{"_id":"@aihubmix/model-schema","_rev":"5-655f95935f6ca607d03cc6e7f5518189","name":"@aihubmix/model-schema","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@aihubmix/model-schema","version":"0.1.0","license":"MIT","_id":"@aihubmix/model-schema@0.1.0","maintainers":[{"name":"chenxue","email":"450907240@qq.com"}],"homepage":"https://github.com/AIhubmix/aihubmix-model-schema#readme","bugs":{"url":"https://github.com/AIhubmix/aihubmix-model-schema/issues"},"dist":{"shasum":"f443c3c446de4f77dc6e3f166625ea6659618c74","tarball":"https://registry.npmjs.org/@aihubmix/model-schema/-/model-schema-0.1.0.tgz","fileCount":9,"integrity":"sha512-rcVxj46alz4jOFY088vmTCQ8Cs5D+7M+jZo12ItOPfbZWDOSS6nrzFp1BkFpHfa9XmkL8zyoY/ODlsCVKWOyoA==","signatures":[{"sig":"MEUCIQDtvCyOwqsTceIHP4uuQzbALDrqjsfOLylq3HlxKfX7HwIgIkLenXJ53qYE1kJddxiLTC4DXw8jFo+ELCpEeH/Fh1w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":265209},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"5c4249ad64ea053280905d5213451e1f67c9c074","scripts":{"test":"vitest run","build":"tsup","prepare":"tsup","test:all":"pnpm typecheck && pnpm test","typecheck":"tsc --noEmit"},"_npmUser":{"name":"chenxue","email":"450907240@qq.com"},"repository":{"url":"git+https://github.com/AIhubmix/aihubmix-model-schema.git","type":"git"},"_npmVersion":"10.9.8","description":"canon (AIHubMix model knowledge base) vocabulary layer: verdict semantics, capability-key to wire-shape puts, and sample values. Translates canon records into the wire-only input @aihubmix/codegen accepts.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@aihubmix/codegen":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.8","typescript":"^5.6.3","@types/node":"^22.20.1"},"_npmOperationalInternal":{"tmp":"tmp/model-schema_0.1.0_1785483004964_0.8520012353559121","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aihubmix/model-schema","version":"0.1.1","license":"MIT","_id":"@aihubmix/model-schema@0.1.1","maintainers":[{"name":"chenxue","email":"450907240@qq.com"}],"homepage":"https://github.com/AIhubmix/aihubmix-model-schema#readme","bugs":{"url":"https://github.com/AIhubmix/aihubmix-model-schema/issues"},"dist":{"shasum":"d2ae3f208e5bac792692c7a9654bbd17aade14d9","tarball":"https://registry.npmjs.org/@aihubmix/model-schema/-/model-schema-0.1.1.tgz","fileCount":9,"integrity":"sha512-TV8+Lh+5U7p7HIRbZZYzrJ+Em7fhK7gy8p2r+tE/hg/bGnkGQ6tMJGaLKGK3b6b8LlfZHHkNs/f9UKdPcHxYNA==","signatures":[{"sig":"MEYCIQC9zBpN5qjhv7mxhB3G/9cXFcZpF4YRJiyPF77z0rJ/8AIhAKf4EtRxZyHDOgRVgUizMtPZL1TVGmoMF9kJpuERtsLO","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":270391},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"656f1095b165aca99553a99434abd3e2ec136246","scripts":{"test":"vitest run","build":"tsup","prepare":"tsup","test:all":"pnpm typecheck && pnpm test","typecheck":"tsc --noEmit"},"_npmUser":{"name":"chenxue","email":"450907240@qq.com"},"repository":{"url":"git+https://github.com/AIhubmix/aihubmix-model-schema.git","type":"git"},"_npmVersion":"10.9.8","description":"canon (AIHubMix model knowledge base) vocabulary layer: verdict semantics, capability-key to wire-shape puts, and sample values. Translates canon records into the wire-only input @aihubmix/codegen accepts.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@aihubmix/codegen":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.8","typescript":"^5.6.3","@types/node":"^22.20.1"},"_npmOperationalInternal":{"tmp":"tmp/model-schema_0.1.1_1785490423607_0.39997422305589825","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aihubmix/model-schema","version":"0.1.2","license":"MIT","_id":"@aihubmix/model-schema@0.1.2","maintainers":[{"name":"chenxue","email":"450907240@qq.com"}],"homepage":"https://github.com/AIhubmix/aihubmix-model-schema#readme","bugs":{"url":"https://github.com/AIhubmix/aihubmix-model-schema/issues"},"dist":{"shasum":"8c86c4c0887febff6bec00ee623a6c82d5277416","tarball":"https://registry.npmjs.org/@aihubmix/model-schema/-/model-schema-0.1.2.tgz","fileCount":9,"integrity":"sha512-a6QmTmCgVXdCEjBx1/+uBKGKlJIw5GrDVE//46XJ7moJCa2KfWof5p3JsMDCTpmsCXyBNjJCOpARdC5dnN5h8w==","signatures":[{"sig":"MEUCIDf6XrTg2/5rQDpxdxZfE+8Ya2dUSrWeV7USAE6QNz9BAiEAx4NfB/SNi6IWwmbZx4hwuo96/C5twmsubUsVA9DL4xM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":272559},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"a6cb927cae6e33a039b567a0b8939603ebf2875e","scripts":{"test":"vitest run","build":"tsup","prepare":"tsup","test:all":"pnpm typecheck && pnpm test","typecheck":"tsc --noEmit"},"_npmUser":{"name":"chenxue","email":"450907240@qq.com"},"repository":{"url":"git+https://github.com/AIhubmix/aihubmix-model-schema.git","type":"git"},"_npmVersion":"10.9.8","description":"canon (AIHubMix model knowledge base) vocabulary layer: verdict semantics, capability-key to wire-shape puts, and sample values. Translates canon records into the wire-only input @aihubmix/codegen accepts.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@aihubmix/codegen":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vitest":"^2.1.8","typescript":"^5.6.3","@types/node":"^22.20.1"},"_npmOperationalInternal":{"tmp":"tmp/model-schema_0.1.2_1785492272079_0.220709640683165","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@aihubmix/model-schema","version":"0.1.3","license":"MIT","_id":"@aihubmix/model-schema@0.1.3","maintainers":[{"name":"chenxue","email":"450907240@qq.com"}],"homepage":"https://github.com/AIhubmix/aihubmix-model-schema#readme","bugs":{"url":"https://github.com/AIhubmix/aihubmix-model-schema/issues"},"dist":{"shasum":"52d46614daee34b237629cd5ba5a068a24c4789b","tarball":"https://registry.npmjs.org/@aihubmix/model-schema/-/model-schema-0.1.3.tgz","fileCount":9,"integrity":"sha512-GD1/3eKSvDGQwwPuLrnINmi2S8RiiXKzWmElXKhFRo5AMktBgc3i74CDfXAy5K2KPnqBH8XedXTXwDTtSfvuew==","signatures":[{"sig":"MEUCIFGZHbp5UDJLj4ck7J4WsN5GW1IgU9QFE8Fh2BIivxTuAiEAqtc8p2iWRgl+nq4YOpWtupYwMHKn4cADbL/FSF7XLak=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":273903},"main":"./dist/index.cjs","pnpm":{"overrides":{"esbuild":">=0.28.1"}},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"gitHead":"7978243189025521025617cba03690620d703ae2","scripts":{"test":"vitest run","build":"tsup","prepare":"tsup","test:all":"pnpm typecheck && pnpm test","typecheck":"tsc --noEmit"},"_npmUser":{"name":"chenxue","email":"450907240@qq.com"},"repository":{"url":"git+https://github.com/AIhubmix/aihubmix-model-schema.git","type":"git"},"_npmVersion":"10.9.8","description":"canon (AIHubMix model knowledge base) vocabulary layer: verdict semantics, capability-key to wire-shape puts, and sample values. Translates canon records into the wire-only input @aihubmix/codegen accepts.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@aihubmix/codegen":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.3.5","vite":"^6.4.3","vitest":"^3.2.7","typescript":"^5.6.3","@types/node":"^22.20.1"},"_npmOperationalInternal":{"tmp":"tmp/model-schema_0.1.3_1785819015435_0.4623669602248548","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@aihubmix/model-schema","version":"0.1.4","description":"canon (AIHubMix model knowledge base) vocabulary layer: verdict semantics, capability-key to wire-shape puts, and sample values. Translates canon records into the wire-only input @aihubmix/codegen accepts.","type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/AIhubmix/aihubmix-model-schema.git"},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}}},"sideEffects":false,"publishConfig":{"access":"public"},"scripts":{"build":"tsup","prepare":"tsup","test":"vitest run","typecheck":"tsc --noEmit","test:all":"pnpm typecheck && pnpm test"},"dependencies":{"@aihubmix/codegen":"^0.1.0"},"devDependencies":{"@types/node":"^22.20.1","tsup":"^8.3.5","typescript":"^5.6.3","vitest":"^3.2.7","vite":"^6.4.3"},"pnpm":{"overrides":{"esbuild":">=0.28.1"}},"_id":"@aihubmix/model-schema@0.1.4","gitHead":"63c5512185bf4a5c5406f5c22c30a3eb477b69e9","bugs":{"url":"https://github.com/AIhubmix/aihubmix-model-schema/issues"},"homepage":"https://github.com/AIhubmix/aihubmix-model-schema#readme","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-saAIMULoAoPviQ92fRHpOtax54aNoauY5onPzLoB6txFQKol1Lm/Q/YQZhTOfpwjB1tTyEH7QSY8qkALyINrrA==","shasum":"02dd0c54ae0345082a4853dd6d7252c675b952ae","tarball":"https://registry.npmjs.org/@aihubmix/model-schema/-/model-schema-0.1.4.tgz","fileCount":9,"unpackedSize":289792,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDCIOL81oEuSQiowQ46KiT6+PIHOOIVcSG2xTV+icLa9gIgOlzLAOihcym9wQY2XxeO5bxsqlqdeBJDcrDYzf+lVuE="}]},"_npmUser":{"name":"chenxue","email":"450907240@qq.com"},"directories":{},"maintainers":[{"name":"chenxue","email":"450907240@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/model-schema_0.1.4_1786722035869_0.34204184157339435"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-31T07:30:04.813Z","modified":"2026-08-14T15:40:36.231Z","0.1.0":"2026-07-31T07:30:05.127Z","0.1.1":"2026-07-31T09:33:43.755Z","0.1.2":"2026-07-31T10:04:32.217Z","0.1.3":"2026-08-04T04:50:15.601Z","0.1.4":"2026-08-14T15:40:36.031Z"},"bugs":{"url":"https://github.com/AIhubmix/aihubmix-model-schema/issues"},"license":"MIT","homepage":"https://github.com/AIhubmix/aihubmix-model-schema#readme","repository":{"type":"git","url":"git+https://github.com/AIhubmix/aihubmix-model-schema.git"},"description":"canon (AIHubMix model knowledge base) vocabulary layer: verdict semantics, capability-key to wire-shape puts, and sample values. Translates canon records into the wire-only input @aihubmix/codegen accepts.","maintainers":[{"name":"chenxue","email":"450907240@qq.com"}],"readme":"# @aihubmix/model-schema\n\nThe knowledge-base vocabulary layer for AIHubMix model pages. It turns capability records from the model knowledge base into the wire-only input that [`@aihubmix/codegen`](https://github.com/AIhubmix/aihubmix-codegen) accepts, and answers \"may the user tick this capability, and what should we warn them about\" — nothing else.\n\n```\n  knowledge base  (open set: 64 capability keys and growing)\n        │\n        ▼   caller fetches; neither package does I/O\n  @aihubmix/model-schema   ← verdict semantics, capability key → wire shape, sample values\n        │\n        ▼   wire vocabulary only: CodeGenCtx\n  @aihubmix/codegen        ← 4 protocols × 7 languages (closed set)\n```\n\nThe dependency is one-way. `@aihubmix/codegen` contains no capability key, no verdict, and no knowledge-base protocol id; its `tests/vocabulary-isolation.test.ts` fails if one is added. That split is the point of this package: a new capability upstream is a change here only, and `@aihubmix/codegen` does not need a release.\n\n## Install\n\n```sh\npnpm add @aihubmix/model-schema @aihubmix/codegen\n```\n\n`@aihubmix/codegen` is a regular dependency, but keep exactly one copy of it in the tree — the same `buildBody()` must produce both the snippet you show and the request you send. Two copies compile fine and silently drift.\n\n## Usage\n\n```ts\nimport { generateFromCapabilities, PROTO_TO_CANON } from '@aihubmix/model-schema';\n\nconst { code, body, used, notes, availability } = generateFromCapabilities({\n  model: 'claude-opus-5',\n  protocol: 'messages',\n  lang: 'python',\n  capabilities: ['system-instruction', 'reasoning-effort', 'function-calling'],\n  baseUrl: 'https://aihubmix.com',\n  // You supply the lookup. This package never reads the knowledge base itself.\n  resolve: (cap, proto) => myCanonIndex[cap]?.[PROTO_TO_CANON[proto]] ?? null,\n});\n```\n\n- `code` — the snippet, with a comment line prepended for any capability whose verdict says it is silently ignored upstream.\n- `body` — the same wire body the snippet sends. Usable directly for the real request, which is what keeps the two from drifting.\n- `used` — capabilities that actually reached `body`, verified by each put's `landed()` check rather than by \"we called `apply()`\".\n- `notes` — machine codes plus default English wording (`verdict`, `no-put-for-proto`, `missing-prerequisite`, `not-landed`, `resolver-error`, …).\n- `availability` — status for **all** capabilities, not just the requested ones, so a UI can render a full chip row.\n\n`resolve` returning `null` means \"no record\" and the capability is left unselectable — the package does not guess. If `resolve` throws, only that one capability is dropped, with a `resolver-error` note; the rest of the generation is unaffected.\n\n## What this package does not do\n\n- **No I/O.** No network, no filesystem, no env reads. Fetching, caching, and content-addressed paths are the consumer's job — this package knows the knowledge base's *vocabulary*, not its *transport*. It must stay `require()`-able from a bare Node prerender script.\n- **No body assembly.** A put only writes wire fields onto `CodeGenCtx`; `@aihubmix/codegen`'s `buildBody()` is the sole thing that produces a body. There is no second implementation.\n- **No UI.** Structured `availability` and `notes` come back; mapping them to chips, strikethrough, and warning banners is the consumer's.\n\n## Coverage\n\n`CAPABILITY_PUTS` currently covers 11 capability keys. Where the knowledge base says a protocol supports something this package cannot yet express, the result carries a `no-put-for-proto` note with a written reason rather than silently omitting it — see the `gap` entries in `src/catalog.ts`.\n\n## Development\n\n```sh\npnpm install\npnpm test:all     # typecheck + unit tests\npnpm build        # ESM + CJS + .d.ts + .d.cts\n```\n\nMIT.\n","readmeFilename":"README.md"}