@oh-my-pi/pi-coding-agent 15.10.0 → 15.10.1

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 (176) hide show
  1. package/CHANGELOG.md +75 -1
  2. package/dist/types/cli/dry-balance-cli.d.ts +15 -1
  3. package/dist/types/commit/analysis/conventional.d.ts +2 -2
  4. package/dist/types/commit/analysis/summary.d.ts +2 -2
  5. package/dist/types/commit/changelog/generate.d.ts +2 -2
  6. package/dist/types/commit/changelog/index.d.ts +2 -2
  7. package/dist/types/commit/map-reduce/index.d.ts +3 -3
  8. package/dist/types/commit/map-reduce/map-phase.d.ts +2 -2
  9. package/dist/types/commit/map-reduce/reduce-phase.d.ts +2 -2
  10. package/dist/types/commit/model-selection.d.ts +10 -4
  11. package/dist/types/config/api-key-resolver.d.ts +34 -0
  12. package/dist/types/config/model-registry.d.ts +17 -1
  13. package/dist/types/config/settings-schema.d.ts +9 -0
  14. package/dist/types/dap/config.d.ts +14 -1
  15. package/dist/types/dap/types.d.ts +10 -0
  16. package/dist/types/lsp/utils.d.ts +3 -2
  17. package/dist/types/modes/components/chat-block.d.ts +64 -0
  18. package/dist/types/modes/components/custom-editor.d.ts +3 -0
  19. package/dist/types/modes/components/overlay-box.d.ts +17 -0
  20. package/dist/types/modes/components/plan-review-overlay.d.ts +59 -0
  21. package/dist/types/modes/components/plan-toc.d.ts +41 -0
  22. package/dist/types/modes/components/read-tool-group.d.ts +2 -0
  23. package/dist/types/modes/components/transcript-container.d.ts +11 -0
  24. package/dist/types/modes/controllers/command-controller.d.ts +1 -0
  25. package/dist/types/modes/controllers/event-controller.d.ts +0 -1
  26. package/dist/types/modes/controllers/extension-ui-controller.d.ts +0 -1
  27. package/dist/types/modes/controllers/input-controller.d.ts +1 -1
  28. package/dist/types/modes/controllers/streaming-reveal.d.ts +22 -0
  29. package/dist/types/modes/controllers/tan-command-controller.d.ts +6 -0
  30. package/dist/types/modes/interactive-mode.d.ts +15 -5
  31. package/dist/types/modes/theme/theme.d.ts +1 -1
  32. package/dist/types/modes/types.d.ts +18 -5
  33. package/dist/types/modes/utils/copy-targets.d.ts +21 -1
  34. package/dist/types/plan-mode/approved-plan.d.ts +27 -8
  35. package/dist/types/plan-mode/plan-protection.d.ts +4 -4
  36. package/dist/types/sdk.d.ts +2 -0
  37. package/dist/types/session/agent-session.d.ts +21 -0
  38. package/dist/types/session/messages.d.ts +12 -0
  39. package/dist/types/session/session-manager.d.ts +3 -1
  40. package/dist/types/slash-commands/types.d.ts +4 -6
  41. package/dist/types/task/executor.d.ts +7 -0
  42. package/dist/types/task/index.d.ts +1 -0
  43. package/dist/types/task/render.d.ts +3 -2
  44. package/dist/types/tools/archive-reader.d.ts +5 -0
  45. package/dist/types/tools/ast-edit.d.ts +3 -0
  46. package/dist/types/tools/ast-grep.d.ts +3 -0
  47. package/dist/types/tools/bash.d.ts +1 -0
  48. package/dist/types/tools/find.d.ts +8 -4
  49. package/dist/types/tools/grouped-file-output.d.ts +95 -12
  50. package/dist/types/tools/memory-render.d.ts +4 -1
  51. package/dist/types/tools/plan-mode-guard.d.ts +8 -9
  52. package/dist/types/tools/render-utils.d.ts +5 -9
  53. package/dist/types/tools/search.d.ts +4 -0
  54. package/dist/types/tools/sqlite-reader.d.ts +1 -0
  55. package/dist/types/tools/todo.d.ts +3 -2
  56. package/dist/types/tools/write.d.ts +3 -0
  57. package/dist/types/tui/output-block.d.ts +16 -4
  58. package/dist/types/tui/status-line.d.ts +3 -0
  59. package/dist/types/utils/enhanced-paste.d.ts +20 -0
  60. package/dist/types/web/search/providers/kimi.d.ts +1 -1
  61. package/package.json +9 -9
  62. package/src/auto-thinking/classifier.ts +5 -1
  63. package/src/cli/dry-balance-cli.ts +52 -17
  64. package/src/cli/gallery-cli.ts +4 -1
  65. package/src/cli/gallery-fixtures/misc.ts +29 -0
  66. package/src/commit/analysis/conventional.ts +2 -2
  67. package/src/commit/analysis/summary.ts +2 -2
  68. package/src/commit/changelog/generate.ts +2 -2
  69. package/src/commit/changelog/index.ts +2 -2
  70. package/src/commit/map-reduce/index.ts +3 -3
  71. package/src/commit/map-reduce/map-phase.ts +2 -2
  72. package/src/commit/map-reduce/reduce-phase.ts +2 -2
  73. package/src/commit/model-selection.ts +33 -9
  74. package/src/commit/pipeline.ts +4 -4
  75. package/src/config/api-key-resolver.ts +58 -0
  76. package/src/config/model-registry.ts +25 -2
  77. package/src/config/settings-schema.ts +10 -0
  78. package/src/config/settings.ts +20 -2
  79. package/src/dap/config.ts +41 -2
  80. package/src/dap/defaults.json +1 -0
  81. package/src/dap/session.ts +1 -0
  82. package/src/dap/types.ts +10 -0
  83. package/src/debug/index.ts +40 -54
  84. package/src/edit/renderer.ts +82 -78
  85. package/src/eval/__tests__/llm-bridge.test.ts +90 -31
  86. package/src/eval/llm-bridge.ts +8 -3
  87. package/src/goals/tools/goal-tool.ts +36 -26
  88. package/src/internal-urls/docs-index.generated.ts +6 -6
  89. package/src/lsp/utils.ts +3 -2
  90. package/src/main.ts +9 -7
  91. package/src/memories/index.ts +12 -5
  92. package/src/mnemopi/backend.ts +5 -1
  93. package/src/modes/acp/acp-agent.ts +33 -26
  94. package/src/modes/components/assistant-message.ts +2 -9
  95. package/src/modes/components/chat-block.ts +111 -0
  96. package/src/modes/components/copy-selector.ts +1 -44
  97. package/src/modes/components/custom-editor.ts +23 -0
  98. package/src/modes/components/custom-message.ts +1 -3
  99. package/src/modes/components/execution-shared.ts +1 -2
  100. package/src/modes/components/hook-message.ts +1 -3
  101. package/src/modes/components/overlay-box.ts +108 -0
  102. package/src/modes/components/plan-review-overlay.ts +799 -0
  103. package/src/modes/components/plan-toc.ts +138 -0
  104. package/src/modes/components/read-tool-group.ts +20 -4
  105. package/src/modes/components/skill-message.ts +0 -1
  106. package/src/modes/components/tips.txt +1 -0
  107. package/src/modes/components/todo-reminder.ts +0 -2
  108. package/src/modes/components/tool-execution.ts +68 -88
  109. package/src/modes/components/transcript-container.ts +84 -24
  110. package/src/modes/components/user-message.ts +1 -2
  111. package/src/modes/controllers/command-controller-shared.ts +7 -6
  112. package/src/modes/controllers/command-controller.ts +57 -55
  113. package/src/modes/controllers/event-controller.ts +41 -40
  114. package/src/modes/controllers/extension-ui-controller.ts +10 -73
  115. package/src/modes/controllers/input-controller.ts +124 -119
  116. package/src/modes/controllers/mcp-command-controller.ts +69 -60
  117. package/src/modes/controllers/selector-controller.ts +23 -25
  118. package/src/modes/controllers/streaming-reveal.ts +212 -0
  119. package/src/modes/controllers/tan-command-controller.ts +173 -0
  120. package/src/modes/interactive-mode.ts +169 -94
  121. package/src/modes/setup-wizard/wizard-overlay.ts +1 -1
  122. package/src/modes/theme/theme-schema.json +1 -1
  123. package/src/modes/theme/theme.ts +8 -4
  124. package/src/modes/types.ts +18 -7
  125. package/src/modes/utils/copy-targets.ts +133 -27
  126. package/src/modes/utils/ui-helpers.ts +44 -46
  127. package/src/plan-mode/approved-plan.ts +66 -43
  128. package/src/plan-mode/plan-protection.ts +4 -4
  129. package/src/prompts/system/background-tan-dispatch.md +8 -0
  130. package/src/prompts/system/plan-mode-active.md +67 -58
  131. package/src/prompts/system/plan-mode-approved.md +1 -1
  132. package/src/sdk.ts +11 -37
  133. package/src/session/agent-session.ts +82 -6
  134. package/src/session/messages.ts +26 -0
  135. package/src/session/session-manager.ts +13 -5
  136. package/src/slash-commands/builtin-registry.ts +36 -9
  137. package/src/slash-commands/types.ts +4 -6
  138. package/src/task/executor.ts +5 -2
  139. package/src/task/index.ts +4 -0
  140. package/src/task/render.ts +212 -147
  141. package/src/tools/archive-reader.ts +64 -0
  142. package/src/tools/ask.ts +119 -164
  143. package/src/tools/ast-edit.ts +98 -71
  144. package/src/tools/ast-grep.ts +37 -43
  145. package/src/tools/bash.ts +50 -6
  146. package/src/tools/debug.ts +20 -8
  147. package/src/tools/fetch.ts +297 -7
  148. package/src/tools/find.ts +44 -30
  149. package/src/tools/gh-renderer.ts +81 -42
  150. package/src/tools/grouped-file-output.ts +272 -48
  151. package/src/tools/image-gen.ts +150 -103
  152. package/src/tools/inspect-image-renderer.ts +63 -41
  153. package/src/tools/inspect-image.ts +8 -1
  154. package/src/tools/job.ts +3 -4
  155. package/src/tools/memory-render.ts +4 -1
  156. package/src/tools/plan-mode-guard.ts +21 -39
  157. package/src/tools/read.ts +23 -16
  158. package/src/tools/render-utils.ts +21 -37
  159. package/src/tools/resolve.ts +14 -0
  160. package/src/tools/search-tool-bm25.ts +36 -23
  161. package/src/tools/search.ts +80 -78
  162. package/src/tools/sqlite-reader.ts +9 -12
  163. package/src/tools/todo.ts +118 -52
  164. package/src/tools/write.ts +81 -62
  165. package/src/tui/output-block.ts +60 -13
  166. package/src/tui/status-line.ts +5 -1
  167. package/src/utils/commit-message-generator.ts +9 -1
  168. package/src/utils/enhanced-paste.ts +202 -0
  169. package/src/utils/title-generator.ts +2 -1
  170. package/src/web/search/providers/anthropic.ts +25 -19
  171. package/src/web/search/providers/exa.ts +11 -3
  172. package/src/web/search/providers/kimi.ts +28 -17
  173. package/src/web/search/providers/parallel.ts +35 -24
  174. package/src/web/search/providers/synthetic.ts +8 -6
  175. package/src/web/search/providers/tavily.ts +9 -8
  176. package/src/web/search/providers/zai.ts +8 -6
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Pure heading/section parser for the plan-review overlay. It splits a plan's
3
+ * markdown into a flat list of sections — a leading preamble (text before the
4
+ * first heading) followed by one entry per ATX heading — preserving the exact
5
+ * source bytes of each section so the overlay can render, reorder-free delete,
6
+ * and round-trip the document without a full markdown re-render.
7
+ *
8
+ * No TUI dependencies: this module is unit-tested in isolation.
9
+ */
10
+ export interface PlanSection {
11
+ /** `0` = preamble (no heading, no ToC entry); `1..6` = heading depth. */
12
+ level: number;
13
+ /** Plain-text heading label with inline markdown lightly stripped. */
14
+ title: string;
15
+ /** Exact source slice for this section, including its trailing newline(s). */
16
+ raw: string;
17
+ }
18
+ /**
19
+ * Collapse inline markdown emphasis/link/code syntax to readable text. This is
20
+ * a deliberately light strip (not a full markdown render) just so ToC entries
21
+ * read cleanly — `**Goal** & [docs](x)` becomes `Goal & docs`.
22
+ */
23
+ export declare function stripInlineMarkdown(text: string): string;
24
+ /**
25
+ * Split `text` into preamble + heading sections. `#` characters inside fenced
26
+ * code blocks are never treated as headings. Concatenating every section's
27
+ * `raw` reproduces the original text exactly.
28
+ */
29
+ export declare function parsePlanSections(text: string): PlanSection[];
30
+ /**
31
+ * Concatenate every section's `raw` back into a single document and guarantee a
32
+ * single trailing newline. Inverse of {@link parsePlanSections} for any input
33
+ * that already ends with a newline.
34
+ */
35
+ export declare function joinPlanSections(sections: readonly PlanSection[]): string;
36
+ /**
37
+ * Indices to remove when deleting `sections[index]`: the heading itself plus
38
+ * every following section nested deeper than it (its sub-headings). The
39
+ * preamble (level 0) is never a deletion target and yields an empty span.
40
+ */
41
+ export declare function sectionDeletionSpan(sections: readonly PlanSection[], index: number): number[];
@@ -14,6 +14,8 @@ type ReadToolGroupOptions = {
14
14
  export declare class ReadToolGroupComponent extends Container implements ToolExecutionHandle {
15
15
  #private;
16
16
  constructor(options?: ReadToolGroupOptions);
17
+ isTranscriptBlockFinalized(): boolean;
18
+ finalize(): void;
17
19
  updateArgs(args: ReadRenderArgs, toolCallId?: string): void;
18
20
  updateResult(result: {
19
21
  content: Array<{
@@ -36,3 +36,14 @@ export declare class TranscriptContainer extends Container implements NativeScro
36
36
  thaw(): void;
37
37
  render(width: number): string[];
38
38
  }
39
+ /**
40
+ * Groups a run of sibling rows (an IRC card's header + body, a file-mention
41
+ * list, a bordered command/version panel) into a single transcript child so the
42
+ * container spaces it as one block — one blank line above, none injected between
43
+ * its rows. Without this wrapper the rows would be top-level children and the
44
+ * container would put a blank line between each (and inside any border box).
45
+ * It is a plain {@link Container}; the named subclass documents intent and makes
46
+ * every manual block grouping greppable.
47
+ */
48
+ export declare class TranscriptBlock extends Container {
49
+ }
@@ -22,6 +22,7 @@ export declare class CommandController {
22
22
  handleContextCommand(): void;
23
23
  handleMemoryCommand(text: string): Promise<void>;
24
24
  handleClearCommand(): Promise<void>;
25
+ handleFreshCommand(): Promise<void>;
25
26
  handleDropCommand(): Promise<void>;
26
27
  handleForkCommand(): Promise<void>;
27
28
  handleMoveCommand(targetPath: string): Promise<void>;
@@ -8,5 +8,4 @@ export declare class EventController {
8
8
  subscribeToAgent(): void;
9
9
  handleEvent(event: AgentSessionEvent): Promise<void>;
10
10
  sendCompletionNotification(): void;
11
- handleBackgroundEvent(event: AgentSessionEvent): Promise<void>;
12
11
  }
@@ -14,7 +14,6 @@ export declare class ExtensionUiController {
14
14
  initHooksAndCustomTools(): Promise<void>;
15
15
  setHookWidget(key: string, content: ExtensionWidgetContent, options?: ExtensionWidgetOptions): void;
16
16
  initializeHookRunner(uiContext: ExtensionUIContext, _hasUI: boolean): void;
17
- createBackgroundUiContext(): ExtensionUIContext;
18
17
  /**
19
18
  * Emit session event to all extension tools.
20
19
  */
@@ -16,7 +16,7 @@ export declare class InputController {
16
16
  abort?: boolean;
17
17
  currentText?: string;
18
18
  }): number;
19
- handleBackgroundCommand(): void;
19
+ handleImagePathPaste(path: string): Promise<void>;
20
20
  handleImagePaste(): Promise<boolean>;
21
21
  handleClipboardTextRawPaste(): Promise<void>;
22
22
  createAutocompleteProvider(commands: SlashCommand[], basePath: string): AutocompleteProvider;
@@ -0,0 +1,22 @@
1
+ import type { AssistantMessage } from "@oh-my-pi/pi-ai";
2
+ import type { AssistantMessageComponent } from "../components/assistant-message";
3
+ export declare const STREAMING_REVEAL_FRAME_MS: number;
4
+ export declare const MIN_STEP = 3;
5
+ export declare const CATCHUP_FRAMES = 8;
6
+ type StreamingRevealComponent = Pick<AssistantMessageComponent, "updateContent">;
7
+ type StreamingRevealControllerOptions = {
8
+ getSmoothStreaming(): boolean;
9
+ getHideThinkingBlock(): boolean;
10
+ requestRender(): void;
11
+ };
12
+ export declare function visibleUnits(message: AssistantMessage, hideThinking: boolean): number;
13
+ export declare function buildDisplayMessage(target: AssistantMessage, revealed: number, hideThinking: boolean): AssistantMessage;
14
+ export declare function nextStep(backlog: number): number;
15
+ export declare class StreamingRevealController {
16
+ #private;
17
+ constructor(options: StreamingRevealControllerOptions);
18
+ begin(component: StreamingRevealComponent, message: AssistantMessage): void;
19
+ setTarget(message: AssistantMessage): void;
20
+ stop(): void;
21
+ }
22
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { InteractiveModeContext } from "../types";
2
+ export declare class TanCommandController {
3
+ private readonly ctx;
4
+ constructor(ctx: InteractiveModeContext);
5
+ start(work: string): Promise<void>;
6
+ }
@@ -8,7 +8,7 @@ import { Settings } from "../config/settings";
8
8
  import type { ExtensionUIContext, ExtensionUIDialogOptions, ExtensionUISelectItem, ExtensionWidgetContent, ExtensionWidgetOptions } from "../extensibility/extensions";
9
9
  import type { CompactOptions } from "../extensibility/extensions/types";
10
10
  import { type PlanApprovalDetails } from "../plan-mode/approved-plan";
11
- import type { AgentSession, AgentSessionEvent } from "../session/agent-session";
11
+ import type { AgentSession } from "../session/agent-session";
12
12
  import { HistoryStorage } from "../session/history-storage";
13
13
  import type { SessionContext, SessionManager } from "../session/session-manager";
14
14
  import type { ShakeMode } from "../session/shake-types";
@@ -63,7 +63,6 @@ export declare class InteractiveMode implements InteractiveModeContext {
63
63
  hookWidgetContainerBelow: Container;
64
64
  statusLine: StatusLineComponent;
65
65
  isInitialized: boolean;
66
- isBackgrounded: boolean;
67
66
  isBashMode: boolean;
68
67
  toolOutputExpanded: boolean;
69
68
  todoExpanded: boolean;
@@ -150,6 +149,16 @@ export declare class InteractiveMode implements InteractiveModeContext {
150
149
  rebuildChatFromMessages(): void;
151
150
  /** Apply any deferred model switch after the current stream ends. */
152
151
  flushPendingModelSwitch(): Promise<void>;
152
+ showPlanReview(planContent: string, title: string, options: string[], dialogOptions?: {
153
+ helpText?: string;
154
+ disabledIndices?: number[];
155
+ onExternalEditor?: () => void;
156
+ onPlanEdited?: (content: string) => void;
157
+ onFeedbackChange?: (feedback: string) => void;
158
+ initialIndex?: number;
159
+ }, extra?: {
160
+ slider?: HookSelectorSlider;
161
+ }): Promise<string | undefined>;
153
162
  handlePlanModeCommand(initialPrompt?: string): Promise<void>;
154
163
  handleGoalModeCommand(rest?: string): Promise<void>;
155
164
  handlePlanApproval(details: PlanApprovalDetails): Promise<void>;
@@ -158,9 +167,9 @@ export declare class InteractiveMode implements InteractiveModeContext {
158
167
  checkShutdownRequested(): Promise<void>;
159
168
  setToolUIContext(uiContext: ExtensionUIContext, hasUI: boolean): void;
160
169
  initializeHookRunner(uiContext: ExtensionUIContext, hasUI: boolean): void;
161
- createBackgroundUiContext(): ExtensionUIContext;
162
170
  setEditorComponent(factory: ((tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => CustomEditor) | undefined): void;
163
- handleBackgroundEvent(event: AgentSessionEvent): Promise<void>;
171
+ present(content: Component | readonly Component[]): void;
172
+ resetTranscript(): void;
164
173
  showStatus(message: string, options?: {
165
174
  dim?: boolean;
166
175
  }): void;
@@ -208,6 +217,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
208
217
  handleToolsCommand(): void;
209
218
  handleContextCommand(): void;
210
219
  handleClearCommand(): Promise<void>;
220
+ handleFreshCommand(): Promise<void>;
211
221
  handleDropCommand(): Promise<void>;
212
222
  handleForkCommand(): Promise<void>;
213
223
  handleMoveCommand(targetPath: string): Promise<void>;
@@ -246,9 +256,9 @@ export declare class InteractiveMode implements InteractiveModeContext {
246
256
  handleCtrlD(): void;
247
257
  handleCtrlZ(): void;
248
258
  handleDequeue(): void;
249
- handleBackgroundCommand(): void;
250
259
  handleImagePaste(): Promise<boolean>;
251
260
  handleBtwCommand(question: string): Promise<void>;
261
+ handleTanCommand(work: string): Promise<void>;
252
262
  hasActiveBtw(): boolean;
253
263
  handleBtwEscape(): boolean;
254
264
  handleOmfgCommand(complaint: string): Promise<void>;
@@ -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" | "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.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.agents" | "icon.cache" | "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" | "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.editing" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers";
9
+ export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "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.agents" | "icon.cache" | "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" | "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.editing" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers";
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 */
@@ -8,7 +8,7 @@ import type { ExtensionUIContext, ExtensionUIDialogOptions, ExtensionUISelectIte
8
8
  import type { CompactOptions } from "../extensibility/extensions/types";
9
9
  import type { MCPManager } from "../mcp";
10
10
  import type { PlanApprovalDetails } from "../plan-mode/approved-plan";
11
- import type { AgentSession, AgentSessionEvent } from "../session/agent-session";
11
+ import type { AgentSession } from "../session/agent-session";
12
12
  import type { HistoryStorage } from "../session/history-storage";
13
13
  import type { SessionContext, SessionManager } from "../session/session-manager";
14
14
  import type { ShakeMode } from "../session/shake-types";
@@ -51,6 +51,7 @@ export type TodoPhase = {
51
51
  };
52
52
  export interface InteractiveModeInitOptions {
53
53
  suppressWelcomeIntro?: boolean;
54
+ clearInitialTerminalHistory?: boolean;
54
55
  }
55
56
  export type InteractiveSelectorDialogOptions = ExtensionUIDialogOptions & Pick<HookSelectorOptions, "disabledIndices">;
56
57
  export interface InteractiveModeContext {
@@ -76,7 +77,6 @@ export interface InteractiveModeContext {
76
77
  mcpManager?: MCPManager;
77
78
  lspServers?: LspStartupServerInfo[];
78
79
  isInitialized: boolean;
79
- isBackgrounded: boolean;
80
80
  isBashMode: boolean;
81
81
  toolOutputExpanded: boolean;
82
82
  todoExpanded: boolean;
@@ -126,9 +126,21 @@ export interface InteractiveModeContext {
126
126
  checkShutdownRequested(): Promise<void>;
127
127
  setToolUIContext(uiContext: ExtensionUIContext, hasUI: boolean): void;
128
128
  initializeHookRunner(uiContext: ExtensionUIContext, hasUI: boolean): void;
129
- createBackgroundUiContext(): ExtensionUIContext;
130
129
  setEditorComponent(factory: ((tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => CustomEditor) | undefined): void;
131
- handleBackgroundEvent(event: AgentSessionEvent): Promise<void>;
130
+ /**
131
+ * Mount transcript content and repaint once. The single sink for "show this in
132
+ * chat": producers build and return a `Component` (or a `ChatBlock` carrying
133
+ * its own lifecycle) and hand it here instead of touching `chatContainer` /
134
+ * `ui.requestRender()` directly. `ChatBlock`s are mounted (their `onMount`
135
+ * runs) so their timers/subscriptions start.
136
+ */
137
+ present(content: Component | readonly Component[]): void;
138
+ /**
139
+ * Dispose every live block in the transcript (stopping timers/subscriptions)
140
+ * and clear it. Used before a full rebuild so animated/streaming blocks do not
141
+ * leak.
142
+ */
143
+ resetTranscript(): void;
132
144
  showStatus(message: string, options?: {
133
145
  dim?: boolean;
134
146
  }): void;
@@ -208,6 +220,7 @@ export interface InteractiveModeContext {
208
220
  handleDumpCommand(): void;
209
221
  handleDebugTranscriptCommand(): Promise<void>;
210
222
  handleClearCommand(): Promise<void>;
223
+ handleFreshCommand(): Promise<void>;
211
224
  handleDropCommand(): Promise<void>;
212
225
  handleForkCommand(): Promise<void>;
213
226
  handleBashCommand(command: string, excludeFromContext?: boolean): Promise<void>;
@@ -248,9 +261,9 @@ export interface InteractiveModeContext {
248
261
  handleCtrlD(): void;
249
262
  handleCtrlZ(): void;
250
263
  handleDequeue(): void;
251
- handleBackgroundCommand(): void;
252
264
  handleImagePaste(): Promise<boolean>;
253
265
  handleBtwCommand(question: string): Promise<void>;
266
+ handleTanCommand(work: string): Promise<void>;
254
267
  hasActiveBtw(): boolean;
255
268
  handleBtwEscape(): boolean;
256
269
  handleOmfgCommand(complaint: string): Promise<void>;
@@ -6,6 +6,17 @@ export interface CodeBlock {
6
6
  /** Block body with the trailing newline stripped. */
7
7
  code: string;
8
8
  }
9
+ /** A blockquote block: a maximal run of `>`-prefixed lines from markdown. */
10
+ export interface QuoteBlock {
11
+ /** Block body with each line's `>` marker (and one optional space) removed. */
12
+ text: string;
13
+ }
14
+ /** A drillable block within an assistant message, in document order. */
15
+ export type MessageBlock = ({
16
+ kind: "code";
17
+ } & CodeBlock) | ({
18
+ kind: "quote";
19
+ } & QuoteBlock);
9
20
  /** A runnable command found in the transcript. */
10
21
  export interface LastCommand {
11
22
  kind: "bash" | "eval";
@@ -19,7 +30,7 @@ export interface LastCommand {
19
30
  * `children` to drill into.
20
31
  */
21
32
  export interface CopyTarget {
22
- /** Stable identifier (e.g. "msg:1", "msg:1:code:0", "msg:1:all", "cmd:1"). */
33
+ /** Stable id (e.g. "msg:1", "msg:1:code:0", "msg:1:quote:0", "msg:1:all", "cmd:1"). */
23
34
  id: string;
24
35
  label: string;
25
36
  /** Dim annotation: line/block counts, language, or tool name. */
@@ -40,8 +51,17 @@ export interface CopySource {
40
51
  readonly messages: readonly AgentMessage[];
41
52
  getLastVisibleHandoffText(): string | undefined;
42
53
  }
54
+ /**
55
+ * Split assistant markdown into drillable blocks — fenced code and `>`-quoted
56
+ * runs — in document order. Fences mask their bodies, so a `>` line inside a
57
+ * code block is never mistaken for a quote. An unclosed fence is treated as
58
+ * ordinary text, matching the fenced-block grammar.
59
+ */
60
+ export declare function extractBlocks(text: string): MessageBlock[];
43
61
  /** Extract fenced code blocks from assistant markdown, in document order. */
44
62
  export declare function extractCodeBlocks(text: string): CodeBlock[];
63
+ /** Extract `>`-quoted blocks from assistant markdown, in document order. */
64
+ export declare function extractQuoteBlocks(text: string): QuoteBlock[];
45
65
  /** Walk the transcript backwards for the most recent bash command or eval code. */
46
66
  export declare function extractLastCommand(messages: readonly AgentMessage[]): LastCommand | undefined;
47
67
  /**
@@ -1,9 +1,10 @@
1
1
  /** Shape forwarded from the plan-mode resolve handler to InteractiveMode's
2
2
  * approval popup. Populated by the standing handler that the resolve tool
3
- * dispatches to when the agent submits `resolve { action: "apply" }`. */
3
+ * dispatches to when the agent submits `resolve { action: "apply" }`.
4
+ * `planFilePath` is the agent-chosen `local://<slug>-plan.md` artifact — it is
5
+ * never renamed on approval, so links to it stay valid for the session. */
4
6
  export interface PlanApprovalDetails {
5
7
  planFilePath: string;
6
- finalPlanFilePath: string;
7
8
  title: string;
8
9
  planExists: boolean;
9
10
  }
@@ -39,11 +40,29 @@ export declare function resolvePlanTitle(input: {
39
40
  * Replaces `-`/`_` separators with spaces and capitalizes the first letter.
40
41
  * Returns an empty string when the input collapses to whitespace. */
41
42
  export declare function humanizePlanTitle(title: string): string;
42
- interface RenameApprovedPlanFileOptions {
43
+ /** The `local://` URL a plan slug maps to. The agent writes the plan here and
44
+ * passes the slug to `resolve`; the file is never renamed, so this URL — and
45
+ * any hyperlink to it — stays valid for the life of the session. */
46
+ export declare function planFileUrlForSlug(slug: string): string;
47
+ export interface ResolveApprovedPlanInput {
48
+ /** The agent's `extra.title` from the `resolve` call, if any. */
49
+ suppliedTitle?: unknown;
50
+ /** The plan path recorded in plan-mode state (the entry default or a prior plan). */
51
+ statePlanFilePath: string;
52
+ /** Read a plan `local://` URL, returning null when the file does not exist. */
53
+ readPlan: (planUrl: string) => Promise<string | null>;
54
+ /** Optional fallback: list candidate plan `local://` URLs (newest first) so a
55
+ * plan whose name can't be reconstructed (e.g. a dropped `extra.title`) is
56
+ * still found. */
57
+ listPlanFiles?: () => Promise<string[]>;
58
+ }
59
+ export interface ResolvedApprovedPlan {
43
60
  planFilePath: string;
44
- finalPlanFilePath: string;
45
- getArtifactsDir: () => string | null;
46
- getSessionId: () => string | null;
61
+ planContent: string;
62
+ title: string;
47
63
  }
48
- export declare function renameApprovedPlanFile(options: RenameApprovedPlanFileOptions): Promise<void>;
49
- export {};
64
+ /** Locate the plan file the agent wrote and finalize its title — without
65
+ * renaming anything. Tries, in order: the slug derived from `extra.title`
66
+ * (`local://<slug>-plan.md`), the plan path from plan-mode state, then a scan
67
+ * of recent plan files. Throws a `ToolError` guiding the agent when none exist. */
68
+ export declare function resolveApprovedPlan(input: ResolveApprovedPlanInput): Promise<ResolvedApprovedPlan>;
@@ -3,10 +3,10 @@ import { type ProtectedToolContext } from "@oh-my-pi/pi-agent-core/compaction/to
3
3
  * Build a compaction protection matcher that keeps `read` results for the active
4
4
  * plan file intact through prune/shake — the plan analog of skill-read
5
5
  * protection. Matches both the canonical `local://PLAN.md` alias and the
6
- * session's current plan reference path (e.g. a titled `local://<title>.md`), so
7
- * the plan survives compaction whether the agent reads it by alias or by title.
6
+ * session's current plan reference path (the agent-chosen `local://<slug>-plan.md`),
7
+ * so the plan survives compaction whether the agent reads it by alias or by name.
8
8
  *
9
- * `getPlanReferencePath` is evaluated at match time so a mid-session retitle
10
- * (plan approval renames `PLAN.md` → `<title>.md`) is honored immediately.
9
+ * `getPlanReferencePath` is evaluated at match time so the plan path set on
10
+ * approval is honored immediately.
11
11
  */
12
12
  export declare function createPlanReadMatcher(getPlanReferencePath: () => string): (context: ProtectedToolContext) => boolean;
@@ -51,6 +51,8 @@ export interface CreateAgentSessionOptions {
51
51
  /** Optional provider-facing session identifier for prompt caches and sticky auth selection.
52
52
  * Keeps persisted session files isolated while reusing provider-side caches. */
53
53
  providerSessionId?: string;
54
+ /** Optional provider-facing prompt cache key, distinct from request lineage. */
55
+ providerPromptCacheKey?: string;
54
56
  /** Custom tools to register (in addition to built-in tools). Accepts both CustomTool and ToolDefinition. */
55
57
  customTools?: (CustomTool | ToolDefinition)[];
56
58
  /** Inline extensions (merged with discovery). */
@@ -294,6 +294,11 @@ export interface SessionStats {
294
294
  premiumRequests: number;
295
295
  cost: number;
296
296
  }
297
+ export interface FreshSessionResult {
298
+ previousSessionId: string;
299
+ sessionId: string;
300
+ closedProviderSessions: number;
301
+ }
297
302
  export declare const ANTHROPIC_TOOL_CALL_BATCH_CAP = 4;
298
303
  export declare function resolveToolCallBatchCapForModel(model: Model | undefined): number | undefined;
299
304
  export declare class AgentSession {
@@ -308,6 +313,8 @@ export declare class AgentSession {
308
313
  constructor(config: AgentSessionConfig);
309
314
  /** Model registry for API key resolution and model discovery */
310
315
  get modelRegistry(): ModelRegistry;
316
+ get asyncJobManager(): AsyncJobManager | undefined;
317
+ getAgentId(): string | undefined;
311
318
  /** Advance the tool-choice queue and return the next directive for the upcoming LLM call. */
312
319
  nextToolChoice(): ToolChoice | undefined;
313
320
  /**
@@ -378,6 +385,7 @@ export declare class AgentSession {
378
385
  * Call this when completely done with the session.
379
386
  */
380
387
  dispose(): Promise<void>;
388
+ freshSession(): FreshSessionResult | undefined;
381
389
  /** Full agent state */
382
390
  get state(): AgentState;
383
391
  /** Current model (may be undefined if not yet selected) */
@@ -609,9 +617,22 @@ export declare class AgentSession {
609
617
  setTodoPhases(phases: TodoPhase[]): void;
610
618
  /**
611
619
  * Abort current operation and wait for agent to become idle.
620
+ *
621
+ * `reason` (e.g. `USER_INTERRUPT_LABEL`) rides the agent's `AbortController`
622
+ * and surfaces verbatim on the aborted assistant message's `errorMessage`, so
623
+ * the transcript can distinguish a deliberate user interrupt from an opaque
624
+ * abort. Omit it for internal/lifecycle aborts.
612
625
  */
613
626
  abort(options?: {
614
627
  goalReason?: "interrupted" | "internal";
628
+ reason?: string;
629
+ }): Promise<void>;
630
+ /**
631
+ * Abort active work, then immediately resume the agent so queued steer/follow-up
632
+ * messages drain instead of waiting for another natural turn boundary.
633
+ */
634
+ interruptAndFlushQueuedMessages(options?: {
635
+ reason?: string;
615
636
  }): Promise<void>;
616
637
  /**
617
638
  * Start a new session, optionally with initial messages and parent tracking.
@@ -40,6 +40,18 @@ export declare const SILENT_ABORT_MARKER = "__omp.silent_abort__";
40
40
  * than string-comparing inline so refactors to the marker constant (e.g.,
41
41
  * namespacing changes) propagate through every consumer in lockstep. */
42
42
  export declare function isSilentAbort(errorMessage: string | undefined): boolean;
43
+ /** Reason threaded through `AbortController.abort(reason)` when the user aborts
44
+ * the turn with Esc (see `AgentSession.abort`). The agent surfaces it verbatim
45
+ * on the aborted assistant message's `errorMessage`, so the transcript reads as
46
+ * a deliberate user interrupt instead of an opaque failure. */
47
+ export declare const USER_INTERRUPT_LABEL = "Interrupted by user";
48
+ /** Resolve the operator-facing label for an aborted assistant turn. A custom
49
+ * abort reason (e.g. `USER_INTERRUPT_LABEL`) threaded onto `errorMessage` is
50
+ * shown verbatim; aborts with no threaded reason fall back to the retry-aware
51
+ * generic label. Centralizes the live-stream (`EventController`), replay
52
+ * (`ui-helpers`), and component (`AssistantMessageComponent`) render paths so
53
+ * they stay in lockstep. */
54
+ export declare function resolveAbortLabel(errorMessage: string | undefined, retryAttempt?: number): string;
43
55
  /** Extract the optional `__pendingDisplayTag` field from a CustomMessage's
44
56
  * `details` blob. Safe over `unknown`; returns undefined when the field is
45
57
  * absent or non-string. */
@@ -565,7 +565,9 @@ export declare class SessionManager {
565
565
  * Fork a session into the current project directory.
566
566
  * Copies history from another session file while creating a new session file in the current sessionDir.
567
567
  */
568
- static forkFrom(sourcePath: string, cwd: string, sessionDir?: string, storage?: SessionStorage): Promise<SessionManager>;
568
+ static forkFrom(sourcePath: string, cwd: string, sessionDir?: string, storage?: SessionStorage, options?: {
569
+ suppressBreadcrumb?: boolean;
570
+ }): Promise<SessionManager>;
569
571
  /**
570
572
  * Open a specific session file.
571
573
  * @param path Path to session file
@@ -69,15 +69,13 @@ export interface SlashCommandRuntime {
69
69
  }
70
70
  /**
71
71
  * Runtime visible to TUI-only handlers (`handleTui`). Carries the interactive
72
- * mode context plus the background-detach hook. Intentionally narrower than
73
- * `SlashCommandRuntime` so existing callers can keep building it from just
74
- * `{ ctx, handleBackgroundCommand }`; when the TUI dispatcher needs to invoke
75
- * a `handle` (no `handleTui` override), it synthesizes a `SlashCommandRuntime`
76
- * from `ctx`.
72
+ * mode context. Intentionally narrower than `SlashCommandRuntime` so existing
73
+ * callers can keep building it from just `{ ctx }`; when the TUI dispatcher
74
+ * needs to invoke a `handle` (no `handleTui` override), it synthesizes a
75
+ * `SlashCommandRuntime` from `ctx`.
77
76
  */
78
77
  export interface TuiSlashCommandRuntime {
79
78
  ctx: InteractiveModeContext;
80
- handleBackgroundCommand: () => void;
81
79
  }
82
80
  /** Unified slash-command spec consumed by both TUI and ACP dispatchers. */
83
81
  export interface SlashCommandSpec extends BuiltinSlashCommand {
@@ -7,6 +7,8 @@ import type { AgentTelemetryConfig, ThinkingLevel } from "@oh-my-pi/pi-agent-cor
7
7
  import { ModelRegistry } from "../config/model-registry";
8
8
  import type { PromptTemplate } from "../config/prompt-templates";
9
9
  import { Settings } from "../config/settings";
10
+ import { type SettingPath } from "../config/settings-schema";
11
+ import type { CustomTool } from "../extensibility/custom-tools/types";
10
12
  import { type Skill } from "../extensibility/skills";
11
13
  import type { HindsightSessionState } from "../hindsight/state";
12
14
  import type { LocalProtocolOptions } from "../internal-urls";
@@ -121,6 +123,11 @@ interface FinalizeSubprocessOutputResult {
121
123
  export declare const SUBAGENT_WARNING_NULL_YIELD = "SYSTEM WARNING: Subagent called yield with null data.";
122
124
  export declare const SUBAGENT_WARNING_MISSING_YIELD = "SYSTEM WARNING: Subagent exited without calling yield tool after 3 reminders.";
123
125
  export declare function finalizeSubprocessOutput(args: FinalizeSubprocessOutputArgs): FinalizeSubprocessOutputResult;
126
+ /**
127
+ * Create proxy tools that reuse the parent's MCP connections.
128
+ */
129
+ export declare function createMCPProxyTools(mcpManager: MCPManager): CustomTool[];
130
+ export declare function createSubagentSettings(baseSettings: Settings, overrides?: Partial<Record<SettingPath, unknown>>): Settings;
124
131
  /**
125
132
  * Run a single agent in-process.
126
133
  */
@@ -29,6 +29,7 @@ export declare class TaskTool implements AgentTool<TaskToolSchemaInstance, TaskT
29
29
  readonly strict = true;
30
30
  readonly loadMode = "discoverable";
31
31
  readonly renderResult: typeof renderResult;
32
+ readonly mergeCallAndResult = true;
32
33
  get parameters(): TaskToolSchemaInstance;
33
34
  renderCall(args: unknown, options: Parameters<typeof renderTaskCall>[1], theme: Theme): import("@oh-my-pi/pi-tui").Component;
34
35
  /** Dynamic description that reflects current disabled-agent settings */
@@ -1,6 +1,6 @@
1
1
  import type { Component } from "@oh-my-pi/pi-tui";
2
2
  import type { RenderResultOptions } from "../extensibility/custom-tools/types";
3
- import type { Theme } from "../modes/theme/theme";
3
+ import { type Theme } from "../modes/theme/theme";
4
4
  import type { TaskParams, TaskToolDetails } from "./types";
5
5
  /**
6
6
  * Render the tool call arguments.
@@ -19,8 +19,9 @@ export declare function renderResult(result: {
19
19
  text?: string;
20
20
  }>;
21
21
  details?: TaskToolDetails;
22
- }, options: RenderResultOptions, theme: Theme): Component;
22
+ }, options: RenderResultOptions, theme: Theme, args?: TaskParams): Component;
23
23
  export declare const taskToolRenderer: {
24
24
  renderCall: typeof renderCall;
25
25
  renderResult: typeof renderResult;
26
+ mergeCallAndResult: boolean;
26
27
  };
@@ -31,6 +31,8 @@ type EntryStorage = TarStorage | ZipStorage;
31
31
  interface ArchiveIndexEntry extends ArchiveNode {
32
32
  storage?: EntryStorage;
33
33
  }
34
+ export declare function formatArchiveEntryLines(entries: readonly ArchiveDirectoryEntry[]): string[];
35
+ export declare function sniffArchiveFormat(bytes: Uint8Array): ArchiveFormat | undefined;
34
36
  export declare function parseArchivePathCandidates(filePath: string): ArchivePathCandidate[];
35
37
  export declare class ArchiveReader {
36
38
  #private;
@@ -41,4 +43,7 @@ export declare class ArchiveReader {
41
43
  readFile(subPath: string): Promise<ExtractedArchiveFile>;
42
44
  }
43
45
  export declare function openArchive(filePath: string): Promise<ArchiveReader>;
46
+ export declare function listArchiveRoot(bytes: Uint8Array, format: ArchiveFormat, opts?: {
47
+ limit?: number;
48
+ }): Promise<string>;
44
49
  export {};
@@ -34,6 +34,9 @@ export interface AstEditToolDetails {
34
34
  /** Absolute base directory used during the edit. Used by the renderer to resolve
35
35
  * display-relative paths to absolute paths for OSC 8 hyperlinks. */
36
36
  searchPath?: string;
37
+ /** Session cwd at edit time. Display header paths are cwd-relative, so the
38
+ * renderer resolves them against this; `searchPath` is the scope target. */
39
+ cwd?: string;
37
40
  }
38
41
  export declare class AstEditTool implements AgentTool<typeof astEditSchema, AstEditToolDetails> {
39
42
  private readonly session;
@@ -31,6 +31,9 @@ export interface AstGrepToolDetails {
31
31
  /** Absolute base directory used during search. Used by the renderer to resolve
32
32
  * display-relative paths to absolute paths for OSC 8 hyperlinks. */
33
33
  searchPath?: string;
34
+ /** Session cwd at search time. Display header/match paths are cwd-relative, so
35
+ * the renderer resolves them against this; `searchPath` is the scope target. */
36
+ cwd?: string;
34
37
  }
35
38
  export declare class AstGrepTool implements AgentTool<typeof astGrepSchema, AstGrepToolDetails> {
36
39
  private readonly session;
@@ -99,6 +99,7 @@ export interface ShellRendererConfig<TArgs> {
99
99
  resolveCommand?: (args: TArgs | undefined) => string | undefined;
100
100
  resolveCwd?: (args: TArgs | undefined) => string | undefined;
101
101
  resolveEnv?: (args: TArgs | undefined) => Record<string, string> | undefined;
102
+ showHeader?: boolean;
102
103
  }
103
104
  export declare function getBashEnvForDisplay(args: BashRenderArgs): Record<string, string> | undefined;
104
105
  /**