@gaunt-sloth/agent 2.0.0-alpha.35 → 2.0.0-alpha.36

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 (63) hide show
  1. package/README.md +9 -10
  2. package/cli-acp.js +20 -24
  3. package/dist/builtInToolsConfig.d.ts +2 -2
  4. package/dist/builtInToolsConfig.js +2 -2
  5. package/dist/core/debugCapture.d.ts +4 -5
  6. package/dist/core/debugCapture.js.map +1 -1
  7. package/dist/core/resolveAgentFactory.d.ts +10 -9
  8. package/dist/core/resolveAgentFactory.js +11 -12
  9. package/dist/core/resolveAgentFactory.js.map +1 -1
  10. package/dist/index.d.ts +2 -4
  11. package/dist/index.js +4 -5
  12. package/dist/index.js.map +1 -1
  13. package/dist/middleware/frontendImageInjectionMiddleware.d.ts +3 -2
  14. package/dist/middleware/frontendImageInjectionMiddleware.js +3 -2
  15. package/dist/middleware/frontendImageInjectionMiddleware.js.map +1 -1
  16. package/dist/middleware/registry.js +16 -3
  17. package/dist/middleware/registry.js.map +1 -1
  18. package/dist/modules/acp/acpAgentApp.d.ts +93 -0
  19. package/dist/modules/acp/acpAgentApp.js +593 -0
  20. package/dist/modules/acp/acpAgentApp.js.map +1 -0
  21. package/dist/modules/acp/acpPermissions.d.ts +60 -0
  22. package/dist/modules/acp/acpPermissions.js +158 -0
  23. package/dist/modules/acp/acpPermissions.js.map +1 -0
  24. package/dist/modules/acp/acpStdio.d.ts +41 -0
  25. package/dist/modules/acp/acpStdio.js +65 -0
  26. package/dist/modules/acp/acpStdio.js.map +1 -0
  27. package/dist/modules/acp/acpUpdates.d.ts +101 -0
  28. package/dist/modules/acp/acpUpdates.js +287 -0
  29. package/dist/modules/acp/acpUpdates.js.map +1 -0
  30. package/dist/modules/apiAgUiModule.js +8 -16
  31. package/dist/modules/apiAgUiModule.js.map +1 -1
  32. package/dist/modules/interactiveSessionModule.js +39 -6
  33. package/dist/modules/interactiveSessionModule.js.map +1 -1
  34. package/dist/tools/GthCustomToolkit.js +1 -1
  35. package/dist/tools/GthCustomToolkit.js.map +1 -1
  36. package/dist/tools/GthDevToolkit.d.ts +2 -2
  37. package/dist/tools/GthDevToolkit.js +8 -13
  38. package/dist/tools/GthDevToolkit.js.map +1 -1
  39. package/dist/tools/gthChecklistTool.js +4 -5
  40. package/dist/tools/gthChecklistTool.js.map +1 -1
  41. package/dist/tools/gthGrepTool.js +6 -6
  42. package/dist/tools/shell/workDir.d.ts +1 -10
  43. package/dist/tools/shell/workDir.js +10 -36
  44. package/dist/tools/shell/workDir.js.map +1 -1
  45. package/package.json +8 -9
  46. package/dist/core/GthDeepAgent.d.ts +0 -128
  47. package/dist/core/GthDeepAgent.js +0 -712
  48. package/dist/core/GthDeepAgent.js.map +0 -1
  49. package/dist/core/deepAgentPermissions.d.ts +0 -138
  50. package/dist/core/deepAgentPermissions.js +0 -309
  51. package/dist/core/deepAgentPermissions.js.map +0 -1
  52. package/dist/core/gthAcpServer.d.ts +0 -27
  53. package/dist/core/gthAcpServer.js +0 -82
  54. package/dist/core/gthAcpServer.js.map +0 -1
  55. package/dist/core/gthDeepAgentFactory.d.ts +0 -11
  56. package/dist/core/gthDeepAgentFactory.js +0 -17
  57. package/dist/core/gthDeepAgentFactory.js.map +0 -1
  58. package/dist/core/subagentProfiles.d.ts +0 -50
  59. package/dist/core/subagentProfiles.js +0 -76
  60. package/dist/core/subagentProfiles.js.map +0 -1
  61. package/dist/modules/acpModule.d.ts +0 -40
  62. package/dist/modules/acpModule.js +0 -86
  63. package/dist/modules/acpModule.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"GthDeepAgent.js","sourceRoot":"","sources":["../../src/core/GthDeepAgent.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,4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AAK,EAAE,OAAY,EAAE,OAAY,EAAE,EAAE;YAClD,IAAI,CAAC,gBAAgB,IAAI,CAAC,OAAO,EAAE,aAAa;gBAAE,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;YAC1E,MAAM,UAAU,GACd,0FAA0F;gBAC1F,iEAAiE,uBAAuB,EAAE,CAAC;YAC7F,OAAO,OAAO,CAAC,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC1F,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,iGAAiG;AACjG,iGAAiG;AACjG,iFAAiF"}
