skip to content
$worker

openwiki

v0.1.0

Source-grounded markdown wiki for any git repository — openwiki::* functions generate, search, and incrementally refresh categorized pages with pinned-commit line citations, and the engine serves a browser UI + JSON API under /openwiki.

Experimental

Published as experimental by its release pipeline. It installs and resolves like any other worker, but its interface may change without notice.

iiiverified
2 installs2 in 7d0 today
install
$iii worker add openwiki@next

exact versions are immutable; binary and bundle artifacts are digest-pinned.

agent-ready brief for v0.1.0
install + config + dependencies + readme + api reference, all in one place. fetch as agent-context.md for an llm to consume.
the same content rendered as discrete blocks below is exposed as a single markdown document at /workers/openwiki.md?version=next. paste it into an llm prompt or pipe it through curl from a worker.

install

install
$iii worker add openwiki@0.1.0

dependencies

readme

README.md

openwiki

OpenWiki browser UI

Builds and maintains a source-grounded, interlinked markdown wiki for a code repository, and serves a browser UI to read and search it. Point it at a git repo: an agent reads the source, plans a hierarchical index, writes one cited page per topic, and keeps the wiki current from git diffs on a per-wiki schedule. Pages persist in iii-state; the engine serves the UI and JSON API under /openwiki.

Install

iii worker add openwiki

This pulls state, cron, and llm-router transitively. Add a model provider through the console's onboarding (anthropic, openai, codex, ...) and pages are model-written; the provider credential lives in the llm-router config, never in this worker.

For the best tier, agent-orchestrated pages written by one sub-agent per page with line citations, add the harness stack as well:

iii worker add harness

harness transitively pulls session-manager, context-manager, shell (jailed git for clone/diff), and the model providers. openwiki degrades gracefully when a worker is absent:

Present Pages are
harness + a configured provider agent-orchestrated, line-cited (best)
llm-router only model-written from pre-selected files
neither heuristic, built from file headers, always works

Quickstart

Open the browser UI on the engine's HTTP port:

http://localhost:3111/openwiki

Or drive it from the CLI:

iii trigger openwiki::generate --json '{"repo_url":"https://github.com/owner/repo"}'
# -> { "wiki_id": "<wiki_id>", "status": "started" }

iii trigger openwiki::status --json '{"id":"<wiki_id>"}'    # poll until phase = ready
iii trigger openwiki::page   --json '{"id":"<wiki_id>","slug":"overview"}'
iii trigger openwiki::search --json '{"id":"<wiki_id>","q":"config"}'

openwiki::refresh { id } is incremental: it pulls the clone, diffs against the recorded commit, and regenerates only the pages whose source changed. openwiki::set-schedule { id, schedule } puts that refresh on a per-wiki cadence (off | 3h | 6h | 12h | daily | weekly | a cron string); a content-hash gate keeps an unchanged repo from churning the wiki.

