@gobing-ai/ts-ai-runner 0.3.20 → 0.3.22

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 CHANGED
@@ -17,7 +17,9 @@ bun add @gobing-ai/ts-ai-runner
17
17
  | `AiRunner` | Runs help, version, auth, prompt, and slash commands through a pluggable process executor; can also build a prompt command without executing it. Emits typed events via optional `EventBus<AgentEvents>`. |
18
18
  | `AgentDetector` | Probes supported agent CLIs and parses version output |
19
19
  | `DoctorRunner` | Combines installation and authentication checks into a usability report |
20
- | `getAgentShim()` | Returns the pure command builder for one supported agent |
20
+ | `getAgentShim()` | Returns the pure command builder for one supported agent (resolves aliases to canonical) |
21
+ | `resolveAgentName()` | Maps a canonical id or alias to its canonical `AgentName`; warns on deprecated/alias ids |
22
+ | `buildAgentCommand()` | Shared command-build seam (identity preamble + shim dispatch) used by both one-shot and team paths |
21
23
  | `translateSlashCommand()` | Converts Claude-style `/plugin:command` inputs to each agent's dialect |
22
24
  | `isClaudeStyleSlashCommand()` | Tests whether input matches the `/plugin:command` pattern |
23
25
  | `buildIdentityPreamble()` / `getGitContext()` | Builds team-mode identity, communication context, and git metadata for prompts |
@@ -30,7 +32,7 @@ bun add @gobing-ai/ts-ai-runner
30
32
  | `AGENT_SHIMS` / `TIER1_PRIORITY` / `TIER2_AGENTS` / `DISPLAY_ORDER` | Agent registry constants |
31
33
  | `isAgentName()` | Type guard for supported agent identifiers |
32
34
 
