opencodekit 0.6.1 → 0.6.3
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/dist/index.js +1 -1
- package/dist/template/.opencode/AGENTS.md +28 -4
- package/dist/template/.opencode/agent/build.md +11 -3
- package/dist/template/.opencode/agent/rush.md +11 -3
- package/dist/template/.opencode/dcp.jsonc +63 -41
- package/dist/template/.opencode/lib/lsp/client.ts +614 -0
- package/dist/template/.opencode/lib/lsp/config.ts +98 -0
- package/dist/template/.opencode/lib/lsp/constants.ts +138 -0
- package/dist/template/.opencode/lib/lsp/types.ts +138 -0
- package/dist/template/.opencode/lib/lsp/utils.ts +190 -0
- package/dist/template/.opencode/opencode.json +3 -3
- package/dist/template/.opencode/package.json +2 -2
- package/dist/template/.opencode/tool/lsp.ts +325 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -750,7 +750,7 @@ var cac = (name = "") => new CAC(name);
|
|
|
750
750
|
// package.json
|
|
751
751
|
var package_default = {
|
|
752
752
|
name: "opencodekit",
|
|
753
|
-
version: "0.6.
|
|
753
|
+
version: "0.6.3",
|
|
754
754
|
description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
|
|
755
755
|
type: "module",
|
|
756
756
|
repository: {
|
|
@@ -79,15 +79,39 @@ Specify depth when delegating to control tool call budget:
|
|
|
79
79
|
|
|
80
80
|
## Tool Priority
|
|
81
81
|
|
|
82
|
-
**GKG tools → AST tools → Built-in tools**
|
|
82
|
+
**GKG tools → LSP tools → AST tools → Built-in tools**
|
|
83
83
|
|
|
84
84
|
1. `gkg_search_codebase_definitions`, `gkg_get_references`, `gkg_repo_map` - Find symbols, usages, API overview
|
|
85
|
-
2. `
|
|
86
|
-
3. `grep
|
|
87
|
-
4. `
|
|
85
|
+
2. `lsp_rename`, `lsp_code_actions`, `lsp_organize_imports` - Semantic refactoring (LSP-based)
|
|
86
|
+
3. `ast-grep` - Semantic code search/replace (AST-based)
|
|
87
|
+
4. `grep`, `glob` - Pattern matching, file discovery
|
|
88
|
+
5. `read`, `edit`, `write` - File operations
|
|
88
89
|
|
|
89
90
|
**Rule**: Always `read` before `edit` to verify content.
|
|
90
91
|
|
|
92
|
+
### LSP Tools Usage
|
|
93
|
+
|
|
94
|
+
Semantic refactoring via Language Server Protocol - smarter than text replacement:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
# Rename symbol across entire codebase
|
|
98
|
+
lsp_rename(filePath, line, character, newName)
|
|
99
|
+
|
|
100
|
+
# Get available refactorings at location
|
|
101
|
+
lsp_code_actions(filePath, startLine, startCharacter, endLine, endCharacter)
|
|
102
|
+
|
|
103
|
+
# Clean up imports
|
|
104
|
+
lsp_organize_imports(filePath)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**When to use LSP over manual edit:**
|
|
108
|
+
|
|
109
|
+
- Renaming functions, variables, classes → `lsp_rename` (updates all references)
|
|
110
|
+
- Cleaning imports after refactoring → `lsp_organize_imports`
|
|
111
|
+
- Exploring refactoring options → `lsp_code_actions`
|
|
112
|
+
|
|
113
|
+
**Caveat**: LSP tools modify files directly. Re-read files before further edits.
|
|
114
|
+
|
|
91
115
|
### AST-Grep Usage
|
|
92
116
|
|
|
93
117
|
Semantic code operations - smarter than regex:
|
|
@@ -16,6 +16,7 @@ tools:
|
|
|
16
16
|
codesearch: true
|
|
17
17
|
gkg*: true
|
|
18
18
|
ast-grep*: true
|
|
19
|
+
lsp*: true
|
|
19
20
|
context7*: true
|
|
20
21
|
gh_grep*: true
|
|
21
22
|
memory-read: true
|
|
@@ -47,9 +48,16 @@ Primary orchestrator. Execute-first. Autonomous task completion until resolved.
|
|
|
47
48
|
## Tool Priority
|
|
48
49
|
|
|
49
50
|
1. **GKG tools** for code search (definitions, references, repo map)
|
|
50
|
-
2. **
|
|
51
|
-
3. **
|
|
52
|
-
4. **
|
|
51
|
+
2. **LSP tools** for semantic refactoring (rename, code actions, organize imports)
|
|
52
|
+
3. **AST-Grep** for semantic code search/replace
|
|
53
|
+
4. **Built-in tools** for pattern matching (grep, glob, read)
|
|
54
|
+
5. **Bash** for running tests, builds, commands
|
|
55
|
+
|
|
56
|
+
### LSP Tools
|
|
57
|
+
|
|
58
|
+
Use LSP tools for safe, semantic refactoring. Use `lsp_rename` to rename functions, variables, or classes across the entire codebase - it updates all references automatically. Use `lsp_organize_imports` after making changes to clean up unused imports and sort the remaining ones. Use `lsp_code_actions` to explore available refactoring options at a specific location.
|
|
59
|
+
|
|
60
|
+
**Caveat**: LSP tools modify files directly. Re-read before further edits.
|
|
53
61
|
|
|
54
62
|
## Anti-Hallucination
|
|
55
63
|
|
|
@@ -15,6 +15,7 @@ tools:
|
|
|
15
15
|
websearch: true
|
|
16
16
|
gkg*: true
|
|
17
17
|
ast-grep*: true
|
|
18
|
+
lsp*: true
|
|
18
19
|
context7*: true
|
|
19
20
|
gh_grep*: true
|
|
20
21
|
codesearch: true
|
|
@@ -45,11 +46,18 @@ Fast execute-first agent. Speed over depth. Delegate anything complex.
|
|
|
45
46
|
|
|
46
47
|
## Tool Priority
|
|
47
48
|
|
|
48
|
-
**GKG tools FIRST, then AST-Grep, then built-in tools.**
|
|
49
|
+
**GKG tools FIRST, then LSP, then AST-Grep, then built-in tools.**
|
|
49
50
|
|
|
50
51
|
1. `gkg_search_codebase_definitions`, `gkg_get_references` - Find symbols, usages
|
|
51
|
-
2. `
|
|
52
|
-
3. `grep
|
|
52
|
+
2. `lsp_rename`, `lsp_organize_imports` - Semantic refactoring
|
|
53
|
+
3. `ast-grep` - Semantic code search/replace
|
|
54
|
+
4. `grep`, `glob` - Text search, file patterns
|
|
55
|
+
|
|
56
|
+
### LSP Tools (Fast Refactoring)
|
|
57
|
+
|
|
58
|
+
Use `lsp_rename` to rename symbols across the codebase - faster than manual find/replace. Use `lsp_organize_imports` to clean up imports after changes.
|
|
59
|
+
|
|
60
|
+
**Caveat**: LSP tools modify files directly. Re-read before further edits.
|
|
53
61
|
|
|
54
62
|
## Pre-Action Checks
|
|
55
63
|
|
|
@@ -1,43 +1,65 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
2
|
+
// Enable or disable the plugin
|
|
3
|
+
"enabled": true,
|
|
4
|
+
// Enable debug logging to ~/.config/opencode/logs/dcp/
|
|
5
|
+
"debug": false,
|
|
6
|
+
// Notification display: "off", "minimal", or "detailed"
|
|
7
|
+
"pruneNotification": "off",
|
|
8
|
+
// Protect from pruning for <turns> message turns
|
|
9
|
+
"turnProtection": {
|
|
10
|
+
"enabled": true,
|
|
11
|
+
"turns": 4
|
|
12
|
+
},
|
|
13
|
+
// LLM-driven context pruning tools
|
|
14
|
+
"tools": {
|
|
15
|
+
// Shared settings for all prune tools
|
|
16
|
+
"settings": {
|
|
17
|
+
// Nudge the LLM to use prune tools (every <nudgeFrequency> tool results)
|
|
18
|
+
"nudgeEnabled": true,
|
|
19
|
+
"nudgeFrequency": 10,
|
|
20
|
+
// Additional tools to protect from pruning (defaults: task, todowrite, todoread, discard, extract, batch)
|
|
21
|
+
"protectedTools": [
|
|
22
|
+
"write",
|
|
23
|
+
"edit",
|
|
24
|
+
"memory-read",
|
|
25
|
+
"memory-update",
|
|
26
|
+
"observation",
|
|
27
|
+
"use_skill",
|
|
28
|
+
"skill"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
// Removes tool content from context without preservation (for completed tasks or noise)
|
|
32
|
+
"discard": {
|
|
33
|
+
"enabled": true
|
|
34
|
+
},
|
|
35
|
+
// Distills key findings into preserved knowledge before removing raw content
|
|
36
|
+
"extract": {
|
|
37
|
+
"enabled": true,
|
|
38
|
+
// Show distillation content as an ignored message notification
|
|
39
|
+
"showDistillation": false
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
// Automatic pruning strategies
|
|
43
|
+
"strategies": {
|
|
44
|
+
// Remove duplicate tool calls (same tool with same arguments)
|
|
45
|
+
"deduplication": {
|
|
46
|
+
"enabled": true,
|
|
47
|
+
// Additional tools to protect from pruning
|
|
48
|
+
"protectedTools": []
|
|
49
|
+
},
|
|
50
|
+
// Prune write tool inputs when the file has been subsequently read
|
|
51
|
+
"supersedeWrites": {
|
|
52
|
+
"enabled": true
|
|
53
|
+
},
|
|
54
|
+
// (Legacy) Run an LLM to analyze what tool calls are no longer relevant on idle
|
|
55
|
+
"onIdle": {
|
|
56
|
+
"enabled": false,
|
|
57
|
+
// Additional tools to protect from pruning
|
|
58
|
+
"protectedTools": [],
|
|
59
|
+
// Show toast notifications when model selection fails
|
|
60
|
+
"showModelErrorToasts": true,
|
|
61
|
+
// When true, fallback models are not permitted
|
|
62
|
+
"strictModelSelection": false
|
|
63
|
+
}
|
|
64
|
+
}
|
|
43
65
|
}
|