pmx-canvas 0.7.3 → 0.8.2
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/THIRD_PARTY_LICENSES.txt +331 -0
- package/.github/extensions/pmx-canvas/extension.mjs +25 -172
- package/.github/extensions/pmx-canvas/mcp-bootstrap.ts +198 -0
- package/.github/extensions/pmx-canvas/runtime.d.mts +41 -0
- package/.github/extensions/pmx-canvas/runtime.json +3 -0
- package/.github/extensions/pmx-canvas/runtime.mjs +194 -0
- package/.github/extensions/pmx-canvas/start-mcp.mjs +51 -0
- package/.github/extensions/pmx-canvas/tools.json +2560 -0
- package/CHANGELOG.md +64 -0
- package/Readme.md +21 -7
- package/dist/canvas/fonts/OFL.txt +93 -0
- package/dist/canvas/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
- package/dist/canvas/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
- package/dist/canvas/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
- package/dist/canvas/fonts/ibm-plex-mono-latin-ext-500-normal.woff2 +0 -0
- package/dist/canvas/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
- package/dist/canvas/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
- package/dist/canvas/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
- package/dist/canvas/fonts/ibm-plex-sans-latin-ext-400-normal.woff2 +0 -0
- package/dist/canvas/fonts/ibm-plex-sans-latin-ext-500-normal.woff2 +0 -0
- package/dist/canvas/fonts/ibm-plex-sans-latin-ext-600-normal.woff2 +0 -0
- package/dist/canvas/global.css +726 -674
- package/dist/canvas/index.js +90 -88
- package/dist/canvas/mcp-app.html +7879 -0
- package/dist/canvas/mermaid-entry.js +1 -1
- package/dist/canvas/surface-theme.css +151 -46
- package/dist/json-render/index.css +81 -1
- package/dist/json-render/index.js +1 -1
- package/dist/types/cli/commands/record.d.ts +1 -1
- package/dist/types/client/canvas/NodeContextMark.d.ts +24 -0
- package/dist/types/client/canvas/SessionReceipt.d.ts +3 -1
- package/dist/types/client/icons.d.ts +1 -2
- package/dist/types/client/mcp-app/index.d.ts +1 -0
- package/dist/types/client/nodes/HtmlNode.d.ts +1 -0
- package/dist/types/client/nodes/ax-node-actions.d.ts +2 -2
- package/dist/types/client/nodes/markdown-sanitize.d.ts +2 -0
- package/dist/types/client/nodes/use-workbench-asset.d.ts +2 -0
- package/dist/types/client/state/attention-store.d.ts +0 -5
- package/dist/types/client/state/context-status-store.d.ts +53 -0
- package/dist/types/client/state/intent-bridge.d.ts +3 -0
- package/dist/types/client/state/near-pin-store.d.ts +16 -0
- package/dist/types/client/state/presence-store.d.ts +5 -0
- package/dist/types/client/state/session-store.d.ts +33 -3
- package/dist/types/client/state/workbench-transport.d.ts +16 -0
- package/dist/types/client/theme/tokens.d.ts +1 -3
- package/dist/types/client/types.d.ts +9 -0
- package/dist/types/json-render/server.d.ts +1 -1
- package/dist/types/mcp/app-server.d.ts +3 -0
- package/dist/types/mcp/canvas-access.d.ts +1 -1
- package/dist/types/mcp/canvas-app.d.ts +4 -0
- package/dist/types/mcp/workbench-app.d.ts +4 -0
- package/dist/types/server/agent-presence.d.ts +1 -1
- package/dist/types/server/ax-state.d.ts +1 -1
- package/dist/types/server/canvas-db.d.ts +8 -0
- package/dist/types/server/canvas-geometry.d.ts +25 -0
- package/dist/types/server/canvas-operations.d.ts +1 -11
- package/dist/types/server/canvas-state.d.ts +25 -3
- package/dist/types/server/context-brief.d.ts +8 -1
- package/dist/types/server/context-reads.d.ts +30 -7
- package/dist/types/server/index.d.ts +6 -1
- package/dist/types/server/mcp-app-runtime.d.ts +1 -0
- package/dist/types/server/operations/http.d.ts +2 -0
- package/dist/types/server/operations/invoker.d.ts +4 -2
- package/dist/types/server/operations/ops/nodes.d.ts +0 -6
- package/dist/types/server/server.d.ts +1 -0
- package/dist/types/server/spatial-analysis.d.ts +2 -0
- package/dist/types/shared/agent-context.d.ts +22 -0
- package/dist/types/shared/agent-presence.d.ts +3 -10
- package/dist/types/shared/canvas-app.d.ts +54 -0
- package/dist/types/shared/themes.d.ts +1 -1
- package/docs/RELEASE.md +7 -3
- package/docs/agent-plugin.md +123 -0
- package/docs/ax-state-contract.md +40 -0
- package/docs/cli.md +7 -2
- package/docs/design/AgentContext.dc.html +186 -0
- package/docs/design/Before.dc.html +208 -0
- package/docs/design/BoardPins.dc.html +151 -0
- package/docs/design/Chrome.dc.html +211 -0
- package/docs/design/Context.dc.html +239 -0
- package/docs/design/Flows.dc.html +181 -0
- package/docs/design/Home.dc.html +209 -0
- package/docs/design/HomeGraph.dc.html +211 -0
- package/docs/design/HomeMap.dc.html +117 -0
- package/docs/design/HomeTeam.dc.html +176 -0
- package/docs/design/Light.dc.html +28 -0
- package/docs/design/Main.dc.html +280 -0
- package/docs/design/NearPin.dc.html +260 -0
- package/docs/design/Pane600.dc.html +120 -0
- package/docs/design/Relations.dc.html +297 -0
- package/docs/design/Themes.dc.html +121 -0
- package/docs/design/TokenSystem.dc.html +136 -0
- package/docs/design/Tokens.dc.html +163 -0
- package/docs/design/Types1.dc.html +177 -0
- package/docs/design/Types2.dc.html +226 -0
- package/docs/design/Types3.dc.html +195 -0
- package/docs/design/Uses.dc.html +152 -0
- package/docs/design/Vision.dc.html +116 -0
- package/docs/design/Zoom.dc.html +82 -0
- package/docs/design/canvas.json +274 -0
- package/docs/design.md +217 -0
- package/docs/environment.md +1 -1
- package/docs/http-api.md +86 -16
- package/docs/mcp.md +202 -4
- package/docs/node-types.md +34 -10
- package/docs/plans/plan-009-tech-debt-backlog.md +1 -1
- package/docs/plans/plan-015-design-foundation-wave-0.md +177 -0
- package/docs/plans/plan-016-context-made-visible-wave-1.md +148 -0
- package/docs/product-vision-2026-09.md +47 -7
- package/docs/screenshot.png +0 -0
- package/docs/sdk.md +1 -0
- package/package.json +10 -4
- package/plugins/pmx-canvas/LICENSE +21 -0
- package/plugins/pmx-canvas/THIRD_PARTY_LICENSES.txt +331 -0
- package/plugins/pmx-canvas/assets/preview.png +0 -0
- package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/extension.mjs +930 -0
- package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/runtime.json +3 -0
- package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/runtime.mjs +194 -0
- package/plugins/pmx-canvas/com.github.copilot/extensions/pmx-canvas/steering-delivery.mjs +79 -0
- package/plugins/pmx-canvas/mcp.json +12 -0
- package/plugins/pmx-canvas/plugin.json +24 -0
- package/plugins/pmx-canvas/runtime.json +3 -0
- package/plugins/pmx-canvas/runtime.mjs +194 -0
- package/plugins/pmx-canvas/start-mcp.mjs +51 -0
- package/plugins/pmx-canvas/tools.json +2560 -0
- package/skills/pmx-canvas/SKILL.md +29 -9
- package/skills/pmx-canvas/evals/evals.json +62 -0
- package/skills/pmx-canvas/references/ax-html-control-surface.md +6 -0
- package/skills/pmx-canvas/references/full-reference.md +11 -7
- package/skills/pmx-canvas/references/github-copilot-app-adapter.md +20 -8
- package/skills/pmx-canvas/references/installing-pmx-canvas.md +6 -6
- package/skills/pmx-canvas-testing/SKILL.md +5 -4
- package/src/cli/commands/copilot.ts +5 -0
- package/src/cli/commands/nodes.ts +3 -2
- package/src/cli/commands/view.ts +1 -1
- package/src/cli/index.ts +10 -4
- package/src/client/App.tsx +6 -1
- package/src/client/canvas/AgentPresenceLayer.tsx +3 -3
- package/src/client/canvas/AnnotationLayer.tsx +1 -1
- package/src/client/canvas/CanvasNode.tsx +32 -49
- package/src/client/canvas/CanvasViewport.tsx +0 -2
- package/src/client/canvas/CommandPalette.tsx +3 -2
- package/src/client/canvas/ContextMenu.tsx +11 -0
- package/src/client/canvas/EdgeLayer.tsx +1 -1
- package/src/client/canvas/ExportDialog.tsx +33 -6
- package/src/client/canvas/IntentLayer.tsx +2 -2
- package/src/client/canvas/Minimap.tsx +12 -7
- package/src/client/canvas/NodeContextMark.tsx +156 -0
- package/src/client/canvas/SessionPanel.tsx +4 -7
- package/src/client/canvas/SessionReceipt.tsx +114 -17
- package/src/client/canvas/ShortcutOverlay.tsx +6 -1
- package/src/client/canvas/SnapshotPanel.tsx +11 -2
- package/src/client/canvas/ToolRail.tsx +12 -9
- package/src/client/canvas/TopBar.tsx +16 -11
- package/src/client/icons.tsx +2 -12
- package/src/client/mcp-app/index.tsx +137 -0
- package/src/client/mcp-app/style.css +10 -0
- package/src/client/nodes/AttachmentNode.tsx +8 -1
- package/src/client/nodes/AxStepControls.tsx +1 -1
- package/src/client/nodes/ContextNode.tsx +9 -9
- package/src/client/nodes/ExtAppFrame.tsx +13 -8
- package/src/client/nodes/FileNode.tsx +8 -5
- package/src/client/nodes/HtmlNode.tsx +12 -2
- package/src/client/nodes/ImageNode.tsx +4 -2
- package/src/client/nodes/InlineMarkdownEditor.tsx +2 -1
- package/src/client/nodes/LedgerNode.tsx +2 -2
- package/src/client/nodes/MarkdownNode.tsx +44 -9
- package/src/client/nodes/McpAppNode.tsx +6 -4
- package/src/client/nodes/PromptNode.tsx +5 -17
- package/src/client/nodes/ResponseNode.tsx +3 -15
- package/src/client/nodes/StatusNode.tsx +2 -2
- package/src/client/nodes/StatusSummary.tsx +3 -1
- package/src/client/nodes/TraceNode.tsx +6 -4
- package/src/client/nodes/WebpageNode.tsx +1 -1
- package/src/client/nodes/ax-node-actions.ts +2 -2
- package/src/client/nodes/iframe-document-url.ts +3 -2
- package/src/client/nodes/markdown-sanitize.ts +10 -0
- package/src/client/nodes/surface-url.ts +10 -0
- package/src/client/nodes/use-surface-frame.ts +3 -1
- package/src/client/nodes/use-workbench-asset.ts +26 -0
- package/src/client/state/attention-bridge.ts +0 -8
- package/src/client/state/attention-store.ts +0 -17
- package/src/client/state/canvas-store.ts +4 -2
- package/src/client/state/context-status-store.ts +66 -0
- package/src/client/state/human-store.ts +2 -0
- package/src/client/state/iframe-mode.ts +5 -0
- package/src/client/state/intent-bridge.ts +10 -4
- package/src/client/state/near-pin-store.ts +53 -0
- package/src/client/state/presence-store.ts +5 -10
- package/src/client/state/session-store.ts +106 -9
- package/src/client/state/sse-bridge.ts +26 -7
- package/src/client/state/theme-override.ts +1 -1
- package/src/client/state/workbench-transport.ts +36 -0
- package/src/client/theme/global.css +726 -674
- package/src/client/theme/surface-theme.css +151 -46
- package/src/client/theme/tokens.ts +7 -11
- package/src/client/types.ts +10 -0
- package/src/json-render/renderer/index.css +6 -1
- package/src/json-render/renderer/index.tsx +0 -1
- package/src/json-render/server.ts +71 -14
- package/src/mcp/app-server.ts +64 -0
- package/src/mcp/canvas-access.ts +14 -11
- package/src/mcp/canvas-app.ts +318 -0
- package/src/mcp/server.ts +1 -1
- package/src/mcp/workbench-app.ts +211 -0
- package/src/server/agent-presence.ts +45 -6
- package/src/server/ax-context.ts +1 -1
- package/src/server/ax-state.ts +1 -1
- package/src/server/board-export.ts +5 -2
- package/src/server/canvas-db.ts +46 -12
- package/src/server/canvas-geometry.ts +64 -0
- package/src/server/canvas-operations.ts +7 -25
- package/src/server/canvas-state.ts +105 -15
- package/src/server/canvas-validation.ts +19 -4
- package/src/server/context-brief.ts +39 -2
- package/src/server/context-reads.ts +87 -15
- package/src/server/demo-state.json +31 -31
- package/src/server/html-surface.ts +4 -5
- package/src/server/index.ts +41 -5
- package/src/server/mcp-app-runtime.ts +11 -0
- package/src/server/operations/composites.ts +4 -3
- package/src/server/operations/http.ts +4 -4
- package/src/server/operations/invoker.ts +13 -4
- package/src/server/operations/mcp.ts +6 -0
- package/src/server/operations/ops/ax-read.ts +1 -1
- package/src/server/operations/ops/ax-timeline.ts +37 -0
- package/src/server/operations/ops/boards.ts +1 -1
- package/src/server/operations/ops/canvas-wire.ts +3 -6
- package/src/server/operations/ops/intent.ts +31 -2
- package/src/server/operations/ops/json-render.ts +6 -2
- package/src/server/operations/ops/nodes.ts +8 -76
- package/src/server/operations/ops/query.ts +8 -2
- package/src/server/operations/ops/snapshots.ts +4 -1
- package/src/server/operations/ops/viewport.ts +29 -5
- package/src/server/operations/registry.ts +41 -5
- package/src/server/scope-fence.ts +55 -10
- package/src/server/server.ts +83 -5
- package/src/server/spatial-analysis.ts +2 -2
- package/src/server/workboard.ts +6 -1
- package/src/{server → shared}/agent-context.ts +2 -2
- package/src/shared/agent-presence.ts +3 -15
- package/src/shared/canvas-app.ts +62 -0
- package/src/shared/themes.ts +5 -5
- package/src/client/canvas/FocusFieldLayer.tsx +0 -116
- package/src/client/canvas/kind-colors.ts +0 -23
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
|
|
2
2
|
import { mutatingNodeIds, sessionActive } from '../state/presence-store';
|
|
3
|
-
import {
|
|
3
|
+
import { attentionPulseNodeIds } from '../state/attention-store';
|
|
4
|
+
import { isAgentPin, NearPinMark, NodeContextMark } from './NodeContextMark';
|
|
5
|
+
import { activityLensNodeIds } from '../state/session-store';
|
|
4
6
|
import {
|
|
5
7
|
activeNodeId,
|
|
6
8
|
activeNeighborNodeIds,
|
|
@@ -34,20 +36,9 @@ import {
|
|
|
34
36
|
ungroupFromClient,
|
|
35
37
|
updateNodeFromClient,
|
|
36
38
|
} from '../state/intent-bridge';
|
|
37
|
-
import { KIND_COLOR } from './kind-colors';
|
|
38
39
|
import { reportHumanGrab, takeOverNode, yieldedNodes } from '../state/human-store';
|
|
39
40
|
import { AxStepControls } from '../nodes/AxStepControls';
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
getNodeIcon,
|
|
43
|
-
IconChevronRight,
|
|
44
|
-
IconChevronDown,
|
|
45
|
-
IconClose,
|
|
46
|
-
IconMore,
|
|
47
|
-
IconExternalLink,
|
|
48
|
-
IconExpand,
|
|
49
|
-
IconSparkle,
|
|
50
|
-
} from '../icons';
|
|
41
|
+
import { getNodeIcon, IconChevronRight, IconClose, IconMore, IconExpand, IconPin } from '../icons';
|
|
51
42
|
import { EXPANDABLE_TYPES, TYPE_LABELS } from '../types';
|
|
52
43
|
import type { CanvasNodeState } from '../types';
|
|
53
44
|
import { AUTO_FIT_TITLEBAR_HEIGHT, computeAutoFitHeight, shouldAutoFitNode } from './auto-fit';
|
|
@@ -137,8 +128,6 @@ export function CanvasNode({ node, children, onContextMenu }: CanvasNodeProps) {
|
|
|
137
128
|
const isActive = activeNodeId.value === node.id;
|
|
138
129
|
const isSelected = selectedNodeIds.value.has(node.id);
|
|
139
130
|
const isContextPinned = contextPinnedNodeIds.value.has(node.id);
|
|
140
|
-
const isAttentionPrimary = attentionPrimaryNodeIds.value.has(node.id);
|
|
141
|
-
const isAttentionSecondary = !isAttentionPrimary && attentionSecondaryNodeIds.value.has(node.id);
|
|
142
131
|
const isAttentionPulse = attentionPulseNodeIds.value.has(node.id);
|
|
143
132
|
const isNeighbor = !isActive && activeNeighborNodeIds.value.has(node.id);
|
|
144
133
|
const searchSet = searchHighlightIds.value;
|
|
@@ -428,8 +417,6 @@ export function CanvasNode({ node, children, onContextMenu }: CanvasNodeProps) {
|
|
|
428
417
|
isSearchDimmed ? 'search-dimmed' : '',
|
|
429
418
|
isSelected ? 'selected' : '',
|
|
430
419
|
isContextPinned ? 'context-pinned' : '',
|
|
431
|
-
isAttentionPrimary ? 'attention-focus-primary' : '',
|
|
432
|
-
isAttentionSecondary ? 'attention-focus-secondary' : '',
|
|
433
420
|
isAttentionPulse ? 'attention-pulse' : '',
|
|
434
421
|
isPinned ? 'pinned' : '',
|
|
435
422
|
isTrace ? 'trace-node' : '',
|
|
@@ -437,6 +424,7 @@ export function CanvasNode({ node, children, onContextMenu }: CanvasNodeProps) {
|
|
|
437
424
|
isGroup ? 'group-node' : '',
|
|
438
425
|
isStrictSize ? 'strict-size' : '',
|
|
439
426
|
isAgentMutating ? 'agent-mutating' : '',
|
|
427
|
+
activityLensNodeIds.value && !activityLensNodeIds.value.has(node.id) ? 'lens-dimmed' : '',
|
|
440
428
|
]
|
|
441
429
|
.filter(Boolean)
|
|
442
430
|
.join(' ');
|
|
@@ -488,7 +476,7 @@ export function CanvasNode({ node, children, onContextMenu }: CanvasNodeProps) {
|
|
|
488
476
|
<div class="group-chip-name">{title}</div>
|
|
489
477
|
<div class="group-chip-meta">
|
|
490
478
|
{groupKindDots.map((kind) => (
|
|
491
|
-
<span key={kind} class="group-kind-dot"
|
|
479
|
+
<span key={kind} class="group-kind-dot" aria-hidden="true" />
|
|
492
480
|
))}
|
|
493
481
|
<span class="group-chip-count">
|
|
494
482
|
{groupChildren.length} node{groupChildren.length === 1 ? '' : 's'}
|
|
@@ -679,40 +667,16 @@ export function CanvasNode({ node, children, onContextMenu }: CanvasNodeProps) {
|
|
|
679
667
|
{title}
|
|
680
668
|
</span>
|
|
681
669
|
)}
|
|
670
|
+
<NearPinMark node={node} pinned={isContextPinned} />
|
|
671
|
+
<NodeContextMark node={node} pinned={isContextPinned} />
|
|
682
672
|
<div class="node-controls">
|
|
683
673
|
{isPinned && (
|
|
684
674
|
<span class="pin-indicator" title="Pinned">
|
|
685
675
|
⊙
|
|
686
676
|
</span>
|
|
687
677
|
)}
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
class={`ctx-pin-btn${isContextPinned ? ' ctx-pin-active' : ''}`}
|
|
691
|
-
onClick={(e) => {
|
|
692
|
-
e.stopPropagation();
|
|
693
|
-
toggleContextPin(node.id);
|
|
694
|
-
}}
|
|
695
|
-
title={isContextPinned ? 'Remove from context' : 'Add to context'}
|
|
696
|
-
>
|
|
697
|
-
<IconSparkle size={14} />
|
|
698
|
-
</button>
|
|
699
|
-
{/* Open as site — full-page standalone view of this node's surface,
|
|
700
|
-
served from /api/canvas/surface/:id (same document as the canvas
|
|
701
|
-
iframe). Opens via the system browser so embedded hosts do not trap
|
|
702
|
-
it in their own webview. */}
|
|
703
|
-
{canOpenAsSite(node) && (
|
|
704
|
-
<button
|
|
705
|
-
type="button"
|
|
706
|
-
onClick={(e) => {
|
|
707
|
-
e.stopPropagation();
|
|
708
|
-
void openNodeAsSite(node);
|
|
709
|
-
}}
|
|
710
|
-
title="Open as site"
|
|
711
|
-
>
|
|
712
|
-
<IconExternalLink size={14} />
|
|
713
|
-
</button>
|
|
714
|
-
)}
|
|
715
|
-
{/* Expand — opens node as full-viewport overlay for focused work */}
|
|
678
|
+
{/* Expand and the context pin always show; the rest sit behind ⋯ and ×
|
|
679
|
+
on hover (docs/design/Chrome.dc.html). */}
|
|
716
680
|
{EXPANDABLE_TYPES.has(node.type) && (
|
|
717
681
|
<button
|
|
718
682
|
type="button"
|
|
@@ -727,18 +691,37 @@ export function CanvasNode({ node, children, onContextMenu }: CanvasNodeProps) {
|
|
|
727
691
|
)}
|
|
728
692
|
<button
|
|
729
693
|
type="button"
|
|
694
|
+
class={`ctx-pin-btn${isContextPinned ? ' ctx-pin-active' : ''}`}
|
|
730
695
|
onClick={(e) => {
|
|
731
696
|
e.stopPropagation();
|
|
732
|
-
|
|
697
|
+
toggleContextPin(node.id);
|
|
698
|
+
}}
|
|
699
|
+
title={isContextPinned ? 'Remove from context' : 'Add to context'}
|
|
700
|
+
aria-label={isContextPinned ? 'Remove from context' : 'Add to context'}
|
|
701
|
+
aria-pressed={isContextPinned}
|
|
702
|
+
>
|
|
703
|
+
<span class="ctx-pin-mark">
|
|
704
|
+
<IconPin />
|
|
705
|
+
{isContextPinned && isAgentPin(node.id) && <span class="ctx-pin-agent-dot" aria-hidden="true" />}
|
|
706
|
+
</span>
|
|
707
|
+
</button>
|
|
708
|
+
<button
|
|
709
|
+
type="button"
|
|
710
|
+
class="node-hover-control"
|
|
711
|
+
onClick={(e) => {
|
|
712
|
+
e.stopPropagation();
|
|
713
|
+
onContextMenu?.(e, node.id);
|
|
733
714
|
}}
|
|
734
|
-
title=
|
|
715
|
+
title="More actions"
|
|
716
|
+
aria-label="More actions"
|
|
735
717
|
>
|
|
736
|
-
|
|
718
|
+
<IconMore size={14} />
|
|
737
719
|
</button>
|
|
738
720
|
{/* Report #64: status nodes get the same remove control as every other
|
|
739
721
|
node type (backend removal + undo/history handle status uniformly). */}
|
|
740
722
|
<button
|
|
741
723
|
type="button"
|
|
724
|
+
class="node-hover-control"
|
|
742
725
|
onClick={(e) => {
|
|
743
726
|
e.stopPropagation();
|
|
744
727
|
void removeNodeFromClient(node.id);
|
|
@@ -38,7 +38,6 @@ import {
|
|
|
38
38
|
} from '../state/canvas-store';
|
|
39
39
|
import { createEdgeFromClient, createNodeFromClient } from '../state/intent-bridge';
|
|
40
40
|
import type { AnnotationTool, CanvasAnnotation, CanvasNodeState } from '../types';
|
|
41
|
-
import { FocusFieldLayer } from './FocusFieldLayer';
|
|
42
41
|
import { importFiles } from './import-files';
|
|
43
42
|
import { IntentLayer } from './IntentLayer';
|
|
44
43
|
import { AgentPresenceLayer } from './AgentPresenceLayer';
|
|
@@ -855,7 +854,6 @@ export function CanvasViewport({
|
|
|
855
854
|
left: 0,
|
|
856
855
|
}}
|
|
857
856
|
>
|
|
858
|
-
<FocusFieldLayer />
|
|
859
857
|
<ScopeFenceLayer />
|
|
860
858
|
<IntentLayer />
|
|
861
859
|
<AgentPresenceLayer />
|
|
@@ -16,6 +16,7 @@ import { startSession } from '../state/session-store';
|
|
|
16
16
|
import { TYPE_LABELS, type CanvasNodeState } from '../types';
|
|
17
17
|
import { invalidateTokenCache } from '../theme/tokens';
|
|
18
18
|
import { clearThemeOverride } from '../state/theme-override';
|
|
19
|
+
import { canvasThemeScheme } from '../../shared/themes.js';
|
|
19
20
|
import { getNodeIcon, IconArrange, IconFitAll, IconMinimap, IconMoon, IconNodeMarkdown, IconSteer } from '../icons';
|
|
20
21
|
import { activeBoardId, openBoard } from '../state/boards-store';
|
|
21
22
|
import { requestJson } from '../state/intent-bridge';
|
|
@@ -269,11 +270,11 @@ export function CommandPalette({ onClose, onToggleMinimap }: { onClose: () => vo
|
|
|
269
270
|
},
|
|
270
271
|
},
|
|
271
272
|
{
|
|
272
|
-
label: 'Toggle theme (
|
|
273
|
+
label: 'Toggle theme (Harbor/Daylight)',
|
|
273
274
|
icon: IconMoon,
|
|
274
275
|
iconTone: 'muted',
|
|
275
276
|
action: () => {
|
|
276
|
-
const next = canvasTheme.value === 'dark' ? '
|
|
277
|
+
const next = canvasThemeScheme(canvasTheme.value) === 'dark' ? 'daylight' : 'harbor';
|
|
277
278
|
// An explicit pick ends any ?theme= session override, same as the
|
|
278
279
|
// toolbar picker — otherwise the session stays sticky-overridden.
|
|
279
280
|
clearThemeOverride();
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
updateEdgeFromClient,
|
|
27
27
|
updateNodeFromClient,
|
|
28
28
|
} from '../state/intent-bridge';
|
|
29
|
+
import { canOpenAsSite, openNodeAsSite } from '../nodes/surface-url';
|
|
29
30
|
import { askText } from './TextPrompt';
|
|
30
31
|
import { EXPANDABLE_TYPES } from '../types';
|
|
31
32
|
import type { CanvasNodeState } from '../types';
|
|
@@ -498,6 +499,16 @@ function buildNodeMenuItems(node: CanvasNodeState): MenuItem[] {
|
|
|
498
499
|
action: () => toggleCollapsed(node.id),
|
|
499
500
|
});
|
|
500
501
|
|
|
502
|
+
// Open as site — full-page standalone view of this node's surface, served
|
|
503
|
+
// from /api/canvas/surface/:id (same document as the canvas iframe). Opens
|
|
504
|
+
// via the system browser so embedded hosts do not trap it in their webview.
|
|
505
|
+
if (canOpenAsSite(node)) {
|
|
506
|
+
items.push({
|
|
507
|
+
label: 'Open in new tab',
|
|
508
|
+
action: () => void openNodeAsSite(node),
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
|
|
501
512
|
// Context pin — add/remove from the human-curated agent context (report #63).
|
|
502
513
|
// This is the PRIMARY "pin" in PMX's model ("pin nodes to curate context"); it
|
|
503
514
|
// matches the SelectionBar's "Pin as context" and updates the context count + the
|
|
@@ -12,7 +12,7 @@ import type { CanvasEdge, CanvasNodeState } from '../types';
|
|
|
12
12
|
// ── Edge type visual styles ──────────────────────────────────
|
|
13
13
|
const EDGE_COLORS: Record<CanvasEdge['type'], string> = {
|
|
14
14
|
relation: 'var(--c-muted)',
|
|
15
|
-
'depends-on': 'var(--c-
|
|
15
|
+
'depends-on': 'var(--c-rel-informs)',
|
|
16
16
|
flow: 'var(--c-accent)',
|
|
17
17
|
// --c-dim is a very low-contrast hairline in dark palettes (forest: #5D7566
|
|
18
18
|
// on #0C1712); the dashed style is what distinguishes `references`.
|
|
@@ -2,6 +2,7 @@ import { signal } from '@preact/signals';
|
|
|
2
2
|
import { useEffect, useState } from 'preact/hooks';
|
|
3
3
|
import { requestJson } from '../state/intent-bridge';
|
|
4
4
|
import { activeBoardId } from '../state/boards-store';
|
|
5
|
+
import { downloadWorkbenchExport, isHostedWorkbench } from '../state/workbench-transport';
|
|
5
6
|
|
|
6
7
|
interface ExportManifest {
|
|
7
8
|
boardId: string;
|
|
@@ -43,6 +44,7 @@ export function ExportDialog() {
|
|
|
43
44
|
const [manifest, setManifest] = useState<ExportManifest | null>(null);
|
|
44
45
|
const [result, setResult] = useState<ExportResult | null>(null);
|
|
45
46
|
const [busy, setBusy] = useState(false);
|
|
47
|
+
const [downloadError, setDownloadError] = useState('');
|
|
46
48
|
const open = exportDialogOpen.value;
|
|
47
49
|
const boardId = activeBoardId.value;
|
|
48
50
|
|
|
@@ -50,6 +52,7 @@ export function ExportDialog() {
|
|
|
50
52
|
if (!open || !boardId) return;
|
|
51
53
|
let current = true;
|
|
52
54
|
setResult(null);
|
|
55
|
+
setDownloadError('');
|
|
53
56
|
setManifest(null);
|
|
54
57
|
void requestJson<{ manifest?: ExportManifest } | null>(
|
|
55
58
|
'exportPreview',
|
|
@@ -174,13 +177,37 @@ export function ExportDialog() {
|
|
|
174
177
|
Saved ({sizeLabel(result.bytes)}): <code>{result.path}</code>
|
|
175
178
|
</div>
|
|
176
179
|
<div class="export-dialog-links">
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
180
|
+
{isHostedWorkbench() ? (
|
|
181
|
+
<button
|
|
182
|
+
type="button"
|
|
183
|
+
disabled={busy}
|
|
184
|
+
onClick={async () => {
|
|
185
|
+
setBusy(true);
|
|
186
|
+
setDownloadError('');
|
|
187
|
+
try {
|
|
188
|
+
await downloadWorkbenchExport(result.url);
|
|
189
|
+
} catch (error) {
|
|
190
|
+
setDownloadError(error instanceof Error ? error.message : 'Download failed. Try again.');
|
|
191
|
+
} finally {
|
|
192
|
+
setBusy(false);
|
|
193
|
+
}
|
|
194
|
+
}}
|
|
195
|
+
>
|
|
196
|
+
{busy ? 'Downloading…' : 'Download'}
|
|
197
|
+
</button>
|
|
198
|
+
) : (
|
|
199
|
+
<>
|
|
200
|
+
<a href={result.url} target="_blank" rel="noopener noreferrer">
|
|
201
|
+
Open
|
|
202
|
+
</a>
|
|
203
|
+
<a class="is-primary" href={`${result.url}?download=1`}>
|
|
204
|
+
Download
|
|
205
|
+
</a>
|
|
206
|
+
</>
|
|
207
|
+
)}
|
|
183
208
|
</div>
|
|
209
|
+
{isHostedWorkbench() && <p>Download the HTML file to open it outside ChatGPT.</p>}
|
|
210
|
+
{downloadError && <p role="alert">{downloadError}</p>}
|
|
184
211
|
</div>
|
|
185
212
|
)}
|
|
186
213
|
<div class="text-prompt-actions">
|
|
@@ -8,8 +8,8 @@ import type { CanvasNodeState } from '../types';
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Ghost Cursor of Intent overlay. Renders the agent's pre-commit moves as faint
|
|
11
|
-
* placeholders in world space (it lives inside the canvas transform,
|
|
12
|
-
*
|
|
11
|
+
* placeholders in world space (it lives inside the canvas transform, so positions
|
|
12
|
+
* are world coords). Five kinds:
|
|
13
13
|
* create → dashed ghost node with icon + type badge
|
|
14
14
|
* move → ghost at the destination + a dashed trail from the current node
|
|
15
15
|
* connect → dashed bezier in the edge-type color
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { agentIdentityHue } from '../../shared/agent-presence.js';
|
|
2
1
|
import type { Signal } from '@preact/signals';
|
|
3
2
|
import { useCallback, useRef } from 'preact/hooks';
|
|
4
3
|
import { fenceRectFromNodes } from '../../shared/scope-fence.js';
|
|
5
|
-
import { selectedNodeIds } from '../state/canvas-store';
|
|
6
|
-
import {
|
|
4
|
+
import { contextPinnedNodeIds, selectedNodeIds } from '../state/canvas-store';
|
|
5
|
+
import {
|
|
6
|
+
agentPresences,
|
|
7
|
+
mutatingNodeIds,
|
|
8
|
+
presenceWorldPosition,
|
|
9
|
+
sessionActive,
|
|
10
|
+
writerColor,
|
|
11
|
+
} from '../state/presence-store';
|
|
7
12
|
import { scopeFence } from '../state/session-store';
|
|
8
13
|
import type { CanvasEdge, CanvasNodeState, ViewportState } from '../types';
|
|
9
|
-
import { KIND_COLOR } from './kind-colors';
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
16
|
* Minimap v2 (rail-chrome-v2 phase 7, design item 19): a true-scale node map
|
|
@@ -141,6 +145,8 @@ export function Minimap({ viewport, nodes, onNavigate, containerWidth, container
|
|
|
141
145
|
);
|
|
142
146
|
|
|
143
147
|
const selected = selectedNodeIds.value;
|
|
148
|
+
const pinned = contextPinnedNodeIds.value;
|
|
149
|
+
const agentAtWork = sessionActive.value ? mutatingNodeIds.value : new Set<string>();
|
|
144
150
|
const fence = scopeFence.value;
|
|
145
151
|
const fenceRect = fence
|
|
146
152
|
? fenceRectFromNodes(
|
|
@@ -177,14 +183,13 @@ export function Minimap({ viewport, nodes, onNavigate, containerWidth, container
|
|
|
177
183
|
return (
|
|
178
184
|
<span
|
|
179
185
|
key={node.id}
|
|
180
|
-
class={`minimap-node${isGroup ? ' is-group' : ''}${selected.has(node.id) ? ' is-selected' : ''}`}
|
|
186
|
+
class={`minimap-node${isGroup ? ' is-group' : ''}${selected.has(node.id) ? ' is-selected' : ''}${pinned.has(node.id) ? ' is-pinned' : ''}${agentAtWork.has(node.id) ? ' is-agent' : ''}`}
|
|
181
187
|
data-kind={node.type}
|
|
182
188
|
style={{
|
|
183
189
|
left: `${toX(node.position.x)}px`,
|
|
184
190
|
top: `${toY(node.position.y)}px`,
|
|
185
191
|
width: `${Math.max(isGroup ? 6 : 4, node.size.width * scale)}px`,
|
|
186
192
|
height: `${Math.max(isGroup ? 5 : 3, node.size.height * scale)}px`,
|
|
187
|
-
'--kind': KIND_COLOR[node.type],
|
|
188
193
|
}}
|
|
189
194
|
/>
|
|
190
195
|
);
|
|
@@ -207,7 +212,7 @@ export function Minimap({ viewport, nodes, onNavigate, containerWidth, container
|
|
|
207
212
|
style={{
|
|
208
213
|
left: `${toX(dot.at.x) - 4}px`,
|
|
209
214
|
top: `${toY(dot.at.y) - 4}px`,
|
|
210
|
-
'--identity-color':
|
|
215
|
+
'--identity-color': writerColor(dot.id),
|
|
211
216
|
}}
|
|
212
217
|
/>
|
|
213
218
|
))}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { useState } from 'preact/hooks';
|
|
2
|
+
import { contextPinMeta, pinnedReadState, writerName } from '../state/context-status-store';
|
|
3
|
+
import { centerDistance } from '../../server/spatial-analysis.js';
|
|
4
|
+
import { nodes } from '../state/canvas-store';
|
|
5
|
+
import { nearPins } from '../state/near-pin-store';
|
|
6
|
+
import type { CanvasNodeState } from '../types';
|
|
7
|
+
import { BarHint } from './BarHint';
|
|
8
|
+
|
|
9
|
+
// Glyphs from docs/design/AgentContext.dc.html (24-unit paths).
|
|
10
|
+
export const GLYPHS = {
|
|
11
|
+
eye: 'M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12zM12 9.5a2.5 2.5 0 1 0 0 5a2.5 2.5 0 1 0 0-5',
|
|
12
|
+
eyeOff:
|
|
13
|
+
'M3 3l18 18M10.6 6.1A10 10 0 0 1 12 6c6.5 0 10 6 10 6a17 17 0 0 1-3 3.6M6.6 6.6C3.8 8.3 2 12 2 12s3.5 6 10 6a9.6 9.6 0 0 0 4.4-1',
|
|
14
|
+
spark: 'M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z',
|
|
15
|
+
pen: 'M4 20l4.2-1L19 8.2 15.8 5 5 15.8z',
|
|
16
|
+
warn: 'M12 4l9 16H3zM12 10v4M12 17v.5',
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
interface Mark {
|
|
20
|
+
tone: 'agent' | 'muted' | 'warn';
|
|
21
|
+
glyph: keyof typeof GLYPHS;
|
|
22
|
+
word: string;
|
|
23
|
+
label: string;
|
|
24
|
+
body: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function clock(iso: string): string {
|
|
28
|
+
const date = new Date(iso);
|
|
29
|
+
return Number.isNaN(date.getTime()) ? iso : date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function markFor(node: CanvasNodeState, pinned: boolean): Mark | null {
|
|
33
|
+
if (pinned) {
|
|
34
|
+
const pin = contextPinMeta.value[node.id];
|
|
35
|
+
const pinnedBy =
|
|
36
|
+
pin?.pinnedBy.actor === 'agent'
|
|
37
|
+
? ` Pinned by ${writerName(pin.pinnedBy)}${pin.reason ? `: ${pin.reason}` : ''}.`
|
|
38
|
+
: '';
|
|
39
|
+
const state = pinnedReadState(node.id, node.contentRevision ?? 0);
|
|
40
|
+
if (state.kind === 'not-read') {
|
|
41
|
+
return {
|
|
42
|
+
tone: 'muted',
|
|
43
|
+
glyph: 'eyeOff',
|
|
44
|
+
word: 'not read',
|
|
45
|
+
label: 'Not read yet',
|
|
46
|
+
body: `In context, but no agent has loaded it since it was pinned.${pinnedBy}`,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (state.kind === 'changed') {
|
|
50
|
+
return {
|
|
51
|
+
tone: 'warn',
|
|
52
|
+
glyph: 'warn',
|
|
53
|
+
word: 'changed since read',
|
|
54
|
+
label: "The agent's copy is out of date",
|
|
55
|
+
body: `Changed after ${state.by} read it at ${clock(state.at)}.${pinnedBy}`,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
tone: 'agent',
|
|
60
|
+
glyph: 'eye',
|
|
61
|
+
word: 'read',
|
|
62
|
+
label: 'Read by the agent',
|
|
63
|
+
body: `${state.count > 1 ? `Read ${state.count} times · last` : 'Read'} ${clock(state.at)} by ${state.by}.${pinnedBy}`,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
// A person's edit ends the agent's byline (decided 2026-10-05).
|
|
67
|
+
if (node.lastEditedBy?.actor === 'human') return null;
|
|
68
|
+
if (node.createdBy?.actor === 'agent') {
|
|
69
|
+
const name = writerName(node.createdBy);
|
|
70
|
+
return {
|
|
71
|
+
tone: 'agent',
|
|
72
|
+
glyph: 'spark',
|
|
73
|
+
word: `by ${name}`,
|
|
74
|
+
label: `Created by ${name}`,
|
|
75
|
+
body: 'The byline stays until you edit the node.',
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
if (node.lastEditedBy?.actor === 'agent') {
|
|
79
|
+
const name = writerName(node.lastEditedBy);
|
|
80
|
+
return {
|
|
81
|
+
tone: 'agent',
|
|
82
|
+
glyph: 'pen',
|
|
83
|
+
word: 'edited',
|
|
84
|
+
label: `Edited by ${name}`,
|
|
85
|
+
body: 'The mark stays until you edit the node.',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** The header chip saying what agents did with this node (one per node; glyph + word). */
|
|
92
|
+
export function NodeContextMark({ node, pinned }: { node: CanvasNodeState; pinned: boolean }) {
|
|
93
|
+
const mark = markFor(node, pinned);
|
|
94
|
+
if (!mark) return null;
|
|
95
|
+
return (
|
|
96
|
+
<BarHint label={mark.label} body={mark.body} align="end" tapToOpen>
|
|
97
|
+
<span class={`node-context-mark is-${mark.tone}`} data-mark={mark.word}>
|
|
98
|
+
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
99
|
+
<path d={GLYPHS[mark.glyph]} />
|
|
100
|
+
</svg>
|
|
101
|
+
{mark.word}
|
|
102
|
+
</span>
|
|
103
|
+
</BarHint>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/** Pinned by an agent: the violet dot on the pin badge. */
|
|
108
|
+
export function isAgentPin(nodeId: string): boolean {
|
|
109
|
+
return contextPinMeta.value[nodeId]?.pinnedBy.actor === 'agent';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Near a pin (docs/design/NearPin.dc.html): a dotted pin-blue chip on an
|
|
114
|
+
* unpinned node the brief carries as title + short summary. Weaker than "in
|
|
115
|
+
* context" on purpose: the agent never gets this node's full content.
|
|
116
|
+
*/
|
|
117
|
+
export function NearPinMark({ node, pinned }: { node: CanvasNodeState; pinned: boolean }) {
|
|
118
|
+
// The pins' titles join this node's DOM only while the chip is hovered or
|
|
119
|
+
// focused: at rest the node must not contain other nodes' titles.
|
|
120
|
+
const [open, setOpen] = useState(false);
|
|
121
|
+
const near = pinned ? undefined : nearPins.value.get(node.id);
|
|
122
|
+
if (!near || near.length === 0) return null;
|
|
123
|
+
const word = near.length > 1 ? `near ${near.length}` : 'near';
|
|
124
|
+
// Distances change every drag frame; read them only while the hint is open.
|
|
125
|
+
const where = open
|
|
126
|
+
? near
|
|
127
|
+
.map((pin) => {
|
|
128
|
+
const pinNode = nodes.value.get(pin.pinNodeId);
|
|
129
|
+
return pinNode ? `“${pin.pinTitle}” (${Math.round(centerDistance(node, pinNode))} px)` : `“${pin.pinTitle}”`;
|
|
130
|
+
})
|
|
131
|
+
.join(', ')
|
|
132
|
+
: '';
|
|
133
|
+
return (
|
|
134
|
+
<BarHint
|
|
135
|
+
label={open ? `Near ${where}` : 'Near a pin'}
|
|
136
|
+
body="The agent gets its title and a short summary, not its full content. Pin it to send its content."
|
|
137
|
+
align="end"
|
|
138
|
+
tapToOpen
|
|
139
|
+
>
|
|
140
|
+
<span
|
|
141
|
+
class="node-near-mark"
|
|
142
|
+
data-near={near.map((pin) => pin.pinNodeId).join(' ')}
|
|
143
|
+
onMouseEnter={() => setOpen(true)}
|
|
144
|
+
onMouseLeave={() => setOpen(false)}
|
|
145
|
+
onFocusIn={() => setOpen(true)}
|
|
146
|
+
onFocusOut={() => setOpen(false)}
|
|
147
|
+
>
|
|
148
|
+
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
149
|
+
<circle cx="12" cy="12" r="8" class="node-near-ring" />
|
|
150
|
+
<circle cx="12" cy="12" r="2.2" class="node-near-dot" />
|
|
151
|
+
</svg>
|
|
152
|
+
{word}
|
|
153
|
+
</span>
|
|
154
|
+
</BarHint>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useEffect, useState } from 'preact/hooks';
|
|
2
2
|
import { IconChevronRight, IconUndo } from '../icons';
|
|
3
3
|
import { useNow } from './use-now';
|
|
4
|
-
import {
|
|
4
|
+
import { agentPhaseLabel } from '../../shared/agent-presence.js';
|
|
5
5
|
import { formatCountdown, gateRemainingMs } from '../../shared/approval-gates.js';
|
|
6
6
|
import { focusNode, selectedNodeIds } from '../state/canvas-store';
|
|
7
|
-
import { activeSession, agentPresences } from '../state/presence-store';
|
|
7
|
+
import { activeSession, agentPresences, writerColor } from '../state/presence-store';
|
|
8
8
|
import {
|
|
9
9
|
type ApprovalGateView,
|
|
10
10
|
endSession,
|
|
@@ -281,12 +281,9 @@ function TimelineRow({ entry }: { entry: TimelineEntry }) {
|
|
|
281
281
|
{entry.label}
|
|
282
282
|
</span>
|
|
283
283
|
{/* With several assistants on one board, "Assistant · 23:11" answers
|
|
284
|
-
nothing — every row names its writer
|
|
284
|
+
nothing — every row names its writer. */}
|
|
285
285
|
{entry.who && (
|
|
286
|
-
<span
|
|
287
|
-
class="session-timeline-who"
|
|
288
|
-
style={{ '--identity-color': `hsl(${agentIdentityHue(entry.who)} 65% 62%)` }}
|
|
289
|
-
>
|
|
286
|
+
<span class="session-timeline-who" style={{ '--identity-color': writerColor(entry.who) }}>
|
|
290
287
|
{writerDisplay(entry.who)}
|
|
291
288
|
</span>
|
|
292
289
|
)}
|