@oh-my-pi/pi-tui 18.2.10 → 18.3.0

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/THIRD-PARTY-NOTICES.txt +1 -1
  3. package/dist/types/apps/ps-data.d.ts +1 -1
  4. package/dist/types/apps/ps-top.d.ts +1 -1
  5. package/dist/types/chat/chat-transcript-builder.d.ts +1 -1
  6. package/dist/types/overlays/annotation-overlay.d.ts +30 -0
  7. package/dist/types/overlays/annotation-types.d.ts +84 -0
  8. package/dist/types/overlays/copy-selector.d.ts +30 -2
  9. package/dist/types/overlays/copy-targets.d.ts +2 -0
  10. package/dist/types/overlays/model-hub.d.ts +2 -2
  11. package/dist/types/overlays/oauth-selector.d.ts +3 -6
  12. package/dist/types/overlays/usage-dashboard.d.ts +2 -0
  13. package/dist/types/prompt/image-source.d.ts +9 -8
  14. package/dist/types/render/render-utils.d.ts +2 -0
  15. package/dist/types/status-line/context-usage.d.ts +3 -1
  16. package/dist/types/theme/mermaid-cache.d.ts +4 -6
  17. package/dist/types/tools/bash.d.ts +7 -0
  18. package/dist/types/tools/daemon.d.ts +46 -0
  19. package/dist/types/tools/irc.d.ts +30 -0
  20. package/dist/types/tools/line-ranges.d.ts +1 -1
  21. package/dist/types/tools/proc-render.d.ts +34 -0
  22. package/dist/types/tools/read.d.ts +4 -1
  23. package/dist/types/tools/task.d.ts +4 -0
  24. package/dist/types/tools/wait.d.ts +131 -0
  25. package/dist/types/tools/write.d.ts +4 -0
  26. package/dist/types/tools/xd-url.d.ts +8 -0
  27. package/dist/types/windows-altgr.d.ts +54 -0
  28. package/package.json +13 -10
  29. package/src/apps/debug/protocol-probe.ts +1 -1
  30. package/src/apps/ps-data.ts +1 -1
  31. package/src/apps/ps-top.ts +1 -1
  32. package/src/chat/chat-transcript-builder.ts +4 -4
  33. package/src/chat/tool-execution.ts +8 -8
  34. package/src/chat/transcript-render-helpers.ts +3 -3
  35. package/src/components/markdown.ts +1 -1
  36. package/src/desktop-notify.ts +1 -1
  37. package/src/overlays/annotation-overlay.ts +1145 -0
  38. package/src/overlays/annotation-types.ts +78 -0
  39. package/src/overlays/copy-selector.ts +45 -19
  40. package/src/overlays/copy-targets.ts +3 -3
  41. package/src/overlays/model-hub.ts +5 -4
  42. package/src/overlays/oauth-selector.ts +8 -12
  43. package/src/overlays/plan-review-overlay.ts +213 -40
  44. package/src/overlays/settings-defs.ts +1 -0
  45. package/src/overlays/usage-dashboard.ts +120 -25
  46. package/src/prompt/image-source.ts +9 -8
  47. package/src/prompt/welcome.ts +4 -1
  48. package/src/render/render-utils.ts +1 -1
  49. package/src/setup/scenes/sign-in.ts +1 -1
  50. package/src/status-line/component.ts +15 -4
  51. package/src/status-line/context-usage.ts +15 -3
  52. package/src/status-line/segments.ts +3 -3
  53. package/src/terminal-capabilities.ts +16 -7
  54. package/src/terminal.ts +8 -1
  55. package/src/theme/mermaid-cache.ts +83 -25
  56. package/src/tools/bash.ts +14 -1
  57. package/src/tools/daemon.ts +51 -0
  58. package/src/tools/index.ts +2 -2
  59. package/src/tools/irc.ts +33 -0
  60. package/src/tools/line-ranges.ts +13 -3
  61. package/src/tools/proc-render.ts +294 -0
  62. package/src/tools/read.ts +22 -1
  63. package/src/tools/task.ts +18 -0
  64. package/src/tools/wait.ts +595 -0
  65. package/src/tools/write.ts +76 -0
  66. package/src/tools/xd-url.ts +9 -0
  67. package/src/windows-altgr.ts +227 -0
  68. package/dist/types/tools/hub.d.ts +0 -342
  69. package/src/tools/hub.ts +0 -1492
