@chatcode/chatcode-cli 3.0.5-rc.5 → 3.0.5-rc.7

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 (61) hide show
  1. package/lib/{command-errors-DGyKMxEq.js → command-errors-CnbcOM1a.js} +12 -12
  2. package/lib/{command-trees-Bh2WKUZ3.js → command-trees-CU7BxVJo.js} +2 -2
  3. package/lib/{component-identity-B7wyM-aN.js → component-identity-kZK1_hFy.js} +3 -3
  4. package/lib/{extension-events-JX8c4mnR.js → extension-events-hLxwPvpg.js} +20 -20
  5. package/lib/{host-access-ClndygbX.js → host-access-kT-u85k_.js} +1 -1
  6. package/lib/{keymap-nfqAZoFE.js → keymap-DS1M8sDo.js} +2 -2
  7. package/lib/{plugin-C9yd07Wb.js → plugin-d65VulBk.js} +583 -532
  8. package/lib/{scenes-C5_xUR61.js → scenes-DG6T8t-A.js} +3 -3
  9. package/lib/{settings-sections-CRhTUEBm.js → settings-sections-2SuE0biI.js} +3 -3
  10. package/lib/{statusBarSettings-ChS8Z4Jf.js → statusBarSettings-B2MEAwnI.js} +3 -3
  11. package/lib/{themes-bFi516uK.js → themes-DUO7kGW-.js} +12 -12
  12. package/lib/tui-compat-command-trees.js +1 -1
  13. package/lib/tui-compat-extensions.js +3 -3
  14. package/lib/tui-compat-plugin-host.js +5 -5
  15. package/lib/tui-compat-scenes.js +1 -1
  16. package/lib/tui-compat-settings-sections.js +1 -1
  17. package/lib/tui-compat-working-activity.js +1 -1
  18. package/lib/tui-compat-workspaces.js +1 -1
  19. package/lib/tui-compat.js +5 -5
  20. package/lib/{workspaces-ous4jIwo.js → workspaces-CLOkL_yE.js} +2 -2
  21. package/package.json +24 -24
  22. package/runtime/manifest.json +2 -2
  23. package/runtime/node_modules/@deepseek-ai/dsh-agent/lib/types/runtime-types.d.ts +16 -0
  24. package/runtime/node_modules/@deepseek-ai/dsh-agent-loop/lib/index.js +4 -0
  25. package/runtime/node_modules/@deepseek-ai/dsh-agent-preset-registry/lib/typert.host.js +1 -1
  26. package/runtime/node_modules/@deepseek-ai/dsh-api-session-controller/lib/typert.host.js +2 -2
  27. package/runtime/node_modules/@deepseek-ai/dsh-api-terminal-controller/lib/typert.host.js +1 -1
  28. package/runtime/node_modules/@deepseek-ai/dsh-atomic-write/lib/index.js +38 -38
  29. package/runtime/node_modules/@deepseek-ai/dsh-atomic-write/lib/types/index.d.ts +2 -2
  30. package/runtime/node_modules/@deepseek-ai/dsh-atomic-write/lib/types/linux-lock.d.ts +1 -1
  31. package/runtime/node_modules/@deepseek-ai/dsh-atomic-write/lib/types/windows-lock.d.ts +1 -1
  32. package/runtime/node_modules/@deepseek-ai/dsh-client-file-upload/lib/typert.host.js +1 -1
  33. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-account/lib/client.js +2 -2
  34. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-settings-general/lib/client.js +1 -1
  35. package/runtime/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
  36. package/runtime/node_modules/@deepseek-ai/dsh-commands/lib/typert.host.js +1 -1
  37. package/runtime/node_modules/@deepseek-ai/dsh-cordis-host-runner/lib/typert.host.js +2 -2
  38. package/runtime/node_modules/@deepseek-ai/dsh-goal/lib/typert.host.js +1 -1
  39. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/index.js +77 -10
  40. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/error-diagnostic.d.ts +15 -0
  41. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/protocol-adapter.d.ts +1 -1
  42. package/runtime/node_modules/@deepseek-ai/dsh-llm-deepseek/lib/types/transport.d.ts +1 -1
  43. package/runtime/node_modules/@deepseek-ai/dsh-scope/lib/invariant.js +1 -0
  44. package/runtime/node_modules/@deepseek-ai/dsh-session-reference/lib/typert.host.js +1 -1
  45. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/index.js +51 -9
  46. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/typert.host.js +1 -1
  47. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/archive-admission.d.ts +13 -0
  48. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/archive-admission.js +20 -6
  49. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/continuation-activation.d.ts +4 -0
  50. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/continuation-activation.js +42 -3
  51. package/runtime/node_modules/@deepseek-ai/dsh-subagent/lib/types/control.d.ts +1 -1
  52. package/runtime/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +12 -0
  53. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/chatcode-apple-touch-icon.png +0 -0
  54. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/chatcode-icon-32.png +0 -0
  55. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/chatcode-mask-icon.svg +1 -1
  56. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/favicon-dark.svg +1 -1
  57. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/favicon.ico +0 -0
  58. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/favicon.svg +1 -1
  59. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/index.html +5 -5
  60. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/logo.png +0 -0
  61. package/runtime/node_modules/@deepseek-ai/dsh-web-frontend/dist/preview.html +5 -5
@@ -1,7 +1,7 @@
1
- import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-ClndygbX.js";
2
- import { n as componentIdentityOf } from "./component-identity-B7wyM-aN.js";
1
+ import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-kT-u85k_.js";
2
+ import { n as componentIdentityOf } from "./component-identity-kZK1_hFy.js";
3
3
  import { Service } from "@deepseek-ai/cordis";
4
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/scenes.js
4
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/scenes.js
5
5
  /** Provider-neutral full-screen scene registry for terminal front doors. */
