Skip to content

Commit 6d5f457

Browse files
committed
Merge origin/main into feat/collab
Main landed 32 commits while this branch was open, including the big #597 markdown-reader refactor that broke Viewer.tsx into a shell + BlockRenderer + InlineMarkdown + blocks/* architecture, added GitHub alert callouts, HTML blocks, directive blocks, bare-URL autolinks, and balanced-paren URL handling. Other landings: code tour agent provider, wide annotate mode, self-hosted paste-service URLs, ~-path expansion, ancestor-PID session resolution, OpenCode origin detection, thumbs-up quick label, PDF/print flow. Conflict resolution: - bun.lock regenerated. - package.json/shared/ui package.jsons: combined both sides' exports and devDeps. Kept our per-package test script (UI needs happy-dom preload) and added main's pi-extension typecheck path. - VSCodeIcon.tsx: kept our style={{ maskType: 'alpha' }} form (same DOM output as main's spread-attribute form). - sharing.ts, useSharing.ts: kept our explanatory comment + defensive null check; main didn't touch the logic. - App.tsx: combined imports, adopted main's ThemeProvider + TooltipProvider root wrap, kept our room-aware Viewer props (showDemoBadge gated on !roomModeActive, onOpenLinkedDoc gated, localDocLinksEnabled, authorOverride, attachmentsEnabled), kept main's annotateReaderMaxWidth for wide-mode support. - Viewer.tsx: accepted main's refactored slim shell wholesale (our fork-point monolith was already main's pre-refactor shape; our 152-line delta was pure prop-threading with no rendering logic). Re-applied our 4 collab props onto main's Viewer: * authorOverride — stamps annotations with room display name * attachmentsEnabled — hides image button in room mode * localDocLinksEnabled — drilled through BlockRenderer, InlineMarkdown, AlertBlock, Callout, TableBlock, TablePopout, proseBody; read in the wikilink + markdown-link handlers so local doc links render as plain text in room mode * onHighlightSurfaceReset — passed straight to the hook (the hook's internal ref handles callback-identity stability) HtmlBlock deliberately not threaded (raw HTML bypasses the markdown renderer). Post-merge fixes needed: - Added VITE_DIFF_DEMO to packages/editor/env.d.ts (main's wide mode reads it via import.meta.env). - Made openSidebarTab param optional to match useLinkedDoc's sidebar.open signature (main narrowed it). Verified: typecheck green, 1,179 tests pass (875 shared + 285 UI + 19 editor). Bundle build and runtime smoke verification still recommended as a follow-up before shipping. For provenance purposes, this commit was AI assisted.
2 parents 6828c4d + 289a2aa commit 6d5f457

135 files changed

Lines changed: 10810 additions & 1819 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/renovate.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
"matchManagers": ["github-actions"],
1414
"groupName": "GitHub Actions",
1515
"automerge": false
16+
},
17+
{
18+
"description": "Pin Bun to 1.3.11: 1.3.12+ broke macOS binary codesign for bun build --compile (hotfixed in v0.17.9). Unpin only after verifying signed builds work on the target version.",
19+
"matchManagers": ["github-actions"],
20+
"matchDepNames": ["oven-sh/setup-bun"],
21+
"matchDepTypes": ["action"],
22+
"enabled": true
23+
},
24+
{
25+
"description": "Do not bump the bun-version input passed to oven-sh/setup-bun. See v0.17.9 hotfix.",
26+
"matchManagers": ["github-actions"],
27+
"matchDepNames": ["bun"],
28+
"enabled": false
1629
}
1730
]
1831
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ apps/pi-extension/review-core.ts
3838
.idea
3939
.DS_Store
4040
*.suo
41+
42+
# Claude Code session-local runtime state (lock files, scheduled-task state).
43+
# Machine-specific; never belongs in the repo.
44+
.claude/
4145
*.ntvs*
4246
*.njsproj
4347
*.sln

