@gaunt-sloth/agent 2.0.0-alpha.2 → 2.0.0-alpha.4

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 (42) hide show
  1. package/README.md +9 -0
  2. package/dist/builtInToolsConfig.js +11 -2
  3. package/dist/builtInToolsConfig.js.map +1 -1
  4. package/dist/core/GthDeepAgent.d.ts +75 -0
  5. package/dist/core/GthDeepAgent.js +257 -21
  6. package/dist/core/GthDeepAgent.js.map +1 -1
  7. package/dist/core/deepAgentPermissions.d.ts +29 -11
  8. package/dist/core/deepAgentPermissions.js +67 -26
  9. package/dist/core/deepAgentPermissions.js.map +1 -1
  10. package/dist/mcp/OAuthClientProviderImpl.js +2 -2
  11. package/dist/mcp/OAuthClientProviderImpl.js.map +1 -1
  12. package/dist/middleware/registry.d.ts +1 -1
  13. package/dist/middleware/registry.js +1 -1
  14. package/dist/middleware/types.d.ts +1 -1
  15. package/dist/middleware/types.js +1 -1
  16. package/dist/modules/acpModule.d.ts +5 -2
  17. package/dist/modules/acpModule.js +5 -2
  18. package/dist/modules/acpModule.js.map +1 -1
  19. package/dist/modules/interactiveSessionModule.js +81 -4
  20. package/dist/modules/interactiveSessionModule.js.map +1 -1
  21. package/dist/tools/GthDevToolkit.d.ts +72 -1
  22. package/dist/tools/GthDevToolkit.js +230 -18
  23. package/dist/tools/GthDevToolkit.js.map +1 -1
  24. package/dist/tools/shell/allowlist.d.ts +11 -0
  25. package/dist/tools/shell/allowlist.js +12 -0
  26. package/dist/tools/shell/allowlist.js.map +1 -0
  27. package/dist/tools/shell/arity.d.ts +11 -0
  28. package/dist/tools/shell/arity.js +12 -0
  29. package/dist/tools/shell/arity.js.map +1 -0
  30. package/dist/tools/shell/env.d.ts +22 -0
  31. package/dist/tools/shell/env.js +110 -0
  32. package/dist/tools/shell/env.js.map +1 -0
  33. package/dist/tools/shell/hardline.d.ts +15 -0
  34. package/dist/tools/shell/hardline.js +88 -0
  35. package/dist/tools/shell/hardline.js.map +1 -0
  36. package/dist/tools/shell/normalize.d.ts +10 -0
  37. package/dist/tools/shell/normalize.js +11 -0
  38. package/dist/tools/shell/normalize.js.map +1 -0
  39. package/dist/tools/shell/outputBuffer.d.ts +53 -0
  40. package/dist/tools/shell/outputBuffer.js +157 -0
  41. package/dist/tools/shell/outputBuffer.js.map +1 -0
  42. package/package.json +8 -8
package/README.md CHANGED
@@ -8,9 +8,18 @@ The deep-agent runtime for Gaunt Sloth. Consolidates what were previously
8
8
  - MCP client + OAuth provider
9
9
  - A2A client and tools
10
10
  - The AG-UI server (`startAgUiServer`) and interactive session module
11
+ - The ACP (Agent Client Protocol) server (`startAcpServer`), exposed as the
12
+ `gaunt-sloth-acp` binary
11
13
  - The `createResolvers` tool/middleware resolver wiring
12
14
 
13
15
  It builds on `@gaunt-sloth/core` (config, provider factory, lean langchain runtime).
14
16
 