33
- Supported agent identifiers: `claude`, `codex`, `gemini`, `pi`, `opencode` (tier 1), `antigravity`, `openclaw` (tier 2).
35
+ Supported agent identifiers: `claude`, `codex`, `gemini` (deprecated), `pi`, `omp`, `opencode`, `antigravity-cli`, `openclaw`, `hermes`. The `antigravity` id is a deprecated alias of `antigravity-cli`. See [Deprecation & Aliases](#deprecation--aliases).
34
36
 
35
37
  ## Architecture
36
38
 
@@ -410,6 +412,8 @@ interface AgentShim {
410
412
  readonly name: AgentName;
411
413
  readonly command: string;
412
414
  readonly tier: 1 | 2;
415
+ readonly aliases?: readonly string[];
416
+ readonly deprecated?: { readonly since: string; readonly replacedBy?: AgentName };
413
417
  getHelpCommand(): ShimCommand;
414
418
  getVersionCommand(): ShimCommand;
415
419
  getPromptCommand(options: PromptOptions): ShimCommand;
@@ -423,14 +427,41 @@ Agent-specific behavior:
423
427
  |-------|-----|------|------------|--------------|
424
428
  | `claude` | `claude` | 1 | `claude auth status` | `-p`, `--continue`, `--model`, `--output-format` |
425
429
  | `codex` | `codex` | 1 | `codex login status` | `exec <prompt>`, `exec resume --last`, `-m`, `--json` |
426
- | `gemini` | `gemini` | 1 | env-only | `-p`, `-r latest` (resume), `-m`, `-o` |
430
+ | `gemini` *(deprecated)* | `gemini` | 1 | env-only | `-p`, `-r latest` (resume), `-m`, `-o` |
427
431
  | `pi` | `pi` | 1 | `pi --list-models` | `--no-session`, `-p`, `-c` (resume), `--model`, `--mode` |
432
+ | `omp` | `omp` | 1 | `omp --list-models` | `--no-session`, `-p`, `-c` (resume), `--model`, `--mode` |
428
433
  | `opencode` | `opencode` | 1 | `opencode providers` | `run`, `-c`, `-m`, `--format json` |
429
- | `antigravity` | `agy` | 2 | env-only | `chat` |
434
+ | `antigravity-cli` | `agy` | 1 | env-only | `-p`, `--continue`, `--model` |
430
435
  | `openclaw` | `openclaw` | 2 | `openclaw health` | `agent --local -m` |
431
-
432
436
  This is the right layer for UI previews, audit logging, and custom launchers.
433
437
 
438
+ ## Deprecation & Aliases
439
+
440
+ The registry carries lifecycle metadata so agent ids can be retired without breaking existing callers.
441
+
442
+ **`resolveAgentName(input)`** maps any canonical id or alias to its canonical `AgentName`. Resolving a deprecated or aliased id emits exactly one `warn` through the logger seam and never throws.
443
+
444
+ ```ts
445
+ import { resolveAgentName } from '@gobing-ai/ts-ai-runner';
446
+
447
+ resolveAgentName('antigravity'); // → 'antigravity-cli' (alias), warns
448
+ resolveAgentName('gemini'); // → 'gemini' (deprecated canonical), warns
449
+ resolveAgentName('antigravity-cli'); // → 'antigravity-cli' (canonical, no warn)
450
+ resolveAgentName('cursor'); // → undefined
451
+ ```
452
+
453
+ **Current deprecation map:**
454
+
455
+ | Id | Status | Canonical | Notes |
456
+ |----|--------|-----------|-------|
457
+ | `antigravity` | alias of `antigravity-cli` | `antigravity-cli` | Old tier-2 id; both use binary `agy`. Resolving warns. |
458
+ | `gemini` | deprecated | `gemini` (self) → replaced by `antigravity-cli` | Gemini CLI sunset 2026-06-18. Shim stays functional. |
459
+ | `omp` | canonical | `omp` | First-class; NOT a pi alias. |
460
+ | `hermes` | canonical | `hermes` | First-class; OpenClaw-compatible but distinct binary. |
461
+
462
+ `getAgentShim()` and `isAgentName()` are alias-aware: passing `'antigravity'` resolves to the `antigravity-cli` shim. `DoctorResult` and `DetectedAgent` surface `deprecated` + `replacedBy` when the resolved canonical id is marked deprecated.
463
+
464
+
434
465
  ## Team Mode Primitives
435
466
 
436
467
  The team-mode APIs are intentionally small building blocks. They do not implement an HTTP API, dashboard, or product workflow; downstream apps compose them into their own orchestration layer.
@@ -566,8 +597,8 @@ const ampShim: AgentShim = {
566
597
  In the same file, add the new agent to these three places:
567
598
 
568
599
  ```ts
569
- // 1. The AgentName union type
570
- export type AgentName = 'claude' | 'codex' | 'gemini' | 'pi' | 'opencode' | 'antigravity' | 'openclaw' | 'amp';
600
+ // 1. The AgentName union type (canonical ids only — aliases are metadata, not union members)
601
+ export type AgentName = 'claude' | 'codex' | 'gemini' | 'pi' | 'omp' | 'opencode' | 'antigravity-cli' | 'openclaw' | 'hermes' | 'amp';
571
602
 
572
603
  // 2. The AGENT_SHIMS registry
573
604
  export const AGENT_SHIMS: Readonly<Record<AgentName, AgentShim>> = {
@@ -577,7 +608,7 @@ export const AGENT_SHIMS: Readonly<Record<AgentName, AgentShim>> = {
577
608
 
578
609
  // 3. DISPLAY_ORDER (determines doctor/detector output order)
579
610
  export const DISPLAY_ORDER: readonly AgentName[] = [
580
- 'claude', 'codex', 'gemini', 'pi', 'opencode', 'antigravity', 'openclaw', 'amp',
611
+ 'claude', 'codex', 'gemini', 'pi', 'omp', 'opencode', 'antigravity-cli', 'openclaw', 'hermes', 'amp',
581
612
  ];
582
613
  ```
583
614
 
@@ -2,7 +2,7 @@ import { type AgentName } from './agents/shims';
2
2
  import { AiRunner } from './ai-runner';
3
3
  /** Installation/version probe result for one coding agent. */
4
4
  export interface DetectedAgent {
5
- /** Agent identifier. */
5
+ /** Canonical agent identifier (alias input is resolved to its canonical id). */
6
6
  name: AgentName | string;
7
7
  /** Whether the agent CLI was found and returned a parseable version. */
8
8
  installed: boolean;
@@ -12,6 +12,10 @@ export interface DetectedAgent {
12
12
  channels: string[];
13
13
  /** Detection error when unavailable. */
14
14
  error: string | null;
15
+ /** True when the resolved canonical id is marked deprecated. */
16
+ deprecated?: boolean;
17
+ /** Canonical replacement when the resolved id is deprecated, if any. */
18
+ replacedBy?: AgentName;
15
19
  }
16
20
  /** Constructor options for AgentDetector. */
17
21
  export interface AgentDetectorOptions {
@@ -25,9 +29,9 @@ export declare class AgentDetector {
25
29
  private readonly runner;
26
30
  private readonly timeout;
27
31
  constructor(options?: AgentDetectorOptions);
28
- /** Probe all bundled agents in display order. */
32
+ /** Probe all bundled canonical agents in display order. */
29
33
  detectAll(): Promise<DetectedAgent[]>;
30
- /** Probe one agent by name. */
34
+ /** Probe one agent by canonical id or alias. */
31
35
  detectOne(agent: string): Promise<DetectedAgent>;
32
36
  private parseResult;
33
37
  private detectChannels;
@@ -1 +1 @@
1
- {"version":3,"file":"agent-detector.d.ts","sourceRoot":"","sources":["../src/agent-detector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA4C,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAuB,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5D,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC1B,wBAAwB;IACxB,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IACzB,wEAAwE;IACxE,S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AO,CAAC;IACrB,wEAAwE;IACxE,UAAU,CAAC,EAAE,SAAS,CAAC;CAC1B;AAED,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACjC,gCAAgC;IAChC,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAKD,6EAA6E;AAC7E,qBAAa,aAAa;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAW;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,GAAE,oBAAyB;IAI9C,2DAA2D;IACrD,SAAS,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAI3C,gDAAgD;IAC1C,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAatD,OAAO,CAAC,WAAW;IAkCnB,OAAO,CAAC,cAAc;CAIzB"}
@@ -1,4 +1,4 @@
1
- import { DISPLAY_ORDER, getAgentShim, isAgentName } from './agents/shims.js';
1
+ import { DISPLAY_ORDER, getAgentShim, resolveAgentName } from './agents/shims.js';
2
2
  import { AiRunner } from './ai-runner.js';
3
3
  const DEFAULT_TIMEOUT_MS = 5_000;
4
4
  const VERSION_PATTERN = /(?<version>\d+\.\d+(?:\.\d+)?)/;
@@ -10,48 +10,50 @@ export class AgentDetector {
10
10
  this.runner = options.runner ?? new AiRunner();
11
11
  this.timeout = options.timeout ?? DEFAULT_TIMEOUT_MS;
12
12
  }
13
- /** Probe all bundled agents in display order. */
13
+ /** Probe all bundled canonical agents in display order. */
14
14
  async detectAll() {
15
15
  return await Promise.all(DISPLAY_ORDER.map((agent) => this.detectOne(agent)));
16
16
  }
17
- /** Probe one agent by name. */
17
+ /** Probe one agent by canonical id or alias. */
18
18
  async detectOne(agent) {
19
- if (!isAgentName(agent))
19
+ const canonical = resolveAgentName(agent);
20
+ if (canonical === undefined)
20
21
  return unavailable(agent, `Unknown agent: ${agent}`);
21
22
  try {
22
- return this.parseResult(agent, await this.runner.runVersionCommand(agent, { timeout: this.timeout }));
23
+ return this.parseResult(canonical, await this.runner.runVersionCommand(canonical, { timeout: this.timeout }));
23
24
  }
24
25
  catch (error) {
25
26
  return unavailable(agent, error instanceof Error ? error.message : String(error));
26
27
  }
27
28
  }
28
- parseResult(agent, result) {
29
- const command = getAgentShim(agent).command;
29
+ parseResult(canonical, result) {
30
+ const command = getAgentShim(canonical).command;
30
31
  const output = `${result.stdout}\n${result.stderr}`.trim();
31
32
  const lower = output.toLowerCase();
32
33
  if (lower.includes('command not found') || lower.includes('enoent') || lower.includes('not recognized')) {
33
- return unavailable(agent, `${command}: command not found`);
34
+ return unavailable(canonical, `${command}: command not found`);
34
35
  }
35
36
  if (result.signal !== undefined) {
36
- return unavailable(agent, `Terminated by signal: ${result.signal}`);
37
+ return unavailable(canonical, `Terminated by signal: ${result.signal}`);
37
38
  }
38
39
  if (result.exitCode === null) {
39
- return unavailable(agent, 'Process did not produce an exit code');
40
+ return unavailable(canonical, 'Process did not produce an exit code');
40
41
  }
41
42
  if (result.exitCode !== 0) {
42
- return unavailable(agent, `Non-zero exit code: ${result.exitCode}. stderr: ${result.stderr.slice(0, 200)}`);
43
+ return unavailable(canonical, `Non-zero exit code: ${result.exitCode}. stderr: ${result.stderr.slice(0, 200)}`);
43
44
  }
44
45
  const match = VERSION_PATTERN.exec(output);
45
46
  if (match?.groups?.version === undefined) {
46
- return unavailable(agent, 'Could not parse version output');
47
+ return unavailable(canonical, 'Could not parse version output');
47
48
  }
48
49
  const version = output.split('\n')[0]?.trim() || match.groups.version;
49
50
  return {
50
- name: agent,
51
+ name: canonical,
51
52
  installed: true,
52
53
  version,
53
- channels: this.detectChannels(agent, output),
54
+ channels: this.detectChannels(canonical, output),
54
55
  error: null,
56
+ ...deprecationOf(canonical),
55
57
  };
56
58
  }
57
59
  detectChannels(_agent, _output) {
@@ -61,5 +63,15 @@ export class AgentDetector {
61
63
  }
62
64
  /** Build an "unavailable" detection result for an agent with the given error. */
63
65
  function unavailable(name, error) {
64
- return { name, installed: false, version: null, channels: [], error };
66
+ return { name, installed: false, version: null, channels: [], error, ...deprecationOf(name) };
67
+ }
68
+ /** Spread deprecation fields when the name resolves to a deprecated canonical id. */
69
+ function deprecationOf(name) {
70
+ const canonical = resolveAgentName(name);
71
+ if (canonical === undefined)
72
+ return {};
73
+ const shim = getAgentShim(canonical);
74
+ if (shim.deprecated === undefined)
75
+ return {};
76
+ return { deprecated: true, replacedBy: shim.deprecated.replacedBy };
65
77
  }
@@ -1,4 +1,4 @@
1
- import { type SyncFileSystem } from '@gobing-ai/ts-runtime';
1
+ import { type FileSystem } from '@gobing-ai/ts-runtime';
2
2
  /** Specification for an AI agent defined in the configuration directory. */
3
3
  export interface AgentSpec {
4
4
  id: string;
@@ -17,9 +17,9 @@ export declare class ValueError extends Error {
17
17
  /** Validate that `id` matches the agent ID format: 2-64 chars, lowercase alphanumeric with `_` or `-`. Returns the id on success, throws `ValueError` otherwise. */
18
18
  export declare function validateAgentId(id: string): string;
19
19
  /** Load and validate all YAML agent spec files from `configDir`. Throws `ValueError` on parse failures or duplicate IDs. */
20
- export declare function loadAgentSpecs(configDir: string, fs?: SyncFileSystem): AgentSpec[];
20
+ export declare function loadAgentSpecs(configDir: string, fs?: FileSystem): Promise<AgentSpec[]>;
21
21
  /** Serialize `spec` to YAML and write it to `configDir/<id>.yaml`. Creates the directory if missing. */
22
- export declare function saveAgentSpec(spec: AgentSpec, configDir: string, fs?: SyncFileSystem): Promise<void>;
22
+ export declare function saveAgentSpec(spec: AgentSpec, configDir: string, fs?: FileSystem): Promise<void>;
23
23
  /** Remove the YAML file for agent `id` from `configDir`. Does nothing if the file doesn't exist. */
24
- export declare function deleteAgentSpec(id: string, configDir: string, fs?: SyncFileSystem): Promise<void>;
24
+ export declare function deleteAgentSpec(id: string, configDir: string, fs?: FileSystem): Promise<void>;
25
25
  //# sourceMappingURL=agent-spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-spec.d.ts","sourceRoot":"","sources":["../src/agent-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,cAAc,EAEtB,MAAM,uBAAuB,CAAC;AAE/B,4EAA4E;AAC5E,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,4EAA4E;AAC5E,qBAAa,UAAW,SAAQ,KAAK;gBACrB,OAAO,EAAE,MAAM;CAI9B;AAED,oKAAoK;AACpK,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED,4HAA4H;AAC5H,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,GAAE,cAAyC,GAAG,SAAS,EAAE,CAY5G;AAED,wGAAwG;AACxG,wBAAsB,aAAa,CAC/B,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,MAAM,EACjB,EAAE,GAAE,cAAyC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAIf;AAED,oGAAoG;AACpG,wBAAsB,eAAe,CACjC,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EACjB,EAAE,GAAE,cAAyC,GAC9C,OAAO,CAAC,IAAI,CAAC,CAGf"}
1
+ {"version":3,"file":"agent-spec.d.ts","sourceRoot":"","sources":["../src/agent-spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,UAAU,EAIlB,MAAM,uBAAuB,CAAC;AAE/B,4EAA4E;AAC5E,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,4EAA4E;AAC5E,qBAAa,UAAW,SAAQ,KAAK;gBACrB,OAAO,EAAE,MAAM;CAI9B;AAED,oKAAoK;AACpK,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED,4HAA4H;AAC5H,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,GAAE,UAAmC,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAcrH;AAED,wGAAwG;AACxG,wBAAsB,aAAa,CAC/B,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,MAAM,EACjB,EAAE,GAAE,UAAmC,GACxC,OAAO,CAAC,IAAI,CAAC,CAIf;AAED,oGAAoG;AACpG,wBAAsB,eAAe,CACjC,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,EACjB,EAAE,GAAE,UAAmC,GACxC,OAAO,CAAC,IAAI,CAAC,CAGf"}
@@ -1,4 +1,4 @@
1
- import { basenamePath, joinPath, NodeSyncFileSystem, parseYamlObject, stringifyYamlObject, } from '@gobing-ai/ts-runtime';
1
+ import { basenamePath, createNodeFileSystem, joinPath, parseYamlObject, stringifyYamlObject, } from '@gobing-ai/ts-runtime';
2
2
  /** Validation error thrown when agent spec data is malformed or invalid. */
3
3
  export class ValueError extends Error {
4
4
  constructor(message) {
@@ -14,11 +14,11 @@ export function validateAgentId(id) {
14
14
  return id;
15
15
  }
16
16
  /** Load and validate all YAML agent spec files from `configDir`. Throws `ValueError` on parse failures or duplicate IDs. */
17
- export function loadAgentSpecs(configDir, fs = new NodeSyncFileSystem()) {
18
- const entries = safeReadDir(configDir, fs)
17
+ export async function loadAgentSpecs(configDir, fs = createNodeFileSystem()) {
18
+ const entries = (await safeReadDir(configDir, fs))
19
19
  .filter((entry) => entry.endsWith('.yaml') || entry.endsWith('.yml'))
20
20
  .sort();
21
- const specs = entries.map((entry) => parseAgentSpec(fs.readFile(joinPath(configDir, entry)), entry));
21
+ const specs = await Promise.all(entries.map(async (entry) => parseAgentSpec(await fs.readFile(joinPath(configDir, entry)), entry)));
22
22
  const seen = new Set();
23
23
  for (const spec of specs) {
24
24
  validateAgentId(spec.id);
@@ -29,19 +29,19 @@ export function loadAgentSpecs(configDir, fs = new NodeSyncFileSystem()) {
29
29
  return specs;
30
30
  }
31
31
  /** Serialize `spec` to YAML and write it to `configDir/<id>.yaml`. Creates the directory if missing. */
32
- export async function saveAgentSpec(spec, configDir, fs = new NodeSyncFileSystem()) {
32
+ export async function saveAgentSpec(spec, configDir, fs = createNodeFileSystem()) {
33
33
  validateAgentId(spec.id);
34
- fs.mkdir(configDir);
35
- fs.writeFile(joinPath(configDir, `${spec.id}.yaml`), serializeAgentSpec(spec));
34
+ await fs.ensureDir(configDir);
35
+ await fs.writeFile(joinPath(configDir, `${spec.id}.yaml`), serializeAgentSpec(spec));
36
36
  }
37
37
  /** Remove the YAML file for agent `id` from `configDir`. Does nothing if the file doesn't exist. */
38
- export async function deleteAgentSpec(id, configDir, fs = new NodeSyncFileSystem()) {
38
+ export async function deleteAgentSpec(id, configDir, fs = createNodeFileSystem()) {
39
39
  validateAgentId(id);
40
- fs.unlink(joinPath(configDir, `${id}.yaml`));
40
+ await fs.deleteFile(joinPath(configDir, `${id}.yaml`));
41
41
  }
42
- function safeReadDir(configDir, fs = new NodeSyncFileSystem()) {
42
+ async function safeReadDir(configDir, fs = createNodeFileSystem()) {
43
43
  try {
44
- return fs.readDir(configDir);
44
+ return await fs.readDir(configDir);
45
45
  }
46
46
  catch (error) {
47
47
  if (error instanceof Error && 'code' in error && error.code === 'ENOENT') {
@@ -1,5 +1,5 @@
1
- /** Identifier for one supported coding agent. */
2
- export type AgentName = 'claude' | 'codex' | 'gemini' | 'pi' | 'opencode' | 'antigravity' | 'openclaw';
1
+ /** Identifier for one supported coding agent (canonical id). */
2
+ export type AgentName = 'claude' | 'codex' | 'gemini' | 'pi' | 'opencode' | 'antigravity-cli' | 'openclaw' | 'hermes' | 'omp';
3
3
  /** Output mode for prompt invocations. */
4
4
  export type OutputMode = 'text' | 'json';
5
5
  /** Concrete executable and argv pair returned by an agent shim. */
@@ -34,14 +34,25 @@ export interface PromptOptions {
34
34
  purpose?: string;
35
35
  }>;
36
36
  }
37
+ /** Deprecation metadata attached to a retired or superseded agent shim. */
38
+ export interface AgentDeprecation {
39
+ /** Release date (ISO) when the id was marked deprecated. */
40
+ readonly since: string;
41
+ /** Canonical replacement, when one exists. */
42
+ readonly replacedBy?: AgentName;
43
+ }
37
44
  /** Pure command builder for one coding-agent CLI. */
38
45
  export interface AgentShim {
39
- /** Stable agent identifier. */
46
+ /** Stable canonical agent identifier. */
40
47
  readonly name: AgentName;
41
48
  /** Executable command name. */
42
49
  readonly command: string;
43
50
  /** Capability tier: 1 = direct CLI, 2 = gateway/TUI constrained. */
44
51
  readonly tier: 1 | 2;
52
+ /** Non-canonical ids that resolve to this shim (aliases map to this canonical id). */
53
+ readonly aliases?: readonly string[];
54
+ /** Deprecation marker; resolving a deprecated id warns and reports canonical status. */
55
+ readonly deprecated?: AgentDeprecation;
45
56
  /** Build a help-display command. */
46
57
  getHelpCommand(): ShimCommand;
47
58
  /** Build a version-detection command. */
@@ -51,16 +62,28 @@ export interface AgentShim {
51
62
  /** Build an auth-status command, or null when unsupported. */
52
63
  getAuthCommand(): ShimCommand | null;
53
64
  }
54
- /** All bundled agent shims keyed by agent name. */
65
+ /** All bundled agent shims keyed by canonical agent name. */
55
66
  export declare const AGENT_SHIMS: Readonly<Record<AgentName, AgentShim>>;
56
- /** Tier-1 auto-selection priority. */
67
+ /** Tier-1 auto-selection priority. Deprecated ids are excluded. */
57
68
  export declare const TIER1_PRIORITY: readonly AgentName[];
58
69
  /** Display order for doctor and list commands. */
59
70
  export declare const DISPLAY_ORDER: readonly AgentName[];
60
71
  /** Set of gateway/TUI-constrained agents. */
61
72
  export declare const TIER2_AGENTS: ReadonlySet<AgentName>;
62
- /** Return true when a value is a supported agent identifier. */
63
- export declare function isAgentName(value: string): value is AgentName;
64
- /** Look up a bundled agent shim. */
73
+ /**
74
+ * Resolve a canonical or alias id to its canonical `AgentName`.
75
+ *
76
+ * - Canonical ids resolve to themselves.
77
+ * - Aliases resolve to their canonical id (e.g. `'antigravity' → 'antigravity-cli'`).
78
+ * - Unknown ids resolve to `undefined`.
79
+ *
80
+ * Resolving a deprecated or aliased id emits exactly one `warn` through the
81
+ * logger seam and never throws.
82
+ */
83
+ export declare function resolveAgentName(input: string): AgentName | undefined;
84
+ /** Return true when a value is a known canonical id or alias. Does not narrow;
85
+ * use `resolveAgentName()` to obtain the canonical `AgentName`. */
86
+ export declare function isAgentName(value: string): boolean;
87
+ /** Look up a bundled agent shim, resolving aliases to the canonical shim. */
65
88
  export declare function getAgentShim(agent: AgentName): AgentShim;
66
89
  //# sourceMappingURL=shims.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shims.d.ts","sourceRoot":"","sources":["../../src/agents/shims.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,IAAI,GAAG,UAAU,GAAG,aAAa,GAAG,UAAU,CAAC;AAEvG,0CAA0C;AAC1C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC,mEAAmE;AACnE,MAAM,WAAW,WAAW;IACxB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,4CAA4C;AAC5C,MAAM,WAAW,aAAa;IAC1B,yDAAyD;IACzD,KAAK,CAAC,EAAE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KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAQrE;AAED;mEACmE;AACnE,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAMxD"}
@@ -1,3 +1,4 @@
1
+ import { getLogger } from '@gobing-ai/ts-infra';
1
2
  const claudeShim = {
2
3
  name: 'claude',
3
4
  command: 'claude',
@@ -38,6 +39,7 @@ const geminiShim = {
38
39
  name: 'gemini',
39
40
  command: 'gemini',
40
41
  tier: 1,
42
+ deprecated: { since: '2026-06-20', replacedBy: 'antigravity-cli' },
41
43
  getHelpCommand: () => ({ command: 'gemini', args: ['--help'] }),
42
44
  getVersionCommand: () => ({ command: 'gemini', args: ['--version'] }),
43
45
  getPromptCommand: (options) => {
@@ -89,13 +91,26 @@ const opencodeShim = {
89
91
  },
90
92
  getAuthCommand: () => ({ command: 'opencode', args: ['providers'] }),
91
93
  };
92
- const antigravityShim = {
93
- name: 'antigravity',
94
+ /**
95
+ * Antigravity CLI (`agy`) — the scriptable/headless successor to Gemini CLI
96
+ * (Antigravity 2.0 split, 2026-06). Tier-1: `-p`/`--print` one-shot, `--model`,
97
+ * `agy models`, `--continue` resumes the most recent session.
98
+ */
99
+ const antigravityCliShim = {
100
+ name: 'antigravity-cli',
94
101
  command: 'agy',
95
- tier: 2,
102
+ tier: 1,
103
+ aliases: ['antigravity'],
96
104
  getHelpCommand: () => ({ command: 'agy', args: ['--help'] }),
97
105
  getVersionCommand: () => ({ command: 'agy', args: ['--version'] }),
98
- getPromptCommand: (options) => ({ command: 'agy', args: ['chat', options.input ?? ''] }),
106
+ getPromptCommand: (options) => {
107
+ const args = ['-p', options.input ?? ''];
108
+ if (options.continue === true)
109
+ args.push('--continue');
110
+ if (options.model !== undefined)
111
+ args.push('--model', options.model);
112
+ return { command: 'agy', args };
113
+ },
99
114
  getAuthCommand: () => null,
100
115
  };
101
116
  const openclawShim = {
@@ -107,35 +122,137 @@ const openclawShim = {
107
122
  getPromptCommand: (options) => ({ command: 'openclaw', args: ['agent', '--local', '-m', options.input ?? ''] }),
108
123
  getAuthCommand: () => ({ command: 'openclaw', args: ['health'] }),
109
124
  };
110
- /** All bundled agent shims keyed by agent name. */
125
+ /**
126
+ * Hermes Agent (NousResearch) — OpenClaw-compatible coding agent. One-shot via
127
+ * `hermes chat -q <input>`; model/provider overrides; `hermes doctor` health probe.
128
+ */
129
+ const hermesShim = {
130
+ name: 'hermes',
131
+ command: 'hermes',
132
+ tier: 1,
133
+ getHelpCommand: () => ({ command: 'hermes', args: ['chat', '--help'] }),
134
+ getVersionCommand: () => ({ command: 'hermes', args: ['--version'] }),
135
+ getPromptCommand: (options) => {
136
+ const args = ['chat', '-q', options.input ?? ''];
137
+ if (options.continue === true)
138
+ args.push('--continue');
139
+ if (options.model !== undefined)
140
+ args.push('-m', options.model);
141
+ return { command: 'hermes', args };
142
+ },
143
+ getAuthCommand: () => ({ command: 'hermes', args: ['doctor'] }),
144
+ };
145
+ /**
146
+ * omp (oh-my-pi) — a Pi fork. argv is Pi-compatible for the one-shot surface
147
+ * (`--no-session`, `-p`, `-c`, `--model`, `--mode`); speaks Pi's `/skill:` slash dialect.
148
+ */
149
+ const ompShim = {
150
+ name: 'omp',
151
+ command: 'omp',
152
+ tier: 1,
153
+ getHelpCommand: () => ({ command: 'omp', args: ['--help'] }),
154
+ getVersionCommand: () => ({ command: 'omp', args: ['--version'] }),
155
+ getPromptCommand: (options) => {
156
+ const args = [];
157
+ if (options.continue !== true)
158
+ args.push('--no-session');
159
+ args.push('-p', options.input ?? '');
160
+ if (options.continue === true)
161
+ args.push('-c');
162
+ if (options.model !== undefined)
163
+ args.push('--model', options.model);
164
+ args.push('--mode', options.mode ?? 'text');
165
+ return { command: 'omp', args };
166
+ },
167
+ getAuthCommand: () => ({ command: 'omp', args: ['--list-models'] }),
168
+ };
169
+ /** All bundled agent shims keyed by canonical agent name. */
111
170
  export const AGENT_SHIMS = {
112
171
  claude: claudeShim,
113
172
  codex: codexShim,
114
173
  gemini: geminiShim,
115
174
  pi: piShim,
116
175
  opencode: opencodeShim,
117
- antigravity: antigravityShim,
176
+ 'antigravity-cli': antigravityCliShim,
118
177
  openclaw: openclawShim,
178
+ hermes: hermesShim,
179
+ omp: ompShim,
119
180
  };
120
- /** Tier-1 auto-selection priority. */
121
- export const TIER1_PRIORITY = ['pi', 'codex', 'gemini', 'claude', 'opencode'];
181
+ /** Tier-1 auto-selection priority. Deprecated ids are excluded. */
182
+ export const TIER1_PRIORITY = [
183
+ 'pi',
184
+ 'omp',
185
+ 'codex',
186
+ 'antigravity-cli',
187
+ 'claude',
188
+ 'hermes',
189
+ 'opencode',
190
+ ];
122
191
  /** Display order for doctor and list commands. */
123
192
  export const DISPLAY_ORDER = [
124
193
  'claude',
125
194
  'codex',
126
195
  'gemini',
127
196
  'pi',
197
+ 'omp',
128
198
  'opencode',
129
- 'antigravity',
199
+ 'antigravity-cli',
130
200
  'openclaw',
201
+ 'hermes',
131
202
  ];
132
203
  /** Set of gateway/TUI-constrained agents. */
133
- export const TIER2_AGENTS = new Set(['antigravity', 'openclaw']);
134
- /** Return true when a value is a supported agent identifier. */
204
+ export const TIER2_AGENTS = new Set(['openclaw']);
205
+ /** Logger for alias/deprecation resolution diagnostics. */
206
+ const logger = getLogger('ai-runner.shims');
207
+ /** Alias → canonical id, derived once from `AGENT_SHIMS[*].aliases`. */
208
+ const ALIAS_TO_CANONICAL = Object.fromEntries(Object.values(AGENT_SHIMS).flatMap((shim) => (shim.aliases ?? []).map((alias) => [alias, shim.name])));
209
+ /**
210
+ * Resolve a canonical or alias id to its canonical `AgentName`.
211
+ *
212
+ * - Canonical ids resolve to themselves.
213
+ * - Aliases resolve to their canonical id (e.g. `'antigravity' → 'antigravity-cli'`).
214
+ * - Unknown ids resolve to `undefined`.
215
+ *
216
+ * Resolving a deprecated or aliased id emits exactly one `warn` through the
217
+ * logger seam and never throws.
218
+ */
219
+ export function resolveAgentName(input) {
220
+ if (isCanonicalName(input))
221
+ return input;
222
+ const canonical = ALIAS_TO_CANONICAL[input];
223
+ if (canonical !== undefined) {
224
+ warnDeprecatedOrAlias(input, canonical);
225
+ return canonical;
226
+ }
227
+ return undefined;
228
+ }
229
+ /** Return true when a value is a known canonical id or alias. Does not narrow;
230
+ * use `resolveAgentName()` to obtain the canonical `AgentName`. */
135
231
  export function isAgentName(value) {
136
- return Object.hasOwn(AGENT_SHIMS, value);
232
+ return isCanonicalName(value) || value in ALIAS_TO_CANONICAL;
137
233
  }
138
- /** Look up a bundled agent shim. */
234
+ /** Look up a bundled agent shim, resolving aliases to the canonical shim. */
139
235
  export function getAgentShim(agent) {
140
- return AGENT_SHIMS[agent];
236
+ const canonical = resolveAgentName(agent);
237
+ if (canonical === undefined) {
238
+ throw new Error(`Unsupported agent: ${agent}`);
239
+ }
240
+ return AGENT_SHIMS[canonical];
241
+ }
242
+ function isCanonicalName(value) {
243
+ return Object.hasOwn(AGENT_SHIMS, value);
244
+ }
245
+ function warnDeprecatedOrAlias(input, canonical) {
246
+ const shim = AGENT_SHIMS[canonical];
247
+ if (shim.deprecated !== undefined) {
248
+ const replacement = shim.deprecated.replacedBy ?? canonical;
249
+ logger.warn(`agent '${input}' is deprecated (since ${shim.deprecated.since}); use '${replacement}'`, {
250
+ input,
251
+ canonical,
252
+ replacedBy: replacement,
253
+ });
254
+ }
255
+ else {
256
+ logger.warn(`agent '${input}' is an alias; resolving to canonical '${canonical}'`, { input, canonical });
257
+ }
141
258
  }
@@ -21,6 +21,8 @@ export interface AgentRunOptions {
21
21
  cwd?: string;
22
22
  /** Timeout in milliseconds. */
23
23
  timeout?: number;
24
+ /** AbortSignal forwarded to ProcessExecutor — aborts the agent subprocess when fired. */
25
+ signal?: AbortSignal;
24
26
  }
25
27
  /** Constructor options for AiRunner. */
26
28
  export interface AiRunnerOptions {
@@ -60,6 +62,14 @@ export declare class AiRunner {
60
62
  /** Run an agent authentication command, or return null when unsupported. */
61
63
  runAuthCommand(agent: AgentName, options?: AgentRunOptions): Promise<AgentRunResult> | null;
62
64
  private invoke;
63
- private withIdentityPreamble;
64
65
  }
66
+ /**
67
+ * Shared command-build seam: identity preamble + shim dispatch. Both the
68
+ * one-shot path (`AiRunner.buildPromptCommand`) and the team-mode path
69
+ * (`TeamOrchestrator.startAgent`) resolve argv through this single function
70
+ * so equivalent `PromptOptions` produce equivalent argv (R5 parity).
71
+ */
72
+ export declare function buildAgentCommand(agent: AgentName, promptOptions: PromptOptions, context: {
73
+ workspace: string;
74
+ }): ShimCommand;
65
75
  //# sourceMappingURL=ai-runner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ai-runner.d.ts","sourceRoot":"","sources":["../src/ai-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAa,KAAK,MAAM,EAAc,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAGH,KAAK,eAAe,EAEpB,KAAK,UAAU,EAClB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,SAAS,EAAgB,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACpG,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAInE,0DAA0D;AAC1D,MAAM,WAAW,cAAc;IAC3B,uEAAuE;IACvE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,sCAAsC;AACtC,MAAM,WAAW,eAAe;IAC5B,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,OAAO,CAAC,E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