@gaia-ai/conductor 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/cli/gaia.js +30 -2
- package/dist/src/config.d.ts +9 -1
- package/dist/src/config.js +13 -5
- package/package.json +2 -2
package/dist/src/cli/gaia.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
2
|
-
import { dirname } from 'node:path';
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
3
|
import { createInterface } from 'node:readline';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
4
5
|
import { CommandRunner, conductorId, createLogger, exec, setDefaultCommandRunner, } from '@gaia-ai/core';
|
|
5
6
|
import { selectAgent, selectExecutor, selectRemote, selectWorkspace, } from '@gaia-ai/core/plugins';
|
|
6
7
|
import { Command } from 'commander';
|
|
@@ -368,9 +369,36 @@ async function promptSecret() {
|
|
|
368
369
|
}
|
|
369
370
|
}
|
|
370
371
|
// --- program ----------------------------------------------------------------
|
|
372
|
+
// Report the CLI's own package version. Walks up from this module to the
|
|
373
|
+
// nearest @gaia-ai/conductor package.json so it resolves both from the
|
|
374
|
+
// compiled dist/src/cli/gaia.js (3 dirs up) and the src/cli/gaia.ts vitest
|
|
375
|
+
// runs (2 dirs up). Same release tag across packages ⇒ == @gaia-ai/gaia.
|
|
376
|
+
function resolveCliVersion() {
|
|
377
|
+
let dir = dirname(fileURLToPath(import.meta.url));
|
|
378
|
+
for (let i = 0; i < 6; i++) {
|
|
379
|
+
try {
|
|
380
|
+
const pkg = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8'));
|
|
381
|
+
if (pkg.name === '@gaia-ai/conductor')
|
|
382
|
+
return pkg.version ?? '0.0.0';
|
|
383
|
+
}
|
|
384
|
+
catch {
|
|
385
|
+
// no package.json here — keep walking up
|
|
386
|
+
}
|
|
387
|
+
dir = dirname(dir);
|
|
388
|
+
}
|
|
389
|
+
return '0.0.0';
|
|
390
|
+
}
|
|
371
391
|
function buildProgram(deps) {
|
|
372
392
|
const program = new Command();
|
|
373
393
|
program.name('gaia').description('GAIA conductor + client CLI');
|
|
394
|
+
const cliVersion = resolveCliVersion();
|
|
395
|
+
program.version(cliVersion); // -V, --version
|
|
396
|
+
program
|
|
397
|
+
.command('version')
|
|
398
|
+
.description('output the gaia CLI version')
|
|
399
|
+
.action(() => {
|
|
400
|
+
console.log(cliVersion);
|
|
401
|
+
});
|
|
374
402
|
const conductor = program
|
|
375
403
|
.command('conductor')
|
|
376
404
|
.description('node-agent lifecycle + local registry')
|
package/dist/src/config.d.ts
CHANGED
|
@@ -12,9 +12,17 @@ import { type ConductorFileConfig } from '@gaia-ai/core';
|
|
|
12
12
|
*
|
|
13
13
|
* The ticket + its comments are NOT embedded (GAIA-112): embedding unbounded
|
|
14
14
|
* ticket content into a single typed pane line overran the PTY canonical line
|
|
15
|
-
* cap (4096 B) and truncated the
|
|
15
|
+
* cap (MAX_CANON = 4096 B) and truncated the dispatch command. Instead the
|
|
16
16
|
* prompt is a bounded, constant-size pointer and the agent reads the ticket +
|
|
17
17
|
* all comments at run start via `gaia dropsh read … --include comments`.
|
|
18
|
+
*
|
|
19
|
+
* The prompt is a SINGLE LINE — no newlines, no control chars (GAIA-128). herdr
|
|
20
|
+
* types it into the pane as one line, so a newline would submit early and any
|
|
21
|
+
* control char would force bash-only `$'…'` quoting that fish can't parse.
|
|
22
|
+
* Being single-line + bounded, plain `'…'` shell-quoting suffices (fish-safe)
|
|
23
|
+
* and the typed line stays well under the 4096 B cap — so NO base64/`bash -c`
|
|
24
|
+
* wrapper and NO multiline handling are needed (that wrapper, GAIA-118, was the
|
|
25
|
+
* thing that re-inflated the line past the cap and truncated it mid-quote).
|
|
18
26
|
* Placeholders: `{identifier}`, `{state}`, `{runUuid}` ({state} falls back to
|
|
19
27
|
* `triage` for unclassified tickets).
|
|
20
28
|
*/
|
package/dist/src/config.js
CHANGED
|
@@ -16,9 +16,17 @@ import { conductorId, } from '@gaia-ai/core';
|
|
|
16
16
|
*
|
|
17
17
|
* The ticket + its comments are NOT embedded (GAIA-112): embedding unbounded
|
|
18
18
|
* ticket content into a single typed pane line overran the PTY canonical line
|
|
19
|
-
* cap (4096 B) and truncated the
|
|
19
|
+
* cap (MAX_CANON = 4096 B) and truncated the dispatch command. Instead the
|
|
20
20
|
* prompt is a bounded, constant-size pointer and the agent reads the ticket +
|
|
21
21
|
* all comments at run start via `gaia dropsh read … --include comments`.
|
|
22
|
+
*
|
|
23
|
+
* The prompt is a SINGLE LINE — no newlines, no control chars (GAIA-128). herdr
|
|
24
|
+
* types it into the pane as one line, so a newline would submit early and any
|
|
25
|
+
* control char would force bash-only `$'…'` quoting that fish can't parse.
|
|
26
|
+
* Being single-line + bounded, plain `'…'` shell-quoting suffices (fish-safe)
|
|
27
|
+
* and the typed line stays well under the 4096 B cap — so NO base64/`bash -c`
|
|
28
|
+
* wrapper and NO multiline handling are needed (that wrapper, GAIA-118, was the
|
|
29
|
+
* thing that re-inflated the line past the cap and truncated it mid-quote).
|
|
22
30
|
* Placeholders: `{identifier}`, `{state}`, `{runUuid}` ({state} falls back to
|
|
23
31
|
* `triage` for unclassified tickets).
|
|
24
32
|
*/
|
|
@@ -30,10 +38,10 @@ export const DEFAULT_AGENT_PROMPT = `You are a GAIA agent working ticket {identi
|
|
|
30
38
|
`transitioning onward. When the {state} work is done and you have no open ` +
|
|
31
39
|
`questions, STOP - do not pick up or work any further state or ticket. If ` +
|
|
32
40
|
`blocked or you need a human, stop and surface the blocker. After you have ` +
|
|
33
|
-
`written the ticket's next state, run /exit to end this session
|
|
34
|
-
`First, read the ticket + all comments in one call
|
|
35
|
-
`
|
|
36
|
-
`
|
|
41
|
+
`written the ticket's next state, run /exit to end this session. ` +
|
|
42
|
+
`First, read the ticket + all comments in one call: run ` +
|
|
43
|
+
`gaia dropsh read gaia_ticket/gaia_ticket/$GAIA_ID --include comments — the ` +
|
|
44
|
+
`latest \`summary\` comment is review feedback you MUST address; any ` +
|
|
37
45
|
`\`spec\`/\`diagnose\` comment is the agreed plan. Treat them as in-scope ` +
|
|
38
46
|
`acceptance criteria.`;
|
|
39
47
|
function requirePlugin(value, kind) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gaia-ai/conductor",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "GAIA conductor engine + CLI: registers, claims tickets via JSON:API, dispatches agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"directory": "conductor/packages/conductor"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@gaia-ai/core": "^0.4.
|
|
28
|
+
"@gaia-ai/core": "^0.4.3",
|
|
29
29
|
"@dropsh/plugin-oauth2": "^0.4.1",
|
|
30
30
|
"@dropsh/plugin-jsonapi-schema": "^0.5.1",
|
|
31
31
|
"commander": "^12.1.0",
|