erosolar-cli 1.7.354 → 1.7.356
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/README.md +148 -24
- package/dist/alpha-zero/agentWrapper.d.ts +84 -0
- package/dist/alpha-zero/agentWrapper.d.ts.map +1 -0
- package/dist/alpha-zero/agentWrapper.js +171 -0
- package/dist/alpha-zero/agentWrapper.js.map +1 -0
- package/dist/alpha-zero/codeEvaluator.d.ts +25 -0
- package/dist/alpha-zero/codeEvaluator.d.ts.map +1 -0
- package/dist/alpha-zero/codeEvaluator.js +273 -0
- package/dist/alpha-zero/codeEvaluator.js.map +1 -0
- package/dist/alpha-zero/competitiveRunner.d.ts +66 -0
- package/dist/alpha-zero/competitiveRunner.d.ts.map +1 -0
- package/dist/alpha-zero/competitiveRunner.js +224 -0
- package/dist/alpha-zero/competitiveRunner.js.map +1 -0
- package/dist/alpha-zero/index.d.ts +67 -0
- package/dist/alpha-zero/index.d.ts.map +1 -0
- package/dist/alpha-zero/index.js +99 -0
- package/dist/alpha-zero/index.js.map +1 -0
- package/dist/alpha-zero/introspection.d.ts +128 -0
- package/dist/alpha-zero/introspection.d.ts.map +1 -0
- package/dist/alpha-zero/introspection.js +300 -0
- package/dist/alpha-zero/introspection.js.map +1 -0
- package/dist/alpha-zero/metricsTracker.d.ts +71 -0
- package/dist/alpha-zero/metricsTracker.d.ts.map +1 -0
- package/dist/{core → alpha-zero}/metricsTracker.js +5 -2
- package/dist/alpha-zero/metricsTracker.js.map +1 -0
- package/dist/alpha-zero/security/core.d.ts +125 -0
- package/dist/alpha-zero/security/core.d.ts.map +1 -0
- package/dist/alpha-zero/security/core.js +271 -0
- package/dist/alpha-zero/security/core.js.map +1 -0
- package/dist/alpha-zero/security/google.d.ts +125 -0
- package/dist/alpha-zero/security/google.d.ts.map +1 -0
- package/dist/alpha-zero/security/google.js +311 -0
- package/dist/alpha-zero/security/google.js.map +1 -0
- package/dist/alpha-zero/security/googleLoader.d.ts +17 -0
- package/dist/alpha-zero/security/googleLoader.d.ts.map +1 -0
- package/dist/alpha-zero/security/googleLoader.js +41 -0
- package/dist/alpha-zero/security/googleLoader.js.map +1 -0
- package/dist/alpha-zero/security/index.d.ts +29 -0
- package/dist/alpha-zero/security/index.d.ts.map +1 -0
- package/dist/alpha-zero/security/index.js +32 -0
- package/dist/alpha-zero/security/index.js.map +1 -0
- package/dist/alpha-zero/security/simulation.d.ts +124 -0
- package/dist/alpha-zero/security/simulation.d.ts.map +1 -0
- package/dist/alpha-zero/security/simulation.js +277 -0
- package/dist/alpha-zero/security/simulation.js.map +1 -0
- package/dist/alpha-zero/selfModification.d.ts +109 -0
- package/dist/alpha-zero/selfModification.d.ts.map +1 -0
- package/dist/alpha-zero/selfModification.js +233 -0
- package/dist/alpha-zero/selfModification.js.map +1 -0
- package/dist/alpha-zero/types.d.ts +170 -0
- package/dist/alpha-zero/types.d.ts.map +1 -0
- package/dist/alpha-zero/types.js +31 -0
- package/dist/alpha-zero/types.js.map +1 -0
- package/dist/bin/erosolar.js +21 -5
- package/dist/bin/erosolar.js.map +1 -1
- package/dist/capabilities/agentSpawningCapability.d.ts.map +1 -1
- package/dist/capabilities/agentSpawningCapability.js +31 -56
- package/dist/capabilities/agentSpawningCapability.js.map +1 -1
- package/dist/capabilities/securityTestingCapability.d.ts +13 -0
- package/dist/capabilities/securityTestingCapability.d.ts.map +1 -0
- package/dist/capabilities/securityTestingCapability.js +25 -0
- package/dist/capabilities/securityTestingCapability.js.map +1 -0
- package/dist/contracts/agent-schemas.json +15 -0
- package/dist/contracts/tools.schema.json +9 -0
- package/dist/core/agent.d.ts +2 -2
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js.map +1 -1
- package/dist/core/aiFlowOptimizer.d.ts +26 -0
- package/dist/core/aiFlowOptimizer.d.ts.map +1 -0
- package/dist/core/aiFlowOptimizer.js +31 -0
- package/dist/core/aiFlowOptimizer.js.map +1 -0
- package/dist/core/aiOptimizationEngine.d.ts +158 -0
- package/dist/core/aiOptimizationEngine.d.ts.map +1 -0
- package/dist/core/aiOptimizationEngine.js +428 -0
- package/dist/core/aiOptimizationEngine.js.map +1 -0
- package/dist/core/aiOptimizationIntegration.d.ts +93 -0
- package/dist/core/aiOptimizationIntegration.d.ts.map +1 -0
- package/dist/core/aiOptimizationIntegration.js +250 -0
- package/dist/core/aiOptimizationIntegration.js.map +1 -0
- package/dist/core/customCommands.d.ts +0 -1
- package/dist/core/customCommands.d.ts.map +1 -1
- package/dist/core/customCommands.js +0 -3
- package/dist/core/customCommands.js.map +1 -1
- package/dist/core/enhancedErrorRecovery.d.ts +100 -0
- package/dist/core/enhancedErrorRecovery.d.ts.map +1 -0
- package/dist/core/enhancedErrorRecovery.js +345 -0
- package/dist/core/enhancedErrorRecovery.js.map +1 -0
- package/dist/core/hooksSystem.d.ts +65 -0
- package/dist/core/hooksSystem.d.ts.map +1 -0
- package/dist/core/hooksSystem.js +273 -0
- package/dist/core/hooksSystem.js.map +1 -0
- package/dist/core/memorySystem.d.ts +48 -0
- package/dist/core/memorySystem.d.ts.map +1 -0
- package/dist/core/memorySystem.js +271 -0
- package/dist/core/memorySystem.js.map +1 -0
- package/dist/core/sessionStore.d.ts +0 -2
- package/dist/core/sessionStore.d.ts.map +1 -1
- package/dist/core/sessionStore.js +0 -1
- package/dist/core/sessionStore.js.map +1 -1
- package/dist/core/toolPreconditions.d.ts.map +1 -1
- package/dist/core/toolPreconditions.js +14 -0
- package/dist/core/toolPreconditions.js.map +1 -1
- package/dist/core/toolRuntime.d.ts +1 -22
- package/dist/core/toolRuntime.d.ts.map +1 -1
- package/dist/core/toolRuntime.js +5 -0
- package/dist/core/toolRuntime.js.map +1 -1
- package/dist/core/toolValidation.d.ts.map +1 -1
- package/dist/core/toolValidation.js +3 -14
- package/dist/core/toolValidation.js.map +1 -1
- package/dist/core/unified/errors.d.ts +189 -0
- package/dist/core/unified/errors.d.ts.map +1 -0
- package/dist/core/unified/errors.js +497 -0
- package/dist/core/unified/errors.js.map +1 -0
- package/dist/core/unified/index.d.ts +19 -0
- package/dist/core/unified/index.d.ts.map +1 -0
- package/dist/core/unified/index.js +68 -0
- package/dist/core/unified/index.js.map +1 -0
- package/dist/core/unified/schema.d.ts +101 -0
- package/dist/core/unified/schema.d.ts.map +1 -0
- package/dist/core/unified/schema.js +350 -0
- package/dist/core/unified/schema.js.map +1 -0
- package/dist/core/unified/toolRuntime.d.ts +179 -0
- package/dist/core/unified/toolRuntime.d.ts.map +1 -0
- package/dist/core/unified/toolRuntime.js +517 -0
- package/dist/core/unified/toolRuntime.js.map +1 -0
- package/dist/core/unified/tools.d.ts +127 -0
- package/dist/core/unified/tools.d.ts.map +1 -0
- package/dist/core/unified/tools.js +1333 -0
- package/dist/core/unified/tools.js.map +1 -0
- package/dist/core/unified/types.d.ts +352 -0
- package/dist/core/unified/types.d.ts.map +1 -0
- package/dist/core/unified/types.js +12 -0
- package/dist/core/unified/types.js.map +1 -0
- package/dist/core/unified/version.d.ts +209 -0
- package/dist/core/unified/version.d.ts.map +1 -0
- package/dist/core/unified/version.js +454 -0
- package/dist/core/unified/version.js.map +1 -0
- package/dist/core/validationRunner.d.ts +3 -1
- package/dist/core/validationRunner.d.ts.map +1 -1
- package/dist/core/validationRunner.js.map +1 -1
- package/dist/headless/headlessApp.d.ts.map +1 -1
- package/dist/headless/headlessApp.js +0 -21
- package/dist/headless/headlessApp.js.map +1 -1
- package/dist/mcp/sseClient.d.ts.map +1 -1
- package/dist/mcp/sseClient.js +18 -9
- package/dist/mcp/sseClient.js.map +1 -1
- package/dist/plugins/tools/build/buildPlugin.d.ts +6 -0
- package/dist/plugins/tools/build/buildPlugin.d.ts.map +1 -1
- package/dist/plugins/tools/build/buildPlugin.js +10 -4
- package/dist/plugins/tools/build/buildPlugin.js.map +1 -1
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
- package/dist/plugins/tools/nodeDefaults.js +2 -0
- package/dist/plugins/tools/nodeDefaults.js.map +1 -1
- package/dist/plugins/tools/security/securityPlugin.d.ts +3 -0
- package/dist/plugins/tools/security/securityPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/security/securityPlugin.js +12 -0
- package/dist/plugins/tools/security/securityPlugin.js.map +1 -0
- package/dist/runtime/agentSession.d.ts +2 -2
- package/dist/runtime/agentSession.d.ts.map +1 -1
- package/dist/runtime/agentSession.js +2 -2
- package/dist/runtime/agentSession.js.map +1 -1
- package/dist/security/active-stack-security.d.ts +112 -0
- package/dist/security/active-stack-security.d.ts.map +1 -0
- package/dist/security/active-stack-security.js +296 -0
- package/dist/security/active-stack-security.js.map +1 -0
- package/dist/security/advanced-persistence-research.d.ts +92 -0
- package/dist/security/advanced-persistence-research.d.ts.map +1 -0
- package/dist/security/advanced-persistence-research.js +195 -0
- package/dist/security/advanced-persistence-research.js.map +1 -0
- package/dist/security/advanced-targeting.d.ts +119 -0
- package/dist/security/advanced-targeting.d.ts.map +1 -0
- package/dist/security/advanced-targeting.js +233 -0
- package/dist/security/advanced-targeting.js.map +1 -0
- package/dist/security/assessment/vulnerabilityAssessment.d.ts +104 -0
- package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +1 -0
- package/dist/security/assessment/vulnerabilityAssessment.js +315 -0
- package/dist/security/assessment/vulnerabilityAssessment.js.map +1 -0
- package/dist/security/authorization/securityAuthorization.d.ts +88 -0
- package/dist/security/authorization/securityAuthorization.d.ts.map +1 -0
- package/dist/security/authorization/securityAuthorization.js +172 -0
- package/dist/security/authorization/securityAuthorization.js.map +1 -0
- package/dist/security/comprehensive-targeting.d.ts +85 -0
- package/dist/security/comprehensive-targeting.d.ts.map +1 -0
- package/dist/security/comprehensive-targeting.js +438 -0
- package/dist/security/comprehensive-targeting.js.map +1 -0
- package/dist/security/global-security-integration.d.ts +91 -0
- package/dist/security/global-security-integration.d.ts.map +1 -0
- package/dist/security/global-security-integration.js +218 -0
- package/dist/security/global-security-integration.js.map +1 -0
- package/dist/security/index.d.ts +38 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +47 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/persistence-analyzer.d.ts +56 -0
- package/dist/security/persistence-analyzer.d.ts.map +1 -0
- package/dist/security/persistence-analyzer.js +187 -0
- package/dist/security/persistence-analyzer.js.map +1 -0
- package/dist/security/persistence-cli.d.ts +36 -0
- package/dist/security/persistence-cli.d.ts.map +1 -0
- package/dist/security/persistence-cli.js +160 -0
- package/dist/security/persistence-cli.js.map +1 -0
- package/dist/security/persistence-research.d.ts +92 -0
- package/dist/security/persistence-research.d.ts.map +1 -0
- package/dist/security/persistence-research.js +364 -0
- package/dist/security/persistence-research.js.map +1 -0
- package/dist/security/research/persistenceResearch.d.ts +97 -0
- package/dist/security/research/persistenceResearch.d.ts.map +1 -0
- package/dist/security/research/persistenceResearch.js +282 -0
- package/dist/security/research/persistenceResearch.js.map +1 -0
- package/dist/security/security-integration.d.ts +74 -0
- package/dist/security/security-integration.d.ts.map +1 -0
- package/dist/security/security-integration.js +137 -0
- package/dist/security/security-integration.js.map +1 -0
- package/dist/security/security-testing-framework.d.ts +112 -0
- package/dist/security/security-testing-framework.d.ts.map +1 -0
- package/dist/security/security-testing-framework.js +364 -0
- package/dist/security/security-testing-framework.js.map +1 -0
- package/dist/security/simulation/attackSimulation.d.ts +93 -0
- package/dist/security/simulation/attackSimulation.d.ts.map +1 -0
- package/dist/security/simulation/attackSimulation.js +341 -0
- package/dist/security/simulation/attackSimulation.js.map +1 -0
- package/dist/security/strategic-operations.d.ts +100 -0
- package/dist/security/strategic-operations.d.ts.map +1 -0
- package/dist/security/strategic-operations.js +276 -0
- package/dist/security/strategic-operations.js.map +1 -0
- package/dist/security/tool-security-wrapper.d.ts +58 -0
- package/dist/security/tool-security-wrapper.d.ts.map +1 -0
- package/dist/security/tool-security-wrapper.js +156 -0
- package/dist/security/tool-security-wrapper.js.map +1 -0
- package/dist/shell/claudeCodeStreamHandler.d.ts +145 -0
- package/dist/shell/claudeCodeStreamHandler.d.ts.map +1 -0
- package/dist/shell/claudeCodeStreamHandler.js +322 -0
- package/dist/shell/claudeCodeStreamHandler.js.map +1 -0
- package/dist/shell/inputQueueManager.d.ts +144 -0
- package/dist/shell/inputQueueManager.d.ts.map +1 -0
- package/dist/shell/inputQueueManager.js +290 -0
- package/dist/shell/inputQueueManager.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +7 -43
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +166 -417
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/metricsTracker.d.ts +60 -0
- package/dist/shell/metricsTracker.d.ts.map +1 -0
- package/dist/shell/metricsTracker.js +119 -0
- package/dist/shell/metricsTracker.js.map +1 -0
- package/dist/shell/shellApp.d.ts +0 -2
- package/dist/shell/shellApp.d.ts.map +1 -1
- package/dist/shell/shellApp.js +9 -82
- package/dist/shell/shellApp.js.map +1 -1
- package/dist/shell/streamingOutputManager.d.ts +115 -0
- package/dist/shell/streamingOutputManager.d.ts.map +1 -0
- package/dist/shell/streamingOutputManager.js +225 -0
- package/dist/shell/streamingOutputManager.js.map +1 -0
- package/dist/shell/systemPrompt.d.ts.map +1 -1
- package/dist/shell/systemPrompt.js +4 -1
- package/dist/shell/systemPrompt.js.map +1 -1
- package/dist/shell/terminalInput.d.ts +125 -250
- package/dist/shell/terminalInput.d.ts.map +1 -1
- package/dist/shell/terminalInput.js +612 -1071
- package/dist/shell/terminalInput.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts +24 -106
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +30 -139
- package/dist/shell/terminalInputAdapter.js.map +1 -1
- package/dist/subagents/taskRunner.d.ts +1 -7
- package/dist/subagents/taskRunner.d.ts.map +1 -1
- package/dist/subagents/taskRunner.js +49 -200
- package/dist/subagents/taskRunner.js.map +1 -1
- package/dist/tools/securityTools.d.ts +22 -0
- package/dist/tools/securityTools.d.ts.map +1 -0
- package/dist/tools/securityTools.js +448 -0
- package/dist/tools/securityTools.js.map +1 -0
- package/dist/ui/ShellUIAdapter.d.ts +1 -7
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +18 -42
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/dist/ui/display.d.ts +45 -24
- package/dist/ui/display.d.ts.map +1 -1
- package/dist/ui/display.js +274 -148
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/persistentPrompt.d.ts +50 -0
- package/dist/ui/persistentPrompt.d.ts.map +1 -0
- package/dist/ui/persistentPrompt.js +92 -0
- package/dist/ui/persistentPrompt.js.map +1 -0
- package/dist/ui/terminalUISchema.d.ts +195 -0
- package/dist/ui/terminalUISchema.d.ts.map +1 -0
- package/dist/ui/terminalUISchema.js +113 -0
- package/dist/ui/terminalUISchema.js.map +1 -0
- package/dist/ui/theme.d.ts.map +1 -1
- package/dist/ui/theme.js +8 -6
- package/dist/ui/theme.js.map +1 -1
- package/dist/ui/toolDisplay.d.ts +158 -0
- package/dist/ui/toolDisplay.d.ts.map +1 -1
- package/dist/ui/toolDisplay.js +348 -0
- package/dist/ui/toolDisplay.js.map +1 -1
- package/dist/ui/unified/layout.d.ts +0 -20
- package/dist/ui/unified/layout.d.ts.map +1 -1
- package/dist/ui/unified/layout.js +216 -105
- package/dist/ui/unified/layout.js.map +1 -1
- package/package.json +4 -4
- package/scripts/deploy-security-capabilities.js +178 -0
- package/dist/core/hooks.d.ts +0 -113
- package/dist/core/hooks.d.ts.map +0 -1
- package/dist/core/hooks.js +0 -267
- package/dist/core/hooks.js.map +0 -1
- package/dist/core/metricsTracker.d.ts +0 -122
- package/dist/core/metricsTracker.d.ts.map +0 -1
- package/dist/core/metricsTracker.js.map +0 -1
- package/dist/core/securityAssessment.d.ts +0 -91
- package/dist/core/securityAssessment.d.ts.map +0 -1
- package/dist/core/securityAssessment.js +0 -580
- package/dist/core/securityAssessment.js.map +0 -1
- package/dist/core/verification.d.ts +0 -137
- package/dist/core/verification.d.ts.map +0 -1
- package/dist/core/verification.js +0 -323
- package/dist/core/verification.js.map +0 -1
- package/dist/subagents/agentConfig.d.ts +0 -27
- package/dist/subagents/agentConfig.d.ts.map +0 -1
- package/dist/subagents/agentConfig.js +0 -89
- package/dist/subagents/agentConfig.js.map +0 -1
- package/dist/subagents/agentRegistry.d.ts +0 -33
- package/dist/subagents/agentRegistry.d.ts.map +0 -1
- package/dist/subagents/agentRegistry.js +0 -162
- package/dist/subagents/agentRegistry.js.map +0 -1
- package/dist/utils/frontmatter.d.ts +0 -10
- package/dist/utils/frontmatter.d.ts.map +0 -1
- package/dist/utils/frontmatter.js +0 -78
- package/dist/utils/frontmatter.js.map +0 -1
|
@@ -33,21 +33,12 @@ export class TerminalInputAdapter {
|
|
|
33
33
|
this.input.on('mode-change', (mode) => this.callbacks.onEditModeChange?.(mode));
|
|
34
34
|
this.input.on('toggleVerify', () => this.callbacks.onToggleVerify?.());
|
|
35
35
|
this.input.on('toggleAutoContinue', () => this.callbacks.onToggleAutoContinue?.());
|
|
36
|
-
this.input.on('toggleThinking', () => this.callbacks.onToggleThinking?.());
|
|
37
|
-
this.input.on('toggleEditMode', () => {
|
|
38
|
-
const mode = this.input.getEditMode?.() || 'display-edits';
|
|
39
|
-
this.callbacks.onEditModeChange?.(mode);
|
|
40
|
-
});
|
|
41
|
-
this.input.on('clearContext', () => this.callbacks.onClearContext?.());
|
|
42
36
|
}
|
|
43
37
|
/**
|
|
44
|
-
* Start capturing input
|
|
38
|
+
* Start capturing input
|
|
45
39
|
*/
|
|
46
40
|
start() {
|
|
47
41
|
this.input.enableBracketedPaste();
|
|
48
|
-
// Enable mouse tracking for scroll wheel
|
|
49
|
-
// Text selection: use Shift+click+drag in most terminals
|
|
50
|
-
this.input.enableMouseTracking();
|
|
51
42
|
// Set up raw mode
|
|
52
43
|
if (this.inStream.isTTY) {
|
|
53
44
|
this.inStream.setRawMode(true);
|
|
@@ -59,14 +50,14 @@ export class TerminalInputAdapter {
|
|
|
59
50
|
this.setupRawDataInterception();
|
|
60
51
|
// Set up keypress handling
|
|
61
52
|
this.setupKeypressHandler();
|
|
62
|
-
//
|
|
53
|
+
// Initial render
|
|
54
|
+
this.input.forceRender();
|
|
63
55
|
}
|
|
64
56
|
/**
|
|
65
57
|
* Stop capturing input
|
|
66
58
|
*/
|
|
67
59
|
stop() {
|
|
68
60
|
this.input.disableBracketedPaste();
|
|
69
|
-
this.input.disableMouseTracking();
|
|
70
61
|
// Remove handlers
|
|
71
62
|
if (this.rawDataHandler) {
|
|
72
63
|
this.restoreRawDataInterception();
|
|
@@ -89,10 +80,11 @@ export class TerminalInputAdapter {
|
|
|
89
80
|
this.input.setMode(streaming ? 'streaming' : 'idle');
|
|
90
81
|
}
|
|
91
82
|
/**
|
|
92
|
-
*
|
|
83
|
+
* Set the row where content ends (for idle mode positioning).
|
|
84
|
+
* Input area will render starting from this row + 1.
|
|
93
85
|
*/
|
|
94
|
-
|
|
95
|
-
this.input.
|
|
86
|
+
setContentEndRow(row) {
|
|
87
|
+
this.input.setContentEndRow(row);
|
|
96
88
|
}
|
|
97
89
|
/**
|
|
98
90
|
* Get current buffer content
|
|
@@ -115,8 +107,8 @@ export class TerminalInputAdapter {
|
|
|
115
107
|
/**
|
|
116
108
|
* Update context usage indicator (0-100, null to clear)
|
|
117
109
|
*/
|
|
118
|
-
setContextUsage(percentage
|
|
119
|
-
this.input.updateContextUsage(percentage
|
|
110
|
+
setContextUsage(percentage) {
|
|
111
|
+
this.input.updateContextUsage(percentage);
|
|
120
112
|
}
|
|
121
113
|
/**
|
|
122
114
|
* Surface mode toggle states (verification/auto-continue) in the control bar.
|
|
@@ -124,6 +116,13 @@ export class TerminalInputAdapter {
|
|
|
124
116
|
setModeToggles(options) {
|
|
125
117
|
this.input.setModeToggles(options);
|
|
126
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Set the model info string (e.g., "OpenAI · gpt-4")
|
|
121
|
+
* This is displayed persistently above the input area.
|
|
122
|
+
*/
|
|
123
|
+
setModelInfo(info) {
|
|
124
|
+
this.input.setModelInfo(info);
|
|
125
|
+
}
|
|
127
126
|
/**
|
|
128
127
|
* Update the inline status message shown before the prompt (e.g., streaming heartbeat).
|
|
129
128
|
*/
|
|
@@ -144,24 +143,12 @@ export class TerminalInputAdapter {
|
|
|
144
143
|
setStreamingLabel(label) {
|
|
145
144
|
this.input.setStreamingLabel(label);
|
|
146
145
|
}
|
|
147
|
-
/**
|
|
148
|
-
* Surface meta header information (elapsed, tokens/context) above the divider.
|
|
149
|
-
*/
|
|
150
|
-
setMetaStatus(meta) {
|
|
151
|
-
this.input.setMetaStatus(meta);
|
|
152
|
-
}
|
|
153
146
|
/**
|
|
154
147
|
* Clear all status messages at once (convenience method).
|
|
155
148
|
*/
|
|
156
149
|
clearAllStatus() {
|
|
157
150
|
this.input.clearAllStatus();
|
|
158
151
|
}
|
|
159
|
-
/**
|
|
160
|
-
* Surface model/provider context in the controls bar.
|
|
161
|
-
*/
|
|
162
|
-
setModelContext(options) {
|
|
163
|
-
this.input.setModelContext(options);
|
|
164
|
-
}
|
|
165
152
|
/**
|
|
166
153
|
* Set the edit guard mode explicitly
|
|
167
154
|
*/
|
|
@@ -198,114 +185,6 @@ export class TerminalInputAdapter {
|
|
|
198
185
|
forceRender() {
|
|
199
186
|
this.input.forceRender();
|
|
200
187
|
}
|
|
201
|
-
/**
|
|
202
|
-
* Stream content above the pinned chat box (Claude Code method).
|
|
203
|
-
* Automatically enables scroll region on first call.
|
|
204
|
-
*/
|
|
205
|
-
streamContent(content) {
|
|
206
|
-
this.input.streamContent(content);
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Enable scroll region (Claude Code method).
|
|
210
|
-
* Chat box is pinned below scroll region.
|
|
211
|
-
*/
|
|
212
|
-
enableScrollRegion() {
|
|
213
|
-
this.input.enableScrollRegion();
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Disable scroll region and reset to full terminal.
|
|
217
|
-
*/
|
|
218
|
-
disableScrollRegion() {
|
|
219
|
-
this.input.disableScrollRegion();
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* @deprecated Use streamContent() instead
|
|
223
|
-
* Write content directly into the scroll region.
|
|
224
|
-
*/
|
|
225
|
-
writeToScrollRegion(content) {
|
|
226
|
-
this.input.writeToScrollRegion(content);
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Enter alternate screen buffer.
|
|
230
|
-
*/
|
|
231
|
-
enterAlternateScreen() {
|
|
232
|
-
this.input.enterAlternateScreen();
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Exit alternate screen buffer.
|
|
236
|
-
*/
|
|
237
|
-
exitAlternateScreen() {
|
|
238
|
-
this.input.exitAlternateScreen();
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Clear the entire terminal screen and reset content position.
|
|
242
|
-
* This removes all content including the launching command.
|
|
243
|
-
*/
|
|
244
|
-
clearScreen() {
|
|
245
|
-
this.input.clearScreen();
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Enter streaming scroll region mode.
|
|
249
|
-
* Call once at the start of streaming.
|
|
250
|
-
*/
|
|
251
|
-
enterStreamingScrollRegion() {
|
|
252
|
-
this.input.enterStreamingScrollRegion();
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* Exit streaming scroll region mode.
|
|
256
|
-
* Call once at the end of streaming.
|
|
257
|
-
*/
|
|
258
|
-
exitStreamingScrollRegion() {
|
|
259
|
-
this.input.exitStreamingScrollRegion();
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Get scrollback buffer content for persistence.
|
|
263
|
-
*/
|
|
264
|
-
getScrollbackBuffer() {
|
|
265
|
-
return this.input.getScrollbackBuffer();
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Load scrollback buffer for restoration.
|
|
269
|
-
*/
|
|
270
|
-
loadScrollbackBuffer(lines) {
|
|
271
|
-
this.input.loadScrollbackBuffer(lines);
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Clear scrollback buffer.
|
|
275
|
-
*/
|
|
276
|
-
clearScrollbackBuffer() {
|
|
277
|
-
this.input.clearScrollbackBuffer();
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Check if alternate screen buffer is currently active.
|
|
281
|
-
*/
|
|
282
|
-
isAlternateScreenActive() {
|
|
283
|
-
return this.input.isAlternateScreenActive();
|
|
284
|
-
}
|
|
285
|
-
/**
|
|
286
|
-
* Get a snapshot of the scrollback buffer (for display on exit).
|
|
287
|
-
*/
|
|
288
|
-
getScrollbackSnapshot() {
|
|
289
|
-
return this.input.getScrollbackSnapshot();
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* Reset content position to top of scroll region.
|
|
293
|
-
*/
|
|
294
|
-
resetContentPosition() {
|
|
295
|
-
this.input.resetContentPosition();
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* Set the content row explicitly (used after banner is written).
|
|
299
|
-
*/
|
|
300
|
-
setContentRow(row) {
|
|
301
|
-
this.input.setContentRow(row);
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* Get the current content row position.
|
|
305
|
-
*/
|
|
306
|
-
getContentRow() {
|
|
307
|
-
return this.input.getContentRow();
|
|
308
|
-
}
|
|
309
188
|
/**
|
|
310
189
|
* Handle terminal resize
|
|
311
190
|
*/
|
|
@@ -326,12 +205,24 @@ export class TerminalInputAdapter {
|
|
|
326
205
|
return this.input;
|
|
327
206
|
}
|
|
328
207
|
/**
|
|
329
|
-
* Register with display's output interceptor for
|
|
330
|
-
* This ensures streamed output goes to the scroll region during processing.
|
|
208
|
+
* Register with display's output interceptor (kept for API compatibility).
|
|
331
209
|
*/
|
|
332
210
|
registerOutputInterceptor(display) {
|
|
333
211
|
this.input.registerOutputInterceptor(display);
|
|
334
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* Set banner content to be written when unified UI initializes.
|
|
215
|
+
*/
|
|
216
|
+
setBannerContent(content) {
|
|
217
|
+
this.input.setBannerContent(content);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Initialize the unified UI system.
|
|
221
|
+
* Clears screen, writes banner, renders input area.
|
|
222
|
+
*/
|
|
223
|
+
initializeUnifiedUI() {
|
|
224
|
+
this.input.initializeUnifiedUI();
|
|
225
|
+
}
|
|
335
226
|
// ===========================================================================
|
|
336
227
|
// PRIVATE
|
|
337
228
|
// ===========================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminalInputAdapter.js","sourceRoot":"","sources":["../../src/shell/terminalInputAdapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAoC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"terminalInputAdapter.js","sourceRoot":"","sources":["../../src/shell/terminalInputAdapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAoC,MAAM,oBAAoB,CAAC;AAqBrF;;GAEG;AACH,MAAM,OAAO,oBAAoB;IASZ;IARF,KAAK,CAAgB;IACrB,SAAS,CAAwB;IAC1C,cAAc,GAAqC,IAAI,CAAC;IACxD,eAAe,GAA6C,IAAI,CAAC;IACzE,8DAA8D;IACtD,YAAY,GAAyC,IAAI,CAAC;IAElE,YACmB,QAA2B,EAC5C,SAA6B,EAC7B,SAAgC;QAFf,aAAQ,GAAR,QAAQ,CAAmB;QAI5C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAE3B,IAAI,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,SAAS,EAAE;YACxC,QAAQ,EAAE,EAAE;YACZ,SAAS,EAAE,KAAK;YAChB,YAAY,EAAE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B,QAAQ,EAAE,GAAG,EAAE,QAAQ;aACxB,CAAC;YAEF,yFAAyF;YACzF,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;gBACnE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;oBACrB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,MAAM,GAAG,CAAC;iBAC7C,CAAC,CAAC;YACL,CAAC;YAED,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC1C,CAAC,CAAC;QAEF,gDAAgD;QAChD,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IAClE,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,SAAgC,EAChC,WAA8B,OAAO,CAAC,KAAK,EAC3C,YAAgC,OAAO,CAAC,MAAM;IAE9C,OAAO,IAAI,oBAAoB,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
import type { CapabilityContext } from '../runtime/agentHost.js';
|
|
2
|
-
import { AgentRegistry, type AgentDefinition } from './agentRegistry.js';
|
|
3
2
|
type TaskModelName = 'sonnet' | 'opus' | 'haiku';
|
|
4
|
-
type TaskThoroughness = 'quick' | 'medium' | 'very_thorough';
|
|
5
3
|
export interface TaskInvocationOptions {
|
|
6
4
|
description: string;
|
|
7
5
|
prompt: string;
|
|
8
6
|
subagentType: string;
|
|
9
7
|
model?: TaskModelName;
|
|
10
8
|
resumeId?: string;
|
|
11
|
-
thoroughness?: TaskThoroughness;
|
|
12
9
|
}
|
|
13
10
|
interface TaskExecutionResult {
|
|
14
11
|
output: string;
|
|
15
12
|
}
|
|
16
|
-
export declare const BUILTIN_AGENT_DEFINITIONS: AgentDefinition[];
|
|
17
13
|
export declare class TaskRunner {
|
|
18
14
|
private readonly context;
|
|
19
|
-
private readonly registry;
|
|
20
15
|
private readonly snapshots;
|
|
21
|
-
constructor(context: CapabilityContext
|
|
16
|
+
constructor(context: CapabilityContext);
|
|
22
17
|
runTask(options: TaskInvocationOptions): Promise<TaskExecutionResult>;
|
|
23
|
-
private buildToolRuntime;
|
|
24
18
|
private resolveToolPermissions;
|
|
25
19
|
private buildModelSelection;
|
|
26
20
|
private composeSystemPrompt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taskRunner.d.ts","sourceRoot":"","sources":["../../src/subagents/taskRunner.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAQjE,
|
|
1
|
+
{"version":3,"file":"taskRunner.d.ts","sourceRoot":"","sources":["../../src/subagents/taskRunner.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAQjE,KAAK,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,mBAAmB;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB;AA6DD,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA2B;gBAEzC,OAAO,EAAE,iBAAiB;IAIhC,OAAO,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAyF3E,OAAO,CAAC,sBAAsB;IAS9B,OAAO,CAAC,mBAAmB;IAsB3B,OAAO,CAAC,mBAAmB;CAkB5B"}
|
|
@@ -5,64 +5,38 @@ import { join } from 'node:path';
|
|
|
5
5
|
import { createNodeRuntime } from '../runtime/node.js';
|
|
6
6
|
import { loadToolSettings } from '../core/preferences.js';
|
|
7
7
|
import { buildEnabledToolSet, evaluateToolPermissions } from '../capabilities/toolRegistry.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
prompt: [
|
|
8
|
+
const SUBAGENT_DEFINITIONS = {
|
|
9
|
+
'general-purpose': {
|
|
10
|
+
id: 'general-purpose',
|
|
11
|
+
label: 'General Purpose',
|
|
12
|
+
summary: 'complete research, editing, and implementation tasks end-to-end',
|
|
13
|
+
instructions: [
|
|
15
14
|
'Own the entire task autonomously. Narrate your plan, gather context with filesystem/search tools, and make changes when necessary.',
|
|
16
15
|
'Always cite the evidence, commands, and files you touched. Include TODOs or risks that need human review.',
|
|
17
|
-
]
|
|
18
|
-
|
|
19
|
-
source: 'builtin',
|
|
16
|
+
],
|
|
17
|
+
defaultModel: 'sonnet',
|
|
20
18
|
},
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
summary: '
|
|
25
|
-
|
|
26
|
-
'
|
|
27
|
-
'',
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
'2. Identify the tech stack, frameworks, and architecture patterns',
|
|
31
|
-
'3. Explore multiple areas systematically - follow imports, trace data flow, understand component relationships',
|
|
32
|
-
'4. Read relevant files in full to understand implementation details',
|
|
33
|
-
'5. Use grep/search to find patterns, usages, and connections across the codebase',
|
|
34
|
-
'',
|
|
35
|
-
'THOROUGHNESS:',
|
|
36
|
-
'- Do NOT return quickly with shallow analysis',
|
|
37
|
-
'- Explore at least 10-20 relevant files for comprehensive understanding',
|
|
38
|
-
'- Follow the dependency chain - understand how modules connect',
|
|
39
|
-
'- Identify entry points, core logic, and data models',
|
|
40
|
-
'- Note architectural patterns, conventions, and code organization',
|
|
41
|
-
'',
|
|
42
|
-
'OUTPUT:',
|
|
43
|
-
'- Provide detailed findings with specific file:line references',
|
|
44
|
-
'- Explain relationships between components',
|
|
45
|
-
'- Include code snippets for key implementations',
|
|
46
|
-
'- Summarize patterns and conventions you discovered',
|
|
47
|
-
].join('\n'),
|
|
48
|
-
tools: ['read', 'read_file', 'read_files', 'list_files', 'search_files', 'glob_search', 'grep_search', 'find_definition', 'context_snapshot', 'learn_codebase', 'learn_file', 'learn_topic'],
|
|
49
|
-
model: 'sonnet',
|
|
50
|
-
source: 'builtin',
|
|
19
|
+
explore: {
|
|
20
|
+
id: 'explore',
|
|
21
|
+
label: 'Explore',
|
|
22
|
+
summary: 'map the codebase, answer architectural questions, and locate patterns quickly',
|
|
23
|
+
instructions: [
|
|
24
|
+
'Prioritize read/search/glob tools before editing. Call out every directory or file you investigated.',
|
|
25
|
+
'Return a crisp summary of what you learned plus direct file references so the parent agent can follow up.',
|
|
26
|
+
],
|
|
27
|
+
defaultModel: 'haiku',
|
|
51
28
|
},
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
summary: '
|
|
56
|
-
|
|
29
|
+
plan: {
|
|
30
|
+
id: 'plan',
|
|
31
|
+
label: 'Plan',
|
|
32
|
+
summary: 'break down complex efforts into actionable steps and identify risks or dependencies',
|
|
33
|
+
instructions: [
|
|
57
34
|
'Produce a numbered plan with estimates, dependency notes, and explicit testing checkpoints.',
|
|
58
35
|
'If the task mentions code changes, suggest which files/modules should be edited and why before any implementation occurs.',
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
tools: ['read', 'read_file', 'read_files', 'list_files', 'search_files', 'glob_search', 'grep_search', 'find_definition', 'context_snapshot'],
|
|
62
|
-
model: 'sonnet',
|
|
63
|
-
source: 'builtin',
|
|
36
|
+
],
|
|
37
|
+
defaultModel: 'sonnet',
|
|
64
38
|
},
|
|
65
|
-
|
|
39
|
+
};
|
|
66
40
|
const MODEL_ID_LOOKUP = {
|
|
67
41
|
sonnet: { provider: 'anthropic', model: 'claude-sonnet-4-5-20250929' },
|
|
68
42
|
opus: { provider: 'anthropic', model: 'claude-opus-4-20250514' },
|
|
@@ -71,24 +45,12 @@ const MODEL_ID_LOOKUP = {
|
|
|
71
45
|
const TASK_STORE_DIR = join(homedir(), '.erosolar', 'tasks');
|
|
72
46
|
export class TaskRunner {
|
|
73
47
|
context;
|
|
74
|
-
registry;
|
|
75
48
|
snapshots = new TaskSnapshotStore();
|
|
76
|
-
constructor(context
|
|
49
|
+
constructor(context) {
|
|
77
50
|
this.context = context;
|
|
78
|
-
this.registry =
|
|
79
|
-
registry ??
|
|
80
|
-
new AgentRegistry({
|
|
81
|
-
workingDir: context.workingDir,
|
|
82
|
-
builtIns: BUILTIN_AGENT_DEFINITIONS,
|
|
83
|
-
});
|
|
84
51
|
}
|
|
85
52
|
async runTask(options) {
|
|
86
|
-
|
|
87
|
-
const definition = this.registry.resolve(options.subagentType);
|
|
88
|
-
if (!definition) {
|
|
89
|
-
const available = this.registry.list().map((agent) => agent.name).join(', ');
|
|
90
|
-
throw new Error(`Subagent "${options.subagentType}" is not defined. Available agents: ${available || 'none found'}`);
|
|
91
|
-
}
|
|
53
|
+
const definition = resolveSubAgentDefinition(options.subagentType);
|
|
92
54
|
const { allowedPluginIds } = this.resolveToolPermissions();
|
|
93
55
|
const adapterOptions = allowedPluginIds.size
|
|
94
56
|
? {
|
|
@@ -104,14 +66,8 @@ export class TaskRunner {
|
|
|
104
66
|
});
|
|
105
67
|
try {
|
|
106
68
|
const session = runtime.session;
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
const { runtime: toolRuntime, allowedTools, missingTools } = this.buildToolRuntime(session.toolRuntime, definition.tools);
|
|
110
|
-
const systemPrompt = this.composeSystemPrompt(session.profileConfig.systemPrompt, definition, options.description, {
|
|
111
|
-
thoroughness: options.thoroughness,
|
|
112
|
-
allowedTools,
|
|
113
|
-
missingTools,
|
|
114
|
-
});
|
|
69
|
+
const selection = this.buildModelSelection(session.profileConfig, options.model ?? definition.defaultModel);
|
|
70
|
+
const systemPrompt = this.composeSystemPrompt(session.profileConfig.systemPrompt, definition, options.description);
|
|
115
71
|
let finalMetadata = null;
|
|
116
72
|
const agent = session.createAgent({
|
|
117
73
|
provider: selection.provider,
|
|
@@ -125,7 +81,7 @@ export class TaskRunner {
|
|
|
125
81
|
finalMetadata = metadata;
|
|
126
82
|
}
|
|
127
83
|
},
|
|
128
|
-
}
|
|
84
|
+
});
|
|
129
85
|
const resumeSnapshot = options.resumeId ? await this.snapshots.load(options.resumeId) : null;
|
|
130
86
|
if (options.resumeId && !resumeSnapshot) {
|
|
131
87
|
throw new Error(`Resume id "${options.resumeId}" was not found. Call Task without resume to start a new agent.`);
|
|
@@ -142,7 +98,7 @@ export class TaskRunner {
|
|
|
142
98
|
id: resumeId,
|
|
143
99
|
profile: this.context.profile,
|
|
144
100
|
description: options.description,
|
|
145
|
-
subagentType: definition.
|
|
101
|
+
subagentType: definition.id,
|
|
146
102
|
history,
|
|
147
103
|
createdAt: resumeSnapshot?.createdAt ?? new Date().toISOString(),
|
|
148
104
|
updatedAt: new Date().toISOString(),
|
|
@@ -151,7 +107,7 @@ export class TaskRunner {
|
|
|
151
107
|
const usageLine = formatUsage(extractUsage(finalMetadata));
|
|
152
108
|
const durationLine = `Duration: ${formatDuration(durationMs)}${usageLine ? ` | ${usageLine}` : ''}`;
|
|
153
109
|
const lines = [
|
|
154
|
-
`Task "${options.description}" completed by ${definition.
|
|
110
|
+
`Task "${options.description}" completed by ${definition.label} agent (${selection.model})`,
|
|
155
111
|
`${durationLine} | Resume ID: ${resumeId}`,
|
|
156
112
|
];
|
|
157
113
|
if (definition.summary) {
|
|
@@ -167,18 +123,6 @@ export class TaskRunner {
|
|
|
167
123
|
await runtime.host.dispose();
|
|
168
124
|
}
|
|
169
125
|
}
|
|
170
|
-
buildToolRuntime(baseRuntime, requestedTools) {
|
|
171
|
-
if (!requestedTools?.length) {
|
|
172
|
-
return { runtime: baseRuntime, allowedTools: [], missingTools: [] };
|
|
173
|
-
}
|
|
174
|
-
const available = baseRuntime.listProviderTools();
|
|
175
|
-
const { allowedNames, missing } = resolveAllowedToolNames(requestedTools, available);
|
|
176
|
-
if (!allowedNames.size) {
|
|
177
|
-
return { runtime: baseRuntime, allowedTools: [], missingTools: missing };
|
|
178
|
-
}
|
|
179
|
-
const runtime = new RestrictedToolRuntime(baseRuntime, allowedNames);
|
|
180
|
-
return { runtime, allowedTools: Array.from(allowedNames), missingTools: missing };
|
|
181
|
-
}
|
|
182
126
|
resolveToolPermissions() {
|
|
183
127
|
const settings = loadToolSettings();
|
|
184
128
|
const selection = buildEnabledToolSet(settings);
|
|
@@ -188,9 +132,8 @@ export class TaskRunner {
|
|
|
188
132
|
};
|
|
189
133
|
}
|
|
190
134
|
buildModelSelection(profile, preferred) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const mapping = MODEL_ID_LOOKUP[normalized];
|
|
135
|
+
if (preferred && MODEL_ID_LOOKUP[preferred]) {
|
|
136
|
+
const mapping = MODEL_ID_LOOKUP[preferred];
|
|
194
137
|
return {
|
|
195
138
|
provider: mapping.provider,
|
|
196
139
|
model: mapping.model,
|
|
@@ -205,46 +148,16 @@ export class TaskRunner {
|
|
|
205
148
|
maxTokens: profile.maxTokens,
|
|
206
149
|
};
|
|
207
150
|
}
|
|
208
|
-
composeSystemPrompt(basePrompt, definition, description
|
|
209
|
-
const toolLine = extras.allowedTools.length
|
|
210
|
-
? `Allowed tools for this subagent: ${extras.allowedTools.join(', ')}.`
|
|
211
|
-
: 'This subagent inherits all tools available to the parent agent.';
|
|
212
|
-
const missingLine = extras.missingTools.length
|
|
213
|
-
? `Requested but unavailable tools: ${extras.missingTools.join(', ')}.`
|
|
214
|
-
: null;
|
|
215
|
-
const thoroughnessLine = extras.thoroughness
|
|
216
|
-
? `Requested exploration thoroughness: ${extras.thoroughness.replace('_', ' ')}.`
|
|
217
|
-
: null;
|
|
218
|
-
const permissionLine = definition.permissionMode
|
|
219
|
-
? `Permission mode: ${definition.permissionMode}`
|
|
220
|
-
: null;
|
|
221
|
-
const skillsLine = definition.skills && definition.skills.length
|
|
222
|
-
? `Auto-load skills: ${definition.skills.join(', ')}`
|
|
223
|
-
: null;
|
|
224
|
-
const agentMeta = [
|
|
225
|
-
`Subagent: ${definition.name}`,
|
|
226
|
-
`Purpose: ${definition.summary || definition.description}`,
|
|
227
|
-
toolLine,
|
|
228
|
-
missingLine,
|
|
229
|
-
permissionLine,
|
|
230
|
-
skillsLine,
|
|
231
|
-
thoroughnessLine,
|
|
232
|
-
]
|
|
233
|
-
.filter(Boolean)
|
|
234
|
-
.join('\n');
|
|
151
|
+
composeSystemPrompt(basePrompt, definition, description) {
|
|
235
152
|
const lines = [
|
|
236
153
|
basePrompt.trim(),
|
|
237
154
|
'',
|
|
238
155
|
'You are an autonomous sub-agent launched via the Task tool. Operate independently and return a single comprehensive report to the parent agent.',
|
|
239
156
|
`Task summary: ${description}`,
|
|
240
|
-
|
|
157
|
+
`Agent specialization: ${definition.summary}`,
|
|
241
158
|
'',
|
|
242
159
|
'Execution rules:',
|
|
243
|
-
|
|
244
|
-
'- Keep your own context focused; do not bloat the response with unnecessary content.',
|
|
245
|
-
'- Always cite the evidence, commands, and files you touched so the parent agent can verify your work.',
|
|
246
|
-
'- If you are read-only, explicitly state any edits you avoided and the files you inspected.',
|
|
247
|
-
definition.prompt,
|
|
160
|
+
...definition.instructions.map((line, index) => `${index + 1}. ${line}`),
|
|
248
161
|
'',
|
|
249
162
|
'When you finish:',
|
|
250
163
|
'- Provide a concise summary with actionable next steps.',
|
|
@@ -254,82 +167,6 @@ export class TaskRunner {
|
|
|
254
167
|
return lines.join('\n').trim();
|
|
255
168
|
}
|
|
256
169
|
}
|
|
257
|
-
const BASELINE_ALLOWED_TOOLS = ['context_snapshot', 'capabilities_overview', 'profile_details'];
|
|
258
|
-
class RestrictedToolRuntime {
|
|
259
|
-
base;
|
|
260
|
-
allowed;
|
|
261
|
-
constructor(base, allowed) {
|
|
262
|
-
this.base = base;
|
|
263
|
-
this.allowed = allowed;
|
|
264
|
-
}
|
|
265
|
-
listProviderTools() {
|
|
266
|
-
return this.base.listProviderTools().filter((tool) => this.allowed.has(tool.name));
|
|
267
|
-
}
|
|
268
|
-
async execute(call, context) {
|
|
269
|
-
if (!this.allowed.has(call.name)) {
|
|
270
|
-
const allowedList = Array.from(this.allowed).join(', ');
|
|
271
|
-
return `Tool "${call.name}" is not allowed for this agent. Allowed tools: ${allowedList || 'none'}.`;
|
|
272
|
-
}
|
|
273
|
-
return this.base.execute(call, context);
|
|
274
|
-
}
|
|
275
|
-
registerSuite(suite) {
|
|
276
|
-
this.base.registerSuite(suite);
|
|
277
|
-
}
|
|
278
|
-
unregisterSuite(id) {
|
|
279
|
-
this.base.unregisterSuite(id);
|
|
280
|
-
}
|
|
281
|
-
clearCache() {
|
|
282
|
-
this.base.clearCache();
|
|
283
|
-
}
|
|
284
|
-
getCacheStats() {
|
|
285
|
-
return this.base.getCacheStats();
|
|
286
|
-
}
|
|
287
|
-
clearToolHistory() {
|
|
288
|
-
this.base.clearToolHistory();
|
|
289
|
-
}
|
|
290
|
-
getToolHistory() {
|
|
291
|
-
return this.base.getToolHistory();
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
function resolveAllowedToolNames(requested, available) {
|
|
295
|
-
const normalizedAvailable = new Map();
|
|
296
|
-
for (const tool of available) {
|
|
297
|
-
normalizedAvailable.set(normalizeToolName(tool.name), tool.name);
|
|
298
|
-
}
|
|
299
|
-
const allowed = new Set();
|
|
300
|
-
const missing = [];
|
|
301
|
-
// Always allow baseline runtime metadata tools
|
|
302
|
-
for (const name of BASELINE_ALLOWED_TOOLS) {
|
|
303
|
-
const normalized = normalizeToolName(name);
|
|
304
|
-
if (normalizedAvailable.has(normalized)) {
|
|
305
|
-
allowed.add(normalizedAvailable.get(normalized));
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
allowed.add(name);
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
for (const entry of requested) {
|
|
312
|
-
const normalized = normalizeToolName(entry);
|
|
313
|
-
if (!normalized) {
|
|
314
|
-
continue;
|
|
315
|
-
}
|
|
316
|
-
const exact = normalizedAvailable.get(normalized);
|
|
317
|
-
if (exact) {
|
|
318
|
-
allowed.add(exact);
|
|
319
|
-
continue;
|
|
320
|
-
}
|
|
321
|
-
const fuzzy = Array.from(normalizedAvailable.entries()).find(([candidate]) => candidate.includes(normalized) || normalized.includes(candidate));
|
|
322
|
-
if (fuzzy) {
|
|
323
|
-
allowed.add(fuzzy[1]);
|
|
324
|
-
continue;
|
|
325
|
-
}
|
|
326
|
-
missing.push(entry);
|
|
327
|
-
}
|
|
328
|
-
return { allowedNames: allowed, missing };
|
|
329
|
-
}
|
|
330
|
-
function normalizeToolName(value) {
|
|
331
|
-
return value.replace(/[^a-z0-9]/gi, '').toLowerCase();
|
|
332
|
-
}
|
|
333
170
|
class TaskSnapshotStore {
|
|
334
171
|
async load(id) {
|
|
335
172
|
try {
|
|
@@ -360,6 +197,18 @@ class TaskSnapshotStore {
|
|
|
360
197
|
return `task_${randomUUID()}`;
|
|
361
198
|
}
|
|
362
199
|
}
|
|
200
|
+
function resolveSubAgentDefinition(name) {
|
|
201
|
+
const normalized = name ? name.trim().toLowerCase() : '';
|
|
202
|
+
const candidate = normalized ? SUBAGENT_DEFINITIONS[normalized] : undefined;
|
|
203
|
+
if (candidate) {
|
|
204
|
+
return candidate;
|
|
205
|
+
}
|
|
206
|
+
const fallback = SUBAGENT_DEFINITIONS['general-purpose'];
|
|
207
|
+
if (!fallback) {
|
|
208
|
+
throw new Error('General-purpose subagent definition is missing.');
|
|
209
|
+
}
|
|
210
|
+
return fallback;
|
|
211
|
+
}
|
|
363
212
|
function sanitizeId(value) {
|
|
364
213
|
return value.replace(/[^a-zA-Z0-9_-]/g, '').slice(0, 64) || 'task';
|
|
365
214
|
}
|