@linxiraos/pi-catalog 1.4.11 → 1.4.13

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +12 -3
  2. package/THIRD-PARTY-NOTICES.txt +4 -5
  3. package/dist/types/compat/auth-ids.d.ts +2 -2
  4. package/dist/types/compat/responses-websocket.d.ts +6 -0
  5. package/dist/types/compat/types.d.ts +6 -0
  6. package/dist/types/discovery/devin-proto.d.ts +15 -0
  7. package/dist/types/model-manager.d.ts +2 -0
  8. package/dist/types/types.d.ts +17 -1
  9. package/dist/types/wire/codex.d.ts +0 -1
  10. package/dist/types/wire/factory-droid.d.ts +1 -1
  11. package/package.json +5 -5
  12. package/src/compat/auth-ids.ts +4 -0
  13. package/src/compat/axes.ts +6 -0
  14. package/src/compat/resolve.ts +2 -0
  15. package/src/compat/responses-websocket.ts +12 -0
  16. package/src/compat/rules/auth/_order.kdl +1 -1
  17. package/src/compat/rules/auth/devin-cli.kdl +6 -0
  18. package/src/compat/rules/auth/devin-windsurf.kdl +6 -0
  19. package/src/compat/rules/classes/anthropic.kdl +16 -0
  20. package/src/compat/rules/providers/factory-droid.kdl +56 -4
  21. package/src/compat/rules/providers/muse-code.kdl +16 -0
  22. package/src/compat/rules/providers/openai.kdl +3 -0
  23. package/src/compat/rules/providers/web.kdl +7 -0
  24. package/src/compat/rules/runtime/behavior.kdl +4 -4
  25. package/src/compat/rules.json +1 -1
  26. package/src/compat/types.d.ts +6 -0
  27. package/src/compat/types.ts +6 -0
  28. package/src/discovery/codex.ts +0 -1
  29. package/src/discovery/devin-proto.d.ts +15 -0
  30. package/src/discovery/devin-proto.ts +28 -0
  31. package/src/discovery/factory-droid.ts +23 -12
  32. package/src/model-manager.d.ts +2 -0
  33. package/src/model-manager.ts +22 -13
  34. package/src/models.json +1 -1
  35. package/src/provider-models/openai-compat.ts +38 -1
  36. package/src/types.d.ts +17 -1
  37. package/src/types.ts +17 -1
  38. package/src/wire/codex.d.ts +0 -1
  39. package/src/wire/codex.ts +0 -1
  40. package/src/wire/factory-droid.d.ts +1 -1
  41. package/src/wire/factory-droid.ts +1 -1
@@ -3255,10 +3255,47 @@ export interface MistralModelManagerConfig {
3255
3255
  fetch?: FetchImpl;
3256
3256
  }
3257
3257
 
3258
+ /**
3259
+ * Mistral's `/v1/models` lists every SKU the key can call, including
3260
+ * embedding, OCR, moderation, transcription, and speech models, and flags chat
3261
+ * support per row in `capabilities.completion_chat`. Rows without it reject
3262
+ * `/chat/completions` with `invalid_model`, so they stay out of the chat
3263
+ * roster. A row with no `capabilities` object (a compatible gateway on a
3264
+ * custom `baseUrl`) is kept.
3265
+ *
3266
+ * The context window comes from `max_context_length`. `capabilities.vision`
3267
+ * and `capabilities.reasoning` can add image input or reasoning to a bundled
3268
+ * reference, never remove them.
3269
+ */
3270
+ function mapMistralModel(
3271
+ entry: OpenAICompatibleModelRecord,
3272
+ defaults: ModelSpec<"openai-completions">,
3273
+ reference: ModelSpec<"openai-completions"> | undefined,
3274
+ ): ModelSpec<"openai-completions"> | null {
3275
+ const capabilities = isRecord(entry.capabilities) ? entry.capabilities : undefined;
3276
+ if (capabilities && capabilities.completion_chat !== true) return null;
3277
+ const model = mapWithBundledReference(entry, defaults, reference);
3278
+ const input: ModelSpec<"openai-completions">["input"] =
3279
+ capabilities?.vision === true && !model.input.includes("image") ? [...model.input, "image"] : model.input;
3280
+ return {
3281
+ ...model,
3282
+ reasoning: model.reasoning || capabilities?.reasoning === true,
3283
+ input,
3284
+ contextWindow: toPositiveNumber(entry.max_context_length, model.contextWindow),
3285
+ };
3286
+ }
3287
+
3258
3288
  export function mistralModelManagerOptions(
3259
3289
  config?: MistralModelManagerConfig,
3260
3290
  ): ModelManagerOptions<"openai-completions"> {
3261
- return createSimpleOpenAICompletionsOptions("mistral", "https://api.mistral.ai/v1", config);
3291
+ return createOpenAICompatibleModelManagerOptions({
3292
+ api: "openai-completions",
3293
+ providerId: "mistral",
3294
+ defaultBaseUrl: "https://api.mistral.ai/v1",
3295
+ config,
3296
+ requireApiKey: true,
3297
+ mapModel: mapMistralModel,
3298
+ });
3262
3299
  }
