@exellix/graph-composer 2.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.
Files changed (103) hide show
  1. package/.env.example +66 -0
  2. package/LICENSE +21 -0
  3. package/README.md +329 -0
  4. package/dist/aiTaskProfile.d.ts +66 -0
  5. package/dist/aiTaskProfile.d.ts.map +1 -0
  6. package/dist/aiTaskProfile.js +179 -0
  7. package/dist/canonicalGraphDocument.d.ts +8 -0
  8. package/dist/canonicalGraphDocument.d.ts.map +1 -0
  9. package/dist/canonicalGraphDocument.js +344 -0
  10. package/dist/canonicalGraphWarnings.d.ts +6 -0
  11. package/dist/canonicalGraphWarnings.d.ts.map +1 -0
  12. package/dist/canonicalGraphWarnings.js +140 -0
  13. package/dist/catalogMatchAssist.d.ts +20 -0
  14. package/dist/catalogMatchAssist.d.ts.map +1 -0
  15. package/dist/catalogMatchAssist.js +203 -0
  16. package/dist/cataloxCatalogBridge.d.ts +103 -0
  17. package/dist/cataloxCatalogBridge.d.ts.map +1 -0
  18. package/dist/cataloxCatalogBridge.js +222 -0
  19. package/dist/cli.d.ts +3 -0
  20. package/dist/cli.d.ts.map +1 -0
  21. package/dist/cli.js +43 -0
  22. package/dist/composeInstructions.d.ts +11 -0
  23. package/dist/composeInstructions.d.ts.map +1 -0
  24. package/dist/composeInstructions.js +39 -0
  25. package/dist/defaultUtilitySkills.d.ts +4 -0
  26. package/dist/defaultUtilitySkills.d.ts.map +1 -0
  27. package/dist/defaultUtilitySkills.js +5 -0
  28. package/dist/exampleGeneration.d.ts +15 -0
  29. package/dist/exampleGeneration.d.ts.map +1 -0
  30. package/dist/exampleGeneration.js +72 -0
  31. package/dist/exampleInputs.d.ts +12 -0
  32. package/dist/exampleInputs.d.ts.map +1 -0
  33. package/dist/exampleInputs.js +181 -0
  34. package/dist/graphComposerActions.d.ts +22 -0
  35. package/dist/graphComposerActions.d.ts.map +1 -0
  36. package/dist/graphComposerActions.js +168 -0
  37. package/dist/graphComposerAgent.d.ts +26 -0
  38. package/dist/graphComposerAgent.d.ts.map +1 -0
  39. package/dist/graphComposerAgent.js +175 -0
  40. package/dist/graphComposerOutputValidation.d.ts +23 -0
  41. package/dist/graphComposerOutputValidation.d.ts.map +1 -0
  42. package/dist/graphComposerOutputValidation.js +709 -0
  43. package/dist/graphConceptPatchMerge.d.ts +10 -0
  44. package/dist/graphConceptPatchMerge.d.ts.map +1 -0
  45. package/dist/graphConceptPatchMerge.js +40 -0
  46. package/dist/graphEngineBridge.d.ts +7 -0
  47. package/dist/graphEngineBridge.d.ts.map +1 -0
  48. package/dist/graphEngineBridge.js +5 -0
  49. package/dist/index.d.ts +24 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +19 -0
  52. package/dist/openRouterConnectTimeout.d.ts +3 -0
  53. package/dist/openRouterConnectTimeout.d.ts.map +1 -0
  54. package/dist/openRouterConnectTimeout.js +48 -0
  55. package/dist/packDir.d.ts +7 -0
  56. package/dist/packDir.d.ts.map +1 -0
  57. package/dist/packDir.js +23 -0
  58. package/dist/parseGraphConceptStory.d.ts +21 -0
  59. package/dist/parseGraphConceptStory.d.ts.map +1 -0
  60. package/dist/parseGraphConceptStory.js +105 -0
  61. package/dist/redactForLog.d.ts +2 -0
  62. package/dist/redactForLog.d.ts.map +1 -0
  63. package/dist/redactForLog.js +37 -0
  64. package/dist/runGraphComposer.d.ts +54 -0
  65. package/dist/runGraphComposer.d.ts.map +1 -0
  66. package/dist/runGraphComposer.js +444 -0
  67. package/dist/scopingCatalogHostTypes.d.ts +28 -0
  68. package/dist/scopingCatalogHostTypes.d.ts.map +1 -0
  69. package/dist/scopingCatalogHostTypes.js +6 -0
  70. package/dist/scopingNeedMatchAssist.d.ts +14 -0
  71. package/dist/scopingNeedMatchAssist.d.ts.map +1 -0
  72. package/dist/scopingNeedMatchAssist.js +58 -0
  73. package/dist/taskNodeTaskVariable.d.ts +44 -0
  74. package/dist/taskNodeTaskVariable.d.ts.map +1 -0
  75. package/dist/taskNodeTaskVariable.js +347 -0
  76. package/dist/types.d.ts +174 -0
  77. package/dist/types.d.ts.map +1 -0
  78. package/dist/types.js +1 -0
  79. package/examples/network-vuln-subnet-triage.v2.json +389 -0
  80. package/functions/graph-composer/meta.json +607 -0
  81. package/functions/graph-composer/prompts/README.md +46 -0
  82. package/functions/graph-composer/prompts/action-create.md +51 -0
  83. package/functions/graph-composer/prompts/action-explain.md +26 -0
  84. package/functions/graph-composer/prompts/action-modify.md +32 -0
  85. package/functions/graph-composer/prompts/action-review-concept.md +97 -0
  86. package/functions/graph-composer/prompts/action-suggest-catalog-creations.md +31 -0
  87. package/functions/graph-composer/prompts/action-suggest-catalog-resolution.md +42 -0
  88. package/functions/graph-composer/prompts/action-suggest-concept-objective.md +38 -0
  89. package/functions/graph-composer/prompts/action-suggest-scoping-map-creation.md +31 -0
  90. package/functions/graph-composer/prompts/action-suggest-scoping-need-match.md +25 -0
  91. package/functions/graph-composer/prompts/default-utility-skills.json +22 -0
  92. package/functions/graph-composer/prompts/judge-rules.md +30 -0
  93. package/functions/graph-composer/prompts/orchestrator-system.md +21 -0
  94. package/functions/graph-composer/prompts/shared/graph-format.md +124 -0
  95. package/functions/graph-composer/prompts/shared/request-context.md +12 -0
  96. package/functions/graph-composer/prompts/shared/skill-selection.md +6 -0
  97. package/functions/graph-composer/prompts/shared/structural-validation.md +19 -0
  98. package/functions/graph-composer/prompts/skill-catalog-ai-header.md +3 -0
  99. package/functions/graph-composer/prompts/skill-catalog-utility-header.md +3 -0
  100. package/functions/graph-composer/prompts/skill-mode-extensible.md +7 -0
  101. package/functions/graph-composer/prompts/skill-mode-locked.md +7 -0
  102. package/functions/graph-composer/test-cases.json +52 -0
  103. package/package.json +86 -0
