better-dsh 0.2.3-e → 0.2.3-g

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.
Files changed (270) hide show
  1. package/docs/50_test-reports/2026-09-13-preact-ui-shell/345/256/236/346/265/213/346/212/245/345/221/212.md +1 -1
  2. package/docs/50_test-reports/2026-09-14-4999-skill/346/270/205/345/215/225/344/270/216lsp-gate/345/256/236/346/265/213/346/212/245/345/221/212.md +54 -0
  3. package/docs/specs/agent/spec.md +54 -0
  4. package/docs/specs/ast/spec.md +34 -0
  5. package/docs/specs/compaction-recall/spec.md +46 -0
  6. package/docs/specs/ctx/spec.md +107 -0
  7. package/docs/specs/dsh/spec.md +47 -0
  8. package/docs/specs/dvc/spec.md +87 -0
  9. package/docs/specs/escalation-guidance/spec.md +44 -0
  10. package/docs/specs/fs-scheme-resolution/spec.md +37 -0
  11. package/docs/specs/hash-edit/spec.md +41 -0
  12. package/docs/specs/http-read/spec.md +73 -0
  13. package/docs/specs/kernel-provisioning/spec.md +53 -0
  14. package/docs/specs/lsp/spec.md +121 -0
  15. package/docs/specs/mobile-layout/spec.md +108 -0
  16. package/docs/specs/model-failover/spec.md +20 -0
  17. package/docs/specs/preact-ui-shell/spec.md +22 -0
  18. package/docs/specs/repl-dispatch-resilience/spec.md +21 -0
  19. package/docs/specs/skill/spec.md +58 -0
  20. package/docs/specs/tool-surface/spec.md +222 -0
  21. package/docs/specs/url-schema/spec.md +148 -0
  22. package/docs/specs/web-trust-fence/spec.md +43 -0
  23. package/dsh-docs/AGENTS.md +75 -0
  24. package/dsh-docs/agent-lifecycle.md +84 -0
  25. package/dsh-docs/agent-lifecycle.zh.md +86 -0
  26. package/dsh-docs/api-gateway.md +164 -0
  27. package/dsh-docs/api-gateway.zh.md +164 -0
  28. package/dsh-docs/architecture.md +150 -0
  29. package/dsh-docs/architecture.zh.md +154 -0
  30. package/dsh-docs/capability-seams.md +543 -0
  31. package/dsh-docs/capability-seams.zh.md +545 -0
  32. package/dsh-docs/config-catalog.md +3473 -0
  33. package/dsh-docs/config-catalog.zh.md +3474 -0
  34. package/dsh-docs/cookbook/adding-a-package.md +117 -0
  35. package/dsh-docs/cookbook/adding-a-package.zh.md +119 -0
  36. package/dsh-docs/cookbook/adding-a-remote-api.md +197 -0
  37. package/dsh-docs/cookbook/adding-a-remote-api.zh.md +197 -0
  38. package/dsh-docs/cookbook/adding-a-settings-card.md +102 -0
  39. package/dsh-docs/cookbook/adding-a-settings-card.zh.md +102 -0
  40. package/dsh-docs/cookbook/adding-a-tool.md +101 -0
  41. package/dsh-docs/cookbook/adding-a-tool.zh.md +103 -0
  42. package/dsh-docs/cookbook/adding-a-vendored-package.md +59 -0
  43. package/dsh-docs/cookbook/adding-a-vendored-package.zh.md +59 -0
  44. package/dsh-docs/cookbook/adding-an-llm-adapter.md +43 -0
  45. package/dsh-docs/cookbook/adding-an-llm-adapter.zh.md +43 -0
  46. package/dsh-docs/cookbook/extension-cookbook.md +132 -0
  47. package/dsh-docs/cookbook/extension-cookbook.zh.md +136 -0
  48. package/dsh-docs/cookbook/maintaining-dsh-code-review.md +64 -0
  49. package/dsh-docs/cookbook/maintaining-dsh-code-review.zh.md +64 -0
  50. package/dsh-docs/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
  51. package/dsh-docs/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
  52. package/dsh-docs/cordis-api/context.md +364 -0
  53. package/dsh-docs/cordis-api/context.zh.md +366 -0
  54. package/dsh-docs/cordis-api/events.md +207 -0
  55. package/dsh-docs/cordis-api/events.zh.md +209 -0
  56. package/dsh-docs/cordis-api/fiber.md +375 -0
  57. package/dsh-docs/cordis-api/fiber.zh.md +377 -0
  58. package/dsh-docs/cordis-api/inherited.md +39 -0
  59. package/dsh-docs/cordis-api/registry.md +152 -0
  60. package/dsh-docs/cordis-api/registry.zh.md +154 -0
  61. package/dsh-docs/cordis-api/service.md +102 -0
  62. package/dsh-docs/cordis-api/service.zh.md +104 -0
  63. package/dsh-docs/cordis-primer.md +45 -0
  64. package/dsh-docs/cordis-primer.zh.md +51 -0
  65. package/dsh-docs/cordis-tutorial/01-first-plugin.md +95 -0
  66. package/dsh-docs/cordis-tutorial/01-first-plugin.zh.md +95 -0
  67. package/dsh-docs/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
  68. package/dsh-docs/cordis-tutorial/02-lifecycle-and-effects.zh.md +98 -0
  69. package/dsh-docs/cordis-tutorial/03-services.md +98 -0
  70. package/dsh-docs/cordis-tutorial/03-services.zh.md +98 -0
  71. package/dsh-docs/cordis-tutorial/04-events.md +144 -0
  72. package/dsh-docs/cordis-tutorial/04-events.zh.md +144 -0
  73. package/dsh-docs/cordis-tutorial/05-config.md +84 -0
  74. package/dsh-docs/cordis-tutorial/05-config.zh.md +84 -0
  75. package/dsh-docs/cordis-tutorial/06-composition-and-hmr.md +113 -0
  76. package/dsh-docs/cordis-tutorial/06-composition-and-hmr.zh.md +113 -0
  77. package/dsh-docs/cordis-tutorial/07-into-the-harness.md +108 -0
  78. package/dsh-docs/cordis-tutorial/07-into-the-harness.zh.md +108 -0
  79. package/dsh-docs/cordis-tutorial/index.md +60 -0
  80. package/dsh-docs/cordis-tutorial/index.zh.md +62 -0
  81. package/dsh-docs/deepseek-llm-api-wire-extensions.md +163 -0
  82. package/dsh-docs/deepseek-llm-api-wire-extensions.zh.md +163 -0
  83. package/dsh-docs/defensive-patterns.md +33 -0
  84. package/dsh-docs/defensive-patterns.zh.md +35 -0
  85. package/dsh-docs/development.md +167 -0
  86. package/dsh-docs/development.zh.md +173 -0
  87. package/dsh-docs/event-producer-consumer.md +86 -0
  88. package/dsh-docs/event-producer-consumer.zh.md +88 -0
  89. package/dsh-docs/glossary.md +45 -0
  90. package/dsh-docs/glossary.zh.md +45 -0
  91. package/dsh-docs/graph-atlas.md +22 -0
  92. package/dsh-docs/graph-atlas.zh.md +24 -0
  93. package/dsh-docs/i18n/README.md +60 -0
  94. package/dsh-docs/i18n/README.zh.md +62 -0
  95. package/dsh-docs/i18n/style-samples.md +87 -0
  96. package/dsh-docs/i18n/terminology.md +214 -0
  97. package/dsh-docs/i18n/translation-prompt.md +263 -0
  98. package/dsh-docs/i18n/translation-rules.md +69 -0
  99. package/dsh-docs/i18n/translation-rules.zh.md +69 -0
  100. package/dsh-docs/module-graph.md +1411 -0
  101. package/dsh-docs/module-graph.zh.md +1413 -0
  102. package/dsh-docs/persistence-catalog.md +1075 -0
  103. package/dsh-docs/persistence-catalog.zh.md +1077 -0
  104. package/dsh-docs/postmortem/0001-acp-default-export-drops-inject.md +113 -0
  105. package/dsh-docs/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
  106. package/dsh-docs/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
  107. package/dsh-docs/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
  108. package/dsh-docs/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
  109. package/dsh-docs/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
  110. package/dsh-docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
  111. package/dsh-docs/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
  112. package/dsh-docs/postmortem/README.md +18 -0
  113. package/dsh-docs/postmortem/README.zh.md +18 -0
  114. package/dsh-docs/rescope.md +53 -0
  115. package/dsh-docs/rescope.zh.md +53 -0
  116. package/dsh-docs/subsystems/README.md +61 -0
  117. package/dsh-docs/subsystems/README.zh.md +61 -0
  118. package/dsh-docs/subsystems/agent-team.md +207 -0
  119. package/dsh-docs/subsystems/agent-team.zh.md +207 -0
  120. package/dsh-docs/subsystems/approval.md +170 -0
  121. package/dsh-docs/subsystems/approval.zh.md +170 -0
  122. package/dsh-docs/subsystems/attachment.md +351 -0
  123. package/dsh-docs/subsystems/attachment.zh.md +351 -0
  124. package/dsh-docs/subsystems/client-modules.md +168 -0
  125. package/dsh-docs/subsystems/client-modules.zh.md +168 -0
  126. package/dsh-docs/subsystems/code-runtime.md +195 -0
  127. package/dsh-docs/subsystems/code-runtime.zh.md +195 -0
  128. package/dsh-docs/subsystems/commands.md +219 -0
  129. package/dsh-docs/subsystems/commands.zh.md +219 -0
  130. package/dsh-docs/subsystems/compaction.md +238 -0
  131. package/dsh-docs/subsystems/compaction.zh.md +238 -0
  132. package/dsh-docs/subsystems/conversation.md +258 -0
  133. package/dsh-docs/subsystems/conversation.zh.md +258 -0
  134. package/dsh-docs/subsystems/core.md +1209 -0
  135. package/dsh-docs/subsystems/core.zh.md +1219 -0
  136. package/dsh-docs/subsystems/credentials.md +329 -0
  137. package/dsh-docs/subsystems/credentials.zh.md +329 -0
  138. package/dsh-docs/subsystems/extensions.md +382 -0
  139. package/dsh-docs/subsystems/extensions.zh.md +382 -0
  140. package/dsh-docs/subsystems/feedback.md +266 -0
  141. package/dsh-docs/subsystems/feedback.zh.md +266 -0
  142. package/dsh-docs/subsystems/filesystem.md +505 -0
  143. package/dsh-docs/subsystems/filesystem.zh.md +505 -0
  144. package/dsh-docs/subsystems/goal.md +277 -0
  145. package/dsh-docs/subsystems/goal.zh.md +277 -0
  146. package/dsh-docs/subsystems/invariants.md +88 -0
  147. package/dsh-docs/subsystems/invariants.zh.md +88 -0
  148. package/dsh-docs/subsystems/jobs.md +290 -0
  149. package/dsh-docs/subsystems/jobs.zh.md +290 -0
  150. package/dsh-docs/subsystems/llm-streaming.md +1080 -0
  151. package/dsh-docs/subsystems/llm-streaming.zh.md +1086 -0
  152. package/dsh-docs/subsystems/lsp.md +202 -0
  153. package/dsh-docs/subsystems/lsp.zh.md +202 -0
  154. package/dsh-docs/subsystems/permission-presets.md +131 -0
  155. package/dsh-docs/subsystems/permission-presets.zh.md +131 -0
  156. package/dsh-docs/subsystems/persistence.md +395 -0
  157. package/dsh-docs/subsystems/persistence.zh.md +395 -0
  158. package/dsh-docs/subsystems/plan.md +87 -0
  159. package/dsh-docs/subsystems/plan.zh.md +87 -0
  160. package/dsh-docs/subsystems/sandbox.md +220 -0
  161. package/dsh-docs/subsystems/sandbox.zh.md +220 -0
  162. package/dsh-docs/subsystems/schedule.md +192 -0
  163. package/dsh-docs/subsystems/schedule.zh.md +192 -0
  164. package/dsh-docs/subsystems/scope.md +59 -0
  165. package/dsh-docs/subsystems/scope.zh.md +59 -0
  166. package/dsh-docs/subsystems/session-projection.md +354 -0
  167. package/dsh-docs/subsystems/session-projection.zh.md +354 -0
  168. package/dsh-docs/subsystems/session-query.md +509 -0
  169. package/dsh-docs/subsystems/session-query.zh.md +509 -0
  170. package/dsh-docs/subsystems/session-reference.md +219 -0
  171. package/dsh-docs/subsystems/session-reference.zh.md +219 -0
  172. package/dsh-docs/subsystems/session-telemetry.md +194 -0
  173. package/dsh-docs/subsystems/session-telemetry.zh.md +194 -0
  174. package/dsh-docs/subsystems/session-title.md +204 -0
  175. package/dsh-docs/subsystems/session-title.zh.md +204 -0
  176. package/dsh-docs/subsystems/session.md +1155 -0
  177. package/dsh-docs/subsystems/session.zh.md +1159 -0
  178. package/dsh-docs/subsystems/settings.md +405 -0
  179. package/dsh-docs/subsystems/settings.zh.md +405 -0
  180. package/dsh-docs/subsystems/shell.md +303 -0
  181. package/dsh-docs/subsystems/shell.zh.md +303 -0
  182. package/dsh-docs/subsystems/skills.md +354 -0
  183. package/dsh-docs/subsystems/skills.zh.md +354 -0
  184. package/dsh-docs/subsystems/slots.md +175 -0
  185. package/dsh-docs/subsystems/slots.zh.md +175 -0
  186. package/dsh-docs/subsystems/spill.md +117 -0
  187. package/dsh-docs/subsystems/spill.zh.md +117 -0
  188. package/dsh-docs/subsystems/storage.md +260 -0
  189. package/dsh-docs/subsystems/storage.zh.md +260 -0
  190. package/dsh-docs/subsystems/subagent.md +766 -0
  191. package/dsh-docs/subsystems/subagent.zh.md +770 -0
  192. package/dsh-docs/subsystems/subprocess.md +324 -0
  193. package/dsh-docs/subsystems/subprocess.zh.md +324 -0
  194. package/dsh-docs/subsystems/system-prompt.md +220 -0
  195. package/dsh-docs/subsystems/system-prompt.zh.md +220 -0
  196. package/dsh-docs/subsystems/terminal.md +184 -0
  197. package/dsh-docs/subsystems/terminal.zh.md +184 -0
  198. package/dsh-docs/subsystems/todo.md +32 -0
  199. package/dsh-docs/subsystems/todo.zh.md +32 -0
  200. package/dsh-docs/subsystems/token-meter.md +105 -0
  201. package/dsh-docs/subsystems/token-meter.zh.md +105 -0
  202. package/dsh-docs/subsystems/tools.md +720 -0
  203. package/dsh-docs/subsystems/tools.zh.md +720 -0
  204. package/dsh-docs/subsystems/typert.md +343 -0
  205. package/dsh-docs/subsystems/typert.zh.md +343 -0
  206. package/dsh-docs/subsystems/user-questions.md +178 -0
  207. package/dsh-docs/subsystems/user-questions.zh.md +178 -0
  208. package/dsh-docs/subsystems/web-client.md +95 -0
  209. package/dsh-docs/subsystems/web-client.zh.md +95 -0
  210. package/dsh-docs/subsystems/web-server.md +154 -0
  211. package/dsh-docs/subsystems/web-server.zh.md +154 -0
  212. package/dsh-docs/subsystems/web.md +206 -0
  213. package/dsh-docs/subsystems/web.zh.md +206 -0
  214. package/dsh-docs/subsystems/webhook.md +70 -0
  215. package/dsh-docs/subsystems/webhook.zh.md +70 -0
  216. package/dsh-docs/subsystems/workflow.md +278 -0
  217. package/dsh-docs/subsystems/workflow.zh.md +278 -0
  218. package/dsh-docs/subsystems/workspace.md +321 -0
  219. package/dsh-docs/subsystems/workspace.zh.md +321 -0
  220. package/dsh-docs/testing.md +54 -0
  221. package/dsh-docs/testing.zh.md +54 -0
  222. package/dsh-docs/tool-catalog.md +2225 -0
  223. package/dsh-docs/tool-catalog.zh.md +2233 -0
  224. package/dsh-docs/tool-execution-pipeline.md +62 -0
  225. package/dsh-docs/tool-execution-pipeline.zh.md +64 -0
  226. package/dsh-docs/user/develop/basic/config.md +106 -0
  227. package/dsh-docs/user/develop/basic/config.zh.md +106 -0
  228. package/dsh-docs/user/develop/basic/index.md +144 -0
  229. package/dsh-docs/user/develop/basic/index.zh.md +144 -0
  230. package/dsh-docs/user/develop/basic/publish.md +183 -0
  231. package/dsh-docs/user/develop/basic/publish.zh.md +183 -0
  232. package/dsh-docs/user/develop/basic/tool.md +52 -0
  233. package/dsh-docs/user/develop/basic/tool.zh.md +52 -0
  234. package/dsh-docs/user/develop/framework/events.md +143 -0
  235. package/dsh-docs/user/develop/framework/events.zh.md +143 -0
  236. package/dsh-docs/user/develop/framework/index.md +137 -0
  237. package/dsh-docs/user/develop/framework/index.zh.md +137 -0
  238. package/dsh-docs/user/develop/framework/service.md +148 -0
  239. package/dsh-docs/user/develop/framework/service.zh.md +150 -0
  240. package/dsh-docs/user/develop/practice/dynamic-cordis.md +15 -0
  241. package/dsh-docs/user/develop/practice/dynamic-cordis.zh.md +15 -0
  242. package/dsh-docs/user/develop/practice/index.md +155 -0
  243. package/dsh-docs/user/develop/practice/index.zh.md +155 -0
  244. package/dsh-docs/user/develop/practice/llm-adapter.md +189 -0
  245. package/dsh-docs/user/develop/practice/llm-adapter.zh.md +189 -0
  246. package/dsh-docs/user/guide/github-review.md +102 -0
  247. package/dsh-docs/user/guide/github-review.zh.md +102 -0
  248. package/dsh-docs/user/guide/index.md +30 -0
  249. package/dsh-docs/user/guide/index.zh.md +30 -0
  250. package/dsh-docs/user/guide/mcp-memory.md +101 -0
  251. package/dsh-docs/user/guide/mcp-memory.zh.md +101 -0
  252. package/dsh-docs/user/guide/network-proxy.md +85 -0
  253. package/dsh-docs/user/guide/network-proxy.zh.md +85 -0
  254. package/dsh-docs/user/guide/providers.md +190 -0
  255. package/dsh-docs/user/guide/providers.zh.md +190 -0
  256. package/dsh-docs/user/guide/python-sdk.md +150 -0
  257. package/dsh-docs/user/guide/python-sdk.zh.md +150 -0
  258. package/dsh-docs/user/guide/schedule.md +21 -0
  259. package/dsh-docs/user/guide/schedule.zh.md +21 -0
  260. package/dsh-docs/user/index.md +11 -0
  261. package/dsh-docs/user/index.zh.md +11 -0
  262. package/dsh-docs/web-styling.md +29 -0
  263. package/dsh-docs/web-styling.zh.md +29 -0
  264. package/lib/client/index.js +268 -38
  265. package/lib/fs-aware/sandbox-plugin.js +1 -1
  266. package/lib/index.js +1112 -1261
  267. package/lib/lsp-server-registry-B8DNonhS.js +3 -0
  268. package/lib/lsp-server-registry-BexQagaK.js +943 -0
  269. package/lib/{wrap-DC8O3SYz.js → wrap-JFjcWwZf.js} +42 -16
  270. package/package.json +2 -1
