@oh-my-pi/pi-tui 18.2.11 → 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 (61) hide show
  1. package/CHANGELOG.md +20 -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/status-line/context-usage.d.ts +3 -1
  15. package/dist/types/theme/mermaid-cache.d.ts +4 -6
  16. package/dist/types/tools/bash.d.ts +7 -0
  17. package/dist/types/tools/daemon.d.ts +46 -0
  18. package/dist/types/tools/irc.d.ts +30 -0
  19. package/dist/types/tools/line-ranges.d.ts +1 -1
  20. package/dist/types/tools/proc-render.d.ts +34 -0
  21. package/dist/types/tools/read.d.ts +4 -1
  22. package/dist/types/tools/wait.d.ts +131 -0
  23. package/dist/types/tools/write.d.ts +4 -0
  24. package/dist/types/tools/xd-url.d.ts +8 -0
  25. package/dist/types/windows-altgr.d.ts +54 -0
  26. package/package.json +13 -10
  27. package/src/apps/debug/protocol-probe.ts +1 -1
  28. package/src/apps/ps-data.ts +1 -1
  29. package/src/apps/ps-top.ts +1 -1
  30. package/src/chat/chat-transcript-builder.ts +4 -4
  31. package/src/chat/tool-execution.ts +8 -8
  32. package/src/chat/transcript-render-helpers.ts +3 -3
  33. package/src/components/markdown.ts +1 -1
  34. package/src/desktop-notify.ts +1 -1
  35. package/src/overlays/annotation-overlay.ts +1145 -0
  36. package/src/overlays/annotation-types.ts +78 -0
  37. package/src/overlays/copy-selector.ts +45 -19
  38. package/src/overlays/copy-targets.ts +3 -3
  39. package/src/overlays/model-hub.ts +5 -4
  40. package/src/overlays/oauth-selector.ts +8 -12
  41. package/src/overlays/plan-review-overlay.ts +213 -40
  42. package/src/overlays/usage-dashboard.ts +22 -1
  43. package/src/prompt/image-source.ts +9 -8
  44. package/src/setup/scenes/sign-in.ts +1 -1
  45. package/src/status-line/context-usage.ts +15 -3
  46. package/src/terminal-capabilities.ts +2 -2
  47. package/src/terminal.ts +8 -1
  48. package/src/theme/mermaid-cache.ts +83 -25
  49. package/src/tools/bash.ts +14 -1
  50. package/src/tools/daemon.ts +51 -0
  51. package/src/tools/index.ts +2 -2
  52. package/src/tools/irc.ts +33 -0
  53. package/src/tools/line-ranges.ts +13 -3
  54. package/src/tools/proc-render.ts +294 -0
  55. package/src/tools/read.ts +22 -1
  56. package/src/tools/wait.ts +595 -0
  57. package/src/tools/write.ts +76 -0
  58. package/src/tools/xd-url.ts +9 -0
  59. package/src/windows-altgr.ts +227 -0
  60. package/dist/types/tools/hub.d.ts +0 -342
  61. package/src/tools/hub.ts +0 -1492
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
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
+
5
25
  ## [18.2.11] - 2026-09-23
6
26
 
7
27
  ### Added
