@gaia-ai/gaia 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/dist/src/host.js +20 -10
- package/dist/src/plugins-barrel.d.ts +4 -1
- package/dist/src/plugins-barrel.js +16 -1
- package/dist/src/upgrade.d.ts +20 -2
- package/dist/src/upgrade.js +49 -9
- package/package.json +18 -13
package/dist/src/host.js
CHANGED
|
@@ -1,29 +1,37 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { dirname, join } from 'node:path';
|
|
3
3
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
4
|
+
import { commands as deploymentCommands } from '@gaia-ai/addon-deployment/preset';
|
|
5
|
+
import { commands as dropshCommands } from '@gaia-ai/addon-dropsh/preset';
|
|
4
6
|
import { commands as conductorCommands } from '@gaia-ai/conductor/preset';
|
|
5
7
|
import { resolveModuleEslintStyle, } from '@gaia-ai/core';
|
|
6
|
-
import { commands as dropshCommands } from '@gaia-ai/plugin-dropsh/preset';
|
|
7
8
|
import { commands as uiCommands } from '@gaia-ai/ui/preset';
|
|
8
9
|
import { Command } from 'commander';
|
|
9
10
|
import { registerUpgrade } from './upgrade.js';
|
|
10
11
|
// GAIA-201: the `gaia` plugin HOST. The meta package `@gaia-ai/gaia` owns the
|
|
11
|
-
// CLI entrypoint (AC-1); ui / conductor / dropsh are declared,
|
|
12
|
-
// resolved, LAZILY mounted command plugins (AC-2). The host
|
|
13
|
-
// it hard-wires nothing. Only the invoked subcommand's module
|
|
14
|
-
// `gaia --help` lists all
|
|
15
|
-
// `gaia conductor …` imports only the conductor module.
|
|
12
|
+
// CLI entrypoint (AC-1); ui / conductor / dropsh / deployment are declared,
|
|
13
|
+
// ESLint-style resolved, LAZILY mounted command plugins (AC-2). The host
|
|
14
|
+
// discovers + mounts; it hard-wires nothing. Only the invoked subcommand's module
|
|
15
|
+
// is imported — `gaia --help` lists all four via describe-only stubs and imports
|
|
16
|
+
// none; `gaia conductor …` imports only the conductor module.
|
|
16
17
|
//
|
|
17
|
-
// GAIA-215: the registry is DERIVED from the command surface — the
|
|
18
|
+
// GAIA-215: the registry is DERIVED from the command surface — the command
|
|
18
19
|
// addons' preset `commands` accumulators — rather than a hand-written list.
|
|
19
20
|
// Those presets are LIGHT (they import no runtime, only return descriptors), so
|
|
20
21
|
// composing them at boot keeps `gaia --help` import-light. `$GAIA_COMMANDS`
|
|
21
|
-
// still overrides the whole registry.
|
|
22
|
+
// still overrides the whole registry. GAIA-224 (Finding 7) added the fourth
|
|
23
|
+
// command surface, `@gaia-ai/addon-deployment` (`gaia deployment …`), which the
|
|
24
|
+
// `conductor` command plugin used to register as a side effect.
|
|
22
25
|
/** Compose the built-in command registry from the command addons' presets. The
|
|
23
26
|
* accumulators are synchronous descriptor builders (light presets), threaded in
|
|
24
|
-
* the conductor → ui → dropsh order. */
|
|
27
|
+
* the conductor → ui → dropsh → deployment order. */
|
|
25
28
|
function composeCommandSurface() {
|
|
26
|
-
const accumulators = [
|
|
29
|
+
const accumulators = [
|
|
30
|
+
conductorCommands,
|
|
31
|
+
uiCommands,
|
|
32
|
+
dropshCommands,
|
|
33
|
+
deploymentCommands,
|
|
34
|
+
];
|
|
27
35
|
let acc = [];
|
|
28
36
|
for (const fn of accumulators) {
|
|
29
37
|
if (typeof fn === 'function')
|
|
@@ -141,6 +149,8 @@ function pluginDescribe(entry) {
|
|
|
141
149
|
return 'interactive terminal UI: project dashboard, ticket list, ticket detail';
|
|
142
150
|
case 'dropsh':
|
|
143
151
|
return 'JSON:API shell (dropsh) bound to the GAIA connection config';
|
|
152
|
+
case 'deployment':
|
|
153
|
+
return 'release / deployment helpers';
|
|
144
154
|
default:
|
|
145
155
|
return `${entry.name} command`;
|
|
146
156
|
}
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { basicAuthProvider } from '@gaia-ai/addon-auth-basic';
|
|
2
|
+
export { DrupalGaiaRemote, drupalRemote } from '@gaia-ai/addon-remote-drupal';
|
|
3
|
+
export { GitWorkspace, gitWorkspace, loadInstructions, } from '@gaia-ai/addon-workspace-git';
|
|
4
|
+
export { type AgentCandidate, type ResolvedAgent, selectAgent, selectAgents, selectExecutor, selectRemote, selectWorkspace, } from '@gaia-ai/conductor/contract';
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
// GAIA-224 (Finding 6, decision 11): the `@gaia-ai/gaia/plugins` BACK-COMPAT
|
|
2
|
+
// barrel. It used to be a single `export * from '@gaia-ai/core/plugins'`; that
|
|
3
|
+
// core barrel is deleted, because core no longer ships plugin implementations.
|
|
4
|
+
// The barrel itself stays (published configs may still name
|
|
5
|
+
// `{ plugin: '@gaia-ai/gaia/plugins', export: 'drupalRemote' }`), but it now
|
|
6
|
+
// aggregates the CONTRIBUTIONS from where they actually live: the impl addons +
|
|
7
|
+
// the conductor-surface selectors. "plugins" is the right word for a
|
|
8
|
+
// contribution barrel (decision 16) — only the *package* prefix became `addon-`.
|
|
9
|
+
//
|
|
10
|
+
// The fakes (`fakeRemote`/`fakeWorkspace`) are deliberately NOT re-exported:
|
|
11
|
+
// they moved into `@gaia-ai/addon-fake`, a workspace-only test fixture that is
|
|
12
|
+
// never published, so the published meta package must not depend on it.
|
|
13
|
+
export { basicAuthProvider } from '@gaia-ai/addon-auth-basic';
|
|
14
|
+
export { DrupalGaiaRemote, drupalRemote } from '@gaia-ai/addon-remote-drupal';
|
|
15
|
+
export { GitWorkspace, gitWorkspace, loadInstructions, } from '@gaia-ai/addon-workspace-git';
|
|
16
|
+
export { selectAgent, selectAgents, selectExecutor, selectRemote, selectWorkspace, } from '@gaia-ai/conductor/contract';
|
package/dist/src/upgrade.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
import { type ProjectConnectionChoice } from '@gaia-ai/conductor';
|
|
1
2
|
import type { Command } from 'commander';
|
|
2
|
-
/**
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* GAIA-218 (AC-3, AC-4): resolve what to do with the PROJECT connection override.
|
|
5
|
+
* Default no in every branch — only an explicit yes opts in. Non-interactive
|
|
6
|
+
* (no TTY) ⇒ always `skip`. The prompt is injected so the host test can stub it.
|
|
7
|
+
*
|
|
8
|
+
* - existing project `gaia.config.js` → "remove this override? [y/N]" → `remove`|`skip`
|
|
9
|
+
* - none → "create an override? [y/N]" → `create`|`skip`
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveProjectConnectionChoice(opts: {
|
|
12
|
+
existing: string | undefined;
|
|
13
|
+
isTTY: boolean;
|
|
14
|
+
prompt: (question: string) => Promise<boolean>;
|
|
15
|
+
}): Promise<ProjectConnectionChoice>;
|
|
16
|
+
/** Register `gaia upgrade` on the host program. `deps` is injectable for tests. */
|
|
17
|
+
export declare function registerUpgrade(program: Command, deps?: {
|
|
18
|
+
prompt?: (question: string) => Promise<boolean>;
|
|
19
|
+
isTTY?: boolean;
|
|
20
|
+
cwd?: string;
|
|
21
|
+
}): void;
|
package/dist/src/upgrade.js
CHANGED
|
@@ -1,17 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createInterface } from 'node:readline';
|
|
2
|
+
import { hasProjectConnection, runUpgrade, } from '@gaia-ai/conductor';
|
|
2
3
|
// GAIA-216: the `gaia upgrade` migration/seed routine was hoisted DOWN into the
|
|
3
4
|
// engine (`@gaia-ai/conductor`) so `conductor init` can call it intra-package
|
|
4
|
-
// without a host→engine→host cycle. The host keeps
|
|
5
|
-
//
|
|
6
|
-
// `conductor/
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
// without a host→engine→host cycle. The host keeps the thin CLI registration
|
|
6
|
+
// below plus the GAIA-218 TTY interaction that resolves the PROJECT connection
|
|
7
|
+
// decision. See `gaia-cli/conductor/src/cli/upgrade.ts` for `runUpgrade` +
|
|
8
|
+
// `UpgradeReport`.
|
|
9
|
+
/** Ask a yes/no question on the terminal; anything but an explicit yes is no. */
|
|
10
|
+
async function promptYesNo(question) {
|
|
11
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
12
|
+
try {
|
|
13
|
+
const answer = await new Promise((resolve) => rl.question(question, resolve));
|
|
14
|
+
const a = answer.trim().toLowerCase();
|
|
15
|
+
return a === 'y' || a === 'yes';
|
|
16
|
+
}
|
|
17
|
+
finally {
|
|
18
|
+
rl.close();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* GAIA-218 (AC-3, AC-4): resolve what to do with the PROJECT connection override.
|
|
23
|
+
* Default no in every branch — only an explicit yes opts in. Non-interactive
|
|
24
|
+
* (no TTY) ⇒ always `skip`. The prompt is injected so the host test can stub it.
|
|
25
|
+
*
|
|
26
|
+
* - existing project `gaia.config.js` → "remove this override? [y/N]" → `remove`|`skip`
|
|
27
|
+
* - none → "create an override? [y/N]" → `create`|`skip`
|
|
28
|
+
*/
|
|
29
|
+
export async function resolveProjectConnectionChoice(opts) {
|
|
30
|
+
if (!opts.isTTY)
|
|
31
|
+
return 'skip';
|
|
32
|
+
if (opts.existing !== undefined) {
|
|
33
|
+
const yes = await opts.prompt(`remove this project connection override (${opts.existing})? [y/N] `);
|
|
34
|
+
return yes ? 'remove' : 'skip';
|
|
35
|
+
}
|
|
36
|
+
const yes = await opts.prompt('create a project connection override for this repo? [y/N] ');
|
|
37
|
+
return yes ? 'create' : 'skip';
|
|
38
|
+
}
|
|
39
|
+
/** Register `gaia upgrade` on the host program. `deps` is injectable for tests. */
|
|
40
|
+
export function registerUpgrade(program, deps = {}) {
|
|
9
41
|
program
|
|
10
42
|
.command('upgrade')
|
|
11
|
-
.description('migrate this install
|
|
43
|
+
.description('migrate this install: the split config model (gaia.config.js connection + conductor.config.js engine; ~/.gaia/machine.config.js) and the GAIA-224 addon package names (@gaia-ai/plugin-*, @gaia-ai/core/builtins and @gaia-ai/core/plugins → @gaia-ai/addon-*). Prompts before creating/removing a project connection override.')
|
|
12
44
|
.option('--dry-run', 'print the migration plan without writing anything', false)
|
|
13
|
-
.action((opts) => {
|
|
14
|
-
const
|
|
45
|
+
.action(async (opts) => {
|
|
46
|
+
const cwd = deps.cwd ?? process.cwd();
|
|
47
|
+
const isTTY = deps.isTTY ?? Boolean(process.stdin.isTTY);
|
|
48
|
+
const prompt = deps.prompt ?? promptYesNo;
|
|
49
|
+
const projectConnection = await resolveProjectConnectionChoice({
|
|
50
|
+
existing: hasProjectConnection(cwd),
|
|
51
|
+
isTTY,
|
|
52
|
+
prompt,
|
|
53
|
+
});
|
|
54
|
+
const report = runUpgrade({ dryRun: opts.dryRun, projectConnection });
|
|
15
55
|
for (const line of report.actions)
|
|
16
56
|
console.log(line);
|
|
17
57
|
if (report.alreadyCurrent)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gaia-ai/gaia",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "GAIA meta package: the `gaia` plugin-host CLI + all runtime plugins. Global install target.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"repository": {
|
|
28
28
|
"type": "git",
|
|
29
29
|
"url": "git+https://git.key-tec.de/keytec/gaia.git",
|
|
30
|
-
"directory": "
|
|
30
|
+
"directory": "gaia-cli/host"
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|
|
33
33
|
"gaia",
|
|
@@ -38,17 +38,22 @@
|
|
|
38
38
|
"jsonapi"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@gaia-ai/
|
|
42
|
-
"@gaia-ai/
|
|
43
|
-
"@gaia-ai/
|
|
44
|
-
"@gaia-ai/
|
|
45
|
-
"@gaia-ai/
|
|
46
|
-
"@gaia-ai/
|
|
47
|
-
"@gaia-ai/
|
|
48
|
-
"@gaia-ai/
|
|
49
|
-
"@gaia-ai/
|
|
50
|
-
"@gaia-ai/
|
|
51
|
-
"@gaia-ai/
|
|
41
|
+
"@gaia-ai/addon-auth-basic": "^0.6.1",
|
|
42
|
+
"@gaia-ai/addon-claude": "^0.6.1",
|
|
43
|
+
"@gaia-ai/addon-codex": "^0.6.1",
|
|
44
|
+
"@gaia-ai/addon-deployment": "^0.6.1",
|
|
45
|
+
"@gaia-ai/addon-dropsh": "^0.6.1",
|
|
46
|
+
"@gaia-ai/addon-essentials": "^0.6.1",
|
|
47
|
+
"@gaia-ai/addon-gaia-ui": "^0.6.1",
|
|
48
|
+
"@gaia-ai/addon-herdr": "^0.6.1",
|
|
49
|
+
"@gaia-ai/addon-kimi": "^0.6.1",
|
|
50
|
+
"@gaia-ai/addon-opencode": "^0.6.1",
|
|
51
|
+
"@gaia-ai/addon-pi": "^0.6.1",
|
|
52
|
+
"@gaia-ai/addon-remote-drupal": "^0.6.1",
|
|
53
|
+
"@gaia-ai/addon-workspace-git": "^0.6.1",
|
|
54
|
+
"@gaia-ai/conductor": "^0.6.1",
|
|
55
|
+
"@gaia-ai/core": "^0.6.1",
|
|
56
|
+
"@gaia-ai/ui": "^0.6.1",
|
|
52
57
|
"commander": "^12.1.0"
|
|
53
58
|
}
|
|
54
59
|
}
|