dsh-edge 0.1.0

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 (159) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +6 -0
  3. package/README.md +183 -0
  4. package/README.zh.md +183 -0
  5. package/THIRD_PARTY_NOTICES.md +199 -0
  6. package/dist/_headers +3 -0
  7. package/dist/assets/fonts/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  8. package/dist/assets/fonts/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  9. package/dist/assets/fonts/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  10. package/dist/assets/fonts/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  11. package/dist/assets/fonts/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  12. package/dist/assets/fonts/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  13. package/dist/assets/fonts/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  14. package/dist/assets/fonts/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  15. package/dist/assets/fonts/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  16. package/dist/assets/fonts/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  17. package/dist/assets/fonts/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  18. package/dist/assets/fonts/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  19. package/dist/assets/fonts/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  20. package/dist/assets/fonts/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  21. package/dist/assets/fonts/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  22. package/dist/assets/fonts/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  23. package/dist/assets/fonts/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  24. package/dist/assets/fonts/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  25. package/dist/assets/fonts/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  26. package/dist/assets/fonts/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  27. package/dist/assets/fonts/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  28. package/dist/assets/fonts/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  29. package/dist/assets/fonts/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  30. package/dist/assets/fonts/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  31. package/dist/assets/fonts/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  32. package/dist/assets/fonts/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  33. package/dist/assets/fonts/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  34. package/dist/assets/fonts/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  35. package/dist/assets/fonts/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  36. package/dist/assets/fonts/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  37. package/dist/assets/fonts/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  38. package/dist/assets/fonts/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  39. package/dist/assets/fonts/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  40. package/dist/assets/fonts/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  41. package/dist/assets/fonts/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  42. package/dist/assets/fonts/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  43. package/dist/assets/fonts/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  44. package/dist/assets/fonts/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  45. package/dist/assets/fonts/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  46. package/dist/assets/fonts/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  47. package/dist/assets/fonts/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  48. package/dist/assets/fonts/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  49. package/dist/assets/fonts/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  50. package/dist/assets/fonts/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  51. package/dist/assets/fonts/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  52. package/dist/assets/fonts/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  53. package/dist/assets/fonts/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  54. package/dist/assets/fonts/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  55. package/dist/assets/fonts/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  56. package/dist/assets/fonts/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  57. package/dist/assets/fonts/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  58. package/dist/assets/fonts/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  59. package/dist/assets/fonts/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  60. package/dist/assets/fonts/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  61. package/dist/assets/fonts/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  62. package/dist/assets/fonts/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  63. package/dist/assets/fonts/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  64. package/dist/assets/fonts/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  65. package/dist/assets/fonts/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  66. package/dist/assets/index-C-1AiF3k.js +112 -0
  67. package/dist/assets/index-CSGf6Qzd.css +1 -0
  68. package/dist/assets/langs/c-BIGW1oBm.js +2 -0
  69. package/dist/assets/langs/cpp-DIPi6g--.js +2 -0
  70. package/dist/assets/langs/csharp-DSvCPggb.js +2 -0
  71. package/dist/assets/langs/css-CLj8gQPS.js +2 -0
  72. package/dist/assets/langs/go-C27-OAKa.js +2 -0
  73. package/dist/assets/langs/html-CfGypltT.js +2 -0
  74. package/dist/assets/langs/ini-BEwlwnbL.js +2 -0
  75. package/dist/assets/langs/java-CylS5w8V.js +2 -0
  76. package/dist/assets/langs/kotlin-BdnUsdx6.js +2 -0
  77. package/dist/assets/langs/less-B1dDrJ26.js +2 -0
  78. package/dist/assets/langs/lua-BaeVxFsk.js +2 -0
  79. package/dist/assets/langs/markdown-Cvjx9yec.js +2 -0
  80. package/dist/assets/langs/mdx-Cmh6b_Ma.js +2 -0
  81. package/dist/assets/langs/php-D-uCvoST.js +2 -0
  82. package/dist/assets/langs/python-B6aJPvgy.js +2 -0
  83. package/dist/assets/langs/ruby-DEItuUFs.js +2 -0
  84. package/dist/assets/langs/rust-B1yitclQ.js +2 -0
  85. package/dist/assets/langs/scss-D5BDwBP9.js +2 -0
  86. package/dist/assets/langs/sql-CRqJ_cUM.js +2 -0
  87. package/dist/assets/langs/swift-D82vCrfD.js +2 -0
  88. package/dist/assets/langs/toml-vGWfd6FD.js +2 -0
  89. package/dist/assets/langs/xml-sdJ4AIDG.js +2 -0
  90. package/dist/assets/langs/yaml-Buea-lGh.js +2 -0
  91. package/dist/assets/vendor-Cjbwl5VI.js +411 -0
  92. package/dist/assets/vendor-CjyC-hUb.css +1 -0
  93. package/dist/favicon.svg +8 -0
  94. package/dist/index.html +35 -0
  95. package/dist/manifest.webmanifest +16 -0
  96. package/dist/plugins/@deepseek-ai/dsh-api-gateway/client.js +420 -0
  97. package/dist/plugins/@deepseek-ai/dsh-api-remotes/client.js +5937 -0
  98. package/dist/plugins/@deepseek-ai/dsh-client-connection/client.js +10207 -0
  99. package/dist/plugins/@deepseek-ai/dsh-client-locale/client.js +1231 -0
  100. package/dist/plugins/@deepseek-ai/dsh-client-modules/client.js +259 -0
  101. package/dist/plugins/@deepseek-ai/dsh-client-runtime/client.js +10539 -0
  102. package/dist/plugins/@deepseek-ai/dsh-client-ui-agent-preset/client.js +1725 -0
  103. package/dist/plugins/@deepseek-ai/dsh-client-ui-commands/client.js +1116 -0
  104. package/dist/plugins/@deepseek-ai/dsh-client-ui-conversation/client.js +9832 -0
  105. package/dist/plugins/@deepseek-ai/dsh-client-ui-deliverables/client.js +373 -0
  106. package/dist/plugins/@deepseek-ai/dsh-client-ui-edge/client.js +549 -0
  107. package/dist/plugins/@deepseek-ai/dsh-client-ui-input-trigger/client.js +859 -0
  108. package/dist/plugins/@deepseek-ai/dsh-client-ui-jobs/client.js +280 -0
  109. package/dist/plugins/@deepseek-ai/dsh-client-ui-layout/client.js +456 -0
  110. package/dist/plugins/@deepseek-ai/dsh-client-ui-model-selection/client.js +804 -0
  111. package/dist/plugins/@deepseek-ai/dsh-client-ui-permission-presets/client.js +461 -0
  112. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings/client.js +254 -0
  113. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-general/client.js +609 -0
  114. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar/client.js +292 -0
  115. package/dist/plugins/@deepseek-ai/dsh-client-ui-skill/client.js +327 -0
  116. package/dist/plugins/@deepseek-ai/dsh-client-ui-subagent/client.js +710 -0
  117. package/dist/plugins/@deepseek-ai/dsh-client-ui-theme/client.js +1312 -0
  118. package/dist/plugins/@deepseek-ai/dsh-client-ui-tool/client.js +1630 -0
  119. package/dist/plugins/@deepseek-ai/dsh-client-ui-trajectory/client.js +7370 -0
  120. package/dist/plugins/@deepseek-ai/dsh-client-ui-user-questions/client.js +700 -0
  121. package/dist/plugins/@deepseek-ai/dsh-client-ui-workflow-run/client.js +474 -0
  122. package/dist/plugins/@deepseek-ai/dsh-client-ui-workspace/client.js +2426 -0
  123. package/dist/plugins/@deepseek-ai/dsh-typert-registry/client.js +1372 -0
  124. package/package.json +97 -0
  125. package/scripts/assemble-web.mjs +230 -0
  126. package/scripts/bundle-size.d.mts +2 -0
  127. package/scripts/bundle-size.mjs +26 -0
  128. package/scripts/bundle.mjs +53 -0
  129. package/scripts/cli.d.mts +39 -0
  130. package/scripts/cli.mjs +496 -0
  131. package/scripts/install.d.mts +149 -0
  132. package/scripts/install.mjs +989 -0
  133. package/scripts/legal-files.mjs +24 -0
  134. package/scripts/verify-packed.mjs +32 -0
  135. package/scripts/wrangler-config.d.mts +18 -0
  136. package/scripts/wrangler-config.mjs +84 -0
  137. package/src/agent.ts +119 -0
  138. package/src/auth.ts +352 -0
  139. package/src/deepseek.ts +231 -0
  140. package/src/deployment.ts +147 -0
  141. package/src/direct-shell-core-empty.ts +10 -0
  142. package/src/direct-shell-protocol.ts +5 -0
  143. package/src/direct-shell.ts +341 -0
  144. package/src/do-session-persistence.ts +1064 -0
  145. package/src/edge-api.ts +796 -0
  146. package/src/edge-credentials.ts +56 -0
  147. package/src/edge-remotes.ts +41 -0
  148. package/src/edge-workspace-store.ts +339 -0
  149. package/src/http.ts +212 -0
  150. package/src/index.ts +196 -0
  151. package/src/instance.ts +1007 -0
  152. package/src/isolated-direct-shell-unavailable.ts +11 -0
  153. package/src/protocol.ts +39 -0
  154. package/src/release.ts +9 -0
  155. package/src/session-store.ts +1110 -0
  156. package/src/sse.ts +86 -0
  157. package/src/web-search.ts +38 -0
  158. package/src/workspace.ts +270 -0
  159. package/wrangler.jsonc +56 -0