@@ -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 {};
@@ -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<{
@@ -0,0 +1,131 @@
1
+ import type { Component } from "../tui.js";
2
+ import type { Theme } from "../theme/theme.js";
3
+ import { type OutputMeta } from "./output-meta.js";
4
+ import { type ConfiguredThinkingLevel } from "../render/render-utils.js";
5
+ import type { StructuredSubagentOutput } from "./task.js";
6
+ import type { RenderResultOptions, ToolActivitySummary } from "./renderer.js";
7
+ import type { IrcDeliveryReceipt, IrcMessage } from "./irc.js";
8
+ /** Whether a wait snapshot contains only running jobs and no cancellations. */
9
+ export declare function isWaitingPollDetails(details: unknown): boolean;
10
+ /** Coordination details retained by wait and background job operations. */
11
+ export type CoordinationOp = "send" | "wait" | "jobs" | "cancel";
12
+ /** Background-job row surfaced by `wait`/`cancel`/`jobs` results. */
13
+ export interface JobSnapshot {
14
+ id: string;
15
+ type: "bash" | "task" | "eval";
16
+ status: "running" | "completed" | "failed" | "cancelled";
17
+ label: string;
18
+ durationMs: number;
19
+ /** Process exit status when the job reports one. */
20
+ exitCode?: number;
21
+ /** Effective task model selector, including an explicit reasoning suffix when configured. */
22
+ resolvedModel?: string;
23
+ /** Provider/id including routing, with no added thinking suffix. */
24
+ resolvedModelIdentity?: string;
25
+ /** Explicit thinking metadata, independent of the model identity. */
26
+ resolvedThinkingLevel?: ConfiguredThinkingLevel;
27
+ /** True when the task progress reports an attached live advisor. */
28
+ advisor?: boolean;
29
+ resultText?: string;
30
+ errorText?: string;
31
+ /** Source-output metadata retained for per-job warnings and persisted row rendering. */
32
+ meta?: OutputMeta;
33
+ /** Capture error in historical snapshots; new snapshots store source metadata in `meta`. */
34
+ artifactError?: OutputMeta["artifactError"];
35
+ structured?: StructuredSubagentOutput;
36
+ /**
37
+ * `agent://<id>` handle backing this job's artifacts — the job-row's
38
+ * registry `agentId` when the manager disambiguated a requested job id
39
+ * on collision, else the job id itself. See {@link AsyncJob.agentId}.
40
+ */
41
+ agentUrlId?: string;
42
+ }
43
+ /** Outcome of cancelling one background job. */
44
+ export type CancelStatus = "cancelled" | "not_found" | "already_completed";
45
+ /** Cancellation outcome and its model-facing explanation. */
46
+ export interface CancelOutcome {
47
+ id: string;
48
+ status: CancelStatus;
49
+ message: string;
50
+ }
51
+ /**
52
+ * A live subagent from the AgentRegistry that has no backing job in the
53
+ * AsyncJobManager — e.g. an idle agent woken (or a parked agent revived) via
54
+ * a peer message, or a spawn owned by another agent. Surfaced by background
55
+ * snapshots so the displayed picture matches the UI's running-agent
56
+ * count.
57
+ */
58
+ export interface AgentActivitySnapshot {
59
+ id: string;
60
+ parentId?: string;
61
+ /** Latest activity gist recorded by the registry (display-only). */
62
+ activity?: string;
63
+ /** Time since the agent was registered. */
64
+ ageMs: number;
65
+ /**
66
+ * Whether an attached session corroborates the `running` claim. False marks
67
+ * a ref that says `running` with no turn in flight — either a spawn still
68
+ * wiring up or a stale registration that an explicit cancellation clears (#8634).
69
+ */
70
+ live: boolean;
71
+ /**
72
+ * Acceptance time of the agent's final result, when the registry recorded
73
+ * one. With `live: false` this is an accepted run the parent may cancel
74
+ * instead of waiting on (#11079).
75
+ */
76
+ acceptedAt?: number;
77
+ }
78
+ /** Details shared by messaging receipts and job/wait results. */
79
+ export interface CoordinationDetails {
80
+ meta?: OutputMeta;
81
+ op: CoordinationOp;
82
+ from?: string;
83
+ to?: string;
84
+ receipts?: IrcDeliveryReceipt[];
85
+ /** Message consumed by `wait`. */
86
+ waited?: IrcMessage | null;
87
+ jobs?: JobSnapshot[];
88
+ cancelled?: {
89
+ id: string;
90
+ status: CancelStatus;
91
+ }[];
92
+ /** Running subagents not represented by a job row in this result. */
93
+ agents?: AgentActivitySnapshot[];
94
+ /** `wait` was cut short by steering, a peer message, or a completion notice that injects next. */
95
+ interrupted?: boolean;
96
+ }
97
+ /** Pending wait frame. */
98
+ declare function waitRenderCall(_args: object, _options: RenderResultOptions, uiTheme: Theme): Component;
99
+ /**
100
+ * Display-only transcript card for live IRC traffic: `irc:incoming` DMs
101
+ * delivered to this session, `irc:autoreply` side-channel replies sent on
102
+ * this session's behalf, and `irc:relay` observations of agent↔agent
103
+ * traffic. Shares the tool renderer's glyph + quote-border conventions so
104
+ * cards and peer-message output look identical in the transcript.
105
+ */
106
+ export declare function createIrcMessageCard(card: {
107
+ kind: "incoming" | "autoreply" | "relay" | "workpool";
108
+ from?: string;
109
+ to?: string;
110
+ body?: string;
111
+ replyTo?: string;
112
+ timestamp?: number;
113
+ pool?: string;
114
+ mode?: string;
115
+ }, getExpanded: () => boolean, uiTheme: Theme): Component;
116
+ /** Render either a received message or a background-job snapshot. */
117
+ export declare const waitToolRenderer: {
118
+ inline: true;
119
+ mergeCallAndResult: true;
120
+ activitySummary(): ToolActivitySummary;
121
+ renderCall: typeof waitRenderCall;
122
+ renderResult(result: {
123
+ content: Array<{
124
+ type: string;
125
+ text?: string;
126
+ }>;
127
+ details?: CoordinationDetails;
128
+ isError?: boolean;
129
+ }, options: RenderResultOptions, uiTheme: Theme): Component;
130
+ };
131
+ export {};