@namzu/cli 12.1.0 → 13.0.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.
Files changed (199) hide show
  1. package/README.md +25 -1
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +119 -60
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/acp.d.ts +24 -8
  6. package/dist/commands/acp.d.ts.map +1 -1
  7. package/dist/commands/acp.js +221 -80
  8. package/dist/commands/acp.js.map +1 -1
  9. package/dist/commands/drain.d.ts.map +1 -1
  10. package/dist/commands/drain.js +45 -9
  11. package/dist/commands/drain.js.map +1 -1
  12. package/dist/commands/prior-messages.d.ts +11 -0
  13. package/dist/commands/prior-messages.d.ts.map +1 -0
  14. package/dist/commands/prior-messages.js +280 -0
  15. package/dist/commands/prior-messages.js.map +1 -0
  16. package/dist/commands/resume.d.ts.map +1 -1
  17. package/dist/commands/resume.js +21 -19
  18. package/dist/commands/resume.js.map +1 -1
  19. package/dist/commands/run-stream.d.ts +5 -3
  20. package/dist/commands/run-stream.d.ts.map +1 -1
  21. package/dist/commands/run-stream.js +66 -62
  22. package/dist/commands/run-stream.js.map +1 -1
  23. package/dist/commands/run.d.ts.map +1 -1
  24. package/dist/commands/run.js +50 -37
  25. package/dist/commands/run.js.map +1 -1
  26. package/dist/config/debug.d.ts +55 -0
  27. package/dist/config/debug.d.ts.map +1 -0
  28. package/dist/config/debug.js +126 -0
  29. package/dist/config/debug.js.map +1 -0
  30. package/dist/config/load.d.ts +88 -4
  31. package/dist/config/load.d.ts.map +1 -1
  32. package/dist/config/load.js +386 -56
  33. package/dist/config/load.js.map +1 -1
  34. package/dist/config/schema.d.ts +87 -5
  35. package/dist/config/schema.d.ts.map +1 -1
  36. package/dist/config/schema.js +5 -5
  37. package/dist/config/schema.js.map +1 -1
  38. package/dist/config/trusted-project-context.d.ts +11 -0
  39. package/dist/config/trusted-project-context.d.ts.map +1 -0
  40. package/dist/config/trusted-project-context.js +28 -0
  41. package/dist/config/trusted-project-context.js.map +1 -0
  42. package/dist/context/project-path.d.ts +3 -0
  43. package/dist/context/project-path.d.ts.map +1 -0
  44. package/dist/context/project-path.js +16 -0
  45. package/dist/context/project-path.js.map +1 -0
  46. package/dist/context/project-tracker.d.ts +30 -0
  47. package/dist/context/project-tracker.d.ts.map +1 -0
  48. package/dist/context/project-tracker.js +217 -0
  49. package/dist/context/project-tracker.js.map +1 -0
  50. package/dist/context/sandbox.d.ts +29 -9
  51. package/dist/context/sandbox.d.ts.map +1 -1
  52. package/dist/context/sandbox.js +8 -0
  53. package/dist/context/sandbox.js.map +1 -1
  54. package/dist/exit-codes.d.ts +5 -4
  55. package/dist/exit-codes.d.ts.map +1 -1
  56. package/dist/exit-codes.js +5 -4
  57. package/dist/exit-codes.js.map +1 -1
  58. package/dist/index.d.ts +2 -2
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +2 -2
  61. package/dist/index.js.map +1 -1
  62. package/dist/integrations/clipboard/text.d.ts +43 -0
  63. package/dist/integrations/clipboard/text.d.ts.map +1 -0
  64. package/dist/integrations/clipboard/text.js +43 -0
  65. package/dist/integrations/clipboard/text.js.map +1 -0
  66. package/dist/integrations/mcp/servers.d.ts +9 -0
  67. package/dist/integrations/mcp/servers.d.ts.map +1 -1
  68. package/dist/integrations/mcp/servers.js +11 -4
  69. package/dist/integrations/mcp/servers.js.map +1 -1
  70. package/dist/integrations/notifications/terminal.d.ts +32 -0
  71. package/dist/integrations/notifications/terminal.d.ts.map +1 -0
  72. package/dist/integrations/notifications/terminal.js +46 -0
  73. package/dist/integrations/notifications/terminal.js.map +1 -0
  74. package/dist/integrations/plugins/runtime.d.ts +17 -0
  75. package/dist/integrations/plugins/runtime.d.ts.map +1 -0
  76. package/dist/integrations/plugins/runtime.js +100 -0
  77. package/dist/integrations/plugins/runtime.js.map +1 -0
  78. package/dist/integrations/providers/credential-store.d.ts +17 -0
  79. package/dist/integrations/providers/credential-store.d.ts.map +1 -1
  80. package/dist/integrations/providers/credential-store.js +114 -2
  81. package/dist/integrations/providers/credential-store.js.map +1 -1
  82. package/dist/integrations/providers/index.d.ts +2 -2
  83. package/dist/integrations/providers/index.d.ts.map +1 -1
  84. package/dist/integrations/providers/index.js +2 -2
  85. package/dist/integrations/providers/index.js.map +1 -1
  86. package/dist/integrations/providers/keychain.d.ts +0 -13
  87. package/dist/integrations/providers/keychain.d.ts.map +1 -1
  88. package/dist/integrations/providers/keychain.js +0 -76
  89. package/dist/integrations/providers/keychain.js.map +1 -1
  90. package/dist/integrations/providers/oauth.d.ts +45 -16
  91. package/dist/integrations/providers/oauth.d.ts.map +1 -1
  92. package/dist/integrations/providers/oauth.js +170 -43
  93. package/dist/integrations/providers/oauth.js.map +1 -1
  94. package/dist/integrations/providers/subscription-login.d.ts +2 -0
  95. package/dist/integrations/providers/subscription-login.d.ts.map +1 -1
  96. package/dist/integrations/providers/subscription-login.js +117 -14
  97. package/dist/integrations/providers/subscription-login.js.map +1 -1
  98. package/dist/integrations/sessions/store.d.ts +111 -1
  99. package/dist/integrations/sessions/store.d.ts.map +1 -1
  100. package/dist/integrations/sessions/store.js +400 -7
  101. package/dist/integrations/sessions/store.js.map +1 -1
  102. package/dist/integrations/sessions/transcript-export.d.ts +25 -0
  103. package/dist/integrations/sessions/transcript-export.d.ts.map +1 -0
  104. package/dist/integrations/sessions/transcript-export.js +441 -0
  105. package/dist/integrations/sessions/transcript-export.js.map +1 -0
  106. package/dist/integrations/sessions/turn-evidence.d.ts +138 -0
  107. package/dist/integrations/sessions/turn-evidence.d.ts.map +1 -0
  108. package/dist/integrations/sessions/turn-evidence.js +506 -0
  109. package/dist/integrations/sessions/turn-evidence.js.map +1 -0
  110. package/dist/integrations/subagents/runtime.d.ts +7 -12
  111. package/dist/integrations/subagents/runtime.d.ts.map +1 -1
  112. package/dist/integrations/subagents/runtime.js +19 -10
  113. package/dist/integrations/subagents/runtime.js.map +1 -1
  114. package/dist/integrations/trust/store.d.ts.map +1 -1
  115. package/dist/integrations/trust/store.js +27 -13
  116. package/dist/integrations/trust/store.js.map +1 -1
  117. package/dist/permissions/canonical-project.d.ts +9 -0
  118. package/dist/permissions/canonical-project.d.ts.map +1 -0
  119. package/dist/permissions/canonical-project.js +13 -0
  120. package/dist/permissions/canonical-project.js.map +1 -0
  121. package/dist/permissions/checks.d.ts +65 -0
  122. package/dist/permissions/checks.d.ts.map +1 -0
  123. package/dist/permissions/checks.js +122 -0
  124. package/dist/permissions/checks.js.map +1 -0
  125. package/dist/permissions/headless-trust.d.ts +9 -5
  126. package/dist/permissions/headless-trust.d.ts.map +1 -1
  127. package/dist/permissions/headless-trust.js +18 -4
  128. package/dist/permissions/headless-trust.js.map +1 -1
  129. package/dist/permissions/rules.d.ts +16 -7
  130. package/dist/permissions/rules.d.ts.map +1 -1
  131. package/dist/permissions/rules.js +78 -13
  132. package/dist/permissions/rules.js.map +1 -1
  133. package/dist/tui/App.d.ts +5 -2
  134. package/dist/tui/App.d.ts.map +1 -1
  135. package/dist/tui/App.js +1555 -143
  136. package/dist/tui/App.js.map +1 -1
  137. package/dist/tui/Composer.d.ts +14 -3
  138. package/dist/tui/Composer.d.ts.map +1 -1
  139. package/dist/tui/Composer.js +53 -15
  140. package/dist/tui/Composer.js.map +1 -1
  141. package/dist/tui/EditPromptPicker.d.ts +8 -0
  142. package/dist/tui/EditPromptPicker.d.ts.map +1 -0
  143. package/dist/tui/EditPromptPicker.js +18 -0
  144. package/dist/tui/EditPromptPicker.js.map +1 -0
  145. package/dist/tui/LiveActivity.d.ts.map +1 -1
  146. package/dist/tui/LiveActivity.js +2 -1
  147. package/dist/tui/LiveActivity.js.map +1 -1
  148. package/dist/tui/Markdown.d.ts.map +1 -1
  149. package/dist/tui/Markdown.js +2 -1
  150. package/dist/tui/Markdown.js.map +1 -1
  151. package/dist/tui/PermissionOverlay.d.ts.map +1 -1
  152. package/dist/tui/PermissionOverlay.js +7 -1
  153. package/dist/tui/PermissionOverlay.js.map +1 -1
  154. package/dist/tui/Picker.d.ts +4 -4
  155. package/dist/tui/Picker.d.ts.map +1 -1
  156. package/dist/tui/Picker.js +86 -7
  157. package/dist/tui/Picker.js.map +1 -1
  158. package/dist/tui/ResumePicker.d.ts.map +1 -1
  159. package/dist/tui/ResumePicker.js +1 -1
  160. package/dist/tui/ResumePicker.js.map +1 -1
  161. package/dist/tui/Transcript.d.ts +4 -2
  162. package/dist/tui/Transcript.d.ts.map +1 -1
  163. package/dist/tui/Transcript.js +31 -5
  164. package/dist/tui/Transcript.js.map +1 -1
  165. package/dist/tui/agent.d.ts +123 -19
  166. package/dist/tui/agent.d.ts.map +1 -1
  167. package/dist/tui/agent.js +665 -143
  168. package/dist/tui/agent.js.map +1 -1
  169. package/dist/tui/compact-transcript.d.ts +24 -0
  170. package/dist/tui/compact-transcript.d.ts.map +1 -0
  171. package/dist/tui/compact-transcript.js +46 -0
  172. package/dist/tui/compact-transcript.js.map +1 -0
  173. package/dist/tui/conversation-history.d.ts +33 -0
  174. package/dist/tui/conversation-history.d.ts.map +1 -0
  175. package/dist/tui/conversation-history.js +42 -0
  176. package/dist/tui/conversation-history.js.map +1 -0
  177. package/dist/tui/edit-prompts.d.ts +23 -0
  178. package/dist/tui/edit-prompts.d.ts.map +1 -0
  179. package/dist/tui/edit-prompts.js +35 -0
  180. package/dist/tui/edit-prompts.js.map +1 -0
  181. package/dist/tui/live-window.d.ts +3 -1
  182. package/dist/tui/live-window.d.ts.map +1 -1
  183. package/dist/tui/live-window.js +20 -8
  184. package/dist/tui/live-window.js.map +1 -1
  185. package/dist/tui/slashCommands.d.ts +178 -9
  186. package/dist/tui/slashCommands.d.ts.map +1 -1
  187. package/dist/tui/slashCommands.js +339 -15
  188. package/dist/tui/slashCommands.js.map +1 -1
  189. package/dist/tui/terminal-display.d.ts +12 -0
  190. package/dist/tui/terminal-display.d.ts.map +1 -0
  191. package/dist/tui/terminal-display.js +65 -0
  192. package/dist/tui/terminal-display.js.map +1 -0
  193. package/dist/tui/types.d.ts +14 -2
  194. package/dist/tui/types.d.ts.map +1 -1
  195. package/dist/tui/workspace-diff.d.ts +40 -0
  196. package/dist/tui/workspace-diff.d.ts.map +1 -0
  197. package/dist/tui/workspace-diff.js +101 -0
  198. package/dist/tui/workspace-diff.js.map +1 -0
  199. package/package.json +7 -7
