grok-cli-acp 0.1.2
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/.env.example +42 -0
- package/.github/workflows/ci.yml +30 -0
- package/.github/workflows/rust.yml +22 -0
- package/.grok/.env.example +85 -0
- package/.grok/COMPLETE_FIX_SUMMARY.md +466 -0
- package/.grok/ENV_CONFIG_GUIDE.md +173 -0
- package/.grok/QUICK_REFERENCE.md +180 -0
- package/.grok/README.md +104 -0
- package/.grok/TESTING_GUIDE.md +393 -0
- package/CHANGELOG.md +465 -0
- package/CODE_REVIEW_SUMMARY.md +414 -0
- package/COMPLETE_FIX_SUMMARY.md +415 -0
- package/CONFIGURATION.md +489 -0
- package/CONTEXT_FILES_GUIDE.md +419 -0
- package/CONTRIBUTING.md +55 -0
- package/CURSOR_POSITION_FIX.md +206 -0
- package/Cargo.toml +88 -0
- package/ERROR_HANDLING_REPORT.md +361 -0
- package/FINAL_FIX_SUMMARY.md +462 -0
- package/FIXES.md +37 -0
- package/FIXES_SUMMARY.md +87 -0
- package/GROK_API_MIGRATION_SUMMARY.md +111 -0
- package/LICENSE +22 -0
- package/MIGRATION_TO_GROK_API.md +223 -0
- package/README.md +504 -0
- package/REVIEW_COMPLETE.md +416 -0
- package/REVIEW_QUICK_REFERENCE.md +173 -0
- package/SECURITY.md +463 -0
- package/SECURITY_AUDIT.md +661 -0
- package/SETUP.md +287 -0
- package/TESTING_TOOLS.md +88 -0
- package/TESTING_TOOL_EXECUTION.md +239 -0
- package/TOOL_EXECUTION_FIX.md +491 -0
- package/VERIFICATION_CHECKLIST.md +419 -0
- package/docs/API.md +74 -0
- package/docs/CHAT_LOGGING.md +39 -0
- package/docs/CURSOR_FIX_DEMO.md +306 -0
- package/docs/ERROR_HANDLING_GUIDE.md +547 -0
- package/docs/FILE_OPERATIONS.md +449 -0
- package/docs/INTERACTIVE.md +401 -0
- package/docs/PROJECT_CREATION_GUIDE.md +570 -0
- package/docs/QUICKSTART.md +378 -0
- package/docs/QUICK_REFERENCE.md +691 -0
- package/docs/RELEASE_NOTES_0.1.2.md +240 -0
- package/docs/TOOLS.md +459 -0
- package/docs/TOOLS_QUICK_REFERENCE.md +210 -0
- package/docs/ZED_INTEGRATION.md +371 -0
- package/docs/extensions.md +464 -0
- package/docs/settings.md +293 -0
- package/examples/extensions/logging-hook/README.md +91 -0
- package/examples/extensions/logging-hook/extension.json +22 -0
- package/package.json +30 -0
- package/scripts/test_acp.py +252 -0
- package/scripts/test_acp.sh +143 -0
- package/scripts/test_acp_simple.sh +72 -0
- package/src/acp/mod.rs +741 -0
- package/src/acp/protocol.rs +323 -0
- package/src/acp/security.rs +298 -0
- package/src/acp/tools.rs +697 -0
- package/src/bin/banner_demo.rs +216 -0
- package/src/bin/docgen.rs +18 -0
- package/src/bin/installer.rs +217 -0
- package/src/cli/app.rs +310 -0
- package/src/cli/commands/acp.rs +721 -0
- package/src/cli/commands/chat.rs +485 -0
- package/src/cli/commands/code.rs +513 -0
- package/src/cli/commands/config.rs +394 -0
- package/src/cli/commands/health.rs +442 -0
- package/src/cli/commands/history.rs +421 -0
- package/src/cli/commands/mod.rs +14 -0
- package/src/cli/commands/settings.rs +1384 -0
- package/src/cli/mod.rs +166 -0
- package/src/config/mod.rs +2212 -0
- package/src/display/ascii_art.rs +139 -0
- package/src/display/banner.rs +289 -0
- package/src/display/components/input.rs +323 -0
- package/src/display/components/mod.rs +2 -0
- package/src/display/components/settings_list.rs +306 -0
- package/src/display/interactive.rs +1255 -0
- package/src/display/mod.rs +62 -0
- package/src/display/terminal.rs +42 -0
- package/src/display/tips.rs +316 -0
- package/src/grok_client_ext.rs +177 -0
- package/src/hooks/loader.rs +407 -0
- package/src/hooks/mod.rs +158 -0
- package/src/lib.rs +174 -0
- package/src/main.rs +65 -0
- package/src/mcp/client.rs +195 -0
- package/src/mcp/config.rs +20 -0
- package/src/mcp/mod.rs +6 -0
- package/src/mcp/protocol.rs +67 -0
- package/src/utils/auth.rs +41 -0
- package/src/utils/chat_logger.rs +568 -0
- package/src/utils/context.rs +390 -0
- package/src/utils/mod.rs +16 -0
- package/src/utils/network.rs +320 -0
- package/src/utils/rate_limiter.rs +166 -0
- package/src/utils/session.rs +73 -0
- package/src/utils/shell_permissions.rs +389 -0
- package/src/utils/telemetry.rs +41 -0
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
# Extension System Documentation
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The Grok CLI extension system provides a powerful way to extend the functionality of the CLI through hooks and custom tools. Extensions can intercept tool executions, add custom behaviors, and integrate with external systems.
|
|
6
|
+
|
|
7
|
+
## Architecture
|
|
8
|
+
|
|
9
|
+
The extension system consists of several key components:
|
|
10
|
+
|
|
11
|
+
### 1. Extension Manager
|
|
12
|
+
- Manages the lifecycle of extensions
|
|
13
|
+
- Handles extension registration and initialization
|
|
14
|
+
- Coordinates between extensions and the core system
|
|
15
|
+
|
|
16
|
+
### 2. Hook Manager
|
|
17
|
+
- Manages execution hooks for tools
|
|
18
|
+
- Provides `before_tool` and `after_tool` hook points
|
|
19
|
+
- Ensures hooks execute in the correct order
|
|
20
|
+
|
|
21
|
+
### 3. Extension Loader
|
|
22
|
+
- Discovers extensions from configured directories
|
|
23
|
+
- Loads extension manifests
|
|
24
|
+
- Instantiates extensions and registers them with the manager
|
|
25
|
+
|
|
26
|
+
## Extension Types
|
|
27
|
+
|
|
28
|
+
Extensions can be one of three types:
|
|
29
|
+
|
|
30
|
+
### Hook Extensions
|
|
31
|
+
Provide lifecycle hooks that execute before/after tool invocations. Useful for:
|
|
32
|
+
- Logging and monitoring
|
|
33
|
+
- Security validation
|
|
34
|
+
- Performance profiling
|
|
35
|
+
- Result transformation
|
|
36
|
+
|
|
37
|
+
### Tool Extensions
|
|
38
|
+
Add new tools to the CLI that can be invoked by the agent. Useful for:
|
|
39
|
+
- Domain-specific functionality
|
|
40
|
+
- Integration with external services
|
|
41
|
+
- Custom workflows
|
|
42
|
+
|
|
43
|
+
### Combined Extensions
|
|
44
|
+
Provide both hooks and tools for complete feature sets.
|
|
45
|
+
|
|
46
|
+
## Creating an Extension
|
|
47
|
+
|
|
48
|
+
### Extension Structure
|
|
49
|
+
|
|
50
|
+
Each extension must be in its own directory with an `extension.json` manifest:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
my-extension/
|
|
54
|
+
├── extension.json # Extension manifest (required)
|
|
55
|
+
├── README.md # Documentation (recommended)
|
|
56
|
+
└── scripts/ # Optional scripts or resources
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Extension Manifest
|
|
60
|
+
|
|
61
|
+
The `extension.json` file defines your extension:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"name": "my-extension",
|
|
66
|
+
"version": "1.0.0",
|
|
67
|
+
"description": "A sample extension",
|
|
68
|
+
"author": "Your Name <your.email@example.com>",
|
|
69
|
+
"extension_type": "hook",
|
|
70
|
+
"hooks": [
|
|
71
|
+
{
|
|
72
|
+
"name": "my-hook",
|
|
73
|
+
"hook_type": "both",
|
|
74
|
+
"script": null,
|
|
75
|
+
"config": {
|
|
76
|
+
"custom_setting": "value"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"dependencies": [],
|
|
81
|
+
"enabled": true
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Manifest Fields
|
|
86
|
+
|
|
87
|
+
- **name** (required): Unique identifier for the extension
|
|
88
|
+
- **version** (required): Semantic version string (e.g., "1.0.0")
|
|
89
|
+
- **description** (optional): Brief description of what the extension does
|
|
90
|
+
- **author** (optional): Author information
|
|
91
|
+
- **extension_type** (required): One of "hook", "tool", or "combined"
|
|
92
|
+
- **hooks** (optional): Array of hook configurations
|
|
93
|
+
- **dependencies** (optional): List of required extensions
|
|
94
|
+
- **enabled** (optional): Whether the extension is enabled by default (default: true)
|
|
95
|
+
|
|
96
|
+
### Hook Configuration
|
|
97
|
+
|
|
98
|
+
Each hook in the `hooks` array has:
|
|
99
|
+
|
|
100
|
+
- **name** (required): Unique name for this hook
|
|
101
|
+
- **hook_type** (required): One of:
|
|
102
|
+
- `"before_tool"`: Executes before tool invocation
|
|
103
|
+
- `"after_tool"`: Executes after tool completion
|
|
104
|
+
- `"both"`: Executes both before and after
|
|
105
|
+
- **script** (optional): Path to external script to execute
|
|
106
|
+
- **config** (optional): Custom configuration object
|
|
107
|
+
|
|
108
|
+
## Configuration
|
|
109
|
+
|
|
110
|
+
### Enabling Extensions
|
|
111
|
+
|
|
112
|
+
In your `~/.config/grok-cli/config.toml`:
|
|
113
|
+
|
|
114
|
+
```toml
|
|
115
|
+
[experimental.extensions]
|
|
116
|
+
enabled = true
|
|
117
|
+
extension_dir = "~/.grok/extensions"
|
|
118
|
+
enabled_extensions = ["logging-hook", "my-extension"]
|
|
119
|
+
allow_config_extensions = true
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Configuration Options
|
|
123
|
+
|
|
124
|
+
- **enabled**: Master switch for the extension system (default: false)
|
|
125
|
+
- **extension_dir**: Directory to search for extensions (default: `~/.grok/extensions`)
|
|
126
|
+
- **enabled_extensions**: List of extension names to load. Empty list = load all
|
|
127
|
+
- **allow_config_extensions**: Allow loading extensions defined in config (default: false)
|
|
128
|
+
|
|
129
|
+
## Hook Lifecycle
|
|
130
|
+
|
|
131
|
+
### Before Tool Hook
|
|
132
|
+
|
|
133
|
+
Called before a tool is executed. Receives:
|
|
134
|
+
- **tool_name**: Name of the tool being invoked
|
|
135
|
+
- **args**: Tool arguments as JSON
|
|
136
|
+
|
|
137
|
+
Can return:
|
|
138
|
+
- `Ok(true)`: Continue with tool execution
|
|
139
|
+
- `Ok(false)`: Abort tool execution (silent)
|
|
140
|
+
- `Err(...)`: Abort with error message
|
|
141
|
+
|
|
142
|
+
```rust
|
|
143
|
+
fn before_tool(&self, context: &ToolContext) -> Result<bool> {
|
|
144
|
+
// Validate, log, or modify behavior
|
|
145
|
+
println!("About to execute: {}", context.tool_name);
|
|
146
|
+
Ok(true) // Continue
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### After Tool Hook
|
|
151
|
+
|
|
152
|
+
Called after a tool completes. Receives:
|
|
153
|
+
- **tool_name**: Name of the tool that executed
|
|
154
|
+
- **args**: Tool arguments as JSON
|
|
155
|
+
- **result**: Tool result as string
|
|
156
|
+
|
|
157
|
+
```rust
|
|
158
|
+
fn after_tool(&self, context: &ToolContext, result: &str) -> Result<()> {
|
|
159
|
+
// Log, monitor, or post-process result
|
|
160
|
+
println!("Tool {} completed with {} bytes", context.tool_name, result.len());
|
|
161
|
+
Ok(())
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Use Cases
|
|
166
|
+
|
|
167
|
+
### 1. Logging and Monitoring
|
|
168
|
+
|
|
169
|
+
Track all tool invocations for debugging:
|
|
170
|
+
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"name": "tool-logger",
|
|
174
|
+
"extension_type": "hook",
|
|
175
|
+
"hooks": [{
|
|
176
|
+
"name": "logger",
|
|
177
|
+
"hook_type": "both",
|
|
178
|
+
"config": {
|
|
179
|
+
"log_file": "/var/log/grok-tools.log"
|
|
180
|
+
}
|
|
181
|
+
}]
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### 2. Security Policies
|
|
186
|
+
|
|
187
|
+
Enforce security constraints on tool usage:
|
|
188
|
+
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"name": "security-policy",
|
|
192
|
+
"extension_type": "hook",
|
|
193
|
+
"hooks": [{
|
|
194
|
+
"name": "validator",
|
|
195
|
+
"hook_type": "before_tool",
|
|
196
|
+
"config": {
|
|
197
|
+
"blocked_tools": ["run_shell_command"],
|
|
198
|
+
"allowed_paths": ["/home/user/projects"]
|
|
199
|
+
}
|
|
200
|
+
}]
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### 3. Performance Profiling
|
|
205
|
+
|
|
206
|
+
Measure tool execution times:
|
|
207
|
+
|
|
208
|
+
```json
|
|
209
|
+
{
|
|
210
|
+
"name": "profiler",
|
|
211
|
+
"extension_type": "hook",
|
|
212
|
+
"hooks": [{
|
|
213
|
+
"name": "timer",
|
|
214
|
+
"hook_type": "both",
|
|
215
|
+
"config": {
|
|
216
|
+
"output_format": "json",
|
|
217
|
+
"min_duration_ms": 100
|
|
218
|
+
}
|
|
219
|
+
}]
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### 4. Result Caching
|
|
224
|
+
|
|
225
|
+
Cache expensive tool results:
|
|
226
|
+
|
|
227
|
+
```json
|
|
228
|
+
{
|
|
229
|
+
"name": "cache",
|
|
230
|
+
"extension_type": "hook",
|
|
231
|
+
"hooks": [{
|
|
232
|
+
"name": "cache-handler",
|
|
233
|
+
"hook_type": "both",
|
|
234
|
+
"config": {
|
|
235
|
+
"cache_dir": "~/.grok/cache",
|
|
236
|
+
"ttl_seconds": 3600
|
|
237
|
+
}
|
|
238
|
+
}]
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Example Extensions
|
|
243
|
+
|
|
244
|
+
Several example extensions are provided in the `examples/extensions/` directory:
|
|
245
|
+
|
|
246
|
+
- **logging-hook**: Basic tool invocation logging
|
|
247
|
+
- More examples coming soon!
|
|
248
|
+
|
|
249
|
+
## Development Guide
|
|
250
|
+
|
|
251
|
+
### Testing Your Extension
|
|
252
|
+
|
|
253
|
+
1. Create your extension directory:
|
|
254
|
+
```bash
|
|
255
|
+
mkdir -p ~/.grok/extensions/my-extension
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
2. Create the manifest:
|
|
259
|
+
```bash
|
|
260
|
+
cat > ~/.grok/extensions/my-extension/extension.json << EOF
|
|
261
|
+
{
|
|
262
|
+
"name": "my-extension",
|
|
263
|
+
"version": "1.0.0",
|
|
264
|
+
"extension_type": "hook",
|
|
265
|
+
"hooks": [...]
|
|
266
|
+
}
|
|
267
|
+
EOF
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
3. Enable extensions in config:
|
|
271
|
+
```toml
|
|
272
|
+
[experimental.extensions]
|
|
273
|
+
enabled = true
|
|
274
|
+
enabled_extensions = ["my-extension"]
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
4. Run Grok CLI with debug logging:
|
|
278
|
+
```bash
|
|
279
|
+
RUST_LOG=debug grok-cli interactive
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Debugging
|
|
283
|
+
|
|
284
|
+
Enable debug logging to see extension loading and execution:
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
export RUST_LOG=grok_cli::hooks=debug
|
|
288
|
+
grok-cli interactive
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Look for log messages like:
|
|
292
|
+
- "Discovered extension: my-extension"
|
|
293
|
+
- "Loading extension: my-extension"
|
|
294
|
+
- "Extension 'my-extension' hook 'my-hook' executing before tool 'read_file'"
|
|
295
|
+
|
|
296
|
+
## Advanced Topics
|
|
297
|
+
|
|
298
|
+
### Extension Dependencies
|
|
299
|
+
|
|
300
|
+
Extensions can declare dependencies on other extensions:
|
|
301
|
+
|
|
302
|
+
```json
|
|
303
|
+
{
|
|
304
|
+
"dependencies": ["base-extension", "util-extension"]
|
|
305
|
+
}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
The loader will ensure dependencies are loaded first (future enhancement).
|
|
309
|
+
|
|
310
|
+
### Custom Configuration
|
|
311
|
+
|
|
312
|
+
Extensions can include custom configuration that's available at runtime:
|
|
313
|
+
|
|
314
|
+
```json
|
|
315
|
+
{
|
|
316
|
+
"hooks": [{
|
|
317
|
+
"config": {
|
|
318
|
+
"api_key": "${ENV:MY_API_KEY}",
|
|
319
|
+
"endpoint": "https://api.example.com",
|
|
320
|
+
"timeout_seconds": 30
|
|
321
|
+
}
|
|
322
|
+
}]
|
|
323
|
+
}
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Script Execution
|
|
327
|
+
|
|
328
|
+
Extensions can execute external scripts (future enhancement):
|
|
329
|
+
|
|
330
|
+
```json
|
|
331
|
+
{
|
|
332
|
+
"hooks": [{
|
|
333
|
+
"script": "./scripts/validate.sh",
|
|
334
|
+
"hook_type": "before_tool"
|
|
335
|
+
}]
|
|
336
|
+
}
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## Security Considerations
|
|
340
|
+
|
|
341
|
+
1. **Trust**: Only install extensions from trusted sources
|
|
342
|
+
2. **Isolation**: Extensions run in the same process as the CLI
|
|
343
|
+
3. **Permissions**: Extensions have the same permissions as the CLI
|
|
344
|
+
4. **Validation**: The extension manifest is validated on load
|
|
345
|
+
5. **Sandboxing**: Future versions may add sandboxing support
|
|
346
|
+
|
|
347
|
+
## Limitations
|
|
348
|
+
|
|
349
|
+
Current limitations of the extension system:
|
|
350
|
+
|
|
351
|
+
1. **Static Loading**: Extensions are loaded once at startup
|
|
352
|
+
2. **No Hot Reload**: Requires restart to load new extensions
|
|
353
|
+
3. **Limited Tool API**: Cannot yet register custom tools dynamically
|
|
354
|
+
4. **Config-Based Only**: No dynamic library (`.so`/`.dll`) loading yet
|
|
355
|
+
5. **No Scripting**: Cannot execute Python/Lua scripts yet
|
|
356
|
+
|
|
357
|
+
## Future Enhancements
|
|
358
|
+
|
|
359
|
+
Planned improvements:
|
|
360
|
+
|
|
361
|
+
- [ ] Hot reload support
|
|
362
|
+
- [ ] Dynamic library loading
|
|
363
|
+
- [ ] Custom tool registration API
|
|
364
|
+
- [ ] Scripting language support (Python, Lua)
|
|
365
|
+
- [ ] Extension marketplace
|
|
366
|
+
- [ ] Sandboxing and isolation
|
|
367
|
+
- [ ] Extension signing and verification
|
|
368
|
+
- [ ] Inter-extension communication
|
|
369
|
+
- [ ] Extension UI components
|
|
370
|
+
|
|
371
|
+
## Troubleshooting
|
|
372
|
+
|
|
373
|
+
### Extension Not Loading
|
|
374
|
+
|
|
375
|
+
1. Check that the extension system is enabled:
|
|
376
|
+
```bash
|
|
377
|
+
grok-cli config get experimental.extension_management
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
2. Verify the extension directory exists:
|
|
381
|
+
```bash
|
|
382
|
+
ls -la ~/.grok/extensions/
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
3. Validate the manifest JSON:
|
|
386
|
+
```bash
|
|
387
|
+
jq . ~/.grok/extensions/my-extension/extension.json
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
4. Check logs for errors:
|
|
391
|
+
```bash
|
|
392
|
+
RUST_LOG=debug grok-cli interactive 2>&1 | grep -i extension
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### Extension Not Executing
|
|
396
|
+
|
|
397
|
+
1. Ensure the extension is in the enabled list (or list is empty)
|
|
398
|
+
2. Check that `enabled: true` in the manifest
|
|
399
|
+
3. Verify hook types match what you expect
|
|
400
|
+
4. Enable debug logging to see hook execution
|
|
401
|
+
|
|
402
|
+
### Performance Issues
|
|
403
|
+
|
|
404
|
+
If extensions cause performance issues:
|
|
405
|
+
|
|
406
|
+
1. Profile extension execution time
|
|
407
|
+
2. Reduce hook complexity
|
|
408
|
+
3. Cache expensive operations
|
|
409
|
+
4. Disable unused extensions
|
|
410
|
+
|
|
411
|
+
## API Reference
|
|
412
|
+
|
|
413
|
+
### Rust Types
|
|
414
|
+
|
|
415
|
+
For implementing extensions in Rust:
|
|
416
|
+
|
|
417
|
+
```rust
|
|
418
|
+
pub trait Extension: Send + Sync {
|
|
419
|
+
fn name(&self) -> &str;
|
|
420
|
+
fn register_hooks(&self, hook_manager: &mut HookManager) -> Result<()>;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
pub trait Hook: Send + Sync {
|
|
424
|
+
fn name(&self) -> &str;
|
|
425
|
+
fn before_tool(&self, context: &ToolContext) -> Result<bool>;
|
|
426
|
+
fn after_tool(&self, context: &ToolContext, result: &str) -> Result<()>;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
pub struct ToolContext {
|
|
430
|
+
pub tool_name: String,
|
|
431
|
+
pub args: Value,
|
|
432
|
+
}
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
## Contributing
|
|
436
|
+
|
|
437
|
+
To contribute extensions or improvements to the extension system:
|
|
438
|
+
|
|
439
|
+
1. Fork the repository
|
|
440
|
+
2. Create a feature branch
|
|
441
|
+
3. Add your extension or changes
|
|
442
|
+
4. Include tests and documentation
|
|
443
|
+
5. Submit a pull request
|
|
444
|
+
|
|
445
|
+
See `CONTRIBUTING.md` for more details.
|
|
446
|
+
|
|
447
|
+
## Resources
|
|
448
|
+
|
|
449
|
+
- [Example Extensions](../examples/extensions/)
|
|
450
|
+
- [Hook API Reference](hooks-api.md)
|
|
451
|
+
- [Configuration Guide](configuration.md)
|
|
452
|
+
- [GitHub Repository](https://github.com/microtech/grok-cli)
|
|
453
|
+
|
|
454
|
+
## Support
|
|
455
|
+
|
|
456
|
+
For help with extensions:
|
|
457
|
+
|
|
458
|
+
- Open an issue on GitHub
|
|
459
|
+
- Check existing documentation
|
|
460
|
+
- Join the community discussions
|
|
461
|
+
|
|
462
|
+
## License
|
|
463
|
+
|
|
464
|
+
The extension system is part of Grok CLI and is licensed under the MIT License.
|