Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e15b021
Forge tools: say why gh or glab could not answer, as one Problem in s…
backnotprop Nov 11, 2026
4be4c60
Inbox: the PR card shows the tool's state, with its one next step
backnotprop Nov 11, 2026
61641e8
Tests and guides for the tool states
backnotprop Nov 11, 2026
3a0a916
Problem card: the command wraps at its spaces, never mid-name
backnotprop Nov 11, 2026
e39dc4b
Inbox: a PR hover card closes only when the pointer moves off it
backnotprop Nov 11, 2026
aee6327
Inbox: a PR with no title yet is named short, never by its URL
backnotprop Nov 11, 2026
79a1b19
Inbox: Remove <PR> wraps inside the card and the phone's sheet
backnotprop Nov 11, 2026
9479850
Inbox: a PR hover card stays with its row when the list moves it
backnotprop Nov 11, 2026
9de3391
fix(ci): core 0.25.24 for the problem and problem-words subpaths
backnotprop Nov 11, 2026
f336ba2
Tests: the tool-state table puts only its fake on PATH
backnotprop Nov 11, 2026
e34ff03
Merge origin/fix/pull-marker-hover-hang into feat/inbox-tool-states
backnotprop Nov 11, 2026
ec19ef3
Merge origin/main into feat/inbox-tool-states
backnotprop Nov 11, 2026
bf23b61
Inbox: "Ask your agent to look" on the six gh / glab states
backnotprop Nov 11, 2026
9cf6253
Merge origin/main into feat/inbox-tool-states
backnotprop Nov 11, 2026
df79d3c
Tests: Ask your agent to look, signed-out gh to a sent thread on Slow 3G
backnotprop Nov 11, 2026
9136a06
Inbox: the PR card's problem actions are thumb-sized in the phone's s…
backnotprop Nov 11, 2026
19b1cbe
Inbox: a tool's line keeps the forge host the person saw, whichever r…
backnotprop Nov 11, 2026
f25c193
Merge origin/main into feat/inbox-tool-states
backnotprop Nov 11, 2026
99a46c4
Merge remote-tracking branch 'origin/main' into feat/inbox-tool-states
backnotprop Nov 16, 2026
1c919cc
Inbox: the six tool states in short words; a host with no login is ne…
backnotprop Nov 16, 2026
220ff9e
Merge remote-tracking branch 'origin/main' into feat/inbox-tool-states
backnotprop Nov 16, 2026
0f85a0f
Tests: the Ask your agent to look spec pins the relay and takes test …
backnotprop Nov 16, 2026
238c9db
Merge remote-tracking branch 'origin/main' into feat/inbox-tool-states
backnotprop Nov 16, 2026
ccb4bb9
Merge remote-tracking branch 'origin/main' into feat/inbox-tool-states
backnotprop Nov 16, 2026
d07ccb8
Pull request cards: commands name only hosts the person uses; Try aga…
backnotprop Nov 16, 2026
b4ad2c6
Merge remote-tracking branch 'origin/main' into feat/inbox-tool-states
backnotprop Nov 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/pi-extension/vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bun ../guides-show/build/sync-manifest.ts --if-missing
mkdir -p generated generated/ai/providers

# Modules that MOVED to @plannotator/core — vendor the real impl from core.
for f in feedback-templates project diff-type file-kind review-prompt guide-prompt favicon favicon-style forge-refs code-file annotatable annotation-threads diagram-anchor image-region html-anchor markdown-structure question-block text-cut inline-markdown server-session external-annotation agent-jobs agent-switch agent-terminal source-save open-in-apps diff-paths diff-files guide guide-notes guide-format guide-viewer-manifest compress crypto package-changes package-changes-npm forge-ref-card; do
for f in feedback-templates project diff-type file-kind review-prompt guide-prompt favicon favicon-style forge-refs code-file annotatable annotation-threads diagram-anchor image-region html-anchor markdown-structure question-block text-cut inline-markdown server-session external-annotation agent-jobs agent-switch agent-terminal source-save open-in-apps diff-paths diff-files guide guide-notes guide-format guide-viewer-manifest compress crypto package-changes package-changes-npm forge-ref-card problem problem-words; do
src="../../packages/core/$f.ts"
printf '// @generated — DO NOT EDIT. Source: packages/core/%s.ts\n' "$f" | cat - "$src" > "generated/$f.ts"
done
Expand All @@ -32,7 +32,7 @@ for f in config-types storage-types workspace-status-types; do
done

