@simonepri/refined-antigravity-acp 1.0.0 → 1.1.0
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/cli.d.ts.map +1 -1
- package/dist/src/cli.js +61 -27
- package/dist/src/cli.js.map +1 -1
- package/dist/src/fixes/index.d.ts +1 -0
- package/dist/src/fixes/index.d.ts.map +1 -1
- package/dist/src/fixes/index.js +3 -0
- package/dist/src/fixes/index.js.map +1 -1
- package/dist/src/fixes/premature-turn-stop/index.d.ts +16 -0
- package/dist/src/fixes/premature-turn-stop/index.d.ts.map +1 -0
- package/dist/src/fixes/premature-turn-stop/index.js +118 -0
- package/dist/src/fixes/premature-turn-stop/index.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/setup.d.ts +9 -0
- package/dist/src/setup.d.ts.map +1 -0
- package/dist/src/setup.js +131 -0
- package/dist/src/setup.js.map +1 -0
- package/package.json +20 -2
- package/readme.md +87 -8
package/dist/src/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AA8DA,wBAAsB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAqB5C"}
|
package/dist/src/cli.js
CHANGED
|
@@ -1,44 +1,78 @@
|
|
|
1
1
|
import readline from "node:readline";
|
|
2
2
|
import { createAntigravityConnector } from "./index.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
process.stdout.write(JSON.stringify(value) + "\n");
|
|
3
|
+
import { runSetup } from "./setup.js";
|
|
4
|
+
async function handleCliArgs(args) {
|
|
5
|
+
const firstArg = args[0]?.toLowerCase();
|
|
6
|
+
if (firstArg === "setup") {
|
|
7
|
+
const target = args[1]?.toLowerCase();
|
|
8
|
+
if (target === "paseo" || args.includes("--paseo")) {
|
|
9
|
+
await runSetup("paseo");
|
|
11
10
|
}
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
else if (target === "zed" || args.includes("--zed")) {
|
|
12
|
+
await runSetup("zed");
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
await runSetup("all");
|
|
16
|
+
}
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
20
|
+
console.log(`Refined Antigravity ACP - Hardened wrapper around Google's official Antigravity ACP binary.
|
|
21
|
+
|
|
22
|
+
Usage:
|
|
23
|
+
refined-antigravity-acp Start ACP server over stdio
|
|
24
|
+
refined-antigravity-acp setup Configure both Paseo and Zed
|
|
25
|
+
refined-antigravity-acp setup paseo Configure Paseo (~/.paseo/config.json)
|
|
26
|
+
refined-antigravity-acp setup zed Configure Zed Editor (settings.json)
|
|
27
|
+
`);
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
async function pipeStdinToWriter(writer) {
|
|
14
33
|
const rl = readline.createInterface({
|
|
15
34
|
input: process.stdin,
|
|
16
35
|
terminal: false,
|
|
17
36
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
continue;
|
|
24
|
-
try {
|
|
25
|
-
const msg = JSON.parse(trimmed);
|
|
26
|
-
await writer.write(msg);
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
// Drop malformed input line or forward error
|
|
30
|
-
}
|
|
37
|
+
try {
|
|
38
|
+
for await (const line of rl) {
|
|
39
|
+
const trimmed = line.trim();
|
|
40
|
+
if (!trimmed) {
|
|
41
|
+
continue;
|
|
31
42
|
}
|
|
32
|
-
}
|
|
33
|
-
finally {
|
|
34
43
|
try {
|
|
35
|
-
|
|
44
|
+
const msg = JSON.parse(trimmed);
|
|
45
|
+
await writer.write(msg);
|
|
36
46
|
}
|
|
37
47
|
catch {
|
|
38
|
-
//
|
|
48
|
+
// Drop malformed input line or forward error
|
|
39
49
|
}
|
|
40
50
|
}
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
try {
|
|
54
|
+
await writer.close();
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
// Writer may already be closed
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export async function runCli() {
|
|
62
|
+
const args = process.argv.slice(2);
|
|
63
|
+
if (await handleCliArgs(args)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const connector = createAntigravityConnector();
|
|
67
|
+
const stream = await connector();
|
|
68
|
+
process.on("SIGINT", () => process.exit(0));
|
|
69
|
+
process.on("SIGTERM", () => process.exit(0));
|
|
70
|
+
const writeStdout = (async () => {
|
|
71
|
+
for await (const value of stream.readable) {
|
|
72
|
+
process.stdout.write(JSON.stringify(value) + "\n");
|
|
73
|
+
}
|
|
41
74
|
})();
|
|
75
|
+
const readStdin = pipeStdinToWriter(stream.writable.getWriter());
|
|
42
76
|
await Promise.all([writeStdout, readStdin]);
|
|
43
77
|
}
|
|
44
78
|
//# sourceMappingURL=cli.js.map
|
package/dist/src/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,M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C,SAAS,EAAE,CAAC,CAAC;IAEjE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -16,6 +16,7 @@ export * from "./cancellation-leak/index.js";
|
|
|
16
16
|
export * from "./missing-usage-metrics/index.js";
|
|
17
17
|
export * from "./dangling-tool-calls/index.js";
|
|
18
18
|
export * from "./missing-question-fallback/index.js";
|
|
19
|
+
export * from "./premature-turn-stop/index.js";
|
|
19
20
|
/**
|
|
20
21
|
* Returns a list of all active fixes addressing the upstream issues documented in readme.md.
|
|
21
22
|
* As upstream releases fix these defects, retirement is as simple as removing the fix here
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fixes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/fixes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAoB/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC;AAE/C;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAqB7C"}
|
package/dist/src/fixes/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import { cancellationLeakFix } from "./cancellation-leak/index.js";
|
|
|
15
15
|
import { missingUsageMetricsFix } from "./missing-usage-metrics/index.js";
|
|
16
16
|
import { danglingToolCallsFix } from "./dangling-tool-calls/index.js";
|
|
17
17
|
import { missingQuestionFallbackFix } from "./missing-question-fallback/index.js";
|
|
18
|
+
import { prematureTurnStopFix } from "./premature-turn-stop/index.js";
|
|
18
19
|
export * from "./missing-localharness/index.js";
|
|
19
20
|
export * from "./missing-system-prompt/index.js";
|
|
20
21
|
export * from "./missing-slash-skills/index.js";
|
|
@@ -32,6 +33,7 @@ export * from "./cancellation-leak/index.js";
|
|
|
32
33
|
export * from "./missing-usage-metrics/index.js";
|
|
33
34
|
export * from "./dangling-tool-calls/index.js";
|
|
34
35
|
export * from "./missing-question-fallback/index.js";
|
|
36
|
+
export * from "./premature-turn-stop/index.js";
|
|
35
37
|
/**
|
|
36
38
|
* Returns a list of all active fixes addressing the upstream issues documented in readme.md.
|
|
37
39
|
* As upstream releases fix these defects, retirement is as simple as removing the fix here
|
|
@@ -56,6 +58,7 @@ export function createDefaultFixes() {
|
|
|
56
58
|
nonCanonicalModeIdsFix,
|
|
57
59
|
missingUsageMetricsFix,
|
|
58
60
|
missingQuestionFallbackFix,
|
|
61
|
+
prematureTurnStopFix,
|
|
59
62
|
];
|
|
60
63
|
}
|
|
61
64
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fixes/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,0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kB;QAClB,wBAAwB;QACxB,sBAAsB;QACtB,sBAAsB;QACtB,0BAA0B;QAC1B,oBAAoB;KACrB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Problem:
|
|
3
|
+
* When upstream Antigravity executes tool calls (or receives a prompt) and halts with an empty
|
|
4
|
+
* completion (stopReason=16, no text and no tool call), upstream completes the prompt turn
|
|
5
|
+
* with a successful result without emitting any `agent_message_chunk`. Editor clients (Paseo, Zed)
|
|
6
|
+
* transition the session to idle, leaving the user with zero explanation and an apparent hang.
|
|
7
|
+
*
|
|
8
|
+
* Solution:
|
|
9
|
+
* Tracks prompt turn state and delivered assistant message chunks. When upstream returns a prompt
|
|
10
|
+
* completion without any assistant message chunks, synthesizes a status message explaining the
|
|
11
|
+
* executed actions or prompting continuation before delivering the prompt result.
|
|
12
|
+
*/
|
|
13
|
+
import { type AcpFix } from "../../core/types.js";
|
|
14
|
+
export declare function createPrematureTurnStopFix(): AcpFix;
|
|
15
|
+
export declare const prematureTurnStopFix: AcpFix;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/fixes/premature-turn-stop/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAIL,KAAK,MAAM,EAIZ,MAAM,qBAAqB,CAAC;AA+G7B,wBAAgB,0BAA0B,IAAI,MAAM,CAiCnD;AAED,eAAO,MAAM,oBAAoB,QAA+B,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Problem:
|
|
3
|
+
* When upstream Antigravity executes tool calls (or receives a prompt) and halts with an empty
|
|
4
|
+
* completion (stopReason=16, no text and no tool call), upstream completes the prompt turn
|
|
5
|
+
* with a successful result without emitting any `agent_message_chunk`. Editor clients (Paseo, Zed)
|
|
6
|
+
* transition the session to idle, leaving the user with zero explanation and an apparent hang.
|
|
7
|
+
*
|
|
8
|
+
* Solution:
|
|
9
|
+
* Tracks prompt turn state and delivered assistant message chunks. When upstream returns a prompt
|
|
10
|
+
* completion without any assistant message chunks, synthesizes a status message explaining the
|
|
11
|
+
* executed actions or prompting continuation before delivering the prompt result.
|
|
12
|
+
*/
|
|
13
|
+
import { ACP_METHODS, SESSION_UPDATES, isJsonRpcRequest, } from "../../core/types.js";
|
|
14
|
+
import { extractSessionId } from "../../core/session-cache.js";
|
|
15
|
+
function recordOutboundPrompt(msg, activeTurns, sessionTurnMap) {
|
|
16
|
+
if (!isJsonRpcRequest(msg) || !("id" in msg) || msg.id === null || msg.id === undefined) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const sessionId = extractSessionId(msg);
|
|
20
|
+
if (!sessionId) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const state = {
|
|
24
|
+
promptId: msg.id,
|
|
25
|
+
sessionId,
|
|
26
|
+
hasAssistantMessage: false,
|
|
27
|
+
toolActionsCount: 0,
|
|
28
|
+
};
|
|
29
|
+
activeTurns.set(msg.id, state);
|
|
30
|
+
sessionTurnMap.set(sessionId, state);
|
|
31
|
+
}
|
|
32
|
+
function processTurnUpdate(state, updateType, title) {
|
|
33
|
+
if (updateType === SESSION_UPDATES.AGENT_MESSAGE_CHUNK) {
|
|
34
|
+
state.hasAssistantMessage = true;
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (updateType === SESSION_UPDATES.TOOL_CALL || updateType === SESSION_UPDATES.TOOL_CALL_UPDATE) {
|
|
38
|
+
state.toolActionsCount++;
|
|
39
|
+
if (title) {
|
|
40
|
+
state.lastToolTitle = title;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function recordInboundUpdate(msg, sessionTurnMap) {
|
|
45
|
+
if (!("params" in msg) || !msg.params) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const params = msg.params;
|
|
49
|
+
const state = params.sessionId ? sessionTurnMap.get(params.sessionId) : undefined;
|
|
50
|
+
if (!state) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
processTurnUpdate(state, params.update?.sessionUpdate, params.update?.title);
|
|
54
|
+
}
|
|
55
|
+
function synthesizeExplanation(state) {
|
|
56
|
+
const toolSuffix = state.lastToolTitle ? ` (last action: ${state.lastToolTitle})` : "";
|
|
57
|
+
const text = state.toolActionsCount > 0
|
|
58
|
+
? `Completed actions (${state.toolActionsCount} operations executed)${toolSuffix}. Please let me know how you would like to proceed.`
|
|
59
|
+
: "Received your message. How can I help you proceed?";
|
|
60
|
+
return {
|
|
61
|
+
jsonrpc: "2.0",
|
|
62
|
+
method: ACP_METHODS.SESSION_UPDATE,
|
|
63
|
+
params: {
|
|
64
|
+
sessionId: state.sessionId,
|
|
65
|
+
update: {
|
|
66
|
+
sessionUpdate: SESSION_UPDATES.AGENT_MESSAGE_CHUNK,
|
|
67
|
+
content: { type: "text", text },
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function resolveInboundResult(msg, activeTurns, sessionTurnMap) {
|
|
73
|
+
if (!("result" in msg) || !("id" in msg) || msg.id === null || msg.id === undefined) {
|
|
74
|
+
return [msg];
|
|
75
|
+
}
|
|
76
|
+
const state = activeTurns.get(msg.id);
|
|
77
|
+
if (!state) {
|
|
78
|
+
return [msg];
|
|
79
|
+
}
|
|
80
|
+
activeTurns.delete(msg.id);
|
|
81
|
+
sessionTurnMap.delete(state.sessionId);
|
|
82
|
+
if (state.hasAssistantMessage) {
|
|
83
|
+
return [msg];
|
|
84
|
+
}
|
|
85
|
+
return [synthesizeExplanation(state), msg];
|
|
86
|
+
}
|
|
87
|
+
export function createPrematureTurnStopFix() {
|
|
88
|
+
const activeTurns = new Map();
|
|
89
|
+
const sessionTurnMap = new Map();
|
|
90
|
+
return {
|
|
91
|
+
name: "premature-turn-stop",
|
|
92
|
+
description: "Detects and recovers from premature empty turn stops without assistant messages",
|
|
93
|
+
getSystemInstructions() {
|
|
94
|
+
return [
|
|
95
|
+
"Never end a prompt turn without emitting a clear assistant text message summarizing completed actions, current status, or next steps.",
|
|
96
|
+
"When executing commit commands, linter checks, or tests that encounter errors, explicitly explain the failures to the user before attempting further autonomous repairs.",
|
|
97
|
+
];
|
|
98
|
+
},
|
|
99
|
+
onOutbound(msg, _context) {
|
|
100
|
+
if ("method" in msg && msg.method === ACP_METHODS.SESSION_PROMPT) {
|
|
101
|
+
recordOutboundPrompt(msg, activeTurns, sessionTurnMap);
|
|
102
|
+
}
|
|
103
|
+
return msg;
|
|
104
|
+
},
|
|
105
|
+
async onInbound(msg, _context) {
|
|
106
|
+
if ("method" in msg && msg.method === ACP_METHODS.SESSION_UPDATE) {
|
|
107
|
+
recordInboundUpdate(msg, sessionTurnMap);
|
|
108
|
+
return [msg];
|
|
109
|
+
}
|
|
110
|
+
if ("result" in msg) {
|
|
111
|
+
return resolveInboundResult(msg, activeTurns, sessionTurnMap);
|
|
112
|
+
}
|
|
113
|
+
return [msg];
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export const prematureTurnStopFix = createPrematureTurnStopFix();
|
|
118
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/fixes/premature-turn-stop/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,WAAW,EACX,eAAe,EACf,gBAAgB,GAKjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAkB/D,SAAS,oBAAoB,CAC3B,GAAqB,EACrB,WAA4C,EAC5C,cAAsC;IAEtC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,I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AAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,EAAE,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./core/transport.js";
|
|
|
8
8
|
export * from "./core/pipeline.js";
|
|
9
9
|
export * from "./core/supervisor.js";
|
|
10
10
|
export * from "./core/command.js";
|
|
11
|
+
export * from "./setup.js";
|
|
11
12
|
export declare const PROMPT_RETRY_DELAY_MS = 500;
|
|
12
13
|
export interface AntigravityConnectorOptions {
|
|
13
14
|
spawnProcess?: (cmd: string, args: string[]) => ChildProcess | Promise<ChildProcess>;
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAa,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAWjF,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,sCAAsC,CAAC;AAG7F,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAa,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAWjF,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,sCAAsC,CAAC;AAG7F,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAE3B,eAAO,MAAM,qBAAqB,MAAgC,CAAC;AAEnE,MAAM,WAAW,2BAA2B;IAC1C,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACrF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sFAAsF;IACtF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,6CAA6C;IAC7C,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,YAAiC,EAC1C,OAAO,CAAC,EAAE,2BAA2B,GACpC,YAAY,CAqBd;AAED,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export * from "./core/transport.js";
|
|
|
15
15
|
export * from "./core/pipeline.js";
|
|
16
16
|
export * from "./core/supervisor.js";
|
|
17
17
|
export * from "./core/command.js";
|
|
18
|
+
export * from "./setup.js";
|
|
18
19
|
export const PROMPT_RETRY_DELAY_MS = DEFAULT_PROMPT_RETRY_DELAY_MS;
|
|
19
20
|
/**
|
|
20
21
|
* Creates an in-process ACP connector stream that launches the official `agy_acp_server` binary,
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,sCAAsC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAA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AM,UAAU,0BAA0B,CACxC,UAAwB,kBAAkB,EAC1C,OAAqC;IAErC,OAAO,KAAK,IAAwB,EAAE;QACpC,MAAM,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,MAAM,oBAAoB,EAAE,CAAC;QAEpD,MAAM,OAAO,GAAG,OAAO,EAAE,YAAY,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/E,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAE9C,MAAM,UAAU,GAAG,IAAI,iBAAiB,CAAC;YACvC,GAAG;YACH,IAAI;YACJ,YAAY;YACZ,QAAQ,EAAE,IAAI,WAAW,CAAC,kBAAkB,EAAE,CAAC;YAC/C,OAAO;YACP,YAAY,EAAE,OAAO,EAAE,YAAY;YACnC,gBAAgB,EAAE,OAAO,EAAE,gBAAgB;YAC3C,oBAAoB,EAAE,OAAO,EAAE,oBAAoB;YACnD,mBAAmB,EAAE,OAAO,EAAE,mBAAmB;SAClD,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC,aAAa,EAAE,CAAC;IACpC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface ResolvedPaths {
|
|
2
|
+
nodePath: string;
|
|
3
|
+
cliPath?: string | undefined;
|
|
4
|
+
}
|
|
5
|
+
export declare function resolvePaths(): ResolvedPaths;
|
|
6
|
+
export declare function setupPaseo(paths?: ResolvedPaths, restartDaemon?: boolean): boolean;
|
|
7
|
+
export declare function setupZed(paths?: ResolvedPaths): boolean;
|
|
8
|
+
export declare function runSetup(target?: "all" | "paseo" | "zed"): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/setup.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,wBAAgB,YAAY,IAAI,aAAa,CAyB5C;AAoCD,wBAAgB,UAAU,CAAC,KAAK,GAAE,aAA8B,EAAE,aAAa,UAAO,GAAG,OAAO,CAgC/F;AAkBD,wBAAgB,QAAQ,CAAC,KAAK,GAAE,aAA8B,GAAG,OAAO,CAwBvE;AAED,wBAAsB,QAAQ,CAAC,MAAM,GAAE,KAAK,GAAG,OAAO,GAAG,KAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAWrF"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import { execFileSync, execSync } from "node:child_process";
|
|
5
|
+
export function resolvePaths() {
|
|
6
|
+
const nodePath = process.execPath;
|
|
7
|
+
let cliPath;
|
|
8
|
+
// 1. Check if process.argv[1] is an actual existing file
|
|
9
|
+
const scriptArg = process.argv[1];
|
|
10
|
+
if (scriptArg && fs.existsSync(scriptArg)) {
|
|
11
|
+
try {
|
|
12
|
+
cliPath = fs.realpathSync(scriptArg);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
cliPath = scriptArg;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
// 2. Check which refined-antigravity-acp
|
|
19
|
+
if (!cliPath) {
|
|
20
|
+
try {
|
|
21
|
+
const found = execSync("which refined-antigravity-acp", { encoding: "utf8" }).trim();
|
|
22
|
+
if (found && fs.existsSync(found)) {
|
|
23
|
+
cliPath = fs.realpathSync(found);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
catch { }
|
|
27
|
+
}
|
|
28
|
+
return { nodePath, cliPath };
|
|
29
|
+
}
|
|
30
|
+
function parseJsonWithComments(content) {
|
|
31
|
+
const stripped = content.replace(/\/\/.*$/gm, "").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
32
|
+
try {
|
|
33
|
+
return JSON.parse(stripped);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return {};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function readJsonFile(filePath) {
|
|
40
|
+
if (!fs.existsSync(filePath)) {
|
|
41
|
+
return {};
|
|
42
|
+
}
|
|
43
|
+
return parseJsonWithComments(fs.readFileSync(filePath, "utf8"));
|
|
44
|
+
}
|
|
45
|
+
function writeJsonFile(filePath, data) {
|
|
46
|
+
fs.writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n", "utf8");
|
|
47
|
+
}
|
|
48
|
+
function getNestedRecord(obj, key) {
|
|
49
|
+
const val = obj[key];
|
|
50
|
+
return (val && typeof val === "object" ? val : {});
|
|
51
|
+
}
|
|
52
|
+
function tryRestartPaseoDaemon() {
|
|
53
|
+
try {
|
|
54
|
+
execFileSync("paseo", ["daemon", "restart"], { stdio: "ignore" });
|
|
55
|
+
console.log("✓ Restarted Paseo daemon");
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
// Paseo daemon may not be active or paseo CLI not in PATH
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export function setupPaseo(paths = resolvePaths(), restartDaemon = true) {
|
|
62
|
+
const paseoDir = path.join(os.homedir(), ".paseo");
|
|
63
|
+
const configPath = path.join(paseoDir, "config.json");
|
|
64
|
+
fs.mkdirSync(paseoDir, { recursive: true });
|
|
65
|
+
const config = readJsonFile(configPath);
|
|
66
|
+
const agents = getNestedRecord(config, "agents");
|
|
67
|
+
const providers = getNestedRecord(agents, "providers");
|
|
68
|
+
const command = paths.cliPath
|
|
69
|
+
? [paths.nodePath, paths.cliPath]
|
|
70
|
+
: ["pnpm", "dlx", "@simonepri/refined-antigravity-acp"];
|
|
71
|
+
providers["refined-antigravity-acp"] = {
|
|
72
|
+
extends: "acp",
|
|
73
|
+
label: "Antigravity",
|
|
74
|
+
command,
|
|
75
|
+
enabled: true,
|
|
76
|
+
};
|
|
77
|
+
agents.providers = providers;
|
|
78
|
+
config.agents = agents;
|
|
79
|
+
writeJsonFile(configPath, config);
|
|
80
|
+
console.log(`✓ Configured Paseo provider in ${configPath}`);
|
|
81
|
+
if (restartDaemon) {
|
|
82
|
+
tryRestartPaseoDaemon();
|
|
83
|
+
}
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
function resolveZedDir() {
|
|
87
|
+
const homeDir = os.homedir();
|
|
88
|
+
const macDir = path.join(homeDir, "Library", "Application Support", "Zed");
|
|
89
|
+
const linuxDir = path.join(homeDir, ".config", "zed");
|
|
90
|
+
const zedDirs = [macDir, linuxDir];
|
|
91
|
+
const found = zedDirs.find((d) => fs.existsSync(d));
|
|
92
|
+
if (found) {
|
|
93
|
+
return found;
|
|
94
|
+
}
|
|
95
|
+
const defaultDir = process.platform === "darwin" ? macDir : linuxDir;
|
|
96
|
+
fs.mkdirSync(defaultDir, { recursive: true });
|
|
97
|
+
return defaultDir;
|
|
98
|
+
}
|
|
99
|
+
export function setupZed(paths = resolvePaths()) {
|
|
100
|
+
const targetDir = resolveZedDir();
|
|
101
|
+
const settingsPath = path.join(targetDir, "settings.json");
|
|
102
|
+
const settings = readJsonFile(settingsPath);
|
|
103
|
+
const agent = getNestedRecord(settings, "agent");
|
|
104
|
+
const profiles = getNestedRecord(agent, "profiles");
|
|
105
|
+
const command = paths.cliPath ? paths.nodePath : "pnpm";
|
|
106
|
+
const args = paths.cliPath ? [paths.cliPath] : ["dlx", "@simonepri/refined-antigravity-acp"];
|
|
107
|
+
profiles.antigravity = {
|
|
108
|
+
type: "acp",
|
|
109
|
+
command,
|
|
110
|
+
args,
|
|
111
|
+
};
|
|
112
|
+
agent.profiles = profiles;
|
|
113
|
+
settings.agent = agent;
|
|
114
|
+
writeJsonFile(settingsPath, settings);
|
|
115
|
+
console.log(`✓ Configured Zed profile in ${settingsPath}`);
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
export async function runSetup(target = "all") {
|
|
119
|
+
const paths = resolvePaths();
|
|
120
|
+
if (target === "paseo") {
|
|
121
|
+
setupPaseo(paths);
|
|
122
|
+
}
|
|
123
|
+
else if (target === "zed") {
|
|
124
|
+
setupZed(paths);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
setupPaseo(paths);
|
|
128
|
+
setupZed(paths);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAO5D,MAAM,UAAU,YAAY;IAC1B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,IAAI,OAA2B,CAAC;IAEhC,yDAAyD;IACzD,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClC,IAAI,SAAS,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1C,IAAI,CAAC;YACH,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;QACvC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,GAAG,SAAS,CAAC;QACtB,CAAC;IACH,CAAC;IAED,yCAAyC;IACzC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,QAAQ,CAAC,+BAA+B,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YACrF,IAAI,KAAK,IAAI,EAAE,CAA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E,UAAU,CAAC,CAAC;IAEpD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;IACxD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,oCAAoC,CAAC,CAAC;IAE7F,QAAQ,CAAC,WAAW,GAAG;QACrB,IAAI,EAAE,KAAK;QACX,OAAO;QACP,IAAI;KACL,CAAC;IAEF,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1B,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;IAEvB,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IACtC,OAAO,CAAC,GAAG,CAAC,+BAA+B,YAAY,EAAE,CAAC,CAAC;IAE3D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,SAAkC,KAAK;IACpE,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;IAE7B,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACvB,UAAU,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;SAAM,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;QAC5B,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;SAAM,CAAC;QACN,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonepri/refined-antigravity-acp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A hardened wrapper around Google's official Antigravity ACP binary.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"acp",
|
|
7
|
+
"acp-protocol",
|
|
8
|
+
"agent-client-protocol",
|
|
9
|
+
"agy",
|
|
10
|
+
"agy-acp",
|
|
11
|
+
"agy-proxy",
|
|
12
|
+
"antigravity",
|
|
13
|
+
"antigravity-acp",
|
|
14
|
+
"antigravity-ai",
|
|
15
|
+
"gemini",
|
|
16
|
+
"google-antigravity",
|
|
17
|
+
"mcp",
|
|
18
|
+
"paseo",
|
|
19
|
+
"provider",
|
|
20
|
+
"refined",
|
|
21
|
+
"zed"
|
|
22
|
+
],
|
|
5
23
|
"homepage": "https://github.com/simonepri/refined-antigravity-acp#readme",
|
|
6
24
|
"bugs": {
|
|
7
25
|
"url": "https://github.com/simonepri/refined-antigravity-acp/issues"
|
|
@@ -38,7 +56,7 @@
|
|
|
38
56
|
"typecheck": "tsc --noEmit",
|
|
39
57
|
"lint": "oxlint",
|
|
40
58
|
"lint:json": "node bin/lint-json.mjs",
|
|
41
|
-
"lint:pub": "publint --strict",
|
|
59
|
+
"lint:pub": "pnpm run build && publint --strict",
|
|
42
60
|
"lint:md": "mmdlint readme.md",
|
|
43
61
|
"lint:actions": "actionlint",
|
|
44
62
|
"lint:yaml": "yamllint .github/workflows/",
|
package/readme.md
CHANGED
|
@@ -44,6 +44,9 @@
|
|
|
44
44
|
</a>
|
|
45
45
|
<br>
|
|
46
46
|
<!-- Distribution -->
|
|
47
|
+
<a href="https://www.npmjs.com/package/@simonepri/refined-antigravity-acp">
|
|
48
|
+
<img src="https://img.shields.io/npm/v/@simonepri/refined-antigravity-acp?logo=npm&logoColor=white" alt="npm version">
|
|
49
|
+
</a>
|
|
47
50
|
<a href="https://github.com/simonepri/refined-antigravity-acp/stargazers">
|
|
48
51
|
<img src="https://img.shields.io/github/stars/simonepri/refined-antigravity-acp?style=flat&logo=github&logoColor=white" alt="GitHub stars">
|
|
49
52
|
</a>
|
|
@@ -66,7 +69,7 @@
|
|
|
66
69
|
|
|
67
70
|
## Overview
|
|
68
71
|
|
|
69
|
-
**Refined Antigravity ACP** is a proxy wrapper around Google's official Antigravity ACP binary (
|
|
72
|
+
**Refined Antigravity ACP** is a proxy wrapper around Google's official Antigravity ACP binary (`agy_acp_server.par`).
|
|
70
73
|
|
|
71
74
|
Google's binary executes models, agent loops, and tool calls. This proxy intercepts the ACP stream between editor and server to fix upstream crashes and deadlocks, normalize MCP traffic, and integrate with **Paseo**, **Zed**, and other ACP clients.
|
|
72
75
|
|
|
@@ -156,23 +159,76 @@ The matrix below documents upstream defects across process startup, turn executi
|
|
|
156
159
|
| [**Missing Usage & Token Metrics**](src/fixes/missing-usage-metrics/index.ts) | **Problem**: Upstream binary never emits ACP `usage_update` notifications, leaving editor context window meters blank.<br>🔗 [`problem: missing usage metrics`](src/fixes/missing-usage-metrics/index.e2e.test.ts#L14) | Intercepts SQLite step metadata to extract token counts and emits standard ACP `sessionUpdate: "usage_update"` with `usedTokens` and `maxTokens`.<br>🔗 [`solution: token usage synthesis`](src/fixes/missing-usage-metrics/index.e2e.test.ts#L35) |
|
|
157
160
|
| [**Dangling Running Tool Calls**](src/fixes/dangling-tool-calls/index.ts) | **Problem**: When commands are backgrounded, upstream never emits terminal `tool_call_update` with `status: "completed"`, leaving editor UIs with an infinite active running animation.<br>🔗 [`problem: dangling running tool call`](src/fixes/dangling-tool-calls/index.test.ts#L67) | Tracks active tool calls and marks backgrounded tools completed immediately, before assistant text streams, and upon turn completion.<br>🔗 [`solution: tool call auto-completion`](src/fixes/dangling-tool-calls/index.test.ts#L79) |
|
|
158
161
|
| [**Forbidden Question Other Option**](src/fixes/missing-question-fallback/index.ts) | **Problem**: Upstream instructs the model not to provide an 'Other' option (`"Do NOT add an 'Other' option to questions"`), stranding users in multiple-choice prompts when none of the choices apply.<br>🔗 [`problem: missing other option`](src/fixes/missing-question-fallback/index.test.ts#L14) | Steers the model to always include an 'Other' choice and appends a fallback 'Other' option to inbound `ask_question` tool calls.<br>🔗 [`solution: option fallback`](src/fixes/missing-question-fallback/index.test.ts#L14) |
|
|
162
|
+
| [**Premature Empty Turn Stop**](src/fixes/premature-turn-stop/index.ts) | **Problem**: Upstream binary prematurely concludes prompt turns with empty completions (`stopReason=16`) without emitting assistant message chunks, leaving editor UIs frozen in silence.<br>🔗 [`problem: premature turn termination`](src/fixes/premature-turn-stop/index.test.ts#L67) | Tracks prompt turn state, injects explicit steering instructions, and synthesizes status messages when upstream ends a turn without speaking.<br>🔗 [`solution: empty turn recovery`](src/fixes/premature-turn-stop/index.test.ts#L106) |
|
|
159
163
|
|
|
160
164
|
## Setup
|
|
161
165
|
|
|
166
|
+
### Automatic Configuration (Recommended)
|
|
167
|
+
|
|
168
|
+
Run the one-line setup command to install and configure both Paseo and Zed:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
pnpm add -g @simonepri/refined-antigravity-acp && refined-antigravity-acp setup
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
To configure a specific editor only:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
refined-antigravity-acp setup paseo # Configures ~/.paseo/config.json & restarts daemon
|
|
178
|
+
refined-antigravity-acp setup zed # Configures Zed settings.json
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
The setup command resolves your active Node runtime (`process.execPath`) and global CLI path automatically, handles Zed JSONC comments safely, and restarts the Paseo daemon.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
### Manual Configuration
|
|
186
|
+
|
|
162
187
|
Install globally:
|
|
163
188
|
|
|
164
189
|
```bash
|
|
165
|
-
|
|
190
|
+
pnpm add -g @simonepri/refined-antigravity-acp
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Locate installed binary paths:
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
which node
|
|
166
197
|
which refined-antigravity-acp
|
|
198
|
+
which pnpm
|
|
167
199
|
```
|
|
168
200
|
|
|
169
201
|
> [!TIP]
|
|
170
|
-
> The wrapper downloads
|
|
202
|
+
> The wrapper downloads `agy_acp_server.par` if not already installed locally.
|
|
203
|
+
|
|
204
|
+
---
|
|
171
205
|
|
|
172
206
|
### 1. Paseo (ACP Agent Provider)
|
|
173
207
|
|
|
174
208
|
Register the wrapper in `~/.paseo/config.json` under `agents.providers`:
|
|
175
209
|
|
|
210
|
+
#### Global Binary (Recommended)
|
|
211
|
+
|
|
212
|
+
```json
|
|
213
|
+
{
|
|
214
|
+
"agents": {
|
|
215
|
+
"providers": {
|
|
216
|
+
"refined-antigravity-acp": {
|
|
217
|
+
"extends": "acp",
|
|
218
|
+
"label": "Antigravity",
|
|
219
|
+
"command": ["<node-path>", "<refined-antigravity-acp-path>"],
|
|
220
|
+
"enabled": true
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
> [!NOTE]
|
|
228
|
+
> The Paseo daemon runs outside the login shell environment. Providing absolute paths from `which node` and `which refined-antigravity-acp` prevents `env: node: No such file or directory` errors.
|
|
229
|
+
|
|
230
|
+
#### Zero-Install (pnpm dlx)
|
|
231
|
+
|
|
176
232
|
```json
|
|
177
233
|
{
|
|
178
234
|
"agents": {
|
|
@@ -180,7 +236,7 @@ Register the wrapper in `~/.paseo/config.json` under `agents.providers`:
|
|
|
180
236
|
"refined-antigravity-acp": {
|
|
181
237
|
"extends": "acp",
|
|
182
238
|
"label": "Antigravity",
|
|
183
|
-
"command": ["/
|
|
239
|
+
"command": ["<pnpm-path>", "dlx", "@simonepri/refined-antigravity-acp"],
|
|
184
240
|
"enabled": true
|
|
185
241
|
}
|
|
186
242
|
}
|
|
@@ -188,7 +244,11 @@ Register the wrapper in `~/.paseo/config.json` under `agents.providers`:
|
|
|
188
244
|
}
|
|
189
245
|
```
|
|
190
246
|
|
|
191
|
-
|
|
247
|
+
Restart the Paseo daemon after modifying `config.json`:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
paseo daemon restart
|
|
251
|
+
```
|
|
192
252
|
|
|
193
253
|
---
|
|
194
254
|
|
|
@@ -196,21 +256,40 @@ Zero-install alternative: `"command": ["pnpm", "dlx", "@simonepri/refined-antigr
|
|
|
196
256
|
|
|
197
257
|
Add `refined-antigravity-acp` to your Zed `settings.json` under `agent.profiles`:
|
|
198
258
|
|
|
259
|
+
#### Global Binary (Recommended)
|
|
260
|
+
|
|
199
261
|
```json
|
|
200
262
|
{
|
|
201
263
|
"agent": {
|
|
202
264
|
"profiles": {
|
|
203
265
|
"antigravity": {
|
|
204
266
|
"type": "acp",
|
|
205
|
-
"command": "
|
|
206
|
-
"args": []
|
|
267
|
+
"command": "<node-path>",
|
|
268
|
+
"args": ["<refined-antigravity-acp-path>"]
|
|
207
269
|
}
|
|
208
270
|
}
|
|
209
271
|
}
|
|
210
272
|
}
|
|
211
273
|
```
|
|
212
274
|
|
|
213
|
-
|
|
275
|
+
> [!NOTE]
|
|
276
|
+
> Zed launches external agent processes without inheriting shell version manager PATH variables. Explicit paths from `which node` and `which refined-antigravity-acp` ensure reliable execution.
|
|
277
|
+
|
|
278
|
+
#### Zero-Install (pnpm dlx)
|
|
279
|
+
|
|
280
|
+
```json
|
|
281
|
+
{
|
|
282
|
+
"agent": {
|
|
283
|
+
"profiles": {
|
|
284
|
+
"antigravity": {
|
|
285
|
+
"type": "acp",
|
|
286
|
+
"command": "<pnpm-path>",
|
|
287
|
+
"args": ["dlx", "@simonepri/refined-antigravity-acp"]
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
```
|
|
214
293
|
|
|
215
294
|
---
|
|
216
295
|
|