@@ -0,0 +1,329 @@
1
+ # User Credentials
2
+
3
+ English | [中文](credentials.zh.md)
4
+
5
+ The credential seam of [dsh-credentials](../../packages/credentials/credentials) keeps secrets out of configuration: settings sections and `cordis.yml` entries carry *references* (environment-variable names), providers such as [dsh-credentials-local](../../packages/credentials/credentials-local) own the values, and consumers resolve a reference once per operation — the LLM adapters resolve once per model request, so a rotated credential reaches the very next request without any restart. One seam-wide rule binds every provider: an empty stored value is absent everywhere.
6
+
7
+ Source: [`packages/credentials/credentials/src/index.ts`](../../packages/credentials/credentials/src/index.ts)
8
+
9
+ ## Identity
10
+
11
+ A reference names one credential as a POSIX-style environment-variable name. The brand prevents callers from mixing credential references with other strings passed between packages or processes; construction validates the shell-identifier syntax.
12
+
13
+ ```ts type-equiv
14
+ /** Nominal reference to one credential: a POSIX-style environment-variable name. */
15
+ type CredentialRef = Branded<'CredentialRef'>
16
+ ```
17
+
18
+ ## Resolution
19
+
20
+ `resolve(ref)` returns the value with the provider-defined source layer that supplied it, or `undefined` while unconfigured. Consumers re-resolve at each operation and never cache across operations — that per-operation read is the hot-update mechanism.
21
+
22
+ ```ts type-equiv
23
+ /** One resolved credential value and the source layer that supplied it. */
24
+ interface ResolvedCredential {
25
+ /** The non-empty secret value. */
26
+ value: string
27
+ /** Provider-defined source layer id (the local provider uses `env`, `file`, `project-env`, and `user-env`). */
28
+ source: string
29
+ }
30
+ ```
31
+
32
+ ## Description
33
+
34
+ `describe(ref)` answers configuration surfaces without ever exposing a value: whether the reference resolves, from which layer, and whether `set` would currently succeed. The local provider reports a reference supplied by the live process environment as `writable: false` — a write would appear to succeed while resolution kept returning the shadowing value, so the seam rejects it and the UI can render the reference read-only up front.
35
+
36
+ ```ts type-equiv
37
+ /**
38
+ * Source and writability facts for one reference, safe for configuration UIs —
39
+ * never the value. The view has no slot a value could ride in, which is what
40
+ * lets the whole read half cross the Remote wire.
41
+ */
42
+ interface CredentialInfo {
43
+ /** Whether resolving the reference would currently return a value. */
44
+ configured: boolean
45
+ /** Source layer currently supplying the value; absent while unconfigured. */
46
+ source?: string
47
+ /** Whether the active provider can write this reference. */
48
+ writable: boolean
49
+ }
50
+ ```
51
+
52
+ ## Change commits
53
+
54
+ `credentials/reference-updated (ref)` fires after a committed change to a provider-managed source — a `set`, an `unset`, or an external edit observed in storage. Ambient process-environment changes are not observable and never emit. Consumers do not need the event (they re-resolve per operation); it exists for configuration surfaces refreshing a "configured" badge.
55
+
56
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
57
+
58
+ <a id="cordis-surface"></a>
59
+
60
+ ## Cordis API
61
+
62
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
63
+
64
+ <a id="ctxauthorization--authorizationservice"></a>
65
+
66
+ ### `ctx.authorization` — `AuthorizationService`
67
+
68
+ `ctx.authorization`: a registry of credential-obtaining flows, one attempt at a time per key.
69
+
70
+ ```ts cordis-catalog
71
+ /**
72
+ * Offer a way to obtain one credential. One flow per key: two plugins
73
+ * claiming the same key would each write a record in their own format, and
74
+ * whichever ran last would leave the other reading a payload it cannot parse.
75
+ *
76
+ * @param flow - the key it writes, its label, its methods, and its runner.
77
+ * @returns Disposer that withdraws this flow.
78
+ * @throws {AuthorizationError} code `DUPLICATE_FLOW` when the key is already claimed.
79
+ */
80
+ registerFlow(flow: AuthorizationFlow): () => void
81
+
82
+ /**
83
+ * Every registered flow, for a surface listing what can be authorized.
84
+ * @returns one entry per flow, in registration order.
85
+ */
86
+ list(): readonly AuthorizationEntry[]
87
+
88
+ /**
89
+ * One registered flow.
90
+ * @param key - the credential record to ask about.
91
+ * @returns the entry, or undefined when no flow claims that key.
92
+ */
93
+ describe(key: CredentialKey): AuthorizationEntry | undefined
94
+
95
+ /**
96
+ * Withdraw the attempt running for a key, if any. Separate from the
97
+ * request's own signal because a request/response transport answers a Cancel
98
+ * button on a second call, with no handle on the first one's signal.
99
+ * @param key - the credential record whose attempt should stop.
100
+ */
101
+ cancel(key: CredentialKey): void
102
+
103
+ /**
104
+ * Run one attempt to authorize a key, and report how it ended.
105
+ *
106
+ * One attempt per key at a time. A second caller is refused rather than
107
+ * joined: the two would be prompting different humans through the same flow,
108
+ * and the second would answer questions the first was asked.
109
+ *
110
+ * @param request - the key, the method, the surface, and the cancel signal.
111
+ * @returns `authorized` once the flow's record is committed during this
112
+ * attempt and observed, or `cancelled` when the human declined or the
113
+ * caller withdrew.
114
+ * @throws {AuthorizationError} code `NO_FLOW` when nothing claims the key,
115
+ * `UNKNOWN_METHOD` when the named method is not one the flow offers,
116
+ * `ALREADY_IN_FLIGHT` when an attempt is already running for the key, or
117
+ * `NOT_COMMITTED` when the flow resolved without committing a record
118
+ * during the attempt.
119
+ */
120
+ async begin(request: AuthorizationRequest): Promise<AuthorizationOutcome>
121
+ ```
122
+
123
+ Source: [`packages/credentials/authorization/src/index.ts`](../../packages/credentials/authorization/src/index.ts)
124
+
125
+ <a id="ctxcredentials--credentialprovider-abstract-seam"></a>
126
+
127
+ ### `ctx.credentials` — `CredentialProvider` (abstract seam)
128
+
129
+ Abstract credential service over two key spaces that answer two questions.
130
+
131
+ A CredentialRef answers "what is behind this environment-variable name", layered over the process environment, the provider-managed store, and `.env` files. One seam-wide rule binds that half: an empty stored value is absent everywhere — `resolve` skips it, `describe` reports it unconfigured — so a blank never masquerades as a configured secret.
132
+
133
+ A CredentialKey answers "what credential does this plugin hold for this id". Nothing can layer here — an authorization grant has no environment to be read from — so presence of the record is the whole fact, and modifyRecord is the only write path because a correct write depends on the current value (a token refresh is read-decide-replace under one lock).
134
+
135
+ ```ts cordis-catalog
136
+ /**
137
+ * Resolve one reference to its current value. Resolution is per call:
138
+ * consumers re-resolve at each operation and must not cache across
139
+ * operations — that per-operation read is what makes a changed credential
140
+ * reach the next operation without a restart.
141
+ * @param ref - the reference to resolve.
142
+ * @returns the value and its source, or `undefined` while unconfigured.
143
+ */
144
+ abstract resolve(ref: CredentialRef): Promise<ResolvedCredential | undefined>
145
+
146
+ /**
147
+ * Describe one reference for configuration surfaces without exposing the
148
+ * value.
149
+ * @param ref - the reference to describe.
150
+ * @returns configured state, supplying source, and writability.
151
+ */
152
+ abstract describe(ref: CredentialRef): Promise<CredentialInfo>
153
+
154
+ /**
155
+ * Durably store one value in the provider-managed writable source. Rejects
156
+ * while a read-only source shadows the reference — the write would appear
157
+ * to succeed while resolution keeps returning the shadowing value — and
158
+ * rejects an empty value (use {@link unset}).
159
+ * @param ref - the reference to store.
160
+ * @param value - the non-empty secret value.
161
+ */
162
+ abstract set(ref: CredentialRef, value: string): Promise<void>
163
+
164
+ /**
165
+ * Remove one reference from the provider-managed writable source; removing
166
+ * an absent reference is a no-op. Rejects while a read-only source shadows
167
+ * the reference, like {@link set}.
168
+ * @param ref - the reference to remove.
169
+ */
170
+ abstract unset(ref: CredentialRef): Promise<void>
171
+
172
+ /**
173
+ * Read one stored record. The value is returned as its owner wrote it; a
174
+ * {@link GrantRecord} payload is not interpreted on the way out.
175
+ * @param key - the record to read.
176
+ * @returns the record, or `undefined` while none is stored.
177
+ */
178
+ abstract readRecord(key: CredentialKey): Promise<CredentialRecord | undefined>
179
+
180
+ /**
181
+ * Describe one record for configuration surfaces without exposing its value.
182
+ * @param key - the record to describe.
183
+ * @returns presence, discriminant, and writability.
184
+ */
185
+ abstract describeRecord(key: CredentialKey): Promise<CredentialRecordInfo>
186
+
187
+ /**
188
+ * Enumerate every stored record's address and tag. Unlike the reference
189
+ * half, which has no enumeration because configuration surfaces learn which
190
+ * references exist from settings schemas, records have no such discovery
191
+ * path: a surface that cannot list them cannot show what a user is
192
+ * authorized for, nor find an orphan left by an uninstalled plugin.
193
+ * @returns every stored record, values excluded.
194
+ */
195
+ abstract listRecords(): Promise<readonly CredentialRecordEntry[]>
196
+
197
+ /**
198
+ * Serialized read-modify-write over one record — the only write path.
199
+ * `mutate` sees the record as it stands at the moment the write is
200
+ * exclusive, and returning `undefined` leaves the entry untouched. Exclusion
201
+ * holds across processes where the backing store supports it, which is what
202
+ * makes a token refresh safe: two processes rotating one refresh token
203
+ * concurrently would otherwise lose whichever wrote first.
204
+ * @param key - the record to modify.
205
+ * @param mutate - receives the current record and returns its replacement, or `undefined` to leave it.
206
+ * @returns the record after the write, or the current one when `mutate` declined.
207
+ */
208
+ abstract modifyRecord( key: CredentialKey, mutate: (current: CredentialRecord | undefined) => Promise<CredentialRecord | undefined>, ): Promise<CredentialRecord | undefined>
209
+
210
+ /**
211
+ * Remove one record; removing an absent record is a no-op.
212
+ * @param key - the record to remove.
213
+ */
214
+ abstract deleteRecord(key: CredentialKey): Promise<void>
215
+ ```
216
+
217
+ Source: [`packages/credentials/credentials/src/index.ts`](../../packages/credentials/credentials/src/index.ts)
218
+
219
+ <a id="ctxcredentialscontroller--credentialscontroller"></a>
220
+
221
+ ### `ctx.credentialsController` — `CredentialsController`
222
+
223
+ Host service backing the generated `ctx.remote.credentials` namespace. It carries every wire obligation the credential seam itself does not: the batch fan-out bound, the field-by-field view projection, the reference-grammar guard, and the refusal mapping. Secret values cross in one direction only — no method here returns one.
224
+
225
+ ```ts cordis-catalog
226
+ /**
227
+ * Describe several references for one configuration surface. Batched because
228
+ * a settings page describes every reference its rows name at once, and one
229
+ * round trip keeps those rows from settling separately.
230
+ * @param refs - reference names, at most {@link MAX_DESCRIBE_REFS}; a name outside the grammar
231
+ * rejects the whole call as `gateway/bad-request`.
232
+ * @returns one view per requested name, keyed by that name.
233
+ * @throws RemoteError when the request is invalid or no credential provider is mounted.
234
+ */
235
+ @Remote async describe(refs: string[]): Promise<Record<string, CredentialInfo>>
236
+
237
+ /**
238
+ * Store one value from a configuration surface. The value crosses the wire in
239
+ * this direction only: no read path returns it.
240
+ * @param ref - reference name to store under.
241
+ * @param value - the non-empty secret value.
242
+ * @throws RemoteError when the request is invalid, no provider is mounted, or the provider refuses the write.
243
+ */
244
+ @Remote async set(ref: string, value: string): Promise<void>
245
+
246
+ /**
247
+ * Remove one reference from a configuration surface.
248
+ * @param ref - reference name to remove.
249
+ * @throws RemoteError when the request is invalid, no provider is mounted, or the provider refuses the write.
250
+ */
251
+ @Remote async unset(ref: string): Promise<void>
252
+ ```
253
+
254
+ Source: [`packages/api/settings-controller/src/credentials.ts`](../../packages/api/settings-controller/src/credentials.ts)
255
+
256
+ <a id="authorization-events"></a>
257
+
258
+ ### `authorization/*` events
259
+
260
+ <a id="authorizationsettled--emit"></a>
261
+
262
+ #### `authorization/settled` — emit
263
+
264
+ One authorization attempt has finished and released its key. Fires for every terminal outcome, failures included, so a surface watching a key it did not start (a second browser tab) learns the attempt is over.
265
+
266
+ ```ts cordis-catalog
267
+ /**
268
+ * One authorization attempt has finished and released its key. Fires for
269
+ * every terminal outcome, failures included, so a surface watching a key it
270
+ * did not start (a second browser tab) learns the attempt is over.
271
+ * @mode emit
272
+ * @param key - the credential record the finished attempt was authorizing.
273
+ * @param settlement - how it ended, including the `failed` case its caller sees as a thrown error.
274
+ */
275
+ 'authorization/settled'(key: CredentialKey, settlement: AuthorizationSettlement): void
276
+ ```
277
+
278
+ Source: [`packages/credentials/authorization/src/index.ts`](../../packages/credentials/authorization/src/index.ts)
279
+
280
+ <a id="credentials-events"></a>
281
+
282
+ ### `credentials/*` events
283
+
284
+ <a id="credentialsrecord-updated--emit"></a>
285
+
286
+ #### `credentials/record-updated` — emit
287
+
288
+ Committed change to a stored credential record: a `modifyRecord` that wrote, a `deleteRecord` that removed, or an external edit observed in storage. Separate from `credentials/reference-updated` because the two key grammars are disjoint — a listener that received both on one event could not tell which space a subject belongs to. Listener failures are contained on the same terms as `credentials/reference-updated`.
289
+
290
+ ```ts cordis-catalog
291
+ /**
292
+ * Committed change to a stored credential record: a `modifyRecord` that
293
+ * wrote, a `deleteRecord` that removed, or an external edit observed in
294
+ * storage. Separate from `credentials/reference-updated` because the two key
295
+ * grammars are disjoint — a listener that received both on one event could
296
+ * not tell which space a subject belongs to. Listener failures are
297
+ * contained on the same terms as `credentials/reference-updated`.
298
+ * @param key - the record whose stored value changed.
299
+ * @mode emit
300
+ */
301
+ 'credentials/record-updated'(key: CredentialKey): void
302
+ ```
303
+
304
+ Source: [`packages/credentials/credentials/src/types.ts`](../../packages/credentials/credentials/src/types.ts)
305
+
306
+ <a id="credentialsreference-updated--emit"></a>
307
+
308
+ #### `credentials/reference-updated` — emit
309
+
310
+ Committed change to a provider-managed credential source: a `set`, an `unset`, or an external edit observed in storage. Ambient process-environment changes are not observable and never emit. Listener failures are contained and logged — a sync throw and an async rejection alike — without changing the committed operation's outcome, except `INVARIANT`-coded failures, which rethrow after every listener ran; that rethrow reaches the emitter only from synchronous listeners, so invariant checks on this event must not be async functions.
311
+
312
+ ```ts cordis-catalog
313
+ /**
314
+ * Committed change to a provider-managed credential source: a `set`, an
315
+ * `unset`, or an external edit observed in storage. Ambient
316
+ * process-environment changes are not observable and never emit. Listener
317
+ * failures are contained and logged — a sync throw and an async rejection
318
+ * alike — without changing the committed operation's outcome, except
319
+ * `INVARIANT`-coded failures, which rethrow after every listener ran;
320
+ * that rethrow reaches the emitter only from synchronous listeners, so
321
+ * invariant checks on this event must not be async functions.
322
+ * @param ref - the reference whose stored value changed.
323
+ * @mode emit
324
+ */
325
+ 'credentials/reference-updated'(ref: CredentialRef): void
326
+ ```
327
+
328
+ Source: [`packages/credentials/credentials/src/types.ts`](../../packages/credentials/credentials/src/types.ts)
329
+ <!-- END GENERATED cordis-surface -->
@@ -0,0 +1,329 @@
1
+ # 用户凭据
2
+
3
+ [English](credentials.md) | 中文
4
+
5
+ [dsh-credentials](../../packages/credentials/credentials) 的凭据 seam 把机密挡在配置之外:settings 分节与 `cordis.yml` 条目携带的是*引用*(环境变量名),值归 [dsh-credentials-local](../../packages/credentials/credentials-local) 这类提供方所有,消费方每个操作解析一次引用——LLM(大语言模型)适配器每次模型请求解析一次,因此轮换后的凭据无需任何重启即可作用于紧随其后的下一次请求。一条 seam 级规则约束每个提供方:空的存储值在任何地方都视为不存在。
6
+
7
+ 来源:[`packages/credentials/credentials/src/index.ts`](../../packages/credentials/credentials/src/index.ts)
8
+
9
+ ## 标识
10
+
11
+ 引用以 POSIX 风格环境变量名命名一条凭据。brand 防止调用方将凭据引用与在包或进程之间传递的其他字符串混用;构造时校验 shell 标识符语法。
12
+
13
+ ```ts type-equiv
14
+ /** Nominal reference to one credential: a POSIX-style environment-variable name. */
15
+ type CredentialRef = Branded<'CredentialRef'>
16
+ ```
17
+
18
+ ## 解析
19
+
20
+ `resolve(ref)` 返回值及提供该值的来源层(由提供方定义);未配置期间返回 `undefined`。消费方在每个操作中重新解析,绝不跨操作缓存——这种按操作进行的读取正是热更新机制。
21
+
22
+ ```ts type-equiv
23
+ /** One resolved credential value and the source layer that supplied it. */
24
+ interface ResolvedCredential {
25
+ /** The non-empty secret value. */
26
+ value: string
27
+ /** Provider-defined source layer id (the local provider uses `env`, `file`, `project-env`, and `user-env`). */
28
+ source: string
29
+ }
30
+ ```
31
+
32
+ ## 描述
33
+
34
+ `describe(ref)` 在绝不暴露值的前提下回应配置界面:引用当前是否可解析、来自哪一层、`set` 当前能否成功。本地提供方把由当前进程环境供值的引用报告为 `writable: false`——那样的写入会表面成功而解析持续返回遮蔽值,因此 seam 直接拒绝,界面也得以提前把该引用渲染为只读。
35
+
36
+ ```ts type-equiv
37
+ /**
38
+ * Source and writability facts for one reference, safe for configuration UIs —
39
+ * never the value. The view has no slot a value could ride in, which is what
40
+ * lets the whole read half cross the Remote wire.
41
+ */
42
+ interface CredentialInfo {
43
+ /** Whether resolving the reference would currently return a value. */
44
+ configured: boolean
45
+ /** Source layer currently supplying the value; absent while unconfigured. */
46
+ source?: string
47
+ /** Whether the active provider can write this reference. */
48
+ writable: boolean
49
+ }
50
+ ```
51
+
52
+ ## 已提交的变更
53
+
54
+ `credentials/reference-updated (ref)` 在提供方管理的来源发生已提交变更后发出——`set`、`unset` 或在存储中观察到的外部编辑。进程环境自身的变化不可观测,永不发出事件。消费方不需要该事件(它们按操作重新解析);它服务于配置界面刷新「已配置」徽标。
55
+
56
+ <!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
57
+
58
+ <a id="cordis-surface"></a>
59
+
60
+ ## Cordis API
61
+
62
+ Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — the language sides differ only in locale-specific paired document paths. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.zh.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
63
+
64
+ <a id="ctxauthorization--authorizationservice"></a>
65
+
66
+ ### `ctx.authorization` — `AuthorizationService`
67
+
68
+ `ctx.authorization`: a registry of credential-obtaining flows, one attempt at a time per key.
69
+
70
+ ```ts cordis-catalog
71
+ /**
72
+ * Offer a way to obtain one credential. One flow per key: two plugins
73
+ * claiming the same key would each write a record in their own format, and
74
+ * whichever ran last would leave the other reading a payload it cannot parse.
75
+ *
76
+ * @param flow - the key it writes, its label, its methods, and its runner.
77
+ * @returns Disposer that withdraws this flow.
78
+ * @throws {AuthorizationError} code `DUPLICATE_FLOW` when the key is already claimed.
79
+ */
80
+ registerFlow(flow: AuthorizationFlow): () => void
81
+
82
+ /**
83
+ * Every registered flow, for a surface listing what can be authorized.
84
+ * @returns one entry per flow, in registration order.
85
+ */
86
+ list(): readonly AuthorizationEntry[]
87
+
88
+ /**
89
+ * One registered flow.
90
+ * @param key - the credential record to ask about.
91
+ * @returns the entry, or undefined when no flow claims that key.
92
+ */
93
+ describe(key: CredentialKey): AuthorizationEntry | undefined
94
+
95
+ /**
96
+ * Withdraw the attempt running for a key, if any. Separate from the
97
+ * request's own signal because a request/response transport answers a Cancel
98
+ * button on a second call, with no handle on the first one's signal.
99
+ * @param key - the credential record whose attempt should stop.
100
+ */
101
+ cancel(key: CredentialKey): void
102
+
103
+ /**
104
+ * Run one attempt to authorize a key, and report how it ended.
105
+ *
106
+ * One attempt per key at a time. A second caller is refused rather than
107
+ * joined: the two would be prompting different humans through the same flow,
108
+ * and the second would answer questions the first was asked.
109
+ *
110
+ * @param request - the key, the method, the surface, and the cancel signal.
111
+ * @returns `authorized` once the flow's record is committed during this
112
+ * attempt and observed, or `cancelled` when the human declined or the
113
+ * caller withdrew.
114
+ * @throws {AuthorizationError} code `NO_FLOW` when nothing claims the key,
115
+ * `UNKNOWN_METHOD` when the named method is not one the flow offers,
116
+ * `ALREADY_IN_FLIGHT` when an attempt is already running for the key, or
117
+ * `NOT_COMMITTED` when the flow resolved without committing a record
118
+ * during the attempt.
119
+ */
120
+ async begin(request: AuthorizationRequest): Promise<AuthorizationOutcome>
121
+ ```
122
+
123
+ Source: [`packages/credentials/authorization/src/index.ts`](../../packages/credentials/authorization/src/index.ts)
124
+
125
+ <a id="ctxcredentials--credentialprovider-abstract-seam"></a>
126
+
127
+ ### `ctx.credentials` — `CredentialProvider` (abstract seam)
128
+
129
+ Abstract credential service over two key spaces that answer two questions.
130
+
131
+ A CredentialRef answers "what is behind this environment-variable name", layered over the process environment, the provider-managed store, and `.env` files. One seam-wide rule binds that half: an empty stored value is absent everywhere — `resolve` skips it, `describe` reports it unconfigured — so a blank never masquerades as a configured secret.
132
+
133
+ A CredentialKey answers "what credential does this plugin hold for this id". Nothing can layer here — an authorization grant has no environment to be read from — so presence of the record is the whole fact, and modifyRecord is the only write path because a correct write depends on the current value (a token refresh is read-decide-replace under one lock).
134
+
135
+ ```ts cordis-catalog
136
+ /**
137
+ * Resolve one reference to its current value. Resolution is per call:
138
+ * consumers re-resolve at each operation and must not cache across
139
+ * operations — that per-operation read is what makes a changed credential
140
+ * reach the next operation without a restart.
141
+ * @param ref - the reference to resolve.
142
+ * @returns the value and its source, or `undefined` while unconfigured.
143
+ */
144
+ abstract resolve(ref: CredentialRef): Promise<ResolvedCredential | undefined>
145
+
146
+ /**
147
+ * Describe one reference for configuration surfaces without exposing the
148
+ * value.
149
+ * @param ref - the reference to describe.
150
+ * @returns configured state, supplying source, and writability.
151
+ */
152
+ abstract describe(ref: CredentialRef): Promise<CredentialInfo>
153
+
154
+ /**
155
+ * Durably store one value in the provider-managed writable source. Rejects
156
+ * while a read-only source shadows the reference — the write would appear
157
+ * to succeed while resolution keeps returning the shadowing value — and
158
+ * rejects an empty value (use {@link unset}).
159
+ * @param ref - the reference to store.
160
+ * @param value - the non-empty secret value.
161
+ */
162
+ abstract set(ref: CredentialRef, value: string): Promise<void>
163
+
164
+ /**
165
+ * Remove one reference from the provider-managed writable source; removing
166
+ * an absent reference is a no-op. Rejects while a read-only source shadows
167
+ * the reference, like {@link set}.
168
+ * @param ref - the reference to remove.
169
+ */
170
+ abstract unset(ref: CredentialRef): Promise<void>
171
+
172
+ /**
173
+ * Read one stored record. The value is returned as its owner wrote it; a
174
+ * {@link GrantRecord} payload is not interpreted on the way out.
175
+ * @param key - the record to read.
176
+ * @returns the record, or `undefined` while none is stored.
177
+ */
178
+ abstract readRecord(key: CredentialKey): Promise<CredentialRecord | undefined>
179
+
180
+ /**
181
+ * Describe one record for configuration surfaces without exposing its value.
182
+ * @param key - the record to describe.
183
+ * @returns presence, discriminant, and writability.
184
+ */
185
+ abstract describeRecord(key: CredentialKey): Promise<CredentialRecordInfo>
186
+
187
+ /**
188
+ * Enumerate every stored record's address and tag. Unlike the reference
189
+ * half, which has no enumeration because configuration surfaces learn which
190
+ * references exist from settings schemas, records have no such discovery
191
+ * path: a surface that cannot list them cannot show what a user is
192
+ * authorized for, nor find an orphan left by an uninstalled plugin.
193
+ * @returns every stored record, values excluded.
194
+ */
195
+ abstract listRecords(): Promise<readonly CredentialRecordEntry[]>
196
+
197
+ /**
198
+ * Serialized read-modify-write over one record — the only write path.
199
+ * `mutate` sees the record as it stands at the moment the write is
200
+ * exclusive, and returning `undefined` leaves the entry untouched. Exclusion
201
+ * holds across processes where the backing store supports it, which is what
202
+ * makes a token refresh safe: two processes rotating one refresh token
203
+ * concurrently would otherwise lose whichever wrote first.
204
+ * @param key - the record to modify.
205
+ * @param mutate - receives the current record and returns its replacement, or `undefined` to leave it.
206
+ * @returns the record after the write, or the current one when `mutate` declined.
207
+ */
208
+ abstract modifyRecord( key: CredentialKey, mutate: (current: CredentialRecord | undefined) => Promise<CredentialRecord | undefined>, ): Promise<CredentialRecord | undefined>
209
+
210
+ /**
211
+ * Remove one record; removing an absent record is a no-op.
212
+ * @param key - the record to remove.
213
+ */
214
+ abstract deleteRecord(key: CredentialKey): Promise<void>
215
+ ```
216
+
217
+ Source: [`packages/credentials/credentials/src/index.ts`](../../packages/credentials/credentials/src/index.ts)
218
+
219
+ <a id="ctxcredentialscontroller--credentialscontroller"></a>
220
+
221
+ ### `ctx.credentialsController` — `CredentialsController`
222
+
223
+ Host service backing the generated `ctx.remote.credentials` namespace. It carries every wire obligation the credential seam itself does not: the batch fan-out bound, the field-by-field view projection, the reference-grammar guard, and the refusal mapping. Secret values cross in one direction only — no method here returns one.
224
+
225
+ ```ts cordis-catalog
226
+ /**
227
+ * Describe several references for one configuration surface. Batched because
228
+ * a settings page describes every reference its rows name at once, and one
229
+ * round trip keeps those rows from settling separately.
230
+ * @param refs - reference names, at most {@link MAX_DESCRIBE_REFS}; a name outside the grammar
231
+ * rejects the whole call as `gateway/bad-request`.
232
+ * @returns one view per requested name, keyed by that name.
233
+ * @throws RemoteError when the request is invalid or no credential provider is mounted.
234
+ */
235
+ @Remote async describe(refs: string[]): Promise<Record<string, CredentialInfo>>
236
+
237
+ /**
238
+ * Store one value from a configuration surface. The value crosses the wire in
239
+ * this direction only: no read path returns it.
240
+ * @param ref - reference name to store under.
241
+ * @param value - the non-empty secret value.
242
+ * @throws RemoteError when the request is invalid, no provider is mounted, or the provider refuses the write.
243
+ */
244
+ @Remote async set(ref: string, value: string): Promise<void>
245
+
246
+ /**
247
+ * Remove one reference from a configuration surface.
248
+ * @param ref - reference name to remove.
249
+ * @throws RemoteError when the request is invalid, no provider is mounted, or the provider refuses the write.
250
+ */
251
+ @Remote async unset(ref: string): Promise<void>
252
+ ```
253
+
254
+ Source: [`packages/api/settings-controller/src/credentials.ts`](../../packages/api/settings-controller/src/credentials.ts)
255
+
256
+ <a id="authorization-events"></a>
257
+
258
+ ### `authorization/*` events
259
+
260
+ <a id="authorizationsettled--emit"></a>
261
+
262
+ #### `authorization/settled` — emit
263
+
264
+ One authorization attempt has finished and released its key. Fires for every terminal outcome, failures included, so a surface watching a key it did not start (a second browser tab) learns the attempt is over.
265
+
266
+ ```ts cordis-catalog
267
+ /**
268
+ * One authorization attempt has finished and released its key. Fires for
269
+ * every terminal outcome, failures included, so a surface watching a key it
270
+ * did not start (a second browser tab) learns the attempt is over.
271
+ * @mode emit
272
+ * @param key - the credential record the finished attempt was authorizing.
273
+ * @param settlement - how it ended, including the `failed` case its caller sees as a thrown error.
274
+ */
275
+ 'authorization/settled'(key: CredentialKey, settlement: AuthorizationSettlement): void
276
+ ```
277
+
278
+ Source: [`packages/credentials/authorization/src/index.ts`](../../packages/credentials/authorization/src/index.ts)
279
+
280
+ <a id="credentials-events"></a>
281
+
282
+ ### `credentials/*` events
283
+
284
+ <a id="credentialsrecord-updated--emit"></a>
285
+
286
+ #### `credentials/record-updated` — emit
287
+
288
+ Committed change to a stored credential record: a `modifyRecord` that wrote, a `deleteRecord` that removed, or an external edit observed in storage. Separate from `credentials/reference-updated` because the two key grammars are disjoint — a listener that received both on one event could not tell which space a subject belongs to. Listener failures are contained on the same terms as `credentials/reference-updated`.
289
+
290
+ ```ts cordis-catalog
291
+ /**
292
+ * Committed change to a stored credential record: a `modifyRecord` that
293
+ * wrote, a `deleteRecord` that removed, or an external edit observed in
294
+ * storage. Separate from `credentials/reference-updated` because the two key
295
+ * grammars are disjoint — a listener that received both on one event could
296
+ * not tell which space a subject belongs to. Listener failures are
297
+ * contained on the same terms as `credentials/reference-updated`.
298
+ * @param key - the record whose stored value changed.
299
+ * @mode emit
300
+ */
301
+ 'credentials/record-updated'(key: CredentialKey): void
302
+ ```
303
+
304
+ Source: [`packages/credentials/credentials/src/types.ts`](../../packages/credentials/credentials/src/types.ts)
305
+
306
+ <a id="credentialsreference-updated--emit"></a>
307
+
308
+ #### `credentials/reference-updated` — emit
309
+
310
+ Committed change to a provider-managed credential source: a `set`, an `unset`, or an external edit observed in storage. Ambient process-environment changes are not observable and never emit. Listener failures are contained and logged — a sync throw and an async rejection alike — without changing the committed operation's outcome, except `INVARIANT`-coded failures, which rethrow after every listener ran; that rethrow reaches the emitter only from synchronous listeners, so invariant checks on this event must not be async functions.
311
+
312
+ ```ts cordis-catalog
313
+ /**
314
+ * Committed change to a provider-managed credential source: a `set`, an
315
+ * `unset`, or an external edit observed in storage. Ambient
316
+ * process-environment changes are not observable and never emit. Listener
317
+ * failures are contained and logged — a sync throw and an async rejection
318
+ * alike — without changing the committed operation's outcome, except
319
+ * `INVARIANT`-coded failures, which rethrow after every listener ran;
320
+ * that rethrow reaches the emitter only from synchronous listeners, so
321
+ * invariant checks on this event must not be async functions.
322
+ * @param ref - the reference whose stored value changed.
323
+ * @mode emit
324
+ */
325
+ 'credentials/reference-updated'(ref: CredentialRef): void
326
+ ```
327
+
328
+ Source: [`packages/credentials/credentials/src/types.ts`](../../packages/credentials/credentials/src/types.ts)
329
+ <!-- END GENERATED cordis-surface -->