@oh-my-pi/pi-catalog 18.2.6 → 18.2.8
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/CHANGELOG.md +24 -3
- package/README.md +18 -18
- package/THIRD-PARTY-NOTICES.txt +0 -37
- package/dist/types/build.d.ts +7 -1
- package/dist/types/compat/auth-ids.d.ts +1 -1
- package/dist/types/compat/axes.d.ts +1 -1
- package/dist/types/compat/cascade.d.ts +3 -2
- package/dist/types/compat/provider-ids.d.ts +1 -1
- package/dist/types/compat/resolve.d.ts +2 -0
- package/dist/types/compat/taxonomy.d.ts +2 -2
- package/dist/types/compat/types.d.ts +18 -7
- package/dist/types/discovery/index.d.ts +1 -0
- package/dist/types/discovery/openai-compatible.d.ts +2 -0
- package/dist/types/discovery/typesafe.d.ts +26 -0
- package/dist/types/model-manager.d.ts +1 -1
- package/dist/types/provider-models/openai-compat.d.ts +6 -4
- package/dist/types/provider-models/special.d.ts +10 -0
- package/dist/types/types.d.ts +23 -0
- package/package.json +38 -38
- package/src/build.ts +27 -5
- package/src/compat/auth-ids.ts +2 -0
- package/src/compat/axes.ts +9 -1
- package/src/compat/cascade.ts +45 -23
- package/src/compat/provider-ids.ts +3 -0
- package/src/compat/resolve.ts +24 -14
- package/src/compat/rules/README.md +38 -35
- package/src/compat/rules/auth/local.kdl +4 -0
- package/src/compat/rules/auth/typesafe.kdl +3 -6
- package/src/compat/rules/auth/web.kdl +4 -0
- package/src/compat/rules/classes/qwen.kdl +6 -5
- package/src/compat/rules/providers/anthropic.kdl +1 -0
- package/src/compat/rules/providers/deepinfra.kdl +28 -0
- package/src/compat/rules/providers/google-antigravity.kdl +17 -0
- package/src/compat/rules/providers/google.kdl +9 -0
- package/src/compat/rules/providers/llama.cpp.kdl +23 -0
- package/src/compat/rules/providers/local.kdl +110 -0
- package/src/compat/rules/providers/openai-codex.kdl +18 -0
- package/src/compat/rules/providers/openai.kdl +61 -0
- package/src/compat/rules/providers/openrouter.kdl +132 -0
- package/src/compat/rules/providers/typesafe.kdl +21 -0
- package/src/compat/rules/providers/web.kdl +153 -0
- package/src/compat/rules/providers/xai-oauth.kdl +26 -0
- package/src/compat/rules/providers/xai.kdl +22 -0
- package/src/compat/rules/runtime/behavior.kdl +2 -1
- package/src/compat/rules/taxonomy/qwen.kdl +2 -0
- package/src/compat/rules.json +12526 -1
- package/src/compat/taxonomy.ts +92 -31
- package/src/compat/types.ts +22 -7
- package/src/discovery/devin.ts +3 -1
- package/src/discovery/index.ts +1 -0
- package/src/discovery/openai-compatible.ts +4 -1
- package/src/discovery/typesafe.ts +118 -0
- package/src/model-manager.ts +44 -15
- package/src/models.json +1 -1
- package/src/provider-models/descriptors.ts +6 -0
- package/src/provider-models/openai-compat.ts +357 -78
- package/src/provider-models/special.ts +53 -0
- package/src/types.ts +51 -0
package/src/types.ts
CHANGED
|
@@ -23,6 +23,47 @@ export type KnownApi =
|
|
|
23
23
|
| "devin-agent";
|
|
24
24
|
export type Api = KnownApi | (string & {});
|
|
25
25
|
|
|
26
|
+
/** Catalog kinds used to isolate role-specific runners from session chat models. */
|
|
27
|
+
export const MODEL_KINDS = [
|
|
28
|
+
"chat",
|
|
29
|
+
"tiny",
|
|
30
|
+
"image",
|
|
31
|
+
"tts",
|
|
32
|
+
"stt",
|
|
33
|
+
"search",
|
|
34
|
+
"judge",
|
|
35
|
+
"embedding",
|
|
36
|
+
"rerank",
|
|
37
|
+
"video",
|
|
38
|
+
] as const;
|
|
39
|
+
/** Technical capability of a catalog model; absent model kinds mean chat. */
|
|
40
|
+
export type ModelKind = (typeof MODEL_KINDS)[number];
|
|
41
|
+
/** Kinds a provider maps to a runner transport through `kind-apis` in its KDL; discovery drops rows of these kinds when the provider declares no API. */
|
|
42
|
+
export const KIND_API_KINDS = ["image", "tts", "stt", "embedding", "rerank", "video"] as const;
|
|
43
|
+
export type KindApiKind = (typeof KIND_API_KINDS)[number];
|
|
44
|
+
/** Grounding transport available to chat models selected by the web role. */
|
|
45
|
+
export type WebSearchGrounding = "gemini" | "anthropic" | "codex" | "xai" | "openrouter";
|
|
46
|
+
/** Non-chat runner protocols accepted by catalog seeds, outside the chat dispatch union. */
|
|
47
|
+
export const RUNNER_APIS = [
|
|
48
|
+
"local-inference",
|
|
49
|
+
"web-search",
|
|
50
|
+
"typesafe",
|
|
51
|
+
"openrouter-decisions",
|
|
52
|
+
"openai-images",
|
|
53
|
+
"openrouter-images",
|
|
54
|
+
"xai-tts",
|
|
55
|
+
"openai-speech",
|
|
56
|
+
"openai-embeddings",
|
|
57
|
+
"openrouter-rerank",
|
|
58
|
+
"openrouter-video",
|
|
59
|
+
"openai-transcriptions",
|
|
60
|
+
] as const;
|
|
61
|
+
|
|
62
|
+
/** Resolve a model's kind while preserving chat semantics for existing catalog rows. */
|
|
63
|
+
export function modelKind(model: Pick<Model, "kind">): ModelKind {
|
|
64
|
+
return model.kind ?? "chat";
|
|
65
|
+
}
|
|
66
|
+
|
|
26
67
|
/** Canonical thinking transport used by a model. */
|
|
27
68
|
export type ThinkingControlMode =
|
|
28
69
|
| "effort"
|
|
@@ -1125,6 +1166,10 @@ export type ModelTokenizer =
|
|
|
1125
1166
|
// Model interface for the unified model system
|
|
1126
1167
|
export interface Model<TApi extends Api = Api> {
|
|
1127
1168
|
id: string;
|
|
1169
|
+
/** Role-specific runner capability; omitted for ordinary chat models. */
|
|
1170
|
+
kind?: ModelKind;
|
|
1171
|
+
/** Grounding transport supported by this chat model. */
|
|
1172
|
+
webSearch?: WebSearchGrounding;
|
|
1128
1173
|
/**
|
|
1129
1174
|
* Structured model identity resolved by the compat engine: vendor lineage
|
|
1130
1175
|
* class, product family, and revision. Baked into models.json rows and
|
|
@@ -1167,6 +1212,12 @@ export interface Model<TApi extends Api = Api> {
|
|
|
1167
1212
|
name: string;
|
|
1168
1213
|
api: TApi;
|
|
1169
1214
|
provider: Provider;
|
|
1215
|
+
/**
|
|
1216
|
+
* Discovery backend whose catalog policy applies when it differs from the
|
|
1217
|
+
* credential-bearing provider id. Persisted so cached and rebuilt custom
|
|
1218
|
+
* providers retain their transport backend's policy.
|
|
1219
|
+
*/
|
|
1220
|
+
providerType?: string;
|
|
1170
1221
|
baseUrl: string;
|
|
1171
1222
|
reasoning: boolean;
|
|
1172
1223
|
/**
|