pmx-canvas 0.8.2 → 0.9.0

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 (335) hide show
  1. package/.github/extensions/pmx-canvas/runtime.json +1 -1
  2. package/.github/extensions/pmx-canvas/tools.json +601 -22
  3. package/CHANGELOG.md +49 -0
  4. package/Readme.md +131 -532
  5. package/dist/canvas/global.css +2724 -476
  6. package/dist/canvas/index.js +168 -107
  7. package/dist/canvas/mcp-app.html +2899 -596
  8. package/dist/json-render/index.js +20 -20
  9. package/dist/types/client/canvas/BarHint.d.ts +12 -2
  10. package/dist/types/client/canvas/BoardLinkDialog.d.ts +3 -1
  11. package/dist/types/client/canvas/BoardPinButton.d.ts +10 -0
  12. package/dist/types/client/canvas/BoardSwitcher.d.ts +1 -1
  13. package/dist/types/client/canvas/CanvasViewport.d.ts +1 -1
  14. package/dist/types/client/canvas/CommandBar.d.ts +3 -4
  15. package/dist/types/client/canvas/ConnectionBanner.d.ts +2 -1
  16. package/dist/types/client/canvas/ContextChip.d.ts +3 -0
  17. package/dist/types/client/canvas/CrossBoardReferences.d.ts +5 -0
  18. package/dist/types/client/canvas/EdgeLayer.d.ts +14 -3
  19. package/dist/types/client/canvas/EmptyState.d.ts +4 -4
  20. package/dist/types/client/canvas/HomeGraphView.d.ts +2 -0
  21. package/dist/types/client/canvas/HomeMapView.d.ts +1 -0
  22. package/dist/types/client/canvas/HomeReviewView.d.ts +6 -0
  23. package/dist/types/client/canvas/HomeView.d.ts +9 -7
  24. package/dist/types/client/canvas/KnowledgeDialog.d.ts +4 -0
  25. package/dist/types/client/canvas/LifecycleChrome.d.ts +5 -0
  26. package/dist/types/client/canvas/LifecycleFields.d.ts +7 -0
  27. package/dist/types/client/canvas/LifecyclePanel.d.ts +1 -0
  28. package/dist/types/client/canvas/MemoryInspector.d.ts +7 -0
  29. package/dist/types/client/canvas/NearPinLayer.d.ts +14 -0
  30. package/dist/types/client/canvas/NodeContextMark.d.ts +40 -7
  31. package/dist/types/client/canvas/RelationPresetsDialog.d.ts +4 -0
  32. package/dist/types/client/canvas/RelationsPanel.d.ts +4 -0
  33. package/dist/types/client/canvas/SessionPanel.d.ts +2 -0
  34. package/dist/types/client/canvas/canvas-area.d.ts +1 -1
  35. package/dist/types/client/canvas/graph-geometry.d.ts +27 -0
  36. package/dist/types/client/canvas/graph-model.d.ts +37 -0
  37. package/dist/types/client/canvas/memory-layout.d.ts +23 -0
  38. package/dist/types/client/canvas/use-chrome-height.d.ts +2 -0
  39. package/dist/types/client/canvas/use-focus-trap.d.ts +1 -0
  40. package/dist/types/client/canvas/use-memory-graph.d.ts +8 -0
  41. package/dist/types/client/canvas/use-pan-zoom.d.ts +4 -1
  42. package/dist/types/client/icons.d.ts +0 -10
  43. package/dist/types/client/nodes/AxStepControls.d.ts +1 -1
  44. package/dist/types/client/nodes/InlineMarkdownEditor.d.ts +4 -4
  45. package/dist/types/client/nodes/MarkdownNode.d.ts +5 -1
  46. package/dist/types/client/nodes/McpAppNode.d.ts +4 -4
  47. package/dist/types/client/nodes/viewer-runtime-state.d.ts +1 -1
  48. package/dist/types/client/state/boards-store.d.ts +81 -9
  49. package/dist/types/client/state/canvas-store.d.ts +14 -1
  50. package/dist/types/client/state/context-chip-store.d.ts +22 -0
  51. package/dist/types/client/state/context-status-store.d.ts +35 -0
  52. package/dist/types/client/state/intent-bridge.d.ts +11 -8
  53. package/dist/types/client/state/knowledge-store.d.ts +22 -0
  54. package/dist/types/client/state/near-pin-store.d.ts +44 -1
  55. package/dist/types/client/state/presence-store.d.ts +4 -4
  56. package/dist/types/client/state/presentation.d.ts +28 -0
  57. package/dist/types/client/state/relation-store.d.ts +10 -0
  58. package/dist/types/client/state/session-store.d.ts +41 -2
  59. package/dist/types/client/state/workspace-settings.d.ts +7 -0
  60. package/dist/types/client/types.d.ts +13 -1
  61. package/dist/types/client/utils/keyboard.d.ts +2 -0
  62. package/dist/types/client/utils/time-ago.d.ts +4 -0
  63. package/dist/types/mcp/context-uri-template.d.ts +3 -1
  64. package/dist/types/server/agent-presence.d.ts +10 -3
  65. package/dist/types/server/ax-context.d.ts +1 -1
  66. package/dist/types/server/canvas-db.d.ts +30 -7
  67. package/dist/types/server/canvas-operations.d.ts +24 -2
  68. package/dist/types/server/canvas-provenance.d.ts +22 -2
  69. package/dist/types/server/canvas-serialization.d.ts +2 -0
  70. package/dist/types/server/canvas-state.d.ts +93 -15
  71. package/dist/types/server/canvas-validation.d.ts +1 -1
  72. package/dist/types/server/context-brief.d.ts +94 -6
  73. package/dist/types/server/context-reads.d.ts +33 -7
  74. package/dist/types/server/edit-summary.d.ts +20 -0
  75. package/dist/types/server/index.d.ts +71 -10
  76. package/dist/types/server/knowledge-lifecycle.d.ts +221 -0
  77. package/dist/types/server/lifecycle-status.d.ts +10 -0
  78. package/dist/types/server/memory-graph.d.ts +9 -0
  79. package/dist/types/server/mutation-history.d.ts +2 -0
  80. package/dist/types/server/operations/ops/ax-shared.d.ts +1 -1
  81. package/dist/types/server/operations/ops/boards.d.ts +2 -1
  82. package/dist/types/server/operations/ops/lifecycle.d.ts +2 -0
  83. package/dist/types/server/operations/ops/memory-graph.d.ts +2 -0
  84. package/dist/types/server/operations/ops/nodes.d.ts +5 -0
  85. package/dist/types/server/operations/ops/query.d.ts +23 -0
  86. package/dist/types/server/operations/registry.d.ts +1 -0
  87. package/dist/types/server/placement.d.ts +7 -0
  88. package/dist/types/server/scope-fence.d.ts +2 -1
  89. package/dist/types/server/spatial-analysis.d.ts +6 -3
  90. package/dist/types/server/tour-control.d.ts +32 -0
  91. package/dist/types/server/wiki-links.d.ts +14 -0
  92. package/dist/types/server/workbench-auth.d.ts +2 -0
  93. package/dist/types/shared/agent-context.d.ts +2 -0
  94. package/dist/types/shared/agent-presence.d.ts +15 -12
  95. package/dist/types/shared/auto-arrange.d.ts +1 -0
  96. package/dist/types/shared/boards.d.ts +4 -4
  97. package/dist/types/shared/knowledge-lifecycle.d.ts +41 -0
  98. package/dist/types/shared/knowledge-presets.d.ts +6 -0
  99. package/dist/types/shared/lifecycle-status.d.ts +24 -0
  100. package/dist/types/shared/memory-graph.d.ts +53 -0
  101. package/dist/types/shared/relations.d.ts +68 -0
  102. package/dist/types/shared/semantic-attention.d.ts +2 -0
  103. package/dist/types/shared/tour.d.ts +38 -0
  104. package/dist/types/shared/workspace-settings.d.ts +11 -0
  105. package/docs/RELEASE.md +21 -3
  106. package/docs/adr-001-bun-only-runtime.md +7 -1
  107. package/docs/adr-002-shared-product-separate-runtimes.md +93 -0
  108. package/docs/api-reference.md +109 -0
  109. package/docs/ax-host-adapter-contract.md +1 -1
  110. package/docs/ax-state-contract.md +5 -4
  111. package/docs/cli.md +153 -15
  112. package/docs/demos/pmx-canvas-demo.mp4 +0 -0
  113. package/docs/design/AgentContext.dc.html +3 -3
  114. package/docs/design/BoardPins.dc.html +37 -22
  115. package/docs/design/Categories.dc.html +208 -0
  116. package/docs/design/CategoryEditor.dc.html +33 -0
  117. package/docs/design/Chrome.dc.html +52 -9
  118. package/docs/design/ContextChip.dc.html +224 -0
  119. package/docs/design/ContextChip600.dc.html +136 -0
  120. package/docs/design/EmptyState.dc.html +45 -0
  121. package/docs/design/Flows.dc.html +23 -1
  122. package/docs/design/HeaderMarks.dc.html +183 -0
  123. package/docs/design/Home.dc.html +19 -1
  124. package/docs/design/HomeGraph.dc.html +86 -202
  125. package/docs/design/HomeMap.dc.html +23 -1
  126. package/docs/design/HomeTeam.dc.html +32 -14
  127. package/docs/design/Lifecycle.dc.html +22 -0
  128. package/docs/design/Lifecycle600.dc.html +18 -0
  129. package/docs/design/LifecycleVariants.dc.html +157 -0
  130. package/docs/design/LinkAuthorship.dc.html +139 -0
  131. package/docs/design/LinksChanged.dc.html +203 -0
  132. package/docs/design/LinksOptions.dc.html +137 -0
  133. package/docs/design/LinksOptions600.dc.html +134 -0
  134. package/docs/design/NearPin.dc.html +9 -10
  135. package/docs/design/Pane600.dc.html +4 -3
  136. package/docs/design/Relations.dc.html +3 -2
  137. package/docs/design/Restore.dc.html +152 -0
  138. package/docs/design/SeeChange.dc.html +267 -0
  139. package/docs/design/Uses.dc.html +12 -6
  140. package/docs/design/canvas.json +146 -19
  141. package/docs/design.md +449 -16
  142. package/docs/environment.md +0 -1
  143. package/docs/evals/curation-effect.md +128 -0
  144. package/docs/http-api.md +459 -37
  145. package/docs/mcp.md +146 -18
  146. package/docs/node-types.md +58 -3
  147. package/docs/plans/design-gaps-2026-10-08.md +53 -0
  148. package/docs/plans/plan-009-tech-debt-backlog.md +379 -0
  149. package/docs/plans/plan-016-context-made-visible-wave-1.md +150 -5
  150. package/docs/plans/plan-017-knowledge-categories-and-lifecycle.md +175 -0
  151. package/docs/plans/plan-018-connected-memory-wave-2.md +594 -0
  152. package/docs/plans/plan-019-post-0.9-roadmap.md +198 -0
  153. package/docs/product-context-vision-2026-09.md +17 -1
  154. package/docs/product-vision-2026-09.md +1082 -43
  155. package/docs/product-vision-review-2026-09.md +13 -1
  156. package/docs/screenshots/workbench-live-dark.png +0 -0
  157. package/docs/screenshots/workbench-live-light.png +0 -0
  158. package/docs/sdk.md +62 -2
  159. package/package.json +1 -1
  160. package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/runtime.json +1 -1
  161. package/plugins/pmx-canvas/plugin.json +1 -1
  162. package/plugins/pmx-canvas/runtime.json +1 -1
  163. package/plugins/pmx-canvas/tools.json +601 -22
  164. package/skills/pmx-canvas/SKILL.md +216 -42
  165. package/skills/pmx-canvas/references/full-reference.md +120 -21
  166. package/skills/pmx-canvas/references/github-copilot-app-adapter.md +2 -2
  167. package/skills/pmx-canvas/references/importing-context.md +132 -0
  168. package/skills/pmx-canvas/references/installing-pmx-canvas.md +6 -6
  169. package/skills/pmx-canvas/references/tours-and-recording.md +16 -1
  170. package/skills/pmx-canvas-testing/SKILL.md +20 -0
  171. package/src/cli/agent.ts +2 -0
  172. package/src/cli/commands/ax.ts +12 -0
  173. package/src/cli/commands/boards.ts +87 -11
  174. package/src/cli/commands/edges.ts +28 -0
  175. package/src/cli/commands/groups.ts +7 -0
  176. package/src/cli/commands/nodes.ts +1 -0
  177. package/src/cli/commands/query.ts +34 -2
  178. package/src/cli/commands/record.ts +199 -48
  179. package/src/cli/index.ts +6 -1
  180. package/src/client/App.tsx +177 -70
  181. package/src/client/canvas/AttentionHistory.tsx +0 -2
  182. package/src/client/canvas/BarHint.tsx +40 -2
  183. package/src/client/canvas/BoardCopyDialog.tsx +1 -1
  184. package/src/client/canvas/BoardFolderDialog.tsx +7 -7
  185. package/src/client/canvas/BoardLinkDialog.tsx +138 -33
  186. package/src/client/canvas/BoardPinButton.tsx +33 -0
  187. package/src/client/canvas/BoardSwitcher.tsx +26 -40
  188. package/src/client/canvas/CanvasNode.tsx +360 -237
  189. package/src/client/canvas/CanvasViewport.tsx +45 -7
  190. package/src/client/canvas/CommandBar.tsx +29 -23
  191. package/src/client/canvas/CommandPalette.tsx +5 -12
  192. package/src/client/canvas/ConnectionBanner.tsx +3 -3
  193. package/src/client/canvas/ContextChip.tsx +296 -0
  194. package/src/client/canvas/ContextMenu.tsx +63 -5
  195. package/src/client/canvas/CrossBoardReferences.tsx +60 -0
  196. package/src/client/canvas/EdgeLayer.tsx +339 -76
  197. package/src/client/canvas/EmptyState.tsx +33 -18
  198. package/src/client/canvas/ExpandedNodeOverlay.tsx +72 -40
  199. package/src/client/canvas/ExternalWriters.tsx +57 -42
  200. package/src/client/canvas/HomeGraphView.tsx +942 -0
  201. package/src/client/canvas/HomeMapView.tsx +641 -0
  202. package/src/client/canvas/HomeReviewView.tsx +167 -0
  203. package/src/client/canvas/HomeView.tsx +687 -160
  204. package/src/client/canvas/IntentLayer.tsx +19 -12
  205. package/src/client/canvas/KnowledgeDialog.tsx +488 -0
  206. package/src/client/canvas/LifecycleChrome.tsx +133 -0
  207. package/src/client/canvas/LifecycleFields.tsx +91 -0
  208. package/src/client/canvas/LifecyclePanel.tsx +533 -0
  209. package/src/client/canvas/MemoryInspector.tsx +104 -0
  210. package/src/client/canvas/Minimap.tsx +3 -3
  211. package/src/client/canvas/NearPinLayer.tsx +187 -0
  212. package/src/client/canvas/NodeContextMark.tsx +175 -97
  213. package/src/client/canvas/Presentation.tsx +23 -57
  214. package/src/client/canvas/RelationPresetsDialog.tsx +413 -0
  215. package/src/client/canvas/RelationsPanel.tsx +82 -0
  216. package/src/client/canvas/SelectionBar.tsx +3 -6
  217. package/src/client/canvas/SessionPanel.tsx +90 -50
  218. package/src/client/canvas/SessionReceipt.tsx +311 -39
  219. package/src/client/canvas/ShortcutOverlay.tsx +1 -1
  220. package/src/client/canvas/SnapshotPanel.tsx +27 -36
  221. package/src/client/canvas/ToolRail.tsx +367 -192
  222. package/src/client/canvas/TopBar.tsx +354 -124
  223. package/src/client/canvas/canvas-area.ts +10 -3
  224. package/src/client/canvas/graph-geometry.ts +195 -0
  225. package/src/client/canvas/graph-model.ts +254 -0
  226. package/src/client/canvas/memory-layout.ts +106 -0
  227. package/src/client/canvas/use-chrome-height.ts +20 -0
  228. package/src/client/canvas/use-focus-trap.ts +31 -5
  229. package/src/client/canvas/use-memory-graph.ts +58 -0
  230. package/src/client/canvas/use-node-drag.ts +2 -1
  231. package/src/client/canvas/use-pan-zoom.ts +64 -7
  232. package/src/client/icons.tsx +0 -63
  233. package/src/client/mcp-app/style.css +0 -6
  234. package/src/client/nodes/AxStepControls.tsx +74 -50
  235. package/src/client/nodes/BoardNode.tsx +5 -1
  236. package/src/client/nodes/ContextNode.tsx +18 -11
  237. package/src/client/nodes/ExtAppFrame.tsx +0 -1
  238. package/src/client/nodes/FileNode.tsx +46 -42
  239. package/src/client/nodes/HtmlNode.tsx +32 -0
  240. package/src/client/nodes/ImageNode.tsx +1 -1
  241. package/src/client/nodes/InlineFormatBar.tsx +6 -9
  242. package/src/client/nodes/InlineMarkdownEditor.tsx +56 -17
  243. package/src/client/nodes/MarkdownNode.tsx +377 -109
  244. package/src/client/nodes/McpAppNode.tsx +50 -20
  245. package/src/client/nodes/MdFormatBar.tsx +21 -18
  246. package/src/client/nodes/PromptNode.tsx +1 -1
  247. package/src/client/nodes/ResponseNode.tsx +1 -1
  248. package/src/client/nodes/viewer-runtime-state.ts +54 -22
  249. package/src/client/state/attention-bridge.ts +64 -15
  250. package/src/client/state/boards-store.ts +193 -39
  251. package/src/client/state/canvas-store.ts +99 -12
  252. package/src/client/state/context-chip-store.ts +70 -0
  253. package/src/client/state/context-status-store.ts +53 -0
  254. package/src/client/state/intent-bridge.ts +51 -30
  255. package/src/client/state/knowledge-store.ts +43 -0
  256. package/src/client/state/near-pin-store.ts +115 -6
  257. package/src/client/state/presence-store.ts +7 -10
  258. package/src/client/state/presentation.ts +91 -0
  259. package/src/client/state/relation-store.ts +81 -0
  260. package/src/client/state/session-store.ts +144 -18
  261. package/src/client/state/sse-bridge.ts +206 -29
  262. package/src/client/state/workspace-settings.ts +11 -0
  263. package/src/client/theme/global.css +2724 -476
  264. package/src/client/types.ts +12 -0
  265. package/src/client/utils/keyboard.ts +10 -0
  266. package/src/client/utils/time-ago.ts +14 -0
  267. package/src/json-render/renderer/index.tsx +31 -0
  268. package/src/mcp/canvas-app.ts +12 -2
  269. package/src/mcp/context-uri-template.ts +7 -4
  270. package/src/mcp/server.ts +63 -41
  271. package/src/mcp/workbench-app.ts +39 -6
  272. package/src/server/agent-presence.ts +128 -28
  273. package/src/server/ax-context.ts +27 -13
  274. package/src/server/board-export.ts +12 -1
  275. package/src/server/canvas-db.ts +331 -42
  276. package/src/server/canvas-operations.ts +195 -83
  277. package/src/server/canvas-provenance.ts +53 -22
  278. package/src/server/canvas-serialization.ts +2 -0
  279. package/src/server/canvas-state.ts +950 -122
  280. package/src/server/canvas-validation.ts +9 -2
  281. package/src/server/context-brief.ts +345 -38
  282. package/src/server/context-reads.ts +178 -30
  283. package/src/server/demo-state.json +355 -24
  284. package/src/server/edit-summary.ts +74 -0
  285. package/src/server/html-surface.ts +8 -1
  286. package/src/server/index.ts +181 -11
  287. package/src/server/knowledge-lifecycle.ts +304 -0
  288. package/src/server/lifecycle-status.ts +232 -0
  289. package/src/server/memory-graph.ts +166 -0
  290. package/src/server/mutation-history.ts +18 -6
  291. package/src/server/operations/composites.ts +32 -11
  292. package/src/server/operations/http.ts +7 -2
  293. package/src/server/operations/index.ts +4 -0
  294. package/src/server/operations/mcp.ts +26 -1
  295. package/src/server/operations/ops/ax-presence.ts +1 -1
  296. package/src/server/operations/ops/ax-read.ts +57 -6
  297. package/src/server/operations/ops/ax-timeline.ts +28 -2
  298. package/src/server/operations/ops/backup.ts +5 -3
  299. package/src/server/operations/ops/batch.ts +35 -4
  300. package/src/server/operations/ops/boards.ts +188 -47
  301. package/src/server/operations/ops/canvas-wire.ts +31 -1
  302. package/src/server/operations/ops/edges.ts +36 -2
  303. package/src/server/operations/ops/groups.ts +6 -1
  304. package/src/server/operations/ops/lifecycle.ts +262 -0
  305. package/src/server/operations/ops/memory-graph.ts +45 -0
  306. package/src/server/operations/ops/nodes.ts +107 -24
  307. package/src/server/operations/ops/query.ts +281 -68
  308. package/src/server/operations/ops/snapshots.ts +73 -1
  309. package/src/server/operations/ops/validate.ts +5 -1
  310. package/src/server/operations/ops/viewport.ts +97 -3
  311. package/src/server/operations/registry.ts +74 -25
  312. package/src/server/placement.ts +29 -0
  313. package/src/server/scope-fence.ts +78 -6
  314. package/src/server/server.ts +115 -16
  315. package/src/server/spatial-analysis.ts +48 -23
  316. package/src/server/tour-control.ts +82 -0
  317. package/src/server/wiki-links.ts +137 -0
  318. package/src/server/workbench-auth.ts +11 -0
  319. package/src/shared/agent-context.ts +3 -0
  320. package/src/shared/agent-presence.ts +15 -15
  321. package/src/shared/auto-arrange.ts +2 -0
  322. package/src/shared/boards.ts +4 -4
  323. package/src/shared/knowledge-lifecycle.ts +22 -0
  324. package/src/shared/knowledge-presets.ts +80 -0
  325. package/src/shared/lifecycle-status.ts +26 -0
  326. package/src/shared/memory-graph.ts +74 -0
  327. package/src/shared/relations.ts +98 -0
  328. package/src/shared/semantic-attention.ts +15 -1
  329. package/src/shared/tour.ts +23 -5
  330. package/src/shared/workspace-settings.ts +13 -0
  331. package/dist/types/client/canvas/ContextPinBar.d.ts +0 -1
  332. package/dist/types/client/canvas/FocusFieldLayer.d.ts +0 -1
  333. package/dist/types/client/canvas/kind-colors.d.ts +0 -3
  334. package/dist/types/server/agent-context.d.ts +0 -22
  335. package/src/client/canvas/ContextPinBar.tsx +0 -25
