@serkanalgur/opencodev2-slim 2.0.6 → 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 CHANGED
@@ -141,6 +141,18 @@ 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
+
149
+ ### 2.0.7
150
+
151
+ - Fix `Cannot find package 'react'` when the plugin is loaded from the global npm cache:
152
+ add a per-file `/** @jsxImportSource @opentui/solid */` pragma to `src/tui.tsx` so JSX
153
+ always compiles against `@opentui/solid/jsx-runtime`
154
+ - Ship `tsconfig.json` in the published package so loaders that read `jsxImportSource` from config pick it up
155
+
144
156
  ### 2.0.6
145
157
 
146
158
  - Add real `compaction` hook so history actually shrinks (the `context` hook only affects the outgoing request)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serkanalgur/opencodev2-slim",
3
- "version": "2.0.6",
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",
@@ -33,6 +33,7 @@
33
33
  "files": [
34
34
  "dist/",
35
35
  "src/",
36
+ "tsconfig.json",
36
37
  "README.md",
37
38
  "LICENSE"
38
39
  ],
package/src/tui.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ /** @jsxImportSource @opentui/solid */
1
2
  import { Show } from "solid-js"
2
3
  import { Plugin } from "@opencode/plugin/tui"
3
4
  import type { PanelInput } from "@opencode/plugin/tui/context"
@@ -33,33 +34,41 @@ export default Plugin.define({
33
34
  ),
34
35
  })
35
36
 
36
- context.keymap.layer(() => ({
37
- mode: "global",
38
- priority: 10,
39
- commands: [
40
- {
41
- id: "opencodev2-slim.panel",
42
- title: "Show Slim Context Panel",
43
- group: "Slim",
44
- palette: true,
45
- slash: { name: "panel", aliases: ["slim-panel"] },
46
- enabled: true,
47
- suggested: true,
48
- run: async () => {
49
- const opened = context.ui.panel.open(PANEL_NAME, {
50
- presentation: "panel",
51
- })
52
- if (!opened) {
53
- context.ui.toast.show({
54
- title: "Slim Panel",
55
- message: "No active session found. Open a session first.",
56
- variant: "warning",
57
- })
58
- }
59
- },
60
- },
61
- ],
62
- }))
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
+ })
63
72
 
64
73
  context.ui.toast.show({
65
74
  title: "Slim Plugin",
package/tsconfig.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "jsx": "preserve",
7
+ "jsxImportSource": "@opentui/solid",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "resolveJsonModule": true,
13
+ "declaration": true,
14
+ "declarationMap": true,
15
+ "sourceMap": true,
16
+ "outDir": "./dist",
17
+ "rootDir": "./src",
18
+ "types": ["node"]
19
+ },
20
+ "include": ["src/**/*"],
21
+ "exclude": ["node_modules", "dist", "tests"]
22
+ }