@simonepri/refined-antigravity-acp 1.1.3 → 1.2.1
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 +26 -17
- package/dist/src/cli.js.map +1 -1
- package/dist/src/fixes/missing-question-fallback/index.d.ts +8 -6
- package/dist/src/fixes/missing-question-fallback/index.d.ts.map +1 -1
- package/dist/src/fixes/missing-question-fallback/index.js +135 -27
- package/dist/src/fixes/missing-question-fallback/index.js.map +1 -1
- package/dist/src/fixes/premature-turn-stop/index.d.ts +4 -4
- package/dist/src/fixes/premature-turn-stop/index.d.ts.map +1 -1
- package/dist/src/fixes/premature-turn-stop/index.js +4 -96
- package/dist/src/fixes/premature-turn-stop/index.js.map +1 -1
- package/dist/src/setup.d.ts +7 -1
- package/dist/src/setup.d.ts.map +1 -1
- package/dist/src/setup.js +68 -6
- package/dist/src/setup.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +18 -2
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":"AAyEA,wBAAsB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAqB5C"}
|
package/dist/src/cli.js
CHANGED
|
@@ -1,30 +1,39 @@
|
|
|
1
1
|
import readline from "node:readline";
|
|
2
2
|
import { createAntigravityConnector } from "./index.js";
|
|
3
3
|
import { runSetup } from "./setup.js";
|
|
4
|
+
function parseSetupTarget(args) {
|
|
5
|
+
if (args.includes("paseo") || args.includes("--paseo"))
|
|
6
|
+
return "paseo";
|
|
7
|
+
if (args.includes("zed") || args.includes("--zed"))
|
|
8
|
+
return "zed";
|
|
9
|
+
return "all";
|
|
10
|
+
}
|
|
11
|
+
function printHelp() {
|
|
12
|
+
console.log(`Refined Antigravity ACP - Hardened wrapper around Google's official Antigravity ACP binary.
|
|
13
|
+
|
|
14
|
+
Usage:
|
|
15
|
+
refined-antigravity-acp Start ACP server over stdio
|
|
16
|
+
refined-antigravity-acp setup Download binary & configure Paseo and Zed
|
|
17
|
+
refined-antigravity-acp setup paseo Configure Paseo (~/.paseo/config.json)
|
|
18
|
+
refined-antigravity-acp setup zed Configure Zed Editor (settings.json)
|
|
19
|
+
|
|
20
|
+
Options:
|
|
21
|
+
-y, --yes Accept Google Terms of Service non-interactively
|
|
22
|
+
`);
|
|
23
|
+
}
|
|
4
24
|
async function handleCliArgs(args) {
|
|
5
25
|
const firstArg = args[0]?.toLowerCase();
|
|
6
26
|
if (firstArg === "setup") {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
await runSetup("zed");
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
await runSetup("all");
|
|
27
|
+
const autoAccept = args.includes("--yes") || args.includes("-y");
|
|
28
|
+
const target = parseSetupTarget(args);
|
|
29
|
+
const success = await runSetup(target, { autoAccept });
|
|
30
|
+
if (!success) {
|
|
31
|
+
process.exit(1);
|
|
16
32
|
}
|
|
17
33
|
return true;
|
|
18
34
|
}
|
|
19
35
|
if (args.includes("--help") || args.includes("-h")) {
|
|
20
|
-
|
|
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
|
-
`);
|
|
36
|
+
printHelp();
|
|
28
37
|
return true;
|
|
29
38
|
}
|
|
30
39
|
return false;
|
package/dist/src/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.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A0B,EAAE,CAAC;IAC/C,MAAM,MAAM,GAAG,MAAM,SAAS,EAAE,CAAC;IAEjC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAE7C,MAAM,WAAW,GAAG,CAAC,KAAK,IAAI,EAAE;QAC9B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QACrD,CAAC;IACH,CAAC,CAAC,EAAE,CAAC;IAEL,MAAM,SAAS,GAAG,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;IAEjE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Problem:
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* When the model invokes `ask_question`, upstream `agy_acp_server` presents a `session/request_permission`
|
|
4
|
+
* modal choice and pauses execution awaiting user input. If the user types a new message into the chat
|
|
5
|
+
* or cancels instead of picking a pre-defined choice, upstream rejects the prompt with
|
|
6
|
+
* `"A foreground turn is already active"`, causing the turn to deadlock indefinitely.
|
|
6
7
|
*
|
|
7
8
|
* Solution:
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* Tracks in-flight `ask_question` requests and unblocks upstream by auto-cancelling the pending
|
|
10
|
+
* permission question when a new user chat prompt arrives, dismissing the UI question spinner and
|
|
11
|
+
* allowing the user's message to execute immediately.
|
|
10
12
|
*/
|
|
11
13
|
import { type AcpFix } from "../../core/types.js";
|
|
12
|
-
export declare const QUESTION_OPTIONS_INSTRUCTIONS: readonly string[];
|
|
13
14
|
export declare const OTHER_OPTION_REGEX: RegExp;
|
|
14
15
|
export interface QuestionItem {
|
|
15
16
|
question?: string;
|
|
@@ -25,6 +26,7 @@ export declare function ensureOtherOption(raw: unknown): {
|
|
|
25
26
|
modified: boolean;
|
|
26
27
|
result: unknown;
|
|
27
28
|
};
|
|
29
|
+
export declare function createQuestionOptionsFix(): AcpFix;
|
|
28
30
|
export declare const missingQuestionFallbackFix: AcpFix;
|
|
29
31
|
export declare const questionOptionsFix: AcpFix;
|
|
30
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/fixes/missing-question-fallback/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/fixes/missing-question-fallback/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAIL,KAAK,MAAM,EAMZ,MAAM,qBAAqB,CAAC;AAG7B,eAAO,MAAM,kBAAkB,QAA4D,CAAC;AAE5F,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAqCD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,CAkBtF;AAuJD,wBAAgB,wBAAwB,IAAI,MAAM,CAwDjD;AAED,eAAO,MAAM,0BAA0B,EAAE,MAAmC,CAAC;AAC7E,eAAO,MAAM,kBAAkB,QAA6B,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Problem:
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* When the model invokes `ask_question`, upstream `agy_acp_server` presents a `session/request_permission`
|
|
4
|
+
* modal choice and pauses execution awaiting user input. If the user types a new message into the chat
|
|
5
|
+
* or cancels instead of picking a pre-defined choice, upstream rejects the prompt with
|
|
6
|
+
* `"A foreground turn is already active"`, causing the turn to deadlock indefinitely.
|
|
6
7
|
*
|
|
7
8
|
* Solution:
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* Tracks in-flight `ask_question` requests and unblocks upstream by auto-cancelling the pending
|
|
10
|
+
* permission question when a new user chat prompt arrives, dismissing the UI question spinner and
|
|
11
|
+
* allowing the user's message to execute immediately.
|
|
10
12
|
*/
|
|
11
13
|
import { ACP_METHODS, SESSION_UPDATES, isMethod, } from "../../core/types.js";
|
|
12
|
-
|
|
13
|
-
"Ignore the ask_question 'no other' rule: always include an 'Other' option for free-text responses.",
|
|
14
|
-
];
|
|
14
|
+
import { extractSessionId } from "../../core/session-cache.js";
|
|
15
15
|
export const OTHER_OPTION_REGEX = /\b(?:other|none\s+of\s+the\s+above|something\s+else)\b/i;
|
|
16
16
|
function parsePayload(raw) {
|
|
17
17
|
if (typeof raw === "string") {
|
|
@@ -84,7 +84,9 @@ function handleSessionUpdate(update) {
|
|
|
84
84
|
function handleRpcRequest(msg) {
|
|
85
85
|
if (!("method" in msg) || typeof msg.method !== "string")
|
|
86
86
|
return;
|
|
87
|
-
const isToolInvocation = msg.method === "tools/call" ||
|
|
87
|
+
const isToolInvocation = msg.method === "tools/call" ||
|
|
88
|
+
msg.method === ACP_METHODS.SESSION_REQUEST_PERMISSION ||
|
|
89
|
+
msg.method === "session/requestPermission";
|
|
88
90
|
if (!isToolInvocation || !msg.params || typeof msg.params !== "object")
|
|
89
91
|
return;
|
|
90
92
|
const p = msg.params;
|
|
@@ -94,26 +96,132 @@ function handleRpcRequest(msg) {
|
|
|
94
96
|
patchFieldIfAskQuestion(p, "rawInput");
|
|
95
97
|
}
|
|
96
98
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
function clearPendingByRequestId(pendingQuestions, id) {
|
|
100
|
+
for (const [sessionId, pending] of pendingQuestions.entries()) {
|
|
101
|
+
if (pending.requestId === id) {
|
|
102
|
+
pendingQuestions.delete(sessionId);
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
async function unblockPendingQuestion(pending, sessionId, context) {
|
|
108
|
+
await context.writeToChild?.({
|
|
109
|
+
jsonrpc: "2.0",
|
|
110
|
+
id: pending.requestId,
|
|
111
|
+
result: { outcome: { outcome: "cancelled" } },
|
|
112
|
+
});
|
|
113
|
+
if (!pending.toolCallId)
|
|
114
|
+
return;
|
|
115
|
+
context.forwardInbound?.({
|
|
116
|
+
jsonrpc: "2.0",
|
|
117
|
+
method: ACP_METHODS.SESSION_UPDATE,
|
|
118
|
+
params: {
|
|
119
|
+
sessionId,
|
|
120
|
+
update: {
|
|
121
|
+
sessionUpdate: SESSION_UPDATES.TOOL_CALL_UPDATE,
|
|
122
|
+
toolCallId: pending.toolCallId,
|
|
123
|
+
status: "completed",
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function isPermissionMethod(method) {
|
|
129
|
+
return (method === ACP_METHODS.SESSION_REQUEST_PERMISSION || method === "session/requestPermission");
|
|
130
|
+
}
|
|
131
|
+
function extractToolCallId(params) {
|
|
132
|
+
if (!params || typeof params !== "object")
|
|
133
|
+
return undefined;
|
|
134
|
+
const toolCall = params.toolCall;
|
|
135
|
+
if (!toolCall || typeof toolCall !== "object")
|
|
136
|
+
return undefined;
|
|
137
|
+
const id = toolCall.toolCallId;
|
|
138
|
+
return typeof id === "string" ? id : undefined;
|
|
139
|
+
}
|
|
140
|
+
function extractPermissionDetails(msg) {
|
|
141
|
+
const sessionId = extractSessionId(msg);
|
|
142
|
+
const toolCallId = "params" in msg ? extractToolCallId(msg.params) : undefined;
|
|
143
|
+
const details = {};
|
|
144
|
+
if (sessionId)
|
|
145
|
+
details.sessionId = sessionId;
|
|
146
|
+
if (toolCallId)
|
|
147
|
+
details.toolCallId = toolCallId;
|
|
148
|
+
return details;
|
|
149
|
+
}
|
|
150
|
+
function recordInboundPermission(msg, pendingQuestions) {
|
|
151
|
+
const method = "method" in msg ? String(msg.method) : undefined;
|
|
152
|
+
if (!isPermissionMethod(method) || !("id" in msg))
|
|
153
|
+
return;
|
|
154
|
+
const id = msg.id;
|
|
155
|
+
if (id === undefined || id === null)
|
|
156
|
+
return;
|
|
157
|
+
const { sessionId, toolCallId } = extractPermissionDetails(msg);
|
|
158
|
+
if (sessionId) {
|
|
159
|
+
const pending = { requestId: id, sessionId };
|
|
160
|
+
if (toolCallId)
|
|
161
|
+
pending.toolCallId = toolCallId;
|
|
162
|
+
pendingQuestions.set(sessionId, pending);
|
|
102
163
|
}
|
|
103
|
-
|
|
104
|
-
|
|
164
|
+
}
|
|
165
|
+
function trackInboundToolCallId(msg, pendingQuestions) {
|
|
166
|
+
if (!isMethod(msg, ACP_METHODS.SESSION_UPDATE))
|
|
167
|
+
return;
|
|
168
|
+
const update = msg.params?.update;
|
|
169
|
+
if (!update)
|
|
170
|
+
return;
|
|
171
|
+
handleSessionUpdate(update);
|
|
172
|
+
const sessionId = extractSessionId(msg);
|
|
173
|
+
if (!sessionId || update.sessionUpdate !== SESSION_UPDATES.TOOL_CALL)
|
|
174
|
+
return;
|
|
175
|
+
if (isAskQuestionName(update.name, update.title) && update.toolCallId) {
|
|
176
|
+
const existing = pendingQuestions.get(sessionId);
|
|
177
|
+
if (existing && !existing.toolCallId) {
|
|
178
|
+
existing.toolCallId = update.toolCallId;
|
|
179
|
+
}
|
|
105
180
|
}
|
|
106
|
-
return msg;
|
|
107
181
|
}
|
|
108
|
-
export
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
182
|
+
export function createQuestionOptionsFix() {
|
|
183
|
+
const pendingQuestions = new Map();
|
|
184
|
+
return {
|
|
185
|
+
name: "missing-question-fallback",
|
|
186
|
+
description: "Unblocks interactive questions when user sends a chat message and provides question fallback handling",
|
|
187
|
+
onOutbound: async (msg, context) => {
|
|
188
|
+
if ("id" in msg && msg.id !== undefined && msg.id !== null) {
|
|
189
|
+
clearPendingByRequestId(pendingQuestions, msg.id);
|
|
190
|
+
}
|
|
191
|
+
const isPromptOrCancel = isMethod(msg, ACP_METHODS.SESSION_PROMPT) || isMethod(msg, ACP_METHODS.SESSION_CANCEL);
|
|
192
|
+
if (isPromptOrCancel) {
|
|
193
|
+
const sessionId = extractSessionId(msg);
|
|
194
|
+
if (sessionId) {
|
|
195
|
+
const pending = pendingQuestions.get(sessionId);
|
|
196
|
+
if (pending) {
|
|
197
|
+
pendingQuestions.delete(sessionId);
|
|
198
|
+
await unblockPendingQuestion(pending, sessionId, context);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return msg;
|
|
203
|
+
},
|
|
204
|
+
onInbound: (msg, _context) => {
|
|
205
|
+
recordInboundPermission(msg, pendingQuestions);
|
|
206
|
+
if (isMethod(msg, ACP_METHODS.SESSION_UPDATE)) {
|
|
207
|
+
trackInboundToolCallId(msg, pendingQuestions);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
handleRpcRequest(msg);
|
|
211
|
+
}
|
|
212
|
+
if ("result" in msg || "error" in msg) {
|
|
213
|
+
const id = msg.id;
|
|
214
|
+
if (id !== undefined && id !== null) {
|
|
215
|
+
clearPendingByRequestId(pendingQuestions, id);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return [msg];
|
|
219
|
+
},
|
|
220
|
+
dispose: () => {
|
|
221
|
+
pendingQuestions.clear();
|
|
222
|
+
},
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
export const missingQuestionFallbackFix = createQuestionOptionsFix();
|
|
118
226
|
export const questionOptionsFix = missingQuestionFallbackFix;
|
|
119
227
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/fixes/missing-question-fallback/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/fixes/missing-question-fallback/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,WAAW,EACX,eAAe,EACf,QAAQ,GAOT,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,yDAAyD,CAAC;AAoB5F,SAAS,YAAY,CAAC,GAAY;IAChC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAY,CAAC;YAC1C,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;gBAClD,CAAC,CAAC,EAAE,MAAM,EAAE,MAA4B,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC1D,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACvC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,I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AC,MAAM,CAAC,SAAS,CAAC,CAAC;wBACnC,MAAM,sBAAsB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;oBAC5D,CAAC;gBACH,CAAC;YACH,CAAC;YAED,OAAO,GAAG,CAAC;QACb,CAAC;QAED,SAAS,EAAE,CAAC,GAAqB,EAAE,QAAwB,EAAsB,EAAE;YACjF,uBAAuB,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;YAE/C,IAAI,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,cAAc,CAAC,EAAE,CAAC;gBAC9C,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,gBAAgB,CAAC,GAAG,CAAC,CAAC;YACxB,CAAC;YAED,IAAI,QAAQ,IAAI,GAAG,IAAI,OAAO,IAAI,GAAG,EAAE,CAAC;gBACtC,MAAM,EAAE,GAAI,GAAgC,CAAC,EAAE,CAAC;gBAChD,IAAI,EAAE,KAAK,SAAS,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;oBACpC,uBAAuB,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;gBAChD,CAAC;YACH,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;QAED,OAAO,EAAE,GAAS,EAAE;YAClB,gBAAgB,CAAC,KAAK,EAAE,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAW,wBAAwB,EAAE,CAAC;AAC7E,MAAM,CAAC,MAAM,kBAAkB,GAAG,0BAA0B,CAAC"}
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* transition the session to idle, leaving the user with zero explanation and an apparent hang.
|
|
7
7
|
*
|
|
8
8
|
* Solution:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Injects explicit system prompt steering instructing the model to never end a prompt turn without
|
|
10
|
+
* emitting a clear assistant text message, eliminating premature silent stops at the model source
|
|
11
|
+
* without synthesizing synthetic conversational prose in the proxy.
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import type { AcpFix } from "../../core/types.js";
|
|
14
14
|
export declare function createPrematureTurnStopFix(): AcpFix;
|
|
15
15
|
export declare const prematureTurnStopFix: AcpFix;
|
|
16
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/fixes/premature-turn-stop/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/fixes/premature-turn-stop/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAElD,wBAAgB,0BAA0B,IAAI,MAAM,CAYnD;AAED,eAAO,MAAM,oBAAoB,QAA+B,CAAC"}
|
|
@@ -6,112 +6,20 @@
|
|
|
6
6
|
* transition the session to idle, leaving the user with zero explanation and an apparent hang.
|
|
7
7
|
*
|
|
8
8
|
* Solution:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Injects explicit system prompt steering instructing the model to never end a prompt turn without
|
|
10
|
+
* emitting a clear assistant text message, eliminating premature silent stops at the model source
|
|
11
|
+
* without synthesizing synthetic conversational prose in the proxy.
|
|
12
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
13
|
export function createPrematureTurnStopFix() {
|
|
88
|
-
const activeTurns = new Map();
|
|
89
|
-
const sessionTurnMap = new Map();
|
|
90
14
|
return {
|
|
91
15
|
name: "premature-turn-stop",
|
|
92
|
-
description: "
|
|
16
|
+
description: "Steers model to prevent premature empty turn stops without assistant messages",
|
|
93
17
|
getSystemInstructions() {
|
|
94
18
|
return [
|
|
95
19
|
"Never end a prompt turn without emitting a clear assistant text message summarizing completed actions, current status, or next steps.",
|
|
96
20
|
"When executing commit commands, linter checks, or tests that encounter errors, explicitly explain the failures to the user before attempting further autonomous repairs.",
|
|
97
21
|
];
|
|
98
22
|
},
|
|
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
23
|
};
|
|
116
24
|
}
|
|
117
25
|
export const prematureTurnStopFix = createPrematureTurnStopFix();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/fixes/premature-turn-stop/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/fixes/premature-turn-stop/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,MAAM,UAAU,0BAA0B;IACxC,OAAO;QACL,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,+EAA+E;QAE5F,qBAAqB;YACnB,OAAO;gBACL,uIAAuI;gBACvI,0KAA0K;aAC3K,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,0BAA0B,EAAE,CAAC"}
|
package/dist/src/setup.d.ts
CHANGED
|
@@ -5,5 +5,11 @@ export interface ResolvedPaths {
|
|
|
5
5
|
export declare function resolvePaths(): ResolvedPaths;
|
|
6
6
|
export declare function setupPaseo(paths?: ResolvedPaths, restartDaemon?: boolean): boolean;
|
|
7
7
|
export declare function setupZed(paths?: ResolvedPaths): boolean;
|
|
8
|
-
export declare
|
|
8
|
+
export declare const GOOGLE_TERMS_URL = "https://antigravity.google/terms";
|
|
9
|
+
export interface SetupOptions {
|
|
10
|
+
autoAccept?: boolean | undefined;
|
|
11
|
+
restartDaemon?: boolean | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare function ensureSetupBinary(options?: SetupOptions): Promise<boolean>;
|
|
14
|
+
export declare function runSetup(target?: "all" | "paseo" | "zed", options?: SetupOptions): Promise<boolean>;
|
|
9
15
|
//# sourceMappingURL=setup.d.ts.map
|
package/dist/src/setup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/setup.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,wBAAgB,YAAY,IAAI,aAAa,CA2B5C;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,eAAO,MAAM,gBAAgB,qCAAqC,CAAC;AAEnE,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACrC;AAkCD,wBAAsB,iBAAiB,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAwBhF;AAED,wBAAsB,QAAQ,CAC5B,MAAM,GAAE,KAAK,GAAG,OAAO,GAAG,KAAa,EACvC,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,OAAO,CAAC,CAmBlB"}
|
package/dist/src/setup.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import os from "node:os";
|
|
4
|
-
import
|
|
4
|
+
import childProcess from "node:child_process";
|
|
5
|
+
import readline from "node:readline/promises";
|
|
6
|
+
import { agyCommand, ensureAntigravityBinary } from "./core/command.js";
|
|
5
7
|
export function resolvePaths() {
|
|
6
8
|
const nodePath = process.execPath;
|
|
7
9
|
let cliPath;
|
|
@@ -18,7 +20,9 @@ export function resolvePaths() {
|
|
|
18
20
|
// 2. Check which refined-antigravity-acp
|
|
19
21
|
if (!cliPath) {
|
|
20
22
|
try {
|
|
21
|
-
const found =
|
|
23
|
+
const found = childProcess
|
|
24
|
+
.execSync("which refined-antigravity-acp", { encoding: "utf8" })
|
|
25
|
+
.trim();
|
|
22
26
|
if (found && fs.existsSync(found)) {
|
|
23
27
|
cliPath = fs.realpathSync(found);
|
|
24
28
|
}
|
|
@@ -51,7 +55,7 @@ function getNestedRecord(obj, key) {
|
|
|
51
55
|
}
|
|
52
56
|
function tryRestartPaseoDaemon() {
|
|
53
57
|
try {
|
|
54
|
-
execFileSync("paseo", ["daemon", "restart"], { stdio: "ignore" });
|
|
58
|
+
childProcess.execFileSync("paseo", ["daemon", "restart"], { stdio: "ignore" });
|
|
55
59
|
console.log("✓ Restarted Paseo daemon");
|
|
56
60
|
}
|
|
57
61
|
catch {
|
|
@@ -115,17 +119,75 @@ export function setupZed(paths = resolvePaths()) {
|
|
|
115
119
|
console.log(`✓ Configured Zed profile in ${settingsPath}`);
|
|
116
120
|
return true;
|
|
117
121
|
}
|
|
118
|
-
export
|
|
122
|
+
export const GOOGLE_TERMS_URL = "https://antigravity.google/terms";
|
|
123
|
+
function findExistingBinary() {
|
|
124
|
+
try {
|
|
125
|
+
const [cmd] = agyCommand();
|
|
126
|
+
return fs.existsSync(cmd) ? cmd : undefined;
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function promptTermsAcceptance() {
|
|
133
|
+
if (!process.stdin.isTTY) {
|
|
134
|
+
console.error(`\nGoogle Antigravity ACP binary was not found locally.\nBy downloading, you agree to the Google Antigravity Terms of Service:\n ${GOOGLE_TERMS_URL}\n\nTo accept non-interactively, pass --yes: refined-antigravity-acp setup --yes\n`);
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
const rl = readline.createInterface({
|
|
138
|
+
input: process.stdin,
|
|
139
|
+
output: process.stdout,
|
|
140
|
+
});
|
|
141
|
+
try {
|
|
142
|
+
const answer = await rl.question(`\nGoogle Antigravity ACP binary was not found locally.\nTo continue, the official binary must be downloaded from Google (dl.google.com).\n\nNotice: By downloading, you agree to the Google Antigravity Terms of Service:\n ${GOOGLE_TERMS_URL}\n\nDo you accept the Google Antigravity Terms of Service? [y/N]: `);
|
|
143
|
+
const trimmed = answer.trim().toLowerCase();
|
|
144
|
+
return trimmed === "y" || trimmed === "yes";
|
|
145
|
+
}
|
|
146
|
+
finally {
|
|
147
|
+
rl.close();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
export async function ensureSetupBinary(options) {
|
|
151
|
+
const existingCmd = findExistingBinary();
|
|
152
|
+
if (existingCmd) {
|
|
153
|
+
console.log(`✓ Google Antigravity ACP binary found: ${existingCmd}`);
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
const accepted = options?.autoAccept ?? (await promptTermsAcceptance());
|
|
157
|
+
if (!accepted) {
|
|
158
|
+
console.log("\nSetup cancelled: Google Antigravity Terms of Service were not accepted.");
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
console.log(`\nNotice: By downloading, you agree to the Google Antigravity Terms of Service:`);
|
|
162
|
+
console.log(` ${GOOGLE_TERMS_URL}`);
|
|
163
|
+
console.log("\n⬇ Downloading official Google Antigravity ACP binary...");
|
|
164
|
+
try {
|
|
165
|
+
const installed = await ensureAntigravityBinary();
|
|
166
|
+
console.log(`✓ Installed agy_acp_server to ${installed}\n`);
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
console.error(`✗ Failed to download Antigravity ACP binary:`, err);
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
export async function runSetup(target = "all", options) {
|
|
175
|
+
const binaryOk = await ensureSetupBinary(options);
|
|
176
|
+
if (!binaryOk) {
|
|
177
|
+
return false;
|
|
178
|
+
}
|
|
119
179
|
const paths = resolvePaths();
|
|
180
|
+
const restartDaemon = options?.restartDaemon ?? true;
|
|
120
181
|
if (target === "paseo") {
|
|
121
|
-
setupPaseo(paths);
|
|
182
|
+
setupPaseo(paths, restartDaemon);
|
|
122
183
|
}
|
|
123
184
|
else if (target === "zed") {
|
|
124
185
|
setupZed(paths);
|
|
125
186
|
}
|
|
126
187
|
else {
|
|
127
|
-
setupPaseo(paths);
|
|
188
|
+
setupPaseo(paths, restartDaemon);
|
|
128
189
|
setupZed(paths);
|
|
129
190
|
}
|
|
191
|
+
return true;
|
|
130
192
|
}
|
|
131
193
|
//# sourceMappingURL=setup.js.map
|
package/dist/src/setup.js.map
CHANGED
|
@@ -1 +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,
|
|
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,YAAY,MAAM,oBAAoB,CAAC;AAC9C,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAOxE,MAAM,UAAU,YAAY;IAC1B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,IAAI,OAA2B,CAAC;IAEhC,yDAAyD;IAC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 -158,8 +158,8 @@ The matrix below documents upstream defects across process startup, turn executi
|
|
|
158
158
|
| [**Silent Background Task Execution**](src/fixes/silent-background-tasks/index.ts) | **Problem**: Subagents and background tasks execute silently; upstream binary produces no stdout chunks during `STATE_WAITING_FOR_TASKS`, leaving editor UIs frozen.<br>🔗 [`problem: silent background tasks`](src/fixes/silent-background-tasks/index.e2e.test.ts#L6) | Synthesizes standard ACP `session/update` plan notifications (`sessionUpdate: "plan"`) tracking active subagent roles and background tasks with live progress and completion.<br>🔗 [`solution: plan synthesis`](src/fixes/silent-background-tasks/index.e2e.test.ts#L12) |
|
|
159
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) |
|
|
160
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) |
|
|
161
|
-
| [**
|
|
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#
|
|
161
|
+
| [**Interactive Question Deadlock**](src/fixes/missing-question-fallback/index.ts) | **Problem**: When `ask_question` is active, sending a chat prompt or cancel causes upstream to reject the message with _"A foreground turn is already active"_, deadlocking sessions indefinitely.<br>🔗 [`problem: question collision`](src/fixes/missing-question-fallback/index.e2e.test.ts#L16) | Intercepts user chat prompts and cancellations to auto-unblock pending question permission requests to the child process and complete UI tool states.<br>🔗 [`solution: question unblocking`](src/fixes/missing-question-fallback/index.e2e.test.ts#L53) |
|
|
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#L48) | Injects explicit system prompt steering instructing the model to always emit clear status messages and never terminate turns silently.<br>🔗 [`solution: prompt steering`](src/fixes/premature-turn-stop/index.test.ts#L79) |
|
|
163
163
|
|
|
164
164
|
## Setup
|
|
165
165
|
|
|
@@ -171,6 +171,9 @@ Run the one-line setup command to install and configure both Paseo and Zed:
|
|
|
171
171
|
pnpm add -g @simonepri/refined-antigravity-acp && refined-antigravity-acp setup
|
|
172
172
|
```
|
|
173
173
|
|
|
174
|
+
> [!NOTE]
|
|
175
|
+
> **Google Terms of Service**: The setup command checks if Google's official `agy_acp_server` binary is installed. If missing, it displays a link to the [Google Antigravity Terms of Service](https://antigravity.google/terms) and prompts you to accept them before downloading the binary from Google's CDN (`dl.google.com`). For non-interactive setups or CI, pass `-y` (or `--yes`) to accept automatically: `refined-antigravity-acp setup --yes`.
|
|
176
|
+
|
|
174
177
|
To configure a specific editor only:
|
|
175
178
|
|
|
176
179
|
```bash
|
|
@@ -366,6 +369,19 @@ Every fix pull request must follow this structure:
|
|
|
366
369
|
|
|
367
370
|
---
|
|
368
371
|
|
|
372
|
+
## Terms of Service Notice
|
|
373
|
+
|
|
374
|
+
Google's [Antigravity Additional Terms of Service](https://antigravity.google/terms) restrict using the Service in connection with unauthorized third-party software.
|
|
375
|
+
|
|
376
|
+
Refined Antigravity ACP operates as a local proxy between ACP clients (Paseo, Zed) and Google's official `agy_acp_server` binary:
|
|
377
|
+
|
|
378
|
+
- **What it does**: It supervises the local child process to recover from upstream deadlocks and crashes, repairs orphaned SQLite checkpoints, sanitizes streaming Markdown and diagrams, and injects workspace context and slash skills.
|
|
379
|
+
- **What it does not do**: It does not make direct calls to Google cloud APIs, does not touch, store, or extract OAuth credentials or API keys, and does not bypass server-side quotas or rate limits.
|
|
380
|
+
|
|
381
|
+
As with any third-party editor integration for official binaries, please review Google's Terms of Service to ensure your use complies with the policies applicable to your account.
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
369
385
|
## Disclaimer
|
|
370
386
|
|
|
371
387
|
This is an independent open-source project and is not affiliated with, authorized, or endorsed by Google LLC. "Antigravity", "Gemini", and Google are trademarks of Google LLC.
|