@gaia-ai/conductor 0.6.0 → 0.6.1
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 +1 -1
- package/dist/src/cli/config-schema.d.ts +42 -7
- package/dist/src/cli/config-schema.js +64 -9
- package/dist/src/cli/init.js +16 -10
- package/dist/src/cli/migrate-addon-names.d.ts +72 -0
- package/dist/src/cli/migrate-addon-names.js +318 -0
- package/dist/src/cli/upgrade.d.ts +15 -0
- package/dist/src/cli/upgrade.js +87 -8
- package/dist/src/commands/conductor.d.ts +27 -3
- package/dist/src/commands/conductor.js +39 -52
- package/dist/src/config.d.ts +15 -1
- package/dist/src/config.js +280 -3
- package/dist/src/contract.d.ts +8 -0
- package/dist/src/contract.js +16 -0
- package/dist/src/core/conductor.d.ts +16 -1
- package/dist/src/core/conductor.js +23 -1
- package/dist/src/index.d.ts +5 -4
- package/dist/src/index.js +17 -3
- package/dist/src/plugins/agent.d.ts +61 -0
- package/dist/src/plugins/agent.js +11 -0
- package/dist/src/plugins/executor.d.ts +104 -0
- package/dist/src/plugins/executor.js +1 -0
- package/dist/src/plugins/plugins.d.ts +60 -0
- package/dist/src/plugins/plugins.js +42 -0
- package/dist/src/plugins/preset.d.ts +48 -0
- package/dist/src/plugins/preset.js +23 -0
- package/dist/src/plugins/remote.d.ts +203 -0
- package/dist/src/plugins/remote.js +1 -0
- package/dist/src/plugins/workspace.d.ts +35 -0
- package/dist/src/plugins/workspace.js +1 -0
- package/dist/src/preset.d.ts +2 -2
- package/dist/src/types.d.ts +65 -0
- package/dist/src/types.js +1 -0
- package/package.json +4 -3
- package/dist/src/cli/conductor-registry.d.ts +0 -7
- package/dist/src/cli/conductor-registry.js +0 -6
- package/dist/src/cli/deployment.d.ts +0 -34
- package/dist/src/cli/deployment.js +0 -63
|
@@ -5,6 +5,13 @@ export interface UpgradeReport {
|
|
|
5
5
|
/** true when nothing needed doing. */
|
|
6
6
|
alreadyCurrent: boolean;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* GAIA-218: what `gaia upgrade` does to the PROJECT connection override. The
|
|
10
|
+
* pure routine defaults to `'skip'` (non-interactive / `conductor init`): never
|
|
11
|
+
* create, never migrate, never delete. The host CLI resolves `'create'` /
|
|
12
|
+
* `'remove'` from an opt-in TTY prompt.
|
|
13
|
+
*/
|
|
14
|
+
export type ProjectConnectionChoice = 'skip' | 'create' | 'remove';
|
|
8
15
|
/** The outcome of routing a single connection-config file. */
|
|
9
16
|
interface ConnectionUpgradeResult {
|
|
10
17
|
action: string;
|
|
@@ -29,10 +36,18 @@ export declare function runConnectionUpgrade(path: string, opts?: {
|
|
|
29
36
|
current?: number;
|
|
30
37
|
chain?: ConnectionConfigMigration[];
|
|
31
38
|
}): ConnectionUpgradeResult;
|
|
39
|
+
/**
|
|
40
|
+
* The absolute path of the PROJECT connection override (`./.gaia/gaia.config.js`)
|
|
41
|
+
* when one exists for `cwd`, else `undefined`. Used by the host CLI to decide
|
|
42
|
+
* whether to ask "remove this override?" vs "create an override?" (GAIA-218).
|
|
43
|
+
*/
|
|
44
|
+
export declare function hasProjectConnection(cwd: string): string | undefined;
|
|
32
45
|
/** Run the migration. Pure w.r.t. injected `cwd`/`home`; `dryRun` suppresses writes. */
|
|
33
46
|
export declare function runUpgrade(opts?: {
|
|
34
47
|
cwd?: string;
|
|
35
48
|
home?: string;
|
|
36
49
|
dryRun?: boolean;
|
|
50
|
+
/** GAIA-218: what to do with the PROJECT connection override (default skip). */
|
|
51
|
+
projectConnection?: ProjectConnectionChoice;
|
|
37
52
|
}): UpgradeReport;
|
|
38
53
|
export {};
|
package/dist/src/cli/upgrade.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { chmodSync, copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, } from 'node:fs';
|
|
1
|
+
import { chmodSync, copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync, } from 'node:fs';
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
3
|
import { dirname, join, resolve } from 'node:path';
|
|
4
4
|
import { pathToFileURL } from 'node:url';
|
|
5
|
+
import { listConductorConfigFiles, stripLegacyConnectionFromConfigSource, } from '../config.js';
|
|
5
6
|
import { applyMigrations, CONNECTION_MIGRATIONS, GAIA_CONFIG_SCHEMA_VERSION, readConfigSchemaVersion, stampVersion, stripVersionHeader, } from './config-schema.js';
|
|
6
7
|
import { renderGaiaConfig } from './init.js';
|
|
8
|
+
import { runAddonRenameMigration } from './migrate-addon-names.js';
|
|
7
9
|
const GAIA_DIR = '.gaia';
|
|
8
10
|
const DEFAULT_ENGINE = 'conductor.config.js';
|
|
9
11
|
const VARIANT_SUFFIX = '.conductor.config.js';
|
|
@@ -98,22 +100,86 @@ export function runConnectionUpgrade(path, opts = {}) {
|
|
|
98
100
|
changed: true,
|
|
99
101
|
};
|
|
100
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* The absolute path of the PROJECT connection override (`./.gaia/gaia.config.js`)
|
|
105
|
+
* when one exists for `cwd`, else `undefined`. Used by the host CLI to decide
|
|
106
|
+
* whether to ask "remove this override?" vs "create an override?" (GAIA-218).
|
|
107
|
+
*/
|
|
108
|
+
export function hasProjectConnection(cwd) {
|
|
109
|
+
const gaiaDir = findGaiaDir(cwd);
|
|
110
|
+
if (gaiaDir === undefined)
|
|
111
|
+
return undefined;
|
|
112
|
+
const p = join(gaiaDir, CONNECTION);
|
|
113
|
+
return existsSync(p) ? p : undefined;
|
|
114
|
+
}
|
|
101
115
|
/** Run the migration. Pure w.r.t. injected `cwd`/`home`; `dryRun` suppresses writes. */
|
|
102
116
|
export function runUpgrade(opts = {}) {
|
|
103
117
|
const cwd = opts.cwd ?? process.cwd();
|
|
104
118
|
const home = opts.home ?? homedir();
|
|
105
119
|
const dry = opts.dryRun ?? false;
|
|
120
|
+
const choice = opts.projectConnection ?? 'skip';
|
|
106
121
|
const actions = [];
|
|
107
122
|
let changed = false;
|
|
108
|
-
// 1. Project connection config (schema-versioned seed/migrate).
|
|
109
123
|
const gaiaDir = findGaiaDir(cwd);
|
|
124
|
+
// 0. GAIA-218 (AC-7): strip legacy connection/auth (`site`/`plugins` + the
|
|
125
|
+
// orphaned connection preamble) from EVERY engine config in the `.gaia/`
|
|
126
|
+
// dir — the supported enumeration only, never an unrelated `*.config.js`.
|
|
127
|
+
if (gaiaDir !== undefined) {
|
|
128
|
+
for (const file of listConductorConfigFiles(gaiaDir)) {
|
|
129
|
+
const path = join(gaiaDir, file);
|
|
130
|
+
if (!existsSync(path))
|
|
131
|
+
continue;
|
|
132
|
+
const original = readFileSync(path, 'utf8');
|
|
133
|
+
const { text, removed } = stripLegacyConnectionFromConfigSource(original);
|
|
134
|
+
if (removed.length === 0)
|
|
135
|
+
continue;
|
|
136
|
+
if (dry) {
|
|
137
|
+
actions.push(`would strip ${removed.join('/')} from ${path}`);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
writeFileSync(`${path}.legacy.bak`, original, 'utf8');
|
|
141
|
+
writeFileSync(path, text, 'utf8');
|
|
142
|
+
actions.push(`stripped ${removed.join('/')} from ${path} (backup ${path}.legacy.bak)`);
|
|
143
|
+
}
|
|
144
|
+
changed = true;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// 1. Project connection config — decision-driven (GAIA-218, default skip).
|
|
110
148
|
if (gaiaDir !== undefined && hasEngineConfig(gaiaDir)) {
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
149
|
+
const projectConn = join(gaiaDir, CONNECTION);
|
|
150
|
+
if (choice === 'create') {
|
|
151
|
+
if (existsSync(projectConn)) {
|
|
152
|
+
actions.push(`project connection: unchanged (${projectConn} exists — kept, not migrated)`);
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
const res = runConnectionUpgrade(projectConn, {
|
|
156
|
+
dryRun: dry,
|
|
157
|
+
label: 'project connection config',
|
|
158
|
+
});
|
|
159
|
+
actions.push(res.action);
|
|
160
|
+
changed = changed || res.changed;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
else if (choice === 'remove') {
|
|
164
|
+
if (existsSync(projectConn)) {
|
|
165
|
+
const bak = `${projectConn}.removed.bak`;
|
|
166
|
+
if (dry) {
|
|
167
|
+
actions.push(`would remove ${projectConn} (project connection override)`);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
copyFileSync(projectConn, bak);
|
|
171
|
+
rmSync(projectConn);
|
|
172
|
+
actions.push(`removed ${projectConn} (project connection override; backup ${bak})`);
|
|
173
|
+
}
|
|
174
|
+
changed = true;
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
actions.push('project connection: unchanged (no project override to remove)');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
actions.push('project connection: unchanged');
|
|
182
|
+
}
|
|
117
183
|
}
|
|
118
184
|
// 2. Machine context move (secret-bearing — never schema-migrated).
|
|
119
185
|
const legacy = legacyMachinePath(home);
|
|
@@ -139,5 +205,18 @@ export function runUpgrade(opts = {}) {
|
|
|
139
205
|
});
|
|
140
206
|
actions.push(homeRes.action);
|
|
141
207
|
changed = changed || homeRes.changed;
|
|
208
|
+
// 4. GAIA-224 addon rename pass over the project + home `.gaia/` configs
|
|
209
|
+
// (connection `gaia.config.js` + every recognised engine config). Runs LAST
|
|
210
|
+
// so a config seeded/migrated above — already on the current names — is a
|
|
211
|
+
// zero-match no-op. Reports only the files it actually rewrites.
|
|
212
|
+
const rename = runAddonRenameMigration({
|
|
213
|
+
gaiaDirs: [
|
|
214
|
+
...(gaiaDir === undefined ? [] : [gaiaDir]),
|
|
215
|
+
join(home, GAIA_DIR),
|
|
216
|
+
],
|
|
217
|
+
dryRun: dry,
|
|
218
|
+
});
|
|
219
|
+
actions.push(...rename.actions);
|
|
220
|
+
changed = changed || rename.changed;
|
|
142
221
|
return { actions, alreadyCurrent: !changed };
|
|
143
222
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ConductorLogger, type GaiaCommandHost, type GaiaCommandPlugin } from '@gaia-ai/core';
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
+
import type { GaiaExecutor } from '../plugins/executor.js';
|
|
4
|
+
import { type ResolvedAgent } from '../plugins/plugins.js';
|
|
5
|
+
import type { GaiaRemote } from '../plugins/remote.js';
|
|
6
|
+
import type { GaiaWorkspace } from '../plugins/workspace.js';
|
|
7
|
+
import type { ConductorFileConfig } from '../types.js';
|
|
3
8
|
/** Test seam: inject any subset of dependencies. */
|
|
4
9
|
export interface GaiaCliDeps {
|
|
5
10
|
remote?: GaiaRemote;
|
|
@@ -11,8 +16,26 @@ export interface GaiaCliDeps {
|
|
|
11
16
|
fetch?: typeof fetch;
|
|
12
17
|
/** Host contract (resolveBases); default: this install + cwd. */
|
|
13
18
|
host?: GaiaCommandHost;
|
|
19
|
+
/**
|
|
20
|
+
* GAIA-222: the herdr process host behind `start` / `stop`. Defaults to the
|
|
21
|
+
* real shell-out (`realHerdrHost`) — a test MUST inject a fake, or the suite
|
|
22
|
+
* creates real workspaces + real conductor processes on the developer's
|
|
23
|
+
* machine.
|
|
24
|
+
*/
|
|
25
|
+
herdr?: HerdrHost;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The multiplexer seam of the conductor lifecycle: start a detached foreground
|
|
29
|
+
* loop, and kill it again by its handle. One interface so both directions are
|
|
30
|
+
* injectable — `killViaHerdr` is reached by BOTH `stop` and `stop --now`.
|
|
31
|
+
*/
|
|
32
|
+
export interface HerdrHost {
|
|
33
|
+
spawn(label: string, cwd: string, cmd: string): Promise<void>;
|
|
34
|
+
kill(label: string): Promise<void>;
|
|
14
35
|
}
|
|
15
36
|
export declare function parseHerdrJson(output: string, command: string): unknown;
|
|
37
|
+
/** The production host: the real `herdr` binary. */
|
|
38
|
+
export declare const realHerdrHost: HerdrHost;
|
|
16
39
|
/**
|
|
17
40
|
* Start-time auth gate. Returns true if authenticated (session or session-less
|
|
18
41
|
* provider); otherwise logs a single clear line and returns false.
|
|
@@ -20,8 +43,9 @@ export declare function parseHerdrJson(output: string, command: string): unknown
|
|
|
20
43
|
export declare function ensureAuthenticated(config: ConductorFileConfig, logger: ConductorLogger): Promise<boolean>;
|
|
21
44
|
/** Build the `conductor` subcommand tree (lifecycle + registry + init). */
|
|
22
45
|
export declare function createConductorCommand(deps: GaiaCliDeps): Command;
|
|
23
|
-
/** The `conductor` command plugin the host mounts (GAIA-201).
|
|
24
|
-
* the `gaia deployment` batch helper
|
|
46
|
+
/** The `conductor` command plugin the host mounts (GAIA-201). GAIA-224
|
|
47
|
+
* (Finding 7): the `gaia deployment` batch helper is no longer registered here —
|
|
48
|
+
* it is its own command addon, `@gaia-ai/addon-deployment`. */
|
|
25
49
|
declare const conductorCommandPlugin: GaiaCommandPlugin;
|
|
26
50
|
export default conductorCommandPlugin;
|
|
27
51
|
/**
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
2
|
import { dirname } from 'node:path';
|
|
3
3
|
import { createInterface } from 'node:readline';
|
|
4
|
-
import { CommandRunner, createLogger, exec, loadGaiaConfig, machineContextPath, readMachineContext, resolveConfigPath, setDefaultCommandRunner, } from '@gaia-ai/core';
|
|
5
|
-
import { selectAgents, selectExecutor, selectRemote, selectWorkspace, } from '@gaia-ai/core/plugins';
|
|
4
|
+
import { CommandRunner, createLogger, exec, getRegisteredConductor, listRegisteredConductors, loadGaiaConfig, machineContextPath, readMachineContext, registerConductor, removeConductor, resolveConfigPath, setDefaultCommandRunner, } from '@gaia-ai/core';
|
|
6
5
|
import { Command } from 'commander';
|
|
7
6
|
import { authStatus } from 'dropsh';
|
|
8
|
-
import
|
|
9
|
-
import { registerDeployment } from '../cli/deployment.js';
|
|
10
|
-
import { scaffold, scaffoldGaiaConfig } from '../cli/init.js';
|
|
7
|
+
import { scaffold } from '../cli/init.js';
|
|
11
8
|
import { runUpgrade } from '../cli/upgrade.js';
|
|
12
9
|
import { fetchUpdateNotice, printVersionLine } from '../cli/version-check.js';
|
|
13
10
|
import { composeConductorConfig, loadConductorConfig } from '../config.js';
|
|
14
11
|
import { Conductor } from '../core/conductor.js';
|
|
12
|
+
import { selectAgents, selectExecutor, selectRemote, selectWorkspace, } from '../plugins/plugins.js';
|
|
15
13
|
/** Default host bases for connection/plugin resolution when none is injected. */
|
|
16
14
|
function defaultHost() {
|
|
17
15
|
return { resolveBases: [import.meta.url, `${process.cwd()}/`] };
|
|
@@ -64,7 +62,7 @@ function loggerFor(checkoutRoot, log = {}) {
|
|
|
64
62
|
setDefaultCommandRunner(new CommandRunner(logger));
|
|
65
63
|
return logger;
|
|
66
64
|
}
|
|
67
|
-
// --- herdr host (
|
|
65
|
+
// --- herdr host (shells out to herdr; injectable via deps.herdr) -----------
|
|
68
66
|
export function parseHerdrJson(output, command) {
|
|
69
67
|
try {
|
|
70
68
|
return JSON.parse(output);
|
|
@@ -100,6 +98,14 @@ async function killViaHerdr(label) {
|
|
|
100
98
|
await exec('herdr', ['workspace', 'close', ws.workspace_id]);
|
|
101
99
|
}
|
|
102
100
|
}
|
|
101
|
+
/** The production host: the real `herdr` binary. */
|
|
102
|
+
export const realHerdrHost = {
|
|
103
|
+
spawn: spawnViaHerdr,
|
|
104
|
+
kill: killViaHerdr,
|
|
105
|
+
};
|
|
106
|
+
function herdrHostOf(deps) {
|
|
107
|
+
return deps.herdr ?? realHerdrHost;
|
|
108
|
+
}
|
|
103
109
|
// --- ls/status freshness ----------------------------------------------------
|
|
104
110
|
const DEFAULT_FRESH_S = 120;
|
|
105
111
|
function freshnessThresholdS(config) {
|
|
@@ -119,7 +125,7 @@ function classify(hub, freshS) {
|
|
|
119
125
|
return fresh ? 'running' : 'wedged';
|
|
120
126
|
}
|
|
121
127
|
async function buildLsRows(remote, config, onlyId) {
|
|
122
|
-
const entries = await
|
|
128
|
+
const entries = await listRegisteredConductors();
|
|
123
129
|
let hub = [];
|
|
124
130
|
try {
|
|
125
131
|
hub = await remote.listConductors('me');
|
|
@@ -249,7 +255,7 @@ async function cmdStartBody(deps, log) {
|
|
|
249
255
|
return;
|
|
250
256
|
const remote = await resolveRemote(deps, config);
|
|
251
257
|
const id = conductorIdOf(config);
|
|
252
|
-
const existing = await
|
|
258
|
+
const existing = await getRegisteredConductor(id);
|
|
253
259
|
if (existing) {
|
|
254
260
|
const hubStatus = await remote.getConductorStatus(id);
|
|
255
261
|
if (hubStatus !== null && hubStatus !== 'offline') {
|
|
@@ -258,7 +264,7 @@ async function cmdStartBody(deps, log) {
|
|
|
258
264
|
}
|
|
259
265
|
}
|
|
260
266
|
const handle = `gaia-conductor:${id}`;
|
|
261
|
-
await
|
|
267
|
+
await registerConductor({
|
|
262
268
|
id,
|
|
263
269
|
path: checkoutRoot,
|
|
264
270
|
project: config.project,
|
|
@@ -274,7 +280,7 @@ async function cmdStartBody(deps, log) {
|
|
|
274
280
|
.join(' ');
|
|
275
281
|
const fgCmd = `GAIA_CONDUCTOR_LOG=file gaia conductor ${fgFlags} start --foreground`.replace(/\s+/g, ' ');
|
|
276
282
|
try {
|
|
277
|
-
await
|
|
283
|
+
await herdrHostOf(deps).spawn(handle, checkoutRoot, fgCmd);
|
|
278
284
|
logger.info({ id, handle }, 'started conductor via herdr');
|
|
279
285
|
}
|
|
280
286
|
catch (err) {
|
|
@@ -287,9 +293,9 @@ async function cmdStop(deps, now) {
|
|
|
287
293
|
const remote = await resolveRemote(deps, config);
|
|
288
294
|
const id = conductorIdOf(config);
|
|
289
295
|
if (now) {
|
|
290
|
-
const entry = await
|
|
296
|
+
const entry = await getRegisteredConductor(id);
|
|
291
297
|
if (entry && entry.host === 'herdr') {
|
|
292
|
-
await
|
|
298
|
+
await herdrHostOf(deps).kill(entry.handle);
|
|
293
299
|
console.log(`hard-stopped conductor ${id} (${entry.handle})`);
|
|
294
300
|
}
|
|
295
301
|
else {
|
|
@@ -297,9 +303,9 @@ async function cmdStop(deps, now) {
|
|
|
297
303
|
}
|
|
298
304
|
return;
|
|
299
305
|
}
|
|
300
|
-
const entry = await
|
|
306
|
+
const entry = await getRegisteredConductor(id);
|
|
301
307
|
if (entry && entry.host === 'herdr') {
|
|
302
|
-
await
|
|
308
|
+
await herdrHostOf(deps).kill(entry.handle);
|
|
303
309
|
}
|
|
304
310
|
await remote.setConductorStatus(id, 'offline');
|
|
305
311
|
console.log(`stopped conductor ${id} (offline)`);
|
|
@@ -320,7 +326,7 @@ async function cmdStatus(deps) {
|
|
|
320
326
|
async function cmdRm(deps) {
|
|
321
327
|
const config = await resolveConfig(deps);
|
|
322
328
|
const id = conductorIdOf(config);
|
|
323
|
-
await
|
|
329
|
+
await removeConductor(id);
|
|
324
330
|
console.log(`removed conductor ${id} from registry`);
|
|
325
331
|
}
|
|
326
332
|
/** ls may run without a config file; best-effort load. */
|
|
@@ -516,15 +522,11 @@ function registerInit(conductor) {
|
|
|
516
522
|
skipMachine: !onboarding,
|
|
517
523
|
skipCommitted: !hasProject,
|
|
518
524
|
});
|
|
519
|
-
//
|
|
520
|
-
//
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
const conn = scaffoldGaiaConfig(opts.config, opts.force);
|
|
525
|
-
wroteConnection = conn.wrote;
|
|
526
|
-
connectionPath = conn.path;
|
|
527
|
-
}
|
|
525
|
+
// GAIA-218: `conductor init` writes the ENGINE config only. It no longer
|
|
526
|
+
// scaffolds a project-local `gaia.config.js` — the global
|
|
527
|
+
// `~/.gaia/gaia.config.js` (seeded by the reachability step below) is the
|
|
528
|
+
// default connection every repo inherits; a project override is opt-in
|
|
529
|
+
// via `gaia upgrade`.
|
|
528
530
|
if (!onboarding) {
|
|
529
531
|
console.log(`machine context found (${machinePath}) → setting up project only`);
|
|
530
532
|
if (typeof existing.base_url !== 'string' ||
|
|
@@ -545,20 +547,19 @@ function registerInit(conductor) {
|
|
|
545
547
|
console.log(res.wroteCommitted
|
|
546
548
|
? `wrote ${res.committedPath} (engine)`
|
|
547
549
|
: `kept ${res.committedPath} (exists — pass --force to replace)`);
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
: `kept ${connectionPath} (exists — pass --force to replace)`);
|
|
551
|
-
// GAIA-216: make the split-config seed reachable from `init` itself —
|
|
552
|
-
// migrate a legacy machine context and seed the home connection config
|
|
550
|
+
// GAIA-216/218: make the split-config seed reachable from `init` itself
|
|
551
|
+
// — migrate a legacy machine context and seed the HOME connection config
|
|
553
552
|
// so an install can never be left with an engine config and no
|
|
554
|
-
// connection config.
|
|
555
|
-
//
|
|
556
|
-
//
|
|
557
|
-
//
|
|
558
|
-
//
|
|
553
|
+
// connection config. `projectConnection: 'skip'` keeps `init` from
|
|
554
|
+
// writing a project override (the global connection is the default;
|
|
555
|
+
// overrides are opt-in via `gaia upgrade`). Idempotent: a fresh init
|
|
556
|
+
// reports these as kept. `home` is derived from the machine-context path
|
|
557
|
+
// (canonical `<home>/.gaia/machine.config.js`) so the home-side steps
|
|
558
|
+
// target the same home the context lives in.
|
|
559
559
|
const reach = runUpgrade({
|
|
560
560
|
cwd: dirname(dirname(opts.config)),
|
|
561
561
|
home: dirname(dirname(machinePath)),
|
|
562
|
+
projectConnection: 'skip',
|
|
562
563
|
});
|
|
563
564
|
for (const line of reach.actions)
|
|
564
565
|
console.log(line);
|
|
@@ -577,22 +578,15 @@ function registerInit(conductor) {
|
|
|
577
578
|
' gaia dropsh auth status # both profiles present');
|
|
578
579
|
});
|
|
579
580
|
}
|
|
580
|
-
/** The `conductor` command plugin the host mounts (GAIA-201).
|
|
581
|
-
* the `gaia deployment` batch helper
|
|
581
|
+
/** The `conductor` command plugin the host mounts (GAIA-201). GAIA-224
|
|
582
|
+
* (Finding 7): the `gaia deployment` batch helper is no longer registered here —
|
|
583
|
+
* it is its own command addon, `@gaia-ai/addon-deployment`. */
|
|
582
584
|
const conductorCommandPlugin = {
|
|
583
585
|
kind: 'command',
|
|
584
586
|
name: 'conductor',
|
|
585
587
|
describe: 'node-agent lifecycle + local registry',
|
|
586
588
|
register(program, host) {
|
|
587
|
-
|
|
588
|
-
program.addCommand(createConductorCommand(deps));
|
|
589
|
-
registerDeployment(program, async () => {
|
|
590
|
-
const config = await resolveConfig(deps);
|
|
591
|
-
return resolveRemote(deps, config);
|
|
592
|
-
}, async () => {
|
|
593
|
-
const config = await resolveConfig(deps);
|
|
594
|
-
return config.project;
|
|
595
|
-
}, () => process.cwd());
|
|
589
|
+
program.addCommand(createConductorCommand({ host }));
|
|
596
590
|
},
|
|
597
591
|
};
|
|
598
592
|
export default conductorCommandPlugin;
|
|
@@ -604,13 +598,6 @@ export function buildConductorProgram(deps = {}) {
|
|
|
604
598
|
const program = new Command();
|
|
605
599
|
program.name('gaia').description('GAIA conductor + client CLI');
|
|
606
600
|
program.addCommand(createConductorCommand(deps));
|
|
607
|
-
registerDeployment(program, async () => {
|
|
608
|
-
const config = await resolveConfig(deps);
|
|
609
|
-
return resolveRemote(deps, config);
|
|
610
|
-
}, async () => {
|
|
611
|
-
const config = await resolveConfig(deps);
|
|
612
|
-
return config.project;
|
|
613
|
-
}, () => process.cwd());
|
|
614
601
|
return program;
|
|
615
602
|
}
|
|
616
603
|
/** Parse argv against the conductor program (test entry). */
|
package/dist/src/config.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type GaiaConnectionConfig } from '@gaia-ai/core';
|
|
2
|
+
import type { AgentCandidate } from './plugins/plugins.js';
|
|
3
|
+
import type { ConductorEngineConfig, ConductorFileConfig } from './types.js';
|
|
2
4
|
export { findGaiaDir, resolveConfigPath, } from '@gaia-ai/core';
|
|
3
5
|
/**
|
|
4
6
|
* Default agent prompt - the project instruction contract. One run works EXACTLY one state;
|
|
@@ -87,3 +89,15 @@ export declare function listConductorConfigFiles(gaiaDir: string): string[];
|
|
|
87
89
|
* `substates:`/other key containing "states" is not matched.
|
|
88
90
|
*/
|
|
89
91
|
export declare function stripStatesFromConfigSource(source: string): string;
|
|
92
|
+
/**
|
|
93
|
+
* Strip the `site:` and `plugins:` properties from an engine config's
|
|
94
|
+
* `export default { … }` (with their leading comment/whitespace), plus the
|
|
95
|
+
* now-orphaned connection preamble consts. Returns the rewritten source and the
|
|
96
|
+
* list of object keys removed (`[]` — source returned unchanged — when there is
|
|
97
|
+
* nothing connection-related to remove). remote/executor/agent/workspace/hooks/
|
|
98
|
+
* project/machine_id/loadLocal are left intact.
|
|
99
|
+
*/
|
|
100
|
+
export declare function stripLegacyConnectionFromConfigSource(source: string): {
|
|
101
|
+
text: string;
|
|
102
|
+
removed: string[];
|
|
103
|
+
};
|