pmx-canvas 0.1.20 → 0.1.21
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 +85 -0
- package/dist/canvas/global.css +88 -0
- package/dist/canvas/index.js +87 -53
- package/dist/types/client/nodes/HtmlNode.d.ts +12 -1
- package/dist/types/client/types.d.ts +1 -1
- package/dist/types/server/html-node-summary.d.ts +2 -0
- package/dist/types/server/html-primitives.d.ts +9 -1
- package/dist/types/server/index.d.ts +8 -1
- package/docs/http-api.md +1 -1
- package/docs/mcp.md +4 -0
- package/docs/node-types.md +27 -5
- package/docs/screenshot.png +0 -0
- package/docs/sdk.md +1 -0
- package/package.json +1 -1
- package/skills/pmx-canvas/SKILL.md +10 -4
- package/skills/pmx-canvas/references/html-primitives.md +132 -0
- package/src/cli/agent.ts +9 -0
- package/src/cli/index.ts +1 -1
- package/src/client/App.tsx +1 -1
- package/src/client/canvas/CommandPalette.tsx +1 -1
- package/src/client/canvas/ExpandedNodeOverlay.tsx +105 -2
- package/src/client/canvas/auto-fit.ts +5 -1
- package/src/client/nodes/HtmlNode.tsx +125 -13
- package/src/client/state/sse-bridge.ts +1 -1
- package/src/client/theme/global.css +88 -0
- package/src/mcp/canvas-access.ts +31 -1
- package/src/mcp/server.ts +17 -3
- package/src/server/agent-context.ts +23 -1
- package/src/server/canvas-operations.ts +10 -2
- package/src/server/canvas-provenance.ts +8 -6
- package/src/server/canvas-schema.ts +11 -0
- package/src/server/canvas-serialization.ts +10 -5
- package/src/server/html-node-summary.ts +141 -0
- package/src/server/html-primitives.ts +318 -8
- package/src/server/index.ts +22 -3
- package/src/server/server.ts +17 -4
- package/src/server/spatial-analysis.ts +4 -2
|
@@ -312,9 +312,10 @@ export function searchNodes(
|
|
|
312
312
|
|
|
313
313
|
for (const node of nodes) {
|
|
314
314
|
const title = ((node.data.title as string) ?? '').toLowerCase();
|
|
315
|
-
const content = ((node.data.content as string) ?? (node.data.description as string) ?? (node.data.fileContent as string) ?? '').toLowerCase();
|
|
315
|
+
const content = ((node.data.content as string) ?? (node.data.agentSummary as string) ?? (node.data.contentSummary as string) ?? (node.data.description as string) ?? (node.data.fileContent as string) ?? '').toLowerCase();
|
|
316
316
|
const path = ((node.data.path as string) ?? '').toLowerCase();
|
|
317
317
|
const description = ((node.data.description as string) ?? '').toLowerCase();
|
|
318
|
+
const summary = ((node.data.summary as string) ?? (node.data.agentSummary as string) ?? (node.data.contentSummary as string) ?? '').toLowerCase();
|
|
318
319
|
const url = ((node.data.url as string) ?? '').toLowerCase();
|
|
319
320
|
|
|
320
321
|
let score = 0;
|
|
@@ -324,6 +325,7 @@ export function searchNodes(
|
|
|
324
325
|
if (path.includes(term)) score += 2;
|
|
325
326
|
if (url.includes(term)) score += 2;
|
|
326
327
|
if (description.includes(term)) score += 1;
|
|
328
|
+
if (summary.includes(term)) score += 1;
|
|
327
329
|
if (content.includes(term)) score += 1;
|
|
328
330
|
}
|
|
329
331
|
|
|
@@ -331,7 +333,7 @@ export function searchNodes(
|
|
|
331
333
|
|
|
332
334
|
// Extract a snippet around the first match in content
|
|
333
335
|
let snippet = '';
|
|
334
|
-
const fullContent = (node.data.content as string) ?? (node.data.description as string) ?? (node.data.fileContent as string) ?? '';
|
|
336
|
+
const fullContent = (node.data.content as string) ?? (node.data.agentSummary as string) ?? (node.data.contentSummary as string) ?? (node.data.description as string) ?? (node.data.fileContent as string) ?? '';
|
|
335
337
|
const matchIdx = fullContent.toLowerCase().indexOf(terms[0]);
|
|
336
338
|
if (matchIdx >= 0) {
|
|
337
339
|
const start = Math.max(0, matchIdx - 40);
|