@dsmm/dsmm 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -67
- package/agent-presets/dsmm-builder/agent.cordis.yml +10 -2015
- package/agent-presets/dsmm-clarifier/agent.cordis.yml +24 -343
- package/agent-presets/dsmm-code-search/agent.cordis.yml +19 -6
- package/agent-presets/dsmm-coding/agent.cordis.yml +19 -438
- package/agent-presets/dsmm-complex/agent.cordis.yml +23 -1009
- package/agent-presets/dsmm-creative/agent.cordis.yml +25 -442
- package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +29 -1013
- package/agent-presets/dsmm-deep/agent.cordis.yml +24 -1008
- package/agent-presets/dsmm-doc-search/agent.cordis.yml +19 -6
- package/agent-presets/dsmm-documenting/agent.cordis.yml +26 -439
- package/agent-presets/dsmm-frontend/agent.cordis.yml +21 -440
- package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +22 -441
- package/agent-presets/dsmm-media-reader/agent.cordis.yml +19 -6
- package/agent-presets/dsmm-normal-task/agent.cordis.yml +19 -438
- package/agent-presets/dsmm-oracle/agent.cordis.yml +25 -340
- package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +25 -340
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +29 -2025
- package/agent-presets/dsmm-plan-critic/agent.cordis.yml +24 -341
- package/agent-presets/dsmm-planner/agent.cordis.yml +14 -344
- package/agent-presets/dsmm-quick/agent.cordis.yml +19 -6
- package/agent-presets/dsmm-research/agent.cordis.yml +23 -8
- package/agent-presets/dsmm-reviewer/agent.cordis.yml +25 -340
- package/cordis.patch.yml +14 -0
- package/docs/agent-presets.md +36 -52
- package/docs/compatibility.md +47 -110
- package/docs/deferred-native-approval-risk.md +19 -0
- package/docs/design.md +2 -2
- package/docs/lsp.md +11 -21
- package/docs/migration-from-ocmm.md +2 -2
- package/docs/model-routing.md +84 -59
- package/docs/native-permissions.md +35 -0
- package/docs/profiles.md +40 -87
- package/docs/releasing.md +123 -2
- package/docs/roadmap.md +71 -17
- package/docs/settings-status.md +34 -169
- package/docs/skill-sync.md +52 -15
- package/lib/agent-registry.d.ts +36 -0
- package/lib/agent-registry.js +75 -0
- package/lib/child-admission-contract.d.ts +37 -0
- package/lib/child-admission-contract.js +2 -0
- package/lib/child-admission.d.ts +40 -0
- package/lib/child-admission.js +151 -0
- package/lib/child-capture.d.ts +85 -0
- package/lib/child-capture.js +205 -0
- package/lib/child-evidence.d.ts +17 -0
- package/lib/child-evidence.js +43 -0
- package/lib/client/ChildrenPanel.d.ts +43 -0
- package/lib/client/ChildrenPanel.js +82 -0
- package/lib/client/DeploymentPage.js +15 -8
- package/lib/client/EditableChoice.d.ts +17 -0
- package/lib/client/EditableChoice.js +49 -0
- package/lib/client/PermissionsPanel.d.ts +14 -0
- package/lib/client/PermissionsPanel.js +46 -0
- package/lib/client/ProfilesSection.js +30 -15
- package/lib/client/RoleAvailability.d.ts +7 -0
- package/lib/client/RoleAvailability.js +19 -0
- package/lib/client/SessionProfiles.js +27 -9
- package/lib/client/StructuredEditor.js +15 -7
- package/lib/client/children-controller.d.ts +98 -0
- package/lib/client/children-controller.js +296 -0
- package/lib/client/children-locales.d.ts +367 -0
- package/lib/client/children-locales.js +69 -0
- package/lib/client/controller.d.ts +6 -1
- package/lib/client/controller.js +14 -8
- package/lib/client/deployment-controller.js +1 -1
- package/lib/client/deployment-data.d.ts +2 -1
- package/lib/client/deployment-data.js +34 -5
- package/lib/client/deployment-locales.d.ts +4 -0
- package/lib/client/deployment-locales.js +11 -2
- package/lib/client/diagnostics.d.ts +14 -0
- package/lib/client/diagnostics.js +53 -0
- package/lib/client/index.d.ts +4 -0
- package/lib/client/index.js +96 -2
- package/lib/client/locales.d.ts +54 -0
- package/lib/client/locales.js +34 -16
- package/lib/client/permission-client.d.ts +16 -0
- package/lib/client/permission-client.js +38 -0
- package/lib/client/permission-controller.d.ts +62 -0
- package/lib/client/permission-controller.js +149 -0
- package/lib/client/permission-locales.d.ts +114 -0
- package/lib/client/permission-locales.js +75 -0
- package/lib/client/session-labels.js +4 -4
- package/lib/client/structured.js +19 -5
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +20 -0
- package/lib/client.js +5780 -1679
- package/lib/core-permission-authority.d.ts +18 -0
- package/lib/core-permission-authority.js +255 -0
- package/lib/core-permissions.d.ts +8 -0
- package/lib/core-permissions.js +33 -0
- package/lib/delivery-authority.d.ts +83 -0
- package/lib/delivery-authority.js +397 -0
- package/lib/deployment-config.d.ts +23 -0
- package/lib/deployment-config.js +61 -40
- package/lib/deployment-permission-rules.d.ts +55 -0
- package/lib/deployment-permission-rules.js +306 -0
- package/lib/dsh-types.d.ts +10 -4
- package/lib/guards.d.ts +1 -1
- package/lib/guards.js +29 -8
- package/lib/host-llm-startup.d.ts +41 -0
- package/lib/host-llm-startup.js +65 -0
- package/lib/host-llm.d.ts +92 -0
- package/lib/host-llm.js +325 -0
- package/lib/index.d.ts +15 -4
- package/lib/index.js +288 -48
- package/lib/live-pi-ai-owner.d.ts +18 -0
- package/lib/live-pi-ai-owner.js +144 -0
- package/lib/llm-runtime.d.ts +11 -0
- package/lib/llm-runtime.js +21 -0
- package/lib/managed-settings.d.ts +5 -0
- package/lib/managed-settings.js +14 -0
- package/lib/model-parameter-policy.d.ts +11 -0
- package/lib/model-parameter-policy.js +27 -0
- package/lib/model-routing.js +28 -17
- package/lib/modules.d.ts +13 -5
- package/lib/modules.js +17 -1
- package/lib/native-child-evidence.d.ts +40 -0
- package/lib/native-child-evidence.js +104 -0
- package/lib/native-pi-ai-wire.d.ts +37 -0
- package/lib/native-pi-ai-wire.js +261 -0
- package/lib/native-scope.js +1 -1
- package/lib/permission-bash.d.ts +6 -0
- package/lib/permission-bash.js +7 -0
- package/lib/permission-control.d.ts +73 -0
- package/lib/permission-control.js +205 -0
- package/lib/permission-controller.d.ts +68 -0
- package/lib/permission-controller.js +317 -0
- package/lib/permission-errors.d.ts +7 -0
- package/lib/permission-errors.js +21 -0
- package/lib/permission-fs-search.d.ts +5 -0
- package/lib/permission-fs-search.js +7 -0
- package/lib/permission-fs.d.ts +5 -0
- package/lib/permission-fs.js +7 -0
- package/lib/permission-native-access.d.ts +11 -0
- package/lib/permission-native-access.js +6 -0
- package/lib/permission-native-command.d.ts +10 -0
- package/lib/permission-native-command.js +93 -0
- package/lib/permission-native-rules.d.ts +75 -0
- package/lib/permission-native-rules.js +278 -0
- package/lib/permission-pwsh.d.ts +6 -0
- package/lib/permission-pwsh.js +7 -0
- package/lib/permission-remote.d.ts +26 -0
- package/lib/permission-remote.js +53 -0
- package/lib/permission-rpc.d.ts +29 -0
- package/lib/permission-rpc.js +152 -0
- package/lib/permission-rules.d.ts +115 -0
- package/lib/permission-rules.js +256 -0
- package/lib/permission-settings.d.ts +45 -0
- package/lib/permission-settings.js +48 -0
- package/lib/permission-shell.d.ts +38 -0
- package/lib/permission-shell.js +150 -0
- package/lib/permission-web.d.ts +5 -0
- package/lib/permission-web.js +7 -0
- package/lib/preset-registry.js +36 -25
- package/lib/profile-diagnostics.d.ts +45 -0
- package/lib/profile-diagnostics.js +148 -0
- package/lib/profile-locale.d.ts +3 -0
- package/lib/profile-locale.js +2 -0
- package/lib/profile-remote.d.ts +8 -0
- package/lib/profile-remote.js +163 -39
- package/lib/profile-rpc.d.ts +4 -3
- package/lib/profile-rpc.js +20 -16
- package/lib/profile-runtime.d.ts +40 -1
- package/lib/profile-runtime.js +368 -93
- package/lib/profile-store.d.ts +11 -0
- package/lib/profile-store.js +143 -11
- package/lib/profile-types.d.ts +70 -1
- package/lib/profile-types.js +1 -0
- package/lib/profiles.d.ts +16 -2
- package/lib/profiles.js +156 -79
- package/lib/prompt-content.js +1 -1
- package/lib/prompts.d.ts +37 -2
- package/lib/prompts.js +111 -9
- package/lib/recovery-policy.js +20 -7
- package/lib/role-control-remote.d.ts +38 -0
- package/lib/role-control-remote.js +211 -0
- package/lib/role-control-rpc.d.ts +51 -0
- package/lib/role-control-rpc.js +381 -0
- package/lib/role-control-types.d.ts +92 -0
- package/lib/role-control-types.js +8 -0
- package/lib/role-invocation.d.ts +47 -0
- package/lib/role-invocation.js +135 -0
- package/lib/role-llm-runtime.d.ts +17 -0
- package/lib/role-llm-runtime.js +62 -0
- package/lib/role-llm.d.ts +31 -0
- package/lib/role-llm.js +66 -0
- package/lib/role-policy.d.ts +46 -8
- package/lib/role-policy.js +421 -61
- package/lib/role-providers.d.ts +2 -2
- package/lib/role-providers.js +27 -72
- package/lib/role-routing.d.ts +11 -2
- package/lib/role-routing.js +42 -25
- package/lib/role-runs.d.ts +138 -0
- package/lib/role-runs.js +335 -0
- package/lib/role-subagents.d.ts +58 -3
- package/lib/role-subagents.js +179 -56
- package/lib/roles.d.ts +5 -6
- package/lib/roles.js +10 -39
- package/lib/route-json.d.ts +19 -0
- package/lib/route-json.js +129 -0
- package/lib/routing-policy.d.ts +2 -0
- package/lib/routing-policy.js +12 -2
- package/lib/runtime-integration.d.ts +81 -0
- package/lib/runtime-integration.js +702 -0
- package/lib/runtime-recovery.js +18 -8
- package/lib/session-persistence.d.ts +2 -1
- package/lib/session-persistence.js +1 -1
- package/lib/session-scope.js +4 -1
- package/lib/settings.d.ts +47 -13
- package/lib/settings.js +217 -82
- package/lib/skills.js +2 -2
- package/lib/status.d.ts +10 -1
- package/lib/status.js +11 -8
- package/lib/subagent-runtime.d.ts +57 -0
- package/lib/subagent-runtime.js +257 -0
- package/package.json +149 -89
- package/patches/subagent-runtime.yml +15 -0
- package/prompts/deepseek-flash.md +1 -1
- package/prompts/deepseek-v4-pro.md +2 -2
- package/prompts/deepwork.md +27 -18
- package/prompts/source/agents/clarifier.md +5 -3
- package/prompts/source/agents/orchestrator.md +18 -9
- package/prompts/source/agents/plan-critic.md +5 -1
- package/prompts/source/agents/planner.md +4 -2
- package/prompts/source/agents/reviewer.md +6 -0
- package/prompts/source/category/complex.md +4 -4
- package/prompts/source/category/creative.md +6 -4
- package/prompts/source/category/cross-cutting.md +10 -8
- package/prompts/source/category/deep.md +5 -3
- package/prompts/source/category/documenting.md +7 -1
- package/prompts/source/category/frontend.md +2 -2
- package/prompts/source/category/hard-reasoning.md +3 -3
- package/prompts/source/category/research.md +4 -2
- package/prompts/source/deepwork/claude-opus-5.md +2 -2
- package/prompts/source/deepwork/codex.md +1 -1
- package/prompts/source/deepwork/default.md +22 -15
- package/prompts/source/deepwork/gemini.md +23 -16
- package/prompts/source/deepwork/glm.md +21 -14
- package/prompts/source/deepwork/gpt.md +12 -6
- package/prompts/source/deepwork/planner.md +8 -5
- package/prompts/source/manifest.json +178 -63
- package/prompts/source/shared/dsh-host-contract.md +5 -3
- package/prompts/source/shared/locale.md +2 -2
- package/prompts/source/terminal/orchestrator.md +1 -1
- package/skills/ast-grep/SKILL.md +7 -4
- package/skills/brainstorming/SKILL.md +43 -22
- package/skills/coding-agent-sessions/SKILL.md +7 -4
- package/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -46
- package/skills/coding-agent-sessions/scripts/tests/test_pi_family_scanners.py +130 -130
- package/skills/debugging/SKILL.md +14 -9
- package/skills/debugging/references/methodology/00-setup.md +14 -62
- package/skills/debugging/references/methodology/02-investigate.md +4 -4
- package/skills/debugging/references/methodology/03-flaky-triage.md +3 -3
- package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +2 -14
- package/skills/debugging/references/methodology/06-fix.md +6 -6
- package/skills/debugging/references/methodology/08-qa.md +5 -5
- package/skills/debugging/references/methodology/09-cleanup.md +15 -153
- package/skills/debugging/references/methodology/partial-runtime-evidence.md +3 -16
- package/skills/debugging/references/runtimes/bundled-js-binary.md +1 -16
- package/skills/debugging/references/runtimes/native-binary.md +9 -54
- package/skills/debugging/references/runtimes/node.md +4 -15
- package/skills/debugging/references/runtimes/python.md +3 -15
- package/skills/debugging/references/runtimes/rust.md +2 -18
- package/skills/debugging/references/tools/dap.md +1 -1
- package/skills/debugging/references/tools/ghidra.md +4 -15
- package/skills/debugging/references/tools/playwright-cli.md +3 -15
- package/skills/debugging/references/tools/pwntools.md +4 -16
- package/skills/dispatching-parallel-agents/SKILL.md +18 -16
- package/skills/frontend/SKILL.md +7 -4
- package/skills/frontend/references/design/react-dev-tooling-skill.md +1 -1
- package/skills/git-master/SKILL.md +7 -4
- package/skills/init-deep/SKILL.md +7 -4
- package/skills/receiving-code-review/SKILL.md +17 -12
- package/skills/remove-ai-slops/SKILL.md +39 -38
- package/skills/requesting-code-review/SKILL.md +19 -17
- package/skills/requesting-code-review/code-reviewer.md +13 -1
- package/skills/subagent-driven-development/SKILL.md +29 -26
- package/skills/subagent-driven-development/implementer-prompt.md +29 -11
- package/skills/subagent-driven-development/spec-reviewer-prompt.md +6 -1
- package/skills/using-git-worktrees/SKILL.md +7 -4
- package/skills/writing-plans/SKILL.md +29 -24
- package/skills/writing-plans/plan-document-reviewer-prompt.md +10 -1
- package/scripts/repair-session-log.mjs +0 -476
- package/scripts/session-repair-native-verifier.mjs +0 -367
package/lib/role-providers.js
CHANGED
|
@@ -1,44 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
export function roleProviderName(role) {
|
|
7
|
-
return `dsmm-role-${role.slice("dsmm-".length)}`;
|
|
8
|
-
}
|
|
1
|
+
import { SubagentError } from "@deepseek-ai/dsh-subagent";
|
|
2
|
+
import { DSMM_ROLE_IDS, roleProviderName } from "./roles.js";
|
|
3
|
+
export { roleProviderName } from "./roles.js";
|
|
4
|
+
import { currentRoleInvocation, invocationAgentOptions, resolveRoleInvocation } from "./role-invocation.js";
|
|
5
|
+
import { currentManagedCreation } from "./agent-registry.js";
|
|
9
6
|
export function roleFromProviderName(provider) {
|
|
10
7
|
return DSMM_ROLE_IDS.find((role) => role !== "dsmm-orchestrator" && roleProviderName(role) === provider);
|
|
11
8
|
}
|
|
12
|
-
const NO_CAPABILITIES = Object.freeze({ agentOptions: false, outputSchema: false, depthLimit: false,
|
|
9
|
+
const NO_CAPABILITIES = Object.freeze({ agentOptions: false, outputSchema: false, depthLimit: false, agentPreset: false });
|
|
13
10
|
function supportedSpawn(provider) {
|
|
14
|
-
return provider !== undefined && provider.name === "spawn" && typeof provider.
|
|
11
|
+
return provider !== undefined && provider.name === "spawn" && typeof provider.prepareContinuable === "function"
|
|
15
12
|
&& provider.inheritsParentContext === false && provider.agentRouteDefaults === undefined;
|
|
16
13
|
}
|
|
17
14
|
export async function roleAgentOptions(parent, role, settings, signal, explicit) {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
reasoningEffort: primary.reasoningEffort === undefined ? undefined : ReasoningEffortId(primary.reasoningEffort), ...explicit };
|
|
21
|
-
if (primary !== undefined && explicit?.reasoningEffort === undefined
|
|
22
|
-
&& (explicit?.provider !== undefined && explicit.provider !== primary.provider || explicit?.model !== undefined && explicit.model !== primary.model))
|
|
23
|
-
options.reasoningEffort = undefined;
|
|
24
|
-
const inherited = parentAgentOptionsForDelegation(parent);
|
|
25
|
-
const provider = options?.provider ?? inherited.provider, model = options?.model ?? inherited.model;
|
|
26
|
-
if (provider === undefined || model === undefined)
|
|
27
|
-
throw new Error("dsmm role delegation requires an effective provider and model");
|
|
28
|
-
const changed = provider !== inherited.provider || model !== inherited.model;
|
|
29
|
-
const effort = options?.reasoningEffort ?? (primary === undefined && !changed ? inherited.reasoningEffort : undefined);
|
|
30
|
-
const llm = parent.ctx.get("llm");
|
|
31
|
-
if (llm?.resolveCallConfig === undefined)
|
|
32
|
-
throw new Error("dsmm role delegation requires the parent Agent native LLM service");
|
|
33
|
-
const candidates = [{ provider, model, ...(effort === undefined ? {} : { reasoningEffort: effort }) },
|
|
34
|
-
...explicit?.provider !== undefined || explicit?.model !== undefined ? [] : resolveRoleRuntimePolicy(settings, role).fallbackRoutes.map((route) => ({ ...route,
|
|
35
|
-
...(explicit?.reasoningEffort === undefined ? {} : { reasoningEffort: explicit.reasoningEffort }) }))];
|
|
36
|
-
const selected = await selectInitialModelRoute(llm, candidates, signal);
|
|
37
|
-
signal.throwIfAborted();
|
|
38
|
-
return primary === undefined && selected.provider === provider && selected.model === model ? explicit : { ...options, ...selected,
|
|
39
|
-
reasoningEffort: selected.reasoningEffort === undefined ? undefined : ReasoningEffortId(selected.reasoningEffort) };
|
|
15
|
+
const invocation = currentRoleInvocation(parent, role) ?? await resolveRoleInvocation(parent, role, settings, signal, {}, explicit);
|
|
16
|
+
return invocationAgentOptions(invocation, explicit);
|
|
40
17
|
}
|
|
41
|
-
/**
|
|
18
|
+
/** The native manager owns descriptors, capability admission and activations. */
|
|
42
19
|
export function registerRoleProviders(ctx, getSettings, getDeploymentSettings = getSettings, policy) {
|
|
43
20
|
const installed = new WeakSet();
|
|
44
21
|
const install = (readyCtx) => {
|
|
@@ -62,53 +39,31 @@ export function registerRoleProviders(ctx, getSettings, getDeploymentSettings =
|
|
|
62
39
|
inheritsParentContext: false,
|
|
63
40
|
get prepareContinuable() {
|
|
64
41
|
const spawn = registry.getProvider("spawn");
|
|
65
|
-
if (!supportedSpawn(spawn) || spawn.prepareContinuable === undefined)
|
|
66
|
-
return undefined;
|
|
67
42
|
return async (request) => {
|
|
43
|
+
if (!supportedSpawn(spawn) || spawn.prepareContinuable === undefined)
|
|
44
|
+
throw new SubagentError("DSMM requires a local spawn provider", "UNSUPPORTED_CAPABILITY");
|
|
68
45
|
if (!active || registry.getProvider("spawn") !== spawn)
|
|
69
46
|
throw new SubagentError("DSMM native continuable provider changed", "NO_PROVIDER");
|
|
70
47
|
const admitted = getSettings(request.parent);
|
|
71
48
|
if (!admitted.modules.deepwork.enabled || !admitted.roles[role])
|
|
72
49
|
throw new SubagentError("DSMM module or role is disabled", "UNAUTHORIZED");
|
|
73
|
-
|
|
50
|
+
const operation = currentManagedCreation();
|
|
51
|
+
if (operation?.kind !== "fresh" || operation.parent !== request.parent || operation.childId !== request.sessionId)
|
|
52
|
+
throw new SubagentError("DSMM role requires its managed creation operation", "UNAUTHORIZED");
|
|
53
|
+
if (operation.delegationMode === "continuable" && (!admitted.subagents.enableRunInBackground || admitted.subagents.backgroundMode !== "continuable"))
|
|
74
54
|
throw new SubagentError("DSMM continuable delegation requires explicit admitted opt-in", "UNAUTHORIZED");
|
|
75
|
-
policy?.prepareContinuable(request.parent, role, request.signal);
|
|
76
|
-
|
|
55
|
+
const preparing = policy?.prepareContinuable(request.parent, role, request.signal);
|
|
56
|
+
const invocation = currentRoleInvocation(request.parent, role);
|
|
57
|
+
request.signal.throwIfAborted();
|
|
58
|
+
if (!active || registry.getProvider("spawn") !== spawn)
|
|
59
|
+
throw new SubagentError("DSMM continuable provider changed during preflight", "NO_PROVIDER");
|
|
60
|
+
if (preparing !== undefined)
|
|
61
|
+
policy.recordContinuableCreation(request.sessionId, request.parent, role, invocation, preparing.epoch, request.signal);
|
|
62
|
+
const prepared = await spawn.prepareContinuable(request);
|
|
63
|
+
if (prepared.seed !== undefined)
|
|
64
|
+
throw new SubagentError("DSMM spawn cannot inherit parent history", "UNSUPPORTED_CAPABILITY");
|
|
65
|
+
return prepared;
|
|
77
66
|
};
|
|
78
|
-
},
|
|
79
|
-
async start(request) {
|
|
80
|
-
if (!active)
|
|
81
|
-
throw new Error("dsmm role provider is disposed");
|
|
82
|
-
const spawn = registry.getProvider("spawn");
|
|
83
|
-
if (!supportedSpawn(spawn))
|
|
84
|
-
throw new Error("dsmm role provider requires the supported native spawn capabilities");
|
|
85
|
-
if (request.descriptor.mode !== "one-shot" || request.descriptor.provider !== roleProviderName(role))
|
|
86
|
-
throw new SubagentError("DSMM alias requires its exact native descriptor", "UNAUTHORIZED");
|
|
87
|
-
const admission = policy?.assertDelegation(request.parent, role);
|
|
88
|
-
for (const [key, value] of Object.entries({ agentOptions: request.agentOptions, outputSchema: request.outputSchema, depthLimit: request.maxDepth, toolFilter: request.toolFilter, persona: request.persona })) {
|
|
89
|
-
if (value !== undefined && !spawn.capabilities[key])
|
|
90
|
-
throw new SubagentError(`DSMM spawn does not support ${key}`, "UNSUPPORTED_CAPABILITY");
|
|
91
|
-
}
|
|
92
|
-
const parentSettings = getSettings(request.parent);
|
|
93
|
-
if (!parentSettings.modules.deepwork.enabled || !parentSettings.roles[role])
|
|
94
|
-
throw new Error("dsmm role provider is disabled by deployment configuration");
|
|
95
|
-
const agentOptions = await roleAgentOptions(request.parent, role, parentSettings, request.signal, request.agentOptions);
|
|
96
|
-
request.signal.throwIfAborted();
|
|
97
|
-
if (!active || registry.getProvider("spawn") !== spawn)
|
|
98
|
-
throw new Error("dsmm role spawn provider changed during route validation; retry delegation");
|
|
99
|
-
if (admission !== undefined && policy.assertDelegation(request.parent, role).epoch !== admission.epoch)
|
|
100
|
-
throw new SubagentError("DSMM parent admission changed during route preflight", "UNAUTHORIZED");
|
|
101
|
-
// Preserve the native descriptor, authority filters and lifecycle;
|
|
102
|
-
// this alias owns only profile-derived route defaults and preflight.
|
|
103
|
-
const routed = agentOptions === request.agentOptions ? request : { ...request, agentOptions };
|
|
104
|
-
const maxDepth = request.maxDepth ?? registry.resolveMaxDepth?.(parentSettings.subagents.maxDepth);
|
|
105
|
-
if (maxDepth !== undefined && !spawn.capabilities.depthLimit)
|
|
106
|
-
throw new SubagentError("DSMM spawn cannot enforce the native depth limit", "UNSUPPORTED_CAPABILITY");
|
|
107
|
-
const resolved = maxDepth === undefined ? routed : { ...routed, maxDepth };
|
|
108
|
-
if (resolved.agentOptions !== undefined && !spawn.capabilities.agentOptions)
|
|
109
|
-
throw new SubagentError("DSMM spawn cannot accept the configured or selected child route", "UNSUPPORTED_CAPABILITY");
|
|
110
|
-
return policy === undefined ? spawn.start(resolved)
|
|
111
|
-
: policy.duringDelegation(request.parent, role, () => spawn.start(resolved), request.toolFilter);
|
|
112
67
|
}
|
|
113
68
|
});
|
|
114
69
|
const provider = registry.getProvider(roleProviderName(role));
|
package/lib/role-routing.d.ts
CHANGED
|
@@ -2,11 +2,13 @@ import type { AgentRequestFrame, DshAgent, DshContext, DshLlmCallConfig, DshLlmR
|
|
|
2
2
|
import type { DsmmRoleId } from "./roles.js";
|
|
3
3
|
import type { DsmmModelRoute, DsmmSettings } from "./settings.js";
|
|
4
4
|
import type { DsmmRoleRuntimeState } from "./profile-types.js";
|
|
5
|
+
import type { DsmmLlmRouteResolver } from "./role-llm.js";
|
|
5
6
|
export declare const DSMM_ROLE_POLICY_EVENT = "dsmm/role-policy";
|
|
6
7
|
export interface RoleRouteLock {
|
|
7
8
|
identity: string;
|
|
8
9
|
route: DsmmModelRoute;
|
|
9
10
|
candidates: readonly DsmmModelRoute[];
|
|
11
|
+
candidateIndex: number;
|
|
10
12
|
generation: number;
|
|
11
13
|
attempts: number;
|
|
12
14
|
startupSettled: boolean;
|
|
@@ -29,9 +31,16 @@ export declare function nativeModelSelectionWasAccepted(agent: DshAgent, intent:
|
|
|
29
31
|
export declare function isUnavailableRouteFailure(error: unknown, nativeRequestFailure?: boolean): boolean;
|
|
30
32
|
export declare function orderedModelRoutes(candidates: readonly DsmmModelRoute[]): DsmmModelRoute[];
|
|
31
33
|
/** Exact metadata preparation, never a completion or advisory catalog health check. */
|
|
32
|
-
export declare function selectInitialModelRoute(llm: DshLlmRuntime, candidates: readonly DsmmModelRoute[], signal?: AbortSignal): Promise<DsmmModelRoute>;
|
|
34
|
+
export declare function selectInitialModelRoute(llm: DshLlmRuntime, candidates: readonly DsmmModelRoute[], signal?: AbortSignal, resolver?: DsmmLlmRouteResolver): Promise<DsmmModelRoute>;
|
|
35
|
+
export declare function selectInitialModelRouteChoice(llm: DshLlmRuntime, candidates: readonly DsmmModelRoute[], signal?: AbortSignal, resolver?: DsmmLlmRouteResolver): Promise<{
|
|
36
|
+
route: DsmmModelRoute;
|
|
37
|
+
requestedRoute: DsmmModelRoute;
|
|
38
|
+
}>;
|
|
33
39
|
export declare function roleRouteLock(agent: DshAgent, identity: string): RoleRouteLock | undefined;
|
|
34
|
-
export declare function pinRoleRoute(agent: DshAgent, identity: string, route: DsmmModelRoute, candidates: readonly DsmmModelRoute[]
|
|
40
|
+
export declare function pinRoleRoute(agent: DshAgent, identity: string, route: DsmmModelRoute, candidates: readonly DsmmModelRoute[], projection?: {
|
|
41
|
+
preserveCandidates: boolean;
|
|
42
|
+
initialCandidate?: DsmmModelRoute;
|
|
43
|
+
}): RoleRouteLock;
|
|
35
44
|
export declare function clearRoleRouteLock(agent: DshAgent): void;
|
|
36
45
|
export declare function roleRouteRuntimeState(agent: DshAgent, settings: DsmmSettings, role: DsmmRoleId | undefined, epoch?: string): DsmmRoleRuntimeState;
|
|
37
46
|
export declare function rolePolicyIdentity(settings: DsmmSettings, role: DsmmRoleId | undefined, epoch?: string): string | undefined;
|
package/lib/role-routing.js
CHANGED
|
@@ -5,6 +5,8 @@ import { isDsmmRoleId } from "./roles.js";
|
|
|
5
5
|
import { isCurrentRecoveryStep } from "./recovery-policy.js";
|
|
6
6
|
import { childOwnedSessionEvents, sessionEvents } from "./session-scope.js";
|
|
7
7
|
import { resolveRoleRuntimePolicy } from "./routing-policy.js";
|
|
8
|
+
import { canonicalModelRouteJson, normalizeModelRouteJson, sameModelRouteJson } from "./route-json.js";
|
|
9
|
+
import { DsmmMissingProviderError, modelRouteFromHeader, modelRouteToCall } from "./role-llm.js";
|
|
8
10
|
const admittedRecoveryRoutes = new WeakMap();
|
|
9
11
|
const routeLocks = new WeakMap();
|
|
10
12
|
const agentEntries = new WeakMap();
|
|
@@ -25,38 +27,47 @@ export function latestNativeModelSelection(agent) {
|
|
|
25
27
|
return selected;
|
|
26
28
|
}
|
|
27
29
|
export function sameExactModelRoute(left, right) {
|
|
28
|
-
return
|
|
30
|
+
return sameModelRouteJson(left, right);
|
|
29
31
|
}
|
|
30
32
|
/** Consumed user intent stays explicit on cold resume and profile re-admission. */
|
|
31
33
|
export function nativeModelSelectionWasAccepted(agent, intent) {
|
|
32
34
|
return policyEvents({ agent }).some((event) => event.type === "request/header" && "seq" in event
|
|
33
35
|
&& typeof event.seq === "number" && event.seq > intent.seq && isRecord(event.data)
|
|
34
36
|
&& isRecord(event.data.header) && isRecord(event.data.header.config)
|
|
35
|
-
&&
|
|
37
|
+
&& sameModelRoute(event.data.header.config, intent.route)
|
|
38
|
+
&& modelRouteFromHeader(event.data.header).reasoningEffort === intent.route.reasoningEffort);
|
|
36
39
|
}
|
|
37
40
|
/** Only native, machine-routable absence authorizes initial candidate admission. */
|
|
38
41
|
export function isUnavailableRouteFailure(error, nativeRequestFailure = false) {
|
|
39
42
|
return isRecord(error) && (error.status === undefined || error.status === 503)
|
|
40
|
-
&& (error
|
|
43
|
+
&& (error instanceof DsmmMissingProviderError || (error.code === "UNKNOWN_MODEL" && (nativeRequestFailure || error instanceof LlmError)));
|
|
41
44
|
}
|
|
42
45
|
export function orderedModelRoutes(candidates) {
|
|
43
46
|
const routes = [];
|
|
44
47
|
for (const route of candidates)
|
|
45
|
-
if (!routes.some((previous) =>
|
|
48
|
+
if (!routes.some((previous) => sameExactModelRoute(previous, route)))
|
|
46
49
|
routes.push(canonicalRoute(route));
|
|
47
50
|
return routes;
|
|
48
51
|
}
|
|
49
52
|
/** Exact metadata preparation, never a completion or advisory catalog health check. */
|
|
50
|
-
export async function selectInitialModelRoute(llm, candidates, signal) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
export async function selectInitialModelRoute(llm, candidates, signal, resolver) {
|
|
54
|
+
return (await selectInitialModelRouteChoice(llm, candidates, signal, resolver)).route;
|
|
55
|
+
}
|
|
56
|
+
export async function selectInitialModelRouteChoice(llm, candidates, signal, resolver) {
|
|
57
|
+
if (resolver === undefined && llm.resolveCallConfig === undefined)
|
|
58
|
+
throw new Error("dsmm route admission requires the Host model service");
|
|
53
59
|
let unavailable;
|
|
54
60
|
for (const route of orderedModelRoutes(candidates)) {
|
|
55
61
|
signal?.throwIfAborted();
|
|
56
62
|
try {
|
|
57
|
-
|
|
63
|
+
if (resolver === undefined && llm.listProviders !== undefined && !llm.listProviders().some(provider => provider.id === route.provider))
|
|
64
|
+
throw new DsmmMissingProviderError();
|
|
65
|
+
const call = modelRouteToCall(route);
|
|
66
|
+
const prepared = resolver === undefined ? await llm.resolveCallConfig(call, signal) : await resolver.resolveRoute(route, signal);
|
|
67
|
+
if (resolver === undefined && call.customParameters !== undefined)
|
|
68
|
+
throw new LlmError("Raw route parameters require their declared Host provider owner", "UNSUPPORTED_ROUTE_PARAMETERS");
|
|
58
69
|
signal?.throwIfAborted();
|
|
59
|
-
return {
|
|
70
|
+
return { route: canonicalRoute(prepared), requestedRoute: canonicalRoute(route) };
|
|
60
71
|
}
|
|
61
72
|
catch (error) {
|
|
62
73
|
signal?.throwIfAborted();
|
|
@@ -71,8 +82,10 @@ export function roleRouteLock(agent, identity) {
|
|
|
71
82
|
const lock = routeLocks.get(agent);
|
|
72
83
|
return lock?.identity === identity ? lock : undefined;
|
|
73
84
|
}
|
|
74
|
-
export function pinRoleRoute(agent, identity, route, candidates) {
|
|
75
|
-
const
|
|
85
|
+
export function pinRoleRoute(agent, identity, route, candidates, projection) {
|
|
86
|
+
const ordered = projection?.preserveCandidates ? candidates.map(canonicalRoute) : orderedModelRoutes(candidates);
|
|
87
|
+
const lock = { identity, route: canonicalRoute(route), candidates: ordered,
|
|
88
|
+
candidateIndex: ordered.findIndex(candidate => sameExactModelRoute(candidate, projection?.initialCandidate ?? route)), generation: 0,
|
|
76
89
|
attempts: 0, startupSettled: false, retries: 0, rateLimits: 0, switches: 0, totalDelayMs: 0 };
|
|
77
90
|
routeLocks.set(agent, lock);
|
|
78
91
|
return lock;
|
|
@@ -91,9 +104,19 @@ export function rolePolicyIdentity(settings, role, epoch) {
|
|
|
91
104
|
return undefined;
|
|
92
105
|
const policy = settings.roleRouting[role];
|
|
93
106
|
const resolved = resolveRoleRuntimePolicy(settings, role);
|
|
107
|
+
const legacy = [policy?.primary, ...resolved.fallbackRoutes].every(route => route === undefined
|
|
108
|
+
|| Object.keys(route).every(key => ["provider", "model", "reasoningEffort"].includes(key)));
|
|
109
|
+
const seen = new Set(policy?.primary === undefined ? [] : [JSON.stringify([policy.primary.provider, policy.primary.model])]);
|
|
110
|
+
const identityFallbacks = legacy ? resolved.fallbackRoutes.filter(route => {
|
|
111
|
+
const key = JSON.stringify([route.provider, route.model]);
|
|
112
|
+
if (seen.has(key))
|
|
113
|
+
return false;
|
|
114
|
+
seen.add(key);
|
|
115
|
+
return true;
|
|
116
|
+
}) : resolved.fallbackRoutes;
|
|
94
117
|
return createHash("sha256").update(JSON.stringify({
|
|
95
118
|
version: 2, role, epoch: epoch ?? null, primary: policy?.primary === undefined ? null : canonicalRoute(policy.primary),
|
|
96
|
-
fallbackSource: resolved.fallbackSource, fallbackRoutes:
|
|
119
|
+
fallbackSource: resolved.fallbackSource, fallbackRoutes: identityFallbacks.map(canonicalRoute),
|
|
97
120
|
strategy: resolved.strategy, rateLimit: resolved.rateLimit
|
|
98
121
|
})).digest("hex");
|
|
99
122
|
}
|
|
@@ -107,7 +130,10 @@ export function liveRolePolicyIdentity(agent, settings, role, epoch) {
|
|
|
107
130
|
return rolePolicyIdentity(settings, role, `${epoch ?? "unscoped"}:${entry}`);
|
|
108
131
|
}
|
|
109
132
|
function canonicalRoute(route) {
|
|
110
|
-
|
|
133
|
+
if (Object.keys(route).every(key => ["provider", "model", "reasoningEffort"].includes(key))) {
|
|
134
|
+
return { provider: route.provider, model: route.model, ...(route.reasoningEffort === undefined ? {} : { reasoningEffort: route.reasoningEffort }) };
|
|
135
|
+
}
|
|
136
|
+
return normalizeModelRouteJson(JSON.parse(canonicalModelRouteJson(route)));
|
|
111
137
|
}
|
|
112
138
|
function policyEvents(frame) {
|
|
113
139
|
const session = frame.agent.session;
|
|
@@ -170,8 +196,7 @@ export function effectiveRoleFallbackRoutes(settings, role) {
|
|
|
170
196
|
return resolveRoleRuntimePolicy(settings, role).fallbackRoutes;
|
|
171
197
|
}
|
|
172
198
|
export function applyModelRoute(config, route) {
|
|
173
|
-
|
|
174
|
-
return { ...preserved, ...route };
|
|
199
|
+
return modelRouteToCall(route);
|
|
175
200
|
}
|
|
176
201
|
export function sameModelRoute(left, right) {
|
|
177
202
|
return left.provider === right.provider && left.model === right.model;
|
|
@@ -199,21 +224,13 @@ export function persistedRoleRoute(frame, primary, fallbacks = [], identity) {
|
|
|
199
224
|
if (typeof config?.provider !== "string" || config.provider.trim() === ""
|
|
200
225
|
|| typeof config.model !== "string" || config.model.trim() === "")
|
|
201
226
|
continue;
|
|
202
|
-
selected =
|
|
203
|
-
provider: config.provider, model: config.model,
|
|
204
|
-
...(typeof config.reasoningEffort === "string" && !adapterDefaultEffort(header) ? { reasoningEffort: config.reasoningEffort } : {})
|
|
205
|
-
};
|
|
227
|
+
selected = modelRouteFromHeader(header);
|
|
206
228
|
}
|
|
207
229
|
// A configured fallback remains exact after its adapter/default header is
|
|
208
230
|
// persisted. A later non-chain durable host route remains host-owned instead.
|
|
209
|
-
return selected === undefined ? undefined : [primary, ...fallbacks].find((route) => route !== undefined &&
|
|
231
|
+
return selected === undefined ? undefined : [primary, ...fallbacks].find((route) => route !== undefined && sameExactModelRoute(route, selected)) ?? selected;
|
|
210
232
|
}
|
|
211
233
|
function isRecord(value) {
|
|
212
234
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
213
235
|
}
|
|
214
|
-
function adapterDefaultEffort(header) {
|
|
215
|
-
if (!("adapterDefaults" in header) || typeof header.adapterDefaults !== "object" || header.adapterDefaults === null)
|
|
216
|
-
return false;
|
|
217
|
-
return "reasoningEffort" in header.adapterDefaults && header.adapterDefaults.reasoningEffort === true;
|
|
218
|
-
}
|
|
219
236
|
//# sourceMappingURL=role-routing.js.map
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
import type { Agent } from "@deepseek-ai/dsh-agent";
|
|
3
|
+
import type { ContentBlock, ToolCallId } from "@deepseek-ai/dsh-llm";
|
|
4
|
+
import type { SessionId } from "@deepseek-ai/dsh-session";
|
|
5
|
+
import type { SubagentActivation } from "@deepseek-ai/dsh-subagent";
|
|
6
|
+
import type { JobRegistry } from "@deepseek-ai/dsh-jobs";
|
|
7
|
+
declare module "@deepseek-ai/dsh-jobs/view" {
|
|
8
|
+
interface JobKindMap {
|
|
9
|
+
subagent: "subagent";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export type RoleRunState = "starting" | "running" | "background" | "settled" | "cancelled";
|
|
13
|
+
export type RoleRunJobId = ReturnType<JobRegistry["start"]>;
|
|
14
|
+
export interface RoleRunAddress {
|
|
15
|
+
readonly sessionId: SessionId;
|
|
16
|
+
readonly toolCallId: ToolCallId;
|
|
17
|
+
/** Public role-run address is the activation childId, never lifecycle-event runId. */
|
|
18
|
+
readonly runId: SubagentActivation["childId"];
|
|
19
|
+
}
|
|
20
|
+
/** Host-only identity. Capture/projection are the borrowed original admitted objects. */
|
|
21
|
+
export interface RoleRunInvocation<C = unknown, P = unknown> extends RoleRunAddress {
|
|
22
|
+
readonly parent: Agent;
|
|
23
|
+
readonly owner: object;
|
|
24
|
+
readonly admissionEpoch: string;
|
|
25
|
+
readonly capture: C;
|
|
26
|
+
readonly projection: P;
|
|
27
|
+
readonly mode: "one-shot";
|
|
28
|
+
readonly childId?: SessionId;
|
|
29
|
+
}
|
|
30
|
+
export interface RoleRunForeground<C = unknown, P = unknown> {
|
|
31
|
+
readonly kind: "foreground";
|
|
32
|
+
readonly runId: SubagentActivation["childId"];
|
|
33
|
+
readonly invocation: RoleRunInvocation<C, P>;
|
|
34
|
+
readonly output: readonly ContentBlock[];
|
|
35
|
+
}
|
|
36
|
+
export interface RoleRunBackground<C = unknown, P = unknown> {
|
|
37
|
+
readonly kind: "background";
|
|
38
|
+
readonly jobId: RoleRunJobId;
|
|
39
|
+
readonly invocation: RoleRunInvocation<C, P>;
|
|
40
|
+
}
|
|
41
|
+
export type RoleRunTransition<C = unknown, P = unknown> = {
|
|
42
|
+
readonly status: "background" | "already-background";
|
|
43
|
+
readonly receipt: RoleRunBackground<C, P>;
|
|
44
|
+
} | {
|
|
45
|
+
readonly status: "already-settled" | "starting" | "cancelled";
|
|
46
|
+
};
|
|
47
|
+
export interface RoleRunBackgroundRequest extends RoleRunAddress {
|
|
48
|
+
readonly parent: Agent;
|
|
49
|
+
readonly owner: object;
|
|
50
|
+
readonly expectedAdmissionEpoch: string;
|
|
51
|
+
}
|
|
52
|
+
export interface RoleRunTeardown {
|
|
53
|
+
/** Supply the stable Host authority's revokeParent, never an epoch-only abort. */
|
|
54
|
+
revokeParent(agent: Agent, reason: string): void;
|
|
55
|
+
/** Invoke the exact activation disposer, whose runtime boundary revokes its tree. */
|
|
56
|
+
disposeRun(run: SubagentActivation): Promise<void>;
|
|
57
|
+
}
|
|
58
|
+
export interface RoleRunCollaborators<C = unknown, P = unknown> {
|
|
59
|
+
/** Synchronous exact-parent/entry-owner check plus the current stable epoch. */
|
|
60
|
+
currentEpoch(parent: Agent, owner: object): string;
|
|
61
|
+
/** Trusted admission/operator adapter; no UI/RPC protocol is synthesized here. */
|
|
62
|
+
canBackground(parent: Agent, identity: RoleRunInvocation<C, P>, currentEpoch: string): boolean;
|
|
63
|
+
readonly teardown: RoleRunTeardown;
|
|
64
|
+
}
|
|
65
|
+
export interface RoleRunStart<C = unknown, P = unknown> {
|
|
66
|
+
readonly parent: Agent;
|
|
67
|
+
readonly owner: object;
|
|
68
|
+
readonly sessionId: SessionId;
|
|
69
|
+
readonly toolCallId: ToolCallId;
|
|
70
|
+
readonly admissionEpoch: string;
|
|
71
|
+
readonly capture: C;
|
|
72
|
+
readonly projection: P;
|
|
73
|
+
readonly label: string;
|
|
74
|
+
readonly callerAbort: AbortSignal;
|
|
75
|
+
readonly jobs?: JobRegistry;
|
|
76
|
+
/** Call native startActivation exactly once, forwarding this holder signal. */
|
|
77
|
+
start(signal: AbortSignal): Promise<SubagentActivation>;
|
|
78
|
+
}
|
|
79
|
+
/** One foreground call's real native run and its revocable caller-cancel relay. */
|
|
80
|
+
export declare class RoleRunHolder<C = unknown, P = unknown> {
|
|
81
|
+
private readonly controller;
|
|
82
|
+
private readonly readyResult;
|
|
83
|
+
private readonly foregroundResult;
|
|
84
|
+
private readonly drainedResult;
|
|
85
|
+
private currentState;
|
|
86
|
+
private identity?;
|
|
87
|
+
private receipt?;
|
|
88
|
+
private outcome?;
|
|
89
|
+
private disposeActivation?;
|
|
90
|
+
private terminal;
|
|
91
|
+
private finished;
|
|
92
|
+
private registering;
|
|
93
|
+
private committing;
|
|
94
|
+
private detachParent;
|
|
95
|
+
private readonly callerRelay;
|
|
96
|
+
readonly ready: Promise<RoleRunInvocation<C, P>>;
|
|
97
|
+
readonly foreground: Promise<RoleRunBackground<C, P> | RoleRunForeground<C, P>>;
|
|
98
|
+
/** Quiescence, preserving typed result and aggregate cleanup errors even in background. */
|
|
99
|
+
readonly drained: Promise<void>;
|
|
100
|
+
private readonly request;
|
|
101
|
+
private readonly collaborators;
|
|
102
|
+
private readonly release;
|
|
103
|
+
constructor(request: RoleRunStart<C, P>, collaborators: RoleRunCollaborators<C, P>, release: () => void);
|
|
104
|
+
get state(): RoleRunState;
|
|
105
|
+
get owner(): object;
|
|
106
|
+
get sessionId(): SessionId;
|
|
107
|
+
get toolCallId(): ToolCallId;
|
|
108
|
+
get invocation(): RoleRunInvocation<C, P> | undefined;
|
|
109
|
+
get holderSignal(): AbortSignal;
|
|
110
|
+
cancel(reason?: unknown): void;
|
|
111
|
+
background(request: RoleRunBackgroundRequest): RoleRunTransition<C, P>;
|
|
112
|
+
private assertAddress;
|
|
113
|
+
private assertAuthorization;
|
|
114
|
+
private begin;
|
|
115
|
+
private observed;
|
|
116
|
+
}
|
|
117
|
+
/** Current process-local calls only; native jobs remain the sole background registry. */
|
|
118
|
+
export declare class RoleRunRegistry<C = unknown, P = unknown> {
|
|
119
|
+
private readonly calls;
|
|
120
|
+
private closed;
|
|
121
|
+
private readonly collaborators;
|
|
122
|
+
/** ctx is the stable Host-owned scope, not a reinstalled profile entry. */
|
|
123
|
+
constructor(ctx: Context, collaborators: RoleRunCollaborators<C, P>);
|
|
124
|
+
start(request: RoleRunStart<C, P>): RoleRunHolder<C, P>;
|
|
125
|
+
/** Host-only lookup; C3 must authorize operator/session/epoch before exposing a view. */
|
|
126
|
+
get(parent: Agent, owner: object, address: RoleRunAddress): RoleRunHolder<C, P> | undefined;
|
|
127
|
+
/** Host-only active-call inventory, including starting calls without invented run ids. */
|
|
128
|
+
list(parent: Agent, owner: object): readonly RoleRunHolder<C, P>[];
|
|
129
|
+
/**
|
|
130
|
+
* Trusted parent teardown first revokes C1 authority, then awaits this before
|
|
131
|
+
* the original AgentHandle.dispose. Already-revoked tickets are not reacquired.
|
|
132
|
+
*/
|
|
133
|
+
drainParent(parent: Agent, owner: object, reason: string): Promise<void>;
|
|
134
|
+
close(reason: string): void;
|
|
135
|
+
drain(): Promise<void>;
|
|
136
|
+
private awaitHolders;
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=role-runs.d.ts.map
|