@yanlinglabs/winter-provider-catalog 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@yanlinglabs/winter-provider-catalog",
3
+ "version": "0.0.1",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "engines": {
7
+ "node": ">=18"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/yanlingLabs/winter-agent-sdk.git",
12
+ "directory": "packages/provider-catalog"
13
+ },
14
+ "homepage": "https://github.com/yanlingLabs/winter-agent-sdk",
15
+ "bugs": {
16
+ "url": "https://github.com/yanlingLabs/winter-agent-sdk/issues"
17
+ },
18
+ "main": "./dist/index.js",
19
+ "types": "./dist/index.d.ts",
20
+ "exports": {
21
+ ".": {
22
+ "types": "./dist/index.d.ts",
23
+ "default": "./dist/index.js"
24
+ },
25
+ "./families": {
26
+ "types": "./dist/families.d.ts",
27
+ "default": "./dist/families.js"
28
+ }
29
+ },
30
+ "files": [
31
+ "dist",
32
+ "generated",
33
+ "overlay",
34
+ "schema",
35
+ "NOTICE",
36
+ "PROVENANCE.md",
37
+ "UPSTREAM.json",
38
+ "README.md",
39
+ "LICENSE"
40
+ ],
41
+ "publishConfig": {
42
+ "access": "restricted"
43
+ },
44
+ "winter": {
45
+ "publish": {
46
+ "npm": true
47
+ }
48
+ },
49
+ "scripts": {}
50
+ }
@@ -0,0 +1,238 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://winter.yanling.dev/schema/provider-catalog/v2.json",
4
+ "title": "WinterCatalog",
5
+ "description": "WS-13 §4's inert provider catalog. This schema is the CROSS-LANGUAGE contract (Lane X's generator, the Swift decoder, any external consumer); `packages/provider-catalog/src/validate.ts` is the in-repo gate and enforces four structural invariants JSON Schema cannot express on its own — global uniqueness of provider ids and model keys, per-provider uniqueness of `upstreamId ∪ aliases`, that every model's providerId names a provider present in the same document, and the secrets floor. Both must pass; neither substitutes for the other.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "catalogVersion", "upstream", "providers", "models", "families"],
9
+ "properties": {
10
+ "schemaVersion": { "const": 2, "description": "2 since WS-13c: every model row carries `modelFamily`/`canonicalModelId` and the document carries `families`." },
11
+ "catalogVersion": { "type": "string", "minLength": 1, "description": "\"0.0.0-seed\" marks the hand-authored seed; otherwise \"<upstream tag>+<extractorVersion>\"." },
12
+ "upstream": {
13
+ "type": "object",
14
+ "additionalProperties": false,
15
+ "required": ["tag", "tagObject", "commit", "extractorVersion", "overlayVersion"],
16
+ "description": "The upstream pin. Every field may be the EMPTY string: that is how the seed says no extraction produced it.",
17
+ "properties": {
18
+ "tag": { "type": "string" },
19
+ "tagObject": { "type": "string" },
20
+ "commit": { "type": "string" },
21
+ "extractorVersion": { "type": "string" },
22
+ "overlayVersion": { "type": "string" }
23
+ }
24
+ },
25
+ "providers": { "type": "array", "items": { "$ref": "#/$defs/WinterProviderDescriptor" } },
26
+ "models": { "type": "array", "items": { "$ref": "#/$defs/WinterModelDescriptor" } },
27
+ "families": { "type": "array", "items": { "$ref": "#/$defs/ModelFamilyDescriptor" }, "description": "WS-13c §1: the vendor lineups, generated from overlay/families.json and sorted by `id`. MAY be empty (a layer validated standalone has none); the `claude` reservation is enforced only when a family with that id is present." }
28
+ },
29
+ "$defs": {
30
+ "EvidenceSource": { "enum": ["official-doc", "live-discovery", "live-probe", "upstream-static", "user-override", "local-override", "winter-default"] },
31
+ "EvidenceConfidence": { "enum": ["verified", "declared", "inferred", "unknown"] },
32
+ "evidenceBase": {
33
+ "type": "object",
34
+ "required": ["value", "source", "confidence"],
35
+ "properties": {
36
+ "source": { "$ref": "#/$defs/EvidenceSource" },
37
+ "sourceRef": { "type": "string", "minLength": 1 },
38
+ "observedAt": { "type": "string", "format": "date-time" },
39
+ "confidence": { "$ref": "#/$defs/EvidenceConfidence" }
40
+ }
41
+ },
42
+ "evidenceNumber": { "allOf": [{ "$ref": "#/$defs/evidenceBase" }], "properties": { "value": { "type": "integer", "exclusiveMinimum": 0 } } },
43
+ "evidenceBoolean": { "allOf": [{ "$ref": "#/$defs/evidenceBase" }], "properties": { "value": { "type": "boolean" } } },
44
+ "evidenceStringArray": { "allOf": [{ "$ref": "#/$defs/evidenceBase" }], "properties": { "value": { "type": "array", "items": { "type": "string", "minLength": 1 } } } },
45
+ "evidenceToolCalling": { "allOf": [{ "$ref": "#/$defs/evidenceBase" }], "properties": { "value": { "enum": ["native", "emulated", "none"] } } },
46
+ "evidenceReadableState": { "allOf": [{ "$ref": "#/$defs/evidenceBase" }], "properties": { "value": { "enum": ["none", "summary", "full-exposed"] } } },
47
+ "evidenceReplayScope": { "allOf": [{ "$ref": "#/$defs/evidenceBase" }], "properties": { "value": { "enum": ["current-tool-loop", "current-turn", "selected-turns", "all-turns"] } } },
48
+ "evidenceToolLoopRequirement": { "allOf": [{ "$ref": "#/$defs/evidenceBase" }], "properties": { "value": { "enum": ["hard-error", "silent-degradation", "not-required"] } } },
49
+ "evidenceString": { "allOf": [{ "$ref": "#/$defs/evidenceBase" }], "properties": { "value": { "type": "string", "minLength": 1 } } },
50
+ "evidenceSummaryRequest": {
51
+ "allOf": [{ "$ref": "#/$defs/evidenceBase" }],
52
+ "properties": {
53
+ "value": {
54
+ "type": "object",
55
+ "additionalProperties": false,
56
+ "required": ["field", "values"],
57
+ "properties": { "field": { "type": "string", "minLength": 1 }, "values": { "type": "array", "items": { "type": "string" } } }
58
+ }
59
+ }
60
+ },
61
+ "evidencePricing": {
62
+ "allOf": [{ "$ref": "#/$defs/evidenceBase" }],
63
+ "properties": {
64
+ "value": {
65
+ "type": "object",
66
+ "additionalProperties": false,
67
+ "required": ["inputPerMTokUsd", "outputPerMTokUsd"],
68
+ "properties": {
69
+ "inputPerMTokUsd": { "type": "number", "minimum": 0 },
70
+ "outputPerMTokUsd": { "type": "number", "minimum": 0 },
71
+ "cacheReadPerMTokUsd": { "type": "number", "minimum": 0 },
72
+ "cacheWritePerMTokUsd": { "type": "number", "minimum": 0 }
73
+ }
74
+ }
75
+ }
76
+ },
77
+ "WinterProviderDescriptor": {
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": ["id", "displayName", "protocols", "authKinds", "defaultEndpoints", "modelDiscovery", "liveCatalogAuthority", "adapterId", "family", "upstream", "risk", "scope", "pricingBasis", "admission"],
81
+ "properties": {
82
+ "id": { "type": "string", "minLength": 1 },
83
+ "displayName": { "type": "string", "minLength": 1 },
84
+ "protocols": {
85
+ "type": "array",
86
+ "minItems": 1,
87
+ "items": { "enum": ["openai-responses", "openai-chat-completions", "anthropic-messages", "google-generate-content", "bedrock-converse", "azure-openai", "custom"] }
88
+ },
89
+ "authKinds": { "type": "array", "minItems": 1, "items": { "enum": ["api-key", "oauth-approved", "cloud-credential-chain", "local-none", "custom"] } },
90
+ "defaultEndpoints": {
91
+ "type": "object",
92
+ "description": "Generated endpoints are IMMUTABLE (R6-11). An EMPTY object is legal and meaningful: Azure/Bedrock/Vertex endpoints are region-, deployment- or project-templated and have no reviewable default. No userinfo, no query string.",
93
+ "additionalProperties": { "type": "string", "format": "uri", "pattern": "^https?://[^?#@]*$" }
94
+ },
95
+ "requiresUserEndpoint": {
96
+ "const": true,
97
+ "description": "P7a (WS-13b §2/§10): this provider's base URL is PER-TENANT, so the row ships none and a host/user supplies one. Only `true` is spellable — absence already means \"the endpoint is usable as shipped\". The in-repo validator additionally requires `endpointTemplate` and REFUSES any `defaultEndpoints.api` on such a row (a sentinel standing in for an endpoint is still an endpoint the runtime would call)."
98
+ },
99
+ "endpointTemplate": {
100
+ "type": "string",
101
+ "minLength": 1,
102
+ "description": "P7a (WS-13b §2/§10): the DOCUMENTED SHAPE of the per-tenant base URL, e.g. \"https://<resource>.services.ai.azure.com/openai/v1\". Documentation only — never sent, never parsed as a URL; it is what the runtime's `endpoint-required` refusal names. Meaningful only beside `requiresUserEndpoint: true`, which the in-repo validator enforces in both directions."
103
+ },
104
+ "modelDiscovery": { "enum": ["none", "openai-models", "provider-native", "local"] },
105
+ "liveCatalogAuthority": { "enum": ["authoritative", "partial", "unknown"] },
106
+ "adapterId": { "type": "string", "minLength": 1 },
107
+ "family": { "type": "string", "minLength": 1 },
108
+ "upstream": {
109
+ "type": "object",
110
+ "additionalProperties": false,
111
+ "required": ["project", "commit", "sourcePaths"],
112
+ "properties": {
113
+ "project": { "enum": ["OmniRoute", "winter"] },
114
+ "commit": { "type": "string" },
115
+ "sourcePaths": { "type": "array", "items": { "type": "string" } }
116
+ }
117
+ },
118
+ "risk": {
119
+ "type": "object",
120
+ "additionalProperties": false,
121
+ "required": ["class", "reasons"],
122
+ "properties": { "class": { "enum": ["approved", "review-required", "blocked"] }, "reasons": { "type": "array", "items": { "type": "string" } } }
123
+ },
124
+ "scope": { "enum": ["llm", "stt", "tts", "embedding", "image", "video", "search"] },
125
+ "pricingBasis": {
126
+ "enum": ["token", "subscription", "free"],
127
+ "description": "WS-13b §1: how the vendor charges for the credential Winter uses. `subscription`/`free` rows never feed R6-H token cost."
128
+ },
129
+ "admission": {
130
+ "type": "object",
131
+ "additionalProperties": false,
132
+ "required": ["basis", "citation", "tier"],
133
+ "description": "WS-13b §1 (D21): the documented third-party path this row ships through. `citation` is a vendor URL, `audit:<section>`, `spec:<section>` or `local`; the in-repo validator additionally REFUSES a citation naming the audit's `unknown` evidence class (R6b-3). `tier` is how good that evidence is (fix-wave R-FW-3): promotion is two-key — a live-gate pass AND a fetched vendor document — and no `approved` row or `supported` model may sit on `pinned-upstream`.",
134
+ "properties": {
135
+ "basis": { "enum": ["api-key", "oauth-documented", "keyless-documented", "local", "cloud-credential"] },
136
+ "citation": { "type": "string", "minLength": 1 },
137
+ "tier": { "enum": ["fetched-document", "pinned-upstream", "spec-ruling", "local", "audit"] }
138
+ }
139
+ },
140
+ "identityHeaders": {
141
+ "type": "object",
142
+ "description": "WS-13b §7/§8.4 (fix-wave R-FW-2): the SECOND identity field this vendor names, if it names one (AI Horde's `Client-Agent`). Winter-authored only: the in-repo validator restricts the NAMES to an allowlist and requires every value to START with the `<product>` placeholder — a hard-coded product token is refused, because it is truthful for exactly one brand. Three tokens are substituted by the adapter at request time: `<product>` (the running brand's package name), `<version>` (this build's) and `<contact>` (P7a fix wave — the running brand's contact URL, the half of a `<name>:<version>:<contact>` triple a vendor acts on). Sent beside the unconditional `User-Agent` and NOT gated on a generated endpoint — it is the running product's own identity, not the operator's.",
143
+ "propertyNames": { "enum": ["Client-Agent"] },
144
+ "additionalProperties": { "type": "string", "minLength": 1 }
145
+ }
146
+ }
147
+ },
148
+ "WinterModelDescriptor": {
149
+ "type": "object",
150
+ "additionalProperties": false,
151
+ "required": ["key", "providerId", "upstreamId", "modelFamily", "canonicalModelId", "displayName", "aliases", "endpoints", "inputModalities", "outputModalities", "toolCalling", "nativeTools", "unsupportedParameters", "status"],
152
+ "properties": {
153
+ "key": { "type": "string", "minLength": 1, "description": "\"<providerId>/<upstreamId>\" (WS-13 §8.3). Split on the FIRST slash: an OpenRouter upstreamId is itself slash-bearing." },
154
+ "providerId": { "type": "string", "minLength": 1 },
155
+ "upstreamId": { "type": "string", "minLength": 1 },
156
+ "modelFamily": { "type": "string", "minLength": 1, "description": "WS-13c §1: the family id this model belongs to, or \"other\". DERIVED at build by `stampFamilyFields`; an overlay row MAY set it as an override." },
157
+ "canonicalModelId": { "type": "string", "minLength": 1, "description": "WS-13c §1: the vendor's model identity with the provider's spelling removed. DERIVED at build; an overlay row MAY set it as an override." },
158
+ "displayName": { "type": "string", "minLength": 1 },
159
+ "aliases": { "type": "array", "items": { "type": "string", "minLength": 1 } },
160
+ "endpoints": { "type": "array", "minItems": 1, "items": { "enum": ["chat", "responses", "embeddings", "image", "audio", "video"] } },
161
+ "contextWindow": { "$ref": "#/$defs/evidenceNumber" },
162
+ "maxInputTokens": { "$ref": "#/$defs/evidenceNumber" },
163
+ "maxOutputTokens": { "$ref": "#/$defs/evidenceNumber" },
164
+ "inputModalities": { "$ref": "#/$defs/evidenceStringArray" },
165
+ "outputModalities": { "$ref": "#/$defs/evidenceStringArray" },
166
+ "toolCalling": { "$ref": "#/$defs/evidenceToolCalling" },
167
+ "nativeTools": { "$ref": "#/$defs/evidenceBoolean" },
168
+ "parallelTools": { "$ref": "#/$defs/evidenceBoolean" },
169
+ "structuredOutput": { "$ref": "#/$defs/evidenceBoolean" },
170
+ "promptCaching": { "$ref": "#/$defs/evidenceBoolean" },
171
+ "classifierEligible": { "$ref": "#/$defs/evidenceBoolean" },
172
+ "pricing": { "$ref": "#/$defs/evidencePricing" },
173
+ "reasoning": {
174
+ "type": "object",
175
+ "additionalProperties": false,
176
+ "required": ["supported", "efforts", "continuation"],
177
+ "properties": {
178
+ "supported": { "$ref": "#/$defs/evidenceBoolean" },
179
+ "efforts": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "May be EMPTY: a model whose reasoning is budget-controlled (Gemini) or uncontrollable (DeepSeek reasoner) has no named-effort vocabulary." },
180
+ "defaultEffort": { "type": "string", "minLength": 1 },
181
+ "continuation": { "enum": ["none", "plaintext", "opaque-provider-state", "server-response-handle"] },
182
+ "readableState": { "$ref": "#/$defs/evidenceReadableState" },
183
+ "summaryRequest": { "$ref": "#/$defs/evidenceSummaryRequest" },
184
+ "replayScope": { "$ref": "#/$defs/evidenceReplayScope" },
185
+ "continuationDomain": { "$ref": "#/$defs/evidenceStringArray" },
186
+ "completionEvent": { "$ref": "#/$defs/evidenceString" },
187
+ "toolLoopRequirement": { "$ref": "#/$defs/evidenceToolLoopRequirement" }
188
+ }
189
+ },
190
+ "unsupportedParameters": { "type": "array", "items": { "type": "string", "minLength": 1 } },
191
+ "status": { "enum": ["candidate", "experimental", "supported", "deprecated", "blocked"] }
192
+ }
193
+ },
194
+ "FamilySlot": {
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "description": "WS-13c §2: one ranked option in a family's lineup. Position in the array is the option ORDER, not a strength claim — `description` and `reason` carry the meaning.",
198
+ "required": ["name", "canonicalModelId", "description", "reason", "basis", "citation", "status"],
199
+ "properties": {
200
+ "name": { "type": "string", "pattern": "^[a-z0-9][a-z0-9.-]{0,31}$", "description": "The facing enum token. `fable`/`opus`/`sonnet`/`haiku` are RESERVED to the `claude` family (D25)." },
201
+ "canonicalModelId": { "type": "string", "minLength": 1, "description": "Must resolve to at least one model row whose `status` is neither `blocked` nor `deprecated`." },
202
+ "provider": { "type": "string", "minLength": 1, "description": "Pins a serving provider id (WS-13c §4 step 4); it must survive the credential/enablement filter or the slot is unservable." },
203
+ "description": { "type": "string", "minLength": 1, "description": "No currency amounts — pricing lives on model rows with its own evidence." },
204
+ "reason": { "type": "string", "minLength": 1 },
205
+ "basis": { "enum": ["user-ruling", "vendor-doc", "winter-curated"] },
206
+ "citation": { "type": "string", "minLength": 1 },
207
+ "status": { "enum": ["candidate", "supported"] }
208
+ }
209
+ },
210
+ "ModelFamilyDescriptor": {
211
+ "type": "object",
212
+ "additionalProperties": false,
213
+ "description": "WS-13c §1: a vendor lineup, independent of the provider that serves it. `matchers` are anchored RegExp SOURCES over `canonicalModelId`, first match wins, authored DISJOINT so the pipeline's sort-by-id can never change a row's stamp.",
214
+ "required": ["id", "displayName", "vendor", "vendorProviders", "matchers", "slots", "status", "citation"],
215
+ "properties": {
216
+ "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]{0,31}$" },
217
+ "displayName": { "type": "string", "minLength": 1 },
218
+ "vendor": { "type": "string", "minLength": 1 },
219
+ "vendorProviders": { "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "ORDERED (WS-13c §4 step 3-i): a configured subscription row precedes a token row of the same vendor." },
220
+ "matchers": {
221
+ "type": "array",
222
+ "items": {
223
+ "type": "object",
224
+ "additionalProperties": false,
225
+ "required": ["pattern", "note"],
226
+ "properties": {
227
+ "pattern": { "type": "string", "minLength": 1 },
228
+ "note": { "type": "string" }
229
+ }
230
+ }
231
+ },
232
+ "slots": { "type": "array", "maxItems": 4, "items": { "$ref": "#/$defs/FamilySlot" }, "description": "0-4, unique names. A family with zero slots is legal — it is listed under \"more options\" only." },
233
+ "status": { "enum": ["candidate", "supported"] },
234
+ "citation": { "type": "string", "minLength": 1 }
235
+ }
236
+ }
237
+ }
238
+ }