@boyingliu01/opencode-plugin 0.35.15 → 0.35.16

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
@@ -62,9 +62,30 @@ Or via local path (development):
62
62
  }
63
63
  ```
64
64
 
65
+ ### OpenCode v2
66
+
67
+ v2 validates the plugin's default export against a schema requiring `id` plus
68
+ `effect` or `setup`. This package ships both keys from 0.35.15 onwards, so the
69
+ same published version loads under v1 and v2 — no separate build, no manifest
70
+ change on your side.
71
+
72
+ Register it the same way (v2 reads the same `plugin` array):
73
+
74
+ ```json
75
+ {
76
+ "plugin": ["@boyingliu01/opencode-plugin"]
77
+ }
78
+ ```
79
+
80
+ Do **not** register `@boyingliu01/opencode-plugin/tui`. The TUI panel was
81
+ abandoned in v0.13.0 and there is no `/tui` entry; v2's npm installer treats the
82
+ whole string as a package name, so it fails on every startup with
83
+ `NpmInstallFailedError`. The subpath export was removed in 0.35.15 for exactly
84
+ that reason.
85
+
65
86
  ## Requirements
66
87
 
67
- - OpenCode v0.11+
88
+ - OpenCode v0.11+ (v2.1.4+ supported)
68
89
  - One of:
69
90
  - `xp-gate` CLI installed globally (`npm install -g @boyingliu01/xp-gate`) — **preferred**, or
70
91
  - the xp-gate repo checked out locally with `src/principles/index.ts` reachable — **fallback** (the tool will shell out via `npx -y tsx`)
package/index.ts CHANGED
@@ -470,11 +470,24 @@ function gateArchTool(directory: string) {
470
470
 
471
471
  function readCurrentSessionModel(dbPath: string, sessionId: string): string {
472
472
  try {
473
+ // execFileSync, NOT execSync (#639). `sessionId` comes from the caller's
474
+ // argument, and the previous form interpolated it into a shell string:
475
+ //
476
+ // `sqlite3 "${dbPath}" "SELECT model FROM session WHERE id = '${escapedId}'"`
477
+ //
478
+ // Escaping only the SQL single quote left every SHELL metacharacter live --
479
+ // a session id containing `"`, `$( )` or a backtick escaped the quoting and
480
+ // executed. Passing argv as an array removes the shell from the path
481
+ // entirely, so no escaping is needed or possible to get wrong.
482
+ //
483
+ // The SQL single quote is still escaped: that is a SQL concern, not a shell
484
+ // one, and it survives the move to argv unchanged.
473
485
  const escapedId = sessionId.replace(/'/g, "''")
474
- const currentRaw = execSync(
475
- `sqlite3 "${dbPath}" "SELECT model FROM session WHERE id = '${escapedId}'"`,
476
- { encoding: "utf8", timeout: SQLITE_TIMEOUT_MS }
477
- ).trim()
486
+ const sql = `SELECT model FROM session WHERE id = '${escapedId}'`
487
+ const currentRaw = execFileSync("sqlite3", [dbPath, sql], {
488
+ encoding: "utf8",
489
+ timeout: SQLITE_TIMEOUT_MS,
490
+ }).trim()
478
491
  if (!currentRaw) return "unknown"
479
492
  try {
480
493
  const parsed = JSON.parse(currentRaw)
@@ -664,9 +677,31 @@ export const XpGatePlugin = async (input: OpenCodePluginInput) => {
664
677
  }
665
678
  }
666
679
 
680
+ /**
681
+ * The plugin module, shaped for BOTH OpenCode generations (#639).
682
+ *
683
+ * v1 read `server`. v2 validates the default export against a schema that
684
+ * requires `id` plus exactly one of `effect` / `setup`, and rejects anything
685
+ * else outright:
686
+ *
687
+ * PluginModule.LoadError: Plugin must export a default definition with an id
688
+ * and an effect or setup function.
689
+ * (cause: SchemaError(Missing key at ["default"]["effect"] / ["default"]["setup"]))
690
+ *
691
+ * The failure mode is total, not partial: the plugin does not load at all, so
692
+ * `gate-check` / `gate-principles` / `gate-arch` simply vanish from v2 sessions
693
+ * and every startup prints a load error.
694
+ *
695
+ * `setup` and the v1 `server` take the same input and return the same shape, so
696
+ * the same function serves both keys. Both are exported deliberately: dropping
697
+ * `server` would break every v1 user on upgrade, which is a migration nobody
698
+ * asked for. `pluginModule` is not frozen, so this stays a plain object literal
699
+ * that both runtimes can read.
700
+ */
667
701
  const pluginModule = {
668
702
  id: "xp-gate",
669
703
  server: XpGatePlugin,
704
+ setup: XpGatePlugin,
670
705
  }
671
706
 
672
707
  /**
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@boyingliu01/opencode-plugin",
3
- "version": "0.35.15",
3
+ "version": "0.35.16",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
- "description": "XP-Gate quality gates + AI workflow skills + Sprint Flow TUI sidebar for OpenCode",
6
+ "description": "XP-Gate quality gates + AI workflow skills for OpenCode",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "https://github.com/boyingliu01/xp-gate",
@@ -17,15 +17,10 @@
17
17
  ".": {
18
18
  "import": "./index.ts",
19
19
  "types": "./index.ts"
20
- },
21
- "./tui": {
22
- "import": "./tui-plugin.tsx",
23
- "types": "./tui-plugin.tsx"
24
20
  }
25
21
  },
26
22
  "files": [
27
23
  "index.ts",
28
- "tui-plugin.ts",
29
24
  "skills/",
30
25
  "tsconfig.json",
31
26
  "README.md"
@@ -1,9 +1,9 @@
1
1
  # SKILLS/DELPHI-REVIEW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-10-30
4
- **Commit:** 6091e238
3
+ **Generated:** 2026-10-31
4
+ **Commit:** 3aa988e7
5
5
  **Branch:** main
6
- **Version:** 0.35.15.0
6
+ **Version:** 0.35.16.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Delphi Consensus Review — multi-round anonymous expert review (≥90% threshold, exactly 3 experts with distinct executable model IDs). Supports design, requirements, and code-walkthrough modes.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/SPRINT-FLOW KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-10-30
4
- **Commit:** 6091e238
3
+ **Generated:** 2026-10-31
4
+ **Commit:** 3aa988e7
5
5
  **Branch:** main
6
- **Version:** 0.35.15.0
6
+ **Version:** 0.35.16.0
7
7
 
8
8
  ## OVERVIEW
9
9
  **6-phase** development pipeline (v2.0 compact redesign, Issue #290): PREP → DESIGN → BUILD → VERIFY → SHIP → CLOSE. Phase 3/6 BUILD default build mode is **ralph-loop** (REQ-level iteration, 40-67% token savings vs parallel). HARD-GATE between DESIGN (2/6) and BUILD (3/6): design must pass Delphi review (≥90% consensus) before any coding.
@@ -1,9 +1,9 @@
1
1
  # SKILLS/TEST-SPECIFICATION-ALIGNMENT KNOWLEDGE BASE
2
2
 
3
- **Generated:** 2026-10-30
4
- **Commit:** 6091e238
3
+ **Generated:** 2026-10-31
4
+ **Commit:** 3aa988e7
5
5
  **Branch:** main
6
- **Version:** 0.35.15.0
6
+ **Version:** 0.35.16.0
7
7
 
8
8
  ## OVERVIEW
9
9
  Test-Specification Alignment Engine — two-stage validation ensuring tests accurately reflect requirements and design specs.