ai: tighten public surface and document CuaProvider + supported models - #7
Merged
Conversation
- Un-export parseCuaModelRef/formatCuaModelRef (internal helpers). - Add docs/supported-models.md enumerating CUA-supported models per provider with source citations, linked from README. - Add a CuaProvider section to the README explaining the type, its relationship to pi-ai's Provider, and the gemini/google rename. - Drop the now-redundant "See examples/quickstart.ts" line from the README quick start.
- Rename CuaProvider key from "gemini" to "google" so it matches pi-ai's Model.provider exactly. providerForModel becomes a thin isCuaProvider guard. Drops the rename map and the dead piProviderFor switch. - Switch packages/ai/src/index.ts from `export *` to named re-exports for models.ts and providers/common.ts. Keeps the public surface to getCuaModel/listCuaModels/providerForModel/isCuaProvider, the action types/input types, CUA tool name constants, CUA_ACTION_TYPES, and createComputerToolDefinitions. Internal exports (parseCuaModelRef, formatCuaModelRef, findCuaAnnotation, CUA_PROVIDERS, CUA_MODEL_ANNOTATIONS, schemas) stay reachable from tests via ../src/models.js but are no longer part of the package interface. - Restore parse/format unit tests, plus update annotation tests to the new google key. - Trim README copy: drop the registry/override caveat, drop "with source citations", and rewrite the CuaProvider section now that the rename is gone. Reword the action-vocabulary section to talk about types instead of dropped schemas.
Tzafon's model is non-deterministic about emitting tool calls under our test prompts; mirror the requireToolCalls guard from #8 so a no-tool-call response no longer fails CI. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
rgarcia
marked this pull request as ready for review
May 13, 2026 15:54
|
Firetiger deploy monitoring skipped This PR didn't match the auto-monitor filter configured on your GitHub connection:
Reason: PR modifies documentation and public API surface of the To monitor this PR anyway, reply with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up polish to
@onkernel/cua-ai's docs and public surface:parseCuaModelRef/formatCuaModelRef: now module-private. They were only ever shaped as implementation details (pure string munging) and had no external callers in the workspace —getCuaModelexercises both internally. Tests for the error paths now route throughgetCuaModelso the user-visible behavior is still covered. Also dropped the empty-id guard fromformatCuaModelRefsince both call sites pass a known-non-empty id.CuaProvidersection between Model Refs andlistCuaModels. Explains thatCuaProvideris a string union (not a runtime object), how it overlaps with pi-ai'sProvider, and thegemini/googlerename.docs/supported-models.mdand linked it from Model Refs. Each provider section lists family/exact matchers with citation links to the official CUA docs.timestamp: Date.now(): kept. Investigated pi-ai'scomplete()— it just delegates to the registered provider's stream function and pi-ai'sUserMessagetype requirestimestamp: number. Nothing defaults it, so the example must include it.Test plan
npm run build(cua-ai package)npm test(cua-ai package — 43 passed / 7 skipped)npm run typecheck(workspace)🤖 Generated with Claude Code
Note
Medium Risk
Medium risk because it changes the public provider identifier from
geminitogoogleand narrows top-level exports, which can break downstream imports and model refs even though runtime behavior is mostly unchanged.Overview
Provider ID alignment: switches CUA provider/model refs from
gemini:*togoogle:*(including agent defaults, tool routing, model annotations/overrides, examples, and integration tests) and simplifiesproviderForModel()to returnmodel.providerafter validation.Public surface + docs: restructures
packages/ai/src/index.tsto explicitly export only the intended APIs/types (addingisCuaProvider) and addsdocs/supported-models.mdplus README updates describingCuaProvider, model-ref format, and supported-model listings.Test robustness: relaxes batch tool integration assertions for providers that may emit no tool calls (e.g. tzafon), gating expectations via new per-provider flags while still requiring usage token reporting.
Reviewed by Cursor Bugbot for commit ce5024b. Bugbot is set up for automated code reviews on this repo. Configure here.