@kolisachint/hoocode-agent 0.4.8 → 0.4.10
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 +2 -0
- package/dist/core/dispatch-evaluator.d.ts +31 -0
- package/dist/core/dispatch-evaluator.d.ts.map +1 -0
- package/dist/core/dispatch-evaluator.js +300 -0
- package/dist/core/dispatch-evaluator.js.map +1 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +1 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/subagent-pool.d.ts +35 -0
- package/dist/core/subagent-pool.d.ts.map +1 -1
- package/dist/core/subagent-pool.js +147 -7
- package/dist/core/subagent-pool.js.map +1 -1
- package/dist/core/subagent.d.ts +9 -1
- package/dist/core/subagent.d.ts.map +1 -1
- package/dist/core/subagent.js +23 -2
- package/dist/core/subagent.js.map +1 -1
- package/dist/core/task-store.d.ts +9 -1
- package/dist/core/task-store.d.ts.map +1 -1
- package/dist/core/task-store.js +2 -0
- package/dist/core/task-store.js.map +1 -1
- package/dist/core/tools/subagent.d.ts +5 -1
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +49 -8
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/extensions/core/hoo-core.d.ts +5 -2
- package/dist/extensions/core/hoo-core.d.ts.map +1 -1
- package/dist/extensions/core/hoo-core.js +3 -1
- package/dist/extensions/core/hoo-core.js.map +1 -1
- package/dist/init-templates.generated.d.ts +1 -0
- package/dist/init-templates.generated.d.ts.map +1 -1
- package/dist/init-templates.generated.js +8 -0
- package/dist/init-templates.generated.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +2 -2
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +9 -14
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +1 -6
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +1 -5
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/task-panel.d.ts +4 -2
- package/dist/modes/interactive/components/task-panel.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-panel.js +69 -6
- package/dist/modes/interactive/components/task-panel.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +12 -10
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +59 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/dark.json +5 -5
- package/dist/modes/interactive/theme/light.json +5 -5
- package/docs/routing.md +57 -0
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
- package/templates/agents/doc.md +35 -0
- package/templates/agents/edit.md +37 -0
- package/templates/agents/explore.md +35 -0
- package/templates/agents/review.md +36 -0
- package/templates/agents/test.md +35 -0
- package/templates/subagent/doc.md +16 -0
|
@@ -12,11 +12,11 @@
|
|
|
12
12
|
"darkGray": "#505050",
|
|
13
13
|
"accent": "#8abeb7",
|
|
14
14
|
"selectedBg": "#3a3a4a",
|
|
15
|
-
"userMsgBg": "#
|
|
16
|
-
"toolPendingBg": "#
|
|
17
|
-
"toolSuccessBg": "#
|
|
18
|
-
"toolErrorBg": "#
|
|
19
|
-
"customMsgBg": "#
|
|
15
|
+
"userMsgBg": "#1c1c26",
|
|
16
|
+
"toolPendingBg": "#1a1a24",
|
|
17
|
+
"toolSuccessBg": "#1a241a",
|
|
18
|
+
"toolErrorBg": "#241a1a",
|
|
19
|
+
"customMsgBg": "#1e1a28"
|
|
20
20
|
},
|
|
21
21
|
"colors": {
|
|
22
22
|
"accent": "accent",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"dimGray": "#767676",
|
|
12
12
|
"lightGray": "#b0b0b0",
|
|
13
13
|
"selectedBg": "#d0d0e0",
|
|
14
|
-
"userMsgBg": "#
|
|
15
|
-
"toolPendingBg": "#
|
|
16
|
-
"toolSuccessBg": "#
|
|
17
|
-
"toolErrorBg": "#
|
|
18
|
-
"customMsgBg": "#
|
|
14
|
+
"userMsgBg": "#f0f0f0",
|
|
15
|
+
"toolPendingBg": "#f0f0f5",
|
|
16
|
+
"toolSuccessBg": "#f0f5f0",
|
|
17
|
+
"toolErrorBg": "#f5f0f0",
|
|
18
|
+
"customMsgBg": "#f2f0f7"
|
|
19
19
|
},
|
|
20
20
|
"colors": {
|
|
21
21
|
"accent": "teal",
|
package/docs/routing.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Subagent Routing
|
|
2
|
+
|
|
3
|
+
HooCode uses a deterministic **dispatch evaluator** to decide whether a task should be handled inline by the main agent or delegated to a specialized subagent. No LLM call is made for this decision — it is purely keyword + heuristic based.
|
|
4
|
+
|
|
5
|
+
## How Routing Decisions Work
|
|
6
|
+
|
|
7
|
+
When the parent agent receives a task (via the `subagent` tool or a `/subagent` slash command), the `DispatchEvaluator` scans the task for keywords and estimates complexity:
|
|
8
|
+
|
|
9
|
+
- **Low complexity** (< 50 lines, 1 file, read-only or trivial edit) → handle **inline**
|
|
10
|
+
- **Medium complexity** (2–3 files, 50–200 lines) → delegate to a **single matching agent**
|
|
11
|
+
- **High complexity** (4+ files, 200+ lines, multi-domain) → **split** across multiple subagents
|
|
12
|
+
|
|
13
|
+
Keyword routing:
|
|
14
|
+
|
|
15
|
+
| Keywords | Agent type |
|
|
16
|
+
|----------|------------|
|
|
17
|
+
| explore, understand, scout, investigate, trace, find | `explore` |
|
|
18
|
+
| write, create, implement, refactor, add, build | `edit` |
|
|
19
|
+
| test, validate, assert, coverage | `test` |
|
|
20
|
+
| review, audit, critique, security, check | `review` |
|
|
21
|
+
| document, readme, comment, explain, docs | `doc` |
|
|
22
|
+
|
|
23
|
+
## When to Expect Inline vs Subagent
|
|
24
|
+
|
|
25
|
+
- **Inline** — Simple single-file changes, read-only lookups, trivial edits.
|
|
26
|
+
- **Subagent** — Anything that spans multiple files, requires isolation, or matches a specialized mode (testing, review, documentation).
|
|
27
|
+
|
|
28
|
+
If you disagree with the evaluator, you can force a subagent by setting `force=true` in the tool call or using the `/subagent <mode> <task>` slash command.
|
|
29
|
+
|
|
30
|
+
## How to Force a Subagent with `/subagent`
|
|
31
|
+
|
|
32
|
+
In interactive mode, type:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
/subagent <mode> <task>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Examples:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
/subagent explore "How does the auth middleware work?"
|
|
42
|
+
/subagent test "Run the parser unit tests"
|
|
43
|
+
/subagent review "Audit login.ts for security issues"
|
|
44
|
+
/subagent doc "Write a README for the API package"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
This bypasses the evaluator and spawns the subagent directly.
|
|
48
|
+
|
|
49
|
+
## Parallel Batches
|
|
50
|
+
|
|
51
|
+
For multi-domain tasks (e.g. "Implement X, write tests, and review"), the evaluator sets `parallelizable: true` and produces a list of subtasks. The `SubagentPool.dispatchBatch()` method spawns up to 5 concurrent subagents and returns aggregated results.
|
|
52
|
+
|
|
53
|
+
## Guardrails
|
|
54
|
+
|
|
55
|
+
- Subagents **cannot spawn subagents**. If `HOOCODE_SUBAGENT_DEPTH >= 1`, the evaluator returns `should_delegate: false`.
|
|
56
|
+
- The pool prioritizes `explore` and `review` tasks over `doc` tasks because they often block downstream work.
|
|
57
|
+
- On completion, each subagent writes its result to `.hoocode/agents/<task_id>/output.json`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolisachint/hoocode-agent",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.10",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"hoocodeConfig": {
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"prepublishOnly": "npm run clean && npm run build"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@kolisachint/hoocode-agent-core": "^0.4.
|
|
48
|
-
"@kolisachint/hoocode-ai": "^0.4.
|
|
49
|
-
"@kolisachint/hoocode-tui": "^0.4.
|
|
47
|
+
"@kolisachint/hoocode-agent-core": "^0.4.10",
|
|
48
|
+
"@kolisachint/hoocode-ai": "^0.4.10",
|
|
49
|
+
"@kolisachint/hoocode-tui": "^0.4.10",
|
|
50
50
|
"@silvia-odwyer/photon-node": "^0.3.4",
|
|
51
51
|
"chalk": "^5.5.0",
|
|
52
52
|
"cli-highlight": "^2.1.11",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: doc
|
|
3
|
+
description: |
|
|
4
|
+
Use this subagent ONLY when:
|
|
5
|
+
- Writing or updating README files
|
|
6
|
+
- Adding inline code comments or API documentation
|
|
7
|
+
- Creating user guides, tutorials, or changelogs
|
|
8
|
+
- Explaining architecture or design decisions
|
|
9
|
+
|
|
10
|
+
DO NOT use for:
|
|
11
|
+
- Modifying source logic (use edit agent)
|
|
12
|
+
- Read-only exploration (use explore agent)
|
|
13
|
+
- Code review (use review agent)
|
|
14
|
+
|
|
15
|
+
Output: Written documentation. Concise, accurate, and well-structured.
|
|
16
|
+
Cost: Low (read + write docs only)
|
|
17
|
+
Isolation: Can run in parallel with explore and review tasks
|
|
18
|
+
model: sonnet
|
|
19
|
+
---
|
|
20
|
+
You are a documentation subagent running inside hoocode. You write and update documentation. You run in an isolated context and cannot see the parent conversation.
|
|
21
|
+
|
|
22
|
+
Scope:
|
|
23
|
+
- You may read files and write documentation files (README, comments, guides). Do not modify source logic.
|
|
24
|
+
- Produce concise, accurate, and well-structured documentation.
|
|
25
|
+
|
|
26
|
+
Method:
|
|
27
|
+
1. Read the relevant source files to understand what needs documenting.
|
|
28
|
+
2. Write or update the requested documentation.
|
|
29
|
+
3. Verify that the documentation is consistent with the code.
|
|
30
|
+
|
|
31
|
+
Guidance:
|
|
32
|
+
- Focus on clarity and accuracy. Avoid unnecessary verbosity.
|
|
33
|
+
- Match the project's existing documentation style.
|
|
34
|
+
- Your final message must contain ONLY the documentation or a summary of what was written.
|
|
35
|
+
- Do not narrate intermediate steps or include tool logs.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: edit
|
|
3
|
+
description: |
|
|
4
|
+
Use this subagent ONLY when:
|
|
5
|
+
- Writing new code or creating new files
|
|
6
|
+
- Refactoring existing code across one or more files
|
|
7
|
+
- Fixing bugs or applying targeted corrections
|
|
8
|
+
- Migrating patterns or renaming symbols
|
|
9
|
+
|
|
10
|
+
DO NOT use for:
|
|
11
|
+
- Read-only exploration
|
|
12
|
+
- Running tests (use test agent)
|
|
13
|
+
- Code review (use review agent)
|
|
14
|
+
|
|
15
|
+
Output: Changed files with path:line descriptions. No narration.
|
|
16
|
+
Cost: Medium (read + write)
|
|
17
|
+
Isolation: Should not run concurrently with other edit tasks on the same files
|
|
18
|
+
model: sonnet
|
|
19
|
+
---
|
|
20
|
+
You are an edit subagent running inside hoocode. You implement one focused code change. You run in an isolated context and cannot see the parent conversation.
|
|
21
|
+
|
|
22
|
+
Scope:
|
|
23
|
+
- You may read, edit, and write files, and run commands needed to make the change.
|
|
24
|
+
- Stay strictly within the requested task. Do not refactor unrelated code.
|
|
25
|
+
|
|
26
|
+
Method:
|
|
27
|
+
1. Read the relevant files before changing them.
|
|
28
|
+
2. Match the existing style: indentation, naming, import order.
|
|
29
|
+
3. Make the smallest change that fully satisfies the task.
|
|
30
|
+
4. Verify your edits by re-reading the changed regions.
|
|
31
|
+
|
|
32
|
+
Guidance:
|
|
33
|
+
- Break down multi-file tasks. Handle one logical unit at a time.
|
|
34
|
+
- Your final answer must contain ONLY your answer — it is the only thing the caller receives.
|
|
35
|
+
- Summarize what you changed and where (path:line), and any follow-up the caller should know.
|
|
36
|
+
- Do not narrate intermediate steps or include tool logs.
|
|
37
|
+
- If you hit a blocker, stop and report it. Do not leave the codebase in a broken state.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: explore
|
|
3
|
+
description: |
|
|
4
|
+
Use this subagent ONLY when:
|
|
5
|
+
- Reading or understanding code without changes
|
|
6
|
+
- Scouting a codebase for plans or maps
|
|
7
|
+
- Analyzing dependencies, imports, project structure
|
|
8
|
+
- Investigating errors or tracing execution flow
|
|
9
|
+
- Estimating scope before edits
|
|
10
|
+
|
|
11
|
+
DO NOT use for:
|
|
12
|
+
- Writing or modifying code
|
|
13
|
+
- Running tests or linting
|
|
14
|
+
- Reviewing code quality
|
|
15
|
+
|
|
16
|
+
Output: Concise summary, file list, or plan. No code changes.
|
|
17
|
+
Cost: Low (read-only)
|
|
18
|
+
Isolation: Can run in parallel with other explore tasks
|
|
19
|
+
model: sonnet
|
|
20
|
+
---
|
|
21
|
+
You are an explore-only agent running inside hoocode. You read code and produce summaries. You NEVER edit files.
|
|
22
|
+
|
|
23
|
+
Scope:
|
|
24
|
+
- READ ONLY. Do not modify, create, or delete files.
|
|
25
|
+
- Use read, grep, find, and ls (and read-only shell commands) to locate and understand code.
|
|
26
|
+
|
|
27
|
+
Method:
|
|
28
|
+
1. Break the task into concrete questions.
|
|
29
|
+
2. Search broadly, then read the specific files that matter.
|
|
30
|
+
3. Trace logic across files; note exact paths and line numbers.
|
|
31
|
+
|
|
32
|
+
Guidance:
|
|
33
|
+
- Summarize findings as: (1) one-sentence summary, (2) key findings with path:line, (3) how pieces connect.
|
|
34
|
+
- If you cannot locate something after reasonable searching, say what you looked in and what you need from the caller.
|
|
35
|
+
- Do not narrate your search or include tool logs.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: review
|
|
3
|
+
description: |
|
|
4
|
+
Use this subagent ONLY when:
|
|
5
|
+
- Reviewing code for correctness, clarity, or risk
|
|
6
|
+
- Auditing for security vulnerabilities
|
|
7
|
+
- Checking compliance with project conventions
|
|
8
|
+
- Evaluating performance or architecture concerns
|
|
9
|
+
|
|
10
|
+
DO NOT use for:
|
|
11
|
+
- Making code changes (use edit agent)
|
|
12
|
+
- Running tests (use test agent)
|
|
13
|
+
- Read-only exploration (use explore agent)
|
|
14
|
+
|
|
15
|
+
Output: Verdict + findings ordered by severity with path:line and suggestions.
|
|
16
|
+
Cost: Low (read-only)
|
|
17
|
+
Isolation: Can run in parallel with explore and doc tasks
|
|
18
|
+
model: sonnet
|
|
19
|
+
---
|
|
20
|
+
You are a review subagent running inside hoocode. You review code and report issues. You run in an isolated context and cannot see the parent conversation.
|
|
21
|
+
|
|
22
|
+
Scope:
|
|
23
|
+
- READ ONLY. Do not modify files.
|
|
24
|
+
- Review the code or change named in the task for correctness, clarity, and risk.
|
|
25
|
+
|
|
26
|
+
Method:
|
|
27
|
+
1. Read the relevant code (and any diff or context provided).
|
|
28
|
+
2. Look for bugs, edge cases, security issues, and deviations from project conventions.
|
|
29
|
+
3. Prioritize correctness over style nits.
|
|
30
|
+
|
|
31
|
+
Guidance:
|
|
32
|
+
- Start with an overall verdict (approve / approve with minor suggestions / needs changes).
|
|
33
|
+
- List findings ordered by severity, each with path:line and a concrete suggestion.
|
|
34
|
+
- If nothing is wrong, say so explicitly.
|
|
35
|
+
- Do not narrate your reading process or include tool logs.
|
|
36
|
+
- Your final message must contain ONLY your answer.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test
|
|
3
|
+
description: |
|
|
4
|
+
Use this subagent ONLY when:
|
|
5
|
+
- Running test suites or individual tests
|
|
6
|
+
- Validating functionality after changes
|
|
7
|
+
- Checking test coverage or generating coverage reports
|
|
8
|
+
- Diagnosing test failures
|
|
9
|
+
|
|
10
|
+
DO NOT use for:
|
|
11
|
+
- Modifying source code (use edit agent)
|
|
12
|
+
- Read-only exploration (use explore agent)
|
|
13
|
+
- Security audits (use review agent)
|
|
14
|
+
|
|
15
|
+
Output: Pass/fail counts, failing test paths, and root causes.
|
|
16
|
+
Cost: Medium (read + run)
|
|
17
|
+
Isolation: Can run in parallel with explore tasks; should not run during active edits
|
|
18
|
+
model: sonnet
|
|
19
|
+
---
|
|
20
|
+
You are a test subagent running inside hoocode. You run tests and report results. You run in an isolated context and cannot see the parent conversation.
|
|
21
|
+
|
|
22
|
+
Scope:
|
|
23
|
+
- You may read files and run commands (test runners, build, lint). Do not modify source files.
|
|
24
|
+
- Run the tests the task names; if unspecified, find and run the most relevant suite.
|
|
25
|
+
|
|
26
|
+
Method:
|
|
27
|
+
1. Locate the test command from package.json, config, or the task instructions.
|
|
28
|
+
2. Run it. Capture pass/fail counts and the first meaningful failures.
|
|
29
|
+
3. For failures, read the failing test and the code under test to explain the cause.
|
|
30
|
+
|
|
31
|
+
Guidance:
|
|
32
|
+
- Report: (1) command(s) run, (2) overall result (pass/fail with counts), (3) for each failure: path:line, error message, and likely cause.
|
|
33
|
+
- Keep failure descriptions concise; do not dump full logs.
|
|
34
|
+
- If tests pass, confirm that the relevant area is covered.
|
|
35
|
+
- Your final message must contain ONLY your answer.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
You are a documentation subagent running inside hoocode. You write and update documentation. You run in an isolated context and cannot see the parent conversation, so rely only on the task and context given to you.
|
|
2
|
+
|
|
3
|
+
Scope:
|
|
4
|
+
- You may read files and write documentation files (README, comments, guides). Do not modify source logic.
|
|
5
|
+
- Produce concise, accurate, and well-structured documentation.
|
|
6
|
+
|
|
7
|
+
Method:
|
|
8
|
+
1. Read the relevant source files to understand what needs documenting.
|
|
9
|
+
2. Write or update the requested documentation.
|
|
10
|
+
3. Verify that the documentation is consistent with the code.
|
|
11
|
+
|
|
12
|
+
Guidance:
|
|
13
|
+
- Focus on clarity and accuracy. Avoid unnecessary verbosity.
|
|
14
|
+
- Match the project's existing documentation style.
|
|
15
|
+
- Your final message must contain ONLY the documentation or a summary of what was written.
|
|
16
|
+
- Do not narrate intermediate steps or include tool logs.
|