@deepseek-ai/dsh-credentials-local 0.1.5-rc.2 → 0.1.6-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/credentials/credentials-local/README.md
5
- README.md: 5c343834ae77dc1623dac37d9f6c5b687e509421
6
- README.zh.md: 08b87022d7824bc920ca23875caa669c6506637f
5
+ README.md: 94d06bc48ec92630bfdd885353592a34f80dc249
6
+ README.zh.md: 64566fe46202b8064df5cd5677904e46e97f96ac
package/README.md CHANGED
@@ -149,11 +149,11 @@ This section explains the design decisions behind the provider and points at the
149
149
 
150
150
  `resolve` and `describe` read the inherited environment snapshot, the parsed document snapshot, and the `.env` fallbacks in precedence order. `set`/`unset` queue onto one exclusive operation chain: entry checks reject early (disposed, empty value, environment-shadowed), and the queue re-judges them at run time before a read-modify-write under the writer lock commits and fires `credentials/reference-updated` exactly once.
151
151
 
152
- `modifyRecord` runs on the same chain and lock: it re-reads the document, shows the mutation the record as it stands, admits the result — a non-empty api key, a grant payload that survives a JSON round trip — renders the record wholesale, and commits, firing `credentials/record-updated` once. A composition the product CLI did not boot has only the inherited environment as its layer.
152
+ `modifyRecord` runs on the same chain and lock: it re-reads the document, passes the record as it stands to the mutation, admits the result — a non-empty API key, a grant payload that survives a JSON round trip — renders the record wholesale, and commits, firing `credentials/record-updated` once. A composition the product CLI did not boot has only the inherited environment as its layer.
153
153
 
154
154
  ### Reload lifecycle
155
155
 
156
- A watcher event or the ready reconcile queues a refresh behind the same chain. `reconcileFromDisk` re-checks permissions, re-reads the text, replaces both snapshots wholesale when the text differs, and publishes one event per changed reference or record; content equal to the text cache — including the provider's own writes — is a no-op. Disposal sets the closed flag, stops accepting events, closes the watcher, and waits out queued operations so nothing publishes after teardown.
156
+ A watcher event or the ready-time reconciliation queues a refresh behind the same chain. `reconcileFromDisk` re-checks permissions, re-reads the text, replaces both snapshots wholesale when the text differs, and publishes one event per changed reference or record; content equal to the text cache — including the provider's own writes — is a no-op. Disposal sets the closed flag, stops accepting events, closes the watcher, and waits out queued operations so nothing publishes after teardown.
157
157
 
158
158
  ### Document versioning
159
159
 
package/README.zh.md CHANGED
@@ -29,7 +29,7 @@ kind: "package-reference"
29
29
 
30
30
  ### 何时使用
31
31
 
32
- 把它作为默认本地存储:产品的 base 组合会加载它,你通过配置界面保存的密钥会立即生效。当部署必须让提供方密钥远离自身 agent 时选择其他存储——文件权限做不到这一点,因为 agent 的工具进程以你的 OS 用户身份运行(见「谁能读取该文件」)。
32
+ 把它作为默认本地存储:产品的基础组合会加载它,你通过配置界面保存的密钥会立即生效。当部署必须让提供方密钥远离自身 agent 时选择其他存储——文件权限做不到这一点,因为 agent 的工具进程以你的 OS 用户身份运行(见「谁能读取该文件」)。
33
33
 
34
34
  ### 设置
35
35
 
@@ -46,7 +46,7 @@ kind: "package-reference"
46
46
  | `watch` | `true` | 文件在磁盘上变化时自动重载 |
47
47
  | `debounceMs` | `100` | 变化后等待这么久再重载,单位为毫秒 |
48
48
 
49
- 生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-credentials-local)是每个受支持字段及其 JSDoc 的穷尽式真源。
49
+ 生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-credentials-local)完整列出了所有受支持字段及其 JSDoc,是这些信息的真源。
50
50
 
51
51
  ### 存储与移除密钥
52
52
 
@@ -106,7 +106,7 @@ records:
106
106
  kind: api-key # neither: the owner confirmed the ambient credential chain
