opencode-goal-plugin 0.1.11 → 0.1.12

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/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.1.12 — 2026-06-08
6
+
7
+ - Harden `escapeGoalText` to escape all XML closing tags (`</` → `<\/`) instead of only `</goal_objective>`, closing a prompt-injection path where user-supplied goal text could break structural framing in the continuation message.
8
+ - Add unit tests for `outputTokensForMessage`, `budgetWrapupNeeded`, `getSessionID`, `stopReason`, `normalizeOptions` boundary inputs (zero, negative, NaN, null, `budgetWrapupRatio` at 0 and 1), and `escapeGoalText` covering all structural tags.
9
+
5
10
  ## 0.1.11 — 2026-06-04
6
11
 
7
12
  - Add `npm run smoke`, a package-export smoke test that exercises the `/goal` command hook without invoking a model.
package/CONTRIBUTING.md CHANGED
@@ -17,6 +17,7 @@ npm test
17
17
  npm run test:coverage
18
18
  npm run smoke
19
19
  npm run check
20
+ npm run smoke
20
21
  npm run pack:check
21
22
  ```
22
23
 
@@ -46,6 +47,10 @@ Before publishing or tagging a release:
46
47
  - perform at least one manual OpenCode smoke test if hook behavior changed
47
48
  - refresh compatibility notes if the tested OpenCode surface changed
48
49
 
50
+ `npm run smoke` verifies the published package entrypoint and `/goal` command hook without
51
+ invoking a model. It does not replace a manual OpenCode smoke test after hook or command
52
+ behavior changes.
53
+
49
54
  ## Pull Requests
50
55
 
51
56
  Keep pull requests focused. Include:
package/README.md CHANGED
@@ -226,12 +226,6 @@ Keep test files outside OpenCode's auto-loaded plugin directory — OpenCode wil
226
226
  6. Verify `/goal status`, `/goal pause`, `/goal resume`, and `/goal clear` behave as expected.
227
227
  7. If you changed hook payload handling or command behavior, repeat the smoke test against the exact OpenCode version and provider/backend combination you care about.
228
228
 
229
- ### Release checklist
230
-
231
- - Confirm `npm test`, `npm run test:coverage`, `npm run check`, `npm run smoke`, and `npm run pack:check` all pass.
232
- - Re-test against a real OpenCode install when touching command hooks, idle-event handling, or system-prompt transforms.
233
- - Update compatibility notes and changelog entries when behavior or tested surfaces change.
234
-
235
229
  ## Development
236
230
 
237
231
  ```sh
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-goal-plugin",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Session-scoped /goal workflow for OpenCode.",
5
5
  "type": "module",
6
6
  "main": "./src/goal-plugin.js",
@@ -686,7 +686,9 @@ function buildLimitWarning(goal) {
686
686
  }
687
687
 
688
688
  function escapeGoalText(text) {
689
- return String(text).replaceAll("</goal_objective>", "<\\/goal_objective>")
689
+ // Escape every XML closing tag so user-supplied goal text cannot break the
690
+ // structural framing used in buildGoalBlock and buildContinueMessage.
691
+ return String(text).replaceAll("</", "<\\/")
690
692
  }
691
693
 
692
694
  function buildGoalBlock(goal) {