gaunt-sloth 2.0.0-alpha.3 → 2.0.0-alpha.31
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/README.md +34 -18
- package/cli.js +5 -2
- package/dist/cli.js +61 -8
- package/dist/cli.js.map +1 -1
- package/dist/commands/adkEvalRunner.d.ts +66 -0
- package/dist/commands/adkEvalRunner.js +69 -0
- package/dist/commands/adkEvalRunner.js.map +1 -0
- package/dist/commands/agUiEvalRunner.d.ts +90 -0
- package/dist/commands/agUiEvalRunner.js +320 -0
- package/dist/commands/agUiEvalRunner.js.map +1 -0
- package/dist/commands/apiCommand.js +1 -0
- package/dist/commands/apiCommand.js.map +1 -1
- package/dist/commands/askCommand.d.ts +3 -2
- package/dist/commands/askCommand.js +26 -7
- package/dist/commands/askCommand.js.map +1 -1
- package/dist/commands/batchCommand.d.ts +78 -0
- package/dist/commands/batchCommand.js +258 -0
- package/dist/commands/batchCommand.js.map +1 -0
- package/dist/commands/chatCommand.js +4 -0
- package/dist/commands/chatCommand.js.map +1 -1
- package/dist/commands/cliOptionParsers.d.ts +12 -0
- package/dist/commands/cliOptionParsers.js +18 -0
- package/dist/commands/cliOptionParsers.js.map +1 -0
- package/dist/commands/codeCommand.js +4 -0
- package/dist/commands/codeCommand.js.map +1 -1
- package/dist/commands/commandIntrospection.d.ts +16 -6
- package/dist/commands/commandIntrospection.js +22 -12
- package/dist/commands/commandIntrospection.js.map +1 -1
- package/dist/commands/commandUtils.d.ts +17 -16
- package/dist/commands/commandUtils.js +21 -20
- package/dist/commands/commandUtils.js.map +1 -1
- package/dist/commands/configCommand.d.ts +28 -0
- package/dist/commands/configCommand.js +176 -0
- package/dist/commands/configCommand.js.map +1 -0
- package/dist/commands/configSetup.d.ts +1 -2
- package/dist/commands/configSetup.js +21 -36
- package/dist/commands/configSetup.js.map +1 -1
- package/dist/commands/evalCommand.d.ts +63 -0
- package/dist/commands/evalCommand.js +786 -0
- package/dist/commands/evalCommand.js.map +1 -0
- package/dist/commands/execCommand.d.ts +9 -3
- package/dist/commands/execCommand.js +22 -4
- package/dist/commands/execCommand.js.map +1 -1
- package/dist/commands/firstRunDialog.d.ts +43 -9
- package/dist/commands/firstRunDialog.js +77 -15
- package/dist/commands/firstRunDialog.js.map +1 -1
- package/dist/commands/getCommand.js +8 -7
- package/dist/commands/getCommand.js.map +1 -1
- package/dist/commands/historyCommand.d.ts +17 -0
- package/dist/commands/historyCommand.js +107 -0
- package/dist/commands/historyCommand.js.map +1 -0
- package/dist/commands/initCommand.d.ts +3 -0
- package/dist/commands/initCommand.js +12 -3
- package/dist/commands/initCommand.js.map +1 -1
- package/dist/commands/insightsCommand.d.ts +8 -0
- package/dist/commands/insightsCommand.js +33 -0
- package/dist/commands/insightsCommand.js.map +1 -0
- package/dist/commands/modelsCommand.d.ts +25 -0
- package/dist/commands/modelsCommand.js +101 -0
- package/dist/commands/modelsCommand.js.map +1 -0
- package/dist/commands/prCommand.js +24 -18
- package/dist/commands/prCommand.js.map +1 -1
- package/dist/commands/prDiscovery.d.ts +2 -2
- package/dist/commands/prDiscovery.js +33 -30
- package/dist/commands/prDiscovery.js.map +1 -1
- package/dist/commands/reviewCommand.js +29 -13
- package/dist/commands/reviewCommand.js.map +1 -1
- package/dist/commands/workflowCommand.d.ts +19 -0
- package/dist/commands/workflowCommand.js +81 -0
- package/dist/commands/workflowCommand.js.map +1 -0
- package/dist/helpers/jira/jiraLogWork.js.map +1 -1
- package/dist/modules/startSession.js +17 -9
- package/dist/modules/startSession.js.map +1 -1
- package/dist/tui/colour.d.ts +49 -0
- package/dist/tui/colour.js +58 -0
- package/dist/tui/colour.js.map +1 -0
- package/dist/tui/components/App.js +669 -97
- package/dist/tui/components/App.js.map +1 -1
- package/dist/tui/components/ApprovalPrompt.d.ts +33 -8
- package/dist/tui/components/ApprovalPrompt.js +136 -13
- package/dist/tui/components/ApprovalPrompt.js.map +1 -1
- package/dist/tui/components/ApprovalsPicker.d.ts +41 -0
- package/dist/tui/components/ApprovalsPicker.js +49 -0
- package/dist/tui/components/ApprovalsPicker.js.map +1 -0
- package/dist/tui/components/AttackBanner.d.ts +54 -0
- package/dist/tui/components/AttackBanner.js +65 -0
- package/dist/tui/components/AttackBanner.js.map +1 -0
- package/dist/tui/components/ClearBanner.d.ts +8 -6
- package/dist/tui/components/ClearBanner.js +9 -7
- package/dist/tui/components/ClearBanner.js.map +1 -1
- package/dist/tui/components/DebugPanel.d.ts +31 -11
- package/dist/tui/components/DebugPanel.js +54 -25
- package/dist/tui/components/DebugPanel.js.map +1 -1
- package/dist/tui/components/FetchProgress.d.ts +36 -0
- package/dist/tui/components/FetchProgress.js +39 -0
- package/dist/tui/components/FetchProgress.js.map +1 -0
- package/dist/tui/components/FramedLines.d.ts +25 -0
- package/dist/tui/components/FramedLines.js +24 -0
- package/dist/tui/components/FramedLines.js.map +1 -0
- package/dist/tui/components/LaunchBanner.d.ts +33 -0
- package/dist/tui/components/LaunchBanner.js +56 -0
- package/dist/tui/components/LaunchBanner.js.map +1 -0
- package/dist/tui/components/LiveTurn.d.ts +66 -5
- package/dist/tui/components/LiveTurn.js +135 -18
- package/dist/tui/components/LiveTurn.js.map +1 -1
- package/dist/tui/components/NoticeBar.d.ts +32 -0
- package/dist/tui/components/NoticeBar.js +39 -0
- package/dist/tui/components/NoticeBar.js.map +1 -0
- package/dist/tui/components/PromptInput.d.ts +7 -5
- package/dist/tui/components/PromptInput.js +145 -7
- package/dist/tui/components/PromptInput.js.map +1 -1
- package/dist/tui/components/Rule.d.ts +8 -14
- package/dist/tui/components/Rule.js +12 -38
- package/dist/tui/components/Rule.js.map +1 -1
- package/dist/tui/components/SelectList.d.ts +112 -9
- package/dist/tui/components/SelectList.js +217 -26
- package/dist/tui/components/SelectList.js.map +1 -1
- package/dist/tui/components/SlashCommandMenu.d.ts +20 -0
- package/dist/tui/components/SlashCommandMenu.js +28 -0
- package/dist/tui/components/SlashCommandMenu.js.map +1 -0
- package/dist/tui/components/StatusBar.d.ts +19 -1
- package/dist/tui/components/StatusBar.js +15 -3
- package/dist/tui/components/StatusBar.js.map +1 -1
- package/dist/tui/components/TranscriptViewport.d.ts +75 -0
- package/dist/tui/components/TranscriptViewport.js +124 -0
- package/dist/tui/components/TranscriptViewport.js.map +1 -0
- package/dist/tui/debugRender.d.ts +41 -6
- package/dist/tui/debugRender.js +126 -12
- package/dist/tui/debugRender.js.map +1 -1
- package/dist/tui/debugSearch.d.ts +40 -0
- package/dist/tui/debugSearch.js +73 -0
- package/dist/tui/debugSearch.js.map +1 -0
- package/dist/tui/hitRegions.d.ts +85 -0
- package/dist/tui/hitRegions.js +114 -0
- package/dist/tui/hitRegions.js.map +1 -0
- package/dist/tui/keyBindings.d.ts +37 -0
- package/dist/tui/keyBindings.js +119 -0
- package/dist/tui/keyBindings.js.map +1 -0
- package/dist/tui/markdown.d.ts +5 -22
- package/dist/tui/markdown.js +0 -0
- package/dist/tui/markdown.js.map +1 -1
- package/dist/tui/mouseParser.d.ts +75 -0
- package/dist/tui/mouseParser.js +108 -0
- package/dist/tui/mouseParser.js.map +1 -0
- package/dist/tui/mouseReporting.d.ts +70 -0
- package/dist/tui/mouseReporting.js +110 -0
- package/dist/tui/mouseReporting.js.map +1 -0
- package/dist/tui/mouseStdin.d.ts +100 -0
- package/dist/tui/mouseStdin.js +252 -0
- package/dist/tui/mouseStdin.js.map +1 -0
- package/dist/tui/pasteParser.d.ts +21 -0
- package/dist/tui/pasteParser.js +24 -0
- package/dist/tui/pasteParser.js.map +1 -0
- package/dist/tui/ruleWidth.d.ts +16 -0
- package/dist/tui/ruleWidth.js +24 -0
- package/dist/tui/ruleWidth.js.map +1 -0
- package/dist/tui/selectCancelled.d.ts +13 -0
- package/dist/tui/selectCancelled.js +17 -0
- package/dist/tui/selectCancelled.js.map +1 -0
- package/dist/tui/shouldUseTui.d.ts +23 -2
- package/dist/tui/shouldUseTui.js +31 -6
- package/dist/tui/shouldUseTui.js.map +1 -1
- package/dist/tui/transcriptScroll.d.ts +129 -0
- package/dist/tui/transcriptScroll.js +169 -0
- package/dist/tui/transcriptScroll.js.map +1 -0
- package/dist/tui/transcriptWindow.d.ts +75 -0
- package/dist/tui/transcriptWindow.js +200 -0
- package/dist/tui/transcriptWindow.js.map +1 -0
- package/dist/tui/tuiSessionModule.js +413 -48
- package/dist/tui/tuiSessionModule.js.map +1 -1
- package/dist/tui/types.d.ts +171 -18
- package/dist/tui/useMouse.d.ts +52 -0
- package/dist/tui/useMouse.js +114 -0
- package/dist/tui/useMouse.js.map +1 -0
- package/dist/tui/useSlothAnimation.d.ts +29 -0
- package/dist/tui/useSlothAnimation.js +65 -0
- package/dist/tui/useSlothAnimation.js.map +1 -0
- package/dist/tui/useTerminalSize.d.ts +50 -0
- package/dist/tui/useTerminalSize.js +95 -0
- package/dist/tui/useTerminalSize.js.map +1 -0
- package/dist/tui/useTranscriptScroll.d.ts +82 -0
- package/dist/tui/useTranscriptScroll.js +168 -0
- package/dist/tui/useTranscriptScroll.js.map +1 -0
- package/dist/tui/viewModel.d.ts +40 -0
- package/dist/tui/viewModel.js +99 -0
- package/dist/tui/viewModel.js.map +1 -1
- package/dist/utils/configErrorGuard.d.ts +30 -0
- package/dist/utils/configErrorGuard.js +54 -0
- package/dist/utils/configErrorGuard.js.map +1 -0
- package/dist/utils/stdinPolicy.d.ts +31 -0
- package/dist/utils/stdinPolicy.js +37 -0
- package/dist/utils/stdinPolicy.js.map +1 -0
- package/package.json +24 -21
- package/dist/builtInToolsConfig.d.ts +0 -1
- package/dist/builtInToolsConfig.js +0 -2
- package/dist/builtInToolsConfig.js.map +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -2
- package/dist/config.js.map +0 -1
- package/dist/constants.d.ts +0 -1
- package/dist/constants.js +0 -2
- package/dist/constants.js.map +0 -1
- package/dist/core/GthAgentRunner.d.ts +0 -1
- package/dist/core/GthAgentRunner.js +0 -2
- package/dist/core/GthAgentRunner.js.map +0 -1
- package/dist/core/GthLangChainAgent.d.ts +0 -1
- package/dist/core/GthLangChainAgent.js +0 -2
- package/dist/core/GthLangChainAgent.js.map +0 -1
- package/dist/core/types.d.ts +0 -1
- package/dist/core/types.js +0 -2
- package/dist/core/types.js.map +0 -1
- package/dist/helpers/jira/jiraClient.d.ts +0 -1
- package/dist/helpers/jira/jiraClient.js +0 -2
- package/dist/helpers/jira/jiraClient.js.map +0 -1
- package/dist/mcp/OAuthClientProviderImpl.d.ts +0 -1
- package/dist/mcp/OAuthClientProviderImpl.js +0 -2
- package/dist/mcp/OAuthClientProviderImpl.js.map +0 -1
- package/dist/middleware/binaryContentInjectionMiddleware.d.ts +0 -1
- package/dist/middleware/binaryContentInjectionMiddleware.js +0 -2
- package/dist/middleware/binaryContentInjectionMiddleware.js.map +0 -1
- package/dist/middleware/registry.d.ts +0 -1
- package/dist/middleware/registry.js +0 -2
- package/dist/middleware/registry.js.map +0 -1
- package/dist/middleware/reviewRateMiddleware.d.ts +0 -1
- package/dist/middleware/reviewRateMiddleware.js +0 -2
- package/dist/middleware/reviewRateMiddleware.js.map +0 -1
- package/dist/middleware/types.d.ts +0 -1
- package/dist/middleware/types.js +0 -2
- package/dist/middleware/types.js.map +0 -1
- package/dist/modules/a2a/A2AClientWrapper.d.ts +0 -1
- package/dist/modules/a2a/A2AClientWrapper.js +0 -2
- package/dist/modules/a2a/A2AClientWrapper.js.map +0 -1
- package/dist/modules/apiAgUiModule.d.ts +0 -1
- package/dist/modules/apiAgUiModule.js +0 -2
- package/dist/modules/apiAgUiModule.js.map +0 -1
- package/dist/modules/interactiveSessionModule.d.ts +0 -1
- package/dist/modules/interactiveSessionModule.js +0 -2
- package/dist/modules/interactiveSessionModule.js.map +0 -1
- package/dist/modules/reviewModule.d.ts +0 -1
- package/dist/modules/reviewModule.js +0 -2
- package/dist/modules/reviewModule.js.map +0 -1
- package/dist/modules/types.d.ts +0 -1
- package/dist/modules/types.js +0 -2
- package/dist/modules/types.js.map +0 -1
- package/dist/presets/anthropic.d.ts +0 -1
- package/dist/presets/anthropic.js +0 -2
- package/dist/presets/anthropic.js.map +0 -1
- package/dist/presets/deepseek.d.ts +0 -1
- package/dist/presets/deepseek.js +0 -2
- package/dist/presets/deepseek.js.map +0 -1
- package/dist/presets/fake.d.ts +0 -1
- package/dist/presets/fake.js +0 -2
- package/dist/presets/fake.js.map +0 -1
- package/dist/presets/google-genai.d.ts +0 -1
- package/dist/presets/google-genai.js +0 -2
- package/dist/presets/google-genai.js.map +0 -1
- package/dist/presets/groq.d.ts +0 -1
- package/dist/presets/groq.js +0 -2
- package/dist/presets/groq.js.map +0 -1
- package/dist/presets/openai.d.ts +0 -1
- package/dist/presets/openai.js +0 -2
- package/dist/presets/openai.js.map +0 -1
- package/dist/presets/openrouter.d.ts +0 -1
- package/dist/presets/openrouter.js +0 -2
- package/dist/presets/openrouter.js.map +0 -1
- package/dist/presets/vertexai.d.ts +0 -1
- package/dist/presets/vertexai.js +0 -2
- package/dist/presets/vertexai.js.map +0 -1
- package/dist/presets/xai.d.ts +0 -1
- package/dist/presets/xai.js +0 -2
- package/dist/presets/xai.js.map +0 -1
- package/dist/providers/file.d.ts +0 -1
- package/dist/providers/file.js +0 -2
- package/dist/providers/file.js.map +0 -1
- package/dist/providers/ghIssueProvider.d.ts +0 -1
- package/dist/providers/ghIssueProvider.js +0 -2
- package/dist/providers/ghIssueProvider.js.map +0 -1
- package/dist/providers/ghPrDiffProvider.d.ts +0 -1
- package/dist/providers/ghPrDiffProvider.js +0 -2
- package/dist/providers/ghPrDiffProvider.js.map +0 -1
- package/dist/providers/jiraIssueLegacyProvider.d.ts +0 -1
- package/dist/providers/jiraIssueLegacyProvider.js +0 -2
- package/dist/providers/jiraIssueLegacyProvider.js.map +0 -1
- package/dist/providers/jiraIssueProvider.d.ts +0 -1
- package/dist/providers/jiraIssueProvider.js +0 -2
- package/dist/providers/jiraIssueProvider.js.map +0 -1
- package/dist/providers/text.d.ts +0 -1
- package/dist/providers/text.js +0 -2
- package/dist/providers/text.js.map +0 -1
- package/dist/providers/types.d.ts +0 -1
- package/dist/providers/types.js +0 -2
- package/dist/providers/types.js.map +0 -1
- package/dist/state/artifactStore.d.ts +0 -1
- package/dist/state/artifactStore.js +0 -2
- package/dist/state/artifactStore.js.map +0 -1
- package/dist/tools/A2AAgentTool.d.ts +0 -1
- package/dist/tools/A2AAgentTool.js +0 -2
- package/dist/tools/A2AAgentTool.js.map +0 -1
- package/dist/tools/GthCustomToolkit.d.ts +0 -1
- package/dist/tools/GthCustomToolkit.js +0 -2
- package/dist/tools/GthCustomToolkit.js.map +0 -1
- package/dist/tools/GthDevToolkit.d.ts +0 -1
- package/dist/tools/GthDevToolkit.js +0 -2
- package/dist/tools/GthDevToolkit.js.map +0 -1
- package/dist/tools/GthFileSystemToolkit.d.ts +0 -1
- package/dist/tools/GthFileSystemToolkit.js +0 -2
- package/dist/tools/GthFileSystemToolkit.js.map +0 -1
- package/dist/tools/binaryUtils.d.ts +0 -1
- package/dist/tools/binaryUtils.js +0 -2
- package/dist/tools/binaryUtils.js.map +0 -1
- package/dist/tools/gthJiraLogWorkTool.d.ts +0 -3
- package/dist/tools/gthJiraLogWorkTool.js +0 -37
- package/dist/tools/gthJiraLogWorkTool.js.map +0 -1
- package/dist/tools/gthStatusUpdateTool.d.ts +0 -1
- package/dist/tools/gthStatusUpdateTool.js +0 -2
- package/dist/tools/gthStatusUpdateTool.js.map +0 -1
- package/dist/tools/gthWebFetchTool.d.ts +0 -1
- package/dist/tools/gthWebFetchTool.js +0 -2
- package/dist/tools/gthWebFetchTool.js.map +0 -1
- package/dist/tools/showA2UISurfaceTool.d.ts +0 -1
- package/dist/tools/showA2UISurfaceTool.js +0 -2
- package/dist/tools/showA2UISurfaceTool.js.map +0 -1
- package/dist/tui/components/Transcript.d.ts +0 -15
- package/dist/tui/components/Transcript.js +0 -37
- package/dist/tui/components/Transcript.js.map +0 -1
- package/dist/tui/slashCommands.d.ts +0 -111
- package/dist/tui/slashCommands.js +0 -193
- package/dist/tui/slashCommands.js.map +0 -1
- package/dist/tui/terminal.d.ts +0 -14
- package/dist/tui/terminal.js +0 -20
- package/dist/tui/terminal.js.map +0 -1
- package/dist/utils/ProgressIndicator.d.ts +0 -1
- package/dist/utils/ProgressIndicator.js +0 -2
- package/dist/utils/ProgressIndicator.js.map +0 -1
- package/dist/utils/aiignoreUtils.d.ts +0 -1
- package/dist/utils/aiignoreUtils.js +0 -2
- package/dist/utils/aiignoreUtils.js.map +0 -1
- package/dist/utils/binaryOutputUtils.d.ts +0 -1
- package/dist/utils/binaryOutputUtils.js +0 -2
- package/dist/utils/binaryOutputUtils.js.map +0 -1
- package/dist/utils/consoleUtils.d.ts +0 -1
- package/dist/utils/consoleUtils.js +0 -2
- package/dist/utils/consoleUtils.js.map +0 -1
- package/dist/utils/debugUtils.d.ts +0 -1
- package/dist/utils/debugUtils.js +0 -2
- package/dist/utils/debugUtils.js.map +0 -1
- package/dist/utils/fileUtils.d.ts +0 -1
- package/dist/utils/fileUtils.js +0 -2
- package/dist/utils/fileUtils.js.map +0 -1
- package/dist/utils/globalConfigUtils.d.ts +0 -1
- package/dist/utils/globalConfigUtils.js +0 -2
- package/dist/utils/globalConfigUtils.js.map +0 -1
- package/dist/utils/llmUtils.d.ts +0 -1
- package/dist/utils/llmUtils.js +0 -2
- package/dist/utils/llmUtils.js.map +0 -1
- package/dist/utils/mcpUtils.d.ts +0 -1
- package/dist/utils/mcpUtils.js +0 -2
- package/dist/utils/mcpUtils.js.map +0 -1
- package/dist/utils/stringUtils.d.ts +0 -1
- package/dist/utils/stringUtils.js +0 -2
- package/dist/utils/stringUtils.js.map +0 -1
- package/dist/utils/systemUtils.d.ts +0 -1
- package/dist/utils/systemUtils.js +0 -2
- package/dist/utils/systemUtils.js.map +0 -1
- package/dist/utils/vertexaiUtils.d.ts +0 -1
- package/dist/utils/vertexaiUtils.js +0 -2
- package/dist/utils/vertexaiUtils.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,37 +1,52 @@
|
|
|
1
1
|
# gaunt-sloth
|
|
2
2
|
|
|
3
|
-
The main CLI application for Gaunt Sloth
|
|
3
|
+
The main CLI application for Gaunt Sloth — the fat package that turns the `@gaunt-sloth/*`
|
|
4
|
+
libraries into the `gth` command.
|
|
4
5
|
|
|
5
6
|
## Contents
|
|
6
7
|
|
|
7
|
-
- CLI entry point
|
|
8
|
-
- Commands: `ask`, `review`, `pr`, `chat`, `code`, `init`, `get`, `api
|
|
9
|
-
|
|
8
|
+
- CLI entry point, commander-based command registration, and the Ink TUI
|
|
9
|
+
- Commands: `ask`, `review`, `pr`, `chat`, `code`, `exec`, `init`, `config`, `get`, `api`,
|
|
10
|
+
`batch`, `eval`, `workflow`, `history`, `insights`, `models` — see
|
|
11
|
+
[docs/COMMANDS.md](https://github.com/pukeko-robotics/gaunt-sloth/blob/main/docs/COMMANDS.md)
|
|
10
12
|
- Vendor package wiring (all LangChain provider packages)
|
|
11
|
-
- Integration tests
|
|
12
13
|
|
|
13
14
|
## CLI Binaries
|
|
14
15
|
|
|
15
|
-
The package registers
|
|
16
|
+
The package registers three equivalent binary aliases:
|
|
16
17
|
|
|
17
|
-
- `
|
|
18
|
-
- `
|
|
19
|
-
- `
|
|
20
|
-
- `gaunt-sloth-assistant` (back-compat alias for the former package name)
|
|
18
|
+
- `gth` (primary)
|
|
19
|
+
- `gsloth` (long-form alias)
|
|
20
|
+
- `gaunt-sloth` (package-name alias)
|
|
21
21
|
|
|
22
22
|
## Dependencies
|
|
23
23
|
|
|
24
24
|
- `@gaunt-sloth/core`
|
|
25
25
|
- `@gaunt-sloth/agent`
|
|
26
26
|
- `@gaunt-sloth/review`
|
|
27
|
+
- `@gaunt-sloth/batch`
|
|
28
|
+
- `@gaunt-sloth/eval-reporter-junit`
|
|
27
29
|
- `commander`
|
|
28
|
-
- All LangChain vendor packages (anthropic, google
|
|
30
|
+
- All LangChain vendor packages (anthropic, google, groq, openai, xai, etc.)
|
|
29
31
|
|
|
30
32
|
This is the only package in the workspace that pulls in AI vendor dependencies directly. All other packages treat vendors as optional peers.
|
|
31
33
|
|
|
32
|
-
##
|
|
34
|
+
## Not a library
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
This package deliberately exports **no importable modules** — its `exports` map exposes only
|
|
37
|
+
`./package.json`. It is the CLI product: install it globally and run `gth`. To embed Gaunt Sloth
|
|
38
|
+
functionality in your own code, depend on the scoped packages instead — they are the supported
|
|
39
|
+
embeddable surface:
|
|
40
|
+
|
|
41
|
+
- [`@gaunt-sloth/core`](https://www.npmjs.com/package/@gaunt-sloth/core) — config resolution and
|
|
42
|
+
the provider factory
|
|
43
|
+
- [`@gaunt-sloth/agent`](https://www.npmjs.com/package/@gaunt-sloth/agent) — the agent runtime,
|
|
44
|
+
tools, and the AG-UI/ACP servers
|
|
45
|
+
- [`@gaunt-sloth/review`](https://www.npmjs.com/package/@gaunt-sloth/review) — programmatic code
|
|
46
|
+
review (see its README for a worked embed example)
|
|
47
|
+
|
|
48
|
+
(Until 2.0 the app exposed a `./*` deep-path wildcard over a tree of re-export shims; the shims
|
|
49
|
+
are gone and the wildcard with them.)
|
|
35
50
|
|
|
36
51
|
## Installation
|
|
37
52
|
|
|
@@ -39,7 +54,7 @@ This is the only package in the workspace that pulls in AI vendor dependencies d
|
|
|
39
54
|
npm install -g gaunt-sloth
|
|
40
55
|
```
|
|
41
56
|
|
|
42
|
-
For full usage documentation see the [root README](
|
|
57
|
+
For full usage documentation see the [root README](https://github.com/pukeko-robotics/gaunt-sloth/blob/main/README.md) and [docs/COMMANDS.md](https://github.com/pukeko-robotics/gaunt-sloth/blob/main/docs/COMMANDS.md).
|
|
43
58
|
|
|
44
59
|
## ACP server (editor integration)
|
|
45
60
|
|
|
@@ -92,7 +107,8 @@ the same `command` + `args` pair.
|
|
|
92
107
|
|
|
93
108
|
## Related packages
|
|
94
109
|
|
|
95
|
-
- [`@gaunt-sloth/core`](
|
|
96
|
-
- [`@gaunt-sloth/agent`](
|
|
97
|
-
- [`@gaunt-sloth/review`](
|
|
98
|
-
- [
|
|
110
|
+
- [`@gaunt-sloth/core`](https://www.npmjs.com/package/@gaunt-sloth/core) — Core utilities, config, and agent infrastructure ([source](https://github.com/pukeko-robotics/gaunt-sloth/tree/main/packages/core))
|
|
111
|
+
- [`@gaunt-sloth/agent`](https://www.npmjs.com/package/@gaunt-sloth/agent) — Agent runtime, built-in tools, API/AG-UI/ACP server ([source](https://github.com/pukeko-robotics/gaunt-sloth/tree/main/packages/agent))
|
|
112
|
+
- [`@gaunt-sloth/review`](https://www.npmjs.com/package/@gaunt-sloth/review) — Review engine with content/requirement sources (GitHub, Jira, file, text) and standalone CLI ([source](https://github.com/pukeko-robotics/gaunt-sloth/tree/main/packages/review))
|
|
113
|
+
- [`@gaunt-sloth/batch`](https://www.npmjs.com/package/@gaunt-sloth/batch) — Batch / eval / workflow runtime ([source](https://github.com/pukeko-robotics/gaunt-sloth/tree/main/packages/batch))
|
|
114
|
+
- [`gaunt-sloth`](https://www.npmjs.com/package/gaunt-sloth) — Main CLI application (this package) ([source](https://github.com/pukeko-robotics/gaunt-sloth/tree/main/packages/app))
|
package/cli.js
CHANGED
|
@@ -42,8 +42,11 @@ if (process.argv.includes('--acp-agent')) {
|
|
|
42
42
|
}
|
|
43
43
|
} else {
|
|
44
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
|
-
|
|
45
|
+
// and delegates to the compiled TypeScript code in dist/cli.js.
|
|
46
|
+
// systemUtils lives in @gaunt-sloth/core (the app-side re-export shim died in
|
|
47
|
+
// GS2-2 B4); importing it from core directly binds the same module instance
|
|
48
|
+
// the rest of the app reads, so setEntryPoint state is shared as before.
|
|
49
|
+
const { setEntryPoint } = await import('@gaunt-sloth/core/utils/systemUtils.js');
|
|
47
50
|
|
|
48
51
|
// Set the installation directory in systemUtils
|
|
49
52
|
setEntryPoint(import.meta.url);
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { askCommand } from '#src/commands/askCommand.js';
|
|
3
3
|
import { execCommand } from '#src/commands/execCommand.js';
|
|
4
|
+
import { batchCommand } from '#src/commands/batchCommand.js';
|
|
5
|
+
import { evalCommand } from '#src/commands/evalCommand.js';
|
|
6
|
+
import { workflowCommand } from '#src/commands/workflowCommand.js';
|
|
4
7
|
import { initCommand } from '#src/commands/initCommand.js';
|
|
5
8
|
import { reviewCommand } from '#src/commands/reviewCommand.js';
|
|
6
9
|
import { prCommand } from '#src/commands/prCommand.js';
|
|
@@ -8,11 +11,22 @@ import { chatCommand } from '#src/commands/chatCommand.js';
|
|
|
8
11
|
import { codeCommand } from '#src/commands/codeCommand.js';
|
|
9
12
|
import { apiCommand } from '#src/commands/apiCommand.js';
|
|
10
13
|
import { getCommand } from '#src/commands/getCommand.js';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
14
|
+
import { configCommand } from '#src/commands/configCommand.js';
|
|
15
|
+
import { historyCommand } from '#src/commands/historyCommand.js';
|
|
16
|
+
import { insightsCommand } from '#src/commands/insightsCommand.js';
|
|
17
|
+
import { modelsCommand } from '#src/commands/modelsCommand.js';
|
|
18
|
+
import { argv, exit, getSlothVersion, readStdin } from '@gaunt-sloth/core/utils/systemUtils.js';
|
|
19
|
+
import { commandSkipsStdin, resolveInvokedCommandName } from '#src/utils/stdinPolicy.js';
|
|
20
|
+
import { guardProgramConfigErrors } from '#src/utils/configErrorGuard.js';
|
|
21
|
+
import { coerceBooleanOrString, displayError } from '@gaunt-sloth/core/utils/consoleUtils.js';
|
|
22
|
+
import { installCrashHandler } from '@gaunt-sloth/core/utils/crashHandler.js';
|
|
23
|
+
// GS2-48 — install the process-level crash handler as early as possible, so an uncaughtException /
|
|
24
|
+
// unhandledRejection anywhere in the run writes a redacted debug snapshot to ~/.gsloth/debug-dumps/
|
|
25
|
+
// before the process dies. Idempotent and inert on a normal exit.
|
|
26
|
+
installCrashHandler();
|
|
13
27
|
const program = new Command();
|
|
14
28
|
program
|
|
15
|
-
.name('
|
|
29
|
+
.name('gth')
|
|
16
30
|
.description('Gaunt Sloth reviewing your PRs')
|
|
17
31
|
.version(getSlothVersion())
|
|
18
32
|
.option('--verbose', 'Set LangChain/LangGraph to verbose mode, ' +
|
|
@@ -20,10 +34,14 @@ program
|
|
|
20
34
|
'Consider using debugLog from config.ts for less intrusive debug logging.')
|
|
21
35
|
.option('-c, --config <path>', 'Path to custom configuration file')
|
|
22
36
|
.option('-i, --identity-profile <identity>', 'Identity profile (separate config and prompts)')
|
|
37
|
+
.option('--profile <name>', 'Named config profile to run under (alias of --identity-profile; ' +
|
|
38
|
+
'create one with `gth config profile create <name>`)')
|
|
23
39
|
.option('-w, --write-output-to-file <value>', 'Write output to file. Accepts true/false or a filename. Shortcuts: -wn or -w0 for false.')
|
|
24
|
-
.option('--tui', 'Force the interactive Ink TUI for chat/code sessions
|
|
40
|
+
.option('--tui', 'Force the interactive Ink TUI for chat/code sessions ' +
|
|
41
|
+
'(overrides GTH_NO_TUI, the tui config key and CI auto-off)')
|
|
25
42
|
.option('--no-tui', 'Force the plain readline session for chat/code (disable the TUI)')
|
|
26
|
-
.addOption(new Option('--nopipe').hideHelp(true))
|
|
43
|
+
.addOption(new Option('--nopipe').hideHelp(true))
|
|
44
|
+
.addOption(new Option('--no-pipe').hideHelp(true));
|
|
27
45
|
const cliConfigOverrides = {};
|
|
28
46
|
// Parse global options before binding any commands
|
|
29
47
|
program.parseOptions(argv);
|
|
@@ -39,8 +57,18 @@ if (program.getOptionValue('config')) {
|
|
|
39
57
|
// Set a custom config path
|
|
40
58
|
cliConfigOverrides.customConfigPath = program.getOptionValue('config');
|
|
41
59
|
}
|
|
42
|
-
|
|
43
|
-
|
|
60
|
+
// `--profile` (GS2-33) is the friendly alias of `-i/--identity-profile`: both select a named profile
|
|
61
|
+
// block (`.gsloth/.gsloth-settings/<name>/`). If BOTH are given and disagree, that is a mistake worth
|
|
62
|
+
// surfacing rather than silently picking one; identical values are harmless.
|
|
63
|
+
const identityProfileOpt = program.getOptionValue('identityProfile');
|
|
64
|
+
const profileOpt = program.getOptionValue('profile');
|
|
65
|
+
if (identityProfileOpt && profileOpt && identityProfileOpt !== profileOpt) {
|
|
66
|
+
displayError(`Conflicting profiles: --identity-profile "${identityProfileOpt}" and --profile "${profileOpt}". ` +
|
|
67
|
+
'Pass only one (they are aliases).');
|
|
68
|
+
exit(1);
|
|
69
|
+
}
|
|
70
|
+
if (profileOpt ?? identityProfileOpt) {
|
|
71
|
+
cliConfigOverrides.identityProfile = profileOpt ?? identityProfileOpt;
|
|
44
72
|
}
|
|
45
73
|
// Tri-state TUI flag: leave `tui` undefined (auto-detect) unless the user explicitly passed
|
|
46
74
|
// `--tui` or `--no-tui`. Commander's `--no-tui` defaults the value to `true`, so we key off
|
|
@@ -62,9 +90,34 @@ reviewCommand(program, cliConfigOverrides);
|
|
|
62
90
|
prCommand(program, cliConfigOverrides);
|
|
63
91
|
askCommand(program, cliConfigOverrides);
|
|
64
92
|
execCommand(program, cliConfigOverrides);
|
|
93
|
+
batchCommand(program, cliConfigOverrides);
|
|
94
|
+
evalCommand(program, cliConfigOverrides);
|
|
95
|
+
workflowCommand(program, cliConfigOverrides);
|
|
65
96
|
chatCommand(program, cliConfigOverrides);
|
|
66
97
|
codeCommand(program, cliConfigOverrides);
|
|
67
98
|
apiCommand(program, cliConfigOverrides);
|
|
68
99
|
getCommand(program, cliConfigOverrides);
|
|
69
|
-
|
|
100
|
+
configCommand(program, cliConfigOverrides);
|
|
101
|
+
// GS2-7 (B20) — read-only, local history/insights surfaces. They resolve their own DB path (global
|
|
102
|
+
// default or --db) and do not build the LLM, so they stay decoupled from config/provider setup.
|
|
103
|
+
historyCommand(program);
|
|
104
|
+
insightsCommand(program);
|
|
105
|
+
// GS2-6 (B16) — model catalog: lists providers/models enriched with models.dev cost/limit metadata.
|
|
106
|
+
// Read-only; enrichment never gates what `/v1/models` reports as callable.
|
|
107
|
+
modelsCommand(program);
|
|
108
|
+
// BATCH-11 (#405 gotcha #5): `eval`/`batch` never consume piped stdin, so they must not block
|
|
109
|
+
// waiting for stdin EOF before dispatch — a scripted/CI `gth eval suite.yaml` inherits a non-TTY,
|
|
110
|
+
// non-closing stdin and would otherwise hang until EOF (or need `</dev/null`). Resolve the invoked
|
|
111
|
+
// subcommand from argv via commander's own operand parsing (so a `-c <path>` value or a file
|
|
112
|
+
// argument is never mistaken for the command name) and, for those commands, imply the existing
|
|
113
|
+
// `--no-pipe` fast path in readStdin. ask/review/pr etc. are untouched and still block-and-read a
|
|
114
|
+
// piped diff.
|
|
115
|
+
const invokedCommand = resolveInvokedCommandName(program.commands.map((command) => command.name()), program.parseOptions(argv).operands);
|
|
116
|
+
if (commandSkipsStdin(invokedCommand)) {
|
|
117
|
+
program.setOptionValue('nopipe', true);
|
|
118
|
+
}
|
|
119
|
+
// CFG-35 — the config loader raises a catchable error when a provider has no resolvable API key,
|
|
120
|
+
// so programmatic callers can classify it. For a person at a terminal there is nothing to classify,
|
|
121
|
+
// so the `gth` CLI makes the terminating choice here, once, instead of in every command action.
|
|
122
|
+
await readStdin(guardProgramConfigErrors(program));
|
|
70
123
|
//# sourceMappingURL=cli.js.map
|
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,8BA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AC;AAED,iGAAiG;AACjG,oGAAoG;AACpG,gGAAgG;AAChG,MAAM,SAAS,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module adkEvalRunner
|
|
3
|
+
* BATCH-14 — the ADK (A2A) target's production runner builders for `gth eval`. The eval runner
|
|
4
|
+
* ({@link @gaunt-sloth/batch#runEvalSuite}) is target-agnostic: it consumes an injected
|
|
5
|
+
* {@link RunCellFn} (single-shot) and {@link RunConversationFn} (multi-turn) and grades whatever
|
|
6
|
+
* `answer` they produce with the SAME assertion surface used for the `gth-agent` target. This module
|
|
7
|
+
* builds those two functions for an EXTERNAL Google ADK agent, driving it over the A2A protocol via
|
|
8
|
+
* {@link A2AClientWrapper} (the existing `@a2a-js/sdk` wrapper) — the analogue of `batchCommand.ts`'s
|
|
9
|
+
* `buildProductionRunCell`/`buildProductionRunConversation` for the in-process gth agent.
|
|
10
|
+
*
|
|
11
|
+
* The A2A client is INJECTABLE (like `RunCellFn`/`RunConversationFn` themselves) so unit tests drive
|
|
12
|
+
* these builders against a FAKE client with no network and no live ADK agent — the live end-to-end
|
|
13
|
+
* validation is a separate node (BATCH-16).
|
|
14
|
+
*
|
|
15
|
+
* Honest boundaries (BATCH-14 design point 4): A2A exposes text (and file/data) parts plus task
|
|
16
|
+
* status/artifact events, but NOT the agent's intermediate tool/function calls — so the ADK outcomes
|
|
17
|
+
* never populate `tools`, and `must_call`/`must_not_call` are rejected at suite-parse time rather
|
|
18
|
+
* than silently passed. A2A likewise carries no token accounting, so `tokensInput`/`tokensOutput`
|
|
19
|
+
* are left unset (undefined), unlike the gth-agent path.
|
|
20
|
+
*/
|
|
21
|
+
import type { AdkAgentTarget, RunCellFn, RunConversationFn } from '@gaunt-sloth/batch';
|
|
22
|
+
/** One A2A turn's result as the ADK runner needs it: the answer text plus the continuity handles to
|
|
23
|
+
* thread into follow-up turns. */
|
|
24
|
+
export interface AdkA2AResponse {
|
|
25
|
+
text: string;
|
|
26
|
+
contextId?: string;
|
|
27
|
+
taskId?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The minimal A2A client the ADK runner depends on — a single `sendMessage(text, context?)` that
|
|
31
|
+
* returns text + continuity handles. Production wraps {@link A2AClientWrapper.sendMessageWithContext};
|
|
32
|
+
* tests inject a fake implementing exactly this. Kept deliberately narrow so a fake is trivial and
|
|
33
|
+
* the runner never reaches into the full SDK surface.
|
|
34
|
+
*/
|
|
35
|
+
export interface AdkA2AClient {
|
|
36
|
+
sendMessage(text: string, context?: {
|
|
37
|
+
contextId?: string;
|
|
38
|
+
taskId?: string;
|
|
39
|
+
}): Promise<AdkA2AResponse>;
|
|
40
|
+
}
|
|
41
|
+
/** Builds an {@link AdkA2AClient} for a target — the injection seam for tests. */
|
|
42
|
+
export type AdkClientFactory = (target: AdkAgentTarget) => AdkA2AClient;
|
|
43
|
+
/** Production factory: a real {@link A2AClientWrapper} over the target's A2A endpoint, adapted to the
|
|
44
|
+
* narrow {@link AdkA2AClient} shape via its context-threading {@link A2AClientWrapper.sendMessageWithContext}. */
|
|
45
|
+
export declare const defaultAdkClientFactory: AdkClientFactory;
|
|
46
|
+
/**
|
|
47
|
+
* Build the injectable single-shot {@link RunCellFn} that drives ONE ADK agent turn over A2A: send
|
|
48
|
+
* the cell's prompt as the A2A message text and return the agent's text as the cell `answer`. A
|
|
49
|
+
* transport/agent error is contained as a failed cell (`ok:false`) so one bad case can never take the
|
|
50
|
+
* whole suite down — matching `buildProductionRunCell`'s discipline for the gth-agent path.
|
|
51
|
+
*
|
|
52
|
+
* `tools`/tokens are intentionally unset (A2A exposes neither); content assertions grade the answer.
|
|
53
|
+
*/
|
|
54
|
+
export declare function buildAdkRunCell(target: AdkAgentTarget, createClient?: AdkClientFactory): RunCellFn;
|
|
55
|
+
/**
|
|
56
|
+
* Build the injectable multi-turn {@link RunConversationFn} that drives a whole scripted conversation
|
|
57
|
+
* against the ADK agent over A2A, threading the A2A `contextId` across turns so turn N sees turn
|
|
58
|
+
* N-1's context (an ADK agent keeps conversational memory by `contextId`). ONE client is built for
|
|
59
|
+
* the conversation; the first turn sends no context, and each subsequent turn carries the `contextId`
|
|
60
|
+
* the previous response returned.
|
|
61
|
+
*
|
|
62
|
+
* Returns one {@link TurnRunOutcome} per turn attempted. A turn that throws is recorded as a failed
|
|
63
|
+
* turn and ABORTS the conversation (the returned array is short) — the runner fails the un-run turns
|
|
64
|
+
* with a clear reason, exactly as it does for a gth-agent conversation that ended early.
|
|
65
|
+
*/
|
|
66
|
+
export declare function buildAdkRunConversation(target: AdkAgentTarget, createClient?: AdkClientFactory): RunConversationFn;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { A2AClientWrapper } from '@gaunt-sloth/agent/modules/a2a/A2AClientWrapper.js';
|
|
2
|
+
/** Production factory: a real {@link A2AClientWrapper} over the target's A2A endpoint, adapted to the
|
|
3
|
+
* narrow {@link AdkA2AClient} shape via its context-threading {@link A2AClientWrapper.sendMessageWithContext}. */
|
|
4
|
+
export const defaultAdkClientFactory = (target) => {
|
|
5
|
+
const wrapper = new A2AClientWrapper({
|
|
6
|
+
agentId: target.agentId ?? 'adk-agent',
|
|
7
|
+
agentUrl: target.url,
|
|
8
|
+
});
|
|
9
|
+
return {
|
|
10
|
+
sendMessage: (text, context) => wrapper.sendMessageWithContext(text, context),
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Build the injectable single-shot {@link RunCellFn} that drives ONE ADK agent turn over A2A: send
|
|
15
|
+
* the cell's prompt as the A2A message text and return the agent's text as the cell `answer`. A
|
|
16
|
+
* transport/agent error is contained as a failed cell (`ok:false`) so one bad case can never take the
|
|
17
|
+
* whole suite down — matching `buildProductionRunCell`'s discipline for the gth-agent path.
|
|
18
|
+
*
|
|
19
|
+
* `tools`/tokens are intentionally unset (A2A exposes neither); content assertions grade the answer.
|
|
20
|
+
*/
|
|
21
|
+
export function buildAdkRunCell(target, createClient = defaultAdkClientFactory) {
|
|
22
|
+
return async (cell) => {
|
|
23
|
+
try {
|
|
24
|
+
const client = createClient(target);
|
|
25
|
+
const { text } = await client.sendMessage(cell.content);
|
|
26
|
+
return { ok: true, answer: text };
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
return { ok: false, error: error instanceof Error ? error.message : String(error) };
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Build the injectable multi-turn {@link RunConversationFn} that drives a whole scripted conversation
|
|
35
|
+
* against the ADK agent over A2A, threading the A2A `contextId` across turns so turn N sees turn
|
|
36
|
+
* N-1's context (an ADK agent keeps conversational memory by `contextId`). ONE client is built for
|
|
37
|
+
* the conversation; the first turn sends no context, and each subsequent turn carries the `contextId`
|
|
38
|
+
* the previous response returned.
|
|
39
|
+
*
|
|
40
|
+
* Returns one {@link TurnRunOutcome} per turn attempted. A turn that throws is recorded as a failed
|
|
41
|
+
* turn and ABORTS the conversation (the returned array is short) — the runner fails the un-run turns
|
|
42
|
+
* with a clear reason, exactly as it does for a gth-agent conversation that ended early.
|
|
43
|
+
*/
|
|
44
|
+
export function buildAdkRunConversation(target, createClient = defaultAdkClientFactory) {
|
|
45
|
+
return async (userMessages) => {
|
|
46
|
+
const client = createClient(target);
|
|
47
|
+
const outcomes = [];
|
|
48
|
+
let contextId;
|
|
49
|
+
for (const message of userMessages) {
|
|
50
|
+
try {
|
|
51
|
+
const response = await client.sendMessage(message, contextId ? { contextId } : undefined);
|
|
52
|
+
// Carry the server's contextId forward so the next turn continues the same conversation.
|
|
53
|
+
if (response.contextId)
|
|
54
|
+
contextId = response.contextId;
|
|
55
|
+
outcomes.push({ ok: true, answer: response.text });
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
outcomes.push({
|
|
59
|
+
ok: false,
|
|
60
|
+
error: error instanceof Error ? error.message : String(error),
|
|
61
|
+
});
|
|
62
|
+
// A failed turn aborts the conversation — the runner marks the remaining turns FAILed.
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return outcomes;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=adkEvalRunner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adkEvalRunner.js","sourceRoot":"","sources":["../../src/commands/adkEvalRunner.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AA0BtF;kHACkH;AAClH,MAAM,CAAC,MAAM,uBAAuB,GAAqB,CAAC,MAAM,EAAE,EAAE;IAClE,MAAM,OAAO,GAAG,IAAI,gBAAgB,CAAC;QACnC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,WAAW;QACtC,QAAQ,EAAE,MAAM,CAAC,GAAG;KACrB,CAAC,CAAC;IACH,OAAO;QACL,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC;KAC9E,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,MAAsB,EACtB,YAAY,GAAqB,uBAAuB;IAExD,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;YACpC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACxD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QACpC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK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ent in the `RunAgentInput.messages` array. The eval only ever sends `user`
|
|
3
|
+
* turns and, for conversation continuity, the `assistant` answers it assembled — the minimal shape
|
|
4
|
+
* the reference server's `convertMessage` consumes (`{ id, role, content }`). */
|
|
5
|
+
export interface AgUiMessage {
|
|
6
|
+
id: string;
|
|
7
|
+
role: 'user' | 'assistant';
|
|
8
|
+
content: string;
|
|
9
|
+
}
|
|
10
|
+
/** The `RunAgentInput` fields the runner drives per request. `threadId` provides conversation
|
|
11
|
+
* continuity (stable across the turns of ONE conversation); `runId` is fresh per request. */
|
|
12
|
+
export interface AgUiRunInput {
|
|
13
|
+
threadId: string;
|
|
14
|
+
runId: string;
|
|
15
|
+
messages: AgUiMessage[];
|
|
16
|
+
}
|
|
17
|
+
/** One AG-UI run's decoded result: the answer assembled from `TEXT_MESSAGE_CONTENT` deltas and the
|
|
18
|
+
* tool names captured from `TOOL_CALL_START` events (empty array when the agent called no tools —
|
|
19
|
+
* NOT undefined, so `must_not_call` grades against a real, present trace). */
|
|
20
|
+
export interface AgUiRunResult {
|
|
21
|
+
answer: string;
|
|
22
|
+
tools: string[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The minimal AG-UI client the runner depends on — a single `run(input)` that POSTs one
|
|
26
|
+
* `RunAgentInput` and returns the decoded answer + tools. Production wraps {@link createAgUiClient};
|
|
27
|
+
* tests inject a fake implementing exactly this. Kept deliberately narrow so a fake is trivial and
|
|
28
|
+
* the runner never reaches into transport details.
|
|
29
|
+
*/
|
|
30
|
+
export interface AgUiClient {
|
|
31
|
+
run(input: AgUiRunInput): Promise<AgUiRunResult>;
|
|
32
|
+
}
|
|
33
|
+
/** Builds an {@link AgUiClient} for a target — the injection seam for tests. */
|
|
34
|
+
export type AgUiClientFactory = (target: AgUiAgentTarget) => AgUiClient;
|
|
35
|
+
/** The `fetch` seam — global `fetch` in production, a fake in tests (so the real POST-body
|
|
36
|
+
* construction + SSE decode are exercised with no network). */
|
|
37
|
+
export type FetchLike = typeof fetch;
|
|
38
|
+
/**
|
|
39
|
+
* Default deadline for one AG-UI run (fetch + full SSE decode). The runner has no configured
|
|
40
|
+
* timeout, so this bounds a server that hangs at EITHER phase — one that accepts the POST but never
|
|
41
|
+
* sends response headers (the `fetch` await never returns) OR one that opens the stream but never
|
|
42
|
+
* emits `RUN_FINISHED`: past it the case FAILS with a clear error instead of wedging the process.
|
|
43
|
+
* Injectable per-client for tests.
|
|
44
|
+
*/
|
|
45
|
+
export declare const AG_UI_RUN_TIMEOUT_MS = 120000;
|
|
46
|
+
/**
|
|
47
|
+
* Create a real {@link AgUiClient} that drives the target's AG-UI run endpoint over HTTP/SSE. Each
|
|
48
|
+
* `run` POSTs a `RunAgentInput` to `{url}/agents/{agentId}/run` and decodes the SSE response via
|
|
49
|
+
* {@link decodeAgUiStream}. A non-2xx response, an absent body, a `RUN_ERROR` event, a truncated
|
|
50
|
+
* stream, or a run that exceeds `timeoutMs` all throw — the runner builders contain that into a
|
|
51
|
+
* failed cell (`ok:false`).
|
|
52
|
+
*
|
|
53
|
+
* The WHOLE run is bounded by `timeoutMs` (default {@link AG_UI_RUN_TIMEOUT_MS}) via a single
|
|
54
|
+
* deadline armed BEFORE the fetch. BOTH phases are raced against it: the `fetch` await (so a server
|
|
55
|
+
* that accepts the POST but never sends response headers is bounded too) AND the SSE decode (so a
|
|
56
|
+
* body that opens but never ends still fails the case rather than hanging). Racing — not the abort
|
|
57
|
+
* signal — is the load-bearing mechanism, since a transport may ignore the abort; on timeout the
|
|
58
|
+
* `AbortController` is fired anyway to free a real socket. On a non-200 the unread body is cancelled
|
|
59
|
+
* first so its socket is released.
|
|
60
|
+
*
|
|
61
|
+
* `fetchImpl` defaults to global `fetch`; tests pass a fake returning a synthetic SSE `Response` so
|
|
62
|
+
* the body construction + decode are exercised without a network or a live server.
|
|
63
|
+
*/
|
|
64
|
+
export declare function createAgUiClient(target: AgUiAgentTarget, fetchImpl?: FetchLike, timeoutMs?: number): AgUiClient;
|
|
65
|
+
/** Production factory: a real HTTP/SSE {@link AgUiClient} over the target's AG-UI endpoint. */
|
|
66
|
+
export declare const defaultAgUiClientFactory: AgUiClientFactory;
|
|
67
|
+
/**
|
|
68
|
+
* Build the injectable single-shot {@link RunCellFn} that drives ONE AG-UI run: send the cell's
|
|
69
|
+
* prompt as the sole `user` message (fresh `threadId`/`runId`) and return the agent's assembled text
|
|
70
|
+
* as the cell `answer` plus the tool names captured from the stream as `tools`. A transport/stream
|
|
71
|
+
* error is contained as a failed cell (`ok:false`) so one bad case can never take the whole suite
|
|
72
|
+
* down — matching `buildProductionRunCell`'s discipline for the gth-agent path.
|
|
73
|
+
*
|
|
74
|
+
* `tools` is ALWAYS populated (possibly `[]`) — the AG-UI wire exposes the trace — so
|
|
75
|
+
* `must_call`/`must_not_call` grade normally, the key difference from the ADK target.
|
|
76
|
+
*/
|
|
77
|
+
export declare function buildAgUiRunCell(target: AgUiAgentTarget, createClient?: AgUiClientFactory): RunCellFn;
|
|
78
|
+
/**
|
|
79
|
+
* Build the injectable multi-turn {@link RunConversationFn} that drives a whole scripted conversation
|
|
80
|
+
* against the AG-UI agent, threading continuity via the `messages` array + a STABLE `threadId` across
|
|
81
|
+
* the turns of ONE conversation: each turn appends its `user` message, POSTs the accumulated history
|
|
82
|
+
* under the same `threadId`, then appends the assistant's answer so the next turn's request carries
|
|
83
|
+
* it. ONE `threadId` for the whole conversation; a fresh `runId` per turn.
|
|
84
|
+
*
|
|
85
|
+
* Returns one {@link TurnRunOutcome} per turn attempted (answer + per-turn tool trace). A turn that
|
|
86
|
+
* throws is recorded as a failed turn and ABORTS the conversation (the returned array is short) — the
|
|
87
|
+
* runner fails the un-run turns with a clear reason, exactly as it does for a gth-agent conversation
|
|
88
|
+
* that ended early.
|
|
89
|
+
*/
|
|
90
|
+
export declare function buildAgUiRunConversation(target: AgUiAgentTarget, createClient?: AgUiClientFactory): RunConversationFn;
|