dsh-edge 0.1.3 → 0.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.i18n.yaml +6 -6
  2. package/README.md +21 -8
  3. package/README.zh.md +21 -8
  4. package/THIRD_PARTY_NOTICES.md +10019 -187
  5. package/dist/index.html +1 -1
  6. package/dist/plugins/@deepseek-ai/dsh-client-locale/client.js +7 -7
  7. package/dist/plugins/@deepseek-ai/dsh-client-ui-agent-preset/client.js +61 -61
  8. package/dist/plugins/@deepseek-ai/dsh-client-ui-commands/client.js +14 -14
  9. package/dist/plugins/@deepseek-ai/dsh-client-ui-conversation/client.js +287 -287
  10. package/dist/plugins/@deepseek-ai/dsh-client-ui-deliverables/client.js +10 -10
  11. package/dist/plugins/@deepseek-ai/dsh-client-ui-input-trigger/client.js +11 -11
  12. package/dist/plugins/@deepseek-ai/dsh-client-ui-jobs/client.js +15 -15
  13. package/dist/plugins/@deepseek-ai/dsh-client-ui-layout/client.js +8 -8
  14. package/dist/plugins/@deepseek-ai/dsh-client-ui-model-selection/client.js +27 -27
  15. package/dist/plugins/@deepseek-ai/dsh-client-ui-permission-presets/client.js +8 -8
  16. package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-general/client.js +31 -31
  17. package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar/client.js +23 -23
  18. package/dist/plugins/@deepseek-ai/dsh-client-ui-skill/client.js +19 -19
  19. package/dist/plugins/@deepseek-ai/dsh-client-ui-subagent/client.js +29 -29
  20. package/dist/plugins/@deepseek-ai/dsh-client-ui-theme/client.js +7 -7
  21. package/dist/plugins/@deepseek-ai/dsh-client-ui-tool/client.js +64 -64
  22. package/dist/plugins/@deepseek-ai/dsh-client-ui-trajectory/client.js +183 -183
  23. package/dist/plugins/@deepseek-ai/dsh-client-ui-user-questions/client.js +44 -44
  24. package/dist/plugins/@deepseek-ai/dsh-client-ui-workflow-run/client.js +24 -24
  25. package/dist/plugins/@deepseek-ai/dsh-client-ui-workspace/client.js +79 -79
  26. package/dist/plugins/dsh-edge-client-ui/client.js +68 -53
  27. package/package.json +22 -22
  28. package/scripts/dev.mjs +38 -0
  29. package/scripts/install.mjs +77 -3
  30. package/scripts/legal-files.d.mts +23 -0
  31. package/scripts/legal-files.mjs +218 -40
  32. package/scripts/publish.d.mts +25 -0
  33. package/scripts/publish.mjs +145 -0
  34. package/scripts/smoke-installed.mjs +27 -22
  35. package/scripts/verify-packed.mjs +8 -0
  36. package/scripts/wrangler-config-core.mjs +107 -0
  37. package/scripts/wrangler-config.d.mts +2 -0
  38. package/scripts/wrangler-config.mjs +9 -78
  39. package/worker/direct/index.js +1136 -1139
  40. package/worker/isolated/index.js +872 -875
  41. package/scripts/assemble-web.mjs +0 -230
  42. package/scripts/bundle.mjs +0 -86
@@ -8,11 +8,11 @@ window.__ModuleLoader__.load({
8
8
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
9
9
  //#endregion
10
10
  let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
11
- let react_jsx_runtime = require("react/jsx-runtime");
12
11
  let react = require("react");
13
12
  let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
13
+ let react_jsx_runtime = require("react/jsx-runtime");
14
14
  //#endregion
15
- //#region lib/types/client/store.js
15
+ //#region ../../../packages/client/ui-edge/src/client/store.ts
16
16
  var import_umd = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
17
17
  (function(global, factory) {
18
18
  typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.compareVersions = {}));
@@ -180,10 +180,16 @@ window.__ModuleLoader__.load({
180
180
  exports$1.validateStrict = validateStrict;
181
181
  }));
182
182
  })))();
183
- /** Repeatable command for upgrading an existing Edge deployment. */
184
- const DSH_EDGE_UPGRADE_COMMAND = "pnpm dlx dsh-edge@latest upgrade";
185
183
  /** Public release history for the Edge distribution. */
186
184
  const DSH_EDGE_RELEASES_URL = "https://github.com/pawaca/dsh-edge/releases";
