@opencode/plugin 0.0.0-dev-19340 → 0.0.0-dev-19342

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.
@@ -3,6 +3,7 @@ import { Effect, Schema, SchemaAST, Stream } from "effect";
3
3
  import { HttpApiEndpoint, HttpApiSchema } from "effect/unstable/httpapi";
4
4
  import { define } from "../effect/plugin.js";
5
5
  const compiledEndpoints = new WeakMap();
6
+ const JsonInput = Schema.fromJsonString(Schema.Unknown);
6
7
  class ReturnedRpcError extends Error {
7
8
  type;
8
9
  data;
@@ -183,7 +184,9 @@ export function fromPromise(plugin) {
183
184
  const adaptApiMethod = (endpoint, method) => {
184
185
  const compiled = compileEndpoint(endpoint);
185
186
  return ((input) => Effect.gen(function* () {
186
- const decoded = yield* Effect.forEach(compiled.decode, (decode) => decode(input ?? {}));
187
+ // Match the generated Promise client, whose request body crosses JSON before endpoint decoding.
188
+ const normalized = yield* Schema.encodeUnknownEffect(JsonInput)(input ?? {}).pipe(Effect.flatMap(Schema.decodeUnknownEffect(JsonInput)));
189
+ const decoded = yield* Effect.forEach(compiled.decode, (decode) => decode(normalized));
187
190
  const result = yield* method(Object.assign({}, ...decoded));
188
191
  if (compiled.noContent)
189
192
  return undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/plugin",
4
- "version": "0.0.0-dev-19340",
4
+ "version": "0.0.0-dev-19342",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "scripts": {
@@ -43,17 +43,17 @@
43
43
  ],
44
44
  "dependencies": {
45
45
  "@ai-sdk/provider": "3.0.8",
46
- "@opencode/ai": "0.0.0-dev-19340",
47
- "@opencode/client": "0.0.0-dev-19340",
48
- "@opencode/protocol": "0.0.0-dev-19340",
49
- "@opencode/schema": "0.0.0-dev-19340",
50
- "@opencode/util": "0.0.0-dev-19340",
46
+ "@opencode/ai": "0.0.0-dev-19342",
47
+ "@opencode/client": "0.0.0-dev-19342",
48
+ "@opencode/protocol": "0.0.0-dev-19342",
49
+ "@opencode/schema": "0.0.0-dev-19342",
50
+ "@opencode/util": "0.0.0-dev-19342",
51
51
  "@standard-schema/spec": "1.1.0",
52
52
  "effect": "4.0.0-rc.112",
53
53
  "zod": "4.1.8"
54
54
  },
55
55
  "peerDependencies": {
56
- "@opencode/theme": "0.0.0-dev-19340",
56
+ "@opencode/theme": "0.0.0-dev-19342",
57
57
  "@opentui/core": ">=0.5.10",
58
58
  "@opentui/solid": ">=0.5.10",
59
59
  "solid-js": ">=1.9.0"
@@ -73,7 +73,7 @@
73
73
  }
74
74
  },
75
75
  "devDependencies": {
76
- "@opencode/theme": "0.0.0-dev-19340",
76
+ "@opencode/theme": "0.0.0-dev-19342",
77
77
  "@opentui/core": "0.5.10",
78
78
  "@opentui/solid": "0.5.10",
79
79
  "@tsconfig/bun": "1.0.9",