@linxiraos/pi-tui 1.1.27 → 1.2.1
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 +50 -461
- package/README.md +7 -5
- package/dist/types/app-keybindings.d.ts +1 -1
- 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 +2 -2
- 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 +5 -0
- package/dist/types/chat/chat-transcript-builder.d.ts +2 -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 +15 -2
- package/dist/types/chrome/shared.d.ts +9 -0
- 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 +15 -4
- package/dist/types/components/form.d.ts +1 -0
- package/dist/types/components/image.d.ts +12 -44
- 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/markdown.d.ts +36 -3
- 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 +1 -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/backend.d.ts +3 -2
- package/dist/types/native/blobs.d.ts +7 -3
- package/dist/types/native/encode.d.ts +3 -4
- package/dist/types/native/overlay.d.ts +5 -0
- 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 +2 -0
- package/dist/types/overlays/agent-transcript-viewer.d.ts +11 -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/history-search.d.ts +10 -0
- package/dist/types/overlays/hook-selector.d.ts +9 -4
- 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 +23 -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/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/usage-dashboard.d.ts +8 -4
- package/dist/types/overlays/usage-display.d.ts +3 -1
- package/dist/types/prompt/composer.d.ts +2 -7
- package/dist/types/prompt/custom-editor.d.ts +11 -8
- package/dist/types/prompt/image-source.d.ts +2 -1
- package/dist/types/prompt/interactive-context-helpers.d.ts +4 -1
- package/dist/types/prompt/model-mention-autocomplete.d.ts +1 -1
- package/dist/types/prompt/welcome.d.ts +19 -42
- 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/splash.d.ts +1 -1
- package/dist/types/setup/scenes/types.d.ts +1 -0
- package/dist/types/status-line/component.d.ts +3 -0
- 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 +27 -35
- package/dist/types/terminal-multiplexer.d.ts +127 -14
- package/dist/types/terminal.d.ts +22 -6
- 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/tmux.d.ts +11 -4
- 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 +0 -4
- package/dist/types/tools/write.d.ts +9 -2
- package/dist/types/tools/yield.d.ts +22 -0
- package/dist/types/tui.d.ts +31 -0
- package/dist/types/utils.d.ts +6 -0
- package/dist/types/vim.d.ts +19 -5
- package/package.json +13 -9
- package/src/app-keybindings.d.ts +1 -1
- package/src/app-keybindings.ts +1 -1
- 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 +26 -5
- package/src/apps/git/git-tui.ts +2 -2
- package/src/apps/git/help.ts +29 -20
- 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/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 +5 -0
- package/src/chat/assistant-message.ts +219 -50
- package/src/chat/chat-transcript-builder.d.ts +2 -0
- package/src/chat/chat-transcript-builder.ts +5 -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 +80 -6
- package/src/chat/user-message.d.ts +15 -2
- package/src/chat/user-message.ts +55 -3
- package/src/chrome/shared.ts +53 -0
- package/src/chrome/transcript-container.d.ts +6 -0
- package/src/chrome/transcript-container.ts +93 -13
- 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 +15 -4
- package/src/components/editor.ts +294 -46
- package/src/components/form.d.ts +1 -0
- package/src/components/form.ts +8 -0
- package/src/components/image.d.ts +12 -44
- package/src/components/image.ts +47 -151
- 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/markdown.d.ts +36 -3
- package/src/components/markdown.ts +433 -318
- 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 +1 -1
- package/src/fuzzy.d.ts +29 -1
- package/src/fuzzy.ts +115 -30
- package/src/key-hint-format.d.ts +1 -1
- package/src/key-hint-format.ts +1 -1
- 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 +4 -4
- 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/backend.d.ts +3 -2
- package/src/native/backend.ts +174 -18
- package/src/native/blobs.d.ts +7 -3
- package/src/native/blobs.ts +47 -12
- package/src/native/encode.d.ts +3 -4
- package/src/native/encode.ts +58 -31
- package/src/native/overlay.d.ts +5 -0
- package/src/native/overlay.ts +13 -0
- package/src/native/reconcile.ts +4 -0
- 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 +46 -31
- package/src/overlays/agent-transcript-viewer.ts +91 -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 +7 -10
- package/src/overlays/btw-history-panel.ts +12 -1
- package/src/overlays/copy-selector.ts +30 -8
- 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/jobs-panel.ts +28 -46
- package/src/overlays/model-browser.ts +341 -110
- package/src/overlays/model-hub.ts +300 -49
- package/src/overlays/move-overlay.ts +28 -14
- package/src/overlays/oauth-selector.ts +54 -70
- package/src/overlays/plan-review-overlay.ts +194 -70
- package/src/overlays/plugin-settings.ts +11 -5
- package/src/overlays/report-panel.ts +2 -2
- package/src/overlays/rewind-selector.ts +86 -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 +4 -3
- 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/tree-selector.ts +41 -20
- package/src/overlays/usage-dashboard.ts +100 -50
- package/src/overlays/usage-display.ts +10 -4
- package/src/prompt/attachment-chips.ts +15 -11
- package/src/prompt/composer-attachments.ts +6 -4
- package/src/prompt/composer-cache.ts +4 -6
- package/src/prompt/composer.ts +6 -37
- package/src/prompt/custom-editor.ts +54 -26
- package/src/prompt/image-source.ts +2 -1
- package/src/prompt/interactive-context-helpers.ts +30 -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/tips.txt +6 -5
- package/src/prompt/welcome.ts +235 -411
- 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 +11 -0
- 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/splash.ts +116 -53
- package/src/setup/scenes/types.ts +1 -0
- package/src/status-line/component.ts +292 -78
- 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 +27 -35
- package/src/terminal-capabilities.ts +75 -189
- package/src/terminal-multiplexer.d.ts +127 -14
- package/src/terminal-multiplexer.ts +112 -33
- package/src/terminal.d.ts +22 -6
- package/src/terminal.ts +139 -37
- 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 +6 -1
- 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/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.ts +92 -42
- 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 +149 -50
- package/src/tools/task.d.ts +0 -4
- package/src/tools/task.ts +112 -59
- 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 +31 -0
- package/src/tui.ts +309 -160
- 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.ts +8 -0
|
@@ -10,12 +10,17 @@ import {
|
|
|
10
10
|
renderKittyPlaceholderLines,
|
|
11
11
|
setKittyGraphics,
|
|
12
12
|
} from "./kitty-graphics";
|
|
13
|
-
import {
|
|
14
|
-
|
|
13
|
+
import {
|
|
14
|
+
isInsideTerminalMultiplexer,
|
|
15
|
+
routeTerminalMultiplexerNotification,
|
|
16
|
+
terminalMultiplexerForTerm,
|
|
17
|
+
terminalMultiplexerSessions,
|
|
18
|
+
} from "./terminal-multiplexer";
|
|
19
|
+
import { resolveTmuxClientTerminalName, wrapTmuxPassthroughIfNeeded } from "./tmux";
|
|
15
20
|
import type { HangulCompatibilityJamoWidth } from "./utils";
|
|
16
21
|
|
|
17
22
|
export * from "./terminal-multiplexer";
|
|
18
|
-
export {
|
|
23
|
+
export { wrapTmuxPassthrough } from "./tmux";
|
|
19
24
|
|
|
20
25
|
export enum ImageProtocol {
|
|
21
26
|
Kitty = "\x1b_G",
|
|
@@ -45,92 +50,6 @@ export type TerminalId =
|
|
|
45
50
|
| "base"
|
|
46
51
|
| "trueColor";
|
|
47
52
|
|
|
48
|
-
const CMUX_NOTIFICATION_TITLE = "zeta";
|
|
49
|
-
const CMUX_SURFACE_ID_PATTERN = /^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/iu;
|
|
50
|
-
|
|
51
|
-
/** Title and body for an out-of-band multiplexer notification (cmux, Herdr). */
|
|
52
|
-
function notificationTitleAndBody(message: string | TerminalNotification): { title: string; body: string } {
|
|
53
|
-
if (typeof message === "string") return { title: CMUX_NOTIFICATION_TITLE, body: message };
|
|
54
|
-
return { title: message.title?.trim() || CMUX_NOTIFICATION_TITLE, body: message.body ?? "" };
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Route a notification through cmux when the process belongs to a concrete
|
|
59
|
-
* surface. Workspace/socket state alone is not enough: only the injected
|
|
60
|
-
* surface UUID identifies the pane that should receive the notification.
|
|
61
|
-
* Returns whether cmux owns delivery so the caller can preserve every existing
|
|
62
|
-
* terminal fallback unchanged when no valid surface is present.
|
|
63
|
-
*/
|
|
64
|
-
function sendCmuxNotification(message: string | TerminalNotification, env: NodeJS.ProcessEnv = Bun.env): boolean {
|
|
65
|
-
const surfaceId = env.CMUX_SURFACE_ID?.trim();
|
|
66
|
-
if (!surfaceId || !CMUX_SURFACE_ID_PATTERN.test(surfaceId)) return false;
|
|
67
|
-
|
|
68
|
-
const { title, body } = notificationTitleAndBody(message);
|
|
69
|
-
try {
|
|
70
|
-
const child = Bun.spawn({
|
|
71
|
-
cmd: ["cmux", "notify", "--surface", surfaceId, "--title", title, "--body", body],
|
|
72
|
-
stdin: "ignore",
|
|
73
|
-
stdout: "ignore",
|
|
74
|
-
stderr: "ignore",
|
|
75
|
-
});
|
|
76
|
-
child.unref();
|
|
77
|
-
} catch {
|
|
78
|
-
// A missing cmux binary leaves delivery to the existing terminal fallback.
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
const HERDR_PANE_ID_PATTERN = /^[0-9A-Za-z:_-]{1,64}$/u;
|
|
85
|
-
/**
|
|
86
|
-
* `herdr notification show` takes the title as its first positional and reads
|
|
87
|
-
* exactly these three values there as a help request; it has no `--`
|
|
88
|
-
* terminator. Any other text, including one starting with `-`, is a title.
|
|
89
|
-
*/
|
|
90
|
-
const HERDR_USAGE_TOKENS = new Set(["help", "--help", "-h"]);
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Route a notification through Herdr when the process runs inside one of its
|
|
94
|
-
* panes. Herdr multiplexes panes like tmux but swallows bare OSC 9 / OSC 99 and
|
|
95
|
-
* has no DCS passthrough envelope, and its bell relay does not flag a
|
|
96
|
-
* backgrounded tab — so without this branch a backgrounded pane gets no signal
|
|
97
|
-
* at all that the agent finished or is waiting for input.
|
|
98
|
-
*
|
|
99
|
-
* `sound` maps the notification kind onto what Herdr offers: a question waiting
|
|
100
|
-
* on the user and a turn that stopped with an error both need the human and
|
|
101
|
-
* ring `request`, a settled turn rings `done`, anything else stays
|
|
102
|
-
* silent. Returns whether Herdr owns delivery, so every existing terminal
|
|
103
|
-
* fallback is preserved when the pane id is absent or the binary is missing.
|
|
104
|
-
*/
|
|
105
|
-
function sendHerdrNotification(message: string | TerminalNotification, env: NodeJS.ProcessEnv = Bun.env): boolean {
|
|
106
|
-
// Pane-only detection, like `isInsideHerdr`: an env-sanitizing launcher can
|
|
107
|
-
// drop HERDR_ENV and keep the pane identity, and that pane can still be
|
|
108
|
-
// backgrounded. The pane id itself is what the CLI needs, so it stays required.
|
|
109
|
-
if (!isInsideHerdr(env)) return false;
|
|
110
|
-
const paneId = env.HERDR_PANE_ID?.trim();
|
|
111
|
-
if (!paneId || !HERDR_PANE_ID_PATTERN.test(paneId)) return false;
|
|
112
|
-
|
|
113
|
-
const parsed = notificationTitleAndBody(message);
|
|
114
|
-
const title = HERDR_USAGE_TOKENS.has(parsed.title) ? CMUX_NOTIFICATION_TITLE : parsed.title;
|
|
115
|
-
const body = parsed.body;
|
|
116
|
-
const kinds = typeof message === "string" ? [] : [message.type ?? []].flat();
|
|
117
|
-
const sound =
|
|
118
|
-
kinds.includes("ask") || kinds.includes("error") ? "request" : kinds.includes("completion") ? "done" : "none";
|
|
119
|
-
try {
|
|
120
|
-
const child = Bun.spawn({
|
|
121
|
-
cmd: ["herdr", "notification", "show", title, "--body", body, "--sound", sound],
|
|
122
|
-
stdin: "ignore",
|
|
123
|
-
stdout: "ignore",
|
|
124
|
-
stderr: "ignore",
|
|
125
|
-
});
|
|
126
|
-
child.unref();
|
|
127
|
-
} catch {
|
|
128
|
-
// A missing herdr binary leaves delivery to the existing terminal fallback.
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
return true;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
53
|
const IMAGE_MARKER_SCAN_LIMIT = 512;
|
|
135
54
|
const SIXEL_MARKER_SCAN_LIMIT = 128;
|
|
136
55
|
const KITTY_PLACEHOLDER_HIGH_SURROGATE = KITTY_PLACEHOLDER.charCodeAt(0);
|
|
@@ -236,33 +155,16 @@ export class TerminalInfo {
|
|
|
236
155
|
|
|
237
156
|
sendNotification(message: string | TerminalNotification): void {
|
|
238
157
|
if (isNotificationSuppressed() || isTerminalHeadless()) return;
|
|
239
|
-
// Innermost surface first. A Herdr pane launched inside a cmux surface
|
|
240
|
-
// inherits both `HERDR_PANE_ID` and the outer `CMUX_SURFACE_ID`; routing to
|
|
241
|
-
// cmux there would flag the containing surface and leave the backgrounded
|
|
242
|
-
// Herdr pane — the one actually waiting — without a sound or a marker.
|
|
243
|
-
if (sendHerdrNotification(message)) return;
|
|
244
|
-
if (sendCmuxNotification(message)) return;
|
|
245
158
|
const formatted = this.formatNotification(message);
|
|
246
|
-
//
|
|
247
|
-
//
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
if (this.notifyProtocol !== NotifyProtocol.Bell && isInsideTmux()) {
|
|
256
|
-
writeTerminalSequence(`${wrapTmuxPassthrough(formatted)}\x07`);
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
// Zellij drops OSC 9/99 and has no DCS passthrough envelope, but raises its
|
|
260
|
-
// `[!]` bell flag on a bare BEL — the same backgrounded-pane signal tmux
|
|
261
|
-
// users get. So follow the (Zellij-swallowed) OSC with a plain BEL.
|
|
262
|
-
if (this.notifyProtocol !== NotifyProtocol.Bell && isInsideZellij()) {
|
|
263
|
-
writeTerminalSequence(`${formatted}\x07`);
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
159
|
+
// Multiplexers that swallow or rewrite the terminal's notification get it
|
|
160
|
+
// first, innermost target first; the terminal sequence is the fallback.
|
|
161
|
+
const routed = routeTerminalMultiplexerNotification({
|
|
162
|
+
message,
|
|
163
|
+
env: Bun.env,
|
|
164
|
+
sequence: this.notifyProtocol === NotifyProtocol.Bell ? null : formatted,
|
|
165
|
+
write: writeTerminalSequence,
|
|
166
|
+
});
|
|
167
|
+
if (routed) return;
|
|
266
168
|
writeTerminalSequence(formatted);
|
|
267
169
|
// VTE-family terminals (Ptyxis, GNOME Terminal, Tilix, …) plus Alacritty
|
|
268
170
|
// and bare xterm-on-Wayland have no in-band escape that surfaces an
|
|
@@ -276,15 +178,6 @@ export class TerminalInfo {
|
|
|
276
178
|
}
|
|
277
179
|
}
|
|
278
180
|
|
|
279
|
-
/**
|
|
280
|
-
* Whether the agent process is running inside a Zellij session. Read fresh on
|
|
281
|
-
* each call (like {@link isInsideTmux}) so a session attached/detached mid-run
|
|
282
|
-
* is observed and tests can toggle `Bun.env.ZELLIJ` per case.
|
|
283
|
-
*/
|
|
284
|
-
export function isInsideZellij(env: NodeJS.ProcessEnv = Bun.env): boolean {
|
|
285
|
-
return Boolean(env.ZELLIJ);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
181
|
/**
|
|
289
182
|
* Whether the agent process runs in an SSH session, so the terminal emulator
|
|
290
183
|
* is remote and host-local input/keyboard modes cannot be assumed.
|
|
@@ -381,12 +274,12 @@ function advertisesSynchronizedOutput(termFeatures: string | undefined): boolean
|
|
|
381
274
|
* 2. Positive `TERM_FEATURES` advertisement (`Sy`) — survives SSH/mux wrapping.
|
|
382
275
|
* 3. Windows Terminal (1.24+) via `WT_SESSION`, on native win32 and the
|
|
383
276
|
* WSL/SSH-fronted host alike.
|
|
384
|
-
* 4.
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
* composite as dirty-row patches — the live viewport tears, with
|
|
389
|
-
* frozen while only the bottom refreshes.
|
|
277
|
+
* 4. A multiplexer session whose pane VTE honors DEC 2026 regardless of its
|
|
278
|
+
* DECRQM reply (Herdr's libghostty pane). Such a multiplexer still owns
|
|
279
|
+
* the grid, so leaked kitty/ghostty identities cannot enable placeholder
|
|
280
|
+
* graphics, but leaving sync off lets CUP-diff paints and split write(2)
|
|
281
|
+
* chunks composite as dirty-row patches — the live viewport tears, with
|
|
282
|
+
* the top frozen while only the bottom refreshes.
|
|
390
283
|
* 5. Known direct terminals with confirmed support. SSH does *not* disable —
|
|
391
284
|
* DEC 2026 passes through SSH when the outer terminal honors it.
|
|
392
285
|
* 6. Everything else starts off, including risky multiplexers; the runtime
|
|
@@ -402,7 +295,7 @@ export function shouldEnableSynchronizedOutputByDefault(
|
|
|
402
295
|
|
|
403
296
|
if (advertisesSynchronizedOutput(env.TERM_FEATURES)) return true;
|
|
404
297
|
if (env.WT_SESSION && (!env.TERM_PROGRAM || env.TERM_PROGRAM.toLowerCase() === "windows_terminal")) return true;
|
|
405
|
-
if (
|
|
298
|
+
if (terminalMultiplexerSessions(env).some(multiplexer => multiplexer.honorsSynchronizedOutput)) return true;
|
|
406
299
|
|
|
407
300
|
// Risky multiplexers start off even when an inner terminal id leaks through:
|
|
408
301
|
// older tmux/screen synchronized-output handling is flaky and a mux may not
|
|
@@ -521,48 +414,35 @@ export function hyperlinksUserOverride(env: NodeJS.ProcessEnv = Bun.env): boolea
|
|
|
521
414
|
return null;
|
|
522
415
|
}
|
|
523
416
|
|
|
524
|
-
/**
|
|
525
|
-
* Parse tmux's self-reported version from `TERM_PROGRAM_VERSION`. tmux sets
|
|
526
|
-
* `TERM_PROGRAM=tmux` and `TERM_PROGRAM_VERSION=<version>` automatically since
|
|
527
|
-
* 3.2a; older releases (or any path that does not surface the version) yield
|
|
528
|
-
* `null` and the caller treats tmux conservatively.
|
|
529
|
-
*/
|
|
530
|
-
function parseTmuxVersionFromEnv(env: NodeJS.ProcessEnv): { major: number; minor: number } | null {
|
|
531
|
-
if (env.TERM_PROGRAM?.toLowerCase() !== "tmux") return null;
|
|
532
|
-
return parseMajorMinorVersion(env.TERM_PROGRAM_VERSION);
|
|
533
|
-
}
|
|
534
|
-
|
|
535
417
|
/**
|
|
536
418
|
* Whether OSC 8 hyperlinks should be enabled by default.
|
|
537
419
|
*
|
|
538
420
|
* Policy (highest precedence first):
|
|
539
421
|
* 1. Explicit user override (`PI_NO_HYPERLINKS=1` off, `PI_FORCE_HYPERLINKS=1`
|
|
540
422
|
* on). Opt-out wins ties.
|
|
541
|
-
* 2.
|
|
542
|
-
*
|
|
543
|
-
*
|
|
544
|
-
*
|
|
423
|
+
* 2. Every multiplexer session with a hyperlink policy renders OSC 8 itself
|
|
424
|
+
* (`render`, e.g. Herdr): on. Herdr hides the outer terminal
|
|
425
|
+
* (`TERM=xterm-256color`, no `TERM_PROGRAM`), so the outer terminal's
|
|
426
|
+
* support does not matter.
|
|
545
427
|
* 2b. Zeta workbench pane with no nested screen/tmux: on, for the same
|
|
546
428
|
* reason — the workbench's terminal simulator renders OSC 8 itself and
|
|
547
429
|
* opens links on Ctrl+click (`ZETA_WORKBENCH=1` is injected into every
|
|
548
430
|
* pane PTY; the outer terminal is invisible from inside).
|
|
549
431
|
* 3. Static terminal capability — terminals whose {@link TerminalInfo} marks
|
|
550
432
|
* `hyperlinks: false` (e.g. `base`) stay off unless the user forced on.
|
|
551
|
-
* 4.
|
|
552
|
-
*
|
|
553
|
-
* 5.
|
|
554
|
-
*
|
|
555
|
-
*
|
|
556
|
-
*
|
|
557
|
-
*
|
|
558
|
-
*
|
|
559
|
-
*
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
*
|
|
563
|
-
* 7.
|
|
564
|
-
* no version available, so off.
|
|
565
|
-
* 8. Otherwise honor the static terminal capability.
|
|
433
|
+
* 4. A session that never forwards OSC 8 (`drop`, e.g. GNU screen's `STY`)
|
|
434
|
+
* always off, even when a forwarding multiplexer is also present.
|
|
435
|
+
* 5. Forwarding sessions (`forward`, e.g. `TMUX`): enabled when every one
|
|
436
|
+
* self-reports at least its forwarding version via `TERM_PROGRAM` /
|
|
437
|
+
* `TERM_PROGRAM_VERSION` (tmux 3.4). Older or unknown versions stay off;
|
|
438
|
+
* on outer terminals without the feature configured, tmux silently drops
|
|
439
|
+
* the sequence. Checked before the TERM heuristic because tmux's
|
|
440
|
+
* historical `default-terminal` is `screen-256color`, so `TERM=screen*`
|
|
441
|
+
* inside a tmux session must NOT short-circuit to off.
|
|
442
|
+
* 6. TERM naming a multiplexer whose session markers were stripped: off,
|
|
443
|
+
* since no session proves the multiplexer forwards OSC 8 (screen never
|
|
444
|
+
* does; tmux has no version to check).
|
|
445
|
+
* 7. Otherwise honor the static terminal capability.
|
|
566
446
|
*/
|
|
567
447
|
export function shouldEnableHyperlinksByDefault(
|
|
568
448
|
env: NodeJS.ProcessEnv = Bun.env,
|
|
@@ -571,29 +451,29 @@ export function shouldEnableHyperlinksByDefault(
|
|
|
571
451
|
const override = hyperlinksUserOverride(env);
|
|
572
452
|
if (override !== null) return override;
|
|
573
453
|
|
|
574
|
-
|
|
454
|
+
const policies = terminalMultiplexerSessions(env).flatMap(multiplexer =>
|
|
455
|
+
multiplexer.hyperlinks === undefined ? [] : [multiplexer.hyperlinks],
|
|
456
|
+
);
|
|
457
|
+
if (policies.length > 0 && policies.every(policy => policy === "render")) return true;
|
|
575
458
|
|
|
576
459
|
if (isInsideZetaWorkbench(env) && !env.STY && !env.TMUX) return true;
|
|
577
460
|
|
|
578
461
|
if (!getTerminalInfo(terminalId).hyperlinks) return false;
|
|
579
462
|
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
if (
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
return version.major > 3 || (version.major === 3 && version.minor >= 4);
|
|
463
|
+
if (policies.includes("drop")) return false;
|
|
464
|
+
|
|
465
|
+
const forwarders = policies.flatMap(policy => (typeof policy === "object" ? [policy.forward] : []));
|
|
466
|
+
if (forwarders.length > 0) {
|
|
467
|
+
const termProgram = env.TERM_PROGRAM?.toLowerCase();
|
|
468
|
+
return forwarders.every(forward => {
|
|
469
|
+
if (termProgram !== forward.termProgram) return false;
|
|
470
|
+
const version = parseMajorMinorVersion(env.TERM_PROGRAM_VERSION);
|
|
471
|
+
if (!version) return false;
|
|
472
|
+
return version.major > forward.major || (version.major === forward.major && version.minor >= forward.minor);
|
|
473
|
+
});
|
|
592
474
|
}
|
|
593
475
|
|
|
594
|
-
|
|
595
|
-
if (term.startsWith("screen")) return false;
|
|
596
|
-
if (term.startsWith("tmux")) return false;
|
|
476
|
+
if (terminalMultiplexerForTerm(env)) return false;
|
|
597
477
|
|
|
598
478
|
return true;
|
|
599
479
|
}
|
|
@@ -667,10 +547,14 @@ export function resolveImageProtocol(
|
|
|
667
547
|
if (imageProtocol !== null && isPaseoEmbedder(env)) {
|
|
668
548
|
return null;
|
|
669
549
|
}
|
|
670
|
-
//
|
|
671
|
-
//
|
|
672
|
-
// can leak into the pane, so only the explicit
|
|
673
|
-
|
|
550
|
+
// Some multiplexers own the pane grid without exposing whether the attached
|
|
551
|
+
// client renders graphics (Herdr's experimental Kitty renderer). Outer-
|
|
552
|
+
// terminal identity variables can leak into the pane, so only the explicit
|
|
553
|
+
// protocol override is safe.
|
|
554
|
+
if (
|
|
555
|
+
imageProtocol !== null &&
|
|
556
|
+
terminalMultiplexerSessions(env).some(multiplexer => multiplexer.imagesRequireOverride)
|
|
557
|
+
) {
|
|
674
558
|
return null;
|
|
675
559
|
}
|
|
676
560
|
return imageProtocol;
|
|
@@ -1050,8 +934,7 @@ export function encodeKittyPlacement(options: {
|
|
|
1050
934
|
/**
|
|
1051
935
|
* Exact shape of the direct-placement line {@link Image} emits as its block's
|
|
1052
936
|
* last row: optional `ESC 7` + `CUU(rows-1)` prefix, the {@link encodeKittyPlacement}
|
|
1053
|
-
* APC, optional `ESC 8` suffix. tmux
|
|
1054
|
-
* not match (passthrough placements stay untouched).
|
|
937
|
+
* APC, optional `ESC 8` suffix. The parser unwraps tmux passthrough first.
|
|
1055
938
|
*/
|
|
1056
939
|
const KITTY_DIRECT_PLACEMENT_LINE =
|
|
1057
940
|
/^(?:\x1b7(?:\x1b\[(\d+)A)?)?\x1b_Ga=p,q=2,C=1,i=(\d+)(?:,p=(\d+))?(?:,c=(\d+))?(?:,r=(\d+))?\x1b\\(?:\x1b8)?$/;
|
|
@@ -1066,10 +949,15 @@ export interface ParsedKittyPlacementLine {
|
|
|
1066
949
|
/**
|
|
1067
950
|
* Parse a frame line that consists solely of a Kitty direct placement (the
|
|
1068
951
|
* last line of an {@link Image} block). Returns null for anything else —
|
|
1069
|
-
* placeholder grids,
|
|
952
|
+
* placeholder grids, sixel/iTerm2 payloads — so
|
|
1070
953
|
* callers fall back to writing the line verbatim.
|
|
1071
954
|
*/
|
|
1072
955
|
export function parseKittyDirectPlacementLine(line: string): ParsedKittyPlacementLine | null {
|
|
956
|
+
if (line.includes("\x1bPtmux;")) {
|
|
957
|
+
line = line.replace(/\x1bPtmux;((?:[^\x1b]|\x1b\x1b)*)\x1b\\/g, (_match, payload: string) =>
|
|
958
|
+
payload.replaceAll("\x1b\x1b", "\x1b"),
|
|
959
|
+
);
|
|
960
|
+
}
|
|
1073
961
|
const m = KITTY_DIRECT_PLACEMENT_LINE.exec(line);
|
|
1074
962
|
if (!m) return null;
|
|
1075
963
|
const columns = m[4] !== undefined ? Number(m[4]) : 0;
|
|
@@ -1114,9 +1002,7 @@ export function encodeKittyPlacementLine(options: {
|
|
|
1114
1002
|
const srcY = Math.floor((options.imageHeightPx * hiddenRows) / options.rows);
|
|
1115
1003
|
params.push(`y=${srcY}`, `h=${Math.max(1, options.imageHeightPx - srcY)}`);
|
|
1116
1004
|
}
|
|
1117
|
-
|
|
1118
|
-
// wrapped, never parses, and never reaches this rewrite.
|
|
1119
|
-
const apc = `\x1b_G${params.join(",")}\x1b\\`;
|
|
1005
|
+
const apc = wrapTmuxPassthroughIfNeeded(`\x1b_G${params.join(",")}\x1b\\`);
|
|
1120
1006
|
const cuu = visibleRows - 1;
|
|
1121
1007
|
return cuu > 0 ? `\x1b7\x1b[${cuu}A${apc}\x1b8` : apc;
|
|
1122
1008
|
}
|
|
@@ -1143,8 +1029,8 @@ export function encodeKittyDeleteAllImages(): string {
|
|
|
1143
1029
|
/**
|
|
1144
1030
|
* Delete a single placement of an image (`d=i`, lowercase): removes its cells
|
|
1145
1031
|
* and registry entry but keeps the transmitted data, so a later `a=p` under a
|
|
1146
|
-
* fresh placement id needs no retransmit.
|
|
1147
|
-
*
|
|
1032
|
+
* fresh placement id needs no retransmit. The frame writer uses this before
|
|
1033
|
+
* replacing a live image without deleting its archived copies.
|
|
1148
1034
|
*/
|
|
1149
1035
|
export function encodeKittyDeletePlacement(imageId: number, placementId: number): string {
|
|
1150
1036
|
return wrapTmuxPassthroughIfNeeded(`\x1b_Ga=d,d=i,i=${imageId},p=${placementId},q=2\x1b\\`);
|
|
@@ -1,20 +1,133 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function isInsideHerdr(env?: NodeJS.ProcessEnv): boolean;
|
|
3
|
-
/** Terminal multiplexers zeta recognizes as owning the screen grid. */
|
|
4
|
-
export type TerminalMultiplexer = "herdr" | "tmux" | "screen" | "zellij" | "cmux" | "wmux";
|
|
1
|
+
import type { TerminalMultiplexerModule, TerminalMultiplexerNotificationRequest } from "./multiplexers/types";
|
|
5
2
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
3
|
+
* Every multiplexer omp recognizes, in classification order within each
|
|
4
|
+
* precedence tier. Adding a multiplexer means adding its module here.
|
|
5
|
+
*/
|
|
6
|
+
declare const registry: readonly [{
|
|
7
|
+
readonly id: "herdr";
|
|
8
|
+
readonly precedence: "session";
|
|
9
|
+
readonly sessionEnvKeys: readonly ["HERDR_ENV", "HERDR_PANE_ID", "HERDR_TAB_ID", "HERDR_WORKSPACE_ID"];
|
|
10
|
+
readonly ownsScreenGrid: true;
|
|
11
|
+
readonly isInside: (env?: NodeJS.ProcessEnv) => boolean;
|
|
12
|
+
readonly notifier: {
|
|
13
|
+
readonly tier: "pane";
|
|
14
|
+
readonly send: ({ message, env }: TerminalMultiplexerNotificationRequest) => boolean;
|
|
15
|
+
};
|
|
16
|
+
readonly hyperlinks: "render";
|
|
17
|
+
readonly honorsSynchronizedOutput: true;
|
|
18
|
+
readonly imagesRequireOverride: true;
|
|
19
|
+
}, {
|
|
20
|
+
readonly id: "tmux";
|
|
21
|
+
readonly precedence: "session";
|
|
22
|
+
readonly sessionEnvKeys: readonly ["TMUX"];
|
|
23
|
+
readonly termPrefix: "tmux";
|
|
24
|
+
readonly ownsScreenGrid: true;
|
|
25
|
+
readonly isInside: (env?: NodeJS.ProcessEnv) => boolean;
|
|
26
|
+
readonly notifier: {
|
|
27
|
+
readonly tier: "inBand";
|
|
28
|
+
readonly send: ({ sequence, write }: TerminalMultiplexerNotificationRequest) => boolean;
|
|
29
|
+
};
|
|
30
|
+
readonly hyperlinks: {
|
|
31
|
+
readonly forward: {
|
|
32
|
+
readonly termProgram: "tmux";
|
|
33
|
+
readonly major: 3;
|
|
34
|
+
readonly minor: 4;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
readonly backgroundColorCache: {
|
|
38
|
+
readonly passthrough: typeof import("./tmux").wrapTmuxPassthrough;
|
|
39
|
+
readonly settleMs: 100;
|
|
40
|
+
};
|
|
41
|
+
readonly expandsRepPadding: true;
|
|
42
|
+
readonly expiresSynchronizedOutput: true;
|
|
43
|
+
readonly altRestoreEndsSynchronizedOutput: true;
|
|
44
|
+
readonly growsBeforeSigwinch: true;
|
|
45
|
+
}, {
|
|
46
|
+
readonly id: "screen";
|
|
47
|
+
readonly precedence: "session";
|
|
48
|
+
readonly sessionEnvKeys: readonly ["STY"];
|
|
49
|
+
readonly termPrefix: "screen";
|
|
50
|
+
readonly ownsScreenGrid: true;
|
|
51
|
+
readonly isInside: (env?: NodeJS.ProcessEnv) => boolean;
|
|
52
|
+
readonly hyperlinks: "drop";
|
|
53
|
+
}, {
|
|
54
|
+
readonly id: "zellij";
|
|
55
|
+
readonly precedence: "session";
|
|
56
|
+
readonly sessionEnvKeys: readonly ["ZELLIJ"];
|
|
57
|
+
readonly ownsScreenGrid: true;
|
|
58
|
+
readonly isInside: (env?: NodeJS.ProcessEnv) => boolean;
|
|
59
|
+
readonly notifier: {
|
|
60
|
+
readonly tier: "inBand";
|
|
61
|
+
readonly send: ({ sequence, write }: TerminalMultiplexerNotificationRequest) => boolean;
|
|
62
|
+
};
|
|
63
|
+
readonly backgroundQueryBrokenOn: readonly ["darwin"];
|
|
64
|
+
}, {
|
|
65
|
+
readonly id: "cmux";
|
|
66
|
+
readonly precedence: "session";
|
|
67
|
+
readonly sessionEnvKeys: readonly ["CMUX_WORKSPACE_ID", "CMUX_SURFACE_ID", "CMUX_REMOTE_TRANSPORT"];
|
|
68
|
+
readonly ownsScreenGrid: true;
|
|
69
|
+
readonly isInside: (env?: NodeJS.ProcessEnv) => boolean;
|
|
70
|
+
readonly notifier: {
|
|
71
|
+
readonly tier: "surface";
|
|
72
|
+
readonly send: ({ message, env }: TerminalMultiplexerNotificationRequest) => boolean;
|
|
73
|
+
};
|
|
74
|
+
}, {
|
|
75
|
+
readonly id: "wmux";
|
|
76
|
+
readonly precedence: "session";
|
|
77
|
+
readonly sessionEnvKeys: readonly ["WMUX", "WMUX_SURFACE_ID"];
|
|
78
|
+
readonly ownsScreenGrid: true;
|
|
79
|
+
readonly isInside: (env?: NodeJS.ProcessEnv) => boolean;
|
|
80
|
+
}, {
|
|
81
|
+
readonly id: "orca";
|
|
82
|
+
readonly precedence: "outerApp";
|
|
83
|
+
readonly sessionEnvKeys: readonly ["ORCA_PANE_KEY", "ORCA_WORKTREE_ID"];
|
|
84
|
+
readonly ownsScreenGrid: false;
|
|
85
|
+
readonly isInside: (env?: NodeJS.ProcessEnv) => boolean;
|
|
86
|
+
}];
|
|
87
|
+
/** Terminal multiplexers omp recognizes. */
|
|
88
|
+
export type TerminalMultiplexer = (typeof registry)[number]["id"];
|
|
89
|
+
/** Every environment variable multiplexer classification reads, including the TERM fallback. */
|
|
90
|
+
export declare const TERMINAL_MULTIPLEXER_ENV_KEYS: readonly string[];
|
|
91
|
+
/**
|
|
92
|
+
* Whether an explicit session marker identifies the current provider.
|
|
93
|
+
*
|
|
94
|
+
* TERM is intentionally excluded: it is a classification fallback, not proof
|
|
95
|
+
* that a particular multiplexer session owns the current grid.
|
|
96
|
+
*/
|
|
97
|
+
export declare function hasTerminalMultiplexerSession(multiplexer: TerminalMultiplexer, env?: NodeJS.ProcessEnv): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Every multiplexer whose explicit session markers are present, in registry
|
|
100
|
+
* order. Nested sessions all appear; TERM is not consulted.
|
|
101
|
+
*/
|
|
102
|
+
export declare function terminalMultiplexerSessions(env?: NodeJS.ProcessEnv): TerminalMultiplexerModule<TerminalMultiplexer>[];
|
|
103
|
+
/**
|
|
104
|
+
* The multiplexer TERM names, whether or not its session markers survived.
|
|
105
|
+
* This is classification's TERM fallback; session markers are not consulted.
|
|
106
|
+
*/
|
|
107
|
+
export declare function terminalMultiplexerForTerm(env?: NodeJS.ProcessEnv): TerminalMultiplexerModule<TerminalMultiplexer> | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Registry entry for the multiplexer hosting the current process, or
|
|
110
|
+
* `undefined` for a direct terminal. Same precedence as
|
|
111
|
+
* {@link classifyTerminalMultiplexer}.
|
|
112
|
+
*/
|
|
113
|
+
export declare function classifyTerminalMultiplexerModule(env?: NodeJS.ProcessEnv): TerminalMultiplexerModule<TerminalMultiplexer> | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Classify which terminal multiplexer hosts the current process, or `null` for
|
|
116
|
+
* a direct terminal. Single source of truth for both the render-path gate
|
|
8
117
|
* (`isInsideTerminalMultiplexer`) and the debug snapshot label.
|
|
9
118
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* overrides and can be set outside a CMUX/WMUX terminal. wmux is a Windows
|
|
15
|
-
* multiplexer (Electron + xterm.js) modeled on cmux/herdr that repaints its
|
|
16
|
-
* pane in place and exports WMUX=1 plus a native WMUX_SURFACE_ID.
|
|
119
|
+
* Session markers are authoritative. TERM can also survive when those markers
|
|
120
|
+
* are stripped (`sudo` without -E, `su`, env-sanitizing launchers/ssh), so a
|
|
121
|
+
* `tmux`/`screen` TERM prefix comes next. Outer applications such as Orca rank
|
|
122
|
+
* last so a multiplexer running inside them wins.
|
|
17
123
|
*/
|
|
18
124
|
export declare function classifyTerminalMultiplexer(env?: NodeJS.ProcessEnv): TerminalMultiplexer | null;
|
|
19
|
-
/** True when
|
|
125
|
+
/** True when the classified multiplexer owns the current screen grid. */
|
|
20
126
|
export declare function isInsideTerminalMultiplexer(env?: NodeJS.ProcessEnv): boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Offer a notification to every active session's notifier, innermost tier
|
|
129
|
+
* first. Returns whether one delivered it; otherwise the terminal fallback
|
|
130
|
+
* applies unchanged.
|
|
131
|
+
*/
|
|
132
|
+
export declare function routeTerminalMultiplexerNotification(request: TerminalMultiplexerNotificationRequest): boolean;
|
|
133
|
+
export {};
|