From 3cdcfdd8be123154e9c37fd74a5a17f7f733a744 Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Sun, 18 Oct 2026 13:43:20 +0200 Subject: [PATCH] chore(story-mode): lint clean (control-character regexes, a case block) Two control-character regexes (the NUL span markers, terminal escape codes) get their eslint-disable directive on the line it covers, and the montage case gets its own block for its declaration. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/story-mode.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/story-mode.ts b/src/story-mode.ts index 72f18d84..499870d2 100644 --- a/src/story-mode.ts +++ b/src/story-mode.ts @@ -231,6 +231,8 @@ function plainMarkdown(text: string, spans: string[]): string { } const restoreSpans = (text: string, spans: string[]): string => + // NUL marks a kept span: no text Claude writes contains one. + // eslint-disable-next-line no-control-regex text.replace(/\u0000(\d+)\u0000/g, (_, n: string) => spans[Number(n)] ?? ''); /** @@ -1108,8 +1110,8 @@ export function createStoryReducer({ sidechain = false }: { sidechain?: boolean if ((entry.isMeta === true && !scheduled) || entry.turnCompanion === true) return out; const local = /^\s*([\s\S]*?)<\/local-command-\1>/.exec(blockText(content)); if (local) { - // eslint-disable-next-line no-control-regex const text = local[2] + // eslint-disable-next-line no-control-regex .replace(/\x1b\[[0-9;]*[A-Za-z]/g, '') .replace(/`([^`\n]+)`/g, '$1') .trim(); @@ -2296,11 +2298,12 @@ function decorate(draft: DraftPanel, events: StoryEvent[], turn: StoryTurn, inde : 'Claude packs up its notes to free memory.'; director = evs.map((e) => e.description).find(Boolean) ?? 'compact_boundary'; break; - case 'montage': + case 'montage': { panel.notes = notesOf(evs.filter((e) => e.tool === 'Bash')); const added = evs.filter((e) => e.intent === 'prompt').length; story = `Claude ${index <= 1 ? 'gets started' : 'keeps going'}${added ? ` (you add ${plural(added, 'thing')})` : ''}: ${montageSummary(evs)}.`; break; + } case 'complete': break; }