@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.
- package/.env.example +66 -0
- package/LICENSE +21 -0
- package/README.md +329 -0
- package/dist/aiTaskProfile.d.ts +66 -0
- package/dist/aiTaskProfile.d.ts.map +1 -0
- package/dist/aiTaskProfile.js +179 -0
- package/dist/canonicalGraphDocument.d.ts +8 -0
- package/dist/canonicalGraphDocument.d.ts.map +1 -0
- package/dist/canonicalGraphDocument.js +344 -0
- package/dist/canonicalGraphWarnings.d.ts +6 -0
- package/dist/canonicalGraphWarnings.d.ts.map +1 -0
- package/dist/canonicalGraphWarnings.js +140 -0
- package/dist/catalogMatchAssist.d.ts +20 -0
- package/dist/catalogMatchAssist.d.ts.map +1 -0
- package/dist/catalogMatchAssist.js +203 -0
- package/dist/cataloxCatalogBridge.d.ts +103 -0
- package/dist/cataloxCatalogBridge.d.ts.map +1 -0
- package/dist/cataloxCatalogBridge.js +222 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +43 -0
- package/dist/composeInstructions.d.ts +11 -0
- package/dist/composeInstructions.d.ts.map +1 -0
- package/dist/composeInstructions.js +39 -0
- package/dist/defaultUtilitySkills.d.ts +4 -0
- package/dist/defaultUtilitySkills.d.ts.map +1 -0
- package/dist/defaultUtilitySkills.js +5 -0
- package/dist/exampleGeneration.d.ts +15 -0
- package/dist/exampleGeneration.d.ts.map +1 -0
- package/dist/exampleGeneration.js +72 -0
- package/dist/exampleInputs.d.ts +12 -0
- package/dist/exampleInputs.d.ts.map +1 -0
- package/dist/exampleInputs.js +181 -0
- package/dist/graphComposerActions.d.ts +22 -0
- package/dist/graphComposerActions.d.ts.map +1 -0
- package/dist/graphComposerActions.js +168 -0
- package/dist/graphComposerAgent.d.ts +26 -0
- package/dist/graphComposerAgent.d.ts.map +1 -0
- package/dist/graphComposerAgent.js +175 -0
- package/dist/graphComposerOutputValidation.d.ts +23 -0
- package/dist/graphComposerOutputValidation.d.ts.map +1 -0
- package/dist/graphComposerOutputValidation.js +709 -0
- package/dist/graphConceptPatchMerge.d.ts +10 -0
- package/dist/graphConceptPatchMerge.d.ts.map +1 -0
- package/dist/graphConceptPatchMerge.js +40 -0
- package/dist/graphEngineBridge.d.ts +7 -0
- package/dist/graphEngineBridge.d.ts.map +1 -0
- package/dist/graphEngineBridge.js +5 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/openRouterConnectTimeout.d.ts +3 -0
- package/dist/openRouterConnectTimeout.d.ts.map +1 -0
- package/dist/openRouterConnectTimeout.js +48 -0
- package/dist/packDir.d.ts +7 -0
- package/dist/packDir.d.ts.map +1 -0
- package/dist/packDir.js +23 -0
- package/dist/parseGraphConceptStory.d.ts +21 -0
- package/dist/parseGraphConceptStory.d.ts.map +1 -0
- package/dist/parseGraphConceptStory.js +105 -0
- package/dist/redactForLog.d.ts +2 -0
- package/dist/redactForLog.d.ts.map +1 -0
- package/dist/redactForLog.js +37 -0
- package/dist/runGraphComposer.d.ts +54 -0
- package/dist/runGraphComposer.d.ts.map +1 -0
- package/dist/runGraphComposer.js +444 -0
- package/dist/scopingCatalogHostTypes.d.ts +28 -0
- package/dist/scopingCatalogHostTypes.d.ts.map +1 -0
- package/dist/scopingCatalogHostTypes.js +6 -0
- package/dist/scopingNeedMatchAssist.d.ts +14 -0
- package/dist/scopingNeedMatchAssist.d.ts.map +1 -0
- package/dist/scopingNeedMatchAssist.js +58 -0
- package/dist/taskNodeTaskVariable.d.ts +44 -0
- package/dist/taskNodeTaskVariable.d.ts.map +1 -0
- package/dist/taskNodeTaskVariable.js +347 -0
- package/dist/types.d.ts +174 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/examples/network-vuln-subnet-triage.v2.json +389 -0
- package/functions/graph-composer/meta.json +607 -0
- package/functions/graph-composer/prompts/README.md +46 -0
- package/functions/graph-composer/prompts/action-create.md +51 -0
- package/functions/graph-composer/prompts/action-explain.md +26 -0
- package/functions/graph-composer/prompts/action-modify.md +32 -0
- package/functions/graph-composer/prompts/action-review-concept.md +97 -0
- package/functions/graph-composer/prompts/action-suggest-catalog-creations.md +31 -0
- package/functions/graph-composer/prompts/action-suggest-catalog-resolution.md +42 -0
- package/functions/graph-composer/prompts/action-suggest-concept-objective.md +38 -0
- package/functions/graph-composer/prompts/action-suggest-scoping-map-creation.md +31 -0
- package/functions/graph-composer/prompts/action-suggest-scoping-need-match.md +25 -0
- package/functions/graph-composer/prompts/default-utility-skills.json +22 -0
- package/functions/graph-composer/prompts/judge-rules.md +30 -0
- package/functions/graph-composer/prompts/orchestrator-system.md +21 -0
- package/functions/graph-composer/prompts/shared/graph-format.md +124 -0
- package/functions/graph-composer/prompts/shared/request-context.md +12 -0
- package/functions/graph-composer/prompts/shared/skill-selection.md +6 -0
- package/functions/graph-composer/prompts/shared/structural-validation.md +19 -0
- package/functions/graph-composer/prompts/skill-catalog-ai-header.md +3 -0
- package/functions/graph-composer/prompts/skill-catalog-utility-header.md +3 -0
- package/functions/graph-composer/prompts/skill-mode-extensible.md +7 -0
- package/functions/graph-composer/prompts/skill-mode-locked.md +7 -0
- package/functions/graph-composer/test-cases.json +52 -0
- package/package.json +86 -0
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "graph-composer",
|
|
3
|
+
"status": "draft",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"scoreGate": 0.85,
|
|
6
|
+
"$defs": {
|
|
7
|
+
"GraphConceptEntityBindings": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"description": "Lane 1 — xmemory entity collections the graph is about (Intent Map v3)",
|
|
10
|
+
"properties": {
|
|
11
|
+
"coreEntityCollectionId": { "type": "string" },
|
|
12
|
+
"supportingEntityCollectionIds": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"items": { "type": "string" }
|
|
15
|
+
},
|
|
16
|
+
"targetEntityCollectionId": { "type": "string" }
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"GraphConceptRequirementsPatch": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"description": "Partial requirements for one coreTask (reviewConcept patch); consumers deep-merge",
|
|
22
|
+
"properties": {
|
|
23
|
+
"skill": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"properties": {
|
|
26
|
+
"skillKey": { "type": "string" },
|
|
27
|
+
"isLocal": { "type": "boolean" }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"catalogBinding": { "type": "object" },
|
|
31
|
+
"strategies": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"description": "PRE/POST ai-task strategy catalog ids",
|
|
34
|
+
"properties": {
|
|
35
|
+
"pre": { "type": "array", "items": { "type": "string" } },
|
|
36
|
+
"post": { "type": "array", "items": { "type": "string" } }
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"narrix": { "type": "object" },
|
|
40
|
+
"memoryIO": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"properties": {
|
|
43
|
+
"reads": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": { "type": "string" }
|
|
46
|
+
},
|
|
47
|
+
"writes": { "type": "string" },
|
|
48
|
+
"jobContextMappings": { "type": "object" }
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"GraphConceptCoreTaskPatchItem": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"description": "Partial coreTask aligned by index with metadata.graphConcept.coreTasks",
|
|
56
|
+
"properties": {
|
|
57
|
+
"taskType": {
|
|
58
|
+
"enum": ["question", "decision", "action", "objective"],
|
|
59
|
+
"description": "Sketch step intent type"
|
|
60
|
+
},
|
|
61
|
+
"statement": { "type": "string" },
|
|
62
|
+
"details": { "type": "string" },
|
|
63
|
+
"sourceFamilyHints": {
|
|
64
|
+
"type": "array",
|
|
65
|
+
"items": { "type": "string" }
|
|
66
|
+
},
|
|
67
|
+
"planningRunsAfterTaskIndex": {
|
|
68
|
+
"type": "integer",
|
|
69
|
+
"minimum": -1,
|
|
70
|
+
"description": "0-based core task index this follows, or -1 after start; omit for auto"
|
|
71
|
+
},
|
|
72
|
+
"stepInputs": {
|
|
73
|
+
"description": "v3 string path hints or legacy object",
|
|
74
|
+
"anyOf": [{ "type": "string" }, { "type": "object" }]
|
|
75
|
+
},
|
|
76
|
+
"subTasks": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"items": { "type": "object" }
|
|
79
|
+
},
|
|
80
|
+
"requirements": {
|
|
81
|
+
"$ref": "#/$defs/GraphConceptRequirementsPatch"
|
|
82
|
+
},
|
|
83
|
+
"webScoping": { "type": "object" },
|
|
84
|
+
"synthesis": { "type": "object" }
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"RequirementOptionCandidate": {
|
|
88
|
+
"type": "object",
|
|
89
|
+
"description": "One ranked option for a requirement field (value and/or rationale)",
|
|
90
|
+
"properties": {
|
|
91
|
+
"value": { "type": "string" },
|
|
92
|
+
"rationale": { "type": "string" },
|
|
93
|
+
"source": { "type": "string" }
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"RequirementOptionEntry": {
|
|
97
|
+
"type": "object",
|
|
98
|
+
"description": "Ambiguous requirement field: candidates and whether a new catalog artifact is needed",
|
|
99
|
+
"required": ["taskIndex", "field", "candidates", "needsNewArtifact"],
|
|
100
|
+
"properties": {
|
|
101
|
+
"taskIndex": {
|
|
102
|
+
"type": "integer",
|
|
103
|
+
"minimum": 0
|
|
104
|
+
},
|
|
105
|
+
"field": { "type": "string" },
|
|
106
|
+
"candidates": {
|
|
107
|
+
"type": "array",
|
|
108
|
+
"minItems": 1,
|
|
109
|
+
"items": { "$ref": "#/$defs/RequirementOptionCandidate" }
|
|
110
|
+
},
|
|
111
|
+
"needsNewArtifact": { "type": "boolean" }
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"GraphConceptPatch": {
|
|
115
|
+
"type": "object",
|
|
116
|
+
"description": "Merge into graph.metadata.graphConcept (suggestConceptObjective primary fields; reviewConcept may add coreTasks and extended strings)",
|
|
117
|
+
"properties": {
|
|
118
|
+
"primaryIntentType": {
|
|
119
|
+
"enum": ["question", "decision", "action", "objective"],
|
|
120
|
+
"description": "L1 intent classification for the whole graph"
|
|
121
|
+
},
|
|
122
|
+
"primaryIntentStatement": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"description": "One or two product-facing sentences: overall goal"
|
|
125
|
+
},
|
|
126
|
+
"businessObjective": { "type": "string" },
|
|
127
|
+
"primaryOutcome": { "type": "string" },
|
|
128
|
+
"graphType": { "type": "string" },
|
|
129
|
+
"expectedInput": { "type": "string" },
|
|
130
|
+
"outputDescription": { "type": "string" },
|
|
131
|
+
"persistenceNotes": { "type": "string" },
|
|
132
|
+
"notes": { "type": "string" },
|
|
133
|
+
"targetEntityType": { "type": "string" },
|
|
134
|
+
"decisionType": { "type": "string" },
|
|
135
|
+
"conceptStatus": {
|
|
136
|
+
"enum": [
|
|
137
|
+
"not-started",
|
|
138
|
+
"generated-draft",
|
|
139
|
+
"user-refined",
|
|
140
|
+
"complete"
|
|
141
|
+
],
|
|
142
|
+
"description": "Intent Map v3 concept lifecycle"
|
|
143
|
+
},
|
|
144
|
+
"entityBindings": {
|
|
145
|
+
"$ref": "#/$defs/GraphConceptEntityBindings"
|
|
146
|
+
},
|
|
147
|
+
"coreTasks": {
|
|
148
|
+
"type": "array",
|
|
149
|
+
"description": "Index-aligned partial core tasks (reviewConcept)",
|
|
150
|
+
"items": {
|
|
151
|
+
"anyOf": [
|
|
152
|
+
{ "type": "null" },
|
|
153
|
+
{ "$ref": "#/$defs/GraphConceptCoreTaskPatchItem" }
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
"SkillDescriptor": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"required": ["skillKey", "description"],
|
|
162
|
+
"properties": {
|
|
163
|
+
"skillKey": { "type": "string" },
|
|
164
|
+
"description": { "type": "string" },
|
|
165
|
+
"isLocal": { "type": "boolean", "default": false },
|
|
166
|
+
"inputSchema": { "type": "object" },
|
|
167
|
+
"outputSchema": { "type": "object" },
|
|
168
|
+
"tags": { "type": "array", "items": { "type": "string" } }
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"ScopingMapCandidate": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"description": "Scoping map or question-id row from MetaDB or host",
|
|
174
|
+
"properties": {
|
|
175
|
+
"scopingMapId": { "type": "string" },
|
|
176
|
+
"questionId": { "type": "string" },
|
|
177
|
+
"title": { "type": "string" },
|
|
178
|
+
"description": { "type": "string" },
|
|
179
|
+
"tags": { "type": "array", "items": { "type": "string" } }
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"NarrixTemplateCandidate": {
|
|
183
|
+
"type": "object",
|
|
184
|
+
"description": "Narrix / discovery-definition template candidate",
|
|
185
|
+
"properties": {
|
|
186
|
+
"id": { "type": "string" },
|
|
187
|
+
"title": { "type": "string" },
|
|
188
|
+
"description": { "type": "string" },
|
|
189
|
+
"datasetId": { "type": "string" },
|
|
190
|
+
"layer": { "type": "string" },
|
|
191
|
+
"narrativeTypeIds": {
|
|
192
|
+
"type": "array",
|
|
193
|
+
"items": { "type": "string" }
|
|
194
|
+
},
|
|
195
|
+
"enableWebScope": { "type": "boolean" },
|
|
196
|
+
"tags": { "type": "array", "items": { "type": "string" } }
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"CatalogCandidates": {
|
|
200
|
+
"type": "object",
|
|
201
|
+
"description": "Optional managed-catalog rows; merged with aiSkills/utilitySkills for suggestCatalog*; scopingMaps required for suggestScopingNeedMatch",
|
|
202
|
+
"properties": {
|
|
203
|
+
"aiSkills": {
|
|
204
|
+
"type": "array",
|
|
205
|
+
"items": { "$ref": "#/$defs/SkillDescriptor" }
|
|
206
|
+
},
|
|
207
|
+
"utilitySkills": {
|
|
208
|
+
"type": "array",
|
|
209
|
+
"items": { "$ref": "#/$defs/SkillDescriptor" }
|
|
210
|
+
},
|
|
211
|
+
"scopingMaps": {
|
|
212
|
+
"type": "array",
|
|
213
|
+
"items": { "$ref": "#/$defs/ScopingMapCandidate" }
|
|
214
|
+
},
|
|
215
|
+
"narrixTemplates": {
|
|
216
|
+
"type": "array",
|
|
217
|
+
"items": { "$ref": "#/$defs/NarrixTemplateCandidate" }
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"io": {
|
|
223
|
+
"input": {
|
|
224
|
+
"type": "object",
|
|
225
|
+
"required": ["intent"],
|
|
226
|
+
"properties": {
|
|
227
|
+
"intent": {
|
|
228
|
+
"type": "object",
|
|
229
|
+
"required": ["action", "description"],
|
|
230
|
+
"properties": {
|
|
231
|
+
"action": {
|
|
232
|
+
"enum": [
|
|
233
|
+
"create",
|
|
234
|
+
"modify",
|
|
235
|
+
"explain",
|
|
236
|
+
"suggestConceptObjective",
|
|
237
|
+
"suggestCatalogResolution",
|
|
238
|
+
"suggestCatalogCreations",
|
|
239
|
+
"suggestScopingNeedMatch",
|
|
240
|
+
"suggestScopingMapCreation",
|
|
241
|
+
"reviewConcept"
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
"description": {
|
|
245
|
+
"type": "string",
|
|
246
|
+
"description": "User goal, or a graph concept story: optional marker line `# graphConcept story` plus `key: value` lines and multiline `|` blocks for whole-graph create/modify."
|
|
247
|
+
},
|
|
248
|
+
"focusNodeIds": {
|
|
249
|
+
"type": "array",
|
|
250
|
+
"items": { "type": "string" },
|
|
251
|
+
"description": "For modify/explain — limit scope to these nodes"
|
|
252
|
+
},
|
|
253
|
+
"onlyIfEmpty": {
|
|
254
|
+
"type": "array",
|
|
255
|
+
"items": {
|
|
256
|
+
"enum": [
|
|
257
|
+
"primaryIntentType",
|
|
258
|
+
"primaryIntentStatement",
|
|
259
|
+
"businessObjective",
|
|
260
|
+
"primaryOutcome"
|
|
261
|
+
]
|
|
262
|
+
},
|
|
263
|
+
"description": "For suggestConceptObjective — skip patch keys when metadata.graphConcept already has a value"
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
"existingGraph": {
|
|
268
|
+
"description": "Required for modify, explain, suggestConceptObjective, suggestCatalogResolution, suggestCatalogCreations, reviewConcept. Optional for suggestScopingNeedMatch (context) and suggestScopingMapCreation (alignment).",
|
|
269
|
+
"type": "object"
|
|
270
|
+
},
|
|
271
|
+
"analysisContext": {
|
|
272
|
+
"type": "object",
|
|
273
|
+
"description": "Optional graph analysis output (execution order, IO, issues, …). Strongly recommended for suggestConceptObjective, reviewConcept, and suggestCatalog*."
|
|
274
|
+
},
|
|
275
|
+
"skillMode": {
|
|
276
|
+
"enum": ["locked", "extensible"],
|
|
277
|
+
"default": "locked"
|
|
278
|
+
},
|
|
279
|
+
"aiSkills": {
|
|
280
|
+
"type": "array",
|
|
281
|
+
"items": { "$ref": "#/$defs/SkillDescriptor" },
|
|
282
|
+
"description": "AI-backed skills (call ai-tasks)"
|
|
283
|
+
},
|
|
284
|
+
"utilitySkills": {
|
|
285
|
+
"type": "array",
|
|
286
|
+
"items": { "$ref": "#/$defs/SkillDescriptor" },
|
|
287
|
+
"description": "Local/deterministic skills (runtime-intercepted)"
|
|
288
|
+
},
|
|
289
|
+
"catalogCandidates": {
|
|
290
|
+
"$ref": "#/$defs/CatalogCandidates",
|
|
291
|
+
"description": "Extra catalog rows from worox-graph MetaDB list APIs (or fixtures) for suggestCatalog* and suggestScoping*"
|
|
292
|
+
},
|
|
293
|
+
"catalogMatchHints": {
|
|
294
|
+
"type": "object",
|
|
295
|
+
"description": "Injected by runGraphWorker when matchLists assist runs; do not set from clients"
|
|
296
|
+
},
|
|
297
|
+
"scopingNeedMatchHints": {
|
|
298
|
+
"type": "object",
|
|
299
|
+
"description": "Injected by runGraphWorker for suggestScopingNeedMatch matchLists assist; do not set from clients"
|
|
300
|
+
},
|
|
301
|
+
"graphConceptFromStory": {
|
|
302
|
+
"type": "object",
|
|
303
|
+
"description": "Injected by graph-composer on create/modify/reviewConcept when intent.description matches a graph concept story. Clients normally omit.",
|
|
304
|
+
"properties": {
|
|
305
|
+
"parsed": {
|
|
306
|
+
"type": "object",
|
|
307
|
+
"description": "Normalized fields (e.g. graphType, primaryIntentStatement, expectedInput, coreTasks array)."
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"constraints": {
|
|
312
|
+
"type": "object",
|
|
313
|
+
"properties": {
|
|
314
|
+
"maxNodes": { "type": "integer" },
|
|
315
|
+
"requireFinalizer": { "type": "boolean", "default": true },
|
|
316
|
+
"allowConditionalEdges": { "type": "boolean", "default": true },
|
|
317
|
+
"executionMemorySchema": {
|
|
318
|
+
"type": "object",
|
|
319
|
+
"description": "Known execution-memory shape to guide outputMapping paths"
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
"output": {
|
|
326
|
+
"type": "object",
|
|
327
|
+
"required": ["action"],
|
|
328
|
+
"properties": {
|
|
329
|
+
"action": {
|
|
330
|
+
"enum": [
|
|
331
|
+
"create",
|
|
332
|
+
"modify",
|
|
333
|
+
"explain",
|
|
334
|
+
"suggestConceptObjective",
|
|
335
|
+
"suggestCatalogResolution",
|
|
336
|
+
"suggestCatalogCreations",
|
|
337
|
+
"suggestScopingNeedMatch",
|
|
338
|
+
"suggestScopingMapCreation",
|
|
339
|
+
"reviewConcept"
|
|
340
|
+
]
|
|
341
|
+
},
|
|
342
|
+
"graph": {
|
|
343
|
+
"type": "object",
|
|
344
|
+
"description": "Full graph JSON (create) or patched graph JSON (modify). Absent for explain."
|
|
345
|
+
},
|
|
346
|
+
"changelog": {
|
|
347
|
+
"type": "array",
|
|
348
|
+
"items": {
|
|
349
|
+
"type": "object",
|
|
350
|
+
"properties": {
|
|
351
|
+
"type": {
|
|
352
|
+
"enum": [
|
|
353
|
+
"added_node",
|
|
354
|
+
"removed_node",
|
|
355
|
+
"modified_node",
|
|
356
|
+
"added_edge",
|
|
357
|
+
"removed_edge",
|
|
358
|
+
"modified_edge",
|
|
359
|
+
"changed_variable",
|
|
360
|
+
"changed_finalizer"
|
|
361
|
+
]
|
|
362
|
+
},
|
|
363
|
+
"nodeId": { "type": "string" },
|
|
364
|
+
"summary": { "type": "string" }
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
"description": "Present for create and modify"
|
|
368
|
+
},
|
|
369
|
+
"explanation": {
|
|
370
|
+
"type": "object",
|
|
371
|
+
"properties": {
|
|
372
|
+
"summary": { "type": "string" },
|
|
373
|
+
"executionOrder": {
|
|
374
|
+
"type": "array",
|
|
375
|
+
"items": { "type": "string" },
|
|
376
|
+
"description": "Topological node-id sequence (with branching noted)"
|
|
377
|
+
},
|
|
378
|
+
"nodeDescriptions": {
|
|
379
|
+
"type": "array",
|
|
380
|
+
"items": {
|
|
381
|
+
"type": "object",
|
|
382
|
+
"properties": {
|
|
383
|
+
"nodeId": { "type": "string" },
|
|
384
|
+
"role": { "type": "string" },
|
|
385
|
+
"reads": { "type": "array", "items": { "type": "string" } },
|
|
386
|
+
"writes": { "type": "array", "items": { "type": "string" } }
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
"dataFlow": {
|
|
391
|
+
"type": "string",
|
|
392
|
+
"description": "Prose description of how data moves through execution memory"
|
|
393
|
+
},
|
|
394
|
+
"conditionalPaths": {
|
|
395
|
+
"type": "array",
|
|
396
|
+
"items": {
|
|
397
|
+
"type": "object",
|
|
398
|
+
"properties": {
|
|
399
|
+
"fromNodeId": { "type": "string" },
|
|
400
|
+
"branches": {
|
|
401
|
+
"type": "array",
|
|
402
|
+
"items": {
|
|
403
|
+
"type": "object",
|
|
404
|
+
"properties": {
|
|
405
|
+
"toNodeId": { "type": "string" },
|
|
406
|
+
"condition": { "type": "string" }
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
"description": "Present for explain"
|
|
415
|
+
},
|
|
416
|
+
"graphConceptPatch": {
|
|
417
|
+
"$ref": "#/$defs/GraphConceptPatch",
|
|
418
|
+
"description": "Present for suggestConceptObjective; optional for reviewConcept — merge into metadata.graphConcept"
|
|
419
|
+
},
|
|
420
|
+
"verdict": {
|
|
421
|
+
"type": "object",
|
|
422
|
+
"description": "Present for reviewConcept",
|
|
423
|
+
"required": ["coherent", "summary"],
|
|
424
|
+
"properties": {
|
|
425
|
+
"coherent": { "type": "boolean" },
|
|
426
|
+
"summary": { "type": "string" }
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
"findings": {
|
|
430
|
+
"type": "array",
|
|
431
|
+
"description": "Present for reviewConcept — categorized review findings",
|
|
432
|
+
"items": {
|
|
433
|
+
"type": "object",
|
|
434
|
+
"required": ["category", "severity", "summary"],
|
|
435
|
+
"properties": {
|
|
436
|
+
"category": { "type": "string" },
|
|
437
|
+
"severity": { "type": "string" },
|
|
438
|
+
"summary": { "type": "string" },
|
|
439
|
+
"taskIndex": {
|
|
440
|
+
"type": "integer",
|
|
441
|
+
"minimum": 0,
|
|
442
|
+
"description": "Zero-based index into metadata.graphConcept.coreTasks"
|
|
443
|
+
},
|
|
444
|
+
"nodeIds": {
|
|
445
|
+
"type": "array",
|
|
446
|
+
"items": { "type": "string" }
|
|
447
|
+
},
|
|
448
|
+
"suggestedChange": { "type": "string" },
|
|
449
|
+
"proposal": {
|
|
450
|
+
"type": "object",
|
|
451
|
+
"description": "Optional structured catalog / gap payload (e.g. category catalog)"
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
"requirementOptions": {
|
|
457
|
+
"type": "array",
|
|
458
|
+
"description": "Optional for reviewConcept — ranked candidates per requirement field when inference is ambiguous",
|
|
459
|
+
"items": { "$ref": "#/$defs/RequirementOptionEntry" }
|
|
460
|
+
},
|
|
461
|
+
"suggestedConceptPatch": {
|
|
462
|
+
"$ref": "#/$defs/GraphConceptPatch",
|
|
463
|
+
"description": "Optional for reviewConcept — partial patch for metadata.graphConcept (same shape as graphConceptPatch; prefer one key)"
|
|
464
|
+
},
|
|
465
|
+
"catalogProposals": {
|
|
466
|
+
"type": "array",
|
|
467
|
+
"description": "Optional for reviewConcept — structured catalog-gap proposals when bindings are missing",
|
|
468
|
+
"items": { "type": "object" }
|
|
469
|
+
},
|
|
470
|
+
"suggestedCatalogArtifacts": {
|
|
471
|
+
"type": "array",
|
|
472
|
+
"description": "Optional alias for catalogProposals (normalized to catalogProposals before validation)",
|
|
473
|
+
"items": { "type": "object" }
|
|
474
|
+
},
|
|
475
|
+
"skillResolution": {
|
|
476
|
+
"type": "array",
|
|
477
|
+
"description": "Present for suggestCatalogResolution",
|
|
478
|
+
"items": {
|
|
479
|
+
"type": "object",
|
|
480
|
+
"required": ["nodeId", "skillKey"],
|
|
481
|
+
"properties": {
|
|
482
|
+
"nodeId": { "type": "string" },
|
|
483
|
+
"skillKey": { "type": "string" },
|
|
484
|
+
"isLocal": { "type": "boolean" },
|
|
485
|
+
"confidence": { "type": "string" },
|
|
486
|
+
"rationale": { "type": "string" }
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
"scopingResolution": {
|
|
491
|
+
"type": "array",
|
|
492
|
+
"description": "Present for suggestCatalogResolution",
|
|
493
|
+
"items": { "type": "object" }
|
|
494
|
+
},
|
|
495
|
+
"narrixResolution": {
|
|
496
|
+
"type": "array",
|
|
497
|
+
"description": "Present for suggestCatalogResolution",
|
|
498
|
+
"items": { "type": "object" }
|
|
499
|
+
},
|
|
500
|
+
"gaps": {
|
|
501
|
+
"type": "array",
|
|
502
|
+
"description": "Present for suggestCatalogResolution — missing catalog coverage",
|
|
503
|
+
"items": {
|
|
504
|
+
"type": "object",
|
|
505
|
+
"required": ["kind", "summary"],
|
|
506
|
+
"properties": {
|
|
507
|
+
"kind": { "type": "string" },
|
|
508
|
+
"summary": { "type": "string" },
|
|
509
|
+
"suggestedRequestedId": { "type": "string" }
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
"catalogRequestProposals": {
|
|
514
|
+
"type": "array",
|
|
515
|
+
"description": "Present for suggestCatalogCreations — merge into graph.metadata.catalogRequests after MetaDB CRUD",
|
|
516
|
+
"items": {
|
|
517
|
+
"type": "object",
|
|
518
|
+
"required": ["catalogType", "requestedId"],
|
|
519
|
+
"properties": {
|
|
520
|
+
"catalogType": { "type": "string" },
|
|
521
|
+
"requestedId": { "type": "string" },
|
|
522
|
+
"status": { "type": "string" },
|
|
523
|
+
"reason": { "type": "string" },
|
|
524
|
+
"title": { "type": "string" },
|
|
525
|
+
"purpose": { "type": "string" },
|
|
526
|
+
"datasetId": { "type": "string" },
|
|
527
|
+
"layer": { "type": "string" },
|
|
528
|
+
"narrativeTypeIds": {
|
|
529
|
+
"type": "array",
|
|
530
|
+
"items": { "type": "string" }
|
|
531
|
+
},
|
|
532
|
+
"enableWebScope": { "type": "boolean" }
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
},
|
|
536
|
+
"newSkillDescriptors": {
|
|
537
|
+
"type": "array",
|
|
538
|
+
"description": "Optional for suggestCatalogCreations",
|
|
539
|
+
"items": { "$ref": "#/$defs/SkillDescriptor" }
|
|
540
|
+
},
|
|
541
|
+
"hasSuitableMatch": {
|
|
542
|
+
"type": "boolean",
|
|
543
|
+
"description": "Present for suggestScopingNeedMatch"
|
|
544
|
+
},
|
|
545
|
+
"recommended": {
|
|
546
|
+
"description": "Present for suggestScopingNeedMatch — object with scopingMapId and/or questionId when hasSuitableMatch; null otherwise",
|
|
547
|
+
"oneOf": [{ "type": "object" }, { "type": "null" }]
|
|
548
|
+
},
|
|
549
|
+
"alternatives": {
|
|
550
|
+
"type": "array",
|
|
551
|
+
"description": "Optional runners-up for suggestScopingNeedMatch",
|
|
552
|
+
"items": { "type": "object" }
|
|
553
|
+
},
|
|
554
|
+
"scopingMapProposal": {
|
|
555
|
+
"type": "object",
|
|
556
|
+
"description": "Present for suggestScopingMapCreation",
|
|
557
|
+
"required": [
|
|
558
|
+
"suggestedScopingMapId",
|
|
559
|
+
"title",
|
|
560
|
+
"purpose"
|
|
561
|
+
],
|
|
562
|
+
"properties": {
|
|
563
|
+
"suggestedScopingMapId": { "type": "string" },
|
|
564
|
+
"title": { "type": "string" },
|
|
565
|
+
"purpose": { "type": "string" },
|
|
566
|
+
"questionTitle": { "type": "string" },
|
|
567
|
+
"asks": { "type": "string" },
|
|
568
|
+
"entityIdPath": { "type": "string" },
|
|
569
|
+
"expectedFieldPaths": {
|
|
570
|
+
"type": "array",
|
|
571
|
+
"items": { "type": "string" }
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
"rationale": {
|
|
576
|
+
"type": "string",
|
|
577
|
+
"description": "Optional note for UI/logs (suggest* and catalog actions)"
|
|
578
|
+
},
|
|
579
|
+
"requiredSkills": {
|
|
580
|
+
"type": "array",
|
|
581
|
+
"items": {
|
|
582
|
+
"type": "object",
|
|
583
|
+
"required": [
|
|
584
|
+
"skillKey",
|
|
585
|
+
"description",
|
|
586
|
+
"expectedInputSchema",
|
|
587
|
+
"expectedOutputSchema"
|
|
588
|
+
],
|
|
589
|
+
"properties": {
|
|
590
|
+
"skillKey": { "type": "string" },
|
|
591
|
+
"description": { "type": "string" },
|
|
592
|
+
"expectedInputSchema": { "type": "object" },
|
|
593
|
+
"expectedOutputSchema": { "type": "object" },
|
|
594
|
+
"rationale": { "type": "string" }
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
|
+
"description": "Only present when skillMode=extensible and the LLM needed skills not in the provided lists"
|
|
598
|
+
},
|
|
599
|
+
"warnings": {
|
|
600
|
+
"type": "array",
|
|
601
|
+
"items": { "type": "string" },
|
|
602
|
+
"description": "Structural warnings: orphan nodes, missing edges, unmapped outputs, etc."
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# graph-composer prompts & templates
|
|
2
|
+
|
|
3
|
+
All **editable** instruction text and judge rules for this function pack live here. Runtime code loads these files from the published `functions/graph-composer/` tree.
|
|
4
|
+
|
|
5
|
+
## Per-action workers
|
|
6
|
+
|
|
7
|
+
Each **`intent.action`** maps to one **worker prompt file** plus optional **shared** fragments (see [`src/graphComposerActions.ts`](../../../src/graphComposerActions.ts) — the action registry is the source of truth).
|
|
8
|
+
|
|
9
|
+
| Path | Role |
|
|
10
|
+
|------|------|
|
|
11
|
+
| `shared/request-context.md` | How to read `intent`, `constraints`, `analysisContext`, etc. |
|
|
12
|
+
| `shared/graph-format.md` | worox-graph JSON shapes, execution memory, edges, finalizer |
|
|
13
|
+
| `shared/skill-selection.md` | How to pick catalog skills |
|
|
14
|
+
| `shared/structural-validation.md` | Checks before returning a graph (create/modify) |
|
|
15
|
+
| `action-create.md` | Worker for `create` only |
|
|
16
|
+
| `action-modify.md` | Worker for `modify` only |
|
|
17
|
+
| `action-explain.md` | Worker for `explain` only |
|
|
18
|
+
| `action-suggest-concept-objective.md` | Worker for `suggestConceptObjective` only |
|
|
19
|
+
| `action-review-concept.md` | Worker for `reviewConcept` only (concept review, no graph JSON) |
|
|
20
|
+
| `orchestrator-system.md` | System prompt for `runGraphComposerAgent` (tool loop) |
|
|
21
|
+
|
|
22
|
+
## Appended for every worker
|
|
23
|
+
|
|
24
|
+
| File | Role |
|
|
25
|
+
|------|------|
|
|
26
|
+
| `skill-mode-locked.md` | Appended when `skillMode` is `locked`. |
|
|
27
|
+
| `skill-mode-extensible.md` | Appended when `skillMode` is `extensible`. |
|
|
28
|
+
| `skill-catalog-ai-header.md` | Heading before injected AI skill list. |
|
|
29
|
+
| `skill-catalog-utility-header.md` | Heading before utility (local) skill list. |
|
|
30
|
+
| `judge-rules.md` | Human-readable doc; **weighted rules** for aifunctions-js (function-pack LLM call) live in the first fenced JSON block. |
|
|
31
|
+
| `default-utility-skills.json` | Default utility catalog when the request omits `utilitySkills`. |
|
|
32
|
+
|
|
33
|
+
Pack root (sibling of this folder) still holds `meta.json` and `test-cases.json`.
|
|
34
|
+
|
|
35
|
+
Legacy rules fallbacks: root-level `rules.json` or `rules` — see `loadRules` in `src/runGraphComposer.ts`.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Adding a new graph action
|
|
40
|
+
|
|
41
|
+
1. **`src/types.ts`**: Extend `GraphComposerIntent["action"]` with the new literal.
|
|
42
|
+
2. **`src/graphComposerActions.ts`**: Add a registry row (`action`, `promptFile`, `sharedIncludes`, `requiresExistingGraph`, `toolName`, `toolDescription`, `validateOutput`).
|
|
43
|
+
3. **`functions/graph-composer/prompts/`**: Add `action-<kebab>.md` (path must match `promptFile`) and any new `shared/*.md` fragments.
|
|
44
|
+
4. **`functions/graph-composer/meta.json`**: Extend `io.input` / `io.output` enums and shapes.
|
|
45
|
+
5. **Tests**: Unit coverage for composition + validation; add or extend a live smoke test when the action is LLM-backed.
|
|
46
|
+
6. **`npm run verify:local`**: Must stay green (required files are derived from the registry).
|