@@ -0,0 +1,347 @@
1
+ /**
2
+
3
+ * Task nodes (GraphModelObject / TaskNode): runtime payload bindings in
4
+
5
+ * `inputsConfig`; dynamic task config in `taskVariable`; results in
6
+
7
+ * `executionMapping`. See `docs/formats-documentations/`.
8
+
9
+ */
10
+ import { canonicalizeGraphDocumentShell, canonicalizeTaskNodePlacement, } from "./canonicalGraphDocument.js";
11
+ const METADATA_EXECUTION_KEYS = new Set([
12
+ "aiTaskProfile",
13
+ "narrix",
14
+ "narrixMode",
15
+ "narrixInput",
16
+ "synthesizedContext",
17
+ "executionStrategyKey",
18
+ "executionStrategies",
19
+ "outputConstraints",
20
+ "aiTasksOutputValidation",
21
+ "modelConfig",
22
+ "llmCall",
23
+ "inputStrategyKey",
24
+ "synthesizedInput",
25
+ "skillKey",
26
+ "variables",
27
+ ]);
28
+ function readRecord(v) {
29
+ if (v === null || v === undefined || typeof v !== "object" || Array.isArray(v)) {
30
+ return undefined;
31
+ }
32
+ return v;
33
+ }
34
+ export function isFinalizerNode(node) {
35
+ return node.type === "finalizer";
36
+ }
37
+ export function isTaskNode(node) {
38
+ if (isFinalizerNode(node))
39
+ return false;
40
+ const t = node.type;
41
+ return t === undefined || t === "task";
42
+ }
43
+ function readPathRef(v) {
44
+ const o = readRecord(v);
45
+ if (o === undefined)
46
+ return undefined;
47
+ const p = o.$path;
48
+ return typeof p === "string" ? p : undefined;
49
+ }
50
+ /** True when the value is a `$path` ref to a template variable bucket. */
51
+ export function isTaskVariablePathRef(v) {
52
+ const path = readPathRef(v);
53
+ if (path === undefined)
54
+ return false;
55
+ return (path.startsWith("variables.") ||
56
+ path.startsWith("jobVariables.") ||
57
+ path.startsWith("taskVariables."));
58
+ }
59
+ /** Dual-read: canonical `inputsConfig`, then legacy `inputs`. */
60
+ export function resolveTaskNodeInputsConfig(node) {
61
+ if (!isTaskNode(node))
62
+ return undefined;
63
+ return readRecord(node.inputsConfig) ?? readRecord(node.inputs);
64
+ }
65
+ /** @deprecated Use `resolveTaskNodeInputsConfig`. */
66
+ export function resolveTaskNodeInputs(node) {
67
+ return resolveTaskNodeInputsConfig(node);
68
+ }
69
+ export function resolveTaskNodeTaskVariable(node) {
70
+ if (!isTaskNode(node))
71
+ return undefined;
72
+ return readRecord(node.taskVariable);
73
+ }
74
+ function variableKeysInBindings(bindings) {
75
+ const keys = [];
76
+ for (const [key, value] of Object.entries(bindings)) {
77
+ if (isTaskVariablePathRef(value))
78
+ keys.push(key);
79
+ }
80
+ return keys;
81
+ }
82
+ function readBindingRecord(node) {
83
+ return readRecord(node.inputs) ?? readRecord(node.inputsConfig);
84
+ }
85
+ export function reportTaskNodeInputsLayoutIssues(graph) {
86
+ const g = graph;
87
+ const nodes = g.nodes;
88
+ if (!Array.isArray(nodes))
89
+ return [];
90
+ const out = [];
91
+ for (const n of nodes) {
92
+ const node = readRecord(n);
93
+ if (node === undefined || !isTaskNode(node))
94
+ continue;
95
+ const id = typeof node.id === "string" ? node.id : "";
96
+ const legacyInputs = readRecord(node.inputs);
97
+ const inputsConfig = readRecord(node.inputsConfig);
98
+ if (legacyInputs !== undefined && inputsConfig !== undefined) {
99
+ out.push({ nodeId: id, code: "deprecated_inputs_and_inputsConfig" });
100
+ }
101
+ const bindings = readBindingRecord(node);
102
+ if (bindings !== undefined) {
103
+ if ("question" in bindings && bindings.question !== undefined) {
104
+ out.push({
105
+ nodeId: id,
106
+ code: "question_in_inputs",
107
+ keys: ["question"],
108
+ });
109
+ }
110
+ const varKeys = variableKeysInBindings(bindings);
111
+ if (varKeys.length > 0) {
112
+ out.push({
113
+ nodeId: id,
114
+ code: "variables_in_inputs",
115
+ keys: varKeys,
116
+ });
117
+ }
118
+ }
119
+ if (legacyInputs !== undefined && inputsConfig === undefined) {
120
+ out.push({ nodeId: id, code: "deprecated_inputs_field" });
121
+ }
122
+ if (readRecord(node.outputMapping) !== undefined) {
123
+ out.push({ nodeId: id, code: "deprecated_output_mapping" });
124
+ }
125
+ const meta = readRecord(node.metadata);
126
+ if (meta !== undefined) {
127
+ if (meta.aiTaskProfile !== undefined) {
128
+ out.push({ nodeId: id, code: "metadata_ai_task_profile" });
129
+ }
130
+ if (meta.narrix !== undefined) {
131
+ out.push({ nodeId: id, code: "metadata_narrix" });
132
+ }
133
+ for (const key of Object.keys(meta)) {
134
+ if (METADATA_EXECUTION_KEYS.has(key) && key !== "aiTaskProfile" && key !== "narrix") {
135
+ out.push({ nodeId: id, code: "metadata_execution_key", metadataKey: key });
136
+ }
137
+ }
138
+ }
139
+ }
140
+ return out;
141
+ }
142
+ function taskVariableKeysInBindings(bindings) {
143
+ const keys = new Set();
144
+ if ("question" in bindings && bindings.question !== undefined)
145
+ keys.add("question");
146
+ for (const key of variableKeysInBindings(bindings))
147
+ keys.add(key);
148
+ return [...keys];
149
+ }
150
+ function canonicalizeTaskVariableRecord(taskVariable) {
151
+ return { ...taskVariable };
152
+ }
153
+ function mergeBindingsIntoInputsConfig(node) {
154
+ const legacy = readRecord(node.inputs);
155
+ const config = readRecord(node.inputsConfig);
156
+ if (legacy === undefined && config === undefined)
157
+ return {};
158
+ if (legacy === undefined)
159
+ return { ...config };
160
+ if (config === undefined)
161
+ return { ...legacy };
162
+ return { ...legacy, ...config };
163
+ }
164
+ function migrateTaskVariablesFromBindings(node) {
165
+ if (!isTaskNode(node))
166
+ return false;
167
+ const bindings = readBindingRecord(node);
168
+ if (bindings === undefined)
169
+ return false;
170
+ const taskVariableKeys = taskVariableKeysInBindings(bindings);
171
+ if (taskVariableKeys.length === 0)
172
+ return false;
173
+ const taskVariable = {
174
+ ...canonicalizeTaskVariableRecord(readRecord(node.taskVariable) ?? {}),
175
+ };
176
+ const nextBindings = { ...bindings };
177
+ for (const key of taskVariableKeys) {
178
+ taskVariable[key] = nextBindings[key];
179
+ delete nextBindings[key];
180
+ }
181
+ node.inputsConfig = nextBindings;
182
+ delete node.inputs;
183
+ node.taskVariable = taskVariable;
184
+ return true;
185
+ }
186
+ function renameInputsToInputsConfig(node) {
187
+ if (!isTaskNode(node))
188
+ return false;
189
+ const legacy = readRecord(node.inputs);
190
+ const config = readRecord(node.inputsConfig);
191
+ if (legacy === undefined)
192
+ return false;
193
+ if (config === undefined) {
194
+ node.inputsConfig = legacy;
195
+ }
196
+ else {
197
+ node.inputsConfig = mergeBindingsIntoInputsConfig(node);
198
+ }
199
+ delete node.inputs;
200
+ return true;
201
+ }
202
+ function renameOutputMappingToExecutionMapping(node) {
203
+ if (!isTaskNode(node))
204
+ return false;
205
+ const om = readRecord(node.outputMapping);
206
+ if (om === undefined || readRecord(node.executionMapping) !== undefined)
207
+ return false;
208
+ node.executionMapping = om;
209
+ delete node.outputMapping;
210
+ return true;
211
+ }
212
+ function migrateExecutionConfigFromMetadata(node) {
213
+ if (!isTaskNode(node))
214
+ return false;
215
+ const meta = readRecord(node.metadata);
216
+ if (meta === undefined)
217
+ return false;
218
+ let changed = false;
219
+ const taskConfiguration = {
220
+ ...readRecord(node.taskConfiguration),
221
+ };
222
+ if (meta.aiTaskProfile !== undefined && taskConfiguration.aiTaskProfile === undefined) {
223
+ taskConfiguration.aiTaskProfile = meta.aiTaskProfile;
224
+ delete meta.aiTaskProfile;
225
+ changed = true;
226
+ }
227
+ if (meta.narrix !== undefined && taskConfiguration.narrix === undefined) {
228
+ taskConfiguration.narrix = meta.narrix;
229
+ delete meta.narrix;
230
+ changed = true;
231
+ }
232
+ if (!changed)
233
+ return false;
234
+ node.taskConfiguration = taskConfiguration;
235
+ if (Object.keys(meta).length === 0) {
236
+ delete node.metadata;
237
+ }
238
+ else {
239
+ node.metadata = meta;
240
+ }
241
+ return true;
242
+ }
243
+ function canonicalizeTaskNodeIoAndMetadata(node) {
244
+ let changed = false;
245
+ if (migrateTaskVariablesFromBindings(node))
246
+ changed = true;
247
+ if (renameInputsToInputsConfig(node))
248
+ changed = true;
249
+ if (renameOutputMappingToExecutionMapping(node))
250
+ changed = true;
251
+ if (migrateExecutionConfigFromMetadata(node))
252
+ changed = true;
253
+ if (canonicalizeTaskNodePlacement(node))
254
+ changed = true;
255
+ return changed;
256
+ }
257
+ /**
258
+
259
+ * Canonicalizes task nodes toward `docs/formats-documentations`:
260
+
261
+ * - splits dynamic config into `taskVariable`
262
+
263
+ * - renames `inputs` → `inputsConfig`, `outputMapping` → `executionMapping`
264
+
265
+ * - moves execution keys from `metadata` → `taskConfiguration`
266
+
267
+ * - preserves `variables.*` / `jobVariables.*` / `taskVariables.*` path refs as authored
268
+
269
+ */
270
+ export function canonicalizeGraphTaskNodeTaskVariable(graph) {
271
+ return canonicalizeGraphModel(graph);
272
+ }
273
+ /** Full graph model canonicalization for create/modify output. */
274
+ export function canonicalizeGraphModel(graph) {
275
+ const g = { ...graph };
276
+ let changed = canonicalizeGraphDocumentShell(g);
277
+ const nodes = g.nodes;
278
+ if (!Array.isArray(nodes)) {
279
+ return changed ? g : graph;
280
+ }
281
+ const nextNodes = nodes.map((n) => {
282
+ const node = readRecord(n);
283
+ if (node === undefined)
284
+ return n;
285
+ const copy = { ...node };
286
+ if (isTaskNode(copy) && canonicalizeTaskNodeIoAndMetadata(copy)) {
287
+ changed = true;
288
+ return copy;
289
+ }
290
+ if (!isTaskNode(copy) && canonicalizeTaskNodePlacement(copy)) {
291
+ changed = true;
292
+ return copy;
293
+ }
294
+ return n;
295
+ });
296
+ if (!changed)
297
+ return graph;
298
+ return { ...g, nodes: nextNodes };
299
+ }
300
+ export function taskNodeInputsLayoutWarningMessage(issues) {
301
+ const parts = [];
302
+ const questionInBindings = issues.filter((i) => i.code === "question_in_inputs");
303
+ if (questionInBindings.length > 0) {
304
+ const detail = questionInBindings
305
+ .map((i) => i.nodeId || "(missing id)")
306
+ .join("; ");
307
+ parts.push(`Task node(s) had dynamic question under inputs/inputsConfig; moved to taskVariable.question: ${detail}.`);
308
+ }
309
+ const inBindings = issues.filter((i) => i.code === "variables_in_inputs");
310
+ if (inBindings.length > 0) {
311
+ const detail = inBindings
312
+ .map((i) => {
313
+ const keys = i.keys?.length ? ` (${i.keys.join(", ")})` : "";
314
+ return `${i.nodeId || "(missing id)"}${keys}`;
315
+ })
316
+ .join("; ");
317
+ parts.push(`Task node(s) had variable refs under inputs/inputsConfig; moved to taskVariable: ${detail}.`);
318
+ }
319
+ const bothInputs = issues.filter((i) => i.code === "deprecated_inputs_and_inputsConfig");
320
+ if (bothInputs.length > 0) {
321
+ parts.push(`Task node(s) had both inputs and inputsConfig; merged into inputsConfig: ${bothInputs.map((i) => i.nodeId).join("; ")}.`);
322
+ }
323
+ const deprecatedInputs = issues.filter((i) => i.code === "deprecated_inputs_field");
324
+ if (deprecatedInputs.length > 0) {
325
+ parts.push(`Task node(s) renamed inputs → inputsConfig: ${deprecatedInputs.map((i) => i.nodeId).join("; ")}.`);
326
+ }
327
+ const deprecatedOm = issues.filter((i) => i.code === "deprecated_output_mapping");
328
+ if (deprecatedOm.length > 0) {
329
+ parts.push(`Task node(s) renamed outputMapping → executionMapping: ${deprecatedOm.map((i) => i.nodeId).join("; ")}.`);
330
+ }
331
+ const metaProfile = issues.filter((i) => i.code === "metadata_ai_task_profile");
332
+ if (metaProfile.length > 0) {
333
+ parts.push(`Task node(s) moved metadata.aiTaskProfile → taskConfiguration.aiTaskProfile: ${metaProfile.map((i) => i.nodeId).join("; ")}.`);
334
+ }
335
+ const metaNarrix = issues.filter((i) => i.code === "metadata_narrix");
336
+ if (metaNarrix.length > 0) {
337
+ parts.push(`Task node(s) moved metadata.narrix → taskConfiguration.narrix: ${metaNarrix.map((i) => i.nodeId).join("; ")}.`);
338
+ }
339
+ const metaExec = issues.filter((i) => i.code === "metadata_execution_key");
340
+ if (metaExec.length > 0) {
341
+ const detail = metaExec
342
+ .map((i) => `${i.nodeId || "(missing id)"}${i.metadataKey ? ` (${i.metadataKey})` : ""}`)
343
+ .join("; ");
344
+ parts.push(`Task node(s) moved metadata execution keys → taskConfiguration: ${detail}.`);
345
+ }
346
+ return parts.join(" ");
347
+ }
@@ -0,0 +1,174 @@
1
+ export type SkillDescriptor = {
2
+ skillKey: string;
3
+ description: string;
4
+ isLocal?: boolean;
5
+ inputSchema?: object;
6
+ outputSchema?: object;
7
+ tags?: string[];
8
+ };
9
+ /** Candidate scoping map / question row from Catalox or host (see docs/worox-graphs-catalogs.md). */
10
+ export type ScopingMapCandidate = {
11
+ scopingMapId?: string;
12
+ questionId?: string;
13
+ title?: string;
14
+ description?: string;
15
+ tags?: string[];
16
+ };
17
+ /** Candidate narrix / discovery-definition template from Catalox or host. */
18
+ export type NarrixTemplateCandidate = {
19
+ id?: string;
20
+ title?: string;
21
+ description?: string;
22
+ datasetId?: string;
23
+ layer?: string;
24
+ narrativeTypeIds?: string[];
25
+ enableWebScope?: boolean;
26
+ tags?: string[];
27
+ };
28
+ /**
29
+ * Optional catalog rows from **Catalox** (see `loadCatalogCandidatesFromCatalox`) or fixtures.
30
+ * Merged with `aiSkills` / `utilitySkills` on the same request for matching.
31
+ */
32
+ export type CatalogCandidates = {
33
+ aiSkills?: SkillDescriptor[];
34
+ utilitySkills?: SkillDescriptor[];
35
+ scopingMaps?: ScopingMapCandidate[];
36
+ narrixTemplates?: NarrixTemplateCandidate[];
37
+ };
38
+ /** Matches worox-graphs-playground `INTENT_TYPE_OPTIONS`. */
39
+ export type PrimaryIntentType = "question" | "decision" | "action" | "objective";
40
+ /** Intent Map v3 lifecycle (`metadata.graphConcept.conceptStatus`). */
41
+ export type GraphConceptStatus = "not-started" | "generated-draft" | "user-refined" | "complete";
42
+ /**
43
+ * Lane 1 — graph subject: which xmemory entity collections the graph is about
44
+ * (Catalox `xmemory.entityCollections`). Not execution-memory IO.
45
+ */
46
+ export type GraphConceptEntityBindings = {
47
+ coreEntityCollectionId?: string;
48
+ supportingEntityCollectionIds?: string[];
49
+ targetEntityCollectionId?: string;
50
+ };
51
+ /** Keys mergeable into `metadata.graphConcept` for primary intent / objective. */
52
+ export type GraphConceptPatchKey = "primaryIntentType" | "primaryIntentStatement" | "businessObjective" | "primaryOutcome";
53
+ /** Partial `requirements` for one `coreTasks[i]` entry (reviewConcept patches); consumers deep-merge. */
54
+ export type GraphConceptRequirementsPatch = {
55
+ skill?: {
56
+ skillKey: string;
57
+ isLocal?: boolean;
58
+ };
59
+ catalogBinding?: Record<string, unknown>;
60
+ /** PRE/POST ai-task strategy catalog ids (Intent Map v3). */
61
+ strategies?: {
62
+ pre?: string[];
63
+ post?: string[];
64
+ };
65
+ narrix?: Record<string, unknown>;
66
+ memoryIO?: {
67
+ reads?: string[];
68
+ writes?: string;
69
+ jobContextMappings?: Record<string, unknown>;
70
+ };
71
+ };
72
+ /** Partial core task aligned by index with `metadata.graphConcept.coreTasks`. */
73
+ export type GraphConceptCoreTaskPatchItem = {
74
+ taskType?: PrimaryIntentType;
75
+ statement?: string;
76
+ details?: string;
77
+ sourceFamilyHints?: string[];
78
+ /** 0-based core task index, or -1 = after start; omit for auto / parallel. */
79
+ planningRunsAfterTaskIndex?: number;
80
+ /** v3 path hint string; object kept for legacy patches. */
81
+ stepInputs?: string | Record<string, unknown>;
82
+ subTasks?: Record<string, unknown>[];
83
+ requirements?: GraphConceptRequirementsPatch;
84
+ webScoping?: Record<string, unknown>;
85
+ synthesis?: Record<string, unknown>;
86
+ };
87
+ export type GraphConceptPatch = {
88
+ primaryIntentType?: PrimaryIntentType;
89
+ primaryIntentStatement?: string;
90
+ businessObjective?: string;
91
+ primaryOutcome?: string;
92
+ graphType?: string;
93
+ expectedInput?: string;
94
+ outputDescription?: string;
95
+ persistenceNotes?: string;
96
+ notes?: string;
97
+ targetEntityType?: string;
98
+ decisionType?: string;
99
+ conceptStatus?: GraphConceptStatus;
100
+ entityBindings?: GraphConceptEntityBindings;
101
+ coreTasks?: (GraphConceptCoreTaskPatchItem | null | undefined)[];
102
+ };
103
+ /** One ranked option when a requirement field is ambiguous (`reviewConcept`). */
104
+ export type RequirementOptionCandidate = {
105
+ value?: string;
106
+ rationale?: string;
107
+ source?: string;
108
+ };
109
+ /** Per-field candidate list for UIs (`reviewConcept`). */
110
+ export type RequirementOptionEntry = {
111
+ taskIndex: number;
112
+ /** Dot path under `requirements`, e.g. `narrix.datasetId`, `memoryIO.writes`. */
113
+ field: string;
114
+ candidates: RequirementOptionCandidate[];
115
+ needsNewArtifact: boolean;
116
+ };
117
+ export type GraphComposerIntent = {
118
+ action: "create" | "modify" | "explain" | "suggestConceptObjective" | "suggestCatalogResolution" | "suggestCatalogCreations" | "suggestScopingNeedMatch" | "suggestScopingMapCreation" | "reviewConcept";
119
+ description: string;
120
+ focusNodeIds?: string[];
121
+ /**
122
+ * For `suggestConceptObjective`: drop each listed patch field when
123
+ * `existingGraph.metadata.graphConcept.<field>` is already a non-empty string.
124
+ */
125
+ onlyIfEmpty?: GraphConceptPatchKey[];
126
+ };
127
+ export type GraphComposerConstraints = {
128
+ maxNodes?: number;
129
+ requireFinalizer?: boolean;
130
+ allowConditionalEdges?: boolean;
131
+ executionMemorySchema?: object;
132
+ };
133
+ /**
134
+ * Input to `runGraphComposer` / `runGraphWorker`. The object sent to the LLM may also
135
+ * include `graphConceptFromStory` when the worker injects a parsed graph concept story;
136
+ * that key is omitted from this type.
137
+ */
138
+ export type GraphComposerInput = {
139
+ intent: GraphComposerIntent;
140
+ existingGraph?: object;
141
+ /**
142
+ * Optional analyzer payload (execution order, node IO, issues, layers, …).
143
+ * Strongly recommended for `suggestConceptObjective`.
144
+ */
145
+ analysisContext?: object;
146
+ skillMode?: "locked" | "extensible";
147
+ aiSkills?: SkillDescriptor[];
148
+ utilitySkills?: SkillDescriptor[];
149
+ constraints?: GraphComposerConstraints;
150
+ /** Optional managed-catalog rows; used by suggestCatalog* actions and matchLists assist. */
151
+ catalogCandidates?: CatalogCandidates;
152
+ /**
153
+ * Set only by `runGraphWorker` when matchLists assist runs; serialized into the worker prompt.
154
+ * Callers must not supply this field.
155
+ */
156
+ catalogMatchHints?: Record<string, unknown>;
157
+ /**
158
+ * Set only by `runGraphWorker` for `suggestScopingNeedMatch` when matchLists assist runs.
159
+ * Callers must not supply this field.
160
+ */
161
+ scopingNeedMatchHints?: Record<string, unknown>;
162
+ };
163
+ /** Natural-language goal for `runGraphComposerAgent` (orchestrator + toolbox workers). */
164
+ export type GraphComposerAgentInput = {
165
+ goal: string;
166
+ existingGraph?: object;
167
+ analysisContext?: object;
168
+ skillMode?: "locked" | "extensible";
169
+ aiSkills?: SkillDescriptor[];
170
+ utilitySkills?: SkillDescriptor[];
171
+ constraints?: GraphComposerConstraints;
172
+ catalogCandidates?: CatalogCandidates;
173
+ };
174
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,qGAAqG;AACrG,MAAM,MAAM,mBAAmB,GAAG;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,aAAa,CAAC,EAAE,eAAe,EAAE,CAAC;IAClC,WAAW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