@dsmm/dsmm 0.3.26 → 0.3.28

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 (50) hide show
  1. package/README.md +21 -8
  2. package/docs/agent-presets.md +7 -7
  3. package/docs/agent-teams.md +27 -0
  4. package/docs/compatibility.md +7 -7
  5. package/docs/lsp.md +10 -12
  6. package/docs/maintenance.md +29 -0
  7. package/docs/roadmap.md +25 -9
  8. package/docs/runtime-recovery.md +3 -3
  9. package/docs/testing.md +3 -1
  10. package/dsh-plugin.json +1 -1
  11. package/lib/client/NativeToolView-data.d.ts +8 -0
  12. package/lib/client/NativeToolView-data.js +19 -0
  13. package/lib/client/NativeToolView.d.ts +19 -0
  14. package/lib/client/NativeToolView.js +46 -0
  15. package/lib/client/RoleToolView-data.js +1 -1
  16. package/lib/client/RoleToolView-locales.d.ts +7 -0
  17. package/lib/client/RoleToolView-locales.js +6 -0
  18. package/lib/client/RoleToolView.js +2 -0
  19. package/lib/client/SessionProfiles.js +1 -1
  20. package/lib/client/children-locales.d.ts +4 -4
  21. package/lib/client/controller.js +20 -0
  22. package/lib/client/locales.d.ts +1 -0
  23. package/lib/client/locales.js +2 -0
  24. package/lib/client.js +350 -187
  25. package/lib/core-permission-authority.js +14 -4
  26. package/lib/mode.js +2 -2
  27. package/lib/native-admission.d.ts +5 -3
  28. package/lib/native-admission.js +218 -77
  29. package/lib/native-ownership.d.ts +3 -0
  30. package/lib/native-ownership.js +19 -0
  31. package/lib/native-subagents.d.ts +2 -1
  32. package/lib/native-subagents.js +4 -3
  33. package/lib/profile-runtime.d.ts +1 -1
  34. package/lib/prompts.d.ts +2 -0
  35. package/lib/prompts.js +14 -8
  36. package/lib/role-control-remote.js +19 -8
  37. package/lib/role-control-rpc.js +1 -1
  38. package/lib/role-control-types.d.ts +18 -5
  39. package/lib/role-identity.js +3 -19
  40. package/lib/role-invocation.d.ts +1 -1
  41. package/lib/role-policy.d.ts +11 -3
  42. package/lib/role-policy.js +61 -21
  43. package/lib/role-subagents.js +12 -5
  44. package/lib/session-metadata.d.ts +27 -1
  45. package/lib/session-metadata.js +46 -0
  46. package/lib/session-scope.d.ts +1 -1
  47. package/lib/session-scope.js +2 -2
  48. package/package.json +3 -1
  49. package/prompts/source/deepwork/general.md +19 -0
  50. package/prompts/source/shared/native-teams.md +11 -0
@@ -1,4 +1,9 @@
1
1
  import { appendPluginRecord, pluginRecordOf } from "@deepseek-ai/dsh-session";
2
+ import { SubagentError } from "@deepseek-ai/dsh-subagent";
3
+ import { isDeepStrictEqual } from "node:util";
4
+ import { isDsmmRoleId } from "./roles.js";
5
+ import { childOwnedSessionEvents } from "./session-scope.js";
6
+ import { validateProfileId } from "./profiles.js";
2
7
  /** Model-hidden observations use the official ignorable record boundary, never authorization. */
