pmx-canvas 0.8.0 → 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.
@@ -43,6 +43,12 @@ async function invokeMcpOperation(
43
43
  .filter((item): item is Extract<(typeof formatted.content)[number], { type: 'text' }> => item.type === 'text')
44
44
  .map((item) => item.text)
45
45
  .join('');
46
+ if (op.name === 'node.get') {
47
+ // Compact responses can still deliver text. Metadata without text or
48
+ // data must not mark unseen content read.
49
+ const node = JSON.parse(text) as { data?: unknown; content?: string | null };
50
+ if (node.data === undefined && !node.content) return formatted;
51
+ }
46
52
  try {
47
53
  await host.recordContextRead(
48
54
  contextReadFromPayload(
@@ -309,7 +309,11 @@ const jsonRenderStreamOperation = defineOperation<z.infer<typeof jsonRenderStrea
309
309
  // node degrades to the bare { ok, id, nodeId } payload.
310
310
  let created: Record<string, unknown> = { ok: true, id, nodeId: id };
311
311
  try {
312
- const node = (await host.invoker().invoke('node.get', { id, includeBlobs: true })) as CanvasNodeState;
312
+ const node = (await host.invoker().invoke('node.get', {
313
+ id,
314
+ includeBlobs: true,
315
+ contextDelivery: false,
316
+ })) as CanvasNodeState;
313
317
  created = { ok: true, node: compactNodePayload(node), id, nodeId: id };
314
318
  } catch {
315
319
  // keep the bare payload (legacy c.getNode → undefined path)
@@ -391,8 +391,10 @@ export async function executeOperation(
391
391
  ...(typeof inputAgentId === 'string' && inputAgentId.trim() ? { agentId: inputAgentId.trim() } : {}),
392
392
  },
393
393
  async () => {
394
- const recordRead = CONTEXT_READ_OPS.has(name) && !meta.fromWorkbench && !meta.proxiedRead;
395
394
  const input = asRecord(rawInput);
395
+ const deliversContext =
396
+ name !== 'node.get' || (input.contextDelivery !== false && input.contextDelivery !== 'false');
397
+ const recordRead = CONTEXT_READ_OPS.has(name) && deliversContext && !meta.fromWorkbench && !meta.proxiedRead;
396
398
  const requestedBoard =
397
399
  recordRead && 'board' in getOperation(name).inputShape && isString(input.board) && input.board.trim()
398
400
  ? input.board.trim()