@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.
Files changed (99) hide show
  1. package/README.md +1 -1
  2. package/agent-presets/dsmm-builder/agent.cordis.yml +0 -4
  3. package/agent-presets/dsmm-clarifier/agent.cordis.yml +0 -4
  4. package/agent-presets/dsmm-code-search/agent.cordis.yml +0 -4
  5. package/agent-presets/dsmm-coding/agent.cordis.yml +0 -4
  6. package/agent-presets/dsmm-complex/agent.cordis.yml +0 -4
  7. package/agent-presets/dsmm-creative/agent.cordis.yml +0 -4
  8. package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +0 -4
  9. package/agent-presets/dsmm-deep/agent.cordis.yml +0 -4
  10. package/agent-presets/dsmm-doc-search/agent.cordis.yml +0 -4
  11. package/agent-presets/dsmm-documenting/agent.cordis.yml +0 -4
  12. package/agent-presets/dsmm-frontend/agent.cordis.yml +0 -4
  13. package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +0 -4
  14. package/agent-presets/dsmm-media-reader/agent.cordis.yml +0 -4
  15. package/agent-presets/dsmm-normal-task/agent.cordis.yml +0 -4
  16. package/agent-presets/dsmm-oracle/agent.cordis.yml +0 -4
  17. package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +0 -4
  18. package/agent-presets/dsmm-orchestrator/agent.cordis.yml +0 -4
  19. package/agent-presets/dsmm-plan-critic/agent.cordis.yml +0 -4
  20. package/agent-presets/dsmm-planner/agent.cordis.yml +0 -4
  21. package/agent-presets/dsmm-quick/agent.cordis.yml +0 -4
  22. package/agent-presets/dsmm-research/agent.cordis.yml +0 -4
  23. package/agent-presets/dsmm-reviewer/agent.cordis.yml +0 -4
  24. package/docs/agent-presets.md +5 -5
  25. package/docs/compatibility.md +10 -4
  26. package/docs/deferred-native-approval-risk.md +11 -1
  27. package/docs/design.md +15 -5
  28. package/docs/lsp.md +1 -1
  29. package/docs/model-routing.md +6 -6
  30. package/docs/native-permissions.md +5 -1
  31. package/docs/profiles.md +36 -5
  32. package/docs/roadmap.md +3 -3
  33. package/docs/runtime-recovery.md +5 -5
  34. package/docs/safety-guards.md +23 -5
  35. package/docs/settings-status.md +3 -3
  36. package/lib/child-capture.d.ts +9 -0
  37. package/lib/child-capture.js +29 -2
  38. package/lib/client/ProfilesSection.js +65 -13
  39. package/lib/client/RoleToolView-data.d.ts +4 -4
  40. package/lib/client/RoleToolView-data.js +3 -1
  41. package/lib/client/RoleToolView-locales.d.ts +7 -4
  42. package/lib/client/RoleToolView-locales.js +10 -6
  43. package/lib/client/RoleToolView.js +20 -5
  44. package/lib/client/SessionProfiles.d.ts +5 -1
  45. package/lib/client/SessionProfiles.js +13 -9
  46. package/lib/client/StructuredEditor.d.ts +32 -0
  47. package/lib/client/StructuredEditor.js +75 -23
  48. package/lib/client/controller.d.ts +10 -0
  49. package/lib/client/controller.js +44 -14
  50. package/lib/client/deployment-locales.js +1 -0
  51. package/lib/client/locales.d.ts +36 -0
  52. package/lib/client/locales.js +47 -17
  53. package/lib/client/permission-locales.js +8 -8
  54. package/lib/client/session-labels.js +4 -1
  55. package/lib/client/structured.d.ts +4 -0
  56. package/lib/client/structured.js +16 -1
  57. package/lib/client/styles.d.ts +1 -1
  58. package/lib/client/styles.js +19 -1
  59. package/lib/client.js +772 -312
  60. package/lib/command-approval.d.ts +50 -0
  61. package/lib/command-approval.js +148 -0
  62. package/lib/core-permissions.d.ts +2 -1
  63. package/lib/core-permissions.js +6 -3
  64. package/lib/guards.d.ts +2 -1
  65. package/lib/guards.js +45 -8
  66. package/lib/host-llm.js +3 -3
  67. package/lib/index.d.ts +1 -1
  68. package/lib/index.js +5 -3
  69. package/lib/model-routing.d.ts +3 -2
  70. package/lib/model-routing.js +28 -7
  71. package/lib/native-admission.d.ts +2 -0
  72. package/lib/native-admission.js +106 -34
  73. package/lib/permission-control.d.ts +5 -2
  74. package/lib/permission-control.js +46 -24
  75. package/lib/permission-controller.d.ts +2 -0
  76. package/lib/permission-controller.js +13 -8
  77. package/lib/permission-native-command.d.ts +2 -0
  78. package/lib/permission-native-command.js +9 -4
  79. package/lib/permission-native-rules.d.ts +2 -2
  80. package/lib/permission-native-rules.js +12 -10
  81. package/lib/profile-diagnostics.js +1 -1
  82. package/lib/profile-runtime.d.ts +11 -0
  83. package/lib/profile-runtime.js +48 -13
  84. package/lib/profile-store.d.ts +4 -1
  85. package/lib/profile-store.js +37 -14
  86. package/lib/profiles.js +2 -1
  87. package/lib/prompt-content.js +2 -2
  88. package/lib/role-control-rpc.js +18 -5
  89. package/lib/role-llm-runtime.js +10 -1
  90. package/lib/role-policy.d.ts +4 -3
  91. package/lib/role-policy.js +6 -6
  92. package/lib/role-providers.js +1 -0
  93. package/lib/runtime-recovery.d.ts +2 -2
  94. package/lib/runtime-recovery.js +7 -4
  95. package/lib/settings.d.ts +2 -0
  96. package/lib/settings.js +10 -0
  97. package/lib/shell-command.d.ts +16 -0
  98. package/lib/shell-command.js +443 -119
  99. package/package.json +1 -1
@@ -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
- disposeRequest = ctx.on("agent/request", async (frame, next) => {
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
- }, { prepend: true });
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,
@@ -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;