@gaia-ai/conductor 0.5.5 → 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.
Files changed (40) hide show
  1. package/README.md +1 -1
  2. package/dist/src/cli/config-schema.d.ts +89 -0
  3. package/dist/src/cli/config-schema.js +146 -0
  4. package/dist/src/cli/init.d.ts +31 -33
  5. package/dist/src/cli/init.js +106 -84
  6. package/dist/src/cli/migrate-addon-names.d.ts +72 -0
  7. package/dist/src/cli/migrate-addon-names.js +318 -0
  8. package/dist/src/cli/upgrade.d.ts +53 -0
  9. package/dist/src/cli/upgrade.js +222 -0
  10. package/dist/src/cli/version-check.js +5 -1
  11. package/dist/src/commands/conductor.d.ts +57 -0
  12. package/dist/src/{cli/gaia.js → commands/conductor.js} +107 -215
  13. package/dist/src/config.d.ts +65 -24
  14. package/dist/src/config.js +405 -154
  15. package/dist/src/contract.d.ts +8 -0
  16. package/dist/src/contract.js +16 -0
  17. package/dist/src/core/conductor.d.ts +16 -1
  18. package/dist/src/core/conductor.js +28 -9
  19. package/dist/src/index.d.ts +7 -5
  20. package/dist/src/index.js +26 -3
  21. package/dist/src/plugins/agent.d.ts +61 -0
  22. package/dist/src/plugins/agent.js +11 -0
  23. package/dist/src/plugins/executor.d.ts +104 -0
  24. package/dist/src/plugins/executor.js +1 -0
  25. package/dist/src/plugins/plugins.d.ts +60 -0
  26. package/dist/src/plugins/plugins.js +42 -0
  27. package/dist/src/plugins/preset.d.ts +48 -0
  28. package/dist/src/plugins/preset.js +23 -0
  29. package/dist/src/plugins/remote.d.ts +203 -0
  30. package/dist/src/plugins/remote.js +1 -0
  31. package/dist/src/plugins/workspace.d.ts +35 -0
  32. package/dist/src/plugins/workspace.js +1 -0
  33. package/dist/src/preset.d.ts +2 -0
  34. package/dist/src/preset.js +8 -0
  35. package/dist/src/types.d.ts +65 -0
  36. package/dist/src/types.js +1 -0
  37. package/package.json +8 -5
  38. package/dist/src/cli/gaia.d.ts +0 -23
  39. package/dist/src/cli/local-registry.d.ts +0 -14
  40. package/dist/src/cli/local-registry.js +0 -56
@@ -1,14 +1,15 @@
1
- import type { AgentCandidate, ConductorFileConfig } from '@gaia-ai/core';
1
+ import { type GaiaConnectionConfig } from '@gaia-ai/core';
2
+ import type { AgentCandidate } from './plugins/plugins.js';
3
+ import type { ConductorEngineConfig, ConductorFileConfig } from './types.js';
4
+ export { findGaiaDir, resolveConfigPath, } from '@gaia-ai/core';
2
5
  /**
3
- * Default agent prompt - the GAIA run contract. One run works EXACTLY one state;
6
+ * Default agent prompt - the project instruction contract. One run works EXACTLY one state;
4
7
  * the agent must stop instead of running the whole flow in one session. The run
5
8
  * is closed automatically when the ticket state changes on the next claim - the
6
9
  * agent does not release it. Run mechanics live here (not in the repo's
7
- * WORKFLOW.md). The prompt routes through the gaia skill (`ticket:run`) rather
8
- * than pointing at WORKFLOW.md directly (GAIA-125): the intake line + state
9
- * engine are a skill mechanic, so a bare "follow WORKFLOW.md" pointer left the
10
- * intake line unprinted unless an external skill-forcing hook happened to fire. A
11
- * conductor config may override via the `prompt` field.
10
+ * WORKFLOW.md). The prompt points directly at the matching project-owned state
11
+ * section and does not prescribe an agent skill. A conductor config may override
12
+ * it via the `prompt` field.
12
13
  *
13
14
  * The ticket + its comments are NOT embedded (GAIA-112): embedding unbounded
14
15
  * ticket content into a single typed pane line overran the PTY canonical line
@@ -31,7 +32,7 @@ import type { AgentCandidate, ConductorFileConfig } from '@gaia-ai/core';
31
32
  * wrapper, GAIA-118, was the thing that re-inflated the line past the cap and
32
33
  * truncated it mid-quote).
33
34
  * Placeholders: `{identifier}`, `{state}`, `{runUuid}` ({state} falls back to
34
- * `triage` for unclassified tickets).
35
+ * `qualification` for unclassified tickets).
35
36
  */
