pmx-canvas 0.8.2 → 0.9.1
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.
- package/.github/extensions/pmx-canvas/runtime.json +1 -1
- package/.github/extensions/pmx-canvas/tools.json +601 -22
- package/CHANGELOG.md +59 -0
- package/Readme.md +131 -532
- package/dist/canvas/global.css +2724 -476
- package/dist/canvas/index.js +168 -107
- package/dist/canvas/mcp-app.html +2899 -596
- package/dist/json-render/index.js +20 -20
- package/dist/types/client/canvas/BarHint.d.ts +12 -2
- package/dist/types/client/canvas/BoardLinkDialog.d.ts +3 -1
- package/dist/types/client/canvas/BoardPinButton.d.ts +10 -0
- package/dist/types/client/canvas/BoardSwitcher.d.ts +1 -1
- package/dist/types/client/canvas/CanvasViewport.d.ts +1 -1
- package/dist/types/client/canvas/CommandBar.d.ts +3 -4
- package/dist/types/client/canvas/ConnectionBanner.d.ts +2 -1
- package/dist/types/client/canvas/ContextChip.d.ts +3 -0
- package/dist/types/client/canvas/CrossBoardReferences.d.ts +5 -0
- package/dist/types/client/canvas/EdgeLayer.d.ts +14 -3
- package/dist/types/client/canvas/EmptyState.d.ts +4 -4
- package/dist/types/client/canvas/HomeGraphView.d.ts +2 -0
- package/dist/types/client/canvas/HomeMapView.d.ts +1 -0
- package/dist/types/client/canvas/HomeReviewView.d.ts +6 -0
- package/dist/types/client/canvas/HomeView.d.ts +9 -7
- package/dist/types/client/canvas/KnowledgeDialog.d.ts +4 -0
- package/dist/types/client/canvas/LifecycleChrome.d.ts +5 -0
- package/dist/types/client/canvas/LifecycleFields.d.ts +7 -0
- package/dist/types/client/canvas/LifecyclePanel.d.ts +1 -0
- package/dist/types/client/canvas/MemoryInspector.d.ts +7 -0
- package/dist/types/client/canvas/NearPinLayer.d.ts +14 -0
- package/dist/types/client/canvas/NodeContextMark.d.ts +40 -7
- package/dist/types/client/canvas/RelationPresetsDialog.d.ts +4 -0
- package/dist/types/client/canvas/RelationsPanel.d.ts +4 -0
- package/dist/types/client/canvas/SessionPanel.d.ts +2 -0
- package/dist/types/client/canvas/canvas-area.d.ts +1 -1
- package/dist/types/client/canvas/graph-geometry.d.ts +27 -0
- package/dist/types/client/canvas/graph-model.d.ts +37 -0
- package/dist/types/client/canvas/memory-layout.d.ts +23 -0
- package/dist/types/client/canvas/use-chrome-height.d.ts +2 -0
- package/dist/types/client/canvas/use-focus-trap.d.ts +1 -0
- package/dist/types/client/canvas/use-memory-graph.d.ts +8 -0
- package/dist/types/client/canvas/use-pan-zoom.d.ts +4 -1
- package/dist/types/client/icons.d.ts +0 -10
- package/dist/types/client/nodes/AxStepControls.d.ts +1 -1
- package/dist/types/client/nodes/InlineMarkdownEditor.d.ts +4 -4
- package/dist/types/client/nodes/MarkdownNode.d.ts +5 -1
- package/dist/types/client/nodes/McpAppNode.d.ts +4 -4
- package/dist/types/client/nodes/viewer-runtime-state.d.ts +1 -1
- package/dist/types/client/state/boards-store.d.ts +81 -9
- package/dist/types/client/state/canvas-store.d.ts +14 -1
- package/dist/types/client/state/context-chip-store.d.ts +22 -0
- package/dist/types/client/state/context-status-store.d.ts +35 -0
- package/dist/types/client/state/human-store.d.ts +2 -1
- package/dist/types/client/state/intent-bridge.d.ts +11 -8
- package/dist/types/client/state/knowledge-store.d.ts +22 -0
- package/dist/types/client/state/near-pin-store.d.ts +44 -1
- package/dist/types/client/state/presence-store.d.ts +4 -4
- package/dist/types/client/state/presentation.d.ts +28 -0
- package/dist/types/client/state/relation-store.d.ts +10 -0
- package/dist/types/client/state/session-store.d.ts +41 -2
- package/dist/types/client/state/workspace-settings.d.ts +7 -0
- package/dist/types/client/types.d.ts +13 -1
- package/dist/types/client/utils/keyboard.d.ts +2 -0
- package/dist/types/client/utils/time-ago.d.ts +4 -0
- package/dist/types/mcp/context-uri-template.d.ts +3 -1
- package/dist/types/server/agent-presence.d.ts +10 -3
- package/dist/types/server/ax-context.d.ts +1 -1
- package/dist/types/server/canvas-db.d.ts +30 -7
- package/dist/types/server/canvas-operations.d.ts +24 -2
- package/dist/types/server/canvas-provenance.d.ts +22 -2
- package/dist/types/server/canvas-serialization.d.ts +2 -0
- package/dist/types/server/canvas-state.d.ts +93 -15
- package/dist/types/server/canvas-validation.d.ts +1 -1
- package/dist/types/server/context-brief.d.ts +94 -6
- package/dist/types/server/context-reads.d.ts +33 -7
- package/dist/types/server/edit-summary.d.ts +20 -0
- package/dist/types/server/index.d.ts +71 -10
- package/dist/types/server/knowledge-lifecycle.d.ts +221 -0
- package/dist/types/server/lifecycle-status.d.ts +10 -0
- package/dist/types/server/memory-graph.d.ts +9 -0
- package/dist/types/server/mutation-history.d.ts +2 -0
- package/dist/types/server/operations/ops/ax-shared.d.ts +1 -1
- package/dist/types/server/operations/ops/boards.d.ts +2 -1
- package/dist/types/server/operations/ops/lifecycle.d.ts +2 -0
- package/dist/types/server/operations/ops/memory-graph.d.ts +2 -0
- package/dist/types/server/operations/ops/nodes.d.ts +5 -0
- package/dist/types/server/operations/ops/query.d.ts +23 -0
- package/dist/types/server/operations/registry.d.ts +1 -0
- package/dist/types/server/placement.d.ts +7 -0
- package/dist/types/server/scope-fence.d.ts +2 -1
- package/dist/types/server/spatial-analysis.d.ts +6 -3
- package/dist/types/server/tour-control.d.ts +32 -0
- package/dist/types/server/wiki-links.d.ts +14 -0
- package/dist/types/server/workbench-auth.d.ts +2 -0
- package/dist/types/shared/agent-context.d.ts +2 -0
- package/dist/types/shared/agent-presence.d.ts +15 -12
- package/dist/types/shared/auto-arrange.d.ts +1 -0
- package/dist/types/shared/boards.d.ts +4 -4
- package/dist/types/shared/knowledge-lifecycle.d.ts +41 -0
- package/dist/types/shared/knowledge-presets.d.ts +6 -0
- package/dist/types/shared/lifecycle-status.d.ts +24 -0
- package/dist/types/shared/memory-graph.d.ts +53 -0
- package/dist/types/shared/relations.d.ts +68 -0
- package/dist/types/shared/semantic-attention.d.ts +2 -0
- package/dist/types/shared/tour.d.ts +38 -0
- package/dist/types/shared/workspace-settings.d.ts +11 -0
- package/docs/RELEASE.md +21 -3
- package/docs/adr-001-bun-only-runtime.md +7 -1
- package/docs/adr-002-shared-product-separate-runtimes.md +93 -0
- package/docs/api-reference.md +109 -0
- package/docs/ax-host-adapter-contract.md +1 -1
- package/docs/ax-state-contract.md +5 -4
- package/docs/cli.md +153 -15
- package/docs/demos/pmx-canvas-demo.mp4 +0 -0
- package/docs/design/AgentContext.dc.html +3 -3
- package/docs/design/BoardPins.dc.html +37 -22
- package/docs/design/Categories.dc.html +208 -0
- package/docs/design/CategoryEditor.dc.html +33 -0
- package/docs/design/Chrome.dc.html +52 -9
- package/docs/design/ContextChip.dc.html +224 -0
- package/docs/design/ContextChip600.dc.html +136 -0
- package/docs/design/EmptyState.dc.html +45 -0
- package/docs/design/Flows.dc.html +23 -1
- package/docs/design/HeaderMarks.dc.html +183 -0
- package/docs/design/Home.dc.html +19 -1
- package/docs/design/HomeGraph.dc.html +86 -202
- package/docs/design/HomeMap.dc.html +23 -1
- package/docs/design/HomeTeam.dc.html +32 -14
- package/docs/design/Lifecycle.dc.html +22 -0
- package/docs/design/Lifecycle600.dc.html +18 -0
- package/docs/design/LifecycleVariants.dc.html +157 -0
- package/docs/design/LinkAuthorship.dc.html +139 -0
- package/docs/design/LinksChanged.dc.html +203 -0
- package/docs/design/LinksOptions.dc.html +137 -0
- package/docs/design/LinksOptions600.dc.html +134 -0
- package/docs/design/NearPin.dc.html +9 -10
- package/docs/design/Pane600.dc.html +4 -3
- package/docs/design/Relations.dc.html +3 -2
- package/docs/design/Restore.dc.html +152 -0
- package/docs/design/SeeChange.dc.html +267 -0
- package/docs/design/Uses.dc.html +12 -6
- package/docs/design/canvas.json +146 -19
- package/docs/design.md +449 -16
- package/docs/environment.md +0 -1
- package/docs/evals/curation-effect.md +128 -0
- package/docs/http-api.md +459 -37
- package/docs/mcp.md +146 -18
- package/docs/node-types.md +58 -3
- package/docs/plans/design-gaps-2026-10-08.md +53 -0
- package/docs/plans/plan-009-tech-debt-backlog.md +379 -0
- package/docs/plans/plan-016-context-made-visible-wave-1.md +150 -5
- package/docs/plans/plan-017-knowledge-categories-and-lifecycle.md +175 -0
- package/docs/plans/plan-018-connected-memory-wave-2.md +594 -0
- package/docs/plans/plan-019-post-0.9-roadmap.md +198 -0
- package/docs/product-context-vision-2026-09.md +17 -1
- package/docs/product-vision-2026-09.md +1082 -43
- package/docs/product-vision-review-2026-09.md +13 -1
- package/docs/screenshots/workbench-live-dark.png +0 -0
- package/docs/screenshots/workbench-live-light.png +0 -0
- package/docs/sdk.md +62 -2
- package/package.json +1 -1
- package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/runtime.json +1 -1
- package/plugins/pmx-canvas/plugin.json +1 -1
- package/plugins/pmx-canvas/runtime.json +1 -1
- package/plugins/pmx-canvas/tools.json +601 -22
- package/skills/pmx-canvas/SKILL.md +216 -42
- package/skills/pmx-canvas/evals/evals.json +224 -0
- package/skills/pmx-canvas/references/full-reference.md +120 -21
- package/skills/pmx-canvas/references/github-copilot-app-adapter.md +2 -2
- package/skills/pmx-canvas/references/importing-context.md +132 -0
- package/skills/pmx-canvas/references/installing-pmx-canvas.md +6 -6
- package/skills/pmx-canvas/references/tours-and-recording.md +16 -1
- package/skills/pmx-canvas-testing/SKILL.md +20 -0
- package/src/cli/agent.ts +2 -0
- package/src/cli/commands/ax.ts +12 -0
- package/src/cli/commands/boards.ts +88 -11
- package/src/cli/commands/edges.ts +28 -0
- package/src/cli/commands/groups.ts +7 -0
- package/src/cli/commands/nodes.ts +1 -0
- package/src/cli/commands/query.ts +34 -2
- package/src/cli/commands/record.ts +199 -48
- package/src/cli/index.ts +6 -1
- package/src/client/App.tsx +177 -70
- package/src/client/canvas/AttentionHistory.tsx +0 -2
- package/src/client/canvas/BarHint.tsx +40 -2
- package/src/client/canvas/BoardCopyDialog.tsx +1 -1
- package/src/client/canvas/BoardFolderDialog.tsx +7 -7
- package/src/client/canvas/BoardLinkDialog.tsx +138 -33
- package/src/client/canvas/BoardPinButton.tsx +33 -0
- package/src/client/canvas/BoardSwitcher.tsx +26 -40
- package/src/client/canvas/CanvasNode.tsx +360 -237
- package/src/client/canvas/CanvasViewport.tsx +45 -7
- package/src/client/canvas/CommandBar.tsx +29 -23
- package/src/client/canvas/CommandPalette.tsx +5 -12
- package/src/client/canvas/ConnectionBanner.tsx +3 -3
- package/src/client/canvas/ContextChip.tsx +296 -0
- package/src/client/canvas/ContextMenu.tsx +63 -5
- package/src/client/canvas/CrossBoardReferences.tsx +60 -0
- package/src/client/canvas/EdgeLayer.tsx +339 -76
- package/src/client/canvas/EmptyState.tsx +33 -18
- package/src/client/canvas/ExpandedNodeOverlay.tsx +72 -40
- package/src/client/canvas/ExternalWriters.tsx +57 -42
- package/src/client/canvas/HomeGraphView.tsx +942 -0
- package/src/client/canvas/HomeMapView.tsx +641 -0
- package/src/client/canvas/HomeReviewView.tsx +167 -0
- package/src/client/canvas/HomeView.tsx +687 -160
- package/src/client/canvas/IntentLayer.tsx +19 -12
- package/src/client/canvas/KnowledgeDialog.tsx +488 -0
- package/src/client/canvas/LifecycleChrome.tsx +133 -0
- package/src/client/canvas/LifecycleFields.tsx +91 -0
- package/src/client/canvas/LifecyclePanel.tsx +543 -0
- package/src/client/canvas/MemoryInspector.tsx +104 -0
- package/src/client/canvas/Minimap.tsx +3 -3
- package/src/client/canvas/NearPinLayer.tsx +187 -0
- package/src/client/canvas/NodeContextMark.tsx +175 -97
- package/src/client/canvas/Presentation.tsx +23 -57
- package/src/client/canvas/RelationPresetsDialog.tsx +413 -0
- package/src/client/canvas/RelationsPanel.tsx +82 -0
- package/src/client/canvas/SelectionBar.tsx +3 -6
- package/src/client/canvas/SessionPanel.tsx +90 -50
- package/src/client/canvas/SessionReceipt.tsx +311 -39
- package/src/client/canvas/ShortcutOverlay.tsx +1 -1
- package/src/client/canvas/SnapshotPanel.tsx +27 -36
- package/src/client/canvas/ToolRail.tsx +367 -192
- package/src/client/canvas/TopBar.tsx +354 -124
- package/src/client/canvas/canvas-area.ts +10 -3
- package/src/client/canvas/graph-geometry.ts +195 -0
- package/src/client/canvas/graph-model.ts +254 -0
- package/src/client/canvas/memory-layout.ts +106 -0
- package/src/client/canvas/use-chrome-height.ts +20 -0
- package/src/client/canvas/use-focus-trap.ts +31 -5
- package/src/client/canvas/use-memory-graph.ts +58 -0
- package/src/client/canvas/use-node-drag.ts +2 -1
- package/src/client/canvas/use-pan-zoom.ts +64 -7
- package/src/client/icons.tsx +0 -63
- package/src/client/mcp-app/style.css +0 -6
- package/src/client/nodes/AxStepControls.tsx +74 -50
- package/src/client/nodes/BoardNode.tsx +5 -1
- package/src/client/nodes/ContextNode.tsx +18 -11
- package/src/client/nodes/ExtAppFrame.tsx +6 -3
- package/src/client/nodes/FileNode.tsx +46 -42
- package/src/client/nodes/HtmlNode.tsx +32 -0
- package/src/client/nodes/ImageNode.tsx +1 -1
- package/src/client/nodes/InlineFormatBar.tsx +6 -9
- package/src/client/nodes/InlineMarkdownEditor.tsx +56 -17
- package/src/client/nodes/MarkdownNode.tsx +377 -109
- package/src/client/nodes/McpAppNode.tsx +50 -20
- package/src/client/nodes/MdFormatBar.tsx +21 -18
- package/src/client/nodes/PromptNode.tsx +1 -1
- package/src/client/nodes/ResponseNode.tsx +1 -1
- package/src/client/nodes/viewer-runtime-state.ts +54 -22
- package/src/client/state/attention-bridge.ts +64 -15
- package/src/client/state/boards-store.ts +193 -39
- package/src/client/state/canvas-store.ts +99 -12
- package/src/client/state/context-chip-store.ts +70 -0
- package/src/client/state/context-status-store.ts +53 -0
- package/src/client/state/human-store.ts +13 -7
- package/src/client/state/intent-bridge.ts +51 -30
- package/src/client/state/knowledge-store.ts +43 -0
- package/src/client/state/near-pin-store.ts +115 -6
- package/src/client/state/presence-store.ts +7 -10
- package/src/client/state/presentation.ts +91 -0
- package/src/client/state/relation-store.ts +81 -0
- package/src/client/state/session-store.ts +144 -18
- package/src/client/state/sse-bridge.ts +235 -32
- package/src/client/state/workspace-settings.ts +11 -0
- package/src/client/theme/global.css +2724 -476
- package/src/client/types.ts +12 -0
- package/src/client/utils/keyboard.ts +10 -0
- package/src/client/utils/time-ago.ts +14 -0
- package/src/json-render/renderer/index.tsx +31 -0
- package/src/mcp/canvas-app.ts +12 -2
- package/src/mcp/context-uri-template.ts +7 -4
- package/src/mcp/server.ts +63 -41
- package/src/mcp/workbench-app.ts +39 -6
- package/src/server/agent-presence.ts +128 -28
- package/src/server/ax-context.ts +27 -13
- package/src/server/board-export.ts +12 -1
- package/src/server/canvas-db.ts +331 -42
- package/src/server/canvas-operations.ts +195 -83
- package/src/server/canvas-provenance.ts +53 -22
- package/src/server/canvas-serialization.ts +2 -0
- package/src/server/canvas-state.ts +950 -122
- package/src/server/canvas-validation.ts +9 -2
- package/src/server/context-brief.ts +345 -38
- package/src/server/context-reads.ts +178 -30
- package/src/server/demo-state.json +355 -24
- package/src/server/edit-summary.ts +74 -0
- package/src/server/html-surface.ts +8 -1
- package/src/server/index.ts +181 -11
- package/src/server/knowledge-lifecycle.ts +304 -0
- package/src/server/lifecycle-status.ts +232 -0
- package/src/server/memory-graph.ts +166 -0
- package/src/server/mutation-history.ts +18 -6
- package/src/server/operations/composites.ts +32 -11
- package/src/server/operations/http.ts +7 -2
- package/src/server/operations/index.ts +4 -0
- package/src/server/operations/mcp.ts +26 -1
- package/src/server/operations/ops/ax-presence.ts +1 -1
- package/src/server/operations/ops/ax-read.ts +57 -6
- package/src/server/operations/ops/ax-timeline.ts +28 -2
- package/src/server/operations/ops/backup.ts +5 -3
- package/src/server/operations/ops/batch.ts +35 -4
- package/src/server/operations/ops/boards.ts +188 -47
- package/src/server/operations/ops/canvas-wire.ts +31 -1
- package/src/server/operations/ops/edges.ts +36 -2
- package/src/server/operations/ops/groups.ts +6 -1
- package/src/server/operations/ops/lifecycle.ts +262 -0
- package/src/server/operations/ops/memory-graph.ts +45 -0
- package/src/server/operations/ops/nodes.ts +107 -24
- package/src/server/operations/ops/query.ts +281 -68
- package/src/server/operations/ops/snapshots.ts +73 -1
- package/src/server/operations/ops/validate.ts +5 -1
- package/src/server/operations/ops/viewport.ts +97 -3
- package/src/server/operations/registry.ts +74 -25
- package/src/server/placement.ts +29 -0
- package/src/server/scope-fence.ts +78 -6
- package/src/server/server.ts +115 -16
- package/src/server/spatial-analysis.ts +48 -23
- package/src/server/tour-control.ts +82 -0
- package/src/server/wiki-links.ts +137 -0
- package/src/server/workbench-auth.ts +11 -0
- package/src/shared/agent-context.ts +3 -0
- package/src/shared/agent-presence.ts +15 -15
- package/src/shared/auto-arrange.ts +2 -0
- package/src/shared/boards.ts +4 -4
- package/src/shared/knowledge-lifecycle.ts +22 -0
- package/src/shared/knowledge-presets.ts +80 -0
- package/src/shared/lifecycle-status.ts +26 -0
- package/src/shared/memory-graph.ts +74 -0
- package/src/shared/relations.ts +98 -0
- package/src/shared/semantic-attention.ts +15 -1
- package/src/shared/tour.ts +23 -5
- package/src/shared/workspace-settings.ts +13 -0
- package/dist/types/client/canvas/ContextPinBar.d.ts +0 -1
- package/dist/types/client/canvas/FocusFieldLayer.d.ts +0 -1
- package/dist/types/client/canvas/kind-colors.d.ts +0 -3
- package/dist/types/server/agent-context.d.ts +0 -22
- package/src/client/canvas/ContextPinBar.tsx +0 -25
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* recording never notifies (a read must not trigger more reads).
|
|
7
7
|
*/
|
|
8
8
|
import type { Database } from 'bun:sqlite';
|
|
9
|
+
import type { MemoryGraph } from '../shared/memory-graph.js';
|
|
9
10
|
export declare const CONTEXT_READ_RETENTION = 5000;
|
|
10
11
|
export declare const CONTEXT_READ_CHANNELS: readonly ["operation", "mcp-resource", "mcp-prompt", "adapter"];
|
|
11
12
|
export type ContextReadChannel = (typeof CONTEXT_READ_CHANNELS)[number];
|
|
@@ -24,15 +25,21 @@ export interface ContextRead {
|
|
|
24
25
|
deliveredNodeIds: string[];
|
|
25
26
|
/** Every node on the read board whose content was delivered, with its content revision at read time. */
|
|
26
27
|
readNodes: Record<string, number>;
|
|
28
|
+
/** Every node on the read board that arrived with its relations (summaries count), with its links revision then. */
|
|
29
|
+
seenLinks: Record<string, number>;
|
|
27
30
|
bytes: number;
|
|
28
31
|
/** The board open when the read happened (null on Home). */
|
|
29
32
|
boardId: string | null;
|
|
30
33
|
}
|
|
31
|
-
export type ContextReadInput = Omit<ContextRead, 'seq' | 'id' | 'at' | 'boardId' | 'readNodes'> & {
|
|
34
|
+
export type ContextReadInput = Omit<ContextRead, 'seq' | 'id' | 'at' | 'boardId' | 'readNodes' | 'seenLinks'> & {
|
|
32
35
|
/** Explicit read target, captured before asynchronous formatting/proxy work. */
|
|
33
36
|
boardId?: string | null;
|
|
34
37
|
/** Ids of every serialized node in what the reader received; the server keeps those on the board. */
|
|
35
38
|
readNodeIds?: string[];
|
|
39
|
+
/** Ids of every node that arrived, summaries included; defaults to readNodeIds. */
|
|
40
|
+
seenNodeIds?: string[];
|
|
41
|
+
/** Exact link clocks captured in the delivered projection, before asynchronous transport work. */
|
|
42
|
+
seenLinkRevisions?: Record<string, number>;
|
|
36
43
|
};
|
|
37
44
|
/** One node's read state on a board: the latest agent read that delivered its content. */
|
|
38
45
|
export interface NodeReadStatus {
|
|
@@ -58,16 +65,35 @@ export interface ContextReadConsumerSummary {
|
|
|
58
65
|
* `nodeId` with its text) in what the reader received. A bare id list, a
|
|
59
66
|
* title, or a clipped-off node does not count — the agent got the node's
|
|
60
67
|
* name, not its content. Non-node ids (edges, intents) are dropped by the
|
|
61
|
-
* caller against the board's nodes.
|
|
68
|
+
* caller against the board's nodes. A summary is "seen", not "read": `read`
|
|
69
|
+
* holds only nodes pulled in full and `reached` adds the summaries. Content
|
|
70
|
+
* delivery alone never establishes that the card's relations were delivered.
|
|
62
71
|
*/
|
|
63
|
-
export declare function deliveredIds(payloadText: string):
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
export declare function deliveredIds(payloadText: string): {
|
|
73
|
+
read: Set<string>;
|
|
74
|
+
reached: Set<string>;
|
|
75
|
+
};
|
|
66
76
|
export declare function contextReadFromPayload(base: Omit<ContextReadInput, 'deliveredNodeIds' | 'bytes' | 'readNodeIds'>, payload: unknown): ContextReadInput;
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Reads a `context.get` brief made on pinned boards (vision move 0a): one per
|
|
79
|
+
* pinned board whose map arrived, so the board shows as read. Its cards came as
|
|
80
|
+
* summaries, which mark nothing read until the agent pulls them; only summaries
|
|
81
|
+
* with complete, unclipped relations count as links seen on that board.
|
|
82
|
+
*/
|
|
83
|
+
export declare function pinnedBoardReads(base: Omit<ContextReadInput, 'deliveredNodeIds' | 'bytes' | 'readNodeIds' | 'pinnedNodeIds' | 'boardId'>, payload: unknown): ContextReadInput[];
|
|
84
|
+
/** Graph summaries are seen on their own boards, never full-content reads or a board switch. */
|
|
85
|
+
export declare function graphReads(base: Pick<ContextReadInput, 'channel' | 'resource' | 'source' | 'consumer' | 'agentId'>, graph: MemoryGraph): ContextReadInput[];
|
|
86
|
+
export declare const CONTEXT_READS_SCHEMA_SQL = "\n CREATE TABLE IF NOT EXISTS context_reads (\n seq INTEGER PRIMARY KEY AUTOINCREMENT,\n id TEXT NOT NULL UNIQUE,\n at TEXT NOT NULL,\n channel TEXT NOT NULL,\n resource TEXT NOT NULL,\n source TEXT NOT NULL,\n consumer TEXT,\n agent_id TEXT,\n pinned_node_ids TEXT NOT NULL DEFAULT '[]',\n delivered_node_ids TEXT NOT NULL DEFAULT '[]',\n bytes INTEGER NOT NULL DEFAULT 0,\n board_id TEXT,\n read_nodes TEXT NOT NULL DEFAULT '{}',\n seen_links TEXT NOT NULL DEFAULT '{}'\n );\n";
|
|
87
|
+
export declare function appendContextReadToDB(db: Database, input: ContextReadInput, boardId: string | null, readNodes?: Record<string, number>, seenLinks?: Record<string, number>): ContextRead;
|
|
69
88
|
/** Per node on a board, the latest agent read that delivered its content (newest row wins). */
|
|
70
89
|
export declare function loadNodeReadStatusFromDB(db: Database, boardId: string): NodeReadStatus[];
|
|
90
|
+
/** The latest agent read on a board, of any kind (a brief, a pinned-board map, a pull), or null. */
|
|
91
|
+
export declare function loadBoardLastReadFromDB(db: Database, boardId: string): {
|
|
92
|
+
lastReadAt: string;
|
|
93
|
+
lastReadBy: string;
|
|
94
|
+
} | null;
|
|
95
|
+
/** Per node on a board, the newest links revision any agent read has carried (connection marks). */
|
|
96
|
+
export declare function loadSeenLinksFromDB(db: Database, boardId: string): Record<string, number>;
|
|
71
97
|
/** Every node on a board whose content an agent read at or after `since` (ISO). */
|
|
72
98
|
export declare function loadReadNodeIdsSince(db: Database, boardId: string, since: string): string[];
|
|
73
99
|
/** Newest first. The summary covers every retained row, not just the returned page. */
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CanvasNodeState } from './canvas-state.js';
|
|
2
|
+
/** "See change" shows this much of each side, centred on the first difference. */
|
|
3
|
+
export declare const CHANGE_EXCERPT = 1200;
|
|
4
|
+
export declare function cardText(node: CanvasNodeState): string;
|
|
5
|
+
/**
|
|
6
|
+
* What an agent's edit did to a card, in a few words, from the card before
|
|
7
|
+
* the session and now (AgentContext.dc.html: "rewrote the second paragraph").
|
|
8
|
+
* Paragraphs are aligned on their shared start and end, so a paragraph added
|
|
9
|
+
* at the top reads as added, not as everything rewritten.
|
|
10
|
+
*/
|
|
11
|
+
export declare function describeEdit(before: CanvasNodeState, after: CanvasNodeState): string;
|
|
12
|
+
/**
|
|
13
|
+
* Before and after for "See change": each side cut to CHANGE_EXCERPT around
|
|
14
|
+
* the first character that differs, with "…" where text was cut, so a change
|
|
15
|
+
* deep in a long card is what shows.
|
|
16
|
+
*/
|
|
17
|
+
export declare function changeExcerpts(was: string, now: string): {
|
|
18
|
+
before: string;
|
|
19
|
+
after: string;
|
|
20
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from 'node:events';
|
|
2
|
-
import { type Tour } from '../shared/tour.js';
|
|
2
|
+
import { type Camera, type Tour, type TourStop } from '../shared/tour.js';
|
|
3
|
+
import { type TourStep, type TourStepResult } from './tour-control.js';
|
|
3
4
|
export type { Tour, TourStop } from '../shared/tour.js';
|
|
5
|
+
export type { TourStep, TourStepResult } from './tour-control.js';
|
|
4
6
|
import type { AgentPhase, AgentPresence, AgentPresenceSnapshot } from '../shared/agent-presence.js';
|
|
5
7
|
import { canvasState } from './canvas-state.js';
|
|
6
8
|
import type { CanvasAnnotation, CanvasNodeState, CanvasEdge, CanvasLayout } from './canvas-state.js';
|
|
@@ -8,10 +10,10 @@ import { type AxInteractionInput, type AxInteractionPublicResult } from './ax-in
|
|
|
8
10
|
import type { PmxAxIntent } from '../shared/ax-intent.js';
|
|
9
11
|
import type { PmxAxActivityKind, PmxAxApprovalGate, PmxAxCommandDescriptor, PmxAxContext, PmxAxElicitation, PmxAxEvent, PmxAxEvidence, PmxAxEvidenceKind, PmxAxFocusState, PmxAxHostCapability, PmxAxMode, PmxAxModeRequest, PmxAxPolicy, PmxAxReviewAnchorType, PmxAxReviewAnnotation, PmxAxReviewKind, PmxAxReviewRegion, PmxAxReviewSeverity, PmxAxReviewStatus, PmxAxSource, PmxAxState, PmxAxSteeringMessage, PmxAxWorkItem, PmxAxWorkItemStatus } from './ax-state.js';
|
|
10
12
|
import type { AxTimelineQuery, CanvasBoard } from './canvas-db.js';
|
|
13
|
+
import type { MemoryGraph } from '../shared/memory-graph.js';
|
|
11
14
|
import type { Attachment, DocumentImport, ImportSection } from './document-import.js';
|
|
12
15
|
import type { BackupFile, BackupStatus } from './backup.js';
|
|
13
16
|
import type { ExportManifest } from './board-export.js';
|
|
14
|
-
import { searchNodes } from './spatial-analysis.js';
|
|
15
17
|
import { diffLayouts } from './mutation-history.js';
|
|
16
18
|
import { fitCanvasView, gcCanvasSnapshots, listCanvasSnapshots } from './canvas-operations.js';
|
|
17
19
|
import { type OpenMcpAppCoreResult } from './operations/index.js';
|
|
@@ -58,10 +60,14 @@ export declare class PmxCanvas extends EventEmitter {
|
|
|
58
60
|
* or keep the whole node — both work. (Previously returned a bare id string.)
|
|
59
61
|
*/
|
|
60
62
|
addNode(input: {
|
|
63
|
+
destinationBoardId?: string;
|
|
64
|
+
requestId?: string;
|
|
65
|
+
expectedBoardId?: string | null;
|
|
61
66
|
intentId?: string;
|
|
62
67
|
type: CanvasNodeState['type'];
|
|
63
68
|
title?: string;
|
|
64
69
|
content?: string;
|
|
70
|
+
data?: Record<string, unknown>;
|
|
65
71
|
children?: string[];
|
|
66
72
|
childIds?: string[];
|
|
67
73
|
childLayout?: 'grid' | 'column' | 'flow';
|
|
@@ -107,16 +113,23 @@ export declare class PmxCanvas extends EventEmitter {
|
|
|
107
113
|
intentId?: string;
|
|
108
114
|
}): void;
|
|
109
115
|
addEdge(input: {
|
|
116
|
+
destinationBoardId?: string;
|
|
117
|
+
requestId?: string;
|
|
118
|
+
expectedBoardId?: string | null;
|
|
110
119
|
intentId?: string;
|
|
111
120
|
from?: string;
|
|
112
121
|
to?: string;
|
|
122
|
+
toBoardId?: string;
|
|
113
123
|
fromSearch?: string;
|
|
114
124
|
toSearch?: string;
|
|
115
125
|
type: CanvasEdge['type'];
|
|
126
|
+
kind?: string;
|
|
127
|
+
reason?: string;
|
|
116
128
|
label?: string;
|
|
117
129
|
style?: CanvasEdge['style'];
|
|
118
130
|
animated?: boolean;
|
|
119
131
|
}): string;
|
|
132
|
+
updateEdge(id: string, patch: Partial<Pick<CanvasEdge, 'type' | 'kind' | 'reason' | 'label' | 'style' | 'animated'>>): Promise<CanvasEdge>;
|
|
120
133
|
addAnnotation(input: Omit<CanvasAnnotation, 'id' | 'createdAt'> & {
|
|
121
134
|
id?: string;
|
|
122
135
|
createdAt?: string;
|
|
@@ -128,6 +141,9 @@ export declare class PmxCanvas extends EventEmitter {
|
|
|
128
141
|
* If childIds are provided, the group auto-sizes to contain them with padding.
|
|
129
142
|
*/
|
|
130
143
|
createGroup(input: {
|
|
144
|
+
destinationBoardId?: string;
|
|
145
|
+
requestId?: string;
|
|
146
|
+
expectedBoardId?: string | null;
|
|
131
147
|
intentId?: string;
|
|
132
148
|
title?: string;
|
|
133
149
|
childIds?: string[];
|
|
@@ -149,6 +165,16 @@ export declare class PmxCanvas extends EventEmitter {
|
|
|
149
165
|
}): boolean;
|
|
150
166
|
getTour(): Tour;
|
|
151
167
|
setTour(tour: Tour | null): void;
|
|
168
|
+
/** Present a tour stop (index, `next` or `previous`) in the workbench. Not recorded in undo history. */
|
|
169
|
+
goToTourStop(step: TourStep, options?: {
|
|
170
|
+
present?: boolean;
|
|
171
|
+
}): TourStepResult;
|
|
172
|
+
/** Leave presentation in every viewer. */
|
|
173
|
+
exitTour(): void;
|
|
174
|
+
/** Ease the camera to a node, world rect or viewport. Not recorded in undo history. */
|
|
175
|
+
moveCamera(stop: TourStop): {
|
|
176
|
+
viewport: Camera;
|
|
177
|
+
};
|
|
152
178
|
clear(): void;
|
|
153
179
|
arrange(layout?: 'grid' | 'column' | 'flow'): void;
|
|
154
180
|
focusNode(id: string, options?: {
|
|
@@ -239,23 +265,32 @@ export declare class PmxCanvas extends EventEmitter {
|
|
|
239
265
|
import: DocumentImport;
|
|
240
266
|
nodeIds: string[];
|
|
241
267
|
}>;
|
|
242
|
-
createBoard(name: string,
|
|
243
|
-
/**
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
268
|
+
createBoard(name: string, folder?: string): Promise<CanvasBoard>;
|
|
269
|
+
/** Workspace category and folder actions do not open a board. */
|
|
270
|
+
knowledge<T extends import('./knowledge-lifecycle.js').KnowledgeInput>(input: T): Promise<import('./knowledge-lifecycle.js').KnowledgeResults[T['action']]>;
|
|
271
|
+
lifecycle<T extends import('./knowledge-lifecycle.js').LifecycleInput>(input: T): Promise<import('./knowledge-lifecycle.js').LifecycleResults[T['action']]>;
|
|
272
|
+
/** Rename a board and/or file it under a folder (`folder: null` unfiles it). */
|
|
273
|
+
updateBoard(id: string, patch: Parameters<typeof canvasState.updateBoard>[1]): Promise<void>;
|
|
248
274
|
setBoardReadme(id: string, readmeNodeId: string | null): Promise<void>;
|
|
275
|
+
/** Pin a board into the agent's working set (its README and pinned cards reach every brief). */
|
|
276
|
+
pinBoard(id: string, reason?: string): Promise<void>;
|
|
277
|
+
unpinBoard(id: string): Promise<void>;
|
|
249
278
|
createBoardFrom(input: {
|
|
250
279
|
sourceBoardId: string;
|
|
251
280
|
name: string;
|
|
252
|
-
|
|
281
|
+
folder?: string;
|
|
253
282
|
nodeIds?: string[];
|
|
254
283
|
includeReadme?: boolean;
|
|
255
284
|
includeStructure?: boolean;
|
|
256
285
|
preview?: boolean;
|
|
257
286
|
}): Promise<Record<string, unknown>>;
|
|
258
287
|
searchLibrary(query: string, limit?: number): Promise<Record<string, unknown>>;
|
|
288
|
+
/** Same projection as Home Graph. Discovery summaries never count as full-content reads. */
|
|
289
|
+
getMemoryGraph(options?: {
|
|
290
|
+
focus?: string;
|
|
291
|
+
depth?: number;
|
|
292
|
+
projection?: 'full' | 'boards';
|
|
293
|
+
}): Promise<MemoryGraph>;
|
|
259
294
|
/** Budgeted cross-board brief. Budget is measured in UTF-16 characters. */
|
|
260
295
|
getContextBrief(options?: {
|
|
261
296
|
consumer?: string;
|
|
@@ -297,6 +332,8 @@ export declare class PmxCanvas extends EventEmitter {
|
|
|
297
332
|
getContextReads(limit?: number): ReturnType<typeof canvasState.getContextReads>;
|
|
298
333
|
/** Per node on a board: when an agent last read its content, who, and the content revision it read. */
|
|
299
334
|
getNodeReadStatus(board?: string): ReturnType<typeof canvasState.getNodeReadStatus>;
|
|
335
|
+
/** A board's latest agent read of any kind (a pinned board's map counts), or null. */
|
|
336
|
+
getBoardLastRead(board?: string): ReturnType<typeof canvasState.getBoardLastRead>;
|
|
300
337
|
listWorkItems(): PmxAxWorkItem[];
|
|
301
338
|
addWorkItem(input: {
|
|
302
339
|
title: string;
|
|
@@ -492,7 +529,21 @@ export declare class PmxCanvas extends EventEmitter {
|
|
|
492
529
|
getNode(id: string, options?: {
|
|
493
530
|
board?: string;
|
|
494
531
|
}): SdkCanvasNode | undefined;
|
|
495
|
-
search(query: string
|
|
532
|
+
search(query: string, options?: {
|
|
533
|
+
scope?: 'active' | 'library';
|
|
534
|
+
boardId?: string;
|
|
535
|
+
folder?: string;
|
|
536
|
+
limit?: number;
|
|
537
|
+
}): {
|
|
538
|
+
qualification?: import("../shared/lifecycle-status.js").LifecycleQualification | undefined;
|
|
539
|
+
boardId: string | null;
|
|
540
|
+
cardId: string;
|
|
541
|
+
id: string;
|
|
542
|
+
type: string;
|
|
543
|
+
title: string | null;
|
|
544
|
+
snippet: string;
|
|
545
|
+
score: number;
|
|
546
|
+
}[];
|
|
496
547
|
getSpatialContext(): import("./spatial-analysis.js").SpatialContext;
|
|
497
548
|
undo(): Promise<{
|
|
498
549
|
ok: boolean;
|
|
@@ -533,6 +584,15 @@ export declare class PmxCanvas extends EventEmitter {
|
|
|
533
584
|
restoreSnapshot(id: string): Promise<{
|
|
534
585
|
ok: boolean;
|
|
535
586
|
}>;
|
|
587
|
+
/** Put one card back to its content in a snapshot (the receipt's Undo on an edit). */
|
|
588
|
+
restoreSnapshotNode(snapshotId: string, nodeId: string, options?: {
|
|
589
|
+
preserveHumanEdits?: boolean;
|
|
590
|
+
}): Promise<{
|
|
591
|
+
ok: boolean;
|
|
592
|
+
id: string;
|
|
593
|
+
restored: boolean;
|
|
594
|
+
skipped?: 'human-edit';
|
|
595
|
+
}>;
|
|
536
596
|
deleteSnapshot(id: string): {
|
|
537
597
|
ok: boolean;
|
|
538
598
|
};
|
|
@@ -714,3 +774,4 @@ export type { HtmlPrimitiveKind, HtmlPrimitiveDescriptor, HtmlPrimitiveInput, Ht
|
|
|
714
774
|
export { traceManager } from './trace-manager.js';
|
|
715
775
|
export type { PmxAxApprovalGate, PmxAxApprovalStatus, PmxAxCommandDescriptor, PmxAxContext, PmxAxEvent, PmxAxElicitation, PmxAxElicitationStatus, PmxAxEventKind, PmxAxEvidence, PmxAxEvidenceKind, PmxAxFocusState, PmxAxHostCapability, PmxAxMode, PmxAxModeRequest, PmxAxModeRequestStatus, PmxAxPolicy, PmxAxReviewAnchorType, PmxAxReviewAnnotation, PmxAxReviewKind, PmxAxReviewRegion, PmxAxReviewSeverity, PmxAxReviewStatus, PmxAxSource, PmxAxState, PmxAxSteeringMessage, PmxAxTimelineSummary, PmxAxWorkItem, PmxAxWorkItemStatus, } from './ax-state.js';
|
|
716
776
|
export type { AxTimelineQuery } from './canvas-db.js';
|
|
777
|
+
export type { Lifecycle, KnowledgeCategory, FolderProperties, ReviewRecord, KnowledgeInput, KnowledgeResults, LifecycleInput, LifecycleResults, } from './knowledge-lifecycle.js';
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import type { Database } from 'bun:sqlite';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { type ActorAttribution } from './attribution.js';
|
|
4
|
+
import type { LifecycleQualification } from '../shared/lifecycle-status.js';
|
|
5
|
+
import type { CanvasNodeState } from './canvas-state.js';
|
|
6
|
+
import { type RelationPreset } from '../shared/relations.js';
|
|
7
|
+
import { type KnowledgeCategory, type Lifecycle } from '../shared/knowledge-lifecycle.js';
|
|
8
|
+
export { categorySchema, lifecycleSchema, type KnowledgeCategory, type Lifecycle, } from '../shared/knowledge-lifecycle.js';
|
|
9
|
+
export interface ReviewCardSummary {
|
|
10
|
+
boardId: string;
|
|
11
|
+
cardId: string;
|
|
12
|
+
boardTitle: string;
|
|
13
|
+
folder: string | null;
|
|
14
|
+
title: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const folderPropertiesSchema: z.ZodObject<{
|
|
17
|
+
path: z.ZodString;
|
|
18
|
+
categoryId: z.ZodNullable<z.ZodString>;
|
|
19
|
+
lifecycleOverride: z.ZodNullable<z.ZodObject<{
|
|
20
|
+
decayType: z.ZodEnum<{
|
|
21
|
+
reality: "reality";
|
|
22
|
+
decision: "decision";
|
|
23
|
+
dependency: "dependency";
|
|
24
|
+
relevance: "relevance";
|
|
25
|
+
}>;
|
|
26
|
+
rate: z.ZodEnum<{
|
|
27
|
+
fast: "fast";
|
|
28
|
+
medium: "medium";
|
|
29
|
+
slow: "slow";
|
|
30
|
+
durable: "durable";
|
|
31
|
+
}>;
|
|
32
|
+
triggers: z.ZodArray<z.ZodString>;
|
|
33
|
+
revalidationMethod: z.ZodString;
|
|
34
|
+
cadenceDays: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
}, z.core.$strict>>;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export type FolderProperties = z.infer<typeof folderPropertiesSchema>;
|
|
38
|
+
export interface ReviewRecord {
|
|
39
|
+
id: string;
|
|
40
|
+
boardId: string;
|
|
41
|
+
nodeId: string;
|
|
42
|
+
outcome: 'retain' | 'revise' | 'externalize' | 'retire' | 'unresolved' | 'restore';
|
|
43
|
+
evidence: string;
|
|
44
|
+
applied: boolean;
|
|
45
|
+
who: ActorAttribution;
|
|
46
|
+
when: string;
|
|
47
|
+
/** Exact semantic version reviewed; old unversioned records remain unknown. */
|
|
48
|
+
contentRevision: number | null;
|
|
49
|
+
sourceRevisions?: Record<string, number | null>;
|
|
50
|
+
}
|
|
51
|
+
export type KnowledgeInput = {
|
|
52
|
+
action: 'list';
|
|
53
|
+
} | {
|
|
54
|
+
action: 'category-set';
|
|
55
|
+
category: KnowledgeCategory;
|
|
56
|
+
} | {
|
|
57
|
+
action: 'category-remove';
|
|
58
|
+
id: string;
|
|
59
|
+
} | {
|
|
60
|
+
action: 'relation-preset-set';
|
|
61
|
+
preset: RelationPreset;
|
|
62
|
+
} | {
|
|
63
|
+
action: 'relation-preset-remove';
|
|
64
|
+
id: string;
|
|
65
|
+
} | ({
|
|
66
|
+
action: 'folder-set';
|
|
67
|
+
} & FolderProperties);
|
|
68
|
+
export interface KnowledgeResults {
|
|
69
|
+
list: {
|
|
70
|
+
ok: true;
|
|
71
|
+
categories: KnowledgeCategory[];
|
|
72
|
+
folders: FolderProperties[];
|
|
73
|
+
relationPresets: RelationPreset[];
|
|
74
|
+
cards: Record<string, LifecycleQualification>;
|
|
75
|
+
reviewCards: ReviewCardSummary[];
|
|
76
|
+
resolvedFolders: Record<string, ReturnType<KnowledgeLifecycle['resolve']>>;
|
|
77
|
+
};
|
|
78
|
+
'category-set': {
|
|
79
|
+
ok: true;
|
|
80
|
+
category: KnowledgeCategory;
|
|
81
|
+
};
|
|
82
|
+
'category-remove': {
|
|
83
|
+
ok: true;
|
|
84
|
+
id: string;
|
|
85
|
+
};
|
|
86
|
+
'relation-preset-set': {
|
|
87
|
+
ok: true;
|
|
88
|
+
preset: RelationPreset;
|
|
89
|
+
};
|
|
90
|
+
'relation-preset-remove': {
|
|
91
|
+
ok: true;
|
|
92
|
+
id: string;
|
|
93
|
+
};
|
|
94
|
+
'folder-set': {
|
|
95
|
+
ok: true;
|
|
96
|
+
folder: FolderProperties;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export type LifecycleInput = {
|
|
100
|
+
action: 'get';
|
|
101
|
+
id: string;
|
|
102
|
+
board?: string;
|
|
103
|
+
} | {
|
|
104
|
+
action: 'set';
|
|
105
|
+
id: string;
|
|
106
|
+
expectedBoardId?: string | null;
|
|
107
|
+
lifecycleOverride: Lifecycle | null;
|
|
108
|
+
} | {
|
|
109
|
+
action: 'review';
|
|
110
|
+
id: string;
|
|
111
|
+
expectedBoardId?: string | null;
|
|
112
|
+
outcome: Exclude<ReviewRecord['outcome'], 'restore'>;
|
|
113
|
+
evidence: string;
|
|
114
|
+
applied: boolean;
|
|
115
|
+
expectedContentRevision?: number;
|
|
116
|
+
expectedSources?: Record<string, number | null>;
|
|
117
|
+
} | {
|
|
118
|
+
action: 'restore';
|
|
119
|
+
id: string;
|
|
120
|
+
expectedBoardId?: string | null;
|
|
121
|
+
evidence: string;
|
|
122
|
+
};
|
|
123
|
+
export interface LifecycleResults {
|
|
124
|
+
get: {
|
|
125
|
+
ok: true;
|
|
126
|
+
boardId: string;
|
|
127
|
+
nodeId: string;
|
|
128
|
+
contentRevision: number;
|
|
129
|
+
qualification: LifecycleQualification;
|
|
130
|
+
} & ReturnType<KnowledgeLifecycle['resolve']> & ReturnType<KnowledgeLifecycle['reviews']>;
|
|
131
|
+
set: {
|
|
132
|
+
ok: true;
|
|
133
|
+
};
|
|
134
|
+
review: {
|
|
135
|
+
ok: true;
|
|
136
|
+
record: ReviewRecord;
|
|
137
|
+
};
|
|
138
|
+
restore: {
|
|
139
|
+
ok: true;
|
|
140
|
+
record: ReviewRecord;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/** Workspace-owned data, deliberately outside board snapshots and read clocks. */
|
|
144
|
+
export declare class KnowledgeLifecycle {
|
|
145
|
+
private readonly getDb;
|
|
146
|
+
private readonly changed;
|
|
147
|
+
private readonly getContentRevision;
|
|
148
|
+
private readonly flush;
|
|
149
|
+
constructor(getDb: () => Database | null, changed: () => void, getContentRevision: (boardId: string, nodeId: string) => number, flush: () => void);
|
|
150
|
+
private db;
|
|
151
|
+
list(): {
|
|
152
|
+
categories: KnowledgeCategory[];
|
|
153
|
+
folders: FolderProperties[];
|
|
154
|
+
relationPresets: RelationPreset[];
|
|
155
|
+
};
|
|
156
|
+
setRelationPreset(value: RelationPreset): RelationPreset;
|
|
157
|
+
removeRelationPreset(id: string): string;
|
|
158
|
+
setCategory(value: KnowledgeCategory): KnowledgeCategory;
|
|
159
|
+
removeCategory(id: string): string;
|
|
160
|
+
setFolder(value: FolderProperties): FolderProperties;
|
|
161
|
+
resolve(folderPath: string | null, override?: Lifecycle | null, catalog?: {
|
|
162
|
+
categories: KnowledgeCategory[];
|
|
163
|
+
folders: FolderProperties[];
|
|
164
|
+
relationPresets: RelationPreset[];
|
|
165
|
+
}): {
|
|
166
|
+
category: {
|
|
167
|
+
decayType: "reality" | "decision" | "dependency" | "relevance";
|
|
168
|
+
rate: "fast" | "medium" | "slow" | "durable";
|
|
169
|
+
triggers: string[];
|
|
170
|
+
revalidationMethod: string;
|
|
171
|
+
id: string;
|
|
172
|
+
name: string;
|
|
173
|
+
glyph: string;
|
|
174
|
+
cadenceDays?: number | undefined;
|
|
175
|
+
} | null;
|
|
176
|
+
categorySourceFolder: string | null;
|
|
177
|
+
lifecycle: {
|
|
178
|
+
decayType: "reality" | "decision" | "dependency" | "relevance";
|
|
179
|
+
rate: "fast" | "medium" | "slow" | "durable";
|
|
180
|
+
triggers: string[];
|
|
181
|
+
revalidationMethod: string;
|
|
182
|
+
cadenceDays?: number | undefined;
|
|
183
|
+
} | null;
|
|
184
|
+
lifecycleSourceFolder: string | null;
|
|
185
|
+
lifecycleSource: "unknown" | "card" | "folder";
|
|
186
|
+
};
|
|
187
|
+
resolveCard(folderPath: string | null, node: Pick<CanvasNodeState, 'type' | 'data'>, catalog?: {
|
|
188
|
+
categories: KnowledgeCategory[];
|
|
189
|
+
folders: FolderProperties[];
|
|
190
|
+
relationPresets: RelationPreset[];
|
|
191
|
+
}): {
|
|
192
|
+
category: {
|
|
193
|
+
decayType: "reality" | "decision" | "dependency" | "relevance";
|
|
194
|
+
rate: "fast" | "medium" | "slow" | "durable";
|
|
195
|
+
triggers: string[];
|
|
196
|
+
revalidationMethod: string;
|
|
197
|
+
id: string;
|
|
198
|
+
name: string;
|
|
199
|
+
glyph: string;
|
|
200
|
+
cadenceDays?: number | undefined;
|
|
201
|
+
} | null;
|
|
202
|
+
categorySourceFolder: string | null;
|
|
203
|
+
lifecycle: {
|
|
204
|
+
decayType: "reality" | "decision" | "dependency" | "relevance";
|
|
205
|
+
rate: "fast" | "medium" | "slow" | "durable";
|
|
206
|
+
triggers: string[];
|
|
207
|
+
revalidationMethod: string;
|
|
208
|
+
cadenceDays?: number | undefined;
|
|
209
|
+
} | null;
|
|
210
|
+
lifecycleSourceFolder: string | null;
|
|
211
|
+
lifecycleSource: "unknown" | "card" | "folder";
|
|
212
|
+
};
|
|
213
|
+
reviews(boardId: string, nodeId: string): {
|
|
214
|
+
records: ReviewRecord[];
|
|
215
|
+
retired: boolean;
|
|
216
|
+
lastValidation: ReviewRecord | null;
|
|
217
|
+
};
|
|
218
|
+
record(boardId: string, nodeId: string, input: Pick<ReviewRecord, 'outcome' | 'evidence' | 'applied'> & {
|
|
219
|
+
expectedContentRevision?: number;
|
|
220
|
+
}, sourceRevisions?: Record<string, number | null>): ReviewRecord;
|
|
221
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type MemoryTarget } from '../shared/memory-graph.js';
|
|
2
|
+
import type { LifecycleQualification } from '../shared/lifecycle-status.js';
|
|
3
|
+
import type { ReviewCardSummary } from './knowledge-lifecycle.js';
|
|
4
|
+
/** A read-only qualification, shared by briefs, search, Home and card review. No clock is renewed. */
|
|
5
|
+
export declare function lifecycleQualifications(now?: number, atUse?: MemoryTarget[]): Record<string, LifecycleQualification>;
|
|
6
|
+
/** Compact queue metadata and qualifications come from the same authoritative read. */
|
|
7
|
+
export declare function lifecycleSnapshot(now?: number, atUse?: MemoryTarget[]): {
|
|
8
|
+
cards: Record<string, LifecycleQualification>;
|
|
9
|
+
reviewCards: ReviewCardSummary[];
|
|
10
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type MemoryGraph, type MemoryGraphEdge } from '../shared/memory-graph.js';
|
|
2
|
+
/** One library projection for Home, backlinks, brief discovery and agent exploration. No writes. */
|
|
3
|
+
export declare function memoryGraph(projection?: 'full' | 'boards'): MemoryGraph;
|
|
4
|
+
/** Keep original qualified endpoints and missing evidence, without card summaries or membership. */
|
|
5
|
+
export declare function boardMemoryGraph(graph: MemoryGraph): MemoryGraph;
|
|
6
|
+
/** Board-level connections are a collapse of the SAME edges, not another link scanner. */
|
|
7
|
+
export declare function boardConnections(graph: MemoryGraph): MemoryGraphEdge[];
|
|
8
|
+
/** Undirected exploration. Membership is a hop too; focus accepts a board ID, qualified key, or pins. */
|
|
9
|
+
export declare function localMemoryGraph(graph: MemoryGraph, focus: string | null, depth: number): MemoryGraph;
|
|
@@ -59,12 +59,14 @@ export interface SnapshotDiffResult {
|
|
|
59
59
|
id: string;
|
|
60
60
|
from: string;
|
|
61
61
|
to: string;
|
|
62
|
+
toBoardId?: string;
|
|
62
63
|
type: string;
|
|
63
64
|
}[];
|
|
64
65
|
removedEdges: {
|
|
65
66
|
id: string;
|
|
66
67
|
from: string;
|
|
67
68
|
to: string;
|
|
69
|
+
toBoardId?: string;
|
|
68
70
|
type: string;
|
|
69
71
|
}[];
|
|
70
72
|
}
|
|
@@ -14,10 +14,10 @@ import type { PmxAxSource } from '../../ax-state.js';
|
|
|
14
14
|
export declare const AX_SOURCES: readonly ["agent", "amp", "api", "browser", "cli", "codex", "copilot", "mcp", "sdk", "system"];
|
|
15
15
|
/** Zod schema for the optional `source` field shared by AX MCP tool shapes. */
|
|
16
16
|
export declare const AX_SOURCE_SHAPE: z.ZodOptional<z.ZodEnum<{
|
|
17
|
-
amp: "amp";
|
|
18
17
|
agent: "agent";
|
|
19
18
|
system: "system";
|
|
20
19
|
sdk: "sdk";
|
|
20
|
+
amp: "amp";
|
|
21
21
|
api: "api";
|
|
22
22
|
browser: "browser";
|
|
23
23
|
cli: "cli";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type CanvasLayout } from '../../canvas-state.js';
|
|
2
2
|
import { type Operation } from '../types.js';
|
|
3
|
-
export declare
|
|
3
|
+
export declare const boardCatalogEpoch: `${string}-${string}-${string}-${string}-${string}`;
|
|
4
|
+
export declare function boardsPayload(reloaded?: boolean): Record<string, unknown>;
|
|
4
5
|
/** Read a board without opening it. Omitted board preserves the active-board contract. */
|
|
5
6
|
export declare function readTargetBoard(boardId?: unknown, includeBlobs?: boolean): {
|
|
6
7
|
boardId: string | null;
|
|
@@ -7,6 +7,8 @@ export declare function defaultNodeSize(type: string): {
|
|
|
7
7
|
width: number;
|
|
8
8
|
height: number;
|
|
9
9
|
};
|
|
10
|
+
/** Parent traversal in a relative path, using the path implementation's separator. */
|
|
11
|
+
export declare function isParentTraversal(path: string, separator: string): boolean;
|
|
10
12
|
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
11
13
|
export declare function pickFiniteNumber(record: Record<string, unknown>, key: string): number | undefined;
|
|
12
14
|
export declare function getRecord(value: unknown): Record<string, unknown> | undefined;
|
|
@@ -33,6 +35,7 @@ export declare function createdNodePayloadFromNode(node: CanvasNodeState, option
|
|
|
33
35
|
*/
|
|
34
36
|
export declare function createBasicCanvasNode(body: Record<string, unknown>, options: {
|
|
35
37
|
fileMode: 'auto' | 'path';
|
|
38
|
+
prepareOnlyNodes?: CanvasNodeState[];
|
|
36
39
|
}): {
|
|
37
40
|
node: CanvasNodeState;
|
|
38
41
|
needsCodeGraphRecompute: boolean;
|
|
@@ -55,4 +58,6 @@ export declare function buildNodePatch(existing: CanvasNodeState, body: Record<s
|
|
|
55
58
|
export declare function removeNodeCore(id: string): {
|
|
56
59
|
needsCodeGraphRecompute: boolean;
|
|
57
60
|
};
|
|
61
|
+
/** Explicit creation identity is opt-in, not content-based deduplication. */
|
|
62
|
+
export declare function createDestinationNode(body: Record<string, unknown>): CanvasNodeState;
|
|
58
63
|
export declare const nodeOperations: Operation[];
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
import { type Operation } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The brief's page size in UTF-16 characters (canvas://context?budget=N). It is
|
|
4
|
+
* not shown to the human: a brief longer than one page continues on the next read.
|
|
5
|
+
*/
|
|
2
6
|
export declare const DEFAULT_CONTEXT_BRIEF_BUDGET = 16000;
|
|
3
7
|
export declare const MAX_CONTEXT_BRIEF_BUDGET = 100000;
|
|
8
|
+
/** Search without opening boards; HTTP, MCP and SDK share discovery and ranking. */
|
|
9
|
+
export declare function searchCanvasNodes(q: string, options?: {
|
|
10
|
+
scope?: 'active' | 'library';
|
|
11
|
+
boardId?: string;
|
|
12
|
+
folder?: string;
|
|
13
|
+
limit?: number | string;
|
|
14
|
+
}): {
|
|
15
|
+
results: {
|
|
16
|
+
qualification?: import("../../../shared/lifecycle-status.js").LifecycleQualification | undefined;
|
|
17
|
+
boardId: string | null;
|
|
18
|
+
cardId: string;
|
|
19
|
+
id: string;
|
|
20
|
+
type: string;
|
|
21
|
+
title: string | null;
|
|
22
|
+
snippet: string;
|
|
23
|
+
score: number;
|
|
24
|
+
}[];
|
|
25
|
+
query: string;
|
|
26
|
+
};
|
|
4
27
|
export declare const queryOperations: Operation[];
|
|
@@ -4,6 +4,7 @@ export declare function getOperation(name: string): Operation;
|
|
|
4
4
|
export declare function listOperations(): Operation[];
|
|
5
5
|
type OperationEventEmitter = (event: string, payload: Record<string, unknown>) => void;
|
|
6
6
|
export declare function setOperationEventEmitter(emitter: OperationEventEmitter | null): void;
|
|
7
|
+
export declare function getOperationEventEmitter(): OperationEventEmitter | null;
|
|
7
8
|
/** True while operation SSE emits are being suppressed (inside a meta-op such as
|
|
8
9
|
* canvas.batch). Ops whose effect depends on a live SSE emit firing — e.g.
|
|
9
10
|
* mcpapp.open, whose canvas node is created as a side-effect of `ext-app-open` —
|
|
@@ -2,6 +2,13 @@ import { type CanvasPlacementRect } from '../shared/placement.js';
|
|
|
2
2
|
export { findOpenCanvasPosition, type CanvasPlacementRect } from '../shared/placement.js';
|
|
3
3
|
export declare const GROUP_PAD = 56;
|
|
4
4
|
export declare const GROUP_TITLEBAR_HEIGHT = 32;
|
|
5
|
+
/** Pack members inside an explicitly sized frame without changing that frame. */
|
|
6
|
+
export declare function computeManualGroupLayout<T extends CanvasPlacementRect & {
|
|
7
|
+
id: string;
|
|
8
|
+
}>(children: T[], frame: CanvasPlacementRect, layout: 'grid' | 'column' | 'flow'): Map<string, {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}>;
|
|
5
12
|
/**
|
|
6
13
|
* Compute bounding box for a group that should contain the given child rects.
|
|
7
14
|
* Returns position and size with padding, or null if no valid children.
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
* authentication boundary.
|
|
25
25
|
*/
|
|
26
26
|
import { type FenceRect } from '../shared/scope-fence.js';
|
|
27
|
+
import { type PmxAxPolicy } from './ax-state.js';
|
|
27
28
|
import type { Operation } from './operations/types.js';
|
|
28
29
|
/** Bounding box of the fenced nodes plus padding; null when none of them exist. */
|
|
29
30
|
export declare function scopeFenceRect(fence: {
|
|
@@ -47,7 +48,7 @@ export interface FenceTarget {
|
|
|
47
48
|
unknown?: string;
|
|
48
49
|
}
|
|
49
50
|
/** Returns a human-readable refusal, or null when the target is inside the fence. */
|
|
50
|
-
export declare function checkFenceTarget(target: FenceTarget, opName: string, writerKey?: string): string | null;
|
|
51
|
+
export declare function checkFenceTarget(target: FenceTarget, opName: string, writerKey?: string, policy?: PmxAxPolicy): string | null;
|
|
51
52
|
/** Describe what a registry op would write, in fence terms. */
|
|
52
53
|
export declare function describeOpTarget(op: Operation, rawInput: unknown): FenceTarget;
|
|
53
54
|
/** Registry entry point: refusal text or null. Only call for mutating, agent-originated ops. */
|