3
8
  export function appendModeRecord(session, active) {
4
9
  appendPluginRecord(session, "plugin:dsmm/mode", { active });
@@ -23,6 +28,47 @@ export function readModelSelectionRecord(event) {
23
28
  return { version, source, selectionSeq, route: { provider: route.provider, model: route.model,
24
29
  ...(route.reasoningEffort === undefined ? {} : { reasoningEffort: route.reasoningEffort }) }, recordSeq: Number(record.seq) };
25
30
  }
31
+ export function appendDelegationCeiling(session, data) {
32
+ appendPluginRecord(session, "plugin:dsmm/delegation-ceiling", data);
33
+ }
34
+ /** Only the child's own suffix can restrict a cold admission; fork seeds carry no identity. */
35
+ export function readDelegationCeiling(session) {
36
+ let ceiling;
37
+ for (const event of childOwnedSessionEvents(session)) {
38
+ const record = pluginRecordOf(event);
39
+ if (record?.type !== "plugin:dsmm/delegation-ceiling")
40
+ continue;
41
+ const data = record.data;
42
+ const invalid = () => { throw new SubagentError("Invalid or conflicting delegation ceiling", "UNAUTHORIZED"); };
43
+ if (!isRecord(data))
44
+ invalid();
45
+ const row = data;
46
+ const fields = ["version", "childId", "creatorId", "rootId", "provider", "role", "level", "profileId", "readOnly", "allow", "deny", "targets", "maxDepth"];
47
+ const text = (value) => typeof value === "string" && value.length > 0;
48
+ const names = (value) => Array.isArray(value) && value.every(text) && new Set(value).size === value.length;
49
+ if (Object.keys(row).length !== fields.length || fields.some(key => !Object.hasOwn(row, key))
50
+ || row.version !== 1 || !text(row.childId) || !text(row.creatorId) || !text(row.rootId) || !text(row.provider)
51
+ || row.childId === row.creatorId || row.childId === row.rootId
52
+ || (row.role === null ? row.level !== null : !isDsmmRoleId(row.role) || !["normal", "low", "high", "max"].includes(String(row.level)))
53
+ || typeof row.readOnly !== "boolean"
54
+ || row.allow !== null && !names(row.allow) || !names(row.deny) || !names(row.targets) || !row.targets.every(isDsmmRoleId)
55
+ || row.maxDepth !== null && (typeof row.maxDepth !== "number" || !Number.isSafeInteger(row.maxDepth) || row.maxDepth < 0))
56
+ invalid();
57
+ if (row.profileId !== null) {
58
+ try {
59
+ validateProfileId(row.profileId);
60
+ }
61
+ catch {
62
+ invalid();
63
+ }
64
+ }
65
+ const current = row;
66
+ if (ceiling !== undefined && !isDeepStrictEqual(ceiling, current))
67
+ invalid();
68
+ ceiling = current;
69
+ }
70
+ return ceiling;
71
+ }
26
72
  function isRecord(value) {
27
73
  return typeof value === "object" && value !== null && !Array.isArray(value);
28
74
  }
@@ -5,5 +5,5 @@ export declare function sessionEvents(session: DshSession | undefined): readonly
5
5
  export declare function resolveSelectedAgentPreset(session: DshSession | undefined): string | undefined;
6
6
  export declare function childOwnedSessionEvents(session: DshSession): readonly DshSessionEvent[];
7
7
  /** Parent preset/persona inheritance is deliberately not delegated role authority. */
8
- export declare function resolveEffectiveDsmmRole(agent: DshAgent, settings: DsmmSettings, modeActive: boolean): DsmmRoleId | undefined;
8
+ export declare function resolveEffectiveDsmmRole(agent: DshAgent, settings: DsmmSettings, _modeActive: boolean): DsmmRoleId | undefined;
9
9
  //# sourceMappingURL=session-scope.d.ts.map
@@ -26,7 +26,7 @@ export function childOwnedSessionEvents(session) {
26
26
  return sessionEvents(session).slice(inherited);
27
27
  }
28
28
  /** Parent preset/persona inheritance is deliberately not delegated role authority. */
29
- export function resolveEffectiveDsmmRole(agent, settings, modeActive) {
29
+ export function resolveEffectiveDsmmRole(agent, settings, _modeActive) {
30
30
  if (!settings.modules.deepwork.enabled)
31
31
  return undefined;
32
32
  let role;
@@ -39,7 +39,7 @@ export function resolveEffectiveDsmmRole(agent, settings, modeActive) {
39
39
  }
40
40
  else {
41
41
  const preset = resolveSelectedAgentPreset(agent.session);
42
- role = isDsmmRoleId(preset) ? preset : modeActive ? "dsmm-orchestrator" : undefined;
42
+ role = isDsmmRoleId(preset) ? preset : undefined;
43
43
  }
44
44
  return role !== undefined && settings.roles[role] ? role : undefined;
45
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsmm/dsmm",
3
- "version": "0.3.26",
3
+ "version": "0.3.28",
4
4
  "description": "Native Deepwork roles, routing, profiles, and permission controls for DeepSeek Harness.",
5
5
  "author": "Hugefiver",
6
6
  "license": "LicenseRef-AAAPL",
@@ -88,6 +88,7 @@
88
88
  "locale/*.json",
89
89
  "agent-presets",
90
90
  "docs/agent-presets.md",
91
+ "docs/agent-teams.md",
91
92
  "docs/compatibility.md",
92
93
  "docs/design.md",
93
94
  "docs/deferred-native-approval-risk.md",
@@ -107,6 +108,7 @@
107
108
  "patches",
108
109
  "prompts",
109
110
  "skills",
111
+ "!skills/**/__pycache__/**",
110
112
  "cordis.patch.yml",
111
113
  "dsh-plugin.json",
112
114
  "LICENSE",
@@ -0,0 +1,19 @@
1
+ <dsmm-deepwork-mode>
2
+ Use this guidance only while the `{{modeName}}` mode is effectively active. Keep the selected native identity, persona, model and reasoning effort. Deepwork supplies general working guidance and on-demand skills; it does not select a DSMM role or change tool permissions.
3
+
4
+ ## Understand and deliver the requested outcome
5
+
6
+ Read the supplied context and directly relevant project evidence before deciding how to proceed. Answer explanation and investigation requests without editing. For authorized changes, implement the complete requested outcome within the stated scope, following existing local patterns. Ask only when a missing decision materially changes scope, acceptance, security, data, public interfaces, permissions or irreversible actions.
7
+
8
+ Use a lightweight plan for bounded work and a substantive plan when complexity or concrete risk warrants it. Load matching skills from the actual native skill catalog when their triggers apply; load `brainstorming` for material uncertainty or design and `writing-plans` for complex implementation or an explicit planning request. Skill bodies are lazy resources, not automatically injected instructions. The native persona and current user request remain authoritative for workflow and delegation. When a skill describes unavailable specialists, perform the corresponding planning or review directly within the native persona's authority, without inventing DSMM delegation tools, and refuse actions that exceed permission boundaries.
9
+
10
+ ## Native tools and delegation
11
+
12
+ Use the tools and delegation targets actually exposed by the Host, following their schemas, ownership and continuation contracts. Delegate a useful bounded independent outcome when permitted; pass its goal, constraints and acceptance criteria, and inspect its result before dependent work. Keep native subagent creation, execution, completion and cancellation with the Host. Deepwork activation creates no specialist roles, required role calls or additional delegation authority.
13
+
14
+ ## Scope and verification
15
+
16
+ Make the smallest change that fully satisfies the request. Avoid speculative abstractions, redundant defenses, unrelated cleanup and tests that prove no required behavior. Preserve valid safety and input-handling coverage. Match checks to the affected behavior and interfaces, exercise the real user-facing surface where applicable, and reuse still-relevant passing evidence. Report failures and missing coverage honestly. Stop when the requested outcome and useful evidence are complete.
17
+
18
+ Treat `[dsmm safety]` messages as binding feedback. Git writes need specific authorization: implementation does not authorize a commit, and a commit does not authorize push, tag, rebase or release. State delivered results, verification and remaining risks directly.
19
+ </dsmm-deepwork-mode>
@@ -0,0 +1,11 @@
1
+ ## Native Agent Teams
2
+
3
+ The native root owns Team mode and reassignment. Use only the Team tools admitted for this step; do not enable Team mode automatically or recreate the task board, scheduler, inbox, or completion delivery.
4
+
5
+ Read the latest task before acting. Claim only an unowned, ready `pending` task, using its current revision. Root reassignment already makes a task `in_progress`: its assignee reads it and performs the work without claiming it again. Writable owners complete their work with the current revision. On a revision conflict, reread the task before deciding the next action.
6
+
7
+ Readonly members may inspect tasks with the exposed list/get tools. They report results or requested changes to the root, which creates, assigns, updates, and completes tasks for them. Task ownership, task text, Team mode, and `writeScopes` do not expand role, tool, filesystem, delegation, or depth permissions. Write scopes are advisory coordination, not locks or authorization.
8
+
9
+ Task mutations do not wake members or add inbox input. Use native `send_message` explicitly when another member needs to act. Interrupting a member does not release its task ownership; the root handles reassignment when needed.
10
+
11
+ `TEAM_TASK_PERSISTENCE_UNCONFIRMED` means a mutation may already be visible without confirmed durability. Read the current task state before deciding what to do; never automatically replay the mutation. Native services remain the authority for task state and persistence.