36
37
  export declare const DEFAULT_AGENT_PROMPT: string;
37
38
  /**
@@ -44,19 +45,59 @@ export declare const DEFAULT_AGENT_PROMPT: string;
44
45
  */
45
46
  export declare function resolveAgents(raw: unknown, configPath: string): Promise<AgentCandidate | AgentCandidate[]>;
46
47
  /**
47
- * Resolve the conductor config path from `cwd`.
48
- *
49
- * 1. An explicit `--config` / `$GAIA_CONDUCTOR_CONFIG` wins verbatim (no walk).
50
- * 2. Otherwise walk root-ward to the nearest `.gaia/` dir holding a conductor config
51
- * so any subdirectory of a project/worktree resolves the same dir.
52
- * - A `--conductor <name>` / `$GAIA_CONDUCTOR` selector resolves the stem's
53
- * file (`conductor` `conductor.config.js`, else
54
- * `<name>.conductor.config.js`; error listing the stems if absent).
55
- * - No selector: `conductor.config.js` present → it is the default; else
56
- * exactly one config → use it (back-compat); else → error naming the
57
- * stems + the selector.
58
- * 3. No `.gaia/` config anywhere up the tree an actionable `gaia init` error
59
- * (never leak a raw "Cannot find module" from a later import()).
60
- */
61
- export declare function resolveConfigPath(override?: string, cwd?: string, conductorName?: string): string;
62
- export declare function loadConductorConfig(configFile: string): Promise<ConductorFileConfig>;
48
+ * Load the ENGINE half of a conductor config (GAIA-201 split model). Reads
49
+ * remote/executor/agent/workspace + project/states/machine_id/label/prompt/
50
+ * scheduler/hooks and deliberately NOT `site` or the auth `plugins`, which now
51
+ * live in a `gaia.config.js` connection config. The conductor command composes
52
+ * the two via `composeConductorConfig`. A legacy `conductor.config.js` still
53
+ * carrying `site`/`plugins` loads fine those two keys are simply ignored here
54
+ * (the connection loader reads them, back-compat).
55
+ */
56
+ export declare function loadConductorConfig(configFile: string): Promise<ConductorEngineConfig>;
57
+ /**
58
+ * Compose the full `ConductorFileConfig` the engine consumes from the engine
59
+ * half (`loadConductorConfig`) and the connection half (`loadGaiaConfig`). The
60
+ * connection supplies `site` + the auth `plugins`; `ensureAuthenticated` /
61
+ * `selectRemote` read them exactly as before — the fields just arrive from
62
+ * `gaia.config.js` now.
63
+ */
64
+ export declare function composeConductorConfig(engine: ConductorEngineConfig, connection: Pick<GaiaConnectionConfig, 'site' | 'plugins'>): ConductorFileConfig;
65
+ /**
66
+ * The conductor **stems** in a `.gaia/` dir — the file naming predicate of
67
+ * GAIA-137: exactly `conductor.config.js` (stem `conductor`) or
68
+ * `<variant>.conductor.config.js` (stem `<variant>`). The resolution itself
69
+ * lives in `@gaia-ai/core` (re-exported above); this is the enumeration.
70
+ */
71
+ export declare function configStems(gaiaDir: string): string[];
72
+ /** Map a conductor stem back to its file name. */
73
+ export declare function fileForStem(stem: string): string;
74
+ /**
75
+ * List the conductor-config **file names** in a `.gaia/` dir, using the same
76
+ * naming predicate the loader uses (`configStems`). This is the only supported
77
+ * enumeration for the `@gaia/upgrade-project` states-strip: it visits the
78
+ * default `conductor.config.js` + every `<variant>.conductor.config.js`, and
79
+ * never an unrelated JS config (`vite.config.js`, the near-miss
80
+ * `myconductor.config.js`).
81
+ */
82
+ export declare function listConductorConfigFiles(gaiaDir: string): string[];
83
+ /**
84
+ * Remove the obsolete `states:` array property from a conductor-config JS
85
+ * source (GAIA-207 made `states` optional — empty ⇒ serve all claimable
86
+ * states — so `@gaia/upgrade-project` drops the now-dead key). Pure string
87
+ * transform: it strips the `states: [ ... ]` property (line form or inline in
88
+ * an object literal) with its trailing comma, and rewrites nothing else. A
89
+ * `substates:`/other key containing "states" is not matched.
90
+ */
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
+ };