package/CHANGELOG.md CHANGED
@@ -2,6 +2,38 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [18.3.0] - 2026-09-24
6
+
7
+ ### Added
8
+
9
+ - Added proc:// and agent:// URI support for interacting with processes and agents.
10
+ - Added support for xd:// documentation topic URLs.
11
+ - Added rendering for background job state and peer-to-peer messages from the wait tool.
12
+ - Added supervised bash service rendering with status, readiness, and output information.
13
+ - Added a fullscreen annotation overlay for diffs and text, including multi-line notes, editing, deletion, and undo ([#12601](https://github.com/can1357/oh-my-pi/pull/12601) by [@anatoli-tsinovoy](https://github.com/anatoli-tsinovoy)).
14
+ - Added Daybreak-enabled account listings to the usage dashboard.
15
+
16
+ ### Changed
17
+
18
+ - Mermaid flowcharts and state diagrams now automatically choose a layout that best fits the available terminal width and reflow when the terminal is resized.
19
+ - Plan Review annotations now support multi-line editing, deletion, and undo ([#12601](https://github.com/can1357/oh-my-pi/pull/12601) by [@anatoli-tsinovoy](https://github.com/anatoli-tsinovoy)).
20
+
21
+ ### Fixed
22
+
23
+ - Fixed AltGr characters, including `[`, `]`, `{`, and `}`, being dropped in Windows Terminal when using the kitty keyboard protocol on Hungarian and other international keyboard layouts ([#12984](https://github.com/can1357/oh-my-pi/pull/12984) by [@H4vC](https://github.com/H4vC)).
24
+
25
+ ## [18.2.11] - 2026-09-23
26
+
27
+ ### Added
28
+
29
+ - Added a Skills section to the settings.
30
+ - Enabled OSC 8 hyperlinks in rio.
31
+
32
+ ### Fixed
33
+
34
+ - Fixed scrolling startup release notes without requiring an initial Escape keypress.
35
+ - Improved usage quota display so names remain distinguishable and readable in narrow and multi-column dashboards.
36
+
5
37
  ## [18.2.10] - 2026-09-22
6
38
 
7
39
  ### Changed
@@ -293,7 +293,7 @@ MIT License
293
293
  Copyright (c) 2026 Sander Land
294
294
  (measured tokenizer vocabulary data, reconstruction model, and reference
295
295
  implementation: https://github.com/sanderland/ctok)
296
- Copyright (c) 2026 Can Bölük and the Oh My Pi contributors
296
+ Copyright (c) 2026 Can Bölük and the omp contributors
297
297
  Copyright (c) 2026 Stencil Labs, Inc.
298
298
  (Rust implementation and the compact binary vocabulary encoding in
299
299
  crates/pi-natives/src/utok/claude)
@@ -1,4 +1,4 @@
1
- import type { DaemonSnapshot, DaemonSpec, DaemonState } from "../tools/hub.js";
1
+ import type { DaemonSnapshot, DaemonSpec, DaemonState } from "../tools/daemon.js";
2
2
  /** One broker scope: a project runtime dir or a machine-global service dir. */
3
3
  export interface PsScope {
4
4
  kind: "project" | "global";
@@ -1,5 +1,5 @@
1
1
  import { type Component, TUI } from "../tui.js";
2
- import type { DaemonSnapshot, DaemonSpec } from "../tools/hub.js";
2
+ import type { DaemonSnapshot, DaemonSpec } from "../tools/daemon.js";
3
3
  import { type PsScope, type PsScopeReport, type PsTarget } from "./ps-data.js";
4
4
  /** Options accepted by the interactive monitor: scope selection from the list flags. */
5
5
  export interface PsTopOptions extends PsTarget {
@@ -5,7 +5,7 @@
5
5
  * viewer ({@link AgentTranscriptViewer}) to render a parked subagent / advisor /
6
6
  * collab-guest transcript that has no live session.
7
7
  *
8
- * Unlike the old incremental hub sync, {@link ChatTranscriptBuilder.rebuild}
8
+ * Unlike incremental transcript sync, {@link ChatTranscriptBuilder.rebuild}
9
9
  * always discards prior components and rebuilds the whole transcript from the
10
10
  * supplied entries. Re-rendering a growing transcript is therefore O(n) in the
11
11
  * entry count, but it cannot duplicate or misorder rows the way incremental
@@ -0,0 +1,30 @@
1
+ import { type Component, type TUI } from "../index.js";
2
+ import { type KeybindingsManager } from "../app-keybindings.js";
3
+ import { type Theme } from "../theme/theme.js";
4
+ import type { CodeReviewAnnotation, CodeReviewOverlayResult, ReviewDiffFile, TextReviewAnnotation, TextReviewOverlayResult, TextReviewSource } from "./annotation-types.js";
5
+ export declare const CONTINUE_CODE_REVIEW_ACTION = "Continue with LLM review";
6
+ export declare const PASTE_CODE_REVIEW_ACTION = "Paste annotations into prompt";
7
+ export interface AnnotationOverlayCallbacks {
8
+ onComplete(result: CodeReviewOverlayResult | TextReviewOverlayResult | undefined): void;
9
+ onWarning?(message: string): void;
10
+ /** Open the draft in the host's editor and invoke `commit` with its result. */
11
+ onAnnotationExternalEditor?(draft: string, commit: (text: string | null) => void): void | Promise<void>;
12
+ }
13
+ export interface CodeReviewOverlayCallbacks extends AnnotationOverlayCallbacks {
14
+ onComplete(result: CodeReviewOverlayResult | undefined): void;
15
+ }
16
+ export interface TextReviewOverlayCallbacks extends AnnotationOverlayCallbacks {
17
+ onComplete(result: TextReviewOverlayResult | undefined): void;
18
+ }
19
+ /** A fullscreen, annotated diff picker that only relies on public OMP APIs. */
20
+ export declare class AnnotationOverlay implements Component {
21
+ #private;
22
+ constructor(tui: TUI, theme: Theme, keybindings: KeybindingsManager, files: readonly ReviewDiffFile[], mode: string, callbacks: CodeReviewOverlayCallbacks);
23
+ constructor(tui: TUI, theme: Theme, keybindings: KeybindingsManager, source: TextReviewSource, callbacks: TextReviewOverlayCallbacks);
24
+ invalidate(): void;
25
+ dispose(): void;
26
+ getAnnotations(): CodeReviewAnnotation[];
27
+ getTextAnnotations(): TextReviewAnnotation[];
28
+ handleInput(data: string): void;
29
+ render(width: number): readonly string[];
30
+ }
@@ -0,0 +1,84 @@
1
+ export type ReviewSourceRowKind = "context" | "added" | "removed";
2
+ export interface ReviewSourceRow {
3
+ kind: ReviewSourceRowKind;
4
+ raw: string;
5
+ content: string;
6
+ oldLine?: number;
7
+ newLine?: number;
8
+ hunkHeader: string;
9
+ }
10
+ export type ReviewDiffRow = ReviewSourceRow | {
11
+ kind: "hunk";
12
+ raw: string;
13
+ hunkHeader: string;
14
+ } | {
15
+ kind: "no-newline";
16
+ raw: string;
17
+ hunkHeader: string;
18
+ };
19
+ export interface ReviewDiffFile {
20
+ path: string;
21
+ oldPath?: string;
22
+ newPath?: string;
23
+ occurrence: number;
24
+ rawDiff: string;
25
+ rows: ReviewDiffRow[];
26
+ linesAdded: number;
27
+ linesRemoved: number;
28
+ isBinary: boolean;
29
+ }
30
+ export interface CodeReviewAnnotationBase {
31
+ path: string;
32
+ oldPath?: string;
33
+ newPath?: string;
34
+ occurrence: number;
35
+ note: string;
36
+ }
37
+ export type CodeReviewAnnotation = (CodeReviewAnnotationBase & {
38
+ scope: "file";
39
+ }) | (CodeReviewAnnotationBase & {
40
+ scope: "line";
41
+ hunkHeader: string;
42
+ oldLine?: number;
43
+ newLine?: number;
44
+ rawLine: string;
45
+ });
46
+ export interface CodeReviewOverlayResult {
47
+ action: "review" | "paste";
48
+ annotations: CodeReviewAnnotation[];
49
+ }
50
+ export type TextReviewSourceProvenance = {
51
+ kind: "latest-assistant";
52
+ entryId: string;
53
+ } | {
54
+ kind: "session";
55
+ entryId: string;
56
+ } | {
57
+ kind: "file";
58
+ path: string;
59
+ } | {
60
+ kind: "prompt";
61
+ };
62
+ export interface TextReviewSource {
63
+ /** Identifies the source within this annotation run. */
64
+ id: string;
65
+ kind: "message" | "code" | "quote" | "command" | "file" | "prompt";
66
+ label: string;
67
+ text: string;
68
+ /** Identifies the active session entry that supplied this source, when applicable. */
69
+ provenance?: TextReviewSourceProvenance;
70
+ sessionId?: string;
71
+ }
72
+ export type TextReviewAnnotation = {
73
+ scope: "text";
74
+ note: string;
75
+ } | {
76
+ scope: "line";
77
+ line: number;
78
+ quote: string;
79
+ note: string;
80
+ };
81
+ export interface TextReviewOverlayResult {
82
+ action: "paste";
83
+ annotations: TextReviewAnnotation[];
84
+ }
@@ -29,12 +29,40 @@ export interface CopySelectorDeps {
29
29
  proseOnlyThinking?: () => boolean;
30
30
  linkTargets?: ReadonlyMap<string, string>;
31
31
  requestRender: () => void;
32
- /** The outlined content was chosen — copy it. `label` feeds the status line. */
33
- onPick: (content: string, label: string) => void;
32
+ /** Replaces the "Copy" header when the picker is reused for another purpose. */
33
+ title?: string;
34
+ /** Verb shown for the pick action in hints and block controls (default "copy"). */
35
+ actionLabel?: string;
36
+ /**
37
+ * The outlined content was chosen — copy it. `label` feeds the status line;
38
+ * `source` names the transcript entry (and inner block, when descended) it came from.
39
+ */
40
+ onPick: (content: string, label: string, source: CopyPickSource) => void;
34
41
  /** `o` on a link block — open `href` with the system opener. Absent: `o` is ignored. */
35
42
  onOpen?: (href: string, label: string) => void;
36
43
  onCancel: () => void;
37
44
  }
45
+ /** Where picked content came from in the transcript. */
46
+ export interface CopyPickSource {
47
+ entry: TranscriptEntry;
48
+ /** The inner block, when the pick happened in the descended block view. */
49
+ block?: CopyBlock;
50
+ }
51
+ /** One copyable inner block of a transcript turn. */
52
+ export interface CopyBlock {
53
+ /** Short kind label ("code · ts", "bash command", "read result", …). */
54
+ label: string;
55
+ /** Exact text placed on the clipboard. */
56
+ content: string;
57
+ /** Transcript entry that produced this block. */
58
+ entry: TranscriptEntry;
59
+ /** Markdown code/quote block, or a bash/eval tool-call command. */
60
+ kind?: "code" | "quote" | "command";
61
+ /** Highlight language for the block preview. */
62
+ language?: string;
63
+ /** Set for link blocks: the URL `o` opens. `content` is the same URL. */
64
+ href?: string;
65
+ }
38
66
  export declare class CopySelectorComponent implements Component {
39
67
  #private;
40
68
  private readonly deps;
@@ -61,3 +61,5 @@ export declare function extractLastLink(messages: readonly AgentMessage[]): Link
61
61
  export declare function commandFromToolCall(tc: ToolCall): LastCommand | undefined;
62
62
  /** Walk the transcript backwards for the most recent bash command or eval code. */
63
63
  export declare function extractLastCommand(messages: readonly AgentMessage[]): LastCommand | undefined;
64
+ /** Concatenated visible text of an assistant message, verbatim; undefined when blank. */
65
+ export declare function assistantText(msg: AgentMessage): string | undefined;
@@ -1,4 +1,4 @@
1
- import type { Model } from "@oh-my-pi/pi-ai";
1
+ import type { KeysApi, Model } from "@oh-my-pi/pi-ai";
2
2
  import type { Component, TUI } from "../tui.js";
3
3
  import type { ModelBrowserSource, ModelBrowserRegistry } from "./model-browser.js";
4
4
  import { type ConfiguredThinkingLevel } from "../thinking.js";
@@ -15,7 +15,7 @@ export interface ModelHubSource extends ModelBrowserSource {
15
15
  /** Catalog capabilities required by the model hub. */
16
16
  export interface ModelHubRegistry extends ModelBrowserRegistry {
17
17
  readonly authStorage: {
18
- hasAuth(provider: string): boolean;
18
+ readonly keys: Pick<KeysApi, "source">;
19
19
  };
20
20
  getDiscoverableProviders(): string[];
21
21
  getProviderDiscoveryState(provider: string): {
@@ -1,13 +1,10 @@
1
+ import type { CredentialsApi, KeysApi } from "@oh-my-pi/pi-ai";
1
2
  import { type SgrMouseEvent } from "../index.js";
2
3
  import { OverlayPanel } from "../chrome/overlay-box.js";
3
4
  /** Credential presence and provenance needed by the provider picker. */
4
5
  export interface OAuthSelectorAuthSource {
5
- has(providerId: string): boolean;
6
- hasAuth(providerId: string): boolean;
7
- getCredentialOrigin(providerId: string): {
8
- kind: "runtime" | "config" | "oauth" | "api_key" | "env" | "fallback";
9
- envVar?: string;
10
- } | undefined;
6
+ readonly credentials: Pick<CredentialsApi, "has">;
7
+ readonly keys: Pick<KeysApi, "source">;
11
8
  }
12
9
  /**
13
10
  * Component that renders an OAuth provider selector.
@@ -38,6 +38,8 @@ export interface ProviderCard {
38
38
  soonestExpiryMs?: number;
39
39
  unavailableReasons: string[];
40
40
  };
41
+ /** Labels of accounts with verified Daybreak access. */
42
+ daybreakAccounts?: string[];
41
43
  }
42
44
  /**
43
45
  * Collapse usage reports into one compact card per provider: limits grouped by
@@ -1,16 +1,17 @@
1
1
  /**
2
- * Original filesystem source carried on image attachments that entered from a
3
- * file on disk: path-pasted/drag-and-dropped images and generated video
4
- * contact-sheet previews. Symbol metadata stays out of serialized/model-bound
5
- * image data while traveling with the draft object, until AgentSession creates
6
- * the hidden companion message that tells the model the path (and link
7
- * materialization prefers it over a blob copy).
2
+ * File source carried on image attachments backed by a file on disk:
3
+ * path-pasted/drag-and-dropped images, clipboard images the coding agent commits
4
+ * to the session's `local://` root, and generated video contact-sheet previews.
5
+ * Symbol metadata stays out of serialized/model-bound image data while traveling
6
+ * with the draft object, until AgentSession creates the hidden companion message
7
+ * that tells the model the path (and link materialization prefers it over a blob copy).
8
8
  */
9
9
  import type { ImageContent } from "@oh-my-pi/pi-ai";
10
10
  /** How an image attachment's backing file entered the session. */
11
11
  export type ImageAttachmentSourceKind = "image" | "video";
12
- /** Original local file backing an image attachment. */
12
+ /** Local file backing an image attachment. */
13
13
  export interface ImageAttachmentSource {
14
+ /** Absolute filesystem path, or a session-relative `local://` URL for images committed to the session. */
14
15
  readonly path: string;
15
16
  readonly kind: ImageAttachmentSourceKind;
16
17
  }
@@ -21,6 +22,6 @@ export type SourceTaggedImage = ImageContent & {
21
22
  };
22
23
  /** Create a model-ready image tagged with the local file it was loaded from. */
23
24
  export declare function tagImageAttachmentSource(image: ImageContent, path: string, kind: ImageAttachmentSourceKind): SourceTaggedImage;
24
- /** Return the original local source of an image attachment, or undefined for payloads with no source file (clipboard bitmaps). */
25
+ /** Return the local file backing an image attachment, or undefined for payloads with no file on disk. */
25
26
  export declare function imageAttachmentSource(image: ImageContent): ImageAttachmentSource | undefined;
26
27
  export {};
@@ -96,6 +96,8 @@ export declare const TRUNCATE_LENGTHS: {
96
96
  };
97
97
  /** Human-readable key currently bound to tool-output expansion, e.g. `Ctrl+O`. */
98
98
  export declare function expandKeyHint(): string;
99
+ /** Keep both ends of a single-line label without splitting wide characters. */
100
+ export declare function truncateMiddleToWidth(text: string, maxWidth: number): string;
99
101
  /** Select a leading line window and count the lines hidden after it. */
100
102
  export declare function cappedHeadLines(lines: readonly string[], max: number): {
101
103
  lines: readonly string[];
@@ -7,7 +7,7 @@ interface ContextSkill {
7
7
  readonly description?: string;
8
8
  readonly hide?: boolean;
9
9
  }
10
- type ContextTool = Pick<AiTool, "name" | "description" | "parameters">;
10
+ type ContextTool = Pick<AiTool, "name" | "description" | "parameters" | "examples">;
11
11
  /** Savings computed by the host's inline-image planner, not by the renderer. */
12
12
  export interface ContextSavingsEstimate {
13
13
  visionCapable: boolean;
@@ -100,6 +100,8 @@ export interface NonMessageTokenSource {
100
100
  };
101
101
  };
102
102
  readonly skills?: readonly ContextSkill[];
103
+ /** Provider-facing, session-frozen descriptions when available. */
104
+ readonly renderedSkills?: readonly ContextSkill[];
103
105
  }
104
106
  /** Shared empty system-prompt part list, avoiding an allocation per render. */
105
107
  export declare const EMPTY_STRING_PARTS: string[];
@@ -6,12 +6,10 @@ import type { MermaidRenderOptions } from "@oh-my-pi/pi-natives";
6
6
  */
7
7
  export interface MermaidResolveOptions extends MermaidRenderOptions {
8
8
  /**
9
- * Maximum display width (terminal columns) the diagram should occupy. A
10
- * layout that overflows this width is re-rendered in the perpendicular
11
- * orientation — a wide horizontal chain collapses to a tall vertical column
12
- * (which the terminal can scroll), and a wide vertical fan-out collapses to a
13
- * tall horizontal column. Omit to keep the source's own layout regardless of
14
- * width.
9
+ * Maximum display width (terminal columns) the diagram should occupy.
10
+ * Flowcharts are also rendered top-down and left-to-right. A resize picks
11
+ * the shortest variant that fits; if none fit, the narrowest, which the
12
+ * caller may still clip. Omit to keep the source's own layout.
15
13
  */
16
14
  maxWidth?: number;
17
15
  }
@@ -19,6 +19,13 @@ export interface BashToolDetails {
19
19
  timedOut?: boolean;
20
20
  /** Live ACP update only; completed results refer to released terminals. */
21
21
  terminalId?: string;
22
+ service?: {
23
+ name: string;
24
+ state: string;
25
+ ready: boolean;
26
+ timedOut: boolean;
27
+ pid?: number;
28
+ };
22
29
  async?: {
23
30
  state: "running" | "completed" | "failed";
24
31
  jobId: string;
@@ -0,0 +1,46 @@
1
+ /** Launch-broker daemon types shared by services, `proc://`, and `omp ps`. */
2
+ /** Stable lifecycle states exposed by the launch broker. */
3
+ export type DaemonState = "starting" | "running" | "ready" | "restarting" | "stopping" | "exited" | "failed";
4
+ /** Restart behavior applied after an unexpected daemon exit. */
5
+ export type DaemonRestartPolicy = "no" | "on-failure" | "always";
6
+ /** Readiness conditions; every configured condition must pass. */
7
+ export interface DaemonReadySpec {
8
+ log?: string;
9
+ port?: number;
10
+ host?: string;
11
+ timeoutMs: number;
12
+ }
13
+ /** Immutable launch specification retained for restart and inspection. */
14
+ export interface DaemonSpec {
15
+ name: string;
16
+ application: string;
17
+ args: string[];
18
+ env: Record<string, string>;
19
+ cwd: string;
20
+ pty: boolean;
21
+ ready?: DaemonReadySpec;
22
+ restart: DaemonRestartPolicy;
23
+ persist: boolean;
24
+ detached: boolean;
25
+ }
26
+ /** Serializable daemon state visible to every client in one broker scope. */
27
+ export interface DaemonSnapshot {
28
+ name: string;
29
+ id: string;
30
+ state: DaemonState;
31
+ pid?: number;
32
+ createdAt: number;
33
+ startedAt: number;
34
+ readyAt?: number;
35
+ exitedAt?: number;
36
+ exitCode?: number;
37
+ exitReason?: string;
38
+ restartCount: number;
39
+ outputBytes: number;
40
+ owner?: string;
41
+ readyMatch?: string;
42
+ /** Readiness conditions still unmet while `state` is `starting`; absent once ready or without a ready spec. */
43
+ readyPending?: ("log" | "port")[];
44
+ persist: boolean;
45
+ detached: boolean;
46
+ }
@@ -0,0 +1,30 @@
1
+ /** Peer-message types and roster constants shared by messaging, `wait`, and child prompts. */
2
+ /** Maximum live peer rows embedded in child prompts. */
3
+ export declare const DEFAULT_PEER_ROSTER_LIMIT = 32;
4
+ /** Serializable peer message retained in coordination result snapshots. */
5
+ export interface IrcMessage {
6
+ id: string;
7
+ /** Sender agent id. */
8
+ from: string;
9
+ /** Recipient agent id (resolved; "all" is expanded by the tool, not stored). */
10
+ to: string;
11
+ body: string;
12
+ ts: number;
13
+ /** Message id being answered. */
14
+ replyTo?: string;
15
+ /**
16
+ * Automated wake-turn relay of a woken subagent's stop output (task executor
17
+ * `relayWakeTurnOutput`). Relays are answers, never wake sources: the
18
+ * recipient's own wake-turn relay must skip them or two idle peers
19
+ * ping-pong forever.
20
+ */
21
+ wakeRelay?: boolean;
22
+ }
23
+ /** Delivery outcome for one peer recipient. */
24
+ export interface IrcDeliveryReceipt {
25
+ to: string;
26
+ outcome: "injected" | "woken" | "revived" | "failed";
27
+ error?: string;
28
+ }
29
+ /** Status ordering for peer rosters in child prompts. */
30
+ export declare const LIST_STATUS_ORDER: Record<string, number>;
@@ -11,7 +11,7 @@ export declare const LINE_RANGE_CHUNK_SOURCE: string;
11
11
  /** Parse a single `N`, `N-M`, `N-`, `N+K`, or `..`-aliased (`N..M`, `N..`) chunk. Throws via {@link ToolError} on invalid bounds. */
12
12
  export declare function parseLineRangeChunk(sel: string): LineRange | null;
13
13
  /**
14
- * Parse a comma-separated list of line ranges (e.g. `5-16,960-973`). Returns
14
+ * Parse a comma-separated list of line ranges (e.g. `5-16,960-973` or `19,59`). Returns
15
15
  * the ranges in ascending order with overlapping/adjacent ranges merged so
16
16
  * downstream consumers can stream the file in a single forward pass per range.
17
17
  */
@@ -0,0 +1,34 @@
1
+ import type { Component } from "../tui.js";
2
+ import type { Theme } from "../theme/theme.js";
3
+ import type { RenderResultOptions } from "./renderer.js";
4
+ import type { AgentActivitySnapshot, CoordinationDetails, JobSnapshot } from "./wait.js";
5
+ import type { DaemonSnapshot } from "./daemon.js";
6
+ export interface ProcReadDetails {
7
+ jobs?: JobSnapshot[];
8
+ agents?: AgentActivitySnapshot[];
9
+ daemons?: DaemonSnapshot[];
10
+ job?: JobSnapshot;
11
+ daemon?: DaemonSnapshot;
12
+ log?: string;
13
+ terminalRows?: string[];
14
+ }
15
+ export type ProcWriteDetails = CoordinationDetails | {
16
+ action: "stop" | "stdin" | "mode";
17
+ daemon: DaemonSnapshot;
18
+ input?: string;
19
+ mode?: string;
20
+ };
21
+ /** Process operation selected by a write URL, independent of its content. */
22
+ export type ProcWriteAction = "stdin" | "mode" | "kill";
23
+ interface ToolResult {
24
+ content: Array<{
25
+ type: string;
26
+ text?: string;
27
+ }>;
28
+ isError?: boolean;
29
+ }
30
+ export declare function renderAgentWrite(to: string, body: string, result: ToolResult | undefined, details: CoordinationDetails | undefined, options: RenderResultOptions, theme: Theme): Component;
31
+ /** Render live and completed process writes with the URL-selected operation. */
32
+ export declare function renderProcWrite(id: string, action: ProcWriteAction, content: string | undefined, result: ToolResult | undefined, details: ProcWriteDetails | undefined, options: RenderResultOptions, theme: Theme): Component;
33
+ export declare function renderProcRead(id: string, result: ToolResult | undefined, details: ProcReadDetails | undefined, options: RenderResultOptions, theme: Theme): Component;
34
+ export {};
@@ -1,14 +1,16 @@
1
1
  import type { SummaryResult } from "@oh-my-pi/pi-natives";
2
2
  import type { Component } from "../tui.js";
3
- import type { RenderResultOptions } from "./renderer.js";
3
+ import type { RenderResultOptions, ToolActivityContext, ToolActivitySummary } from "./renderer.js";
4
4
  import type { Theme } from "../theme/theme.js";
5
5
  import type { OutputMeta } from "./output-meta.js";
6
6
  import type { TruncationResult } from "./streaming-output.js";
7
+ import { type ProcReadDetails } from "./proc-render.js";
7
8
  /** Read result metadata retains truncation statistics, not a second copy of the body. */
8
9
  export type ReadTruncationStats = Omit<TruncationResult, "content">;
9
10
  /** Display metadata for file and URL reads. */
10
11
  export interface ReadToolDetails {
11
12
  kind?: "file" | "url";
13
+ proc?: ProcReadDetails;
12
14
  /** Filesystem hyperlink target resolved by the executing tool. */
13
15
  displayTarget?: string;
14
16
  truncation?: ReadTruncationStats;
@@ -96,6 +98,7 @@ export interface ReadRenderArgs {
96
98
  export declare function readSourceFsPath(details: ReadToolDetails | undefined): string | undefined;
97
99
  /** Render file, image, and URL reads in the transcript. */
98
100
  export declare const readToolRenderer: {
101
+ activitySummary(args: unknown, _context: ToolActivityContext): ToolActivitySummary;
99
102
  renderCall(args: ReadRenderArgs, _options: RenderResultOptions, uiTheme: Theme): Component;
100
103
  renderResult(result: {
101
104
  content: Array<{
@@ -237,6 +237,8 @@ export interface AgentProgress {
237
237
  resolvedThinkingLevel?: ConfiguredThinkingLevel;
238
238
  /** True when {@link resolvedModel} is the target of an active retry fallback (not the originally configured model). Lets observer-only UIs (collab guests, Agent Hub rows with no live session) flag the fallback and keep the provider. */
239
239
  resolvedModelIsFallback?: boolean;
240
+ /** Extension routing note (e.g. model-pools) explaining why {@link resolvedModel} was chosen. */
241
+ resolvedModelRoute?: string;
240
242
  /** True when a live advisor was attached to this run's session, not merely enabled in settings. */
241
243
  advisor?: boolean;
242
244
  /** Data extracted by registered subprocess tool handlers (keyed by tool name) */
@@ -313,6 +315,8 @@ export interface SingleResult {
313
315
  resolvedThinkingLevel?: ConfiguredThinkingLevel;
314
316
  /** True when {@link resolvedModel} is the target of an active retry fallback. Mirrors {@link AgentProgress.resolvedModelIsFallback} onto the settled result. */
315
317
  resolvedModelIsFallback?: boolean;
318
+ /** Mirrors {@link AgentProgress.resolvedModelRoute} onto the settled result. */
319
+ resolvedModelRoute?: string;
316
320
  /** Retains {@link AgentProgress.advisor} after the advised session is disposed. */
317
321
  advisor?: boolean;
318
322
  error?: string;