@oh-my-pi/pi-coding-agent 16.1.13 → 16.1.15

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 (153) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/cli.js +5615 -2833
  3. package/dist/types/advisor/runtime.d.ts +3 -0
  4. package/dist/types/config/settings-schema.d.ts +64 -14
  5. package/dist/types/eval/__tests__/julia-prelude.test.d.ts +1 -0
  6. package/dist/types/eval/backend-helpers.d.ts +23 -0
  7. package/dist/types/eval/executor-base.d.ts +118 -0
  8. package/dist/types/eval/index.d.ts +2 -0
  9. package/dist/types/eval/jl/executor.d.ts +44 -0
  10. package/dist/types/eval/jl/index.d.ts +11 -0
  11. package/dist/types/eval/jl/kernel.d.ts +28 -0
  12. package/dist/types/eval/jl/prelude.d.ts +1 -0
  13. package/dist/types/eval/jl/runtime.d.ts +22 -0
  14. package/dist/types/eval/kernel-base.d.ts +105 -0
  15. package/dist/types/eval/py/kernel.d.ts +3 -61
  16. package/dist/types/eval/rb/executor.d.ts +77 -0
  17. package/dist/types/eval/rb/index.d.ts +11 -0
  18. package/dist/types/eval/rb/kernel.d.ts +31 -0
  19. package/dist/types/eval/rb/prelude.d.ts +1 -0
  20. package/dist/types/eval/rb/runtime.d.ts +23 -0
  21. package/dist/types/eval/runtime-env.d.ts +24 -0
  22. package/dist/types/eval/types.d.ts +3 -3
  23. package/dist/types/export/share.d.ts +8 -1
  24. package/dist/types/extensibility/extensions/runner.d.ts +2 -15
  25. package/dist/types/extensibility/hooks/loader.d.ts +1 -25
  26. package/dist/types/extensibility/session-handler-types.d.ts +23 -0
  27. package/dist/types/jsonrpc/message-framing.d.ts +35 -0
  28. package/dist/types/mcp/transports/stdio.d.ts +12 -1
  29. package/dist/types/mnemopi/embed-client.d.ts +7 -24
  30. package/dist/types/modes/components/chat-transcript-builder.d.ts +1 -1
  31. package/dist/types/modes/components/custom-editor.d.ts +11 -0
  32. package/dist/types/modes/components/selector-helpers.d.ts +53 -0
  33. package/dist/types/modes/components/status-line/context-thresholds.d.ts +4 -3
  34. package/dist/types/modes/components/status-line/types.d.ts +1 -0
  35. package/dist/types/modes/interactive-mode.d.ts +0 -2
  36. package/dist/types/modes/theme/theme.d.ts +8 -1
  37. package/dist/types/modes/types.d.ts +0 -2
  38. package/dist/types/modes/utils/copy-targets.d.ts +1 -1
  39. package/dist/types/modes/utils/interactive-context-helpers.d.ts +14 -0
  40. package/dist/types/modes/utils/transcript-render-helpers.d.ts +54 -0
  41. package/dist/types/sdk.d.ts +1 -1
  42. package/dist/types/secrets/obfuscator.d.ts +3 -3
  43. package/dist/types/session/agent-session.d.ts +2 -2
  44. package/dist/types/stt/asr-client.d.ts +3 -29
  45. package/dist/types/subprocess/worker-client.d.ts +149 -0
  46. package/dist/types/subprocess/worker-runtime.d.ts +107 -0
  47. package/dist/types/tiny/title-client.d.ts +14 -34
  48. package/dist/types/tools/eval-backends.d.ts +6 -3
  49. package/dist/types/tools/eval-render.d.ts +6 -5
  50. package/dist/types/tools/eval.d.ts +13 -15
  51. package/dist/types/tools/index.d.ts +3 -3
  52. package/dist/types/tts/tts-client.d.ts +3 -28
  53. package/dist/types/tui/code-cell.d.ts +7 -0
  54. package/dist/types/utils/file-display-mode.d.ts +1 -1
  55. package/dist/types/utils/shell-snapshot.d.ts +10 -0
  56. package/dist/types/web/parallel.d.ts +6 -0
  57. package/dist/types/web/search/providers/perplexity.d.ts +17 -3
  58. package/package.json +12 -12
  59. package/src/advisor/__tests__/advisor.test.ts +114 -0
  60. package/src/advisor/runtime.ts +129 -1
  61. package/src/config/model-registry.ts +12 -4
  62. package/src/config/settings-schema.ts +74 -18
  63. package/src/config/settings.ts +5 -0
  64. package/src/dap/client.ts +13 -107
  65. package/src/eval/__tests__/julia-prelude.test.ts +77 -0
  66. package/src/eval/backend-helpers.ts +48 -0
  67. package/src/eval/executor-base.ts +425 -0
  68. package/src/eval/index.ts +2 -0
  69. package/src/eval/jl/executor.ts +540 -0
  70. package/src/eval/jl/index.ts +54 -0
  71. package/src/eval/jl/kernel.ts +235 -0
  72. package/src/eval/jl/prelude.jl +930 -0
  73. package/src/eval/jl/prelude.ts +3 -0
  74. package/src/eval/jl/runner.jl +634 -0
  75. package/src/eval/jl/runtime.ts +118 -0
  76. package/src/eval/js/index.ts +3 -14
  77. package/src/eval/kernel-base.ts +569 -0
  78. package/src/eval/py/executor.ts +43 -252
  79. package/src/eval/py/index.ts +9 -20
  80. package/src/eval/py/kernel.ts +29 -544
  81. package/src/eval/rb/executor.ts +504 -0
  82. package/src/eval/rb/index.ts +54 -0
  83. package/src/eval/rb/kernel.ts +230 -0
  84. package/src/eval/rb/prelude.rb +721 -0
  85. package/src/eval/rb/prelude.ts +3 -0
  86. package/src/eval/rb/runner.rb +474 -0
  87. package/src/eval/rb/runtime.ts +132 -0
  88. package/src/eval/runtime-env.ts +104 -0
  89. package/src/eval/types.ts +3 -3
  90. package/src/exec/bash-executor.ts +44 -0
  91. package/src/export/share.ts +51 -28
  92. package/src/extensibility/extensions/runner.ts +4 -11
  93. package/src/extensibility/hooks/loader.ts +3 -21
  94. package/src/extensibility/session-handler-types.ts +21 -0
  95. package/src/internal-urls/docs-index.generated.txt +1 -1
  96. package/src/jsonrpc/message-framing.ts +142 -0
  97. package/src/lsp/client.ts +13 -109
  98. package/src/mcp/transports/stdio.ts +20 -4
  99. package/src/mnemopi/embed-client.ts +43 -198
  100. package/src/modes/components/agent-dashboard.ts +17 -40
  101. package/src/modes/components/chat-transcript-builder.ts +18 -102
  102. package/src/modes/components/custom-editor.test.ts +22 -0
  103. package/src/modes/components/custom-editor.ts +29 -1
  104. package/src/modes/components/extensions/extension-dashboard.ts +4 -13
  105. package/src/modes/components/extensions/extension-list.ts +16 -44
  106. package/src/modes/components/footer.ts +4 -3
  107. package/src/modes/components/history-search.ts +4 -16
  108. package/src/modes/components/selector-helpers.ts +129 -0
  109. package/src/modes/components/settings-selector.ts +7 -5
  110. package/src/modes/components/status-line/component.ts +5 -1
  111. package/src/modes/components/status-line/context-thresholds.ts +11 -3
  112. package/src/modes/components/status-line/segments.ts +1 -1
  113. package/src/modes/components/status-line/types.ts +1 -0
  114. package/src/modes/components/tree-selector.ts +13 -18
  115. package/src/modes/controllers/command-controller.ts +1 -0
  116. package/src/modes/controllers/event-controller.ts +3 -9
  117. package/src/modes/controllers/input-controller.ts +32 -54
  118. package/src/modes/interactive-mode.ts +5 -7
  119. package/src/modes/theme/theme.ts +35 -0
  120. package/src/modes/types.ts +0 -2
  121. package/src/modes/utils/copy-targets.ts +3 -2
  122. package/src/modes/utils/interactive-context-helpers.ts +27 -0
  123. package/src/modes/utils/transcript-render-helpers.ts +157 -0
  124. package/src/modes/utils/ui-helpers.ts +21 -126
  125. package/src/prompts/system/system-prompt.md +5 -5
  126. package/src/prompts/tools/bash.md +2 -3
  127. package/src/prompts/tools/eval.md +6 -4
  128. package/src/prompts/tools/find.md +0 -4
  129. package/src/prompts/tools/read.md +1 -2
  130. package/src/prompts/tools/replace.md +1 -1
  131. package/src/sdk.ts +13 -7
  132. package/src/secrets/obfuscator.ts +3 -9
  133. package/src/session/agent-session.ts +42 -9
  134. package/src/slash-commands/builtin-registry.ts +2 -1
  135. package/src/stt/asr-client.ts +35 -215
  136. package/src/stt/asr-worker.ts +29 -181
  137. package/src/subprocess/worker-client.ts +297 -0
  138. package/src/subprocess/worker-runtime.ts +277 -0
  139. package/src/task/executor.ts +4 -4
  140. package/src/tiny/title-client.ts +53 -219
  141. package/src/tiny/worker.ts +29 -180
  142. package/src/tools/eval-backends.ts +10 -3
  143. package/src/tools/eval-render.ts +17 -8
  144. package/src/tools/eval.ts +187 -22
  145. package/src/tools/index.ts +51 -28
  146. package/src/tts/tts-client.ts +38 -206
  147. package/src/tts/tts-worker.ts +23 -97
  148. package/src/tui/code-cell.ts +12 -1
  149. package/src/utils/file-display-mode.ts +2 -3
  150. package/src/utils/shell-snapshot.ts +63 -1
  151. package/src/web/parallel.ts +43 -42
  152. package/src/web/search/providers/parallel.ts +10 -99
  153. package/src/web/search/providers/perplexity.ts +18 -6
