Skip to content

Commit c99467c

Browse files
authored
Merge pull request #69 from kernel/hypeship/agent-tool-configuration
Make agent tool configuration explicit
2 parents 1782b43 + e85e6af commit c99467c

134 files changed

Lines changed: 10523 additions & 8998 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/release/SKILL.md‎

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
name: release
3-
description: Prepare and publish @onkernel/cua-ai and @onkernel/cua-agent npm releases from kernel/cua. Use when checking release readiness, choosing package versions, writing package changelogs, committing release metadata to main, pushing package-prefixed tags, or monitoring release workflows.
3+
description: Prepare and publish @onkernel/cua-ai, @onkernel/cua-agent, and @onkernel/cua-cli npm releases from kernel/cua. Use when checking release readiness, choosing package versions, writing package changelogs, committing release metadata to main, pushing package-prefixed tags, or monitoring release workflows.
44
---
55

66
# Release
77

8-
Use this workflow to release `@onkernel/cua-ai` and `@onkernel/cua-agent`. The
9-
packages do not need to release in lockstep.
8+
Use this workflow to release `@onkernel/cua-ai`, `@onkernel/cua-agent`, and
9+
`@onkernel/cua-cli`. The packages do not need to release in lockstep.
1010

1111
If a release run hits an unexpected bump, unclear decision, missing command, or
1212
avoidable manual step, update this skill as part of the release cleanup. Keep
@@ -19,9 +19,11 @@ error-prone.
1919
| --- | --- | --- | --- |
2020
| `@onkernel/cua-ai` | `packages/ai` | `cua-ai/v` | `release-cua-ai.yml` |
2121
| `@onkernel/cua-agent` | `packages/agent` | `cua-agent/v` | `release-cua-agent.yml` |
22+
| `@onkernel/cua-cli` | `packages/cli` | `cua-cli/v` | `release-cua-cli.yml` |
2223

23-
Release `@onkernel/cua-ai` before `@onkernel/cua-agent` when both are changing
24-
or when the agent package depends on the new AI package version.
24+
When all three change, release in dependency order: `cua-ai`, then `cua-agent`,
25+
then `cua-cli`. The CLI production workflow verifies that its exact AI and agent
26+
dependency versions already exist on npm.
2527

2628
## Quick Start
2729

@@ -39,15 +41,18 @@ git fetch --tags origin
3941
git status --short
4042
npm view @onkernel/cua-ai versions --json
4143
npm view @onkernel/cua-agent versions --json
44+
npm view @onkernel/cua-cli versions --json
4245
test -f .github/workflows/release-cua-ai.yml
4346
test -f .github/workflows/release-cua-agent.yml
47+
test -f .github/workflows/release-cua-cli.yml
4448
```
4549

4650
3. For each package, find the previous release tag:
4751

4852
```bash
4953
git tag --list "cua-ai/v*" --sort=-v:refname | head -1
5054
git tag --list "cua-agent/v*" --sort=-v:refname | head -1
55+
git tag --list "cua-cli/v*" --sort=-v:refname | head -1
5156
```
5257

5358
If no tag exists, treat the next release as the package's current
@@ -61,10 +66,13 @@ git diff --name-status <last-tag>..HEAD -- packages/ai package.json package-lock
6166

6267
git log --oneline <last-tag>..HEAD -- packages/agent packages/ai package.json package-lock.json tsconfig.base.json
6368
git diff --name-status <last-tag>..HEAD -- packages/agent packages/ai package.json package-lock.json tsconfig.base.json
69+
70+
git log --oneline <last-tag>..HEAD -- packages/cli packages/agent packages/ai package.json package-lock.json tsconfig.base.json
71+
git diff --name-status <last-tag>..HEAD -- packages/cli packages/agent packages/ai package.json package-lock.json tsconfig.base.json
6472
```
6573

66-
For `@onkernel/cua-agent`, include `packages/ai` changes only when they affect
67-
the published agent dependency or runtime behavior.
74+
For a dependent package, include upstream package changes only when they affect
75+
its published dependency version or runtime behavior.
6876

6977
## Version Choice
7078

