@omnicross/contracts 0.1.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/LICENSE +21 -0
- package/README.md +15 -0
- package/dist/account-tokens-types.cjs +18 -0
- package/dist/account-tokens-types.d.cts +142 -0
- package/dist/account-tokens-types.d.ts +142 -0
- package/dist/account-tokens-types.js +0 -0
- package/dist/canonical-models.cjs +262 -0
- package/dist/canonical-models.d.cts +107 -0
- package/dist/canonical-models.d.ts +107 -0
- package/dist/canonical-models.js +232 -0
- package/dist/completion-types.cjs +18 -0
- package/dist/completion-types.d.cts +324 -0
- package/dist/completion-types.d.ts +324 -0
- package/dist/completion-types.js +0 -0
- package/dist/endpoint-resolver.cjs +54 -0
- package/dist/endpoint-resolver.d.cts +43 -0
- package/dist/endpoint-resolver.d.ts +43 -0
- package/dist/endpoint-resolver.js +29 -0
- package/dist/extended-context.cjs +39 -0
- package/dist/extended-context.d.cts +21 -0
- package/dist/extended-context.d.ts +21 -0
- package/dist/extended-context.js +13 -0
- package/dist/index.cjs +2724 -0
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +2656 -0
- package/dist/llm-config-CQjOimv2.d.cts +390 -0
- package/dist/llm-config-D1jKQLVp.d.ts +390 -0
- package/dist/llm-config.cjs +18 -0
- package/dist/llm-config.d.cts +2 -0
- package/dist/llm-config.d.ts +2 -0
- package/dist/llm-config.js +0 -0
- package/dist/mcp-types.cjs +33 -0
- package/dist/mcp-types.d.cts +131 -0
- package/dist/mcp-types.d.ts +131 -0
- package/dist/mcp-types.js +8 -0
- package/dist/message-blocks.cjs +18 -0
- package/dist/message-blocks.d.cts +44 -0
- package/dist/message-blocks.d.ts +44 -0
- package/dist/message-blocks.js +0 -0
- package/dist/provider-presets/index.cjs +2183 -0
- package/dist/provider-presets/index.d.cts +104 -0
- package/dist/provider-presets/index.d.ts +104 -0
- package/dist/provider-presets/index.js +2143 -0
- package/dist/subscription-types.cjs +48 -0
- package/dist/subscription-types.d.cts +149 -0
- package/dist/subscription-types.d.ts +149 -0
- package/dist/subscription-types.js +22 -0
- package/dist/thinking-CBWSLel8.d.cts +33 -0
- package/dist/thinking-CBWSLel8.d.ts +33 -0
- package/dist/thinking-config.cjs +243 -0
- package/dist/thinking-config.d.cts +71 -0
- package/dist/thinking-config.d.ts +71 -0
- package/dist/thinking-config.js +205 -0
- package/dist/usage-types.cjs +18 -0
- package/dist/usage-types.d.cts +41 -0
- package/dist/usage-types.d.ts +41 -0
- package/dist/usage-types.js +0 -0
- package/dist/websearch-types.cjs +37 -0
- package/dist/websearch-types.d.cts +76 -0
- package/dist/websearch-types.d.ts +76 -0
- package/dist/websearch-types.js +11 -0
- package/package.json +116 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { p as ProviderModelMapping, q as ProviderSearchConfig, P as PresetProviderTemplate } from '../llm-config-CQjOimv2.cjs';
|
|
2
|
+
export { A as API_MODE_IDS, d as ApiMode, e as ApiModeId, f as CodingPlanConfig, S as SearchCapability } from '../llm-config-CQjOimv2.cjs';
|
|
3
|
+
import '../thinking-CBWSLel8.cjs';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Derived/companion maps + the seed-id const for the provider preset registry.
|
|
7
|
+
* These are CODE, not catalog data (several reference preset ids the orphan-id
|
|
8
|
+
* tests police), so they stay TypeScript. Moved verbatim from the prior flat
|
|
9
|
+
* `provider-presets.ts`.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Coding Plan URL presets keyed by preset `id` (NOT `presetId`).
|
|
14
|
+
* When enabling Coding Plan, the baseUrl is auto-filled from this map.
|
|
15
|
+
*
|
|
16
|
+
* Note: For variants that share `presetId` (e.g. xiaomi-mimo OpenAI vs Anthropic
|
|
17
|
+
* formats both share `presetId: 'xiaomi-mimo'`), each variant has its own row
|
|
18
|
+
* here keyed by its unique `id`.
|
|
19
|
+
*/
|
|
20
|
+
declare const CODING_PLAN_URL_PRESETS: Record<string, {
|
|
21
|
+
baseUrl: string;
|
|
22
|
+
separateApiKey?: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Known provider model mappings for the follow-provider feature.
|
|
26
|
+
* Key is the provider's presetId (matching LLM_PROVIDER_PRESETS[].presetId).
|
|
27
|
+
* Variants that share a presetId (e.g. xiaomi-mimo OpenAI/Anthropic) share one mapping.
|
|
28
|
+
*/
|
|
29
|
+
declare const PROVIDER_MODEL_MAPPINGS: Record<string, ProviderModelMapping>;
|
|
30
|
+
/**
|
|
31
|
+
* Search configurations for known providers.
|
|
32
|
+
* Key is the provider's presetId (matching LLM_PROVIDER_PRESETS[].id or PROVIDER_TEMPLATES[].id).
|
|
33
|
+
*/
|
|
34
|
+
declare const PROVIDER_SEARCH_CONFIGS: Record<string, ProviderSearchConfig>;
|
|
35
|
+
/**
|
|
36
|
+
* Per-preset overrides for the default `maxConcurrency`. Anything not listed
|
|
37
|
+
* falls back to {@link DEFAULT_MAX_CONCURRENCY} (-1 = no limit). The Chinese
|
|
38
|
+
* cloud providers cluster here because they ship stricter per-key rate limits
|
|
39
|
+
* (TPM / QPS) that bite at low concurrency — well-funded international
|
|
40
|
+
* providers handle parallelism themselves, so a client-side semaphore would
|
|
41
|
+
* just throttle us for no reason.
|
|
42
|
+
*
|
|
43
|
+
* A preset's own explicit `maxConcurrency` field still wins over this map.
|
|
44
|
+
*/
|
|
45
|
+
declare const MAX_CONCURRENCY_DEFAULTS: Record<string, number>;
|
|
46
|
+
/**
|
|
47
|
+
* Default seed preset IDs for cold-boot — all available presets.
|
|
48
|
+
* Each ID MUST resolve via `getAllProviderPresets()` — the host's provider
|
|
49
|
+
* manager asserts this in development to catch orphan IDs early.
|
|
50
|
+
*
|
|
51
|
+
* **Ordering**: popular at top, cold/niche at bottom. The array index becomes
|
|
52
|
+
* the initial `sortOrder` (× 100 to leave gaps for manual inserts), so users
|
|
53
|
+
* see flagship providers first in the client's provider list. They can
|
|
54
|
+
* drag-reorder afterwards via `reorderProviders()`.
|
|
55
|
+
*
|
|
56
|
+
* Tiers:
|
|
57
|
+
* 1. International flagship (openai/anthropic/gemini/deepseek/grok)
|
|
58
|
+
* 2. Aggregator + Chinese flagship with coding plan
|
|
59
|
+
* 3. International extras + fast inference + local
|
|
60
|
+
* 4. Specialized (azure / openai-response)
|
|
61
|
+
* 5. Cold / niche / variants (bottom)
|
|
62
|
+
*/
|
|
63
|
+
declare const DEFAULT_SEED_PRESET_IDS: readonly string[];
|
|
64
|
+
|
|
65
|
+
/** Top-level catalog version (additive metadata; reserved, inert). */
|
|
66
|
+
declare const CATALOG_VERSION: number;
|
|
67
|
+
/**
|
|
68
|
+
* LLM provider presets — single flat list, assembled from `presets/<id>.json`
|
|
69
|
+
* in source order. Deep-equal to the prior flat TS array (golden-tested).
|
|
70
|
+
*/
|
|
71
|
+
declare const LLM_PROVIDER_PRESETS: PresetProviderTemplate[];
|
|
72
|
+
/** Resolve a preset's revision (default 1). Reserved; no current consumer. */
|
|
73
|
+
declare function getPresetRevision(id: string): number;
|
|
74
|
+
/**
|
|
75
|
+
* Resolve follow-provider model for a given provider.
|
|
76
|
+
* Returns the mapped model ref string ("providerId,modelId") or undefined.
|
|
77
|
+
*/
|
|
78
|
+
declare function resolveFollowProviderModel(providerId: string, presetId: string | undefined, type: 'background' | 'vision'): string | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Get all provider presets as a flat list (international + Chinese + local + fast-inference).
|
|
81
|
+
* Client preset pickers consume this directly with no grouping.
|
|
82
|
+
*/
|
|
83
|
+
declare function getAllProviderPresets(): PresetProviderTemplate[];
|
|
84
|
+
/**
|
|
85
|
+
* Find a preset by its unique `id` first, then by `presetId` as fallback.
|
|
86
|
+
*
|
|
87
|
+
* `id` is the unique key — for variants that share `presetId` (e.g. xiaomi-mimo
|
|
88
|
+
* OpenAI vs Anthropic), use `id` to disambiguate. Callers passing a `presetId`
|
|
89
|
+
* value (legacy code) still resolve to the first matching variant.
|
|
90
|
+
*/
|
|
91
|
+
declare function getPresetById(idOrPresetId: string): PresetProviderTemplate | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Get the Coding Plan base URL for a preset.
|
|
94
|
+
* Looks up by preset's own `id` first (so Xiaomi double-variant resolves
|
|
95
|
+
* each side correctly), then falls back to CODING_PLAN_URL_PRESETS map.
|
|
96
|
+
*/
|
|
97
|
+
declare function getCodingPlanBaseUrl(idOrPresetId: string): string | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Get the search configuration for a provider by its preset ID.
|
|
100
|
+
* Checks the preset's inline searchConfig first, then falls back to PROVIDER_SEARCH_CONFIGS.
|
|
101
|
+
*/
|
|
102
|
+
declare function getProviderSearchConfig(presetId: string): ProviderSearchConfig | undefined;
|
|
103
|
+
|
|
104
|
+
export { CATALOG_VERSION, CODING_PLAN_URL_PRESETS, DEFAULT_SEED_PRESET_IDS, LLM_PROVIDER_PRESETS, MAX_CONCURRENCY_DEFAULTS, PROVIDER_MODEL_MAPPINGS, PROVIDER_SEARCH_CONFIGS, PresetProviderTemplate, ProviderModelMapping, ProviderSearchConfig, getAllProviderPresets, getCodingPlanBaseUrl, getPresetById, getPresetRevision, getProviderSearchConfig, resolveFollowProviderModel };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { p as ProviderModelMapping, q as ProviderSearchConfig, P as PresetProviderTemplate } from '../llm-config-D1jKQLVp.js';
|
|
2
|
+
export { A as API_MODE_IDS, d as ApiMode, e as ApiModeId, f as CodingPlanConfig, S as SearchCapability } from '../llm-config-D1jKQLVp.js';
|
|
3
|
+
import '../thinking-CBWSLel8.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Derived/companion maps + the seed-id const for the provider preset registry.
|
|
7
|
+
* These are CODE, not catalog data (several reference preset ids the orphan-id
|
|
8
|
+
* tests police), so they stay TypeScript. Moved verbatim from the prior flat
|
|
9
|
+
* `provider-presets.ts`.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Coding Plan URL presets keyed by preset `id` (NOT `presetId`).
|
|
14
|
+
* When enabling Coding Plan, the baseUrl is auto-filled from this map.
|
|
15
|
+
*
|
|
16
|
+
* Note: For variants that share `presetId` (e.g. xiaomi-mimo OpenAI vs Anthropic
|
|
17
|
+
* formats both share `presetId: 'xiaomi-mimo'`), each variant has its own row
|
|
18
|
+
* here keyed by its unique `id`.
|
|
19
|
+
*/
|
|
20
|
+
declare const CODING_PLAN_URL_PRESETS: Record<string, {
|
|
21
|
+
baseUrl: string;
|
|
22
|
+
separateApiKey?: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* Known provider model mappings for the follow-provider feature.
|
|
26
|
+
* Key is the provider's presetId (matching LLM_PROVIDER_PRESETS[].presetId).
|
|
27
|
+
* Variants that share a presetId (e.g. xiaomi-mimo OpenAI/Anthropic) share one mapping.
|
|
28
|
+
*/
|
|
29
|
+
declare const PROVIDER_MODEL_MAPPINGS: Record<string, ProviderModelMapping>;
|
|
30
|
+
/**
|
|
31
|
+
* Search configurations for known providers.
|
|
32
|
+
* Key is the provider's presetId (matching LLM_PROVIDER_PRESETS[].id or PROVIDER_TEMPLATES[].id).
|
|
33
|
+
*/
|
|
34
|
+
declare const PROVIDER_SEARCH_CONFIGS: Record<string, ProviderSearchConfig>;
|
|
35
|
+
/**
|
|
36
|
+
* Per-preset overrides for the default `maxConcurrency`. Anything not listed
|
|
37
|
+
* falls back to {@link DEFAULT_MAX_CONCURRENCY} (-1 = no limit). The Chinese
|
|
38
|
+
* cloud providers cluster here because they ship stricter per-key rate limits
|
|
39
|
+
* (TPM / QPS) that bite at low concurrency — well-funded international
|
|
40
|
+
* providers handle parallelism themselves, so a client-side semaphore would
|
|
41
|
+
* just throttle us for no reason.
|
|
42
|
+
*
|
|
43
|
+
* A preset's own explicit `maxConcurrency` field still wins over this map.
|
|
44
|
+
*/
|
|
45
|
+
declare const MAX_CONCURRENCY_DEFAULTS: Record<string, number>;
|
|
46
|
+
/**
|
|
47
|
+
* Default seed preset IDs for cold-boot — all available presets.
|
|
48
|
+
* Each ID MUST resolve via `getAllProviderPresets()` — the host's provider
|
|
49
|
+
* manager asserts this in development to catch orphan IDs early.
|
|
50
|
+
*
|
|
51
|
+
* **Ordering**: popular at top, cold/niche at bottom. The array index becomes
|
|
52
|
+
* the initial `sortOrder` (× 100 to leave gaps for manual inserts), so users
|
|
53
|
+
* see flagship providers first in the client's provider list. They can
|
|
54
|
+
* drag-reorder afterwards via `reorderProviders()`.
|
|
55
|
+
*
|
|
56
|
+
* Tiers:
|
|
57
|
+
* 1. International flagship (openai/anthropic/gemini/deepseek/grok)
|
|
58
|
+
* 2. Aggregator + Chinese flagship with coding plan
|
|
59
|
+
* 3. International extras + fast inference + local
|
|
60
|
+
* 4. Specialized (azure / openai-response)
|
|
61
|
+
* 5. Cold / niche / variants (bottom)
|
|
62
|
+
*/
|
|
63
|
+
declare const DEFAULT_SEED_PRESET_IDS: readonly string[];
|
|
64
|
+
|
|
65
|
+
/** Top-level catalog version (additive metadata; reserved, inert). */
|
|
66
|
+
declare const CATALOG_VERSION: number;
|
|
67
|
+
/**
|
|
68
|
+
* LLM provider presets — single flat list, assembled from `presets/<id>.json`
|
|
69
|
+
* in source order. Deep-equal to the prior flat TS array (golden-tested).
|
|
70
|
+
*/
|
|
71
|
+
declare const LLM_PROVIDER_PRESETS: PresetProviderTemplate[];
|
|
72
|
+
/** Resolve a preset's revision (default 1). Reserved; no current consumer. */
|
|
73
|
+
declare function getPresetRevision(id: string): number;
|
|
74
|
+
/**
|
|
75
|
+
* Resolve follow-provider model for a given provider.
|
|
76
|
+
* Returns the mapped model ref string ("providerId,modelId") or undefined.
|
|
77
|
+
*/
|
|
78
|
+
declare function resolveFollowProviderModel(providerId: string, presetId: string | undefined, type: 'background' | 'vision'): string | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Get all provider presets as a flat list (international + Chinese + local + fast-inference).
|
|
81
|
+
* Client preset pickers consume this directly with no grouping.
|
|
82
|
+
*/
|
|
83
|
+
declare function getAllProviderPresets(): PresetProviderTemplate[];
|
|
84
|
+
/**
|
|
85
|
+
* Find a preset by its unique `id` first, then by `presetId` as fallback.
|
|
86
|
+
*
|
|
87
|
+
* `id` is the unique key — for variants that share `presetId` (e.g. xiaomi-mimo
|
|
88
|
+
* OpenAI vs Anthropic), use `id` to disambiguate. Callers passing a `presetId`
|
|
89
|
+
* value (legacy code) still resolve to the first matching variant.
|
|
90
|
+
*/
|
|
91
|
+
declare function getPresetById(idOrPresetId: string): PresetProviderTemplate | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Get the Coding Plan base URL for a preset.
|
|
94
|
+
* Looks up by preset's own `id` first (so Xiaomi double-variant resolves
|
|
95
|
+
* each side correctly), then falls back to CODING_PLAN_URL_PRESETS map.
|
|
96
|
+
*/
|
|
97
|
+
declare function getCodingPlanBaseUrl(idOrPresetId: string): string | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Get the search configuration for a provider by its preset ID.
|
|
100
|
+
* Checks the preset's inline searchConfig first, then falls back to PROVIDER_SEARCH_CONFIGS.
|
|
101
|
+
*/
|
|
102
|
+
declare function getProviderSearchConfig(presetId: string): ProviderSearchConfig | undefined;
|
|
103
|
+
|
|
104
|
+
export { CATALOG_VERSION, CODING_PLAN_URL_PRESETS, DEFAULT_SEED_PRESET_IDS, LLM_PROVIDER_PRESETS, MAX_CONCURRENCY_DEFAULTS, PROVIDER_MODEL_MAPPINGS, PROVIDER_SEARCH_CONFIGS, PresetProviderTemplate, ProviderModelMapping, ProviderSearchConfig, getAllProviderPresets, getCodingPlanBaseUrl, getPresetById, getPresetRevision, getProviderSearchConfig, resolveFollowProviderModel };
|