mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 09:01:17 +00:00
feat: gigacode (#92)
This commit is contained in:
parent
0a73d1d8e8
commit
a02393436c
40 changed files with 2736 additions and 1327 deletions
|
|
@ -8,6 +8,7 @@ export type NonExecutableBinaryMessageOptions = {
|
|||
trustPackages: string;
|
||||
bunInstallBlocks: InstallCommandBlock[];
|
||||
genericInstallCommands?: string[];
|
||||
binaryName?: string;
|
||||
};
|
||||
|
||||
export type FsSubset = {
|
||||
|
|
@ -63,10 +64,16 @@ export function assertExecutable(binPath: string, fs: FsSubset): boolean {
|
|||
export function formatNonExecutableBinaryMessage(
|
||||
options: NonExecutableBinaryMessageOptions,
|
||||
): string {
|
||||
const { binPath, trustPackages, bunInstallBlocks, genericInstallCommands } =
|
||||
options;
|
||||
const {
|
||||
binPath,
|
||||
trustPackages,
|
||||
bunInstallBlocks,
|
||||
genericInstallCommands,
|
||||
binaryName,
|
||||
} = options;
|
||||
|
||||
const lines = [`sandbox-agent binary is not executable: ${binPath}`];
|
||||
const label = binaryName ?? "sandbox-agent";
|
||||
const lines = [`${label} binary is not executable: ${binPath}`];
|
||||
|
||||
if (isBunRuntime()) {
|
||||
lines.push(
|
||||
|
|
|
|||
66
sdks/gigacode/bin/gigacode
Normal file
66
sdks/gigacode/bin/gigacode
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
#!/usr/bin/env node
|
||||
const { execFileSync } = require("child_process");
|
||||
const {
|
||||
assertExecutable,
|
||||
formatNonExecutableBinaryMessage,
|
||||
} = require("@sandbox-agent/cli-shared");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
const TRUST_PACKAGES =
|
||||
"gigacode-linux-x64 gigacode-linux-arm64 gigacode-darwin-arm64 gigacode-darwin-x64 gigacode-win32-x64";
|
||||
|
||||
function formatHint(binPath) {
|
||||
return formatNonExecutableBinaryMessage({
|
||||
binPath,
|
||||
binaryName: "gigacode",
|
||||
trustPackages: TRUST_PACKAGES,
|
||||
bunInstallBlocks: [
|
||||
{
|
||||
label: "Project install",
|
||||
commands: [
|
||||
`bun pm trust ${TRUST_PACKAGES}`,
|
||||
"bun add gigacode",
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Global install",
|
||||
commands: [
|
||||
`bun pm -g trust ${TRUST_PACKAGES}`,
|
||||
"bun add -g gigacode",
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
const PLATFORMS = {
|
||||
"darwin-arm64": "gigacode-darwin-arm64",
|
||||
"darwin-x64": "gigacode-darwin-x64",
|
||||
"linux-x64": "gigacode-linux-x64",
|
||||
"linux-arm64": "gigacode-linux-arm64",
|
||||
"win32-x64": "gigacode-win32-x64",
|
||||
};
|
||||
|
||||
const key = `${process.platform}-${process.arch}`;
|
||||
const pkg = PLATFORMS[key];
|
||||
if (!pkg) {
|
||||
console.error(`Unsupported platform: ${key}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
try {
|
||||
const pkgPath = require.resolve(`${pkg}/package.json`);
|
||||
const bin = process.platform === "win32" ? "gigacode.exe" : "gigacode";
|
||||
const binPath = path.join(path.dirname(pkgPath), "bin", bin);
|
||||
|
||||
if (!assertExecutable(binPath, fs)) {
|
||||
console.error(formatHint(binPath));
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
|
||||
} catch (e) {
|
||||
if (e.status !== undefined) process.exit(e.status);
|
||||
throw e;
|
||||
}
|
||||
32
sdks/gigacode/package.json
Normal file
32
sdks/gigacode/package.json
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"name": "gigacode",
|
||||
"version": "0.1.6",
|
||||
"description": "Gigacode CLI (sandbox-agent with OpenCode attach by default)",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/rivet-dev/sandbox-agent"
|
||||
},
|
||||
"bin": {
|
||||
"gigacode": "bin/gigacode"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"@sandbox-agent/cli-shared": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vitest": "^3.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"gigacode-linux-x64": "workspace:*",
|
||||
"gigacode-linux-arm64": "workspace:*",
|
||||
"gigacode-darwin-arm64": "workspace:*",
|
||||
"gigacode-darwin-x64": "workspace:*",
|
||||
"gigacode-win32-x64": "workspace:*"
|
||||
},
|
||||
"files": [
|
||||
"bin"
|
||||
]
|
||||
}
|
||||
22
sdks/gigacode/platforms/darwin-arm64/package.json
Normal file
22
sdks/gigacode/platforms/darwin-arm64/package.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "gigacode-darwin-arm64",
|
||||
"version": "0.1.6",
|
||||
"description": "gigacode CLI binary for macOS arm64",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/rivet-dev/sandbox-agent"
|
||||
},
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"scripts": {
|
||||
"postinstall": "chmod +x bin/gigacode || true"
|
||||
},
|
||||
"files": [
|
||||
"bin"
|
||||
]
|
||||
}
|
||||
22
sdks/gigacode/platforms/darwin-x64/package.json
Normal file
22
sdks/gigacode/platforms/darwin-x64/package.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "gigacode-darwin-x64",
|
||||
"version": "0.1.6",
|
||||
"description": "gigacode CLI binary for macOS x64",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/rivet-dev/sandbox-agent"
|
||||
},
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"scripts": {
|
||||
"postinstall": "chmod +x bin/gigacode || true"
|
||||
},
|
||||
"files": [
|
||||
"bin"
|
||||
]
|
||||
}
|
||||
22
sdks/gigacode/platforms/linux-arm64/package.json
Normal file
22
sdks/gigacode/platforms/linux-arm64/package.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "gigacode-linux-arm64",
|
||||
"version": "0.1.6",
|
||||
"description": "gigacode CLI binary for Linux arm64",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/rivet-dev/sandbox-agent"
|
||||
},
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"scripts": {
|
||||
"postinstall": "chmod +x bin/gigacode || true"
|
||||
},
|
||||
"files": [
|
||||
"bin"
|
||||
]
|
||||
}
|
||||
22
sdks/gigacode/platforms/linux-x64/package.json
Normal file
22
sdks/gigacode/platforms/linux-x64/package.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "gigacode-linux-x64",
|
||||
"version": "0.1.6",
|
||||
"description": "gigacode CLI binary for Linux x64",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/rivet-dev/sandbox-agent"
|
||||
},
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"scripts": {
|
||||
"postinstall": "chmod +x bin/gigacode || true"
|
||||
},
|
||||
"files": [
|
||||
"bin"
|
||||
]
|
||||
}
|
||||
19
sdks/gigacode/platforms/win32-x64/package.json
Normal file
19
sdks/gigacode/platforms/win32-x64/package.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "gigacode-win32-x64",
|
||||
"version": "0.1.6",
|
||||
"description": "gigacode CLI binary for Windows x64",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/rivet-dev/sandbox-agent"
|
||||
},
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"files": [
|
||||
"bin"
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue