Files
deepseek-harness/packages/util/README.zh.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

2.7 KiB

description, kind
description kind
共享工具家族的包映射:原子文件写入、品牌化 id、双端队列、JSON 值、harness 主目录路径、启动环境、原生命令、输出保留、时区与超时。 package-group

util/:共享工具

English | 中文

概述

util/ 组为能力包提供共享的机制原语,避免重复实现。它涵盖原子写入、品牌化 id、双端队列、无损 JSON 值、UUID、Harness home 路径、启动环境、出站代理策略、原生命令、输出保留、时区规范化和超时处理。这里的每个根入口都是库:它不注册产品服务或事件,业务语义仍由消费它的能力负责。

目录


每个包提供一个原语;打开对应包页面了解如何使用。

职责
brand/ 提供名义字符串类型及其无状态构造函数
crypto/ 基于跨运行时 crypto.getRandomValues 原语生成 RFC 9562 v4 UUID
deque/ 提供摊销常数时间的队列操作和有界空闲存储
values/ 校验、创建快照、比较和冻结无损 JSON 兼容值
home-paths/ 解析统一的 Harness 主目录并拼接共享的用户数据路径
http-proxy/ 解析出唯一的出站代理策略,并为 fetch、SDK agent 与派生子进程安装它
launch-environment/ 冻结的启动环境,记住每个值来自哪一层
atomic-write/ 原子文件替换与跨进程写锁
native-command/ 直接运行宿主原生命令,绝不拼 shell 字符串
workspace-path/ 提供浏览器安全的 Workspace 路径与显示辅助函数
output-retention/ 限制面向模型的输出并报告精确的省略元数据
time/ 校验并规范化调用方所报的 IANA 时区
timeout/ 截止时间运算、信号融合与超时/取消分类

相关文档

开发备注

维护者的工作上下文——点击展开

无。