{
  "schemaVersion": 1,
  "generatedAt": "2026-08-12T23:36:38.933Z",
  "generationKey": "801eabadab5d41bda487c653a202e3452c098fcd61d7797b126ca67067558524",
  "metadataPayloadSha256": "e4edd68bf2ace0a10d51a3ecd0cbdbfff7f2ebf40e78356d07167260b3eedb1f",
  "diagram": {
    "id": "ai-template-generation-d3f7aea7",
    "title": "AI template generation",
    "description": "AI template generation traces the ordered service interactions, decisions, and persisted outcomes for this workflow.",
    "status": "archived",
    "canonicalAppearanceKey": "md:docs/architecture/workspace/08-capture-templates.md#5"
  },
  "aliases": [],
  "concepts": [
    "Capture templates"
  ],
  "keywords": [
    "MCP agent",
    "generateTemplateAction (templates-ai.ts)",
    "apply_template tool (template.ts)",
    "storage.applyTemplate (adapter)",
    "Template engine (parser.ts + apply.ts)",
    "write (templates-ai.ts:130)",
    "apply_template with template, path, vars",
    "parse into tokens (parser.ts:53)",
    "createNote at destination path (writes.ts:475)",
    "Template editor UI",
    "AI gateway (smart tier)",
    "template body, token usage recorded (templates-ai.ts:106)",
    "upsert note at with _template true (templates-ai.ts:145)",
    "storage.applyTemplate(templateId, path + vars) (template.ts:53)",
    "applyTemplate(source, vars, now)",
    ".eli/templates",
    ".eli/templates/id.md",
    "vault/.eli/templates/typeName.md",
    ".eli/templates/typeName.md",
    "date/var/prompt",
    "literal/date/var/prompt",
    "storage",
    "resolveAiKey - fail fast with no AI key configured (templates-ai.ts:85)",
    "ok, path, body, modelId - row inserted optimistically (editor.tsx:115)",
    "read - missing gives Template not found isError (writes.ts:456)",
    "Note"
  ],
  "mermaid": {
    "type": "sequence",
    "sourceSha256": "d3f7aea7e2717cc3c0f15b6af7ca4308569933a8921ced6698accd7b144b59d2"
  },
  "provenance": [
    {
      "appearanceKey": "md:docs/architecture/workspace/08-capture-templates.md#5",
      "surface": "markdown",
      "sourcePath": "docs/architecture/workspace/08-capture-templates.md",
      "line": 259,
      "heading": "Data flow — detailed"
    }
  ],
  "embeddedMetadata": [
    {
      "sourcePath": "docs/architecture/workspace/08-capture-templates.md",
      "heading": "Data flow — detailed"
    }
  ],
  "generation": {
    "application": {
      "name": "eli-ai",
      "version": "0.1.0"
    },
    "environment": {
      "node": "v26.3.1",
      "yarn": "4.17.1",
      "platform": "linux",
      "architecture": "x64",
      "containerImage": "playwright:v1.62.1-noble@sha256:c091b21d9fae78c76e85cd4356431e9b018402f172a214fc7d7a5e9a7e29d8ac+node:26.3.1-bookworm-slim@sha256:209558c3e5e40e8adff68959d3c2ba7cd73723e716d89196878a0c362fa1e109"
    },
    "packages": {
      "mermaid": "11.16.0",
      "mermaidCli": "11.16.0",
      "playwright": "1.62.1",
      "playwrightCore": "1.62.1",
      "puppeteer": "25.6.0",
      "puppeteerCore": "25.6.0"
    },
    "renderer": {
      "mermaidConfigSha256": "68c10966fe84406ee626034d58bfabd555df9f65f691204b7c46db24038da101",
      "themeCssSha256": "c80287a78d80ad63d27bd5ca348b2ef9a7e2f44da289e436be6484ea28a1b033",
      "browser": {
        "name": "chromium",
        "revision": "1234",
        "version": "151.0.7922.34",
        "executableSha256": "0b20b130e7edd9dd51873be867761295fe0cfad490c2b9a64f95bd3cfc08fa71"
      },
      "font": {
        "family": "Eli Diagram Inter Variable",
        "fileSha256": "3100e775e8616cd2611beecfa23a4263d7037586789b43f035236a2e6fbd4c62",
        "licenseSha256": "3b0a5fca3d17942cde889069889dedbbbd075e9b599968c82a95f4d944e9b345"
      }
    },
    "adapterVersions": {
      "diagramGenerator": "2",
      "drawioFlowchart": "1",
      "drawioSequence": "1",
      "drawioState": "1",
      "drawioGantt": "1"
    }
  },
  "artifacts": {
    "mmd": "/diagrams/ai-template-generation-d3f7aea7/ai-template-generation-d3f7aea7.mmd",
    "svg": "/diagrams/ai-template-generation-d3f7aea7/ai-template-generation-d3f7aea7.svg",
    "png": "/diagrams/ai-template-generation-d3f7aea7/ai-template-generation-d3f7aea7.png",
    "drawio": "/diagrams/ai-template-generation-d3f7aea7/ai-template-generation-d3f7aea7.drawio",
    "json": "/diagrams/ai-template-generation-d3f7aea7/ai-template-generation-d3f7aea7.json"
  },
  "artifactSha256": {
    "mmd": "8917e6915128be7f7a604e08f540bd05d92f4d0c6d7e0dc8887168b26a4671ad",
    "svg": "0ba721cae0d46c0da41c299c7daf7252f3842b1e47c811785cb3233e65fb77e2",
    "png": "a8cc880619e35574bc1b2d7932dba27cd95e1faec5394908b9f19ce6f01c3c58",
    "drawio": "a83430aa1ab9b834a994cbe77f9fb84c7208db715ca69e545f6211df9892fc00"
  }
}
