@dsmm/dsmm 0.1.1 → 0.1.4

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 (95) hide show
  1. package/README.md +24 -13
  2. package/agent-presets/dsmm-builder/agent.cordis.yml +14 -12
  3. package/agent-presets/dsmm-builder/preset.yml +1 -1
  4. package/agent-presets/dsmm-clarifier/agent.cordis.yml +4 -2
  5. package/agent-presets/dsmm-clarifier/preset.yml +1 -1
  6. package/agent-presets/dsmm-code-search/agent.cordis.yml +4 -2
  7. package/agent-presets/dsmm-code-search/preset.yml +1 -1
  8. package/agent-presets/dsmm-creative/agent.cordis.yml +3 -1
  9. package/agent-presets/dsmm-creative/preset.yml +1 -1
  10. package/agent-presets/dsmm-doc-search/agent.cordis.yml +4 -2
  11. package/agent-presets/dsmm-doc-search/preset.yml +1 -1
  12. package/agent-presets/dsmm-media-reader/agent.cordis.yml +4 -2
  13. package/agent-presets/dsmm-media-reader/preset.yml +1 -1
  14. package/agent-presets/dsmm-oracle/agent.cordis.yml +3 -1
  15. package/agent-presets/dsmm-oracle/preset.yml +1 -1
  16. package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +3 -1
  17. package/agent-presets/dsmm-oracle-2nd/preset.yml +1 -1
  18. package/agent-presets/dsmm-orchestrator/agent.cordis.yml +15 -13
  19. package/agent-presets/dsmm-orchestrator/preset.yml +2 -2
  20. package/agent-presets/dsmm-plan-critic/agent.cordis.yml +4 -2
  21. package/agent-presets/dsmm-plan-critic/preset.yml +1 -1
  22. package/agent-presets/dsmm-planner/agent.cordis.yml +4 -2
  23. package/agent-presets/dsmm-planner/preset.yml +1 -1
  24. package/agent-presets/dsmm-reviewer/agent.cordis.yml +4 -2
  25. package/agent-presets/dsmm-reviewer/preset.yml +1 -1
  26. package/docs/agent-presets.md +15 -5
  27. package/docs/compatibility.md +64 -11
  28. package/docs/model-routing.md +10 -6
  29. package/docs/profiles.md +83 -0
  30. package/docs/releasing.md +58 -19
  31. package/docs/settings-status.md +13 -5
  32. package/lib/client/ProfilesSection.d.ts +11 -0
  33. package/lib/client/ProfilesSection.js +62 -0
  34. package/lib/client/controller.d.ts +77 -0
  35. package/lib/client/controller.js +198 -0
  36. package/lib/client/index.d.ts +11 -0
  37. package/lib/client/index.js +34 -0
  38. package/lib/client/locales.d.ts +56 -0
  39. package/lib/client/locales.js +48 -0
  40. package/lib/client/styles.d.ts +3 -0
  41. package/lib/client/styles.js +25 -0
  42. package/lib/client.js +1930 -0
  43. package/lib/commands.d.ts +3 -3
  44. package/lib/commands.js +4 -4
  45. package/lib/dsh-types.d.ts +4 -0
  46. package/lib/guards.d.ts +2 -2
  47. package/lib/guards.js +3 -2
  48. package/lib/index.d.ts +12 -4
  49. package/lib/index.js +72 -20
  50. package/lib/mode.d.ts +2 -2
  51. package/lib/mode.js +1 -1
  52. package/lib/model-routing.d.ts +2 -2
  53. package/lib/model-routing.js +17 -2
  54. package/lib/preset-registry.js +5 -3
  55. package/lib/profile-remote.d.ts +31 -0
  56. package/lib/profile-remote.js +106 -0
  57. package/lib/profile-rpc.d.ts +27 -0
  58. package/lib/profile-rpc.js +90 -0
  59. package/lib/profile-runtime.d.ts +44 -0
  60. package/lib/profile-runtime.js +159 -0
  61. package/lib/profile-store.d.ts +42 -0
  62. package/lib/profile-store.js +478 -0
  63. package/lib/profile-types.d.ts +40 -0
  64. package/lib/profile-types.js +2 -0
  65. package/lib/profiles.d.ts +26 -0
  66. package/lib/profiles.js +237 -0
  67. package/lib/prompts.d.ts +2 -2
  68. package/lib/prompts.js +4 -4
  69. package/lib/role-providers.d.ts +2 -2
  70. package/lib/role-providers.js +39 -6
  71. package/lib/role-routing.d.ts +2 -2
  72. package/lib/role-routing.js +4 -1
  73. package/lib/role-subagents.d.ts +2 -2
  74. package/lib/role-subagents.js +6 -4
  75. package/lib/roles.d.ts +4 -0
  76. package/lib/roles.js +43 -27
  77. package/lib/runtime-recovery.d.ts +2 -2
  78. package/lib/runtime-recovery.js +3 -3
  79. package/lib/session-metadata.d.ts +13 -0
  80. package/lib/session-metadata.js +34 -0
  81. package/lib/session-persistence.d.ts +35 -0
  82. package/lib/session-persistence.js +304 -0
  83. package/lib/settings.d.ts +8 -1
  84. package/lib/settings.js +4 -0
  85. package/lib/state.d.ts +1 -0
  86. package/lib/state.js +4 -0
  87. package/lib/status.js +6 -5
  88. package/locale/en.json +6 -0
  89. package/locale/zh.json +6 -0
  90. package/package.json +62 -15
  91. package/patches/agent-presets-root.example.cordis.patch.yml +6 -10
  92. package/prompts/deepseek-v4-pro.md +1 -1
  93. package/prompts/deepwork.md +3 -3
  94. package/scripts/repair-session-log.mjs +476 -0
  95. package/scripts/session-repair-native-verifier.mjs +367 -0
