@xth26/dsh-plan-build-mode 0.3.1 → 0.4.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.
package/README.md CHANGED
@@ -10,6 +10,13 @@ This plugin adds an independent Plan/Build mode switch to DSH:
10
10
 
11
11
  The tool denial only takes effect when Plan mode is configured as `read-only`. When the session has not been switched, Build mode is active by default.
12
12
 
13
+ ## Version compatibility
14
+
15
+ | Plugin version | DSH version | Notes |
16
+ |---|---|---|
17
+ | `0.4.x` | `>= 0.1.5-rc.1` | Uses `session.snapshotEvents()`; DSH 0.1.5 removed the `session.events` snapshot getter. |
18
+ | `<= 0.3.1` | `0.1.0-rc.x` | Legacy releases; broken on DSH 0.1.5+ because of the API change above. |
19
+
13
20
  ## Installation
14
21
 
15
22
  DSH plugins are loaded through a DSH profile. Install the plugin into the profile(s) you use:
@@ -73,7 +80,7 @@ For `0.x` versions, the semver range `^0.1.0` only matches `0.1.x` and will **ne
73
80
  ```bash
74
81
  # Bump the installed version in the target profile
75
82
  # (run this outside a sandboxed agent session; the profile directory is not writable from DSH)
76
- dsh plugin --profile dsh-tui add @xth26/dsh-plan-build-mode@0.3.1
83
+ dsh plugin --profile dsh-tui add @xth26/dsh-plan-build-mode@0.4.0
77
84
 
78
85
  # Restart the DSH process that uses that profile
79
86
  # (old Node process still holds the previous plugin code in memory)
package/README.zh.md CHANGED
@@ -9,6 +9,13 @@ OpenCode 风格的 Plan / Build 硬权限模型插件。
9
9
 
10
10
  写工具拦截仅在 Plan 模式配置为 `read-only` 时生效。首次使用或未切换时,默认处于 Build 模式。
11
11
 
12
+ ## 版本兼容性
13
+
14
+ | 插件版本 | DSH 版本 | 说明 |
15
+ |---|---|---|
16
+ | `0.4.x` | `>= 0.1.5-rc.1` | 使用 `session.snapshotEvents()`;DSH 0.1.5 移除了 `session.events` 快照 getter。 |
17
+ | `<= 0.3.1` | `0.1.0-rc.x` | 旧版本;在 DSH 0.1.5+ 上因上述 API 变更无法工作。 |
18
+
12
19
  ## 安装
13
20
 
14
21
  DSH 插件通过 DSH profile 加载。把它装到你实际使用的 profile 里:
@@ -70,7 +77,7 @@ pnpm link --global @xth26/dsh-plan-build-mode
70
77
  ```bash
71
78
  # 在目标 profile 中提升已安装版本
72
79
  # (这条命令需要在非沙箱的终端里执行;DSH agent 无法写入 profile 目录)
73
- dsh plugin --profile dsh-tui add @xth26/dsh-plan-build-mode@0.3.1
80
+ dsh plugin --profile dsh-tui add @xth26/dsh-plan-build-mode@0.4.0
74
81
 
75
82
  # 重启使用该 profile 的 DSH 进程
76
83
  # (旧的 Node 进程仍缓存着旧插件代码)
package/lib/helpers.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { Agent } from '@deepseek-ai/dsh-agent';
6
6
  import type { SandboxMode } from '@deepseek-ai/dsh-sandbox';
7
- import type { SessionEvent } from '@deepseek-ai/dsh-session';
7
+ import type { Session } from '@deepseek-ai/dsh-session';
8
8
  import type { ToolExecution } from '@deepseek-ai/dsh-tools';
9
9
  /** Default sandbox mode while Plan mode is active. */
10
10
  export declare const DEFAULT_PLAN_SANDBOX: SandboxMode;
@@ -15,14 +15,18 @@ export declare const WRITE_TOOLS: Set<string>;
15
15
  /**
16
16
  * Return the most recently written sandbox mode for a session, or undefined
17
17
  * when the session has never switched.
18
+ *
19
+ * DSH >= 0.1.5 removed the `session.events` snapshot getter; the log is read
20
+ * through `session.snapshotEvents()` instead (an immutable, cached full-log
21
+ * snapshot with the same element shape).
18
22
  */
