@oh-my-pi/pi-catalog 18.12.2 → 18.12.4
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 +27 -0
- package/dist/types/compat/auth-ids.d.ts +2 -2
- package/dist/types/compat/image-tokenization.d.ts +13 -1
- package/dist/types/compat/provider-ids.d.ts +1 -1
- package/dist/types/compat/request-size.d.ts +11 -6
- package/dist/types/discovery/devin.d.ts +1 -1
- package/dist/types/hosts.d.ts +3 -1
- package/dist/types/provider-models/openai-compat.d.ts +7 -0
- package/dist/types/types.d.ts +10 -3
- package/dist/types/wire/devin.d.ts +1 -15
- package/package.json +4 -4
- package/src/compat/auth-ids.ts +2 -0
- package/src/compat/axes.ts +18 -2
- package/src/compat/image-tokenization.ts +55 -1
- package/src/compat/provider-ids.ts +1 -0
- package/src/compat/request-size.ts +18 -8
- package/src/compat/resolve.ts +1 -0
- package/src/compat/rules/README.md +6 -2
- package/src/compat/rules/auth/_order.kdl +1 -1
- package/src/compat/rules/auth/inception.kdl +11 -0
- package/src/compat/rules/classes/anthropic.kdl +23 -21
- package/src/compat/rules/classes/deepseek.kdl +31 -0
- package/src/compat/rules/classes/gemma.kdl +11 -0
- package/src/compat/rules/classes/minimax.kdl +13 -8
- package/src/compat/rules/providers/amazon-bedrock.kdl +56 -0
- package/src/compat/rules/providers/factory-droid.kdl +12 -0
- package/src/compat/rules/providers/inception.kdl +61 -0
- package/src/compat/rules.json +1 -1
- package/src/discovery/devin.ts +33 -66
- package/src/hosts.ts +5 -2
- package/src/models.json +1 -1
- package/src/provider-models/descriptors.ts +2 -0
- package/src/provider-models/openai-compat.ts +44 -2
- package/src/types.ts +10 -3
- package/src/wire/devin.ts +16 -20
|
@@ -40,6 +40,7 @@ import {
|
|
|
40
40
|
groqModelManagerOptions,
|
|
41
41
|
helmcodeModelManagerOptions,
|
|
42
42
|
huggingfaceModelManagerOptions,
|
|
43
|
+
inceptionModelManagerOptions,
|
|
43
44
|
kiloModelManagerOptions,
|
|
44
45
|
kimiCodeModelManagerOptions,
|
|
45
46
|
litellmModelManagerOptions,
|
|
@@ -126,6 +127,7 @@ const MODEL_MANAGER_FACTORIES: Readonly<Partial<Record<KnownProvider, ModelManag
|
|
|
126
127
|
groq: config => groqModelManagerOptions(config),
|
|
127
128
|
helmcode: config => helmcodeModelManagerOptions(config),
|
|
128
129
|
huggingface: config => huggingfaceModelManagerOptions(config),
|
|
130
|
+
inception: config => inceptionModelManagerOptions(config),
|
|
129
131
|
kilo: config => kiloModelManagerOptions(config),
|
|
130
132
|
"kimi-code": config => kimiCodeModelManagerOptions(config),
|
|
131
133
|
litellm: config => litellmModelManagerOptions(config),
|
|
@@ -569,8 +569,8 @@ function perTokenPricingCost(pricing: unknown): TokenCost {
|
|
|
569
569
|
return {
|
|
570
570
|
input: toPositiveNumber(rates.prompt, 0) * 1_000_000,
|
|
571
571
|
output: toPositiveNumber(rates.completion, 0) * 1_000_000,
|
|
572
|
-
cacheRead: toPositiveNumber(rates.input_cache_read, 0) * 1_000_000,
|
|
573
|
-
cacheWrite: toPositiveNumber(rates.input_cache_write, 0) * 1_000_000,
|
|
572
|
+
cacheRead: toPositiveNumber(rates.input_cache_read ?? rates.input_cache_reads, 0) * 1_000_000,
|
|
573
|
+
cacheWrite: toPositiveNumber(rates.input_cache_write ?? rates.input_cache_writes, 0) * 1_000_000,
|
|
574
574
|
};
|
|
575
575
|
}
|
|
576
576
|
|
|
@@ -4739,6 +4739,48 @@ export function togetherModelManagerOptions(
|
|
|
4739
4739
|
return createSimpleOpenAICompletionsOptions("together", "https://api.together.xyz/v1", config);
|
|
4740
4740
|
}
|
|
4741
4741
|
|
|
4742
|
+
// ---------------------------------------------------------------------------
|
|
4743
|
+
// Inception
|
|
4744
|
+
// ---------------------------------------------------------------------------
|
|
4745
|
+
|
|
4746
|
+
/**
|
|
4747
|
+
* Builds Inception's authenticated model-discovery manager. A successful
|
|
4748
|
+
* `/v1/models` fetch is the complete roster, keeping only rows that advertise
|
|
4749
|
+
* `chat.completions` (the shared roster also lists FIM/edit and Decisions-only
|
|
4750
|
+
* models); without an API key the bundled Mercury seeds are served.
|
|
4751
|
+
*/
|
|
4752
|
+
export function inceptionModelManagerOptions(config?: ModelManagerConfig): ModelManagerOptions<"openai-completions"> {
|
|
4753
|
+
return {
|
|
4754
|
+
...createOpenAICompatibleModelManagerOptions({
|
|
4755
|
+
api: "openai-completions",
|
|
4756
|
+
providerId: "inception",
|
|
4757
|
+
defaultBaseUrl: "https://api.inceptionlabs.ai/v1",
|
|
4758
|
+
config,
|
|
4759
|
+
requireApiKey: true,
|
|
4760
|
+
dynamicModelsAuthoritative: true,
|
|
4761
|
+
mapModel: (entry, defaults, reference) => {
|
|
4762
|
+
// The shared roster also contains FIM/edit and Decisions-only models;
|
|
4763
|
+
// `supported_endpoints` is required, so a row without it is not chat.
|
|
4764
|
+
if (!Array.isArray(entry.supported_endpoints) || !entry.supported_endpoints.includes("chat.completions")) {
|
|
4765
|
+
return null;
|
|
4766
|
+
}
|
|
4767
|
+
const model = mapWithBundledReference(entry, defaults, reference);
|
|
4768
|
+
return {
|
|
4769
|
+
...model,
|
|
4770
|
+
input: Array.isArray(entry.input_modalities) ? toInputCapabilities(entry.input_modalities) : model.input,
|
|
4771
|
+
cost: isRecord(entry.pricing) ? perTokenPricingCost(entry.pricing) : model.cost,
|
|
4772
|
+
contextWindow: toPositiveNumber(entry.context_length, model.contextWindow),
|
|
4773
|
+
maxTokens: toPositiveNumber(entry.max_output_length, model.maxTokens),
|
|
4774
|
+
...(Array.isArray(entry.supported_features) && {
|
|
4775
|
+
supportsTools: entry.supported_features.includes("tools"),
|
|
4776
|
+
}),
|
|
4777
|
+
};
|
|
4778
|
+
},
|
|
4779
|
+
}),
|
|
4780
|
+
staticModels: seedModels<"openai-completions">("inception"),
|
|
4781
|
+
};
|
|
4782
|
+
}
|
|
4783
|
+
|
|
4742
4784
|
// ---------------------------------------------------------------------------
|
|
4743
4785
|
// 15.5 CoreWeave Serverless Inference
|
|
4744
4786
|
// ---------------------------------------------------------------------------
|
package/src/types.ts
CHANGED
|
@@ -810,8 +810,8 @@ export interface AnthropicCompat {
|
|
|
810
810
|
}
|
|
811
811
|
|
|
812
812
|
/**
|
|
813
|
-
* Compatibility settings for Bedrock Converse
|
|
814
|
-
*
|
|
813
|
+
* Compatibility settings for Bedrock Converse requests and native streaming
|
|
814
|
+
* side-compaction. Cache pricing does not imply these capabilities.
|
|
815
815
|
*/
|
|
816
816
|
export interface BedrockCompat {
|
|
817
817
|
/** Explicit disabled-thinking wire form; unset preserves the provider's existing behavior. */
|
|
@@ -859,9 +859,14 @@ export interface BedrockCompat {
|
|
|
859
859
|
* local prefix-binding safeguards. Default: true.
|
|
860
860
|
*/
|
|
861
861
|
supportsThinkingBindingControls?: boolean;
|
|
862
|
+
/**
|
|
863
|
+
* Whether the model supports a compaction-only Bedrock Runtime
|
|
864
|
+
* InvokeModelWithResponseStream request. Ordinary turns still use Converse.
|
|
865
|
+
*/
|
|
866
|
+
supportsServerCompaction?: boolean;
|
|
862
867
|
}
|
|
863
868
|
|
|
864
|
-
/** Fully-resolved Bedrock Converse
|
|
869
|
+
/** Fully-resolved Bedrock Converse and side-compaction capabilities, materialized once by `buildModel`. */
|
|
865
870
|
export interface ResolvedBedrockCompat {
|
|
866
871
|
/** See {@link BedrockCompat.disabledThinking}. */
|
|
867
872
|
disabledThinking?: BedrockCompat["disabledThinking"];
|
|
@@ -876,6 +881,8 @@ export interface ResolvedBedrockCompat {
|
|
|
876
881
|
supportsForcedToolChoice: boolean;
|
|
877
882
|
/** See {@link BedrockCompat.supportsThinkingBindingControls}. */
|
|
878
883
|
supportsThinkingBindingControls: boolean;
|
|
884
|
+
/** See {@link BedrockCompat.supportsServerCompaction}; false unless the Bedrock model-card policy opts in. */
|
|
885
|
+
supportsServerCompaction: boolean;
|
|
879
886
|
/**
|
|
880
887
|
* Stream-watchdog idle-timeout fallback in ms for hosts with no keepalive
|
|
881
888
|
* events; 0 disables the idle watchdog. Undefined defers to
|
package/src/wire/devin.ts
CHANGED
|
@@ -17,7 +17,7 @@ const DEVIN_LOCALE = "en";
|
|
|
17
17
|
/**
|
|
18
18
|
* Released Devin CLI request identity. The backend gates behavior on this
|
|
19
19
|
* tuple: `ideType: "chisel"` is what unlocks router assignment (`AssignModel`)
|
|
20
|
-
* and the CLI model surface
|
|
20
|
+
* and the CLI model surface.
|
|
21
21
|
*/
|
|
22
22
|
const DEVIN_CLI_METADATA = {
|
|
23
23
|
ideName: "devin-cli",
|
|
@@ -31,9 +31,8 @@ const DEVIN_CLI_METADATA = {
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Native discovery identity. The Devin CLI announces itself as the `chisel`
|
|
34
|
-
* client on its dev channel for `GetCliModelConfigs`; that identity
|
|
35
|
-
* released chat identity
|
|
36
|
-
* config set.
|
|
34
|
+
* client on its dev channel for `GetCliModelConfigs`; that identity, not the
|
|
35
|
+
* released chat identity, unlocks the full native config set.
|
|
37
36
|
*/
|
|
38
37
|
const DEVIN_DISCOVERY_METADATA = {
|
|
39
38
|
ideName: "chisel",
|
|
@@ -44,33 +43,30 @@ const DEVIN_DISCOVERY_METADATA = {
|
|
|
44
43
|
os: DEVIN_OS,
|
|
45
44
|
} as const;
|
|
46
45
|
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/** Released-CLI metadata with credential bytes already encoded for the wire. */
|
|
54
|
-
export function devinWireMetadata(apiKey: string | undefined, userJwt = "") {
|
|
55
|
-
return {
|
|
56
|
-
apiKey: apiKey ?? "",
|
|
57
|
-
userJwt,
|
|
58
|
-
...DEVIN_CLI_METADATA,
|
|
59
|
-
};
|
|
46
|
+
/** Prefixes bare JWT-shaped session tokens; every other key, legacy `sk-ws-` ones included, goes out as stored. */
|
|
47
|
+
function encodeDevinCredential(apiKey: string | undefined): string {
|
|
48
|
+
const key = apiKey?.trim();
|
|
49
|
+
if (!key) return "";
|
|
50
|
+
if (key.startsWith(DEVIN_SESSION_TOKEN_PREFIX)) return key;
|
|
51
|
+
return key.split(".").length === 3 ? `${DEVIN_SESSION_TOKEN_PREFIX}${key}` : key;
|
|
60
52
|
}
|
|
61
53
|
|
|
62
54
|
/**
|
|
63
55
|
* Fields for `Metadata` on released-CLI calls (`GetUserJwt`, `AssignModel`,
|
|
64
|
-
* `GetChatMessage`, `GetUserStatus`)
|
|
56
|
+
* `GetChatMessage`, `GetUserStatus`).
|
|
65
57
|
*/
|
|
66
58
|
export function devinCliMetadata(apiKey: string | undefined, userJwt = "") {
|
|
67
|
-
return
|
|
59
|
+
return {
|
|
60
|
+
apiKey: encodeDevinCredential(apiKey),
|
|
61
|
+
userJwt,
|
|
62
|
+
...DEVIN_CLI_METADATA,
|
|
63
|
+
};
|
|
68
64
|
}
|
|
69
65
|
|
|
70
66
|
/** Fields for `Metadata` on the dev-channel `GetCliModelConfigs` call. */
|
|
71
67
|
export function devinDiscoveryMetadata(apiKey: string | undefined) {
|
|
72
68
|
return {
|
|
73
|
-
apiKey:
|
|
69
|
+
apiKey: encodeDevinCredential(apiKey),
|
|
74
70
|
...DEVIN_DISCOVERY_METADATA,
|
|
75
71
|
};
|
|
76
72
|
}
|