@ycodium-ai/agent-antigravity 0.2.3976 → 0.2.3982
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.js +16 -55
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1387,7 +1387,7 @@ var require_yauzl = __commonJS({
|
|
|
1387
1387
|
import { definePlugin } from "@ycodium-ai/plugin-api";
|
|
1388
1388
|
|
|
1389
1389
|
// ../../packages/plugin-api/src/version.ts
|
|
1390
|
-
var PLUGIN_API_VERSION =
|
|
1390
|
+
var PLUGIN_API_VERSION = 76;
|
|
1391
1391
|
|
|
1392
1392
|
// src/index.ts
|
|
1393
1393
|
import {
|
|
@@ -28373,9 +28373,7 @@ function createExecutorRuntime({
|
|
|
28373
28373
|
if (shared.disposed) {
|
|
28374
28374
|
return;
|
|
28375
28375
|
}
|
|
28376
|
-
eventStream.publish(
|
|
28377
|
-
options2.originBindingGeneration === void 0 ? event : { ...event, originBindingGeneration: options2.originBindingGeneration }
|
|
28378
|
-
);
|
|
28376
|
+
eventStream.publish(event);
|
|
28379
28377
|
};
|
|
28380
28378
|
const emit = publish;
|
|
28381
28379
|
const emitArtifacts = makeArtifactEmitter({
|
|
@@ -30713,7 +30711,6 @@ function createBackgroundCommandTracker(input2) {
|
|
|
30713
30711
|
provider: ANTIGRAVITY_DRIVER_KIND,
|
|
30714
30712
|
threadId: input2.threadId,
|
|
30715
30713
|
...command.turnId === void 0 ? {} : { turnId: command.turnId },
|
|
30716
|
-
...input2.originBindingGeneration === void 0 ? {} : { originBindingGeneration: input2.originBindingGeneration },
|
|
30717
30714
|
payload: { taskId: id, taskType: TASK_TYPE, toolUseId: id, ...payload }
|
|
30718
30715
|
});
|
|
30719
30716
|
const onToolCallUpdated = (update) => {
|
|
@@ -31436,7 +31433,6 @@ function createAntigravitySession({
|
|
|
31436
31433
|
clock,
|
|
31437
31434
|
userHome,
|
|
31438
31435
|
dirs,
|
|
31439
|
-
events,
|
|
31440
31436
|
threads,
|
|
31441
31437
|
registerSession,
|
|
31442
31438
|
mutable,
|
|
@@ -31535,8 +31531,7 @@ function createAntigravitySession({
|
|
|
31535
31531
|
const resume = input2.discardResumeCursor === true ? void 0 : parseAcpResumeCursor(input2.resumeCursor, RESUME_SCHEMA_VERSION);
|
|
31536
31532
|
const requestedModelId = modelIdFromSelection(input2.modelSelection);
|
|
31537
31533
|
const background = createBackgroundCommandTracker({
|
|
31538
|
-
threadId: input2.threadId
|
|
31539
|
-
originBindingGeneration: input2.bindingGeneration
|
|
31534
|
+
threadId: input2.threadId
|
|
31540
31535
|
});
|
|
31541
31536
|
const hooks = {
|
|
31542
31537
|
// 大载荷在进执行器之前就截断:事件的 rawPayload 取自这里的返回值。
|
|
@@ -31566,7 +31561,6 @@ function createAntigravitySession({
|
|
|
31566
31561
|
slashCommands: acpCommandsToSlashCommands(commands)
|
|
31567
31562
|
}),
|
|
31568
31563
|
...requestedModelId === void 0 ? {} : { requestedModelId },
|
|
31569
|
-
...input2.bindingGeneration === void 0 ? {} : { originBindingGeneration: input2.bindingGeneration },
|
|
31570
31564
|
hooks,
|
|
31571
31565
|
// 只发 agent 在握手里声明过的个人 Google 账号这一种登录方式。
|
|
31572
31566
|
authMethodId: (initialized) => initialized.authMethods?.some((method) => method.id === "oauth-personal") ? "oauth-personal" : void 0,
|
|
@@ -31580,9 +31574,12 @@ function createAntigravitySession({
|
|
|
31580
31574
|
const forwarding = (async () => {
|
|
31581
31575
|
for await (const event of executor.events) {
|
|
31582
31576
|
if (event.type === "turn.completed") {
|
|
31583
|
-
for (const started of background.promote()) events.
|
|
31577
|
+
for (const started of background.promote()) input2.events.emit(started);
|
|
31578
|
+
}
|
|
31579
|
+
if (event.type === "session.exited") {
|
|
31580
|
+
for (const stopped of background.finish()) input2.events.emit(stopped);
|
|
31584
31581
|
}
|
|
31585
|
-
events.
|
|
31582
|
+
input2.events.emit(event);
|
|
31586
31583
|
}
|
|
31587
31584
|
})();
|
|
31588
31585
|
try {
|
|
@@ -31631,6 +31628,7 @@ function createAntigravitySession({
|
|
|
31631
31628
|
...input2.bindingGeneration === void 0 ? {} : { bindingGeneration: input2.bindingGeneration }
|
|
31632
31629
|
};
|
|
31633
31630
|
registerSession(input2.threadId, {
|
|
31631
|
+
events: input2.events,
|
|
31634
31632
|
session,
|
|
31635
31633
|
turns: [],
|
|
31636
31634
|
executor,
|
|
@@ -31671,7 +31669,6 @@ function createAntigravitySession({
|
|
|
31671
31669
|
import * as NodeCrypto4 from "node:crypto";
|
|
31672
31670
|
function createAntigravityTurn({
|
|
31673
31671
|
deps,
|
|
31674
|
-
events,
|
|
31675
31672
|
mutable,
|
|
31676
31673
|
requireThread,
|
|
31677
31674
|
stopSession,
|
|
@@ -31682,7 +31679,7 @@ function createAntigravityTurn({
|
|
|
31682
31679
|
const stamp = () => ({ eventId: NodeCrypto4.randomUUID(), createdAt: nowIso() });
|
|
31683
31680
|
const base = { provider: ANTIGRAVITY_DRIVER_KIND, threadId: input2.threadId, turnId };
|
|
31684
31681
|
booked.session = { ...booked.session, status: "running", updatedAt: nowIso() };
|
|
31685
|
-
events.
|
|
31682
|
+
booked.events.emit({ type: "turn.started", ...stamp(), ...base, payload: {} });
|
|
31686
31683
|
let reply;
|
|
31687
31684
|
try {
|
|
31688
31685
|
await login.logout({ keepThreadId: input2.threadId });
|
|
@@ -31692,8 +31689,10 @@ function createAntigravityTurn({
|
|
|
31692
31689
|
}
|
|
31693
31690
|
const itemId = NodeCrypto4.randomUUID();
|
|
31694
31691
|
const item = { ...base, itemId };
|
|
31695
|
-
events.
|
|
31696
|
-
|
|
31692
|
+
booked.events.emit(
|
|
31693
|
+
makeAcpAssistantItemEvent({ stamp: stamp(), lifecycle: "item.started", ...item })
|
|
31694
|
+
);
|
|
31695
|
+
booked.events.emit(
|
|
31697
31696
|
makeAcpContentDeltaEvent({
|
|
31698
31697
|
stamp: stamp(),
|
|
31699
31698
|
...item,
|
|
@@ -31701,10 +31700,10 @@ function createAntigravityTurn({
|
|
|
31701
31700
|
rawPayload: { synthetic: "logout" }
|
|
31702
31701
|
})
|
|
31703
31702
|
);
|
|
31704
|
-
events.
|
|
31703
|
+
booked.events.emit(
|
|
31705
31704
|
makeAcpAssistantItemEvent({ stamp: stamp(), lifecycle: "item.completed", ...item })
|
|
31706
31705
|
);
|
|
31707
|
-
events.
|
|
31706
|
+
booked.events.emit({
|
|
31708
31707
|
type: "turn.completed",
|
|
31709
31708
|
...stamp(),
|
|
31710
31709
|
...base,
|
|
@@ -33467,38 +33466,6 @@ function createAntigravityTextGeneration(deps) {
|
|
|
33467
33466
|
|
|
33468
33467
|
// src/antigravityInstance.ts
|
|
33469
33468
|
var DEFAULT_EXIT_WAIT_MS = 1e4;
|
|
33470
|
-
var EventBus = class {
|
|
33471
|
-
#queued = [];
|
|
33472
|
-
#waiters = [];
|
|
33473
|
-
#closed = false;
|
|
33474
|
-
push(event) {
|
|
33475
|
-
const waiter = this.#waiters.shift();
|
|
33476
|
-
if (waiter) {
|
|
33477
|
-
waiter({ done: false, value: event });
|
|
33478
|
-
return;
|
|
33479
|
-
}
|
|
33480
|
-
this.#queued.push(event);
|
|
33481
|
-
}
|
|
33482
|
-
close() {
|
|
33483
|
-
if (this.#closed) return;
|
|
33484
|
-
this.#closed = true;
|
|
33485
|
-
while (this.#waiters.length > 0) {
|
|
33486
|
-
this.#waiters.shift()?.({ done: true, value: void 0 });
|
|
33487
|
-
}
|
|
33488
|
-
}
|
|
33489
|
-
[Symbol.asyncIterator]() {
|
|
33490
|
-
return {
|
|
33491
|
-
next: () => {
|
|
33492
|
-
const queued = this.#queued.shift();
|
|
33493
|
-
if (queued !== void 0) return Promise.resolve({ done: false, value: queued });
|
|
33494
|
-
if (this.#closed) return Promise.resolve({ done: true, value: void 0 });
|
|
33495
|
-
return new Promise((resolve6) => {
|
|
33496
|
-
this.#waiters.push(resolve6);
|
|
33497
|
-
});
|
|
33498
|
-
}
|
|
33499
|
-
};
|
|
33500
|
-
}
|
|
33501
|
-
};
|
|
33502
33469
|
async function createAntigravityInstance(config2, host, deps) {
|
|
33503
33470
|
const recipe = parseAntigravityInstanceConfig(config2);
|
|
33504
33471
|
const platform2 = deps.platform ?? HOST_PLATFORM;
|
|
@@ -33514,7 +33481,6 @@ async function createAntigravityInstance(config2, host, deps) {
|
|
|
33514
33481
|
});
|
|
33515
33482
|
const swept = await sweepRuntimeTempDirs(dirs.runtimeTempRoot);
|
|
33516
33483
|
if (swept > 0) host.log.info("removed leftover runtime temp directories", { count: swept });
|
|
33517
|
-
const events = new EventBus();
|
|
33518
33484
|
const threads = /* @__PURE__ */ new Map();
|
|
33519
33485
|
const mutable = { disposed: false };
|
|
33520
33486
|
const unregister = deps.runtime.registerInstance({
|
|
@@ -33530,7 +33496,6 @@ async function createAntigravityInstance(config2, host, deps) {
|
|
|
33530
33496
|
};
|
|
33531
33497
|
const resolveExecutable = () => deps.runtime.resolve(resolveInput);
|
|
33532
33498
|
const stopBooked = async (booked, processExit) => {
|
|
33533
|
-
for (const stopped of booked.background.finish()) events.push(stopped);
|
|
33534
33499
|
await cleanupAcpSession({
|
|
33535
33500
|
executor: booked.executor,
|
|
33536
33501
|
stopProcess: () => stopAgentProcess(booked.handle, exitWaitMs, host.log, clock),
|
|
@@ -33608,7 +33573,6 @@ async function createAntigravityInstance(config2, host, deps) {
|
|
|
33608
33573
|
}
|
|
33609
33574
|
}
|
|
33610
33575
|
await Promise.all([stopAll(), helpers.stopRunning()]);
|
|
33611
|
-
events.close();
|
|
33612
33576
|
});
|
|
33613
33577
|
const signedInFile = signedInMarkerFile(dirs.profile);
|
|
33614
33578
|
const noteSession = (note) => note().catch((error62) => {
|
|
@@ -33661,7 +33625,6 @@ async function createAntigravityInstance(config2, host, deps) {
|
|
|
33661
33625
|
clock,
|
|
33662
33626
|
userHome,
|
|
33663
33627
|
dirs,
|
|
33664
|
-
events,
|
|
33665
33628
|
threads,
|
|
33666
33629
|
registerSession,
|
|
33667
33630
|
mutable,
|
|
@@ -33674,7 +33637,6 @@ async function createAntigravityInstance(config2, host, deps) {
|
|
|
33674
33637
|
});
|
|
33675
33638
|
const turn = createAntigravityTurn({
|
|
33676
33639
|
deps,
|
|
33677
|
-
events,
|
|
33678
33640
|
mutable,
|
|
33679
33641
|
requireThread,
|
|
33680
33642
|
stopSession,
|
|
@@ -33763,7 +33725,6 @@ async function createAntigravityInstance(config2, host, deps) {
|
|
|
33763
33725
|
const booked = requireThread(threadId);
|
|
33764
33726
|
return { threadId, turns: booked.turns };
|
|
33765
33727
|
},
|
|
33766
|
-
events,
|
|
33767
33728
|
textGeneration: helpers.textGeneration,
|
|
33768
33729
|
continuationKey: dirs.continuationKey,
|
|
33769
33730
|
dispose: () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/agent-antigravity",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3982",
|
|
4
4
|
"description": "Google Antigravity executor: runs the Antigravity agent over Agent Client Protocol stdio.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"typescript": "~6.0.3",
|
|
32
32
|
"vite-plus": "0.2.2",
|
|
33
33
|
"yauzl": "^3.4.0",
|
|
34
|
-
"ycodium-
|
|
35
|
-
"
|
|
36
|
-
"ycodium-executor
|
|
34
|
+
"@ycodium-ai/plugin-api": "0.2.3982",
|
|
35
|
+
"ycodium-executor-testing": "0.0.0",
|
|
36
|
+
"ycodium-acp-executor": "0.2.3982"
|
|
37
37
|
},
|
|
38
38
|
"ycodium": {
|
|
39
39
|
"plugin": "./dist/index.js",
|