@agenticdiagrams/schema 0.1.1 → 0.1.2

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/dist/index.cjs CHANGED
@@ -178,6 +178,7 @@ var agentic_v0_1_default = {
178
178
  to: { type: "string", description: "Target node id" },
179
179
  type: { $ref: "#/$defs/edgeType" },
180
180
  label: { type: "string" },
181
+ condition: { type: "string", description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'" },
181
182
  animated: { type: "boolean", description: "Show animated flow on connection" },
182
183
  path: { $ref: "#/$defs/pathType" },
183
184
  source_handle: { $ref: "#/$defs/handlePosition" },
@@ -193,6 +194,7 @@ var agentic_v0_1_default = {
193
194
  to: { type: "string", description: "Target node id" },
194
195
  type: { $ref: "#/$defs/edgeType" },
195
196
  label: { type: "string" },
197
+ condition: { type: "string", description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'" },
196
198
  animated: { type: "boolean", description: "Show animated flow on connection" },
197
199
  path: { $ref: "#/$defs/pathType" },
198
200
  source_handle: { $ref: "#/$defs/handlePosition" },
@@ -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 \"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;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;A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xD;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;;;AD9OA,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"]}
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 \"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 \"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 }\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 }\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,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,M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AE,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;;;ADhPA,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
@@ -44,6 +44,7 @@ interface AgenticInlineEdge {
44
44
  to: string;
45
45
  type?: string;
46
46
  label?: string;
47
+ condition?: string;
47
48
  animated?: boolean;
48
49
  path?: string;
49
50
  source_handle?: string;
@@ -54,6 +55,7 @@ interface AgenticEdge {
54
55
  to: string;
55
56
  type?: string;
56
57
  label?: string;
58
+ condition?: string;
57
59
  animated?: boolean;
58
60
  path?: string;
59
61
  source_handle?: string;
package/dist/index.d.ts CHANGED
@@ -44,6 +44,7 @@ interface AgenticInlineEdge {
44
44
  to: string;
45
45
  type?: string;
46
46
  label?: string;
47
+ condition?: string;
47
48
  animated?: boolean;
48
49
  path?: string;
49
50
  source_handle?: string;
@@ -54,6 +55,7 @@ interface AgenticEdge {
54
55
  to: string;
55
56
  type?: string;
56
57
  label?: string;
58
+ condition?: string;
57
59
  animated?: boolean;
58
60
  path?: string;
59
61
  source_handle?: string;
package/dist/index.js CHANGED
@@ -142,6 +142,7 @@ var agentic_v0_1_default = {
142
142
  to: { type: "string", description: "Target node id" },
143
143
  type: { $ref: "#/$defs/edgeType" },
144
144
  label: { type: "string" },
145
+ condition: { type: "string", description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'" },
145
146
  animated: { type: "boolean", description: "Show animated flow on connection" },
146
147
  path: { $ref: "#/$defs/pathType" },
147
148
  source_handle: { $ref: "#/$defs/handlePosition" },
@@ -157,6 +158,7 @@ var agentic_v0_1_default = {
157
158
  to: { type: "string", description: "Target node id" },
158
159
  type: { $ref: "#/$defs/edgeType" },
159
160
  label: { type: "string" },
161
+ condition: { type: "string", description: "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'" },
160
162
  animated: { type: "boolean", description: "Show animated flow on connection" },
161
163
  path: { $ref: "#/$defs/pathType" },
162
164
  source_handle: { $ref: "#/$defs/handlePosition" },
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 \"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,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;AA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M,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\": { \"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 \"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 \"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 }\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 }\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,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AAA,EAC5B,CAAC;AAED,SAAO,EAAE,OAAO,OAAO,OAAO;AAChC;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agenticdiagrams/schema",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
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",
@@ -113,6 +113,7 @@
113
113
  "to": { "type": "string", "description": "Target node id" },
114
114
  "type": { "$ref": "#/$defs/edgeType" },
115
115
  "label": { "type": "string" },
116
+ "condition": { "type": "string", "description": "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'" },
116
117
  "animated": { "type": "boolean", "description": "Show animated flow on connection" },
117
118
  "path": { "$ref": "#/$defs/pathType" },
118
119
  "source_handle": { "$ref": "#/$defs/handlePosition" },
@@ -128,6 +129,7 @@
128
129
  "to": { "type": "string", "description": "Target node id" },
129
130
  "type": { "$ref": "#/$defs/edgeType" },
130
131
  "label": { "type": "string" },
132
+ "condition": { "type": "string", "description": "Branch condition expression, e.g. 'approved', 'score > 0.8', 'default'" },
131
133
  "animated": { "type": "boolean", "description": "Show animated flow on connection" },
132
134
  "path": { "$ref": "#/$defs/pathType" },
133
135
  "source_handle": { "$ref": "#/$defs/handlePosition" },