@@ -1,48 +1,113 @@
1
+ import type { MemoryTarget } from '../../shared/memory-graph.js';
2
+ import type { RelationDefinition } from '../../shared/relations.js';
1
3
  /**
2
4
  * Many boards (plan 012): the workspace's boards and which one is open. The
3
5
  * server is the authority; this mirrors GET /api/canvas/boards and the
4
- * `boards-changed` SSE frame. `activeBoardId === null` is Home.
6
+ * `boards-changed` SSE frame. Null means no server board is open; browsingMemory
7
+ * separately keeps a human in the library while agents open boards.
5
8
  */
6
9
  export interface BoardSummary {
7
10
  id: string;
8
11
  name: string;
9
- category: string | null;
12
+ folder: string | null;
10
13
  createdAt: string;
11
14
  lastOpenedAt: string | null;
12
15
  nodeCount: number;
13
16
  readmeNodeId?: string | null;
17
+ mapPosition?: {
18
+ x: number;
19
+ y: number;
20
+ } | null;
21
+ previousBoardId?: string | null;
22
+ relationVocabulary?: RelationDefinition[];
14
23
  summary?: string | null;
15
24
  pinnedTitles?: Array<{
16
25
  nodeId: string;
17
26
  title: string;
18
27
  }>;
19
28
  links?: Array<{
29
+ id?: string;
20
30
  nodeId: string;
21
31
  boardId: string;
32
+ cardId?: string;
33
+ cardTitle?: string | null;
22
34
  title: string | null;
23
35
  missing: boolean;
36
+ kind?: string;
24
37
  }>;
25
38
  backlinks?: Array<{
39
+ id?: string;
26
40
  boardId: string;
27
41
  title: string;
28
42
  nodeId: string;
43
+ cardId?: string;
44
+ kind?: string;
29
45
  }>;
46
+ /** Home thumbnail (docs/design/Home.dc.html): cards as 0–1 rectangles of the board's extent. */
47
+ preview?: Array<{
48
+ x: number;
49
+ y: number;
50
+ w: number;
51
+ h: number;
52
+ pinned?: true;
53
+ }>;
54
+ /** Roughly what this board's map costs in the brief when pinned (README + pinned card summaries). */
55
+ mapChars?: number;
56
+ /** In the agent's working set (vision move 0a); null when not pinned. */
57
+ pin?: {
58
+ pinnedBy: {
59
+ actor: string;
60
+ source: string;
61
+ agentId?: string;
62
+ };
63
+ pinnedAt: string;
64
+ reason?: string;
65
+ } | null;
30
66
  }
