opencodekit 0.6.2 → 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/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 +493 -536
- 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
|
|