AGENTS.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ claude --plugin-dir ./apps/hook
131131
| `PLANNOTATOR_SHARE` | Set to `disabled` to turn off URL sharing entirely. Default: enabled. |
132132
| `PLANNOTATOR_SHARE_URL` | Custom base URL for share links (self-hosted portal). Default: `https://share.plannotator.ai`. |
133133
| `PLANNOTATOR_PASTE_URL` | Base URL of the paste service API for short URL sharing. Default: `https://plannotator-paste.plannotator.workers.dev`. |
134+
| `PLANNOTATOR_ORIGIN` | Explicit agent-origin override at the top of the detection chain. Valid values: `claude-code`, `opencode`, `codex`, `copilot-cli`, `gemini-cli`. Invalid values silently fall through to env-based detection. Unset by default. |
134135
| `PLANNOTATOR_JINA` | Set to `0` / `false` to disable Jina Reader for URL annotation, or `1` / `true` to enable. Default: enabled. Can also be set via `~/.plannotator/config.json` (`{ "jina": false }`) or per-invocation via `--no-jina`. |
135136
| `JINA_API_KEY` | Optional Jina Reader API key for higher rate limits (500 RPM vs 20 RPM unauthenticated). Free keys include 10M tokens. |
136137
| `PLANNOTATOR_VERIFY_ATTESTATION` | **Read by the install scripts only**, not by the runtime binary. Set to `1` / `true` to have `scripts/install.sh` / `install.ps1` / `install.cmd` run `gh attestation verify` on every install. Off by default. Can also be set persistently via `~/.plannotator/config.json` (`{ "verifyAttestation": true }`) or per-invocation via `--verify-attestation`. Requires `gh` installed and authenticated. |
@@ -280,12 +281,14 @@ work; it is not part of the room-origin approve/deny surface.
280281
| `/api/external-annotations` | POST | Add external annotations (single or batch `{ annotations: [...] }`) |
281282
| `/api/external-annotations` | PATCH | Update fields on a single annotation (`?id=`) |
282283
| `/api/external-annotations` | DELETE | Remove by `?id=`, `?source=`, or clear all |
283-
| `/api/agents/capabilities` | GET | Check available agent providers (claude, codex) |
284+
| `/api/agents/capabilities` | GET | Check available agent providers (claude, codex, tour) |
284285
| `/api/agents/jobs/stream` | GET | SSE stream for real-time agent job status updates |
285286
| `/api/agents/jobs` | GET | Snapshot of agent jobs (polling fallback, `?since=N` for version gating) |
286287
| `/api/agents/jobs` | POST | Launch an agent job (body: `{ provider, command, label }`) |
287288
| `/api/agents/jobs` | DELETE | Kill all running agent jobs |
288289
| `/api/agents/jobs/:id` | DELETE | Kill a specific agent job |
290+
| `/api/tour/:jobId` | GET | Fetch Code Tour result (greeting, stops, checklist) for a completed tour job |
291+
| `/api/tour/:jobId/checklist` | PUT | Persist checklist item state for a Code Tour |
289292

290293
### Annotate Server (`packages/server/annotate.ts`)
291294

