@agenticdiagrams/schema 0.1.5 → 0.1.7
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/README.md +10 -10
- package/dist/index.cjs +78 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -5
- package/dist/index.d.ts +38 -5
- package/dist/index.js +78 -10
- package/dist/index.js.map +1 -1
- package/examples/multi-agent-with-guardrails.agentic.yaml +1 -1
- package/examples/simple-agent.agentic.yaml +1 -1
- package/package.json +1 -1
- package/schema/agentic.v0.1.json +107 -15
package/README.md
CHANGED
|
@@ -44,14 +44,14 @@ Or reference it by URL: `https://agenticdiagrams.com/schemas/agentic/0.1.json`
|
|
|
44
44
|
|
|
45
45
|
## What's in the box
|
|
46
46
|
|
|
47
|
-
| Export
|
|
48
|
-
|
|
49
|
-
| `AgenticYaml`
|
|
50
|
-
| `AgenticNode`
|
|
51
|
-
| `AgenticEdge`
|
|
52
|
-
| `AgenticScenario` | Flow scenario with steps
|
|
53
|
-
| `AgenticLayout`
|
|
54
|
-
| `validate()`
|
|
47
|
+
| Export | Description |
|
|
48
|
+
| ----------------- | ----------------------------------------- |
|
|
49
|
+
| `AgenticYaml` | Root document type |
|
|
50
|
+
| `AgenticNode` | Node definition |
|
|
51
|
+
| `AgenticEdge` | Edge (connection) definition |
|
|
52
|
+
| `AgenticScenario` | Flow scenario with steps |
|
|
53
|
+
| `AgenticLayout` | Layout hints (positions, sizes, styles) |
|
|
54
|
+
| `validate()` | Structural validation against JSON Schema |
|
|
55
55
|
|
|
56
56
|
## Spec
|
|
57
57
|
|
|
@@ -68,13 +68,13 @@ The [`examples/`](examples/) directory contains complete `.agentic.yaml` files:
|
|
|
68
68
|
## Minimum valid document
|
|
69
69
|
|
|
70
70
|
```yaml
|
|
71
|
-
agentic:
|
|
71
|
+
agentic: '0.1'
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
A practical minimum:
|
|
75
75
|
|
|
76
76
|
```yaml
|
|
77
|
-
agentic:
|
|
77
|
+
agentic: '0.1'
|
|
78
78
|
nodes:
|
|
79
79
|
my-agent:
|
|
80
80
|
type: agent
|
package/dist/index.cjs
CHANGED
|
@@ -81,7 +81,10 @@ var agentic_v0_1_default = {
|
|
|
81
81
|
description: { type: "string" },
|
|
82
82
|
type: { type: "string", enum: ["system", "component"] },
|
|
83
83
|
active_scenario: { type: "string" },
|
|
84
|
-
parent_diagram: {
|
|
84
|
+
parent_diagram: {
|
|
85
|
+
type: "string",
|
|
86
|
+
description: "Parent diagram id for drill-down hierarchy"
|
|
87
|
+
},
|
|
85
88
|
created: { type: "string", format: "date-time" },
|
|
86
89
|
updated: { type: "string", format: "date-time" }
|
|
87
90
|
}
|
|
@@ -129,17 +132,36 @@ var agentic_v0_1_default = {
|
|
|
129
132
|
type: { $ref: "#/$defs/nodeType" },
|
|
130
133
|
label: { type: "string", description: "Display name (defaults to node id)" },
|
|
131
134
|
sub_title: { type: "string", description: "Secondary display text below label" },
|
|
135
|
+
badge: {
|
|
136
|
+
type: "string",
|
|
137
|
+
description: "Short tag shown on the node, e.g. NEW or beta"
|
|
138
|
+
},
|
|
132
139
|
description: { type: "string" },
|
|
133
140
|
sub_type: { type: "string" },
|
|
134
141
|
url: { type: "string", format: "uri" },
|
|
135
142
|
group: { type: "string", description: "Parent group node id" },
|
|
136
|
-
linked_diagram: {
|
|
143
|
+
linked_diagram: {
|
|
144
|
+
type: "string",
|
|
145
|
+
description: "Drill-down target diagram id or file path"
|
|
146
|
+
},
|
|
137
147
|
is_looping: { type: "boolean" },
|
|
138
148
|
auth: { type: "string" },
|
|
139
149
|
auth_detail: { type: "string" },
|
|
140
150
|
provider: { type: "string" },
|
|
151
|
+
model: {
|
|
152
|
+
type: "string",
|
|
153
|
+
description: "Model identifier, e.g. claude-sonnet-4-6. Primarily for agent and model nodes."
|
|
154
|
+
},
|
|
141
155
|
content: { type: "string" },
|
|
142
156
|
example_response: { type: "string" },
|
|
157
|
+
input_schema: {
|
|
158
|
+
type: "string",
|
|
159
|
+
description: "Input schema, usually JSON Schema serialised as a string. Primarily for tool nodes."
|
|
160
|
+
},
|
|
161
|
+
output_schema: {
|
|
162
|
+
type: "string",
|
|
163
|
+
description: "Output schema, usually JSON Schema serialised as a string. Primarily for tool nodes."
|
|
164
|
+
},
|
|
143
165
|
ttl: {
|
|
144
166
|
type: "string",
|
|
145
167
|
description: "Retention lifetime. Primarily for memory nodes. Preset values: session, 24h, permanent. Freeform strings (e.g. 7d) are accepted."
|
|
@@ -148,6 +170,7 @@ var agentic_v0_1_default = {
|
|
|
148
170
|
type: "string",
|
|
149
171
|
description: "Audience scope. Primarily for memory nodes. Preset values: per-user, per-session, global. Freeform strings accepted."
|
|
150
172
|
},
|
|
173
|
+
metadata: { $ref: "#/$defs/nodeMetadata" },
|
|
151
174
|
edges: {
|
|
152
175
|
type: "array",
|
|
153
176
|
description: "Inline edge definitions (from is inferred as this node)",
|
|
@@ -155,10 +178,29 @@ var agentic_v0_1_default = {
|
|
|
155
178
|
}
|
|
156
179
|
}
|
|
157
180
|
},
|
|
181
|
+
nodeMetadata: {
|
|
182
|
+
type: "object",
|
|
183
|
+
description: "Freeform node properties the spec does not model, such as extra typed fields or editor hints. Values are strings, numbers or booleans.",
|
|
184
|
+
additionalProperties: {
|
|
185
|
+
anyOf: [{ type: "string" }, { type: "number" }, { type: "boolean" }]
|
|
186
|
+
}
|
|
187
|
+
},
|
|
158
188
|
edgeType: {
|
|
159
189
|
type: "string",
|
|
160
|
-
description: "Edge semantic type. Defaults to request when omitted",
|
|
161
|
-
enum: [
|
|
190
|
+
description: "Edge semantic type. Defaults to request when omitted. data, control, stream and tool are the connection kinds of the current editor; stream is equivalent to streaming.",
|
|
191
|
+
enum: [
|
|
192
|
+
"default",
|
|
193
|
+
"request",
|
|
194
|
+
"response",
|
|
195
|
+
"async",
|
|
196
|
+
"streaming",
|
|
197
|
+
"event",
|
|
198
|
+
"error",
|
|
199
|
+
"data",
|
|
200
|
+
"control",
|
|
201
|
+
"stream",
|
|
202
|
+
"tool"
|
|
203
|
+
]
|
|
162
204
|
},
|
|
163
205
|
pathType: {
|
|
164
206
|
type: "string",
|
|
@@ -167,14 +209,19 @@ var agentic_v0_1_default = {
|
|
|
167
209
|
handlePosition: {
|
|
168
210
|
type: "string",
|
|
169
211
|
pattern: "^(?:top|right|bottom|left)(?:-\\d+(?:-t)?)?$",
|
|
170
|
-
description: "Connection point on a node. Plain side name ('bottom') connects at the centre; slot form ('bottom-20') places the anchor at
|
|
212
|
+
description: "Connection point on a node. Plain side name ('bottom') connects at the centre; slot form ('bottom-20') places the anchor at that whole-number percentage (0-100) along that side; '-t' suffix marks a target slot ('top-80-t'). Omit it to let the renderer choose the connection point."
|
|
171
213
|
},
|
|
172
214
|
edgeMetadata: {
|
|
173
215
|
type: "object",
|
|
174
216
|
description: "Freeform presentation hints for an edge (editor cosmetics). Known keys are typed; unknown keys are allowed.",
|
|
175
217
|
additionalProperties: true,
|
|
176
218
|
properties: {
|
|
177
|
-
label_pos: {
|
|
219
|
+
label_pos: {
|
|
220
|
+
type: "number",
|
|
221
|
+
minimum: 0,
|
|
222
|
+
maximum: 1,
|
|
223
|
+
description: "Label position along the edge as a fraction of its length (0 = source end, 1 = target end). Defaults to 0.5."
|
|
224
|
+
}
|
|
178
225
|
}
|
|
179
226
|
},
|
|
180
227
|
edgeArrows: {
|
|
@@ -190,7 +237,10 @@ var agentic_v0_1_default = {
|
|
|
190
237
|
to: { type: "string", description: "Target node id" },
|
|
191
238
|
type: { $ref: "#/$defs/edgeType" },
|
|
192
239
|
label: { type: "string" },
|
|
193
|
-
condition: {
|
|
240
|
+
condition: {
|
|
241
|
+
type: "string",
|
|
242
|
+
description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'"
|
|
243
|
+
},
|
|
194
244
|
animated: { type: "boolean", description: "Show animated flow on connection" },
|
|
195
245
|
arrows: { $ref: "#/$defs/edgeArrows" },
|
|
196
246
|
path: { $ref: "#/$defs/pathType" },
|
|
@@ -208,7 +258,10 @@ var agentic_v0_1_default = {
|
|
|
208
258
|
to: { type: "string", description: "Target node id" },
|
|
209
259
|
type: { $ref: "#/$defs/edgeType" },
|
|
210
260
|
label: { type: "string" },
|
|
211
|
-
condition: {
|
|
261
|
+
condition: {
|
|
262
|
+
type: "string",
|
|
263
|
+
description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'"
|
|
264
|
+
},
|
|
212
265
|
animated: { type: "boolean", description: "Show animated flow on connection" },
|
|
213
266
|
arrows: { $ref: "#/$defs/edgeArrows" },
|
|
214
267
|
path: { $ref: "#/$defs/pathType" },
|
|
@@ -247,11 +300,25 @@ var agentic_v0_1_default = {
|
|
|
247
300
|
},
|
|
248
301
|
step: {
|
|
249
302
|
type: "object",
|
|
250
|
-
|
|
303
|
+
description: "A playback step: either a from/to pair (a message between two nodes) or a nodes list (nodes highlighted together), never both.",
|
|
251
304
|
additionalProperties: false,
|
|
305
|
+
oneOf: [
|
|
306
|
+
{ required: ["from", "to"], not: { required: ["nodes"] } },
|
|
307
|
+
{
|
|
308
|
+
required: ["nodes"],
|
|
309
|
+
not: { anyOf: [{ required: ["from"] }, { required: ["to"] }] }
|
|
310
|
+
}
|
|
311
|
+
],
|
|
252
312
|
properties: {
|
|
253
313
|
from: { type: "string", description: "Source node id" },
|
|
254
314
|
to: { type: "string", description: "Target node id" },
|
|
315
|
+
nodes: {
|
|
316
|
+
type: "array",
|
|
317
|
+
description: "Node ids highlighted together at this step. Use instead of from/to when a step involves one node, or more than two.",
|
|
318
|
+
items: { type: "string" },
|
|
319
|
+
minItems: 1,
|
|
320
|
+
uniqueItems: true
|
|
321
|
+
},
|
|
255
322
|
type: { $ref: "#/$defs/stepType" },
|
|
256
323
|
label: { type: "string" },
|
|
257
324
|
payload: { type: "string" },
|
|
@@ -281,8 +348,9 @@ var agentic_v0_1_default = {
|
|
|
281
348
|
},
|
|
282
349
|
size2d: {
|
|
283
350
|
type: "array",
|
|
351
|
+
description: "[width, height], or [width] alone to let the node's height follow its content",
|
|
284
352
|
items: { type: "number", minimum: 0 },
|
|
285
|
-
minItems:
|
|
353
|
+
minItems: 1,
|
|
286
354
|
maxItems: 2
|
|
287
355
|
},
|
|
288
356
|
viewport: {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/validate.ts","../schema/agentic.v0.1.json"],"sourcesContent":["export type {\n AgenticYaml,\n AgenticDiagram,\n AgenticNode,\n AgenticInlineEdge,\n AgenticEdge,\n AgenticEdgeArrows,\n AgenticStep,\n AgenticScenario,\n AgenticNodeStyle,\n AgenticLayout,\n} from './types';\n\nexport { validate } from './validate';\nexport type { ValidationResult } from './validate';\n","import Ajv2020 from 'ajv/dist/2020.js';\nimport addFormats from 'ajv-formats';\nimport schema from '../schema/agentic.v0.1.json';\n\nexport interface ValidationResult {\n valid: boolean;\n errors: string[];\n}\n\nconst ajv = new Ajv2020({ allErrors: true });\naddFormats(ajv);\nconst compiledValidate = ajv.compile(schema);\n\n/**\n * Validate a parsed YAML object against the agentic schema v0.1.\n *\n * This validates structure only — it does not parse YAML strings.\n * Use your preferred YAML parser (js-yaml, yaml, etc.) first.\n *\n * @example\n * ```ts\n * import * as yaml from 'js-yaml';\n * import { validate } from '@agenticdiagrams/schema';\n *\n * const doc = yaml.load(yamlString);\n * const result = validate(doc);\n * if (!result.valid) {\n * console.error(result.errors);\n * }\n * ```\n */\nexport function validate(data: unknown): ValidationResult {\n const valid = compiledValidate(data);\n\n if (valid) {\n return { valid: true, errors: [] };\n }\n\n const errors = (compiledValidate.errors ?? []).map((err) => {\n const path = err.instancePath || '/';\n const message = err.message || 'unknown error';\n return `${path}: ${message}`;\n });\n\n return { valid: false, errors };\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://agenticdiagrams.com/schemas/agentic/0.1.json\",\n \"title\": \"Agentic Diagram\",\n \"description\": \"Schema for .agentic.yaml diagram files (spec v0.1)\",\n \"type\": \"object\",\n \"required\": [\"agentic\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"agentic\": {\n \"type\": \"string\",\n \"const\": \"0.1\",\n \"description\": \"Spec version\"\n },\n \"diagram\": { \"$ref\": \"#/$defs/diagram\" },\n \"nodes\": {\n \"type\": \"object\",\n \"description\": \"Node definitions keyed by stable id\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/node\" }\n },\n \"edges\": {\n \"type\": \"array\",\n \"description\": \"Connections between nodes (type defaults to request)\",\n \"items\": { \"$ref\": \"#/$defs/edge\" }\n },\n \"scenarios\": {\n \"type\": \"object\",\n \"description\": \"Flow definitions keyed by id\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/scenario\" }\n },\n \"layout\": { \"$ref\": \"#/$defs/layout\" }\n },\n \"$defs\": {\n \"diagram\": {\n \"type\": \"object\",\n \"description\": \"Diagram metadata. All fields optional, name defaults to Untitled\",\n \"additionalProperties\": false,\n \"properties\": {\n \"name\": { \"type\": \"string\", \"default\": \"Untitled\" },\n \"description\": { \"type\": \"string\" },\n \"type\": { \"type\": \"string\", \"enum\": [\"system\", \"component\"] },\n \"active_scenario\": { \"type\": \"string\" },\n \"parent_diagram\": { \"type\": \"string\", \"description\": \"Parent diagram id for drill-down hierarchy\" },\n \"created\": { \"type\": \"string\", \"format\": \"date-time\" },\n \"updated\": { \"type\": \"string\", \"format\": \"date-time\" }\n }\n },\n \"nodeType\": {\n \"type\": \"string\",\n \"enum\": [\n \"agent\", \"tool\", \"component\", \"backend\", \"generic\", \"note\",\n \"system\", \"memory\", \"gateway\", \"skill\", \"channel\", \"waypoint\",\n \"router\", \"human\", \"trigger\", \"guardrail\", \"model\", \"aggregator\",\n \"observability\", \"group\", \"block\", \"image\", \"prompt\", \"user\",\n \"output\", \"knowledge_base\", \"environment\", \"text_label\", \"divider\"\n ]\n },\n \"node\": {\n \"type\": \"object\",\n \"description\": \"Node definition. Label defaults to the node id when omitted\",\n \"required\": [\"type\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"type\": { \"$ref\": \"#/$defs/nodeType\" },\n \"label\": { \"type\": \"string\", \"description\": \"Display name (defaults to node id)\" },\n \"sub_title\": { \"type\": \"string\", \"description\": \"Secondary display text below label\" },\n \"description\": { \"type\": \"string\" },\n \"sub_type\": { \"type\": \"string\" },\n \"url\": { \"type\": \"string\", \"format\": \"uri\" },\n \"group\": { \"type\": \"string\", \"description\": \"Parent group node id\" },\n \"linked_diagram\": { \"type\": \"string\", \"description\": \"Drill-down target diagram id or file path\" },\n \"is_looping\": { \"type\": \"boolean\" },\n \"auth\": { \"type\": \"string\" },\n \"auth_detail\": { \"type\": \"string\" },\n \"provider\": { \"type\": \"string\" },\n \"content\": { \"type\": \"string\" },\n \"example_response\": { \"type\": \"string\" },\n \"ttl\": {\n \"type\": \"string\",\n \"description\": \"Retention lifetime. Primarily for memory nodes. Preset values: session, 24h, permanent. Freeform strings (e.g. 7d) are accepted.\"\n },\n \"scope\": {\n \"type\": \"string\",\n \"description\": \"Audience scope. Primarily for memory nodes. Preset values: per-user, per-session, global. Freeform strings accepted.\"\n },\n \"edges\": {\n \"type\": \"array\",\n \"description\": \"Inline edge definitions (from is inferred as this node)\",\n \"items\": { \"$ref\": \"#/$defs/inlineEdge\" }\n }\n }\n },\n \"edgeType\": {\n \"type\": \"string\",\n \"description\": \"Edge semantic type. Defaults to request when omitted\",\n \"enum\": [\"default\", \"request\", \"response\", \"async\", \"streaming\", \"event\", \"error\"]\n },\n \"pathType\": {\n \"type\": \"string\",\n \"enum\": [\"bezier\", \"straight\", \"step\", \"smooth_step\", \"simple_bezier\"]\n },\n \"handlePosition\": {\n \"type\": \"string\",\n \"pattern\": \"^(?:top|right|bottom|left)(?:-\\\\d+(?:-t)?)?$\",\n \"description\": \"Connection point on a node. Plain side name ('bottom') connects at the centre; slot form ('bottom-20') places the anchor at 20 % along that side; '-t' suffix marks a target slot ('top-80-t').\"\n },\n \"edgeMetadata\": {\n \"type\": \"object\",\n \"description\": \"Freeform presentation hints for an edge (editor cosmetics). Known keys are typed; unknown keys are allowed.\",\n \"additionalProperties\": true,\n \"properties\": {\n \"label_pos\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1, \"description\": \"Label position along the edge as a fraction of its length (0 = source end, 1 = target end). Defaults to 0.5.\" }\n }\n },\n \"edgeArrows\": {\n \"enum\": [\"none\", \"start\", \"end\", \"both\"],\n \"description\": \"Which ends of an edge show an arrowhead: none, start (source), end (target), or both. Defaults to 'end'.\"\n },\n \"edge\": {\n \"type\": \"object\",\n \"required\": [\"from\", \"to\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"from\": { \"type\": \"string\", \"description\": \"Source node id\" },\n \"to\": { \"type\": \"string\", \"description\": \"Target node id\" },\n \"type\": { \"$ref\": \"#/$defs/edgeType\" },\n \"label\": { \"type\": \"string\" },\n \"condition\": { \"type\": \"string\", \"description\": \"Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'\" },\n \"animated\": { \"type\": \"boolean\", \"description\": \"Show animated flow on connection\" },\n \"arrows\": { \"$ref\": \"#/$defs/edgeArrows\" },\n \"path\": { \"$ref\": \"#/$defs/pathType\" },\n \"source_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"target_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"metadata\": { \"$ref\": \"#/$defs/edgeMetadata\" }\n }\n },\n \"inlineEdge\": {\n \"type\": \"object\",\n \"description\": \"Edge defined on a node (from is inferred as the parent node id)\",\n \"required\": [\"to\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"to\": { \"type\": \"string\", \"description\": \"Target node id\" },\n \"type\": { \"$ref\": \"#/$defs/edgeType\" },\n \"label\": { \"type\": \"string\" },\n \"condition\": { \"type\": \"string\", \"description\": \"Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'\" },\n \"animated\": { \"type\": \"boolean\", \"description\": \"Show animated flow on connection\" },\n \"arrows\": { \"$ref\": \"#/$defs/edgeArrows\" },\n \"path\": { \"$ref\": \"#/$defs/pathType\" },\n \"source_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"target_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"metadata\": { \"$ref\": \"#/$defs/edgeMetadata\" }\n }\n },\n \"stepType\": {\n \"type\": \"string\",\n \"description\": \"Step semantic type. Defaults to call when omitted\",\n \"enum\": [\"call\", \"return\", \"async\", \"event\", \"error\"]\n },\n \"fragmentType\": {\n \"type\": \"string\",\n \"enum\": [\"alt\", \"opt\", \"loop\", \"par\"]\n },\n \"fragment\": {\n \"type\": \"object\",\n \"required\": [\"type\", \"position\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"type\": { \"$ref\": \"#/$defs/fragmentType\" },\n \"label\": { \"type\": \"string\" },\n \"position\": { \"type\": \"string\", \"enum\": [\"start\", \"else\", \"end\"] }\n }\n },\n \"note\": {\n \"type\": \"object\",\n \"required\": [\"text\", \"position\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"text\": { \"type\": \"string\" },\n \"position\": { \"type\": \"string\", \"enum\": [\"left\", \"right\", \"over\"] }\n }\n },\n \"step\": {\n \"type\": \"object\",\n \"required\": [\"from\", \"to\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"from\": { \"type\": \"string\", \"description\": \"Source node id\" },\n \"to\": { \"type\": \"string\", \"description\": \"Target node id\" },\n \"type\": { \"$ref\": \"#/$defs/stepType\" },\n \"label\": { \"type\": \"string\" },\n \"payload\": { \"type\": \"string\" },\n \"duration\": { \"type\": \"number\", \"minimum\": 0 },\n \"fragment\": { \"$ref\": \"#/$defs/fragment\" },\n \"note\": { \"$ref\": \"#/$defs/note\" }\n }\n },\n \"scenario\": {\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"description\": { \"type\": \"string\" },\n \"steps\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/step\" }\n }\n }\n },\n \"point2d\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"number\" },\n \"minItems\": 2,\n \"maxItems\": 2\n },\n \"size2d\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"number\", \"minimum\": 0 },\n \"minItems\": 2,\n \"maxItems\": 2\n },\n \"viewport\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"number\" },\n \"minItems\": 3,\n \"maxItems\": 3,\n \"description\": \"[x, y, zoom]\"\n },\n \"nodeStyle\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"borderless\": { \"type\": \"boolean\" },\n \"icon_url\": { \"type\": \"string\", \"format\": \"uri\" },\n \"icon_layout\": { \"type\": \"string\", \"enum\": [\"left\", \"right\", \"top\", \"bottom\"] },\n \"image_url\": { \"type\": \"string\", \"format\": \"uri\" }\n }\n },\n \"direction\": {\n \"type\": \"string\",\n \"description\": \"Auto-layout flow direction. Defaults to TB\",\n \"enum\": [\"TB\", \"LR\", \"BT\", \"RL\"]\n },\n \"layout\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"direction\": { \"$ref\": \"#/$defs/direction\" },\n \"viewport\": { \"$ref\": \"#/$defs/viewport\" },\n \"positions\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/point2d\" }\n },\n \"sizes\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/size2d\" }\n },\n \"node_styles\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/nodeStyle\" }\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,eAAoB;AACpB,yBAAuB;;;ACDvB;AAAA,EACE,SAAW;AAAA,EACX,KAAO;AAAA,EACP,OAAS;AAAA,EACT,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,UAAY,CAAC,SAAS;AAAA,EACtB,sBAAw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AAU,IAAI,WAAW;AAC/B,WAAO,GAAG,IAAI,KAAK,OAAO;AAAA,EAC5B,CAAC;AAED,SAAO,EAAE,OAAO,OAAO,OAAO;AAChC;","names":["Ajv2020","addFormats"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/validate.ts","../schema/agentic.v0.1.json"],"sourcesContent":["export type {\n AgenticYaml,\n AgenticDiagram,\n AgenticNode,\n AgenticNodeMetadata,\n AgenticInlineEdge,\n AgenticEdge,\n AgenticEdgeArrows,\n AgenticEdgeMetadata,\n AgenticStep,\n AgenticStepDetail,\n AgenticMessageStep,\n AgenticHighlightStep,\n AgenticScenario,\n AgenticNodeStyle,\n AgenticLayout,\n} from './types';\n\nexport { validate } from './validate';\nexport type { ValidationResult } from './validate';\n","import Ajv2020 from 'ajv/dist/2020.js';\nimport addFormats from 'ajv-formats';\nimport schema from '../schema/agentic.v0.1.json';\n\nexport interface ValidationResult {\n valid: boolean;\n errors: string[];\n}\n\nconst ajv = new Ajv2020({ allErrors: true });\naddFormats(ajv);\nconst compiledValidate = ajv.compile(schema);\n\n/**\n * Validate a parsed YAML object against the agentic schema v0.1.\n *\n * This validates structure only — it does not parse YAML strings.\n * Use your preferred YAML parser (js-yaml, yaml, etc.) first.\n *\n * @example\n * ```ts\n * import * as yaml from 'js-yaml';\n * import { validate } from '@agenticdiagrams/schema';\n *\n * const doc = yaml.load(yamlString);\n * const result = validate(doc);\n * if (!result.valid) {\n * console.error(result.errors);\n * }\n * ```\n */\nexport function validate(data: unknown): ValidationResult {\n const valid = compiledValidate(data);\n\n if (valid) {\n return { valid: true, errors: [] };\n }\n\n const errors = (compiledValidate.errors ?? []).map((err) => {\n const path = err.instancePath || '/';\n const message = err.message || 'unknown error';\n return `${path}: ${message}`;\n });\n\n return { valid: false, errors };\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://agenticdiagrams.com/schemas/agentic/0.1.json\",\n \"title\": \"Agentic Diagram\",\n \"description\": \"Schema for .agentic.yaml diagram files (spec v0.1)\",\n \"type\": \"object\",\n \"required\": [\"agentic\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"agentic\": {\n \"type\": \"string\",\n \"const\": \"0.1\",\n \"description\": \"Spec version\"\n },\n \"diagram\": { \"$ref\": \"#/$defs/diagram\" },\n \"nodes\": {\n \"type\": \"object\",\n \"description\": \"Node definitions keyed by stable id\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/node\" }\n },\n \"edges\": {\n \"type\": \"array\",\n \"description\": \"Connections between nodes (type defaults to request)\",\n \"items\": { \"$ref\": \"#/$defs/edge\" }\n },\n \"scenarios\": {\n \"type\": \"object\",\n \"description\": \"Flow definitions keyed by id\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/scenario\" }\n },\n \"layout\": { \"$ref\": \"#/$defs/layout\" }\n },\n \"$defs\": {\n \"diagram\": {\n \"type\": \"object\",\n \"description\": \"Diagram metadata. All fields optional, name defaults to Untitled\",\n \"additionalProperties\": false,\n \"properties\": {\n \"name\": { \"type\": \"string\", \"default\": \"Untitled\" },\n \"description\": { \"type\": \"string\" },\n \"type\": { \"type\": \"string\", \"enum\": [\"system\", \"component\"] },\n \"active_scenario\": { \"type\": \"string\" },\n \"parent_diagram\": {\n \"type\": \"string\",\n \"description\": \"Parent diagram id for drill-down hierarchy\"\n },\n \"created\": { \"type\": \"string\", \"format\": \"date-time\" },\n \"updated\": { \"type\": \"string\", \"format\": \"date-time\" }\n }\n },\n \"nodeType\": {\n \"type\": \"string\",\n \"enum\": [\n \"agent\",\n \"tool\",\n \"component\",\n \"backend\",\n \"generic\",\n \"note\",\n \"system\",\n \"memory\",\n \"gateway\",\n \"skill\",\n \"channel\",\n \"waypoint\",\n \"router\",\n \"human\",\n \"trigger\",\n \"guardrail\",\n \"model\",\n \"aggregator\",\n \"observability\",\n \"group\",\n \"block\",\n \"image\",\n \"prompt\",\n \"user\",\n \"output\",\n \"knowledge_base\",\n \"environment\",\n \"text_label\",\n \"divider\"\n ]\n },\n \"node\": {\n \"type\": \"object\",\n \"description\": \"Node definition. Label defaults to the node id when omitted\",\n \"required\": [\"type\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"type\": { \"$ref\": \"#/$defs/nodeType\" },\n \"label\": { \"type\": \"string\", \"description\": \"Display name (defaults to node id)\" },\n \"sub_title\": { \"type\": \"string\", \"description\": \"Secondary display text below label\" },\n \"badge\": {\n \"type\": \"string\",\n \"description\": \"Short tag shown on the node, e.g. NEW or beta\"\n },\n \"description\": { \"type\": \"string\" },\n \"sub_type\": { \"type\": \"string\" },\n \"url\": { \"type\": \"string\", \"format\": \"uri\" },\n \"group\": { \"type\": \"string\", \"description\": \"Parent group node id\" },\n \"linked_diagram\": {\n \"type\": \"string\",\n \"description\": \"Drill-down target diagram id or file path\"\n },\n \"is_looping\": { \"type\": \"boolean\" },\n \"auth\": { \"type\": \"string\" },\n \"auth_detail\": { \"type\": \"string\" },\n \"provider\": { \"type\": \"string\" },\n \"model\": {\n \"type\": \"string\",\n \"description\": \"Model identifier, e.g. claude-sonnet-4-6. Primarily for agent and model nodes.\"\n },\n \"content\": { \"type\": \"string\" },\n \"example_response\": { \"type\": \"string\" },\n \"input_schema\": {\n \"type\": \"string\",\n \"description\": \"Input schema, usually JSON Schema serialised as a string. Primarily for tool nodes.\"\n },\n \"output_schema\": {\n \"type\": \"string\",\n \"description\": \"Output schema, usually JSON Schema serialised as a string. Primarily for tool nodes.\"\n },\n \"ttl\": {\n \"type\": \"string\",\n \"description\": \"Retention lifetime. Primarily for memory nodes. Preset values: session, 24h, permanent. Freeform strings (e.g. 7d) are accepted.\"\n },\n \"scope\": {\n \"type\": \"string\",\n \"description\": \"Audience scope. Primarily for memory nodes. Preset values: per-user, per-session, global. Freeform strings accepted.\"\n },\n \"metadata\": { \"$ref\": \"#/$defs/nodeMetadata\" },\n \"edges\": {\n \"type\": \"array\",\n \"description\": \"Inline edge definitions (from is inferred as this node)\",\n \"items\": { \"$ref\": \"#/$defs/inlineEdge\" }\n }\n }\n },\n \"nodeMetadata\": {\n \"type\": \"object\",\n \"description\": \"Freeform node properties the spec does not model, such as extra typed fields or editor hints. Values are strings, numbers or booleans.\",\n \"additionalProperties\": {\n \"anyOf\": [{ \"type\": \"string\" }, { \"type\": \"number\" }, { \"type\": \"boolean\" }]\n }\n },\n \"edgeType\": {\n \"type\": \"string\",\n \"description\": \"Edge semantic type. Defaults to request when omitted. data, control, stream and tool are the connection kinds of the current editor; stream is equivalent to streaming.\",\n \"enum\": [\n \"default\",\n \"request\",\n \"response\",\n \"async\",\n \"streaming\",\n \"event\",\n \"error\",\n \"data\",\n \"control\",\n \"stream\",\n \"tool\"\n ]\n },\n \"pathType\": {\n \"type\": \"string\",\n \"enum\": [\"bezier\", \"straight\", \"step\", \"smooth_step\", \"simple_bezier\"]\n },\n \"handlePosition\": {\n \"type\": \"string\",\n \"pattern\": \"^(?:top|right|bottom|left)(?:-\\\\d+(?:-t)?)?$\",\n \"description\": \"Connection point on a node. Plain side name ('bottom') connects at the centre; slot form ('bottom-20') places the anchor at that whole-number percentage (0-100) along that side; '-t' suffix marks a target slot ('top-80-t'). Omit it to let the renderer choose the connection point.\"\n },\n \"edgeMetadata\": {\n \"type\": \"object\",\n \"description\": \"Freeform presentation hints for an edge (editor cosmetics). Known keys are typed; unknown keys are allowed.\",\n \"additionalProperties\": true,\n \"properties\": {\n \"label_pos\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"description\": \"Label position along the edge as a fraction of its length (0 = source end, 1 = target end). Defaults to 0.5.\"\n }\n }\n },\n \"edgeArrows\": {\n \"enum\": [\"none\", \"start\", \"end\", \"both\"],\n \"description\": \"Which ends of an edge show an arrowhead: none, start (source), end (target), or both. Defaults to 'end'.\"\n },\n \"edge\": {\n \"type\": \"object\",\n \"required\": [\"from\", \"to\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"from\": { \"type\": \"string\", \"description\": \"Source node id\" },\n \"to\": { \"type\": \"string\", \"description\": \"Target node id\" },\n \"type\": { \"$ref\": \"#/$defs/edgeType\" },\n \"label\": { \"type\": \"string\" },\n \"condition\": {\n \"type\": \"string\",\n \"description\": \"Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'\"\n },\n \"animated\": { \"type\": \"boolean\", \"description\": \"Show animated flow on connection\" },\n \"arrows\": { \"$ref\": \"#/$defs/edgeArrows\" },\n \"path\": { \"$ref\": \"#/$defs/pathType\" },\n \"source_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"target_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"metadata\": { \"$ref\": \"#/$defs/edgeMetadata\" }\n }\n },\n \"inlineEdge\": {\n \"type\": \"object\",\n \"description\": \"Edge defined on a node (from is inferred as the parent node id)\",\n \"required\": [\"to\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"to\": { \"type\": \"string\", \"description\": \"Target node id\" },\n \"type\": { \"$ref\": \"#/$defs/edgeType\" },\n \"label\": { \"type\": \"string\" },\n \"condition\": {\n \"type\": \"string\",\n \"description\": \"Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'\"\n },\n \"animated\": { \"type\": \"boolean\", \"description\": \"Show animated flow on connection\" },\n \"arrows\": { \"$ref\": \"#/$defs/edgeArrows\" },\n \"path\": { \"$ref\": \"#/$defs/pathType\" },\n \"source_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"target_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"metadata\": { \"$ref\": \"#/$defs/edgeMetadata\" }\n }\n },\n \"stepType\": {\n \"type\": \"string\",\n \"description\": \"Step semantic type. Defaults to call when omitted\",\n \"enum\": [\"call\", \"return\", \"async\", \"event\", \"error\"]\n },\n \"fragmentType\": {\n \"type\": \"string\",\n \"enum\": [\"alt\", \"opt\", \"loop\", \"par\"]\n },\n \"fragment\": {\n \"type\": \"object\",\n \"required\": [\"type\", \"position\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"type\": { \"$ref\": \"#/$defs/fragmentType\" },\n \"label\": { \"type\": \"string\" },\n \"position\": { \"type\": \"string\", \"enum\": [\"start\", \"else\", \"end\"] }\n }\n },\n \"note\": {\n \"type\": \"object\",\n \"required\": [\"text\", \"position\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"text\": { \"type\": \"string\" },\n \"position\": { \"type\": \"string\", \"enum\": [\"left\", \"right\", \"over\"] }\n }\n },\n \"step\": {\n \"type\": \"object\",\n \"description\": \"A playback step: either a from/to pair (a message between two nodes) or a nodes list (nodes highlighted together), never both.\",\n \"additionalProperties\": false,\n \"oneOf\": [\n { \"required\": [\"from\", \"to\"], \"not\": { \"required\": [\"nodes\"] } },\n {\n \"required\": [\"nodes\"],\n \"not\": { \"anyOf\": [{ \"required\": [\"from\"] }, { \"required\": [\"to\"] }] }\n }\n ],\n \"properties\": {\n \"from\": { \"type\": \"string\", \"description\": \"Source node id\" },\n \"to\": { \"type\": \"string\", \"description\": \"Target node id\" },\n \"nodes\": {\n \"type\": \"array\",\n \"description\": \"Node ids highlighted together at this step. Use instead of from/to when a step involves one node, or more than two.\",\n \"items\": { \"type\": \"string\" },\n \"minItems\": 1,\n \"uniqueItems\": true\n },\n \"type\": { \"$ref\": \"#/$defs/stepType\" },\n \"label\": { \"type\": \"string\" },\n \"payload\": { \"type\": \"string\" },\n \"duration\": { \"type\": \"number\", \"minimum\": 0 },\n \"fragment\": { \"$ref\": \"#/$defs/fragment\" },\n \"note\": { \"$ref\": \"#/$defs/note\" }\n }\n },\n \"scenario\": {\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"description\": { \"type\": \"string\" },\n \"steps\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/step\" }\n }\n }\n },\n \"point2d\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"number\" },\n \"minItems\": 2,\n \"maxItems\": 2\n },\n \"size2d\": {\n \"type\": \"array\",\n \"description\": \"[width, height], or [width] alone to let the node's height follow its content\",\n \"items\": { \"type\": \"number\", \"minimum\": 0 },\n \"minItems\": 1,\n \"maxItems\": 2\n },\n \"viewport\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"number\" },\n \"minItems\": 3,\n \"maxItems\": 3,\n \"description\": \"[x, y, zoom]\"\n },\n \"nodeStyle\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"borderless\": { \"type\": \"boolean\" },\n \"icon_url\": { \"type\": \"string\", \"format\": \"uri\" },\n \"icon_layout\": { \"type\": \"string\", \"enum\": [\"left\", \"right\", \"top\", \"bottom\"] },\n \"image_url\": { \"type\": \"string\", \"format\": \"uri\" }\n }\n },\n \"direction\": {\n \"type\": \"string\",\n \"description\": \"Auto-layout flow direction. Defaults to TB\",\n \"enum\": [\"TB\", \"LR\", \"BT\", \"RL\"]\n },\n \"layout\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"direction\": { \"$ref\": \"#/$defs/direction\" },\n \"viewport\": { \"$ref\": \"#/$defs/viewport\" },\n \"positions\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/point2d\" }\n },\n \"sizes\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/size2d\" }\n },\n \"node_styles\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/nodeStyle\" }\n }\n }\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,eAAoB;AACpB,yBAAuB;;;ACDvB;AAAA,EACE,SAAW;AAAA,EACX,KAAO;AAAA,EACP,OAAS;AAAA,EACT,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,UAAY,CAAC,SAAS;AAAA,EACtB,sBAAwB;AAAA,EACxB,YAAc;AAAA,IACZ,SAAW;AAAA,MACT,MAAQ;AAAA,MACR,OAAS;AAAA,MACT,aA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AAA,MACX,MAAQ;AAAA,MACR,aAAe;AAAA,MACf,MAAQ,CAAC,MAAM,MAAM,MAAM,IAAI;AAAA,IACjC;AAAA,IACA,QAAU;AAAA,MACR,MAAQ;AAAA,MACR,sBAAwB;AAAA,MACxB,YAAc;AAAA,QACZ,WAAa,EAAE,MAAQ,oBAAoB;AAAA,QAC3C,UAAY,EAAE,MAAQ,mBAAmB;AAAA,QACzC,WAAa;AAAA,UACX,MAAQ;AAAA,UACR,sBAAwB,EAAE,MAAQ,kBAAkB;AAAA,QACtD;AAAA,QACA,OAAS;AAAA,UACP,MAAQ;AAAA,UACR,sBAAwB,EAAE,MAAQ,iBAAiB;AAAA,QACrD;AAAA,QACA,aAAe;AAAA,UACb,MAAQ;AAAA,UACR,sBAAwB,EAAE,MAAQ,oBAAoB;AAAA,QACxD;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;AD5VA,IAAM,MAAM,IAAI,SAAAA,QAAQ,EAAE,WAAW,KAAK,CAAC;AAAA,IAC3C,mBAAAC,SAAW,GAAG;AACd,IAAM,mBAAmB,IAAI,QAAQ,oBAAM;AAoBpC,SAAS,SAAS,MAAiC;AACxD,QAAM,QAAQ,iBAAiB,IAAI;AAEnC,MAAI,OAAO;AACT,WAAO,EAAE,OAAO,MAAM,QAAQ,CAAC,EAAE;AAAA,EACnC;AAEA,QAAM,UAAU,iBAAiB,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ;AAC1D,UAAM,OAAO,IAAI,gBAAgB;AACjC,UAAM,UAAU,IAAI,WAAW;AAC/B,WAAO,GAAG,IAAI,KAAK,OAAO;AAAA,EAC5B,CAAC;AAED,SAAO,EAAE,OAAO,OAAO,OAAO;AAChC;","names":["Ajv2020","addFormats"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -23,6 +23,8 @@ interface AgenticNode {
|
|
|
23
23
|
type: string;
|
|
24
24
|
label?: string;
|
|
25
25
|
sub_title?: string;
|
|
26
|
+
/** Short tag shown on the node, e.g. `NEW` or `beta`. */
|
|
27
|
+
badge?: string;
|
|
26
28
|
description?: string;
|
|
27
29
|
sub_type?: string;
|
|
28
30
|
url?: string;
|
|
@@ -32,13 +34,29 @@ interface AgenticNode {
|
|
|
32
34
|
auth?: string;
|
|
33
35
|
auth_detail?: string;
|
|
34
36
|
provider?: string;
|
|
37
|
+
/** Model identifier, e.g. `claude-sonnet-4-6` — primarily for agent and model nodes. */
|
|
38
|
+
model?: string;
|
|
35
39
|
content?: string;
|
|
36
40
|
example_response?: string;
|
|
41
|
+
/** Input schema, usually JSON Schema serialised as a string — primarily for tool nodes. */
|
|
42
|
+
input_schema?: string;
|
|
43
|
+
/** Output schema, usually JSON Schema serialised as a string — primarily for tool nodes. */
|
|
44
|
+
output_schema?: string;
|
|
37
45
|
edges?: AgenticInlineEdge[];
|
|
38
46
|
/** Retention lifetime — primarily for memory nodes. Preset values: 'session' | '24h' | 'permanent'. Freeform strings (e.g. '7d') are accepted. */
|
|
39
47
|
ttl?: string;
|
|
40
48
|
/** Audience scope — primarily for memory nodes. Preset values: 'per-user' | 'per-session' | 'global'. Freeform strings accepted. */
|
|
41
49
|
scope?: string;
|
|
50
|
+
/** Freeform properties the spec does not model (extra typed fields, editor hints). */
|
|
51
|
+
metadata?: AgenticNodeMetadata;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Freeform node properties the spec does not model — extra typed fields or
|
|
55
|
+
* editor hints — so an editor can round-trip them without a schema change.
|
|
56
|
+
* Values are limited to strings, numbers and booleans.
|
|
57
|
+
*/
|
|
58
|
+
interface AgenticNodeMetadata {
|
|
59
|
+
[key: string]: string | number | boolean;
|
|
42
60
|
}
|
|
43
61
|
/**
|
|
44
62
|
* Freeform presentation hints for an edge (editor cosmetics). Known keys are
|
|
@@ -77,9 +95,8 @@ interface AgenticEdge {
|
|
|
77
95
|
target_handle?: string;
|
|
78
96
|
metadata?: AgenticEdgeMetadata;
|
|
79
97
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
to: string;
|
|
98
|
+
/** Fields shared by both step forms. */
|
|
99
|
+
interface AgenticStepDetail {
|
|
83
100
|
type?: string;
|
|
84
101
|
label?: string;
|
|
85
102
|
payload?: string;
|
|
@@ -94,6 +111,21 @@ interface AgenticStep {
|
|
|
94
111
|
position: 'left' | 'right' | 'over';
|
|
95
112
|
};
|
|
96
113
|
}
|
|
114
|
+
/** A step that is a message between two nodes. */
|
|
115
|
+
interface AgenticMessageStep extends AgenticStepDetail {
|
|
116
|
+
from: string;
|
|
117
|
+
to: string;
|
|
118
|
+
nodes?: never;
|
|
119
|
+
}
|
|
120
|
+
/** A step that highlights nodes together — one node, or more than two. */
|
|
121
|
+
interface AgenticHighlightStep extends AgenticStepDetail {
|
|
122
|
+
/** Node ids highlighted at this step (at least one, no duplicates). */
|
|
123
|
+
nodes: string[];
|
|
124
|
+
from?: never;
|
|
125
|
+
to?: never;
|
|
126
|
+
}
|
|
127
|
+
/** A playback step: a `from`/`to` message or a `nodes` highlight, never both. */
|
|
128
|
+
type AgenticStep = AgenticMessageStep | AgenticHighlightStep;
|
|
97
129
|
interface AgenticScenario {
|
|
98
130
|
name: string;
|
|
99
131
|
description?: string;
|
|
@@ -109,7 +141,8 @@ interface AgenticLayout {
|
|
|
109
141
|
direction?: 'TB' | 'LR' | 'BT' | 'RL';
|
|
110
142
|
viewport?: [number, number, number];
|
|
111
143
|
positions?: Record<string, [number, number]>;
|
|
112
|
-
|
|
144
|
+
/** Node id → `[width, height]`, or `[width]` alone when the height follows the node's content. */
|
|
145
|
+
sizes?: Record<string, [number, number] | [number]>;
|
|
113
146
|
node_styles?: Record<string, AgenticNodeStyle>;
|
|
114
147
|
}
|
|
115
148
|
|
|
@@ -137,4 +170,4 @@ interface ValidationResult {
|
|
|
137
170
|
*/
|
|
138
171
|
declare function validate(data: unknown): ValidationResult;
|
|
139
172
|
|
|
140
|
-
export { type AgenticDiagram, type AgenticEdge, type AgenticEdgeArrows, type AgenticInlineEdge, type AgenticLayout, type AgenticNode, type AgenticNodeStyle, type AgenticScenario, type AgenticStep, type AgenticYaml, type ValidationResult, validate };
|
|
173
|
+
export { type AgenticDiagram, type AgenticEdge, type AgenticEdgeArrows, type AgenticEdgeMetadata, type AgenticHighlightStep, type AgenticInlineEdge, type AgenticLayout, type AgenticMessageStep, type AgenticNode, type AgenticNodeMetadata, type AgenticNodeStyle, type AgenticScenario, type AgenticStep, type AgenticStepDetail, type AgenticYaml, type ValidationResult, validate };
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ interface AgenticNode {
|
|
|
23
23
|
type: string;
|
|
24
24
|
label?: string;
|
|
25
25
|
sub_title?: string;
|
|
26
|
+
/** Short tag shown on the node, e.g. `NEW` or `beta`. */
|
|
27
|
+
badge?: string;
|
|
26
28
|
description?: string;
|
|
27
29
|
sub_type?: string;
|
|
28
30
|
url?: string;
|
|
@@ -32,13 +34,29 @@ interface AgenticNode {
|
|
|
32
34
|
auth?: string;
|
|
33
35
|
auth_detail?: string;
|
|
34
36
|
provider?: string;
|
|
37
|
+
/** Model identifier, e.g. `claude-sonnet-4-6` — primarily for agent and model nodes. */
|
|
38
|
+
model?: string;
|
|
35
39
|
content?: string;
|
|
36
40
|
example_response?: string;
|
|
41
|
+
/** Input schema, usually JSON Schema serialised as a string — primarily for tool nodes. */
|
|
42
|
+
input_schema?: string;
|
|
43
|
+
/** Output schema, usually JSON Schema serialised as a string — primarily for tool nodes. */
|
|
44
|
+
output_schema?: string;
|
|
37
45
|
edges?: AgenticInlineEdge[];
|
|
38
46
|
/** Retention lifetime — primarily for memory nodes. Preset values: 'session' | '24h' | 'permanent'. Freeform strings (e.g. '7d') are accepted. */
|
|
39
47
|
ttl?: string;
|
|
40
48
|
/** Audience scope — primarily for memory nodes. Preset values: 'per-user' | 'per-session' | 'global'. Freeform strings accepted. */
|
|
41
49
|
scope?: string;
|
|
50
|
+
/** Freeform properties the spec does not model (extra typed fields, editor hints). */
|
|
51
|
+
metadata?: AgenticNodeMetadata;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Freeform node properties the spec does not model — extra typed fields or
|
|
55
|
+
* editor hints — so an editor can round-trip them without a schema change.
|
|
56
|
+
* Values are limited to strings, numbers and booleans.
|
|
57
|
+
*/
|
|
58
|
+
interface AgenticNodeMetadata {
|
|
59
|
+
[key: string]: string | number | boolean;
|
|
42
60
|
}
|
|
43
61
|
/**
|
|
44
62
|
* Freeform presentation hints for an edge (editor cosmetics). Known keys are
|
|
@@ -77,9 +95,8 @@ interface AgenticEdge {
|
|
|
77
95
|
target_handle?: string;
|
|
78
96
|
metadata?: AgenticEdgeMetadata;
|
|
79
97
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
to: string;
|
|
98
|
+
/** Fields shared by both step forms. */
|
|
99
|
+
interface AgenticStepDetail {
|
|
83
100
|
type?: string;
|
|
84
101
|
label?: string;
|
|
85
102
|
payload?: string;
|
|
@@ -94,6 +111,21 @@ interface AgenticStep {
|
|
|
94
111
|
position: 'left' | 'right' | 'over';
|
|
95
112
|
};
|
|
96
113
|
}
|
|
114
|
+
/** A step that is a message between two nodes. */
|
|
115
|
+
interface AgenticMessageStep extends AgenticStepDetail {
|
|
116
|
+
from: string;
|
|
117
|
+
to: string;
|
|
118
|
+
nodes?: never;
|
|
119
|
+
}
|
|
120
|
+
/** A step that highlights nodes together — one node, or more than two. */
|
|
121
|
+
interface AgenticHighlightStep extends AgenticStepDetail {
|
|
122
|
+
/** Node ids highlighted at this step (at least one, no duplicates). */
|
|
123
|
+
nodes: string[];
|
|
124
|
+
from?: never;
|
|
125
|
+
to?: never;
|
|
126
|
+
}
|
|
127
|
+
/** A playback step: a `from`/`to` message or a `nodes` highlight, never both. */
|
|
128
|
+
type AgenticStep = AgenticMessageStep | AgenticHighlightStep;
|
|
97
129
|
interface AgenticScenario {
|
|
98
130
|
name: string;
|
|
99
131
|
description?: string;
|
|
@@ -109,7 +141,8 @@ interface AgenticLayout {
|
|
|
109
141
|
direction?: 'TB' | 'LR' | 'BT' | 'RL';
|
|
110
142
|
viewport?: [number, number, number];
|
|
111
143
|
positions?: Record<string, [number, number]>;
|
|
112
|
-
|
|
144
|
+
/** Node id → `[width, height]`, or `[width]` alone when the height follows the node's content. */
|
|
145
|
+
sizes?: Record<string, [number, number] | [number]>;
|
|
113
146
|
node_styles?: Record<string, AgenticNodeStyle>;
|
|
114
147
|
}
|
|
115
148
|
|
|
@@ -137,4 +170,4 @@ interface ValidationResult {
|
|
|
137
170
|
*/
|
|
138
171
|
declare function validate(data: unknown): ValidationResult;
|
|
139
172
|
|
|
140
|
-
export { type AgenticDiagram, type AgenticEdge, type AgenticEdgeArrows, type AgenticInlineEdge, type AgenticLayout, type AgenticNode, type AgenticNodeStyle, type AgenticScenario, type AgenticStep, type AgenticYaml, type ValidationResult, validate };
|
|
173
|
+
export { type AgenticDiagram, type AgenticEdge, type AgenticEdgeArrows, type AgenticEdgeMetadata, type AgenticHighlightStep, type AgenticInlineEdge, type AgenticLayout, type AgenticMessageStep, type AgenticNode, type AgenticNodeMetadata, type AgenticNodeStyle, type AgenticScenario, type AgenticStep, type AgenticStepDetail, type AgenticYaml, type ValidationResult, validate };
|
package/dist/index.js
CHANGED
|
@@ -45,7 +45,10 @@ var agentic_v0_1_default = {
|
|
|
45
45
|
description: { type: "string" },
|
|
46
46
|
type: { type: "string", enum: ["system", "component"] },
|
|
47
47
|
active_scenario: { type: "string" },
|
|
48
|
-
parent_diagram: {
|
|
48
|
+
parent_diagram: {
|
|
49
|
+
type: "string",
|
|
50
|
+
description: "Parent diagram id for drill-down hierarchy"
|
|
51
|
+
},
|
|
49
52
|
created: { type: "string", format: "date-time" },
|
|
50
53
|
updated: { type: "string", format: "date-time" }
|
|
51
54
|
}
|
|
@@ -93,17 +96,36 @@ var agentic_v0_1_default = {
|
|
|
93
96
|
type: { $ref: "#/$defs/nodeType" },
|
|
94
97
|
label: { type: "string", description: "Display name (defaults to node id)" },
|
|
95
98
|
sub_title: { type: "string", description: "Secondary display text below label" },
|
|
99
|
+
badge: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "Short tag shown on the node, e.g. NEW or beta"
|
|
102
|
+
},
|
|
96
103
|
description: { type: "string" },
|
|
97
104
|
sub_type: { type: "string" },
|
|
98
105
|
url: { type: "string", format: "uri" },
|
|
99
106
|
group: { type: "string", description: "Parent group node id" },
|
|
100
|
-
linked_diagram: {
|
|
107
|
+
linked_diagram: {
|
|
108
|
+
type: "string",
|
|
109
|
+
description: "Drill-down target diagram id or file path"
|
|
110
|
+
},
|
|
101
111
|
is_looping: { type: "boolean" },
|
|
102
112
|
auth: { type: "string" },
|
|
103
113
|
auth_detail: { type: "string" },
|
|
104
114
|
provider: { type: "string" },
|
|
115
|
+
model: {
|
|
116
|
+
type: "string",
|
|
117
|
+
description: "Model identifier, e.g. claude-sonnet-4-6. Primarily for agent and model nodes."
|
|
118
|
+
},
|
|
105
119
|
content: { type: "string" },
|
|
106
120
|
example_response: { type: "string" },
|
|
121
|
+
input_schema: {
|
|
122
|
+
type: "string",
|
|
123
|
+
description: "Input schema, usually JSON Schema serialised as a string. Primarily for tool nodes."
|
|
124
|
+
},
|
|
125
|
+
output_schema: {
|
|
126
|
+
type: "string",
|
|
127
|
+
description: "Output schema, usually JSON Schema serialised as a string. Primarily for tool nodes."
|
|
128
|
+
},
|
|
107
129
|
ttl: {
|
|
108
130
|
type: "string",
|
|
109
131
|
description: "Retention lifetime. Primarily for memory nodes. Preset values: session, 24h, permanent. Freeform strings (e.g. 7d) are accepted."
|
|
@@ -112,6 +134,7 @@ var agentic_v0_1_default = {
|
|
|
112
134
|
type: "string",
|
|
113
135
|
description: "Audience scope. Primarily for memory nodes. Preset values: per-user, per-session, global. Freeform strings accepted."
|
|
114
136
|
},
|
|
137
|
+
metadata: { $ref: "#/$defs/nodeMetadata" },
|
|
115
138
|
edges: {
|
|
116
139
|
type: "array",
|
|
117
140
|
description: "Inline edge definitions (from is inferred as this node)",
|
|
@@ -119,10 +142,29 @@ var agentic_v0_1_default = {
|
|
|
119
142
|
}
|
|
120
143
|
}
|
|
121
144
|
},
|
|
145
|
+
nodeMetadata: {
|
|
146
|
+
type: "object",
|
|
147
|
+
description: "Freeform node properties the spec does not model, such as extra typed fields or editor hints. Values are strings, numbers or booleans.",
|
|
148
|
+
additionalProperties: {
|
|
149
|
+
anyOf: [{ type: "string" }, { type: "number" }, { type: "boolean" }]
|
|
150
|
+
}
|
|
151
|
+
},
|
|
122
152
|
edgeType: {
|
|
123
153
|
type: "string",
|
|
124
|
-
description: "Edge semantic type. Defaults to request when omitted",
|
|
125
|
-
enum: [
|
|
154
|
+
description: "Edge semantic type. Defaults to request when omitted. data, control, stream and tool are the connection kinds of the current editor; stream is equivalent to streaming.",
|
|
155
|
+
enum: [
|
|
156
|
+
"default",
|
|
157
|
+
"request",
|
|
158
|
+
"response",
|
|
159
|
+
"async",
|
|
160
|
+
"streaming",
|
|
161
|
+
"event",
|
|
162
|
+
"error",
|
|
163
|
+
"data",
|
|
164
|
+
"control",
|
|
165
|
+
"stream",
|
|
166
|
+
"tool"
|
|
167
|
+
]
|
|
126
168
|
},
|
|
127
169
|
pathType: {
|
|
128
170
|
type: "string",
|
|
@@ -131,14 +173,19 @@ var agentic_v0_1_default = {
|
|
|
131
173
|
handlePosition: {
|
|
132
174
|
type: "string",
|
|
133
175
|
pattern: "^(?:top|right|bottom|left)(?:-\\d+(?:-t)?)?$",
|
|
134
|
-
description: "Connection point on a node. Plain side name ('bottom') connects at the centre; slot form ('bottom-20') places the anchor at
|
|
176
|
+
description: "Connection point on a node. Plain side name ('bottom') connects at the centre; slot form ('bottom-20') places the anchor at that whole-number percentage (0-100) along that side; '-t' suffix marks a target slot ('top-80-t'). Omit it to let the renderer choose the connection point."
|
|
135
177
|
},
|
|
136
178
|
edgeMetadata: {
|
|
137
179
|
type: "object",
|
|
138
180
|
description: "Freeform presentation hints for an edge (editor cosmetics). Known keys are typed; unknown keys are allowed.",
|
|
139
181
|
additionalProperties: true,
|
|
140
182
|
properties: {
|
|
141
|
-
label_pos: {
|
|
183
|
+
label_pos: {
|
|
184
|
+
type: "number",
|
|
185
|
+
minimum: 0,
|
|
186
|
+
maximum: 1,
|
|
187
|
+
description: "Label position along the edge as a fraction of its length (0 = source end, 1 = target end). Defaults to 0.5."
|
|
188
|
+
}
|
|
142
189
|
}
|
|
143
190
|
},
|
|
144
191
|
edgeArrows: {
|
|
@@ -154,7 +201,10 @@ var agentic_v0_1_default = {
|
|
|
154
201
|
to: { type: "string", description: "Target node id" },
|
|
155
202
|
type: { $ref: "#/$defs/edgeType" },
|
|
156
203
|
label: { type: "string" },
|
|
157
|
-
condition: {
|
|
204
|
+
condition: {
|
|
205
|
+
type: "string",
|
|
206
|
+
description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'"
|
|
207
|
+
},
|
|
158
208
|
animated: { type: "boolean", description: "Show animated flow on connection" },
|
|
159
209
|
arrows: { $ref: "#/$defs/edgeArrows" },
|
|
160
210
|
path: { $ref: "#/$defs/pathType" },
|
|
@@ -172,7 +222,10 @@ var agentic_v0_1_default = {
|
|
|
172
222
|
to: { type: "string", description: "Target node id" },
|
|
173
223
|
type: { $ref: "#/$defs/edgeType" },
|
|
174
224
|
label: { type: "string" },
|
|
175
|
-
condition: {
|
|
225
|
+
condition: {
|
|
226
|
+
type: "string",
|
|
227
|
+
description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'"
|
|
228
|
+
},
|
|
176
229
|
animated: { type: "boolean", description: "Show animated flow on connection" },
|
|
177
230
|
arrows: { $ref: "#/$defs/edgeArrows" },
|
|
178
231
|
path: { $ref: "#/$defs/pathType" },
|
|
@@ -211,11 +264,25 @@ var agentic_v0_1_default = {
|
|
|
211
264
|
},
|
|
212
265
|
step: {
|
|
213
266
|
type: "object",
|
|
214
|
-
|
|
267
|
+
description: "A playback step: either a from/to pair (a message between two nodes) or a nodes list (nodes highlighted together), never both.",
|
|
215
268
|
additionalProperties: false,
|
|
269
|
+
oneOf: [
|
|
270
|
+
{ required: ["from", "to"], not: { required: ["nodes"] } },
|
|
271
|
+
{
|
|
272
|
+
required: ["nodes"],
|
|
273
|
+
not: { anyOf: [{ required: ["from"] }, { required: ["to"] }] }
|
|
274
|
+
}
|
|
275
|
+
],
|
|
216
276
|
properties: {
|
|
217
277
|
from: { type: "string", description: "Source node id" },
|
|
218
278
|
to: { type: "string", description: "Target node id" },
|
|
279
|
+
nodes: {
|
|
280
|
+
type: "array",
|
|
281
|
+
description: "Node ids highlighted together at this step. Use instead of from/to when a step involves one node, or more than two.",
|
|
282
|
+
items: { type: "string" },
|
|
283
|
+
minItems: 1,
|
|
284
|
+
uniqueItems: true
|
|
285
|
+
},
|
|
219
286
|
type: { $ref: "#/$defs/stepType" },
|
|
220
287
|
label: { type: "string" },
|
|
221
288
|
payload: { type: "string" },
|
|
@@ -245,8 +312,9 @@ var agentic_v0_1_default = {
|
|
|
245
312
|
},
|
|
246
313
|
size2d: {
|
|
247
314
|
type: "array",
|
|
315
|
+
description: "[width, height], or [width] alone to let the node's height follow its content",
|
|
248
316
|
items: { type: "number", minimum: 0 },
|
|
249
|
-
minItems:
|
|
317
|
+
minItems: 1,
|
|
250
318
|
maxItems: 2
|
|
251
319
|
},
|
|
252
320
|
viewport: {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/validate.ts","../schema/agentic.v0.1.json"],"sourcesContent":["import Ajv2020 from 'ajv/dist/2020.js';\nimport addFormats from 'ajv-formats';\nimport schema from '../schema/agentic.v0.1.json';\n\nexport interface ValidationResult {\n valid: boolean;\n errors: string[];\n}\n\nconst ajv = new Ajv2020({ allErrors: true });\naddFormats(ajv);\nconst compiledValidate = ajv.compile(schema);\n\n/**\n * Validate a parsed YAML object against the agentic schema v0.1.\n *\n * This validates structure only — it does not parse YAML strings.\n * Use your preferred YAML parser (js-yaml, yaml, etc.) first.\n *\n * @example\n * ```ts\n * import * as yaml from 'js-yaml';\n * import { validate } from '@agenticdiagrams/schema';\n *\n * const doc = yaml.load(yamlString);\n * const result = validate(doc);\n * if (!result.valid) {\n * console.error(result.errors);\n * }\n * ```\n */\nexport function validate(data: unknown): ValidationResult {\n const valid = compiledValidate(data);\n\n if (valid) {\n return { valid: true, errors: [] };\n }\n\n const errors = (compiledValidate.errors ?? []).map((err) => {\n const path = err.instancePath || '/';\n const message = err.message || 'unknown error';\n return `${path}: ${message}`;\n });\n\n return { valid: false, errors };\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://agenticdiagrams.com/schemas/agentic/0.1.json\",\n \"title\": \"Agentic Diagram\",\n \"description\": \"Schema for .agentic.yaml diagram files (spec v0.1)\",\n \"type\": \"object\",\n \"required\": [\"agentic\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"agentic\": {\n \"type\": \"string\",\n \"const\": \"0.1\",\n \"description\": \"Spec version\"\n },\n \"diagram\": { \"$ref\": \"#/$defs/diagram\" },\n \"nodes\": {\n \"type\": \"object\",\n \"description\": \"Node definitions keyed by stable id\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/node\" }\n },\n \"edges\": {\n \"type\": \"array\",\n \"description\": \"Connections between nodes (type defaults to request)\",\n \"items\": { \"$ref\": \"#/$defs/edge\" }\n },\n \"scenarios\": {\n \"type\": \"object\",\n \"description\": \"Flow definitions keyed by id\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/scenario\" }\n },\n \"layout\": { \"$ref\": \"#/$defs/layout\" }\n },\n \"$defs\": {\n \"diagram\": {\n \"type\": \"object\",\n \"description\": \"Diagram metadata. All fields optional, name defaults to Untitled\",\n \"additionalProperties\": false,\n \"properties\": {\n \"name\": { \"type\": \"string\", \"default\": \"Untitled\" },\n \"description\": { \"type\": \"string\" },\n \"type\": { \"type\": \"string\", \"enum\": [\"system\", \"component\"] },\n \"active_scenario\": { \"type\": \"string\" },\n \"parent_diagram\": { \"type\": \"string\", \"description\": \"Parent diagram id for drill-down hierarchy\" },\n \"created\": { \"type\": \"string\", \"format\": \"date-time\" },\n \"updated\": { \"type\": \"string\", \"format\": \"date-time\" }\n }\n },\n \"nodeType\": {\n \"type\": \"string\",\n \"enum\": [\n \"agent\", \"tool\", \"component\", \"backend\", \"generic\", \"note\",\n \"system\", \"memory\", \"gateway\", \"skill\", \"channel\", \"waypoint\",\n \"router\", \"human\", \"trigger\", \"guardrail\", \"model\", \"aggregator\",\n \"observability\", \"group\", \"block\", \"image\", \"prompt\", \"user\",\n \"output\", \"knowledge_base\", \"environment\", \"text_label\", \"divider\"\n ]\n },\n \"node\": {\n \"type\": \"object\",\n \"description\": \"Node definition. Label defaults to the node id when omitted\",\n \"required\": [\"type\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"type\": { \"$ref\": \"#/$defs/nodeType\" },\n \"label\": { \"type\": \"string\", \"description\": \"Display name (defaults to node id)\" },\n \"sub_title\": { \"type\": \"string\", \"description\": \"Secondary display text below label\" },\n \"description\": { \"type\": \"string\" },\n \"sub_type\": { \"type\": \"string\" },\n \"url\": { \"type\": \"string\", \"format\": \"uri\" },\n \"group\": { \"type\": \"string\", \"description\": \"Parent group node id\" },\n \"linked_diagram\": { \"type\": \"string\", \"description\": \"Drill-down target diagram id or file path\" },\n \"is_looping\": { \"type\": \"boolean\" },\n \"auth\": { \"type\": \"string\" },\n \"auth_detail\": { \"type\": \"string\" },\n \"provider\": { \"type\": \"string\" },\n \"content\": { \"type\": \"string\" },\n \"example_response\": { \"type\": \"string\" },\n \"ttl\": {\n \"type\": \"string\",\n \"description\": \"Retention lifetime. Primarily for memory nodes. Preset values: session, 24h, permanent. Freeform strings (e.g. 7d) are accepted.\"\n },\n \"scope\": {\n \"type\": \"string\",\n \"description\": \"Audience scope. Primarily for memory nodes. Preset values: per-user, per-session, global. Freeform strings accepted.\"\n },\n \"edges\": {\n \"type\": \"array\",\n \"description\": \"Inline edge definitions (from is inferred as this node)\",\n \"items\": { \"$ref\": \"#/$defs/inlineEdge\" }\n }\n }\n },\n \"edgeType\": {\n \"type\": \"string\",\n \"description\": \"Edge semantic type. Defaults to request when omitted\",\n \"enum\": [\"default\", \"request\", \"response\", \"async\", \"streaming\", \"event\", \"error\"]\n },\n \"pathType\": {\n \"type\": \"string\",\n \"enum\": [\"bezier\", \"straight\", \"step\", \"smooth_step\", \"simple_bezier\"]\n },\n \"handlePosition\": {\n \"type\": \"string\",\n \"pattern\": \"^(?:top|right|bottom|left)(?:-\\\\d+(?:-t)?)?$\",\n \"description\": \"Connection point on a node. Plain side name ('bottom') connects at the centre; slot form ('bottom-20') places the anchor at 20 % along that side; '-t' suffix marks a target slot ('top-80-t').\"\n },\n \"edgeMetadata\": {\n \"type\": \"object\",\n \"description\": \"Freeform presentation hints for an edge (editor cosmetics). Known keys are typed; unknown keys are allowed.\",\n \"additionalProperties\": true,\n \"properties\": {\n \"label_pos\": { \"type\": \"number\", \"minimum\": 0, \"maximum\": 1, \"description\": \"Label position along the edge as a fraction of its length (0 = source end, 1 = target end). Defaults to 0.5.\" }\n }\n },\n \"edgeArrows\": {\n \"enum\": [\"none\", \"start\", \"end\", \"both\"],\n \"description\": \"Which ends of an edge show an arrowhead: none, start (source), end (target), or both. Defaults to 'end'.\"\n },\n \"edge\": {\n \"type\": \"object\",\n \"required\": [\"from\", \"to\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"from\": { \"type\": \"string\", \"description\": \"Source node id\" },\n \"to\": { \"type\": \"string\", \"description\": \"Target node id\" },\n \"type\": { \"$ref\": \"#/$defs/edgeType\" },\n \"label\": { \"type\": \"string\" },\n \"condition\": { \"type\": \"string\", \"description\": \"Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'\" },\n \"animated\": { \"type\": \"boolean\", \"description\": \"Show animated flow on connection\" },\n \"arrows\": { \"$ref\": \"#/$defs/edgeArrows\" },\n \"path\": { \"$ref\": \"#/$defs/pathType\" },\n \"source_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"target_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"metadata\": { \"$ref\": \"#/$defs/edgeMetadata\" }\n }\n },\n \"inlineEdge\": {\n \"type\": \"object\",\n \"description\": \"Edge defined on a node (from is inferred as the parent node id)\",\n \"required\": [\"to\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"to\": { \"type\": \"string\", \"description\": \"Target node id\" },\n \"type\": { \"$ref\": \"#/$defs/edgeType\" },\n \"label\": { \"type\": \"string\" },\n \"condition\": { \"type\": \"string\", \"description\": \"Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'\" },\n \"animated\": { \"type\": \"boolean\", \"description\": \"Show animated flow on connection\" },\n \"arrows\": { \"$ref\": \"#/$defs/edgeArrows\" },\n \"path\": { \"$ref\": \"#/$defs/pathType\" },\n \"source_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"target_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"metadata\": { \"$ref\": \"#/$defs/edgeMetadata\" }\n }\n },\n \"stepType\": {\n \"type\": \"string\",\n \"description\": \"Step semantic type. Defaults to call when omitted\",\n \"enum\": [\"call\", \"return\", \"async\", \"event\", \"error\"]\n },\n \"fragmentType\": {\n \"type\": \"string\",\n \"enum\": [\"alt\", \"opt\", \"loop\", \"par\"]\n },\n \"fragment\": {\n \"type\": \"object\",\n \"required\": [\"type\", \"position\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"type\": { \"$ref\": \"#/$defs/fragmentType\" },\n \"label\": { \"type\": \"string\" },\n \"position\": { \"type\": \"string\", \"enum\": [\"start\", \"else\", \"end\"] }\n }\n },\n \"note\": {\n \"type\": \"object\",\n \"required\": [\"text\", \"position\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"text\": { \"type\": \"string\" },\n \"position\": { \"type\": \"string\", \"enum\": [\"left\", \"right\", \"over\"] }\n }\n },\n \"step\": {\n \"type\": \"object\",\n \"required\": [\"from\", \"to\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"from\": { \"type\": \"string\", \"description\": \"Source node id\" },\n \"to\": { \"type\": \"string\", \"description\": \"Target node id\" },\n \"type\": { \"$ref\": \"#/$defs/stepType\" },\n \"label\": { \"type\": \"string\" },\n \"payload\": { \"type\": \"string\" },\n \"duration\": { \"type\": \"number\", \"minimum\": 0 },\n \"fragment\": { \"$ref\": \"#/$defs/fragment\" },\n \"note\": { \"$ref\": \"#/$defs/note\" }\n }\n },\n \"scenario\": {\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"description\": { \"type\": \"string\" },\n \"steps\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/step\" }\n }\n }\n },\n \"point2d\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"number\" },\n \"minItems\": 2,\n \"maxItems\": 2\n },\n \"size2d\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"number\", \"minimum\": 0 },\n \"minItems\": 2,\n \"maxItems\": 2\n },\n \"viewport\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"number\" },\n \"minItems\": 3,\n \"maxItems\": 3,\n \"description\": \"[x, y, zoom]\"\n },\n \"nodeStyle\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"borderless\": { \"type\": \"boolean\" },\n \"icon_url\": { \"type\": \"string\", \"format\": \"uri\" },\n \"icon_layout\": { \"type\": \"string\", \"enum\": [\"left\", \"right\", \"top\", \"bottom\"] },\n \"image_url\": { \"type\": \"string\", \"format\": \"uri\" }\n }\n },\n \"direction\": {\n \"type\": \"string\",\n \"description\": \"Auto-layout flow direction. Defaults to TB\",\n \"enum\": [\"TB\", \"LR\", \"BT\", \"RL\"]\n },\n \"layout\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"direction\": { \"$ref\": \"#/$defs/direction\" },\n \"viewport\": { \"$ref\": \"#/$defs/viewport\" },\n \"positions\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/point2d\" }\n },\n \"sizes\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/size2d\" }\n },\n \"node_styles\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/nodeStyle\" }\n }\n }\n }\n }\n}\n"],"mappings":";AAAA,OAAO,aAAa;AACpB,OAAO,gBAAgB;;;ACDvB;AAAA,EACE,SAAW;AAAA,EACX,KAAO;AAAA,EACP,OAAS;AAAA,EACT,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,UAAY,CAAC,SAAS;AAAA,EACtB,sBAAwB;AAAA,EACxB,YAAc;AAAA,IACZ,SAAW;AAAA,MACT,MAAQ;AAAA,MACR,OAAS;AAAA,MACT,aAAe;AAAA,IACjB;AAAA,IACA,SAAW,EAAE,MAAQ,kBAAkB;AAAA,IACvC,OAAS;AAAA,MACP,MAAQ;AAAA,MACR,aAAe;AAAA,MACf,sBAAwB,EAAE,MAAQ,eAAe;AAAA,IACnD;AAAA,IACA,OAAS;AAAA,MACP,MAAQ;AAAA,MACR,aAAe;AAAA,MACf,OAAS,EAAE,MAAQ,eAAe;AAAA,IACpC;AAAA,IACA,WAAa;AAAA,MACX,MAAQ;AAAA,MACR,aAAe;AAAA,MACf,sBAAwB,EAAE,MAAQ,mBAAmB;AAAA,IACvD;AAAA,IACA,QAAU,EAAE,MAAQ,iBAAiB;AAAA,EACvC;AAAA,EACA,OAAS;AAAA,IACP,SAAW;AAAA,MACT,MAAQ;AAAA,MACR,aAAe;AAAA,MACf,sBAAwB;AAAA,MACxB,YAAc;AAAA,QACZ,MAAQ,EAAE,MAAQ,UAAU,SAAW,WAAW;AAAA,QAClD,aAAe,EAAE,MAAQ,SAAS;AAAA,QAClC,MAAQ,EAAE,MAAQ,UAAU,MAAQ,CAAC,UAAU,WAAW,EAAE;AAAA,QAC5D,iBAAmB,EAAE,MAAQ,SAAS;AAAA,QACtC,gBAAkB,EAAE,MAAQ,UAAU,aAAe,6CAA6C;AAAA,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AAI,QAAQ,EAAE,WAAW,KAAK,CAAC;AAC3C,WAAW,GAAG;AACd,IAAM,mBAAmB,IAAI,QAAQ,oBAAM;AAoBpC,SAAS,SAAS,MAAiC;AACxD,QAAM,QAAQ,iBAAiB,IAAI;AAEnC,MAAI,OAAO;AACT,WAAO,EAAE,OAAO,MAAM,QAAQ,CAAC,EAAE;AAAA,EACnC;AAEA,QAAM,UAAU,iBAAiB,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ;AAC1D,UAAM,OAAO,IAAI,gBAAgB;AACjC,UAAM,UAAU,IAAI,WAAW;AAC/B,WAAO,GAAG,IAAI,KAAK,OAAO;AAAA,EAC5B,CAAC;AAED,SAAO,EAAE,OAAO,OAAO,OAAO;AAChC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/validate.ts","../schema/agentic.v0.1.json"],"sourcesContent":["import Ajv2020 from 'ajv/dist/2020.js';\nimport addFormats from 'ajv-formats';\nimport schema from '../schema/agentic.v0.1.json';\n\nexport interface ValidationResult {\n valid: boolean;\n errors: string[];\n}\n\nconst ajv = new Ajv2020({ allErrors: true });\naddFormats(ajv);\nconst compiledValidate = ajv.compile(schema);\n\n/**\n * Validate a parsed YAML object against the agentic schema v0.1.\n *\n * This validates structure only — it does not parse YAML strings.\n * Use your preferred YAML parser (js-yaml, yaml, etc.) first.\n *\n * @example\n * ```ts\n * import * as yaml from 'js-yaml';\n * import { validate } from '@agenticdiagrams/schema';\n *\n * const doc = yaml.load(yamlString);\n * const result = validate(doc);\n * if (!result.valid) {\n * console.error(result.errors);\n * }\n * ```\n */\nexport function validate(data: unknown): ValidationResult {\n const valid = compiledValidate(data);\n\n if (valid) {\n return { valid: true, errors: [] };\n }\n\n const errors = (compiledValidate.errors ?? []).map((err) => {\n const path = err.instancePath || '/';\n const message = err.message || 'unknown error';\n return `${path}: ${message}`;\n });\n\n return { valid: false, errors };\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://agenticdiagrams.com/schemas/agentic/0.1.json\",\n \"title\": \"Agentic Diagram\",\n \"description\": \"Schema for .agentic.yaml diagram files (spec v0.1)\",\n \"type\": \"object\",\n \"required\": [\"agentic\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"agentic\": {\n \"type\": \"string\",\n \"const\": \"0.1\",\n \"description\": \"Spec version\"\n },\n \"diagram\": { \"$ref\": \"#/$defs/diagram\" },\n \"nodes\": {\n \"type\": \"object\",\n \"description\": \"Node definitions keyed by stable id\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/node\" }\n },\n \"edges\": {\n \"type\": \"array\",\n \"description\": \"Connections between nodes (type defaults to request)\",\n \"items\": { \"$ref\": \"#/$defs/edge\" }\n },\n \"scenarios\": {\n \"type\": \"object\",\n \"description\": \"Flow definitions keyed by id\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/scenario\" }\n },\n \"layout\": { \"$ref\": \"#/$defs/layout\" }\n },\n \"$defs\": {\n \"diagram\": {\n \"type\": \"object\",\n \"description\": \"Diagram metadata. All fields optional, name defaults to Untitled\",\n \"additionalProperties\": false,\n \"properties\": {\n \"name\": { \"type\": \"string\", \"default\": \"Untitled\" },\n \"description\": { \"type\": \"string\" },\n \"type\": { \"type\": \"string\", \"enum\": [\"system\", \"component\"] },\n \"active_scenario\": { \"type\": \"string\" },\n \"parent_diagram\": {\n \"type\": \"string\",\n \"description\": \"Parent diagram id for drill-down hierarchy\"\n },\n \"created\": { \"type\": \"string\", \"format\": \"date-time\" },\n \"updated\": { \"type\": \"string\", \"format\": \"date-time\" }\n }\n },\n \"nodeType\": {\n \"type\": \"string\",\n \"enum\": [\n \"agent\",\n \"tool\",\n \"component\",\n \"backend\",\n \"generic\",\n \"note\",\n \"system\",\n \"memory\",\n \"gateway\",\n \"skill\",\n \"channel\",\n \"waypoint\",\n \"router\",\n \"human\",\n \"trigger\",\n \"guardrail\",\n \"model\",\n \"aggregator\",\n \"observability\",\n \"group\",\n \"block\",\n \"image\",\n \"prompt\",\n \"user\",\n \"output\",\n \"knowledge_base\",\n \"environment\",\n \"text_label\",\n \"divider\"\n ]\n },\n \"node\": {\n \"type\": \"object\",\n \"description\": \"Node definition. Label defaults to the node id when omitted\",\n \"required\": [\"type\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"type\": { \"$ref\": \"#/$defs/nodeType\" },\n \"label\": { \"type\": \"string\", \"description\": \"Display name (defaults to node id)\" },\n \"sub_title\": { \"type\": \"string\", \"description\": \"Secondary display text below label\" },\n \"badge\": {\n \"type\": \"string\",\n \"description\": \"Short tag shown on the node, e.g. NEW or beta\"\n },\n \"description\": { \"type\": \"string\" },\n \"sub_type\": { \"type\": \"string\" },\n \"url\": { \"type\": \"string\", \"format\": \"uri\" },\n \"group\": { \"type\": \"string\", \"description\": \"Parent group node id\" },\n \"linked_diagram\": {\n \"type\": \"string\",\n \"description\": \"Drill-down target diagram id or file path\"\n },\n \"is_looping\": { \"type\": \"boolean\" },\n \"auth\": { \"type\": \"string\" },\n \"auth_detail\": { \"type\": \"string\" },\n \"provider\": { \"type\": \"string\" },\n \"model\": {\n \"type\": \"string\",\n \"description\": \"Model identifier, e.g. claude-sonnet-4-6. Primarily for agent and model nodes.\"\n },\n \"content\": { \"type\": \"string\" },\n \"example_response\": { \"type\": \"string\" },\n \"input_schema\": {\n \"type\": \"string\",\n \"description\": \"Input schema, usually JSON Schema serialised as a string. Primarily for tool nodes.\"\n },\n \"output_schema\": {\n \"type\": \"string\",\n \"description\": \"Output schema, usually JSON Schema serialised as a string. Primarily for tool nodes.\"\n },\n \"ttl\": {\n \"type\": \"string\",\n \"description\": \"Retention lifetime. Primarily for memory nodes. Preset values: session, 24h, permanent. Freeform strings (e.g. 7d) are accepted.\"\n },\n \"scope\": {\n \"type\": \"string\",\n \"description\": \"Audience scope. Primarily for memory nodes. Preset values: per-user, per-session, global. Freeform strings accepted.\"\n },\n \"metadata\": { \"$ref\": \"#/$defs/nodeMetadata\" },\n \"edges\": {\n \"type\": \"array\",\n \"description\": \"Inline edge definitions (from is inferred as this node)\",\n \"items\": { \"$ref\": \"#/$defs/inlineEdge\" }\n }\n }\n },\n \"nodeMetadata\": {\n \"type\": \"object\",\n \"description\": \"Freeform node properties the spec does not model, such as extra typed fields or editor hints. Values are strings, numbers or booleans.\",\n \"additionalProperties\": {\n \"anyOf\": [{ \"type\": \"string\" }, { \"type\": \"number\" }, { \"type\": \"boolean\" }]\n }\n },\n \"edgeType\": {\n \"type\": \"string\",\n \"description\": \"Edge semantic type. Defaults to request when omitted. data, control, stream and tool are the connection kinds of the current editor; stream is equivalent to streaming.\",\n \"enum\": [\n \"default\",\n \"request\",\n \"response\",\n \"async\",\n \"streaming\",\n \"event\",\n \"error\",\n \"data\",\n \"control\",\n \"stream\",\n \"tool\"\n ]\n },\n \"pathType\": {\n \"type\": \"string\",\n \"enum\": [\"bezier\", \"straight\", \"step\", \"smooth_step\", \"simple_bezier\"]\n },\n \"handlePosition\": {\n \"type\": \"string\",\n \"pattern\": \"^(?:top|right|bottom|left)(?:-\\\\d+(?:-t)?)?$\",\n \"description\": \"Connection point on a node. Plain side name ('bottom') connects at the centre; slot form ('bottom-20') places the anchor at that whole-number percentage (0-100) along that side; '-t' suffix marks a target slot ('top-80-t'). Omit it to let the renderer choose the connection point.\"\n },\n \"edgeMetadata\": {\n \"type\": \"object\",\n \"description\": \"Freeform presentation hints for an edge (editor cosmetics). Known keys are typed; unknown keys are allowed.\",\n \"additionalProperties\": true,\n \"properties\": {\n \"label_pos\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"description\": \"Label position along the edge as a fraction of its length (0 = source end, 1 = target end). Defaults to 0.5.\"\n }\n }\n },\n \"edgeArrows\": {\n \"enum\": [\"none\", \"start\", \"end\", \"both\"],\n \"description\": \"Which ends of an edge show an arrowhead: none, start (source), end (target), or both. Defaults to 'end'.\"\n },\n \"edge\": {\n \"type\": \"object\",\n \"required\": [\"from\", \"to\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"from\": { \"type\": \"string\", \"description\": \"Source node id\" },\n \"to\": { \"type\": \"string\", \"description\": \"Target node id\" },\n \"type\": { \"$ref\": \"#/$defs/edgeType\" },\n \"label\": { \"type\": \"string\" },\n \"condition\": {\n \"type\": \"string\",\n \"description\": \"Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'\"\n },\n \"animated\": { \"type\": \"boolean\", \"description\": \"Show animated flow on connection\" },\n \"arrows\": { \"$ref\": \"#/$defs/edgeArrows\" },\n \"path\": { \"$ref\": \"#/$defs/pathType\" },\n \"source_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"target_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"metadata\": { \"$ref\": \"#/$defs/edgeMetadata\" }\n }\n },\n \"inlineEdge\": {\n \"type\": \"object\",\n \"description\": \"Edge defined on a node (from is inferred as the parent node id)\",\n \"required\": [\"to\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"to\": { \"type\": \"string\", \"description\": \"Target node id\" },\n \"type\": { \"$ref\": \"#/$defs/edgeType\" },\n \"label\": { \"type\": \"string\" },\n \"condition\": {\n \"type\": \"string\",\n \"description\": \"Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'\"\n },\n \"animated\": { \"type\": \"boolean\", \"description\": \"Show animated flow on connection\" },\n \"arrows\": { \"$ref\": \"#/$defs/edgeArrows\" },\n \"path\": { \"$ref\": \"#/$defs/pathType\" },\n \"source_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"target_handle\": { \"$ref\": \"#/$defs/handlePosition\" },\n \"metadata\": { \"$ref\": \"#/$defs/edgeMetadata\" }\n }\n },\n \"stepType\": {\n \"type\": \"string\",\n \"description\": \"Step semantic type. Defaults to call when omitted\",\n \"enum\": [\"call\", \"return\", \"async\", \"event\", \"error\"]\n },\n \"fragmentType\": {\n \"type\": \"string\",\n \"enum\": [\"alt\", \"opt\", \"loop\", \"par\"]\n },\n \"fragment\": {\n \"type\": \"object\",\n \"required\": [\"type\", \"position\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"type\": { \"$ref\": \"#/$defs/fragmentType\" },\n \"label\": { \"type\": \"string\" },\n \"position\": { \"type\": \"string\", \"enum\": [\"start\", \"else\", \"end\"] }\n }\n },\n \"note\": {\n \"type\": \"object\",\n \"required\": [\"text\", \"position\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"text\": { \"type\": \"string\" },\n \"position\": { \"type\": \"string\", \"enum\": [\"left\", \"right\", \"over\"] }\n }\n },\n \"step\": {\n \"type\": \"object\",\n \"description\": \"A playback step: either a from/to pair (a message between two nodes) or a nodes list (nodes highlighted together), never both.\",\n \"additionalProperties\": false,\n \"oneOf\": [\n { \"required\": [\"from\", \"to\"], \"not\": { \"required\": [\"nodes\"] } },\n {\n \"required\": [\"nodes\"],\n \"not\": { \"anyOf\": [{ \"required\": [\"from\"] }, { \"required\": [\"to\"] }] }\n }\n ],\n \"properties\": {\n \"from\": { \"type\": \"string\", \"description\": \"Source node id\" },\n \"to\": { \"type\": \"string\", \"description\": \"Target node id\" },\n \"nodes\": {\n \"type\": \"array\",\n \"description\": \"Node ids highlighted together at this step. Use instead of from/to when a step involves one node, or more than two.\",\n \"items\": { \"type\": \"string\" },\n \"minItems\": 1,\n \"uniqueItems\": true\n },\n \"type\": { \"$ref\": \"#/$defs/stepType\" },\n \"label\": { \"type\": \"string\" },\n \"payload\": { \"type\": \"string\" },\n \"duration\": { \"type\": \"number\", \"minimum\": 0 },\n \"fragment\": { \"$ref\": \"#/$defs/fragment\" },\n \"note\": { \"$ref\": \"#/$defs/note\" }\n }\n },\n \"scenario\": {\n \"type\": \"object\",\n \"required\": [\"name\"],\n \"additionalProperties\": false,\n \"properties\": {\n \"name\": { \"type\": \"string\" },\n \"description\": { \"type\": \"string\" },\n \"steps\": {\n \"type\": \"array\",\n \"items\": { \"$ref\": \"#/$defs/step\" }\n }\n }\n },\n \"point2d\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"number\" },\n \"minItems\": 2,\n \"maxItems\": 2\n },\n \"size2d\": {\n \"type\": \"array\",\n \"description\": \"[width, height], or [width] alone to let the node's height follow its content\",\n \"items\": { \"type\": \"number\", \"minimum\": 0 },\n \"minItems\": 1,\n \"maxItems\": 2\n },\n \"viewport\": {\n \"type\": \"array\",\n \"items\": { \"type\": \"number\" },\n \"minItems\": 3,\n \"maxItems\": 3,\n \"description\": \"[x, y, zoom]\"\n },\n \"nodeStyle\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"borderless\": { \"type\": \"boolean\" },\n \"icon_url\": { \"type\": \"string\", \"format\": \"uri\" },\n \"icon_layout\": { \"type\": \"string\", \"enum\": [\"left\", \"right\", \"top\", \"bottom\"] },\n \"image_url\": { \"type\": \"string\", \"format\": \"uri\" }\n }\n },\n \"direction\": {\n \"type\": \"string\",\n \"description\": \"Auto-layout flow direction. Defaults to TB\",\n \"enum\": [\"TB\", \"LR\", \"BT\", \"RL\"]\n },\n \"layout\": {\n \"type\": \"object\",\n \"additionalProperties\": false,\n \"properties\": {\n \"direction\": { \"$ref\": \"#/$defs/direction\" },\n \"viewport\": { \"$ref\": \"#/$defs/viewport\" },\n \"positions\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/point2d\" }\n },\n \"sizes\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/size2d\" }\n },\n \"node_styles\": {\n \"type\": \"object\",\n \"additionalProperties\": { \"$ref\": \"#/$defs/nodeStyle\" }\n }\n }\n }\n }\n}\n"],"mappings":";AAAA,OAAO,aAAa;AACpB,OAAO,gBAAgB;;;ACDvB;AAAA,EACE,SAAW;AAAA,EACX,KAAO;AAAA,EACP,OAAS;AAAA,EACT,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,UAAY,CAAC,SAAS;AAAA,EACtB,sBAAwB;AAAA,EACxB,YAAc;AAAA,IACZ,SAAW;AAAA,MACT,MAAQ;AAAA,MACR,OAAS;AAAA,MACT,aA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AAA,MACX,MAAQ;AAAA,MACR,aAAe;AAAA,MACf,MAAQ,CAAC,MAAM,MAAM,MAAM,IAAI;AAAA,IACjC;AAAA,IACA,QAAU;AAAA,MACR,MAAQ;AAAA,MACR,sBAAwB;AAAA,MACxB,YAAc;AAAA,QACZ,WAAa,EAAE,MAAQ,oBAAoB;AAAA,QAC3C,UAAY,EAAE,MAAQ,mBAAmB;AAAA,QACzC,WAAa;AAAA,UACX,MAAQ;AAAA,UACR,sBAAwB,EAAE,MAAQ,kBAAkB;AAAA,QACtD;AAAA,QACA,OAAS;AAAA,UACP,MAAQ;AAAA,UACR,sBAAwB,EAAE,MAAQ,iBAAiB;AAAA,QACrD;AAAA,QACA,aAAe;AAAA,UACb,MAAQ;AAAA,UACR,sBAAwB,EAAE,MAAQ,oBAAoB;AAAA,QACxD;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;AD5VA,IAAM,MAAM,IAAI,QAAQ,EAAE,WAAW,KAAK,CAAC;AAC3C,WAAW,GAAG;AACd,IAAM,mBAAmB,IAAI,QAAQ,oBAAM;AAoBpC,SAAS,SAAS,MAAiC;AACxD,QAAM,QAAQ,iBAAiB,IAAI;AAEnC,MAAI,OAAO;AACT,WAAO,EAAE,OAAO,MAAM,QAAQ,CAAC,EAAE;AAAA,EACnC;AAEA,QAAM,UAAU,iBAAiB,UAAU,CAAC,GAAG,IAAI,CAAC,QAAQ;AAC1D,UAAM,OAAO,IAAI,gBAAgB;AACjC,UAAM,UAAU,IAAI,WAAW;AAC/B,WAAO,GAAG,IAAI,KAAK,OAAO;AAAA,EAC5B,CAAC;AAED,SAAO,EAAE,OAAO,OAAO,OAAO;AAChC;","names":[]}
|
package/package.json
CHANGED
package/schema/agentic.v0.1.json
CHANGED
|
@@ -40,7 +40,10 @@
|
|
|
40
40
|
"description": { "type": "string" },
|
|
41
41
|
"type": { "type": "string", "enum": ["system", "component"] },
|
|
42
42
|
"active_scenario": { "type": "string" },
|
|
43
|
-
"parent_diagram": {
|
|
43
|
+
"parent_diagram": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Parent diagram id for drill-down hierarchy"
|
|
46
|
+
},
|
|
44
47
|
"created": { "type": "string", "format": "date-time" },
|
|
45
48
|
"updated": { "type": "string", "format": "date-time" }
|
|
46
49
|
}
|
|
@@ -48,11 +51,35 @@
|
|
|
48
51
|
"nodeType": {
|
|
49
52
|
"type": "string",
|
|
50
53
|
"enum": [
|
|
51
|
-
"agent",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
54
|
+
"agent",
|
|
55
|
+
"tool",
|
|
56
|
+
"component",
|
|
57
|
+
"backend",
|
|
58
|
+
"generic",
|
|
59
|
+
"note",
|
|
60
|
+
"system",
|
|
61
|
+
"memory",
|
|
62
|
+
"gateway",
|
|
63
|
+
"skill",
|
|
64
|
+
"channel",
|
|
65
|
+
"waypoint",
|
|
66
|
+
"router",
|
|
67
|
+
"human",
|
|
68
|
+
"trigger",
|
|
69
|
+
"guardrail",
|
|
70
|
+
"model",
|
|
71
|
+
"aggregator",
|
|
72
|
+
"observability",
|
|
73
|
+
"group",
|
|
74
|
+
"block",
|
|
75
|
+
"image",
|
|
76
|
+
"prompt",
|
|
77
|
+
"user",
|
|
78
|
+
"output",
|
|
79
|
+
"knowledge_base",
|
|
80
|
+
"environment",
|
|
81
|
+
"text_label",
|
|
82
|
+
"divider"
|
|
56
83
|
]
|
|
57
84
|
},
|
|
58
85
|
"node": {
|
|
@@ -64,17 +91,36 @@
|
|
|
64
91
|
"type": { "$ref": "#/$defs/nodeType" },
|
|
65
92
|
"label": { "type": "string", "description": "Display name (defaults to node id)" },
|
|
66
93
|
"sub_title": { "type": "string", "description": "Secondary display text below label" },
|
|
94
|
+
"badge": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "Short tag shown on the node, e.g. NEW or beta"
|
|
97
|
+
},
|
|
67
98
|
"description": { "type": "string" },
|
|
68
99
|
"sub_type": { "type": "string" },
|
|
69
100
|
"url": { "type": "string", "format": "uri" },
|
|
70
101
|
"group": { "type": "string", "description": "Parent group node id" },
|
|
71
|
-
"linked_diagram": {
|
|
102
|
+
"linked_diagram": {
|
|
103
|
+
"type": "string",
|
|
104
|
+
"description": "Drill-down target diagram id or file path"
|
|
105
|
+
},
|
|
72
106
|
"is_looping": { "type": "boolean" },
|
|
73
107
|
"auth": { "type": "string" },
|
|
74
108
|
"auth_detail": { "type": "string" },
|
|
75
109
|
"provider": { "type": "string" },
|
|
110
|
+
"model": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"description": "Model identifier, e.g. claude-sonnet-4-6. Primarily for agent and model nodes."
|
|
113
|
+
},
|
|
76
114
|
"content": { "type": "string" },
|
|
77
115
|
"example_response": { "type": "string" },
|
|
116
|
+
"input_schema": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"description": "Input schema, usually JSON Schema serialised as a string. Primarily for tool nodes."
|
|
119
|
+
},
|
|
120
|
+
"output_schema": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"description": "Output schema, usually JSON Schema serialised as a string. Primarily for tool nodes."
|
|
123
|
+
},
|
|
78
124
|
"ttl": {
|
|
79
125
|
"type": "string",
|
|
80
126
|
"description": "Retention lifetime. Primarily for memory nodes. Preset values: session, 24h, permanent. Freeform strings (e.g. 7d) are accepted."
|
|
@@ -83,6 +129,7 @@
|
|
|
83
129
|
"type": "string",
|
|
84
130
|
"description": "Audience scope. Primarily for memory nodes. Preset values: per-user, per-session, global. Freeform strings accepted."
|
|
85
131
|
},
|
|
132
|
+
"metadata": { "$ref": "#/$defs/nodeMetadata" },
|
|
86
133
|
"edges": {
|
|
87
134
|
"type": "array",
|
|
88
135
|
"description": "Inline edge definitions (from is inferred as this node)",
|
|
@@ -90,10 +137,29 @@
|
|
|
90
137
|
}
|
|
91
138
|
}
|
|
92
139
|
},
|
|
140
|
+
"nodeMetadata": {
|
|
141
|
+
"type": "object",
|
|
142
|
+
"description": "Freeform node properties the spec does not model, such as extra typed fields or editor hints. Values are strings, numbers or booleans.",
|
|
143
|
+
"additionalProperties": {
|
|
144
|
+
"anyOf": [{ "type": "string" }, { "type": "number" }, { "type": "boolean" }]
|
|
145
|
+
}
|
|
146
|
+
},
|
|
93
147
|
"edgeType": {
|
|
94
148
|
"type": "string",
|
|
95
|
-
"description": "Edge semantic type. Defaults to request when omitted",
|
|
96
|
-
"enum": [
|
|
149
|
+
"description": "Edge semantic type. Defaults to request when omitted. data, control, stream and tool are the connection kinds of the current editor; stream is equivalent to streaming.",
|
|
150
|
+
"enum": [
|
|
151
|
+
"default",
|
|
152
|
+
"request",
|
|
153
|
+
"response",
|
|
154
|
+
"async",
|
|
155
|
+
"streaming",
|
|
156
|
+
"event",
|
|
157
|
+
"error",
|
|
158
|
+
"data",
|
|
159
|
+
"control",
|
|
160
|
+
"stream",
|
|
161
|
+
"tool"
|
|
162
|
+
]
|
|
97
163
|
},
|
|
98
164
|
"pathType": {
|
|
99
165
|
"type": "string",
|
|
@@ -102,14 +168,19 @@
|
|
|
102
168
|
"handlePosition": {
|
|
103
169
|
"type": "string",
|
|
104
170
|
"pattern": "^(?:top|right|bottom|left)(?:-\\d+(?:-t)?)?$",
|
|
105
|
-
"description": "Connection point on a node. Plain side name ('bottom') connects at the centre; slot form ('bottom-20') places the anchor at
|
|
171
|
+
"description": "Connection point on a node. Plain side name ('bottom') connects at the centre; slot form ('bottom-20') places the anchor at that whole-number percentage (0-100) along that side; '-t' suffix marks a target slot ('top-80-t'). Omit it to let the renderer choose the connection point."
|
|
106
172
|
},
|
|
107
173
|
"edgeMetadata": {
|
|
108
174
|
"type": "object",
|
|
109
175
|
"description": "Freeform presentation hints for an edge (editor cosmetics). Known keys are typed; unknown keys are allowed.",
|
|
110
176
|
"additionalProperties": true,
|
|
111
177
|
"properties": {
|
|
112
|
-
"label_pos": {
|
|
178
|
+
"label_pos": {
|
|
179
|
+
"type": "number",
|
|
180
|
+
"minimum": 0,
|
|
181
|
+
"maximum": 1,
|
|
182
|
+
"description": "Label position along the edge as a fraction of its length (0 = source end, 1 = target end). Defaults to 0.5."
|
|
183
|
+
}
|
|
113
184
|
}
|
|
114
185
|
},
|
|
115
186
|
"edgeArrows": {
|
|
@@ -125,7 +196,10 @@
|
|
|
125
196
|
"to": { "type": "string", "description": "Target node id" },
|
|
126
197
|
"type": { "$ref": "#/$defs/edgeType" },
|
|
127
198
|
"label": { "type": "string" },
|
|
128
|
-
"condition": {
|
|
199
|
+
"condition": {
|
|
200
|
+
"type": "string",
|
|
201
|
+
"description": "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'"
|
|
202
|
+
},
|
|
129
203
|
"animated": { "type": "boolean", "description": "Show animated flow on connection" },
|
|
130
204
|
"arrows": { "$ref": "#/$defs/edgeArrows" },
|
|
131
205
|
"path": { "$ref": "#/$defs/pathType" },
|
|
@@ -143,7 +217,10 @@
|
|
|
143
217
|
"to": { "type": "string", "description": "Target node id" },
|
|
144
218
|
"type": { "$ref": "#/$defs/edgeType" },
|
|
145
219
|
"label": { "type": "string" },
|
|
146
|
-
"condition": {
|
|
220
|
+
"condition": {
|
|
221
|
+
"type": "string",
|
|
222
|
+
"description": "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'"
|
|
223
|
+
},
|
|
147
224
|
"animated": { "type": "boolean", "description": "Show animated flow on connection" },
|
|
148
225
|
"arrows": { "$ref": "#/$defs/edgeArrows" },
|
|
149
226
|
"path": { "$ref": "#/$defs/pathType" },
|
|
@@ -182,11 +259,25 @@
|
|
|
182
259
|
},
|
|
183
260
|
"step": {
|
|
184
261
|
"type": "object",
|
|
185
|
-
"
|
|
262
|
+
"description": "A playback step: either a from/to pair (a message between two nodes) or a nodes list (nodes highlighted together), never both.",
|
|
186
263
|
"additionalProperties": false,
|
|
264
|
+
"oneOf": [
|
|
265
|
+
{ "required": ["from", "to"], "not": { "required": ["nodes"] } },
|
|
266
|
+
{
|
|
267
|
+
"required": ["nodes"],
|
|
268
|
+
"not": { "anyOf": [{ "required": ["from"] }, { "required": ["to"] }] }
|
|
269
|
+
}
|
|
270
|
+
],
|
|
187
271
|
"properties": {
|
|
188
272
|
"from": { "type": "string", "description": "Source node id" },
|
|
189
273
|
"to": { "type": "string", "description": "Target node id" },
|
|
274
|
+
"nodes": {
|
|
275
|
+
"type": "array",
|
|
276
|
+
"description": "Node ids highlighted together at this step. Use instead of from/to when a step involves one node, or more than two.",
|
|
277
|
+
"items": { "type": "string" },
|
|
278
|
+
"minItems": 1,
|
|
279
|
+
"uniqueItems": true
|
|
280
|
+
},
|
|
190
281
|
"type": { "$ref": "#/$defs/stepType" },
|
|
191
282
|
"label": { "type": "string" },
|
|
192
283
|
"payload": { "type": "string" },
|
|
@@ -216,8 +307,9 @@
|
|
|
216
307
|
},
|
|
217
308
|
"size2d": {
|
|
218
309
|
"type": "array",
|
|
310
|
+
"description": "[width, height], or [width] alone to let the node's height follow its content",
|
|
219
311
|
"items": { "type": "number", "minimum": 0 },
|
|
220
|
-
"minItems":
|
|
312
|
+
"minItems": 1,
|
|
221
313
|
"maxItems": 2
|
|
222
314
|
},
|
|
223
315
|
"viewport": {
|