@dsmm/dsmm 0.1.4 → 0.1.6
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 +13 -12
- package/docs/compatibility.md +8 -6
- package/docs/migration-from-ocmm.md +8 -0
- package/docs/model-routing.md +22 -6
- package/docs/profiles.md +23 -9
- package/docs/releasing.md +27 -15
- package/docs/runtime-recovery.md +41 -14
- package/docs/settings-status.md +10 -8
- package/lib/client/ProfilesSection.js +7 -3
- package/lib/client/SessionProfiles.d.ts +19 -0
- package/lib/client/SessionProfiles.js +55 -0
- package/lib/client/StructuredEditor.d.ts +11 -0
- package/lib/client/StructuredEditor.js +74 -0
- package/lib/client/controller.d.ts +68 -1
- package/lib/client/controller.js +282 -11
- package/lib/client/index.d.ts +3 -1
- package/lib/client/index.js +47 -0
- package/lib/client/locales.d.ts +109 -0
- package/lib/client/locales.js +56 -2
- package/lib/client/session-labels.d.ts +8 -0
- package/lib/client/session-labels.js +13 -0
- package/lib/client/structured.d.ts +18 -0
- package/lib/client/structured.js +98 -0
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +14 -1
- package/lib/client.js +1215 -74
- package/lib/commands.js +1 -0
- package/lib/dsh-types.d.ts +16 -0
- package/lib/index.js +27 -1
- package/lib/model-routing.js +109 -23
- package/lib/profile-remote.d.ts +7 -1
- package/lib/profile-remote.js +117 -2
- package/lib/profile-rpc.d.ts +9 -1
- package/lib/profile-rpc.js +99 -2
- package/lib/profile-runtime.d.ts +25 -5
- package/lib/profile-runtime.js +193 -31
- package/lib/profile-store.d.ts +19 -1
- package/lib/profile-store.js +120 -10
- package/lib/profile-types.d.ts +43 -1
- package/lib/profiles.d.ts +1 -1
- package/lib/profiles.js +34 -2
- package/lib/role-providers.js +12 -2
- package/lib/role-routing.d.ts +37 -3
- package/lib/role-routing.js +107 -35
- package/lib/routing-policy.d.ts +32 -0
- package/lib/routing-policy.js +92 -0
- package/lib/runtime-recovery.js +216 -52
- package/lib/settings.d.ts +27 -1
- package/lib/settings.js +29 -7
- package/lib/status.d.ts +10 -2
- package/lib/status.js +36 -10
- package/package.json +8 -1
package/lib/status.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { classifyModelFamily } from "./model-family.js";
|
|
2
2
|
import { isDeepseekFlashRoute, isDeepseekV4ProRoute } from "./model-routing.js";
|
|
3
3
|
import { DSMM_ROLES, isDsmmRoleId } from "./roles.js";
|
|
4
|
-
import {
|
|
4
|
+
import { persistedRoleRoute, liveRolePolicyIdentity, roleRouteRuntimeState } from "./role-routing.js";
|
|
5
5
|
import { resolveEffectiveDsmmRole, resolveSelectedAgentPreset } from "./session-scope.js";
|
|
6
|
+
import { resolveRoleRuntimePolicy } from "./routing-policy.js";
|
|
6
7
|
export const DSMM_STATUS_VERSION = 1;
|
|
7
8
|
export function createDsmmStatusSnapshot(input) {
|
|
8
9
|
const { agent, settings, modeActive } = input;
|
|
10
|
+
const ordinaryRoot = agent.session.header?.origin !== "subagent";
|
|
9
11
|
const selectedPreset = resolveSelectedAgentPreset(agent.session);
|
|
10
12
|
const dsmmPreset = isDsmmRoleId(selectedPreset);
|
|
11
13
|
let role;
|
|
@@ -17,8 +19,11 @@ export function createDsmmStatusSnapshot(input) {
|
|
|
17
19
|
invalidDescriptor = true;
|
|
18
20
|
}
|
|
19
21
|
const inScope = modeActive || role !== undefined;
|
|
20
|
-
const policy = role === undefined ? undefined : settings.roleRouting[role];
|
|
21
|
-
const
|
|
22
|
+
const policy = ordinaryRoot || role === undefined ? undefined : settings.roleRouting[role];
|
|
23
|
+
const runtimePolicy = resolveRoleRuntimePolicy(settings, role);
|
|
24
|
+
const roleRuntimeState = input.roleRuntimeState ?? (input.admission === undefined || invalidDescriptor ? undefined
|
|
25
|
+
: roleRouteRuntimeState(agent, settings, role, input.admission.epoch));
|
|
26
|
+
const fallbacks = ordinaryRoot || invalidDescriptor ? [] : runtimePolicy.fallbackRoutes;
|
|
22
27
|
const selectedRoute = resolveRoute(agent);
|
|
23
28
|
const family = classifyModelFamily({
|
|
24
29
|
providerID: selectedRoute.provider,
|
|
@@ -30,14 +35,19 @@ export function createDsmmStatusSnapshot(input) {
|
|
|
30
35
|
const deepseekFlash = selectedRoute.provider !== undefined && selectedRoute.model !== undefined
|
|
31
36
|
&& isDeepseekFlashRoute({ provider: selectedRoute.provider, model: selectedRoute.model });
|
|
32
37
|
let acceptedRoleRoute;
|
|
33
|
-
if (
|
|
34
|
-
acceptedRoleRoute = persistedRoleRoute({ agent }, policy
|
|
38
|
+
if (!ordinaryRoot && !invalidDescriptor && role !== undefined) {
|
|
39
|
+
acceptedRoleRoute = persistedRoleRoute({ agent }, policy?.primary, fallbacks, liveRolePolicyIdentity(agent, settings, role, input.admission?.epoch));
|
|
35
40
|
}
|
|
36
41
|
const exactRouting = policy?.primary !== undefined || acceptedRoleRoute !== undefined
|
|
37
42
|
|| fallbacks.some((route) => route.reasoningEffort !== undefined && route.provider === selectedRoute.provider
|
|
38
43
|
&& route.model === selectedRoute.model && route.reasoningEffort === selectedRoute.reasoningEffort);
|
|
39
44
|
return {
|
|
40
45
|
version: DSMM_STATUS_VERSION,
|
|
46
|
+
...(input.admission === undefined ? {} : { admission: {
|
|
47
|
+
profile: input.admission.profile === null ? null : { ...input.admission.profile },
|
|
48
|
+
epoch: input.admission.epoch,
|
|
49
|
+
scope: input.admission.scope
|
|
50
|
+
} }),
|
|
41
51
|
mode: {
|
|
42
52
|
name: settings.modeName,
|
|
43
53
|
active: modeActive,
|
|
@@ -53,7 +63,10 @@ export function createDsmmStatusSnapshot(input) {
|
|
|
53
63
|
deepseekFlash,
|
|
54
64
|
...(selectedRoute.reasoningEffort === undefined ? {} : { currentReasoningEffort: selectedRoute.reasoningEffort })
|
|
55
65
|
},
|
|
56
|
-
calibration:
|
|
66
|
+
calibration: ordinaryRoot ? {
|
|
67
|
+
mode: deepseekFlash ? settings.deepseekFlashCalibration : settings.deepseekV4ProCalibration,
|
|
68
|
+
applies: false, action: "native-owned"
|
|
69
|
+
} : exactRouting ? {
|
|
57
70
|
mode: deepseekFlash ? settings.deepseekFlashCalibration : settings.deepseekV4ProCalibration,
|
|
58
71
|
applies: false, action: "fixed-role-policy"
|
|
59
72
|
} : resolveCalibration({
|
|
@@ -65,10 +78,18 @@ export function createDsmmStatusSnapshot(input) {
|
|
|
65
78
|
}),
|
|
66
79
|
rolePolicy: {
|
|
67
80
|
...(role === undefined ? {} : { role }),
|
|
68
|
-
applies:
|
|
81
|
+
applies: inScope && !invalidDescriptor,
|
|
69
82
|
...(policy?.primary === undefined ? {} : { primary: { ...policy.primary } }),
|
|
70
83
|
fallbackRoutes: fallbacks.map((route) => ({ ...route })),
|
|
71
|
-
fallbackSource:
|
|
84
|
+
fallbackSource: ordinaryRoot || invalidDescriptor ? "disabled" : runtimePolicy.fallbackSource,
|
|
85
|
+
strategy: ordinaryRoot ? "startup-lock" : runtimePolicy.strategy,
|
|
86
|
+
rateLimit: { ...runtimePolicy.rateLimit },
|
|
87
|
+
...(roleRuntimeState === undefined ? {} : { runtimeState: {
|
|
88
|
+
...roleRuntimeState,
|
|
89
|
+
...(ordinaryRoot ? { strategy: "startup-lock" } : {}),
|
|
90
|
+
rateLimit: { ...roleRuntimeState.rateLimit },
|
|
91
|
+
...(roleRuntimeState.route === undefined ? {} : { route: { ...roleRuntimeState.route } })
|
|
92
|
+
} }),
|
|
72
93
|
...(invalidDescriptor ? { diagnostic: "invalid-child-descriptor" } : {})
|
|
73
94
|
},
|
|
74
95
|
runtimeRecovery: {
|
|
@@ -102,9 +123,11 @@ export function formatDsmmStatus(snapshot) {
|
|
|
102
123
|
"Deepwork status",
|
|
103
124
|
`Mode: ${snapshot.mode.active ? "active" : "inactive"} (${snapshot.mode.name})`,
|
|
104
125
|
`Scope: ${scope}`,
|
|
126
|
+
...(snapshot.admission === undefined ? [] : [`Profile admission: ${snapshot.admission.scope}; profile=${snapshot.admission.profile?.id ?? "deployment baseline"}; epoch=${snapshot.admission.epoch}`]),
|
|
105
127
|
`Workflow policy: ${snapshot.effectiveSettings.workflow.policy}`,
|
|
106
128
|
`Route: ${provider}/${model} [${snapshot.route.family}]`,
|
|
107
|
-
`Role policy: ${displayRole(snapshot.rolePolicy.role)}; primary=${snapshot.rolePolicy.primary === undefined ? "inherit" : `${snapshot.rolePolicy.primary.provider}/${snapshot.rolePolicy.primary.model}`}; fallbacks=${snapshot.rolePolicy.fallbackSource}`,
|
|
129
|
+
`Role policy: ${displayRole(snapshot.rolePolicy.role)}; strategy=${snapshot.rolePolicy.strategy}; primary=${snapshot.rolePolicy.primary === undefined ? "inherit" : `${snapshot.rolePolicy.primary.provider}/${snapshot.rolePolicy.primary.model}`}; fallbacks=${snapshot.rolePolicy.fallbackSource}; retries=${snapshot.rolePolicy.rateLimit.maxRetries}; threshold=${snapshot.rolePolicy.rateLimit.switchAfterRateLimits}; switches=${snapshot.rolePolicy.rateLimit.maxSwitches}`,
|
|
130
|
+
...(snapshot.rolePolicy.runtimeState === undefined ? [] : [`Retry state: retries=${snapshot.rolePolicy.runtimeState.retries}; rate limits=${snapshot.rolePolicy.runtimeState.rateLimitFailures}; switches=${snapshot.rolePolicy.runtimeState.switches}; delay ms=${snapshot.rolePolicy.runtimeState.totalDelayMs}`]),
|
|
108
131
|
`Reasoning: ${snapshot.calibration.mode}; policy=${policyEffort}; current=${currentReasoningEffort}; action=${snapshot.calibration.action}`,
|
|
109
132
|
`Runtime recovery: ${snapshot.runtimeRecovery.enabled ? "enabled" : "disabled"}; applies=${snapshot.runtimeRecovery.applies ? "yes" : "no"}; fallbacks=${snapshot.runtimeRecovery.fallbackRouteCount}; max attempts=${snapshot.runtimeRecovery.maxFallbackAttempts}`,
|
|
110
133
|
`Idle continuation: ${snapshot.runtimeRecovery.idleContinuation.enabled ? "enabled" : "disabled"}; max=${snapshot.runtimeRecovery.idleContinuation.maxContinuations}`,
|
|
@@ -168,8 +191,11 @@ function copySettings(settings) {
|
|
|
168
191
|
roles: { ...settings.roles },
|
|
169
192
|
roleRouting: Object.fromEntries(Object.entries(settings.roleRouting).map(([role, policy]) => [role, {
|
|
170
193
|
...(policy.primary === undefined ? {} : { primary: { ...policy.primary } }),
|
|
171
|
-
...(policy.fallbackRoutes === undefined ? {} : { fallbackRoutes: policy.fallbackRoutes.map((route) => ({ ...route })) })
|
|
194
|
+
...(policy.fallbackRoutes === undefined ? {} : { fallbackRoutes: policy.fallbackRoutes.map((route) => ({ ...route })) }),
|
|
195
|
+
...(policy.strategy === undefined ? {} : { strategy: policy.strategy }),
|
|
196
|
+
...(policy.rateLimit === undefined ? {} : { rateLimit: { ...policy.rateLimit } })
|
|
172
197
|
}])),
|
|
198
|
+
runtimePolicy: { strategy: settings.runtimePolicy.strategy, rateLimit: { ...settings.runtimePolicy.rateLimit } },
|
|
173
199
|
presets: { ...settings.presets },
|
|
174
200
|
workflow: { ...settings.workflow },
|
|
175
201
|
guards: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsmm/dsmm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "DeepSeek Harness deepwork mode bundle for ocmm-style agentic workflows.",
|
|
5
5
|
"author": "Hugefiver",
|
|
6
6
|
"license": "LicenseRef-AAAPL",
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@deepseek-ai/cordis": "~4.0.4",
|
|
86
|
+
"@deepseek-ai/dsh-client-connection": "0.2.0-rc.2",
|
|
86
87
|
"@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2",
|
|
87
88
|
"@deepseek-ai/dsh-attachment": "0.2.0-rc.2",
|
|
88
89
|
"@deepseek-ai/dsh-brand": "0.2.0-rc.2",
|
|
@@ -107,6 +108,10 @@
|
|
|
107
108
|
},
|
|
108
109
|
"devDependencies": {
|
|
109
110
|
"@deepseek-ai/cordis": "~4.0.4",
|
|
111
|
+
"@deepseek-ai/dsh-api-session-controller": "0.2.0-rc.2",
|
|
112
|
+
"@deepseek-ai/dsh-client-ui-session": "0.2.0-rc.2",
|
|
113
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.0-rc.2",
|
|
114
|
+
"@deepseek-ai/dsh-client-ui-model-selection": "0.2.0-rc.2",
|
|
110
115
|
"@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2",
|
|
111
116
|
"@deepseek-ai/dsh-typert-registry": "0.2.0-rc.2",
|
|
112
117
|
"@deepseek-ai/dsh-api-gateway": "0.2.0-rc.2",
|
|
@@ -118,6 +123,8 @@
|
|
|
118
123
|
"@deepseek-ai/dsh-client-ui-primitives": "0.2.0-rc.2",
|
|
119
124
|
"@deepseek-ai/dsh-client-ui-settings": "0.2.0-rc.2",
|
|
120
125
|
"@types/react": "^18.3.27",
|
|
126
|
+
"immer": "10.1.1",
|
|
127
|
+
"zustand": "4.4.7",
|
|
121
128
|
"esbuild": "^0.25.12",
|
|
122
129
|
"react": "^18.3.1",
|
|
123
130
|
"@deepseek-ai/dsh-attachment": "0.2.0-rc.2",
|