mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
refactor: @aaif/goose-acp -> @aaif/goose-sdk (#8555)
This commit is contained in:
@@ -1,182 +0,0 @@
|
||||
# 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)
|
||||
+6
-6
@@ -1,4 +1,4 @@
|
||||
# @aaif/goose-acp
|
||||
# @aaif/goose-sdk
|
||||
|
||||
TypeScript client library for the Goose Agent Client Protocol (ACP).
|
||||
|
||||
@@ -9,7 +9,7 @@ This package provides:
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
npm install @aaif/goose-acp
|
||||
npm install @aaif/goose-sdk
|
||||
```
|
||||
|
||||
The native `goose` binaries are distributed as optional dependencies
|
||||
@@ -52,7 +52,7 @@ npm run build
|
||||
npm link
|
||||
|
||||
# In ui/text (or another project)
|
||||
npm link @aaif/goose-acp
|
||||
npm link @aaif/goose-sdk
|
||||
```
|
||||
|
||||
### Schema Generation
|
||||
@@ -84,7 +84,7 @@ Platform-specific npm packages for the `goose` binary are located in
|
||||
| `@aaif/goose-binary-linux-x64` | Linux x64 |
|
||||
| `@aaif/goose-binary-win32-x64` | Windows x64 |
|
||||
|
||||
These are published separately from `@aaif/goose-acp`.
|
||||
These are published separately from `@aaif/goose-sdk`.
|
||||
|
||||
### Building Native Binaries
|
||||
|
||||
@@ -111,14 +111,14 @@ For manual publishing:
|
||||
```
|
||||
|
||||
This will:
|
||||
1. Build and publish `@aaif/goose-acp`
|
||||
1. Build and publish `@aaif/goose-sdk`
|
||||
2. Publish all native binary packages
|
||||
3. Publish `@aaif/goose` (which depends on the above)
|
||||
|
||||
## Usage
|
||||
|
||||
```typescript
|
||||
import { GooseClient } from "@aaif/goose-acp";
|
||||
import { GooseClient } from "@aaif/goose-sdk";
|
||||
|
||||
const client = new GooseClient({
|
||||
// ... configuration
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@aaif/goose-acp",
|
||||
"name": "@aaif/goose-sdk",
|
||||
"version": "0.16.0",
|
||||
"description": "Agent Client Protocol (ACP) SDK for Goose AI agent",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
"i18n:compile": "node scripts/i18n-compile.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aaif/goose-acp": "workspace:*",
|
||||
"@aaif/goose-sdk": "workspace:*",
|
||||
"@mcp-ui/client": "6.1.0",
|
||||
"@modelcontextprotocol/ext-apps": "^1.1.1",
|
||||
"@radix-ui/react-accordion": "^1.2.12",
|
||||
|
||||
@@ -43,7 +43,7 @@ For manual publishing:
|
||||
./ui/scripts/publish.sh --real
|
||||
```
|
||||
|
||||
This will publish all native packages along with `@aaif/goose-acp` and `@aaif/goose`.
|
||||
This will publish all native packages along with `@aaif/goose-sdk` and `@aaif/goose`.
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -43,7 +43,7 @@ importers:
|
||||
|
||||
desktop:
|
||||
dependencies:
|
||||
'@aaif/goose-acp':
|
||||
'@aaif/goose-sdk':
|
||||
specifier: workspace:*
|
||||
version: link:../acp
|
||||
'@mcp-ui/client':
|
||||
@@ -664,7 +664,7 @@ importers:
|
||||
|
||||
text:
|
||||
dependencies:
|
||||
'@aaif/goose-acp':
|
||||
'@aaif/goose-sdk':
|
||||
specifier: workspace:*
|
||||
version: link:../acp
|
||||
'@agentclientprotocol/sdk':
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
"lint": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aaif/goose-acp": "workspace:*",
|
||||
"@aaif/goose-sdk": "workspace:*",
|
||||
"@agentclientprotocol/sdk": "^0.14.1",
|
||||
"@inkjs/ui": "^2.0.0",
|
||||
"ink": "^6.8.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect, useCallback } from "react";
|
||||
import { Box, Text, useInput, useStdout } from "ink";
|
||||
import type { GooseClient, ProviderDetailEntry } from "@aaif/goose-acp";
|
||||
import type { GooseClient, ProviderDetailEntry } from "@aaif/goose-sdk";
|
||||
import {
|
||||
TEAL,
|
||||
GOLD,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useState, useEffect, useCallback } from "react";
|
||||
import { Box, Text, useInput, useStdout } from "ink";
|
||||
import { TextInput, PasswordInput } from '@inkjs/ui';
|
||||
import type { GooseClient, ProviderDetailEntry } from "@aaif/goose-acp";
|
||||
import type { GooseClient, ProviderDetailEntry } from "@aaif/goose-sdk";
|
||||
import {
|
||||
CRANBERRY,
|
||||
TEAL,
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import type {
|
||||
ToolCallUpdate,
|
||||
} from "@agentclientprotocol/sdk";
|
||||
import { ndJsonStream } from "@agentclientprotocol/sdk";
|
||||
import { GooseClient } from "@aaif/goose-acp";
|
||||
import { GooseClient } from "@aaif/goose-sdk";
|
||||
import Onboarding from "./onboarding.js";
|
||||
import ConfigureScreen from "./configure.js";
|
||||
import type { PendingPermission, ResponseItem, Turn } from "./types.js";
|
||||
|
||||
Reference in New Issue
Block a user