pinokiod 7.3.0 → 7.3.3
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/kernel/api/github/index.js +444 -0
- package/kernel/api/index.js +199 -11
- package/kernel/api/process/index.js +124 -44
- package/kernel/api/shell_run_template.js +273 -0
- package/kernel/api/uri/index.js +51 -0
- package/kernel/bin/{conda-python.js → conda-pins.js} +23 -0
- package/kernel/bin/conda.js +15 -5
- package/kernel/bin/git.js +9 -10
- package/kernel/bin/huggingface.js +1 -1
- package/kernel/bin/index.js +5 -2
- package/kernel/bin/zip.js +9 -1
- package/kernel/connect/providers/github/README.md +5 -4
- package/kernel/environment.js +195 -92
- package/kernel/git.js +98 -19
- package/kernel/gitconfig_template +7 -0
- package/kernel/gpu/amd.js +72 -0
- package/kernel/gpu/apple.js +8 -0
- package/kernel/gpu/common.js +12 -0
- package/kernel/gpu/intel.js +47 -0
- package/kernel/gpu/nvidia.js +8 -0
- package/kernel/index.js +11 -1
- package/kernel/managed_skills.js +871 -0
- package/kernel/plugin.js +6 -58
- package/kernel/plugin_sources.js +316 -0
- package/kernel/resource_usage/gpu.js +349 -0
- package/kernel/resource_usage/index.js +322 -0
- package/kernel/resource_usage/macos_footprint.js +197 -0
- package/kernel/resource_usage/preferences.js +92 -0
- package/kernel/resource_usage/process_tree.js +303 -0
- package/kernel/scripts/git/create +4 -4
- package/kernel/scripts/git/fork +7 -8
- package/kernel/shell.js +23 -2
- package/kernel/shells.js +41 -0
- package/kernel/sysinfo.js +62 -9
- package/kernel/util.js +60 -0
- package/package.json +1 -1
- package/server/index.js +984 -156
- package/server/lib/app_log_report.js +543 -0
- package/server/lib/content_validation.js +55 -33
- package/server/lib/launcher_instruction_bootstrap.js +4 -96
- package/server/lib/terminal_session_helpers.js +0 -3
- package/server/public/common.js +77 -31
- package/server/public/create-launcher.js +4 -32
- package/server/public/logs.js +1428 -0
- package/server/public/nav.js +7 -0
- package/server/public/plugin-detail.js +93 -10
- package/server/public/privacy_filter_worker.js +391 -0
- package/server/public/style.css +1104 -154
- package/server/public/task-launcher.js +8 -29
- package/server/public/universal-launcher.css +8 -6
- package/server/public/universal-launcher.js +3 -27
- package/server/routes/apps.js +195 -1
- package/server/views/app.ejs +3041 -717
- package/server/views/autolaunch.ejs +917 -0
- package/server/views/bootstrap.ejs +7 -1
- package/server/views/d.ejs +408 -65
- package/server/views/editor.ejs +85 -19
- package/server/views/index.ejs +661 -111
- package/server/views/init/index.ejs +1 -1
- package/server/views/install.ejs +1 -1
- package/server/views/logs.ejs +164 -86
- package/server/views/net.ejs +7 -1
- package/server/views/partials/d_terminal_column.ejs +2 -2
- package/server/views/partials/d_terminal_options.ejs +0 -8
- package/server/views/partials/fs_status.ejs +47 -0
- package/server/views/partials/home_action_modal.ejs +86 -0
- package/server/views/partials/home_run_menu.ejs +87 -0
- package/server/views/partials/main_sidebar.ejs +2 -0
- package/server/views/partials/menu.ejs +1 -1
- package/server/views/plugin_detail.ejs +19 -4
- package/server/views/plugins.ejs +201 -3
- package/server/views/pre.ejs +1 -1
- package/server/views/pro.ejs +1 -1
- package/server/views/shell.ejs +40 -18
- package/server/views/skills.ejs +506 -0
- package/server/views/terminal.ejs +45 -19
- package/spec/INSTRUCTION_SYNC.md +20 -10
- package/system/plugin/antigravity-cli/antigravity.png +0 -0
- package/system/plugin/antigravity-cli/common.js +155 -0
- package/system/plugin/antigravity-cli/install.js +272 -0
- package/system/plugin/antigravity-cli/pinokio.js +13 -0
- package/system/plugin/antigravity-cli-auto/antigravity.png +0 -0
- package/system/plugin/antigravity-cli-auto/pinokio.js +13 -0
- package/system/plugin/claude/claude.png +0 -0
- package/system/plugin/claude/pinokio.js +47 -0
- package/system/plugin/claude-auto/claude.png +0 -0
- package/system/plugin/claude-auto/pinokio.js +58 -0
- package/system/plugin/claude-desktop/icon.jpeg +0 -0
- package/system/plugin/claude-desktop/pinokio.js +23 -0
- package/system/plugin/codex/openai.webp +0 -0
- package/system/plugin/codex/pinokio.js +42 -0
- package/system/plugin/codex-auto/openai.webp +0 -0
- package/system/plugin/codex-auto/pinokio.js +49 -0
- package/system/plugin/codex-desktop/icon.png +0 -0
- package/system/plugin/codex-desktop/pinokio.js +23 -0
- package/system/plugin/crush/crush.png +0 -0
- package/system/plugin/crush/pinokio.js +15 -0
- package/system/plugin/cursor/cursor.jpeg +0 -0
- package/system/plugin/cursor/pinokio.js +23 -0
- package/system/plugin/qwen/pinokio.js +34 -0
- package/system/plugin/qwen/qwen.png +0 -0
- package/system/plugin/vscode/pinokio.js +20 -0
- package/system/plugin/vscode/vscode.png +0 -0
- package/system/plugin/windsurf/pinokio.js +23 -0
- package/system/plugin/windsurf/windsurf.png +0 -0
- package/test/antigravity-cli-plugin.test.js +185 -0
- package/test/app-api.test.js +239 -0
- package/test/app-log-report.test.js +67 -0
- package/test/environment-cache-preflight.test.js +98 -0
- package/test/git-bin.test.js +59 -0
- package/test/git-defaults.test.js +97 -0
- package/test/github-api.test.js +158 -0
- package/test/github-connection.test.js +117 -0
- package/test/huggingface-bin.test.js +25 -0
- package/test/managed-skills.test.js +351 -0
- package/test/plugin-action-functions.test.js +337 -0
- package/test/plugin-dev-iframe.test.js +17 -0
- package/test/plugin-sources.test.js +203 -0
- package/test/privacy-filter-worker-heuristics.test.js +69 -0
- package/test/process-wait.test.js +169 -0
- package/test/script-api.test.js +97 -0
- package/test/shell-api.test.js +134 -0
- package/test/shell-run-template.test.js +209 -0
- package/test/storage-api.test.js +137 -0
- package/test/uri-api.test.js +100 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
const fs = require("fs")
|
|
2
|
+
const path = require("path")
|
|
3
|
+
|
|
4
|
+
const MANAGED_DIR_PARTS = ["bin", "antigravity-cli"]
|
|
5
|
+
|
|
6
|
+
function installDir(kernel) {
|
|
7
|
+
return kernel.path("bin")
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function managedDir(kernel) {
|
|
11
|
+
return kernel.path(...MANAGED_DIR_PARTS)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function binaryPath(kernel, platform) {
|
|
15
|
+
return kernel.path("bin", platform === "win32" ? "agy.exe" : "agy")
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function currentPlatform(kernel) {
|
|
19
|
+
return kernel.platform
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function metadataPath(kernel) {
|
|
23
|
+
return path.join(managedDir(kernel), "install.json")
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function installerPath() {
|
|
27
|
+
return path.join(__dirname, "install.js")
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function shellQuote(value) {
|
|
31
|
+
return `'${String(value).replace(/'/g, "'\\''")}'`
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function powershellQuote(value) {
|
|
35
|
+
return `'${String(value).replace(/'/g, "''")}'`
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function promptFor(context) {
|
|
39
|
+
const args = context && context.args ? context.args : {}
|
|
40
|
+
const input = context && context.input ? context.input : {}
|
|
41
|
+
return args.prompt || input.prompt || ""
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function workspaceFor(context, kernel) {
|
|
45
|
+
const args = context && context.args ? context.args : {}
|
|
46
|
+
return args.cwd || kernel.path("home")
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function installSteps(kernel) {
|
|
50
|
+
return [{
|
|
51
|
+
id: "install",
|
|
52
|
+
method: "shell.run",
|
|
53
|
+
params: {
|
|
54
|
+
conda: { skip: true },
|
|
55
|
+
message: {
|
|
56
|
+
_: [
|
|
57
|
+
process.execPath,
|
|
58
|
+
installerPath(),
|
|
59
|
+
"--install-dir",
|
|
60
|
+
installDir(kernel),
|
|
61
|
+
"--managed-dir",
|
|
62
|
+
managedDir(kernel),
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
path: kernel.path(),
|
|
66
|
+
buffer: 1024,
|
|
67
|
+
}
|
|
68
|
+
}]
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function uninstallSteps(kernel) {
|
|
72
|
+
const dir = installDir(kernel)
|
|
73
|
+
const managed = managedDir(kernel)
|
|
74
|
+
const platform = currentPlatform(kernel)
|
|
75
|
+
const bin = binaryPath(kernel, platform)
|
|
76
|
+
if (platform === "win32") {
|
|
77
|
+
return [{
|
|
78
|
+
id: "uninstall",
|
|
79
|
+
method: "shell.run",
|
|
80
|
+
params: {
|
|
81
|
+
shell: "powershell",
|
|
82
|
+
conda: { skip: true },
|
|
83
|
+
message: `Remove-Item -Force ${powershellQuote(bin)} -ErrorAction SilentlyContinue\nRemove-Item -Recurse -Force ${powershellQuote(managed)} -ErrorAction SilentlyContinue\nWrite-Host "Antigravity CLI removed from ${dir}"`,
|
|
84
|
+
path: kernel.path("bin"),
|
|
85
|
+
}
|
|
86
|
+
}]
|
|
87
|
+
}
|
|
88
|
+
return [{
|
|
89
|
+
id: "uninstall",
|
|
90
|
+
method: "shell.run",
|
|
91
|
+
params: {
|
|
92
|
+
conda: { skip: true },
|
|
93
|
+
message: `rm -f ${shellQuote(bin)}\nrm -rf ${shellQuote(managed)}\necho "Antigravity CLI removed from ${dir}"`,
|
|
94
|
+
path: kernel.path("bin"),
|
|
95
|
+
}
|
|
96
|
+
}]
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function installed(kernel) {
|
|
100
|
+
return fs.existsSync(binaryPath(kernel, currentPlatform(kernel)))
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function pluginDetailHref(options = {}) {
|
|
104
|
+
const pluginName = options.auto ? "antigravity-cli-auto" : "antigravity-cli"
|
|
105
|
+
return `/plugin?path=${encodeURIComponent(`/pinokio/run/plugin/${pluginName}/pinokio.js`)}&next=install`
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function runSteps(kernel, info, context, options = {}) {
|
|
109
|
+
const bin = binaryPath(kernel, currentPlatform(kernel))
|
|
110
|
+
if (!fs.existsSync(bin)) {
|
|
111
|
+
return [{
|
|
112
|
+
method: "notify",
|
|
113
|
+
params: {
|
|
114
|
+
html: "Antigravity CLI is not installed in Pinokio. Open the plugin page and click Install.",
|
|
115
|
+
href: pluginDetailHref(options),
|
|
116
|
+
target: "_parent",
|
|
117
|
+
type: "warning",
|
|
118
|
+
}
|
|
119
|
+
}]
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const message = [bin]
|
|
123
|
+
if (options.auto) {
|
|
124
|
+
message.push("--dangerously-skip-permissions")
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const prompt = promptFor(context)
|
|
128
|
+
if (prompt) {
|
|
129
|
+
message.push("--prompt-interactive", prompt)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return [{
|
|
133
|
+
id: "run",
|
|
134
|
+
method: "shell.run",
|
|
135
|
+
params: {
|
|
136
|
+
conda: { skip: true },
|
|
137
|
+
message: { _: message },
|
|
138
|
+
path: workspaceFor(context, kernel),
|
|
139
|
+
buffer: 1024,
|
|
140
|
+
input: true,
|
|
141
|
+
}
|
|
142
|
+
}]
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
module.exports = {
|
|
146
|
+
binaryPath,
|
|
147
|
+
installDir,
|
|
148
|
+
installed,
|
|
149
|
+
installerPath,
|
|
150
|
+
installSteps,
|
|
151
|
+
metadataPath,
|
|
152
|
+
pluginDetailHref,
|
|
153
|
+
runSteps,
|
|
154
|
+
uninstallSteps,
|
|
155
|
+
}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
const fs = require("fs")
|
|
2
|
+
const fsp = require("fs/promises")
|
|
3
|
+
const path = require("path")
|
|
4
|
+
const crypto = require("crypto")
|
|
5
|
+
const https = require("https")
|
|
6
|
+
const childProcess = require("child_process")
|
|
7
|
+
|
|
8
|
+
const GITHUB_LATEST_RELEASE_API = "https://api.github.com/repos/google-antigravity/antigravity-cli/releases/latest"
|
|
9
|
+
|
|
10
|
+
function usage() {
|
|
11
|
+
return "Usage: node install.js --install-dir <path> --managed-dir <path>"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function parseArgs(argv) {
|
|
15
|
+
const args = {}
|
|
16
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
17
|
+
const key = argv[i]
|
|
18
|
+
const value = argv[i + 1]
|
|
19
|
+
if (key === "--install-dir") {
|
|
20
|
+
args.installDir = value
|
|
21
|
+
i += 1
|
|
22
|
+
} else if (key === "--managed-dir") {
|
|
23
|
+
args.managedDir = value
|
|
24
|
+
i += 1
|
|
25
|
+
} else {
|
|
26
|
+
throw new Error("Unknown argument: " + key + "\n" + usage())
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (!args.installDir || !args.managedDir) {
|
|
30
|
+
throw new Error(usage())
|
|
31
|
+
}
|
|
32
|
+
return args
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function requestBuffer(url, redirectsLeft = 5) {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
const headers = {
|
|
38
|
+
"User-Agent": "Pinokio Antigravity CLI installer",
|
|
39
|
+
"Accept": "application/vnd.github+json, application/octet-stream"
|
|
40
|
+
}
|
|
41
|
+
const request = https.get(url, { headers }, (response) => {
|
|
42
|
+
const statusCode = response.statusCode || 0
|
|
43
|
+
const location = response.headers.location
|
|
44
|
+
if (statusCode >= 300 && statusCode < 400 && location) {
|
|
45
|
+
response.resume()
|
|
46
|
+
if (redirectsLeft <= 0) {
|
|
47
|
+
reject(new Error("Too many redirects while fetching " + url))
|
|
48
|
+
return
|
|
49
|
+
}
|
|
50
|
+
const nextUrl = new URL(location, url).toString()
|
|
51
|
+
requestBuffer(nextUrl, redirectsLeft - 1).then(resolve, reject)
|
|
52
|
+
return
|
|
53
|
+
}
|
|
54
|
+
if (statusCode < 200 || statusCode >= 300) {
|
|
55
|
+
const chunks = []
|
|
56
|
+
response.on("data", (chunk) => chunks.push(chunk))
|
|
57
|
+
response.on("end", () => {
|
|
58
|
+
reject(new Error("Request failed " + statusCode + " for " + url + ": " + Buffer.concat(chunks).toString("utf8").slice(0, 300)))
|
|
59
|
+
})
|
|
60
|
+
return
|
|
61
|
+
}
|
|
62
|
+
const chunks = []
|
|
63
|
+
response.on("data", (chunk) => chunks.push(chunk))
|
|
64
|
+
response.on("end", () => resolve(Buffer.concat(chunks)))
|
|
65
|
+
})
|
|
66
|
+
request.on("error", reject)
|
|
67
|
+
request.setTimeout(120000, () => {
|
|
68
|
+
request.destroy(new Error("Timed out fetching " + url))
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function fetchJson(url) {
|
|
74
|
+
const body = await requestBuffer(url)
|
|
75
|
+
return JSON.parse(body.toString("utf8"))
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async function downloadFile(url, destination) {
|
|
79
|
+
const body = await requestBuffer(url)
|
|
80
|
+
await fsp.writeFile(destination, body)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function assetNameForPlatform() {
|
|
84
|
+
const arch = process.arch === "arm64" ? "arm64" : process.arch === "x64" ? "x64" : ""
|
|
85
|
+
if (!arch) {
|
|
86
|
+
throw new Error("Unsupported CPU architecture: " + process.arch)
|
|
87
|
+
}
|
|
88
|
+
if (process.platform === "darwin") return "agy_cli_mac_" + arch + ".tar.gz"
|
|
89
|
+
if (process.platform === "linux") return "agy_cli_linux_" + arch + ".tar.gz"
|
|
90
|
+
if (process.platform === "win32") return "agy_cli_windows_" + arch + ".zip"
|
|
91
|
+
throw new Error("Unsupported OS: " + process.platform)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
async function readMetadata(metadataPath) {
|
|
95
|
+
try {
|
|
96
|
+
return JSON.parse(await fsp.readFile(metadataPath, "utf8"))
|
|
97
|
+
} catch (_) {
|
|
98
|
+
return null
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
async function sha256File(filepath) {
|
|
103
|
+
return new Promise((resolve, reject) => {
|
|
104
|
+
const hash = crypto.createHash("sha256")
|
|
105
|
+
const stream = fs.createReadStream(filepath)
|
|
106
|
+
stream.on("data", (chunk) => hash.update(chunk))
|
|
107
|
+
stream.on("error", reject)
|
|
108
|
+
stream.on("end", () => resolve(hash.digest("hex")))
|
|
109
|
+
})
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function run(command, args) {
|
|
113
|
+
childProcess.execFileSync(command, args, { stdio: "inherit" })
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function runQuiet(command, args) {
|
|
117
|
+
childProcess.execFileSync(command, args, { stdio: "ignore" })
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function powershellLiteral(value) {
|
|
121
|
+
return "'" + String(value).replace(/'/g, "''") + "'"
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
async function extractPayload(assetName, payloadPath, extractDir) {
|
|
125
|
+
await fsp.mkdir(extractDir, { recursive: true })
|
|
126
|
+
if (assetName.endsWith(".tar.gz")) {
|
|
127
|
+
run("tar", ["-xzf", payloadPath, "-C", extractDir])
|
|
128
|
+
return
|
|
129
|
+
}
|
|
130
|
+
if (assetName.endsWith(".zip")) {
|
|
131
|
+
try {
|
|
132
|
+
run("tar", ["-xf", payloadPath, "-C", extractDir])
|
|
133
|
+
return
|
|
134
|
+
} catch (tarError) {
|
|
135
|
+
if (process.platform === "win32") {
|
|
136
|
+
run("powershell", [
|
|
137
|
+
"-NoLogo",
|
|
138
|
+
"-NoProfile",
|
|
139
|
+
"-ExecutionPolicy",
|
|
140
|
+
"Bypass",
|
|
141
|
+
"-Command",
|
|
142
|
+
"$ErrorActionPreference='Stop'; Expand-Archive -LiteralPath " + powershellLiteral(payloadPath) + " -DestinationPath " + powershellLiteral(extractDir) + " -Force"
|
|
143
|
+
])
|
|
144
|
+
return
|
|
145
|
+
}
|
|
146
|
+
run("unzip", ["-o", payloadPath, "-d", extractDir])
|
|
147
|
+
return
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
throw new Error("Unsupported Antigravity CLI release asset: " + assetName)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
async function findExtractedBinary(root) {
|
|
154
|
+
const names = process.platform === "win32"
|
|
155
|
+
? new Set(["agy.exe", "antigravity.exe"])
|
|
156
|
+
: new Set(["agy", "antigravity"])
|
|
157
|
+
const queue = [root]
|
|
158
|
+
while (queue.length > 0) {
|
|
159
|
+
const current = queue.shift()
|
|
160
|
+
const entries = await fsp.readdir(current, { withFileTypes: true })
|
|
161
|
+
for (const entry of entries) {
|
|
162
|
+
const full = path.join(current, entry.name)
|
|
163
|
+
if (entry.isDirectory()) {
|
|
164
|
+
queue.push(full)
|
|
165
|
+
} else if (entry.isFile() && names.has(entry.name.toLowerCase())) {
|
|
166
|
+
return full
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
throw new Error("Release asset did not contain an agy binary.")
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async function writeMetadata(metadataPath, release, asset) {
|
|
174
|
+
const payload = {
|
|
175
|
+
version: release.tag_name || release.name || "",
|
|
176
|
+
asset: asset.name,
|
|
177
|
+
digest: asset.digest || "",
|
|
178
|
+
source: asset.browser_download_url || "",
|
|
179
|
+
release_url: release.html_url || "",
|
|
180
|
+
installed_at: new Date().toISOString()
|
|
181
|
+
}
|
|
182
|
+
await fsp.writeFile(metadataPath, JSON.stringify(payload, null, 2) + "\n", "utf8")
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
async function install(options) {
|
|
186
|
+
const installDir = options.installDir
|
|
187
|
+
const managedDir = options.managedDir
|
|
188
|
+
const binPath = path.join(installDir, process.platform === "win32" ? "agy.exe" : "agy")
|
|
189
|
+
const metadataPath = path.join(managedDir, "install.json")
|
|
190
|
+
const stagingDir = path.join(managedDir, ".staging")
|
|
191
|
+
|
|
192
|
+
await fsp.mkdir(installDir, { recursive: true })
|
|
193
|
+
await fsp.mkdir(managedDir, { recursive: true })
|
|
194
|
+
|
|
195
|
+
console.log("Fetching latest Antigravity CLI release from GitHub...")
|
|
196
|
+
const release = await fetchJson(GITHUB_LATEST_RELEASE_API)
|
|
197
|
+
const assetName = assetNameForPlatform()
|
|
198
|
+
const asset = Array.isArray(release.assets)
|
|
199
|
+
? release.assets.find((candidate) => candidate && candidate.name === assetName)
|
|
200
|
+
: null
|
|
201
|
+
if (!asset || !asset.browser_download_url) {
|
|
202
|
+
throw new Error("No Antigravity CLI release asset found for " + assetName)
|
|
203
|
+
}
|
|
204
|
+
if (typeof asset.digest !== "string" || !asset.digest.startsWith("sha256:")) {
|
|
205
|
+
throw new Error("GitHub release asset is missing a SHA-256 digest: " + assetName)
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const metadata = await readMetadata(metadataPath)
|
|
209
|
+
if (
|
|
210
|
+
metadata &&
|
|
211
|
+
metadata.version === (release.tag_name || release.name || "") &&
|
|
212
|
+
metadata.asset === asset.name &&
|
|
213
|
+
metadata.digest === asset.digest &&
|
|
214
|
+
fs.existsSync(binPath)
|
|
215
|
+
) {
|
|
216
|
+
console.log("Antigravity CLI " + metadata.version + " is already installed at " + binPath)
|
|
217
|
+
try {
|
|
218
|
+
run(binPath, ["--version"])
|
|
219
|
+
} catch (_) {
|
|
220
|
+
}
|
|
221
|
+
return
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
await fsp.rm(stagingDir, { recursive: true, force: true })
|
|
225
|
+
await fsp.mkdir(stagingDir, { recursive: true })
|
|
226
|
+
const payloadPath = path.join(stagingDir, asset.name)
|
|
227
|
+
const extractDir = path.join(stagingDir, "extract")
|
|
228
|
+
|
|
229
|
+
console.log("Downloading " + asset.name + " from GitHub release " + (release.tag_name || release.name || "latest") + "...")
|
|
230
|
+
await downloadFile(asset.browser_download_url, payloadPath)
|
|
231
|
+
|
|
232
|
+
const actualDigest = "sha256:" + await sha256File(payloadPath)
|
|
233
|
+
if (actualDigest.toLowerCase() !== asset.digest.toLowerCase()) {
|
|
234
|
+
throw new Error("Checksum mismatch for Antigravity CLI. Expected " + asset.digest + ", got " + actualDigest)
|
|
235
|
+
}
|
|
236
|
+
console.log("Download verified with " + asset.digest)
|
|
237
|
+
|
|
238
|
+
await extractPayload(asset.name, payloadPath, extractDir)
|
|
239
|
+
const extractedBinary = await findExtractedBinary(extractDir)
|
|
240
|
+
const nextBinary = binPath + ".next"
|
|
241
|
+
|
|
242
|
+
await fsp.rm(nextBinary, { force: true })
|
|
243
|
+
await fsp.copyFile(extractedBinary, nextBinary)
|
|
244
|
+
if (process.platform !== "win32") {
|
|
245
|
+
await fsp.chmod(nextBinary, 0o755)
|
|
246
|
+
}
|
|
247
|
+
await fsp.rename(nextBinary, binPath)
|
|
248
|
+
if (process.platform === "darwin") {
|
|
249
|
+
try {
|
|
250
|
+
runQuiet("xattr", ["-d", "com.apple.quarantine", binPath])
|
|
251
|
+
} catch (_) {
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
await writeMetadata(metadataPath, release, asset)
|
|
256
|
+
await fsp.rm(stagingDir, { recursive: true, force: true })
|
|
257
|
+
console.log("Antigravity CLI installed at " + binPath)
|
|
258
|
+
run(binPath, ["--version"])
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (require.main === module) {
|
|
262
|
+
install(parseArgs(process.argv.slice(2))).catch((error) => {
|
|
263
|
+
console.error(error && error.stack ? error.stack : String(error))
|
|
264
|
+
process.exit(1)
|
|
265
|
+
})
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
module.exports = {
|
|
269
|
+
assetNameForPlatform,
|
|
270
|
+
install,
|
|
271
|
+
parseArgs,
|
|
272
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const antigravity = require("./common")
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
title: "Antigravity CLI",
|
|
5
|
+
icon: "antigravity.png",
|
|
6
|
+
description: "Antigravity agents in the terminal.",
|
|
7
|
+
link: "https://antigravity.google/product/antigravity-cli",
|
|
8
|
+
install: antigravity.installSteps,
|
|
9
|
+
update: antigravity.installSteps,
|
|
10
|
+
uninstall: antigravity.uninstallSteps,
|
|
11
|
+
installed: antigravity.installed,
|
|
12
|
+
run: antigravity.runSteps,
|
|
13
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const antigravity = require("../antigravity-cli/common")
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
title: "Antigravity CLI Auto",
|
|
5
|
+
icon: "antigravity.png",
|
|
6
|
+
description: "Antigravity CLI with tool permission prompts skipped.",
|
|
7
|
+
link: "https://antigravity.google/product/antigravity-cli",
|
|
8
|
+
install: antigravity.installSteps,
|
|
9
|
+
update: antigravity.installSteps,
|
|
10
|
+
uninstall: antigravity.uninstallSteps,
|
|
11
|
+
installed: antigravity.installed,
|
|
12
|
+
run: (kernel, info, context) => antigravity.runSteps(kernel, info, context, { auto: true }),
|
|
13
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
title: "Claude Code",
|
|
3
|
+
icon: "claude.png",
|
|
4
|
+
link: "https://www.anthropic.com/claude-code",
|
|
5
|
+
run: [{
|
|
6
|
+
when: "{{platform === 'win32'}}",
|
|
7
|
+
id: "run",
|
|
8
|
+
method: "shell.run",
|
|
9
|
+
params: {
|
|
10
|
+
shell: "{{kernel.path('bin/miniconda/Library/bin/bash.exe')}}",
|
|
11
|
+
conda: {
|
|
12
|
+
skip: true
|
|
13
|
+
},
|
|
14
|
+
env: {
|
|
15
|
+
CLAUDE_CODE_GIT_BASH_PATH: "{{kernel.path('bin/miniconda/Library/bin/bash.exe')}}"
|
|
16
|
+
},
|
|
17
|
+
message: {
|
|
18
|
+
_: [
|
|
19
|
+
"npx",
|
|
20
|
+
"-y",
|
|
21
|
+
"@anthropic-ai/claude-code@latest",
|
|
22
|
+
"{{args.prompt || undefined}}"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
path: "{{args.cwd}}",
|
|
26
|
+
input: true,
|
|
27
|
+
buffer: 1024
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
when: "{{platform !== 'win32'}}",
|
|
31
|
+
id: "run",
|
|
32
|
+
method: "shell.run",
|
|
33
|
+
params: {
|
|
34
|
+
message: {
|
|
35
|
+
_: [
|
|
36
|
+
"npx",
|
|
37
|
+
"-y",
|
|
38
|
+
"@anthropic-ai/claude-code@latest",
|
|
39
|
+
"{{args.prompt || undefined}}"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
path: "{{args.cwd}}",
|
|
43
|
+
input: true,
|
|
44
|
+
buffer: 1024
|
|
45
|
+
}
|
|
46
|
+
}]
|
|
47
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
title: "Claude Code Auto",
|
|
3
|
+
icon: "claude.png",
|
|
4
|
+
description: "Claude Code with trusted workspace and bypass permissions prompts skipped.",
|
|
5
|
+
link: "https://www.anthropic.com/claude-code",
|
|
6
|
+
run: [{
|
|
7
|
+
when: "{{platform === 'win32'}}",
|
|
8
|
+
id: "run",
|
|
9
|
+
method: "shell.run",
|
|
10
|
+
params: {
|
|
11
|
+
shell: "{{kernel.path('bin/miniconda/Library/bin/bash.exe')}}",
|
|
12
|
+
conda: {
|
|
13
|
+
skip: true
|
|
14
|
+
},
|
|
15
|
+
env: {
|
|
16
|
+
CLAUDE_CODE_GIT_BASH_PATH: "{{kernel.path('bin/miniconda/Library/bin/bash.exe')}}",
|
|
17
|
+
CLAUBBIT: "true"
|
|
18
|
+
},
|
|
19
|
+
message: {
|
|
20
|
+
_: [
|
|
21
|
+
"npx",
|
|
22
|
+
"-y",
|
|
23
|
+
"@anthropic-ai/claude-code@latest",
|
|
24
|
+
"--settings",
|
|
25
|
+
"{\"skipDangerousModePermissionPrompt\":true}",
|
|
26
|
+
"--dangerously-skip-permissions",
|
|
27
|
+
"{{args.prompt || undefined}}"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
path: "{{args.cwd}}",
|
|
31
|
+
input: true,
|
|
32
|
+
buffer: 1024
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
when: "{{platform !== 'win32'}}",
|
|
36
|
+
id: "run",
|
|
37
|
+
method: "shell.run",
|
|
38
|
+
params: {
|
|
39
|
+
env: {
|
|
40
|
+
CLAUBBIT: "true"
|
|
41
|
+
},
|
|
42
|
+
message: {
|
|
43
|
+
_: [
|
|
44
|
+
"npx",
|
|
45
|
+
"-y",
|
|
46
|
+
"@anthropic-ai/claude-code@latest",
|
|
47
|
+
"--settings",
|
|
48
|
+
"{\"skipDangerousModePermissionPrompt\":true}",
|
|
49
|
+
"--dangerously-skip-permissions",
|
|
50
|
+
"{{args.prompt || undefined}}"
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
path: "{{args.cwd}}",
|
|
54
|
+
input: true,
|
|
55
|
+
buffer: 1024
|
|
56
|
+
}
|
|
57
|
+
}]
|
|
58
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
title: "Claude Desktop",
|
|
3
|
+
link: "https://claude.com/download",
|
|
4
|
+
icon: "icon.jpeg",
|
|
5
|
+
description: "Claude desktop",
|
|
6
|
+
launch_type: "desktop",
|
|
7
|
+
run: [{
|
|
8
|
+
method: "uri.open",
|
|
9
|
+
params: {
|
|
10
|
+
uri: "claude://code/new",
|
|
11
|
+
params: {
|
|
12
|
+
q: "{{args.prompt || ''}}",
|
|
13
|
+
folder: "{{args.cwd || ''}}"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}, {
|
|
17
|
+
method: "process.wait",
|
|
18
|
+
params: {
|
|
19
|
+
title: "Launched",
|
|
20
|
+
description: "Click the stop button to stop watching file changes"
|
|
21
|
+
}
|
|
22
|
+
}]
|
|
23
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
title: "OpenAI Codex",
|
|
3
|
+
icon: "openai.webp",
|
|
4
|
+
link: "https://github.com/openai/codex",
|
|
5
|
+
run: [{
|
|
6
|
+
when: "{{platform === 'win32'}}",
|
|
7
|
+
id: "run",
|
|
8
|
+
method: "shell.run",
|
|
9
|
+
params: {
|
|
10
|
+
shell: "{{kernel.path('bin/miniconda/Library/bin/bash.exe')}}",
|
|
11
|
+
conda: {
|
|
12
|
+
skip: true
|
|
13
|
+
},
|
|
14
|
+
message: {
|
|
15
|
+
_: [
|
|
16
|
+
"npx",
|
|
17
|
+
"-y",
|
|
18
|
+
"@openai/codex@latest",
|
|
19
|
+
"{{args.prompt || undefined}}"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
path: "{{args.cwd}}",
|
|
23
|
+
input: true
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
when: "{{platform !== 'win32'}}",
|
|
27
|
+
id: "run",
|
|
28
|
+
method: "shell.run",
|
|
29
|
+
params: {
|
|
30
|
+
message: {
|
|
31
|
+
_: [
|
|
32
|
+
"npx",
|
|
33
|
+
"-y",
|
|
34
|
+
"@openai/codex@latest",
|
|
35
|
+
"{{args.prompt || undefined}}"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
path: "{{args.cwd}}",
|
|
39
|
+
input: true
|
|
40
|
+
}
|
|
41
|
+
}]
|
|
42
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
title: "OpenAI Codex Auto",
|
|
3
|
+
icon: "openai.webp",
|
|
4
|
+
description: "OpenAI Codex CLI with --yolo and trusted workspace config.",
|
|
5
|
+
link: "https://github.com/openai/codex",
|
|
6
|
+
run: [{
|
|
7
|
+
when: "{{platform === 'win32'}}",
|
|
8
|
+
id: "run",
|
|
9
|
+
method: "shell.run",
|
|
10
|
+
params: {
|
|
11
|
+
shell: "{{kernel.path('bin/miniconda/Library/bin/bash.exe')}}",
|
|
12
|
+
conda: {
|
|
13
|
+
skip: true
|
|
14
|
+
},
|
|
15
|
+
message: {
|
|
16
|
+
_: [
|
|
17
|
+
"npx",
|
|
18
|
+
"-y",
|
|
19
|
+
"@openai/codex@latest",
|
|
20
|
+
"--yolo",
|
|
21
|
+
"-c",
|
|
22
|
+
"projects={ {{JSON.stringify(args.cwd)}}={trust_level=\"trusted\"} }",
|
|
23
|
+
"{{args.prompt || undefined}}"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
path: "{{args.cwd}}",
|
|
27
|
+
input: true
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
when: "{{platform !== 'win32'}}",
|
|
31
|
+
id: "run",
|
|
32
|
+
method: "shell.run",
|
|
33
|
+
params: {
|
|
34
|
+
message: {
|
|
35
|
+
_: [
|
|
36
|
+
"npx",
|
|
37
|
+
"-y",
|
|
38
|
+
"@openai/codex@latest",
|
|
39
|
+
"--yolo",
|
|
40
|
+
"-c",
|
|
41
|
+
"projects={ {{JSON.stringify(args.cwd)}}={trust_level=\"trusted\"} }",
|
|
42
|
+
"{{args.prompt || undefined}}"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
path: "{{args.cwd}}",
|
|
46
|
+
input: true
|
|
47
|
+
}
|
|
48
|
+
}]
|
|
49
|
+
}
|
|
Binary file
|