@@ -89,6 +97,7 @@ Update only the changelog for packages being released:
8997

9098
- `packages/ai/CHANGELOG.md`
9199
- `packages/agent/CHANGELOG.md`
100+
- `packages/cli/CHANGELOG.md`
92101

93102
Add a new top entry:
94103

@@ -110,12 +119,12 @@ Set versions explicitly:
110119
```bash
111120
npm pkg set version=<version> --workspace @onkernel/cua-ai
112121
npm pkg set version=<version> --workspace @onkernel/cua-agent
122+
npm pkg set version=<version> --workspace @onkernel/cua-cli
113123
```
114124

115-
When releasing `@onkernel/cua-agent`, ensure its `@onkernel/cua-ai` dependency
116-
points at the intended published AI package version. Edit
117-
`packages/agent/package.json` directly if `npm pkg set` is awkward for the
118-
scoped dependency key.
125+
Ensure exact internal dependencies point at the versions that will be published
126+
first: agent to AI, and CLI to both AI and agent. Edit the package manifests
127+
directly if `npm pkg set` is awkward for scoped dependency keys.
119128

120129
Refresh the lockfile:
121130

@@ -143,6 +152,17 @@ npm test --workspace @onkernel/cua-agent
143152
npm pack --workspace @onkernel/cua-agent --dry-run
144153
```
145154

155+
For `@onkernel/cua-cli`:
156+
157+
```bash
158+
npm run build --workspace @onkernel/cua-ai
159+
npm run build --workspace @onkernel/cua-agent
160+
npm run build --workspace @onkernel/ptywright
161+
npm run build --workspace @onkernel/cua-cli
162+
PTYWRIGHT_REQUIRED=1 npm test --workspace @onkernel/cua-cli
163+
npm pack --workspace @onkernel/cua-cli --dry-run
164+
```
165+
146166
Run the full unit suites — do not pass individual test files. `cua-ai`
147167
excludes integration/live tests by default (`npm run test:integration
148168
--workspace @onkernel/cua-ai` runs them separately), and the `cua-agent` live
@@ -157,7 +177,7 @@ limited to package versions, changelogs, and `package-lock.json`.
157177

158178
```bash
159179
git status --short
160-
git add package-lock.json packages/ai/package.json packages/ai/CHANGELOG.md packages/agent/package.json packages/agent/CHANGELOG.md
180+
git add package-lock.json packages/ai/package.json packages/ai/CHANGELOG.md packages/agent/package.json packages/agent/CHANGELOG.md packages/cli/package.json packages/cli/CHANGELOG.md
161181
git commit -m "Release CUA packages"
162182
git push origin main
163183
```
@@ -180,10 +200,13 @@ For the agent package:
180200
```bash
181201
git tag -a cua-agent/v<version> -m "@onkernel/cua-agent v<version>"
182202
git push origin cua-agent/v<version>
203+
204+
git tag -a cua-cli/v<version> -m "@onkernel/cua-cli v<version>"
205+
git push origin cua-cli/v<version>
183206
```
184207

185-
Push the AI tag first and wait for it to publish before pushing the agent tag
186-
when the agent depends on that AI version.
208+
Push and verify each dependency tag before the next one: AI, then agent, then
209+
CLI.
187210

188211
## Monitor
189212

@@ -195,6 +218,9 @@ gh run watch <run-id> --exit-status
195218

196219
gh run list --workflow release-cua-agent.yml --json databaseId,status,conclusion,headBranch,displayTitle,url --limit 10
197220
gh run watch <run-id> --exit-status
221+
222+
gh run list --workflow release-cua-cli.yml --json databaseId,status,conclusion,headBranch,displayTitle,url --limit 10
223+
gh run watch <run-id> --exit-status
198224
```
199225

200226
After a workflow succeeds, verify npm:
@@ -204,6 +230,8 @@ npm view @onkernel/cua-ai@<version> version
204230
npm dist-tag ls @onkernel/cua-ai
205231
npm view @onkernel/cua-agent@<version> version
206232
npm dist-tag ls @onkernel/cua-agent
233+
npm view @onkernel/cua-cli@<version> version
234+
npm dist-tag ls @onkernel/cua-cli
207235
```
208236

209237
Then verify the published artifact actually imports — `npm view` only proves
@@ -217,7 +245,8 @@ node --input-type=module -e "import('@onkernel/cua-ai').then((m) => { if (typeof
217245
```
218246

