@inkeep/open-knowledge 0.6.0-beta.13 → 0.6.0-beta.15

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.
Files changed (51) hide show
  1. package/dist/assets/skills/discovery/SKILL.md +1 -1
  2. package/dist/assets/skills/project/SKILL.md +36 -6
  3. package/dist/cli.mjs +21 -21
  4. package/dist/constants-nGMU1v3i.mjs +2 -0
  5. package/dist/dist-CiO-cnaZ.mjs +1 -0
  6. package/dist/{dist-DVt5ImvV.mjs → dist-DsQyJDx9.mjs} +53 -46
  7. package/dist/git-handle-Bpdi8GVn-C5u26rxz.mjs +1 -0
  8. package/dist/{git-handle-DwfYp_z--CfyPz4Dz.mjs → git-handle-Bpdi8GVn-Dj_04HQK.mjs} +2 -2
  9. package/dist/index.mjs +1 -1
  10. package/dist/init-DWQgcLqP.mjs +1 -0
  11. package/dist/{init-BVyOcRVl.mjs → init-DWeer2GE.mjs} +8 -8
  12. package/dist/{loader-DlVJK5_j.mjs → loader-CMQGtLC7.mjs} +3 -3
  13. package/dist/loader-DMGuKABp.mjs +1 -0
  14. package/dist/{preview-D-yuPDgI.mjs → preview-B1DrNLNP.mjs} +2 -2
  15. package/dist/preview-CsYWmW2j.mjs +1 -0
  16. package/dist/public/assets/{ActivityModeContent-BTDXmmcF.js → ActivityModeContent-lVBLogiX.js} +1 -1
  17. package/dist/public/assets/DocumentContext-DL3IvUIj.js +52 -0
  18. package/dist/public/assets/GraphPanel-BEMXBopP.js +46 -0
  19. package/dist/public/assets/{SettingsDialogBody-DcjK_PiT.js → SettingsDialogBody-BaHGiuxL.js} +2 -2
  20. package/dist/public/assets/{SourceEditor-wRLdKlEx.js → SourceEditor-BDFVqj-3.js} +2 -2
  21. package/dist/public/assets/config-validation-events-BUz3G5Oa.js +11 -0
  22. package/dist/public/assets/index-BsoPxNgS.js +1915 -0
  23. package/dist/public/assets/index-QxNC4V2M.css +1 -0
  24. package/dist/public/assets/prop-types-CnHV2frT.js +433 -0
  25. package/dist/public/assets/{target-navigation-intent-4pvac8Xe.js → target-navigation-intent-Bo7Eb12B.js} +1 -1
  26. package/dist/public/assets/{toggle-group-KLnzY88z.js → toggle-group-DQNenxzz.js} +1 -1
  27. package/dist/public/assets/typing-burst-detector-DauwpHXj.js +2 -0
  28. package/dist/public/index.html +8 -8
  29. package/dist/{repair-launch-json-DgXubyAt.mjs → repair-launch-json-Wv_TmPhW.mjs} +2 -2
  30. package/dist/{repair-mcp-configs-DNVytwh9.mjs → repair-mcp-configs-Ty_ahhbc.mjs} +2 -2
  31. package/dist/{server-lock-D7DXNVql-BRVVzA6T.mjs → server-lock-BniQ3qki-CadPGoZN.mjs} +1 -1
  32. package/dist/server-lock-BniQ3qki-DjKtnzVr.mjs +1 -0
  33. package/dist/{src-DDVTc8a2.mjs → src-RAiejTY-.mjs} +2 -2
  34. package/dist/{start-CQhiQAVz.mjs → start-BauSbtBh.mjs} +2 -2
  35. package/dist/start-uKvTqQ7x.mjs +1 -0
  36. package/package.json +1 -1
  37. package/dist/constants-DMYn7coi.mjs +0 -2
  38. package/dist/dist-BTk16yDE.mjs +0 -1
  39. package/dist/git-handle-DwfYp_z--DreW3fNC.mjs +0 -1
  40. package/dist/init-hlHTTbBd.mjs +0 -1
  41. package/dist/loader-zlf-nKBp.mjs +0 -1
  42. package/dist/preview-OJnqomHA.mjs +0 -1
  43. package/dist/public/assets/DocumentContext-BLVVzPxk.js +0 -52
  44. package/dist/public/assets/GraphPanel-MDxyn9iQ.js +0 -46
  45. package/dist/public/assets/config-validation-events-2g5Tn60q.js +0 -11
  46. package/dist/public/assets/index-BG8pn9At.js +0 -1915
  47. package/dist/public/assets/index-Cr48lc4Y.css +0 -1
  48. package/dist/public/assets/prop-types-DgXoNo88.js +0 -433
  49. package/dist/public/assets/typing-burst-detector-YLtKpRD8.js +0 -2
  50. package/dist/server-lock-D7DXNVql-B5nINglj.mjs +0 -1
  51. package/dist/start-DYyrxo2Q.mjs +0 -1
