@ycodium-ai/agent-antigravity 0.2.5265 → 0.2.5271
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 +152 -152
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1692,158 +1692,6 @@ function approvalOutcomeForDecision(decision, optionId) {
|
|
|
1692
1692
|
return decision !== "cancel" && optionId !== void 0 ? { outcome: "selected", optionId } : { outcome: "cancelled" };
|
|
1693
1693
|
}
|
|
1694
1694
|
|
|
1695
|
-
// ../../packages/ycodium-executor-common/src/stderrTail.ts
|
|
1696
|
-
var REDACTION_MARKERS = ["[redacted]", "[pairing-url]"];
|
|
1697
|
-
function lastStderrTail(text, maxChars) {
|
|
1698
|
-
if (text.length <= maxChars) return text;
|
|
1699
|
-
let start = text.length - maxChars;
|
|
1700
|
-
if (text[start - 1] !== "\n") {
|
|
1701
|
-
const lineEnd = text.indexOf("\n", start);
|
|
1702
|
-
if (lineEnd !== -1 && lineEnd < text.length - 1) return text.slice(lineEnd + 1);
|
|
1703
|
-
const code = text.charCodeAt(start);
|
|
1704
|
-
if (code >= 56320 && code <= 57343) start += 1;
|
|
1705
|
-
for (const marker of REDACTION_MARKERS) {
|
|
1706
|
-
const at = text.lastIndexOf(marker, start);
|
|
1707
|
-
if (at !== -1 && at < start && start < at + marker.length) start = at + marker.length;
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
1710
|
-
return text.slice(start);
|
|
1711
|
-
}
|
|
1712
|
-
|
|
1713
|
-
// ../../packages/ycodium-acp-executor/src/errors.ts
|
|
1714
|
-
var AcpExecutorError = class extends Error {
|
|
1715
|
-
code;
|
|
1716
|
-
constructor(code, message) {
|
|
1717
|
-
super(message);
|
|
1718
|
-
this.name = "AcpExecutorError";
|
|
1719
|
-
this.code = code;
|
|
1720
|
-
}
|
|
1721
|
-
};
|
|
1722
|
-
var AcpExecutorDisposedError = class extends AcpExecutorError {
|
|
1723
|
-
constructor(message = "ACP executor has been disposed") {
|
|
1724
|
-
super("disposed", message);
|
|
1725
|
-
this.name = "AcpExecutorDisposedError";
|
|
1726
|
-
}
|
|
1727
|
-
};
|
|
1728
|
-
var AcpExecutorTurnEndedError = class extends AcpExecutorError {
|
|
1729
|
-
constructor(message = "The target turn has ended. The message was not sent.") {
|
|
1730
|
-
super("provider-rejected", message);
|
|
1731
|
-
this.name = "AcpExecutorTurnEndedError";
|
|
1732
|
-
}
|
|
1733
|
-
};
|
|
1734
|
-
var AcpExecutorOptionRejectedError = class extends AcpExecutorError {
|
|
1735
|
-
constructor(option, value, cause) {
|
|
1736
|
-
const detail = acpErrorDetail(cause);
|
|
1737
|
-
super(
|
|
1738
|
-
"provider-rejected",
|
|
1739
|
-
`The agent rejected the ${option}${value === void 0 ? "" : ` "${value}"`}${detail === void 0 ? "" : ` (${detail})`}. This turn was not sent.`
|
|
1740
|
-
);
|
|
1741
|
-
this.name = "AcpExecutorOptionRejectedError";
|
|
1742
|
-
}
|
|
1743
|
-
};
|
|
1744
|
-
var AcpExecutorOptionTimeoutError = class extends AcpExecutorError {
|
|
1745
|
-
constructor(option, value) {
|
|
1746
|
-
super(
|
|
1747
|
-
"provider-rejected",
|
|
1748
|
-
`The agent did not answer the ${option} "${value}" change in time. This turn was not sent.`
|
|
1749
|
-
);
|
|
1750
|
-
this.name = "AcpExecutorOptionTimeoutError";
|
|
1751
|
-
}
|
|
1752
|
-
};
|
|
1753
|
-
var AcpOptionWriteStoppedError = class extends Error {
|
|
1754
|
-
constructor() {
|
|
1755
|
-
super("option write stopped");
|
|
1756
|
-
this.name = "AcpOptionWriteStoppedError";
|
|
1757
|
-
}
|
|
1758
|
-
};
|
|
1759
|
-
function acpErrorDetail(cause) {
|
|
1760
|
-
if (typeof cause !== "object" || cause === null) return void 0;
|
|
1761
|
-
const message = cause.message;
|
|
1762
|
-
const data = cause.data;
|
|
1763
|
-
const parts = [message, data].filter(
|
|
1764
|
-
(part) => typeof part === "string" && part.trim().length > 0
|
|
1765
|
-
);
|
|
1766
|
-
return parts.length === 0 ? void 0 : parts.join(": ");
|
|
1767
|
-
}
|
|
1768
|
-
var AcpExecutorNotStartedError = class extends AcpExecutorError {
|
|
1769
|
-
constructor(message = "ACP session has not been started") {
|
|
1770
|
-
super("not-started", message);
|
|
1771
|
-
this.name = "AcpExecutorNotStartedError";
|
|
1772
|
-
}
|
|
1773
|
-
};
|
|
1774
|
-
var AcpExecutorCancelTimeoutError = class extends AcpExecutorError {
|
|
1775
|
-
constructor(message = "Timed out waiting for session/prompt to finish after cancellation") {
|
|
1776
|
-
super("cancel-timeout", message);
|
|
1777
|
-
this.name = "AcpExecutorCancelTimeoutError";
|
|
1778
|
-
}
|
|
1779
|
-
};
|
|
1780
|
-
var AcpExecutorRequestError = class extends AcpExecutorError {
|
|
1781
|
-
method;
|
|
1782
|
-
constructor(method, message) {
|
|
1783
|
-
super("request-failed", message);
|
|
1784
|
-
this.name = "AcpExecutorRequestError";
|
|
1785
|
-
this.method = method;
|
|
1786
|
-
}
|
|
1787
|
-
};
|
|
1788
|
-
var AcpConnectionClosedError = class extends Error {
|
|
1789
|
-
reason;
|
|
1790
|
-
constructor(message = "ACP connection closed", options2) {
|
|
1791
|
-
super(message, options2?.cause === void 0 ? void 0 : { cause: options2.cause });
|
|
1792
|
-
this.name = "AcpConnectionClosedError";
|
|
1793
|
-
this.reason = options2?.reason ?? "closed";
|
|
1794
|
-
}
|
|
1795
|
-
};
|
|
1796
|
-
async function withStartupStderr(error62, stderrTail) {
|
|
1797
|
-
if (!(error62 instanceof AcpConnectionClosedError) || stderrTail === void 0) return error62;
|
|
1798
|
-
const tail = await stderrTail();
|
|
1799
|
-
if (tail.length === 0) return error62;
|
|
1800
|
-
return new AcpConnectionClosedError(`${error62.message}
|
|
1801
|
-
Agent stderr (last lines):
|
|
1802
|
-
${tail}`, {
|
|
1803
|
-
cause: error62,
|
|
1804
|
-
reason: error62.reason
|
|
1805
|
-
});
|
|
1806
|
-
}
|
|
1807
|
-
var AGENT_EXIT_STDERR_MAX_CHARS = 800;
|
|
1808
|
-
var AGENT_EXIT_SETTLE_MS = 500;
|
|
1809
|
-
var AcpAgentExitedError = class extends AcpConnectionClosedError {
|
|
1810
|
-
exitCode;
|
|
1811
|
-
constructor(message, exitCode, cause) {
|
|
1812
|
-
super(message, { cause, reason: "input-ended" });
|
|
1813
|
-
this.name = "AcpAgentExitedError";
|
|
1814
|
-
this.exitCode = exitCode;
|
|
1815
|
-
}
|
|
1816
|
-
};
|
|
1817
|
-
var settledExitCode = async (exited) => {
|
|
1818
|
-
if (exited === void 0) return void 0;
|
|
1819
|
-
let timer;
|
|
1820
|
-
try {
|
|
1821
|
-
return await Promise.race([
|
|
1822
|
-
exited.catch(() => void 0),
|
|
1823
|
-
new Promise((resolve7) => {
|
|
1824
|
-
timer = setTimeout(() => resolve7(void 0), AGENT_EXIT_SETTLE_MS);
|
|
1825
|
-
})
|
|
1826
|
-
]);
|
|
1827
|
-
} finally {
|
|
1828
|
-
clearTimeout(timer);
|
|
1829
|
-
}
|
|
1830
|
-
};
|
|
1831
|
-
async function describeAgentExit(input2) {
|
|
1832
|
-
const [exitCode, tail] = await Promise.all([
|
|
1833
|
-
settledExitCode(input2.exited),
|
|
1834
|
-
input2.stderrTail === void 0 ? "" : Promise.resolve().then(input2.stderrTail).catch(() => "")
|
|
1835
|
-
]);
|
|
1836
|
-
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}.`;
|
|
1837
|
-
const excerpt = lastStderrTail(tail.trim(), AGENT_EXIT_STDERR_MAX_CHARS);
|
|
1838
|
-
return new AcpAgentExitedError(
|
|
1839
|
-
excerpt.length === 0 ? head : `${head}
|
|
1840
|
-
Agent stderr (last lines):
|
|
1841
|
-
${excerpt}`,
|
|
1842
|
-
exitCode,
|
|
1843
|
-
input2.cause
|
|
1844
|
-
);
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
1695
|
// ../../packages/ycodium-acp-executor/src/event-stream.ts
|
|
1848
1696
|
var UnboundedEventStream = class {
|
|
1849
1697
|
subscribers = /* @__PURE__ */ new Set();
|
|
@@ -2030,6 +1878,158 @@ function acpModelChoicesFromSessionModels(models) {
|
|
|
2030
1878
|
return out;
|
|
2031
1879
|
}
|
|
2032
1880
|
|
|
1881
|
+
// ../../packages/ycodium-executor-common/src/stderrTail.ts
|
|
1882
|
+
var REDACTION_MARKERS = ["[redacted]", "[pairing-url]"];
|
|
1883
|
+
function lastStderrTail(text, maxChars) {
|
|
1884
|
+
if (text.length <= maxChars) return text;
|
|
1885
|
+
let start = text.length - maxChars;
|
|
1886
|
+
if (text[start - 1] !== "\n") {
|
|
1887
|
+
const lineEnd = text.indexOf("\n", start);
|
|
1888
|
+
if (lineEnd !== -1 && lineEnd < text.length - 1) return text.slice(lineEnd + 1);
|
|
1889
|
+
const code = text.charCodeAt(start);
|
|
1890
|
+
if (code >= 56320 && code <= 57343) start += 1;
|
|
1891
|
+
for (const marker of REDACTION_MARKERS) {
|
|
1892
|
+
const at = text.lastIndexOf(marker, start);
|
|
1893
|
+
if (at !== -1 && at < start && start < at + marker.length) start = at + marker.length;
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
return text.slice(start);
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
// ../../packages/ycodium-acp-executor/src/errors.ts
|
|
1900
|
+
var AcpExecutorError = class extends Error {
|
|
1901
|
+
code;
|
|
1902
|
+
constructor(code, message) {
|
|
1903
|
+
super(message);
|
|
1904
|
+
this.name = "AcpExecutorError";
|
|
1905
|
+
this.code = code;
|
|
1906
|
+
}
|
|
1907
|
+
};
|
|
1908
|
+
var AcpExecutorDisposedError = class extends AcpExecutorError {
|
|
1909
|
+
constructor(message = "ACP executor has been disposed") {
|
|
1910
|
+
super("disposed", message);
|
|
1911
|
+
this.name = "AcpExecutorDisposedError";
|
|
1912
|
+
}
|
|
1913
|
+
};
|
|
1914
|
+
var AcpExecutorTurnEndedError = class extends AcpExecutorError {
|
|
1915
|
+
constructor(message = "The target turn has ended. The message was not sent.") {
|
|
1916
|
+
super("provider-rejected", message);
|
|
1917
|
+
this.name = "AcpExecutorTurnEndedError";
|
|
1918
|
+
}
|
|
1919
|
+
};
|
|
1920
|
+
var AcpExecutorOptionRejectedError = class extends AcpExecutorError {
|
|
1921
|
+
constructor(option, value, cause) {
|
|
1922
|
+
const detail = acpErrorDetail(cause);
|
|
1923
|
+
super(
|
|
1924
|
+
"provider-rejected",
|
|
1925
|
+
`The agent rejected the ${option}${value === void 0 ? "" : ` "${value}"`}${detail === void 0 ? "" : ` (${detail})`}. This turn was not sent.`
|
|
1926
|
+
);
|
|
1927
|
+
this.name = "AcpExecutorOptionRejectedError";
|
|
1928
|
+
}
|
|
1929
|
+
};
|
|
1930
|
+
var AcpExecutorOptionTimeoutError = class extends AcpExecutorError {
|
|
1931
|
+
constructor(option, value) {
|
|
1932
|
+
super(
|
|
1933
|
+
"provider-rejected",
|
|
1934
|
+
`The agent did not answer the ${option} "${value}" change in time. This turn was not sent.`
|
|
1935
|
+
);
|
|
1936
|
+
this.name = "AcpExecutorOptionTimeoutError";
|
|
1937
|
+
}
|
|
1938
|
+
};
|
|
1939
|
+
var AcpOptionWriteStoppedError = class extends Error {
|
|
1940
|
+
constructor() {
|
|
1941
|
+
super("option write stopped");
|
|
1942
|
+
this.name = "AcpOptionWriteStoppedError";
|
|
1943
|
+
}
|
|
1944
|
+
};
|
|
1945
|
+
function acpErrorDetail(cause) {
|
|
1946
|
+
if (typeof cause !== "object" || cause === null) return void 0;
|
|
1947
|
+
const message = cause.message;
|
|
1948
|
+
const data = cause.data;
|
|
1949
|
+
const parts = [message, data].filter(
|
|
1950
|
+
(part) => typeof part === "string" && part.trim().length > 0
|
|
1951
|
+
);
|
|
1952
|
+
return parts.length === 0 ? void 0 : parts.join(": ");
|
|
1953
|
+
}
|
|
1954
|
+
var AcpExecutorNotStartedError = class extends AcpExecutorError {
|
|
1955
|
+
constructor(message = "ACP session has not been started") {
|
|
1956
|
+
super("not-started", message);
|
|
1957
|
+
this.name = "AcpExecutorNotStartedError";
|
|
1958
|
+
}
|
|
1959
|
+
};
|
|
1960
|
+
var AcpExecutorCancelTimeoutError = class extends AcpExecutorError {
|
|
1961
|
+
constructor(message = "Timed out waiting for session/prompt to finish after cancellation") {
|
|
1962
|
+
super("cancel-timeout", message);
|
|
1963
|
+
this.name = "AcpExecutorCancelTimeoutError";
|
|
1964
|
+
}
|
|
1965
|
+
};
|
|
1966
|
+
var AcpExecutorRequestError = class extends AcpExecutorError {
|
|
1967
|
+
method;
|
|
1968
|
+
constructor(method, message) {
|
|
1969
|
+
super("request-failed", message);
|
|
1970
|
+
this.name = "AcpExecutorRequestError";
|
|
1971
|
+
this.method = method;
|
|
1972
|
+
}
|
|
1973
|
+
};
|
|
1974
|
+
var AcpConnectionClosedError = class extends Error {
|
|
1975
|
+
reason;
|
|
1976
|
+
constructor(message = "ACP connection closed", options2) {
|
|
1977
|
+
super(message, options2?.cause === void 0 ? void 0 : { cause: options2.cause });
|
|
1978
|
+
this.name = "AcpConnectionClosedError";
|
|
1979
|
+
this.reason = options2?.reason ?? "closed";
|
|
1980
|
+
}
|
|
1981
|
+
};
|
|
1982
|
+
async function withStartupStderr(error62, stderrTail) {
|
|
1983
|
+
if (!(error62 instanceof AcpConnectionClosedError) || stderrTail === void 0) return error62;
|
|
1984
|
+
const tail = await stderrTail();
|
|
1985
|
+
if (tail.length === 0) return error62;
|
|
1986
|
+
return new AcpConnectionClosedError(`${error62.message}
|
|
1987
|
+
Agent stderr (last lines):
|
|
1988
|
+
${tail}`, {
|
|
1989
|
+
cause: error62,
|
|
1990
|
+
reason: error62.reason
|
|
1991
|
+
});
|
|
1992
|
+
}
|
|
1993
|
+
var AGENT_EXIT_STDERR_MAX_CHARS = 800;
|
|
1994
|
+
var AGENT_EXIT_SETTLE_MS = 500;
|
|
1995
|
+
var AcpAgentExitedError = class extends AcpConnectionClosedError {
|
|
1996
|
+
exitCode;
|
|
1997
|
+
constructor(message, exitCode, cause) {
|
|
1998
|
+
super(message, { cause, reason: "input-ended" });
|
|
1999
|
+
this.name = "AcpAgentExitedError";
|
|
2000
|
+
this.exitCode = exitCode;
|
|
2001
|
+
}
|
|
2002
|
+
};
|
|
2003
|
+
var settledExitCode = async (exited) => {
|
|
2004
|
+
if (exited === void 0) return void 0;
|
|
2005
|
+
let timer;
|
|
2006
|
+
try {
|
|
2007
|
+
return await Promise.race([
|
|
2008
|
+
exited.catch(() => void 0),
|
|
2009
|
+
new Promise((resolve7) => {
|
|
2010
|
+
timer = setTimeout(() => resolve7(void 0), AGENT_EXIT_SETTLE_MS);
|
|
2011
|
+
})
|
|
2012
|
+
]);
|
|
2013
|
+
} finally {
|
|
2014
|
+
clearTimeout(timer);
|
|
2015
|
+
}
|
|
2016
|
+
};
|
|
2017
|
+
async function describeAgentExit(input2) {
|
|
2018
|
+
const [exitCode, tail] = await Promise.all([
|
|
2019
|
+
settledExitCode(input2.exited),
|
|
2020
|
+
input2.stderrTail === void 0 ? "" : Promise.resolve().then(input2.stderrTail).catch(() => "")
|
|
2021
|
+
]);
|
|
2022
|
+
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}.`;
|
|
2023
|
+
const excerpt = lastStderrTail(tail.trim(), AGENT_EXIT_STDERR_MAX_CHARS);
|
|
2024
|
+
return new AcpAgentExitedError(
|
|
2025
|
+
excerpt.length === 0 ? head : `${head}
|
|
2026
|
+
Agent stderr (last lines):
|
|
2027
|
+
${excerpt}`,
|
|
2028
|
+
exitCode,
|
|
2029
|
+
input2.cause
|
|
2030
|
+
);
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
2033
|
// ../../packages/ycodium-acp-executor/src/util.ts
|
|
2034
2034
|
function isRecord2(value) {
|
|
2035
2035
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
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.5271",
|
|
4
4
|
"description": "Google Antigravity executor: runs the Antigravity agent over Agent Client Protocol stdio.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"typescript": "~6.0.3",
|
|
32
32
|
"vite-plus": "0.2.2",
|
|
33
33
|
"yauzl": "^3.4.0",
|
|
34
|
-
"ycodium-
|
|
35
|
-
"@ycodium-ai/plugin-api": "0.2.5265",
|
|
36
|
-
"ycodium-acp-executor": "0.2.0",
|
|
34
|
+
"@ycodium-ai/plugin-api": "0.2.0",
|
|
37
35
|
"ycodium-react-test-harness": "0.0.0",
|
|
38
36
|
"ycodium-executor-testing": "0.0.0",
|
|
39
|
-
"ycodium-text-generation": "0.0.0"
|
|
37
|
+
"ycodium-text-generation": "0.0.0",
|
|
38
|
+
"ycodium-acp-executor": "0.2.5271",
|
|
39
|
+
"ycodium-instance-config": "0.0.0"
|
|
40
40
|
},
|
|
41
41
|
"ycodium": {
|
|
42
42
|
"plugin": "./dist/index.js",
|