31
67
  export declare const boardList: import("@preact/signals-core").Signal<BoardSummary[]>;
32
68
  export declare const activeBoardId: import("@preact/signals-core").Signal<string | null>;
69
+ /** An explicitly opened library view stays visible while agents switch boards. */
70
+ export declare const browsingMemory: import("@preact/signals-core").Signal<boolean>;
71
+ /** Review belongs to this navigation incarnation, never merely a reused card ID. */
72
+ export declare const lifecycleTarget: import("@preact/signals-core").Signal<{
73
+ boardId: string;
74
+ nodeId: string;
75
+ incarnation: number;
76
+ } | null>;
77
+ export declare const lifecycleFilter: import("@preact/signals-core").Signal<"All" | "To review" | "Retired">;
78
+ /** Layout/pin/reconnect invalidation for the library's shared graph projection. */
79
+ export declare const memoryGraphRevision: import("@preact/signals-core").Signal<number>;
33
80
  /** False until the first list arrives — Home must not flash before the server answers. */
34
81
  export declare const boardsLoaded: import("@preact/signals-core").Signal<boolean>;
82
+ export declare let catalogEpoch: string | null;
83
+ export declare let boardGeneration: number | null;
84
+ /** Invalidates suspended writes when the canonical board/library is replaced. */
85
+ export declare let boardIncarnation: number;
86
+ /** Invalidates lifecycle UI work across suspension, including an off/on round trip. */
87
+ export declare let lifecycleUiGeneration: number;
88
+ /** Only the current transport's connected handshake may replace the server epoch. */
89
+ export declare function connectBoardCatalog(epoch: string): void;
35
90
  /** The SSE bridge resyncs the canvas when the open board changes under it. */
