@phnx-labs/agents-cli 1.23.51 → 1.23.53

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.23.53
4
+
5
+ - **Antigravity runs headless with JSON, resume, plan, effort and extra directories, and picks only a login it will actually use.** `agents run antigravity "…" --json` passes `agy --output-format stream-json` (the old TODO said it was broken upstream; agy 1.5.16 streams `init`, `step_update` and `result` events), and `agents teams` now parses those events into messages, `bash`, `file_create`/`file_write` and results instead of `unknown`. `--resume <id>` maps to `agy --conversation <id>` (agy 1.1.27+). `--mode plan` maps to `agy --mode plan` and runs read-only headless, so it no longer degrades to a writable run; `--mode edit` maps to `agy --mode accept-edits`. `-e/--effort` passes `agy --effort <level>` and `--add-dir` passes `agy --add-dir`, where both were silently dropped. Under `--strategy balanced`, an Antigravity version counted as signed in when its own home held a token, but agy reads whichever home `~/.gemini/antigravity-cli` points at, so the run asked for a Google login and timed out after 60 s. A symlink-adopted harness (antigravity, droid, goose and the others without a config env) now counts a version as launchable only while the symlink names its home; `agents use antigravity@<version>` switches it. The same verdict feeds `launchable` in fleet probes, the accounts limits column and the `run.launch` event's `signedIn`. The `agy` preset no longer claims a gemini-3.5-flash default, and `prices.json` adds Gemini 4 Carbon, Argon, Neon and Hydrogen, Gemini 3.8 Flash and Gemini 3.1 Pro at Google's list prices after the introductory prices end (2026-12-01 for Carbon and Argon, 2027-01-01 for 3.8 Flash). Source: `cli/src/lib/exec.ts`, `cli/src/lib/teams/parsers.ts`, `cli/src/lib/accounting/rotate.ts`, `cli/src/lib/models.ts`, `cli/src/lib/add-dir.ts`, `cli/src/lib/pricing/prices.json`.
6
+
7
+ ## 1.23.52
8
+
9
+ - **`agents browser` (and `computer`, `secrets`, `sessions`) now explain the alias that sent you there (PHNX-4641).** With `alias browser="agents browser"` in `~/.zshrc`, every `browser` call hit the removed-group error, and its advice, `browser --help`, looped straight back into it. The error now names the standalone binary by absolute path (`/opt/homebrew/bin/browser doctor`), says a shell alias or function is the likely cause (`type browser` shows it), and, when it finds one in `~/.zshrc`, `~/.zshenv`, `~/.zprofile`, `~/.bashrc`, `~/.bash_aliases`, `~/.bash_profile`, `~/.profile` or `~/.config/fish/config.fish`, names the file and line with the fix: delete it, then `unalias browser`. The scan is read-only and never edits an rc file. Source: `cli/src/lib/startup/command-registry.ts`, `cli/src/lib/startup/shadowing-alias.ts`.
10
+
3
11
  ## 1.23.51
4
12
 
5
13
  - **Every session gets a workstream, and titles come in one batched call.** The `session-title` daemon service now names up to 12 sessions per tick in ONE cheap-model call instead of one call per session, and each reply carries a `workstream` beside the title: 1 to 3 words naming the larger effort ("Rush Mac", "Ahrefs SEO"). The call is shown the workstreams this box already uses, so related sessions share one name. A session keeps its workstream until its first message changes, and a `/rename`d session keeps its name and only gets a workstream. The field rides `agents ps --json`, `ps watch --json`, `feed watch --json`, history rows and the fleet session mirror, so AGI EXT can group sessions by what they are about. Schema v55 adds `sessions.workstream`. Source: `cli/src/lib/session/title.ts`, `cli/src/lib/session/db.ts`, `cli/src/lib/session/active.ts`, `cli/src/lib/session/remote/watch.ts`, `cli/src/lib/session/mirror.ts`.