107
107
  ```
108
108
 
109
- 你可以直接编辑该文件——存储会自动重载并接收变更,包括你删除的密钥或记录。`refs` 按环境变量名存放密钥值;`records` 按 `<owner>/<id>` 存放按插件凭据,每条都带 `api-key` 或 `grant` 标签,其中 grant 的 payload 由存储逐字保留,因为只有它的拥有者能解释。产品写入时会保留注释与未触及条目的排版;直接位于某条目上方的注释属于该条目的注解,会随它一起删除。文件只存放凭据,因此任何其他内容都会被明确拒绝,而不是被静默忽略:非 mapping 的根、未知的顶层键、在其键空间内不可寻址的键、类型错误或空的值、未知的记录标签或字段、重复键以及格式错误的 YAML 都会在启动时失败;运行期热重载时则保留最后可用内容并告警。
109
+ 你可以直接编辑该文件——存储会自动重载并接收变更,包括你删除的密钥或记录。`refs` 按环境变量名存放密钥值;`records` 按 `<owner>/<id>` 存放各插件的凭据,每条都带 `api-key` 或 `grant` 标签,其中 grant 的 payload 由存储逐字保留,因为只有它的拥有者能解释。产品写入时会保留注释与未触及条目的排版;直接位于某条目上方的注释属于该条目的注解,会随它一起删除。文件只存放凭据,因此任何其他内容都会被明确拒绝,而不是被静默忽略:非 mapping 的根、未知的顶层键、在其键空间内不可寻址的键、类型错误或空的值、未知的记录标签或字段、重复键以及格式错误的 YAML 都会在启动时失败;运行期热重载时则保留最后可用内容并告警。
110
110
 
111
111
  密钥的值可以是任意文本,包括多行值——不需要任何引号技巧。空值等于「没有密钥」,这正是文件中的空字符串被拒绝的原因:移除密钥是删除它,而不是把它置空。`grant` 的 payload 必须经受 JSON 往返,进出两个方向都会强制这一点,因此存储会拒绝无法逐字读回的值。如果磁盘上的文件已无法解析,保存会失败,而不是覆盖产品读不懂的内容。
112
112
 
@@ -118,7 +118,7 @@ records:
118
118
 
119
119
  - **启动环境提供的密钥是只读的**——`DEEPSEEK_API_KEY=… dsh` 在本轮运行中优先,保存或移除它都会被拒绝。请先在启动 shell 中清除该变量。
120
120
  - **空值无法保存**——存储空字符串会被拒绝;请改为移除密钥。
121
- - **存储拒绝加载它无法信任的文件**——任何其他用户可读的文件、格式错误的 YAML 或无法到达的路径都会在启动时失败;运行期热重载则保留最后可用内容并告警。
121
+ - **存储拒绝加载它无法信任的文件**——任何其他用户可读的文件、格式错误的 YAML 或无法访问的路径都会在启动时失败;运行期热重载则保留最后可用内容并告警。
122
122
  - **同一时刻的修改都会被保留**——如果你在产品写入的同时编辑文件,你的变更会被并入,而不是被覆盖。
123
123
 
124
124
  -----
@@ -136,24 +136,24 @@ records:
136
136
  - **一套明确的优先级。** 继承环境优先,因为它是本次运行的明确意图且无法从进程内部修改;它之下的所有来源都输给受管存储,因此已存密钥永远不会被陈旧的 `.env` 挤掉。
137
137
  - **文档只存放凭据。** 它是带 `refs` 与 `records` 分节的版本化文档,而不是 dotenv 文件:一个 harness 拥有、且绝不物化进环境的存储,不能同时充当用户的环境层,否则会以自己的优先级遮蔽非机密条目。
138
138
  - **写入打补丁,重载整体替换。** 行编辑在跨进程写锁下保留注释与未触及条目;重载整体交换解析后的快照,已删除条目绝不在内存滞留。
139
- - **信任攸关处明确报错。** 启动与重载都会拒绝不可读、无效或可被属主之外读取的文档;失败的活动重载保留最后可用快照并告警,而不是拖垮进程。
139
+ - **信任攸关处明确报错。** 启动与重载都会拒绝不可读、无效或可被属主之外读取的文档;运行期重载失败时会保留最后可用快照并告警,而不是拖垮进程。
140
140
 
141
141
  ### 源码地图
142
142
 
143
143
  | 文件 | 职责 |
144
144
  |---|---|
145
145
  | [`src/index.ts`](src/index.ts) | 提供方:层解析、严格文档解析、写锁下的引用与记录写路径、watcher 生命周期、权限检查 |
146
- | — | 不发布运行时不变式伴生入口;事件生命周期约定归 seam 伴生插件。 |
146
+ | — | 未发布运行时不变式配套入口;Service Definition 的配套入口(`dsh-credentials/invariant`)负责 `credentials/reference-updated` 生命周期约定;本提供方的文件与环境分层属于异步 I/O,并由其单元测试套件加以约束。 |
147
147
 
148
148
  ### 解析与写入路径
149
149
 
150
150
  `resolve` 与 `describe` 按优先级顺序读取继承环境快照、已解析文档快照与 `.env` 后备层。`set`/`unset` 排入同一条独占操作链:入口检查提前拒绝(已释放、空值、被环境遮蔽),队列在运行时会重新判定,随后在写锁下执行读-改-写、提交,并恰好触发一次 `credentials/reference-updated`。
151
151
 
152
- `modifyRecord` 走同一条链与同一把锁:它重新读取文档、把当前记录交给变更函数、准入其结果——非空的 api key、能经受 JSON 往返的 grant payload——整体渲染该记录并提交,恰好触发一次 `credentials/record-updated`。并非由产品 CLI 启动的组合只有继承环境这一层。
152
+ `modifyRecord` 走同一条链与同一把锁:它重新读取文档、把当前记录交给变更函数、准入其结果——非空的 API 密钥、能经受 JSON 往返的 grant payload——整体渲染该记录并提交,恰好触发一次 `credentials/record-updated`。并非由产品 CLI(命令行界面)启动的组合只有继承环境这一层。
153
153
 
154
154
  ### 重载生命周期
155
155
 
156
- watcher 事件或 ready 对账把一次刷新排到同一链条之后。`reconcileFromDisk` 重新检查权限、重读文本,文本有差异时整体替换两个快照,并按变更引用或记录逐个发布事件;与文本缓存一致的内容——包括提供方自己的写入——是 no-op。释放时设置 closed 标志、停止接收事件、关闭 watcher,并等待排队操作结算完毕,确保 teardown 之后不再有任何发布。
156
+ watcher 事件或就绪时的对账会将一次刷新排到同一链条之后。`reconcileFromDisk` 重新检查权限、重读文本,文本有差异时整体替换两个快照,并按变更引用或记录逐个发布事件;与文本缓存一致的内容——包括提供方自己的写入——是 no-op。释放时设置关闭标志、停止接收事件、关闭 watcher,并等待排队操作结算完毕,确保资源销毁后不再发布任何事件。
157
157
 
158
158
  ### 文档版本化
159
159
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-credentials-local",
3
3
  "description": "File-backed credentials provider ($DSH_HOME/.env under the live process environment) for the DeepSeek Harness",
4
- "version": "0.1.5-rc.2",
4
+ "version": "0.1.6-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,10 +27,10 @@
27
27
  ],
28
28
  "license": "MIT",
29
29
  "peerDependencies": {
30
- "@deepseek-ai/dsh-atomic-write": "^0.1.5-rc.2",
31
- "@deepseek-ai/dsh-credentials": "^0.1.5-rc.2",
32
- "@deepseek-ai/dsh-launch-environment": "^0.1.5-rc.2",
33
- "@deepseek-ai/dsh-home-paths": "^0.1.5-rc.2",
30
+ "@deepseek-ai/dsh-atomic-write": "^0.1.6-alpha.1",
31
+ "@deepseek-ai/dsh-credentials": "^0.1.6-alpha.1",
32
+ "@deepseek-ai/dsh-launch-environment": "^0.1.6-alpha.1",
33
+ "@deepseek-ai/dsh-home-paths": "^0.1.6-alpha.1",
34
34
  "@deepseek-ai/cordis": "^4.0.2"
35
35
  },
36
36
  "dependencies": {
@@ -39,10 +39,10 @@
39
39
  "@deepseek-ai/schemastery": "^3.18.2"
40
40
  },
41
41
  "devDependencies": {
42
- "@deepseek-ai/dsh-atomic-write": "^0.1.5-rc.2",
43
- "@deepseek-ai/dsh-credentials": "^0.1.5-rc.2",
44
- "@deepseek-ai/dsh-launch-environment": "^0.1.5-rc.2",
45
- "@deepseek-ai/dsh-home-paths": "^0.1.5-rc.2",
42
+ "@deepseek-ai/dsh-atomic-write": "^0.1.6-alpha.1",
43
+ "@deepseek-ai/dsh-credentials": "^0.1.6-alpha.1",
44
+ "@deepseek-ai/dsh-launch-environment": "^0.1.6-alpha.1",
45
+ "@deepseek-ai/dsh-home-paths": "^0.1.6-alpha.1",
46
46
  "@deepseek-ai/cordis": "^4.0.2"
47
47
  }
48
48
  }