Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
feat(canvas-control): fan-in — context-link spawned nodes + a `link` verb
enesa4036f99d5d9
diff --git a/src/main/canvas-control-core.test.ts b/src/main/canvas-control-core.test.tsindex 742da23fa..b58188f97 100644--- a/src/main/canvas-control-core.test.ts+++ b/src/main/canvas-control-core.test.ts@@ -63,6 +63,21 @@ describe('parseControlRequest', () => {args: { nodes: 'a', edge: 'left' }})})+ it('link requires --to; --from is optional and it is not destructive', () => {+ expect(parseControlRequest('link', {})).toEqual({ error: 'link requires --to <id,id>' })+ expect(parseControlRequest('link', { to: 'n2,n3' })).toEqual({+ verb: 'link',+ args: { to: 'n2,n3' }+ })+ expect(parseControlRequest('link', { to: 'n2', from: 'n1' })).toEqual({+ verb: 'link',+ args: { to: 'n2', from: 'n1' }+ })+ // A context link is pull-only (nothing is pushed into the endpoints), so it never+ // goes through the confirm dialog.+ expect(isDestructiveVerb('link')).toBe(false)+ })+it('open-agent requires --agent, and is not destructive', () => {expect(parseControlRequest('open-agent', {})).toEqual({ error: 'open-agent requires --agent <id>' })expect(parseControlRequest('open-agent', { agent: 'codex' })).toEqual({diff --git a/src/main/canvas-control-core.ts b/src/main/canvas-control-core.tsindex 5f4eb0ddb..6732066b0 100644--- a/src/main/canvas-control-core.ts+++ b/src/main/canvas-control-core.ts@@ -14,6 +14,7 @@ export type ControlVerb =| 'group'| 'arrange'| 'align'+ | 'link'| 'spawn-team'| 'open-worktree'| 'close-worktree'@@ -39,6 +40,7 @@ const VERBS: ControlVerb[] = ['group','arrange','align',+ 'link','spawn-team','open-worktree','close-worktree',@@ -75,6 +77,7 @@ export function parseControlRequest(if ((v === 'group' || v === 'arrange') && !args.nodes) return { error: `${v} requires --nodes <id,id>` }if (v === 'align' && !args.nodes) return { error: 'align requires --nodes <id,id>' }if (v === 'align' && !args.edge) return { error: 'align requires --edge' }+ if (v === 'link' && !args.to) return { error: 'link requires --to <id,id>' }if (v === 'spawn-team' && !args.team) return { error: 'spawn-team requires --team <json>' }if (v === 'open-worktree' && !args.branch) return { error: 'open-worktree requires --branch <name>' }if (v === 'close-worktree' && !args.group) return { error: 'close-worktree requires --group <id>' }@@ -132,8 +135,12 @@ export function buildCanvasControlInstructions(shimPath: string): string {'- `open-browser --url U` — open a navigable browser node.','- `group --nodes <id,id> [--label L]` / `arrange --nodes <id,id> [--layout grid|row|column] [--cols N]` /',' `align --nodes <id,id> --edge left|right|top|bottom|hcenter|vcenter` — organize the canvas.',+ '- `link --to <id,id> [--from <id>]` — context-link nodes so each can READ the other\'s transcript',+ ' on demand (nodeterm linked-context CLI). `--from` defaults to you; nothing is pushed into the',+ ' linked sessions. Agent sessions you open are linked to you automatically — use `link` for nodes',+ ' you did not open, or to link two OTHER nodes together.','- `spawn-team --label L --team \'[{"title":"UI","prompt":"...","agent":"claude"}]\'` — one agent per',- ' role (max 8), arranged in a grid, wrapped in a labeled group, each connected to you.',+ ' role (max 8), arranged in a grid, wrapped in a labeled group, each connected + context-linked to you.','- `open-worktree --branch <name> [--base <ref>] [--path P] [--group <id>]` — create a git worktree',' wrapped in a bound group frame (terminals inside it run in the worktree). Local projects only.','- `close-worktree --group <id> [--mode unbind|remove]` — unbind keeps the directory; remove asks',@@ -143,12 +150,18 @@ export function buildCanvasControlInstructions(shimPath: string): string {'- `write --node <id> --text "..."` / `close --node <id>` — type into / close a node.',' Both ask the user to confirm a dialog and may be denied.','',- 'Orchestration ("Build with Nodeterm orchestration"): break the task into 2-5 independent',- 'workstreams; per stream `open-worktree --branch <slug>` then `open-agent --agent claude',- '--group <groupId> --prompt "<concrete task>"` (each stream on its own branch, no tree',- 'conflicts). Members land in grid slots inside the frame automatically; align the frames',- 'themselves with `arrange --nodes <groupId,…> --layout row` (pass GROUP ids — arrange/align',- 'are top-level only) and `rename` each by subject. The user merges when a stream is done;',+ 'Orchestration ("Build with Nodeterm orchestration"): first decide what is genuinely',+ 'independent — for every "and then", ask whether the next step READS the previous step\'s',+ 'output. If not, they are separate stations; if it does, sequence it yourself, because a',+ 'station cannot wait for another one. Then break the task into 2-5 independent workstreams;',+ 'per stream `open-worktree --branch <slug>` then `open-agent --agent claude --group <groupId>',+ '--prompt "<concrete task>"` (each stream on its own branch, no tree conflicts). Members land',+ 'in grid slots inside the frame automatically; align the frames themselves with',+ '`arrange --nodes <groupId,…> --layout row` (pass GROUP ids — arrange/align are top-level',+ 'only) and `rename` each by subject. When a station goes idle, READ what it did through the',+ 'context link (the linked-context CLI — see the get-linked-context section in your global',+ 'agent instructions) and reconcile the streams into ONE synthesis yourself; a station you',+ 'never read is one you cannot vouch for. The user merges when a stream is done;','`close-worktree --group <id>` releases a finished station.'].join('\n')}@@ -248,7 +261,7 @@ exit 1export function buildCanvasSkillBody(shimPath: string): string {return `---name: manage-nodeterm-canvas-description: Create, organize and control nodes on the nodeterm canvas — open Claude Code / Codex / Gemini / terminal nodes, spawn a team of agents that divide up a task, create git worktrees as bound groups, wrap nodes in labeled groups, arrange/align/rename them, show an image/video/web page, write to or close a terminal. Use whenever the user says "Build with Nodeterm orchestration", asks to create or open nodes/sessions/terminals, split or parallelize work across subagents/agents/sessions/worktrees, delegate parts of a task to other agents, work on several things at once, build something using multiple Claude (or other agent) sessions, organize the canvas into groups by topic, or visualize code/output you produced. Only works inside a nodeterm Claude session.+description: Create, organize and control nodes on the nodeterm canvas — open Claude Code / Codex / Gemini / terminal nodes, spawn a team of agents that divide up a task, create git worktrees as bound groups, wrap nodes in labeled groups, arrange/align/rename them, link nodes so you can read back what they produced, show an image/video/web page, write to or close a terminal. Use whenever the user says "Build with Nodeterm orchestration", asks to create or open nodes/sessions/terminals, split or parallelize work across subagents/agents/sessions/worktrees, delegate parts of a task to other agents, work on several things at once, build something using multiple Claude (or other agent) sessions, collect or synthesize the results of agents you opened, organize the canvas into groups by topic, or visualize code/output you produced. Only works inside a nodeterm Claude session.---# Manage the nodeterm canvas@@ -276,9 +289,14 @@ Verbs:- \`group --nodes <id,id> [--label "Frontend Team"]\` — wrap nodes in a labeled group frame.- \`arrange --nodes <id,id> [--layout grid|row|column] [--cols N]\` — tidy layout, no overlap.- \`align --nodes <id,id> --edge left|right|top|bottom|hcenter|vcenter\` — align edges/centers.+- \`link --to <id,id> [--from <id>]\` — context-link nodes, so each can READ the other's+ transcript on demand with the get-linked-context skill. \`--from\` defaults to you. Nothing is+ pushed into the linked sessions — reading is on demand, so linking never interrupts anyone.+ Agent sessions you open (\`open-claude\`/\`open-agent\`/\`spawn-team\`) are linked to you+ automatically; use \`link\` for nodes you did not open, or to link two OTHER nodes together.- \`spawn-team --label "Frontend Team" --team '[{"title":"UI","prompt":"...","agent":"claude"}]'\` —open one agent per role (each prompt starts that member working), arrange them in a grid,- wrap them in a labeled group, and connect each to you. Max 8 roles per call.+ wrap them in a labeled group, and connect + context-link each to you. Max 8 roles per call.- \`open-worktree --branch <name> [--base <ref>] [--path P] [--group <id>]\` — create a gitworktree (new branch off base, default: the repo's default branch) and wrap it in a boundgroup frame (or bind it to an existing empty group). Terminals created inside the group@@ -312,6 +330,12 @@ Typical requests this skill covers:When the user says "Build with Nodeterm orchestration" (or asks you to orchestrate a buildacross Nodeterm sessions), be the orchestration chef — plan the kitchen, then run it:+0. First decide what is actually independent. For every "and then" in your plan, ask: does+ the next step READ the previous step's output? If it does not, there is no dependency and+ the wait is wasted — those steps are separate stations. If it does, do NOT open them as+ parallel stations: a station cannot wait for another one. Either sequence them yourself+ (open the downstream station once the upstream is done and you have read its result), or+ keep the dependent part in your own session. Fan out breadth; keep chains to yourself.1. Break the task into 2–5 independent workstreams (by subsystem, not by file).2. Per workstream, give it its own branch + kitchen station:\`open-worktree --branch <slug>\` → note the returned \`groupId\`, then@@ -322,8 +346,15 @@ across Nodeterm sessions), be the orchestration chef — plan the kitchen, thenout side by side — after opening all stations, align the frames with\`arrange --nodes <groupId,groupId,…> --layout row\` (arrange/align work on top-levelnodes, so pass the GROUP ids, not the children). \`rename\` each group by subject.-4. Track progress (their status badges show working/waiting) and coordinate: when a stream- finishes, the user merges from the group's chip (never merge for them); release a finished+4. Track progress (their status badges show working/waiting) and coordinate.+5. Collect the results yourself — this is the half most orchestrators skip. Every station you+ opened is context-linked to you, so when one goes idle, read what it actually did with the+ **get-linked-context** skill (summary or transcript for that node id) instead of asking the+ user to relay it. Then do the work only you can do: reconcile the streams against each+ other, name the conflicts and the leftovers, and report ONE synthesis. A station you never+ read is a station whose work you cannot vouch for — say so rather than assuming it went+ fine. Stations you did not open are not linked; \`link --to <id>\` them first.+6. Hand back: the user merges from the group's chip (never merge for them); release a finishedstation with \`close-worktree --group <id>\` (unbind keeps the directory).`}diff --git a/src/main/canvas-control-shim.test.ts b/src/main/canvas-control-shim.test.tsindex 7aaca8c3d..065b5f07b 100644--- a/src/main/canvas-control-shim.test.ts+++ b/src/main/canvas-control-shim.test.ts@@ -198,6 +198,20 @@ describe('canvas-control shim over a unix socket', () => {})})+ it('carries a comma-joined --to list through unmangled (link)', async () => {+ state.seen = null+ await callShim(['link', '--to', 'n2,n3', '--from', 'n1'], {+ NODETERM_HOOK_PORT: '',+ NODETERM_HOOK_SOCK: sock,+ NODETERM_HOOK_TOKEN: 'tok-remote'+ })+ expect(lastSeen()?.path).toBe('/control/link')+ expect(parseControlBody(lastSeen()?.body ?? '', 'application/x-www-form-urlencoded')).toEqual({+ nodeId: 'node-1',+ args: { to: 'n2,n3', from: 'n1' }+ })+ })+it('prefers the socket over a port when both are advertised', async () => {state.seen = nullawait callShim(['list'], { NODETERM_HOOK_SOCK: sock })diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsxindex c54231e5a..2aaee5af0 100644--- a/src/renderer/canvas/Canvas.tsx+++ b/src/renderer/canvas/Canvas.tsx@@ -177,7 +177,7 @@ import {reconnectRelayTab,type RelayTab,} from '../session/relay-tab'-import { buildBackgroundLinkMaps, buildContextLinkNote, buildLinkMap, buildNotePushMessage, classifyLink, type LinkEndpoint } from '../lib/noteLink'+import { buildBackgroundLinkMaps, buildContextLinkNote, buildLinkMap, buildNotePushMessage, classifyLink, planBridges, type LinkEndpoint } from '../lib/noteLink'import { useSettings } from '../state/settings'import { activePermissionMode } from '../state/permissionMode'import { useContextWindow } from '../state/contextWindow'@@ -4609,6 +4609,28 @@ export function Canvas() {const placeBelow = (i = 0) => ({ x: srcAbs.x + srcW / 2 + i * 460, y: belowY + 210 })const connect = (newId: string) =>setControlEdges((es) => [...es, ropeEdge(`ctrl-${sourceNodeId}-${newId}`, sourceNodeId, newId, edgeColor)])+ // Draw real CONTEXT links (persisted `bridges`), not the display-only ropes `connect`+ // draws — a rope is lineage decoration, a bridge is what get-linked-context reads. This+ // is what lets an orchestrator fan IN: read back what the nodes it opened produced.+ // Deliberately SILENT: the manual onConnect path pushes a one-shot discovery note into+ // each endpoint, but doing that here would inject a prompt into every member of a team+ // the agent just spawned — the exact intrusion that push was reverted for. The link+ // still works: it is pull-based, and the CLI/skill is already installed in the session.+ // `lookup` defaults to the live canvas, but the open/spawn verbs pass their own: they+ // create and bridge nodes in the SAME tick, and setNodes is async — nodesRef has not+ // seen them yet, so resolving them off the canvas would skip every one as "no such node".+ const bridgeTo = (+ fromId: string,+ targetIds: string[],+ lookup: (id: string) => LinkEndpoint | null = linkEndpointOf+ ) => {+ const plan = planBridges(fromId, targetIds, lookup, linkEdgesRef.current)+ if (plan.edges.length) {+ setLinkEdges((es) => [...es, ...plan.edges.map((e) => ({ ...e, type: 'default' }))])+ markDirty()+ }+ return plan+ }// Append a freshly-created node, draw its connecting edge, and mark the canvas dirty so it// persists. Returns the new node id. A node opened by a grouped agent joins that group// (parentInto converts back to group-relative coords), so the control fan-out stays inside@@ -4763,10 +4785,22 @@ export function Canvas() {const ids = intoGroupId? addGrouped(intoGroupId, count, make): Array.from({ length: count }, (_, i) => addAndConnect(make(i)))+ // Context-link the new session(s) back to the opener (same rationale as spawn-team:+ // the fan-out needs a fan-in). The nodes were added via setNodes in this tick, so+ // resolve their endpoints from `agentId` rather than the not-yet-updated canvas.+ const openedEndpoint = (id: string): LinkEndpoint | null =>+ id === sourceNodeId+ ? linkEndpointOf(id)+ : ids.includes(id)+ ? { kind: 'terminal', contextCapable: canContextLink(agentId) }+ : null+ const bridged = bridgeTo(sourceNodeId, ids, openedEndpoint).linkedreply({ok: true,- message: `opened ${count} ${agentId} session(s): ${ids.join(', ')}`,- result: { ids }+ message:+ `opened ${count} ${agentId} session(s): ${ids.join(', ')}` ++ (bridged.length ? `\ncontext-linked to you: ${bridged.join(', ')}` : ''),+ result: { ids, linked: bridged }})return}@@ -4877,6 +4911,37 @@ export function Canvas() {reply({ ok: true, message: `aligned ${ids.length} node(s) to ${edge}`, result: { count: ids.length } })return}+ case 'link': {+ // Fan-in edge: link the caller (or --from) to nodes so each can READ the other's+ // transcript on demand. Pull-based and non-destructive — nothing is injected.+ const from = (args.from ?? sourceNodeId).trim()+ const targets = (args.to ?? '').split(',').map((s) => s.trim()).filter(Boolean)+ if (targets.length === 0) {+ reply({ ok: false, error: 'link requires --to <id,id>' })+ return+ }+ if (!linkEndpointOf(from)) {+ reply({ ok: false, error: `link: --from names no existing node (${from})` })+ return+ }+ const { linked, skipped } = bridgeTo(from, targets)+ if (linked.length === 0) {+ reply({+ ok: false,+ error: `link: nothing linked — ${skipped.map((s) => `${s.id}: ${s.why}`).join('; ')}`+ })+ return+ }+ const note = skipped.length+ ? ` (skipped ${skipped.map((s) => `${s.id}: ${s.why}`).join('; ')})`+ : ''+ reply({+ ok: true,+ message: `linked ${from} ↔ ${linked.join(', ')}${note}`,+ result: { from, linked, skipped }+ })+ return+ }case 'spawn-team': {let roles: { title?: string; prompt?: string; agent?: string }[]try {@@ -4926,11 +4991,25 @@ export function Canvas() {)setNodes(next)memberIds.forEach((mid) => connect(mid))+ // …and CONTEXT-link each member back to the conductor, so the fan-out has a fan-in:+ // once a member is done, the conductor reads what it produced via get-linked-context+ // instead of asking the user to relay it. Members whose agent isn't context-capable+ // (a custom agent) just keep the display rope.+ const memberEndpoint = (id: string): LinkEndpoint | null => {+ if (id === sourceNodeId) return linkEndpointOf(id)+ const m = members.find((x) => x.id === id)+ if (!m) return null+ const a = m.data.agentId as AgentId | undefined+ return { kind: m.type ?? 'terminal', contextCapable: !!a && canContextLink(a) }+ }+ const bridged = bridgeTo(sourceNodeId, memberIds, memberEndpoint).linkedmarkDirty()reply({ok: true,- message: `spawned ${memberIds.length} member(s) in group ${teamGroup.id}: ${memberIds.join(', ')}`,- result: { groupId: teamGroup.id, memberIds }+ message:+ `spawned ${memberIds.length} member(s) in group ${teamGroup.id}: ${memberIds.join(', ')}` ++ (bridged.length ? `\ncontext-linked to you: ${bridged.join(', ')}` : ''),+ result: { groupId: teamGroup.id, memberIds, linked: bridged }})return}diff --git a/src/renderer/lib/noteLink.test.ts b/src/renderer/lib/noteLink.test.tsindex 3eda7a776..8e6e033cc 100644--- a/src/renderer/lib/noteLink.test.ts+++ b/src/renderer/lib/noteLink.test.ts@@ -4,7 +4,8 @@ import {buildContextLinkNote,buildLinkMap,buildNotePushMessage,- classifyLink+ classifyLink,+ planBridges} from './noteLink'import type { CanvasNodeState } from '@shared/types'@@ -29,6 +30,70 @@ describe('classifyLink', () => {})})+describe('planBridges', () => {+ // Canvas: n1 (conductor) + n2/n3 context-capable agents, p1 a plain terminal, s1 a sticky.+ const canvas: Record<string, { kind: string; contextCapable: boolean }> = {+ n1: term(true),+ n2: term(true),+ n3: term(true),+ p1: term(false),+ s1: sticky()+ }+ const lookup = (id: string) => canvas[id] ?? null++ it('links every context-capable target and reports the edges', () => {+ const plan = planBridges('n1', ['n2', 'n3'], lookup, [])+ expect(plan.linked).toEqual(['n2', 'n3'])+ expect(plan.skipped).toEqual([])+ expect(plan.edges).toEqual([+ { id: 'bridge-n1-n2', source: 'n1', target: 'n2' },+ { id: 'bridge-n1-n3', source: 'n1', target: 'n3' }+ ])+ })++ it('skips a target that is not linkable, without losing the ones that are', () => {+ const plan = planBridges('n1', ['p1', 'n2'], lookup, [])+ expect(plan.linked).toEqual(['n2'])+ expect(plan.skipped).toEqual([+ { id: 'p1', why: 'not linkable (needs two context-capable agents, or a sticky + terminal)' }+ ])+ })++ it('skips self-links and unknown nodes', () => {+ const plan = planBridges('n1', ['n1', 'ghost'], lookup, [])+ expect(plan.edges).toEqual([])+ expect(plan.skipped).toEqual([+ { id: 'n1', why: 'same node' },+ { id: 'ghost', why: 'no such node' }+ ])+ })++ it('dedupes against an existing edge in EITHER direction', () => {+ const plan = planBridges('n1', ['n2'], lookup, [{ source: 'n2', target: 'n1' }])+ expect(plan.edges).toEqual([])+ expect(plan.skipped).toEqual([{ id: 'n2', why: 'already linked' }])+ })++ it('dedupes within the batch itself, not just against the canvas', () => {+ const plan = planBridges('n1', ['n2', 'n2'], lookup, [])+ expect(plan.linked).toEqual(['n2'])+ expect(plan.edges).toHaveLength(1)+ expect(plan.skipped).toEqual([{ id: 'n2', why: 'already linked' }])+ })++ it('stores a note link sticky→terminal even when asked terminal→sticky', () => {+ const plan = planBridges('n1', ['s1'], lookup, [])+ expect(plan.edges).toEqual([{ id: 'bridge-s1-n1', source: 's1', target: 'n1' }])+ expect(plan.linked).toEqual(['s1'])+ })++ it('refuses everything when the source node does not exist', () => {+ const plan = planBridges('ghost', ['n2'], lookup, [])+ expect(plan.edges).toEqual([])+ expect(plan.skipped).toEqual([{ id: 'n2', why: 'no such node' }])+ })+})+describe('buildNotePushMessage', () => {it('wraps the note text with the nodeterm prefix and title', () => {expect(buildNotePushMessage('Deploy notes', 'use the staging key')).toBe(diff --git a/src/renderer/lib/noteLink.ts b/src/renderer/lib/noteLink.tsindex 1638af92c..98e6170e6 100644--- a/src/renderer/lib/noteLink.ts+++ b/src/renderer/lib/noteLink.ts@@ -22,6 +22,76 @@ export function classifyLink(a: LinkEndpoint, b: LinkEndpoint): LinkKind | nullreturn other.kind === 'terminal' ? 'note' : null}+/** One node the plan refused to link, with the reason to report back to the caller. */+export interface SkippedBridge {+ id: string+ why: string+}++export interface BridgePlan {+ /** Edges to append (already deduped against `existing` AND within the batch). */+ edges: BridgeLink[]+ linked: string[]+ skipped: SkippedBridge[]+}++/**+ * Plan the link edges connecting `fromId` to each of `targetIds` — the batch form of what+ * onConnect does for one hand-drawn edge, used by the canvas-control `link` verb and by the+ * open-agent / spawn-team fan-out (which link every session they open back to the opener).+ *+ * Pure so the refusal matrix is testable: the callers live inside Canvas.tsx, where node+ * lookup is a ref read and the result is a setState. `lookup` is injected because a caller+ * that links nodes it created in the SAME tick cannot resolve them off the canvas yet+ * (setNodes is async), and `existing` is passed in rather than read, so a batch also dedupes+ * against itself and not just against what is already on screen.+ */+export function planBridges(+ fromId: string,+ targetIds: string[],+ lookup: (id: string) => LinkEndpoint | null,+ existing: readonly { source: string; target: string }[]+): BridgePlan {+ const edges: BridgeLink[] = []+ const linked: string[] = []+ const skipped: SkippedBridge[] = []+ const se = lookup(fromId)+ const linkedAlready = (a: string, b: string) =>+ [...existing, ...edges].some(+ (e) => (e.source === a && e.target === b) || (e.source === b && e.target === a)+ )+ for (const tid of targetIds) {+ if (tid === fromId) {+ skipped.push({ id: tid, why: 'same node' })+ continue+ }+ const te = lookup(tid)+ if (!se || !te) {+ skipped.push({ id: tid, why: 'no such node' })+ continue+ }+ const kind = classifyLink(se, te)+ if (!kind) {+ skipped.push({+ id: tid,+ why: 'not linkable (needs two context-capable agents, or a sticky + terminal)'+ })+ continue+ }+ // Note edges are stored sticky→terminal regardless of the direction they were requested+ // in, so styling and the link map can key off "source is sticky" (mirrors onConnect).+ const source = kind === 'note' && te.kind === 'sticky' ? tid : fromId+ const target = source === fromId ? tid : fromId+ if (linkedAlready(source, target)) {+ skipped.push({ id: tid, why: 'already linked' })+ continue+ }+ edges.push({ id: `bridge-${source}-${target}`, source, target })+ linked.push(tid)+ }+ return { edges, linked, skipped }+}+/** Longest note text pushed inline; longer notes are truncated with a pointer to the skill. */const NOTE_PUSH_MAX = 2000