@phnx-labs/agents-cli 1.23.52 → 1.23.54
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 +8 -0
- package/README.md +1 -1
- package/dist/commands/exec.js +4 -4
- package/dist/commands/recordings.js +1 -1
- package/dist/lib/accounting/rotate.js +5 -3
- package/dist/lib/add-dir.js +1 -1
- package/dist/lib/agent-spec/agents.js +1 -1
- package/dist/lib/exec.d.ts +3 -2
- package/dist/lib/exec.js +11 -6
- package/dist/lib/models.js +1 -1
- package/dist/lib/pricing/prices.json +31 -1
- package/dist/lib/profiles-presets.js +1 -1
- package/dist/lib/recordings/config.js +16 -2
- package/dist/lib/teams/parsers.js +73 -30
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.23.54
|
|
4
|
+
|
|
5
|
+
- **`agents recordings` keeps its ledger under `~/.agents/.history/recordings/`.** It wrote `config.json` and `ledger.json` to `~/.agents/recordings/`, the root of your tracked resources repo, so they showed up as untracked files there. An existing `~/.agents/recordings/` is moved on first use, so already-published recordings keep their rows and are not uploaded again. Source: `cli/src/lib/recordings/config.ts`.
|
|
6
|
+
|
|
7
|
+
## 1.23.53
|
|
8
|
+
|
|
9
|
+
- **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`.
|
|
10
|
+
|
|
3
11
|
## 1.23.52
|
|
4
12
|
|
|
5
13
|
- **`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`.
|
package/README.md
CHANGED
|
@@ -421,7 +421,7 @@ Install `ffmpeg` and `@phnx-labs/artifacts-cli`, then sign in to `artifacts` wit
|
|
|
421
421
|
organization email. Every publish uses `--visibility org --expire never`; public inbox
|
|
422
422
|
identities are refused rather than turning a team recording into a personal artifact.
|
|
423
423
|
CleanShot re-exports such as `… AM 3.mp4` replace the earlier artifact at the same slug.
|
|
424
|
-
The restart-safe ledger is `~/.agents/recordings/ledger.json`. See
|
|
424
|
+
The restart-safe ledger is `~/.agents/.history/recordings/ledger.json`. See
|
|
425
425
|
[the recordings guide](cli/docs/recordings.md) for the data flow and failure behavior.
|
|
426
426
|
|
|
427
427
|
### Back up sessions off-box
|
package/dist/commands/exec.js
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
|
@@ -99,7 +99,7 @@ agents recordings watch --dir ~/Movies/CleanShot`,
|
|
|
99
99
|
setHelpSections(list, {
|
|
100
100
|
examples: `agents recordings list
|
|
101
101
|
agents recordings list --json`,
|
|
102
|
-
notes: 'The ledger lives at ~/.agents/recordings/ledger.json and is reused after daemon restarts.',
|
|
102
|
+
notes: 'The ledger lives at ~/.agents/.history/recordings/ledger.json and is reused after daemon restarts.',
|
|
103
103
|
});
|
|
104
104
|
const upload = command.command('upload <file>')
|
|
105
105
|
.description('Transcode and publish one recording through the watcher pipeline.')
|
|
@@ -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 =
|
|
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 =
|
|
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 {
|
package/dist/lib/add-dir.js
CHANGED
|
@@ -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',
|
package/dist/lib/exec.d.ts
CHANGED
|
@@ -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
|
|
24
|
-
*
|
|
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
|
|
108
|
-
*
|
|
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: '
|
|
429
|
+
promptFlag: '--print',
|
|
430
|
+
interactivePromptFlag: '--prompt-interactive',
|
|
431
431
|
modeFlags: {
|
|
432
|
-
|
|
432
|
+
plan: ['--mode', 'plan'],
|
|
433
|
+
edit: ['--mode', 'accept-edits'],
|
|
433
434
|
skip: ['--dangerously-skip-permissions'],
|
|
434
435
|
},
|
|
435
|
-
|
|
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
|
}
|
package/dist/lib/models.js
CHANGED
|
@@ -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-
|
|
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
|
|
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,10 +1,24 @@
|
|
|
1
1
|
import * as fs from 'node:fs/promises';
|
|
2
|
+
import { existsSync, mkdirSync, renameSync } from 'node:fs';
|
|
2
3
|
import * as path from 'node:path';
|
|
3
|
-
import { getUserAgentsDir } from '../state.js';
|
|
4
|
+
import { getHistoryDir, getUserAgentsDir } from '../state.js';
|
|
4
5
|
import { atomicWriteFile } from '../fs-atomic.js';
|
|
5
6
|
import { runProcess } from './process.js';
|
|
6
7
|
export function recordingsStateDir() {
|
|
7
|
-
|
|
8
|
+
const dir = path.join(getHistoryDir(), 'recordings');
|
|
9
|
+
const legacy = path.join(getUserAgentsDir(), 'recordings');
|
|
10
|
+
if (!existsSync(dir) && existsSync(legacy)) {
|
|
11
|
+
mkdirSync(getHistoryDir(), { recursive: true, mode: 0o700 });
|
|
12
|
+
try {
|
|
13
|
+
renameSync(legacy, dir);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
const code = error.code;
|
|
17
|
+
if (code !== 'ENOENT' && code !== 'EEXIST' && code !== 'ENOTEMPTY')
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return dir;
|
|
8
22
|
}
|
|
9
23
|
export function recordingsConfigPath() {
|
|
10
24
|
return path.join(recordingsStateDir(), 'config.json');
|
|
@@ -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
|
|
1104
|
-
|
|
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:
|
|
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 (
|
|
1112
|
+
if (event === 'result') {
|
|
1125
1113
|
return [{
|
|
1126
1114
|
type: 'result',
|
|
1127
1115
|
agent: 'antigravity',
|
|
1128
|
-
status:
|
|
1129
|
-
session_id:
|
|
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:
|
|
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.
|
|
3
|
+
"version": "1.23.54",
|
|
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",
|