@@ -408,7 +408,7 @@ export function registerRunCommand(program) {
408
408
  .command('run [agent] [prompt]')
409
409
  .description('Execute an agent. Pass a prompt for headless runs; omit it to launch the agent interactively. With --broadcast, run the same prompt/task across an agent × model matrix.')
410
410
  .option('-m, --mode <mode>', 'How much the agent can do: plan (read-only), edit (can write files), auto (more autonomous than edit, mechanism per-harness: smart classifier auto-approves safe ops and still prompts for risky ones on Claude/Copilot; approval_policy=never over the edit sandbox on Codex, which never prompts; Grok\'s native --permission-mode auto), skip (bypass all permission prompts). Omitted, no permission flag is passed and the harness\'s own settings decide (Codex\'s launcher applies its edit policy); set a default with agents config set run.<agent>@*.mode <mode>. \'full\' accepted as alias for skip.', 'plan')
411
- .option('-e, --effort <effort>', 'Reasoning effort: low | medium | high | xhigh | max | auto (claude and codex only)', 'auto')
411
+ .option('-e, --effort <effort>', 'Reasoning effort: low | medium | high | xhigh | max | auto (claude, codex, antigravity, droid, grok, muse)', 'auto')
412
412
  .option('--model <model>', 'Cost tier (cheap|default|best|ultra) or a concrete model id; tiers resolve per harness+version to a supported model')
413
413
  .option('--env <key=value>', 'Pass environment variable to the agent (repeatable, e.g., --env DEBUG=1 --env API_KEY=xyz)', (val, prev) => [...prev, val], [])
414
414
  .option('--secrets <bundle>', 'Inject a secrets bundle (repeatable). Values resolve from macOS Keychain at run time. See `secrets --help`.', (val, prev) => [...prev, val], [])
@@ -417,7 +417,7 @@ export function registerRunCommand(program) {
417
417
  .option('--allow-expired', 'Inject secrets even if their expiry date has passed (overrides the pre-run expiry abort).')
418
418
  .option('--cwd <dir>', 'Working directory for the agent (defaults to current directory). With --device, the directory ON the device.')
419
419
  .option('-P, --project <ref>', 'Project shorthand <slug>[@worktree], resolved against your projects root (auto-inferred, cached). Sets the cwd locally or on --device.')
420
- .option('--add-dir <dir>', 'Grant access to an additional directory outside the project (Claude, Codex, Cursor, Kimi, Grok; repeatable)', (val, prev) => [...prev, val], [])
420
+ .option('--add-dir <dir>', 'Grant access to an additional directory outside the project (Claude, Codex, Cursor, Kimi, Grok, Antigravity; repeatable)', (val, prev) => [...prev, val], [])
421
421
  .option('--json', 'Stream events as JSON lines (for parsing by other tools)')
422
422
  .option('--quiet', 'Suppress preamble (rotation banner, "Running:" line). Useful when piping JSON events to a parser.', false)
423
423
  .option('--headless', 'Force headless mode. Auto-enabled when a prompt is provided; pass explicitly to stay headless with no prompt (reads the prompt from stdin).', false)
@@ -571,8 +571,8 @@ agents run auto --device yosemite-s0 "fix the flaky test" # pin the device
571
571
  ${formatModeSupportTable().split('\n').map((line) => ` ${line}`).join('\n')}
572
572
 
573
573
  Headless plan support (a prompt makes the run headless):
574
- plan works headless on claude, codex, cursor, droid, opencode.
575
- kimi, grok, antigravity have no headless plan mode — a headless
574
+ plan works headless on claude, codex, cursor, droid, opencode, antigravity.
575
+ kimi and grok have no headless plan mode — a headless
576
576
  --mode plan auto-downgrades to --mode auto (with a stderr warning).
577
577
  Interactive plan (omit the prompt) works everywhere it is listed.
578
578
 
@@ -9,7 +9,7 @@ import { isTierToken, resolveTier } from '../model-tiers.js';
9
9
  import { listInstalledVersions, getVersionHomePath, resolveVersion } from '../installations/versions.js';
10
10
  import { resolveManagedInstallation } from '../installations/store.js';
11
11
  import { listNativeAccounts, pausedNativeIdentityKeys } from '../account-registry.js';
12
- import { resolveNativeSpawnHome } from '../exec-account-home.js';
12
+ import { adoptedConfigPointsAtHome, resolveNativeSpawnHome } from '../exec-account-home.js';
13
13
  import { getProjectRunConfigs } from '../run-config.js';
14
14
  import { emit } from '../feed/events.js';
15
15
  import { getUsageInfoByIdentity, getUsageLookupKey, deriveUsageStatusFromSnapshot, getClaudeModelRefusal, claudeModelRefusalKey, } from './usage.js';
@@ -63,7 +63,8 @@ export function isLaunchableSignedIn(signedIn, presence) {
63
63
  export async function isVersionLaunchableHere(agent, version) {
64
64
  const home = getVersionHomePath(agent, version);
65
65
  const info = await getAccountInfo(agent, home);
66
- const launchable = isLaunchableSignedIn(info.signedIn, credentialPresence(agent, home));
66
+ const launchable = adoptedConfigPointsAtHome(agent, home)
67
+ && isLaunchableSignedIn(info.signedIn, credentialPresence(agent, home));
67
68
  return { launchable, email: launchable ? info.email : null };
68
69
  }
69
70
  export const USAGE_DECISION_MAX_AGE_MS = 5 * 60 * 1000;
@@ -427,7 +428,8 @@ export async function collectRunCandidates(agent) {
427
428
  if (fs.existsSync(home) && slotDirs.has(fs.realpathSync(home)))
428
429
  return null;
429
430
  const info = await getAccountInfo(agent, home);
430
- const launchable = isLaunchableSignedIn(info.signedIn, credentialPresence(agent, home));
431
+ const launchable = adoptedConfigPointsAtHome(agent, home)
432
+ && isLaunchableSignedIn(info.signedIn, credentialPresence(agent, home));
431
433
  const authHealth = authCache[authCacheKey(localHost, agent, version)];
432
434
  const authVerdict = authHealth?.verdict ?? null;
433
435
  return {
@@ -12,7 +12,7 @@ export const ADD_DIR_STRATEGY = {
12
12
  copilot: 'none',
13
13
  amp: 'none',
14
14
  goose: 'none',
15
- antigravity: 'none',
15
+ antigravity: 'native-flag',
16
16
  droid: 'none',
17
17
  hermes: 'none',
18
18
  muse: 'none',
@@ -444,7 +444,7 @@ export const AGENTS = {
444
444
  variableSyntax: '{{args}}',
445
445
  supportsHooks: true,
446
446
  cloudProvider: 'antigravity',
447
- capabilities: { hooks: true, mcp: true, mcpHttp: false, mcpHeaders: false, allowlist: true, ask: true, skills: true, commands: true, plugins: true, subagents: { since: '1.0.16' }, rules: { file: 'AGENTS.md' }, workflows: { since: '1.0.6' }, memory: false, modes: ['edit', 'skip'], rulesImports: false, interactiveRepl: true },
447
+ capabilities: { hooks: true, mcp: true, mcpHttp: false, mcpHeaders: false, allowlist: true, ask: true, skills: true, commands: true, plugins: true, subagents: { since: '1.0.16' }, rules: { file: 'AGENTS.md' }, workflows: { since: '1.0.6' }, memory: false, modes: ['plan', 'edit', 'skip'], rulesImports: false, interactiveRepl: true },
448
448
  },
449
449
  grok: {
450
450
  id: 'grok',
@@ -20,8 +20,8 @@ export declare function resolveMode(agent: AgentId, requested: Mode): Mode;
20
20
  * `--prompt` + `--plan`, and grok's `--permission-mode plan` silently stalls at
21
21
  * its ExitPlanMode gate. For those agents, a headless plan request degrades to
22
22
  * `auto` (kimi -p auto-runs; grok runs `--permission-mode auto`) with a visible
23
- * one-line stderr warning, mirroring the graceful plan→edit degrade antigravity
24
- * get for having no plan flag at all. Interactive runs are never
23
+ * one-line stderr warning, mirroring the graceful plan→edit degrade a harness
24
+ * with no plan flag at all gets. Interactive runs are never
25
25
  * downgraded. This is the single source of truth shared by buildExecCommand
26
26
  * (agents run / teams).
27
27
  */
@@ -113,6 +113,7 @@ interface AgentCommandTemplate {
113
113
  jsonFlags?: string[];
114
114
  modelFlag?: string;
115
115
  printFlags?: string[];
116
+ interactivePromptFlag?: string;
116
117
  verboseFlag?: string;
117
118
  nameFlag?: string;
118
119
  resume?: ({
package/dist/lib/exec.js CHANGED
@@ -104,8 +104,8 @@ export function resolveMode(agent, requested) {
104
104
  * `--prompt` + `--plan`, and grok's `--permission-mode plan` silently stalls at
105
105
  * its ExitPlanMode gate. For those agents, a headless plan request degrades to
106
106
  * `auto` (kimi -p auto-runs; grok runs `--permission-mode auto`) with a visible
107
- * one-line stderr warning, mirroring the graceful plan→edit degrade antigravity
108
- * get for having no plan flag at all. Interactive runs are never
107
+ * one-line stderr warning, mirroring the graceful plan→edit degrade a harness
108
+ * with no plan flag at all gets. Interactive runs are never
109
109
  * downgraded. This is the single source of truth shared by buildExecCommand
110
110
  * (agents run / teams).
111
111
  */
@@ -424,16 +424,18 @@ export const AGENT_COMMANDS = {
424
424
  edit: [],
425
425
  },
426
426
  },
427
- // TODO: --output-format json is documented but currently broken upstream
428
427
  antigravity: {
429
428
  base: ['agy'],
430
- promptFlag: 'positional',
429
+ promptFlag: '--print',
430
+ interactivePromptFlag: '--prompt-interactive',
431
431
  modeFlags: {
432
- edit: [],
432
+ plan: ['--mode', 'plan'],
433
+ edit: ['--mode', 'accept-edits'],
433
434
  skip: ['--dangerously-skip-permissions'],
434
435
  },
435
- printFlags: ['--print'],
436
+ jsonFlags: ['--output-format', 'stream-json'],
436
437
  modelFlag: '--model',
438
+ resume: { flag: '--conversation', since: '1.1.27' },
437
439
  },
438
440
  grok: {
439
441
  base: ['grok'],
@@ -678,6 +680,9 @@ export function buildExecCommand(options) {
678
680
  else if (interactive && options.agent === 'claude') {
679
681
  cmd.push(options.prompt);
680
682
  }
683
+ else if (interactive && template.interactivePromptFlag) {
684
+ cmd.push(template.interactivePromptFlag, options.prompt);
685
+ }
681
686
  else if (template.promptFlag === 'positional') {
682
687
  cmd.push(options.prompt);
683
688
  }
@@ -826,7 +826,7 @@ export function buildReasoningFlags(agent, level) {
826
826
  if (normalized === 'auto') {
827
827
  return agent === 'claude' ? ['--effort', 'auto'] : [];
828
828
  }
829
- if (agent === 'claude') {
829
+ if (agent === 'claude' || agent === 'antigravity') {
830
830
  return ['--effort', normalized];
831
831
  }
832
832
  if (agent === 'codex') {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026-08-05",
2
+ "version": "2026-11-24",
3
3
  "models": {
4
4
  "claude-opus-4": {
5
5
  "inputPerToken": 5e-06,
@@ -136,6 +136,36 @@
136
136
  "outputPerToken": 4.4e-06,
137
137
  "cacheReadPerToken": 2.75e-07
138
138
  },
139
+ "gemini-4-carbon": {
140
+ "inputPerToken": 4e-06,
141
+ "outputPerToken": 2e-05,
142
+ "cacheReadPerToken": 2e-07
143
+ },
144
+ "gemini-4-argon": {
145
+ "inputPerToken": 4e-06,
146
+ "outputPerToken": 2e-05,
147
+ "cacheReadPerToken": 2e-07
148
+ },
149
+ "gemini-4-neon": {
150
+ "inputPerToken": 3e-06,
151
+ "outputPerToken": 1.5e-05,
152
+ "cacheReadPerToken": 1.5e-07
153
+ },
154
+ "gemini-4-hydrogen": {
155
+ "inputPerToken": 1.5e-06,
156
+ "outputPerToken": 7.5e-06,
157
+ "cacheReadPerToken": 7.5e-08
158
+ },
159
+ "gemini-3.8-flash": {
160
+ "inputPerToken": 1.5e-06,
161
+ "outputPerToken": 7.5e-06,
162
+ "cacheReadPerToken": 1.5e-07
163
+ },
164
+ "gemini-3.1-pro": {
165
+ "inputPerToken": 2e-06,
166
+ "outputPerToken": 1.2e-05,
167
+ "cacheReadPerToken": 2e-07
168
+ },
139
169
  "gemini-2.5-pro": {
140
170
  "inputPerToken": 1.25e-06,
141
171
  "outputPerToken": 1e-05,
@@ -141,7 +141,7 @@ export const PRESETS = [
141
141
  },
142
142
  {
143
143
  name: 'agy',
144
- description: 'Google Antigravity CLI default (gemini-3.5-flash). Optimized for speed and large context.',
144
+ description: 'Google Antigravity CLI (agy) on its own default model. `agy models` lists the Gemini 4 family and Gemini 3.8 Flash.',
145
145
  provider: 'google',
146
146
  host: 'antigravity',
147
147
  authEnvVar: 'ANTIGRAVITY_API_KEY',
@@ -1,3 +1,6 @@
1
+ import * as os from 'os';
2
+ import { findExecutable } from '../platform/exec.js';
3
+ import { findShadowingDefinition, shadowFixCommand } from './shadowing-alias.js';
1
4
  const LOADED_COMMAND_NAMES = [
2
5
  'accounts', 'auth', 'view', 'inspect', 'commands', 'hooks', 'skills', 'rules', 'memory',
3
6
  'permissions', 'mcp', 'clis', 'subagents', 'plugins', 'workflows', 'add', 'use',
@@ -105,7 +108,21 @@ export function removedToolGroupMessage(group, rest) {
105
108
  ? `error: 'agents sessions --roots' was removed; use 'agents daemon index roots'.`
106
109
  : `error: 'agents sessions --active' was removed; use 'agents ps'.`;
107
110
  }
108
- return `error: 'agents ${group}' was removed; use the standalone '${group}' CLI (${group} --help).`;
111
+ return standaloneGroupMessage(group);
112
+ }
113
+ const STANDALONE_CHECK_VERB = { browser: 'doctor' };
114
+ function standaloneGroupMessage(group) {
115
+ const binary = findExecutable(group);
116
+ const next = binary ? `(${binary} ${STANDALONE_CHECK_VERB[group] ?? '--help'})` : `(none is on PATH)`;
117
+ const shadow = findShadowingDefinition(group, os.homedir());
118
+ const fix = shadow
119
+ ? `~/${shadow.file}:${shadow.line} defines it: delete that ${shadow.kind === 'alias' ? 'line' : 'function'}, then run '${shadowFixCommand(group, shadow)}'.`
120
+ : `If so, remove it from your shell rc file, then run 'unalias ${group}' (or 'unset -f ${group}' for a function).`;
121
+ return [
122
+ `error: 'agents ${group}' was removed; use the standalone '${group}' CLI ${next}.`,
123
+ `If you typed '${group}', a shell alias or function sends it here; 'type ${group}' shows it.`,
124
+ fix,
125
+ ].join('\n');
109
126
  }
110
127
  export function isKnownTopLevelCommand(name) {
111
128
  return KNOWN_TOP_LEVEL_COMMANDS.has(name);
@@ -0,0 +1,8 @@
1
+ export interface ShadowingDefinition {
2
+ kind: 'alias' | 'function';
3
+ file: string;
4
+ line: number;
5
+ fish: boolean;
6
+ }
7
+ export declare function findShadowingDefinition(group: string, home: string): ShadowingDefinition | undefined;
8
+ export declare function shadowFixCommand(group: string, def: ShadowingDefinition): string;
@@ -0,0 +1,66 @@
1
+ import * as fs from 'fs';
2
+ import * as path from 'path';
3
+ const RC_FILES = [
4
+ '.zshrc', '.zshenv', '.zprofile', '.bashrc', '.bash_aliases', '.bash_profile', '.profile',
5
+ '.config/fish/config.fish',
6
+ ];
7
+ const MAX_RC_BYTES = 1024 * 1024;
8
+ const MAX_FUNCTION_LINES = 20;
9
+ function escapeRegExp(value) {
10
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
11
+ }
12
+ export function findShadowingDefinition(group, home) {
13
+ const name = `${escapeRegExp(group)}(?![\\w-])`;
14
+ const callsAgents = new RegExp(`(?:^|[\\s'"/;&|({])(?:agents|ag)\\s+${name}`);
15
+ const alias = new RegExp(`^\\s*alias\\s+(?:-\\w+\\s+)*(?:--\\s+)?${name}(?:=|\\s+)(.*)$`);
16
+ const fn = new RegExp(`^\\s*(?:function\\s+${name}|${name}\\s*\\(\\s*\\))(.*)$`);
17
+ const comment = /^\s*#/;
18
+ for (const file of RC_FILES) {
19
+ const full = path.join(home, file);
20
+ let text;
21
+ try {
22
+ const stat = fs.statSync(full);
23
+ if (!stat.isFile() || stat.size > MAX_RC_BYTES)
24
+ continue;
25
+ text = fs.readFileSync(full, 'utf-8');
26
+ }
27
+ catch {
28
+ continue;
29
+ }
30
+ const fish = file.endsWith('.fish');
31
+ const lines = text.split(/\r?\n/);
32
+ for (let i = 0; i < lines.length; i++) {
33
+ const aliasMatch = alias.exec(lines[i]);
34
+ if (aliasMatch && callsAgents.test(aliasMatch[1])) {
35
+ return { kind: 'alias', file, line: i + 1, fish };
36
+ }
37
+ const fnMatch = fn.exec(lines[i]);
38
+ if (!fnMatch)
39
+ continue;
40
+ const header = fnMatch[1];
41
+ if (callsAgents.test(header))
42
+ return { kind: 'function', file, line: i + 1, fish };
43
+ if (/\}\s*;?\s*$/.test(header))
44
+ continue;
45
+ let depth = 0;
46
+ const end = Math.min(lines.length, i + MAX_FUNCTION_LINES);
47
+ for (let j = i + 1; j < end; j++) {
48
+ const body = lines[j];
49
+ if (comment.test(body))
50
+ continue;
51
+ if (callsAgents.test(body))
52
+ return { kind: 'function', file, line: i + 1, fish };
53
+ if (fish && /^\s*(?:if|for|while|switch|begin|function)\b/.test(body))
54
+ depth++;
55
+ if (/^\s*(?:\}|end\b)/.test(body) && depth-- === 0)
56
+ break;
57
+ }
58
+ }
59
+ }
60
+ return undefined;
61
+ }
62
+ export function shadowFixCommand(group, def) {
63
+ if (def.fish)
64
+ return `functions --erase ${group}`;
65
+ return def.kind === 'alias' ? `unalias ${group}` : `unset -f ${group}`;
66
+ }
@@ -1079,19 +1079,15 @@ function extractDroidToolResultContent(content) {
1079
1079
  }
1080
1080
  return '';
1081
1081
  }
1082
+ const ANTIGRAVITY_FILE_TOOLS = {
1083
+ write_file: 'file_create',
1084
+ edit_file: 'file_write',
1085
+ replace_file_content: 'file_write',
1086
+ multi_replace_file_content: 'file_write',
1087
+ view_file: 'file_read',
1088
+ };
1082
1089
  function normalizeAntigravity(raw) {
1083
1090
  const timestamp = new Date().toISOString();
1084
- if (typeof raw === 'string') {
1085
- if (!raw)
1086
- return [];
1087
- return [{
1088
- type: 'message',
1089
- agent: 'antigravity',
1090
- content: raw,
1091
- complete: true,
1092
- timestamp: timestamp,
1093
- }];
1094
- }
1095
1091
  if (!raw || typeof raw !== 'object') {
1096
1092
  return [{
1097
1093
  type: 'unknown',
@@ -1100,38 +1096,85 @@ function normalizeAntigravity(raw) {
1100
1096
  timestamp: timestamp,
1101
1097
  }];
1102
1098
  }
1103
- const eventType = raw.type || 'unknown';
1104
- if (eventType === 'init') {
1099
+ const event = typeof raw.event === 'string' ? raw.event : 'unknown';
1100
+ const body = raw[event] && typeof raw[event] === 'object' ? raw[event] : {};
1101
+ const sessionId = typeof raw.conversation_id === 'string'
1102
+ ? raw.conversation_id
1103
+ : typeof body.conversation_id === 'string' ? body.conversation_id : null;
1104
+ if (event === 'init') {
1105
1105
  return [{
1106
1106
  type: 'init',
1107
1107
  agent: 'antigravity',
1108
- session_id: typeof raw.sessionId === 'string' ? raw.sessionId : null,
1109
- timestamp: timestamp,
1110
- }];
1111
- }
1112
- if (eventType === 'message') {
1113
- const content = typeof raw.content === 'string' ? raw.content : '';
1114
- if (!content)
1115
- return [];
1116
- return [{
1117
- type: 'message',
1118
- agent: 'antigravity',
1119
- content: content,
1120
- complete: raw.complete !== false,
1108
+ session_id: sessionId,
1121
1109
  timestamp: timestamp,
1122
1110
  }];
1123
1111
  }
1124
- if (eventType === 'result') {
1112
+ if (event === 'result') {
1125
1113
  return [{
1126
1114
  type: 'result',
1127
1115
  agent: 'antigravity',
1128
- status: raw.status === 'error' ? 'error' : 'success',
1129
- session_id: typeof raw.sessionId === 'string' ? raw.sessionId : null,
1116
+ status: body.status === 'SUCCESS' ? 'success' : 'error',
1117
+ session_id: sessionId,
1130
1118
  timestamp: timestamp,
1131
1119
  }];
1132
1120
  }
1121
+ if (event === 'step_update') {
1122
+ if (body.step_type === 'user_input')
1123
+ return [];
1124
+ if (body.step_type === 'agent_response') {
1125
+ const delta = typeof body.text_delta === 'string' ? body.text_delta : '';
1126
+ if (!delta)
1127
+ return [];
1128
+ return [{
1129
+ type: 'message',
1130
+ agent: 'antigravity',
1131
+ content: delta,
1132
+ complete: false,
1133
+ timestamp: timestamp,
1134
+ }];
1135
+ }
1136
+ if (body.step_type === 'tool') {
1137
+ const info = body.tool_info && typeof body.tool_info === 'object' ? body.tool_info : {};
1138
+ const toolName = typeof info.name === 'string' ? info.name : 'unknown';
1139
+ const params = info.parameters && typeof info.parameters === 'object' ? info.parameters : {};
1140
+ if (body.state === 'DONE') {
1141
+ return [{
1142
+ type: 'tool_result',
1143
+ agent: 'antigravity',
1144
+ tool: toolName,
1145
+ success: !body.error,
1146
+ content: typeof info.output === 'string' ? info.output : '',
1147
+ timestamp: timestamp,
1148
+ }];
1149
+ }
1150
+ const command = typeof params.CommandLine === 'string' ? params.CommandLine : '';
1151
+ if (toolName === 'run_command' && command) {
1152
+ const events = [{ type: 'bash', agent: 'antigravity', tool: toolName, command, timestamp }];
1153
+ const [filesRead, filesWritten, filesDeleted] = extractFileOpsFromBash(command);
1154
+ for (const p of filesRead)
1155
+ events.push({ type: 'file_read', agent: 'antigravity', tool: 'bash', path: p, command, timestamp });
1156
+ for (const p of filesWritten)
1157
+ events.push({ type: 'file_write', agent: 'antigravity', tool: 'bash', path: p, command, timestamp });
1158
+ for (const p of filesDeleted)
1159
+ events.push({ type: 'file_delete', agent: 'antigravity', tool: 'bash', path: p, command, timestamp });
1160
+ return events;
1161
+ }
1162
+ const fileType = ANTIGRAVITY_FILE_TOOLS[toolName];
1163
+ const filePath = typeof params.Path === 'string' ? params.Path : '';
1164
+ if (fileType && filePath) {
1165
+ return [{ type: fileType, agent: 'antigravity', tool: toolName, path: filePath, timestamp }];
1166
+ }
1167
+ return [{
1168
+ type: 'tool_use',
1169
+ agent: 'antigravity',
1170
+ tool: toolName,
1171
+ args: params,
1172
+ timestamp: timestamp,
1173
+ }];
1174
+ }
1175
+ }
1133
1176
  return [{
1134
- type: eventType,
1177
+ type: event,
1135
1178
  agent: 'antigravity',
1136
1179
  raw: raw,
1137
1180
  timestamp: timestamp,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phnx-labs/agents-cli",
3
- "version": "1.23.51",
3
+ "version": "1.23.53",
4
4
  "description": "One CLI for all your AI coding agents - versions, config, cloud dispatch, sessions, and teams (now with first-class Grok Build CLI support)",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",