Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,20 @@ jobs:
run: npm test --workspace @onkernel/cua-cli
- name: Build cua-cli
run: npm run build --workspace @onkernel/cua-cli
- name: Pack tarball
run: npm pack --workspace @onkernel/cua-cli --pack-destination "$RUNNER_TEMP"
- name: Pack tarballs
# Pack the workspace dependencies too so the smoke install resolves
# them from the tarballs instead of the registry, where the versions
# under development are not published yet.
run: |
npm pack --workspace @onkernel/cua-ai --pack-destination "$RUNNER_TEMP"
npm pack --workspace @onkernel/cua-agent --pack-destination "$RUNNER_TEMP"
npm pack --workspace @onkernel/cua-cli --pack-destination "$RUNNER_TEMP"
- name: CLI bin smoke test
run: |
SMOKE_DIR=$(mktemp -d)
cd "$SMOKE_DIR"
npm init -y > /dev/null
npm install "$RUNNER_TEMP"/onkernel-cua-cli-*.tgz
npm install "$RUNNER_TEMP"/onkernel-cua-ai-*.tgz "$RUNNER_TEMP"/onkernel-cua-agent-*.tgz "$RUNNER_TEMP"/onkernel-cua-cli-*.tgz
OUTPUT=$(./node_modules/.bin/cua --help)
echo "$OUTPUT"
echo "$OUTPUT" | grep -q "Usage:"
Expand Down
4 changes: 2 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ user prompt
├─► resolveCuaRuntimeSpec(model) provides toolDefinitions,
│ toolExecutors, defaultSystemPrompt, onPayload, …
├─► onPayload (cua-ai) — provider payload transforms
├─► pi-ai streamSimple → provider HTTP SSE
├─► pi Models.streamSimple (cuaModels) → provider HTTP SSE
│ (OpenAI Responses / Anthropic Messages / Google GenAI / Tzafon / Yutori)
├─► tool_call events carry canonical CuaAction args
│ └─► cua-agent executor
Expand Down Expand Up @@ -286,7 +286,7 @@ flowchart LR
browserMod --> sdk[("@onkernel/sdk")]
harness --> agentPkg["cua-agent: CuaAgentHarness"]
agentPkg --> piHarness["pi-agent-core AgentHarness"]
piHarness --> piAi["pi-ai streamSimple"]
piHarness --> piAi["pi Models.streamSimple (cuaModels)"]
piAi -->|"openai-responses"| openai[("api.openai.com /v1/responses")]
piAi -->|"anthropic-messages + beta header"| anthro[("api.anthropic.com /v1/messages")]
piAi -->|"google-generative-ai"| gemini[("generativelanguage.googleapis.com")]
Expand Down
15 changes: 8 additions & 7 deletions docs/cua-cli-harness-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ Goals, in priority order:
interactive UI is rebuilt on pi-tui primitives instead. pi-tui 0.79 provides
`Markdown`, `Image` (kitty/iTerm2), `Editor` (autocomplete), `SelectList`,
overlays, keybindings, `ProcessTerminal`.
- pi-ai's `registerApiProvider` registry is process-global: a test fixture can
register a scripted `streamSimple` for an API id and the real harness will
route model calls through it. This replaces the `InteractiveDriver` test seam.
- The harness streams through a pi `Models` collection: a test fixture can
build a `createCuaModels()` collection with a scripted provider and pass it
to `buildCuaHarness({ models })`, and the real harness routes model calls
through it. This replaces the `InteractiveDriver` test seam.
- `@onkernel/cua-ai` owns the model catalog: `listCuaModels`,
`parseCuaModelRef`, `getCuaModel`, `CuaModelRef` (`provider:model`), and the
documented API-key env-var conventions (`getCuaEnvApiKey`).
Expand Down Expand Up @@ -128,10 +129,10 @@ Module map (current → target):

## Test strategy

- **Scripted provider fixture**: a test-only pi-ai provider registered with
`registerApiProvider`, whose `streamSimple` replays declarative steps (text
deltas, canonical CUA tool calls, errors, await-abort) — port of the current
`ScriptedDriver` JSON step DSL, moved below the harness.
- **Scripted provider fixture**: a test-only pi provider placed in a
`createCuaModels()` collection, whose `streamSimple` replays declarative
steps (text deltas, canonical CUA tool calls, errors, await-abort) — port
of the current `ScriptedDriver` JSON step DSL, moved below the harness.
- **Fake Kernel client**: plain object stubbing
`browsers.computer.{batch,captureScreenshot,readClipboard}` etc. (pattern
already proven in `packages/agent/test`).
Expand Down
Loading
Loading