36
- export declare function setBoardSwitchHandler(handler: (() => void) | null): void;
91
+ export declare function setBoardSwitchHandler(handler: ((initial: boolean) => void) | null): void;
37
92
  export declare function applyBoards(data: {
38
93
  activeBoardId?: unknown;
39
94
  boards?: unknown;
40
- reloaded?: unknown;
95
+ catalogEpoch?: unknown;
96
+ catalogRevision?: unknown;
97
+ reloadRevision?: unknown;
98
+ boardGeneration?: unknown;
41
99
  } | null): void;
42
100
  export declare function loadBoards(): Promise<void>;
101
+ /** Reserve navigation before an async save; later navigation cancels the pending jump. */
102
+ export declare function claimNavigation(): () => boolean;
43
103
  /** Open a board, or Home with null. */
44
104
  export declare function openBoard(id: string | null): Promise<void>;
45
- export declare function createAndOpenBoard(name: string): Promise<void>;
105
+ /** Used by wiki links, graph nodes and qualified library hits; never focus a stale board's same-ID card. */
106
+ export declare function openMemoryTarget(target: MemoryTarget, options?: {
107
+ review?: boolean;
108
+ }): Promise<boolean>;
109
+ /** Create a board (filed in `folder` when given) and open it. */
110
+ export declare function createAndOpenBoard(name: string, folder?: string | null): Promise<void>;
46
111
  export interface BoardCopyCard {
47
112
  id: string;
48
113
  type: string;
@@ -64,16 +129,23 @@ export declare function previewBoardCopy(sourceBoardId: string): Promise<BoardCo
64
129
  export declare function createBoardFrom(opts: {
65
130
  sourceBoardId: string;
66
131
  name: string;
67
- category?: string;
132
+ folder?: string;
68
133
  nodeIds: string[];
69
134
  includeReadme: boolean;
70
135
  includeStructure: boolean;
71
136
  }): Promise<BoardSummary | null>;
72
- /** Rename and/or re-file a board; `category: null` removes it from its category. */
137
+ /** Rename and/or re-file a board; `folder: null` unfiles it. */
73
138
  export declare function updateBoard(id: string, patch: {
74
139
  name?: string;
75
- category?: string | null;
76
- }): Promise<void>;
140
+ folder?: string | null;
141
+ mapPosition?: {
142
+ x: number;
143
+ y: number;
144
+ } | null;
145
+ relationVocabulary?: RelationDefinition[];
146
+ }): Promise<boolean>;
147
+ /** Pin a board into the agent's working set, or unpin it. */
148
+ export declare function setBoardPinned(id: string, pinned: boolean): Promise<void>;
77
149
  export declare function setBoardReadme(id: string, readmeNodeId: string | null): Promise<void>;
