gaunt-sloth 2.0.0-beta.1 → 2.0.0-beta.10
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 +6 -6
- package/dist/cli.js +24 -5
- package/dist/cli.js.map +1 -1
- package/dist/commands/apiCommand.js +25 -6
- package/dist/commands/apiCommand.js.map +1 -1
- package/dist/commands/askCommand.js +1 -1
- package/dist/commands/askCommand.js.map +1 -1
- package/dist/commands/batchCommand.js +2 -2
- package/dist/commands/batchCommand.js.map +1 -1
- package/dist/commands/chatCommand.js +8 -17
- package/dist/commands/chatCommand.js.map +1 -1
- package/dist/commands/codeCommand.js +11 -15
- package/dist/commands/codeCommand.js.map +1 -1
- package/dist/commands/commandIntrospection.d.ts +1 -1
- package/dist/commands/commandIntrospection.js +1 -1
- package/dist/commands/configSetup.d.ts +13 -1
- package/dist/commands/configSetup.js +27 -6
- package/dist/commands/configSetup.js.map +1 -1
- package/dist/commands/execCommand.js +1 -1
- package/dist/commands/execCommand.js.map +1 -1
- package/dist/commands/firstRunDialog.d.ts +12 -4
- package/dist/commands/firstRunDialog.js +64 -16
- package/dist/commands/firstRunDialog.js.map +1 -1
- package/dist/commands/historyCommand.d.ts +19 -4
- package/dist/commands/historyCommand.js +212 -12
- package/dist/commands/historyCommand.js.map +1 -1
- package/dist/commands/initCommand.d.ts +11 -1
- package/dist/commands/initCommand.js +21 -4
- package/dist/commands/initCommand.js.map +1 -1
- package/dist/commands/insightsCommand.d.ts +4 -4
- package/dist/commands/insightsCommand.js +26 -8
- package/dist/commands/insightsCommand.js.map +1 -1
- package/dist/commands/prCommand.js +13 -1
- package/dist/commands/prCommand.js.map +1 -1
- package/dist/commands/prDiscovery.js +53 -1
- package/dist/commands/prDiscovery.js.map +1 -1
- package/dist/commands/resumeOption.d.ts +28 -0
- package/dist/commands/resumeOption.js +42 -0
- package/dist/commands/resumeOption.js.map +1 -0
- package/dist/commands/reviewCommand.js +12 -1
- package/dist/commands/reviewCommand.js.map +1 -1
- package/dist/modules/sessionConfigs.d.ts +16 -0
- package/dist/modules/sessionConfigs.js +47 -0
- package/dist/modules/sessionConfigs.js.map +1 -0
- package/dist/modules/startSession.d.ts +2 -2
- package/dist/modules/startSession.js +25 -6
- package/dist/modules/startSession.js.map +1 -1
- package/dist/tui/components/App.d.ts +0 -6
- package/dist/tui/components/App.js +602 -70
- package/dist/tui/components/App.js.map +1 -1
- package/dist/tui/components/ApprovalPrompt.d.ts +57 -33
- package/dist/tui/components/ApprovalPrompt.js +61 -140
- package/dist/tui/components/ApprovalPrompt.js.map +1 -1
- package/dist/tui/components/ApprovalRequestPanel.d.ts +40 -0
- package/dist/tui/components/ApprovalRequestPanel.js +63 -0
- package/dist/tui/components/ApprovalRequestPanel.js.map +1 -0
- package/dist/tui/components/DebugPanel.d.ts +11 -0
- package/dist/tui/components/DebugPanel.js +17 -1
- package/dist/tui/components/DebugPanel.js.map +1 -1
- package/dist/tui/components/LiveTurn.d.ts +20 -1
- package/dist/tui/components/LiveTurn.js +73 -23
- package/dist/tui/components/LiveTurn.js.map +1 -1
- package/dist/tui/components/NegotiationPanel.d.ts +39 -0
- package/dist/tui/components/NegotiationPanel.js +63 -0
- package/dist/tui/components/NegotiationPanel.js.map +1 -0
- package/dist/tui/components/NoticeBar.js +10 -2
- package/dist/tui/components/NoticeBar.js.map +1 -1
- package/dist/tui/components/PromptEditor.d.ts +12 -0
- package/dist/tui/components/PromptEditor.js +20 -0
- package/dist/tui/components/PromptEditor.js.map +1 -1
- package/dist/tui/components/PromptInput.d.ts +14 -1
- package/dist/tui/components/PromptInput.js +44 -3
- package/dist/tui/components/PromptInput.js.map +1 -1
- package/dist/tui/components/SelectList.d.ts +2 -8
- package/dist/tui/components/SelectList.js +4 -18
- package/dist/tui/components/SelectList.js.map +1 -1
- package/dist/tui/components/SlashCommandMenu.d.ts +25 -2
- package/dist/tui/components/SlashCommandMenu.js +45 -8
- package/dist/tui/components/SlashCommandMenu.js.map +1 -1
- package/dist/tui/components/StatusBar.d.ts +134 -17
- package/dist/tui/components/StatusBar.js +194 -19
- package/dist/tui/components/StatusBar.js.map +1 -1
- package/dist/tui/components/TranscriptViewport.js +28 -5
- package/dist/tui/components/TranscriptViewport.js.map +1 -1
- package/dist/tui/debugRender.d.ts +1 -1
- package/dist/tui/debugRender.js +1 -1
- package/dist/tui/fixtureAgent.d.ts +5 -0
- package/dist/tui/fixtureAgent.js +74 -1
- package/dist/tui/fixtureAgent.js.map +1 -1
- package/dist/tui/listWindow.d.ts +41 -0
- package/dist/tui/listWindow.js +61 -0
- package/dist/tui/listWindow.js.map +1 -0
- package/dist/tui/textRows.d.ts +6 -0
- package/dist/tui/textRows.js +135 -0
- package/dist/tui/textRows.js.map +1 -0
- package/dist/tui/transcriptWindow.d.ts +13 -0
- package/dist/tui/transcriptWindow.js +94 -12
- package/dist/tui/transcriptWindow.js.map +1 -1
- package/dist/tui/tuiSessionModule.d.ts +45 -19
- package/dist/tui/tuiSessionModule.js +363 -35
- package/dist/tui/tuiSessionModule.js.map +1 -1
- package/dist/tui/types.d.ts +137 -7
- package/dist/tui/viewModel.d.ts +127 -3
- package/dist/tui/viewModel.js +100 -10
- package/dist/tui/viewModel.js.map +1 -1
- package/package.json +18 -18
package/LICENSE
CHANGED
|
@@ -1,7 +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
|
-
|
|
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
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/dist/cli.js
CHANGED
|
@@ -13,11 +13,13 @@ import { apiCommand } from '#src/commands/apiCommand.js';
|
|
|
13
13
|
import { getCommand } from '#src/commands/getCommand.js';
|
|
14
14
|
import { configCommand } from '#src/commands/configCommand.js';
|
|
15
15
|
import { historyCommand } from '#src/commands/historyCommand.js';
|
|
16
|
+
import { RESUMABLE_COMMANDS, resumeOption, rootResumeRefusalMessage, } from '#src/commands/resumeOption.js';
|
|
16
17
|
import { insightsCommand } from '#src/commands/insightsCommand.js';
|
|
17
18
|
import { modelsCommand } from '#src/commands/modelsCommand.js';
|
|
18
19
|
import { argv, exit, getSlothVersion, readStdin } from '@gaunt-sloth/core/utils/systemUtils.js';
|
|
19
20
|
import { commandSkipsStdin, resolveInvokedCommandName } from '#src/utils/stdinPolicy.js';
|
|
20
21
|
import { guardProgramConfigErrors } from '#src/utils/configErrorGuard.js';
|
|
22
|
+
import { CONFLICTING_CONFIG_SOURCES_MESSAGE } from '@gaunt-sloth/core/config.js';
|
|
21
23
|
import { coerceBooleanOrString, displayError } from '@gaunt-sloth/core/utils/consoleUtils.js';
|
|
22
24
|
import { installCrashHandler } from '@gaunt-sloth/core/utils/crashHandler.js';
|
|
23
25
|
// GS2-48 — install the process-level crash handler as early as possible, so an uncaughtException /
|
|
@@ -41,6 +43,9 @@ program
|
|
|
41
43
|
.option('--tui', 'Force the interactive Ink TUI for chat/code sessions ' +
|
|
42
44
|
'(overrides GTH_NO_TUI, the tui config key and CI auto-off)')
|
|
43
45
|
.option('--no-tui', 'Force the plain readline session for chat/code (disable the TUI)')
|
|
46
|
+
// GS2-20 — on the root so the bare `gth` (a code session) can resume too; `chat` and `code`
|
|
47
|
+
// carry the same option themselves.
|
|
48
|
+
.addOption(resumeOption())
|
|
44
49
|
.addOption(new Option('--nopipe').hideHelp(true))
|
|
45
50
|
.addOption(new Option('--no-pipe').hideHelp(true));
|
|
46
51
|
const cliConfigOverrides = {};
|
|
@@ -60,11 +65,12 @@ if (program.getOptionValue('config')) {
|
|
|
60
65
|
}
|
|
61
66
|
// CFG-56 — `-g/--global` and `-c/--config` both choose WHERE configuration comes from, and
|
|
62
67
|
// honouring either one makes the other a silent no-op. Refuse the pair here, before anything is
|
|
63
|
-
// read, rather than quietly loading one source while the user watches for the other.
|
|
68
|
+
// read, rather than quietly loading one source while the user watches for the other. The loader
|
|
69
|
+
// refuses the same pair wherever config is built (CFG-57), so an embedder is covered too; both
|
|
70
|
+
// speak the one shared sentence.
|
|
64
71
|
if (program.getOptionValue('global')) {
|
|
65
72
|
if (cliConfigOverrides.customConfigPath) {
|
|
66
|
-
displayError(
|
|
67
|
-
'(the global config in ~/.gsloth versus the named file). Pass only one.');
|
|
73
|
+
displayError(CONFLICTING_CONFIG_SOURCES_MESSAGE);
|
|
68
74
|
exit(1);
|
|
69
75
|
}
|
|
70
76
|
cliConfigOverrides.global = true;
|
|
@@ -97,7 +103,7 @@ if (coerced !== undefined) {
|
|
|
97
103
|
cliConfigOverrides.writeOutputToFile = coerced;
|
|
98
104
|
}
|
|
99
105
|
// Initialize all commands - they will handle their own config loading
|
|
100
|
-
initCommand(program);
|
|
106
|
+
initCommand(program, cliConfigOverrides);
|
|
101
107
|
reviewCommand(program, cliConfigOverrides);
|
|
102
108
|
prCommand(program, cliConfigOverrides);
|
|
103
109
|
askCommand(program, cliConfigOverrides);
|
|
@@ -112,7 +118,9 @@ getCommand(program, cliConfigOverrides);
|
|
|
112
118
|
configCommand(program, cliConfigOverrides);
|
|
113
119
|
// GS2-7 (B20) — read-only, local history/insights surfaces. They resolve their own DB path (global
|
|
114
120
|
// default or --db) and do not build the LLM, so they stay decoupled from config/provider setup.
|
|
115
|
-
|
|
121
|
+
// GS2-20 — `history resume <id>` is the exception: it starts a session, so it takes the overrides
|
|
122
|
+
// the session commands take.
|
|
123
|
+
historyCommand(program, cliConfigOverrides);
|
|
116
124
|
insightsCommand(program);
|
|
117
125
|
// GS2-6 (B16) — model catalog: lists providers/models enriched with models.dev cost/limit metadata.
|
|
118
126
|
// Read-only; enrichment never gates what `/v1/models` reports as callable.
|
|
@@ -128,6 +136,17 @@ const invokedCommand = resolveInvokedCommandName(program.commands.map((command)
|
|
|
128
136
|
if (commandSkipsStdin(invokedCommand)) {
|
|
129
137
|
program.setOptionValue('nopipe', true);
|
|
130
138
|
}
|
|
139
|
+
// GS2-20 — the root `--resume` belongs to the bare command (a code session) and rides along for
|
|
140
|
+
// `chat`/`code`; in front of any other subcommand it would be accepted and silently dropped, and a
|
|
141
|
+
// fresh `ask`/`exec` would run as though nothing had been asked. Refused here, once, before the
|
|
142
|
+
// subcommand's action can run: a typed intent is never answered with a different command.
|
|
143
|
+
const rootResume = program.getOptionValue('resume');
|
|
144
|
+
if (rootResume !== undefined &&
|
|
145
|
+
invokedCommand !== undefined &&
|
|
146
|
+
!RESUMABLE_COMMANDS.has(invokedCommand)) {
|
|
147
|
+
displayError(rootResumeRefusalMessage(invokedCommand, rootResume));
|
|
148
|
+
exit(1);
|
|
149
|
+
}
|
|
131
150
|
// CFG-35 — the config loader raises a catchable error when a provider has no resolvable API key,
|
|
132
151
|
// so programmatic callers can classify it. For a person at a terminal there is nothing to classify,
|
|
133
152
|
// so the `gth` CLI makes the terminating choice here, once, instead of in every command action.
|
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,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,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,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CA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AAO,CAAC,CAAC;AAEvB,8FAA8F;AAC9F,kGAAkG;AAClG,mGAAmG;AACnG,6FAA6F;AAC7F,+FAA+F;AAC/F,kGAAkG;AAClG,cAAc;AACd,MAAM,cAAc,GAAG,yBAAyB,CAC9C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,EACjD,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ,CACpC,CAAC;AACF,IAAI,iBAAiB,CAAC,cAAc,CAAC,EAAE,CAAC;IACtC,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,gGAAgG;AAChG,mGAAmG;AACnG,gGAAgG;AAChG,0FAA0F;AAC1F,MAAM,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAuB,CAAC;AAC1E,IACE,UAAU,KAAK,SAAS;IACxB,cAAc,KAAK,SAAS;IAC5B,CAAC,kBAAkB,CAAC,GAAG,CAAC,cAAc,CAAC,EACvC,CAAC;IACD,YAAY,CAAC,wBAAwB,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC;IACnE,IAAI,CAAC,CAAC,CAAC,CAAC;AACV,CAAC;AAED,iGAAiG;AACjG,oGAAoG;AACpG,gGAAgG;AAChG,MAAM,SAAS,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
import { initConfig } from '@gaunt-sloth/core/config.js';
|
|
2
2
|
import { displayError } from '@gaunt-sloth/core/utils/consoleUtils.js';
|
|
3
3
|
import { setExitCode } from '@gaunt-sloth/core/utils/systemUtils.js';
|
|
4
|
+
import { parseIntOption } from '#src/commands/cliOptionParsers.js';
|
|
4
5
|
export function apiCommand(program, commandLineConfigOverrides) {
|
|
5
6
|
const api = program.command('api').description('Start an API server for Gaunt Sloth');
|
|
6
7
|
api
|
|
7
8
|
.command('ag-ui')
|
|
8
9
|
.description('Start an AG-UI protocol HTTP server')
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
// CFG-62: the strict parser, as on `batch -j`, so `--port abc` is refused at parse time instead
|
|
11
|
+
// of `parseInt` handing the server `NaN`, and `--port 10abc` is refused instead of becoming 10.
|
|
12
|
+
.option('--port <port>', 'Port to listen on', parseIntOption)
|
|
13
|
+
// CFG-67: the server binds loopback unless this says otherwise, so exposing an unauthenticated
|
|
14
|
+
// agent endpoint to the network is something someone typed rather than something they inherited.
|
|
15
|
+
.option('--host <host>', 'Interface to bind. Default 127.0.0.1 (this machine only); 0.0.0.0 — or :: for IPv6 as well — accepts connections from the network')
|
|
16
|
+
// OPS-16: the browser origin is the other half of the port. A launcher that moves the web
|
|
17
|
+
// client knows its new origin and cannot rewrite the config file pinning the old one, so
|
|
18
|
+
// without this flag the client relocates and every request it makes is refused by a preflight
|
|
19
|
+
// naming an origin it no longer has.
|
|
20
|
+
.option('--cors-origin <origin>', 'Browser origin allowed to call this server, over commands.api.cors.allowOrigin. One origin, not a list')
|
|
21
|
+
.addHelpText('after', '\n' +
|
|
22
|
+
'Examples:\n' +
|
|
23
|
+
' $ gth api ag-ui\n' +
|
|
24
|
+
' $ gth api ag-ui --port 4000\n' +
|
|
25
|
+
' $ gth api ag-ui --host 0.0.0.0 --port 4000\n' +
|
|
26
|
+
' $ gth api ag-ui --port 4000 --cors-origin http://localhost:5556\n')
|
|
11
27
|
.action(async (options) => {
|
|
12
28
|
try {
|
|
13
29
|
const config = await initConfig(commandLineConfigOverrides);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
30
|
+
// `??`, not a truthiness check: the option is a number now, and `--port 0` (let the OS pick)
|
|
31
|
+
// must stay port 0 rather than falling through to the configured port.
|
|
32
|
+
const port = options.port ?? config.commands?.api?.port ?? 3000;
|
|
17
33
|
const { startAgUiServer } = await import('@gaunt-sloth/agent/modules/apiAgUiModule.js');
|
|
18
|
-
|
|
34
|
+
// The host's precedence — flag, then `commands.api.host`, then loopback — is resolved by
|
|
35
|
+
// the server rather than here, so a programmatic caller gets the same safe default and
|
|
36
|
+
// the two doors onto this server cannot drift. The CORS origin travels the same way.
|
|
37
|
+
await startAgUiServer(config, port, options.host, options.corsOrigin);
|
|
19
38
|
}
|
|
20
39
|
catch (error) {
|
|
21
40
|
displayError(error instanceof Error ? error.message : String(error));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apiCommand.js","sourceRoot":"","sources":["../../src/commands/apiCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"apiCommand.js","sourceRoot":"","sources":["../../src/commands/apiCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAEnE,MAAM,UAAU,UAAU,CACxB,OAAgB,EAChB,0BAAsD;IAEtD,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,qCAAqC,CAAC,CAAC;IAEtF,GAAG;SACA,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,qCAAqC,CAAC;QACnD,gGAAgG;QAChG,gGAAgG;SAC/F,MAAM,CAAC,eAAe,EAAE,mBAAmB,EAAE,cAAc,CAAC;QAC7D,+FAA+F;QAC/F,iGAAiG;SAChG,MAAM,CACL,eAAe,EACf,mIAAmI,CACpI;QACD,0FAA0F;QAC1F,yFAAyF;QACzF,8FAA8F;QAC9F,qCAAqC;SACpC,MAAM,CACL,wBAAwB,EACxB,wGAAwG,CACzG;SACA,WAAW,CACV,OAAO,EACP,IAAI;QACF,aAAa;QACb,qBAAqB;QACrB,iCAAiC;QACjC,gDAAgD;QAChD,qEAAqE,CACxE;SACA,MAAM,CAAC,KAAK,EAAE,OAA8D,EAAE,EAAE;QAC/E,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,0BAA0B,CAAC,CAAC;YAC5D,6FAA6F;YAC7F,uEAAuE;YACvE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,IAAI,IAAI,CAAC;YAEhE,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,6CAA6C,CAAC,CAAC;YACxF,yFAAyF;YACzF,uFAAuF;YACvF,qFAAqF;YACrF,MAAM,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QACxE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,YAAY,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACrE,WAAW,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -77,7 +77,7 @@ export function askCommand(program, commandLineConfigOverrides) {
|
|
|
77
77
|
let ok = false;
|
|
78
78
|
try {
|
|
79
79
|
({ ok } = await runSingleShot('ASK', getAskSystemPrompt(config), content.join('\n'), config, createResolvers(), 'ask',
|
|
80
|
-
// ask
|
|
80
|
+
// ask asks for the lean backend, the only one shipped; config.agent.backend names no other.
|
|
81
81
|
resolveAgentFactory(config, 'lean')));
|
|
82
82
|
}
|
|
83
83
|
catch (error) {
|
|
@@ -1 +1 @@
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AAC,CAAC;QAClF,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,iCAAiC,CAAC,CAAC;QAC5E,MAAM,EAAE,mBAAmB,EAAE,GAC3B,MAAM,MAAM,CAAC,gDAAgD,CAAC,CAAC;QACjE,IAAI,EAAE,GAAG,KAAK,CAAC;QACf,IAAI,CAAC;YACH,CAAC,EAAE,EAAE,EAAE,GAAG,MAAM,aAAa,CAC3B,KAAK,EACL,kBAAkB,CAAC,MAAM,CAAC,EAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAClB,MAAM,EACN,eAAe,EAAE,EACjB,KAAK;YACL,4FAA4F;YAC5F,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CACpC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,YAAY,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACrE,EAAE,GAAG,KAAK,CAAC;QACb,CAAC;QAED,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,WAAW,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -79,8 +79,8 @@ export async function buildProductionRunCell(baseConfig, preamble, commandLineCo
|
|
|
79
79
|
const resolvers = createResolvers();
|
|
80
80
|
try {
|
|
81
81
|
const { ok, answer, tokensInput, tokensOutput, tools, toolResults } = await runSingleShot(`${options.sourcePrefix}-${cell.id}`, preamble, content, cellConfig, resolvers, options.command,
|
|
82
|
-
// batch/eval
|
|
83
|
-
// config.agent.backend
|
|
82
|
+
// batch/eval ask for the lean backend, same as exec/ask — the only one shipped;
|
|
83
|
+
// config.agent.backend names no other.
|
|
84
84
|
resolveAgentFactory(cellConfig, 'lean'), { displayCommand: options.displayCommand });
|
|
85
85
|
return { ok, answer, tokensInput, tokensOutput, tools, toolResults };
|
|
86
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batchCommand.js","sourceRoot":"","sources":["../../src/commands/batchCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EACL,WAAW,EACX,cAAc,EACd,cAAc,GACf,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,+BAA+B,GAChC,MAAM,sCAAsC,CAAC;AAgB9C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAS,wBAAwB,CAC/B,UAAqB,EACrB,0BAAsD;IAEtD,MAAM,cAAc,GAAG,IAAI,GAAG,EAA8B,CAAC;IAE7D,OAAO,CAAC,KAAyB,EAAsB,EAAE;QACvD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QACrC,CAAC;QACD,IAAI,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,GAAG,UAAU,CAAC,EAAE,GAAG,0BAA0B,EAAE,KAAK,EAAE,CAAC,CAAC;YAC9D,cAAc,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAyBD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,UAAqB,EACrB,QAAgB,EAChB,0BAAsD,EACtD,OAAiC;IAEjC,MAAM,EAAE,aAA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,CAAC;QACjE,IAAI,IAAI,EAAE,CAAC;YACT,WAAW,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,kFAAkF;YAClF,wEAAwE;YACxE,cAAc,CACZ,GAAG,OAAO,CAAC,MAAM,yBAAyB,SAAS,4BAA4B,CAChF,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,30 +1,21 @@
|
|
|
1
1
|
import { startSession } from '#src/modules/startSession.js';
|
|
2
|
-
import {
|
|
2
|
+
import { CHAT_SESSION_CONFIG } from '#src/modules/sessionConfigs.js';
|
|
3
|
+
import { resumeOption, sessionOptionsFor } from '#src/commands/resumeOption.js';
|
|
3
4
|
export function chatCommand(program, commandLineConfigOverrides) {
|
|
4
|
-
const sessionConfig = {
|
|
5
|
-
mode: 'chat',
|
|
6
|
-
readModePrompt: readChatPrompt,
|
|
7
|
-
description: 'Start an interactive chat session with Gaunt Sloth',
|
|
8
|
-
readyMessage: '\nGaunt Sloth is ready to chat. Type your prompt.',
|
|
9
|
-
// [[TUI-C79]] — this row is shared by BOTH surfaces (the Ink dock composes it with
|
|
10
|
-
// TUI_HINT_SUFFIX; the readline session prints it as-is), so every clause has to be true on
|
|
11
|
-
// both. `exit` is: it needs no condition on either surface, in any state. `Ctrl+C` no longer
|
|
12
|
-
// is — on the TUI it scraps a draft first and stops a turn second, and it only leaves from the
|
|
13
|
-
// bottom of that ladder — and no accurate short wording exists for a fixed row, so the clause
|
|
14
|
-
// is dropped rather than qualified. `/help` is the reference, and lists Ctrl+C per context.
|
|
15
|
-
exitMessage: "Type 'exit' to leave chat · /help for commands\n",
|
|
16
|
-
};
|
|
17
5
|
// Chat command (REL-3: the no-subcommand default is now `code`, registered in codeCommand)
|
|
18
6
|
program
|
|
19
7
|
.command('chat')
|
|
20
8
|
.description('Start an interactive chat session with Gaunt Sloth')
|
|
21
9
|
.argument('[message]', 'Initial message to start the chat')
|
|
10
|
+
// GS2-20 — re-enter a recorded conversation in chat mode.
|
|
11
|
+
.addOption(resumeOption())
|
|
22
12
|
.addHelpText('after', '\n' +
|
|
23
13
|
'Examples:\n' +
|
|
24
14
|
' $ gth chat\n' +
|
|
25
|
-
' $ gth chat "Let\'s discuss the architecture of this project"\n'
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
' $ gth chat "Let\'s discuss the architecture of this project"\n' +
|
|
16
|
+
' $ gth chat --resume 42\n')
|
|
17
|
+
.action(async (message, options) => {
|
|
18
|
+
await startSession(CHAT_SESSION_CONFIG, commandLineConfigOverrides, message, sessionOptionsFor(program, options));
|
|
28
19
|
});
|
|
29
20
|
}
|
|
30
21
|
//# sourceMappingURL=chatCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatCommand.js","sourceRoot":"","sources":["../../src/commands/chatCommand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chatCommand.js","sourceRoot":"","sources":["../../src/commands/chatCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGhF,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,0BAAsD;IAEtD,2FAA2F;IAC3F,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,oDAAoD,CAAC;SACjE,QAAQ,CAAC,WAAW,EAAE,mCAAmC,CAAC;QAC3D,0DAA0D;SACzD,SAAS,CAAC,YAAY,EAAE,CAAC;SACzB,WAAW,CACV,OAAO,EACP,IAAI;QACF,aAAa;QACb,gBAAgB;QAChB,kEAAkE;QAClE,4BAA4B,CAC/B;SACA,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,OAA4B,EAAE,EAAE;QAC9D,MAAM,YAAY,CAChB,mBAAmB,EACnB,0BAA0B,EAC1B,OAAO,EACP,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,CACpC,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import { startSession } from '#src/modules/startSession.js';
|
|
2
|
-
import {
|
|
2
|
+
import { CODE_SESSION_CONFIG } from '#src/modules/sessionConfigs.js';
|
|
3
|
+
import { resumeOption, sessionOptionsFor } from '#src/commands/resumeOption.js';
|
|
3
4
|
export function codeCommand(program, commandLineConfigOverrides) {
|
|
4
|
-
const sessionConfig = {
|
|
5
|
-
mode: 'code',
|
|
6
|
-
readModePrompt: readCodePrompt,
|
|
7
|
-
description: 'Interactively write code with sloth (has full file system access within your project)',
|
|
8
|
-
readyMessage: '\nGaunt Sloth is ready to code. Type your prompt.',
|
|
9
|
-
// [[TUI-C79]] — the same shared-row rule as `chatCommand`: `exit` is the one route that is true
|
|
10
|
-
// on both surfaces in every state, `Ctrl+C` is a three-meaning key on the TUI and cannot be
|
|
11
|
-
// stated accurately in a fixed row, and `/help` is where the per-context version lives.
|
|
12
|
-
exitMessage: "Type 'exit' to leave the code session · /help for commands\n",
|
|
13
|
-
};
|
|
14
5
|
// REL-3: bare `gth` (no subcommand) now defaults to the agentic code session.
|
|
6
|
+
// GS2-20 — `gth --resume <id>` is the root option (see cli.ts), read here because the bare form
|
|
7
|
+
// has no subcommand of its own to carry it.
|
|
15
8
|
program.action(async () => {
|
|
16
|
-
await startSession(
|
|
9
|
+
await startSession(CODE_SESSION_CONFIG, commandLineConfigOverrides, undefined, sessionOptionsFor(program, {}));
|
|
17
10
|
});
|
|
18
11
|
program
|
|
19
12
|
.command('code')
|
|
20
13
|
.description('Interactively write code with sloth (has full file system access within your project)')
|
|
21
14
|
.argument('[message]', 'Initial message to start the code session')
|
|
15
|
+
// GS2-20 — re-enter a recorded conversation in code mode.
|
|
16
|
+
.addOption(resumeOption())
|
|
22
17
|
.addHelpText('after', '\n' +
|
|
23
18
|
'Examples:\n' +
|
|
24
19
|
' $ gth code\n' +
|
|
25
|
-
' $ gth code "Help me refactor the authentication module"\n'
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
' $ gth code "Help me refactor the authentication module"\n' +
|
|
21
|
+
' $ gth code --resume 42\n')
|
|
22
|
+
.action(async (message, options) => {
|
|
23
|
+
await startSession(CODE_SESSION_CONFIG, commandLineConfigOverrides, message, sessionOptionsFor(program, options));
|
|
28
24
|
});
|
|
29
25
|
}
|
|
30
26
|
//# sourceMappingURL=codeCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeCommand.js","sourceRoot":"","sources":["../../src/commands/codeCommand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"codeCommand.js","sourceRoot":"","sources":["../../src/commands/codeCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGhF,MAAM,UAAU,WAAW,CACzB,OAAgB,EAChB,0BAAsD;IAEtD,8EAA8E;IAC9E,gGAAgG;IAChG,4CAA4C;IAC5C,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE;QACxB,MAAM,YAAY,CAChB,mBAAmB,EACnB,0BAA0B,EAC1B,SAAS,EACT,iBAAiB,CAAC,OAAO,EAAE,EAAE,CAAC,CAC/B,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CACV,uFAAuF,CACxF;SACA,QAAQ,CAAC,WAAW,EAAE,2CAA2C,CAAC;QACnE,0DAA0D;SACzD,SAAS,CAAC,YAAY,EAAE,CAAC;SACzB,WAAW,CACV,OAAO,EACP,IAAI;QACF,aAAa;QACb,gBAAgB;QAChB,6DAA6D;QAC7D,4BAA4B,CAC/B;SACA,MAAM,CAAC,KAAK,EAAE,OAAe,EAAE,OAA4B,EAAE,EAAE;QAC9D,MAAM,YAAY,CAChB,mBAAmB,EACnB,0BAA0B,EAC1B,OAAO,EACP,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,CACpC,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -8,7 +8,7 @@ export declare function getExecSystemPrompt(config: GthConfig): string;
|
|
|
8
8
|
/**
|
|
9
9
|
* The system prompt a `review` / `pr` run sends.
|
|
10
10
|
*
|
|
11
|
-
* Composed from the same segments, in the same order, that the agent
|
|
11
|
+
* Composed from the same segments, in the same order, that the agent composes for these
|
|
12
12
|
* commands — backstory + guidelines + the review instructions (the `review`/`pr` mode prompt) +
|
|
13
13
|
* system prompt. `commandIntrospectionReviewPrompt.spec.ts` pins the two against each other, so a
|
|
14
14
|
* change to what a review run is given cannot leave `gth get system-prompt review` reporting the
|
|
@@ -15,7 +15,7 @@ export function getExecSystemPrompt(config) {
|
|
|
15
15
|
/**
|
|
16
16
|
* The system prompt a `review` / `pr` run sends.
|
|
17
17
|
*
|
|
18
|
-
* Composed from the same segments, in the same order, that the agent
|
|
18
|
+
* Composed from the same segments, in the same order, that the agent composes for these
|
|
19
19
|
* commands — backstory + guidelines + the review instructions (the `review`/`pr` mode prompt) +
|
|
20
20
|
* system prompt. `commandIntrospectionReviewPrompt.spec.ts` pins the two against each other, so a
|
|
21
21
|
* change to what a review run is given cannot leave `gth get system-prompt review` reporting the
|
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Where {@link createProjectConfig} writes the scaffolded config. Mirrors {@link ConfigScope}
|
|
3
|
+
* (firstRunDialog.ts) but as a destination the scriptable `gth init <provider>` path is told
|
|
4
|
+
* rather than a choice it asks for: `global: true` selects `~/.gsloth/` (or its named profile
|
|
5
|
+
* dir); `global: false`/omitted keeps the existing project default.
|
|
6
|
+
*/
|
|
7
|
+
export interface CreateProjectConfigDest {
|
|
8
|
+
/** Write into the global `~/.gsloth` tree instead of the project's `.gsloth/`. */
|
|
9
|
+
global?: boolean;
|
|
10
|
+
/** Named profile subdirectory within `.gsloth-settings/` (project or global, per `global`). */
|
|
11
|
+
identityProfile?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function createProjectConfig(configType: string, force?: boolean, dest?: CreateProjectConfigDest): Promise<void>;
|
|
2
14
|
/**
|
|
3
15
|
* Ensures that the .gsloth directory exists in the project root.
|
|
4
16
|
* Creates it if it does not exist.
|
|
@@ -1,29 +1,50 @@
|
|
|
1
1
|
import { GSLOTH_DIR, USER_PROJECT_CONFIG_JSON } from '@gaunt-sloth/core/constants.js';
|
|
2
|
-
import { availableDefaultConfigs } from '@gaunt-sloth/core/config.js';
|
|
2
|
+
import { availableDefaultConfigs, validateProfileName, } from '@gaunt-sloth/core/config.js';
|
|
3
3
|
import { resolveInitModel } from '@gaunt-sloth/core/providers/modelDiscovery.js';
|
|
4
4
|
import { displayError, displayInfo, displayWarning } from '@gaunt-sloth/core/utils/consoleUtils.js';
|
|
5
5
|
import { getGslothConfigWritePath } from '@gaunt-sloth/review/utils/fileUtils.js';
|
|
6
|
+
import { getGlobalGslothConfigWritePath } from '@gaunt-sloth/core/utils/globalConfigUtils.js';
|
|
6
7
|
import { exit, getCurrentWorkDir } from '@gaunt-sloth/core/utils/systemUtils.js';
|
|
7
8
|
import { existsSync, mkdirSync } from 'node:fs';
|
|
8
9
|
import { resolve } from 'node:path';
|
|
9
|
-
export async function createProjectConfig(configType, force = false) {
|
|
10
|
+
export async function createProjectConfig(configType, force = false, dest = {}) {
|
|
10
11
|
if (!availableDefaultConfigs.includes(configType)) {
|
|
11
12
|
displayError(`Unknown config type: ${configType}. Available options: ${availableDefaultConfigs.join(', ')}`);
|
|
12
13
|
exit(1);
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
// GS2-33 — a bad profile name must never reach a mkdir or a write.
|
|
16
|
+
let identityProfile = dest.identityProfile;
|
|
17
|
+
if (identityProfile !== undefined) {
|
|
18
|
+
try {
|
|
19
|
+
identityProfile = validateProfileName(identityProfile);
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
displayError(err instanceof Error ? err.message : String(err));
|
|
23
|
+
exit(1);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const global = !!dest.global;
|
|
28
|
+
if (global) {
|
|
29
|
+
displayInfo(`Setting up your global configuration\n`);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
ensureGslothDir();
|
|
33
|
+
displayInfo(`Setting up your project\n`);
|
|
34
|
+
}
|
|
16
35
|
// GS2-43: `gth init` scaffolds the config file ONLY. The planted `.gsloth.guidelines.md` /
|
|
17
36
|
// `.gsloth.review.md` templates are gone — the bundled defaults (empty guidelines, a complete
|
|
18
37
|
// review prompt) apply until the user creates their own files or points `prompts.*` elsewhere.
|
|
19
38
|
// Without --force, keep an existing config (and say so honestly) rather than running
|
|
20
39
|
// the provider init, whose no-clobber write would silently skip and leave a misleading trail.
|
|
21
|
-
const configPath =
|
|
40
|
+
const configPath = global
|
|
41
|
+
? getGlobalGslothConfigWritePath(USER_PROJECT_CONFIG_JSON, identityProfile)
|
|
42
|
+
: getGslothConfigWritePath(USER_PROJECT_CONFIG_JSON, identityProfile);
|
|
22
43
|
if (!force && existsSync(configPath)) {
|
|
23
44
|
displayWarning(`${configPath} already exists and was kept (not overwritten). Re-run with --force to overwrite it.`);
|
|
24
45
|
return;
|
|
25
46
|
}
|
|
26
|
-
displayInfo(`Creating project config for ${configType}`);
|
|
47
|
+
displayInfo(`Creating ${global ? 'global ' : 'project '}config for ${configType}`);
|
|
27
48
|
// CFG-14: resolve the model to write from live `/v1/models` discovery when a key/daemon is
|
|
28
49
|
// present (a verified-present id, never a speculative literal). When live discovery is
|
|
29
50
|
// impossible this returns undefined and `init` omits `model`, deferring to the provider's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configSetup.js","sourceRoot":"","sources":["../../src/commands/configSetup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AACtF,OAAO,
|
|
1
|
+
{"version":3,"file":"configSetup.js","sourceRoot":"","sources":["../../src/commands/configSetup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AACtF,OAAO,EACL,uBAAuB,EACvB,mBAAmB,GAEpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,+CAA+C,CAAC;AAClG,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACpG,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,8BAA8B,EAAE,MAAM,8CAA8C,CAAC;AAC9F,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAepC,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,UAAkB,EAClB,KAAK,GAAG,KAAK,EACb,IAAI,GAA4B,EAAE;IAElC,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,UAAwB,CAAC,EAAE,CAAC;QAChE,YAAY,CACV,wBAAwB,UAAU,wBAAwB,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC/F,CAAC;QACF,IAAI,CAAC,CAAC,CAAC,CAAC;IACV,CAAC;IAED,mEAAmE;IACnE,IAAI,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;IAC3C,IAAI,eAAe,K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CAAC,CAAC;IAClF,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAC9C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe;IAC7B,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAC;IACvC,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IACtD,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QAC/B,SAAS,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9C,WAAW,CAAC,WAAW,UAAU,YAAY,CAAC,CAAC;IACjD,CAAC;AACH,CAAC"}
|
|
@@ -114,7 +114,7 @@ export function execCommand(program, commandLineConfigOverrides) {
|
|
|
114
114
|
let ok = false;
|
|
115
115
|
try {
|
|
116
116
|
({ ok } = await runSingleShot('EXEC', getExecSystemPrompt(execConfig), content.join('\n'), execConfig, createResolvers(), 'exec',
|
|
117
|
-
// exec
|
|
117
|
+
// exec asks for the lean backend, the only one shipped; config.agent.backend names no other.
|
|
118
118
|
resolveAgentFactory(execConfig, 'lean')));
|
|
119
119
|
}
|
|
120
120
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execCommand.js","sourceRoot":"","sources":["../../src/commands/execCommand.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAErF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACvF,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAmBvF;;;;;;;;;;;;;;;;;;;G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K,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACrE,EAAE,GAAG,KAAK,CAAC;QACb,CAAC;QAED,IAAI,CAAC,EAAE,EAAE,CAAC;YACR,WAAW,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { detectProviders, type DetectedProvider, type ModelDiscoveryResult, type ModelInfo, type ProviderId } from '@gaunt-sloth/core/providers/modelDiscovery.js';
|
|
2
|
+
import type { CatalogOptions } from '@gaunt-sloth/core/providers/modelCatalog.js';
|
|
2
3
|
import { ensureGslothDir } from '#src/commands/configSetup.js';
|
|
3
4
|
/**
|
|
4
5
|
* Where the first-run dialog (CFG-2) persists the chosen provider/model config.
|
|
@@ -70,9 +71,16 @@ export declare function defaultModelIndex(models: ModelInfo[]): number;
|
|
|
70
71
|
* First-run always has an explicit model chosen, so it is written into the config (unlike a bare
|
|
71
72
|
* `init <provider>` template, which omits the model to track the curated fallback, CFG-14).
|
|
72
73
|
*/
|
|
73
|
-
export declare function buildConfigContent(providerId: ProviderId, model: string
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
export declare function buildConfigContent(providerId: ProviderId, model: string, options?: {
|
|
75
|
+
catalogOptions?: CatalogOptions;
|
|
76
|
+
}): Promise<string>;
|
|
77
|
+
/**
|
|
78
|
+
* Resolves the config write path for the chosen scope (CFG-3 layering). When `identityProfile` is
|
|
79
|
+
* set, the path is the named profile's config within that scope's settings tree
|
|
80
|
+
* (`.gsloth/.gsloth-settings/<profile>/` or `~/.gsloth/.gsloth-settings/<profile>/`) rather than
|
|
81
|
+
* the unscoped project/global config file.
|
|
82
|
+
*/
|
|
83
|
+
export declare function resolveConfigWritePath(scope: ConfigScope, identityProfile?: string): string;
|
|
76
84
|
/**
|
|
77
85
|
* CFG-9 — an explicit, readable readiness label for a provider in the menu. The old bare
|
|
78
86
|
* `✓`/blank mark read like a selection checkbox; this spells the state out instead.
|
|
@@ -96,5 +104,5 @@ export declare function makeDefaultProgress(): <T>(label: string, run: () => Pro
|
|
|
96
104
|
* the project scope, ensures the `.gsloth` dir exists). Nothing else is planted —
|
|
97
105
|
* the bundled prompt defaults apply until the user adds files or `prompts.*` config.
|
|
98
106
|
*/
|
|
99
|
-
export declare function runFirstRunDialog(overrides?: Partial<FirstRunDialogDeps>, force?: boolean, forcedScope?: ConfigScope): Promise<void>;
|
|
107
|
+
export declare function runFirstRunDialog(overrides?: Partial<FirstRunDialogDeps>, force?: boolean, forcedScope?: ConfigScope, identityProfile?: string): Promise<void>;
|
|
100
108
|
export {};
|