@dsmm/dsmm 0.1.0 → 0.1.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.
- package/README.md +6 -3
- package/agent-presets/dsmm-builder/agent.cordis.yml +11 -11
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +11 -11
- package/docs/agent-presets.md +3 -1
- package/docs/compatibility.md +5 -2
- package/docs/migration-from-ocmm.md +10 -4
- package/docs/model-routing.md +46 -1
- package/docs/releasing.md +11 -9
- package/docs/roadmap.md +1 -1
- package/docs/runtime-recovery.md +10 -2
- package/docs/settings-status.md +4 -0
- package/lib/dsh-events.d.ts +8 -0
- package/lib/dsh-types.d.ts +4 -0
- package/lib/index.d.ts +5 -3
- package/lib/index.js +6 -2
- package/lib/model-routing.js +28 -3
- package/lib/preset-materializer.js +2 -2
- package/lib/preset-registry.js +1 -1
- package/lib/recovery-policy.js +1 -1
- package/lib/role-providers.d.ts +13 -0
- package/lib/role-providers.js +61 -0
- package/lib/role-routing.d.ts +15 -0
- package/lib/role-routing.js +144 -0
- package/lib/role-subagents.js +2 -2
- package/lib/roles.d.ts +5 -4
- package/lib/roles.js +11 -9
- package/lib/runtime-recovery.js +34 -15
- package/lib/session-scope.d.ts +6 -1
- package/lib/session-scope.js +23 -0
- package/lib/settings.d.ts +12 -1
- package/lib/settings.js +123 -39
- package/lib/status.d.ts +11 -2
- package/lib/status.js +49 -11
- package/package.json +6 -1
package/lib/settings.js
CHANGED
|
@@ -17,6 +17,7 @@ export const DEFAULT_DSMM_SETTINGS = {
|
|
|
17
17
|
deepseekFlashMaxReasoningPresets: ["dsmm-plan-critic", "dsmm-reviewer"],
|
|
18
18
|
skills: createDefaultSkillSettings(),
|
|
19
19
|
roles: createDefaultRoleSettings(),
|
|
20
|
+
roleRouting: {},
|
|
20
21
|
presets: {
|
|
21
22
|
materialize: false
|
|
22
23
|
},
|
|
@@ -74,6 +75,29 @@ const SKILLS_SCHEMA = Schema.object({
|
|
|
74
75
|
"remove-ai-slops": Schema.boolean().default(DEFAULT_DSMM_SETTINGS.skills["remove-ai-slops"])
|
|
75
76
|
});
|
|
76
77
|
const ROLES_SCHEMA = Schema.object(Object.fromEntries(DSMM_ROLE_IDS.map((id) => [id, Schema.boolean().default(DEFAULT_DSMM_SETTINGS.roles[id])])));
|
|
78
|
+
const MODEL_ROUTE_SCHEMA = Schema.object({
|
|
79
|
+
provider: Schema.string().required(),
|
|
80
|
+
model: Schema.string().required(),
|
|
81
|
+
reasoningEffort: Schema.string()
|
|
82
|
+
});
|
|
83
|
+
// A dictionary retains unknown keys for fail-closed validation by the resolver.
|
|
84
|
+
const ROLE_ROUTING_SCHEMA = Schema.dict(Schema.object({
|
|
85
|
+
primary: Schema.union([Schema.const(undefined), MODEL_ROUTE_SCHEMA]),
|
|
86
|
+
fallbackRoutes: Schema.union([Schema.const(undefined), Schema.array(MODEL_ROUTE_SCHEMA)])
|
|
87
|
+
}).required()).default({});
|
|
88
|
+
// Schemastery treats null like an omitted default. Validate the untouched map
|
|
89
|
+
// before object defaults can erase an explicitly malformed routing policy.
|
|
90
|
+
const ROLE_ROUTING_VALIDATION_SCHEMA = Schema.transform(Schema.any(), (input) => {
|
|
91
|
+
if (!isRoutingRecord(input))
|
|
92
|
+
return input;
|
|
93
|
+
if (isRoutingRecord(input.runtimeRecovery) && Array.isArray(input.runtimeRecovery.fallbackRoutes)) {
|
|
94
|
+
for (const route of input.runtimeRecovery.fallbackRoutes) {
|
|
95
|
+
if (isRoutingRecord(route))
|
|
96
|
+
normalizeRecoveryEffort(route);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return { roleRouting: resolveRoleRouting(input.roleRouting) };
|
|
100
|
+
});
|
|
77
101
|
const PRESETS_SCHEMA = Schema.object({
|
|
78
102
|
materialize: Schema.boolean().default(DEFAULT_DSMM_SETTINGS.presets.materialize),
|
|
79
103
|
root: Schema.string()
|
|
@@ -135,7 +159,8 @@ const RUNTIME_RECOVERY_SCHEMA = Schema.object({
|
|
|
135
159
|
retryOnCodes: Schema.array(String).default([...DEFAULT_DSMM_SETTINGS.runtimeRecovery.retryOnCodes]),
|
|
136
160
|
fallbackRoutes: Schema.array(Schema.object({
|
|
137
161
|
provider: Schema.string(),
|
|
138
|
-
model: Schema.string()
|
|
162
|
+
model: Schema.string(),
|
|
163
|
+
reasoningEffort: Schema.string()
|
|
139
164
|
})).default(DEFAULT_DSMM_SETTINGS.runtimeRecovery.fallbackRoutes.map((route) => ({ ...route }))),
|
|
140
165
|
maxFallbackAttempts: Schema.number().default(DEFAULT_DSMM_SETTINGS.runtimeRecovery.maxFallbackAttempts),
|
|
141
166
|
idleContinuation: RUNTIME_RECOVERY_IDLE_CONTINUATION_SCHEMA
|
|
@@ -162,43 +187,45 @@ const LSP_SCHEMA = Schema.object({
|
|
|
162
187
|
toolCallTimeoutMs: Schema.number().default(DEFAULT_DSMM_SETTINGS.lsp.toolCallTimeoutMs),
|
|
163
188
|
failOnStartupError: Schema.boolean().default(DEFAULT_DSMM_SETTINGS.lsp.failOnStartupError)
|
|
164
189
|
});
|
|
165
|
-
export const DSMM_CONFIG_SCHEMA = Schema.object({
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
190
|
+
export const DSMM_CONFIG_SCHEMA = Schema.intersect([ROLE_ROUTING_VALIDATION_SCHEMA, Schema.object({
|
|
191
|
+
modeName: Schema.string().default(DEFAULT_DSMM_SETTINGS.modeName),
|
|
192
|
+
section: Schema.string(),
|
|
193
|
+
defaultActive: Schema.boolean().default(DEFAULT_DSMM_SETTINGS.defaultActive),
|
|
194
|
+
promptOrder: Schema.number().default(DEFAULT_DSMM_SETTINGS.promptOrder),
|
|
195
|
+
deepseekV4ProCalibration: DEEPSEEK_CALIBRATION_SCHEMA,
|
|
196
|
+
deepseekV4ProDefaultReasoningEffort: DEEPSEEK_DEFAULT_REASONING_EFFORT_SCHEMA,
|
|
197
|
+
deepseekV4ProMaxReasoningPresets: DEEPSEEK_MAX_REASONING_PRESETS_SCHEMA,
|
|
198
|
+
deepseekFlashCalibration: DEEPSEEK_CALIBRATION_SCHEMA,
|
|
199
|
+
deepseekFlashDefaultReasoningEffort: DEEPSEEK_DEFAULT_REASONING_EFFORT_SCHEMA,
|
|
200
|
+
deepseekFlashMaxReasoningPresets: DEEPSEEK_MAX_REASONING_PRESETS_SCHEMA,
|
|
201
|
+
skills: SKILLS_SCHEMA,
|
|
202
|
+
roles: ROLES_SCHEMA,
|
|
203
|
+
roleRouting: ROLE_ROUTING_SCHEMA,
|
|
204
|
+
presets: PRESETS_SCHEMA,
|
|
205
|
+
workflow: WORKFLOW_CONFIG_SCHEMA,
|
|
206
|
+
guards: GUARDS_SCHEMA,
|
|
207
|
+
runtimeRecovery: RUNTIME_RECOVERY_SCHEMA,
|
|
208
|
+
lsp: LSP_SCHEMA
|
|
209
|
+
})]).default({});
|
|
210
|
+
export const DSMM_SETTINGS_SCHEMA = Schema.intersect([ROLE_ROUTING_VALIDATION_SCHEMA, Schema.object({
|
|
211
|
+
modeName: Schema.string().default(DEFAULT_DSMM_SETTINGS.modeName),
|
|
212
|
+
defaultActive: Schema.boolean().default(DEFAULT_DSMM_SETTINGS.defaultActive),
|
|
213
|
+
promptOrder: Schema.number().default(DEFAULT_DSMM_SETTINGS.promptOrder),
|
|
214
|
+
deepseekV4ProCalibration: DEEPSEEK_CALIBRATION_SCHEMA,
|
|
215
|
+
deepseekV4ProDefaultReasoningEffort: DEEPSEEK_DEFAULT_REASONING_EFFORT_SCHEMA,
|
|
216
|
+
deepseekV4ProMaxReasoningPresets: DEEPSEEK_MAX_REASONING_PRESETS_SCHEMA,
|
|
217
|
+
deepseekFlashCalibration: DEEPSEEK_CALIBRATION_SCHEMA,
|
|
218
|
+
deepseekFlashDefaultReasoningEffort: DEEPSEEK_DEFAULT_REASONING_EFFORT_SCHEMA,
|
|
219
|
+
deepseekFlashMaxReasoningPresets: DEEPSEEK_MAX_REASONING_PRESETS_SCHEMA,
|
|
220
|
+
skills: SKILLS_SCHEMA,
|
|
221
|
+
roles: ROLES_SCHEMA,
|
|
222
|
+
roleRouting: ROLE_ROUTING_SCHEMA,
|
|
223
|
+
presets: PRESETS_SCHEMA,
|
|
224
|
+
workflow: WORKFLOW_SCHEMA,
|
|
225
|
+
guards: GUARDS_SCHEMA,
|
|
226
|
+
runtimeRecovery: RUNTIME_RECOVERY_SCHEMA,
|
|
227
|
+
lsp: LSP_SCHEMA
|
|
228
|
+
})]).default({});
|
|
202
229
|
export function resolveConfig(config = {}) {
|
|
203
230
|
return {
|
|
204
231
|
modeName: normalizeModeName(config.modeName),
|
|
@@ -212,6 +239,7 @@ export function resolveConfig(config = {}) {
|
|
|
212
239
|
deepseekFlashMaxReasoningPresets: resolveMaxReasoningPresets(config.deepseekFlashMaxReasoningPresets, DEFAULT_DSMM_SETTINGS.deepseekFlashMaxReasoningPresets),
|
|
213
240
|
skills: { ...DEFAULT_DSMM_SETTINGS.skills, ...config.skills },
|
|
214
241
|
roles: { ...DEFAULT_DSMM_SETTINGS.roles, ...config.roles },
|
|
242
|
+
roleRouting: resolveRoleRouting(config.roleRouting),
|
|
215
243
|
presets: resolvePresetSettings(config.presets),
|
|
216
244
|
workflow: resolveWorkflowSettings(config.workflow),
|
|
217
245
|
guards: resolveGuardSettings(config.guards),
|
|
@@ -223,6 +251,53 @@ function resolveMaxReasoningPresets(input, defaults) {
|
|
|
223
251
|
const requested = new Set(input ?? defaults);
|
|
224
252
|
return DSMM_ROLE_IDS.filter((id) => requested.has(id));
|
|
225
253
|
}
|
|
254
|
+
export function resolveRoleRouting(input) {
|
|
255
|
+
if (input === undefined)
|
|
256
|
+
return {};
|
|
257
|
+
if (!isRoutingRecord(input))
|
|
258
|
+
throw new TypeError("dsmm roleRouting must be an object");
|
|
259
|
+
const result = {};
|
|
260
|
+
for (const [key, value] of Object.entries(input)) {
|
|
261
|
+
if (!DSMM_ROLE_IDS.includes(key))
|
|
262
|
+
throw new TypeError("dsmm roleRouting contains an unknown role");
|
|
263
|
+
if (!isRoutingRecord(value) || Object.keys(value).some((field) => field !== "primary" && field !== "fallbackRoutes")) {
|
|
264
|
+
throw new TypeError("dsmm roleRouting role policy must contain only primary and fallbackRoutes");
|
|
265
|
+
}
|
|
266
|
+
const policy = {};
|
|
267
|
+
if (Object.hasOwn(value, "primary"))
|
|
268
|
+
policy.primary = normalizeExplicitRoute(value.primary);
|
|
269
|
+
if (Object.hasOwn(value, "fallbackRoutes")) {
|
|
270
|
+
if (!Array.isArray(value.fallbackRoutes))
|
|
271
|
+
throw new TypeError("dsmm roleRouting fallbackRoutes must be an array");
|
|
272
|
+
policy.fallbackRoutes = [];
|
|
273
|
+
for (const entry of value.fallbackRoutes) {
|
|
274
|
+
const route = normalizeExplicitRoute(entry);
|
|
275
|
+
if (!policy.fallbackRoutes.some((existing) => existing.provider === route.provider && existing.model === route.model))
|
|
276
|
+
policy.fallbackRoutes.push(route);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
result[key] = policy;
|
|
280
|
+
}
|
|
281
|
+
return result;
|
|
282
|
+
}
|
|
283
|
+
function isRoutingRecord(value) {
|
|
284
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
285
|
+
}
|
|
286
|
+
function normalizeExplicitRoute(value) {
|
|
287
|
+
if (!isRoutingRecord(value) || Object.keys(value).some((field) => !["provider", "model", "reasoningEffort"].includes(field))) {
|
|
288
|
+
throw new TypeError("dsmm explicit model route must contain provider, model and optional reasoningEffort");
|
|
289
|
+
}
|
|
290
|
+
if (typeof value.provider !== "string" || value.provider.trim() === "" || typeof value.model !== "string" || value.model.trim() === "") {
|
|
291
|
+
throw new TypeError("dsmm explicit model route requires nonempty provider and model");
|
|
292
|
+
}
|
|
293
|
+
if (Object.hasOwn(value, "reasoningEffort") && (typeof value.reasoningEffort !== "string" || value.reasoningEffort.trim() === "")) {
|
|
294
|
+
throw new TypeError("dsmm explicit model route reasoningEffort must be nonempty");
|
|
295
|
+
}
|
|
296
|
+
return {
|
|
297
|
+
provider: value.provider.trim(), model: value.model.trim(),
|
|
298
|
+
...(typeof value.reasoningEffort === "string" ? { reasoningEffort: value.reasoningEffort.trim() } : {})
|
|
299
|
+
};
|
|
300
|
+
}
|
|
226
301
|
export function isRoleEnabled(settings, role) {
|
|
227
302
|
return settings.roles[role];
|
|
228
303
|
}
|
|
@@ -292,14 +367,23 @@ function normalizeRetryCodes(input, defaults) {
|
|
|
292
367
|
function normalizeRecoveryRoutes(input, defaults) {
|
|
293
368
|
const normalized = [];
|
|
294
369
|
for (const route of input ?? defaults) {
|
|
370
|
+
const reasoningEffort = normalizeRecoveryEffort(route);
|
|
295
371
|
const provider = route.provider?.trim() ?? "";
|
|
296
372
|
const model = route.model?.trim() ?? "";
|
|
297
373
|
if (provider === "" || model === "" || normalized.some((candidate) => candidate.provider === provider && candidate.model === model))
|
|
298
374
|
continue;
|
|
299
|
-
normalized.push({ provider, model });
|
|
375
|
+
normalized.push({ provider, model, ...(reasoningEffort ? { reasoningEffort } : {}) });
|
|
300
376
|
}
|
|
301
377
|
return normalized;
|
|
302
378
|
}
|
|
379
|
+
function normalizeRecoveryEffort(route) {
|
|
380
|
+
if (!Object.hasOwn(route, "reasoningEffort"))
|
|
381
|
+
return undefined;
|
|
382
|
+
const value = route.reasoningEffort;
|
|
383
|
+
if (typeof value !== "string" || value.trim() === "")
|
|
384
|
+
throw new TypeError("dsmm recovery route reasoningEffort must be nonempty");
|
|
385
|
+
return value.trim();
|
|
386
|
+
}
|
|
303
387
|
function normalizeBoundedInteger(value, defaultValue) {
|
|
304
388
|
if (value === undefined || !Number.isFinite(value))
|
|
305
389
|
return defaultValue;
|
package/lib/status.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DshAgent } from "./dsh-types.js";
|
|
2
2
|
import type { DsmmModelFamily } from "./model-family.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { DsmmRoleId } from "./roles.js";
|
|
4
|
+
import type { DeepseekCalibration, DsmmModelRoute, DsmmSettings } from "./settings.js";
|
|
4
5
|
export declare const DSMM_STATUS_VERSION: 1;
|
|
5
6
|
export interface DsmmStatusSnapshot {
|
|
6
7
|
version: typeof DSMM_STATUS_VERSION;
|
|
@@ -23,7 +24,15 @@ export interface DsmmStatusSnapshot {
|
|
|
23
24
|
mode: DeepseekCalibration;
|
|
24
25
|
applies: boolean;
|
|
25
26
|
policyEffort?: "off" | "low" | "high" | "max";
|
|
26
|
-
action: "disabled" | "out-of-scope" | "non-target-route" | "preserve-explicit" | "fill-missing" | "enforce";
|
|
27
|
+
action: "disabled" | "out-of-scope" | "non-target-route" | "preserve-explicit" | "fill-missing" | "enforce" | "fixed-role-policy";
|
|
28
|
+
};
|
|
29
|
+
rolePolicy: {
|
|
30
|
+
role?: DsmmRoleId;
|
|
31
|
+
applies: boolean;
|
|
32
|
+
primary?: DsmmModelRoute;
|
|
33
|
+
fallbackRoutes: DsmmModelRoute[];
|
|
34
|
+
fallbackSource: "role" | "global" | "disabled";
|
|
35
|
+
diagnostic?: "invalid-child-descriptor";
|
|
27
36
|
};
|
|
28
37
|
runtimeRecovery: {
|
|
29
38
|
enabled: boolean;
|
package/lib/status.js
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
import { classifyModelFamily } from "./model-family.js";
|
|
2
2
|
import { isDeepseekFlashRoute, isDeepseekV4ProRoute } from "./model-routing.js";
|
|
3
3
|
import { isDsmmRoleId } from "./roles.js";
|
|
4
|
-
import {
|
|
4
|
+
import { effectiveRoleFallbackRoutes, persistedRoleRoute, rolePolicyIdentity } from "./role-routing.js";
|
|
5
|
+
import { resolveEffectiveDsmmRole, resolveSelectedAgentPreset } from "./session-scope.js";
|
|
5
6
|
export const DSMM_STATUS_VERSION = 1;
|
|
6
7
|
export function createDsmmStatusSnapshot(input) {
|
|
7
8
|
const { agent, settings, modeActive } = input;
|
|
8
9
|
const selectedPreset = resolveSelectedAgentPreset(agent.session);
|
|
9
10
|
const dsmmPreset = isDsmmRoleId(selectedPreset);
|
|
10
|
-
|
|
11
|
+
let role;
|
|
12
|
+
let invalidDescriptor = false;
|
|
13
|
+
try {
|
|
14
|
+
role = resolveEffectiveDsmmRole(agent, settings, modeActive);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
invalidDescriptor = true;
|
|
18
|
+
}
|
|
19
|
+
const inScope = modeActive || role !== undefined;
|
|
20
|
+
const policy = role === undefined ? undefined : settings.roleRouting[role];
|
|
21
|
+
const fallbacks = invalidDescriptor ? [] : effectiveRoleFallbackRoutes(settings, role);
|
|
11
22
|
const selectedRoute = resolveRoute(agent);
|
|
12
23
|
const family = classifyModelFamily({
|
|
13
24
|
providerID: selectedRoute.provider,
|
|
@@ -18,6 +29,13 @@ export function createDsmmStatusSnapshot(input) {
|
|
|
18
29
|
&& isDeepseekV4ProRoute({ provider: selectedRoute.provider, model: selectedRoute.model });
|
|
19
30
|
const deepseekFlash = selectedRoute.provider !== undefined && selectedRoute.model !== undefined
|
|
20
31
|
&& isDeepseekFlashRoute({ provider: selectedRoute.provider, model: selectedRoute.model });
|
|
32
|
+
let acceptedRoleRoute;
|
|
33
|
+
if (settings.runtimeRecovery.enabled && policy?.fallbackRoutes !== undefined) {
|
|
34
|
+
acceptedRoleRoute = persistedRoleRoute({ agent }, policy.primary, fallbacks, rolePolicyIdentity(settings, role));
|
|
35
|
+
}
|
|
36
|
+
const exactRouting = policy?.primary !== undefined || acceptedRoleRoute !== undefined
|
|
37
|
+
|| fallbacks.some((route) => route.reasoningEffort !== undefined && route.provider === selectedRoute.provider
|
|
38
|
+
&& route.model === selectedRoute.model && route.reasoningEffort === selectedRoute.reasoningEffort);
|
|
21
39
|
return {
|
|
22
40
|
version: DSMM_STATUS_VERSION,
|
|
23
41
|
mode: {
|
|
@@ -35,17 +53,28 @@ export function createDsmmStatusSnapshot(input) {
|
|
|
35
53
|
deepseekFlash,
|
|
36
54
|
...(selectedRoute.reasoningEffort === undefined ? {} : { currentReasoningEffort: selectedRoute.reasoningEffort })
|
|
37
55
|
},
|
|
38
|
-
calibration:
|
|
56
|
+
calibration: exactRouting ? {
|
|
57
|
+
mode: deepseekFlash ? settings.deepseekFlashCalibration : settings.deepseekV4ProCalibration,
|
|
58
|
+
applies: false, action: "fixed-role-policy"
|
|
59
|
+
} : resolveCalibration({
|
|
39
60
|
calibration: deepseekFlash ? settings.deepseekFlashCalibration : settings.deepseekV4ProCalibration,
|
|
40
61
|
inScope,
|
|
41
62
|
targetRoute: deepseekV4Pro || deepseekFlash,
|
|
42
63
|
policyEffort: resolvePolicyEffort(settings, selectedPreset, deepseekFlash),
|
|
43
64
|
currentReasoningEffort: selectedRoute.reasoningEffort
|
|
44
65
|
}),
|
|
66
|
+
rolePolicy: {
|
|
67
|
+
...(role === undefined ? {} : { role }),
|
|
68
|
+
applies: policy?.primary !== undefined || (settings.runtimeRecovery.enabled && policy?.fallbackRoutes !== undefined),
|
|
69
|
+
...(policy?.primary === undefined ? {} : { primary: { ...policy.primary } }),
|
|
70
|
+
fallbackRoutes: fallbacks.map((route) => ({ ...route })),
|
|
71
|
+
fallbackSource: !settings.runtimeRecovery.enabled ? "disabled" : policy?.fallbackRoutes === undefined ? "global" : "role",
|
|
72
|
+
...(invalidDescriptor ? { diagnostic: "invalid-child-descriptor" } : {})
|
|
73
|
+
},
|
|
45
74
|
runtimeRecovery: {
|
|
46
75
|
enabled: settings.runtimeRecovery.enabled,
|
|
47
|
-
applies: settings.runtimeRecovery.enabled && inScope,
|
|
48
|
-
fallbackRouteCount:
|
|
76
|
+
applies: settings.runtimeRecovery.enabled && inScope && !invalidDescriptor,
|
|
77
|
+
fallbackRouteCount: fallbacks.length,
|
|
49
78
|
maxFallbackAttempts: settings.runtimeRecovery.maxFallbackAttempts,
|
|
50
79
|
idleContinuation: {
|
|
51
80
|
enabled: settings.runtimeRecovery.idleContinuation.enabled,
|
|
@@ -56,11 +85,14 @@ export function createDsmmStatusSnapshot(input) {
|
|
|
56
85
|
};
|
|
57
86
|
}
|
|
58
87
|
export function formatDsmmStatus(snapshot) {
|
|
59
|
-
const scope = snapshot.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
88
|
+
const scope = snapshot.rolePolicy.role !== undefined && snapshot.rolePolicy.role !== "dsmm-orchestrator"
|
|
89
|
+
&& snapshot.rolePolicy.role !== snapshot.mode.selectedPreset
|
|
90
|
+
? `${snapshot.rolePolicy.role} role`
|
|
91
|
+
: snapshot.mode.inScope && snapshot.mode.dsmmPreset && snapshot.mode.selectedPreset
|
|
92
|
+
? `${snapshot.mode.selectedPreset} preset`
|
|
93
|
+
: snapshot.mode.inScope
|
|
94
|
+
? "active deepwork"
|
|
95
|
+
: "out of scope";
|
|
64
96
|
const provider = snapshot.route.provider ?? "unavailable";
|
|
65
97
|
const model = snapshot.route.model ?? "unavailable";
|
|
66
98
|
const policyEffort = snapshot.calibration.policyEffort ?? "not applicable";
|
|
@@ -71,6 +103,7 @@ export function formatDsmmStatus(snapshot) {
|
|
|
71
103
|
`Scope: ${scope}`,
|
|
72
104
|
`Workflow policy: ${snapshot.effectiveSettings.workflow.policy}`,
|
|
73
105
|
`Route: ${provider}/${model} [${snapshot.route.family}]`,
|
|
106
|
+
`Role policy: ${snapshot.rolePolicy.role ?? "none"}; primary=${snapshot.rolePolicy.primary === undefined ? "inherit" : `${snapshot.rolePolicy.primary.provider}/${snapshot.rolePolicy.primary.model}`}; fallbacks=${snapshot.rolePolicy.fallbackSource}`,
|
|
74
107
|
`Reasoning: ${snapshot.calibration.mode}; policy=${policyEffort}; current=${currentReasoningEffort}; action=${snapshot.calibration.action}`,
|
|
75
108
|
`Runtime recovery: ${snapshot.runtimeRecovery.enabled ? "enabled" : "disabled"}; applies=${snapshot.runtimeRecovery.applies ? "yes" : "no"}; fallbacks=${snapshot.runtimeRecovery.fallbackRouteCount}; max attempts=${snapshot.runtimeRecovery.maxFallbackAttempts}`,
|
|
76
109
|
`Idle continuation: ${snapshot.runtimeRecovery.idleContinuation.enabled ? "enabled" : "disabled"}; max=${snapshot.runtimeRecovery.idleContinuation.maxContinuations}`,
|
|
@@ -89,7 +122,8 @@ function resolveRoute(agent) {
|
|
|
89
122
|
}
|
|
90
123
|
return {
|
|
91
124
|
provider: readString(agent.options?.provider),
|
|
92
|
-
model: readString(agent.options?.model)
|
|
125
|
+
model: readString(agent.options?.model),
|
|
126
|
+
reasoningEffort: readString(agent.options?.reasoningEffort)
|
|
93
127
|
};
|
|
94
128
|
}
|
|
95
129
|
function readString(value) {
|
|
@@ -131,6 +165,10 @@ function copySettings(settings) {
|
|
|
131
165
|
deepseekFlashMaxReasoningPresets: [...settings.deepseekFlashMaxReasoningPresets],
|
|
132
166
|
skills: { ...settings.skills },
|
|
133
167
|
roles: { ...settings.roles },
|
|
168
|
+
roleRouting: Object.fromEntries(Object.entries(settings.roleRouting).map(([role, policy]) => [role, {
|
|
169
|
+
...(policy.primary === undefined ? {} : { primary: { ...policy.primary } }),
|
|
170
|
+
...(policy.fallbackRoutes === undefined ? {} : { fallbackRoutes: policy.fallbackRoutes.map((route) => ({ ...route })) })
|
|
171
|
+
}])),
|
|
134
172
|
presets: { ...settings.presets },
|
|
135
173
|
workflow: { ...settings.workflow },
|
|
136
174
|
guards: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsmm/dsmm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "DeepSeek Harness deepwork mode bundle for ocmm-style agentic workflows.",
|
|
5
5
|
"author": "Hugefiver",
|
|
6
6
|
"license": "LicenseRef-AAAPL",
|
|
@@ -82,6 +82,7 @@
|
|
|
82
82
|
"@deepseek-ai/dsh-timeout": "0.2.0-rc.2",
|
|
83
83
|
"@deepseek-ai/dsh-agent-preset-registry": "0.2.0-rc.2",
|
|
84
84
|
"@deepseek-ai/dsh-tool-subagent": "0.2.0-rc.2",
|
|
85
|
+
"@deepseek-ai/dsh-subagent": "0.2.0-rc.2",
|
|
85
86
|
"@deepseek-ai/dsh-tool-fs": "0.2.0-rc.2",
|
|
86
87
|
"@deepseek-ai/dsh-tool-fs-search": "0.2.0-rc.2",
|
|
87
88
|
"@deepseek-ai/dsh-tool-bash": "0.2.0-rc.2",
|
|
@@ -101,11 +102,15 @@
|
|
|
101
102
|
"@deepseek-ai/dsh-timeout": "0.2.0-rc.2",
|
|
102
103
|
"@deepseek-ai/dsh-system-prompt": "0.2.0-rc.2",
|
|
103
104
|
"@deepseek-ai/dsh-agent": "0.2.0-rc.2",
|
|
105
|
+
"@deepseek-ai/dsh-agent-loop": "0.2.0-rc.2",
|
|
104
106
|
"@deepseek-ai/dsh-agent-preset-registry": "0.2.0-rc.2",
|
|
105
107
|
"@deepseek-ai/dsh-tools": "0.2.0-rc.2",
|
|
106
108
|
"@deepseek-ai/dsh-scope": "0.2.0-rc.2",
|
|
107
109
|
"@deepseek-ai/dsh-session": "0.2.0-rc.2",
|
|
110
|
+
"@deepseek-ai/dsh-session-projection": "0.2.0-rc.2",
|
|
111
|
+
"@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.0-rc.2",
|
|
108
112
|
"@deepseek-ai/dsh-tool-subagent": "0.2.0-rc.2",
|
|
113
|
+
"@deepseek-ai/dsh-subagent": "0.2.0-rc.2",
|
|
109
114
|
"@deepseek-ai/dsh-tool-fs": "0.2.0-rc.2",
|
|
110
115
|
"@deepseek-ai/dsh-tool-fs-search": "0.2.0-rc.2",
|
|
111
116
|
"@deepseek-ai/dsh-tool-bash": "0.2.0-rc.2",
|