3263
3300
 
3264
3301
  // ---------------------------------------------------------------------------
package/src/types.d.ts CHANGED
@@ -493,6 +493,14 @@ export interface AnthropicCompat {
493
493
  * Sonnet 4.6+, Fable/Mythos 5+ on supported hosts. Default: false.
494
494
  */
495
495
  supportsServerCompaction?: boolean;
496
+ /**
497
+ * Whether the model supports message threads (`message-threads-2026-08-12`):
498
+ * later turns continue a server-held conversation and send only new
499
+ * messages. Enabled on Claude 4.5+ for the first-party provider; the
500
+ * transport still requires the official endpoint unless the caller opts in.
501
+ * Default: false.
502
+ */
503
+ supportsMessageThreads?: boolean;
496
504
  /**
497
505
  * Whether the model is served by the first-party Anthropic provider (its
498
506
  * default route is the official API). Rule-owned on the provider; the
@@ -955,6 +963,14 @@ export interface ResolvedOpenAIResponsesCompat extends ResolvedOpenAISharedCompa
955
963
  * `PI_MUSE_STORE_RESPONSES`); stored runs retain prompts and outputs on the provider.
956
964
  */
957
965
  storeResponses: boolean;
966
+ /**
967
+ * Prefix the `openai-responses` handler puts on every function-tool name it
968
+ * declares or replays, and strips from returned calls through the request's
969
+ * wire-name table. Rule-owned: hosts that reject requests declaring certain
970
+ * exact tool names (Muse Code). Unset sends names unchanged. Other
971
+ * Responses-family handlers do not read it.
972
+ */
973
+ toolNamePrefix?: string;
958
974
  /**
959
975
  * Whether the host binds native history items (`encrypted_content`, item
960
976
  * ids) to the connection that issued them, so a new process must rebuild
@@ -1466,7 +1482,7 @@ export interface Model<TApi extends Api = Api> {
1466
1482
  * dispatch is redirected.
1467
1483
  */
1468
1484
  transport?: "pi-native";
1469
- /** Hint that websocket transport should be preferred when supported by the provider implementation. */
1485
+ /** Standard Responses is opt-in and catalog-gated; either model/request false vetoes true. Codex keeps its independent policy. */
1470
1486
  preferWebsockets?: boolean;
1471
1487
  /** Codex Responses Lite transport: send the lite marker and carry instructions/tools as input items (mirrors codex-rs `use_responses_lite`). */
1472
1488
  useResponsesLite?: boolean;
package/src/types.ts CHANGED
@@ -615,6 +615,14 @@ export interface AnthropicCompat {
615
615
  * Sonnet 4.6+, Fable/Mythos 5+ on supported hosts. Default: false.
616
616
  */
617
617
  supportsServerCompaction?: boolean;
618
+ /**
619
+ * Whether the model supports message threads (`message-threads-2026-08-12`):
620
+ * later turns continue a server-held conversation and send only new
621
+ * messages. Enabled on Claude 4.5+ for the first-party provider; the
622
+ * transport still requires the official endpoint unless the caller opts in.
623
+ * Default: false.
624
+ */
625
+ supportsMessageThreads?: boolean;
618
626
  /**
619
627
  * Whether the model is served by the first-party Anthropic provider (its
620
628
  * default route is the official API). Rule-owned on the provider; the
@@ -1157,6 +1165,14 @@ export interface ResolvedOpenAIResponsesCompat extends ResolvedOpenAISharedCompa
1157
1165
  * `PI_MUSE_STORE_RESPONSES`); stored runs retain prompts and outputs on the provider.
1158
1166
  */
1159
1167
  storeResponses: boolean;
1168
+ /**
1169
+ * Prefix the `openai-responses` handler puts on every function-tool name it
1170
+ * declares or replays, and strips from returned calls through the request's
1171
+ * wire-name table. Rule-owned: hosts that reject requests declaring certain
1172
+ * exact tool names (Muse Code). Unset sends names unchanged. Other
1173
+ * Responses-family handlers do not read it.
1174
+ */
1175
+ toolNamePrefix?: string;
1160
1176
  /**
1161
1177
  * Whether the host binds native history items (`encrypted_content`, item
1162
1178
  * ids) to the connection that issued them, so a new process must rebuild
@@ -1760,7 +1776,7 @@ export interface Model<TApi extends Api = Api> {
1760
1776
  * dispatch is redirected.
1761
1777
  */
1762
1778
  transport?: "pi-native";
1763
- /** Hint that websocket transport should be preferred when supported by the provider implementation. */
1779
+ /** Standard Responses is opt-in and catalog-gated; either model/request false vetoes true. Codex keeps its independent policy. */
1764
1780
  preferWebsockets?: boolean;
1765
1781
  /** Codex Responses Lite transport: send the lite marker and carry instructions/tools as input items (mirrors codex-rs `use_responses_lite`). */
1766
1782
  useResponsesLite?: boolean;
@@ -46,7 +46,6 @@ export declare const OPENAI_HEADERS: {
46
46
  readonly ROUTING_HINT: "x-codex-routing-hint";
47
47
  };
48
48
  export declare const OPENAI_HEADER_VALUES: {
49
- readonly BETA_RESPONSES: "responses=experimental";
50
49
  readonly BETA_RESPONSES_WEBSOCKETS_V2: "responses_websockets=2026-02-06";
51
50
  readonly REMOTE_COMPACTION_V2: "remote_compaction_v2";
52
51
  readonly ORIGINATOR_CODEX: "omp";
package/src/wire/codex.ts CHANGED
@@ -65,7 +65,6 @@ export const OPENAI_HEADERS = {
65
65
  } as const;
66
66
 
67
67
  export const OPENAI_HEADER_VALUES = {
68
- BETA_RESPONSES: "responses=experimental",
69
68
  BETA_RESPONSES_WEBSOCKETS_V2: "responses_websockets=2026-02-06",
70
69
  REMOTE_COMPACTION_V2: "remote_compaction_v2",
71
70
  ORIGINATOR_CODEX: "omp",
@@ -3,7 +3,7 @@
3
3
  * native request corpus with `packages/ai/scripts/capture-factory-droid-native.ts`
4
4
  * against the matching CLI binary and make `factory-droid-native-parity.test.ts` pass.
5
5
  */
6
- export declare const FACTORY_DROID_CLIENT_VERSION = "0.237.0";
6
+ export declare const FACTORY_DROID_CLIENT_VERSION = "1.1.0";
7
7
  /** Wire protocols the Factory proxy multiplexes; `api-routes provider="factory-droid"` picks one per model. */
8
8
  export declare const FACTORY_DROID_WIRES: readonly ["openai-completions", "openai-responses", "anthropic-messages", "google-generate"];
9
9
  /** Wire protocol used by the Factory proxy for each model. */
@@ -10,7 +10,7 @@ import { isRecord } from "../utils";
10
10
  * native request corpus with `packages/ai/scripts/capture-factory-droid-native.ts`
11
11
  * against the matching CLI binary and make `factory-droid-native-parity.test.ts` pass.
12
12
  */
13
- export const FACTORY_DROID_CLIENT_VERSION = "0.237.0";
13
+ export const FACTORY_DROID_CLIENT_VERSION = "1.1.0";
14
14
 
15
15
  /** Wire protocols the Factory proxy multiplexes; `api-routes provider="factory-droid"` picks one per model. */
16
16
  export const FACTORY_DROID_WIRES = [