@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,204 @@
|
|
|
1
|
+
import { analyzeRunTaskRequest, validateRunTaskConfig, validateRunTaskInvoke, } from '@exellix/ai-tasks';
|
|
2
|
+
import { resolveTaskKey } from './resolveTaskKey.js';
|
|
3
|
+
import { isLocalSkillKey } from './localSkills/index.js';
|
|
4
|
+
import { buildAiTasksRunTaskRequest, extractRunTaskStrategyOverrides, } from './buildAiTasksRunTaskRequest.js';
|
|
5
|
+
import { resolveExecutionPipelineForTaskNode } from './resolveExecutionPipelineForTaskNode.js';
|
|
6
|
+
import { resolveTaskNodeInputsForRunTask } from './resolveTaskNodeInputs.js';
|
|
7
|
+
import { assertAiTasksNodeExtensionsValid } from '../inspection/validateAiTasksNodeExtensions.js';
|
|
8
|
+
import { buildRunTaskMainInput, extractCallerInputsBag } from './resolveGraphEngineMemoryPaths.js';
|
|
9
|
+
import { mirrorRuntimeInputRawOnExecutionMemory, mirrorStructuredInputOntoExecutionMemory, } from './materializeStructuredRunTaskInput.js';
|
|
10
|
+
import { xynthesizedOutboundForNode } from './graphRunExecutionSeed.js';
|
|
11
|
+
import { buildTaskNodeJobContext } from './buildTaskNodeJobContext.js';
|
|
12
|
+
import { resolveNarrixForTaskNode } from './resolveNarrixForTaskNode.js';
|
|
13
|
+
import { normalizeSynthesizedContextConfig } from './synthesizedContextPipeline.js';
|
|
14
|
+
import { buildRunTaskIdentityEnvelope, mergeDefinedLlmCallParts, shouldForwardRunTaskTraceMode, } from './runTaskAugments.js';
|
|
15
|
+
import { mirrorTaskVariablesOnExecution, readExecutionVariableBuckets, } from './executionVariableBuckets.js';
|
|
16
|
+
import { newGraphRunTaskId } from './graphRunIdentity.js';
|
|
17
|
+
function isPlainRecord(v) {
|
|
18
|
+
return v != null && typeof v === 'object' && !Array.isArray(v);
|
|
19
|
+
}
|
|
20
|
+
function mergeKnowledgePatchIntoRunTaskMemory(memory, patch) {
|
|
21
|
+
if (patch == null)
|
|
22
|
+
return memory;
|
|
23
|
+
const base = isPlainRecord(memory) ? { ...memory } : {};
|
|
24
|
+
const existingKnowledge = isPlainRecord(base.knowledge) ? base.knowledge : {};
|
|
25
|
+
return {
|
|
26
|
+
...base,
|
|
27
|
+
knowledge: {
|
|
28
|
+
...existingKnowledge,
|
|
29
|
+
...patch,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Materialize the outbound `RunTaskRequest` graph-engine would send for a task node
|
|
35
|
+
* (mirrors `executeNode` request assembly; does not run PRE strategy phases or `runTask`).
|
|
36
|
+
*/
|
|
37
|
+
export function buildTaskNodeRunTaskRequest(args) {
|
|
38
|
+
const node = args.node;
|
|
39
|
+
if (node.type === 'finalizer') {
|
|
40
|
+
return { runnable: false, skillKey: 'finalizer', reason: 'finalizer' };
|
|
41
|
+
}
|
|
42
|
+
const runTaskJobIdStr = String(args.runTaskJobId ?? args.job?.jobId ?? args.job?.id ?? '');
|
|
43
|
+
const lifecycleJobId = runTaskJobIdStr || 'standalone-job';
|
|
44
|
+
const graphRunTaskId = args.graphRunTaskId ?? newGraphRunTaskId();
|
|
45
|
+
const skillKey = resolveTaskKey(node, args.skillKeyResolution ?? {}, {
|
|
46
|
+
jobId: runTaskJobIdStr || undefined,
|
|
47
|
+
graphId: args.graphId,
|
|
48
|
+
});
|
|
49
|
+
if (isLocalSkillKey(skillKey)) {
|
|
50
|
+
return { runnable: false, skillKey, reason: 'local_skill' };
|
|
51
|
+
}
|
|
52
|
+
assertAiTasksNodeExtensionsValid(node, `nodes.${String(node.id)}`);
|
|
53
|
+
let execution = args.execution != null && typeof args.execution === 'object' && !Array.isArray(args.execution)
|
|
54
|
+
? { ...args.execution }
|
|
55
|
+
: {};
|
|
56
|
+
mirrorTaskVariablesOnExecution({
|
|
57
|
+
execution,
|
|
58
|
+
node: node,
|
|
59
|
+
runtimeTaskVariables: args.taskVariables,
|
|
60
|
+
});
|
|
61
|
+
const executionPipeline = resolveExecutionPipelineForTaskNode({
|
|
62
|
+
node,
|
|
63
|
+
optionsExecutionPipeline: args.graphExecutionPipeline,
|
|
64
|
+
executionExecutionPipeline: execution.executionPipeline,
|
|
65
|
+
});
|
|
66
|
+
const hasSynthesizedContextPreStep = Array.isArray(executionPipeline) &&
|
|
67
|
+
executionPipeline.some((s) => s.phase === 'pre' && s.type === 'synthesized-context');
|
|
68
|
+
const preStepConfig = hasSynthesizedContextPreStep && Array.isArray(executionPipeline)
|
|
69
|
+
? normalizeSynthesizedContextConfig(executionPipeline.find((s) => s.phase === 'pre' && s.type === 'synthesized-context')?.config)
|
|
70
|
+
: undefined;
|
|
71
|
+
const includeContextInPrompt = hasSynthesizedContextPreStep && preStepConfig?.autoEnableContext !== true;
|
|
72
|
+
const variableBuckets = readExecutionVariableBuckets(execution);
|
|
73
|
+
const jobVariables = variableBuckets.jobVariables;
|
|
74
|
+
const hasExistingSynthesizedContext = execution.synthesizedContext != null;
|
|
75
|
+
const clearSynthForTask = args.clearSynthesizedContextPerNode === true &&
|
|
76
|
+
hasSynthesizedContextPreStep &&
|
|
77
|
+
hasExistingSynthesizedContext;
|
|
78
|
+
mirrorRuntimeInputRawOnExecutionMemory(execution);
|
|
79
|
+
const nodeBindings = resolveTaskNodeInputsForRunTask({ node, execution });
|
|
80
|
+
const jobContext = buildTaskNodeJobContext({
|
|
81
|
+
node,
|
|
82
|
+
jobMemory: args.jobMemory,
|
|
83
|
+
executionMemory: execution,
|
|
84
|
+
variables: jobVariables,
|
|
85
|
+
});
|
|
86
|
+
const narrix = resolveNarrixForTaskNode({
|
|
87
|
+
nodeMetadataNarrix: node.taskConfiguration?.narrix != null
|
|
88
|
+
? { ...node.taskConfiguration.narrix }
|
|
89
|
+
: undefined,
|
|
90
|
+
graphVariablesNarrix: jobVariables?.narrix,
|
|
91
|
+
aiTaskProfile: node.taskConfiguration?.aiTaskProfile,
|
|
92
|
+
});
|
|
93
|
+
const metaTk = node.taskConfiguration?.taskKind;
|
|
94
|
+
const taskKindForward = metaTk === 'decision' || metaTk === 'utility' || metaTk === 'content' ? metaTk : undefined;
|
|
95
|
+
const autoValDec = node.taskConfiguration?.autoValidateDecisionOutput;
|
|
96
|
+
const executionForTask = clearSynthForTask
|
|
97
|
+
? (() => {
|
|
98
|
+
const c = { ...execution };
|
|
99
|
+
delete c.synthesizedContext;
|
|
100
|
+
return c;
|
|
101
|
+
})()
|
|
102
|
+
: execution;
|
|
103
|
+
const callerInputs = extractCallerInputsBag({
|
|
104
|
+
execution,
|
|
105
|
+
jobMemory: isPlainRecord(args.jobMemory) ? args.jobMemory : undefined,
|
|
106
|
+
});
|
|
107
|
+
const taskInput = buildRunTaskMainInput({
|
|
108
|
+
execution,
|
|
109
|
+
jobMemory: isPlainRecord(args.jobMemory) ? args.jobMemory : undefined,
|
|
110
|
+
nodeBindings: {
|
|
111
|
+
...nodeBindings,
|
|
112
|
+
...(node.data?.upstreamNodeIds !== undefined ? { upstreamNodeIds: node.data.upstreamNodeIds } : {}),
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
mirrorStructuredInputOntoExecutionMemory(executionForTask, taskInput);
|
|
116
|
+
const runTaskJobMemory = mergeKnowledgePatchIntoRunTaskMemory(args.jobMemory, args.jobKnowledgePatch);
|
|
117
|
+
const runTaskTaskMemory = mergeKnowledgePatchIntoRunTaskMemory(args.taskMemory, args.taskKnowledgePatch);
|
|
118
|
+
const effectiveLlmCall = mergeDefinedLlmCallParts(args.runtimeLlmCall, args.llmCall, node.taskConfiguration?.llmCall);
|
|
119
|
+
const forwardRunTaskTrace = shouldForwardRunTaskTraceMode({
|
|
120
|
+
runTaskExecutionMode: args.runTaskExecutionMode,
|
|
121
|
+
});
|
|
122
|
+
const metaStrats = node.taskConfiguration?.executionStrategies;
|
|
123
|
+
const ov = node.taskConfiguration?.aiTasksOutputValidation;
|
|
124
|
+
const request = buildAiTasksRunTaskRequest({
|
|
125
|
+
skillKey,
|
|
126
|
+
job: args.job,
|
|
127
|
+
nodeId: String(node.id),
|
|
128
|
+
taskConfiguration: node.taskConfiguration,
|
|
129
|
+
graphId: args.graphId,
|
|
130
|
+
taskId: graphRunTaskId,
|
|
131
|
+
runTaskJobId: lifecycleJobId,
|
|
132
|
+
taskInput,
|
|
133
|
+
callerInputs,
|
|
134
|
+
variables: jobVariables,
|
|
135
|
+
jobMemory: runTaskJobMemory,
|
|
136
|
+
taskMemory: runTaskTaskMemory,
|
|
137
|
+
executionMemory: executionForTask,
|
|
138
|
+
jobContext,
|
|
139
|
+
prevNodeId: args.prevNodeId,
|
|
140
|
+
executionPipeline: executionPipeline,
|
|
141
|
+
includeContextInPrompt: includeContextInPrompt === true ? true : undefined,
|
|
142
|
+
narrix: narrix ?? undefined,
|
|
143
|
+
...extractRunTaskStrategyOverrides(node.taskConfiguration),
|
|
144
|
+
outputValidation: ov != null && typeof ov === 'object' && !Array.isArray(ov) && 'schema' in ov
|
|
145
|
+
? ov
|
|
146
|
+
: undefined,
|
|
147
|
+
diagnostics: args.runTaskDiagnostics,
|
|
148
|
+
modelConfig: args.modelConfig ?? undefined,
|
|
149
|
+
llmCall: effectiveLlmCall,
|
|
150
|
+
identity: buildRunTaskIdentityEnvelope({
|
|
151
|
+
base: args.runTaskIdentity,
|
|
152
|
+
nodeMeta: node.taskConfiguration,
|
|
153
|
+
graphId: args.graphId,
|
|
154
|
+
nodeId: String(node.id),
|
|
155
|
+
taskId: graphRunTaskId,
|
|
156
|
+
jobId: lifecycleJobId,
|
|
157
|
+
}),
|
|
158
|
+
executionMode: forwardRunTaskTrace ? 'trace' : undefined,
|
|
159
|
+
taskKind: taskKindForward,
|
|
160
|
+
autoValidateDecisionOutput: typeof autoValDec === 'boolean' ? autoValDec : undefined,
|
|
161
|
+
executionStrategies: Array.isArray(metaStrats) ? metaStrats : [],
|
|
162
|
+
xynthesized: xynthesizedOutboundForNode(execution, String(node.id)),
|
|
163
|
+
smartInput: node.smartInput,
|
|
164
|
+
});
|
|
165
|
+
return { runnable: true, skillKey, request };
|
|
166
|
+
}
|
|
167
|
+
/** Static ai-tasks validation on the graph-built {@link RunTaskRequest}. */
|
|
168
|
+
export function validateTaskNodeRunTaskConfig(args) {
|
|
169
|
+
const built = buildTaskNodeRunTaskRequest(args);
|
|
170
|
+
if (!built.runnable) {
|
|
171
|
+
return { skipped: true, skillKey: built.skillKey, reason: built.reason };
|
|
172
|
+
}
|
|
173
|
+
const validation = validateRunTaskConfig(built.request);
|
|
174
|
+
return { skipped: false, skillKey: built.skillKey, request: built.request, ...validation };
|
|
175
|
+
}
|
|
176
|
+
/** Config + payload + template path validation via ai-tasks {@link validateRunTaskInvoke}. */
|
|
177
|
+
export async function validateTaskNodeRunTaskInvoke(args) {
|
|
178
|
+
const built = buildTaskNodeRunTaskRequest(args);
|
|
179
|
+
if (!built.runnable) {
|
|
180
|
+
return { skipped: true, skillKey: built.skillKey, reason: built.reason };
|
|
181
|
+
}
|
|
182
|
+
const invokeParams = {
|
|
183
|
+
analyzeTemplates: args.analyzeTemplates,
|
|
184
|
+
templateResolver: args.templateResolver,
|
|
185
|
+
instructions: args.instructions,
|
|
186
|
+
prompt: args.prompt,
|
|
187
|
+
checkTemplateResolution: args.checkTemplateResolution,
|
|
188
|
+
checkSmartInputRender: args.checkSmartInputRender,
|
|
189
|
+
};
|
|
190
|
+
const validation = await validateRunTaskInvoke({
|
|
191
|
+
request: built.request,
|
|
192
|
+
...invokeParams,
|
|
193
|
+
});
|
|
194
|
+
return { skipped: false, skillKey: built.skillKey, request: built.request, ...validation };
|
|
195
|
+
}
|
|
196
|
+
/** Catalox-backed skill request analysis on the graph-built {@link RunTaskRequest}. */
|
|
197
|
+
export async function analyzeTaskNodeRunTaskRequest(args) {
|
|
198
|
+
const built = buildTaskNodeRunTaskRequest(args);
|
|
199
|
+
if (!built.runnable) {
|
|
200
|
+
return { skipped: true, skillKey: built.skillKey, reason: built.reason };
|
|
201
|
+
}
|
|
202
|
+
const analysis = await analyzeRunTaskRequest(args.catalox, built.request, args.analyzeOptions);
|
|
203
|
+
return { ...analysis, skipped: false, skillKey: built.skillKey, request: built.request };
|
|
204
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Graph } from '../types/refs.js';
|
|
2
|
+
/** Top-level keys permitted on a canonical exellix-graph executable graph JSON document. */
|
|
3
|
+
export declare const CANONICAL_GRAPH_TOP_LEVEL_KEYS: readonly ["id", "version", "modelConfig", "jobKnowledge", "nodes", "edges", "variables", "response", "metadata"];
|
|
4
|
+
/**
|
|
5
|
+
* Returns top-level keys on `graph` that are not part of the canonical executable document contract.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getCanonicalGraphDocumentViolations(graph: unknown): string[];
|
|
8
|
+
/** Single-node validation. Throws `NON_CANONICAL_TASK_NODE` on the first canonical violation. */
|
|
9
|
+
export declare function assertCanonicalTaskNode(node: unknown, context?: {
|
|
10
|
+
jobId?: string;
|
|
11
|
+
graphId?: string;
|
|
12
|
+
nodeIndex?: number;
|
|
13
|
+
}): void;
|
|
14
|
+
/**
|
|
15
|
+
* Throws {@link ExellixGraphError} when the value is not a canonical graph document
|
|
16
|
+
* (forbidden top-level keys, record-keyed `nodes`, root `outputConstraints`, or any
|
|
17
|
+
* legacy task-node alias). Upstream producers must emit only model fields (`id`,
|
|
18
|
+
* optional `version`, `modelConfig`, `jobKnowledge`, `nodes`, `edges`,
|
|
19
|
+
* `variables`, required `response`, and `metadata`); runtime fields belong under the execution
|
|
20
|
+
* request `runtime` object.
|
|
21
|
+
*/
|
|
22
|
+
export declare function assertCanonicalGraphDocument(graph: Graph, context?: {
|
|
23
|
+
jobId?: string;
|
|
24
|
+
graphId?: string;
|
|
25
|
+
}): void;
|