@chronova/wiki-agent 1.7.0 → 1.7.1

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/README.md CHANGED
@@ -16,8 +16,8 @@ A standalone Ollama-only documentation agent. It inspects your source code and g
16
16
  - **GitHub Actions** — `--init` automatically creates a scheduled update workflow in your repo
17
17
  - **Repo instructions** — reads `AGENTS.md` or `CLAUDE.md` from the project root and follows all conventions documented there
18
18
  - **Change reports** — each run writes `.wiki/.last-update-report.md` with created/edited pages, used as the staging PR body in CI
19
- - **Restricted toolset** — the agent can only read files, write under `.wiki/`, run read-only git subcommands, and inspect pull requests via a read-only `gh` CLI tool; there is no shell tool
20
- - **Staging PR staleness check** — before writing in update mode, the agent checks for open wiki staging PRs and abandons the update if a newer one already exists, preventing duplicate PRs
19
+ - **Restricted toolset** — the agent can only read files, write under `.wiki/`, run read-only git subcommands, and use a `gh` CLI tool for inspecting pull requests and closing stale wiki staging PRs; there is no shell tool
20
+ - **Staging PR staleness check** — before writing in update mode, the agent checks for open wiki staging PRs, abandons the update if a newer one already exists, and closes stale ones with a comment ("This branch is from an earlier staging run and is stale. Closing")
21
21
  - **Frontmatter stripping** — YAML frontmatter is stripped before publishing to the GitHub Wiki tab, since GitHub Wiki renders frontmatter as literal text
22
22
 
23
23
  ## Quickstart
@@ -120,7 +120,7 @@ For cloud:
120
120
  | `WIKI_OLLAMA_BASE_URL` | Override Ollama server URL | `http://localhost:11434` / `https://ollama.com` |
121
121
  | `WIKI_MODEL` | Override model ID | from config |
122
122
  | `WIKI_RECURSION_LIMIT` | Max agent iterations | `200` |
123
- | `GH_TOKEN` | GitHub token for the read-only `gh` CLI tool (used in CI for the staging PR staleness check) | from environment |
123
+ | `GH_TOKEN` | GitHub token for the `gh` CLI tool (read-only inspection plus staging PR close/comment; used in CI for the staging PR staleness check) | from environment |
124
124
 
125
125
  Environment variables take priority over config files.
126
126
 
@@ -191,8 +191,8 @@ bun pm pack
191
191
  ## How it works
192
192
 
193
193
  1. The agent reads `AGENTS.md` or `CLAUDE.md` from the project root and follows all conventions documented there
194
- 2. It inspects your source code using a restricted, read-only toolset: `read_file`, `ls`, `glob`, `grep`, `ast_grep`, `ast_search`, a read-only `git` tool (whitelisted subcommands only — no mutating git, no shell), and a read-only `gh` CLI tool for inspecting pull requests and repository metadata
195
- 3. In update mode, it checks for open wiki staging PRs via `gh pr list` and compares branch timestamps against the latest commit — if a newer staging PR already exists, it abandons the update to prevent duplicates
194
+ 2. It inspects your source code using a restricted toolset: `read_file`, `ls`, `glob`, `grep`, `ast_grep`, `ast_search`, a read-only `git` tool (whitelisted subcommands only — no mutating git, no shell), and a `gh` CLI tool for inspecting pull requests and managing stale wiki staging PRs
195
+ 3. In update mode, it checks for open wiki staging PRs via `gh pr list` and compares branch timestamps against the latest commit — if a newer staging PR already exists, it abandons the update; stale PRs (older branch timestamp) are closed with a comment ("This branch is from an earlier staging run and is stale. Closing")
196
196
  4. It generates wiki pages under `.wiki/` with YAML frontmatter using `write_file` and `edit_file` (the only mutating tools, constrained to `.wiki/`)
197
197
  5. After the run, `index.md` files are synchronized for each directory
