@kolisachint/hoocode-agent 0.4.21 → 0.4.24
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 +21 -0
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +5 -0
- package/dist/cli/args.js.map +1 -1
- package/dist/config.d.ts +2 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -9
- package/dist/config.js.map +1 -1
- package/dist/core/agent-frontmatter.d.ts +3 -0
- package/dist/core/agent-frontmatter.d.ts.map +1 -1
- package/dist/core/agent-frontmatter.js +41 -1
- package/dist/core/agent-frontmatter.js.map +1 -1
- package/dist/core/agent-manifest-paths.d.ts +17 -0
- package/dist/core/agent-manifest-paths.d.ts.map +1 -0
- package/dist/core/agent-manifest-paths.js +27 -0
- package/dist/core/agent-manifest-paths.js.map +1 -0
- package/dist/core/agent-registry.d.ts +14 -7
- package/dist/core/agent-registry.d.ts.map +1 -1
- package/dist/core/agent-registry.js +114 -8
- package/dist/core/agent-registry.js.map +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +23 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/index.d.ts +1 -1
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -0
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +26 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/keybindings.d.ts +8 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +2 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/package-manager.d.ts +2 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +38 -9
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/provider-health.d.ts +36 -0
- package/dist/core/provider-health.d.ts.map +1 -0
- package/dist/core/provider-health.js +54 -0
- package/dist/core/provider-health.js.map +1 -0
- package/dist/core/resource-loader.d.ts +14 -0
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +12 -0
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +2 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +1 -1
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/skills.d.ts +9 -0
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +32 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/core/source-info.d.ts +1 -1
- package/dist/core/source-info.d.ts.map +1 -1
- package/dist/core/source-info.js.map +1 -1
- package/dist/core/subagent-pool-instance.d.ts +7 -0
- package/dist/core/subagent-pool-instance.d.ts.map +1 -1
- package/dist/core/subagent-pool-instance.js +14 -1
- package/dist/core/subagent-pool-instance.js.map +1 -1
- package/dist/core/subagent-pool.d.ts +16 -0
- package/dist/core/subagent-pool.d.ts.map +1 -1
- package/dist/core/subagent-pool.js +42 -2
- package/dist/core/subagent-pool.js.map +1 -1
- package/dist/core/subagent-result.d.ts.map +1 -1
- package/dist/core/subagent-result.js +32 -2
- package/dist/core/subagent-result.js.map +1 -1
- package/dist/core/system-prompt.d.ts +7 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +15 -3
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +10 -0
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +34 -0
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +26 -0
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/extensions/core/hoo-core.d.ts +10 -3
- package/dist/extensions/core/hoo-core.d.ts.map +1 -1
- package/dist/extensions/core/hoo-core.js +254 -13
- package/dist/extensions/core/hoo-core.js.map +1 -1
- package/dist/init-templates.generated.d.ts.map +1 -1
- package/dist/init-templates.generated.js +5 -4
- package/dist/init-templates.generated.js.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +6 -2
- package/dist/init.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/ask-options.d.ts +44 -0
- package/dist/modes/interactive/components/ask-options.d.ts.map +1 -0
- package/dist/modes/interactive/components/ask-options.js +202 -0
- package/dist/modes/interactive/components/ask-options.js.map +1 -0
- package/dist/modes/interactive/components/config-selector.d.ts +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +1 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +1 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/task-panel.d.ts +15 -4
- package/dist/modes/interactive/components/task-panel.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-panel.js +178 -63
- package/dist/modes/interactive/components/task-panel.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +10 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +50 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +26 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- 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/examples/sdk/12-full-control.ts +2 -0
- package/package.json +4 -4
- package/templates/agents/doc.md +1 -1
- package/templates/agents/edit.md +1 -0
- package/templates/agents/explore.md +3 -3
- package/templates/agents/general-purpose.md +37 -0
- package/templates/agents/review.md +2 -2
|
@@ -18,6 +18,7 @@ import { clampThinkingLevel, cleanupSessionResources, getSupportedThinkingLevels
|
|
|
18
18
|
import { theme } from "../modes/interactive/theme/theme.js";
|
|
19
19
|
import { stripFrontmatter } from "../utils/frontmatter.js";
|
|
20
20
|
import { sleep } from "../utils/sleep.js";
|
|
21
|
+
import { loadAgentRegistry } from "./agent-registry.js";
|
|
21
22
|
import { formatNoApiKeyFoundMessage, formatNoModelSelectedMessage } from "./auth-guidance.js";
|
|
22
23
|
import { executeBashWithOperations } from "./bash-executor.js";
|
|
23
24
|
import { calculateContextTokens, collectEntriesForBranchSummary, compact, estimateContextTokens, generateBranchSummary, prepareCompaction, shouldCompact, } from "./compaction/index.js";
|
|
@@ -27,8 +28,10 @@ import { createToolHtmlRenderer } from "./export-html/tool-renderer.js";
|
|
|
27
28
|
import { ExtensionRunner, wrapRegisteredTools, } from "./extensions/index.js";
|
|
28
29
|
import { emitSessionShutdownEvent } from "./extensions/runner.js";
|
|
29
30
|
import { expandPromptTemplate } from "./prompt-templates.js";
|
|
31
|
+
import { clearProviderExhaustion, isProviderQuotaError, markProviderExhausted } from "./provider-health.js";
|
|
30
32
|
import { CURRENT_SESSION_VERSION, getLatestCompactionEntry } from "./session-manager.js";
|
|
31
33
|
import { createSyntheticSourceInfo } from "./source-info.js";
|
|
34
|
+
import { updateSubagentSkillPaths } from "./subagent-pool-instance.js";
|
|
32
35
|
import { buildSystemPrompt } from "./system-prompt.js";
|
|
33
36
|
import { createLocalBashOperations } from "./tools/bash.js";
|
|
34
37
|
import { createAllToolDefinitions } from "./tools/index.js";
|
|
@@ -118,6 +121,7 @@ export class AgentSession {
|
|
|
118
121
|
this.settingsManager = config.settingsManager;
|
|
119
122
|
this._scopedModels = config.scopedModels ?? [];
|
|
120
123
|
this._resourceLoader = config.resourceLoader;
|
|
124
|
+
updateSubagentSkillPaths(this._resourceLoader.getSkillPaths());
|
|
121
125
|
this._customTools = config.customTools ?? [];
|
|
122
126
|
this._cwd = config.cwd;
|
|
123
127
|
this._modelRegistry = config.modelRegistry;
|
|
@@ -314,6 +318,11 @@ export class AgentSession {
|
|
|
314
318
|
const assistantMsg = event.message;
|
|
315
319
|
if (assistantMsg.stopReason !== "error") {
|
|
316
320
|
this._overflowRecoveryAttempted = false;
|
|
321
|
+
// A successful response clears any prior provider-exhaustion flag so
|
|
322
|
+
// subagent dispatch is unblocked as soon as the provider recovers.
|
|
323
|
+
const provider = this.model?.provider;
|
|
324
|
+
if (provider)
|
|
325
|
+
clearProviderExhaustion(provider);
|
|
317
326
|
}
|
|
318
327
|
// Reset retry counter immediately on successful assistant response
|
|
319
328
|
// This prevents accumulation across multiple LLM calls within a turn
|
|
@@ -336,6 +345,14 @@ export class AgentSession {
|
|
|
336
345
|
const didRetry = await this._handleRetryableError(msg);
|
|
337
346
|
if (didRetry)
|
|
338
347
|
return; // Retry was initiated, don't proceed to compaction
|
|
348
|
+
// Retries are exhausted/disabled and a quota or rate-limit error
|
|
349
|
+
// persists: flag the provider so subagent dispatch can skip pointless
|
|
350
|
+
// spawns (subagents inherit this provider). Self-expires via TTL and is
|
|
351
|
+
// cleared on the next successful response.
|
|
352
|
+
const provider = this.model?.provider;
|
|
353
|
+
if (provider && isProviderQuotaError(msg.errorMessage)) {
|
|
354
|
+
markProviderExhausted(provider, msg.errorMessage ?? "provider error");
|
|
355
|
+
}
|
|
339
356
|
}
|
|
340
357
|
this._resolveRetry();
|
|
341
358
|
await this._checkCompaction(msg);
|
|
@@ -663,9 +680,13 @@ export class AgentSession {
|
|
|
663
680
|
const appendSystemPrompt = loaderAppendSystemPrompt.length > 0 ? loaderAppendSystemPrompt.join("\n\n") : undefined;
|
|
664
681
|
const loadedSkills = this._resourceLoader.getSkills().skills;
|
|
665
682
|
const loadedContextFiles = this._resourceLoader.getAgentsFiles().agentsFiles;
|
|
683
|
+
// Include agents in the system prompt only when the Task tool is active.
|
|
684
|
+
const hasTaskTool = validToolNames.includes("Task");
|
|
685
|
+
const loadedAgents = hasTaskTool ? loadAgentRegistry({ cwd: this._cwd }).list() : [];
|
|
666
686
|
this._baseSystemPromptOptions = {
|
|
667
687
|
cwd: this._cwd,
|
|
668
688
|
skills: loadedSkills,
|
|
689
|
+
agents: loadedAgents,
|
|
669
690
|
contextFiles: loadedContextFiles,
|
|
670
691
|
customPrompt: loaderSystemPrompt,
|
|
671
692
|
appendSystemPrompt,
|
|
@@ -1588,6 +1609,7 @@ export class AgentSession {
|
|
|
1588
1609
|
themePaths: this.buildExtensionResourcePaths(themePaths),
|
|
1589
1610
|
};
|
|
1590
1611
|
this._resourceLoader.extendResources(extensionPaths);
|
|
1612
|
+
updateSubagentSkillPaths(this._resourceLoader.getSkillPaths());
|
|
1591
1613
|
this._baseSystemPrompt = this._rebuildSystemPrompt(this.getActiveToolNames());
|
|
1592
1614
|
this.agent.state.systemPrompt = this._baseSystemPrompt;
|
|
1593
1615
|
}
|
|
@@ -1850,6 +1872,7 @@ export class AgentSession {
|
|
|
1850
1872
|
await this.settingsManager.reload();
|
|
1851
1873
|
resetApiProviders();
|
|
1852
1874
|
await this._resourceLoader.reload();
|
|
1875
|
+
updateSubagentSkillPaths(this._resourceLoader.getSkillPaths());
|
|
1853
1876
|
this._buildRuntime({
|
|
1854
1877
|
activeToolNames: this.getActiveToolNames(),
|
|
1855
1878
|
flagValues: previousFlagValues,
|