refactor: goose-acp-server -> goose binary for TUI (#8155)
This commit is contained in:
+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