gaunt-sloth 2.0.0-alpha.1 → 2.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +49 -0
- package/cli.js +43 -10
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/initCommand.js +1 -1
- package/dist/commands/initCommand.js.map +1 -1
- package/dist/tui/components/App.js +128 -9
- package/dist/tui/components/App.js.map +1 -1
- package/dist/tui/components/ApprovalPrompt.d.ts +17 -0
- package/dist/tui/components/ApprovalPrompt.js +25 -0
- package/dist/tui/components/ApprovalPrompt.js.map +1 -0
- package/dist/tui/components/DebugPanel.d.ts +14 -0
- package/dist/tui/components/DebugPanel.js +30 -16
- package/dist/tui/components/DebugPanel.js.map +1 -1
- package/dist/tui/slashCommands.d.ts +13 -0
- package/dist/tui/slashCommands.js +31 -0
- package/dist/tui/slashCommands.js.map +1 -1
- package/dist/tui/tuiSessionModule.js +63 -1
- package/dist/tui/tuiSessionModule.js.map +1 -1
- package/dist/tui/types.d.ts +24 -1
- package/package.json +14 -13
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2025-present Andrew Kondratev
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -41,6 +41,55 @@ npm install -g gaunt-sloth
|
|
|
41
41
|
|
|
42
42
|
For full usage documentation see the [root README](../../README.md) and [docs/COMMANDS.md](../../docs/COMMANDS.md).
|
|
43
43
|
|
|
44
|
+
## ACP server (editor integration)
|
|
45
|
+
|
|
46
|
+
Gaunt Sloth can run as an [Agent Client Protocol](https://agentclientprotocol.com/) (ACP)
|
|
47
|
+
server, so an ACP host — Zed, JetBrains, a future Pukeko client — can spawn it as a coding
|
|
48
|
+
agent. It speaks ACP JSON-RPC over **stdio** (no port, no flags beyond the switch below); the
|
|
49
|
+
host launches it as a subprocess.
|
|
50
|
+
|
|
51
|
+
Run it through this package:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install -g gaunt-sloth@alpha
|
|
55
|
+
gaunt-sloth --acp-agent
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Install the app (`gaunt-sloth`), not `@gaunt-sloth/agent`.** The agent package also ships a
|
|
59
|
+
standalone `gaunt-sloth-acp` binary, but the LLM providers (`@langchain/anthropic`, `openai`,
|
|
60
|
+
`google`, …) are `peerDependencies` of `@gaunt-sloth/core` that **only this app package
|
|
61
|
+
declares as real dependencies**. A bare `@gaunt-sloth/agent` install leaves those peers unmet,
|
|
62
|
+
so its ACP server has no provider to build a model from. `gaunt-sloth --acp-agent` runs the
|
|
63
|
+
exact same ACP server but resolves providers out of the app's dependency tree, so every
|
|
64
|
+
configured provider works. (`stdout` is the protocol channel and is kept clean — gsloth's
|
|
65
|
+
status/config output is redirected to `stderr`.)
|
|
66
|
+
|
|
67
|
+
Provider credentials and model selection come from your usual gsloth config
|
|
68
|
+
(`.gsloth.config.*` / env vars such as `ANTHROPIC_API_KEY`); the ACP server reads them via the
|
|
69
|
+
same `initConfig` path as the CLI. Run the host from your project directory (or set its `cwd`)
|
|
70
|
+
so config and the per-session workspace resolve correctly.
|
|
71
|
+
|
|
72
|
+
### Zed
|
|
73
|
+
|
|
74
|
+
Add to Zed `settings.json` (or Settings -> External Agents -> Add Agent -> Custom Agent):
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"agent_servers": {
|
|
79
|
+
"Gaunt Sloth": {
|
|
80
|
+
"type": "custom",
|
|
81
|
+
"command": "gaunt-sloth",
|
|
82
|
+
"args": ["--acp-agent"],
|
|
83
|
+
"env": {}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Point `command` at the global `gaunt-sloth` binary (after `npm install -g gaunt-sloth@alpha`),
|
|
90
|
+
or at an absolute path to `cli.js` for a local build. Other ACP hosts (JetBrains, etc.) take
|
|
91
|
+
the same `command` + `args` pair.
|
|
92
|
+
|
|
44
93
|
## Related packages
|
|
45
94
|
|
|
46
95
|
- [`@gaunt-sloth/core`](../core) — Core utilities, config, and agent infrastructure
|
package/cli.js
CHANGED
|
@@ -9,15 +9,48 @@ process.on('warning', (warning) => {
|
|
|
9
9
|
console.warn(warning);
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
|
|
12
|
+
// --- ACP server bypass -----------------------------------------------------
|
|
13
|
+
// `gaunt-sloth --acp-agent` runs the Agent Client Protocol (ACP) server instead
|
|
14
|
+
// of the normal CLI, so an ACP host (Zed, JetBrains, a future Pukeko client) can
|
|
15
|
+
// spawn the fat `gaunt-sloth` package as a coding-agent subprocess.
|
|
16
|
+
//
|
|
17
|
+
// Why route ACP through the app rather than the standalone `gaunt-sloth-acp`
|
|
18
|
+
// binary in @gaunt-sloth/agent: the LLM providers (@langchain/anthropic, openai,
|
|
19
|
+
// google, …) are peerDependencies of @gaunt-sloth/core, and only this app package
|
|
20
|
+
// declares them as real dependencies. A bare `@gaunt-sloth/agent` install leaves
|
|
21
|
+
// those peers unmet, so its ACP server has no providers to construct a model from.
|
|
22
|
+
// Starting the same ACP server from here resolves providers out of the app's tree.
|
|
23
|
+
//
|
|
24
|
+
// ACP speaks JSON-RPC over stdio, so stdout MUST stay a clean protocol channel:
|
|
25
|
+
// redirect console.log/info (used by initConfig/status output) to stderr BEFORE
|
|
26
|
+
// touching config, exactly as the standalone `gaunt-sloth-acp` entry does.
|
|
27
|
+
if (process.argv.includes('--acp-agent')) {
|
|
28
|
+
for (const method of ['log', 'info']) {
|
|
29
|
+
console[method] = (...args) => process.stderr.write(args.join(' ') + '\n');
|
|
30
|
+
}
|
|
31
|
+
const [{ initConfig }, { displayError }, { startAcpServer }] = await Promise.all([
|
|
32
|
+
import('@gaunt-sloth/core/config.js'),
|
|
33
|
+
import('@gaunt-sloth/core/utils/consoleUtils.js'),
|
|
34
|
+
import('@gaunt-sloth/agent'),
|
|
35
|
+
]);
|
|
36
|
+
try {
|
|
37
|
+
const config = await initConfig({});
|
|
38
|
+
await startAcpServer(config);
|
|
39
|
+
} catch (err) {
|
|
40
|
+
displayError(`ACP server failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
// This is a minimalistic entry point that sets the installDir in systemUtils
|
|
45
|
+
// and delegates to the compiled TypeScript code in dist/cli.js
|
|
46
|
+
const { setEntryPoint } = await import('./dist/utils/systemUtils.js');
|
|
15
47
|
|
|
16
|
-
// Set the installation directory in systemUtils
|
|
17
|
-
setEntryPoint(import.meta.url);
|
|
48
|
+
// Set the installation directory in systemUtils
|
|
49
|
+
setEntryPoint(import.meta.url);
|
|
18
50
|
|
|
19
|
-
// Import and run the compiled TypeScript code
|
|
20
|
-
import('./dist/cli.js').catch((err) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
51
|
+
// Import and run the compiled TypeScript code
|
|
52
|
+
import('./dist/cli.js').catch((err) => {
|
|
53
|
+
console.error('Failed to load application:', err);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
});
|
|
56
|
+
}
|
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import { coerceBooleanOrString } from '@gaunt-sloth/core/utils/consoleUtils.js';
|
|
|
13
13
|
const program = new Command();
|
|
14
14
|
program
|
|
15
15
|
.name('gsloth')
|
|
16
|
-
.description('Gaunt Sloth
|
|
16
|
+
.description('Gaunt Sloth reviewing your PRs')
|
|
17
17
|
.version(getSlothVersion())
|
|
18
18
|
.option('--verbose', 'Set LangChain/LangGraph to verbose mode, ' +
|
|
19
19
|
'causing LangChain/LangGraph to log many details to the console. ' +
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAG1F,OAAO,EAAE,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EAAsE;AACtE,WAAW,CAAC,OAAO,CAAC,CAAC;AACrB,aAAa,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AAC3C,SAAS,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACvC,UAAU,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACxC,WAAW,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACzC,WAAW,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACzC,WAAW,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACzC,UAAU,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AACxC,UAAU,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;AAExC,MAAM,SAAS,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -15,7 +15,7 @@ import { Argument } from 'commander';
|
|
|
15
15
|
export function initCommand(program) {
|
|
16
16
|
program
|
|
17
17
|
.command('init')
|
|
18
|
-
.description('Initialize
|
|
18
|
+
.description('Initialize Gaunt Sloth in your project. This will write necessary config files.')
|
|
19
19
|
.addArgument(new Argument('[type]', 'Config type (optional, runs the interactive dialog if omitted)').choices(availableDefaultConfigs))
|
|
20
20
|
.action(async (config) => {
|
|
21
21
|
if (config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initCommand.js","sourceRoot":"","sources":["../../src/commands/initCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAW,MAAM,WAAW,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,
|
|
1
|
+
{"version":3,"file":"initCommand.js","sourceRoot":"","sources":["../../src/commands/initCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAW,MAAM,WAAW,CAAC;AAE9C;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,iFAAiF,CAAC;SAC9F,WAAW,CACV,IAAI,QAAQ,CACV,QAAQ,EACR,gEAAgE,CACjE,CAAC,OAAO,CAAC,uBAAuB,CAAC,CACnC;SACA,MAAM,CAAC,KAAK,EAAE,MAAmB,EAAE,EAAE;QACpC,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACN,MAAM,iBAAiB,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -3,13 +3,14 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
|
3
3
|
import { Box, Text, useApp, useInput, useStdout } from 'ink';
|
|
4
4
|
import { foldEvents, foldSubagentEvents, initialSubagentTree, initialTurnViewModel, } from '#src/tui/viewModel.js';
|
|
5
5
|
import { Transcript } from '#src/tui/components/Transcript.js';
|
|
6
|
+
import { ApprovalPrompt } from '#src/tui/components/ApprovalPrompt.js';
|
|
6
7
|
import { LiveTurn } from '#src/tui/components/LiveTurn.js';
|
|
7
8
|
import { StatusBar } from '#src/tui/components/StatusBar.js';
|
|
8
9
|
import { PromptInput } from '#src/tui/components/PromptInput.js';
|
|
9
10
|
import { Rule } from '#src/tui/components/Rule.js';
|
|
10
11
|
import { ClearBanner } from '#src/tui/components/ClearBanner.js';
|
|
11
|
-
import { DebugPanel, DEBUG_TABS } from '#src/tui/components/DebugPanel.js';
|
|
12
|
-
import { createCommandRegistry, dispatchSlashCommand, parseSlashCommand, toolsToggleNotice, } from '#src/tui/slashCommands.js';
|
|
12
|
+
import { DebugPanel, debugPanelLines, DEBUG_TABS, } from '#src/tui/components/DebugPanel.js';
|
|
13
|
+
import { createCommandRegistry, dispatchSlashCommand, parseSlashCommand, toolsToggleNotice, yoloToggleNotice, } from '#src/tui/slashCommands.js';
|
|
13
14
|
import { viewportBumpSequence } from '#src/tui/terminal.js';
|
|
14
15
|
/** Rows of clipping viewport in the docked debug panel (default / restored size). */
|
|
15
16
|
const DEBUG_VIEWPORT_HEIGHT = 8;
|
|
@@ -61,6 +62,16 @@ export function App(props) {
|
|
|
61
62
|
// swallowed because clearing <Static>'s items resets its internal index (TUI-C12). Hidden
|
|
62
63
|
// again the moment the next user turn starts so it doesn't linger above a fresh conversation.
|
|
63
64
|
const [clearedBanner, setClearedBanner] = useState(false);
|
|
65
|
+
// Tool-approval queue (EXT-9 Phase B2). The head record (if any) is the approval currently
|
|
66
|
+
// shown; while it is non-null the approval prompt OWNS keyboard input and the normal prompt is
|
|
67
|
+
// suspended, so the command can't be typed into the chat box. Additional requests queue behind
|
|
68
|
+
// it (only one approval is shown at a time) and surface as the head is resolved.
|
|
69
|
+
const [approvalQueue, setApprovalQueue] = useState([]);
|
|
70
|
+
const pendingApproval = approvalQueue[0] ?? null;
|
|
71
|
+
// Mirror for the synchronous useInput handler, so it can read+resolve the head without a stale
|
|
72
|
+
// closure (the handler is bound once and must not depend on the queue in its deps).
|
|
73
|
+
const approvalQueueRef = useRef([]);
|
|
74
|
+
approvalQueueRef.current = approvalQueue;
|
|
64
75
|
// Mirror of toolsExpanded for the slash-command handler (memoized without it in deps), so
|
|
65
76
|
// /tools can compute the next state without a stale closure or a side effect in the updater.
|
|
66
77
|
const toolsExpandedRef = useRef(false);
|
|
@@ -81,6 +92,21 @@ export function App(props) {
|
|
|
81
92
|
const debugViewport = debugViewportHeight(debugMaximized, terminalRows);
|
|
82
93
|
// PageUp/PageDown step tracks the live viewport so maximise pages by (almost) a full screen.
|
|
83
94
|
const debugPageStep = Math.max(1, debugViewport - 1);
|
|
95
|
+
// The active section's line count drives the real maximum scroll offset, so neither the page
|
|
96
|
+
// step nor the arrow step can push the offset past the end (the over-scroll bug that left
|
|
97
|
+
// PgUp/↑ burning through phantom offset before anything moved — TUI-C11). Single-sourced with
|
|
98
|
+
// DebugPanel via the exported `debugPanelLines` so the clamp matches exactly what is rendered.
|
|
99
|
+
const debugLineCount = useMemo(() => debugPanelLines({
|
|
100
|
+
subagents,
|
|
101
|
+
historyLines: debugHistory,
|
|
102
|
+
requestLines: debugRequest,
|
|
103
|
+
responseLines: debugResponse,
|
|
104
|
+
activeTab: debugTab,
|
|
105
|
+
}).length, [subagents, debugHistory, debugRequest, debugResponse, debugTab]);
|
|
106
|
+
const debugMaxOffset = Math.max(0, debugLineCount - debugViewport);
|
|
107
|
+
// Clamp helper shared by every downward scroll (page + arrow) so the offset never exceeds the
|
|
108
|
+
// real maximum; the upward floor stays Math.max(0, …).
|
|
109
|
+
const clampDebugScroll = (next) => Math.min(Math.max(0, next), debugMaxOffset);
|
|
84
110
|
// Built once per session; a plain array so later layers (EXT-5) could append commands.
|
|
85
111
|
const registry = useMemo(() => createCommandRegistry(), []);
|
|
86
112
|
const nextId = () => (idRef.current += 1);
|
|
@@ -145,6 +171,40 @@ export function App(props) {
|
|
|
145
171
|
push({ kind: 'notice', title, lines, tone: tone ?? 'info' });
|
|
146
172
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
147
173
|
}, []);
|
|
174
|
+
// Resolve the currently-shown approval (the queue head) and commit a brief notice so the
|
|
175
|
+
// decision reads in the transcript (TUI-C14 notice conventions). Dequeues the head so the next
|
|
176
|
+
// queued approval (if any) surfaces. Approve carries the chosen scope; reject is fail-closed.
|
|
177
|
+
const resolveApproval = useCallback((decision) => {
|
|
178
|
+
const head = approvalQueueRef.current[0];
|
|
179
|
+
if (!head)
|
|
180
|
+
return;
|
|
181
|
+
if (decision === 'reject') {
|
|
182
|
+
head.resolve({ type: 'reject', message: 'User rejected the shell command.' });
|
|
183
|
+
push({
|
|
184
|
+
kind: 'notice',
|
|
185
|
+
title: 'Command rejected',
|
|
186
|
+
lines: ['The shell command was not run; the agent was told you declined.'],
|
|
187
|
+
tone: 'warn',
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
const scope = decision;
|
|
192
|
+
head.resolve({ type: 'approve', scope });
|
|
193
|
+
const detail = scope === 'once'
|
|
194
|
+
? 'Approved this single invocation only.'
|
|
195
|
+
: scope === 'session'
|
|
196
|
+
? 'Approved for this session — future variants will not re-prompt.'
|
|
197
|
+
: 'Approved and remembered — saved to the project allow-list.';
|
|
198
|
+
push({
|
|
199
|
+
kind: 'notice',
|
|
200
|
+
title: `Command approved (${scope})`,
|
|
201
|
+
lines: [detail],
|
|
202
|
+
tone: 'info',
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
setApprovalQueue((q) => q.slice(1));
|
|
206
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
207
|
+
}, []);
|
|
148
208
|
const handleSubmit = useCallback((value) => {
|
|
149
209
|
if (runningRef.current)
|
|
150
210
|
return;
|
|
@@ -198,6 +258,23 @@ export function App(props) {
|
|
|
198
258
|
// toggleTools owns the notice so the copy matches the state actually applied.
|
|
199
259
|
toggleTools();
|
|
200
260
|
}
|
|
261
|
+
if (result.toggleYolo) {
|
|
262
|
+
// The runner owns the flag; flip it and commit the notice for the landed state. When the
|
|
263
|
+
// agent can't toggle (fixture without a runner) fall back to a clear system line rather
|
|
264
|
+
// than silently no-op. EXT-12.
|
|
265
|
+
if (agent.toggleYolo) {
|
|
266
|
+
const next = agent.toggleYolo();
|
|
267
|
+
const { title, lines, tone } = yoloToggleNotice(next);
|
|
268
|
+
push({ kind: 'notice', title, lines, tone: tone ?? 'info' });
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
push({
|
|
272
|
+
kind: 'system',
|
|
273
|
+
level: 'warning',
|
|
274
|
+
text: 'yolo is unavailable in this session.',
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
}
|
|
201
278
|
if (result.toggleDebug) {
|
|
202
279
|
setDebugVisible((v) => {
|
|
203
280
|
const next = !v;
|
|
@@ -215,9 +292,9 @@ export function App(props) {
|
|
|
215
292
|
return next;
|
|
216
293
|
});
|
|
217
294
|
}
|
|
218
|
-
// Commit a structured notice (TUI-C14). /tools
|
|
219
|
-
// skip
|
|
220
|
-
if (result.notice && !result.toggleTools) {
|
|
295
|
+
// Commit a structured notice (TUI-C14). /tools and /yolo own their notices above (the
|
|
296
|
+
// state-aware copy is committed there), so skip result.notice in those cases.
|
|
297
|
+
if (result.notice && !result.toggleTools && !result.toggleYolo) {
|
|
221
298
|
const { title, lines, tone } = result.notice;
|
|
222
299
|
push({ kind: 'notice', title, lines, tone: tone ?? 'info' });
|
|
223
300
|
}
|
|
@@ -236,8 +313,25 @@ export function App(props) {
|
|
|
236
313
|
// 1. Esc while running → abort the in-flight turn (stdin is uncontended here — the event
|
|
237
314
|
// path never registers gsloth's readline Esc handler, so Ink owns raw mode cleanly).
|
|
238
315
|
// 2. Tab while the panel is visible and idle → focus/cycle the panel.
|
|
239
|
-
// 3. While the panel is focused → Tab
|
|
316
|
+
// 3. While the panel is focused → Tab/Shift+Tab cycle sections, ↑/↓ scroll one line,
|
|
317
|
+
// PageUp/PageDown page-step, m maximises, Esc unfocuses.
|
|
240
318
|
useInput((input, key) => {
|
|
319
|
+
// Highest priority: a pending tool approval OWNS the keyboard (EXT-9 Phase B2). While one is
|
|
320
|
+
// shown, o/s/a resolve approve with the matching scope; anything else (n, Esc, Enter, …)
|
|
321
|
+
// resolves reject — fail-closed, mirroring the readline path. We swallow the key either way
|
|
322
|
+
// so it can't fall through to abort/debug handling or get typed into the prompt.
|
|
323
|
+
if (approvalQueueRef.current.length > 0) {
|
|
324
|
+
const ch = input.toLowerCase();
|
|
325
|
+
if (ch === 'o')
|
|
326
|
+
resolveApproval('once');
|
|
327
|
+
else if (ch === 's')
|
|
328
|
+
resolveApproval('session');
|
|
329
|
+
else if (ch === 'a')
|
|
330
|
+
resolveApproval('always');
|
|
331
|
+
else
|
|
332
|
+
resolveApproval('reject');
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
241
335
|
if (key.escape && runningRef.current) {
|
|
242
336
|
abortRef.current?.abort();
|
|
243
337
|
return;
|
|
@@ -257,8 +351,11 @@ export function App(props) {
|
|
|
257
351
|
debugFocusedRef.current = false;
|
|
258
352
|
return;
|
|
259
353
|
}
|
|
354
|
+
// Tab cycles sections forward; Shift+Tab steps back to the previous section (Ink reports
|
|
355
|
+
// a back-tab as key.tab with key.shift). Both reset the scroll to the top of the new section.
|
|
260
356
|
if (key.tab) {
|
|
261
|
-
|
|
357
|
+
const step = key.shift ? -1 : 1;
|
|
358
|
+
setDebugTab((t) => DEBUG_TABS[(DEBUG_TABS.indexOf(t) + step + DEBUG_TABS.length) % DEBUG_TABS.length]);
|
|
262
359
|
setDebugScroll(0);
|
|
263
360
|
return;
|
|
264
361
|
}
|
|
@@ -268,12 +365,24 @@ export function App(props) {
|
|
|
268
365
|
setDebugMaximized((m) => !m);
|
|
269
366
|
return;
|
|
270
367
|
}
|
|
368
|
+
// ↑/↓ scroll one line for fine control; PgUp/PgDn page-step for coarse. Arrows exist on
|
|
369
|
+
// every keyboard, so they are the universal scroll keys (Mac/compact keyboards lack
|
|
370
|
+
// dedicated PgUp/PgDn) — that is why the hint and overflow markers advertise the arrows
|
|
371
|
+
// (TUI-C11). Every downward move is clamped to the real maximum (see clampDebugScroll).
|
|
372
|
+
if (key.upArrow) {
|
|
373
|
+
setDebugScroll((s) => Math.max(0, s - 1));
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
if (key.downArrow) {
|
|
377
|
+
setDebugScroll((s) => clampDebugScroll(s + 1));
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
271
380
|
if (key.pageUp) {
|
|
272
381
|
setDebugScroll((s) => Math.max(0, s - debugPageStep));
|
|
273
382
|
return;
|
|
274
383
|
}
|
|
275
384
|
if (key.pageDown) {
|
|
276
|
-
setDebugScroll((s) => s + debugPageStep);
|
|
385
|
+
setDebugScroll((s) => clampDebugScroll(s + debugPageStep));
|
|
277
386
|
return;
|
|
278
387
|
}
|
|
279
388
|
return;
|
|
@@ -318,9 +427,19 @@ export function App(props) {
|
|
|
318
427
|
});
|
|
319
428
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
320
429
|
}, []);
|
|
430
|
+
// Surface tool-approval requests bridged from the runner (EXT-9 Phase B2): each pending
|
|
431
|
+
// approval is appended to the queue; the head renders the <ApprovalPrompt> and owns input.
|
|
432
|
+
useEffect(() => {
|
|
433
|
+
if (!props.subscribeApproval)
|
|
434
|
+
return;
|
|
435
|
+
return props.subscribeApproval((record) => {
|
|
436
|
+
setApprovalQueue((q) => [...q, record]);
|
|
437
|
+
});
|
|
438
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
439
|
+
}, []);
|
|
321
440
|
// The greeting is an intro, not a permanent fixture: show it only before the first
|
|
322
441
|
// exchange, so it stops padding the bottom dock once the conversation is underway.
|
|
323
442
|
const showIntro = !initialMessage && transcript.length === 0 && !live;
|
|
324
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Transcript, { items: transcript, toolsExpanded: toolsExpanded }), clearedBanner ? _jsx(ClearBanner, {}) : null, showIntro ? _jsx(Text, { dimColor: true, children: readyMessage.trim() }) : null, live ? _jsx(LiveTurn, { turn: live, toolsExpanded: toolsExpanded, streaming: true }) : null, debugVisible ? (_jsx(DebugPanel, { subagents: subagents, historyLines: debugHistory, requestLines: debugRequest, responseLines: debugResponse, activeTab: debugTab, scrollOffset: debugScroll, focused: debugFocused, viewportHeight: debugViewport, maximized: debugMaximized })) : null, _jsx(Rule, {}), _jsx(StatusBar, { running: running, mode: mode, modelDisplayName: modelDisplayName, turnCount: turnCount, debugHint: debugVisible && !debugFocused }), !running && !debugFocused ? _jsx(PromptInput, { onSubmit: handleSubmit }) : null, _jsx(Text, { dimColor: true, children: exitMessage.trim() }), _jsx(Rule, {})] }));
|
|
443
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Transcript, { items: transcript, toolsExpanded: toolsExpanded }), clearedBanner ? _jsx(ClearBanner, {}) : null, showIntro ? _jsx(Text, { dimColor: true, children: readyMessage.trim() }) : null, live ? _jsx(LiveTurn, { turn: live, toolsExpanded: toolsExpanded, streaming: true }) : null, debugVisible ? (_jsx(DebugPanel, { subagents: subagents, historyLines: debugHistory, requestLines: debugRequest, responseLines: debugResponse, activeTab: debugTab, scrollOffset: debugScroll, focused: debugFocused, viewportHeight: debugViewport, maximized: debugMaximized })) : null, pendingApproval ? _jsx(ApprovalPrompt, { pending: pendingApproval.pending }) : null, _jsx(Rule, {}), _jsx(StatusBar, { running: running, mode: mode, modelDisplayName: modelDisplayName, turnCount: turnCount, debugHint: debugVisible && !debugFocused }), !running && !debugFocused && !pendingApproval ? (_jsx(PromptInput, { onSubmit: handleSubmit })) : null, _jsx(Text, { dimColor: true, children: exitMessage.trim() }), _jsx(Rule, {})] }));
|
|
325
444
|
}
|
|
326
445
|
//# sourceMappingURL=App.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.js","sourceRoot":"","sources":["../../../src/tui/components/App.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAC7D,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GAGrB,MAAM,uBAAuB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,CAAC,IAAI,EAKP,eAAe,CAAC,CAAC,CAAC,KAAC,cAAc,IAAC,OAAO,EAAE,eAAe,CAAC,OAAO,GAAI,CAAC,CAAC,CAAC,IAAI,EAC9E,KAAC,IAAI,KAAG,EACR,KAAC,SAAS,IACR,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,YAAY,IAAI,CAAC,YAAY,GACxC,EACD,CAAC,OAAO,IAAI,CAAC,YAAY,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAC/C,KAAC,WAAW,IAAC,QAAQ,EAAE,YAAY,GAAI,CACxC,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,IAAI,IAAC,QAAQ,kBAAE,WAAW,CAAC,IAAI,EAAE,GAAQ,EAC1C,KAAC,IAAI,KAAG,IACJ,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PendingToolInterrupt } from '@gaunt-sloth/core/core/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The scoped tool-approval affordance (EXT-9 Phase B2) — the Ink TUI counterpart to the
|
|
5
|
+
* readline `Approve? [o]nce / [s]ession / [a]lways / [N]o:` prompt. Shown when a
|
|
6
|
+
* `run_shell_command` interrupt is pending; styled like a warn-tone {@link CommandNotice}
|
|
7
|
+
* (yellow bold title + dim body bracketed by a rule) so it reads consistently in the
|
|
8
|
+
* transcript dock. While it is mounted the parent `<App>` routes keyboard input here and
|
|
9
|
+
* suspends the normal prompt, so the command can't be typed into the chat box.
|
|
10
|
+
*
|
|
11
|
+
* Pure/presentational: it only renders the pending command + the choices. The key handling
|
|
12
|
+
* (o/s/a → approve, anything else → reject) lives in `<App>`'s `useInput`, mirroring the way
|
|
13
|
+
* the debug panel's scroll keys are owned by the root component.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ApprovalPrompt({ pending, }: {
|
|
16
|
+
pending: PendingToolInterrupt;
|
|
17
|
+
}): React.ReactElement;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { Rule } from '#src/tui/components/Rule.js';
|
|
4
|
+
/**
|
|
5
|
+
* The scoped tool-approval affordance (EXT-9 Phase B2) — the Ink TUI counterpart to the
|
|
6
|
+
* readline `Approve? [o]nce / [s]ession / [a]lways / [N]o:` prompt. Shown when a
|
|
7
|
+
* `run_shell_command` interrupt is pending; styled like a warn-tone {@link CommandNotice}
|
|
8
|
+
* (yellow bold title + dim body bracketed by a rule) so it reads consistently in the
|
|
9
|
+
* transcript dock. While it is mounted the parent `<App>` routes keyboard input here and
|
|
10
|
+
* suspends the normal prompt, so the command can't be typed into the chat box.
|
|
11
|
+
*
|
|
12
|
+
* Pure/presentational: it only renders the pending command + the choices. The key handling
|
|
13
|
+
* (o/s/a → approve, anything else → reject) lives in `<App>`'s `useInput`, mirroring the way
|
|
14
|
+
* the debug panel's scroll keys are owned by the root component.
|
|
15
|
+
*/
|
|
16
|
+
export function ApprovalPrompt({ pending, }) {
|
|
17
|
+
const commandText = typeof pending.args.command === 'string'
|
|
18
|
+
? pending.args.command
|
|
19
|
+
: JSON.stringify(pending.args);
|
|
20
|
+
// EXT-10: when the LLM-as-judge gate escalated this command (rather than auto-approving), show
|
|
21
|
+
// its flag + reason so the human has the judge's read before deciding.
|
|
22
|
+
const verdict = pending.safetyVerdict;
|
|
23
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Rule, {}), _jsx(Text, { bold: true, color: "yellow", children: `The agent wants to run a shell command via ${pending.name}` }), _jsx(Text, { dimColor: true, children: ` ${commandText}` }), verdict ? (_jsx(Text, { color: "yellow", children: `⚠ safety judge (${verdict.risk}): ${verdict.reason}` })) : null, _jsx(Text, { dimColor: true, children: 'Approve? [o]nce [s]ession [a]lways [N]o' })] }));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=ApprovalPrompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApprovalPrompt.js","sourceRoot":"","sources":["../../../src/tui/components/ApprovalPrompt.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AAGnD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,OAAO,GAGR;IACC,MAAM,WAAW,GACf,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,KAAK,QAAQ;QACtC,CAAC,CAAE,OAAO,CAAC,IAAI,CAAC,OAAkB;QAClC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,+FAA+F;IAC/F,uEAAuE;IACvE,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;IACtC,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,KAAC,IAAI,KAAG,EACR,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,QAAQ,YACtB,8CAA8C,OAAO,CAAC,IAAI,EAAE,GACxD,EACP,KAAC,IAAI,IAAC,QAAQ,kBAAE,OAAO,WAAW,EAAE,GAAQ,EAC3C,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,YAAE,mBAAmB,OAAO,CAAC,IAAI,MAAM,OAAO,CAAC,MAAM,EAAE,GAAQ,CACpF,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,IAAI,IAAC,QAAQ,kBAAE,gDAAgD,GAAQ,IACpE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -23,6 +23,20 @@ export interface DebugPanelProps {
|
|
|
23
23
|
/** Whether the pane is maximised (grown to most of the terminal height). */
|
|
24
24
|
maximized: boolean;
|
|
25
25
|
}
|
|
26
|
+
/** The data a debug section needs to resolve into renderable lines. */
|
|
27
|
+
export interface DebugPanelLinesInput {
|
|
28
|
+
subagents: SubagentTreeViewModel;
|
|
29
|
+
historyLines: string[];
|
|
30
|
+
requestLines: string[];
|
|
31
|
+
responseLines: string[];
|
|
32
|
+
activeTab: DebugTab;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The exact lines the active section renders, including the empty-state placeholders. Exported
|
|
36
|
+
* (and pure) so `<App>` can compute the active section's length to clamp the scroll offset to
|
|
37
|
+
* its real maximum — keeping keyboard scrolling and the rendered viewport in agreement (TUI-C11).
|
|
38
|
+
*/
|
|
39
|
+
export declare function debugPanelLines({ subagents, historyLines, requestLines, responseLines, activeTab, }: DebugPanelLinesInput): string[];
|
|
26
40
|
/**
|
|
27
41
|
* Full-width docked panel below the transcript / above the status bar (lives in the live,
|
|
28
42
|
* non-static frame so it coexists with `<Static>` scrollback). Tabs select a section; the
|
|
@@ -8,6 +8,26 @@ const TAB_LABELS = {
|
|
|
8
8
|
request: 'Sent to model (system + tools)',
|
|
9
9
|
response: 'Raw model response',
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* The exact lines the active section renders, including the empty-state placeholders. Exported
|
|
13
|
+
* (and pure) so `<App>` can compute the active section's length to clamp the scroll offset to
|
|
14
|
+
* its real maximum — keeping keyboard scrolling and the rendered viewport in agreement (TUI-C11).
|
|
15
|
+
*/
|
|
16
|
+
export function debugPanelLines({ subagents, historyLines, requestLines, responseLines, activeTab, }) {
|
|
17
|
+
return activeTab === 'subagents'
|
|
18
|
+
? subagentLines(subagents)
|
|
19
|
+
: activeTab === 'history'
|
|
20
|
+
? historyLines.length
|
|
21
|
+
? historyLines
|
|
22
|
+
: ['(no model call captured yet)']
|
|
23
|
+
: activeTab === 'request'
|
|
24
|
+
? requestLines.length
|
|
25
|
+
? requestLines
|
|
26
|
+
: ['(no request details captured yet)']
|
|
27
|
+
: responseLines.length
|
|
28
|
+
? responseLines
|
|
29
|
+
: ['(no model response captured yet)'];
|
|
30
|
+
}
|
|
11
31
|
/** Flatten the subagent tree into renderable lines for the bounded viewport. */
|
|
12
32
|
function subagentLines(tree) {
|
|
13
33
|
if (tree.nodes.length === 0)
|
|
@@ -34,19 +54,13 @@ function subagentLines(tree) {
|
|
|
34
54
|
* Pure presentational: all state (tab, offset, focus) is owned by `<App>`.
|
|
35
55
|
*/
|
|
36
56
|
export function DebugPanel({ subagents, historyLines, requestLines, responseLines, activeTab, scrollOffset, focused, viewportHeight, maximized, }) {
|
|
37
|
-
const lines =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
? requestLines.length
|
|
45
|
-
? requestLines
|
|
46
|
-
: ['(no request details captured yet)']
|
|
47
|
-
: responseLines.length
|
|
48
|
-
? responseLines
|
|
49
|
-
: ['(no model response captured yet)'];
|
|
57
|
+
const lines = debugPanelLines({
|
|
58
|
+
subagents,
|
|
59
|
+
historyLines,
|
|
60
|
+
requestLines,
|
|
61
|
+
responseLines,
|
|
62
|
+
activeTab,
|
|
63
|
+
});
|
|
50
64
|
// Clamp the window into range so an offset left over from a longer section never blanks
|
|
51
65
|
// the viewport when switching to a shorter one.
|
|
52
66
|
const maxOffset = Math.max(0, lines.length - viewportHeight);
|
|
@@ -61,14 +75,14 @@ export function DebugPanel({ subagents, historyLines, requestLines, responseLine
|
|
|
61
75
|
// line range, an "N more below" / "— end —" marker, and an "▲ above" marker when scrolled.
|
|
62
76
|
const footer = overflow
|
|
63
77
|
? `${top + 1}-${bottom}/${lines.length}` +
|
|
64
|
-
(hasBelow ? ` ▼ ${lines.length - bottom} more below (
|
|
65
|
-
(hasAbove ? ' ▲ above (
|
|
78
|
+
(hasBelow ? ` ▼ ${lines.length - bottom} more below (↓)` : ' — end —') +
|
|
79
|
+
(hasAbove ? ' ▲ above (↑)' : '')
|
|
66
80
|
: `${lines.length} line${lines.length === 1 ? '' : 's'}`;
|
|
67
81
|
return (_jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: focused ? 'cyan' : 'gray', children: [_jsx(Box, { children: _jsx(Text, { children: DEBUG_TABS.map((tab) => {
|
|
68
82
|
const label = TAB_LABELS[tab];
|
|
69
83
|
return tab === activeTab ? (_jsx(Text, { color: "cyan", bold: true, children: ` ${label} ` }, tab)) : (_jsx(Text, { dimColor: true, children: ` ${label} ` }, tab));
|
|
70
84
|
}) }) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: focused
|
|
71
|
-
? `[Tab: section ·
|
|
85
|
+
? `[Tab: section · ↑/↓: scroll · m: ${maximized ? 'restore' : 'maximise'} · Esc: unfocus]`
|
|
72
86
|
: '[/debug to hide]' }) }), _jsx(Box, { height: viewportHeight, overflow: "hidden", flexDirection: "column", children: visible.map((line, i) => (_jsx(Text, { children: line }, top + i))) }), _jsx(Box, { children: _jsx(Text, { dimColor: true, children: footer }) })] }));
|
|
73
87
|
}
|
|
74
88
|
//# sourceMappingURL=DebugPanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebugPanel.js","sourceRoot":"","sources":["../../../src/tui/components/DebugPanel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAGhC,iEAAiE;AACjE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAGnF,MAAM,UAAU,GAA6B;IAC3C,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,8BAA8B;IACvC,OAAO,EAAE,gCAAgC;IACzC,QAAQ,EAAE,oBAAoB;CAC/B,CAAC;
|
|
1
|
+
{"version":3,"file":"DebugPanel.js","sourceRoot":"","sources":["../../../src/tui/components/DebugPanel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,E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,CAAC,SAAS,CAAC,CAAC,CAAC,UAC1B,kBAAkB;wBACpB,CAAC,CAAC,kBAAkB,GACjB,GACH,EACN,KAAC,GAAG,IAAC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAC,QAAQ,EAAC,aAAa,EAAC,QAAQ,YAClE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACxB,KAAC,IAAI,cAAgB,IAAI,IAAd,GAAG,GAAG,CAAC,CAAe,CAClC,CAAC,GACE,EAEN,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,QAAQ,kBAAE,MAAM,GAAQ,GAC1B,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -51,6 +51,13 @@ export interface SlashCommandResult {
|
|
|
51
51
|
toggleDebug?: boolean;
|
|
52
52
|
/** When true, the component toggles tool-call panels between collapsed and expanded. */
|
|
53
53
|
toggleTools?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* EXT-12 — when true, the component flips the runner's session-scoped yolo flag (shell
|
|
56
|
+
* commands auto-approved this session) and commits the resulting-state notice. The command
|
|
57
|
+
* itself stays pure: it cannot read the runner's flag, so the App owns the actual toggle and
|
|
58
|
+
* the notice (mirroring how `/tools` / `/debug` defer their state-aware copy to the App).
|
|
59
|
+
*/
|
|
60
|
+
toggleYolo?: boolean;
|
|
54
61
|
/** When true, the component quits the app (runs `onExit`). */
|
|
55
62
|
exit?: boolean;
|
|
56
63
|
}
|
|
@@ -83,6 +90,12 @@ export declare function toolsToggleNotice(expanded: boolean): SlashCommandNotice
|
|
|
83
90
|
* command reports exactly the state the component will apply.
|
|
84
91
|
*/
|
|
85
92
|
export declare function debugToggleNotice(visible: boolean): SlashCommandNotice;
|
|
93
|
+
/**
|
|
94
|
+
* The notice for the `/yolo` toggle (EXT-12), given the RESULTING (post-toggle) state. Shared so
|
|
95
|
+
* the command reports exactly the state the App applies. ON is rendered 'warn' (yellow) because it
|
|
96
|
+
* disables the approval gate for the session; OFF is 'info'.
|
|
97
|
+
*/
|
|
98
|
+
export declare function yoloToggleNotice(yolo: boolean): SlashCommandNotice;
|
|
86
99
|
/**
|
|
87
100
|
* Build the default command registry. Returns a fresh array each call so callers may push
|
|
88
101
|
* extension commands onto it (EXT-5) without sharing mutable module state.
|
|
@@ -66,6 +66,30 @@ export function debugToggleNotice(visible) {
|
|
|
66
66
|
],
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* The notice for the `/yolo` toggle (EXT-12), given the RESULTING (post-toggle) state. Shared so
|
|
71
|
+
* the command reports exactly the state the App applies. ON is rendered 'warn' (yellow) because it
|
|
72
|
+
* disables the approval gate for the session; OFF is 'info'.
|
|
73
|
+
*/
|
|
74
|
+
export function yoloToggleNotice(yolo) {
|
|
75
|
+
return yolo
|
|
76
|
+
? {
|
|
77
|
+
title: 'yolo ON — shell commands auto-approved this session',
|
|
78
|
+
lines: [
|
|
79
|
+
'run_shell_command will now execute WITHOUT the per-command approval prompt.',
|
|
80
|
+
'Session-scoped only (not saved); run /yolo again to require approvals.',
|
|
81
|
+
'The hardline safety floor still blocks catastrophic commands.',
|
|
82
|
+
],
|
|
83
|
+
tone: 'warn',
|
|
84
|
+
}
|
|
85
|
+
: {
|
|
86
|
+
title: 'yolo OFF — approvals required',
|
|
87
|
+
lines: [
|
|
88
|
+
'run_shell_command will prompt for approval again before each command.',
|
|
89
|
+
'Run /yolo to re-enable session-wide auto-approval.',
|
|
90
|
+
],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
69
93
|
/**
|
|
70
94
|
* Build the default command registry. Returns a fresh array each call so callers may push
|
|
71
95
|
* extension commands onto it (EXT-5) without sharing mutable module state.
|
|
@@ -98,6 +122,13 @@ export function createCommandRegistry() {
|
|
|
98
122
|
// State-aware: report the notice for the state the toggle will land on (the inverse of now).
|
|
99
123
|
run: (ctx) => ({ toggleTools: true, notice: toolsToggleNotice(!ctx.toolsExpanded) }),
|
|
100
124
|
},
|
|
125
|
+
{
|
|
126
|
+
name: 'yolo',
|
|
127
|
+
description: 'Toggle session-wide shell auto-approval (no per-command prompt)',
|
|
128
|
+
// State-aware: the App owns the runner flag, so it flips it and commits the notice for the
|
|
129
|
+
// landed state (the command can't read the flag here). EXT-12.
|
|
130
|
+
run: () => ({ toggleYolo: true }),
|
|
131
|
+
},
|
|
101
132
|
{
|
|
102
133
|
name: 'exit',
|
|
103
134
|
description: 'Quit the session',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slashCommands.js","sourceRoot":"","sources":["../../src/tui/slashCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"slashCommands.js","sourceRoot":"","sources":["../../src/tui/slashCommands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAwEH;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC,CAAC,8BAA8B;IACpE,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,MAAM,CAAC;IAC/B,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAiB;IACjD,OAAO,QAAQ;QACb,CAAC,CAAC;YACE,KAAK,EAAE,kBAAkB;YACzB,KAAK,EAAE;gBACL,wEAAwE;gBACxE,wEAAwE;aACz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AmG;AACnG,MAAM,UAAU,UAAU,CAAC,QAAwB;IACjD,OAAO;QACL,KAAK,EAAE,gBAAgB;QACvB,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC;KAC5D,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAA0B,EAC1B,QAAwB,EACxB,GAAwB;IAExB,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC3B,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;IAC1C,CAAC;IACD,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;YACL,MAAM,EAAE;gBACN,KAAK,EAAE,qBAAqB,MAAM,CAAC,IAAI,EAAE;gBACzC,KAAK,EAAE,CAAC,wCAAwC,EAAE,wCAAwC,CAAC;gBAC3F,IAAI,EAAE,MAAM;aACb;SACF,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -55,6 +55,53 @@ function createDebugBridge() {
|
|
|
55
55
|
},
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Fan-out so the runner's tool-approval callback can reach the mounted React app. Modeled on
|
|
60
|
+
* {@link createStatusBridge}, but promise-based: when the runner suspends on a
|
|
61
|
+
* `run_shell_command` interrupt and calls the approval callback, the bridge creates a pending
|
|
62
|
+
* record (the {@link PendingToolInterrupt} plus a `resolve`), emits it to the subscribed
|
|
63
|
+
* `<App>`, and hands the callback a Promise it awaits until the app resolves a decision.
|
|
64
|
+
*
|
|
65
|
+
* Fail-closed: if the session ends / the app unmounts while an approval is still pending, every
|
|
66
|
+
* outstanding record is resolved as a reject (`abortPending`), so a suspended run can never hang
|
|
67
|
+
* — matching the readline path's "anything not o/s/a → reject" default.
|
|
68
|
+
*/
|
|
69
|
+
function createApprovalBridge() {
|
|
70
|
+
const listeners = new Set();
|
|
71
|
+
// Records that have been emitted but not yet resolved (used by abortPending on teardown).
|
|
72
|
+
const outstanding = new Set();
|
|
73
|
+
return {
|
|
74
|
+
/** Wired to `runner.setToolApprovalCallback`: returns a Promise the runner awaits. */
|
|
75
|
+
request: (pending) => new Promise((resolve) => {
|
|
76
|
+
let settled = false;
|
|
77
|
+
const record = {
|
|
78
|
+
pending,
|
|
79
|
+
resolve: (decision) => {
|
|
80
|
+
if (settled)
|
|
81
|
+
return;
|
|
82
|
+
settled = true;
|
|
83
|
+
outstanding.delete(record);
|
|
84
|
+
resolve(decision);
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
outstanding.add(record);
|
|
88
|
+
for (const l of listeners)
|
|
89
|
+
l(record);
|
|
90
|
+
}),
|
|
91
|
+
subscribe: (cb) => {
|
|
92
|
+
listeners.add(cb);
|
|
93
|
+
return () => {
|
|
94
|
+
listeners.delete(cb);
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
/** Resolve every still-pending approval as a reject (fail-closed) on teardown. */
|
|
98
|
+
abortPending: () => {
|
|
99
|
+
for (const record of [...outstanding]) {
|
|
100
|
+
record.resolve({ type: 'reject', message: 'Session ended before approval.' });
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
}
|
|
58
105
|
/**
|
|
59
106
|
* Ink TUI counterpart to `createInteractiveSession` (the readline path). Same lifecycle —
|
|
60
107
|
* init config, session logging, a `GthAgentRunner` driving the deep agent — but it renders
|
|
@@ -89,9 +136,16 @@ export async function createTuiSession(sessionConfig, commandLineConfigOverrides
|
|
|
89
136
|
}
|
|
90
137
|
const bridge = createStatusBridge();
|
|
91
138
|
const debugBridge = createDebugBridge();
|
|
139
|
+
const approvalBridge = createApprovalBridge();
|
|
92
140
|
const runner = new GthAgentRunner(bridge.emit, createResolvers(), gthDeepAgentFactory);
|
|
93
141
|
try {
|
|
94
142
|
await runner.init(sessionConfig.mode, config, checkpointSaver);
|
|
143
|
+
// Tool-approval (human-in-the-loop) prompt for gated tools — the readline counterpart in
|
|
144
|
+
// interactiveSessionModule. The runner consults the allow-list BEFORE calling this, so
|
|
145
|
+
// trusted commands never reach the TUI prompt; otherwise the bridge surfaces the pending
|
|
146
|
+
// command in the mounted <App> and awaits the human's scoped decision (o/s/a → approve,
|
|
147
|
+
// anything else → reject, fail-closed).
|
|
148
|
+
runner.setToolApprovalCallback((pending) => approvalBridge.request(pending));
|
|
95
149
|
// Attach the debug sink to the live deep agent (opt-in; the wrapModelCall middleware reads
|
|
96
150
|
// it lazily, so this only enables capture for the TUI's /debug panel — the lean/AG-UI
|
|
97
151
|
// contracts are untouched). Guarded by an instanceof so a non-deep agent simply has no
|
|
@@ -115,6 +169,10 @@ export async function createTuiSession(sessionConfig, commandLineConfigOverrides
|
|
|
115
169
|
resetThread() {
|
|
116
170
|
runner.resetThread();
|
|
117
171
|
},
|
|
172
|
+
// `/yolo` flips the runner's session-scoped shell auto-approval flag (EXT-12).
|
|
173
|
+
toggleYolo() {
|
|
174
|
+
return runner.toggleSessionYolo();
|
|
175
|
+
},
|
|
118
176
|
};
|
|
119
177
|
// "Bump up" the screen on launch the clear/Ctrl+L way (TUI-C13): scroll whatever was on
|
|
120
178
|
// screen before `gth`/`gsloth` ran up and out of the visible viewport (it stays in
|
|
@@ -128,7 +186,10 @@ export async function createTuiSession(sessionConfig, commandLineConfigOverrides
|
|
|
128
186
|
// writes the scroll/viewport-clear escapes, then calls this to make Ink forget its last
|
|
129
187
|
// frame so the re-render lands cleanly at the top (TUI-C12).
|
|
130
188
|
let resetFrame;
|
|
131
|
-
const instance = render(_jsx(App, { agent: tuiAgent, mode: sessionConfig.mode, modelDisplayName: config.modelDisplayName, readyMessage: sessionConfig.readyMessage, exitMessage: sessionConfig.exitMessage, initialMessage: message, subscribeStatus: bridge.subscribe, subscribeDebug: debugBridge.subscribe, onTurnComplete: logTurn, onResetFrame: () => resetFrame?.(), onExit: async () => {
|
|
189
|
+
const instance = render(_jsx(App, { agent: tuiAgent, mode: sessionConfig.mode, modelDisplayName: config.modelDisplayName, readyMessage: sessionConfig.readyMessage, exitMessage: sessionConfig.exitMessage, initialMessage: message, subscribeStatus: bridge.subscribe, subscribeDebug: debugBridge.subscribe, subscribeApproval: approvalBridge.subscribe, onTurnComplete: logTurn, onResetFrame: () => resetFrame?.(), onExit: async () => {
|
|
190
|
+
// Fail-closed: resolve any approval still awaiting a decision before tearing down,
|
|
191
|
+
// so a suspended run can never hang on an unanswered prompt.
|
|
192
|
+
approvalBridge.abortPending();
|
|
132
193
|
await runner.cleanup();
|
|
133
194
|
stopSessionLogging();
|
|
134
195
|
} }));
|
|
@@ -136,6 +197,7 @@ export async function createTuiSession(sessionConfig, commandLineConfigOverrides
|
|
|
136
197
|
await instance.waitUntilExit();
|
|
137
198
|
}
|
|
138
199
|
catch (err) {
|
|
200
|
+
approvalBridge.abortPending();
|
|
139
201
|
await runner.cleanup();
|
|
140
202
|
stopSessionLogging();
|
|
141
203
|
throw err;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tuiSessionModule.js","sourceRoot":"","sources":["../../src/tui/tuiSessionModule.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAmC,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"tuiSessionModule.js","sourceRoot":"","s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QAC7D,IAAI,UAAoC,CAAC;QACzC,MAAM,QAAQ,GAAG,MAAM,CACrB,KAAC,GAAG,IACF,KAAK,EAAE,QAAQ,EACf,IAAI,EAAE,aAAa,CAAC,IAAI,EACxB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,EACzC,YAAY,EAAE,aAAa,CAAC,YAAY,EACxC,WAAW,EAAE,aAAa,CAAC,WAAW,EACtC,cAAc,EAAE,OAAO,EACvB,eAAe,EAAE,MAAM,CAAC,SAAS,EACjC,cAAc,EAAE,WAAW,CAAC,SAAS,EACrC,iBAAiB,EAAE,cAAc,CAAC,SAAS,EAC3C,cAAc,EAAE,OAAO,EACvB,YAAY,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,EAAE,EAClC,MAAM,EAAE,KAAK,IAAI,EAAE;gBACjB,mFAAmF;gBACnF,6DAA6D;gBAC7D,cAAc,CAAC,YAAY,EAAE,CAAC;gBAC9B,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;gBACvB,kBAAkB,EAAE,CAAC;YACvB,CAAC,GACD,CACH,CAAC;QACF,UAAU,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAEpC,MAAM,QAAQ,CAAC,aAAa,EAAE,CAAC;IACjC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,cAAc,CAAC,YAAY,EAAE,CAAC;QAC9B,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;QACvB,kBAAkB,EAAE,CAAC;QACrB,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
package/dist/tui/types.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import type { AgentStreamEvent } from '@gaunt-sloth/core/core/types.js';
|
|
1
|
+
import type { AgentStreamEvent, PendingToolInterrupt, ToolApprovalDecision } from '@gaunt-sloth/core/core/types.js';
|
|
2
2
|
import type { TurnViewModel } from '#src/tui/viewModel.js';
|
|
3
3
|
import type { CommandNoticeTone } from '#src/tui/components/CommandNotice.js';
|
|
4
|
+
/**
|
|
5
|
+
* One in-flight tool-approval request bridged from the runner into the mounted `<App>`
|
|
6
|
+
* (EXT-9 Phase B2): the {@link PendingToolInterrupt} the runner suspended on, plus a `resolve`
|
|
7
|
+
* that hands the human's {@link ToolApprovalDecision} back to the awaiting runner callback.
|
|
8
|
+
* Idempotent — calling `resolve` more than once is a no-op (the first decision wins).
|
|
9
|
+
*/
|
|
10
|
+
export interface PendingApproval {
|
|
11
|
+
pending: PendingToolInterrupt;
|
|
12
|
+
resolve: (decision: ToolApprovalDecision) => void;
|
|
13
|
+
}
|
|
4
14
|
/**
|
|
5
15
|
* The minimal agent surface the Ink `<App>` drives. Decoupling the component from
|
|
6
16
|
* `GthAgentRunner` keeps the UI unit-testable with a scripted fake (a generator that
|
|
@@ -15,6 +25,12 @@ export interface TuiAgent {
|
|
|
15
25
|
* Optional so the fixture agent (no real checkpointer thread) may omit it.
|
|
16
26
|
*/
|
|
17
27
|
resetThread?(): void;
|
|
28
|
+
/**
|
|
29
|
+
* EXT-12 — flip the runner's session-scoped yolo flag (shell auto-approval) and return the NEW
|
|
30
|
+
* state, so the App can render a state-aware notice. Wired to the `/yolo` slash command.
|
|
31
|
+
* Optional so the fixture agent (no runner) may omit it.
|
|
32
|
+
*/
|
|
33
|
+
toggleYolo?(): boolean;
|
|
18
34
|
}
|
|
19
35
|
/**
|
|
20
36
|
* One debug capture from the deep agent's `wrapModelCall` middleware. `kind: 'request'`
|
|
@@ -72,6 +88,13 @@ export interface TuiAppProps {
|
|
|
72
88
|
* so the readline/AG-UI paths and the fixture agent (which have no such sink) simply omit it.
|
|
73
89
|
*/
|
|
74
90
|
subscribeDebug?: (cb: (capture: TuiDebugCapture) => void) => () => void;
|
|
91
|
+
/**
|
|
92
|
+
* Subscribe to tool-approval requests bridged from the runner (EXT-9 Phase B2): each
|
|
93
|
+
* {@link PendingApproval} carries the pending `run_shell_command` interrupt and a `resolve`
|
|
94
|
+
* the app calls with the human's scoped decision. Optional so the fixture/AG-UI paths (which
|
|
95
|
+
* never surface approvals) simply omit it.
|
|
96
|
+
*/
|
|
97
|
+
subscribeApproval?: (cb: (record: PendingApproval) => void) => () => void;
|
|
75
98
|
/** Called once a turn finishes, with the user input and the final assistant text. */
|
|
76
99
|
onTurnComplete?: (userInput: string, assistantText: string) => void;
|
|
77
100
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gaunt-sloth",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Andrew Kondratev",
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"main": "dist/cli.js",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/
|
|
11
|
+
"url": "git+https://github.com/pukeko-robotics/gaunt-sloth.git",
|
|
12
12
|
"directory": "packages/app"
|
|
13
13
|
},
|
|
14
14
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/
|
|
15
|
+
"url": "https://github.com/pukeko-robotics/gaunt-sloth/issues"
|
|
16
16
|
},
|
|
17
|
-
"homepage": "https://github.com/
|
|
17
|
+
"homepage": "https://github.com/pukeko-robotics/gaunt-sloth#readme",
|
|
18
18
|
"keywords": [
|
|
19
19
|
"ai",
|
|
20
20
|
"agent",
|
|
@@ -26,10 +26,6 @@
|
|
|
26
26
|
"node": ">=24.0.0",
|
|
27
27
|
"npm": ">=11.0.0"
|
|
28
28
|
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"build": "tsc",
|
|
31
|
-
"prepack": "tsc"
|
|
32
|
-
},
|
|
33
29
|
"bin": {
|
|
34
30
|
"gaunt-sloth-assistant": "cli.js",
|
|
35
31
|
"gaunt-sloth": "cli.js",
|
|
@@ -37,17 +33,19 @@
|
|
|
37
33
|
"gth": "cli.js"
|
|
38
34
|
},
|
|
39
35
|
"dependencies": {
|
|
40
|
-
"@gaunt-sloth/agent": "2.0.0-alpha.1",
|
|
41
|
-
"@gaunt-sloth/core": "2.0.0-alpha.1",
|
|
42
|
-
"@gaunt-sloth/review": "2.0.0-alpha.1",
|
|
43
36
|
"@langchain/anthropic": "^1.5.0",
|
|
44
37
|
"@langchain/core": "^1.2.0",
|
|
45
38
|
"@langchain/deepseek": "^1.1.1",
|
|
46
39
|
"@langchain/google": "^0.2.0",
|
|
47
40
|
"@langchain/groq": "^1.3.0",
|
|
41
|
+
"@langchain/langgraph": "^1.4.4",
|
|
48
42
|
"@langchain/openai": "^1.5.1",
|
|
49
43
|
"@langchain/xai": "^1.4.1",
|
|
50
|
-
"commander": "^15.0.0"
|
|
44
|
+
"commander": "^15.0.0",
|
|
45
|
+
"zod": "^3.25.0 || ^4.0.0",
|
|
46
|
+
"@gaunt-sloth/core": "2.0.0-alpha.3",
|
|
47
|
+
"@gaunt-sloth/review": "2.0.0-alpha.3",
|
|
48
|
+
"@gaunt-sloth/agent": "2.0.0-alpha.3"
|
|
51
49
|
},
|
|
52
50
|
"optionalDependencies": {
|
|
53
51
|
"chalk": "^5.6.2",
|
|
@@ -75,5 +73,8 @@
|
|
|
75
73
|
],
|
|
76
74
|
"publishConfig": {
|
|
77
75
|
"tag": "alpha"
|
|
76
|
+
},
|
|
77
|
+
"scripts": {
|
|
78
|
+
"build": "tsc"
|
|
78
79
|
}
|
|
79
|
-
}
|
|
80
|
+
}
|