@prevalentware/opencode-goal-plugin 0.1.40 → 0.1.41

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/dist/server.js +18 -1
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -1875,6 +1875,21 @@ function v2ObjectSchema(properties, required = []) {
1875
1875
  additionalProperties: false
1876
1876
  };
1877
1877
  }
1878
+ function decodeV2Event(value) {
1879
+ let decoded = value;
1880
+ if (typeof decoded === "string") {
1881
+ try {
1882
+ decoded = JSON.parse(decoded);
1883
+ } catch {
1884
+ return;
1885
+ }
1886
+ }
1887
+ if (!isRecord(decoded) || typeof decoded.type !== "string" || !isRecord(decoded.data))
1888
+ return;
1889
+ if (typeof decoded.created !== "number")
1890
+ return;
1891
+ return decoded;
1892
+ }
1878
1893
  function textFromToolResult(result) {
1879
1894
  if (typeof result.output === "string")
1880
1895
  return result.output;
@@ -3041,7 +3056,9 @@ async function setupV2(context) {
3041
3056
  const { done, value } = await iterator.next();
3042
3057
  if (done)
3043
3058
  break;
3044
- await handleV2Event(value);
3059
+ const event = decodeV2Event(value);
3060
+ if (event)
3061
+ await handleV2Event(event);
3045
3062
  }
3046
3063
  } catch (error) {
3047
3064
  if (!abortController.signal.aborted)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prevalentware/opencode-goal-plugin",
3
- "version": "0.1.40",
3
+ "version": "0.1.41",
4
4
  "description": "OpenCode goal plugin that adds Codex-style long-running goal mode, /goal commands, persistence, and TUI status for AI coding agents.",
5
5
  "keywords": [
6
6
  "opencode",