@serkanalgur/opencodev2-notification 1.2.0 → 1.2.2

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 (2) hide show
  1. package/package.json +9 -2
  2. package/src/index.ts +8 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serkanalgur/opencodev2-notification",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Native OS notifications for OpenCode V2 - know when tasks complete, errors occur, or the AI needs your input",
5
5
  "keywords": [
6
6
  "opencode",
@@ -42,10 +42,17 @@
42
42
  "@opencode/plugin": "^2.0.0",
43
43
  "@types/bun": "latest",
44
44
  "prettier": "^3.4.0",
45
+ "solid-js": ">=1.9.0",
45
46
  "tsx": "^4.23.15",
46
47
  "typescript": "^5.7.0"
47
48
  },
48
49
  "peerDependencies": {
49
- "@opencode/plugin": ">=2.0.0"
50
+ "@opencode/plugin": ">=2.0.0",
51
+ "solid-js": ">=1.9.0"
52
+ },
53
+ "peerDependenciesMeta": {
54
+ "solid-js": {
55
+ "optional": false
56
+ }
50
57
  }
51
58
  }
package/src/index.ts CHANGED
@@ -163,6 +163,14 @@ function toNonEmptyString(value: unknown): string | null {
163
163
  export default Plugin.define({
164
164
  id: "opencodev2-notification",
165
165
  async setup(context) {
166
+ // This plugin requires the TUI context (data + attention APIs).
167
+ // OpenCode loads plugins on the server process first where these are unavailable.
168
+ // Bail out gracefully — the TUI will load a separate instance with full context.
169
+ const ctx = context as any
170
+ if (!ctx.data || !ctx.attention) {
171
+ return
172
+ }
173
+
166
174
  // Load config at startup
167
175
  const config = await loadConfig()
168
176