@@ -387,10 +390,11 @@ interface Annotation {
387390

388391
interface Block {
389392
id: string;
390-
type: "paragraph" | "heading" | "blockquote" | "list-item" | "code" | "hr";
393+
type: "paragraph" | "heading" | "blockquote" | "list-item" | "code" | "hr" | "table" | "html" | "directive";
391394
content: string;
392395
level?: number; // For headings (1-6)
393396
language?: string; // For code blocks
397+
alertKind?: "note" | "tip" | "warning" | "caution" | "important"; // GitHub alerts (blockquote subtype)
394398
order: number;
395399
startLine: number;
396400
}
@@ -402,12 +406,15 @@ interface Block {
402406

403407
`parseMarkdownToBlocks(markdown)` splits markdown into Block objects. Handles:
404408

405-
- Headings (`#`, `##`, etc.)
409+
- Headings (`#`, `##`, etc.) with slug-derived anchor ids
406410
- Code blocks (``` with language extraction)
407411
- List items (`-`, `*`, `1.`)
408-
- Blockquotes (`>`)
412+
- Blockquotes (`>`) — including GitHub alerts (`> [!NOTE|TIP|WARNING|CAUTION|IMPORTANT]`) which set `alertKind`
409413
- Horizontal rules (`---`)
410-
- Paragraphs (default)
414+
- Tables (pipe-delimited) — rendered via `TableBlock` with a `TableToolbar` (copy as markdown/CSV) and `TablePopout` overlay
415+
- Raw HTML blocks (`<details>`, `<summary>`, etc.) — rendered via `HtmlBlock` through `marked` + DOMPurify
416+
- Directive containers (`:::kind ... :::`) — rendered via `Callout`
417+
- Paragraphs (default) with inline extras: bare URL autolinks, `@mentions` / `#issue-refs`, emoji shortcodes, smart punctuation
411418

412419
`exportAnnotations(blocks, annotations, globalAttachments)` generates human-readable feedback for Claude. Images are referenced by name: `[image-name] /tmp/path...`. Annotations with `diffContext` include `[In diff content]` labels.
413420

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Interactive Plan & Code Review for AI Coding Agents. Mark up and refine your pla
3535
<tr><td><strong>Visual Plan Review</strong></td><td>Built-in hook</td><td>Approve or deny agent plans with inline annotations</td></tr>
3636
<tr><td><strong>Plan Diff</strong></td><td>Automatic</td><td>See what changed when the agent revises a plan</td></tr>
3737
<tr><td><strong>Code Review</strong></td><td><code>/plannotator-review</code></td><td>View git diffs or remote PRs. Package annotations and ask AI about the code as you review.</td></tr>
38-
<tr><td><strong>Annotate Any File</strong></td><td><code>/plannotator-annotate</code></td><td>Annotate any markdown file and send feedback to your agent</td></tr>
38+
<tr><td><strong>Annotate Any File</strong></td><td><code>/plannotator-annotate &lt;file|folder|url&gt;</code></td><td>Annotate markdown, HTML, URLs, or folders and send feedback to your agent</td></tr>
3939
<tr><td><strong>Annotate Last Message</strong></td><td><code>/plannotator-last</code></td><td>Annotate the agent's last response and send structured feedback</td></tr>
4040
</table>
4141

apps/copilot/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "plannotator-copilot",
33
"description": "Interactive Plan & Code Review for GitHub Copilot CLI. Visual annotations, team sharing, structured feedback.",
4-
"version": "0.17.10",
4+
"version": "0.19.0",
55
"author": { "name": "backnotprop" },
66
"repository": "https://github.com/backnotprop/plannotator",
77
"license": "MIT OR Apache-2.0",

apps/hook/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "plannotator",
33
"description": "Interactive Plan Review: Mark up and refine your plans using a UI, easily share for team collaboration, automatically integrates with plan mode hooks.",
4-
"version": "0.17.10",
4+
"version": "0.19.0",
55
"author": {
66
"name": "backnotprop"
77
},

apps/hook/commands/plannotator-annotate.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
description: Open interactive annotation UI for a markdown file or folder
33
allowed-tools: Bash(plannotator:*)
4+
disable-model-invocation: true
45
---
56

67
## Markdown Annotations

apps/hook/commands/plannotator-archive.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
description: Browse saved plan decisions in the archive
33
allowed-tools: Bash(plannotator:*)
4+
disable-model-invocation: true
45
---
56

67
## Plan Archive

apps/hook/commands/plannotator-last.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
description: Annotate the last rendered assistant message
33
allowed-tools: Bash(plannotator:*)
4+
disable-model-invocation: true
45
---
56

67
## Message Annotations

apps/hook/commands/plannotator-review.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
description: Open interactive code review for current changes or a PR URL
33
allowed-tools: Bash(plannotator:*)
4+
disable-model-invocation: true
45
---
56

67
## Code Review Feedback

0 commit comments

Comments
 (0)