@dsmm/dsmm 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/README.md +26 -42
  2. package/cordis.patch.yml +1 -0
  3. package/docs/agent-presets.md +26 -14
  4. package/docs/compatibility.md +20 -79
  5. package/docs/deferred-native-approval-risk.md +8 -12
  6. package/docs/design.md +25 -254
  7. package/docs/lsp.md +2 -2
  8. package/docs/migration-from-ocmm.md +38 -51
  9. package/docs/model-routing.md +21 -21
  10. package/docs/native-permissions.md +17 -7
  11. package/docs/profiles.md +13 -9
  12. package/docs/releasing.md +34 -240
  13. package/docs/roadmap.md +23 -254
  14. package/docs/runtime-recovery.md +29 -91
  15. package/docs/safety-guards.md +19 -16
  16. package/docs/settings-status.md +23 -11
  17. package/docs/skill-sync.md +17 -17
  18. package/docs/web-fetch-fakeip.md +82 -0
  19. package/lib/child-capture.d.ts +16 -2
  20. package/lib/child-capture.js +29 -10
  21. package/lib/client/ChildrenPanel.d.ts +1 -4
  22. package/lib/client/ChildrenPanel.js +4 -16
  23. package/lib/client/DeploymentFields.d.ts +28 -0
  24. package/lib/client/DeploymentFields.js +68 -0
  25. package/lib/client/DeploymentPage.d.ts +17 -5
  26. package/lib/client/DeploymentPage.js +79 -112
  27. package/lib/client/NativeCommandEntries.d.ts +17 -0
  28. package/lib/client/NativeCommandEntries.js +68 -0
  29. package/lib/client/PermissionsPanel.d.ts +1 -1
  30. package/lib/client/PermissionsPanel.js +8 -8
  31. package/lib/client/ProfilesSection.js +7 -5
  32. package/lib/client/RoleToolView-data.d.ts +35 -0
  33. package/lib/client/RoleToolView-data.js +52 -0
  34. package/lib/client/RoleToolView-locales.d.ts +36 -0
  35. package/lib/client/RoleToolView-locales.js +20 -0
  36. package/lib/client/RoleToolView.d.ts +10 -0
  37. package/lib/client/RoleToolView.js +47 -0
  38. package/lib/client/SessionProfiles.js +39 -15
  39. package/lib/client/children-controller.d.ts +2 -8
  40. package/lib/client/children-controller.js +1 -26
  41. package/lib/client/children-locales.d.ts +26 -51
  42. package/lib/client/children-locales.js +8 -12
  43. package/lib/client/configuration-display.d.ts +5 -0
  44. package/lib/client/configuration-display.js +11 -0
  45. package/lib/client/controller.d.ts +1 -0
  46. package/lib/client/controller.js +20 -13
  47. package/lib/client/deployment-controller.d.ts +13 -1
  48. package/lib/client/deployment-controller.js +85 -25
  49. package/lib/client/deployment-data.d.ts +1 -0
  50. package/lib/client/deployment-data.js +4 -1
  51. package/lib/client/deployment-locales.d.ts +43 -0
  52. package/lib/client/deployment-locales.js +35 -9
  53. package/lib/client/deployment-modules.d.ts +9 -0
  54. package/lib/client/deployment-modules.js +24 -0
  55. package/lib/client/deployment-workspace.d.ts +48 -0
  56. package/lib/client/deployment-workspace.js +123 -0
  57. package/lib/client/index.js +11 -74
  58. package/lib/client/locales.d.ts +7 -0
  59. package/lib/client/locales.js +12 -6
  60. package/lib/client/permission-controller.d.ts +1 -0
  61. package/lib/client/permission-controller.js +3 -2
  62. package/lib/client/permission-locales.d.ts +25 -0
  63. package/lib/client/permission-locales.js +24 -4
  64. package/lib/client/session-labels.js +4 -3
  65. package/lib/client/styles.d.ts +1 -1
  66. package/lib/client/styles.js +9 -8
  67. package/lib/client.js +2716 -2364
  68. package/lib/commands.js +2 -0
  69. package/lib/config-file-store.d.ts +3 -0
  70. package/lib/config-file-store.js +4 -2
  71. package/lib/config-revision.d.ts +5 -0
  72. package/lib/config-revision.js +11 -0
  73. package/lib/core-permission-authority.js +11 -41
  74. package/lib/deployment-config.d.ts +9 -2
  75. package/lib/deployment-config.js +35 -8
  76. package/lib/deployment-permission-rules.js +19 -7
  77. package/lib/dsh-types.d.ts +1 -1
  78. package/lib/host-llm-startup.js +3 -3
  79. package/lib/host-llm.d.ts +9 -3
  80. package/lib/host-llm.js +48 -8
  81. package/lib/index.d.ts +17 -21
  82. package/lib/index.js +131 -430
  83. package/lib/lifetime.d.ts +4 -0
  84. package/lib/lifetime.js +22 -0
  85. package/lib/live-pi-ai-owner.d.ts +1 -0
  86. package/lib/live-pi-ai-owner.js +8 -4
  87. package/lib/mode.d.ts +3 -2
  88. package/lib/mode.js +28 -41
  89. package/lib/model-routing.d.ts +2 -8
  90. package/lib/model-routing.js +59 -175
  91. package/lib/native-admission.d.ts +56 -0
  92. package/lib/native-admission.js +313 -0
  93. package/lib/native-pi-ai-wire.d.ts +3 -1
  94. package/lib/native-pi-ai-wire.js +47 -13
  95. package/lib/permission-control.d.ts +0 -3
  96. package/lib/permission-rpc.js +3 -3
  97. package/lib/preset-registry.js +3 -2
  98. package/lib/preset-skills.d.ts +3 -12
  99. package/lib/preset-skills.js +28 -58
  100. package/lib/profile-diagnostics.d.ts +1 -1
  101. package/lib/profile-diagnostics.js +2 -2
  102. package/lib/profile-remote.js +61 -22
  103. package/lib/profile-rpc.d.ts +4 -3
  104. package/lib/profile-rpc.js +39 -41
  105. package/lib/profile-runtime.d.ts +31 -74
  106. package/lib/profile-runtime.js +224 -639
  107. package/lib/profile-store.d.ts +18 -6
  108. package/lib/profile-store.js +106 -64
  109. package/lib/profile-types.d.ts +18 -4
  110. package/lib/profiles.d.ts +3 -1
  111. package/lib/profiles.js +9 -7
  112. package/lib/prompt-content.d.ts +1 -0
  113. package/lib/prompt-content.js +4 -1
  114. package/lib/prompts.d.ts +2 -12
  115. package/lib/prompts.js +11 -66
  116. package/lib/role-control-remote.d.ts +1 -4
  117. package/lib/role-control-remote.js +8 -36
  118. package/lib/role-control-rpc.d.ts +10 -36
  119. package/lib/role-control-rpc.js +112 -265
  120. package/lib/role-control-types.d.ts +3 -26
  121. package/lib/role-control-types.js +3 -4
  122. package/lib/role-identity.d.ts +5 -0
  123. package/lib/role-identity.js +10 -0
  124. package/lib/role-invocation.d.ts +2 -2
  125. package/lib/role-llm-runtime.js +5 -11
  126. package/lib/role-policy.d.ts +19 -53
  127. package/lib/role-policy.js +136 -525
  128. package/lib/role-providers.d.ts +5 -8
  129. package/lib/role-providers.js +20 -126
  130. package/lib/role-routing.d.ts +1 -3
  131. package/lib/role-routing.js +24 -34
  132. package/lib/role-subagents.d.ts +5 -14
  133. package/lib/role-subagents.js +149 -97
  134. package/lib/runtime-integration.d.ts +5 -109
  135. package/lib/runtime-integration.js +11 -779
  136. package/lib/session-metadata.d.ts +13 -12
  137. package/lib/session-metadata.js +6 -31
  138. package/lib/session-scope.js +6 -2
  139. package/lib/settings.d.ts +5 -18
  140. package/lib/settings.js +19 -43
  141. package/lib/state.d.ts +3 -2
  142. package/lib/state.js +26 -10
  143. package/lib/status.d.ts +1 -9
  144. package/lib/status.js +3 -55
  145. package/lib/web-fetch-address-policy.d.ts +24 -0
  146. package/lib/web-fetch-address-policy.js +189 -0
  147. package/lib/web-fetch-fakeip.d.ts +25 -0
  148. package/lib/web-fetch-fakeip.js +107 -0
  149. package/package.json +133 -113
  150. package/docs/research/deepseek-v4-pro.md +0 -74
  151. package/docs/research/oh-dsh.md +0 -96
  152. package/lib/child-admission.d.ts +0 -42
  153. package/lib/child-admission.js +0 -162
  154. package/lib/delivery-authority.d.ts +0 -68
  155. package/lib/delivery-authority.js +0 -260
  156. package/lib/legacy-child-policy.d.ts +0 -51
  157. package/lib/legacy-child-policy.js +0 -123
  158. package/lib/legacy-read-composition.d.ts +0 -20
  159. package/lib/legacy-read-composition.js +0 -144
  160. package/lib/legacy-read-contracts.d.ts +0 -157
  161. package/lib/legacy-read-contracts.js +0 -39
  162. package/lib/legacy-read-host.d.ts +0 -19
  163. package/lib/legacy-read-host.js +0 -67
  164. package/lib/legacy-read-integration.d.ts +0 -121
  165. package/lib/legacy-read-integration.js +0 -522
  166. package/lib/legacy-read-proxy.d.ts +0 -26
  167. package/lib/legacy-read-proxy.js +0 -237
  168. package/lib/native-child-evidence.d.ts +0 -42
  169. package/lib/native-child-evidence.js +0 -133
  170. package/lib/role-runs.d.ts +0 -135
  171. package/lib/role-runs.js +0 -304
  172. package/lib/session-persistence.d.ts +0 -35
  173. package/lib/session-persistence.js +0 -304
  174. package/lib/subagent-runtime.d.ts +0 -45
  175. package/lib/subagent-runtime.js +0 -131
  176. package/prompts/deepseek-flash.md +0 -11
  177. package/prompts/deepseek-v4-pro.md +0 -14
  178. package/scripts/cold-profile-composition.mjs +0 -329
  179. package/scripts/cold-profile-sources.mjs +0 -238
  180. package/scripts/migrate-cold-profile.mjs +0 -315
  181. package/scripts/repair-session-log.mjs +0 -476
  182. package/scripts/session-repair-native-verifier.mjs +0 -367