package/lib/state.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { sessionEvents } from "./session-scope.js";
2
+ import { assertDsmmMetadataPersistence } from "./session-metadata.js";
2
3
  export const DEEPWORK_MODE_EVENT = "deepwork/mode";
3
4
  function activeFromEvent(event) {
4
5
  if (event.type !== DEEPWORK_MODE_EVENT)
@@ -25,8 +26,10 @@ export function hasOpenTurn(events = []) {
25
26
  return open;
26
27
  }
27
28
  export class DeepworkModeController {
29
+ ctx;
28
30
  pending = new WeakMap();
29
31
  constructor(ctx) {
32
+ this.ctx = ctx;
30
33
  ctx.on?.("agent/pre-step", async (frame, next) => {
31
34
  const decision = await next();
32
35
  const intent = this.pending.get(frame.agent.session);
@@ -57,6 +60,7 @@ export class DeepworkModeController {
57
60
  return "committed";
58
61
  }
59
62
  async commit(session, active) {
63
+ assertDsmmMetadataPersistence(this.ctx);
60
64
  await session.append(DEEPWORK_MODE_EVENT, { active });
61
65
  this.pending.delete(session);
62
66
  }
package/lib/status.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { classifyModelFamily } from "./model-family.js";
2
2
  import { isDeepseekFlashRoute, isDeepseekV4ProRoute } from "./model-routing.js";
3
- import { isDsmmRoleId } from "./roles.js";
3
+ import { DSMM_ROLES, isDsmmRoleId } from "./roles.js";
4
4
  import { effectiveRoleFallbackRoutes, persistedRoleRoute, rolePolicyIdentity } from "./role-routing.js";
5
5
  import { resolveEffectiveDsmmRole, resolveSelectedAgentPreset } from "./session-scope.js";
6
6
  export const DSMM_STATUS_VERSION = 1;
@@ -85,11 +85,12 @@ export function createDsmmStatusSnapshot(input) {
85
85
  };
86
86
  }
87
87
  export function formatDsmmStatus(snapshot) {
88
+ const displayRole = (id) => DSMM_ROLES.find((role) => role.id === id)?.name ?? id ?? "none";
88
89
  const scope = snapshot.rolePolicy.role !== undefined && snapshot.rolePolicy.role !== "dsmm-orchestrator"
89
90
  && snapshot.rolePolicy.role !== snapshot.mode.selectedPreset
90
- ? `${snapshot.rolePolicy.role} role`
91
+ ? `${displayRole(snapshot.rolePolicy.role)} role`
91
92
  : snapshot.mode.inScope && snapshot.mode.dsmmPreset && snapshot.mode.selectedPreset
92
- ? `${snapshot.mode.selectedPreset} preset`
93
+ ? `${displayRole(snapshot.mode.selectedPreset)} preset`
93
94
  : snapshot.mode.inScope
94
95
  ? "active deepwork"
95
96
  : "out of scope";
@@ -98,12 +99,12 @@ export function formatDsmmStatus(snapshot) {
98
99
  const policyEffort = snapshot.calibration.policyEffort ?? "not applicable";
99
100
  const currentReasoningEffort = snapshot.route.currentReasoningEffort ?? "provider default";
100
101
  return [
101
- "DSMM status",
102
+ "Deepwork status",
102
103
  `Mode: ${snapshot.mode.active ? "active" : "inactive"} (${snapshot.mode.name})`,
103
104
  `Scope: ${scope}`,
104
105
  `Workflow policy: ${snapshot.effectiveSettings.workflow.policy}`,
105
106
  `Route: ${provider}/${model} [${snapshot.route.family}]`,
106
- `Role policy: ${snapshot.rolePolicy.role ?? "none"}; primary=${snapshot.rolePolicy.primary === undefined ? "inherit" : `${snapshot.rolePolicy.primary.provider}/${snapshot.rolePolicy.primary.model}`}; fallbacks=${snapshot.rolePolicy.fallbackSource}`,
107
+ `Role policy: ${displayRole(snapshot.rolePolicy.role)}; primary=${snapshot.rolePolicy.primary === undefined ? "inherit" : `${snapshot.rolePolicy.primary.provider}/${snapshot.rolePolicy.primary.model}`}; fallbacks=${snapshot.rolePolicy.fallbackSource}`,
107
108
  `Reasoning: ${snapshot.calibration.mode}; policy=${policyEffort}; current=${currentReasoningEffort}; action=${snapshot.calibration.action}`,
108
109
  `Runtime recovery: ${snapshot.runtimeRecovery.enabled ? "enabled" : "disabled"}; applies=${snapshot.runtimeRecovery.applies ? "yes" : "no"}; fallbacks=${snapshot.runtimeRecovery.fallbackRouteCount}; max attempts=${snapshot.runtimeRecovery.maxFallbackAttempts}`,
109
110
  `Idle continuation: ${snapshot.runtimeRecovery.idleContinuation.enabled ? "enabled" : "disabled"}; max=${snapshot.runtimeRecovery.idleContinuation.maxContinuations}`,
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Deepwork",
4
+ "description": "Deepwork workflows, DW agents and independent profiles for DeepSeek Harness."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Deepwork",
4
+ "description": "DeepSeek Harness 的 Deepwork 工作流、DW 智能体与独立配置档。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@dsmm/dsmm",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "description": "DeepSeek Harness deepwork mode bundle for ocmm-style agentic workflows.",
5
5
  "author": "Hugefiver",
6
6
  "license": "LicenseRef-AAAPL",
7
- "repository": "https://github.com/hugefiver/ocmm",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/hugefiver/ocmm"
10
+ },
8
11
  "homepage": "https://github.com/hugefiver/ocmm/tree/master/dsmm",
9
12
  "bugs": "https://github.com/hugefiver/ocmm/issues",
10
13
  "keywords": [
@@ -31,11 +34,24 @@
31
34
  "types": "./lib/preset-skills.d.ts",
32
35
  "default": "./lib/preset-skills.js"
33
36
  },
34
- "./package.json": "./package.json"
37
+ "./session-persistence": {
38
+ "types": "./lib/session-persistence.d.ts",
39
+ "default": "./lib/session-persistence.js"
40
+ },
41
+ "./client": {
42
+ "types": "./lib/client/index.d.ts",
43
+ "default": "./lib/client.js"
44
+ },
45
+ "./package.json": "./package.json",
46
+ "./locale/en.json": "./locale/en.json",
47
+ "./locale/zh.json": "./locale/zh.json"
35
48
  },
36
49
  "files": [
37
50
  "lib/**/*.js",
38
51
  "lib/**/*.d.ts",
52
+ "scripts/repair-session-log.mjs",
53
+ "scripts/session-repair-native-verifier.mjs",
54
+ "locale/*.json",
39
55
  "agent-presets",
40
56
  "docs/agent-presets.md",
41
57
  "docs/compatibility.md",
@@ -43,6 +59,7 @@
43
59
  "docs/lsp.md",
44
60
  "docs/migration-from-ocmm.md",
45
61
  "docs/model-routing.md",
62
+ "docs/profiles.md",
46
63
  "docs/releasing.md",
47
64
  "docs/research",
48
65
  "docs/roadmap.md",
@@ -57,29 +74,24 @@
57
74
  "LICENSE",
58
75
  "README.md"
59
76
  ],
60
- "scripts": {
61
- "build": "tsc -p tsconfig.json",
62
- "check:release": "node scripts/check-release-readiness.mjs",
63
- "typecheck": "tsc -p tsconfig.json --noEmit",
64
- "typecheck:test": "pnpm run build && tsc -p tsconfig.test.json --noEmit",
65
- "test": "pnpm run build && node --test --experimental-strip-types test/*.test.ts",
66
- "smoke:docker:build": "docker build --build-arg DSH_PACKAGE=@deepseek-ai/dsh@0.2.0-rc.2 -f docker/Dockerfile.smoke -t dsmm-dsh-smoke:0.2 ..",
67
- "smoke:docker:run": "docker run --rm dsmm-dsh-smoke:0.2",
68
- "smoke:docker": "node scripts/docker-smoke.mjs"
69
- },
70
77
  "engines": {
71
78
  "node": ">=22"
72
79
  },
73
80
  "dependencies": {
74
- "@deepseek-ai/schemastery": "~3.18.4"
81
+ "@deepseek-ai/schemastery": "~3.18.4",
82
+ "jsonc-parser": "^3.3.1"
75
83
  },
76
84
  "peerDependencies": {
77
85
  "@deepseek-ai/cordis": "~4.0.4",
86
+ "@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2",
78
87
  "@deepseek-ai/dsh-attachment": "0.2.0-rc.2",
79
88
  "@deepseek-ai/dsh-brand": "0.2.0-rc.2",
80
89
  "@deepseek-ai/dsh-invariants": "0.2.0-rc.2",
81
90
  "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
82
91
  "@deepseek-ai/dsh-timeout": "0.2.0-rc.2",
92
+ "@deepseek-ai/dsh-session": "0.2.0-rc.2",
93
+ "@deepseek-ai/dsh-session-persistence": "0.2.0-rc.2",
94
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.0-rc.2",
83
95
  "@deepseek-ai/dsh-agent-preset-registry": "0.2.0-rc.2",
84
96
  "@deepseek-ai/dsh-tool-subagent": "0.2.0-rc.2",
85
97
  "@deepseek-ai/dsh-subagent": "0.2.0-rc.2",
@@ -95,11 +107,26 @@
95
107
  },
96
108
  "devDependencies": {
97
109
  "@deepseek-ai/cordis": "~4.0.4",
110
+ "@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2",
111
+ "@deepseek-ai/dsh-typert-registry": "0.2.0-rc.2",
112
+ "@deepseek-ai/dsh-api-gateway": "0.2.0-rc.2",
113
+ "@deepseek-ai/dsh-client-connection": "0.2.0-rc.2",
114
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.2",
115
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.2",
116
+ "@deepseek-ai/dsh-client-store": "0.2.0-rc.2",
117
+ "@deepseek-ai/dsh-client-locale": "0.2.0-rc.2",
118
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.2",
119
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.2",
120
+ "@types/react": "^18.3.27",
121
+ "esbuild": "^0.25.12",
122
+ "react": "^18.3.1",
98
123
  "@deepseek-ai/dsh-attachment": "0.2.0-rc.2",
99
124
  "@deepseek-ai/dsh-brand": "0.2.0-rc.2",
100
125
  "@deepseek-ai/dsh-invariants": "0.2.0-rc.2",
101
126
  "@deepseek-ai/dsh-llm": "0.2.0-rc.2",
102
127
  "@deepseek-ai/dsh-timeout": "0.2.0-rc.2",
128
+ "@deepseek-ai/dsh-session-persistence": "0.2.0-rc.2",
129
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.0-rc.2",
103
130
  "@deepseek-ai/dsh-system-prompt": "0.2.0-rc.2",
104
131
  "@deepseek-ai/dsh-agent": "0.2.0-rc.2",
105
132
  "@deepseek-ai/dsh-agent-loop": "0.2.0-rc.2",
@@ -124,8 +151,28 @@
124
151
  "typescript": "^6.0.3"
125
152
  },
126
153
  "dsh": {
154
+ "client": {
155
+ "platform": "web",
156
+ "inject": [
157
+ "@deepseek-ai/dsh-api-gateway",
158
+ "@deepseek-ai/dsh-client-locale",
159
+ "@deepseek-ai/dsh-client-ui-renderer"
160
+ ],
161
+ "external": []
162
+ },
127
163
  "bundle": {
128
164
  "patch": "./cordis.patch.yml"
129
165
  }
166
+ },
167
+ "scripts": {
168
+ "build": "tsc -p tsconfig.json && node scripts/build-client.mjs",
169
+ "build:client": "node scripts/build-client.mjs",
170
+ "check:release": "node scripts/check-release-readiness.mjs",
171
+ "typecheck": "tsc -p tsconfig.json --noEmit",
172
+ "typecheck:test": "pnpm run build && tsc -p tsconfig.test.json --noEmit",
173
+ "test": "pnpm run build && node --test --experimental-strip-types test/*.test.ts",
174
+ "smoke:docker:build": "docker build --build-arg DSH_PACKAGE=@deepseek-ai/dsh@0.2.0-rc.2 -f docker/Dockerfile.smoke -t dsmm-dsh-smoke:0.2 ..",
175
+ "smoke:docker:run": "docker run --rm dsmm-dsh-smoke:0.2",
176
+ "smoke:docker": "node scripts/docker-smoke.mjs"
130
177
  }
131
- }
178
+ }
@@ -1,14 +1,10 @@
1
1
  # Example only: dsmm does not auto-apply this patch.
2
2
  #
3
- # Use this from an explicit dsh profile/patch after enabling dsmm preset
4
- # materialization with a matching `presets.root` value in the dsmm config.
5
- # Patching `agent-presets` replaces the whole row, so restate default, roots,
6
- # and includeUserRoot instead of only adding the dsmm root.
3
+ # DSH 0.2 registers enabled root-capable DSMM roles through the native registry;
4
+ # exported preset directories are inspection templates, not discovery inputs.
5
+ # Use this optional explicit patch only to choose the default for new sessions.
6
+ # The chosen DSMM role must be enabled. Auxiliary roles are delegation-only.
7
+ # Installing DSMM does not apply this patch or change the deployment default.
7
8
  - id: agent-presets
8
9
  config:
9
- default: standard
10
- roots:
11
- # Replace this with the same absolute path configured as dsmm.presets.root.
12
- - path: /absolute/path/to/dsmm-managed-agent-presets
13
- trust: user
14
- includeUserRoot: true
10
+ default: dsmm-orchestrator
@@ -7,7 +7,7 @@ DeepSeek V4 Pro calibration is active.
7
7
  - Use tools before making repository-specific or API-specific claims.
8
8
  - Runtime reasoning effort is enforced by `agent/request`, not this prompt.
9
9
  - In `auto` calibration, explicit upstream reasoning effort is preserved; `strict` overrides it with computed policy.
10
- - Only adapter-advertised reasoning efforts are emitted; `max` is selected only for configured DSMM presets.
10
+ - Only adapter-advertised reasoning efforts are emitted; `max` is selected only for configured DW presets.
11
11
  - Keep final answers concise and do not expose private chain-of-thought.
12
12
  - When tool calls are enabled through the provider, preserve the provider-required reasoning/tool-call continuity.
13
13
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  DEEPWORK MODE ENABLED!
4
4
 
5
- Use this workflow only while the `{{modeName}}` mode is active OR a DSMM-managed preset is selected. This is an opt-in boundary: outside both conditions, do not apply dsmm-specific gates, intent routing, or tool-discipline requirements. The default mode name is `deepwork` unless configured.
5
+ Use this workflow only while the `{{modeName}}` mode is active OR a DW-managed preset is selected. This is an opt-in boundary: outside both conditions, do not apply Deepwork-specific gates, intent routing, or tool-discipline requirements. The default mode name is `deepwork` unless configured.
6
6
 
7
7
  ## Intent routing
8
8
 
@@ -17,7 +17,7 @@ Determine whether the user requests an explanation, diagnosis, implementation, o
17
17
  - For completed implementation, gather evidence from tests, diagnostics, and real surfaces before declaring done.
18
18
  - Keep scope exact. Do not add unrelated refactors, speculative abstractions, or surprise features.
19
19
  - The bundled workflow skill set is available in this mode: `brainstorming`, `writing-plans`, `subagent-driven-development`, `dispatching-parallel-agents`, `requesting-code-review`, `receiving-code-review`, and `remove-ai-slops`.
20
- - `workflow.policy=risk-based` uses the rules above. Explicit `workflow.policy=legacy` retains the configured `strictGates`, `reviewCap`, and `finalReviewPolicy` gates. Do not apply any DSMM policy outside active `{{modeName}}` mode or DSMM-managed preset scope.
20
+ - `workflow.policy=risk-based` uses the rules above. Explicit `workflow.policy=legacy` retains the configured `strictGates`, `reviewCap`, and `finalReviewPolicy` gates. Do not apply any Deepwork policy outside active `{{modeName}}` mode or DW-managed preset scope.
21
21
 
22
22
  ## Tool discipline
23
23
 
@@ -27,6 +27,6 @@ Use repository tools for repository-specific claims. Prefer narrow reads and sea
27
27
  - No autonomous Git writes: implementing or fixing does not authorize a commit, and a commit does not authorize pushing, tagging, rebasing, or releasing.
28
28
  - Child tasks inherit the host's authority and depth limits. Delegate only through actually available DSH tools; preset files alone do not prove that a role is callable.
29
29
 
30
- - DSMM safety guards may enforce shell dialect, git-write approval, output-size, plan-format, question-label, and todo-discipline policy inside this mode; treat `[dsmm safety]` messages as binding policy feedback.
30
+ - Deepwork safety guards may enforce shell dialect, git-write approval, output-size, plan-format, question-label, and todo-discipline policy inside this mode; treat `[dsmm safety]` messages as binding policy feedback.
31
31
 
32
32
  </dsmm-deepwork-mode>