@exellix/graph-engine 7.4.0 → 7.4.2
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/src/errors/exellixGraphErrorCodes.d.ts +1 -1
- package/dist/src/errors/exellixGraphErrorCodes.js +1 -1
- package/dist/src/runtime/ExellixGraphRuntime.d.ts +1 -1
- package/dist/src/runtime/graphAiModelConfig.d.ts +11 -8
- package/dist/src/runtime/graphAiModelConfig.js +19 -34
- package/dist/src/runtime/resolveModelConfigForNode.d.ts +2 -3
- package/dist/src/runtime/resolveModelConfigForNode.js +2 -3
- package/dist/src/runtime/taskNodeRunTaskPreflight.d.ts +1 -1
- package/dist/src/types/refs.d.ts +3 -3
- package/dist/testkit/testModelAliasRuntime.d.ts +2 -2
- package/dist/testkit/testModelAliasRuntime.js +2 -2
- package/package.json +2 -3
|
@@ -36,6 +36,6 @@ export declare enum ExellixGraphErrorCode {
|
|
|
36
36
|
NON_CANONICAL_MODEL_CONFIG = "NON_CANONICAL_MODEL_CONFIG",
|
|
37
37
|
/** `modelConfig` is missing or not exactly `{ preActionModel, skillModel, postActionModel }`. */
|
|
38
38
|
MODEL_CONFIG_INCOMPLETE = "MODEL_CONFIG_INCOMPLETE",
|
|
39
|
-
/**
|
|
39
|
+
/** @deprecated Graph-engine no longer resolves profile aliases; kept for error-code compatibility. */
|
|
40
40
|
MODEL_PROFILE_UNRESOLVED = "MODEL_PROFILE_UNRESOLVED"
|
|
41
41
|
}
|
|
@@ -37,6 +37,6 @@ export var ExellixGraphErrorCode;
|
|
|
37
37
|
ExellixGraphErrorCode["NON_CANONICAL_MODEL_CONFIG"] = "NON_CANONICAL_MODEL_CONFIG";
|
|
38
38
|
/** `modelConfig` is missing or not exactly `{ preActionModel, skillModel, postActionModel }`. */
|
|
39
39
|
ExellixGraphErrorCode["MODEL_CONFIG_INCOMPLETE"] = "MODEL_CONFIG_INCOMPLETE";
|
|
40
|
-
/**
|
|
40
|
+
/** @deprecated Graph-engine no longer resolves profile aliases; kept for error-code compatibility. */
|
|
41
41
|
ExellixGraphErrorCode["MODEL_PROFILE_UNRESOLVED"] = "MODEL_PROFILE_UNRESOLVED";
|
|
42
42
|
})(ExellixGraphErrorCode || (ExellixGraphErrorCode = {}));
|
|
@@ -92,7 +92,7 @@ export interface GraphRuntimeObject extends HostExecuteGraphRunOptions {
|
|
|
92
92
|
/** Runtime default model selection (`cases`); overrides GraphModelObject.modelConfig. */
|
|
93
93
|
modelConfig?: ModelConfigSelection;
|
|
94
94
|
/**
|
|
95
|
-
* @deprecated Unused since 7.1 —
|
|
95
|
+
* @deprecated Unused since 7.1 — profile aliases pass through to downstream resolution.
|
|
96
96
|
*/
|
|
97
97
|
aliasConfig?: GraphModelAliasConfig;
|
|
98
98
|
/** Task-node runtime overrides keyed by node id. */
|
|
@@ -4,11 +4,13 @@ export type RunTaskModelConfigWire = {
|
|
|
4
4
|
xynthesisModel: string;
|
|
5
5
|
skillModel: string;
|
|
6
6
|
};
|
|
7
|
-
/** Profile names used when no modelConfig tier resolves. */
|
|
7
|
+
/** Profile alias names used when no modelConfig tier resolves. */
|
|
8
8
|
export declare const DEFAULT_GRAPH_AI_MODEL_PROFILE_CONFIG: GraphAiModelConfig;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Illustrative concrete ids for {@link DEFAULT_GRAPH_AI_MODEL_PROFILE_CONFIG}.
|
|
11
|
+
* Graph-engine does not resolve aliases; downstream (ai-tasks / xynthesis) owns registry lookup.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated Informational only — do not use for execution-time resolution in graph-engine.
|
|
12
14
|
*/
|
|
13
15
|
export declare const DEFAULT_GRAPH_AI_MODEL_IDS: GraphAiModelConfig;
|
|
14
16
|
export type GraphAiModelConfigResolveContext = {
|
|
@@ -17,21 +19,22 @@ export type GraphAiModelConfigResolveContext = {
|
|
|
17
19
|
nodeId?: string;
|
|
18
20
|
};
|
|
19
21
|
/**
|
|
20
|
-
* True when a value looks like a concrete provider model id (host-resolved
|
|
22
|
+
* True when a value looks like a concrete provider model id (host-resolved override).
|
|
21
23
|
*/
|
|
22
24
|
export declare function looksLikeConcreteModelId(value: string): boolean;
|
|
23
25
|
/**
|
|
24
|
-
* True when a string is a valid graph-authored
|
|
26
|
+
* True when a string is a valid graph-authored profile alias (not a provider model id).
|
|
25
27
|
*/
|
|
26
28
|
export declare function isGraphAiProfileName(value: unknown): value is string;
|
|
27
29
|
export declare function assertGraphAiProfileNameString(value: unknown, path: string, context?: GraphAiModelConfigResolveContext): asserts value is string;
|
|
28
30
|
/**
|
|
29
|
-
*
|
|
30
|
-
* Profile
|
|
31
|
+
* Validates and normalizes graph/runtime {@link GraphAiModelConfig}.
|
|
32
|
+
* Profile aliases and host-resolved concrete ids pass through unchanged for downstream resolution.
|
|
31
33
|
*/
|
|
32
34
|
export declare function resolveGraphAiModelConfig(modelConfig: GraphAiModelConfig | undefined, context?: GraphAiModelConfigResolveContext): Promise<GraphAiModelConfig>;
|
|
33
35
|
export type EngineModelPhase = 'pre' | 'main' | 'post';
|
|
34
36
|
/**
|
|
35
|
-
* Maps
|
|
37
|
+
* Maps three-phase graph config to ai-tasks slot pair for a single runTask phase.
|
|
38
|
+
* Values are forwarded as-is (profile aliases or concrete ids).
|
|
36
39
|
*/
|
|
37
40
|
export declare function toRunTaskModelConfigForPhase(config: GraphAiModelConfig, phase: EngineModelPhase): RunTaskModelConfigWire;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { resolveAIProfile } from '@x12i/ai-profiles';
|
|
2
1
|
import { ExellixGraphError } from '../errors/ExellixGraphError.js';
|
|
3
2
|
import { ExellixGraphErrorCode } from '../errors/exellixGraphErrorCodes.js';
|
|
4
3
|
import { isGraphAiModelConfig } from './modelConfigSelection.js';
|
|
5
|
-
/** Profile names used when no modelConfig tier resolves. */
|
|
4
|
+
/** Profile alias names used when no modelConfig tier resolves. */
|
|
6
5
|
export const DEFAULT_GRAPH_AI_MODEL_PROFILE_CONFIG = {
|
|
7
6
|
preActionModel: 'cheap',
|
|
8
7
|
skillModel: 'balanced',
|
|
9
8
|
postActionModel: 'cheap',
|
|
10
9
|
};
|
|
11
10
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* Illustrative concrete ids for {@link DEFAULT_GRAPH_AI_MODEL_PROFILE_CONFIG}.
|
|
12
|
+
* Graph-engine does not resolve aliases; downstream (ai-tasks / xynthesis) owns registry lookup.
|
|
13
|
+
*
|
|
14
|
+
* @deprecated Informational only — do not use for execution-time resolution in graph-engine.
|
|
14
15
|
*/
|
|
15
16
|
export const DEFAULT_GRAPH_AI_MODEL_IDS = {
|
|
16
17
|
preActionModel: 'google/gemini-2.5-flash-lite',
|
|
@@ -30,7 +31,7 @@ const CONCRETE_MODEL_PREFIXES = [
|
|
|
30
31
|
'groq/',
|
|
31
32
|
];
|
|
32
33
|
/**
|
|
33
|
-
* True when a value looks like a concrete provider model id (host-resolved
|
|
34
|
+
* True when a value looks like a concrete provider model id (host-resolved override).
|
|
34
35
|
*/
|
|
35
36
|
export function looksLikeConcreteModelId(value) {
|
|
36
37
|
const trimmed = value.trim();
|
|
@@ -42,7 +43,7 @@ export function looksLikeConcreteModelId(value) {
|
|
|
42
43
|
return CONCRETE_MODEL_PREFIXES.some((p) => lower.startsWith(p));
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
45
|
-
* True when a string is a valid graph-authored
|
|
46
|
+
* True when a string is a valid graph-authored profile alias (not a provider model id).
|
|
46
47
|
*/
|
|
47
48
|
export function isGraphAiProfileName(value) {
|
|
48
49
|
if (typeof value !== 'string')
|
|
@@ -54,49 +55,33 @@ export function isGraphAiProfileName(value) {
|
|
|
54
55
|
}
|
|
55
56
|
export function assertGraphAiProfileNameString(value, path, context) {
|
|
56
57
|
if (!isGraphAiProfileName(value)) {
|
|
57
|
-
throw new ExellixGraphError(ExellixGraphErrorCode.NON_CANONICAL_MODEL_CONFIG, `${path} must be an AI profile
|
|
58
|
+
throw new ExellixGraphError(ExellixGraphErrorCode.NON_CANONICAL_MODEL_CONFIG, `${path} must be an AI profile alias (non-empty string without "/" or provider prefixes); got ${JSON.stringify(value)}`, context);
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
const mid = modelId.trim();
|
|
62
|
-
if (mid.includes('/'))
|
|
63
|
-
return mid;
|
|
64
|
-
const prov = provider.trim();
|
|
65
|
-
return prov ? `${prov}/${mid}` : mid;
|
|
66
|
-
}
|
|
67
|
-
async function resolveModelSlot(slot, context) {
|
|
61
|
+
function normalizeModelSlot(slot, context) {
|
|
68
62
|
const trimmed = slot.trim();
|
|
69
63
|
if (trimmed === '') {
|
|
70
64
|
throw new ExellixGraphError(ExellixGraphErrorCode.MODEL_CONFIG_INCOMPLETE, 'modelConfig slot must be a non-empty string', context);
|
|
71
65
|
}
|
|
72
|
-
|
|
73
|
-
return trimmed;
|
|
74
|
-
try {
|
|
75
|
-
const resolved = await resolveAIProfile(trimmed, { source: 'bundled' });
|
|
76
|
-
return formatResolvedModelId(resolved.provider, resolved.modelId);
|
|
77
|
-
}
|
|
78
|
-
catch (err) {
|
|
79
|
-
const code = err?.code ?? 'UNKNOWN_PROFILE';
|
|
80
|
-
throw new ExellixGraphError(ExellixGraphErrorCode.MODEL_PROFILE_UNRESOLVED, `Unresolved AI profile "${trimmed}" (${String(code)})`, { ...context, profile: trimmed });
|
|
81
|
-
}
|
|
66
|
+
return trimmed;
|
|
82
67
|
}
|
|
83
68
|
/**
|
|
84
|
-
*
|
|
85
|
-
* Profile
|
|
69
|
+
* Validates and normalizes graph/runtime {@link GraphAiModelConfig}.
|
|
70
|
+
* Profile aliases and host-resolved concrete ids pass through unchanged for downstream resolution.
|
|
86
71
|
*/
|
|
87
72
|
export async function resolveGraphAiModelConfig(modelConfig, context) {
|
|
88
73
|
if (!isGraphAiModelConfig(modelConfig)) {
|
|
89
74
|
throw new ExellixGraphError(ExellixGraphErrorCode.MODEL_CONFIG_INCOMPLETE, 'modelConfig must be { preActionModel: string, skillModel: string, postActionModel: string } with non-empty values', context);
|
|
90
75
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return { preActionModel, skillModel, postActionModel };
|
|
76
|
+
return {
|
|
77
|
+
preActionModel: normalizeModelSlot(modelConfig.preActionModel, context),
|
|
78
|
+
skillModel: normalizeModelSlot(modelConfig.skillModel, context),
|
|
79
|
+
postActionModel: normalizeModelSlot(modelConfig.postActionModel, context),
|
|
80
|
+
};
|
|
97
81
|
}
|
|
98
82
|
/**
|
|
99
|
-
* Maps
|
|
83
|
+
* Maps three-phase graph config to ai-tasks slot pair for a single runTask phase.
|
|
84
|
+
* Values are forwarded as-is (profile aliases or concrete ids).
|
|
100
85
|
*/
|
|
101
86
|
export function toRunTaskModelConfigForPhase(config, phase) {
|
|
102
87
|
switch (phase) {
|
|
@@ -16,9 +16,8 @@ export type ResolveModelConfigForNodeArgs = {
|
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* Resolves effective model config for a task node (precedence + conditional cases).
|
|
19
|
-
* Returns profile
|
|
20
|
-
* {@link toRunTaskModelConfigForPhase} / ai-tasks wire
|
|
21
|
-
* Use {@link resolveGraphAiModelConfig} when concrete ids are required (observability, docs).
|
|
19
|
+
* Returns profile aliases (or host-resolved concrete ids from runtime overrides) for
|
|
20
|
+
* {@link toRunTaskModelConfigForPhase} / ai-tasks wire. Alias → model resolution is downstream.
|
|
22
21
|
*/
|
|
23
22
|
export declare function resolveModelConfigForNode(args: ResolveModelConfigForNodeArgs): Promise<GraphAiModelConfig>;
|
|
24
23
|
export { conditionWhenSignature, isEmptyConditionWhen };
|
|
@@ -35,9 +35,8 @@ async function resolveTier(value, ctx, executionInput, runx) {
|
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
37
37
|
* Resolves effective model config for a task node (precedence + conditional cases).
|
|
38
|
-
* Returns profile
|
|
39
|
-
* {@link toRunTaskModelConfigForPhase} / ai-tasks wire
|
|
40
|
-
* Use {@link resolveGraphAiModelConfig} when concrete ids are required (observability, docs).
|
|
38
|
+
* Returns profile aliases (or host-resolved concrete ids from runtime overrides) for
|
|
39
|
+
* {@link toRunTaskModelConfigForPhase} / ai-tasks wire. Alias → model resolution is downstream.
|
|
41
40
|
*/
|
|
42
41
|
export async function resolveModelConfigForNode(args) {
|
|
43
42
|
const staticHost = args.runtimeNodeConfig?.modelConfig;
|
|
@@ -30,7 +30,7 @@ export type BuildTaskNodeRunTaskRequestArgs = {
|
|
|
30
30
|
graphRunTaskId?: string;
|
|
31
31
|
/** Host job id on `job.jobId` / `job.id`; defaults from `job` when omitted. */
|
|
32
32
|
runTaskJobId?: string;
|
|
33
|
-
/**
|
|
33
|
+
/** Profile aliases or host-resolved concrete ids; forwarded unchanged on the ai-tasks wire. */
|
|
34
34
|
modelConfig?: GraphAiModelConfig;
|
|
35
35
|
/** @deprecated Unused since 7.1. */
|
|
36
36
|
aliasConfig?: GraphModelAliasConfig;
|
package/dist/src/types/refs.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ export type TaskNodeExecutionPipelineStep = {
|
|
|
14
14
|
*/
|
|
15
15
|
/**
|
|
16
16
|
* Three-phase AI model selection on graph model / node `modelConfig`.
|
|
17
|
-
* Values are
|
|
18
|
-
* or host-resolved concrete provider ids on runtime overrides.
|
|
17
|
+
* Values are profile alias names (`cheap`, `balanced`, `deep`, …) in graph JSON,
|
|
18
|
+
* or host-resolved concrete provider ids on runtime overrides. Alias resolution is downstream.
|
|
19
19
|
*/
|
|
20
20
|
export type GraphAiModelConfig = {
|
|
21
21
|
preActionModel: string;
|
|
@@ -29,7 +29,7 @@ export type GraphModelAliasConfig = Record<string, string>;
|
|
|
29
29
|
/** Runtime overrides for a single task node, stored at GraphRuntimeObject.nodes[nodeId]. */
|
|
30
30
|
export type TaskNodeRuntimeObject = {
|
|
31
31
|
modelConfig?: GraphAiModelConfig;
|
|
32
|
-
/** @deprecated Unused since 7.1 — profile
|
|
32
|
+
/** @deprecated Unused since 7.1 — profile aliases pass through to downstream resolution. */
|
|
33
33
|
aliasConfig?: GraphModelAliasConfig;
|
|
34
34
|
};
|
|
35
35
|
/** Backwards-readable alias for per-node runtime overrides keyed by task node id. */
|
|
@@ -2,10 +2,10 @@ import type { Graph } from '../src/types/refs.js';
|
|
|
2
2
|
import { createExellixGraphRuntime, type GraphRuntimeObject } from '../src/runtime/ExellixGraphRuntime.js';
|
|
3
3
|
type CreateOpts = Parameters<typeof createExellixGraphRuntime>[0];
|
|
4
4
|
/**
|
|
5
|
-
* Testkit runtime for graphs using
|
|
5
|
+
* Testkit runtime for graphs using profile aliases (no `runtime.aliasConfig` required).
|
|
6
6
|
*/
|
|
7
7
|
export declare function createTestExellixGraphRuntime(opts: CreateOpts): ReturnType<typeof createExellixGraphRuntime>;
|
|
8
|
-
/** @deprecated Alias map test helper removed in 7.1 —
|
|
8
|
+
/** @deprecated Alias map test helper removed in 7.1 — profile aliases pass through to ai-tasks. */
|
|
9
9
|
export declare function buildTestAliasConfig(_graph: Pick<Graph, 'modelConfig' | 'nodes'>, runtimePartial?: Pick<GraphRuntimeObject, 'modelConfig' | 'nodes'> & {
|
|
10
10
|
aliasConfig?: Record<string, string>;
|
|
11
11
|
}): Record<string, string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createExellixGraphRuntime, } from '../src/runtime/ExellixGraphRuntime.js';
|
|
2
2
|
/**
|
|
3
|
-
* Testkit runtime for graphs using
|
|
3
|
+
* Testkit runtime for graphs using profile aliases (no `runtime.aliasConfig` required).
|
|
4
4
|
*/
|
|
5
5
|
export function createTestExellixGraphRuntime(opts) {
|
|
6
6
|
const runtime = createExellixGraphRuntime(opts);
|
|
@@ -20,7 +20,7 @@ export function createTestExellixGraphRuntime(opts) {
|
|
|
20
20
|
};
|
|
21
21
|
return runtime;
|
|
22
22
|
}
|
|
23
|
-
/** @deprecated Alias map test helper removed in 7.1 —
|
|
23
|
+
/** @deprecated Alias map test helper removed in 7.1 — profile aliases pass through to ai-tasks. */
|
|
24
24
|
export function buildTestAliasConfig(_graph, runtimePartial) {
|
|
25
25
|
return { ...(runtimePartial?.aliasConfig ?? {}) };
|
|
26
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exellix/graph-engine",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Graph executor SDK",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -50,9 +50,8 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@exellix/ai-tasks": "^8.2.
|
|
53
|
+
"@exellix/ai-tasks": "^8.2.9",
|
|
54
54
|
"@x12i/activix": "8.5.0",
|
|
55
|
-
"@x12i/ai-profiles": "1.8.0",
|
|
56
55
|
"@x12i/catalox": "5.1.3",
|
|
57
56
|
"@x12i/env": "4.0.1",
|
|
58
57
|
"@x12i/funcx": "4.3.0",
|