@@ -3,7 +3,7 @@ name: open-knowledge-discovery
3
3
  description: "Read when the user asks what Open Knowledge is, wants to install it on a repository, wants to share an Open Knowledge project with collaborators, or asks how `ok init` / `ok install-skill` / OK Desktop set up a project. Do NOT load to perform Open Knowledge reads/writes — the runtime guidance for editing markdown inside an initialized OK project ships as a separate project-local skill at `.claude/skills/open-knowledge/` whenever `ok init` runs. If the user appears to be editing markdown inside a `.ok/` project and this is the only OK skill loaded, advise them to re-run `ok init` to install the project-local skill."
4
4
  compatibility: "Any agent host — no MCP server required. Pure discovery + install guidance."
5
5
  metadata:
6
- version: "0.6.0-beta.13"
6
+ version: "0.6.0-beta.15"
7
7
  author: "Inkeep"
8
8
  repository: "https://github.com/inkeep/open-knowledge"
9
9
  ---
@@ -3,7 +3,7 @@ name: open-knowledge
3
3
  description: "MUST invoke before reading or editing any `.md` / `.mdx` file, and before any `mcp__open-knowledge__*` tool call (`exec`, `search`, `write_document`, `edit_document`, and the rest). This skill is installed into the repository by `ok init`, so its presence alone means this is an Open Knowledge project — its runtime contract governs every markdown file here, with no need to probe for a `.ok/` directory. Authoritative agent-runtime contract; supersedes the overlapping MCP server `instructions` echo."
4
4
  compatibility: "Claude Code, Claude Desktop, Claude Cowork, Claude.ai web. Requires Open Knowledge MCP server + code execution."
5
5
  metadata:
6
- version: "0.6.0-beta.13"
6
+ version: "0.6.0-beta.15"
7
7
  author: "Inkeep"
8
8
  repository: "https://github.com/inkeep/open-knowledge"
9
9
  ---
@@ -19,17 +19,18 @@ Open Knowledge (OK) is a markdown-CRDT collaboration platform exposed via MCP. T
19
19
 
20
20
  1. **Reads:** `exec("cat …")` for a single doc, `exec("ls -A …")` for a directory (with folder defaults + template menu), `exec("grep …")` for literal, `search` for ranked retrieval. Native `Read` / `Grep` only on source code (`.ts` / `.py` / …), never on in-scope `.md` / `.mdx`.
21
21
  2. **Writes:** `write_document` for new or full-replace, `edit_document` for body-only find/replace, `edit_frontmatter` for 1-2 frontmatter keys (JSON Merge Patch — preferred). Full frontmatter rewrites use `write_document({ position: "replace" })`. `edit_document` rejects frontmatter (HTTP 400).
22
- 3. **Preview:** every OK read/write response carries a route-only `previewUrl` (`/#/<doc>`, no host:port). If you have a `preview_*` tool, call `preview_start("open-knowledge-ui")`; otherwise call `get_preview_url` once for the full browser URL and open it in your own in-app browser. Surface to the user on a `start-ui` warning (no UI running). Don't `preview_screenshot` after every edit.
22
+ 3. **Preview:** every OK read/write response carries a route-only `previewUrl` (`/#/<doc>`, no host:port). If you have a `preview_*` tool, call `preview_start("open-knowledge-ui")`; otherwise call `get_preview_url` once for the full browser URL and open it in your own in-app browser. Surface to the user on a `start-ui` warning (no UI running). Don't `preview_screenshot` to confirm edits — the CRDT tool response is the confirmation.
23
23
  4. **Workflow tools** (`ingest` / `research` / `consolidate` / `discover`) return procedural guides, not data. Use them when the work fits the layer; follow their numbered steps.