# Everything else in the original flat list stays sourced from packages/shared.
for f in child-env annotate-bundle plannotator-tool prompts review-core repo-files repo-files-node fuzzy-path review-image review-markdown-image review-progress generated-files feedback-archive cli-pagination jj-core gitbutler-core vcs-core review-args advertised-url review-open-state draft review-draft annotate-draft annotate-history annotate-live-version pr-types pr-context-live pr-artifact-document pr-marked pr-gitlab-versions pr-provider pr-stack pr-gitlab-stack pr-github pr-github-account pr-gitlab pr-gitlab-file-threads pr-bitbucket checklist integrations-common notion repo reference-common markdown-extensions resolve-file doc-resolve file-browser-watch-core file-browser-files annotate-reference-roots-node worktree worktree-pool html-to-markdown html-diff html-assets html-assets-node open-in-locate app-html packed-app diagram-engine-assets url-to-markdown tour annotate-args annotate-target at-reference review-workspace-node review-workspace pfm-reminder improvement-hooks code-nav repo-file data-dir semantic-diff-types semantic-diff call-flow-types call-flow-languages call-flow-pack-locks call-flow-install-lock call-flow call-flow-install single-flight source-save-node review-profiles guide-store guide-instructions-store commit-avatars commit-history port-range annotate-client-lease annotate-decision archive-mode tailscale live-proxy-port plannotator-server-marker plannotator-ports live-proxy-core live-probe live-proxy-node loopback-host loopback-proxy tailnet-audience this-machine-reader reference-reader host-control request-origin request-host path-segment local-image update-check daily-ping star-ask browser-intent agent-program package-metadata package-changes-service ref-cards ref-cards-node; do
for f in child-env annotate-bundle plannotator-tool prompts review-core repo-files repo-files-node fuzzy-path review-image review-markdown-image review-progress generated-files feedback-archive cli-pagination jj-core gitbutler-core vcs-core review-args advertised-url review-open-state draft review-draft annotate-draft annotate-history annotate-live-version pr-types pr-context-live pr-artifact-document pr-marked pr-gitlab-versions pr-provider pr-stack pr-gitlab-stack pr-github pr-github-account pr-gitlab pr-gitlab-file-threads pr-bitbucket checklist integrations-common notion repo reference-common markdown-extensions resolve-file doc-resolve file-browser-watch-core file-browser-files annotate-reference-roots-node worktree worktree-pool html-to-markdown html-diff html-assets html-assets-node open-in-locate app-html packed-app diagram-engine-assets url-to-markdown tour annotate-args annotate-target at-reference review-workspace-node review-workspace pfm-reminder improvement-hooks code-nav repo-file data-dir semantic-diff-types semantic-diff call-flow-types call-flow-languages call-flow-pack-locks call-flow-install-lock call-flow call-flow-install single-flight source-save-node review-profiles guide-store guide-instructions-store commit-avatars commit-history port-range annotate-client-lease annotate-decision archive-mode tailscale live-proxy-port plannotator-server-marker plannotator-ports live-proxy-core live-probe live-proxy-node loopback-host loopback-proxy tailnet-audience this-machine-reader reference-reader host-control request-origin request-host path-segment local-image update-check daily-ping star-ask browser-intent agent-program package-metadata package-changes-service ref-cards ref-cards-node tool-state; do
src="../../packages/shared/$f.ts"
# Shared modules that import browser-safe siblings from @plannotator/core
# (e.g. guide-store → core/guide-format): generated/ is flat and vendors the
Expand Down
4 changes: 2 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/agent-guides/guides-and-shared-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ The Inbox's issue / PR / MR hover cards (#2187; see "Hover cards for issue, PR a

