@ycodium-ai/agent-antigravity 0.2.4321 → 0.2.4351
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 +91 -15
- package/package.json +3 -3
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 = 110;
|
|
1391
1391
|
|
|
1392
1392
|
// src/index.ts
|
|
1393
1393
|
import {
|
|
@@ -1768,9 +1768,11 @@ var AcpExecutorRequestError = class extends AcpExecutorError {
|
|
|
1768
1768
|
}
|
|
1769
1769
|
};
|
|
1770
1770
|
var AcpConnectionClosedError = class extends Error {
|
|
1771
|
+
reason;
|
|
1771
1772
|
constructor(message = "ACP connection closed", options2) {
|
|
1772
|
-
super(message, options2);
|
|
1773
|
+
super(message, options2?.cause === void 0 ? void 0 : { cause: options2.cause });
|
|
1773
1774
|
this.name = "AcpConnectionClosedError";
|
|
1775
|
+
this.reason = options2?.reason ?? "closed";
|
|
1774
1776
|
}
|
|
1775
1777
|
};
|
|
1776
1778
|
async function withStartupStderr(error62, stderrTail) {
|
|
@@ -1780,9 +1782,65 @@ async function withStartupStderr(error62, stderrTail) {
|
|
|
1780
1782
|
return new AcpConnectionClosedError(`${error62.message}
|
|
1781
1783
|
Agent stderr (last lines):
|
|
1782
1784
|
${tail}`, {
|
|
1783
|
-
cause: error62
|
|
1785
|
+
cause: error62,
|
|
1786
|
+
reason: error62.reason
|
|
1784
1787
|
});
|
|
1785
1788
|
}
|
|
1789
|
+
var AGENT_EXIT_STDERR_MAX_CHARS = 800;
|
|
1790
|
+
var AGENT_EXIT_SETTLE_MS = 500;
|
|
1791
|
+
var AcpAgentExitedError = class extends AcpConnectionClosedError {
|
|
1792
|
+
exitCode;
|
|
1793
|
+
constructor(message, exitCode, cause) {
|
|
1794
|
+
super(message, { cause, reason: "input-ended" });
|
|
1795
|
+
this.name = "AcpAgentExitedError";
|
|
1796
|
+
this.exitCode = exitCode;
|
|
1797
|
+
}
|
|
1798
|
+
};
|
|
1799
|
+
var REDACTION_MARKERS = ["[redacted]", "[pairing-url]"];
|
|
1800
|
+
var lastLines = (text, maxChars) => {
|
|
1801
|
+
if (text.length <= maxChars) return text;
|
|
1802
|
+
let start = text.length - maxChars;
|
|
1803
|
+
if (text[start - 1] !== "\n") {
|
|
1804
|
+
const lineEnd = text.indexOf("\n", start);
|
|
1805
|
+
if (lineEnd !== -1 && lineEnd < text.length - 1) return text.slice(lineEnd + 1);
|
|
1806
|
+
const code = text.charCodeAt(start);
|
|
1807
|
+
if (code >= 56320 && code <= 57343) start += 1;
|
|
1808
|
+
for (const marker of REDACTION_MARKERS) {
|
|
1809
|
+
const at = text.lastIndexOf(marker, start);
|
|
1810
|
+
if (at !== -1 && at < start && start < at + marker.length) start = at + marker.length;
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
return text.slice(start);
|
|
1814
|
+
};
|
|
1815
|
+
var settledExitCode = async (exited) => {
|
|
1816
|
+
if (exited === void 0) return void 0;
|
|
1817
|
+
let timer;
|
|
1818
|
+
try {
|
|
1819
|
+
return await Promise.race([
|
|
1820
|
+
exited.catch(() => void 0),
|
|
1821
|
+
new Promise((resolve6) => {
|
|
1822
|
+
timer = setTimeout(() => resolve6(void 0), AGENT_EXIT_SETTLE_MS);
|
|
1823
|
+
})
|
|
1824
|
+
]);
|
|
1825
|
+
} finally {
|
|
1826
|
+
clearTimeout(timer);
|
|
1827
|
+
}
|
|
1828
|
+
};
|
|
1829
|
+
async function describeAgentExit(input2) {
|
|
1830
|
+
const [exitCode, tail] = await Promise.all([
|
|
1831
|
+
settledExitCode(input2.exited),
|
|
1832
|
+
input2.stderrTail === void 0 ? "" : Promise.resolve().then(input2.stderrTail).catch(() => "")
|
|
1833
|
+
]);
|
|
1834
|
+
const head = exitCode === void 0 ? "The agent closed its connection." : exitCode === null ? "The agent process exited without an exit code." : `The agent process exited with code ${exitCode}.`;
|
|
1835
|
+
const excerpt = lastLines(tail.trim(), AGENT_EXIT_STDERR_MAX_CHARS);
|
|
1836
|
+
return new AcpAgentExitedError(
|
|
1837
|
+
excerpt.length === 0 ? head : `${head}
|
|
1838
|
+
Agent stderr (last lines):
|
|
1839
|
+
${excerpt}`,
|
|
1840
|
+
exitCode,
|
|
1841
|
+
input2.cause
|
|
1842
|
+
);
|
|
1843
|
+
}
|
|
1786
1844
|
|
|
1787
1845
|
// ../../packages/ycodium-acp-executor/src/event-stream.ts
|
|
1788
1846
|
var UnboundedEventStream = class {
|
|
@@ -26749,7 +26807,8 @@ function createAcpConnection(options2) {
|
|
|
26749
26807
|
options2.onInboundFailure?.(error62);
|
|
26750
26808
|
void shutdown(
|
|
26751
26809
|
new AcpConnectionClosedError(
|
|
26752
|
-
`ACP inbound handling failed: ${error62 instanceof Error ? error62.message : String(error62)}
|
|
26810
|
+
`ACP inbound handling failed: ${error62 instanceof Error ? error62.message : String(error62)}`,
|
|
26811
|
+
{ reason: "inbound-failed" }
|
|
26753
26812
|
)
|
|
26754
26813
|
);
|
|
26755
26814
|
};
|
|
@@ -26794,19 +26853,21 @@ function createAcpConnection(options2) {
|
|
|
26794
26853
|
} finally {
|
|
26795
26854
|
endInboundBatch();
|
|
26796
26855
|
}
|
|
26797
|
-
await shutdown(
|
|
26856
|
+
await shutdown(
|
|
26857
|
+
new AcpConnectionClosedError("ACP input stream ended", { reason: "input-ended" })
|
|
26858
|
+
);
|
|
26798
26859
|
});
|
|
26799
26860
|
};
|
|
26800
26861
|
const onError = (error62) => {
|
|
26801
26862
|
enqueueInbound(async () => {
|
|
26802
26863
|
await shutdown(
|
|
26803
|
-
error62 instanceof Error ? error62 : new AcpConnectionClosedError("ACP input stream error")
|
|
26864
|
+
error62 instanceof Error ? error62 : new AcpConnectionClosedError("ACP input stream error", { reason: "stream-error" })
|
|
26804
26865
|
);
|
|
26805
26866
|
});
|
|
26806
26867
|
};
|
|
26807
26868
|
const onWritableError = (error62) => {
|
|
26808
26869
|
void shutdown(
|
|
26809
|
-
error62 instanceof Error ? error62 : new AcpConnectionClosedError("ACP output stream error")
|
|
26870
|
+
error62 instanceof Error ? error62 : new AcpConnectionClosedError("ACP output stream error", { reason: "stream-error" })
|
|
26810
26871
|
);
|
|
26811
26872
|
};
|
|
26812
26873
|
options2.readable.on("data", onData);
|
|
@@ -26869,7 +26930,8 @@ function createAcpConnection(options2) {
|
|
|
26869
26930
|
awaitInboundIdle,
|
|
26870
26931
|
abandonPending,
|
|
26871
26932
|
close,
|
|
26872
|
-
closed
|
|
26933
|
+
closed,
|
|
26934
|
+
closeError: () => closedError
|
|
26873
26935
|
};
|
|
26874
26936
|
}
|
|
26875
26937
|
|
|
@@ -27278,7 +27340,8 @@ var ACP_FAILURE_CATEGORIES = [
|
|
|
27278
27340
|
"auth",
|
|
27279
27341
|
"model-unavailable",
|
|
27280
27342
|
"transport",
|
|
27281
|
-
"unknown"
|
|
27343
|
+
"unknown",
|
|
27344
|
+
"process-exit"
|
|
27282
27345
|
];
|
|
27283
27346
|
var isAcpFailureCategory = (value) => ACP_FAILURE_CATEGORIES.some((category) => category === value);
|
|
27284
27347
|
var readAcpFailureCategory = (error62) => {
|
|
@@ -27288,11 +27351,14 @@ var readAcpFailureCategory = (error62) => {
|
|
|
27288
27351
|
};
|
|
27289
27352
|
var withFailureCategory = (error62, category) => category === void 0 ? error62 : Object.assign(error62, { failureCategory: category });
|
|
27290
27353
|
var failureCategoryField = (category) => category === void 0 ? {} : { failureCategory: category };
|
|
27291
|
-
var
|
|
27354
|
+
var acpClosedConnectionCategory = (closeError, sessionEstablished, disposed) => {
|
|
27355
|
+
if (!sessionEstablished || disposed) return void 0;
|
|
27356
|
+
return closeError instanceof AcpConnectionClosedError && closeError.reason === "input-ended" ? "process-exit" : "transport";
|
|
27357
|
+
};
|
|
27292
27358
|
var acpPromptFailureCategory = (error62, input2) => {
|
|
27293
27359
|
const signaled = readAcpFailureCategory(error62);
|
|
27294
27360
|
if (signaled !== void 0) return signaled;
|
|
27295
|
-
return error62 instanceof AcpConnectionClosedError ?
|
|
27361
|
+
return error62 instanceof AcpConnectionClosedError ? acpClosedConnectionCategory(error62, input2.sessionEstablished, input2.disposed) : void 0;
|
|
27296
27362
|
};
|
|
27297
27363
|
|
|
27298
27364
|
// ../../packages/ycodium-acp-executor/src/tool-subagents.ts
|
|
@@ -27307,7 +27373,7 @@ var sealedHidden = (entry) => ({
|
|
|
27307
27373
|
});
|
|
27308
27374
|
function toolSubagentSettlementOfTurn(state, failureCategory) {
|
|
27309
27375
|
if (state === "cancelled") return "turn-interrupted";
|
|
27310
|
-
return state === "failed" && failureCategory === "
|
|
27376
|
+
return state === "failed" && failureCategory === "process-exit" ? "session-ended" : "turn-ended";
|
|
27311
27377
|
}
|
|
27312
27378
|
var sameFacts = (a, b) => a.title === b.title && a.description === b.description && a.summary === b.summary && a.role === b.role && a.model === b.model && a.effort === b.effort && a.rosterKind === b.rosterKind;
|
|
27313
27379
|
function linkage(taskId, toolCallId, facts) {
|
|
@@ -27924,14 +27990,19 @@ function createExecutorPrompt({
|
|
|
27924
27990
|
},
|
|
27925
27991
|
record2
|
|
27926
27992
|
);
|
|
27927
|
-
} catch (
|
|
27993
|
+
} catch (caught) {
|
|
27928
27994
|
if (shared.disposed) {
|
|
27929
27995
|
throw new AcpExecutorDisposedError();
|
|
27930
27996
|
}
|
|
27931
|
-
const failureCategory = acpPromptFailureCategory(
|
|
27997
|
+
const failureCategory = acpPromptFailureCategory(caught, {
|
|
27932
27998
|
sessionEstablished: shared.startResult !== void 0,
|
|
27933
27999
|
disposed: shared.disposed
|
|
27934
28000
|
});
|
|
28001
|
+
const error62 = failureCategory === "process-exit" && !interruptedTurnIds.has(turnId) ? await describeAgentExit({
|
|
28002
|
+
cause: caught,
|
|
28003
|
+
exited: options2.exited,
|
|
28004
|
+
stderrTail: options2.stderrTail
|
|
28005
|
+
}) : caught;
|
|
27935
28006
|
if (!interruptedTurnIds.has(turnId)) {
|
|
27936
28007
|
const errorMessage2 = error62 instanceof Error && error62.message.trim() || "ACP prompt failed";
|
|
27937
28008
|
if (settle2({
|
|
@@ -29809,7 +29880,11 @@ function createAcpExecutor(options2) {
|
|
|
29809
29880
|
settleAllUserInputs();
|
|
29810
29881
|
abortPendingSettlement(
|
|
29811
29882
|
"connection closed",
|
|
29812
|
-
|
|
29883
|
+
acpClosedConnectionCategory(
|
|
29884
|
+
connection.closeError(),
|
|
29885
|
+
shared.startResult !== void 0,
|
|
29886
|
+
shared.disposed
|
|
29887
|
+
)
|
|
29813
29888
|
);
|
|
29814
29889
|
shared.promptWaiters.splice(0).forEach((wake) => wake());
|
|
29815
29890
|
},
|
|
@@ -31549,6 +31624,7 @@ function createAntigravitySession({
|
|
|
31549
31624
|
readable,
|
|
31550
31625
|
writable,
|
|
31551
31626
|
stderrTail,
|
|
31627
|
+
exited: handle.exited,
|
|
31552
31628
|
cwd,
|
|
31553
31629
|
threadId: input2.threadId,
|
|
31554
31630
|
provider: ANTIGRAVITY_DRIVER_KIND,
|
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.4351",
|
|
4
4
|
"description": "Google Antigravity executor: runs the Antigravity agent over Agent Client Protocol stdio.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"typescript": "~6.0.3",
|
|
32
32
|
"vite-plus": "0.2.2",
|
|
33
33
|
"yauzl": "^3.4.0",
|
|
34
|
-
"ycodium-
|
|
35
|
-
"
|
|
34
|
+
"@ycodium-ai/plugin-api": "0.2.4351",
|
|
35
|
+
"ycodium-acp-executor": "0.2.4351",
|
|
36
36
|
"ycodium-executor-testing": "0.0.0"
|
|
37
37
|
},
|
|
38
38
|
"ycodium": {
|