@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
package/lib/index.js CHANGED
@@ -4,476 +4,177 @@ import { registerSafetyGuards } from "./guards.js";
4
4
  import { registerDeepworkPrompt } from "./mode.js";
5
5
  import { registerAgentSkills } from "./preset-skills.js";
6
6
  import { registerModelRouting } from "./model-routing.js";
7
- import { registerRuntimeRecovery } from "./runtime-recovery.js";
8
- import { reconcileRolePresets, resolveManagedPresetRoot } from "./preset-materializer.js";
9
7
  import { registerHeadlessRoleTools, registerNativeSubagentControls } from "./role-subagents.js";
10
8
  import { registerRolePresets } from "./preset-registry.js";
11
9
  import { registerRoleProviders } from "./role-providers.js";
12
10
  import { DsmmRolePolicy } from "./role-policy.js";
13
- import { registerLspRuntime } from "./lsp.js";
14
11
  import { createProfileRuntime } from "./profile-runtime.js";
15
12
  import { DsmmProfilesHost, registerConfigRpc } from "./profile-rpc.js";
16
- import { DSMM_CONFIG_SCHEMA, DSMM_NATIVE_CONFIG_SCHEMA, registerSettings } from "./settings.js";
17
- import { DeepworkModeController, isDeepworkActive } from "./state.js";
18
- import DsmmSessionPersistence from "./session-persistence.js";
19
- import { isAbsolute } from "node:path";
20
- import { createHash, randomUUID } from "node:crypto";
21
- import { DsmmProfileError } from "./profiles.js";
13
+ import { DSMM_CONFIG_SCHEMA, DSMM_NATIVE_CONFIG_SCHEMA } from "./settings.js";
14
+ import { DeepworkModeController } from "./state.js";
22
15
  import { DsmmDeploymentConfig } from "./deployment-config.js";
23
- import { agentForScope } from "./native-scope.js";
24
- import { resolveSelectedAgentPreset, sessionEvents } from "./session-scope.js";
25
- import { projectDsmmModules } from "./modules.js";
26
- import { scopeLifetime } from "./delivery-authority.js";
27
- import { admittedAgentContext, classifyDsmmAgent, integrateSubagentRuntime, managedAgentContext, publicProfileRuntime, registerRoleControlContribution, registerRuntimeGuidance, runtimeAdmissionView } from "./runtime-integration.js";
28
- import { LegacyReadUnavailable } from "./legacy-read-contracts.js";
16
+ import { NativeAdmission } from "./native-admission.js";
17
+ import { scopeLifetime } from "./lifetime.js";
18
+ import { runtimeAdmissionView, assertSupportedHostStartup } from "./runtime-integration.js";
29
19
  import { createCorePermissionAuthority } from "./core-permission-authority.js";
30
- import { nativeStandingFullAccess } from "./permission-native-access.js";
31
20
  import { installCorePermissions } from "./core-permissions.js";
21
+ import { registerRoleControlRpc } from "./role-control-rpc.js";
22
+ import { nativeStandingFullAccess } from "./permission-native-access.js";
23
+ import { DsmmProfileError } from "./profiles.js";
24
+ import { registerLspRuntime } from "./lsp.js";
32
25
  export const name = "dsmm";
33
26
  export const inject = ["profileContext", "agents"];
34
- // Direct public Config calls keep the complete plain flat ABI. Native Cordis
35
- // consumes the same object's Standard Schema protocol for sparse volatile refs.
36
- export const Config = new Proxy(DSMM_NATIVE_CONFIG_SCHEMA, {
37
- apply(_target, _receiver, args) { return DSMM_CONFIG_SCHEMA(args[0] ?? {}); }
38
- });
27
+ export const Config = new Proxy(DSMM_NATIVE_CONFIG_SCHEMA, { apply(_target, _receiver, args) { return DSMM_CONFIG_SCHEMA(args[0] ?? {}); } });
39
28
  export { DSMM_ROLE_IDS, DSMM_ROLES, isDsmmRoleId, renderAgentCordis, renderPresetMetadata } from "./roles.js";
40
29
  export { DSMM_MANAGED_PRESET_MARKER, materializeRolePresets, reconcileRolePresets, resolveManagedPresetRoot } from "./preset-materializer.js";
41
30
  export { DSMM_GUARD_PREFIX, decidePostToolExecution, decidePreToolExecution, isSafetyScopeActive, registerSafetyGuards, truncateTextMiddle } from "./guards.js";
42
31
  export { DEFAULT_DSMM_LSP_SETTINGS, DSMM_LSP_SERVER_NAME, DSMM_LSP_TOOL_NAMES, parseLspSmokeCommand, publicLspToolName, renderLspMcpPatch, resolveLspSettings, toDshMcpClientConfig } from "./lsp.js";
43
32
  export { classifyModelFamily } from "./model-family.js";
44
- export { desiredDeepseekEffort, isDeepseekV4ProRoute, registerModelRouting, selectAdvertisedEffort } from "./model-routing.js";
45
- export { classifyRecoveryFailure, foldAttemptedRecoveryRoutes, foldDurableRecoveryWork, selectFallbackRoute } from "./recovery-policy.js";
46
- export { registerRuntimeRecovery } from "./runtime-recovery.js";
33
+ export { registerModelRouting } from "./model-routing.js";
47
34
  export { childOwnedSessionEvents, resolveEffectiveDsmmRole, resolveSelectedAgentPreset } from "./session-scope.js";
48
35
  export { roleFromProviderName, roleProviderName, registerRoleProviders } from "./role-providers.js";
49
36
  export { effectiveRoleFallbackRoutes } from "./role-routing.js";
50
37
  export { DSMM_STATUS_COMMAND, registerDsmmStatusCommand } from "./commands.js";
51
38
  export { DSMM_STATUS_VERSION, createDsmmStatusSnapshot, formatDsmmStatus } from "./status.js";
52
- export { DSMM_SKILL_NAMES, DEFAULT_DSMM_SETTINGS, MVP_SKILL_NAMES, isRoleEnabled, resolveConfig, resolveRoleRouting, registerSettings } from "./settings.js";
39
+ export { DSMM_SKILL_NAMES, DSMM_SETTINGS_SCHEMA, DEFAULT_DSMM_SETTINGS, MVP_SKILL_NAMES, deploymentEditorSchema, isRoleEnabled, resolveConfig, resolveDeployment, resolveRoleRouting, registerSettings, validateNativeConfig } from "./settings.js";
53
40
  export { createProfileRuntime, DsmmProfileRuntime } from "./profile-runtime.js";
54
41
  export { resolveDshHome } from "./dsh-home.js";
55
42
  export { DsmmDeploymentConfig, parseGlobalConfig, editGlobalConfig } from "./deployment-config.js";
56
43
  export { DSMM_MODULE_DESCRIPTORS, deepworkEnabled, projectDeepworkModule } from "./modules.js";
57
44
  export { DEEPWORK_MODE_EVENT, DeepworkModeController, hasOpenTurn, isDeepworkActive } from "./state.js";
58
45
  export { DsmmNativeLlmRuntime } from "./llm-runtime.js";
59
- /** Experimental Host collaborators are programmatic only; serialized settings cannot authenticate them. */
46
+ export { registerRuntimeRecovery } from "./runtime-recovery.js";
47
+ export { classifyRecoveryFailure, foldAttemptedRecoveryRoutes, foldDurableRecoveryWork, selectFallbackRoute } from "./recovery-policy.js";
60
48
  export function createDsmmHostPlugin(startup) {
61
- if (startup.experimentalLegacyRead !== undefined) {
62
- const host = startup.experimentalLegacyRead.startup;
63
- if (host === null || typeof host !== "object" || [host.captureClosedComposition, host.resolveReadBindings, host.acquireCallContext,
64
- host.reportAuditFault, host.reportRetirementFault, host.revoke].some(callback => typeof callback !== "function"))
65
- throw new DsmmProfileError("unavailable", "Legacy read startup requires actual Host composition, FS, turn and audit collaborators.");
66
- }
67
- return { name, Config, inject: startup.experimentalLegacyRead === undefined ? inject : [...inject, "subagents"],
68
- apply(ctx, config = {}) { return apply(ctx, config, startup); } };
49
+ assertSupportedHostStartup(startup);
50
+ return { name, Config, inject, apply(ctx, config = {}) { return apply(ctx, config, startup); } };
69
51
  }
