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.
Files changed (37) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/dist/canvas/global.css +88 -0
  3. package/dist/canvas/index.js +87 -53
  4. package/dist/types/client/nodes/HtmlNode.d.ts +12 -1
  5. package/dist/types/client/types.d.ts +1 -1
  6. package/dist/types/server/html-node-summary.d.ts +2 -0
  7. package/dist/types/server/html-primitives.d.ts +9 -1
  8. package/dist/types/server/index.d.ts +8 -1
  9. package/docs/http-api.md +1 -1
  10. package/docs/mcp.md +4 -0
  11. package/docs/node-types.md +27 -5
  12. package/docs/screenshot.png +0 -0
  13. package/docs/sdk.md +1 -0
  14. package/package.json +1 -1
  15. package/skills/pmx-canvas/SKILL.md +10 -4
  16. package/skills/pmx-canvas/references/html-primitives.md +132 -0
  17. package/src/cli/agent.ts +9 -0
  18. package/src/cli/index.ts +1 -1
  19. package/src/client/App.tsx +1 -1
  20. package/src/client/canvas/CommandPalette.tsx +1 -1
  21. package/src/client/canvas/ExpandedNodeOverlay.tsx +105 -2
  22. package/src/client/canvas/auto-fit.ts +5 -1
  23. package/src/client/nodes/HtmlNode.tsx +125 -13
  24. package/src/client/state/sse-bridge.ts +1 -1
  25. package/src/client/theme/global.css +88 -0
  26. package/src/mcp/canvas-access.ts +31 -1
  27. package/src/mcp/server.ts +17 -3
  28. package/src/server/agent-context.ts +23 -1
  29. package/src/server/canvas-operations.ts +10 -2
  30. package/src/server/canvas-provenance.ts +8 -6
  31. package/src/server/canvas-schema.ts +11 -0
  32. package/src/server/canvas-serialization.ts +10 -5
  33. package/src/server/html-node-summary.ts +141 -0
  34. package/src/server/html-primitives.ts +318 -8
  35. package/src/server/index.ts +22 -3
  36. package/src/server/server.ts +17 -4
  37. 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);