78
150
  export declare function deleteBoard(id: string): Promise<void>;
79
151
  export declare function activeBoard(): BoardSummary | null;
@@ -85,10 +85,15 @@ export declare function distributeSelection(): void;
85
85
  /** Grid the selection in reading order from its own top-left corner. */
86
86
  export declare function arrangeSelection(gap?: number): void;
87
87
  export declare function getSelectedNodes(): CanvasNodeState[];
88
+ export declare let contextPinsRevision: number;
89
+ export declare let contextPinsPendingWrites: number;
88
90
  export declare function toggleContextPin(id: string): void;
89
91
  export declare function addContextPins(ids: string[]): void;
92
+ export declare function removeContextPins(ids: string[]): void;
90
93
  export declare function clearContextPins(): void;
91
94
  export declare function replaceContextPinsFromServer(ids: string[]): void;
95
+ /** Reconcile dropped frames and refused/normalized writes without replaying old pins. */
96
+ export declare function refreshContextPins(): Promise<void>;
92
97
  export declare function addNode(node: CanvasNodeState): void;
93
98
  export declare function updateNode(id: string, patch: Partial<CanvasNodeState>): void;
94
99
  export declare function updateNodeData(id: string, dataPatch: Record<string, unknown>): void;
@@ -119,7 +124,9 @@ export declare function bringToFront(id: string): void;
119
124
  export declare function toggleCollapsed(id: string): void;
120
125
  export declare function setViewport(v: Partial<ViewportState>): void;
121
126
  export declare function replaceViewport(next: ViewportState): void;
