replicas-cli 0.3.560 → 0.3.564
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/index.cjs +274 -11
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -349,6 +349,8 @@ function getProviderDisplayName(provider2, variant = "short") {
|
|
|
349
349
|
return "Codex";
|
|
350
350
|
case "cursor":
|
|
351
351
|
return "Cursor";
|
|
352
|
+
case "gemini":
|
|
353
|
+
return "Gemini";
|
|
352
354
|
case "muse":
|
|
353
355
|
return variant === "long" ? "Muse Code" : "Muse";
|
|
354
356
|
case "opencode":
|
|
@@ -372,6 +374,7 @@ var init_agent = __esm({
|
|
|
372
374
|
CLAUDE: "claude",
|
|
373
375
|
CODEX: "codex",
|
|
374
376
|
CURSOR: "cursor",
|
|
377
|
+
GEMINI: "gemini",
|
|
375
378
|
MUSE: "muse",
|
|
376
379
|
OPENCODE: "opencode",
|
|
377
380
|
PI: "pi",
|
|
@@ -396,6 +399,11 @@ var init_agent = __esm({
|
|
|
396
399
|
label: "Cursor",
|
|
397
400
|
description: "Use Cursor for tasks"
|
|
398
401
|
},
|
|
402
|
+
{
|
|
403
|
+
value: "gemini",
|
|
404
|
+
label: "Gemini",
|
|
405
|
+
description: "Use Gemini through the Antigravity CLI for tasks"
|
|
406
|
+
},
|
|
399
407
|
{
|
|
400
408
|
value: "muse",
|
|
401
409
|
label: "Muse Code",
|
|
@@ -418,6 +426,7 @@ var init_agent = __esm({
|
|
|
418
426
|
claude: [...STANDARD_THINKING_LEVELS, "ultracode"],
|
|
419
427
|
codex: [...STANDARD_THINKING_LEVELS, "ultra"],
|
|
420
428
|
cursor: STANDARD_THINKING_LEVELS,
|
|
429
|
+
gemini: STANDARD_THINKING_LEVELS,
|
|
421
430
|
muse: VALID_THINKING_LEVELS.filter((level) => level !== "max" && level !== "ultracode"),
|
|
422
431
|
opencode: STANDARD_THINKING_LEVELS,
|
|
423
432
|
pi: STANDARD_THINKING_LEVELS,
|
|
@@ -20995,7 +21004,7 @@ var init_services = __esm({
|
|
|
20995
21004
|
"claude-foundry",
|
|
20996
21005
|
"codex-foundry"
|
|
20997
21006
|
];
|
|
20998
|
-
SUBSCRIPTION_CREDENTIAL_SERVICES = ["claude", "codex", "muse"];
|
|
21007
|
+
SUBSCRIPTION_CREDENTIAL_SERVICES = ["claude", "codex", "gemini", "muse"];
|
|
20999
21008
|
}
|
|
21000
21009
|
});
|
|
21001
21010
|
|
|
@@ -21044,7 +21053,8 @@ var init_agents = __esm({
|
|
|
21044
21053
|
OPENCODE_GO: "opencode-go",
|
|
21045
21054
|
ASTER: "aster",
|
|
21046
21055
|
OPENROUTER: "openrouter",
|
|
21047
|
-
MUSE_OAUTH: "muse-oauth"
|
|
21056
|
+
MUSE_OAUTH: "muse-oauth",
|
|
21057
|
+
GEMINI_OAUTH: "gemini-oauth"
|
|
21048
21058
|
};
|
|
21049
21059
|
CREDENTIAL_TYPE = {
|
|
21050
21060
|
CLAUDE_OAUTH: "claude",
|
|
@@ -21062,7 +21072,8 @@ var init_agents = __esm({
|
|
|
21062
21072
|
ASTER_API_KEY: "aster_api_key",
|
|
21063
21073
|
OPENROUTER_API_KEY: "openrouter_api_key",
|
|
21064
21074
|
MUSE_OAUTH: "muse_oauth",
|
|
21065
|
-
MUSE_API_KEY: "muse_api_key"
|
|
21075
|
+
MUSE_API_KEY: "muse_api_key",
|
|
21076
|
+
GEMINI_OAUTH: "gemini_oauth"
|
|
21066
21077
|
};
|
|
21067
21078
|
ENVIRONMENT_AUTH_REQUIRED_KEYS = {
|
|
21068
21079
|
[AGENT.CLAUDE]: [
|
|
@@ -21098,6 +21109,9 @@ var init_agents = __esm({
|
|
|
21098
21109
|
[AGENT.CURSOR]: [
|
|
21099
21110
|
{ method: CREDENTIAL_METHOD.API_KEY, credentialType: CREDENTIAL_TYPE.CURSOR_API_KEY }
|
|
21100
21111
|
],
|
|
21112
|
+
[AGENT.GEMINI]: [
|
|
21113
|
+
{ method: CREDENTIAL_METHOD.GEMINI_OAUTH, credentialType: CREDENTIAL_TYPE.GEMINI_OAUTH }
|
|
21114
|
+
],
|
|
21101
21115
|
[AGENT.MUSE]: [
|
|
21102
21116
|
{ method: CREDENTIAL_METHOD.MUSE_OAUTH, credentialType: CREDENTIAL_TYPE.MUSE_OAUTH },
|
|
21103
21117
|
{ method: CREDENTIAL_METHOD.API_KEY, credentialType: CREDENTIAL_TYPE.MUSE_API_KEY }
|
|
@@ -21571,6 +21585,7 @@ var init_design_tokens = __esm({
|
|
|
21571
21585
|
replicas: { light: "#2f9d57", dark: "#3eeba3" },
|
|
21572
21586
|
claude: "#d97757",
|
|
21573
21587
|
codex: ["#b1a7ff", "#7a9dff", "#3941ff"],
|
|
21588
|
+
gemini: ["#4796e3", "#9177c7", "#ca6673"],
|
|
21574
21589
|
muse: "#0668e1",
|
|
21575
21590
|
opencode: ["#4b4646", "#f1ecec"],
|
|
21576
21591
|
slack: ["#e01e5a", "#36c5f0", "#2eb67d", "#ecb22e"],
|
|
@@ -22242,7 +22257,7 @@ function classifyCanvasFilename(filename) {
|
|
|
22242
22257
|
const ext = idx === -1 ? "" : filename.slice(idx).toLowerCase();
|
|
22243
22258
|
return CANVAS_KIND_BY_EXTENSION[ext] ?? (detectLanguageByPath(filename) ? { kind: "text", mimeType: "text/plain; charset=utf-8" } : { kind: "other", mimeType: "application/octet-stream" });
|
|
22244
22259
|
}
|
|
22245
|
-
var CLAUDE_OPUS_1M_MODEL, LEGACY_CLAUDE_OPUS_1M_MODEL, CLAUDE_FABLE_5_1_MODEL, CLAUDE_FABLE_5_MODEL, CLAUDE_OPUS_5_MODEL, CLAUDE_OPUS_4_8_MODEL, CLAUDE_SONNET_5_5_MODEL, CLAUDE_SONNET_5_MODEL, CLAUDE_HAIKU_5_5_MODEL, CLAUDE_HAIKU_4_5_MODEL, DEFAULT_CLAUDE_MODEL, GPT_6_ASTRA_MODEL, GPT_6_SOL_MODEL, GPT_6_LUNA_MODEL, GPT_5_6_SOL_MODEL, GPT_5_6_TERRA_MODEL, GPT_5_6_LUNA_MODEL, DEFAULT_CODEX_MODEL, DEFAULT_OPENCODE_MODEL, GLM_5_3_FLASH_MODEL, DEEPSEEK_V4_PRO_MODEL, DEEPSEEK_V4_FLASH_MODEL, MUSE_WONDER_1_0_MODEL, MUSE_SPARK_1_3_MODEL, DEFAULT_MUSE_MODEL, DEFAULT_OPENROUTER_MODELS, OPENROUTER_MODELS, CLAUDE_MODEL_CONTEXT_WINDOWS, CLAUDE_MODEL_MIN_SANDBOX_IMAGE, CODEX_MODEL_MIN_SANDBOX_IMAGE, AGENT_MODELS, HIDDEN_BY_DEFAULT_MODELS, withoutHiddenByDefault, DEFAULT_STATIC_AGENT_MODELS, DEFAULT_CURSOR_MODELS, MODEL_PREDECESSORS, MODEL_LABELS, IMAGE_MEDIA_TYPES, resourcePressure, sandboxResourceMinuteSchema, MAX_PENDING_RESOURCE_MINUTES, sandboxResourceMinutesSchema, sandboxMemorySampleSchema, versionChangeSchema, engineUpdateChangesSchema, engineUpdateProgressSchema, MAX_CANVAS_FILE_BYTES, MAX_CANVAS_UPLOAD_BYTES, MAX_CANVAS_PREVIEW_BYTES, CANVAS_KIND_BY_EXTENSION;
|
|
22260
|
+
var CLAUDE_OPUS_1M_MODEL, LEGACY_CLAUDE_OPUS_1M_MODEL, CLAUDE_FABLE_5_1_MODEL, CLAUDE_FABLE_5_MODEL, CLAUDE_OPUS_5_MODEL, CLAUDE_OPUS_4_8_MODEL, CLAUDE_SONNET_5_5_MODEL, CLAUDE_SONNET_5_MODEL, CLAUDE_HAIKU_5_5_MODEL, CLAUDE_HAIKU_4_5_MODEL, DEFAULT_CLAUDE_MODEL, GPT_6_ASTRA_MODEL, GPT_6_SOL_MODEL, GPT_6_LUNA_MODEL, GPT_5_6_SOL_MODEL, GPT_5_6_TERRA_MODEL, GPT_5_6_LUNA_MODEL, DEFAULT_CODEX_MODEL, DEFAULT_OPENCODE_MODEL, GLM_5_3_FLASH_MODEL, DEEPSEEK_V4_PRO_MODEL, DEEPSEEK_V4_FLASH_MODEL, MUSE_WONDER_1_0_MODEL, MUSE_SPARK_1_3_MODEL, DEFAULT_MUSE_MODEL, DEFAULT_GEMINI_MODEL, DEFAULT_OPENROUTER_MODELS, OPENROUTER_MODELS, CLAUDE_MODEL_CONTEXT_WINDOWS, CLAUDE_MODEL_MIN_SANDBOX_IMAGE, CODEX_MODEL_MIN_SANDBOX_IMAGE, AGENT_MODELS, HIDDEN_BY_DEFAULT_MODELS, withoutHiddenByDefault, DEFAULT_STATIC_AGENT_MODELS, DEFAULT_CURSOR_MODELS, MODEL_PREDECESSORS, MODEL_LABELS, IMAGE_MEDIA_TYPES, resourcePressure, sandboxResourceMinuteSchema, MAX_PENDING_RESOURCE_MINUTES, sandboxResourceMinutesSchema, sandboxMemorySampleSchema, versionChangeSchema, engineUpdateChangesSchema, engineUpdateProgressSchema, MAX_CANVAS_FILE_BYTES, MAX_CANVAS_UPLOAD_BYTES, MAX_CANVAS_PREVIEW_BYTES, CANVAS_KIND_BY_EXTENSION;
|
|
22246
22261
|
var init_types4 = __esm({
|
|
22247
22262
|
"../shared/src/engine/types.ts"() {
|
|
22248
22263
|
"use strict";
|
|
@@ -22280,6 +22295,7 @@ var init_types4 = __esm({
|
|
|
22280
22295
|
MUSE_WONDER_1_0_MODEL = "muse-wonder-1.0";
|
|
22281
22296
|
MUSE_SPARK_1_3_MODEL = "muse-spark-1.3";
|
|
22282
22297
|
DEFAULT_MUSE_MODEL = "muse-spark-1.2";
|
|
22298
|
+
DEFAULT_GEMINI_MODEL = "gemini-3.8-flash";
|
|
22283
22299
|
DEFAULT_OPENROUTER_MODELS = [
|
|
22284
22300
|
DEFAULT_OPENCODE_MODEL,
|
|
22285
22301
|
DEEPSEEK_V4_PRO_MODEL,
|
|
@@ -22373,6 +22389,21 @@ var init_types4 = __esm({
|
|
|
22373
22389
|
CLAUDE_HAIKU_4_5_MODEL,
|
|
22374
22390
|
"kimi-k2.5"
|
|
22375
22391
|
],
|
|
22392
|
+
// Every plan has Gemini 3.8 Flash; Google AI Pro and Ultra add the Gemini 4 and Claude 5.5 models (antigravity.google/pricing).
|
|
22393
|
+
gemini: [
|
|
22394
|
+
DEFAULT_GEMINI_MODEL,
|
|
22395
|
+
"gemini-4-neon",
|
|
22396
|
+
"gemini-4-carbon",
|
|
22397
|
+
"gemini-4-argon",
|
|
22398
|
+
"gemini-4-hydrogen",
|
|
22399
|
+
"gemini-pro-orchestrator-neon",
|
|
22400
|
+
"gemini-pro-orchestrator-g1-pro",
|
|
22401
|
+
CLAUDE_OPUS_5_5_MODEL,
|
|
22402
|
+
CLAUDE_SONNET_5_5_MODEL,
|
|
22403
|
+
"claude-opus-4-6-thinking",
|
|
22404
|
+
"claude-sonnet-4-6",
|
|
22405
|
+
"gpt-oss-120b-medium"
|
|
22406
|
+
],
|
|
22376
22407
|
muse: [MUSE_WONDER_1_0_MODEL, MUSE_SPARK_1_3_MODEL, DEFAULT_MUSE_MODEL],
|
|
22377
22408
|
opencode: [...DEFAULT_OPENROUTER_MODELS, ...ASTER_MODELS],
|
|
22378
22409
|
pi: [...DEFAULT_OPENROUTER_MODELS, ...ASTER_MODELS]
|
|
@@ -22454,6 +22485,15 @@ var init_types4 = __esm({
|
|
|
22454
22485
|
"xiaomi/mimo-v2.5-pro": "MiMo V2.5 Pro via OpenRouter",
|
|
22455
22486
|
"moonshotai/kimi-k2.6": "Kimi K2.6 via OpenRouter",
|
|
22456
22487
|
"moonshotai/kimi-k3": "Kimi K3 via OpenRouter",
|
|
22488
|
+
"gemini-4-neon": "Gemini 4 Neon",
|
|
22489
|
+
"gemini-4-carbon": "Gemini 4 Carbon",
|
|
22490
|
+
"gemini-4-argon": "Gemini 4 Argon",
|
|
22491
|
+
"gemini-4-hydrogen": "Gemini 4 Hydrogen",
|
|
22492
|
+
"gemini-pro-orchestrator-neon": "Orchestrator (Neon)",
|
|
22493
|
+
"gemini-pro-orchestrator-g1-pro": "Orchestrator (Argon)",
|
|
22494
|
+
"claude-opus-4-6-thinking": "Claude Opus 4.6 (Thinking)",
|
|
22495
|
+
"claude-sonnet-4-6": "Claude Sonnet 4.6",
|
|
22496
|
+
"gpt-oss-120b-medium": "GPT-OSS 120B",
|
|
22457
22497
|
[MUSE_WONDER_1_0_MODEL]: "Muse Wonder 1.0",
|
|
22458
22498
|
[MUSE_SPARK_1_3_MODEL]: "Muse Spark 1.3",
|
|
22459
22499
|
[DEFAULT_MUSE_MODEL]: "Muse Spark 1.2",
|
|
@@ -22658,7 +22698,7 @@ var init_chat_fork = __esm({
|
|
|
22658
22698
|
});
|
|
22659
22699
|
|
|
22660
22700
|
// ../shared/src/credential-refresh.ts
|
|
22661
|
-
var restingCredentialsSchema, engineCredentialRefreshFailureSchema;
|
|
22701
|
+
var restingCredentialsSchema, agentLoginWithdrawalSchema, engineCredentialRefreshFailureSchema;
|
|
22662
22702
|
var init_credential_refresh = __esm({
|
|
22663
22703
|
"../shared/src/credential-refresh.ts"() {
|
|
22664
22704
|
"use strict";
|
|
@@ -22671,10 +22711,15 @@ var init_credential_refresh = __esm({
|
|
|
22671
22711
|
scope: external_exports.enum(CREDENTIAL_SCOPE).optional(),
|
|
22672
22712
|
resetsAt: external_exports.string()
|
|
22673
22713
|
});
|
|
22714
|
+
agentLoginWithdrawalSchema = external_exports.object({
|
|
22715
|
+
envKeys: external_exports.array(external_exports.string()),
|
|
22716
|
+
files: external_exports.array(external_exports.string())
|
|
22717
|
+
});
|
|
22674
22718
|
engineCredentialRefreshFailureSchema = external_exports.object({
|
|
22675
22719
|
code: external_exports.string(),
|
|
22676
22720
|
credential: workspaceCredentialSelectionSchema.optional(),
|
|
22677
|
-
resting: restingCredentialsSchema.optional()
|
|
22721
|
+
resting: restingCredentialsSchema.optional(),
|
|
22722
|
+
revoke: agentLoginWithdrawalSchema.optional()
|
|
22678
22723
|
});
|
|
22679
22724
|
}
|
|
22680
22725
|
});
|
|
@@ -23008,6 +23053,11 @@ var init_provider_icons = __esm({
|
|
|
23008
23053
|
viewBox: "640 340 320 320",
|
|
23009
23054
|
paths: ["M920.015 424.958L805.919 359.086C802.256 356.97 797.735 356.97 794.071 359.086L679.981 424.958C676.901 426.736 675 430.025 675 433.587V566.419C675 569.981 676.901 573.269 679.981 575.048L794.077 640.92C797.74 643.036 802.261 643.036 805.925 640.92L920.02 575.048C923.1 573.269 925.001 569.981 925.001 566.419V433.587C925.001 430.025 923.1 426.736 920.02 424.958H920.015ZM912.848 438.911L802.706 629.682C801.961 630.968 799.995 630.443 799.995 628.954V504.039C799.995 501.543 798.662 499.234 796.498 497.981L688.321 435.526C687.036 434.781 687.561 432.816 689.05 432.816H909.334C912.462 432.816 914.417 436.206 912.853 438.917H912.848V438.911Z"]
|
|
23010
23055
|
},
|
|
23056
|
+
gemini: {
|
|
23057
|
+
viewBox: "0 0 24 24",
|
|
23058
|
+
paths: ["M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"],
|
|
23059
|
+
gradient: BRAND_COLORS.gemini
|
|
23060
|
+
},
|
|
23011
23061
|
muse: {
|
|
23012
23062
|
viewBox: "0 0 24 24",
|
|
23013
23063
|
paths: ["M3 4h4.5l4.5 7.2L16.5 4H21v16h-4V10.5l-5 7.5-5-7.5V20H3V4Z"],
|
|
@@ -38157,6 +38207,133 @@ var init_muse_parser = __esm({
|
|
|
38157
38207
|
}
|
|
38158
38208
|
});
|
|
38159
38209
|
|
|
38210
|
+
// ../shared/src/display-message/parsers/gemini-parser.ts
|
|
38211
|
+
function contentText(content) {
|
|
38212
|
+
if (!Array.isArray(content)) return "";
|
|
38213
|
+
return content.flatMap((entry) => isRecord(entry) && entry.type === "content" && isRecord(entry.content) && typeof entry.content.text === "string" ? [entry.content.text] : []).join("\n");
|
|
38214
|
+
}
|
|
38215
|
+
function commandLine(input2) {
|
|
38216
|
+
if (!isRecord(input2)) return void 0;
|
|
38217
|
+
const command = [input2.CommandLine, input2.commandLine, input2.command_line, input2.command].find((value) => typeof value === "string" && value);
|
|
38218
|
+
return typeof command === "string" ? command : void 0;
|
|
38219
|
+
}
|
|
38220
|
+
function parseGeminiEvents(events) {
|
|
38221
|
+
const messages = [];
|
|
38222
|
+
const activeChunks = {};
|
|
38223
|
+
const toolUpdates = /* @__PURE__ */ new Map();
|
|
38224
|
+
const inputState = { requests: /* @__PURE__ */ new Map(), resolutions: /* @__PURE__ */ new Map(), requestedAt: /* @__PURE__ */ new Map() };
|
|
38225
|
+
let chunkSequence = 0;
|
|
38226
|
+
for (const event of events) {
|
|
38227
|
+
const userContent = getUserMessage(event);
|
|
38228
|
+
if (userContent !== null) {
|
|
38229
|
+
activeChunks.agent_message_chunk = void 0;
|
|
38230
|
+
activeChunks.agent_thought_chunk = void 0;
|
|
38231
|
+
if (userContent.trim()) messages.push({
|
|
38232
|
+
id: getUserMessageId(event) ?? `gemini-user-${event.timestamp}`,
|
|
38233
|
+
type: "user",
|
|
38234
|
+
content: userContent,
|
|
38235
|
+
timestamp: event.timestamp
|
|
38236
|
+
});
|
|
38237
|
+
continue;
|
|
38238
|
+
}
|
|
38239
|
+
if (event.type === "gemini-error") {
|
|
38240
|
+
messages.push({
|
|
38241
|
+
id: `gemini-error-${event.timestamp}`,
|
|
38242
|
+
type: "error",
|
|
38243
|
+
message: typeof event.payload.message === "string" ? event.payload.message : "Gemini failed",
|
|
38244
|
+
timestamp: event.timestamp
|
|
38245
|
+
});
|
|
38246
|
+
continue;
|
|
38247
|
+
}
|
|
38248
|
+
if (event.type === "gemini-turn-complete") {
|
|
38249
|
+
for (const message2 of messages) {
|
|
38250
|
+
if (message2.type === "reasoning" && message2.status === "in_progress") message2.status = "completed";
|
|
38251
|
+
}
|
|
38252
|
+
markTurnEnd(messages, event.timestamp);
|
|
38253
|
+
activeChunks.agent_message_chunk = void 0;
|
|
38254
|
+
activeChunks.agent_thought_chunk = void 0;
|
|
38255
|
+
continue;
|
|
38256
|
+
}
|
|
38257
|
+
if (applyToolInputEvent(event, messages, "gemini", inputState, isToolInputQuestion)) continue;
|
|
38258
|
+
if (event.type !== "gemini-session-update" && event.type !== "gemini-chunk" || !isRecord(event.payload.update)) continue;
|
|
38259
|
+
const update = event.payload.update;
|
|
38260
|
+
const kind = update.sessionUpdate;
|
|
38261
|
+
if (kind === "agent_message_chunk" || kind === "agent_thought_chunk") {
|
|
38262
|
+
if (!isRecord(update.content) || update.content.type !== "text" || typeof update.content.text !== "string" || !update.content.text) continue;
|
|
38263
|
+
const explicitId = typeof update.messageId === "string" && update.messageId ? `gemini-${kind}-${update.messageId}` : null;
|
|
38264
|
+
const id = explicitId ?? activeChunks[kind] ?? `gemini-${kind}-${chunkSequence++}`;
|
|
38265
|
+
activeChunks[kind] = id;
|
|
38266
|
+
if (!explicitId) activeChunks[kind === "agent_message_chunk" ? "agent_thought_chunk" : "agent_message_chunk"] = void 0;
|
|
38267
|
+
const existing = messages.find((message2) => message2.id === id);
|
|
38268
|
+
const content = `${existing && "content" in existing && typeof existing.content === "string" ? existing.content : ""}${update.content.text}`;
|
|
38269
|
+
upsertDisplayMessage(messages, kind === "agent_thought_chunk" ? { id, type: "reasoning", content, status: "in_progress", timestamp: existing?.timestamp ?? event.timestamp } : { id, type: "agent", content, timestamp: existing?.timestamp ?? event.timestamp });
|
|
38270
|
+
continue;
|
|
38271
|
+
}
|
|
38272
|
+
activeChunks.agent_message_chunk = void 0;
|
|
38273
|
+
activeChunks.agent_thought_chunk = void 0;
|
|
38274
|
+
if ((kind === "tool_call" || kind === "tool_call_update") && typeof update.toolCallId === "string") {
|
|
38275
|
+
const call = { ...toolUpdates.get(update.toolCallId), ...update };
|
|
38276
|
+
toolUpdates.set(update.toolCallId, call);
|
|
38277
|
+
const id = `gemini-tool-${update.toolCallId}`;
|
|
38278
|
+
const timestamp2 = messages.find((message2) => message2.id === id)?.timestamp ?? event.timestamp;
|
|
38279
|
+
const status = call.status === "failed" ? "failed" : call.status === "completed" ? "completed" : "in_progress";
|
|
38280
|
+
const output3 = contentText(call.content) || stringifyDisplayValue(call.rawOutput);
|
|
38281
|
+
const inputRequest = inputState.requests.get(update.toolCallId);
|
|
38282
|
+
const diffs = Array.isArray(call.content) ? call.content.filter((entry) => isRecord(entry) && entry.type === "diff" && typeof entry.path === "string") : [];
|
|
38283
|
+
const command = call.kind === "execute" ? commandLine(call.rawInput) ?? (typeof call.title === "string" ? call.title : void 0) : void 0;
|
|
38284
|
+
if (!inputRequest && command) {
|
|
38285
|
+
upsertDisplayMessage(messages, { id, type: "command", command, output: output3, status, timestamp: timestamp2 });
|
|
38286
|
+
} else if (!inputRequest && diffs.length > 0) {
|
|
38287
|
+
upsertDisplayMessage(messages, {
|
|
38288
|
+
id,
|
|
38289
|
+
type: "file_change",
|
|
38290
|
+
changes: diffs.map((diff) => ({
|
|
38291
|
+
path: diff.path,
|
|
38292
|
+
kind: diff.oldText === null || diff.oldText === void 0 ? "add" : diff.newText === "" && call.kind === "delete" ? "delete" : "update"
|
|
38293
|
+
})),
|
|
38294
|
+
status,
|
|
38295
|
+
timestamp: timestamp2
|
|
38296
|
+
});
|
|
38297
|
+
} else {
|
|
38298
|
+
upsertDisplayMessage(messages, createCallDisplayMessage({
|
|
38299
|
+
id,
|
|
38300
|
+
server: "gemini",
|
|
38301
|
+
tool: [call.title, call.name, call.kind].find((value) => typeof value === "string" && value.length > 0) ?? "tool",
|
|
38302
|
+
inputRequest,
|
|
38303
|
+
input: call.rawInput === void 0 ? void 0 : isRecord(call.rawInput) ? call.rawInput : stringifyDisplayValue(call.rawInput),
|
|
38304
|
+
output: output3,
|
|
38305
|
+
status,
|
|
38306
|
+
timestamp: timestamp2
|
|
38307
|
+
}));
|
|
38308
|
+
}
|
|
38309
|
+
continue;
|
|
38310
|
+
}
|
|
38311
|
+
if (kind === "plan" && Array.isArray(update.entries)) {
|
|
38312
|
+
const items = update.entries.flatMap((entry) => {
|
|
38313
|
+
if (!isRecord(entry) || typeof entry.content !== "string") return [];
|
|
38314
|
+
const itemStatus = entry.status === "completed" || entry.status === "in_progress" ? entry.status : "pending";
|
|
38315
|
+
return [{ text: entry.content, completed: itemStatus === "completed", itemStatus }];
|
|
38316
|
+
});
|
|
38317
|
+
upsertDisplayMessage(messages, {
|
|
38318
|
+
id: "gemini-plan",
|
|
38319
|
+
type: "todo_list",
|
|
38320
|
+
items,
|
|
38321
|
+
status: items.every((item) => item.completed) ? "completed" : "in_progress",
|
|
38322
|
+
timestamp: event.timestamp
|
|
38323
|
+
});
|
|
38324
|
+
}
|
|
38325
|
+
}
|
|
38326
|
+
return messages;
|
|
38327
|
+
}
|
|
38328
|
+
var init_gemini_parser = __esm({
|
|
38329
|
+
"../shared/src/display-message/parsers/gemini-parser.ts"() {
|
|
38330
|
+
"use strict";
|
|
38331
|
+
init_agent_event_utils();
|
|
38332
|
+
init_type_guards();
|
|
38333
|
+
init_utils();
|
|
38334
|
+
}
|
|
38335
|
+
});
|
|
38336
|
+
|
|
38160
38337
|
// ../shared/src/display-message/parsers/pi-parser.ts
|
|
38161
38338
|
function nestedPayload(event) {
|
|
38162
38339
|
return isRecord(event.payload.assistantMessageEvent) ? event.payload.assistantMessageEvent : event.payload;
|
|
@@ -39205,6 +39382,9 @@ function parseProviderEvents(events, agentType, parentToolUseId) {
|
|
|
39205
39382
|
if (agentType === "cursor") {
|
|
39206
39383
|
return parseCursorEvents(events);
|
|
39207
39384
|
}
|
|
39385
|
+
if (agentType === "gemini") {
|
|
39386
|
+
return parseGeminiEvents(events);
|
|
39387
|
+
}
|
|
39208
39388
|
if (agentType === "muse") {
|
|
39209
39389
|
return parseMuseEvents(events);
|
|
39210
39390
|
}
|
|
@@ -39405,6 +39585,7 @@ var init_parsers = __esm({
|
|
|
39405
39585
|
init_cursor_parser();
|
|
39406
39586
|
init_opencode_parser();
|
|
39407
39587
|
init_muse_parser();
|
|
39588
|
+
init_gemini_parser();
|
|
39408
39589
|
init_pi_parser();
|
|
39409
39590
|
init_replicas_parser();
|
|
39410
39591
|
init_claude_parser();
|
|
@@ -40484,12 +40665,45 @@ var init_muse_auth = __esm({
|
|
|
40484
40665
|
}
|
|
40485
40666
|
});
|
|
40486
40667
|
|
|
40668
|
+
// ../shared/src/gemini-auth.ts
|
|
40669
|
+
function buildGeminiAuthorizationUrl(codeChallenge, state) {
|
|
40670
|
+
return `https://accounts.google.com/o/oauth2/auth?${new URLSearchParams({
|
|
40671
|
+
access_type: "offline",
|
|
40672
|
+
client_id: GEMINI_OAUTH_CLIENT_ID,
|
|
40673
|
+
code_challenge: codeChallenge,
|
|
40674
|
+
code_challenge_method: "S256",
|
|
40675
|
+
prompt: "consent",
|
|
40676
|
+
redirect_uri: GEMINI_OAUTH_REDIRECT_URI,
|
|
40677
|
+
response_type: "code",
|
|
40678
|
+
scope: [
|
|
40679
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
|
40680
|
+
"https://www.googleapis.com/auth/userinfo.email",
|
|
40681
|
+
"https://www.googleapis.com/auth/userinfo.profile",
|
|
40682
|
+
"https://www.googleapis.com/auth/cclog",
|
|
40683
|
+
"https://www.googleapis.com/auth/experimentsandconfigs",
|
|
40684
|
+
"https://www.googleapis.com/auth/aicode",
|
|
40685
|
+
"openid"
|
|
40686
|
+
].join(" "),
|
|
40687
|
+
state
|
|
40688
|
+
})}`;
|
|
40689
|
+
}
|
|
40690
|
+
var GEMINI_OAUTH_CLIENT_ID, GEMINI_OAUTH_REDIRECT_URI, geminiCredentialRequestSchema;
|
|
40691
|
+
var init_gemini_auth = __esm({
|
|
40692
|
+
"../shared/src/gemini-auth.ts"() {
|
|
40693
|
+
"use strict";
|
|
40694
|
+
init_zod();
|
|
40695
|
+
GEMINI_OAUTH_CLIENT_ID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com";
|
|
40696
|
+
GEMINI_OAUTH_REDIRECT_URI = "https://antigravity.google/oauth-callback";
|
|
40697
|
+
geminiCredentialRequestSchema = external_exports.object({ code: external_exports.string(), code_verifier: external_exports.string() });
|
|
40698
|
+
}
|
|
40699
|
+
});
|
|
40700
|
+
|
|
40487
40701
|
// ../shared/src/cli-version.ts
|
|
40488
40702
|
var CLI_VERSION;
|
|
40489
40703
|
var init_cli_version = __esm({
|
|
40490
40704
|
"../shared/src/cli-version.ts"() {
|
|
40491
40705
|
"use strict";
|
|
40492
|
-
CLI_VERSION = "0.3.
|
|
40706
|
+
CLI_VERSION = "0.3.564";
|
|
40493
40707
|
}
|
|
40494
40708
|
});
|
|
40495
40709
|
|
|
@@ -40703,8 +40917,8 @@ var init_command_protection = __esm({
|
|
|
40703
40917
|
mergeInProgress: external_exports.boolean().optional()
|
|
40704
40918
|
});
|
|
40705
40919
|
commandProtectionEvaluateRequestSchema = external_exports.object({
|
|
40706
|
-
provider: external_exports.enum(["claude", "codex", "cursor", "opencode", "pi", "harness"]),
|
|
40707
|
-
source: external_exports.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call", "harness_tool_call"]),
|
|
40920
|
+
provider: external_exports.enum(["claude", "codex", "cursor", "gemini", "opencode", "pi", "harness"]),
|
|
40921
|
+
source: external_exports.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "gemini_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call", "harness_tool_call"]),
|
|
40708
40922
|
toolName: external_exports.string(),
|
|
40709
40923
|
toolInput: external_exports.unknown(),
|
|
40710
40924
|
command: external_exports.string().nullish(),
|
|
@@ -51540,6 +51754,7 @@ var init_src = __esm({
|
|
|
51540
51754
|
init_claude_auth();
|
|
51541
51755
|
init_codex_auth();
|
|
51542
51756
|
init_muse_auth();
|
|
51757
|
+
init_gemini_auth();
|
|
51543
51758
|
init_cli_version();
|
|
51544
51759
|
init_version();
|
|
51545
51760
|
init_environment_files();
|
|
@@ -53820,6 +54035,51 @@ var init_muse_auth2 = __esm({
|
|
|
53820
54035
|
}
|
|
53821
54036
|
});
|
|
53822
54037
|
|
|
54038
|
+
// src/lib/gemini-oauth.ts
|
|
54039
|
+
async function runGeminiOAuthFlow(totalSteps) {
|
|
54040
|
+
const pkce = generatePkceCodes();
|
|
54041
|
+
renderAuthFlowStep(1, totalSteps, "Sign in with the Google account that has your Antigravity plan");
|
|
54042
|
+
await openForApproval("accounts.google.com", buildGeminiAuthorizationUrl(pkce.codeChallenge, generateState2()));
|
|
54043
|
+
renderAuthFlowStep(2, totalSteps, "Paste the code Antigravity shows");
|
|
54044
|
+
const code = await promptForAuthorizationCode();
|
|
54045
|
+
if (!code) throw new Error("No authorization code provided.");
|
|
54046
|
+
return { code, codeVerifier: pkce.codeVerifier };
|
|
54047
|
+
}
|
|
54048
|
+
var init_gemini_oauth = __esm({
|
|
54049
|
+
"src/lib/gemini-oauth.ts"() {
|
|
54050
|
+
"use strict";
|
|
54051
|
+
init_src();
|
|
54052
|
+
init_pkce();
|
|
54053
|
+
init_claude_oauth();
|
|
54054
|
+
init_oauth_flow_ui();
|
|
54055
|
+
}
|
|
54056
|
+
});
|
|
54057
|
+
|
|
54058
|
+
// src/commands/gemini-auth.ts
|
|
54059
|
+
async function geminiAuthCommand(options = {}) {
|
|
54060
|
+
await runCredentialAuthFlow(options, {
|
|
54061
|
+
provider: "gemini",
|
|
54062
|
+
providerLabel: "Gemini",
|
|
54063
|
+
credentialLabel: "Gemini",
|
|
54064
|
+
connectorLabel: "OAuth",
|
|
54065
|
+
oauthSteps: 2,
|
|
54066
|
+
orgEndpoint: "/v1/gemini/credentials",
|
|
54067
|
+
userEndpoint: "/v1/gemini/user/credentials",
|
|
54068
|
+
runOAuth: async (steps, save) => {
|
|
54069
|
+
await openForApproval("Replicas", await save(await runGeminiOAuthFlow(steps)));
|
|
54070
|
+
},
|
|
54071
|
+
toRequestBody: (authorization) => ({ code: authorization.code, code_verifier: authorization.codeVerifier })
|
|
54072
|
+
});
|
|
54073
|
+
}
|
|
54074
|
+
var init_gemini_auth2 = __esm({
|
|
54075
|
+
"src/commands/gemini-auth.ts"() {
|
|
54076
|
+
"use strict";
|
|
54077
|
+
init_credential_upload();
|
|
54078
|
+
init_gemini_oauth();
|
|
54079
|
+
init_oauth_flow_ui();
|
|
54080
|
+
}
|
|
54081
|
+
});
|
|
54082
|
+
|
|
53823
54083
|
// src/commands/init.ts
|
|
53824
54084
|
function getDefaultConfig() {
|
|
53825
54085
|
return {
|
|
@@ -53902,7 +54162,7 @@ var init_subscription_usage = __esm({
|
|
|
53902
54162
|
function credentialsPath(service, { org: org2 }, writable = false) {
|
|
53903
54163
|
const services = writable ? API_KEY_CREDENTIAL_SERVICES : [...API_KEY_CREDENTIAL_SERVICES, ...SUBSCRIPTION_CREDENTIAL_SERVICES];
|
|
53904
54164
|
if (!services.includes(service)) {
|
|
53905
|
-
throw new Error(`Unknown service: ${service}. Use one of: ${services.join(", ")}${writable ? ". Subscriptions connect with replicas claude-auth, codex-auth, or muse-auth" : ""}`);
|
|
54165
|
+
throw new Error(`Unknown service: ${service}. Use one of: ${services.join(", ")}${writable ? ". Subscriptions connect with replicas claude-auth, codex-auth, gemini-auth, or muse-auth" : ""}`);
|
|
53906
54166
|
}
|
|
53907
54167
|
return `/v1/${service}/${org2 ? "" : "user/"}credentials`;
|
|
53908
54168
|
}
|
|
@@ -58512,6 +58772,7 @@ var init_src2 = __esm({
|
|
|
58512
58772
|
init_codex_auth2();
|
|
58513
58773
|
init_claude_auth2();
|
|
58514
58774
|
init_muse_auth2();
|
|
58775
|
+
init_gemini_auth2();
|
|
58515
58776
|
init_init();
|
|
58516
58777
|
init_credentials2();
|
|
58517
58778
|
init_version_check();
|
|
@@ -58555,6 +58816,7 @@ var init_src2 = __esm({
|
|
|
58555
58816
|
"claude-auth",
|
|
58556
58817
|
"codex-auth",
|
|
58557
58818
|
"muse-auth",
|
|
58819
|
+
"gemini-auth",
|
|
58558
58820
|
"config",
|
|
58559
58821
|
"device",
|
|
58560
58822
|
"init",
|
|
@@ -58590,6 +58852,7 @@ var init_src2 = __esm({
|
|
|
58590
58852
|
program.command("init").description("Create a replicas.json or replicas.yaml configuration file").option("-f, --force", "Overwrite existing config file").option("-y, --yaml", "Create replicas.yaml instead of replicas.json").action(run(initCommand));
|
|
58591
58853
|
program.command("logout").description("Clear stored credentials").action(run(logoutCommand));
|
|
58592
58854
|
program.command("muse-auth").description("Connect your Muse Code subscription to Replicas (personal by default)").option("-u, --user", "Store credentials for your personal account (default)").option("-o, --org", "Share credentials with the whole organization (admins only)").option("-y, --yes", "Skip the destination confirmation prompt").action(run(museAuthCommand));
|
|
58855
|
+
program.command("gemini-auth").description("Connect the Google account with your Antigravity plan to Replicas for Gemini (personal by default)").option("-u, --user", "Store credentials for your personal account (default)").option("-o, --org", "Share credentials with the whole organization (admins only)").option("-y, --yes", "Skip the destination confirmation prompt").action(run(geminiAuthCommand));
|
|
58593
58856
|
program.command("whoami").description("Display current authenticated user").action(run(whoamiCommand));
|
|
58594
58857
|
program.command("codex-auth").description("Connect your Codex credentials to Replicas (personal by default)").option("-u, --user", "Store credentials for your personal account (default)").option("-o, --org", "Share credentials with the whole organization (admins only)").option("-y, --yes", "Skip the destination confirmation prompt").action(run(codexAuthCommand));
|
|
58595
58858
|
program.command("claude-auth").description("Connect your Claude Code credentials to Replicas (personal by default)").option("-u, --user", "Store credentials for your personal account (default)").option("-o, --org", "Share credentials with the whole organization (admins only)").option("-y, --yes", "Skip the destination confirmation prompt").action(run(claudeAuthCommand));
|
|
@@ -58662,7 +58925,7 @@ var init_src2 = __esm({
|
|
|
58662
58925
|
credentials.command("list <agent>").description("List connected credentials for an agent (claude, codex, cursor, ...) and which one new workspaces use").action(run(credentialsListCommand));
|
|
58663
58926
|
credentials.command("get <service>").description("Show stored credentials for a service (secrets masked for API keys)").option("-o, --org", "Organization credentials instead of personal").action(run(credentialsGetCommand));
|
|
58664
58927
|
credentials.command("set <service>").description(`Store credentials. The API key (AWS secret for bedrock) is prompted for, or read from stdin. Services: ${API_KEY_CREDENTIAL_SERVICES.join(", ")}`).option("-o, --org", "Organization credentials (admins only)").option("--base-url <url>", "Base URL (ollama, anthropic-compatible, openai-compatible, codex-foundry)").option("--models <ids>", "Comma-separated model IDs (ollama)").option("--models-url <url>", "Models endpoint (openai-compatible)").option("--authorization-header <value>", "Authorization header value (openai-compatible)").option("--preserve-authorization-header", "Forward the authorization header unchanged (openai-compatible)").option("--aws-access-key-id <id>", "AWS access key ID (bedrock)").option("--aws-region <region>", "AWS region (bedrock)").option("--small-fast-model-region <region>", "Region for the small fast model (bedrock)").option("--resource <name>", "Azure Foundry resource (claude-foundry)").option("--sonnet-model <id>", "Sonnet deployment (claude-foundry)").option("--haiku-model <id>", "Haiku deployment (claude-foundry)").option("--opus-model <id>", "Opus deployment (claude-foundry)").option("--model <id>", "Model deployment (codex-foundry)").action(run(credentialsSetCommand));
|
|
58665
|
-
credentials.command("remove <service>").description("Remove stored credentials for a service (also claude, codex, muse subscriptions)").option("-o, --org", "Organization credentials instead of personal").action(run(credentialsRemoveCommand));
|
|
58928
|
+
credentials.command("remove <service>").description("Remove stored credentials for a service (also claude, codex, gemini, muse subscriptions)").option("-o, --org", "Organization credentials instead of personal").action(run(credentialsRemoveCommand));
|
|
58666
58929
|
credentials.command("usage").description("Show how much of each connected Claude and ChatGPT subscription's 5-hour and weekly limits is used (personal and organization by default)").addOption(new import_commander.Option("-o, --org", "Only organization subscriptions").conflicts("user")).option("-u, --user", "Only your personal subscriptions").action(run(credentialsUsageCommand));
|
|
58667
58930
|
automation = program.command("automation").alias("auto").description("Manage automations");
|
|
58668
58931
|
automation.command("list").description("List all automations").option("-p, --page <page>", "Page number").option("-l, --limit <limit>", "Number of items per page").option("--owner <owner>", "Ownership filter: org, user, all").option("--trigger-type <type>", "Only automations with a trigger of this type (cron, github, gitlab, slack, sentry, linear, custom)").option("--enabled <enabled>", "Only enabled or disabled automations (true/false)").option("--search <search>", "Case-insensitive substring match on the name").option("--background <background>", "Only background (true) or main-list (false) automations").action(run(automationListCommand));
|