@simonepri/refined-antigravity-acp 0.1.0 → 0.1.2
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/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +56 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/index.server.d.ts +4 -0
- package/dist/index.server.d.ts.map +1 -0
- package/dist/index.server.js +7 -0
- package/dist/index.server.js.map +1 -0
- package/dist/src/agy-patch.d.ts +65 -0
- package/dist/src/agy-patch.d.ts.map +1 -0
- package/dist/src/agy-patch.js +351 -0
- package/dist/src/agy-patch.js.map +1 -0
- package/dist/src/auth.d.ts +27 -0
- package/dist/src/auth.d.ts.map +1 -0
- package/dist/src/auth.js +113 -0
- package/dist/src/auth.js.map +1 -0
- package/dist/src/command.d.ts +5 -0
- package/dist/src/command.d.ts.map +1 -0
- package/dist/src/command.js +74 -0
- package/dist/src/command.js.map +1 -0
- package/dist/src/connector.d.ts +188 -0
- package/dist/src/connector.d.ts.map +1 -0
- package/dist/src/connector.js +1138 -0
- package/dist/src/connector.js.map +1 -0
- package/dist/src/history.d.ts +12 -0
- package/dist/src/history.d.ts.map +1 -0
- package/dist/src/history.js +152 -0
- package/dist/src/history.js.map +1 -0
- package/dist/src/mcp-proxy.d.ts +83 -0
- package/dist/src/mcp-proxy.d.ts.map +1 -0
- package/dist/src/mcp-proxy.js +308 -0
- package/dist/src/mcp-proxy.js.map +1 -0
- package/dist/src/provider.d.ts +11 -0
- package/dist/src/provider.d.ts.map +1 -0
- package/dist/src/provider.js +31 -0
- package/dist/src/provider.js.map +1 -0
- package/dist/src/sanitize.d.ts +29 -0
- package/dist/src/sanitize.d.ts.map +1 -0
- package/dist/src/sanitize.js +237 -0
- package/dist/src/sanitize.js.map +1 -0
- package/dist/src/skills.d.ts +17 -0
- package/dist/src/skills.d.ts.map +1 -0
- package/dist/src/skills.js +140 -0
- package/dist/src/skills.js.map +1 -0
- package/dist/src/steering.d.ts +30 -0
- package/dist/src/steering.d.ts.map +1 -0
- package/dist/src/steering.js +174 -0
- package/dist/src/steering.js.map +1 -0
- package/package.json +20 -13
- package/paseo-plugin.json +0 -1
- package/readme.md +3 -5
- package/.fallowrc.json +0 -11
- package/.github/workflows/ci.yml +0 -24
- package/.github/workflows/release.yml +0 -41
- package/.oxlintignore +0 -2
- package/.oxlintrc.json +0 -152
- package/.release-please-manifest.json +0 -3
- package/bin/cli.ts +0 -58
- package/index.server.ts +0 -9
- package/pnpm-workspace.yaml +0 -44
- package/release-please-config.json +0 -13
- package/server/agy-patch.test.ts +0 -445
- package/server/agy-patch.ts +0 -445
- package/server/auth.test.ts +0 -51
- package/server/auth.ts +0 -122
- package/server/command.test.ts +0 -18
- package/server/command.ts +0 -92
- package/server/connector.test.ts +0 -1136
- package/server/connector.ts +0 -1386
- package/server/history.test.ts +0 -139
- package/server/history.ts +0 -157
- package/server/mcp-proxy.test.ts +0 -368
- package/server/mcp-proxy.ts +0 -375
- package/server/provider.test.ts +0 -11
- package/server/provider.ts +0 -37
- package/server/sanitize.test.ts +0 -174
- package/server/sanitize.ts +0 -286
- package/server/skills.test.ts +0 -121
- package/server/skills.ts +0 -183
- package/server/steering.test.ts +0 -405
- package/server/steering.ts +0 -199
- package/tsconfig.json +0 -14
package/server/command.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { execFileSync } from "node:child_process";
|
|
5
|
-
|
|
6
|
-
const BINARY_URLS: Record<string, string> = {
|
|
7
|
-
"darwin-arm64":
|
|
8
|
-
"https://dl.google.com/agy-extensions/releases/macos/agy-acp-server-agy_acp_server_1.1.1-darwin-arm64.zip",
|
|
9
|
-
"linux-x64":
|
|
10
|
-
"https://dl.google.com/agy-extensions/releases/linux/agy-acp-server-agy_acp_server_1.1.1-linux-x86_64.zip",
|
|
11
|
-
"linux-arm64":
|
|
12
|
-
"https://dl.google.com/agy-extensions/releases/linux/agy-acp-server-agy_acp_server_1.1.1-linux-arm64.zip",
|
|
13
|
-
"win32-x64":
|
|
14
|
-
"https://dl.google.com/agy-extensions/releases/windows/agy-acp-server-agy_acp_server_1.1.1-windows-x86_64.zip",
|
|
15
|
-
"win32-arm64":
|
|
16
|
-
"https://dl.google.com/agy-extensions/releases/windows/agy-acp-server-agy_acp_server_1.1.1-windows-arm64.zip",
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export function getPlatformKey(
|
|
20
|
-
platform: NodeJS.Platform = process.platform,
|
|
21
|
-
arch: string = process.arch,
|
|
22
|
-
): string | null {
|
|
23
|
-
const key = `${platform}-${arch}`;
|
|
24
|
-
return BINARY_URLS[key] ? key : null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function extractZip(zipPath: string, targetDir: string): void {
|
|
28
|
-
fs.mkdirSync(targetDir, { recursive: true, mode: 0o755 });
|
|
29
|
-
try {
|
|
30
|
-
execFileSync("tar", ["-xf", zipPath, "-C", targetDir], { stdio: "ignore" });
|
|
31
|
-
} catch {
|
|
32
|
-
execFileSync("unzip", ["-q", "-o", zipPath, "-d", targetDir], { stdio: "ignore" });
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
async function downloadBinaryZip(url: string): Promise<string> {
|
|
37
|
-
const res = await fetch(url, { signal: AbortSignal.timeout(30000) });
|
|
38
|
-
if (!res.ok || !res.body) {
|
|
39
|
-
throw new Error(`Failed to download Antigravity ACP binary: HTTP ${res.status}`);
|
|
40
|
-
}
|
|
41
|
-
const tempZip = path.join(os.tmpdir(), `agy-acp-${Date.now()}.zip`);
|
|
42
|
-
fs.writeFileSync(tempZip, Buffer.from(await res.arrayBuffer()));
|
|
43
|
-
return tempZip;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export async function ensureAntigravityBinary(): Promise<string> {
|
|
47
|
-
const platformKey = getPlatformKey();
|
|
48
|
-
const url = platformKey ? BINARY_URLS[platformKey] : null;
|
|
49
|
-
if (!url) {
|
|
50
|
-
throw new Error(
|
|
51
|
-
`Unsupported platform for Antigravity ACP: ${process.platform} (${process.arch})`,
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const installDir = path.join(os.homedir(), ".local", "share", "antigravity-acp");
|
|
56
|
-
const tempZip = await downloadBinaryZip(url);
|
|
57
|
-
try {
|
|
58
|
-
extractZip(tempZip, installDir);
|
|
59
|
-
} finally {
|
|
60
|
-
fs.rmSync(tempZip, { force: true });
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const binaryName = process.platform === "win32" ? "agy_acp_server.exe" : "agy_acp_server.par";
|
|
64
|
-
const binaryPath = path.join(installDir, binaryName);
|
|
65
|
-
if (process.platform !== "win32" && fs.existsSync(binaryPath)) {
|
|
66
|
-
fs.chmodSync(binaryPath, 0o755);
|
|
67
|
-
}
|
|
68
|
-
return binaryPath;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function resolveExecutable(platform: NodeJS.Platform, override?: string): string {
|
|
72
|
-
const trimmed = override?.trim();
|
|
73
|
-
if (trimmed) return trimmed;
|
|
74
|
-
const defaultName = platform === "win32" ? "agy_acp_server.exe" : "agy_acp_server.par";
|
|
75
|
-
const candidates = [
|
|
76
|
-
path.join(os.homedir(), ".local", "share", "antigravity-acp", defaultName),
|
|
77
|
-
path.join("/opt", "homebrew", "bin", defaultName),
|
|
78
|
-
path.join("/usr", "local", "bin", defaultName),
|
|
79
|
-
];
|
|
80
|
-
return candidates.find((p) => fs.existsSync(p)) ?? defaultName;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export function agyCommand(
|
|
84
|
-
platform: NodeJS.Platform = process.platform,
|
|
85
|
-
override = process.env.PASEO_AGY_ACP_BIN,
|
|
86
|
-
): readonly [string, ...string[]] {
|
|
87
|
-
if (platform !== "darwin" && platform !== "linux" && platform !== "win32") {
|
|
88
|
-
throw new Error(`Antigravity ACP server does not support ${platform}`);
|
|
89
|
-
}
|
|
90
|
-
const executable = resolveExecutable(platform, override);
|
|
91
|
-
return platform === "linux" ? [executable, "--uid="] : [executable];
|
|
92
|
-
}
|