@jini-ai/agent-runtime 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/agent-protocol/acp/session.d.ts +206 -1
- package/dist/agent-protocol/acp/session.d.ts.map +1 -1
- package/dist/agent-protocol/acp/session.js +505 -350
- package/dist/agent-protocol/acp/session.js.map +1 -1
- package/dist/agent-protocol/core/json-line-stream.d.ts +53 -0
- package/dist/agent-protocol/core/json-line-stream.d.ts.map +1 -1
- package/dist/agent-protocol/core/json-line-stream.js +307 -255
- package/dist/agent-protocol/core/json-line-stream.js.map +1 -1
- package/dist/agent-protocol/pi-rpc/events.d.ts +22 -1
- package/dist/agent-protocol/pi-rpc/events.d.ts.map +1 -1
- package/dist/agent-protocol/pi-rpc/events.js +189 -153
- package/dist/agent-protocol/pi-rpc/events.js.map +1 -1
- package/dist/agent-protocol/pi-rpc/session.d.ts +39 -0
- package/dist/agent-protocol/pi-rpc/session.d.ts.map +1 -1
- package/dist/agent-protocol/pi-rpc/session.js +143 -107
- package/dist/agent-protocol/pi-rpc/session.js.map +1 -1
- package/dist/auth.js +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/claude-stream.d.ts +65 -2
- package/dist/claude-stream.d.ts.map +1 -1
- package/dist/claude-stream.js +569 -442
- package/dist/claude-stream.js.map +1 -1
- package/dist/defs/aider.d.ts.map +1 -1
- package/dist/defs/aider.js +13 -1
- package/dist/defs/aider.js.map +1 -1
- package/dist/defs/amp.d.ts.map +1 -1
- package/dist/defs/amp.js +16 -1
- package/dist/defs/amp.js.map +1 -1
- package/dist/defs/amr.d.ts +2 -1
- package/dist/defs/amr.d.ts.map +1 -1
- package/dist/defs/amr.js +12 -1
- package/dist/defs/amr.js.map +1 -1
- package/dist/defs/antigravity.d.ts +25 -13
- package/dist/defs/antigravity.d.ts.map +1 -1
- package/dist/defs/antigravity.js +190 -163
- package/dist/defs/antigravity.js.map +1 -1
- package/dist/defs/claude.d.ts +7 -0
- package/dist/defs/claude.d.ts.map +1 -1
- package/dist/defs/claude.js +61 -3
- package/dist/defs/claude.js.map +1 -1
- package/dist/defs/codebuddy.d.ts.map +1 -1
- package/dist/defs/codebuddy.js +9 -1
- package/dist/defs/codebuddy.js.map +1 -1
- package/dist/defs/codex.d.ts +1 -0
- package/dist/defs/codex.d.ts.map +1 -1
- package/dist/defs/codex.js +34 -0
- package/dist/defs/codex.js.map +1 -1
- package/dist/defs/copilot.d.ts.map +1 -1
- package/dist/defs/copilot.js +15 -1
- package/dist/defs/copilot.js.map +1 -1
- package/dist/defs/cursor-agent.d.ts.map +1 -1
- package/dist/defs/cursor-agent.js +24 -2
- package/dist/defs/cursor-agent.js.map +1 -1
- package/dist/defs/deepseek.d.ts.map +1 -1
- package/dist/defs/deepseek.js +12 -0
- package/dist/defs/deepseek.js.map +1 -1
- package/dist/defs/devin.d.ts +2 -1
- package/dist/defs/devin.d.ts.map +1 -1
- package/dist/defs/devin.js +12 -7
- package/dist/defs/devin.js.map +1 -1
- package/dist/defs/grok-build.d.ts.map +1 -1
- package/dist/defs/grok-build.js +10 -0
- package/dist/defs/grok-build.js.map +1 -1
- package/dist/defs/hermes.d.ts +1 -0
- package/dist/defs/hermes.d.ts.map +1 -1
- package/dist/defs/hermes.js +3 -0
- package/dist/defs/hermes.js.map +1 -1
- package/dist/defs/kilo.d.ts +1 -0
- package/dist/defs/kilo.d.ts.map +1 -1
- package/dist/defs/kilo.js +3 -0
- package/dist/defs/kilo.js.map +1 -1
- package/dist/defs/kimi.d.ts +1 -0
- package/dist/defs/kimi.d.ts.map +1 -1
- package/dist/defs/kimi.js +3 -0
- package/dist/defs/kimi.js.map +1 -1
- package/dist/defs/kiro.d.ts +1 -0
- package/dist/defs/kiro.d.ts.map +1 -1
- package/dist/defs/kiro.js +3 -0
- package/dist/defs/kiro.js.map +1 -1
- package/dist/defs/opencode.d.ts +4 -0
- package/dist/defs/opencode.d.ts.map +1 -1
- package/dist/defs/opencode.js +19 -0
- package/dist/defs/opencode.js.map +1 -1
- package/dist/defs/pi.d.ts +5 -1
- package/dist/defs/pi.d.ts.map +1 -1
- package/dist/defs/pi.js +16 -4
- package/dist/defs/pi.js.map +1 -1
- package/dist/defs/qoder.d.ts +1 -0
- package/dist/defs/qoder.d.ts.map +1 -1
- package/dist/defs/qoder.js +15 -0
- package/dist/defs/qoder.js.map +1 -1
- package/dist/defs/qwen.d.ts.map +1 -1
- package/dist/defs/qwen.js +9 -0
- package/dist/defs/qwen.js.map +1 -1
- package/dist/defs/reasonix.d.ts +5 -0
- package/dist/defs/reasonix.d.ts.map +1 -1
- package/dist/defs/reasonix.js +19 -6
- package/dist/defs/reasonix.js.map +1 -1
- package/dist/defs/shared.d.ts +31 -1
- package/dist/defs/shared.d.ts.map +1 -1
- package/dist/defs/shared.js +35 -0
- package/dist/defs/shared.js.map +1 -1
- package/dist/defs/trae-cli.d.ts +1 -0
- package/dist/defs/trae-cli.d.ts.map +1 -1
- package/dist/defs/trae-cli.js +3 -0
- package/dist/defs/trae-cli.js.map +1 -1
- package/dist/defs/vibe.d.ts +1 -0
- package/dist/defs/vibe.d.ts.map +1 -1
- package/dist/defs/vibe.js +3 -0
- package/dist/defs/vibe.js.map +1 -1
- package/dist/detection.d.ts +1 -1
- package/dist/detection.d.ts.map +1 -1
- package/dist/detection.js +7 -2
- package/dist/detection.js.map +1 -1
- package/dist/env.js +1 -1
- package/dist/executables.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/invocation.js +1 -1
- package/dist/json-event-stream.d.ts.map +1 -1
- package/dist/json-event-stream.js +63 -0
- package/dist/json-event-stream.js.map +1 -1
- package/dist/launch.js +1 -1
- package/dist/log-file.d.ts +23 -0
- package/dist/log-file.d.ts.map +1 -0
- package/dist/log-file.js +56 -0
- package/dist/log-file.js.map +1 -0
- package/dist/mcp.d.ts +1 -1
- package/dist/metadata.d.ts +1 -1
- package/dist/mmd-routes.js +1 -1
- package/dist/model-registry.d.ts +7 -45
- package/dist/model-registry.d.ts.map +1 -1
- package/dist/model-registry.js.map +1 -1
- package/dist/models.d.ts +1 -1
- package/dist/opencode-log.js +1 -1
- package/dist/paths.js +1 -1
- package/dist/prompt-augmenter.d.ts +1 -1
- package/dist/prompt-augmenter.js +1 -1
- package/dist/prompt-budget.d.ts +1 -1
- package/dist/prompt-file.js +1 -1
- package/dist/providers/anthropic-messages.d.ts +198 -6
- package/dist/providers/anthropic-messages.d.ts.map +1 -1
- package/dist/providers/anthropic-messages.js +318 -141
- package/dist/providers/anthropic-messages.js.map +1 -1
- package/dist/providers/azure-chat.d.ts +113 -3
- package/dist/providers/azure-chat.d.ts.map +1 -1
- package/dist/providers/azure-chat.js +114 -21
- package/dist/providers/azure-chat.js.map +1 -1
- package/dist/providers/connection-guard.d.ts +121 -1
- package/dist/providers/connection-guard.d.ts.map +1 -1
- package/dist/providers/connection-guard.js +205 -3
- package/dist/providers/connection-guard.js.map +1 -1
- package/dist/providers/connection-test.d.ts +62 -0
- package/dist/providers/connection-test.d.ts.map +1 -0
- package/dist/providers/connection-test.js +404 -0
- package/dist/providers/connection-test.js.map +1 -0
- package/dist/providers/elevenlabs.d.ts.map +1 -1
- package/dist/providers/elevenlabs.js +3 -2
- package/dist/providers/elevenlabs.js.map +1 -1
- package/dist/providers/google-messages.d.ts +208 -7
- package/dist/providers/google-messages.d.ts.map +1 -1
- package/dist/providers/google-messages.js +331 -105
- package/dist/providers/google-messages.js.map +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +1 -0
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/model-catalog.d.ts.map +1 -1
- package/dist/providers/model-catalog.js +21 -0
- package/dist/providers/model-catalog.js.map +1 -1
- package/dist/providers/ollama-chat.d.ts +190 -1
- package/dist/providers/ollama-chat.d.ts.map +1 -1
- package/dist/providers/ollama-chat.js +319 -110
- package/dist/providers/ollama-chat.js.map +1 -1
- package/dist/providers/openai-chat.d.ts +222 -14
- package/dist/providers/openai-chat.d.ts.map +1 -1
- package/dist/providers/openai-chat.js +377 -128
- package/dist/providers/openai-chat.js.map +1 -1
- package/dist/providers/sse-decode.d.ts +2 -2
- package/dist/providers/sse-decode.js +2 -2
- package/dist/qoder-stream.d.ts +1 -1
- package/dist/qoder-stream.js +1 -1
- package/dist/registry.d.ts +16 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +19 -1
- package/dist/registry.js.map +1 -1
- package/dist/resolution.js +1 -1
- package/dist/terminal-launch.js +1 -1
- package/dist/types.d.ts +181 -89
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -4
package/dist/defs/antigravity.js
CHANGED
|
@@ -1,137 +1,82 @@
|
|
|
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.
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
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
|
|
17
|
-
// - 'default'
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
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
|
|
26
|
-
//
|
|
27
|
-
// `
|
|
28
|
-
//
|
|
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
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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.
|
|
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.
|
|
30
|
+
// `agy -p` prints an interactive OAuth sign-in URL to **stdout** and then
|
|
31
|
+
// exits **0** when the keyring entry is missing or expired, so a driver that
|
|
32
|
+
// streams stdout live shows that URL to the user as if it were the model's
|
|
33
|
+
// reply. Two reasons that is a leak, not merely ugly:
|
|
34
|
+
// - the URL carries the client_id and redirect_uri of a login flow bound to
|
|
35
|
+
// whoever runs the daemon, and a chat transcript is a far wider audience
|
|
36
|
+
// than a terminal;
|
|
37
|
+
// - it is also useless to click: `-p` print mode has no field to paste the
|
|
38
|
+
// resulting auth code back into (see `auth.ts`'s
|
|
39
|
+
// `antigravityAuthGuidance`), so the only outcome is a leaked URL.
|
|
40
|
+
// Hence `stdoutPolicy: {buffering: 'until-close'}` plus this redactor.
|
|
95
41
|
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return false;
|
|
42
|
+
// The shape being matched is real, not guessed — it is the same text this
|
|
43
|
+
// package's own `isAntigravityAuthFailureText` already classifies, captured
|
|
44
|
+
// from agy v1.0.3:
|
|
45
|
+
// Authentication required. Please visit the URL to log in:
|
|
46
|
+
// https://accounts.google.com/o/oauth2/auth?client_id=…&redirect_uri=antigravity-redirect
|
|
47
|
+
const OAUTH_URL_PATTERN = new RegExp([
|
|
48
|
+
// Google's own OAuth 2.0 authorization host — the endpoint agy actually
|
|
49
|
+
// prints. Host-anchored rather than path-anchored so an upstream move
|
|
50
|
+
// from `/o/oauth2/auth` to any other path on that host still redacts.
|
|
51
|
+
String.raw `https?://accounts\.google\.com/\S*`,
|
|
52
|
+
// Any other absolute URL carrying an OAuth request's or a bearer
|
|
53
|
+
// credential's hallmark query parameter, so a future change of identity
|
|
54
|
+
// provider degrades to "redacted" instead of "leaked". Deliberately keyed
|
|
55
|
+
// on the parameter names rather than on the word "oauth" appearing
|
|
56
|
+
// somewhere in the URL, which would also eat ordinary documentation links
|
|
57
|
+
// an assistant reply might legitimately contain.
|
|
58
|
+
String.raw `https?://\S*[?&](?:client_id|code_challenge|code_verifier|access_token|id_token|refresh_token)=\S*`,
|
|
59
|
+
].join('|'), 'gi');
|
|
60
|
+
/** What a redacted URL is replaced with. Deliberately says *what* was removed, so the surrounding "Please visit the URL to log in:" text does not read as truncated output. */
|
|
61
|
+
const OAUTH_URL_PLACEHOLDER = '[redacted sign-in URL]';
|
|
62
|
+
/**
|
|
63
|
+
* Redacts any OAuth sign-in URL from agy's buffered print-mode stdout,
|
|
64
|
+
* leaving all other output byte-identical.
|
|
65
|
+
*
|
|
66
|
+
* Scoped to redaction on purpose: it does **not** classify the output as an
|
|
67
|
+
* auth failure or substitute sign-in guidance for it. That classification
|
|
68
|
+
* already has an owner — `auth.ts`'s `classifyAgentAuthFailure` /
|
|
69
|
+
* `isAntigravityAuthFailureText`, consumed by whatever surfaces a structured
|
|
70
|
+
* auth error — and duplicating the decision here would mean this def silently
|
|
71
|
+
* rewrites assistant text into instructions. See `source-map.md`.
|
|
72
|
+
*
|
|
73
|
+
* @param fullText - The concatenation of every stdout chunk agy produced.
|
|
74
|
+
* @returns The same text with every sign-in URL replaced by a placeholder.
|
|
75
|
+
* @complexity O(n) in the buffered text length.
|
|
76
|
+
* @overallScore 100/100
|
|
77
|
+
*/
|
|
78
|
+
export function redactAntigravityAuthUrls(fullText) {
|
|
79
|
+
return fullText.replace(OAUTH_URL_PATTERN, OAUTH_URL_PLACEHOLDER);
|
|
135
80
|
}
|
|
136
81
|
export const antigravityAgentDef = {
|
|
137
82
|
id: 'antigravity',
|
|
@@ -140,17 +85,20 @@ export const antigravityAgentDef = {
|
|
|
140
85
|
versionArgs: ['--version'],
|
|
141
86
|
fallbackModels: [
|
|
142
87
|
DEFAULT_MODEL_OPTION,
|
|
143
|
-
{ id: '
|
|
144
|
-
{ id: '
|
|
145
|
-
{ id: '
|
|
146
|
-
{ id: '
|
|
147
|
-
{ id: '
|
|
148
|
-
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
},
|
|
152
|
-
{ id: '
|
|
153
|
-
{ id: '
|
|
88
|
+
{ id: 'gemini-3.8-flash-high', label: 'Gemini 3.8 Flash (High)' },
|
|
89
|
+
{ id: 'gemini-3.8-flash-medium', label: 'Gemini 3.8 Flash (Medium)' },
|
|
90
|
+
{ id: 'gemini-3.8-flash-low', label: 'Gemini 3.8 Flash (Low)' },
|
|
91
|
+
{ id: 'gemini-3.7-flash-high', label: 'Gemini 3.7 Flash (High)' },
|
|
92
|
+
{ id: 'gemini-3.7-flash-medium', label: 'Gemini 3.7 Flash (Medium)' },
|
|
93
|
+
{ id: 'gemini-3.7-flash-low', label: 'Gemini 3.7 Flash (Low)' },
|
|
94
|
+
{ id: 'gemini-3.6-flash-high', label: 'Gemini 3.6 Flash (High)' },
|
|
95
|
+
{ id: 'gemini-3.6-flash-medium', label: 'Gemini 3.6 Flash (Medium)' },
|
|
96
|
+
{ id: 'gemini-3.6-flash-low', label: 'Gemini 3.6 Flash (Low)' },
|
|
97
|
+
{ id: 'gemini-3.1-pro-high', label: 'Gemini 3.1 Pro (High)' },
|
|
98
|
+
{ id: 'gemini-3.1-pro-low', label: 'Gemini 3.1 Pro (Low)' },
|
|
99
|
+
{ id: 'claude-sonnet-4-6', label: 'Claude Sonnet 4.6 (Thinking)' },
|
|
100
|
+
{ id: 'claude-opus-4-6-thinking', label: 'Claude Opus 4.6 (Thinking)' },
|
|
101
|
+
{ id: 'gpt-oss-120b-medium', label: 'GPT-OSS 120B (Medium)' },
|
|
154
102
|
],
|
|
155
103
|
supportsCustomModel: false,
|
|
156
104
|
// We deliberately do NOT opt into `resumesSessionViaCli` / agy's `-c`
|
|
@@ -169,45 +117,124 @@ export const antigravityAgentDef = {
|
|
|
169
117
|
// apps/web/src/providers/daemon.ts). The stronger OVERRIDE block
|
|
170
118
|
// composed in server.ts gives a second line of defense for weak
|
|
171
119
|
// plain-stream models like Gemini 3.5 Flash.
|
|
172
|
-
buildArgs: (
|
|
120
|
+
buildArgs: (prompt, _imagePaths, _extra = [], options = {}, runtimeContext = {}) => {
|
|
121
|
+
// `-p` is a Go `flag`-package flag that TAKES THE PROMPT AS ITS VALUE,
|
|
122
|
+
// not a boolean switch followed by a positional prompt, and agy has no
|
|
123
|
+
// stdin sentinel under the default `--input-format text`. Verified
|
|
124
|
+
// against the installed agy v1.1.19:
|
|
125
|
+
// - `agy -p` alone -> `flag needs an argument: -p`
|
|
126
|
+
// - `echo <prompt> | agy -p -` -> runs, but the prompt is the literal
|
|
127
|
+
// one-character string `-`; the piped stdin is never read, and agy
|
|
128
|
+
// answers the empty ask with a generic greeting drawn from whatever
|
|
129
|
+
// project memory it has ("How can I assist you today?").
|
|
130
|
+
// - `agy -p '<prompt>'` -> the prompt actually lands.
|
|
131
|
+
// So the prompt rides argv as `-p`'s value. That is also why this def is
|
|
132
|
+
// argv-budgeted (`maxPromptArgBytes` below) rather than `promptViaStdin`.
|
|
133
|
+
const args = [];
|
|
134
|
+
// `--model` is the same kind of Go flag as `--log-file`/`-p`: its value is
|
|
135
|
+
// whatever argv token immediately follows it, so it too must be pushed
|
|
136
|
+
// before `-p` (always last — see below). Verified live against agy
|
|
137
|
+
// v1.1.24: `agy --model <slug> -p '<prompt>'` runs that one print-mode
|
|
138
|
+
// turn on the named model, and combining it with `--log-file` works the
|
|
139
|
+
// same way — relative order between `--model` and `--log-file` doesn't
|
|
140
|
+
// matter (each independently consumes exactly the one token after it),
|
|
141
|
+
// only that both precede `-p`.
|
|
173
142
|
if (options.model && options.model !== DEFAULT_MODEL_OPTION.id) {
|
|
174
|
-
|
|
143
|
+
args.push('--model', options.model);
|
|
175
144
|
}
|
|
176
|
-
// We invoke agy via `-p -` (print mode + stdin sentinel), NOT
|
|
177
|
-
// `chat -`. Verified against `agy --help` on v1.0.3 — the
|
|
178
|
-
// `Available subcommands` list is `changelog / help / install /
|
|
179
|
-
// plugin / update`, and `chat` is NOT among them. `-p` is the
|
|
180
|
-
// documented print-mode flag (`Short alias for --print`) and
|
|
181
|
-
// `agy -p -` reads the prompt from stdin. The looper reviewer
|
|
182
|
-
// bot's environment runs a different agy build that may have
|
|
183
|
-
// renamed the entry point; until upstream confirms a stable
|
|
184
|
-
// headless subcommand (see google-antigravity/antigravity-cli#119)
|
|
185
|
-
// and the change actually ships in the auto-update channel that
|
|
186
|
-
// packaged OD users get, `-p -` is the contract that actually
|
|
187
|
-
// produces a print-mode reply on the installed CLI.
|
|
188
|
-
const args = [];
|
|
189
145
|
// Always opt into `--log-file` when the daemon supplied a path so
|
|
190
146
|
// it can post-exit grep for the actual upstream failure shape
|
|
191
147
|
// (auth missing vs quota reached vs upstream error) — without it
|
|
192
148
|
// the chat surfaces a generic "empty response" because print mode
|
|
193
149
|
// never echoes those errors on stdout. See server.ts empty-output
|
|
194
150
|
// guard for the consumer.
|
|
195
|
-
//
|
|
196
|
-
// Flag order is load-bearing on agy v1.0.3: `agy -p --log-file
|
|
197
|
-
// /tmp/x -` runs successfully but leaves /tmp/x empty, while `agy
|
|
198
|
-
// --log-file /tmp/x -p -` captures the diagnostic log, including
|
|
199
|
-
// `Propagating selected model override to backend: label="<model>"`
|
|
200
|
-
// and auth/quota failures.
|
|
201
151
|
if (runtimeContext.agentLogFilePath) {
|
|
202
152
|
args.push('--log-file', runtimeContext.agentLogFilePath);
|
|
203
153
|
}
|
|
204
|
-
args.push('-p');
|
|
205
|
-
args.push('-');
|
|
154
|
+
args.push('-p', prompt);
|
|
206
155
|
return args;
|
|
207
156
|
},
|
|
208
|
-
|
|
157
|
+
// agy takes its prompt on argv (see `buildArgs`), so this def is
|
|
158
|
+
// argv-budgeted like the other plain-stream argv adapters (aider,
|
|
159
|
+
// deepseek) rather than `promptViaStdin`. Without one of these three
|
|
160
|
+
// fields `assessAgentExecutorCompatibility` rejects the def outright.
|
|
161
|
+
maxPromptArgBytes: 30_000,
|
|
209
162
|
streamFormat: 'plain',
|
|
163
|
+
// `buildArgs` above already consumes `runtimeContext.agentLogFilePath` when
|
|
164
|
+
// the caller supplies one; this is what asks it to. Print mode never
|
|
165
|
+
// echoes auth/quota failures on stdout, so post-exit log inspection is the
|
|
166
|
+
// only way to tell those two apart — see server.ts's empty-output guard
|
|
167
|
+
// for the consumer.
|
|
168
|
+
needsAgentLogFile: true,
|
|
169
|
+
// The one adapter in this package that must not stream live — see
|
|
170
|
+
// `redactAntigravityAuthUrls`'s comment for the OAuth-URL-on-stdout-plus-
|
|
171
|
+
// exit-0 behavior that forces it. Every other `streamFormat: 'plain'`
|
|
172
|
+
// adapter (grok-build, aider, deepseek, qwen) leaves `stdoutPolicy` unset
|
|
173
|
+
// and keeps streaming per chunk; aider's and deepseek's own comments call
|
|
174
|
+
// that live cadence out as deliberate.
|
|
175
|
+
stdoutPolicy: { buffering: 'until-close', sanitize: redactAntigravityAuthUrls },
|
|
210
176
|
installUrl: 'https://antigravity.google/cli',
|
|
211
177
|
docsUrl: 'https://antigravity.google/docs/cli-overview',
|
|
178
|
+
// `externalMcpInjection: 'env-passthrough'` — the prior verdict here ("no safe, run-scoped
|
|
179
|
+
// delivery mechanism exists") stood as long as the only candidates were a per-run config
|
|
180
|
+
// flag/relocatable home dir, neither of which `agy` has (see the probes below, still accurate).
|
|
181
|
+
// What flips the verdict is a THIRD property, verified live and not previously tested: `agy`
|
|
182
|
+
// passes its own parent process environment through to the stdio MCP server children it spawns
|
|
183
|
+
// for servers already sitting in its persistent global registry.
|
|
184
|
+
//
|
|
185
|
+
// - Proven with a probe MCP server registered under a relocated `HOME`'s
|
|
186
|
+
// `.gemini/config/mcp_config.json`: booted under `agy -p`, it read a marker variable
|
|
187
|
+
// (`TOVU_ENV_PASSTHROUGH_PROBE`) straight out of its own `process.env` — no config field, no
|
|
188
|
+
// argv, nothing but inherited environment. Full MCP handshake observed on the same run:
|
|
189
|
+
// `server/discover` → `initialize` → `notifications/initialized` → `tools/list`
|
|
190
|
+
// (protocolVersion `2025-11-25`, clientInfo `antigravity-client`).
|
|
191
|
+
// - That makes the registration itself a STATIC, one-time operation — the operator adds one
|
|
192
|
+
// `tovu` entry to their real `~/.gemini/config/mcp_config.json` (confirmed still the one real
|
|
193
|
+
// mechanism; see the probes below) with a bare, env-free `command` pointing at this package's
|
|
194
|
+
// own `jini-mcp` bin, resolving its credential from the environment at spawn time instead of
|
|
195
|
+
// a baked-in value. No per-spawn config mutation, no lock, no restore discipline — the exact
|
|
196
|
+
// "safe, run-scoped delivery" gap the old verdict cited is closed by inheritance, not by
|
|
197
|
+
// relocation.
|
|
198
|
+
// - So this def's job shrinks to exactly what `'env-passthrough'` describes in `types.ts`: put
|
|
199
|
+
// the bridge entry's `JINI_RUN_ID`/`JINI_DAEMON_URL`/`JINI_DAEMON_TOKEN` onto `agy`'s OWN
|
|
200
|
+
// spawn env (done centrally by `@jini-ai/daemon`'s `computeChildEnv`, not by this def's
|
|
201
|
+
// `buildArgs`), and `agy` carries them the rest of the way to the already-registered server on
|
|
202
|
+
// its own.
|
|
203
|
+
//
|
|
204
|
+
// The prior probes into a per-run/relocatable mechanism remain accurate and are kept as the
|
|
205
|
+
// record of what does NOT work, so a future reader does not re-walk the same dead ends:
|
|
206
|
+
//
|
|
207
|
+
// - No per-run config-path flag. `agy --help` and `agy mcp add --help` were read in full: `mcp
|
|
208
|
+
// add/remove/list/enable/disable` only mutate the PERSISTENT global registry — there is no
|
|
209
|
+
// `--mcp-config <path>`-shaped flag anywhere on the top-level command or its subcommands.
|
|
210
|
+
// - No CODEX_HOME-equivalent env var. `strings` over the `agy` binary itself (not just docs) for
|
|
211
|
+
// every all-caps `*HOME*`/`*_DIR`/`*_PATH`/`XDG_*` token found nothing naming a relocatable
|
|
212
|
+
// config/data root for Antigravity or Gemini specifically — only the generic `HOME` (relocating
|
|
213
|
+
// that would redirect the ENTIRE user profile for the child, not a scoped config dir, and is not
|
|
214
|
+
// an "explicit, run-scoped delivery" by any reasonable reading). Also why the passthrough probe
|
|
215
|
+
// above used a relocated `HOME` only to prove inheritance in isolation — production spawns
|
|
216
|
+
// always use the operator's real `HOME`, since relocating it breaks `agy`'s own auth.
|
|
217
|
+
// - The workspace-relative `.agents/mcp_config.json` this comment used to cite as unverified is
|
|
218
|
+
// now verified NOT to be what it looked like: a project dir was seeded with a real
|
|
219
|
+
// `.agents/mcp_config.json` entry, then `agy mcp list` (run from that cwd) showed only the
|
|
220
|
+
// REAL global config's servers — the workspace file never appeared. A live headless `agy -p`
|
|
221
|
+
// run from that same cwd (both with and without `--new-project`), captured via `--log-file`,
|
|
222
|
+
// shows zero mention of "mcp" or the seeded server name anywhere in its diagnostic log, and its
|
|
223
|
+
// own log line reports the run scoped to a generic `"CLI Project"` bucket, not the cwd as a
|
|
224
|
+
// distinct project. Best read: `.agents/mcp_config.json` belongs to the Antigravity IDE
|
|
225
|
+
// extension's own project layer, a different consumer than the bare `agy` CLI binary this
|
|
226
|
+
// daemon actually spawns — not a mechanism reachable from a plain `agy -p` invocation at all.
|
|
227
|
+
// Confirmed independently upstream: antigravity-cli issue #60 (open, no maintainer response)
|
|
228
|
+
// reports the identical "project-local mcp_config.json is read but ignored" symptom.
|
|
229
|
+
// - `~/.gemini/config/mcp_config.json` (global, JSON, `{"mcpServers":{"<name>":{"command":...}}}`,
|
|
230
|
+
// confirmed by reading the operator's own file read-only after backing it up) has no relocation
|
|
231
|
+
// path — but per the passthrough finding above, this def never needs to write to it at all
|
|
232
|
+
// outside the one-time operator registration, so the shared-file race a prior version of this
|
|
233
|
+
// comment warned about (a second race alongside the now-deleted settings.json model lock) never
|
|
234
|
+
// materializes: nothing here mutates that file per run.
|
|
235
|
+
//
|
|
236
|
+
// No hang was observed on any of these probes (all completed in well under `--print-timeout`'s
|
|
237
|
+
// default 5m).
|
|
238
|
+
externalMcpInjection: 'env-passthrough',
|
|
212
239
|
};
|
|
213
240
|
//# sourceMappingURL=antigravity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"antigravity.js","sourceRoot":"","sources":["../../src/defs/antigravity.ts"],"names":[],"mappings":"AAAA,iIAAiI;AACjI,OAAO,
|
|
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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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"}
|
package/dist/defs/claude.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare const claudeAgentDef: {
|
|
|
13
13
|
'--include-partial-messages': string;
|
|
14
14
|
'--add-dir': string;
|
|
15
15
|
'--effort': string;
|
|
16
|
+
'--append-system-prompt': string;
|
|
16
17
|
};
|
|
17
18
|
fallbackModels: import("../types.js").RuntimeModelOption[];
|
|
18
19
|
fetchModels: (_resolvedBin: string, env: import("../types.js").RuntimeEnv) => Promise<import("../types.js").RuntimeModelOption[] | null>;
|
|
@@ -25,6 +26,12 @@ export declare const claudeAgentDef: {
|
|
|
25
26
|
promptInputFormat: "stream-json";
|
|
26
27
|
streamFormat: string;
|
|
27
28
|
externalMcpInjection: "claude-mcp-json";
|
|
29
|
+
systemPromptDelivery: {
|
|
30
|
+
strategy: "append-flag";
|
|
31
|
+
flag: string;
|
|
32
|
+
capabilityKey: string;
|
|
33
|
+
};
|
|
28
34
|
resumesSessionViaCli: true;
|
|
35
|
+
imageDelivery: "prompt-path";
|
|
29
36
|
};
|
|
30
37
|
//# sourceMappingURL=claude.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/defs/claude.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../src/defs/claude.ts"],"names":[],"mappings":"AA6DA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwIA,CAAC"}
|
package/dist/defs/claude.js
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Ported verbatim from OD's `apps/daemon/src/runtimes/defs/claude.ts` (import
|
|
3
|
+
* path adjusted only). See `source-map.md`.
|
|
4
|
+
*
|
|
5
|
+
* **Image delivery (added 2026-08-03):** `buildArgs` below takes an
|
|
6
|
+
* `_imagePaths` parameter but never references it — the Claude Code CLI has
|
|
7
|
+
* no dedicated image-attachment flag or wire mechanism this adapter could
|
|
8
|
+
* forward to. It is not, however, blind to images: confirmed live by piping
|
|
9
|
+
* `Tell me what this image is as best you can: /tmp/probe-image.png` into a
|
|
10
|
+
* real `claude -p` and getting an accurate description back — the CLI reads
|
|
11
|
+
* a local file itself once its path is named in the prompt text. The one
|
|
12
|
+
* real precondition, also confirmed live: the path's directory has to be in
|
|
13
|
+
* the CLI's allowed-directory list (`claude -p` first refused the identical
|
|
14
|
+
* probe when the path was under `/Users/la/Desktop`, reporting that
|
|
15
|
+
* directory as outside its allowed working directories) — which is exactly
|
|
16
|
+
* what `buildArgs`'s existing `extraAllowedDirs` -> `--add-dir` handling
|
|
17
|
+
* below already provides, unmodified.
|
|
18
|
+
*
|
|
19
|
+
* `imageDelivery: 'prompt-path'` (declared below) is what turns this into
|
|
20
|
+
* real behavior: `@jini-ai/daemon`'s `agent-executor.ts` reads that field and,
|
|
21
|
+
* before `buildArgs` ever runs, (1) appends an attachment-naming section to
|
|
22
|
+
* the prompt text via `image-prompt-delivery.ts#augmentPromptWithImageAttachments`
|
|
23
|
+
* and (2) widens `extraAllowedDirs` with each image's containing directory —
|
|
24
|
+
* so this file needed no change to its own `dirs`/`--add-dir` logic at all,
|
|
25
|
+
* only the one-line `imageDelivery` declaration. See
|
|
26
|
+
* `types.ts#RuntimeAgentDef.imageDelivery`'s doc for the full mode contract
|
|
27
|
+
* and why 'native'-delivery defs (ACP, pi-rpc, qoder) must never also get
|
|
28
|
+
* this treatment.
|
|
29
|
+
*/
|
|
2
30
|
import { agentCapabilities } from '../capabilities.js';
|
|
3
|
-
import { DEFAULT_MODEL_OPTION } from './shared.js';
|
|
31
|
+
import { buildClaudeMcpConfigArgs, DEFAULT_MODEL_OPTION } from './shared.js';
|
|
4
32
|
import { loadMmdRouteModels } from '../mmd-routes.js';
|
|
5
33
|
/**
|
|
6
34
|
* The levels `claude --effort` accepts, as the CLI itself reports them when
|
|
@@ -12,14 +40,20 @@ import { loadMmdRouteModels } from '../mmd-routes.js';
|
|
|
12
40
|
const CLAUDE_EFFORT_LEVELS = new Set([
|
|
13
41
|
'low', 'medium', 'high', 'xhigh', 'max',
|
|
14
42
|
]);
|
|
43
|
+
// Current models first, then the still-active-but-superseded 4.5 opus/sonnet generation kept as
|
|
44
|
+
// older options rather than dropped — an installed CLI may still be pinned to one via its own
|
|
45
|
+
// config, and removing a working selection out from under a user is worse than listing it last.
|
|
46
|
+
// `claude-haiku-4-5` is unchanged: Haiku 4.5 is still the current Haiku model, nothing superseded it.
|
|
15
47
|
const CLAUDE_FALLBACK_MODELS = [
|
|
16
48
|
DEFAULT_MODEL_OPTION,
|
|
17
49
|
{ id: 'sonnet', label: 'Sonnet (alias)' },
|
|
18
50
|
{ id: 'opus', label: 'Opus (alias)' },
|
|
19
51
|
{ id: 'haiku', label: 'Haiku (alias)' },
|
|
52
|
+
{ id: 'claude-opus-5', label: 'claude-opus-5' },
|
|
53
|
+
{ id: 'claude-sonnet-5', label: 'claude-sonnet-5' },
|
|
54
|
+
{ id: 'claude-haiku-4-5', label: 'claude-haiku-4-5' },
|
|
20
55
|
{ id: 'claude-opus-4-5', label: 'claude-opus-4-5' },
|
|
21
56
|
{ id: 'claude-sonnet-4-5', label: 'claude-sonnet-4-5' },
|
|
22
|
-
{ id: 'claude-haiku-4-5', label: 'claude-haiku-4-5' },
|
|
23
57
|
];
|
|
24
58
|
export const claudeAgentDef = {
|
|
25
59
|
id: 'claude',
|
|
@@ -45,6 +79,7 @@ export const claudeAgentDef = {
|
|
|
45
79
|
'--include-partial-messages': 'partialMessages',
|
|
46
80
|
'--add-dir': 'addDir',
|
|
47
81
|
'--effort': 'effort',
|
|
82
|
+
'--append-system-prompt': 'appendSystemPrompt',
|
|
48
83
|
},
|
|
49
84
|
// `claude` has no list-models subcommand. Prefer local mmd/MMS routes
|
|
50
85
|
// when present so proxy-backed Claude-compatible models appear in the
|
|
@@ -104,6 +139,13 @@ export const claudeAgentDef = {
|
|
|
104
139
|
if (dirs.length > 0 && caps.addDir !== false) {
|
|
105
140
|
args.push('--add-dir', ...dirs);
|
|
106
141
|
}
|
|
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.
|
|
107
149
|
// Continue Claude's own CLI session across turns so it keeps its
|
|
108
150
|
// working memory (files read, edits made, tool history) instead of
|
|
109
151
|
// re-deriving everything from the rendered transcript each turn.
|
|
@@ -120,6 +162,12 @@ export const claudeAgentDef = {
|
|
|
120
162
|
if (options.permissionMode !== 'restricted') {
|
|
121
163
|
args.push('--permission-mode', 'bypassPermissions');
|
|
122
164
|
}
|
|
165
|
+
// Explicit `--strict-mcp-config --mcp-config <path>` instead of relying on Claude Code's
|
|
166
|
+
// auto-discovery of `.mcp.json` from cwd. Shared with every other `'claude-mcp-json'` def —
|
|
167
|
+
// see `buildClaudeMcpConfigArgs`'s own doc for why explicit, why strict, and why this is one
|
|
168
|
+
// implementation rather than a copy per def. A no-op (`[]`) whenever the caller staged no
|
|
169
|
+
// file, so a host that never configured MCP injection sees no argv change.
|
|
170
|
+
args.push(...buildClaudeMcpConfigArgs(runtimeContext));
|
|
123
171
|
return args;
|
|
124
172
|
},
|
|
125
173
|
promptViaStdin: true,
|
|
@@ -129,6 +177,16 @@ export const claudeAgentDef = {
|
|
|
129
177
|
// so the daemon writes the user's external MCP servers there before
|
|
130
178
|
// launching (server.ts handles the cwd guard).
|
|
131
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' },
|
|
132
185
|
resumesSessionViaCli: true,
|
|
186
|
+
// See this file's module doc's "Image delivery" section — the CLI reads
|
|
187
|
+
// a local file once its path is named in the prompt, so the daemon
|
|
188
|
+
// augments the prompt text and widens `extraAllowedDirs` on this def's
|
|
189
|
+
// behalf rather than this file forwarding `_imagePaths` itself.
|
|
190
|
+
imageDelivery: 'prompt-path',
|
|
133
191
|
};
|
|
134
192
|
//# sourceMappingURL=claude.js.map
|
package/dist/defs/claude.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/defs/claude.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/defs/claude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGtD;;;;;;GAMG;AACH,MAAM,oBAAoB,GAAwB,IAAI,GAAG,CAAC;IACxD,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK;CACxC,CAAC,CAAC;AAEH,gGAAgG;AAChG,8FAA8F;AAC9F,gGAAgG;AAChG,sGAAsG;AACtG,MAAM,sBAAsB,GAAG;IAC7B,oBAAoB;IACpB,EAAE,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE;IACzC,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE;IACrC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE;IACvC,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,eAAe,EAAE;IAC/C,EAAE,EAAE,EAA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F;QAC7F,0FAA0F;QAC1F,2EAA2E;QAC3E,IAAI,CAAC,IAAI,CAAC,GAAG,wBAAwB,CAAC,cAAc,CAAC,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,cAAc,EAAE,IAAI;IACpB,iBAAiB,EAAE,aAAa;IAChC,YAAY,EAAE,oBAAoB;IAClC,oEAAoE;IACpE,oEAAoE;IACpE,+CAA+C;IAC/C,oBAAoB,EAAE,iBAAiB;IACvC,0FAA0F;IAC1F,4FAA4F;IAC5F,2FAA2F;IAC3F,0CAA0C;IAC1C,oBAAoB,EAAE,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,wBAAwB,EAAE,aAAa,EAAE,oBAAoB,EAAE;IACtH,oBAAoB,EAAE,IAAI;IAC1B,wEAAwE;IACxE,mEAAmE;IACnE,uEAAuE;IACvE,gEAAgE;IAChE,aAAa,EAAE,aAAa;CACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codebuddy.d.ts","sourceRoot":"","sources":["../../src/defs/codebuddy.ts"],"names":[],"mappings":"AA+CA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"codebuddy.d.ts","sourceRoot":"","sources":["../../src/defs/codebuddy.ts"],"names":[],"mappings":"AA+CA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;CA4FH,CAAC"}
|