@agenticdiagrams/schema 0.1.4 → 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 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 | 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 |
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: "0.1"
71
+ agentic: '0.1'
72
72
  ```
73
73
 
74
74
  A practical minimum:
75
75
 
76
76
  ```yaml
77
- agentic: "0.1"
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: { type: "string", description: "Parent diagram id for drill-down hierarchy" },
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: { type: "string", description: "Drill-down target diagram id or file path" },
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: ["default", "request", "response", "async", "streaming", "event", "error"]
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,16 +209,25 @@ 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 20 % along that side; '-t' suffix marks a target slot ('top-80-t')."
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: { 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." }
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
  },
227
+ edgeArrows: {
228
+ enum: ["none", "start", "end", "both"],
229
+ description: "Which ends of an edge show an arrowhead: none, start (source), end (target), or both. Defaults to 'end'."
230
+ },
180
231
  edge: {
181
232
  type: "object",
182
233
  required: ["from", "to"],
@@ -186,8 +237,12 @@ var agentic_v0_1_default = {
186
237
  to: { type: "string", description: "Target node id" },
187
238
  type: { $ref: "#/$defs/edgeType" },
188
239
  label: { type: "string" },
189
- condition: { type: "string", description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'" },
240
+ condition: {
241
+ type: "string",
242
+ description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'"
243
+ },
190
244
  animated: { type: "boolean", description: "Show animated flow on connection" },
245
+ arrows: { $ref: "#/$defs/edgeArrows" },
191
246
  path: { $ref: "#/$defs/pathType" },
192
247
  source_handle: { $ref: "#/$defs/handlePosition" },
193
248
  target_handle: { $ref: "#/$defs/handlePosition" },
@@ -203,8 +258,12 @@ var agentic_v0_1_default = {
203
258
  to: { type: "string", description: "Target node id" },
204
259
  type: { $ref: "#/$defs/edgeType" },
205
260
  label: { type: "string" },
206
- condition: { type: "string", description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'" },
261
+ condition: {
262
+ type: "string",
263
+ description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'"
264
+ },
207
265
  animated: { type: "boolean", description: "Show animated flow on connection" },
266
+ arrows: { $ref: "#/$defs/edgeArrows" },
208
267
  path: { $ref: "#/$defs/pathType" },
209
268
  source_handle: { $ref: "#/$defs/handlePosition" },
210
269
  target_handle: { $ref: "#/$defs/handlePosition" },
@@ -241,11 +300,25 @@ var agentic_v0_1_default = {
241
300
  },
242
301
  step: {
243
302
  type: "object",
244
- required: ["from", "to"],
303
+ description: "A playback step: either a from/to pair (a message between two nodes) or a nodes list (nodes highlighted together), never both.",
245
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
+ ],
246
312
  properties: {
247
313
  from: { type: "string", description: "Source node id" },
248
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
+ },
249
322
  type: { $ref: "#/$defs/stepType" },
250
323
  label: { type: "string" },
251
324
  payload: { type: "string" },
@@ -275,8 +348,9 @@ var agentic_v0_1_default = {
275
348
  },
276
349
  size2d: {
277
350
  type: "array",
351
+ description: "[width, height], or [width] alone to let the node's height follow its content",
278
352
  items: { type: "number", minimum: 0 },
279
- minItems: 2,
353
+ minItems: 1,
280
354
  maxItems: 2
281
355
  },
282
356
  viewport: {
@@ -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 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 \"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 \"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 \"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,sBAAwB;AAAA,EACxB,YAA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"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,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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oB;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
@@ -50,12 +68,15 @@ interface AgenticEdgeMetadata {
50
68
  label_pos?: number;
51
69
  [key: string]: unknown;
52
70
  }
71
+ /** Which ends of an edge show an arrowhead. Defaults to `'end'` (arrow at the target). */
72
+ type AgenticEdgeArrows = 'none' | 'start' | 'end' | 'both';
53
73
  interface AgenticInlineEdge {
54
74
  to: string;
55
75
  type?: string;
56
76
  label?: string;
57
77
  condition?: string;
58
78
  animated?: boolean;
79
+ arrows?: AgenticEdgeArrows;
59
80
  path?: string;
60
81
  source_handle?: string;
61
82
  target_handle?: string;
@@ -68,14 +89,14 @@ interface AgenticEdge {
68
89
  label?: string;
69
90
  condition?: string;
70
91
  animated?: boolean;
92
+ arrows?: AgenticEdgeArrows;
71
93
  path?: string;
72
94
  source_handle?: string;
73
95
  target_handle?: string;
74
96
  metadata?: AgenticEdgeMetadata;
75
97
  }
76
- interface AgenticStep {
77
- from: string;
78
- to: string;
98
+ /** Fields shared by both step forms. */
99
+ interface AgenticStepDetail {
79
100
  type?: string;
80
101
  label?: string;
81
102
  payload?: string;
@@ -90,6 +111,21 @@ interface AgenticStep {
90
111
  position: 'left' | 'right' | 'over';
91
112
  };
92
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;
93
129
  interface AgenticScenario {
94
130
  name: string;
95
131
  description?: string;
@@ -105,7 +141,8 @@ interface AgenticLayout {
105
141
  direction?: 'TB' | 'LR' | 'BT' | 'RL';
106
142
  viewport?: [number, number, number];
107
143
  positions?: Record<string, [number, number]>;
108
- sizes?: Record<string, [number, number]>;
144
+ /** Node id → `[width, height]`, or `[width]` alone when the height follows the node's content. */
145
+ sizes?: Record<string, [number, number] | [number]>;
109
146
  node_styles?: Record<string, AgenticNodeStyle>;
110
147
  }
111
148
 
@@ -133,4 +170,4 @@ interface ValidationResult {
133
170
  */
134
171
  declare function validate(data: unknown): ValidationResult;
135
172
 
136
- export { type AgenticDiagram, type AgenticEdge, 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
@@ -50,12 +68,15 @@ interface AgenticEdgeMetadata {
50
68
  label_pos?: number;
51
69
  [key: string]: unknown;
52
70
  }
71
+ /** Which ends of an edge show an arrowhead. Defaults to `'end'` (arrow at the target). */
72
+ type AgenticEdgeArrows = 'none' | 'start' | 'end' | 'both';
53
73
  interface AgenticInlineEdge {
54
74
  to: string;
55
75
  type?: string;
56
76
  label?: string;
57
77
  condition?: string;
58
78
  animated?: boolean;
79
+ arrows?: AgenticEdgeArrows;
59
80
  path?: string;
60
81
  source_handle?: string;
61
82
  target_handle?: string;
@@ -68,14 +89,14 @@ interface AgenticEdge {
68
89
  label?: string;
69
90
  condition?: string;
70
91
  animated?: boolean;
92
+ arrows?: AgenticEdgeArrows;
71
93
  path?: string;
72
94
  source_handle?: string;
73
95
  target_handle?: string;
74
96
  metadata?: AgenticEdgeMetadata;
75
97
  }
76
- interface AgenticStep {
77
- from: string;
78
- to: string;
98
+ /** Fields shared by both step forms. */
99
+ interface AgenticStepDetail {
79
100
  type?: string;
80
101
  label?: string;
81
102
  payload?: string;
@@ -90,6 +111,21 @@ interface AgenticStep {
90
111
  position: 'left' | 'right' | 'over';
91
112
  };
92
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;
93
129
  interface AgenticScenario {
94
130
  name: string;
95
131
  description?: string;
@@ -105,7 +141,8 @@ interface AgenticLayout {
105
141
  direction?: 'TB' | 'LR' | 'BT' | 'RL';
106
142
  viewport?: [number, number, number];
107
143
  positions?: Record<string, [number, number]>;
108
- sizes?: Record<string, [number, number]>;
144
+ /** Node id → `[width, height]`, or `[width]` alone when the height follows the node's content. */
145
+ sizes?: Record<string, [number, number] | [number]>;
109
146
  node_styles?: Record<string, AgenticNodeStyle>;
110
147
  }
111
148
 
@@ -133,4 +170,4 @@ interface ValidationResult {
133
170
  */
134
171
  declare function validate(data: unknown): ValidationResult;
135
172
 
136
- export { type AgenticDiagram, type AgenticEdge, 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: { type: "string", description: "Parent diagram id for drill-down hierarchy" },
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: { type: "string", description: "Drill-down target diagram id or file path" },
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: ["default", "request", "response", "async", "streaming", "event", "error"]
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,16 +173,25 @@ 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 20 % along that side; '-t' suffix marks a target slot ('top-80-t')."
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: { 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." }
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
  },
191
+ edgeArrows: {
192
+ enum: ["none", "start", "end", "both"],
193
+ description: "Which ends of an edge show an arrowhead: none, start (source), end (target), or both. Defaults to 'end'."
194
+ },
144
195
  edge: {
145
196
  type: "object",
146
197
  required: ["from", "to"],
@@ -150,8 +201,12 @@ var agentic_v0_1_default = {
150
201
  to: { type: "string", description: "Target node id" },
151
202
  type: { $ref: "#/$defs/edgeType" },
152
203
  label: { type: "string" },
153
- condition: { type: "string", description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'" },
204
+ condition: {
205
+ type: "string",
206
+ description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'"
207
+ },
154
208
  animated: { type: "boolean", description: "Show animated flow on connection" },
209
+ arrows: { $ref: "#/$defs/edgeArrows" },
155
210
  path: { $ref: "#/$defs/pathType" },
156
211
  source_handle: { $ref: "#/$defs/handlePosition" },
157
212
  target_handle: { $ref: "#/$defs/handlePosition" },
@@ -167,8 +222,12 @@ var agentic_v0_1_default = {
167
222
  to: { type: "string", description: "Target node id" },
168
223
  type: { $ref: "#/$defs/edgeType" },
169
224
  label: { type: "string" },
170
- condition: { type: "string", description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'" },
225
+ condition: {
226
+ type: "string",
227
+ description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'"
228
+ },
171
229
  animated: { type: "boolean", description: "Show animated flow on connection" },
230
+ arrows: { $ref: "#/$defs/edgeArrows" },
172
231
  path: { $ref: "#/$defs/pathType" },
173
232
  source_handle: { $ref: "#/$defs/handlePosition" },
174
233
  target_handle: { $ref: "#/$defs/handlePosition" },
@@ -205,11 +264,25 @@ var agentic_v0_1_default = {
205
264
  },
206
265
  step: {
207
266
  type: "object",
208
- required: ["from", "to"],
267
+ description: "A playback step: either a from/to pair (a message between two nodes) or a nodes list (nodes highlighted together), never both.",
209
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
+ ],
210
276
  properties: {
211
277
  from: { type: "string", description: "Source node id" },
212
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
+ },
213
286
  type: { $ref: "#/$defs/stepType" },
214
287
  label: { type: "string" },
215
288
  payload: { type: "string" },
@@ -239,8 +312,9 @@ var agentic_v0_1_default = {
239
312
  },
240
313
  size2d: {
241
314
  type: "array",
315
+ description: "[width, height], or [width] alone to let the node's height follow its content",
242
316
  items: { type: "number", minimum: 0 },
243
- minItems: 2,
317
+ minItems: 1,
244
318
  maxItems: 2
245
319
  },
246
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 \"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 \"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 \"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,QAClG,SAAW,EAAE,MAAQ,UAAU,QAAU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AAC,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,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,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AAY,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":[]}
@@ -1,4 +1,4 @@
1
- agentic: "0.1"
1
+ agentic: '0.1'
2
2
 
3
3
  diagram:
4
4
  name: Guarded Multi-Agent Pipeline
@@ -1,4 +1,4 @@
1
- agentic: "0.1"
1
+ agentic: '0.1'
2
2
  diagram:
3
3
  name: Simple Support Bot
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticdiagrams/schema",
3
- "version": "0.1.4",
3
+ "version": "0.1.7",
4
4
  "description": "Agentic YAML Schema — spec, types, and validation for .agentic.yaml diagram files",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -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": { "type": "string", "description": "Parent diagram id for drill-down hierarchy" },
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", "tool", "component", "backend", "generic", "note",
52
- "system", "memory", "gateway", "skill", "channel", "waypoint",
53
- "router", "human", "trigger", "guardrail", "model", "aggregator",
54
- "observability", "group", "block", "image", "prompt", "user",
55
- "output", "knowledge_base", "environment", "text_label", "divider"
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": { "type": "string", "description": "Drill-down target diagram id or file path" },
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": ["default", "request", "response", "async", "streaming", "event", "error"]
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,16 +168,25 @@
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 20 % along that side; '-t' suffix marks a target slot ('top-80-t')."
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": { "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." }
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
  },
186
+ "edgeArrows": {
187
+ "enum": ["none", "start", "end", "both"],
188
+ "description": "Which ends of an edge show an arrowhead: none, start (source), end (target), or both. Defaults to 'end'."
189
+ },
115
190
  "edge": {
116
191
  "type": "object",
117
192
  "required": ["from", "to"],
@@ -121,8 +196,12 @@
121
196
  "to": { "type": "string", "description": "Target node id" },
122
197
  "type": { "$ref": "#/$defs/edgeType" },
123
198
  "label": { "type": "string" },
124
- "condition": { "type": "string", "description": "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'" },
199
+ "condition": {
200
+ "type": "string",
201
+ "description": "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'"
202
+ },
125
203
  "animated": { "type": "boolean", "description": "Show animated flow on connection" },
204
+ "arrows": { "$ref": "#/$defs/edgeArrows" },
126
205
  "path": { "$ref": "#/$defs/pathType" },
127
206
  "source_handle": { "$ref": "#/$defs/handlePosition" },
128
207
  "target_handle": { "$ref": "#/$defs/handlePosition" },
@@ -138,8 +217,12 @@
138
217
  "to": { "type": "string", "description": "Target node id" },
139
218
  "type": { "$ref": "#/$defs/edgeType" },
140
219
  "label": { "type": "string" },
141
- "condition": { "type": "string", "description": "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'" },
220
+ "condition": {
221
+ "type": "string",
222
+ "description": "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'"
223
+ },
142
224
  "animated": { "type": "boolean", "description": "Show animated flow on connection" },
225
+ "arrows": { "$ref": "#/$defs/edgeArrows" },
143
226
  "path": { "$ref": "#/$defs/pathType" },
144
227
  "source_handle": { "$ref": "#/$defs/handlePosition" },
145
228
  "target_handle": { "$ref": "#/$defs/handlePosition" },
@@ -176,11 +259,25 @@
176
259
  },
177
260
  "step": {
178
261
  "type": "object",
179
- "required": ["from", "to"],
262
+ "description": "A playback step: either a from/to pair (a message between two nodes) or a nodes list (nodes highlighted together), never both.",
180
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
+ ],
181
271
  "properties": {
182
272
  "from": { "type": "string", "description": "Source node id" },
183
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
+ },
184
281
  "type": { "$ref": "#/$defs/stepType" },
185
282
  "label": { "type": "string" },
186
283
  "payload": { "type": "string" },
@@ -210,8 +307,9 @@
210
307
  },
211
308
  "size2d": {
212
309
  "type": "array",
310
+ "description": "[width, height], or [width] alone to let the node's height follow its content",
213
311
  "items": { "type": "number", "minimum": 0 },
214
- "minItems": 2,
312
+ "minItems": 1,
215
313
  "maxItems": 2
216
314
  },
217
315
  "viewport": {