17
+ > **Running the ACP server:** prefer `gaunt-sloth --acp-agent` from the
18
+ > [`gaunt-sloth`](../app) app, not the standalone `gaunt-sloth-acp` binary. The LLM
19
+ > providers are `peerDependencies` of `@gaunt-sloth/core` that only the app declares, so a
20
+ > bare `@gaunt-sloth/agent` install has no providers to construct a model from. See the
21
+ > [app README → ACP server](../app/README.md#acp-server-editor-integration) for setup and a
22
+ > Zed `settings.json` example.
23
+
15
24
  > `@gaunt-sloth/tools` and `@gaunt-sloth/api` are deprecated and now re-export
16
25
  > from this package.
@@ -47,10 +47,19 @@ export async function getDefaultTools(config, command) {
47
47
  return [...filesystemTools, ...devTools, ...customTools, ...builtInTools];
48
48
  }
49
49
  async function filterDevTools(command, devToolConfig) {
50
- if ((command !== 'code' && command !== 'exec') || !devToolConfig) {
50
+ // Dev tools only apply to the do-the-job commands (`code` / `exec`; `ask --write` is mapped
51
+ // to `code` by the caller). EXT-12: for `code` the toolkit is constructed even when no
52
+ // devTools config is present, so the shell tool's absent-config default (ON in `code`) can
53
+ // emit `run_shell_command` (still gated). For `exec` we keep the prior behaviour — no config
54
+ // means no dev tools — by short-circuiting when the config is absent.
55
+ if (command !== 'code' && command !== 'exec') {
51
56
  return [];
52
57
  }
53
- const toolkit = new GthDevToolkit(devToolConfig);
58
+ if (command === 'exec' && !devToolConfig) {
59
+ return [];
60
+ }
61
+ // Pass the command so GthDevToolkit resolves the shell default for the active mode.
62
+ const toolkit = new GthDevToolkit(devToolConfig ?? {}, command);
54
63
  return [...toolkit.getTools()];
55
64
  }
56
65
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"builtInToolsConfig.js","sourceRoot":"","sources":["../src/builtInToolsConfig.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,oBAAoB,MAAM,oCAAoC,CAAC;AAGtE,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,OAAO,aAAa,MAAM,6BAA6B,CAAC;AACxD,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAE9D;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC;;OAEG;IACH,iBAAiB,EAAE,mCAAmC;IACtD;;OAEG;IACH,aAAa,EAAE,+BAA+B;IAC9C;;OAEG;IACH,iBAAiB,EAAE,mCAAmC;CAC9C,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAAiB,EACjB,OAAoB;IAEpB,MAAM,eAAe,GAAG,qBAAqB,CAC3C,MAAM,CAAC,UAAU,EACjB,MAAM,CAAC,QAAQ,EACf,MAAM,CAAC,aAAa,CACrB,CAAC;IACF,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IACnD,2FAA2F;IAC3F,8FAA8F;IAC9F,6FAA6F;IAC7F,6DAA6D;IAC7D,MAAM,QAAQ,GAAG,OAAO,KAAK,KAAK,IAAI,MAAM,CAAC,YAAY,KAAK,IAAI,CAAC;IACnE,MAAM,aAAa,GACjB,OAAO,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AM,CAAC,YAAY,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;QAC3C,IAAI,QAAQ,IAAI,wBAAwB,EAAE,CAAC;YACzC,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,MAAM,MAAM,CACvB,wBAAwB,CAAC,QAAiD,CAAC,CAC5E,CAAC;gBACF,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;YAC/B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,cAAc,CAAC,iCAAiC,QAAQ,MAAM,KAAK,EAAE,CAAC,CAAC;YACzE,CAAC;QACH,CAAC;aAAM,CAAC;YACN,cAAc,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC;QACvD,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -3,6 +3,7 @@ import { GthAbstractAgent } from '@gaunt-sloth/core/core/GthAbstractAgent.js';
3
3
  import { type GthCommand } from '@gaunt-sloth/core/core/types.js';
4
4
  import type { StructuredToolInterface } from '@langchain/core/tools';
5
5
  import type { BaseCheckpointSaver } from '@langchain/langgraph';
6
+ import { type InterruptOnConfig } from 'langchain';
6
7
  import { type FilesystemPermission } from '#src/core/deepAgentPermissions.js';
7
8
  import type { DebugCapture, DebugRequestExtras } from '#src/core/debugCapture.js';
8
9
  /**
@@ -31,6 +32,18 @@ export interface GthDeepAgentParams {
31
32
  * no prompt content is composed (lets deepagents use only its base prompt).
32
33
  */
33
34
  systemPrompt: string | undefined;
35
+ /**
36
+ * Per-tool human-in-the-loop configuration passed straight to
37
+ * `createDeepAgent({ interruptOn })` (deepagents installs LangChain's
38
+ * `humanInTheLoopMiddleware` for it). A matching tool call suspends the graph with a
39
+ * `__interrupt__` (a `HITLRequest`) so a consumer can approve/reject before the tool runs;
40
+ * resume with `new Command({ resume: { decisions: [...] } })` on the same `thread_id`.
41
+ *
42
+ * gsloth currently sets this only for the opt-in `run_shell_command` tool (when its
43
+ * `devTools.shell` is enabled and `devTools.shellYolo` is NOT). Left `undefined` otherwise —
44
+ * including under yolo — so no tool is gated and runs never suspend for approval.
45
+ */
46
+ interruptOn?: Record<string, boolean | InterruptOnConfig>;
34
47
  }
35
48
  /**
36
49
  * Deep agent: builds a `createDeepAgent` graph (deepagents). All run/stream/event
@@ -67,7 +80,69 @@ export declare class GthDeepAgent extends GthAbstractAgent {
67
80
  * runner ({@link init}) and the `deepagents-acp` ACP entry.
68
81
  */
69
82
  buildDeepAgentParams(command: GthCommand | undefined, configIn: GthConfig): Promise<GthDeepAgentParams>;
83
+ /**
84
+ * Resolve the {@link GthDevToolsConfig} that applies to the active command, mirroring the
85
+ * per-command selection in `builtInToolsConfig.getDefaultTools` (which is what actually emits
86
+ * the dev tools): `exec` → `commands.exec.devTools`, `ask --write` → `commands.ask.devTools`,
87
+ * otherwise (`code`) → `commands.code.devTools`. Returns `undefined` for any other command,
88
+ * matching the toolkit being inert there. Kept private and side-effect-free so the interrupt
89
+ * wiring above and the tool emission stay in lockstep.
90
+ */
91
+ private getEffectiveDevToolsConfig;
70
92
  }
93
+ /**
94
+ * EXT-22: shared virtualMode path-namespace guidance — ONE source of truth used by BOTH the S2
95
+ * early-framing note ({@link appendVirtualCwdNote}, injected into gsloth's composed systemPrompt =
96
+ * block 0) and the S1 last-word correction middleware
97
+ * ({@link createPathNamespaceCorrectionMiddleware}, appended after deepagents' `/`-rooted line).
98
+ *
99
+ * In a virtualMode `code` session (EXT-16, e.g. Windows) the deepagents filesystem tools use a
100
+ * VIRTUAL `/` root (= the working dir) while `run_shell_command` uses REAL native OS paths; the
101
+ * model conflates the two forms. This text draws the distinction and steers toward cwd-relative
102
+ * paths (the one form both tool families read alike).
103
+ *
104
+ * It deliberately does NOT equate the virtual root with a specific real path (no "`/` = D:\\work"):
105
+ * virtualMode withholds the real cwd on purpose (see the systemPrompt gate in {@link
106
+ * GthDeepAgent.init}), so the guidance is about the DISTINCTION between the two namespaces and the
107
+ * safety of relative paths, not a mapping between them.
108
+ */
109
+ export declare const PATH_NAMESPACE_GUIDANCE: string;
110
+ /**
111
+ * EXT-22 (S2): virtualMode variant of {@link appendCwdNote}. On the `code` path when the fs
112
+ * backend runs in virtualMode (EXT-16), inject the shared path-namespace guidance EARLY in
113
+ * gsloth's composed systemPrompt (block 0) so the model is framed before deepagents' own prompt.
114
+ *
115
+ * This is early framing only: deepagents' hardcoded `/`-rooted line lands in a LATER block and can
116
+ * partially override block 0, so the authoritative last word is delivered by the S1 middleware
117
+ * ({@link createPathNamespaceCorrectionMiddleware}); see handoff/spike-systemmessage-ordering.md.
118
+ * Returns the note alone when there is no base prompt.
119
+ */
120
+ export declare function appendVirtualCwdNote(systemPrompt: string | undefined): string;
121
+ /**
122
+ * EXT-22 (S1): the load-bearing path-namespace correction. A gsloth `wrapModelCall` middleware
123
+ * runs INNERMOST (inside deepagents' filesystem middleware), so appending a trailing block to
124
+ * `request.systemMessage` lands AFTER deepagents' hardcoded "All file paths must start with a /."
125
+ * line — giving gsloth the last word on path semantics (empirically verified; see
126
+ * handoff/spike-systemmessage-ordering.md). It APPENDS via `request.systemMessage.concat(...)`
127
+ * (mirroring how deepagents appends its own fs prompt), never string-splices, and returns a NEW
128
+ * request so it never mutates persisted state (no compounding across turns).
129
+ *
130
+ * `appendCorrection` gates it to `code` + virtualMode: only there do the fs virtual `/` root and
131
+ * the shell's real-OS paths diverge. On POSIX real-path mode deepagents' "start with /" is
132
+ * literally true, so the middleware is a transparent pass-through (like the debug-capture
133
+ * middleware when no sink is attached).
134
+ */
135
+ export declare function createPathNamespaceCorrectionMiddleware(appendCorrection: boolean): import("langchain").AgentMiddleware<undefined, undefined, unknown, readonly (import("@langchain/core/tools").ClientTool | import("@langchain/core/tools").ServerTool)[], readonly []>;
136
+ /**
137
+ * EXT-13 (part b): append a real-cwd / path-model note to the composed code-mode system prompt.
138
+ *
139
+ * The default code-mode backend runs in REAL-path mode (no virtualMode), so the deepagents fs
140
+ * tools and `run_shell_command` share one real-absolute-path namespace rooted at `cwd`. Neither
141
+ * deepagents' base prompt nor `.gsloth.code.md` states the actual cwd, so without this the model
142
+ * assumes `/` is cwd and hands `/`-rooted paths to the real-fs shell. The cwd is injected
143
+ * dynamically (never baked into the .md). Returns the note alone when there is no base prompt.
144
+ */
145
+ export declare function appendCwdNote(systemPrompt: string | undefined, cwd: string): string;
71
146
  /**
72
147
  * Assemble the non-message request parts ({@link DebugRequestExtras}) for the `/debug`
73
148
  * panel from a `wrapModelCall` request, defensively and key-free. Never throws (the caller
@@ -1,3 +1,4 @@
1
+ import { isShellToolEnabled } from '@gaunt-sloth/core/config.js';
1
2
  import { GthAbstractAgent } from '@gaunt-sloth/core/core/GthAbstractAgent.js';
2
3
  import { StatusLevel } from '@gaunt-sloth/core/core/types.js';
3
4
  import { debugLog, debugLogObject } from '@gaunt-sloth/core/utils/debugUtils.js';
@@ -7,6 +8,21 @@ import { AIMessage, ToolMessage } from '@langchain/core/messages';
7
8
  import { createMiddleware } from 'langchain';
8
9
  import { createDeepAgent, FilesystemBackend } from 'deepagents';
9
10
  import { buildPermissions, FILESYSTEM_TOOL_NAMES, } from '#src/core/deepAgentPermissions.js';
11
+ import { ShellCommandFailedError } from '#src/tools/GthDevToolkit.js';
12
+ /**
13
+ * EXT-16: decide whether the deepagents filesystem backend must run in virtualMode.
14
+ *
15
+ * deepagents' permission layer (`validatePath`) requires POSIX `/`-rooted glob paths, and its
16
+ * fs tools hand the SAME model-supplied path string to both the permission check and the native
17
+ * `path.resolve`/`fs` backend. On Windows a real cwd is `D:\...`, which can satisfy neither side
18
+ * as one string, so the EXT-13 real-path sandbox throws `Error: path must be absolute` on every
19
+ * turn and the agent hangs. The precise trigger is "the real cwd is not POSIX-rooted", so we key
20
+ * off that directly (not just `win32`): when true, run virtualMode (cwd→`/`) with virtual
21
+ * permissions — the pre-EXT-13 known-good behavior. POSIX keeps the EXT-13 real-path namespace.
22
+ */
23
+ function shouldUseVirtualFs() {
24
+ return !getCurrentWorkDir().startsWith('/');
25
+ }
10
26
  /**
11
27
  * Deep agent: builds a `createDeepAgent` graph (deepagents). All run/stream/event
12
28
  * plumbing lives in {@link GthAbstractAgent}; this class only knows how to construct
@@ -83,32 +99,76 @@ export class GthDeepAgent extends GthAbstractAgent {
83
99
  return response;
84
100
  },
85
101
  });
86
- const middleware = [...params.middleware, toolCallStatusMiddleware, debugCaptureMiddleware];
102
+ // EXT-16: whether the deepagents fs backend runs in virtualMode. deepagents' permission layer
103
+ // requires POSIX `/`-rooted paths, so a Windows real cwd (`D:\...`) can't be expressed as a
104
+ // permission glob and the EXT-13 real-path mode hangs there (`Error: path must be absolute`).
105
+ // When the real cwd isn't POSIX-rooted, fall back to virtualMode (cwd→`/`) with virtual
106
+ // permissions — the pre-EXT-13 known-good Windows behavior. Computed here because the EXT-22 S1
107
+ // middleware (below), the backend, and the systemPrompt gate (further down) all key off it.
108
+ const useVirtualFs = shouldUseVirtualFs();
109
+ // EXT-22 (S1): last-word path-namespace correction. Appends the shared guidance as a trailing
110
+ // system-message block ONLY in code + virtualMode (where the fs virtual `/` root and the
111
+ // shell's real-OS paths diverge); a transparent pass-through otherwise. Added LAST in the
112
+ // middleware array so, being the innermost wrapModelCall, its block lands AFTER deepagents'
113
+ // "All file paths must start with a /." line (see handoff/spike-systemmessage-ordering.md).
114
+ const pathNamespaceCorrectionMiddleware = createPathNamespaceCorrectionMiddleware(this.command === 'code' && useVirtualFs);
115
+ const middleware = [
116
+ ...params.middleware,
117
+ toolCallStatusMiddleware,
118
+ debugCaptureMiddleware,
119
+ pathNamespaceCorrectionMiddleware,
120
+ ];
87
121
  this.statusUpdate(StatusLevel.INFO, `Loaded middleware: ${middleware.map((m) => m.name).join(', ')}`);
88
- // Default: a virtual-root sandbox anchored at cwd (absolute paths / `..` cannot escape).
89
- // `--allow-dir` (config.allowDirs) opts into widening: drop virtualMode so the listed real
90
- // directories are reachable, and rely on the permission allow-rules (built in
91
- // buildDeepAgentParams) to constrain access to cwd + those dirs. This removes a guardrail,
92
- // so it is announced loudly by the exec command and surfaced here in the status log.
122
+ // EXT-13: the backend always runs in REAL-path mode (virtualMode off) so the deepagents fs
123
+ // tools and the EXT-9 run_shell_command tool share ONE path namespace real absolute paths
124
+ // rooted at cwd. Containment is enforced entirely by the permission allow/deny globs built in
125
+ // buildDeepAgentParams (default: allow cwd/**, deny /**), which match what virtualMode used to
126
+ // give for free (see deepAgentPermissions + the EXT-13 symlink/`..` parity tests).
127
+ // `--allow-dir` (config.allowDirs) further widens those allow-rules to reach extra real dirs;
128
+ // it removes a guardrail, so it is announced loudly by the exec command and surfaced here.
93
129
  const allowDirs = this.config?.allowDirs;
94
130
  const widenFs = Array.isArray(allowDirs) && allowDirs.length > 0;
95
131
  if (widenFs) {
96
- this.statusUpdate(StatusLevel.WARNING, `Filesystem sandbox widened beyond cwd (--allow-dir): ${allowDirs.join(', ')}`);
132
+ this.statusUpdate(StatusLevel.WARNING, `Filesystem sandbox widened beyond cwd (--allow-dir): ${allowDirs.join(', ')}` +
133
+ (useVirtualFs
134
+ ? ' — note: on this platform the sandbox runs in virtual mode, so widening beyond cwd is not applied.'
135
+ : ''));
97
136
  }
98
137
  const backend = new FilesystemBackend({
99
138
  rootDir: getCurrentWorkDir(),
100
- virtualMode: !widenFs,
139
+ virtualMode: useVirtualFs,
101
140
  });
141
+ // EXT-13 (part b): on the local-runner code path the model used to be told nothing about
142
+ // where it is, so it assumed `/` was cwd and fed `/`-rooted paths to the real-fs shell. Now
143
+ // the backend uses real absolute paths (above), so inject the dynamic real cwd + path model
144
+ // into the prompt the model actually receives. Code mode only — the surface with full fs +
145
+ // shell access; the ACP transport keeps virtualMode and re-roots per session, so this
146
+ // real-path note must NOT leak there (which is why it lives in init(), not the
147
+ // transport-agnostic buildDeepAgentParams).
148
+ // In virtualMode (EXT-16, Windows) the real-cwd note must NOT be injected — it would mislabel
149
+ // the namespace (the fs tools' `/` is the virtual root, not the real cwd). Instead, EXT-22 (S2)
150
+ // injects the virtualMode path-namespace note so the model is told EARLY that the fs virtual
151
+ // `/` root and run_shell_command's real-OS paths differ (the S1 middleware repeats it as the
152
+ // authoritative last word after deepagents' `/`-rooted line). Non-code paths get neither.
153
+ const systemPrompt = this.command === 'code'
154
+ ? useVirtualFs
155
+ ? appendVirtualCwdNote(params.systemPrompt)
156
+ : appendCwdNote(params.systemPrompt, getCurrentWorkDir())
157
+ : params.systemPrompt;
102
158
  this.agent = createDeepAgent({
103
159
  model: params.model,
104
160
  tools: params.tools,
105
161
  // gsloth's composed prompt, combined ADDITIVELY by deepagents with its base + fs prompts
106
162
  // into a single system message (avoids the two-system-message Anthropic rejection).
107
- systemPrompt: params.systemPrompt,
163
+ systemPrompt,
108
164
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
109
165
  middleware: middleware,
110
166
  backend,
111
167
  permissions: params.permissions,
168
+ // Per-tool human-in-the-loop gating (e.g. run_shell_command confirmation). When set,
169
+ // deepagents installs humanInTheLoopMiddleware so a matching tool call suspends the graph
170
+ // for approval; `undefined` (the default, and under yolo) leaves every tool ungated.
171
+ interruptOn: params.interruptOn,
112
172
  checkpointer,
113
173
  });
114
174
  debugLog('Deep agent created successfully');
@@ -202,11 +262,20 @@ export class GthDeepAgent extends GthAbstractAgent {
202
262
  }
203
263
  return true;
204
264
  });
205
- // Soften deepagents' fail-hard filesystem permission denials. By default a denied
206
- // read/write THROWS, which aborts the whole run; wrap tool calls so a denial becomes
207
- // a recoverable ToolMessage instead, letting the model continue and report it. This
208
- // preserves gsloth's recoverable-denial UX (the old GthFileSystemToolkit returned a
209
- // message rather than throwing).
265
+ // Soften deepagents' fail-hard filesystem tool throws. By default the permission layer
266
+ // THROWS on both a denied read/write AND on a malformed path the model supplied a relative
267
+ // path, a `..`/`~` segment, or an empty string (deepagents' validatePath, run BEFORE the
268
+ // permission check in enforcePermission). Any of these aborts the WHOLE run. On the AG-UI
269
+ // transport that throw propagates out of streamWithEvents into the run handler's catch, which
270
+ // emits RUN_ERROR and ends the response WITHOUT a terminal RUN_FINISHED — and since AG-UI's
271
+ // protocol makes RUN_ERROR terminal ("no further events can be sent"), a consumer waiting for
272
+ // RUN_FINISHED hangs (EXT-24). Wrap tool calls so each of these becomes a recoverable error
273
+ // ToolMessage instead, letting the model observe the mistake, retry with a good path, and
274
+ // finish the run normally (reaching RUN_FINISHED). This preserves gsloth's recoverable-denial
275
+ // UX (the old GthFileSystemToolkit returned a message rather than throwing). Only these known
276
+ // fs path/permission messages are caught; every other throw (GraphInterrupt from a client-tool
277
+ // interrupt stub, AbortError on client disconnect, unexpected errors) is rethrown untouched so
278
+ // control-flow and genuine failures still surface.
210
279
  const fsDenialSoftening = createMiddleware({
211
280
  name: 'GthDeepFsDenialSoftening',
212
281
  wrapToolCall: async (request, handler) => {
@@ -215,8 +284,11 @@ export class GthDeepAgent extends GthAbstractAgent {
215
284
  }
216
285
  catch (e) {
217
286
  const message = e instanceof Error ? e.message : String(e);
218
- if (/permission denied for (read|write)/i.test(message)) {
219
- debugLog(`Softened fs permission denial into a ToolMessage: ${message}`);
287
+ // deepagents fs enforcement throws (middleware/fs.ts enforcePermission +
288
+ // permissions/enforce.ts validatePath): a permission denial, or a path that is
289
+ // relative / contains ".." or "~" / is empty. All are recoverable model-input errors.
290
+ if (/permission denied for (read|write)|path must (be absolute|not contain|be a non-empty string)/i.test(message)) {
291
+ debugLog(`Softened fs tool throw into a ToolMessage: ${message}`);
220
292
  return new ToolMessage({
221
293
  content: message,
222
294
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -228,10 +300,44 @@ export class GthDeepAgent extends GthAbstractAgent {
228
300
  }
229
301
  },
230
302
  });
231
- // fsDenialSoftening first so it is the outermost wrapToolCall it must see the throw
232
- // from deepagents' permission-enforcing fs tools. The console-bound tool-call-status
233
- // middleware is NOT added here (see GthDeepAgentParams.middleware); the runner appends it.
234
- const middleware = [fsDenialSoftening, ...configuredMiddleware];
303
+ // EXT-20: sibling of fsDenialSoftening for the run_* (dev/shell) tools. GthDevToolkit's
304
+ // executeCommand now THROWS a ShellCommandFailedError on a non-zero exit or a timeout-kill
305
+ // (instead of resolving with the failure text), so the tool result no longer misreports
306
+ // status:'success' (✓). Catch it here and return an error ToolMessage that PRESERVES the full
307
+ // stdout/stderr body — the model's observation is unchanged except that status flips to
308
+ // 'error', which drives the ✗ (isError) glyph (GthAbstractAgent maps status==='error' →
309
+ // isError). Returning a ToolMessage (rather than rethrowing) also means the approved-then-failed
310
+ // command does NOT trigger a retry loop — it is a normal, observed tool result.
311
+ const shellExitSoftening = createMiddleware({
312
+ name: 'GthDeepShellExitSoftening',
313
+ wrapToolCall: async (request, handler) => {
314
+ try {
315
+ return await handler(request);
316
+ }
317
+ catch (e) {
318
+ if (e instanceof ShellCommandFailedError) {
319
+ debugLog(`Softened shell/dev command failure (exit ${e.exitCode ?? 'timeout'}) into an ` +
320
+ `error ToolMessage for '${e.command}'`);
321
+ return new ToolMessage({
322
+ content: e.output,
323
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
324
+ tool_call_id: request.toolCall?.id ?? '',
325
+ status: 'error',
326
+ });
327
+ }
328
+ throw e;
329
+ }
330
+ },
331
+ });
332
+ // fsDenialSoftening first so it is the outermost wrapToolCall — it must see the throw from
333
+ // deepagents' permission-enforcing fs tools. shellExitSoftening sits right after it (still
334
+ // outboard of any user-configured middleware, so it always sees the raw ShellCommandFailedError
335
+ // throw before a user wrapToolCall could transform it). Order between the two softeners is not
336
+ // load-bearing: they catch DISJOINT conditions (a permission-denied regex vs an
337
+ // `instanceof ShellCommandFailedError`) and each rethrows what it doesn't recognize, so neither
338
+ // can swallow the other. The console-bound tool-call-status middleware is NOT added here (see
339
+ // GthDeepAgentParams.middleware); the runner appends it.
340
+ const middleware = [fsDenialSoftening, shellExitSoftening, ...configuredMiddleware];
235
341
  // Map gsloth's .aiignore + filesystem mode onto deepagents permission rules. When
236
342
  // `--allow-dir` widens the sandbox, the backend runs without virtualMode, so paths are REAL
237
343
  // absolute paths: constrain read+write to cwd + the allowed dirs (everything else denied),
@@ -242,7 +348,10 @@ export class GthDeepAgent extends GthAbstractAgent {
242
348
  allowDirs: Array.isArray(this.config.allowDirs) && this.config.allowDirs.length > 0
243
349
  ? this.config.allowDirs
244
350
  : undefined,
245
- });
351
+ },
352
+ // EXT-16: build virtual (`/`-rooted) permission rules when the backend will run in
353
+ // virtualMode (Windows), matching the FilesystemBackend created in init().
354
+ shouldUseVirtualFs());
246
355
  debugLogObject('Filesystem permissions', permissions);
247
356
  // Compose gsloth's system prompt (backstory + guidelines + per-command mode prompt +
248
357
  // system prompt) so identity profiles (Gaunt Sloth, sorcerer, fisher-alt, …) and
@@ -258,14 +367,141 @@ export class GthDeepAgent extends GthAbstractAgent {
258
367
  : readChatPrompt(this.config);
259
368
  const systemMessages = buildSystemMessages(this.config, modePrompt);
260
369
  const systemPrompt = typeof systemMessages[0]?.content === 'string' ? systemMessages[0].content : undefined;
370
+ // Gate the opt-in run_shell_command tool behind a per-command approval interrupt. The tool
371
+ // is only emitted (by GthDevToolkit, via builtInToolsConfig) when its devTools.shell flag is
372
+ // set; mirror the same per-command devTools resolution here so the interrupt is wired only
373
+ // when the tool actually exists. yolo (shellYolo) opts OUT of the confirmation: leave
374
+ // interruptOn undefined so the tool runs without suspending.
375
+ const devTools = this.getEffectiveDevToolsConfig();
376
+ // EXT-12 — pass the active command so the absent-config default (shell ON in `code`)
377
+ // is applied consistently with where the tool is actually emitted (GthDevToolkit).
378
+ const shellEnabled = isShellToolEnabled(devTools, this.command);
379
+ const interruptOn = shellEnabled && devTools?.shellYolo !== true
380
+ ? { run_shell_command: { allowedDecisions: ['approve', 'reject'] } }
381
+ : undefined;
382
+ if (interruptOn) {
383
+ this.statusUpdate(StatusLevel.INFO, 'Shell tool (run_shell_command) enabled with per-command approval (interruptOn).');
384
+ }
385
+ else if (shellEnabled) {
386
+ this.statusUpdate(StatusLevel.WARNING, 'Shell tool (run_shell_command) enabled in YOLO mode: commands run WITHOUT confirmation.');
387
+ }
261
388
  return {
262
389
  model: this.config.llm,
263
390
  tools: passThroughTools,
264
391
  permissions,
265
392
  middleware,
266
393
  systemPrompt,
394
+ interruptOn,
267
395
  };
268
396
  }
397
+ /**
398
+ * Resolve the {@link GthDevToolsConfig} that applies to the active command, mirroring the
399
+ * per-command selection in `builtInToolsConfig.getDefaultTools` (which is what actually emits
400
+ * the dev tools): `exec` → `commands.exec.devTools`, `ask --write` → `commands.ask.devTools`,
401
+ * otherwise (`code`) → `commands.code.devTools`. Returns `undefined` for any other command,
402
+ * matching the toolkit being inert there. Kept private and side-effect-free so the interrupt
403
+ * wiring above and the tool emission stay in lockstep.
404
+ */
405
+ getEffectiveDevToolsConfig() {
406
+ const config = this.config;
407
+ if (!config)
408
+ return undefined;
409
+ const command = this.command;
410
+ const askWrite = command === 'ask' && config.askWriteMode === true;
411
+ if (command === 'exec')
412
+ return config.commands?.exec?.devTools;
413
+ if (askWrite)
414
+ return config.commands?.ask?.devTools;
415
+ if (command === 'code')
416
+ return config.commands?.code?.devTools;
417
+ return undefined;
418
+ }
419
+ }
420
+ /**
421
+ * EXT-22: shared virtualMode path-namespace guidance — ONE source of truth used by BOTH the S2
422
+ * early-framing note ({@link appendVirtualCwdNote}, injected into gsloth's composed systemPrompt =
423
+ * block 0) and the S1 last-word correction middleware
424
+ * ({@link createPathNamespaceCorrectionMiddleware}, appended after deepagents' `/`-rooted line).
425
+ *
426
+ * In a virtualMode `code` session (EXT-16, e.g. Windows) the deepagents filesystem tools use a
427
+ * VIRTUAL `/` root (= the working dir) while `run_shell_command` uses REAL native OS paths; the
428
+ * model conflates the two forms. This text draws the distinction and steers toward cwd-relative
429
+ * paths (the one form both tool families read alike).
430
+ *
431
+ * It deliberately does NOT equate the virtual root with a specific real path (no "`/` = D:\\work"):
432
+ * virtualMode withholds the real cwd on purpose (see the systemPrompt gate in {@link
433
+ * GthDeepAgent.init}), so the guidance is about the DISTINCTION between the two namespaces and the
434
+ * safety of relative paths, not a mapping between them.
435
+ */
436
+ export const PATH_NAMESPACE_GUIDANCE = 'The filesystem tools (ls, read_file, write_file, edit_file, glob, grep) use a VIRTUAL root in ' +
437
+ 'this session: a leading `/` means your working directory, and their paths are written ' +
438
+ '`/`-rooted relative to it (this is what "all file paths must start with a /" refers to). That ' +
439
+ '`/` is NOT the real operating-system filesystem root. run_shell_command is different: it runs ' +
440
+ 'in the real operating system and uses real native paths (on Windows, e.g. ' +
441
+ '`C:\\Users\\...\\project`, with backslashes), never the virtual `/` root. A `/`-rooted path ' +
442
+ 'from the filesystem tools is NOT a valid shell path and must never be passed to ' +
443
+ 'run_shell_command. The one form that means the same thing to both tool families is a path ' +
444
+ 'RELATIVE to the working directory (e.g. `src/index.ts`); prefer relative paths for both. When ' +
445
+ 'you must be absolute, use `/`-rooted form ONLY for the filesystem tools and real native form ' +
446
+ 'ONLY for run_shell_command.';
447
+ /**
448
+ * EXT-22 (S2): virtualMode variant of {@link appendCwdNote}. On the `code` path when the fs
449
+ * backend runs in virtualMode (EXT-16), inject the shared path-namespace guidance EARLY in
450
+ * gsloth's composed systemPrompt (block 0) so the model is framed before deepagents' own prompt.
451
+ *
452
+ * This is early framing only: deepagents' hardcoded `/`-rooted line lands in a LATER block and can
453
+ * partially override block 0, so the authoritative last word is delivered by the S1 middleware
454
+ * ({@link createPathNamespaceCorrectionMiddleware}); see handoff/spike-systemmessage-ordering.md.
455
+ * Returns the note alone when there is no base prompt.
456
+ */
457
+ export function appendVirtualCwdNote(systemPrompt) {
458
+ const note = `Filesystem vs shell path namespaces: ${PATH_NAMESPACE_GUIDANCE}`;
459
+ return systemPrompt ? `${systemPrompt}\n\n${note}` : note;
460
+ }
461
+ /**
462
+ * EXT-22 (S1): the load-bearing path-namespace correction. A gsloth `wrapModelCall` middleware
463
+ * runs INNERMOST (inside deepagents' filesystem middleware), so appending a trailing block to
464
+ * `request.systemMessage` lands AFTER deepagents' hardcoded "All file paths must start with a /."
465
+ * line — giving gsloth the last word on path semantics (empirically verified; see
466
+ * handoff/spike-systemmessage-ordering.md). It APPENDS via `request.systemMessage.concat(...)`
467
+ * (mirroring how deepagents appends its own fs prompt), never string-splices, and returns a NEW
468
+ * request so it never mutates persisted state (no compounding across turns).
469
+ *
470
+ * `appendCorrection` gates it to `code` + virtualMode: only there do the fs virtual `/` root and
471
+ * the shell's real-OS paths diverge. On POSIX real-path mode deepagents' "start with /" is
472
+ * literally true, so the middleware is a transparent pass-through (like the debug-capture
473
+ * middleware when no sink is attached).
474
+ */
475
+ export function createPathNamespaceCorrectionMiddleware(appendCorrection) {
476
+ return createMiddleware({
477
+ name: 'GthDeepPathNamespaceCorrection',
478
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
479
+ wrapModelCall: async (request, handler) => {
480
+ if (!appendCorrection || !request?.systemMessage)
481
+ return handler(request);
482
+ const correction = 'IMPORTANT — path namespaces (authoritative; this overrides any earlier instruction that ' +
483
+ `implies every path is a simple \`/\`-rooted filesystem path): ${PATH_NAMESPACE_GUIDANCE}`;
484
+ return handler({ ...request, systemMessage: request.systemMessage.concat(correction) });
485
+ },
486
+ });
487
+ }
488
+ /**
489
+ * EXT-13 (part b): append a real-cwd / path-model note to the composed code-mode system prompt.
490
+ *
491
+ * The default code-mode backend runs in REAL-path mode (no virtualMode), so the deepagents fs
492
+ * tools and `run_shell_command` share one real-absolute-path namespace rooted at `cwd`. Neither
493
+ * deepagents' base prompt nor `.gsloth.code.md` states the actual cwd, so without this the model
494
+ * assumes `/` is cwd and hands `/`-rooted paths to the real-fs shell. The cwd is injected
495
+ * dynamically (never baked into the .md). Returns the note alone when there is no base prompt.
496
+ */
497
+ export function appendCwdNote(systemPrompt, cwd) {
498
+ const cwdNote = `Working directory: ${cwd}\n` +
499
+ 'Paths are real absolute filesystem paths (there is no virtual root). The working directory ' +
500
+ 'above is where this session runs; relative paths resolve against it, and both the filesystem ' +
501
+ 'tools (ls/glob/read_file/write_file/edit_file/grep) and run_shell_command operate on these ' +
502
+ 'same real paths. Check the current directory before filesystem operations and prefer absolute ' +
503
+ 'paths (or paths relative to the working directory); do not assume the current directory is "/".';
504
+ return systemPrompt ? `${systemPrompt}\n\n${cwdNote}` : cwdNote;
269
505
  }
270
506
  /**
271
507
  * Scalar model-param fields worth surfacing in the `/debug` panel. Deliberately an
@@ -1 +1 @@
1
- {"version":3,"file":"GthDeepAgent.js","sourceRoot":"","sources":["../../src/core/GthDeepAgent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAmB,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GAEtB,MAAM,mCAAmC,CAAC;AAiC3C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,YAAa,SAAQ,gBAAgB;IAChD;;;;;OAKG;IACI,YAAY,CAA2B;IAE9C,KAAK,CAAC,IAAI,CACR,OAA+B,EAC/B,QAAmB,EACnB,YAA8C;QAE9C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAElE,uFAAuF;QACvF,qFAAqF;QACrF,kEAAkE;QAClE,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY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