@@ -0,0 +1,11 @@
1
+ import type { ToolSession } from "../../tools";
2
+ import { type ExecutorBackendExecOptions, type ExecutorBackendResult } from "../backend";
3
+ export declare function namespaceSessionId(sessionId: string): string;
4
+ declare const _default: {
5
+ id: "ruby";
6
+ label: string;
7
+ highlightLang: string;
8
+ isAvailable(session: ToolSession): Promise<boolean>;
9
+ execute(code: string, opts: ExecutorBackendExecOptions): Promise<ExecutorBackendResult>;
10
+ };
11
+ export default _default;
@@ -0,0 +1,31 @@
1
+ import { BaseKernel, type KernelRuntimeEnv, type KernelStartOptions } from "../kernel-base";
2
+ import type { KernelDisplayOutput } from "../py/display";
3
+ import { type RubyRuntime } from "./runtime";
4
+ export type { KernelExecuteResult, KernelRuntimeEnv, KernelShutdownResult } from "../kernel-base";
5
+ export type { KernelDisplayOutput, PythonStatusEvent } from "../py/display";
6
+ export { renderKernelDisplay } from "../py/display";
7
+ export interface KernelExecuteOptions {
8
+ id?: string;
9
+ /** Runtime working directory applied immediately before this request executes. */
10
+ cwd?: string;
11
+ /** Managed runtime environment variables applied immediately before this request executes. */
12
+ env?: KernelRuntimeEnv;
13
+ signal?: AbortSignal;
14
+ onChunk?: (text: string) => Promise<void> | void;
15
+ onDisplay?: (output: KernelDisplayOutput) => Promise<void> | void;
16
+ timeoutMs?: number;
17
+ silent?: boolean;
18
+ storeHistory?: boolean;
19
+ }
20
+ export interface RubyKernelAvailability {
21
+ ok: boolean;
22
+ rubyPath?: string;
23
+ reason?: string;
24
+ /** The probed-working runtime, when one was found. */
25
+ runtime?: RubyRuntime;
26
+ }
27
+ export declare function checkRubyKernelAvailability(cwd: string, interpreter?: string): Promise<RubyKernelAvailability>;
28
+ export declare class RubyKernel extends BaseKernel<KernelExecuteOptions> {
29
+ private constructor();
30
+ static start(options: KernelStartOptions): Promise<RubyKernel>;
31
+ }
@@ -0,0 +1 @@
1
+ export declare const RUBY_PRELUDE: string;
@@ -0,0 +1,23 @@
1
+ export interface RubyRuntime {
2
+ /** Path to the ruby executable. */
3
+ rubyPath: string;
4
+ /** Filtered environment variables. */
5
+ env: Record<string, string | undefined>;
6
+ }
7
+ export declare const filterEnv: (env: Record<string, string | undefined>) => Record<string, string | undefined>;
8
+ /**
9
+ * Resolve an explicitly configured interpreter (`ruby.interpreter`) into a
10
+ * runtime, bypassing discovery. Does not probe the executable — callers must
11
+ * check it actually runs. `~` expands to the home directory and relative paths
12
+ * resolve against `cwd`.
13
+ */
14
+ export declare function resolveExplicitRubyRuntime(interpreter: string, cwd: string, baseEnv: Record<string, string | undefined>): RubyRuntime;
15
+ /**
16
+ * Enumerate candidate Ruby runtimes in priority order. With an explicit
17
+ * interpreter that is the only candidate; otherwise the first `ruby` on PATH.
18
+ */
19
+ export declare function enumerateRubyRuntimes(cwd: string, baseEnv: Record<string, string | undefined>, interpreter?: string): RubyRuntime[];
20
+ /**
21
+ * Resolve the highest-priority Ruby runtime. Throws when none exists.
22
+ */
23
+ export declare function resolveRubyRuntime(cwd: string, baseEnv: Record<string, string | undefined>, interpreter?: string): RubyRuntime;
@@ -0,0 +1,24 @@
1
+ export declare const CASE_INSENSITIVE_ENV: boolean;
2
+ export declare const SECRET_KEY_PATTERN: RegExp;
3
+ export interface EnvFilterOptions {
4
+ allowList: string[];
5
+ windowsAllowList: string[];
6
+ denyList: string[];
7
+ allowPrefixes: string[];
8
+ }
9
+ /**
10
+ * Creates an environment filter function based on the provided allowlists, denylists, and prefixes.
11
+ */
12
+ export declare function createEnvFilter(options: EnvFilterOptions): (env: Record<string, string | undefined>) => Record<string, string | undefined>;
13
+ /**
14
+ * Resolve an explicitly configured interpreter path, expanding `~` to the home directory.
15
+ */
16
+ export declare function resolveExplicitPath(interpreter: string, cwd: string): string;
17
+ /**
18
+ * Enumerates candidate runtimes in priority order.
19
+ */
20
+ export declare function enumerateRuntimes<T>(cwd: string, baseEnv: Record<string, string | undefined>, binaryName: string, createRuntime: (executablePath: string, env: Record<string, string | undefined>) => T, interpreter?: string): T[];
21
+ /**
22
+ * Resolves the highest-priority runtime. Throws when none exists.
23
+ */
24
+ export declare function resolveRuntime<T>(cwd: string, baseEnv: Record<string, string | undefined>, binaryName: string, createRuntime: (executablePath: string, env: Record<string, string | undefined>) => T, interpreter?: string): T;
@@ -1,13 +1,13 @@
1
1
  /** Runtime backend that an eval cell dispatches to. */