24
24
 
25
25
  Everything below is depth. Read on demand.
26
26
 
27
- ## Tool index — 18 tools
27
+ ## Tool index — 21 tools
28
28
 
29
29
  The full MCP surface, grouped by risk-level. Every tool's `kind` / `action` set is single-risk-level (never a read and a write behind one discriminator).
30
30
 
31
31
  - **Reads** — `exec` (primary; shell-style `cat`/`ls`/`grep`/`find` with frontmatter + backlink + history enrichment), `search` (ranked, BM25 + recency), `get_history` (versions for a doc), `links` (`kind: 'backlinks'|'forward'|'dead'|'orphans'|'hubs'|'suggest'`), `get_config` (resolved config), `get_components` (canonical component schemas), `get_preview_url` (browser-reachable preview URL on demand).
32
32
  - **Writes** — `write_document` (new or full-replace; supports `template:` instantiation), `edit_document` (body-only find/replace), `edit_frontmatter` (1-2 keys via RFC 7396 JSON Merge Patch — preferred), `delete_document`, `rename` (probes file vs folder; rewrites referrers), `version` (`action: 'save'|'rollback'`), `folder_config` (`action: 'set-rule'|'write-template'|'delete-template'`).
33
+ - **GitHub-sync conflicts** — `list_conflicts` (enumerate), `get_conflict_content` (base/ours/theirs stages + lifecycle), `resolve_conflict` (write a chosen resolution + commit; destructive). Mutating writes against a doc in conflict return RFC 9457 `urn:ok:error:doc-in-conflict` (409); `exec("cat …")` returns `lifecycle: {status, reason} | null` so you can detect the state proactively. See *Conflict-aware writes*.
33
34
  - **Workflow** — `ingest`, `research`, `consolidate`, `discover` (return procedural guides, not data).
34
35
 
35
36
  Tools NOT in OK MCP (they belong to your agent host): `preview_start`, `preview_screenshot`, `WebFetch`, `WebSearch`, native `Read` / `Grep` / `Glob` / `Edit`. The STOP rule below governs which of those you may use on in-scope markdown.
@@ -61,7 +62,7 @@ Why: native tools skip frontmatter, backlinks, shadow-repo activity, and project
61
62
 
62
63
  ## Preview — open the browser at session start
63
64
 
64
- The user watches your edits land in a live browser preview. Open it once at session start, then keep working — re-navigate later only to verify an ambiguous edit.
65
+ The user watches your edits land in a live browser preview. Open it once at session start, then keep working. Re-navigate only when the user asks to open a different doc, not to re-check your own edits.
65
66
 
66
67
  **`previewUrl` is a route, not a URL to open.** Every read response (per-doc, on `exec` / `search` / `links` rows) and every write response carries a `previewUrl` — a route fragment like `/#/specs/foo/SPEC`, with **no scheme, host, or port**. It identifies *which doc* to preview, not a URL to hand a browser by itself. Never construct or guess preview URLs.
67
68
 
@@ -88,9 +89,9 @@ If you see `"Hocuspocus server is not running"`, run `ok start` and retry.
88
89
 
89
90
  OK Electron and `ok ui` share `ui.lock`; when a second UI binds a different port, the OK lock-collision proxy bridges it to the live server transparently. That is exactly why `previewUrl` is route-only — the port behind the proxy is not the agent's to use. **Do not nudge the user to quit OK Electron to free a port** — the proxy handles it, and quitting tears down a UI in active use.
90
91
 
91
- **The preview is read-only for the agent.** Navigate to verify edits landed; you cannot click or type to drive edits — the CRDT flow is one-way (agent → MCP → CRDT → preview).
92
+ **The preview is read-only for the agent it is the user's view, not a surface you read back.** You cannot click or type to drive edits — the CRDT flow is one-way (agent → MCP → CRDT → preview).
92
93
 
