@oh-my-pi/pi-catalog 17.3.8 → 17.4.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.
- package/CHANGELOG.md +15 -0
- package/dist/types/build.d.ts +5 -0
- package/dist/types/discovery/cursor-proto.d.ts +5362 -0
- package/dist/types/discovery/devin-proto.d.ts +1549 -0
- package/dist/types/discovery/index.d.ts +1 -0
- package/dist/types/discovery/protobuf.d.ts +102 -0
- package/dist/types/identity/family.d.ts +10 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/model-tokenizer.d.ts +8 -0
- package/dist/types/types.d.ts +15 -0
- package/package.json +5 -6
- package/src/build.ts +7 -0
- package/src/discovery/cursor-proto.ts +8322 -0
- package/src/discovery/cursor.ts +2 -2
- package/src/discovery/devin-proto.ts +2037 -0
- package/src/discovery/devin.ts +4 -3
- package/src/discovery/index.ts +1 -0
- package/src/discovery/protobuf.ts +1073 -0
- package/src/hosts.ts +22 -1
- package/src/identity/family.ts +21 -0
- package/src/index.ts +1 -0
- package/src/model-tokenizer.ts +75 -0
- package/src/models.json +185020 -2079
- package/src/models.ts +6 -5
- package/src/provider-models/bundled-references.ts +12 -2
- package/src/provider-models/openai-compat.ts +120 -50
- package/src/types.ts +24 -0
- package/dist/types/discovery/cursor-gen/agent_pb.d.ts +0 -16854
- package/dist/types/discovery/devin-gen/buf/validate/validate_pb.d.ts +0 -1715
- package/dist/types/discovery/devin-gen/exa/analytics_pb/analytics_pb.d.ts +0 -693
- package/dist/types/discovery/devin-gen/exa/api_server_pb/api_server_pb.d.ts +0 -9158
- package/dist/types/discovery/devin-gen/exa/auth_pb/auth_pb.d.ts +0 -52
- package/dist/types/discovery/devin-gen/exa/auto_cascade_common_pb/auto_cascade_common_pb.d.ts +0 -276
- package/dist/types/discovery/devin-gen/exa/bug_checker_pb/bug_checker_pb.d.ts +0 -78
- package/dist/types/discovery/devin-gen/exa/cascade_plugins_pb/cascade_plugins_pb.d.ts +0 -999
- package/dist/types/discovery/devin-gen/exa/chat_pb/chat_pb.d.ts +0 -1704
- package/dist/types/discovery/devin-gen/exa/code_edit/code_edit_pb/code_edit_pb.d.ts +0 -656
- package/dist/types/discovery/devin-gen/exa/codeium_common_pb/codeium_common_pb.d.ts +0 -15014
- package/dist/types/discovery/devin-gen/exa/context_module_pb/context_module_pb.d.ts +0 -607
- package/dist/types/discovery/devin-gen/exa/cortex_pb/cortex_pb.d.ts +0 -11830
- package/dist/types/discovery/devin-gen/exa/diff_action_pb/diff_action_pb.d.ts +0 -248
- package/dist/types/discovery/devin-gen/exa/index_pb/index_pb.d.ts +0 -1747
- package/dist/types/discovery/devin-gen/exa/knowledge_base_pb/knowledge_base_pb.d.ts +0 -509
- package/dist/types/discovery/devin-gen/exa/language_server_pb/language_server_pb.d.ts +0 -9048
- package/dist/types/discovery/devin-gen/exa/opensearch_clients_pb/opensearch_clients_pb.d.ts +0 -1760
- package/dist/types/discovery/devin-gen/exa/prompt_pb/prompt_pb.d.ts +0 -286
- package/dist/types/discovery/devin-gen/exa/reactive_component_pb/reactive_component_pb.d.ts +0 -405
- package/dist/types/discovery/devin-gen/exa/trust_pb/trust_pb.d.ts +0 -582
- package/src/discovery/cursor-gen/agent_pb.ts +0 -19608
- package/src/discovery/devin-gen/buf/validate/validate_pb.ts +0 -1862
- package/src/discovery/devin-gen/exa/analytics_pb/analytics_pb.ts +0 -871
- package/src/discovery/devin-gen/exa/api_server_pb/api_server_pb.ts +0 -11083
- package/src/discovery/devin-gen/exa/auth_pb/auth_pb.ts +0 -71
- package/src/discovery/devin-gen/exa/auto_cascade_common_pb/auto_cascade_common_pb.ts +0 -348
- package/src/discovery/devin-gen/exa/bug_checker_pb/bug_checker_pb.ts +0 -103
- package/src/discovery/devin-gen/exa/cascade_plugins_pb/cascade_plugins_pb.ts +0 -1198
- package/src/discovery/devin-gen/exa/chat_pb/chat_pb.ts +0 -2063
- package/src/discovery/devin-gen/exa/code_edit/code_edit_pb/code_edit_pb.ts +0 -810
- package/src/discovery/devin-gen/exa/codeium_common_pb/codeium_common_pb.ts +0 -18354
- package/src/discovery/devin-gen/exa/context_module_pb/context_module_pb.ts +0 -732
- package/src/discovery/devin-gen/exa/cortex_pb/cortex_pb.ts +0 -14277
- package/src/discovery/devin-gen/exa/diff_action_pb/diff_action_pb.ts +0 -312
- package/src/discovery/devin-gen/exa/index_pb/index_pb.ts +0 -2106
- package/src/discovery/devin-gen/exa/knowledge_base_pb/knowledge_base_pb.ts +0 -623
- package/src/discovery/devin-gen/exa/language_server_pb/language_server_pb.ts +0 -10918
- package/src/discovery/devin-gen/exa/opensearch_clients_pb/opensearch_clients_pb.ts +0 -2125
- package/src/discovery/devin-gen/exa/prompt_pb/prompt_pb.ts +0 -361
- package/src/discovery/devin-gen/exa/reactive_component_pb/reactive_component_pb.ts +0 -450
- package/src/discovery/devin-gen/exa/trust_pb/trust_pb.ts +0 -712
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-performance, zero-builder protobuf wire codecs for @oh-my-pi/pi-catalog.
|
|
3
|
+
*
|
|
4
|
+
* Schemas are declared as static IR descriptors with near-zero module load overhead
|
|
5
|
+
* and lazy compilation on first encode/decode/create invocation.
|
|
6
|
+
*/
|
|
7
|
+
/** JSON values carried by `google.protobuf.Value` fields. */
|
|
8
|
+
export type JsonValue = null | boolean | number | string | JsonValue[] | {
|
|
9
|
+
[key: string]: JsonValue;
|
|
10
|
+
};
|
|
11
|
+
/** An unrecognised wire field retained for forward-compatible round-trips. */
|
|
12
|
+
export interface ProtoUnknownField {
|
|
13
|
+
no: number;
|
|
14
|
+
wireType: number;
|
|
15
|
+
data: Uint8Array;
|
|
16
|
+
}
|
|
17
|
+
/** Shared internal metadata present on every decoded protocol message. */
|
|
18
|
+
export interface ProtoMessage {
|
|
19
|
+
$typeName?: string;
|
|
20
|
+
$unknown?: ProtoUnknownField[];
|
|
21
|
+
}
|
|
22
|
+
/** A bidirectional codec for one protobuf message type. */
|
|
23
|
+
export interface MessageCodec<T extends ProtoMessage = ProtoMessage> {
|
|
24
|
+
(value: T): Uint8Array;
|
|
25
|
+
(value: Uint8Array): T;
|
|
26
|
+
/** Creates a message with protobuf defaults for omitted fields. */
|
|
27
|
+
create(value?: Partial<T>): T;
|
|
28
|
+
/** Encodes one message into protobuf wire bytes. */
|
|
29
|
+
encode(value: T): Uint8Array;
|
|
30
|
+
/** Decodes one protobuf message from wire bytes. */
|
|
31
|
+
decode(value: Uint8Array): T;
|
|
32
|
+
/** Converts a message to its protobuf JSON representation. */
|
|
33
|
+
toJson(value: T): JsonValue;
|
|
34
|
+
}
|
|
35
|
+
/** Infers a message shape from a codec result. */
|
|
36
|
+
export type InferMessage<TCodec> = TCodec extends MessageCodec<infer TMessage> ? TMessage : never;
|
|
37
|
+
/** Erases a referenced message's concrete shape for static field descriptors. */
|
|
38
|
+
export interface MessageReference {
|
|
39
|
+
encode(value: unknown): Uint8Array;
|
|
40
|
+
decode(value: Uint8Array): ProtoMessage;
|
|
41
|
+
toJson(value: unknown): JsonValue;
|
|
42
|
+
}
|
|
43
|
+
export type ScalarKind = "bool" | "bytes" | "double" | "enum" | "float" | "int32" | "int64" | "string" | "uint32" | "uint64";
|
|
44
|
+
export type WireType = 0 | 1 | 2 | 5;
|
|
45
|
+
export interface ScalarFieldDesc {
|
|
46
|
+
readonly no: number;
|
|
47
|
+
readonly name: string;
|
|
48
|
+
readonly kind: ScalarKind;
|
|
49
|
+
readonly optional?: boolean;
|
|
50
|
+
readonly repeat?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface MessageFieldDesc {
|
|
53
|
+
readonly no: number;
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly kind: "message";
|
|
56
|
+
readonly T: () => MessageReference;
|
|
57
|
+
readonly repeat?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface EnumFieldDesc {
|
|
60
|
+
readonly no: number;
|
|
61
|
+
readonly name: string;
|
|
62
|
+
readonly kind: "enum";
|
|
63
|
+
readonly optional?: boolean;
|
|
64
|
+
readonly repeat?: boolean;
|
|
65
|
+
}
|
|
66
|
+
export interface MapFieldDesc {
|
|
67
|
+
readonly no: number;
|
|
68
|
+
readonly name: string;
|
|
69
|
+
readonly kind: "map";
|
|
70
|
+
readonly K: "string";
|
|
71
|
+
readonly V: ScalarKind | (() => MessageReference);
|
|
72
|
+
}
|
|
73
|
+
export type VariantDesc = {
|
|
74
|
+
readonly no: number;
|
|
75
|
+
readonly name: string;
|
|
76
|
+
readonly kind: ScalarKind;
|
|
77
|
+
} | {
|
|
78
|
+
readonly no: number;
|
|
79
|
+
readonly name: string;
|
|
80
|
+
readonly kind: "message";
|
|
81
|
+
readonly T: () => MessageReference;
|
|
82
|
+
};
|
|
83
|
+
export interface OneofFieldDesc {
|
|
84
|
+
readonly kind: "oneof";
|
|
85
|
+
readonly name: string;
|
|
86
|
+
readonly variants: readonly VariantDesc[];
|
|
87
|
+
}
|
|
88
|
+
export type FieldDesc = ScalarFieldDesc | MessageFieldDesc | EnumFieldDesc | MapFieldDesc | OneofFieldDesc;
|
|
89
|
+
/** Creates a high-performance, lazy protobuf message codec from an IR field descriptor list. */
|
|
90
|
+
export declare function pb<T extends ProtoMessage = ProtoMessage>(typeName: string, fields?: readonly FieldDesc[]): MessageCodec<T>;
|
|
91
|
+
/** Creates a message using its codec's protobuf defaults. */
|
|
92
|
+
export declare function create<TMessage extends ProtoMessage>(codec: MessageCodec<TMessage>, value?: Partial<TMessage>): TMessage;
|
|
93
|
+
/** Encodes a message using its codec. */
|
|
94
|
+
export declare function toBinary<TMessage extends ProtoMessage>(codec: MessageCodec<TMessage>, value: TMessage): Uint8Array;
|
|
95
|
+
/** Decodes wire bytes using a message codec. */
|
|
96
|
+
export declare function fromBinary<TMessage extends ProtoMessage>(codec: MessageCodec<TMessage>, value: Uint8Array): TMessage;
|
|
97
|
+
/** Converts a message to protobuf JSON using its codec. */
|
|
98
|
+
export declare function toJson<TMessage extends ProtoMessage>(codec: MessageCodec<TMessage>, value: TMessage): JsonValue;
|
|
99
|
+
/** Encodes a JSON value as `google.protobuf.Value`. */
|
|
100
|
+
export declare function encodeJsonValue(value: JsonValue): Uint8Array;
|
|
101
|
+
/** Decodes `google.protobuf.Value` wire bytes into a JSON value. */
|
|
102
|
+
export declare function decodeJsonValue(value: Uint8Array): JsonValue;
|
|
@@ -56,6 +56,8 @@ export declare const isDeepseekModelIdOrName: (modelId: string) => boolean;
|
|
|
56
56
|
export declare const isDeepseekV4FlashModelId: (modelId: string) => boolean;
|
|
57
57
|
/** Xiaomi MiMo family by id or display name. */
|
|
58
58
|
export declare const isMimoModelIdOrName: (modelId: string) => boolean;
|
|
59
|
+
/** StepFun Step 3.7 Flash SKU in any namespace form (`kilo/stepfun/step-3.7-flash:free`). */
|
|
60
|
+
export declare const isStep37FlashModelId: (modelId: string) => boolean;
|
|
59
61
|
/** Gemini family ids in any namespace form (`gemini-*`, `google/gemini-*`, `openrouter/google/gemini-…`). */
|
|
60
62
|
export declare const isGeminiModelId: (modelId: string) => boolean;
|
|
61
63
|
/** Grok family ids across namespace and delimiter forms (`grok-*`, `cursor-grok-*`, `xai/grok-*`). */
|
|
@@ -199,6 +201,14 @@ export declare const hasOpus47ApiRestrictions: (modelId: string) => boolean;
|
|
|
199
201
|
* @see https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages
|
|
200
202
|
*/
|
|
201
203
|
export declare const supportsMidConversationSystemMessages: (modelId: string) => boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Models that reliably follow the hashline line-anchored edit dialect
|
|
206
|
+
* (`[path#TAG]` headers plus 1-indexed anchors). Kimi, MiMo, DeepSeek V4
|
|
207
|
+
* Flash, and Step 3.7 Flash miscount anchors or drop the tag header often
|
|
208
|
+
* enough that hosts fall back to a literal search-replace edit format for
|
|
209
|
+
* them.
|
|
210
|
+
*/
|
|
211
|
+
export declare const supportsHashlineEdits: (modelId: string) => boolean;
|
|
202
212
|
export declare const isAnthropicFableOrMythosModel: (modelId: string) => boolean;
|
|
203
213
|
/** Thinking-variant token location inside a model id. */
|
|
204
214
|
export interface ThinkingVariantToken {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./identity/index.js";
|
|
|
6
6
|
export * from "./model-cache.js";
|
|
7
7
|
export * from "./model-manager.js";
|
|
8
8
|
export * from "./model-thinking.js";
|
|
9
|
+
export * from "./model-tokenizer.js";
|
|
9
10
|
export * from "./models.js";
|
|
10
11
|
export * from "./provider-models/index.js";
|
|
11
12
|
export * from "./types.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ModelTokenizer } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Resolve the exact locally embedded tokenizer for a canonical model id.
|
|
4
|
+
*
|
|
5
|
+
* This is catalog policy, not a runtime caller heuristic: [`buildModel`](./build.ts)
|
|
6
|
+
* materializes the result as `Model.tokenizer`; consumers read that property.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveModelTokenizer(modelId: string): ModelTokenizer | undefined;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -716,6 +716,15 @@ export interface LongContextTokenCost extends TokenCost {
|
|
|
716
716
|
export interface ModelCost extends TokenCost {
|
|
717
717
|
longContext?: LongContextTokenCost;
|
|
718
718
|
}
|
|
719
|
+
/**
|
|
720
|
+
* Exact local content tokenizer family for a model.
|
|
721
|
+
*
|
|
722
|
+
* Absent means no first-party local tokenizer is known and consumers retain
|
|
723
|
+
* their estimate/default-tokenizer policy. The values name tokenizer
|
|
724
|
+
* generations rather than providers: DeepSeek V3 through V4 share
|
|
725
|
+
* `"deepseek-v3"`; Kimi K2 through K3 share `"kimi-k2"`.
|
|
726
|
+
*/
|
|
727
|
+
export type ModelTokenizer = "claude-v3" | "claude-v47" | "claude-v5" | "claude-v5-sonnet" | "qwen3" | "deepseek-v3" | "kimi-k2" | "glm5";
|
|
719
728
|
export interface Model<TApi extends Api = Api> {
|
|
720
729
|
id: string;
|
|
721
730
|
/**
|
|
@@ -739,6 +748,12 @@ export interface Model<TApi extends Api = Api> {
|
|
|
739
748
|
provider: Provider;
|
|
740
749
|
baseUrl: string;
|
|
741
750
|
reasoning: boolean;
|
|
751
|
+
/**
|
|
752
|
+
* Exact local tokenizer family resolved from the model identity or supplied
|
|
753
|
+
* explicitly by a catalog/discovery source. Absent leaves local counting to
|
|
754
|
+
* the consumer's fallback policy.
|
|
755
|
+
*/
|
|
756
|
+
tokenizer?: ModelTokenizer;
|
|
742
757
|
input: ("text" | "image")[];
|
|
743
758
|
/**
|
|
744
759
|
* Decoder family used for image inputs when it has narrower format support
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-catalog",
|
|
4
|
-
"version": "17.
|
|
4
|
+
"version": "17.4.0",
|
|
5
5
|
"description": "Model catalog for omp: bundled model database, provider discovery descriptors, model identity, classification, and equivalence",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -31,15 +31,14 @@
|
|
|
31
31
|
"fix": "biome check --write --unsafe .",
|
|
32
32
|
"fmt": "biome format --write .",
|
|
33
33
|
"gen:models": "bun scripts/generate-models.ts",
|
|
34
|
-
"gen:
|
|
34
|
+
"gen:proto": "bun scripts/generate-protocols.ts"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"@oh-my-pi/
|
|
39
|
-
"@oh-my-pi/pi-utils": "17.3.8"
|
|
37
|
+
"@oh-my-pi/omptype": "17.4.0",
|
|
38
|
+
"@oh-my-pi/pi-utils": "17.4.0"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
|
-
"@oh-my-pi/pi-ai": "17.
|
|
41
|
+
"@oh-my-pi/pi-ai": "17.4.0",
|
|
43
42
|
"@types/bun": "^1.3.14"
|
|
44
43
|
},
|
|
45
44
|
"engines": {
|
package/src/build.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { buildDevinCompat } from "./compat/devin";
|
|
|
16
16
|
import { buildOpenAICompat, buildOpenAIResponsesCompat, buildOpenRouterCompat } from "./compat/openai";
|
|
17
17
|
import { bareModelId, parseOpenAIModel, semverGte } from "./identity/classify";
|
|
18
18
|
import { resolveModelThinking } from "./model-thinking";
|
|
19
|
+
import { resolveModelTokenizer } from "./model-tokenizer";
|
|
19
20
|
import type { Api, CompatOf, Model, ModelSpec } from "./types";
|
|
20
21
|
import { cleanModelName } from "./utils";
|
|
21
22
|
|
|
@@ -58,12 +59,18 @@ function supportsOpenAIGAComputerUse(spec: ModelSpec<Api>, explicitSupport: bool
|
|
|
58
59
|
return parsed !== null && semverGte(parsed.version, "5.4");
|
|
59
60
|
}
|
|
60
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Build one model from an authored spec. Bundled models.json rows are fully
|
|
64
|
+
* materialized by the generator and consumed directly (see `models.ts`), so
|
|
65
|
+
* this only runs for discovered/custom/override specs.
|
|
66
|
+
*/
|
|
61
67
|
export function buildModel<TApi extends Api>(spec: ModelSpec<TApi>): Model<TApi> {
|
|
62
68
|
const compat = buildCompat(spec) as CompatOf<TApi>;
|
|
63
69
|
const supportsComputerUseConfig = explicitComputerUseConfig(spec);
|
|
64
70
|
return {
|
|
65
71
|
...spec,
|
|
66
72
|
name: cleanModelName(spec.name),
|
|
73
|
+
tokenizer: spec.tokenizer ?? resolveModelTokenizer(spec.requestModelId ?? spec.id),
|
|
67
74
|
thinking: resolveModelThinking(spec, compat),
|
|
68
75
|
supportsComputerUse: supportsOpenAIGAComputerUse(spec, supportsComputerUseConfig),
|
|
69
76
|
supportsComputerUseConfig,
|