122
- export declare function commitViewport(next: ViewportState): void;
127
+ export declare function commitViewport(next: ViewportState, options?: {
128
+ recordHistory?: boolean;
129
+ }): void;
123
130
  export declare function applyServerCanvasLayout(layout: Pick<CanvasLayout, 'nodes' | 'edges'> & {
124
131
  viewport?: ViewportState;
125
132
  annotations?: CanvasAnnotation[];
@@ -144,6 +151,12 @@ export declare function zoomByFactor(factor: number, duration?: number): void;
144
151
  export declare function animateViewport(target: ViewportState, duration?: number, options?: {
145
152
  recordHistory?: boolean;
146
153
  }): void;
154
+ /**
155
+ * Drive the camera along `frameAt(t)`, t in [0, 1], over `duration` ms — the
156
+ * tour/camera-move path. Shares animateViewport's slot, so a pan gesture or a
157
+ * capture frame (cancelViewportAnimation) interrupts it. Duration 0 jumps.
158
+ */
159
+ export declare function animateCameraPath(frameAt: (t: number) => ViewportState, duration: number, onDone?: (end: ViewportState) => void): void;
147
160
  /** Cancel any in-flight viewport animation (e.g. when user starts dragging). */
148
161
  export declare function cancelViewportAnimation(): void;
149
162
  export declare function persistLayout(options?: {
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The context chip (docs/design/ContextChip.dc.html): what the agent's brief
3
+ * costs in tokens, and when each pinned board was last read. The brief fetch is a measurement, not a delivery: it says so with
4
+ * `x-pmx-proxied-read`, so it is never booked as an agent read — not even from
5
+ * an `?agent=` tab, whose requests carry no workbench marker. Otherwise the
6
+ * recorded read would announce itself and refetch the chip in a loop.
7
+ */
8
+ export interface BriefSize {
9
+ chars: number;
10
+ }
11
+ export interface BoardRead {
12
+ lastReadAt: string;
13
+ lastReadBy: string;
14
+ }
15
+ export declare const briefSize: import("@preact/signals-core").Signal<BriefSize | null>;
16
+ export declare const pinnedBoardReads: import("@preact/signals-core").Signal<Map<string, BoardRead | null>>;
17
+ /** A token count for display: 873, 1.1k. */
18
+ export declare function formatTokens(tokens: number): string;
19
+ /** ≈ tokens for a character count (about four characters per token). */
20
+ export declare function approxTokens(chars: number): string;
21
+ /** Debounced: pins, reads and board changes arrive in bursts; content edits wait longer. */
22
+ export declare function refreshContextChip(delayMs?: number): void;
@@ -25,10 +25,13 @@ interface ContextStatusResponse {
25
25
  ok?: boolean;
26
26
  boardId?: string | null;
27
27
  nodes?: NodeReadStatus[];
28
+ /** Per node, the newest links revision an agent read carried. */
29
+ links?: Record<string, number>;
28
30
  pins?: Record<string, ContextPinMeta>;
29
31
  }
30
32
  export declare const nodeReadStatus: import("@preact/signals-core").Signal<Map<string, NodeReadStatus>>;
31
33
  export declare const contextPinMeta: import("@preact/signals-core").Signal<Record<string, ContextPinMeta>>;
34
+ export declare const seenLinks: import("@preact/signals-core").Signal<Record<string, number>>;
32
35
  export declare function applyContextStatus(response: ContextStatusResponse): void;
33
36
  export declare function refreshContextStatus(): Promise<void>;
34
37
  /** How an agent's context relates to one pinned node — the mark its header shows. */
@@ -45,6 +48,38 @@ export type PinnedReadState = {
45
48
  at: string;
46
49
  };
47
50
  export declare function pinnedReadState(nodeId: string, currentRevision: number): PinnedReadState;
51
+ /**
52
+ * The marks a link's pill carries (docs/design/LinkAuthorship.dc.html):
53
+ * - `agent`: the agent that drew or last relabelled it — a ✦ that stays until
54
+ * a person edits, retypes or relabels the link. A read never clears it.
55
+ * - `notSeen`: a person's new or edited link that no read has carried yet —
56
+ * temporary, cleared by the agent's next read of either end. Quiet until an
57
+ * agent has read this board at all. An agent's link is never "not seen".
58
+ * The board's only person draws without a mark (another person's initial is
59
+ * Part 3, shared boards).
60
+ */
61
+ export interface LinkMarks {
62
+ agent: string | null;
63
+ notSeen: boolean;
64
+ }
65
+ export declare function linkMarks(edge: {
66
+ from: string;
67
+ to: string;
68
+ toBoardId?: string;
69
+ revision?: number;
70
+ changedBy?: {
71
+ actor: string;
72
+ source: string;
73
+ agentId?: string;
74
+ };
75
+ }): LinkMarks;
76
+ /**
77
+ * A card whose links changed after the last read that carried them (shown
78
+ * neutral, never amber). A link an agent drew does not count — that agent
79
+ * made it, and the link itself says "by <agent>". A removed link has no
80
+ * author left to check, so it counts.
81
+ */
82
+ export declare function linksChanged(nodeId: string, linksRevision: number): boolean;
48
83
  /** Display name for an attributed writer: its agent id, else its transport label. */
49
84
  export declare function writerName(actor: {
50
85
  source: string;
@@ -1,4 +1,5 @@
1
1
  import type { AgentPresenceSnapshot } from '../../shared/agent-presence.js';
2
+ import type { CanvasNodeState } from '../types';
2
3
  /**
3
4
  * Per-tab identity: an AGENT driving the workbench UI from its own pane opens
4
5
  * `/workbench?agent=<key>` and every write from that tab is booked as that
@@ -26,17 +27,12 @@ export declare function vetoGhostIntent(intent: {
26
27
  reason?: string;
27
28
  }): Promise<boolean>;
28
29
  /** Fetch rendered markdown HTML from the server. */
29
- export declare function renderMarkdown(markdown: string): Promise<string>;
30
+ export declare function renderMarkdown(markdown: string, nodeId?: string, expectedBoardId?: string | null): Promise<string | null>;
30
31
  /** Fetch file content from the server. */
31
32
  export declare function fetchFile(path: string): Promise<{
32
33
  content: string;
33
34
  provenance?: unknown;
34
35
  }>;
35
- /** Save file content to the server. */
36
- export declare function saveFile(path: string, content: string): Promise<{
37
- ok: boolean;
38
- updatedAt?: string;
39
- }>;
40
36
  /** Fetch current workbench state. */
41
37
  export declare function fetchWorkbenchState(): Promise<Record<string, unknown>>;
42
38
  /** Open a markdown file in the workbench/canvas. */
@@ -44,7 +40,7 @@ export declare function openWorkbenchFile(path: string): Promise<{
44
40
  ok: boolean;
45
41
  }>;
46
42
  /** Fetch canvas state from server. */
47
- export declare function fetchCanvasState(): Promise<Record<string, unknown>>;
43
+ export declare function fetchCanvasState(expectedBoardId: string | null): Promise<Record<string, unknown>>;
48
44
  export declare function saveCanvasTheme(theme: string): Promise<{
49
45
  ok: boolean;
50
46
  theme?: string;
@@ -85,7 +81,10 @@ export declare function pushCanvasUpdate(updates: Array<{
85
81
  recordHistory?: boolean;
86
82
  }): Promise<void>;
87
83
  /** Render the server-confirmed edge immediately, without waiting for SSE/polling. */
88
- export declare function createEdgeFromClient(from: string, to: string, type: string, label?: string): Promise<{
84
+ export declare function createEdgeFromClient(from: string, to: string, type: string, label?: string, options?: {
85
+ toBoardId?: string;
86
+ expectedBoardId?: string | null;
87
+ }): Promise<{
89
88
  ok: boolean;
90
89
  id?: string;
91
90
  }>;
@@ -122,10 +121,12 @@ export declare function updateNodeFromClient(id: string, patch: {
122
121
  children?: string[];
123
122
  expectedContentRevision?: number;
124
123
  expectedBoardId?: string | null;
124
+ persistFile?: boolean;
125
125
  }): Promise<{
126
126
  ok: boolean;
127
127
  id?: string;
128
128
  contentRevision?: number;
129
+ lastEditedBy?: CanvasNodeState['lastEditedBy'];
129
130
  }>;
130
131
  /** Refresh a webpage node from its persisted URL on the server. */
131
132
  export declare function refreshWebpageNodeFromClient(id: string, url?: string): Promise<{
@@ -232,6 +233,8 @@ export declare function deleteSnapshot(id: string): Promise<{
232
233
  }>;
233
234
  /** Patch an edge in place (label/type/style/animated) via the server. */
234
235
  export declare function updateEdgeFromClient(edgeId: string, patch: {
236
+ kind?: string | null;
237
+ reason?: string | null;
235
238
  label?: string;
236
239
  type?: string;
237
240
  style?: string;
@@ -0,0 +1,22 @@
1
+ export { lifecycleFilter, lifecycleTarget } from './boards-store';
2
+ export declare const knowledge: import("@preact/signals-core").Signal<{
3
+ ok: true;
4
+ categories: import("../../server").KnowledgeCategory[];
5
+ folders: import("../../server").FolderProperties[];
6
+ relationPresets: import("../../shared/relations").RelationPreset[];
7
+ cards: Record<string, import("../../shared/lifecycle-status").LifecycleQualification>;
8
+ reviewCards: import("../../server/knowledge-lifecycle.js").ReviewCardSummary[];
9
+ resolvedFolders: Record<string, ReturnType<import("../../server/knowledge-lifecycle.js").KnowledgeLifecycle["resolve"]>>;
10
+ } | null>;
11
+ export declare const knowledgeUnavailable: import("@preact/signals-core").Signal<boolean>;
12
+ export declare const effectiveLifecycleFilter: import("@preact/signals-core").ReadonlySignal<"All" | "To review" | "Retired">;
13
+ export declare const retirementUndo: import("@preact/signals-core").Signal<{
14
+ boardId: string;
15
+ nodeId: string;
16
+ incarnation: number;
17
+ } | null>;
18
+ export declare function refreshKnowledge(): Promise<void>;
19
+ export declare function cardQualification(nodeId: string): import("../../shared/lifecycle-status").LifecycleQualification | undefined;
20
+ /** Raw pin membership survives retirement, but retired cards are not delivered. */
21
+ export declare const activeContextPinnedNodeIds: import("@preact/signals-core").ReadonlySignal<Set<string>>;
22
+ export declare function openLifecycle(nodeId: string): void;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Near a pin (docs/design/NearPin.dc.html): each pinned node pulls up to five
3
- * unpinned nodes within 600 px into the agent's brief as title + short
3
+ * unpinned nodes within a 600 px edge-to-edge gap into the agent's brief as title + short
4
4
  * summary. Same rule as the server's brief (`findNeighborhoods`), so the mark
5
5
  * claims exactly what the agent receives.
6
6
  */
@@ -14,3 +14,46 @@ export interface NearPin {
14
14
  * changes: the chips subscribed to it re-render only when a neighbourhood does.
15
15
  */
16
16
  export declare const nearPins: import("@preact/signals-core").ReadonlySignal<Map<string, NearPin[]>>;
17
+ /** Pin id → its neighbours' ids: the tether layer looks a pin up, never scans the near map. */
18
+ export declare const neighboursByPin: import("@preact/signals-core").ReadonlySignal<Map<string, string[]>>;
19
+ /** The node under the pointer: a hovered pin draws its neighbours (NearPin.dc.html §2). */
20
+ export declare const hoveredNodeId: import("@preact/signals-core").Signal<string | null>;
21
+ /** A near node whose pins the human asked to see from its chip ("Show pins"). */
22
+ export declare const shownPinsFor: import("@preact/signals-core").Signal<string | null>;
23
+ /**
24
+ * Pins drawn with tethers and the 600 px boundary around their edges: the pin being dragged,
25
+ * hovered or selected, or the pins of the near node whose chip said "Show
26
+ * pins". Dragging an unpinned node rings only its nearest pin (§3).
27
+ */
28
+ export declare const tetherFocus: import("@preact/signals-core").ReadonlySignal<{
29
+ pinIds: string[];
30
+ ringOnly: boolean;
31
+ }>;
32
+ /** The moment it changes (§3): the chip pulses once on a drop inside, fades on a drop outside. */
33
+ export declare const nearChange: import("@preact/signals-core").Signal<{
34
+ nodeId: string;
35
+ kind: "in" | "out";
36
+ pins: NearPin[];
37
+ } | null>;
38
+ export declare function noteNearAtGrab(nodeId: string): void;
39
+ export declare function settleNearAfterDrop(nodeId: string): void;
40
+ export declare function clearNearChange(nodeId: string): void;
41
+ /**
42
+ * The open near chip's card (§2), drawn over the canvas because a node paints
43
+ * contained. `at` is the chip's screen rect when it opened; the card closes
44
+ * when the view moves rather than chase a stale anchor.
45
+ */
46
+ export declare const nearCard: import("@preact/signals-core").Signal<{
47
+ nodeId: string;
48
+ at: {
49
+ left: number;
50
+ right: number;
51
+ top: number;
52
+ bottom: number;
53
+ };
54
+ view: string;
55
+ } | null>;
56
+ export declare function openNearCard(nodeId: string, chip: Element, view: string): void;
57
+ /** Leaving the chip for the card must not close it: close after a short grace. */
58
+ export declare function closeNearCardSoon(): void;
59
+ export declare function keepNearCard(): void;
@@ -1,5 +1,5 @@
1
1
  import type { PmxAxIntent } from '../../shared/ax-intent.js';
2
- import { type AgentActivityEntry, type AgentPresence, type AgentPresenceSnapshot, type ContextBudget } from '../../shared/agent-presence.js';
2
+ import { type AgentActivityEntry, type AgentPresence, type AgentPresenceSnapshot } from '../../shared/agent-presence.js';
3
3
  /**
4
4
  * Agent presence (rail-chrome-v2 phase 2). Fed by the server's `agent-presence`
5
5
  * SSE snapshot (every change, including TTL expiry) and the connect-time read,
@@ -9,7 +9,6 @@ import { type AgentActivityEntry, type AgentPresence, type AgentPresenceSnapshot
9
9
  * panel, command bar, presence layer, and top-bar chip all mount on it.
10
10
  */
11
11
  export declare const agentPresences: import("@preact/signals-core").Signal<AgentPresence[]>;
12
- export declare const contextBudget: import("@preact/signals-core").Signal<ContextBudget>;
13
12
  /** Recent agent writes, newest first — the External Steering activity feed. */
14
13
  export declare const agentActivity: import("@preact/signals-core").Signal<AgentActivityEntry[]>;
15
14
  /** External Steering chrome (phase 6): the feed popover and the writers sheet. */
@@ -27,9 +26,10 @@ export declare function writerColor(sessionId: string): string;
27
26
  export declare function writerInitial(label: string): string;
28
27
  /** Compact relative age for feed rows and the writers sheet: now · 12s · 4m · 2h. */
29
28
  export declare function relativeAge(iso: string, now?: number): string;
30
- /** Master gate for every agent surface: an attached session exists. */
29
+ /** Attachment state is independent of whether the human opted into its UI. */
31
30
  export declare const sessionActive: import("@preact/signals-core").ReadonlySignal<boolean>;
32
- /** Live writers with no attached session — the External Steering mode. */
31
+ export declare const sessionChromeActive: import("@preact/signals-core").ReadonlySignal<boolean>;
32
+ /** With session UI off, attached agents still appear as ordinary live writers. */
33
33
  export declare const externalWriterPresences: import("@preact/signals-core").ReadonlySignal<AgentPresence[]>;
34
34
  /**
35
35
  * Connected agents the human can ADDRESS from the composer: every live
@@ -1,3 +1,31 @@
1
+ import { type TourStop } from '../../shared/tour.js';
2
+ import type { ViewportState } from '../types';
1
3
  export declare const presenting: import("@preact/signals-core").Signal<boolean>;
2
4
  export declare const recordingCamera: import("@preact/signals-core").Signal<boolean>;
5
+ /** Why the current stop cannot be shown (missing target, no stops, server unreachable). */
6
+ export declare const presentationError: import("@preact/signals-core").Signal<string>;
3
7
  export declare function ownsCamera(): boolean;
8
+ /**
9
+ * Ease this viewer's camera to a stop: log-space zoom, optional pull-back.
10
+ * Reduced motion jumps straight to the end. Throws when the target is missing.
11
+ */
12
+ export declare function playStop(stop: TourStop, onDone?: (end: ViewportState) => void): void;
13
+ /**
14
+ * Show a tour stop, entering presentation if needed. Entering hides the
15
+ * chrome, so the canvas area is measured only after that layout has
16
+ * committed (two frames); the latest step always wins.
17
+ */
18
+ export declare function presentStop(stop: TourStop): void;
19
+ /**
20
+ * Move the server's shared tour cursor. The `canvas-tour-step` echo does the
21
+ * animating, here and in every other presenting viewer, so a human's keys and
22
+ * an agent's `tour.go` always agree on where the tour is.
23
+ */
24
+ export declare function stepTour(to: {
25
+ stop: number;
26
+ } | {
27
+ step: 'next' | 'previous';
28
+ }): Promise<void>;
29
+ /** Present from the first stop, or resume where the tour already is (`?present=1`). */
30
+ export declare function startPresentation(resume?: boolean): Promise<void>;
31
+ export declare function endPresentation(): void;
@@ -0,0 +1,10 @@
1
+ export declare const relationFilter: import("@preact/signals-core").Signal<{
2
+ boardId: string;
3
+ kind: string;
4
+ } | null>;
5
+ export declare const relationFocus: import("@preact/signals-core").ReadonlySignal<string | null>;
6
+ /** View-only highlights. They never infer evidence, change a decision or execute a flow. */
7
+ export declare const relationHighlight: import("@preact/signals-core").ReadonlySignal<{
8
+ cards: Set<string>;
9
+ links: Set<string>;
10
+ } | null>;
@@ -1,4 +1,6 @@
1
1
  import type { AxApprovalStatus, AxEventKind, AxWorkItemStatus } from '../../shared/ax-kinds.js';
2
+ /** Explicit panel expansion, shared by the panel handle and the agent popover. */
3
+ export declare const sessionPanelOpened: import("@preact/signals-core").Signal<boolean>;
2
4
  export type WorkItemStatus = AxWorkItemStatus;
3
5
  export interface WorkItemView {
4
6
  id: string;
@@ -159,6 +161,8 @@ export interface SessionReceipt {
159
161
  labels: string[];
160
162
  /** Endings folded into this card (see applySessionReceipt). */
161
163
  sessions: number;
164
+ /** When the session attached (the receipt's "This session · start–end"); null if unknown. */
165
+ startedAt: string | null;
162
166
  endedAt: string;
163
167
  /** Why it ended — the receipt should answer this, not leave the human asking. */
164
168
  endedBy?: 'human' | 'agent' | 'idle-timeout';
@@ -177,6 +181,7 @@ export interface SessionReceipt {
177
181
  snapshot: {
178
182
  id: string;
179
183
  name: string;
184
+ boardId: string | null;
180
185
  } | null;
181
186
  /** What the session did with context (docs/design/AgentContext.dc.html receipt). */
182
187
  context: SessionContextActivity;
@@ -184,8 +189,17 @@ export interface SessionReceipt {
184
189
  export interface ReceiptNode {
185
190
  id: string;
186
191
  title: string;
192
+ /** The board where this touch was recorded, for reopening a change's card. */
193
+ boardId?: string;
187
194
  reason?: string;
195
+ /** Edited cards: what the edit did ("rewrote the second paragraph"). */
196
+ change?: string;
197
+ /** Edited cards: the text before and at the session's end, cut around the first difference. */
198
+ before?: string;
199
+ after?: string;
188
200
  }
201
+ /** Card ids are local to a board; receipts can remain open across board switches. */
202
+ export declare const receiptNodeKey: (node: ReceiptNode) => string;
189
203
  export interface SessionContextActivity {
190
204
  read: ReceiptNode[];
191
205
  pinned: ReceiptNode[];
@@ -197,8 +211,25 @@ export interface SessionContextActivity {
197
211
  * The agent-activity lens: while on, nodes the last session did not touch
198
212
  * (read, pin, create, edit) are dimmed. Null when off.
199
213
  */
200
- export declare const activityLensNodeIds: import("@preact/signals-core").Signal<Set<string> | null>;
201
- export declare function setActivityLens(on: boolean): void;
214
+ /**
215
+ * The activity lens ("Dim untouched nodes"): off, one live session's touches
216
+ * (the chip that was pressed), or the receipt's. A live lens hands over to the
217
+ * receipt when that session ends, and switches off if its ending has none.
218
+ */
219
+ export type ActivityLens = {
220
+ kind: 'live';
221
+ sessionId: string;
222
+ } | {
223
+ kind: 'receipt';
224
+ } | null;
225
+ export declare const activityLens: import("@preact/signals-core").Signal<ActivityLens>;
226
+ export declare const activityLensNodeIds: import("@preact/signals-core").ReadonlySignal<Set<string> | null>;
227
+ /** Cards an agent edited in a live session or in the receipt's session: they carry the violet bar. */
228
+ export declare const sessionEditedIds: import("@preact/signals-core").ReadonlySignal<Set<string>>;
229
+ /** Turn the lens on for a live session (from its chip) or the receipt, or off. */
230
+ export declare function setActivityLens(on: boolean, live?: {
231
+ sessionId: string;
232
+ }): void;
202
233
  /** The last ended session's receipt (design item 2); client-side, cleared on dismiss. */
203
234
  export declare const sessionReceipt: import("@preact/signals-core").Signal<SessionReceipt | null>;
204
235
  /**
@@ -209,5 +240,13 @@ export declare const sessionReceipt: import("@preact/signals-core").Signal<Sessi
209
240
  * extend an open receipt. Qualifying endings while one is up merge into it.
210
241
  */
211
242
  export declare function applySessionReceipt(data: Record<string, unknown>): void;
243
+ /**
244
+ * Undo on the receipt's Edited row (AgentContext.dc.html): each card back to
245
+ * its content in the pre-session snapshot — the rest of the board stays.
246
+ */
247
+ export declare function undoSessionEdits(snapshotId: string, edits: ReceiptNode[]): Promise<{
248
+ ok: boolean;
249
+ restored: string[];
250
+ }>;
212
251
  export declare function dismissSessionReceipt(): void;
213
252
  export declare function resetSessionStore(): void;
@@ -0,0 +1,7 @@
1
+ export declare const workspaceSettings: import("@preact/signals-core").Signal<{
2
+ agentSessions: boolean;
3
+ knowledgeLifecycle: boolean;
4
+ } | null>;
5
+ export declare const agentSessionsEnabled: import("@preact/signals-core").ReadonlySignal<boolean>;
6
+ export declare const knowledgeLifecycleEnabled: import("@preact/signals-core").ReadonlySignal<boolean>;
7
+ export declare function applyWorkspaceSettings(value: unknown): void;
@@ -19,6 +19,8 @@ export interface CanvasNodeState {
19
19
  collapsed: boolean;
20
20
  pinned: boolean;
21
21
  contentRevision?: number;
22
+ /** Revision of this node's latest link change, kept apart from its text. */
23
+ linksRevision?: number;
22
24
  /** Who created / last edited the node's content (server attribution). */
23
25
  createdBy?: NodeActor;
24
26
  lastEditedBy?: NodeActor;
@@ -33,10 +35,20 @@ export interface CanvasEdge {
33
35
  id: string;
34
36
  from: string;
35
37
  to: string;
38
+ toBoardId?: string;
36
39
  type: 'relation' | 'depends-on' | 'flow' | 'references';
40
+ kind?: string;
41
+ reason?: string;
37
42
  label?: string;
38
43
  style?: 'solid' | 'dashed' | 'dotted';
39
44
  animated?: boolean;
45
+ /** Board revision of this link's latest add, retype or relabel. */
46
+ revision?: number;
47
+ changedBy?: NodeActor;
48
+ changedAt?: string;
49
+ /** Who first drew the link, and when (LinkAuthorship.dc.html). */
50
+ createdBy?: NodeActor;
51
+ createdAt?: string;
40
52
  }
41
53
  export interface CanvasAnnotationPoint {
42
54
  x: number;
@@ -63,7 +75,7 @@ export type AnnotationTool = 'pen' | 'eraser' | 'text' | null;
63
75
  export type ConnectionStatus = 'connecting' | 'connected' | 'disconnected';
64
76
  export declare const TYPE_LABELS: Record<CanvasNodeState['type'], string>;
65
77
  /** Node types that support the full-viewport expand/focus overlay. */
66
- export declare const EXPANDABLE_TYPES: Set<"file" | "group" | "html" | "markdown" | "mcp-app" | "webpage" | "json-render" | "graph" | "board" | "prompt" | "response" | "status" | "context" | "ledger" | "trace" | "diff" | "mermaid" | "image">;
78
+ export declare const EXPANDABLE_TYPES: Set<"image" | "board" | "file" | "markdown" | "mcp-app" | "webpage" | "json-render" | "graph" | "prompt" | "response" | "status" | "context" | "ledger" | "trace" | "diff" | "mermaid" | "html" | "group">;
67
79
  export declare const EXCALIDRAW_SERVER_NAME = "Excalidraw";
68
80
  export declare const EXCALIDRAW_CREATE_VIEW_TOOL = "create_view";
69
81
  export declare function isExcalidrawNode(node: CanvasNodeState): boolean;
@@ -0,0 +1,2 @@
1
+ /** Overlays and text editors get Escape before the underlying view selection. */
2
+ export declare function isSelectionEscape(event: KeyboardEvent): boolean;
@@ -0,0 +1,4 @@
1
+ /** How long ago, compact: "just now", "5m", "3h", "2d". */
2
+ export declare function age(iso: string): string;
3
+ /** "just now", "5m ago", "3h ago", "2d ago". */
4
+ export declare function timeAgo(iso: string): string;
@@ -1,6 +1,8 @@
1
1
  import { UriTemplate } from '@modelcontextprotocol/sdk/shared/uriTemplate.js';
2
2
  /** SDK v1 matches {?a,b} as two required, ordered parameters, unlike its expansion. */
3
3
  export declare class ContextUriTemplate extends UriTemplate {
4
- constructor();
4
+ private readonly host;
5
+ private readonly parameters;
6
+ constructor(host?: string, parameters?: string[]);
5
7
  match(uri: string): Record<string, string> | null;
6
8
  }