@dsmm/dsmm 0.3.10 → 0.3.12
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 +1 -1
- package/agent-presets/dsmm-builder/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-clarifier/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-code-search/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-coding/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-complex/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-creative/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-deep/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-doc-search/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-documenting/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-frontend/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-media-reader/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-normal-task/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-oracle/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-plan-critic/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-planner/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-quick/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-research/agent.cordis.yml +0 -4
- package/agent-presets/dsmm-reviewer/agent.cordis.yml +0 -4
- package/docs/agent-presets.md +5 -5
- package/docs/compatibility.md +10 -4
- package/docs/deferred-native-approval-risk.md +11 -1
- package/docs/design.md +15 -5
- package/docs/lsp.md +1 -1
- package/docs/model-routing.md +6 -6
- package/docs/native-permissions.md +5 -1
- package/docs/profiles.md +36 -5
- package/docs/roadmap.md +3 -3
- package/docs/runtime-recovery.md +5 -5
- package/docs/safety-guards.md +23 -5
- package/docs/settings-status.md +3 -3
- package/lib/child-capture.d.ts +9 -0
- package/lib/child-capture.js +29 -2
- package/lib/client/ProfilesSection.js +65 -13
- package/lib/client/RoleToolView-data.d.ts +4 -4
- package/lib/client/RoleToolView-data.js +3 -1
- package/lib/client/RoleToolView-locales.d.ts +7 -4
- package/lib/client/RoleToolView-locales.js +10 -6
- package/lib/client/RoleToolView.js +20 -5
- package/lib/client/SessionProfiles.d.ts +5 -1
- package/lib/client/SessionProfiles.js +13 -9
- package/lib/client/StructuredEditor.d.ts +32 -0
- package/lib/client/StructuredEditor.js +75 -23
- package/lib/client/controller.d.ts +10 -0
- package/lib/client/controller.js +44 -14
- package/lib/client/deployment-locales.js +1 -0
- package/lib/client/locales.d.ts +36 -0
- package/lib/client/locales.js +47 -17
- package/lib/client/permission-locales.js +8 -8
- package/lib/client/session-labels.js +4 -1
- package/lib/client/structured.d.ts +4 -0
- package/lib/client/structured.js +16 -1
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +19 -1
- package/lib/client.js +772 -312
- package/lib/command-approval.d.ts +50 -0
- package/lib/command-approval.js +148 -0
- package/lib/core-permissions.d.ts +2 -1
- package/lib/core-permissions.js +6 -3
- package/lib/guards.d.ts +2 -1
- package/lib/guards.js +45 -8
- package/lib/host-llm.js +3 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +5 -3
- package/lib/model-routing.d.ts +3 -2
- package/lib/model-routing.js +28 -7
- package/lib/native-admission.d.ts +2 -0
- package/lib/native-admission.js +106 -34
- package/lib/permission-control.d.ts +5 -2
- package/lib/permission-control.js +46 -24
- package/lib/permission-controller.d.ts +2 -0
- package/lib/permission-controller.js +13 -8
- package/lib/permission-native-command.d.ts +2 -0
- package/lib/permission-native-command.js +9 -4
- package/lib/permission-native-rules.d.ts +2 -2
- package/lib/permission-native-rules.js +12 -10
- package/lib/profile-diagnostics.js +1 -1
- package/lib/profile-runtime.d.ts +11 -0
- package/lib/profile-runtime.js +48 -13
- package/lib/profile-store.d.ts +4 -1
- package/lib/profile-store.js +37 -14
- package/lib/profiles.js +2 -1
- package/lib/prompt-content.js +2 -2
- package/lib/role-control-rpc.js +18 -5
- package/lib/role-llm-runtime.js +10 -1
- package/lib/role-policy.d.ts +4 -3
- package/lib/role-policy.js +6 -6
- package/lib/role-providers.js +1 -0
- package/lib/runtime-recovery.d.ts +2 -2
- package/lib/runtime-recovery.js +7 -4
- package/lib/settings.d.ts +2 -0
- package/lib/settings.js +10 -0
- package/lib/shell-command.d.ts +16 -0
- package/lib/shell-command.js +443 -119
- package/package.json +1 -1
package/lib/runtime-recovery.js
CHANGED
|
@@ -60,7 +60,7 @@ function positiveNoOutput(frame, attempt, consumed = false) {
|
|
|
60
60
|
return false;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
63
|
+
export function registerRuntimeRecovery(ctx, controller, getSettings, bindRequest) {
|
|
64
64
|
if (installedContexts.has(ctx) || ctx.on === undefined)
|
|
65
65
|
return;
|
|
66
66
|
installedContexts.add(ctx);
|
|
@@ -154,8 +154,7 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
}, { prepend: true });
|
|
157
|
-
|
|
158
|
-
const downstream = await next();
|
|
157
|
+
const prepareRequest = async (frame, downstream) => {
|
|
159
158
|
if (!active || !live(frame.agent))
|
|
160
159
|
return downstream;
|
|
161
160
|
const pending = pendingByAgent.get(frame.agent);
|
|
@@ -192,7 +191,11 @@ export function registerRuntimeRecovery(ctx, controller, getSettings) {
|
|
|
192
191
|
lock.route = { ...pending.route };
|
|
193
192
|
recordAdmittedRecoveryRoute(frame, pending.route);
|
|
194
193
|
return applyModelRoute(downstream, pending.route);
|
|
195
|
-
}
|
|
194
|
+
};
|
|
195
|
+
if (bindRequest)
|
|
196
|
+
bindRequest(prepareRequest);
|
|
197
|
+
else
|
|
198
|
+
disposeRequest = ctx.on("agent/request", async (frame, next) => prepareRequest(frame, await next()), { prepend: true });
|
|
196
199
|
disposeRequestError = ctx.on("agent/request-error", async (frame, next) => {
|
|
197
200
|
if (!active || !live(frame.agent) || frame.signal.aborted)
|
|
198
201
|
return undefined;
|
package/lib/settings.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export type { DsmmSkillName, MvpSkillName } from "./skills.js";
|
|
|
17
17
|
export type DsmmFinalReviewPolicy = "simple-oracle-complex-reviewer" | "reviewer-only" | "off";
|
|
18
18
|
export type DsmmGuardScope = "deepwork-or-dsmm-agent" | "always" | "off";
|
|
19
19
|
export type DsmmGitWritePolicy = "ask" | "deny" | "off";
|
|
20
|
+
export type DsmmGitWriteScope = "all-writes" | "high-risk";
|
|
20
21
|
export type DsmmInvocationLevel = "normal" | "low" | "high" | "max";
|
|
21
22
|
export type DsmmLevelOverride = {
|
|
22
23
|
reasoningEffort: string;
|
|
@@ -50,6 +51,7 @@ export interface DsmmGuardSettings {
|
|
|
50
51
|
scope: DsmmGuardScope;
|
|
51
52
|
shellCommandSafety: boolean;
|
|
52
53
|
gitWriteGuard: DsmmGitWritePolicy;
|
|
54
|
+
gitWriteScope: DsmmGitWriteScope;
|
|
53
55
|
toolOutputTruncation: {
|
|
54
56
|
enabled: boolean;
|
|
55
57
|
maxInlineBytes: number;
|
package/lib/settings.js
CHANGED
|
@@ -36,6 +36,7 @@ export const DEFAULT_DSMM_SETTINGS = {
|
|
|
36
36
|
scope: "deepwork-or-dsmm-agent",
|
|
37
37
|
shellCommandSafety: true,
|
|
38
38
|
gitWriteGuard: "ask",
|
|
39
|
+
gitWriteScope: "all-writes",
|
|
39
40
|
toolOutputTruncation: {
|
|
40
41
|
enabled: true,
|
|
41
42
|
maxInlineBytes: 12000
|
|
@@ -105,6 +106,8 @@ const ROLE_ROUTING_VALIDATION_SCHEMA = Schema.transform(Schema.any(), (input) =>
|
|
|
105
106
|
rejectDeprecatedFields(input);
|
|
106
107
|
if (Object.hasOwn(input, "locale"))
|
|
107
108
|
validateLocale(input.locale);
|
|
109
|
+
if (isRoutingRecord(input.guards) && Object.hasOwn(input.guards, "gitWriteScope"))
|
|
110
|
+
validateShape(input.guards.gitWriteScope, GIT_WRITE_SCOPE_SCHEMA, ["guards", "gitWriteScope"]);
|
|
108
111
|
if (isRoutingRecord(input.runtimeRecovery) && Array.isArray(input.runtimeRecovery.fallbackRoutes)) {
|
|
109
112
|
for (const route of input.runtimeRecovery.fallbackRoutes) {
|
|
110
113
|
normalizeExplicitRoute(route);
|
|
@@ -154,6 +157,10 @@ const GIT_WRITE_POLICY_SCHEMA = Schema.union([
|
|
|
154
157
|
Schema.const("deny"),
|
|
155
158
|
Schema.const("off")
|
|
156
159
|
]).default(DEFAULT_DSMM_SETTINGS.guards.gitWriteGuard);
|
|
160
|
+
const GIT_WRITE_SCOPE_SCHEMA = Schema.union([
|
|
161
|
+
Schema.const("all-writes"),
|
|
162
|
+
Schema.const("high-risk")
|
|
163
|
+
]).default(DEFAULT_DSMM_SETTINGS.guards.gitWriteScope);
|
|
157
164
|
const TOOL_OUTPUT_TRUNCATION_SCHEMA = Schema.object({
|
|
158
165
|
enabled: Schema.boolean().default(DEFAULT_DSMM_SETTINGS.guards.toolOutputTruncation.enabled),
|
|
159
166
|
maxInlineBytes: Schema.number().default(DEFAULT_DSMM_SETTINGS.guards.toolOutputTruncation.maxInlineBytes)
|
|
@@ -166,6 +173,7 @@ const GUARDS_SCHEMA = Schema.object({
|
|
|
166
173
|
scope: GUARD_SCOPE_SCHEMA,
|
|
167
174
|
shellCommandSafety: Schema.boolean().default(DEFAULT_DSMM_SETTINGS.guards.shellCommandSafety),
|
|
168
175
|
gitWriteGuard: GIT_WRITE_POLICY_SCHEMA,
|
|
176
|
+
gitWriteScope: GIT_WRITE_SCOPE_SCHEMA,
|
|
169
177
|
toolOutputTruncation: TOOL_OUTPUT_TRUNCATION_SCHEMA,
|
|
170
178
|
planFormatValidation: Schema.boolean().default(DEFAULT_DSMM_SETTINGS.guards.planFormatValidation),
|
|
171
179
|
questionLabelHelper: QUESTION_LABEL_HELPER_SCHEMA,
|
|
@@ -672,6 +680,8 @@ function resolveWorkflowSettings(config) {
|
|
|
672
680
|
}
|
|
673
681
|
export function resolveGuardSettings(config) {
|
|
674
682
|
const defaults = DEFAULT_DSMM_SETTINGS.guards;
|
|
683
|
+
if (config !== undefined && Object.hasOwn(config, "gitWriteScope"))
|
|
684
|
+
validateShape(config.gitWriteScope, GIT_WRITE_SCOPE_SCHEMA, ["guards", "gitWriteScope"]);
|
|
675
685
|
return {
|
|
676
686
|
...defaults,
|
|
677
687
|
...config,
|
package/lib/shell-command.d.ts
CHANGED
|
@@ -12,6 +12,22 @@ export interface ParsedShellSegment {
|
|
|
12
12
|
words: readonly string[];
|
|
13
13
|
}
|
|
14
14
|
export declare function parseShellCommand(input: string, dialect: ShellDialect): readonly ParsedShellSegment[];
|
|
15
|
+
export interface GitStaticContext {
|
|
16
|
+
/** Literal spelling, not a claim about executable identity or repository confinement. */
|
|
17
|
+
readonly executable: string;
|
|
18
|
+
readonly globalOptions: readonly string[];
|
|
19
|
+
readonly environment: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
export interface GitCommandAction {
|
|
22
|
+
readonly ruleId: `git.${string}`;
|
|
23
|
+
readonly action: string;
|
|
24
|
+
readonly risk: "write" | "high-risk";
|
|
25
|
+
/** Callers must also bind actual cwd, dialect, Agent and tool registration. */
|
|
26
|
+
readonly reusable: boolean;
|
|
27
|
+
readonly context: GitStaticContext;
|
|
28
|
+
}
|
|
29
|
+
/** Pure, finite Git classification; this is not a shell AST or an authorization grant. */
|
|
30
|
+
export declare function evaluateGitCommand(input: string, dialect: ShellDialect): readonly GitCommandAction[];
|
|
15
31
|
export declare function classifyKnownGitWrite(input: string, dialect: ShellDialect): string | undefined;
|
|
16
32
|
export type ShellDialectViolation = "powershell-export" | "powershell-source" | "powershell-dev-null" | "posix-powershell-env";
|
|
17
33
|
export declare function classifyShellDialectViolation(input: string, dialect: ShellDialect): ShellDialectViolation | undefined;
|