@oh-my-pi/pi-coding-agent 3.30.0 → 3.31.0

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 (155) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/package.json +5 -5
  3. package/src/cli/args.ts +4 -0
  4. package/src/core/agent-session.ts +29 -2
  5. package/src/core/bash-executor.ts +2 -1
  6. package/src/core/custom-commands/bundled/review/index.ts +369 -14
  7. package/src/core/custom-commands/bundled/wt/index.ts +1 -1
  8. package/src/core/session-manager.ts +158 -246
  9. package/src/core/session-storage.ts +379 -0
  10. package/src/core/settings-manager.ts +155 -4
  11. package/src/core/system-prompt.ts +62 -64
  12. package/src/core/tools/ask.ts +5 -4
  13. package/src/core/tools/bash-interceptor.ts +26 -61
  14. package/src/core/tools/bash.ts +13 -8
  15. package/src/core/tools/edit-diff.ts +11 -4
  16. package/src/core/tools/edit.ts +7 -13
  17. package/src/core/tools/find.ts +111 -50
  18. package/src/core/tools/gemini-image.ts +128 -147
  19. package/src/core/tools/grep.ts +397 -415
  20. package/src/core/tools/index.test.ts +5 -1
  21. package/src/core/tools/index.ts +6 -8
  22. package/src/core/tools/ls.ts +12 -10
  23. package/src/core/tools/lsp/client.ts +58 -9
  24. package/src/core/tools/lsp/config.ts +205 -656
  25. package/src/core/tools/lsp/defaults.json +465 -0
  26. package/src/core/tools/lsp/index.ts +55 -32
  27. package/src/core/tools/lsp/rust-analyzer.ts +49 -10
  28. package/src/core/tools/lsp/types.ts +1 -0
  29. package/src/core/tools/lsp/utils.ts +1 -1
  30. package/src/core/tools/read.ts +150 -74
  31. package/src/core/tools/render-utils.ts +70 -10
  32. package/src/core/tools/review.ts +38 -126
  33. package/src/core/tools/task/artifacts.ts +5 -4
  34. package/src/core/tools/task/executor.ts +94 -83
  35. package/src/core/tools/task/index.ts +129 -92
  36. package/src/core/tools/task/parallel.ts +30 -3
  37. package/src/core/tools/task/render.ts +85 -39
  38. package/src/core/tools/task/types.ts +15 -6
  39. package/src/core/tools/task/worker.ts +124 -89
  40. package/src/core/tools/web-fetch.ts +112 -377
  41. package/src/core/tools/{web-fetch-handlers → web-scrapers}/artifacthub.ts +6 -1
  42. package/src/core/tools/{web-fetch-handlers → web-scrapers}/arxiv.ts +8 -4
  43. package/src/core/tools/{web-fetch-handlers → web-scrapers}/aur.ts +6 -2
  44. package/src/core/tools/{web-fetch-handlers → web-scrapers}/biorxiv.ts +6 -1
  45. package/src/core/tools/{web-fetch-handlers → web-scrapers}/bluesky.ts +10 -3
  46. package/src/core/tools/{web-fetch-handlers → web-scrapers}/brew.ts +6 -2
  47. package/src/core/tools/{web-fetch-handlers → web-scrapers}/cheatsh.ts +6 -1
  48. package/src/core/tools/{web-fetch-handlers → web-scrapers}/chocolatey.ts +6 -1
  49. package/src/core/tools/web-scrapers/choosealicense.ts +110 -0
  50. package/src/core/tools/web-scrapers/cisa-kev.ts +100 -0
  51. package/src/core/tools/web-scrapers/clojars.ts +180 -0
  52. package/src/core/tools/{web-fetch-handlers → web-scrapers}/coingecko.ts +6 -1
  53. package/src/core/tools/{web-fetch-handlers → web-scrapers}/crates-io.ts +7 -2
  54. package/src/core/tools/web-scrapers/crossref.ts +149 -0
  55. package/src/core/tools/{web-fetch-handlers → web-scrapers}/devto.ts +8 -4
  56. package/src/core/tools/{web-fetch-handlers → web-scrapers}/discogs.ts +6 -1
  57. package/src/core/tools/web-scrapers/discourse.ts +221 -0
  58. package/src/core/tools/{web-fetch-handlers → web-scrapers}/dockerhub.ts +7 -3
  59. package/src/core/tools/web-scrapers/fdroid.ts +158 -0
  60. package/src/core/tools/web-scrapers/firefox-addons.ts +214 -0
  61. package/src/core/tools/web-scrapers/flathub.ts +239 -0
  62. package/src/core/tools/{web-fetch-handlers → web-scrapers}/github-gist.ts +6 -2
  63. package/src/core/tools/{web-fetch-handlers → web-scrapers}/github.ts +63 -32
  64. package/src/core/tools/{web-fetch-handlers → web-scrapers}/gitlab.ts +31 -19
  65. package/src/core/tools/{web-fetch-handlers → web-scrapers}/go-pkg.ts +8 -4
  66. package/src/core/tools/{web-fetch-handlers → web-scrapers}/hackage.ts +6 -1
  67. package/src/core/tools/{web-fetch-handlers → web-scrapers}/hackernews.ts +18 -18
  68. package/src/core/tools/{web-fetch-handlers → web-scrapers}/hex.ts +3 -3
  69. package/src/core/tools/{web-fetch-handlers → web-scrapers}/huggingface.ts +10 -10
  70. package/src/core/tools/{web-fetch-handlers → web-scrapers}/iacr.ts +8 -4
  71. package/src/core/tools/web-scrapers/index.ts +250 -0
  72. package/src/core/tools/web-scrapers/jetbrains-marketplace.ts +169 -0
  73. package/src/core/tools/web-scrapers/lemmy.ts +220 -0
  74. package/src/core/tools/{web-fetch-handlers → web-scrapers}/lobsters.ts +3 -3
  75. package/src/core/tools/{web-fetch-handlers → web-scrapers}/mastodon.ts +11 -3
  76. package/src/core/tools/{web-fetch-handlers → web-scrapers}/maven.ts +6 -1
  77. package/src/core/tools/{web-fetch-handlers → web-scrapers}/mdn.ts +2 -2
  78. package/src/core/tools/{web-fetch-handlers → web-scrapers}/metacpan.ts +13 -7
  79. package/src/core/tools/web-scrapers/musicbrainz.ts +273 -0
  80. package/src/core/tools/{web-fetch-handlers → web-scrapers}/npm.ts +12 -5
  81. package/src/core/tools/{web-fetch-handlers → web-scrapers}/nuget.ts +9 -5
  82. package/src/core/tools/{web-fetch-handlers → web-scrapers}/nvd.ts +6 -1
  83. package/src/core/tools/web-scrapers/ollama.ts +267 -0
  84. package/src/core/tools/web-scrapers/open-vsx.ts +119 -0
  85. package/src/core/tools/{web-fetch-handlers → web-scrapers}/opencorporates.ts +2 -0
  86. package/src/core/tools/{web-fetch-handlers → web-scrapers}/openlibrary.ts +18 -12
  87. package/src/core/tools/web-scrapers/orcid.ts +299 -0
  88. package/src/core/tools/{web-fetch-handlers → web-scrapers}/osv.ts +6 -1
  89. package/src/core/tools/{web-fetch-handlers → web-scrapers}/packagist.ts +6 -2
  90. package/src/core/tools/{web-fetch-handlers → web-scrapers}/pub-dev.ts +3 -3
  91. package/src/core/tools/{web-fetch-handlers → web-scrapers}/pubmed.ts +8 -4
  92. package/src/core/tools/{web-fetch-handlers → web-scrapers}/pypi.ts +7 -3
  93. package/src/core/tools/web-scrapers/rawg.ts +124 -0
  94. package/src/core/tools/{web-fetch-handlers → web-scrapers}/readthedocs.ts +7 -3
  95. package/src/core/tools/{web-fetch-handlers → web-scrapers}/reddit.ts +6 -2
  96. package/src/core/tools/{web-fetch-handlers → web-scrapers}/repology.ts +6 -1
  97. package/src/core/tools/{web-fetch-handlers → web-scrapers}/rfc.ts +7 -3
  98. package/src/core/tools/{web-fetch-handlers → web-scrapers}/rubygems.ts +6 -1
  99. package/src/core/tools/web-scrapers/searchcode.ts +217 -0
  100. package/src/core/tools/{web-fetch-handlers → web-scrapers}/sec-edgar.ts +6 -1
  101. package/src/core/tools/{web-fetch-handlers → web-scrapers}/semantic-scholar.ts +2 -2
  102. package/src/core/tools/web-scrapers/snapcraft.ts +200 -0
  103. package/src/core/tools/web-scrapers/sourcegraph.ts +373 -0
  104. package/src/core/tools/web-scrapers/spdx.ts +121 -0
  105. package/src/core/tools/{web-fetch-handlers → web-scrapers}/spotify.ts +3 -3
  106. package/src/core/tools/{web-fetch-handlers → web-scrapers}/stackoverflow.ts +3 -2
  107. package/src/core/tools/{web-fetch-handlers → web-scrapers}/terraform.ts +11 -3
  108. package/src/core/tools/{web-fetch-handlers → web-scrapers}/tldr.ts +6 -2
  109. package/src/core/tools/{web-fetch-handlers → web-scrapers}/twitter.ts +15 -3
  110. package/src/core/tools/{web-fetch-handlers → web-scrapers}/types.ts +98 -27
  111. package/src/core/tools/web-scrapers/utils.ts +162 -0
  112. package/src/core/tools/{web-fetch-handlers → web-scrapers}/vimeo.ts +3 -3
  113. package/src/core/tools/web-scrapers/vscode-marketplace.ts +195 -0
  114. package/src/core/tools/web-scrapers/w3c.ts +163 -0
  115. package/src/core/tools/{web-fetch-handlers → web-scrapers}/wikidata.ts +13 -5
  116. package/src/core/tools/{web-fetch-handlers → web-scrapers}/wikipedia.ts +7 -3
  117. package/src/core/tools/{web-fetch-handlers → web-scrapers}/youtube.ts +72 -20
  118. package/src/core/tools/write.ts +21 -18
  119. package/src/core/voice.ts +3 -2
  120. package/src/lib/worktree/collapse.ts +2 -1
  121. package/src/lib/worktree/git.ts +2 -18
  122. package/src/main.ts +59 -3
  123. package/src/modes/interactive/components/extensions/extension-dashboard.ts +33 -19
  124. package/src/modes/interactive/components/extensions/extension-list.ts +15 -8
  125. package/src/modes/interactive/components/hook-editor.ts +2 -1
  126. package/src/modes/interactive/components/model-selector.ts +19 -4
  127. package/src/modes/interactive/interactive-mode.ts +41 -38
  128. package/src/modes/interactive/theme/theme.ts +58 -58
  129. package/src/modes/rpc/rpc-mode.ts +10 -9
  130. package/src/prompts/review-request.md +27 -0
  131. package/src/prompts/reviewer.md +64 -68
  132. package/src/prompts/tools/output.md +22 -3
  133. package/src/prompts/tools/task.md +32 -33
  134. package/src/utils/clipboard.ts +2 -1
  135. package/examples/extensions/subagent/agents/reviewer.md +0 -35
  136. package/src/core/tools/web-fetch-handlers/index.ts +0 -69
  137. package/src/core/tools/web-fetch-handlers/utils.ts +0 -91
  138. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/academic.test.ts +0 -0
  139. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/business.test.ts +0 -0
  140. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/dev-platforms.test.ts +0 -0
  141. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/documentation.test.ts +0 -0
  142. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/finance-media.test.ts +0 -0
  143. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/git-hosting.test.ts +0 -0
  144. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/media.test.ts +0 -0
  145. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/package-managers-2.test.ts +0 -0
  146. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/package-managers.test.ts +0 -0
  147. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/package-registries.test.ts +0 -0
  148. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/research.test.ts +0 -0
  149. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/security.test.ts +0 -0
  150. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/social-extended.test.ts +0 -0
  151. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/social.test.ts +0 -0
  152. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/stackexchange.test.ts +0 -0
  153. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/standards.test.ts +0 -0
  154. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/wikipedia.test.ts +0 -0
  155. /package/src/core/tools/{web-fetch-handlers → web-scrapers}/youtube.test.ts +0 -0
