erosolar-cli 1.7.260 → 1.7.262
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 +22 -148
- package/dist/core/customCommands.d.ts +1 -0
- package/dist/core/customCommands.d.ts.map +1 -1
- package/dist/core/customCommands.js +3 -0
- package/dist/core/customCommands.js.map +1 -1
- package/dist/core/hooks.d.ts +113 -0
- package/dist/core/hooks.d.ts.map +1 -0
- package/dist/core/hooks.js +267 -0
- package/dist/core/hooks.js.map +1 -0
- package/dist/core/metricsTracker.d.ts +122 -0
- package/dist/core/metricsTracker.d.ts.map +1 -0
- package/dist/{alpha-zero → core}/metricsTracker.js +2 -5
- package/dist/core/metricsTracker.js.map +1 -0
- package/dist/core/toolPreconditions.d.ts.map +1 -1
- package/dist/core/toolPreconditions.js +0 -14
- package/dist/core/toolPreconditions.js.map +1 -1
- package/dist/core/toolRuntime.d.ts.map +1 -1
- package/dist/core/toolRuntime.js +0 -5
- package/dist/core/toolRuntime.js.map +1 -1
- package/dist/core/toolValidation.d.ts.map +1 -1
- package/dist/core/toolValidation.js +14 -3
- package/dist/core/toolValidation.js.map +1 -1
- package/dist/core/validationRunner.d.ts +1 -3
- package/dist/core/validationRunner.d.ts.map +1 -1
- package/dist/core/validationRunner.js.map +1 -1
- package/dist/mcp/sseClient.d.ts.map +1 -1
- package/dist/mcp/sseClient.js +9 -18
- package/dist/mcp/sseClient.js.map +1 -1
- package/dist/plugins/tools/build/buildPlugin.d.ts +0 -6
- package/dist/plugins/tools/build/buildPlugin.d.ts.map +1 -1
- package/dist/plugins/tools/build/buildPlugin.js +4 -10
- package/dist/plugins/tools/build/buildPlugin.js.map +1 -1
- package/dist/shell/interactiveShell.d.ts +10 -2
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +182 -36
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/terminalInput.d.ts +68 -140
- package/dist/shell/terminalInput.d.ts.map +1 -1
- package/dist/shell/terminalInput.js +424 -685
- package/dist/shell/terminalInput.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts +20 -15
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +14 -22
- package/dist/shell/terminalInputAdapter.js.map +1 -1
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +13 -12
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/dist/ui/display.d.ts +19 -0
- package/dist/ui/display.d.ts.map +1 -1
- package/dist/ui/display.js +131 -33
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/theme.d.ts.map +1 -1
- package/dist/ui/theme.js +6 -8
- package/dist/ui/theme.js.map +1 -1
- package/dist/ui/toolDisplay.d.ts +0 -158
- package/dist/ui/toolDisplay.d.ts.map +1 -1
- package/dist/ui/toolDisplay.js +0 -348
- package/dist/ui/toolDisplay.js.map +1 -1
- package/dist/ui/unified/layout.d.ts +1 -0
- package/dist/ui/unified/layout.d.ts.map +1 -1
- package/dist/ui/unified/layout.js +15 -25
- package/dist/ui/unified/layout.js.map +1 -1
- package/package.json +1 -1
- package/dist/alpha-zero/agentWrapper.d.ts +0 -84
- package/dist/alpha-zero/agentWrapper.d.ts.map +0 -1
- package/dist/alpha-zero/agentWrapper.js +0 -171
- package/dist/alpha-zero/agentWrapper.js.map +0 -1
- package/dist/alpha-zero/codeEvaluator.d.ts +0 -25
- package/dist/alpha-zero/codeEvaluator.d.ts.map +0 -1
- package/dist/alpha-zero/codeEvaluator.js +0 -273
- package/dist/alpha-zero/codeEvaluator.js.map +0 -1
- package/dist/alpha-zero/competitiveRunner.d.ts +0 -66
- package/dist/alpha-zero/competitiveRunner.d.ts.map +0 -1
- package/dist/alpha-zero/competitiveRunner.js +0 -224
- package/dist/alpha-zero/competitiveRunner.js.map +0 -1
- package/dist/alpha-zero/index.d.ts +0 -67
- package/dist/alpha-zero/index.d.ts.map +0 -1
- package/dist/alpha-zero/index.js +0 -99
- package/dist/alpha-zero/index.js.map +0 -1
- package/dist/alpha-zero/introspection.d.ts +0 -128
- package/dist/alpha-zero/introspection.d.ts.map +0 -1
- package/dist/alpha-zero/introspection.js +0 -300
- package/dist/alpha-zero/introspection.js.map +0 -1
- package/dist/alpha-zero/metricsTracker.d.ts +0 -71
- package/dist/alpha-zero/metricsTracker.d.ts.map +0 -1
- package/dist/alpha-zero/metricsTracker.js.map +0 -1
- package/dist/alpha-zero/security/core.d.ts +0 -125
- package/dist/alpha-zero/security/core.d.ts.map +0 -1
- package/dist/alpha-zero/security/core.js +0 -271
- package/dist/alpha-zero/security/core.js.map +0 -1
- package/dist/alpha-zero/security/google.d.ts +0 -125
- package/dist/alpha-zero/security/google.d.ts.map +0 -1
- package/dist/alpha-zero/security/google.js +0 -311
- package/dist/alpha-zero/security/google.js.map +0 -1
- package/dist/alpha-zero/security/googleLoader.d.ts +0 -17
- package/dist/alpha-zero/security/googleLoader.d.ts.map +0 -1
- package/dist/alpha-zero/security/googleLoader.js +0 -41
- package/dist/alpha-zero/security/googleLoader.js.map +0 -1
- package/dist/alpha-zero/security/index.d.ts +0 -29
- package/dist/alpha-zero/security/index.d.ts.map +0 -1
- package/dist/alpha-zero/security/index.js +0 -32
- package/dist/alpha-zero/security/index.js.map +0 -1
- package/dist/alpha-zero/security/simulation.d.ts +0 -124
- package/dist/alpha-zero/security/simulation.d.ts.map +0 -1
- package/dist/alpha-zero/security/simulation.js +0 -277
- package/dist/alpha-zero/security/simulation.js.map +0 -1
- package/dist/alpha-zero/selfModification.d.ts +0 -109
- package/dist/alpha-zero/selfModification.d.ts.map +0 -1
- package/dist/alpha-zero/selfModification.js +0 -233
- package/dist/alpha-zero/selfModification.js.map +0 -1
- package/dist/alpha-zero/types.d.ts +0 -170
- package/dist/alpha-zero/types.d.ts.map +0 -1
- package/dist/alpha-zero/types.js +0 -31
- package/dist/alpha-zero/types.js.map +0 -1
- package/dist/core/aiFlowOptimizer.d.ts +0 -26
- package/dist/core/aiFlowOptimizer.d.ts.map +0 -1
- package/dist/core/aiFlowOptimizer.js +0 -31
- package/dist/core/aiFlowOptimizer.js.map +0 -1
- package/dist/core/aiOptimizationEngine.d.ts +0 -158
- package/dist/core/aiOptimizationEngine.d.ts.map +0 -1
- package/dist/core/aiOptimizationEngine.js +0 -428
- package/dist/core/aiOptimizationEngine.js.map +0 -1
- package/dist/core/aiOptimizationIntegration.d.ts +0 -93
- package/dist/core/aiOptimizationIntegration.d.ts.map +0 -1
- package/dist/core/aiOptimizationIntegration.js +0 -250
- package/dist/core/aiOptimizationIntegration.js.map +0 -1
- package/dist/core/enhancedErrorRecovery.d.ts +0 -100
- package/dist/core/enhancedErrorRecovery.d.ts.map +0 -1
- package/dist/core/enhancedErrorRecovery.js +0 -345
- package/dist/core/enhancedErrorRecovery.js.map +0 -1
- package/dist/core/unified/errors.d.ts +0 -189
- package/dist/core/unified/errors.d.ts.map +0 -1
- package/dist/core/unified/errors.js +0 -497
- package/dist/core/unified/errors.js.map +0 -1
- package/dist/core/unified/index.d.ts +0 -19
- package/dist/core/unified/index.d.ts.map +0 -1
- package/dist/core/unified/index.js +0 -68
- package/dist/core/unified/index.js.map +0 -1
- package/dist/core/unified/schema.d.ts +0 -101
- package/dist/core/unified/schema.d.ts.map +0 -1
- package/dist/core/unified/schema.js +0 -350
- package/dist/core/unified/schema.js.map +0 -1
- package/dist/core/unified/toolRuntime.d.ts +0 -179
- package/dist/core/unified/toolRuntime.d.ts.map +0 -1
- package/dist/core/unified/toolRuntime.js +0 -517
- package/dist/core/unified/toolRuntime.js.map +0 -1
- package/dist/core/unified/tools.d.ts +0 -127
- package/dist/core/unified/tools.d.ts.map +0 -1
- package/dist/core/unified/tools.js +0 -1333
- package/dist/core/unified/tools.js.map +0 -1
- package/dist/core/unified/types.d.ts +0 -352
- package/dist/core/unified/types.d.ts.map +0 -1
- package/dist/core/unified/types.js +0 -12
- package/dist/core/unified/types.js.map +0 -1
- package/dist/core/unified/version.d.ts +0 -209
- package/dist/core/unified/version.d.ts.map +0 -1
- package/dist/core/unified/version.js +0 -454
- package/dist/core/unified/version.js.map +0 -1
- package/dist/security/active-stack-security.d.ts +0 -112
- package/dist/security/active-stack-security.d.ts.map +0 -1
- package/dist/security/active-stack-security.js +0 -296
- package/dist/security/active-stack-security.js.map +0 -1
- package/dist/security/advanced-persistence-research.d.ts +0 -92
- package/dist/security/advanced-persistence-research.d.ts.map +0 -1
- package/dist/security/advanced-persistence-research.js +0 -195
- package/dist/security/advanced-persistence-research.js.map +0 -1
- package/dist/security/advanced-targeting.d.ts +0 -119
- package/dist/security/advanced-targeting.d.ts.map +0 -1
- package/dist/security/advanced-targeting.js +0 -233
- package/dist/security/advanced-targeting.js.map +0 -1
- package/dist/security/assessment/vulnerabilityAssessment.d.ts +0 -104
- package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +0 -1
- package/dist/security/assessment/vulnerabilityAssessment.js +0 -315
- package/dist/security/assessment/vulnerabilityAssessment.js.map +0 -1
- package/dist/security/authorization/securityAuthorization.d.ts +0 -88
- package/dist/security/authorization/securityAuthorization.d.ts.map +0 -1
- package/dist/security/authorization/securityAuthorization.js +0 -172
- package/dist/security/authorization/securityAuthorization.js.map +0 -1
- package/dist/security/comprehensive-targeting.d.ts +0 -85
- package/dist/security/comprehensive-targeting.d.ts.map +0 -1
- package/dist/security/comprehensive-targeting.js +0 -438
- package/dist/security/comprehensive-targeting.js.map +0 -1
- package/dist/security/global-security-integration.d.ts +0 -91
- package/dist/security/global-security-integration.d.ts.map +0 -1
- package/dist/security/global-security-integration.js +0 -218
- package/dist/security/global-security-integration.js.map +0 -1
- package/dist/security/index.d.ts +0 -38
- package/dist/security/index.d.ts.map +0 -1
- package/dist/security/index.js +0 -47
- package/dist/security/index.js.map +0 -1
- package/dist/security/persistence-analyzer.d.ts +0 -56
- package/dist/security/persistence-analyzer.d.ts.map +0 -1
- package/dist/security/persistence-analyzer.js +0 -187
- package/dist/security/persistence-analyzer.js.map +0 -1
- package/dist/security/persistence-cli.d.ts +0 -36
- package/dist/security/persistence-cli.d.ts.map +0 -1
- package/dist/security/persistence-cli.js +0 -160
- package/dist/security/persistence-cli.js.map +0 -1
- package/dist/security/persistence-research.d.ts +0 -92
- package/dist/security/persistence-research.d.ts.map +0 -1
- package/dist/security/persistence-research.js +0 -364
- package/dist/security/persistence-research.js.map +0 -1
- package/dist/security/research/persistenceResearch.d.ts +0 -97
- package/dist/security/research/persistenceResearch.d.ts.map +0 -1
- package/dist/security/research/persistenceResearch.js +0 -282
- package/dist/security/research/persistenceResearch.js.map +0 -1
- package/dist/security/security-integration.d.ts +0 -74
- package/dist/security/security-integration.d.ts.map +0 -1
- package/dist/security/security-integration.js +0 -137
- package/dist/security/security-integration.js.map +0 -1
- package/dist/security/security-testing-framework.d.ts +0 -112
- package/dist/security/security-testing-framework.d.ts.map +0 -1
- package/dist/security/security-testing-framework.js +0 -364
- package/dist/security/security-testing-framework.js.map +0 -1
- package/dist/security/simulation/attackSimulation.d.ts +0 -93
- package/dist/security/simulation/attackSimulation.d.ts.map +0 -1
- package/dist/security/simulation/attackSimulation.js +0 -341
- package/dist/security/simulation/attackSimulation.js.map +0 -1
- package/dist/security/strategic-operations.d.ts +0 -100
- package/dist/security/strategic-operations.d.ts.map +0 -1
- package/dist/security/strategic-operations.js +0 -276
- package/dist/security/strategic-operations.js.map +0 -1
- package/dist/security/tool-security-wrapper.d.ts +0 -58
- package/dist/security/tool-security-wrapper.d.ts.map +0 -1
- package/dist/security/tool-security-wrapper.js +0 -156
- package/dist/security/tool-security-wrapper.js.map +0 -1
- package/dist/shell/claudeCodeStreamHandler.d.ts +0 -145
- package/dist/shell/claudeCodeStreamHandler.d.ts.map +0 -1
- package/dist/shell/claudeCodeStreamHandler.js +0 -322
- package/dist/shell/claudeCodeStreamHandler.js.map +0 -1
- package/dist/shell/inputQueueManager.d.ts +0 -144
- package/dist/shell/inputQueueManager.d.ts.map +0 -1
- package/dist/shell/inputQueueManager.js +0 -290
- package/dist/shell/inputQueueManager.js.map +0 -1
- package/dist/shell/streamingOutputManager.d.ts +0 -115
- package/dist/shell/streamingOutputManager.d.ts.map +0 -1
- package/dist/shell/streamingOutputManager.js +0 -225
- package/dist/shell/streamingOutputManager.js.map +0 -1
- package/dist/ui/persistentPrompt.d.ts +0 -50
- package/dist/ui/persistentPrompt.d.ts.map +0 -1
- package/dist/ui/persistentPrompt.js +0 -92
- package/dist/ui/persistentPrompt.js.map +0 -1
- package/dist/ui/terminalUISchema.d.ts +0 -195
- package/dist/ui/terminalUISchema.d.ts.map +0 -1
- package/dist/ui/terminalUISchema.js +0 -113
- package/dist/ui/terminalUISchema.js.map +0 -1
- package/scripts/deploy-security-capabilities.js +0 -178
package/README.md
CHANGED
|
@@ -1,173 +1,47 @@
|
|
|
1
1
|
# erosolar-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Unified command-line agent with a single, persistent chat box pinned to the bottom of every session. Output streams scroll above it while the prompt and status controls stay anchored.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
| **Erosolar CLI** |  |
|
|
10
|
-
|
|
11
|
-
### Current State
|
|
12
|
-
|
|
13
|
-
**Claude Code** currently delivers the best results for creating complete projects from scratch. It successfully built a CS50 final project end-to-end and launched it without manual intervention.
|
|
14
|
-
|
|
15
|
-
**OpenAI Codex CLI** provides solid coding assistance but requires more human guidance for complex multi-step project creation.
|
|
16
|
-
|
|
17
|
-
**Erosolar CLI** is actively being developed by Bo Shang to match and eventually exceed these capabilities. The goal is to achieve the same level of autonomous project creation, constrained only by the underlying model's limits—not by the CLI tooling itself. This work is ongoing.
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## Overview
|
|
22
|
-
|
|
23
|
-
**Erosolar CLI** is a sophisticated, unified AI coding agent framework for the command line that provides multi-provider AI support with advanced code intelligence and security research capabilities.
|
|
24
|
-
|
|
25
|
-
### Core Purpose
|
|
26
|
-
|
|
27
|
-
1. **Universal AI Interface**: Acts as a model-agnostic CLI that works with any major AI provider (OpenAI, Anthropic, Google, xAI, DeepSeek, Ollama) - you bring your own API keys
|
|
28
|
-
|
|
29
|
-
2. **Advanced Code Intelligence**: Provides comprehensive coding capabilities including:
|
|
30
|
-
- File system operations (read/write/edit)
|
|
31
|
-
- Code search and analysis
|
|
32
|
-
- Bash command execution
|
|
33
|
-
- Git operations
|
|
34
|
-
- Browser automation
|
|
35
|
-
- Cloud deployment
|
|
36
|
-
- Testing and validation
|
|
37
|
-
|
|
38
|
-
3. **Security Research Toolkit**: Includes sophisticated security testing and research capabilities for:
|
|
39
|
-
- Penetration testing
|
|
40
|
-
- Vulnerability scanning
|
|
41
|
-
- Threat intelligence
|
|
42
|
-
- Red team operations
|
|
43
|
-
- Counter-intelligence simulations
|
|
44
|
-
|
|
45
|
-
### Key Features
|
|
46
|
-
|
|
47
|
-
- **Multi-Provider Support** - Switch between OpenAI, Anthropic, Google, xAI, DeepSeek, or run locally with Ollama
|
|
48
|
-
- **25+ Built-in Models** - From GPT-5 to Claude Opus to Gemini Pro to local Llama models
|
|
49
|
-
- **Advanced Code Intelligence** - Full file system access, git operations, bash command execution
|
|
50
|
-
- **Browser Automation** - Web scraping, form filling, authentication, testing
|
|
51
|
-
- **Cloud Deployment** - Firebase, Vercel, Netlify, AWS, GCP, Azure support
|
|
52
|
-
- **Security Research** - Penetration testing, vulnerability scanning, threat intelligence
|
|
53
|
-
- **Testing Framework** - Unit tests, E2E tests, accessibility tests, performance audits
|
|
54
|
-
- **Email Automation** - SMTP email sending, batch campaigns, template personalization
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## Installation
|
|
5
|
+
## Highlights
|
|
6
|
+
- One chat box, always on the bottom during the entire session (idle or streaming).
|
|
7
|
+
- Shared control bar for status, verify/build toggle, auto-continue, and context gauge.
|
|
8
|
+
- Works with OpenAI, Anthropic, Google, xAI, DeepSeek, and local Ollama using the same UI contract.
|
|
59
9
|
|
|
10
|
+
## Install
|
|
60
11
|
```bash
|
|
61
12
|
npm install -g erosolar-cli
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Or use npx:
|
|
65
|
-
|
|
66
|
-
```bash
|
|
13
|
+
# or
|
|
67
14
|
npx erosolar-cli
|
|
68
15
|
```
|
|
69
16
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## Quick Start
|
|
73
|
-
|
|
17
|
+
## Run
|
|
74
18
|
```bash
|
|
75
|
-
#
|
|
19
|
+
# default profile
|
|
76
20
|
erosolar
|
|
77
21
|
|
|
78
|
-
#
|
|
22
|
+
# choose model/provider
|
|
79
23
|
erosolar --provider openai --model gpt-4o
|
|
80
24
|
|
|
81
|
-
#
|
|
82
|
-
erosolar --profile erosolar-code
|
|
83
|
-
|
|
84
|
-
# Resume last session
|
|
25
|
+
# restore last session
|
|
85
26
|
erosolar --restore
|
|
86
27
|
```
|
|
87
28
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
## Configuration
|
|
91
|
-
|
|
92
|
-
Set your API keys as environment variables:
|
|
93
|
-
|
|
29
|
+
## Configure
|
|
30
|
+
Set the keys you need before launching:
|
|
94
31
|
```bash
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
# Anthropic
|
|
99
|
-
ANTHROPIC_API_KEY=sk-ant-...
|
|
100
|
-
|
|
101
|
-
# Google AI
|
|
32
|
+
OPENAI_API_KEY=...
|
|
33
|
+
ANTHROPIC_API_KEY=...
|
|
102
34
|
GOOGLE_API_KEY=...
|
|
103
|
-
|
|
104
|
-
# xAI
|
|
105
35
|
XAI_API_KEY=...
|
|
106
|
-
|
|
107
|
-
# DeepSeek
|
|
108
36
|
DEEPSEEK_API_KEY=...
|
|
109
|
-
|
|
110
|
-
# Ollama (local)
|
|
111
37
|
OLLAMA_BASE_URL=http://localhost:11434
|
|
112
38
|
```
|
|
113
39
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
Options:
|
|
122
|
-
--provider <name> AI provider (openai, anthropic, google, xai, deepseek, ollama)
|
|
123
|
-
--model <name> Specific model to use
|
|
124
|
-
--profile <name> Agent profile (general, erosolar-code)
|
|
125
|
-
--restore Resume last session
|
|
126
|
-
--version Show version
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## Agent Profiles
|
|
132
|
-
|
|
133
|
-
Erosolar CLI supports multiple agent profiles optimized for different tasks:
|
|
134
|
-
|
|
135
|
-
- **`erosolar-code`**: Coding specialist optimized for fast, deterministic edits
|
|
136
|
-
- **`general`**: General-purpose agent for research and analysis
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## Development Status
|
|
141
|
-
|
|
142
|
-
Erosolar CLI is actively being developed to achieve production readiness. Current focus areas include:
|
|
143
|
-
|
|
144
|
-
- ✅ Multi-provider AI support
|
|
145
|
-
- ✅ Advanced code intelligence
|
|
146
|
-
- ✅ Security research capabilities
|
|
147
|
-
- 🔄 Performance optimization
|
|
148
|
-
- 🔄 Enterprise features
|
|
149
|
-
- 🔄 Enhanced reliability
|
|
150
|
-
|
|
151
|
-
See [CRITICAL_ENHANCEMENTS.md](./CRITICAL_ENHANCEMENTS.md) for detailed roadmap.
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
## License
|
|
156
|
-
|
|
157
|
-
MIT
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
|
-
## Links
|
|
162
|
-
|
|
163
|
-
- [npm Package](https://www.npmjs.com/package/erosolar-cli)
|
|
164
|
-
- [GitHub](https://github.com/ErosolarAI/erosolar-by-bo)
|
|
165
|
-
- [Issues](https://github.com/ErosolarAI/erosolar-by-bo/issues)
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## Author
|
|
170
|
-
|
|
171
|
-
Built by **Bo Shang** with assistance from Claude Code and OpenAI Codex CLI. A special thanks goes to Samantha Briasco-Stewart (erosolar) for motivating Bo to code.
|
|
40
|
+
## Options
|
|
41
|
+
- `--provider <name>` pick the AI provider
|
|
42
|
+
- `--model <name>` choose a model
|
|
43
|
+
- `--profile <name>` switch agent profiles (e.g., `erosolar-code`)
|
|
44
|
+
- `--restore` resume the previous session
|
|
45
|
+
- `--version` show the CLI version
|
|
172
46
|
|
|
173
|
-
|
|
47
|
+
MIT licensed.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customCommands.d.ts","sourceRoot":"","sources":["../../src/core/customCommands.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAM7C,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"customCommands.d.ts","sourceRoot":"","sources":["../../src/core/customCommands.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAM7C,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,UAAU,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,uBAAuB,CAAC,GAAG,GAAE,MAA2B,GAAG,mBAAmB,EAAE,CAmC/F;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,mBAAmB,EAC5B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,oBAAoB,GAC5B,MAAM,CAYR"}
|
|
@@ -70,12 +70,15 @@ function normalizeCommand(entry, source) {
|
|
|
70
70
|
}
|
|
71
71
|
const requireInputEntry = record['requireInput'] ?? record['inputRequired'];
|
|
72
72
|
const requireInput = typeof requireInputEntry === 'boolean' ? requireInputEntry : false;
|
|
73
|
+
const categoryEntry = record['category'];
|
|
74
|
+
const category = typeof categoryEntry === 'string' ? categoryEntry.trim() : undefined;
|
|
73
75
|
return {
|
|
74
76
|
command,
|
|
75
77
|
description,
|
|
76
78
|
template: templateValue,
|
|
77
79
|
requireInput,
|
|
78
80
|
source,
|
|
81
|
+
category,
|
|
79
82
|
};
|
|
80
83
|
}
|
|
81
84
|
//# sourceMappingURL=customCommands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customCommands.js","sourceRoot":"","sources":["../../src/core/customCommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAIlC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC,CAAC;AAC1F,MAAM,kBAAkB,GACtB,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;
|
|
1
|
+
{"version":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MAAM,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC;IAC5E,MAAM,YAAY,GAAG,OAAO,iBAAiB,KAAK,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC;IAExF,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;IACzC,MAAM,QAAQ,GAAG,OAAO,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAEtF,OAAO;QACL,OAAO;QACP,WAAW;QACX,QAAQ,EAAE,aAAa;QACvB,YAAY;QACZ,MAAM;QACN,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks System
|
|
3
|
+
*
|
|
4
|
+
* Event-triggered scripts that automate workflows, based on Claude Code's hooks architecture.
|
|
5
|
+
* Hooks can execute shell commands or query an LLM for decisions.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Hook event types
|
|
9
|
+
*/
|
|
10
|
+
export type HookEvent = 'PreToolUse' | 'PostToolUse' | 'PermissionRequest' | 'UserPromptSubmit' | 'SessionStart' | 'SessionEnd' | 'Stop' | 'SubagentStop' | 'Notification';
|
|
11
|
+
/**
|
|
12
|
+
* Hook types
|
|
13
|
+
*/
|
|
14
|
+
export type HookType = 'command' | 'prompt';
|
|
15
|
+
/**
|
|
16
|
+
* Hook definition
|
|
17
|
+
*/
|
|
18
|
+
export interface HookDefinition {
|
|
19
|
+
/** Regex pattern to match tool names or events */
|
|
20
|
+
matcher?: string;
|
|
21
|
+
/** Type of hook: 'command' for shell, 'prompt' for LLM */
|
|
22
|
+
type: HookType;
|
|
23
|
+
/** Shell command to execute (for command hooks) */
|
|
24
|
+
command?: string;
|
|
25
|
+
/** Prompt to send to LLM (for prompt hooks) */
|
|
26
|
+
prompt?: string;
|
|
27
|
+
/** Timeout in milliseconds */
|
|
28
|
+
timeout?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Hook execution result
|
|
32
|
+
*/
|
|
33
|
+
export interface HookResult {
|
|
34
|
+
success: boolean;
|
|
35
|
+
output?: string;
|
|
36
|
+
decision?: 'allow' | 'deny' | 'continue';
|
|
37
|
+
reason?: string;
|
|
38
|
+
error?: string;
|
|
39
|
+
blocked?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Hook execution context
|
|
43
|
+
*/
|
|
44
|
+
export interface HookContext {
|
|
45
|
+
event: HookEvent;
|
|
46
|
+
toolName?: string;
|
|
47
|
+
toolArgs?: Record<string, unknown>;
|
|
48
|
+
toolResult?: string;
|
|
49
|
+
userInput?: string;
|
|
50
|
+
sessionId?: string;
|
|
51
|
+
workingDir: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Hooks configuration
|
|
55
|
+
*/
|
|
56
|
+
export interface HooksConfig {
|
|
57
|
+
[event: string]: HookDefinition[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Load hooks from settings files
|
|
61
|
+
*/
|
|
62
|
+
export declare function loadHooks(workingDir: string): HooksConfig;
|
|
63
|
+
/**
|
|
64
|
+
* HooksManager class for managing and executing hooks
|
|
65
|
+
*/
|
|
66
|
+
export declare class HooksManager {
|
|
67
|
+
private hooks;
|
|
68
|
+
private workingDir;
|
|
69
|
+
constructor(workingDir: string);
|
|
70
|
+
/**
|
|
71
|
+
* Reload hooks from settings files
|
|
72
|
+
*/
|
|
73
|
+
reload(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Check if hooks are configured for an event
|
|
76
|
+
*/
|
|
77
|
+
hasHooks(event: HookEvent): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Get all hooks for an event
|
|
80
|
+
*/
|
|
81
|
+
getHooks(event: HookEvent): HookDefinition[];
|
|
82
|
+
/**
|
|
83
|
+
* Execute all matching hooks for an event
|
|
84
|
+
*/
|
|
85
|
+
executeHooks(context: HookContext): Promise<HookResult[]>;
|
|
86
|
+
/**
|
|
87
|
+
* Execute pre-tool hooks and check if tool should proceed
|
|
88
|
+
*/
|
|
89
|
+
executePreToolHooks(toolName: string, args: Record<string, unknown>): Promise<{
|
|
90
|
+
allowed: boolean;
|
|
91
|
+
results: HookResult[];
|
|
92
|
+
}>;
|
|
93
|
+
/**
|
|
94
|
+
* Execute post-tool hooks
|
|
95
|
+
*/
|
|
96
|
+
executePostToolHooks(toolName: string, args: Record<string, unknown>, result: string): Promise<HookResult[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Execute user prompt hooks
|
|
99
|
+
*/
|
|
100
|
+
executeUserPromptHooks(userInput: string): Promise<{
|
|
101
|
+
allowed: boolean;
|
|
102
|
+
results: HookResult[];
|
|
103
|
+
}>;
|
|
104
|
+
/**
|
|
105
|
+
* Execute session lifecycle hooks
|
|
106
|
+
*/
|
|
107
|
+
executeSessionHook(event: 'SessionStart' | 'SessionEnd', sessionId: string): Promise<HookResult[]>;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Create a hooks manager for the given working directory
|
|
111
|
+
*/
|
|
112
|
+
export declare function createHooksManager(workingDir: string): HooksManager;
|
|
113
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/core/hooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH;;GAEG;AACH,MAAM,MAAM,SAAS,GACjB,YAAY,GACZ,aAAa,GACb,mBAAmB,GACnB,kBAAkB,GAClB,cAAc,GACd,YAAY,GACZ,MAAM,GACN,cAAc,GACd,cAAc,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,OAAO,CAAC,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,KAAK,EAAE,SAAS,GAAG,cAAc,EAAE;IAI5C;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAmB/D;;OAEG;IACG,mBAAmB,CACvB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;IAgBvD;;OAEG;IACG,oBAAoB,CACxB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,UAAU,EAAE,CAAC;IAYxB;;OAEG;IACG,sBAAsB,CAC1B,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;IAavD;;OAEG;IACG,kBAAkB,CACtB,KAAK,EAAE,cAAc,GAAG,YAAY,EACpC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,UAAU,EAAE,CAAC;CASzB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY,CAEnE"}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hooks System
|
|
3
|
+
*
|
|
4
|
+
* Event-triggered scripts that automate workflows, based on Claude Code's hooks architecture.
|
|
5
|
+
* Hooks can execute shell commands or query an LLM for decisions.
|
|
6
|
+
*/
|
|
7
|
+
import { exec } from 'node:child_process';
|
|
8
|
+
import { promisify } from 'node:util';
|
|
9
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { homedir } from 'node:os';
|
|
12
|
+
const execAsync = promisify(exec);
|
|
13
|
+
/**
|
|
14
|
+
* Load hooks from settings files
|
|
15
|
+
*/
|
|
16
|
+
export function loadHooks(workingDir) {
|
|
17
|
+
const hooks = {};
|
|
18
|
+
// Load from user settings (~/.claude/settings.json or ~/.erosolar/settings.json)
|
|
19
|
+
const userSettingsPaths = [
|
|
20
|
+
join(homedir(), '.claude', 'settings.json'),
|
|
21
|
+
join(homedir(), '.erosolar', 'settings.json'),
|
|
22
|
+
];
|
|
23
|
+
// Load from project settings (.claude/settings.json or .erosolar/settings.json)
|
|
24
|
+
const projectSettingsPaths = [
|
|
25
|
+
join(workingDir, '.claude', 'settings.json'),
|
|
26
|
+
join(workingDir, '.erosolar', 'settings.json'),
|
|
27
|
+
];
|
|
28
|
+
// Load user settings first, then override with project settings
|
|
29
|
+
for (const settingsPath of [...userSettingsPaths, ...projectSettingsPaths]) {
|
|
30
|
+
if (existsSync(settingsPath)) {
|
|
31
|
+
try {
|
|
32
|
+
const content = readFileSync(settingsPath, 'utf-8');
|
|
33
|
+
const settings = JSON.parse(content);
|
|
34
|
+
if (settings.hooks) {
|
|
35
|
+
for (const [event, eventHooks] of Object.entries(settings.hooks)) {
|
|
36
|
+
if (!hooks[event]) {
|
|
37
|
+
hooks[event] = [];
|
|
38
|
+
}
|
|
39
|
+
hooks[event].push(...eventHooks);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// Ignore invalid settings files
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return hooks;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Check if a hook matches the given context
|
|
52
|
+
*/
|
|
53
|
+
function matchesHook(hook, context) {
|
|
54
|
+
if (!hook.matcher) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
const regex = new RegExp(hook.matcher);
|
|
59
|
+
// Match against tool name if available
|
|
60
|
+
if (context.toolName) {
|
|
61
|
+
return regex.test(context.toolName);
|
|
62
|
+
}
|
|
63
|
+
// Match against event name
|
|
64
|
+
return regex.test(context.event);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Execute a command hook
|
|
72
|
+
*/
|
|
73
|
+
async function executeCommandHook(hook, context) {
|
|
74
|
+
if (!hook.command) {
|
|
75
|
+
return { success: false, error: 'No command specified' };
|
|
76
|
+
}
|
|
77
|
+
const timeout = hook.timeout ?? 30000;
|
|
78
|
+
// Prepare environment variables for the hook
|
|
79
|
+
const env = {
|
|
80
|
+
...process.env,
|
|
81
|
+
HOOK_EVENT: context.event,
|
|
82
|
+
HOOK_TOOL_NAME: context.toolName ?? '',
|
|
83
|
+
HOOK_TOOL_ARGS: context.toolArgs ? JSON.stringify(context.toolArgs) : '',
|
|
84
|
+
HOOK_TOOL_RESULT: context.toolResult ?? '',
|
|
85
|
+
HOOK_USER_INPUT: context.userInput ?? '',
|
|
86
|
+
HOOK_SESSION_ID: context.sessionId ?? '',
|
|
87
|
+
HOOK_WORKING_DIR: context.workingDir,
|
|
88
|
+
};
|
|
89
|
+
try {
|
|
90
|
+
const { stdout, stderr } = await execAsync(hook.command, {
|
|
91
|
+
cwd: context.workingDir,
|
|
92
|
+
timeout,
|
|
93
|
+
env,
|
|
94
|
+
});
|
|
95
|
+
// Try to parse JSON output for structured results
|
|
96
|
+
const output = stdout.trim();
|
|
97
|
+
try {
|
|
98
|
+
const parsed = JSON.parse(output);
|
|
99
|
+
return {
|
|
100
|
+
success: true,
|
|
101
|
+
output,
|
|
102
|
+
decision: parsed.decision,
|
|
103
|
+
reason: parsed.reason,
|
|
104
|
+
blocked: parsed.blocked,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
// Return raw output if not JSON
|
|
109
|
+
return {
|
|
110
|
+
success: true,
|
|
111
|
+
output,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
117
|
+
// Exit code 2 means blocking
|
|
118
|
+
if (message.includes('exit code 2')) {
|
|
119
|
+
return {
|
|
120
|
+
success: false,
|
|
121
|
+
blocked: true,
|
|
122
|
+
error: message,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
success: false,
|
|
127
|
+
error: message,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Execute a prompt hook (would query LLM in full implementation)
|
|
133
|
+
*/
|
|
134
|
+
async function executePromptHook(hook, context) {
|
|
135
|
+
if (!hook.prompt) {
|
|
136
|
+
return { success: false, error: 'No prompt specified' };
|
|
137
|
+
}
|
|
138
|
+
// In a full implementation, this would:
|
|
139
|
+
// 1. Send the prompt to a fast LLM (e.g., Haiku)
|
|
140
|
+
// 2. Parse the response for decision
|
|
141
|
+
// 3. Return the result
|
|
142
|
+
// For now, return a placeholder that allows continuation
|
|
143
|
+
return {
|
|
144
|
+
success: true,
|
|
145
|
+
decision: 'continue',
|
|
146
|
+
reason: 'Prompt hooks require LLM integration',
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Execute a single hook
|
|
151
|
+
*/
|
|
152
|
+
async function executeHook(hook, context) {
|
|
153
|
+
switch (hook.type) {
|
|
154
|
+
case 'command':
|
|
155
|
+
return executeCommandHook(hook, context);
|
|
156
|
+
case 'prompt':
|
|
157
|
+
return executePromptHook(hook, context);
|
|
158
|
+
default:
|
|
159
|
+
return { success: false, error: `Unknown hook type: ${hook.type}` };
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* HooksManager class for managing and executing hooks
|
|
164
|
+
*/
|
|
165
|
+
export class HooksManager {
|
|
166
|
+
hooks;
|
|
167
|
+
workingDir;
|
|
168
|
+
constructor(workingDir) {
|
|
169
|
+
this.workingDir = workingDir;
|
|
170
|
+
this.hooks = loadHooks(workingDir);
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Reload hooks from settings files
|
|
174
|
+
*/
|
|
175
|
+
reload() {
|
|
176
|
+
this.hooks = loadHooks(this.workingDir);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Check if hooks are configured for an event
|
|
180
|
+
*/
|
|
181
|
+
hasHooks(event) {
|
|
182
|
+
return Boolean(this.hooks[event]?.length);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Get all hooks for an event
|
|
186
|
+
*/
|
|
187
|
+
getHooks(event) {
|
|
188
|
+
return this.hooks[event] ?? [];
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Execute all matching hooks for an event
|
|
192
|
+
*/
|
|
193
|
+
async executeHooks(context) {
|
|
194
|
+
const eventHooks = this.hooks[context.event] ?? [];
|
|
195
|
+
const results = [];
|
|
196
|
+
for (const hook of eventHooks) {
|
|
197
|
+
if (matchesHook(hook, context)) {
|
|
198
|
+
const result = await executeHook(hook, context);
|
|
199
|
+
results.push(result);
|
|
200
|
+
// Stop on blocking result
|
|
201
|
+
if (result.blocked) {
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return results;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Execute pre-tool hooks and check if tool should proceed
|
|
210
|
+
*/
|
|
211
|
+
async executePreToolHooks(toolName, args) {
|
|
212
|
+
const context = {
|
|
213
|
+
event: 'PreToolUse',
|
|
214
|
+
toolName,
|
|
215
|
+
toolArgs: args,
|
|
216
|
+
workingDir: this.workingDir,
|
|
217
|
+
};
|
|
218
|
+
const results = await this.executeHooks(context);
|
|
219
|
+
// Check if any hook blocked the operation
|
|
220
|
+
const blocked = results.some((r) => r.blocked || r.decision === 'deny');
|
|
221
|
+
return { allowed: !blocked, results };
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Execute post-tool hooks
|
|
225
|
+
*/
|
|
226
|
+
async executePostToolHooks(toolName, args, result) {
|
|
227
|
+
const context = {
|
|
228
|
+
event: 'PostToolUse',
|
|
229
|
+
toolName,
|
|
230
|
+
toolArgs: args,
|
|
231
|
+
toolResult: result,
|
|
232
|
+
workingDir: this.workingDir,
|
|
233
|
+
};
|
|
234
|
+
return this.executeHooks(context);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Execute user prompt hooks
|
|
238
|
+
*/
|
|
239
|
+
async executeUserPromptHooks(userInput) {
|
|
240
|
+
const context = {
|
|
241
|
+
event: 'UserPromptSubmit',
|
|
242
|
+
userInput,
|
|
243
|
+
workingDir: this.workingDir,
|
|
244
|
+
};
|
|
245
|
+
const results = await this.executeHooks(context);
|
|
246
|
+
const blocked = results.some((r) => r.blocked || r.decision === 'deny');
|
|
247
|
+
return { allowed: !blocked, results };
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Execute session lifecycle hooks
|
|
251
|
+
*/
|
|
252
|
+
async executeSessionHook(event, sessionId) {
|
|
253
|
+
const context = {
|
|
254
|
+
event,
|
|
255
|
+
sessionId,
|
|
256
|
+
workingDir: this.workingDir,
|
|
257
|
+
};
|
|
258
|
+
return this.executeHooks(context);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Create a hooks manager for the given working directory
|
|
263
|
+
*/
|
|
264
|
+
export function createHooksManager(workingDir) {
|
|
265
|
+
return new HooksManager(workingDir);
|
|
266
|
+
}
|
|
267
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/core/hooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;A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