@@ -0,0 +1,254 @@
1
+ window.__ModuleLoader__.load({
2
+ id: "@deepseek-ai/dsh-client-ui-settings",
3
+ factory: (require) => {
4
+ var module = { exports: {} };
5
+ var exports = module.exports;
6
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
+ let _deepseek_ai_cordis = require("@deepseek-ai/cordis");
8
+ let _deepseek_ai_dsh_client_schema_form = require("@deepseek-ai/dsh-client-schema-form");
9
+ let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
10
+ //#region lib/types/client/settings-scope.js
11
+ /**
12
+ * Host transport for the settings-namespace scope contract. The contract types
13
+ * live in `dsh-client-runtime` (the common dependency of every feature that
14
+ * owns a preference); this file owns the wire behavior and the invalidation
15
+ * subscription, both of which are Settings-surface concerns.
16
+ */
17
+ /**
18
+ * Serializes one namespace's Host reads and writes behind a snapshot store.
19
+ * Reads never block plugin activation; writes carry the latest known
20
+ * namespace revision and teardown waits for the operation already crossing
21
+ * the wire.
22
+ */
23
+ var SettingsScopeController = class {
24
+ api;
25
+ spec;
26
+ persistence;
27
+ store;
28
+ tail = Promise.resolve();
29
+ readGeneration = 0;
30
+ writeGeneration = 0;
31
+ disposed = false;
32
+ /**
33
+ * @param api - settings wire face.
34
+ * @param spec - namespace identity and optional narrowing decoder.
35
+ * @param persistence - remote browsers remain process-local because settings RPCs are loopback-only.
36
+ */
37
+ constructor(api, spec, persistence = "host") {
38
+ this.api = api;
39
+ this.spec = spec;
40
+ this.persistence = persistence;
41
+ this.store = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)({
42
+ status: persistence === "host" ? "loading" : "unavailable",
43
+ value: void 0,
44
+ base: void 0,
45
+ user: void 0,
46
+ revision: void 0,
47
+ writable: false,
48
+ mode: persistence
49
+ });
50
+ }
51
+ /** @returns the current sync snapshot (stable reference until the next change). */
52
+ getSnapshot() {
53
+ return this.store.getSnapshot();
54
+ }
55
+ /**
56
+ * Observe snapshot replacements.
57
+ * @param listener - invoked after each snapshot change.
58
+ * @returns the disposer removing this listener.
59
+ */
60
+ subscribe(listener) {
61
+ return this.store.subscribe(listener);
62
+ }
63
+ /**
64
+ * Queue a Host refresh; a newer read or user write suppresses stale publication.
65
+ * @returns settlement after the queued read completes or is skipped.
66
+ */
67
+ load() {
68
+ const generation = ++this.readGeneration;
69
+ return this.enqueue(() => this.read(generation));
70
+ }
71
+ /**
72
+ * Queue one field write; see {@link SettingsScope.set} for the ordering,
73
+ * revision, and recovery contract.
74
+ * @param field - scalar field inside the namespace section.
75
+ * @param value - JSON-shaped value selected by the user.
76
+ * @returns settlement after the write and any latest-write recovery read.
77
+ */
78
+ set(field, value) {
79
+ return this.write({
80
+ op: "set",
81
+ path: [field],
82
+ value
83
+ });
84
+ }
85
+ /**
86
+ * Queue one field clear; see {@link SettingsScope.unset} for the ordering,
87
+ * revision, and recovery contract.
88
+ * @param field - scalar field inside the namespace section.
89
+ * @returns settlement after the clear and any latest-write recovery read.
90
+ */
91
+ unset(field) {
92
+ return this.write({
93
+ op: "unset",
94
+ path: [field]
95
+ });
96
+ }
97
+ write(op) {
98
+ this.readGeneration += 1;
99
+ const generation = ++this.writeGeneration;
100
+ return this.enqueue(async () => {
101
+ const revision = this.getSnapshot().revision;
102
+ let response;
103
+ try {
104
+ response = await this.api.settings.mutate({
105
+ ns: this.spec.namespace,
106
+ ops: [op],
107
+ ...revision === void 0 ? {} : { expectedRevision: revision }
108
+ });
109
+ } catch (_settingsWriteFailure) {
110
+ if (!this.disposed && generation === this.writeGeneration) await this.read(++this.readGeneration);
111
+ return;
112
+ }
113
+ if (!response.result.ok) {
114
+ if (!this.disposed && generation === this.writeGeneration) await this.read(++this.readGeneration);
115
+ return;
116
+ }
117
+ this.accept(response.result.value, generation === this.writeGeneration);
118
+ });
119
+ }
120
+ /**
121
+ * Stop queued operations and wait for the current wire call to settle.
122
+ * @returns settlement after the controller reaches quiescence.
123
+ */
124
+ async dispose() {
125
+ this.disposed = true;
126
+ this.readGeneration += 1;
127
+ this.writeGeneration += 1;
128
+ await this.tail;
129
+ }
130
+ enqueue(operation) {
131
+ if (this.persistence === "memory" || this.disposed) return Promise.resolve();
132
+ const task = this.tail.then(async () => {
133
+ if (this.disposed) return;
134
+ await operation();
135
+ });
136
+ this.tail = task.catch(() => {});
137
+ return task;
138
+ }
139
+ async read(generation) {
140
+ let response;
141
+ try {
142
+ response = await this.api.settings.describe({});
143
+ } catch (_settingsReadFailure) {
144
+ return;
145
+ }
146
+ if (!response.result.ok || this.disposed) return;
147
+ const { namespaces, writable } = response.result.value;
148
+ const view = namespaces.find((candidate) => candidate.ns === this.spec.namespace);
149
+ const publish = generation === this.readGeneration;
150
+ if (view === void 0) {
151
+ if (publish) this.store.update((draft) => {
152
+ draft.status = "unavailable";
153
+ draft.writable = writable;
154
+ });
155
+ return;
156
+ }
157
+ this.accept(view, publish, writable);
158
+ }
159
+ accept(view, publish, writable) {
160
+ const decoded = publish ? this.decode(view) : void 0;
161
+ this.store.update((draft) => {
162
+ draft.revision = view.revision;
163
+ draft.base = view.base;
164
+ draft.user = view.user;
165
+ if (writable !== void 0) draft.writable = writable;
166
+ if (decoded === void 0) return;
167
+ draft.status = "ready";
168
+ draft.value = decoded;
169
+ });
170
+ }
171
+ decode(view) {
172
+ if (this.spec.decode !== void 0) return this.spec.decode(view.value);
173
+ if (typeof view.value !== "object" || view.value === null || Array.isArray(view.value)) return void 0;
174
+ let failure;
175
+ try {
176
+ failure = (0, _deepseek_ai_dsh_client_schema_form.validateDraft)((0, _deepseek_ai_dsh_client_schema_form.rehydrateSchema)(view.schema), view.value);
177
+ } catch (_malformedSchemaEnvelope) {
178
+ return;
179
+ }
180
+ return failure === void 0 ? view.value : void 0;
181
+ }
182
+ };
183
+ /**
184
+ * The settings domain's base service. Features that own a preference reach the
185
+ * settings transport through this service rather than a shared function: the
186
+ * client bundle purity gate forbids cross-plugin value imports and directs
187
+ * cross-plugin collaboration through cordis services
188
+ * (`packages/client/tsdown.client.ts`).
189
+ */
190
+ var SettingsScopeBinder = class extends _deepseek_ai_cordis.Service {
191
+ /**
192
+ * @param ctx - the providing plugin's context.
193
+ */
194
+ constructor(ctx) {
195
+ super(ctx, "settingsScope");
196
+ }
197
+ /**
198
+ * Bind one namespace scope to settings and connection invalidations on the
199
+ * CALLER's plugin lifecycle — the service proxy binds `this.ctx` to the
200
+ * caller at call time, so the scope's disposer belongs to the calling fiber.
201
+ * Listeners exist before the initial background read starts, so activation
202
+ * never blocks on the settings transport. The caller injects `connection`
203
+ * for the transport and `remote` for the forwarded settings invalidation.
204
+ * @param spec - domain-owned namespace contract.
205
+ * @returns the bound scope consumed by the domain's services and rows.
206
+ */
207
+ bind(spec) {
208
+ const ctx = this.ctx;
209
+ const connection = ctx.get("connection");
210
+ const controller = new SettingsScopeController(connection.api, spec, connection.isLoopback ? "host" : "memory");
211
+ ctx.effect(() => {
212
+ const refresh = (namespace) => {
213
+ if (namespace !== void 0 && namespace !== spec.namespace) return;
214
+ controller.load();
215
+ };
216
+ const disposers = [ctx.get("remote").$on("settings/document-updated", refresh), ctx.on("connection/reset", () => {
217
+ refresh();
218
+ })];
219
+ controller.load();
220
+ return async () => {
221
+ for (const dispose of disposers) dispose();
222
+ await controller.dispose();
223
+ };
224
+ }, `ui-settings: ${spec.namespace} settings scope`);
225
+ return controller;
226
+ }
227
+ };
228
+ //#endregion
229
+ //#region lib/types/client/index.js
230
+ /**
231
+ * Required services: none. The transport is resolved per caller through
232
+ * `this.ctx` at `bind` time, so this plugin waits for nothing.
233
+ */
234
+ const inject = [];
235
+ /**
236
+ * Provide the settings-namespace scope service.
237
+ *
238
+ * Constructing the service in this plugin's fiber keeps its traced methods
239
+ * bound to each consuming plugin's context.
240
+ * @param ctx - client root context.
241
+ */
242
+ function apply(ctx) {
243
+ new SettingsScopeBinder(ctx);
244
+ }
245
+ //#endregion
246
+ exports.SettingsScopeBinder = SettingsScopeBinder;
247
+ exports.SettingsScopeController = SettingsScopeController;
248
+ exports.apply = apply;
249
+ exports.inject = inject;
250
+ return module.exports;
251
+ }
252
+ });
253
+
254
+ //# sourceMappingURL=client.js.map