@agentex/agent 0.0.37 → 0.0.39
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/CHANGELOG.md +47 -0
- package/README.md +54 -17
- package/dist/providers/antigravity/codec.d.ts +4 -0
- package/dist/providers/antigravity/codec.d.ts.map +1 -0
- package/dist/providers/antigravity/codec.js +27 -0
- package/dist/providers/antigravity/codec.js.map +1 -0
- package/dist/providers/antigravity/connection.d.ts +100 -0
- package/dist/providers/antigravity/connection.d.ts.map +1 -0
- package/dist/providers/antigravity/connection.js +267 -0
- package/dist/providers/antigravity/connection.js.map +1 -0
- package/dist/providers/antigravity/discovery.d.ts +11 -0
- package/dist/providers/antigravity/discovery.d.ts.map +1 -0
- package/dist/providers/antigravity/discovery.js +92 -0
- package/dist/providers/antigravity/discovery.js.map +1 -0
- package/dist/providers/antigravity/execute.d.ts +9 -0
- package/dist/providers/antigravity/execute.d.ts.map +1 -0
- package/dist/providers/antigravity/execute.js +206 -0
- package/dist/providers/antigravity/execute.js.map +1 -0
- package/dist/providers/antigravity/index.d.ts +12 -0
- package/dist/providers/antigravity/index.d.ts.map +1 -0
- package/dist/providers/antigravity/index.js +46 -0
- package/dist/providers/antigravity/index.js.map +1 -0
- package/dist/providers/antigravity/parse.d.ts +114 -0
- package/dist/providers/antigravity/parse.d.ts.map +1 -0
- package/dist/providers/antigravity/parse.js +369 -0
- package/dist/providers/antigravity/parse.js.map +1 -0
- package/dist/providers/antigravity/probe.d.ts +3 -0
- package/dist/providers/antigravity/probe.d.ts.map +1 -0
- package/dist/providers/antigravity/probe.js +84 -0
- package/dist/providers/antigravity/probe.js.map +1 -0
- package/dist/providers/antigravity/runtime.d.ts +30 -0
- package/dist/providers/antigravity/runtime.d.ts.map +1 -0
- package/dist/providers/antigravity/runtime.js +69 -0
- package/dist/providers/antigravity/runtime.js.map +1 -0
- package/dist/providers/antigravity/session.d.ts +7 -0
- package/dist/providers/antigravity/session.d.ts.map +1 -0
- package/dist/providers/antigravity/session.js +317 -0
- package/dist/providers/antigravity/session.js.map +1 -0
- package/dist/providers/gemini/index.d.ts.map +1 -1
- package/dist/providers/gemini/index.js +6 -0
- package/dist/providers/gemini/index.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +2 -0
- package/dist/registry.js.map +1 -1
- package/dist/types.d.ts +6 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/auth.d.ts +1 -1
- package/dist/utils/auth.d.ts.map +1 -1
- package/dist/utils/auth.js +79 -1
- package/dist/utils/auth.js.map +1 -1
- package/dist/utils/binary.d.ts.map +1 -1
- package/dist/utils/binary.js +10 -0
- package/dist/utils/binary.js.map +1 -1
- package/dist/utils/instructions.d.ts +36 -12
- package/dist/utils/instructions.d.ts.map +1 -1
- package/dist/utils/instructions.js +116 -62
- package/dist/utils/instructions.js.map +1 -1
- package/dist/utils/runtime-homes.d.ts.map +1 -1
- package/dist/utils/runtime-homes.js +4 -0
- package/dist/utils/runtime-homes.js.map +1 -1
- package/dist/utils/skills.d.ts +3 -3
- package/dist/utils/skills.d.ts.map +1 -1
- package/dist/utils/skills.js +16 -2
- package/dist/utils/skills.js.map +1 -1
- package/package.json +3 -2
- package/src/providers/antigravity/codec.ts +29 -0
- package/src/providers/antigravity/connection.ts +304 -0
- package/src/providers/antigravity/discovery.ts +90 -0
- package/src/providers/antigravity/execute.ts +214 -0
- package/src/providers/antigravity/index.ts +48 -0
- package/src/providers/antigravity/parse.ts +439 -0
- package/src/providers/antigravity/probe.ts +89 -0
- package/src/providers/antigravity/runtime.ts +64 -0
- package/src/providers/antigravity/session.ts +359 -0
- package/src/providers/gemini/index.ts +6 -0
- package/src/registry.ts +2 -0
- package/src/types.ts +6 -5
- package/src/utils/auth.ts +82 -1
- package/src/utils/binary.ts +10 -0
- package/src/utils/instructions.ts +162 -73
- package/src/utils/runtime-homes.ts +4 -0
- package/src/utils/skills.ts +17 -4
|
@@ -0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oBACA,SAAS,EAAE,KAAK;oBAChB,sDAAsD;oBACtD,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,SAAkB,CAAC,CAAC,CAAC,kBAA2B;oBACpE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,UAAU,EAAE,OAAO,IAAI,yCAAyC;iBAC3G;YACH,QAAQ,EAAE,SAAS,CAAC,iBAAiB,CAAC;YACtC,KAAK,EAAE,SAAS,CAAC,iBAAiB,CAAC;YACnC,kBAAkB,EAAE,SAAS,CAAC,KAAK,CAAC;YACpC,oBAAoB,EAAE,SAAS,CAAC,KAAK,CAAC;YACtC,mBAAmB,EAAE,SAAS,CAAC,KAAK,CAAC;YACrC,iBAAiB,EAAE,SAAS,CAAC,KAAK,CAAC;SACpC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { AgentMode, ProviderConfig, ProviderRuntimeContext } from "../../types.js";
|
|
2
|
+
import { type ResolvedBinary } from "../../utils/binary.js";
|
|
3
|
+
/** Running `agy` with no arguments signs in through the browser. */
|
|
4
|
+
export declare const AGY_LOGIN_COMMAND = "agy";
|
|
5
|
+
export declare const AGY_SIGN_IN_MESSAGE = "Antigravity CLI is not signed in. Run `agy` once to sign in.";
|
|
6
|
+
export declare function findAgyBinary(ctx?: ProviderRuntimeContext): Promise<ResolvedBinary>;
|
|
7
|
+
/**
|
|
8
|
+
* The CLI's execution modes (`--mode`). `default` is request-review: file
|
|
9
|
+
* edits wait for approval, which headless runs settle by policy. Shell
|
|
10
|
+
* commands follow the permission rules in every mode.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ANTIGRAVITY_MODES: AgentMode[];
|
|
13
|
+
/** The `--mode` value for a config, or null for the CLI default. */
|
|
14
|
+
export declare function resolveAgyMode(config: ProviderConfig): string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Arguments for a headless `agy` process that reads user messages as NDJSON
|
|
17
|
+
* on stdin and writes `stream-json` events. One process serves a whole
|
|
18
|
+
* session; one-shot runs write a single message and close stdin.
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildAgyArgs(config: ProviderConfig, options: {
|
|
21
|
+
resumeId: string | null;
|
|
22
|
+
model: string | null;
|
|
23
|
+
}): string[];
|
|
24
|
+
/**
|
|
25
|
+
* The conversation to resume from saved params, or null. Antigravity scopes
|
|
26
|
+
* conversations to the directory they ran in, so params saved under a
|
|
27
|
+
* different cwd start fresh instead of resuming somewhere unexpected.
|
|
28
|
+
*/
|
|
29
|
+
export declare function readAgyResumeId(params: Record<string, unknown> | null | undefined, cwd: string): string | null;
|
|
30
|
+
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/providers/antigravity/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAExE,oEAAoE;AACpE,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC,eAAO,MAAM,mBAAmB,iEAAiE,CAAC;AAElG,wBAAgB,aAAa,CAAC,GAAG,GAAE,sBAA2B,GAAG,OAAO,CAAC,cAAc,CAAC,CAEvF;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,EAIxC,CAAC;AAEF,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAKpE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE;IAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,MAAM,EAAE,CAYzH;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO9G"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as path from "node:path";
|
|
2
|
+
import { findBinary } from "../../utils/binary.js";
|
|
3
|
+
/** Running `agy` with no arguments signs in through the browser. */
|
|
4
|
+
export const AGY_LOGIN_COMMAND = "agy";
|
|
5
|
+
export const AGY_SIGN_IN_MESSAGE = "Antigravity CLI is not signed in. Run `agy` once to sign in.";
|
|
6
|
+
export function findAgyBinary(ctx = {}) {
|
|
7
|
+
return findBinary("agy", ctx.config?.command);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The CLI's execution modes (`--mode`). `default` is request-review: file
|
|
11
|
+
* edits wait for approval, which headless runs settle by policy. Shell
|
|
12
|
+
* commands follow the permission rules in every mode.
|
|
13
|
+
*/
|
|
14
|
+
export const ANTIGRAVITY_MODES = [
|
|
15
|
+
{ id: "default", name: "Default", description: "Review file edits before they are applied" },
|
|
16
|
+
{ id: "accept-edits", name: "Accept edits", description: "Apply file edits without asking" },
|
|
17
|
+
{ id: "plan", name: "Plan", description: "Investigate read-only and propose a plan before editing" },
|
|
18
|
+
];
|
|
19
|
+
/** The `--mode` value for a config, or null for the CLI default. */
|
|
20
|
+
export function resolveAgyMode(config) {
|
|
21
|
+
if (config.planMode)
|
|
22
|
+
return "plan";
|
|
23
|
+
const requested = config.modeId ?? config.mode;
|
|
24
|
+
if (!requested || requested === "default")
|
|
25
|
+
return null;
|
|
26
|
+
return requested;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Arguments for a headless `agy` process that reads user messages as NDJSON
|
|
30
|
+
* on stdin and writes `stream-json` events. One process serves a whole
|
|
31
|
+
* session; one-shot runs write a single message and close stdin.
|
|
32
|
+
*/
|
|
33
|
+
export function buildAgyArgs(config, options) {
|
|
34
|
+
const args = ["--input-format", "stream-json", "--output-format", "stream-json"];
|
|
35
|
+
if (options.resumeId)
|
|
36
|
+
args.push("--conversation", options.resumeId);
|
|
37
|
+
if (options.model)
|
|
38
|
+
args.push("--model", options.model);
|
|
39
|
+
if (config.effort)
|
|
40
|
+
args.push("--effort", config.effort);
|
|
41
|
+
const mode = resolveAgyMode(config);
|
|
42
|
+
if (mode)
|
|
43
|
+
args.push("--mode", mode);
|
|
44
|
+
// Plan mode is the more conservative intent and wins over skipPermissions.
|
|
45
|
+
if (config.skipPermissions && !config.planMode)
|
|
46
|
+
args.push("--dangerously-skip-permissions");
|
|
47
|
+
if (config.sandbox)
|
|
48
|
+
args.push("--sandbox");
|
|
49
|
+
if (config.extraArgs)
|
|
50
|
+
args.push(...config.extraArgs);
|
|
51
|
+
return args;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The conversation to resume from saved params, or null. Antigravity scopes
|
|
55
|
+
* conversations to the directory they ran in, so params saved under a
|
|
56
|
+
* different cwd start fresh instead of resuming somewhere unexpected.
|
|
57
|
+
*/
|
|
58
|
+
export function readAgyResumeId(params, cwd) {
|
|
59
|
+
if (!params)
|
|
60
|
+
return null;
|
|
61
|
+
const id = params["sessionId"] ?? params["session_id"] ?? params["conversationId"];
|
|
62
|
+
if (typeof id !== "string" || !id.trim())
|
|
63
|
+
return null;
|
|
64
|
+
const savedCwd = params["cwd"];
|
|
65
|
+
if (typeof savedCwd === "string" && savedCwd && path.resolve(savedCwd) !== path.resolve(cwd))
|
|
66
|
+
return null;
|
|
67
|
+
return id.trim();
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../src/providers/antigravity/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,UAAU,EAAuB,MAAM,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import type { AgentSession, SessionContext } from "../../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Open a multi-turn Antigravity session. Throws when `agy` is not installed.
|
|
4
|
+
* The process starts on the first `send()`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createAntigravitySession(ctx: SessionContext): Promise<AgentSession>;
|
|
7
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../src/providers/antigravity/session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAOZ,cAAc,EAOf,MAAM,gBAAgB,CAAC;AA4BxB;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAYzF"}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { GoalController, EMULATED_GOAL_CAPABILITY } from "../../goals/index.js";
|
|
2
|
+
import { buildEnv, ensurePathInEnv } from "../../utils/env.js";
|
|
3
|
+
import { resolveInstructions } from "../../utils/instructions.js";
|
|
4
|
+
import { injectHomeSkills } from "../../utils/skills.js";
|
|
5
|
+
import { uuidv7 } from "../../utils/uuid.js";
|
|
6
|
+
import { AgyConnection, firstAgyErrorLine, interruptAgyTurn, } from "./connection.js";
|
|
7
|
+
import { ANTIGRAVITY_PROVIDER_TYPE, AgyStreamParser, agyUsageRecord, classifyAgyFailure, mapAgyTurnStatus, } from "./parse.js";
|
|
8
|
+
import { AGY_SIGN_IN_MESSAGE, buildAgyArgs, findAgyBinary, readAgyResumeId } from "./runtime.js";
|
|
9
|
+
/**
|
|
10
|
+
* Open a multi-turn Antigravity session. Throws when `agy` is not installed.
|
|
11
|
+
* The process starts on the first `send()`.
|
|
12
|
+
*/
|
|
13
|
+
export async function createAntigravitySession(ctx) {
|
|
14
|
+
const binary = await findAgyBinary(ctx);
|
|
15
|
+
const config = ctx.config ?? {};
|
|
16
|
+
const instructions = await resolveInstructions(config.instructionsFile);
|
|
17
|
+
if (config.skillDirs && config.skillDirs.length > 0) {
|
|
18
|
+
try {
|
|
19
|
+
await injectHomeSkills(config.skillDirs, "antigravity");
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
// Non-fatal
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return new AntigravitySession(ctx, binary, instructions);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* One `agy --input-format stream-json --output-format stream-json` process
|
|
29
|
+
* holds the conversation across turns. The CLI has no control protocol, so
|
|
30
|
+
* an interrupt is a SIGINT (Ctrl+C); when that ends the process, the next
|
|
31
|
+
* `send()` starts a new one on the same conversation with `--conversation`.
|
|
32
|
+
*/
|
|
33
|
+
class AntigravitySession {
|
|
34
|
+
ctx;
|
|
35
|
+
binary;
|
|
36
|
+
_state = "idle";
|
|
37
|
+
conversationId;
|
|
38
|
+
connection = null;
|
|
39
|
+
parser = null;
|
|
40
|
+
active = null;
|
|
41
|
+
/** Events received from agy processes, to tell whether one saw a message. */
|
|
42
|
+
connectionEvents = 0;
|
|
43
|
+
draining = false;
|
|
44
|
+
/** Instructions go into the first message of a conversation this session starts. */
|
|
45
|
+
pendingInstructions;
|
|
46
|
+
cwd;
|
|
47
|
+
goals;
|
|
48
|
+
constructor(ctx, binary, instructions) {
|
|
49
|
+
this.ctx = ctx;
|
|
50
|
+
this.binary = binary;
|
|
51
|
+
this.cwd = ctx.cwd ?? process.cwd();
|
|
52
|
+
this.conversationId = readAgyResumeId(ctx.sessionParams, this.cwd);
|
|
53
|
+
this.pendingInstructions = this.conversationId ? null : instructions;
|
|
54
|
+
this.goals = new GoalController({
|
|
55
|
+
providerType: ANTIGRAVITY_PROVIDER_TYPE,
|
|
56
|
+
capability: EMULATED_GOAL_CAPABILITY,
|
|
57
|
+
getSessionId: () => this.sessionId,
|
|
58
|
+
send: (message) => this.send(message),
|
|
59
|
+
dispatch: (event) => void this.dispatch(event),
|
|
60
|
+
});
|
|
61
|
+
if (ctx.signal) {
|
|
62
|
+
if (ctx.signal.aborted)
|
|
63
|
+
void this.close();
|
|
64
|
+
else
|
|
65
|
+
ctx.signal.addEventListener("abort", () => void this.close(), { once: true });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
get sessionId() {
|
|
69
|
+
return this.parser?.conversationId ?? this.conversationId;
|
|
70
|
+
}
|
|
71
|
+
get state() {
|
|
72
|
+
return this._state;
|
|
73
|
+
}
|
|
74
|
+
async send(message, options) {
|
|
75
|
+
if (this._state === "closed")
|
|
76
|
+
throw new Error("Session is closed");
|
|
77
|
+
if (this.draining)
|
|
78
|
+
throw new Error("Session is draining — no new sends accepted");
|
|
79
|
+
if (this.active) {
|
|
80
|
+
throw new Error("Antigravity session is busy — a turn is already in progress (concurrentSend not supported)");
|
|
81
|
+
}
|
|
82
|
+
const uuid = uuidv7();
|
|
83
|
+
const turnId = uuidv7();
|
|
84
|
+
const abort = new AbortController();
|
|
85
|
+
const text = this.pendingInstructions ? `${this.pendingInstructions}\n\n${message}` : message;
|
|
86
|
+
this.pendingInstructions = null;
|
|
87
|
+
this._state = "thinking";
|
|
88
|
+
const done = this.runTurn(text, turnId, abort, options);
|
|
89
|
+
this.active = { turnId, abort, done };
|
|
90
|
+
void done.then((result) => this.goals.onTurnSettled(result)).catch(() => undefined);
|
|
91
|
+
return { uuid, result: done };
|
|
92
|
+
}
|
|
93
|
+
ensureConnection() {
|
|
94
|
+
if (this.connection?.alive)
|
|
95
|
+
return this.connection;
|
|
96
|
+
const config = this.ctx.config ?? {};
|
|
97
|
+
// A replacement process picks the conversation back up where it stopped.
|
|
98
|
+
this.conversationId = this.sessionId;
|
|
99
|
+
const parser = new AgyStreamParser({
|
|
100
|
+
includePartialMessages: config.includePartialMessages,
|
|
101
|
+
conversationId: this.conversationId,
|
|
102
|
+
});
|
|
103
|
+
const env = buildEnv(this.ctx.env);
|
|
104
|
+
ensurePathInEnv(env);
|
|
105
|
+
this.ctx.onLifecycle?.({ phase: "spawning" });
|
|
106
|
+
const connection = new AgyConnection({
|
|
107
|
+
command: this.binary.bin,
|
|
108
|
+
args: [
|
|
109
|
+
...this.binary.prefixArgs,
|
|
110
|
+
...buildAgyArgs(config, { resumeId: this.conversationId, model: config.model ?? null }),
|
|
111
|
+
],
|
|
112
|
+
cwd: this.cwd,
|
|
113
|
+
env,
|
|
114
|
+
parser,
|
|
115
|
+
// Lines a replaced process prints on its way out belong to no turn.
|
|
116
|
+
onEvent: async (event) => {
|
|
117
|
+
if (this.connection === connection)
|
|
118
|
+
await this.onEvent(event);
|
|
119
|
+
},
|
|
120
|
+
...(this.ctx.onOutput ? { onOutput: this.ctx.onOutput } : {}),
|
|
121
|
+
});
|
|
122
|
+
if (connection.pid != null)
|
|
123
|
+
this.ctx.onLifecycle?.({ phase: "running", pid: connection.pid });
|
|
124
|
+
this.connection = connection;
|
|
125
|
+
this.parser = parser;
|
|
126
|
+
return connection;
|
|
127
|
+
}
|
|
128
|
+
async runTurn(text, turnId, abort, options) {
|
|
129
|
+
await this.emitTurnEdge({ type: "turn_start", turnId, trigger: "send" });
|
|
130
|
+
const timeoutSec = options?.timeoutSec ?? this.ctx.config?.timeoutSec;
|
|
131
|
+
const graceSec = this.ctx.config?.graceSec;
|
|
132
|
+
let timer = null;
|
|
133
|
+
const guards = [
|
|
134
|
+
new Promise((resolve) => abort.signal.addEventListener("abort", () => resolve("aborted"), { once: true })),
|
|
135
|
+
];
|
|
136
|
+
if (timeoutSec && timeoutSec > 0) {
|
|
137
|
+
guards.push(new Promise((resolve) => { timer = setTimeout(() => resolve("timeout"), timeoutSec * 1000); }));
|
|
138
|
+
}
|
|
139
|
+
const onSendAbort = () => abort.abort();
|
|
140
|
+
if (options?.signal) {
|
|
141
|
+
if (options.signal.aborted)
|
|
142
|
+
abort.abort();
|
|
143
|
+
else
|
|
144
|
+
options.signal.addEventListener("abort", onSendAbort, { once: true });
|
|
145
|
+
}
|
|
146
|
+
let connection = this.ensureConnection();
|
|
147
|
+
try {
|
|
148
|
+
let result = null;
|
|
149
|
+
let reason = "result";
|
|
150
|
+
for (let attempt = 0; result === null; attempt++) {
|
|
151
|
+
const eventsBefore = this.connectionEvents;
|
|
152
|
+
const pending = connection.nextTurn();
|
|
153
|
+
connection.write(text);
|
|
154
|
+
const first = await Promise.race([pending, ...guards]);
|
|
155
|
+
if (first === "timeout" || first === "aborted") {
|
|
156
|
+
const outcome = await interruptAgyTurn(connection, pending, graceSec);
|
|
157
|
+
// agy may report INTERRUPTED and then exit. Learn which before the
|
|
158
|
+
// next send, so it never lands on a process that is going away.
|
|
159
|
+
if (outcome?.result)
|
|
160
|
+
await connection.waitForExit(500);
|
|
161
|
+
// Without an INTERRUPTED result the process was stopped; a late result
|
|
162
|
+
// from it must never settle the next turn.
|
|
163
|
+
if ((!outcome?.result || !connection.alive) && this.connection === connection)
|
|
164
|
+
this.connection = null;
|
|
165
|
+
result = {
|
|
166
|
+
summary: outcome?.result?.response.trim() || null,
|
|
167
|
+
...this.usageOf(outcome),
|
|
168
|
+
costUsd: null,
|
|
169
|
+
status: first,
|
|
170
|
+
errorCode: first,
|
|
171
|
+
errorMessage: first === "timeout" ? "Turn exceeded its timeout" : "Turn aborted",
|
|
172
|
+
};
|
|
173
|
+
reason = "cancelled";
|
|
174
|
+
}
|
|
175
|
+
else if (attempt === 0 && !first.result && first.exited && !first.authRequired
|
|
176
|
+
&& this.connectionEvents === eventsBefore && this._state !== "closed") {
|
|
177
|
+
// The process exited without ever acknowledging the message (it was
|
|
178
|
+
// already shutting down). Run it on a fresh process for the same
|
|
179
|
+
// conversation instead of failing a turn agy never started.
|
|
180
|
+
if (this.connection === connection)
|
|
181
|
+
this.connection = null;
|
|
182
|
+
connection = this.ensureConnection();
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
result = this.toTurnResult(first);
|
|
186
|
+
reason = first.result ? "result" : "session_closed";
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
await this.emitTurnEdge({ type: "turn_end", turnId, trigger: "send", reason });
|
|
190
|
+
return result;
|
|
191
|
+
}
|
|
192
|
+
finally {
|
|
193
|
+
if (timer)
|
|
194
|
+
clearTimeout(timer);
|
|
195
|
+
options?.signal?.removeEventListener("abort", onSendAbort);
|
|
196
|
+
this.active = null;
|
|
197
|
+
if (!connection.alive && this.connection === connection)
|
|
198
|
+
this.connection = null;
|
|
199
|
+
if (this._state !== "closed")
|
|
200
|
+
this._state = "idle";
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
usageOf(outcome) {
|
|
204
|
+
const usage = agyUsageRecord(outcome?.result?.turnUsage ?? null, this.parser?.model ?? this.ctx.config?.model ?? null);
|
|
205
|
+
return usage ? { usage } : {};
|
|
206
|
+
}
|
|
207
|
+
toTurnResult(outcome) {
|
|
208
|
+
const { result } = outcome;
|
|
209
|
+
if (result) {
|
|
210
|
+
const status = mapAgyTurnStatus(result.status);
|
|
211
|
+
if (status === "completed") {
|
|
212
|
+
return { summary: result.response.trim() || null, ...this.usageOf(outcome), costUsd: null, status, errorCode: null, errorMessage: null };
|
|
213
|
+
}
|
|
214
|
+
const errorCode = status === "aborted"
|
|
215
|
+
? "aborted"
|
|
216
|
+
: outcome.authRequired ? "auth_required" : classifyAgyFailure(result, outcome.agyError);
|
|
217
|
+
return {
|
|
218
|
+
summary: result.response.trim() || null,
|
|
219
|
+
...this.usageOf(outcome),
|
|
220
|
+
costUsd: null,
|
|
221
|
+
status,
|
|
222
|
+
errorCode,
|
|
223
|
+
errorMessage: errorCode === "auth_required"
|
|
224
|
+
? AGY_SIGN_IN_MESSAGE
|
|
225
|
+
: result.error ?? outcome.agyError?.message ?? `Antigravity turn ended with ${result.status}`,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
if (outcome.authRequired) {
|
|
229
|
+
return { summary: null, costUsd: null, status: "failed", errorCode: "auth_required", errorMessage: AGY_SIGN_IN_MESSAGE };
|
|
230
|
+
}
|
|
231
|
+
return {
|
|
232
|
+
summary: null,
|
|
233
|
+
costUsd: null,
|
|
234
|
+
status: "failed",
|
|
235
|
+
errorCode: "process_exited",
|
|
236
|
+
errorMessage: outcome.agyError?.message
|
|
237
|
+
?? firstAgyErrorLine(outcome.stderr)
|
|
238
|
+
?? `Antigravity CLI exited (code ${outcome.exitCode ?? "null"}${outcome.signal ? `, ${outcome.signal}` : ""}) before finishing the turn`,
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
async onEvent(event) {
|
|
242
|
+
this.connectionEvents++;
|
|
243
|
+
if (this._state !== "closed") {
|
|
244
|
+
if (event.type === "tool_call")
|
|
245
|
+
this._state = "tool_executing";
|
|
246
|
+
else if (event.type === "assistant" || event.type === "thinking" || event.type === "tool_result")
|
|
247
|
+
this._state = "thinking";
|
|
248
|
+
}
|
|
249
|
+
await this.dispatch(event);
|
|
250
|
+
}
|
|
251
|
+
async emitTurnEdge(edge) {
|
|
252
|
+
await this.dispatch({
|
|
253
|
+
...edge,
|
|
254
|
+
timestamp: new Date().toISOString(),
|
|
255
|
+
providerType: ANTIGRAVITY_PROVIDER_TYPE,
|
|
256
|
+
sessionId: this.sessionId,
|
|
257
|
+
messageId: null,
|
|
258
|
+
eventId: null,
|
|
259
|
+
parentToolCallId: null,
|
|
260
|
+
raw: {},
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
async dispatch(event) {
|
|
264
|
+
if (!this.ctx.onEvent)
|
|
265
|
+
return;
|
|
266
|
+
try {
|
|
267
|
+
await this.ctx.onEvent(event);
|
|
268
|
+
}
|
|
269
|
+
catch {
|
|
270
|
+
/* a throwing handler must not break the stream */
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
async cancel(_uuid) {
|
|
274
|
+
// One message per turn and no queue, so there is never a queued message to drop.
|
|
275
|
+
return { cancelled: false };
|
|
276
|
+
}
|
|
277
|
+
async stopTask(_taskId) {
|
|
278
|
+
return { stopped: false };
|
|
279
|
+
}
|
|
280
|
+
setGoal(objective, options) {
|
|
281
|
+
return this.goals.setGoal(objective, options);
|
|
282
|
+
}
|
|
283
|
+
clearGoal(options) {
|
|
284
|
+
return this.goals.clearGoal(options);
|
|
285
|
+
}
|
|
286
|
+
getGoal() {
|
|
287
|
+
return this.goals.getGoal();
|
|
288
|
+
}
|
|
289
|
+
async interrupt() {
|
|
290
|
+
const active = this.active;
|
|
291
|
+
if (!active)
|
|
292
|
+
return;
|
|
293
|
+
active.abort.abort();
|
|
294
|
+
await active.done.catch(() => undefined);
|
|
295
|
+
}
|
|
296
|
+
async drain() {
|
|
297
|
+
this.draining = true;
|
|
298
|
+
if (this.active)
|
|
299
|
+
await this.active.done.catch(() => undefined);
|
|
300
|
+
await this.close();
|
|
301
|
+
}
|
|
302
|
+
async close() {
|
|
303
|
+
if (this._state === "closed" && !this.connection)
|
|
304
|
+
return;
|
|
305
|
+
this._state = "closed";
|
|
306
|
+
const active = this.active;
|
|
307
|
+
if (active) {
|
|
308
|
+
active.abort.abort();
|
|
309
|
+
await active.done.catch(() => undefined);
|
|
310
|
+
}
|
|
311
|
+
const connection = this.connection;
|
|
312
|
+
this.connection = null;
|
|
313
|
+
if (connection)
|
|
314
|
+
await connection.terminate(this.ctx.config?.graceSec);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
//# sourceMappingURL=session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../../src/providers/antigravity/session.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhF,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,aAAa,EACb,iBA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":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/gemini/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AA0BrD,eAAO,MAAM,cAAc,gBAAS,CAAC"}
|
|
@@ -5,6 +5,12 @@ import { resolveAuthForProvider } from "../../utils/auth.js";
|
|
|
5
5
|
* `@google/gemini-cli` on PATH; Gemini handles its own Google auth (GEMINI_API_KEY,
|
|
6
6
|
* GOOGLE_API_KEY, or an OAuth login).
|
|
7
7
|
*
|
|
8
|
+
* Since 2026-06-18 Gemini CLI no longer serves free, Google AI Pro, or Google
|
|
9
|
+
* AI Ultra sign-ins ("This client is no longer supported for Gemini Code
|
|
10
|
+
* Assist for individuals"); those accounts moved to the Antigravity CLI — use
|
|
11
|
+
* the `antigravity` provider. Gemini CLI still works with a paid API key and
|
|
12
|
+
* Gemini Code Assist Standard/Enterprise.
|
|
13
|
+
*
|
|
8
14
|
* Replaces the previous one-shot `--output-format stream-json` adapter: the ACP
|
|
9
15
|
* base gives gemini real sessions, streaming, tool-call correlation, permission
|
|
10
16
|
* bridging (via `onUserInputRequest`), and mode discovery — none of which the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/gemini/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/providers/gemini/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,GAAmB,WAAW,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;AAE3F,iFAAiF;AACjF,iCAAiC;AACjC,MAAM,CAAC,WAAW,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,sBAAsB,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AAEpE,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC"}
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA0BjD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAOxD;AAED,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAExC;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAE/D"}
|
package/dist/registry.js
CHANGED
|
@@ -7,6 +7,7 @@ import { cursorProvider } from "./providers/cursor/index.js";
|
|
|
7
7
|
import { opencodeProvider } from "./providers/opencode/index.js";
|
|
8
8
|
import { piProvider } from "./providers/pi/index.js";
|
|
9
9
|
import { copilotProvider } from "./providers/copilot/index.js";
|
|
10
|
+
import { antigravityProvider } from "./providers/antigravity/index.js";
|
|
10
11
|
const providers = new Map();
|
|
11
12
|
// Pre-register built-in providers
|
|
12
13
|
providers.set("claude", claudeProvider);
|
|
@@ -18,6 +19,7 @@ providers.set("cursor", cursorProvider);
|
|
|
18
19
|
providers.set("opencode", opencodeProvider);
|
|
19
20
|
providers.set("pi", piProvider);
|
|
20
21
|
providers.set("copilot", copilotProvider);
|
|
22
|
+
providers.set("antigravity", antigravityProvider);
|
|
21
23
|
export function getProvider(type) {
|
|
22
24
|
const provider = providers.get(type);
|
|
23
25
|
if (!provider) {
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;A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AI,EAAE,QAAQ,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -608,8 +608,8 @@ export interface ProviderConfig {
|
|
|
608
608
|
model?: string;
|
|
609
609
|
/** Provider-native model variant, independent from reasoning effort. */
|
|
610
610
|
modelVariant?: string;
|
|
611
|
-
/** Provider reasoning effort. Claude
|
|
612
|
-
* it as the app-server `turn/start.effort` override. */
|
|
611
|
+
/** Provider reasoning effort. Claude and Antigravity map this to `--effort`;
|
|
612
|
+
* Codex sends it as the app-server `turn/start.effort` override. */
|
|
613
613
|
effort?: string;
|
|
614
614
|
/** Behavior when a host does not provide or loses its input callback. */
|
|
615
615
|
unattendedPermissionPolicy?: "allow" | "deny";
|
|
@@ -670,15 +670,16 @@ export interface ProviderConfig {
|
|
|
670
670
|
sandbox?: boolean;
|
|
671
671
|
thinking?: string;
|
|
672
672
|
/**
|
|
673
|
-
* Provider-specific mode pass-through.
|
|
674
|
-
* `--mode <mode>` flag. Don't use this for plan mode — set `planMode: true`
|
|
673
|
+
* Provider-specific mode pass-through. Used by `cursor` and `antigravity`
|
|
674
|
+
* for their `--mode <mode>` flag. Don't use this for plan mode — set `planMode: true`
|
|
675
675
|
* instead, which is the cross-provider abstraction.
|
|
676
676
|
*/
|
|
677
677
|
mode?: string;
|
|
678
678
|
/**
|
|
679
679
|
* Select a provider operating mode by id (one of `listModes()`). Honored by
|
|
680
680
|
* providers with `capabilities.modes === true` (codex collaboration modes,
|
|
681
|
-
* ACP session modes, copilot allow-all/agent/plan
|
|
681
|
+
* ACP session modes, copilot allow-all/agent/plan, antigravity
|
|
682
|
+
* default/accept-edits/plan). Ignored otherwise.
|
|
682
683
|
* Distinct from `mode` (cursor's raw `--mode` passthrough) and `planMode`
|
|
683
684
|
* (the cross-provider read-only abstraction).
|
|
684
685
|
*/
|