@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/runtime-recovery.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { createUserMessage, expandAssistantStream } from "@deepseek-ai/dsh-llm";
|
|
2
2
|
import { foldDurableRecoveryWork, isCurrentRecoveryStep } from "./recovery-policy.js";
|
|
3
3
|
import { isDsmmRoleId } from "./roles.js";
|
|
4
|
-
import { applyModelRoute, isUnavailableRouteFailure, latestNativeModelSelection, liveRolePolicyIdentity, recordAdmittedRecoveryRoute, roleRouteLock,
|
|
4
|
+
import { applyModelRoute, isUnavailableRouteFailure, latestNativeModelSelection, liveRolePolicyIdentity, recordAdmittedRecoveryRoute, roleRouteLock, sameExactModelRoute, selectInitialModelRouteChoice } from "./role-routing.js";
|
|
5
|
+
import { modelRouteFromCall, modelRouteFromHeader, projectModelRouteParameters } from "./role-llm.js";
|
|
5
6
|
import { childOwnedSessionEvents, resolveSelectedAgentPreset, sessionEvents } from "./session-scope.js";
|
|
6
7
|
import { resolveAdmittedDsmmRole as resolveEffectiveDsmmRole } from "./role-policy.js";
|
|
7
8
|
import { resolveRoleRuntimePolicy } from "./routing-policy.js";
|
|
9
|
+
import { configuredModelParameterPolicy, resolvedModelParameterPolicy } from "./model-parameter-policy.js";
|
|
8
10
|
const installedContexts = new WeakSet();
|
|
9
11
|
const RECOVERY_WARNING = "dsmm runtime recovery refused an unproven or exhausted retry";
|
|
10
12
|
const CONTINUATION_WARNING = "dsmm runtime recovery continuation steering failed for turn";
|
|
@@ -115,7 +117,7 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
115
117
|
}
|
|
116
118
|
const previous = attemptsByAgent.get(agent);
|
|
117
119
|
const attempt = { id: frame.attemptId, turn: frame.turn, step: frame.step, revision: frame.revision, chunks: 0,
|
|
118
|
-
route:
|
|
120
|
+
route: modelRouteFromHeader(header), header, policy, generation: lock?.generation, manualSelectionSeq: lock?.manualSelectionSeq,
|
|
119
121
|
valid: Number.isSafeInteger(frame.revision) && frame.revision >= 1 && (previous === undefined || frame.revision === previous.revision + 1), output: false, consumed: false };
|
|
120
122
|
attemptsByAgent.set(agent, attempt);
|
|
121
123
|
if (lock !== undefined)
|
|
@@ -177,10 +179,10 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
177
179
|
return downstream;
|
|
178
180
|
}
|
|
179
181
|
}
|
|
180
|
-
const accepted = frame.agent.session.requestHeader?.()
|
|
182
|
+
const accepted = frame.agent.session.requestHeader?.();
|
|
181
183
|
const lock = pending.policy === undefined ? undefined : roleRouteLock(frame.agent, pending.policy);
|
|
182
184
|
if (!active || lock === undefined || lock.generation !== pending.generation || attemptsByAgent.get(frame.agent) !== pending.attempt
|
|
183
|
-
|| accepted === undefined || !
|
|
185
|
+
|| accepted === undefined || !sameExactModelRoute(modelRouteFromHeader(accepted), pending.failedRoute)) {
|
|
184
186
|
pendingByAgent.delete(frame.agent);
|
|
185
187
|
return downstream;
|
|
186
188
|
}
|
|
@@ -215,7 +217,7 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
215
217
|
const attempt = attemptsByAgent.get(frame.agent);
|
|
216
218
|
const header = frame.agent.session.requestHeader?.();
|
|
217
219
|
if (!active || frame.signal.aborted || lock === undefined || header === undefined
|
|
218
|
-
|| header.config.provider !== frame.provider || !
|
|
220
|
+
|| header.config.provider !== frame.provider || !sameExactModelRoute(modelRouteFromHeader(header), lock.route)
|
|
219
221
|
|| attempt === undefined || attempt.policy !== policy || attempt.generation !== lock.generation
|
|
220
222
|
|| latestNativeModelSelection(frame.agent)?.seq !== attempt.manualSelectionSeq
|
|
221
223
|
|| !isCurrentRecoveryStep(recoveryEvents(frame.agent), frame.turn, frame.step) || !positiveNoOutput(frame, attempt))
|
|
@@ -224,6 +226,7 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
224
226
|
const resolved = resolveRoleRuntimePolicy(settings, role);
|
|
225
227
|
const bounds = resolved.rateLimit;
|
|
226
228
|
let route = lock.route;
|
|
229
|
+
let candidateIndex = lock.candidateIndex;
|
|
227
230
|
let switching = false;
|
|
228
231
|
if (unavailable) {
|
|
229
232
|
if (lock.startupSettled || lock.attempts !== 1)
|
|
@@ -241,12 +244,18 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
241
244
|
if (switching) {
|
|
242
245
|
if (!unavailable && lock.switches >= bounds.maxSwitches)
|
|
243
246
|
return undefined;
|
|
244
|
-
const index = lock.
|
|
247
|
+
const index = lock.candidateIndex;
|
|
245
248
|
const candidates = lock.candidates.slice(index + 1);
|
|
246
249
|
if (index < 0 || candidates.length === 0)
|
|
247
250
|
return undefined;
|
|
248
251
|
const llm = frame.agent.ctx?.get?.("llm") ?? ctx.get?.("llm") ?? ctx.llm;
|
|
249
|
-
|
|
252
|
+
const admission = getSettings.admission?.(frame.agent);
|
|
253
|
+
const parameterPolicy = admission === undefined ? configuredModelParameterPolicy(settings) : resolvedModelParameterPolicy(admission);
|
|
254
|
+
const selected = await selectInitialModelRouteChoice(llm ?? {}, candidates, frame.signal, parameterPolicy.mode === "passthrough" ? ctx.get?.("dsmmLlmRoutes") : undefined);
|
|
255
|
+
route = parameterPolicy.mode === "native-defaults"
|
|
256
|
+
? modelRouteFromCall(projectModelRouteParameters(selected.route, selected.requestedRoute.reasoningEffort === undefined ? "dsmm-config" : "native", false))
|
|
257
|
+
: selected.route;
|
|
258
|
+
candidateIndex = index + 1 + candidates.findIndex(candidate => sameExactModelRoute(candidate, selected.requestedRoute));
|
|
250
259
|
}
|
|
251
260
|
const serverMinimum = frame.failure.providerRetryAfterMs;
|
|
252
261
|
if (serverMinimum !== undefined && (!Number.isSafeInteger(serverMinimum) || serverMinimum < 0))
|
|
@@ -281,9 +290,10 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
281
290
|
|| attemptsByAgent.get(frame.agent) !== attempt || !isCurrentRecoveryStep(recoveryEvents(frame.agent), frame.turn, frame.step)
|
|
282
291
|
|| latestNativeModelSelection(frame.agent)?.seq !== attempt.manualSelectionSeq
|
|
283
292
|
|| !positiveNoOutput(frame, attempt, true)
|
|
284
|
-
|| !
|
|
293
|
+
|| !sameExactModelRoute(modelRouteFromHeader(frame.agent.session.requestHeader?.()), attempt.route))
|
|
285
294
|
return undefined;
|
|
286
295
|
if (switching) {
|
|
296
|
+
lock.candidateIndex = candidateIndex;
|
|
287
297
|
lock.generation += 1;
|
|
288
298
|
if (!unavailable)
|
|
289
299
|
lock.switches += 1;
|
|
@@ -2,6 +2,7 @@ import { Context, Service } from "@deepseek-ai/cordis";
|
|
|
2
2
|
import type { SessionHeader, SessionId } from "@deepseek-ai/dsh-session";
|
|
3
3
|
import { SessionPersistence } from "@deepseek-ai/dsh-session-persistence";
|
|
4
4
|
import type { SessionAccess, SessionHandle, SessionPersistenceCreateOptions, SessionPersistenceListOptions, SessionPersistenceOpenOptions, SessionPersistenceStatOptions } from "@deepseek-ai/dsh-session-persistence";
|
|
5
|
+
import * as JsonlSessionPersistence from "@deepseek-ai/dsh-session-persistence-jsonl";
|
|
5
6
|
import type { Config } from "@deepseek-ai/dsh-session-persistence-jsonl";
|
|
6
7
|
export { DSMM_PERSISTENCE_COMPATIBILITY } from "./session-metadata.js";
|
|
7
8
|
export type { Config } from "@deepseek-ai/dsh-session-persistence-jsonl";
|
|
@@ -12,7 +13,7 @@ export type { Config } from "@deepseek-ai/dsh-session-persistence-jsonl";
|
|
|
12
13
|
*/
|
|
13
14
|
export default class DsmmSessionPersistence extends SessionPersistence {
|
|
14
15
|
readonly config: Config;
|
|
15
|
-
static Config: import("@deepseek-ai/schemastery").default<Config>;
|
|
16
|
+
static Config: import("@deepseek-ai/schemastery").default<JsonlSessionPersistence.Config>;
|
|
16
17
|
readonly name = "dsmm-session-persistence";
|
|
17
18
|
private readonly inner;
|
|
18
19
|
private readonly ready;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, Service } from "@deepseek-ai/cordis";
|
|
2
2
|
import { SessionHandleClosedError, SessionPersistence, SessionReadOnlyError, materializeAppendBatch } from "@deepseek-ai/dsh-session-persistence";
|
|
3
|
-
import JsonlSessionPersistence from "@deepseek-ai/dsh-session-persistence-jsonl";
|
|
3
|
+
import * as JsonlSessionPersistence from "@deepseek-ai/dsh-session-persistence-jsonl";
|
|
4
4
|
import { isDeepStrictEqual } from "node:util";
|
|
5
5
|
import { annotateDsmmEvent, DSMM_PERSISTENCE_COMPATIBILITY } from "./session-metadata.js";
|
|
6
6
|
export { DSMM_PERSISTENCE_COMPATIBILITY } from "./session-metadata.js";
|
package/lib/session-scope.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { foldSubagentDescriptor } from "@deepseek-ai/dsh-subagent";
|
|
2
2
|
import { isDsmmRoleId } from "./roles.js";
|
|
3
3
|
import { roleFromProviderName } from "./role-providers.js";
|
|
4
|
+
import { capturedRoleInvocation } from "./role-invocation.js";
|
|
4
5
|
export function sessionEvents(session) {
|
|
5
6
|
return session?.snapshotEvents?.() ?? session?.events ?? [];
|
|
6
7
|
}
|
|
@@ -31,7 +32,9 @@ export function resolveEffectiveDsmmRole(agent, settings, modeActive) {
|
|
|
31
32
|
if (agent.session.header?.origin === "subagent") {
|
|
32
33
|
const own = childOwnedSessionEvents(agent.session);
|
|
33
34
|
const descriptor = foldSubagentDescriptor(own);
|
|
34
|
-
|
|
35
|
+
// Native lifecycle mode does not determine an exact Agent's admitted DSMM role.
|
|
36
|
+
role = capturedRoleInvocation(agent)?.target
|
|
37
|
+
?? (descriptor?.mode === "one-shot" ? roleFromProviderName(descriptor.provider) : undefined);
|
|
35
38
|
}
|
|
36
39
|
else {
|
|
37
40
|
const preset = resolveSelectedAgentPreset(agent.session);
|
package/lib/settings.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ import type { DsmmRoleId } from "./roles.js";
|
|
|
5
5
|
import type { DsmmSkillName } from "./skills.js";
|
|
6
6
|
import type { DsmmRateLimitPolicy, DsmmRoutingStrategy, DsmmRuntimePolicyConfig, DsmmRuntimePolicySettings } from "./routing-policy.js";
|
|
7
7
|
import type { DeploymentSchemaNode } from "./profile-types.js";
|
|
8
|
+
import type { DsmmLocale } from "./profile-locale.js";
|
|
9
|
+
import type { ModelRouteJson } from "./route-json.js";
|
|
10
|
+
import type { PermissionControlSchemaInput, PermissionControlSettings } from "./permission-settings.js";
|
|
11
|
+
export { DSMM_LOCALES } from "./profile-locale.js";
|
|
12
|
+
export type { DsmmLocale } from "./profile-locale.js";
|
|
8
13
|
export type { DsmmRateLimitPolicy, DsmmRoutingStrategy, DsmmRuntimePolicyConfig, DsmmRuntimePolicySettings } from "./routing-policy.js";
|
|
9
14
|
export { resolveRoleRuntimePolicy } from "./routing-policy.js";
|
|
10
15
|
export { DSMM_SKILL_NAMES, MVP_SKILL_NAMES } from "./skills.js";
|
|
@@ -14,6 +19,17 @@ export type DeepseekDefaultReasoningEffort = "off" | "low" | "high";
|
|
|
14
19
|
export type DsmmFinalReviewPolicy = "simple-oracle-complex-reviewer" | "reviewer-only" | "off";
|
|
15
20
|
export type DsmmGuardScope = "deepwork-or-dsmm-agent" | "always" | "off";
|
|
16
21
|
export type DsmmGitWritePolicy = "ask" | "deny" | "off";
|
|
22
|
+
export type DsmmInvocationLevel = "normal" | "low" | "high" | "max";
|
|
23
|
+
export type DsmmLevelOverride = {
|
|
24
|
+
reasoningEffort: string;
|
|
25
|
+
provider?: never;
|
|
26
|
+
model?: never;
|
|
27
|
+
} | DsmmModelRoute;
|
|
28
|
+
export interface DsmmInvocationOptions {
|
|
29
|
+
level?: DsmmInvocationLevel;
|
|
30
|
+
route?: DsmmLevelOverride;
|
|
31
|
+
}
|
|
32
|
+
export type DsmmToolTopology = "per-role" | "parameterized";
|
|
17
33
|
export interface DsmmWorkflowSettings {
|
|
18
34
|
policy: "risk-based" | "legacy";
|
|
19
35
|
strictGates: boolean;
|
|
@@ -22,9 +38,13 @@ export interface DsmmWorkflowSettings {
|
|
|
22
38
|
}
|
|
23
39
|
export interface DsmmPresetSettings {
|
|
24
40
|
materialize: boolean;
|
|
41
|
+
/** Startup-pinned root exposure only; workflow Planner delegation stays enabled. */
|
|
42
|
+
plannerRootEnabled: boolean;
|
|
25
43
|
root?: string;
|
|
26
44
|
}
|
|
27
45
|
export interface DsmmSubagentSettings {
|
|
46
|
+
toolTopology: DsmmToolTopology;
|
|
47
|
+
allowRouteOverride: boolean;
|
|
28
48
|
enableRunInBackground: boolean;
|
|
29
49
|
backgroundMode: "one-shot" | "continuable";
|
|
30
50
|
/** Omitted delegates to the native host limit (rc.2 default 1). */
|
|
@@ -45,14 +65,10 @@ export interface DsmmGuardSettings {
|
|
|
45
65
|
};
|
|
46
66
|
todoDisciplineHelper: boolean;
|
|
47
67
|
}
|
|
48
|
-
export
|
|
49
|
-
|
|
50
|
-
model: string;
|
|
51
|
-
reasoningEffort?: string;
|
|
52
|
-
}
|
|
53
|
-
export interface DsmmRecoveryRoute extends DsmmModelRoute {
|
|
54
|
-
}
|
|
68
|
+
export type DsmmModelRoute = ModelRouteJson;
|
|
69
|
+
export type DsmmRecoveryRoute = DsmmModelRoute;
|
|
55
70
|
export interface DsmmRoleRoutingConfig {
|
|
71
|
+
levels?: Partial<Record<Exclude<DsmmInvocationLevel, "normal">, DsmmLevelOverride>>;
|
|
56
72
|
primary?: DsmmModelRoute;
|
|
57
73
|
fallbackRoutes?: DsmmModelRoute[];
|
|
58
74
|
strategy?: DsmmRoutingStrategy;
|
|
@@ -76,10 +92,16 @@ type DsmmGuardConfig = Partial<Omit<DsmmGuardSettings, "toolOutputTruncation" |
|
|
|
76
92
|
questionLabelHelper?: Partial<DsmmGuardSettings["questionLabelHelper"]>;
|
|
77
93
|
};
|
|
78
94
|
type DsmmRuntimeRecoveryConfig = Partial<Omit<DsmmRuntimeRecoverySettings, "fallbackRoutes" | "idleContinuation">> & {
|
|
79
|
-
fallbackRoutes?:
|
|
95
|
+
fallbackRoutes?: DsmmRecoveryRoute[];
|
|
80
96
|
idleContinuation?: Partial<DsmmRuntimeRecoverySettings["idleContinuation"]>;
|
|
81
97
|
};
|
|
82
98
|
export interface DsmmPluginConfig {
|
|
99
|
+
/** Deployment-only; the mounted permission owner retains its cold-start policy. */
|
|
100
|
+
permissionControl?: PermissionControlSchemaInput;
|
|
101
|
+
modelParameters?: {
|
|
102
|
+
passthrough?: boolean;
|
|
103
|
+
};
|
|
104
|
+
locale?: DsmmLocale;
|
|
83
105
|
/** Only global deployment input; native/legacy profile transport rejects it. */
|
|
84
106
|
modules?: {
|
|
85
107
|
deepwork?: {
|
|
@@ -95,10 +117,8 @@ export interface DsmmPluginConfig {
|
|
|
95
117
|
section?: string;
|
|
96
118
|
deepseekV4ProCalibration?: DeepseekCalibration;
|
|
97
119
|
deepseekV4ProDefaultReasoningEffort?: DeepseekDefaultReasoningEffort;
|
|
98
|
-
deepseekV4ProMaxReasoningPresets?: DsmmRoleId[];
|
|
99
120
|
deepseekFlashCalibration?: DeepseekCalibration;
|
|
100
121
|
deepseekFlashDefaultReasoningEffort?: DeepseekDefaultReasoningEffort;
|
|
101
|
-
deepseekFlashMaxReasoningPresets?: DsmmRoleId[];
|
|
102
122
|
defaultActive?: boolean;
|
|
103
123
|
promptOrder?: number;
|
|
104
124
|
skills?: Partial<Record<DsmmSkillName, boolean>>;
|
|
@@ -113,6 +133,11 @@ export interface DsmmPluginConfig {
|
|
|
113
133
|
lsp?: Partial<DsmmLspSettings>;
|
|
114
134
|
}
|
|
115
135
|
export interface DsmmSettings {
|
|
136
|
+
permissionControl: PermissionControlSettings;
|
|
137
|
+
modelParameters: {
|
|
138
|
+
passthrough: boolean;
|
|
139
|
+
};
|
|
140
|
+
locale?: DsmmLocale;
|
|
116
141
|
modules: {
|
|
117
142
|
deepwork: {
|
|
118
143
|
enabled: boolean;
|
|
@@ -123,10 +148,8 @@ export interface DsmmSettings {
|
|
|
123
148
|
promptOrder: number;
|
|
124
149
|
deepseekV4ProCalibration: DeepseekCalibration;
|
|
125
150
|
deepseekV4ProDefaultReasoningEffort: DeepseekDefaultReasoningEffort;
|
|
126
|
-
deepseekV4ProMaxReasoningPresets: DsmmRoleId[];
|
|
127
151
|
deepseekFlashCalibration: DeepseekCalibration;
|
|
128
152
|
deepseekFlashDefaultReasoningEffort: DeepseekDefaultReasoningEffort;
|
|
129
|
-
deepseekFlashMaxReasoningPresets: DsmmRoleId[];
|
|
130
153
|
skills: Record<DsmmSkillName, boolean>;
|
|
131
154
|
roles: Record<DsmmRoleId, boolean>;
|
|
132
155
|
roleRouting: DsmmRoleRouting;
|
|
@@ -140,12 +163,17 @@ export interface DsmmSettings {
|
|
|
140
163
|
}
|
|
141
164
|
export type DsmmProfileScope = "global-default" | "session-override" | "deployment-baseline";
|
|
142
165
|
export interface DsmmProfileAdmission {
|
|
166
|
+
childCapture?: import("./child-capture.js").ChildAdmissionCapture;
|
|
167
|
+
childEvidence?: import("./child-capture.js").ChildAdmissionEvidenceView;
|
|
168
|
+
warnings?: import("./profile-diagnostics.js").ProfileDiagnostic[];
|
|
169
|
+
roleAvailability?: import("./profile-types.js").DsmmRoleAvailabilityState[];
|
|
170
|
+
subagentRuntime?: import("./profile-types.js").SubagentRuntimeAdmissionView;
|
|
143
171
|
settings: DsmmSettings;
|
|
144
172
|
profile: {
|
|
145
173
|
id: string;
|
|
146
174
|
revision: string;
|
|
147
175
|
} | null;
|
|
148
|
-
epoch: string;
|
|
176
|
+
readonly epoch: string;
|
|
149
177
|
scope: DsmmProfileScope;
|
|
150
178
|
deployment?: DsmmDeploymentSnapshot;
|
|
151
179
|
restartRequired?: readonly string[];
|
|
@@ -186,6 +214,7 @@ export interface DsmmDeploymentSnapshot {
|
|
|
186
214
|
export type DsmmSettingsGetter = ((agent?: DshAgent) => DsmmSettings) & {
|
|
187
215
|
admission?: (agent?: DshAgent) => DsmmProfileAdmission;
|
|
188
216
|
moduleStates?: (agent?: DshAgent) => import("./modules.js").DsmmModuleState[];
|
|
217
|
+
subagentRuntime?: () => import("./profile-types.js").SubagentRuntimeAdmissionView;
|
|
189
218
|
};
|
|
190
219
|
export interface DsmmResolvedRoleRuntimePolicy {
|
|
191
220
|
readonly strategy: DsmmRoutingStrategy;
|
|
@@ -217,8 +246,13 @@ export declare function validateDeploymentPath(path: readonly string[]): void;
|
|
|
217
246
|
export declare function mergeConfigLayers(...layers: DsmmPluginConfig[]): DsmmPluginConfig;
|
|
218
247
|
export declare function resolveDeployment(global: DsmmPluginConfig, profile: DsmmPluginConfig): DsmmSettings;
|
|
219
248
|
export declare function validateResolvedSettings(settings: DsmmSettings): DsmmSettings;
|
|
249
|
+
export declare function rejectDeprecatedFields(input: object, prefix?: string): void;
|
|
250
|
+
export declare function validateLocale(value: unknown, field?: string): asserts value is DsmmLocale;
|
|
251
|
+
export declare function normalizeLevelOverride(value: unknown, field?: string): DsmmLevelOverride;
|
|
220
252
|
export declare function resolveRoleRouting(input: DsmmRoleRouting | undefined): DsmmRoleRouting;
|
|
221
253
|
export declare function isRoleEnabled(settings: DsmmSettings, role: DsmmRoleId): boolean;
|
|
254
|
+
/** Native standing-root availability is independent of child role enablement. */
|
|
255
|
+
export declare function isRootRoleEnabled(settings: DsmmSettings, id: DsmmRoleId): boolean;
|
|
222
256
|
export declare function resolveGuardSettings(config: DsmmPluginConfig["guards"]): DsmmGuardSettings;
|
|
223
257
|
export declare function registerSettings(ctx: DshContext, config?: DsmmPluginConfig, options?: RegisterSettingsOptions): () => DsmmSettings;
|
|
224
258
|
//# sourceMappingURL=settings.d.ts.map
|