feat: zod validation, explicit load results, V2 wire modelID fix - #140
Merged
Merged
Conversation
- Add src/schemas.ts (ModelEntry/Manifest/availability/plugin config) as the single source of truth; catalog/manifest types derive via z.infer. - Add explicit LoadResult boundaries (src/load-result.ts) and a hermetic EnvDeps seam (src/env.ts); degraded reasons carry the real cause. - Parse bundled models.json entry-by-entry, dropping invalid entries with reasons instead of failing the whole catalog. - V2 modelID is the full catalog wire id; the UI/map key stays the toConfigKey short name.
V1 resolves provider npm through BunProc.install and calls the first create* export, so the plugin package itself can never be the SDK npm field. Default provider.commandcode to @ai-sdk/openai-compatible and add the Provider API baseURL unless a custom npm/baseURL is already configured. Aligns the sync:global helper and README transport section with the same defaults.
Refresh devDependencies (ai 7.0.114, oxlint 1.85.0, oxfmt 0.70.0, typescript 6.0.3) and remove the last caret ranges so the lockfile is fully exact. chore commits are path-gated out of releases.
README now leads with how the pipeline works (extract/filter, cost merge, artifacts, V1+V2 injection, fallbacks) and the shipped plugin config file. Plans and task notes are removed; docs/specs describe what ships, including the new catalog-freshness spec. AGENTS.md gains the docs rule and the validation/runtime-weight boundaries.
Contributor
|
🎉 This PR is included in version 0.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Lands the follow-up work on top of the dual V1+V2 plugin (#138):
ad5f1e3feat: zod validation, explicit load results, V2 wire modelID fix —src/schemas.tsis the single source of truth (catalog.ts/manifest.tstypes derive viaz.infer), explicitLoadResultboundaries plus a hermeticEnvDepsseam, per-entry validation of bundledmodels.jsonwith degraded reasons carrying the real cause, and the V2modelIDfix (UI/map key staystoConfigKeyshort; the wire id is the full catalog id).b482ef0fix: use @ai-sdk/openai-compatible as V1 provider npm default — V1provider.commandcodedefaults now point at the real AI SDK package plus the Provider APIbaseURL; a custom npm or baseURL is left untouched. Mirrored insync:globaland the README transport section.a87bd6cchore(deps): refresh and hard-pin dependencies — ai 7.0.114, oxlint/oxfmt/typescript pins, lockfile refreshed (path-gated: no release).d572eb2docs: rewrite README flow and prune docs to specs — how-it-works flow, plugin config table, plans removed, specs updated, new catalog-freshness spec, AGENTS.md docs/validation rules.Verification
bun run checkgreen on the tip: 214 pass / 0 fail, oxlint + oxfmt --check + tsc --noEmit.bun install --frozen-lockfile --dry-runclean on the tip and on the zod-only intermediate commit.README.md/docs/specs/in the same branch (AGENTS.md docs rule).Release
Latest tag is
v0.8.0; thefeatcommit touches product paths, so semantic-release is expected to cut a minor bump → 0.9.0 after auto-merge. No publish commands run here.