Files
deepseek-harness/packages/util/README.md
T
Yichen Jiang c62d6f3a44 refactor(net): make the proxy a util library with six functions
Review asked why this is a plugin and why it exports so much. The design note
this branch shipped answered the second question itself — "a pure resolution
function plus an installation function" — and the code drifted to seventeen
exports and a Cordis plugin nobody approved or mounted.

The plugin is gone. Transport policy has one answer per process: nothing to
swap, and no scope narrower than the process to give one. Its `Config` was also
the only supplier of a configuration branch, so resolution now reads the
environment and nothing else — `mode`, the config-sourced fields, and the
`config` policy source were unreachable the moment the plugin left.

Four exports nothing outside the package used are internal again, and
`currentProxyPolicy` answers with the direct policy instead of `undefined`, so
`DIRECT_POLICY` no longer needs a public face. Nine functions remain, one per
way a caller can need the policy; two is not reachable with six consumer seams.

The package moves to `util/`. The note claimed a dependency on `undici`
disqualified it from that group; the charter governs harness dependencies, not
external ones, and the process note that says so predates this branch. The real
blocker was the harness dependency: resolution needed one method of
`LaunchEnvironmentSnapshot`, so it names a structural `EnvLookup` and the
launcher passes its snapshot unchanged. `net/` is dissolved.

Dropping the group's line from the repository layout also returns `AGENTS.md`
to its original ceiling, so the raise the merge needed is reverted.
2026-09-01 11:01:05 +08:00

3.0 KiB

description, kind
description kind
Package map for shared utilities: atomic file writes, branded ids, deques, JSON values, harness home paths, launch environment, native commands, output retention, time zones, and timeouts. package-group

util/ — shared utilities

English | 中文

Summary

The util/ group gives capability packages shared mechanical primitives instead of duplicate implementations. It covers atomic writes, branded ids, deques, lossless JSON values, UUIDs, Harness-home paths, launch environments, outbound proxy policy, native commands, output retention, time-zone canonicalization, and timeout handling. Every root entry here is a library: it registers no product service or event, and the consuming capability retains the business semantics.

Table of Contents


Packages

Each package provides one primitive; open a package page for how to use it.

Package Role
brand/ Nominal string types and their stateless constructor
crypto/ Mints RFC 9562 v4 UUIDs from the cross-runtime crypto.getRandomValues primitive
deque/ Provides amortized constant-time queue operations with bounded vacant storage
values/ Validates, snapshots, compares, and freezes lossless JSON-compatible values
home-paths/ Resolves the single Harness home and joins shared user-data paths
http-proxy/ Resolves one outbound proxy policy and installs it for fetch, SDK agents, and spawned children
launch-environment/ Frozen launch environment that remembers which layer supplied each value
atomic-write/ Atomic file replacement and cross-process writer locking
native-command/ Runs host-native commands directly, never through a shell string
workspace-path/ Provides browser-safe Workspace path and display helpers
output-retention/ Bounds model-facing output and reports exact omission metadata
time/ Validates and canonicalizes a caller-reported IANA time zone
timeout/ Deadline arithmetic, signal fusion, and timeout-versus-cancel classification

Dev Note

Working context for maintainers — click to expand

None.