refactor: goose-acp-server -> goose binary for TUI (#8155)

This commit is contained in:
Alex Hancock
2026-03-27 17:12:11 -04:00
committed by GitHub
parent ae83fd2adc
commit dfa93fe948
21 changed files with 335 additions and 262 deletions

View File

@@ -1,120 +0,0 @@
name: Build Native Packages
on:
workflow_call:
outputs:
artifact-name:
description: "Name of the artifact containing all native binaries"
value: ${{ jobs.collect.outputs.artifact-name }}
workflow_dispatch:
push:
branches:
- main
paths:
- 'crates/goose-acp/**'
- 'ui/acp/**'
- '.github/workflows/build-native-packages.yml'
pull_request:
paths:
- 'crates/goose-acp/**'
- 'ui/acp/**'
- '.github/workflows/build-native-packages.yml'
jobs:
build-matrix:
name: Build ${{ matrix.platform }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- platform: darwin-arm64
os: macos-latest
target: aarch64-apple-darwin
- platform: darwin-x64
os: macos-latest
target: x86_64-apple-darwin
- platform: linux-arm64
os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
- platform: linux-x64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- platform: win32-x64
os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@631a55b12751854ce901bb631d5902ceb48146f7 # stable
with:
targets: ${{ matrix.target }}
- name: Add Intel target for cross-compilation (macOS ARM64 → x86_64)
if: matrix.platform == 'darwin-x64'
run: rustup target add x86_64-apple-darwin
- name: Install cross-compilation tools (Linux ARM64)
if: matrix.platform == 'linux-arm64'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
- name: Setup Rust cache
uses: Swatinem/rust-cache@42dc69e1aa15d09112580998cf2ef0119e2e91ae # v2
with:
key: ${{ matrix.platform }}
- name: Build goose-acp-server
run: cargo build --release --target ${{ matrix.target }} --bin goose-acp-server
- name: Prepare artifact (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p artifact/bin
cp target/${{ matrix.target }}/release/goose-acp-server artifact/bin/
chmod +x artifact/bin/goose-acp-server
- name: Prepare artifact (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
mkdir -p artifact/bin
cp target/${{ matrix.target }}/release/goose-acp-server.exe artifact/bin/
- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: goose-acp-server-${{ matrix.platform }}
path: artifact/
if-no-files-found: error
retention-days: 7
collect:
name: Collect all binaries
runs-on: ubuntu-latest
needs: build-matrix
outputs:
artifact-name: native-binaries-all
steps:
- name: Download all artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
path: native-binaries
- name: List downloaded artifacts
run: |
echo "Downloaded artifacts:"
ls -R native-binaries/
- name: Upload combined artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: native-binaries-all
path: native-binaries/
if-no-files-found: error
retention-days: 7

View File

@@ -91,9 +91,9 @@ jobs:
if-no-files-found: error
retention-days: 7
# Build goose binaries for all platforms
# Build goose CLI binaries for all platforms
build-goose-binaries:
name: Build goose (${{ matrix.platform }})
name: Build goose CLI (${{ matrix.platform }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
@@ -111,9 +111,10 @@ jobs:
- platform: linux-x64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- platform: win32-x64
os: windows-latest
target: x86_64-pc-windows-msvc
# Temporarily disabled - Windows builds are slow (20+ min) without cache
# - platform: win32-x64
# os: windows-latest
# target: x86_64-pc-windows-msvc
outputs:
cache-key-base: ${{ steps.cache-key.outputs.key-base }}
steps:
@@ -164,7 +165,7 @@ jobs:
target/${{ matrix.target }}/release/goose${{ matrix.platform == 'win32-x64' && '.exe' || '' }}
key: ${{ steps.cache-key.outputs.key }}
- name: Build goose binary
- name: Build goose CLI binary
if: steps.binary-cache.outputs.cache-hit != 'true'
run: cargo build --release --target ${{ matrix.target }} --bin goose
@@ -227,7 +228,7 @@ jobs:
echo "Downloaded ACP schema:"
ls -lh crates/goose-acp/acp-*.json
echo ""
echo "Downloaded goose binaries:"
echo "Downloaded goose CLI binaries:"
ls -R goose-binaries/
- name: Install dependencies
@@ -259,7 +260,7 @@ jobs:
echo "### ACP Schema"
echo "✅ Generated and cached"
echo ""
echo "### Goose Binaries"
echo "### Goose CLI Binaries"
echo "✅ Built for all platforms:"
for dir in goose-binaries/goose-*; do
platform=$(basename "$dir" | sed 's/goose-//')
@@ -268,7 +269,7 @@ jobs:
echo ""
echo "### npm Packages"
echo "✅ @aaif/goose-acp"
echo "✅ @aaif/goose-text"
echo "✅ @aaif/goose (TUI)"
echo ""
} >> "$GITHUB_STEP_SUMMARY"
@@ -292,29 +293,52 @@ jobs:
echo "⚠️ Skipping actual npm publish (dry-run mode)"
echo ""
echo "To publish for real, run this workflow without dry-run enabled."
echo ""
echo "**Note:** Changesets will still run to verify functionality."
} >> "$GITHUB_STEP_SUMMARY"
fi
- name: Create Release Pull Request or Publish to npm
- name: Publish to npm
if: inputs.dry-run != true && github.ref == 'refs/heads/main'
id: changesets
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
with:
publish: pnpm run release
version: pnpm run version
commit: 'chore: version packages'
title: 'chore: version packages'
cwd: ui
run: |
cd ui
# Publish all packages in the workspace
pnpm publish -r --access public --no-git-checks
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: Publish summary
if: steps.changesets.outputs.published == 'true' && inputs.dry-run != true && github.ref == 'refs/heads/main'
- name: Dry run - Show what would be published
if: inputs.dry-run == true || github.ref != 'refs/heads/main'
run: |
cd ui
echo "## 📦 Packages that would be published:" | tee -a "$GITHUB_STEP_SUMMARY"
echo "" | tee -a "$GITHUB_STEP_SUMMARY"
# List all publishable packages
for pkg in acp text goose-binary/*/; do
if [ -f "$pkg/package.json" ]; then
name=$(jq -r '.name' "$pkg/package.json")
version=$(jq -r '.version' "$pkg/package.json")
echo "- $name@$version" | tee -a "$GITHUB_STEP_SUMMARY"
fi
done
echo "" | tee -a "$GITHUB_STEP_SUMMARY"
echo "**Note:** This is a dry run. No packages were published." | tee -a "$GITHUB_STEP_SUMMARY"
- name: Publish summary
if: inputs.dry-run != true && github.ref == 'refs/heads/main'
run: |
cd ui
{
echo "## 🚀 Published Packages"
echo ""
echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -r '.[] | "- \(.name)@\(.version)"'
for pkg in acp text goose-binary/*/; do
if [ -f "$pkg/package.json" ]; then
name=$(jq -r '.name' "$pkg/package.json")
version=$(jq -r '.version' "$pkg/package.json")
echo "- $name@$version"
fi
done
} >> "$GITHUB_STEP_SUMMARY"

View File

@@ -0,0 +1,182 @@
# publish-npm.yml Workflow Changes
## Summary
Successfully simplified the `publish-npm.yml` workflow by removing the broken changesets action and replacing it with direct `pnpm publish` commands.
## Changes Made
### 1. Removed Changesets Action
**Problem:** The changesets action never worked - all runs failed with "There is no .changeset directory in this project" error, even though the directory existed.
**Root Cause:** The `cwd` parameter in the changesets action wasn't working correctly, and the action was checking for `.changeset` in the repo root before applying the working directory.
**Solution:** Removed changesets entirely and replaced with simple `pnpm publish -r` command.
### 2. Simplified Publishing Logic
**Before:**
```yaml
- name: Create Release Pull Request or Publish to npm
if: inputs.dry-run != true && github.ref == 'refs/heads/main'
uses: changesets/action@...
with:
publish: pnpm run release
version: pnpm run version
cwd: ui
```
**After:**
```yaml
- name: Publish to npm
if: inputs.dry-run != true && github.ref == 'refs/heads/main'
run: |
cd ui
pnpm publish -r --access public --no-git-checks
- name: Dry run - Show what would be published
if: inputs.dry-run == true || github.ref != 'refs/heads/main'
run: |
cd ui
# List all packages with their versions
for pkg in acp text goose-binary/*/; do
if [ -f "$pkg/package.json" ]; then
name=$(jq -r '.name' "$pkg/package.json")
version=$(jq -r '.version' "$pkg/package.json")
echo "- $name@$version"
fi
done
```
### 3. Dry-Run Now Only Prevents Publish
**Before:** Dry-run would skip the entire changesets step, preventing testing of the workflow logic.
**After:** Dry-run runs all the same steps but shows what would be published instead of actually publishing. This allows full workflow testing without publishing to npm.
### 4. Temporarily Disabled Windows Build
**Reason:** Windows builds take 20+ minutes when cache misses, slowing down testing.
**Solution:** Commented out Windows from the build matrix. Will re-enable after implementing sccache optimization (see `docs/ci-optimization-windows-builds.md`).
## Testing Results
### Successful Run: 23666117886
**Duration:** ~5 minutes (all builds had cache hits)
**Packages Detected:**
- @aaif/goose-acp@0.1.0
- @aaif/goose@0.1.0
- @aaif/goose-binary-darwin-arm64@0.1.0
- @aaif/goose-binary-darwin-x64@0.1.0
- @aaif/goose-binary-linux-arm64@0.1.0
- @aaif/goose-binary-linux-x64@0.1.0
- @aaif/goose-binary-win32-x64@0.1.0
**Status:** ✅ All steps completed successfully
## How to Use
### Test the Workflow (Dry-Run)
```bash
gh workflow run publish-npm.yml --ref <branch> -f dry-run=true
```
This will:
1. Generate ACP schema
2. Build goose binaries for all platforms (except Windows, temporarily)
3. Build npm packages
4. Show what would be published (without actually publishing)
### Publish for Real (Main Branch Only)
```bash
# Merge to main, then:
gh workflow run publish-npm.yml --ref main -f dry-run=false
```
This will:
1. Run all build steps
2. Actually publish to npm with `pnpm publish -r`
**Note:** Publishing only works from the `main` branch due to security restrictions.
## Versioning Strategy
Since we removed changesets, you'll need to manage versions manually:
### Option 1: Manual Version Bumps
```bash
cd ui/acp
npm version patch # or minor, major
cd ../text
npm version patch
# etc for each package
```
### Option 2: Use Changesets CLI Manually
```bash
cd ui
pnpm changeset add # Create a changeset
pnpm changeset version # Bump versions based on changesets
git commit -am "chore: version packages"
```
Then trigger the workflow to publish.
### Option 3: Add Version Bump to Workflow
Could add a step to automatically bump versions based on conventional commits or other logic.
## Future Improvements
### 1. Re-enable Windows Build with sccache
See `docs/ci-optimization-windows-builds.md` for implementation details.
**Expected improvement:** 20+ minutes → 8-10 minutes for cache misses
### 2. Add Automatic Version Bumping
Options:
- Use conventional commits to determine version bump
- Add a workflow input for version bump type (patch/minor/major)
- Integrate changesets CLI properly (without the action)
### 3. Add Release Notes Generation
Could generate release notes from git commits or changeset files.
### 4. Add npm Publish Verification
After publishing, verify packages are available on npm registry.
## Troubleshooting
### "Package already exists" Error
If you try to publish a version that already exists on npm:
```bash
# Bump the version first
cd ui/acp
npm version patch
git commit -am "chore: bump version"
git push
```
### Cache Issues
If builds are slow due to cache misses:
```bash
# Skip cache and rebuild everything
gh workflow run publish-npm.yml -f skip-cache=true
```
### Testing Without Publishing
Always use dry-run mode for testing:
```bash
gh workflow run publish-npm.yml -f dry-run=true
```
## Related Documentation
- `docs/ci-optimization-windows-builds.md` - Strategies to speed up Windows builds
- `.github/workflows/publish-npm.yml` - The workflow file
- `ui/package.json` - Workspace configuration
- `ui/.changeset/` - Changeset configuration (currently unused by workflow)

View File

@@ -183,23 +183,15 @@ The TUI will automatically start the goose-acp-server if you have it installed:
npm start
```
**Option 2: Manual server startup**
**Option 2: Connect to a custom server**
Start the ACP server separately, then connect the TUI:
For servers that support the draft standard ACP over Streamable HTTP https://github.com/agentclientprotocol/agent-client-protocol/pull/721
```bash
# Terminal 1: Start the server
npm start -- --server http://HOST:PORT
# example server
cargo run -p goose-acp --bin goose-acp-server
# Terminal 2: Start the TUI
cd ui/text
npm start
```
**Option 3: Connect to a custom server**
```bash
npm start -- --server http://localhost:3284
```
### Single Prompt Mode

View File

@@ -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

View File

@@ -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`.

View File

@@ -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) => {

View File

@@ -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

View File

@@ -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"
]
}

View File

@@ -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"
]
}

View File

@@ -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"
]
}

View File

@@ -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"
]
}

View File

@@ -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"
]
}

View File

@@ -4,7 +4,7 @@
"acp",
"text",
"desktop",
"goose-acp-server/*"
"goose-binary/*"
],
"scripts": {
"changeset": "changeset",

30
ui/pnpm-lock.yaml generated
View File

@@ -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:

View File

@@ -2,4 +2,4 @@ packages:
- 'acp'
- 'text'
- 'desktop'
- 'goose-acp-server/*'
- 'goose-binary/*'

View File

@@ -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

View File

@@ -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
```

View File

@@ -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"

View File

@@ -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}`);