6
6
  const name = "dsh-tui-scenes";
7
7
  /**
@@ -1,6 +1,6 @@
1
- import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-ClndygbX.js";
1
+ import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-kT-u85k_.js";
2
2
  import { Service } from "@deepseek-ai/cordis";
3
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/credentialRefGuard.js
3
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/credentialRefGuard.js
4
4
  /**
5
5
  * Credential-ref reservation guard for the plugin settings-section seam.
6
6
  *
@@ -49,7 +49,7 @@ function vetSectionSecretRefs(section) {
49
49
  };
50
50
  }
51
51
  //#endregion
52
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/settings-sections.js
52
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/settings-sections.js
53
53
  /**
54
54
  * Plugin settings-section extension seam for terminal front doors.
55
55
  *
@@ -1,5 +1,5 @@
1
1
  import Schema from "@deepseek-ai/schemastery";
2
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/settingsCompat.js
2
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/settingsCompat.js
3
3
  /** Mark display fields editable on hosts that support volatile Config references. */
4
4
  function withLiveSettings(schema, fields) {
5
5
  for (const key of fields) {
@@ -43,7 +43,7 @@ function settingsValue(settings, ns) {
43
43
  return descriptor && "value" in descriptor ? descriptor.value : settings.get?.(ns);
44
44
  }
45
45
  //#endregion
46
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/tuiDisplayPrefs.js
46
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/tuiDisplayPrefs.js
47
47
  /** Default footer shows account-wide tokens today and current context usage. */
48
48
  const DEFAULT_STATUS_BAR = Object.freeze({
49
49
  compact: true,
@@ -203,7 +203,7 @@ function applyPageMargin(setting) {
203
203
  return next;
204
204
  }
205
205
  //#endregion
206
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/statusBarSettings.js
206
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/statusBarSettings.js
207
207
  /** Shared status-footer settings declarations and validation. */
208
208
  /**
209
209
  * Build the complete footer schema for both composition and live settings.
@@ -1,12 +1,12 @@
1
- import { c as parseCombo, i as comboMatchesStrict, r as canonicalCombo, s as fixedReservedCombos, u as reservedActionCombos } from "./keymap-nfqAZoFE.js";
2
- import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, r as assertCallerContext, s as requirePluginCaller, t as activationContext } from "./host-access-ClndygbX.js";
3
- import { n as componentIdentityOf } from "./component-identity-B7wyM-aN.js";
4
- import { S as DATA_DIR, f as cleanRenderText, p as cleanScalarText } from "./extension-events-JX8c4mnR.js";
1
+ import { c as parseCombo, i as comboMatchesStrict, r as canonicalCombo, s as fixedReservedCombos, u as reservedActionCombos } from "./keymap-DS1M8sDo.js";
2
+ import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, r as assertCallerContext, s as requirePluginCaller, t as activationContext } from "./host-access-kT-u85k_.js";
3
+ import { n as componentIdentityOf } from "./component-identity-kZK1_hFy.js";
4
+ import { S as DATA_DIR, f as cleanRenderText, p as cleanScalarText } from "./extension-events-hLxwPvpg.js";
5
5
  import { readFileSync, readdirSync } from "node:fs";
6
6
  import { join } from "node:path";
7
7
  import { Context, Service } from "@deepseek-ai/cordis";
8
8
  import { KNOWN_SESSION_EVENT_TYPES } from "@deepseek-ai/dsh-session";
9
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/dialogs.js
9
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/dialogs.js
10
10
  /**
11
11
  * Managed plugin dialogs — the pi `ctx.ui.select/confirm/input` seam for
12
12
  * ChatCode CLI TUI. Plugins hand the HOST a declarative request; the TUI renders the
@@ -279,7 +279,7 @@ function getHostDialogStore(runtime) {
279
279
  }
280
280
  }
281
281
  //#endregion
282
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/status.js
282
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/status.js
283
283
  /**
284
284
  * Keyed status-line contributions — pi's `ctx.ui.setStatus(key, text)`.
285
285
  * Each plugin owns a key; setting text shows it, setting undefined clears
@@ -503,7 +503,7 @@ function getHostStatusStore(runtime) {
503
503
  }
504
504
  }
505
505
  //#endregion
506
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/shortcuts.js
506
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/shortcuts.js
507
507
  /**
508
508
  * Plugin keyboard shortcuts — pi's `pi.registerShortcut`. A plugin binds a
509
509
  * combo (`ctrl+shift+p`, `alt+k`, …) to a handler; the chat screen matches
@@ -704,7 +704,7 @@ function getHostShortcuts(runtime) {
704
704
  }
705
705
  }
706
706
  //#endregion
707
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/renderers.js
707
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/renderers.js
708
708
  /**
709
709
  * Custom session-entry renderers — pi's `pi.registerMessageRenderer`. A
710
710
  * plugin that appends its own log-only session events (`session.append(
@@ -876,7 +876,7 @@ function getHostRenderers(runtime) {
876
876
  }
877
877
  }
878
878
  //#endregion
879
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/toast.js
879
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/toast.js
880
880
  /**
881
881
  * Plugin-facing transient notifications — a fire-and-forget toast shown on
882
882
  * the host's existing notification surface (the same toasts the channel
@@ -1011,7 +1011,7 @@ function getHostToastStore(runtime) {
1011
1011
  }
1012
1012
  }
1013
1013
  //#endregion
1014
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/theme.js
1014
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/theme.js
1015
1015
  /**
1016
1016
  * dsh-tui color themes — ChatCode CLI terminal family.
1017
1017
  *
@@ -1486,7 +1486,7 @@ function getActiveTheme() {
1486
1486
  return getTheme(activeThemeName);
1487
1487
  }
1488
1488
  //#endregion
1489
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/customTheme.js
1489
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/customTheme.js
1490
1490
  /**
1491
1491
  * User-defined color themes for dsh-tui.
1492
1492
  *
@@ -1716,7 +1716,7 @@ function indexCustomThemeNames() {
1716
1716
  nameIndexed = true;
1717
1717
  }
1718
1718
  //#endregion
1719
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/themes.js
1719
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/themes.js
1720
1720
  /**
1721
1721
  * Cordis-backed runtime theme contributions.
1722
1722
  *
@@ -1,2 +1,2 @@
1
- import { r as name, t as TuiCommandTreeRuntime } from "./command-trees-Bh2WKUZ3.js";
1
+ import { r as name, t as TuiCommandTreeRuntime } from "./command-trees-CU7BxVJo.js";
2
2
  export { TuiCommandTreeRuntime, TuiCommandTreeRuntime as default, name };
@@ -1,9 +1,9 @@
1
- import { a as normalizeCancelDecision, c as installDecisionGuard, n as DECISION_TOTAL_TIMEOUT_MS, o as DECISION_EVENT_PERMISSIONS, t as DECISION_HANDLER_TIMEOUT_MS, x as readGrantStore } from "./extension-events-JX8c4mnR.js";
2
- import { A as TuiDialogRuntime, C as matchShortcut, D as getHostStatusStore, E as TuiStatusStore, O as DIALOG_DEFAULT_TIMEOUT_MS, T as TuiStatusRuntime, _ as TuiToastRuntime, j as TuiDialogStore, k as INPUT_CELLS, t as TuiThemeRuntime, w as parseShortcutCombo, x as TuiShortcutRuntime, y as TuiRendererRuntime } from "./themes-bFi516uK.js";
1
+ import { a as normalizeCancelDecision, c as installDecisionGuard, n as DECISION_TOTAL_TIMEOUT_MS, o as DECISION_EVENT_PERMISSIONS, t as DECISION_HANDLER_TIMEOUT_MS, x as readGrantStore } from "./extension-events-hLxwPvpg.js";
2
+ import { A as TuiDialogRuntime, C as matchShortcut, D as getHostStatusStore, E as TuiStatusStore, O as DIALOG_DEFAULT_TIMEOUT_MS, T as TuiStatusRuntime, _ as TuiToastRuntime, j as TuiDialogStore, k as INPUT_CELLS, t as TuiThemeRuntime, w as parseShortcutCombo, x as TuiShortcutRuntime, y as TuiRendererRuntime } from "./themes-DUO7kGW-.js";
3
3
  import { appendFileSync, mkdirSync } from "node:fs";
4
4
  import { homedir } from "node:os";
5
5
  import { dirname, join } from "node:path";
6
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/extensions.js
6
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/extensions.js
7
7
  /**
8
8
  * The dsh-tui-extensions row: mounts every plugin-facing UI seam service in
9
9
  * one cordis plugin (one profile row, one patch-surface entry — see issue
@@ -1,10 +1,10 @@
1
- import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, r as assertCallerContext, t as activationContext } from "./host-access-ClndygbX.js";
2
- import { c as requiresDecisionEvents, o as requireComponentIdentity, r as declaresCommand, s as requiresContract, t as bindComponentIdentity } from "./component-identity-B7wyM-aN.js";
3
- import { B as createAdmissionCatalog, F as verifyRegistry, I as DECISION_EVENTS_COORDINATE, J as parseManifest, L as TUI_DECISION_EVENT_NAMES, M as loadSpecData, P as verifyContractProfiles, R as TUI_EXTENSION_API_VERSION, Y as projectManifest, c as installDecisionGuard, l as registerDecisionHandler, n as DECISION_TOTAL_TIMEOUT_MS, o as DECISION_EVENT_PERMISSIONS, s as decisionHandlerMetadataOf, t as DECISION_HANDLER_TIMEOUT_MS, u as withDecisionRegistration, x as readGrantStore, z as TUI_EXTENSION_PERMISSION_NAMES } from "./extension-events-JX8c4mnR.js";
4
- import { A as validatePlugin, C as TuiPluginStorageRuntime, D as buildHostDescriptor, E as HOST_SUPPORTED_CONTRACTS, O as negotiate, S as STORAGE_MAX_KEYS, T as TuiEffectLedgerRuntime, b as STORAGE_KEY_MAX_LENGTH, c as OBSERVE_CALLBACK_QUEUE_LIMIT, d as OBSERVE_ID_MAX_CHARS, f as OBSERVE_IMAGE_BASE64_MAX_CHARS, g as TuiMessageObserverRuntime, h as OBSERVE_SUMMARY_CELLS, i as withCommandErrorMapping, k as createContractIndex, l as OBSERVE_CALLBACK_TIMEOUT_MS, m as OBSERVE_SCOPE_MAX_CHARS, n as hasCommandErrorCode, o as stampCommandOwner, p as OBSERVE_IMAGE_MAX_BYTES, r as mapCommandError, s as unstampCommandOwner, t as COMMAND_ERROR_CODES, u as OBSERVE_CONTENT_MAX_CHARS, x as STORAGE_MAX_BYTES, y as PluginStorageError } from "./command-errors-DGyKMxEq.js";
1
+ import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, r as assertCallerContext, t as activationContext } from "./host-access-kT-u85k_.js";
2
+ import { c as requiresDecisionEvents, o as requireComponentIdentity, r as declaresCommand, s as requiresContract, t as bindComponentIdentity } from "./component-identity-kZK1_hFy.js";
3
+ import { B as createAdmissionCatalog, F as verifyRegistry, I as DECISION_EVENTS_COORDINATE, J as parseManifest, L as TUI_DECISION_EVENT_NAMES, M as loadSpecData, P as verifyContractProfiles, R as TUI_EXTENSION_API_VERSION, Y as projectManifest, c as installDecisionGuard, l as registerDecisionHandler, n as DECISION_TOTAL_TIMEOUT_MS, o as DECISION_EVENT_PERMISSIONS, s as decisionHandlerMetadataOf, t as DECISION_HANDLER_TIMEOUT_MS, u as withDecisionRegistration, x as readGrantStore, z as TUI_EXTENSION_PERMISSION_NAMES } from "./extension-events-hLxwPvpg.js";
4
+ import { A as validatePlugin, C as TuiPluginStorageRuntime, D as buildHostDescriptor, E as HOST_SUPPORTED_CONTRACTS, O as negotiate, S as STORAGE_MAX_KEYS, T as TuiEffectLedgerRuntime, b as STORAGE_KEY_MAX_LENGTH, c as OBSERVE_CALLBACK_QUEUE_LIMIT, d as OBSERVE_ID_MAX_CHARS, f as OBSERVE_IMAGE_BASE64_MAX_CHARS, g as TuiMessageObserverRuntime, h as OBSERVE_SUMMARY_CELLS, i as withCommandErrorMapping, k as createContractIndex, l as OBSERVE_CALLBACK_TIMEOUT_MS, m as OBSERVE_SCOPE_MAX_CHARS, n as hasCommandErrorCode, o as stampCommandOwner, p as OBSERVE_IMAGE_MAX_BYTES, r as mapCommandError, s as unstampCommandOwner, t as COMMAND_ERROR_CODES, u as OBSERVE_CONTENT_MAX_CHARS, x as STORAGE_MAX_BYTES, y as PluginStorageError } from "./command-errors-CnbcOM1a.js";
5
5
  import { randomUUID } from "node:crypto";
6
6
  import { Context, Service } from "@deepseek-ai/cordis";
7
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/plugin-host.js
7
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/plugin-host.js
8
8
  /**
9
9
  * The dsh-tui-plugin-host row: the plugin-interop anchor every later
10
10
  * contract surface hangs off (storage.local, messages.observe, effect
@@ -1,2 +1,2 @@
1
- import { r as name, t as TuiSceneRuntime } from "./scenes-C5_xUR61.js";
1
+ import { r as name, t as TuiSceneRuntime } from "./scenes-DG6T8t-A.js";
2
2
  export { TuiSceneRuntime, TuiSceneRuntime as default, name };
@@ -1,2 +1,2 @@
1
- import { i as name, t as TuiSettingsSectionsRuntime } from "./settings-sections-CRhTUEBm.js";
1
+ import { i as name, t as TuiSettingsSectionsRuntime } from "./settings-sections-2SuE0biI.js";
2
2
  export { TuiSettingsSectionsRuntime, TuiSettingsSectionsRuntime as default, name };
@@ -235,7 +235,7 @@ function apply$1(ctx, config = {}) {
235
235
  }, "working-activity tick timer");
236
236
  }
237
237
  //#endregion
238
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/working-activity.js
238
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/working-activity.js
239
239
  /**
240
240
  * Re-export of the `dsh-working-activity` plugin under this package's own
241
241
  * name, so the bundle patch layer can mount the working-activity row as
@@ -1,2 +1,2 @@
1
- import { a as localWorkspaceUri, n as WORKSPACE_PROVIDER_TIMEOUT_MS, o as name, r as createLocalWorkspaceRuntime, s as parseLocalWorkspaceReference, t as TuiWorkspaceRuntime } from "./workspaces-ous4jIwo.js";
1
+ import { a as localWorkspaceUri, n as WORKSPACE_PROVIDER_TIMEOUT_MS, o as name, r as createLocalWorkspaceRuntime, s as parseLocalWorkspaceReference, t as TuiWorkspaceRuntime } from "./workspaces-CLOkL_yE.js";
2
2
  export { TuiWorkspaceRuntime, TuiWorkspaceRuntime as default, WORKSPACE_PROVIDER_TIMEOUT_MS, createLocalWorkspaceRuntime, localWorkspaceUri, name, parseLocalWorkspaceReference };
package/lib/tui-compat.js CHANGED
@@ -1,7 +1,7 @@
1
- import { c as normalizePageMargin, g as liveConfigValues, n as createStatusBarSchema, v as withLiveSettings } from "./statusBarSettings-ChS8Z4Jf.js";
2
- import { t as SHORTCUT_ACTIONS } from "./keymap-nfqAZoFE.js";
1
+ import { c as normalizePageMargin, g as liveConfigValues, n as createStatusBarSchema, v as withLiveSettings } from "./statusBarSettings-B2MEAwnI.js";
2
+ import { t as SHORTCUT_ACTIONS } from "./keymap-DS1M8sDo.js";
3
3
  import Schema from "@deepseek-ai/schemastery";
4
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/force-production-react.js
4
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/force-production-react.js
5
5
  /**
6
6
  * React-reconciler selects its dev/production build at require time from
7
7
  * NODE_ENV; the dev build records one performance.measure() per render into
@@ -14,7 +14,7 @@ import Schema from "@deepseek-ai/schemastery";
14
14
  */
15
15
  process.env.NODE_ENV ??= "production";
16
16
  //#endregion
17
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/index.js
17
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/index.js
18
18
  /**
19
19
  * dsh-tui plugin entry. The TUI implementation lives in `./plugin.tsx` (its
20
20
  * render path is JSX); this module owns the plugin surface (`name`/`inject`/
@@ -101,7 +101,7 @@ const Config$1 = withLiveSettings(Schema.object({
101
101
  * @returns a promise settling when the TUI teardown completes.
102
102
  */
103
103
  async function apply(ctx, config) {
104
- const { apply: ccTuiApply } = await import("./plugin-C9yd07Wb.js");
104
+ const { apply: ccTuiApply } = await import("./plugin-d65VulBk.js");
105
105
  return ccTuiApply(ctx, liveConfigValues(config));
106
106
  }
107
107
  //#endregion
@@ -1,8 +1,8 @@
1
- import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-ClndygbX.js";
1
+ import { a as compositionRoot, i as bindCallerEffect, n as activationFiber, o as concreteService, s as requirePluginCaller } from "./host-access-kT-u85k_.js";
2
2
  import { fileURLToPath, pathToFileURL } from "node:url";
3
3
  import { basename, isAbsolute, resolve } from "node:path";
4
4
  import { Service } from "@deepseek-ai/cordis";
5
- //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.25_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/workspaces.js
5
+ //#region ../../node_modules/.pnpm/@chatcode+cco-tui@0.10.0-rc.28_08ea48c8555976e562c6368d51cb542b/node_modules/@chatcode/cco-tui/lib/types/dsh-adapter/workspaces.js
6
6
  /**
7
7
  * Workspace-target extension seam for terminal front doors.
8
8
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chatcode/chatcode-cli",
3
3
  "description": "ChatCode CLI: TUI-first coding agent, Web launcher, profiles, and legacy DSH-compatible plugins",
4
- "version": "3.0.5-rc.5",
4
+ "version": "3.0.5-rc.7",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -30,13 +30,13 @@
30
30
  "@babel/code-frame": "^7.29.0",
31
31
  "@chatcode/cco-better-sidebar": "0.18.0-rc.13",
32
32
  "@chatcode/cco-builtin-browser": "0.1.21",
33
- "@chatcode/cco-chat-import": "0.17.3",
33
+ "@chatcode/cco-chat-import": "0.17.4",
34
34
  "@chatcode/cco-computer-use": "0.3.2",
35
35
  "@chatcode/cco-llm-chatcode-config": "0.1.4-rc.10",
36
36
  "@chatcode/cco-market": "1.45.2-rc.5",
37
- "@chatcode/cco-tui": "0.10.0-rc.25",
37
+ "@chatcode/cco-tui": "0.10.0-rc.28",
38
38
  "@deepseek-ai/libreoffice-kit": "^0.1.1",
39
- "@deepseek-harness-tui/dsh-tui": "npm:@chatcode/cco-tui@0.10.0-rc.25",
39
+ "@deepseek-harness-tui/dsh-tui": "npm:@chatcode/cco-tui@0.10.0-rc.28",
40
40
  "@earendil-works/pi-ai": "^0.85.1",
41
41
  "@eslint-community/regexpp": "^4.12.2",
42
42
  "@joplin/turndown-plugin-gfm": "^1.0.67",
@@ -60,7 +60,7 @@
60
60
  "diff": "^9.0.0",
61
61
  "dsh-better-sidebar": "npm:@chatcode/cco-better-sidebar@0.18.0-rc.13",
62
62
  "dsh-builtin-browser": "npm:@chatcode/cco-builtin-browser@0.1.21",
63
- "dsh-chat-import": "npm:@chatcode/cco-chat-import@0.17.3",
63
+ "dsh-chat-import": "npm:@chatcode/cco-chat-import@0.17.4",
64
64
  "dsh-computer-use": "npm:@chatcode/cco-computer-use@0.3.2",
65
65
  "dshmarket": "npm:@chatcode/cco-market@1.45.2-rc.5",
66
66
  "eventsource-parser": "^3.1.0",
@@ -95,46 +95,46 @@
95
95
  "ajv": "^8.20.0",
96
96
  "execa": "^10.0.0",
97
97
  "ws": "8.21.0",
98
- "@deepseek-ai/dsh-agent": "0.1.7-rc.2",
99
- "@deepseek-ai/dsh-acp": "0.1.7-rc.2",
100
- "@deepseek-ai/dsh-attachment-local": "0.1.7-rc.2",
101
98
  "@deepseek-ai/dsh-agent-loop": "0.1.7-rc.2",
99
+ "@deepseek-ai/dsh-acp": "0.1.7-rc.2",
100
+ "@deepseek-ai/dsh-agent": "0.1.7-rc.2",
102
101
  "@deepseek-ai/dsh-credentials-local": "0.1.7-rc.2",
103
- "@deepseek-ai/dsh-bash-local": "0.1.7-rc.2",
104
- "@deepseek-ai/dsh-experimental-tool-agent-team": "0.1.7-rc.2",
105
102
  "@deepseek-ai/dsh-deepseek-llm-api-extensions": "0.1.7-rc.2",
103
+ "@deepseek-ai/dsh-bash-local": "0.1.7-rc.2",
104
+ "@deepseek-ai/dsh-experimental-agent-team": "0.1.7-rc.2",
105
+ "@deepseek-ai/dsh-attachment-local": "0.1.7-rc.2",
106
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.1.7-rc.2",
106
107
  "@deepseek-ai/dsh-experimental-ptc-runtime-python": "0.1.7-rc.2",
108
+ "@deepseek-ai/dsh-experimental-tool-agent-team": "0.1.7-rc.2",
107
109
  "@deepseek-ai/dsh-fs-observation-policy": "0.1.7-rc.2",
108
- "@deepseek-ai/dsh-llm-deepseek": "0.1.7-rc.2",
109
- "@deepseek-ai/dsh-llm-deepseek-api-key": "0.1.7-rc.2",
110
110
  "@deepseek-ai/dsh-host-frontend-static": "0.1.7-rc.2",
111
- "@deepseek-ai/dsh-experimental-agent-team": "0.1.7-rc.2",
112
111
  "@deepseek-ai/dsh-fs-sandbox": "0.1.7-rc.2",
113
- "@deepseek-ai/dsh-llm": "0.1.7-rc.2",
114
112
  "@deepseek-ai/dsh-host-webserver": "0.1.7-rc.2",
115
- "@deepseek-ai/dsh-agent-loop-testkit": "0.1.7-rc.2",
113
+ "@deepseek-ai/dsh-llm": "0.1.7-rc.2",
114
+ "@deepseek-ai/dsh-llm-deepseek": "0.1.7-rc.2",
115
+ "@deepseek-ai/dsh-llm-deepseek-account": "0.1.7-rc.2",
116
116
  "@deepseek-ai/dsh-llm-mock-server": "0.1.7-rc.2",
117
117
  "@deepseek-ai/dsh-llm-pi-ai": "0.1.7-rc.2",
118
- "@deepseek-ai/dsh-llm-deepseek-account": "0.1.7-rc.2",
119
- "@deepseek-ai/dsh-llm-replay": "0.1.7-rc.2",
120
- "@deepseek-ai/dsh-loader-smoke": "0.1.7-rc.2",
118
+ "@deepseek-ai/dsh-llm-deepseek-api-key": "0.1.7-rc.2",
121
119
  "@deepseek-ai/dsh-plugin-package-inventory-deepseek": "0.1.7-rc.2",
120
+ "@deepseek-ai/dsh-loader-smoke": "0.1.7-rc.2",
121
+ "@deepseek-ai/dsh-llm-replay": "0.1.7-rc.2",
122
122
  "@deepseek-ai/dsh-sandbox-policy": "0.1.7-rc.2",
123
123
  "@deepseek-ai/dsh-sandbox-local": "0.1.7-rc.2",
124
- "@deepseek-ai/dsh-sdk-client": "0.1.7-rc.2",
125
- "@deepseek-ai/dsh-session-checkpoint-policy": "0.1.7-rc.2",
126
- "@deepseek-ai/dsh-session-log-deepseek": "0.1.7-rc.2",
127
124
  "@deepseek-ai/dsh-session": "0.1.7-rc.2",
125
+ "@deepseek-ai/dsh-session-log-deepseek": "0.1.7-rc.2",
126
+ "@deepseek-ai/dsh-sdk-client": "0.1.7-rc.2",
128
127
  "@deepseek-ai/dsh-session-persistence-jsonl": "0.1.7-rc.2",
128
+ "@deepseek-ai/dsh-session-checkpoint-policy": "0.1.7-rc.2",
129
129
  "@deepseek-ai/dsh-session-query": "0.1.7-rc.2",
130
- "@deepseek-ai/dsh-subagent-fork-in-process": "0.1.7-rc.2",
131
- "@deepseek-ai/dsh-subagent": "0.1.7-rc.2",
132
130
  "@deepseek-ai/dsh-settings": "0.1.7-rc.2",
133
131
  "@deepseek-ai/dsh-shell-env": "0.1.7-rc.2",
134
132
  "@deepseek-ai/dsh-subprocess-local": "0.1.7-rc.2",
133
+ "@deepseek-ai/dsh-subagent-fork-in-process": "0.1.7-rc.2",
135
134
  "@deepseek-ai/dsh-subagent-spawn-in-process": "0.1.7-rc.2",
136
- "@deepseek-ai/dsh-tools": "0.1.7-rc.2",
135
+ "@deepseek-ai/dsh-subagent": "0.1.7-rc.2",
137
136
  "@deepseek-ai/dsh-system-prompt": "0.1.7-rc.2",
137
+ "@deepseek-ai/dsh-tools": "0.1.7-rc.2",
138
138
  "@deepseek-ai/dsh-user-approval": "0.1.7-rc.2"
139
139
  },
140
140
  "exports": {
@@ -282,6 +282,6 @@
282
282
  "@deepseek-ai/node-addon-system",
283
283
  "@deepseek-ai/schemastery"
284
284
  ],
285
- "fileCount": 3624,
286
- "byteCount": 68881376
285
+ "fileCount": 3626,
286
+ "byteCount": 69005612
287
287
  }
@@ -30,6 +30,8 @@ export interface AgentOptions {
30
30
  }
31
31
  /** Options for {@link Agent.cancel}. */
32
32
  export interface CancelOptions {
33
+ /** Interrupt this Agent alone; subagent owners leave its descendants running. */
34
+ keepChildren?: boolean | undefined;
33
35
  /**
34
36
  * Preserve queued and steering inbox items instead of discarding them. The
35
37
  * active turn is still aborted, but un-started and pending work survives for a
@@ -253,6 +255,20 @@ declare module '@deepseek-ai/cordis' {
253
255
  agent: Agent;
254
256
  status: AgentStatus;
255
257
  }): void;
258
+ /**
259
+ * A cancellation request was applied to the Agent's activity and inbox.
260
+ * Also emitted when idle so capability owners can stop independent child work.
261
+ * @param payload.agent - the exact Agent receiving cancellation.
262
+ * @param payload.cause - caller intent; the active signal retains its first cause.
263
+ * @param payload.options - pending-input and descendant preservation requested by the caller.
264
+ * Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
265
+ * @mode emit
266
+ */
267
+ 'agent/cancelled'(this: Scoped<Agent>, payload: {
268
+ agent: Agent;
269
+ cause: AgentCancelCause;
270
+ options: CancelOptions;
271
+ }): void;
256
272
  /**
257
273
  * One message entered the live inbox.
258
274
  * @param payload.agent - the agent whose inbox changed.
@@ -818,6 +818,10 @@ var ReactLoopAgent = class {
818
818
  if (this.phase.kind !== "idle") this.phase.wakeRequested = false;
819
819
  }
820
820
  if (this.phase.kind !== "idle") this.phase.abort.abort(cause);
821
+ this.dispatch.emit("agent/cancelled", {
822
+ cause,
823
+ options
824
+ });
821
825
  }
822
826
  runMaintenance(job) {
823
827
  if (this.phase.kind !== "idle") throw new Error(`agent "${this.id}" already has active work`);
@@ -316,7 +316,7 @@ export const TYPERT = {
316
316
  },
317
317
  {
318
318
  "name": "CancelOptions",
319
- "declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
319
+ "declaration": "export interface CancelOptions {\n keepChildren?: boolean | undefined;\n keepInbox?: boolean | undefined;\n}"
320
320
  },
321
321
  {
322
322
  "name": "CommandId",
@@ -1538,7 +1538,7 @@ export const TYPERT = {
1538
1538
  },
1539
1539
  {
1540
1540
  "name": "CancelOptions",
1541
- "declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
1541
+ "declaration": "export interface CancelOptions {\n keepChildren?: boolean | undefined;\n keepInbox?: boolean | undefined;\n}"
1542
1542
  },
1543
1543
  {
1544
1544
  "name": "CommandId",
@@ -2417,7 +2417,7 @@ export const TYPERT = {
2417
2417
  },
2418
2418
  {
2419
2419
  "name": "CancelOptions",
2420
- "declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
2420
+ "declaration": "export interface CancelOptions {\n keepChildren?: boolean | undefined;\n keepInbox?: boolean | undefined;\n}"
2421
2421
  },
2422
2422
  {
2423
2423
  "name": "CommandId",
@@ -751,7 +751,7 @@ export const TYPERT = {
751
751
  },
752
752
  {
753
753
  "name": "CancelOptions",
754
- "declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
754
+ "declaration": "export interface CancelOptions {\n keepChildren?: boolean | undefined;\n keepInbox?: boolean | undefined;\n}"
755
755
  },
756
756
  {
757
757
  "name": "CommandId",
@@ -1,50 +1,50 @@
1
1
  import { createHash, randomBytes } from "node:crypto";
2
2
  import { link, lstat, mkdir, readFile, rename, rm, stat, writeFile } from "node:fs/promises";
3
3
  import { dirname, win32 } from "node:path";
4
- import { execFile } from "node:child_process";
5
- import { promisify } from "node:util";
6
4
  import { closeSync, constants, fstatSync, lstatSync, openSync, readFileSync, readSync } from "node:fs";
7
5
  import { constants as constants$1 } from "node:os";
6
+ import { execFile } from "node:child_process";
7
+ import { promisify } from "node:util";
8
8
  //#region lib/types/windows-lock.js
9
- /** Exclusive Windows inspection for an empty or zero-filled lock left by a failed creator. */
10
- const execute$1 = promisify(execFile);
9
+ /** Lazy Win32 inspection of damaged legacy locks, without spawning PowerShell. */
10
+ let bindings$1;
11
+ async function windows() {
12
+ return bindings$1 ??= (async () => {
13
+ const kernel = (await import("koffi")).default.load("kernel32.dll");
14
+ return {
15
+ open: kernel.func("intptr_t __stdcall CreateFileW(str16 path, uint32_t access, uint32_t share, void *security, uint32_t creation, uint32_t flags, intptr_t template)"),
16
+ read: kernel.func("int __stdcall ReadFile(intptr_t handle, void *buffer, uint32_t size, _Out_ uint32_t *count, void *overlapped)"),
17
+ close: kernel.func("int __stdcall CloseHandle(intptr_t handle)")
18
+ };
19
+ })();
20
+ }
11
21
  /**
12
- * Read a small lock only when no other handle has the file open.
22
+ * Read a small regular lock only when the kernel excludes all other open handles.
13
23
  * @param path - lock path, protected by the caller's takeover claim.
14
24
  * @returns its record, or undefined if exclusive access or inspection fails.
15
25
  */
16
26
  async function readUnopenedWindowsLock(path) {
17
- const powershell = win32.join(process.env.SystemRoot ?? "C:\\Windows", "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
18
- const script = [
19
- "$ErrorActionPreference = 'Stop'",
20
- `$file = [IO.File]::Open('${path.replaceAll("'", "''")}', [IO.FileMode]::Open, [IO.FileAccess]::Read, [IO.FileShare]::None)`,
21
- "try {",
22
- " if ($file.Length -gt 64) { exit 1 }",
23
- " $reader = [IO.StreamReader]::new($file, [Text.Encoding]::UTF8, $false)",
24
- " try { [Console]::Out.Write([Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($reader.ReadToEnd()))) }",
25
- " finally { $reader.Dispose() }",
26
- "} finally { $file.Dispose() }"
27
- ].join("\n");
27
+ let api;
28
+ let handle;
28
29
  try {
29
- const { stdout } = await execute$1(powershell, [
30
- "-NoLogo",
31
- "-NoProfile",
32
- "-NonInteractive",
33
- "-EncodedCommand",
34
- Buffer.from(script, "utf16le").toString("base64")
35
- ], {
36
- encoding: "utf8",
37
- windowsHide: true,
38
- timeout: 2e3,
39
- maxBuffer: 4096,
40
- env: Object.fromEntries(Object.entries(process.env).filter(([name]) => !/KEY|SECRET|TOKEN|PASSWORD/i.test(name)))
41
- });
42
- const value = stdout.trim();
43
- const bytes = Buffer.from(value, "base64");
44
- if (bytes.length > 64 || bytes.toString("base64") !== value) return void 0;
45
- return bytes.toString("utf8");
30
+ api = await windows();
31
+ const before = lstatSync(path);
32
+ if (!before.isFile() || before.size > 64) return void 0;
33
+ const opened = api.open(win32.toNamespacedPath(path), 2147483648, 0, null, 3, 2097152, 0);
34
+ if (opened === -1 || opened === -1n || opened === 0 || opened === 0n) return void 0;
35
+ handle = opened;
36
+ const buffer = Buffer.alloc(65);
37
+ const count = [0];
38
+ if (api.read(handle, buffer, buffer.length, count, null) === 0) return void 0;
39
+ const size = count[0];
40
+ if (size === void 0 || !Number.isInteger(size) || size < 0 || size > 64) return void 0;
41
+ const after = lstatSync(path);
42
+ if (!after.isFile() || before.dev !== after.dev || before.ino !== after.ino || after.size !== size) return void 0;
43
+ return buffer.toString("utf8", 0, size);
46
44
  } catch (error) {
47
45
  return;
46
+ } finally {
47
+ if (handle !== void 0 && api !== void 0) api.close(handle);
48
48
  }
49
49
  }
50
50
  //#endregion
@@ -111,7 +111,7 @@ async function readClosedLinuxLock(path) {
111
111
  }
112
112
  //#endregion
113
113
  //#region lib/types/linux-lock.js
114
- /** Linux writer identity and complete-record publication on Linux and macOS. */
114
+ /** Linux writer identity and complete-record publication on supported desktop platforms. */
115
115
  const RECORD = /^(\d+)\r?\n(?:linux ([a-f0-9-]{36}) (\d+) ([a-f0-9]{24})\n)?$/u;
116
116
  let ownIdentity;
117
117
  /** Read kernel identity without treating inaccessible procfs as evidence of an exited writer. */
@@ -142,13 +142,13 @@ async function writerLockRecord() {
142
142
  return current === void 0 ? pid : `${pid}linux ${current} ${randomBytes(12).toString("hex")}\n`;
143
143
  }
144
144
  /**
145
- * Exclusively publish a complete macOS PID or Linux identity record; other platforms use wx.
145
+ * Exclusively publish a complete Windows/macOS PID or Linux identity record; other platforms use wx.
146
146
  * @param path - lock sibling in an existing parent directory.
147
147
  * @param record - one acquisition's record from writerLockRecord.
148
148
  */
149
149
  async function createWriterLock(path, record) {
150
150
  const nonce = RECORD.exec(record)?.[4];
151
- if (process.platform !== "darwin" && (process.platform !== "linux" || nonce === void 0)) {
151
+ if (process.platform !== "win32" && process.platform !== "darwin" && (process.platform !== "linux" || nonce === void 0)) {
152
152
  await writeFile(path, record, {
153
153
  mode: 384,
154
154
  flag: "wx"
@@ -265,7 +265,7 @@ async function readClosedDarwinLock(path) {
265
265
  * creator still has the lock file open. Linux uses a read lease to exclude
266
266
  * unfinished writers, and kernel process identity to distinguish a previous
267
267
  * boot, reused PID, or zombie process. macOS inspects legacy damaged records
268
- * with the system lsof and publishes complete new records by hard link.
268
+ * with the system lsof. Windows and macOS publish complete new records by hard link.
269
269
  * @module @deepseek-ai/dsh-atomic-write
270
270
  */
271
271
  const WINDOWS_TRANSIENT_FILE_ERRORS = new Set([
@@ -436,7 +436,7 @@ const DEFAULT_LOCK_WAIT_MS = 2e3;
436
436
  * excludes open writers. macOS recovers empty or zero-filled records up to
437
437
  * 128 bytes only after the system lsof reports no open handles on the unchanged
438
438
  * inode without warnings. Missing or failed inspection preserves the lock.
439
- * New macOS records are published complete by exclusive hard link.
439
+ * New Windows and macOS records are published complete by exclusive hard link.
440
440
  * Dead takeover claimants are recovered automatically.
441
441
  * Windows lock release retries transient file interference for a bounded interval. Contention backs
442
442
  * off exponentially and times out after the deadline. Linux identity records
@@ -12,7 +12,7 @@
12
12
  * creator still has the lock file open. Linux uses a read lease to exclude
13
13
  * unfinished writers, and kernel process identity to distinguish a previous
14
14
  * boot, reused PID, or zombie process. macOS inspects legacy damaged records
15
- * with the system lsof and publishes complete new records by hard link.
15
+ * with the system lsof. Windows and macOS publish complete new records by hard link.
16
16
  * @module @deepseek-ai/dsh-atomic-write
17
17
  */
18
18
  /**
@@ -80,7 +80,7 @@ export interface FileLockOptions {
80
80
  * excludes open writers. macOS recovers empty or zero-filled records up to
81
81
  * 128 bytes only after the system lsof reports no open handles on the unchanged
82
82
  * inode without warnings. Missing or failed inspection preserves the lock.
83
- * New macOS records are published complete by exclusive hard link.
83
+ * New Windows and macOS records are published complete by exclusive hard link.
84
84
  * Dead takeover claimants are recovered automatically.
85
85
  * Windows lock release retries transient file interference for a bounded interval. Contention backs
86
86
  * off exponentially and times out after the deadline. Linux identity records
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export declare function writerLockRecord(): Promise<string>;
6
6
  /**
7
- * Exclusively publish a complete macOS PID or Linux identity record; other platforms use wx.
7
+ * Exclusively publish a complete Windows/macOS PID or Linux identity record; other platforms use wx.
8
8
  * @param path - lock sibling in an existing parent directory.
9
9
  * @param record - one acquisition's record from writerLockRecord.
10
10
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Read a small lock only when no other handle has the file open.
2
+ * Read a small regular lock only when the kernel excludes all other open handles.
3
3
  * @param path - lock path, protected by the caller's takeover claim.
4
4
  * @returns its record, or undefined if exclusive access or inspection fails.
5
5
  */
@@ -190,7 +190,7 @@ export const TYPERT = {
190
190
  },
191
191
  {
192
192
  "name": "CancelOptions",
193
- "declaration": "export interface CancelOptions {\n keepInbox?: boolean | undefined;\n}"
193
+ "declaration": "export interface CancelOptions {\n keepChildren?: boolean | undefined;\n keepInbox?: boolean | undefined;\n}"
194
194
  },
195
195
  {
196
196
  "name": "CommandId",