185
+ /** Stable deployments follow latest; prerelease deployments stay on next. */
186
+ function releaseChannel(version) {
187
+ return (0, import_umd.validate)(version) && version.includes("-") ? "next" : "latest";
188
+ }
189
+ /** Repeatable command for upgrading without crossing release channels. */
190
+ function upgradeCommand(version) {
191
+ return `npx dsh-edge@${releaseChannel(version)} upgrade`;
192
+ }
187
193
  function releaseStatus(current, latest) {
188
194
  if (!(0, import_umd.validate)(current) || current === "0.0.0") return "development";
189
195
  if (latest === void 0 || !(0, import_umd.validate)(latest)) return "unavailable";
@@ -223,16 +229,18 @@ window.__ModuleLoader__.load({
223
229
  const health = await healthResponse.json();
224
230
  if (!isHealth(health)) throw new Error("Invalid Edge health response");
225
231
  if (generation !== this.loadGeneration) return;
232
+ const channel = releaseChannel(health.version);
226
233
  this.store.update((state) => {
227
234
  state.status = "ready";
228
235
  state.health = health;
236
+ state.releaseChannel = channel;
229
237
  state.releaseStatus = releaseStatus(health.version);
230
238
  delete state.latestVersion;
231
239
  delete state.error;
232
240
  });
233
241
  let latestVersion;
234
242
  try {
235
- const releaseResponse = await this.io.fetch("https://registry.npmjs.org/dsh-edge/latest", { signal: AbortSignal.timeout(5e3) });
243
+ const releaseResponse = await this.io.fetch(`https://registry.npmjs.org/dsh-edge/${channel}`, { signal: AbortSignal.timeout(5e3) });
236
244
  if (releaseResponse.ok) {
237
245
  const release = await releaseResponse.json();
238
246
  if (release !== null && typeof release === "object" && typeof release.version === "string") latestVersion = release.version;
@@ -252,10 +260,11 @@ window.__ModuleLoader__.load({
252
260
  });
253
261
  }
254
262
  }
255
- /** Copy the stable upgrade command without affecting health or owner-session state. */
263
+ /** Copy the matching channel upgrade command without affecting deployment state. */
256
264
  async copyUpgrade() {
257
265
  try {
258
- await this.io.copy(DSH_EDGE_UPGRADE_COMMAND);
266
+ const version = this.store.getSnapshot().health?.version ?? "0.0.0";
267
+ await this.io.copy(upgradeCommand(version));
259
268
  this.store.update((state) => {
260
269
  state.copied = true;
261
270
  delete state.copyError;
@@ -290,9 +299,9 @@ window.__ModuleLoader__.load({
290
299
  }
291
300
  };
292
301
  //#endregion
293
- //#region \0dsh-css:D:\a\dsh-edge\dsh-edge\packages\client\ui-edge\src\client\EdgeSettingsSection.module.css.mjs
294
- const css = ".B8bxQq_section{gap:20px;max-width:720px;display:grid}.B8bxQq_section header h2,.B8bxQq_card h3{color:var(--dsw-alias-text-primary);margin:0}.B8bxQq_section header p,.B8bxQq_card p{color:var(--dsw-alias-label-secondary)}.B8bxQq_card{border:1px solid var(--dsw-alias-border-subtle);border-radius:12px;padding:18px}.B8bxQq_card dl{margin:12px 0}.B8bxQq_row{border-bottom:1px solid var(--dsw-alias-border-secondary);grid-template-columns:minmax(150px,1fr) minmax(0,2fr);gap:16px;padding:8px 0;display:grid}.B8bxQq_row:last-child{border-bottom:0}.B8bxQq_row dt{color:var(--dsw-alias-label-secondary)}.B8bxQq_row dd{overflow-wrap:anywhere;color:var(--dsw-alias-text-primary);margin:0}.B8bxQq_actions{flex-wrap:wrap;align-items:center;gap:12px;display:flex}.B8bxQq_actions a{color:var(--dsw-alias-brand-primary)}.B8bxQq_status{align-items:center;gap:8px;display:flex}.B8bxQq_notice{color:var(--dsw-alias-label-secondary)}.B8bxQq_error{color:var(--dsw-alias-state-error-primary)!important}@media (width<=560px){.B8bxQq_row{grid-template-columns:1fr;gap:4px}}";
295
- const tagId = "dsh-edge-client-ui/EdgeSettingsSection.module.css";
302
+ //#region \0dsh-edge-css:src/client/EdgeSettingsSection.module.css.mjs
303
+ const css = "._68Y4qa_section{gap:20px;max-width:720px;display:grid}._68Y4qa_section header h2,._68Y4qa_card h3{color:var(--dsw-alias-text-primary);margin:0}._68Y4qa_section header p,._68Y4qa_card p{color:var(--dsw-alias-label-secondary)}._68Y4qa_card{border:1px solid var(--dsw-alias-border-subtle);border-radius:12px;padding:18px}._68Y4qa_card dl{margin:12px 0}._68Y4qa_row{border-bottom:1px solid var(--dsw-alias-border-secondary);grid-template-columns:minmax(150px,1fr) minmax(0,2fr);gap:16px;padding:8px 0;display:grid}._68Y4qa_row:last-child{border-bottom:0}._68Y4qa_row dt{color:var(--dsw-alias-label-secondary)}._68Y4qa_row dd{overflow-wrap:anywhere;color:var(--dsw-alias-text-primary);margin:0}._68Y4qa_actions{flex-wrap:wrap;align-items:center;gap:12px;display:flex}._68Y4qa_actions a{color:var(--dsw-alias-brand-primary)}._68Y4qa_status{align-items:center;gap:8px;display:flex}._68Y4qa_notice{color:var(--dsw-alias-label-secondary)}._68Y4qa_error{color:var(--dsw-alias-state-error-primary)!important}@media (width<=560px){._68Y4qa_row{grid-template-columns:1fr;gap:4px}}";
304
+ const tagId = "dsh-edge-client-ui/src/client/EdgeSettingsSection.module.css";
296
305
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
297
306
  const tag = document.createElement("style");
298
307
  tag.dataset.plugin = "dsh-edge-client-ui";
@@ -301,20 +310,20 @@ window.__ModuleLoader__.load({
301
310
  document.head.appendChild(tag);
302
311
  }
303
312
  var EdgeSettingsSection_module_css_default = {
304
- "actions": "B8bxQq_actions",
305
- "status": "B8bxQq_status",
306
- "card": "B8bxQq_card",
307
- "row": "B8bxQq_row",
308
- "error": "B8bxQq_error",
309
- "notice": "B8bxQq_notice",
310
- "section": "B8bxQq_section"
313
+ "actions": "_68Y4qa_actions",
314
+ "card": "_68Y4qa_card",
315
+ "error": "_68Y4qa_error",
316
+ "notice": "_68Y4qa_notice",
317
+ "row": "_68Y4qa_row",
318
+ "section": "_68Y4qa_section",
319
+ "status": "_68Y4qa_status"
311
320
  };
312
321
  //#endregion
313
- //#region lib/types/client/EdgeSettingsSection.js
322
+ //#region ../../../packages/client/ui-edge/src/client/EdgeSettingsSection.tsx
314
323
  function Row({ label, value }) {
315
- return (0, react_jsx_runtime.jsxs)("div", {
324
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
316
325
  className: EdgeSettingsSection_module_css_default.row,
317
- children: [(0, react_jsx_runtime.jsx)("dt", { children: label }), (0, react_jsx_runtime.jsx)("dd", { children: value })]
326
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("dt", { children: label }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("dd", { children: value })]
318
327
  });
319
328
  }
320
329
  function EdgeSettingsSection(props) {
@@ -323,13 +332,13 @@ window.__ModuleLoader__.load({
323
332
  load();
324
333
  }, [load]);
325
334
  const state = useEdgeSettings((snapshot) => snapshot);
326
- const deploymentDetails = state.status === "idle" || state.status === "loading" ? (0, react_jsx_runtime.jsx)("p", {
335
+ const deploymentDetails = state.status === "idle" || state.status === "loading" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
327
336
  className: EdgeSettingsSection_module_css_default.notice,
328
337
  children: t("loading")
329
- }) : state.status === "error" || state.health === void 0 ? (0, react_jsx_runtime.jsxs)("div", {
338
+ }) : state.status === "error" || state.health === void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
330
339
  className: EdgeSettingsSection_module_css_default.notice,
331
340
  role: "alert",
332
- children: [(0, react_jsx_runtime.jsx)("p", { children: t("loadFailed") }), (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
341
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("loadFailed") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
333
342
  variant: "outline",
334
343
  size: "sm",
335
344
  onClick: () => {
@@ -337,95 +346,99 @@ window.__ModuleLoader__.load({
337
346
  },
338
347
  children: t("retry")
339
348
  })]
340
- }) : (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsxs)("section", {
349
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
341
350
  className: EdgeSettingsSection_module_css_default.card,
342
351
  "aria-labelledby": "edge-release-title",
343
352
  children: [
344
- (0, react_jsx_runtime.jsx)("h3", {
353
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
345
354
  id: "edge-release-title",
346
355
  children: t("release")
347
356
  }),
348
- (0, react_jsx_runtime.jsxs)("dl", { children: [
349
- (0, react_jsx_runtime.jsx)(Row, {
357
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", { children: [
358
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
350
359
  label: t("currentVersion"),
351
360
  value: state.health.version
352
361
  }),
353
- (0, react_jsx_runtime.jsx)(Row, {
362
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
363
+ label: t("updateChannel"),
364
+ value: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { children: state.releaseChannel ?? "—" })
365
+ }),
366
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
354
367
  label: t("latestVersion"),
355
368
  value: state.latestVersion ?? "—"
356
369
  }),
357
- (0, react_jsx_runtime.jsx)(Row, {
370
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
358
371
  label: t("upstreamVersion"),
359
372
  value: state.health.upstreamVersion
360
373
  })
361
374
  ] }),
362
- (0, react_jsx_runtime.jsxs)("p", {
375
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
363
376
  className: EdgeSettingsSection_module_css_default.status,
364
- children: [state.releaseStatus === void 0 || state.releaseStatus === "unavailable" ? null : (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: state.releaseStatus === "update-available" ? "warning" : "done" }), state.releaseStatus === "latest" ? t("latest") : state.releaseStatus === "update-available" ? t("updateAvailable") : state.releaseStatus === "development" ? t("development") : t("unavailable")]
377
+ children: [state.releaseStatus === void 0 || state.releaseStatus === "unavailable" ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, { state: state.releaseStatus === "update-available" ? "warning" : "done" }), state.releaseStatus === "latest" ? t("latest") : state.releaseStatus === "update-available" ? t("updateAvailable") : state.releaseStatus === "development" ? t("development") : t("unavailable")]
365
378
  }),
366
- (0, react_jsx_runtime.jsxs)("div", {
379
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
367
380
  className: EdgeSettingsSection_module_css_default.actions,
368
- children: [state.releaseStatus === "update-available" ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
381
+ children: [state.releaseStatus === "update-available" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
369
382
  variant: "outline",
370
383
  size: "sm",
371
384
  onClick: () => {
372
385
  copyUpgrade();
373
386
  },
374
387
  children: state.copied ? t("copied") : t("copyUpgrade")
375
- }) : null, (0, react_jsx_runtime.jsx)("a", {
388
+ }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
376
389
  href: DSH_EDGE_RELEASES_URL,
377
390
  target: "_blank",
378
391
  rel: "noreferrer",
379
392
  children: t("releaseNotes")
380
393
  })]
381
394
  }),
382
- state.copyError === void 0 ? null : (0, react_jsx_runtime.jsx)("p", {
395
+ state.copyError === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
383
396
  className: EdgeSettingsSection_module_css_default.error,
384
397
  role: "alert",
385
398
  children: t("copyFailed")
386
399
  })
387
400
  ]
388
- }), (0, react_jsx_runtime.jsxs)("section", {
401
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
389
402
  className: EdgeSettingsSection_module_css_default.card,
390
403
  "aria-labelledby": "edge-runtime-title",
391
- children: [(0, react_jsx_runtime.jsx)("h3", {
404
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
392
405
  id: "edge-runtime-title",
393
406
  children: t("runtime")
394
- }), (0, react_jsx_runtime.jsxs)("dl", { children: [
395
- (0, react_jsx_runtime.jsx)(Row, {
407
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", { children: [
408
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
396
409
  label: t("runtime"),
397
410
  value: state.health.shell === "just-bash-direct" ? t("direct") : t("isolated")
398
411
  }),
399
- (0, react_jsx_runtime.jsx)(Row, {
412
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
400
413
  label: t("storage"),
401
414
  value: t("durableStorage")
402
415
  }),
403
- (0, react_jsx_runtime.jsx)(Row, {
416
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
404
417
  label: t("deploymentId"),
405
- value: (0, react_jsx_runtime.jsx)("code", { children: state.health.deploymentId })
418
+ value: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { children: state.health.deploymentId })
406
419
  })
407
420
  ] })]
408
421
  })] });
