@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
|
@@ -21,6 +21,7 @@ import { BUILT_IN_PROVIDER_DISPLAY_NAMES } from "../../core/provider-display-nam
|
|
|
21
21
|
import { formatMissingSessionCwdPrompt, MissingSessionCwdError } from "../../core/session-cwd.js";
|
|
22
22
|
import { SessionManager } from "../../core/session-manager.js";
|
|
23
23
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
24
|
+
import { runSubagent } from "../../core/subagent.js";
|
|
24
25
|
import { taskStore } from "../../core/task-store.js";
|
|
25
26
|
import { WORDMARK } from "../../core/wordmark.js";
|
|
26
27
|
import { getChangelogPath, getNewEntries, parseChangelog } from "../../utils/changelog.js";
|
|
@@ -2124,6 +2125,11 @@ export class InteractiveMode {
|
|
|
2124
2125
|
await this.shutdown();
|
|
2125
2126
|
return;
|
|
2126
2127
|
}
|
|
2128
|
+
if (text === "/subagent" || text.startsWith("/subagent ")) {
|
|
2129
|
+
this.editor.setText("");
|
|
2130
|
+
await this.handleSubagentCommand(text);
|
|
2131
|
+
return;
|
|
2132
|
+
}
|
|
2127
2133
|
// Handle bash command (! for normal, !! for excluded from context)
|
|
2128
2134
|
if (text.startsWith("!")) {
|
|
2129
2135
|
const isExcluded = text.startsWith("!!");
|
|
@@ -3531,6 +3537,59 @@ export class InteractiveMode {
|
|
|
3531
3537
|
this.showError(error instanceof Error ? error.message : String(error));
|
|
3532
3538
|
}
|
|
3533
3539
|
}
|
|
3540
|
+
async handleSubagentCommand(text) {
|
|
3541
|
+
const prefix = "/subagent ";
|
|
3542
|
+
const args = text.startsWith(prefix) ? text.slice(prefix.length).trim() : "";
|
|
3543
|
+
if (!args) {
|
|
3544
|
+
this.showStatus("Usage: /subagent <mode> <task>");
|
|
3545
|
+
return;
|
|
3546
|
+
}
|
|
3547
|
+
const firstSpace = args.indexOf(" ");
|
|
3548
|
+
if (firstSpace === -1) {
|
|
3549
|
+
this.showStatus("Usage: /subagent <mode> <task>");
|
|
3550
|
+
return;
|
|
3551
|
+
}
|
|
3552
|
+
const mode = args.slice(0, firstSpace).trim();
|
|
3553
|
+
const task = args.slice(firstSpace + 1).trim();
|
|
3554
|
+
if (!task) {
|
|
3555
|
+
this.showStatus("Usage: /subagent <mode> <task>");
|
|
3556
|
+
return;
|
|
3557
|
+
}
|
|
3558
|
+
const validModes = ["explore", "edit", "test", "fix", "review", "doc"];
|
|
3559
|
+
if (!validModes.includes(mode)) {
|
|
3560
|
+
this.showStatus(`Unknown subagent mode: ${mode}. Valid: ${validModes.join(", ")}`);
|
|
3561
|
+
return;
|
|
3562
|
+
}
|
|
3563
|
+
this.showStatus(`Spawning ${mode} subagent...`);
|
|
3564
|
+
try {
|
|
3565
|
+
const result = await runSubagent({
|
|
3566
|
+
task,
|
|
3567
|
+
context: "",
|
|
3568
|
+
mode,
|
|
3569
|
+
cwd: this.session.sessionManager.getCwd(),
|
|
3570
|
+
model: this.session.model ?? undefined,
|
|
3571
|
+
modelRegistry: this.runtimeHost.services.modelRegistry,
|
|
3572
|
+
signal: undefined,
|
|
3573
|
+
});
|
|
3574
|
+
if (result.ok) {
|
|
3575
|
+
this.showStatus(`${mode} subagent completed`);
|
|
3576
|
+
// Inject the subagent answer as a custom message so the user can see it in the chat
|
|
3577
|
+
this.sessionManager.appendMessage({
|
|
3578
|
+
role: "custom",
|
|
3579
|
+
customType: "subagent",
|
|
3580
|
+
content: result.answer || "(no output)",
|
|
3581
|
+
display: true,
|
|
3582
|
+
timestamp: Date.now(),
|
|
3583
|
+
});
|
|
3584
|
+
}
|
|
3585
|
+
else {
|
|
3586
|
+
this.showError(`Subagent (${mode}) failed: ${result.error ?? "unknown error"}`);
|
|
3587
|
+
}
|
|
3588
|
+
}
|
|
3589
|
+
catch (error) {
|
|
3590
|
+
this.showError(error instanceof Error ? error.message : String(error));
|
|
3591
|
+
}
|
|
3592
|
+
}
|
|
3534
3593
|
showTreeSelector(initialSelectedId) {
|
|
3535
3594
|
const tree = this.sessionManager.getTree();
|
|
3536
3595
|
const realLeafId = this.sessionManager.getLeafId();
|