- **No change for anyone without gh / glab, offline, or on an older server.** Both apps render `<RefHoverCards rootRef={…} onlyWithData />` (`packages/ui/components/RefHoverCard.tsx`) on their root element: a card opens only once the forge answered (`ok`), with no loading skeleton and no failure card (the Inbox keeps both); a hover that leaves first shows nothing; a tap on a touch screen follows the link as before (no sheet). Links render and link exactly as before.
- **The transport.** `refCardRouteTransport('/api/ref')` (`packages/ui/utils/refCard.ts`): installed by the plan / annotate app once `/api/plan` answered (never for a share link, so the static portal asks nothing) and by the review app once `/api/diff` answered (never in the demo). A `404` (an older server without the route, or the route off) turns the transport off for the page, so a second hover asks nothing.
- **The route.** `GET /api/ref?url=` on the plan, annotate and review servers of both runtimes (Server API tables in `server-and-storage.md`): the Inbox's answer plus `serverSession`. One module for both runtimes, `packages/shared/ref-cards.ts` (vendored to Pi): the queries, parsers, the per-ref cache (fresh 60 s, a failure 30 s; bounded, see the fetch in `inbox-window.md`), the hosts rule (github.com, gitlab.com and hosts gh / glab report `state: success` for), `--hostname` on every call, and `handleRefCardRoute`. The runner is the runtime's: Bun's `Bun.spawn` (`packages/server/ref-cards.ts`, which the Inbox uses too) and Node's `child_process.spawn` (`packages/shared/ref-cards-node.ts`, vendored to Pi; no shell, 127 when the CLI is missing). Both runners keep one contract: a hard deadline at 8 s (`REF_TIMEOUT_MS`) that ends the CLI and everything it started (its own process group on POSIX: TERM, then KILL after `REF_KILL_GRACE_MS`, `refRunnerKill`) and answers at once (`<cli>: timed out`), and a CLI that exited while a child still holds its pipes is answered `REF_DRAIN_MS` later with what it printed. Every reader's concurrency goes through `createRefSlots`: a slot is given back after `REF_SLOT_HOLD_MS` whatever its job does, and a queue with no slot given back for `REF_QUEUE_STALL_MS` refuses its waiting jobs (answered `unavailable`, never cached). Why: current glab turns TERM into a cancel, and a wrapper's real program outlives a TERM to the wrapper; the old Bun runner then never settled and held a slot for good. One cache per server; nothing runs before a hover. Tests inject `refRunner` on every server's options.
- **The route.** `GET /api/ref?url=` on the plan, annotate and review servers of both runtimes (Server API tables in `server-and-storage.md`): the Inbox's answer plus `serverSession`. One module for both runtimes, `packages/shared/ref-cards.ts` (vendored to Pi): the queries, parsers, the per-ref cache (fresh 60 s, a failure 30 s; bounded, see the fetch in `inbox-window.md`), the hosts rule (github.com, gitlab.com and hosts gh / glab report `state: success` for), `--hostname` on every call, and `handleRefCardRoute`. The runner is the runtime's: Bun's `Bun.spawn` (`packages/server/ref-cards.ts`, which the Inbox uses too) and Node's `child_process.spawn` (`packages/shared/ref-cards-node.ts`, vendored to Pi; no shell, 127 when the CLI is missing). Both runners keep one contract: a hard deadline at 8 s (`REF_TIMEOUT_MS`) that ends the CLI and everything it started (its own process group on POSIX: TERM, then KILL after `REF_KILL_GRACE_MS`, `refRunnerKill`) and answers at once (`<cli>: timed out`), and a CLI that exited while a child still holds its pipes is answered `REF_DRAIN_MS` later with what it printed. Every reader's concurrency goes through `createRefSlots`: a slot is given back after `REF_SLOT_HOLD_MS` whatever its job does, and a queue with no slot given back for `REF_QUEUE_STALL_MS` refuses its waiting jobs (answered `unavailable`, never cached). Why: current glab turns TERM into a cancel, and a wrapper's real program outlives a TERM to the wrapper; the old Bun runner then never settled and held a slot for good. One cache per server; nothing runs before a hover. Tests inject `refRunner` on every server's options. A failed card carries `problem` beside `error` (both runtimes, from `packages/shared/tool-state.ts`; the runners mark a deadline with `timedOut`): the tool's state in the words of `packages/core/problem-words.ts`, refined without waiting by the status check's cached answer. `RefCardView` draws it with `ProblemNotice` (additive, `packages/ui/components/ProblemNotice.tsx`: icon, bold line, muted line, one action with Copy); an older server's bare `error` reads as the same words (`cardProblem`). `unsupported` keeps its own line.
- **Exposure: this machine and the tailnet owner only.** The route answers `404 ref_cards_disabled` in remote mode (both runtimes): anyone who reaches the URL could otherwise make this computer run the user's gh / glab and read private issues through their credentials. In a `--tailscale` session (Bun annotate and review; plan review and Pi have no `--tailscale`) it decides per request with the gate "Ask this session" uses (`refCardsTailnetAllowed` in `packages/server/ref-cards.ts`, `sessionTailnetAskAllowed`): a tab on this machine (`sessionTailnetAudience` `local`) and the tailnet owner's tab through `tailscale serve` with the served name and port as Host get cards (where Tailscale names no owner, a login in `inboxTailscaleAllow` is the owner; the CLI reads the owner for every `--tailscale` session, with or without an "Ask this session" bridge); any other tailnet device never gets this far: the session refuses it before any route (`refuseTailnetPeer`), as the Inbox gives the owner `/api/inbox/ref` and never the device door. Otherwise the global guards hold (the Host allowlist answers first), and another site's read is `403 cross_origin` (`isSameOriginOrNoOrigin`, as the Inbox's read routes), so a page on another site cannot time or drive lookups.
- **Beside the token hover cards.** Code review's token hover cards (`/api/code-nav/hover`) listen on code tokens in the diff views (Pierre's shadow DOM, never an `a[href]`); ref cards listen for `a[href]` naming a forge ref. They never share an element, and each closes on its own Escape.
- Tests: `packages/server/ref-card-route.scenarios.ts` run by `packages/server/ref-card-route.test.ts` (Bun) and `apps/pi-extension/server/ref-card-route.test.ts` (Pi), with a scripted runner (the card, the cache, `--hostname`, another site, a foreign Host, a bad url, POST, remote mode, and under `--tailscale` a local tab and the owner answered, every other tailnet device refused); `apps/pi-extension/server/ref-cards-node.test.ts` (the Node runner against a scripted `gh` alone on PATH); the DOM test `packages/editor/App.refCards.test.tsx` (a plan's `#12` shows its card, nothing asked before a hover, no card without gh, a `404` asked once); `tests/e2e/ref-cards-review.spec.ts` (compiled binary with `tests/e2e/fake-forge.ts` on PATH, plan review, annotate and code review on hover, and in plan review the keyboard (Tab to the link opens it, Tab moves in, Escape closes it, returns the focus and stops there) and a touch tap (follows the link, no card, no CLI); `PLANNOTATOR_REF_CARD_REVIEW_SHOTS` keeps screenshots).
Expand Down
Loading