@exellix/graph-engine 6.0.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/.env.example +3 -0
- package/CHANGELOG.md +208 -0
- package/README.md +827 -0
- package/dist/src/errors/ExellixGraphError.d.ts +38 -0
- package/dist/src/errors/ExellixGraphError.js +21 -0
- package/dist/src/errors/exellixGraphErrorCodes.d.ts +31 -0
- package/dist/src/errors/exellixGraphErrorCodes.js +32 -0
- package/dist/src/index.d.ts +100 -0
- package/dist/src/index.js +75 -0
- package/dist/src/inspection/contractInspection.d.ts +21 -0
- package/dist/src/inspection/contractInspection.js +526 -0
- package/dist/src/inspection/contractTypes.d.ts +137 -0
- package/dist/src/inspection/contractTypes.js +1 -0
- package/dist/src/inspection/controlInspection.d.ts +22 -0
- package/dist/src/inspection/controlInspection.js +130 -0
- package/dist/src/inspection/graphInspection.d.ts +51 -0
- package/dist/src/inspection/graphInspection.js +467 -0
- package/dist/src/inspection/index.d.ts +21 -0
- package/dist/src/inspection/index.js +17 -0
- package/dist/src/inspection/nodeInspection.d.ts +42 -0
- package/dist/src/inspection/nodeInspection.js +474 -0
- package/dist/src/inspection/types.d.ts +321 -0
- package/dist/src/inspection/types.js +14 -0
- package/dist/src/inspection/validateAiTasksNodeExtensions.d.ts +12 -0
- package/dist/src/inspection/validateAiTasksNodeExtensions.js +119 -0
- package/dist/src/inspection/validateCatalogPlanning.d.ts +21 -0
- package/dist/src/inspection/validateCatalogPlanning.js +187 -0
- package/dist/src/integrations/ActivityTrackerIntegration.d.ts +86 -0
- package/dist/src/integrations/ActivityTrackerIntegration.js +134 -0
- package/dist/src/integrations/ActivixGraphRunIntegration.d.ts +34 -0
- package/dist/src/integrations/ActivixGraphRunIntegration.js +338 -0
- package/dist/src/integrations/ActivixNodeActivityIntegration.d.ts +33 -0
- package/dist/src/integrations/ActivixNodeActivityIntegration.js +220 -0
- package/dist/src/integrations/cataloxGraphCatalog.d.ts +21 -0
- package/dist/src/integrations/cataloxGraphCatalog.js +30 -0
- package/dist/src/integrations/createActivixExellixIntegration.d.ts +14 -0
- package/dist/src/integrations/createActivixExellixIntegration.js +16 -0
- package/dist/src/integrations/createActivixFromEnv.d.ts +31 -0
- package/dist/src/integrations/createActivixFromEnv.js +53 -0
- package/dist/src/loaders/FileGraphLoader.d.ts +23 -0
- package/dist/src/loaders/FileGraphLoader.js +31 -0
- package/dist/src/playground/PlaygroundReporter.d.ts +40 -0
- package/dist/src/playground/PlaygroundReporter.js +480 -0
- package/dist/src/playground/index.d.ts +1 -0
- package/dist/src/playground/index.js +1 -0
- package/dist/src/runtime/ExellixGraphRuntime.d.ts +263 -0
- package/dist/src/runtime/ExellixGraphRuntime.js +1716 -0
- package/dist/src/runtime/GraphEngine.d.ts +33 -0
- package/dist/src/runtime/GraphEngine.js +4 -0
- package/dist/src/runtime/aiTasksObservability.d.ts +6 -0
- package/dist/src/runtime/aiTasksObservability.js +37 -0
- package/dist/src/runtime/aiTasksStrategyPhases.d.ts +46 -0
- package/dist/src/runtime/aiTasksStrategyPhases.js +93 -0
- package/dist/src/runtime/applyAiTaskProfileWebScopingToNarrix.d.ts +17 -0
- package/dist/src/runtime/applyAiTaskProfileWebScopingToNarrix.js +46 -0
- package/dist/src/runtime/buildAiTasksRunTaskRequest.d.ts +67 -0
- package/dist/src/runtime/buildAiTasksRunTaskRequest.js +164 -0
- package/dist/src/runtime/buildRunLog.d.ts +27 -0
- package/dist/src/runtime/buildRunLog.js +234 -0
- package/dist/src/runtime/buildRunTaskTaskConfigurationForward.d.ts +9 -0
- package/dist/src/runtime/buildRunTaskTaskConfigurationForward.js +80 -0
- package/dist/src/runtime/buildTaskNodeJobContext.d.ts +11 -0
- package/dist/src/runtime/buildTaskNodeJobContext.js +30 -0
- package/dist/src/runtime/canonicalModelUsed.d.ts +6 -0
- package/dist/src/runtime/canonicalModelUsed.js +36 -0
- package/dist/src/runtime/contextualScope.d.ts +7 -0
- package/dist/src/runtime/contextualScope.js +121 -0
- package/dist/src/runtime/dataFiltersEvaluation.d.ts +60 -0
- package/dist/src/runtime/dataFiltersEvaluation.js +169 -0
- package/dist/src/runtime/deepMerge.d.ts +5 -0
- package/dist/src/runtime/deepMerge.js +22 -0
- package/dist/src/runtime/events.d.ts +92 -0
- package/dist/src/runtime/events.js +122 -0
- package/dist/src/runtime/executionMatrixHost.d.ts +98 -0
- package/dist/src/runtime/executionMatrixHost.js +134 -0
- package/dist/src/runtime/executionVariableBuckets.d.ts +67 -0
- package/dist/src/runtime/executionVariableBuckets.js +96 -0
- package/dist/src/runtime/finalizers/errors.d.ts +9 -0
- package/dist/src/runtime/finalizers/errors.js +10 -0
- package/dist/src/runtime/finalizers/executeFinalizer.d.ts +40 -0
- package/dist/src/runtime/finalizers/executeFinalizer.js +471 -0
- package/dist/src/runtime/finalizers/schema.d.ts +18 -0
- package/dist/src/runtime/finalizers/schema.js +63 -0
- package/dist/src/runtime/finalizers/validateFinalizer.d.ts +16 -0
- package/dist/src/runtime/finalizers/validateFinalizer.js +534 -0
- package/dist/src/runtime/graphDocumentFingerprint.d.ts +8 -0
- package/dist/src/runtime/graphDocumentFingerprint.js +21 -0
- package/dist/src/runtime/graphEngineMemoryPaths.d.ts +12 -0
- package/dist/src/runtime/graphEngineMemoryPaths.js +55 -0
- package/dist/src/runtime/graphResponseMapping.d.ts +23 -0
- package/dist/src/runtime/graphResponseMapping.js +156 -0
- package/dist/src/runtime/graphResponseMigration.d.ts +7 -0
- package/dist/src/runtime/graphResponseMigration.js +44 -0
- package/dist/src/runtime/graphRunExecutionSeed.d.ts +29 -0
- package/dist/src/runtime/graphRunExecutionSeed.js +61 -0
- package/dist/src/runtime/graphRunIdentity.d.ts +7 -0
- package/dist/src/runtime/graphRunIdentity.js +18 -0
- package/dist/src/runtime/localSkills/deterministicRule.d.ts +137 -0
- package/dist/src/runtime/localSkills/deterministicRule.js +196 -0
- package/dist/src/runtime/localSkills/index.d.ts +12 -0
- package/dist/src/runtime/localSkills/index.js +14 -0
- package/dist/src/runtime/localSkills/memorixItemToScopedOutput.d.ts +7 -0
- package/dist/src/runtime/localSkills/memorixItemToScopedOutput.js +104 -0
- package/dist/src/runtime/localSkills/memorixRuntime.d.ts +9 -0
- package/dist/src/runtime/localSkills/memorixRuntime.js +70 -0
- package/dist/src/runtime/localSkills/memorixScopedConfig.d.ts +16 -0
- package/dist/src/runtime/localSkills/memorixScopedConfig.js +18 -0
- package/dist/src/runtime/localSkills/scopedAnswerAssembler.d.ts +23 -0
- package/dist/src/runtime/localSkills/scopedAnswerAssembler.js +35 -0
- package/dist/src/runtime/localSkills/scopedAnswerFields.d.ts +12 -0
- package/dist/src/runtime/localSkills/scopedAnswerFields.js +66 -0
- package/dist/src/runtime/localSkills/scopedAnswerWriter.d.ts +32 -0
- package/dist/src/runtime/localSkills/scopedAnswerWriter.js +156 -0
- package/dist/src/runtime/localSkills/scopedDataReader.d.ts +47 -0
- package/dist/src/runtime/localSkills/scopedDataReader.js +89 -0
- package/dist/src/runtime/localSkills/utils.d.ts +12 -0
- package/dist/src/runtime/localSkills/utils.js +39 -0
- package/dist/src/runtime/materializeStructuredRunTaskInput.d.ts +9 -0
- package/dist/src/runtime/materializeStructuredRunTaskInput.js +34 -0
- package/dist/src/runtime/memory.d.ts +51 -0
- package/dist/src/runtime/memory.js +250 -0
- package/dist/src/runtime/mergeExellixGraphRuntimeInvocation.d.ts +18 -0
- package/dist/src/runtime/mergeExellixGraphRuntimeInvocation.js +32 -0
- package/dist/src/runtime/modelConfigSelection.d.ts +7 -0
- package/dist/src/runtime/modelConfigSelection.js +37 -0
- package/dist/src/runtime/narrixIngestEnv.d.ts +9 -0
- package/dist/src/runtime/narrixIngestEnv.js +18 -0
- package/dist/src/runtime/pathExpr.d.ts +36 -0
- package/dist/src/runtime/pathExpr.js +131 -0
- package/dist/src/runtime/predicates.d.ts +14 -0
- package/dist/src/runtime/predicates.js +86 -0
- package/dist/src/runtime/readTaskNodeInputsConfig.d.ts +23 -0
- package/dist/src/runtime/readTaskNodeInputsConfig.js +27 -0
- package/dist/src/runtime/resolveExecutionPipelineForTaskNode.d.ts +11 -0
- package/dist/src/runtime/resolveExecutionPipelineForTaskNode.js +93 -0
- package/dist/src/runtime/resolveGraphEngineMemoryPaths.d.ts +63 -0
- package/dist/src/runtime/resolveGraphEngineMemoryPaths.js +213 -0
- package/dist/src/runtime/resolveModelConfigForNode.d.ts +20 -0
- package/dist/src/runtime/resolveModelConfigForNode.js +69 -0
- package/dist/src/runtime/resolveNarrixForTaskNode.d.ts +14 -0
- package/dist/src/runtime/resolveNarrixForTaskNode.js +19 -0
- package/dist/src/runtime/resolveTaskKey.d.ts +11 -0
- package/dist/src/runtime/resolveTaskKey.js +28 -0
- package/dist/src/runtime/resolveTaskNodeInputs.d.ts +25 -0
- package/dist/src/runtime/resolveTaskNodeInputs.js +140 -0
- package/dist/src/runtime/runTaskAugments.d.ts +17 -0
- package/dist/src/runtime/runTaskAugments.js +37 -0
- package/dist/src/runtime/runTaskResponse.d.ts +4 -0
- package/dist/src/runtime/runTaskResponse.js +13 -0
- package/dist/src/runtime/runtimeObjects.d.ts +85 -0
- package/dist/src/runtime/runtimeObjects.js +50 -0
- package/dist/src/runtime/smartInputPaths.d.ts +13 -0
- package/dist/src/runtime/smartInputPaths.js +38 -0
- package/dist/src/runtime/stepRetry.d.ts +21 -0
- package/dist/src/runtime/stepRetry.js +238 -0
- package/dist/src/runtime/synthesizedContextPipeline.d.ts +12 -0
- package/dist/src/runtime/synthesizedContextPipeline.js +28 -0
- package/dist/src/runtime/taskNodeConditionsEvaluation.d.ts +27 -0
- package/dist/src/runtime/taskNodeConditionsEvaluation.js +140 -0
- package/dist/src/runtime/taskNodeMainReadiness.d.ts +45 -0
- package/dist/src/runtime/taskNodeMainReadiness.js +164 -0
- package/dist/src/runtime/taskNodeRunTaskPreflight.d.ts +89 -0
- package/dist/src/runtime/taskNodeRunTaskPreflight.js +204 -0
- package/dist/src/runtime/validateCanonicalGraphDocument.d.ts +25 -0
- package/dist/src/runtime/validateCanonicalGraphDocument.js +567 -0
- package/dist/src/runtime/variables.d.ts +2 -0
- package/dist/src/runtime/variables.js +1 -0
- package/dist/src/runtime/withTimeout.d.ts +5 -0
- package/dist/src/runtime/withTimeout.js +20 -0
- package/dist/src/types/aiTaskProfile.d.ts +41 -0
- package/dist/src/types/aiTaskProfile.js +6 -0
- package/dist/src/types/aiTasksDerivedTypes.d.ts +5 -0
- package/dist/src/types/aiTasksDerivedTypes.js +1 -0
- package/dist/src/types/events.d.ts +23 -0
- package/dist/src/types/events.js +1 -0
- package/dist/src/types/job.d.ts +9 -0
- package/dist/src/types/job.js +1 -0
- package/dist/src/types/narrix.d.ts +60 -0
- package/dist/src/types/narrix.js +1 -0
- package/dist/src/types/options.d.ts +122 -0
- package/dist/src/types/options.js +1 -0
- package/dist/src/types/refs.d.ts +747 -0
- package/dist/src/types/refs.js +12 -0
- package/dist/src/types/results.d.ts +103 -0
- package/dist/src/types/results.js +1 -0
- package/dist/src/types/runLog.d.ts +72 -0
- package/dist/src/types/runLog.js +18 -0
- package/dist/src/types/taskNodeConfiguration.d.ts +95 -0
- package/dist/src/types/taskNodeConfiguration.js +3 -0
- package/dist/src/util/packageVersion.d.ts +2 -0
- package/dist/src/util/packageVersion.js +12 -0
- package/dist/testkit/RealTasksClient.d.ts +16 -0
- package/dist/testkit/RealTasksClient.js +143 -0
- package/dist/testkit/depGraphEngineFactory.d.ts +6 -0
- package/dist/testkit/depGraphEngineFactory.js +54 -0
- package/dist/testkit/exellixRuntimeObjects.d.ts +7 -0
- package/dist/testkit/exellixRuntimeObjects.js +25 -0
- package/dist/testkit/inMemoryGraphLoader.d.ts +6 -0
- package/dist/testkit/inMemoryGraphLoader.js +12 -0
- package/dist/testkit/index.d.ts +4 -0
- package/dist/testkit/index.js +4 -0
- package/package.json +70 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads a task node's runtime binding recipe with backward-compatible fallbacks.
|
|
3
|
+
* Finalizers use `FinalizerNode.inputs` directly; this helper is for task nodes only.
|
|
4
|
+
*/
|
|
5
|
+
export function readTaskNodeInputsConfig(node) {
|
|
6
|
+
const n = node;
|
|
7
|
+
const recipe = n.inputsConfig ?? n.inputBindings ?? n.inputs;
|
|
8
|
+
if (recipe != null && typeof recipe === 'object' && !Array.isArray(recipe)) {
|
|
9
|
+
return recipe;
|
|
10
|
+
}
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Model surface for graph.response selectors (`nodeInputsConfig` / legacy `nodeInputs`):
|
|
15
|
+
* runtime bindings plus `taskVariable` (taskVariable wins on key collision).
|
|
16
|
+
*/
|
|
17
|
+
export function readTaskNodeModelInputSurface(node) {
|
|
18
|
+
const bindings = readTaskNodeInputsConfig(node);
|
|
19
|
+
const taskVariable = node.taskVariable;
|
|
20
|
+
if (taskVariable != null && typeof taskVariable === 'object' && !Array.isArray(taskVariable)) {
|
|
21
|
+
return { ...bindings, ...taskVariable };
|
|
22
|
+
}
|
|
23
|
+
return bindings;
|
|
24
|
+
}
|
|
25
|
+
export function isNodeInputsConfigSelectorType(type) {
|
|
26
|
+
return type === 'nodeInputsConfig' || type === 'nodeInputs';
|
|
27
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TaskNode } from '../types/refs.js';
|
|
2
|
+
import type { ExecutionStepOption } from '../types/options.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the effective execution pipeline for a task node, including `taskConfiguration.aiTaskProfile.inputSynthesis`
|
|
5
|
+
* bridge and INPUT_SYNTHESIS_PIPELINE_CONFLICT rules (GE-007 / GE-008).
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveExecutionPipelineForTaskNode(args: {
|
|
8
|
+
node: TaskNode;
|
|
9
|
+
optionsExecutionPipeline?: ExecutionStepOption[];
|
|
10
|
+
executionExecutionPipeline?: unknown;
|
|
11
|
+
}): ExecutionStepOption[];
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
function isPlainObject(v) {
|
|
2
|
+
return v != null && typeof v === 'object' && !Array.isArray(v);
|
|
3
|
+
}
|
|
4
|
+
function pipelineError(code, message) {
|
|
5
|
+
const e = new Error(message);
|
|
6
|
+
e.code = code;
|
|
7
|
+
return e;
|
|
8
|
+
}
|
|
9
|
+
function findPreSynthesizedContextIndex(pipeline) {
|
|
10
|
+
return pipeline.findIndex((s) => s.phase === 'pre' && s.type === 'synthesized-context');
|
|
11
|
+
}
|
|
12
|
+
function uniqStrings(paths) {
|
|
13
|
+
return [...new Set(paths.map((p) => p.trim()).filter(Boolean))];
|
|
14
|
+
}
|
|
15
|
+
function buildInputSynthesisPreConfig(synth) {
|
|
16
|
+
const sources = Array.isArray(synth.sources) ? synth.sources : [];
|
|
17
|
+
return {
|
|
18
|
+
contextSourcePolicy: 'memory-only',
|
|
19
|
+
memoryPaths: sources.map((p) => String(p).trim()).filter(Boolean),
|
|
20
|
+
autoEnableContext: true,
|
|
21
|
+
xynthesizedOutput: {
|
|
22
|
+
destination: synth.destination,
|
|
23
|
+
outputKey: synth.outputKey,
|
|
24
|
+
mode: synth.mode ?? 'merge',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function mergeSynthConfigs(params) {
|
|
29
|
+
const { existing, fromAuthoring } = params;
|
|
30
|
+
const pol = existing.contextSourcePolicy;
|
|
31
|
+
if (pol != null && pol !== 'memory-only') {
|
|
32
|
+
throw pipelineError('INPUT_SYNTHESIS_PIPELINE_CONFLICT', `Existing PRE synthesized-context uses contextSourcePolicy "${String(pol)}"; inputSynthesis requires memory-only`);
|
|
33
|
+
}
|
|
34
|
+
const existingPaths = Array.isArray(existing.memoryPaths)
|
|
35
|
+
? existing.memoryPaths.filter((x) => typeof x === 'string')
|
|
36
|
+
: [];
|
|
37
|
+
const newPaths = fromAuthoring.memoryPaths;
|
|
38
|
+
const mergedPaths = uniqStrings([...existingPaths, ...newPaths]);
|
|
39
|
+
const xOutExisting = isPlainObject(existing.xynthesizedOutput) ? existing.xynthesizedOutput : null;
|
|
40
|
+
const xOutNew = fromAuthoring.xynthesizedOutput;
|
|
41
|
+
if (xOutExisting != null && Object.keys(xOutExisting).length > 0) {
|
|
42
|
+
if (xOutExisting.destination !== xOutNew.destination || xOutExisting.outputKey !== xOutNew.outputKey) {
|
|
43
|
+
throw pipelineError('INPUT_SYNTHESIS_PIPELINE_CONFLICT', 'Existing PRE synthesized-context xynthesizedOutput conflicts with taskConfiguration.aiTaskProfile.inputSynthesis');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
...existing,
|
|
48
|
+
...fromAuthoring,
|
|
49
|
+
contextSourcePolicy: 'memory-only',
|
|
50
|
+
memoryPaths: mergedPaths,
|
|
51
|
+
xynthesizedOutput: {
|
|
52
|
+
...(xOutExisting ?? {}),
|
|
53
|
+
...xOutNew,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Resolves the effective execution pipeline for a task node, including `taskConfiguration.aiTaskProfile.inputSynthesis`
|
|
59
|
+
* bridge and INPUT_SYNTHESIS_PIPELINE_CONFLICT rules (GE-007 / GE-008).
|
|
60
|
+
*/
|
|
61
|
+
export function resolveExecutionPipelineForTaskNode(args) {
|
|
62
|
+
const { node } = args;
|
|
63
|
+
const synthRaw = node.taskConfiguration?.aiTaskProfile?.inputSynthesis;
|
|
64
|
+
const synthEnabled = synthRaw?.enabled === true;
|
|
65
|
+
const authorPipelineRaw = args.optionsExecutionPipeline ??
|
|
66
|
+
node.executionPipeline ??
|
|
67
|
+
args.executionExecutionPipeline ??
|
|
68
|
+
null;
|
|
69
|
+
const authorPipeline = authorPipelineRaw != null && Array.isArray(authorPipelineRaw)
|
|
70
|
+
? [...authorPipelineRaw]
|
|
71
|
+
: null;
|
|
72
|
+
if (!synthEnabled) {
|
|
73
|
+
if (authorPipeline != null && authorPipeline.length > 0)
|
|
74
|
+
return authorPipeline;
|
|
75
|
+
return [{ phase: 'main', type: 'direct' }];
|
|
76
|
+
}
|
|
77
|
+
const synth = synthRaw;
|
|
78
|
+
const preFromAuthoring = buildInputSynthesisPreConfig(synth);
|
|
79
|
+
if (authorPipeline != null && authorPipeline.length > 0) {
|
|
80
|
+
// assertCanonicalGraphDocument already rejects manual PRE synthesized-context steps when
|
|
81
|
+
// inputSynthesis is enabled, so reaching this branch means the author authored a non-PRE pipeline.
|
|
82
|
+
// Inject the engine-built PRE synthesized-context at the front.
|
|
83
|
+
const idx = findPreSynthesizedContextIndex(authorPipeline);
|
|
84
|
+
if (idx >= 0) {
|
|
85
|
+
throw pipelineError('INPUT_SYNTHESIS_PIPELINE_CONFLICT', 'inputSynthesis.enabled is true but executionPipeline already has a PRE synthesized-context step');
|
|
86
|
+
}
|
|
87
|
+
return [{ phase: 'pre', type: 'synthesized-context', config: preFromAuthoring }, ...authorPipeline];
|
|
88
|
+
}
|
|
89
|
+
return [
|
|
90
|
+
{ phase: 'pre', type: 'synthesized-context', config: preFromAuthoring },
|
|
91
|
+
{ phase: 'main', type: 'direct' },
|
|
92
|
+
];
|
|
93
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Caller / graph-entry `inputs` bag only (not merged with MAIN `input`).
|
|
3
|
+
*/
|
|
4
|
+
export declare function extractCallerInputsBag(args: {
|
|
5
|
+
execution?: Record<string, unknown>;
|
|
6
|
+
jobMemory?: Record<string, unknown>;
|
|
7
|
+
extraLayers?: Array<Record<string, unknown> | undefined>;
|
|
8
|
+
}): Record<string, unknown> | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* MAIN `RunTaskRequest.input` bucket: runtime MAIN object layers plus materialized node
|
|
11
|
+
* binding keys only. Does **not** merge the caller `inputs` bag (see {@link extractCallerInputsBag}).
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildRunTaskMainInput(args: {
|
|
14
|
+
nodeBindings?: Record<string, unknown>;
|
|
15
|
+
execution?: Record<string, unknown>;
|
|
16
|
+
jobMemory?: Record<string, unknown>;
|
|
17
|
+
extraLayers?: Array<Record<string, unknown> | undefined>;
|
|
18
|
+
}): Record<string, unknown>;
|
|
19
|
+
export type GraphEngineMemoryResolutionRoot = {
|
|
20
|
+
/** MAIN bucket (`RunTaskRequest.input`). */
|
|
21
|
+
input: Record<string, unknown>;
|
|
22
|
+
/** Caller bag (`RunTaskRequest.inputs`). */
|
|
23
|
+
inputs: Record<string, unknown>;
|
|
24
|
+
/** Job / graph run template variables (`execution.jobVariables`). */
|
|
25
|
+
jobVariables?: Record<string, unknown>;
|
|
26
|
+
/** Task/node-scoped template variables (`execution.taskVariables`). */
|
|
27
|
+
taskVariables?: Record<string, unknown>;
|
|
28
|
+
jobMemory?: Record<string, unknown>;
|
|
29
|
+
taskMemory?: Record<string, unknown>;
|
|
30
|
+
executionMemory?: Record<string, unknown>;
|
|
31
|
+
xynthesized?: {
|
|
32
|
+
job: Record<string, unknown>;
|
|
33
|
+
task: Record<string, unknown>;
|
|
34
|
+
execution: Record<string, unknown>;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Builds a resolution root for {@link resolveGraphEngineMemoryPathValue} from outbound runTask fields.
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildGraphEngineMemoryResolutionRoot(args: {
|
|
41
|
+
input: Record<string, unknown>;
|
|
42
|
+
inputs?: Record<string, unknown>;
|
|
43
|
+
jobVariables?: Record<string, unknown>;
|
|
44
|
+
taskVariables?: Record<string, unknown>;
|
|
45
|
+
jobMemory?: unknown;
|
|
46
|
+
taskMemory?: unknown;
|
|
47
|
+
executionMemory?: Record<string, unknown>;
|
|
48
|
+
xynthesized?: {
|
|
49
|
+
job: Record<string, unknown>;
|
|
50
|
+
task: Record<string, unknown>;
|
|
51
|
+
execution?: Record<string, unknown>;
|
|
52
|
+
};
|
|
53
|
+
}): GraphEngineMemoryResolutionRoot;
|
|
54
|
+
/**
|
|
55
|
+
* Flat graphs-studio / host `workingMemory` object.
|
|
56
|
+
*/
|
|
57
|
+
export declare function buildGraphEngineMemoryResolutionRootFromWorkingMemory(workingMemory: Record<string, unknown>, opts?: {
|
|
58
|
+
nodeId?: string;
|
|
59
|
+
}): GraphEngineMemoryResolutionRoot;
|
|
60
|
+
/**
|
|
61
|
+
* Resolves a memory path against distinct roots (`input.*` and `inputs.*` do not cross-fallback).
|
|
62
|
+
*/
|
|
63
|
+
export declare function resolveGraphEngineMemoryPathValue(root: GraphEngineMemoryResolutionRoot, path: string): unknown;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves graph-engine smart-input / input-synthesis memory paths against RunTask-shaped
|
|
3
|
+
* or working-memory-shaped roots (`input`, `inputs`, etc.).
|
|
4
|
+
*/
|
|
5
|
+
import { splitGraphEngineMemoryPath } from './graphEngineMemoryPaths.js';
|
|
6
|
+
import { selectByPath } from './pathExpr.js';
|
|
7
|
+
function isPlainObject(v) {
|
|
8
|
+
return v != null && typeof v === 'object' && !Array.isArray(v);
|
|
9
|
+
}
|
|
10
|
+
function readInputsBag(container) {
|
|
11
|
+
if (!container)
|
|
12
|
+
return undefined;
|
|
13
|
+
const bag = container.inputs;
|
|
14
|
+
return isPlainObject(bag) ? bag : undefined;
|
|
15
|
+
}
|
|
16
|
+
function readInputObjectLayer(container) {
|
|
17
|
+
if (!container)
|
|
18
|
+
return undefined;
|
|
19
|
+
return isPlainObject(container.input) ? container.input : undefined;
|
|
20
|
+
}
|
|
21
|
+
/** MAIN `input` merge layer — omits `input.raw` (PRE synthesis container, not a model field). */
|
|
22
|
+
function readMainInputObjectLayer(container) {
|
|
23
|
+
const layer = readInputObjectLayer(container);
|
|
24
|
+
if (!layer)
|
|
25
|
+
return undefined;
|
|
26
|
+
const { raw: _raw, ...rest } = layer;
|
|
27
|
+
return Object.keys(rest).length > 0 ? rest : undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Caller / graph-entry `inputs` bag only (not merged with MAIN `input`).
|
|
31
|
+
*/
|
|
32
|
+
export function extractCallerInputsBag(args) {
|
|
33
|
+
const layers = [
|
|
34
|
+
readInputsBag(args.jobMemory),
|
|
35
|
+
readInputsBag(args.execution),
|
|
36
|
+
...(args.extraLayers ?? []).flatMap((wm) => (wm ? [readInputsBag(wm)] : [])),
|
|
37
|
+
];
|
|
38
|
+
const out = {};
|
|
39
|
+
for (const layer of layers) {
|
|
40
|
+
if (layer)
|
|
41
|
+
Object.assign(out, layer);
|
|
42
|
+
}
|
|
43
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* MAIN `RunTaskRequest.input` bucket: runtime MAIN object layers plus materialized node
|
|
47
|
+
* binding keys only. Does **not** merge the caller `inputs` bag (see {@link extractCallerInputsBag}).
|
|
48
|
+
*/
|
|
49
|
+
export function buildRunTaskMainInput(args) {
|
|
50
|
+
const layers = [
|
|
51
|
+
readMainInputObjectLayer(args.jobMemory),
|
|
52
|
+
readMainInputObjectLayer(args.execution),
|
|
53
|
+
...(args.extraLayers ?? []).flatMap((wm) => (wm ? [readMainInputObjectLayer(wm)] : [])),
|
|
54
|
+
args.nodeBindings,
|
|
55
|
+
];
|
|
56
|
+
const out = {};
|
|
57
|
+
for (const layer of layers) {
|
|
58
|
+
if (layer)
|
|
59
|
+
Object.assign(out, layer);
|
|
60
|
+
}
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
63
|
+
function resolveXynthesizedSubpath(xy, subRoot, tail) {
|
|
64
|
+
if (!xy)
|
|
65
|
+
return undefined;
|
|
66
|
+
if (subRoot === 'xynthesized.job') {
|
|
67
|
+
const job = xy.job;
|
|
68
|
+
return tail ? selectByPath(job, tail) : job;
|
|
69
|
+
}
|
|
70
|
+
if (subRoot === 'xynthesized.execution') {
|
|
71
|
+
const executionBucket = xy.execution;
|
|
72
|
+
return tail ? selectByPath(executionBucket, tail) : executionBucket;
|
|
73
|
+
}
|
|
74
|
+
const task = xy.task;
|
|
75
|
+
return tail ? selectByPath(task, tail) : task;
|
|
76
|
+
}
|
|
77
|
+
function resolveInputSubpath(root, tail) {
|
|
78
|
+
if (!tail)
|
|
79
|
+
return root.input;
|
|
80
|
+
return selectByPath(root.input, tail);
|
|
81
|
+
}
|
|
82
|
+
function resolveInputsSubpath(root, tail) {
|
|
83
|
+
if (!tail)
|
|
84
|
+
return root.inputs;
|
|
85
|
+
return selectByPath(root.inputs, tail);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Builds a resolution root for {@link resolveGraphEngineMemoryPathValue} from outbound runTask fields.
|
|
89
|
+
*/
|
|
90
|
+
export function buildGraphEngineMemoryResolutionRoot(args) {
|
|
91
|
+
const inputs = args.inputs ?? {};
|
|
92
|
+
const executionMemory = args.executionMemory;
|
|
93
|
+
const xy = args.xynthesized;
|
|
94
|
+
const jobVariables = isPlainObject(args.jobVariables)
|
|
95
|
+
? args.jobVariables
|
|
96
|
+
: isPlainObject(executionMemory?.jobVariables)
|
|
97
|
+
? executionMemory.jobVariables
|
|
98
|
+
: isPlainObject(executionMemory?.variables)
|
|
99
|
+
? executionMemory.variables
|
|
100
|
+
: undefined;
|
|
101
|
+
const taskVariables = isPlainObject(args.taskVariables)
|
|
102
|
+
? args.taskVariables
|
|
103
|
+
: isPlainObject(executionMemory?.taskVariables)
|
|
104
|
+
? executionMemory.taskVariables
|
|
105
|
+
: undefined;
|
|
106
|
+
return {
|
|
107
|
+
input: args.input,
|
|
108
|
+
inputs,
|
|
109
|
+
jobVariables,
|
|
110
|
+
taskVariables,
|
|
111
|
+
jobMemory: isPlainObject(args.jobMemory) ? args.jobMemory : undefined,
|
|
112
|
+
taskMemory: isPlainObject(args.taskMemory) ? args.taskMemory : undefined,
|
|
113
|
+
executionMemory,
|
|
114
|
+
xynthesized: xy
|
|
115
|
+
? {
|
|
116
|
+
job: xy.job,
|
|
117
|
+
task: xy.task,
|
|
118
|
+
execution: xy.execution ?? {},
|
|
119
|
+
}
|
|
120
|
+
: undefined,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Flat graphs-studio / host `workingMemory` object.
|
|
125
|
+
*/
|
|
126
|
+
export function buildGraphEngineMemoryResolutionRootFromWorkingMemory(workingMemory, opts) {
|
|
127
|
+
const execution = isPlainObject(workingMemory.execution)
|
|
128
|
+
? workingMemory.execution
|
|
129
|
+
: undefined;
|
|
130
|
+
const inputs = extractCallerInputsBag({
|
|
131
|
+
execution,
|
|
132
|
+
jobMemory: isPlainObject(workingMemory.jobMemory) ? workingMemory.jobMemory : undefined,
|
|
133
|
+
extraLayers: [workingMemory],
|
|
134
|
+
}) ?? {};
|
|
135
|
+
const input = buildRunTaskMainInput({
|
|
136
|
+
execution,
|
|
137
|
+
jobMemory: isPlainObject(workingMemory.jobMemory) ? workingMemory.jobMemory : undefined,
|
|
138
|
+
extraLayers: [workingMemory],
|
|
139
|
+
nodeBindings: isPlainObject(workingMemory.taskInput) ? workingMemory.taskInput : undefined,
|
|
140
|
+
});
|
|
141
|
+
const wmXy = isPlainObject(workingMemory.xynthesized) ? workingMemory.xynthesized : undefined;
|
|
142
|
+
const exXy = isPlainObject(execution?.xynthesized) ? execution.xynthesized : undefined;
|
|
143
|
+
const xySource = wmXy ?? exXy;
|
|
144
|
+
const job = (isPlainObject(xySource?.job) ? xySource.job : undefined) ??
|
|
145
|
+
(isPlainObject(exXy?.job) ? exXy.job : undefined) ??
|
|
146
|
+
{};
|
|
147
|
+
const nodeId = opts?.nodeId;
|
|
148
|
+
let task = {};
|
|
149
|
+
if (isPlainObject(xySource?.task)) {
|
|
150
|
+
task = xySource.task;
|
|
151
|
+
}
|
|
152
|
+
else if (nodeId && isPlainObject(xySource?.taskByNode)) {
|
|
153
|
+
const bucket = (xySource.taskByNode)[nodeId];
|
|
154
|
+
task = isPlainObject(bucket) ? bucket : {};
|
|
155
|
+
}
|
|
156
|
+
const executionBucket = (isPlainObject(xySource?.execution) ? xySource.execution : undefined) ??
|
|
157
|
+
(isPlainObject(exXy?.execution) ? exXy.execution : undefined) ??
|
|
158
|
+
{};
|
|
159
|
+
return buildGraphEngineMemoryResolutionRoot({
|
|
160
|
+
input,
|
|
161
|
+
inputs,
|
|
162
|
+
jobVariables: isPlainObject(execution?.jobVariables)
|
|
163
|
+
? execution.jobVariables
|
|
164
|
+
: isPlainObject(execution?.variables)
|
|
165
|
+
? execution.variables
|
|
166
|
+
: isPlainObject(workingMemory.variables)
|
|
167
|
+
? workingMemory.variables
|
|
168
|
+
: undefined,
|
|
169
|
+
taskVariables: isPlainObject(execution?.taskVariables) ? execution.taskVariables : undefined,
|
|
170
|
+
jobMemory: workingMemory.jobMemory,
|
|
171
|
+
taskMemory: workingMemory.taskMemory,
|
|
172
|
+
executionMemory: execution,
|
|
173
|
+
xynthesized: {
|
|
174
|
+
job: job,
|
|
175
|
+
task,
|
|
176
|
+
execution: executionBucket,
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Resolves a memory path against distinct roots (`input.*` and `inputs.*` do not cross-fallback).
|
|
182
|
+
*/
|
|
183
|
+
export function resolveGraphEngineMemoryPathValue(root, path) {
|
|
184
|
+
const trimmed = typeof path === 'string' ? path.trim() : '';
|
|
185
|
+
if (!trimmed)
|
|
186
|
+
return undefined;
|
|
187
|
+
const { root: rootKey, tail } = splitGraphEngineMemoryPath(trimmed);
|
|
188
|
+
switch (rootKey) {
|
|
189
|
+
case 'input':
|
|
190
|
+
return resolveInputSubpath(root, tail);
|
|
191
|
+
case 'inputs':
|
|
192
|
+
return resolveInputsSubpath(root, tail);
|
|
193
|
+
case 'xynthesized.job':
|
|
194
|
+
return resolveXynthesizedSubpath(root.xynthesized, 'xynthesized.job', tail);
|
|
195
|
+
case 'xynthesized.task':
|
|
196
|
+
return resolveXynthesizedSubpath(root.xynthesized, 'xynthesized.task', tail);
|
|
197
|
+
case 'xynthesized.execution':
|
|
198
|
+
return resolveXynthesizedSubpath(root.xynthesized, 'xynthesized.execution', tail);
|
|
199
|
+
case 'variables':
|
|
200
|
+
case 'jobVariables':
|
|
201
|
+
return tail ? selectByPath(root.jobVariables, tail) : root.jobVariables;
|
|
202
|
+
case 'taskVariables':
|
|
203
|
+
return tail ? selectByPath(root.taskVariables, tail) : root.taskVariables;
|
|
204
|
+
case 'jobMemory':
|
|
205
|
+
return tail ? selectByPath(root.jobMemory, tail) : root.jobMemory;
|
|
206
|
+
case 'taskMemory':
|
|
207
|
+
return tail ? selectByPath(root.taskMemory, tail) : root.taskMemory;
|
|
208
|
+
case 'executionMemory':
|
|
209
|
+
return tail ? selectByPath(root.executionMemory, tail) : root.executionMemory;
|
|
210
|
+
default:
|
|
211
|
+
return undefined;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RunxClient } from '@x12i/runx';
|
|
2
|
+
import type { GraphAiModelConfig, GraphModelAliasConfig, ModelConfigSelection, TaskNodeRuntimeObject } from '../types/refs.js';
|
|
3
|
+
import { conditionWhenSignature, isEmptyConditionWhen } from './modelConfigSelection.js';
|
|
4
|
+
import { type TaskNodeConditionEvalContext } from './taskNodeConditionsEvaluation.js';
|
|
5
|
+
export type ResolveModelConfigForNodeArgs = {
|
|
6
|
+
runtimeNodeConfig?: TaskNodeRuntimeObject;
|
|
7
|
+
nodeModelConfig?: unknown;
|
|
8
|
+
runtimeModelConfig?: ModelConfigSelection;
|
|
9
|
+
graphModelConfig?: ModelConfigSelection;
|
|
10
|
+
runtimeAliasConfig?: GraphModelAliasConfig;
|
|
11
|
+
conditionCtx: TaskNodeConditionEvalContext;
|
|
12
|
+
executionInput: Record<string, unknown>;
|
|
13
|
+
runx?: RunxClient;
|
|
14
|
+
};
|
|
15
|
+
export declare function resolveGraphAiModelConfigAliases(modelConfig: GraphAiModelConfig | undefined, aliasConfig: GraphModelAliasConfig | undefined): GraphAiModelConfig | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves effective model config for a task node (precedence + conditional cases + aliases).
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveModelConfigForNode(args: ResolveModelConfigForNodeArgs): Promise<GraphAiModelConfig | undefined>;
|
|
20
|
+
export { conditionWhenSignature, isEmptyConditionWhen };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { conditionWhenSignature, isEmptyConditionWhen, isGraphAiModelConfig, isModelConfigSelection, } from './modelConfigSelection.js';
|
|
2
|
+
import { evaluateConditionWhen } from './taskNodeConditionsEvaluation.js';
|
|
3
|
+
function resolveModelAlias(modelOrAlias, aliases) {
|
|
4
|
+
return aliases?.[modelOrAlias] ?? modelOrAlias;
|
|
5
|
+
}
|
|
6
|
+
function mergeAliasConfigs(root, node) {
|
|
7
|
+
if (root == null && node == null)
|
|
8
|
+
return undefined;
|
|
9
|
+
return { ...(root ?? {}), ...(node ?? {}) };
|
|
10
|
+
}
|
|
11
|
+
export function resolveGraphAiModelConfigAliases(modelConfig, aliasConfig) {
|
|
12
|
+
if (!isGraphAiModelConfig(modelConfig))
|
|
13
|
+
return undefined;
|
|
14
|
+
return {
|
|
15
|
+
xynthesisModel: resolveModelAlias(modelConfig.xynthesisModel, aliasConfig),
|
|
16
|
+
skillModel: resolveModelAlias(modelConfig.skillModel, aliasConfig),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async function selectFromCases(selection, ctx, executionInput, runx) {
|
|
20
|
+
const cases = selection.cases;
|
|
21
|
+
if (!Array.isArray(cases) || cases.length === 0)
|
|
22
|
+
return undefined;
|
|
23
|
+
let defaultCase;
|
|
24
|
+
for (const c of cases) {
|
|
25
|
+
if (isEmptyConditionWhen(c.when)) {
|
|
26
|
+
defaultCase = c;
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (c.when == null)
|
|
30
|
+
continue;
|
|
31
|
+
const ev = await evaluateConditionWhen(c.when, ctx, executionInput, { runx });
|
|
32
|
+
if (ev.error)
|
|
33
|
+
continue;
|
|
34
|
+
if (ev.ok && isGraphAiModelConfig(c.modelConfig)) {
|
|
35
|
+
return c.modelConfig;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (defaultCase != null && isGraphAiModelConfig(defaultCase.modelConfig)) {
|
|
39
|
+
return defaultCase.modelConfig;
|
|
40
|
+
}
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
async function resolveTier(value, ctx, executionInput, runx) {
|
|
44
|
+
if (isGraphAiModelConfig(value))
|
|
45
|
+
return value;
|
|
46
|
+
if (isModelConfigSelection(value)) {
|
|
47
|
+
return selectFromCases(value, ctx, executionInput, runx);
|
|
48
|
+
}
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Resolves effective model config for a task node (precedence + conditional cases + aliases).
|
|
53
|
+
*/
|
|
54
|
+
export async function resolveModelConfigForNode(args) {
|
|
55
|
+
const aliasConfig = mergeAliasConfigs(args.runtimeAliasConfig, args.runtimeNodeConfig?.aliasConfig);
|
|
56
|
+
const staticHost = args.runtimeNodeConfig?.modelConfig;
|
|
57
|
+
if (isGraphAiModelConfig(staticHost)) {
|
|
58
|
+
return resolveGraphAiModelConfigAliases(staticHost, aliasConfig);
|
|
59
|
+
}
|
|
60
|
+
const tiers = [args.nodeModelConfig, args.runtimeModelConfig, args.graphModelConfig];
|
|
61
|
+
for (const tier of tiers) {
|
|
62
|
+
const selected = await resolveTier(tier, args.conditionCtx, args.executionInput, args.runx);
|
|
63
|
+
if (selected != null) {
|
|
64
|
+
return resolveGraphAiModelConfigAliases(selected, aliasConfig);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
export { conditionWhenSignature, isEmptyConditionWhen };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { NarrixPreProcessorConfig, ResolvedNarrixWirePayload } from '../types/narrix.js';
|
|
2
|
+
import type { AiTaskProfileMetadata } from '../types/aiTaskProfile.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves outbound `RunTaskRequest.narrix`: starts from node taskConfiguration (authoring shape, no web fields),
|
|
5
|
+
* shallow-merges graph-level `variables.narrix` discovery fields, then derives web-scope fields from
|
|
6
|
+
* `taskConfiguration.aiTaskProfile.webScoping` via {@link applyAiTaskProfileWebScopingToNarrix}.
|
|
7
|
+
*
|
|
8
|
+
* Shared by {@link ExellixGraphRuntime}.
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveNarrixForTaskNode(args: {
|
|
11
|
+
nodeMetadataNarrix: NarrixPreProcessorConfig | undefined;
|
|
12
|
+
graphVariablesNarrix: Partial<NarrixPreProcessorConfig> | undefined;
|
|
13
|
+
aiTaskProfile: AiTaskProfileMetadata | undefined;
|
|
14
|
+
}): ResolvedNarrixWirePayload | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { applyAiTaskProfileWebScopingToNarrix } from './applyAiTaskProfileWebScopingToNarrix.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves outbound `RunTaskRequest.narrix`: starts from node taskConfiguration (authoring shape, no web fields),
|
|
4
|
+
* shallow-merges graph-level `variables.narrix` discovery fields, then derives web-scope fields from
|
|
5
|
+
* `taskConfiguration.aiTaskProfile.webScoping` via {@link applyAiTaskProfileWebScopingToNarrix}.
|
|
6
|
+
*
|
|
7
|
+
* Shared by {@link ExellixGraphRuntime}.
|
|
8
|
+
*/
|
|
9
|
+
export function resolveNarrixForTaskNode(args) {
|
|
10
|
+
let resolved = args.nodeMetadataNarrix != null ? { ...args.nodeMetadataNarrix } : undefined;
|
|
11
|
+
const graphNarrix = args.graphVariablesNarrix;
|
|
12
|
+
if (graphNarrix) {
|
|
13
|
+
resolved = {
|
|
14
|
+
...graphNarrix,
|
|
15
|
+
...(resolved ?? {}),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return applyAiTaskProfileWebScopingToNarrix(resolved, args.aiTaskProfile);
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GraphNode } from '../types/refs.js';
|
|
2
|
+
import { SkillKeyResolutionOptions } from '../types/options.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves skillKey from a node. 5.x reads only the canonical `node.skillKey`.
|
|
5
|
+
* Legacy aliases on `node.data.skillKey` / `node.metadata.skillKey` are rejected
|
|
6
|
+
* by `assertCanonicalGraphDocument` before execution.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveTaskKey(node: GraphNode, options?: SkillKeyResolutionOptions, context?: {
|
|
9
|
+
jobId?: string;
|
|
10
|
+
graphId?: string;
|
|
11
|
+
}): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ExellixGraphError } from '../errors/ExellixGraphError.js';
|
|
2
|
+
import { ExellixGraphErrorCode } from '../errors/exellixGraphErrorCodes.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves skillKey from a node. 5.x reads only the canonical `node.skillKey`.
|
|
5
|
+
* Legacy aliases on `node.data.skillKey` / `node.metadata.skillKey` are rejected
|
|
6
|
+
* by `assertCanonicalGraphDocument` before execution.
|
|
7
|
+
*/
|
|
8
|
+
export function resolveTaskKey(node, options = {}, context) {
|
|
9
|
+
const { allowFallbackToNodeId = false, fallbackPrefix = 'tasks/', aliases = {}, } = options;
|
|
10
|
+
if (node.skillKey) {
|
|
11
|
+
return applyAlias(node.skillKey, aliases);
|
|
12
|
+
}
|
|
13
|
+
if (allowFallbackToNodeId) {
|
|
14
|
+
return `${fallbackPrefix}${node.id}`;
|
|
15
|
+
}
|
|
16
|
+
throw new ExellixGraphError(ExellixGraphErrorCode.NODE_SKILLKEY_MISSING, `Node ${node.id} does not specify a skillKey. Set node.skillKey in graph JSON.`, {
|
|
17
|
+
jobId: context?.jobId,
|
|
18
|
+
graphId: context?.graphId,
|
|
19
|
+
nodeId: node.id,
|
|
20
|
+
nodeType: node.type,
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Applies alias mapping if present
|
|
25
|
+
*/
|
|
26
|
+
function applyAlias(skillKey, aliases) {
|
|
27
|
+
return aliases[skillKey] || skillKey;
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TaskNode } from '../types/refs.js';
|
|
2
|
+
import { type ExecutionVariableBuckets } from './executionVariableBuckets.js';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves `node.taskVariable` into concrete values for `RunTaskRequest.input`.
|
|
5
|
+
* `$path` refs resolve against the matching execution bucket only (no cross-bucket merge).
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveTaskNodeTaskVariableForRunTask(args: {
|
|
8
|
+
node: TaskNode;
|
|
9
|
+
buckets: ExecutionVariableBuckets;
|
|
10
|
+
}): Record<string, unknown>;
|
|
11
|
+
/**
|
|
12
|
+
* Resolves runtime payload bindings from `node.inputsConfig` only (plus deprecated aliases).
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveTaskNodeInputBindingsForRunTask(args: {
|
|
15
|
+
node: TaskNode;
|
|
16
|
+
execution: Record<string, unknown>;
|
|
17
|
+
}): Record<string, unknown>;
|
|
18
|
+
/**
|
|
19
|
+
* Resolves task-node model input for MAIN `RunTaskRequest.input`:
|
|
20
|
+
* `taskVariable` plus execution-memory bindings (separate buckets, no merge).
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveTaskNodeInputsForRunTask(args: {
|
|
23
|
+
node: TaskNode;
|
|
24
|
+
execution: Record<string, unknown>;
|
|
25
|
+
}): Record<string, unknown>;
|