gaunt-sloth 2.0.0-beta.6 → 2.0.0-beta.7
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.
|
@@ -10,7 +10,20 @@ export function apiCommand(program, commandLineConfigOverrides) {
|
|
|
10
10
|
// CFG-62: the strict parser, as on `batch -j`, so `--port abc` is refused at parse time instead
|
|
11
11
|
// of `parseInt` handing the server `NaN`, and `--port 10abc` is refused instead of becoming 10.
|
|
12
12
|
.option('--port <port>', 'Port to listen on', parseIntOption)
|
|
13
|
-
|
|
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')
|
|
14
27
|
.action(async (options) => {
|
|
15
28
|
try {
|
|
16
29
|
const config = await initConfig(commandLineConfigOverrides);
|
|
@@ -18,7 +31,10 @@ export function apiCommand(program, commandLineConfigOverrides) {
|
|
|
18
31
|
// must stay port 0 rather than falling through to the configured port.
|
|
19
32
|
const port = options.port ?? config.commands?.api?.port ?? 3000;
|
|
20
33
|
const { startAgUiServer } = await import('@gaunt-sloth/agent/modules/apiAgUiModule.js');
|
|
21
|
-
|
|
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);
|
|
22
38
|
}
|
|
23
39
|
catch (error) {
|
|
24
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;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;
|
|
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;AA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AK,CAAC,CAAC,CAAC;YACrE,WAAW,CAAC,CAAC,CAAC,CAAC;QACjB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gaunt-sloth",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Andrew Kondratev",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@langchain/xai": "^1.4.10",
|
|
45
45
|
"commander": "^15.0.0",
|
|
46
46
|
"zod": "^4.5.4",
|
|
47
|
-
"@gaunt-sloth/agent": "2.0.0-beta.
|
|
48
|
-
"@gaunt-sloth/batch": "2.0.0-beta.
|
|
49
|
-
"@gaunt-sloth/
|
|
50
|
-
"@gaunt-sloth/
|
|
51
|
-
"@gaunt-sloth/
|
|
47
|
+
"@gaunt-sloth/agent": "2.0.0-beta.7",
|
|
48
|
+
"@gaunt-sloth/batch": "2.0.0-beta.7",
|
|
49
|
+
"@gaunt-sloth/review": "2.0.0-beta.7",
|
|
50
|
+
"@gaunt-sloth/core": "2.0.0-beta.7",
|
|
51
|
+
"@gaunt-sloth/eval-reporter-junit": "0.1.0"
|
|
52
52
|
},
|
|
53
53
|
"optionalDependencies": {
|
|
54
54
|
"chalk": "^6.0.0",
|