@linxiraos/pi-tui 1.4.10 → 1.4.12
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 +34 -237
- package/README.md +4 -1
- package/THIRD-PARTY-NOTICES.txt +99 -0
- package/dist/types/apps/shell-visualizer.d.ts +24 -0
- package/dist/types/autocomplete.d.ts +20 -0
- package/dist/types/chat/cache-invalidation-marker.d.ts +15 -7
- package/dist/types/chat/chat-transcript-builder.d.ts +5 -3
- package/dist/types/chat/display-preferences.d.ts +2 -0
- package/dist/types/chat/extension-types.d.ts +72 -1
- package/dist/types/chat/image-loading.d.ts +2 -2
- package/dist/types/chat/messages.d.ts +2 -3
- package/dist/types/chat/read-tool-group.d.ts +15 -2
- package/dist/types/chat/skill-message.d.ts +1 -0
- package/dist/types/chat/spotlight.d.ts +203 -0
- package/dist/types/chat/tool-execution.d.ts +26 -5
- package/dist/types/chat/transcript-actions.d.ts +11 -0
- package/dist/types/chat/transcript-browser.d.ts +9 -0
- package/dist/types/chat/transcript-presentation.d.ts +164 -0
- package/dist/types/chat/ttsr-notification.d.ts +2 -0
- package/dist/types/chrome/message-frame.d.ts +2 -0
- package/dist/types/chrome/transcript-container.d.ts +27 -6
- package/dist/types/components/loader.d.ts +0 -2
- package/dist/types/components/markdown.d.ts +11 -1
- package/dist/types/components/settings-list.d.ts +12 -2
- package/dist/types/frame-rate.d.ts +18 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/keybinding-matchers.d.ts +4 -1
- package/dist/types/kitty-graphics.d.ts +1 -1
- package/dist/types/motion-effects.d.ts +10 -0
- package/dist/types/native/encode.d.ts +2 -0
- package/dist/types/native/measure.d.ts +10 -0
- package/dist/types/native/overlay.d.ts +1 -1
- package/dist/types/native/quiet.d.ts +5 -0
- package/dist/types/native/reconcile.d.ts +6 -1
- package/dist/types/native/spans.d.ts +6 -0
- package/dist/types/native/state.d.ts +4 -0
- package/dist/types/overlays/agent-hub.d.ts +6 -0
- package/dist/types/overlays/link-browser.d.ts +55 -0
- package/dist/types/overlays/running-subagent-badge.d.ts +1 -4
- package/dist/types/overlays/settings-selector.d.ts +1 -1
- package/dist/types/overlays/snapcompact-shape-preview.d.ts +1 -1
- package/dist/types/overlays/spotlight-sheet.d.ts +36 -0
- package/dist/types/prompt/composer-attachments.d.ts +5 -2
- package/dist/types/prompt/composer-cache.d.ts +7 -2
- package/dist/types/prompt/composer.d.ts +6 -11
- package/dist/types/prompt/custom-editor.d.ts +8 -2
- package/dist/types/prompt/gradient-highlight.d.ts +2 -2
- package/dist/types/prompt/magic-keywords.d.ts +2 -0
- package/dist/types/prompt/model-mention-autocomplete.d.ts +9 -7
- package/dist/types/prompt/model-mention-syntax.d.ts +6 -0
- package/dist/types/prompt/prompt-action-autocomplete.d.ts +2 -1
- package/dist/types/prompt/welcome.d.ts +19 -0
- package/dist/types/render/extension-links.d.ts +0 -6
- package/dist/types/render/index.d.ts +1 -0
- package/dist/types/render/link-hints.d.ts +78 -0
- package/dist/types/render/render-utils.d.ts +0 -2
- package/dist/types/setup/scenes/types.d.ts +8 -0
- package/dist/types/setup/scenes/updates.d.ts +6 -0
- package/dist/types/setup/wizard.d.ts +7 -2
- package/dist/types/spinner-clock.d.ts +34 -0
- package/dist/types/status-line/component.d.ts +8 -4
- package/dist/types/status-line/host.d.ts +62 -0
- package/dist/types/status-line/index.d.ts +1 -0
- package/dist/types/status-line/prompt-cache.d.ts +14 -0
- package/dist/types/status-line/schema.d.ts +1 -1
- package/dist/types/status-line/startup.d.ts +6 -0
- package/dist/types/status-line/types.d.ts +8 -21
- package/dist/types/theme/schema.d.ts +28 -1
- package/dist/types/theme/symbols.d.ts +1 -1
- package/dist/types/theme/theme-class.d.ts +12 -2
- package/dist/types/theme/theme.d.ts +1 -1
- package/dist/types/theme/tui-adapters.d.ts +7 -0
- package/dist/types/thinking.d.ts +12 -0
- package/dist/types/tools/ask.d.ts +1 -1
- package/dist/types/tools/bash.d.ts +21 -0
- package/dist/types/tools/find.d.ts +9 -1
- package/dist/types/tools/grep.d.ts +2 -1
- package/dist/types/tools/grouped-file-output.d.ts +17 -0
- package/dist/types/tools/job-widget.d.ts +2 -2
- package/dist/types/tools/lsp.d.ts +4 -2
- package/dist/types/tools/native-view.d.ts +4 -0
- package/dist/types/tools/renderer.d.ts +9 -1
- package/dist/types/tools/shell-trace.d.ts +10 -0
- package/dist/types/tools/shell-viz-render.d.ts +6 -0
- package/dist/types/tools/shell-viz.d.ts +16 -0
- package/dist/types/tools/wait.d.ts +2 -2
- package/dist/types/tools/web-search-types.d.ts +1 -0
- package/dist/types/tools/write.d.ts +2 -0
- package/dist/types/tui.d.ts +15 -1
- package/package.json +15 -11
- package/src/apps/shell-visualizer.d.ts +24 -0
- package/src/apps/shell-visualizer.ts +167 -0
- package/src/autocomplete.d.ts +20 -0
- package/src/autocomplete.ts +14 -0
- package/src/chat/assistant-message.ts +11 -6
- package/src/chat/cache-invalidation-marker.d.ts +15 -7
- package/src/chat/cache-invalidation-marker.ts +18 -9
- package/src/chat/chat-transcript-builder.d.ts +5 -3
- package/src/chat/chat-transcript-builder.ts +16 -12
- package/src/chat/display-preferences.d.ts +2 -0
- package/src/chat/display-preferences.ts +3 -0
- package/src/chat/extension-types.d.ts +72 -1
- package/src/chat/extension-types.ts +74 -1
- package/src/chat/image-loading.d.ts +2 -2
- package/src/chat/image-loading.ts +2 -2
- package/src/chat/messages.d.ts +2 -3
- package/src/chat/messages.ts +3 -8
- package/src/chat/read-tool-group.d.ts +15 -2
- package/src/chat/read-tool-group.ts +201 -41
- package/src/chat/skill-message.d.ts +1 -0
- package/src/chat/skill-message.ts +4 -0
- package/src/chat/spotlight.d.ts +203 -0
- package/src/chat/spotlight.ts +460 -0
- package/src/chat/tool-execution.d.ts +26 -5
- package/src/chat/tool-execution.ts +360 -38
- package/src/chat/transcript-actions.d.ts +11 -0
- package/src/chat/transcript-actions.ts +13 -1
- package/src/chat/transcript-browser.d.ts +9 -0
- package/src/chat/transcript-browser.ts +18 -0
- package/src/chat/transcript-presentation.d.ts +164 -0
- package/src/chat/transcript-presentation.ts +642 -0
- package/src/chat/ttsr-notification.d.ts +25 -0
- package/src/chat/ttsr-notification.ts +5 -0
- package/src/chrome/message-frame.d.ts +2 -0
- package/src/chrome/message-frame.ts +7 -0
- package/src/chrome/message-notice.d.ts +58 -0
- package/src/chrome/transcript-container.d.ts +27 -6
- package/src/chrome/transcript-container.ts +317 -66
- package/src/components/editor.ts +25 -1
- package/src/components/loader.d.ts +0 -2
- package/src/components/loader.ts +30 -18
- package/src/components/markdown.d.ts +11 -1
- package/src/components/markdown.ts +41 -16
- package/src/components/settings-list.d.ts +12 -2
- package/src/components/settings-list.ts +29 -13
- package/src/frame-rate.d.ts +18 -0
- package/src/frame-rate.ts +36 -0
- package/src/hotkeys-markdown.ts +4 -1
- package/src/index.d.ts +3 -0
- package/src/index.ts +3 -0
- package/src/keybinding-matchers.d.ts +4 -1
- package/src/keybinding-matchers.ts +13 -12
- package/src/kitty-graphics.d.ts +1 -1
- package/src/kitty-graphics.ts +3 -2
- package/src/motion-effects.d.ts +10 -0
- package/src/motion-effects.ts +27 -0
- package/src/native/backend.ts +66 -7
- package/src/native/encode.d.ts +2 -0
- package/src/native/encode.ts +2 -0
- package/src/native/measure.d.ts +10 -0
- package/src/native/measure.ts +185 -0
- package/src/native/overlay.d.ts +1 -1
- package/src/native/overlay.ts +1 -1
- package/src/native/quiet.d.ts +5 -0
- package/src/native/quiet.ts +105 -0
- package/src/native/reconcile.d.ts +6 -1
- package/src/native/reconcile.ts +16 -10
- package/src/native/spans.d.ts +6 -0
- package/src/native/spans.ts +40 -0
- package/src/native/state.d.ts +4 -0
- package/src/native/state.ts +18 -0
- package/src/overlays/agent-hub.ts +15 -2
- package/src/overlays/ask-dialog.ts +1 -0
- package/src/overlays/btw-history-panel.ts +73 -6
- package/src/overlays/link-browser.ts +295 -0
- package/src/overlays/running-subagent-badge.ts +2 -9
- package/src/overlays/settings-defs.ts +2 -1
- package/src/overlays/settings-selector.ts +18 -4
- package/src/overlays/snapcompact-shape-preview.ts +1 -1
- package/src/overlays/spotlight-sheet.ts +478 -0
- package/src/overlays/usage-dashboard.ts +6 -5
- package/src/prompt/composer-attachments.d.ts +5 -2
- package/src/prompt/composer-attachments.ts +6 -6
- package/src/prompt/composer-cache.ts +17 -16
- package/src/prompt/composer.ts +30 -123
- package/src/prompt/custom-editor.ts +17 -13
- package/src/prompt/gradient-highlight.d.ts +2 -2
- package/src/prompt/gradient-highlight.ts +5 -4
- package/src/prompt/magic-keywords.d.ts +2 -0
- package/src/prompt/magic-keywords.ts +4 -1
- package/src/prompt/model-mention-autocomplete.ts +73 -20
- package/src/prompt/model-mention-syntax.d.ts +6 -0
- package/src/prompt/model-mention-syntax.ts +9 -0
- package/src/prompt/prompt-action-autocomplete.ts +49 -33
- package/src/prompt/tips.txt +1 -0
- package/src/prompt/welcome.ts +104 -2
- package/src/render/extension-links.d.ts +0 -6
- package/src/render/extension-links.ts +0 -20
- package/src/render/index.d.ts +1 -0
- package/src/render/index.ts +1 -0
- package/src/render/link-hints.d.ts +78 -0
- package/src/render/link-hints.ts +299 -0
- package/src/render/render-utils.d.ts +0 -2
- package/src/render/render-utils.ts +0 -5
- package/src/setup/scenes/glyph.ts +1 -1
- package/src/setup/scenes/types.ts +8 -0
- package/src/setup/scenes/updates.ts +116 -0
- package/src/setup/wizard.ts +19 -8
- package/src/spinner-clock.d.ts +34 -0
- package/src/spinner-clock.ts +79 -0
- package/src/status-line/component.ts +145 -53
- package/src/status-line/host.ts +51 -0
- package/src/status-line/index.ts +1 -0
- package/src/status-line/presets.ts +3 -1
- package/src/status-line/prompt-cache.ts +154 -0
- package/src/status-line/schema.ts +1 -1
- package/src/status-line/segments.ts +33 -22
- package/src/status-line/startup.ts +23 -5
- package/src/status-line/types.ts +8 -22
- package/src/stdin-buffer.ts +89 -46
- package/src/terminal-capabilities.ts +3 -3
- package/src/terminal.ts +1 -8
- package/src/theme/loader.ts +3 -2
- package/src/theme/schema-validation.ts +1 -1
- package/src/theme/schema.d.ts +28 -1
- package/src/theme/schema.ts +30 -1
- package/src/theme/symbols.d.ts +1 -1
- package/src/theme/symbols.ts +15 -3
- package/src/theme/theme-class.d.ts +12 -2
- package/src/theme/theme-class.ts +23 -0
- package/src/theme/theme-schema.json +1 -1
- package/src/theme/theme.d.ts +1 -1
- package/src/theme/theme.ts +3 -7
- package/src/theme/tui-adapters.d.ts +7 -0
- package/src/theme/tui-adapters.ts +33 -1
- package/src/thinking.d.ts +12 -0
- package/src/thinking.ts +31 -0
- package/src/tools/ask.d.ts +1 -1
- package/src/tools/ask.ts +99 -38
- package/src/tools/ast-edit.ts +51 -32
- package/src/tools/ast-grep.ts +31 -19
- package/src/tools/bash.d.ts +21 -0
- package/src/tools/bash.ts +166 -24
- package/src/tools/find.d.ts +9 -1
- package/src/tools/find.ts +23 -2
- package/src/tools/grep.d.ts +2 -1
- package/src/tools/grep.ts +52 -36
- package/src/tools/grouped-file-output.d.ts +17 -0
- package/src/tools/grouped-file-output.ts +20 -2
- package/src/tools/job-widget.d.ts +2 -2
- package/src/tools/job-widget.ts +2 -2
- package/src/tools/lsp.d.ts +4 -2
- package/src/tools/lsp.ts +537 -642
- package/src/tools/native-view.d.ts +4 -0
- package/src/tools/native-view.ts +8 -2
- package/src/tools/renderer.d.ts +9 -1
- package/src/tools/renderer.ts +9 -1
- package/src/tools/shell-trace.d.ts +10 -0
- package/src/tools/shell-trace.ts +80 -0
- package/src/tools/shell-viz-render.d.ts +6 -0
- package/src/tools/shell-viz-render.ts +156 -0
- package/src/tools/shell-viz.d.ts +16 -0
- package/src/tools/shell-viz.ts +181 -0
- package/src/tools/streaming-output.ts +18 -8
- package/src/tools/task.ts +1 -1
- package/src/tools/wait.d.ts +2 -2
- package/src/tools/wait.ts +39 -34
- package/src/tools/web-search-types.d.ts +1 -0
- package/src/tools/web-search-types.ts +1 -0
- package/src/tools/write.d.ts +2 -0
- package/src/tools/write.ts +2 -0
- package/src/tui.d.ts +15 -1
- package/src/tui.ts +63 -6
- package/src/windows-input-mode.ts +7 -1
- package/dist/types/chat/collab-prompt-message.d.ts +0 -14
- package/dist/types/chrome/collab-qrcode.d.ts +0 -35
- package/src/chat/collab-prompt-message.d.ts +0 -14
- package/src/chat/collab-prompt-message.ts +0 -46
- package/src/chrome/collab-qrcode.ts +0 -99
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension transcript presenters (`pi.registerTranscriptPresenter`). The host installs them with
|
|
3
|
+
* {@link setTranscriptPresenters}; each presentable block draws from its
|
|
4
|
+
* {@link TranscriptPresentationState}.
|
|
5
|
+
*/
|
|
6
|
+
import type { TspText } from "@linxiraos/pi-wire";
|
|
7
|
+
import { type Component, Container } from "../tui.js";
|
|
8
|
+
import { type DescribeContext, type NativeNode, type NativeUiEvent } from "../native/node.js";
|
|
9
|
+
import type { AnimationFrame, CompactTranscriptBlock } from "../chrome/transcript-container.js";
|
|
10
|
+
import type { TranscriptBlock, TranscriptPresentation, TranscriptPresenter } from "./extension-types.js";
|
|
11
|
+
import { type BashExecutionMessage, type CustomMessage, type HookMessage, type PythonExecutionMessage } from "./messages.js";
|
|
12
|
+
/** A block's presentation once every presenter has answered. */
|
|
13
|
+
export type ResolvedPresentation = {
|
|
14
|
+
readonly mode: "full";
|
|
15
|
+
} | {
|
|
16
|
+
readonly mode: "hidden";
|
|
17
|
+
} | {
|
|
18
|
+
readonly mode: "compact";
|
|
19
|
+
readonly label?: TspText;
|
|
20
|
+
readonly rows: readonly TspText[];
|
|
21
|
+
};
|
|
22
|
+
export type CompactPresentation = Extract<ResolvedPresentation, {
|
|
23
|
+
mode: "compact";
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Install the presenters the transcript draws with, in extension load order; true when the set
|
|
27
|
+
* changed. They are called as given: the installer guards them (the extension runner reports a
|
|
28
|
+
* throw or an unknown answer, and answers `"full"` instead).
|
|
29
|
+
*/
|
|
30
|
+
export declare function setTranscriptPresenters(next: readonly TranscriptPresenter[]): boolean;
|
|
31
|
+
/** An extension registered or disposed a presenter; the host installs the set again and refreshes. */
|
|
32
|
+
export declare function notifyTranscriptPresentersChanged(): void;
|
|
33
|
+
/** Call `listener` on {@link notifyTranscriptPresentersChanged}; returns the unsubscribe. */
|
|
34
|
+
export declare function onTranscriptPresentersChanged(listener: () => void): () => void;
|
|
35
|
+
/**
|
|
36
|
+
* Call `listener` when a block draws a presentation other than the one it last drew, outside a
|
|
37
|
+
* refresh (a late result, say): the host replays the scrollback when that block has rows in it.
|
|
38
|
+
* Returns the unsubscribe.
|
|
39
|
+
*/
|
|
40
|
+
export declare function onTranscriptPresentationRedrawn(listener: (owner: Component) => void): () => void;
|
|
41
|
+
/**
|
|
42
|
+
* A presenter's answer as plain data when it is a {@link TranscriptPresentation}; `null` for
|
|
43
|
+
* anything else (a misspelt mode, the Promise of an async presenter, a `compact` that is not a
|
|
44
|
+
* plain object), which draws the block in full. It reads every field the transcript uses once,
|
|
45
|
+
* so a throwing getter or Proxy in the answer throws here, inside the caller's guard, and never
|
|
46
|
+
* while drawing. Labels and rows that are not `TspText` are dropped.
|
|
47
|
+
*/
|
|
48
|
+
export declare function readTranscriptPresentation(answer: unknown): TranscriptPresentation | null;
|
|
49
|
+
/**
|
|
50
|
+
* One block's presentation, resolved lazily after {@link markStale}. The resolved object keeps
|
|
51
|
+
* its identity while the answer is the same, so it can sit in render memo keys.
|
|
52
|
+
*/
|
|
53
|
+
export declare class TranscriptPresentationState {
|
|
54
|
+
#private;
|
|
55
|
+
/**
|
|
56
|
+
* `snapshot` is the block presenters see (`undefined`: always full); `expanded` tells whether
|
|
57
|
+
* the user expanded it, which always draws it in full. `owner` is the transcript block it draws
|
|
58
|
+
* ({@link onTranscriptPresentationRedrawn} names it).
|
|
59
|
+
*/
|
|
60
|
+
constructor(snapshot: () => TranscriptBlock | undefined, expanded: () => boolean, owner?: Component);
|
|
61
|
+
/** The block's data changed: ask again before the next draw. */
|
|
62
|
+
markStale(): void;
|
|
63
|
+
/** What the block draws now. */
|
|
64
|
+
get shown(): ResolvedPresentation;
|
|
65
|
+
/** The last answer {@link shown} resolved, without asking the presenters again. */
|
|
66
|
+
get resolved(): ResolvedPresentation;
|
|
67
|
+
/** {@link shown}, for the block's render or description: what {@link refresh} compares against. */
|
|
68
|
+
draw(): ResolvedPresentation;
|
|
69
|
+
/**
|
|
70
|
+
* The block's data changed where nothing may draw it again (rows retired to scrollback): ask now,
|
|
71
|
+
* and report an answer other than the drawn one as {@link draw} would. What was drawn stays the
|
|
72
|
+
* baseline until the block draws again.
|
|
73
|
+
*/
|
|
74
|
+
recheck(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Ask again now when `ids` selects this block (every block when `undefined`); true when the
|
|
77
|
+
* answer differs from what the block last drew. A block in terminal scrollback is not drawn
|
|
78
|
+
* again, so a change its data made since (a late result) still counts. A change it reports is
|
|
79
|
+
* the caller's to redraw, so the next draw does not report it again.
|
|
80
|
+
*/
|
|
81
|
+
refresh(ids?: ReadonlySet<string>): boolean;
|
|
82
|
+
}
|
|
83
|
+
/** A transcript block whose display presenters choose. */
|
|
84
|
+
export interface TranscriptPresentable {
|
|
85
|
+
/**
|
|
86
|
+
* Ask again for the parts whose id is in `ids` (all when `undefined`); true when the drawing
|
|
87
|
+
* changed. True obliges the caller to redraw the block (and replay scrollback holding its rows):
|
|
88
|
+
* the change is not reported again.
|
|
89
|
+
*/
|
|
90
|
+
refreshTranscriptPresentation(ids?: ReadonlySet<string>): boolean;
|
|
91
|
+
}
|
|
92
|
+
export declare function isTranscriptPresentable(component: Component): component is Component & TranscriptPresentable;
|
|
93
|
+
/**
|
|
94
|
+
* A compact block's terminal rows: `• <head>` (the presenter's `label` replacing `head`), then one
|
|
95
|
+
* indented row per presenter row. Plain strings arrive sanitized (see `normalize`) and keep their
|
|
96
|
+
* spacing; span arrays are styled.
|
|
97
|
+
*/
|
|
98
|
+
export declare function compactRows(head: string, presentation: CompactPresentation, width: number, glyph?: string): string[];
|
|
99
|
+
/** omp's own one-row head: the bold title, then a muted detail (raw input, sanitized to one line). */
|
|
100
|
+
export declare function compactHead(title: string, detail?: string): string;
|
|
101
|
+
/** How a block names itself in a compact native card when its full drawing is not a `tool` node. */
|
|
102
|
+
export interface CompactNativeHead {
|
|
103
|
+
readonly role: string;
|
|
104
|
+
readonly title: string;
|
|
105
|
+
readonly target?: TspText;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A block's native drawing under `presentation`. Hidden stays mounted through the `hidden` prop.
|
|
109
|
+
* Compact folds a `tool` node to one inline, collapsed row (its toggle asks for the full block);
|
|
110
|
+
* any other drawing becomes the body of a collapsed card headed by `head`.
|
|
111
|
+
*/
|
|
112
|
+
export declare function presentNative(full: NativeNode, presentation: ResolvedPresentation, head: CompactNativeHead): NativeNode;
|
|
113
|
+
type WrappedTranscriptBlock = Exclude<TranscriptBlock, {
|
|
114
|
+
type: "toolCall";
|
|
115
|
+
}>;
|
|
116
|
+
/** The `message` block of a session message: its id is the decimal `timestamp`. */
|
|
117
|
+
export declare function messageBlock(message: CustomMessage | HookMessage | BashExecutionMessage | PythonExecutionMessage): WrappedTranscriptBlock;
|
|
118
|
+
/** A process-unique id for an `event` block. */
|
|
119
|
+
export declare function eventBlockId(kind: string): string;
|
|
120
|
+
/** Transcript hooks a wrapped component may have; the wrapper forwards the ones it has. */
|
|
121
|
+
interface WrappedComponent extends Component, CompactTranscriptBlock {
|
|
122
|
+
setExpanded?(expanded: boolean): void;
|
|
123
|
+
/**
|
|
124
|
+
* Whether the user expanded it, including through a nested disclosure no root toggle reports
|
|
125
|
+
* (the skill's `prompt`). True forces the block full, so it must default to false.
|
|
126
|
+
*/
|
|
127
|
+
isExpanded?(): boolean;
|
|
128
|
+
setToolActivityVisible?(visible: boolean): void;
|
|
129
|
+
isTranscriptBlockFinalized?(): boolean;
|
|
130
|
+
setTranscriptAllocation?(rows: number, frame: AnimationFrame): void;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* A non-tool transcript block (advisor, skill, late diagnostics, `!`/`$` run, background job,
|
|
134
|
+
* supervised process, TTSR, todo reminder) with the presenters' answer applied around the
|
|
135
|
+
* component that draws it. In full it draws and describes as `inner` does; expansion, native
|
|
136
|
+
* events, tool-activity visibility and finalization reach `inner`.
|
|
137
|
+
*/
|
|
138
|
+
export declare class PresentedBlock<T extends WrappedComponent = WrappedComponent> extends Container implements TranscriptPresentable {
|
|
139
|
+
#private;
|
|
140
|
+
readonly inner: T;
|
|
141
|
+
/** Only where `inner` has it: the transcript container detects tool activity by its presence. */
|
|
142
|
+
readonly setToolActivityVisible?: (visible: boolean) => void;
|
|
143
|
+
constructor(inner: T, block: WrappedTranscriptBlock);
|
|
144
|
+
get block(): WrappedTranscriptBlock;
|
|
145
|
+
/**
|
|
146
|
+
* The block's data changed (a `!`/`$` run was recorded, TTSR rules merged in). A block already
|
|
147
|
+
* in scrollback is not drawn again, so a changed answer is reported now for a one-time replay.
|
|
148
|
+
*/
|
|
149
|
+
setBlock(block: WrappedTranscriptBlock): void;
|
|
150
|
+
setExpanded(expanded: boolean): void;
|
|
151
|
+
/** The compact row's toggle, or `inner`'s own root toggle, expands the block. */
|
|
152
|
+
handleNativeEvent(event: NativeUiEvent): void;
|
|
153
|
+
refreshTranscriptPresentation(ids?: ReadonlySet<string>): boolean;
|
|
154
|
+
isTranscriptBlockFinalized(): boolean;
|
|
155
|
+
/** A squeezed compact block keeps its head and as many rows as fit; in full, `inner` decides. */
|
|
156
|
+
setTranscriptAllocation(rows: number, frame: AnimationFrame): void;
|
|
157
|
+
/** Compact while drawn as compact rows; in full, as compact as `inner` says. */
|
|
158
|
+
isTranscriptBlockCompact(): boolean;
|
|
159
|
+
/** The cached head row carries theme colours and glyphs. */
|
|
160
|
+
invalidate(): void;
|
|
161
|
+
render(width: number): readonly string[];
|
|
162
|
+
describe(cx: DescribeContext): NativeNode | null;
|
|
163
|
+
}
|
|
164
|
+
export {};
|
|
@@ -16,6 +16,8 @@ export declare class TtsrNotificationComponent extends Container {
|
|
|
16
16
|
#private;
|
|
17
17
|
constructor(rules: NotificationRule[]);
|
|
18
18
|
setToolActivityVisible(visible: boolean): void;
|
|
19
|
+
/** A snapshot: {@link addRules} grows the block's own list in place. */
|
|
20
|
+
get rules(): readonly NotificationRule[];
|
|
19
21
|
/** Merge additional rules into this block (deduped by rule name). */
|
|
20
22
|
addRules(rules: NotificationRule[]): void;
|
|
21
23
|
setExpanded(expanded: boolean): void;
|
|
@@ -59,4 +59,6 @@ export declare class FramedMessageComponent<M extends FramedMessage> extends Con
|
|
|
59
59
|
*/
|
|
60
60
|
describe(): NativeNode;
|
|
61
61
|
handleNativeEvent(event: NativeUiEvent): void;
|
|
62
|
+
/** Packs with neighboring compact blocks while the extension renderer's component reports compact rows. */
|
|
63
|
+
isTranscriptBlockCompact(): boolean;
|
|
62
64
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Component, Container, type HistoryBatch } from "../tui.js";
|
|
2
|
-
import type { NativeNode } from "../native/node.js";
|
|
2
|
+
import type { DescribeContext, NativeNode } from "../native/node.js";
|
|
3
3
|
/** Shared animation time supplied by the constrained transcript root. */
|
|
4
4
|
export interface AnimationFrame {
|
|
5
5
|
readonly tick: number;
|
|
@@ -42,6 +42,17 @@ export interface AppendOnlyTranscriptBlock {
|
|
|
42
42
|
*/
|
|
43
43
|
resetTranscriptStableRows?(): void;
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Lets a block pack against its neighbors. Two consecutive compact blocks
|
|
47
|
+
* (blocks that draw nothing between them don't count) have no blank separator
|
|
48
|
+
* row between them in the terminal, and a native (TSP) surface groups each
|
|
49
|
+
* such run into one gapless entry. The hook is read every frame, so a block
|
|
50
|
+
* may change its answer at any time (expanded, collapsed, re-presented).
|
|
51
|
+
*/
|
|
52
|
+
export interface CompactTranscriptBlock {
|
|
53
|
+
/** Whether the block's current presentation is compact rows. */
|
|
54
|
+
isTranscriptBlockCompact?(): boolean;
|
|
55
|
+
}
|
|
45
56
|
/**
|
|
46
57
|
* Block lifecycle:
|
|
47
58
|
* - `active`: still mutating; renders live and counts against tool admission.
|
|
@@ -156,17 +167,27 @@ export declare class TranscriptContainer extends Container {
|
|
|
156
167
|
*/
|
|
157
168
|
renderTail(width: number, maxRows: number): readonly string[];
|
|
158
169
|
/**
|
|
159
|
-
* The transcript's blocks for a native (TSP) surface, one
|
|
160
|
-
*
|
|
170
|
+
* The transcript's blocks for a native (TSP) surface, one `main` child
|
|
171
|
+
* per block in transcript order; ids follow component identity, so
|
|
161
172
|
* inserts, removals (rewind, displacement) and reorders become targeted ops.
|
|
162
173
|
* Finalized blocks are settled as a hint; they stay editable, so a later
|
|
163
174
|
* expansion, late result or reaction still reaches them wherever they sit.
|
|
175
|
+
* A block's {@link Component.nativeTrailers} follow it as blocks of their own.
|
|
164
176
|
* No retirement happens on this path: the whole transcript is one document.
|
|
165
|
-
*
|
|
177
|
+
*
|
|
178
|
+
* Each run of two or more consecutive compact blocks
|
|
179
|
+
* ({@link CompactTranscriptBlock}), with any blocks between them that
|
|
180
|
+
* describe nothing at `cx`, is one gapless entry whose members stay
|
|
181
|
+
* component children, keeping their own description, wire id and native
|
|
182
|
+
* events. A compact block's trailers are members of its run; a trailer of
|
|
183
|
+
* any other block is not. The entry is the same object while the same block
|
|
184
|
+
* leads the run, and it never settles: a member joining later may still be live.
|
|
185
|
+
*
|
|
186
|
+
* Returns the same array while the entries are unchanged.
|
|
166
187
|
*/
|
|
167
|
-
nativeBlocks(): readonly Component[];
|
|
188
|
+
nativeBlocks(cx: DescribeContext): readonly Component[];
|
|
168
189
|
/** Embedded as a child (transcript viewers): a stack of the {@link nativeBlocks}. */
|
|
169
|
-
describe(): NativeNode;
|
|
190
|
+
describe(cx: DescribeContext): NativeNode;
|
|
170
191
|
/** Full semantic render used by exports and non-terminal commands. */
|
|
171
192
|
render(width: number): readonly string[];
|
|
172
193
|
/** Rendered row where a child's block begins in the last full render() (transcript deep-links). */
|
|
@@ -3,8 +3,6 @@ import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node.
|
|
|
3
3
|
import { type ShimmerPalette } from "../theme/shimmer.js";
|
|
4
4
|
import type { TUI } from "../tui.js";
|
|
5
5
|
import { Text } from "./text.js";
|
|
6
|
-
/** Milliseconds between spinner-frame advances; exported so time-derived spinners elsewhere tick at the Loader cadence. */
|
|
7
|
-
export declare const SPINNER_ADVANCE_MS = 80;
|
|
8
6
|
/** A working-row variant (§6.5): a retry countdown, or context compaction. */
|
|
9
7
|
export type WorkingRowVariant = {
|
|
10
8
|
readonly kind: "retry";
|
|
@@ -138,7 +138,8 @@ export declare function getMarkdownLinkUrls(text: string): string[];
|
|
|
138
138
|
* Each function takes text and returns styled text with ANSI codes.
|
|
139
139
|
*/
|
|
140
140
|
export interface MarkdownTheme {
|
|
141
|
-
heading
|
|
141
|
+
/** Color a heading; `depth` is its level, 1–6. Bold/underline/`#` prefix are already applied. */
|
|
142
|
+
heading: (text: string, depth: number) => string;
|
|
142
143
|
link: (text: string) => string;
|
|
143
144
|
linkUrl: (text: string) => string;
|
|
144
145
|
/** Resolve the OSC 8 destination without changing visible text; undefined preserves the authored URL. */
|
|
@@ -154,6 +155,15 @@ export interface MarkdownTheme {
|
|
|
154
155
|
italic: (text: string) => string;
|
|
155
156
|
strikethrough: (text: string) => string;
|
|
156
157
|
underline: (text: string) => string;
|
|
158
|
+
/**
|
|
159
|
+
* Style `**strong**` spans, including their weight. Omitted → {@link bold}.
|
|
160
|
+
* A theme that colors them owns the span's foreground over a `proseFg` default.
|
|
161
|
+
*/
|
|
162
|
+
strong?: (text: string) => string;
|
|
163
|
+
/** Style `*emphasis*` spans, including their slant. Omitted → {@link italic}; colors win like {@link strong}. */
|
|
164
|
+
emphasis?: (text: string) => string;
|
|
165
|
+
/** Style table header cells, including their weight. Omitted → {@link bold}; colors win like {@link strong}. */
|
|
166
|
+
tableHeader?: (text: string) => string;
|
|
157
167
|
highlightCode?: (code: string, lang?: string) => string[];
|
|
158
168
|
/**
|
|
159
169
|
* Create a stateful incremental highlighter for one streaming code fence.
|
|
@@ -3,6 +3,8 @@ import type { TspPrefsControl, TspPrefsRow, TspPrefsSection } from "@linxiraos/p
|
|
|
3
3
|
import type { DescribeContext, NativeNode, NativeUiEvent } from "../native/node.js";
|
|
4
4
|
import type { Component } from "../tui.js";
|
|
5
5
|
import { FormField, type FormFieldOptions, type FormFieldTheme } from "./form.js";
|
|
6
|
+
/** Builds a row's editor from its current value; `done` closes it, with the value picked if one was. */
|
|
7
|
+
export type SettingEditor = (currentValue: string, done: (selectedValue?: string) => void) => Component;
|
|
6
8
|
export interface SettingItem {
|
|
7
9
|
/** Unique identifier for this setting */
|
|
8
10
|
id: string;
|
|
@@ -17,7 +19,12 @@ export interface SettingItem {
|
|
|
17
19
|
/** If provided, Enter/Space cycles through these values */
|
|
18
20
|
values?: string[];
|
|
19
21
|
/** If provided, Enter opens this submenu. Receives current value and done callback. */
|
|
20
|
-
submenu?:
|
|
22
|
+
submenu?: SettingEditor;
|
|
23
|
+
/**
|
|
24
|
+
* A `values` row's choices as a menu: a native settings page's popup button
|
|
25
|
+
* opens it ({@link SettingsList.openSubmenuFor}); Enter/Space still cycle.
|
|
26
|
+
*/
|
|
27
|
+
menu?: SettingEditor;
|
|
21
28
|
/** True when the displayed setting differs from its default value. */
|
|
22
29
|
changed?: boolean;
|
|
23
30
|
/** The default, as a native settings page names it in the changed dot's title. */
|
|
@@ -142,7 +149,10 @@ export declare class SettingsList implements Component {
|
|
|
142
149
|
prefsEditing(inlineMenu: (id: string) => boolean): PrefsEditing | null;
|
|
143
150
|
/** Applies `value` to a cycling (boolean/enum) row the way Enter does: the row shows it and `onChange` runs. */
|
|
144
151
|
applyValue(id: string, value: string): void;
|
|
145
|
-
/**
|
|
152
|
+
/**
|
|
153
|
+
* Opens row `id`'s submenu (a cycling row's `menu`) the way Enter opens a
|
|
154
|
+
* submenu, leaving one already open for it; returns it.
|
|
155
|
+
*/
|
|
146
156
|
openSubmenuFor(id: string): Component | undefined;
|
|
147
157
|
/** Resize the visible viewport (fullscreen hosts call this every render). */
|
|
148
158
|
setMaxVisible(rows: number): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The frame-rate ceiling (`tui.maxFps`): the render scheduler paints no closer than
|
|
3
|
+
* {@link minFrameIntervalMs}, except frames a keystroke is waiting on. Dependency-free: the host's
|
|
4
|
+
* flag table imports it during CLI bootstrap.
|
|
5
|
+
*/
|
|
6
|
+
/** Default ceiling, in frames per second (the historical scheduler cadence). */
|
|
7
|
+
export declare const DEFAULT_MAX_FPS = 30;
|
|
8
|
+
/** Shortest interval between two frames at the live ceiling, in milliseconds. */
|
|
9
|
+
export declare function minFrameIntervalMs(): number;
|
|
10
|
+
/** Set the ceiling; callers pass a value {@link parseMaxFps} accepted. Applies from the next scheduled frame. */
|
|
11
|
+
export declare function setMaxFps(next: number): void;
|
|
12
|
+
/**
|
|
13
|
+
* Canonicalize a configured ceiling: an integer from 1 to 120. Numeric strings are accepted so one
|
|
14
|
+
* parser serves the CLI flag, the environment variable, and the setting.
|
|
15
|
+
*
|
|
16
|
+
* @throws Error on a non-numeric, fractional, or out-of-range value.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseMaxFps(value: unknown): number;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -15,6 +15,9 @@ export * from "./components/layout/row.js";
|
|
|
15
15
|
export * from "./components/layout/split-pane.js";
|
|
16
16
|
export * from "./components/layout/stack.js";
|
|
17
17
|
export * from "./components/loader.js";
|
|
18
|
+
export * from "./spinner-clock.js";
|
|
19
|
+
export * from "./frame-rate.js";
|
|
20
|
+
export * from "./motion-effects.js";
|
|
18
21
|
export * from "./components/markdown.js";
|
|
19
22
|
export * from "./components/menu-selection.js";
|
|
20
23
|
export * from "./components/metric.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { KeyId } from "./app-keybindings.js";
|
|
2
|
+
import { type KeybindingsManager } from "./keybindings.js";
|
|
2
3
|
/**
|
|
3
4
|
* Match the coding-agent interrupt key.
|
|
4
5
|
*
|
|
@@ -38,8 +39,10 @@ export declare function matchesAppExternalEditor(data: string): boolean;
|
|
|
38
39
|
* effective follow-up binding.
|
|
39
40
|
*/
|
|
40
41
|
export declare function matchesAppFollowUp(data: string): boolean;
|
|
42
|
+
/** Effective follow-up keys: the `app.message.followUp` bindings, or Ctrl+Enter/Ctrl+Q when unbound. */
|
|
43
|
+
export declare function appFollowUpKeys(keybindings?: KeybindingsManager): readonly KeyId[];
|
|
41
44
|
/** Effective tool-approval keys: the `app.approval.approve` bindings, or Ctrl+Enter/Ctrl+Q when unbound. */
|
|
42
|
-
export declare function appApproveKeys(): readonly KeyId[];
|
|
45
|
+
export declare function appApproveKeys(keybindings?: KeybindingsManager): readonly KeyId[];
|
|
43
46
|
/** Match the tool-approval key, recognizing modifier-tagged LF as Ctrl+Enter like {@link matchesAppFollowUp}. */
|
|
44
47
|
export declare function matchesAppApprove(data: string): boolean;
|
|
45
48
|
/**
|
|
@@ -26,7 +26,7 @@ export interface KittyGraphicsFeatures {
|
|
|
26
26
|
* Whether the detected terminal renders Kitty Unicode placeholders (`U=1` +
|
|
27
27
|
* U+10EEEE with row/column diacritics).
|
|
28
28
|
*
|
|
29
|
-
* Kitty, Ghostty and
|
|
29
|
+
* Kitty, Ghostty, Otty and Tern advertise placeholder support directly. A multiplexer
|
|
30
30
|
* cannot use cursor-positioned placements because the outer terminal does not
|
|
31
31
|
* know pane scroll/reflow state. An explicit `PI_FORCE_IMAGE_PROTOCOL=kitty`
|
|
32
32
|
* opts into placeholders under any multiplexer — matching `timg -pk`.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decorative motion with no knob of its own — the status-line blink and brand fade, the editor's
|
|
3
|
+
* magic-keyword sweep, native `fx` spans — behind one switch the host's `tui.motion` preset drives.
|
|
4
|
+
*/
|
|
5
|
+
/** Whether decorative motion may run. */
|
|
6
|
+
export declare function motionEffectsEnabled(): boolean;
|
|
7
|
+
/** Enable or disable decorative motion. Timer-driven effects stop at their next frame. */
|
|
8
|
+
export declare function setMotionEffects(next: boolean): void;
|
|
9
|
+
/** Observe switch flips, for output nothing would otherwise re-describe; returns the unsubscribe. */
|
|
10
|
+
export declare function onMotionEffectsChange(listener: () => void): () => void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type TspEvent, type TspReply, type TspVerb } from "@linxiraos/pi-wire";
|
|
2
2
|
/** Every TSP message starts with this. */
|
|
3
3
|
export declare const TSP_PREFIX = "\u001B_tsp;";
|
|
4
|
+
/** TSP input framing through ConPTY, whose input parser discards APC. */
|
|
5
|
+
export declare const TSP_OSC_PREFIX = "\u001B]877;tsp;";
|
|
4
6
|
/** The terminal's hello reply. */
|
|
5
7
|
export type TspHello = Extract<TspReply, {
|
|
6
8
|
r: "hello";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Component } from "../tui.js";
|
|
2
|
+
import type { NativeChild, NativeNode } from "./node.js";
|
|
3
|
+
/** The last description of a component, or undefined when unknown. */
|
|
4
|
+
export type DescribedOf = (component: Component) => NativeNode | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* Estimated rows of `root` at `cols` cells wide, stopping once `limit` is
|
|
7
|
+
* reached (the result never exceeds it). Component children are measured
|
|
8
|
+
* through `described`.
|
|
9
|
+
*/
|
|
10
|
+
export declare function estimateRows(root: NativeChild, cols: number, limit: number, described: DescribedOf): number;
|
|
@@ -10,7 +10,7 @@ import type { TspProps, TspSpan, TspText } from "@linxiraos/pi-wire";
|
|
|
10
10
|
import { type KeyName } from "../key-hint-format.js";
|
|
11
11
|
import { type Keybinding } from "../keybindings.js";
|
|
12
12
|
import type { NativeChild, NativeNode } from "./node.js";
|
|
13
|
-
/** Below this many columns a centered sheet fills the pane instead of floating with margins. */
|
|
13
|
+
/** Below this many columns a centered sheet with tall content fills the pane instead of floating with margins. */
|
|
14
14
|
export declare const NARROW_SHEET_COLS = 100;
|
|
15
15
|
/** One footer hint: the keys that trigger it and what it does. */
|
|
16
16
|
export interface NativeHint {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { NativeNode } from "./node.js";
|
|
2
|
+
/** Forget cached translations; the backend calls this when a motion switch flips, then re-describes. */
|
|
3
|
+
export declare function resetQuietMotion(): void;
|
|
4
|
+
/** `node` as described, or with its terminal-clocked animations stilled per the motion switches. */
|
|
5
|
+
export declare function quietMotion(node: NativeNode): NativeNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TspOp } from "@linxiraos/pi-wire";
|
|
2
2
|
import { type Component } from "../tui.js";
|
|
3
|
-
import type { DescribeContext, NativeChild } from "./node.js";
|
|
3
|
+
import type { DescribeContext, NativeChild, NativeNode } from "./node.js";
|
|
4
4
|
/** The regions a frame fills. */
|
|
5
5
|
export interface NativeRegions {
|
|
6
6
|
readonly main: readonly NativeChild[];
|
|
@@ -41,6 +41,11 @@ export declare class Reconciler {
|
|
|
41
41
|
itemKey(id: string): string;
|
|
42
42
|
/** Wire id of the first `editor`/`input` `component` describes (for `focus`), or null. */
|
|
43
43
|
focusTarget(component: Component): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* The last description of `component` on this surface (a settled one only
|
|
46
|
+
* while still referenced elsewhere), or undefined when it isn't mounted.
|
|
47
|
+
*/
|
|
48
|
+
described(component: Component): NativeNode | undefined;
|
|
44
49
|
/** Stop referencing ids the terminal dropped (`gone`). */
|
|
45
50
|
forget(ids: readonly string[]): void;
|
|
46
51
|
}
|
|
@@ -17,5 +17,11 @@ export declare function styleSpans(content: string, style?: (text: string) => st
|
|
|
17
17
|
export declare function compactText(spans: readonly TspSpan[]): TspText;
|
|
18
18
|
/** Pre-rendered ANSI rows as one unwrapped text block (rows already carry their line breaks). */
|
|
19
19
|
export declare function rowsText(lines: readonly string[]): NativeNode;
|
|
20
|
+
/**
|
|
21
|
+
* Styled text as one ANSI terminal line: the reverse of {@link styledSpans}. Each span takes the
|
|
22
|
+
* last theme colour (or semantic colour token) in `s`, bold for `strong` and italic for `em`; text
|
|
23
|
+
* is sanitized like {@link plainText} and line breaks become spaces.
|
|
24
|
+
*/
|
|
25
|
+
export declare function spansLine(content: TspText): string;
|
|
20
26
|
/** Theme background token of the first SGR background in ANSI-styled text. */
|
|
21
27
|
export declare function styledBackground(styled: string): ThemeBg | undefined;
|
|
@@ -6,5 +6,9 @@ export declare function setNativeRendering(on: boolean): void;
|
|
|
6
6
|
export declare function nativeButtons(): boolean;
|
|
7
7
|
/** Called by the native backend when it adopts a `hello` reply and when it stops. */
|
|
8
8
|
export declare function setNativeButtons(on: boolean): void;
|
|
9
|
+
/** Whether a live surface's terminal paces streamed `md` (see {@link setNativePacing}). */
|
|
10
|
+
export declare function nativePacing(): boolean;
|
|
11
|
+
/** Called by the native backend when it adopts a `hello` reply and when it stops. */
|
|
12
|
+
export declare function setNativePacing(on: boolean): void;
|
|
9
13
|
/** Call `listener` whenever native rendering starts or stops; returns the unsubscribe. */
|
|
10
14
|
export declare function onNativeRenderingChange(listener: (on: boolean) => void): () => void;
|
|
@@ -56,6 +56,12 @@ export interface AgentHubDeps<TRecord extends AgentRecordLike = AgentRecordLike>
|
|
|
56
56
|
requestRender: () => void;
|
|
57
57
|
/** Registry supplying the roster. */
|
|
58
58
|
registry: AgentHubRegistry<TRecord>;
|
|
59
|
+
/**
|
|
60
|
+
* Whether a registry ref belongs to the open session's tree. The host registry
|
|
61
|
+
* outlives `/new` and session switches, so earlier sessions' agents stay
|
|
62
|
+
* registered; absent, every ref is listed.
|
|
63
|
+
*/
|
|
64
|
+
inSession?: (ref: AgentRecordLike) => boolean;
|
|
59
65
|
/** Resolve lifecycle actions lazily when a local action needs them. */
|
|
60
66
|
lifecycle: () => AgentLifecycleLike<TRecord>;
|
|
61
67
|
/** Host message bus supplying unread counts. */
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fullscreen extension link browser: the transcript replayed on the alternate screen, so links
|
|
3
|
+
* that have scrolled into terminal scrollback (which omp cannot draw over) can be picked too.
|
|
4
|
+
*
|
|
5
|
+
* Each extension link label ({@link extensionLinkLabels}) on the rows in view gets a hint tag that
|
|
6
|
+
* it keeps while it stays in view (see {@link LinkHints.update}); typing a whole tag, or a left click on
|
|
7
|
+
* a label, picks its link. Arrows, Page Up/Down, Home/End and the wheel scroll; Esc closes; other
|
|
8
|
+
* keys do nothing. The browser stays open after a pick, so an extension redrawing the reply
|
|
9
|
+
* ({@link LinkBrowserComponent.rerenderMessage}) is seen in place.
|
|
10
|
+
*
|
|
11
|
+
* The transcript is a snapshot taken when the browser opens: a reply still streaming shows as far
|
|
12
|
+
* as it had come. Like `/copy`, it replays the recent part of a long branch first, and the rest
|
|
13
|
+
* once the view scrolls to its top.
|
|
14
|
+
*/
|
|
15
|
+
import type { AgentTool } from "@linxiraos/pi-agent-core";
|
|
16
|
+
import type { AssistantTextRenderer, MessageRenderer } from "../chat/extension-types.js";
|
|
17
|
+
import { type TranscriptEntryLike as TranscriptEntry } from "../chat/transcript-entry.js";
|
|
18
|
+
import type { Component, TUI } from "../tui.js";
|
|
19
|
+
export interface LinkBrowserDeps {
|
|
20
|
+
ui: TUI;
|
|
21
|
+
getTool?: (name: string) => AgentTool | undefined;
|
|
22
|
+
/** Whether the active registry entry came from a built-in factory. */
|
|
23
|
+
isBuiltInTool?: (name: string) => boolean;
|
|
24
|
+
getMessageRenderer?: (customType: string) => MessageRenderer | undefined;
|
|
25
|
+
cwd: string;
|
|
26
|
+
hideThinkingBlock?: () => boolean;
|
|
27
|
+
proseOnlyThinking?: () => boolean;
|
|
28
|
+
expandThinkingBlocks?: () => boolean;
|
|
29
|
+
linkTargets?: ReadonlyMap<string, string>;
|
|
30
|
+
/** The extension assistant text renderers the transcript draws with, which may write the links. */
|
|
31
|
+
textRenderers: readonly AssistantTextRenderer[];
|
|
32
|
+
requestRender: () => void;
|
|
33
|
+
/** A link was picked: raise `link_activate` for `url`. */
|
|
34
|
+
onActivate: (url: string) => void;
|
|
35
|
+
onClose: () => void;
|
|
36
|
+
}
|
|
37
|
+
export declare class LinkBrowserComponent implements Component {
|
|
38
|
+
#private;
|
|
39
|
+
constructor(entries: TranscriptEntry[], deps: LinkBrowserDeps);
|
|
40
|
+
/**
|
|
41
|
+
* Whether the transcript draws any extension link at frame width `width`. The recent part is
|
|
42
|
+
* checked first; the whole branch is replayed only when that part has none.
|
|
43
|
+
*/
|
|
44
|
+
hasLinks(width: number): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Redraw the browser's copy of the reply sent at `timestamp`, re-running the text renderers;
|
|
47
|
+
* returns whether it holds one. The rows above it stay where they are on screen, and the links
|
|
48
|
+
* below it keep their tags on the rows they move to.
|
|
49
|
+
*/
|
|
50
|
+
rerenderMessage(timestamp: number): boolean;
|
|
51
|
+
invalidate(): void;
|
|
52
|
+
dispose(): void;
|
|
53
|
+
handleInput(data: string): void;
|
|
54
|
+
render(width: number): readonly string[];
|
|
55
|
+
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type AgentHubRegistry } from "./agent-hub-types.js";
|
|
2
|
-
export
|
|
3
|
-
agentRegistry: T;
|
|
4
|
-
}
|
|
5
|
-
export declare function getRunningSubagentBadgeRegistry<T extends AgentHubRegistry>(collabGuest: RunningSubagentRegistrySource<T> | undefined, localRegistry: T): T;
|
|
2
|
+
export declare function getRunningSubagentBadgeRegistry<T extends AgentHubRegistry>(localRegistry: T): T;
|
|
6
3
|
export declare function getRunningSubagentBadgeAgentIds(registry: AgentHubRegistry): string[];
|
|
7
4
|
/**
|
|
8
5
|
* Agents the Agent Hub roster can show (every registry ref but the main
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ThinkingLevel } from "@linxiraos/pi-agent-core";
|
|
2
2
|
import type { Effort } from "@linxiraos/pi-ai";
|
|
3
3
|
import { type Component, type ImageBudget } from "../index.js";
|
|
4
|
-
import type { ShapeTarget } from "@linxiraos/
|
|
4
|
+
import type { ShapeTarget } from "@linxiraos/zeta-compact";
|
|
5
5
|
import type { ContextLineMode, StatusLinePreset, StatusLineSegmentId, StatusLineSeparatorStyle } from "../status-line/schema.js";
|
|
6
6
|
import { type SettingsHost } from "./settings-defs.js";
|
|
7
7
|
import { type ComposerPreviewStatusSource } from "./composer-shape-preview.js";
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* line plus a dim notice.
|
|
14
14
|
*/
|
|
15
15
|
import { type Component, type ImageBudget } from "../index.js";
|
|
16
|
-
import { type ShapeTarget } from "@linxiraos/
|
|
16
|
+
import { type ShapeTarget } from "@linxiraos/zeta-compact";
|
|
17
17
|
import type { DescribeContext, NativeNode } from "../native/node.js";
|
|
18
18
|
export interface SnapcompactShapePreviewOptions {
|
|
19
19
|
/** Active model (api + id); resolves what `auto` maps to for this reader. */
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type SpotlightDetails, type SpotlightOriginal } from "../chat/spotlight.js";
|
|
2
|
+
import type { NativeNode, NativeUiEvent } from "../native/node.js";
|
|
3
|
+
import type { Component } from "../tui.js";
|
|
4
|
+
export interface SpotlightSheetOptions {
|
|
5
|
+
spotlight: SpotlightDetails & {
|
|
6
|
+
original: SpotlightOriginal;
|
|
7
|
+
};
|
|
8
|
+
/** The original text, as its artifact holds it. */
|
|
9
|
+
original: string;
|
|
10
|
+
/**
|
|
11
|
+
* The text the model saw, or of a held-out result the would-be text its `shapedUrl` holds (its lines label folds and
|
|
12
|
+
* give the shaping notes, through the trace's `map`).
|
|
13
|
+
*/
|
|
14
|
+
reduced: string;
|
|
15
|
+
close(): void;
|
|
16
|
+
}
|
|
17
|
+
export declare class SpotlightSheet implements Component {
|
|
18
|
+
#private;
|
|
19
|
+
readonly nativeOverlay: {
|
|
20
|
+
role: string;
|
|
21
|
+
head: string;
|
|
22
|
+
size: "lg";
|
|
23
|
+
anchor: "center";
|
|
24
|
+
};
|
|
25
|
+
constructor(options: SpotlightSheetOptions);
|
|
26
|
+
describe(): NativeNode;
|
|
27
|
+
render(width: number): string[];
|
|
28
|
+
invalidate(): void;
|
|
29
|
+
handleInput(data: string): void;
|
|
30
|
+
/** Close runs what Esc runs; the parameters' toggle shows every parameter or only the intent. */
|
|
31
|
+
handleNativeEvent(event: NativeUiEvent): void;
|
|
32
|
+
}
|
|
33
|
+
/** Whether a trace has an original to show. */
|
|
34
|
+
export declare function hasSpotlightOriginal(spotlight: SpotlightDetails): spotlight is SpotlightDetails & {
|
|
35
|
+
original: SpotlightOriginal;
|
|
36
|
+
};
|
|
@@ -22,9 +22,12 @@ export declare function modelChipStyle(label: string, restore?: string): string;
|
|
|
22
22
|
export declare function collapseSkillTokens(text: string, isKnown: (name: string) => boolean, register: (label: string, expansion: string) => void): string;
|
|
23
23
|
/**
|
|
24
24
|
* Replaces mentionable model selectors with their display chips and registers
|
|
25
|
-
* each chip's canonical selector as its atomic editor expansion.
|
|
25
|
+
* each chip's canonical `^selector` as its atomic editor expansion.
|
|
26
26
|
*/
|
|
27
|
-
export declare function collapseModelMentions(text: string,
|
|
27
|
+
export declare function collapseModelMentions(text: string, chipFor: (selector: string) => {
|
|
28
|
+
label: string;
|
|
29
|
+
selector: string;
|
|
30
|
+
} | undefined, register: (label: string, expansion: string) => void): string;
|
|
28
31
|
/** Compact atomic composer token for attachment `n` in the active symbol preset. */
|
|
29
32
|
export declare function chipLabel(kind: ChipKind, n: number): string;
|
|
30
33
|
/** Infers an attachment kind from a chip label emitted by any configured symbol preset. */
|
|
@@ -33,7 +33,12 @@ export declare class ComposerCache {
|
|
|
33
33
|
read(cwd: string): ComposerStartupCache;
|
|
34
34
|
/** Resolved theme and composer settings for the next prepaint. */
|
|
35
35
|
writeUi(cwd: string, preferences: ComposerPreferences, theme: ComposerThemePreferences): void;
|
|
36
|
-
/**
|
|
37
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Status-bar inputs for the next prepaint's startup status line. `shared: false`
|
|
38
|
+
* keeps them out of the any-project fallback (a project-scoped default model).
|
|
39
|
+
*/
|
|
40
|
+
writeStatus(cwd: string, status: ComposerStatusCache, options?: {
|
|
41
|
+
shared?: boolean;
|
|
42
|
+
}): void;
|
|
38
43
|
close(): void;
|
|
39
44
|
}
|