pmx-canvas 0.1.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.
- package/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/Readme.md +865 -0
- package/dist/canvas/global.css +3173 -0
- package/dist/canvas/index.js +183 -0
- package/dist/json-render/index.css +2 -0
- package/dist/json-render/index.js +389 -0
- package/dist/types/cli/agent.d.ts +13 -0
- package/dist/types/cli/index.d.ts +2 -0
- package/dist/types/cli/watch.d.ts +5 -0
- package/dist/types/client/App.d.ts +1 -0
- package/dist/types/client/canvas/AttentionHistory.d.ts +1 -0
- package/dist/types/client/canvas/AttentionToast.d.ts +1 -0
- package/dist/types/client/canvas/CanvasNode.d.ts +8 -0
- package/dist/types/client/canvas/CanvasViewport.d.ts +8 -0
- package/dist/types/client/canvas/CommandPalette.d.ts +4 -0
- package/dist/types/client/canvas/ContextMenu.d.ts +24 -0
- package/dist/types/client/canvas/ContextPinBar.d.ts +1 -0
- package/dist/types/client/canvas/ContextPinHud.d.ts +1 -0
- package/dist/types/client/canvas/DockedNode.d.ts +4 -0
- package/dist/types/client/canvas/EdgeLayer.d.ts +8 -0
- package/dist/types/client/canvas/ExpandedNodeOverlay.d.ts +1 -0
- package/dist/types/client/canvas/FocusFieldLayer.d.ts +1 -0
- package/dist/types/client/canvas/Minimap.d.ts +23 -0
- package/dist/types/client/canvas/SelectionBar.d.ts +1 -0
- package/dist/types/client/canvas/ShortcutOverlay.d.ts +3 -0
- package/dist/types/client/canvas/SnapshotPanel.d.ts +7 -0
- package/dist/types/client/canvas/snap-guides.d.ts +23 -0
- package/dist/types/client/canvas/use-node-drag.d.ts +15 -0
- package/dist/types/client/canvas/use-node-resize.d.ts +15 -0
- package/dist/types/client/canvas/use-pan-zoom.d.ts +16 -0
- package/dist/types/client/ext-app/bridge.d.ts +161 -0
- package/dist/types/client/icons.d.ts +70 -0
- package/dist/types/client/index.d.ts +1 -0
- package/dist/types/client/nodes/ContextNode.d.ts +34 -0
- package/dist/types/client/nodes/ExtAppFrame.d.ts +18 -0
- package/dist/types/client/nodes/FileNode.d.ts +5 -0
- package/dist/types/client/nodes/GroupNode.d.ts +6 -0
- package/dist/types/client/nodes/ImageNode.d.ts +10 -0
- package/dist/types/client/nodes/InlineFormatBar.d.ts +7 -0
- package/dist/types/client/nodes/InlineMarkdownEditor.d.ts +14 -0
- package/dist/types/client/nodes/LedgerNode.d.ts +4 -0
- package/dist/types/client/nodes/MarkdownNode.d.ts +6 -0
- package/dist/types/client/nodes/McpAppNode.d.ts +4 -0
- package/dist/types/client/nodes/MdFormatBar.d.ts +8 -0
- package/dist/types/client/nodes/PromptNode.d.ts +5 -0
- package/dist/types/client/nodes/ResponseNode.d.ts +5 -0
- package/dist/types/client/nodes/StatusNode.d.ts +4 -0
- package/dist/types/client/nodes/StatusSummary.d.ts +4 -0
- package/dist/types/client/nodes/TraceNode.d.ts +4 -0
- package/dist/types/client/nodes/WebpageNode.d.ts +5 -0
- package/dist/types/client/nodes/image-warnings.d.ts +6 -0
- package/dist/types/client/nodes/inline-editor-commands.d.ts +11 -0
- package/dist/types/client/nodes/md-format.d.ts +25 -0
- package/dist/types/client/state/attention-bridge.d.ts +3 -0
- package/dist/types/client/state/attention-store.d.ts +25 -0
- package/dist/types/client/state/canvas-store.d.ts +74 -0
- package/dist/types/client/state/intent-bridge.d.ts +158 -0
- package/dist/types/client/state/sse-bridge.d.ts +5 -0
- package/dist/types/client/theme/tokens.d.ts +27 -0
- package/dist/types/client/types.d.ts +40 -0
- package/dist/types/client/utils/ext-app-tool-result.d.ts +1 -0
- package/dist/types/client/utils/placement.d.ts +1 -0
- package/dist/types/client/utils/platform.d.ts +2 -0
- package/dist/types/json-render/catalog.d.ts +815 -0
- package/dist/types/json-render/charts/components.d.ts +54 -0
- package/dist/types/json-render/charts/definitions.d.ts +103 -0
- package/dist/types/json-render/charts/extra-components.d.ts +58 -0
- package/dist/types/json-render/charts/extra-definitions.d.ts +181 -0
- package/dist/types/json-render/renderer/index.d.ts +16 -0
- package/dist/types/json-render/schema.d.ts +46 -0
- package/dist/types/json-render/server.d.ts +55 -0
- package/dist/types/mcp/server.d.ts +22 -0
- package/dist/types/server/agent-context.d.ts +21 -0
- package/dist/types/server/artifact-paths.d.ts +3 -0
- package/dist/types/server/canvas-operations.d.ts +154 -0
- package/dist/types/server/canvas-provenance.d.ts +13 -0
- package/dist/types/server/canvas-schema.d.ts +49 -0
- package/dist/types/server/canvas-serialization.d.ts +25 -0
- package/dist/types/server/canvas-state.d.ts +174 -0
- package/dist/types/server/canvas-validation.d.ts +33 -0
- package/dist/types/server/chart-template.d.ts +29 -0
- package/dist/types/server/code-graph.d.ts +67 -0
- package/dist/types/server/context-cards.d.ts +24 -0
- package/dist/types/server/diagram-presets.d.ts +28 -0
- package/dist/types/server/ext-app-call-registry.d.ts +16 -0
- package/dist/types/server/ext-app-tool-result.d.ts +1 -0
- package/dist/types/server/file-watcher.d.ts +16 -0
- package/dist/types/server/index.d.ts +243 -0
- package/dist/types/server/mcp-app-candidate.d.ts +25 -0
- package/dist/types/server/mcp-app-host.d.ts +65 -0
- package/dist/types/server/mcp-app-runtime.d.ts +47 -0
- package/dist/types/server/mutation-history.d.ts +105 -0
- package/dist/types/server/placement.d.ts +37 -0
- package/dist/types/server/server.d.ts +103 -0
- package/dist/types/server/spatial-analysis.d.ts +87 -0
- package/dist/types/server/trace-manager.d.ts +48 -0
- package/dist/types/server/web-artifacts.d.ts +50 -0
- package/dist/types/server/webpage-node.d.ts +25 -0
- package/dist/types/shared/auto-arrange.d.ts +29 -0
- package/dist/types/shared/ext-app-tool-result.d.ts +9 -0
- package/dist/types/shared/placement.d.ts +26 -0
- package/dist/types/shared/semantic-attention.d.ts +97 -0
- package/package.json +109 -0
- package/skills/data-analysis/SKILL.md +324 -0
- package/skills/doc-coauthoring/SKILL.md +375 -0
- package/skills/frontend-design/SKILL.md +45 -0
- package/skills/json-render-codegen/SKILL.md +112 -0
- package/skills/json-render-core/SKILL.md +265 -0
- package/skills/json-render-ink/SKILL.md +273 -0
- package/skills/json-render-mcp/SKILL.md +132 -0
- package/skills/json-render-react/SKILL.md +264 -0
- package/skills/json-render-shadcn/SKILL.md +159 -0
- package/skills/playwright-cli/SKILL.md +67 -0
- package/skills/pmx-canvas/SKILL.md +668 -0
- package/skills/pmx-canvas/evals/evals.json +186 -0
- package/skills/pmx-canvas-testing/SKILL.md +78 -0
- package/skills/published-consumer-e2e/SKILL.md +43 -0
- package/skills/published-consumer-e2e/scripts/run-published-consumer-e2e.sh +241 -0
- package/skills/web-artifacts-builder/SKILL.md +80 -0
- package/skills/web-artifacts-builder/scripts/bundle-artifact.sh +167 -0
- package/skills/web-artifacts-builder/scripts/init-artifact.sh +425 -0
- package/skills/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/skills/web-design-guidelines/SKILL.md +39 -0
- package/src/cli/agent.ts +2144 -0
- package/src/cli/index.ts +622 -0
- package/src/cli/watch.ts +88 -0
- package/src/client/App.tsx +507 -0
- package/src/client/canvas/AttentionHistory.tsx +81 -0
- package/src/client/canvas/AttentionToast.tsx +19 -0
- package/src/client/canvas/CanvasNode.tsx +363 -0
- package/src/client/canvas/CanvasViewport.tsx +590 -0
- package/src/client/canvas/CommandPalette.tsx +302 -0
- package/src/client/canvas/ContextMenu.tsx +601 -0
- package/src/client/canvas/ContextPinBar.tsx +25 -0
- package/src/client/canvas/ContextPinHud.tsx +22 -0
- package/src/client/canvas/DockedNode.tsx +66 -0
- package/src/client/canvas/EdgeLayer.tsx +280 -0
- package/src/client/canvas/ExpandedNodeOverlay.tsx +260 -0
- package/src/client/canvas/FocusFieldLayer.tsx +107 -0
- package/src/client/canvas/Minimap.tsx +301 -0
- package/src/client/canvas/SelectionBar.tsx +69 -0
- package/src/client/canvas/ShortcutOverlay.tsx +69 -0
- package/src/client/canvas/SnapshotPanel.tsx +236 -0
- package/src/client/canvas/snap-guides.ts +170 -0
- package/src/client/canvas/use-node-drag.ts +51 -0
- package/src/client/canvas/use-node-resize.ts +59 -0
- package/src/client/canvas/use-pan-zoom.ts +191 -0
- package/src/client/ext-app/bridge.ts +542 -0
- package/src/client/icons.tsx +424 -0
- package/src/client/index.tsx +7 -0
- package/src/client/nodes/ContextNode.tsx +412 -0
- package/src/client/nodes/ExtAppFrame.tsx +509 -0
- package/src/client/nodes/FileNode.tsx +256 -0
- package/src/client/nodes/GroupNode.tsx +39 -0
- package/src/client/nodes/ImageNode.tsx +160 -0
- package/src/client/nodes/InlineFormatBar.tsx +169 -0
- package/src/client/nodes/InlineMarkdownEditor.tsx +123 -0
- package/src/client/nodes/LedgerNode.tsx +37 -0
- package/src/client/nodes/MarkdownNode.tsx +359 -0
- package/src/client/nodes/McpAppNode.tsx +85 -0
- package/src/client/nodes/MdFormatBar.tsx +109 -0
- package/src/client/nodes/PromptNode.tsx +597 -0
- package/src/client/nodes/ResponseNode.tsx +153 -0
- package/src/client/nodes/StatusNode.tsx +84 -0
- package/src/client/nodes/StatusSummary.tsx +38 -0
- package/src/client/nodes/TraceNode.tsx +120 -0
- package/src/client/nodes/WebpageNode.tsx +288 -0
- package/src/client/nodes/image-warnings.ts +95 -0
- package/src/client/nodes/inline-editor-commands.ts +37 -0
- package/src/client/nodes/md-format.ts +206 -0
- package/src/client/state/attention-bridge.ts +328 -0
- package/src/client/state/attention-store.ts +73 -0
- package/src/client/state/canvas-store.ts +631 -0
- package/src/client/state/intent-bridge.ts +315 -0
- package/src/client/state/sse-bridge.ts +965 -0
- package/src/client/theme/global.css +3173 -0
- package/src/client/theme/tokens.ts +72 -0
- package/src/client/types-shims.d.ts +5 -0
- package/src/client/types.ts +81 -0
- package/src/client/utils/ext-app-tool-result.ts +4 -0
- package/src/client/utils/placement.ts +4 -0
- package/src/client/utils/platform.ts +2 -0
- package/src/json-render/catalog.ts +256 -0
- package/src/json-render/charts/components.tsx +198 -0
- package/src/json-render/charts/definitions.ts +81 -0
- package/src/json-render/charts/extra-components.tsx +267 -0
- package/src/json-render/charts/extra-definitions.ts +145 -0
- package/src/json-render/renderer/index.css +174 -0
- package/src/json-render/renderer/index.tsx +86 -0
- package/src/json-render/schema.ts +62 -0
- package/src/json-render/server.ts +597 -0
- package/src/mcp/server.ts +1377 -0
- package/src/server/agent-context.ts +242 -0
- package/src/server/artifact-paths.ts +17 -0
- package/src/server/canvas-operations.ts +1279 -0
- package/src/server/canvas-provenance.ts +243 -0
- package/src/server/canvas-schema.ts +432 -0
- package/src/server/canvas-serialization.ts +95 -0
- package/src/server/canvas-state.ts +1134 -0
- package/src/server/canvas-validation.ts +114 -0
- package/src/server/chart-template.ts +449 -0
- package/src/server/code-graph.ts +370 -0
- package/src/server/context-cards.ts +31 -0
- package/src/server/diagram-presets.ts +71 -0
- package/src/server/ext-app-call-registry.ts +77 -0
- package/src/server/ext-app-tool-result.ts +4 -0
- package/src/server/file-watcher.ts +121 -0
- package/src/server/index.ts +647 -0
- package/src/server/mcp-app-candidate.ts +174 -0
- package/src/server/mcp-app-host.ts +814 -0
- package/src/server/mcp-app-runtime.ts +459 -0
- package/src/server/mutation-history.ts +350 -0
- package/src/server/placement.ts +125 -0
- package/src/server/server.ts +3846 -0
- package/src/server/spatial-analysis.ts +356 -0
- package/src/server/trace-manager.ts +333 -0
- package/src/server/web-artifacts/scripts/bundle-artifact.sh +167 -0
- package/src/server/web-artifacts/scripts/init-artifact.sh +426 -0
- package/src/server/web-artifacts/scripts/shadcn-components.tar.gz +0 -0
- package/src/server/web-artifacts.ts +442 -0
- package/src/server/webpage-node.ts +328 -0
- package/src/shared/auto-arrange.ts +439 -0
- package/src/shared/ext-app-tool-result.ts +76 -0
- package/src/shared/placement.ts +81 -0
- package/src/shared/semantic-attention.ts +598 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
import type { CanvasNodeState, CanvasEdge, CanvasLayout } from './canvas-state.js';
|
|
3
|
+
import { searchNodes } from './spatial-analysis.js';
|
|
4
|
+
import { diffLayouts } from './mutation-history.js';
|
|
5
|
+
import { type WebArtifactBuildInput, type WebArtifactCanvasBuildResult } from './web-artifacts.js';
|
|
6
|
+
import { type ExternalMcpTransportConfig } from './mcp-app-runtime.js';
|
|
7
|
+
import { type DiagramPresetOpenInput } from './diagram-presets.js';
|
|
8
|
+
import { type GraphNodeInput, type JsonRenderNodeInput, type JsonRenderSpec } from '../json-render/server.js';
|
|
9
|
+
import type { CanvasAutomationWebViewOptions, CanvasAutomationWebViewStatus } from './server.js';
|
|
10
|
+
export declare class PmxCanvas extends EventEmitter {
|
|
11
|
+
private _port;
|
|
12
|
+
private _server;
|
|
13
|
+
constructor(options?: {
|
|
14
|
+
port?: number;
|
|
15
|
+
});
|
|
16
|
+
start(options?: {
|
|
17
|
+
open?: boolean;
|
|
18
|
+
automationWebView?: boolean | CanvasAutomationWebViewOptions;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
stop(): void;
|
|
21
|
+
addNode(input: {
|
|
22
|
+
type: CanvasNodeState['type'];
|
|
23
|
+
title?: string;
|
|
24
|
+
content?: string;
|
|
25
|
+
x?: number;
|
|
26
|
+
y?: number;
|
|
27
|
+
width?: number;
|
|
28
|
+
height?: number;
|
|
29
|
+
}): string;
|
|
30
|
+
addWebpageNode(input: {
|
|
31
|
+
title?: string;
|
|
32
|
+
url: string;
|
|
33
|
+
x?: number;
|
|
34
|
+
y?: number;
|
|
35
|
+
width?: number;
|
|
36
|
+
height?: number;
|
|
37
|
+
}): Promise<{
|
|
38
|
+
ok: boolean;
|
|
39
|
+
id: string;
|
|
40
|
+
error?: string;
|
|
41
|
+
fetch: {
|
|
42
|
+
ok: boolean;
|
|
43
|
+
error?: string;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
refreshWebpageNode(id: string, url?: string): Promise<{
|
|
47
|
+
ok: boolean;
|
|
48
|
+
id: string;
|
|
49
|
+
error?: string;
|
|
50
|
+
}>;
|
|
51
|
+
updateNode(id: string, patch: Partial<CanvasNodeState>): void;
|
|
52
|
+
removeNode(id: string): void;
|
|
53
|
+
addEdge(input: {
|
|
54
|
+
from?: string;
|
|
55
|
+
to?: string;
|
|
56
|
+
fromSearch?: string;
|
|
57
|
+
toSearch?: string;
|
|
58
|
+
type: CanvasEdge['type'];
|
|
59
|
+
label?: string;
|
|
60
|
+
style?: CanvasEdge['style'];
|
|
61
|
+
animated?: boolean;
|
|
62
|
+
}): string;
|
|
63
|
+
removeEdge(id: string): void;
|
|
64
|
+
/**
|
|
65
|
+
* Create a group node and optionally add child nodes to it.
|
|
66
|
+
* If childIds are provided, the group auto-sizes to contain them with padding.
|
|
67
|
+
*/
|
|
68
|
+
createGroup(input: {
|
|
69
|
+
title?: string;
|
|
70
|
+
childIds?: string[];
|
|
71
|
+
x?: number;
|
|
72
|
+
y?: number;
|
|
73
|
+
width?: number;
|
|
74
|
+
height?: number;
|
|
75
|
+
color?: string;
|
|
76
|
+
childLayout?: 'grid' | 'column' | 'flow';
|
|
77
|
+
}): string;
|
|
78
|
+
/** Add nodes to an existing group. */
|
|
79
|
+
groupNodes(groupId: string, childIds: string[], options?: {
|
|
80
|
+
childLayout?: 'grid' | 'column' | 'flow';
|
|
81
|
+
}): boolean;
|
|
82
|
+
/** Remove all children from a group (the group node remains). */
|
|
83
|
+
ungroupNodes(groupId: string): boolean;
|
|
84
|
+
clear(): void;
|
|
85
|
+
arrange(layout?: 'grid' | 'column' | 'flow'): void;
|
|
86
|
+
focusNode(id: string): void;
|
|
87
|
+
getLayout(): CanvasLayout;
|
|
88
|
+
getNode(id: string): CanvasNodeState | undefined;
|
|
89
|
+
search(query: string): ReturnType<typeof searchNodes>;
|
|
90
|
+
getSpatialContext(): import("./spatial-analysis.js").SpatialContext;
|
|
91
|
+
undo(): Promise<{
|
|
92
|
+
ok: boolean;
|
|
93
|
+
description?: string;
|
|
94
|
+
}>;
|
|
95
|
+
redo(): Promise<{
|
|
96
|
+
ok: boolean;
|
|
97
|
+
description?: string;
|
|
98
|
+
}>;
|
|
99
|
+
getHistory(): {
|
|
100
|
+
text: string;
|
|
101
|
+
entries: import("./mutation-history.js").MutationSummary[];
|
|
102
|
+
canUndo: boolean;
|
|
103
|
+
canRedo: boolean;
|
|
104
|
+
};
|
|
105
|
+
applyUpdates(updates: Array<{
|
|
106
|
+
id: string;
|
|
107
|
+
position?: {
|
|
108
|
+
x: number;
|
|
109
|
+
y: number;
|
|
110
|
+
};
|
|
111
|
+
size?: {
|
|
112
|
+
width: number;
|
|
113
|
+
height: number;
|
|
114
|
+
};
|
|
115
|
+
collapsed?: boolean;
|
|
116
|
+
dockPosition?: 'left' | 'right' | null;
|
|
117
|
+
}>): {
|
|
118
|
+
applied: number;
|
|
119
|
+
skipped: number;
|
|
120
|
+
};
|
|
121
|
+
setContextPins(nodeIds: string[], mode?: 'set' | 'add' | 'remove'): {
|
|
122
|
+
count: number;
|
|
123
|
+
nodeIds: string[];
|
|
124
|
+
};
|
|
125
|
+
listSnapshots(): import("./canvas-state.js").CanvasSnapshot[];
|
|
126
|
+
saveSnapshot(name: string): import("./canvas-state.js").CanvasSnapshot | null;
|
|
127
|
+
restoreSnapshot(id: string): Promise<{
|
|
128
|
+
ok: boolean;
|
|
129
|
+
}>;
|
|
130
|
+
deleteSnapshot(id: string): {
|
|
131
|
+
ok: boolean;
|
|
132
|
+
};
|
|
133
|
+
diffSnapshot(idOrName: string): {
|
|
134
|
+
ok: boolean;
|
|
135
|
+
text?: string;
|
|
136
|
+
diff?: ReturnType<typeof diffLayouts>;
|
|
137
|
+
error?: string;
|
|
138
|
+
};
|
|
139
|
+
getCodeGraph(): {
|
|
140
|
+
text: string;
|
|
141
|
+
summary: import("./code-graph.js").CodeGraphSummary;
|
|
142
|
+
};
|
|
143
|
+
validate(): import("./canvas-validation.js").CanvasValidationResult;
|
|
144
|
+
private findCanvasExtAppNodeId;
|
|
145
|
+
describeSchema(): {
|
|
146
|
+
ok: true;
|
|
147
|
+
source: "running-server";
|
|
148
|
+
version: string | null;
|
|
149
|
+
nodeTypes: import("./canvas-schema.js").CanvasCreateTypeSchema[];
|
|
150
|
+
jsonRender: {
|
|
151
|
+
rootShape: Record<string, string>;
|
|
152
|
+
components: import("../json-render/catalog.js").JsonRenderComponentDescriptor[];
|
|
153
|
+
};
|
|
154
|
+
graph: {
|
|
155
|
+
graphTypes: ("line" | "bar" | "pie" | "area" | "scatter" | "radar" | "composed" | "stacked-bar")[];
|
|
156
|
+
};
|
|
157
|
+
mcp: {
|
|
158
|
+
tools: string[];
|
|
159
|
+
resources: string[];
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
validateSpec(input: {
|
|
163
|
+
type: 'json-render' | 'graph';
|
|
164
|
+
spec?: unknown;
|
|
165
|
+
graph?: GraphNodeInput;
|
|
166
|
+
}): import("./canvas-schema.js").StructuredValidationResult;
|
|
167
|
+
runBatch(operations: Array<{
|
|
168
|
+
op: string;
|
|
169
|
+
assign?: string;
|
|
170
|
+
args?: Record<string, unknown>;
|
|
171
|
+
}>): Promise<{
|
|
172
|
+
ok: boolean;
|
|
173
|
+
results: Array<Record<string, unknown>>;
|
|
174
|
+
refs: Record<string, unknown>;
|
|
175
|
+
failedIndex?: number;
|
|
176
|
+
error?: string;
|
|
177
|
+
}>;
|
|
178
|
+
buildWebArtifact(input: WebArtifactBuildInput & {
|
|
179
|
+
openInCanvas?: boolean;
|
|
180
|
+
}): Promise<WebArtifactCanvasBuildResult>;
|
|
181
|
+
openMcpApp(input: {
|
|
182
|
+
transport: ExternalMcpTransportConfig;
|
|
183
|
+
toolName: string;
|
|
184
|
+
toolArguments?: Record<string, unknown>;
|
|
185
|
+
serverName?: string;
|
|
186
|
+
title?: string;
|
|
187
|
+
x?: number;
|
|
188
|
+
y?: number;
|
|
189
|
+
width?: number;
|
|
190
|
+
height?: number;
|
|
191
|
+
}): Promise<{
|
|
192
|
+
ok: true;
|
|
193
|
+
nodeId: string | null;
|
|
194
|
+
toolCallId: string;
|
|
195
|
+
sessionId: string;
|
|
196
|
+
resourceUri: string;
|
|
197
|
+
}>;
|
|
198
|
+
addDiagram(input: DiagramPresetOpenInput): Promise<{
|
|
199
|
+
ok: true;
|
|
200
|
+
nodeId: string | null;
|
|
201
|
+
toolCallId: string;
|
|
202
|
+
sessionId: string;
|
|
203
|
+
resourceUri: string;
|
|
204
|
+
}>;
|
|
205
|
+
addJsonRenderNode(input: JsonRenderNodeInput): {
|
|
206
|
+
id: string;
|
|
207
|
+
url: string;
|
|
208
|
+
spec: JsonRenderSpec;
|
|
209
|
+
};
|
|
210
|
+
addGraphNode(input: GraphNodeInput): {
|
|
211
|
+
id: string;
|
|
212
|
+
url: string;
|
|
213
|
+
spec: JsonRenderSpec;
|
|
214
|
+
};
|
|
215
|
+
get port(): number;
|
|
216
|
+
startAutomationWebView(options?: CanvasAutomationWebViewOptions): Promise<CanvasAutomationWebViewStatus>;
|
|
217
|
+
stopAutomationWebView(): Promise<boolean>;
|
|
218
|
+
getAutomationWebViewStatus(): CanvasAutomationWebViewStatus;
|
|
219
|
+
evaluateAutomationWebView(expression: string): Promise<unknown>;
|
|
220
|
+
resizeAutomationWebView(width: number, height: number): Promise<CanvasAutomationWebViewStatus>;
|
|
221
|
+
screenshotAutomationWebView(options?: Record<string, unknown>): Promise<Uint8Array>;
|
|
222
|
+
}
|
|
223
|
+
export declare function createCanvas(options?: {
|
|
224
|
+
port?: number;
|
|
225
|
+
}): PmxCanvas;
|
|
226
|
+
export type { CanvasNodeState, CanvasEdge, CanvasLayout, ViewportState } from './canvas-state.js';
|
|
227
|
+
export type { CanvasAutomationWebViewOptions, CanvasAutomationWebViewStatus, PrimaryWorkbenchCanvasPromptRequest, PrimaryWorkbenchIntent, } from './server.js';
|
|
228
|
+
export { emitPrimaryWorkbenchEvent, consumePrimaryWorkbenchIntents, setPrimaryWorkbenchAutoOpenEnabled, setPrimaryWorkbenchCanvasPromptHandler, startCanvasServer, stopCanvasServer, getCanvasServerPort, openUrlInExternalBrowser, getCanvasAutomationWebViewStatus, startCanvasAutomationWebView, stopCanvasAutomationWebView, evaluateCanvasAutomationWebView, resizeCanvasAutomationWebView, screenshotCanvasAutomationWebView, } from './server.js';
|
|
229
|
+
export { canvasState } from './canvas-state.js';
|
|
230
|
+
export type { CanvasSnapshot } from './canvas-state.js';
|
|
231
|
+
export { findOpenCanvasPosition } from './placement.js';
|
|
232
|
+
export { searchNodes, buildSpatialContext, detectClusters, findNeighborhoods } from './spatial-analysis.js';
|
|
233
|
+
export type { SpatialCluster, SpatialContext, SpatialNeighbor, NodeSpatialInfo } from './spatial-analysis.js';
|
|
234
|
+
export { mutationHistory, diffLayouts, formatDiff } from './mutation-history.js';
|
|
235
|
+
export { recomputeCodeGraph, buildCodeGraphSummary, formatCodeGraph } from './code-graph.js';
|
|
236
|
+
export { describeCanvasSchema, validateStructuredCanvasPayload } from './canvas-schema.js';
|
|
237
|
+
export { buildWebArtifactOnCanvas, executeWebArtifactBuild, openWebArtifactInCanvas, resolveWebArtifactScriptPath, resolveWorkspacePath, } from './web-artifacts.js';
|
|
238
|
+
export { buildGraphSpec, buildJsonRenderViewerHtml, createJsonRenderNodeData, GRAPH_NODE_SIZE, JSON_RENDER_NODE_SIZE, normalizeAndValidateJsonRenderSpec, } from '../json-render/server.js';
|
|
239
|
+
export type { CodeGraphSummary, CodeGraphEdge } from './code-graph.js';
|
|
240
|
+
export type { MutationEntry, MutationSummary, SnapshotDiffResult } from './mutation-history.js';
|
|
241
|
+
export type { WebArtifactBuildInput, WebArtifactBuildOutput, WebArtifactCanvasBuildResult, WebArtifactCanvasOpenResult, } from './web-artifacts.js';
|
|
242
|
+
export type { GraphNodeInput, JsonRenderNodeInput, JsonRenderSpec } from '../json-render/server.js';
|
|
243
|
+
export { traceManager } from './trace-manager.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP app candidate detection — standalone version.
|
|
3
|
+
*
|
|
4
|
+
* Removed PMX-specific imports (inferServerNameFromToolName, excalidraw-url helpers).
|
|
5
|
+
* Inlined the necessary URL detection logic.
|
|
6
|
+
*/
|
|
7
|
+
export interface McpAppToolCompletionInput {
|
|
8
|
+
name: string;
|
|
9
|
+
mcpServerName?: string;
|
|
10
|
+
mcpToolName?: string;
|
|
11
|
+
result: unknown;
|
|
12
|
+
content?: string;
|
|
13
|
+
detailedContent?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface McpAppToolCandidate {
|
|
16
|
+
url: string;
|
|
17
|
+
inferredType: string;
|
|
18
|
+
keyHint: string;
|
|
19
|
+
sourceServer: string | null;
|
|
20
|
+
sourceTool: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function inferMcpAppType(url: string): string;
|
|
23
|
+
export declare function isLikelyMcpAppWebUrl(url: string): boolean;
|
|
24
|
+
export declare function inferMcpAppSourceServer(input: Pick<McpAppToolCompletionInput, 'name' | 'mcpServerName'>, url: string): string | null;
|
|
25
|
+
export declare function getMcpAppCandidateFromToolCompletion(data: McpAppToolCompletionInput): McpAppToolCandidate | null;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export type McpAppHostCapabilityState = 'supported' | 'unsupported' | 'degraded';
|
|
2
|
+
export interface McpAppHostCapability {
|
|
3
|
+
serverName: string;
|
|
4
|
+
state: McpAppHostCapabilityState;
|
|
5
|
+
reasonCode: string;
|
|
6
|
+
runtimeReady: boolean;
|
|
7
|
+
serverSupportsHost: boolean;
|
|
8
|
+
updatedAt: string;
|
|
9
|
+
}
|
|
10
|
+
export type McpAppHostSessionState = 'active' | 'background' | 'closed';
|
|
11
|
+
export interface McpAppHostSession {
|
|
12
|
+
sessionId: string;
|
|
13
|
+
sourceServer: string | null;
|
|
14
|
+
sourceTool: string;
|
|
15
|
+
url: string;
|
|
16
|
+
inferredType: string;
|
|
17
|
+
trustedDomain: boolean;
|
|
18
|
+
state: McpAppHostSessionState;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
lastSeenAt: string;
|
|
21
|
+
fallbackReason: string | null;
|
|
22
|
+
lastExternalOpenAt: string | null;
|
|
23
|
+
}
|
|
24
|
+
export interface McpAppHostSnapshot {
|
|
25
|
+
runtimeEnabled: boolean;
|
|
26
|
+
activeSessionId: string | null;
|
|
27
|
+
sessions: McpAppHostSession[];
|
|
28
|
+
capabilities: McpAppHostCapability[];
|
|
29
|
+
metrics: {
|
|
30
|
+
hostedOpens: number;
|
|
31
|
+
fallbackTotal: number;
|
|
32
|
+
fallbackByReason: Record<string, number>;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface McpAppCandidateInput {
|
|
36
|
+
sourceServer: string | null;
|
|
37
|
+
sourceTool: string;
|
|
38
|
+
url: string;
|
|
39
|
+
inferredType: string;
|
|
40
|
+
keyHint: string;
|
|
41
|
+
}
|
|
42
|
+
export interface McpAppHostRoutingResult {
|
|
43
|
+
mode: 'hosted' | 'fallback';
|
|
44
|
+
reasonCode: string;
|
|
45
|
+
trustedDomain: boolean;
|
|
46
|
+
capability: McpAppHostCapability;
|
|
47
|
+
session: McpAppHostSession | null;
|
|
48
|
+
}
|
|
49
|
+
export declare function isTrustedMcpAppDomain(url: string): boolean;
|
|
50
|
+
export declare function registerMcpAppHostCapability(input: {
|
|
51
|
+
serverName: string;
|
|
52
|
+
state: McpAppHostCapabilityState;
|
|
53
|
+
reasonCode: string;
|
|
54
|
+
runtimeReady: boolean;
|
|
55
|
+
serverSupportsHost: boolean;
|
|
56
|
+
}): McpAppHostCapability;
|
|
57
|
+
export declare function preRegisterKnownMcpAppHostCapabilities(serverNames: string[]): void;
|
|
58
|
+
export declare function routeMcpAppCandidateToHost(input: McpAppCandidateInput): McpAppHostRoutingResult;
|
|
59
|
+
export declare function focusMcpAppHostSession(sessionId: string): McpAppHostSession | null;
|
|
60
|
+
export declare function closeMcpAppHostSession(sessionId: string): McpAppHostSession | null;
|
|
61
|
+
export declare function markMcpAppHostSessionOpenedExternally(sessionId: string): McpAppHostSession | null;
|
|
62
|
+
export declare function listMcpAppHostSessions(options?: {
|
|
63
|
+
includeClosed?: boolean;
|
|
64
|
+
}): McpAppHostSession[];
|
|
65
|
+
export declare function getMcpAppHostSnapshot(): McpAppHostSnapshot;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { CallToolResult, ListPromptsResult, ListResourcesResult, ListResourceTemplatesResult, ListToolsResult, ReadResourceResult, Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import type { McpUiResourceMeta } from '@modelcontextprotocol/ext-apps';
|
|
3
|
+
export interface ExternalMcpHttpTransportConfig {
|
|
4
|
+
type: 'http';
|
|
5
|
+
url: string;
|
|
6
|
+
headers?: Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
export interface ExternalMcpStdioTransportConfig {
|
|
9
|
+
type: 'stdio';
|
|
10
|
+
command: string;
|
|
11
|
+
args?: string[];
|
|
12
|
+
cwd?: string;
|
|
13
|
+
env?: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
export type ExternalMcpTransportConfig = ExternalMcpHttpTransportConfig | ExternalMcpStdioTransportConfig;
|
|
16
|
+
export interface OpenMcpAppInput {
|
|
17
|
+
transport: ExternalMcpTransportConfig;
|
|
18
|
+
toolName: string;
|
|
19
|
+
toolArguments?: Record<string, unknown>;
|
|
20
|
+
serverName?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface OpenMcpAppResult {
|
|
23
|
+
sessionId: string;
|
|
24
|
+
serverName: string;
|
|
25
|
+
toolName: string;
|
|
26
|
+
tool: Tool;
|
|
27
|
+
toolInput: Record<string, unknown>;
|
|
28
|
+
toolResult: CallToolResult;
|
|
29
|
+
resourceUri: string;
|
|
30
|
+
html: string;
|
|
31
|
+
resourceMeta?: McpUiResourceMeta;
|
|
32
|
+
}
|
|
33
|
+
export interface ExtAppModelContextUpdateInput {
|
|
34
|
+
content?: unknown[];
|
|
35
|
+
structuredContent?: Record<string, unknown>;
|
|
36
|
+
}
|
|
37
|
+
export declare function openMcpApp(input: OpenMcpAppInput): Promise<OpenMcpAppResult>;
|
|
38
|
+
export declare function callMcpAppTool(sessionId: string, toolName: string, args?: Record<string, unknown>): Promise<CallToolResult>;
|
|
39
|
+
export declare function readMcpAppResource(sessionId: string, uri: string): Promise<ReadResourceResult>;
|
|
40
|
+
export declare function listMcpAppTools(sessionId: string): Promise<ListToolsResult>;
|
|
41
|
+
export declare function listMcpAppResources(sessionId: string): Promise<ListResourcesResult>;
|
|
42
|
+
export declare function listMcpAppResourceTemplates(sessionId: string): Promise<ListResourceTemplatesResult>;
|
|
43
|
+
export declare function listMcpAppPrompts(sessionId: string): Promise<ListPromptsResult>;
|
|
44
|
+
export declare function closeMcpAppSession(sessionId: string): void;
|
|
45
|
+
export declare function closeAllMcpAppSessions(): void;
|
|
46
|
+
export declare function hasMcpAppSession(sessionId: string): boolean;
|
|
47
|
+
export declare function listMcpAppSessionIds(): string[];
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canvas Mutation History — Time Travel for PMX Canvas
|
|
3
|
+
*
|
|
4
|
+
* Records every canvas mutation in an in-memory ring buffer with forward/inverse
|
|
5
|
+
* closures for undo/redo. Provides a human-readable history timeline and
|
|
6
|
+
* snapshot diff capabilities.
|
|
7
|
+
*
|
|
8
|
+
* Design decisions:
|
|
9
|
+
* - In-memory only (not persisted) — history is session-scoped
|
|
10
|
+
* - Ring buffer caps at 200 entries to bound memory
|
|
11
|
+
* - forward/inverse closures capture cloned state at record time
|
|
12
|
+
* - _replaying flag prevents undo/redo from recording new entries
|
|
13
|
+
*/
|
|
14
|
+
import type { CanvasNodeState, CanvasEdge } from './canvas-state.js';
|
|
15
|
+
export type MutationOp = 'addNode' | 'updateNode' | 'removeNode' | 'addEdge' | 'removeEdge' | 'clear' | 'arrange' | 'restoreSnapshot' | 'setPins' | 'batch' | 'viewport' | 'groupNodes' | 'ungroupNodes';
|
|
16
|
+
export interface MutationEntry {
|
|
17
|
+
id: string;
|
|
18
|
+
timestamp: string;
|
|
19
|
+
description: string;
|
|
20
|
+
operationType: MutationOp;
|
|
21
|
+
forward: () => void;
|
|
22
|
+
inverse: () => void;
|
|
23
|
+
}
|
|
24
|
+
export interface MutationSummary {
|
|
25
|
+
id: string;
|
|
26
|
+
timestamp: string;
|
|
27
|
+
description: string;
|
|
28
|
+
operationType: MutationOp;
|
|
29
|
+
isCurrent: boolean;
|
|
30
|
+
isUndone: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface SnapshotDiffResult {
|
|
33
|
+
snapshotName: string;
|
|
34
|
+
addedNodes: {
|
|
35
|
+
id: string;
|
|
36
|
+
type: string;
|
|
37
|
+
title: string | null;
|
|
38
|
+
}[];
|
|
39
|
+
removedNodes: {
|
|
40
|
+
id: string;
|
|
41
|
+
type: string;
|
|
42
|
+
title: string | null;
|
|
43
|
+
}[];
|
|
44
|
+
modifiedNodes: {
|
|
45
|
+
id: string;
|
|
46
|
+
type: string;
|
|
47
|
+
title: string | null;
|
|
48
|
+
changes: string[];
|
|
49
|
+
}[];
|
|
50
|
+
addedEdges: {
|
|
51
|
+
id: string;
|
|
52
|
+
from: string;
|
|
53
|
+
to: string;
|
|
54
|
+
type: string;
|
|
55
|
+
}[];
|
|
56
|
+
removedEdges: {
|
|
57
|
+
id: string;
|
|
58
|
+
from: string;
|
|
59
|
+
to: string;
|
|
60
|
+
type: string;
|
|
61
|
+
}[];
|
|
62
|
+
}
|
|
63
|
+
declare class MutationHistory {
|
|
64
|
+
private entries;
|
|
65
|
+
/** Index of the last applied mutation. -1 means nothing applied / all undone. */
|
|
66
|
+
private cursor;
|
|
67
|
+
/** When true, mutations triggered by undo/redo are not recorded. */
|
|
68
|
+
private _replaying;
|
|
69
|
+
get isReplaying(): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Record a new mutation. Truncates any redo-able future, then appends.
|
|
72
|
+
* If called while replaying (undo/redo), the call is silently ignored.
|
|
73
|
+
*/
|
|
74
|
+
record(entry: Omit<MutationEntry, 'id' | 'timestamp'>): void;
|
|
75
|
+
/** Undo the last applied mutation. Returns the entry that was undone, or null. */
|
|
76
|
+
undo(): MutationEntry | null;
|
|
77
|
+
/** Redo the next undone mutation. Returns the entry that was redone, or null. */
|
|
78
|
+
redo(): MutationEntry | null;
|
|
79
|
+
canUndo(): boolean;
|
|
80
|
+
canRedo(): boolean;
|
|
81
|
+
/** Get all entries with current/undone status for display. */
|
|
82
|
+
getSummaries(): MutationSummary[];
|
|
83
|
+
/** Human-readable timeline for the canvas://history resource. */
|
|
84
|
+
toHumanReadable(): string;
|
|
85
|
+
/** Number of recorded entries. */
|
|
86
|
+
get length(): number;
|
|
87
|
+
/** Clear all recorded mutations. Useful for isolated test runs. */
|
|
88
|
+
reset(): void;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Compare two canvas layouts and produce a structured diff.
|
|
92
|
+
*/
|
|
93
|
+
export declare function diffLayouts(snapshotName: string, snapshotLayout: {
|
|
94
|
+
nodes: CanvasNodeState[];
|
|
95
|
+
edges: CanvasEdge[];
|
|
96
|
+
}, currentLayout: {
|
|
97
|
+
nodes: CanvasNodeState[];
|
|
98
|
+
edges: CanvasEdge[];
|
|
99
|
+
}): SnapshotDiffResult;
|
|
100
|
+
/**
|
|
101
|
+
* Format a diff result as human-readable text for MCP.
|
|
102
|
+
*/
|
|
103
|
+
export declare function formatDiff(diff: SnapshotDiffResult): string;
|
|
104
|
+
export declare const mutationHistory: MutationHistory;
|
|
105
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type CanvasPlacementRect } from '../shared/placement.js';
|
|
2
|
+
export { findOpenCanvasPosition, type CanvasPlacementRect } from '../shared/placement.js';
|
|
3
|
+
export declare const GROUP_PAD = 40;
|
|
4
|
+
export declare const GROUP_TITLEBAR_HEIGHT = 32;
|
|
5
|
+
/**
|
|
6
|
+
* Compute bounding box for a group that should contain the given child rects.
|
|
7
|
+
* Returns position and size with padding, or null if no valid children.
|
|
8
|
+
*/
|
|
9
|
+
export declare function computeGroupBounds(children: CanvasPlacementRect[], defaultWidth?: number, defaultHeight?: number): {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
} | null;
|
|
15
|
+
export declare function computePackedGroupLayout<T extends CanvasPlacementRect & {
|
|
16
|
+
id: string;
|
|
17
|
+
}>(children: T[]): {
|
|
18
|
+
positions: Map<string, {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
}>;
|
|
22
|
+
bounds: {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
width: number;
|
|
26
|
+
height: number;
|
|
27
|
+
} | null;
|
|
28
|
+
};
|
|
29
|
+
export declare function resolveGroupCollision(bounds: {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
}, existing: CanvasPlacementRect[]): {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standalone canvas server — extracted from PMX web-canvas/server.ts.
|
|
3
|
+
*
|
|
4
|
+
* Provides:
|
|
5
|
+
* - GET /workbench -> canvas SPA HTML
|
|
6
|
+
* - GET /api/file?path=... -> read markdown content
|
|
7
|
+
* - POST /api/file/save -> persist markdown edits
|
|
8
|
+
* - POST /api/render -> server-side markdown render (marked)
|
|
9
|
+
* - GET /api/canvas/state -> canvas layout
|
|
10
|
+
* - POST /api/canvas/update -> batch node updates
|
|
11
|
+
* - POST /api/canvas/edge -> add edge
|
|
12
|
+
* - DELETE /api/canvas/edge -> remove edge
|
|
13
|
+
* - POST /api/canvas/prompt -> canvas prompt
|
|
14
|
+
* - POST /api/canvas/context-pins -> update context pins
|
|
15
|
+
* - GET /api/canvas/pinned-context -> get pinned context preamble
|
|
16
|
+
* - GET /api/canvas/spatial-context -> spatial analysis (clusters, reading order, neighborhoods)
|
|
17
|
+
* - GET /api/canvas/search?q=... -> full-text search across nodes
|
|
18
|
+
* - GET /api/canvas/code-graph -> auto-detected file dependency graph
|
|
19
|
+
* - POST /api/canvas/undo -> undo last mutation
|
|
20
|
+
* - POST /api/canvas/redo -> redo last undone mutation
|
|
21
|
+
* - GET /api/canvas/history -> mutation history timeline
|
|
22
|
+
* - POST /api/canvas/json-render -> create a native json-render node
|
|
23
|
+
* - POST /api/canvas/graph -> create a native graph node
|
|
24
|
+
* - GET /api/canvas/json-render/view?nodeId=... -> local json-render viewer
|
|
25
|
+
* - POST /api/canvas/web-artifact -> build bundled HTML artifact + optional canvas node
|
|
26
|
+
* - GET /api/workbench/events -> SSE event stream
|
|
27
|
+
* - GET /api/workbench/state -> workbench state snapshot
|
|
28
|
+
* - POST /api/workbench/intent -> workbench intents
|
|
29
|
+
* - GET /api/workbench/webview -> Bun.WebView automation status
|
|
30
|
+
* - POST /api/workbench/webview/start -> start Bun.WebView automation session
|
|
31
|
+
* - POST /api/workbench/webview/evaluate -> evaluate JS in Bun.WebView automation session
|
|
32
|
+
* - POST /api/workbench/webview/resize -> resize Bun.WebView automation viewport
|
|
33
|
+
* - POST /api/workbench/webview/screenshot -> capture Bun.WebView automation screenshot
|
|
34
|
+
* - DELETE /api/workbench/webview -> stop Bun.WebView automation session
|
|
35
|
+
*/
|
|
36
|
+
export interface PrimaryWorkbenchEventPayload {
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
}
|
|
39
|
+
export interface CanvasAutomationWebViewOptions {
|
|
40
|
+
backend?: 'webkit' | 'chrome';
|
|
41
|
+
width?: number;
|
|
42
|
+
height?: number;
|
|
43
|
+
chromePath?: string;
|
|
44
|
+
chromeArgv?: string[];
|
|
45
|
+
dataStoreDir?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface CanvasAutomationWebViewStatus {
|
|
48
|
+
supported: boolean;
|
|
49
|
+
active: boolean;
|
|
50
|
+
headlessOnly: true;
|
|
51
|
+
url: string | null;
|
|
52
|
+
backend: 'webkit' | 'chrome' | null;
|
|
53
|
+
width: number | null;
|
|
54
|
+
height: number | null;
|
|
55
|
+
dataStoreDir: string | null;
|
|
56
|
+
startedAt: string | null;
|
|
57
|
+
lastError: string | null;
|
|
58
|
+
}
|
|
59
|
+
export declare function getCanvasAutomationWebViewStatus(): CanvasAutomationWebViewStatus;
|
|
60
|
+
export declare function stopCanvasAutomationWebView(): Promise<boolean>;
|
|
61
|
+
export declare function startCanvasAutomationWebView(url: string, options?: CanvasAutomationWebViewOptions): Promise<CanvasAutomationWebViewStatus>;
|
|
62
|
+
export declare function evaluateCanvasAutomationWebView(expression: string): Promise<unknown>;
|
|
63
|
+
export declare function resizeCanvasAutomationWebView(width: number, height: number): Promise<CanvasAutomationWebViewStatus>;
|
|
64
|
+
export declare function screenshotCanvasAutomationWebView(options?: Record<string, unknown>): Promise<Uint8Array>;
|
|
65
|
+
export interface PrimaryWorkbenchIntent {
|
|
66
|
+
id: number;
|
|
67
|
+
type: 'focus-primary' | 'refresh-artifact' | 'review-artifact' | 'focus-approval' | 'open-aux' | 'close-aux' | 'mcp-app-focus' | 'mcp-app-close' | 'trace-toggle' | 'trace-clear' | 'canvas-prompt';
|
|
68
|
+
payload: PrimaryWorkbenchEventPayload;
|
|
69
|
+
createdAt: string;
|
|
70
|
+
}
|
|
71
|
+
export interface PrimaryWorkbenchCanvasPromptRequest {
|
|
72
|
+
nodeId: string;
|
|
73
|
+
text: string;
|
|
74
|
+
displayText: string;
|
|
75
|
+
parentNodeId?: string;
|
|
76
|
+
contextNodeIds: string[];
|
|
77
|
+
}
|
|
78
|
+
type PrimaryWorkbenchCanvasPromptHandler = (request: PrimaryWorkbenchCanvasPromptRequest) => Promise<void>;
|
|
79
|
+
export declare function setPrimaryWorkbenchAutoOpenEnabled(enabled: boolean): void;
|
|
80
|
+
export declare function isPrimaryWorkbenchAutoOpenEnabled(): boolean;
|
|
81
|
+
export declare function hasWorkbenchSubscribers(): boolean;
|
|
82
|
+
export declare function setPrimaryWorkbenchCanvasPromptHandler(handler: PrimaryWorkbenchCanvasPromptHandler | null): void;
|
|
83
|
+
export declare function buildMacBrowserOpenScript(appName: string, url: string): string;
|
|
84
|
+
export declare function openUrlInExternalBrowser(url: string): boolean;
|
|
85
|
+
export declare function emitPrimaryWorkbenchEvent(event: string, payload?: PrimaryWorkbenchEventPayload): void;
|
|
86
|
+
export declare function consumePrimaryWorkbenchIntents(limit?: number): PrimaryWorkbenchIntent[];
|
|
87
|
+
export declare function getPrimaryWorkbenchUrl(workspaceRoot?: string): string | null;
|
|
88
|
+
export declare function syncCanvasBrowserOpenedFromSubscribers(): void;
|
|
89
|
+
export declare function isCanvasBrowserOpened(): boolean;
|
|
90
|
+
export declare function isCanvasBrowserOpening(): boolean;
|
|
91
|
+
export declare function markCanvasBrowserOpened(): void;
|
|
92
|
+
export declare function markCanvasBrowserOpening(): void;
|
|
93
|
+
export declare function openPrimaryWorkbenchPath(pathLike: string, workspaceRoot?: string): string | null;
|
|
94
|
+
export interface CanvasServerOptions {
|
|
95
|
+
port?: number;
|
|
96
|
+
workspaceRoot?: string;
|
|
97
|
+
autoOpenBrowser?: boolean;
|
|
98
|
+
}
|
|
99
|
+
export declare function startCanvasServer(options?: CanvasServerOptions): string | null;
|
|
100
|
+
export declare function stopCanvasServer(): void;
|
|
101
|
+
export declare function getCanvasServerPort(): number | null;
|
|
102
|
+
export { closeMcpAppHostSession, focusMcpAppHostSession, getMcpAppHostSnapshot, isTrustedMcpAppDomain, listMcpAppHostSessions, markMcpAppHostSessionOpenedExternally, preRegisterKnownMcpAppHostCapabilities, registerMcpAppHostCapability, routeMcpAppCandidateToHost, } from './mcp-app-host.js';
|
|
103
|
+
export type { McpAppCandidateInput, McpAppHostCapability, McpAppHostCapabilityState, McpAppHostRoutingResult, McpAppHostSession, McpAppHostSnapshot, } from './mcp-app-host.js';
|