(nodes: MutationNode[])
| 441 | // ── Mutation methods ───────────────────────────────────────────────────── |
| 442 | |
| 443 | function registerMutations(nodes: MutationNode[]) { |
| 444 | const activeIds = new Set(nodes.map((n) => n.statementId)); |
| 445 | |
| 446 | // Clean up removed mutations |
| 447 | for (const sid of mutations.keys()) { |
| 448 | if (!activeIds.has(sid)) mutations.delete(sid); |
| 449 | } |
| 450 | |
| 451 | // Register/update active mutations |
| 452 | for (const node of nodes) { |
| 453 | const existing = mutations.get(node.statementId); |
| 454 | if (existing) { |
| 455 | if (existing.toolName !== node.toolName) { |
| 456 | existing.toolName = node.toolName; |
| 457 | existing.result = { status: "idle", data: null, error: null }; |
| 458 | existing.error = undefined; |
| 459 | } |
| 460 | } else { |
| 461 | mutations.set(node.statementId, { |
| 462 | toolName: node.toolName, |
| 463 | result: { status: "idle" }, |
| 464 | }); |
| 465 | } |
| 466 | } |
| 467 | |
| 468 | if (rebuildSnapshot()) notify(); |
| 469 | } |
| 470 | |
| 471 | async function fireMutation( |
| 472 | statementId: string, |
nothing calls this directly
no test coverage detected