@@ -1,131 +1,88 @@
1
1
  import type { DshAgent, DshContext } from "./dsh-types.js";
2
- import type { LoadedProfileSelection, LoadedSessionProfileSelection, SessionProfileCommit } from "./profile-store.js";
3
- import type { ProfileReadResult, ProfileSaveRequest, ProfileSelectRequest, ProfileSelectionState, ProfileSnapshot, SessionModeSelectRequest, SessionProfileSelectRequest, SessionProfileSnapshot } from "./profile-types.js";
2
+ import type { LoadedProfileSelection, LoadedSessionProfileSelection, ProfileCommit, SessionProfileCommit } from "./profile-store.js";
3
+ import type { ProfileReadResult, ProfileSaveRequest, ProfileSelectRequest, ProfileSelectionState, ProfileSnapshot, SessionModeSelectRequest, SessionProfileSelectRequest, SessionProfileSnapshot, DeploymentAdmissionView, SubagentRuntimeAdmissionView } from "./profile-types.js";
4
4
  import type { DsmmProfileDocument } from "./profiles.js";
5
- import type { DsmmProfileAdmission, DsmmSettings, DsmmSettingsGetter } from "./settings.js";
5
+ import type { DsmmProfileAdmission, DsmmSettings, DsmmSettingsGetter, DsmmDeploymentSnapshot } from "./settings.js";
6
6
  import { DeepworkModeController } from "./state.js";
