Skip to content

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.

feat(context-link): sticky note entries in link files, CLI, and skill

enes98914daa0bf2
diff --git a/src/main/context-link-core.test.ts b/src/main/context-link-core.test.ts
index c023e62d9..3e7851fb1 100644
--- a/src/main/context-link-core.test.ts
+++ b/src/main/context-link-core.test.ts
@@ -24,6 +24,17 @@ describe('buildLinkDoc', () => {
])
})
+ it('carries a sticky note through with empty transcript/tmux', () => {
+ const doc = buildLinkDoc('node-A', [{ id: 'note-1', title: 'Deploy notes', note: 'use staging' }], {
+ transcriptOf: () => '/should/not/be/used.jsonl',
+ tmuxBin: '/usr/bin/tmux',
+ tmuxSocket: 'node-terminal'
+ })
+ expect(doc.links).toEqual([
+ { id: 'note-1', title: 'Deploy notes', cwd: '', transcriptPath: '', tmux: '', note: 'use staging' }
+ ])
+ })
+
it('sanitizes the tmux session name like the pty manager', () => {
const doc = buildLinkDoc('x', [{ id: 'a b/c.d', title: 'T' }], {
transcriptOf: () => '',
diff --git a/src/main/context-link-core.ts b/src/main/context-link-core.ts
index 74230d62f..88eccb7bf 100644
--- a/src/main/context-link-core.ts
+++ b/src/main/context-link-core.ts
@@ -19,6 +19,8 @@ export interface LinkDocEntry {
cwd: string
transcriptPath: string
tmux: string
+ /** Present when this entry is a sticky note: its text. Note entries have no transcript/terminal. */
+ note?: string
}
export interface LinkDoc {
self: { id: string }
@@ -35,13 +37,18 @@ export function buildLinkDoc(
): LinkDoc {
return {
self: { id: nodeId },
- links: links.map((n) => ({
- id: n.id,
- title: n.title,
- cwd: n.cwd ?? '',
- transcriptPath: ctx.transcriptOf(n.id),
- tmux: sessionName(n.id)
- })),
+ links: links.map((n) => {
+ const isNote = n.note != null
+ const entry: LinkDocEntry = {
+ id: n.id,
+ title: n.title,
+ cwd: n.cwd ?? '',
+ transcriptPath: isNote ? '' : ctx.transcriptOf(n.id),
+ tmux: isNote ? '' : sessionName(n.id)
+ }
+ if (isNote) entry.note = n.note
+ return entry
+ }),
tmuxBin: ctx.tmuxBin,
tmuxSocket: ctx.tmuxSocket
}
@@ -80,7 +87,7 @@ function pickNode(doc, want) {
}
if (links.length === 1) return links[0]
out('Several linked nodes — re-run with --node <id|title>:')
- links.forEach(function (n) { out('- ' + n.title + ' (id: ' + n.id + ')') })
+ links.forEach(function (n) { out('- ' + n.title + (n.note != null ? ' (note)' : '') + ' (id: ' + n.id + ')') })
process.exit(0)
}
@@ -161,10 +168,20 @@ var doc = loadLinks()
if (cmd === 'list') {
if (!doc.links.length) { out('No linked nodes.'); process.exit(0) }
out('Linked nodes:')
- doc.links.forEach(function (n) { out('- ' + n.title + ' (id: ' + n.id + ')') })
+ doc.links.forEach(function (n) { out('- ' + n.title + (n.note != null ? ' (note)' : '') + ' (id: ' + n.id + ')') })
process.exit(0)
}
var node = pickNode(doc, flag('--node'))
+// Sticky notes carry their text in the link file — every command just prints it.
+if (node.note != null) {
+ if (cmd === 'terminal') {
+ out('"' + node.title + '" is a sticky note — it has no terminal.')
+ } else {
+ out('=== ' + node.title + ' — note ===')
+ out(node.note || '(empty note)')
+ }
+ process.exit(0)
+}
if (cmd === 'summary') {
var n = parseInt(flag('-n') || '15', 10) || 15
var ls = readTranscript(node)
diff --git a/src/main/context-link.cli.test.ts b/src/main/context-link.cli.test.ts
index df40127cd..4a6ba5681 100644
--- a/src/main/context-link.cli.test.ts
+++ b/src/main/context-link.cli.test.ts
@@ -28,7 +28,8 @@ beforeAll(() => {
JSON.stringify({
self: { id: 'node-A' },
links: [
- { id: 'node-B', title: 'Builder', cwd: '', transcriptPath: join(dir, 'b.jsonl'), tmux: 'nt-node-B' }
+ { id: 'node-B', title: 'Builder', cwd: '', transcriptPath: join(dir, 'b.jsonl'), tmux: 'nt-node-B' },
+ { id: 'note-1', title: 'Deploy notes', cwd: '', transcriptPath: '', tmux: '', note: 'use the staging key' }
],
tmuxBin: null,
tmuxSocket: 'node-terminal'
@@ -52,22 +53,40 @@ describe('context-cli', () => {
expect(out).toContain('node-B')
})
it('summary prints recent conversation lines', () => {
- const out = run('node-A', ['summary', '-n', '10'])
+ const out = run('node-A', ['summary', '-n', '10', '--node', 'node-B'])
expect(out).toContain('deploy the app')
expect(out).toContain('On it.')
expect(out).toContain('npm run build')
})
it('transcript prints the full conversation', () => {
- const out = run('node-A', ['transcript'])
+ const out = run('node-A', ['transcript', '--node', 'node-B'])
expect(out).toContain('full transcript')
expect(out).toContain('deploy the app')
})
it('terminal mode reports when tmux is unavailable', () => {
- const out = run('node-A', ['terminal'])
+ const out = run('node-A', ['terminal', '--node', 'node-B'])
expect(out).toContain('Terminal capture unavailable')
})
it('is a no-op without NODETERM_NODE_ID', () => {
const out = run('', ['list'])
expect(out).toContain('Not a nodeterm session')
})
+ it('list marks sticky notes', () => {
+ const out = run('node-A', ['list'])
+ expect(out).toContain('Deploy notes (note)')
+ })
+ it('summary of a note prints its text', () => {
+ const out = run('node-A', ['summary', '--node', 'note-1'])
+ expect(out).toContain('Deploy notes — note')
+ expect(out).toContain('use the staging key')
+ })
+ it('transcript of a note prints its text too', () => {
+ const out = run('node-A', ['transcript', '--node', 'Deploy notes'])
+ expect(out).toContain('use the staging key')
+ })
+ it('terminal of a note explains there is no terminal', () => {
+ const out = run('node-A', ['terminal', '--node', 'note-1'])
+ expect(out).toContain('sticky note')
+ expect(out).toContain('no terminal')
+ })
})
diff --git a/src/main/context-link.ts b/src/main/context-link.ts
index 3fd56425a..69e34f2ab 100644
--- a/src/main/context-link.ts
+++ b/src/main/context-link.ts
@@ -53,7 +53,7 @@ ELECTRON_RUN_AS_NODE=1 exec "${process.execPath}" "${cliScriptPath()}" "$@"
function installSkill(): void {
const body = `---
name: get-linked-context
-description: Read the conversation/transcript, a recent summary, or the terminal output of another Claude node you are linked to on the nodeterm canvas. Use when you need to know what a connected node has been doing, hand off, or continue its work. Only meaningful inside a nodeterm session with a context-link edge.
+description: Read the conversation/transcript, a recent summary, or the terminal output of another Claude node you are linked to on the nodeterm canvas. Use when you need to know what a connected node has been doing, hand off, or continue its work. Only meaningful inside a nodeterm session with a context-link edge. Also reads sticky notes linked to this node as context.
---
# Get linked context
@@ -74,6 +74,10 @@ Commands:
- \`transcript [--node X]\` — the linked node's full conversation transcript.
- \`terminal [--node X]\` — the linked node's recent terminal output (visible buffer).
+Linked sticky notes appear in \`list\` marked \`(note)\`; \`summary\` or \`transcript\` on a note
+prints its **current** text (the note is read live from the canvas, so it may have changed
+since it was first linked).
+
\`--node\` is optional when you are linked to exactly one node; otherwise pass the id or title
from \`list\`. If the CLI says "Not a nodeterm session" or "No linked nodes", there is nothing
to read — do not retry.