198
198
  6. `.last-updated.json` and `.last-update-report.md` are written
@@ -200,4 +200,4 @@ bun pm pack
200
200
  8. In update mode, only pages affected by recent changes are refreshed
201
201
  9. With `--wiki`, the workflow flattens the `.wiki/` tree (stripping frontmatter, converting nested paths to flat dash-joined filenames, rewriting links) and publishes to the GitHub Wiki tab by pushing directly to `<repo>.wiki.git` `master`
202
202
 
203
- The agent uses a manual tool-calling loop with the Ollama chat API — no LangChain or LangGraph dependency. The recursion limit prevents infinite loops. There is no general-purpose shell tool; the agent cannot execute arbitrary commands on the host system. The `gh` tool is restricted to read-only subcommands (pr list, pr view, repo view, etc.) — mutating operations like create, merge, and close are blocked.
203
+ The agent uses a manual tool-calling loop with the Ollama chat API — no LangChain or LangGraph dependency. The recursion limit prevents infinite loops. There is no general-purpose shell tool; the agent cannot execute arbitrary commands on the host system. The `gh` tool allows read-only inspection (pr list, pr view, repo view, etc.) plus `pr close` and `pr comment` but only on wiki staging PRs (branches matching `wiki/staging-*`); all other mutating operations are blocked.
package/dist/tui/App.js CHANGED
@@ -2,6 +2,7 @@ import React, { useState, useCallback } from "react";
2
2
  import { Box, Text, useApp, useInput } from "ink";
3
3
  import { CredentialsSetup } from "./CredentialsSetup.js";
4
4
  import { RunView } from "./RunView.js";
5
+ import { VERSION } from "../version.js";
5
6
  export function App({ command, cwd, config, verbose, wiki }) {
6
7
  const [needsSetup, setNeedsSetup] = useState(config.mode === "cloud" && !config.apiKey);
7
8
  const [resolvedConfig, setResolvedConfig] = useState(config);
@@ -21,7 +22,7 @@ export function App({ command, cwd, config, verbose, wiki }) {
21
22
  onConfigSaved: handleConfigSaved,
22
23
  });
23
24
  }
24
- return React.createElement(Box, { flexDirection: "column" }, React.createElement(Box, { borderStyle: "round", borderColor: "cyan", paddingX: 1 }, React.createElement(Text, null, React.createElement(Text, { bold: true }, "Wiki Agent v0.1.0"), " | ", React.createElement(Text, { color: "cyan" }, `Ollama (${resolvedConfig.mode})`), " | ", React.createElement(Text, { color: "gray" }, `model: ${resolvedConfig.model}`), " | ", React.createElement(Text, { color: "gray" }, cwd))), React.createElement(RunView, {
25
+ return React.createElement(Box, { flexDirection: "column" }, React.createElement(Box, { borderStyle: "round", borderColor: "cyan", paddingX: 1 }, React.createElement(Text, null, React.createElement(Text, { bold: true }, `Wiki Agent v${VERSION}`), " | ", React.createElement(Text, { color: "cyan" }, `Ollama (${resolvedConfig.mode})`), " | ", React.createElement(Text, { color: "gray" }, `model: ${resolvedConfig.model}`), " | ", React.createElement(Text, { color: "gray" }, cwd))), React.createElement(RunView, {
25
26
  command,
26
27
  cwd,
27
28
  config: resolvedConfig,
@@ -0,0 +1 @@
1
+ export declare const VERSION: string;
@@ -0,0 +1,6 @@
1
+ import { createRequire } from "node:module";
2
+ // Read the version from package.json so the TUI and CLI stay in sync
3
+ // with releases without a hardcoded string to update.
4
+ const require = createRequire(import.meta.url);
5
+ const pkg = require("../package.json");
6
+ export const VERSION = pkg.version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chronova/wiki-agent",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Standalone Ollama-only documentation agent",
5
5
  "type": "module",
6
6
  "bin": {