@aaif/goose-sdk

中文文档
0.20.2发布于 2026/06/10Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 2816

Agent Client Protocol (ACP) SDK for Goose AI agent

原始使用文档
文档目录10 节
  1. Installation
  2. Development
  3. Prerequisites
  4. Building
  5. Local Development with npm link
  6. Schema Generation
  7. Native Binary Packages
  8. Building Native Binaries
  9. Publishing
  10. Usage

@aaif/goose-sdk

TypeScript client library for the Goose Agent Client Protocol (ACP).

This package provides:

  • TypeScript types and Zod validators for Goose ACP extension methods
  • A client for communicating with the Goose ACP server

Installation

npm install @aaif/goose-sdk

The native goose binaries are distributed as optional dependencies and will be automatically installed for your platform.

Development

Prerequisites

  • Node.js 18+
  • Rust toolchain
  • (Optional) Cross-compilation toolchains for building all platforms

Building

# Build everything (schema + TypeScript)
npm run build

# Build just the schema (requires Rust)
npm run build:schema

# Build just the TypeScript
npm run build:ts

# Build native binary for current platform
npm run build:native

# Build native binaries for all platforms
npm run build:native:all

To use this package locally in another project (e.g., @aaif/goose):

# In ui/sdk
npm run build
npm link

# In ui/text (or another project)
npm link @aaif/goose-sdk

Schema Generation

The TypeScript types are generated from Rust schemas defined in crates/goose. The build process:

  1. Builds the generate-acp-schema Rust binary
  2. Runs it to generate acp-schema.json and acp-meta.json
  3. Uses @hey-api/openapi-ts to generate TypeScript types and Zod validators
  4. Generates a typed client in src/generated/client.gen.ts

To regenerate schemas after changing Rust types:

npm run build:schema

Native Binary Packages

Platform-specific npm packages for the goose binary are located in ui/goose-binary/:

PackagePlatform
@aaif/goose-binary-darwin-arm64macOS Apple Silicon
@aaif/goose-binary-darwin-x64macOS Intel
@aaif/goose-binary-linux-arm64Linux ARM64
@aaif/goose-binary-linux-x64Linux x64
@aaif/goose-binary-win32-x64Windows x64

These are published separately from @aaif/goose-sdk.

Building Native Binaries

# Build for current platform
npm run build:native

# Build for all platforms (requires cross-compilation toolchains)
npm run build:native:all

# Build for specific platform(s)
npx tsx scripts/build-native.ts darwin-arm64 linux-x64

Publishing

Publishing is handled by GitHub Actions. See .github/workflows/publish-npm.yml.

For manual publishing:

# From repository root
./ui/scripts/publish.sh --real

This will:

  1. Build and publish @aaif/goose-sdk
  2. Publish all native binary packages
  3. Publish @aaif/goose (which depends on the above)

Usage

import { GooseClient } from "@aaif/goose-sdk";

const client = new GooseClient({
  // ... configuration
});

// Use the client
const result = await client.someMethod({ ... });

See the main documentation for more details.

版本与发布记录

@aaif/goose-sdk 共发布 7 个版本,首次发布于 2026/04/16;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.20.2latest2026/06/104 个月前
0.20.12026/05/155 个月前
0.20.02026/05/155 个月前
0.19.12026/05/086 个月前
0.19.02026/04/256 个月前
0.17.02026/04/166 个月前

关于 @aaif/goose-sdk 的常见问题

@aaif/goose-sdk 是什么?

Agent Client Protocol (ACP) SDK for Goose AI agent

如何安装 @aaif/goose-sdk?

在项目目录运行 npm install @aaif/goose-sdk,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@agentclientprotocol/sdk(^0.19.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@aaif/goose-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@aaif/goose-sdk 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@aaif/goose-sdk 可以商用吗?

@aaif/goose-sdk 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@aaif/goose-sdk 的下载量有多少?

根据 npm 官方下载统计,@aaif/goose-sdk 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,816 次,日均约 94 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aaif/goose-sdk 还在维护吗?

最新版本 0.20.2 发布于 2026/06/10(4 个月前);至今共发布 7 个版本,其中过去 12 个月发布了 7 个;首次发布于 2026/04/16。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。