@oh-my-pi/pi-tui 18.3.2 → 18.3.4
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 +22 -0
- package/dist/types/app-keybindings.d.ts +2 -17
- package/dist/types/autocomplete.d.ts +18 -3
- package/dist/types/chrome/keybinding-hints.d.ts +16 -10
- package/dist/types/components/editor.d.ts +11 -0
- package/dist/types/key-hint-format.d.ts +29 -0
- package/dist/types/keys.d.ts +2 -1
- package/dist/types/overlays/agent-hub.d.ts +1 -1
- package/dist/types/overlays/agent-transcript-viewer.d.ts +1 -1
- package/dist/types/overlays/model-picker.d.ts +1 -3
- package/dist/types/prompt/composer-hints.d.ts +42 -0
- package/dist/types/prompt/composer.d.ts +2 -1
- package/dist/types/prompt/custom-editor.d.ts +8 -2
- package/dist/types/prompt/macos-spelling.d.ts +7 -16
- package/dist/types/prompt/prompt-action-autocomplete.d.ts +4 -1
- package/dist/types/prompt/prose-gate.d.ts +24 -0
- package/dist/types/prompt/word-completion.d.ts +46 -0
- package/dist/types/render/render-utils.d.ts +1 -1
- package/dist/types/theme/active-symbols.d.ts +12 -0
- package/dist/types/theme/symbols.d.ts +1 -1
- package/dist/types/theme/theme-class.d.ts +0 -1
- package/dist/types/tools/eval.d.ts +1 -1
- package/dist/types/tools/mcp.d.ts +3 -1
- package/dist/types/tools/task-yield-assembly.d.ts +10 -2
- package/dist/types/tools/task.d.ts +4 -0
- package/package.json +11 -10
- package/src/app-keybindings.ts +11 -104
- package/src/apps/autoresearch-dashboard.ts +10 -3
- package/src/apps/debug/log-viewer.ts +3 -2
- package/src/apps/debug/raw-sse.ts +2 -1
- package/src/apps/git/git-tui.ts +9 -5
- package/src/apps/live-visualizer.ts +2 -1
- package/src/apps/ps-top.ts +13 -4
- package/src/autocomplete.ts +42 -7
- package/src/chat/compaction-summary-message.ts +2 -1
- package/src/chat/execution-shared.ts +4 -2
- package/src/chat/tool-execution.ts +3 -1
- package/src/chat/ttsr-notification.ts +4 -3
- package/src/chat/user-message.ts +2 -2
- package/src/chrome/keybinding-hints.ts +38 -13
- package/src/components/editor.ts +180 -58
- package/src/components/settings-list.ts +10 -3
- package/src/components/tab-bar.ts +2 -1
- package/src/debug-server.ts +4 -1
- package/src/hotkeys-markdown.ts +14 -17
- package/src/key-hint-format.ts +122 -0
- package/src/keys.ts +2 -1
- package/src/overlays/advisor-config.ts +28 -6
- package/src/overlays/agent-hub.ts +8 -5
- package/src/overlays/agent-transcript-viewer.ts +6 -4
- package/src/overlays/agents-hub.ts +22 -8
- package/src/overlays/annotation-overlay.ts +31 -17
- package/src/overlays/ask-dialog.ts +14 -19
- package/src/overlays/bordered-loader.ts +2 -1
- package/src/overlays/btw-history-panel.ts +15 -12
- package/src/overlays/btw-panel.ts +12 -7
- package/src/overlays/cleanse-panel.ts +9 -6
- package/src/overlays/codex-reset-fireworks.ts +5 -3
- package/src/overlays/copy-selector.ts +13 -5
- package/src/overlays/extensions/extension-dashboard.ts +6 -1
- package/src/overlays/history-search.ts +3 -2
- package/src/overlays/hook-editor.ts +7 -2
- package/src/overlays/hook-input.ts +2 -1
- package/src/overlays/hook-selector.ts +5 -1
- package/src/overlays/login-dialog.ts +17 -4
- package/src/overlays/logout-account-selector.ts +10 -1
- package/src/overlays/mcp-add-wizard.ts +32 -20
- package/src/overlays/model-hub.ts +55 -28
- package/src/overlays/model-picker.ts +27 -12
- package/src/overlays/move-overlay.ts +5 -1
- package/src/overlays/omfg-panel.ts +8 -5
- package/src/overlays/pause-screen.ts +7 -3
- package/src/overlays/plan-review-overlay.ts +40 -14
- package/src/overlays/plan-save-overlay.ts +3 -1
- package/src/overlays/plugin-settings.ts +15 -8
- package/src/overlays/reset-usage-selector.ts +10 -3
- package/src/overlays/rewind-selector.ts +11 -5
- package/src/overlays/session-info-overlay.ts +4 -3
- package/src/overlays/session-selector.ts +12 -2
- package/src/overlays/settings-selector.ts +18 -11
- package/src/overlays/tree-selector.ts +27 -4
- package/src/overlays/usage-dashboard.ts +8 -2
- package/src/prompt/composer-cache.ts +2 -1
- package/src/prompt/composer-hints.ts +75 -0
- package/src/prompt/composer.ts +3 -2
- package/src/prompt/custom-editor.ts +22 -4
- package/src/prompt/macos-spelling.ts +17 -158
- package/src/prompt/prompt-action-autocomplete.ts +9 -2
- package/src/prompt/prose-gate.ts +87 -0
- package/src/prompt/tips.txt +6 -6
- package/src/prompt/welcome.ts +35 -2
- package/src/prompt/word-completion.ts +205 -0
- package/src/render/render-utils.ts +4 -4
- package/src/setup/scenes/composer.ts +5 -1
- package/src/setup/scenes/model.ts +3 -1
- package/src/setup/scenes/providers.ts +4 -1
- package/src/setup/scenes/sign-in.ts +4 -2
- package/src/setup/scenes/splash.ts +9 -4
- package/src/setup/scenes/theme.ts +18 -5
- package/src/setup/wizard-overlay.ts +5 -4
- package/src/theme/active-symbols.ts +20 -0
- package/src/theme/glyph-bundle.json +28 -1
- package/src/theme/symbols.ts +88 -6
- package/src/theme/theme-class.ts +0 -1
- package/src/theme/theme.ts +2 -0
- package/src/tools/bash-interactive.ts +2 -1
- package/src/tools/eval.ts +3 -3
- package/src/tools/mcp.ts +3 -1
- package/src/tools/task-yield-assembly.ts +34 -8
- package/src/tools/task.ts +14 -5
- package/dist/types/overlays/tiny-title-download-progress.d.ts +0 -21
- package/src/overlays/tiny-title-download-progress.ts +0 -102
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [18.3.3] - 2026-09-27
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added responsive ghost-text word completion with pluggable backend providers, context-aware prose filtering, and feedback support.
|
|
10
|
+
- Improved autocomplete responsiveness for high-latency file discovery by showing interim suggestions and a searching state while results are refreshed.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Improved word-completion acceptance and persistence when typing through existing ghost text, including more natural handling of trailing spaces and punctuation.
|
|
15
|
+
- Made keyboard labels across the TUI platform-aware so shortcuts are displayed using the appropriate key names for the user's operating system.
|
|
16
|
+
- Updated the process monitor to distinguish target scope from current and global scope in its labels.
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Fixed autocomplete submission so Enter commits the current input correctly while suggestions are still loading.
|
|
21
|
+
- Fixed the background tint for truncated skip lines.
|
|
22
|
+
|
|
23
|
+
### Removed
|
|
24
|
+
|
|
25
|
+
- Removed the legacy TinyTitleDownloadProgress overlay in favor of the centralized agent HUD.
|
|
26
|
+
|
|
5
27
|
## [18.3.1] - 2026-09-25
|
|
6
28
|
|
|
7
29
|
### Breaking Changes
|
|
@@ -372,24 +372,9 @@ export declare class KeybindingsManager extends TuiKeybindingsManager {
|
|
|
372
372
|
* Get the effective resolved bindings (defaults + user overrides).
|
|
373
373
|
*/
|
|
374
374
|
getEffectiveConfig(): KeybindingsConfig;
|
|
375
|
-
/**
|
|
376
|
-
* Get display string for a keybinding (e.g., "ctrl+c/escape").
|
|
377
|
-
*/
|
|
375
|
+
/** Display string for a keybinding's keys (see {@link formatKeyHints}); empty when unbound. */
|
|
378
376
|
getDisplayString(keybinding: Keybinding): string;
|
|
379
377
|
}
|
|
380
|
-
|
|
381
|
-
export declare function setKeyHintPlatform(platform: NodeJS.Platform | undefined): void;
|
|
382
|
-
/** Platform currently used for key-hint rendering. */
|
|
383
|
-
export declare function keyHintPlatform(): NodeJS.Platform;
|
|
384
|
-
type Modifier = "ctrl" | "shift" | "alt" | "super";
|
|
385
|
-
/**
|
|
386
|
-
* Human label for a modifier, using each platform's own key names. `ctrl` and
|
|
387
|
-
* `shift` are the same everywhere; `alt`/`super` become `Option`/`Cmd` on macOS.
|
|
388
|
-
*/
|
|
389
|
-
export declare function modifierLabel(mod: Modifier, platform?: NodeJS.Platform): string;
|
|
390
|
-
/** Format a key chord with human-readable, platform-aware modifier labels. */
|
|
391
|
-
export declare function formatKeyHint(key: KeyId): string;
|
|
392
|
-
/** Format alternative key chords as slash-separated human-readable hints. */
|
|
393
|
-
export declare function formatKeyHints(keys: KeyId | KeyId[]): string;
|
|
378
|
+
export * from "./key-hint-format.js";
|
|
394
379
|
export type { Keybinding, KeybindingsConfig, KeyId };
|
|
395
380
|
export { migrateKeybindingsConfigFile };
|
|
@@ -15,6 +15,12 @@ export declare function findTrailingSlashCommandStart(text: string): number | nu
|
|
|
15
15
|
export declare function isDirectoryCompletionValue(value: string): boolean;
|
|
16
16
|
/** Ranked-tier subsequence match ("wig" ~ "skill:wig"); distinct from fuzzy.ts's word-local engine. */
|
|
17
17
|
export declare function subsequenceMatch(query: string, target: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether an `@` file completion `value` still fits the live `@` token.
|
|
20
|
+
* The editor narrows a stale `@` list with this while a fresh search runs;
|
|
21
|
+
* mirrors the subsequence filter `getSuggestions` applies to fuzzy results.
|
|
22
|
+
*/
|
|
23
|
+
export declare function atCompletionMatches(token: string, value: string): boolean;
|
|
18
24
|
/** Ranked-tier subsequence score (100/80/60/40−gaps·5); higher is better, 0 is no match. */
|
|
19
25
|
export declare function subsequenceScore(query: string, target: string): number;
|
|
20
26
|
export interface AutocompleteItem {
|
|
@@ -43,8 +49,14 @@ export interface SlashCommand {
|
|
|
43
49
|
getInlineHint?(argumentText: string): string | null;
|
|
44
50
|
}
|
|
45
51
|
export interface AutocompleteProvider {
|
|
46
|
-
/**
|
|
47
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Get autocomplete suggestions for current text/cursor position. Expensive providers SHOULD stop when `signal` aborts.
|
|
54
|
+
* Slow providers MAY report interim suggestions through `onPartial` before resolving; the resolved value supersedes them.
|
|
55
|
+
*/
|
|
56
|
+
getSuggestions(lines: string[], cursorLine: number, cursorCol: number, signal?: AbortSignal, onPartial?: (suggestions: {
|
|
57
|
+
items: AutocompleteItem[];
|
|
58
|
+
prefix: string;
|
|
59
|
+
}) => void): Promise<{
|
|
48
60
|
items: AutocompleteItem[];
|
|
49
61
|
prefix: string;
|
|
50
62
|
} | null>;
|
|
@@ -114,7 +126,10 @@ export declare function midPromptSkillTokenMatches(lowerToken: string, name: str
|
|
|
114
126
|
export declare class CombinedAutocompleteProvider implements AutocompleteProvider {
|
|
115
127
|
#private;
|
|
116
128
|
constructor(commands?: CommandEntry[], basePath?: string, options?: CombinedAutocompleteOptions);
|
|
117
|
-
getSuggestions(lines: string[], cursorLine: number, cursorCol: number, signal?: AbortSignal
|
|
129
|
+
getSuggestions(lines: string[], cursorLine: number, cursorCol: number, signal?: AbortSignal, onPartial?: (suggestions: {
|
|
130
|
+
items: AutocompleteItem[];
|
|
131
|
+
prefix: string;
|
|
132
|
+
}) => void): Promise<{
|
|
118
133
|
items: AutocompleteItem[];
|
|
119
134
|
prefix: string;
|
|
120
135
|
} | null>;
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utilities for formatting keybinding hints in the UI.
|
|
3
3
|
*/
|
|
4
|
-
import { type Keybinding } from "../keybindings.js";
|
|
5
|
-
import { type AppKeybinding, type KeybindingsManager } from "../app-keybindings.js";
|
|
4
|
+
import { type KeyId, type Keybinding } from "../keybindings.js";
|
|
5
|
+
import { type AppKeybinding, type KeyName, type KeybindingsManager } from "../app-keybindings.js";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Primary (first) key bound to an editor action, formatted for footer hints;
|
|
8
|
+
* empty when unbound. Full alternatives: `formatKeyHints(getKeybindings().getKeys(action))`.
|
|
8
9
|
*/
|
|
9
10
|
export declare function editorKey(action: Keybinding): string;
|
|
11
|
+
/** Primary keys of several actions, slash-joined: `editorKeys("tui.select.up", "tui.select.down")` → `↑/↓`. */
|
|
12
|
+
export declare function editorKeys(...actions: Keybinding[]): string;
|
|
10
13
|
/**
|
|
11
|
-
*
|
|
14
|
+
* Keys bound to `action`, or `fallback` when the active registry has none — a
|
|
15
|
+
* TUI-only registry carries no `app.*` bindings. Mirrors the fallbacks in
|
|
16
|
+
* `keybinding-matchers.ts`, so hints name the keys the matcher accepts.
|
|
12
17
|
*/
|
|
18
|
+
export declare function boundKeys(action: Keybinding, fallback: readonly KeyId[]): readonly KeyId[];
|
|
19
|
+
/** Primary interrupt key (`app.interrupt`, raw Escape when unbound, as `matchesAppInterrupt`). */
|
|
20
|
+
export declare function interruptKey(): string;
|
|
21
|
+
/** Primary key bound to an app action (see {@link editorKey}); all keys: `getDisplayString`. */
|
|
13
22
|
export declare function appKey(keybindings: KeybindingsManager, action: AppKeybinding): string;
|
|
14
23
|
/**
|
|
15
24
|
* Format a keybinding hint with consistent styling: dim key, muted description.
|
|
@@ -31,10 +40,7 @@ export declare function keyHint(action: Keybinding, description: string): string
|
|
|
31
40
|
*/
|
|
32
41
|
export declare function appKeyHint(keybindings: KeybindingsManager, action: AppKeybinding, description: string): string;
|
|
33
42
|
/**
|
|
34
|
-
* Format a
|
|
35
|
-
*
|
|
36
|
-
* @param key - Raw key string
|
|
37
|
-
* @param description - Description text
|
|
38
|
-
* @returns Formatted string with dim key and muted description
|
|
43
|
+
* Format a hint for fixed (non-configurable) keys, e.g. `rawKeyHint(["up", "down"], "navigate")`.
|
|
44
|
+
* Alternatives render slash-separated (see {@link formatKeyHints}).
|
|
39
45
|
*/
|
|
40
|
-
export declare function rawKeyHint(
|
|
46
|
+
export declare function rawKeyHint(keys: KeyName | readonly KeyName[], description: string): string;
|
|
@@ -53,6 +53,12 @@ export interface EditorTextDecorationContext {
|
|
|
53
53
|
export interface EditorTextAssistProvider {
|
|
54
54
|
/** Return ghost-text suffix for the partial word at the cursor, or `null`. */
|
|
55
55
|
getWordCompletion?(lines: string[], cursorLine: number, cursorCol: number): string | null;
|
|
56
|
+
/**
|
|
57
|
+
* Report the fate of the ghost-text `suggestion` shown at the cursor:
|
|
58
|
+
* `accepted` (Tab/→) or typed past (a typed character diverged from it).
|
|
59
|
+
* Called with the editor state the suggestion was shown for.
|
|
60
|
+
*/
|
|
61
|
+
wordCompletionFeedback?(lines: string[], cursorLine: number, cursorCol: number, suggestion: string, accepted: boolean): void;
|
|
56
62
|
/** Return a correction after one single-character insertion, or `null`. */
|
|
57
63
|
tryAutocorrect?(lines: string[], cursorLine: number, cursorCol: number): EditorInlineReplacement | null | Promise<EditorInlineReplacement | null>;
|
|
58
64
|
/** Return replacement candidates for the misspelled word at the cursor. */
|
|
@@ -103,6 +109,11 @@ export declare class Editor implements Component, Focusable {
|
|
|
103
109
|
onLargePaste?: (text: string, lineCount: number, options: PasteOptions) => boolean;
|
|
104
110
|
onAutocompleteCancel?: () => void;
|
|
105
111
|
disableSubmit: boolean;
|
|
112
|
+
/** Placeholder painted right-aligned on the cursor row while the editor is empty and no
|
|
113
|
+
* autocomplete is open; hidden when it can't keep {@link PLACEHOLDER_MIN_GAP} cells from the
|
|
114
|
+
* cursor. The host styles it (ANSI allowed). Re-evaluated on every render, so hosts can derive
|
|
115
|
+
* it from live state. */
|
|
116
|
+
placeholder?: () => string | undefined;
|
|
106
117
|
constructor(theme: EditorTheme);
|
|
107
118
|
/** Return bounded editor content, cursor, and transient child state for debug inspection. */
|
|
108
119
|
debugState(): Record<string, unknown>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Key-hint formatting, kept free of the native addon: it imports only types
|
|
3
|
+
* plus the theme symbol mirror, so addon-free CLI paths (`omp --version`,
|
|
4
|
+
* help text in cli/command-help.ts) can format keys without loading
|
|
5
|
+
* `@oh-my-pi/pi-natives` through the keybindings registry.
|
|
6
|
+
*/
|
|
7
|
+
import type { KeyId } from "./keybindings.js";
|
|
8
|
+
import type { ModifierName } from "./keys.js";
|
|
9
|
+
/** Pin the platform used to render modifier labels (test seam). */
|
|
10
|
+
export declare function setKeyHintPlatform(platform: NodeJS.Platform | undefined): void;
|
|
11
|
+
/** Platform currently used for key-hint rendering. */
|
|
12
|
+
export declare function keyHintPlatform(): NodeJS.Platform;
|
|
13
|
+
/** A displayable key: a chord, or a bare modifier for "hold ⇧" style hints. */
|
|
14
|
+
export type KeyName = KeyId | ModifierName;
|
|
15
|
+
/**
|
|
16
|
+
* Format one key for display: `"ctrl+shift+c"` → `⌃⇧C` (macOS) / `Ctrl+⇧C`,
|
|
17
|
+
* `"escape"` → `⎋`, `"alt+up"` → `⌥↑` / `Alt+↑`, `"shift"` → `⇧`.
|
|
18
|
+
* A glyph modifier is followed by the preset's `key.joiner` (nothing in
|
|
19
|
+
* unicode, a space in nerd, whose icons blur together when adjacent); a word
|
|
20
|
+
* modifier takes a `+`. Modifiers
|
|
21
|
+
* render in canonical order whatever the binding says (`shift+ctrl+p` → `⌃⇧P`).
|
|
22
|
+
* A bare letter stays lowercase (`q`) since `Q` would read as ⇧Q; in a chord it
|
|
23
|
+
* is capitalized. Other keys are capitalized (`f5` → `F5`).
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatKeyHint(key: KeyName): string;
|
|
26
|
+
/** Format alternative keys as a slash-separated hint (`["f5", "alt+r"]` → `F5/⌥R`). */
|
|
27
|
+
export declare function formatKeyHints(keys: KeyName | readonly KeyName[]): string;
|
|
28
|
+
/** Format a double-tap gesture: `←←` with glyphs, `Left Left` with words. */
|
|
29
|
+
export declare function formatDoubleTap(key: KeyName): string;
|
package/dist/types/keys.d.ts
CHANGED
|
@@ -45,7 +45,8 @@ type Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
|
45
45
|
type KeySymbol = "`" | "-" | "=" | "[" | "]" | "\\" | ";" | "'" | "," | "." | "/" | "!" | "@" | "#" | "$" | "%" | "^" | "&" | "*" | "(" | ")" | "_" | "+" | "|" | "~" | "{" | "}" | ":" | "<" | ">" | "?";
|
|
46
46
|
type SpecialKey = "escape" | "esc" | "enter" | "return" | "tab" | "space" | "backspace" | "delete" | "insert" | "clear" | "home" | "end" | "pageUp" | "pageDown" | "up" | "down" | "left" | "right" | "f1" | "f2" | "f3" | "f4" | "f5" | "f6" | "f7" | "f8" | "f9" | "f10" | "f11" | "f12";
|
|
47
47
|
type BaseKey = Letter | Digit | KeySymbol | SpecialKey;
|
|
48
|
-
|
|
48
|
+
/** Modifier key names as they appear in {@link KeyId} chords. */
|
|
49
|
+
export type ModifierName = "ctrl" | "shift" | "alt" | "super";
|
|
49
50
|
type ModifiedKeyId<Key extends string, RemainingModifiers extends ModifierName = ModifierName> = {
|
|
50
51
|
[M in RemainingModifiers]: `${M}+${Key}` | `${M}+${ModifiedKeyId<Key, Exclude<RemainingModifiers, M>>}`;
|
|
51
52
|
}[RemainingModifiers];
|
|
@@ -17,7 +17,7 @@ import type { AgentTool } from "@oh-my-pi/pi-agent-core";
|
|
|
17
17
|
import { Container, type TUI } from "../tui.js";
|
|
18
18
|
import { type SelectListMouseTarget } from "../mouse.js";
|
|
19
19
|
import { type AgentActivitySource } from "./agent-activity.js";
|
|
20
|
-
import type
|
|
20
|
+
import { type KeyId } from "../app-keybindings.js";
|
|
21
21
|
import type { MessageRenderer } from "../chat/extension-types.js";
|
|
22
22
|
import type { AgentLifecycleLike, IrcBusLike } from "./agent-hub-types.js";
|
|
23
23
|
import { type AgentRecordLike, type AgentHubRegistry } from "./agent-hub-types.js";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import type * as fs from "node:fs";
|
|
17
17
|
import type { AgentTool } from "@oh-my-pi/pi-agent-core";
|
|
18
18
|
import type { Component, TUI } from "../tui.js";
|
|
19
|
-
import type
|
|
19
|
+
import { type KeyId } from "../app-keybindings.js";
|
|
20
20
|
import type { MessageRenderer } from "../chat/extension-types.js";
|
|
21
21
|
import type { AgentLifecycleLike } from "./agent-hub-types.js";
|
|
22
22
|
import type { AgentHubRegistry } from "./agent-hub-types.js";
|
|
@@ -51,10 +51,8 @@ export interface ModelPickerOptions {
|
|
|
51
51
|
quickRoleOrder?: ReadonlyArray<string>;
|
|
52
52
|
/** Active quick role, highlighted when the search begins with `@`. */
|
|
53
53
|
currentQuickRole?: string;
|
|
54
|
-
/** Keys that toggle task-subagent mode while the picker is open;
|
|
54
|
+
/** Keys that toggle task-subagent mode while the picker is open; the first is shown in the footer. */
|
|
55
55
|
taskModeKeys?: readonly KeyId[];
|
|
56
|
-
/** Human-readable label for the toggle key, shown in footer hints (e.g. "alt+p"). */
|
|
57
|
-
taskModeKeyLabel?: string;
|
|
58
56
|
/** `provider/id` highlighted and preselected in task mode (current Task subagent model). */
|
|
59
57
|
taskSelector?: string;
|
|
60
58
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composer hints: the right-aligned placeholder shown in the empty composer to
|
|
3
|
+
* surface gestures that matter right now (e.g. background agents are running).
|
|
4
|
+
*
|
|
5
|
+
* Hints are checked in priority order; the first one that applies wins. A hint
|
|
6
|
+
* retires for good once the user has performed its gesture
|
|
7
|
+
* {@link ComposerHint.learnedAfter} times — the host records each use under the
|
|
8
|
+
* hint's id and reports counts through {@link ComposerHintContext.uses}.
|
|
9
|
+
*
|
|
10
|
+
* Add a hint by appending to {@link COMPOSER_HINTS}, extending
|
|
11
|
+
* {@link ComposerHintId}, and recording the gesture where it is handled.
|
|
12
|
+
*/
|
|
13
|
+
import { type KeybindingsManager } from "../app-keybindings.js";
|
|
14
|
+
/** Stable hint ids; persisted as usage-counter keys, so never rename one. */
|
|
15
|
+
export type ComposerHintId = "agents" | "effort";
|
|
16
|
+
/** Live state that hint conditions read. Built by the host on every render of the empty composer. */
|
|
17
|
+
export interface ComposerHintContext {
|
|
18
|
+
/** Subagents currently running in the background. */
|
|
19
|
+
runningAgents: number;
|
|
20
|
+
/** The view is focused on a subagent session instead of the main one. */
|
|
21
|
+
focusedOnAgent: boolean;
|
|
22
|
+
/** The viewed session already has messages. */
|
|
23
|
+
conversationStarted: boolean;
|
|
24
|
+
keybindings: KeybindingsManager;
|
|
25
|
+
/** Times the user has performed the gesture a hint teaches. */
|
|
26
|
+
uses(id: ComposerHintId): number;
|
|
27
|
+
}
|
|
28
|
+
/** A gesture tip: `key` renders highlighted, `label` describes what it does. */
|
|
29
|
+
export interface ComposerHint {
|
|
30
|
+
id: ComposerHintId;
|
|
31
|
+
/** Uses of the gesture after which the hint stops showing. */
|
|
32
|
+
learnedAfter: number;
|
|
33
|
+
/** Key and label when the hint applies, otherwise `undefined`. */
|
|
34
|
+
resolve(ctx: ComposerHintContext): {
|
|
35
|
+
key: string;
|
|
36
|
+
label: string;
|
|
37
|
+
} | undefined;
|
|
38
|
+
}
|
|
39
|
+
/** Registered hints, highest priority first. */
|
|
40
|
+
export declare const COMPOSER_HINTS: readonly ComposerHint[];
|
|
41
|
+
/** Render the highest-priority applicable, not-yet-learned hint, if any. */
|
|
42
|
+
export declare function resolveComposerHint(ctx: ComposerHintContext): string | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Terminal } from "../terminal.js";
|
|
2
2
|
import { type Component, type ResizeScrollbackMode, type TerminalFramePlan, type TerminalFrameProvider, TUI, type TUIOptions, type ViewportSize } from "../tui.js";
|
|
3
3
|
import { CustomEditor } from "./custom-editor.js";
|
|
4
|
+
import type { WordCompletionMethod } from "./word-completion.js";
|
|
4
5
|
import { type LspServerInfo, type RecentSession, WelcomeComponent } from "./welcome.js";
|
|
5
6
|
/** Live settings that affect the composer before and after session adoption. */
|
|
6
7
|
export interface ComposerPreferences {
|
|
@@ -12,7 +13,7 @@ export interface ComposerPreferences {
|
|
|
12
13
|
readonly imeSafeCursor: boolean;
|
|
13
14
|
readonly autocompleteMaxVisible: number;
|
|
14
15
|
readonly spellingTypoDetection: boolean;
|
|
15
|
-
readonly spellingAutocomplete:
|
|
16
|
+
readonly spellingAutocomplete: WordCompletionMethod;
|
|
16
17
|
readonly spellingAutocorrect: boolean;
|
|
17
18
|
}
|
|
18
19
|
/** Settings-schema-compatible defaults used when constructing a dependency-free composer. */
|
|
@@ -4,7 +4,13 @@ import { type KeyId } from "../keys.js";
|
|
|
4
4
|
import { SpaceHoldGesture } from "../space-hold.js";
|
|
5
5
|
import { TUI } from "../tui.js";
|
|
6
6
|
import type { AppKeybinding } from "../app-keybindings.js";
|
|
7
|
-
import { type
|
|
7
|
+
import { type MacOSSpellingFeatures } from "./macos-spelling.js";
|
|
8
|
+
import { type WordCompletionMethod } from "./word-completion.js";
|
|
9
|
+
/** Independently switchable prose-assistance features of the composer. */
|
|
10
|
+
export interface SpellingFeatures extends MacOSSpellingFeatures {
|
|
11
|
+
/** Word-completion engine; `off` disables ghost text. */
|
|
12
|
+
autocomplete: WordCompletionMethod;
|
|
13
|
+
}
|
|
8
14
|
type ConfigurableEditorAction = Extract<AppKeybinding, "app.interrupt" | "app.clear" | "app.exit" | "app.suspend" | "app.display.reset" | "app.thinking.cycle" | "app.model.cycleForward" | "app.model.cycleBackward" | "app.model.select" | "app.model.selectTemporary" | "app.message.dequeue" | "app.retry" | "app.clipboard.pasteImage" | "app.clipboard.pasteTextRaw" | "app.clipboard.copyPrompt">;
|
|
9
15
|
/**
|
|
10
16
|
* Extract image-or-other file paths from plain (un-bracketed) clipboard text.
|
|
@@ -114,7 +120,7 @@ export declare class CustomEditor extends Editor {
|
|
|
114
120
|
* keep working.
|
|
115
121
|
*/
|
|
116
122
|
constructor(...args: readonly unknown[]);
|
|
117
|
-
/** Independently configure typo detection, word
|
|
123
|
+
/** Independently configure typo detection, the word-completion engine, and autocorrect. */
|
|
118
124
|
setSpellingFeatures(features: SpellingFeatures): void;
|
|
119
125
|
/** Clear the composer draft: optionally commit `historyText` to history, then
|
|
120
126
|
* reset the editor text and all pending draft-image state. The shared tail of
|
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
import * as native from "@oh-my-pi/pi-natives";
|
|
2
2
|
import type { EditorInlineReplacement, EditorTextAssistProvider, EditorWordReplacements } from "../components/editor.js";
|
|
3
|
+
import { type SpellingDecorationContext } from "./prose-gate.js";
|
|
3
4
|
/** Independently switchable macOS prose-assistance features. */
|
|
4
|
-
export interface
|
|
5
|
+
export interface MacOSSpellingFeatures {
|
|
5
6
|
typoDetection: boolean;
|
|
6
|
-
autocomplete: boolean;
|
|
7
7
|
autocorrect: boolean;
|
|
8
8
|
}
|
|
9
|
-
/** Logical source location for one rendered editor segment. */
|
|
10
|
-
export interface SpellingDecorationContext {
|
|
11
|
-
editorText: string;
|
|
12
|
-
lines: readonly string[];
|
|
13
|
-
line: number;
|
|
14
|
-
startCol: number;
|
|
15
|
-
}
|
|
16
9
|
/** Native spelling operations used by {@link MacOSSpellingProvider}. */
|
|
17
10
|
export interface SpellingBackend {
|
|
18
11
|
isAvailable(): boolean;
|
|
19
12
|
checkSpelling(text: string): Promise<readonly native.SpellingRange[]>;
|
|
20
|
-
completeWord(text: string, start: number, length: number): Promise<readonly string[]>;
|
|
21
13
|
autocorrectWord(text: string, start: number, length: number): Promise<string | null>;
|
|
22
14
|
spellingGuesses(text: string, start: number, length: number): Promise<readonly string[]>;
|
|
23
15
|
}
|
|
24
16
|
/**
|
|
25
|
-
* Bridges Apple's spelling service into the editor's
|
|
26
|
-
*
|
|
17
|
+
* Bridges Apple's spelling service into the editor's typo and autocorrection
|
|
18
|
+
* paths. Word completion is the cross-platform `WordCompletionProvider`
|
|
19
|
+
* (`word-completion.ts`).
|
|
27
20
|
*/
|
|
28
21
|
export declare class MacOSSpellingProvider implements EditorTextAssistProvider {
|
|
29
22
|
#private;
|
|
@@ -31,12 +24,10 @@ export declare class MacOSSpellingProvider implements EditorTextAssistProvider {
|
|
|
31
24
|
/** Invoked when an asynchronous spelling result can change rendered output. */
|
|
32
25
|
onUpdate: (() => void) | undefined;
|
|
33
26
|
constructor(backend?: SpellingBackend, styledUnderlines?: boolean);
|
|
34
|
-
/** Apply
|
|
35
|
-
setFeatures(features:
|
|
27
|
+
/** Apply both independent feature gates and invalidate rendered typo ranges. */
|
|
28
|
+
setFeatures(features: MacOSSpellingFeatures): void;
|
|
36
29
|
/** Add red undercurls to misspellings while preserving visible text width. */
|
|
37
30
|
decorateTypos(text: string, context: SpellingDecorationContext, decorate?: (span: string) => string): string;
|
|
38
|
-
/** Return the cached macOS completion suffix for the word ending at the cursor. */
|
|
39
|
-
getWordCompletion(lines: string[], cursorLine: number, cursorCol: number): string | null;
|
|
40
31
|
/** Return the confident macOS correction after a completed prose word. */
|
|
41
32
|
tryAutocorrect(lines: string[], cursorLine: number, cursorCol: number): Promise<EditorInlineReplacement | null>;
|
|
42
33
|
/** Return macOS replacement guesses for the misspelled word at the cursor. */
|
|
@@ -32,7 +32,10 @@ interface PromptActionAutocompleteOptions {
|
|
|
32
32
|
export declare class PromptActionAutocompleteProvider implements AutocompleteProvider {
|
|
33
33
|
#private;
|
|
34
34
|
constructor(commands: SlashCommand[], basePath: string, actions: PromptActionDefinition[], commandUsage?: (name: string) => number, internalUrlCaller?: () => InternalUrlCallerContext, modelMentions?: ModelMentionCandidateSource);
|
|
35
|
-
getSuggestions(lines: string[], cursorLine: number, cursorCol: number, signal?: AbortSignal
|
|
35
|
+
getSuggestions(lines: string[], cursorLine: number, cursorCol: number, signal?: AbortSignal, onPartial?: (suggestions: {
|
|
36
|
+
items: AutocompleteItem[];
|
|
37
|
+
prefix: string;
|
|
38
|
+
}) => void): Promise<{
|
|
36
39
|
items: AutocompleteItem[];
|
|
37
40
|
prefix: string;
|
|
38
41
|
} | null>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Logical source location for one rendered editor segment. */
|
|
2
|
+
export interface SpellingDecorationContext {
|
|
3
|
+
editorText: string;
|
|
4
|
+
lines: readonly string[];
|
|
5
|
+
line: number;
|
|
6
|
+
startCol: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Whether `text[start, end)` is a prose word: unmasked by {@link maskNonProse},
|
|
10
|
+
* not inside a path/identifier-like token, and not on a slash-command or
|
|
11
|
+
* queue-shorthand line.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isProseWord(text: string, masked: string, start: number, end: number): boolean;
|
|
14
|
+
/** Whole-buffer context for `line`, starting at column 0. */
|
|
15
|
+
export declare function lineContext(lines: readonly string[], line: number): SpellingDecorationContext;
|
|
16
|
+
/**
|
|
17
|
+
* Memoized whole-buffer prose mask: answers whether a line range is prose in
|
|
18
|
+
* the context of the full editor text (fenced code spans lines).
|
|
19
|
+
*/
|
|
20
|
+
export declare class ProseSource {
|
|
21
|
+
#private;
|
|
22
|
+
/** True when `[startCol, endCol)` of `context.line` is prose and the buffer is within the caps. */
|
|
23
|
+
isProse(context: SpellingDecorationContext, startCol: number, endCol: number): boolean;
|
|
24
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { EditorTextAssistProvider } from "../components/editor.js";
|
|
2
|
+
/** Values of the `spelling.autocomplete` setting. */
|
|
3
|
+
export declare const WORD_COMPLETION_METHODS: readonly ["off", "auto", "ngram", "smollm", "apple"];
|
|
4
|
+
/** Configured word-completion engine; `off` disables ghost text. */
|
|
5
|
+
export type WordCompletionMethod = (typeof WORD_COMPLETION_METHODS)[number];
|
|
6
|
+
/** Whether `value` is a {@link WordCompletionMethod}. */
|
|
7
|
+
export declare function isWordCompletionMethod(value: unknown): value is WordCompletionMethod;
|
|
8
|
+
/** An enabled word-completion engine. */
|
|
9
|
+
export type WordCompletionEngine = Exclude<WordCompletionMethod, "off">;
|
|
10
|
+
/** Asynchronous engine behind ghost-text word completion (coding-agent: the text-prediction daemon). */
|
|
11
|
+
export interface WordPredictionBackend {
|
|
12
|
+
/** Characters to paint after `prefix` typed after `before`, or `null` to show nothing. */
|
|
13
|
+
complete(before: string, prefix: string): Promise<string | null>;
|
|
14
|
+
/** Report a shown suggestion the user accepted (Tab/→) or typed past. Fire-and-forget. */
|
|
15
|
+
feedback(before: string, prefix: string, suggestion: string, accepted: boolean): void;
|
|
16
|
+
}
|
|
17
|
+
/** Resolves the backend for an engine; `undefined` means none is available (no ghost text). */
|
|
18
|
+
export type WordPredictionBackendResolver = (method: WordCompletionEngine) => WordPredictionBackend | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Install the host's backend resolver for every editor, including ones built
|
|
21
|
+
* before the host finished starting. Pass `undefined` to detach.
|
|
22
|
+
*/
|
|
23
|
+
export declare function setWordPredictionHost(resolver: WordPredictionBackendResolver | undefined): void;
|
|
24
|
+
/**
|
|
25
|
+
* Ghost-text word completion for the prose word ending at the cursor, served
|
|
26
|
+
* by an injected asynchronous {@link WordPredictionBackend}.
|
|
27
|
+
*
|
|
28
|
+
* Rendering is synchronous, so a cache miss schedules a single-flight backend
|
|
29
|
+
* request (one active, the newest queued) and repaints through `onUpdate` when
|
|
30
|
+
* the answer changes what is shown. The previous suggestion is projected: if
|
|
31
|
+
* its full word still extends what was typed, the remainder shows immediately
|
|
32
|
+
* and stays until the engine offers a different word.
|
|
33
|
+
*/
|
|
34
|
+
export declare class WordCompletionProvider implements EditorTextAssistProvider {
|
|
35
|
+
#private;
|
|
36
|
+
/** Invoked when an asynchronous answer changes the rendered ghost text. */
|
|
37
|
+
onUpdate: (() => void) | undefined;
|
|
38
|
+
/** `resolveBackend` defaults to the host installed with {@link setWordPredictionHost}. */
|
|
39
|
+
constructor(resolveBackend?: WordPredictionBackendResolver);
|
|
40
|
+
/** Select the engine (`off` disables completion) and drop answers from the previous one. */
|
|
41
|
+
setMethod(method: WordCompletionMethod): void;
|
|
42
|
+
/** Return the ghost-text suffix for the prose word ending at the cursor, or `null`. */
|
|
43
|
+
getWordCompletion(lines: string[], cursorLine: number, cursorCol: number): string | null;
|
|
44
|
+
/** Forward accept (Tab/→) or typed-past feedback for the suggestion shown at the cursor. */
|
|
45
|
+
wordCompletionFeedback(lines: string[], cursorLine: number, cursorCol: number, suggestion: string, accepted: boolean): void;
|
|
46
|
+
}
|
|
@@ -94,7 +94,7 @@ export declare const TRUNCATE_LENGTHS: {
|
|
|
94
94
|
/** Idle recap status line (~40-word LLM reply) */
|
|
95
95
|
readonly RECAP: 280;
|
|
96
96
|
};
|
|
97
|
-
/** Human-readable key
|
|
97
|
+
/** Human-readable primary key bound to tool-output expansion, e.g. `Ctrl+O`. */
|
|
98
98
|
export declare function expandKeyHint(): string;
|
|
99
99
|
/** Keep both ends of a single-line label without splitting wide characters. */
|
|
100
100
|
export declare function truncateMiddleToWidth(text: string, maxWidth: number): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Active theme's symbol lookup without importing `./theme` (which pulls the
|
|
3
|
+
* native addon through `@oh-my-pi/pi-natives`). Key-hint formatting runs on
|
|
4
|
+
* CLI paths that must stay addon-free (`omp --version`, help), so it reads the
|
|
5
|
+
* active theme through this mirror; `./theme` publishes every assignment here.
|
|
6
|
+
*/
|
|
7
|
+
import { type SymbolKey } from "./symbols.js";
|
|
8
|
+
import type { Theme } from "./theme-class.js";
|
|
9
|
+
/** @internal Called by `./theme` whenever the active theme changes. */
|
|
10
|
+
export declare function setActiveSymbolTheme(value: Theme | undefined): void;
|
|
11
|
+
/** Symbol from the active theme, or the ascii preset before any theme loads. */
|
|
12
|
+
export declare function activeThemeSymbol(key: SymbolKey): string;
|
|
@@ -2,7 +2,7 @@ export type SymbolPreset = "unicode" | "nerd" | "ascii";
|
|
|
2
2
|
/**
|
|
3
3
|
* All available symbol keys organized by category.
|
|
4
4
|
*/
|
|
5
|
-
export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "status.done" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "progress.filled" | "progress.empty" | "context.speculation" | "context.compaction" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxDotted.horizontal" | "boxDotted.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.powerlineCapLeft" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.prewalk" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.worktree" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.pin" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.subscription" | "icon.advisor" | "icon.advisorClosed" | "icon.time" | "icon.omp" | "icon.
|
|
5
|
+
export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "status.done" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "progress.filled" | "progress.empty" | "context.speculation" | "context.compaction" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxDotted.horizontal" | "boxDotted.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.powerlineCapLeft" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.prewalk" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.worktree" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.pin" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.subscription" | "icon.advisor" | "icon.advisorClosed" | "icon.time" | "icon.omp" | "icon.ghost" | "icon.agents" | "icon.job" | "icon.cache" | "icon.cacheMiss" | "icon.input" | "icon.output" | "icon.throughput" | "icon.intelligence" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.vimNormal" | "icon.vimInsert" | "icon.vimVisual" | "icon.vimVisualLine" | "cmd.action" | "cmd.prompt" | "cmd.extension" | "cmd.settings" | "cmd.gear" | "cmd.shield" | "cmd.wave" | "cmd.compass" | "cmd.inbox" | "cmd.swap" | "cmd.expand" | "cmd.computer" | "cmd.eye" | "cmd.todo" | "cmd.stats" | "cmd.news" | "cmd.keyboard" | "cmd.export" | "cmd.clipboard" | "cmd.share" | "cmd.broadcast" | "cmd.globe" | "cmd.copy" | "cmd.plus" | "cmd.restart" | "cmd.eraser" | "cmd.trash" | "cmd.compress" | "cmd.vibrate" | "cmd.handoff" | "cmd.history" | "cmd.question" | "cmd.rocket" | "cmd.stethoscope" | "cmd.redo" | "cmd.bug" | "cmd.memory" | "cmd.pencil" | "cmd.folderMove" | "cmd.folderPlus" | "cmd.folderMinus" | "cmd.hammer" | "cmd.power" | "cmd.cart" | "icon.mic" | "icon.camera" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.max" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "radio.selected" | "radio.unselected" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "advisor.rail" | "skill.rail" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.julia" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "chip.image" | "chip.video" | "chip.paste" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.files" | "tab.shell" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers" | "tool.write" | "tool.edit" | "tool.bash" | "tool.ssh" | "tool.lsp" | "tool.gh" | "tool.webSearch" | "tool.exa" | "tool.browser" | "tool.eval" | "tool.debug" | "tool.mcp" | "tool.job" | "tool.launch" | "tool.task" | "tool.todo" | "tool.memory" | "tool.ask" | "tool.resolve" | "tool.review" | "tool.goal" | "tool.irc" | "tool.delete" | "tool.move" | "key.ctrl" | "key.ctrlMac" | "key.shift" | "key.alt" | "key.altMac" | "key.super" | "key.superMac" | "key.joiner" | "key.enter" | "key.esc" | "key.tab" | "key.backspace" | "key.delete" | "key.space" | "key.up" | "key.down" | "key.left" | "key.right";
|
|
6
6
|
export type SymbolMap = Record<SymbolKey, string>;
|
|
7
7
|
/**
|
|
8
8
|
* Icon vocabulary for slash-command autocomplete type indicators. Each name
|
|
@@ -3,7 +3,7 @@ import type { RenderResultOptions } from "./renderer.js";
|
|
|
3
3
|
import { type Theme } from "../theme/theme.js";
|
|
4
4
|
import type { ImageContent } from "@oh-my-pi/pi-ai";
|
|
5
5
|
import type { OutputMeta } from "./output-meta.js";
|
|
6
|
-
import type
|
|
6
|
+
import { type ConfiguredThinkingLevel } from "../render/render-utils.js";
|
|
7
7
|
/** Runtime backend that an eval cell dispatches to. */
|
|
8
8
|
export type EvalLanguage = "python" | "js";
|
|
9
9
|
/** Status event emitted by eval prelude helpers for TUI rendering. */
|
|
@@ -48,7 +48,7 @@ export interface MCPResourceContent {
|
|
|
48
48
|
}
|
|
49
49
|
/** Supported MCP result content blocks retained in display metadata. */
|
|
50
50
|
export type MCPContent = MCPTextContent | MCPImageContent | MCPResourceContent;
|
|
51
|
-
/**
|
|
51
|
+
/** MCP result details shared by renderers and programmatic tool consumers. */
|
|
52
52
|
export interface MCPToolDetails {
|
|
53
53
|
/** Server name */
|
|
54
54
|
serverName: string;
|
|
@@ -58,6 +58,8 @@ export interface MCPToolDetails {
|
|
|
58
58
|
isError?: boolean;
|
|
59
59
|
/** Raw content from MCP response */
|
|
60
60
|
rawContent?: MCPContent[];
|
|
61
|
+
/** Server-supplied structured data, independent of the model-facing text rendering. */
|
|
62
|
+
structuredContent?: Record<string, unknown>;
|
|
61
63
|
/** Structured metadata from the MCP response */
|
|
62
64
|
mcpMeta?: Record<string, unknown>;
|
|
63
65
|
/** Provider ID (e.g., "claude", "mcp-json") */
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import type { YieldItem } from "./task.js";
|
|
2
|
+
/**
|
|
3
|
+
* Output-schema shape of each declared top-level property, keyed by incremental yield label.
|
|
4
|
+
* `array` sections accumulate into a list (even a lone yield); `scalar` sections keep the
|
|
5
|
+
* latest yield, since the schema admits exactly one value. Undeclared labels accumulate
|
|
6
|
+
* into a list only once repeated.
|
|
7
|
+
*/
|
|
8
|
+
export type YieldSectionShapes = ReadonlyMap<string, "array" | "scalar">;
|
|
2
9
|
/** Outcome of folding a run's yield calls into one payload, with provenance flags. */
|
|
3
10
|
interface AssembledYieldResult {
|
|
4
11
|
data: unknown;
|
|
@@ -14,7 +21,8 @@ interface AssembledYieldResult {
|
|
|
14
21
|
* assistant turn the raw terminal result. Other string-typed yields contribute
|
|
15
22
|
* the terminal labelled section. Untyped terminal yields keep the historical
|
|
16
23
|
* "last yield wins" behavior unless no terminal yield exists, in which case
|
|
17
|
-
* accumulated typed sections finalize on idle.
|
|
24
|
+
* accumulated typed sections finalize on idle. Repeated sections merge per
|
|
25
|
+
* `sectionShapes` (see {@link YieldSectionShapes}).
|
|
18
26
|
*/
|
|
19
|
-
export declare function assembleYieldResult(yieldItems: YieldItem[], lastAssistantText?: string,
|
|
27
|
+
export declare function assembleYieldResult(yieldItems: YieldItem[], lastAssistantText?: string, sectionShapes?: YieldSectionShapes): AssembledYieldResult | undefined;
|
|
20
28
|
export {};
|
|
@@ -101,6 +101,8 @@ export interface TaskItem {
|
|
|
101
101
|
agent?: string;
|
|
102
102
|
/** The work; required by the schema. */
|
|
103
103
|
task?: string;
|
|
104
|
+
/** How open-ended the work is; required by the schema and the child's sole `auto` thinking classification input. */
|
|
105
|
+
solutionSpace?: string;
|
|
104
106
|
/** Per-spawn thinking effort: lowest/middle/highest level the resolved model supports. Overrides the agent's default selector (e.g. `auto`). */
|
|
105
107
|
effort?: "lo" | "med" | "hi";
|
|
106
108
|
/** Caller-provided output schema; its presence overrides the selected agent's schema. */
|
|
@@ -125,6 +127,8 @@ export interface TaskParams {
|
|
|
125
127
|
agent?: string;
|
|
126
128
|
/** The work (flat form). */
|
|
127
129
|
task?: string;
|
|
130
|
+
/** How open-ended the work is (flat form); see {@link TaskItem.solutionSpace}. */
|
|
131
|
+
solutionSpace?: string;
|
|
128
132
|
/** Per-spawn thinking effort (flat form): lowest/middle/highest level the resolved model supports. */
|
|
129
133
|
effort?: "lo" | "med" | "hi";
|
|
130
134
|
/** Caller-provided output schema; its presence overrides the selected agent's schema. */
|