@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
@@ -0,0 +1,600 @@
1
+ import type { ptree } from "@oh-my-pi/pi-utils";
2
+
3
+ export type DapMessage = DapRequestMessage | DapResponseMessage | DapEventMessage;
4
+ export type DapSessionStatus = "launching" | "configuring" | "stopped" | "running" | "terminated";
5
+
6
+ export interface DapProtocolMessage {
7
+ seq: number;
8
+ type: "request" | "response" | "event";
9
+ }
10
+
11
+ export interface DapRequestMessage extends DapProtocolMessage {
12
+ type: "request";
13
+ command: string;
14
+ arguments?: unknown;
15
+ }
16
+
17
+ export interface DapResponseMessage extends DapProtocolMessage {
18
+ type: "response";
19
+ request_seq: number;
20
+ success: boolean;
21
+ command: string;
22
+ message?: string;
23
+ body?: unknown;
24
+ }
25
+
26
+ export interface DapEventMessage extends DapProtocolMessage {
27
+ type: "event";
28
+ event: string;
29
+ body?: unknown;
30
+ }
31
+
32
+ export interface DapErrorBody {
33
+ id?: number;
34
+ format: string;
35
+ variables?: Record<string, string>;
36
+ showUser?: boolean;
37
+ sendTelemetry?: boolean;
38
+ url?: string;
39
+ urlLabel?: string;
40
+ }
41
+
42
+ export interface DapSource {
43
+ name?: string;
44
+ path?: string;
45
+ sourceReference?: number;
46
+ presentationHint?: "normal" | "emphasize" | "deemphasize";
47
+ origin?: string;
48
+ adapterData?: unknown;
49
+ }
50
+
51
+ export interface DapBreakpoint {
52
+ id?: number;
53
+ verified: boolean;
54
+ message?: string;
55
+ source?: DapSource;
56
+ line?: number;
57
+ column?: number;
58
+ endLine?: number;
59
+ endColumn?: number;
60
+ instructionReference?: string;
61
+ offset?: number;
62
+ }
63
+
64
+ export interface DapSourceBreakpoint {
65
+ line: number;
66
+ column?: number;
67
+ condition?: string;
68
+ hitCondition?: string;
69
+ logMessage?: string;
70
+ }
71
+
72
+ export interface DapFunctionBreakpoint {
73
+ name: string;
74
+ condition?: string;
75
+ hitCondition?: string;
76
+ }
77
+
78
+ export interface DapInitializeArguments {
79
+ clientID?: string;
80
+ clientName?: string;
81
+ adapterID?: string;
82
+ locale?: string;
83
+ linesStartAt1?: boolean;
84
+ columnsStartAt1?: boolean;
85
+ pathFormat?: "path" | "uri";
86
+ supportsVariableType?: boolean;
87
+ supportsVariablePaging?: boolean;
88
+ supportsRunInTerminalRequest?: boolean;
89
+ supportsStartDebuggingRequest?: boolean;
90
+ supportsMemoryReferences?: boolean;
91
+ supportsProgressReporting?: boolean;
92
+ supportsInvalidatedEvent?: boolean;
93
+ supportsArgsCanBeInterpretedByShell?: boolean;
94
+ }
95
+
96
+ export interface DapCapabilities {
97
+ supportsConfigurationDoneRequest?: boolean;
98
+ supportsFunctionBreakpoints?: boolean;
99
+ supportsConditionalBreakpoints?: boolean;
100
+ supportsTerminateRequest?: boolean;
101
+ supportsTerminateThreadsRequest?: boolean;
102
+ supportsEvaluateForHovers?: boolean;
103
+ supportsSetVariable?: boolean;
104
+ supportsRestartRequest?: boolean;
105
+ supportsCompletionsRequest?: boolean;
106
+ supportsLogPoints?: boolean;
107
+ supportsDisassembleRequest?: boolean;
108
+ supportsReadMemoryRequest?: boolean;
109
+ supportsWriteMemoryRequest?: boolean;
110
+ supportsModulesRequest?: boolean;
111
+ supportsLoadedSourcesRequest?: boolean;
112
+ supportsExceptionInfoRequest?: boolean;
113
+ supportsInstructionBreakpoints?: boolean;
114
+ supportsDataBreakpoints?: boolean;
115
+ supportsSteppingGranularity?: boolean;
116
+ supportsClipboardContext?: boolean;
117
+ [key: string]: unknown;
118
+ }
119
+
120
+ export interface DapLaunchArguments {
121
+ program: string;
122
+ args?: string[];
123
+ cwd?: string;
124
+ stopOnEntry?: boolean;
125
+ stopAtBeginningOfMainSubprogram?: boolean;
126
+ request?: "launch";
127
+ [key: string]: unknown;
128
+ }
129
+
130
+ export interface DapAttachArguments {
131
+ pid?: number;
132
+ processId?: number;
133
+ port?: number;
134
+ host?: string;
135
+ cwd?: string;
136
+ request?: "attach";
137
+ [key: string]: unknown;
138
+ }
139
+
140
+ export interface DapConfigurationDoneArguments {
141
+ threadId?: number;
142
+ }
143
+
144
+ export interface DapSetBreakpointsArguments {
145
+ source: DapSource;
146
+ breakpoints: DapSourceBreakpoint[];
147
+ sourceModified?: boolean;
148
+ }
149
+
150
+ export interface DapSetBreakpointsResponse {
151
+ breakpoints: DapBreakpoint[];
152
+ }
153
+
154
+ export interface DapSetFunctionBreakpointsArguments {
155
+ breakpoints: DapFunctionBreakpoint[];
156
+ }
157
+
158
+ export interface DapSetFunctionBreakpointsResponse {
159
+ breakpoints: DapBreakpoint[];
160
+ }
161
+
162
+ export interface DapInstructionBreakpoint {
163
+ instructionReference: string;
164
+ offset?: number;
165
+ condition?: string;
166
+ hitCondition?: string;
167
+ }
168
+
169
+ export interface DapSetInstructionBreakpointsArguments {
170
+ breakpoints: DapInstructionBreakpoint[];
171
+ }
172
+
173
+ export interface DapDataBreakpointInfoArguments {
174
+ variablesReference?: number;
175
+ name: string;
176
+ frameId?: number;
177
+ }
178
+
179
+ export interface DapDataBreakpointInfoResponse {
180
+ dataId: string | null;
181
+ description: string;
182
+ accessTypes?: Array<"read" | "write" | "readWrite">;
183
+ canPersist?: boolean;
184
+ }
185
+
186
+ export interface DapDataBreakpoint {
187
+ dataId: string;
188
+ accessType?: "read" | "write" | "readWrite";
189
+ condition?: string;
190
+ hitCondition?: string;
191
+ }
192
+
193
+ export interface DapSetDataBreakpointsArguments {
194
+ breakpoints: DapDataBreakpoint[];
195
+ }
196
+
197
+ export interface DapContinueArguments {
198
+ threadId: number;
199
+ singleThread?: boolean;
200
+ }
201
+
202
+ export interface DapContinueResponse {
203
+ allThreadsContinued?: boolean;
204
+ }
205
+
206
+ export interface DapPauseArguments {
207
+ threadId: number;
208
+ }
209
+
210
+ export interface DapStepArguments {
211
+ threadId: number;
212
+ singleThread?: boolean;
213
+ granularity?: "statement" | "line" | "instruction";
214
+ }
215
+
216
+ export interface DapTerminateArguments {
217
+ restart?: boolean;
218
+ }
219
+
220
+ export interface DapDisconnectArguments {
221
+ restart?: boolean;
222
+ terminateDebuggee?: boolean;
223
+ suspendDebuggee?: boolean;
224
+ }
225
+
226
+ export interface DapStackTraceArguments {
227
+ threadId: number;
228
+ startFrame?: number;
229
+ levels?: number;
230
+ format?: Record<string, unknown>;
231
+ }
232
+
233
+ export interface DapStackFrame {
234
+ id: number;
235
+ name: string;
236
+ source?: DapSource;
237
+ line: number;
238
+ column: number;
239
+ endLine?: number;
240
+ endColumn?: number;
241
+ instructionPointerReference?: string;
242
+ moduleId?: number | string;
243
+ presentationHint?: "normal" | "label" | "subtle";
244
+ }
245
+
246
+ export interface DapStackTraceResponse {
247
+ stackFrames: DapStackFrame[];
248
+ totalFrames?: number;
249
+ }
250
+
251
+ export interface DapScopesArguments {
252
+ frameId: number;
253
+ }
254
+
255
+ export interface DapScope {
256
+ name: string;
257
+ presentationHint?: "arguments" | "locals" | "registers" | string;
258
+ variablesReference: number;
259
+ expensive: boolean;
260
+ source?: DapSource;
261
+ line?: number;
262
+ column?: number;
263
+ endLine?: number;
264
+ endColumn?: number;
265
+ }
266
+
267
+ export interface DapScopesResponse {
268
+ scopes: DapScope[];
269
+ }
270
+
271
+ export interface DapVariablesArguments {
272
+ variablesReference: number;
273
+ filter?: "indexed" | "named";
274
+ start?: number;
275
+ count?: number;
276
+ format?: Record<string, unknown>;
277
+ }
278
+
279
+ export interface DapVariable {
280
+ name: string;
281
+ value: string;
282
+ type?: string;
283
+ presentationHint?: {
284
+ kind?: string;
285
+ attributes?: string[];
286
+ visibility?: string;
287
+ lazy?: boolean;
288
+ };
289
+ evaluateName?: string;
290
+ variablesReference: number;
291
+ namedVariables?: number;
292
+ indexedVariables?: number;
293
+ memoryReference?: string;
294
+ }
295
+
296
+ export interface DapVariablesResponse {
297
+ variables: DapVariable[];
298
+ }
299
+
300
+ export interface DapDisassembleArguments {
301
+ memoryReference: string;
302
+ offset?: number;
303
+ instructionOffset?: number;
304
+ instructionCount: number;
305
+ resolveSymbols?: boolean;
306
+ }
307
+
308
+ export interface DapDisassembledInstruction {
309
+ address: string;
310
+ instructionBytes?: string;
311
+ instruction: string;
312
+ symbol?: string;
313
+ location?: DapSource;
314
+ line?: number;
315
+ column?: number;
316
+ endLine?: number;
317
+ endColumn?: number;
318
+ }
319
+
320
+ export interface DapDisassembleResponse {
321
+ instructions: DapDisassembledInstruction[];
322
+ }
323
+
324
+ export interface DapReadMemoryArguments {
325
+ memoryReference: string;
326
+ offset?: number;
327
+ count: number;
328
+ }
329
+
330
+ export interface DapReadMemoryResponse {
331
+ address: string;
332
+ unreadableBytes?: number;
333
+ data?: string;
334
+ }
335
+
336
+ export interface DapWriteMemoryArguments {
337
+ memoryReference: string;
338
+ offset?: number;
339
+ data: string;
340
+ allowPartial?: boolean;
341
+ }
342
+
343
+ export interface DapWriteMemoryResponse {
344
+ offset?: number;
345
+ bytesWritten?: number;
346
+ }
347
+
348
+ export interface DapModule {
349
+ id: number | string;
350
+ name: string;
351
+ path?: string;
352
+ isOptimized?: boolean;
353
+ isUserCode?: boolean;
354
+ version?: string;
355
+ symbolStatus?: string;
356
+ symbolFilePath?: string;
357
+ dateTimeStamp?: string;
358
+ addressRange?: string;
359
+ }
360
+
361
+ export interface DapModulesArguments {
362
+ startModule?: number;
363
+ moduleCount?: number;
364
+ }
365
+
366
+ export interface DapModulesResponse {
367
+ modules: DapModule[];
368
+ totalModules?: number;
369
+ }
370
+
371
+ export interface DapLoadedSourcesResponse {
372
+ sources: DapSource[];
373
+ }
374
+
375
+ export interface DapEvaluateArguments {
376
+ expression: string;
377
+ frameId?: number;
378
+ context?: "watch" | "repl" | "hover" | "clipboard" | "variables";
379
+ format?: Record<string, unknown>;
380
+ }
381
+
382
+ export interface DapEvaluateResponse {
383
+ result: string;
384
+ type?: string;
385
+ presentationHint?: {
386
+ kind?: string;
387
+ attributes?: string[];
388
+ visibility?: string;
389
+ lazy?: boolean;
390
+ };
391
+ variablesReference: number;
392
+ namedVariables?: number;
393
+ indexedVariables?: number;
394
+ memoryReference?: string;
395
+ }
396
+
397
+ export interface DapThread {
398
+ id: number;
399
+ name: string;
400
+ }
401
+
402
+ export interface DapThreadsResponse {
403
+ threads: DapThread[];
404
+ }
405
+
406
+ export interface DapOutputEventBody {
407
+ category?: "console" | "important" | "stdout" | "stderr" | "telemetry" | string;
408
+ output: string;
409
+ group?: "start" | "startCollapsed" | "end";
410
+ variablesReference?: number;
411
+ source?: DapSource;
412
+ line?: number;
413
+ column?: number;
414
+ data?: unknown;
415
+ }
416
+
417
+ export interface DapStoppedEventBody {
418
+ reason: string;
419
+ description?: string;
420
+ threadId?: number;
421
+ preserveFocusHint?: boolean;
422
+ text?: string;
423
+ allThreadsStopped?: boolean;
424
+ hitBreakpointIds?: number[];
425
+ }
426
+
427
+ export interface DapContinuedEventBody {
428
+ threadId: number;
429
+ allThreadsContinued?: boolean;
430
+ }
431
+
432
+ export interface DapExitedEventBody {
433
+ exitCode?: number;
434
+ }
435
+
436
+ export interface DapTerminatedEventBody {
437
+ restart?: boolean | Record<string, unknown>;
438
+ }
439
+
440
+ export interface DapInitializedEventBody {}
441
+
442
+ export interface DapRunInTerminalArguments {
443
+ kind?: "integrated" | "external";
444
+ title?: string;
445
+ cwd?: string;
446
+ args: string[];
447
+ env?: Record<string, string | null>;
448
+ }
449
+
450
+ export interface DapRunInTerminalResponse {
451
+ processId?: number;
452
+ shellProcessId?: number;
453
+ }
454
+
455
+ export interface DapStartDebuggingArguments {
456
+ request: "launch" | "attach";
457
+ configuration: Record<string, unknown>;
458
+ }
459
+
460
+ export interface DapPendingRequest {
461
+ resolve: (body: unknown) => void;
462
+ reject: (error: Error) => void;
463
+ command: string;
464
+ }
465
+
466
+ export interface DapClientState {
467
+ adapterName: string;
468
+ cwd: string;
469
+ proc: ptree.ChildProcess<"pipe">;
470
+ requestSeq: number;
471
+ pendingRequests: Map<number, DapPendingRequest>;
472
+ messageBuffer: Uint8Array;
473
+ isReading: boolean;
474
+ lastActivity: number;
475
+ capabilities?: DapCapabilities;
476
+ }
477
+
478
+ export interface DapAdapterConfig {
479
+ command: string;
480
+ args?: string[];
481
+ languages?: string[];
482
+ fileTypes?: string[];
483
+ rootMarkers?: string[];
484
+ launchDefaults?: Record<string, unknown>;
485
+ attachDefaults?: Record<string, unknown>;
486
+ /** "stdio" (default): communicate via stdin/stdout pipes.
487
+ * "socket": adapter uses a network socket instead of stdio.
488
+ * On Linux, connects via a unix domain socket.
489
+ * On macOS, the adapter dials into a local TCP listener (--client-addr). */
490
+ connectMode?: "stdio" | "socket";
491
+ }
492
+
493
+ export interface DapResolvedAdapter {
494
+ name: string;
495
+ command: string;
496
+ args: string[];
497
+ resolvedCommand: string;
498
+ languages: string[];
499
+ fileTypes: string[];
500
+ rootMarkers: string[];
501
+ launchDefaults: Record<string, unknown>;
502
+ attachDefaults: Record<string, unknown>;
503
+ connectMode: "stdio" | "socket";
504
+ }
505
+
506
+ export interface DapBreakpointRecord {
507
+ id?: number;
508
+ verified: boolean;
509
+ line: number;
510
+ condition?: string;
511
+ message?: string;
512
+ }
513
+
514
+ export interface DapInstructionBreakpointRecord {
515
+ id?: number;
516
+ verified: boolean;
517
+ instructionReference: string;
518
+ offset?: number;
519
+ condition?: string;
520
+ hitCondition?: string;
521
+ message?: string;
522
+ }
523
+
524
+ export interface DapDataBreakpointRecord {
525
+ id?: number;
526
+ verified: boolean;
527
+ dataId: string;
528
+ accessType?: "read" | "write" | "readWrite";
529
+ condition?: string;
530
+ hitCondition?: string;
531
+ message?: string;
532
+ }
533
+
534
+ export interface DapFunctionBreakpointRecord {
535
+ id?: number;
536
+ verified: boolean;
537
+ name: string;
538
+ condition?: string;
539
+ message?: string;
540
+ }
541
+
542
+ export interface DapStopLocation {
543
+ threadId?: number;
544
+ frameId?: number;
545
+ reason?: string;
546
+ description?: string;
547
+ text?: string;
548
+ frameName?: string;
549
+ instructionPointerReference?: string;
550
+ source?: DapSource;
551
+ line?: number;
552
+ column?: number;
553
+ }
554
+
555
+ export interface DapSessionSummary {
556
+ id: string;
557
+ adapter: string;
558
+ cwd: string;
559
+ program?: string;
560
+ status: DapSessionStatus;
561
+ launchedAt: string;
562
+ lastUsedAt: string;
563
+ threadId?: number;
564
+ frameId?: number;
565
+ stopReason?: string;
566
+ stopDescription?: string;
567
+ frameName?: string;
568
+ instructionPointerReference?: string;
569
+ source?: DapSource;
570
+ line?: number;
571
+ column?: number;
572
+ breakpointFiles: number;
573
+ breakpointCount: number;
574
+ functionBreakpointCount: number;
575
+ outputBytes: number;
576
+ outputTruncated: boolean;
577
+ exitCode?: number;
578
+ needsConfigurationDone: boolean;
579
+ }
580
+
581
+ export interface DapContinueOutcome {
582
+ snapshot: DapSessionSummary;
583
+ state: "running" | "stopped" | "terminated";
584
+ timedOut: boolean;
585
+ }
586
+
587
+ export interface DapLaunchSessionOptions {
588
+ adapter: DapResolvedAdapter;
589
+ program: string;
590
+ args?: string[];
591
+ cwd: string;
592
+ }
593
+
594
+ export interface DapAttachSessionOptions {
595
+ adapter: DapResolvedAdapter;
596
+ cwd: string;
597
+ pid?: number;
598
+ port?: number;
599
+ host?: string;
600
+ }
@@ -1,14 +1,15 @@
1
- import { copyToClipboard, sanitizeText } from "@oh-my-pi/pi-natives";
1
+ import { sanitizeText } from "@oh-my-pi/pi-natives";
2
2
  import {
3
3
  type Component,
4
4
  extractPrintableText,
5
5
  matchesKey,
6
6
  padding,
7
+ replaceTabs,
7
8
  truncateToWidth,
8
9
  visibleWidth,
9
10
  } from "@oh-my-pi/pi-tui";
10
11
  import { theme } from "../modes/theme/theme";
11
- import { replaceTabs } from "../tools/render-utils";
12
+ import { copyToClipboard } from "../utils/clipboard";
12
13
  import {
13
14
  formatDebugLogExpandedLines,
14
15
  formatDebugLogLine,
@@ -4,7 +4,7 @@
4
4
  * Primary provider for OMP native configs. Supports all capabilities.
5
5
  */
6
6
  import * as path from "node:path";
7
- import { logger, tryParseJson } from "@oh-my-pi/pi-utils";
7
+ import { logger, parseFrontmatter, tryParseJson } from "@oh-my-pi/pi-utils";
8
8
  import { registerProvider } from "../capability";
9
9
  import { type ContextFile, contextFileCapability } from "../capability/context-file";
10
10
  import { type Extension, type ExtensionManifest, extensionCapability } from "../capability/extension";
@@ -22,7 +22,6 @@ import { type SystemPrompt, systemPromptCapability } from "../capability/system-
22
22
  import { type CustomTool, toolCapability } from "../capability/tool";
23
23
  import type { LoadContext, LoadResult } from "../capability/types";
24
24
  import { expandTilde } from "../tools/path-utils";
25
- import { parseFrontmatter } from "../utils/frontmatter";
26
25
  import {
27
26
  buildRuleFromMarkdown,
28
27
  createSourceMeta,
@@ -7,7 +7,7 @@
7
7
  * User directory: ~/.codex
8
8
  */
9
9
  import * as path from "node:path";
10
- import { logger } from "@oh-my-pi/pi-utils";
10
+ import { logger, parseFrontmatter } from "@oh-my-pi/pi-utils";
11
11
  import { registerProvider } from "../capability";
12
12
  import type { ContextFile } from "../capability/context-file";
13
13
  import { contextFileCapability } from "../capability/context-file";
@@ -28,7 +28,7 @@ import { slashCommandCapability } from "../capability/slash-command";
28
28
  import type { CustomTool } from "../capability/tool";
29
29
  import { toolCapability } from "../capability/tool";
30
30
  import type { LoadContext, LoadResult, SourceMeta } from "../capability/types";
31
- import { parseFrontmatter } from "../utils/frontmatter";
31
+
32
32
  import {
33
33
  createSourceMeta,
34
34
  discoverExtensionModulePaths,
@@ -12,12 +12,13 @@
12
12
  * - instructions: *.instructions.md in .github/instructions/ with applyTo frontmatter
13
13
  */
14
14
  import * as path from "node:path";
15
+ import { parseFrontmatter } from "@oh-my-pi/pi-utils";
15
16
  import { registerProvider } from "../capability";
16
17
  import { type ContextFile, contextFileCapability } from "../capability/context-file";
17
18
  import { readFile } from "../capability/fs";
18
19
  import { type Instruction, instructionCapability } from "../capability/instruction";
19
20
  import type { LoadContext, LoadResult, SourceMeta } from "../capability/types";
20
- import { parseFrontmatter } from "../utils/frontmatter";
21
+
21
22
  import { calculateDepth, createSourceMeta, getProjectPath, loadFilesFromDir } from "./helpers";
22
23
 
23
24
  const PROVIDER_ID = "github";
@@ -3,13 +3,13 @@ import * as os from "node:os";
3
3
  import * as path from "node:path";
4
4
  import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
5
5
  import { FileType, glob } from "@oh-my-pi/pi-natives";
6
- import { CONFIG_DIR_NAME, getConfigDirName, getProjectDir, tryParseJson } from "@oh-my-pi/pi-utils";
6
+ import { CONFIG_DIR_NAME, getConfigDirName, getProjectDir, parseFrontmatter, tryParseJson } from "@oh-my-pi/pi-utils";
7
7
  import { readDirEntries, readFile } from "../capability/fs";
8
8
  import { parseRuleConditionAndScope, type Rule, type RuleFrontmatter } from "../capability/rule";
9
9
  import type { Skill, SkillFrontmatter } from "../capability/skill";
10
10
  import type { LoadContext, LoadResult, SourceMeta } from "../capability/types";
11
11
  import { parseThinkingLevel } from "../thinking";
12
- import { parseFrontmatter } from "../utils/frontmatter";
12
+
13
13
  import { buildPluginDirRoot } from "./plugin-dir-roots";
14
14
 
15
15
  /**
@@ -16,7 +16,7 @@
16
16
  * Priority: 55 (tool-specific provider)
17
17
  */
18
18
  import * as path from "node:path";
19
- import { logger, tryParseJson } from "@oh-my-pi/pi-utils";
19
+ import { logger, parseFrontmatter, tryParseJson } from "@oh-my-pi/pi-utils";
20
20
  import { registerProvider } from "../capability";
21
21
  import { type ContextFile, contextFileCapability } from "../capability/context-file";
22
22
  import { type ExtensionModule, extensionModuleCapability } from "../capability/extension-module";
@@ -26,7 +26,7 @@ import { type Settings, settingsCapability } from "../capability/settings";
26
26
  import { type Skill, skillCapability } from "../capability/skill";
27
27
  import { type SlashCommand, slashCommandCapability } from "../capability/slash-command";
28
28
  import type { LoadContext, LoadResult, SourceMeta } from "../capability/types";
29
- import { parseFrontmatter } from "../utils/frontmatter";
29
+
30
30
  import {
31
31
  createSourceMeta,
32
32
  discoverExtensionModulePaths,