@@ -1,14 +1,59 @@
1
1
  /**
2
- * @namzu/cli config schema (M0 stub).
2
+ * Public @namzu/cli configuration vocabulary.
3
3
  *
4
- * The schema is intentionally minimal in M0; each later milestone extends
5
- * it as concrete settings land (M2 providers, M4 memory, M5 skills, etc.).
6
- * Validation library (e.g. Zod) is introduced when constraints exist that
7
- * are worth enforcing at runtime — premature now.
4
+ * Runtime admission lives in `load.ts`, beside the source/precedence facts it
5
+ * needs for actionable errors. Keeping this file declarative makes the public
6
+ * type the one list of settings while the loader's total reader map forces a
7
+ * validation decision whenever that list grows.
8
8
  */
9
9
  import type { McpServersConfig } from '../integrations/mcp/servers.js';
10
10
  import type { FormatName } from '../output/index.js';
11
+ import type { PermissionChecksConfig } from '../permissions/checks.js';
11
12
  import type { PermissionsConfig } from '../permissions/rules.js';
13
+ /**
14
+ * What one profile may set.
15
+ *
16
+ * Executable plugins are intentionally excluded as well as nested profiles:
17
+ * `NAMZU_PROFILE` may select a declared profile, and ambient shell state must
18
+ * not be able to turn code loading on.
19
+ */
20
+ export type ProfileConfig = Omit<NamzuCliConfig, 'profiles' | 'plugins'>;
21
+ export type ProfilesConfig = Readonly<Record<string, ProfileConfig>>;
22
+ /** The two operator-visible moments the TUI can notify about. */
23
+ export type TerminalNotificationEvent = 'turn-settled' | 'approval-required';
24
+ /** Escape protocol used for an opted-in terminal notification. */
25
+ export type TerminalNotificationMethod = 'osc9' | 'bel';
26
+ export interface TuiConfig {
27
+ /**
28
+ * Notify for TUI events through the terminal itself.
29
+ *
30
+ * Absent or `false` means off. `true` enables both events; a list enables
31
+ * only the named events, and an empty list explicitly disables all of them.
32
+ * No command is started and no conversation content is included.
33
+ */
34
+ readonly notifications?: boolean | readonly TerminalNotificationEvent[];
35
+ /** Terminal protocol to write. Defaults to `osc9` when notifications are on. */
36
+ readonly notificationMethod?: TerminalNotificationMethod;
37
+ }
38
+ /** Where the CLI may discover executable plugin bundles. */
39
+ export type PluginScope = 'project' | 'user';
40
+ /**
41
+ * Session plugin runtime settings.
42
+ *
43
+ * Plugins may import JavaScript hooks and tools, so the runtime is disabled
44
+ * unless an operator opts in explicitly. Project plugins are considered only
45
+ * after the existing project trust gate has pinned the canonical cwd.
46
+ */
47
+ export interface PluginConfig {
48
+ /** Start the plugin runtime. Only the exact value `true` enables it. */
49
+ readonly enabled?: boolean;
50
+ /** Scan admitted plugin directories. Defaults to `true` once enabled. */
51
+ readonly autoDiscovery?: boolean;
52
+ /** Locations the discovery pass may read. Defaults to project and user. */
53
+ readonly allowedScopes?: readonly PluginScope[];
54
+ /** Per-hook deadline in milliseconds. Defaults to the SDK runtime default. */
55
+ readonly hookTimeoutMs?: number;
56
+ }
12
57
  export interface NamzuCliConfig {
13
58
  /** Default output format when not overridden by --format. */
14
59
  readonly format?: FormatName;
@@ -22,6 +67,34 @@ export interface NamzuCliConfig {
22
67
  * it meant before this existed — the absence of a policy never widens one.
23
68
  */
24
69
  readonly permissions?: PermissionsConfig;
70
+ /**
71
+ * What the operator believes the table above decides, checked at startup.
72
+ *
73
+ * Each entry names a tool, an input, and the expected `"allow" | "ask" |
74
+ * "deny"`. A mismatch is reported by index and the run continues — the
75
+ * point is to say that a policy does not do what its author said, which
76
+ * a table of globs cannot be read for. Absent means nothing is checked,
77
+ * which is what it meant before this existed.
78
+ */
79
+ readonly permissionChecks?: PermissionChecksConfig;
80
+ /**
81
+ * Named bundles of settings to switch between.
82
+ *
83
+ * A profile is not another file. It sits INSIDE one, so the settings a
84
+ * person switches between live next to each other and can be read as a
85
+ * set — which is the thing a second config file cannot give you, because
86
+ * a second file has to be found before it can be compared.
87
+ *
88
+ * Selecting one applies it as a layer above the file it came from, so a
89
+ * profile overrides that file's own base values and is in turn overridden
90
+ * by the environment. A profile may set anything except `profiles` and
91
+ * executable `plugins`: a
92
+ * profile that carried profiles would be a cascade inside a cascade, and
93
+ * the question "which one is active" would stop having one answer.
94
+ * Plugins are excluded because `NAMZU_PROFILE` can select a profile; shell
95
+ * state must not be an executable-code authority.
96
+ */
97
+ readonly profiles?: ProfilesConfig;
25
98
  /**
26
99
  * External tool servers to connect, keyed by the name their tools are
27
100
  * prefixed with.
@@ -30,6 +103,8 @@ export interface NamzuCliConfig {
30
103
  * means no external servers, which is what it meant before this existed.
31
104
  */
32
105
  readonly mcpServers?: McpServersConfig;
106
+ /** Executable extension bundles. Absent keeps discovery and imports off. */
107
+ readonly plugins?: PluginConfig;
33
108
  /**
34
109
  * Isolation for the commands this CLI runs.
35
110
  *
@@ -53,6 +128,8 @@ export interface NamzuCliConfig {
53
128
  * something a default arranges.
54
129
  */
55
130
  readonly telemetry?: TelemetryConfig;
131
+ /** Interactive-terminal-only behaviour. Absent leaves notifications off. */
132
+ readonly tui?: TuiConfig;
56
133
  }
57
134
  export interface TelemetryConfig {
58
135
  /**
@@ -118,6 +195,11 @@ export interface SandboxConfig {
118
195
  * a refusal instead of a surprise.
119
196
  */
120
197
  readonly requireIsolation?: readonly ('filesystem' | 'network' | 'process')[];
198
+ /**
199
+ * How long a completed or cancelled run waits for sandbox teardown.
200
+ * Defaults to 30 seconds. Set to `0` to preserve the former unbounded wait.
201
+ */
202
+ readonly teardownTimeoutMs?: number;
121
203
  }
122
204
  export declare const DEFAULT_CONFIG: NamzuCliConfig;
123
205
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EA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EAAE,SAAS,CAAC,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC,EAAE,CAAA;IAC7E;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CACnC;AAED,eAAO,MAAM,cAAc,EAAE,cAG3B,CAAA"}
@@ -1,10 +1,10 @@
1
1
  /**
2
- * @namzu/cli config schema (M0 stub).
2
+ * Public @namzu/cli configuration vocabulary.
3
3
  *
4
- * The schema is intentionally minimal in M0; each later milestone extends
5
- * it as concrete settings land (M2 providers, M4 memory, M5 skills, etc.).
6
- * Validation library (e.g. Zod) is introduced when constraints exist that
7
- * are worth enforcing at runtime — premature now.
4
+ * Runtime admission lives in `load.ts`, beside the source/precedence facts it
5
+ * needs for actionable errors. Keeping this file declarative makes the public
6
+ * type the one list of settings while the loader's total reader map forces a
7
+ * validation decision whenever that list grows.
8
8
  */
9
9
  export const DEFAULT_CONFIG = Object.freeze({
10
10
  format: 'text',
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAyHH,MAAM,CAAC,MAAM,cAAc,GAAmB,MAAM,CAAC,MAAM,CAAC;IAC3D,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,KAAK;CACZ,CAAC,CAAA"}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAkNH,MAAM,CAAC,MAAM,cAAc,GAAmB,MAAM,CAAC,MAAM,CAAC;IAC3D,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,KAAK;CACZ,CAAC,CAAA"}
@@ -0,0 +1,11 @@
1
+ export declare function bindTrustedProjectContext<T extends object>(bootstrap: T, resolve: (cwd: string) => T): T;
2
+ export declare function resolveTrustedProjectContext<T extends object>(bootstrap: T, cwd: string): T;
3
+ /**
4
+ * Pin a real project path only for contexts the CLI marked as trust-aware.
5
+ *
6
+ * Embedded/hand-built contexts keep their historical lexical cwd behaviour;
7
+ * production bootstrap contexts cannot proceed if their target disappears
8
+ * while crossing the trust boundary.
9
+ */
10
+ export declare function pinTrustedProjectPath(bootstrap: object, cwd: string): string;
11
+ //# sourceMappingURL=trusted-project-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trusted-project-context.d.ts","sourceRoot":"","sources":["../../src/config/trusted-project-context.ts"],"names":[],"mappings":"AAWA,wBAAgB,yBAAyB,CAAC,CAAC,SAAS,MAAM,EACzD,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,CAAC,GACzB,CAAC,CAGH;AAED,wBAAgB,4BAA4B,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,CAG3F;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5E"}
@@ -0,0 +1,28 @@
1
+ import { canonicalProjectPath } from '../permissions/canonical-project.js';
2
+ /**
3
+ * Internal bridge from a pre-trust context to its project-aware replacement.
4
+ *
5
+ * A WeakMap keeps this authority out of the public CommandContext/TuiContext
6
+ * shapes. Hand-built embedded contexts therefore retain their existing
7
+ * behaviour: resolving them is an identity operation.
8
+ */
9
+ const trustedResolvers = new WeakMap();
10
+ export function bindTrustedProjectContext(bootstrap, resolve) {
11
+ trustedResolvers.set(bootstrap, resolve);
12
+ return bootstrap;
13
+ }
14
+ export function resolveTrustedProjectContext(bootstrap, cwd) {
15
+ const resolve = trustedResolvers.get(bootstrap);
16
+ return resolve ? resolve(cwd) : bootstrap;
17
+ }
18
+ /**
19
+ * Pin a real project path only for contexts the CLI marked as trust-aware.
20
+ *
21
+ * Embedded/hand-built contexts keep their historical lexical cwd behaviour;
22
+ * production bootstrap contexts cannot proceed if their target disappears
23
+ * while crossing the trust boundary.
24
+ */
25
+ export function pinTrustedProjectPath(bootstrap, cwd) {
26
+ return trustedResolvers.has(bootstrap) ? canonicalProjectPath(cwd) : cwd;
27
+ }
28
+ //# sourceMappingURL=trusted-project-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trusted-project-context.js","sourceRoot":"","sources":["../../src/config/trusted-project-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAE1E;;;;;;GAMG;AACH,MAAM,gBAAgB,GAAG,IAAI,OAAO,EAAmC,CAAA;AAEvE,MAAM,UAAU,yBAAyB,CACxC,SAAY,EACZ,OAA2B;IAE3B,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IACxC,OAAO,SAAS,CAAA;AACjB,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAmB,SAAY,EAAE,GAAW;IACvF,MAAM,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IAC/C,OAAO,OAAO,CAAC,CAAC,CAAE,OAAO,CAAC,GAAG,CAAO,CAAC,CAAC,CAAC,SAAS,CAAA;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAiB,EAAE,GAAW;IACnE,OAAO,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;AACzE,CAAC"}
@@ -0,0 +1,3 @@
1
+ /** Render an instruction path without terminal controls or visual reordering. */
2
+ export declare function visibleProjectInstructionPath(path: string): string;
3
+ //# sourceMappingURL=project-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-path.d.ts","sourceRoot":"","sources":["../../src/context/project-path.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAclE"}
@@ -0,0 +1,16 @@
1
+ /** Render an instruction path without terminal controls or visual reordering. */
2
+ export function visibleProjectInstructionPath(path) {
3
+ return [...path]
4
+ .map((character) => {
5
+ const code = character.codePointAt(0) ?? 0;
6
+ const unsafe = code <= 0x1f ||
7
+ (code >= 0x7f && code <= 0x9f) ||
8
+ code === 0x2028 ||
9
+ code === 0x2029 ||
10
+ (code >= 0x202a && code <= 0x202e) ||
11
+ (code >= 0x2066 && code <= 0x2069);
12
+ return unsafe ? `\\u${code.toString(16).padStart(4, '0')}` : character;
13
+ })
14
+ .join('');
15
+ }
16
+ //# sourceMappingURL=project-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-path.js","sourceRoot":"","sources":["../../src/context/project-path.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,UAAU,6BAA6B,CAAC,IAAY;IACzD,OAAO,CAAC,GAAG,IAAI,CAAC;SACd,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;QAClB,MAAM,IAAI,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QAC1C,MAAM,MAAM,GACX,IAAI,IAAI,IAAI;YACZ,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC;YAC9B,IAAI,KAAK,MAAM;YACf,IAAI,KAAK,MAAM;YACf,CAAC,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC;YAClC,CAAC,IAAI,IAAI,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,CAAA;QACnC,OAAO,MAAM,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;IACvE,CAAC,CAAC;SACD,IAAI,CAAC,EAAE,CAAC,CAAA;AACX,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { type Message, type ProjectInstructionContext, type UserMessage } from '@namzu/sdk';
2
+ import { type SkippedInstructionFile } from './project.js';
3
+ /** Total model-visible instruction text held by one session. */
4
+ export declare const MAX_TOTAL_PROJECT_INSTRUCTION_CHARS = 256000;
5
+ /**
6
+ * Session-owned live instruction state. Each run gets its own drain cursor;
7
+ * children share discovery without being able to consume the parent's update.
8
+ */
9
+ export declare class ProjectInstructionTracker {
10
+ private readonly cwd;
11
+ private readonly root;
12
+ private readonly scopes;
13
+ constructor(cwd: string);
14
+ /** Re-read only paths named by validated provenance; persisted text is ignored. */
15
+ rehydrate(messages: readonly Message[]): void;
16
+ /** Refresh known scopes and return the exact policy for a new human turn. */
17
+ prepareSnapshot(messages: readonly Message[]): UserMessage | null;
18
+ /** Each run's durable messages are its cursor over the shared discovered state. */
19
+ createRunContext(): ProjectInstructionContext;
20
+ get instructionFiles(): readonly string[];
21
+ get skippedInstructionFiles(): readonly SkippedInstructionFile[];
22
+ private observe;
23
+ private registerPath;
24
+ private refreshDirectories;
25
+ private view;
26
+ private snapshot;
27
+ private snapshotKey;
28
+ private snapshotKeyFromMessages;
29
+ }
30
+ //# sourceMappingURL=project-tracker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-tracker.d.ts","sourceRoot":"","sources":["../../src/context/project-tracker.ts"],"names":[],"mappings":"AAEA,OAAO,EAEN,KAAK,OAAO,EACZ,KAAK,yBAAyB,EAE9B,KAAK,WAAW,EAGhB,MAAM,YAAY,CAAA;AAGnB,OAAO,EAIN,KAAK,sBAAsB,EAG3B,MAAM,cAAc,CAAA;AAErB,gEAAgE;AAChE,eAAO,MAAM,mCAAmC,SAAU,CAAA;AA0D1D;;;GAGG;AACH,qBAAa,yBAAyB;IACrC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAQ;IAC7B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgC;gBAE3C,GAAG,EAAE,MAAM;IAMvB,mFAAmF;IACnF,SAAS,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI;IAa7C,6EAA6E;IAC7E,eAAe,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,WAAW,GAAG,IAAI;IAKjE,mFAAmF;IACnF,gBAAgB,IAAI,yBAAyB;IAa7C,IAAI,gBAAgB,IAAI,SAAS,MAAM,EAAE,CAExC;IAED,IAAI,uBAAuB,IAAI,SAAS,sBAAsB,EAAE,CAE/D;IAED,OAAO,CAAC,OAAO;IAyBf,OAAO,CAAC,YAAY;IAapB,OAAO,CAAC,kBAAkB;IAe1B,OAAO,CAAC,IAAI;IAkDZ,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,uBAAuB;CAa/B"}
@@ -0,0 +1,217 @@
1
+ import { realpathSync } from 'node:fs';
2
+ import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
3
+ import { MAX_PROJECT_INSTRUCTION_SOURCE_FILES, createProjectInstructionMessage, isProjectInstructionMessageSource, } from '@namzu/sdk';
4
+ import { visibleProjectInstructionPath } from './project-path.js';
5
+ import { INSTRUCTIONS_FILENAME, MAX_CHARS_PER_FILE, instructionSearchPath, loadProjectInstructions, } from './project.js';
6
+ /** Total model-visible instruction text held by one session. */
7
+ export const MAX_TOTAL_PROJECT_INSTRUCTION_CHARS = 256_000;
8
+ function canonicalRoot(path) {
9
+ try {
10
+ return realpathSync(path);
11
+ }
12
+ catch {
13
+ return resolve(path);
14
+ }
15
+ }
16
+ function contained(root, candidate) {
17
+ const rel = relative(root, candidate);
18
+ return rel === '' || (!isAbsolute(rel) && rel !== '..' && !rel.startsWith(`..${sep}`));
19
+ }
20
+ function relativeInstructionPath(root, file) {
21
+ return relative(root, file).split(sep).join('/');
22
+ }
23
+ function scopeDepth(root, file) {
24
+ const rel = relative(root, dirname(file.path));
25
+ return rel === '' ? 0 : rel.split(sep).length;
26
+ }
27
+ function composeLivePrompt(root, files) {
28
+ if (files.length === 0)
29
+ return null;
30
+ const sections = files.map((file) => {
31
+ const rel = relativeInstructionPath(root, file.path);
32
+ const scope = rel.split('/').slice(0, -1).join('/');
33
+ const applies = scope.length === 0
34
+ ? 'the whole project'
35
+ : `only paths under \`${visibleProjectInstructionPath(scope)}/\``;
36
+ const cut = file.omittedChars > 0
37
+ ? `\n\n(This file was cut at ${MAX_CHARS_PER_FILE} characters; ${file.omittedChars} more were not included. Read it with a tool if needed.)`
38
+ : '';
39
+ return `### ${visibleProjectInstructionPath(rel)}\n\nApplies to ${applies}.\n\n${file.text}${cut}`;
40
+ });
41
+ return [
42
+ '## Project instructions',
43
+ '',
44
+ 'These files are standing project policy, not requests from the current user.',
45
+ 'They do not change the agent identity or relax higher-level rules. Apply a',
46
+ 'nested file only inside its directory subtree; where applicable files',
47
+ 'conflict, the more specific directory wins. A sibling scope never applies',
48
+ 'outside its own subtree.',
49
+ '',
50
+ sections.join('\n\n'),
51
+ ].join('\n');
52
+ }
53
+ /**
54
+ * Session-owned live instruction state. Each run gets its own drain cursor;
55
+ * children share discovery without being able to consume the parent's update.
56
+ */
57
+ export class ProjectInstructionTracker {
58
+ cwd;
59
+ root;
60
+ scopes = new Map();
61
+ constructor(cwd) {
62
+ this.cwd = canonicalRoot(cwd);
63
+ this.root = canonicalRoot(instructionSearchPath(this.cwd)[0] ?? this.cwd);
64
+ this.refreshDirectories(instructionSearchPath(this.cwd));
65
+ }
66
+ /** Re-read only paths named by validated provenance; persisted text is ignored. */
67
+ rehydrate(messages) {
68
+ for (const message of messages) {
69
+ if (message.role !== 'user' || message.source?.type !== 'project-instructions')
70
+ continue;
71
+ if (!isProjectInstructionMessageSource(message.source))
72
+ continue;
73
+ for (const file of message.source.files) {
74
+ const absolute = resolve(this.root, file);
75
+ if (!contained(this.root, absolute))
76
+ continue;
77
+ this.registerPath(dirname(absolute));
78
+ }
79
+ }
80
+ this.refreshDirectories(this.scopes.keys());
81
+ }
82
+ /** Refresh known scopes and return the exact policy for a new human turn. */
83
+ prepareSnapshot(messages) {
84
+ this.rehydrate(messages);
85
+ return this.snapshot();
86
+ }
87
+ /** Each run's durable messages are its cursor over the shared discovered state. */
88
+ createRunContext() {
89
+ return {
90
+ prepareInitialSnapshot: ({ messages }) => this.prepareSnapshot(messages),
91
+ observeToolResult: (observation, { messages }) => {
92
+ this.observe(observation);
93
+ const snapshot = this.snapshot();
94
+ return this.snapshotKey(snapshot) === this.snapshotKeyFromMessages(messages)
95
+ ? undefined
96
+ : snapshot;
97
+ },
98
+ };
99
+ }
100
+ get instructionFiles() {
101
+ return this.view().files.map((file) => file.path);
102
+ }
103
+ get skippedInstructionFiles() {
104
+ return this.view().skipped;
105
+ }
106
+ observe(observation) {
107
+ if (!observation.result.success || !['read', 'write', 'edit'].includes(observation.toolName)) {
108
+ return;
109
+ }
110
+ if (typeof observation.input !== 'object' ||
111
+ observation.input === null ||
112
+ !('path' in observation.input) ||
113
+ typeof observation.input.path !== 'string') {
114
+ return;
115
+ }
116
+ const rawPath = observation.input.path;
117
+ const lexical = resolve(this.cwd, rawPath);
118
+ let target;
119
+ try {
120
+ target = realpathSync(lexical);
121
+ }
122
+ catch {
123
+ return;
124
+ }
125
+ if (!contained(this.root, target))
126
+ return;
127
+ this.registerPath(dirname(target));
128
+ this.refreshDirectories(this.scopes.keys());
129
+ }
130
+ registerPath(directory) {
131
+ const target = resolve(directory);
132
+ if (!contained(this.root, target))
133
+ return;
134
+ const rel = relative(this.root, target);
135
+ let current = this.root;
136
+ if (!this.scopes.has(current))
137
+ this.scopes.set(current, { directory: current });
138
+ if (rel === '')
139
+ return;
140
+ for (const part of rel.split(sep)) {
141
+ current = join(current, part);
142
+ if (!this.scopes.has(current))
143
+ this.scopes.set(current, { directory: current });
144
+ }
145
+ }
146
+ refreshDirectories(directories) {
147
+ for (const directory of [...directories]) {
148
+ this.registerPath(directory);
149
+ const loaded = loadProjectInstructions(directory);
150
+ const expected = join(directory, INSTRUCTIONS_FILENAME);
151
+ const file = loaded.files.find((candidate) => candidate.path === expected);
152
+ const skipped = loaded.skipped.find((candidate) => candidate.path === expected);
153
+ this.scopes.set(directory, {
154
+ directory,
155
+ ...(file ? { file } : {}),
156
+ ...(skipped ? { skipped } : {}),
157
+ });
158
+ }
159
+ }
160
+ view() {
161
+ const loaded = [...this.scopes.values()].flatMap((scope) => (scope.file ? [scope.file] : []));
162
+ const rootFile = loaded.find((file) => dirname(file.path) === this.root);
163
+ const candidates = loaded
164
+ .filter((file) => file !== rootFile)
165
+ .sort((a, b) => scopeDepth(this.root, b) - scopeDepth(this.root, a) || a.path.localeCompare(b.path));
166
+ const selected = [];
167
+ let used = 0;
168
+ const skipped = [...this.scopes.values()].flatMap((scope) => scope.skipped ? [scope.skipped] : []);
169
+ for (const file of rootFile ? [rootFile, ...candidates] : candidates) {
170
+ const sourcePath = relativeInstructionPath(this.root, file.path);
171
+ if (!isProjectInstructionMessageSource({ type: 'project-instructions', files: [sourcePath] })) {
172
+ skipped.push({
173
+ path: file.path,
174
+ reason: 'its project-relative provenance is not a canonical bounded AGENTS.md path',
175
+ });
176
+ continue;
177
+ }
178
+ if (selected.length >= MAX_PROJECT_INSTRUCTION_SOURCE_FILES ||
179
+ used + file.text.length > MAX_TOTAL_PROJECT_INSTRUCTION_CHARS) {
180
+ skipped.push({
181
+ path: file.path,
182
+ reason: `the live project-instruction snapshot is limited to ${MAX_TOTAL_PROJECT_INSTRUCTION_CHARS} characters and ${MAX_PROJECT_INSTRUCTION_SOURCE_FILES} files`,
183
+ });
184
+ continue;
185
+ }
186
+ selected.push(file);
187
+ used += file.text.length;
188
+ }
189
+ selected.sort((a, b) => scopeDepth(this.root, a) - scopeDepth(this.root, b) || a.path.localeCompare(b.path));
190
+ return {
191
+ files: selected,
192
+ skipped: skipped.sort((a, b) => a.path.localeCompare(b.path)),
193
+ };
194
+ }
195
+ snapshot() {
196
+ const { files } = this.view();
197
+ const prompt = composeLivePrompt(this.root, files);
198
+ return prompt
199
+ ? createProjectInstructionMessage(prompt, files.map((file) => relativeInstructionPath(this.root, file.path)))
200
+ : null;
201
+ }
202
+ snapshotKey(snapshot) {
203
+ return snapshot ? JSON.stringify([snapshot.source, snapshot.content]) : 'null';
204
+ }
205
+ snapshotKeyFromMessages(messages) {
206
+ for (let index = messages.length - 1; index >= 0; index -= 1) {
207
+ const message = messages[index];
208
+ if (message?.role === 'user' &&
209
+ message.source?.type === 'project-instructions' &&
210
+ isProjectInstructionMessageSource(message.source)) {
211
+ return this.snapshotKey(message);
212
+ }
213
+ }
214
+ return 'null';
215
+ }
216
+ }
217
+ //# sourceMappingURL=project-tracker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-tracker.js","sourceRoot":"","sources":["../../src/context/project-tracker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC7E,OAAO,EACN,oCAAoC,EAKpC,+BAA+B,EAC/B,iCAAiC,GACjC,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAA;AAEjE,OAAO,EACN,qBAAqB,EACrB,kBAAkB,EAGlB,qBAAqB,EACrB,uBAAuB,GACvB,MAAM,cAAc,CAAA;AAErB,gEAAgE;AAChE,MAAM,CAAC,MAAM,mCAAmC,GAAG,OAAO,CAAA;AAQ1D,SAAS,aAAa,CAAC,IAAY;IAClC,IAAI,CAAC;QACJ,OAAO,YAAY,CAAC,IAAI,CAAC,CAAA;IAC1B,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,OAAO,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC;AACF,CAAC;AAED,SAAS,SAAS,CAAC,IAAY,EAAE,SAAiB;IACjD,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;IACrC,OAAO,GAAG,KAAK,E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C,CAAC,CAAC,IAAI,CAAC,CAAC;SAC7D,CAAA;IACF,CAAC;IAEO,QAAQ;QACf,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;QAC7B,MAAM,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAClD,OAAO,MAAM;YACZ,CAAC,CAAC,+BAA+B,CAC/B,MAAM,EACN,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAClE;YACF,CAAC,CAAC,IAAI,CAAA;IACR,CAAC;IAEO,WAAW,CAAC,QAA4B;QAC/C,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;IAC/E,CAAC;IAEO,uBAAuB,CAAC,QAA4B;QAC3D,KAAK,IAAI,KAAK,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;YAC9D,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;YAC/B,IACC,OAAO,EAAE,IAAI,KAAK,MAAM;gBACxB,OAAO,CAAC,MAAM,EAAE,IAAI,KAAK,sBAAsB;gBAC/C,iCAAiC,CAAC,OAAO,CAAC,MAAM,CAAC,EAChD,CAAC;gBACF,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;YACjC,CAAC;QACF,CAAC;QACD,OAAO,MAAM,CAAA;IACd,CAAC;CACD"}
@@ -1,4 +1,4 @@
1
- import { type Logger, type SandboxProvider } from '@namzu/sdk';
1
+ import { type Logger, type SandboxEnvironment, type SandboxIsolationControl, type SandboxProvider } from '@namzu/sdk';
2
2
  import type { SandboxConfig } from '../config/schema.js';
3
3
  /**
4
4
  * The sandbox a CLI run executes its commands in.
@@ -13,19 +13,39 @@ import type { SandboxConfig } from '../config/schema.js';
13
13
  * On by default now. What it enforces is a property of the machine, and
14
14
  * this module's other job is to make sure nobody has to guess which.
15
15
  */
16
- export interface ResolvedSandbox {
17
- /** Absent when the operator turned it off. */
18
- readonly provider?: SandboxProvider;
19
- /** One line for the operator, always — including when it is off. */
20
- readonly notice: string;
16
+ /**
17
+ * What a reader needs to know about the sandbox, without the live provider.
18
+ *
19
+ * Split out so `/status` can be handed the facts rather than the object: the
20
+ * provider is a running thing with a filesystem under it, and a render
21
+ * function has no business holding one.
22
+ */
23
+ export interface SandboxSummary {
21
24
  /**
22
25
  * True when commands run on the host with no confinement.
23
26
  *
24
- * Either because the sandbox is off, or because this platform's
25
- * environment enforces nothing. A caller that wants to warn louder in
26
- * that case does not have to re-derive it from the notice text.
27
+ * Either because the sandbox is off, or because this platform's environment
28
+ * enforces nothing. A caller that wants to warn louder in that case does not
29
+ * have to re-derive it from the notice text.
27
30
  */
28
31
  readonly unconfined: boolean;
32
+ /** Absent when the operator turned the sandbox off. */
33
+ readonly environment?: SandboxEnvironment;
34
+ /** Controls this machine actually applies to a spawned command. */
35
+ readonly enforced: readonly SandboxIsolationControl[];
36
+ /**
37
+ * Controls the operator DEMANDED, which is not recoverable from the line
38
+ * above: a host that supplies `filesystem` anyway looks identical to one
39
+ * where it was insisted on, and only the second is a guarantee that
40
+ * survives moving machines.
41
+ */
42
+ readonly required: readonly SandboxIsolationControl[];
43
+ }
44
+ export interface ResolvedSandbox extends SandboxSummary {
45
+ /** Absent when the operator turned it off. */
46
+ readonly provider?: SandboxProvider;
47
+ /** One line for the operator, always — including when it is off. */
48
+ readonly notice: string;
29
49
  }
30
50
  /**
31
51
  * Build the sandbox for a run, or explain why there is none.
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/context/sand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AAgB,SAAQ,cAAc;IACtD,8CAA8C;IAC9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAA;IACnC,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,GAAG,SAAS,GAAG,eAAe,CA+C9F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,GAAG,MAAM,CAEjF"}
@@ -14,6 +14,8 @@ export function resolveSandbox(log, config) {
14
14
  return {
15
15
  notice: "Sandbox off by configuration: commands run in this process, with this shell's environment. Remove `sandbox.enabled: false` to turn it back on.",
16
16
  unconfined: true,
17
+ enforced: [],
18
+ required: (config?.requireIsolation ?? []),
17
19
  };
18
20
  }
19
21
  const required = (config?.requireIsolation ?? []);
@@ -33,6 +35,9 @@ export function resolveSandbox(log, config) {
33
35
  provider,
34
36
  notice: `Sandbox on (${provider.environment}), but this platform enforces none of ${SANDBOX_ISOLATION_CONTROLS.join(', ')} — commands are not confined. Name what you need under \`sandbox.requireIsolation\` to be refused instead of surprised.`,
35
37
  unconfined: true,
38
+ environment: provider.environment,
39
+ enforced: [],
40
+ required,
36
41
  };
37
42
  }
38
43
  return {
@@ -41,6 +46,9 @@ export function resolveSandbox(log, config) {
41
46
  ? `Sandbox on (${provider.environment}): enforcing ${enforced.join(', ')}.`
42
47
  : `Sandbox on (${provider.environment}): enforcing ${enforced.join(', ')}; NOT enforcing ${missing.join(', ')}.`,
43
48
  unconfined: false,
49
+ environment: provider.environment,
50
+ enforced,
51
+ required,
44
52
  };
45
53
  }
46
54
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../src/context/sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EAEpB,0BAA0B,EAG1B,WAAW,GACX,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AA0B,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IAEpE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,8DAA8D;QAC9D,qEAAqE;QACrE,iDAAiD;QACjD,OAAO;YACN,QAAQ;YACR,MAAM,EAAE,eAAe,QAAQ,CAAC,WAAW,yCAAyC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,yHAAyH;YAClP,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,QAAQ,EAAE,EAAE;YACZ,QAAQ;SACR,CAAA;IACF,CAAC;IAED,OAAO;QACN,QAAQ;QACR,MAAM,EACL,OAAO,CAAC,MAAM,KAAK,CAAC;YACnB,CAAC,CAAC,eAAe,QAAQ,CAAC,WAAW,gBAAgB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;YAC3E,CAAC,CAAC,eAAe,QAAQ,CAAC,WAAW,gBAAgB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;QAClH,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,QAAQ;QACR,QAAQ;KACR,CAAA;AACF,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,uBAAuB,CAAC,OAAwB;IAC/D,OAAO,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAA;AAC5C,CAAC"}
@@ -37,10 +37,11 @@
37
37
  * nothing else is. A caller who cannot tell them
38
38
  * apart matches on the message string, and then
39
39
  * the message can never be reworded.
40
- * 78 EXIT_BAD_CONFIG — sysexits EX_CONFIG; a config file is present and
41
- * its contents could not be established, so the
42
- * run refused to start rather than continue with
43
- * settings it failed to read. Distinct from 2 for
40
+ * 78 EXIT_BAD_CONFIG — sysexits EX_CONFIG; a config source is present
41
+ * and cannot be read or contains a known setting
42
+ * with an invalid value, so the run refuses rather
43
+ * than silently substituting another setting.
44
+ * Distinct from 2 for
44
45
  * the reason 2 is distinct from 0: "namzu is not
45
46
  * configured here" and "your configuration is
46
47
  * unreadable" are fixed by opposite actions, and a