19
- export declare function currentSandboxMode(events: readonly SessionEvent[]): SandboxMode | undefined;
23
+ export declare function currentSandboxMode(session: Session): SandboxMode | undefined;
20
24
  /**
21
25
  * Whether the session is currently in OpenCode Plan mode.
22
26
  * Plan mode is defined as the current sandbox mode matching the configured
23
27
  * planSandbox (read-only by default).
24
28
  */
25
- export declare function isPlanModeActive(events: readonly SessionEvent[], planSandbox: SandboxMode): boolean;
29
+ export declare function isPlanModeActive(session: Session, planSandbox: SandboxMode): boolean;
26
30
  /**
27
31
  * Append a `sandbox/mode` event to switch between Plan and Build mode.
28
32
  */
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAG3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE3D,sDAAsD;AACtD,eAAO,MAAM,oBAAoB,EAAE,WAAyB,CAAA;AAE5D,uDAAuD;AACvD,eAAO,MAAM,qBAAqB,EAAE,WAA+B,CAAA;AAEnE,0CAA0C;AAC1C,eAAO,MAAM,WAAW,aAA6B,CAAA;AAErD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,WAAW,GAAG,SAAS,CAQ3F;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAEnG;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,GAAG,IAAI,CAGhI;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,aAAa,EACnB,WAAW,EAAE,WAAW,EACxB,UAAU,GAAE,WAAW,CAAC,MAAM,CAAe,GAC5C,MAAM,GAAG,SAAS,CAQpB"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAG3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE3D,sDAAsD;AACtD,eAAO,MAAM,oBAAoB,EAAE,WAAyB,CAAA;AAE5D,uDAAuD;AACvD,eAAO,MAAM,qBAAqB,EAAE,WAA+B,CAAA;AAEnE,0CAA0C;AAC1C,eAAO,MAAM,WAAW,aAA6B,CAAA;AAErD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,GAAG,SAAS,CAS5E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,GAAG,OAAO,CAEpF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,GAAG,IAAI,CAGhI;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,aAAa,EACnB,WAAW,EAAE,WAAW,EACxB,UAAU,GAAE,WAAW,CAAC,MAAM,CAAe,GAC5C,MAAM,GAAG,SAAS,CAQpB"}
package/lib/helpers.js CHANGED
@@ -11,8 +11,13 @@ export const WRITE_TOOLS = new Set(['write', 'edit']);
11
11
  /**
12
12
  * Return the most recently written sandbox mode for a session, or undefined
13
13
  * when the session has never switched.
14
+ *
15
+ * DSH >= 0.1.5 removed the `session.events` snapshot getter; the log is read
16
+ * through `session.snapshotEvents()` instead (an immutable, cached full-log
17
+ * snapshot with the same element shape).
14
18
  */