@@ -1,138 +0,0 @@
1
- import type { BackendProtocolV2, FilesystemPermission } from 'deepagents';
2
- export type { FilesystemPermission };
3
- /**
4
- * Tool names deepagents' filesystem middleware registers. This mirrors deepagents'
5
- * internal `FILESYSTEM_TOOL_NAMES` (which is declared in its types but not exported
6
- * at runtime). `createDeepAgent` throws on a name collision with any of these, so a
7
- * gsloth-supplied tool sharing one of these names is superseded by the deep agent's
8
- * built-in filesystem tool. Kept here as the single place the deep path references it.
9
- */
10
- export declare const FILESYSTEM_TOOL_NAMES: readonly ['ls', 'read_file', 'write_file', 'edit_file', 'glob', 'grep', 'execute'];
11
- /**
12
- * **Every tool name `createDeepAgent` registers on its own** — the filesystem set above plus the
13
- * tools its other standard middleware installs unconditionally: `write_todos` (`todoListMiddleware`)
14
- * and `task` (`createSubAgentMiddleware`). None of them ever appears in the tool array gsloth passes
15
- * `createDeepAgent`, so this is the only way the approval policy can see them.
16
- *
17
- * **It exists because the approval question is "what did the graph bind", not "what did we supply".**
18
- * `task` and `write_todos` have no entry in core's `BUILT_IN_TOOL_ACCESS`, so the two deterministic
19
- * rungs must escalate them — `task` most of all, since it delegates to a subagent. A set built from
20
- * `FILESYSTEM_TOOL_NAMES` alone left both bound and ungated at `manual` and `write`, under a rung
21
- * description promising to ask about anything else. A subagent's OWN calls are gated too —
22
- * `createSubAgentMiddleware` inherits this set, and a nested interrupt does reach the parent state
23
- * the runner drains (measured in `deepAgentNestedInterrupt.spec.ts`) — so gating `task` is about the
24
- * delegation itself being a thing the user agreed to, not about reaching the child's writes.
25
- *
26
- * Like {@link FILESYSTEM_TOOL_NAMES} this MIRRORS deepagents (its own `BUILTIN_TOOL_NAMES` is
27
- * declared in the types but not exported at runtime, and the graph must be handed `interruptOn`
28
- * before it exists, so the registered set cannot be read back). **It must track deepagents:** a tool
29
- * a future version registers itself and this list has not learned about is bound and ungated.
30
- * deepagents' async-task tools are deliberately absent — that middleware is installed only for
31
- * async subagents, which this backend never configures.
32
- */
33
- export declare const DEEP_AGENT_BUILT_IN_TOOL_NAMES: readonly ["ls", "read_file", "write_file", "edit_file", "glob", "grep", "execute", "write_todos", "task"];
34
- /** The slice of GthConfig the permission mapping consumes. */
35
- export interface PermissionConfigSlice {
36
- filesystem: string[] | 'all' | 'read' | 'none';
37
- aiignore?: {
38
- enabled?: boolean;
39
- patterns?: string[];
40
- };
41
- /**
42
- * Extra real filesystem roots to allow (`gth exec --allow-dir`). When present, the backend runs
43
- * WITHOUT virtualMode, so permission paths are real absolute paths: access is allow-listed to
44
- * cwd + these dirs and everything else is denied. Undefined/empty keeps the cwd-only sandbox.
45
- */
46
- allowDirs?: string[];
47
- }
48
- /**
49
- * Build allow+deny rules for the widened (`--allow-dir`) sandbox. Because the backend runs
50
- * without virtualMode, paths are REAL absolute paths, so we anchor allow rules at the resolved
51
- * absolute cwd and each allowed dir, then deny everything else. First-match-wins, so the allow
52
- * rules must come before the catch-all deny.
53
- */
54
- export declare function allowDirsToPermissions(allowDirs: string[]): FilesystemPermission[];
55
- /**
56
- * Convert `.aiignore` patterns (relative, .gitignore-ish) into deepagents deny rules.
57
- *
58
- * deepagents matches the path argument the model passes to a fs tool against ABSOLUTE
59
- * globs. EXT-13: the backend now runs WITHOUT virtualMode in both the default and widened
60
- * cases, so paths are REAL absolute paths and the caller passes the absolute cwd as `base`
61
- * to anchor these deny rules there.
62
- *
63
- * A bare pattern (`*.env`, `secret.txt`) should match at any depth, so we emit both a
64
- * top-level (`<base>/secret.txt`) and a recursive (`<base>/&#42;&#42;/secret.txt`) rule. A pattern
65
- * already containing "/" (`config/secrets.json`) is anchored as-is (plus a `/**` subtree rule).
66
- *
67
- * `base` defaults to "" (anchoring at the virtual root "/") for legacy callers; gsloth's
68
- * {@link buildPermissions} always passes the absolute cwd now.
69
- */
70
- export declare function aiignoreToPermissions(patterns: string[], base?: string): FilesystemPermission[];
71
- /**
72
- * Map gsloth's filesystem mode onto deepagents permission rules for the DEFAULT
73
- * (non-widen) code-mode sandbox.
74
- *
75
- * EXT-13: the default backend now runs WITHOUT virtualMode (real absolute paths), so
76
- * containment can no longer lean on the virtual-root chroot — it is enforced entirely by
77
- * these globs anchored at the REAL absolute cwd. We therefore allow read+write within
78
- * `cwd/**` (and `cwd`) and deny everything else (`/**`), mirroring what virtualMode gave
79
- * for free. An explicit `string[]` allow-list resolves each entry against the real cwd.
80
- *
81
- * - `all` → no extra restriction beyond the cwd sandbox (matches the old virtualMode
82
- * behavior, where `/` already meant cwd).
83
- * - `read` → deny all writes (the cwd sandbox still applies for reads).
84
- * - `none` → deny all reads and writes.
85
- * - `string[]` → allow each (cwd-resolved) dir, deny everything else.
86
- *
87
- * The `cwd` argument is injected (defaults to {@link getCurrentWorkDir}) so callers/tests
88
- * can anchor deterministically.
89
- */
90
- export declare function filesystemModeToPermissions(fs: string[] | 'all' | 'read' | 'none', cwd?: string, virtual?: boolean): FilesystemPermission[];
91
- /**
92
- * Compose the full permission list. `.aiignore` deny rules go FIRST so they win over
93
- * any allow rule (first-match-wins). Then the filesystem-mode rules. `.aiignore` is
94
- * skipped when explicitly disabled (`aiignore.enabled === false`) or has no patterns.
95
- */
96
- export declare function buildPermissions(config: PermissionConfigSlice, virtual?: boolean): FilesystemPermission[];
97
- /** Options for {@link guardFilesystemBackend}. */
98
- export interface RealpathGuardOptions {
99
- /** Real absolute cwd the sandbox is rooted at. Defaults to {@link getCurrentWorkDir}. */
100
- cwd?: string;
101
- /**
102
- * True when the wrapped backend runs in virtualMode (EXT-16 Windows fallback): the
103
- * model-supplied path is a `/`-rooted VIRTUAL path relative to cwd, not a real OS path.
104
- * `--allow-dir` widening never applies in virtualMode (mirrors {@link buildPermissions}), so
105
- * `allowDirs` is ignored when this is true.
106
- */
107
- virtual?: boolean;
108
- /** Extra real absolute directories allowed beyond cwd (the `--allow-dir` widened roots). */
109
- allowDirs?: string[];
110
- }
111
- /**
112
- * Wrap a deepagents filesystem backend so every read/write/edit/ls/glob/grep call is additionally
113
- * checked for a REALPATH (symlink-resolved) escape from the sandbox root(s) — closes EXT-14.
114
- *
115
- * deepagents' own permission layer (`enforcePermission` → `validatePath` → `decidePathAccess`,
116
- * `permissions/enforce.ts`) matches the RAW model-supplied path against the allow/deny globs and
117
- * never resolves symlinks. A raw `..`/`~` is rejected by `validatePath`, and a FINAL-component
118
- * symlink is blocked by the backend's own `O_NOFOLLOW` read — but an INTERMEDIATE symlinked
119
- * directory inside cwd whose target is OUTSIDE cwd (`cwd/linkdir -> /outside`, then reading
120
- * `cwd/linkdir/secret.txt`) matches the lexical `allow cwd/**` rule and reaches outside the
121
- * sandbox. See `deepAgentRealPathSandbox.spec.ts` for the end-to-end proof.
122
- *
123
- * This wraps the BACKEND — rather than adding a `wrapToolCall` middleware — because it is the ONE
124
- * seam gsloth fully controls that also covers subagents: `createDeepAgent` builds a fresh
125
- * `createFilesystemMiddleware({ backend, permissions })` per subagent (and for the main agent)
126
- * from the SAME `backend` reference, but each subagent gets its OWN middleware array that does
127
- * NOT include gsloth's `middleware` param — so a `wrapToolCall` guard would only cover the
128
- * top-level agent's tool calls, not a subagent's. Wrapping the shared backend closes the gap for
129
- * both.
130
- *
131
- * Deliberately does NOT re-implement deepagents' glob/permission matching (aiignore, read-only
132
- * mode, etc. all stay correctly enforced, unchanged, by the existing lexical checks inside the
133
- * wrapped backend's tools) — this is a second, independent containment gate layered in front of
134
- * them. TOCTOU: the realpath resolution here and the real fs op that follows inside the wrapped
135
- * backend are not atomic; racing a symlink swap in that small window is an accepted risk (out of
136
- * scope — this closes the deterministic, non-racing escape described above).
137
- */
138
- export declare function guardFilesystemBackend(backend: BackendProtocolV2, options?: RealpathGuardOptions): BackendProtocolV2;
@@ -1,309 +0,0 @@
1
- import { realpathSync } from 'node:fs';
2
- import { realpath as realpathAsync } from 'node:fs/promises';
3
- import path from 'node:path';
4
- import { getCurrentWorkDir } from '@gaunt-sloth/core/utils/systemUtils.js';
5
- /**
6
- * Tool names deepagents' filesystem middleware registers. This mirrors deepagents'
7
- * internal `FILESYSTEM_TOOL_NAMES` (which is declared in its types but not exported
8
- * at runtime). `createDeepAgent` throws on a name collision with any of these, so a
9
- * gsloth-supplied tool sharing one of these names is superseded by the deep agent's
10
- * built-in filesystem tool. Kept here as the single place the deep path references it.
11
- */
12
- export const FILESYSTEM_TOOL_NAMES = [
13
- 'ls',
14
- 'read_file',
15
- 'write_file',
16
- 'edit_file',
17
- 'glob',
18
- 'grep',
19
- 'execute',
20
- ];
21
- /**
22
- * **Every tool name `createDeepAgent` registers on its own** — the filesystem set above plus the
23
- * tools its other standard middleware installs unconditionally: `write_todos` (`todoListMiddleware`)
24
- * and `task` (`createSubAgentMiddleware`). None of them ever appears in the tool array gsloth passes
25
- * `createDeepAgent`, so this is the only way the approval policy can see them.
26
- *
27
- * **It exists because the approval question is "what did the graph bind", not "what did we supply".**
28
- * `task` and `write_todos` have no entry in core's `BUILT_IN_TOOL_ACCESS`, so the two deterministic
29
- * rungs must escalate them — `task` most of all, since it delegates to a subagent. A set built from
30
- * `FILESYSTEM_TOOL_NAMES` alone left both bound and ungated at `manual` and `write`, under a rung
31
- * description promising to ask about anything else. A subagent's OWN calls are gated too —
32
- * `createSubAgentMiddleware` inherits this set, and a nested interrupt does reach the parent state
33
- * the runner drains (measured in `deepAgentNestedInterrupt.spec.ts`) — so gating `task` is about the
34
- * delegation itself being a thing the user agreed to, not about reaching the child's writes.
35
- *
36
- * Like {@link FILESYSTEM_TOOL_NAMES} this MIRRORS deepagents (its own `BUILTIN_TOOL_NAMES` is
37
- * declared in the types but not exported at runtime, and the graph must be handed `interruptOn`
38
- * before it exists, so the registered set cannot be read back). **It must track deepagents:** a tool
39
- * a future version registers itself and this list has not learned about is bound and ungated.
40
- * deepagents' async-task tools are deliberately absent — that middleware is installed only for
41
- * async subagents, which this backend never configures.
42
- */
43
- export const DEEP_AGENT_BUILT_IN_TOOL_NAMES = [
44
- ...FILESYSTEM_TOOL_NAMES,
45
- 'write_todos',
46
- 'task',
47
- ];
48
- /**
49
- * Compute the real absolute containment root(s) for a real-path (non-virtual) sandbox: cwd plus
50
- * each of `dirs` resolved against cwd, de-duped (e.g. a dir that resolves back to cwd). Shared by
51
- * {@link allowDirsToPermissions} (turns these into glob allow-rules) and
52
- * {@link guardFilesystemBackend} (EXT-14: uses them as the realpath containment boundary — the
53
- * SAME roots the lexical globs are anchored at, so the two checks agree on what "contained"
54
- * means).
55
- */
56
- function computeSandboxRoots(cwd, dirs = []) {
57
- return Array.from(new Set([cwd, ...dirs.map((d) => path.resolve(cwd, d))]));
58
- }
59
- /**
60
- * Build allow+deny rules for the widened (`--allow-dir`) sandbox. Because the backend runs
61
- * without virtualMode, paths are REAL absolute paths, so we anchor allow rules at the resolved
62
- * absolute cwd and each allowed dir, then deny everything else. First-match-wins, so the allow
63
- * rules must come before the catch-all deny.
64
- */
65
- export function allowDirsToPermissions(allowDirs) {
66
- const cwd = getCurrentWorkDir();
67
- const uniqueRoots = computeSandboxRoots(cwd, allowDirs);
68
- const allow = uniqueRoots.map((root) => ({
69
- operations: ['read', 'write'],
70
- paths: [`${root}/**`, root],
71
- mode: 'allow',
72
- }));
73
- return [...allow, { operations: ['read', 'write'], paths: ['/**'], mode: 'deny' }];
74
- }
75
- /**
76
- * Strip a single leading "./" or "/" and any trailing slashes, using linear string
77
- * ops rather than regex. The previous `/\/+$/` trailing-slash regex was flagged by
78
- * CodeQL as a polynomial ReDoS (the `$` anchor makes the greedy `\/+` retry from every
79
- * start position → quadratic on a long run of slashes); plain slicing is O(n) and safe.
80
- */
81
- function normalizePathFragment(p) {
82
- let start = 0;
83
- if (p.startsWith('./'))
84
- start = 2;
85
- else if (p.startsWith('/'))
86
- start = 1;
87
- let end = p.length;
88
- while (end > start && p[end - 1] === '/')
89
- end--;
90
- return p.slice(start, end);
91
- }
92
- /**
93
- * Convert `.aiignore` patterns (relative, .gitignore-ish) into deepagents deny rules.
94
- *
95
- * deepagents matches the path argument the model passes to a fs tool against ABSOLUTE
96
- * globs. EXT-13: the backend now runs WITHOUT virtualMode in both the default and widened
97
- * cases, so paths are REAL absolute paths and the caller passes the absolute cwd as `base`
98
- * to anchor these deny rules there.
99
- *
100
- * A bare pattern (`*.env`, `secret.txt`) should match at any depth, so we emit both a
101
- * top-level (`<base>/secret.txt`) and a recursive (`<base>/&#42;&#42;/secret.txt`) rule. A pattern
102
- * already containing "/" (`config/secrets.json`) is anchored as-is (plus a `/**` subtree rule).
103
- *
104
- * `base` defaults to "" (anchoring at the virtual root "/") for legacy callers; gsloth's
105
- * {@link buildPermissions} always passes the absolute cwd now.
106
- */
107
- export function aiignoreToPermissions(patterns, base = '') {
108
- const rules = [];
109
- for (const raw of patterns) {
110
- const clean = normalizePathFragment(raw);
111
- if (clean.length === 0)
112
- continue;
113
- const paths = clean.includes('/')
114
- ? [`${base}/${clean}`, `${base}/${clean}/**`]
115
- : [`${base}/${clean}`, `${base}/**/${clean}`];
116
- rules.push({ operations: ['read', 'write'], paths, mode: 'deny' });
117
- }
118
- return rules;
119
- }
120
- /**
121
- * Map gsloth's filesystem mode onto deepagents permission rules for the DEFAULT
122
- * (non-widen) code-mode sandbox.
123
- *
124
- * EXT-13: the default backend now runs WITHOUT virtualMode (real absolute paths), so
125
- * containment can no longer lean on the virtual-root chroot — it is enforced entirely by
126
- * these globs anchored at the REAL absolute cwd. We therefore allow read+write within
127
- * `cwd/**` (and `cwd`) and deny everything else (`/**`), mirroring what virtualMode gave
128
- * for free. An explicit `string[]` allow-list resolves each entry against the real cwd.
129
- *
130
- * - `all` → no extra restriction beyond the cwd sandbox (matches the old virtualMode
131
- * behavior, where `/` already meant cwd).
132
- * - `read` → deny all writes (the cwd sandbox still applies for reads).
133
- * - `none` → deny all reads and writes.
134
- * - `string[]` → allow each (cwd-resolved) dir, deny everything else.
135
- *
136
- * The `cwd` argument is injected (defaults to {@link getCurrentWorkDir}) so callers/tests
137
- * can anchor deterministically.
138
- */
139
- export function filesystemModeToPermissions(fs, cwd = getCurrentWorkDir(), virtual = false) {
140
- // EXT-16: on Windows the real cwd (`D:\...`) cannot be expressed as a deepagents
141
- // permission glob — its `validatePath` requires POSIX `/`-rooted paths — so the backend
142
- // runs in virtualMode and these rules anchor at the virtual root `/` (= cwd) instead of
143
- // the real absolute cwd. On POSIX, `virtual` is false and this is the EXT-13 real-path
144
- // sandbox unchanged. `rootGlob`/`rootPath` = "everything under the sandbox root".
145
- const rootGlob = virtual ? '/**' : `${cwd}/**`;
146
- const rootPath = virtual ? '/' : cwd;
147
- if (fs === 'none')
148
- return [{ operations: ['read', 'write'], paths: ['/**'], mode: 'deny' }];
149
- if (fs === 'read') {
150
- // Deny all writes everywhere; reads are still confined to the cwd sandbox below.
151
- return [
152
- { operations: ['write'], paths: ['/**'], mode: 'deny' },
153
- { operations: ['read'], paths: [rootGlob, rootPath], mode: 'allow' },
154
- { operations: ['read'], paths: ['/**'], mode: 'deny' },
155
- ];
156
- }
157
- if (fs === 'all') {
158
- // No allow-list restriction, but the cwd sandbox must still apply by default
159
- // (allow cwd/**, deny /**) — this is what virtualMode enforced implicitly.
160
- return [
161
- { operations: ['read', 'write'], paths: [rootGlob, rootPath], mode: 'allow' },
162
- { operations: ['read', 'write'], paths: ['/**'], mode: 'deny' },
163
- ];
164
- }
165
- // string[] — explicit allow-list of directories. Real mode resolves each against the REAL
166
- // cwd; virtual mode anchors each under the virtual root `/`. Allow read+write within each,
167
- // deny everything else. Allow rules first (first-match-wins), deny catch-all last.
168
- const allow = fs
169
- .filter((d) => d !== 'all' && d !== 'read')
170
- .map((d) => {
171
- const frag = normalizePathFragment(d);
172
- const dir = virtual ? `/${frag}` : path.resolve(cwd, frag);
173
- return { operations: ['read', 'write'], paths: [`${dir}/**`, dir], mode: 'allow' };
174
- });
175
- return [...allow, { operations: ['read', 'write'], paths: ['/**'], mode: 'deny' }];
176
- }
177
- /**
178
- * Compose the full permission list. `.aiignore` deny rules go FIRST so they win over
179
- * any allow rule (first-match-wins). Then the filesystem-mode rules. `.aiignore` is
180
- * skipped when explicitly disabled (`aiignore.enabled === false`) or has no patterns.
181
- */
182
- export function buildPermissions(config, virtual = false) {
183
- const cwd = getCurrentWorkDir();
184
- const widen = Array.isArray(config.allowDirs) && config.allowDirs.length > 0;
185
- const aiignoreEnabled = config.aiignore?.enabled !== false && !!config.aiignore?.patterns?.length;
186
- // EXT-13/EXT-16: real mode anchors aiignore deny rules at the absolute cwd; virtual mode
187
- // (Windows) anchors them at the virtual root ("" → "/"). Either way they keep matching the
188
- // project-relative ignore patterns.
189
- const base = virtual ? '' : cwd;
190
- const aiignore = aiignoreEnabled ? aiignoreToPermissions(config.aiignore.patterns, base) : [];
191
- // `--allow-dir` widens to the cwd + allowed-dirs allow-list, which needs REAL absolute paths
192
- // and so cannot apply in virtualMode (EXT-16): when virtual, fall back to the cwd-only mode
193
- // sandbox (the caller warns that widening is limited on this platform).
194
- const modeRules = widen && !virtual
195
- ? allowDirsToPermissions(config.allowDirs)
196
- : filesystemModeToPermissions(config.filesystem, cwd, virtual);
197
- return [...aiignore, ...modeRules];
198
- }
199
- /**
200
- * Resolve `absPath` to its real, symlink-free location, walking up to the nearest EXISTING
201
- * ancestor when the target itself doesn't exist yet (e.g. a `write_file` target about to be
202
- * created). Only an EXISTING path component can itself be — or sit behind — a symlink, so
203
- * resolving the nearest real ancestor is enough to catch an intermediate symlinked directory
204
- * that would steer a not-yet-existing write outside the sandbox. Terminates because
205
- * `path.dirname` strictly shortens the path until it reaches the filesystem root.
206
- */
207
- async function realpathNearestExisting(absPath) {
208
- let current = absPath;
209
- for (;;) {
210
- try {
211
- return await realpathAsync(current);
212
- }
213
- catch {
214
- const parent = path.dirname(current);
215
- if (parent === current)
216
- return current; // filesystem root; nothing left to resolve
217
- current = parent;
218
- }
219
- }
220
- }
221
- /** True when `resolved` equals one of `roots` or is a descendant of one. */
222
- function isWithinRoots(resolved, roots) {
223
- return roots.some((root) => resolved === root || resolved.startsWith(`${root}${path.sep}`));
224
- }
225
- /**
226
- * Wrap a deepagents filesystem backend so every read/write/edit/ls/glob/grep call is additionally
227
- * checked for a REALPATH (symlink-resolved) escape from the sandbox root(s) — closes EXT-14.
228
- *
229
- * deepagents' own permission layer (`enforcePermission` → `validatePath` → `decidePathAccess`,
230
- * `permissions/enforce.ts`) matches the RAW model-supplied path against the allow/deny globs and
231
- * never resolves symlinks. A raw `..`/`~` is rejected by `validatePath`, and a FINAL-component
232
- * symlink is blocked by the backend's own `O_NOFOLLOW` read — but an INTERMEDIATE symlinked
233
- * directory inside cwd whose target is OUTSIDE cwd (`cwd/linkdir -> /outside`, then reading
234
- * `cwd/linkdir/secret.txt`) matches the lexical `allow cwd/**` rule and reaches outside the
235
- * sandbox. See `deepAgentRealPathSandbox.spec.ts` for the end-to-end proof.
236
- *
237
- * This wraps the BACKEND — rather than adding a `wrapToolCall` middleware — because it is the ONE
238
- * seam gsloth fully controls that also covers subagents: `createDeepAgent` builds a fresh
239
- * `createFilesystemMiddleware({ backend, permissions })` per subagent (and for the main agent)
240
- * from the SAME `backend` reference, but each subagent gets its OWN middleware array that does
241
- * NOT include gsloth's `middleware` param — so a `wrapToolCall` guard would only cover the
242
- * top-level agent's tool calls, not a subagent's. Wrapping the shared backend closes the gap for
243
- * both.
244
- *
245
- * Deliberately does NOT re-implement deepagents' glob/permission matching (aiignore, read-only
246
- * mode, etc. all stay correctly enforced, unchanged, by the existing lexical checks inside the
247
- * wrapped backend's tools) — this is a second, independent containment gate layered in front of
248
- * them. TOCTOU: the realpath resolution here and the real fs op that follows inside the wrapped
249
- * backend are not atomic; racing a symlink swap in that small window is an accepted risk (out of
250
- * scope — this closes the deterministic, non-racing escape described above).
251
- */
252
- export function guardFilesystemBackend(backend, options = {}) {
253
- const cwd = options.cwd ?? getCurrentWorkDir();
254
- const virtual = options.virtual ?? false;
255
- // allowDirs never widens virtualMode (mirrors buildPermissions); real mode's roots are cwd plus
256
- // each configured extra real dir. Resolved via realpath ONCE at wrap time (not per call) so a
257
- // symlinked tmp root (e.g. macOS `/tmp` -> `/private/tmp`) doesn't itself look like an escape.
258
- const rawRoots = virtual ? [cwd] : computeSandboxRoots(cwd, options.allowDirs);
259
- const roots = rawRoots.map((root) => {
260
- try {
261
- return realpathSync(root);
262
- }
263
- catch {
264
- return root; // root doesn't exist (yet) — fall back to its lexical form
265
- }
266
- });
267
- async function assertContained(rawPath, operation) {
268
- const lexical = virtual
269
- ? path.resolve(cwd, rawPath.startsWith('/') ? rawPath.slice(1) : rawPath)
270
- : path.resolve(cwd, rawPath);
271
- const resolved = await realpathNearestExisting(lexical);
272
- if (!isWithinRoots(resolved, roots)) {
273
- throw new Error(`Error: permission denied for ${operation} on ${rawPath}`);
274
- }
275
- }
276
- return {
277
- async ls(dirPath) {
278
- await assertContained(dirPath, 'read');
279
- return backend.ls(dirPath);
280
- },
281
- async read(filePath, offset, limit) {
282
- await assertContained(filePath, 'read');
283
- return backend.read(filePath, offset, limit);
284
- },
285
- async readRaw(filePath) {
286
- await assertContained(filePath, 'read');
287
- return backend.readRaw(filePath);
288
- },
289
- async write(filePath, content) {
290
- await assertContained(filePath, 'write');
291
- return backend.write(filePath, content);
292
- },
293
- async edit(filePath, oldString, newString, replaceAll) {
294
- await assertContained(filePath, 'write');
295
- return backend.edit(filePath, oldString, newString, replaceAll);
296
- },
297
- async glob(pattern, dirPath) {
298
- await assertContained(dirPath ?? '/', 'read');
299
- return backend.glob(pattern, dirPath);
300
- },
301
- async grep(pattern, dirPath, glob) {
302
- await assertContained(dirPath ?? '/', 'read');
303
- return backend.grep(pattern, dirPath, glob);
304
- },
305
- uploadFiles: backend.uploadFiles?.bind(backend),
306
- downloadFiles: backend.downloadFiles?.bind(backend),
307
- };
308
- }
309
- //# sourceMappingURL=deepAgentPermissions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deepAgentPermissions.js","sourceRoot":"","sources":["../../src/core/deepAgentPermissions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAI3E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI;IACJ,WAAW;IACX,YAAY;IACZ,WAAW;IACX,MAAM;IACN,MAAM;IACN,SAAS;CACD,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,GAAG,qBAAqB;IACxB,aAAa;IACb,MAAM;CACE,CAAC;AAcX;;;;;;;GAOG;AACH,SAAS,mBAAmB,CAAC,GAAW,EAAE,IAAI,GAAa,EAAE;IAC3D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAmB;IACxD,MAAM,GAAG,GAAG,iBAAiB,EAAE,CAAC;IAChC,MAAM,WAAW,GAAG,mBAAmB,CAAC,G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,UAAU;YACnD,MAAM,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACzC,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QAClE,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO;YACzB,MAAM,eAAe,CAAC,OAAO,IAAI,GAAG,EAAE,MAAM,CAAC,CAAC;YAC9C,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxC,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI;YAC/B,MAAM,eAAe,CAAC,OAAO,IAAI,GAAG,EAAE,MAAM,CAAC,CAAC;YAC9C,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAC9C,CAAC;QACD,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC;QAC/C,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC;KACpD,CAAC;AACJ,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * @packageDocumentation
3
- * Thin wrapper over `deepagents-acp`'s `DeepAgentsServer` that fixes how its filesystem backend is
4
- * rooted, since 0.1.12 gets both the location and the path semantics wrong for an IDE-hosted agent.
5
- *
6
- * 1. **Per-session root.** deepagents-acp roots its backend once at `workspaceRoot ?? process.cwd()`
7
- * and IGNORES the `cwd` carried by every ACP `session/new` request. An ACP host (Zed, JetBrains)
8
- * spawns one long-lived agent subprocess and passes the real project root per session, so we
9
- * re-root the backend to `session/new.cwd`.
10
- * 2. **Virtual-fs semantics.** deepagents-acp builds its backend WITHOUT `virtualMode`, so `/`
11
- * resolves to the OS root and `ls /` lists the whole machine — but deepagents' filesystem prompt
12
- * tells the model `/` is the workspace root (the convention the local runner uses via
13
- * `FilesystemBackend({ virtualMode: true })`). We switch the backend into virtual-fs mode so
14
- * `'/'`-rooted paths are workspace-relative.
15
- *
16
- * The server's connection handler dispatches `this.handleNewSession(params, conn)` dynamically, so
17
- * we patch that instance method before `start()`. Both fixes reach into deepagents-acp internals and
18
- * are guarded so a shape change degrades to a no-op rather than throwing; if a future deepagents-acp
19
- * honors session cwd / virtual mode itself, this becomes a harmless re-assert.
20
- */
21
- import { DeepAgentsServer, type DeepAgentsServerOptions } from 'deepagents-acp';
22
- /**
23
- * Construct and start a deepagents-acp server that roots its filesystem backend at each ACP
24
- * session's `cwd` and runs it in virtual-fs mode (so `/` is the workspace, not the OS root).
25
- * Resolves once the stdio transport is listening.
26
- */
27
- export declare function startGthAcpServer(options: DeepAgentsServerOptions): Promise<DeepAgentsServer>;
@@ -1,82 +0,0 @@
1
- /**
2
- * @packageDocumentation
3
- * Thin wrapper over `deepagents-acp`'s `DeepAgentsServer` that fixes how its filesystem backend is
4
- * rooted, since 0.1.12 gets both the location and the path semantics wrong for an IDE-hosted agent.
5
- *
6
- * 1. **Per-session root.** deepagents-acp roots its backend once at `workspaceRoot ?? process.cwd()`
7
- * and IGNORES the `cwd` carried by every ACP `session/new` request. An ACP host (Zed, JetBrains)
8
- * spawns one long-lived agent subprocess and passes the real project root per session, so we
9
- * re-root the backend to `session/new.cwd`.
10
- * 2. **Virtual-fs semantics.** deepagents-acp builds its backend WITHOUT `virtualMode`, so `/`
11
- * resolves to the OS root and `ls /` lists the whole machine — but deepagents' filesystem prompt
12
- * tells the model `/` is the workspace root (the convention the local runner uses via
13
- * `FilesystemBackend({ virtualMode: true })`). We switch the backend into virtual-fs mode so
14
- * `'/'`-rooted paths are workspace-relative.
15
- *
16
- * The server's connection handler dispatches `this.handleNewSession(params, conn)` dynamically, so
17
- * we patch that instance method before `start()`. Both fixes reach into deepagents-acp internals and
18
- * are guarded so a shape change degrades to a no-op rather than throwing; if a future deepagents-acp
19
- * honors session cwd / virtual mode itself, this becomes a harmless re-assert.
20
- */
21
- import { DeepAgentsServer } from 'deepagents-acp';
22
- import { resolve } from 'node:path';
23
- import { debugLog } from '@gaunt-sloth/core/utils/debugUtils.js';
24
- import { setAcpShellWorkDir } from '#src/tools/shell/workDir.js';
25
- /**
26
- * Put an ACP filesystem backend into deepagents' virtual-fs mode so `'/'`-rooted paths are
27
- * workspace-relative (clamped under `cwd`), matching deepagents' prompt and the local runner.
28
- *
29
- * `virtualMode` covers the methods that route through `resolvePath` (ls) and the inline checks
30
- * (glob/grep). The ACP read/write proxy uses its own `resolveAbsPath`, which ignores `virtualMode`,
31
- * so override that too so proxied reads/writes hit the workspace, not the OS root.
32
- */
33
- function configureVirtualFs(backend) {
34
- backend.virtualMode = true;
35
- backend.resolveAbsPath = (filePath) => resolve(backend.cwd ?? process.cwd(), String(filePath).replace(/^\/+/, ''));
36
- }
37
- /**
38
- * Construct and start a deepagents-acp server that roots its filesystem backend at each ACP
39
- * session's `cwd` and runs it in virtual-fs mode (so `/` is the workspace, not the OS root).
40
- * Resolves once the stdio transport is listening.
41
- */
42
- export async function startGthAcpServer(options) {
43
- const server = new DeepAgentsServer(options);
44
- const internals = server;
45
- const original = internals.handleNewSession;
46
- if (typeof original === 'function') {
47
- const bound = original.bind(server);
48
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
- internals.handleNewSession = async (params, conn) => {
50
- const result = await bound(params, conn);
51
- const backends = internals.acpBackends;
52
- const cwd = typeof params?.cwd === 'string' && params.cwd.length > 0 ? resolve(params.cwd) : undefined;
53
- if (backends && backends.size > 0) {
54
- for (const backend of backends.values()) {
55
- if (!backend || typeof backend !== 'object')
56
- continue;
57
- if (cwd)
58
- backend.cwd = cwd;
59
- configureVirtualFs(backend);
60
- }
61
- debugLog(`ACP session: virtual fs, root ${cwd ?? '[startup workspace]'}`);
62
- }
63
- // EXT-23: align the shell tool (run_shell_command) with THIS session's fs-backend root, so the
64
- // shell spawns where the fs tools read/write. `cwd` is the resolved session root; when
65
- // session/new carries no cwd, deepagents-acp keeps the startup workspace (rooted at
66
- // `workspaceRoot ?? process.cwd()`), so fall back to that. This is the ACP counterpart of the
67
- // local runner's EXT-22 S4 alignment, and it sidesteps getCurrentWorkDir()'s INIT_CWD (stale in
68
- // the long-lived ACP subprocess — the reason acpModule roots the startup workspace at raw
69
- // process.cwd()). Set unconditionally per session so the shell tracks the session cwd even if
70
- // the backend map has not been populated yet.
71
- const startupRoot = options.workspaceRoot ? resolve(options.workspaceRoot) : process.cwd();
72
- setAcpShellWorkDir(cwd ?? startupRoot);
73
- return result;
74
- };
75
- }
76
- else {
77
- debugLog('deepagents-acp handleNewSession not found to patch; session fs rooting disabled');
78
- }
79
- await server.start();
80
- return server;
81
- }
82
- //# sourceMappingURL=gthAcpServer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"gthAcpServer.js","sourceRoot":"","sources":["../../src/core/gthAcpServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,gBAAgB,EAAgC,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAiBjE;;;;;;;GAOG;AACH,SAAS,kBAAkB,CAAC,OAA0B;IACpD,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAC3B,OAAO,CAAC,cAAc,GAAG,CAAC,QAAgB,EAAU,EAAE,CACpD,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;AAChF,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAAgC;IAEhC,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,OAAO,C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AC,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;YAC3F,kBAAkB,CAAC,GAAG,IAAI,WAAW,CAAC,CAAC;YACvC,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,QAAQ,CAAC,iFAAiF,CAAC,CAAC;IAC9F,CAAC;IAED,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { GthAgentFactory } from '@gaunt-sloth/core/core/types.js';
2
- /**
3
- * A {@link GthAgentFactory} that produces a {@link GthDeepAgent}. Pass this to
4
- * `GthAgentRunner` (its optional 3rd ctor arg) so the same runner drives a
5
- * `createDeepAgent` graph instead of the lean default — without `core` ever
6
- * importing `deepagents`.
7
- *
8
- * The deepagents backend is **experimental**: lean is the default. Selecting it (via
9
- * `agent.backend: 'deep'`) emits a one-time warning so it is never used unknowingly.
10
- */
11
- export declare const gthDeepAgentFactory: GthAgentFactory;