@ycodium-ai/agent-antigravity 0.2.3935 → 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 +21 -55
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1385,6 +1385,11 @@ var require_yauzl = __commonJS({
|
|
|
1385
1385
|
|
|
1386
1386
|
// src/index.ts
|
|
1387
1387
|
import { definePlugin } from "@ycodium-ai/plugin-api";
|
|
1388
|
+
|
|
1389
|
+
// ../../packages/plugin-api/src/version.ts
|
|
1390
|
+
var PLUGIN_API_VERSION = 76;
|
|
1391
|
+
|
|
1392
|
+
// src/index.ts
|
|
1388
1393
|
import {
|
|
1389
1394
|
EXECUTOR_EFFECTIVE_PAYLOAD_SCHEMA,
|
|
1390
1395
|
readExecutorEffectiveRequest
|
|
@@ -28368,9 +28373,7 @@ function createExecutorRuntime({
|
|
|
28368
28373
|
if (shared.disposed) {
|
|
28369
28374
|
return;
|
|
28370
28375
|
}
|
|
28371
|
-
eventStream.publish(
|
|
28372
|
-
options2.originBindingGeneration === void 0 ? event : { ...event, originBindingGeneration: options2.originBindingGeneration }
|
|
28373
|
-
);
|
|
28376
|
+
eventStream.publish(event);
|
|
28374
28377
|
};
|
|
28375
28378
|
const emit = publish;
|
|
28376
28379
|
const emitArtifacts = makeArtifactEmitter({
|
|
@@ -30708,7 +30711,6 @@ function createBackgroundCommandTracker(input2) {
|
|
|
30708
30711
|
provider: ANTIGRAVITY_DRIVER_KIND,
|
|
30709
30712
|
threadId: input2.threadId,
|
|
30710
30713
|
...command.turnId === void 0 ? {} : { turnId: command.turnId },
|
|
30711
|
-
...input2.originBindingGeneration === void 0 ? {} : { originBindingGeneration: input2.originBindingGeneration },
|
|
30712
30714
|
payload: { taskId: id, taskType: TASK_TYPE, toolUseId: id, ...payload }
|
|
30713
30715
|
});
|
|
30714
30716
|
const onToolCallUpdated = (update) => {
|
|
@@ -31431,7 +31433,6 @@ function createAntigravitySession({
|
|
|
31431
31433
|
clock,
|
|
31432
31434
|
userHome,
|
|
31433
31435
|
dirs,
|
|
31434
|
-
events,
|
|
31435
31436
|
threads,
|
|
31436
31437
|
registerSession,
|
|
31437
31438
|
mutable,
|
|
@@ -31530,8 +31531,7 @@ function createAntigravitySession({
|
|
|
31530
31531
|
const resume = input2.discardResumeCursor === true ? void 0 : parseAcpResumeCursor(input2.resumeCursor, RESUME_SCHEMA_VERSION);
|
|
31531
31532
|
const requestedModelId = modelIdFromSelection(input2.modelSelection);
|
|
31532
31533
|
const background = createBackgroundCommandTracker({
|
|
31533
|
-
threadId: input2.threadId
|
|
31534
|
-
originBindingGeneration: input2.bindingGeneration
|
|
31534
|
+
threadId: input2.threadId
|
|
31535
31535
|
});
|
|
31536
31536
|
const hooks = {
|
|
31537
31537
|
// 大载荷在进执行器之前就截断:事件的 rawPayload 取自这里的返回值。
|
|
@@ -31561,7 +31561,6 @@ function createAntigravitySession({
|
|
|
31561
31561
|
slashCommands: acpCommandsToSlashCommands(commands)
|
|
31562
31562
|
}),
|
|
31563
31563
|
...requestedModelId === void 0 ? {} : { requestedModelId },
|
|
31564
|
-
...input2.bindingGeneration === void 0 ? {} : { originBindingGeneration: input2.bindingGeneration },
|
|
31565
31564
|
hooks,
|
|
31566
31565
|
// 只发 agent 在握手里声明过的个人 Google 账号这一种登录方式。
|
|
31567
31566
|
authMethodId: (initialized) => initialized.authMethods?.some((method) => method.id === "oauth-personal") ? "oauth-personal" : void 0,
|
|
@@ -31575,9 +31574,12 @@ function createAntigravitySession({
|
|
|
31575
31574
|
const forwarding = (async () => {
|
|
31576
31575
|
for await (const event of executor.events) {
|
|
31577
31576
|
if (event.type === "turn.completed") {
|
|
31578
|
-
for (const started of background.promote()) events.
|
|
31577
|
+
for (const started of background.promote()) input2.events.emit(started);
|
|
31579
31578
|
}
|
|
31580
|
-
|
|
31579
|
+
if (event.type === "session.exited") {
|
|
31580
|
+
for (const stopped of background.finish()) input2.events.emit(stopped);
|
|
31581
|
+
}
|
|
31582
|
+
input2.events.emit(event);
|
|
31581
31583
|
}
|
|
31582
31584
|
})();
|
|
31583
31585
|
try {
|
|
@@ -31626,6 +31628,7 @@ function createAntigravitySession({
|
|
|
31626
31628
|
...input2.bindingGeneration === void 0 ? {} : { bindingGeneration: input2.bindingGeneration }
|
|
31627
31629
|
};
|
|
31628
31630
|
registerSession(input2.threadId, {
|
|
31631
|
+
events: input2.events,
|
|
31629
31632
|
session,
|
|
31630
31633
|
turns: [],
|
|
31631
31634
|
executor,
|
|
@@ -31666,7 +31669,6 @@ function createAntigravitySession({
|
|
|
31666
31669
|
import * as NodeCrypto4 from "node:crypto";
|
|
31667
31670
|
function createAntigravityTurn({
|
|
31668
31671
|
deps,
|
|
31669
|
-
events,
|
|
31670
31672
|
mutable,
|
|
31671
31673
|
requireThread,
|
|
31672
31674
|
stopSession,
|
|
@@ -31677,7 +31679,7 @@ function createAntigravityTurn({
|
|
|
31677
31679
|
const stamp = () => ({ eventId: NodeCrypto4.randomUUID(), createdAt: nowIso() });
|
|
31678
31680
|
const base = { provider: ANTIGRAVITY_DRIVER_KIND, threadId: input2.threadId, turnId };
|
|
31679
31681
|
booked.session = { ...booked.session, status: "running", updatedAt: nowIso() };
|
|
31680
|
-
events.
|
|
31682
|
+
booked.events.emit({ type: "turn.started", ...stamp(), ...base, payload: {} });
|
|
31681
31683
|
let reply;
|
|
31682
31684
|
try {
|
|
31683
31685
|
await login.logout({ keepThreadId: input2.threadId });
|
|
@@ -31687,8 +31689,10 @@ function createAntigravityTurn({
|
|
|
31687
31689
|
}
|
|
31688
31690
|
const itemId = NodeCrypto4.randomUUID();
|
|
31689
31691
|
const item = { ...base, itemId };
|
|
31690
|
-
events.
|
|
31691
|
-
|
|
31692
|
+
booked.events.emit(
|
|
31693
|
+
makeAcpAssistantItemEvent({ stamp: stamp(), lifecycle: "item.started", ...item })
|
|
31694
|
+
);
|
|
31695
|
+
booked.events.emit(
|
|
31692
31696
|
makeAcpContentDeltaEvent({
|
|
31693
31697
|
stamp: stamp(),
|
|
31694
31698
|
...item,
|
|
@@ -31696,10 +31700,10 @@ function createAntigravityTurn({
|
|
|
31696
31700
|
rawPayload: { synthetic: "logout" }
|
|
31697
31701
|
})
|
|
31698
31702
|
);
|
|
31699
|
-
events.
|
|
31703
|
+
booked.events.emit(
|
|
31700
31704
|
makeAcpAssistantItemEvent({ stamp: stamp(), lifecycle: "item.completed", ...item })
|
|
31701
31705
|
);
|
|
31702
|
-
events.
|
|
31706
|
+
booked.events.emit({
|
|
31703
31707
|
type: "turn.completed",
|
|
31704
31708
|
...stamp(),
|
|
31705
31709
|
...base,
|
|
@@ -33462,38 +33466,6 @@ function createAntigravityTextGeneration(deps) {
|
|
|
33462
33466
|
|
|
33463
33467
|
// src/antigravityInstance.ts
|
|
33464
33468
|
var DEFAULT_EXIT_WAIT_MS = 1e4;
|
|
33465
|
-
var EventBus = class {
|
|
33466
|
-
#queued = [];
|
|
33467
|
-
#waiters = [];
|
|
33468
|
-
#closed = false;
|
|
33469
|
-
push(event) {
|
|
33470
|
-
const waiter = this.#waiters.shift();
|
|
33471
|
-
if (waiter) {
|
|
33472
|
-
waiter({ done: false, value: event });
|
|
33473
|
-
return;
|
|
33474
|
-
}
|
|
33475
|
-
this.#queued.push(event);
|
|
33476
|
-
}
|
|
33477
|
-
close() {
|
|
33478
|
-
if (this.#closed) return;
|
|
33479
|
-
this.#closed = true;
|
|
33480
|
-
while (this.#waiters.length > 0) {
|
|
33481
|
-
this.#waiters.shift()?.({ done: true, value: void 0 });
|
|
33482
|
-
}
|
|
33483
|
-
}
|
|
33484
|
-
[Symbol.asyncIterator]() {
|
|
33485
|
-
return {
|
|
33486
|
-
next: () => {
|
|
33487
|
-
const queued = this.#queued.shift();
|
|
33488
|
-
if (queued !== void 0) return Promise.resolve({ done: false, value: queued });
|
|
33489
|
-
if (this.#closed) return Promise.resolve({ done: true, value: void 0 });
|
|
33490
|
-
return new Promise((resolve6) => {
|
|
33491
|
-
this.#waiters.push(resolve6);
|
|
33492
|
-
});
|
|
33493
|
-
}
|
|
33494
|
-
};
|
|
33495
|
-
}
|
|
33496
|
-
};
|
|
33497
33469
|
async function createAntigravityInstance(config2, host, deps) {
|
|
33498
33470
|
const recipe = parseAntigravityInstanceConfig(config2);
|
|
33499
33471
|
const platform2 = deps.platform ?? HOST_PLATFORM;
|
|
@@ -33509,7 +33481,6 @@ async function createAntigravityInstance(config2, host, deps) {
|
|
|
33509
33481
|
});
|
|
33510
33482
|
const swept = await sweepRuntimeTempDirs(dirs.runtimeTempRoot);
|
|
33511
33483
|
if (swept > 0) host.log.info("removed leftover runtime temp directories", { count: swept });
|
|
33512
|
-
const events = new EventBus();
|
|
33513
33484
|
const threads = /* @__PURE__ */ new Map();
|
|
33514
33485
|
const mutable = { disposed: false };
|
|
33515
33486
|
const unregister = deps.runtime.registerInstance({
|
|
@@ -33525,7 +33496,6 @@ async function createAntigravityInstance(config2, host, deps) {
|
|
|
33525
33496
|
};
|
|
33526
33497
|
const resolveExecutable = () => deps.runtime.resolve(resolveInput);
|
|
33527
33498
|
const stopBooked = async (booked, processExit) => {
|
|
33528
|
-
for (const stopped of booked.background.finish()) events.push(stopped);
|
|
33529
33499
|
await cleanupAcpSession({
|
|
33530
33500
|
executor: booked.executor,
|
|
33531
33501
|
stopProcess: () => stopAgentProcess(booked.handle, exitWaitMs, host.log, clock),
|
|
@@ -33603,7 +33573,6 @@ async function createAntigravityInstance(config2, host, deps) {
|
|
|
33603
33573
|
}
|
|
33604
33574
|
}
|
|
33605
33575
|
await Promise.all([stopAll(), helpers.stopRunning()]);
|
|
33606
|
-
events.close();
|
|
33607
33576
|
});
|
|
33608
33577
|
const signedInFile = signedInMarkerFile(dirs.profile);
|
|
33609
33578
|
const noteSession = (note) => note().catch((error62) => {
|
|
@@ -33656,7 +33625,6 @@ async function createAntigravityInstance(config2, host, deps) {
|
|
|
33656
33625
|
clock,
|
|
33657
33626
|
userHome,
|
|
33658
33627
|
dirs,
|
|
33659
|
-
events,
|
|
33660
33628
|
threads,
|
|
33661
33629
|
registerSession,
|
|
33662
33630
|
mutable,
|
|
@@ -33669,7 +33637,6 @@ async function createAntigravityInstance(config2, host, deps) {
|
|
|
33669
33637
|
});
|
|
33670
33638
|
const turn = createAntigravityTurn({
|
|
33671
33639
|
deps,
|
|
33672
|
-
events,
|
|
33673
33640
|
mutable,
|
|
33674
33641
|
requireThread,
|
|
33675
33642
|
stopSession,
|
|
@@ -33758,7 +33725,6 @@ async function createAntigravityInstance(config2, host, deps) {
|
|
|
33758
33725
|
const booked = requireThread(threadId);
|
|
33759
33726
|
return { threadId, turns: booked.turns };
|
|
33760
33727
|
},
|
|
33761
|
-
events,
|
|
33762
33728
|
textGeneration: helpers.textGeneration,
|
|
33763
33729
|
continuationKey: dirs.continuationKey,
|
|
33764
33730
|
dispose: () => {
|
|
@@ -34843,7 +34809,7 @@ var executors = [
|
|
|
34843
34809
|
];
|
|
34844
34810
|
var index_default = definePlugin({
|
|
34845
34811
|
id: "agent-antigravity",
|
|
34846
|
-
apiVersion:
|
|
34812
|
+
apiVersion: PLUGIN_API_VERSION,
|
|
34847
34813
|
executors,
|
|
34848
34814
|
activate(ctx) {
|
|
34849
34815
|
const runtime = createRuntimeManager({
|
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",
|