From 43c8690c14ec22857bc1d6299e203bd884b3503b Mon Sep 17 00:00:00 2001 From: Kit Langton Date: Thu, 27 Aug 2026 22:30:07 -0400 Subject: [PATCH] docs(core): correct newtype decoding guidance (#45736) --- .changeset/correct-newtype-decoding.md | 5 +++++ packages/core/src/schema.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/correct-newtype-decoding.md diff --git a/.changeset/correct-newtype-decoding.md b/.changeset/correct-newtype-decoding.md new file mode 100644 index 00000000000..decb1970074 --- /dev/null +++ b/.changeset/correct-newtype-decoding.md @@ -0,0 +1,5 @@ +--- +"@opencode-ai/core": patch +--- + +Correct the published Newtype documentation to recommend `Schema.decodeUnknownSync` for schema-based synchronous decoding. diff --git a/packages/core/src/schema.ts b/packages/core/src/schema.ts index 19796c4dfd5..24c2c68baf7 100644 --- a/packages/core/src/schema.ts +++ b/packages/core/src/schema.ts @@ -41,7 +41,7 @@ export type DeepMutable = T extends string | number | boolean | bigint | symb /** * Nominal wrapper for scalar types. The class itself is a valid schema — - * pass it directly to `Schema.decode`, `Schema.decodeEffect`, etc. + * pass it directly to `Schema.decodeUnknownSync`, `Schema.decodeEffect`, etc. * * The runtime value remains an unwrapped primitive. `Schema.brand` supplies * the primitive schema behavior and constructor validation, while the class