You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(open-knowledge): preview via Claude Desktop in-app browser (#2588)
* feat(open-knowledge): preview via Claude Desktop in-app browser
Claude Code Desktop's Browser pane now opens a URL directly with
preview_start({url}) and moves with navigate({url}), the same way Cursor
and Codex drive their in-app browsers. Migrate the preview capability
ladder so Claude Desktop is treated as an in-app browser rather than the
old preview-pane path, and remove the machinery that only existed to prop
up the pane's base-open flow.
- Skill + response-message cleanup to the preview_url -> preview_start({url})
-> navigate({url}) model (preview.md, SKILL.md, discovery, anti-patterns,
preview-url.ts / get-preview-url.ts messages).
- Remove the pane-target arming subsystem: the preview_url armPaneTarget
param, the /api/config paneTarget field, the DELETE consume route, the
ok ui base-open 302 redirect, the app PaneTargetLanding, and pane-target.ts.
The presence-driven AgentFocusBroadcaster path is unchanged.
- Add the spec for the remaining launch.json removal (I1/I2/I5/I6) under
specs/2026-07-10-remove-launch-json-pane-arming.
* feat(open-knowledge): remove launch.json + LAUNCH_JSON_PORT machinery
OK no longer scaffolds a .claude/launch.json. Claude Code Desktop's in-app
Browser pane opens the preview URL directly and preview_url autostarts the
OK UI, so the generated launch.json dev-server recipe and its port split are
dead weight.
- Stop generating .claude/launch.json: remove scaffoldLaunchJson, the sh and
PowerShell recipes, the version sentinels, and every wiring site (init,
write-project-ai-integrations, desktop launch-json-wiring, worktree inherit,
cli index export, .gitignore).
- Repurpose the ok start repair sweep to remove any pre-existing
open-knowledge-ui entry instead of rewriting it forward. repair-launch-json
now delegates to removeOwnLaunchEntry; ok deinit removal is unchanged.
- Remove the LAUNCH_JSON_PORT (39848) constant. The lock-collision proxy, the
--ui-port channel, and connectUiSibling stay; they serve general ok ui
collision and OK Electron, not only the launch.json spawn.
- Update user-facing surfaces: the docs reference tables, the mcp reference
(drop armPaneTarget), the consent and sharing UI (regenerated i18n catalogs),
and AGENTS.md preview guidance.
Kept on purpose: the git-exclude artifact set still lists .claude/launch.json
so a legacy file left by an older OK stays excluded in local-only mode until
the repair sweep removes it. The lume-qa e2e scenarios still probe the old
39848/launch.json flow; they run in a VM harness, not bun run check, and are
left for a follow-up.
* chore(ok-marketing): regen vendored open-knowledge-core dist
Removing the paneTarget field from ApiConfigSuccessSchema in
open-knowledge-core changed core's built index.mjs. Regenerate ok-marketing's
vendored copy so verify-core-dist passes.
* chore(open-knowledge): address PR review feedback
- Add the missing changeset (minor): removes the scaffoldLaunchJson,
LAUNCH_UI_CHAIN_*, and LaunchJsonResult exports from @inkeep/open-knowledge,
the preview_url armPaneTarget param, and the /api/config paneTarget field.
- Sweep stale launch.json / pane-target references out of JSDoc and comments
(ui.ts, start.ts, write-project-ai-integrations.ts,
project-integration-writers.ts, discovery/SKILL.md, ui.test.ts test name).
- preview.md: drop the preview_start({name}) form, which now has no launch.json
entry to spawn, so an agent can no longer pick a silently-failing invocation.
- what-open-knowledge-writes.mdx: note the repair sweep now removes launch.json
entries and restore the third sweep row so "all three" is accurate.
- repair-launch-json: wrap removeOwnLaunchEntry so a write failure stays
fail-soft (matching the "never throws" contract) instead of crashing ok start.
- Rename localLockDir back to lockDir to match the surrounding convention.
GitOrigin-RevId: 9b85ab89a160a444c93a2fee73c32db55dfeb6a6
Remove the launch.json preview machinery and the pane-target arming subsystem. Claude Code Desktop's in-app Browser pane now opens the preview URL directly (`preview_start({url})` + `navigate({url})`), so OK no longer scaffolds `.claude/launch.json`.
10
+
11
+
Breaking for consumers: the `@inkeep/open-knowledge` package drops the `scaffoldLaunchJson`, `LAUNCH_UI_CHAIN_*`, and `LaunchJsonResult` exports; the `preview_url` MCP tool drops the `armPaneTarget` param; and the `/api/config` response drops the `paneTarget` field. The `ok start` repair sweep now removes any pre-existing `open-knowledge-ui` launch.json entry instead of rewriting it.
Copy file name to clipboardExpand all lines: docs/content/reference/mcp.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ The surface is **19 tools**. The four write verbs — `write`, `edit`, `delete`,
21
21
|`skills`| Find and read agent skills. Omit `name` to list every skill across Project + Global (rows carry `installed` + `hosts`); pass `name` to read one (addressed by `name`+`scope`, never by path); pass `name` + `file` to read one bundle file's text — the read path for `references/` and `scripts/` content |
22
22
|`config`| Read the effective merged config (`config({ key: "appearance.theme" })` for a sub-tree; omit `key` for the whole config) |
23
23
|`palette`| Markdown-native authoring forms, themed `html preview` embed starters, and theme tokens. Pass `components` for the canonical components' full JSX prop schemas |
24
-
|`preview_url`| Resolve the browser-reachable preview URL. Targets a `document`, `folder`, or `skill` in the current project, or — via `file`, an absolute path — a markdown file outside it (resolved through the session serving that file). Per-response `previewUrl` fields elsewhere are route-only (`/#/<doc>`); call this when you need the full openable URL. `armPaneTarget` briefly arms the target so a host preview pane opens on it|
24
+
|`preview_url`| Resolve the browser-reachable preview URL. Targets a `document`, `folder`, or `skill` in the current project, or — via `file`, an absolute path — a markdown file outside it (resolved through the session serving that file). Per-response `previewUrl` fields elsewhere are route-only (`/#/<doc>`); call this when you need the full openable URL |
25
25
|`share_link`| Build a GitHub-substrate share URL for a doc or folder to send to a teammate (`kind` disambiguates; `path: ""` with `kind: "folder"` shares the content root). Responses carry a `freshness` verdict — `current`, `stale` (unpushed changes), or `absent` (never pushed), omitted when the probe can't run — and prepend a matching warning to relay with the link. Read-only against `.git/`; never publishes |
26
26
|`write`| Create or overwrite a `document`, `folder`, `template`, `skill`, or `asset`. For a document: `{ path, content }`, or `{ path, template }` to instantiate from a folder template. `position` selects `replace` (full rewrite; the only mode that touches frontmatter), `append`, or `prepend`. `extension` selects `.md` (default) or `.mdx` for a new document; an existing doc keeps its extension (the MCP cannot change it). An `asset` takes exactly one of `content` (base64, for small files) or `source` (a local path the server reads, for large files) |
27
27
|`edit`| Modify a `document` (body find/replace **or** a frontmatter merge-patch), a `folder` (frontmatter merge-patch), a `template`, or a `skill`. Body edits take `{ path, find, replace, occurrence? }`; `occurrence` selects which match (1 = first) |
@@ -73,6 +73,6 @@ To detect conflict state proactively without waiting for a 409, call `conflicts(
73
73
74
74
## Preview links
75
75
76
-
Read and write tools return a `previewUrl` for any doc they touched, but **those are route-only** (`/#/<doc>` with no host:port), meant to identify the doc, not to be opened as-is. Hosts that want to open the editor (Claude Code Desktop's `preview_start`, terminal `open <url>`) call `preview_url` to resolve the full URL once per session.
76
+
Read and write tools return a `previewUrl` for any doc they touched, but **those are route-only** (`/#/<doc>` with no host:port), meant to identify the doc, not to be opened as-is. Hosts that want to open the editor (Claude Code Desktop's `preview_start({url})`, terminal `open <url>`) call `preview_url` to resolve the full URL once per session.
77
77
78
78
`preview_url` always carries an `autoOpen` boolean (top-level on its response) reflecting the user's [`appearance.preview.autoOpen`](/docs/reference/configuration) preference. The write tools (`write`, `edit`) carry the same boolean on the `warning` object, which fires only when no browser is attached to the preview. In the common case (a browser is attached), the write response has no `warning` and no `autoOpen` field. Agents honor `autoOpen` before navigating: `true` (default) follows the host-capability routing in the bundled skill; `false` means the user is managing their own preview window, so the agent surfaces the URL on request but does not open or refresh anything. The value is resolved fresh on every tool call, so a mid-session toggle propagates within 0–1 calls, with no client restart.
Copy file name to clipboardExpand all lines: docs/content/reference/what-open-knowledge-writes.mdx
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,6 @@ When you initialize or open a project, the app scaffolds the same project files
87
87
|`.pi/extensions/open-knowledge.ts`| Managed bridge extension connecting [Pi](/docs/integrations/pi) (which has no MCP support) to the project | In-project, committed |
88
88
|`.claude/skills/`, `.cursor/skills/`, `.codex/skills/`, `.opencode/skills/`, `.pi/skills/`| Project-local "rich" OpenKnowledge skill (`SKILL.md`) for the same five editors | In-project, committed |
89
89
|`.ok/skill-targets.json`| Committed list of which editors receive skills, written when you customize the targets | In-project, committed |
90
-
|`.claude/launch.json`| Configures Claude Code's preview pane to open the editor (on a local UI port, `39848`) | In-project, committed |
91
90
|`~/.claude.json`, `~/Library/Application Support/Claude/claude_desktop_config.json`, `~/.cursor/mcp.json`, `~/.codex/config.toml`, `~/.config/opencode/opencode.json`, `~/.openclaw/openclaw.json`, `~/.gemini/config/mcp_config.json`, `~/.lmstudio/mcp.json`, `~/.hermes/config.yaml`| User-level `open-knowledge` MCP registration, one per detected editor, so it's available in every project (`~/.openclaw/openclaw.json` only when `~/.openclaw/` exists; `~/.gemini/config/mcp_config.json` is Antigravity's shared IDE + `agy` config, only when `~/.gemini/` exists; `~/.lmstudio/mcp.json` and `~/.hermes/config.yaml` only when those apps are installed) | Outside-project (editor config) |
92
91
93
92
### While a project is open
@@ -109,7 +108,7 @@ The app runs a collaboration server for the open project. It writes runtime stat
109
108
110
109
Diagnostic logs and telemetry are **on by default but local-only** — credential-bearing attributes are redacted (`[REDACTED]`) before anything is written, the files rotate at the size caps above, and nothing leaves the machine until you explicitly run `ok diagnose bundle`. Turn the local sink off with `telemetry.localSink.enabled: false`; see [Configuration](/docs/reference/configuration).
111
110
112
-
On each launch and project open, the app also runs **repair sweeps**: it rewrites *existing*`open-knowledge` MCP entries (in the editor configs above), `.claude/launch.json`, and the OpenKnowledge skill bundles (`open-knowledge-discovery` and `open-knowledge-write-skill`, in `~/.agents/skills/` and each detected editor's `~/.claude/skills/`, `~/.cursor/skills/`, `~/.codex/skills/`, `~/.opencode/skills/`) to the current canonical form — a no-op when nothing has drifted. It **never adds** an MCP entry to an editor that doesn't already have one; and when you turn on skill management for a project, it also adopts your existing editor skills into `.ok/skills/`. Same `OK_RECLAIM_DISABLE=1` opt-out.
111
+
On each launch and project open, the app also runs **repair sweeps**: it rewrites *existing*`open-knowledge` MCP entries (in the editor configs above)and the OpenKnowledge skill bundles (`open-knowledge-discovery` and `open-knowledge-write-skill`, in `~/.agents/skills/` and each detected editor's `~/.claude/skills/`, `~/.cursor/skills/`, `~/.codex/skills/`, `~/.opencode/skills/`) to the current canonical form — a no-op when nothing has drifted. It also removes any stale `open-knowledge-ui` entry left in `.claude/launch.json` by an older OK version. It **never adds** an MCP entry to an editor that doesn't already have one; and when you turn on skill management for a project, it also adopts your existing editor skills into `.ok/skills/`. Same `OK_RECLAIM_DISABLE=1` opt-out.
113
112
114
113
### Home directory and credentials (`~/.ok/`)
115
114
@@ -165,7 +164,6 @@ The `postinstall` step is **non-fatal** (install always succeeds even if it fail
165
164
|`.pi/extensions/open-knowledge.ts`| Managed bridge extension connecting [Pi](/docs/integrations/pi) (which has no MCP support) to the project | In-project, committed |
166
165
|`.claude/skills/`, `.cursor/skills/`, `.codex/skills/`, `.opencode/skills/`, `.pi/skills/`| Project-local "rich" OpenKnowledge skill (`SKILL.md`) for the same five editors | In-project, committed |
167
166
|`.ok/skill-targets.json`| Committed list of which editors receive skills, written when you customize the targets | In-project, committed |
168
-
|`.claude/launch.json`| Configures Claude Code's preview pane to open the editor (on a local UI port, `39848`) | In-project, committed |
169
167
170
168
With `--scope user` or `both` (the default), `ok init` also registers the `open-knowledge` MCP server in each detected editor's **user-level** config, so it's available in every project:
171
169
@@ -217,8 +215,8 @@ On each boot, `ok start` also runs **repair sweeps**: it re-checks a few things
217
215
| What it re-checks | Where | Scope |
218
216
| --- | --- | --- |
219
217
| Existing `open-knowledge` MCP entries | The same editor configs `ok init` writes — **both** user-level (`~/.claude.json`, `~/.cursor/mcp.json`, …) and project-level | Outside-project (editor config) **and** in-project |
220
-
|`.claude/launch.json`| Your project | In-project, committed |
221
218
| OpenKnowledge skill bundles (`open-knowledge-discovery`, `open-knowledge-write-skill`) | Project (`.claude/skills/…`) and user-global — `~/.agents/skills/` plus each detected editor's `~/.claude/skills/`, `~/.cursor/skills/`, `~/.codex/skills/`, `~/.opencode/skills/`| In-project **and** outside-project (home dir) |
219
+
| Stale `open-knowledge-ui` entry in `.claude/launch.json`| Project | Removed if present — OK no longer writes launch.json |
0 commit comments