@@ -0,0 +1,27 @@
1
+ ## Code Review Request
2
+
3
+ ### Mode
4
+ {MODE}
5
+
6
+ ### Changed Files ({FILE_COUNT} files, +{LINES_ADDED}/-{LINES_REMOVED} lines)
7
+
8
+ {FILE_TABLE}
9
+
10
+ {EXCLUDED_SECTION}
11
+
12
+ ### Distribution Guidelines
13
+
14
+ {DISTRIBUTION_GUIDANCE}
15
+
16
+ {GROUPING_GUIDANCE}
17
+
18
+ ### Reviewer Instructions
19
+
20
+ Each reviewer agent should:
21
+ 1. Focus ONLY on its assigned files
22
+ 2. {DIFF_INSTRUCTION}
23
+ 3. Read full file context as needed via the `read` tool
24
+ 4. Call `report_finding` for each issue found
25
+ 5. Call `complete` with verdict when done
26
+
27
+ {DIFF_SECTION}
@@ -1,81 +1,77 @@
1
1
  ---
2
2
  name: reviewer
3
3
  description: Code review specialist for quality and security analysis
4
- tools: read, grep, find, ls, bash, report_finding, submit_review
5
- spawns: explore
4
+ tools: read, grep, find, ls, bash, report_finding
5
+ spawns: explore, task
6
6
  model: pi/slow, gpt-5.2-codex, gpt-5.2, codex, gpt