2
- export type EvalLanguage = "python" | "js";
2
+ export type EvalLanguage = "python" | "js" | "ruby" | "julia";
3
3
  import type { ImageContent } from "@oh-my-pi/pi-ai";
4
4
  import type { OutputMeta } from "../tools/output-meta";
5
- /** Status event emitted by prelude helpers (python or js) for TUI rendering. */
5
+ /** Status event emitted by eval prelude helpers for TUI rendering. */
6
6
  export interface EvalStatusEvent {
7
7
  op: string;
8
8
  [key: string]: unknown;
9
9
  }
10
- /** Display output captured during eval execution. Union of python and js shapes. */
10
+ /** Display output captured during eval execution across supported backends. */
11
11
  export type EvalDisplayOutput = {
12
12
  type: "json";
13
13
  data: unknown;
@@ -6,9 +6,16 @@ import { type SessionData } from "./html";
6
6
  export { DEFAULT_SHARE_URL };
7
7
  /** Hard cap for blobs accepted by the share server (mirrors relay shareMaxBytes). */
8
8
  export declare const SERVER_MAX_SEALED_BYTES = 1000000;
9
+ export type ShareStore = "blob" | "gist";
9
10
  export interface ShareSessionOptions {
10
11
  /** Share server/viewer base URL; defaults to {@link DEFAULT_SHARE_URL}. */
11
12
  serverUrl?: string;
13
+ /**
14
+ * Where to upload the sealed blob. `"blob"` (default) posts to the share
15
+ * server; `"gist"` pushes to a secret GitHub gist first (needs an
16
+ * authenticated `gh`) and falls back to the server.
17
+ */
18
+ store?: ShareStore;
12
19
  /** Agent state for system prompt + tool descriptions in the snapshot. */
13
20
  state?: AgentState;
14
21
  /**
@@ -36,7 +43,7 @@ export interface ShareSessionResult {
36
43
  }
37
44
  /** Build the snapshot that gets sealed and uploaded, redacted when an obfuscator is provided. */
38
45
  export declare function buildShareSnapshot(sm: SessionManager, options?: ShareSessionOptions): SessionData;
39
- /** Share the session; tries a secret gist first, then the share server. */
46
+ /** Share the session; uploads to the share server unless `options.store` is `"gist"`. */
40
47
  export declare function shareSession(sm: SessionManager, options?: ShareSessionOptions): Promise<ShareSessionResult>;
41
48
  /** Strip trailing slashes so `<base>/<id>` composes cleanly. */
42
49
  export declare function normalizeShareServerUrl(serverUrl?: string): string;
@@ -8,6 +8,7 @@ import type { ModelRegistry } from "../../config/model-registry";
8
8
  import type { Settings } from "../../config/settings";
9
9
  import type { MemoryRuntimeContext } from "../../memory-backend";
10
10
  import type { SessionManager } from "../../session/session-manager";
11
+ import type { BranchHandler, NavigateTreeHandler, NewSessionHandler } from "../session-handler-types";
11
12
  import type { AfterProviderResponseEvent, AssistantThinkingRenderer, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, ContextEvent, Extension, ExtensionActions, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFlag, ExtensionRuntime, ExtensionShortcut, ExtensionUIContext, InputEvent, InputEventResult, MessageRenderer, RegisteredCommand, RegisteredTool, ResourcesDiscoverEvent, SessionBeforeBranchResult, SessionBeforeCompactResult, SessionBeforeSwitchResult, SessionBeforeTreeResult, SessionCompactingResult, SessionStopEvent, SessionStopEventResult, ToolCallEvent, ToolCallEventResult, ToolResultEvent, ToolResultEventResult, UserBashEvent, UserBashEventResult, UserPythonEvent, UserPythonEventResult } from "./types";
12
13
  /** Combined result from all before_agent_start handlers */
13
14
  interface BeforeAgentStartCombinedResult {
@@ -46,20 +47,7 @@ type RunnerEmitResult<TEvent extends RunnerEmitEvent> = TEvent extends {
46
47
  } ? SessionCompactingResult | undefined : TEvent extends {
47
48
  type: "session_stop";
48
49
  } ? SessionStopEventResult | undefined : undefined;
49
- export type NewSessionHandler = (options?: {
50
- parentSession?: string;
51
- setup?: (sessionManager: SessionManager) => Promise<void>;
52
- }) => Promise<{
53
- cancelled: boolean;
54
- }>;
55
- export type BranchHandler = (entryId: string) => Promise<{
56
- cancelled: boolean;
57
- }>;
58
- export type NavigateTreeHandler = (targetId: string, options?: {
59
- summarize?: boolean;
60
- }) => Promise<{
61
- cancelled: boolean;
62
- }>;
50
+ export type { BranchHandler, NavigateTreeHandler, NewSessionHandler };
63
51
  export type SwitchSessionHandler = (sessionPath: string) => Promise<{
64
52
  cancelled: boolean;
65
53
  }>;
@@ -156,4 +144,3 @@ export declare class ExtensionRunner {
156
144
  emitAfterProviderResponse(response: ProviderResponseMetadata, _model?: Model): Promise<void>;
157
145
  emitBeforeAgentStart(prompt: string, images: ImageContent[] | undefined, systemPrompt: string[]): Promise<BeforeAgentStartCombinedResult | undefined>;
158
146
  }
159
- export {};
@@ -1,5 +1,4 @@
1
1
  import type { HookMessage } from "../../session/messages";
2
- import type { SessionManager } from "../../session/session-manager";
3
2
  import type { HookMessageRenderer, RegisteredCommand } from "./types";
4
3
  /**
5
4
  * Generic handler function type.
@@ -16,29 +15,7 @@ export type SendMessageHandler = <T = unknown>(message: Pick<HookMessage<T>, "cu
16
15
  * Append entry handler type for pi.appendEntry().
17
16
  */
18
17
  export type AppendEntryHandler = <T = unknown>(customType: string, data?: T) => void;
19
- /**
20
- * New session handler type for ctx.newSession() in HookCommandContext.
21
- */
22
- export type NewSessionHandler = (options?: {
23
- parentSession?: string;
24
- setup?: (sessionManager: SessionManager) => Promise<void>;
25
- }) => Promise<{
26
- cancelled: boolean;
27
- }>;
28
- /**
29
- * Branch handler type for ctx.branch() in HookCommandContext.
30
- */
31
- export type BranchHandler = (entryId: string) => Promise<{
32
- cancelled: boolean;
33
- }>;
34
- /**
35
- * Navigate tree handler type for ctx.navigateTree() in HookCommandContext.
36
- */
37
- export type NavigateTreeHandler = (targetId: string, options?: {
38
- summarize?: boolean;
39
- }) => Promise<{
40
- cancelled: boolean;
41
- }>;
18
+ export type { BranchHandler, NavigateTreeHandler, NewSessionHandler } from "../session-handler-types";
42
19
  /**
43
20
  * Registered handlers for a loaded hook.
44
21
  */
@@ -86,4 +63,3 @@ export declare function loadHooks(paths: string[], cwd: string): Promise<LoadHoo
86
63
  * Plus any explicitly configured paths from settings.
87
64
  */
88
65
  export declare function discoverAndLoadHooks(configuredPaths: string[], cwd: string): Promise<LoadHooksResult>;
89
- export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Session-lifecycle handler types shared by the extension runner and the hook
3
+ * loader/runner. Both surfaces wire the same new-session / branch / navigate
4
+ * handlers into their command contexts; this is the single source of truth.
5
+ */
6
+ import type { SessionManager } from "../session/session-manager";
7
+ /** Handler for `ctx.newSession()` — creates (and optionally seeds) a session. */
8
+ export type NewSessionHandler = (options?: {
9
+ parentSession?: string;
10
+ setup?: (sessionManager: SessionManager) => Promise<void>;
11
+ }) => Promise<{
12
+ cancelled: boolean;
13
+ }>;
14
+ /** Handler for `ctx.branch()` — branches from a transcript entry. */
15
+ export type BranchHandler = (entryId: string) => Promise<{
16
+ cancelled: boolean;
17
+ }>;
18
+ /** Handler for `ctx.navigateTree()` — navigates the session tree. */
19
+ export type NavigateTreeHandler = (targetId: string, options?: {
20
+ summarize?: boolean;
21
+ }) => Promise<{
22
+ cancelled: boolean;
23
+ }>;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Shared Content-Length message framing for the JSON byte streams spoken by the
3
+ * LSP and DAP stdio clients. Both protocols use the same base-protocol framing:
4
+ * each message is a `Content-Length: <n>\r\n\r\n` header block followed by `<n>`
5
+ * bytes of UTF-8 JSON. This module owns the incremental decode so the two
6
+ * clients don't each reimplement chunk accumulation, header scanning, and the
7
+ * mid-message remainder handoff.
8
+ */
9
+ /**
10
+ * Incremental Content-Length frame decoder for a JSON message byte stream.
11
+ *
12
+ * Incoming bytes are buffered as a list of chunks and only joined when a full
13
+ * message is framed — concatenating the accumulator on every read is O(n^2) for
14
+ * messages that span many reads (e.g. a large initial diagnostics burst). Feed
15
+ * raw chunks with {@link push}, pull every complete message with {@link drain},
16
+ * and persist {@link remainder} when the reader stops so a restarted reader
17
+ * resumes mid-message.
18
+ */
19
+ export declare class MessageFramer {
20
+ #private;
21
+ /** Seed the buffer with any unparsed remainder left by a previous reader. */
22
+ constructor(seed: Buffer);
23
+ /** Append a freshly read chunk to the pending buffer. */
24
+ push(chunk: Buffer): void;
25
+ /**
26
+ * Yield the JSON text of every complete message currently buffered. A header
27
+ * block without a `Content-Length` is non-protocol noise (e.g. a server
28
+ * printing to stdout); `onResync` is invoked with the offending header text
29
+ * and the framer drops past the bogus terminator to recover instead of
30
+ * stalling on the same junk header forever.
31
+ */
32
+ drain(onResync: (headerText: string) => void): Generator<string>;
33
+ /** The unparsed remainder, to persist when the reader stops. */
34
+ remainder(): Buffer;
35
+ }
@@ -16,7 +16,18 @@ export interface ResolveStdioSpawnOptions {
16
16
  env: Record<string, string | undefined>;
17
17
  platform?: NodeJS.Platform;
18
18
  }
19
- /** Resolve the subprocess argv used to launch an MCP stdio server. */
19
+ /**
20
+ * Resolve the subprocess argv used to launch an MCP stdio server.
21
+ *
22
+ * On Windows, our PATH/PATHEXT walk may return `null` for a bare command
23
+ * (e.g. `npx`) — `Bun.env.PATH` empty under a restricted parent process,
24
+ * UNC/network mounts that reject `fs.access`, locked-down shells. The
25
+ * legacy fallback handed `Bun.spawn` the bare name, but `CreateProcess`
26
+ * only appends `.exe` for extensionless names — `.cmd`/`.bat` are never
27
+ * tried, so `npx` (which exists only as `npx.cmd` on Windows) crashes the
28
+ * subprocess immediately. When the resolver can't pin the command down,
29
+ * route through `cmd.exe /d /s /c` so Windows's own PATHEXT lookup runs.
30
+ */
20
31
  export declare function resolveStdioSpawnCommand(config: MCPStdioServerConfig, options: ResolveStdioSpawnOptions): Promise<StdioSpawnCommand>;
21
32
  /** Minimal write surface of `Subprocess.stdin` we need for framed sends. */
22
33
  interface FrameSink {
@@ -1,43 +1,27 @@
1
- import type { Subprocess } from "bun";
1
+ import { type SpawnedSubprocess, type WorkerHandle } from "../subprocess/worker-client";
2
2
  import type { MnemopiEmbedModelId, MnemopiEmbedWorkerInbound, MnemopiEmbedWorkerOutbound } from "./embed-protocol";
3
3
  /**
4
- * Abstraction over the mnemopi embeddings subprocess. The runtime
4
+ * Parent-side handle for the mnemopi embeddings subprocess. The runtime
5
5
  * implementation is a Bun child process so `onnxruntime-node`'s NAPI
6
6
  * constructor + finalizer never run inside the main agent address space —
7
7
  * those destructors segfault Bun on Windows when mnemopi's local embedding
8
8
  * provider loads fastembed in the main process (issue #3031; the mnemopi
9
9
  * sibling of the tiny-model fix from #1606 / #1607).
10
10
  */
11
- export interface MnemopiEmbedWorkerHandle {
12
- send(message: MnemopiEmbedWorkerInbound): void;
13
- onMessage(handler: (message: MnemopiEmbedWorkerOutbound) => void): () => void;
14
- onError(handler: (error: Error) => void): () => void;
15
- terminate(): Promise<void>;
16
- }
11
+ export type MnemopiEmbedWorkerHandle = WorkerHandle<MnemopiEmbedWorkerInbound, MnemopiEmbedWorkerOutbound>;
17
12
  /**
18
13
  * Hidden subcommand on the main CLI that boots the mnemopi embeddings worker
19
14
  * in the spawned subprocess. Kept in sync with the dispatch in `cli.ts`.
20
15
  */
21
16
  export declare const MNEMOPI_EMBED_WORKER_ARG = "__omp_worker_mnemopi_embed";
22
- interface SpawnedSubprocess {
23
- proc: Subprocess<"ignore", "ignore", "ignore">;
24
- inbound: Set<(message: MnemopiEmbedWorkerOutbound) => void>;
25
- errors: Set<(error: Error) => void>;
26
- /**
27
- * Flipped to `true` right before the deliberate SIGKILL so `onExit` can
28
- * distinguish the expected hard-kill from a crash (SIGSEGV from a native
29
- * fault, OOM SIGKILL, operator `kill -9`). Only the latter surfaces as a
30
- * worker error so callers don't await forever.
31
- */
32
- intentionalExit: {
33
- value: boolean;
34
- };
35
- }
36
17
  /**
37
18
  * Spawn the mnemopi embeddings worker as a subprocess. Exported for tests and
38
19
  * the smoke probe; production callers go through {@link spawnMnemopiEmbedWorker}.
20
+ * The child inherits the parent env verbatim — fastembed honours `HF_HUB_*`,
21
+ * `HTTPS_PROXY`, etc., and our `loadFastembed()` reads the same `OMP_*`
22
+ * runtime-install knobs the parent uses.
39
23
  */
40
- export declare function createMnemopiEmbedSubprocess(): SpawnedSubprocess;
24
+ export declare function createMnemopiEmbedSubprocess(): SpawnedSubprocess<MnemopiEmbedWorkerOutbound>;
41
25
  /**
42
26
  * Per-model wrapper produced by {@link MnemopiEmbedClient.initialize}.
43
27
  * `embed()` round-trips one batch of texts through the worker subprocess and
@@ -67,4 +51,3 @@ export declare function shutdownMnemopiEmbedClient(): Promise<void>;
67
51
  export declare function smokeTestMnemopiEmbedWorker({ timeoutMs, }?: {
68
52
  timeoutMs?: number;
69
53
  }): Promise<void>;
70
- export {};
@@ -12,7 +12,7 @@
12
12
  * component reuse could.
13
13
  */
14
14
  import type { AgentTool } from "@oh-my-pi/pi-agent-core";
15
- import { type TUI } from "@oh-my-pi/pi-tui";
15
+ import type { TUI } from "@oh-my-pi/pi-tui";
16
16
  import type { MessageRenderer } from "../../extensibility/extensions/types";
17
17
  import type { SessionMessageEntry } from "../../session/session-entries";
18
18
  import { TranscriptContainer } from "./transcript-container";
@@ -1,3 +1,4 @@
1
+ import type { ImageContent } from "@oh-my-pi/pi-ai";
1
2
  import { Editor, type KeyId } from "@oh-my-pi/pi-tui";
2
3
  import type { AppKeybinding } from "../../config/keybindings";
3
4
  type ConfigurableEditorAction = Extract<AppKeybinding, "app.interrupt" | "app.clear" | "app.exit" | "app.suspend" | "app.display.reset" | "app.thinking.cycle" | "app.model.cycleForward" | "app.model.cycleBackward" | "app.model.select" | "app.model.selectTemporary" | "app.tools.expand" | "app.thinking.toggle" | "app.editor.external" | "app.history.search" | "app.message.dequeue" | "app.retry" | "app.clipboard.pasteImage" | "app.clipboard.pasteTextRaw" | "app.clipboard.copyPrompt">;
@@ -26,6 +27,16 @@ export declare function extractBracketedImagePastePath(data: string): string | u
26
27
  export declare class CustomEditor extends Editor {
27
28
  #private;
28
29
  imageLinks?: readonly (string | undefined)[];
30
+ /** Draft images pasted into the composer, consumed on submit. Co-located with
31
+ * {@link imageLinks} so every piece of draft-image state lives on the editor. */
32
+ pendingImages: ImageContent[];
33
+ /** Per-image source links (file:// targets) parallel to {@link pendingImages};
34
+ * `undefined` entries are images without a backing reference yet. */
35
+ pendingImageLinks: (string | undefined)[];
36
+ /** Clear the composer draft: optionally commit `historyText` to history, then
37
+ * reset the editor text and all pending draft-image state. The shared tail of
38
+ * every "message submitted" path; pass no argument for a plain discard. */
39
+ clearDraft(historyText?: string): void;
29
40
  /** Treat image/paste markers as indivisible: a stray backspace deletes the whole token
30
41
  * instead of corrupting `[Paste #1, +30 lines]` into plain text. */
31
42
  atomicTokenPattern: RegExp;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Render `rows` through a {@link ScrollView} with the shared list theme (muted
3
+ * track / accent thumb) and an "auto" scrollbar, positioned at `scrollOffset`.
4
+ * Returns the rendered lines for the caller to append to its output.
5
+ */
6
+ export declare function renderScrollableList(rows: readonly string[], options: {
7
+ width: number;
8
+ totalRows: number;
9
+ scrollOffset: number;
10
+ }): readonly string[];
11
+ /**
12
+ * Center a viewport window of `maxVisible` rows on `selectedIndex` within a
13
+ * list of `total` rows, clamped to valid bounds. Used by the selection-centered
14
+ * list panes (history search, tree selector).
15
+ */
16
+ export declare function centeredWindow(selectedIndex: number, total: number, maxVisible: number): {
17
+ startIndex: number;
18
+ endIndex: number;
19
+ };
20
+ /**
21
+ * Width available for row content, reserving the rightmost column for the
22
+ * scrollbar when the list overflows its visible window.
23
+ */
24
+ export declare function contentRowWidth(width: number, total: number, maxVisible: number): number;
25
+ /**
26
+ * Clamp `selectedIndex` into `[0, total)` and nudge `scrollOffset` so the
27
+ * selection stays within the visible window of `maxVisible` rows. Returns the
28
+ * adjusted pair; on an empty list both reset to 0.
29
+ */
30
+ export declare function clampSelection(selectedIndex: number, scrollOffset: number, total: number, maxVisible: number): {
31
+ selectedIndex: number;
32
+ scrollOffset: number;
33
+ };
34
+ /**
35
+ * Classify a key event for search-query text entry. Returns the single
36
+ * printable character to append to the query, or `null` when the key is not a
37
+ * searchable character: non-printable, multi-byte, or a reserved `j`/`k`
38
+ * navigation key.
39
+ */
40
+ export declare function searchableChar(data: string): string | null;
41
+ /**
42
+ * Handle the shared tab-cycling keys: Tab/Right advance to the next tab,
43
+ * Shift+Tab/Left to the previous. Invokes `switchTab` with the direction and
44
+ * returns true when the key was consumed.
45
+ */
46
+ export declare function handleTabSwitchKey(data: string, switchTab: (direction: 1 | -1) => void): boolean;
47
+ /**
48
+ * Pad `lines` with blank rows up to `rows` so a full-screen overlay covers the
49
+ * viewport instead of letting the transcript peek through below it. Copies
50
+ * before padding — the source array may be component-owned and must not be
51
+ * mutated.
52
+ */
53
+ export declare function padLinesToHeight(lines: readonly string[], rows: number): readonly string[];
@@ -2,8 +2,9 @@ import type { ThemeColor } from "../../../modes/theme/theme";
2
2
  export type ContextUsageLevel = "normal" | "warning" | "purple" | "error";
3
3
  export declare function getContextUsageLevel(contextPercent: number, contextWindow: number): ContextUsageLevel;
4
4
  /**
5
- * Format context usage as `<percent>%/<window>` (e.g. `5.1%/1M`), matching the
6
- * status line's context gauge so subagent and footer renderers stay in sync.
5
+ * Format context usage as `<percent>%/<window>` when the model window is known.
6
+ * Unknown windows render as `<tokens>/?`, because `0.0%/0` suggests a real
7
+ * empty context instead of missing provider metadata.
7
8
  */
8
- export declare function formatContextUsage(contextPercent: number | null | undefined, contextWindow: number): string;
9
+ export declare function formatContextUsage(contextPercent: number | null | undefined, contextWindow: number, usedTokens?: number): string;
9
10
  export declare function getContextUsageThemeColor(level: ContextUsageLevel): ThemeColor;
@@ -72,6 +72,7 @@ export interface SegmentContext {
72
72
  };
73
73
  /** Context usage percent, or null when unknown (e.g. right after compaction). */
74
74
  contextPercent: number | null;
75
+ contextTokens: number;
75
76
  contextWindow: number;
76
77
  autoCompactEnabled: boolean;
77
78
  subagentCount: number;
@@ -110,8 +110,6 @@ export declare class InteractiveMode implements InteractiveModeContext {
110
110
  todoPhases: TodoPhase[];
111
111
  hideThinkingBlock: boolean;
112
112
  proseOnlyThinking: boolean;
113
- pendingImages: ImageContent[];
114
- pendingImageLinks: (string | undefined)[];
115
113
  compactionQueuedMessages: CompactionQueuedMessage[];
116
114
  pendingTools: Map<string, ToolExecutionHandle>;
117
115
  pendingBashComponents: BashExecutionComponent[];
@@ -6,7 +6,7 @@ export type SymbolPreset = "unicode" | "nerd" | "ascii";
6
6
  /**
7
7
  * All available symbol keys organized by category.
8
8
  */
9
- export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "status.done" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.ghost" | "icon.agents" | "icon.job" | "icon.cache" | "icon.cacheMiss" | "icon.input" | "icon.output" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.mic" | "icon.camera" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "radio.selected" | "radio.unselected" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.files" | "tab.shell" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers" | "tool.write" | "tool.edit" | "tool.bash" | "tool.ssh" | "tool.lsp" | "tool.gh" | "tool.webSearch" | "tool.exa" | "tool.browser" | "tool.eval" | "tool.debug" | "tool.mcp" | "tool.job" | "tool.task" | "tool.todo" | "tool.memory" | "tool.ask" | "tool.resolve" | "tool.review" | "tool.inspectImage" | "tool.goal" | "tool.irc";
9
+ export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "status.done" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.search" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.ghost" | "icon.agents" | "icon.job" | "icon.cache" | "icon.cacheMiss" | "icon.input" | "icon.output" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.mic" | "icon.camera" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "radio.selected" | "radio.unselected" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.julia" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.files" | "tab.shell" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers" | "tool.write" | "tool.edit" | "tool.bash" | "tool.ssh" | "tool.lsp" | "tool.gh" | "tool.webSearch" | "tool.exa" | "tool.browser" | "tool.eval" | "tool.debug" | "tool.mcp" | "tool.job" | "tool.task" | "tool.todo" | "tool.memory" | "tool.ask" | "tool.resolve" | "tool.review" | "tool.inspectImage" | "tool.goal" | "tool.irc";
10
10
  export type SpinnerType = "status" | "activity";
11
11
  export type ThemeColor = "accent" | "border" | "borderAccent" | "borderMuted" | "success" | "error" | "warning" | "muted" | "dim" | "text" | "thinkingText" | "userMessageText" | "customMessageText" | "customMessageLabel" | "toolTitle" | "toolOutput" | "mdHeading" | "mdLink" | "mdLinkUrl" | "mdCode" | "mdCodeBlock" | "mdCodeBlockBorder" | "mdQuote" | "mdQuoteBorder" | "mdHr" | "mdListBullet" | "toolDiffAdded" | "toolDiffRemoved" | "toolDiffContext" | "syntaxComment" | "syntaxKeyword" | "syntaxFunction" | "syntaxVariable" | "syntaxString" | "syntaxNumber" | "syntaxType" | "syntaxOperator" | "syntaxPunctuation" | "thinkingOff" | "thinkingMinimal" | "thinkingLow" | "thinkingMedium" | "thinkingHigh" | "thinkingXhigh" | "bashMode" | "pythonMode" | "statusLineSep" | "statusLineModel" | "statusLinePath" | "statusLineGitClean" | "statusLineGitDirty" | "statusLineContext" | "statusLineSpend" | "statusLineStaged" | "statusLineDirty" | "statusLineUntracked" | "statusLineOutput" | "statusLineCost" | "statusLineSubagents";
12
12
  /** Check if a string is a valid ThemeColor value */
@@ -241,6 +241,13 @@ export declare class Theme {
241
241
  * Maps common language names to their corresponding symbol keys.
242
242
  */
243
243
  getLangIcon(lang: string | undefined): string;
244
+ /**
245
+ * Language icon tinted with the language's brand color (see
246
+ * {@link LANG_BRAND_COLORS}). Falls back to the muted theme color for
247
+ * languages without a brand entry, and returns the bare (possibly empty)
248
+ * icon when the active symbol preset has none.
249
+ */
250
+ getLangIconStyled(lang: string | undefined): string;
244
251
  }
245
252
  export declare function getAvailableThemes(): Promise<string[]>;
246
253
  export interface ThemeInfo {
@@ -141,8 +141,6 @@ export interface InteractiveModeContext {
141
141
  planModePlanFilePath?: string;
142
142
  hideThinkingBlock: boolean;
143
143
  proseOnlyThinking: boolean;
144
- pendingImages: ImageContent[];
145
- pendingImageLinks: (string | undefined)[];
146
144
  compactionQueuedMessages: CompactionQueuedMessage[];
147
145
  pendingTools: Map<string, ToolExecutionHandle>;
148
146
  pendingBashComponents: BashExecutionComponent[];
@@ -21,7 +21,7 @@ export type MessageBlock = ({
21
21
  export interface LastCommand {
22
22
  kind: "bash" | "eval";
23
23
  code: string;
24
- /** Highlight language: "bash" for bash, "python"/"javascript" for eval. */
24
+ /** Highlight language: "bash" for bash, or the resolved eval language ("python"/"javascript"/"ruby"/"julia"). */
25
25
  language: string;
26
26
  }
27
27
  /**
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Small helpers over {@link InteractiveModeContext} shared between
3
+ * {@link UiHelpers} and the input/event controllers, so the live chat surfaces
4
+ * construct components and reset editor state identically.
5
+ */
6
+ import type { AssistantMessage } from "@oh-my-pi/pi-ai";
7
+ import { AssistantMessageComponent } from "../components/assistant-message";
8
+ import type { InteractiveModeContext } from "../types";
9
+ /**
10
+ * Construct an {@link AssistantMessageComponent} wired to the live context's
11
+ * thinking/image settings. `message` is omitted for the streaming placeholder
12
+ * component and supplied when rendering a persisted turn.
13
+ */
14
+ export declare function createAssistantMessageComponent(ctx: InteractiveModeContext, message?: AssistantMessage): AssistantMessageComponent;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Render helpers shared between the live transcript ({@link UiHelpers}) and the
3
+ * file/remote-backed {@link ChatTranscriptBuilder}. Both surfaces build the same
4
+ * transcript rows from persisted message entries; holding the row construction
5
+ * here keeps the two byte-for-byte identical.
6
+ */
7
+ import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
8
+ import { type Component } from "@oh-my-pi/pi-tui";
9
+ import { type FileMentionMessage } from "../../session/messages";
10
+ import { TranscriptBlock } from "../components/transcript-container";
11
+ type CustomOrHookMessage = Extract<AgentMessage, {
12
+ role: "custom" | "hookMessage";
13
+ }>;
14
+ type AssistantAgentMessage = Extract<AgentMessage, {
15
+ role: "assistant";
16
+ }>;
17
+ /**
18
+ * Render an `async-result` custom message (a completed background bash/task job,
19
+ * or a batch of them) as a transcript block of one "Background job completed"
20
+ * row per job.
21
+ */
22
+ export declare function buildAsyncResultBlock(message: CustomOrHookMessage): TranscriptBlock;
23
+ /**
24
+ * Render a live IRC traffic custom message (`irc:incoming` / `irc:autoreply` /
25
+ * `irc:relay`) as a transcript card. `getExpanded` supplies the live
26
+ * expanded-state getter for the cached card.
27
+ */
28
+ export declare function buildIrcMessageCard(message: CustomOrHookMessage, getExpanded: () => boolean): Component;
29
+ /**
30
+ * Render a `fileMention` message's files as a transcript block of "Read <path>"
31
+ * rows. `indent` sets the left pad: the live chat renders within an outer gutter
32
+ * (0), the transcript viewer renders body rows without one so rows own their pad
33
+ * (1).
34
+ */
35
+ export declare function buildFileMentionBlock(files: FileMentionMessage["files"], indent: number): TranscriptBlock;
36
+ /**
37
+ * Whether an assistant turn has visible text or thinking content (after
38
+ * canonicalization) — i.e. content that closes the current read-tool run.
39
+ */
40
+ export declare function assistantHasVisibleContent(message: AssistantAgentMessage): boolean;
41
+ /**
42
+ * Normalize raw tool-call arguments to a plain record, collapsing non-object or
43
+ * array values to an empty object.
44
+ */
45
+ export declare function normalizeToolArgs(args: unknown): Record<string, unknown>;
46
+ /**
47
+ * Resolve the inline error label, if any, for a turn-ending assistant message.
48
+ * Silent aborts yield no label. `retryAttempt` tunes the abort label wording.
49
+ */
50
+ export declare function resolveAssistantErrorMessage(message: AssistantAgentMessage, retryAttempt?: number): {
51
+ hasErrorStop: boolean;
52
+ errorMessage: string | null;
53
+ };
54
+ export {};
@@ -128,7 +128,7 @@ export interface CreateAgentSessionOptions {
128
128
  mcpManager?: MCPManager;
129
129
  /** Enable LSP integration (tool, formatting, diagnostics, warmup). Default: true */
130
130
  enableLsp?: boolean;
131
- /** Skip Python kernel availability check and prelude warmup */
131
+ /** Skip subprocess-kernel availability checks and prelude warmup */
132
132
  skipPythonPreflight?: boolean;
133
133
  /** Tool names explicitly requested (enables disabled-by-default tools) */
134
134
  toolNames?: string[];