replicas-engine 0.1.1725 → 0.1.1730
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/src/{asp-host-7DGBCD52.js → asp-host-K3ISVMG6.js} +6 -6
- package/dist/src/{chunk-DHAQM6LA.js → chunk-2HQP6MMR.js} +1 -1
- package/dist/src/{chunk-ZYRAETMX.js → chunk-BUJZF6CI.js} +2 -2
- package/dist/src/{chunk-ESENYL7M.js → chunk-ITJRSUSN.js} +1 -1
- package/dist/src/{chunk-YNHFXBHT.js → chunk-J6MIIMDU.js} +421 -227
- package/dist/src/{chunk-3SJP6X3P.js → chunk-KBE3MXTD.js} +86 -43
- package/dist/src/{chunk-EZWCNWX2.js → chunk-LIX74B2Y.js} +2 -2
- package/dist/src/{chunk-APCSKPLU.js → chunk-O2BDFDEA.js} +1 -1
- package/dist/src/{chunk-UDR2HT74.js → chunk-OW37FXFJ.js} +2 -2
- package/dist/src/{chunk-LIXZEE44.js → chunk-PIZ63O3B.js} +3 -3
- package/dist/src/{chunk-4YQ4UWFY.js → chunk-VHY4DMEA.js} +65 -8
- package/dist/src/{chunk-7ZDAVYTV.js → chunk-XCFPXSY4.js} +4 -0
- package/dist/src/codemode-mcp.js +4 -4
- package/dist/src/command-protection-hook.js +17 -6
- package/dist/src/headless-agent.js +48 -5
- package/dist/src/index.js +755 -192
- package/dist/src/post-tool-pr-hook.js +4 -3
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -6,21 +6,25 @@ import {
|
|
|
6
6
|
fetchOpencodeModelVariants,
|
|
7
7
|
getOpenCodeGoModel,
|
|
8
8
|
getOpencodeProvider,
|
|
9
|
+
initializeGeminiAcp,
|
|
9
10
|
initializeMuse,
|
|
10
11
|
museTurnStartParams,
|
|
11
12
|
opencodeConfig,
|
|
12
13
|
opencodeModelRef,
|
|
13
14
|
opencodeThinkingVariant,
|
|
14
15
|
recoverCompletedTurn,
|
|
16
|
+
selectGeminiModel,
|
|
17
|
+
spawnGeminiAcp,
|
|
15
18
|
spawnMuseMsp,
|
|
19
|
+
startGeminiSession,
|
|
16
20
|
startMuseSession
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-VHY4DMEA.js";
|
|
22
|
+
import "./chunk-XCFPXSY4.js";
|
|
19
23
|
import {
|
|
20
24
|
AppServerProcess,
|
|
21
25
|
buildCodexAgentEnv
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-PIZ63O3B.js";
|
|
27
|
+
import "./chunk-O2BDFDEA.js";
|
|
24
28
|
import {
|
|
25
29
|
AGENT,
|
|
26
30
|
OPENCODE_GO_PROVIDER,
|
|
@@ -30,7 +34,7 @@ import {
|
|
|
30
34
|
headlessAgentUsagePath,
|
|
31
35
|
isRecord,
|
|
32
36
|
withTimeout
|
|
33
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-J6MIIMDU.js";
|
|
34
38
|
import "./chunk-VEQXQN22.js";
|
|
35
39
|
|
|
36
40
|
// src/headless-agent.ts
|
|
@@ -266,6 +270,42 @@ async function runMuse(request) {
|
|
|
266
270
|
child.kill("SIGTERM");
|
|
267
271
|
}
|
|
268
272
|
}
|
|
273
|
+
async function runGemini(request) {
|
|
274
|
+
const { child, client } = spawnGeminiAcp(request.workingDirectory);
|
|
275
|
+
let stderr = "";
|
|
276
|
+
child.stderr.on("data", (chunk) => {
|
|
277
|
+
stderr = `${stderr}${chunk}`.slice(-2e3);
|
|
278
|
+
});
|
|
279
|
+
child.on("exit", (code, signal) => client.dispose(new Error(`Antigravity exited with ${code ?? signal}: ${stderr.trim()}`)));
|
|
280
|
+
client.on("serverRequest", (serverRequest) => client.respond(serverRequest.id, { outcome: { outcome: "cancelled" } }));
|
|
281
|
+
try {
|
|
282
|
+
await initializeGeminiAcp(client);
|
|
283
|
+
const session = await startGeminiSession(client, { cwd: request.workingDirectory });
|
|
284
|
+
await selectGeminiModel(client, session, request.model);
|
|
285
|
+
let message = "";
|
|
286
|
+
client.on("notification", (frame) => {
|
|
287
|
+
if (!isRecord(frame) || !isRecord(frame.params) || frame.params.sessionId !== session.sessionId || !isRecord(frame.params.update)) return;
|
|
288
|
+
const { update } = frame.params;
|
|
289
|
+
if (update.sessionUpdate === "agent_message_chunk" && isRecord(update.content) && typeof update.content.text === "string") {
|
|
290
|
+
message += update.content.text;
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
const response = await withTimeout(
|
|
294
|
+
client.request("session/prompt", { sessionId: session.sessionId, prompt: [{ type: "text", text: jsonReplyPrompt(request) }] }, { timeoutMs: 0 }),
|
|
295
|
+
request.timeoutSeconds * 1e3,
|
|
296
|
+
"Antigravity turn timed out"
|
|
297
|
+
);
|
|
298
|
+
if (!message) throw new Error("Antigravity returned no final message");
|
|
299
|
+
const usage = isRecord(response) && isRecord(response.usage) ? response.usage : null;
|
|
300
|
+
return {
|
|
301
|
+
output: parseJsonReply(message),
|
|
302
|
+
usage: usage && typeof usage.inputTokens === "number" && typeof usage.outputTokens === "number" ? { inputTokens: usage.inputTokens, outputTokens: usage.outputTokens } : null
|
|
303
|
+
};
|
|
304
|
+
} finally {
|
|
305
|
+
client.dispose();
|
|
306
|
+
child.kill("SIGTERM");
|
|
307
|
+
}
|
|
308
|
+
}
|
|
269
309
|
async function main() {
|
|
270
310
|
const [requestPath, outputPath] = process.argv.slice(2);
|
|
271
311
|
if (!requestPath || !outputPath) throw new Error("Usage: replicas-headless-agent <request.json> <output.json>");
|
|
@@ -287,6 +327,9 @@ async function main() {
|
|
|
287
327
|
case AGENT.MUSE:
|
|
288
328
|
result = await runMuse(request);
|
|
289
329
|
break;
|
|
330
|
+
case AGENT.GEMINI:
|
|
331
|
+
result = await runGemini(request);
|
|
332
|
+
break;
|
|
290
333
|
case AGENT.PI:
|
|
291
334
|
throw new Error("Send Pi credentials as an Opencode request, which reads the same stored secrets");
|
|
292
335
|
case AGENT.REPLICAS:
|