7
7
  ---
8
8
 
9
- You are acting as a reviewer for a proposed code change made by another engineer.
9
+ You are a senior engineer reviewing a proposed code change. Your goal: identify bugs that the author would want to fix before merging.
10
10
 
11
- Bash is for read-only commands only: `git diff`, `git log`, `git show`, `gh pr diff`. Do NOT modify files or run builds.
11
+ # Strategy
12
12
 
13
- # Review Strategy
13
+ 1. Run `git diff` (or `gh pr diff <number>`) to see the patch
14
+ 2. Read modified files for full context
15
+ 3. For large changes, spawn parallel `task` agents (one per module/concern)
16
+ 4. Call `report_finding` for each issue
17
+ 5. Call `complete` with your verdict — **review is incomplete until `complete` is called**
14
18
 
15
- 1. Run `git diff` (or `gh pr diff <number>`) to see the changes
16
- 2. Read the modified files for full context
17
- 3. For large changes spanning multiple files/modules, use `task` with `explore` agents in parallel to gather context faster
18
- 4. Analyze for bugs, security issues, and code quality problems
19
- 5. Use `report_finding` for each issue found
20
- 6. Use `submit_review` to provide final verdict
19
+ Bash is read-only: `git diff`, `git log`, `git show`, `gh pr diff`. No file modifications or builds.
21
20
 
