@jini-ai/agent-runtime 0.3.0 → 0.3.2

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 (86) hide show
  1. package/dist/auth.js +1 -1
  2. package/dist/capabilities.d.ts +1 -1
  3. package/dist/claude-stream.d.ts +1 -1
  4. package/dist/claude-stream.js +1 -1
  5. package/dist/defs/aider.d.ts.map +1 -1
  6. package/dist/defs/aider.js +0 -7
  7. package/dist/defs/aider.js.map +1 -1
  8. package/dist/defs/amp.d.ts.map +1 -1
  9. package/dist/defs/amp.js +0 -9
  10. package/dist/defs/amp.js.map +1 -1
  11. package/dist/defs/amr.d.ts +0 -1
  12. package/dist/defs/amr.d.ts.map +1 -1
  13. package/dist/defs/amr.js +0 -7
  14. package/dist/defs/amr.js.map +1 -1
  15. package/dist/defs/antigravity.d.ts +29 -26
  16. package/dist/defs/antigravity.d.ts.map +1 -1
  17. package/dist/defs/antigravity.js +158 -243
  18. package/dist/defs/antigravity.js.map +1 -1
  19. package/dist/defs/claude.d.ts +5 -0
  20. package/dist/defs/claude.d.ts.map +1 -1
  21. package/dist/defs/claude.js +12 -9
  22. package/dist/defs/claude.js.map +1 -1
  23. package/dist/defs/codex.d.ts +2 -1
  24. package/dist/defs/codex.d.ts.map +1 -1
  25. package/dist/defs/codex.js +23 -1
  26. package/dist/defs/codex.js.map +1 -1
  27. package/dist/defs/copilot.d.ts.map +1 -1
  28. package/dist/defs/copilot.js +0 -11
  29. package/dist/defs/copilot.js.map +1 -1
  30. package/dist/defs/cursor-agent.d.ts.map +1 -1
  31. package/dist/defs/cursor-agent.js +0 -11
  32. package/dist/defs/cursor-agent.js.map +1 -1
  33. package/dist/defs/deepseek.d.ts.map +1 -1
  34. package/dist/defs/deepseek.js +0 -12
  35. package/dist/defs/deepseek.js.map +1 -1
  36. package/dist/defs/grok-build.d.ts.map +1 -1
  37. package/dist/defs/grok-build.js +0 -10
  38. package/dist/defs/grok-build.js.map +1 -1
  39. package/dist/defs/opencode.d.ts +4 -0
  40. package/dist/defs/opencode.d.ts.map +1 -1
  41. package/dist/defs/opencode.js +19 -0
  42. package/dist/defs/opencode.js.map +1 -1
  43. package/dist/defs/pi.d.ts +4 -0
  44. package/dist/defs/pi.d.ts.map +1 -1
  45. package/dist/defs/pi.js +10 -3
  46. package/dist/defs/pi.js.map +1 -1
  47. package/dist/defs/qoder.d.ts.map +1 -1
  48. package/dist/defs/qoder.js +0 -11
  49. package/dist/defs/qoder.js.map +1 -1
  50. package/dist/defs/qwen.d.ts.map +1 -1
  51. package/dist/defs/qwen.js +0 -9
  52. package/dist/defs/qwen.js.map +1 -1
  53. package/dist/defs/reasonix.d.ts +4 -0
  54. package/dist/defs/reasonix.d.ts.map +1 -1
  55. package/dist/defs/reasonix.js +16 -6
  56. package/dist/defs/reasonix.js.map +1 -1
  57. package/dist/env.js +1 -1
  58. package/dist/executables.js +1 -1
  59. package/dist/invocation.js +1 -1
  60. package/dist/json-event-stream.d.ts.map +1 -1
  61. package/dist/json-event-stream.js +63 -0
  62. package/dist/json-event-stream.js.map +1 -1
  63. package/dist/launch.js +1 -1
  64. package/dist/mcp.d.ts +1 -1
  65. package/dist/metadata.d.ts +1 -1
  66. package/dist/mmd-routes.js +1 -1
  67. package/dist/models.d.ts +1 -1
  68. package/dist/opencode-log.js +1 -1
  69. package/dist/paths.js +1 -1
  70. package/dist/prompt-augmenter.d.ts +1 -1
  71. package/dist/prompt-augmenter.js +1 -1
  72. package/dist/prompt-budget.d.ts +1 -1
  73. package/dist/prompt-file.js +1 -1
  74. package/dist/providers/anthropic-messages.d.ts +1 -1
  75. package/dist/providers/anthropic-messages.js +1 -1
  76. package/dist/qoder-stream.d.ts +1 -1
  77. package/dist/qoder-stream.js +1 -1
  78. package/dist/registry.d.ts +16 -0
  79. package/dist/registry.d.ts.map +1 -1
  80. package/dist/registry.js +19 -1
  81. package/dist/registry.js.map +1 -1
  82. package/dist/resolution.js +1 -1
  83. package/dist/terminal-launch.js +1 -1
  84. package/dist/types.d.ts +57 -3
  85. package/dist/types.d.ts.map +1 -1
  86. package/package.json +2 -2
@@ -1,146 +1,32 @@
1
1
  /** Ported verbatim from OD's `apps/daemon/src/runtimes/defs/antigravity.ts` (import path adjusted only). See `source-map.md`. */
