@oh-my-pi/pi-catalog 18.6.3 → 18.7.0

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.
@@ -7147,23 +7147,12 @@ const MODELS_DEV_PROVIDER_DESCRIPTORS_CODING_PLANS: readonly ModelsDevProviderDe
7147
7147
  allowsSyntheticReasoningContentForToolCalls: false,
7148
7148
  },
7149
7149
  }),
7150
- // --- MiniMax Coding Plan ---
7151
- openAiCompletionsDescriptor("minimax-coding-plan", "minimax-code", "https://api.minimax.io/v1", {
7152
- compat: {
7153
- supportsStore: false,
7154
- supportsDeveloperRole: false,
7155
- supportsReasoningEffort: false,
7156
- reasoningContentField: "reasoning_content",
7157
- },
7158
- }),
7159
- openAiCompletionsDescriptor("minimax-cn-coding-plan", "minimax-code-cn", "https://api.minimaxi.com/v1", {
7160
- compat: {
7161
- supportsStore: false,
7162
- supportsDeveloperRole: false,
7163
- supportsReasoningEffort: false,
7164
- reasoningContentField: "reasoning_content",
7165
- },
7166
- }),
7150
+ // --- MiniMax Token Plan ---
7151
+ // MiniMax documents its Anthropic-compatible API as the recommended
7152
+ // protocol: signed thinking blocks, `output_config.effort` depth control,
7153
+ // and prompt-cache usage reporting.
7154
+ anthropicMessagesDescriptor("minimax-coding-plan", "minimax-code", "https://api.minimax.io/anthropic"),
7155
+ anthropicMessagesDescriptor("minimax-cn-coding-plan", "minimax-code-cn", "https://api.minimaxi.com/anthropic"),
7167
7156
  // --- Alibaba Coding Plan ---
7168
7157
  openAiCompletionsDescriptor(
7169
7158
  "alibaba-coding-plan",
package/src/types.ts CHANGED
@@ -60,6 +60,59 @@ export const RUNNER_APIS = [
60
60
  "openrouter-video",
61
61
  "openai-transcriptions",
62
62
  ] as const;
63
+ /** Kind each single-purpose runner API serves; `local-inference` hosts several kinds. */
64
+ export const RUNNER_API_KINDS: Record<Exclude<(typeof RUNNER_APIS)[number], "local-inference">, ModelKind> = {
65
+ "web-search": "search",
66
+ typesafe: "judge",
67
+ "openrouter-decisions": "judge",
68
+ "openai-images": "image",
69
+ "openrouter-images": "image",
70
+ "xai-tts": "tts",
71
+ "openai-speech": "tts",
72
+ "openai-embeddings": "embedding",
73
+ "openrouter-rerank": "rerank",
74
+ "openrouter-video": "video",
75
+ "openai-transcriptions": "stt",
76
+ };
77
+
78
+ const RUNNER_API_KIND_BY_API: ReadonlyMap<Api, ModelKind> = new Map(Object.entries(RUNNER_API_KINDS));
79
+
80
+ /** Kind a runner API serves; `undefined` for chat transports and multi-kind `local-inference`. */
81
+ export function runnerApiKind(api: Api): ModelKind | undefined {
82
+ return RUNNER_API_KIND_BY_API.get(api);
83
+ }
84
+
85
+ /** Catalog APIs `generate_image` runs through a pi-ai image client; the hosted Responses pair needs a carrier model. */
86
+ export const IMAGE_GENERATION_APIS = [
87
+ "openai-images",
88
+ "openrouter-images",
89
+ "google-generative-ai",
90
+ "google-gemini-cli",
91
+ "openai-responses",
92
+ "openai-codex-responses",
93
+ ] as const;
94
+ export type ImageGenerationApi = (typeof IMAGE_GENERATION_APIS)[number];
95
+
96
+ const CHAT_TRANSPORT_KINDS: readonly ModelKind[] = ["chat", "tiny"];
97
+ const IMAGE_CHAT_TRANSPORT_KINDS: readonly ModelKind[] = ["chat", "tiny", "image"];
98
+
99
+ /**
100
+ * Kinds a model on `api` may declare: a runner api serves its own kind; a chat
101
+ * transport serves `chat` and `tiny`, plus `image` when `generate_image` runs it
102
+ * (hosted Responses image tool, Gemini image models). `undefined` for
103
+ * `local-inference`, which hosts several kinds chosen by the model itself.
104
+ */
105
+ export function servedKinds(api: Api): readonly ModelKind[] | undefined {
106
+ if (api === "local-inference") return undefined;
107
+ const runnerKind = runnerApiKind(api);
108
+ if (runnerKind !== undefined) return [runnerKind];
109
+ return (IMAGE_GENERATION_APIS as readonly Api[]).includes(api) ? IMAGE_CHAT_TRANSPORT_KINDS : CHAT_TRANSPORT_KINDS;
110
+ }
111
+
112
+ /** Whether a model of `kind` can run on `api`. */
113
+ export function apiServesKind(api: Api, kind: ModelKind): boolean {
114
+ return servedKinds(api)?.includes(kind) ?? true;
115
+ }
63
116
 
64
117
  /** Resolve a model's kind while preserving chat semantics for existing catalog rows. */
65
118
  export function modelKind(model: Pick<Model, "kind">): ModelKind {
@@ -1327,6 +1380,12 @@ export interface Model<TApi extends Api = Api> {
1327
1380
  id: string;
1328
1381
  /** Role-specific runner capability; omitted for ordinary chat models. */
1329
1382
  kind?: ModelKind;
1383
+ /**
1384
+ * Verbatim configured kind (models.yml, `modelOverrides`, runtime
1385
+ * registrations). `buildModel` applies it over catalog `kind` rules on every
1386
+ * rebuild, so a configured runner keeps its role.
1387
+ */
1388
+ kindConfig?: ModelKind;
1330
1389
  /** Grounding transport supported by this chat model. */
1331
1390
  webSearch?: WebSearchGrounding;
1332
1391
  /** Cheaper same-provider model to run hosted web search in this model's place (model id or provider/id). */
@@ -1539,9 +1598,9 @@ export interface Model<TApi extends Api = Api> {
1539
1598
  /**
1540
1599
  * Per-service-tier cost multipliers baked from the `service-tier-cost`
1541
1600
  * catalog axis (e.g. `{ priority: 2.5 }`). Absent tiers use the API-generic
1542
- * defaults.
1601
+ * defaults, and a tier with no published price stays at 1x.
1543
1602
  */
1544
- serviceTierCost?: Readonly<Partial<Record<"flex" | "priority", number>>>;
1603
+ serviceTierCost?: Readonly<Partial<Record<"flex" | "priority" | "ultrafast", number>>>;
1545
1604
  /**
1546
1605
  * Provider-supplied one-line blurb for this model. Set only when an upstream
1547
1606
  * ships one (Devin's `GetCliModelConfigs`); never synthesized locally.