22
- # Parallelization
21
+ # What to Flag
23
22
 
24
- For reviews touching many files, spawn `explore` agents to research in parallel:
25
- - Each agent can investigate a different module or concern
26
- - Example: one explores test coverage, another checks related implementations
27
- - Gather their findings, then synthesize into your review
23
+ Report an issue only when ALL conditions hold:
28
24
 
29
- # What to Flag
25
+ - **Provable impact**: You can show specific code paths affected (no speculation)
26
+ - **Actionable**: Discrete fix, not a vague "consider improving X"
27
+ - **Unintentional**: Clearly not a deliberate design choice
28
+ - **Introduced in this patch**: Don't flag pre-existing bugs
29
+ - **No unstated assumptions**: Bug doesn't rely on assumptions about codebase or author's intent
30
+ - **Proportionate rigor**: Fix doesn't demand rigor not present elsewhere in the codebase
31
+
32
+ # Priority
33
+
34
+ | Level | Criteria | Example |
35
+ | ----- | ----------------------------------------------------------- | ---------------------------- |
36
+ | P0 | Blocks release/operations; universal (no input assumptions) | Data corruption, auth bypass |
37
+ | P1 | High; fix next cycle | Race condition under load |
38
+ | P2 | Medium; fix eventually | Edge case mishandling |
39
+ | P3 | Info; nice to have | Suboptimal but correct |
40
+
41
+ # Writing Findings
42
+
43
+ - **Title**: Imperative, ≤80 chars (e.g., `Handle null response from API`)
44
+ - **Body**: One paragraph. State the bug, trigger condition, and impact. Neutral tone.
45
+ - **Suggestion blocks**: Only for concrete replacement code. Preserve exact whitespace. No commentary inside.
46
+
47
+ <example>
48
+ <title>Validate input length before buffer copy</title>
49
+ <body>When `data.length > BUFFER_SIZE`, `memcpy` writes past the buffer boundary. This occurs if the API returns oversized payloads, causing heap corruption.</body>
50
+ ```suggestion
51
+ if (data.length > BUFFER_SIZE) return -EINVAL;
52
+ memcpy(buf, data.ptr, data.length);
53
+ ```
54
+ </example>
55
+
56
+ # Output Format
57
+
58
+ Each `report_finding` requires:
59
+
60
+ - `title`: ≤80 chars, imperative
61
+ - `body`: One paragraph
62
+ - `priority`: 0-3
63
+ - `confidence`: 0.0-1.0
64
+ - `file_path`: Absolute path
65
+ - `line_start`, `line_end`: Range ≤10 lines, must overlap the diff
66
+
67
+ Final `complete` call:
68
+
69
+ - `overall_correctness`: "correct" (no bugs/blockers) or "incorrect"
70
+ - `explanation`: 1-3 sentences
71
+ - `confidence`: 0.0-1.0
72
+
73
+ Correctness judgment ignores non-blocking issues (style, docs, nits).
74
+
75
+ # Critical Reminder
30
76
 
