@agenticdiagrams/schema 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,118 @@
1
+ /**
2
+ * TypeScript types matching the agentic YAML spec v0.1.
3
+ * These represent the parsed YAML structure, not any editor-specific model.
4
+ */
5
+ interface AgenticYaml {
6
+ agentic: '0.1';
7
+ diagram?: AgenticDiagram;
8
+ nodes?: Record<string, AgenticNode>;
9
+ edges?: AgenticEdge[];
10
+ scenarios?: Record<string, AgenticScenario>;
11
+ layout?: AgenticLayout;
12
+ }
13
+ interface AgenticDiagram {
14
+ name?: string;
15
+ description?: string;
16
+ type?: 'system' | 'component';
17
+ active_scenario?: string;
18
+ parent_diagram?: string;
19
+ created?: string;
20
+ updated?: string;
21
+ }
22
+ interface AgenticNode {
23
+ type: string;
24
+ label?: string;
25
+ sub_title?: string;
26
+ description?: string;
27
+ sub_type?: string;
28
+ url?: string;
29
+ group?: string;
30
+ linked_diagram?: string;
31
+ is_looping?: boolean;
32
+ auth?: string;
33
+ auth_detail?: string;
34
+ provider?: string;
35
+ content?: string;
36
+ example_response?: string;
37
+ edges?: AgenticInlineEdge[];
38
+ }
39
+ interface AgenticInlineEdge {
40
+ to: string;
41
+ type?: string;
42
+ label?: string;
43
+ animated?: boolean;
44
+ path?: string;
45
+ source_handle?: string;
46
+ target_handle?: string;
47
+ }
48
+ interface AgenticEdge {
49
+ from: string;
50
+ to: string;
51
+ type?: string;
52
+ label?: string;
53
+ animated?: boolean;
54
+ path?: string;
55
+ source_handle?: string;
56
+ target_handle?: string;
57
+ }
58
+ interface AgenticStep {
59
+ from: string;
60
+ to: string;
61
+ type?: string;
62
+ label?: string;
63
+ payload?: string;
64
+ duration?: number;
65
+ fragment?: {
66
+ type: 'alt' | 'opt' | 'loop' | 'par';
67
+ label?: string;
68
+ position: 'start' | 'else' | 'end';
69
+ };
70
+ note?: {
71
+ text: string;
72
+ position: 'left' | 'right' | 'over';
73
+ };
74
+ }
75
+ interface AgenticScenario {
76
+ name: string;
77
+ description?: string;
78
+ steps?: AgenticStep[];
79
+ }
80
+ interface AgenticNodeStyle {
81
+ borderless?: boolean;
82
+ icon_url?: string;
83
+ icon_layout?: string;
84
+ image_url?: string;
85
+ }
86
+ interface AgenticLayout {
87
+ direction?: 'TB' | 'LR' | 'BT' | 'RL';
88
+ viewport?: [number, number, number];
89
+ positions?: Record<string, [number, number]>;
90
+ sizes?: Record<string, [number, number]>;
91
+ node_styles?: Record<string, AgenticNodeStyle>;
92
+ }
93
+
94
+ interface ValidationResult {
95
+ valid: boolean;
96
+ errors: string[];
97
+ }
98
+ /**
99
+ * Validate a parsed YAML object against the agentic schema v0.1.
100
+ *
101
+ * This validates structure only — it does not parse YAML strings.
102
+ * Use your preferred YAML parser (js-yaml, yaml, etc.) first.
103
+ *
104
+ * @example
105
+ * ```ts
106
+ * import * as yaml from 'js-yaml';
107
+ * import { validate } from '@agenticdiagrams/schema';
108
+ *
109
+ * const doc = yaml.load(yamlString);
110
+ * const result = validate(doc);
111
+ * if (!result.valid) {
112
+ * console.error(result.errors);
113
+ * }
114
+ * ```
115
+ */
116
+ declare function validate(data: unknown): ValidationResult;
117
+
118
+ export { type AgenticDiagram, type AgenticEdge, type AgenticInlineEdge, type AgenticLayout, type AgenticNode, type AgenticNodeStyle, type AgenticScenario, type AgenticStep, type AgenticYaml, type ValidationResult, validate };
package/dist/index.js ADDED
@@ -0,0 +1,290 @@
1
+ // src/validate.ts
2
+ import Ajv2020 from "ajv/dist/2020.js";
3
+ import addFormats from "ajv-formats";
4
+
5
+ // schema/agentic.v0.1.json
6
+ var agentic_v0_1_default = {
7
+ $schema: "https://json-schema.org/draft/2020-12/schema",
8
+ $id: "https://agenticdiagrams.com/schemas/agentic/0.1.json",
9
+ title: "Agentic Diagram",
10
+ description: "Schema for .agentic.yaml diagram files (spec v0.1)",
11
+ type: "object",
12
+ required: ["agentic"],
13
+ additionalProperties: false,
14
+ properties: {
15
+ agentic: {
16
+ type: "string",
17
+ const: "0.1",
18
+ description: "Spec version"
19
+ },
20
+ diagram: { $ref: "#/$defs/diagram" },
21
+ nodes: {
22
+ type: "object",
23
+ description: "Node definitions keyed by stable id",
24
+ additionalProperties: { $ref: "#/$defs/node" }
25
+ },
26
+ edges: {
27
+ type: "array",
28
+ description: "Connections between nodes (type defaults to request)",
29
+ items: { $ref: "#/$defs/edge" }
30
+ },
31
+ scenarios: {
32
+ type: "object",
33
+ description: "Flow definitions keyed by id",
34
+ additionalProperties: { $ref: "#/$defs/scenario" }
35
+ },
36
+ layout: { $ref: "#/$defs/layout" }
37
+ },
38
+ $defs: {
39
+ diagram: {
40
+ type: "object",
41
+ description: "Diagram metadata. All fields optional, name defaults to Untitled",
42
+ additionalProperties: false,
43
+ properties: {
44
+ name: { type: "string", default: "Untitled" },
45
+ description: { type: "string" },
46
+ type: { type: "string", enum: ["system", "component"] },
47
+ active_scenario: { type: "string" },
48
+ parent_diagram: { type: "string", description: "Parent diagram id for drill-down hierarchy" },
49
+ created: { type: "string", format: "date-time" },
50
+ updated: { type: "string", format: "date-time" }
51
+ }
52
+ },
53
+ nodeType: {
54
+ type: "string",
55
+ enum: [
56
+ "agent",
57
+ "tool",
58
+ "component",
59
+ "backend",
60
+ "generic",
61
+ "note",
62
+ "system",
63
+ "memory",
64
+ "gateway",
65
+ "skill",
66
+ "channel",
67
+ "waypoint",
68
+ "router",
69
+ "human",
70
+ "trigger",
71
+ "guardrail",
72
+ "model",
73
+ "aggregator",
74
+ "observability",
75
+ "group",
76
+ "block",
77
+ "image",
78
+ "prompt",
79
+ "user",
80
+ "output",
81
+ "knowledge_base",
82
+ "environment",
83
+ "text_label",
84
+ "divider"
85
+ ]
86
+ },
87
+ node: {
88
+ type: "object",
89
+ description: "Node definition. Label defaults to the node id when omitted",
90
+ required: ["type"],
91
+ additionalProperties: false,
92
+ properties: {
93
+ type: { $ref: "#/$defs/nodeType" },
94
+ label: { type: "string", description: "Display name (defaults to node id)" },
95
+ sub_title: { type: "string", description: "Secondary display text below label" },
96
+ description: { type: "string" },
97
+ sub_type: { type: "string" },
98
+ url: { type: "string", format: "uri" },
99
+ group: { type: "string", description: "Parent group node id" },
100
+ linked_diagram: { type: "string", description: "Drill-down target diagram id or file path" },
101
+ is_looping: { type: "boolean" },
102
+ auth: { type: "string" },
103
+ auth_detail: { type: "string" },
104
+ provider: { type: "string" },
105
+ content: { type: "string" },
106
+ example_response: { type: "string" },
107
+ edges: {
108
+ type: "array",
109
+ description: "Inline edge definitions (from is inferred as this node)",
110
+ items: { $ref: "#/$defs/inlineEdge" }
111
+ }
112
+ }
113
+ },
114
+ edgeType: {
115
+ type: "string",
116
+ description: "Edge semantic type. Defaults to request when omitted",
117
+ enum: ["default", "request", "response", "async", "streaming", "event", "error"]
118
+ },
119
+ pathType: {
120
+ type: "string",
121
+ enum: ["bezier", "straight", "step", "smooth_step", "simple_bezier"]
122
+ },
123
+ handlePosition: {
124
+ type: "string",
125
+ enum: ["top", "right", "bottom", "left"],
126
+ description: "Which side of the node the edge connects to"
127
+ },
128
+ edge: {
129
+ type: "object",
130
+ required: ["from", "to"],
131
+ additionalProperties: false,
132
+ properties: {
133
+ from: { type: "string", description: "Source node id" },
134
+ to: { type: "string", description: "Target node id" },
135
+ type: { $ref: "#/$defs/edgeType" },
136
+ label: { type: "string" },
137
+ animated: { type: "boolean", description: "Show animated flow on connection" },
138
+ path: { $ref: "#/$defs/pathType" },
139
+ source_handle: { $ref: "#/$defs/handlePosition" },
140
+ target_handle: { $ref: "#/$defs/handlePosition" }
141
+ }
142
+ },
143
+ inlineEdge: {
144
+ type: "object",
145
+ description: "Edge defined on a node (from is inferred as the parent node id)",
146
+ required: ["to"],
147
+ additionalProperties: false,
148
+ properties: {
149
+ to: { type: "string", description: "Target node id" },
150
+ type: { $ref: "#/$defs/edgeType" },
151
+ label: { type: "string" },
152
+ animated: { type: "boolean", description: "Show animated flow on connection" },
153
+ path: { $ref: "#/$defs/pathType" },
154
+ source_handle: { $ref: "#/$defs/handlePosition" },
155
+ target_handle: { $ref: "#/$defs/handlePosition" }
156
+ }
157
+ },
158
+ stepType: {
159
+ type: "string",
160
+ description: "Step semantic type. Defaults to call when omitted",
161
+ enum: ["call", "return", "async", "event", "error"]
162
+ },
163
+ fragmentType: {
164
+ type: "string",
165
+ enum: ["alt", "opt", "loop", "par"]
166
+ },
167
+ fragment: {
168
+ type: "object",
169
+ required: ["type", "position"],
170
+ additionalProperties: false,
171
+ properties: {
172
+ type: { $ref: "#/$defs/fragmentType" },
173
+ label: { type: "string" },
174
+ position: { type: "string", enum: ["start", "else", "end"] }
175
+ }
176
+ },
177
+ note: {
178
+ type: "object",
179
+ required: ["text", "position"],
180
+ additionalProperties: false,
181
+ properties: {
182
+ text: { type: "string" },
183
+ position: { type: "string", enum: ["left", "right", "over"] }
184
+ }
185
+ },
186
+ step: {
187
+ type: "object",
188
+ required: ["from", "to"],
189
+ additionalProperties: false,
190
+ properties: {
191
+ from: { type: "string", description: "Source node id" },
192
+ to: { type: "string", description: "Target node id" },
193
+ type: { $ref: "#/$defs/stepType" },
194
+ label: { type: "string" },
195
+ payload: { type: "string" },
196
+ duration: { type: "number", minimum: 0 },
197
+ fragment: { $ref: "#/$defs/fragment" },
198
+ note: { $ref: "#/$defs/note" }
199
+ }
200
+ },
201
+ scenario: {
202
+ type: "object",
203
+ required: ["name"],
204
+ additionalProperties: false,
205
+ properties: {
206
+ name: { type: "string" },
207
+ description: { type: "string" },
208
+ steps: {
209
+ type: "array",
210
+ items: { $ref: "#/$defs/step" }
211
+ }
212
+ }
213
+ },
214
+ point2d: {
215
+ type: "array",
216
+ items: { type: "number" },
217
+ minItems: 2,
218
+ maxItems: 2
219
+ },
220
+ size2d: {
221
+ type: "array",
222
+ items: { type: "number", minimum: 0 },
223
+ minItems: 2,
224
+ maxItems: 2
225
+ },
226
+ viewport: {
227
+ type: "array",
228
+ items: { type: "number" },
229
+ minItems: 3,
230
+ maxItems: 3,
231
+ description: "[x, y, zoom]"
232
+ },
233
+ nodeStyle: {
234
+ type: "object",
235
+ additionalProperties: false,
236
+ properties: {
237
+ borderless: { type: "boolean" },
238
+ icon_url: { type: "string", format: "uri" },
239
+ icon_layout: { type: "string", enum: ["left", "right", "top", "bottom"] },
240
+ image_url: { type: "string", format: "uri" }
241
+ }
242
+ },
243
+ direction: {
244
+ type: "string",
245
+ description: "Auto-layout flow direction. Defaults to TB",
246
+ enum: ["TB", "LR", "BT", "RL"]
247
+ },
248
+ layout: {
249
+ type: "object",
250
+ additionalProperties: false,
251
+ properties: {
252
+ direction: { $ref: "#/$defs/direction" },
253
+ viewport: { $ref: "#/$defs/viewport" },
254
+ positions: {
255
+ type: "object",
256
+ additionalProperties: { $ref: "#/$defs/point2d" }
257
+ },
258
+ sizes: {
259
+ type: "object",
260
+ additionalProperties: { $ref: "#/$defs/size2d" }
261
+ },
262
+ node_styles: {
263
+ type: "object",
264
+ additionalProperties: { $ref: "#/$defs/nodeStyle" }
265
+ }
266
+ }
267
+ }
268
+ }
269
+ };
270
+
271
+ // src/validate.ts
272
+ var ajv = new Ajv2020({ allErrors: true });
273
+ addFormats(ajv);
274
+ var compiledValidate = ajv.compile(agentic_v0_1_default);
275
+ function validate(data) {
276
+ const valid = compiledValidate(data);
277
+ if (valid) {
278
+ return { valid: true, errors: [] };
279
+ }
280
+ const errors = (compiledValidate.errors ?? []).map((err) => {
281
+ const path = err.instancePath || "/";
282
+ const message = err.message || "unknown error";
283
+ return `${path}: ${message}`;
284
+ });
285
+ return { valid: false, errors };
286
+ }
287
+ export {
288
+ validate
289
+ };
290
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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 \"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 \"enum\": [\"top\", \"right\", \"bottom\", \"left\"],\n \"description\": \"Which side of the node the edge connects to\"\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 \"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 }\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 \"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 }\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,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O;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":[]}
@@ -0,0 +1,201 @@
1
+ agentic: "0.1"
2
+
3
+ diagram:
4
+ name: Kitchen Manager Agent
5
+ description: Multi-protocol agentic system with inventory tracking and recipe lookup
6
+ active_scenario: dinner-prep
7
+
8
+ nodes:
9
+ chef:
10
+ type: human
11
+ label: Head Chef
12
+ edges:
13
+ - to: orchestrator
14
+ type: event
15
+ label: Menu request
16
+ source_handle: bottom
17
+ target_handle: top
18
+
19
+ orchestrator:
20
+ type: agent
21
+ label: Kitchen Manager
22
+ edges:
23
+ - to: inventory-agent
24
+ label: Delegate inventory check
25
+ source_handle: bottom
26
+ target_handle: top
27
+ - to: recipe-agent
28
+ source_handle: bottom
29
+ target_handle: top
30
+ - to: kitchen-model
31
+ source_handle: right
32
+ target_handle: left
33
+ - to: custom-timer
34
+ type: async
35
+ source_handle: bottom
36
+ target_handle: top
37
+
38
+ inventory-agent:
39
+ type: agent
40
+ label: Inventory Tracker
41
+ is_looping: true
42
+ edges:
43
+ - to: mcp-pantry
44
+ - to: mcp-inventory-db
45
+
46
+ recipe-agent:
47
+ type: agent
48
+ label: Recipe Finder
49
+ edges:
50
+ - to: recipe-kb
51
+
52
+ kitchen-model:
53
+ type: model
54
+ sub_type: llm
55
+ label: GPT-4o
56
+ provider: OpenAI
57
+
58
+ mcp-pantry:
59
+ type: tool
60
+ sub_type: mcp
61
+ label: Pantry MCP Server
62
+
63
+ mcp-inventory-db:
64
+ type: tool
65
+ sub_type: mcp
66
+ label: Inventory Database
67
+
68
+ custom-timer:
69
+ type: tool
70
+ sub_type: custom
71
+ label: Kitchen Timer
72
+
73
+ recipe-kb:
74
+ type: knowledge_base
75
+ sub_type: documents
76
+ label: Recipe Collection
77
+
78
+ scenarios:
79
+ dinner-prep:
80
+ name: Dinner Preparation Flow
81
+ description: Chef requests dinner suggestions, system checks inventory and finds recipes
82
+ steps:
83
+ - from: chef
84
+ to: orchestrator
85
+ label: What can we cook tonight?
86
+ payload: '{"request": "dinner_suggestions", "guests": 4}'
87
+
88
+ - from: orchestrator
89
+ to: kitchen-model
90
+ label: Plan approach
91
+
92
+ - from: kitchen-model
93
+ to: orchestrator
94
+ type: return
95
+ label: Check inventory then find recipes
96
+
97
+ - from: orchestrator
98
+ to: inventory-agent
99
+ label: Check available ingredients
100
+ fragment:
101
+ type: par
102
+ label: Parallel lookup
103
+ position: start
104
+
105
+ - from: inventory-agent
106
+ to: mcp-pantry
107
+ label: Query pantry
108
+
109
+ - from: mcp-pantry
110
+ to: inventory-agent
111
+ type: return
112
+ label: Pantry contents
113
+
114
+ - from: inventory-agent
115
+ to: mcp-inventory-db
116
+ label: Query fridge & freezer
117
+
118
+ - from: mcp-inventory-db
119
+ to: inventory-agent
120
+ type: return
121
+ label: Fridge stock
122
+
123
+ - from: inventory-agent
124
+ to: orchestrator
125
+ type: return
126
+ label: Full ingredient list
127
+ payload: '{"ingredients": ["pasta", "tomatoes", "basil", "chicken", "cream"]}'
128
+
129
+ - from: orchestrator
130
+ to: recipe-agent
131
+ label: Find matching recipes
132
+ fragment:
133
+ type: par
134
+ position: end
135
+
136
+ - from: recipe-agent
137
+ to: recipe-kb
138
+ label: Search recipes by ingredients
139
+
140
+ - from: recipe-kb
141
+ to: recipe-agent
142
+ type: return
143
+ label: Matching recipes
144
+
145
+ - from: recipe-agent
146
+ to: orchestrator
147
+ type: return
148
+ label: Recipe suggestions
149
+ payload: '{"recipes": ["Chicken Alfredo", "Pasta Pomodoro", "Caprese Chicken"]}'
150
+
151
+ - from: orchestrator
152
+ to: chef
153
+ type: return
154
+ label: Tonight's menu options
155
+
156
+ low-stock:
157
+ name: Low Stock Alert
158
+ description: Inventory agent detects low stock and alerts the chef
159
+ steps:
160
+ - from: inventory-agent
161
+ to: mcp-inventory-db
162
+ label: Periodic stock check
163
+ fragment:
164
+ type: loop
165
+ label: Every 30 minutes
166
+ position: start
167
+
168
+ - from: mcp-inventory-db
169
+ to: inventory-agent
170
+ type: return
171
+ label: Current levels
172
+
173
+ - from: inventory-agent
174
+ to: orchestrator
175
+ type: event
176
+ label: Low stock warning
177
+ payload: '{"item": "tomatoes", "remaining": 2, "threshold": 5}'
178
+ fragment:
179
+ type: loop
180
+ position: end
181
+
182
+ - from: orchestrator
183
+ to: chef
184
+ type: event
185
+ label: Restock needed
186
+ note:
187
+ text: Only alerts if stock below threshold
188
+ position: right
189
+
190
+ layout:
191
+ viewport: [300, -50, 1.2]
192
+ positions:
193
+ chef: [350, -200]
194
+ orchestrator: [350, 0]
195
+ inventory-agent: [100, 200]
196
+ recipe-agent: [600, 200]
197
+ kitchen-model: [700, 0]
198
+ mcp-pantry: [0, 400]
199
+ mcp-inventory-db: [200, 400]
200
+ custom-timer: [350, 400]
201
+ recipe-kb: [600, 400]