@oh-my-pi/pi-tui 18.4.2 → 18.4.3
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 +20 -0
- package/dist/types/chat/thinking-display.d.ts +2 -0
- package/dist/types/components/editor.d.ts +5 -0
- package/dist/types/loop-watchdog.d.ts +9 -0
- package/dist/types/overlays/model-picker.d.ts +2 -1
- package/dist/types/setup/scenes/sign-in.d.ts +9 -9
- package/dist/types/setup/scenes/types.d.ts +0 -26
- package/dist/types/stdin-buffer.d.ts +10 -7
- package/dist/types/terminal.d.ts +9 -0
- package/dist/types/tools/web-search-types.d.ts +90 -0
- package/dist/types/tools/web-search.d.ts +1 -168
- package/package.json +9 -9
- package/src/chat/assistant-message.ts +192 -40
- package/src/chat/thinking-display.ts +73 -11
- package/src/chrome/transcript-container.ts +102 -17
- package/src/components/editor.ts +23 -9
- package/src/components/markdown.ts +110 -56
- package/src/loop-watchdog.ts +38 -10
- package/src/overlays/model-picker.ts +9 -6
- package/src/overlays/settings-selector.ts +2 -10
- package/src/setup/scenes/sign-in.ts +17 -12
- package/src/setup/scenes/types.ts +0 -27
- package/src/setup/wizard.ts +1 -1
- package/src/status-line/component.ts +16 -2
- package/src/stdin-buffer.ts +27 -21
- package/src/terminal.ts +23 -9
- package/src/theme/mermaid-cache.ts +10 -1
- package/src/theme/tui-adapters.ts +14 -1
- package/src/tools/bash.ts +53 -13
- package/src/tools/edit.ts +110 -29
- package/src/tools/streaming-output.ts +79 -16
- package/src/tools/web-search-types.ts +99 -0
- package/src/tools/web-search.ts +1 -172
- package/src/tui.ts +1 -1
- package/dist/types/setup/scenes/providers.d.ts +0 -3
- package/dist/types/setup/scenes/web-search.d.ts +0 -22
- package/src/setup/scenes/providers.ts +0 -110
- package/src/setup/scenes/web-search.ts +0 -165
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [18.4.3] - 2026-09-28
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Reduced frame spikes and memory while long assistant replies retire into scrollback mid-stream: retiring rows no longer re-renders the whole published reply once per row, and the transcript no longer rescans the entire session history every frame ([#13650](https://github.com/can1357/oh-my-pi/pull/13650) by [@H4vC](https://github.com/H4vC)).
|
|
10
|
+
- Reduced memory held by finished messages: streamed Markdown blocks release their streaming row caches, frozen lex tokens, and syntax-highlight streams when they finalize, and the Mermaid render cache is now size-bounded ([#13650](https://github.com/can1357/oh-my-pi/pull/13650) by [@H4vC](https://github.com/H4vC)).
|
|
11
|
+
- Reduced per-frame CPU while streaming Markdown, edit previews (header facts are reused across frames; replace previews process only the visible lines), bash previews (highlighting is deferred to paint and the highlight cache is size-bounded), interleaved thinking blocks, and the live bash/ssh output tail ([#13650](https://github.com/can1357/oh-my-pi/pull/13650) by [@H4vC](https://github.com/H4vC)).
|
|
12
|
+
- Changed git status refresh interval to 10 seconds and added generation tracking to avoid stale counts after HEAD moves
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Fixed streaming bash previews showing fields that follow the `env` object (e.g. `command`) as environment assignments ([#13650](https://github.com/can1357/oh-my-pi/pull/13650) by [@H4vC](https://github.com/H4vC)).
|
|
17
|
+
- Fixed model picker latency by avoiding unnecessary catalog rebuilds
|
|
18
|
+
- Fixed the `@` completion popup showing a `Searching…` placeholder while a refreshed file search is pending; the popup now stays hidden until results arrive, and Escape is no longer swallowed by it
|
|
19
|
+
- Fixed multi-line IME and dictation input (for example, voice input in Ghostty or cmux) being sent as one message per line; it now lands in the prompt as a single multi-line draft, while Enter typed during a UI freeze still submits ([#13378](https://github.com/can1357/oh-my-pi/pull/13378) by [@goransh-walia](https://github.com/goransh-walia))
|
|
20
|
+
|
|
21
|
+
### Removed
|
|
22
|
+
|
|
23
|
+
- Removed the setup wizard's "Web search" tab; the providers scene is now sign-in only, and web search is chosen through the `web` model role like other kind roles.
|
|
24
|
+
|
|
5
25
|
## [18.4.2] - 2026-09-28
|
|
6
26
|
|
|
7
27
|
### Changed
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
/** Drop every memo slot so the next call recomputes from scratch. Tests only. */
|
|
3
|
+
export declare function resetThinkingDisplayCacheForTests(): void;
|
|
2
4
|
export declare function canonicalizeMessage(text: string | null | undefined): string;
|
|
3
5
|
/**
|
|
4
6
|
* Thinking text prepared for display. Both modes drop empty `<!-- -->`
|
|
@@ -278,5 +278,10 @@ export declare class Editor implements Component, Focusable {
|
|
|
278
278
|
* {@link getExpandedText}). Hosts that intercept large pastes through {@link onLargePaste} use
|
|
279
279
|
* this to re-insert a (possibly transformed) paste without re-triggering the interception hook. */
|
|
280
280
|
insertPaste(content: string): void;
|
|
281
|
+
/**
|
|
282
|
+
* Whether an autocomplete popup is on screen. An `@` list narrowed to no match
|
|
283
|
+
* while its refresh is pending stays open internally but is hidden, so it does
|
|
284
|
+
* not claim keys (Escape, Vim mode switches) meant for the editor or app.
|
|
285
|
+
*/
|
|
281
286
|
isShowingAutocomplete(): boolean;
|
|
282
287
|
}
|
|
@@ -45,5 +45,14 @@ export declare class LoopWatchdog {
|
|
|
45
45
|
constructor(options?: LoopWatchdogOptions);
|
|
46
46
|
start(): void;
|
|
47
47
|
stop(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Whether the loop is blocked right now — the armed tick is already more
|
|
50
|
+
* than `thresholdMs` overdue — or a detected block ended within the last
|
|
51
|
+
* `thresholdMs`. Input read at such a moment may be keystrokes the block
|
|
52
|
+
* batched into one read. Resolves both orders in which a resumed loop can
|
|
53
|
+
* run the late tick and the queued stdin read. A suspended-process gap is
|
|
54
|
+
* not a stall, and a stopped watchdog never reports one.
|
|
55
|
+
*/
|
|
56
|
+
isStalled(): boolean;
|
|
48
57
|
}
|
|
49
58
|
export {};
|
|
@@ -19,7 +19,8 @@ export interface ResolvedRoleModel {
|
|
|
19
19
|
}
|
|
20
20
|
/** Catalog refresh capability used by the session picker. */
|
|
21
21
|
export interface ModelPickerRegistry extends ModelBrowserRegistry {
|
|
22
|
-
|
|
22
|
+
/** Bring the catalog up to date without rebuilding a current one; `true` when the picker must re-read it. */
|
|
23
|
+
refreshIfStale(): Promise<boolean>;
|
|
23
24
|
}
|
|
24
25
|
export interface ModelPickerCallbacks {
|
|
25
26
|
/**
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { type SgrMouseEvent } from "../../mouse.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { SetupScene, SetupSceneController, SetupSceneHost } from "./types.js";
|
|
3
3
|
/**
|
|
4
|
-
* "Sign in"
|
|
5
|
-
* OAuth.
|
|
6
|
-
*
|
|
4
|
+
* "Sign in" scene: lets the user authenticate one or more model providers via
|
|
5
|
+
* OAuth. It never auto-advances the wizard — the user may sign in to several
|
|
6
|
+
* providers and then continue with Esc.
|
|
7
7
|
*/
|
|
8
|
-
export declare class
|
|
8
|
+
export declare class SignInScene implements SetupSceneController {
|
|
9
9
|
#private;
|
|
10
|
-
readonly
|
|
11
|
-
|
|
10
|
+
readonly title = "Sign in to your providers";
|
|
11
|
+
get subtitle(): string;
|
|
12
12
|
constructor(host: SetupSceneHost);
|
|
13
|
-
/** Modal while an OAuth flow is running so the scene won't switch tabs or finish. */
|
|
14
|
-
get modal(): boolean;
|
|
15
13
|
dispose(): void;
|
|
16
14
|
invalidate(): void;
|
|
17
15
|
handleInput(data: string): void;
|
|
@@ -19,3 +17,5 @@ export declare class SignInTab implements SetupTab {
|
|
|
19
17
|
routeMouse(event: SgrMouseEvent, line: number, col: number): void;
|
|
20
18
|
render(width: number, maxLines?: number): readonly string[];
|
|
21
19
|
}
|
|
20
|
+
/** Onboarding scene for provider sign-in. */
|
|
21
|
+
export declare const providersSetupScene: SetupScene;
|
|
@@ -5,7 +5,6 @@ import type { ComposerPreviewStatusSource } from "../../overlays/composer-shape-
|
|
|
5
5
|
import type { ComposerShape } from "../../overlays/composer-shape-registry.js";
|
|
6
6
|
import type { ModelBrowserSource } from "../../overlays/model-browser.js";
|
|
7
7
|
import type { SymbolPreset } from "../../theme/theme.js";
|
|
8
|
-
import type { SearchProviderId } from "../../tools/web-search.js";
|
|
9
8
|
import type { Component, TUI } from "../../tui.js";
|
|
10
9
|
/** Terminal capabilities used by setup overlays and the startup splash. */
|
|
11
10
|
export interface SetupUiHost {
|
|
@@ -21,7 +20,6 @@ export interface SetupHost extends SetupUiHost {
|
|
|
21
20
|
readonly composerShape: ComposerShape;
|
|
22
21
|
readonly symbolPreset: SymbolPreset;
|
|
23
22
|
readonly colorBlindMode: boolean;
|
|
24
|
-
readonly webSearchOrder: readonly string[];
|
|
25
23
|
readonly disabledProviders: readonly string[];
|
|
26
24
|
readonly authStorage: AuthStorage;
|
|
27
25
|
readonly modelSource: ModelBrowserSource;
|
|
@@ -37,8 +35,6 @@ export interface SetupHost extends SetupUiHost {
|
|
|
37
35
|
saveSymbolPreset(preset: SymbolPreset): void;
|
|
38
36
|
saveColorBlindMode(enabled: boolean): void;
|
|
39
37
|
saveTheme(mode: "dark" | "light", name: string): void;
|
|
40
|
-
isSearchProviderAvailable(id: SearchProviderId): Promise<boolean>;
|
|
41
|
-
saveSearchProvider(id: SearchProviderId | "auto"): void;
|
|
42
38
|
captureBrowserSession(request: OAuthBrowserSessionRequest, signal?: AbortSignal): Promise<string>;
|
|
43
39
|
copyToClipboard(text: string): Promise<void>;
|
|
44
40
|
openInBrowser(url: string): void;
|
|
@@ -78,28 +74,6 @@ export interface SetupSceneController extends Component {
|
|
|
78
74
|
*/
|
|
79
75
|
routeMouse?(event: SgrMouseEvent, line: number, col: number): void;
|
|
80
76
|
}
|
|
81
|
-
/**
|
|
82
|
-
* A single panel inside a tabbed setup scene. The host scene owns the tab bar
|
|
83
|
-
* and forwards rendering/input to the active tab.
|
|
84
|
-
*/
|
|
85
|
-
export interface SetupTab {
|
|
86
|
-
readonly id: string;
|
|
87
|
-
readonly label: string;
|
|
88
|
-
/**
|
|
89
|
-
* While `true` the tab owns all keyboard input (e.g. an in-progress OAuth
|
|
90
|
-
* login). The parent scene MUST NOT switch tabs or finish while modal.
|
|
91
|
-
*/
|
|
92
|
-
readonly modal: boolean;
|
|
93
|
-
/** See {@link SetupSceneController.render}: `maxLines` is the tab-local row budget. */
|
|
94
|
-
render(width: number, maxLines?: number): readonly string[];
|
|
95
|
-
handleInput(data: string): void;
|
|
96
|
-
invalidate(): void;
|
|
97
|
-
/** Called when the tab becomes active (including initial mount). */
|
|
98
|
-
onActivate?(): void;
|
|
99
|
-
/** Mouse routing at tab-local coordinates; see {@link SetupSceneController.routeMouse}. */
|
|
100
|
-
routeMouse?(event: SgrMouseEvent, line: number, col: number): void;
|
|
101
|
-
dispose(): void;
|
|
102
|
-
}
|
|
103
77
|
/** Versioned onboarding scene definition. */
|
|
104
78
|
export interface SetupScene {
|
|
105
79
|
id: string;
|
|
@@ -63,14 +63,17 @@ export declare class StdinBuffer extends EventEmitter<StdinBufferEventMap> {
|
|
|
63
63
|
constructor(options?: StdinBufferOptions);
|
|
64
64
|
process(data: string | Buffer): void;
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* paste then always arrives wrapped, so
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
66
|
+
* Gate unbracketed raw-paste classification on event-loop responsiveness.
|
|
67
|
+
* Terminal installs a probe once DECRQM confirms bracketed-paste (mode
|
|
68
|
+
* 2004) support: a genuine paste then always arrives wrapped, so an
|
|
69
|
+
* unmarked multiline burst is either an input-method commit — IME,
|
|
70
|
+
* dictation, and emoji commits are typed input, never bracketed (#13344) —
|
|
71
|
+
* or keystrokes an event-loop stall batched into one read (#12540). A burst
|
|
72
|
+
* classified while `stalled()` reports a stall is replayed as the original
|
|
73
|
+
* keys so every Enter submits; otherwise it is delivered as one paste.
|
|
74
|
+
* `undefined` restores unconditional classification.
|
|
72
75
|
*/
|
|
73
|
-
|
|
76
|
+
setRawPasteStallProbe(stalled: (() => boolean) | undefined): void;
|
|
74
77
|
flush(): string[];
|
|
75
78
|
clear(): void;
|
|
76
79
|
getBuffer(): string;
|
package/dist/types/terminal.d.ts
CHANGED
|
@@ -96,6 +96,15 @@ export interface TerminalStartOptions {
|
|
|
96
96
|
* echoes even while module loading blocks the event loop.
|
|
97
97
|
*/
|
|
98
98
|
deferInput?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Reports whether the event loop is stalled or just recovered from a
|
|
101
|
+
* stall. Once the terminal confirms bracketed paste, an unmarked multiline
|
|
102
|
+
* burst is an input-method commit (IME, dictation) delivered as one paste
|
|
103
|
+
* on a responsive loop, but keystrokes a stall batched into one read —
|
|
104
|
+
* replayed as keys so Enter submits — while this returns true. Without a
|
|
105
|
+
* probe every such burst is treated as an input-method commit.
|
|
106
|
+
*/
|
|
107
|
+
isLoopStalled?: () => boolean;
|
|
99
108
|
}
|
|
100
109
|
/** Identity of an accepted explicit terminal appearance refresh request. */
|
|
101
110
|
export type TerminalAppearanceRequestToken = number;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Web search response types shared by the coding agent's search providers and
|
|
3
|
+
* the transcript renderer in {@link ./web-search}. Render-free, so provider code
|
|
4
|
+
* can import it without loading UI components.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Display label for every search implementation: `web/*` engines and the
|
|
8
|
+
* chat-model groundings. Keys are the ids providers report in
|
|
9
|
+
* {@link SearchResponse.provider} and search errors.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SEARCH_PROVIDER_LABELS: {
|
|
12
|
+
readonly parallel: "Parallel";
|
|
13
|
+
readonly perplexity: "Perplexity";
|
|
14
|
+
readonly gemini: "Gemini";
|
|
15
|
+
readonly anthropic: "Anthropic";
|
|
16
|
+
readonly codex: "OpenAI Codex";
|
|
17
|
+
readonly openai: "OpenAI API";
|
|
18
|
+
readonly xai: "xAI";
|
|
19
|
+
readonly openrouter: "OpenRouter";
|
|
20
|
+
readonly zai: "Z.AI";
|
|
21
|
+
readonly exa: "Exa";
|
|
22
|
+
readonly tinyfish: "TinyFish";
|
|
23
|
+
readonly jina: "Jina";
|
|
24
|
+
readonly kagi: "Kagi";
|
|
25
|
+
readonly tavily: "Tavily";
|
|
26
|
+
readonly firecrawl: "Firecrawl";
|
|
27
|
+
readonly brave: "Brave";
|
|
28
|
+
readonly kimi: "Kimi";
|
|
29
|
+
readonly synthetic: "Synthetic";
|
|
30
|
+
readonly ollama: "Ollama";
|
|
31
|
+
readonly searxng: "SearXNG";
|
|
32
|
+
readonly startpage: "Startpage";
|
|
33
|
+
readonly duckduckgo: "DuckDuckGo";
|
|
34
|
+
readonly ecosia: "Ecosia";
|
|
35
|
+
readonly google: "Google";
|
|
36
|
+
readonly mojeek: "Mojeek";
|
|
37
|
+
readonly public: "Public Web";
|
|
38
|
+
};
|
|
39
|
+
/** Id of a search implementation; see {@link SEARCH_PROVIDER_LABELS}. */
|
|
40
|
+
export type SearchProviderId = keyof typeof SEARCH_PROVIDER_LABELS;
|
|
41
|
+
/** Label for a provider id; ids from older transcripts fall back to the raw id. */
|
|
42
|
+
export declare function getSearchProviderLabel(id: SearchProviderId): string;
|
|
43
|
+
/** Source returned by search (all providers) */
|
|
44
|
+
export interface SearchSource {
|
|
45
|
+
title: string;
|
|
46
|
+
url: string;
|
|
47
|
+
snippet?: string;
|
|
48
|
+
/** ISO date string or relative ("2d ago") */
|
|
49
|
+
publishedDate?: string;
|
|
50
|
+
/** Age in seconds for consistent formatting */
|
|
51
|
+
ageSeconds?: number;
|
|
52
|
+
author?: string;
|
|
53
|
+
}
|
|
54
|
+
/** Citation with text reference (LLM-mediated providers) */
|
|
55
|
+
export interface SearchCitation {
|
|
56
|
+
url: string;
|
|
57
|
+
title: string;
|
|
58
|
+
citedText?: string;
|
|
59
|
+
}
|
|
60
|
+
/** Usage metrics */
|
|
61
|
+
export interface SearchUsage {
|
|
62
|
+
inputTokens?: number;
|
|
63
|
+
outputTokens?: number;
|
|
64
|
+
/** Anthropic: number of web search requests made */
|
|
65
|
+
searchRequests?: number;
|
|
66
|
+
/** Perplexity: combined token count */
|
|
67
|
+
totalTokens?: number;
|
|
68
|
+
}
|
|
69
|
+
/** Unified response across providers */
|
|
70
|
+
export interface SearchResponse {
|
|
71
|
+
provider: SearchProviderId | "none";
|
|
72
|
+
/** Synthesized answer text (LLM-mediated providers) */
|
|
73
|
+
answer?: string;
|
|
74
|
+
/** Search result sources */
|
|
75
|
+
sources: SearchSource[];
|
|
76
|
+
/** Text citations with context */
|
|
77
|
+
citations?: SearchCitation[];
|
|
78
|
+
/** Intermediate search queries (anthropic) */
|
|
79
|
+
searchQueries?: string[];
|
|
80
|
+
/** Follow-up question suggestions (provider-dependent) */
|
|
81
|
+
relatedQuestions?: string[];
|
|
82
|
+
/** Token usage metrics */
|
|
83
|
+
usage?: SearchUsage;
|
|
84
|
+
/** Model used */
|
|
85
|
+
model?: string;
|
|
86
|
+
/** Request ID for debugging */
|
|
87
|
+
requestId?: string;
|
|
88
|
+
/** Authentication mode used by the provider (e.g. oauth, api-key) */
|
|
89
|
+
authMode?: string;
|
|
90
|
+
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import type { Component } from "../index.js";
|
|
7
7
|
import type { RenderResultOptions } from "./renderer.js";
|
|
8
8
|
import { type Theme } from "../theme/theme.js";
|
|
9
|
+
import { type SearchResponse } from "./web-search-types.js";
|
|
9
10
|
/** Search response and optional failure shown in the transcript. */
|
|
10
11
|
export interface SearchRenderDetails {
|
|
11
12
|
response: SearchResponse;
|
|
@@ -33,171 +34,3 @@ export declare const webSearchToolRenderer: {
|
|
|
33
34
|
renderResult: typeof renderSearchResult;
|
|
34
35
|
mergeCallAndResult: true;
|
|
35
36
|
};
|
|
36
|
-
/**
|
|
37
|
-
* Web Search Types
|
|
38
|
-
*
|
|
39
|
-
* Unified types for web search responses across supported providers.
|
|
40
|
-
*/
|
|
41
|
-
export declare const SEARCH_PROVIDER_OPTIONS: readonly [{
|
|
42
|
-
readonly value: "auto";
|
|
43
|
-
readonly label: "Auto";
|
|
44
|
-
readonly description: "Automatically uses the first configured web-search provider";
|
|
45
|
-
}, {
|
|
46
|
-
readonly value: "parallel";
|
|
47
|
-
readonly label: "Parallel";
|
|
48
|
-
readonly description: "Uses API auth when configured; otherwise searches through the keyless public MCP";
|
|
49
|
-
}, {
|
|
50
|
-
readonly value: "perplexity";
|
|
51
|
-
readonly label: "Perplexity";
|
|
52
|
-
readonly description: "Uses auth when configured; explicit selection falls back to anonymous search";
|
|
53
|
-
}, {
|
|
54
|
-
readonly value: "gemini";
|
|
55
|
-
readonly label: "Gemini";
|
|
56
|
-
readonly description: "Google Search grounding via Gemini (uses google-gemini-cli or google-antigravity OAuth)";
|
|
57
|
-
}, {
|
|
58
|
-
readonly value: "anthropic";
|
|
59
|
-
readonly label: "Anthropic";
|
|
60
|
-
readonly description: "Claude's native web_search tool (uses Anthropic OAuth or ANTHROPIC_API_KEY)";
|
|
61
|
-
}, {
|
|
62
|
-
readonly value: "codex";
|
|
63
|
-
readonly label: "OpenAI Codex";
|
|
64
|
-
readonly description: "OpenAI's native web_search (uses ChatGPT OAuth via /login openai-codex)";
|
|
65
|
-
}, {
|
|
66
|
-
readonly value: "openai";
|
|
67
|
-
readonly label: "OpenAI API";
|
|
68
|
-
readonly description: "OpenAI hosted web_search via OPENAI_API_KEY or OpenAI API-key registry credentials; billed by API usage";
|
|
69
|
-
}, {
|
|
70
|
-
readonly value: "xai";
|
|
71
|
-
readonly label: "xAI";
|
|
72
|
-
readonly description: "Grok web search via xAI Responses API (uses SuperGrok/X Premium+ OAuth via /login xai-oauth, or XAI_API_KEY)";
|
|
73
|
-
}, {
|
|
74
|
-
readonly value: "openrouter";
|
|
75
|
-
readonly label: "OpenRouter";
|
|
76
|
-
readonly description: "OpenRouter plugins-based web search with model-selected grounding";
|
|
77
|
-
}, {
|
|
78
|
-
readonly value: "zai";
|
|
79
|
-
readonly label: "Z.AI";
|
|
80
|
-
readonly description: "Calls Z.AI webSearchPrime MCP";
|
|
81
|
-
}, {
|
|
82
|
-
readonly value: "exa";
|
|
83
|
-
readonly label: "Exa";
|
|
84
|
-
readonly description: "API via /login exa or EXA_API_KEY; explicit keyless fallback via MCP";
|
|
85
|
-
}, {
|
|
86
|
-
readonly value: "tinyfish";
|
|
87
|
-
readonly label: "TinyFish";
|
|
88
|
-
readonly description: "Requires TINYFISH_API_KEY";
|
|
89
|
-
}, {
|
|
90
|
-
readonly value: "jina";
|
|
91
|
-
readonly label: "Jina";
|
|
92
|
-
readonly description: "Requires JINA_API_KEY";
|
|
93
|
-
}, {
|
|
94
|
-
readonly value: "kagi";
|
|
95
|
-
readonly label: "Kagi";
|
|
96
|
-
readonly description: "Requires KAGI_API_KEY and Kagi Search API beta access";
|
|
97
|
-
}, {
|
|
98
|
-
readonly value: "tavily";
|
|
99
|
-
readonly label: "Tavily";
|
|
100
|
-
readonly description: "Requires TAVILY_API_KEY";
|
|
101
|
-
}, {
|
|
102
|
-
readonly value: "firecrawl";
|
|
103
|
-
readonly label: "Firecrawl";
|
|
104
|
-
readonly description: "Uses Firecrawl API when FIRECRAWL_API_KEY is set; falls back to keyless mode";
|
|
105
|
-
}, {
|
|
106
|
-
readonly value: "brave";
|
|
107
|
-
readonly label: "Brave";
|
|
108
|
-
readonly description: "Requires BRAVE_API_KEY";
|
|
109
|
-
}, {
|
|
110
|
-
readonly value: "kimi";
|
|
111
|
-
readonly label: "Kimi";
|
|
112
|
-
readonly description: "Kimi Code search (requires a Kimi Code Console key via KIMI_SEARCH_API_KEY/MOONSHOT_SEARCH_API_KEY or /login kimi-code; not MOONSHOT_API_KEY)";
|
|
113
|
-
}, {
|
|
114
|
-
readonly value: "synthetic";
|
|
115
|
-
readonly label: "Synthetic";
|
|
116
|
-
readonly description: "Requires SYNTHETIC_API_KEY";
|
|
117
|
-
}, {
|
|
118
|
-
readonly value: "ollama";
|
|
119
|
-
readonly label: "Ollama";
|
|
120
|
-
readonly description: "Requires OLLAMA_CLOUD_API_KEY";
|
|
121
|
-
}, {
|
|
122
|
-
readonly value: "searxng";
|
|
123
|
-
readonly label: "SearXNG";
|
|
124
|
-
readonly description: "Requires SEARXNG_ENDPOINT or searxng.endpoint";
|
|
125
|
-
}, {
|
|
126
|
-
readonly value: "startpage";
|
|
127
|
-
readonly label: "Startpage";
|
|
128
|
-
readonly description: "Credential-free scrape of Startpage (Google-backed) results; may be bot-challenged";
|
|
129
|
-
}, {
|
|
130
|
-
readonly value: "duckduckgo";
|
|
131
|
-
readonly label: "DuckDuckGo";
|
|
132
|
-
readonly description: "Credential-free best-effort fallback; may be bot-challenged on datacenter/shared-egress IPs";
|
|
133
|
-
}, {
|
|
134
|
-
readonly value: "ecosia";
|
|
135
|
-
readonly label: "Ecosia";
|
|
136
|
-
readonly description: "Credential-free browser-backed scrape of Ecosia (Google-backed) results";
|
|
137
|
-
}, {
|
|
138
|
-
readonly value: "google";
|
|
139
|
-
readonly label: "Google";
|
|
140
|
-
readonly description: "Credential-free browser-backed fallback; slower and may be bot-challenged";
|
|
141
|
-
}, {
|
|
142
|
-
readonly value: "mojeek";
|
|
143
|
-
readonly label: "Mojeek";
|
|
144
|
-
readonly description: "Credential-free browser-backed scrape of Mojeek's independent index";
|
|
145
|
-
}, {
|
|
146
|
-
readonly value: "public";
|
|
147
|
-
readonly label: "Public Web";
|
|
148
|
-
readonly description: "Queries every credential-free engine in parallel and consolidates deduplicated results";
|
|
149
|
-
}];
|
|
150
|
-
/** Supported web search providers (every option except `auto`). */
|
|
151
|
-
export type SearchProviderId = Exclude<(typeof SEARCH_PROVIDER_OPTIONS)[number]["value"], "auto">;
|
|
152
|
-
/** Display labels, derived from {@link SEARCH_PROVIDER_OPTIONS}. */
|
|
153
|
-
export declare const SEARCH_PROVIDER_LABELS: Record<SearchProviderId, string>;
|
|
154
|
-
/** Source returned by search (all providers) */
|
|
155
|
-
export interface SearchSource {
|
|
156
|
-
title: string;
|
|
157
|
-
url: string;
|
|
158
|
-
snippet?: string;
|
|
159
|
-
/** ISO date string or relative ("2d ago") */
|
|
160
|
-
publishedDate?: string;
|
|
161
|
-
/** Age in seconds for consistent formatting */
|
|
162
|
-
ageSeconds?: number;
|
|
163
|
-
author?: string;
|
|
164
|
-
}
|
|
165
|
-
/** Citation with text reference (LLM-mediated providers) */
|
|
166
|
-
export interface SearchCitation {
|
|
167
|
-
url: string;
|
|
168
|
-
title: string;
|
|
169
|
-
citedText?: string;
|
|
170
|
-
}
|
|
171
|
-
/** Usage metrics */
|
|
172
|
-
export interface SearchUsage {
|
|
173
|
-
inputTokens?: number;
|
|
174
|
-
outputTokens?: number;
|
|
175
|
-
/** Anthropic: number of web search requests made */
|
|
176
|
-
searchRequests?: number;
|
|
177
|
-
/** Perplexity: combined token count */
|
|
178
|
-
totalTokens?: number;
|
|
179
|
-
}
|
|
180
|
-
/** Unified response across providers */
|
|
181
|
-
export interface SearchResponse {
|
|
182
|
-
provider: SearchProviderId | "none";
|
|
183
|
-
/** Synthesized answer text (LLM-mediated providers) */
|
|
184
|
-
answer?: string;
|
|
185
|
-
/** Search result sources */
|
|
186
|
-
sources: SearchSource[];
|
|
187
|
-
/** Text citations with context */
|
|
188
|
-
citations?: SearchCitation[];
|
|
189
|
-
/** Intermediate search queries (anthropic) */
|
|
190
|
-
searchQueries?: string[];
|
|
191
|
-
/** Follow-up question suggestions (provider-dependent) */
|
|
192
|
-
relatedQuestions?: string[];
|
|
193
|
-
/** Token usage metrics */
|
|
194
|
-
usage?: SearchUsage;
|
|
195
|
-
/** Model used */
|
|
196
|
-
model?: string;
|
|
197
|
-
/** Request ID for debugging */
|
|
198
|
-
requestId?: string;
|
|
199
|
-
/** Authentication mode used by the provider (e.g. oauth, api-key) */
|
|
200
|
-
authMode?: string;
|
|
201
|
-
}
|
|
202
|
-
/** Cheap, sync metadata accessor — never triggers a provider load. */
|
|
203
|
-
export declare function getSearchProviderLabel(id: SearchProviderId): string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-tui",
|
|
4
|
-
"version": "18.4.
|
|
4
|
+
"version": "18.4.3",
|
|
5
5
|
"description": "Terminal User Interface library with differential rendering for efficient text-based applications",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": {
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"gen:glyphs": "bun scripts/gen-glyphs.ts"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@oh-my-pi/omptype": "18.4.
|
|
45
|
-
"@oh-my-pi/pi-agent-core": "18.4.
|
|
46
|
-
"@oh-my-pi/pi-ai": "18.4.
|
|
47
|
-
"@oh-my-pi/pi-catalog": "18.4.
|
|
48
|
-
"@oh-my-pi/pi-natives": "18.4.
|
|
49
|
-
"@oh-my-pi/pi-utils": "18.4.
|
|
50
|
-
"@oh-my-pi/pi-wire": "18.4.
|
|
51
|
-
"@oh-my-pi/snapcompact": "18.4.
|
|
44
|
+
"@oh-my-pi/omptype": "18.4.3",
|
|
45
|
+
"@oh-my-pi/pi-agent-core": "18.4.3",
|
|
46
|
+
"@oh-my-pi/pi-ai": "18.4.3",
|
|
47
|
+
"@oh-my-pi/pi-catalog": "18.4.3",
|
|
48
|
+
"@oh-my-pi/pi-natives": "18.4.3",
|
|
49
|
+
"@oh-my-pi/pi-utils": "18.4.3",
|
|
50
|
+
"@oh-my-pi/pi-wire": "18.4.3",
|
|
51
|
+
"@oh-my-pi/snapcompact": "18.4.3"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"kitty-vt-wasm": "^0.2.0"
|