The full function catalogue (generation, scoped source readers for writer sub-agents, cited Q&A via openwiki::ask, Mermaid diagrams, AGENTS.md export, lint) is one iii worker info openwiki away. HTTP triggers mirror the read/generate functions under /openwiki/api/*, generation progress streams live over SSE, and page citations deep-link to source at the pinned commit.

openwiki also registers openwiki::read-wiki-structure, openwiki::read-wiki-contents, and openwiki::ask-question, which the mcp worker advertises to any MCP client:

iii worker add mcp

How generation works

  1. Clone the repo (through the shell worker, with a local git fallback), inventory its files, and record the commit so citations deep-link to exact source.
  2. A lead agent explores the clone through openwiki's scoped readers (openwiki::src::read / src::list / src::grep) and plans a reading-ordered index. The model decides how many pages the repo needs and follows the repo's own docs index (llms.txt, a docs/ tree) when present.
  3. The lead spawns one writer sub-agent per page in parallel. Each writer reads its focused files and stores its finished page with openwiki::write-page; openwiki turns citations into pinned-commit source links and rejects a page that comes back too thin.
  4. Pages stream into the UI as each writer lands; the lead submits only the table of contents.

Configuration

  • Model: pick one in the browser UI's generate form (populated from the router's live catalog, grouped by provider), pass model to openwiki::generate, or set OPENWIKI_MODEL. Any model the router advertises works. Default claude-haiku-4-5-20251001.
  • refresh_default: the auto-refresh cadence new wikis start with (off by default; each wiki overrides it in the UI). Editable in the console like the other openwiki config, or seed it with OPENWIKI_REFRESH_DEFAULT.
  • OPENWIKI_DATA: wiki store and clone directory (default /tmp/openwiki-data). Must resolve inside the shell worker's fs.host_roots when git runs through shell.
  • OPENWIKI_MAX_PARALLEL: concurrent page writers (default 3).

License

Apache-2.0

api reference (json)

agent-api-reference.json
{
  "functions": [
    {
      "description": "Ask a question about a wiki; returns a cited answer. mode=fast (router) or deep (harness).",
      "metadata": {},
      "name": "openwiki::ask",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "file_answer": {
            "description": "File a good answer back into the wiki as a new page.",
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "mode": {
            "description": "fast = router retrieval; deep = harness multi-hop.",
            "enum": [
              "fast",
              "deep"
            ],
            "type": "string"
          },
          "q": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "q"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "answer": {
            "type": "string"
          },
          "citations": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "end_line": {
                  "type": "integer"
                },
                "note": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "start_line": {
                  "type": "integer"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "path"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "filed_slug": {
            "type": "string"
          }
        },
        "required": [
          "answer"
        ],
        "type": "object"
      }
    },
    {
      "description": "MCP: ask a question about a wiki; returns a cited answer.",
      "metadata": {
        "mcp": {
          "expose": true
        }
      },
      "name": "openwiki::ask-question",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "q": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "q"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "answer": {
            "type": "string"
          },
          "citations": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "end_line": {
                  "type": "integer"
                },
                "note": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "start_line": {
                  "type": "integer"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "path"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "filed_slug": {
            "type": "string"
          }
        },
        "required": [
          "answer"
        ],
        "type": "object"
      }
    },
    {
      "description": "Cron: refresh every wiki whose auto-refresh interval has elapsed.",
      "metadata": {},
      "name": "openwiki::cron::refresh-due",
      "request_schema": {
        "additionalProperties": true,
        "properties": {},
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "refreshed": {
            "type": "integer"
          }
        },
        "required": [
          "refreshed"
        ],
        "type": "object"
      }
    },
    {
      "description": "Delete a wiki and all its pages. Params: { id }.",
      "metadata": {},
      "name": "openwiki::delete",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "deleted"
        ],
        "type": "object"
      }
    },
    {
      "description": "Generate a Mermaid diagram (architecture|dataflow|deps) of a wiki.",
      "metadata": {},
      "name": "openwiki::diagram",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "architecture",
              "dataflow",
              "deps"
            ],
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string"
          },
          "mermaid": {
            "type": "string"
          }
        },
        "required": [
          "mermaid"
        ],
        "type": "object"
      }
    },
    {
      "description": "Build the AGENTS.md/CLAUDE.md pointer block for a wiki.",
      "metadata": {},
      "name": "openwiki::export-agents-md",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "base_url": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "targets": {
            "items": {
              "enum": [
                "AGENTS.md",
                "CLAUDE.md"
              ],
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "content": {
            "type": "string"
          },
          "targets": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "content"
        ],
        "type": "object"
      }
    },
    {
      "description": "Measurement: source bytes the agent read and page bytes produced for a generation.",
      "metadata": {},
      "name": "openwiki::gen-stats",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": true,
        "properties": {
          "output_bytes": {
            "type": "integer"
          },
          "page_count": {
            "type": "integer"
          }
        },
        "type": "object"
      }
    },
    {
      "description": "Start generating a source-grounded wiki for a git repository URL. Returns immediately with { wiki_id, status }; poll openwiki::status.",
      "metadata": {},
      "name": "openwiki::generate",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "model": {
            "description": "Optional LLM model id, routed via llm-router.",
            "type": "string"
          },
          "ref": {
            "description": "Optional branch/tag/commit to check out (default: default branch).",
            "type": "string"
          },
          "repo_url": {
            "description": "HTTPS git URL of a public repository.",
            "type": "string"
          },
          "steer": {
            "additionalProperties": true,
            "description": "Optional per-repo steering (repo_notes, explicit pages, caps). Mirrors openwiki.json.",
            "type": "object"
          }
        },
        "required": [
          "repo_url"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "status": {
            "type": "string"
          },
          "wiki_id": {
            "type": "string"
          }
        },
        "required": [
          "wiki_id",
          "status"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP POST /openwiki/api/wikis/:id/ask",
      "metadata": {},
      "name": "openwiki::http::ask",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP GET /openwiki/api/wikis/:id/diagram",
      "metadata": {},
      "name": "openwiki::http::diagram",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP GET /openwiki/api/wikis/:id/events (SSE live progress)",
      "metadata": {},
      "name": "openwiki::http::events",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP GET /openwiki/api/models",
      "metadata": {},
      "name": "openwiki::http::models",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP GET /openwiki/api/wikis/:id/pages/:slug",
      "metadata": {},
      "name": "openwiki::http::page-get",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP GET /openwiki/api/wikis/:id/pages",
      "metadata": {},
      "name": "openwiki::http::pages-list",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP POST /openwiki/api/wikis/:id/refresh",
      "metadata": {},
      "name": "openwiki::http::refresh",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP PUT /openwiki/api/wikis/:id/schedule",
      "metadata": {},
      "name": "openwiki::http::schedule-set",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP GET /openwiki/api/wikis/:id/search?q=",
      "metadata": {},
      "name": "openwiki::http::search",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP: serve the OpenWiki browser UI.",
      "metadata": {},
      "name": "openwiki::http::ui",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP DELETE /openwiki/api/wikis/:id",
      "metadata": {},
      "name": "openwiki::http::wiki-delete",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP GET /openwiki/api/wikis/:id",
      "metadata": {},
      "name": "openwiki::http::wiki-get",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP GET /openwiki/api/wikis/:id/status",
      "metadata": {},
      "name": "openwiki::http::wiki-status",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP POST /openwiki/api/wikis",
      "metadata": {},
      "name": "openwiki::http::wikis-create",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "HTTP GET /openwiki/api/wikis",
      "metadata": {},
      "name": "openwiki::http::wikis-list",
      "request_schema": {
        "additionalProperties": true,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "method": {
            "type": "string"
          },
          "path_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "query_params": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "body": {
            "type": "string"
          },
          "headers": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "status_code",
          "body"
        ],
        "type": "object"
      }
    },
    {
      "description": "Validate every page citation against the clone and flag thin pages.",
      "metadata": {},
      "name": "openwiki::lint",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "checked": {
            "type": "integer"
          },
          "issues": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "detail": {
                  "type": "string"
                },
                "kind": {
                  "enum": [
                    "broken-citation",
                    "orphan",
                    "missing-xref",
                    "stale",
                    "thin"
                  ],
                  "type": "string"
                },
                "slug": {
                  "type": "string"
                }
              },
              "required": [
                "slug",
                "kind"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "checked",
          "issues"
        ],
        "type": "object"
      }
    },
    {
      "description": "Models available via llm-router (for the UI's model picker), plus the configured default. Empty when no provider is configured.",
      "metadata": {},
      "name": "openwiki::models",
      "request_schema": {
        "additionalProperties": false,
        "properties": {},
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "default_model": {
            "type": "string"
          },
          "models": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string"
                },
                "provider": {
                  "type": "string"
                },
                "supports_structured_output": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "provider"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "models",
          "default_model"
        ],
        "type": "object"
      }
    },
    {
      "description": "Reload runtime config when the openwiki configuration entry changes.",
      "metadata": {},
      "name": "openwiki::on-config-change",
      "request_schema": {
        "additionalProperties": true,
        "properties": {},
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "reloaded": {
            "type": "boolean"
          }
        },
        "required": [
          "reloaded"
        ],
        "type": "object"
      }
    },
    {
      "description": "Internal: routes harness::turn-completed events to the active generation.",
      "metadata": {},
      "name": "openwiki::on-turn-completed",
      "request_schema": {
        "additionalProperties": true,
        "properties": {},
        "type": "object"
      },
      "response_schema": {
        "type": "null"
      }
    },
    {
      "description": "Internal: routes harness::turn-started events (sub-agent spawns) to the active generation.",
      "metadata": {},
      "name": "openwiki::on-turn-started",
      "request_schema": {
        "additionalProperties": true,
        "properties": {},
        "type": "object"
      },
      "response_schema": {
        "type": "null"
      }
    },
    {
      "description": "Get a single wiki page (markdown body + metadata). Params: { id, slug } (slug from openwiki::pages).",
      "metadata": {},
      "name": "openwiki::page",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "category": {
            "type": "string"
          },
          "citations": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "end_line": {
                  "type": "integer"
                },
                "note": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "start_line": {
                  "type": "integer"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "path"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "confidence": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string"
          },
          "generator": {
            "enum": [
              "harness",
              "router",
              "heuristic"
            ],
            "type": "string"
          },
          "last_updated": {
            "type": "string"
          },
          "markdown": {
            "type": "string"
          },
          "quality_issues": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "source_paths": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "current",
              "needs-review",
              "stale"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "slug",
          "markdown"
        ],
        "type": "object"
      }
    },
    {
      "description": "List all pages of a wiki. Params: { id }.",
      "metadata": {},
      "name": "openwiki::pages",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "pages": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "category": {
                  "type": "string"
                },
                "citations": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "end_line": {
                        "type": "integer"
                      },
                      "note": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string"
                      },
                      "start_line": {
                        "type": "integer"
                      },
                      "url": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "path"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "confidence": {
                  "enum": [
                    "low",
                    "medium",
                    "high"
                  ],
                  "type": "string"
                },
                "generator": {
                  "enum": [
                    "harness",
                    "router",
                    "heuristic"
                  ],
                  "type": "string"
                },
                "last_updated": {
                  "type": "string"
                },
                "quality_issues": {
                  "type": "integer"
                },
                "slug": {
                  "type": "string"
                },
                "source_paths": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "status": {
                  "enum": [
                    "current",
                    "needs-review",
                    "stale"
                  ],
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "slug",
                "title",
                "category"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "pages"
        ],
        "type": "object"
      }
    },
    {
      "description": "MCP: read one wiki page (markdown + metadata).",
      "metadata": {
        "mcp": {
          "expose": true
        }
      },
      "name": "openwiki::read-wiki-contents",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "category": {
            "type": "string"
          },
          "citations": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "end_line": {
                  "type": "integer"
                },
                "note": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "start_line": {
                  "type": "integer"
                },
                "url": {
                  "type": "string"
                }
              },
              "required": [
                "path"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "confidence": {
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "type": "string"
          },
          "generator": {
            "enum": [
              "harness",
              "router",
              "heuristic"
            ],
            "type": "string"
          },
          "last_updated": {
            "type": "string"
          },
          "markdown": {
            "type": "string"
          },
          "quality_issues": {
            "type": "integer"
          },
          "slug": {
            "type": "string"
          },
          "source_paths": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "current",
              "needs-review",
              "stale"
            ],
            "type": "string"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "slug",
          "markdown"
        ],
        "type": "object"
      }
    },
    {
      "description": "MCP: list a wiki's structure (categories + pages).",
      "metadata": {
        "mcp": {
          "expose": true
        }
      },
      "name": "openwiki::read-wiki-structure",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "categories": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "description": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "id"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "pages": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "category": {
                  "type": "string"
                },
                "slug": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "slug"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "repo": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          }
        },
        "required": [
          "pages"
        ],
        "type": "object"
      }
    },
    {
      "description": "Pull the repo and regenerate only the pages whose source changed (incremental).",
      "metadata": {},
      "name": "openwiki::refresh",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "changed": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "path": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "status",
                "path"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "pages_affected": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "refresh": {
            "enum": [
              "regenerating",
              "up_to_date",
              "in_progress",
              "error"
            ],
            "type": "string"
          },
          "wiki_id": {
            "type": "string"
          }
        },
        "required": [
          "wiki_id",
          "refresh"
        ],
        "type": "object"
      }
    },
    {
      "description": "Search pages of a wiki by keyword. Params: { id, q }.",
      "metadata": {},
      "name": "openwiki::search",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "q": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "q"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "results": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "category": {
                  "type": "string"
                },
                "matched": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "score": {
                  "type": "number"
                },
                "slug": {
                  "type": "string"
                },
                "snippet": {
                  "type": "string"
                },
                "source_paths": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "slug",
                "score"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "results"
        ],
        "type": "object"
      }
    },
    {
      "description": "Set a wiki auto-refresh cadence: off | 3h | 6h | 12h | daily | weekly | a cron string. Params: { id, schedule }.",
      "metadata": {},
      "name": "openwiki::set-schedule",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "schedule": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "schedule"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "ok": {
            "type": "boolean"
          },
          "schedule": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "schedule",
          "ok"
        ],
        "type": "object"
      }
    },
    {
      "description": "Search file contents in a wiki's cloned repo. Params: { id, pattern, max? }.",
      "metadata": {},
      "name": "openwiki::src::grep",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "max": {
            "type": "integer"
          },
          "pattern": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "pattern"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "matches": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "line": {
                  "type": "integer"
                },
                "path": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "path",
                "line",
                "text"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "matches"
        ],
        "type": "object"
      }
    },
    {
      "description": "List files (path, language, priority) in a wiki's cloned repo. Params: { id, dir? }.",
      "metadata": {},
      "name": "openwiki::src::list",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "dir": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "files": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "language": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "priority": {
                  "type": "integer"
                },
                "size": {
                  "type": "integer"
                }
              },
              "required": [
                "path"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "files"
        ],
        "type": "object"
      }
    },
    {
      "description": "Read a file (optional 1-indexed line window) from a wiki's cloned repo. Params: { id, path, from?, to? }.",
      "metadata": {},
      "name": "openwiki::src::read",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "from": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "to": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "path"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "content": {
            "type": "string"
          },
          "from": {
            "type": "integer"
          },
          "path": {
            "type": "string"
          },
          "to": {
            "type": "integer"
          },
          "total_lines": {
            "type": "integer"
          },
          "truncated": {
            "type": "boolean"
          }
        },
        "required": [
          "path",
          "content"
        ],
        "type": "object"
      }
    },
    {
      "description": "Poll generation status for a wiki id.",
      "metadata": {},
      "name": "openwiki::status",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": true,
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "phase": {
            "enum": [
              "queued",
              "cloning",
              "inventorying",
              "planning",
              "generating",
              "linting",
              "ready",
              "error",
              "unknown"
            ],
            "type": "string"
          },
          "progress": {
            "type": "number"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "phase",
          "progress"
        ],
        "type": "object"
      }
    },
    {
      "description": "Fetch a single wiki's metadata.",
      "metadata": {},
      "name": "openwiki::wiki",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "categories": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "description": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "title"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "category_count": {
            "type": "integer"
          },
          "commit": {
            "type": "string"
          },
          "content_hash": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "generating": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "last_refresh_at": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "navigation": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array"
          },
          "page_count": {
            "type": "integer"
          },
          "ref": {
            "type": "string"
          },
          "refresh_schedule": {
            "type": "string"
          },
          "repo_name": {
            "type": "string"
          },
          "repo_url": {
            "type": "string"
          },
          "steer": {
            "additionalProperties": true,
            "type": "object"
          },
          "summary": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "repo_url",
          "repo_name",
          "page_count",
          "category_count",
          "generating"
        ],
        "type": "object"
      }
    },
    {
      "description": "List all wikis generated by this worker.",
      "metadata": {},
      "name": "openwiki::wikis",
      "request_schema": {
        "additionalProperties": false,
        "properties": {},
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "wikis": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "categories": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "description": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "title"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "category_count": {
                  "type": "integer"
                },
                "commit": {
                  "type": "string"
                },
                "content_hash": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string"
                },
                "generating": {
                  "type": "boolean"
                },
                "id": {
                  "type": "string"
                },
                "last_refresh_at": {
                  "type": "string"
                },
                "model": {
                  "type": "string"
                },
                "navigation": {
                  "items": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "type": "array"
                },
                "page_count": {
                  "type": "integer"
                },
                "ref": {
                  "type": "string"
                },
                "refresh_schedule": {
                  "type": "string"
                },
                "repo_name": {
                  "type": "string"
                },
                "repo_url": {
                  "type": "string"
                },
                "steer": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "summary": {
                  "type": "string"
                },
                "updated_at": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "repo_url",
                "repo_name",
                "page_count",
                "category_count",
                "generating"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "wikis"
        ],
        "type": "object"
      }
    },
    {
      "description": "A page-writer sub-agent stores its finished page (markdown + metadata) for a generating wiki.",
      "metadata": {},
      "name": "openwiki::write-page",
      "request_schema": {
        "additionalProperties": false,
        "properties": {
          "category": {
            "type": "string"
          },
          "citations": {
            "items": {
              "additionalProperties": false,
              "properties": {
                "end_line": {
                  "type": "integer"
                },
                "note": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "start_line": {
                  "type": "integer"
                }
              },
              "required": [
                "path"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "markdown": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "source_paths": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "slug",
          "markdown"
        ],
        "type": "object"
      },
      "response_schema": {
        "additionalProperties": false,
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "slug",
          "ok"
        ],
        "type": "object"
      }
    }
  ],
  "triggers": []
}