{
  "build": "miscsubjects",
  "ts": "2026-07-22T23:04:45.612Z",
  "note": "Whole-build ontology. Every capability is REST. GET this, then GET the feeds, and the entire build is operable.",
  "feeds": {
    "directory": "GET /api/directory  — the invocation table (D1); rows carry add/edit schema",
    "inventory": "GET /api/inventory  — every file/object with read/edit/delete URL+method",
    "dispatch": "POST /api/dispatch {key,body}  — run any directory row"
  },
  "directory_schema": {
    "store": "D1 table `directory` (one row = one invocable build capability)",
    "fields": {
      "key": "string · primary key · the invocation name",
      "type": "fn | http | agent | flow",
      "target": "fn: FN_MAP name · http: \"METHOD url\" (e.g. \"GET https://…/$1\") · agent: model id · flow: \"\" (content holds the DSL)",
      "auth": "http only: \"bearer:ENV_VAR\" | \"headers:{...}\" | \"query:k=$ENV\" | \"\"",
      "content": "fn/http: \"# docs\\n<arg template>\" · agent: the system prompt body · flow: the DSL",
      "includes": "agent only: comma-separated prompt_block keys (e.g. BLOCK_VOICE,BLOCK_ROUTING) composed before content at runtime",
      "category": "string tag",
      "allowed_categories": "csv of categories, or \"*\"",
      "seq": "int (sort)",
      "enabled": "1|0",
      "planner_visible": "1|0",
      "planner_rank": "int",
      "input_schema": "optional JSON string",
      "examples": "optional JSON string",
      "row_num": "int · computed · 1-based position in the canonical directory list (stable for a given ordering)"
    },
    "rest": {
      "list": "GET /api/directory[?type=agent|http|fn|flow][&row_num=N][&format=widgets] -> {count, rows[]}; format=widgets returns HTML cards; row_num returns the Nth row",
      "read": "GET /api/directory/<key>[?format=widgets] -> the row with row_num; format=widgets returns an HTML card",
      "create": "POST /api/directory {key,type,...} (key+type required) -> 201",
      "update": "PUT /api/directory/<key> {type,...} (full upsert)",
      "patch": "PATCH /api/directory/<key> {field:value,...} (partial; e.g. {\"content\":\"...\"})",
      "delete": "DELETE /api/directory/<key>"
    },
    "invoke": "POST /api/dispatch {key, body, actor?} -> runs the row and returns its result"
  },
  "routes": [
    {
      "group": "kernel",
      "route": "POST /api/dispatch",
      "note": "run any directory row {key,body,actor?}"
    },
    {
      "group": "kernel",
      "route": "POST /api/turn",
      "note": "inbound message -> ROUTER"
    },
    {
      "group": "kernel",
      "route": "POST /blooio",
      "note": "iMessage webhook (Blooio)"
    },
    {
      "group": "kernel",
      "route": "GET|POST /api/mcp",
      "note": "directory exposed as MCP tools"
    },
    {
      "group": "directory",
      "route": "GET /api/directory[?type=agent|http|fn|flow]",
      "note": "list rows + schema"
    },
    {
      "group": "directory",
      "route": "POST /api/directory {key,type,...}",
      "note": "create a row"
    },
    {
      "group": "directory",
      "route": "GET|PUT|PATCH|DELETE /api/directory/:key",
      "note": "read/update/patch/delete one row (+ _rest, _schema)"
    },
    {
      "group": "directory",
      "route": "GET /api/directory/categories | /api/directory/search",
      "note": "taxonomy + search"
    },
    {
      "group": "assets",
      "route": "GET /api/inventory[?kind=file,r2,kv,directory,page,article]",
      "note": "every file/object with read/edit/delete"
    },
    {
      "group": "assets",
      "route": "GET|PUT|DELETE /api/file/*",
      "note": "repo files (reads/writes/commits to GitHub main)"
    },
    {
      "group": "assets",
      "route": "GET|PUT|DELETE /api/r2/*",
      "note": "R2 objects"
    },
    {
      "group": "assets",
      "route": "GET|PUT|DELETE /api/kv",
      "note": "KV pairs"
    },
    {
      "group": "assets",
      "route": "GET|PUT|PATCH|DELETE /api/short/:id",
      "note": "short links"
    },
    {
      "group": "assets",
      "route": "GET|POST /api/store/*",
      "note": "storage worker (bound, reference sprawl)"
    },
    {
      "group": "assets",
      "route": "ANY /api/settings/:key",
      "note": "settings rows"
    },
    {
      "group": "content",
      "route": "ANY /api/articles/* | /api/content/* | /api/pages/*",
      "note": "content CRUD"
    },
    {
      "group": "content",
      "route": "GET|POST /api/presets | /api/relationships | /api/plan | /api/panel | /api/studio",
      "note": ""
    },
    {
      "group": "content",
      "route": "GET /api/models | ANY /api/providers/* | ANY /api/runs/* /api/run/*",
      "note": ""
    },
    {
      "group": "agents",
      "route": "POST /api/council | /api/proactive | /grok/audit",
      "note": "multi-model agents"
    },
    {
      "group": "agents",
      "route": "ANY /api/durable/*",
      "note": "durable resident agents (AgentDO)"
    },
    {
      "group": "handoff",
      "route": "GET /api/model-lane | GET /api/relay?social=1",
      "note": "public model execution lane and public proof chain; unified backend handoff is owner-only"
    },
    {
      "group": "ingest",
      "route": "POST /api/cc_log | /api/grok_log | /api/kimi_log | /api/agent_log | /api/agent_ledger_sync | /api/agent_audit | /api/cc_audit | /api/event_log_ingest | /api/snapshot_ingest | /api/deliver",
      "note": "turn-log + ledger ingest + delivery"
    },
    {
      "group": "site",
      "route": "GET /",
      "note": "homepage (public/index.html)"
    },
    {
      "group": "site",
      "route": "GET /:slug",
      "note": "dynamic page (pages table)"
    },
    {
      "group": "site",
      "route": "GET /a/:slug",
      "note": "article"
    },
    {
      "group": "site",
      "route": "GET /content/:slug | GET /s/:slug | GET /img/*",
      "note": "content / short link / R2 image"
    },
    {
      "group": "admin",
      "route": "GET /admin/*",
      "note": "HTML cockpit: directory, ledger, manual, map, assets, content, pages, trace, run, cc, sync-sheets, bind-secrets"
    }
  ],
  "bindings": {
    "DB": true,
    "LEDGER": true,
    "KV": true,
    "R2": true,
    "AI": true,
    "DIRECTORY_DO": true,
    "TASKS": true,
    "STORE": true,
    "GITHUB_TOKEN": true,
    "TERMINAL_KEY": true,
    "STORE_KEY": true,
    "CLOUDFLARE_API_TOKEN": true
  },
  "counts": {
    "directory": 875
  }
}