@linxiraos/pi-tui 1.1.26 → 1.2.0
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.
- package/CHANGELOG.md +51 -491
- package/README.md +13 -7
- package/dist/types/active-terminal.d.ts +30 -0
- package/dist/types/app-keybindings.d.ts +7 -2
- package/dist/types/apps/cleanse-board.d.ts +1 -1
- package/dist/types/apps/debug/log-viewer.d.ts +4 -0
- package/dist/types/apps/debug/raw-sse-buffer.d.ts +2 -0
- package/dist/types/apps/git/git-tui.d.ts +5 -4
- package/dist/types/apps/git/help.d.ts +3 -1
- package/dist/types/apps/if-bench-board.d.ts +2 -2
- package/dist/types/apps/setup-model-picker.d.ts +1 -1
- package/dist/types/autocomplete.d.ts +5 -2
- package/dist/types/charts/chart-plan.d.ts +674 -0
- package/dist/types/charts/chart-svg.d.ts +59 -0
- package/dist/types/charts/table-data.d.ts +175 -0
- package/dist/types/chat/assistant-message.d.ts +11 -1
- package/dist/types/chat/chat-transcript-builder.d.ts +3 -0
- package/dist/types/chat/compaction-summary-message.d.ts +1 -0
- package/dist/types/chat/execution-shared.d.ts +6 -5
- package/dist/types/chat/fence-figure.d.ts +42 -0
- package/dist/types/chat/figure-markdown.d.ts +42 -0
- package/dist/types/chat/messages.d.ts +1 -1
- package/dist/types/chat/svg-figure.d.ts +33 -0
- package/dist/types/chat/svg-source.d.ts +49 -0
- package/dist/types/chat/table-chart.d.ts +89 -0
- package/dist/types/chat/tool-execution.d.ts +2 -0
- package/dist/types/chat/user-message.d.ts +17 -4
- package/dist/types/chrome/shared.d.ts +9 -0
- package/dist/types/chrome/status-notice.d.ts +15 -3
- package/dist/types/chrome/transcript-container.d.ts +6 -0
- package/dist/types/components/box.d.ts +1 -0
- package/dist/types/components/disclosure.d.ts +1 -0
- package/dist/types/components/editor.d.ts +23 -5
- package/dist/types/components/form.d.ts +1 -0
- package/dist/types/components/image.d.ts +26 -44
- package/dist/types/components/input.d.ts +2 -1
- package/dist/types/components/key-value-list.d.ts +1 -0
- package/dist/types/components/layout/row.d.ts +1 -0
- package/dist/types/components/layout/stack.d.ts +1 -0
- package/dist/types/components/loader.d.ts +5 -6
- package/dist/types/components/markdown.d.ts +47 -5
- package/dist/types/components/scroll-view.d.ts +1 -0
- package/dist/types/components/section.d.ts +1 -0
- package/dist/types/components/table.d.ts +1 -0
- package/dist/types/components/text.d.ts +1 -0
- package/dist/types/components/tree-view.d.ts +7 -0
- package/dist/types/components/truncated-text.d.ts +1 -0
- package/dist/types/fuzzy.d.ts +29 -1
- package/dist/types/key-hint-format.d.ts +9 -1
- package/dist/types/keybinding-matchers.d.ts +3 -0
- package/dist/types/keybindings.d.ts +1 -1
- package/dist/types/kitty-graphics.d.ts +2 -2
- package/dist/types/loop-watchdog.d.ts +8 -7
- package/dist/types/multiplexers/cmux.d.ts +16 -0
- package/dist/types/multiplexers/herdr.d.ts +26 -0
- package/dist/types/multiplexers/notify.d.ts +13 -0
- package/dist/types/multiplexers/orca.d.ts +12 -0
- package/dist/types/multiplexers/screen.d.ts +9 -0
- package/dist/types/multiplexers/tmux.d.ts +29 -0
- package/dist/types/multiplexers/types.d.ts +100 -0
- package/dist/types/multiplexers/wmux.d.ts +12 -0
- package/dist/types/multiplexers/zellij.d.ts +12 -0
- package/dist/types/native/apply.d.ts +4 -3
- package/dist/types/native/backend.d.ts +5 -4
- package/dist/types/native/blobs.d.ts +7 -3
- package/dist/types/native/encode.d.ts +8 -6
- package/dist/types/native/node.d.ts +36 -5
- package/dist/types/native/overlay.d.ts +8 -3
- package/dist/types/native/settle.d.ts +4 -3
- package/dist/types/overlays/agent-hub-projection.d.ts +6 -5
- package/dist/types/overlays/agent-hub-types.d.ts +9 -0
- package/dist/types/overlays/agent-hub.d.ts +3 -0
- package/dist/types/overlays/agent-transcript-viewer.d.ts +12 -2
- package/dist/types/overlays/agents-hub.d.ts +9 -0
- package/dist/types/overlays/annotation-overlay.d.ts +19 -2
- package/dist/types/overlays/annotation-types.d.ts +2 -0
- package/dist/types/overlays/ask-dialog.d.ts +5 -2
- package/dist/types/overlays/btw-history-panel.d.ts +13 -1
- package/dist/types/overlays/copy-selector.d.ts +1 -0
- package/dist/types/overlays/history-search.d.ts +10 -0
- package/dist/types/overlays/hook-selector.d.ts +9 -4
- package/dist/types/overlays/hub-frame.d.ts +4 -1
- package/dist/types/overlays/jobs-panel.d.ts +1 -7
- package/dist/types/overlays/model-browser.d.ts +54 -7
- package/dist/types/overlays/model-hub.d.ts +37 -0
- package/dist/types/overlays/oauth-selector.d.ts +0 -1
- package/dist/types/overlays/plan-review-overlay.d.ts +3 -2
- package/dist/types/overlays/report-panel.d.ts +68 -0
- package/dist/types/overlays/rewind-selector.d.ts +1 -0
- package/dist/types/overlays/session-observer-registry.d.ts +2 -0
- package/dist/types/overlays/session-selector.d.ts +6 -2
- package/dist/types/overlays/settings-defs.d.ts +1 -0
- package/dist/types/overlays/thinking-selector.d.ts +2 -2
- package/dist/types/overlays/usage-dashboard.d.ts +12 -8
- package/dist/types/overlays/usage-display.d.ts +3 -1
- package/dist/types/prompt/composer-cache.d.ts +0 -16
- package/dist/types/prompt/composer.d.ts +18 -3
- package/dist/types/prompt/custom-editor.d.ts +25 -13
- package/dist/types/prompt/image-source.d.ts +2 -1
- package/dist/types/prompt/interactive-context-helpers.d.ts +5 -1
- package/dist/types/prompt/model-mention-autocomplete.d.ts +1 -1
- package/dist/types/prompt/welcome.d.ts +7 -2
- package/dist/types/render/composite.d.ts +2 -0
- package/dist/types/render/output-pane.d.ts +1 -0
- package/dist/types/render/render-utils.d.ts +1 -0
- package/dist/types/render/tool-card.d.ts +6 -0
- package/dist/types/render/width-aware-text.d.ts +2 -0
- package/dist/types/setup/scenes/types.d.ts +1 -0
- package/dist/types/space-hold.d.ts +40 -25
- package/dist/types/status-line/component.d.ts +3 -0
- package/dist/types/status-line/context-usage.d.ts +7 -5
- package/dist/types/status-line/host.d.ts +4 -1
- package/dist/types/status-line/segments.d.ts +2 -0
- package/dist/types/status-line/types.d.ts +14 -3
- package/dist/types/terminal-capabilities.d.ts +41 -36
- package/dist/types/terminal-multiplexer.d.ts +127 -14
- package/dist/types/terminal.d.ts +23 -16
- package/dist/types/theme/active-symbols.d.ts +1 -1
- package/dist/types/theme/schema.d.ts +11 -2
- package/dist/types/theme/symbols.d.ts +1 -1
- package/dist/types/theme/theme-class.d.ts +7 -0
- package/dist/types/theme/theme.d.ts +1 -1
- package/dist/types/theme/tui-adapters.d.ts +3 -0
- package/dist/types/thinking.d.ts +1 -1
- package/dist/types/tmux.d.ts +11 -4
- package/dist/types/tools/bash.d.ts +7 -2
- package/dist/types/tools/daemon.d.ts +1 -1
- package/dist/types/tools/eval.d.ts +22 -3
- package/dist/types/tools/glob.d.ts +4 -0
- package/dist/types/tools/native-view.d.ts +47 -0
- package/dist/types/tools/output-meta.d.ts +11 -1
- package/dist/types/tools/renderer.d.ts +37 -2
- package/dist/types/tools/streaming-output.d.ts +20 -1
- package/dist/types/tools/task.d.ts +2 -3
- package/dist/types/tools/write.d.ts +9 -2
- package/dist/types/tools/yield.d.ts +22 -0
- package/dist/types/tui.d.ts +36 -0
- package/dist/types/utils.d.ts +6 -0
- package/dist/types/vim.d.ts +19 -5
- package/dist/types/windows-input-mode.d.ts +33 -1
- package/package.json +13 -9
- package/src/active-terminal.d.ts +30 -0
- package/src/active-terminal.ts +80 -0
- package/src/app-keybindings.d.ts +7 -2
- package/src/app-keybindings.ts +7 -2
- package/src/apps/autoresearch-dashboard.ts +7 -3
- package/src/apps/cleanse-board.ts +2 -2
- package/src/apps/cleanse-picker.ts +1 -1
- package/src/apps/debug/log-viewer.ts +188 -72
- package/src/apps/debug/raw-sse-buffer.ts +8 -0
- package/src/apps/debug/raw-sse.ts +39 -5
- package/src/apps/git/diff-pane.ts +96 -23
- package/src/apps/git/git-tui.ts +23 -16
- package/src/apps/git/help.ts +29 -20
- package/src/apps/git/sidebar.ts +8 -3
- package/src/apps/if-bench-board.ts +2 -2
- package/src/apps/ps-top.ts +2 -2
- package/src/apps/setup-model-picker.ts +1 -1
- package/src/autocomplete.d.ts +5 -2
- package/src/autocomplete.ts +67 -43
- package/src/bracketed-paste.ts +10 -3
- package/src/charts/chart-plan.d.ts +674 -0
- package/src/charts/chart-plan.ts +5081 -0
- package/src/charts/chart-svg.d.ts +59 -0
- package/src/charts/chart-svg.ts +4657 -0
- package/src/charts/table-data.d.ts +175 -0
- package/src/charts/table-data.ts +1478 -0
- package/src/chat/advisor-message.ts +11 -0
- package/src/chat/assistant-message.d.ts +11 -1
- package/src/chat/assistant-message.ts +245 -54
- package/src/chat/chat-transcript-builder.d.ts +3 -0
- package/src/chat/chat-transcript-builder.ts +9 -3
- package/src/chat/compaction-summary-message.d.ts +1 -0
- package/src/chat/compaction-summary-message.ts +8 -0
- package/src/chat/execution-shared.d.ts +6 -5
- package/src/chat/execution-shared.ts +42 -25
- package/src/chat/fence-figure.d.ts +42 -0
- package/src/chat/fence-figure.ts +80 -0
- package/src/chat/figure-markdown.d.ts +42 -0
- package/src/chat/figure-markdown.ts +174 -0
- package/src/chat/messages.d.ts +1 -1
- package/src/chat/messages.ts +1 -1
- package/src/chat/read-tool-group.ts +6 -4
- package/src/chat/skill-message.ts +6 -0
- package/src/chat/svg-figure.d.ts +33 -0
- package/src/chat/svg-figure.ts +399 -0
- package/src/chat/svg-source.d.ts +49 -0
- package/src/chat/svg-source.ts +188 -0
- package/src/chat/table-chart.d.ts +89 -0
- package/src/chat/table-chart.ts +294 -0
- package/src/chat/tool-execution.d.ts +2 -0
- package/src/chat/tool-execution.ts +86 -7
- package/src/chat/user-message.d.ts +17 -4
- package/src/chat/user-message.ts +71 -8
- package/src/chrome/shared.ts +53 -0
- package/src/chrome/status-notice.ts +25 -7
- package/src/chrome/transcript-container.d.ts +6 -0
- package/src/chrome/transcript-container.ts +162 -19
- package/src/components/box.d.ts +1 -0
- package/src/components/box.ts +5 -0
- package/src/components/disclosure.d.ts +1 -0
- package/src/components/disclosure.ts +8 -0
- package/src/components/editor.d.ts +23 -5
- package/src/components/editor.ts +316 -47
- package/src/components/form.d.ts +1 -0
- package/src/components/form.ts +8 -0
- package/src/components/image.d.ts +26 -44
- package/src/components/image.ts +115 -152
- package/src/components/input.d.ts +2 -1
- package/src/components/input.ts +17 -7
- package/src/components/key-value-list.d.ts +1 -0
- package/src/components/key-value-list.ts +4 -0
- package/src/components/layout/row.d.ts +1 -0
- package/src/components/layout/row.ts +7 -0
- package/src/components/layout/stack.d.ts +1 -0
- package/src/components/layout/stack.ts +7 -0
- package/src/components/loader.d.ts +5 -6
- package/src/components/loader.ts +10 -17
- package/src/components/markdown.d.ts +47 -5
- package/src/components/markdown.ts +786 -303
- package/src/components/scroll-view.d.ts +1 -0
- package/src/components/scroll-view.ts +5 -0
- package/src/components/section.d.ts +1 -0
- package/src/components/section.ts +5 -0
- package/src/components/settings-list.ts +2 -0
- package/src/components/table.d.ts +1 -0
- package/src/components/table.ts +4 -0
- package/src/components/text.d.ts +1 -0
- package/src/components/text.ts +7 -0
- package/src/components/tree-view.d.ts +7 -0
- package/src/components/tree-view.ts +38 -8
- package/src/components/truncated-text.d.ts +1 -0
- package/src/components/truncated-text.ts +5 -0
- package/src/desktop-notify.ts +3 -2
- package/src/fuzzy.d.ts +29 -1
- package/src/fuzzy.ts +115 -30
- package/src/hotkeys-markdown.ts +9 -2
- package/src/key-hint-format.d.ts +9 -1
- package/src/key-hint-format.ts +26 -11
- package/src/keybinding-matchers.d.ts +3 -0
- package/src/keybinding-matchers.ts +6 -2
- package/src/keybindings.d.ts +1 -1
- package/src/keybindings.ts +1 -1
- package/src/kitty-graphics.d.ts +2 -2
- package/src/kitty-graphics.ts +11 -5
- package/src/loop-watchdog.d.ts +8 -7
- package/src/loop-watchdog.ts +18 -13
- package/src/multiplexers/cmux.d.ts +16 -0
- package/src/multiplexers/cmux.ts +29 -0
- package/src/multiplexers/herdr.d.ts +26 -0
- package/src/multiplexers/herdr.ts +64 -0
- package/src/multiplexers/notify.d.ts +13 -0
- package/src/multiplexers/notify.ts +24 -0
- package/src/multiplexers/orca.d.ts +12 -0
- package/src/multiplexers/orca.ts +16 -0
- package/src/multiplexers/screen.d.ts +9 -0
- package/src/multiplexers/screen.ts +15 -0
- package/src/multiplexers/tmux.d.ts +29 -0
- package/src/multiplexers/tmux.ts +40 -0
- package/src/multiplexers/types.d.ts +100 -0
- package/src/multiplexers/types.ts +110 -0
- package/src/multiplexers/wmux.d.ts +12 -0
- package/src/multiplexers/wmux.ts +16 -0
- package/src/multiplexers/zellij.d.ts +12 -0
- package/src/multiplexers/zellij.ts +24 -0
- package/src/native/apply.d.ts +4 -3
- package/src/native/apply.ts +4 -3
- package/src/native/backend.d.ts +5 -4
- package/src/native/backend.ts +199 -22
- package/src/native/blobs.d.ts +7 -3
- package/src/native/blobs.ts +47 -12
- package/src/native/encode.d.ts +8 -6
- package/src/native/encode.ts +76 -34
- package/src/native/node.d.ts +36 -5
- package/src/native/node.ts +31 -5
- package/src/native/overlay.d.ts +8 -3
- package/src/native/overlay.ts +17 -4
- package/src/native/reconcile.ts +16 -4
- package/src/native/settle.d.ts +4 -3
- package/src/native/settle.ts +4 -3
- package/src/overlays/agent-hub-projection.d.ts +6 -5
- package/src/overlays/agent-hub-projection.ts +124 -13
- package/src/overlays/agent-hub-types.d.ts +9 -0
- package/src/overlays/agent-hub-types.ts +6 -0
- package/src/overlays/agent-hub.ts +48 -29
- package/src/overlays/agent-transcript-viewer.ts +93 -23
- package/src/overlays/agents-hub.ts +28 -8
- package/src/overlays/annotation-overlay.ts +293 -90
- package/src/overlays/annotation-types.ts +2 -0
- package/src/overlays/ask-dialog.ts +10 -17
- package/src/overlays/btw-history-panel.ts +136 -39
- package/src/overlays/copy-selector.d.ts +1 -0
- package/src/overlays/copy-selector.ts +32 -8
- package/src/overlays/extensions/extension-dashboard.ts +4 -4
- package/src/overlays/extensions/state-manager.ts +52 -12
- package/src/overlays/history-search.ts +100 -7
- package/src/overlays/hook-selector.ts +12 -5
- package/src/overlays/hub-frame.ts +19 -1
- package/src/overlays/jobs-panel.ts +33 -52
- package/src/overlays/model-browser.ts +367 -122
- package/src/overlays/model-hub.ts +435 -59
- package/src/overlays/move-overlay.ts +28 -14
- package/src/overlays/oauth-selector.ts +54 -70
- package/src/overlays/pause-screen.ts +2 -2
- package/src/overlays/plan-review-overlay.ts +208 -70
- package/src/overlays/plugin-settings.ts +3 -3
- package/src/overlays/report-panel.ts +191 -0
- package/src/overlays/rewind-selector.ts +88 -17
- package/src/overlays/session-observer-registry.d.ts +2 -0
- package/src/overlays/session-observer-registry.ts +10 -2
- package/src/overlays/session-selector.ts +64 -26
- package/src/overlays/settings-defs.ts +5 -4
- package/src/overlays/settings-selector.ts +33 -8
- package/src/overlays/snapcompact-shape-preview.ts +2 -3
- package/src/overlays/stats-notice.ts +1 -1
- package/src/overlays/thinking-selector.ts +11 -10
- package/src/overlays/tree-selector.ts +41 -20
- package/src/overlays/usage-dashboard.ts +117 -58
- package/src/overlays/usage-display.ts +10 -4
- package/src/overlays/usage-row.ts +22 -8
- package/src/prompt/attachment-chips.ts +15 -11
- package/src/prompt/composer-attachments.ts +6 -4
- package/src/prompt/composer-cache.ts +7 -86
- package/src/prompt/composer.ts +37 -26
- package/src/prompt/custom-editor.ts +282 -105
- package/src/prompt/image-source.ts +2 -1
- package/src/prompt/interactive-context-helpers.ts +32 -18
- package/src/prompt/macos-spelling.ts +7 -0
- package/src/prompt/magic-keywords.ts +11 -2
- package/src/prompt/model-mention-autocomplete.ts +14 -14
- package/src/prompt/queued-messages.ts +6 -4
- package/src/prompt/tips.txt +13 -9
- package/src/prompt/welcome.ts +64 -46
- package/src/prompt/word-completion.ts +38 -5
- package/src/render/composite.d.ts +2 -0
- package/src/render/composite.ts +64 -0
- package/src/render/output-pane.d.ts +1 -0
- package/src/render/output-pane.ts +6 -0
- package/src/render/render-utils.d.ts +1 -0
- package/src/render/render-utils.ts +16 -1
- package/src/render/tool-card.d.ts +6 -0
- package/src/render/tool-card.ts +15 -0
- package/src/render/width-aware-text.d.ts +2 -0
- package/src/render/width-aware-text.ts +5 -0
- package/src/setup/scenes/model.ts +2 -1
- package/src/setup/scenes/types.ts +1 -0
- package/src/space-hold.d.ts +40 -25
- package/src/space-hold.ts +156 -52
- package/src/status-line/component.ts +292 -78
- package/src/status-line/context-usage.ts +21 -46
- package/src/status-line/host.ts +4 -1
- package/src/status-line/segments.ts +40 -22
- package/src/status-line/types.ts +15 -3
- package/src/terminal-capabilities.d.ts +41 -36
- package/src/terminal-capabilities.ts +137 -213
- package/src/terminal-multiplexer.d.ts +127 -14
- package/src/terminal-multiplexer.ts +112 -33
- package/src/terminal.d.ts +23 -16
- package/src/terminal.ts +203 -99
- package/src/theme/active-symbols.d.ts +1 -1
- package/src/theme/active-symbols.ts +1 -1
- package/src/theme/schema-validation.ts +1 -0
- package/src/theme/schema.d.ts +11 -2
- package/src/theme/schema.ts +14 -1
- package/src/theme/session-color.ts +1 -7
- package/src/theme/symbols.d.ts +1 -1
- package/src/theme/symbols.ts +11 -4
- package/src/theme/theme-class.d.ts +7 -0
- package/src/theme/theme-class.ts +26 -1
- package/src/theme/theme-schema.json +5 -1
- package/src/theme/theme.d.ts +1 -1
- package/src/theme/theme.ts +8 -4
- package/src/theme/tui-adapters.d.ts +3 -0
- package/src/theme/tui-adapters.ts +68 -0
- package/src/thinking.d.ts +1 -1
- package/src/thinking.ts +1 -1
- package/src/tmux.d.ts +11 -4
- package/src/tmux.ts +47 -11
- package/src/tools/ast-edit.ts +59 -35
- package/src/tools/ast-grep.ts +35 -16
- package/src/tools/bash.d.ts +7 -2
- package/src/tools/bash.ts +116 -47
- package/src/tools/daemon.d.ts +1 -1
- package/src/tools/daemon.ts +1 -1
- package/src/tools/default-renderer.ts +35 -19
- package/src/tools/edit.ts +142 -120
- package/src/tools/eval-format/index.ts +28 -2
- package/src/tools/eval-format/javascript.ts +7 -5
- package/src/tools/eval.d.ts +22 -3
- package/src/tools/eval.ts +364 -208
- package/src/tools/fetch.ts +5 -6
- package/src/tools/glob.d.ts +4 -0
- package/src/tools/glob.ts +33 -65
- package/src/tools/grep.ts +81 -48
- package/src/tools/index.ts +2 -0
- package/src/tools/lsp.ts +81 -59
- package/src/tools/mcp.ts +111 -68
- package/src/tools/native-view.d.ts +47 -0
- package/src/tools/native-view.ts +102 -1
- package/src/tools/output-meta.d.ts +11 -1
- package/src/tools/output-meta.ts +23 -3
- package/src/tools/read.ts +7 -5
- package/src/tools/renderer.d.ts +37 -2
- package/src/tools/renderer.ts +42 -2
- package/src/tools/streaming-output.d.ts +20 -1
- package/src/tools/streaming-output.ts +154 -50
- package/src/tools/task.d.ts +2 -3
- package/src/tools/task.ts +115 -62
- package/src/tools/todo.ts +119 -30
- package/src/tools/wait.ts +34 -24
- package/src/tools/web-search.ts +1 -1
- package/src/tools/write.d.ts +9 -2
- package/src/tools/write.ts +147 -95
- package/src/tools/yield.d.ts +22 -0
- package/src/tools/yield.ts +225 -0
- package/src/tui.d.ts +36 -0
- package/src/tui.ts +666 -217
- package/src/utils.d.ts +6 -0
- package/src/utils.ts +19 -0
- package/src/vim.d.ts +19 -5
- package/src/vim.ts +333 -18
- package/src/windows-input-mode.d.ts +33 -1
- package/src/windows-input-mode.ts +212 -6
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Draws a {@link ChartSpec} as a standalone SVG document colored only with
|
|
3
|
+
* figure tokens — `var(--fg)`, `var(--muted)`, `var(--border)`,
|
|
4
|
+
* `var(--accent)`, `var(--surface)`, `var(--c1)`…`var(--c6)` — on a
|
|
5
|
+
* transparent background — the token vocabulary of assistant ```svg figures —
|
|
6
|
+
* so the host resolves them against the live theme (`prepareSvg`) for both
|
|
7
|
+
* the rasterized terminal image and the native TSP blob.
|
|
8
|
+
*
|
|
9
|
+
* Styled after Apple's charts and Tern's UI: a UI sans (Geist where Tern
|
|
10
|
+
* provides it), muted labels, hairline gridlines that recede behind the
|
|
11
|
+
* marks, bars and cells with rounded corners, smooth lines (over a soft area
|
|
12
|
+
* fill where the axis starts at zero), dot legends, one hue across small
|
|
13
|
+
* multiples' columns with gray for context. 13-unit labels land near the terminal's own glyph size
|
|
14
|
+
* at 16 user units per row; bolded table cells draw at full strength while
|
|
15
|
+
* their neighbours recede. Grouped categories ({@link ChartSpec.groups}) name
|
|
16
|
+
* each group once beside its members, the groups parted by a gap; a name too
|
|
17
|
+
* long for its column wraps to two lines ({@link categoryLabels}). A few
|
|
18
|
+
* outliers far above the rest break a bar axis instead of flattening it
|
|
19
|
+
* ({@link outlierTier}); reference rows ({@link ChartSpec.reference}) draw a
|
|
20
|
+
* dashed rule through their group.
|
|
21
|
+
*
|
|
22
|
+
* Every chart opens with a header ({@link drawHeader}): the semibold title a
|
|
23
|
+
* planner set ({@link ChartSpec.title}, the one fact worth stating; its key
|
|
24
|
+
* figure in the accent), a muted
|
|
25
|
+
* note on how the data is encoded, and the series key right-aligned on the
|
|
26
|
+
* title's line when it fits. Marks size to
|
|
27
|
+
* the row count ({@link barMetrics}); strong heat cells and share segments
|
|
28
|
+
* print their figures in a theme-adaptive dark {@link ink}. Reusable
|
|
29
|
+
* annotation primitives — {@link band}, {@link referenceRule},
|
|
30
|
+
* {@link callout} — draw the {@link ChartSpec.annotations} a planner lays on.
|
|
31
|
+
*
|
|
32
|
+
* Axes tick on round steps in one unit (`0, 2, 4` for counts, `50s, 100s`,
|
|
33
|
+
* `25 GiB` where the table wrote binary sizes, thousands separated). Meaning
|
|
34
|
+
* layers on top: each contest's best value carries a quiet `best` tag (an
|
|
35
|
+
* outline in a heatmap), estimates (`~15`) among measured figures draw as
|
|
36
|
+
* dashed, faint bars ({@link barRect}), moves of a measure with a polarity read in `success`
|
|
37
|
+
* or `error` (transitions, factors, signed deltas), and status cells badge
|
|
38
|
+
* their row's name with a colored dot keyed under the chart.
|
|
39
|
+
*/
|
|
40
|
+
import { type ChartSpec } from "./chart-plan.js";
|
|
41
|
+
import { type Dimension } from "./table-data.js";
|
|
42
|
+
/** A drawn chart: the SVG document and its size in user units. */
|
|
43
|
+
export interface ChartSvg {
|
|
44
|
+
readonly svg: string;
|
|
45
|
+
readonly width: number;
|
|
46
|
+
readonly height: number;
|
|
47
|
+
}
|
|
48
|
+
/** The SVG document for `spec`. */
|
|
49
|
+
export declare function renderChartSvg(spec: ChartSpec): ChartSvg;
|
|
50
|
+
/** One-line description of the chart, for screen readers and terminals that show the alt text. */
|
|
51
|
+
export declare function chartAlt(spec: ChartSpec): string;
|
|
52
|
+
/**
|
|
53
|
+
* A value in base units as an axis label: durations and sizes in the unit,
|
|
54
|
+
* counts compacted under the suffix (`12k`, `3.4M`), that `magnitude` reads
|
|
55
|
+
* best in — the value's own size by default, an axis' largest tick to keep
|
|
56
|
+
* its labels in one unit. Sizes read in decimal units (`20 GB`), or binary
|
|
57
|
+
* ones (`16 GiB`) when `unit` is `iB`.
|
|
58
|
+
*/
|
|
59
|
+
export declare function formatValue(value: number, dim: Dimension, unit: string, magnitude?: number): string;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Numeric reading of GFM table cells and columns, the input to
|
|
3
|
+
* {@link planChart}: what number a cell holds (in base units, with its
|
|
4
|
+
* dimension and annotations) and which role each column plays — a measure to
|
|
5
|
+
* plot, a category label, an ordered x axis, or a row index to ignore.
|
|
6
|
+
*
|
|
7
|
+
* Cells are model-written prose, not CSV: `~1,400`, `**4** ✅`, `17 (21.5%)`,
|
|
8
|
+
* `24–72 h`, `12 → 15`, `5/8`, `1m 56s`, `TIMEOUT`. The reader keeps the first
|
|
9
|
+
* number and its unit and classifies the rest, so a column of mostly clean
|
|
10
|
+
* numbers survives a few annotated or sentinel cells.
|
|
11
|
+
*/
|
|
12
|
+
/** What a number measures; values of one dimension share an axis after unit normalization. */
|
|
13
|
+
export type Dimension = "count" | "percent" | "duration" | "bytes" | "currency" | "ratio" | "fraction" | "rate";
|
|
14
|
+
/**
|
|
15
|
+
* How cleanly a cell reads as its number: bare (`12 ms`), with a short note
|
|
16
|
+
* (`17 (21.5%)`, `16 pass`), a range (`24–72 h`), a transition (`12 → 15`), a
|
|
17
|
+
* fraction (`5/8`), or a number leading prose (`~1,400w, nearly ready`).
|
|
18
|
+
*/
|
|
19
|
+
export type CellFit = "pure" | "note" | "range" | "arrow" | "fraction" | "prose";
|
|
20
|
+
/** A cell that reads as a number. */
|
|
21
|
+
export interface NumberCell {
|
|
22
|
+
readonly kind: "number";
|
|
23
|
+
/** Value in base units: seconds, bytes, a plain count, percent points. */
|
|
24
|
+
readonly value: number;
|
|
25
|
+
readonly dim: Dimension;
|
|
26
|
+
/** Unit or currency symbol as written (`ms`, `KiB`, `$`, `tok/s`); empty for bare numbers. */
|
|
27
|
+
readonly unit: string;
|
|
28
|
+
readonly fit: CellFit;
|
|
29
|
+
/** Written as an estimate or bound (`~`, `≈`, `<`, `≥`). */
|
|
30
|
+
readonly approx: boolean;
|
|
31
|
+
/** Written with an explicit sign (`+12%`, `-3`). */
|
|
32
|
+
readonly signed: boolean;
|
|
33
|
+
/** The cell was bolded: models bold the value they want noticed. */
|
|
34
|
+
readonly emphasis: boolean;
|
|
35
|
+
/** The cell text without Markdown decoration. */
|
|
36
|
+
readonly text: string;
|
|
37
|
+
/** The number as written, with approximation, sign, currency and unit (`~$250`, `12.5 ms`, `24–72 h`). */
|
|
38
|
+
readonly figure: string;
|
|
39
|
+
/** `a → b`: `b`, in the same base units. */
|
|
40
|
+
readonly to?: number;
|
|
41
|
+
/** `a → b`: `b` as written. */
|
|
42
|
+
readonly toFigure?: string;
|
|
43
|
+
/** `a–b`: `b`, in the same base units. */
|
|
44
|
+
readonly upper?: number;
|
|
45
|
+
/**
|
|
46
|
+
* `a/b`: `b`. {@link analyzeTable} reads a score (`12/12`, `154/160`, a mean
|
|
47
|
+
* like `0.6/4`) as the percent of `b` reached, unless its column also holds a
|
|
48
|
+
* plain fraction; a pair (`85 / 147` under `Edit / read calls`) keeps `a`.
|
|
49
|
+
*/
|
|
50
|
+
readonly denominator?: number;
|
|
51
|
+
/**
|
|
52
|
+
* `a ± e` (`3.67s ± 0.69`, `~404ms ± 60`, `$0.72 (±0.16)`): `e`, in the same base units — the
|
|
53
|
+
* spread the table states around the value; {@link figure} then writes both (`3.67s ± 0.69`).
|
|
54
|
+
*/
|
|
55
|
+
readonly error?: number;
|
|
56
|
+
/**
|
|
57
|
+
* A slash list of measurements in one unit (`79 / 124 µs`, `1,864 ms /
|
|
58
|
+
* 2,678 ms`, `**675ms** / 680ms`): every listed value, the first included,
|
|
59
|
+
* in base units, 2–4 of them. `value` is the first.
|
|
60
|
+
*/
|
|
61
|
+
readonly values?: readonly number[];
|
|
62
|
+
}
|
|
63
|
+
/** A cell that is not a quantity. */
|
|
64
|
+
export interface OtherCell {
|
|
65
|
+
readonly kind: "missing" | "date" | "time" | "version" | "id" | "text";
|
|
66
|
+
readonly text: string;
|
|
67
|
+
readonly emphasis: boolean;
|
|
68
|
+
}
|
|
69
|
+
export type Cell = NumberCell | OtherCell;
|
|
70
|
+
/**
|
|
71
|
+
* What a column contributes to a chart: `measure` values to plot, `label`
|
|
72
|
+
* category names, `temporal` dates or times, `sequence` an ordered step
|
|
73
|
+
* (`Run`, `Day`, `Workers`), `index` a row number or identifier never plotted.
|
|
74
|
+
*/
|
|
75
|
+
export type ColumnRole = "measure" | "label" | "temporal" | "sequence" | "index";
|
|
76
|
+
export interface TableColumn {
|
|
77
|
+
readonly index: number;
|
|
78
|
+
/** Header text without Markdown decoration. */
|
|
79
|
+
readonly header: string;
|
|
80
|
+
readonly role: ColumnRole;
|
|
81
|
+
readonly cells: readonly Cell[];
|
|
82
|
+
/** Dominant dimension of the numeric cells. */
|
|
83
|
+
readonly dim: Dimension | undefined;
|
|
84
|
+
/** Representative unit of the dominant dimension (`$`, `tok/s`); empty when bare. */
|
|
85
|
+
readonly unit: string;
|
|
86
|
+
/** Numeric cells disagree on dimension (a metric-per-row table). */
|
|
87
|
+
readonly mixed: boolean;
|
|
88
|
+
/** Numeric cells are mostly scores out of a total (`12/12`), read as percent of it. */
|
|
89
|
+
readonly scores: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Per row, the status its cell leads with ({@link cellStatus}), when most
|
|
92
|
+
* of the column's cells lead with one: a pass/fail or progress column.
|
|
93
|
+
*/
|
|
94
|
+
readonly statuses?: readonly (Status | undefined)[];
|
|
95
|
+
/** Every numeric data cell holds the same value: an echoed setting, not a measure. */
|
|
96
|
+
readonly constant: boolean;
|
|
97
|
+
/** Share of numeric cells written with an explicit sign. */
|
|
98
|
+
readonly signedShare: number;
|
|
99
|
+
/** Share of numeric cells written as `a → b`. */
|
|
100
|
+
readonly arrowShare: number;
|
|
101
|
+
/**
|
|
102
|
+
* Index of the measure column this one restates, read from the values: a
|
|
103
|
+
* proportional copy (`pass` 33/38 beside `pass%` 87%, `Samples` beside `% of
|
|
104
|
+
* Total`, `Leverage vs $200` beside the cost) or a running total of it
|
|
105
|
+
* (`Offset` summing `Verts`). Such a column is never a measure of its own.
|
|
106
|
+
*/
|
|
107
|
+
readonly restates?: number;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Measure columns that add up, read from the values: leaf `parts` summing to
|
|
111
|
+
* `whole` in every row (`Cached + Uncached input = Input`, `Input + Output =
|
|
112
|
+
* Total` → parts Cached, Uncached input, Output of Total), or — when not
|
|
113
|
+
* `exact` — parts falling within a `Total` column, the rest unlisted (`New +
|
|
114
|
+
* Edited ≤ Prose total`).
|
|
115
|
+
*/
|
|
116
|
+
export interface Composition {
|
|
117
|
+
/** Column the parts make up; absent when only a judge says the parts form a whole. */
|
|
118
|
+
readonly whole: number | undefined;
|
|
119
|
+
/** Leaf part columns, in table order. */
|
|
120
|
+
readonly parts: readonly number[];
|
|
121
|
+
/** The parts sum to the whole within the written precision in every row. */
|
|
122
|
+
readonly exact: boolean;
|
|
123
|
+
}
|
|
124
|
+
/** A table read for charting. */
|
|
125
|
+
export interface TableAnalysis {
|
|
126
|
+
readonly columns: readonly TableColumn[];
|
|
127
|
+
/**
|
|
128
|
+
* Category labels: the first text or temporal column not made only of codes
|
|
129
|
+
* (`#2233`, `00`), else the first text column, else a sequence or index column.
|
|
130
|
+
*/
|
|
131
|
+
readonly label: TableColumn | undefined;
|
|
132
|
+
/** Plottable measure columns, constant ones excluded. */
|
|
133
|
+
readonly measures: readonly TableColumn[];
|
|
134
|
+
/** Data rows, in table order, without total/summary rows. */
|
|
135
|
+
readonly rows: readonly number[];
|
|
136
|
+
/** Total/summary rows (`Total`, `Average`, …), kept out of the scale. */
|
|
137
|
+
readonly totals: readonly number[];
|
|
138
|
+
/** Measure columns adding up to a whole, when the values show it. */
|
|
139
|
+
readonly composition?: Composition;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* What a status cell (`ok`, `FAIL`, `pending`, ✅) says about its row: `good`
|
|
143
|
+
* passed or landed, `bad` failed or broke, `warn` partly or flaky, `pending`
|
|
144
|
+
* not settled yet.
|
|
145
|
+
*/
|
|
146
|
+
export type Status = "good" | "bad" | "warn" | "pending";
|
|
147
|
+
/**
|
|
148
|
+
* The status a cell's text leads with (`FAIL`, `✓ via mmdc`, `**pending**`,
|
|
149
|
+
* `1 ok`), or `undefined` for any other text. A count before the word
|
|
150
|
+
* (`3 ok`) still reads as the word's status.
|
|
151
|
+
*/
|
|
152
|
+
export declare function cellStatus(text: string): Status | undefined;
|
|
153
|
+
/**
|
|
154
|
+
* Strip inline Markdown from a cell: links keep their text; bold, italics,
|
|
155
|
+
* strikethrough, code spans and `<br>` keep their content.
|
|
156
|
+
*/
|
|
157
|
+
export declare function plainCell(markdown: string): {
|
|
158
|
+
text: string;
|
|
159
|
+
emphasis: boolean;
|
|
160
|
+
};
|
|
161
|
+
/** Parse the first number of a (Markdown) cell, or classify why it is not one. */
|
|
162
|
+
export declare function parseCell(markdown: string): Cell;
|
|
163
|
+
/** Read a table's columns and rows for charting. Cells are the raw Markdown of each cell. */
|
|
164
|
+
export declare function analyzeTable(header: readonly string[], rows: readonly (readonly string[])[]): TableAnalysis;
|
|
165
|
+
/**
|
|
166
|
+
* Half the last written digit of `cell`, in base units (`6,313k` → 500,
|
|
167
|
+
* `38.5%` → 0.05): how far its value may sit from the exact quantity it
|
|
168
|
+
* rounds. A score (`33/38` read as percent) and a whole count written in full
|
|
169
|
+
* (`46`, `1,980`) are exact.
|
|
170
|
+
*/
|
|
171
|
+
export declare function writtenSlack(cell: NumberCell): number;
|
|
172
|
+
/** Strictly increasing or strictly decreasing. */
|
|
173
|
+
export declare function isMonotonic(values: readonly number[]): boolean;
|
|
174
|
+
/** Whether `cell` reads as a number. */
|
|
175
|
+
export declare function isNumber(cell: Cell | undefined): cell is NumberCell;
|
|
@@ -38,7 +38,7 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
38
38
|
* for lack of a target is re-rendered with its reaction stripped.
|
|
39
39
|
*/
|
|
40
40
|
pickReactionTarget(transcript: readonly Component[]): void;
|
|
41
|
-
constructor(message?: AssistantMessage, hideThinkingBlock?: boolean, onImageUpdate?: () => void, thinkingRenderers?: readonly AssistantThinkingRenderer[], imageBudget?: ImageBudget, proseOnlyThinking?: boolean, linkTargets?: ReadonlyMap<string, string
|
|
41
|
+
constructor(message?: AssistantMessage, hideThinkingBlock?: boolean, onImageUpdate?: () => void, thinkingRenderers?: readonly AssistantThinkingRenderer[], imageBudget?: ImageBudget, proseOnlyThinking?: boolean, linkTargets?: ReadonlyMap<string, string>, expandThinkingBlocks?: boolean);
|
|
42
42
|
/**
|
|
43
43
|
* Show or clear the trailing cache-invalidation divider. Set at `message_end`
|
|
44
44
|
* (live) or during rebuild, once the turn's usage is known and compared
|
|
@@ -54,6 +54,7 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
54
54
|
*/
|
|
55
55
|
setServedModelMismatch(info: ServedModelMismatch | undefined): void;
|
|
56
56
|
invalidate(): void;
|
|
57
|
+
releaseRenderCaches(): void;
|
|
57
58
|
setHideThinkingBlock(hide: boolean): void;
|
|
58
59
|
/**
|
|
59
60
|
* Allow or withhold retiring finished lines into native scrollback while the
|
|
@@ -65,6 +66,11 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
65
66
|
*/
|
|
66
67
|
setMidStreamPublication(allowed: boolean): void;
|
|
67
68
|
setProseOnlyThinking(proseOnly: boolean): void;
|
|
69
|
+
/**
|
|
70
|
+
* Keep finished thinking sections expanded instead of folding them to "Thought for 12s".
|
|
71
|
+
* Sections the user folded or unfolded by hand keep that choice.
|
|
72
|
+
*/
|
|
73
|
+
setExpandThinkingBlocks(expand: boolean): void;
|
|
68
74
|
dispose(): void;
|
|
69
75
|
/**
|
|
70
76
|
* Toggle suppression of the inline `Error: …` line while the same error is
|
|
@@ -81,6 +87,8 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
81
87
|
*/
|
|
82
88
|
setExpanded(expanded: boolean): void;
|
|
83
89
|
isTranscriptBlockFinalized(): boolean;
|
|
90
|
+
/** Whether a figure still waits for the raster of its final source; the transcript holds retirement meanwhile. */
|
|
91
|
+
isTranscriptBlockPending(): boolean;
|
|
84
92
|
render(width: number): readonly string[];
|
|
85
93
|
/**
|
|
86
94
|
* A `col` (role `zeta.assistant`) of `md` nodes keyed by content index, so
|
|
@@ -118,6 +126,8 @@ export declare class AssistantMessageComponent extends Container {
|
|
|
118
126
|
messagePersistenceKey(): string | undefined;
|
|
119
127
|
/** Toggle rendering for assistant-native and tool-result images. */
|
|
120
128
|
setImagesVisible(visible: boolean): void;
|
|
129
|
+
/** Toggle charts under numeric tables (the main session's transcript only, never a subagent's). */
|
|
130
|
+
setTableChartsVisible(visible: boolean): void;
|
|
121
131
|
/** Toggle only images produced by tool results; assistant-native images remain governed by setImagesVisible. */
|
|
122
132
|
setToolResultImagesVisible(visible: boolean): void;
|
|
123
133
|
setToolResultImages(toolCallId: string, images: ImageContent[]): void;
|
|
@@ -25,8 +25,11 @@ export interface ChatTranscriptBuilderDeps {
|
|
|
25
25
|
cwd: string;
|
|
26
26
|
hideThinkingBlock?: () => boolean;
|
|
27
27
|
proseOnlyThinking?: () => boolean;
|
|
28
|
+
expandThinkingBlocks?: () => boolean;
|
|
28
29
|
/** Session-scoped resolved destinations for model-authored Markdown links. */
|
|
29
30
|
linkTargets?: ReadonlyMap<string, string>;
|
|
31
|
+
/** Draw charts under numeric tables; false for transcripts that are not the main session's. Default: true. */
|
|
32
|
+
tableCharts?: boolean;
|
|
30
33
|
requestRender: () => void;
|
|
31
34
|
}
|
|
32
35
|
export declare class ChatTranscriptBuilder {
|
|
@@ -31,6 +31,7 @@ declare class SummaryMessageComponent implements Component {
|
|
|
31
31
|
handleNativeEvent(event: NativeUiEvent): void;
|
|
32
32
|
setIgnoreTight(ignore: boolean): this;
|
|
33
33
|
invalidate(): void;
|
|
34
|
+
releaseRenderCaches(): void;
|
|
34
35
|
dispose(): void;
|
|
35
36
|
render(width: number): readonly string[];
|
|
36
37
|
}
|
|
@@ -78,7 +78,7 @@ export interface ExecutionToolInput {
|
|
|
78
78
|
/** Tool name for the head icon (`bash`, `eval`). */
|
|
79
79
|
readonly name: string;
|
|
80
80
|
readonly title: string;
|
|
81
|
-
/** The command / cell source
|
|
81
|
+
/** The command / cell source: the run box's input and the head's Copy command. */
|
|
82
82
|
readonly command: string;
|
|
83
83
|
readonly lang: string;
|
|
84
84
|
/** Excluded from context (`!!`/`$$`). */
|
|
@@ -96,10 +96,11 @@ export interface ExecutionToolInput {
|
|
|
96
96
|
readonly artifactError?: OutputArtifactError;
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
99
|
-
* A user `!`/`$` run as the agent's `tool` frame (§6.6):
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
99
|
+
* A user `!`/`$` run as the agent's `tool` frame (§6.6): a head with a `you`
|
|
100
|
+
* badge (plus `not sent` when excluded from context) and the command for Copy
|
|
101
|
+
* command; the body is one run box — the source, the output as an `ansi` mini
|
|
102
|
+
* terminal following its tail, and the foot (state, time, truncation) — with
|
|
103
|
+
* any images below it. Timer, exit chip and cancelled note stay head data.
|
|
103
104
|
*/
|
|
104
105
|
export declare function describeExecutionTool(input: ExecutionToolInput): NativeNode;
|
|
105
106
|
/**
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tool call's {@link ToolFigure} drawn under its card, the way assistant
|
|
3
|
+
* Markdown draws that fence: ```svg as an inline image ({@link SvgFigure}),
|
|
4
|
+
* redrawn as the body streams; ```mermaid as ASCII art once the body is
|
|
5
|
+
* final. The card already shows the source, so unlike the assistant's fence
|
|
6
|
+
* it never falls back to code: {@link FenceFigure.draws} turns down fences
|
|
7
|
+
* this terminal shows as code, and an svg that does not rasterize stays blank.
|
|
8
|
+
*/
|
|
9
|
+
import type { ImageBudget } from "../components/image.js";
|
|
10
|
+
import type { ToolFigure } from "../tools/renderer.js";
|
|
11
|
+
import type { Component } from "../tui.js";
|
|
12
|
+
/** Fence languages a {@link FenceFigure} draws. */
|
|
13
|
+
export type FenceFigureLang = "svg" | "mermaid";
|
|
14
|
+
export interface FenceFigureOptions {
|
|
15
|
+
/** Shared inline-image budget for an svg's rasters. */
|
|
16
|
+
budget?: ImageBudget;
|
|
17
|
+
/** The figure's rows changed outside a render: a raster landed. */
|
|
18
|
+
onChange: () => void;
|
|
19
|
+
}
|
|
20
|
+
export declare class FenceFigure implements Component {
|
|
21
|
+
#private;
|
|
22
|
+
/**
|
|
23
|
+
* Whether this terminal draws `figure` now: an svg where inline images show
|
|
24
|
+
* (`showImages` and a graphics protocol), a closed mermaid fence when
|
|
25
|
+
* diagram rendering is on and the source renders.
|
|
26
|
+
*/
|
|
27
|
+
static draws(figure: ToolFigure, options: {
|
|
28
|
+
showImages: boolean;
|
|
29
|
+
}): figure is ToolFigure & {
|
|
30
|
+
readonly lang: FenceFigureLang;
|
|
31
|
+
};
|
|
32
|
+
readonly lang: FenceFigureLang;
|
|
33
|
+
constructor(lang: FenceFigureLang, options: FenceFigureOptions);
|
|
34
|
+
/** Feed the fence as it stands; its `lang` is this figure's. */
|
|
35
|
+
update(figure: ToolFigure): void;
|
|
36
|
+
/** Whether a closed svg's raster is still on its way. */
|
|
37
|
+
get pending(): boolean;
|
|
38
|
+
/** The drawing; no rows while an svg draws, or when it does not. */
|
|
39
|
+
render(width: number): readonly string[];
|
|
40
|
+
invalidate(): void;
|
|
41
|
+
dispose(): void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ImageBudget } from "../components/image.js";
|
|
2
|
+
import type { Markdown } from "../components/markdown.js";
|
|
3
|
+
import { Container } from "../tui.js";
|
|
4
|
+
export interface FigureMarkdownOptions {
|
|
5
|
+
/** Markdown for one prose run (and a failed figure's code fallback); FigureMarkdown drives its transience. */
|
|
6
|
+
markdown: (text: string) => Markdown;
|
|
7
|
+
/** Draw charts under numeric tables; off for transcripts that are not the main session's. */
|
|
8
|
+
charts: boolean;
|
|
9
|
+
/** Shared inline-image budget for the figures. */
|
|
10
|
+
budget?: ImageBudget;
|
|
11
|
+
/** A figure's rows changed outside a text update (raster landed, fell back to code). */
|
|
12
|
+
onChange: () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Assistant Markdown whose top-level ```svg fences are lifted out of the prose
|
|
16
|
+
* and drawn as images ({@link SvgFigure}), and whose numeric tables get a chart
|
|
17
|
+
* drawn under them ({@link TableChartFigure}), with ordinary {@link Markdown}
|
|
18
|
+
* for the prose between them. Stands in for Markdown on an assistant text
|
|
19
|
+
* block that holds an svg fence or a chartable table: {@link setText} streams
|
|
20
|
+
* in place, reusing every part whose kind is unchanged, and
|
|
21
|
+
* {@link transientRenderCache} marks the block's tail as still streaming — the
|
|
22
|
+
* last prose run renders transient, the last figure throttles its rasters
|
|
23
|
+
* until its fence closes, and a table at the tail waits for its last row.
|
|
24
|
+
*/
|
|
25
|
+
export declare class FigureMarkdown extends Container {
|
|
26
|
+
#private;
|
|
27
|
+
constructor(text: string, options: FigureMarkdownOptions);
|
|
28
|
+
/** Replace the source; returns whether it changed. */
|
|
29
|
+
setText(text: string): boolean;
|
|
30
|
+
get transientRenderCache(): boolean;
|
|
31
|
+
set transientRenderCache(value: boolean);
|
|
32
|
+
/**
|
|
33
|
+
* The trimmed prose ahead of the first figure, or "" when the block opens
|
|
34
|
+
* with one. These are the only rows plain Markdown reproduces byte for
|
|
35
|
+
* byte, so they are all a transcript may publish ahead of the figure.
|
|
36
|
+
*/
|
|
37
|
+
get leadingProse(): string;
|
|
38
|
+
/** Whether a figure's final source still waits for its raster, or a chart for its pick or raster. */
|
|
39
|
+
get pending(): boolean;
|
|
40
|
+
/** Rebuild the prose runs through the Markdown factory after its theme changed; figures keep their rasters. */
|
|
41
|
+
restyle(): void;
|
|
42
|
+
}
|
|
@@ -64,7 +64,7 @@ export interface SkillPromptDetails {
|
|
|
64
64
|
* `ui-helpers.addMessageToChat` (renderers), `AgentHubOverlayComponent
|
|
65
65
|
* #buildTranscriptLines`, `runPrintMode`, and `AcpAgent#replayAssistantMessage`
|
|
66
66
|
* (fallback error emission) read it via `isSilentAbort`. */
|
|
67
|
-
export declare const SILENT_ABORT_MARKER = "
|
|
67
|
+
export declare const SILENT_ABORT_MARKER = "__zeta.silent_abort__";
|
|
68
68
|
/** Type-guard for silent aborts. Renderers MUST call this helper so structured
|
|
69
69
|
* `errorId` and legacy persisted marker messages stay in lockstep. */
|
|
70
70
|
export declare function isSilentAbort(message: Pick<AssistantMessage, "errorId" | "errorMessage">): boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ImageBudget } from "../components/image.js";
|
|
2
|
+
import { type Markdown } from "../components/markdown.js";
|
|
3
|
+
import type { Component } from "../tui.js";
|
|
4
|
+
/** The active theme's color per figure token, for resolving a figure with `prepareSvg`. */
|
|
5
|
+
export declare function svgFigurePalette(): Record<string, string>;
|
|
6
|
+
/** Turn lifting ```svg fences into images on or off (the host's `tui.renderSvg`); the host rebuilds the transcript after. */
|
|
7
|
+
export declare function setSvgFigureRendering(enabled: boolean): void;
|
|
8
|
+
/** Whether assistant ```svg fences render as images where the terminal can show them. */
|
|
9
|
+
export declare function svgFigureRendering(): boolean;
|
|
10
|
+
export interface SvgFigureOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Markdown for the fenced-code fallback shown when the final source does not
|
|
13
|
+
* render. Without it the figure decorates content shown elsewhere (a chart
|
|
14
|
+
* under its table): it stays blank until drawn, and when it cannot be.
|
|
15
|
+
*/
|
|
16
|
+
markdown?: (text: string) => Markdown;
|
|
17
|
+
/** Shared inline-image budget; superseded rasters are released from it. */
|
|
18
|
+
budget?: ImageBudget;
|
|
19
|
+
/** The figure's rows changed outside a text update: a raster landed or rendering fell back to code. */
|
|
20
|
+
onChange: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare class SvgFigure implements Component {
|
|
23
|
+
#private;
|
|
24
|
+
constructor(options: SvgFigureOptions);
|
|
25
|
+
/** Feed the fence body; `final` once the fence closed or the message stopped streaming. */
|
|
26
|
+
update(source: string, final: boolean): void;
|
|
27
|
+
/** Whether the final source still waits for its raster (or for failing to render). */
|
|
28
|
+
get pending(): boolean;
|
|
29
|
+
render(width: number): readonly string[];
|
|
30
|
+
invalidate(): void;
|
|
31
|
+
dispose(): void;
|
|
32
|
+
debugState(): Record<string, unknown>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-level handling of ```svg fences in assistant Markdown: splitting
|
|
3
|
+
* prose around them ({@link splitSvgFences}), turning a fence that is still
|
|
4
|
+
* streaming into a document an SVG parser accepts ({@link closePartialSvg}),
|
|
5
|
+
* and resolving the theme tokens figures color themselves with
|
|
6
|
+
* ({@link prepareSvg}). `FigureMarkdown` lifts the fences out as `SvgFigure`
|
|
7
|
+
* images.
|
|
8
|
+
*/
|
|
9
|
+
/** One run of an assistant text block: prose, or the body of a ```svg fence. */
|
|
10
|
+
export type FigureSegment = {
|
|
11
|
+
readonly kind: "markdown";
|
|
12
|
+
readonly text: string;
|
|
13
|
+
}
|
|
14
|
+
/** `closed` once the fence's closing line arrived. */
|
|
15
|
+
| {
|
|
16
|
+
readonly kind: "svg";
|
|
17
|
+
readonly source: string;
|
|
18
|
+
readonly closed: boolean;
|
|
19
|
+
};
|
|
20
|
+
/** Whether `markdown` holds a ```svg fence {@link splitSvgFences} would lift. */
|
|
21
|
+
export declare function hasSvgFence(markdown: string): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Split `markdown` into prose and ```svg fence bodies, in order. Only
|
|
24
|
+
* top-level fences lift; an svg fence nested in another fence, a list's
|
|
25
|
+
* indented block or a blockquote stays prose. Blank prose runs are dropped.
|
|
26
|
+
* An svg fence still open at the end is the last segment, `closed: false`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function splitSvgFences(markdown: string): FigureSegment[];
|
|
29
|
+
/**
|
|
30
|
+
* Turn a possibly truncated SVG source into a well-formed document: cut the
|
|
31
|
+
* trailing construct still being written (a tag without its `>`, an
|
|
32
|
+
* unterminated comment, CDATA section, processing instruction or declaration,
|
|
33
|
+
* a dangling `&entity`) and close every element left open, innermost first.
|
|
34
|
+
* A complete document passes through unchanged. Returns null until the root
|
|
35
|
+
* `<svg …>` start tag is complete — before that there is nothing to draw.
|
|
36
|
+
*/
|
|
37
|
+
export declare function closePartialSvg(source: string): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Make a figure's source what an SVG rasterizer draws as written, in the
|
|
40
|
+
* reader's theme. Rasterizers resolve neither CSS custom properties nor an
|
|
41
|
+
* inherited text color, and reject a root without the SVG namespace, so:
|
|
42
|
+
* - `var(--name)` / `var(--name, fallback)` become `palette[name]` (an
|
|
43
|
+
* unknown name takes its fallback, else `palette.fg`);
|
|
44
|
+
* - a root `<svg>` lacking them gets `color` = `palette.fg` (so
|
|
45
|
+
* `currentColor` follows the theme), a sans-serif `font-family` (instead
|
|
46
|
+
* of the rasterizer's Times), `xmlns`, and `xmlns:xlink` when the source
|
|
47
|
+
* uses `xlink:` attributes.
|
|
48
|
+
*/
|
|
49
|
+
export declare function prepareSvg(svg: string, palette: Readonly<Record<string, string>>): string;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { Tokens } from "@linxiraos/pi-utils/marked";
|
|
2
|
+
import { type ChartPlan } from "../charts/chart-plan.js";
|
|
3
|
+
import { type TableAnalysis } from "../charts/table-data.js";
|
|
4
|
+
import type { ImageBudget } from "../components/image.js";
|
|
5
|
+
import type { NativeNode } from "../native/node.js";
|
|
6
|
+
import type { Component } from "../tui.js";
|
|
7
|
+
/**
|
|
8
|
+
* `smart`: a model refines the local guess where meaning decides (kind,
|
|
9
|
+
* columns, row names, ordering, polarity, focus, title; see {@link shouldJudge});
|
|
10
|
+
* `always`: the local best guess charts every table it reads as numeric;
|
|
11
|
+
* `off`: tables stay tables.
|
|
12
|
+
*/
|
|
13
|
+
export type TableChartMode = "smart" | "always" | "off";
|
|
14
|
+
/** A table the host's planner picks a chart for ({@link shouldJudge}). */
|
|
15
|
+
export interface TableChartRequest {
|
|
16
|
+
/** The table's Markdown source. */
|
|
17
|
+
readonly markdown: string;
|
|
18
|
+
readonly table: TableAnalysis;
|
|
19
|
+
/** The local best guess; the planner may keep it. */
|
|
20
|
+
readonly guess: ChartPlan;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Picks the chart for a multi-series table under `smart`: a plan, or `null`
|
|
24
|
+
* for no chart. A rejection falls back to the local guess.
|
|
25
|
+
*/
|
|
26
|
+
export type TableChartPlanner = (request: TableChartRequest) => Promise<ChartPlan | null>;
|
|
27
|
+
/** A drawn chart, ready to resolve against the theme. */
|
|
28
|
+
export interface TableChart {
|
|
29
|
+
/** SVG colored with figure tokens (`var(--accent)`, …). */
|
|
30
|
+
readonly svg: string;
|
|
31
|
+
readonly alt: string;
|
|
32
|
+
/** Size in SVG user units. */
|
|
33
|
+
readonly width: number;
|
|
34
|
+
readonly height: number;
|
|
35
|
+
}
|
|
36
|
+
/** The chart under a table: drawn, none, or a smart pick on its way (the promise settles once the cache holds it). */
|
|
37
|
+
export type ChartLookup = TableChart | null | Promise<void>;
|
|
38
|
+
/** One run of a Markdown block: prose (ending at a charted table), or the chart drawn after that table. */
|
|
39
|
+
export type ChartSegment = {
|
|
40
|
+
readonly kind: "markdown";
|
|
41
|
+
readonly text: string;
|
|
42
|
+
} | {
|
|
43
|
+
readonly kind: "chart";
|
|
44
|
+
readonly table: Tokens.Table;
|
|
45
|
+
};
|
|
46
|
+
/** Set how tables become charts (the host's `tui.autoGraph`) and its `smart` planner; the host rebuilds the transcript after. */
|
|
47
|
+
export declare function setTableCharts(mode: TableChartMode, planner?: TableChartPlanner): void;
|
|
48
|
+
/** How assistant tables currently become charts. */
|
|
49
|
+
export declare function tableChartMode(): TableChartMode;
|
|
50
|
+
/** Whether `markdown` may hold a table {@link splitTableCharts} would chart. */
|
|
51
|
+
export declare function hasChartTable(markdown: string): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Split `markdown` after each top-level table that has (or may get) a chart.
|
|
54
|
+
* A table still streaming at the block's tail is left whole: rows may follow.
|
|
55
|
+
*/
|
|
56
|
+
export declare function splitTableCharts(markdown: string, streaming: boolean): ChartSegment[];
|
|
57
|
+
/**
|
|
58
|
+
* The chart for `table` under the current mode, read once per table source.
|
|
59
|
+
* Under `smart` the first lookup of a multi-series table asks the planner.
|
|
60
|
+
*/
|
|
61
|
+
export declare function lookupTableChart(table: Tokens.Table): ChartLookup;
|
|
62
|
+
/**
|
|
63
|
+
* A native `image` node drawing `chart` from its SVG — no raster — resolved
|
|
64
|
+
* against the active theme; rebuilt when the theme changes.
|
|
65
|
+
*/
|
|
66
|
+
export declare function describeTableChart(chart: TableChart, key: string): NativeNode;
|
|
67
|
+
export interface TableChartFigureOptions {
|
|
68
|
+
/** Shared inline-image budget. */
|
|
69
|
+
budget?: ImageBudget;
|
|
70
|
+
/** The chart's rows changed outside a text update: its pick or raster landed. */
|
|
71
|
+
onChange: () => void;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The chart under one table, as a terminal image a blank row below it. Looks
|
|
75
|
+
* the chart up on first render — a block rebuilt mid-stream never asks for a
|
|
76
|
+
* pick it drops — and renders nothing until it is drawn, or when the table
|
|
77
|
+
* gets no chart.
|
|
78
|
+
*/
|
|
79
|
+
export declare class TableChartFigure implements Component {
|
|
80
|
+
#private;
|
|
81
|
+
constructor(options: TableChartFigureOptions);
|
|
82
|
+
/** Point the figure at `table`. */
|
|
83
|
+
update(table: Tokens.Table): void;
|
|
84
|
+
/** Whether the chart is still being looked up, picked or drawn. */
|
|
85
|
+
get pending(): boolean;
|
|
86
|
+
render(width: number): readonly string[];
|
|
87
|
+
invalidate(): void;
|
|
88
|
+
dispose(): void;
|
|
89
|
+
}
|
|
@@ -90,6 +90,8 @@ export declare class ToolExecutionComponent extends Container {
|
|
|
90
90
|
* component-scoped so the TUI reuses every other root subtree (issue #4377).
|
|
91
91
|
*/
|
|
92
92
|
tickSpinner(frame: number): void;
|
|
93
|
+
/** Whether the result's figure still waits for its raster; the transcript holds retirement meanwhile. */
|
|
94
|
+
isTranscriptBlockPending(): boolean;
|
|
93
95
|
/**
|
|
94
96
|
* Whether this block is ready to retire as immutable history. Partial
|
|
95
97
|
* results, including detached background tasks, remain active and mutable
|