31
- Only flag issues where ALL of these apply:
32
-
33
- 1. It meaningfully impacts the accuracy, performance, security, or maintainability of the code
34
- 2. The bug is discrete and actionable (not a general issue or combination of multiple issues)
35
- 3. Fixing it doesn't demand rigor not present elsewhere in the codebase
36
- 4. The bug was introduced in this commit (don't flag pre-existing bugs)
37
- 5. The author would likely fix the issue if made aware of it
38
- 6. The bug doesn't rely on unstated assumptions about the codebase or author's intent
39
- 7. You can identify specific code that is provably affected (speculation is not enough)
40
- 8. The issue is clearly not an intentional change by the author
41
-
42
- # Priority Levels
43
-
44
- - **P0**: Drop everything to fix. Blocking release, operations, or major usage. Only use for universal issues that do not depend on assumptions about inputs.
45
- - **P1**: Urgent. Should be addressed in the next cycle.
46
- - **P2**: Normal. To be fixed eventually.
47
- - **P3**: Low. Nice to have.
48
-
49
- # Comment Guidelines
50
-
51
- 1. Be clear about WHY the issue is a bug
52
- 2. Communicate severity appropriately - don't overstate
53
- 3. Keep body to one paragraph max
54
- 4. Code snippets should be ≤3 lines, wrapped in markdown code tags
55
- 5. Clearly state what conditions are necessary for the bug to arise
56
- 6. Tone: matter-of-fact, not accusatory or overly positive
57
- 7. Write so the author can immediately grasp the idea without close reading
58
- 8. Avoid flattery and phrases like "Great job...", "Thanks for..."
59
- 9. Use ```suggestion blocks ONLY for concrete replacement code (minimal lines; no commentary inside the block)
60
- 10. In every ```suggestion block, preserve the exact leading whitespace of the replaced lines (spaces vs tabs, number of spaces)
61
-
62
- # CRITICAL
63
-
64
- You MUST call `submit_review` before ending your response, even if you found no issues.
65
- The review is only considered complete when `submit_review` is called.
66
- Failure to call `submit_review` means the review was not submitted.
67
-
68
- # Output
69
-
70
- - Use `report_finding` for each issue. Continue until you've listed every qualifying finding.
71
- - Each `report_finding` must include: title (<=80 chars, imperative, prefixed `[P0-P3]`), body (one paragraph), priority (0-3), confidence (0.0-1.0), absolute `file_path`, and `line_start`/`line_end` with a range <=10 lines.
72
- - If there is no finding that a person would definitely want to fix, prefer outputting no findings.
73
- - Every finding must be anchored to a specific diff hunk; the code location must overlap the patch. If you cannot anchor it to the patch, do not report it.
74
- - Ignore trivial style unless it obscures meaning or violates documented standards.
75
- - Use `submit_review` at the end with your overall verdict:
76
- - **correct**: Existing code and tests will not break, patch is free of bugs and blocking issues
77
- - **incorrect**: Has bugs or blocking issues that must be addressed
78
-
79
- Ignore non-blocking issues (style, formatting, typos, documentation, nits) when determining correctness.
80
-
81
- At the end of the review, double-check that every finding is evidence-backed and non-speculative.
77
+ Every finding must be anchored to the patch and evidence-backed. Before submitting, verify each finding is not speculative. Then call `complete`.
@@ -16,13 +16,32 @@ Do NOT use when:
16
16
 
17
17
  ## Parameters
18
18
 
19
- - `ids`: Array of output IDs from Task results (e.g., `["reviewer_0", "explore_1"]`)
19
+ - `ids`: Array of output IDs from Task results (e.g., `["ApiAudit", "DbAudit"]`)
20
20
  - `format` (optional):
21
21
  - `"raw"` (default): Full output with ANSI codes preserved
22
22
  - `"json"`: Structured object with metadata
23
23
  - `"stripped"`: Plain text with ANSI codes removed for parsing
24
- - `query` (optional): jq-like query for JSON outputs (e.g., `.result.items[0].name`)
24
+ - `query` (optional): jq-like query for JSON outputs (e.g., `.endpoints[0].file`)
25
25
  - `offset` (optional): Line number to start reading from (1-indexed)
26
26
  - `limit` (optional): Maximum number of lines to read
27
27
 
28
- Use offset/limit for line ranges to reduce context usage on large outputs. Use `query` for JSON outputs (for example, subagent `complete` results).
28
+ Use offset/limit for line ranges to reduce context usage on large outputs. Use `query` for structured agent outputs (agents that call `complete` with `output`).
29
+
30
+ ## Query Examples
31
+
32
+ For agents returning structured data via `complete`, use `query` to extract specific fields:
33
+
34
+ ```
35
+ # Given output: { properties: { endpoints: { elements: { properties: { file, line, hasAuth } } } } }
36
+
37
+ .endpoints # Get all endpoints array
38
+ .endpoints[0] # First endpoint object
39
+ .endpoints[0].file # First endpoint's file path
40
+ .endpoints[0]["hasAuth"] # Bracket notation (equivalent to .hasAuth)
41
+ ```
42
+
43
+ Query paths:
44
+ - `.foo` - property access
45
+ - `[0]` - array index
46
+ - `.foo.bar[0].baz` - chained access
47
+ - `["special-key"]` - properties with special characters
@@ -16,9 +16,9 @@ The Task tool launches specialized agents (workers) that autonomously handle com
16
16
  ## Usage Notes
17
17
 
18
18
  - Always include a short description of the task in the task parameter
19
- - **Plan-then-execute**: Put shared constraints in `context`, keep each task focused, specify acceptance criteria; use `output_schema` when you need structured output
19
+ - **Plan-then-execute**: Put shared constraints in `context`, keep each task focused, specify acceptance criteria; use `output` when you need structured output
20
20
  - **Minimize tool chatter**: Avoid repeating large context; use Output tool with output ids for full logs
21
- - **Structured completion**: If `output_schema` is provided, subagents must call `complete` to finish
21
+ - **Structured completion**: If `output` is provided, subagents must call `complete` to finish
22
22
  - **Parallelize**: Launch multiple agents concurrently whenever possible
23
23
  - **Results are intermediate data**: Agent findings provide context for YOU to perform actual work. Do not treat agent reports as "task complete" signals.
24
24
  - **Stateless invocations**: Each agent runs autonomously and returns a single final message. Include all necessary context and specify exactly what information to return.
@@ -28,43 +28,42 @@ The Task tool launches specialized agents (workers) that autonomously handle com
28
28
 
29
29
  ## Parameters
30
30
 
31
- - `tasks`: Array of `{agent, task, description?, model?}` - tasks to run in parallel (max {{MAX_PARALLEL_TASKS}}, {{MAX_CONCURRENCY}} concurrent)
32
- - `model`: (optional) Override the agent's default model with fuzzy matching (e.g., "sonnet", "codex", "5.2"). Supports comma-separated fallbacks: "gpt, opus" tries gpt first, then opus. Use "default" for omp's default model
33
- - `context`: (optional) Shared context string prepended to all task prompts - use this to avoid repeating instructions
34
- - `output_schema`: (optional) JSON schema for structured subagent output (used by the complete tool)
31
+ - `agent`: Agent type to use for all tasks
32
+ - `context`: Shared context string prepended to all task prompts
33
+ - `model`: (optional) Model override (fuzzy matching, e.g., "sonnet", "opus")
34
+ - `tasks`: Array of `{id, task, description}` - tasks to run in parallel (max {{MAX_PARALLEL_TASKS}}, {{MAX_CONCURRENCY}} concurrent)
35
+ - `id`: Short CamelCase identifier for display (max 20 chars, e.g., "SessionStore", "LspRefactor")
36
+ - `task`: The task prompt for the agent
37
+ - `description`: Short human-readable description of what the task does
38
+ - `output`: (optional) JTD schema for structured subagent output (used by the complete tool)
35
39
 
36
- ## Examples
40
+ ## Example
37
41
 
38
42
  <example>
39
- user: "Please write a function that checks if a number is prime"
40
- assistant: Sure let me write a function that checks if a number is prime
41
- assistant: I'm going to use the Write tool to write the following code:
42
- <code>
43
- function isPrime(n) {
44
- if (n <= 1) return false
45
- for (let i = 2; i * i <= n; i++) {
46
- if (n % i === 0) return false
47
- }
48
- return true
49
- }
50
- </code>
51
- <commentary>
52
- Since a significant piece of code was written and the task was completed, now use the code-reviewer agent to review the code
53
- </commentary>
54
- assistant: Now let me use the code-reviewer agent to review the code
55
- assistant: Uses the Task tool: { tasks: [{ agent: "code-reviewer", task: "Review the isPrime function" }] }
56
- </example>
57
-
58
- <example>
59
- user: "Find all TODO comments in the codebase"
60
- assistant: I'll use multiple explore agents to search different directories in parallel
43
+ user: "Extract all hardcoded strings for i18n"
44
+ assistant: I'll scan UI components and return structured string locations for internationalization.
61
45
  assistant: Uses the Task tool:
62
46
  {
63
- "context": "Find all TODO comments. Return file:line:content format.",
47
+ "agent": "explore",
48
+ "context": "Find hardcoded user-facing strings (labels, messages, errors). Ignore logs, comments, and internal identifiers.",
49
+ "output": {
50
+ "properties": {
51
+ "strings": {
52
+ "elements": {
53
+ "properties": {
54
+ "file": { "type": "string" },
55
+ "line": { "type": "uint32" },
56
+ "text": { "type": "string" },
57
+ "suggestedKey": { "type": "string" }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ },
64
63
  "tasks": [
65
- { "agent": "explore", "task": "Search in src/" },
66
- { "agent": "explore", "task": "Search in lib/" },
67
- { "agent": "explore", "task": "Search in tests/" }
64
+ { "id": "Forms", "task": "Scan src/components/forms/", "description": "Extract form strings" },
65
+ { "id": "Modals", "task": "Scan src/components/modals/", "description": "Extract modal strings" },
66
+ { "id": "Pages", "task": "Scan src/pages/", "description": "Extract page strings" }
68
67
  ]
69
68
  }
70
69
  </example>
@@ -1,4 +1,5 @@
1
1
  import { platform } from "node:os";
2
+ import { nanoid } from "nanoid";
2
3
 
3
4
  async function spawnWithTimeout(cmd: string[], input: string, timeoutMs: number): Promise<void> {
4
5
  const proc = Bun.spawn(cmd, { stdin: "pipe" });
@@ -199,7 +200,7 @@ async function readImageMacOS(timeout: number): Promise<ClipboardImage | null> {
199
200
 
200
201
  // Read the actual image data using a temp file approach
201
202
  // osascript can't output binary directly, so we write to a temp file
202
- const tempFile = `/tmp/omp-clipboard-${Date.now()}.${imageType === "png" ? "png" : "jpg"}`;
203
+ const tempFile = `/tmp/omp-clipboard-${nanoid()}.${imageType === "png" ? "png" : "jpg"}`;
203
204
  const clipboardClass = imageType === "png" ? "«class PNGf»" : "«class JPEG»";
204
205
 
205
206
  const readScript = `
@@ -1,35 +0,0 @@
1
- ---
2
- name: reviewer
3
- description: Code review specialist for quality and security analysis
4
- tools: read, grep, find, ls, bash
5
- model: claude-sonnet-4-5
6
- ---
7
-
8
- You are a senior code reviewer. Analyze code for quality, security, and maintainability.
9
-
10
- Bash is for read-only commands only: `git diff`, `git log`, `git show`. Do NOT modify files or run builds.
11
- Assume tool permissions are not perfectly enforceable; keep all bash usage strictly read-only.
12
-
13
- Strategy:
14
- 1. Run `git diff` to see recent changes (if applicable)
15
- 2. Read the modified files
16
- 3. Check for bugs, security issues, code smells
17
-
18
- Output format:
19
-
20
- ## Files Reviewed
21
- - `path/to/file.ts` (lines X-Y)
22
-
23
- ## Critical (must fix)
24
- - `file.ts:42` - Issue description
25
-
26
- ## Warnings (should fix)
27
- - `file.ts:100` - Issue description
28
-
29
- ## Suggestions (consider)
30
- - `file.ts:150` - Improvement idea
31
-
32
- ## Summary
33
- Overall assessment in 2-3 sentences.
34
-
35
- Be specific with file paths and line numbers.
@@ -1,69 +0,0 @@
1
- /**
2
- * Web Fetch Special Handlers Index
3
- *
4
- * Exports all special handlers for site-specific content extraction.
5
- */
6
-
7
- export { handleArtifactHub } from "./artifacthub";
8
- // Academic
9
- export { handleArxiv } from "./arxiv";
10
- export { handleAur } from "./aur";
11
- export { handleBiorxiv } from "./biorxiv";
12
- export { handleBluesky } from "./bluesky";
13
- export { handleBrew } from "./brew";
14
- export { handleCheatSh } from "./cheatsh";
15
- export { handleChocolatey } from "./chocolatey";
16
- export { handleCoinGecko } from "./coingecko";
17
- export { handleCratesIo } from "./crates-io";
18
- export { handleDevTo } from "./devto";
19
- export { handleDiscogs } from "./discogs";
20
- export { handleDockerHub } from "./dockerhub";
21
- // Git hosting
22
- export { fetchGitHubApi, handleGitHub } from "./github";
23
- export { handleGitHubGist } from "./github-gist";
24
- export { handleGitLab } from "./gitlab";
25
- export { handleGoPkg } from "./go-pkg";
26
- export { handleHackage } from "./hackage";
27
- export { handleHackerNews } from "./hackernews";
28
- export { handleHex } from "./hex";
29
- // ML/AI
30
- export { handleHuggingFace } from "./huggingface";
31
- export { handleIacr } from "./iacr";
32
- export { handleLobsters } from "./lobsters";
33
- export { handleMastodon } from "./mastodon";
34
- export { handleMaven } from "./maven";
35
- export { handleMDN } from "./mdn";
36
- export { handleMetaCPAN } from "./metacpan";
37
- // Package registries
38
- export { handleNpm } from "./npm";
39
- export { handleNuGet } from "./nuget";
40
- export { handleNvd } from "./nvd";
41
- export { handleOpenCorporates } from "./opencorporates";
42
- export { handleOpenLibrary } from "./openlibrary";
43
- export { handleOsv } from "./osv";
44
- export { handlePackagist } from "./packagist";
45
- export { handlePubDev } from "./pub-dev";
46
- export { handlePubMed } from "./pubmed";
47
- export { handlePyPI } from "./pypi";
48
- export { handleReadTheDocs } from "./readthedocs";
49
- export { handleReddit } from "./reddit";
50
- export { handleRepology } from "./repology";
51
- export { handleRfc } from "./rfc";
52
- export { handleRubyGems } from "./rubygems";
53
- export { handleSecEdgar } from "./sec-edgar";
54
- export { handleSemanticScholar } from "./semantic-scholar";
55
- export { handleSpotify } from "./spotify";
56
- // Developer content
57
- export { handleStackOverflow } from "./stackoverflow";
58
- export { handleTerraform } from "./terraform";
59
- export { handleTldr } from "./tldr";
60
- // Social/News
61
- export { handleTwitter } from "./twitter";
62
- export type { RenderResult, SpecialHandler } from "./types";
63
- export { handleVimeo } from "./vimeo";
64
-
65
- // Reference
66
- export { handleWikidata } from "./wikidata";
67
- export { handleWikipedia } from "./wikipedia";
68
- // Video/Media
69
- export { handleYouTube } from "./youtube";
@@ -1,91 +0,0 @@
1
- import { tmpdir } from "node:os";
2
- import * as path from "node:path";
3
- import { ensureTool } from "../../../utils/tools-manager";
4
-
5
- const MAX_BYTES = 50 * 1024 * 1024; // 50MB for binary files
6
-
7
- function exec(
8
- cmd: string,
9
- args: string[],
10
- options?: { timeout?: number; input?: string | Buffer },
11
- ): { stdout: string; stderr: string; ok: boolean } {
12
- const result = Bun.spawnSync([cmd, ...args], {
13
- stdin: options?.input ? (options.input as any) : "ignore",
14
- stdout: "pipe",
15
- stderr: "pipe",
16
- });
17
- return {
18
- stdout: result.stdout?.toString() ?? "",
19
- stderr: result.stderr?.toString() ?? "",
20
- ok: result.exitCode === 0,
21
- };
22
- }
23
-
24
- export async function convertWithMarkitdown(
25
- content: Buffer,
26
- extensionHint: string,
27
- timeout: number,
28
- ): Promise<{ content: string; ok: boolean }> {
29
- const markitdown = await ensureTool("markitdown", true);
30
- if (!markitdown) {
31
- return { content: "", ok: false };
32
- }
33
-
34
- // Write to temp file with extension hint
35
- const ext = extensionHint || ".bin";
36
- const tmpDir = tmpdir();
37
- const tmpFile = path.join(tmpDir, `omp-convert-${Date.now()}${ext}`);
38
-
39
- try {
40
- await Bun.write(tmpFile, content);
41
- const result = exec(markitdown, [tmpFile], { timeout });
42
- return { content: result.stdout, ok: result.ok };
43
- } finally {
44
- try {
45
- await Bun.$`rm ${tmpFile}`.quiet();
46
- } catch {}
47
- }
48
- }
49
-
50
- export async function fetchBinary(
51
- url: string,
52
- timeout: number,
53
- ): Promise<{ buffer: Buffer; contentType: string; contentDisposition?: string; ok: boolean }> {
54
- try {
55
- const controller = new AbortController();
56
- const timeoutId = setTimeout(() => controller.abort(), timeout * 1000);
57
-
58
- const response = await fetch(url, {
59
- signal: controller.signal,
60
- headers: {
61
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/131.0.0.0",
62
- },
63
- redirect: "follow",
64
- });
65
-
66
- clearTimeout(timeoutId);
67
-
68
- if (!response.ok) {
69
- return { buffer: Buffer.alloc(0), contentType: "", ok: false };
70
- }
71
-
72
- const contentType = response.headers.get("content-type") ?? "";
73
- const contentDisposition = response.headers.get("content-disposition") ?? undefined;
74
- const contentLength = response.headers.get("content-length");
75
- if (contentLength) {
76
- const size = Number.parseInt(contentLength, 10);
77
- if (Number.isFinite(size) && size > MAX_BYTES) {
78
- return { buffer: Buffer.alloc(0), contentType, contentDisposition, ok: false };
79
- }
80
- }
81
-
82
- const buffer = Buffer.from(await response.arrayBuffer());
83
- if (buffer.length > MAX_BYTES) {
84
- return { buffer: Buffer.alloc(0), contentType, contentDisposition, ok: false };
85
- }
86
-
87
- return { buffer, contentType, contentDisposition, ok: true };
88
- } catch {
89
- return { buffer: Buffer.alloc(0), contentType: "", ok: false };
90
- }
91
- }