@oh-my-pi/pi-coding-agent 15.11.6 → 15.11.8
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 +57 -1
- package/dist/cli.js +431 -381
- package/dist/types/cli/args.d.ts +2 -0
- package/dist/types/cli/bench-cli.d.ts +78 -0
- package/dist/types/collab/crypto.d.ts +12 -0
- package/dist/types/collab/guest.d.ts +21 -0
- package/dist/types/collab/host.d.ts +13 -0
- package/dist/types/collab/protocol.d.ts +100 -0
- package/dist/types/collab/relay-client.d.ts +22 -0
- package/dist/types/commands/bench.d.ts +29 -0
- package/dist/types/commands/join.d.ts +12 -0
- package/dist/types/config/model-resolver.d.ts +3 -2
- package/dist/types/config/settings-schema.d.ts +93 -1
- package/dist/types/edit/renderer.d.ts +1 -0
- package/dist/types/extensibility/slash-commands.d.ts +1 -11
- package/dist/types/modes/components/agent-hub.d.ts +13 -0
- package/dist/types/modes/components/collab-prompt-message.d.ts +10 -0
- package/dist/types/modes/components/hook-selector.d.ts +4 -6
- package/dist/types/modes/components/oauth-selector.d.ts +10 -1
- package/dist/types/modes/components/segment-track.d.ts +11 -6
- package/dist/types/modes/components/settings-selector.d.ts +8 -1
- package/dist/types/modes/components/snapcompact-shape-preview.d.ts +31 -0
- package/dist/types/modes/components/status-line/component.d.ts +4 -1
- package/dist/types/modes/components/status-line/types.d.ts +9 -0
- package/dist/types/modes/components/tool-execution.d.ts +13 -9
- package/dist/types/modes/interactive-mode.d.ts +7 -0
- package/dist/types/modes/setup-wizard/scenes/sign-in.d.ts +3 -0
- package/dist/types/modes/setup-wizard/scenes/types.d.ts +10 -1
- package/dist/types/modes/setup-wizard/scenes/web-search.d.ts +3 -0
- package/dist/types/modes/types.d.ts +8 -0
- package/dist/types/session/agent-session.d.ts +11 -0
- package/dist/types/session/session-manager.d.ts +21 -0
- package/dist/types/session/snapcompact-inline.d.ts +8 -3
- package/dist/types/slash-commands/builtin-registry.d.ts +9 -0
- package/dist/types/tools/bash.d.ts +2 -0
- package/dist/types/tools/eval-render.d.ts +1 -0
- package/dist/types/tools/renderers.d.ts +13 -0
- package/dist/types/tools/ssh.d.ts +1 -0
- package/package.json +14 -12
- package/scripts/bench-guard.ts +71 -0
- package/src/cli/args.ts +2 -0
- package/src/cli/bench-cli.ts +437 -0
- package/src/cli-commands.ts +2 -0
- package/src/collab/crypto.ts +57 -0
- package/src/collab/guest.ts +421 -0
- package/src/collab/host.ts +494 -0
- package/src/collab/protocol.ts +191 -0
- package/src/collab/relay-client.ts +216 -0
- package/src/commands/bench.ts +42 -0
- package/src/commands/join.ts +39 -0
- package/src/config/model-registry.ts +74 -19
- package/src/config/model-resolver.ts +36 -5
- package/src/config/settings-schema.ts +119 -1
- package/src/edit/renderer.ts +5 -0
- package/src/extensibility/slash-commands.ts +1 -97
- package/src/hindsight/client.ts +26 -1
- package/src/hindsight/state.ts +6 -2
- package/src/internal-urls/docs-index.generated.ts +4 -3
- package/src/main.ts +11 -2
- package/src/mcp/transports/stdio.ts +81 -7
- package/src/modes/components/agent-hub.ts +119 -22
- package/src/modes/components/assistant-message.ts +126 -6
- package/src/modes/components/collab-prompt-message.ts +30 -0
- package/src/modes/components/hook-selector.ts +4 -5
- package/src/modes/components/oauth-selector.ts +67 -7
- package/src/modes/components/segment-track.ts +44 -7
- package/src/modes/components/settings-selector.ts +27 -0
- package/src/modes/components/snapcompact-shape-preview-doc.md +11 -0
- package/src/modes/components/snapcompact-shape-preview.ts +192 -0
- package/src/modes/components/status-line/component.ts +21 -1
- package/src/modes/components/status-line/presets.ts +1 -1
- package/src/modes/components/status-line/segments.ts +13 -0
- package/src/modes/components/status-line/types.ts +10 -0
- package/src/modes/components/tips.txt +2 -1
- package/src/modes/components/tool-execution.ts +18 -10
- package/src/modes/controllers/input-controller.ts +80 -12
- package/src/modes/controllers/selector-controller.ts +6 -2
- package/src/modes/controllers/streaming-reveal.ts +7 -0
- package/src/modes/interactive-mode.ts +36 -4
- package/src/modes/setup-wizard/index.ts +1 -0
- package/src/modes/setup-wizard/scenes/glyph.ts +24 -6
- package/src/modes/setup-wizard/scenes/providers.ts +36 -2
- package/src/modes/setup-wizard/scenes/sign-in.ts +10 -1
- package/src/modes/setup-wizard/scenes/theme.ts +28 -1
- package/src/modes/setup-wizard/scenes/types.ts +10 -1
- package/src/modes/setup-wizard/scenes/web-search.ts +22 -6
- package/src/modes/setup-wizard/wizard-overlay.ts +38 -1
- package/src/modes/types.ts +8 -0
- package/src/modes/utils/context-usage.ts +1 -1
- package/src/modes/utils/ui-helpers.ts +7 -0
- package/src/prompts/bench.md +7 -0
- package/src/sdk.ts +240 -36
- package/src/session/agent-session.ts +22 -0
- package/src/session/session-manager.ts +44 -0
- package/src/session/snapcompact-inline.ts +20 -22
- package/src/slash-commands/builtin-registry.ts +210 -0
- package/src/tools/bash.ts +3 -0
- package/src/tools/eval-render.ts +4 -0
- package/src/tools/read.ts +38 -5
- package/src/tools/renderers.ts +13 -0
- package/src/tools/ssh.ts +3 -0
- package/src/tools/write.ts +13 -42
package/dist/types/cli/args.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ export interface Args {
|
|
|
26
26
|
sessionDir?: string;
|
|
27
27
|
providerSessionId?: string;
|
|
28
28
|
fork?: string;
|
|
29
|
+
/** Collab link to join at startup (set by the `join` subcommand; no CLI flag). */
|
|
30
|
+
join?: string;
|
|
29
31
|
models?: string[];
|
|
30
32
|
tools?: string[];
|
|
31
33
|
noTools?: boolean;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { ResolvedThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import type { Api, ApiKeyResolver, AssistantMessageEventStream, Context, Model, SimpleStreamOptions } from "@oh-my-pi/pi-ai";
|
|
3
|
+
import type { CanonicalModelVariant } from "@oh-my-pi/pi-catalog/identity";
|
|
4
|
+
import type { ApiKeyResolverModel } from "../config/api-key-resolver";
|
|
5
|
+
import { type CanonicalModelQueryOptions } from "../config/model-registry";
|
|
6
|
+
import { Settings } from "../config/settings";
|
|
7
|
+
export interface BenchCommandArgs {
|
|
8
|
+
models: string[];
|
|
9
|
+
flags: {
|
|
10
|
+
runs?: number;
|
|
11
|
+
maxTokens?: number;
|
|
12
|
+
prompt?: string;
|
|
13
|
+
json?: boolean;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface BenchModelRegistry {
|
|
17
|
+
getAll(): Model<Api>[];
|
|
18
|
+
getApiKey(model: Model<Api>, sessionId?: string): Promise<string | undefined>;
|
|
19
|
+
resolver(model: ApiKeyResolverModel, sessionId?: string): ApiKeyResolver;
|
|
20
|
+
resolveCanonicalModel?(canonicalId: string, options?: CanonicalModelQueryOptions): Model<Api> | undefined;
|
|
21
|
+
getCanonicalVariants?(canonicalId: string, options?: CanonicalModelQueryOptions): CanonicalModelVariant[];
|
|
22
|
+
getCanonicalId?(model: Model<Api>): string | undefined;
|
|
23
|
+
}
|
|
24
|
+
export interface BenchRuntime {
|
|
25
|
+
modelRegistry: BenchModelRegistry;
|
|
26
|
+
settings?: Settings;
|
|
27
|
+
close?: () => void;
|
|
28
|
+
}
|
|
29
|
+
export interface BenchRunSuccess {
|
|
30
|
+
ok: true;
|
|
31
|
+
ttftMs: number;
|
|
32
|
+
durationMs: number;
|
|
33
|
+
outputTokens: number;
|
|
34
|
+
/** Generation throughput measured over the post-first-token window. */
|
|
35
|
+
tokensPerSecond: number;
|
|
36
|
+
}
|
|
37
|
+
export interface BenchRunFailure {
|
|
38
|
+
ok: false;
|
|
39
|
+
error: string;
|
|
40
|
+
}
|
|
41
|
+
export type BenchRunResult = BenchRunSuccess | BenchRunFailure;
|
|
42
|
+
export interface BenchAverages {
|
|
43
|
+
ttftMs: number;
|
|
44
|
+
durationMs: number;
|
|
45
|
+
outputTokens: number;
|
|
46
|
+
tokensPerSecond: number;
|
|
47
|
+
}
|
|
48
|
+
export interface BenchModelReport {
|
|
49
|
+
/** Selector as the user typed it (e.g. "opus" or "gemini-3.5:low"). */
|
|
50
|
+
selector: string;
|
|
51
|
+
/** Resolved `provider/id`. */
|
|
52
|
+
model: string;
|
|
53
|
+
/** Explicit thinking level from a `:level` selector suffix; undefined = provider default. */
|
|
54
|
+
thinking?: ResolvedThinkingLevel;
|
|
55
|
+
results: BenchRunResult[];
|
|
56
|
+
/** Averages over successful runs; null when every run failed. */
|
|
57
|
+
average: BenchAverages | null;
|
|
58
|
+
}
|
|
59
|
+
export interface BenchSummary {
|
|
60
|
+
runs: number;
|
|
61
|
+
maxTokens: number;
|
|
62
|
+
models: BenchModelReport[];
|
|
63
|
+
failures: number;
|
|
64
|
+
}
|
|
65
|
+
type BenchStreamSimple = (model: Model<Api>, context: Context, options?: SimpleStreamOptions) => AssistantMessageEventStream;
|
|
66
|
+
export interface BenchDependencies {
|
|
67
|
+
createRuntime?: () => Promise<BenchRuntime>;
|
|
68
|
+
randomSessionId?: () => string;
|
|
69
|
+
writeStdout?: (text: string) => void;
|
|
70
|
+
writeStderr?: (text: string) => void;
|
|
71
|
+
setExitCode?: (code: number) => void;
|
|
72
|
+
streamSimple?: BenchStreamSimple;
|
|
73
|
+
now?: () => number;
|
|
74
|
+
stdoutIsTTY?: boolean;
|
|
75
|
+
}
|
|
76
|
+
export declare function formatBenchTable(summary: BenchSummary): string;
|
|
77
|
+
export declare function runBenchCommand(command: BenchCommandArgs, deps?: BenchDependencies): Promise<BenchSummary>;
|
|
78
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AES-256-GCM sealing for collab frames.
|
|
3
|
+
*
|
|
4
|
+
* The room key lives only in the link fragment; the relay sees opaque bytes.
|
|
5
|
+
* Sealed layout: `[12B IV][ciphertext+tag]`.
|
|
6
|
+
*/
|
|
7
|
+
import type { CollabFrame } from "./protocol";
|
|
8
|
+
export declare function generateRoomKey(): Uint8Array;
|
|
9
|
+
export declare function importRoomKey(raw: Uint8Array): Promise<CryptoKey>;
|
|
10
|
+
export declare function seal(key: CryptoKey, frame: CollabFrame): Promise<Uint8Array>;
|
|
11
|
+
/** Inverse of {@link seal}. Throws on auth failure or malformed input. */
|
|
12
|
+
export declare function open(key: CryptoKey, data: Uint8Array): Promise<CollabFrame>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ImageContent } from "@oh-my-pi/pi-ai";
|
|
2
|
+
import type { AgentHubRemote } from "../modes/components/agent-hub";
|
|
3
|
+
import type { InteractiveModeContext } from "../modes/types";
|
|
4
|
+
import { AgentRegistry } from "../registry/agent-registry";
|
|
5
|
+
import { type CollabSessionState } from "./protocol";
|
|
6
|
+
/** Commands a guest may run locally; everything else is host-only. */
|
|
7
|
+
export declare const COLLAB_GUEST_ALLOWED_COMMANDS: Record<string, true>;
|
|
8
|
+
export declare class CollabGuestLink {
|
|
9
|
+
#private;
|
|
10
|
+
state: CollabSessionState | null;
|
|
11
|
+
/** Local mirror of the host's agent ecosystem (refs carry `session: null`). */
|
|
12
|
+
readonly agentRegistry: AgentRegistry;
|
|
13
|
+
/** Agent Hub actions routed to the host over the wire. */
|
|
14
|
+
get hubRemote(): AgentHubRemote;
|
|
15
|
+
constructor(ctx: InteractiveModeContext);
|
|
16
|
+
join(link: string): Promise<void>;
|
|
17
|
+
/** User-initiated leave (or post-disconnect cleanup): restore the previous session. */
|
|
18
|
+
leave(_reason: string): Promise<void>;
|
|
19
|
+
sendPrompt(text: string, images?: ImageContent[]): void;
|
|
20
|
+
sendAbort(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { InteractiveModeContext } from "../modes/types";
|
|
2
|
+
import { type CollabParticipant } from "./protocol";
|
|
3
|
+
/** Display name for this process's user in collab sessions. */
|
|
4
|
+
export declare function collabDisplayName(ctx: InteractiveModeContext): string;
|
|
5
|
+
export declare class CollabHost {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(ctx: InteractiveModeContext);
|
|
8
|
+
get link(): string;
|
|
9
|
+
get participants(): CollabParticipant[];
|
|
10
|
+
start(relayUrl: string): Promise<void>;
|
|
11
|
+
/** Broadcast a goodbye, detach all taps, and close the socket. */
|
|
12
|
+
stop(reason: string): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collab live-session wire protocol.
|
|
3
|
+
*
|
|
4
|
+
* Hub topology: the host is authoritative, guests never peer. All session
|
|
5
|
+
* payloads (`CollabFrame`) travel AES-256-GCM sealed; the relay only sees the
|
|
6
|
+
* plaintext envelope (`[4B uint32 BE peerId][sealed payload]`) plus TEXT JSON
|
|
7
|
+
* control messages that carry no session data.
|
|
8
|
+
*/
|
|
9
|
+
import type { ImageContent, Model } from "@oh-my-pi/pi-ai";
|
|
10
|
+
import type { BusChannel, GuestFrame, ParsedCollabLink, Participant, SessionState, AgentSnapshot as WireAgentSnapshot } from "@oh-my-pi/pi-wire";
|
|
11
|
+
import { DEFAULT_RELAY_URL, ENVELOPE_HEADER_LENGTH, ROOM_ID_BYTES } from "@oh-my-pi/pi-wire";
|
|
12
|
+
import type { ContextUsage } from "../extensibility/extensions/types";
|
|
13
|
+
import type { AgentSessionEvent } from "../session/agent-session";
|
|
14
|
+
import type { SessionEntry, SessionHeader } from "../session/session-manager";
|
|
15
|
+
export type { CollabPromptDetails, ParsedCollabLink, RelayControlMessage, RelayControlToGuest, RelayControlToHost, } from "@oh-my-pi/pi-wire";
|
|
16
|
+
export { COLLAB_PROMPT_MESSAGE_TYPE, COLLAB_PROTO } from "@oh-my-pi/pi-wire";
|
|
17
|
+
export { DEFAULT_RELAY_URL, ENVELOPE_HEADER_LENGTH, ROOM_ID_BYTES };
|
|
18
|
+
export type CollabParticipant = Participant;
|
|
19
|
+
export type AgentSnapshot = WireAgentSnapshot;
|
|
20
|
+
/** Debounced footer snapshot broadcast by the host. */
|
|
21
|
+
export type CollabSessionState = SessionState & {
|
|
22
|
+
/**
|
|
23
|
+
* Host model (full catalog object). Guests apply it to their replica
|
|
24
|
+
* agent state so model display and context-window math are native.
|
|
25
|
+
*/
|
|
26
|
+
model?: Model;
|
|
27
|
+
/** Host status-line context numbers (guest system prompt/tools differ, so local estimates drift). */
|
|
28
|
+
contextUsage?: ContextUsage;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Encrypted payload frames (inside AES-GCM, JSON). The wire package pins the
|
|
32
|
+
* JSON skeleton (`WireFrame`); host-side frames carry the rich session types
|
|
33
|
+
* that serialize into those shapes.
|
|
34
|
+
*/
|
|
35
|
+
export type CollabFrame = Exclude<GuestFrame, {
|
|
36
|
+
t: "prompt";
|
|
37
|
+
}> | {
|
|
38
|
+
t: "prompt";
|
|
39
|
+
text: string;
|
|
40
|
+
images?: ImageContent[];
|
|
41
|
+
} | {
|
|
42
|
+
t: "welcome";
|
|
43
|
+
proto: number;
|
|
44
|
+
header: SessionHeader;
|
|
45
|
+
entries: SessionEntry[];
|
|
46
|
+
state: CollabSessionState;
|
|
47
|
+
agents: AgentSnapshot[];
|
|
48
|
+
} | {
|
|
49
|
+
t: "entry";
|
|
50
|
+
entry: SessionEntry;
|
|
51
|
+
} | {
|
|
52
|
+
t: "event";
|
|
53
|
+
event: AgentSessionEvent;
|
|
54
|
+
} | {
|
|
55
|
+
t: "state";
|
|
56
|
+
state: CollabSessionState;
|
|
57
|
+
}
|
|
58
|
+
/** Mirrored EventBus traffic (task subagent lifecycle/progress channels only). */
|
|
59
|
+
| {
|
|
60
|
+
t: "bus";
|
|
61
|
+
channel: BusChannel;
|
|
62
|
+
data: unknown;
|
|
63
|
+
}
|
|
64
|
+
/** Full agent-registry snapshot (debounced on registry change). */
|
|
65
|
+
| {
|
|
66
|
+
t: "agents";
|
|
67
|
+
agents: AgentSnapshot[];
|
|
68
|
+
}
|
|
69
|
+
/** Targeted reply to fetch-transcript; `text` is decoded JSONL from `fromByte`, `newSize` the next offset base. */
|
|
70
|
+
| {
|
|
71
|
+
t: "transcript";
|
|
72
|
+
reqId: number;
|
|
73
|
+
text: string;
|
|
74
|
+
newSize: number;
|
|
75
|
+
error?: string;
|
|
76
|
+
} | {
|
|
77
|
+
t: "bye";
|
|
78
|
+
reason: string;
|
|
79
|
+
} | {
|
|
80
|
+
t: "error";
|
|
81
|
+
message: string;
|
|
82
|
+
};
|
|
83
|
+
export declare function packEnvelope(peerId: number, sealed: Uint8Array): Uint8Array;
|
|
84
|
+
export declare function unpackEnvelope(data: Uint8Array): {
|
|
85
|
+
peerId: number;
|
|
86
|
+
payload: Uint8Array;
|
|
87
|
+
} | null;
|
|
88
|
+
/** Rewrite the peerId in place without copying the payload. */
|
|
89
|
+
export declare function rewriteEnvelopePeer(data: Uint8Array, peerId: number): void;
|
|
90
|
+
export declare function generateRoomId(): string;
|
|
91
|
+
/**
|
|
92
|
+
* Render the shareable link. Compact forms: the default relay collapses to
|
|
93
|
+
* `<roomId>#<key>`, other wss relays drop the scheme (`host[:port]/r/…`);
|
|
94
|
+
* only localhost ws:// links keep their full URL so parsing cannot
|
|
95
|
+
* mis-infer wss.
|
|
96
|
+
*/
|
|
97
|
+
export declare function formatCollabLink(relayUrl: string, roomId: string, key: Uint8Array): string;
|
|
98
|
+
export declare function parseCollabLink(link: string): ParsedCollabLink | {
|
|
99
|
+
error: string;
|
|
100
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CollabFrame, RelayControlMessage } from "./protocol";
|
|
2
|
+
export interface CollabSocketOptions {
|
|
3
|
+
/** wss://host[:port]/r/<roomId> — no query string. */
|
|
4
|
+
wsUrl: string;
|
|
5
|
+
role: "host" | "guest";
|
|
6
|
+
key: CryptoKey;
|
|
7
|
+
}
|
|
8
|
+
export declare class CollabSocket {
|
|
9
|
+
#private;
|
|
10
|
+
/** Fires after every successful (re)connect. */
|
|
11
|
+
onOpen?: () => void;
|
|
12
|
+
onFrame?: (frame: CollabFrame, fromPeer: number) => void;
|
|
13
|
+
onControl?: (msg: RelayControlMessage) => void;
|
|
14
|
+
/** Fires once per terminal close (intentional, fatal code, or bad key). willReconnect=true for transient drops that will retry. */
|
|
15
|
+
onClose?: (reason: string, willReconnect: boolean) => void;
|
|
16
|
+
constructor(opts: CollabSocketOptions);
|
|
17
|
+
get isOpen(): boolean;
|
|
18
|
+
connect(): void;
|
|
19
|
+
send(frame: CollabFrame, targetPeer?: number): void;
|
|
20
|
+
/** Intentional close: clears any retry timer, suppresses reconnect. A later connect() starts fresh. */
|
|
21
|
+
close(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Command } from "@oh-my-pi/pi-utils/cli";
|
|
2
|
+
export default class Bench extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
models: import("@oh-my-pi/pi-utils/cli").ArgDescriptor & {
|
|
6
|
+
description: string;
|
|
7
|
+
required: true;
|
|
8
|
+
multiple: true;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
static flags: {
|
|
12
|
+
runs: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"integer"> & {
|
|
13
|
+
description: string;
|
|
14
|
+
default: number;
|
|
15
|
+
};
|
|
16
|
+
"max-tokens": import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"integer"> & {
|
|
17
|
+
description: string;
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
prompt: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"string"> & {
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
json: import("@oh-my-pi/pi-utils/cli").FlagDescriptor<"boolean"> & {
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
static examples: string[];
|
|
28
|
+
run(): Promise<void>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from "@oh-my-pi/pi-utils/cli";
|
|
2
|
+
export default class Join extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
link: import("@oh-my-pi/pi-utils/cli").ArgDescriptor & {
|
|
6
|
+
description: string;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
static examples: string[];
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Layering:
|
|
5
5
|
* - `matchModel` is the single matching engine. Order: exact `provider/id`
|
|
6
|
-
* reference (with OpenRouter routed/date fallbacks) →
|
|
7
|
-
* exact
|
|
6
|
+
* reference (with variant-alias and OpenRouter routed/date fallbacks) →
|
|
7
|
+
* exact canonical id → exact bare id → retired variant alias →
|
|
8
|
+
* provider-scoped fuzzy → substring with alias-vs-dated pick.
|
|
8
9
|
* - `parseModelPatternWithContext`/`parseModelPattern` layer the selector
|
|
9
10
|
* grammar on top: trailing `:level` thinking suffixes (`splitThinkingSuffix`)
|
|
10
11
|
* and `@upstream` provider routing (`splitUpstreamRouting`).
|
|
@@ -33,7 +33,7 @@ export declare const TAB_METADATA: Record<SettingTab, {
|
|
|
33
33
|
*/
|
|
34
34
|
export declare const TAB_GROUPS: Record<SettingTab, readonly string[]>;
|
|
35
35
|
/** Status line segment identifiers */
|
|
36
|
-
export type StatusLineSegmentId = "pi" | "model" | "mode" | "path" | "git" | "pr" | "subagents" | "token_in" | "token_out" | "token_total" | "token_rate" | "cost" | "context_pct" | "context_total" | "time_spent" | "time" | "session" | "hostname" | "cache_read" | "cache_write" | "cache_hit" | "session_name" | "usage";
|
|
36
|
+
export type StatusLineSegmentId = "pi" | "model" | "mode" | "path" | "git" | "pr" | "subagents" | "token_in" | "token_out" | "token_total" | "token_rate" | "cost" | "context_pct" | "context_total" | "time_spent" | "time" | "session" | "hostname" | "cache_read" | "cache_write" | "cache_hit" | "session_name" | "usage" | "collab";
|
|
37
37
|
/** Submenu choice metadata. */
|
|
38
38
|
export type SubmenuOption<V extends string = string> = {
|
|
39
39
|
value: V;
|
|
@@ -1394,6 +1394,26 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1394
1394
|
readonly description: "Notify when the ask tool is waiting for input";
|
|
1395
1395
|
};
|
|
1396
1396
|
};
|
|
1397
|
+
readonly "collab.relayUrl": {
|
|
1398
|
+
readonly type: "string";
|
|
1399
|
+
readonly default: "wss://relay.omp.sh";
|
|
1400
|
+
readonly ui: {
|
|
1401
|
+
readonly tab: "interaction";
|
|
1402
|
+
readonly group: "Collab";
|
|
1403
|
+
readonly label: "Relay URL";
|
|
1404
|
+
readonly description: "Relay used by /collab (wss://host[:port]; self-host with the omp-collab-relay service)";
|
|
1405
|
+
};
|
|
1406
|
+
};
|
|
1407
|
+
readonly "collab.displayName": {
|
|
1408
|
+
readonly type: "string";
|
|
1409
|
+
readonly default: "";
|
|
1410
|
+
readonly ui: {
|
|
1411
|
+
readonly tab: "interaction";
|
|
1412
|
+
readonly group: "Collab";
|
|
1413
|
+
readonly label: "Display Name";
|
|
1414
|
+
readonly description: "Name shown to other collab participants (default: OS username)";
|
|
1415
|
+
};
|
|
1416
|
+
};
|
|
1397
1417
|
readonly "stt.enabled": {
|
|
1398
1418
|
readonly type: "boolean";
|
|
1399
1419
|
readonly default: false;
|
|
@@ -1771,6 +1791,78 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1771
1791
|
readonly description: "Experimental: render large historical tool results as dense PNG image(s) instead of text (vision models only). Saves tokens on accumulated read/search output.";
|
|
1772
1792
|
};
|
|
1773
1793
|
};
|
|
1794
|
+
readonly "snapcompact.shape": {
|
|
1795
|
+
readonly type: "enum";
|
|
1796
|
+
readonly values: readonly ["auto", ...("5x8-bw" | "5x8-sent" | "6x12-dim" | "6x6u-bw" | "6x6u-sent" | "8on16-bw" | "8x13-bw" | "8x8r-bw" | "8x8r-sent" | "8x8u-bw" | "8x8u-sent" | "doc-8on16-bw" | "doc-8on16-sent" | "doc-8on16-sent-dim")[]];
|
|
1797
|
+
readonly default: "auto";
|
|
1798
|
+
readonly ui: {
|
|
1799
|
+
readonly tab: "context";
|
|
1800
|
+
readonly group: "Experimental";
|
|
1801
|
+
readonly label: "Snapcompact Shape";
|
|
1802
|
+
readonly description: "Frame shape snapcompact prints text with (compaction archive and inline imaging). Auto picks a shape tuned for the current model.";
|
|
1803
|
+
readonly options: readonly [{
|
|
1804
|
+
readonly value: "auto";
|
|
1805
|
+
readonly label: "Auto";
|
|
1806
|
+
readonly description: "Picks a shape tuned for the current model, falling back to its provider family.";
|
|
1807
|
+
}, {
|
|
1808
|
+
readonly value: "8x8r-bw";
|
|
1809
|
+
readonly label: "8x8 repeated, black";
|
|
1810
|
+
readonly description: "unscii square cell, black ink, every line printed twice with the copy on a pale highlight band.";
|
|
1811
|
+
}, {
|
|
1812
|
+
readonly value: "8x8r-sent";
|
|
1813
|
+
readonly label: "8x8 repeated, sentence hues";
|
|
1814
|
+
readonly description: "Repeated grid with ink cycling six hues at sentence boundaries.";
|
|
1815
|
+
}, {
|
|
1816
|
+
readonly value: "8x8u-bw";
|
|
1817
|
+
readonly label: "8x8, black";
|
|
1818
|
+
readonly description: "Plain unscii square cell, single-printed lines, black ink.";
|
|
1819
|
+
}, {
|
|
1820
|
+
readonly value: "8x8u-sent";
|
|
1821
|
+
readonly label: "8x8, sentence hues";
|
|
1822
|
+
readonly description: "Plain unscii square cell with sentence-hue ink.";
|
|
1823
|
+
}, {
|
|
1824
|
+
readonly value: "6x6u-bw";
|
|
1825
|
+
readonly label: "6x6 dense, black";
|
|
1826
|
+
readonly description: "unscii squeezed to 6x6 — densest readable cell, fewest frames — in black ink.";
|
|
1827
|
+
}, {
|
|
1828
|
+
readonly value: "6x6u-sent";
|
|
1829
|
+
readonly label: "6x6 dense, sentence hues";
|
|
1830
|
+
readonly description: "Densest cell with sentence-hue ink.";
|
|
1831
|
+
}, {
|
|
1832
|
+
readonly value: "5x8-bw";
|
|
1833
|
+
readonly label: "5x8 legacy, black";
|
|
1834
|
+
readonly description: "Original X.org 5x8 glyphs on the 2576px frame, black ink.";
|
|
1835
|
+
}, {
|
|
1836
|
+
readonly value: "5x8-sent";
|
|
1837
|
+
readonly label: "5x8 legacy, sentence hues";
|
|
1838
|
+
readonly description: "The original snapcompact shape (pre-shape-table sessions rendered this).";
|
|
1839
|
+
}, {
|
|
1840
|
+
readonly value: "6x12-dim";
|
|
1841
|
+
readonly label: "6x12, dimmed stopwords";
|
|
1842
|
+
readonly description: "X.org 6x12 glyphs, black ink, function words dimmed gray.";
|
|
1843
|
+
}, {
|
|
1844
|
+
readonly value: "8x13-bw";
|
|
1845
|
+
readonly label: "8x13, black";
|
|
1846
|
+
readonly description: "X.org 8x13 glyphs, black ink.";
|
|
1847
|
+
}, {
|
|
1848
|
+
readonly value: "8on16-bw";
|
|
1849
|
+
readonly label: "8x13 on 16px pitch, black";
|
|
1850
|
+
readonly description: "8x13 glyphs on an 8x16 cell (extra leading), black ink.";
|
|
1851
|
+
}, {
|
|
1852
|
+
readonly value: "doc-8on16-bw";
|
|
1853
|
+
readonly label: "Doc 8on16, black";
|
|
1854
|
+
readonly description: "Two word-wrapped newspaper columns of 8x13 glyphs on a 16px pitch, black ink.";
|
|
1855
|
+
}, {
|
|
1856
|
+
readonly value: "doc-8on16-sent";
|
|
1857
|
+
readonly label: "Doc 8on16, sentence hues";
|
|
1858
|
+
readonly description: "Two-column doc layout with sentence-hue ink.";
|
|
1859
|
+
}, {
|
|
1860
|
+
readonly value: "doc-8on16-sent-dim";
|
|
1861
|
+
readonly label: "Doc 8on16, sentence hues + dimmed stopwords";
|
|
1862
|
+
readonly description: "Two-column doc layout, sentence-hue ink, function words dimmed gray.";
|
|
1863
|
+
}];
|
|
1864
|
+
};
|
|
1865
|
+
};
|
|
1774
1866
|
readonly "branchSummary.enabled": {
|
|
1775
1867
|
readonly type: "boolean";
|
|
1776
1868
|
readonly default: false;
|
|
@@ -93,6 +93,7 @@ export interface EditRenderContext {
|
|
|
93
93
|
}
|
|
94
94
|
export declare const editToolRenderer: {
|
|
95
95
|
mergeCallAndResult: boolean;
|
|
96
|
+
provisionalPendingPreview: boolean;
|
|
96
97
|
renderCall(args: EditRenderArgs, options: RenderResultOptions & {
|
|
97
98
|
renderContext?: EditRenderContext;
|
|
98
99
|
}, uiTheme: Theme): Component;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { AutocompleteItem } from "@oh-my-pi/pi-tui";
|
|
2
|
-
import { type BuiltinSlashCommand } from "../slash-commands/builtin-registry";
|
|
3
1
|
export type SlashCommandSource = "extension" | "prompt" | "skill";
|
|
4
2
|
export type SlashCommandLocation = "user" | "project" | "path";
|
|
5
3
|
export interface SlashCommandInfo {
|
|
@@ -9,15 +7,7 @@ export interface SlashCommandInfo {
|
|
|
9
7
|
location?: SlashCommandLocation;
|
|
10
8
|
path?: string;
|
|
11
9
|
}
|
|
12
|
-
export type { BuiltinSlashCommand, SubcommandDef } from "../slash-commands/
|
|
13
|
-
/**
|
|
14
|
-
* Materialized builtin slash commands with completion functions derived from
|
|
15
|
-
* declarative subcommand/hint definitions.
|
|
16
|
-
*/
|
|
17
|
-
export declare const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand & {
|
|
18
|
-
getArgumentCompletions?: (prefix: string) => AutocompleteItem[] | null;
|
|
19
|
-
getInlineHint?: (argumentText: string) => string | null;
|
|
20
|
-
}>;
|
|
10
|
+
export type { BuiltinSlashCommand, SubcommandDef } from "../slash-commands/types";
|
|
21
11
|
/**
|
|
22
12
|
* Represents a custom slash command loaded from a file
|
|
23
13
|
*/
|
|
@@ -4,6 +4,17 @@ import { IrcBus } from "../../irc/bus";
|
|
|
4
4
|
import { AgentLifecycleManager } from "../../registry/agent-lifecycle";
|
|
5
5
|
import { AgentRegistry } from "../../registry/agent-registry";
|
|
6
6
|
import type { SessionObserverRegistry } from "../session-observer-registry";
|
|
7
|
+
/** Guest-side proxy for hub actions executed on the collab host. */
|
|
8
|
+
export interface AgentHubRemote {
|
|
9
|
+
chat(id: string, text: string): void;
|
|
10
|
+
kill(id: string): void;
|
|
11
|
+
revive(id: string): void;
|
|
12
|
+
/** Mirrors readFileIncremental: text from fromByte (complete JSONL lines), newSize = next fromByte base; null = unavailable. */
|
|
13
|
+
readTranscript(id: string, fromByte: number): Promise<{
|
|
14
|
+
text: string;
|
|
15
|
+
newSize: number;
|
|
16
|
+
} | null>;
|
|
17
|
+
}
|
|
7
18
|
export interface AgentHubDeps {
|
|
8
19
|
/** Progress/status snapshot source (task lifecycle + progress channels). */
|
|
9
20
|
observers: SessionObserverRegistry;
|
|
@@ -17,6 +28,8 @@ export interface AgentHubDeps {
|
|
|
17
28
|
lifecycle?: AgentLifecycleManager;
|
|
18
29
|
/** Injectable for tests; defaults to the process-global bus. */
|
|
19
30
|
irc?: IrcBus;
|
|
31
|
+
/** Collab guest: route actions/transcripts to the host instead of local sessions. */
|
|
32
|
+
remote?: AgentHubRemote;
|
|
20
33
|
}
|
|
21
34
|
export declare class AgentHubOverlayComponent extends Container {
|
|
22
35
|
#private;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Container } from "@oh-my-pi/pi-tui";
|
|
2
|
+
import type { CollabPromptDetails } from "../../collab/protocol";
|
|
3
|
+
import type { CustomMessage } from "../../session/messages";
|
|
4
|
+
/**
|
|
5
|
+
* Renders a collab guest prompt on every participant's transcript: a
|
|
6
|
+
* user-message-styled bubble prefixed with the author's name.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CollabPromptMessageComponent extends Container {
|
|
9
|
+
constructor(message: CustomMessage<CollabPromptDetails>);
|
|
10
|
+
}
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
* Displays a list of string options with keyboard navigation.
|
|
4
4
|
*/
|
|
5
5
|
import { Container, type TUI } from "@oh-my-pi/pi-tui";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
/** One segment of a {@link HookSelectorSlider} — a label and an optional
|
|
7
|
+
* detail line (e.g. the resolved model name) shown beneath the track while
|
|
8
|
+
* the segment is active. Segment colors come from the track's theme palette,
|
|
9
|
+
* assigned by position. */
|
|
10
10
|
export interface HookSelectorSliderSegment {
|
|
11
11
|
label: string;
|
|
12
|
-
/** Theme color for the segment label; defaults to `accent`. */
|
|
13
|
-
color?: ThemeColor;
|
|
14
12
|
/** Secondary line rendered under the track when this segment is selected. */
|
|
15
13
|
detail?: string;
|
|
16
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Container } from "@oh-my-pi/pi-tui";
|
|
1
|
+
import { Container, type SgrMouseEvent } from "@oh-my-pi/pi-tui";
|
|
2
2
|
import type { AuthStorage } from "../../session/auth-storage";
|
|
3
3
|
/**
|
|
4
4
|
* Component that renders an OAuth provider selector.
|
|
@@ -11,4 +11,13 @@ export declare class OAuthSelectorComponent extends Container {
|
|
|
11
11
|
});
|
|
12
12
|
stopValidation(): void;
|
|
13
13
|
handleInput(keyData: string): void;
|
|
14
|
+
/** Move the selection one step for a wheel notch (clamped, no wrap). */
|
|
15
|
+
handleWheel(delta: -1 | 1): void;
|
|
16
|
+
/**
|
|
17
|
+
* Route an SGR mouse report at component-local coordinates. Provider rows
|
|
18
|
+
* start LIST_ROW_OFFSET lines into the render; the ScrollView window shows
|
|
19
|
+
* #visibleCount rows from #scrollStart. Wheel moves the selection, motion
|
|
20
|
+
* drives the hover band, and a left click selects and confirms like Enter.
|
|
21
|
+
*/
|
|
22
|
+
routeMouse(event: SgrMouseEvent, line: number, _col: number): void;
|
|
14
23
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared renderer for a horizontal row of colored "segments" styled after the
|
|
3
|
-
* status line: each segment
|
|
4
|
-
* as a powerline chip (its
|
|
5
|
-
* flanked by triangle caps) and the
|
|
6
|
-
* thin separator.
|
|
3
|
+
* status line: each segment is colored by its track position from the theme's
|
|
4
|
+
* own palette, the active one is filled as a powerline chip (its color as the
|
|
5
|
+
* background, a luminance-matched label, flanked by triangle caps) and the
|
|
6
|
+
* rest are plain colored labels joined by a thin separator.
|
|
7
7
|
*
|
|
8
8
|
* Used by the plan-mode model-tier slider ({@link HookSelectorComponent}) and
|
|
9
9
|
* the ctrl+p role-cycle status so both surfaces read identically.
|
|
@@ -11,9 +11,14 @@
|
|
|
11
11
|
import { type ThemeColor } from "../theme/theme";
|
|
12
12
|
export interface TrackSegment {
|
|
13
13
|
label: string;
|
|
14
|
-
/** Theme color for the segment; defaults to `accent`. */
|
|
15
|
-
color?: ThemeColor;
|
|
16
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Resolve up to `count` theme colors that render distinctly under the active
|
|
17
|
+
* theme, in candidate preference order. May return fewer than `count` when the
|
|
18
|
+
* theme has fewer distinct hues (e.g. monochrome themes) — callers wrap with
|
|
19
|
+
* modulo. Never returns an empty array: `accent` always resolves.
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolveSegmentPalette(count: number): ThemeColor[];
|
|
17
22
|
/**
|
|
18
23
|
* Render `segments` as a colored chip track with `activeIndex` filled. Returns
|
|
19
24
|
* a single line of styled text with no surrounding caption or arrows — callers
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import type { Effort } from "@oh-my-pi/pi-ai";
|
|
3
|
-
import { type Component } from "@oh-my-pi/pi-tui";
|
|
3
|
+
import { type Component, type ImageBudget } from "@oh-my-pi/pi-tui";
|
|
4
|
+
import type { ShapeTarget } from "@oh-my-pi/snapcompact";
|
|
4
5
|
import { type SettingPath } from "../../config/settings";
|
|
5
6
|
import type { StatusLinePreset, StatusLineSegmentId, StatusLineSeparatorStyle } from "../../config/settings-schema";
|
|
6
7
|
/**
|
|
@@ -16,6 +17,12 @@ export interface SettingsRuntimeContext {
|
|
|
16
17
|
availableThemes: string[];
|
|
17
18
|
/** Working directory for plugins tab */
|
|
18
19
|
cwd: string;
|
|
20
|
+
/** Active model (api + id); resolves what the snapcompact `auto` shape maps to. */
|
|
21
|
+
model?: ShapeTarget;
|
|
22
|
+
/** Shared TUI image budget (graphics ids + transmit-once) for image previews. */
|
|
23
|
+
imageBudget?: ImageBudget;
|
|
24
|
+
/** Schedules a re-render after async preview work completes. */
|
|
25
|
+
requestRender?: () => void;
|
|
19
26
|
}
|
|
20
27
|
/** Status line settings subset for preview */
|
|
21
28
|
export interface StatusLinePreviewSettings {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live preview for the `snapcompact.shape` setting: renders a sample session
|
|
3
|
+
* transcript through the real snapcompact rasterizer as a miniature page and
|
|
4
|
+
* shows it zoomed, so cell size, ink hues, highlight bands, and dim tool-result
|
|
5
|
+
* spans are legible at terminal scale.
|
|
6
|
+
*
|
|
7
|
+
* The mini-frame (a {@link SRC_FRAME_PX}px page) is upscaled with
|
|
8
|
+
* nearest-neighbor so the glyph pixels stay crisp when the terminal scales the
|
|
9
|
+
* placement box. Graphics display requires the Kitty unicode-placeholder path —
|
|
10
|
+
* `renderImage` returning `lines` is the gate — because the bordered settings
|
|
11
|
+
* frame re-fits every row, which direct cursor-positioned placements (iTerm2,
|
|
12
|
+
* Sixel, Kitty `a=p`) do not survive. Everything else falls back to the stats
|
|
13
|
+
* line plus a dim notice.
|
|
14
|
+
*/
|
|
15
|
+
import { type Component, type ImageBudget } from "@oh-my-pi/pi-tui";
|
|
16
|
+
import { type ShapeTarget } from "@oh-my-pi/snapcompact";
|
|
17
|
+
export interface SnapcompactShapePreviewOptions {
|
|
18
|
+
/** Active model (api + id); resolves what `auto` maps to for this reader. */
|
|
19
|
+
model?: ShapeTarget;
|
|
20
|
+
/** Shared TUI image budget: stable graphics ids, transmit-once, exit cleanup. */
|
|
21
|
+
imageBudget?: ImageBudget;
|
|
22
|
+
/** Schedules a re-render once an async sample render completes. */
|
|
23
|
+
requestRender?: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare class SnapcompactShapePreview implements Component {
|
|
26
|
+
#private;
|
|
27
|
+
constructor(currentValue: string, options?: SnapcompactShapePreviewOptions);
|
|
28
|
+
/** Track the highlighted option; the next render reflects it. */
|
|
29
|
+
setValue(value: string): void;
|
|
30
|
+
render(width: number): readonly string[];
|
|
31
|
+
}
|