409
- return (0, react_jsx_runtime.jsxs)("div", {
422
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
410
423
  className: EdgeSettingsSection_module_css_default.section,
411
424
  children: [
412
- (0, react_jsx_runtime.jsxs)("header", { children: [(0, react_jsx_runtime.jsx)("h2", { children: t("title") }), (0, react_jsx_runtime.jsx)("p", { children: t("intro") })] }),
425
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", { children: t("title") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("intro") })] }),
413
426
  deploymentDetails,
414
- (0, react_jsx_runtime.jsxs)("section", {
427
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
415
428
  className: EdgeSettingsSection_module_css_default.card,
416
429
  "aria-labelledby": "edge-owner-title",
417
430
  children: [
418
- (0, react_jsx_runtime.jsx)("h3", {
431
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
419
432
  id: "edge-owner-title",
420
433
  children: t("ownerSession")
421
434
  }),
422
- (0, react_jsx_runtime.jsx)("p", { children: t("ownerIntro") }),
423
- state.signOutError === void 0 ? null : (0, react_jsx_runtime.jsx)("p", {
435
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: t("ownerIntro") }),
436
+ state.signOutError === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
424
437
  className: EdgeSettingsSection_module_css_default.error,
425
438
  role: "alert",
426
439
  children: t("signOutFailed")
427
440
  }),
428
- (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
441
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
429
442
  variant: "outline",
430
443
  size: "sm",
431
444
  disabled: state.signingOut,
@@ -440,7 +453,7 @@ window.__ModuleLoader__.load({
440
453
  });
441
454
  }
442
455
  //#endregion
443
- //#region lib/types/client/locales.js
456
+ //#region ../../../packages/client/ui-edge/src/client/locales.ts
444
457
  /** English copy is the key-set source of truth for the Edge settings page. */
445
458
  const en = {
446
459
  nav: "DSH Edge",
@@ -448,7 +461,8 @@ window.__ModuleLoader__.load({
448
461
  intro: "Deployment details and updates for this Cloudflare Worker.",
449
462
  release: "Release",
450
463
  currentVersion: "Installed version",
451
- latestVersion: "Latest version",
464
+ updateChannel: "Update channel",
465
+ latestVersion: "Channel version",
452
466
  upstreamVersion: "DeepSeek Harness base",
453
467
  latest: "Up to date",
454
468
  updateAvailable: "Update available",
@@ -481,7 +495,8 @@ window.__ModuleLoader__.load({
481
495
  intro: "查看此 Cloudflare Worker 的部署信息和更新。",
482
496
  release: "版本",
483
497
  currentVersion: "当前版本",
484
- latestVersion: "最新版本",
498
+ updateChannel: "更新渠道",
499
+ latestVersion: "渠道版本",
485
500
  upstreamVersion: "DeepSeek Harness 基础版本",
486
501
  latest: "已是最新版本",
487
502
  updateAvailable: "有可用更新",
@@ -508,7 +523,7 @@ window.__ModuleLoader__.load({
508
523
  signOutFailed: "退出失败,请重试。"
509
524
  };
510
525
  //#endregion
511
- //#region lib/types/client/index.js
526
+ //#region ../../../packages/client/ui-edge/src/client/index.ts
512
527
  const inject = ["slots", "locale"];
513
528
  function apply(ctx) {
514
529
  ctx.effect(() => ctx.locale.register("settings.edge", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-edge",
3
- "version": "0.1.3",
3
+ "version": "0.2.0-alpha.1",
4
4
  "description": "Run DeepSeek Harness on Cloudflare Workers as an independent community project",
5
5
  "author": "pawaca",
6
6
  "license": "MIT",
@@ -45,6 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@clack/prompts": "1.7.0",
48
+ "compare-versions": "6.1.1",
48
49
  "execa": "^10.0.0",
49
50
  "jsonc-parser": "^3.3.1",
50
51
  "wrangler": "4.123.0"
@@ -52,49 +53,48 @@
52
53
  "devDependencies": {
53
54
  "@cloudflare/computer": "0.2.0",
54
55
  "@cloudflare/workers-types": "5.20260812.1",
55
- "just-bash": "3.3.0",
56
- "playwright": "^1.49.0",
57
- "typescript": "^6.0.3",
58
- "vitest": "^4.1.8",
59
- "ws": "^8.21.0",
60
- "@deepseek-ai/dsh-brand": "0.1.0-rc.7",
61
56
  "@deepseek-ai/cordis": "4.0.1",
62
57
  "@deepseek-ai/dsh-agent": "0.1.0-rc.7",
63
58
  "@deepseek-ai/dsh-agent-loop": "0.1.0-rc.7",
59
+ "@deepseek-ai/dsh-anonymous-user-id": "0.1.0-rc.7",
60
+ "@deepseek-ai/dsh-brand": "0.1.0-rc.7",
64
61
  "@deepseek-ai/dsh-credentials": "0.1.0-rc.7",
65
62
  "@deepseek-ai/dsh-host-apiproxy": "0.1.0-rc.7",
66
- "@deepseek-ai/dsh-anonymous-user-id": "0.1.0-rc.7",
67
63
  "@deepseek-ai/dsh-launch-environment": "0.1.0-rc.7",
68
64
  "@deepseek-ai/dsh-llm": "0.1.0-rc.7",
69
65
  "@deepseek-ai/dsh-llm-deepseek": "0.1.0-rc.7",
70
66
  "@deepseek-ai/dsh-session": "0.1.0-rc.7",
71
67
  "@deepseek-ai/dsh-session-persistence": "0.1.0-rc.7",
72
68
  "@deepseek-ai/dsh-session-query": "0.1.0-rc.7",
69
+ "@deepseek-ai/dsh-session-title": "0.1.0-rc.7",
73
70
  "@deepseek-ai/dsh-settings": "0.1.0-rc.7",
74
71
  "@deepseek-ai/dsh-system-prompt": "0.1.0-rc.7",
75
- "@deepseek-ai/dsh-session-title": "0.1.0-rc.7",
76
- "@deepseek-ai/dsh-tool-web": "0.1.0-rc.7",
77
72
  "@deepseek-ai/dsh-tool-call-timeout-policy": "0.1.0-rc.7",
73
+ "@deepseek-ai/dsh-tool-web": "0.1.0-rc.7",
78
74
  "@deepseek-ai/dsh-tools": "0.1.0-rc.7",
79
75
  "@deepseek-ai/dsh-web": "0.1.0-rc.7",
80
- "@deepseek-ai/dsh-web-search-deepseek": "0.1.0-rc.7"
76
+ "@deepseek-ai/dsh-web-search-deepseek": "0.1.0-rc.7",
77
+ "just-bash": "3.3.0",
78
+ "playwright": "^1.49.0",
79
+ "typescript": "^6.0.3",
80
+ "vitest": "^4.1.8",
81
+ "ws": "^8.21.0"
81
82
  },
82
83
  "scripts": {
83
- "bundle:direct": "pnpm run web:build && node scripts/bundle.mjs direct",
84
- "bundle:isolated": "pnpm run web:build && node scripts/bundle.mjs isolated",
85
- "bundle:workers": "node scripts/bundle.mjs direct && node scripts/bundle.mjs isolated",
86
- "dev": "pnpm run web:build && wrangler dev --env=\"\"",
87
- "dev:isolated": "pnpm run web:build && wrangler dev --env isolated",
84
+ "bundle:direct": "pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct",
85
+ "bundle:isolated": "pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated",
86
+ "bundle:workers": "pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",
87
+ "dev": "pnpm run bundle:direct && node scripts/dev.mjs direct",
88
+ "dev:isolated": "pnpm run bundle:isolated && node scripts/dev.mjs isolated",
88
89
  "dsh-edge": "node scripts/cli.mjs",
89
90
  "example:install": "node examples/install-keyless.mjs",
90
- "install:cloudflare": "pnpm run web:build && pnpm run bundle:workers && node scripts/cli.mjs install",
91
+ "install:cloudflare": "pnpm run bundle:workers && node scripts/cli.mjs install",
91
92
  "legal:write": "node scripts/legal-files.mjs write",
92
93
  "pack:verify": "node scripts/verify-packed.mjs",
93
- "web:assemble": "node scripts/assemble-web.mjs",
94
- "web:build": "pnpm --workspace-root run build:lib:host && pnpm --workspace-root run build:lib:client && pnpm --workspace-root run build:web && pnpm run web:assemble",
95
- "test": "vitest run --root ../.. apps/dsh-edge/tests/agent.spec.ts apps/dsh-edge/tests/auth.spec.ts apps/dsh-edge/tests/cli.spec.ts apps/dsh-edge/tests/deployment-health.spec.ts apps/dsh-edge/tests/deployment.spec.ts apps/dsh-edge/tests/direct-shell.spec.ts apps/dsh-edge/tests/do-session-persistence.spec.ts apps/dsh-edge/tests/edge-api.spec.ts apps/dsh-edge/tests/edge-credentials.spec.ts apps/dsh-edge/tests/edge-remotes.spec.ts apps/dsh-edge/tests/installer.spec.ts apps/dsh-edge/tests/sse.spec.ts apps/dsh-edge/tests/verify-packed.spec.ts apps/dsh-edge/tests/web-search.spec.ts apps/dsh-edge/tests/workspace.spec.ts",
96
- "test:integration": "pnpm run web:build && node tests/session.integration.mjs",
97
- "test:snapshot": "vitest run --config vitest.snapshot.config.ts",
94
+ "web:build": "pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",
95
+ "test": "vitest run --root ../.. --project edge-runtime",
96
+ "test:integration": "pnpm run bundle:workers && node tests/run-session-integration.mjs",
97
+ "test:snapshot": "vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",
98
98
  "typecheck": "tsc --noEmit"
99
99
  }
100
100
  }
@@ -0,0 +1,38 @@
1
+ /** Serve the exact prebuilt artifact used by the installer. */
2
+
3
+ import { createRequire } from 'node:module'
4
+ import { randomUUID } from 'node:crypto'
5
+ import { rm } from 'node:fs/promises'
6
+ import { join } from 'node:path'
7
+ import { fileURLToPath } from 'node:url'
8
+ import { execa } from 'execa'
9
+ import { writePrebuiltModeWranglerConfig } from './wrangler-config.mjs'
10
+
11
+ const mode = process.argv[2]
12
+ if (mode !== 'direct' && mode !== 'isolated') {
13
+ process.stderr.write('Usage: node scripts/dev.mjs <direct|isolated> [wrangler dev options]\n')
14
+ process.exitCode = 2
15
+ } else {
16
+ const appDirectory = fileURLToPath(new URL('..', import.meta.url))
17
+ const require = createRequire(import.meta.url)
18
+ // Keep the generated config beside `.dev.vars`; Wrangler resolves local
19
+ // secrets relative to the configuration file rather than the process cwd.
20
+ const configFile = join(appDirectory, `.wrangler.dev.${randomUUID()}.json`)
21
+ try {
22
+ await writePrebuiltModeWranglerConfig(mode, configFile)
23
+ const result = await execa(process.execPath, [
24
+ require.resolve('wrangler'),
25
+ 'dev',
26
+ '--config', configFile,
27
+ '--env', mode === 'direct' ? '' : 'isolated',
28
+ ...process.argv.slice(3),
29
+ ], {
30
+ cwd: appDirectory,
31
+ stdio: 'inherit',
32
+ reject: false,
33
+ })
34
+ process.exitCode = result.exitCode ?? 1
35
+ } finally {
36
+ await rm(configFile, { force: true })
37
+ }
38
+ }
@@ -1,6 +1,6 @@
1
1
  import { randomBytes } from 'node:crypto'
2
2
  import { execFile } from 'node:child_process'
3
- import { chmod, mkdtemp, open, readFile, rm, writeFile } from 'node:fs/promises'
3
+ import { chmod, mkdtemp, open, rm, writeFile } from 'node:fs/promises'
4
4
  import { createRequire } from 'node:module'
5
5
  import { tmpdir } from 'node:os'
6
6
  import { join } from 'node:path'
@@ -93,6 +93,48 @@ const SENSITIVE_ENV_KEY = /(KEY|PASSWORD|SECRET|TOKEN)/iu
93
93
  const WORKER_NAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/u
94
94
  const CLAIM_URL = /https:\/\/dash\.cloudflare\.com\/claim-preview\?[^\s\u001b]+/u
95
95
  const MAX_CAPTURE_BYTES = 2 * 1024 * 1024
96
+ const WINDOWS_ACL_TIMEOUT_MS = 30_000
97
+ const WINDOWS_PRIVATE_DIRECTORY_SCRIPT = String.raw`
98
+ $ErrorActionPreference = 'Stop'
99
+ $directory = [System.IO.Path]::GetFullPath($env:DSH_EDGE_PRIVATE_DIRECTORY)
100
+ if (-not [System.IO.Directory]::Exists($directory)) {
101
+ throw 'Installer temporary directory does not exist.'
102
+ }
103
+ $identity = [System.Security.Principal.WindowsIdentity]::GetCurrent().User
104
+ $acl = [System.Security.AccessControl.DirectorySecurity]::new()
105
+ $acl.SetOwner($identity)
106
+ $acl.SetAccessRuleProtection($true, $false)
107
+ $inheritance = [System.Security.AccessControl.InheritanceFlags]::ContainerInherit -bor [System.Security.AccessControl.InheritanceFlags]::ObjectInherit
108
+ $rule = [System.Security.AccessControl.FileSystemAccessRule]::new(
109
+ $identity,
110
+ [System.Security.AccessControl.FileSystemRights]::FullControl,
111
+ $inheritance,
112
+ [System.Security.AccessControl.PropagationFlags]::None,
113
+ [System.Security.AccessControl.AccessControlType]::Allow
114
+ )
115
+ $acl.AddAccessRule($rule)
116
+ [System.IO.Directory]::SetAccessControl($directory, $acl)
117
+
118
+ $verified = [System.IO.Directory]::GetAccessControl(
119
+ $directory,
120
+ [System.Security.AccessControl.AccessControlSections]::Owner -bor [System.Security.AccessControl.AccessControlSections]::Access
121
+ )
122
+ $owner = $verified.GetOwner([System.Security.Principal.SecurityIdentifier])
123
+ $rules = @($verified.GetAccessRules($true, $true, [System.Security.Principal.SecurityIdentifier]))
124
+ if (-not $verified.AreAccessRulesProtected -or $owner.Value -ne $identity.Value -or $rules.Count -ne 1) {
125
+ throw "Installer temporary directory DACL is not private (protected=$($verified.AreAccessRulesProtected), owner=$($owner.Value), user=$($identity.Value), rules=$($rules.Count))."
126
+ }
127
+ $verifiedRule = $rules[0]
128
+ if (
129
+ $verifiedRule.IdentityReference.Value -ne $identity.Value -or
130
+ $verifiedRule.AccessControlType -ne [System.Security.AccessControl.AccessControlType]::Allow -or
131
+ $verifiedRule.FileSystemRights -ne [System.Security.AccessControl.FileSystemRights]::FullControl -or
132
+ $verifiedRule.InheritanceFlags -ne $inheritance -or
133
+ $verifiedRule.PropagationFlags -ne [System.Security.AccessControl.PropagationFlags]::None
134
+ ) {
135
+ throw 'Installer temporary directory DACL has unexpected access rules.'
136
+ }
137
+ `
96
138
 
97
139
  export class InstallCancelledError extends Error {
98
140
  constructor() {
@@ -1001,6 +1043,38 @@ async function readBoundedUtf8File(path, maxBytes) {
1001
1043
 
1002
1044
  async function createPrivateTemporaryDirectory() {
1003
1045
  const directory = await mkdtemp(join(tmpdir(), 'dsh-edge-install-'))
1004
- await chmod(directory, 0o700)
1005
- return directory
1046
+ try {
1047
+ if (process.platform === 'win32') {
1048
+ const systemRoot = process.env.SystemRoot ?? process.env.WINDIR
1049
+ if (systemRoot === undefined || systemRoot === '') {
1050
+ throw new Error('Could not locate Windows PowerShell to secure installer credentials.')
1051
+ }
1052
+ const powershell = join(systemRoot, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe')
1053
+ const encodedCommand = Buffer.from(WINDOWS_PRIVATE_DIRECTORY_SCRIPT, 'utf16le').toString('base64')
1054
+ try {
1055
+ await execa(powershell, [
1056
+ '-NoLogo',
1057
+ '-NoProfile',
1058
+ '-NonInteractive',
1059
+ '-EncodedCommand',
1060
+ encodedCommand,
1061
+ ], {
1062
+ env: {
1063
+ ...process.env,
1064
+ DSH_EDGE_PRIVATE_DIRECTORY: directory,
1065
+ },
1066
+ timeout: WINDOWS_ACL_TIMEOUT_MS,
1067
+ windowsHide: true,
1068
+ })
1069
+ } catch (error) {
1070
+ throw new Error('Could not establish a private Windows ACL for installer credentials.', { cause: error })
1071
+ }
1072
+ } else {
1073
+ await chmod(directory, 0o700)
1074
+ }
1075
+ return directory
1076
+ } catch (error) {
1077
+ await rm(directory, { recursive: true, force: true }).catch(() => {})
1078
+ throw error
1079
+ }
1006
1080
  }
@@ -0,0 +1,23 @@
1
+ export interface BundledComponent {
2
+ author?: string | { name?: string }
3
+ license: string
4
+ name: string
5
+ path: string
6
+ repository?: string | { url?: string }
7
+ version: string
8
+ }
9
+
10
+ export interface LegalDocumentUse {
11
+ file: string
12
+ name: string
13
+ version: string
14
+ }
15
+
16
+ export interface LegalDocument {
17
+ id: string
18
+ text: string
19
+ uses: LegalDocumentUse[]
20
+ }
21
+
22
+ export declare function collectLicenseDocuments(components: BundledComponent[]): LegalDocument[]
23
+ export declare function renderBundledTerms(components: BundledComponent[]): string