15
- export function currentSandboxMode(events) {
19
+ export function currentSandboxMode(session) {
20
+ const events = session.snapshotEvents();
16
21
  for (let i = events.length - 1; i >= 0; i -= 1) {
17
22
  const event = events[i];
18
23
  if (event.type === 'sandbox/mode') {
@@ -26,8 +31,8 @@ export function currentSandboxMode(events) {
26
31
  * Plan mode is defined as the current sandbox mode matching the configured
27
32
  * planSandbox (read-only by default).
28
33
  */
29
- export function isPlanModeActive(events, planSandbox) {
30
- return currentSandboxMode(events) === planSandbox;
34
+ export function isPlanModeActive(session, planSandbox) {
35
+ return currentSandboxMode(session) === planSandbox;
31
36
  }
32
37
  /**
33
38
  * Append a `sandbox/mode` event to switch between Plan and Build mode.
@@ -50,7 +55,7 @@ export function planModeDenial(exec, planSandbox, writeTools = WRITE_TOOLS) {
50
55
  return undefined;
51
56
  if (planSandbox !== 'read-only')
52
57
  return undefined;
53
- if (!isPlanModeActive(exec.agent.session.events, planSandbox))
58
+ if (!isPlanModeActive(exec.agent.session, planSandbox))
54
59
  return undefined;
55
60
  if (writeTools.has(exec.name)) {
56
61
  return `Tool '${exec.name}' is forbidden in Plan Mode. Run /plan-build (or /plan-build switch build) to leave Plan Mode before editing files.`;
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,sDAAsD;AACtD,MAAM,CAAC,MAAM,oBAAoB,GAAgB,WAAW,CAAA;AAE5D,uDAAuD;AACvD,MAAM,CAAC,MAAM,qBAAqB,GAAgB,iBAAiB,CAAA;AAEnE,0CAA0C;AAC1C,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;AAErD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAA+B;IAChE,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAE,CAAA;Q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AI,WAAW,KAAK,WAAW;QAAE,OAAO,SAAS,CAAA;IACjD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC;QAAE,OAAO,SAAS,CAAA;IACxE,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,OAAO,SAAS,IAAI,CAAC,IAAI,qHAAqH,CAAA;IAChJ,CAAC;IACD,OAAO,SAAS,CAAA;AAClB,CAAC"}
package/lib/index.d.ts CHANGED
@@ -18,8 +18,12 @@ import z from '@deepseek-ai/schemastery';
18
18
  import type { PlanBuildModeConfig } from './types.ts';
19
19
  /** Cordis plugin name. */
20
20
  export declare const name = "dsh-plan-build-mode";
21
- /** Service dependencies for the host half. */
22
- export declare const inject: readonly ["agents", "tools", "systemPrompt"];
21
+ /**
22
+ * Service dependencies for the host half. `commands` is injected optionally at
23
+ * runtime via ctx.inject(['commands'], ...) so headless assemblies stay
24
+ * unaffected; the hard services are systemPrompt and tools.
25
+ */
26
+ export declare const inject: readonly ["tools", "systemPrompt"];
23
27
  /** Configuration schema. */
24
28
  export declare const Config: z<Schemastery.ObjectS<{
25
29
  planSandbox: z<"read-only" | "workspace-write" | "danger-full-access", "read-only" | "workspace-write" | "danger-full-access">;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAmBxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErD,0BAA0B;AAC1B,eAAO,MAAM,IAAI,wBAAwB,CAAA;AACzC,8CAA8C;AAC9C,eAAO,MAAM,MAAM,8CAA+C,CAAA;AAClE,4BAA4B;AAC5B,eAAO,MAAM,MAAM;;;;;;;;;;GAajB,CAAA;AAEF;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,mBAAwB,GAAG,IAAI,CAoG1E"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAmBxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAErD,0BAA0B;AAC1B,eAAO,MAAM,IAAI,wBAAwB,CAAA;AACzC;;;;GAIG;AACH,eAAO,MAAM,MAAM,oCAAqC,CAAA;AACxD,4BAA4B;AAC5B,eAAO,MAAM,MAAM;;;;;;;;;;GAajB,CAAA;AAEF;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,mBAAwB,GAAG,IAAI,CAgG1E"}
package/lib/index.js CHANGED
@@ -17,8 +17,12 @@ import z from '@deepseek-ai/schemastery';
17
17
  import { DEFAULT_BUILD_SANDBOX, DEFAULT_PLAN_SANDBOX, isPlanModeActive, planModeDenial, setPlanBuildMode, WRITE_TOOLS, } from "./helpers.js";
18
18
  /** Cordis plugin name. */
19
19
  export const name = 'dsh-plan-build-mode';
20
- /** Service dependencies for the host half. */
21
- export const inject = ['agents', 'tools', 'systemPrompt'];
20
+ /**
21
+ * Service dependencies for the host half. `commands` is injected optionally at
22
+ * runtime via ctx.inject(['commands'], ...) so headless assemblies stay
23
+ * unaffected; the hard services are systemPrompt and tools.
24
+ */
25
+ export const inject = ['tools', 'systemPrompt'];
22
26
  /** Configuration schema. */
23
27
  export const Config = z.object({
24
28
  planSandbox: z.union([
@@ -49,12 +53,9 @@ export function apply(ctx, config = {}) {
49
53
  const enableSection = config.section !== false;
50
54
  ctx.effect(() => {
51
55
  const disposers = [];
52
- // Align existing sessions on load (resumed sessions may already have
53
- // sandbox/mode events).
54
- for (const _agent of ctx.agents.list()) {
55
- // No-op on load: state is already in the log; we only react to commands.
56
- }
57
56
  // Inject a system prompt section describing the current mode.
57
+ // AssembleContext carries `agent?: Agent` (merged by @deepseek-ai/dsh-agent)
58
+ // since the scope-based system-prompt rewrite; it is absent on diagnostics.
58
59
  if (enableSection) {
59
60
  disposers.push(ctx.systemPrompt.section({
60
61
  name: 'plan-build:policy',
@@ -63,7 +64,7 @@ export function apply(ctx, config = {}) {
63
64
  const agent = context.agent;
64
65
  if (agent === undefined)
65
66
  return '';
66
- return isPlanModeActive(agent.session.events, planSandbox)
67
+ return isPlanModeActive(agent.session, planSandbox)
67
68
  ? 'You are in OpenCode Plan Mode. You are READ-ONLY. You may read files, search code, browse directories, ask questions, and inspect data or run quick read-only sanity checks. You are encouraged to write short command-line Python snippets (for example, python -B -c "...") to read data files, compute statistics, sample records, or run fast tests that do not modify the filesystem or write caches. Avoid commands that install packages, write files, generate build artifacts, or change the system. If a verification requires writing files, leave it for Build Mode. Present a complete plan and use /plan-build (or /plan-build switch build) to enter Build Mode before implementing.'
68
69
  : 'You are in OpenCode Build Mode. You may edit files, run commands, and execute the approved plan. Make minimal changes, run tests/verification after changes, and ask for confirmation before destructive git operations or system-wide changes. Run /plan-build (or /plan-build switch plan) to return to Plan Mode when you need to re-plan.';
69
70
  },
@@ -87,7 +88,7 @@ export function apply(ctx, config = {}) {
87
88
  input: { hint: '[status | switch [plan|build]]' },
88
89
  handler: ({ agent, rawInput }) => {
89
90
  const arg = rawInput.trim().toLowerCase();
90
- const active = isPlanModeActive(agent.session.events, planSandbox);
91
+ const active = isPlanModeActive(agent.session, planSandbox);
91
92
  if (arg === '' || arg === 'switch') {
92
93
  const next = active ? 'build' : 'plan';
93
94
  setPlanBuildMode(agent, next, planSandbox, buildSandbox);
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts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AM,CAAA;oBACtC,IAAI,MAAM,KAAK,YAAY,EAAE,CAAC;wBAC5B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,MAAM,QAAQ,EAAE,CAAA;oBAChE,CAAC;oBAED,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,CAAC,CAAA;oBAC1D,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,MAAM,QAAQ,EAAE,CAAA;gBACjE,CAAC;aACF,CAAC,CAAC,CAAA;QACL,CAAC,CAAC,CAAA;QAEF,OAAO,GAAG,EAAE;YACV,KAAK,MAAM,OAAO,IAAI,SAAS;gBAAE,OAAO,EAAE,CAAA;QAC5C,CAAC,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../src/invariant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,oCAAoC;AACpC,eAAO,MAAM,IAAI,kCAAkC,CAAA;AACnD,2EAA2E;AAC3E,eAAO,MAAM,MAAM,yBAA0B,CAAA;AAO7C;;;;GAIG;AACH,eAAO,MAAM,KAAK,QAAS,OAAO,GAAG;IAAE,UAAU,EAAE,OAAO,CAAA;CAAE,KAAG,OAAO,CAAC,MAAM,IAAI,CAM9E,CAAA"}
1
+ {"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../src/invariant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,oCAAoC;AACpC,eAAO,MAAM,IAAI,kCAAkC,CAAA;AACnD,2EAA2E;AAC3E,eAAO,MAAM,MAAM,yBAA0B,CAAA;AAO7C;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,KAAK,OAAO,GAAG;IAAE,UAAU,EAAE,OAAO,CAAA;CAAE,KAAG,OAAO,CAAC,MAAM,IAAI,CAM9E,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xth26/dsh-plan-build-mode",
3
3
  "description": "OpenCode-style Plan / Build hard permission model for DSH",
4
- "version": "0.3.1",
4
+ "version": "0.4.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -40,16 +40,16 @@
40
40
  },
41
41
  "license": "MIT",
42
42
  "peerDependencies": {
43
- "@deepseek-ai/cordis": "^4.0.1",
44
- "@deepseek-ai/dsh-agent": "^0.1.0-rc.8",
45
- "@deepseek-ai/dsh-commands": "^0.1.0-rc.8",
46
- "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8",
47
- "@deepseek-ai/dsh-sandbox": "^0.1.0-rc.8",
48
- "@deepseek-ai/dsh-sandbox-policy": "^0.1.0-rc.8",
49
- "@deepseek-ai/dsh-session": "^0.1.0-rc.8",
50
- "@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.8",
51
- "@deepseek-ai/dsh-tools": "^0.1.0-rc.8",
52
- "@deepseek-ai/schemastery": "^3.18.1"
43
+ "@deepseek-ai/cordis": "^4.0.2",
44
+ "@deepseek-ai/dsh-agent": "^0.1.5-rc.1",
45
+ "@deepseek-ai/dsh-commands": "^0.1.5-rc.1",
46
+ "@deepseek-ai/dsh-invariants": "^0.1.5-rc.1",
47
+ "@deepseek-ai/dsh-sandbox": "^0.1.5-rc.1",
48
+ "@deepseek-ai/dsh-sandbox-policy": "^0.1.5-rc.1",
49
+ "@deepseek-ai/dsh-session": "^0.1.5-rc.1",
50
+ "@deepseek-ai/dsh-system-prompt": "^0.1.5-rc.1",
51
+ "@deepseek-ai/dsh-tools": "^0.1.5-rc.1",
52
+ "@deepseek-ai/schemastery": "^3.18.2"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@deepseek-ai/cordis": {
@@ -84,16 +84,16 @@
84
84
  }
85
85
  },
86
86
  "devDependencies": {
87
- "@deepseek-ai/cordis": "link:../deepseek-harness/vendor/cordis",
88
- "@deepseek-ai/dsh-agent": "link:../deepseek-harness/packages/core/agent",
89
- "@deepseek-ai/dsh-commands": "link:../deepseek-harness/packages/interaction/commands",
90
- "@deepseek-ai/dsh-invariants": "link:../deepseek-harness/packages/runtime-diagnostics/invariants",
91
- "@deepseek-ai/dsh-sandbox": "link:../deepseek-harness/packages/sandbox/sandbox",
92
- "@deepseek-ai/dsh-sandbox-policy": "link:../deepseek-harness/packages/sandbox/sandbox-policy",
93
- "@deepseek-ai/dsh-session": "link:../deepseek-harness/packages/core/session",
94
- "@deepseek-ai/dsh-system-prompt": "link:../deepseek-harness/packages/core/system-prompt",
95
- "@deepseek-ai/dsh-tools": "link:../deepseek-harness/packages/core/tools",
96
- "@deepseek-ai/schemastery": "link:../deepseek-harness/vendor/schemastery",
87
+ "@deepseek-ai/cordis": "4.0.2",
88
+ "@deepseek-ai/dsh-agent": "0.1.5-rc.2",
89
+ "@deepseek-ai/dsh-commands": "0.1.5-rc.2",
90
+ "@deepseek-ai/dsh-invariants": "0.1.5-rc.2",
91
+ "@deepseek-ai/dsh-sandbox": "0.1.5-rc.2",
92
+ "@deepseek-ai/dsh-sandbox-policy": "0.1.5-rc.2",
93
+ "@deepseek-ai/dsh-session": "0.1.5-rc.2",
94
+ "@deepseek-ai/dsh-system-prompt": "0.1.5-rc.2",
95
+ "@deepseek-ai/dsh-tools": "0.1.5-rc.2",
96
+ "@deepseek-ai/schemastery": "^3.18.2",
97
97
  "@types/node": "^22.0.0",
98
98
  "typescript": "^5.7.0",
99
99
  "vitest": "^2.1.0"