Files
danyaberezun fbc0abf25d feat(session-insights): analyze pi sessions locally in a Session insights panel and an /insights command
Generic extension SDK additions:
- extension.query: a request/response wire method answered by an extension's server half, with
  per-extension host services (sessions, history records, artifacts writes) resolved by the host.
- Web extension panels declared by a web extension and rendered in a generic extension center tab,
  opened from the palette (view.extension.<ext>.<panel>), with a PanelHost that lets a panel open a
  session, jump to a tool call in the chat transcript (exact or nearest-row fallback), reveal the
  Artifacts tool and query its server half.
- supersedesPackages so a bundled extension can replace the pi package it wraps.
- Palette roles in colors.json for charts and categorical series; TreeRow (with useTreeItem, the
  item half of the app's keyboard tree model), DiffStatBadge and folderChains move to @thinkrail/ui so
  extension web halves can reuse them.
- extension.list reports hasParentExtensions, so an empty tool list reads as "queries only by design"
  rather than "its factories failed to load"; the binary and desktop smokes require tools only from
  extensions that compose factories and run a query probe for every extension that declares an
  apiVersion (session-insights' sessions.list must list the smoke's own chat).

Portable core @thinkrail/pi-session-insights (pi-extensions/session-insights): streaming parse,
incremental session index, pi-recorded totals mirror, subagent join and cost provenance; trace,
turns, actor timeline and day view; subagent waves, plans, error chains, context and cache per call,
cost explanations, files matrix, cross-session findings, usage, hotspots, sequences, comparisons,
search, labels and notes; HTML, Chrome-trace and e2e-fixture exports; and an /insights command for
vanilla pi. Publish-ready but not published.

The session-insights ThinkRail extension (thinkrail-extensions/session-insights) wires the core into
a Session insights panel with no-agent e2e coverage. Its panel keys (/ search, n/N, e/E, r/R, z and
+/-/0 zoom) are local commands in one scope, rebindable in Settings → Keyboard, with the navigation
keys listed as its shortcuts; plain F stays hint mode's.

Review fixes: mask before diffing, labels never take a secret-named value, pending lookups during indexing, atomic export names.

Switching it off stops all of its work: one shared openable-panels rule hides its panels, palette
rows and entry points; ExtensionHostServices.signal aborts in-flight indexing and queries and drops
the query table; open chats reload when the superseded-package set changes;
PiPackageSummary.supersededBy names the bundled extension that replaces a pi package; bundled
extension titles are localized, and the keyboard cheatsheet gets a section per extension.

Entry points: PanelDeclaration.chatAction and rail let a panel declare a per-chat action and a
left-rail icon; Session insights opens from a chat header link, the chat tab menu, the Chats list ⋯
menu and recently closed list, and a left-rail icon with a rebindable Ctrl+Alt+I / ⌃⌥I.
2026-11-22 16:28:36 +01:00
..