70
- export function apply(ctx, config = {}, hostStartup = {}) {
71
- if (!Context.is(ctx)) {
72
- if (hostStartup.experimentalLegacyRead !== undefined)
73
- throw new DsmmProfileError("unavailable", "Legacy read requires a real cold native Host.");
74
- return applyConfigured(ctx, config, undefined, undefined, hostStartup);
75
- }
76
- if (hostStartup.experimentalLegacyRead !== undefined && (ctx.get("dsmmProfileRuntime") !== undefined || runtimeAdmissionView(ctx).deliveryFenceReady))
77
- throw new LegacyReadUnavailable("lifetime-unavailable");
52
+ export async function apply(input, config = {}, startupOptions = {}) {
53
+ assertSupportedHostStartup(startupOptions);
54
+ if (!Context.is(input))
55
+ throw new Error("DSMM requires the native Cordis Host");
56
+ const ctx = input;
78
57
  const deployment = new DsmmDeploymentConfig(ctx, config);
79
- return deployment.readDesired().then((startup) => applyConfigured(ctx, config, deployment, startup, hostStartup));
80
- }
81
- function applyConfigured(ctx, config, deployment, startup, hostStartup = {}) {
82
- // Volatile desired saves retain live realms. An ordinary Loader remount must
83
- // not replace already-admitted Agent policy/skill realms, including busy Agents.
84
- if (Context.is(ctx) && ctx.fiber.entry !== undefined) {
85
- const native = ctx;
86
- const owner = ctx.fiber.entry;
87
- native.on("loader/patch-context", (entry, next) => {
88
- if (entry === owner && (native.get("agents")?.list().length ?? 0) > 0) {
89
- throw new Error("dsmm deployment Config requires restart while Agents are admitted; runtime mode/profile changes use idle maintenance instead");
90
- }
91
- next();
92
- }, { global: true });
93
- }
94
- const storage = config.sessionPersistence;
95
- if (storage !== undefined) {
96
- if (storage === null || typeof storage !== "object" || typeof storage.root !== "string" || !isAbsolute(storage.root)
97
- || Object.keys(storage).some((key) => !["root", "compression"].includes(key))
98
- || storage.compression !== undefined && !["zstd", "none"].includes(storage.compression)) {
99
- throw new Error("Deepwork sessionPersistence must preserve an explicit absolute native root and compression");
100
- }
101
- if (!Context.is(ctx))
102
- throw new Error("Deepwork sessionPersistence requires a native Cordis Context");
103
- const native = ctx;
104
- if (native.get("sessionPersistence") !== undefined)
105
- throw new Error("Disable the exact existing JSONL entry at startup before enabling Deepwork sessionPersistence; live replacement is refused");
106
- const fiber = native.plugin(DsmmSessionPersistence, storage);
107
- return fiber.await().then(() => applyRuntime(ctx, config, deployment, startup, hostStartup));
108
- }
109
- return applyRuntime(ctx, config, deployment, startup, hostStartup);
110
- }
111
- function applyRuntime(ctx, config, deployment, startup, hostStartup = {}) {
112
- const native = Context.is(ctx) ? ctx : undefined;
113
58
  const lifetime = new AbortController();
114
- if (native !== undefined)
115
- scopeLifetime(native, "dsmm: revoke Core startup and admission", () => lifetime.abort());
59
+ scopeLifetime(ctx, "dsmm: retire Core", () => lifetime.abort());
60
+ // Install a startup execution fence before asynchronous configuration reads.
61
+ let admission;
62
+ const assert = (agent) => { lifetime.signal.throwIfAborted(); if (!admission)
63
+ throw new Error("DSMM initialization is incomplete"); return admission.assert(agent); };
64
+ ctx.on("agent/created", () => { lifetime.signal.throwIfAborted(); if (!admission?.isReady)
65
+ throw new Error("DSMM initialization is incomplete"); }, { global: true, prepend: true });
66
+ ctx.on("agent/pre-step", async (frame, next) => { await admission?.ensure(frame.agent); assert(frame.agent); return next(); }, { global: true, prepend: true });
67
+ ctx.on("agent/request", async (frame, next) => { await admission?.ensure(frame.agent); assert(frame.agent); return next(); }, { global: true, prepend: true });
68
+ ctx.on("tools/pre-execute", async (exec, next) => { if (exec.agent) {
69
+ await admission?.ensure(exec.agent);
70
+ assert(exec.agent);
71
+ } return next(); }, { global: true, prepend: true });
72
+ const startup = await deployment.readDesired();
73
+ lifetime.signal.throwIfAborted();
74
+ const getSettings = agent => agent === undefined ? startup.settings : admission.configuration(agent).settings;
75
+ getSettings.admission = agent => agent === undefined ? profiles.admission() : admission.configuration(agent);
76
+ getSettings.subagentRuntime = () => runtimeAdmissionView(ctx);
77
+ const controller = new DeepworkModeController(ctx, agent => getSettings(agent).modules.deepwork.enabled, () => admission?.isReady === true && ctx.get("subagents") !== undefined && ctx.get("agentPresets") !== undefined);
78
+ const policy = new DsmmRolePolicy(ctx, getSettings, controller);
116
79
  let permissionOwner;
117
- const getMountedPermission = () => {
118
- if (native === undefined || lifetime.signal.aborted)
119
- return null;
120
- const current = native.get("dsmmPermissionController");
121
- if (current === undefined || (Reflect.get(current, symbols.original) ?? current) !== permissionOwner)
80
+ const mountedPermission = () => {
81
+ if (lifetime.signal.aborted)
122
82
  return null;
123
- return current?.rules.status().mounted ?? null;
124
- };
125
- let rootAdmissionsInitialized = false;
126
- const completedRootAdmissions = new WeakSet();
127
- let rolePolicy;
128
- const controlledParent = (agent) => {
129
- if (classifyDsmmAgent(agent) === "dsmm")
130
- return true;
131
- if (agent.session.header?.origin === "subagent")
132
- return false;
133
- // A pending parent admission cannot establish native-child eligibility.
134
- if (!rootAdmissionsInitialized && !completedRootAdmissions.has(agent))
135
- return true;
136
- const settings = getBoundSettings(agent);
137
- return settings.modules.deepwork.enabled && isDeepworkActive(sessionEvents(agent.session), settings.defaultActive, resolveSelectedAgentPreset(agent.session));
138
- };
139
- if (native !== undefined) {
140
- ctx = managedAgentContext(native, controlledParent);
141
- }
142
- const validatingRootModule = new WeakMap();
143
- const controller = new DeepworkModeController(ctx, (agent) => validatingRootModule.get(agent) ?? getBoundSettings(agent).modules.deepwork.enabled);
144
- let runtime;
145
- let profileInitialization;
146
- let requiresNativeProfiles = ctx.get !== undefined;
147
- const requireProfileAdmission = (agent) => {
148
- if (agent !== undefined && requiresNativeProfiles && runtime === undefined) {
149
- throw new DsmmProfileError("unavailable", "Native Deepwork profile admission is not ready. No provider request or tool work is allowed.");
150
- }
151
- };
152
- const getBoundSettings = (agent) => {
153
- requireProfileAdmission(agent);
154
- return runtime?.getSettings(agent) ?? getSettings();
83
+ const current = ctx.get("dsmmPermissionController");
84
+ return current && (Reflect.get(current, symbols.original) ?? current) === permissionOwner ? current.rules.status().mounted : null;
155
85
  };
156
- const deploymentAdmissions = new WeakMap();
157
- getBoundSettings.admission = (agent) => {
158
- requireProfileAdmission(agent);
159
- const nativeAdmission = runtime?.getSettings.admission?.(agent);
160
- if (nativeAdmission !== undefined)
161
- return nativeAdmission;
162
- const settings = getSettings();
163
- let admission = deploymentAdmissions.get(settings);
164
- if (admission === undefined) {
165
- admission = Object.freeze({ settings, profile: null, scope: "deployment-baseline", epoch: createHash("sha256").update(randomUUID()).digest("hex") });
166
- deploymentAdmissions.set(settings, admission);
167
- }
168
- return admission;
169
- };
170
- getBoundSettings.moduleStates = (agent) => {
171
- requireProfileAdmission(agent);
172
- return runtime?.getSettings.moduleStates?.(agent) ?? projectDsmmModules(getSettings(), startup, getBoundSettings.admission(agent), false, getMountedPermission);
173
- };
174
- getBoundSettings.subagentRuntime = () => native === undefined
175
- ? { binding: "unavailable", deliveryFenceReady: false, restartRequired: true, reason: "explicit-composition-required" }
176
- : runtimeAdmissionView(native);
177
- rolePolicy = new DsmmRolePolicy(ctx, getBoundSettings, controller);
178
- const assertDwDelivery = (agent) => {
179
- if (rolePolicy.identity(agent).role === undefined)
180
- return;
181
- const integration = native?.get("dsmmRuntimeIntegration");
182
- if (integration === undefined || !integration.runtime.authority.view().deliveryFenceReady)
183
- throw new DsmmProfileError("unavailable", "Deepwork execution requires its live delivery fence.");
184
- return integration.bridge.authority.acquireParentTicket(agent);
185
- };
186
- const getSettings = registerSettings(ctx, config, {
187
- ...(startup === undefined ? {} : { resolved: startup.settings }),
188
- install(readyCtx, getReadySettings) {
189
- const startupMounted = getReadySettings().modules.deepwork.enabled;
190
- // The global editor belongs to core, not profile/DW installation success.
191
- if (deployment !== undefined) {
192
- readyCtx.provide?.("dsmmDeploymentConfig", deployment);
193
- readyCtx.inject?.(["typert"], (rpcCtx) => {
194
- registerConfigRpc(rpcCtx, deployment, getReadySettings(), () => runtime, startup?.sources, getMountedPermission);
195
- });
196
- }
197
- const install = (installCtx, settingsGetter) => {
198
- if (startupMounted) {
199
- registerDeepworkPrompt(installCtx, controller, settingsGetter, { section: startup === undefined ? config.section : startup.profile.section ?? startup.global.section });
200
- registerAgentSkills(installCtx, controller, settingsGetter);
201
- }
202
- const installCommands = (commandCtx) => {
203
- if (startupMounted)
204
- registerDeepworkCommand(commandCtx, controller, settingsGetter);
205
- // Status projects live substrate readiness without replacing the exact
206
- // immutable admission reference used by authority and providers.
207
- const statusSettings = Object.assign(((agent) => settingsGetter(agent)), settingsGetter);
208
- statusSettings.admission = agent => ({ ...getBoundSettings.admission(agent), subagentRuntime: getBoundSettings.subagentRuntime() });
209
- registerDsmmStatusCommand(commandCtx, controller, statusSettings);
210
- };
211
- if (installCtx.get !== undefined && installCtx.inject !== undefined)
212
- installCtx.inject(["commands"], installCommands);
213
- else
214
- installCommands(installCtx);
215
- if (!startupMounted)
86
+ const profiles = await createProfileRuntime(ctx, startup.settings, { startup, readDesired: () => deployment.readDesired(), modeController: controller,
87
+ runtimeView: () => runtimeAdmissionView(ctx), getMountedPermission: mountedPermission });
88
+ lifetime.signal.throwIfAborted();
89
+ admission = new NativeAdmission(ctx, profiles, policy);
90
+ ctx.provide("dsmmNativeAdmission", admission);
91
+ ctx.provide("dsmmProfileRuntime", profiles);
92
+ ctx.provide("dsmmDeploymentConfig", deployment);
93
+ ctx.provide("dsmmCoreLlmOwner", { async admit(frame) {
94
+ const captured = assert(frame.agent), full = nativeStandingFullAccess(ctx, frame.agent);
95
+ const permissions = ctx.get("dsmmPermissionController");
96
+ if (!full && captured.settings.permissionControl.enabled && permissions === undefined)
97
+ throw new DsmmProfileError("unavailable", "Core permission authority is not ready.");
98
+ if (!full)
99
+ await permissions?.rules.refresh();
100
+ const permissionIdentity = permissions === undefined ? undefined : Reflect.get(permissions, symbols.original) ?? permissions;
101
+ const permissionRevision = full ? undefined : permissions?.rules.getPolicy().revision;
102
+ const permissionSignal = full ? undefined : permissions?.rules.signal;
103
+ const signal = AbortSignal.any([frame.signal, lifetime.signal, ...permissionSignal === undefined ? [] : [permissionSignal]]);
104
+ const assertCurrent = () => {
105
+ signal.throwIfAborted();
106
+ if (assert(frame.agent) !== captured)
107
+ throw new DsmmProfileError("not-owned", "Native admission changed.");
108
+ if (full)
216
109
  return;
217
- // Standing compositions are deployment-only and never replaced on a
218
- // runtime profile selection. All routes are read from Agent bindings.
219
- const settings = getReadySettings();
220
- const root = resolveManagedPresetRoot(settings, deployment === undefined ? process.env : { ...process.env, DSH_HOME: deployment.home });
221
- if (root !== undefined)
222
- reconcileRolePresets({ root, settings });
223
- };
224
- if (readyCtx.get === undefined) {
225
- registerRolePresets(readyCtx, getReadySettings);
226
- install(readyCtx, getReadySettings);
227
- if (startupMounted)
228
- registerRoleProviders(readyCtx, getReadySettings, getReadySettings, rolePolicy);
229
- return;
230
- }
231
- requiresNativeProfiles = true;
232
- const installProfiles = async (profileCtx) => {
233
- if (native === undefined)
234
- throw new Error("dsmm native profiles require the actual Cordis Host scope");
235
- const hostCtx = profileCtx;
236
- profileCtx = managedAgentContext(hostCtx, controlledParent);
237
- if (startupMounted) {
238
- await registerLspRuntime(profileCtx, { ...getReadySettings().lsp, enabled: false }, getBoundSettings);
239
- }
240
- // Standing definitions must exist before initialize audits retained
241
- // Agents. A missing optional registry still installs later from this
242
- // same frozen startup getter, without blocking unrelated Hosts.
243
- const presets = registerRolePresets(profileCtx, getReadySettings);
244
- if (profileCtx.get?.("agentPresets") !== undefined)
245
- await presets;
246
- const integration = await integrateSubagentRuntime(hostCtx, getReadySettings(), rolePolicy, () => runtime, hostStartup);
247
- lifetime.signal.throwIfAborted();
248
- if (hostStartup.experimentalLegacyRead !== undefined && integration === undefined)
249
- throw new DsmmProfileError("unavailable", "Legacy read requires the explicit cold DSMM runtime composition.");
250
- if (startupMounted && hostCtx.get("subagents") !== undefined) {
251
- // The actual registry exists now. Alias registration is synchronous and
252
- // does not wait on a policy-ready provider, avoiding a startup cycle.
253
- registerRoleProviders({ get: hostCtx.get.bind(hostCtx), effect: callback => hostCtx.effect(() => callback() ?? (() => { })) }, getBoundSettings, getReadySettings, rolePolicy);
254
- }
255
- const retainedChildren = profileCtx.get("agents").list().filter(agent => agent.session.header?.origin === "subagent");
256
- const manager = await createProfileRuntime(profileCtx, getReadySettings(), { modeController: controller,
257
- getMountedPermission, deferRetainedChildren: integration !== undefined,
258
- ...(startup === undefined ? {} : { startup }), ...(deployment === undefined ? {} : { readDesired: () => deployment.readDesired() }),
259
- ...(integration === undefined ? {} : { childAuthority: integration.bridge.authority, childAuthorityOwner: integration.owner,
260
- childAdmission: integration.bridge.childAdmission, childCapturePersistence: hostCtx.get("sessionPersistence") === undefined ? "resident" : "durable" }),
261
- validateRootRole: (agent, admission) => {
262
- // Candidate identity validation precedes publication. Its mode check
263
- // must not recursively demand the not-yet-bound live admission.
264
- validatingRootModule.set(agent, admission.settings.modules.deepwork.enabled);
265
- try {
266
- rolePolicy.validateRootRole(agent, admission);
267
- }
268
- finally {
269
- validatingRootModule.delete(agent);
270
- }
271
- },
272
- onAdmissionGuardsInstalled: async (initializing) => {
273
- runtime = initializing;
274
- integration?.onAdmissionGuardsInstalled();
275
- // Native descendants are filtered from their direct parent's actual
276
- // admission, including a preselected named profile, not startup mode.
277
- for (const root of hostCtx.agents.roots()) {
278
- const agent = root;
279
- await initializing.completeAdmission(agent, undefined, startup);
280
- completedRootAdmissions.add(agent);
281
- }
282
- rootAdmissionsInitialized = true;
283
- if (integration?.legacyRead !== undefined) {
284
- profileCtx.on?.("agent/created", async ({ agent, signal }) => {
285
- await integration.afterChildAdmission(agent, signal);
286
- }, { global: true });
287
- }
288
- },
289
- subagentCapabilities: {
290
- backgroundJobs: profileCtx.get?.("jobs") !== undefined,
291
- continuable: profileCtx.get?.("sessionPersistence") !== undefined && profileCtx.get?.("sessionQuery") !== undefined
292
- && profileCtx.get?.("subagents")?.getProvider("spawn")?.prepareContinuable !== undefined
293
- } });
294
- runtime = manager;
295
- lifetime.signal.throwIfAborted();
296
- // Retained controlled children enroll only after their awaited admission
297
- // in the Core-dependent continuation; ordinary Core startup stays independent.
298
- const admittedCtx = admittedAgentContext(profileCtx, manager);
299
- install(admittedCtx, getBoundSettings);
300
- registerRuntimeGuidance(admittedCtx, getBoundSettings, rolePolicy);
301
- const published = publicProfileRuntime(manager, hostCtx, integration?.legacyRead === undefined ? undefined : integration);
302
- profileCtx.provide?.("dsmmProfileRuntime", published);
303
- if (integration !== undefined) {
304
- hostCtx.provide("dsmmRuntimeIntegration", integration);
305
- hostCtx.inject(["dsmmCoreLlmOwner"], async (continuationCtx) => {
306
- const continuation = new AbortController();
307
- scopeLifetime(continuationCtx, "dsmm: cancel DW startup continuation", () => continuation.abort());
308
- return integration.continueStartup(async (signal) => {
309
- const visited = new Set();
310
- const admit = async (agent) => {
311
- signal.throwIfAborted();
312
- lifetime.signal.throwIfAborted();
313
- if (visited.has(agent))
314
- return;
315
- visited.add(agent);
316
- const parent = hostCtx.agents.list().find(parent => parent !== agent && hostCtx.agents.isOwnedBy(agent.id, parent));
317
- if (parent !== undefined)
318
- await admit(parent);
319
- if (parent !== undefined && classifyDsmmAgent(agent) === "native" && !controlledParent(parent))
320
- return;
321
- await manager.completeAdmission(agent, signal, startup);
322
- await integration.afterChildAdmission(agent, signal);
323
- };
324
- for (const agent of retainedChildren)
325
- if (hostCtx.agents.get(agent.id) === agent)
326
- await admit(agent);
327
- signal.throwIfAborted();
328
- lifetime.signal.throwIfAborted();
329
- await registerNativeSubagentControls(profileCtx);
330
- signal.throwIfAborted();
331
- lifetime.signal.throwIfAborted();
332
- await registerHeadlessRoleTools(admittedAgentContext(profileCtx, manager), controller, getBoundSettings, rolePolicy, integration);
333
- signal.throwIfAborted();
334
- lifetime.signal.throwIfAborted();
335
- hostCtx.inject(["typert"], scope => integration.registerControls(scope));
336
- }, AbortSignal.any([lifetime.signal, continuation.signal]));
337
- });
110
+ const current = ctx.get("dsmmPermissionController");
111
+ if ((current === undefined ? undefined : Reflect.get(current, symbols.original) ?? current) !== permissionIdentity
112
+ || current?.rules.getPolicy().revision !== permissionRevision || current?.rules.signal !== permissionSignal) {
113
+ throw new DsmmProfileError("not-owned", "Core permission authority changed.");
338
114
  }
339
- else
340
- registerRoleControlContribution(hostCtx);
341
- profileCtx.inject?.(["typert"], (rpcCtx) => {
342
- new DsmmProfilesHost(rpcCtx, published);
343
- });
344
115
  };
345
- if (readyCtx.inject !== undefined) {
346
- profileInitialization = new Promise((resolve, reject) => {
347
- const fiber = readyCtx.inject(["profileContext"], async (profileCtx) => {
348
- try {
349
- await installProfiles(profileCtx);
350
- resolve();
351
- }
352
- catch (error) {
353
- reject(error);
354
- }
355
- });
356
- scopeLifetime(fiber.ctx, "dsmm: cancel Core profile initialization", () => reject(new DsmmProfileError("unavailable", "Core profile initialization was disposed.")));
357
- });
358
- }
359
- else
360
- throw new Error("dsmm native profiles require asynchronous profileContext injection");
116
+ assertCurrent();
117
+ return Object.freeze({ agent: frame.agent, admission: captured, capture: captured, epoch: captured.epoch, signal, assertCurrent });
118
+ } });
119
+ const nativeAdmission = admission;
120
+ if (startup.settings.modules.deepwork.enabled) {
121
+ const presets = ctx.inject(["agentPresets"], async (scope) => {
122
+ await registerRolePresets(scope, () => startup.settings);
123
+ const providers = scope.inject(["subagents"], async (runtimeScope) => {
124
+ registerRoleProviders(runtimeScope, () => startup.settings, nativeAdmission);
125
+ await registerNativeSubagentControls(runtimeScope);
126
+ });
127
+ if (scope.get("subagents") !== undefined)
128
+ await providers.await();
129
+ });
130
+ if (ctx.get("agentPresets") !== undefined)
131
+ await presets.await();
132
+ }
133
+ if (startup.settings.modules.deepwork.enabled)
134
+ await registerLspRuntime(ctx, startup.settings.lsp, getSettings);
135
+ lifetime.signal.throwIfAborted();
136
+ const installed = new WeakSet();
137
+ admission.activate(async (agent, candidate) => {
138
+ candidate.subagentRuntime = () => runtimeAdmissionView(ctx);
139
+ const scope = agent.ctx;
140
+ if (candidate().modules.deepwork.enabled) {
141
+ registerAgentSkills(scope, controller, candidate, agent, admission.lifetime.signal);
142
+ registerDeepworkPrompt(scope, controller, candidate, { section: startup.profile.section ?? startup.global.section }, agent, admission.lifetime.signal);
361
143
  }
144
+ if (installed.has(agent)) {
145
+ if (candidate().modules.deepwork.enabled && ctx.get("subagents") !== undefined)
146
+ await registerHeadlessRoleTools(scope, controller, candidate, policy, nativeAdmission, agent);
147
+ return;
148
+ }
149
+ registerModelRouting(scope, controller, candidate);
150
+ registerSafetyGuards(scope, controller, candidate, policy);
151
+ if (candidate().modules.deepwork.enabled) {
152
+ if (ctx.get("subagents") !== undefined)
153
+ await registerHeadlessRoleTools(scope, controller, candidate, policy, nativeAdmission, agent);
154
+ }
155
+ installed.add(agent);
362
156
  });
363
- if (getSettings().modules.deepwork.enabled) {
364
- registerRuntimeRecovery(ctx, controller, getBoundSettings);
365
- registerModelRouting(ctx, controller, getBoundSettings);
366
- }
367
- if (ctx.get !== undefined) {
368
- ctx.on?.("system-prompt/assemble", async (_assembly, options, next) => {
369
- const agent = agentForScope(ctx, options.scope);
370
- if (agent !== undefined)
371
- rolePolicy.assertModuleAdmission(agent);
372
- return next();
373
- }, { prepend: true, global: true });
374
- ctx.on?.("agent/request", async (frame, next) => {
375
- rolePolicy.assertModuleAdmission(frame.agent);
376
- assertDwDelivery(frame.agent);
377
- return next();
378
- }, { prepend: true, global: true });
379
- ctx.on?.("tools/execute", async (exec, next) => {
380
- if (exec.agent === undefined)
381
- return next();
382
- return rolePolicy.duringToolExecution(exec, next);
383
- }, { global: true });
384
- }
385
- registerSafetyGuards(ctx, controller, getBoundSettings, ctx.get === undefined ? undefined : rolePolicy);
386
- if (native === undefined)
387
- return profileInitialization;
388
- native.inject(["tools"], scope => {
389
- managedAgentContext(scope, controlledParent).on("tools/pre-execute", (exec, next) => rolePolicy.beforeToolDecision(async () => {
390
- if (exec.agent !== undefined && !nativeStandingFullAccess(scope, exec.agent)) {
391
- rolePolicy.assertModuleAdmission(exec.agent);
392
- assertDwDelivery(exec.agent);
393
- }
394
- return next();
395
- }), { prepend: true, global: true });
396
- managedAgentContext(scope, controlledParent).get("tools").guard(exec => {
397
- rolePolicy.assertToolExecution(exec);
398
- });
157
+ ctx.inject(["commands"], scope => {
158
+ registerDsmmStatusCommand(scope, controller, getSettings);
159
+ if (startup.settings.modules.deepwork.enabled)
160
+ registerDeepworkCommand(scope, controller, getSettings);
399
161
  });
400
- if (deployment !== undefined) {
401
- const permissions = createCorePermissionAuthority(native, { getSettings: getBoundSettings, rolePolicy, signal: lifetime.signal });
402
- native.inject(["tools"], scope => {
403
- const installed = installCorePermissions(scope, deployment, permissions.authority, permissions.assertWritable);
404
- const identity = Reflect.get(installed, symbols.original) ?? installed;
405
- scopeLifetime(scope, "dsmm: release mounted permission projection", () => { if (permissionOwner === identity)
406
- permissionOwner = undefined; }, () => { permissionOwner = identity; });
407
- });
408
- }
409
- return Promise.resolve(profileInitialization).then(() => {
410
- lifetime.signal.throwIfAborted();
411
- const owner = { async admit(frame) {
412
- const agent = frame.agent;
413
- frame.signal.throwIfAborted();
414
- lifetime.signal.throwIfAborted();
415
- if (frame.agent.session.header.origin === "subagent" && classifyDsmmAgent(frame.agent) === "native") {
416
- const registry = native.agents;
417
- const parents = registry.list().filter(parent => parent !== frame.agent && registry.isOwnedBy(frame.agent.id, parent));
418
- if (registry.get(frame.agent.id) !== frame.agent || parents.length !== 1
419
- || frame.agent.session.header.parentSession !== parents[0].id)
420
- throw new DsmmProfileError("not-owned", "The native child lost its physical owner.");
421
- if (!controlledParent(parents[0]))
422
- return undefined;
423
- }
424
- rolePolicy.assertModuleAdmission(agent);
425
- const admission = getBoundSettings.admission(agent);
426
- const permissions = native.get("dsmmPermissionController");
427
- const full = nativeStandingFullAccess(native, frame.agent);
428
- if (!full && admission.settings.permissionControl.enabled && permissions === undefined)
429
- throw new DsmmProfileError("unavailable", "Core permission authority is not ready.");
430
- if (!full)
431
- await permissions?.rules.refresh();
432
- frame.signal.throwIfAborted();
433
- lifetime.signal.throwIfAborted();
434
- const permissionIdentity = permissions === undefined ? undefined : Reflect.get(permissions, symbols.original) ?? permissions;
435
- const permissionRevision = full ? undefined : permissions?.rules.getPolicy().revision;
436
- const permissionSignal = full ? undefined : permissions?.rules.signal;
437
- const bindPermission = (captured) => {
438
- if (full)
439
- return captured;
440
- const signal = AbortSignal.any([captured.signal, ...permissionSignal === undefined ? [] : [permissionSignal]]);
441
- const assertCurrent = () => {
442
- signal.throwIfAborted();
443
- captured.assertCurrent();
444
- const current = native.get("dsmmPermissionController");
445
- if ((current === undefined ? undefined : Reflect.get(current, symbols.original) ?? current) !== permissionIdentity
446
- || current?.rules.getPolicy().revision !== permissionRevision
447
- || current?.rules.signal !== permissionSignal)
448
- throw new DsmmProfileError("not-owned", "LLM permission revision changed.");
449
- };
450
- assertCurrent();
451
- return Object.freeze({ ...captured, signal, assertCurrent });
452
- };
453
- if (rolePolicy.identity(agent).role !== undefined) {
454
- const integration = native.get("dsmmRuntimeIntegration");
455
- if (integration?.runtime.authority.view().deliveryFenceReady !== true)
456
- throw new DsmmProfileError("unavailable", "Deepwork requests require the live delivery fence.");
457
- const admitted = await integration.admitLlmRequest(frame.agent, frame.signal);
458
- if (admitted === undefined)
459
- throw new DsmmProfileError("not-owned", "Deepwork request lost its role admission.");
460
- return bindPermission(admitted);
461
- }
462
- const signal = AbortSignal.any([frame.signal, lifetime.signal]);
463
- const assertCurrent = () => {
464
- signal.throwIfAborted();
465
- rolePolicy.assertModuleAdmission(agent);
466
- if (native.get("dsmmCoreLlmOwner") !== owner || getBoundSettings.admission(agent) !== admission)
467
- throw new DsmmProfileError("not-owned", "Core LLM admission changed.");
468
- };
469
- assertCurrent();
470
- return bindPermission(Object.freeze({ agent: frame.agent, admission, capture: admission, epoch: admission.epoch, signal, assertCurrent }));
471
- } };
472
- native.provide("dsmmCoreLlmOwner", owner);
162
+ ctx.inject(["typert"], scope => { registerConfigRpc(scope, deployment, startup.settings, () => profiles, startup.sources, mountedPermission); new DsmmProfilesHost(scope, profiles); registerRoleControlRpc(scope, nativeAdmission); });
163
+ const permissions = createCorePermissionAuthority(ctx, { getSettings, rolePolicy: policy, signal: lifetime.signal });
164
+ const installPermissions = () => ctx.inject(["tools", ...(ctx.fiber.entry === undefined ? [] : ["settings"])], scope => {
165
+ const installed = installCorePermissions(scope, deployment, permissions.authority, permissions.assertWritable);
166
+ const identity = Reflect.get(installed, symbols.original) ?? installed;
167
+ scopeLifetime(scope, "dsmm: release permission projection", () => { if (permissionOwner === identity)
168
+ permissionOwner = undefined; }, () => { permissionOwner = identity; });
473
169
  });
170
+ if (ctx.fiber.entry === undefined || ctx.fiber.state === 2)
171
+ installPermissions();
172
+ else {
173
+ const owner = ctx.fiber.ctx;
174
+ const detach = ctx.on("internal/status", fiber => { if (fiber.ctx !== owner || fiber.state !== 2)
175
+ return; detach(); if (!lifetime.signal.aborted)
176
+ installPermissions(); }, { global: true });
177
+ }
474
178
  }
475
- // Cordis Loader introspects this object's Config/inject; a bare function loses
476
- // the exported schema and may pass null where required DSMM defaults belong.
477
- // Method-form apply keeps Cordis on its awaited callback, not constructor, path.
478
- export default { name, inject, Config, apply(ctx, config = {}) { return apply(ctx, config); } };
179
+ export default { name, inject, Config, apply };
479
180
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,4 @@
1
+ import type { Context } from "@deepseek-ai/cordis";
2
+ /** Revoke synchronously when an owning scope begins unloading, before async cleanup. */
3
+ export declare function scopeLifetime(scope: Context, label: string, revoke: () => void, install?: () => void): () => void;
4
+ //# sourceMappingURL=lifetime.d.ts.map