@exellix/graph-engine 7.4.1 → 7.4.3

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.
@@ -91,6 +91,8 @@ export interface GraphRuntimeObject extends HostExecuteGraphRunOptions {
91
91
  taskVariables?: Record<string, unknown>;
92
92
  /** Runtime default model selection (`cases`); overrides GraphModelObject.modelConfig. */
93
93
  modelConfig?: ModelConfigSelection;
94
+ /** Profile aliases for xynthesis when runtime.modelConfig is host-resolved concrete ids. */
95
+ aiProfiles?: GraphAiModelConfig;
94
96
  /**
95
97
  * @deprecated Unused since 7.1 — profile aliases pass through to downstream resolution.
96
98
  */
@@ -210,6 +212,8 @@ export declare function createExellixGraphRuntime(opts: ExellixGraphRuntimeOptio
210
212
  prevNodeId?: string;
211
213
  /** Overrides graph-level / runtime default for this node only. */
212
214
  modelConfig?: GraphAiModelConfig;
215
+ /** Profile aliases for xynthesis PRE/POST when modelConfig is host-resolved concrete ids. */
216
+ aiProfiles?: GraphAiModelConfig;
213
217
  llmCall?: Record<string, unknown>;
214
218
  runTaskIdentity?: Record<string, unknown>;
215
219
  runTaskExecutionMode?: "default" | "trace";
@@ -397,7 +397,7 @@ export function createExellixGraphRuntime(opts) {
397
397
  },
398
398
  ...(input.modelConfig != null
399
399
  ? {
400
- modelConfig: toRunTaskModelConfigForPhase(input.modelConfig, 'pre'),
400
+ modelConfig: toRunTaskModelConfigForPhase(input.modelConfig, 'pre', input.aiProfiles),
401
401
  }
402
402
  : {}),
403
403
  ...(effectiveLlmCall != null ? { llmCall: effectiveLlmCall } : {}),
@@ -610,7 +610,7 @@ export function createExellixGraphRuntime(opts) {
610
610
  }
611
611
  const effectiveModelConfig = input.modelConfig;
612
612
  const mainRunTaskModelConfig = effectiveModelConfig != null
613
- ? toRunTaskModelConfigForPhase(effectiveModelConfig, 'main')
613
+ ? toRunTaskModelConfigForPhase(effectiveModelConfig, 'main', input.aiProfiles)
614
614
  : undefined;
615
615
  // DEBUG: Verify execution object before sending
616
616
  traceExecutionMemory('executeNode', 'Node execution object before runTask', {
@@ -722,6 +722,7 @@ export function createExellixGraphRuntime(opts) {
722
722
  jobContext,
723
723
  prevNodeId: input.prevNodeId,
724
724
  modelConfig: effectiveModelConfig,
725
+ aiProfiles: input.aiProfiles,
725
726
  llmCall: effectiveLlmCall,
726
727
  runTaskIdentity: runTaskIdentityBase,
727
728
  nodeTaskConfiguration: input.node?.taskConfiguration,
@@ -1023,6 +1024,7 @@ export function createExellixGraphRuntime(opts) {
1023
1024
  jobContext,
1024
1025
  prevNodeId: input.prevNodeId,
1025
1026
  modelConfig: effectiveModelConfig,
1027
+ aiProfiles: input.aiProfiles,
1026
1028
  llmCall: effectiveLlmCall,
1027
1029
  runTaskIdentity: runTaskIdentityBase,
1028
1030
  nodeTaskConfiguration: input.node?.taskConfiguration,
@@ -1616,6 +1618,7 @@ export function createExellixGraphRuntime(opts) {
1616
1618
  variables: runtime.variables,
1617
1619
  taskVariables: runtime.taskVariables,
1618
1620
  modelConfig: effectiveModelConfig,
1621
+ aiProfiles: merged.aiProfiles,
1619
1622
  llmCall: merged.llmCall,
1620
1623
  runTaskIdentity: merged.runTaskIdentity,
1621
1624
  runTaskExecutionMode: merged.runTaskExecutionMode,
@@ -27,6 +27,8 @@ export type RunEngineAiTasksStrategyPhaseArgs = {
27
27
  prevNodeId?: string;
28
28
  /** Resolved three-phase config; routed to the correct ai-tasks slot for this strategy phase. */
29
29
  modelConfig?: GraphAiModelConfig;
30
+ /** Profile aliases for xynthesis slots when modelConfig is host-resolved concrete ids. */
31
+ aiProfiles?: GraphAiModelConfig;
30
32
  llmCall?: RunTaskRequest['llmCall'];
31
33
  runTaskIdentity?: Record<string, unknown>;
32
34
  /** Task node `taskConfiguration` (identity envelope merge). */
@@ -55,7 +55,7 @@ export async function runEngineAiTasksStrategyPhase(args) {
55
55
  executionPipeline: [{ phase: 'main', type: 'direct' }],
56
56
  executionStrategies: [],
57
57
  modelConfig: args.modelConfig != null
58
- ? toRunTaskModelConfigForPhase(args.modelConfig, args.phase)
58
+ ? toRunTaskModelConfigForPhase(args.modelConfig, args.phase, args.aiProfiles)
59
59
  : undefined,
60
60
  llmCall: args.llmCall ?? undefined,
61
61
  identity,
@@ -36,5 +36,9 @@ export type EngineModelPhase = 'pre' | 'main' | 'post';
36
36
  /**
37
37
  * Maps three-phase graph config to ai-tasks slot pair for a single runTask phase.
38
38
  * Values are forwarded as-is (profile aliases or concrete ids).
39
+ *
40
+ * When {@link aiProfiles} is set (studio/playground host pattern), xynthesis slots use profile
41
+ * aliases so PRE synthesis inside ai-tasks resolves via ai-profiles even when {@link config}
42
+ * carries host-resolved concrete provider ids on `runtime.modelConfig`.
39
43
  */
40
- export declare function toRunTaskModelConfigForPhase(config: GraphAiModelConfig, phase: EngineModelPhase): RunTaskModelConfigWire;
44
+ export declare function toRunTaskModelConfigForPhase(config: GraphAiModelConfig, phase: EngineModelPhase, aiProfiles?: GraphAiModelConfig): RunTaskModelConfigWire;
@@ -79,26 +79,37 @@ export async function resolveGraphAiModelConfig(modelConfig, context) {
79
79
  postActionModel: normalizeModelSlot(modelConfig.postActionModel, context),
80
80
  };
81
81
  }
82
+ function xynthesisSlotForWire(config, phase, aiProfiles) {
83
+ if (aiProfiles != null) {
84
+ return phase === 'post' ? aiProfiles.postActionModel : aiProfiles.preActionModel;
85
+ }
86
+ return phase === 'post' ? config.postActionModel : config.preActionModel;
87
+ }
82
88
  /**
83
89
  * Maps three-phase graph config to ai-tasks slot pair for a single runTask phase.
84
90
  * Values are forwarded as-is (profile aliases or concrete ids).
91
+ *
92
+ * When {@link aiProfiles} is set (studio/playground host pattern), xynthesis slots use profile
93
+ * aliases so PRE synthesis inside ai-tasks resolves via ai-profiles even when {@link config}
94
+ * carries host-resolved concrete provider ids on `runtime.modelConfig`.
85
95
  */
86
- export function toRunTaskModelConfigForPhase(config, phase) {
96
+ export function toRunTaskModelConfigForPhase(config, phase, aiProfiles) {
97
+ const xynthesisModel = xynthesisSlotForWire(config, phase, aiProfiles);
87
98
  switch (phase) {
88
99
  case 'pre':
89
100
  return {
90
- xynthesisModel: config.preActionModel,
91
- skillModel: config.preActionModel,
101
+ xynthesisModel,
102
+ skillModel: xynthesisModel,
92
103
  };
93
104
  case 'main':
94
105
  return {
95
- xynthesisModel: config.preActionModel,
106
+ xynthesisModel,
96
107
  skillModel: config.skillModel,
97
108
  };
98
109
  case 'post':
99
110
  return {
100
- xynthesisModel: config.postActionModel,
101
- skillModel: config.postActionModel,
111
+ xynthesisModel,
112
+ skillModel: xynthesisModel,
102
113
  };
103
114
  }
104
115
  }
@@ -16,6 +16,7 @@ export function mergeExellixGraphRuntimeInvocation(input, opts) {
16
16
  playgroundMeta: input.playgroundMeta ?? opts.playgroundMeta,
17
17
  clearSynthesizedContextPerNode: input.clearSynthesizedContextPerNode ?? opts.clearSynthesizedContextPerNode,
18
18
  modelConfig: input.modelConfig ?? opts.modelConfig,
19
+ aiProfiles: input.aiProfiles ?? opts.aiProfiles,
19
20
  aliasConfig: input.aliasConfig ?? opts.aliasConfig,
20
21
  nodes: input.nodes ?? opts.nodes,
21
22
  llmCall: input.llmCall ?? opts.llmCall,
@@ -1,7 +1,7 @@
1
1
  import type { Activix } from '@x12i/activix';
2
2
  import type { StackLoggingOptions } from '@x12i/logxer';
3
3
  import type { LlmCallConfig, RunTaskRequest as AiTasksRunTaskRequest, RunTaskResponse as AiTasksRunTaskResponse } from '@exellix/ai-tasks';
4
- import type { GraphModelAliasConfig, ModelConfigSelection, TaskNodeRuntimeObject } from './refs.js';
4
+ import type { GraphAiModelConfig, GraphModelAliasConfig, ModelConfigSelection, TaskNodeRuntimeObject } from './refs.js';
5
5
  import type { RuntimeObjects } from '../runtime/runtimeObjects.js';
6
6
  /**
7
7
  * NOTE: `@exellix/ai-tasks` 5.5+ removed the exported `RunTaskDiagnostics` type.
@@ -63,6 +63,11 @@ export interface HostExecuteGraphRunOptions {
63
63
  playgroundMeta?: Record<string, unknown>;
64
64
  clearSynthesizedContextPerNode?: boolean;
65
65
  modelConfig?: ModelConfigSelection;
66
+ /**
67
+ * Profile aliases for xynthesis PRE/POST when {@link modelConfig} carries host-resolved concrete ids.
68
+ * MAIN `skillModel` still comes from resolved `modelConfig`; xynthesis slots prefer these aliases.
69
+ */
70
+ aiProfiles?: GraphAiModelConfig;
66
71
  aliasConfig?: GraphModelAliasConfig;
67
72
  nodes?: Record<string, TaskNodeRuntimeObject>;
68
73
  llmCall?: LlmCallConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exellix/graph-engine",
3
- "version": "7.4.1",
3
+ "version": "7.4.3",
4
4
  "type": "module",
5
5
  "description": "Graph executor SDK",
6
6
  "main": "dist/src/index.js",
@@ -28,6 +28,8 @@
28
28
  "test": "npm run build && npm run check:no-legacy && tsx --test --test-force-exit tests/model-alias-contract.test.ts tests/reports-fixtures-pre-synthesis.test.ts tests/passthrough-parity.test.ts tests/step-retry-llm-call.test.ts tests/run-log-diagnostics.test.ts",
29
29
  "test:full": "npm run build && npm run check:no-legacy && tsx --test --test-force-exit tests/graph-engine.test.ts tests/passthrough-parity.test.ts tests/task-node-run-task-preflight.test.ts tests/reports-fixtures-pre-synthesis.test.ts tests/model-alias-contract.test.ts tests/step-retry-llm-call.test.ts",
30
30
  "test:live": "npm run run:pre-synthesis",
31
+ "test:subnets-graph-fixture": "npm run build && node --test tests/subnets-graph.fixture.test.mjs",
32
+ "test:subnets-graph-live": "npm run build && node --env-file=.env --test tests/subnets-graph.live.test.mjs",
31
33
  "run:pre-synthesis": "npm run build && node --env-file=.env scripts/run-pre-synthesis-graph.mjs",
32
34
  "check:no-legacy": "node scripts/check-no-legacy.mjs",
33
35
  "lint": "eslint src testkit --ext .ts",