@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,747 @@
|
|
|
1
|
+
import type { SmartInputConfig } from './aiTasksDerivedTypes.js';
|
|
2
|
+
import type { TaskNodeTaskConfiguration } from './taskNodeConfiguration.js';
|
|
3
|
+
/**
|
|
4
|
+
* One step in `TaskNode.executionPipeline`. Same shape as `ExecutionStepOption` in `options.ts`
|
|
5
|
+
* (declared here to avoid a circular import between `refs.ts` and `options.ts`).
|
|
6
|
+
*/
|
|
7
|
+
export type TaskNodeExecutionPipelineStep = {
|
|
8
|
+
phase: 'pre' | 'main' | 'post';
|
|
9
|
+
type: string;
|
|
10
|
+
config?: unknown;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Type references for graph execution
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Explicit AI model selection carried by graph model/runtime contracts.
|
|
17
|
+
* Values may be concrete model ids or runtime aliases resolved before `runTask`.
|
|
18
|
+
*/
|
|
19
|
+
export type GraphAiModelConfig = {
|
|
20
|
+
xynthesisModel: string;
|
|
21
|
+
skillModel: string;
|
|
22
|
+
};
|
|
23
|
+
/** Runtime alias map used to resolve GraphAiModelConfig values before dispatch. */
|
|
24
|
+
export type GraphModelAliasConfig = Record<string, string>;
|
|
25
|
+
/** Runtime overrides for a single task node, stored at GraphRuntimeObject.nodes[nodeId]. */
|
|
26
|
+
export type TaskNodeRuntimeObject = {
|
|
27
|
+
modelConfig?: GraphAiModelConfig;
|
|
28
|
+
aliasConfig?: GraphModelAliasConfig;
|
|
29
|
+
};
|
|
30
|
+
/** Backwards-readable alias for per-node runtime overrides keyed by task node id. */
|
|
31
|
+
export type GraphRuntimeNodeConfig = TaskNodeRuntimeObject;
|
|
32
|
+
/** Schema version for structured record gates on `conditions.dataFilters` (and optional `graphEntry.dataFilters`). */
|
|
33
|
+
export declare const EXELLIX_STRUCTURED_DATA_FILTERS_V1: "exellix.dataFilters.v1";
|
|
34
|
+
/**
|
|
35
|
+
* Deterministic JSON gate: same recursive shape as {@link GraphPredicate}, but every leaf `path`
|
|
36
|
+
* must be `data` or `data.*` and is evaluated against the host-supplied **record** object (the
|
|
37
|
+
* object whose properties back those paths). See `evaluateStructuredDataFilters` in the runtime.
|
|
38
|
+
*/
|
|
39
|
+
export type StructuredDataFiltersV1 = {
|
|
40
|
+
version: typeof EXELLIX_STRUCTURED_DATA_FILTERS_V1;
|
|
41
|
+
when: GraphPredicate;
|
|
42
|
+
};
|
|
43
|
+
/** Legacy catalog ids (`string[]`) or structured v1 gate. */
|
|
44
|
+
export type ConditionsDataFilters = string[] | StructuredDataFiltersV1;
|
|
45
|
+
export type GraphPredicate = {
|
|
46
|
+
/** Dot-path into evaluation context (executionMemory/variables/jobMemory/taskMemory). */
|
|
47
|
+
path: string;
|
|
48
|
+
/** True when the value is neither null nor undefined. */
|
|
49
|
+
exists?: boolean;
|
|
50
|
+
/** Strict equality comparison. */
|
|
51
|
+
eq?: any;
|
|
52
|
+
} | {
|
|
53
|
+
all: GraphPredicate[];
|
|
54
|
+
} | {
|
|
55
|
+
any: GraphPredicate[];
|
|
56
|
+
} | {
|
|
57
|
+
not: GraphPredicate;
|
|
58
|
+
};
|
|
59
|
+
export interface GraphEdge {
|
|
60
|
+
/** Source node id. */
|
|
61
|
+
from: string;
|
|
62
|
+
/** Destination node id (depends on `from`). */
|
|
63
|
+
to: string;
|
|
64
|
+
/** Optional predicate controlling whether this dependency edge is active. */
|
|
65
|
+
when?: GraphPredicate;
|
|
66
|
+
[key: string]: any;
|
|
67
|
+
}
|
|
68
|
+
export type OutputSchema = {
|
|
69
|
+
type: 'object';
|
|
70
|
+
required?: string[];
|
|
71
|
+
properties?: Record<string, {
|
|
72
|
+
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
73
|
+
}>;
|
|
74
|
+
additionalProperties?: boolean;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Optional authoring / documentation block: human-readable titles and questions next to framework ids.
|
|
78
|
+
* Not read by exellix-graph execution; not merged into `RunTaskRequest.narrix` (only `metadata.narrix` is forwarded).
|
|
79
|
+
*/
|
|
80
|
+
/**
|
|
81
|
+
* Classifies the role of a node in terms of question-answering, for graph-browsing tools and human readers.
|
|
82
|
+
* - `contextual-data` — scoped-data-reader reading background context for this entity
|
|
83
|
+
* - `upstream-verdict` — scoped-data-reader reading a verdict written by an earlier graph in the pipeline
|
|
84
|
+
* - `inference` — deterministic-rule deriving a verdict/label from available data
|
|
85
|
+
* - `routing` — deterministic-rule deciding which execution branch to follow
|
|
86
|
+
* - `llm-analysis` — professional-answer asking an LLM to reason over evidence
|
|
87
|
+
* - `assembly` — scoped-answer-assembler merging node outputs into a persistence payload
|
|
88
|
+
* - `persistence` — scoped-answer-writer writing assembled answers to x-scoped-data
|
|
89
|
+
*/
|
|
90
|
+
export type GraphReadabilityKind = 'contextual-data' | 'upstream-verdict' | 'inference' | 'routing' | 'llm-analysis' | 'assembly' | 'persistence';
|
|
91
|
+
export type GraphReadability = {
|
|
92
|
+
/** Short label when scanning graph JSON or building UIs */
|
|
93
|
+
title?: string;
|
|
94
|
+
/** Plain-language question or intent (may match or shorten `inputs.question`) */
|
|
95
|
+
asks?: string;
|
|
96
|
+
/** Classifies the node's question-answering role — see GraphReadabilityKind */
|
|
97
|
+
kind?: GraphReadabilityKind;
|
|
98
|
+
/**
|
|
99
|
+
* Key fields this node reads from scoped storage.
|
|
100
|
+
* Applicable to `contextual-data` and `upstream-verdict` nodes.
|
|
101
|
+
* Makes the scope-map contents visible without cross-referencing the scopingMapId.
|
|
102
|
+
* Declares expected answer keys for authors and graph UIs; the engine loads the full scoped `answer` row (see `.docs/exellix-graph-format.md` — scoped entity reads vs graph-level reads).
|
|
103
|
+
*/
|
|
104
|
+
reads?: string[];
|
|
105
|
+
/**
|
|
106
|
+
* Possible output values or tier names this node can produce.
|
|
107
|
+
* Applicable to `inference`, `routing`, and `llm-analysis` nodes.
|
|
108
|
+
* For routing nodes, each entry describes a tier and its gate condition.
|
|
109
|
+
*/
|
|
110
|
+
produces?: string[];
|
|
111
|
+
/** Echo ids that appear elsewhere on the node for grep-friendly reading */
|
|
112
|
+
ids?: {
|
|
113
|
+
narrixQuestionId?: string;
|
|
114
|
+
skillKey?: string;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
export type FinalizerInputBinding = {
|
|
118
|
+
type: 'executionMemoryPath';
|
|
119
|
+
path: string;
|
|
120
|
+
optional?: boolean;
|
|
121
|
+
} | {
|
|
122
|
+
type: 'outputsMemoryPath';
|
|
123
|
+
path: string;
|
|
124
|
+
optional?: boolean;
|
|
125
|
+
} | {
|
|
126
|
+
type: 'literal';
|
|
127
|
+
value: unknown;
|
|
128
|
+
};
|
|
129
|
+
export type GraphResponseMissingBehavior = 'omit' | 'null';
|
|
130
|
+
export type GraphResponseSelector = {
|
|
131
|
+
type: 'outputsMemoryPath';
|
|
132
|
+
path: string;
|
|
133
|
+
} | {
|
|
134
|
+
type: 'executionMemoryPath';
|
|
135
|
+
path: string;
|
|
136
|
+
} | {
|
|
137
|
+
type: 'executionPath';
|
|
138
|
+
path: string;
|
|
139
|
+
} | {
|
|
140
|
+
type: 'nodeMetadata';
|
|
141
|
+
nodeId: string;
|
|
142
|
+
path: string;
|
|
143
|
+
} | {
|
|
144
|
+
type: 'nodeInputsConfig';
|
|
145
|
+
nodeId: string;
|
|
146
|
+
path: string;
|
|
147
|
+
}
|
|
148
|
+
/** @deprecated Use `nodeInputsConfig`. */
|
|
149
|
+
| {
|
|
150
|
+
type: 'nodeInputs';
|
|
151
|
+
nodeId: string;
|
|
152
|
+
path: string;
|
|
153
|
+
} | {
|
|
154
|
+
type: 'literal';
|
|
155
|
+
value: unknown;
|
|
156
|
+
} | {
|
|
157
|
+
type: 'firstPresent';
|
|
158
|
+
sources: GraphResponseSelector[];
|
|
159
|
+
};
|
|
160
|
+
export type GraphResponseShape = unknown;
|
|
161
|
+
export type GraphResponseDefinition = {
|
|
162
|
+
/** Default: "omit". When "null", missing selector values are materialized as null. */
|
|
163
|
+
missing?: GraphResponseMissingBehavior;
|
|
164
|
+
shape: GraphResponseShape;
|
|
165
|
+
};
|
|
166
|
+
/** @deprecated Use root-level GraphResponseDefinition at GraphModelObject.response. */
|
|
167
|
+
export type GraphResponseMappingTarget = 'finalOutput';
|
|
168
|
+
/** @deprecated Use GraphResponseMissingBehavior. */
|
|
169
|
+
export type GraphResponseMappingMissingBehavior = GraphResponseMissingBehavior;
|
|
170
|
+
/** @deprecated Use GraphResponseSelector. */
|
|
171
|
+
export type GraphResponseMappingSelector = GraphResponseSelector;
|
|
172
|
+
/** @deprecated Use root-level GraphResponseDefinition at GraphModelObject.response. */
|
|
173
|
+
export type GraphResponseMapping = {
|
|
174
|
+
version: 'graphResponseMapping.v1';
|
|
175
|
+
target?: GraphResponseMappingTarget;
|
|
176
|
+
/** Default: "omit". When "null", missing selector values are materialized as null. */
|
|
177
|
+
missing?: GraphResponseMappingMissingBehavior;
|
|
178
|
+
shape: unknown;
|
|
179
|
+
};
|
|
180
|
+
export type AggregateExpr = {
|
|
181
|
+
kind: 'input';
|
|
182
|
+
name: string;
|
|
183
|
+
} | {
|
|
184
|
+
kind: 'literal';
|
|
185
|
+
value: unknown;
|
|
186
|
+
};
|
|
187
|
+
export type QuestionDrivenItemSpec = {
|
|
188
|
+
/** Node id to pull the question text from. */
|
|
189
|
+
nodeId: string;
|
|
190
|
+
/**
|
|
191
|
+
* Dot-path under the node definition to read the question from.
|
|
192
|
+
* Default: "inputs.question"
|
|
193
|
+
*/
|
|
194
|
+
questionPath?: string;
|
|
195
|
+
/**
|
|
196
|
+
* Dot-path under executionMemory where the node wrote its output.
|
|
197
|
+
* Default: node.executionMapping.path (if present)
|
|
198
|
+
*/
|
|
199
|
+
answerPath?: string;
|
|
200
|
+
/**
|
|
201
|
+
* When true and the answer path resolves to a failed node marker or is missing, `answer` becomes `null`.
|
|
202
|
+
*/
|
|
203
|
+
optional?: boolean;
|
|
204
|
+
};
|
|
205
|
+
export type ReportSchemaSectionSpec = {
|
|
206
|
+
/** Dot-path in executionMemory to pull the section value from. */
|
|
207
|
+
path: string;
|
|
208
|
+
/** Human-readable title for this section. */
|
|
209
|
+
title?: string;
|
|
210
|
+
optional?: boolean;
|
|
211
|
+
};
|
|
212
|
+
export type AggregateFinalizerConfig = {
|
|
213
|
+
strategy: 'object-map';
|
|
214
|
+
map: Record<string, AggregateExpr>;
|
|
215
|
+
omitUndefined?: boolean;
|
|
216
|
+
} | {
|
|
217
|
+
/**
|
|
218
|
+
* Build a canonical question-driven response object.
|
|
219
|
+
* Each entry produces: { question, answer } under the configured output key.
|
|
220
|
+
*/
|
|
221
|
+
strategy: 'question-driven';
|
|
222
|
+
/** Optional literal contract version to include at top-level. */
|
|
223
|
+
contractVersion?: string;
|
|
224
|
+
/** Map output keys → node specs. */
|
|
225
|
+
items: Record<string, QuestionDrivenItemSpec>;
|
|
226
|
+
/** Optional extra metadata to include at top-level from executionMemory or outputsMemory. */
|
|
227
|
+
meta?: Record<string, {
|
|
228
|
+
type: 'executionMemoryPath' | 'outputsMemoryPath';
|
|
229
|
+
path: string;
|
|
230
|
+
optional?: boolean;
|
|
231
|
+
}>;
|
|
232
|
+
} | {
|
|
233
|
+
/**
|
|
234
|
+
* Assemble a structured multi-section report from executionMemory.
|
|
235
|
+
* Each section key maps to a dot-path. collect_tags gathers all
|
|
236
|
+
* epistemic tags across sections.
|
|
237
|
+
*/
|
|
238
|
+
strategy: 'report-schema';
|
|
239
|
+
/** Map of output key → section spec (path + optional title). */
|
|
240
|
+
sections: Record<string, ReportSchemaSectionSpec>;
|
|
241
|
+
/** When true, scan all section values for CONFIRMED/INFERRED/ASSUMED/UNKNOWN and emit collected_tags. */
|
|
242
|
+
collect_tags?: boolean;
|
|
243
|
+
/** Optional literal fields merged at top level. */
|
|
244
|
+
meta?: Record<string, unknown>;
|
|
245
|
+
};
|
|
246
|
+
export type BundleFinalizerConfig = {
|
|
247
|
+
strategy: 'bundle';
|
|
248
|
+
includeInputs: string[];
|
|
249
|
+
};
|
|
250
|
+
export type SelectFinalizerConfig = {
|
|
251
|
+
strategy: 'select';
|
|
252
|
+
selector: {
|
|
253
|
+
type: 'firstPresent' | 'byInputValue';
|
|
254
|
+
order?: string[];
|
|
255
|
+
selectorInput?: string;
|
|
256
|
+
cases?: Record<string, string>;
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
export type UtilityExecutionPolicy = 'debug' | 'standard' | 'batch-prod';
|
|
260
|
+
export type SynthesizeFinalizerConfig = {
|
|
261
|
+
strategy: 'synthesize';
|
|
262
|
+
/** Utility skill key resolved by `@exellix/ai-tasks` (e.g. catalog utilities such as `xynthesis/finalize`). */
|
|
263
|
+
utilityKey: string;
|
|
264
|
+
templateId: string;
|
|
265
|
+
outputContractId?: string;
|
|
266
|
+
executionPolicy?: UtilityExecutionPolicy;
|
|
267
|
+
};
|
|
268
|
+
export interface FinalizerNode {
|
|
269
|
+
id: string;
|
|
270
|
+
type: 'finalizer';
|
|
271
|
+
finalizerType: 'aggregate' | 'compose' | 'select' | 'bundle' | 'synthesize';
|
|
272
|
+
inputs: Record<string, FinalizerInputBinding>;
|
|
273
|
+
/** Transitional: runtime validation narrows by finalizerType; implemented finalizers export typed configs. */
|
|
274
|
+
config: AggregateFinalizerConfig | BundleFinalizerConfig | SelectFinalizerConfig | SynthesizeFinalizerConfig | Record<string, unknown>;
|
|
275
|
+
/** Writes selected finalizer result fields into graph-owned outputsMemory for final response assembly. */
|
|
276
|
+
outputMapping?: TaskNodeResultMapping;
|
|
277
|
+
outputSchema?: OutputSchema;
|
|
278
|
+
[key: string]: any;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Allowlisted task-node `metadata`: descriptive / planning only.
|
|
282
|
+
* Execution wiring lives on {@link TaskNode.taskConfiguration}.
|
|
283
|
+
*/
|
|
284
|
+
export type TaskNodePureMetadata = {
|
|
285
|
+
graphReadability?: GraphReadability;
|
|
286
|
+
catalogBinding?: CatalogBinding;
|
|
287
|
+
catalogRequest?: CatalogRequestEntry;
|
|
288
|
+
/** Display / tracing label (not merged into template variables from metadata). */
|
|
289
|
+
name?: string;
|
|
290
|
+
description?: string;
|
|
291
|
+
/** Declarative integration target; runtime does not branch on this key. */
|
|
292
|
+
exellixContractTarget?: unknown;
|
|
293
|
+
};
|
|
294
|
+
export type TaskNodeResultMapping = {
|
|
295
|
+
path: string;
|
|
296
|
+
mode?: 'replace' | 'append' | 'merge';
|
|
297
|
+
map?: {
|
|
298
|
+
[targetKey: string]: string;
|
|
299
|
+
};
|
|
300
|
+
fields?: string[];
|
|
301
|
+
};
|
|
302
|
+
export type TaskNodeConditionParameters = Record<string, unknown>;
|
|
303
|
+
/** When true, invert the evaluator result after runx returns. */
|
|
304
|
+
export type TaskNodeConditionNegate = {
|
|
305
|
+
negate?: boolean;
|
|
306
|
+
};
|
|
307
|
+
export type TaskNodeJsonConditionOptions = {
|
|
308
|
+
jsonConditionFormat?: 'auto' | 'jsonlogic' | 'jsonata' | 'filter-predicate' | 'custom';
|
|
309
|
+
timeoutMs?: number;
|
|
310
|
+
};
|
|
311
|
+
export type TaskNodeJsonCondition = TaskNodeConditionNegate & {
|
|
312
|
+
condition: string | Record<string, unknown> | unknown[];
|
|
313
|
+
parameters?: TaskNodeConditionParameters;
|
|
314
|
+
options?: TaskNodeJsonConditionOptions;
|
|
315
|
+
};
|
|
316
|
+
export type TaskNodeJsConditionFunction = TaskNodeConditionNegate & {
|
|
317
|
+
conditionFunctionId: string;
|
|
318
|
+
parameters?: TaskNodeConditionParameters;
|
|
319
|
+
};
|
|
320
|
+
export type TaskNodeAiCondition = TaskNodeConditionNegate & {
|
|
321
|
+
condition: string;
|
|
322
|
+
parameters?: TaskNodeConditionParameters;
|
|
323
|
+
mode?: 'hybrid' | 'model';
|
|
324
|
+
model?: string;
|
|
325
|
+
};
|
|
326
|
+
/** Gates evaluated by graph-engine (runx) before a task node runs. */
|
|
327
|
+
export type TaskNodeConditionWhen = {
|
|
328
|
+
jsonConditions?: TaskNodeJsonCondition;
|
|
329
|
+
jsConditionFunction?: TaskNodeJsConditionFunction;
|
|
330
|
+
aiCondition?: TaskNodeAiCondition;
|
|
331
|
+
};
|
|
332
|
+
/**
|
|
333
|
+
* Declarative gating for when this node should run.
|
|
334
|
+
*
|
|
335
|
+
* - **`jsonConditions` / `jsConditionFunction` / `aiCondition`:** evaluated via runx (see `evaluateTaskNodeConditions`).
|
|
336
|
+
* - **`dataFilters` (`string[]`):** opaque catalog ids — not evaluated by graph-engine.
|
|
337
|
+
* - **`narratives`:** authoring / tooling only.
|
|
338
|
+
*/
|
|
339
|
+
export type TaskNodeConditions = {
|
|
340
|
+
narratives?: string[];
|
|
341
|
+
/** Opaque catalog reference ids only — not evaluated by graph-engine. */
|
|
342
|
+
dataFilters?: string[];
|
|
343
|
+
jsonConditions?: TaskNodeJsonCondition;
|
|
344
|
+
jsConditionFunction?: TaskNodeJsConditionFunction;
|
|
345
|
+
aiCondition?: TaskNodeAiCondition;
|
|
346
|
+
};
|
|
347
|
+
export type ModelConfigCase = {
|
|
348
|
+
when?: TaskNodeConditionWhen;
|
|
349
|
+
modelConfig: GraphAiModelConfig;
|
|
350
|
+
};
|
|
351
|
+
/** Canonical authoring shape for graph and taskConfiguration model selection. */
|
|
352
|
+
export type ModelConfigSelection = {
|
|
353
|
+
cases: ModelConfigCase[];
|
|
354
|
+
};
|
|
355
|
+
export interface TaskNode {
|
|
356
|
+
id: string;
|
|
357
|
+
type?: string;
|
|
358
|
+
skillKey?: string;
|
|
359
|
+
/**
|
|
360
|
+
* Static task-scoped knowledge references declared by the graph model.
|
|
361
|
+
* Node/task-scoped knowledge refs. Runtime resolvers may use these refs to
|
|
362
|
+
* enrich this node's outbound `RunTaskRequest.taskMemory.knowledge`; resolved
|
|
363
|
+
* content must not be authored back into the model.
|
|
364
|
+
*/
|
|
365
|
+
taskKnowledge?: string[];
|
|
366
|
+
/**
|
|
367
|
+
* **Removed in 5.x** — `data.skillKey` / `data.variables` are no longer accepted; the runtime
|
|
368
|
+
* reads only `node.skillKey` and `node.variables`. The optional `data` bag may still carry
|
|
369
|
+
* arbitrary host fields, but the canonical validator rejects `skillKey` / `variables` here.
|
|
370
|
+
*/
|
|
371
|
+
data?: Record<string, any>;
|
|
372
|
+
metadata?: TaskNodePureMetadata & {
|
|
373
|
+
/** Synthetic boundary marker from {@link materializeVirtualBoundaryDiagram}; not execution config. */
|
|
374
|
+
__exellixVirtualBoundary?: boolean;
|
|
375
|
+
};
|
|
376
|
+
/**
|
|
377
|
+
* Execution-facing settings for this node (`runTask`, Narrix, pipelines, local skills, retries).
|
|
378
|
+
*/
|
|
379
|
+
taskConfiguration?: TaskNodeTaskConfiguration;
|
|
380
|
+
variables?: Record<string, any>;
|
|
381
|
+
memory?: {
|
|
382
|
+
taskMemory?: any;
|
|
383
|
+
jobMemory?: any;
|
|
384
|
+
};
|
|
385
|
+
/** Writes selected node result fields into task-visible executionMemory for downstream execution. */
|
|
386
|
+
executionMapping?: TaskNodeResultMapping;
|
|
387
|
+
jobContextMapping?: {
|
|
388
|
+
path?: string;
|
|
389
|
+
mode?: 'replace' | 'append' | 'merge';
|
|
390
|
+
map?: {
|
|
391
|
+
[targetKey: string]: string;
|
|
392
|
+
};
|
|
393
|
+
fields?: string[];
|
|
394
|
+
};
|
|
395
|
+
scope?: {
|
|
396
|
+
contextualKnowledge?: Array<{
|
|
397
|
+
list: string;
|
|
398
|
+
select?: string[];
|
|
399
|
+
filter?: {
|
|
400
|
+
where?: Array<{
|
|
401
|
+
path: string;
|
|
402
|
+
eq?: any;
|
|
403
|
+
eqAny?: any[];
|
|
404
|
+
}>;
|
|
405
|
+
limit?: number;
|
|
406
|
+
orderBy?: Array<{
|
|
407
|
+
path: string;
|
|
408
|
+
direction: 'asc' | 'desc';
|
|
409
|
+
}>;
|
|
410
|
+
};
|
|
411
|
+
}>;
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* Runtime payload bindings only (`executionMemoryPath` / legacy memory `$path` refs).
|
|
415
|
+
* See `taskVariable` for prompts and graph-variable hooks.
|
|
416
|
+
*/
|
|
417
|
+
inputsConfig?: Record<string, unknown>;
|
|
418
|
+
/** @deprecated Prefer `inputsConfig`. */
|
|
419
|
+
inputBindings?: Record<string, unknown>;
|
|
420
|
+
/**
|
|
421
|
+
* @deprecated Prefer `inputsConfig` — name collides with `runtime.inputs` (caller bag).
|
|
422
|
+
*/
|
|
423
|
+
inputs?: Record<string, any>;
|
|
424
|
+
/**
|
|
425
|
+
* Dynamic task configuration: prompts, literals, and `{ "$path": "variables.*" }` refs.
|
|
426
|
+
* Not execution-memory payload wires (those belong in `inputsConfig`).
|
|
427
|
+
*/
|
|
428
|
+
taskVariable?: Record<string, unknown>;
|
|
429
|
+
/**
|
|
430
|
+
* Passthrough smart-input path list for `@exellix/ai-tasks` (graph-engine validates allowed roots only).
|
|
431
|
+
*/
|
|
432
|
+
smartInput?: SmartInputConfig;
|
|
433
|
+
/**
|
|
434
|
+
* Optional deterministic output checks before `executionMapping` is applied (see `executeNode` / `validateNodeOutput`).
|
|
435
|
+
*/
|
|
436
|
+
outputValidation?: TaskOutputValidation;
|
|
437
|
+
/**
|
|
438
|
+
* Per-node execution pipeline (pre / main / post). Same semantics as `ExecuteGraphOptions.executionPipeline`.
|
|
439
|
+
* Read by `executeNode` and `ExellixGraphRuntime` when not overridden by options / execution.
|
|
440
|
+
*/
|
|
441
|
+
executionPipeline?: TaskNodeExecutionPipelineStep[];
|
|
442
|
+
/** Optional runx-backed gates; opaque dataFilters / narratives are not evaluated by graph-engine. */
|
|
443
|
+
conditions?: TaskNodeConditions;
|
|
444
|
+
[key: string]: any;
|
|
445
|
+
}
|
|
446
|
+
/** Shape used by runtime output validation (`executeNode`). */
|
|
447
|
+
export type TaskOutputValidation = {
|
|
448
|
+
rules?: Array<{
|
|
449
|
+
path: string;
|
|
450
|
+
type: 'boolean' | 'string' | 'number' | 'object' | 'array';
|
|
451
|
+
required?: boolean;
|
|
452
|
+
}>;
|
|
453
|
+
};
|
|
454
|
+
export type GraphNode = TaskNode | FinalizerNode;
|
|
455
|
+
/**
|
|
456
|
+
* Which catalog family a binding or gap request refers to.
|
|
457
|
+
* Exellix-graph-engine does not branch on these values at execution time.
|
|
458
|
+
*/
|
|
459
|
+
export type CatalogPlanningKind = 'scoped-question' | 'discovery-definition';
|
|
460
|
+
/**
|
|
461
|
+
* Workflow status for a catalog gap request (tooling only).
|
|
462
|
+
*/
|
|
463
|
+
export type CatalogRequestStatus = 'required' | 'draft' | 'submitted' | string;
|
|
464
|
+
/**
|
|
465
|
+
* Binds a task node to a catalog entry (scoped question or discovery definition).
|
|
466
|
+
* **Planning only:** editors use this as source of truth; runtime uses `taskConfiguration.narrix`,
|
|
467
|
+
* `taskConfiguration.scopingMapId`, etc., unless an external tool syncs them. Safe to omit; ignored by the executor.
|
|
468
|
+
*
|
|
469
|
+
* `discovery-definition` is a first-class literal for Narrix-aligned discovery catalog entries.
|
|
470
|
+
*/
|
|
471
|
+
export type CatalogBinding = {
|
|
472
|
+
catalogType: CatalogPlanningKind | string;
|
|
473
|
+
catalogId: string;
|
|
474
|
+
/** Catalog semver or label when known; omit during early authoring. */
|
|
475
|
+
version?: string;
|
|
476
|
+
/** Optional notes for editor UIs (not consumed by exellix-graph execution). */
|
|
477
|
+
notes?: string;
|
|
478
|
+
};
|
|
479
|
+
/**
|
|
480
|
+
* Planning vocabulary for a discovery-definition catalog item: mirrors Narrix-oriented docs and
|
|
481
|
+
* {@link NarrixPreProcessorConfig} without implying the executor reads this shape from bindings.
|
|
482
|
+
* All fields optional so editors can store partial snapshots while authoring.
|
|
483
|
+
*/
|
|
484
|
+
export type DiscoveryDefinitionPlanningFields = {
|
|
485
|
+
title?: string;
|
|
486
|
+
purpose?: string;
|
|
487
|
+
datasetId?: string;
|
|
488
|
+
layer?: string;
|
|
489
|
+
narrativeTypeIds?: string[];
|
|
490
|
+
enableWebScope?: boolean;
|
|
491
|
+
/** Discovery notes / rationale for editors and dashboards only. */
|
|
492
|
+
discoveryNotes?: string;
|
|
493
|
+
/** Expected semantic outputs (signals/stories, etc.) — planning hints only. */
|
|
494
|
+
expectedSemanticOutputs?: string[];
|
|
495
|
+
/** Compatible task / skill identifiers for this definition (planning). */
|
|
496
|
+
compatibleTaskTypes?: string[];
|
|
497
|
+
};
|
|
498
|
+
type CatalogRequestEntryShared = {
|
|
499
|
+
status: CatalogRequestStatus;
|
|
500
|
+
requestedId: string;
|
|
501
|
+
reason: string;
|
|
502
|
+
/** Optional short label; discovery gaps often omit until copy exists. */
|
|
503
|
+
title?: string;
|
|
504
|
+
requestedByNodeId?: string;
|
|
505
|
+
};
|
|
506
|
+
/**
|
|
507
|
+
* Graph- or node-level request for a missing scoped-question catalog item.
|
|
508
|
+
*/
|
|
509
|
+
export type ScopedQuestionCatalogRequestEntry = CatalogRequestEntryShared & {
|
|
510
|
+
catalogType: 'scoped-question';
|
|
511
|
+
asks: string;
|
|
512
|
+
entityType: string;
|
|
513
|
+
proposedScopingMapId?: string;
|
|
514
|
+
planningNotes?: string;
|
|
515
|
+
};
|
|
516
|
+
/**
|
|
517
|
+
* Graph- or node-level request for a missing discovery-definition catalog item
|
|
518
|
+
* (planning alignment with Narrix-oriented fields — not applied to `metadata.narrix` by the executor).
|
|
519
|
+
* Narrix-aligned fields are optional so in-flight gap declarations stay valid.
|
|
520
|
+
*/
|
|
521
|
+
export type DiscoveryDefinitionCatalogRequestEntry = CatalogRequestEntryShared & {
|
|
522
|
+
catalogType: 'discovery-definition';
|
|
523
|
+
} & DiscoveryDefinitionPlanningFields;
|
|
524
|
+
/** Alias matching client naming for the discovery gap variant. */
|
|
525
|
+
export type DiscoveryDefinitionCatalogRequest = DiscoveryDefinitionCatalogRequestEntry;
|
|
526
|
+
/**
|
|
527
|
+
* Declares a required catalog item that does not exist yet (gap / feature request).
|
|
528
|
+
*/
|
|
529
|
+
export type CatalogRequestEntry = ScopedQuestionCatalogRequestEntry | DiscoveryDefinitionCatalogRequestEntry;
|
|
530
|
+
/**
|
|
531
|
+
* Semantic class of data a graph expects at Layer 01. Combinations are represented
|
|
532
|
+
* by multiple `GraphEntryInputSpec` entries on `metadata.graphEntry.inputs`.
|
|
533
|
+
*/
|
|
534
|
+
export type GraphEntryInputKind = 'record' | 'query' | 'user-input' | 'content' | 'metadata' | 'execution';
|
|
535
|
+
export type GraphEntryValueInputKind = Exclude<GraphEntryInputKind, 'execution'>;
|
|
536
|
+
/**
|
|
537
|
+
* Design-time declaration shared by graph entry inputs.
|
|
538
|
+
* **Declarative only:** core runtime does not validate or coerce these specs.
|
|
539
|
+
*/
|
|
540
|
+
export type GraphEntryInputSpecBase = {
|
|
541
|
+
/** Semantic input class, e.g. `record`, `query`, `user-input`, `content`, or `execution`. */
|
|
542
|
+
kind: GraphEntryInputKind;
|
|
543
|
+
/** Stable name for tooling/templates when the path is not enough. */
|
|
544
|
+
name?: string;
|
|
545
|
+
/** One-line label for graph authors and UIs. */
|
|
546
|
+
title?: string;
|
|
547
|
+
/** Longer human-readable description for editors, catalogs, and docs. */
|
|
548
|
+
description?: string;
|
|
549
|
+
/** Defaults to true for authoring intent; runtime does not enforce it today. */
|
|
550
|
+
required?: boolean;
|
|
551
|
+
/** Optional JSON Schema for this specific input value. Validators may use it; core runtime does not. */
|
|
552
|
+
schema?: Record<string, unknown>;
|
|
553
|
+
[key: string]: unknown;
|
|
554
|
+
};
|
|
555
|
+
/**
|
|
556
|
+
* Design-time declaration of one caller-supplied value in the graph execution object.
|
|
557
|
+
* Paths are dot-paths under the merged `execution` object, usually `input.*`.
|
|
558
|
+
*/
|
|
559
|
+
export type GraphEntryValueInputSpec = GraphEntryInputSpecBase & {
|
|
560
|
+
kind: GraphEntryValueInputKind;
|
|
561
|
+
/** Dot-path under merged `execution` where this input is expected, e.g. `input.subnetId`. */
|
|
562
|
+
path: string;
|
|
563
|
+
};
|
|
564
|
+
/**
|
|
565
|
+
* Design-time declaration of a prior graph execution used as this graph's input.
|
|
566
|
+
* A host/orchestrator can use `graphId` and `metadataFilter` to find the source execution,
|
|
567
|
+
* then materialize it at `path` before calling `executeGraph`.
|
|
568
|
+
*/
|
|
569
|
+
export type GraphEntryExecutionInputSpec = Omit<GraphEntryInputSpecBase, 'kind'> & {
|
|
570
|
+
kind: 'execution';
|
|
571
|
+
/** Source graph id whose completed execution should be used as input. */
|
|
572
|
+
graphId: string;
|
|
573
|
+
/** Metadata fields used by host tooling to select the matching source execution. */
|
|
574
|
+
metadataFilter?: Record<string, unknown>;
|
|
575
|
+
/** Dot-path under merged `execution` where the selected graph execution is expected. */
|
|
576
|
+
path?: string;
|
|
577
|
+
};
|
|
578
|
+
/**
|
|
579
|
+
* Design-time declaration of one graph entry input.
|
|
580
|
+
*/
|
|
581
|
+
export type GraphEntryInputSpec = GraphEntryValueInputSpec | GraphEntryExecutionInputSpec;
|
|
582
|
+
/**
|
|
583
|
+
* Layer 01 (graph entry): declares what callers should supply in `ExecuteGraphOptions.execution`
|
|
584
|
+
* after merge — the seed for `execution.input.*` and related paths first-wave nodes read.
|
|
585
|
+
* **Declarative only:** `executeGraph` does not validate this object; it is exposed via
|
|
586
|
+
* `variables.__graphModel` for tools, composers, and documentation (see `.docs/graph-io-visibility.md`).
|
|
587
|
+
*/
|
|
588
|
+
export type GraphEntryContract = {
|
|
589
|
+
/** One-line summary for authors and UIs. */
|
|
590
|
+
summary?: string;
|
|
591
|
+
/**
|
|
592
|
+
* Optional structured gate evaluated once at graph-run start against `runtime.executionMemory.input`
|
|
593
|
+
* (same shape as `TaskNodeConditions.dataFilters`). Legacy `string[]` ids are not evaluated here.
|
|
594
|
+
*/
|
|
595
|
+
dataFilters?: ConditionsDataFilters;
|
|
596
|
+
/**
|
|
597
|
+
* Dot-paths under merged `execution` that first-wave nodes expect (e.g. `input.subnetId`,
|
|
598
|
+
* `input.entityId`, `input.vulnerabilityId`). Same convention as `metadata.entityIdPath` roots.
|
|
599
|
+
*/
|
|
600
|
+
requiredExecutionPaths?: string[];
|
|
601
|
+
/**
|
|
602
|
+
* Semantic entry inputs this graph is designed to work with. Use multiple entries for combinations
|
|
603
|
+
* (for example, `record` + `query`).
|
|
604
|
+
*/
|
|
605
|
+
inputs?: GraphEntryInputSpec[];
|
|
606
|
+
/**
|
|
607
|
+
* Optional JSON Schema (e.g. draft 2020-12) for the merged `execution` object. Validators may use it; core runtime does not.
|
|
608
|
+
*/
|
|
609
|
+
executionSchema?: Record<string, unknown>;
|
|
610
|
+
[key: string]: unknown;
|
|
611
|
+
};
|
|
612
|
+
/**
|
|
613
|
+
* @deprecated Use root-level {@link GraphModelObject.response}. The final response shape is executable
|
|
614
|
+
* graph contract, not document metadata.
|
|
615
|
+
*/
|
|
616
|
+
export type GraphResponseContract = {
|
|
617
|
+
summary?: string;
|
|
618
|
+
/**
|
|
619
|
+
* Execution paths typically read after a successful run (e.g. `finalOutput`, `_trace.nodes`).
|
|
620
|
+
* UIs may also read `runLog`, `runLogTruncated`, and `logxerCorrelationId` on the graph result object.
|
|
621
|
+
*/
|
|
622
|
+
notableExecutionPaths?: string[];
|
|
623
|
+
/**
|
|
624
|
+
* Optional JSON Schema for `finalOutput` (finalizer product). Core runtime does not validate.
|
|
625
|
+
*/
|
|
626
|
+
finalOutputSchema?: Record<string, unknown>;
|
|
627
|
+
/** @deprecated Move executable response shaping to root `graph.response`. */
|
|
628
|
+
responseMapping?: GraphResponseMapping;
|
|
629
|
+
[key: string]: unknown;
|
|
630
|
+
};
|
|
631
|
+
export type GraphExecutionMode = 'forward' | 'backward' | 'hybrid';
|
|
632
|
+
export type GraphOutputMode = 'mappedAggregation' | 'lastExitNode';
|
|
633
|
+
export type GraphFlowOutline = 'linearSequence' | 'convergingParallelFlow';
|
|
634
|
+
export type GraphCoreObjective = {
|
|
635
|
+
/** Dynamic property name used on every `stepsResponses` item. Default: "coreObjective". */
|
|
636
|
+
propertyName: string;
|
|
637
|
+
/** Dot-path resolved from graph/run context. Supported roots: input, execution, variables, jobMemory, taskMemory, job. */
|
|
638
|
+
sourcePath: string;
|
|
639
|
+
};
|
|
640
|
+
/**
|
|
641
|
+
* Human-readable labels for how a graph's node responses should be described in UIs and docs.
|
|
642
|
+
* Runtime uses these keys when building `stepsResponses`.
|
|
643
|
+
*/
|
|
644
|
+
export type GraphNodesResponses = {
|
|
645
|
+
singular: string;
|
|
646
|
+
plural: string;
|
|
647
|
+
};
|
|
648
|
+
/**
|
|
649
|
+
* Graph-level execution defaults and authoring labels.
|
|
650
|
+
* Planner mode still comes from `GraphExecutionRequest.runtime.mode`; response shaping belongs to
|
|
651
|
+
* root-level `GraphModelObject.response`.
|
|
652
|
+
*/
|
|
653
|
+
export type GraphExecutionDefaults = {
|
|
654
|
+
mode?: GraphExecutionMode;
|
|
655
|
+
goalNodeId?: string;
|
|
656
|
+
dimension?: string;
|
|
657
|
+
outputMode?: GraphOutputMode;
|
|
658
|
+
coreObjective?: GraphCoreObjective;
|
|
659
|
+
nodesResponses?: GraphNodesResponses;
|
|
660
|
+
/** Metadata-only outline for tools/docs; runtime does not branch on this value. */
|
|
661
|
+
flowOutline?: GraphFlowOutline;
|
|
662
|
+
};
|
|
663
|
+
/**
|
|
664
|
+
* Graph-document metadata: domain model, contracts, catalog hints, authoring.
|
|
665
|
+
* Declare product-specific shapes here; exellix-graph forwards values to `variables.__graphModel`
|
|
666
|
+
* and inspection without interpreting keys.
|
|
667
|
+
*/
|
|
668
|
+
export interface GraphDocumentMetadata {
|
|
669
|
+
/** Short title (tooling, UIs). */
|
|
670
|
+
name?: string;
|
|
671
|
+
/** Longer description for authors or catalogs. */
|
|
672
|
+
description?: string;
|
|
673
|
+
/** Integration / contract target blob (declarative; runtime does not branch on it). */
|
|
674
|
+
exellixContractTarget?: unknown;
|
|
675
|
+
/**
|
|
676
|
+
* Layer 01 — expected execution seed / input contract (see {@link GraphEntryContract}).
|
|
677
|
+
*/
|
|
678
|
+
graphEntry?: GraphEntryContract;
|
|
679
|
+
/** @deprecated Move final response contract to root `graph.response`. */
|
|
680
|
+
graphResponse?: GraphResponseContract;
|
|
681
|
+
/**
|
|
682
|
+
* Graph execution defaults and labels.
|
|
683
|
+
* Planner mode is still selected by `executeGraph({ model, runtime }).runtime.mode` and defaults to `forward`;
|
|
684
|
+
* output labels in this block shape `stepsResponses`, not `ExecuteGraphResult.finalOutput`.
|
|
685
|
+
*/
|
|
686
|
+
graphExecution?: GraphExecutionDefaults;
|
|
687
|
+
/**
|
|
688
|
+
* Planning-only: formal catalog gap requests (scoped questions and/or discovery definitions).
|
|
689
|
+
* Not enforced or interpreted by the executor — for editors, dashboards, and gap tracking.
|
|
690
|
+
*/
|
|
691
|
+
catalogRequests?: CatalogRequestEntry[];
|
|
692
|
+
/** Optional nested bucket for namespaced extensions. */
|
|
693
|
+
extensions?: Record<string, unknown>;
|
|
694
|
+
[key: string]: unknown;
|
|
695
|
+
}
|
|
696
|
+
/** Merged graph document model is exposed under this key in merged execution `variables`. */
|
|
697
|
+
export declare const EXELLIX_GRAPH_MODEL_VARIABLE_KEY: "__graphModel";
|
|
698
|
+
/** Returns `graph.metadata` when present (plain object); otherwise `{}`. */
|
|
699
|
+
export declare function mergeGraphDocumentModel(graph: Graph): GraphDocumentMetadata;
|
|
700
|
+
export interface GraphModelObject {
|
|
701
|
+
id: string;
|
|
702
|
+
/** Optional static model version for authoring, storage, and replay/audit tooling. */
|
|
703
|
+
version?: string;
|
|
704
|
+
/**
|
|
705
|
+
* Graph-level default AI model selection. Runtime aliases are resolved from
|
|
706
|
+
* GraphRuntimeObject.aliasConfig / nodes[nodeId].aliasConfig before runTask.
|
|
707
|
+
*/
|
|
708
|
+
modelConfig?: ModelConfigSelection;
|
|
709
|
+
/**
|
|
710
|
+
* Static graph-level knowledge references. Runtime resolvers use these refs
|
|
711
|
+
* for outbound `RunTaskRequest.jobMemory.knowledge` across the graph run.
|
|
712
|
+
*/
|
|
713
|
+
jobKnowledge?: string[];
|
|
714
|
+
/** Canonical 5.x: nodes is always a `GraphNode[]` array. Record-keyed nodes are rejected at load. */
|
|
715
|
+
nodes: GraphNode[];
|
|
716
|
+
edges?: GraphEdge[];
|
|
717
|
+
variables?: Record<string, any>;
|
|
718
|
+
/**
|
|
719
|
+
* Executable graph-level final response contract. `ExecuteGraphResult.finalOutput`
|
|
720
|
+
* is resolved from this shape after nodes and the terminal finalizer/barrier complete.
|
|
721
|
+
*/
|
|
722
|
+
response: GraphResponseDefinition;
|
|
723
|
+
/**
|
|
724
|
+
* Graph-level metadata (domain / contract / catalog). Copied into execution variables
|
|
725
|
+
* as {@link EXELLIX_GRAPH_MODEL_VARIABLE_KEY}; see {@link mergeGraphDocumentModel}.
|
|
726
|
+
*/
|
|
727
|
+
metadata?: GraphDocumentMetadata;
|
|
728
|
+
}
|
|
729
|
+
/** Backwards-compatible type alias for the static graph model object. */
|
|
730
|
+
export type Graph = GraphModelObject;
|
|
731
|
+
export interface Job {
|
|
732
|
+
/**
|
|
733
|
+
* Host correlation id for this run (mirrors `runtime.jobId`) after normalization.
|
|
734
|
+
* You may omit `id` / `job.jobId` on input when `runtime.jobId` is passed at the graph call; the runtime sets both.
|
|
735
|
+
*/
|
|
736
|
+
id?: string;
|
|
737
|
+
/** Same as `id` when both set — used by injected runtime and `runTask.jobId`. */
|
|
738
|
+
jobId?: string;
|
|
739
|
+
/** Semantic class of job, distinct from unique `id`. Forwarded to `@exellix/ai-tasks` as `jobTypeId` when set. */
|
|
740
|
+
jobType?: string;
|
|
741
|
+
/** Explicit catalog/job classification id; wins over `jobType` when both are set for `runTask.jobTypeId`. */
|
|
742
|
+
jobTypeId?: string;
|
|
743
|
+
jobVariables?: Record<string, any>;
|
|
744
|
+
agentId?: string;
|
|
745
|
+
[key: string]: any;
|
|
746
|
+
}
|
|
747
|
+
export {};
|