@oh-my-pi/pi-coding-agent 13.18.0 → 14.0.2
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.
- package/CHANGELOG.md +316 -1
- package/package.json +86 -24
- package/scripts/format-prompts.ts +2 -2
- package/src/autoresearch/apply-contract-to-state.ts +24 -0
- package/src/autoresearch/contract.ts +0 -44
- package/src/autoresearch/dashboard.ts +1 -2
- package/src/autoresearch/git.ts +116 -30
- package/src/autoresearch/helpers.ts +49 -0
- package/src/autoresearch/index.ts +28 -187
- package/src/autoresearch/prompt.md +26 -9
- package/src/autoresearch/state.ts +0 -6
- package/src/autoresearch/tools/init-experiment.ts +202 -117
- package/src/autoresearch/tools/log-experiment.ts +123 -178
- package/src/autoresearch/tools/run-experiment.ts +48 -10
- package/src/autoresearch/types.ts +2 -2
- package/src/capability/index.ts +4 -2
- package/src/cli/file-processor.ts +3 -3
- package/src/cli/grep-cli.ts +8 -8
- package/src/cli/grievances-cli.ts +78 -0
- package/src/cli/read-cli.ts +67 -0
- package/src/cli/setup-cli.ts +4 -4
- package/src/cli/update-cli.ts +3 -3
- package/src/cli.ts +2 -0
- package/src/commands/grep.ts +6 -1
- package/src/commands/grievances.ts +20 -0
- package/src/commands/read.ts +33 -0
- package/src/commit/agentic/agent.ts +5 -8
- package/src/commit/agentic/index.ts +22 -26
- package/src/commit/agentic/tools/analyze-file.ts +3 -3
- package/src/commit/agentic/tools/git-file-diff.ts +3 -6
- package/src/commit/agentic/tools/git-hunk.ts +3 -3
- package/src/commit/agentic/tools/git-overview.ts +6 -9
- package/src/commit/agentic/tools/index.ts +6 -8
- package/src/commit/agentic/tools/propose-commit.ts +4 -7
- package/src/commit/agentic/tools/recent-commits.ts +3 -3
- package/src/commit/agentic/tools/split-commit.ts +4 -4
- package/src/commit/agentic/validation.ts +1 -1
- package/src/commit/analysis/conventional.ts +4 -4
- package/src/commit/analysis/summary.ts +3 -3
- package/src/commit/changelog/generate.ts +4 -4
- package/src/commit/changelog/index.ts +5 -9
- package/src/commit/map-reduce/map-phase.ts +4 -4
- package/src/commit/map-reduce/reduce-phase.ts +4 -4
- package/src/commit/pipeline.ts +13 -16
- package/src/config/keybindings.ts +7 -6
- package/src/config/prompt-templates.ts +44 -226
- package/src/config/resolve-config-value.ts +4 -2
- package/src/config/settings-schema.ts +98 -2
- package/src/config/settings.ts +25 -26
- package/src/dap/client.ts +674 -0
- package/src/dap/config.ts +150 -0
- package/src/dap/defaults.json +211 -0
- package/src/dap/index.ts +4 -0
- package/src/dap/session.ts +1255 -0
- package/src/dap/types.ts +600 -0
- package/src/debug/log-viewer.ts +3 -2
- package/src/discovery/builtin.ts +1 -2
- package/src/discovery/codex.ts +2 -2
- package/src/discovery/github.ts +2 -1
- package/src/discovery/helpers.ts +2 -2
- package/src/discovery/opencode.ts +2 -2
- package/src/edit/diff.ts +818 -0
- package/src/edit/index.ts +309 -0
- package/src/edit/line-hash.ts +67 -0
- package/src/edit/modes/chunk.ts +454 -0
- package/src/{patch → edit/modes}/hashline.ts +741 -361
- package/src/{patch/applicator.ts → edit/modes/patch.ts} +420 -117
- package/src/{patch/fuzzy.ts → edit/modes/replace.ts} +519 -197
- package/src/{patch → edit}/normalize.ts +97 -76
- package/src/{patch/shared.ts → edit/renderer.ts} +181 -108
- package/src/exec/bash-executor.ts +4 -2
- package/src/exec/idle-timeout-watchdog.ts +126 -0
- package/src/exec/non-interactive-env.ts +5 -0
- package/src/extensibility/custom-commands/bundled/ci-green/index.ts +6 -18
- package/src/extensibility/custom-commands/bundled/review/index.ts +45 -43
- package/src/extensibility/custom-commands/loader.ts +1 -2
- package/src/extensibility/custom-tools/loader.ts +34 -11
- package/src/extensibility/custom-tools/types.ts +1 -1
- package/src/extensibility/extensions/loader.ts +9 -4
- package/src/extensibility/extensions/runner.ts +24 -1
- package/src/extensibility/extensions/types.ts +4 -2
- package/src/extensibility/hooks/loader.ts +5 -6
- package/src/extensibility/hooks/types.ts +2 -2
- package/src/extensibility/plugins/doctor.ts +2 -1
- package/src/extensibility/plugins/marketplace/fetcher.ts +2 -57
- package/src/extensibility/plugins/marketplace/source-resolver.ts +4 -4
- package/src/extensibility/slash-commands.ts +3 -7
- package/src/index.ts +3 -1
- package/src/internal-urls/docs-index.generated.ts +11 -11
- package/src/ipy/executor.ts +58 -17
- package/src/ipy/gateway-coordinator.ts +6 -4
- package/src/ipy/kernel.ts +45 -22
- package/src/ipy/runtime.ts +2 -2
- package/src/lsp/client.ts +7 -4
- package/src/lsp/clients/lsp-linter-client.ts +4 -4
- package/src/lsp/config.ts +2 -2
- package/src/lsp/defaults.json +688 -154
- package/src/lsp/index.ts +234 -45
- package/src/lsp/lspmux.ts +2 -2
- package/src/lsp/startup-events.ts +13 -0
- package/src/lsp/types.ts +12 -1
- package/src/lsp/utils.ts +8 -1
- package/src/main.ts +125 -47
- package/src/memories/index.ts +4 -5
- package/src/modes/acp/acp-agent.ts +563 -163
- package/src/modes/acp/acp-event-mapper.ts +9 -1
- package/src/modes/acp/acp-mode.ts +4 -2
- package/src/modes/components/agent-dashboard.ts +3 -4
- package/src/modes/components/diff.ts +6 -7
- package/src/modes/components/footer.ts +9 -29
- package/src/modes/components/hook-editor.ts +3 -3
- package/src/modes/components/hook-selector.ts +6 -1
- package/src/modes/components/read-tool-group.ts +6 -12
- package/src/modes/components/session-observer-overlay.ts +472 -0
- package/src/modes/components/settings-defs.ts +24 -0
- package/src/modes/components/status-line.ts +15 -61
- package/src/modes/components/tool-execution.ts +1 -1
- package/src/modes/components/welcome.ts +1 -1
- package/src/modes/controllers/btw-controller.ts +2 -2
- package/src/modes/controllers/command-controller.ts +4 -2
- package/src/modes/controllers/event-controller.ts +59 -2
- package/src/modes/controllers/extension-ui-controller.ts +1 -0
- package/src/modes/controllers/input-controller.ts +15 -8
- package/src/modes/controllers/selector-controller.ts +26 -0
- package/src/modes/index.ts +20 -2
- package/src/modes/interactive-mode.ts +278 -69
- package/src/modes/rpc/host-tools.ts +186 -0
- package/src/modes/rpc/rpc-client.ts +178 -13
- package/src/modes/rpc/rpc-mode.ts +73 -3
- package/src/modes/rpc/rpc-types.ts +53 -1
- package/src/modes/session-observer-registry.ts +146 -0
- package/src/modes/shared.ts +0 -42
- package/src/modes/theme/theme.ts +80 -8
- package/src/modes/types.ts +4 -2
- package/src/modes/utils/keybinding-matchers.ts +9 -0
- package/src/prompts/system/custom-system-prompt.md +5 -0
- package/src/prompts/system/system-prompt.md +8 -1
- package/src/prompts/tools/chunk-edit.md +219 -0
- package/src/prompts/tools/debug.md +43 -0
- package/src/prompts/tools/grep.md +3 -0
- package/src/prompts/tools/lsp.md +5 -5
- package/src/prompts/tools/read-chunk.md +17 -0
- package/src/prompts/tools/read.md +19 -5
- package/src/sdk.ts +216 -165
- package/src/secrets/index.ts +1 -1
- package/src/secrets/obfuscator.ts +25 -17
- package/src/session/agent-session.ts +381 -286
- package/src/session/agent-storage.ts +12 -12
- package/src/session/compaction/branch-summarization.ts +3 -3
- package/src/session/compaction/compaction.ts +5 -6
- package/src/session/compaction/utils.ts +3 -3
- package/src/session/history-storage.ts +62 -19
- package/src/session/messages.ts +3 -3
- package/src/session/session-dump-format.ts +203 -0
- package/src/session/session-manager.ts +15 -5
- package/src/session/session-storage.ts +4 -2
- package/src/session/streaming-output.ts +1 -1
- package/src/session/tool-choice-queue.ts +213 -0
- package/src/slash-commands/builtin-registry.ts +56 -8
- package/src/ssh/connection-manager.ts +2 -2
- package/src/ssh/sshfs-mount.ts +5 -5
- package/src/stt/downloader.ts +4 -4
- package/src/stt/recorder.ts +4 -4
- package/src/stt/transcriber.ts +2 -2
- package/src/system-prompt.ts +25 -13
- package/src/task/agents.ts +5 -6
- package/src/task/commands.ts +2 -5
- package/src/task/executor.ts +32 -4
- package/src/task/index.ts +91 -82
- package/src/task/template.ts +2 -2
- package/src/task/types.ts +25 -0
- package/src/task/worktree.ts +131 -149
- package/src/tools/ask.ts +2 -3
- package/src/tools/ast-edit.ts +7 -7
- package/src/tools/ast-grep.ts +7 -7
- package/src/tools/auto-generated-guard.ts +36 -41
- package/src/tools/await-tool.ts +2 -2
- package/src/tools/bash.ts +5 -23
- package/src/tools/browser.ts +4 -5
- package/src/tools/calculator.ts +2 -3
- package/src/tools/cancel-job.ts +2 -2
- package/src/tools/checkpoint.ts +3 -3
- package/src/tools/debug.ts +1007 -0
- package/src/tools/exit-plan-mode.ts +3 -3
- package/src/tools/fetch.ts +67 -3
- package/src/tools/find.ts +4 -5
- package/src/tools/fs-cache-invalidation.ts +5 -0
- package/src/tools/gemini-image.ts +13 -5
- package/src/tools/gh.ts +130 -308
- package/src/tools/grep.ts +57 -9
- package/src/tools/index.ts +44 -22
- package/src/tools/inspect-image.ts +4 -4
- package/src/tools/output-meta.ts +1 -1
- package/src/tools/python.ts +19 -6
- package/src/tools/read.ts +211 -146
- package/src/tools/render-mermaid.ts +2 -3
- package/src/tools/render-utils.ts +20 -6
- package/src/tools/renderers.ts +3 -1
- package/src/tools/report-tool-issue.ts +80 -0
- package/src/tools/resolve.ts +70 -39
- package/src/tools/search-tool-bm25.ts +2 -2
- package/src/tools/ssh.ts +2 -2
- package/src/tools/todo-write.ts +2 -2
- package/src/tools/tool-timeouts.ts +1 -0
- package/src/tools/write.ts +5 -6
- package/src/tui/tree-list.ts +3 -1
- package/src/utils/clipboard.ts +80 -0
- package/src/utils/commit-message-generator.ts +2 -3
- package/src/utils/edit-mode.ts +49 -0
- package/src/utils/external-editor.ts +11 -5
- package/src/utils/file-display-mode.ts +6 -5
- package/src/utils/file-mentions.ts +8 -7
- package/src/utils/git.ts +1400 -0
- package/src/utils/image-loading.ts +98 -0
- package/src/utils/title-generator.ts +2 -3
- package/src/utils/tools-manager.ts +6 -6
- package/src/web/scrapers/choosealicense.ts +1 -1
- package/src/web/search/index.ts +3 -3
- package/src/web/search/render.ts +6 -4
- package/src/autoresearch/command-initialize.md +0 -34
- package/src/commit/git/errors.ts +0 -9
- package/src/commit/git/index.ts +0 -210
- package/src/commit/git/operations.ts +0 -54
- package/src/patch/diff.ts +0 -433
- package/src/patch/index.ts +0 -888
- package/src/patch/parser.ts +0 -532
- package/src/patch/types.ts +0 -292
- package/src/prompts/agents/oracle.md +0 -77
- package/src/tools/gh-cli.ts +0 -125
- package/src/tools/pending-action.ts +0 -49
- package/src/utils/child-process.ts +0 -88
- package/src/utils/frontmatter.ts +0 -117
- package/src/utils/image-input.ts +0 -274
- package/src/utils/mime.ts +0 -53
- package/src/utils/prompt-format.ts +0 -170
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
Provides debugger access through the Debug Adapter Protocol (DAP). Use this to launch or attach debuggers, set breakpoints, step through execution, inspect threads/stack/variables, evaluate expressions, capture program output, and interrupt hung programs.
|
|
2
|
+
|
|
3
|
+
<instruction>
|
|
4
|
+
- Prefer this over bash when you need program state, breakpoints, stepping, thread inspection, or to interrupt a running process.
|
|
5
|
+
- `action: "launch"` starts a debugger session for a program or script. `program` is required. `adapter` is optional; when omitted, the tool selects an installed adapter from the target path and workspace.
|
|
6
|
+
- `action: "attach"` connects to an existing process. Provide `pid` for local process attach or `port` for adapters that support remote attach. Use `adapter` to force a specific debugger.
|
|
7
|
+
- Breakpoints:
|
|
8
|
+
- Source breakpoints: `set_breakpoint` / `remove_breakpoint` with `file` + `line`
|
|
9
|
+
- Function breakpoints: `set_breakpoint` / `remove_breakpoint` with `function`
|
|
10
|
+
- Optional `condition` adds a conditional breakpoint expression
|
|
11
|
+
- Flow control:
|
|
12
|
+
- `continue` resumes execution and waits briefly to see whether the program stops or keeps running
|
|
13
|
+
- `step_over`, `step_in`, `step_out` perform single-step execution
|
|
14
|
+
- `pause` interrupts a running program so you can inspect the current state
|
|
15
|
+
- Inspection:
|
|
16
|
+
- `threads` lists threads
|
|
17
|
+
- `stack_trace` returns frames for the current stopped thread
|
|
18
|
+
- `scopes` requires `frame_id` or a current stopped frame
|
|
19
|
+
- `variables` requires `variable_ref` or `scope_id`
|
|
20
|
+
- `evaluate` requires `expression`; use `context: "repl"` for raw debugger commands when the adapter supports them
|
|
21
|
+
- `output` returns captured stdout/stderr/console output from the debuggee and adapter
|
|
22
|
+
- `sessions` lists tracked debug sessions
|
|
23
|
+
- `terminate` ends the active debug session
|
|
24
|
+
- Timeouts apply to individual debugger requests, not the full session lifetime.
|
|
25
|
+
</instruction>
|
|
26
|
+
|
|
27
|
+
<caution>
|
|
28
|
+
- Only one active debug session is supported at a time.
|
|
29
|
+
- Some adapters require a launched session to receive `configurationDone` before the target actually runs; if the tool says configuration is pending, set breakpoints and then call `continue`.
|
|
30
|
+
- Adapter availability depends on local binaries. Common built-ins are `gdb`, `lldb-dap`, `python -m debugpy.adapter`, and `dlv dap`.
|
|
31
|
+
</caution>
|
|
32
|
+
|
|
33
|
+
<example name="launch and inspect hang">
|
|
34
|
+
1. `debug(action: "launch", program: "./my_app")`
|
|
35
|
+
2. `debug(action: "set_breakpoint", file: "src/main.c", line: 42)`
|
|
36
|
+
3. `debug(action: "continue")`
|
|
37
|
+
4. If the program appears hung: `debug(action: "pause")`
|
|
38
|
+
5. Inspect state with `threads`, `stack_trace`, `scopes`, and `variables`
|
|
39
|
+
</example>
|
|
40
|
+
|
|
41
|
+
<example name="raw debugger command through repl">
|
|
42
|
+
`debug(action: "evaluate", expression: "info registers", context: "repl")`
|
|
43
|
+
</example>
|
package/src/prompts/tools/lsp.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
Interacts with Language Server Protocol servers for code intelligence.
|
|
2
2
|
|
|
3
3
|
<operations>
|
|
4
|
-
- `diagnostics`: Get errors/warnings for file, glob, or entire workspace (
|
|
4
|
+
- `diagnostics`: Get errors/warnings for a file, a glob of files, or the entire workspace (`file: "*"`)
|
|
5
5
|
- `definition`: Go to symbol definition → file path + position + 3-line source context
|
|
6
6
|
- `type_definition`: Go to symbol type definition → file path + position + 3-line source context
|
|
7
7
|
- `implementation`: Find concrete implementations → file path + position + 3-line source context
|
|
8
8
|
- `references`: Find references → locations with 3-line source context (first 50), remaining location-only
|
|
9
9
|
- `hover`: Get type info and documentation → type signature + docs
|
|
10
|
-
- `symbols`: List symbols in file, or search workspace
|
|
10
|
+
- `symbols`: List symbols in a file, or search workspace with `file: "*"` and a `query`
|
|
11
11
|
- `rename`: Rename symbol across codebase → preview or apply edits
|
|
12
12
|
- `code_actions`: List available quick-fixes/refactors/import actions; apply one when `apply: true` and `query` matches title or index
|
|
13
13
|
- `status`: Show active language servers
|
|
14
|
-
- `reload`: Restart
|
|
14
|
+
- `reload`: Restart a specific server (via `file`) or all servers with `file: "*"`
|
|
15
15
|
</operations>
|
|
16
16
|
|
|
17
17
|
<parameters>
|
|
18
|
-
- `file`: File path
|
|
18
|
+
- `file`: File path, glob pattern (e.g. `src/**/*.ts`), or `"*"` for workspace scope. Globs are expanded locally before dispatch. `"*"` routes `diagnostics`/`symbols`/`reload` to their workspace-wide form.
|
|
19
19
|
- `line`: 1-indexed line number for position-based actions
|
|
20
20
|
- `symbol`: Substring on the target line used to resolve column automatically
|
|
21
21
|
- `occurrence`: 1-indexed match index when `symbol` appears multiple times on the same line
|
|
@@ -28,6 +28,6 @@ Interacts with Language Server Protocol servers for code intelligence.
|
|
|
28
28
|
<caution>
|
|
29
29
|
- Requires running LSP server for target language
|
|
30
30
|
- Some operations require file to be saved to disk
|
|
31
|
-
-
|
|
31
|
+
- Glob expansion samples up to 20 files per request; use `file: "*"` for broader coverage
|
|
32
32
|
- When `symbol` is provided for position-based actions, missing symbols or out-of-bounds `occurrence` values return an explicit error instead of silently falling back
|
|
33
33
|
</caution>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Reads files using syntax-aware chunks.
|
|
2
|
+
|
|
3
|
+
<instruction>
|
|
4
|
+
- `path` — file path or URL; may include `:selector` suffix
|
|
5
|
+
- `sel` — optional selector: `class_Foo`, `class_Foo.fn_bar#ABCD@body`, `?`, `L50`, `L50-L120`, or `raw`
|
|
6
|
+
- `timeout` — seconds, for URLs only
|
|
7
|
+
|
|
8
|
+
Each opening anchor `[< full.chunk.path#CCCC ]` in the default output identifies a chunk. Use `full.chunk.path#CCCC` as-is to read truncated chunks.
|
|
9
|
+
If you need a canonical target list, run `read(path="file", sel="?")`. That listing shows chunk paths with CRCs.
|
|
10
|
+
Line numbers in the gutter are absolute file line numbers.
|
|
11
|
+
|
|
12
|
+
Chunk trees: JS, TS, TSX, Python, Rust, Go. Others use blank-line fallback.
|
|
13
|
+
</instruction>
|
|
14
|
+
|
|
15
|
+
<critical>
|
|
16
|
+
- **MUST** `read` before editing — never invent chunk names or CRCs.
|
|
17
|
+
</critical>
|
|
@@ -4,9 +4,23 @@ Reads the content at the specified path or URL.
|
|
|
4
4
|
The `read` tool is a multi-purpose tool that can be used to inspect all kinds of files and URLs.
|
|
5
5
|
- You **MUST** parallelize reads when exploring related files
|
|
6
6
|
|
|
7
|
+
## Parameters
|
|
8
|
+
- `path` -- file path or URL (required)
|
|
9
|
+
- `sel` -- optional selector for line ranges or raw mode
|
|
10
|
+
- `timeout` -- seconds, for URLs only
|
|
11
|
+
|
|
12
|
+
## Selectors
|
|
13
|
+
|
|
14
|
+
|`sel` value|Behavior|
|
|
15
|
+
|---|---|
|
|
16
|
+
|*(omitted)*|Read full file (up to {{DEFAULT_LIMIT}} lines)|
|
|
17
|
+
|`L50`|Read from line 50 onward|
|
|
18
|
+
|`L50-L120`|Read lines 50 through 120|
|
|
19
|
+
|`raw`|Raw content without transformations (for URLs: untouched HTML)|
|
|
20
|
+
|
|
21
|
+
Max {{DEFAULT_MAX_LINES}} lines per call.
|
|
22
|
+
|
|
7
23
|
# Filesystem
|
|
8
|
-
- Reads up to {{DEFAULT_LIMIT}} lines by default
|
|
9
|
-
- Use `offset` and `limit` for large files; max {{DEFAULT_MAX_LINES}} lines per call
|
|
10
24
|
{{#if IS_HASHLINE_MODE}}
|
|
11
25
|
- If reading from FS, result will be prefixed with anchors: `41#ZZ:def alpha():`
|
|
12
26
|
{{else}}
|
|
@@ -26,7 +40,7 @@ When used against a directory, or an archive root, the tool will return a list o
|
|
|
26
40
|
|
|
27
41
|
# URLs
|
|
28
42
|
- Extract information from web pages, GitHub issues/PRs, Stack Overflow, Wikipedia, Reddit, NPM, arXiv, technical blogs, RSS/Atom feeds, JSON endpoints
|
|
29
|
-
- `raw
|
|
43
|
+
- `sel="raw"` for untouched HTML or debugging
|
|
30
44
|
- `timeout` to override the default request timeout
|
|
31
45
|
</instruction>
|
|
32
46
|
|
|
@@ -35,6 +49,6 @@ When used against a directory, or an archive root, the tool will return a list o
|
|
|
35
49
|
- You **MUST** use `read` instead of `ls` for directory listings.
|
|
36
50
|
- You **MUST** use `read` instead of shelling out to `tar` or `unzip` for supported archive reads.
|
|
37
51
|
- You **MUST** always include the `path` parameter, NEVER call `read` with empty arguments `{}`.
|
|
38
|
-
- When reading specific line ranges, use `
|
|
39
|
-
- You **MAY** use `
|
|
52
|
+
- When reading specific line ranges, use `sel`: `read(path="file", sel="L50-L150")` not `cat -n file | sed`.
|
|
53
|
+
- You **MAY** use `sel` with URL reads; the tool will paginate the cached fetched output.
|
|
40
54
|
</critical>
|