@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.
- package/README.md +5 -0
- package/package.json +1 -1
- 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
package/src/tui.tsx
CHANGED
|
@@ -34,33 +34,41 @@ export default Plugin.define({
|
|
|
34
34
|
),
|
|
35
35
|
})
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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",
|