2
- import { existsSync, mkdirSync, readFileSync, writeFileSync, } from 'node:fs';
3
- import { readFile as fsReadFile } from 'node:fs/promises';
4
- import { homedir } from 'node:os';
5
- import { dirname, join } from 'node:path';
6
2
  import { DEFAULT_MODEL_OPTION } from './shared.js';
7
- // `agy` v1.0.3 still has no `--model` flag (upstream issue #35), but the
8
- // TUI's Switch-Model picker writes the choice to its settings.json, and
9
- // every `agy -p` invocation re-reads that file on startup verified by
10
- // capturing the `--log-file` line `Propagating selected model override to
11
- // backend: label="<model>"`. So we can route OD's model picker through
12
- // settings.json: when the user picks a concrete model in Settings, the
13
- // daemon writes the label into agy's settings.json right before spawn,
14
- // and the resulting print-mode run uses that model.
3
+ // `agy` v1.1.24 has a real `--model <id>` flag (`agy --help`: "Model for the current CLI
4
+ // session") plus a machine-readable `agy models` subcommand that lists every selectable model as
5
+ // a stable `<slug>\t<label>` pair both verified live, neither true of the v1.0.3 this file used
6
+ // to target (upstream issue #35, closed by the flag's addition). That retires the
7
+ // settings.json-write-then-poll-the-log workaround this file used to carry (see git history for
8
+ // `writeAntigravityModelSelection`/`antigravityModelLock`/`waitForAgyToReadModel`, and the
9
+ // process-global race across concurrent runs it existed to serialize): the model rides argv on
10
+ // `buildArgs` below instead, exactly like every other flag this def emits, and there is nothing
11
+ // left to lock.
15
12
  //
16
- // Two ids the picker exposes are special:
17
- // - 'default' : leave settings.json untouched, so agy keeps
18
- // whatever the user last picked in its own TUI.
19
- // (Respects user choice when they switch models
20
- // from `agy` directly.)
21
- // - any other id : the literal display label agy expects (e.g.
22
- // "Gemini 3.1 Pro (High)", "Claude Sonnet 4.6
23
- // (Thinking)"). We persist it before spawn.
13
+ // Two cases `buildArgs` treats specially:
14
+ // - `DEFAULT_MODEL_OPTION.id` ('default') or no model at all: omit `--model` entirely, so agy
15
+ // keeps whatever it would otherwise default to (its own TUI's last pick, or its own default).
16
+ // - any other id: one of the stable slugs below (e.g. `gemini-3.1-pro-high`), passed verbatim as
17
+ // `--model`'s value.
24
18
  //
25
- // `supportsCustomModel: false` because the label set is a server-side
26
- // enum a typed id agy doesn't recognise resolves to a silent
27
- // `availableModels` cache miss + empty print-mode output, which surfaces
28
- // to the user as a generic "empty response" error.
19
+ // `supportsCustomModel: false` because the model set is still a server-side enum, not free text —
20
+ // but the failure mode for an id outside it changed for the better: `agy --model <bogus> -p ...`
21
+ // now prints a loud `Error: invalid model selection ...` plus the full list of valid models
22
+ // (verified live), rather than the old settings.json path's silent `availableModels` cache miss +
23
+ // empty print-mode output. Kept `false` anyway: nothing here validates a typed id before spawn, so
24
+ // letting a UI send arbitrary text would just move that same failure into production instead of
25
+ // preventing it — `isKnownModel` (`../models.ts`) is what actually gates a caller-supplied id
26
+ // against this list before it ever reaches `buildArgs`.
29
27
  //
