@oh-my-pi/pi-coding-agent 13.19.0 → 14.0.3

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 (205) hide show
  1. package/CHANGELOG.md +277 -2
  2. package/package.json +86 -20
  3. package/scripts/format-prompts.ts +2 -2
  4. package/src/autoresearch/apply-contract-to-state.ts +24 -0
  5. package/src/autoresearch/contract.ts +0 -44
  6. package/src/autoresearch/dashboard.ts +1 -2
  7. package/src/autoresearch/git.ts +91 -0
  8. package/src/autoresearch/helpers.ts +49 -0
  9. package/src/autoresearch/index.ts +28 -187
  10. package/src/autoresearch/prompt.md +26 -9
  11. package/src/autoresearch/state.ts +0 -6
  12. package/src/autoresearch/tools/init-experiment.ts +202 -117
  13. package/src/autoresearch/tools/log-experiment.ts +83 -125
  14. package/src/autoresearch/tools/run-experiment.ts +48 -10
  15. package/src/autoresearch/types.ts +2 -2
  16. package/src/capability/index.ts +4 -2
  17. package/src/cli/file-processor.ts +3 -3
  18. package/src/cli/grep-cli.ts +8 -8
  19. package/src/cli/grievances-cli.ts +78 -0
  20. package/src/cli/read-cli.ts +67 -0
  21. package/src/cli/setup-cli.ts +4 -4
  22. package/src/cli/update-cli.ts +3 -3
  23. package/src/cli.ts +2 -0
  24. package/src/commands/grep.ts +6 -1
  25. package/src/commands/grievances.ts +20 -0
  26. package/src/commands/read.ts +33 -0
  27. package/src/commit/agentic/agent.ts +5 -5
  28. package/src/commit/agentic/index.ts +3 -4
  29. package/src/commit/agentic/tools/analyze-file.ts +3 -3
  30. package/src/commit/agentic/validation.ts +1 -1
  31. package/src/commit/analysis/conventional.ts +4 -4
  32. package/src/commit/analysis/summary.ts +3 -3
  33. package/src/commit/changelog/generate.ts +4 -4
  34. package/src/commit/map-reduce/map-phase.ts +4 -4
  35. package/src/commit/map-reduce/reduce-phase.ts +4 -4
  36. package/src/commit/pipeline.ts +3 -4
  37. package/src/config/model-registry.ts +17 -3
  38. package/src/config/prompt-templates.ts +44 -226
  39. package/src/config/resolve-config-value.ts +4 -2
  40. package/src/config/settings-schema.ts +54 -2
  41. package/src/config/settings.ts +25 -26
  42. package/src/dap/client.ts +674 -0
  43. package/src/dap/config.ts +150 -0
  44. package/src/dap/defaults.json +211 -0
  45. package/src/dap/index.ts +4 -0
  46. package/src/dap/session.ts +1255 -0
  47. package/src/dap/types.ts +600 -0
  48. package/src/debug/log-viewer.ts +3 -2
  49. package/src/discovery/builtin.ts +1 -2
  50. package/src/discovery/codex.ts +2 -2
  51. package/src/discovery/github.ts +2 -1
  52. package/src/discovery/helpers.ts +2 -2
  53. package/src/discovery/opencode.ts +2 -2
  54. package/src/edit/diff.ts +818 -0
  55. package/src/edit/index.ts +309 -0
  56. package/src/edit/line-hash.ts +67 -0
  57. package/src/edit/modes/chunk.ts +454 -0
  58. package/src/{patch → edit/modes}/hashline.ts +741 -361
  59. package/src/{patch/applicator.ts → edit/modes/patch.ts} +420 -117
  60. package/src/{patch/fuzzy.ts → edit/modes/replace.ts} +519 -197
  61. package/src/{patch → edit}/normalize.ts +97 -76
  62. package/src/{patch/shared.ts → edit/renderer.ts} +181 -108
  63. package/src/exec/bash-executor.ts +4 -2
  64. package/src/exec/idle-timeout-watchdog.ts +126 -0
  65. package/src/exec/non-interactive-env.ts +5 -0
  66. package/src/extensibility/custom-commands/bundled/ci-green/index.ts +2 -2
  67. package/src/extensibility/custom-commands/bundled/review/index.ts +36 -15
  68. package/src/extensibility/custom-commands/loader.ts +1 -2
  69. package/src/extensibility/custom-tools/loader.ts +34 -11
  70. package/src/extensibility/extensions/loader.ts +9 -4
  71. package/src/extensibility/extensions/runner.ts +24 -1
  72. package/src/extensibility/extensions/types.ts +1 -1
  73. package/src/extensibility/hooks/loader.ts +5 -6
  74. package/src/extensibility/hooks/types.ts +1 -1
  75. package/src/extensibility/plugins/doctor.ts +2 -1
  76. package/src/extensibility/slash-commands.ts +3 -7
  77. package/src/index.ts +2 -1
  78. package/src/internal-urls/docs-index.generated.ts +11 -11
  79. package/src/ipy/executor.ts +58 -17
  80. package/src/ipy/gateway-coordinator.ts +6 -4
  81. package/src/ipy/kernel.ts +45 -22
  82. package/src/ipy/runtime.ts +2 -2
  83. package/src/lsp/client.ts +7 -4
  84. package/src/lsp/clients/lsp-linter-client.ts +4 -4
  85. package/src/lsp/config.ts +20 -4
  86. package/src/lsp/defaults.json +688 -154
  87. package/src/lsp/index.ts +234 -45
  88. package/src/lsp/lspmux.ts +2 -2
  89. package/src/lsp/startup-events.ts +13 -0
  90. package/src/lsp/types.ts +12 -1
  91. package/src/lsp/utils.ts +8 -1
  92. package/src/main.ts +102 -46
  93. package/src/memories/index.ts +4 -5
  94. package/src/modes/acp/acp-agent.ts +563 -163
  95. package/src/modes/acp/acp-event-mapper.ts +9 -1
  96. package/src/modes/acp/acp-mode.ts +4 -2
  97. package/src/modes/components/agent-dashboard.ts +3 -4
  98. package/src/modes/components/diff.ts +6 -7
  99. package/src/modes/components/read-tool-group.ts +6 -12
  100. package/src/modes/components/session-observer-overlay.ts +21 -12
  101. package/src/modes/components/settings-defs.ts +5 -0
  102. package/src/modes/components/tool-execution.ts +1 -1
  103. package/src/modes/components/welcome.ts +1 -1
  104. package/src/modes/controllers/btw-controller.ts +2 -2
  105. package/src/modes/controllers/command-controller.ts +3 -2
  106. package/src/modes/controllers/input-controller.ts +12 -8
  107. package/src/modes/index.ts +20 -2
  108. package/src/modes/interactive-mode.ts +94 -37
  109. package/src/modes/rpc/host-tools.ts +186 -0
  110. package/src/modes/rpc/rpc-client.ts +178 -13
  111. package/src/modes/rpc/rpc-mode.ts +73 -3
  112. package/src/modes/rpc/rpc-types.ts +53 -1
  113. package/src/modes/theme/theme.ts +80 -8
  114. package/src/modes/types.ts +2 -2
  115. package/src/prompts/review-request.md +6 -0
  116. package/src/prompts/system/system-prompt.md +2 -1
  117. package/src/prompts/tools/chunk-edit.md +223 -0
  118. package/src/prompts/tools/debug.md +43 -0
  119. package/src/prompts/tools/grep.md +3 -0
  120. package/src/prompts/tools/lsp.md +5 -5
  121. package/src/prompts/tools/read-chunk.md +17 -0
  122. package/src/prompts/tools/read.md +19 -5
  123. package/src/sdk.ts +190 -154
  124. package/src/secrets/obfuscator.ts +1 -1
  125. package/src/session/agent-session.ts +306 -256
  126. package/src/session/agent-storage.ts +12 -12
  127. package/src/session/compaction/branch-summarization.ts +3 -3
  128. package/src/session/compaction/compaction.ts +5 -6
  129. package/src/session/compaction/utils.ts +3 -3
  130. package/src/session/history-storage.ts +62 -19
  131. package/src/session/messages.ts +3 -3
  132. package/src/session/session-dump-format.ts +203 -0
  133. package/src/session/session-storage.ts +4 -2
  134. package/src/session/streaming-output.ts +1 -1
  135. package/src/session/tool-choice-queue.ts +213 -0
  136. package/src/slash-commands/builtin-registry.ts +56 -8
  137. package/src/ssh/connection-manager.ts +2 -2
  138. package/src/ssh/sshfs-mount.ts +5 -5
  139. package/src/stt/downloader.ts +4 -4
  140. package/src/stt/recorder.ts +4 -4
  141. package/src/stt/transcriber.ts +2 -2
  142. package/src/system-prompt.ts +21 -13
  143. package/src/task/agents.ts +5 -6
  144. package/src/task/commands.ts +2 -5
  145. package/src/task/executor.ts +4 -4
  146. package/src/task/index.ts +3 -4
  147. package/src/task/template.ts +2 -2
  148. package/src/task/worktree.ts +4 -4
  149. package/src/tools/ask.ts +2 -3
  150. package/src/tools/ast-edit.ts +7 -7
  151. package/src/tools/ast-grep.ts +7 -7
  152. package/src/tools/auto-generated-guard.ts +36 -41
  153. package/src/tools/await-tool.ts +2 -2
  154. package/src/tools/bash.ts +5 -23
  155. package/src/tools/browser.ts +4 -5
  156. package/src/tools/calculator.ts +2 -3
  157. package/src/tools/cancel-job.ts +2 -2
  158. package/src/tools/checkpoint.ts +3 -3
  159. package/src/tools/debug.ts +1007 -0
  160. package/src/tools/exit-plan-mode.ts +2 -3
  161. package/src/tools/fetch.ts +67 -3
  162. package/src/tools/find.ts +4 -5
  163. package/src/tools/fs-cache-invalidation.ts +5 -0
  164. package/src/tools/gemini-image.ts +13 -5
  165. package/src/tools/gh.ts +10 -11
  166. package/src/tools/grep.ts +57 -9
  167. package/src/tools/index.ts +44 -22
  168. package/src/tools/inspect-image.ts +4 -4
  169. package/src/tools/output-meta.ts +1 -1
  170. package/src/tools/python.ts +19 -6
  171. package/src/tools/read.ts +198 -67
  172. package/src/tools/render-mermaid.ts +2 -3
  173. package/src/tools/render-utils.ts +20 -6
  174. package/src/tools/renderers.ts +3 -1
  175. package/src/tools/report-tool-issue.ts +80 -0
  176. package/src/tools/resolve.ts +70 -39
  177. package/src/tools/search-tool-bm25.ts +2 -2
  178. package/src/tools/ssh.ts +2 -2
  179. package/src/tools/todo-write.ts +2 -2
  180. package/src/tools/tool-timeouts.ts +1 -0
  181. package/src/tools/write.ts +5 -6
  182. package/src/tui/tree-list.ts +3 -1
  183. package/src/utils/clipboard.ts +80 -0
  184. package/src/utils/commit-message-generator.ts +2 -3
  185. package/src/utils/edit-mode.ts +49 -0
  186. package/src/utils/file-display-mode.ts +6 -5
  187. package/src/utils/file-mentions.ts +8 -7
  188. package/src/utils/git.ts +4 -4
  189. package/src/utils/image-loading.ts +98 -0
  190. package/src/utils/title-generator.ts +2 -3
  191. package/src/utils/tools-manager.ts +6 -6
  192. package/src/web/scrapers/choosealicense.ts +1 -1
  193. package/src/web/search/index.ts +3 -3
  194. package/src/autoresearch/command-initialize.md +0 -34
  195. package/src/patch/diff.ts +0 -433
  196. package/src/patch/index.ts +0 -888
  197. package/src/patch/parser.ts +0 -532
  198. package/src/patch/types.ts +0 -292
  199. package/src/prompts/agents/oracle.md +0 -77
  200. package/src/tools/pending-action.ts +0 -49
  201. package/src/utils/child-process.ts +0 -88
  202. package/src/utils/frontmatter.ts +0 -117
  203. package/src/utils/image-input.ts +0 -274
  204. package/src/utils/mime.ts +0 -53
  205. package/src/utils/prompt-format.ts +0 -170
package/CHANGELOG.md CHANGED
@@ -2,7 +2,274 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [14.0.3] - 2026-04-09
6
+
7
+ ### Fixed
8
+
9
+ - Fixed cached Ollama discovery rows so upgraded installs switch to the OpenAI Responses transport instead of staying on the old completions transport
10
+
11
+ ## [14.0.2] - 2026-04-09
12
+ ### Added
13
+
14
+ - Added `/force` slash command to force the next agent turn to use a specific tool
15
+ - Added `ToolChoiceQueue` for managing tool-choice directives with lifecycle callbacks and requeue semantics
16
+ - Added `setForcedToolChoice()` method to AgentSession to programmatically force tool invocations
17
+ - Added `toolChoiceQueue` property to AgentSession for direct queue access
18
+ - Added `peekQueueInvoker()` method to AgentSession to retrieve in-flight tool invocation handlers
19
+ - Added `queueResolveHandler()` function as the canonical entry point for preview/apply workflows
20
+ - Added `buildToolChoice()` and `steer()` methods to ToolSession for tool-choice queue integration
21
+ - Added `getToolChoiceQueue()` method to ToolSession for accessing the tool-choice queue
22
+ - Added support for embedded URL selectors (`:raw` and `:L#-L#` line ranges) in read command paths
23
+ - Added `parseReadUrlTarget` function to parse and validate URL read targets with line range support
24
+ - Added `decl` region to chunk selector for targeting declarations without leading trivia
25
+ - Exported `hooks` subpath for extensibility API access
26
+ - Added `build` script for compiling binary artifacts
27
+
28
+ ### Changed
29
+
30
+ - Refactored pending action handling from `PendingActionStore` to `ToolChoiceQueue` with generator-based directives
31
+ - Changed tool-choice override mechanism from simple override to a queue-based system with callbacks
32
+ - Updated `ResolveTool` to dispatch to in-flight queue invokers instead of popping from a pending action store
33
+ - Updated custom tool loader to accept `pushPendingAction` callback instead of `PendingActionStore` instance
34
+ - Updated `AstEditTool` to use `queueResolveHandler()` for preview/apply semantics
35
+ - Changed eager-todo prelude to use the tool-choice queue instead of simple override
36
+ - Updated todo reminder suppression to check for user-forced directives via `consumeLastServedLabel()`
37
+ - Made model-specific edit mode defaults conditional on `PI_STRICT_EDIT_MODE` environment variable for greater flexibility in edit mode selection
38
+ - Updated slash command handlers to support returning remaining text as prompt input instead of consuming input entirely
39
+ - Enhanced slash command parser to recognize both whitespace and colon (`:`) as command argument separators
40
+ - Updated indentation guidance for chunk edit content to use single leading spaces per indent level instead of tabs
41
+ - Updated read CLI to delegate URL inputs through the read tool pipeline instead of treating them as local file paths
42
+ - Updated chunk edit documentation to clarify region semantics and emphasize using the narrowest region for edits
43
+ - Improved chunk selector guidance with visual diagram showing region boundaries
44
+ - Renamed `build:binary` script to `build`
45
+ - Refactored `check` script to include linting via Biome and type checking
46
+ - Added `check:types`, `lint`, `fmt`, and `fix` scripts for improved developer workflow
47
+ - Simplified TypeScript configuration by extending workspace-level config
48
+
49
+ ### Removed
50
+
51
+ - Removed `PendingActionStore` class and related pending-action module
52
+ - Removed `pendingActionStore` parameter from AgentSession config
53
+ - Removed `pendingActionStore` from ToolSession interface
54
+ - Removed `consumeNextToolChoiceOverride()` method from AgentSession (replaced by `nextToolChoice()`)
55
+
56
+ ### Fixed
57
+
58
+ - Fixed tool-choice queue cleanup on agent loop abort to prevent orphaned in-flight directives
59
+ - Fixed requeue semantics to preserve `onInvoked` and `onRejected` callbacks across multiple abort cycles
60
+
61
+ ## [14.0.1] - 2026-04-08
62
+
63
+ ### Changed
64
+
65
+ - Improved auto-generated file detection to gracefully handle ENOENT errors when peeking file content, preventing unnecessary abort failures
66
+ - Optimized context emission by skipping message cloning when no extensions have context handlers
67
+ - Improved message cloning resilience by falling back to shallow array clone when structured cloning fails due to non-cloneable objects
68
+ - Made `assertEditableFileContent` synchronous instead of async for improved performance in streaming edit checks
69
+ - Enhanced streaming edit abort detection to check for auto-generated files as soon as the file path is available, rather than waiting for the full diff
70
+ - Improved file prefix reading in session storage to use `peekFile` utility from @oh-my-pi/pi-utils for better efficiency
71
+ - Moved image metadata detection to @oh-my-pi/pi-utils package for shared use across projects
72
+ - Simplified image loading API by removing redundant metadata parameters and consolidating image utilities
73
+ - Updated imports to use readImageMetadata and parseImageMetadata from @oh-my-pi/pi-utils instead of local implementations
74
+
75
+ ### Removed
76
+
77
+ - Removed image-input.ts utility module; functionality consolidated into image-loading.ts
78
+ - Removed mime.ts utility module; MIME detection moved to @oh-my-pi/pi-utils
79
+ - Removed ImageMetadata interface and ReadImageMetadataOptions from local codebase
80
+
81
+ ### Fixed
82
+
83
+ - Fixed streaming edit abort for auto-generated files by adding LRU caching and early path-based detection to prevent unnecessary edits
84
+
85
+ ## [14.0.0] - 2026-04-08
86
+
87
+ ### Breaking Changes
88
+
89
+ - Simplified chunk edit operations: removed `append_child`, `prepend_child`, `append_sibling`, `prepend_sibling`, and `replace_body` ops in favor of unified `replace`, `before`, `after`, `prepend`, and `append` with region targeting (`@head`, `@body`, `@tail`)
90
+ - Chunk edit `target` format changed: now accepts `selector#CRC@region` for mutations and `selector@region` for insertions; removed separate `crc` and `anchor` fields from edit operations
91
+ - Removed checksum requirement from insert operations (`before`, `after`, `prepend`, `append`); only `replace` requires `#CRC` suffix
92
+
93
+ ### Added
94
+
95
+ - Auto QA tool (`report_tool_issue`) for automated tracking of unexpected tool behavior; enabled via `PI_AUTO_QA=1` environment variable or `dev.autoqa` setting
96
+ - `dev.autoqa` setting to enable automated tool issue reporting for all agents
97
+ - System prompt guidance when `report_tool_issue` tool is available, encouraging agents to report tool behavior discrepancies
98
+ - LSP server discovery at startup via `discoverStartupLspServers()` to detect configured language servers without blocking initialization
99
+ - LSP startup event channel (`lsp:startup`) for asynchronous server warmup notifications with completion or failure status
100
+ - `LspStartupServerInfo` type for tracking LSP server status including connecting, ready, and error states
101
+ - LSP server status display in `/info` command showing connecting, ready, and error states with color-coded indicators
102
+ - Multi-session support in ACP mode: agents can now manage multiple concurrent sessions with independent state, models, and configurations
103
+ - Session forking in ACP mode: `unstable_forkSession` creates a new session from an existing one's history
104
+ - Session resumption in ACP mode: `unstable_resumeSession` reloads a previously saved session
105
+ - Session closure in ACP mode: `unstable_closeSession` cleanly shuts down a session and releases resources
106
+ - Model state reporting in ACP mode: `SessionModelState` with available models and current selection in session responses
107
+ - Direct model setting in ACP mode: `unstable_setSessionModel` RPC command for changing the active model
108
+ - Turn-level usage tracking in ACP mode: prompt responses now include `usage` with input/output/cached token counts
109
+ - Message ID tracking in ACP mode: stable message IDs for assistant chunks enabling client-side message correlation
110
+ - Settings cloning: `Settings.cloneForCwd()` method to create isolated settings instances for different working directories
111
+ - Extension flag value retrieval: `ExtensionRunner.getFlagValues()` to inspect current flag state
112
+ - Exported autoresearch module and submodules via `./autoresearch` and `./autoresearch/*` package paths
113
+ - Exported autoresearch tools via `./autoresearch/tools/*` package path
114
+ - Exported CLI commands via `./cli/commands/*` package path
115
+ - Exported DAP module and submodules via `./dap` and `./dap/*` package paths
116
+ - Exported edit module and submodules via `./edit`, `./edit/*`, and `./edit/modes/*` package paths
117
+ - Exported bundled ci-green custom command via `./extensibility/custom-commands/bundled/ci-green` package path
118
+ - Exported extensibility plugins marketplace via `./extensibility/plugins/marketplace` and `./extensibility/plugins/marketplace/*` package paths
119
+ - Exported ACP mode via `./modes/acp` and `./modes/acp/*` package paths
120
+ - Exported web utilities via `./web/*` package path
121
+ - Exported line-hash utilities from edit module via `./edit/line-hash`
122
+ - Host-owned custom tools support: RPC clients can now register custom tools via `setCustomTools()` and the RPC server will invoke them over the transport with `host_tool_call` requests
123
+ - RPC host tool framework: `RpcHostToolBridge` for managing host tool execution, `RpcHostToolDefinition` for tool metadata, and bidirectional `host_tool_call`, `host_tool_cancel`, `host_tool_update`, and `host_tool_result` frames
124
+ - RPC client tool API: `defineRpcClientTool()` helper, `RpcClientCustomTool` interface, and `RpcClientToolContext` for implementing host-side tool execution with update streaming and abort support
125
+ - `set_host_tools` RPC command to replace the active set of host-owned tools before the next model call
126
+ - `refreshRpcHostTools()` method on `AgentSession` to integrate host tools into the active tool registry with conflict detection and auto-activation of non-hidden tools
127
+ - Instruction breakpoints support: `set_instruction_breakpoint` and `remove_instruction_breakpoint` debug actions for setting breakpoints at specific instruction addresses
128
+ - Data breakpoints support: `data_breakpoint_info`, `set_data_breakpoint`, and `remove_data_breakpoint` debug actions for monitoring variable/memory access
129
+ - Memory introspection: `read_memory` and `write_memory` debug actions for inspecting and modifying debugger memory
130
+ - Disassembly support: `disassemble` debug action for viewing assembly instructions with symbol resolution
131
+ - Module and source introspection: `modules` and `loaded_sources` debug actions for querying loaded modules and source files
132
+ - Custom DAP requests: `custom_request` debug action for sending arbitrary Debug Adapter Protocol commands
133
+ - Reverse request handling in DAP client: `onReverseRequest()` method for responding to adapter-initiated requests like `runInTerminal` and `startDebugging`
134
+ - DAP reverse request support: adapters can now request terminal spawning and child debug sessions via `runInTerminal` and `startDebugging` reverse requests
135
+ - Instruction pointer reference in debug snapshots: `instructionPointerReference` field in session summaries for low-level debugging
136
+ - Hit condition support for instruction and data breakpoints: `hit_condition` parameter for conditional breakpoint triggering
137
+ - RPC `set_todos` command and `todoPhases` in `get_state`, allowing hosts to pre-seed and inspect session todo state over the protocol
138
+ - Deferred diagnostics support in LSP writethrough: `onDeferredDiagnostics` callback and `deferredSignal` in `WritethroughOptions` allow callers to receive diagnostics that arrive after the main 5-second timeout
139
+ - Language detection for `.pm` (Perl modules), `.astro` (Astro framework), and special filenames `containerfile` and `justfile`
140
+ - Workspace-scoped diagnostics and reload actions via `*` file parameter; `diagnostics` action now supports `*` for workspace-wide diagnostics across all configured servers
141
+ - Socket-mode DAP adapter support for debuggers like dlv that communicate via network sockets instead of stdio; Linux uses unix domain sockets, macOS/other platforms use TCP with client-addr dialing
142
+ - Improved extensionless binary debugging: native debuggers (gdb, lldb-dap) and adapters with root markers are now preferred over unrelated adapters like debugpy
143
+ - Debug tool with DAP (Debug Adapter Protocol) support for launching and attaching debuggers, setting breakpoints, stepping through execution, inspecting threads/stack/variables, and evaluating expressions
144
+ - Debug adapter configuration for gdb, lldb-dap, debugpy, and dlv with language/file-type matching and root marker detection
145
+ - Debug session management with support for source and function breakpoints, conditional breakpoints, stack trace inspection, scope/variable exploration, and program output capture
146
+ - `debug.enabled` setting to control debug tool availability
147
+ - Chunk read formatting: `anchorStyle` (full / kind / bare), `read.anchorstyle` setting, and `chunked` flag on file display mode
148
+ - `read.prosechunks` and `read.explorechunks` settings for prose chunk trees and checksum-free explore trees
149
+ - Handlebars helpers `anchor` and `sel` (with template `anchorStyle` context) for chunk examples in prompts
150
+ - Chunk-mode grep lines as `path:selector>LINE|content`; unified grep tool template behind `IS_CHUNK_MODE`
151
+ - `lru-cache` for chunk tree caching
152
+ - Chunk-mode `read` output: recursive rendering with `$XXXX` checksum suffixes, inline large-chunk previews, and normalized `#path$XXXX` selectors between read and edit
153
+ - Autoresearch: `init_experiment` options `new_segment`, `from_autoresearch_md`, `abandon_unlogged_runs`; `log_experiment` options `skip_restore` and broader `force`; `run_experiment` `force` (with warnings); pre-run dirty-path tracking; `abandonUnloggedAutoresearchRuns` and `abandonedAt` on runs
154
+ - LSP: diagnostic versioning (`versionSupport`, stored document version per diagnostic set), and `waitForDiagnostics` / `getDiagnosticsForFile` options (`expectedDocumentVersion`, `allowUnversioned`)
155
+
156
+ ### Changed
157
+
158
+ - Extracted working directory formatting logic into `formatToolWorkingDirectory()` utility for consistent path display across tools
159
+ - Bash command rendering now sanitizes tabs and shortens home directory paths in command previews
160
+ - Chunk edit tool schema: renamed `target` parameter to `sel` for consistency with read tool terminology
161
+ - Chunk edit tool: `op` parameter is now required (previously optional with `replace` default)
162
+ - Chunk edit documentation: updated all region references from `@inner` to `@body` for clearer semantics
163
+ - Chunk edit documentation: expanded with comprehensive real-world examples showing full read output, operation effects, and indentation rules
164
+ - Chunk edit documentation: simplified indentation guidance to write content at indent-level 0 with automatic re-indentation by the tool
165
+ - Chunk edit documentation: clarified that `@region` only works on container chunks, not leaf chunks
166
+ - Chunk edit documentation: emphasized that CRCs change after every edit and must be refreshed from latest responses
167
+ - Read chunk tool documentation: updated selector examples to use `@body` instead of `@inner`
168
+ - Chunk edit region terminology updated: `@inner` renamed to `@body` for clearer semantics in container chunks
169
+ - Chunk edit documentation restructured with comprehensive examples showing full read output, operation effects, and indentation rules
170
+ - Chunk edit indentation guidance simplified: content should be written at indent-level 0 and the tool automatically applies correct base indentation
171
+ - Chunk edit examples expanded with realistic TypeScript code samples demonstrating replace, insert, prepend, append, and delete operations
172
+ - Python tool description now dynamically reflects prelude documentation availability instead of static text
173
+ - Python tool now automatically warms the environment on first execution if prelude helpers are unavailable, ensuring documentation is loaded before use
174
+ - Tool creation now auto-injects `report_tool_issue` when auto QA is enabled, regardless of requested tool list
175
+ - Chunk edit region names standardized to `@head`, `@body`, and `@tail` for clearer semantics
176
+ - Chunk edit documentation clarified: region defaults to full chunk when omitted; leaf chunks no longer support region targeting
177
+ - Chunk read documentation updated: selector examples now use region-specific selectors based on `@head`, `@body`, and `@tail`
178
+ - LSP server connecting status in welcome banner now uses muted pending symbol instead of warning symbol for clearer visual distinction
179
+ - Codex websocket prewarm now runs asynchronously in the background instead of blocking session creation, allowing faster startup
180
+ - Codex websocket status updates now display in interactive mode when prewarm completes or fails
181
+ - LSP server warmup now runs asynchronously in the background instead of blocking session creation, allowing faster startup
182
+ - LSP servers returned from `createAgentSession()` now include `connecting` status during initial warmup phase
183
+ - Interactive mode now subscribes to LSP startup events and displays status updates and error messages to the user
184
+ - LSP server status in `/info` command now distinguishes between connecting (yellow), ready (green), and error (red) states
185
+ - ACP agent now manages multiple sessions instead of a single session; session lifecycle and configuration are now per-session
186
+ - ACP session creation now uses a factory function to support creating new sessions for different working directories
187
+ - ACP event mapping now accepts optional `getMessageId` callback for stable message ID assignment to assistant chunks
188
+
189
+ ### Removed
190
+
191
+ - Deleted `src/utils/prompt-format.ts` module; prompt formatting logic moved to `pi-utils`
192
+ - Deleted `src/utils/frontmatter.ts` module; frontmatter parsing logic moved to `pi-utils`
193
+ - Removed `waitForChildProcess` utility (child process termination now handled by native `killTree` from pi-natives)
194
+ - `grep-chunk.md` (folded into unified grep template)
195
+ - `startMacAppearanceObserver` export (use `MacAppearanceObserver.start()`)
196
+ - `copyToClipboard` export from pi-natives
197
+ - `PI_CHUNK_SPLICES` env and `chunkSplicesEnabled()`
198
+ - Autoresearch `segmentFingerprint` and related config hashing
199
+
200
+ ### Fixed
201
+
202
+ - Chunk edit parameter validation: corrected detection of chunk edit operations to check for `sel` field instead of `target`
203
+ - Chunk edit streaming previews: updated to reference `sel` parameter instead of `target`
204
+ - Python prelude introspection now respects execution timeout and signal options, preventing hangs during environment warmup
205
+ - Welcome banner LSP server status now updates in real-time when background startup warmup completes, eliminating stale connecting status displays
206
+ - Welcome banner LSP startup rows now re-render when background warmup finishes, use the pending status symbol while servers are still connecting, and no longer add a redundant `LSP ready` status line on successful startup
207
+ - ACP session initialization now registers connection cleanup handlers to dispose all sessions on disconnect
208
+ - Reorganized package.json exports: moved `./edit` exports before `./plan-mode` for better logical grouping
209
+ - Notebook conversion logic now checks for raw read mode or non-chunk mode before converting via markit, allowing chunk-mode reads of `.ipynb` files to use chunk parsing instead of conversion
210
+ - Go receiver methods now render as top-level siblings instead of nested under their receiver type in chunk read output
211
+ - Moved prompt formatting and rendering utilities from `coding-agent` to `pi-utils` package; `renderPromptTemplate()` and `formatPromptContent()` now accessed via `prompt.render()` and `prompt.format()` from `@oh-my-pi/pi-utils`
212
+ - Moved `parseFrontmatter()` utility from `coding-agent` to `pi-utils` package; now imported from `@oh-my-pi/pi-utils` instead of local utils
213
+ - Consolidated prompt template handling: `TemplateContext` type now available as `prompt.TemplateContext` from `@oh-my-pi/pi-utils`
214
+ - DAP initialization now advertises support for `runInTerminal` and `startDebugging` reverse requests, and memory references
215
+ - Debug tool schema expanded with new parameters for instruction/data breakpoints, memory operations, and custom requests
216
+ - DAP session state now tracks instruction and data breakpoints separately from source breakpoints
217
+ - Replaced `Bun.which()` with `$which()` from pi-utils for command resolution
218
+ - Chunk edit tool documentation restructured: replaced operation-specific examples with region-based guidance and canonical indentation rules
219
+ - Chunk read documentation updated: selectors now support region syntax (e.g., `class_Foo.fn_bar#ABCD@body`) and canonical target listings show supported regions per chunk
220
+ - Chunk edit schema simplified: `target` description now documents region format; `op` and `content` descriptions clarified for region-aware operations
221
+ - Chunk edit streaming previews updated: labels now reflect region-aware operations (e.g., `append` instead of `append child`, `insert after` without anchor reference)
222
+ - Removed CRC parsing from `parseChunkSelector()` and `parseChunkReadPath()`: selectors no longer extract embedded checksums
223
+ - Chunk edit normalization simplified: no longer requires async checksum resolution or context-dependent operation mapping
224
+ - RPC mode now automatically disables session title generation by default; hosts can opt in with `PI_RPC_EMIT_TITLE=1` environment variable to receive title updates
225
+ - RPC mode now resets workflow-altering `todo.*`, `task.*`, and `async.*` settings to built-in defaults instead of inheriting user overrides
226
+ - RPC mode now disables automatic session title generation by default and suppresses `setTitle` extension UI requests unless hosts opt in with `PI_RPC_EMIT_TITLE=1`
227
+ - Reorganized edit tool implementation from `patch/` to `edit/` directory structure with dedicated mode subdirectories (`edit/modes/chunk.ts`, `edit/modes/hashline.ts`, `edit/modes/patch.ts`, `edit/modes/replace.ts`)
228
+ - Updated package.json exports to use `./edit` path instead of `./patch` for edit tool and related utilities
229
+ - Chunk edit tool documentation simplified: removed line-based edit examples, clarified `target` format with full path and CRC suffix, added guidance for `replace_body` operation to preserve declarations
230
+ - LSP diagnostics timeout reduced from 10 seconds to 5 seconds for faster feedback; slow diagnostics now fetch in background via deferred mechanism
231
+ - Diagnostics action error messaging clarified: requires `file` parameter or `*` for workspace scope; improved guidance in error responses
232
+ - Workspace symbols and reload actions now accept `*` to operate across all configured servers instead of requiring a file path
233
+ - DAP session initialization now subscribes to stop events before launching/attaching to avoid missing stopOnEntry events
234
+ - Stack frame fetching moved outside the event dispatch loop to prevent deadlocks and improve responsiveness
235
+ - Evaluate requests now default to the top stopped frame when frameId is not explicitly provided
236
+ - Eager todo enforcement now skips prompts ending with question marks or exclamation marks, treating them as queries or commands rather than statements requiring task planning
237
+ - Chunk read output now displays fully-qualified anchor paths (e.g., `[class_Worker.fn_run#CRC]`) instead of bare names, making targets unambiguous for edits
238
+ - Chunk edit tool documentation clarified: `target` must be the fully-qualified path with `#CRC` suffix; added guidance to run `read(path="file", sel="?")` for canonical target listings when anchor style is unclear
239
+ - Chunk read tool documentation updated: `sel` parameter now documents the `?` selector for canonical target listings, and clarifies that default output shows full paths
240
+ - Chunk edit schema and tool contract: explicit `op` (`replace`, `append`, `prepend`, `after`, `before`); use `replace` with empty `content` to remove a chunk (no separate `delete` op); sibling inserts use `anchor` instead of separate after/before target fields; insert ops omit CRC where appropriate, mutations require checksum on target
241
+ - Chunk path handling: parse selector and CRC separately, sanitize selectors (strip filename prefixes, uppercase checksums), accept embedded `#CRC` on targets, auto-accept stale CRC for later ops in the same batch on the same chunk
242
+ - Chunk UX: streaming and final edit previews show chunk edits next to hashline edits with op-specific labels; prompt docs shortened with rules table, `…` in examples, and helper-based path/anchor samples
243
+ - `log_experiment` only reverts files modified by the run; prompts and errors document that pre-existing dirty files are preserved; richer pending-run error context; `init_experiment` no-ops when the contract matches unless `new_segment`; secondary metrics informational only (no `force` for drift)
244
+ - Autoresearch: `log_experiment` reloads benchmark/scope/constraints from `autoresearch.md` after resolving a pending run; `/autoresearch` without `autoresearch.md` follows `/plan`-style toggle and message flow; setup moved into autoresearch system prompt (removed `command-initialize.md`)
245
+ - Native/shell alignment: `GrepOutputMode` from pi-natives; shell and `getDiagnosticsForFile` callbacks use error-first `(err, chunk)`; `getDiagnosticsForFile` takes an options object
246
+ - Clipboard: `copyToClipboard` / `readImageFromClipboard` live in `utils/clipboard.ts` (OSC 52 and Termux)
247
+ - macOS: session-wide power assertion while the agent runs; `MacAppearanceObserver.start()` with error-first callback; `detectMacOSAppearance()` returns enum values
248
+ - ACP session cleanup now properly cancels in-flight prompts and disposes resources when sessions are closed or connection aborts
249
+ - Removed unused `_createErrorToolResult` helper function from RPC host-tools module
250
+ - Fixed Go receiver method indentation in append operations to preserve relative indentation from the anchor chunk
251
+ - Fixed Go type chunk line counts to report only the type body lines instead of including grouped receiver methods
252
+ - Fixed enum variant insertion to avoid adding extra blank lines between variants
253
+ - Chunk read output now correctly preserves embedded CRC in selectors (e.g., `class_Foo.fn_bar#ZZPM`) instead of stripping them during path parsing
254
+ - Chunk edit error messages now consistently report checksum mismatches with format `Checksum mismatch` instead of variable phrasing
255
+ - Chunk-mode read output now correctly displays scoped response trees showing only touched chunks and adjacent siblings, preventing unrelated distant chunks from appearing in responses
256
+ - DAP stopped event handling no longer blocks the message reader, preventing potential deadlocks during rapid event sequences
257
+ - Chunk-mode whole-chunk replaces now preserve attached leading comments and docblocks when replacement content starts at the declaration, preventing accidental comment loss during agent edits
258
+ - Chunk edit error messages now consistently report checksum mismatches with the format `did not match checksum "XXXX"` instead of variable phrasing
259
+ - Chunk selector validation for edits now rejects non-canonical selectors (suffix-only like `fn_run` or prefix-stripped like `run`), requiring fully-qualified paths to prevent ambiguity
260
+ - Plan review previews now re-append at the chat tail on refresh, keeping them adjacent to the active selector instead of updating off-screen
261
+ - `log_experiment` validates and reverts run-scoped file changes without clobbering unrelated dirty worktree state
262
+ - Chunk edit targets that embed CRC in the selector (e.g. `fn_foo#ABCD`) parse correctly
263
+ - Shell paths check errors before consuming chunk output (bash executor, config resolution)
264
+ - `/autoresearch` toggles like `/plan` when empty; slash completion no longer suggests `off`/`clear` on an empty prefix after the command
265
+ - Chunk-mode read/edit edge cases (zero-width gap replaces, stale batch diagnostics, grouped Go receivers, line-count headers, parse error locations)
266
+
267
+ ### Added
268
+
269
+ - `/review` command now accepts inline args as custom instructions appended to the generated prompt for all structured review modes (PR-style, uncommitted, specific commit). When inline args are provided, option 4 (editor) is suppressed from the menu. The no-UI (Task tool) path forwards args as a focus hint.
270
+
5
271
  ## [13.19.0] - 2026-04-05
272
+
6
273
  ### Added
7
274
 
8
275
  - Added idle auto-compaction settings and scheduling so sessions can compact after inactive turns without auto-continuing.
@@ -50,6 +317,7 @@
50
317
  - Fixed the plan review selector to support the external editor shortcut for opening and updating the current plan from the approval screen
51
318
 
52
319
  ## [13.18.0] - 2026-04-02
320
+
53
321
  ### Breaking Changes
54
322
 
55
323
  - Removed standalone `fetch` tool; URL fetching is now integrated into the `read` tool
@@ -72,6 +340,7 @@
72
340
  - Fixed `read` tool to properly handle `file://` URL scheme by converting to filesystem paths
73
341
 
74
342
  ## [13.17.5] - 2026-04-01
343
+
75
344
  ### Added
76
345
 
77
346
  - Added support for writing to ZIP archives using fflate library for cross-platform compatibility
@@ -85,6 +354,7 @@
85
354
  - Removed GhPrPushTool test case
86
355
 
87
356
  ## [13.17.4] - 2026-04-01
357
+
88
358
  ### Added
89
359
 
90
360
  - Support for writing to archive entries in `.tar`, `.tar.gz`, `.tgz`, and `.zip` files using `archive.ext:path/inside/archive` syntax
@@ -109,6 +379,7 @@
109
379
  - Updated `read` tool documentation to reflect archive support and usage patterns
110
380
 
111
381
  ## [13.17.2] - 2026-04-01
382
+
112
383
  ### Added
113
384
 
114
385
  - Added `/marketplace help` command to display usage guide for all marketplace operations
@@ -164,6 +435,7 @@
164
435
  - Fixed inline image rendering to cap image height and preserve multiplexer scrollback during terminal resizes ([#587](https://github.com/can1357/oh-my-pi/pull/587) by [@smileynet](https://github.com/smileynet))
165
436
 
166
437
  ## [13.17.1] - 2026-04-01
438
+
167
439
  ### Removed
168
440
 
169
441
  - Removed `code_search` tool for code snippet and documentation search
@@ -173,6 +445,7 @@
173
445
  - Fixed edit tool diff rendering to wrap long diff lines with continuation gutters instead of truncating them at terminal width ([#578](https://github.com/can1357/oh-my-pi/issues/578))
174
446
  - Fixed `--list-models` and `/model` provider filtering to hide models from disabled providers ([#588](https://github.com/can1357/oh-my-pi/issues/588))
175
447
  - Fixed edit tool diffstats to use diff-specific add/remove theme colors instead of success/error status colors ([#589](https://github.com/can1357/oh-my-pi/issues/589))
448
+
176
449
  ## [13.17.0] - 2026-03-30
177
450
 
178
451
  ### Added
@@ -225,6 +498,7 @@
225
498
  - Fixed `--model provider/id` resolving to wrong provider when model ID exists in multiple catalogs ([#560](https://github.com/can1357/oh-my-pi/issues/560))
226
499
 
227
500
  ## [13.16.4] - 2026-03-28
501
+
228
502
  ### Changed
229
503
 
230
504
  - Renamed hashline helper functions from `hlineref`/`hlinefull` to `href`/`hline` for brevity
@@ -404,6 +678,7 @@
404
678
  ### Added
405
679
 
406
680
  - Session observer overlay (`Ctrl+S`): view running subagent sessions with a picker and read-only transcript showing thinking, text, tool calls, and results
681
+
407
682
  ## [13.14.0] - 2026-03-20
408
683
 
409
684
  ### Added
@@ -1680,7 +1955,7 @@
1680
1955
 
1681
1956
  - Changed custom UI hook cleanup to conditionally restore editor state only when not using overlay mode
1682
1957
  - Extracted environment variable configuration for non-interactive bash execution into reusable `NO_PAGER_ENV` constant
1683
- - Replaced custom timing instrumentation with logger.timeAsync() and logger.time() from pi-utils for consistent startup profiling
1958
+ - Replaced custom timing instrumentation with logger.time() and logger.time() from pi-utils for consistent startup profiling
1684
1959
  - Removed PI_DEBUG_STARTUP environment variable in favor of logger.debug() for conditional debug output
1685
1960
  - Consolidated timing calls throughout initialization pipeline to use unified logger-based timing system
1686
1961
 
@@ -6625,4 +6900,4 @@ Initial public release.
6625
6900
  - Git branch display in footer
6626
6901
  - Message queueing during streaming responses
6627
6902
  - OAuth integration for Gmail and Google Calendar access
6628
- - HTML export with syntax highlighting and collapsible sections
6903
+ - HTML export with syntax highlighting and collapsible sections
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-coding-agent",
4
- "version": "13.19.0",
4
+ "version": "14.0.3",
5
5
  "description": "Coding agent CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
7
  "author": "Can Boluk",
@@ -31,23 +31,27 @@
31
31
  "omp": "src/cli.ts"
32
32
  },
33
33
  "scripts": {
34
- "check": "tsgo -p tsconfig.json",
34
+ "build": "bun --cwd=../stats scripts/generate-client-bundle.ts --generate && bun --cwd=../natives run embed:native && bun build --compile --define PI_COMPILED=true --external mupdf --root ../.. ./src/cli.ts --outfile dist/omp && bun --cwd=../natives run embed:native --reset && bun --cwd=../stats scripts/generate-client-bundle.ts --reset",
35
+ "check": "biome check . && bun run check:types",
36
+ "check:types": "tsgo -p tsconfig.json --noEmit",
37
+ "lint": "biome lint .",
38
+ "test": "bun test",
39
+ "fix": "biome check --write --unsafe . && bun run format-prompts && bun run generate-docs-index",
40
+ "fmt": "biome format --write . && bun run format-prompts",
35
41
  "format-prompts": "bun scripts/format-prompts.ts",
36
42
  "generate-docs-index": "bun scripts/generate-docs-index.ts",
37
43
  "prepack": "bun scripts/generate-docs-index.ts",
38
- "build:binary": "cd ../.. && bun --cwd=packages/stats scripts/generate-client-bundle.ts && bun --cwd=packages/natives run embed:native && bun build --compile --define PI_COMPILED=true --external mupdf --root . ./packages/coding-agent/src/cli.ts --outfile packages/coding-agent/dist/omp && bun --cwd=packages/natives run embed:native --reset && bun --cwd=packages/stats scripts/generate-client-bundle.ts --reset",
39
- "generate-template": "bun scripts/generate-template.ts",
40
- "test": "bun test"
44
+ "generate-template": "bun scripts/generate-template.ts"
41
45
  },
42
46
  "dependencies": {
43
47
  "@agentclientprotocol/sdk": "0.16.1",
44
48
  "@mozilla/readability": "^0.6",
45
- "@oh-my-pi/omp-stats": "13.19.0",
46
- "@oh-my-pi/pi-agent-core": "13.19.0",
47
- "@oh-my-pi/pi-ai": "13.19.0",
48
- "@oh-my-pi/pi-natives": "13.19.0",
49
- "@oh-my-pi/pi-tui": "13.19.0",
50
- "@oh-my-pi/pi-utils": "13.19.0",
49
+ "@oh-my-pi/omp-stats": "14.0.3",
50
+ "@oh-my-pi/pi-agent-core": "14.0.3",
51
+ "@oh-my-pi/pi-ai": "14.0.3",
52
+ "@oh-my-pi/pi-natives": "14.0.3",
53
+ "@oh-my-pi/pi-tui": "14.0.3",
54
+ "@oh-my-pi/pi-utils": "14.0.3",
51
55
  "@sinclair/typebox": "^0.34",
52
56
  "@xterm/headless": "^6.0",
53
57
  "ajv": "^8.18",
@@ -56,6 +60,7 @@
56
60
  "fflate": "0.8.2",
57
61
  "handlebars": "^4.7",
58
62
  "linkedom": "^0.18",
63
+ "lru-cache": "11.3.1",
59
64
  "markit-ai": "0.5.0",
60
65
  "puppeteer": "^24.37",
61
66
  "zod": "4.3.6"
@@ -90,6 +95,18 @@
90
95
  "types": "./src/async/*.ts",
91
96
  "import": "./src/async/*.ts"
92
97
  },
98
+ "./autoresearch": {
99
+ "types": "./src/autoresearch/index.ts",
100
+ "import": "./src/autoresearch/index.ts"
101
+ },
102
+ "./autoresearch/*": {
103
+ "types": "./src/autoresearch/*.ts",
104
+ "import": "./src/autoresearch/*.ts"
105
+ },
106
+ "./autoresearch/tools/*": {
107
+ "types": "./src/autoresearch/tools/*.ts",
108
+ "import": "./src/autoresearch/tools/*.ts"
109
+ },
93
110
  "./capability": {
94
111
  "types": "./src/capability/index.ts",
95
112
  "import": "./src/capability/index.ts"
@@ -102,6 +119,10 @@
102
119
  "types": "./src/cli/*.ts",
103
120
  "import": "./src/cli/*.ts"
104
121
  },
122
+ "./cli/commands/*": {
123
+ "types": "./src/cli/commands/*.ts",
124
+ "import": "./src/cli/commands/*.ts"
125
+ },
105
126
  "./commands/*": {
106
127
  "types": "./src/commands/*.ts",
107
128
  "import": "./src/commands/*.ts"
@@ -166,6 +187,14 @@
166
187
  "types": "./src/config/*.ts",
167
188
  "import": "./src/config/*.ts"
168
189
  },
190
+ "./dap": {
191
+ "types": "./src/dap/index.ts",
192
+ "import": "./src/dap/index.ts"
193
+ },
194
+ "./dap/*": {
195
+ "types": "./src/dap/*.ts",
196
+ "import": "./src/dap/*.ts"
197
+ },
169
198
  "./debug": {
170
199
  "types": "./src/debug/index.ts",
171
200
  "import": "./src/debug/index.ts"
@@ -182,6 +211,18 @@
182
211
  "types": "./src/discovery/*.ts",
183
212
  "import": "./src/discovery/*.ts"
184
213
  },
214
+ "./edit": {
215
+ "types": "./src/edit/index.ts",
216
+ "import": "./src/edit/index.ts"
217
+ },
218
+ "./edit/*": {
219
+ "types": "./src/edit/*.ts",
220
+ "import": "./src/edit/*.ts"
221
+ },
222
+ "./edit/modes/*": {
223
+ "types": "./src/edit/modes/*.ts",
224
+ "import": "./src/edit/modes/*.ts"
225
+ },
185
226
  "./exa": {
186
227
  "types": "./src/exa/index.ts",
187
228
  "import": "./src/exa/index.ts"
@@ -218,6 +259,10 @@
218
259
  "types": "./src/extensibility/custom-commands/*.ts",
219
260
  "import": "./src/extensibility/custom-commands/*.ts"
220
261
  },
262
+ "./extensibility/custom-commands/bundled/ci-green": {
263
+ "types": "./src/extensibility/custom-commands/bundled/ci-green/index.ts",
264
+ "import": "./src/extensibility/custom-commands/bundled/ci-green/index.ts"
265
+ },
221
266
  "./extensibility/custom-commands/bundled/review": {
222
267
  "types": "./src/extensibility/custom-commands/bundled/review/index.ts",
223
268
  "import": "./src/extensibility/custom-commands/bundled/review/index.ts"
@@ -254,6 +299,14 @@
254
299
  "types": "./src/extensibility/plugins/*.ts",
255
300
  "import": "./src/extensibility/plugins/*.ts"
256
301
  },
302
+ "./extensibility/plugins/marketplace": {
303
+ "types": "./src/extensibility/plugins/marketplace/index.ts",
304
+ "import": "./src/extensibility/plugins/marketplace/index.ts"
305
+ },
306
+ "./extensibility/plugins/marketplace/*": {
307
+ "types": "./src/extensibility/plugins/marketplace/*.ts",
308
+ "import": "./src/extensibility/plugins/marketplace/*.ts"
309
+ },
257
310
  "./internal-urls": {
258
311
  "types": "./src/internal-urls/index.ts",
259
312
  "import": "./src/internal-urls/index.ts"
@@ -314,6 +367,14 @@
314
367
  "types": "./src/modes/*.ts",
315
368
  "import": "./src/modes/*.ts"
316
369
  },
370
+ "./modes/acp": {
371
+ "types": "./src/modes/acp/index.ts",
372
+ "import": "./src/modes/acp/index.ts"
373
+ },
374
+ "./modes/acp/*": {
375
+ "types": "./src/modes/acp/*.ts",
376
+ "import": "./src/modes/acp/*.ts"
377
+ },
317
378
  "./modes/components": {
318
379
  "types": "./src/modes/components/index.ts",
319
380
  "import": "./src/modes/components/index.ts"
@@ -358,14 +419,6 @@
358
419
  "types": "./src/modes/utils/*.ts",
359
420
  "import": "./src/modes/utils/*.ts"
360
421
  },
361
- "./patch": {
362
- "types": "./src/patch/index.ts",
363
- "import": "./src/patch/index.ts"
364
- },
365
- "./patch/*": {
366
- "types": "./src/patch/*.ts",
367
- "import": "./src/patch/*.ts"
368
- },
369
422
  "./plan-mode/*": {
370
423
  "types": "./src/plan-mode/*.ts",
371
424
  "import": "./src/plan-mode/*.ts"
@@ -435,6 +488,10 @@
435
488
  "types": "./src/utils/*.ts",
436
489
  "import": "./src/utils/*.ts"
437
490
  },
491
+ "./web/*": {
492
+ "types": "./src/web/*.ts",
493
+ "import": "./src/web/*.ts"
494
+ },
438
495
  "./web/scrapers": {
439
496
  "types": "./src/web/scrapers/index.ts",
440
497
  "import": "./src/web/scrapers/index.ts"
@@ -454,6 +511,15 @@
454
511
  "./web/search/providers/*": {
455
512
  "types": "./src/web/search/providers/*.ts",
456
513
  "import": "./src/web/search/providers/*.ts"
457
- }
514
+ },
515
+ "./hooks": {
516
+ "types": "./src/extensibility/hooks/index.ts",
517
+ "import": "./src/extensibility/hooks/index.ts"
518
+ },
519
+ "./hooks/*": {
520
+ "types": "./src/extensibility/hooks/*.ts",
521
+ "import": "./src/extensibility/hooks/*.ts"
522
+ },
523
+ "./*.js": "./src/*.ts"
458
524
  }
459
525
  }
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env bun
2
+ import { prompt } from "@oh-my-pi/pi-utils";
2
3
  /**
3
4
  * Format prompt files (mixed XML + Markdown + Handlebars).
4
5
  *
@@ -14,7 +15,6 @@
14
15
  * 9. Bold RFC 2119 keywords (MUST, SHOULD, MAY, etc.) in prompt content
15
16
  */
16
17
  import { Glob } from "bun";
17
- import { formatPromptContent } from "../src/utils/prompt-format";
18
18
 
19
19
  const PROMPTS_DIR = new URL("../src/prompts/", import.meta.url).pathname;
20
20
  const COMMIT_PROMPTS_DIR = new URL("../src/commit/prompts/", import.meta.url).pathname;
@@ -42,7 +42,7 @@ async function main() {
42
42
 
43
43
  for (const fullPath of files) {
44
44
  const original = await Bun.file(fullPath).text();
45
- const formatted = formatPromptContent(original, PROMPT_FORMAT_OPTIONS);
45
+ const formatted = prompt.format(original, PROMPT_FORMAT_OPTIONS);
46
46
 
47
47
  if (original !== `${formatted}\n`) {
48
48
  if (check) {
@@ -0,0 +1,24 @@
1
+ import { inferMetricUnitFromName } from "./helpers";
2
+ import type { AutoresearchContract, ExperimentState } from "./types";
3
+
4
+ /**
5
+ * Updates session fields from a validated `autoresearch.md` parse (same fields as `init_experiment`).
6
+ * Does not touch `name`, `currentSegment`, `results`, `bestMetric`, `confidence`, or `maxExperiments`.
7
+ */
8
+ export function applyAutoresearchContractToExperimentState(
9
+ contract: AutoresearchContract,
10
+ state: ExperimentState,
11
+ ): void {
12
+ const benchmarkContract = contract.benchmark;
13
+ state.metricName = benchmarkContract.primaryMetric ?? state.metricName;
14
+ state.metricUnit = benchmarkContract.metricUnit;
15
+ state.bestDirection = benchmarkContract.direction ?? "lower";
16
+ state.secondaryMetrics = benchmarkContract.secondaryMetrics.map(name => ({
17
+ name,
18
+ unit: inferMetricUnitFromName(name),
19
+ }));
20
+ state.benchmarkCommand = benchmarkContract.command?.trim() ?? state.benchmarkCommand;
21
+ state.scopePaths = [...contract.scopePaths];
22
+ state.offLimits = [...contract.offLimits];
23
+ state.constraints = [...contract.constraints];
24
+ }