@dsh-edge/dsh-edge-agent 0.0.0-stage → 0.1.2

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 (238) hide show
  1. package/CHANGELOG.md +158 -0
  2. package/LICENSE +21 -0
  3. package/README.md +181 -2
  4. package/config/edge.example.json +179 -0
  5. package/config/privacy-policy.json +202 -0
  6. package/cordis.desktop-safe.patch.yml +129 -0
  7. package/cordis.patch.yml +382 -0
  8. package/cordis.yml +374 -0
  9. package/lib/attestation.d.ts +2 -0
  10. package/lib/attestation.d.ts.map +1 -0
  11. package/lib/attestation.js +2 -0
  12. package/lib/audit-log.d.ts +2 -0
  13. package/lib/audit-log.d.ts.map +1 -0
  14. package/lib/audit-log.js +2 -0
  15. package/lib/client.js +87 -0
  16. package/lib/cloud-llm-adapter.d.ts +2 -0
  17. package/lib/cloud-llm-adapter.d.ts.map +1 -0
  18. package/lib/cloud-llm-adapter.js +2 -0
  19. package/lib/dsh-adapter/attestation.d.ts +42 -0
  20. package/lib/dsh-adapter/attestation.d.ts.map +1 -0
  21. package/lib/dsh-adapter/attestation.js +40 -0
  22. package/lib/dsh-adapter/audit-log.d.ts +139 -0
  23. package/lib/dsh-adapter/audit-log.d.ts.map +1 -0
  24. package/lib/dsh-adapter/audit-log.js +376 -0
  25. package/lib/dsh-adapter/cloud-egress.d.ts +181 -0
  26. package/lib/dsh-adapter/cloud-egress.d.ts.map +1 -0
  27. package/lib/dsh-adapter/cloud-egress.js +257 -0
  28. package/lib/dsh-adapter/cloud-llm-adapter.d.ts +416 -0
  29. package/lib/dsh-adapter/cloud-llm-adapter.d.ts.map +1 -0
  30. package/lib/dsh-adapter/cloud-llm-adapter.js +1472 -0
  31. package/lib/dsh-adapter/contract.d.ts +80 -0
  32. package/lib/dsh-adapter/contract.d.ts.map +1 -0
  33. package/lib/dsh-adapter/contract.js +194 -0
  34. package/lib/dsh-adapter/desktop-cookie-janitor.d.ts +214 -0
  35. package/lib/dsh-adapter/desktop-cookie-janitor.d.ts.map +1 -0
  36. package/lib/dsh-adapter/desktop-cookie-janitor.js +409 -0
  37. package/lib/dsh-adapter/dsh-edge-agent.d.ts +48 -0
  38. package/lib/dsh-adapter/dsh-edge-agent.d.ts.map +1 -0
  39. package/lib/dsh-adapter/dsh-edge-agent.js +64 -0
  40. package/lib/dsh-adapter/edge-config.d.ts +484 -0
  41. package/lib/dsh-adapter/edge-config.d.ts.map +1 -0
  42. package/lib/dsh-adapter/edge-config.js +898 -0
  43. package/lib/dsh-adapter/edge-context-view.d.ts +184 -0
  44. package/lib/dsh-adapter/edge-context-view.d.ts.map +1 -0
  45. package/lib/dsh-adapter/edge-context-view.js +483 -0
  46. package/lib/dsh-adapter/effective-model.d.ts +85 -0
  47. package/lib/dsh-adapter/effective-model.d.ts.map +1 -0
  48. package/lib/dsh-adapter/effective-model.js +171 -0
  49. package/lib/dsh-adapter/etscli-shell-guard.d.ts +244 -0
  50. package/lib/dsh-adapter/etscli-shell-guard.d.ts.map +1 -0
  51. package/lib/dsh-adapter/etscli-shell-guard.js +420 -0
  52. package/lib/dsh-adapter/etscli-tools.d.ts +112 -0
  53. package/lib/dsh-adapter/etscli-tools.d.ts.map +1 -0
  54. package/lib/dsh-adapter/etscli-tools.js +393 -0
  55. package/lib/dsh-adapter/file-logger.d.ts +294 -0
  56. package/lib/dsh-adapter/file-logger.d.ts.map +1 -0
  57. package/lib/dsh-adapter/file-logger.js +564 -0
  58. package/lib/dsh-adapter/function-call-external.d.ts +357 -0
  59. package/lib/dsh-adapter/function-call-external.d.ts.map +1 -0
  60. package/lib/dsh-adapter/function-call-external.js +1005 -0
  61. package/lib/dsh-adapter/host-egress-guard.d.ts +161 -0
  62. package/lib/dsh-adapter/host-egress-guard.d.ts.map +1 -0
  63. package/lib/dsh-adapter/host-egress-guard.js +213 -0
  64. package/lib/dsh-adapter/host-llm-trace.d.ts +198 -0
  65. package/lib/dsh-adapter/host-llm-trace.d.ts.map +1 -0
  66. package/lib/dsh-adapter/host-llm-trace.js +344 -0
  67. package/lib/dsh-adapter/http-api-routes.d.ts +61 -0
  68. package/lib/dsh-adapter/http-api-routes.d.ts.map +1 -0
  69. package/lib/dsh-adapter/http-api-routes.js +79 -0
  70. package/lib/dsh-adapter/http-api-sessions.d.ts +105 -0
  71. package/lib/dsh-adapter/http-api-sessions.d.ts.map +1 -0
  72. package/lib/dsh-adapter/http-api-sessions.js +173 -0
  73. package/lib/dsh-adapter/http-api.d.ts +221 -0
  74. package/lib/dsh-adapter/http-api.d.ts.map +1 -0
  75. package/lib/dsh-adapter/http-api.js +1811 -0
  76. package/lib/dsh-adapter/index.d.ts +62 -0
  77. package/lib/dsh-adapter/index.d.ts.map +1 -0
  78. package/lib/dsh-adapter/index.js +97 -0
  79. package/lib/dsh-adapter/input-guard-messages.d.ts +56 -0
  80. package/lib/dsh-adapter/input-guard-messages.d.ts.map +1 -0
  81. package/lib/dsh-adapter/input-guard-messages.js +136 -0
  82. package/lib/dsh-adapter/input-guard.d.ts +508 -0
  83. package/lib/dsh-adapter/input-guard.d.ts.map +1 -0
  84. package/lib/dsh-adapter/input-guard.js +2174 -0
  85. package/lib/dsh-adapter/intent-prompts.d.ts +77 -0
  86. package/lib/dsh-adapter/intent-prompts.d.ts.map +1 -0
  87. package/lib/dsh-adapter/intent-prompts.js +97 -0
  88. package/lib/dsh-adapter/intent-router.d.ts +710 -0
  89. package/lib/dsh-adapter/intent-router.d.ts.map +1 -0
  90. package/lib/dsh-adapter/intent-router.js +2802 -0
  91. package/lib/dsh-adapter/intent-signals.d.ts +208 -0
  92. package/lib/dsh-adapter/intent-signals.d.ts.map +1 -0
  93. package/lib/dsh-adapter/intent-signals.js +391 -0
  94. package/lib/dsh-adapter/invariant-install.d.ts +16 -0
  95. package/lib/dsh-adapter/invariant-install.d.ts.map +1 -0
  96. package/lib/dsh-adapter/invariant-install.js +15 -0
  97. package/lib/dsh-adapter/invariant.d.ts +16 -0
  98. package/lib/dsh-adapter/invariant.d.ts.map +1 -0
  99. package/lib/dsh-adapter/invariant.js +22 -0
  100. package/lib/dsh-adapter/llm-adapters.d.ts +19 -0
  101. package/lib/dsh-adapter/llm-adapters.d.ts.map +1 -0
  102. package/lib/dsh-adapter/llm-adapters.js +16 -0
  103. package/lib/dsh-adapter/llm-internal-caller.d.ts +92 -0
  104. package/lib/dsh-adapter/llm-internal-caller.d.ts.map +1 -0
  105. package/lib/dsh-adapter/llm-internal-caller.js +100 -0
  106. package/lib/dsh-adapter/llm-max-turns.d.ts +55 -0
  107. package/lib/dsh-adapter/llm-max-turns.d.ts.map +1 -0
  108. package/lib/dsh-adapter/llm-max-turns.js +127 -0
  109. package/lib/dsh-adapter/llm-trace-store.d.ts +131 -0
  110. package/lib/dsh-adapter/llm-trace-store.d.ts.map +1 -0
  111. package/lib/dsh-adapter/llm-trace-store.js +205 -0
  112. package/lib/dsh-adapter/llm-trace.d.ts +450 -0
  113. package/lib/dsh-adapter/llm-trace.d.ts.map +1 -0
  114. package/lib/dsh-adapter/llm-trace.js +463 -0
  115. package/lib/dsh-adapter/local-llm-adapter.d.ts +141 -0
  116. package/lib/dsh-adapter/local-llm-adapter.d.ts.map +1 -0
  117. package/lib/dsh-adapter/local-llm-adapter.js +787 -0
  118. package/lib/dsh-adapter/local-storage.d.ts +96 -0
  119. package/lib/dsh-adapter/local-storage.d.ts.map +1 -0
  120. package/lib/dsh-adapter/local-storage.js +198 -0
  121. package/lib/dsh-adapter/model-router.d.ts +79 -0
  122. package/lib/dsh-adapter/model-router.d.ts.map +1 -0
  123. package/lib/dsh-adapter/model-router.js +107 -0
  124. package/lib/dsh-adapter/ohttp-gateway.d.ts +49 -0
  125. package/lib/dsh-adapter/ohttp-gateway.d.ts.map +1 -0
  126. package/lib/dsh-adapter/ohttp-gateway.js +32 -0
  127. package/lib/dsh-adapter/openai-sse.d.ts +85 -0
  128. package/lib/dsh-adapter/openai-sse.d.ts.map +1 -0
  129. package/lib/dsh-adapter/openai-sse.js +462 -0
  130. package/lib/dsh-adapter/pii-utils.d.ts +96 -0
  131. package/lib/dsh-adapter/pii-utils.d.ts.map +1 -0
  132. package/lib/dsh-adapter/pii-utils.js +324 -0
  133. package/lib/dsh-adapter/plugin-host.d.ts +38 -0
  134. package/lib/dsh-adapter/plugin-host.d.ts.map +1 -0
  135. package/lib/dsh-adapter/plugin-host.js +38 -0
  136. package/lib/dsh-adapter/plugin.d.ts +46 -0
  137. package/lib/dsh-adapter/plugin.d.ts.map +1 -0
  138. package/lib/dsh-adapter/plugin.js +100 -0
  139. package/lib/dsh-adapter/privacy-policy.d.ts +237 -0
  140. package/lib/dsh-adapter/privacy-policy.d.ts.map +1 -0
  141. package/lib/dsh-adapter/privacy-policy.js +391 -0
  142. package/lib/dsh-adapter/prompt-guard.d.ts +152 -0
  143. package/lib/dsh-adapter/prompt-guard.d.ts.map +1 -0
  144. package/lib/dsh-adapter/prompt-guard.js +872 -0
  145. package/lib/dsh-adapter/realm-skill-bridge.d.ts +365 -0
  146. package/lib/dsh-adapter/realm-skill-bridge.d.ts.map +1 -0
  147. package/lib/dsh-adapter/realm-skill-bridge.js +1180 -0
  148. package/lib/dsh-adapter/sanitizer-pipeline.d.ts +140 -0
  149. package/lib/dsh-adapter/sanitizer-pipeline.d.ts.map +1 -0
  150. package/lib/dsh-adapter/sanitizer-pipeline.js +431 -0
  151. package/lib/dsh-adapter/secure-bridge.d.ts +47 -0
  152. package/lib/dsh-adapter/secure-bridge.d.ts.map +1 -0
  153. package/lib/dsh-adapter/secure-bridge.js +35 -0
  154. package/lib/dsh-adapter/session-attribution.d.ts +70 -0
  155. package/lib/dsh-adapter/session-attribution.d.ts.map +1 -0
  156. package/lib/dsh-adapter/session-attribution.js +76 -0
  157. package/lib/dsh-adapter/sessions.d.ts +86 -0
  158. package/lib/dsh-adapter/sessions.d.ts.map +1 -0
  159. package/lib/dsh-adapter/sessions.js +179 -0
  160. package/lib/dsh-adapter/tcm.d.ts +55 -0
  161. package/lib/dsh-adapter/tcm.d.ts.map +1 -0
  162. package/lib/dsh-adapter/tcm.js +94 -0
  163. package/lib/dsh-adapter/td-bus.d.ts +87 -0
  164. package/lib/dsh-adapter/td-bus.d.ts.map +1 -0
  165. package/lib/dsh-adapter/td-bus.js +196 -0
  166. package/lib/dsh-adapter/tool-runner.d.ts +185 -0
  167. package/lib/dsh-adapter/tool-runner.d.ts.map +1 -0
  168. package/lib/dsh-adapter/tool-runner.js +271 -0
  169. package/lib/dsh-adapter/tools.d.ts +118 -0
  170. package/lib/dsh-adapter/tools.d.ts.map +1 -0
  171. package/lib/dsh-adapter/tools.js +292 -0
  172. package/lib/dsh-adapter/types.d.ts +23 -0
  173. package/lib/dsh-adapter/types.d.ts.map +1 -0
  174. package/lib/dsh-adapter/types.js +16 -0
  175. package/lib/dsh-adapter/voice-input.d.ts +30 -0
  176. package/lib/dsh-adapter/voice-input.d.ts.map +1 -0
  177. package/lib/dsh-adapter/voice-input.js +34 -0
  178. package/lib/dsh-adapter/web-search-tavily-bocha.d.ts +152 -0
  179. package/lib/dsh-adapter/web-search-tavily-bocha.d.ts.map +1 -0
  180. package/lib/dsh-adapter/web-search-tavily-bocha.js +289 -0
  181. package/lib/http-api.d.ts +2 -0
  182. package/lib/http-api.d.ts.map +1 -0
  183. package/lib/http-api.js +2 -0
  184. package/lib/index.d.ts +48 -0
  185. package/lib/index.d.ts.map +1 -0
  186. package/lib/index.js +49 -0
  187. package/lib/intent-router.d.ts +2 -0
  188. package/lib/intent-router.d.ts.map +1 -0
  189. package/lib/intent-router.js +2 -0
  190. package/lib/llm-adapters.d.ts +2 -0
  191. package/lib/llm-adapters.d.ts.map +1 -0
  192. package/lib/llm-adapters.js +2 -0
  193. package/lib/local-llm-adapter.d.ts +2 -0
  194. package/lib/local-llm-adapter.d.ts.map +1 -0
  195. package/lib/local-llm-adapter.js +2 -0
  196. package/lib/local-storage.d.ts +2 -0
  197. package/lib/local-storage.d.ts.map +1 -0
  198. package/lib/local-storage.js +2 -0
  199. package/lib/model-router.d.ts +2 -0
  200. package/lib/model-router.d.ts.map +1 -0
  201. package/lib/model-router.js +2 -0
  202. package/lib/ohttp-gateway.d.ts +2 -0
  203. package/lib/ohttp-gateway.d.ts.map +1 -0
  204. package/lib/ohttp-gateway.js +2 -0
  205. package/lib/plugin-host.d.ts +2 -0
  206. package/lib/plugin-host.d.ts.map +1 -0
  207. package/lib/plugin-host.js +2 -0
  208. package/lib/privacy-policy.d.ts +2 -0
  209. package/lib/privacy-policy.d.ts.map +1 -0
  210. package/lib/privacy-policy.js +2 -0
  211. package/lib/prompt-guard.d.ts +2 -0
  212. package/lib/prompt-guard.d.ts.map +1 -0
  213. package/lib/prompt-guard.js +2 -0
  214. package/lib/sanitizer-pipeline.d.ts +2 -0
  215. package/lib/sanitizer-pipeline.d.ts.map +1 -0
  216. package/lib/sanitizer-pipeline.js +2 -0
  217. package/lib/secure-bridge.d.ts +2 -0
  218. package/lib/secure-bridge.d.ts.map +1 -0
  219. package/lib/secure-bridge.js +2 -0
  220. package/lib/sessions.d.ts +2 -0
  221. package/lib/sessions.d.ts.map +1 -0
  222. package/lib/sessions.js +2 -0
  223. package/lib/tcm.d.ts +2 -0
  224. package/lib/tcm.d.ts.map +1 -0
  225. package/lib/tcm.js +2 -0
  226. package/lib/td-bus.d.ts +2 -0
  227. package/lib/td-bus.d.ts.map +1 -0
  228. package/lib/td-bus.js +2 -0
  229. package/lib/tools.d.ts +2 -0
  230. package/lib/tools.d.ts.map +1 -0
  231. package/lib/tools.js +2 -0
  232. package/lib/voice-input.d.ts +2 -0
  233. package/lib/voice-input.d.ts.map +1 -0
  234. package/lib/voice-input.js +2 -0
  235. package/package.json +253 -3
  236. package/presets/agent-preset-edge.json +50 -0
  237. package/presets/edge.desktop-safe.patch.yml +503 -0
  238. package/presets/edge.patch.yml +557 -0
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Upstream DSH compatibility contract.
3
+ *
4
+ * Policy (2026-10-17): **do not pin the upstream DSH release line.** The
5
+ * project follows the newest published `@deepseek-ai/dsh-*` packages
6
+ * (currently the `next` dist-tag), so `package.json` uses open-ended
7
+ * lower bounds (`>=0.2.1-rc.2`) rather than exact versions.
8
+ *
9
+ * The contract gate therefore checks *compatibility*, not equality:
10
+ * - every blessed package must be installed;
11
+ * - every installed version must be >= `UPSTREAM_MIN_VERSION`;
12
+ * - all blessed packages must resolve to one consistent version line
13
+ * (mixed installs are the usual symptom of a partial upgrade);
14
+ * - versions newer than `UPSTREAM_TESTED_VERSION` are reported as a
15
+ * warning, never as a failure.
16
+ *
17
+ * `UPSTREAM_MIN_VERSION` is bumped only when an upstream change actually
18
+ * requires a code change here (e.g. the 0.2.x `agent/assistant-stream`
19
+ * replacement for `session/event assistant/chunk`).
20
+ */
21
+ /**
22
+ * Oldest upstream line this bundle is known to work with. Raise this only
23
+ * together with a code migration, never just because a newer RC exists.
24
+ */
25
+ export declare const UPSTREAM_MIN_VERSION = "0.2.1-rc.2";
26
+ /** Newest upstream line exercised by the repo's own compile/gate run. */
27
+ export declare const UPSTREAM_TESTED_VERSION = "0.2.1-rc.2";
28
+ /**
29
+ * @deprecated Use `UPSTREAM_TESTED_VERSION` (or `UPSTREAM_MIN_VERSION` for
30
+ * compatibility checks). Kept as an alias so external scripts that imported
31
+ * the old name keep working.
32
+ */
33
+ export declare const UPSTREAM_VALIDATED_VERSION = "0.2.1-rc.2";
34
+ /** Framework packages compared by major/minor only. */
35
+ export declare const UPSTREAM_FRAMEWORK_MAJORS: {
36
+ readonly '@deepseek-ai/cordis': ">=4.0.5";
37
+ readonly '@deepseek-ai/schemastery': ">=3.18.5";
38
+ };
39
+ /**
40
+ * Packages whose versions must move together. Keeping this list small is
41
+ * deliberate: it covers the API surface this bundle imports directly.
42
+ */
43
+ export declare const UPSTREAM_BLESSED_PACKAGES: readonly ["@deepseek-ai/dsh-agent", "@deepseek-ai/dsh-llm", "@deepseek-ai/dsh-tools", "@deepseek-ai/dsh-session", "@deepseek-ai/dsh-system-prompt", "@deepseek-ai/dsh-scope"];
44
+ export type BlessedPackage = (typeof UPSTREAM_BLESSED_PACKAGES)[number];
45
+ export interface UpstreamEntry {
46
+ pkg: string;
47
+ installed: string;
48
+ }
49
+ export interface UpstreamReport {
50
+ /** False only for below-minimum or mixed installs. */
51
+ ok: boolean;
52
+ minimum: string;
53
+ tested: string;
54
+ installed: Record<string, string>;
55
+ missing: string[];
56
+ belowMinimum: UpstreamEntry[];
57
+ mixed: UpstreamEntry[];
58
+ newerThanTested: UpstreamEntry[];
59
+ versions: string[];
60
+ }
61
+ /** Semver-ish comparison that also understands `-rc.1` style prereleases. */
62
+ export declare function compareVersions(a: string, b: string): number;
63
+ export declare function versionAtLeast(value: string, minimum: string): boolean;
64
+ /**
65
+ * Read installed versions by walking the consumer's `node_modules/<pkg>/package.json`.
66
+ * Missing packages are reported, not thrown: a host may provide them lazily.
67
+ */
68
+ export declare function installedUpstreamVersions(): Promise<Map<string, string>>;
69
+ /** Full compatibility report used by the CI gate and boot diagnostics. */
70
+ export declare function upstreamReport(): Promise<UpstreamReport>;
71
+ /**
72
+ * Boot-time drift: only conditions that are actually incompatible.
73
+ * A newer upstream (e.g. 0.3.x) is intentionally *not* drift.
74
+ */
75
+ export declare function upstreamDrift(): Promise<Array<{
76
+ pkg: string;
77
+ installed: string;
78
+ expected: string;
79
+ }>>;
80
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../src/dsh-adapter/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,eAAe,CAAA;AAEhD,yEAAyE;AACzE,eAAO,MAAM,uBAAuB,eAAe,CAAA;AAEnD;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,eAA0B,CAAA;AAEjE,uDAAuD;AACvD,eAAO,MAAM,yBAAyB;;;CAG5B,CAAA;AAEV;;;GAGG;AACH,eAAO,MAAM,yBAAyB,+KAO5B,CAAA;AAEV,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvE,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,sDAAsD;IACtD,EAAE,EAAE,OAAO,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACjC,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,YAAY,EAAE,aAAa,EAAE,CAAA;IAC7B,KAAK,EAAE,aAAa,EAAE,CAAA;IACtB,eAAe,EAAE,aAAa,EAAE,CAAA;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAuCD,6EAA6E;AAC7E,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ5D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtE;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAa9E;AAED,0EAA0E;AAC1E,wBAAsB,cAAc,IAAI,OAAO,CAAC,cAAc,CAAC,CAkD9D;AAED;;;GAGG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAY1G"}
@@ -0,0 +1,194 @@
1
+ /**
2
+ * Upstream DSH compatibility contract.
3
+ *
4
+ * Policy (2026-10-17): **do not pin the upstream DSH release line.** The
5
+ * project follows the newest published `@deepseek-ai/dsh-*` packages
6
+ * (currently the `next` dist-tag), so `package.json` uses open-ended
7
+ * lower bounds (`>=0.2.1-rc.2`) rather than exact versions.
8
+ *
9
+ * The contract gate therefore checks *compatibility*, not equality:
10
+ * - every blessed package must be installed;
11
+ * - every installed version must be >= `UPSTREAM_MIN_VERSION`;
12
+ * - all blessed packages must resolve to one consistent version line
13
+ * (mixed installs are the usual symptom of a partial upgrade);
14
+ * - versions newer than `UPSTREAM_TESTED_VERSION` are reported as a
15
+ * warning, never as a failure.
16
+ *
17
+ * `UPSTREAM_MIN_VERSION` is bumped only when an upstream change actually
18
+ * requires a code change here (e.g. the 0.2.x `agent/assistant-stream`
19
+ * replacement for `session/event assistant/chunk`).
20
+ */
21
+ /**
22
+ * Oldest upstream line this bundle is known to work with. Raise this only
23
+ * together with a code migration, never just because a newer RC exists.
24
+ */
25
+ export const UPSTREAM_MIN_VERSION = '0.2.1-rc.2';
26
+ /** Newest upstream line exercised by the repo's own compile/gate run. */
27
+ export const UPSTREAM_TESTED_VERSION = '0.2.1-rc.2';
28
+ /**
29
+ * @deprecated Use `UPSTREAM_TESTED_VERSION` (or `UPSTREAM_MIN_VERSION` for
30
+ * compatibility checks). Kept as an alias so external scripts that imported
31
+ * the old name keep working.
32
+ */
33
+ export const UPSTREAM_VALIDATED_VERSION = UPSTREAM_TESTED_VERSION;
34
+ /** Framework packages compared by major/minor only. */
35
+ export const UPSTREAM_FRAMEWORK_MAJORS = {
36
+ '@deepseek-ai/cordis': '>=4.0.5',
37
+ '@deepseek-ai/schemastery': '>=3.18.5',
38
+ };
39
+ /**
40
+ * Packages whose versions must move together. Keeping this list small is
41
+ * deliberate: it covers the API surface this bundle imports directly.
42
+ */
43
+ export const UPSTREAM_BLESSED_PACKAGES = [
44
+ '@deepseek-ai/dsh-agent',
45
+ '@deepseek-ai/dsh-llm',
46
+ '@deepseek-ai/dsh-tools',
47
+ '@deepseek-ai/dsh-session',
48
+ '@deepseek-ai/dsh-system-prompt',
49
+ '@deepseek-ai/dsh-scope',
50
+ ];
51
+ function parseVersion(value) {
52
+ const [core = '', pre = ''] = value.split('-', 2);
53
+ const parts = core.split('.').map((part) => {
54
+ const n = Number.parseInt(part, 10);
55
+ return Number.isFinite(n) ? n : 0;
56
+ });
57
+ return { parts, prerelease: pre.length > 0 ? pre.split('.') : [] };
58
+ }
59
+ function comparePrerelease(a, b) {
60
+ // A release sorts above any prerelease of the same core version.
61
+ if (a.length === 0 && b.length === 0)
62
+ return 0;
63
+ if (a.length === 0)
64
+ return 1;
65
+ if (b.length === 0)
66
+ return -1;
67
+ const length = Math.max(a.length, b.length);
68
+ for (let i = 0; i < length; i++) {
69
+ const x = a[i];
70
+ const y = b[i];
71
+ if (x === undefined)
72
+ return -1;
73
+ if (y === undefined)
74
+ return 1;
75
+ const xNumeric = /^\d+$/.test(x);
76
+ const yNumeric = /^\d+$/.test(y);
77
+ if (xNumeric && yNumeric) {
78
+ const diff = Number(x) - Number(y);
79
+ if (diff !== 0)
80
+ return diff < 0 ? -1 : 1;
81
+ }
82
+ else if (xNumeric) {
83
+ return -1;
84
+ }
85
+ else if (yNumeric) {
86
+ return 1;
87
+ }
88
+ else {
89
+ const cmp = x.localeCompare(y);
90
+ if (cmp !== 0)
91
+ return cmp < 0 ? -1 : 1;
92
+ }
93
+ }
94
+ return 0;
95
+ }
96
+ /** Semver-ish comparison that also understands `-rc.1` style prereleases. */
97
+ export function compareVersions(a, b) {
98
+ const pa = parseVersion(a);
99
+ const pb = parseVersion(b);
100
+ for (let i = 0; i < 3; i++) {
101
+ const diff = (pa.parts[i] ?? 0) - (pb.parts[i] ?? 0);
102
+ if (diff !== 0)
103
+ return diff < 0 ? -1 : 1;
104
+ }
105
+ return comparePrerelease(pa.prerelease, pb.prerelease);
106
+ }
107
+ export function versionAtLeast(value, minimum) {
108
+ return compareVersions(value, minimum) >= 0;
109
+ }
110
+ /**
111
+ * Read installed versions by walking the consumer's `node_modules/<pkg>/package.json`.
112
+ * Missing packages are reported, not thrown: a host may provide them lazily.
113
+ */
114
+ export async function installedUpstreamVersions() {
115
+ const { createRequire } = await import('node:module');
116
+ const require = createRequire(import.meta.url);
117
+ const result = new Map();
118
+ for (const pkg of UPSTREAM_BLESSED_PACKAGES) {
119
+ try {
120
+ const manifest = require(`${pkg}/package.json`);
121
+ result.set(pkg, manifest.version);
122
+ }
123
+ catch {
124
+ // not installed; reported as `missing`
125
+ }
126
+ }
127
+ return result;
128
+ }
129
+ /** Full compatibility report used by the CI gate and boot diagnostics. */
130
+ export async function upstreamReport() {
131
+ const installedMap = await installedUpstreamVersions();
132
+ const installed = {};
133
+ const missing = [];
134
+ const belowMinimum = [];
135
+ const newerThanTested = [];
136
+ for (const pkg of UPSTREAM_BLESSED_PACKAGES) {
137
+ const version = installedMap.get(pkg);
138
+ if (version === undefined) {
139
+ missing.push(pkg);
140
+ continue;
141
+ }
142
+ installed[pkg] = version;
143
+ if (!versionAtLeast(version, UPSTREAM_MIN_VERSION)) {
144
+ belowMinimum.push({ pkg, installed: version });
145
+ }
146
+ if (compareVersions(version, UPSTREAM_TESTED_VERSION) > 0) {
147
+ newerThanTested.push({ pkg, installed: version });
148
+ }
149
+ }
150
+ const versions = [...new Set(Object.values(installed))];
151
+ let mixed = [];
152
+ if (versions.length > 1) {
153
+ // Report the outliers relative to the most common version line.
154
+ const counts = new Map();
155
+ for (const version of Object.values(installed)) {
156
+ counts.set(version, (counts.get(version) ?? 0) + 1);
157
+ }
158
+ const baseline = [...counts.entries()].sort((a, b) => b[1] - a[1])[0]?.[0];
159
+ mixed = Object.entries(installed)
160
+ .filter(([, version]) => version !== baseline)
161
+ .map(([pkg, version]) => ({ pkg, installed: version }));
162
+ }
163
+ return {
164
+ // Missing packages are a hard failure for the CI gate (the repo installs
165
+ // them as devDependencies). Runtime consumers use `upstreamDrift()`, which
166
+ // intentionally ignores `missing` because the host may provide them.
167
+ ok: missing.length === 0 && belowMinimum.length === 0 && mixed.length === 0,
168
+ minimum: UPSTREAM_MIN_VERSION,
169
+ tested: UPSTREAM_TESTED_VERSION,
170
+ installed,
171
+ missing,
172
+ belowMinimum,
173
+ mixed,
174
+ newerThanTested,
175
+ versions,
176
+ };
177
+ }
178
+ /**
179
+ * Boot-time drift: only conditions that are actually incompatible.
180
+ * A newer upstream (e.g. 0.3.x) is intentionally *not* drift.
181
+ */
182
+ export async function upstreamDrift() {
183
+ const report = await upstreamReport();
184
+ return [
185
+ ...report.belowMinimum.map((entry) => ({
186
+ ...entry,
187
+ expected: UPSTREAM_MIN_VERSION,
188
+ })),
189
+ ...report.mixed.map((entry) => ({
190
+ ...entry,
191
+ expected: 'one consistent upstream version line',
192
+ })),
193
+ ];
194
+ }
@@ -0,0 +1,214 @@
1
+ /**
2
+ * desktop-cookie-janitor — §7.145 桌面版「起不来」的根因修复。
3
+ *
4
+ * ## 现象(主人现场,2026-10-28)
5
+ *
6
+ * 桌面版反复起不来,报 "DeepSeek Harness is unavailable"。审计链里能看到
7
+ * **18 次「插件加载完 0.1 秒就死」的启动**(每次只有 8 条事件:
8
+ * config.loaded → policy.loaded → boot.probe → 4 条 hook 注册,然后戛然而止)。
9
+ *
10
+ * ## 根因
11
+ *
12
+ * 桌面版每次启动都用**随机端口**起 web 服务
13
+ * (apps/desktop-host/src/index.ts: `args: ['--no-open','--host','127.0.0.1','--port','0']`),
14
+ * 宿主据此签发浏览器会话 cookie:
15
+ *
16
+ * cookie 名 = "dsh-auth-" + base64url(sha256(authority)) // authority = "127.0.0.1:<port>"
17
+ *
18
+ * **端口进了 cookie 名** ⇒ 每次启动都是一条**新名字**的 cookie ⇒ 上一轮的 cookie
19
+ * 既不会被命中、也不会因为端口复用而覆盖 ⇒ Chromium 的 cookie jar 无限增长。
20
+ *
21
+ * Chromium 把**同一 host 的全部 cookie** 塞进 Cookie 头(cookie 不按端口隔离,
22
+ * 只有名字里带了端口)⇒ Electron 外壳的 welcome 握手
23
+ * (app.asar/lib/main.js:8885 `net.fetch(url, {credentials:'include'})`)带着
24
+ * 一大堆 cookie 出发 ⇒ 宿主 web 服务是裸 `createServer(listener)`
25
+ * (@deepseek-ai/dsh-host-webserver/lib/index.js:566,未设 maxHeaderSize)
26
+ * ⇒ Node 默认 16384 B 头上限 ⇒ **431 Request Header Fields Too Large**
27
+ * ⇒ 外壳判定 `!authenticated.ok` ⇒ 拆掉宿主 ⇒ 「unavailable」。
28
+ *
29
+ * 实测:71 条 cookie = 16.2 KB(每条 227 B)⇒ 约 69 次启动就撞线。
30
+ *
31
+ * ## 为什么是本插件来修
32
+ *
33
+ * 实测时间线(2026-10-29 01:08:23 一次真实启动):
34
+ *
35
+ * 01:08:23.030 我们的插件加载(config.loaded)
36
+ * 01:08:25.979 Electron 锁住 cookie 库(welcome 握手触发网络服务)
37
+ *
38
+ * ⇒ 插件加载后有**约 3 秒的窗口**,cookie 库还没被锁 ⇒ 这时候可以把历次启动
39
+ * 留下的死端口 cookie 删掉。Electron 之后才打开这个库,读到的就是清理过的。
40
+ *
41
+ * 同时把宿主 web 服务的 `maxHeaderSize` 抬上去:即使清理没赶上(库已被锁),
42
+ * 一个已经攒胖的 jar 也不会再把启动打死 —— 两道防线,互不依赖。
43
+ *
44
+ * ## 只在桌面版生效
45
+ *
46
+ * 431 只发生在 Electron 外壳(只有它带 Chromium cookie jar)。headless profile
47
+ * (web / tui / dsh-edge-agent)由普通 Node 拉起,自己起 web 服务、客户端不带
48
+ * cookie jar ⇒ 同样场景不会发生。所以本插件用 `process.versions.electron`
49
+ * 判别运行环境,非桌面版一律跳过 —— 不去动无关 profile 里的宿主 web 服务。
50
+ *
51
+ * ## 不做什么
52
+ *
53
+ * - **不碰**非 `dsh-auth-*` 的 cookie(别的站点的)。
54
+ * - **不碰**当前活着端口的那条(= 本次会话的 cookie)。
55
+ * - **不删**认不出 audience 的行以外的东西;认不出的 auth cookie 视为残骸
56
+ * (它多半来自旧版本/旧端口),但只在 `source_port` 也拿不到时才动它。
57
+ * - 任何一步失败都**静默降级**(返回一份报告,绝不抛)—— 观测/家���不能拖垮启动。
58
+ *
59
+ * @module dsh-edge-agent/desktop-cookie-janitor
60
+ */
61
+ import type { Context } from '@deepseek-ai/cordis';
62
+ import Schema from '@deepseek-ai/schemastery';
63
+ export declare const name = "desktop-cookie-janitor";
64
+ /** 无硬依赖:web 服务用 `ctx.inject(['webServer'])` 延迟取(headless profile
65
+ * 未必有它),cookie 库也不依赖任何服务。 */
66
+ export declare const inject: readonly [];
67
+ /** 宿主签发的浏览器会话 cookie 前缀(别的 cookie 一律不碰)。 */
68
+ export declare const AUTH_COOKIE_PREFIX = "dsh-auth-";
69
+ /** Node http.Server 的默认请求头上限(bytes)。宿主 web 服务没设 maxHeaderSize,
70
+ * 所以这就是宿主实际生效的门槛。 */
71
+ export declare const NODE_MAX_HEADER_SIZE = 16384;
72
+ /** 我们把上限抬到的值(bytes)。64 KB ≈ 280 条 cookie —— 远超 Chromium 的
73
+ * 每域 cookie 上限(180),所以清理一旦失效也不会顶到 Chromium 的淘汰线。 */
74
+ export declare const DEFAULT_MAX_HEADER_BYTES = 65536;
75
+ /** Chromium 会话 cookie 之外的请求头估值(Host / UA / sec-ch-* / Accept-* …)。 */
76
+ export declare const OTHER_HEADER_BYTES = 600;
77
+ /** 单条 cookie 的实测字节:name 52 + value 173 + 2 个分隔符 ≈ 227。 */
78
+ export declare const PER_COOKIE_BYTES = 227;
79
+ /** cookie 库中的一行(只取我们用得到的列)。 */
80
+ export interface CookieRow {
81
+ host_key: string;
82
+ name: string;
83
+ value: string;
84
+ source_port: number | null;
85
+ }
86
+ /**
87
+ * 从 cookie 里取出 audience(`host:port`)。
88
+ *
89
+ * 宿主签发的是 `v1.<base64url(json)>.<hmac>`,json 里带 authority;但 Chromium
90
+ * 在 Windows 上会用 DPAPI 加密 `value` 列 ⇒ 解析多半失败 ⇒ 退回
91
+ * `host_key` + `source_port`(Chromium 自己记的源端口,一直是对的)。
92
+ */
93
+ export declare function authorityOf(cookie: CookieRow): string | undefined;
94
+ /** 从 audience 里取端口。 */
95
+ export declare function portOf(authority: string | undefined): number | undefined;
96
+ /**
97
+ * 请求头投影:Chromium 会把同一 host 的全部 cookie 塞进 Cookie 头。
98
+ *
99
+ * @param cookies - 参与发送的 cookie 行
100
+ */
101
+ export declare function projectHeaderBytes(cookies: CookieRow[]): number;
102
+ /** 还能撑几次启动(每次新增一条 cookie)。 */
103
+ export declare function remainingLaunches(cookies: CookieRow[]): number;
104
+ /** 一条 cookie 的判定结果。 */
105
+ export interface CookieVerdict {
106
+ cookie: CookieRow;
107
+ authority: string | undefined;
108
+ port: number | undefined;
109
+ /** 端口已死 = 历次启动的残骸,可以删。 */
110
+ stale: boolean;
111
+ reason: string;
112
+ }
113
+ /**
114
+ * 把 auth cookie 分成「活的」与「死的」。
115
+ *
116
+ * @param cookies - 库里的全部行(函数自己只挑 `dsh-auth-*`)
117
+ * @param isAlive - (port) => Promise<boolean>,端口存活探针(可注入以便自证)
118
+ */
119
+ export declare function classifyCookies(cookies: CookieRow[], isAlive: (port: number) => Promise<boolean>): Promise<{
120
+ auth: CookieRow[];
121
+ foreign: CookieRow[];
122
+ stale: CookieVerdict[];
123
+ live: CookieVerdict[];
124
+ }>;
125
+ /**
126
+ * 抬高 web 服务的请求头上限。
127
+ *
128
+ * Node 在**每条连接**建立时把 `server.maxHeaderSize` 读进 parser ⇒ 在握手
129
+ * 之前改好即可生效。
130
+ *
131
+ * ⚠️ 实测坑:`http.createServer()` 建出来的 server 上,`maxHeaderSize` 是
132
+ * **undefined**(不是 16384!)—— Node 把默认值放在 parser 里。所以
133
+ * 「读到的不是数字 ⇒ 不是 http server」这个判据是错的,会让这道防线永远
134
+ * 抬不上。真正的判据是「它像不像一个 http server」(有 listen/close)。
135
+ *
136
+ * @returns 是否真的改了(false = 没接口 / 已经够大 / 被禁用 / 不是 server)
137
+ */
138
+ export declare function applyHeaderBudget(server: unknown, bytes: number): boolean;
139
+ /** 桌面版 cookie 库的默认位置(各平台 Electron userData 目录)。 */
140
+ export declare function defaultJarPath(env?: NodeJS.ProcessEnv): string;
141
+ /** 端口上是否还有进程在监听(= 该 cookie 的宿主还活着)。 */
142
+ export declare function probePort(port: number, host?: string, timeoutMs?: number): Promise<boolean>;
143
+ /** 清理结果(给日志看的客观事实,不含任何 cookie 明文)。 */
144
+ export interface JanitorReport {
145
+ /** cookie 库路径(不存在 ⇒ 根本没有桌面版环境)。 */
146
+ jar: string;
147
+ /** 库可读吗?不可读 = 打不开(被 Electron 锁着 / 文件损坏)。 */
148
+ opened: boolean;
149
+ /** 库里的 auth cookie 总数。 */
150
+ authCount: number;
151
+ /** 删掉的条数。 */
152
+ removed: number;
153
+ /** 清理后的请求头投影字节数。 */
154
+ projectedBytes: number;
155
+ /** 清理后还能撑几次启动。 */
156
+ launchesLeft: number;
157
+ /** 出错时的说明(可空)。 */
158
+ error?: string;
159
+ }
160
+ /**
161
+ * 清一次 cookie 库。
162
+ *
163
+ * 全程不抛:库不存在 / 被 Electron 锁着 / 没有 node:sqlite —— 都只写进报告。
164
+ */
165
+ export declare function cleanCookieJar(jarPath: string, isAlive?: (port: number) => Promise<boolean>): Promise<JanitorReport>;
166
+ export interface Config {
167
+ /** 关掉整个插件(默认开)。 */
168
+ enabled: boolean;
169
+ /** 请求头上限(bytes);0 = 不动宿主。 */
170
+ maxHeaderBytes: number;
171
+ /** cookie 库路径;空 = 按平台默认猜。 */
172
+ jarPath: string;
173
+ }
174
+ export declare const Config: Schema<Config>;
175
+ interface WebServerFace {
176
+ server?: {
177
+ maxHeaderSize?: number;
178
+ };
179
+ }
180
+ /** 宿主 web 服务(@deepseek-ai/dsh-host-webserver)注入的服务名。 */
181
+ export declare const WEB_SERVER_SERVICE = "webServer";
182
+ /**
183
+ * 是不是跑在 Electron 里(= 桌面版)。
184
+ *
185
+ * 桌面版的宿主进程是 Electron 以 `ELECTRON_RUN_AS_NODE=1` 拉起来的
186
+ * (apps/desktop-host/src/index.ts 的 packageManager),所以宿主进程里
187
+ * `process.versions.electron` 有值(实测 44.7.0)。headless profile
188
+ * (web / tui / dsh-edge-agent)由普通 Node 拉起 ⇒ 没有这个字段。
189
+ */
190
+ export declare function isDesktopRuntime(versions?: Record<string, string | undefined>): boolean;
191
+ /**
192
+ * 从 inject 回调拿到的 ctx 代理里取出宿主 web 服务。
193
+ *
194
+ * cordis 的 `ctx.inject(deps, cb)` 把 **ctx 代理**交给回调(不是服务本身),
195
+ * 注入的服务要从代理上按**服务名**取(`raw.webServer`);直接读别的属性
196
+ * 会被代理拒绝("cannot get property X without inject")。
197
+ */
198
+ export declare function webServerOf(raw: unknown): WebServerFace | undefined;
199
+ /** 立刻抬高上限(web 服务的 http server 已经存在时)。 */
200
+ export declare function raiseHeaderBudget(raw: unknown, bytes: number): boolean;
201
+ /**
202
+ * 等 web 服务把 http server 建出来,再抬上限。
203
+ *
204
+ * 宿主 web 服务的 `server` 字段是在 `listen` 的 effect 里创建的
205
+ * (`this.server = createServer(listener)`),而 inject 回调在**服务构造**时
206
+ * 就触发了 ⇒ 那一刻 `server` 还是 undefined。所以这里短轮询一下:等它出现
207
+ * 立刻抬(赶在 Electron 的 welcome 握手之前),最多等 ~2 秒。
208
+ *
209
+ * @returns 是否抬成功
210
+ */
211
+ export declare function raiseHeaderBudgetWhenReady(raw: unknown, bytes: number, attempts?: number, intervalMs?: number, schedule?: (fn: () => void, ms: number) => void): Promise<boolean>;
212
+ export declare function apply(ctx: Context, config: Config): Promise<() => void>;
213
+ export {};
214
+ //# sourceMappingURL=desktop-cookie-janitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"desktop-cookie-janitor.d.ts","sourceRoot":"","sources":["../../src/dsh-adapter/desktop-cookie-janitor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,MAAM,MAAM,0BAA0B,CAAA;AAM7C,eAAO,MAAM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