@ai-setting/roy-plugin-task-show 2.5.15 → 2.5.17

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.
@@ -1 +1 @@
1
- {"version":3,"file":"chat-markdown-renderer.d.ts","sourceRoot":"","sources":["../src/chat-markdown-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AA6BH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkE3D;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK5D"}
1
+ {"version":3,"file":"chat-markdown-renderer.d.ts","sourceRoot":"","sources":["../src/chat-markdown-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AA6BH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA4J3D;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK5D"}
@@ -77,11 +77,86 @@ marked.setOptions({
77
77
  export function normalizeAssistantText(text) {
78
78
  if (!text)
79
79
  return "";
80
+ let out = text;
81
+ // Step 0 — normalize fullwidth pipe to halfwidth pipe.
82
+ //
83
+ // Task #2982 (post-v2.5.15 followup): the previous implementation
84
+ // only handled ASCII `|` (U+007C) as a table separator. The
85
+ // Assistant output frequently uses the fullwidth `|` (U+FF5C) —
86
+ // visually identical in CJK locales, semantically a different
87
+ // character. `marked` only recognizes the ASCII pipe as a table
88
+ // boundary, so fullwidth-pipe tables collapsed into a single `<p>`
89
+ // blob even though `gfm: true` was set.
90
+ //
91
+ // We convert the fullwidth variant to ASCII BEFORE the table parser
92
+ // sees it. The conversion is idempotent (already-ASCII pipes are
93
+ // untouched).
94
+ out = out.replace(/|/g, "|");
95
+ // Step 0.5 — convert decorative `=== xxx ===` pseudo-headers to
96
+ // standard `## xxx` markdown headings.
97
+ //
98
+ // Task #2983 (post-v2.5.16 followup): the user reported that even
99
+ // after the Task #2982 fullwidth-pipe fix, Assistant replies still
100
+ // render as one continuous blob. Inspecting the actual Assistant
101
+ // output shows it uses a MIXED decorative format:
102
+ //
103
+ // ## � roy-agent 全部 25 个根任务
104
+ // ## 🎯 活跃研发主线
105
+ // 【标题】|-------- =====
106
+ // 1 [Bug] task-show chat panel fullwidth 渲染
107
+ // === [2981] [Release] merge Task #2979 ===
108
+ //
109
+ // `=== xxx ===` is NOT standard markdown — it's a decorative
110
+ // pseudo-header that `marked` passes through as inline `<p>` text.
111
+ // The user clearly intends those lines as headings (they appear in
112
+ // the same position as `## xxx` headings), so we normalize them to
113
+ // real `## xxx` headings BEFORE marked sees them.
114
+ //
115
+ // We support both:
116
+ // - Full-line: === xxx === (entire line is the marker)
117
+ // - Inline: ... text === xxx === more text ...
118
+ //
119
+ // The inline form gets wrapped with newlines so marked treats it as
120
+ // a block-level element rather than inline text.
121
+ //
122
+ // Idempotent: a second pass sees `## xxx` and the `={3,}` regex no
123
+ // longer matches, so we don't accidentally double-wrap.
124
+ out = out.replace(/^={2,}\s*(.+?)\s*={2,}\s*$/gm, (_m, body) => `\n## ${String(body).trim()}\n`);
125
+ out = out.replace(/={3,}\s*(.+?)\s*={3,}/g, (_m, body) => `\n\n## ${String(body).trim()}\n\n`);
126
+ // Step 0.6 — clean up decorative table separators that don't conform
127
+ // to GitHub-flavored markdown. The Assistant frequently emits:
128
+ //
129
+ // 【标题】|-------- =====
130
+ // |--- =====|----|
131
+ // |========|========|
132
+ //
133
+ // These are NOT valid GFM table separators (GFM requires exactly
134
+ // `|---|---|` or `| --- | --- |`). The `【xxx】|-------- =====`
135
+ // form is especially tricky: the leading `【xxx】` is decorative
136
+ // metadata AND there's only a single pipe on the line.
137
+ //
138
+ // Strategy: detect lines that LOOK LIKE a decorative separator
139
+ // (a pipe followed by runs of dashes and/or equals signs, possibly
140
+ // with a `【...】` prefix). Replace them with a clean GFM separator
141
+ // `| --- | --- |` so marked's table parser accepts the rows above
142
+ // and below. If no rows above/below match a real table, the
143
+ // separator is just deleted (rendered as nothing — the surrounding
144
+ // paragraphs already convey the section structure).
145
+ //
146
+ // Idempotent: a second pass sees `| --- | --- |` and the regex
147
+ // doesn't re-match (the chars inside pipes are now spaces, not
148
+ // =-).
149
+ out = out.replace(/^[\s]*【[^】]*】\s*\|[\s=-]+[ \t]*[={ \t]*$/gm, () => "| --- | --- |");
150
+ out = out.replace(/^\s*\|[\s=-]+\|[ \t]*[={ \t]*$/gm, (line) => {
151
+ const cols = line.split("|").filter((s) => s.trim() !== "").length;
152
+ if (cols < 2)
153
+ return line;
154
+ return `| ${Array(cols).fill("---").join(" | ")} |`;
155
+ });
80
156
  // Step 1 — convert standalone dash-rule lines to an HR placeholder.
81
157
  // We replace the literal text BEFORE handing off to marked so the
82
158
  // user sees a real <hr> instead of four cosmetic dashes inside a
83
159
  // <p>.
84
- let out = text;
85
160
  // (a) 4+ horizontal-dash / ASCII-dash on its own line → HR
86
161
  out = out.replace(/(^|\n)[ \t]*[─-]{4,}[ \t]*\n?/g, (_m, lead) => `${lead}\n<hr class="chat-md-hr"/>\n`);
87
162
  // (b) `• ---` (bullet + 3+ dashes) on its own line → HR
@@ -1 +1 @@
1
- {"version":3,"file":"chat-markdown-renderer.js","sourceRoot":"","sources":["../src/chat-markdown-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,gBAAgB,MAAM,WAAW,CAAC;AAEzC,mEAAmE;AACnE,qEAAqE;AACrE,2DAA2D;AAC3D,EAAE;AACF,oE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AG,GAAG,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAErC,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAY;IAClD,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,EAAE;QAAE,OAAO,EAAE,CAAC;IAC3C,MAAM,UAAU,GAAG,sBAAsB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,CAAW,CAAC;IAC/C,OAAO,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;AAClD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-setting/roy-plugin-task-show",
3
- "version": "2.5.15",
3
+ "version": "2.5.17",
4
4
  "description": "roy-agent plugin: visualize task solving process via tool call flow on a local web service",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/plugin.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-setting/roy-plugin-task-show",
3
- "version": "2.5.15",
3
+ "version": "2.5.17",
4
4
  "type": "tool-plugin",
5
5
  "description": "v2.4.1: Mermaid zoom now supports click-and-drag pan (Task #2785). After zooming in, users can drag the diagram to view the surrounding canvas area. Implementation: per-container panState/dragState WeakMap (no global state leak); applyTransform(translate+scale) single-source-of-truth for the CSS transform; attachPanHandlers on pointerdown/move/up/cancel with setPointerCapture for off-element drags; pointer cursor switches to grab/grabbing with touch-action: none to prevent native scrolling; reset/zoomReset now also resets pan to (0,0). 14/14 new mermaid-pan tests pass, full suite 558/564 with 6 pre-existing failures unrelated to this commit. v2.4.0: Combines v2.3.0 Combines v2.3.0 (worktree-aware file-tree + unbounded Mermaid zoom, Task #2773) with the v2.3.0 mermaid placeholder expansion (Task #2771). Sidebar + endpoint scope git ls-files to session.context.worktree (fallback process.cwd()); Mermaid zoom-in is no longer capped at 3.0\u00d7; .mermaid placeholder is now min-height: 2400px and .mermaid-zoom-stage is min-width: 6400px / min-height: 2400px (5\u00d7 base, via --mermaid-placeholder-multiplier CSS custom property) so dense diagrams get enough canvas to pan/zoom comfortably. v2.3.0: Worktree-aware file tree sidebar + unbounded Mermaid zoom-in. The file-tree sidebar (and /api/task/:id/file-tree endpoint) now scope git ls-files to session.context.worktree when the host (task:before.create / task:after.create payload) supplies a worktree path, so the sidebar shows the files the agent is actually editing instead of the plugin process cwd. New resolveWorktreePath helper in src/file-tree.ts returns session.context.worktree (trimmed, with empty/non-string guard) or falls back to process.cwd() for backward compatibility with pre-v2.3.0 hosts. TypeScript: TaskSession gains an optional context?: { worktree?: string } field. TaskShowServer exposes getCollector() so tests can seed sessions with context.worktree set. The Mermaid zoom toolbar (introduced in v2.0.8) no longer caps zoom-in at 3.0\u00d7 \u2014 the ZOOM_MAX constant is REMOVED and clampZoom only enforces ZOOM_MIN=0.25, so dense diagrams remain readable on high-DPI monitors when the user wants to zoom way in. ZOOM_MIN stays in place so zoom-out still bottoms out before rendering a black screen. New tests: test/file-tree-worktree.test.ts (10 cases \u2014 resolveWorktreePath edges, SSR scope, endpoint scope, fallback), test/mermaid-zoom-unlimited.test.ts (8 cases \u2014 source guard, behaviour at 6\u00d7/10\u00d7/50\u00d7, lower-bound preserved), test/mermaid-placeholder-size.test.ts (7 cases \u2014 min-height/min-width 5\u00d7 checks, transform-origin preserved, --mermaid-placeholder-multiplier hint). v2.3.0: Major visual overhaul of the per-task detail page \u2014 VS Code-style tool-call browser powered by Monaco Editor + LCS-based diff + project file tree with mermaid-driven navigation. The detail page now renders a 2-column layout: a sticky left sidebar with the project's git-tracked file tree (chevron-toggle directories, `is-affected` highlight for files touched by the current task), and a main column with the existing Mermaid + stats + toolcalls table + a new dedicated `<section id=\"tool-call-detail-panel\">` that hosts the LCS diff body + Monaco container for the currently-selected tool call. The legacy inline `<details class=\"diff-panel\">` (naive split-and-filter, prone to mis-tagging context lines) is replaced by `<ol class=\"diff-body\">` with proper added/removed/context markers driven by a real LCS dynamic-programming table (`computeDiff()` in `src/tool-call-detail.ts`). Tool calls with a file path get a Monaco Editor placeholder (`<div class=\"monaco-editor\" data-file-path=\"...\" data-language=\"...\">`) which the client-side `public/tool-call-detail.js` lazy-loads from `cdn.jsdelivr.net/npm/monaco-editor@0.45.0` the first time the user clicks a tool row. The Mermaid `__toolClick(toolId)` callback now drives THREE things: (a) the existing row scroll + highlight (preserved from v1.x), (b) the dedicated detail panel re-renders with the matching call, (c) the file-tree sidebar highlights the corresponding file (when `data-file-path` is present). New `GET /api/task/:id/file-tree` endpoint serves the git-tracked file list (`{ files: string[] }`) with a 30-second in-memory TTL + 8-entry FIFO bound. New modules: `src/file-tree.ts` (pure data layer: `buildFileTree / extractAffectedPaths / findNodeByPath / collectAllPaths / gitLsFiles / parseLsFiles`), `src/tool-call-detail.ts` (SSR + LCS diff + HTML escaping), `public/file-tree.js` (vanilla JS hydrator with chevron toggle + keyboard navigation + scrollIntoView), `public/tool-call-detail.js` (Monaco AMD loader + `__toolClick` wrapper + file-content fetch). New tests: `test/file-tree.test.ts` (21 cases \u2014 empty/single/nested/dedup/sort/depth/parseLsFiles/gitLsFiles), `test/tool-call-detail.test.ts` (22 cases \u2014 LCS diff edges, HTML escape, path aliases, summary stats), `test/tool-call-detail-server-integration.test.ts` (7 cases \u2014 SSR HTML contracts + endpoint), `test/tool-call-detail-jsdom.test.ts` (7 cases \u2014 client-side hydrators). v1.2.0: CSS context & packaged release hotfix. The plugin's public assets (notably `public/style.css`) and runtime adapters now correctly resolve relative to the installed package directory even when consumed via the published npm tarball. The session-scoped `TaskSessionStore` now preserves the full host session context (parent-child task links, plugin-handle id, env scope) across render cycles \u2014 previously the session was collapsed to its `sessionId` on first load and never refreshed, so the home page lost the \u300csession ancestors\u300d chain and external tasks from outside the current session silently disappeared from the tree. Adds `src/task-metadata.ts` as the single source of truth for the public `Task` shape exposed by `/api/tasks` + `/api/tasks/:id`, including the v1.0.0+ `processDescription` field, and re-exports it through the CLI adapters (`cli-tasks-adapter.ts` + `cli-tasks-tree-adapter.ts`) so the home page tree + the per-task page render against the same metadata contract. Bundles 244-line regression test (`test/context-and-packed-release.test.ts`) that boots the plugin from the **npm-pack** directory (not the repo working tree), spawns `roy-agent tasks get <id> --json`, and asserts (a) `public/style.css` is present and \u2265 64 lines, (b) the `/api/events` SSE endpoint survives a reload, and (c) `task.session` survives a render cycle. v1.1.0: Full Server-Sent Events realtime subscription across 3 event classes (task.created / operation.updated / tool.called) on both the home page and the per-task /task/<id> page. The per-task pipeline now subscribes to /api/events and patches the DOM in place on operation.updated \u2014 no more 5s-poll delay before the user sees a new milestone. The 'Task lifecycle pipeline' header badge is replaced by a 5-state SSE-aware badge (stale / connecting / live / reconnecting / error) so the user can tell at a glance whether real-time updates are flowing, the connection dropped, or 3+ consecutive errors triggered the polling fallback. Legacy boolean `stale` cache-TTL pill and `tool.recorded` event name are preserved for back-compat with v0.9.x / v1.0.0 clients. v1.0.0: First stable release. Replaces the v0.9.x fixture-based verify scripts (which built fake TaskOperationsEnvelope and never invoked the real `roy-agent` CLI, masking regressions in the public-schema `processDescription` field) with a real-CLI scenario test + verify (`test/process-description-real-scenario.test.ts` + `scripts/verify-v100-real-scenario.ts`) that spawns `roy-agent tasks get <id> --operations --json` via `defaultRunner` and asserts the API response carries `processDescription` end-to-end. The 0.9.9 processDescription fix is preserved verbatim \u2014 this release only swaps the verify surface. Visualize the tool call chain of a task on a local web service with real-time SSE updates. v0.9.9: Task lifecycle pipeline on /task/<id> now exposes BOTH the milestone badge AND the \u300c\u8fc7\u7a0b\u63cf\u8ff0\u300d column at a glance \u2014 the server-side `/api/tasks/:id/operations` endpoint exposes `processDescription` on every operation (no longer stripped from the public schema), the client-side `renderPipelineHtml` mirrors the server's `.op-desc-block` + `.op-proc-block` block layout so SSR \u2194 CSR stay in sync, and a long-standing CSS right-side text-truncation bug in the pipeline timeline (long CJK titles overflowing the panel edge) is fixed via `min-width: 0` on `.op-row1` + `overflow-wrap: anywhere` on `.op-title`. v0.9.0: Session-scoped home page (only show tasks created after plugin load + their external ancestors), with per-row \u300c\u663e\u793a\u5168\u90e8\u680f\u4f4d\u300d toggle and lazy-loaded operations timeline; per-task Mermaid labels now correctly render CJK / mixed-Latin / emoji text (encoded as \\uXXXX before emission, decoded by the browser); detail page layout reordered to lifecycle \u2192 pipeline \u2192 stats \u2192 toolcalls \u2192 rawjson. v0.5.0+: page refreshes stream over GET /api/events (Server-Sent Events). Subscribes to tool:before.execute, tool:after.execute, task:before.create, task:after.create, task:after.complete (preferred, 2026-07-10+), and task:after.update (legacy fallback). v0.6.11: Mermaid re-rendering is delegated to a self-contained controller (public/mermaid-renderer.js) that prevents the SVG\u2192raw-source regression on async updates and surfaces recoverable .mermaid-error states. v0.6.12: Task lifecycle pipeline (operations timeline) server now emits data-task-id on the pipeline section; client preserves it on swap, so the page actually fetches /api/tasks/<id>/operations and renders the 7-op timeline (previously silently bailed). v0.7.0: Home page redesigned as a hierarchical task tree (driven by `roy-agent tasks tree --json`); new /api/tasks/tree endpoint with status / priority / type / root-id filters, expand/collapse UI, search, and live 30s polling. v0.8.0: per-task page Mermaid area now renders the hierarchical 'Task lifecycle + tools' view \u2014 each operation record owns a subgraph that nests its tool calls, with click callbacks (`window.__toolClick`) that scroll-into-view + highlight + auto-expand the matching row in the tool-call table below. Operation record descriptions (`description` + `processDescription`) are now always rendered inline (no `<details>` collapse) so the user sees the lifecycle state at a glance; a fallback `<details>` kicks in only for descriptions longer than 600 chars. v0.8.1: hotfix for two pre-existing bugs in v0.8.0 (browser smoke test surfaced after merge). (a) Mermaid click directives were emitted as `click t1 __toolClick(1)` (missing `call` keyword) \u2014 Mermaid 10's parser rejects this with `got 'PS'`. Fixed to `click t1 call __toolClick(1)` (the v10 grammar requires `call` to invoke a callback with arguments). (b) `buildMermaidSource` lived inside the `attachTaskPageTimeline` IIFE but was also called from a listener in the `attachToolClickBridge` IIFE \u2014 sibling IIFEs cannot see each other's locals, so the listener threw `ReferenceError: buildMermaidSource is not defined` and the Mermaid diagram silently failed to re-render after `task-show:lifecycle-ops-loaded`. Fixed by hoisting the function (and its three helpers) to script top-level so both IIFEs can see it via the script-wide closure; the function is also exposed on `window.buildMermaidSource` for tests + tooling. v0.8.3: tree-display fix (Task #2426). The home page used to look like a flat list of root tasks because `autoExpandFirstLevels(..., 2)` only opened the first 2 levels \u2014 30/47 roots were leaf nodes and the remaining 17 collapsed to one level so grandchildren were never visible. Default expand depth is now 3 (root + child + grandchild + great-grandchild are visible on first paint), the summary line now shows per-depth count pills (root / child / grandchild / great-grandchild / level-N), each `tree-row` carries a `data-depth` attribute so CSS can paint coloured left rails per level, and the duplicated 'Live tool-call sessions (legacy view)' panel that made the page look like both a flat table AND a tree is now hidden behind `#legacy-sessions[hidden]` (kept for future debug-toggle restoration). v0.8.10: bug-fix release (Task #2537 + Task #2534). (a) Heap-bounded plugin caches: OperationsCache and TasksTreeCache now enforce a hard maxEntries cap (default 256 / 64). Oldest stale entries are evicted before inserting a new one, so long-lived roy-agent sessions (BackgroundTaskManager + MemorySessionStore) no longer leak Map entries through the plugin's per-task caches \u2014 see Task #2537 for the heap-unbounded-state RED\u2192GREEN repro. (b) Mermaid CJK font-family: server.ts renderTaskPage now configures mermaid.initialize({ themeVariables: { fontFamily: '\"PingFang SC\", \"Microsoft YaHei\", \"Noto Sans CJK SC\", \"Source Han Sans CN\", \"WenQuanYi Micro Hei\", sans-serif' } }) so Chinese node labels render correctly in browsers that have at least one of those fonts installed (see Task #2534).",
6
6
  "main": "dist/index.js",
@@ -30,6 +30,94 @@
30
30
  if (!text) return '';
31
31
  var out = String(text);
32
32
 
33
+ // (0) Task #2982: convert fullwidth pipe (| U+FF5C) to ASCII pipe.
34
+ //
35
+ // The Assistant frequently outputs tables using fullwidth | because
36
+ // CJK input methods default to it. `marked` only recognizes the ASCII
37
+ // | (U+007C) as a table boundary, so fullwidth-pipe tables collapsed
38
+ // into a single inline <p> blob — even though gfm:true was set.
39
+ //
40
+ // We normalize to ASCII BEFORE marked sees it. The conversion is
41
+ // idempotent: existing ASCII pipes are not touched, prose | stays
42
+ // as-is. This mirrors the node twin in src/chat-markdown-renderer.ts.
43
+ out = out.replace(/|/g, '|');
44
+
45
+ // (0.5) Task #2983: convert decorative `=== xxx ===` pseudo-headers
46
+ // to standard `## xxx` markdown headings.
47
+ //
48
+ // The user's v2.5.16 screenshot showed Assistant output still as one
49
+ // continuous blob even after the fullwidth-pipe fix. Inspecting the
50
+ // actual output shows it uses MIXED decorative format:
51
+ //
52
+ // ## 🎯 roy-agent 全部 25 个根任务
53
+ // === 🎯 活跃研发主线 ===
54
+ // 【标题】|-------- =====
55
+ //
56
+ // `=== xxx ===` is NOT standard markdown — it's a decorative
57
+ // pseudo-header that `marked` passes through as inline `<p>` text.
58
+ // The user clearly intends those lines as headings (they appear in
59
+ // the same position as `## xxx` headings), so we normalize them to
60
+ // real `## xxx` headings BEFORE marked sees them.
61
+ //
62
+ // We support both:
63
+ // - Full-line: === xxx === (entire line is the marker)
64
+ // - Inline: ... text === xxx === more text ...
65
+ //
66
+ // The inline form gets wrapped with newlines so marked treats it as
67
+ // a block-level element rather than inline text.
68
+ //
69
+ // Idempotent: a second pass sees `## xxx` and the `={3,}` regex no
70
+ // longer matches, so we don't accidentally double-wrap.
71
+ //
72
+ // MUST stay byte-for-byte equivalent with
73
+ // src/chat-markdown-renderer.ts#normalizeAssistantText.
74
+ out = out.replace(
75
+ /^={2,}\s*(.+?)\s*={2,}\s*$/gm,
76
+ function (_m, body) { return '\n## ' + String(body).trim() + '\n'; }
77
+ );
78
+ out = out.replace(
79
+ /={3,}\s*(.+?)\s*={3,}/g,
80
+ function (_m, body) { return '\n\n## ' + String(body).trim() + '\n\n'; }
81
+ );
82
+
83
+ // (0.6) Task #2983: clean up decorative table separators.
84
+ //
85
+ // The Assistant frequently emits non-GFM table separators like:
86
+ //
87
+ // 【标题】|-------- =====
88
+ // |--- =====|----|
89
+ // |========|========|
90
+ //
91
+ // GFM requires exactly `|---|---|` or `| --- | --- |`. The
92
+ // `【xxx】|-------- =====` form is especially tricky: the leading
93
+ // `【xxx】` is decorative metadata AND there's only a single pipe.
94
+ //
95
+ // We rewrite the `【xxx】|` form to a clean `| --- | --- |`
96
+ // (marked's table parser then treats the surrounding rows as a
97
+ // 2-column table — visually they were meant as a header anyway).
98
+ // For lines with both leading and trailing pipes, we preserve the
99
+ // column count.
100
+ //
101
+ // Idempotent: a second pass sees `| --- | --- |` and the regex no
102
+ // longer matches (the chars inside pipes are now spaces, not =-).
103
+ //
104
+ // MUST stay byte-for-byte equivalent with
105
+ // src/chat-markdown-renderer.ts#normalizeAssistantText.
106
+ out = out.replace(
107
+ /^[\s]*【[^】]*】\s*\|[\s=-]+[ \t]*[={ \t]*$/gm,
108
+ function () { return '| --- | --- |'; }
109
+ );
110
+ out = out.replace(
111
+ /^\s*\|[\s=-]+\|[ \t]*[={ \t]*$/gm,
112
+ function (line) {
113
+ var cols = line.split('|').filter(function (s) { return s.trim() !== ''; }).length;
114
+ if (cols < 2) return line;
115
+ var cells = [];
116
+ for (var i = 0; i < cols; i++) cells.push('---');
117
+ return '| ' + cells.join(' | ') + ' |';
118
+ }
119
+ );
120
+
33
121
  // (a) Standalone 4+ dash line (──── or ----) → HR placeholder
34
122
  out = out.replace(/(^|\n)[ \t]*[─-]{4,}[ \t]*\n?/g,
35
123
  function (_m, lead) { return lead + '\n<hr class="chat-md-hr"/>\n'; });