@serkanalgur/opencodev2-slim 2.0.7 → 2.0.8

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.
Files changed (3) hide show
  1. package/README.md +5 -0
  2. package/package.json +1 -1
  3. package/src/tui.tsx +35 -27
package/README.md CHANGED
@@ -141,6 +141,11 @@ Note: Compression is performed by the AI assistant using the `compress` tool. Th
141
141
 
142
142
  ## Changelog
143
143
 
144
+ ### 2.0.8
145
+
146
+ - Fix `keymap.provider is missing` in the CLI plugin: register the keymap layer inside
147
+ an `app` slot render (where the keymap provider is available) instead of in `setup()`.
148
+
144
149
  ### 2.0.7
145
150
 
146
151
  - Fix `Cannot find package 'react'` when the plugin is loaded from the global npm cache:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serkanalgur/opencodev2-slim",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "Smart context management plugin for OpenCode v2 - semantic compression, cost-aware pruning, adaptive thresholds",
5
5
  "keywords": [
6
6
  "opencode",
package/src/tui.tsx CHANGED
@@ -34,33 +34,41 @@ export default Plugin.define({
34
34
  ),
35
35
  })
36
36
 
37
- context.keymap.layer(() => ({
38
- mode: "global",
39
- priority: 10,
40
- commands: [
41
- {
42
- id: "opencodev2-slim.panel",
43
- title: "Show Slim Context Panel",
44
- group: "Slim",
45
- palette: true,
46
- slash: { name: "panel", aliases: ["slim-panel"] },
47
- enabled: true,
48
- suggested: true,
49
- run: async () => {
50
- const opened = context.ui.panel.open(PANEL_NAME, {
51
- presentation: "panel",
52
- })
53
- if (!opened) {
54
- context.ui.toast.show({
55
- title: "Slim Panel",
56
- message: "No active session found. Open a session first.",
57
- variant: "warning",
58
- })
59
- }
60
- },
61
- },
62
- ],
63
- }))
37
+ // Register the command/shortcut inside the "app" slot render, where the
38
+ // keymap provider is available (consistent with OpenCode V2 CLI plugins).
39
+ context.ui.slot({
40
+ append: "app",
41
+ render: () => {
42
+ context.keymap.layer(() => ({
43
+ mode: "global",
44
+ priority: 10,
45
+ commands: [
46
+ {
47
+ id: "opencodev2-slim.panel",
48
+ title: "Show Slim Context Panel",
49
+ group: "Slim",
50
+ palette: true,
51
+ slash: { name: "panel", aliases: ["slim-panel"] },
52
+ enabled: true,
53
+ suggested: true,
54
+ run: async () => {
55
+ const opened = context.ui.panel.open(PANEL_NAME, {
56
+ presentation: "panel",
57
+ })
58
+ if (!opened) {
59
+ context.ui.toast.show({
60
+ title: "Slim Panel",
61
+ message: "No active session found. Open a session first.",
62
+ variant: "warning",
63
+ })
64
+ }
65
+ },
66
+ },
67
+ ],
68
+ }))
69
+ return null
70
+ },
71
+ })
64
72
 
65
73
  context.ui.toast.show({
66
74
  title: "Slim Plugin",