7
- import type { DsmmDeploymentSnapshot } from "./settings.js";
8
7
  import type { DsmmMountedPermissionGetter } from "./modules.js";
9
- import type { DeploymentAdmissionView } from "./profile-types.js";
10
- import type { ChildAdmissionCompletion, DsmmChildAdmissionAuthority, LegacyChildEvidenceReader, ParentAdmissionTicket } from "./child-admission-contract.js";
11
- import type { ChildAdmissionCapture, ChildAdmissionEvidence, PreparedChildAdmission } from "./child-capture.js";
12
8
  export interface DsmmProfileRuntimeStore {
13
- createChildAdmission?(capture: ChildAdmissionCapture, assertCurrent?: () => void): Promise<ChildAdmissionCapture>;
14
- readChildAdmission?(childId: string, parentId: string): Promise<ChildAdmissionCapture | null>;
15
- deleteChildAdmission?(childId: string, parentId: string): Promise<void>;
16
9
  readonly readOnly?: boolean;
17
10
  readonly origin?: "central" | "legacy" | "explicit";
18
11
  readonly writeRestriction?: string;
19
12
  loadSelection(): Promise<LoadedProfileSelection>;
20
13
  describe(): Promise<ProfileSnapshot>;
21
14
  read(id: string): Promise<ProfileReadResult>;
22
- save(request: ProfileSaveRequest): Promise<ProfileReadResult>;
23
- select<T>(request: ProfileSelectRequest, validateCandidate: (document: DsmmProfileDocument | null) => T | Promise<T>): Promise<{
15
+ save(request: ProfileSaveRequest, assertCurrent?: () => void): Promise<ProfileReadResult>;
16
+ select<T>(request: ProfileSelectRequest, validate: (document: DsmmProfileDocument | null) => T | Promise<T>, commit?: ProfileCommit<T>, assertCurrent?: () => void): Promise<{
24
17
  selection: ProfileSelectionState;
25
18
  prepared: T;
26
19
  }>;
27
- loadSessionSelection(sessionId: string): Promise<LoadedSessionProfileSelection>;
28
- selectSession<T>(request: SessionProfileSelectRequest, epoch: string, validateCandidate: (document: DsmmProfileDocument | null) => T | Promise<T>, commit: SessionProfileCommit<T>): Promise<{
20
+ loadSessionSelection(id: string): Promise<LoadedSessionProfileSelection>;
21
+ selectSession<T>(request: SessionProfileSelectRequest, epoch: string, validate: (document: DsmmProfileDocument | null) => T | Promise<T>, commit: SessionProfileCommit<T>): Promise<{
29
22
  selection: LoadedSessionProfileSelection;
30
23
  prepared: T;
31
24
  }>;
32
25
  }
33
26
  export interface DsmmProfileRuntimeOptions {
34
- /** Separate Host-owned central sidecars keep legacy profile libraries read-only. */
35
- childCaptureStore?: Pick<DsmmProfileRuntimeStore, "createChildAdmission" | "readChildAdmission" | "deleteChildAdmission">;
36
- childAuthority?: DsmmChildAdmissionAuthority;
37
- /** Exact entry identity bound by the stable Host authority; never wire input. */
38
- childAuthorityOwner?: object;
39
- childAdmission?: ChildAdmissionCompletion;
40
- /** Pure role/ceiling validation before awaited candidate checks and before commit; never publishes identity or authority. */
41
- validateRootRole?: (agent: DshAgent, admission: DsmmProfileAdmission) => void;
42
- /** Host session substrate decides this; resident mode makes no restart claim. */
43
- childCapturePersistence?: "durable" | "resident";
44
- /** Parent composition may enable its bound policy after guards exist, before retained Agents are admitted. */
45
- onAdmissionGuardsInstalled?: (runtime: DsmmProfileRuntime) => void | Promise<void>;
46
- /** Core startup admits roots first; the Host DW continuation completes retained controlled children. */
47
- deferRetainedChildren?: boolean;
48
- /** Trusted test/integration seam, never a wire-supplied path or callback. */
27
+ runtimeView?: () => SubagentRuntimeAdmissionView;
49
28
  validateCandidate?: (settings: DsmmSettings) => void | Promise<void>;
50
29
  modeController?: DeepworkModeController;
51
- /** Awaited once per new ordinary root; never used by children or idle switches. */
52
30
  readDesired?: () => Promise<DsmmDeploymentSnapshot>;
53
31
  startup?: DsmmDeploymentSnapshot;
54
- /** Read the current live Host controller's mounted status; unknown/retired is null. */
55
32
  getMountedPermission?: DsmmMountedPermissionGetter;
56
- /** Frozen actual native startup substrate; omission is the trusted legacy seam. */
57
- subagentCapabilities?: {
58
- backgroundJobs: boolean;
59
- continuable: boolean;
60
- };
61
33
  }
34
+ export type DsmmSessionActionUnavailableReason = import("./profile-types.js").SessionActionUnavailableReason;
35
+ export type DsmmSessionProfileSnapshot = SessionProfileSnapshot;
62
36
  interface AdmittedProfile extends ProfileSelectionState, DsmmProfileAdmission {
63
37
  baseline: DsmmSettings;
64
38
  }
65
- /** Global defaults admit new roots; scoped idle switches replace one root's epoch. */
39
+ /** Configuration transactions and immutable snapshots; native admission owns Agent binding. */
66
40
  export declare class DsmmProfileRuntime {
67
41
  private readonly ctx;
68
42
  private readonly store;
69
43
  private readonly options;
70
- readonly childCaptureStore: Pick<DsmmProfileRuntimeStore, "createChildAdmission" | "readChildAdmission" | "deleteChildAdmission">;
71
44
  readonly getSettings: DsmmSettingsGetter;
72
- private current;
73
- private currentDocument;
74
45
  private readonly baseline;
46
+ private current;
47
+ private document;
75
48
  private readonly bound;
76
- private readonly admitting;
77
- private readonly disposedAgents;
78
- private readonly switching;
79
- private readonly admissionObservers;
49
+ private readonly observations;
80
50
  private disposed;
81
- private selectionQueue;
51
+ private queue;
82
52
  private readonly mode;
83
53
  constructor(ctx: DshContext, baseline: DsmmSettings, store: DsmmProfileRuntimeStore, options?: DsmmProfileRuntimeOptions);
84
54
  initialize(): Promise<void>;
55
+ private assertCurrent;
85
56
  admission(agent?: DshAgent): AdmittedProfile;
86
- /** Host enrollment observes completed exact admissions, never an entered but unpublished policy. */
87
57
  hasAdmission(agent: DshAgent): boolean;
88
- observeAdmissions(observer: (agent: DshAgent) => void | Promise<void>): () => void;
89
- private announceAdmission;
90
- getSession(agent: DshAgent): Promise<SessionProfileSnapshot>;
91
- /** The fourth argument is trusted native caller authority, never wire data. */
92
- selectMode(request: SessionModeSelectRequest, agent: DshAgent, signal?: AbortSignal, assertAuthority?: () => void): Promise<SessionProfileSnapshot>;
93
- selectSession(request: SessionProfileSelectRequest, agent: DshAgent, signal?: AbortSignal, assertAuthority?: () => void): Promise<SessionProfileSnapshot>;
58
+ /** Called only by the awaited native creation owner after all Agent-scoped installation. */
59
+ publish(agent: DshAgent, admission: DsmmProfileAdmission): void;
60
+ release(agent: DshAgent): void;
61
+ prepareRoot(agent: DshAgent, signal: AbortSignal): Promise<AdmittedProfile>;
62
+ getSession(agent: DshAgent): Promise<DsmmSessionProfileSnapshot>;
63
+ selectMode(request: SessionModeSelectRequest, agent: DshAgent, signal?: AbortSignal, authority?: () => void): Promise<DsmmSessionProfileSnapshot>;
64
+ selectSession(_request: SessionProfileSelectRequest, agent: DshAgent, _signal?: AbortSignal, _authority?: () => void): Promise<SessionProfileSnapshot>;
65
+ private assertRoot;
94
66
  describe(): Promise<ProfileSnapshot>;
95
67
  read(id: string): Promise<ProfileReadResult>;
96
- save(request: ProfileSaveRequest): Promise<ProfileReadResult>;
68
+ save(request: ProfileSaveRequest, authority?: () => void): Promise<ProfileReadResult>;
97
69
  getStartupSettings(): DsmmSettings;
98
- /** Preview uses the admission path but neither binds nor creates an Agent. */
99
70
  previewDeployment(desired: DsmmDeploymentSnapshot): DeploymentAdmissionView;
100
71
  describeDeployment(agent?: DshAgent): Promise<{
101
72
  startup: DsmmDeploymentSnapshot | null;
102
73
  desired: DsmmDeploymentSnapshot | null;
103
- admission: DsmmProfileAdmission;
74
+ admission: AdmittedProfile | null;
104
75
  }>;
105
- select(request: ProfileSelectRequest): Promise<ProfileSnapshot>;
76
+ select(request: ProfileSelectRequest, authority?: () => void): Promise<ProfileSnapshot>;
106
77
  private prepare;
107
78
  private profileAdmission;
108
- private declaredProfileModel;
109
- private agents;
110
- private bind;
111
- private owner;
112
- private assertRoot;
113
- /** Host-only awaited completion for fresh, retained and cold exact Agents; no execution occurs here. */
114
- completeAdmission(agent: DshAgent, signal?: AbortSignal, startup?: DsmmDeploymentSnapshot): Promise<DsmmProfileAdmission>;
115
- private admit;
116
- /** Awaited native creation completion: evidence + persistence + role identity + exact-parent authority. */
117
- completeChildAdmission(agent: DshAgent, parent: DshAgent, prepared: PreparedChildAdmission, signal?: AbortSignal): Promise<void>;
118
- /** C's scoped resolver callback: original resident/durable evidence, then explicit trusted legacy folds. */
119
- resolveOriginalChildEvidence(ticket: ParentAdmissionTicket, childId: string, signal: AbortSignal, readLegacy?: LegacyChildEvidenceReader): Promise<ChildAdmissionEvidence>;
120
- private assertOwnedParentTicket;
121
- private subagentRuntimeView;
122
- private assertDeliveryFence;
123
- private assertRootRole;
124
- private validateRootRole;
125
79
  private roleAvailability;
80
+ private editorRoles;
81
+ private sessionActions;
126
82
  private validate;
83
+ private observedSelection;
84
+ private runtimeView;
127
85
  }
128
- /** No guessed home fallback: native deployment context owns this directory. */
129
86
  export declare function createProfileRuntime(ctx: DshContext, baseline: DsmmSettings, options?: DsmmProfileRuntimeOptions): Promise<DsmmProfileRuntime>;
130
87
  export {};
131
88
  //# sourceMappingURL=profile-runtime.d.ts.map