nexus-agents 11.6.2 → 11.7.0
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/dist/{ast-rule-runner-GRU2OC5H.js → ast-rule-runner-PIIAHXDA.js} +5 -5
- package/dist/{child-mcp-config-DNZN7CMS.js → child-mcp-config-B6BTYZT4.js} +4 -4
- package/dist/{chunk-L4QFWMXB.js → chunk-26WUCAGU.js} +4 -4
- package/dist/{chunk-MFBTGXR6.js → chunk-3QKRY72I.js} +8 -435
- package/dist/chunk-3QKRY72I.js.map +1 -0
- package/dist/{chunk-UMG4PRKT.js → chunk-4HOSKAB3.js} +4 -4
- package/dist/{chunk-2URHVZJR.js → chunk-4MKZAA6W.js} +5 -4
- package/dist/chunk-4MKZAA6W.js.map +1 -0
- package/dist/{chunk-JLJVZP7U.js → chunk-4NNCB7O2.js} +5 -5
- package/dist/{chunk-Z5XFIY4Q.js → chunk-5BEFQVPR.js} +2 -2
- package/dist/chunk-6IP3FOEC.js +365 -0
- package/dist/chunk-6IP3FOEC.js.map +1 -0
- package/dist/{chunk-4X4RJ6AP.js → chunk-6T6YL7MV.js} +4 -4
- package/dist/{chunk-RWBF3Y4A.js → chunk-7HI6EWY5.js} +2 -2
- package/dist/{chunk-45G5ZV3K.js → chunk-7Y6SB623.js} +2 -2
- package/dist/{chunk-N5YTX4UL.js → chunk-BSX3PMNN.js} +2 -2
- package/dist/{chunk-6A6YA4C4.js → chunk-BVUPPTAD.js} +6 -6
- package/dist/{chunk-L3VR5RXX.js → chunk-E5XKXB3G.js} +2 -2
- package/dist/chunk-ENX4WYFX.js +441 -0
- package/dist/chunk-ENX4WYFX.js.map +1 -0
- package/dist/{chunk-6WCFWNIR.js → chunk-FOJ2INSI.js} +3 -3
- package/dist/{chunk-OMQC4NWX.js → chunk-GCRXO43T.js} +2 -2
- package/dist/{chunk-U36QOTW3.js → chunk-HCTKX472.js} +8 -8
- package/dist/{chunk-2UEI7ZZ5.js → chunk-HT7QZ3JB.js} +5 -5
- package/dist/{chunk-7GTIW25A.js → chunk-IHGMXLLO.js} +6 -5
- package/dist/chunk-IHGMXLLO.js.map +1 -0
- package/dist/{chunk-UBK5LSLD.js → chunk-IJCEGKCM.js} +222 -152
- package/dist/{chunk-UBK5LSLD.js.map → chunk-IJCEGKCM.js.map} +1 -1
- package/dist/{chunk-4X3HAJWZ.js → chunk-IKGAI6ES.js} +2 -2
- package/dist/{chunk-GIW4L5PI.js → chunk-INVGMQKJ.js} +2 -2
- package/dist/{chunk-GP2O652R.js → chunk-JMKK6UBR.js} +34 -389
- package/dist/chunk-JMKK6UBR.js.map +1 -0
- package/dist/{chunk-STKHXNVO.js → chunk-ML7FSBBM.js} +4 -4
- package/dist/{chunk-CHYLIBKP.js → chunk-OHI6P6GE.js} +4 -4
- package/dist/{chunk-ZYZIRL4X.js → chunk-OMWOFIK5.js} +2657 -2525
- package/dist/chunk-OMWOFIK5.js.map +1 -0
- package/dist/{chunk-HWAJUCPO.js → chunk-PHLASJD2.js} +31 -26
- package/dist/chunk-PHLASJD2.js.map +1 -0
- package/dist/{chunk-2SFOJPJH.js → chunk-PYTN5UNL.js} +2 -2
- package/dist/{chunk-6KIQF3UT.js → chunk-RRZOCS22.js} +4 -4
- package/dist/{chunk-3QBKZZKE.js → chunk-U4GRHZRQ.js} +1705 -1490
- package/dist/chunk-U4GRHZRQ.js.map +1 -0
- package/dist/{chunk-UL2JGKCQ.js → chunk-VPRBPMVL.js} +3 -3
- package/dist/{chunk-O3FMPRQH.js → chunk-VVDPRJU7.js} +3 -1
- package/dist/chunk-VVDPRJU7.js.map +1 -0
- package/dist/{chunk-AZPPUDUR.js → chunk-YHW6FXKC.js} +7 -7
- package/dist/{chunk-PO2CMGVP.js → chunk-YI6DZGN6.js} +2 -2
- package/dist/{cli-circuit-breaker-KAOHEKYP.js → cli-circuit-breaker-HV7WXCVP.js} +5 -5
- package/dist/{cli-readiness-X7O3LCWW.js → cli-readiness-N4WWAROI.js} +10 -9
- package/dist/{cli-server-gateway-P4F66L2K.js → cli-server-gateway-5N7MHUO6.js} +15 -13
- package/dist/cli.js +88 -85
- package/dist/cli.js.map +1 -1
- package/dist/{composite-router-4QGXSANU.js → composite-router-TXGVXX56.js} +4 -4
- package/dist/{consensus-vote-ZCZJT3HS.js → consensus-vote-BYEM44JH.js} +19 -17
- package/dist/{context-retriever-2XMORQMD.js → context-retriever-NT2DYPFG.js} +11 -11
- package/dist/{doctor-deep-RLYWXUJX.js → doctor-deep-RUWHL6R5.js} +5 -5
- package/dist/{doctor-gateway-report-AKE3S2UH.js → doctor-gateway-report-BBMWMMVQ.js} +8 -8
- package/dist/{doctor-live-MA7S3NS7.js → doctor-live-NI27JU6K.js} +15 -13
- package/dist/{doctor-live-MA7S3NS7.js.map → doctor-live-NI27JU6K.js.map} +1 -1
- package/dist/{expert-bridge-2TNU6HKC.js → expert-bridge-V2R5PAXS.js} +6 -6
- package/dist/{factory-UCKSPZ5G.js → factory-3PBQNM44.js} +14 -12
- package/dist/{factory-5UWGAQOB.js → factory-YZILOS2Z.js} +7 -7
- package/dist/gemini-adapter-IZ3TS6KZ.js +28 -0
- package/dist/{improvement-review-PHNGPUYO.js → improvement-review-N6W2FWFO.js} +7 -7
- package/dist/index.d.ts +68 -2
- package/dist/index.js +132 -128
- package/dist/index.js.map +1 -1
- package/dist/{init-opencode-CII5S6XH.js → init-opencode-PLMPOB55.js} +7 -7
- package/dist/{issue-triage-DO6ATHBV.js → issue-triage-W5XKE324.js} +7 -7
- package/dist/{model-config-helpers-3U6IEHM6.js → model-config-helpers-5DTFDWYR.js} +7 -3
- package/dist/{openai-compat-adapter-7G6JYZLY.js → openai-compat-adapter-4VREPXZT.js} +7 -7
- package/dist/{pr-reviewer-helpers-JSLG5YYG.js → pr-reviewer-helpers-RAPVW52Y.js} +6 -6
- package/dist/{registry-command-X5NLFI3D.js → registry-command-3XWS7G6F.js} +2 -2
- package/dist/{repo-security-plan-DLROWMDR.js → repo-security-plan-BITATHGO.js} +4 -4
- package/dist/{research-helpers-synthesize-NE3I56IC.js → research-helpers-synthesize-FW47ZIMK.js} +6 -6
- package/dist/{routing-memory-YFSHH2AN.js → routing-memory-POESZPDJ.js} +4 -4
- package/dist/{session-memory-ZE2FUHO3.js → session-memory-TBBFP3XP.js} +5 -5
- package/dist/{setup-config-SFNU2QL4.js → setup-config-AKFLKDMP.js} +5 -5
- package/dist/{setup-custom-api-JBCH5YAW.js → setup-custom-api-WQMO2OV7.js} +5 -5
- package/dist/{tool-memory-Z3X6EFMS.js → tool-memory-RLCP6WVV.js} +7 -7
- package/dist/{unified-registry-2YSSICSB.js → unified-registry-MIANRTCJ.js} +14 -12
- package/dist/{weather-report-YSGMEYVV.js → weather-report-QB2TYTYU.js} +4 -4
- package/dist/weather-report-QB2TYTYU.js.map +1 -0
- package/package.json +1 -1
- package/dist/chunk-2URHVZJR.js.map +0 -1
- package/dist/chunk-3QBKZZKE.js.map +0 -1
- package/dist/chunk-7GTIW25A.js.map +0 -1
- package/dist/chunk-GP2O652R.js.map +0 -1
- package/dist/chunk-HWAJUCPO.js.map +0 -1
- package/dist/chunk-MFBTGXR6.js.map +0 -1
- package/dist/chunk-O3FMPRQH.js.map +0 -1
- package/dist/chunk-ZYZIRL4X.js.map +0 -1
- /package/dist/{ast-rule-runner-GRU2OC5H.js.map → ast-rule-runner-PIIAHXDA.js.map} +0 -0
- /package/dist/{child-mcp-config-DNZN7CMS.js.map → child-mcp-config-B6BTYZT4.js.map} +0 -0
- /package/dist/{chunk-L4QFWMXB.js.map → chunk-26WUCAGU.js.map} +0 -0
- /package/dist/{chunk-UMG4PRKT.js.map → chunk-4HOSKAB3.js.map} +0 -0
- /package/dist/{chunk-JLJVZP7U.js.map → chunk-4NNCB7O2.js.map} +0 -0
- /package/dist/{chunk-Z5XFIY4Q.js.map → chunk-5BEFQVPR.js.map} +0 -0
- /package/dist/{chunk-4X4RJ6AP.js.map → chunk-6T6YL7MV.js.map} +0 -0
- /package/dist/{chunk-RWBF3Y4A.js.map → chunk-7HI6EWY5.js.map} +0 -0
- /package/dist/{chunk-45G5ZV3K.js.map → chunk-7Y6SB623.js.map} +0 -0
- /package/dist/{chunk-N5YTX4UL.js.map → chunk-BSX3PMNN.js.map} +0 -0
- /package/dist/{chunk-6A6YA4C4.js.map → chunk-BVUPPTAD.js.map} +0 -0
- /package/dist/{chunk-L3VR5RXX.js.map → chunk-E5XKXB3G.js.map} +0 -0
- /package/dist/{chunk-6WCFWNIR.js.map → chunk-FOJ2INSI.js.map} +0 -0
- /package/dist/{chunk-OMQC4NWX.js.map → chunk-GCRXO43T.js.map} +0 -0
- /package/dist/{chunk-U36QOTW3.js.map → chunk-HCTKX472.js.map} +0 -0
- /package/dist/{chunk-2UEI7ZZ5.js.map → chunk-HT7QZ3JB.js.map} +0 -0
- /package/dist/{chunk-4X3HAJWZ.js.map → chunk-IKGAI6ES.js.map} +0 -0
- /package/dist/{chunk-GIW4L5PI.js.map → chunk-INVGMQKJ.js.map} +0 -0
- /package/dist/{chunk-STKHXNVO.js.map → chunk-ML7FSBBM.js.map} +0 -0
- /package/dist/{chunk-CHYLIBKP.js.map → chunk-OHI6P6GE.js.map} +0 -0
- /package/dist/{chunk-2SFOJPJH.js.map → chunk-PYTN5UNL.js.map} +0 -0
- /package/dist/{chunk-6KIQF3UT.js.map → chunk-RRZOCS22.js.map} +0 -0
- /package/dist/{chunk-UL2JGKCQ.js.map → chunk-VPRBPMVL.js.map} +0 -0
- /package/dist/{chunk-AZPPUDUR.js.map → chunk-YHW6FXKC.js.map} +0 -0
- /package/dist/{chunk-PO2CMGVP.js.map → chunk-YI6DZGN6.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-KAOHEKYP.js.map → cli-circuit-breaker-HV7WXCVP.js.map} +0 -0
- /package/dist/{cli-readiness-X7O3LCWW.js.map → cli-readiness-N4WWAROI.js.map} +0 -0
- /package/dist/{cli-server-gateway-P4F66L2K.js.map → cli-server-gateway-5N7MHUO6.js.map} +0 -0
- /package/dist/{composite-router-4QGXSANU.js.map → composite-router-TXGVXX56.js.map} +0 -0
- /package/dist/{consensus-vote-ZCZJT3HS.js.map → consensus-vote-BYEM44JH.js.map} +0 -0
- /package/dist/{context-retriever-2XMORQMD.js.map → context-retriever-NT2DYPFG.js.map} +0 -0
- /package/dist/{doctor-deep-RLYWXUJX.js.map → doctor-deep-RUWHL6R5.js.map} +0 -0
- /package/dist/{doctor-gateway-report-AKE3S2UH.js.map → doctor-gateway-report-BBMWMMVQ.js.map} +0 -0
- /package/dist/{expert-bridge-2TNU6HKC.js.map → expert-bridge-V2R5PAXS.js.map} +0 -0
- /package/dist/{factory-5UWGAQOB.js.map → factory-3PBQNM44.js.map} +0 -0
- /package/dist/{factory-UCKSPZ5G.js.map → factory-YZILOS2Z.js.map} +0 -0
- /package/dist/{improvement-review-PHNGPUYO.js.map → gemini-adapter-IZ3TS6KZ.js.map} +0 -0
- /package/dist/{issue-triage-DO6ATHBV.js.map → improvement-review-N6W2FWFO.js.map} +0 -0
- /package/dist/{init-opencode-CII5S6XH.js.map → init-opencode-PLMPOB55.js.map} +0 -0
- /package/dist/{model-config-helpers-3U6IEHM6.js.map → issue-triage-W5XKE324.js.map} +0 -0
- /package/dist/{openai-compat-adapter-7G6JYZLY.js.map → model-config-helpers-5DTFDWYR.js.map} +0 -0
- /package/dist/{pr-reviewer-helpers-JSLG5YYG.js.map → openai-compat-adapter-4VREPXZT.js.map} +0 -0
- /package/dist/{repo-security-plan-DLROWMDR.js.map → pr-reviewer-helpers-RAPVW52Y.js.map} +0 -0
- /package/dist/{registry-command-X5NLFI3D.js.map → registry-command-3XWS7G6F.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-NE3I56IC.js.map → repo-security-plan-BITATHGO.js.map} +0 -0
- /package/dist/{routing-memory-YFSHH2AN.js.map → research-helpers-synthesize-FW47ZIMK.js.map} +0 -0
- /package/dist/{session-memory-ZE2FUHO3.js.map → routing-memory-POESZPDJ.js.map} +0 -0
- /package/dist/{setup-config-SFNU2QL4.js.map → session-memory-TBBFP3XP.js.map} +0 -0
- /package/dist/{tool-memory-Z3X6EFMS.js.map → setup-config-AKFLKDMP.js.map} +0 -0
- /package/dist/{setup-custom-api-JBCH5YAW.js.map → setup-custom-api-WQMO2OV7.js.map} +0 -0
- /package/dist/{unified-registry-2YSSICSB.js.map → tool-memory-RLCP6WVV.js.map} +0 -0
- /package/dist/{weather-report-YSGMEYVV.js.map → unified-registry-MIANRTCJ.js.map} +0 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SubprocessCliAdapter,
|
|
3
|
+
estimateTaskComplexity,
|
|
4
|
+
executeCliRetryLoop,
|
|
5
|
+
getTimeoutForTask
|
|
6
|
+
} from "./chunk-3QKRY72I.js";
|
|
7
|
+
import {
|
|
8
|
+
AGY_MODEL_SLUGS,
|
|
9
|
+
CliCircuitBreaker,
|
|
10
|
+
DEFAULT_CIRCUIT_BREAKER_CONFIG,
|
|
11
|
+
GEMINI_CLI_COMMAND,
|
|
12
|
+
createCallerInputCliError,
|
|
13
|
+
err,
|
|
14
|
+
fromAgyModelSlug,
|
|
15
|
+
ok,
|
|
16
|
+
toAgyModelSlug,
|
|
17
|
+
withEnforcedAccessMode
|
|
18
|
+
} from "./chunk-OMWOFIK5.js";
|
|
19
|
+
import {
|
|
20
|
+
buildModelInfo,
|
|
21
|
+
getCliModelName,
|
|
22
|
+
getDefaultModelForCli,
|
|
23
|
+
resolveCliAlias
|
|
24
|
+
} from "./chunk-PHLASJD2.js";
|
|
25
|
+
import {
|
|
26
|
+
createLogger,
|
|
27
|
+
getTimeProvider
|
|
28
|
+
} from "./chunk-MQ23UGSY.js";
|
|
29
|
+
|
|
30
|
+
// src/cli-adapters/parsers/agy-parser.ts
|
|
31
|
+
import { z } from "zod";
|
|
32
|
+
var AgyUsageSchema = z.object({
|
|
33
|
+
input_tokens: z.number(),
|
|
34
|
+
output_tokens: z.number(),
|
|
35
|
+
thinking_tokens: z.number().optional(),
|
|
36
|
+
cache_read_tokens: z.number().optional(),
|
|
37
|
+
total_tokens: z.number()
|
|
38
|
+
});
|
|
39
|
+
var AgySuccessSchema = z.object({
|
|
40
|
+
status: z.literal("SUCCESS"),
|
|
41
|
+
response: z.string(),
|
|
42
|
+
conversation_id: z.string().optional(),
|
|
43
|
+
duration_seconds: z.number().optional(),
|
|
44
|
+
num_turns: z.number().optional(),
|
|
45
|
+
usage: AgyUsageSchema.optional()
|
|
46
|
+
});
|
|
47
|
+
var AgyErrorSchema = z.object({
|
|
48
|
+
status: z.string(),
|
|
49
|
+
error: z.string().optional(),
|
|
50
|
+
response: z.string().optional(),
|
|
51
|
+
conversation_id: z.string().optional()
|
|
52
|
+
});
|
|
53
|
+
function asJson(raw) {
|
|
54
|
+
try {
|
|
55
|
+
return JSON.parse(raw);
|
|
56
|
+
} catch {
|
|
57
|
+
return void 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
var AgyResponseParser = class {
|
|
61
|
+
name = "agy-parser";
|
|
62
|
+
supportedVersionRange = ">=1.0.0 <2.0.0";
|
|
63
|
+
parse(raw) {
|
|
64
|
+
const json = asJson(raw);
|
|
65
|
+
if (json === void 0) return null;
|
|
66
|
+
const parsed = AgySuccessSchema.safeParse(json);
|
|
67
|
+
return parsed.success ? parsed.data : null;
|
|
68
|
+
}
|
|
69
|
+
extractResponse(raw) {
|
|
70
|
+
return this.parse(raw)?.response ?? null;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The error text from a non-SUCCESS envelope, or null when the run succeeded
|
|
74
|
+
* or the output was not a recognizable agy envelope at all.
|
|
75
|
+
*
|
|
76
|
+
* Returning the message lets the adapter classify it (rate limit, auth,
|
|
77
|
+
* bad model) through the shared taxonomy rather than reporting a bare
|
|
78
|
+
* PARSE_ERROR — the same reason `opencode-parser` grew this method.
|
|
79
|
+
*/
|
|
80
|
+
extractErrorMessage(raw) {
|
|
81
|
+
const json = asJson(raw);
|
|
82
|
+
if (json === void 0) return null;
|
|
83
|
+
if (AgySuccessSchema.safeParse(json).success) return null;
|
|
84
|
+
const parsed = AgyErrorSchema.safeParse(json);
|
|
85
|
+
if (!parsed.success) return null;
|
|
86
|
+
return parsed.data.error ?? `agy reported status '${parsed.data.status}'`;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Maps agy's usage block onto {@link TokenUsage}.
|
|
90
|
+
*
|
|
91
|
+
* `thinking_tokens` are **folded into `outputTokens`** rather than dropped:
|
|
92
|
+
* they are generated, billable tokens, and discarding them would understate
|
|
93
|
+
* cost in exactly the outcome data the routing loop learns from.
|
|
94
|
+
* `cache_read_tokens` are deliberately NOT added — they are a subset of input
|
|
95
|
+
* already counted in `input_tokens`, so adding them would double-count.
|
|
96
|
+
*/
|
|
97
|
+
/**
|
|
98
|
+
* agy's `conversation_id` is the session handle — it is what `--conversation`
|
|
99
|
+
* accepts to resume a run, so it maps directly onto the session-id contract.
|
|
100
|
+
*/
|
|
101
|
+
extractSessionId(raw) {
|
|
102
|
+
const id = this.parse(raw)?.conversation_id;
|
|
103
|
+
return id === void 0 || id === "" ? null : id;
|
|
104
|
+
}
|
|
105
|
+
extractUsage(raw) {
|
|
106
|
+
const parsed = this.parse(raw);
|
|
107
|
+
if (parsed?.usage === void 0) return null;
|
|
108
|
+
const { input_tokens, output_tokens, thinking_tokens, total_tokens } = parsed.usage;
|
|
109
|
+
return {
|
|
110
|
+
inputTokens: input_tokens,
|
|
111
|
+
outputTokens: output_tokens + (thinking_tokens ?? 0),
|
|
112
|
+
totalTokens: total_tokens
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// src/cli-adapters/adapters/gemini-adapter-helpers.ts
|
|
118
|
+
var GEMINI_LEGACY_DEFAULTS = {
|
|
119
|
+
displayNames: {},
|
|
120
|
+
contextWindows: {},
|
|
121
|
+
inputCosts: {},
|
|
122
|
+
outputCosts: {},
|
|
123
|
+
contextWindow: 1e6,
|
|
124
|
+
inputCost: 0.15,
|
|
125
|
+
outputCost: 0.6
|
|
126
|
+
};
|
|
127
|
+
function createCircuitOpenError(cli) {
|
|
128
|
+
return {
|
|
129
|
+
code: "EXECUTION_ERROR",
|
|
130
|
+
message: `Circuit breaker is open - ${cli} CLI temporarily unavailable`,
|
|
131
|
+
cli,
|
|
132
|
+
retryable: false
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// src/cli-adapters/adapters/agy-invocation.ts
|
|
137
|
+
var DEFAULT_GEMINI_CLI_MODEL = getCliModelName(getDefaultModelForCli("gemini"));
|
|
138
|
+
var AGY_PRINT_TIMEOUT_HEADROOM_MS = 5e3;
|
|
139
|
+
var AGY_PRINT_TIMEOUT_FLOOR_S = 30;
|
|
140
|
+
function agyPrintTimeoutArgs(timeoutMs) {
|
|
141
|
+
if (timeoutMs === void 0) return [];
|
|
142
|
+
const seconds = Math.floor((timeoutMs - AGY_PRINT_TIMEOUT_HEADROOM_MS) / 1e3);
|
|
143
|
+
return ["--print-timeout", `${String(Math.max(AGY_PRINT_TIMEOUT_FLOOR_S, seconds))}s`];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// src/cli-adapters/adapters/gemini-adapter.ts
|
|
147
|
+
var DEFAULT_CONFIG = {
|
|
148
|
+
model: DEFAULT_GEMINI_CLI_MODEL,
|
|
149
|
+
maxRetries: 3,
|
|
150
|
+
baseDelayMs: 1e3,
|
|
151
|
+
maxDelayMs: 3e4,
|
|
152
|
+
enableCircuitBreaker: true
|
|
153
|
+
};
|
|
154
|
+
var GeminiCliAdapter = class extends SubprocessCliAdapter {
|
|
155
|
+
name = "gemini";
|
|
156
|
+
// agy cannot enforce read-only analysis (#6962), so it refuses those tasks.
|
|
157
|
+
// #6754 mapped the mode to `--mode plan --sandbox` from `agy --help` alone.
|
|
158
|
+
// Observed live on 2026-10-02 with agy 1.2.15: given exactly that argv and a
|
|
159
|
+
// prompt asking it to, agy created `pwned.txt` and rewrote a committed file
|
|
160
|
+
// in a scratch repository, on two differently phrased prompts. Plan mode
|
|
161
|
+
// writes a plan and then executes it in print mode; `--sandbox` restricts
|
|
162
|
+
// the terminal, not the file-edit tools.
|
|
163
|
+
enforcesReadOnlyAnalysis = false;
|
|
164
|
+
/**
|
|
165
|
+
* #4346: the arm is still called `gemini` (it serves Google's Gemini models
|
|
166
|
+
* and keeps the routing/LinUCB identity), but the executable is `agy`. The
|
|
167
|
+
* standalone gemini CLI is EOL — it exits 55 with IneligibleTierError on
|
|
168
|
+
* every invocation.
|
|
169
|
+
*/
|
|
170
|
+
get binaryName() {
|
|
171
|
+
return GEMINI_CLI_COMMAND;
|
|
172
|
+
}
|
|
173
|
+
parser;
|
|
174
|
+
model;
|
|
175
|
+
maxRetries;
|
|
176
|
+
baseDelayMs;
|
|
177
|
+
maxDelayMs;
|
|
178
|
+
circuitBreaker;
|
|
179
|
+
adapterLogger;
|
|
180
|
+
constructor(options) {
|
|
181
|
+
const mergedConfig = { ...DEFAULT_CONFIG, ...options };
|
|
182
|
+
super(options?.logger);
|
|
183
|
+
this.model = mergedConfig.model;
|
|
184
|
+
this.maxRetries = mergedConfig.maxRetries;
|
|
185
|
+
this.baseDelayMs = mergedConfig.baseDelayMs;
|
|
186
|
+
this.maxDelayMs = mergedConfig.maxDelayMs;
|
|
187
|
+
this.parser = new AgyResponseParser();
|
|
188
|
+
this.adapterLogger = options?.logger ?? createLogger({ component: "gemini-adapter" });
|
|
189
|
+
if (mergedConfig.enableCircuitBreaker) {
|
|
190
|
+
const cbConfig = {
|
|
191
|
+
...DEFAULT_CIRCUIT_BREAKER_CONFIG,
|
|
192
|
+
...options?.circuitBreakerConfig
|
|
193
|
+
};
|
|
194
|
+
this.circuitBreaker = new CliCircuitBreaker("gemini", cbConfig);
|
|
195
|
+
} else {
|
|
196
|
+
this.circuitBreaker = null;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/** Key-free model enumeration via the models.dev snapshot (#3405). */
|
|
200
|
+
/**
|
|
201
|
+
* The slugs this arm can actually run (#5085).
|
|
202
|
+
*
|
|
203
|
+
* NOT `listModelsForCli('gemini')`, which resolves the models.dev `google`
|
|
204
|
+
* vendor — 82 Google **API** ids like `gemini-2.5-flash`. This arm spawns
|
|
205
|
+
* `agy`, which accepts none of them; the same reasoning already documented
|
|
206
|
+
* for `cliModelName` in `config/agy-model-map.ts` applies to enumeration.
|
|
207
|
+
* Reporting the API list made every consumer confidently wrong rather than
|
|
208
|
+
* empty, which is worse.
|
|
209
|
+
*/
|
|
210
|
+
listModels() {
|
|
211
|
+
return Promise.resolve(AGY_MODEL_SLUGS.map((id) => ({ id, provider: "antigravity" })));
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Gets Gemini model information.
|
|
215
|
+
* Resolves from canonical registry when possible, falls back to legacy lookup.
|
|
216
|
+
* Note: maxOutput is capped at 8_192 (Gemini CLI constraint).
|
|
217
|
+
*/
|
|
218
|
+
getModelInfo() {
|
|
219
|
+
let selected = this.model;
|
|
220
|
+
try {
|
|
221
|
+
const canonical = fromAgyModelSlug(toAgyModelSlug(this.model));
|
|
222
|
+
const resolved = canonical === null ? void 0 : resolveCliAlias(canonical);
|
|
223
|
+
if (resolved !== void 0) selected = getCliModelName(resolved);
|
|
224
|
+
} catch {
|
|
225
|
+
}
|
|
226
|
+
const fromRegistry = buildModelInfo("gemini", selected);
|
|
227
|
+
if (fromRegistry !== void 0) {
|
|
228
|
+
return { ...fromRegistry, maxOutput: 8192 };
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
id: this.model,
|
|
232
|
+
name: GEMINI_LEGACY_DEFAULTS.displayNames[this.model] ?? this.model,
|
|
233
|
+
contextWindow: GEMINI_LEGACY_DEFAULTS.contextWindows[this.model] ?? GEMINI_LEGACY_DEFAULTS.contextWindow,
|
|
234
|
+
maxOutput: 8192,
|
|
235
|
+
costPerMillionInput: GEMINI_LEGACY_DEFAULTS.inputCosts[this.model] ?? GEMINI_LEGACY_DEFAULTS.inputCost,
|
|
236
|
+
costPerMillionOutput: GEMINI_LEGACY_DEFAULTS.outputCosts[this.model] ?? GEMINI_LEGACY_DEFAULTS.outputCost
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Executes a task with reliability features.
|
|
241
|
+
*/
|
|
242
|
+
async execute(task, options) {
|
|
243
|
+
const result = await this.executeWithMetadata(task, options);
|
|
244
|
+
if (result.ok) {
|
|
245
|
+
return ok(withEnforcedAccessMode(result.value.response, task));
|
|
246
|
+
}
|
|
247
|
+
return err(result.error);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Executes with full metadata about retry attempts and circuit state.
|
|
251
|
+
*/
|
|
252
|
+
async executeWithMetadata(task, options) {
|
|
253
|
+
const refusal = await this.accessModeRefusal(task);
|
|
254
|
+
if (refusal !== void 0) return err(refusal);
|
|
255
|
+
try {
|
|
256
|
+
toAgyModelSlug(task.model ?? this.model);
|
|
257
|
+
} catch (error) {
|
|
258
|
+
return err(
|
|
259
|
+
createCallerInputCliError(
|
|
260
|
+
error instanceof Error ? error.message : "Unsupported AGY model",
|
|
261
|
+
"gemini"
|
|
262
|
+
)
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
const circuitCheckResult = this.checkCircuitBreaker();
|
|
266
|
+
if (circuitCheckResult !== null) {
|
|
267
|
+
return err(circuitCheckResult);
|
|
268
|
+
}
|
|
269
|
+
const startTime = getTimeProvider().now();
|
|
270
|
+
const complexity = estimateTaskComplexity(task.content);
|
|
271
|
+
const effectiveOptions = this.buildExecutionOptions(task.content, options);
|
|
272
|
+
const result = await this.executeWithRetryTracking(task, effectiveOptions);
|
|
273
|
+
return this.buildExecutionResult(result, startTime, complexity);
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Gets current circuit breaker snapshot.
|
|
277
|
+
*/
|
|
278
|
+
getCircuitBreakerSnapshot() {
|
|
279
|
+
return this.circuitBreaker?.getSnapshot() ?? null;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Resets the circuit breaker to closed state.
|
|
283
|
+
*/
|
|
284
|
+
resetCircuitBreaker() {
|
|
285
|
+
this.circuitBreaker?.reset();
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Gets CLI command and arguments for execution.
|
|
289
|
+
*/
|
|
290
|
+
getCommand(task) {
|
|
291
|
+
const args = [];
|
|
292
|
+
args.push("--output-format", "json");
|
|
293
|
+
const requested = task.model ?? this.model;
|
|
294
|
+
const model = toAgyModelSlug(requested);
|
|
295
|
+
if (model !== requested) {
|
|
296
|
+
this.adapterLogger.debug("Substituted an agy model slug", { requested, model });
|
|
297
|
+
}
|
|
298
|
+
args.push("--model", model);
|
|
299
|
+
if (task.sessionId !== void 0 && task.sessionId !== "") {
|
|
300
|
+
args.push("--conversation", task.sessionId);
|
|
301
|
+
}
|
|
302
|
+
const workDir = task.options?.["workDir"];
|
|
303
|
+
args.push("--add-dir", typeof workDir === "string" && workDir !== "" ? workDir : process.cwd());
|
|
304
|
+
args.push(...agyPrintTimeoutArgs(task.timeoutMs));
|
|
305
|
+
const content = task.systemPrompt !== void 0 && task.systemPrompt !== "" ? `${task.systemPrompt}
|
|
306
|
+
|
|
307
|
+
${task.content}` : task.content;
|
|
308
|
+
return { command: this.binaryName, args, stdin: content };
|
|
309
|
+
}
|
|
310
|
+
checkCircuitBreaker() {
|
|
311
|
+
if (this.circuitBreaker === null) {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
if (this.circuitBreaker.getState() === "open") {
|
|
315
|
+
return createCircuitOpenError("gemini");
|
|
316
|
+
}
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
buildExecutionOptions(taskContent, options) {
|
|
320
|
+
const complexity = estimateTaskComplexity(taskContent);
|
|
321
|
+
const timeoutMs = options?.timeoutMs ?? getTimeoutForTask(this.name, complexity);
|
|
322
|
+
return {
|
|
323
|
+
timeoutMs,
|
|
324
|
+
allowRetry: options?.allowRetry ?? true,
|
|
325
|
+
maxRetries: options?.maxRetries ?? this.maxRetries,
|
|
326
|
+
trackUsage: options?.trackUsage ?? true,
|
|
327
|
+
onProgress: options?.onProgress
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
buildExecutionResult(result, startTime, complexity) {
|
|
331
|
+
const totalDurationMs = getTimeProvider().now() - startTime;
|
|
332
|
+
const circuitState = this.circuitBreaker?.getState() ?? "closed";
|
|
333
|
+
if (result.ok) {
|
|
334
|
+
this.circuitBreaker?.recordSuccess();
|
|
335
|
+
return ok({
|
|
336
|
+
response: result.value.response,
|
|
337
|
+
retryCount: result.value.retryCount,
|
|
338
|
+
totalDurationMs,
|
|
339
|
+
complexity,
|
|
340
|
+
circuitState
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
return err(result.error);
|
|
344
|
+
}
|
|
345
|
+
async executeWithRetryTracking(task, options) {
|
|
346
|
+
return executeCliRetryLoop(() => this.executeTask(task, options), {
|
|
347
|
+
maxRetries: options.maxRetries,
|
|
348
|
+
allowRetry: this.shouldOuterRetry(options),
|
|
349
|
+
baseDelayMs: this.baseDelayMs,
|
|
350
|
+
maxDelayMs: this.maxDelayMs,
|
|
351
|
+
circuitBreaker: this.circuitBreaker,
|
|
352
|
+
cli: this.name,
|
|
353
|
+
logger: this.adapterLogger
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
function createGeminiAdapter(options) {
|
|
358
|
+
return new GeminiCliAdapter(options);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
export {
|
|
362
|
+
GeminiCliAdapter,
|
|
363
|
+
createGeminiAdapter
|
|
364
|
+
};
|
|
365
|
+
//# sourceMappingURL=chunk-6IP3FOEC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli-adapters/parsers/agy-parser.ts","../src/cli-adapters/adapters/gemini-adapter-helpers.ts","../src/cli-adapters/adapters/agy-invocation.ts","../src/cli-adapters/adapters/gemini-adapter.ts"],"sourcesContent":["/**\n * nexus-agents/cli-adapters - Antigravity (`agy`) CLI Response Parser\n *\n * Parses `agy --output-format json`, the replacement for the retired standalone\n * `gemini` CLI (#4346).\n *\n * FAIL-CLOSED BY CONSTRUCTION. `agy` exits 0 even when the run failed — a bad\n * model returns `{\"status\":\"ERROR\",\"response\":\"\",\"error\":\"…\"}` with exit code 0.\n * The verdict lives in the `status` field, so this parser treats anything that\n * is not an explicit `SUCCESS` envelope with a string `response` as a failure:\n * unparseable output, truncated JSON, a missing `status`, an unrecognized\n * `status`, and a non-string `response` all yield `null`. Callers must not\n * infer success from the process exit code.\n *\n * Verified against `agy` v1.1.9 (2026-08-09).\n *\n * @module cli-adapters/parsers/agy-parser\n */\n\nimport { z } from 'zod';\nimport type { ICliResponseParser, TokenUsage } from '../types.js';\n\n/**\n * The usage block agy reports. `thinking_tokens` and `cache_read_tokens` have no\n * home in {@link TokenUsage}; see {@link AgyResponseParser.extractUsage} for how\n * they are handled rather than dropped.\n */\nconst AgyUsageSchema = z.object({\n input_tokens: z.number(),\n output_tokens: z.number(),\n thinking_tokens: z.number().optional(),\n cache_read_tokens: z.number().optional(),\n total_tokens: z.number(),\n});\n\n/**\n * A successful agy envelope. `status` is pinned to the literal `SUCCESS` so an\n * unrecognized future status (e.g. a `PARTIAL`) fails the parse instead of being\n * waved through as a success.\n */\nconst AgySuccessSchema = z.object({\n status: z.literal('SUCCESS'),\n response: z.string(),\n conversation_id: z.string().optional(),\n duration_seconds: z.number().optional(),\n num_turns: z.number().optional(),\n usage: AgyUsageSchema.optional(),\n});\n\n/** A failed agy envelope — still delivered with exit code 0. */\nconst AgyErrorSchema = z.object({\n status: z.string(),\n error: z.string().optional(),\n response: z.string().optional(),\n conversation_id: z.string().optional(),\n});\n\n/** A parsed, validated agy success envelope. */\nexport type AgyCliResponse = z.infer<typeof AgySuccessSchema>;\n\n/** Parse raw stdout as JSON, or undefined when it is not JSON at all. */\nfunction asJson(raw: string): unknown {\n try {\n return JSON.parse(raw);\n } catch {\n return undefined;\n }\n}\n\n/**\n * Parser for `agy --output-format json`.\n *\n * `parse` returns a value ONLY for a well-formed success envelope. Failure\n * detail is available separately via {@link AgyResponseParser.extractErrorMessage}.\n */\nexport class AgyResponseParser implements ICliResponseParser<AgyCliResponse> {\n readonly name = 'agy-parser';\n readonly supportedVersionRange = '>=1.0.0 <2.0.0';\n\n parse(raw: string): AgyCliResponse | null {\n const json = asJson(raw);\n if (json === undefined) return null;\n const parsed = AgySuccessSchema.safeParse(json);\n return parsed.success ? parsed.data : null;\n }\n\n extractResponse(raw: string): string | null {\n return this.parse(raw)?.response ?? null;\n }\n\n /**\n * The error text from a non-SUCCESS envelope, or null when the run succeeded\n * or the output was not a recognizable agy envelope at all.\n *\n * Returning the message lets the adapter classify it (rate limit, auth,\n * bad model) through the shared taxonomy rather than reporting a bare\n * PARSE_ERROR — the same reason `opencode-parser` grew this method.\n */\n extractErrorMessage(raw: string): string | null {\n const json = asJson(raw);\n if (json === undefined) return null;\n // A valid success envelope has no error to report.\n if (AgySuccessSchema.safeParse(json).success) return null;\n const parsed = AgyErrorSchema.safeParse(json);\n if (!parsed.success) return null;\n return parsed.data.error ?? `agy reported status '${parsed.data.status}'`;\n }\n\n /**\n * Maps agy's usage block onto {@link TokenUsage}.\n *\n * `thinking_tokens` are **folded into `outputTokens`** rather than dropped:\n * they are generated, billable tokens, and discarding them would understate\n * cost in exactly the outcome data the routing loop learns from.\n * `cache_read_tokens` are deliberately NOT added — they are a subset of input\n * already counted in `input_tokens`, so adding them would double-count.\n */\n /**\n * agy's `conversation_id` is the session handle — it is what `--conversation`\n * accepts to resume a run, so it maps directly onto the session-id contract.\n */\n extractSessionId(raw: string): string | null {\n const id = this.parse(raw)?.conversation_id;\n return id === undefined || id === '' ? null : id;\n }\n\n extractUsage(raw: string): TokenUsage | null {\n const parsed = this.parse(raw);\n if (parsed?.usage === undefined) return null;\n const { input_tokens, output_tokens, thinking_tokens, total_tokens } = parsed.usage;\n return {\n inputTokens: input_tokens,\n outputTokens: output_tokens + (thinking_tokens ?? 0),\n totalTokens: total_tokens,\n };\n }\n}\n","/**\n * nexus-agents/cli-adapters - Gemini CLI Adapter Helpers\n *\n * CLI-specific helper functions for retry logic and error handling.\n * Model info lookups consolidated into config/model-config-helpers.ts (#886).\n */\n\nimport type { CliError, CliName } from '../types.js';\n\n// -----------------------------------------------------------------------------\n// Fallback Defaults (for unknown models not in canonical registry)\n// -----------------------------------------------------------------------------\n\n/**\n * Fallback defaults for Gemini models not in the canonical registry.\n * All current models are in config/in-tree-data.ts and served by\n * buildModelInfo('gemini', model). This provides sensible defaults\n * when an unknown model name is encountered at runtime.\n *\n * @see config/in-tree-data.ts — single source of truth for current models\n */\nexport const GEMINI_LEGACY_DEFAULTS = {\n displayNames: {} as Readonly<Record<string, string>>,\n contextWindows: {} as Readonly<Record<string, number>>,\n inputCosts: {} as Readonly<Record<string, number>>,\n outputCosts: {} as Readonly<Record<string, number>>,\n contextWindow: 1_000_000,\n inputCost: 0.15,\n outputCost: 0.6,\n} as const;\n\n// -----------------------------------------------------------------------------\n// Re-exports from canonical cli-retry-loop.ts (Issue #1596)\n// -----------------------------------------------------------------------------\n\nexport { calculateBackoffDelay, isRetryableError, categorizeError } from '../cli-retry-loop.js';\n\n// -----------------------------------------------------------------------------\n// Error Factory\n// -----------------------------------------------------------------------------\n\n/** Creates a circuit breaker open error. */\nexport function createCircuitOpenError(cli: CliName): CliError {\n return {\n code: 'EXECUTION_ERROR',\n message: `Circuit breaker is open - ${cli} CLI temporarily unavailable`,\n cli,\n retryable: false,\n };\n}\n\n// -----------------------------------------------------------------------------\n// Utility Functions\n// -----------------------------------------------------------------------------\n\n// Re-export from canonical source for backward compatibility\nexport { delay } from '../../utils/async-utils.js';\n","/**\n * agy invocation helpers shared by the gemini adapter and the `pnpm review`\n * script (#4389), so both spawn agy with the same default model and the same\n * print-mode wait.\n *\n * @module cli-adapters/adapters/agy-invocation\n */\n\nimport { getCliModelName, getDefaultModelForCli } from '../../config/model-config-helpers.js';\n\n/** Derive the CLI model name for the default Gemini model from the canonical registry. */\nexport const DEFAULT_GEMINI_CLI_MODEL: string = getCliModelName(getDefaultModelForCli('gemini'));\n\n/** Headroom between agy's print-mode wait and the subprocess guard (#6277). */\nconst AGY_PRINT_TIMEOUT_HEADROOM_MS = 5_000;\n/** Shortest wait handed to agy; below this a seat cannot answer at all. */\nconst AGY_PRINT_TIMEOUT_FLOOR_S = 30;\n\n/**\n * agy's `--print-timeout` argv (Go duration, whole seconds) for a task\n * budget: the guard minus a fixed headroom, never below the floor. No\n * budget → no flag, so agy's own default applies.\n */\nexport function agyPrintTimeoutArgs(timeoutMs: number | undefined): readonly string[] {\n if (timeoutMs === undefined) return [];\n const seconds = Math.floor((timeoutMs - AGY_PRINT_TIMEOUT_HEADROOM_MS) / 1000);\n return ['--print-timeout', `${String(Math.max(AGY_PRINT_TIMEOUT_FLOOR_S, seconds))}s`];\n}\n","/**\n * nexus-agents/cli-adapters - Gemini CLI Adapter\n *\n * Subprocess-based adapter for Gemini CLI with:\n * - Tiered timeout profiles based on task complexity\n * - Resilient JSON parsing with fallback strategies\n * - Exponential backoff retry logic\n * - Circuit breaker integration for sustained failures\n *\n * (Source: cli-project_plan.md v2.1.0)\n * (Source: Issue #366 - Gemini CLI timeout and parser improvements)\n * (Source: Issue #389 - Merged enhanced adapter back to canonical)\n */\n\nimport type { Result, ILogger } from '../../core/index.js';\nimport { ok, err, createLogger, getTimeProvider } from '../../core/index.js';\nimport type {\n ICliResponseParser,\n CliTask,\n CliResponse,\n CliError,\n ModelInfo,\n CliName,\n ExecutionOptions,\n ResolvedExecutionOptions,\n BaseAdapterOptions,\n} from '../types.js';\nimport { SubprocessCliAdapter, type CommandConfig } from '../subprocess-adapter.js';\nimport { createCallerInputCliError } from '../cli-error-helpers.js';\nimport { withEnforcedAccessMode } from '../access-mode.js';\nimport { AgyResponseParser } from '../parsers/agy-parser.js';\nimport { toAgyModelSlug, fromAgyModelSlug, AGY_MODEL_SLUGS } from '../../config/agy-model-map.js';\nimport type { CliModelInfo } from '../types-capability.js';\nimport {\n getTimeoutForTask,\n estimateTaskComplexity,\n type TaskComplexity,\n} from '../cli-timeout-profiles.js';\nimport {\n CliCircuitBreaker,\n DEFAULT_CIRCUIT_BREAKER_CONFIG,\n type CircuitBreakerConfig,\n type CircuitBreakerSnapshot,\n} from '../circuit-breaker.js';\nimport { GEMINI_LEGACY_DEFAULTS, createCircuitOpenError } from './gemini-adapter-helpers.js';\nimport { executeCliRetryLoop } from '../cli-retry-loop.js';\nimport { GEMINI_CLI_COMMAND } from '../cli-error-envelope.js';\nimport { DEFAULT_GEMINI_CLI_MODEL, agyPrintTimeoutArgs } from './agy-invocation.js';\nimport {\n buildModelInfo,\n getCliModelName,\n resolveCliAlias,\n} from '../../config/model-config-helpers.js';\n\n/** Configuration for Gemini adapter. Extends BaseAdapterOptions with retry/circuit breaker. */\nexport interface GeminiConfig extends BaseAdapterOptions {\n /** Maximum retry attempts (default: 3) */\n readonly maxRetries?: number;\n /** Base delay for exponential backoff in ms (default: 1000) */\n readonly baseDelayMs?: number;\n /** Maximum delay for backoff in ms (default: 30000) */\n readonly maxDelayMs?: number;\n /** Circuit breaker configuration */\n readonly circuitBreakerConfig?: Partial<CircuitBreakerConfig>;\n /** Enable circuit breaker (default: true) */\n readonly enableCircuitBreaker?: boolean;\n}\n\n/** Execution result with metadata. */\nexport interface GeminiExecutionResult {\n readonly response: CliResponse;\n readonly retryCount: number;\n readonly totalDurationMs: number;\n readonly complexity: TaskComplexity;\n readonly circuitState: 'closed' | 'open' | 'half-open';\n}\n\nconst DEFAULT_CONFIG: Required<Omit<GeminiConfig, 'logger' | 'circuitBreakerConfig'>> = {\n model: DEFAULT_GEMINI_CLI_MODEL,\n maxRetries: 3,\n baseDelayMs: 1000,\n maxDelayMs: 30_000,\n enableCircuitBreaker: true,\n};\n\n/**\n * The executable name spawned by the Gemini CLI adapter (#4346, #6278).\n * The standalone gemini CLI is EOL — it exits 55 with IneligibleTierError on\n * every invocation.\n */\nexport { GEMINI_CLI_COMMAND };\n\n/**\n * Gemini CLI adapter with reliability features.\n *\n * Includes tiered timeouts, resilient parsing, retry logic, and circuit breaker.\n */\nexport class GeminiCliAdapter extends SubprocessCliAdapter {\n readonly name: CliName = 'gemini';\n // agy cannot enforce read-only analysis (#6962), so it refuses those tasks.\n // #6754 mapped the mode to `--mode plan --sandbox` from `agy --help` alone.\n // Observed live on 2026-10-02 with agy 1.2.15: given exactly that argv and a\n // prompt asking it to, agy created `pwned.txt` and rewrote a committed file\n // in a scratch repository, on two differently phrased prompts. Plan mode\n // writes a plan and then executes it in print mode; `--sandbox` restricts\n // the terminal, not the file-edit tools.\n override readonly enforcesReadOnlyAnalysis = false;\n\n /**\n * #4346: the arm is still called `gemini` (it serves Google's Gemini models\n * and keeps the routing/LinUCB identity), but the executable is `agy`. The\n * standalone gemini CLI is EOL — it exits 55 with IneligibleTierError on\n * every invocation.\n */\n override get binaryName(): string {\n return GEMINI_CLI_COMMAND;\n }\n protected readonly parser: ICliResponseParser;\n\n private readonly model: string;\n private readonly maxRetries: number;\n private readonly baseDelayMs: number;\n private readonly maxDelayMs: number;\n private readonly circuitBreaker: CliCircuitBreaker | null;\n private readonly adapterLogger: ILogger;\n\n constructor(options?: GeminiConfig) {\n const mergedConfig = { ...DEFAULT_CONFIG, ...options };\n super(options?.logger);\n\n this.model = mergedConfig.model;\n this.maxRetries = mergedConfig.maxRetries;\n this.baseDelayMs = mergedConfig.baseDelayMs;\n this.maxDelayMs = mergedConfig.maxDelayMs;\n this.parser = new AgyResponseParser();\n this.adapterLogger = options?.logger ?? createLogger({ component: 'gemini-adapter' });\n\n // Initialize circuit breaker if enabled\n if (mergedConfig.enableCircuitBreaker) {\n const cbConfig: CircuitBreakerConfig = {\n ...DEFAULT_CIRCUIT_BREAKER_CONFIG,\n ...options?.circuitBreakerConfig,\n };\n this.circuitBreaker = new CliCircuitBreaker('gemini', cbConfig);\n } else {\n this.circuitBreaker = null;\n }\n }\n\n /** Key-free model enumeration via the models.dev snapshot (#3405). */\n /**\n * The slugs this arm can actually run (#5085).\n *\n * NOT `listModelsForCli('gemini')`, which resolves the models.dev `google`\n * vendor — 82 Google **API** ids like `gemini-2.5-flash`. This arm spawns\n * `agy`, which accepts none of them; the same reasoning already documented\n * for `cliModelName` in `config/agy-model-map.ts` applies to enumeration.\n * Reporting the API list made every consumer confidently wrong rather than\n * empty, which is worse.\n */\n listModels(): Promise<readonly CliModelInfo[]> {\n return Promise.resolve(AGY_MODEL_SLUGS.map((id) => ({ id, provider: 'antigravity' })));\n }\n\n /**\n * Gets Gemini model information.\n * Resolves from canonical registry when possible, falls back to legacy lookup.\n * Note: maxOutput is capped at 8_192 (Gemini CLI constraint).\n */\n getModelInfo(): ModelInfo {\n // Describe a supported migrated selection honestly; unsupported configured\n // models retain their requested descriptor but are refused at execution.\n let selected = this.model;\n try {\n const canonical = fromAgyModelSlug(toAgyModelSlug(this.model));\n const resolved = canonical === null ? undefined : resolveCliAlias(canonical);\n if (resolved !== undefined) selected = getCliModelName(resolved);\n } catch {\n /* No selection: execution returns a non-retryable refusal. */\n }\n const fromRegistry = buildModelInfo('gemini', selected);\n if (fromRegistry !== undefined) {\n return { ...fromRegistry, maxOutput: 8_192 };\n }\n return {\n id: this.model,\n name: GEMINI_LEGACY_DEFAULTS.displayNames[this.model] ?? this.model,\n contextWindow:\n GEMINI_LEGACY_DEFAULTS.contextWindows[this.model] ?? GEMINI_LEGACY_DEFAULTS.contextWindow,\n maxOutput: 8_192,\n costPerMillionInput:\n GEMINI_LEGACY_DEFAULTS.inputCosts[this.model] ?? GEMINI_LEGACY_DEFAULTS.inputCost,\n costPerMillionOutput:\n GEMINI_LEGACY_DEFAULTS.outputCosts[this.model] ?? GEMINI_LEGACY_DEFAULTS.outputCost,\n };\n }\n\n /**\n * Executes a task with reliability features.\n */\n override async execute(\n task: CliTask,\n options?: ExecutionOptions\n ): Promise<Result<CliResponse, CliError>> {\n const result = await this.executeWithMetadata(task, options);\n\n if (result.ok) {\n // #6792: this path bypasses the base execute, so it stamps the mode too.\n return ok(withEnforcedAccessMode(result.value.response, task));\n }\n\n return err(result.error);\n }\n\n /**\n * Executes with full metadata about retry attempts and circuit state.\n */\n async executeWithMetadata(\n task: CliTask,\n options?: ExecutionOptions\n ): Promise<Result<GeminiExecutionResult, CliError>> {\n // #6754: this path bypasses the base execute, so it applies the same\n // fail-closed access-mode check first.\n const refusal = await this.accessModeRefusal(task);\n if (refusal !== undefined) return err(refusal);\n try {\n toAgyModelSlug(task.model ?? this.model);\n } catch (error: unknown) {\n return err(\n createCallerInputCliError(\n error instanceof Error ? error.message : 'Unsupported AGY model',\n 'gemini'\n )\n );\n }\n const circuitCheckResult = this.checkCircuitBreaker();\n if (circuitCheckResult !== null) {\n return err(circuitCheckResult);\n }\n\n const startTime = getTimeProvider().now();\n const complexity = estimateTaskComplexity(task.content);\n const effectiveOptions = this.buildExecutionOptions(task.content, options);\n\n const result = await this.executeWithRetryTracking(task, effectiveOptions);\n\n return this.buildExecutionResult(result, startTime, complexity);\n }\n\n /**\n * Gets current circuit breaker snapshot.\n */\n getCircuitBreakerSnapshot(): CircuitBreakerSnapshot | null {\n return this.circuitBreaker?.getSnapshot() ?? null;\n }\n\n /**\n * Resets the circuit breaker to closed state.\n */\n resetCircuitBreaker(): void {\n this.circuitBreaker?.reset();\n }\n\n /**\n * Gets CLI command and arguments for execution.\n */\n protected override getCommand(task: CliTask): CommandConfig {\n const args: string[] = [];\n\n // #4346: the standalone `gemini` CLI is retired — it fails every invocation\n // with IneligibleTierError (exit 55). `agy` (Antigravity) is Google's own\n // replacement. Flag spellings differ entirely from the old CLI:\n // -o json -> --output-format json\n // -m <model> -> --model <slug>\n // --resume -> --conversation\n // --policy -> (no equivalent; see systemPrompt handling below)\n args.push('--output-format', 'json');\n\n // Registry model ids and agy slugs are different namespaces — see\n // config/agy-model-map.ts for why `cliModelName` cannot carry the agy slug.\n // Unsupported explicit pins are refused before dispatch; accepted legacy\n // Flash aliases migrate through the documented transport map.\n const requested = task.model ?? this.model;\n const model = toAgyModelSlug(requested);\n if (model !== requested) {\n this.adapterLogger.debug('Substituted an agy model slug', { requested, model });\n }\n args.push('--model', model);\n\n if (task.sessionId !== undefined && task.sessionId !== '') {\n args.push('--conversation', task.sessionId);\n }\n\n // #6254: agy's workspace is its STORED project, not the directory it is\n // spawned in — the other arms take the cwd as their tree by default; agy\n // does not. Measured: spawned from this repository with no --add-dir, a\n // voter seat read `packages/nexus-agents/package.json` out of an unrelated\n // checkout on the same machine and reported that file's version, and on\n // governor panels it abstained \"no repository or accessible sandbox was\n // provided\". The task's `workDir` (the same option the claude adapter\n // honours) wins; otherwise the process cwd, which is what the subprocess\n // inherits and what the voter prompt names.\n const workDir = task.options?.['workDir'];\n args.push('--add-dir', typeof workDir === 'string' && workDir !== '' ? workDir : process.cwd());\n\n // #6277: agy's own print-mode wait defaults to 5m0s regardless of the\n // budget the caller gave us. Measured on the #6260 governor panels: a\n // contrarian seat with a 600 s budget hit agy's 5-minute default, agy\n // exited 0 with {\"status\":\"SUCCESS\",\"response\":\"\"}, and the vote path\n // read the empty answer as a parse failure for the rest of the budget.\n // Derive the CLI's wait from the task timeout, a little below the guard\n // so agy's own timeout fires first and its stderr is readable.\n args.push(...agyPrintTimeoutArgs(task.timeoutMs));\n\n // agy has no system-prompt flag. The old CLI's `--policy <file>` preserved\n // system-role framing (#1886); agy offers only `--agent`, which selects a\n // preconfigured agent rather than accepting inline instructions. So the\n // system prompt is prepended to the user content — a deliberate downgrade\n // in framing fidelity, recorded here so it is not mistaken for an\n // oversight. No temp file is written, which also removes the tempdir-leak\n // surface the old path had.\n const content =\n task.systemPrompt !== undefined && task.systemPrompt !== ''\n ? `${task.systemPrompt}\\n\\n${task.content}`\n : task.content;\n\n // agy reads text stdin in print mode when no prompt flag is present.\n // Explicit --print (even with an empty value) suppresses that stdin read.\n // Keep large artifact prompts out of argv's per-argument limit (#7106).\n return { command: this.binaryName, args, stdin: content };\n }\n\n private checkCircuitBreaker(): CliError | null {\n if (this.circuitBreaker === null) {\n return null;\n }\n if (this.circuitBreaker.getState() === 'open') {\n return createCircuitOpenError('gemini');\n }\n return null;\n }\n\n private buildExecutionOptions(\n taskContent: string,\n options?: ExecutionOptions\n ): ResolvedExecutionOptions {\n const complexity = estimateTaskComplexity(taskContent);\n const timeoutMs = options?.timeoutMs ?? getTimeoutForTask(this.name, complexity);\n\n return {\n timeoutMs,\n allowRetry: options?.allowRetry ?? true,\n maxRetries: options?.maxRetries ?? this.maxRetries,\n trackUsage: options?.trackUsage ?? true,\n onProgress: options?.onProgress,\n };\n }\n\n private buildExecutionResult(\n result: Result<{ response: CliResponse; retryCount: number }, CliError>,\n startTime: number,\n complexity: TaskComplexity\n ): Result<GeminiExecutionResult, CliError> {\n const totalDurationMs = getTimeProvider().now() - startTime;\n const circuitState = this.circuitBreaker?.getState() ?? 'closed';\n\n if (result.ok) {\n this.circuitBreaker?.recordSuccess();\n return ok({\n response: result.value.response,\n retryCount: result.value.retryCount,\n totalDurationMs,\n complexity,\n circuitState,\n });\n }\n\n return err(result.error);\n }\n\n private async executeWithRetryTracking(\n task: CliTask,\n options: ResolvedExecutionOptions\n ): Promise<Result<{ response: CliResponse; retryCount: number }, CliError>> {\n return executeCliRetryLoop(() => this.executeTask(task, options), {\n maxRetries: options.maxRetries,\n allowRetry: this.shouldOuterRetry(options),\n baseDelayMs: this.baseDelayMs,\n maxDelayMs: this.maxDelayMs,\n circuitBreaker: this.circuitBreaker,\n cli: this.name,\n logger: this.adapterLogger,\n });\n }\n}\n\n/** Creates a Gemini CLI adapter with reliability features. */\nexport function createGeminiAdapter(options?: GeminiConfig): GeminiCliAdapter {\n return new GeminiCliAdapter(options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,SAAS,SAAS;AAQlB,IAAM,iBAAiB,EAAE,OAAO;A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
|
import {
|
|
2
2
|
IN_FAMILY_FALLBACK_OPTION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ENX4WYFX.js";
|
|
4
4
|
import {
|
|
5
5
|
sanitizeErrorDetails
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VVDPRJU7.js";
|
|
7
7
|
import {
|
|
8
8
|
classifyExtractedError,
|
|
9
9
|
isTimeoutText
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-OMWOFIK5.js";
|
|
11
11
|
import {
|
|
12
12
|
getTimeProvider
|
|
13
13
|
} from "./chunk-MQ23UGSY.js";
|
|
@@ -158,4 +158,4 @@ export {
|
|
|
158
158
|
SERVES_PROBE_PROMPT,
|
|
159
159
|
probeServes
|
|
160
160
|
};
|
|
161
|
-
//# sourceMappingURL=chunk-
|
|
161
|
+
//# sourceMappingURL=chunk-6T6YL7MV.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getErrorMessage,
|
|
6
6
|
ok,
|
|
7
7
|
resolveInsideRoot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OMWOFIK5.js";
|
|
9
9
|
import {
|
|
10
10
|
createLogger
|
|
11
11
|
} from "./chunk-MQ23UGSY.js";
|
|
@@ -213,4 +213,4 @@ export {
|
|
|
213
213
|
loadPapersRegistry,
|
|
214
214
|
savePapersRegistry
|
|
215
215
|
};
|
|
216
|
-
//# sourceMappingURL=chunk-
|
|
216
|
+
//# sourceMappingURL=chunk-7HI6EWY5.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
err,
|
|
3
3
|
ok
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OMWOFIK5.js";
|
|
5
5
|
import {
|
|
6
6
|
createLogger
|
|
7
7
|
} from "./chunk-MQ23UGSY.js";
|
|
@@ -89,4 +89,4 @@ export {
|
|
|
89
89
|
hasToken,
|
|
90
90
|
getTokenEnvVars
|
|
91
91
|
};
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-7Y6SB623.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
getAdaptiveBonus,
|
|
7
7
|
getOutcomeStore
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OMWOFIK5.js";
|
|
9
9
|
import {
|
|
10
10
|
ApiArmIdSchema,
|
|
11
11
|
hasMeasuredCategory
|
|
@@ -152,4 +152,4 @@ export {
|
|
|
152
152
|
runDeepDiagnostics,
|
|
153
153
|
formatDeepDiagnostics
|
|
154
154
|
};
|
|
155
|
-
//# sourceMappingURL=chunk-
|
|
155
|
+
//# sourceMappingURL=chunk-BSX3PMNN.js.map
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
hostnameOf,
|
|
4
4
|
redactGatewaySecrets,
|
|
5
5
|
validateCustomApiBaseUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5BEFQVPR.js";
|
|
7
7
|
import {
|
|
8
8
|
REDACTED_KEY_PLACEHOLDER,
|
|
9
9
|
sanitizeErrorDetails
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VVDPRJU7.js";
|
|
11
11
|
import {
|
|
12
12
|
CUSTOM_API_ALLOW_PRIVATE_ENV,
|
|
13
13
|
ConfigError,
|
|
@@ -33,14 +33,14 @@ import {
|
|
|
33
33
|
recordUsageEvent,
|
|
34
34
|
refineGatewayCatalog,
|
|
35
35
|
resolveRetryAfterMs
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-OMWOFIK5.js";
|
|
37
37
|
import {
|
|
38
38
|
getCliModelName,
|
|
39
39
|
lookupInTreeCapability
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-PHLASJD2.js";
|
|
41
41
|
import {
|
|
42
42
|
getDefaultRegistry
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-4MKZAA6W.js";
|
|
44
44
|
import {
|
|
45
45
|
isEndpointArmId
|
|
46
46
|
} from "./chunk-VIT46LNO.js";
|
|
@@ -2414,4 +2414,4 @@ export {
|
|
|
2414
2414
|
createOpenAICompatClient,
|
|
2415
2415
|
buildOpenAICompatAdapters
|
|
2416
2416
|
};
|
|
2417
|
-
//# sourceMappingURL=chunk-
|
|
2417
|
+
//# sourceMappingURL=chunk-BVUPPTAD.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ValidationError,
|
|
4
4
|
formatZodError,
|
|
5
5
|
resolveInsideRoot
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OMWOFIK5.js";
|
|
7
7
|
import {
|
|
8
8
|
createLogger
|
|
9
9
|
} from "./chunk-MQ23UGSY.js";
|
|
@@ -249,4 +249,4 @@ export {
|
|
|
249
249
|
collectAstQaFindings,
|
|
250
250
|
runAstQaRules
|
|
251
251
|
};
|
|
252
|
-
//# sourceMappingURL=chunk-
|
|
252
|
+
//# sourceMappingURL=chunk-E5XKXB3G.js.map
|