@exellix/ai-skills 7.0.15 → 7.0.17
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/invocation/aiProfileModelFormat.d.ts +0 -2
- package/dist/invocation/aiProfileModelFormat.d.ts.map +1 -1
- package/dist/invocation/aiProfileModelFormat.js +1 -5
- package/dist/invocation/aiProfileModelFormat.js.map +1 -1
- package/dist/invocation/resolveSkillProfileToWireModel.d.ts.map +1 -1
- package/dist/invocation/resolveSkillProfileToWireModel.js +18 -10
- package/dist/invocation/resolveSkillProfileToWireModel.js.map +1 -1
- package/dist/optimixer/build-optimixer-model-profile.d.ts +13 -3
- package/dist/optimixer/build-optimixer-model-profile.d.ts.map +1 -1
- package/dist/optimixer/build-optimixer-model-profile.js +46 -46
- package/dist/optimixer/build-optimixer-model-profile.js.map +1 -1
- package/dist/utils/exellix-skills-logxer-defaults.d.ts +1 -1
- package/package.json +9 -8
|
@@ -3,8 +3,6 @@ export declare function isStrictProfileChoiceKey(value: string): boolean;
|
|
|
3
3
|
/** True when the value should be resolved via ai-profiles (not a concrete wire id). */
|
|
4
4
|
export declare function isResolvableModelAlias(value: string): boolean;
|
|
5
5
|
export declare function normalizeProfileSlotInput(value: string): string;
|
|
6
|
-
/** Bare vendor SKU passthrough is handled by {@link isConcreteModelId} (catalog-backed). */
|
|
7
|
-
export declare function isBareVendorModelSku(_value: string): boolean;
|
|
8
6
|
export declare function requireStrictProfileChoiceKey(value: string, slotPath: string): string;
|
|
9
7
|
export declare function requireSkillModelReference(value: string, slotPath: string): string;
|
|
10
8
|
/** @deprecated Bare-profile expansion removed. Use {@link requireStrictProfileChoiceKey}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiProfileModelFormat.d.ts","sourceRoot":"","sources":["../../src/invocation/aiProfileModelFormat.ts"],"names":[],"mappings":"AAOA,yFAAyF;AACzF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI/D;AAED,uFAAuF;AACvF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI7D;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,
|
|
1
|
+
{"version":3,"file":"aiProfileModelFormat.d.ts","sourceRoot":"","sources":["../../src/invocation/aiProfileModelFormat.ts"],"names":[],"mappings":"AAOA,yFAAyF;AACzF,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI/D;AAED,uFAAuF;AACvF,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI7D;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMrF;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElF;AAED,6FAA6F;AAC7F,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAMlG;AAED,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAYtF"}
|
|
@@ -12,15 +12,11 @@ export function isResolvableModelAlias(value) {
|
|
|
12
12
|
const trimmed = value.trim();
|
|
13
13
|
if (!trimmed || isConcreteModelId(trimmed))
|
|
14
14
|
return false;
|
|
15
|
-
return
|
|
15
|
+
return true;
|
|
16
16
|
}
|
|
17
17
|
export function normalizeProfileSlotInput(value) {
|
|
18
18
|
return value.trim();
|
|
19
19
|
}
|
|
20
|
-
/** Bare vendor SKU passthrough is handled by {@link isConcreteModelId} (catalog-backed). */
|
|
21
|
-
export function isBareVendorModelSku(_value) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
20
|
export function requireStrictProfileChoiceKey(value, slotPath) {
|
|
25
21
|
const trimmed = value.trim();
|
|
26
22
|
if (!trimmed) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiProfileModelFormat.js","sourceRoot":"","sources":["../../src/invocation/aiProfileModelFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,yFAAyF;AACzF,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,OAAO,wBAAwB,CAAC,OAAO,CAAC,IAAI,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5E,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,sBAAsB,CAAC,KAAa;IAClD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO,IAAI,iBAAiB,CAAC,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IACzD,OAAO,
|
|
1
|
+
{"version":3,"file":"aiProfileModelFormat.js","sourceRoot":"","sources":["../../src/invocation/aiProfileModelFormat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,yFAAyF;AACzF,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,OAAO,wBAAwB,CAAC,OAAO,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AAO,OAAO,CAAC;IAC7B,IAAI,YAAY,CAAC,WAAW,EAAE,KAAK,YAAY,EAAE,CAAC;QAChD,IAAI,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC;YAAE,OAAO,OAAO,CAAC;QACtD,OAAO,cAAc,OAAO,EAAE,CAAC;IACjC,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,OAAO,CAAC;IAC1C,MAAM,cAAc,GAAG,GAAG,YAAY,GAAG,CAAC;IAC1C,IAAI,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC;QAAE,OAAO,OAAO,CAAC;IACvD,OAAO,GAAG,YAAY,IAAI,OAAO,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveSkillProfileToWireModel.d.ts","sourceRoot":"","sources":["../../src/invocation/resolveSkillProfileToWireModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveSkillProfileToWireModel.d.ts","sourceRoot":"","sources":["../../src/invocation/resolveSkillProfileToWireModel.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAqB,MAAM,mBAAmB,CAAC;AAUnG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAI/E,MAAM,MAAM,qCAAqC,GAAG,2BAA2B,GAAG;IAChF,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,WAAW,CAAC,EAAE,kBAAkB,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,QAAQ,EAAE,MAAM,CAAC;IACjB,sFAAsF;IACtF,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAyDF;;GAEG;AACH,wBAAsB,4BAA4B,CAChD,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,OAAO,CAAC,EAAE,qCAAqC,GAC9C,OAAO,CAAC,6BAA6B,GAAG,SAAS,CAAC,CAwDpD;AAED;;;GAGG;AACH,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,OAAO,CAAC,EAAE,qCAAqC,GAC9C,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAG7B"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { AIProfilesError, resolveAIProfile } from "@x12i/ai-profiles";
|
|
2
|
-
import { formatResolvedProfileModelId,
|
|
1
|
+
import { AIProfilesError, isReasoningModel, requireBundledCatalogModel, resolveAIProfile, } from "@x12i/ai-profiles";
|
|
2
|
+
import { formatResolvedProfileModelId, requireSkillModelReference, } from "./aiProfileModelFormat.js";
|
|
3
3
|
import { isConcreteModelId } from "./concreteModelId.js";
|
|
4
4
|
import { defaultAiSkillsResolveAiProfileOptions, getAiSkillsAiProfilesSource, } from "./defaultAiProfilesResolveOptions.js";
|
|
5
5
|
import { resolvePreferOpenRouterPolicy } from "./preferOpenRouterPolicy.js";
|
|
6
6
|
import { throwSkillModelResolutionError } from "../errors/skillModelResolutionError.js";
|
|
7
|
-
import { splitGatewayWireModelForOptimixer } from "../optimixer/build-optimixer-model-profile.js";
|
|
8
7
|
function openrouterModelIdFromInvocation(resolved) {
|
|
9
8
|
const or = resolved.invocation?.openrouter?.modelId?.trim();
|
|
10
9
|
if (or)
|
|
@@ -32,19 +31,28 @@ function skillWireModelIdFromResolved(resolved) {
|
|
|
32
31
|
return formatResolvedProfileModelId(resolved.provider, resolved.modelId);
|
|
33
32
|
}
|
|
34
33
|
function resolvedSkillProfileForInvokeFromProfile(resolved) {
|
|
35
|
-
const wireModel = skillWireModelIdFromResolved(resolved);
|
|
36
|
-
const split = splitGatewayWireModelForOptimixer(wireModel);
|
|
37
34
|
return {
|
|
38
|
-
wireModel,
|
|
39
|
-
provider:
|
|
35
|
+
wireModel: skillWireModelIdFromResolved(resolved),
|
|
36
|
+
provider: resolved.provider,
|
|
40
37
|
supportsReasoning: resolved.modelSignals.isReasoningModel ? true : undefined,
|
|
41
38
|
};
|
|
42
39
|
}
|
|
43
40
|
function passthroughSkillProfileForInvoke(wire) {
|
|
44
|
-
const
|
|
41
|
+
const catalog = requireBundledCatalogModel(wire);
|
|
42
|
+
if (catalog.found !== true || !catalog.provider || !catalog.modelId) {
|
|
43
|
+
throwSkillModelResolutionError(wire, `Concrete model id "${wire}" is not in the ai-profiles catalog; cannot derive provider for Optimixer without guessing.`, "modelConfig.model");
|
|
44
|
+
}
|
|
45
|
+
let supportsReasoning;
|
|
46
|
+
try {
|
|
47
|
+
supportsReasoning = isReasoningModel(wire) === true ? true : undefined;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
supportsReasoning = undefined;
|
|
51
|
+
}
|
|
45
52
|
return {
|
|
46
53
|
wireModel: wire,
|
|
47
|
-
provider:
|
|
54
|
+
provider: catalog.provider,
|
|
55
|
+
supportsReasoning,
|
|
48
56
|
};
|
|
49
57
|
}
|
|
50
58
|
/**
|
|
@@ -57,7 +65,7 @@ export async function resolveSkillProfileForInvoke(value, options) {
|
|
|
57
65
|
if (!trimmed)
|
|
58
66
|
return undefined;
|
|
59
67
|
const slotPath = "modelConfig.model";
|
|
60
|
-
if (isConcreteModelId(trimmed)
|
|
68
|
+
if (isConcreteModelId(trimmed)) {
|
|
61
69
|
return passthroughSkillProfileForInvoke(trimmed);
|
|
62
70
|
}
|
|
63
71
|
const resolveInput = requireSkillModelReference(trimmed, slotPath);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveSkillProfileToWireModel.js","sourceRoot":"","sources":["../../src/invocation/resolveSkillProfileToWireModel.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"resolveSkillProfileToWireModel.js","sourceRoot":"","sources":["../../src/invocation/resolveSkillProfileToWireModel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL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;QACJ,CAAC;QACD,8BAA8B,CAC5B,OAAO,EACP,kCAAkC,OAAO,4BAA4B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EACvH,QAAQ,EACR,EAAE,KAAK,EAAE,GAAG,EAAE,CACf,CAAC;IACJ,CAAC;IAED,OAAO,wCAAwC,CAAC,QAAQ,CAAC,CAAC;AAC5D,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,KAAyB,EACzB,OAA+C;IAE/C,MAAM,QAAQ,GAAG,MAAM,4BAA4B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACpE,OAAO,QAAQ,EAAE,SAAS,CAAC;AAC7B,CAAC"}
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
import type { OptimixerModelProfile } from "@x12i/optimixer";
|
|
2
2
|
import type { ModelConfig } from "../types.js";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Prefer {@link buildOptimixerModelProfileFromModelConfig} which passes `wireModel`
|
|
5
|
+
* to Optimixer 3.6+ (ai-profiles resolves identity inside Optimixer). Kept for callers that still
|
|
6
|
+
* need an explicit `{ provider, model }` pair.
|
|
7
|
+
*/
|
|
4
8
|
export declare function splitGatewayWireModelForOptimixer(wire: string, explicitProvider?: string): {
|
|
5
9
|
provider: string;
|
|
6
10
|
model: string;
|
|
7
11
|
};
|
|
8
12
|
export type BuildOptimixerModelProfileArgs = {
|
|
9
13
|
modelConfig: ModelConfig | undefined;
|
|
10
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* From ai-profiles resolution (`modelSignals.isReasoningModel`).
|
|
16
|
+
* When omitted, Optimixer 3.6+ resolves reasoning via ai-profiles from `wireModel`.
|
|
17
|
+
* When provided, forwarded as `reasoning.enabled`.
|
|
18
|
+
*/
|
|
11
19
|
supportsReasoning?: boolean;
|
|
12
20
|
};
|
|
13
21
|
/**
|
|
14
22
|
* Build Optimixer `modelProfile` from resolved {@link ModelConfig}.
|
|
15
|
-
*
|
|
23
|
+
*
|
|
24
|
+
* Optimixer **≥ 3.6.0** owns provider/model identity via `wireModel` + `@x12i/ai-profiles`.
|
|
25
|
+
* This package does not invent vendors from SKU keywords.
|
|
16
26
|
*/
|
|
17
27
|
export declare function buildOptimixerModelProfileFromModelConfig(args: BuildOptimixerModelProfileArgs): OptimixerModelProfile | undefined;
|
|
18
28
|
//# sourceMappingURL=build-optimixer-model-profile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-optimixer-model-profile.d.ts","sourceRoot":"","sources":["../../src/optimixer/build-optimixer-model-profile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-optimixer-model-profile.d.ts","sourceRoot":"","sources":["../../src/optimixer/build-optimixer-model-profile.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAG7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;GAIG;AACH,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,MAAM,EACZ,gBAAgB,CAAC,EAAE,MAAM,GACxB;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAsCrC;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC;IACrC;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,yCAAyC,CACvD,IAAI,EAAE,8BAA8B,GACnC,qBAAqB,GAAG,SAAS,CAqCnC"}
|
|
@@ -1,58 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isReasoningModel, normalizeGatewayWireId, requireBundledCatalogModel, } from "@x12i/ai-profiles";
|
|
2
2
|
import { isResolvableModelAlias } from "../invocation/aiProfileModelFormat.js";
|
|
3
3
|
import { throwSkillModelResolutionError } from "../errors/skillModelResolutionError.js";
|
|
4
4
|
import { resolveWireModelFromModelConfig } from "../utils/validate-model-config-for-invoke.js";
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Prefer {@link buildOptimixerModelProfileFromModelConfig} which passes `wireModel`
|
|
7
|
+
* to Optimixer 3.6+ (ai-profiles resolves identity inside Optimixer). Kept for callers that still
|
|
8
|
+
* need an explicit `{ provider, model }` pair.
|
|
9
|
+
*/
|
|
6
10
|
export function splitGatewayWireModelForOptimixer(wire, explicitProvider) {
|
|
7
11
|
const trimmed = wire.trim();
|
|
8
12
|
if (!trimmed) {
|
|
9
13
|
throw new Error("Optimixer modelProfile requires a non-empty gateway wire model id.");
|
|
10
14
|
}
|
|
11
15
|
const providerOverride = explicitProvider?.trim();
|
|
12
|
-
|
|
16
|
+
const catalog = requireBundledCatalogModel(trimmed);
|
|
17
|
+
if (catalog.found === true && catalog.provider && catalog.modelId) {
|
|
13
18
|
return {
|
|
14
|
-
provider: providerOverride
|
|
15
|
-
model:
|
|
19
|
+
provider: providerOverride || catalog.provider,
|
|
20
|
+
model: catalog.modelId,
|
|
16
21
|
};
|
|
17
22
|
}
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
const normalized = normalizeGatewayWireId(trimmed);
|
|
24
|
+
if (normalized &&
|
|
25
|
+
typeof normalized === "object" &&
|
|
26
|
+
typeof normalized.provider === "string" &&
|
|
27
|
+
normalized.provider.trim() &&
|
|
28
|
+
typeof normalized.modelId === "string" &&
|
|
29
|
+
normalized.modelId.trim()) {
|
|
22
30
|
return {
|
|
23
|
-
provider: providerOverride
|
|
24
|
-
model:
|
|
31
|
+
provider: providerOverride || normalized.provider,
|
|
32
|
+
model: normalized.modelId,
|
|
25
33
|
};
|
|
26
34
|
}
|
|
27
|
-
|
|
28
|
-
trimmed
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
? "openai"
|
|
32
|
-
: trimmed.toLowerCase().startsWith("claude")
|
|
33
|
-
? "anthropic"
|
|
34
|
-
: trimmed.toLowerCase().startsWith("gemini")
|
|
35
|
-
? "google"
|
|
36
|
-
: undefined;
|
|
37
|
-
return {
|
|
38
|
-
provider: providerOverride ?? bareProvider ?? "openrouter",
|
|
39
|
-
model: trimmed,
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
function reasoningEnabledFromCatalog(provider, model) {
|
|
43
|
-
const catalog = loadBundledModelsCatalog();
|
|
44
|
-
const entry = findCatalogModelEntry(catalog, {
|
|
45
|
-
provider: provider,
|
|
46
|
-
modelId: model,
|
|
47
|
-
openRouterModelId: provider.toLowerCase() === "openrouter" ? model : undefined,
|
|
48
|
-
});
|
|
49
|
-
if (!entry)
|
|
50
|
-
return undefined;
|
|
51
|
-
return capabilitiesFromCatalogEntry(entry).supportsReasoning === true ? true : undefined;
|
|
35
|
+
if (providerOverride) {
|
|
36
|
+
return { provider: providerOverride, model: trimmed };
|
|
37
|
+
}
|
|
38
|
+
throw new Error(`Cannot derive Optimixer provider/model from "${trimmed}" without a catalog match or modelConfig.provider. Prefer Optimixer modelProfile.wireModel (3.6+) so @x12i/ai-profiles owns identity.`);
|
|
52
39
|
}
|
|
53
40
|
/**
|
|
54
41
|
* Build Optimixer `modelProfile` from resolved {@link ModelConfig}.
|
|
55
|
-
*
|
|
42
|
+
*
|
|
43
|
+
* Optimixer **≥ 3.6.0** owns provider/model identity via `wireModel` + `@x12i/ai-profiles`.
|
|
44
|
+
* This package does not invent vendors from SKU keywords.
|
|
56
45
|
*/
|
|
57
46
|
export function buildOptimixerModelProfileFromModelConfig(args) {
|
|
58
47
|
const wire = resolveWireModelFromModelConfig(args.modelConfig);
|
|
@@ -61,19 +50,30 @@ export function buildOptimixerModelProfileFromModelConfig(args) {
|
|
|
61
50
|
if (isResolvableModelAlias(wire)) {
|
|
62
51
|
throwSkillModelResolutionError(wire, `Cannot predict max tokens for unresolved model alias "${wire}". Resolve profile/choice to a concrete provider model id before Optimixer predict.`, "modelConfig.model");
|
|
63
52
|
}
|
|
64
|
-
const split = splitGatewayWireModelForOptimixer(wire, args.modelConfig?.provider);
|
|
65
|
-
const reasoningEnabled = args.supportsReasoning === true
|
|
66
|
-
? true
|
|
67
|
-
: args.supportsReasoning === false
|
|
68
|
-
? false
|
|
69
|
-
: reasoningEnabledFromCatalog(split.provider, split.model);
|
|
70
53
|
const profile = {
|
|
71
|
-
|
|
72
|
-
model: split.model,
|
|
54
|
+
wireModel: wire,
|
|
73
55
|
};
|
|
74
|
-
|
|
56
|
+
const explicitProvider = args.modelConfig?.provider?.trim();
|
|
57
|
+
if (explicitProvider) {
|
|
58
|
+
profile.provider = explicitProvider;
|
|
59
|
+
}
|
|
60
|
+
if (args.supportsReasoning === true) {
|
|
75
61
|
profile.reasoning = { enabled: true };
|
|
76
62
|
}
|
|
63
|
+
else if (args.supportsReasoning === false) {
|
|
64
|
+
profile.reasoning = { enabled: false };
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
// Optional hint only — Optimixer also resolves via ai-profiles from wireModel.
|
|
68
|
+
try {
|
|
69
|
+
if (isReasoningModel(wire) === true) {
|
|
70
|
+
profile.reasoning = { enabled: true };
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
/* leave unset */
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
77
|
return profile;
|
|
78
78
|
}
|
|
79
79
|
//# sourceMappingURL=build-optimixer-model-profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-optimixer-model-profile.js","sourceRoot":"","sources":["../../src/optimixer/build-optimixer-model-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"build-optimixer-model-profile.js","sourceRoot":"","sources":["../../src/optimixer/build-optimixer-model-profile.ts"],"names":[],"mapp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P,iBAAiB;QACnB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -4,7 +4,7 @@ export declare const AI_SKILLS_LOGXER_ENV_PREFIX: "AI_SKILLS";
|
|
|
4
4
|
/** Known `envPrefix` values for this package and its primary gateway stack (for hosts / `.env`). */
|
|
5
5
|
export declare const AI_SKILLS_STACK_LOG_PREFIXES: {
|
|
6
6
|
readonly gateway: "AI_GATEWAY";
|
|
7
|
-
readonly router: "
|
|
7
|
+
readonly router: "AI_ROUTER_RUNTIME";
|
|
8
8
|
readonly flexMd: "FLEX_MD";
|
|
9
9
|
readonly skills: "AI_SKILLS";
|
|
10
10
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exellix/ai-skills",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.17",
|
|
4
4
|
"description": "Foundational skill execution layer for exellix ecosystem using @x12i/ai-gateway with FlexMD 2.0 support and Catalox as the catalog store",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"doc": "docs"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
|
+
"prepublishOnly": "npm run build",
|
|
34
35
|
"build": "tsc",
|
|
35
36
|
"demo": "tsx demo.ts",
|
|
36
37
|
"test:real": "tsx test-real.ts",
|
|
@@ -60,17 +61,17 @@
|
|
|
60
61
|
},
|
|
61
62
|
"dependencies": {
|
|
62
63
|
"@exellix/catalox-ai-skills": "^1.0.5",
|
|
63
|
-
"@x12i/activix": "^9.0.
|
|
64
|
-
"@x12i/ai-gateway": "^11.
|
|
65
|
-
"@x12i/ai-profiles": "^4.
|
|
64
|
+
"@x12i/activix": "^9.0.5",
|
|
65
|
+
"@x12i/ai-gateway": "^11.1.1",
|
|
66
|
+
"@x12i/ai-profiles": "^4.3.0",
|
|
66
67
|
"@x12i/catalox": "^5.10.1",
|
|
67
68
|
"@x12i/env": "^4.0.3",
|
|
68
69
|
"@x12i/execution-memory-manager": "^1.2.0",
|
|
69
|
-
"@x12i/graphenix-core": "^2.
|
|
70
|
-
"@x12i/graphenix-executable-contracts": "^2.
|
|
71
|
-
"@x12i/graphenix-plan-format": "^2.
|
|
70
|
+
"@x12i/graphenix-core": "^2.17.0",
|
|
71
|
+
"@x12i/graphenix-executable-contracts": "^2.17.0",
|
|
72
|
+
"@x12i/graphenix-plan-format": "^2.17.0",
|
|
72
73
|
"@x12i/logxer": "^5.1.0",
|
|
73
|
-
"@x12i/optimixer": "^3.
|
|
74
|
+
"@x12i/optimixer": "^3.6.0",
|
|
74
75
|
"@x12i/rendrix": "^4.3.0",
|
|
75
76
|
"nx-helpers": "^1.5.1"
|
|
76
77
|
},
|