refactor: goose-acp-server -> goose binary for TUI (#8155)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
---
|
||||
"@aaif/goose-acp": minor
|
||||
"@aaif/goose": minor
|
||||
"@aaif/goose-acp-server-darwin-arm64": minor
|
||||
"@aaif/goose-acp-server-darwin-x64": minor
|
||||
"@aaif/goose-acp-server-linux-arm64": minor
|
||||
"@aaif/goose-acp-server-linux-x64": minor
|
||||
"@aaif/goose-acp-server-win32-x64": minor
|
||||
"@aaif/goose-binary-darwin-arm64": minor
|
||||
"@aaif/goose-binary-darwin-x64": minor
|
||||
"@aaif/goose-binary-linux-arm64": minor
|
||||
"@aaif/goose-binary-linux-x64": minor
|
||||
"@aaif/goose-binary-win32-x64": minor
|
||||
---
|
||||
|
||||
Initial release of Goose npm packages
|
||||
|
||||
+8
-8
@@ -12,7 +12,7 @@ This package provides:
|
||||
npm install @aaif/goose-acp
|
||||
```
|
||||
|
||||
The native `goose-acp-server` binaries are distributed as optional dependencies
|
||||
The native `goose` binaries are distributed as optional dependencies
|
||||
and will be automatically installed for your platform.
|
||||
|
||||
## Development
|
||||
@@ -73,16 +73,16 @@ npm run build:schema
|
||||
|
||||
## Native Binary Packages
|
||||
|
||||
Platform-specific npm packages for the `goose-acp-server` binary are located in
|
||||
`ui/goose-acp-server/`:
|
||||
Platform-specific npm packages for the `goose` binary are located in
|
||||
`ui/goose-binary/`:
|
||||
|
||||
| Package | Platform |
|
||||
|---------|----------|
|
||||
| `@aaif/goose-acp-server-darwin-arm64` | macOS Apple Silicon |
|
||||
| `@aaif/goose-acp-server-darwin-x64` | macOS Intel |
|
||||
| `@aaif/goose-acp-server-linux-arm64` | Linux ARM64 |
|
||||
| `@aaif/goose-acp-server-linux-x64` | Linux x64 |
|
||||
| `@aaif/goose-acp-server-win32-x64` | Windows x64 |
|
||||
| `@aaif/goose-binary-darwin-arm64` | macOS Apple Silicon |
|
||||
| `@aaif/goose-binary-darwin-x64` | macOS Intel |
|
||||
| `@aaif/goose-binary-linux-arm64` | Linux ARM64 |
|
||||
| `@aaif/goose-binary-linux-x64` | Linux x64 |
|
||||
| `@aaif/goose-binary-win32-x64` | Windows x64 |
|
||||
|
||||
These are published separately from `@aaif/goose-acp`.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Builds the goose-acp-server binary for target platforms and places them
|
||||
* into the corresponding npm package directories under native/.
|
||||
* Builds the goose binary for target platforms and places them
|
||||
* into the corresponding npm package directories under ui/goose-binary/.
|
||||
*
|
||||
* Usage:
|
||||
* npm run build:native # build for current platform only
|
||||
@@ -20,7 +20,7 @@ import { mkdirSync, copyFileSync, chmodSync, existsSync } from "fs";
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
const ROOT = resolve(__dirname, "../../..");
|
||||
const NATIVE_DIR = resolve(ROOT, "ui/goose-acp-server");
|
||||
const NATIVE_DIR = resolve(ROOT, "ui/goose-binary");
|
||||
|
||||
const RUST_TARGETS: Record<string, string> = {
|
||||
"darwin-arm64": "aarch64-apple-darwin",
|
||||
@@ -51,19 +51,16 @@ function buildTarget(platform: string): void {
|
||||
throw new Error(`Unknown platform: ${platform}`);
|
||||
}
|
||||
|
||||
const pkgDir = resolve(NATIVE_DIR, `goose-acp-server-${platform}`);
|
||||
const pkgDir = resolve(NATIVE_DIR, `goose-binary-${platform}`);
|
||||
const binDir = resolve(pkgDir, "bin");
|
||||
|
||||
console.log(`==> Building goose-acp-server for ${platform} (${rustTarget})`);
|
||||
console.log(`==> Building goose for ${platform} (${rustTarget})`);
|
||||
|
||||
try {
|
||||
execSync(
|
||||
`cargo build --release --target ${rustTarget} --bin goose-acp-server`,
|
||||
{
|
||||
cwd: ROOT,
|
||||
stdio: "inherit",
|
||||
}
|
||||
);
|
||||
execSync(`cargo build --release --target ${rustTarget} --bin goose`, {
|
||||
cwd: ROOT,
|
||||
stdio: "inherit",
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(`Failed to build for ${platform}`);
|
||||
throw err;
|
||||
@@ -72,7 +69,7 @@ function buildTarget(platform: string): void {
|
||||
mkdirSync(binDir, { recursive: true });
|
||||
|
||||
const ext = platform.startsWith("win32") ? ".exe" : "";
|
||||
const binaryName = `goose-acp-server${ext}`;
|
||||
const binaryName = `goose${ext}`;
|
||||
const srcPath = resolve(ROOT, "target", rustTarget, "release", binaryName);
|
||||
const destPath = resolve(binDir, binaryName);
|
||||
|
||||
@@ -105,7 +102,9 @@ async function main() {
|
||||
for (const platform of args) {
|
||||
if (!RUST_TARGETS[platform]) {
|
||||
console.error(`Unknown platform: ${platform}`);
|
||||
console.error(`Valid platforms: ${Object.keys(RUST_TARGETS).join(", ")}`);
|
||||
console.error(
|
||||
`Valid platforms: ${Object.keys(RUST_TARGETS).join(", ")}`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
buildTarget(platform);
|
||||
@@ -115,7 +114,7 @@ async function main() {
|
||||
const currentPlatform = getCurrentPlatform();
|
||||
if (!currentPlatform) {
|
||||
console.error(
|
||||
`Unsupported platform: ${process.platform}-${process.arch}`
|
||||
`Unsupported platform: ${process.platform}-${process.arch}`,
|
||||
);
|
||||
console.error(`Valid platforms: ${Object.keys(RUST_TARGETS).join(", ")}`);
|
||||
console.error(`Use --all to build for all platforms`);
|
||||
@@ -125,7 +124,7 @@ async function main() {
|
||||
buildTarget(currentPlatform);
|
||||
}
|
||||
|
||||
console.log("==> Done. Native packages staged in ui/goose-acp-server/");
|
||||
console.log("==> Done. Native packages staged in ui/goose-binary/");
|
||||
}
|
||||
|
||||
main().catch((err) => {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
# Native Binary Packages for goose-acp-server
|
||||
# Native Binary Packages for goose
|
||||
|
||||
This directory contains the npm package scaffolding for distributing the
|
||||
`goose-acp-server` Rust binary as platform-specific npm packages.
|
||||
`goose` Rust binary as platform-specific npm packages.
|
||||
|
||||
## Packages
|
||||
|
||||
| Package | Platform |
|
||||
|---------|----------|
|
||||
| `@aaif/goose-acp-server-darwin-arm64` | macOS Apple Silicon |
|
||||
| `@aaif/goose-acp-server-darwin-x64` | macOS Intel |
|
||||
| `@aaif/goose-acp-server-linux-arm64` | Linux ARM64 |
|
||||
| `@aaif/goose-acp-server-linux-x64` | Linux x64 |
|
||||
| `@aaif/goose-acp-server-win32-x64` | Windows x64 |
|
||||
| `@aaif/goose-binary-darwin-arm64` | macOS Apple Silicon |
|
||||
| `@aaif/goose-binary-darwin-x64` | macOS Intel |
|
||||
| `@aaif/goose-binary-linux-arm64` | Linux ARM64 |
|
||||
| `@aaif/goose-binary-linux-x64` | Linux x64 |
|
||||
| `@aaif/goose-binary-win32-x64` | Windows x64 |
|
||||
|
||||
## Building
|
||||
|
||||
@@ -29,7 +29,7 @@ npm run build:native:all
|
||||
npx tsx scripts/build-native.ts darwin-arm64 linux-x64
|
||||
```
|
||||
|
||||
The built binaries are placed into `ui/goose-acp-server/goose-acp-server-{platform}/bin/`.
|
||||
The built binaries are placed into `ui/goose-binary/goose-binary-{platform}/bin/`.
|
||||
These directories are git-ignored.
|
||||
|
||||
## Publishing
|
||||
+3
-5
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@aaif/goose-acp-server-darwin-arm64",
|
||||
"name": "@aaif/goose-binary-darwin-arm64",
|
||||
"version": "0.1.0",
|
||||
"description": "Goose ACP server binary for macOS ARM64",
|
||||
"description": "Goose binary for macOS ARM64",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -11,8 +11,6 @@
|
||||
"goose",
|
||||
"ai",
|
||||
"agent",
|
||||
"acp",
|
||||
"server",
|
||||
"binary"
|
||||
],
|
||||
"os": [
|
||||
@@ -22,6 +20,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"files": [
|
||||
"bin/goose-acp-server"
|
||||
"bin/goose"
|
||||
]
|
||||
}
|
||||
+3
-5
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@aaif/goose-acp-server-darwin-x64",
|
||||
"name": "@aaif/goose-binary-darwin-x64",
|
||||
"version": "0.1.0",
|
||||
"description": "Goose ACP server binary for macOS x64",
|
||||
"description": "Goose binary for macOS x64",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -11,8 +11,6 @@
|
||||
"goose",
|
||||
"ai",
|
||||
"agent",
|
||||
"acp",
|
||||
"server",
|
||||
"binary"
|
||||
],
|
||||
"os": [
|
||||
@@ -22,6 +20,6 @@
|
||||
"x64"
|
||||
],
|
||||
"files": [
|
||||
"bin/goose-acp-server"
|
||||
"bin/goose"
|
||||
]
|
||||
}
|
||||
+3
-5
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@aaif/goose-acp-server-linux-arm64",
|
||||
"name": "@aaif/goose-binary-linux-arm64",
|
||||
"version": "0.1.0",
|
||||
"description": "Goose ACP server binary for Linux ARM64",
|
||||
"description": "Goose binary for Linux ARM64",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -11,8 +11,6 @@
|
||||
"goose",
|
||||
"ai",
|
||||
"agent",
|
||||
"acp",
|
||||
"server",
|
||||
"binary"
|
||||
],
|
||||
"os": [
|
||||
@@ -22,6 +20,6 @@
|
||||
"arm64"
|
||||
],
|
||||
"files": [
|
||||
"bin/goose-acp-server"
|
||||
"bin/goose"
|
||||
]
|
||||
}
|
||||
+3
-5
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@aaif/goose-acp-server-linux-x64",
|
||||
"name": "@aaif/goose-binary-linux-x64",
|
||||
"version": "0.1.0",
|
||||
"description": "Goose ACP server binary for Linux x64",
|
||||
"description": "Goose binary for Linux x64",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -11,8 +11,6 @@
|
||||
"goose",
|
||||
"ai",
|
||||
"agent",
|
||||
"acp",
|
||||
"server",
|
||||
"binary"
|
||||
],
|
||||
"os": [
|
||||
@@ -22,6 +20,6 @@
|
||||
"x64"
|
||||
],
|
||||
"files": [
|
||||
"bin/goose-acp-server"
|
||||
"bin/goose"
|
||||
]
|
||||
}
|
||||
+3
-5
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@aaif/goose-acp-server-win32-x64",
|
||||
"name": "@aaif/goose-binary-win32-x64",
|
||||
"version": "0.1.0",
|
||||
"description": "Goose ACP server binary for Windows x64",
|
||||
"description": "Goose binary for Windows x64",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -11,8 +11,6 @@
|
||||
"goose",
|
||||
"ai",
|
||||
"agent",
|
||||
"acp",
|
||||
"server",
|
||||
"binary"
|
||||
],
|
||||
"os": [
|
||||
@@ -22,6 +20,6 @@
|
||||
"x64"
|
||||
],
|
||||
"files": [
|
||||
"bin/goose-acp-server.exe"
|
||||
"bin/goose.exe"
|
||||
]
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
"acp",
|
||||
"text",
|
||||
"desktop",
|
||||
"goose-acp-server/*"
|
||||
"goose-binary/*"
|
||||
],
|
||||
"scripts": {
|
||||
"changeset": "changeset",
|
||||
|
||||
Generated
+15
-15
@@ -366,15 +366,15 @@ importers:
|
||||
specifier: ^4.0.18
|
||||
version: 4.1.0(@types/node@25.5.0)(@vitest/ui@4.1.0)(jsdom@28.1.0)(vite@7.3.1(@types/node@25.5.0)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(tsx@4.21.0)(yaml@2.8.2))
|
||||
|
||||
goose-acp-server/goose-acp-server-darwin-arm64: {}
|
||||
goose-binary/goose-binary-darwin-arm64: {}
|
||||
|
||||
goose-acp-server/goose-acp-server-darwin-x64: {}
|
||||
goose-binary/goose-binary-darwin-x64: {}
|
||||
|
||||
goose-acp-server/goose-acp-server-linux-arm64: {}
|
||||
goose-binary/goose-binary-linux-arm64: {}
|
||||
|
||||
goose-acp-server/goose-acp-server-linux-x64: {}
|
||||
goose-binary/goose-binary-linux-x64: {}
|
||||
|
||||
goose-acp-server/goose-acp-server-win32-x64: {}
|
||||
goose-binary/goose-binary-win32-x64: {}
|
||||
|
||||
text:
|
||||
dependencies:
|
||||
@@ -422,21 +422,21 @@ importers:
|
||||
specifier: ^5.7.0
|
||||
version: 5.9.3
|
||||
optionalDependencies:
|
||||
'@aaif/goose-acp-server-darwin-arm64':
|
||||
'@aaif/goose-binary-darwin-arm64':
|
||||
specifier: workspace:*
|
||||
version: link:../goose-acp-server/goose-acp-server-darwin-arm64
|
||||
'@aaif/goose-acp-server-darwin-x64':
|
||||
version: link:../goose-binary/goose-binary-darwin-arm64
|
||||
'@aaif/goose-binary-darwin-x64':
|
||||
specifier: workspace:*
|
||||
version: link:../goose-acp-server/goose-acp-server-darwin-x64
|
||||
'@aaif/goose-acp-server-linux-arm64':
|
||||
version: link:../goose-binary/goose-binary-darwin-x64
|
||||
'@aaif/goose-binary-linux-arm64':
|
||||
specifier: workspace:*
|
||||
version: link:../goose-acp-server/goose-acp-server-linux-arm64
|
||||
'@aaif/goose-acp-server-linux-x64':
|
||||
version: link:../goose-binary/goose-binary-linux-arm64
|
||||
'@aaif/goose-binary-linux-x64':
|
||||
specifier: workspace:*
|
||||
version: link:../goose-acp-server/goose-acp-server-linux-x64
|
||||
'@aaif/goose-acp-server-win32-x64':
|
||||
version: link:../goose-binary/goose-binary-linux-x64
|
||||
'@aaif/goose-binary-win32-x64':
|
||||
specifier: workspace:*
|
||||
version: link:../goose-acp-server/goose-acp-server-win32-x64
|
||||
version: link:../goose-binary/goose-binary-win32-x64
|
||||
|
||||
packages:
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@ packages:
|
||||
- 'acp'
|
||||
- 'text'
|
||||
- 'desktop'
|
||||
- 'goose-acp-server/*'
|
||||
- 'goose-binary/*'
|
||||
|
||||
@@ -13,7 +13,7 @@ set -euo pipefail
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
ACP_DIR="${REPO_ROOT}/ui/acp"
|
||||
NATIVE_DIR="${REPO_ROOT}/ui/goose-acp-server"
|
||||
NATIVE_DIR="${REPO_ROOT}/ui/goose-binary"
|
||||
TEXT_DIR="${REPO_ROOT}/ui/text"
|
||||
|
||||
DRY_RUN="--dry-run"
|
||||
@@ -36,18 +36,18 @@ echo "==> Building @aaif/goose"
|
||||
(cd "${TEXT_DIR}" && npm run build)
|
||||
|
||||
NATIVE_PACKAGES=(
|
||||
"goose-acp-server-darwin-arm64"
|
||||
"goose-acp-server-darwin-x64"
|
||||
"goose-acp-server-linux-arm64"
|
||||
"goose-acp-server-linux-x64"
|
||||
"goose-acp-server-win32-x64"
|
||||
"goose-binary-darwin-arm64"
|
||||
"goose-binary-darwin-x64"
|
||||
"goose-binary-linux-arm64"
|
||||
"goose-binary-linux-x64"
|
||||
"goose-binary-win32-x64"
|
||||
)
|
||||
|
||||
# Publish native binary packages
|
||||
for pkg in "${NATIVE_PACKAGES[@]}"; do
|
||||
pkg_dir="${NATIVE_DIR}/${pkg}"
|
||||
|
||||
if [ ! -f "${pkg_dir}/bin/goose-acp-server" ] && [ ! -f "${pkg_dir}/bin/goose-acp-server.exe" ]; then
|
||||
if [ ! -f "${pkg_dir}/bin/goose" ] && [ ! -f "${pkg_dir}/bin/goose.exe" ]; then
|
||||
echo " SKIP ${pkg} (no binary found — run npm run build:native:all in ui/acp first)"
|
||||
continue
|
||||
fi
|
||||
|
||||
+13
-7
@@ -7,10 +7,16 @@ https://github.com/block/goose/discussions/7309
|
||||
|
||||
## Running
|
||||
|
||||
1. Run the server `cargo run -p goose-acp --bin goose-acp-server`
|
||||
2. Run the tui
|
||||
```
|
||||
cd ui/text
|
||||
npm i
|
||||
npm run start
|
||||
```
|
||||
The TUI automatically launches the goose ACP server using the `goose acp` command.
|
||||
|
||||
```bash
|
||||
cd ui/text
|
||||
npm i
|
||||
npm run start
|
||||
```
|
||||
|
||||
To use a custom server URL instead:
|
||||
|
||||
```bash
|
||||
npm run start -- --server http://localhost:8080
|
||||
```
|
||||
|
||||
@@ -40,11 +40,11 @@
|
||||
"react": "^19.2.4"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@aaif/goose-acp-server-darwin-arm64": "workspace:*",
|
||||
"@aaif/goose-acp-server-darwin-x64": "workspace:*",
|
||||
"@aaif/goose-acp-server-linux-arm64": "workspace:*",
|
||||
"@aaif/goose-acp-server-linux-x64": "workspace:*",
|
||||
"@aaif/goose-acp-server-win32-x64": "workspace:*"
|
||||
"@aaif/goose-binary-darwin-arm64": "workspace:*",
|
||||
"@aaif/goose-binary-darwin-x64": "workspace:*",
|
||||
"@aaif/goose-binary-linux-arm64": "workspace:*",
|
||||
"@aaif/goose-binary-linux-x64": "workspace:*",
|
||||
"@aaif/goose-binary-win32-x64": "workspace:*"
|
||||
},
|
||||
"overrides": {
|
||||
"react": "19.2.4"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
// Resolves the path to the goose-acp-server binary from the platform-specific
|
||||
// Resolves the path to the goose binary from the platform-specific
|
||||
// optional dependency. Writes the result to a JSON file that the CLI reads at
|
||||
// startup so it can spawn the server automatically.
|
||||
|
||||
@@ -13,11 +13,11 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
const PLATFORMS = {
|
||||
"darwin-arm64": "@aaif/goose-acp-server-darwin-arm64",
|
||||
"darwin-x64": "@aaif/goose-acp-server-darwin-x64",
|
||||
"linux-arm64": "@aaif/goose-acp-server-linux-arm64",
|
||||
"linux-x64": "@aaif/goose-acp-server-linux-x64",
|
||||
"win32-x64": "@aaif/goose-acp-server-win32-x64",
|
||||
"darwin-arm64": "@aaif/goose-binary-darwin-arm64",
|
||||
"darwin-x64": "@aaif/goose-binary-darwin-x64",
|
||||
"linux-arm64": "@aaif/goose-binary-linux-arm64",
|
||||
"linux-x64": "@aaif/goose-binary-linux-x64",
|
||||
"win32-x64": "@aaif/goose-binary-win32-x64",
|
||||
};
|
||||
|
||||
const key = `${process.platform}-${process.arch}`;
|
||||
@@ -25,7 +25,7 @@ const pkg = PLATFORMS[key];
|
||||
|
||||
if (!pkg) {
|
||||
console.warn(
|
||||
`@aaif/goose: no prebuilt goose-acp-server binary for ${key}. ` +
|
||||
`@aaif/goose: no prebuilt goose binary for ${key}. ` +
|
||||
`You will need to provide a server URL manually with --server.`,
|
||||
);
|
||||
process.exit(0);
|
||||
@@ -35,7 +35,7 @@ let binaryPath;
|
||||
try {
|
||||
// Resolve the package directory, then point at the binary inside it
|
||||
const pkgDir = dirname(require.resolve(`${pkg}/package.json`));
|
||||
const binName = process.platform === "win32" ? "goose-acp-server.exe" : "goose-acp-server";
|
||||
const binName = process.platform === "win32" ? "goose.exe" : "goose";
|
||||
binaryPath = join(pkgDir, "bin", binName);
|
||||
} catch {
|
||||
// The optional dependency wasn't installed (e.g. wrong platform). That's fine.
|
||||
@@ -53,4 +53,4 @@ writeFileSync(
|
||||
JSON.stringify({ binaryPath }, null, 2) + "\n",
|
||||
);
|
||||
|
||||
console.log(`@aaif/goose: found native server binary at ${binaryPath}`);
|
||||
console.log(`@aaif/goose: found native goose binary at ${binaryPath}`);
|
||||
|
||||
Reference in New Issue
Block a user