30
- // The 8 model labels mirror what `Switch Model` in agy's TUI lists for
31
- // consumer-tier accounts as of 2026-05-28. The set is small and stable
32
- // enough to ship statically until upstream adds a programmatic
33
- // `agy models` subcommand (also tracked under issue #35).
34
- const ANTIGRAVITY_SETTINGS_PATH = join(homedir(), '.gemini', 'antigravity-cli', 'settings.json');
35
- export function writeAntigravityModelSelection(label, settingsPath = ANTIGRAVITY_SETTINGS_PATH) {
36
- let existing = {};
37
- if (existsSync(settingsPath)) {
38
- try {
39
- const parsed = JSON.parse(readFileSync(settingsPath, 'utf8'));
40
- if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
41
- existing = parsed;
42
- }
43
- }
44
- catch {
45
- // Corrupt JSON — fall through and rewrite the file from scratch so
46
- // the next spawn starts from a known-good state.
47
- }
48
- }
49
- existing.model = label;
50
- mkdirSync(dirname(settingsPath), { recursive: true });
51
- writeFileSync(settingsPath, `${JSON.stringify(existing, null, 2)}\n`);
52
- }
53
- // Per-process serialization for write-settings → spawn → agy-reads
54
- // cycles on antigravity. `~/.gemini/antigravity-cli/settings.json` is
55
- // process-global, so two OD runs that both pick concrete (non-default)
56
- // models can race: run A writes model A, spawn A starts, run B writes
57
- // model B before A's agy has read settings.json — A then executes on
58
- // model B. The daemon serialises non-default antigravity spawns
59
- // through this chain: each acquire awaits the previous release, and
60
- // each release fires only after the spawned agy actually emits
61
- // `Propagating selected model override to backend: label="<X>"` in
62
- // its `--log-file` (which is the upstream signal that settings.json
63
- // has been read).
64
- let antigravityLockChain = Promise.resolve();
65
- export async function acquireAntigravityModelLock() {
66
- const previous = antigravityLockChain;
67
- // Definite-assignment assertion (`!`), not a `() => {}` fallback default:
68
- // the ECMAScript spec guarantees a `Promise` executor runs synchronously,
69
- // immediately, during construction — `release = resolve` below has
70
- // already run by the time `new Promise(...)` returns, so a fallback
71
- // no-op default would be assigned, coverage-instrumented, and never once
72
- // invoked. Removing it drops that dead function instead of padding a
73
- // test around code that cannot execute.
74
- let release;
75
- antigravityLockChain = new Promise((resolve) => {
76
- release = resolve;
77
- });
78
- await previous;
79
- return release;
80
- }
81
- // Visible for tests. Resets the module-level lock chain so a test that
82
- // installed a hanging acquirer can release it without leaking state to
83
- // subsequent test cases. Production code never calls this.
84
- export function _resetAntigravityModelLockForTests() {
85
- antigravityLockChain = Promise.resolve();
86
- }
87
- // Polls agy's `--log-file` for the line
88
- // `Propagating selected model override to backend: label="<expectedModel>"`
89
- // which `model_config_manager.go` emits once agy has finished reading
90
- // `~/.gemini/antigravity-cli/settings.json` and sent the model
91
- // override to the upstream backend. Returns true on observed signal,
92
- // false on timeout OR abort. Never throws — a missing log file is
93
- // treated as "not yet seen" so the polling loop keeps retrying until
94
- // either the deadline or the abort signal fires.
95
- //
96
- // IMPORTANT: callers MUST NOT use a `false` return as a "go ahead and
97
- // release the settings.json lock" signal — false means "I gave up
98
- // polling," not "agy definitely didn't read this." Release the lock
99
- // only on (a) a `true` return, OR (b) child exit. See server.ts for
100
- // the wiring.
101
- export async function waitForAgyToReadModel(logFilePath, expectedModel, options = {}) {
102
- const timeoutMs = options.timeoutMs ?? 15_000;
103
- const pollIntervalMs = options.pollIntervalMs ?? 250;
104
- const readFile = options.readFile ?? ((path) => fsReadFile(path, 'utf8'));
105
- const now = options.now ?? Date.now;
106
- const abortSignal = options.abortSignal;
107
- if (abortSignal?.aborted)
108
- return false;
109
- const escaped = expectedModel.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
110
- const pattern = new RegExp(`Propagating selected model override to backend: label="${escaped}"`);
111
- const deadline = now() + timeoutMs;
112
- while (now() < deadline) {
113
- if (abortSignal?.aborted)
114
- return false;
115
- try {
116
- const content = await readFile(logFilePath);
117
- if (pattern.test(content))
118
- return true;
119
- }
120
- catch {
121
- // Log file may not have appeared yet; keep polling.
122
- }
123
- if (now() >= deadline)
124
- break;
125
- await new Promise((resolve) => {
126
- const onAbort = () => {
127
- clearTimeout(timer);
128
- resolve();
129
- };
130
- // `{ once: true }` only detaches the listener on the abort path. When the
131
- // timer wins instead — the common case, once per poll — the listener would
132
- // stay attached to a signal that outlives this iteration, so a default
133
- // 15s/250ms run accumulates ~60 of them on the same AbortSignal before the
134
- // process exits. Detach explicitly on the timer path too.
135
- const timer = setTimeout(() => {
136
- abortSignal?.removeEventListener('abort', onAbort);
137
- resolve();
138
- }, pollIntervalMs);
139
- abortSignal?.addEventListener('abort', onAbort, { once: true });
140
- });
141
- }
142
- return false;
143
- }
28
+ // The 14 slugs/labels below are `agy models`' full live output as of agy v1.1.24 (2026-09-02), not
29
+ // a hand-maintained guess re-run `agy models` to refresh if upstream's catalog changes.
144
30
  // `agy -p` prints an interactive OAuth sign-in URL to **stdout** and then
145
31
  // exits **0** when the keyring entry is missing or expired, so a driver that
146
32
  // streams stdout live shows that URL to the user as if it were the model's
@@ -193,86 +79,95 @@ export function redactAntigravityAuthUrls(fullText) {
193
79
  return fullText.replace(OAUTH_URL_PATTERN, OAUTH_URL_PLACEHOLDER);
194
80
  }
195
81
  /**
196
- * Resolves when `signal` aborts (immediately if it already has). Used instead
197
- * of a never-settling `new Promise(() => {})` so a long-lived caller does not
198
- * accumulate one permanently-pending promise, plus its captured closure, per
199
- * run.
200
- */
201
- function waitUntilAborted(signal) {
202
- if (signal.aborted)
203
- return Promise.resolve();
204
- return new Promise((resolve) => {
205
- signal.addEventListener('abort', () => resolve(), { once: true });
206
- });
207
- }
208
- /**
209
- * Adapts the module-level `acquireAntigravityModelLock` /
210
- * `waitForAgyToReadModel` pair to the caller-facing {@link RuntimeLock}
211
- * contract. A thin adapter, deliberately: the mutex and the log-polling
212
- * handoff detector are the existing, separately-tested functions above, and
213
- * this adds no serialization logic of its own.
82
+ * Parses `agy models`' stdout into the shared `RuntimeModelOption[]` shape.
214
83
  *
215
- * The one policy decision it does makeskipping the lock entirely when no
216
- * concrete model was selected mirrors `buildArgs`'s own
217
- * `options.model && options.model !== DEFAULT_MODEL_OPTION.id` guard exactly.
218
- * The lock guards the `settings.json` write, so when that write will not
219
- * happen there is nothing to serialize, and holding the chain anyway would
220
- * make a `'default'`-model run queue behind an unrelated one for no benefit.
84
+ * The CLI's real output (agy v1.1.24, verified live see this file's header
85
+ * comment for the exact captured transcript) is one `Fetching available
86
+ * models...` progress line followed by one `<slug>\t<label>` pair per line.
87
+ * Each data line is split on the FIRST tab only, so a label that itself
88
+ * contains a tab or extra whitespace never bleeds into the id.
89
+ *
90
+ * @param stdout - Raw stdout from `agy models`.
91
+ * @returns The synthetic default option prepended to every parsed entry, or
92
+ * `null` when no real entry was found (empty stdout, or only the progress
93
+ * line survives filtering) — mirrors `parseCursorAgentModels`'s same-shape
94
+ * null contract, which `detection.ts#fetchModels` already treats the same
95
+ * as an empty array: fall back to `fallbackModels`.
96
+ * @complexity O(n) in the stdout length.
221
97
  */
222
- export const antigravityModelLock = {
223
- acquire: async ({ model }) => {
224
- if (!model || model === DEFAULT_MODEL_OPTION.id) {
225
- // No settings.json write this spawn — hand back an inert hold rather
226
- // than joining the chain. `release` must still exist and still be
227
- // idempotent: the caller calls it on both handoff and process exit
228
- // without knowing which kind of hold it got.
229
- return { release: () => { } };
230
- }
231
- const release = await acquireAntigravityModelLock();
232
- return {
233
- release,
234
- waitForHandoff: async ({ logFilePath, processExited }) => {
235
- if (logFilePath !== undefined) {
236
- const observed = await waitForAgyToReadModel(logFilePath, model, {
237
- abortSignal: processExited,
238
- });
239
- if (observed)
240
- return;
241
- }
242
- // Reached when either there is no `--log-file` to watch (no
243
- // observable propagation signal exists at all), or the watcher
244
- // stopped without seeing the line. Neither is evidence that agy
245
- // failed to read settings.json — `waitForAgyToReadModel`'s `false`
246
- // means "stopped polling" (see its own doc). Resolving here would
247
- // release the lock while a cold-starting agy may still be about to
248
- // read the file, reopening exactly the race this lock closes. So
249
- // hand the release decision back to process exit, the only event
250
- // that proves agy can no longer read it.
251
- await waitUntilAborted(processExited);
252
- },
253
- };
254
- },
255
- };
98
+ export function parseAgyModels(stdout) {
99
+ const lines = String(stdout || '')
100
+ .split('\n')
101
+ .map((line) => line.trim())
102
+ .filter((line) => line.length > 0);
103
+ if (lines.length === 0)
104
+ return null;
105
+ const out = [DEFAULT_MODEL_OPTION];
106
+ const seen = new Set([DEFAULT_MODEL_OPTION.id]);
107
+ for (const line of lines) {
108
+ if (/^fetching available models\.\.\.$/i.test(line))
109
+ continue;
110
+ const tabIndex = line.indexOf('\t');
111
+ if (tabIndex === -1)
112
+ continue;
113
+ const id = line.slice(0, tabIndex).trim();
114
+ if (!id || seen.has(id))
115
+ continue;
116
+ seen.add(id);
117
+ const label = line.slice(tabIndex + 1).trim();
118
+ out.push({ id, label: label || id });
119
+ }
120
+ return out.length > 1 ? out : null;
121
+ }
256
122
  export const antigravityAgentDef = {
257
123
  id: 'antigravity',
258
124
  name: 'Antigravity',
259
125
  bin: 'agy',
260
126
  versionArgs: ['--version'],
127
+ // `agy models` does a real network fetch (its own stdout says "Fetching
128
+ // available models..."), so this gets a longer budget than codex's 5s
129
+ // local-cache read — 10s to absorb ordinary network latency without
130
+ // making every detection pass wait needlessly long on a slow/offline run
131
+ // (`detection.ts#fetchModels` falls back to `fallbackModels` on timeout).
132
+ listModels: {
133
+ args: ['models'],
134
+ parse: parseAgyModels,
135
+ timeoutMs: 10_000,
136
+ },
261
137
  fallbackModels: [
262
138
  DEFAULT_MODEL_OPTION,
263
- { id: 'Gemini 3.1 Pro (High)', label: 'Gemini 3.1 Pro (High)' },
264
- { id: 'Gemini 3.1 Pro (Low)', label: 'Gemini 3.1 Pro (Low)' },
265
- { id: 'Gemini 3.5 Flash (High)', label: 'Gemini 3.5 Flash (High)' },
266
- { id: 'Gemini 3.5 Flash (Medium)', label: 'Gemini 3.5 Flash (Medium)' },
267
- { id: 'Gemini 3.5 Flash (Low)', label: 'Gemini 3.5 Flash (Low)' },
268
- {
269
- id: 'Claude Sonnet 4.6 (Thinking)',
270
- label: 'Claude Sonnet 4.6 (Thinking)',
271
- },
272
- { id: 'Claude Opus 4.6 (Thinking)', label: 'Claude Opus 4.6 (Thinking)' },
273
- { id: 'GPT-OSS 120B (Medium)', label: 'GPT-OSS 120B (Medium)' },
139
+ { id: 'gemini-3.8-flash-high', label: 'Gemini 3.8 Flash (High)' },
140
+ { id: 'gemini-3.8-flash-medium', label: 'Gemini 3.8 Flash (Medium)' },
141
+ { id: 'gemini-3.8-flash-low', label: 'Gemini 3.8 Flash (Low)' },
142
+ { id: 'gemini-3.7-flash-high', label: 'Gemini 3.7 Flash (High)' },
143
+ { id: 'gemini-3.7-flash-medium', label: 'Gemini 3.7 Flash (Medium)' },
144
+ { id: 'gemini-3.7-flash-low', label: 'Gemini 3.7 Flash (Low)' },
145
+ { id: 'gemini-3.6-flash-high', label: 'Gemini 3.6 Flash (High)' },
146
+ { id: 'gemini-3.6-flash-medium', label: 'Gemini 3.6 Flash (Medium)' },
147
+ { id: 'gemini-3.6-flash-low', label: 'Gemini 3.6 Flash (Low)' },
148
+ { id: 'gemini-3.1-pro-high', label: 'Gemini 3.1 Pro (High)' },
149
+ { id: 'gemini-3.1-pro-low', label: 'Gemini 3.1 Pro (Low)' },
150
+ { id: 'claude-sonnet-4-6', label: 'Claude Sonnet 4.6 (Thinking)' },
151
+ { id: 'claude-opus-4-6-thinking', label: 'Claude Opus 4.6 (Thinking)' },
152
+ { id: 'gpt-oss-120b-medium', label: 'GPT-OSS 120B (Medium)' },
274
153
  ],
275
154
  supportsCustomModel: false,
155
+ // agy has no `--effort`-shaped flag: reasoning effort is a trailing `-high`/
156
+ // `-medium`/`-low` on the model slug `--model` already carries (see the
157
+ // `fallbackModels` list above, which is `agy models`' real output). So this
158
+ // def declares the suffix VOCABULARY only — see `types.ts`'s
159
+ // `RuntimeReasoningInModelId` for why the per-base-model availability is
160
+ // derived from the model list instead of enumerated here, and why
161
+ // `-thinking` on `claude-opus-4-6-thinking` must not be read as a level.
162
+ // `buildArgs` below is deliberately unchanged: the effort is already inside
163
+ // `--model`'s value, so there is no second argv to emit.
164
+ reasoningInModelId: {
165
+ levels: [
166
+ { id: 'high', label: 'High' },
167
+ { id: 'medium', label: 'Medium' },
168
+ { id: 'low', label: 'Low' },
169
+ ],
170
+ },
276
171
  // We deliberately do NOT opt into `resumesSessionViaCli` / agy's `-c`
277
172
  // resume flag on follow-up turns. Tested both shapes; `-c` activates
278
173
  // agy's internal agentic loop (multi-step model retries, tool calls,
@@ -290,9 +185,6 @@ export const antigravityAgentDef = {
290
185
  // composed in server.ts gives a second line of defense for weak
291
186
  // plain-stream models like Gemini 3.5 Flash.
292
187
  buildArgs: (prompt, _imagePaths, _extra = [], options = {}, runtimeContext = {}) => {
293
- if (options.model && options.model !== DEFAULT_MODEL_OPTION.id) {
294
- writeAntigravityModelSelection(options.model, runtimeContext.antigravitySettingsPath);
295
- }
296
188
  // `-p` is a Go `flag`-package flag that TAKES THE PROMPT AS ITS VALUE,
297
189
  // not a boolean switch followed by a positional prompt, and agy has no
298
190
  // stdin sentinel under the default `--input-format text`. Verified
@@ -306,18 +198,23 @@ export const antigravityAgentDef = {
306
198
  // So the prompt rides argv as `-p`'s value. That is also why this def is
307
199
  // argv-budgeted (`maxPromptArgBytes` below) rather than `promptViaStdin`.
308
200
  const args = [];
201
+ // `--model` is the same kind of Go flag as `--log-file`/`-p`: its value is
202
+ // whatever argv token immediately follows it, so it too must be pushed
203
+ // before `-p` (always last — see below). Verified live against agy
204
+ // v1.1.24: `agy --model <slug> -p '<prompt>'` runs that one print-mode
205
+ // turn on the named model, and combining it with `--log-file` works the
206
+ // same way — relative order between `--model` and `--log-file` doesn't
207
+ // matter (each independently consumes exactly the one token after it),
208
+ // only that both precede `-p`.
209
+ if (options.model && options.model !== DEFAULT_MODEL_OPTION.id) {
210
+ args.push('--model', options.model);
211
+ }
309
212
  // Always opt into `--log-file` when the daemon supplied a path so
310
213
  // it can post-exit grep for the actual upstream failure shape
311
214
  // (auth missing vs quota reached vs upstream error) — without it
312
215
  // the chat surfaces a generic "empty response" because print mode
313
216
  // never echoes those errors on stdout. See server.ts empty-output
314
217
  // guard for the consumer.
315
- //
316
- // Flag order is load-bearing: `--log-file` must precede `-p`, since
317
- // everything after `-p` is consumed as its value. `agy --log-file /tmp/x
318
- // -p '<prompt>'` captures the diagnostic log, including `Propagating
319
- // selected model override to backend: label="<model>"` and auth/quota
320
- // failures.
321
218
  if (runtimeContext.agentLogFilePath) {
322
219
  args.push('--log-file', runtimeContext.agentLogFilePath);
323
220
  }
@@ -331,13 +228,10 @@ export const antigravityAgentDef = {
331
228
  maxPromptArgBytes: 30_000,
332
229
  streamFormat: 'plain',
333
230
  // `buildArgs` above already consumes `runtimeContext.agentLogFilePath` when
334
- // the caller supplies one; this is what asks it to. Two distinct things
335
- // depend on the log file, which is why it is not merely a diagnostic nicety
336
- // for this adapter:
337
- // - `runtimeLock`'s handoff detector polls it for agy's own
338
- // "Propagating selected model override to backend" line;
339
- // - print mode never echoes auth/quota failures on stdout, so post-exit
340
- // log inspection is the only way to tell those two apart.
231
+ // the caller supplies one; this is what asks it to. Print mode never
232
+ // echoes auth/quota failures on stdout, so post-exit log inspection is the
233
+ // only way to tell those two apart — see server.ts's empty-output guard
234
+ // for the consumer.
341
235
  needsAgentLogFile: true,
342
236
  // The one adapter in this package that must not stream live — see
343
237
  // `redactAntigravityAuthUrls`'s comment for the OAuth-URL-on-stdout-plus-
@@ -346,13 +240,36 @@ export const antigravityAgentDef = {
346
240
  // and keeps streaming per chunk; aider's and deepseek's own comments call
347
241
  // that live cadence out as deliberate.
348
242
  stdoutPolicy: { buffering: 'until-close', sanitize: redactAntigravityAuthUrls },
349
- runtimeLock: antigravityModelLock,
350
243
  installUrl: 'https://antigravity.google/cli',
351
244
  docsUrl: 'https://antigravity.google/docs/cli-overview',
352
- // Deliberately left with no `externalMcpInjection` — investigated for a Codex-style relocation
353
- // strategy (see `codex.ts`'s `'codex-toml'`) and rejected for lack of a safe, run-scoped delivery
354
- // mechanism, not for lack of trying. Evidence, gathered live against the installed CLI (`agy`
355
- // v1.1.22), not from docs alone:
245
+ // `externalMcpInjection: 'env-passthrough'` — the prior verdict here ("no safe, run-scoped
246
+ // delivery mechanism exists") stood as long as the only candidates were a per-run config
247
+ // flag/relocatable home dir, neither of which `agy` has (see the probes below, still accurate).
248
+ // What flips the verdict is a THIRD property, verified live and not previously tested: `agy`
249
+ // passes its own parent process environment through to the stdio MCP server children it spawns
250
+ // for servers already sitting in its persistent global registry.
251
+ //
252
+ // - Proven with a probe MCP server registered under a relocated `HOME`'s
253
+ // `.gemini/config/mcp_config.json`: booted under `agy -p`, it read a marker variable
254
+ // (`TOVU_ENV_PASSTHROUGH_PROBE`) straight out of its own `process.env` — no config field, no
255
+ // argv, nothing but inherited environment. Full MCP handshake observed on the same run:
256
+ // `server/discover` → `initialize` → `notifications/initialized` → `tools/list`
257
+ // (protocolVersion `2025-11-25`, clientInfo `antigravity-client`).
258
+ // - That makes the registration itself a STATIC, one-time operation — the operator adds one
259
+ // `tovu` entry to their real `~/.gemini/config/mcp_config.json` (confirmed still the one real
260
+ // mechanism; see the probes below) with a bare, env-free `command` pointing at this package's
261
+ // own `jini-mcp` bin, resolving its credential from the environment at spawn time instead of
262
+ // a baked-in value. No per-spawn config mutation, no lock, no restore discipline — the exact
263
+ // "safe, run-scoped delivery" gap the old verdict cited is closed by inheritance, not by
264
+ // relocation.
265
+ // - So this def's job shrinks to exactly what `'env-passthrough'` describes in `types.ts`: put
266
+ // the bridge entry's `JINI_RUN_ID`/`JINI_DAEMON_URL`/`JINI_DAEMON_TOKEN` onto `agy`'s OWN
267
+ // spawn env (done centrally by `@jini-ai/daemon`'s `computeChildEnv`, not by this def's
268
+ // `buildArgs`), and `agy` carries them the rest of the way to the already-registered server on
269
+ // its own.
270
+ //
271
+ // The prior probes into a per-run/relocatable mechanism remain accurate and are kept as the
272
+ // record of what does NOT work, so a future reader does not re-walk the same dead ends:
356
273
  //
357
274
  // - No per-run config-path flag. `agy --help` and `agy mcp add --help` were read in full: `mcp
358
275
  // add/remove/list/enable/disable` only mutate the PERSISTENT global registry — there is no
@@ -361,7 +278,9 @@ export const antigravityAgentDef = {
361
278
  // every all-caps `*HOME*`/`*_DIR`/`*_PATH`/`XDG_*` token found nothing naming a relocatable
362
279
  // config/data root for Antigravity or Gemini specifically — only the generic `HOME` (relocating
363
280
  // that would redirect the ENTIRE user profile for the child, not a scoped config dir, and is not
364
- // an "explicit, run-scoped delivery" by any reasonable reading).
281
+ // an "explicit, run-scoped delivery" by any reasonable reading). Also why the passthrough probe
282
+ // above used a relocated `HOME` only to prove inheritance in isolation — production spawns
283
+ // always use the operator's real `HOME`, since relocating it breaks `agy`'s own auth.
365
284
  // - The workspace-relative `.agents/mcp_config.json` this comment used to cite as unverified is
366
285
  // now verified NOT to be what it looked like: a project dir was seeded with a real
367
286
  // `.agents/mcp_config.json` entry, then `agy mcp list` (run from that cwd) showed only the
@@ -372,21 +291,17 @@ export const antigravityAgentDef = {
372
291
  // distinct project. Best read: `.agents/mcp_config.json` belongs to the Antigravity IDE
373
292
  // extension's own project layer, a different consumer than the bare `agy` CLI binary this
374
293
  // daemon actually spawns — not a mechanism reachable from a plain `agy -p` invocation at all.
375
- // - The one mechanism that IS real `~/.gemini/config/mcp_config.json` (global, JSON,
376
- // `{"mcpServers":{"<name>":{"command":...}}}`, confirmed by reading the operator's own file
377
- // read-only after backing it up) — has no relocation path, so using it means mutating the
378
- // operator's real shared config on every spawn. That is the exact class of side effect
379
- // `codex.ts`'s doc rejected the `-c`-override approach for, made concretely worse here: this
380
- // def already fights a real cross-run race on `settings.json` for model selection
381
- // (`antigravityModelLock` above), and a second shared-file race for MCP config would need its
382
- // own serialization/merge/restore discipline with its own live verification — not a strategy
383
- // bolted onto this one on a guess. Also relevant: this same `agy -p` run, on the SAME machine,
384
- // left `~/.gemini/trustedFolders.json` and `~/.gemini/projects.json` byte-identical
385
- // before/after (unlike Codex's `config.toml`, which does grow a project-tracking entry per
386
- // run) — headless print mode does not even register the folder as a project, reinforcing that
387
- // nothing here is scoped per-invocation the way `CODEX_HOME` is.
294
+ // Confirmed independently upstream: antigravity-cli issue #60 (open, no maintainer response)
295
+ // reports the identical "project-local mcp_config.json is read but ignored" symptom.
296
+ // - `~/.gemini/config/mcp_config.json` (global, JSON, `{"mcpServers":{"<name>":{"command":...}}}`,
297
+ // confirmed by reading the operator's own file read-only after backing it up) has no relocation
298
+ // path but per the passthrough finding above, this def never needs to write to it at all
299
+ // outside the one-time operator registration, so the shared-file race a prior version of this
300
+ // comment warned about (a second race alongside the now-deleted settings.json model lock) never
301
+ // materializes: nothing here mutates that file per run.
388
302
  //
389
303
  // No hang was observed on any of these probes (all completed in well under `--print-timeout`'s
390
- // default 5m), so the blocker is "no safe delivery mechanism exists", not "the mechanism hangs".
304
+ // default 5m).
305
+ externalMcpInjection: 'env-passthrough',
391
306
  };
392
307
  //# sourceMappingURL=antigravity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.js","sourceRoot":"","sources":["../../src/defs/antigravity.ts"],"names":[],"mappings":"AAAA,iIAAiI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iC;IACjC,EAAE;IACF,iGAAiG;IACjG,+FAA+F;IAC/F,8FAA8F;IAC9F,mGAAmG;IACnG,gGAAgG;IAChG,oGAAoG;IACpG,qGAAqG;IACrG,qEAAqE;IACrE,kGAAkG;IAClG,uFAAuF;IACvF,+FAA+F;IAC/F,iGAAiG;IACjG,iGAAiG;IACjG,oGAAoG;IACpG,gGAAgG;IAChG,4FAA4F;IAC5F,8FAA8F;IAC9F,kGAAkG;IAClG,yFAAyF;IACzF,gGAAgG;IAChG,8FAA8F;IAC9F,2FAA2F;IAC3F,iGAAiG;IACjG,sFAAsF;IACtF,kGAAkG;IAClG,iGAAiG;IACjG,mGAAmG;IACnG,wFAAwF;IACxF,+FAA+F;IAC/F,kGAAkG;IAClG,qEAAqE;IACrE,EAAE;IACF,+FAA+F;IAC/F,iGAAiG;CACxE,CAAC"}
1
+ {"version":3,"file":"antigravity.js","sourceRoot":"","sources":["../../src/defs/antigravity.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,yFAAyF;AACzF,iGAAiG;AACjG,kGAAkG;AAClG,kFAAkF;AAClF,gGAAgG;AAChG,2FAA2F;AAC3F,+FAA+F;AAC/F,gGAAgG;AAChG,gBAAgB;AAChB,EAAE;AACF,0CAA0C;AAC1C,gGAAgG;AAChG,kGAAkG;AAClG,mGAAmG;AACnG,yBAAyB;AACzB,EAAE;AACF,kGAAkG;AAClG,iGAAiG;AACjG,4FAA4F;AAC5F,kGAAkG;AAClG,mGAAmG;AACnG,gGAAgG;AAChG,8FAA8F;AAC9F,wDAAwD;AACxD,EAAE;AACF,mGAAmG;AACnG,0FAA0F;AAE1F,0EAA0E;AAC1E,6EAA6E;AAC7E,2EAA2E;AAC3E,sDAAsD;AACtD,8EAA8E;AAC9E,6EAA6E;AAC7E,uBAAuB;AACvB,6EAA6E;AAC7E,qDAAqD;AACrD,uEAAuE;AACvE,uEAAuE;AACvE,EAAE;A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B,iBAAiB,EAAE,IAAI;IACvB,kEAAkE;IAClE,0EAA0E;IAC1E,sEAAsE;IACtE,0EAA0E;IAC1E,0EAA0E;IAC1E,uCAAuC;IACvC,YAAY,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,yBAAyB,EAAE;IAC/E,UAAU,EAAE,gCAAgC;IAC5C,OAAO,EAAE,8CAA8C;IACvD,2FAA2F;IAC3F,yFAAyF;IACzF,gGAAgG;IAChG,6FAA6F;IAC7F,+FAA+F;IAC/F,iEAAiE;IACjE,EAAE;IACF,2EAA2E;IAC3E,yFAAyF;IACzF,iGAAiG;IACjG,4FAA4F;IAC5F,oFAAoF;IACpF,uEAAuE;IACvE,8FAA8F;IAC9F,kGAAkG;IAClG,kGAAkG;IAClG,iGAAiG;IACjG,iGAAiG;IACjG,6FAA6F;IAC7F,kBAAkB;IAClB,iGAAiG;IACjG,8FAA8F;IAC9F,4FAA4F;IAC5F,mGAAmG;IACnG,eAAe;IACf,EAAE;IACF,4FAA4F;IAC5F,wFAAwF;IACxF,EAAE;IACF,iGAAiG;IACjG,+FAA+F;IAC/F,8FAA8F;IAC9F,mGAAmG;IACnG,gGAAgG;IAChG,oGAAoG;IACpG,qGAAqG;IACrG,oGAAoG;IACpG,+FAA+F;IAC/F,0FAA0F;IAC1F,kGAAkG;IAClG,uFAAuF;IACvF,+FAA+F;IAC/F,iGAAiG;IACjG,iGAAiG;IACjG,oGAAoG;IACpG,gGAAgG;IAChG,4FAA4F;IAC5F,8FAA8F;IAC9F,kGAAkG;IAClG,iGAAiG;IACjG,yFAAyF;IACzF,qGAAqG;IACrG,oGAAoG;IACpG,+FAA+F;IAC/F,kGAAkG;IAClG,oGAAoG;IACpG,4DAA4D;IAC5D,EAAE;IACF,+FAA+F;IAC/F,eAAe;IACf,oBAAoB,EAAE,iBAAiB;CACd,CAAC"}
@@ -26,6 +26,11 @@ export declare const claudeAgentDef: {
26
26
  promptInputFormat: "stream-json";
27
27
  streamFormat: string;
28
28
  externalMcpInjection: "claude-mcp-json";
29
+ systemPromptDelivery: {
30
+ strategy: "append-flag";
31
+ flag: string;
32
+ capabilityKey: string;
33
+ };
29
34
  resumesSessionViaCli: true;
30
35
  imageDelivery: "prompt-path";
31
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/defs/claude.ts"],"names":[],"mappings":"AA6DA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuIA,CAAC"}
1
+ {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/defs/claude.ts"],"names":[],"mappings":"AA6DA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwIA,CAAC"}
@@ -139,15 +139,13 @@ export const claudeAgentDef = {
139
139
  if (dirs.length > 0 && caps.addDir !== false) {
140
140
  args.push('--add-dir', ...dirs);
141
141
  }
142
- // Appended, never replaces the CLI's own default system prompt — see
143
- // `RuntimeBuildOptions.systemPromptOverlay`'s doc. Same probe-gate reasoning as
144
- // `--include-partial-messages`/`--effort` above: an older build rejects an unknown option
145
- // with exit 1, which kills the chat rather than degrading it.
146
- if (caps.appendSystemPrompt !== false
147
- && typeof options.systemPromptOverlay === 'string'
148
- && options.systemPromptOverlay.length > 0) {
149
- args.push('--append-system-prompt', options.systemPromptOverlay);
150
- }
142
+ // `--append-system-prompt` delivery now lives outside this function — see
143
+ // `systemPromptDelivery` below and `@jini-ai/daemon`'s `resolveSystemPromptOverlayDelivery`
144
+ // (the single dispatch point for every def, not just this one). The probe-gate reasoning
145
+ // (an older build rejects an unknown option with exit 1, which kills the chat rather than
146
+ // degrading it) is preserved there via `capabilityKey: 'appendSystemPrompt'`, read from the
147
+ // same `capabilityFlags` probe above — moving the *call site* changed nothing about the gate
148
+ // itself.
151
149
  // Continue Claude's own CLI session across turns so it keeps its
152
150
  // working memory (files read, edits made, tool history) instead of
153
151
  // re-deriving everything from the rendered transcript each turn.
@@ -179,6 +177,11 @@ export const claudeAgentDef = {
179
177
  // so the daemon writes the user's external MCP servers there before
180
178
  // launching (server.ts handles the cwd guard).
181
179
  externalMcpInjection: 'claude-mcp-json',
180
+ // Formerly inline in `buildArgs` above (see the comment there) — moved to the declarative
181
+ // shape every def now uses to receive `RuntimeBuildOptions.systemPromptOverlay`. Same flag,
182
+ // same probe gate (`capabilityFlags['--append-system-prompt']` above), same "append, never
183
+ // replace" behavior as before this moved.
184
+ systemPromptDelivery: { strategy: 'append-flag', flag: '--append-system-prompt', capabilityKey: 'appendSystemPrompt' },
182
185
  resumesSessionViaCli: true,
183
186
  // See this file's module doc's "Image delivery" section — the CLI reads
184
187
  // a local file once its path is named in the prompt, so the daemon