93
- **No screenshots after every edit, no generic verification loop.** Do NOT take `preview_screenshot` (host tool, not OK MCP) after every write, and do not run a generic snapshot/eval/screenshot verification loop — OK's preview is a read-only, one-way mirror, so the CRDT tool response *is* the confirmation that an edit landed. Screenshot only when (a) debugging a visual issue, (b) a response looks ambiguous, or (c) the user asks.
94
+ **No screenshots to confirm edits, no generic verification loop.** Do NOT take `preview_screenshot` (host tool, not OK MCP) after a write, and do not run a generic snapshot/eval/screenshot verification loop — OK's preview is a read-only, one-way mirror, so the CRDT tool response *is* the confirmation that an edit landed. Screenshot only when debugging a visual rendering issue or when the user explicitly asks to see the preview — never to confirm an edit landed.
94
95
 
95
96
  ## Writing
96
97
 
@@ -100,6 +101,35 @@ To delete a doc, call `delete_document` — never `rm` / `unlink` / native `Bash
100
101
 
101
102
  **If `edit_document` returns "Text not found" on text you can verify exists on disk** (via `exec("cat …")`), the MCP session is likely stale (e.g., after a folder rename or server restart). Treat this as the escape-hatch trigger from the STOP block: prefix your next user-visible sentence with `Open Knowledge MCP unavailable:` and report the inconsistency. Don't loop on retries — the symptom is structural, not transient.
102
103
 
104
+ ## Conflict-aware writes
105
+
106
+ Projects with GitHub sync enabled may carry docs in a merge-conflict state. The MCP server refuses every mutating call against such a doc with a structured RFC 9457 response:
107
+
108
+ ```json
109
+ {
110
+ "type": "urn:ok:error:doc-in-conflict",
111
+ "title": "Document is in conflict.",
112
+ "status": 409,
113
+ "detail": "The document is in a merge-conflict state. Call get_conflict_content + resolve_conflict before retrying.",
114
+ "file": "notes/sso.md",
115
+ "resolutionOptions": ["mine", "theirs", "content"]
116
+ }
117
+ ```
118
+
119
+ The gate covers `write_document`, `edit_document`, `delete_document`, `rename`, `version` (`action: 'rollback'`), `folder_config` (`action: 'write-template'|'delete-template'`), and agent undo. You cannot route around it by writing content that byte-matches one of the merge stages — the gate refuses on lifecycle state, not on body equality.
120
+
121
+ **Detect proactively.** `exec("cat <path>.md")` always returns `lifecycle: {status, reason} | null` alongside the body. When `status === 'conflict'`, switch to the resolution flow before attempting any mutation.
122
+
123
+ **Resolution flow.** Three tools compose:
124
+
125
+ 1. `list_conflicts()` → enumerate every doc currently tracked in conflict.
126
+ 2. `get_conflict_content({ file })` → fetch `base` / `ours` / `theirs` stages plus the doc's `lifecycleStatus`. `ours` reflects the live Y.Text (what the human user sees in the editor) when the doc is loaded server-side and is marker-free; falls back to `git show :2:<file>` otherwise (e.g. after an editor reopen seeded markers into Y.Text).
127
+ 3. `resolve_conflict({ file, strategy, content? })` → write the chosen bytes and commit. Strategies: `mine` writes `git show :2:`, `theirs` writes `git show :3:`, `content` writes the bytes you supply.
128
+
129
+ `file` is a `.md` / `.mdx` path relative to the project dir (extension included) — mirrors the on-disk shape, not the extension-less `docName` used by other tools.
130
+
131
+ The resolve operation is best-effort and NOT atomic: `git checkout --ours/--theirs && git add` may succeed but the subsequent `git commit --no-edit` can fail (pre-commit hook rejection, locked index). On commit failure the staged files are re-`git add`-ed back into the unmerged index and the tracked entry remains in `conflicts.json` — re-call `resolve_conflict` after the user clears the blocker.
132
+
103
133
  ## Components — prefer canonicals when one fits
104
134
 
105
135
  OK projects ship a registry of custom JSX components (callouts, tabs, math, file attachments, …) with richer affordances than plain CommonMark / GFM. Three-step pattern: