@oh-my-pi/pi-coding-agent 16.1.1 → 16.1.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 +22 -1
- package/dist/cli.js +3314 -3338
- package/dist/types/cli/bench-cli.d.ts +2 -1
- package/dist/types/config/settings-schema.d.ts +1 -1
- package/dist/types/main.d.ts +2 -0
- package/dist/types/modes/components/assistant-message.d.ts +12 -0
- package/dist/types/modes/components/welcome.d.ts +1 -1
- package/dist/types/sdk.d.ts +19 -2
- package/dist/types/session/auth-broker-config.d.ts +33 -6
- package/dist/types/system-prompt.d.ts +5 -1
- package/dist/types/task/executor.d.ts +10 -0
- package/dist/types/tools/find.d.ts +0 -2
- package/dist/types/tools/search.d.ts +3 -3
- package/package.json +12 -12
- package/scripts/measure-prompt-tokens.ts +63 -0
- package/src/cli/bench-cli.ts +64 -3
- package/src/cli/startup-cwd.ts +3 -13
- package/src/config/settings-schema.ts +1 -1
- package/src/cursor.ts +1 -1
- package/src/debug/raw-sse-buffer.ts +31 -10
- package/src/eval/py/prelude.py +1 -1
- package/src/export/html/tool-views.generated.js +1 -1
- package/src/extensibility/extensions/runner.ts +8 -2
- package/src/internal-urls/docs-index.generated.txt +1 -1
- package/src/main.ts +29 -9
- package/src/modes/components/assistant-message.ts +86 -0
- package/src/modes/components/tips.txt +2 -1
- package/src/modes/components/welcome.ts +86 -8
- package/src/modes/controllers/event-controller.ts +1 -1
- package/src/prompts/system/personalities/default.md +8 -16
- package/src/prompts/system/system-prompt.md +101 -115
- package/src/prompts/tools/ast-edit.md +10 -12
- package/src/prompts/tools/ast-grep.md +14 -18
- package/src/prompts/tools/bash.md +19 -21
- package/src/prompts/tools/browser.md +24 -24
- package/src/prompts/tools/checkpoint.md +0 -1
- package/src/prompts/tools/debug.md +11 -15
- package/src/prompts/tools/eval.md +27 -27
- package/src/prompts/tools/find.md +6 -10
- package/src/prompts/tools/github.md +11 -15
- package/src/prompts/tools/goal.md +0 -7
- package/src/prompts/tools/inspect-image.md +0 -1
- package/src/prompts/tools/irc.md +15 -24
- package/src/prompts/tools/job.md +5 -8
- package/src/prompts/tools/learn.md +2 -2
- package/src/prompts/tools/lsp.md +27 -30
- package/src/prompts/tools/manage-skill.md +4 -4
- package/src/prompts/tools/read.md +21 -23
- package/src/prompts/tools/replace.md +0 -1
- package/src/prompts/tools/resolve.md +4 -9
- package/src/prompts/tools/rewind.md +1 -1
- package/src/prompts/tools/search.md +8 -10
- package/src/prompts/tools/task.md +33 -38
- package/src/prompts/tools/todo.md +14 -18
- package/src/prompts/tools/web-search.md +0 -4
- package/src/prompts/tools/write.md +1 -1
- package/src/sdk.ts +49 -102
- package/src/session/agent-session.ts +17 -2
- package/src/session/auth-broker-config.ts +36 -76
- package/src/session/session-history-format.ts +1 -1
- package/src/session/session-manager.ts +33 -6
- package/src/system-prompt.ts +28 -8
- package/src/task/executor.ts +57 -0
- package/src/task/index.ts +15 -1
- package/src/tools/browser.ts +1 -1
- package/src/tools/eval.ts +1 -1
- package/src/tools/find.ts +4 -17
- package/src/tools/memory-edit.ts +1 -1
- package/src/tools/search.ts +5 -5
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
Use for launching or attaching debuggers, setting breakpoints, stepping through execution, inspecting threads/stack/variables, evaluating expressions, capturing output, and interrupting hung programs.
|
|
1
|
+
Debugger access.
|
|
3
2
|
|
|
4
3
|
<instruction>
|
|
5
|
-
- You SHOULD prefer this
|
|
6
|
-
- `action: "launch"` starts a session; `program`
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **Inspect**: `threads` (list), `stack_trace` (frames for current stopped thread), `scopes` (needs `frame_id` or a current stopped frame), `variables` (needs `variable_ref` or `scope_id`), `evaluate` (needs `expression`; `context: "repl"` for raw debugger commands when the adapter supports them), `output` (captured stdout/stderr/console), `sessions` (tracked debug sessions), `terminate`.
|
|
12
|
-
- Timeouts apply per-request, not to the full session lifetime.
|
|
4
|
+
- You SHOULD prefer this over bash for program state, breakpoints, stepping, thread inspection, or interrupting a running process.
|
|
5
|
+
- `action: "launch"` starts a session; `program` required, `adapter` optional. Python: `adapter: "debugpy"`, `program` = target `.py`, interpreter/script flags in `args`.
|
|
6
|
+
- `action: "attach"` connects to a running process: `pid` (local), `port` (remote), `adapter` forces a specific debugger.
|
|
7
|
+
- **Breakpoints**: `set_breakpoint`/`remove_breakpoint` with source (`file`+`line`) or function (`function`); optional `condition`.
|
|
8
|
+
- **Flow control**: `continue` (resume), `step_over`/`step_in`/`step_out` (single-step), `pause` (interrupt a running program).
|
|
9
|
+
- **Inspect**: `threads`, `stack_trace` (current stopped thread), `scopes` (needs `frame_id` or current stopped frame), `variables` (needs `variable_ref` or `scope_id`), `evaluate` (needs `expression`; `context: "repl"` for raw debugger commands), `output` (stdout/stderr/console), `sessions`, `terminate`.
|
|
13
10
|
</instruction>
|
|
14
11
|
|
|
15
12
|
<caution>
|
|
16
|
-
- Only one active debug session
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
- Python debugging requires `debugpy`; install with `pip install debugpy` if the adapter is unavailable.
|
|
13
|
+
- Only one active debug session at a time.
|
|
14
|
+
- Valid `adapter` values: `gdb`, `lldb-dap`, `python -m debugpy.adapter`, `dlv dap` (must be installed locally).
|
|
15
|
+
- `program` must be an executable file or debug target, not a directory or bare interpreter name.
|
|
16
|
+
- Python debugging requires `debugpy`; `pip install debugpy` if unavailable.
|
|
21
17
|
</caution>
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
Run code in a persistent kernel using a list of cells.
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
|
-
Cells run in array order. State persists per language
|
|
4
|
+
Cells run in array order. State persists per language across cells, tool calls, and `task` subagents — stage helpers/datasets/clients once, subagents reuse directly, no re-import/serialize.
|
|
5
5
|
|
|
6
6
|
Cell fields:
|
|
7
7
|
|
|
8
|
-
- `language` — {{#if py}}`"py"`
|
|
9
|
-
- `code` — cell body, verbatim. Newlines
|
|
8
|
+
- `language` — {{#if py}}`"py"` IPython kernel{{/if}}{{#ifAll py js}}, {{/ifAll}}{{#if js}}`"js"` persistent JavaScript VM{{/if}}.
|
|
9
|
+
- `code` — cell body, verbatim. Newlines/quotes JSON-encoded; no fences, no headers.
|
|
10
10
|
- `title` (optional) — short transcript label (e.g. `"imports"`).
|
|
11
|
-
- `timeout` (optional) — per-cell seconds
|
|
11
|
+
- `timeout` (optional) — per-cell seconds. Raise only for heavy compute or long non-agent tool calls.
|
|
12
12
|
- `reset` (optional) — wipe this cell's language kernel first.{{#ifAll py js}} Per-language: a `py` reset never touches the JS VM.{{/ifAll}}
|
|
13
13
|
|
|
14
|
-
Work incrementally
|
|
15
|
-
{{#if py}}
|
|
16
|
-
|
|
14
|
+
Work incrementally — one logical step per cell (imports, define, test, use), many small cells per call; workflow notes in the assistant message or `title`, never in cell code.
|
|
15
|
+
{{#if py}}Live event loop: use top-level `await` directly; `asyncio.run(…)` raises "cannot be called from a running event loop".{{/if}}
|
|
16
|
+
Errors name the failing cell ("Cell 3 failed") — resubmit the fixed cell + any remaining.
|
|
17
17
|
</instruction>
|
|
18
18
|
|
|
19
19
|
<prelude>
|
|
20
|
-
{{#ifAll py js}}Same helpers
|
|
20
|
+
{{#ifAll py js}}Same helpers + arg order, both runtimes. Python: sync, options = trailing kwargs. JS: async/`await`able, options = ONE trailing object literal, never positional (extras throw).{{else}}{{#if py}}Sync; options = trailing kwargs.{{/if}}{{#if js}}Async/`await`able; options = ONE trailing object literal, never positional (extras throw).{{/if}}{{/ifAll}}
|
|
21
21
|
```
|
|
22
22
|
display(value) → None
|
|
23
|
-
|
|
23
|
+
Cell output; figures/images/dataframes shown natively.
|
|
24
24
|
print(value, ...) → None
|
|
25
|
-
|
|
25
|
+
Text output.
|
|
26
26
|
read(path, offset?=1, limit?=None) → str
|
|
27
|
-
|
|
27
|
+
File as text; offset/limit 1-indexed lines. Accepts `local://…`.
|
|
28
28
|
write(path, content) → str
|
|
29
|
-
Write file (creates parents)
|
|
29
|
+
Write file (creates parents) → resolved path. `local://…` persists across turns/subagents.
|
|
30
30
|
append(path, content) → str
|
|
31
|
-
Append
|
|
31
|
+
Append → resolved path. Accepts `local://…`.
|
|
32
32
|
tree(path?=".", max_depth?=3, show_hidden?=False) → str
|
|
33
33
|
Directory tree.
|
|
34
34
|
diff(a, b) → str
|
|
@@ -36,35 +36,35 @@ diff(a, b) → str
|
|
|
36
36
|
env(key?=None, value?=None) → str | None | dict
|
|
37
37
|
No args → full env dict; one → value of `key`; two → set `key=value`, return value.
|
|
38
38
|
output(*ids, format?="raw", query?=None, offset?=None, limit?=None) → str | dict | list[dict]
|
|
39
|
-
|
|
39
|
+
Task/agent output by id; one → text/dict, multiple → list.
|
|
40
40
|
tool.<name>(args) → unknown
|
|
41
|
-
Invoke any session tool; `args`
|
|
41
|
+
Invoke any session tool; `args` = its parameter object.
|
|
42
42
|
completion(prompt, model?="default", system?=None, schema?=None) → str | dict
|
|
43
|
-
Oneshot stateless
|
|
43
|
+
Oneshot, stateless (no history/tools). `model`: "smol" fast | "default" session | "slow" most capable. `schema` (JSON-Schema) → structured output, parsed object.
|
|
44
44
|
{{#if spawns}}agent(prompt, agent_type?="task", model?=None, label?=None, schema?=None, return_handle?=False) → str | dict
|
|
45
|
-
Run a subagent
|
|
45
|
+
Run a subagent → final output. `agent_type`/`agentType` picks another discovered agent; `schema` as in completion(). Background via `local://` files named in the prompt. `return_handle`/`returnHandle` → DAG node dict { text, output, handle: "agent://<id>", id, agent } (parsed under `data` when `schema` set).
|
|
46
46
|
{{#if js}} JS: options are ONE trailing object — agent(prompt, { agentType, schema, returnHandle }).
|
|
47
47
|
{{/if}}
|
|
48
48
|
{{/if}}
|
|
49
49
|
parallel(thunks) → list
|
|
50
|
-
|
|
50
|
+
Thunks through a bounded pool (wide as a `task` batch — don't pre-shrink), input order kept; returns when all finish, a throwing thunk propagates.
|
|
51
51
|
pipeline(items, ...stages) → list
|
|
52
|
-
Map items through one-arg stages left-to-right, barrier between stages; stage 1 gets the item, later stages the previous result.
|
|
52
|
+
Map items through one-arg stages left-to-right, barrier between stages; stage 1 gets the item, later stages the previous result.
|
|
53
53
|
log(message) → None
|
|
54
54
|
Progress line above the status tree.
|
|
55
55
|
phase(title) → None
|
|
56
|
-
|
|
56
|
+
Phase grouping subsequent status lines.
|
|
57
57
|
budget → per-turn token budget
|
|
58
|
-
{{#if py}}`budget.total` (ceiling or None), `budget.spent()`, `budget.remaining()` (math.inf when no ceiling), `budget.hard
|
|
58
|
+
{{#if py}}`budget.total` (ceiling or None), `budget.spent()`, `budget.remaining()` (math.inf when no ceiling), `budget.hard`.{{/if}}{{#if js}}`await budget.total()` (ceiling or null), `await budget.spent()`, `await budget.remaining()` (Infinity when no ceiling), `await budget.hard()`.{{/if}} Ceiling: `+Nk` (advisory) or `+Nk!`/Goal Mode (hard — `agent()` won't spawn past it); spend still tracked.
|
|
59
59
|
```
|
|
60
60
|
</prelude>
|
|
61
61
|
{{#if spawns}}
|
|
62
62
|
<dag>
|
|
63
|
-
|
|
64
|
-
- **Name nodes.** Capture each `agent(…, {{#if py}}return_handle=True{{/if}}{{#if js}}{ returnHandle: true }{{/if}})` result;
|
|
65
|
-
- **Wire edges by reference.**
|
|
66
|
-
- **`pipeline(items, *stages)` = staged waves
|
|
67
|
-
- **Isolate failure.** A raising node re-raises the lowest-index error
|
|
68
|
-
- **Acyclic only.** A node never waits on its own descendant
|
|
63
|
+
Pipe handles through stage helpers to build a dependency graph — acyclic waves:
|
|
64
|
+
- **Name nodes.** Capture each `agent(…, {{#if py}}return_handle=True{{/if}}{{#if js}}{ returnHandle: true }{{/if}})` result; carries `handle` (`agent://<id>`) + `output`.
|
|
65
|
+
- **Wire edges by reference.** Put an upstream node's `handle`/`output` in the dependent stage's prompt — large transcript never re-inlined. Bulk: `write("local://<name>.md", …)`, pass the URI.
|
|
66
|
+
- **`pipeline(items, *stages)` = staged waves**, barrier between stages (every item clears stage N before any enters N+1). **`parallel(thunks)` = one wave** of independent nodes.
|
|
67
|
+
- **Isolate failure.** A raising node re-raises the lowest-index error, aborts its wave; wrap risky nodes in try/except so a failure degrades only its dependent subtree, independent branches finish.
|
|
68
|
+
- **Acyclic only.** A node never waits on its own descendant.
|
|
69
69
|
</dag>
|
|
70
70
|
{{/if}}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
Finds files and directories
|
|
1
|
+
Finds files and directories via fast pattern matching, any codebase size.
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
|
-
- `paths
|
|
5
|
-
-
|
|
6
|
-
- `
|
|
7
|
-
- `hidden` defaults to `true`; combine with `gitignore: false` to surface dotfiles that are also gitignored
|
|
8
|
-
- `limit` is clamped to 1-200 (default 200). Narrow the pattern instead of raising the limit
|
|
9
|
-
- `timeout` is in seconds (default 5, clamped to 0.5–60). On timeout, find returns whatever partial matches it has collected with `truncated: true` and a notice — increase `timeout` or narrow the pattern instead of retrying blindly
|
|
10
|
-
- You SHOULD perform multiple searches in parallel when potentially useful
|
|
4
|
+
- `paths`: array of globs, files, or directories.
|
|
5
|
+
- `gitignore` (default `true`) hides `.gitignore` matches. Set `gitignore: false` to find `.env*`, `*.log`, fresh build outputs, or anything your repo ignores.
|
|
6
|
+
- `hidden` (default `true`); combine with `gitignore: false` to surface dotfiles also gitignored.
|
|
11
7
|
</instruction>
|
|
12
8
|
|
|
13
9
|
<output>
|
|
14
|
-
Matching
|
|
10
|
+
Matching paths sorted by mtime (newest first), grouped under `# <dir>/` headers with basenames below; directories get a trailing `/`.
|
|
15
11
|
</output>
|
|
16
12
|
|
|
17
13
|
<avoid>
|
|
18
|
-
|
|
14
|
+
Open-ended searches needing multiple rounds of globbing/searching: you MUST use the Task tool instead.
|
|
19
15
|
</avoid>
|
|
20
16
|
|
|
21
17
|
<critical>
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
Op-based `gh` wrapper: repos, PRs, search, checkout, push, Actions watch. Read an issue/PR via `issue://<N>`/`pr://<N>`. PR diffs: `pr://<N>/diff` (file listing), `pr://<N>/diff/<i>` (file slice, 1-indexed), `pr://<N>/diff/all` (full diff).
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
|
-
Pick
|
|
5
|
-
- `repo_view` —
|
|
6
|
-
- `pr_create` —
|
|
7
|
-
- `pr_checkout` —
|
|
8
|
-
- `pr_push` —
|
|
9
|
-
- `search_issues` —
|
|
10
|
-
- `
|
|
11
|
-
- `
|
|
12
|
-
- `
|
|
13
|
-
- `search_repos` — Search repositories across GitHub. Optional `query` (required unless `since`/`until` is set), `limit`, `since`, `until`, `dateField` (use query qualifiers like `org:`, `language:` instead of `repo`).
|
|
14
|
-
- All `search_*` ops except `search_repos` default `repo` to the current checkout's `owner/repo` when omitted; pass an explicit `repo:`/`org:`/`user:` qualifier in `query` to search outside it.
|
|
15
|
-
- Date filter format for `since` / `until`: relative duration `<n><unit>` (`m`/`h`/`d`/`w`/`mo`/`y`, e.g. `3d`, `12h`, `2w`), an ISO date `YYYY-MM-DD`, or an ISO datetime. Translated to a single GitHub-search qualifier (`created:≥…`, `created:≤…`, or `created:since..until`). `dateField: "updated"` maps to `updated:` for issues/prs and `pushed:` for repos. When you only want a date filter and no keywords, omit `query` entirely.
|
|
16
|
-
- `run_watch` — Watch a GitHub Actions workflow run. Optional `run` (id or URL). Omitting `run` watches all workflow runs for the current HEAD commit; `branch` falls back to the current branch. Optional `tail` (log lines per failed job). Fast-fails on the first job failure and returns tailed logs for the failed jobs.
|
|
4
|
+
Pick op via `op`. Beyond the field descriptions, per op:
|
|
5
|
+
- `repo_view` — omit `repo` to view the current checkout.
|
|
6
|
+
- `pr_create` — `head` defaults to the current branch.
|
|
7
|
+
- `pr_checkout` — checks PR(s) out into dedicated git worktrees, not your working tree; pass an array of `pr` to batch multiple in one call.
|
|
8
|
+
- `pr_push` — requires the branch to have been checked out first via `op: pr_checkout`.
|
|
9
|
+
- `search_issues`/`search_prs`/`search_commits`/`search_repos` — `query` is optional when `since`/`until` is set (omit it for a date-only filter). `search_code` supports neither: `query` is required and `since`/`until` are rejected.
|
|
10
|
+
- `search_*` default `repo` to the current checkout's `owner/repo`; pass a `repo:`/`org:`/`user:` qualifier in `query` to search elsewhere. `search_repos` is the exception — it ignores `repo`; scope it with `org:`/`language:` qualifiers in `query`.
|
|
11
|
+
- `since`/`until` — relative duration (`<n>` + `m`/`h`/`d`/`w`/`mo`/`y`, e.g. `3d`, `2w`), ISO date (`YYYY-MM-DD`), or ISO datetime. `dateField: "updated"` filters on update time (issues/PRs) or push time (repos), not creation.
|
|
12
|
+
- `run_watch` — omit `run` to watch every run for the current HEAD (`branch` falls back to current). Fast-fails on the first job failure.
|
|
17
13
|
</instruction>
|
|
18
14
|
|
|
19
15
|
<output>
|
|
20
|
-
|
|
16
|
+
Concise summary per op. `run_watch` failures save full logs to a session artifact.
|
|
21
17
|
</output>
|
|
@@ -7,12 +7,5 @@ Use a single `op` field:
|
|
|
7
7
|
- `complete` marks the goal complete after you have verified every deliverable against current evidence.
|
|
8
8
|
- `drop` discards the current goal without completing it.
|
|
9
9
|
|
|
10
|
-
Examples:
|
|
11
|
-
- `goal({"op":"create","objective":"Implement feature X","token_budget":50000})`
|
|
12
|
-
- `goal({"op":"get"})`
|
|
13
|
-
- `goal({"op":"resume"})`
|
|
14
|
-
- `goal({"op":"complete"})`
|
|
15
|
-
- `goal({"op":"drop"})`
|
|
16
|
-
|
|
17
10
|
NEVER call `complete` because a budget is low or a turn is ending. Call it only when the goal is actually done and verified.
|
|
18
11
|
If `get` shows a paused goal, call `resume` before continuing work on it.
|
|
@@ -17,7 +17,6 @@ Inspects an image file with a vision-capable model and returns compact text anal
|
|
|
17
17
|
</output>
|
|
18
18
|
|
|
19
19
|
<critical>
|
|
20
|
-
- Parameters are strict: only `path` and `question` are allowed
|
|
21
20
|
- If image submission is blocked by settings, the tool will fail with an actionable error
|
|
22
21
|
- If configured model does not support image input, configure a vision-capable model role before retrying
|
|
23
22
|
</critical>
|
package/src/prompts/tools/irc.md
CHANGED
|
@@ -1,42 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
Send/receive short text messages between agents in this process.
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
|
-
- Main agent is `Main`; subagents reuse their task id (`AuthLoader`,
|
|
4
|
+
- Main agent is `Main`; subagents reuse their task id (`AuthLoader`, `AuthLoader-2` on repeat).
|
|
5
5
|
- `op: "list"` — peers with status (`running` | `idle` | `parked`), unread count, parent, last activity. Use when unsure who exists.
|
|
6
|
-
- `op: "send"` — fire-and-forget
|
|
7
|
-
- Messaging an `idle`/`parked` peer
|
|
8
|
-
- `
|
|
9
|
-
- `op: "
|
|
10
|
-
-
|
|
11
|
-
- `replyTo` — id of the message you are answering, so the sender can correlate.
|
|
12
|
-
- Replies arrive only when the recipient sends one. Exception: `await: true` to a peer stuck mid-turn (async execution disabled, e.g. blocked in a synchronous task spawn) gets a side-channel auto-reply from its context. For background on a peer, `read` `history://<id>` instead of interrogating it.
|
|
6
|
+
- `op: "send"` — fire-and-forget; returns per-recipient receipts immediately, NEVER waits for the recipient to act. Outcomes: delivered, or `failed` (unreachable). `to: "all"` broadcasts to live peers.
|
|
7
|
+
- Messaging an `idle`/`parked` peer wakes it — no separate revive call.
|
|
8
|
+
- `op: "wait"` — block for a message (optionally only `from` one peer); consumes + returns it. Timeout = clean "no message", not an error.
|
|
9
|
+
- `op: "inbox"` — drain pending messages without blocking.
|
|
10
|
+
- Replies arrive only when the recipient sends one. For peer background, `read` `history://<id>`, don't interrogate.
|
|
13
11
|
</instruction>
|
|
14
12
|
|
|
15
13
|
<when_to_use>
|
|
16
|
-
Reach for `irc`
|
|
17
|
-
- **Unexpected state** — missing file, config contradicting the assignment, API/tool behaving differently than told. DM `Main` (or your spawner)
|
|
18
|
-
- **Blocked by another agent** — a peer holds the file/branch/resource
|
|
19
|
-
- **Decision outside your scope** — a genuine fork the assignment didn't pre-decide. Ask the requester
|
|
20
|
-
- **Coordination** — a peer's in-flight work overlaps yours (
|
|
14
|
+
Reach for `irc` when going alone is wasteful or wrong; when in doubt, message.
|
|
15
|
+
- **Unexpected state** — missing file, config contradicting the assignment, API/tool behaving differently than told. DM `Main` (or your spawner), don't guess.
|
|
16
|
+
- **Blocked by another agent** — a peer holds the file/branch/resource/decision you need, or started your change. DM them (or broadcast to find who) before duplicating work.
|
|
17
|
+
- **Decision outside your scope** — a genuine fork the assignment didn't pre-decide. Ask the requester, don't pick unilaterally.
|
|
18
|
+
- **Coordination** — a peer's in-flight work overlaps yours (roster shows each peer's role + activity); message before editing a shared file or duplicating a sibling's change.
|
|
21
19
|
|
|
22
20
|
NEVER for: routine progress updates, things a tool call can verify, questions your assignment/repo/docs already answer.
|
|
23
21
|
</when_to_use>
|
|
24
22
|
|
|
25
23
|
<etiquette>
|
|
26
|
-
Applies to sending
|
|
24
|
+
Applies to sending + replying.
|
|
27
25
|
- **Plain prose only.** NEVER JSON status payloads like `{"type":"task_completed",…}` — write a normal sentence.
|
|
28
26
|
- **NEVER quote the message you answer.** Lead with the answer; set `replyTo`.
|
|
29
27
|
- **Learn about peers via IRC** — NEVER grep artifacts, read other sessions' JSONL, or shell-poke. DM them, or `read` `history://<id>`.
|
|
30
|
-
- **Send, then keep working.** `wait`/`await: true` only when you
|
|
31
|
-
- **Answer expected questions** via `irc send` to the sender (
|
|
28
|
+
- **Send, then keep working.** `wait`/`await: true` only when you cannot proceed. NEVER "did you get my message?". A `failed` receipt = peer unreachable — move on; NEVER retry in a loop.
|
|
29
|
+
- **Answer expected questions** via `irc send` to the sender (finish your current step first).
|
|
32
30
|
- **Stay terse.** One question per send; share files via `local://`/`memory://`/`artifact://` URLs, never pasted blobs.
|
|
33
31
|
- **Address peers by exact id** from `op: "list"` (e.g. `AuthLoader`, `Main`). NEVER invent friendly names.
|
|
34
32
|
- **NEVER IRC what a tool answers.** A `read`, grep, or build resolves it? Do that first.
|
|
35
33
|
</etiquette>
|
|
36
|
-
|
|
37
|
-
<output>
|
|
38
|
-
- `send`: per-recipient receipts; with `await: true`, also the reply (or timeout notice).
|
|
39
|
-
- `wait`: the consumed message, or a clean timeout notice.
|
|
40
|
-
- `inbox`: pending messages, oldest first.
|
|
41
|
-
- `list`: peers with status, unread count, parent, last activity.
|
|
42
|
-
</output>
|
package/src/prompts/tools/job.md
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
Inspects, waits, or cancels async jobs.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Results arrive automatically on completion; reach for this tool only to intervene.
|
|
4
4
|
|
|
5
5
|
# Operations
|
|
6
6
|
|
|
7
7
|
## `list: true`
|
|
8
|
-
|
|
8
|
+
Inspect what's running.
|
|
9
9
|
|
|
10
10
|
## `poll: [id, …]`
|
|
11
|
-
Block until
|
|
12
|
-
- Use when
|
|
13
|
-
-
|
|
14
|
-
- Completed jobs include their final output in the returned snapshot.
|
|
15
|
-
- With Max Poll Time set to `smart` (the default), the wait window adapts: it starts at ~5s and lengthens with each back-to-back poll (up to ~5m), then resets to ~5s after you go a while without polling. Spinning in a poll loop costs progressively more; do real work between polls.
|
|
11
|
+
Block until specified jobs finish or the wait window elapses. Omit `poll` (no `list`/`cancel`) to wait on ALL running jobs — NEVER enumerate ids you don't need to filter.
|
|
12
|
+
- Use only when genuinely blocked with no other work.
|
|
13
|
+
- Completed jobs include final output.
|
|
16
14
|
|
|
17
15
|
## `cancel: [id, …]`
|
|
18
16
|
Stop running jobs.
|
|
19
17
|
- Use when a job is stalled, hung, or no longer needed.
|
|
20
|
-
- Returns immediately after cancelling.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Capture a reusable lesson into long-term memory, and optionally mint or enhance a managed skill in the same call.
|
|
2
2
|
|
|
3
|
-
Use after solving something whose insight will pay off again: a non-obvious fix, a project convention you had to discover, a workflow that worked.
|
|
3
|
+
Use after solving something whose insight will pay off again: a non-obvious fix, a project convention you had to discover, a workflow that worked.
|
|
4
4
|
|
|
5
|
-
Provide the optional `skill` object when the lesson is a repeatable *procedure* worth codifying as a `SKILL.md` (not just a fact). Managed skills are written to an isolated directory (`~/.omp/agent/managed-skills`) and are surfaced like normal skills next session. They NEVER touch user-authored skills.
|
|
5
|
+
Provide the optional `skill` object when the lesson is a repeatable *procedure* worth codifying as a `SKILL.md` (not just a fact). Managed skills are written to an isolated directory (`~/.omp/agent/managed-skills`) and are surfaced like normal skills next session. They NEVER touch user-authored skills. Frontmatter is generated from `name` and `description`.
|
|
6
6
|
|
|
7
7
|
Capture sparingly and specifically. One strong, reusable lesson beats several vague ones.
|
package/src/prompts/tools/lsp.md
CHANGED
|
@@ -1,42 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
Language Server Protocol (LSP) servers for code intelligence.
|
|
2
2
|
|
|
3
3
|
<operations>
|
|
4
|
-
- `diagnostics`:
|
|
5
|
-
- `definition`:
|
|
6
|
-
- `type_definition`:
|
|
7
|
-
- `implementation`:
|
|
8
|
-
- `references`:
|
|
9
|
-
- `hover`:
|
|
10
|
-
- `symbols`:
|
|
11
|
-
- `rename`:
|
|
12
|
-
- `rename_file`:
|
|
13
|
-
- `code_actions`:
|
|
14
|
-
- `status`:
|
|
15
|
-
- `capabilities`:
|
|
16
|
-
- `request`:
|
|
17
|
-
- `reload`:
|
|
4
|
+
- `diagnostics`: errors/warnings for a file, glob, or workspace (`file: "*"`)
|
|
5
|
+
- `definition`: symbol definition
|
|
6
|
+
- `type_definition`: symbol's type definition
|
|
7
|
+
- `implementation`: concrete implementations
|
|
8
|
+
- `references`: all references
|
|
9
|
+
- `hover`: type info / docs
|
|
10
|
+
- `symbols`: list file symbols, or search workspace with `file: "*"` + `query`
|
|
11
|
+
- `rename`: rename symbol codebase-wide
|
|
12
|
+
- `rename_file`: rename/move a file/directory; updates import paths + other references
|
|
13
|
+
- `code_actions`: list quick-fixes/refactors/import actions; apply one when `apply: true` + `query` matches title or index
|
|
14
|
+
- `status`: active language servers
|
|
15
|
+
- `capabilities`: per-server capabilities
|
|
16
|
+
- `request`: raw LSP request — `query` = method name (e.g. `rust-analyzer/expandMacro`, `workspace/executeCommand`); `payload` = JSON params
|
|
17
|
+
- `reload`: restart one server (via `file`) or all (`file: "*"`)
|
|
18
18
|
</operations>
|
|
19
19
|
|
|
20
20
|
<parameters>
|
|
21
|
-
- `file`:
|
|
22
|
-
- `line`: 1-indexed line
|
|
23
|
-
- `symbol`:
|
|
24
|
-
- `query`:
|
|
25
|
-
- `new_name`:
|
|
26
|
-
- `apply`:
|
|
27
|
-
- `payload`: JSON
|
|
28
|
-
- `timeout`:
|
|
21
|
+
- `file`: path, glob (e.g. `src/**/*.ts`), or `"*"` for workspace scope
|
|
22
|
+
- `line`: 1-indexed line for position-based actions
|
|
23
|
+
- `symbol`: substring on the target line. Append `#N` for the Nth occurrence — e.g. `foo#2` = second `foo`.
|
|
24
|
+
- `query`: symbol search, code-action kind filter/selector (list/apply mode), or LSP method name when `action: request`
|
|
25
|
+
- `new_name`: required for `rename` (new identifier) and `rename_file` (destination path)
|
|
26
|
+
- `apply`: apply edits for rename/rename_file/code_actions (default true for rename/rename_file; code_actions list mode unless true)
|
|
27
|
+
- `payload`: JSON params for `action: request`
|
|
28
|
+
- `timeout`: seconds
|
|
29
29
|
</parameters>
|
|
30
30
|
|
|
31
31
|
<caution>
|
|
32
|
-
-
|
|
33
|
-
- Some operations require file to be saved to disk
|
|
34
|
-
- Glob expansion samples up to 20 files per request; use `file: "*"` for broader coverage
|
|
35
|
-
- When `symbol` is provided for position-based actions, missing symbols or out-of-bounds `#N` occurrence selectors return an explicit error instead of silently falling back
|
|
32
|
+
- Missing `symbol` or out-of-bounds `#N` → explicit error.
|
|
36
33
|
</caution>
|
|
37
34
|
|
|
38
35
|
<critical>
|
|
39
|
-
- You MUST use `lsp` for symbol-aware operations (rename,
|
|
40
|
-
- You NEVER perform cross-file renames with `ast_edit`, `sed`, or manual edits when `lsp` `rename` can do it. Text-based renames miss shadowing, re-exports, and usages
|
|
41
|
-
- You SHOULD use `lsp` `code_actions` for imports, quick-fixes, and refactors the
|
|
36
|
+
- You MUST use `lsp` for symbol-aware operations (rename, references, definition/implementation, code actions) whenever a language server is available — safer and more accurate than text-based alternatives.
|
|
37
|
+
- You NEVER perform cross-file renames with `ast_edit`, `sed`, or manual edits when `lsp` `rename` can do it. Text-based renames miss shadowing, re-exports, and cross-file usages.
|
|
38
|
+
- You SHOULD use `lsp` `code_actions` for imports, quick-fixes, and refactors the server already applies.
|
|
42
39
|
</critical>
|
|
@@ -2,8 +2,8 @@ Create, update, or delete a managed skill — a `SKILL.md` written to an isolate
|
|
|
2
2
|
|
|
3
3
|
Managed skills are for repeatable procedures worth codifying: a setup sequence, a debugging recipe, a project-specific workflow. They are kept separate from user-authored skills and this tool NEVER edits those.
|
|
4
4
|
|
|
5
|
-
- `action: "create"` —
|
|
6
|
-
- `action: "update"` —
|
|
7
|
-
- `action: "delete"` —
|
|
5
|
+
- `action: "create"` — fails if the skill already exists.
|
|
6
|
+
- `action: "update"` — overwrites the body; fails if the skill does not exist.
|
|
7
|
+
- `action: "delete"` — fails if the skill does not exist.
|
|
8
8
|
|
|
9
|
-
`name` is kebab-case (lowercase letters, digits, hyphens). `description`
|
|
9
|
+
`name` is kebab-case (lowercase letters, digits, hyphens). The `description` drives discovery, so make it specific. Do not include frontmatter in `body`; it is generated from `name` and `description`.
|
|
@@ -1,50 +1,48 @@
|
|
|
1
|
-
Read files, directories, archives, SQLite
|
|
1
|
+
Read files, directories, archives, SQLite, images, documents, internal resources, and web URLs via one `path`.
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
|
-
-
|
|
5
|
-
-
|
|
4
|
+
- SHOULD parallelize independent reads.
|
|
5
|
+
- SHOULD use `read` (not a browser tool) for web content; browser only when `read` can't deliver.
|
|
6
6
|
</instruction>
|
|
7
7
|
|
|
8
8
|
## Parameters
|
|
9
9
|
|
|
10
|
-
- `path` — required. Local path, internal URI (`skill://`, `agent://`, `artifact://`, `history://`, `memory://`, `rule://`, `local://`, `vault://`, `mcp://`, `omp://`, `issue://`, `pr://`), or URL. Append `:<sel>` for
|
|
10
|
+
- `path` — required. Local path, internal URI (`skill://`, `agent://`, `artifact://`, `history://`, `memory://`, `rule://`, `local://`, `vault://`, `mcp://`, `omp://`, `issue://`, `pr://`), or URL. Append `:<sel>` for ranges/modes (e.g. `src/foo.ts:50-200`, `src/foo.ts:raw`, `db.sqlite:users:42`).
|
|
11
11
|
|
|
12
12
|
## Selectors
|
|
13
13
|
|
|
14
|
-
Append `:<sel>` to `path`; bare path = default mode.
|
|
15
|
-
|
|
16
14
|
- _(none)_ — parseable code → structural summary; other files → from start (up to {{DEFAULT_LIMIT}} lines).
|
|
17
15
|
- `:50` / `:50-` — from line 50 onward.
|
|
18
16
|
- `:50-200` — lines 50–200 inclusive.
|
|
19
|
-
- `:50+150` — 150 lines
|
|
20
|
-
- `:20+1` — anchor line 20
|
|
21
|
-
- `:5-16,960-973` — multiple ranges in one call
|
|
22
|
-
- `:raw` — verbatim; no anchors
|
|
23
|
-
- `:2-4:raw` / `:raw:2-4` — range AND verbatim;
|
|
17
|
+
- `:50+150` — 150 lines from 50.
|
|
18
|
+
- `:20+1` — anchor line 20.
|
|
19
|
+
- `:5-16,960-973` — multiple ranges in one call.
|
|
20
|
+
- `:raw` — verbatim; no anchors/summary/line prefixes.
|
|
21
|
+
- `:2-4:raw` / `:raw:2-4` — range AND verbatim; either order.
|
|
24
22
|
- `:conflicts` — one line per unresolved git merge conflict block.
|
|
25
23
|
|
|
26
24
|
# Files
|
|
27
25
|
|
|
28
|
-
- Directory
|
|
26
|
+
- Directory → depth-limited dirent listing.
|
|
29
27
|
{{#if IS_HL_MODE}}
|
|
30
|
-
- File
|
|
28
|
+
- File + selector → snapshot tag header + numbered lines: `[src/foo.ts#1A2B]` then `41:def alpha():`. Copy `[PATH#TAG]` for anchored edits; ops use bare line numbers. NEVER fabricate the tag.
|
|
31
29
|
{{else}}
|
|
32
30
|
{{#if IS_LINE_NUMBER_MODE}}
|
|
33
|
-
- File
|
|
31
|
+
- File + selector → numbered lines: `41|def alpha():`.
|
|
34
32
|
{{/if}}
|
|
35
33
|
{{/if}}
|
|
36
|
-
- Parseable code
|
|
34
|
+
- Parseable code, no selector → **structural summary**: declarations kept, body elided with `…`. Footer names the recovery selector; re-issue ONLY the ranges you need.
|
|
37
35
|
|
|
38
36
|
# Documents & Notebooks
|
|
39
37
|
|
|
40
|
-
PDF, Word, PowerPoint, Excel, RTF, EPUB → extracted text. Notebooks (`.ipynb`) → editable `# %% [type] cell:N` text
|
|
38
|
+
PDF, Word, PowerPoint, Excel, RTF, EPUB → extracted text. Notebooks (`.ipynb`) → editable `# %% [type] cell:N` text. `:raw` bypasses the converter.
|
|
41
39
|
|
|
42
40
|
# Images
|
|
43
41
|
|
|
44
42
|
{{#if INSPECT_IMAGE_ENABLED}}
|
|
45
|
-
Image
|
|
43
|
+
Image → metadata. Visual analysis: call `inspect_image` with the path and a question.
|
|
46
44
|
{{else}}
|
|
47
|
-
Image
|
|
45
|
+
Image → decoded inline (PNG, JPEG, GIF, WEBP) for direct visual analysis.
|
|
48
46
|
{{/if}}
|
|
49
47
|
|
|
50
48
|
# Archives
|
|
@@ -63,16 +61,16 @@ For `.sqlite`, `.sqlite3`, `.db`, `.db3`:
|
|
|
63
61
|
|
|
64
62
|
# URLs
|
|
65
63
|
|
|
66
|
-
- Reader-mode
|
|
67
|
-
- `:raw` → untouched HTML; line selectors (`:50`, `:50-100`, `:50+150`) paginate the
|
|
68
|
-
- Bare `host:port` collides with
|
|
64
|
+
- Reader-mode default: HTML, GitHub issues/PRs, Stack Overflow, Wikipedia, Reddit, NPM, arXiv, RSS/Atom, JSON endpoints, PDFs → clean text/markdown.
|
|
65
|
+
- `:raw` → untouched HTML; line selectors (`:50`, `:50-100`, `:50+150`) paginate the fetch.
|
|
66
|
+
- Bare `host:port` collides with selector grammar — add a trailing slash: `https://example.com/:80`.
|
|
69
67
|
|
|
70
68
|
# Internal URIs
|
|
71
69
|
|
|
72
|
-
All
|
|
70
|
+
All URI schemes take the same line selectors. `artifact://<id>` recovers full output a bash/eval/tool result spilled or truncated. `history://<agentId>` = agent transcript; bare `history://` lists agents.
|
|
73
71
|
|
|
74
72
|
<critical>
|
|
75
|
-
-
|
|
73
|
+
- MUST use `read` for every file/directory/archive/URL inspection. `cat`, `head`, `tail`, `less`, `more`, `ls`, `tar`, `unzip`, `curl`, `wget` are FORBIDDEN bash calls, however convenient.
|
|
76
74
|
- Line ranges go in the selector (`path="src/foo.ts:50-200"`) — NEVER `sed -n`, `awk NR`, or `head`/`tail` pipelines.
|
|
77
75
|
- Summary footer names elided ranges? Re-issue ONLY those ranges. NEVER guess `..`/`…` content.
|
|
78
76
|
</critical>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
Performs string replacements in files with fuzzy whitespace matching.
|
|
2
2
|
|
|
3
3
|
<instruction>
|
|
4
|
-
- Params MUST be `{ path, edits }`; `path` is required at the top level and applies to every replacement
|
|
5
4
|
- You MUST use the smallest `old_text` that uniquely identifies the change
|
|
6
5
|
- If `old_text` is not unique, you MUST expand it with more context or use `all: true` to replace all occurrences
|
|
7
6
|
- You SHOULD prefer editing existing files over creating new ones
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
Resolves a pending action
|
|
2
|
-
- `action`
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
- `reason` is required: one short complete sentence explaining why, starting with a capital letter and ending with a period.
|
|
6
|
-
- `extra` (optional) is free-form metadata passed to the resolving tool. When the pending action is a plan-approval gate, supply `extra.title` (kebab/PascalCase slug for the approved plan filename). For preview-style pending actions (e.g. `ast_edit`), `extra` is unused.
|
|
7
|
-
|
|
8
|
-
Valid whenever a pending action exists — either a preview-style staging (e.g. `ast_edit`) or a long-lived approval gate.
|
|
9
|
-
Call fails with an error when no pending action exists.
|
|
1
|
+
Resolves a pending action — apply or discard. Valid only when a pending action exists; errors otherwise.
|
|
2
|
+
- `action` (required): `"apply"` persists/submits; `"discard"` rejects.
|
|
3
|
+
- `reason` (required): one short sentence explaining why.
|
|
4
|
+
- `extra` (optional): free-form metadata. Plan-approval gate? Supply `extra.title` (kebab/PascalCase slug = approved plan filename). Unused for preview actions (e.g. `ast_edit`).
|
|
@@ -3,7 +3,7 @@ End an active checkpoint. Rewind context to it, replacing intermediate explorati
|
|
|
3
3
|
Call immediately after `checkpoint`-started investigative work.
|
|
4
4
|
|
|
5
5
|
Requirements:
|
|
6
|
-
- `report`
|
|
6
|
+
- `report` MUST be concise, factual, and actionable.
|
|
7
7
|
- Include key findings, decisions, and any unresolved risks.
|
|
8
8
|
- AVOID raw scratch logs unless essential.
|
|
9
9
|
- You MUST call this before yielding if a checkpoint is active.
|