tui: set up for publishing via github actions (#8020)
This commit is contained in:
Generated
-1762
File diff suppressed because it is too large
Load Diff
+14
-7
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@block/goose",
|
||||
"name": "@aaif/goose",
|
||||
"version": "0.1.0",
|
||||
"description": "Goose - an open-source AI agent",
|
||||
"license": "Apache-2.0",
|
||||
@@ -7,6 +7,13 @@
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/block/goose.git"
|
||||
},
|
||||
"keywords": [
|
||||
"goose",
|
||||
"ai",
|
||||
"agent",
|
||||
"cli",
|
||||
"terminal"
|
||||
],
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"goose": "dist/tui.js"
|
||||
@@ -24,7 +31,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@agentclientprotocol/sdk": "^0.14.1",
|
||||
"@block/goose-acp": "^0.1.0",
|
||||
"@aaif/goose-acp": "workspace:*",
|
||||
"ink": "^6.8.0",
|
||||
"ink-text-input": "^6.0.0",
|
||||
"marked": "^15.0.12",
|
||||
@@ -33,11 +40,11 @@
|
||||
"react": "^19.2.4"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@block/goose-acp-server-darwin-arm64": "0.1.0",
|
||||
"@block/goose-acp-server-darwin-x64": "0.1.0",
|
||||
"@block/goose-acp-server-linux-arm64": "0.1.0",
|
||||
"@block/goose-acp-server-linux-x64": "0.1.0",
|
||||
"@block/goose-acp-server-win32-x64": "0.1.0"
|
||||
"@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:*"
|
||||
},
|
||||
"overrides": {
|
||||
"react": "19.2.4"
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Builds the goose-acp-server binary for each target platform and places it
|
||||
# into the corresponding npm package directory under npm/.
|
||||
#
|
||||
# Usage:
|
||||
# ./ui/text/scripts/build-native-packages.sh # build all targets
|
||||
# ./ui/text/scripts/build-native-packages.sh darwin-arm64 # build one target
|
||||
#
|
||||
# Prerequisites:
|
||||
# - Rust cross-compilation toolchains installed for each target
|
||||
# - Run from the repository root
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "$0")/../../.." && pwd)"
|
||||
NPM_DIR="${REPO_ROOT}/npm"
|
||||
|
||||
declare -A RUST_TARGETS=(
|
||||
["darwin-arm64"]="aarch64-apple-darwin"
|
||||
["darwin-x64"]="x86_64-apple-darwin"
|
||||
["linux-arm64"]="aarch64-unknown-linux-gnu"
|
||||
["linux-x64"]="x86_64-unknown-linux-gnu"
|
||||
["win32-x64"]="x86_64-pc-windows-msvc"
|
||||
)
|
||||
|
||||
build_target() {
|
||||
local platform="$1"
|
||||
local rust_target="${RUST_TARGETS[$platform]}"
|
||||
local pkg_dir="${NPM_DIR}/goose-acp-server-${platform}"
|
||||
local bin_dir="${pkg_dir}/bin"
|
||||
|
||||
echo "==> Building goose for ${platform} (${rust_target})"
|
||||
|
||||
cargo build --release --target "${rust_target}" --bin goose
|
||||
|
||||
mkdir -p "${bin_dir}"
|
||||
|
||||
local ext=""
|
||||
if [[ "$platform" == win32-* ]]; then
|
||||
ext=".exe"
|
||||
fi
|
||||
|
||||
cp "${REPO_ROOT}/target/${rust_target}/release/goose${ext}" "${bin_dir}/goose${ext}"
|
||||
chmod +x "${bin_dir}/goose${ext}"
|
||||
|
||||
echo " Placed binary at ${bin_dir}/goose${ext}"
|
||||
}
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
# Build specific target(s)
|
||||
for target in "$@"; do
|
||||
if [[ -z "${RUST_TARGETS[$target]+x}" ]]; then
|
||||
echo "Unknown target: ${target}"
|
||||
echo "Valid targets: ${!RUST_TARGETS[*]}"
|
||||
exit 1
|
||||
fi
|
||||
build_target "$target"
|
||||
done
|
||||
else
|
||||
# Build all targets
|
||||
for platform in "${!RUST_TARGETS[@]}"; do
|
||||
build_target "$platform"
|
||||
done
|
||||
fi
|
||||
|
||||
echo "==> Done. Native packages staged in ${NPM_DIR}/"
|
||||
@@ -13,11 +13,11 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
const PLATFORMS = {
|
||||
"darwin-arm64": "@block/goose-acp-server-darwin-arm64",
|
||||
"darwin-x64": "@block/goose-acp-server-darwin-x64",
|
||||
"linux-arm64": "@block/goose-acp-server-linux-arm64",
|
||||
"linux-x64": "@block/goose-acp-server-linux-x64",
|
||||
"win32-x64": "@block/goose-acp-server-win32-x64",
|
||||
"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",
|
||||
};
|
||||
|
||||
const key = `${process.platform}-${process.arch}`;
|
||||
@@ -25,7 +25,7 @@ const pkg = PLATFORMS[key];
|
||||
|
||||
if (!pkg) {
|
||||
console.warn(
|
||||
`@block/goose: no prebuilt goose-acp-server binary for ${key}. ` +
|
||||
`@aaif/goose: no prebuilt goose-acp-server binary for ${key}. ` +
|
||||
`You will need to provide a server URL manually with --server.`,
|
||||
);
|
||||
process.exit(0);
|
||||
@@ -35,12 +35,12 @@ 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.exe" : "goose";
|
||||
const binName = process.platform === "win32" ? "goose-acp-server.exe" : "goose-acp-server";
|
||||
binaryPath = join(pkgDir, "bin", binName);
|
||||
} catch {
|
||||
// The optional dependency wasn't installed (e.g. wrong platform). That's fine.
|
||||
console.warn(
|
||||
`@block/goose: optional dependency ${pkg} not installed. ` +
|
||||
`@aaif/goose: optional dependency ${pkg} not installed. ` +
|
||||
`You will need to provide a server URL manually with --server.`,
|
||||
);
|
||||
process.exit(0);
|
||||
@@ -53,4 +53,4 @@ writeFileSync(
|
||||
JSON.stringify({ binaryPath }, null, 2) + "\n",
|
||||
);
|
||||
|
||||
console.log(`@block/goose: found native server binary at ${binaryPath}`);
|
||||
console.log(`@aaif/goose: found native server binary at ${binaryPath}`);
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ import type {
|
||||
Stream,
|
||||
} from "@agentclientprotocol/sdk";
|
||||
import { ndJsonStream } from "@agentclientprotocol/sdk";
|
||||
import { GooseClient } from "@block/goose-acp";
|
||||
import { GooseClient } from "@aaif/goose-acp";
|
||||
import { renderMarkdown } from "./markdown.js";
|
||||
import { buildToolCallCardLines, ToolCallCompact, findFeaturedToolCallId } from "./toolcall.js";
|
||||
import type { ToolCallInfo } from "./toolcall.js";
|
||||
|
||||
Reference in New Issue
Block a user