erosolar-cli 1.7.345 → 1.7.346
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 -31
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +166 -362
- 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 +120 -236
- package/dist/shell/terminalInput.d.ts.map +1 -1
- package/dist/shell/terminalInput.js +539 -1044
- package/dist/shell/terminalInput.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts +21 -99
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +30 -135
- 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 +47 -180
- 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 +259 -140
- 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
|
@@ -35,14 +35,10 @@ export class TerminalInputAdapter {
|
|
|
35
35
|
this.input.on('toggleAutoContinue', () => this.callbacks.onToggleAutoContinue?.());
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
|
-
* Start capturing input
|
|
38
|
+
* Start capturing input
|
|
39
39
|
*/
|
|
40
40
|
start() {
|
|
41
41
|
this.input.enableBracketedPaste();
|
|
42
|
-
// Mouse tracking disabled by default to preserve native text selection
|
|
43
|
-
// Users can select and copy text normally with their mouse
|
|
44
|
-
// Use PageUp/PageDown, Ctrl+Home/End for scrollback navigation
|
|
45
|
-
// this.input.enableMouseTracking();
|
|
46
42
|
// Set up raw mode
|
|
47
43
|
if (this.inStream.isTTY) {
|
|
48
44
|
this.inStream.setRawMode(true);
|
|
@@ -54,15 +50,14 @@ export class TerminalInputAdapter {
|
|
|
54
50
|
this.setupRawDataInterception();
|
|
55
51
|
// Set up keypress handling
|
|
56
52
|
this.setupKeypressHandler();
|
|
57
|
-
//
|
|
53
|
+
// Initial render
|
|
54
|
+
this.input.forceRender();
|
|
58
55
|
}
|
|
59
56
|
/**
|
|
60
57
|
* Stop capturing input
|
|
61
58
|
*/
|
|
62
59
|
stop() {
|
|
63
60
|
this.input.disableBracketedPaste();
|
|
64
|
-
// Only disable if it was enabled
|
|
65
|
-
// this.input.disableMouseTracking();
|
|
66
61
|
// Remove handlers
|
|
67
62
|
if (this.rawDataHandler) {
|
|
68
63
|
this.restoreRawDataInterception();
|
|
@@ -85,10 +80,11 @@ export class TerminalInputAdapter {
|
|
|
85
80
|
this.input.setMode(streaming ? 'streaming' : 'idle');
|
|
86
81
|
}
|
|
87
82
|
/**
|
|
88
|
-
*
|
|
83
|
+
* Set the row where content ends (for idle mode positioning).
|
|
84
|
+
* Input area will render starting from this row + 1.
|
|
89
85
|
*/
|
|
90
|
-
|
|
91
|
-
this.input.
|
|
86
|
+
setContentEndRow(row) {
|
|
87
|
+
this.input.setContentEndRow(row);
|
|
92
88
|
}
|
|
93
89
|
/**
|
|
94
90
|
* Get current buffer content
|
|
@@ -111,8 +107,8 @@ export class TerminalInputAdapter {
|
|
|
111
107
|
/**
|
|
112
108
|
* Update context usage indicator (0-100, null to clear)
|
|
113
109
|
*/
|
|
114
|
-
setContextUsage(percentage
|
|
115
|
-
this.input.updateContextUsage(percentage
|
|
110
|
+
setContextUsage(percentage) {
|
|
111
|
+
this.input.updateContextUsage(percentage);
|
|
116
112
|
}
|
|
117
113
|
/**
|
|
118
114
|
* Surface mode toggle states (verification/auto-continue) in the control bar.
|
|
@@ -120,6 +116,13 @@ export class TerminalInputAdapter {
|
|
|
120
116
|
setModeToggles(options) {
|
|
121
117
|
this.input.setModeToggles(options);
|
|
122
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
|
+
}
|
|
123
126
|
/**
|
|
124
127
|
* Update the inline status message shown before the prompt (e.g., streaming heartbeat).
|
|
125
128
|
*/
|
|
@@ -140,24 +143,12 @@ export class TerminalInputAdapter {
|
|
|
140
143
|
setStreamingLabel(label) {
|
|
141
144
|
this.input.setStreamingLabel(label);
|
|
142
145
|
}
|
|
143
|
-
/**
|
|
144
|
-
* Surface meta header information (elapsed, tokens/context) above the divider.
|
|
145
|
-
*/
|
|
146
|
-
setMetaStatus(meta) {
|
|
147
|
-
this.input.setMetaStatus(meta);
|
|
148
|
-
}
|
|
149
146
|
/**
|
|
150
147
|
* Clear all status messages at once (convenience method).
|
|
151
148
|
*/
|
|
152
149
|
clearAllStatus() {
|
|
153
150
|
this.input.clearAllStatus();
|
|
154
151
|
}
|
|
155
|
-
/**
|
|
156
|
-
* Surface model/provider context in the controls bar.
|
|
157
|
-
*/
|
|
158
|
-
setModelContext(options) {
|
|
159
|
-
this.input.setModelContext(options);
|
|
160
|
-
}
|
|
161
152
|
/**
|
|
162
153
|
* Set the edit guard mode explicitly
|
|
163
154
|
*/
|
|
@@ -194,114 +185,6 @@ export class TerminalInputAdapter {
|
|
|
194
185
|
forceRender() {
|
|
195
186
|
this.input.forceRender();
|
|
196
187
|
}
|
|
197
|
-
/**
|
|
198
|
-
* Stream content above the pinned chat box (Claude Code method).
|
|
199
|
-
* Automatically enables scroll region on first call.
|
|
200
|
-
*/
|
|
201
|
-
streamContent(content) {
|
|
202
|
-
this.input.streamContent(content);
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Enable scroll region (Claude Code method).
|
|
206
|
-
* Chat box is pinned below scroll region.
|
|
207
|
-
*/
|
|
208
|
-
enableScrollRegion() {
|
|
209
|
-
this.input.enableScrollRegion();
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Disable scroll region and reset to full terminal.
|
|
213
|
-
*/
|
|
214
|
-
disableScrollRegion() {
|
|
215
|
-
this.input.disableScrollRegion();
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* @deprecated Use streamContent() instead
|
|
219
|
-
* Write content directly into the scroll region.
|
|
220
|
-
*/
|
|
221
|
-
writeToScrollRegion(content) {
|
|
222
|
-
this.input.writeToScrollRegion(content);
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Enter alternate screen buffer.
|
|
226
|
-
*/
|
|
227
|
-
enterAlternateScreen() {
|
|
228
|
-
this.input.enterAlternateScreen();
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* Exit alternate screen buffer.
|
|
232
|
-
*/
|
|
233
|
-
exitAlternateScreen() {
|
|
234
|
-
this.input.exitAlternateScreen();
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Clear the entire terminal screen and reset content position.
|
|
238
|
-
* This removes all content including the launching command.
|
|
239
|
-
*/
|
|
240
|
-
clearScreen() {
|
|
241
|
-
this.input.clearScreen();
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Enter streaming scroll region mode.
|
|
245
|
-
* Call once at the start of streaming.
|
|
246
|
-
*/
|
|
247
|
-
enterStreamingScrollRegion() {
|
|
248
|
-
this.input.enterStreamingScrollRegion();
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Exit streaming scroll region mode.
|
|
252
|
-
* Call once at the end of streaming.
|
|
253
|
-
*/
|
|
254
|
-
exitStreamingScrollRegion() {
|
|
255
|
-
this.input.exitStreamingScrollRegion();
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* Get scrollback buffer content for persistence.
|
|
259
|
-
*/
|
|
260
|
-
getScrollbackBuffer() {
|
|
261
|
-
return this.input.getScrollbackBuffer();
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Load scrollback buffer for restoration.
|
|
265
|
-
*/
|
|
266
|
-
loadScrollbackBuffer(lines) {
|
|
267
|
-
this.input.loadScrollbackBuffer(lines);
|
|
268
|
-
}
|
|
269
|
-
/**
|
|
270
|
-
* Clear scrollback buffer.
|
|
271
|
-
*/
|
|
272
|
-
clearScrollbackBuffer() {
|
|
273
|
-
this.input.clearScrollbackBuffer();
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* Check if alternate screen buffer is currently active.
|
|
277
|
-
*/
|
|
278
|
-
isAlternateScreenActive() {
|
|
279
|
-
return this.input.isAlternateScreenActive();
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Get a snapshot of the scrollback buffer (for display on exit).
|
|
283
|
-
*/
|
|
284
|
-
getScrollbackSnapshot() {
|
|
285
|
-
return this.input.getScrollbackSnapshot();
|
|
286
|
-
}
|
|
287
|
-
/**
|
|
288
|
-
* Reset content position to top of scroll region.
|
|
289
|
-
*/
|
|
290
|
-
resetContentPosition() {
|
|
291
|
-
this.input.resetContentPosition();
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Set the content row explicitly (used after banner is written).
|
|
295
|
-
*/
|
|
296
|
-
setContentRow(row) {
|
|
297
|
-
this.input.setContentRow(row);
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* Get the current content row position.
|
|
301
|
-
*/
|
|
302
|
-
getContentRow() {
|
|
303
|
-
return this.input.getContentRow();
|
|
304
|
-
}
|
|
305
188
|
/**
|
|
306
189
|
* Handle terminal resize
|
|
307
190
|
*/
|
|
@@ -322,12 +205,24 @@ export class TerminalInputAdapter {
|
|
|
322
205
|
return this.input;
|
|
323
206
|
}
|
|
324
207
|
/**
|
|
325
|
-
* Register with display's output interceptor for
|
|
326
|
-
* This ensures streamed output goes to the scroll region during processing.
|
|
208
|
+
* Register with display's output interceptor (kept for API compatibility).
|
|
327
209
|
*/
|
|
328
210
|
registerOutputInterceptor(display) {
|
|
329
211
|
this.input.registerOutputInterceptor(display);
|
|
330
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
|
+
}
|
|
331
226
|
// ===========================================================================
|
|
332
227
|
// PRIVATE
|
|
333
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;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,GAAG;SAClB,CAAC,CAAC;QAEH,iBAAiB;QACjB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QACjE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC;QAC/D,IA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,GAAG,EAAE,IAAI;gBACf,KAAK,EAAE,GAAG,EAAE,KAAK;gBACjB,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,46 +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
|
-
'Operate in read-only mode. Do not edit files or run mutating commands.',
|
|
19
|
+
explore: {
|
|
20
|
+
id: 'explore',
|
|
21
|
+
label: 'Explore',
|
|
22
|
+
summary: 'map the codebase, answer architectural questions, and locate patterns quickly',
|
|
23
|
+
instructions: [
|
|
27
24
|
'Prioritize read/search/glob tools before editing. Call out every directory or file you investigated.',
|
|
28
25
|
'Return a crisp summary of what you learned plus direct file references so the parent agent can follow up.',
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
model: 'haiku',
|
|
32
|
-
source: 'builtin',
|
|
26
|
+
],
|
|
27
|
+
defaultModel: 'haiku',
|
|
33
28
|
},
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
summary: '
|
|
38
|
-
|
|
29
|
+
plan: {
|
|
30
|
+
id: 'plan',
|
|
31
|
+
label: 'Plan',
|
|
32
|
+
summary: 'break down complex efforts into actionable steps and identify risks or dependencies',
|
|
33
|
+
instructions: [
|
|
39
34
|
'Produce a numbered plan with estimates, dependency notes, and explicit testing checkpoints.',
|
|
40
35
|
'If the task mentions code changes, suggest which files/modules should be edited and why before any implementation occurs.',
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
tools: ['read', 'read_file', 'read_files', 'list_files', 'search_files', 'glob_search', 'grep_search', 'find_definition', 'context_snapshot'],
|
|
44
|
-
model: 'sonnet',
|
|
45
|
-
source: 'builtin',
|
|
36
|
+
],
|
|
37
|
+
defaultModel: 'sonnet',
|
|
46
38
|
},
|
|
47
|
-
|
|
39
|
+
};
|
|
48
40
|
const MODEL_ID_LOOKUP = {
|
|
49
41
|
sonnet: { provider: 'anthropic', model: 'claude-sonnet-4-5-20250929' },
|
|
50
42
|
opus: { provider: 'anthropic', model: 'claude-opus-4-20250514' },
|
|
@@ -53,24 +45,12 @@ const MODEL_ID_LOOKUP = {
|
|
|
53
45
|
const TASK_STORE_DIR = join(homedir(), '.erosolar', 'tasks');
|
|
54
46
|
export class TaskRunner {
|
|
55
47
|
context;
|
|
56
|
-
registry;
|
|
57
48
|
snapshots = new TaskSnapshotStore();
|
|
58
|
-
constructor(context
|
|
49
|
+
constructor(context) {
|
|
59
50
|
this.context = context;
|
|
60
|
-
this.registry =
|
|
61
|
-
registry ??
|
|
62
|
-
new AgentRegistry({
|
|
63
|
-
workingDir: context.workingDir,
|
|
64
|
-
builtIns: BUILTIN_AGENT_DEFINITIONS,
|
|
65
|
-
});
|
|
66
51
|
}
|
|
67
52
|
async runTask(options) {
|
|
68
|
-
|
|
69
|
-
const definition = this.registry.resolve(options.subagentType);
|
|
70
|
-
if (!definition) {
|
|
71
|
-
const available = this.registry.list().map((agent) => agent.name).join(', ');
|
|
72
|
-
throw new Error(`Subagent "${options.subagentType}" is not defined. Available agents: ${available || 'none found'}`);
|
|
73
|
-
}
|
|
53
|
+
const definition = resolveSubAgentDefinition(options.subagentType);
|
|
74
54
|
const { allowedPluginIds } = this.resolveToolPermissions();
|
|
75
55
|
const adapterOptions = allowedPluginIds.size
|
|
76
56
|
? {
|
|
@@ -86,14 +66,8 @@ export class TaskRunner {
|
|
|
86
66
|
});
|
|
87
67
|
try {
|
|
88
68
|
const session = runtime.session;
|
|
89
|
-
const
|
|
90
|
-
const
|
|
91
|
-
const { runtime: toolRuntime, allowedTools, missingTools } = this.buildToolRuntime(session.toolRuntime, definition.tools);
|
|
92
|
-
const systemPrompt = this.composeSystemPrompt(session.profileConfig.systemPrompt, definition, options.description, {
|
|
93
|
-
thoroughness: options.thoroughness,
|
|
94
|
-
allowedTools,
|
|
95
|
-
missingTools,
|
|
96
|
-
});
|
|
69
|
+
const selection = this.buildModelSelection(session.profileConfig, options.model ?? definition.defaultModel);
|
|
70
|
+
const systemPrompt = this.composeSystemPrompt(session.profileConfig.systemPrompt, definition, options.description);
|
|
97
71
|
let finalMetadata = null;
|
|
98
72
|
const agent = session.createAgent({
|
|
99
73
|
provider: selection.provider,
|
|
@@ -107,7 +81,7 @@ export class TaskRunner {
|
|
|
107
81
|
finalMetadata = metadata;
|
|
108
82
|
}
|
|
109
83
|
},
|
|
110
|
-
}
|
|
84
|
+
});
|
|
111
85
|
const resumeSnapshot = options.resumeId ? await this.snapshots.load(options.resumeId) : null;
|
|
112
86
|
if (options.resumeId && !resumeSnapshot) {
|
|
113
87
|
throw new Error(`Resume id "${options.resumeId}" was not found. Call Task without resume to start a new agent.`);
|
|
@@ -124,7 +98,7 @@ export class TaskRunner {
|
|
|
124
98
|
id: resumeId,
|
|
125
99
|
profile: this.context.profile,
|
|
126
100
|
description: options.description,
|
|
127
|
-
subagentType: definition.
|
|
101
|
+
subagentType: definition.id,
|
|
128
102
|
history,
|
|
129
103
|
createdAt: resumeSnapshot?.createdAt ?? new Date().toISOString(),
|
|
130
104
|
updatedAt: new Date().toISOString(),
|
|
@@ -133,7 +107,7 @@ export class TaskRunner {
|
|
|
133
107
|
const usageLine = formatUsage(extractUsage(finalMetadata));
|
|
134
108
|
const durationLine = `Duration: ${formatDuration(durationMs)}${usageLine ? ` | ${usageLine}` : ''}`;
|
|
135
109
|
const lines = [
|
|
136
|
-
`Task "${options.description}" completed by ${definition.
|
|
110
|
+
`Task "${options.description}" completed by ${definition.label} agent (${selection.model})`,
|
|
137
111
|
`${durationLine} | Resume ID: ${resumeId}`,
|
|
138
112
|
];
|
|
139
113
|
if (definition.summary) {
|
|
@@ -149,18 +123,6 @@ export class TaskRunner {
|
|
|
149
123
|
await runtime.host.dispose();
|
|
150
124
|
}
|
|
151
125
|
}
|
|
152
|
-
buildToolRuntime(baseRuntime, requestedTools) {
|
|
153
|
-
if (!requestedTools?.length) {
|
|
154
|
-
return { runtime: baseRuntime, allowedTools: [], missingTools: [] };
|
|
155
|
-
}
|
|
156
|
-
const available = baseRuntime.listProviderTools();
|
|
157
|
-
const { allowedNames, missing } = resolveAllowedToolNames(requestedTools, available);
|
|
158
|
-
if (!allowedNames.size) {
|
|
159
|
-
return { runtime: baseRuntime, allowedTools: [], missingTools: missing };
|
|
160
|
-
}
|
|
161
|
-
const runtime = new RestrictedToolRuntime(baseRuntime, allowedNames);
|
|
162
|
-
return { runtime, allowedTools: Array.from(allowedNames), missingTools: missing };
|
|
163
|
-
}
|
|
164
126
|
resolveToolPermissions() {
|
|
165
127
|
const settings = loadToolSettings();
|
|
166
128
|
const selection = buildEnabledToolSet(settings);
|
|
@@ -170,9 +132,8 @@ export class TaskRunner {
|
|
|
170
132
|
};
|
|
171
133
|
}
|
|
172
134
|
buildModelSelection(profile, preferred) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
const mapping = MODEL_ID_LOOKUP[normalized];
|
|
135
|
+
if (preferred && MODEL_ID_LOOKUP[preferred]) {
|
|
136
|
+
const mapping = MODEL_ID_LOOKUP[preferred];
|
|
176
137
|
return {
|
|
177
138
|
provider: mapping.provider,
|
|
178
139
|
model: mapping.model,
|
|
@@ -187,46 +148,16 @@ export class TaskRunner {
|
|
|
187
148
|
maxTokens: profile.maxTokens,
|
|
188
149
|
};
|
|
189
150
|
}
|
|
190
|
-
composeSystemPrompt(basePrompt, definition, description
|
|
191
|
-
const toolLine = extras.allowedTools.length
|
|
192
|
-
? `Allowed tools for this subagent: ${extras.allowedTools.join(', ')}.`
|
|
193
|
-
: 'This subagent inherits all tools available to the parent agent.';
|
|
194
|
-
const missingLine = extras.missingTools.length
|
|
195
|
-
? `Requested but unavailable tools: ${extras.missingTools.join(', ')}.`
|
|
196
|
-
: null;
|
|
197
|
-
const thoroughnessLine = extras.thoroughness
|
|
198
|
-
? `Requested exploration thoroughness: ${extras.thoroughness.replace('_', ' ')}.`
|
|
199
|
-
: null;
|
|
200
|
-
const permissionLine = definition.permissionMode
|
|
201
|
-
? `Permission mode: ${definition.permissionMode}`
|
|
202
|
-
: null;
|
|
203
|
-
const skillsLine = definition.skills && definition.skills.length
|
|
204
|
-
? `Auto-load skills: ${definition.skills.join(', ')}`
|
|
205
|
-
: null;
|
|
206
|
-
const agentMeta = [
|
|
207
|
-
`Subagent: ${definition.name}`,
|
|
208
|
-
`Purpose: ${definition.summary || definition.description}`,
|
|
209
|
-
toolLine,
|
|
210
|
-
missingLine,
|
|
211
|
-
permissionLine,
|
|
212
|
-
skillsLine,
|
|
213
|
-
thoroughnessLine,
|
|
214
|
-
]
|
|
215
|
-
.filter(Boolean)
|
|
216
|
-
.join('\n');
|
|
151
|
+
composeSystemPrompt(basePrompt, definition, description) {
|
|
217
152
|
const lines = [
|
|
218
153
|
basePrompt.trim(),
|
|
219
154
|
'',
|
|
220
155
|
'You are an autonomous sub-agent launched via the Task tool. Operate independently and return a single comprehensive report to the parent agent.',
|
|
221
156
|
`Task summary: ${description}`,
|
|
222
|
-
|
|
157
|
+
`Agent specialization: ${definition.summary}`,
|
|
223
158
|
'',
|
|
224
159
|
'Execution rules:',
|
|
225
|
-
|
|
226
|
-
'- Keep your own context focused; do not bloat the response with unnecessary content.',
|
|
227
|
-
'- Always cite the evidence, commands, and files you touched so the parent agent can verify your work.',
|
|
228
|
-
'- If you are read-only, explicitly state any edits you avoided and the files you inspected.',
|
|
229
|
-
definition.prompt,
|
|
160
|
+
...definition.instructions.map((line, index) => `${index + 1}. ${line}`),
|
|
230
161
|
'',
|
|
231
162
|
'When you finish:',
|
|
232
163
|
'- Provide a concise summary with actionable next steps.',
|
|
@@ -236,82 +167,6 @@ export class TaskRunner {
|
|
|
236
167
|
return lines.join('\n').trim();
|
|
237
168
|
}
|
|
238
169
|
}
|
|
239
|
-
const BASELINE_ALLOWED_TOOLS = ['context_snapshot', 'capabilities_overview', 'profile_details'];
|
|
240
|
-
class RestrictedToolRuntime {
|
|
241
|
-
base;
|
|
242
|
-
allowed;
|
|
243
|
-
constructor(base, allowed) {
|
|
244
|
-
this.base = base;
|
|
245
|
-
this.allowed = allowed;
|
|
246
|
-
}
|
|
247
|
-
listProviderTools() {
|
|
248
|
-
return this.base.listProviderTools().filter((tool) => this.allowed.has(tool.name));
|
|
249
|
-
}
|
|
250
|
-
async execute(call, context) {
|
|
251
|
-
if (!this.allowed.has(call.name)) {
|
|
252
|
-
const allowedList = Array.from(this.allowed).join(', ');
|
|
253
|
-
return `Tool "${call.name}" is not allowed for this agent. Allowed tools: ${allowedList || 'none'}.`;
|
|
254
|
-
}
|
|
255
|
-
return this.base.execute(call, context);
|
|
256
|
-
}
|
|
257
|
-
registerSuite(suite) {
|
|
258
|
-
this.base.registerSuite(suite);
|
|
259
|
-
}
|
|
260
|
-
unregisterSuite(id) {
|
|
261
|
-
this.base.unregisterSuite(id);
|
|
262
|
-
}
|
|
263
|
-
clearCache() {
|
|
264
|
-
this.base.clearCache();
|
|
265
|
-
}
|
|
266
|
-
getCacheStats() {
|
|
267
|
-
return this.base.getCacheStats();
|
|
268
|
-
}
|
|
269
|
-
clearToolHistory() {
|
|
270
|
-
this.base.clearToolHistory();
|
|
271
|
-
}
|
|
272
|
-
getToolHistory() {
|
|
273
|
-
return this.base.getToolHistory();
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
function resolveAllowedToolNames(requested, available) {
|
|
277
|
-
const normalizedAvailable = new Map();
|
|
278
|
-
for (const tool of available) {
|
|
279
|
-
normalizedAvailable.set(normalizeToolName(tool.name), tool.name);
|
|
280
|
-
}
|
|
281
|
-
const allowed = new Set();
|
|
282
|
-
const missing = [];
|
|
283
|
-
// Always allow baseline runtime metadata tools
|
|
284
|
-
for (const name of BASELINE_ALLOWED_TOOLS) {
|
|
285
|
-
const normalized = normalizeToolName(name);
|
|
286
|
-
if (normalizedAvailable.has(normalized)) {
|
|
287
|
-
allowed.add(normalizedAvailable.get(normalized));
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
allowed.add(name);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
for (const entry of requested) {
|
|
294
|
-
const normalized = normalizeToolName(entry);
|
|
295
|
-
if (!normalized) {
|
|
296
|
-
continue;
|
|
297
|
-
}
|
|
298
|
-
const exact = normalizedAvailable.get(normalized);
|
|
299
|
-
if (exact) {
|
|
300
|
-
allowed.add(exact);
|
|
301
|
-
continue;
|
|
302
|
-
}
|
|
303
|
-
const fuzzy = Array.from(normalizedAvailable.entries()).find(([candidate]) => candidate.includes(normalized) || normalized.includes(candidate));
|
|
304
|
-
if (fuzzy) {
|
|
305
|
-
allowed.add(fuzzy[1]);
|
|
306
|
-
continue;
|
|
307
|
-
}
|
|
308
|
-
missing.push(entry);
|
|
309
|
-
}
|
|
310
|
-
return { allowedNames: allowed, missing };
|
|
311
|
-
}
|
|
312
|
-
function normalizeToolName(value) {
|
|
313
|
-
return value.replace(/[^a-z0-9]/gi, '').toLowerCase();
|
|
314
|
-
}
|
|
315
170
|
class TaskSnapshotStore {
|
|
316
171
|
async load(id) {
|
|
317
172
|
try {
|
|
@@ -342,6 +197,18 @@ class TaskSnapshotStore {
|
|
|
342
197
|
return `task_${randomUUID()}`;
|
|
343
198
|
}
|
|
344
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
|
+
}
|
|
345
212
|
function sanitizeId(value) {
|
|
346
213
|
return value.replace(/[^a-zA-Z0-9_-]/g, '').slice(0, 64) || 'task';
|
|
347
214
|
}
|