219247
For `@onkernel/cua-agent`, install `@onkernel/cua-agent@<version>` the same
220-
way and check `typeof m.CuaAgent === "function"`.
248+
way and check `typeof m.CuaAgent === "function"`. For the CLI, install it in a
249+
fresh directory and verify `./node_modules/.bin/cua --help` prints `Usage:`.
221250

222251
If a workflow fails after a tag is pushed, do not reuse the same package
223252
version unless npm did not publish it. Fix forward with a new commit and a new

‎.agents/skills/update-docs/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ For every doc update:
4141
Start with these source-of-truth checks:
4242

4343
- Package topology: `package.json`, `tsconfig.json`, and `packages/*/package.json`.
44-
- Design invariants: `@onkernel/cua-ai` owns provider-specific policy (catalog, tool schemas, payload transforms); `@onkernel/cua-agent` is provider-neutral runtime glue around `pi-agent-core` (no provider names in `packages/agent/src`); every provider difference reaches the agent as data through `CuaRuntimeSpec`; `@onkernel/cua-cli` composes both for orchestration.
45-
- Model layer: `packages/ai/src/index.ts`, `getCuaModel`/`listCuaModels`/`parseCuaModelRef`, `resolveCuaRuntimeSpec`, provider adapters, and `api-keys.ts`.
44+
- Design invariants: `@onkernel/cua-ai` owns provider-specific policy (catalog, tool schemas, payload transforms); `@onkernel/cua-agent` is provider-neutral runtime glue around `pi-agent-core` (no provider names in `packages/agent/src`); provider differences reach the agent as compiled `CuaToolCatalog` data; `@onkernel/cua-cli` composes both for orchestration.
45+
- Model layer: `packages/ai/src/index.ts`, `cua.ts`, `tool-catalog.ts`, `getCuaModel`/`listCuaModels`/`parseCuaModelRef`, provider adapters, and `api-keys.ts`.
4646
- Execution layer: `packages/agent/src/index.ts`, `CuaAgent` and `CuaAgentHarness` wiring, and the canonical CUA tool executors against `@onkernel/sdk`.
4747
- CLI runtime flow: `packages/cli/src/cli.ts`, `cli-harness.ts`, `harness.ts`, `harness-browser.ts`, `harness-models.ts`, `harness-sessions.ts`, `harness-named-sessions.ts`, `harness-skills.ts`, `print.ts`, `output/harness-jsonl.ts`, `action/`, and `tui/`.
4848
- TUI test infrastructure: `packages/ptywright/package.json`, `src/index.ts`, `src/session.ts`, `src/terminal.ts`, and `README.md`.

‎.github/workflows/release-cua-agent.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,16 @@ jobs:
8080
npm init -y > /dev/null
8181
npm install /tmp/pack/*.tgz
8282
cat > smoke.mjs <<'EOF'
83-
import { CuaAgent, CuaAgentHarness, createCuaComputerTools, NodeExecutionEnv } from "@onkernel/cua-agent";
83+
import { cua, CuaAgent, CuaAgentHarness, formatBrowserActResult, NodeExecutionEnv } from "@onkernel/cua-agent";
8484
85-
for (const [name, value] of Object.entries({ CuaAgent, CuaAgentHarness, createCuaComputerTools, NodeExecutionEnv })) {
85+
for (const [name, value] of Object.entries({ CuaAgent, CuaAgentHarness, formatBrowserActResult, NodeExecutionEnv })) {
8686
if (typeof value !== "function") {
8787
throw new Error(`expected ${name} to be a function, got ${typeof value}`);
8888
}
8989
}
90+
if (typeof cua !== "object" || cua === null) {
91+
throw new Error(`expected cua to be an object, got ${typeof cua}`);
92+
}
9093
console.log("ESM import smoke OK");
9194
EOF
9295
node smoke.mjs

0 commit comments

Comments
 (0)