@x12i/ai-tools 2.1.5 → 2.2.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/dist/catalog/index.cjs +4 -4
- package/dist/catalog/index.js +3 -3
- package/dist/{chunk-U3BAEJ2C.cjs → chunk-33AAM7KQ.cjs} +3 -3
- package/dist/{chunk-U3BAEJ2C.cjs.map → chunk-33AAM7KQ.cjs.map} +1 -1
- package/dist/{chunk-4ILJWO64.js → chunk-3CUSLNEV.js} +8 -1
- package/dist/chunk-3CUSLNEV.js.map +1 -0
- package/dist/{chunk-SYDW33AL.cjs → chunk-EDZOFPLV.cjs} +8 -1
- package/dist/chunk-EDZOFPLV.cjs.map +1 -0
- package/dist/{chunk-IYRZYLUP.cjs → chunk-FWPH5YE6.cjs} +11 -11
- package/dist/{chunk-IYRZYLUP.cjs.map → chunk-FWPH5YE6.cjs.map} +1 -1
- package/dist/{chunk-5IZ7PLY2.cjs → chunk-FYRPN3N2.cjs} +3 -3
- package/dist/chunk-FYRPN3N2.cjs.map +1 -0
- package/dist/{chunk-4UA2V5R2.cjs → chunk-GHRUS5UF.cjs} +14 -14
- package/dist/{chunk-4UA2V5R2.cjs.map → chunk-GHRUS5UF.cjs.map} +1 -1
- package/dist/{chunk-WJFOQS6I.js → chunk-M35MNKDY.js} +3 -3
- package/dist/{chunk-YQVY7CWT.js → chunk-MLMQ5LGW.js} +2 -2
- package/dist/{chunk-YQVY7CWT.js.map → chunk-MLMQ5LGW.js.map} +1 -1
- package/dist/{chunk-DYVCBK2C.js → chunk-PP75SWKY.js} +2 -2
- package/dist/{chunk-RK4QKTQ2.cjs → chunk-QILRLRA4.cjs} +5 -5
- package/dist/{chunk-RK4QKTQ2.cjs.map → chunk-QILRLRA4.cjs.map} +1 -1
- package/dist/{chunk-OZHZUMNR.js → chunk-TFQUMP2O.js} +2 -2
- package/dist/{chunk-WBHH3JEK.js → chunk-TLUM25FM.js} +8 -3
- package/dist/chunk-TLUM25FM.js.map +1 -0
- package/dist/{chunk-YY2AGHRV.cjs → chunk-UIDCBJXR.cjs} +7 -7
- package/dist/{chunk-YY2AGHRV.cjs.map → chunk-UIDCBJXR.cjs.map} +1 -1
- package/dist/{chunk-MN6K2YHF.js → chunk-WMB3YEQQ.js} +3 -3
- package/dist/{chunk-CM3GY62V.cjs → chunk-XD5RQKYL.cjs} +10 -5
- package/dist/chunk-XD5RQKYL.cjs.map +1 -0
- package/dist/{chunk-DIVRTJUA.js → chunk-XJQODPN6.js} +2 -2
- package/dist/cli/index.cjs +16 -16
- package/dist/cli/index.js +7 -7
- package/dist/cost/index.cjs +5 -5
- package/dist/cost/index.js +4 -4
- package/dist/index.cjs +9 -9
- package/dist/index.js +8 -8
- package/dist/models/index.cjs +6 -6
- package/dist/models/index.js +5 -5
- package/dist/profiles/index.cjs +2 -2
- package/dist/profiles/index.js +1 -1
- package/dist/sync/index.cjs +2 -2
- package/dist/sync/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-4ILJWO64.js.map +0 -1
- package/dist/chunk-5IZ7PLY2.cjs.map +0 -1
- package/dist/chunk-CM3GY62V.cjs.map +0 -1
- package/dist/chunk-SYDW33AL.cjs.map +0 -1
- package/dist/chunk-WBHH3JEK.js.map +0 -1
- /package/dist/{chunk-WJFOQS6I.js.map → chunk-M35MNKDY.js.map} +0 -0
- /package/dist/{chunk-DYVCBK2C.js.map → chunk-PP75SWKY.js.map} +0 -0
- /package/dist/{chunk-OZHZUMNR.js.map → chunk-TFQUMP2O.js.map} +0 -0
- /package/dist/{chunk-MN6K2YHF.js.map → chunk-WMB3YEQQ.js.map} +0 -0
- /package/dist/{chunk-DIVRTJUA.js.map → chunk-XJQODPN6.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
MODEL_FIELD_PRIORITY,
|
|
5
5
|
extractUsageInput,
|
|
6
6
|
resolveUsageModel
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TFQUMP2O.js";
|
|
8
8
|
import {
|
|
9
9
|
AIToolbox
|
|
10
10
|
} from "./chunk-XRBZQQQU.js";
|
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
countModels,
|
|
26
26
|
filterModels,
|
|
27
27
|
getModelInfo
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-M35MNKDY.js";
|
|
29
29
|
import {
|
|
30
30
|
resolveModelVendor
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-WMB3YEQQ.js";
|
|
32
32
|
import {
|
|
33
33
|
normalizeOpenRouterModel
|
|
34
34
|
} from "./chunk-VDNKQRDG.js";
|
|
@@ -38,11 +38,11 @@ import {
|
|
|
38
38
|
resolveModelVendorFromResolution,
|
|
39
39
|
resolveModelVendorLastResort,
|
|
40
40
|
resolveModelVendorSync
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-3CUSLNEV.js";
|
|
42
42
|
import {
|
|
43
43
|
refreshAiModelsCatalog,
|
|
44
44
|
verifyAiModelsCatalog
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-PP75SWKY.js";
|
|
46
46
|
import {
|
|
47
47
|
AiModelsCatalogClient,
|
|
48
48
|
DEFAULT_CATALOG_CACHE_TTL_MS,
|
|
@@ -52,8 +52,8 @@ import {
|
|
|
52
52
|
loadCatalogSources,
|
|
53
53
|
loadCatalogSourcesCached,
|
|
54
54
|
resolveCatalogCacheTtlMs
|
|
55
|
-
} from "./chunk-
|
|
56
|
-
import "./chunk-
|
|
55
|
+
} from "./chunk-XJQODPN6.js";
|
|
56
|
+
import "./chunk-TLUM25FM.js";
|
|
57
57
|
import {
|
|
58
58
|
REASONING_SUPPORTED_PARAMETERS,
|
|
59
59
|
computeSupportsReasoning,
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
profileConfigFromResolved,
|
|
90
90
|
resolveAIProfile,
|
|
91
91
|
resolveProfileForAsk
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-MLMQ5LGW.js";
|
|
93
93
|
export {
|
|
94
94
|
AIToolbox,
|
|
95
95
|
AiModelsCatalogClient,
|
package/dist/models/index.cjs
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('../chunk-
|
|
7
|
+
var _chunkQILRLRA4cjs = require('../chunk-QILRLRA4.cjs');
|
|
8
|
+
require('../chunk-FWPH5YE6.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkYO7AJ5Z3cjs = require('../chunk-YO7AJ5Z3.cjs');
|
|
13
|
-
require('../chunk-
|
|
14
|
-
require('../chunk-
|
|
15
|
-
require('../chunk-
|
|
13
|
+
require('../chunk-EDZOFPLV.cjs');
|
|
14
|
+
require('../chunk-33AAM7KQ.cjs');
|
|
15
|
+
require('../chunk-XD5RQKYL.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
@@ -35,5 +35,5 @@ require('../chunk-GS7T56RP.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
exports.AiModelsService =
|
|
38
|
+
exports.AiModelsService = _chunkQILRLRA4cjs.AiModelsService; exports.REASONING_SUPPORTED_PARAMETERS = _chunk2KPWVOOTcjs.REASONING_SUPPORTED_PARAMETERS; exports.computeSupportsReasoning = _chunk2KPWVOOTcjs.computeSupportsReasoning; exports.countModels = _chunkQILRLRA4cjs.countModels; exports.extractProviderId = _chunkYO7AJ5Z3cjs.extractProviderId; exports.filterModels = _chunkQILRLRA4cjs.filterModels; exports.getModelInfo = _chunkQILRLRA4cjs.getModelInfo; exports.hasReasoningPricing = _chunk2KPWVOOTcjs.hasReasoningPricing; exports.isReasoningModel = _chunk2KPWVOOTcjs.isReasoningModel; exports.normalizeOpenRouterModel = _chunkYO7AJ5Z3cjs.normalizeOpenRouterModel; exports.supportsReasoningParameter = _chunk2KPWVOOTcjs.supportsReasoningParameter;
|
|
39
39
|
//# sourceMappingURL=index.cjs.map
|
package/dist/models/index.js
CHANGED
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
countModels,
|
|
5
5
|
filterModels,
|
|
6
6
|
getModelInfo
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-M35MNKDY.js";
|
|
8
|
+
import "../chunk-WMB3YEQQ.js";
|
|
9
9
|
import {
|
|
10
10
|
extractProviderId,
|
|
11
11
|
normalizeOpenRouterModel
|
|
12
12
|
} from "../chunk-VDNKQRDG.js";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-3CUSLNEV.js";
|
|
14
|
+
import "../chunk-XJQODPN6.js";
|
|
15
|
+
import "../chunk-TLUM25FM.js";
|
|
16
16
|
import {
|
|
17
17
|
REASONING_SUPPORTED_PARAMETERS,
|
|
18
18
|
computeSupportsReasoning,
|
package/dist/profiles/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkFYRPN3N2cjs = require('../chunk-FYRPN3N2.cjs');
|
|
9
9
|
require('../chunk-GS7T56RP.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
@@ -14,5 +14,5 @@ require('../chunk-GS7T56RP.cjs');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.isKnownProfileOrShortcut =
|
|
17
|
+
exports.isKnownProfileOrShortcut = _chunkFYRPN3N2cjs.isKnownProfileOrShortcut; exports.listAIProfiles = _chunkFYRPN3N2cjs.listAIProfiles; exports.listAIShortcuts = _chunkFYRPN3N2cjs.listAIShortcuts; exports.profileConfigFromResolved = _chunkFYRPN3N2cjs.profileConfigFromResolved; exports.resolveAIProfile = _chunkFYRPN3N2cjs.resolveAIProfile; exports.resolveProfileForAsk = _chunkFYRPN3N2cjs.resolveProfileForAsk;
|
|
18
18
|
//# sourceMappingURL=index.cjs.map
|
package/dist/profiles/index.js
CHANGED
package/dist/sync/index.cjs
CHANGED
|
@@ -11,7 +11,7 @@ require('../chunk-YO7AJ5Z3.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkEDZOFPLVcjs = require('../chunk-EDZOFPLV.cjs');
|
|
15
15
|
require('../chunk-2KPWVOOT.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
@@ -45,5 +45,5 @@ require('../chunk-GS7T56RP.cjs');
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
exports.ModelNameResolver = _chunkOZE336BLcjs.ModelNameResolver; exports.OpenRouterSyncProvider = _chunkJDOFFZJAcjs.OpenRouterSyncProvider; exports.buildCatalogIndexes = _chunkOZE336BLcjs.buildCatalogIndexes; exports.createModelNameResolver = _chunkJDOFFZJAcjs.createModelNameResolver; exports.isEffectiveOpenRouterTransport = _chunkOZE336BLcjs.isEffectiveOpenRouterTransport; exports.isRoutedViaOpenRouter = _chunkJDOFFZJAcjs.isRoutedViaOpenRouter; exports.loadOpenRouterRoutingEnv = _chunkOZE336BLcjs.loadOpenRouterRoutingEnv; exports.modelVendorRefFromIdentity =
|
|
48
|
+
exports.ModelNameResolver = _chunkOZE336BLcjs.ModelNameResolver; exports.OpenRouterSyncProvider = _chunkJDOFFZJAcjs.OpenRouterSyncProvider; exports.buildCatalogIndexes = _chunkOZE336BLcjs.buildCatalogIndexes; exports.createModelNameResolver = _chunkJDOFFZJAcjs.createModelNameResolver; exports.isEffectiveOpenRouterTransport = _chunkOZE336BLcjs.isEffectiveOpenRouterTransport; exports.isRoutedViaOpenRouter = _chunkJDOFFZJAcjs.isRoutedViaOpenRouter; exports.loadOpenRouterRoutingEnv = _chunkOZE336BLcjs.loadOpenRouterRoutingEnv; exports.modelVendorRefFromIdentity = _chunkEDZOFPLVcjs.modelVendorRefFromIdentity; exports.modelVendorRefFromVendorAndSlug = _chunkEDZOFPLVcjs.modelVendorRefFromVendorAndSlug; exports.normalizeProvider = _chunkOZE336BLcjs.normalizeProvider; exports.normalizeString = _chunkOZE336BLcjs.normalizeString; exports.providerIdToEnvKeyPrefix = _chunkOZE336BLcjs.providerIdToEnvKeyPrefix; exports.resolveModel = _chunkJDOFFZJAcjs.resolveModel; exports.resolveModelVendorFromResolution = _chunkEDZOFPLVcjs.resolveModelVendorFromResolution; exports.resolveModelVendorLastResort = _chunkEDZOFPLVcjs.resolveModelVendorLastResort; exports.resolveModelVendorSync = _chunkEDZOFPLVcjs.resolveModelVendorSync; exports.shouldDefaultRouteViaOpenRouter = _chunkOZE336BLcjs.shouldDefaultRouteViaOpenRouter; exports.vendorApiKeyEnvName = _chunkOZE336BLcjs.vendorApiKeyEnvName;
|
|
49
49
|
//# sourceMappingURL=index.cjs.map
|
package/dist/sync/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x12i/ai-tools",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "AI model catalogs (open-assets JSON), cost calculation, and LLM utilities",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@x12i/ai-profiles": "^1.
|
|
88
|
+
"@x12i/ai-profiles": "^1.8.0",
|
|
89
89
|
"@x12i/env": "^4.0.1",
|
|
90
90
|
"commander": "^12.1.0",
|
|
91
91
|
"dotenv": "^16.4.7",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/sync/modelNameResolver/resolveModelVendor.ts"],"sourcesContent":["import {\n buildModelInvocation,\n buildOpenRouterModelId,\n resolveModelIdentity,\n} from \"@x12i/ai-profiles\";\nimport type { ModelInvocationEndpoint } from \"@x12i/ai-profiles\";\nimport type { AiModelRecord } from \"../../models/types.js\";\nimport { ModelNameResolver } from \"./ModelNameResolver.js\";\nimport { PROVIDER_INFERENCE_MAP } from \"./constants.js\";\nimport { normalizeProvider, normalizeString } from \"./normalize.js\";\nimport type {\n ModelResolutionInput,\n ModelResolutionResult,\n ModelResolverOptions,\n} from \"./types.js\";\n\nfunction isOpenRouterProvider(provider?: string): boolean {\n return normalizeProvider(provider) === \"openrouter\";\n}\n\nfunction buildVendorResolveAttempts(model: string): ModelResolutionInput[] {\n const attempts: ModelResolutionInput[] = [];\n const seen = new Set<string>();\n const add = (m: string, p?: string) => {\n const key = `${p ?? \"\"}\\0${normalizeString(m)}`;\n if (seen.has(key)) return;\n seen.add(key);\n attempts.push({ model: m, provider: p });\n };\n\n add(model, undefined);\n\n const normalised = normalizeString(model);\n if (normalised.includes(\"/\")) {\n const prefix = normalised.split(\"/\")[0]!;\n if (!isOpenRouterProvider(prefix)) {\n add(model, normalizeProvider(prefix));\n }\n }\n\n add(model, \"openrouter\");\n return attempts;\n}\n\nexport type ModelVendorRef = {\n provider: string;\n model: string;\n};\n\nexport type ResolveModelVendorOptions = ModelResolverOptions & {\n /** Return OpenRouter transport shape: provider `openrouter`, model `vendor/slug`. */\n asOpenRouter?: boolean;\n};\n\nfunction endpointToRef(endpoint: ModelInvocationEndpoint): ModelVendorRef {\n return { provider: endpoint.provider, model: endpoint.modelId };\n}\n\nfunction invocationToRef(\n providerHint: string,\n modelId: string,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef {\n const invocation = buildModelInvocation(providerHint, normalizeString(modelId));\n if (options?.asOpenRouter) {\n return endpointToRef(\n invocation.openrouter ?? {\n provider: \"openrouter\",\n modelId: buildOpenRouterModelId(providerHint, modelId),\n },\n );\n }\n return endpointToRef(invocation.direct);\n}\n\nfunction fromAiProfilesIdentity(\n ref: NonNullable<ReturnType<typeof resolveModelIdentity>>,\n): ModelVendorRef {\n return { provider: ref.provider, model: ref.modelId };\n}\n\n/** Exact registry / bundled-catalog lookup via @x12i/ai-profiles. */\nexport function modelVendorRefFromIdentity(\n model: string,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef | null {\n const identity = resolveModelIdentity(model, {\n asOpenRouter: options?.asOpenRouter,\n });\n return identity ? fromAiProfilesIdentity(identity) : null;\n}\n\n/** Build `{ provider, model }` using @x12i/ai-profiles transport mapping. */\nexport function modelVendorRefFromVendorAndSlug(\n providerHint: string,\n modelId: string,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef {\n return invocationToRef(providerHint, modelId, options);\n}\n\nfunction inferProviderFromSlug(\n slug: string,\n options?: ResolveModelVendorOptions,\n): string | undefined {\n const patterns = [\n ...(options?.additionalProviderPatterns ?? []),\n ...PROVIDER_INFERENCE_MAP,\n ];\n for (const { pattern, provider } of patterns) {\n if (pattern.test(slug)) return provider;\n }\n return undefined;\n}\n\nfunction providerHintForModelId(\n modelId: string,\n record: AiModelRecord | null | undefined,\n options?: ResolveModelVendorOptions,\n): string | undefined {\n if (record?.providerId) {\n const vendor = normalizeProvider(record.providerId);\n if (vendor && !isOpenRouterProvider(vendor)) return vendor;\n }\n\n const normalised = normalizeString(modelId);\n if (normalised.includes(\"/\")) {\n const prefix = normalised.split(\"/\")[0]!;\n if (!isOpenRouterProvider(prefix)) {\n return normalizeProvider(prefix) ?? prefix;\n }\n }\n\n return inferProviderFromSlug(normalised, options);\n}\n\nfunction formatModelVendorRef(\n modelId: string,\n record: AiModelRecord | null | undefined,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef | null {\n const hint = providerHintForModelId(modelId, record, options);\n if (!hint) return null;\n return invocationToRef(hint, modelId, options);\n}\n\n/** Pattern inference when registry and catalog both miss. */\nexport function resolveModelVendorLastResort(\n model: string,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef | null {\n const hint = providerHintForModelId(model, null, options);\n if (!hint) return null;\n return invocationToRef(hint, model, options);\n}\n\n/** Map a fuzzy catalog resolution result to `{ provider, model }`. */\nexport function resolveModelVendorFromResolution(\n result: ModelResolutionResult,\n inputModel: string,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef | null {\n if (result.found) {\n const ref = formatModelVendorRef(result.modelId, result.record, options);\n if (ref) return ref;\n }\n\n if (!result.found && result.bestRejectedCandidate) {\n const ref = formatModelVendorRef(result.bestRejectedCandidate.modelId, null, options);\n if (ref) return ref;\n }\n\n return resolveModelVendorLastResort(inputModel, options);\n}\n\n/** Best-effort vendor lookup from a model name alone (sync, catalog map only). */\nexport function resolveModelVendorSync(\n model: string,\n catalog: Map<string, AiModelRecord>,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef | null {\n const exact = modelVendorRefFromIdentity(model, options);\n if (exact) return exact;\n\n const resolver = new ModelNameResolver(catalog, options);\n const attempts = buildVendorResolveAttempts(model);\n let last: ModelResolutionResult | null = null;\n\n for (const attempt of attempts) {\n const result = resolver.resolve(attempt);\n last = result;\n if (result.found) {\n const ref = resolveModelVendorFromResolution(result, model, options);\n if (ref) return ref;\n }\n }\n\n return resolveModelVendorFromResolution(\n last ?? {\n found: false,\n modelId: null,\n record: null,\n attemptedStrategies: [],\n reason: \"Model not found in catalog\",\n },\n model,\n options,\n );\n}\n"],"mappings":";;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAYP,SAAS,qBAAqB,UAA4B;AACxD,SAAO,kBAAkB,QAAQ,MAAM;AACzC;AAEA,SAAS,2BAA2B,OAAuC;AACzE,QAAM,WAAmC,CAAC;AAC1C,QAAM,OAAO,oBAAI,IAAY;AAC7B,QAAM,MAAM,CAAC,GAAW,MAAe;AACrC,UAAM,MAAM,GAAG,KAAK,EAAE,KAAK,gBAAgB,CAAC,CAAC;AAC7C,QAAI,KAAK,IAAI,GAAG,EAAG;AACnB,SAAK,IAAI,GAAG;AACZ,aAAS,KAAK,EAAE,OAAO,GAAG,UAAU,EAAE,CAAC;AAAA,EACzC;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S,SAAS,QAAQ,OAAO;AACvC,WAAO;AACP,QAAI,OAAO,OAAO;AAChB,YAAM,MAAM,iCAAiC,QAAQ,OAAO,OAAO;AACnE,UAAI,IAAK,QAAO;AAAA,IAClB;AAAA,EACF;AAEA,SAAO;AAAA,IACL,QAAQ;AAAA,MACN,OAAO;AAAA,MACP,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,qBAAqB,CAAC;AAAA,MACtB,QAAQ;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/ami/Documents/prometheus/x12i/ai-tools/dist/chunk-5IZ7PLY2.cjs","../src/profiles/resolveProfileForAsk.ts","../src/profiles/index.ts"],"names":[],"mappings":"AAAA;ACAA,+CAAiC;AAsC1B,SAAS,yBAAA,CACd,QAAA,EACuB;AACvB,EAAA,OAAO;AAAA,IACL,QAAA,EAAU,QAAA,CAAS,QAAA;AAAA,IACnB,KAAA,EAAO,QAAA,CAAS,OAAA;AAAA,IAChB,eAAA,EAAiB,QAAA,CAAS,eAAA;AAAA,IAC1B,OAAA,EAAS,QAAA,CAAS,OAAA;AAAA,IAClB,OAAA,EAAS,QAAA,CAAS,OAAA;AAAA,IAClB,MAAA,EAAQ,QAAA,CAAS,MAAA;AAAA,IACjB,WAAA,EAAa,QAAA,CAAS,OAAA,CAAQ,WAAA;AAAA,IAC9B,UAAA,EAAY,QAAA,CAAS,OAAA,CAAQ,UAAA;AAAA,IAC7B,UAAA,EAAY,QAAA,CAAS,OAAA,CAAQ,UAAA;AAAA,IAC7B,eAAA,EAAiB,QAAA,CAAS,OAAA,CAAQ,eAAA;AAAA,IAClC,aAAA,EAAe,QAAA,CAAS,OAAA,CAAQ,aAAA;AAAA,IAChC,gBAAA,EAAkB,QAAA,CAAS,OAAA,CAAQ,gBAAA;AAAA,IACnC,QAAA,EAAU,QAAA,CAAS,OAAA,CAAQ,QAAA;AAAA,IAC3B,eAAA,EAAiB,QAAA,CAAS,OAAA,CAAQ,eAAA;AAAA,IAClC,kBAAA,EAAoB,QAAA,CAAS,OAAA,CAAQ,kBAAA;AAAA,IACrC,WAAA,EAAa,QAAA,CAAS,OAAA,CAAQ,WAAA;AAAA,IAC9B,GAAI,QAAA,CAAS,SAAA,IAAa,KAAA,EAAA,EAAY,EAAE,QAAA,EAAU,QAAA,CAAS,SAAS,EAAA,EAAI,CAAC,CAAA;AAAA,IACzE,GAAI,QAAA,CAAS,QAAA,IAAY,KAAA,EAAA,EAAY,EAAE,OAAA,EAAS,QAAA,CAAS,QAAQ,EAAA,EAAI,CAAC,CAAA;AAAA,IACtE;AAAA,EACF,CAAA;AACF;AAOA,MAAA,SAAsB,oBAAA,CACpB,KAAA,EACgC;AAChC,EAAA,MAAM,SAAA,EAAW,MAAM,0CAAA,KAAiB,CAAM,OAAA,EAAS;AAAA,IACrD,MAAA,EAAQ,KAAA,CAAM,MAAA;AAAA,IACd,MAAA,EAAQ,KAAA,CAAM,MAAA;AAAA,IACd,OAAA,EAAS,KAAA,CAAM;AAAA,EACjB,CAAC,CAAA;AACD,EAAA,OAAO,yBAAA,CAA0B,QAAQ,CAAA;AAC3C;AD7CA;AACA;AEfA;AACE;AACA;AACA;AACA;AAAA;AFkBF;AACA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,iWAAC","file":"/Users/ami/Documents/prometheus/x12i/ai-tools/dist/chunk-5IZ7PLY2.cjs","sourcesContent":[null,"import { resolveAIProfile } from \"@x12i/ai-profiles\";\nimport type {\n AIProfileBackend,\n InstructionTier,\n RegistrySourceMode,\n ResolvedAIProfile,\n} from \"@x12i/ai-profiles\";\n\nexport type ResolveProfileForAskInput = {\n profile: string;\n choice?: string;\n source?: RegistrySourceMode;\n refresh?: boolean;\n};\n\n/** FuncX / ask-node model config derived from {@link ResolvedAIProfile}. */\nexport type AskProfileModelConfig = {\n provider: ResolvedAIProfile[\"provider\"];\n model: string;\n instructionTier: InstructionTier;\n backend: AIProfileBackend;\n profile: string;\n choice: string;\n temperature: number;\n outputMode: ResolvedAIProfile[\"runtime\"][\"outputMode\"];\n toolPolicy: ResolvedAIProfile[\"runtime\"][\"toolPolicy\"];\n reasoningEffort: ResolvedAIProfile[\"runtime\"][\"reasoningEffort\"];\n executionMode: ResolvedAIProfile[\"runtime\"][\"executionMode\"];\n requireCitations: boolean;\n allowWeb: boolean;\n allowFileSearch: boolean;\n allowCodeExecution: boolean;\n humanReview: ResolvedAIProfile[\"runtime\"][\"humanReview\"];\n metadata?: Record<string, unknown>;\n pricing?: ResolvedAIProfile[\"pricing\"];\n resolved: ResolvedAIProfile;\n};\n\nexport function profileConfigFromResolved(\n resolved: ResolvedAIProfile,\n): AskProfileModelConfig {\n return {\n provider: resolved.provider,\n model: resolved.modelId,\n instructionTier: resolved.instructionTier,\n backend: resolved.backend,\n profile: resolved.profile,\n choice: resolved.choice,\n temperature: resolved.runtime.temperature,\n outputMode: resolved.runtime.outputMode,\n toolPolicy: resolved.runtime.toolPolicy,\n reasoningEffort: resolved.runtime.reasoningEffort,\n executionMode: resolved.runtime.executionMode,\n requireCitations: resolved.runtime.requireCitations,\n allowWeb: resolved.runtime.allowWeb,\n allowFileSearch: resolved.runtime.allowFileSearch,\n allowCodeExecution: resolved.runtime.allowCodeExecution,\n humanReview: resolved.runtime.humanReview,\n ...(resolved.metadata !== undefined ? { metadata: resolved.metadata } : {}),\n ...(resolved.pricing !== undefined ? { pricing: resolved.pricing } : {}),\n resolved,\n };\n}\n\n/**\n * Resolve a profile (+ optional choice) into ask-node / FuncX model configuration.\n * Uses {@link ResolvedAIProfile.instructionTier} and {@link ResolvedAIProfile.backend}\n * from `@x12i/ai-profiles` — do not duplicate preset tables locally.\n */\nexport async function resolveProfileForAsk(\n input: ResolveProfileForAskInput,\n): Promise<AskProfileModelConfig> {\n const resolved = await resolveAIProfile(input.profile, {\n choice: input.choice,\n source: input.source,\n refresh: input.refresh,\n });\n return profileConfigFromResolved(resolved);\n}\n","export {\n resolveProfileForAsk,\n profileConfigFromResolved,\n} from \"./resolveProfileForAsk.js\";\nexport type {\n AskProfileModelConfig,\n ResolveProfileForAskInput,\n} from \"./resolveProfileForAsk.js\";\n\nexport type {\n ResolvedAIProfile,\n InstructionTier,\n AIProfileBackend,\n AIProfileSummary,\n AIShortcutSummary,\n ResolveAIProfileOptions,\n RegistrySourceMode,\n} from \"@x12i/ai-profiles\";\n\nexport {\n resolveAIProfile,\n listAIProfiles,\n listAIShortcuts,\n isKnownProfileOrShortcut,\n} from \"@x12i/ai-profiles\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/ami/Documents/prometheus/x12i/ai-tools/dist/chunk-CM3GY62V.cjs","../src/cost/costModelResolution.ts","../src/cost/aiProfilesMatch.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACKO,SAAS,oBAAA,CAAqB,QAAA,EAA4B;AAC/D,EAAA,OAAO,iDAAA,QAA0B,EAAA,IAAM,YAAA;AACzC;AAEO,SAAS,eAAA,CAAgB,QAAA,EAA4B;AAC1D,EAAA,MAAM,EAAA,mBAAI,iDAAA,QAA0B,CAAA,UAAK,+CAAA,iBAAgB,QAAA,UAAY,IAAE,GAAA;AACvE,EAAA,OAAO,iCAAA,CAAgB,GAAA,CAAI,CAAC,CAAA;AAC9B;AAGO,SAAS,yBAAA,CACd,QAAA,EACA,aAAA,EACS;AACT,EAAA,GAAA,CAAI,iBAAC,QAAA,2BAAU,QAAA,GAAS,QAAA,CAAS,MAAA,EAAQ,OAAO,KAAA;AAChD,EAAA,GAAA,CAAI,QAAA,CAAS,WAAA,CAAY,QAAA,CAAS,4BAA4B,CAAA,EAAG,OAAO,IAAA;AACxE,EAAA,OAAO,eAAA,CAAgB,aAAa,CAAA;AACtC;AAMO,SAAS,2BAAA,CACd,KAAA,EACA,YAAA,EACoB;AACpB,EAAA,MAAM,WAAA,EAAa,+C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AAA;AACD,IAAA;AACT,IAAA;AAGS,IAAA;AACT,IAAA;AACS,IAAA;AACG,IAAA;AACH,IAAA;AACD,IAAA;AACV,EAAA;AACF;AAEe;AAMP,EAAA;AACO,EAAA;AACA,IAAA;AACA,IAAA;AACb,EAAA;AACI,EAAA;AACQ,IAAA;AACZ,EAAA;AAEgC,EAAA;AACrB,EAAA;AACI,IAAA;AACH,IAAA;AACZ,EAAA;AAEa,EAAA;AACH,EAAA;AACG,IAAA;AACE,MAAA;AACL,QAAA;AACN,MAAA;AACF,IAAA;AACF,EAAA;AAEe,EAAA;AACJ,EAAA;AACE,IAAA;AACb,EAAA;AAEa,EAAA;AACC,EAAA;AAChB;AAMsB;AAKL,EAAA;AACT,EAAA;AAEF,EAAA;AACI,IAAA;AACC,IAAA;AACK,EAAA;AACN,IAAA;AACE,MAAA;AACR,IAAA;AACF,EAAA;AAEc,EAAA;AACD,EAAA;AACE,EAAA;AACH,EAAA;AAEN,EAAA;AACF,EAAA;AACK,IAAA;AACL,MAAA;AACA,MAAA;AACA,MAAA;AACA,MAAA;AACF,IAAA;AACF,EAAA;AAEO,EAAA;AACT;AFzBiB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/Users/ami/Documents/prometheus/x12i/ai-tools/dist/chunk-CM3GY62V.cjs","sourcesContent":[null,"import type { AiModelsCatalogClient } from \"../catalog/AiModelsCatalogClient.js\";\nimport { LOCAL_PROVIDERS } from \"../sync/modelNameResolver/constants.js\";\nimport {\n loadOpenRouterRoutingEnv,\n shouldDefaultRouteViaOpenRouter,\n} from \"../sync/openRouterRoutingEnv.js\";\nimport { normalizeProvider, normalizeString } from \"../sync/modelNameResolver/normalize.js\";\nimport type {\n ModelResolutionInput,\n ModelResolutionResult,\n ModelResolverOptions,\n} from \"../sync/modelNameResolver/types.js\";\nimport type { OpenRouterRoutingConfig } from \"../sync/openRouterRoutingEnv.js\";\n\nexport function isOpenRouterProvider(provider?: string): boolean {\n return normalizeProvider(provider) === \"openrouter\";\n}\n\nexport function isLocalProvider(provider?: string): boolean {\n const p = normalizeProvider(provider) ?? normalizeString(provider ?? \"\");\n return LOCAL_PROVIDERS.has(p);\n}\n\n/** Catalog resolver returned success without a priced record (Ollama, LM Studio, …). */\nexport function isLocalProviderResolution(\n resolved: ModelResolutionResult | null,\n inputProvider?: string,\n): boolean {\n if (!resolved?.found || resolved.record) return false;\n if (resolved.resolvedVia.includes(\"local-provider-passthrough\")) return true;\n return isLocalProvider(inputProvider);\n}\n\n/**\n * Vendor id for a model slug (`openai/gpt-4o` → `openai`).\n * Ignores `openrouter` as a provider hint — it is a routing layer, not the model owner.\n */\nexport function underlyingProviderFromModel(\n model: string,\n providerHint?: string,\n): string | undefined {\n const normalized = normalizeString(model);\n if (normalized.includes(\"/\")) {\n const prefix = normalized.split(\"/\")[0]!;\n if (!isOpenRouterProvider(prefix)) return prefix;\n }\n if (providerHint && !isOpenRouterProvider(providerHint)) {\n return normalizeProvider(providerHint);\n }\n return undefined;\n}\n\n/** Provider hint for ai-profiles index lookup (openrouter → underlying vendor). */\nexport function providerHintForProfiles(\n model: string,\n provider?: string,\n): string | undefined {\n if (isOpenRouterProvider(provider)) {\n return underlyingProviderFromModel(model, provider);\n }\n return normalizeProvider(provider);\n}\n\n/**\n * Catalog resolve attempts for direct API and OpenRouter usage.\n * Tries the caller hint, inferred vendor, no hint, and openrouter routing.\n */\nexport function buildCatalogResolveAttempts(\n model: string,\n provider?: string,\n): ModelResolutionInput[] {\n const attempts: ModelResolutionInput[] = [];\n const seen = new Set<string>();\n const add = (m: string, p?: string) => {\n const key = `${p ?? \"\"}\\0${normalizeString(m)}`;\n if (seen.has(key)) return;\n seen.add(key);\n attempts.push({ model: m, provider: p });\n };\n\n add(model, provider);\n\n const underlying = underlyingProviderFromModel(model, provider);\n if (provider) add(model, undefined);\n if (underlying) add(model, underlying);\n if (!isOpenRouterProvider(provider)) {\n add(model, \"openrouter\");\n }\n\n return attempts;\n}\n\nexport async function resolveFromCatalogAttempts(\n catalog: AiModelsCatalogClient,\n attempts: ModelResolutionInput[],\n options?: ModelResolverOptions,\n): Promise<ModelResolutionResult | null> {\n let last: ModelResolutionResult | null = null;\n let localPassthrough: ModelResolutionResult | null = null;\n\n for (const attempt of attempts) {\n const result = await catalog.resolveModel(attempt, options);\n last = result;\n if (result.found && result.record) return result;\n if (\n result.found &&\n !result.record &&\n isLocalProviderResolution(result, attempt.provider)\n ) {\n localPassthrough = result;\n }\n }\n\n return localPassthrough ?? last;\n}\n\nexport function resolveRoutedViaOpenRouter(\n inputProvider: string | undefined,\n resolved: ModelResolutionResult | null,\n modelId?: string,\n routingEnv?: OpenRouterRoutingConfig,\n): boolean {\n const env = routingEnv ?? loadOpenRouterRoutingEnv();\n\n if (isOpenRouterProvider(inputProvider)) return true;\n\n if (resolved?.found) {\n return resolved.routedViaOpenRouter;\n }\n\n const vendor = underlyingProviderFromModel(\n modelId ?? (resolved?.found ? resolved.modelId : \"\") ?? \"\",\n inputProvider,\n );\n if (vendor && shouldDefaultRouteViaOpenRouter(vendor, env)) {\n return true;\n }\n\n return false;\n}\n","import {\n AIProfilesError,\n buildOpenRouterModelId,\n getChoiceOpenRouterModelId,\n getChoicePricing,\n getChoiceVendorModelId,\n loadAIProfilesRegistry,\n resolveAIProfile,\n} from \"@x12i/ai-profiles\";\nimport type {\n AIProfileBackend,\n AIProfileChoice,\n AIModelPricing,\n AIProfilesRegistry,\n InstructionTier,\n RegistrySourceMode,\n ResolvedAIProfile,\n} from \"@x12i/ai-profiles\";\nimport { providerHintForProfiles } from \"./costModelResolution.js\";\nimport { normalizeProvider, normalizeString } from \"../sync/modelNameResolver/normalize.js\";\nimport { stripModelVersionSuffix } from \"../sync/modelNameResolver/stripVersionSuffix.js\";\n\nexport type AiProfilesModelMatch = {\n provider: string;\n modelId: string;\n canonicalModelId: string;\n pricing?: AIModelPricing;\n instructionTier: InstructionTier;\n backend: AIProfileBackend;\n matchedVia: \"profile\" | \"shortcut\" | \"profile-alias\" | \"model-id\";\n profile?: string;\n choice?: string;\n};\n\nfunction profileKey(value: string): string {\n return value.trim().toLowerCase();\n}\n\nfunction canonicalModelId(provider: string, modelId: string): string {\n const normalized = normalizeString(modelId);\n if (normalized.includes(\"/\")) return normalized;\n return buildOpenRouterModelId(provider, normalized);\n}\n\ntype IndexedChoice = {\n provider: string;\n modelId: string;\n canonicalModelId: string;\n pricing?: AIModelPricing;\n profile: string;\n choice: string;\n};\n\nlet cachedIndex: {\n cacheKey: string;\n byKey: Map<string, IndexedChoice[]>;\n} | null = null;\n\nexport type MatchModelInAiProfilesOptions = {\n source?: RegistrySourceMode;\n};\n\n/** When set (tests), overrides default `auto` registry/catalog source. */\nlet registrySourceOverride: RegistrySourceMode | undefined;\n\nfunction registrySource(options?: MatchModelInAiProfilesOptions): RegistrySourceMode {\n return options?.source ?? registrySourceOverride ?? \"auto\";\n}\n\n/** ai-profiles reuses catalog/registry memory cache regardless of requested source unless refresh is set. */\nfunction profileResolveOptions(source: RegistrySourceMode) {\n return source === \"auto\" ? { source } : { source, refresh: true as const };\n}\n\n/** Index bare model ids only — profile/shortcut names resolve via {@link resolveAIProfile}. */\nfunction indexRegistry(registry: AIProfilesRegistry): Map<string, IndexedChoice[]> {\n const byKey = new Map<string, IndexedChoice[]>();\n\n const add = (key: string, entry: IndexedChoice) => {\n const k = profileKey(key);\n if (!k) return;\n const list = byKey.get(k) ?? [];\n if (\n list.some(\n (e) =>\n e.canonicalModelId === entry.canonicalModelId &&\n e.choice === entry.choice &&\n e.profile === entry.profile,\n )\n ) {\n return;\n }\n list.push(entry);\n byKey.set(k, list);\n };\n\n for (const profile of Object.values(registry.profiles)) {\n for (const [choiceKey, choice] of Object.entries(profile.choices)) {\n const entry = choiceEntry(choice, profile.profile, choiceKey);\n add(getChoiceVendorModelId(choice), entry);\n add(canonicalModelId(choice.provider, getChoiceVendorModelId(choice)), entry);\n }\n }\n\n return byKey;\n}\n\nfunction choiceEntry(\n choice: AIProfileChoice,\n profile: string,\n choiceKey: string,\n): IndexedChoice {\n const vendorModelId = getChoiceVendorModelId(choice);\n const provider = normalizeProvider(choice.provider) ?? choice.provider;\n const canonical =\n getChoiceOpenRouterModelId(choice) ??\n canonicalModelId(choice.provider, vendorModelId);\n return {\n provider,\n modelId: normalizeString(vendorModelId),\n canonicalModelId: canonical,\n pricing: getChoicePricing(choice),\n profile,\n choice: choiceKey,\n };\n}\n\nasync function getProfileIndex(\n source: RegistrySourceMode,\n): Promise<Map<string, IndexedChoice[]>> {\n const registry = await loadAIProfilesRegistry(profileResolveOptions(source));\n const cacheKey = `${source}:${registry.version}:${registry.generatedAt ?? \"\"}:${registry.source}`;\n if (cachedIndex?.cacheKey === cacheKey) {\n return cachedIndex.byKey;\n }\n const byKey = indexRegistry(registry);\n cachedIndex = { cacheKey, byKey };\n return byKey;\n}\n\nfunction scoreCandidate(\n entry: IndexedChoice,\n model: string,\n providerHint?: string,\n): number {\n const normalized = normalizeString(model);\n let score = 0;\n\n if (normalized === entry.canonicalModelId) score += 100;\n if (normalized === entry.modelId) score += 80;\n if (providerHint && entry.provider === providerHint) score += 50;\n if (entry.pricing) score += 2;\n\n return score;\n}\n\nfunction pickBest(\n candidates: IndexedChoice[],\n model: string,\n providerHint?: string,\n): IndexedChoice | null {\n if (candidates.length === 0) return null;\n if (candidates.length === 1) return candidates[0]!;\n\n let best = candidates[0]!;\n let bestScore = scoreCandidate(best, model, providerHint);\n for (let i = 1; i < candidates.length; i++) {\n const c = candidates[i]!;\n const s = scoreCandidate(c, model, providerHint);\n if (s > bestScore) {\n best = c;\n bestScore = s;\n }\n }\n return best;\n}\n\nfunction resolvedToMatch(resolved: ResolvedAIProfile): AiProfilesModelMatch {\n const direct = resolved.invocation.direct;\n const canonical =\n resolved.invocation.openrouter?.modelId ??\n buildOpenRouterModelId(direct.provider, direct.modelId);\n return {\n provider: normalizeProvider(direct.provider) ?? direct.provider,\n modelId: normalizeString(direct.modelId),\n canonicalModelId: canonical,\n pricing: resolved.pricing,\n instructionTier: resolved.instructionTier,\n backend: resolved.backend,\n matchedVia: resolved.shortcut ? \"shortcut\" : \"profile\",\n profile: resolved.profile,\n choice: resolved.choice,\n };\n}\n\nasync function fromIndexed(\n entry: IndexedChoice,\n source: RegistrySourceMode,\n): Promise<AiProfilesModelMatch> {\n const resolved = await resolveAIProfile(entry.profile, {\n choice: entry.choice,\n ...profileResolveOptions(source),\n });\n const direct = resolved.invocation.direct;\n return {\n provider: normalizeProvider(direct.provider) ?? direct.provider,\n modelId: normalizeString(direct.modelId),\n canonicalModelId:\n resolved.invocation.openrouter?.modelId ??\n buildOpenRouterModelId(direct.provider, direct.modelId),\n pricing: resolved.pricing ?? entry.pricing,\n instructionTier: resolved.instructionTier,\n backend: resolved.backend,\n matchedVia: \"model-id\",\n profile: resolved.profile,\n choice: resolved.choice,\n };\n}\n\nasync function lookupInIndex(\n index: Map<string, IndexedChoice[]>,\n model: string,\n source: RegistrySourceMode,\n provider?: string,\n): Promise<AiProfilesModelMatch | null> {\n const providerHint = provider ? normalizeProvider(provider) : undefined;\n const keys = [\n profileKey(model),\n profileKey(normalizeString(model)),\n ];\n if (providerHint) {\n keys.push(profileKey(canonicalModelId(providerHint, model)));\n }\n\n const pooled: IndexedChoice[] = [];\n for (const key of keys) {\n const hits = index.get(key);\n if (hits) pooled.push(...hits);\n }\n\n const bare = normalizeString(model);\n if (!bare.includes(\"/\")) {\n for (const list of index.values()) {\n for (const entry of list) {\n if (entry.modelId === bare) pooled.push(entry);\n }\n }\n }\n\n const unique = new Map<string, IndexedChoice>();\n for (const e of pooled) {\n unique.set(`${e.profile}:${e.choice}:${e.canonicalModelId}`, e);\n }\n\n const best = pickBest([...unique.values()], model, providerHint);\n return best ? fromIndexed(best, source) : null;\n}\n\n/**\n * Resolve a model string via @x12i/ai-profiles — profile/shortcut names, aliases,\n * or a concrete model id that appears on a profile choice.\n */\nexport async function matchModelInAiProfiles(\n model: string,\n provider?: string,\n options?: MatchModelInAiProfilesOptions,\n): Promise<AiProfilesModelMatch | null> {\n const source = registrySource(options);\n const resolveOpts = profileResolveOptions(source);\n\n try {\n const resolved = await resolveAIProfile(model, resolveOpts);\n return resolvedToMatch(resolved);\n } catch (err) {\n if (!(err instanceof AIProfilesError) || err.code !== \"UNKNOWN_PROFILE\") {\n throw err;\n }\n }\n\n const index = await getProfileIndex(source);\n const hint = providerHintForProfiles(model, provider);\n const direct = await lookupInIndex(index, model, source, hint);\n if (direct) return direct;\n\n const stripped = stripModelVersionSuffix(model);\n if (stripped && stripped !== normalizeString(model)) {\n return lookupInIndex(\n index,\n stripped,\n source,\n providerHintForProfiles(stripped, provider),\n );\n }\n\n return null;\n}\n\n/** @internal Test-only — reset module cache between tests. */\nexport function resetAiProfilesMatchCacheForTests(\n options?: { source?: RegistrySourceMode },\n): void {\n cachedIndex = null;\n registrySourceOverride = options?.source ?? \"bundled\";\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/ami/Documents/prometheus/x12i/ai-tools/dist/chunk-SYDW33AL.cjs","../src/sync/modelNameResolver/resolveModelVendor.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACPA;AACE;AACA;AACA;AAAA,+CACK;AAYP,SAAS,oBAAA,CAAqB,QAAA,EAA4B;AACxD,EAAA,OAAO,iDAAA,QAA0B,EAAA,IAAM,YAAA;AACzC;AAEA,SAAS,0BAAA,CAA2B,KAAA,EAAuC;AACzE,EAAA,MAAM,SAAA,EAAmC,CAAC,CAAA;AAC1C,EAAA,MAAM,KAAA,kBAAO,IAAI,GAAA,CAAY,CAAA;AAC7B,EAAA,MAAM,IAAA,EAAM,CAAC,CAAA,EAAW,CAAA,EAAA,GAAe;AACrC,IAAA,MAAM,IAAA,EAAM,CAAA,mBAAA;AACC,IAAA;AACD,IAAA;AACH,IAAA;AACX,EAAA;AAEW,EAAA;AAEL,EAAA;AACS,EAAA;AACP,IAAA;AACD,IAAA;AACQ,MAAA;AACb,IAAA;AACF,EAAA;AAEW,EAAA;AACJ,EAAA;AACT;AAYS;AACE,EAAA;AACX;AAES;AAKD,EAAA;AACO,EAAA;AACJ,IAAA;AACM,uBAAA;AACT,QAAA;AACS,QAAA;AACX,MAAA;AACF,IAAA;AACF,EAAA;AACO,EAAA;AACT;AAES;AAGE,EAAA;AACX;AAGgB;AAIR,EAAA;AACJ,IAAA;AACD,EAAA;AACM,EAAA;AACT;AAGgB;AAKP,EAAA;AACT;AAES;AAID,EAAA;AACS,IAAA;AACV,IAAA;AACL,EAAA;AACa,EAAA;AACC,IAAA;AACd,EAAA;AACO,EAAA;AACT;AAES;AAKK,EAAA;AACJ,IAAA;AACF,IAAA;AACN,EAAA;AAEM,EAAA;AACS,EAAA;AACP,IAAA;AACD,IAAA;AACI,MAAA;AACT,IAAA;AACF,EAAA;AAEO,EAAA;AACT;AAES;AAKM,EAAA;AACF,EAAA;AACJ,EAAA;AACT;AAGgB;AAID,EAAA;AACF,EAAA;AACJ,EAAA;AACT;AAGgB;AAKH,EAAA;AACG,IAAA;AACH,IAAA;AACX,EAAA;AAEY,EAAA;AACE,IAAA;AACH,IAAA;AACX,EAAA;AAEO,EAAA;AACT;AAGgB;AAKA,EAAA;AACH,EAAA;AAEL,EAAA;AACA,EAAA;AACmC,EAAA;AAE9B,EAAA;AACH,IAAA;AACC,IAAA;AACI,IAAA;AACH,MAAA;AACG,MAAA;AACX,IAAA;AACF,EAAA;AAEO,EAAA;AACG,qBAAA;AACC,MAAA;AACE,MAAA;AACD,MAAA;AACR,MAAA;AACQ,MAAA;AACV,IAAA;AACA,IAAA;AACA,IAAA;AACF,EAAA;AACF;AD1EiB;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/Users/ami/Documents/prometheus/x12i/ai-tools/dist/chunk-SYDW33AL.cjs","sourcesContent":[null,"import {\n buildModelInvocation,\n buildOpenRouterModelId,\n resolveModelIdentity,\n} from \"@x12i/ai-profiles\";\nimport type { ModelInvocationEndpoint } from \"@x12i/ai-profiles\";\nimport type { AiModelRecord } from \"../../models/types.js\";\nimport { ModelNameResolver } from \"./ModelNameResolver.js\";\nimport { PROVIDER_INFERENCE_MAP } from \"./constants.js\";\nimport { normalizeProvider, normalizeString } from \"./normalize.js\";\nimport type {\n ModelResolutionInput,\n ModelResolutionResult,\n ModelResolverOptions,\n} from \"./types.js\";\n\nfunction isOpenRouterProvider(provider?: string): boolean {\n return normalizeProvider(provider) === \"openrouter\";\n}\n\nfunction buildVendorResolveAttempts(model: string): ModelResolutionInput[] {\n const attempts: ModelResolutionInput[] = [];\n const seen = new Set<string>();\n const add = (m: string, p?: string) => {\n const key = `${p ?? \"\"}\\0${normalizeString(m)}`;\n if (seen.has(key)) return;\n seen.add(key);\n attempts.push({ model: m, provider: p });\n };\n\n add(model, undefined);\n\n const normalised = normalizeString(model);\n if (normalised.includes(\"/\")) {\n const prefix = normalised.split(\"/\")[0]!;\n if (!isOpenRouterProvider(prefix)) {\n add(model, normalizeProvider(prefix));\n }\n }\n\n add(model, \"openrouter\");\n return attempts;\n}\n\nexport type ModelVendorRef = {\n provider: string;\n model: string;\n};\n\nexport type ResolveModelVendorOptions = ModelResolverOptions & {\n /** Return OpenRouter transport shape: provider `openrouter`, model `vendor/slug`. */\n asOpenRouter?: boolean;\n};\n\nfunction endpointToRef(endpoint: ModelInvocationEndpoint): ModelVendorRef {\n return { provider: endpoint.provider, model: endpoint.modelId };\n}\n\nfunction invocationToRef(\n providerHint: string,\n modelId: string,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef {\n const invocation = buildModelInvocation(providerHint, normalizeString(modelId));\n if (options?.asOpenRouter) {\n return endpointToRef(\n invocation.openrouter ?? {\n provider: \"openrouter\",\n modelId: buildOpenRouterModelId(providerHint, modelId),\n },\n );\n }\n return endpointToRef(invocation.direct);\n}\n\nfunction fromAiProfilesIdentity(\n ref: NonNullable<ReturnType<typeof resolveModelIdentity>>,\n): ModelVendorRef {\n return { provider: ref.provider, model: ref.modelId };\n}\n\n/** Exact registry / bundled-catalog lookup via @x12i/ai-profiles. */\nexport function modelVendorRefFromIdentity(\n model: string,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef | null {\n const identity = resolveModelIdentity(model, {\n asOpenRouter: options?.asOpenRouter,\n });\n return identity ? fromAiProfilesIdentity(identity) : null;\n}\n\n/** Build `{ provider, model }` using @x12i/ai-profiles transport mapping. */\nexport function modelVendorRefFromVendorAndSlug(\n providerHint: string,\n modelId: string,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef {\n return invocationToRef(providerHint, modelId, options);\n}\n\nfunction inferProviderFromSlug(\n slug: string,\n options?: ResolveModelVendorOptions,\n): string | undefined {\n const patterns = [\n ...(options?.additionalProviderPatterns ?? []),\n ...PROVIDER_INFERENCE_MAP,\n ];\n for (const { pattern, provider } of patterns) {\n if (pattern.test(slug)) return provider;\n }\n return undefined;\n}\n\nfunction providerHintForModelId(\n modelId: string,\n record: AiModelRecord | null | undefined,\n options?: ResolveModelVendorOptions,\n): string | undefined {\n if (record?.providerId) {\n const vendor = normalizeProvider(record.providerId);\n if (vendor && !isOpenRouterProvider(vendor)) return vendor;\n }\n\n const normalised = normalizeString(modelId);\n if (normalised.includes(\"/\")) {\n const prefix = normalised.split(\"/\")[0]!;\n if (!isOpenRouterProvider(prefix)) {\n return normalizeProvider(prefix) ?? prefix;\n }\n }\n\n return inferProviderFromSlug(normalised, options);\n}\n\nfunction formatModelVendorRef(\n modelId: string,\n record: AiModelRecord | null | undefined,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef | null {\n const hint = providerHintForModelId(modelId, record, options);\n if (!hint) return null;\n return invocationToRef(hint, modelId, options);\n}\n\n/** Pattern inference when registry and catalog both miss. */\nexport function resolveModelVendorLastResort(\n model: string,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef | null {\n const hint = providerHintForModelId(model, null, options);\n if (!hint) return null;\n return invocationToRef(hint, model, options);\n}\n\n/** Map a fuzzy catalog resolution result to `{ provider, model }`. */\nexport function resolveModelVendorFromResolution(\n result: ModelResolutionResult,\n inputModel: string,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef | null {\n if (result.found) {\n const ref = formatModelVendorRef(result.modelId, result.record, options);\n if (ref) return ref;\n }\n\n if (!result.found && result.bestRejectedCandidate) {\n const ref = formatModelVendorRef(result.bestRejectedCandidate.modelId, null, options);\n if (ref) return ref;\n }\n\n return resolveModelVendorLastResort(inputModel, options);\n}\n\n/** Best-effort vendor lookup from a model name alone (sync, catalog map only). */\nexport function resolveModelVendorSync(\n model: string,\n catalog: Map<string, AiModelRecord>,\n options?: ResolveModelVendorOptions,\n): ModelVendorRef | null {\n const exact = modelVendorRefFromIdentity(model, options);\n if (exact) return exact;\n\n const resolver = new ModelNameResolver(catalog, options);\n const attempts = buildVendorResolveAttempts(model);\n let last: ModelResolutionResult | null = null;\n\n for (const attempt of attempts) {\n const result = resolver.resolve(attempt);\n last = result;\n if (result.found) {\n const ref = resolveModelVendorFromResolution(result, model, options);\n if (ref) return ref;\n }\n }\n\n return resolveModelVendorFromResolution(\n last ?? {\n found: false,\n modelId: null,\n record: null,\n attemptedStrategies: [],\n reason: \"Model not found in catalog\",\n },\n model,\n options,\n );\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cost/costModelResolution.ts","../src/cost/aiProfilesMatch.ts"],"sourcesContent":["import type { AiModelsCatalogClient } from \"../catalog/AiModelsCatalogClient.js\";\nimport { LOCAL_PROVIDERS } from \"../sync/modelNameResolver/constants.js\";\nimport {\n loadOpenRouterRoutingEnv,\n shouldDefaultRouteViaOpenRouter,\n} from \"../sync/openRouterRoutingEnv.js\";\nimport { normalizeProvider, normalizeString } from \"../sync/modelNameResolver/normalize.js\";\nimport type {\n ModelResolutionInput,\n ModelResolutionResult,\n ModelResolverOptions,\n} from \"../sync/modelNameResolver/types.js\";\nimport type { OpenRouterRoutingConfig } from \"../sync/openRouterRoutingEnv.js\";\n\nexport function isOpenRouterProvider(provider?: string): boolean {\n return normalizeProvider(provider) === \"openrouter\";\n}\n\nexport function isLocalProvider(provider?: string): boolean {\n const p = normalizeProvider(provider) ?? normalizeString(provider ?? \"\");\n return LOCAL_PROVIDERS.has(p);\n}\n\n/** Catalog resolver returned success without a priced record (Ollama, LM Studio, …). */\nexport function isLocalProviderResolution(\n resolved: ModelResolutionResult | null,\n inputProvider?: string,\n): boolean {\n if (!resolved?.found || resolved.record) return false;\n if (resolved.resolvedVia.includes(\"local-provider-passthrough\")) return true;\n return isLocalProvider(inputProvider);\n}\n\n/**\n * Vendor id for a model slug (`openai/gpt-4o` → `openai`).\n * Ignores `openrouter` as a provider hint — it is a routing layer, not the model owner.\n */\nexport function underlyingProviderFromModel(\n model: string,\n providerHint?: string,\n): string | undefined {\n const normalized = normalizeString(model);\n if (normalized.includes(\"/\")) {\n const prefix = normalized.split(\"/\")[0]!;\n if (!isOpenRouterProvider(prefix)) return prefix;\n }\n if (providerHint && !isOpenRouterProvider(providerHint)) {\n return normalizeProvider(providerHint);\n }\n return undefined;\n}\n\n/** Provider hint for ai-profiles index lookup (openrouter → underlying vendor). */\nexport function providerHintForProfiles(\n model: string,\n provider?: string,\n): string | undefined {\n if (isOpenRouterProvider(provider)) {\n return underlyingProviderFromModel(model, provider);\n }\n return normalizeProvider(provider);\n}\n\n/**\n * Catalog resolve attempts for direct API and OpenRouter usage.\n * Tries the caller hint, inferred vendor, no hint, and openrouter routing.\n */\nexport function buildCatalogResolveAttempts(\n model: string,\n provider?: string,\n): ModelResolutionInput[] {\n const attempts: ModelResolutionInput[] = [];\n const seen = new Set<string>();\n const add = (m: string, p?: string) => {\n const key = `${p ?? \"\"}\\0${normalizeString(m)}`;\n if (seen.has(key)) return;\n seen.add(key);\n attempts.push({ model: m, provider: p });\n };\n\n add(model, provider);\n\n const underlying = underlyingProviderFromModel(model, provider);\n if (provider) add(model, undefined);\n if (underlying) add(model, underlying);\n if (!isOpenRouterProvider(provider)) {\n add(model, \"openrouter\");\n }\n\n return attempts;\n}\n\nexport async function resolveFromCatalogAttempts(\n catalog: AiModelsCatalogClient,\n attempts: ModelResolutionInput[],\n options?: ModelResolverOptions,\n): Promise<ModelResolutionResult | null> {\n let last: ModelResolutionResult | null = null;\n let localPassthrough: ModelResolutionResult | null = null;\n\n for (const attempt of attempts) {\n const result = await catalog.resolveModel(attempt, options);\n last = result;\n if (result.found && result.record) return result;\n if (\n result.found &&\n !result.record &&\n isLocalProviderResolution(result, attempt.provider)\n ) {\n localPassthrough = result;\n }\n }\n\n return localPassthrough ?? last;\n}\n\nexport function resolveRoutedViaOpenRouter(\n inputProvider: string | undefined,\n resolved: ModelResolutionResult | null,\n modelId?: string,\n routingEnv?: OpenRouterRoutingConfig,\n): boolean {\n const env = routingEnv ?? loadOpenRouterRoutingEnv();\n\n if (isOpenRouterProvider(inputProvider)) return true;\n\n if (resolved?.found) {\n return resolved.routedViaOpenRouter;\n }\n\n const vendor = underlyingProviderFromModel(\n modelId ?? (resolved?.found ? resolved.modelId : \"\") ?? \"\",\n inputProvider,\n );\n if (vendor && shouldDefaultRouteViaOpenRouter(vendor, env)) {\n return true;\n }\n\n return false;\n}\n","import {\n AIProfilesError,\n buildOpenRouterModelId,\n getChoiceOpenRouterModelId,\n getChoicePricing,\n getChoiceVendorModelId,\n loadAIProfilesRegistry,\n resolveAIProfile,\n} from \"@x12i/ai-profiles\";\nimport type {\n AIProfileBackend,\n AIProfileChoice,\n AIModelPricing,\n AIProfilesRegistry,\n InstructionTier,\n RegistrySourceMode,\n ResolvedAIProfile,\n} from \"@x12i/ai-profiles\";\nimport { providerHintForProfiles } from \"./costModelResolution.js\";\nimport { normalizeProvider, normalizeString } from \"../sync/modelNameResolver/normalize.js\";\nimport { stripModelVersionSuffix } from \"../sync/modelNameResolver/stripVersionSuffix.js\";\n\nexport type AiProfilesModelMatch = {\n provider: string;\n modelId: string;\n canonicalModelId: string;\n pricing?: AIModelPricing;\n instructionTier: InstructionTier;\n backend: AIProfileBackend;\n matchedVia: \"profile\" | \"shortcut\" | \"profile-alias\" | \"model-id\";\n profile?: string;\n choice?: string;\n};\n\nfunction profileKey(value: string): string {\n return value.trim().toLowerCase();\n}\n\nfunction canonicalModelId(provider: string, modelId: string): string {\n const normalized = normalizeString(modelId);\n if (normalized.includes(\"/\")) return normalized;\n return buildOpenRouterModelId(provider, normalized);\n}\n\ntype IndexedChoice = {\n provider: string;\n modelId: string;\n canonicalModelId: string;\n pricing?: AIModelPricing;\n profile: string;\n choice: string;\n};\n\nlet cachedIndex: {\n cacheKey: string;\n byKey: Map<string, IndexedChoice[]>;\n} | null = null;\n\nexport type MatchModelInAiProfilesOptions = {\n source?: RegistrySourceMode;\n};\n\n/** When set (tests), overrides default `auto` registry/catalog source. */\nlet registrySourceOverride: RegistrySourceMode | undefined;\n\nfunction registrySource(options?: MatchModelInAiProfilesOptions): RegistrySourceMode {\n return options?.source ?? registrySourceOverride ?? \"auto\";\n}\n\n/** ai-profiles reuses catalog/registry memory cache regardless of requested source unless refresh is set. */\nfunction profileResolveOptions(source: RegistrySourceMode) {\n return source === \"auto\" ? { source } : { source, refresh: true as const };\n}\n\n/** Index bare model ids only — profile/shortcut names resolve via {@link resolveAIProfile}. */\nfunction indexRegistry(registry: AIProfilesRegistry): Map<string, IndexedChoice[]> {\n const byKey = new Map<string, IndexedChoice[]>();\n\n const add = (key: string, entry: IndexedChoice) => {\n const k = profileKey(key);\n if (!k) return;\n const list = byKey.get(k) ?? [];\n if (\n list.some(\n (e) =>\n e.canonicalModelId === entry.canonicalModelId &&\n e.choice === entry.choice &&\n e.profile === entry.profile,\n )\n ) {\n return;\n }\n list.push(entry);\n byKey.set(k, list);\n };\n\n for (const profile of Object.values(registry.profiles)) {\n for (const [choiceKey, choice] of Object.entries(profile.choices)) {\n const entry = choiceEntry(choice, profile.profile, choiceKey);\n add(getChoiceVendorModelId(choice), entry);\n add(canonicalModelId(choice.provider, getChoiceVendorModelId(choice)), entry);\n }\n }\n\n return byKey;\n}\n\nfunction choiceEntry(\n choice: AIProfileChoice,\n profile: string,\n choiceKey: string,\n): IndexedChoice {\n const vendorModelId = getChoiceVendorModelId(choice);\n const provider = normalizeProvider(choice.provider) ?? choice.provider;\n const canonical =\n getChoiceOpenRouterModelId(choice) ??\n canonicalModelId(choice.provider, vendorModelId);\n return {\n provider,\n modelId: normalizeString(vendorModelId),\n canonicalModelId: canonical,\n pricing: getChoicePricing(choice),\n profile,\n choice: choiceKey,\n };\n}\n\nasync function getProfileIndex(\n source: RegistrySourceMode,\n): Promise<Map<string, IndexedChoice[]>> {\n const registry = await loadAIProfilesRegistry(profileResolveOptions(source));\n const cacheKey = `${source}:${registry.version}:${registry.generatedAt ?? \"\"}:${registry.source}`;\n if (cachedIndex?.cacheKey === cacheKey) {\n return cachedIndex.byKey;\n }\n const byKey = indexRegistry(registry);\n cachedIndex = { cacheKey, byKey };\n return byKey;\n}\n\nfunction scoreCandidate(\n entry: IndexedChoice,\n model: string,\n providerHint?: string,\n): number {\n const normalized = normalizeString(model);\n let score = 0;\n\n if (normalized === entry.canonicalModelId) score += 100;\n if (normalized === entry.modelId) score += 80;\n if (providerHint && entry.provider === providerHint) score += 50;\n if (entry.pricing) score += 2;\n\n return score;\n}\n\nfunction pickBest(\n candidates: IndexedChoice[],\n model: string,\n providerHint?: string,\n): IndexedChoice | null {\n if (candidates.length === 0) return null;\n if (candidates.length === 1) return candidates[0]!;\n\n let best = candidates[0]!;\n let bestScore = scoreCandidate(best, model, providerHint);\n for (let i = 1; i < candidates.length; i++) {\n const c = candidates[i]!;\n const s = scoreCandidate(c, model, providerHint);\n if (s > bestScore) {\n best = c;\n bestScore = s;\n }\n }\n return best;\n}\n\nfunction resolvedToMatch(resolved: ResolvedAIProfile): AiProfilesModelMatch {\n const direct = resolved.invocation.direct;\n const canonical =\n resolved.invocation.openrouter?.modelId ??\n buildOpenRouterModelId(direct.provider, direct.modelId);\n return {\n provider: normalizeProvider(direct.provider) ?? direct.provider,\n modelId: normalizeString(direct.modelId),\n canonicalModelId: canonical,\n pricing: resolved.pricing,\n instructionTier: resolved.instructionTier,\n backend: resolved.backend,\n matchedVia: resolved.shortcut ? \"shortcut\" : \"profile\",\n profile: resolved.profile,\n choice: resolved.choice,\n };\n}\n\nasync function fromIndexed(\n entry: IndexedChoice,\n source: RegistrySourceMode,\n): Promise<AiProfilesModelMatch> {\n const resolved = await resolveAIProfile(entry.profile, {\n choice: entry.choice,\n ...profileResolveOptions(source),\n });\n const direct = resolved.invocation.direct;\n return {\n provider: normalizeProvider(direct.provider) ?? direct.provider,\n modelId: normalizeString(direct.modelId),\n canonicalModelId:\n resolved.invocation.openrouter?.modelId ??\n buildOpenRouterModelId(direct.provider, direct.modelId),\n pricing: resolved.pricing ?? entry.pricing,\n instructionTier: resolved.instructionTier,\n backend: resolved.backend,\n matchedVia: \"model-id\",\n profile: resolved.profile,\n choice: resolved.choice,\n };\n}\n\nasync function lookupInIndex(\n index: Map<string, IndexedChoice[]>,\n model: string,\n source: RegistrySourceMode,\n provider?: string,\n): Promise<AiProfilesModelMatch | null> {\n const providerHint = provider ? normalizeProvider(provider) : undefined;\n const keys = [\n profileKey(model),\n profileKey(normalizeString(model)),\n ];\n if (providerHint) {\n keys.push(profileKey(canonicalModelId(providerHint, model)));\n }\n\n const pooled: IndexedChoice[] = [];\n for (const key of keys) {\n const hits = index.get(key);\n if (hits) pooled.push(...hits);\n }\n\n const bare = normalizeString(model);\n if (!bare.includes(\"/\")) {\n for (const list of index.values()) {\n for (const entry of list) {\n if (entry.modelId === bare) pooled.push(entry);\n }\n }\n }\n\n const unique = new Map<string, IndexedChoice>();\n for (const e of pooled) {\n unique.set(`${e.profile}:${e.choice}:${e.canonicalModelId}`, e);\n }\n\n const best = pickBest([...unique.values()], model, providerHint);\n return best ? fromIndexed(best, source) : null;\n}\n\n/**\n * Resolve a model string via @x12i/ai-profiles — profile/shortcut names, aliases,\n * or a concrete model id that appears on a profile choice.\n */\nexport async function matchModelInAiProfiles(\n model: string,\n provider?: string,\n options?: MatchModelInAiProfilesOptions,\n): Promise<AiProfilesModelMatch | null> {\n const source = registrySource(options);\n const resolveOpts = profileResolveOptions(source);\n\n try {\n const resolved = await resolveAIProfile(model, resolveOpts);\n return resolvedToMatch(resolved);\n } catch (err) {\n if (!(err instanceof AIProfilesError) || err.code !== \"UNKNOWN_PROFILE\") {\n throw err;\n }\n }\n\n const index = await getProfileIndex(source);\n const hint = providerHintForProfiles(model, provider);\n const direct = await lookupInIndex(index, model, source, hint);\n if (direct) return direct;\n\n const stripped = stripModelVersionSuffix(model);\n if (stripped && stripped !== normalizeString(model)) {\n return lookupInIndex(\n index,\n stripped,\n source,\n providerHintForProfiles(stripped, provider),\n );\n }\n\n return null;\n}\n\n/** @internal Test-only — reset module cache between tests. */\nexport function resetAiProfilesMatchCacheForTests(\n options?: { source?: RegistrySourceMode },\n): void {\n cachedIndex = null;\n registrySourceOverride = options?.source ?? \"bundled\";\n}\n"],"mappings":";;;;;;;;;;AAcO,SAAS,qBAAqB,UAA4B;AAC/D,SAAO,kBAAkB,QAAQ,MAAM;AACzC;AAEO,SAAS,gBAAgB,UAA4B;AAC1D,QAAM,IAAI,kBAAkB,QAAQ,KAAK,gBAAgB,YAAY,EAAE;AACvE,SAAO,gBAAgB,IAAI,CAAC;AAC9B;AAGO,SAAS,0BACd,UACA,eACS;AACT,MAAI,CAAC,UAAU,SAAS,SAAS,OAAQ,QAAO;AAChD,MAAI,SAAS,YAAY,SAAS,4BAA4B,EAAG,QAAO;AACxE,SAAO,gBAAgB,aAAa;AACtC;AAMO,SAAS,4BACd,OACA,cACoB;AACpB,QAAM,aAAa,gBAAgB,KAAK;AACxC,MAAI,WAAW,SAAS,GAAG,GAAG;AAC5B,UAAM,SAAS,WAAW,MAAM,GAAG,EAAE,CAAC;AACtC,QAAI,CAAC,qBAAqB,MAAM,EAAG,QAAO;AAAA,EAC5C;AACA,MAAI,gBAAgB,CAAC,qBAAqB,YAAY,GAAG;AACvD,WAAO,kBAAkB,YAAY;AAAA,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;AACpD,QAAM,SAAS,MAAM,cAAc,OAAO,OAAO,QAAQ,IAAI;AAC7D,MAAI,OAAQ,QAAO;AAEnB,QAAM,WAAW,wBAAwB,KAAK;AAC9C,MAAI,YAAY,aAAa,gBAAgB,KAAK,GAAG;AACnD,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,wBAAwB,UAAU,QAAQ;AAAA,IAC5C;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|