Releases: btravstack/temporal-contract
@temporal-contract/worker@4.0.0
Major Changes
-
ebf7683: Upgrade to
unthrown1.0.0.unthrown 1.0.0 renames the result constructors to PascalCase:
ok→Ok,err→Err,defect→Defect. All packages are updated, and theunthrownpeer-dependency range moves to^1.Breaking for consumers who construct results directly (e.g. in activity implementations): replace
ok(value)/err(failure)withOk(value)/Err(failure)(andok(value).toAsync()/err(failure).toAsync()at promise boundaries), and bumpunthrownto^1. Theresult.match({ ok, err, defect })handler keys are unchanged (they are object keys, not constructors), andmatchTags/TaggedError/fromPromise/fromSafePromise/.toAsync()and theresult.isOk()/isErr()/isDefect()narrowing are all unchanged.See the Migrating from neverthrow guide.
Patch Changes
- Updated dependencies [ebf7683]
- @temporal-contract/contract@4.0.0
@temporal-contract/worker@3.0.0
Major Changes
-
8d0750f: Replace
neverthrowwithunthrownfor the Result/error-handling spine across all packages. This is a breaking change to the public API.What changed
ResultAsync<T, E>→AsyncResult<T, E>. Every activity, workflow-context, child-workflow, schedule, and typed-client method that returned aResultAsyncnow returns anAsyncResult. Theunthrownpeer dependency replacesneverthrow.- No
okAsync/errAsync. Lift a synchronousResultwith.toAsync()instead:ok(value).toAsync(),err(failure).toAsync(). Promise boundaries usefromPromise(promise, qualify)/fromSafePromise(promise). - Narrow before accessing the payload. Both the
result.isOk()/isErr()/isDefect()methods and the matching free functionsisOk(result)/isErr(result)/isDefect(result)(imported fromunthrown) are type guards; the codebase uses the methods. Narrow before touching.value/.error/.cause. - New
defectchannel. Unanticipated throws (a thrown exception the code did not model) now surface onunthrown's thirddefectchannel — inspected viaresult.isDefect()/result.causeand re-thrown at the edge — rather than as a typederr. Deliberate boundary classification (e.g. mapping a Temporal SDK rejection toWorkflowExecutionNotFoundError) still produces a modelederr.result.match({ ok, err, defect })folds all three. WorkflowScopeErrorremoved. Non-cancellation errors thrown insidecancellableScope/nonCancellableScopeare unmodeled failures and now ride thedefectchannel. The scopes' error union narrows toWorkflowCancelledError.- The client's "unexpected"
RuntimeClientErrorwrap is gone. An unanticipated rejection in a client operation now surfaces as a defect, not a manufacturedRuntimeClientError.RuntimeClientErroris still produced by deliberate boundary classification. - Error classes use
TaggedError. The workerWorkerErrorhierarchy and the entire clientTypedClientErrorhierarchy are now built withunthrown'sTaggedError, each carrying a_tagdiscriminant (foldable withmatchTags). The_tagis package-namespaced — e.g."@temporal-contract/WorkflowExecutionNotFoundError"— so it never collides with a consumer's own tags; each error's.namestays the bare class name for readable logs.ChildWorkflowCancelledErroris now a sibling ofChildWorkflowError(distinct_tag) rather than a subclass — discriminate on_tag/instanceof ChildWorkflowCancelledErrorinstead of relying oninstanceof ChildWorkflowErrormatching cancellation. The worker'sValidationErrorsubclasses are unchanged — they still extend Temporal'sApplicationFailurefor terminal-failure semantics.
See the Migrating from neverthrow guide.
Patch Changes
- Updated dependencies [8d0750f]
- @temporal-contract/contract@3.0.0
@temporal-contract/testing@4.0.0
Major Changes
-
ebf7683: Upgrade to
unthrown1.0.0.unthrown 1.0.0 renames the result constructors to PascalCase:
ok→Ok,err→Err,defect→Defect. All packages are updated, and theunthrownpeer-dependency range moves to^1.Breaking for consumers who construct results directly (e.g. in activity implementations): replace
ok(value)/err(failure)withOk(value)/Err(failure)(andok(value).toAsync()/err(failure).toAsync()at promise boundaries), and bumpunthrownto^1. Theresult.match({ ok, err, defect })handler keys are unchanged (they are object keys, not constructors), andmatchTags/TaggedError/fromPromise/fromSafePromise/.toAsync()and theresult.isOk()/isErr()/isDefect()narrowing are all unchanged.See the Migrating from neverthrow guide.
@temporal-contract/testing@3.0.0
Major Changes
-
8d0750f: Replace
neverthrowwithunthrownfor the Result/error-handling spine across all packages. This is a breaking change to the public API.What changed
ResultAsync<T, E>→AsyncResult<T, E>. Every activity, workflow-context, child-workflow, schedule, and typed-client method that returned aResultAsyncnow returns anAsyncResult. Theunthrownpeer dependency replacesneverthrow.- No
okAsync/errAsync. Lift a synchronousResultwith.toAsync()instead:ok(value).toAsync(),err(failure).toAsync(). Promise boundaries usefromPromise(promise, qualify)/fromSafePromise(promise). - Narrow before accessing the payload. Both the
result.isOk()/isErr()/isDefect()methods and the matching free functionsisOk(result)/isErr(result)/isDefect(result)(imported fromunthrown) are type guards; the codebase uses the methods. Narrow before touching.value/.error/.cause. - New
defectchannel. Unanticipated throws (a thrown exception the code did not model) now surface onunthrown's thirddefectchannel — inspected viaresult.isDefect()/result.causeand re-thrown at the edge — rather than as a typederr. Deliberate boundary classification (e.g. mapping a Temporal SDK rejection toWorkflowExecutionNotFoundError) still produces a modelederr.result.match({ ok, err, defect })folds all three. WorkflowScopeErrorremoved. Non-cancellation errors thrown insidecancellableScope/nonCancellableScopeare unmodeled failures and now ride thedefectchannel. The scopes' error union narrows toWorkflowCancelledError.- The client's "unexpected"
RuntimeClientErrorwrap is gone. An unanticipated rejection in a client operation now surfaces as a defect, not a manufacturedRuntimeClientError.RuntimeClientErroris still produced by deliberate boundary classification. - Error classes use
TaggedError. The workerWorkerErrorhierarchy and the entire clientTypedClientErrorhierarchy are now built withunthrown'sTaggedError, each carrying a_tagdiscriminant (foldable withmatchTags). The_tagis package-namespaced — e.g."@temporal-contract/WorkflowExecutionNotFoundError"— so it never collides with a consumer's own tags; each error's.namestays the bare class name for readable logs.ChildWorkflowCancelledErroris now a sibling ofChildWorkflowError(distinct_tag) rather than a subclass — discriminate on_tag/instanceof ChildWorkflowCancelledErrorinstead of relying oninstanceof ChildWorkflowErrormatching cancellation. The worker'sValidationErrorsubclasses are unchanged — they still extend Temporal'sApplicationFailurefor terminal-failure semantics.
See the Migrating from neverthrow guide.
@temporal-contract/contract@4.0.0
Major Changes
-
ebf7683: Upgrade to
unthrown1.0.0.unthrown 1.0.0 renames the result constructors to PascalCase:
ok→Ok,err→Err,defect→Defect. All packages are updated, and theunthrownpeer-dependency range moves to^1.Breaking for consumers who construct results directly (e.g. in activity implementations): replace
ok(value)/err(failure)withOk(value)/Err(failure)(andok(value).toAsync()/err(failure).toAsync()at promise boundaries), and bumpunthrownto^1. Theresult.match({ ok, err, defect })handler keys are unchanged (they are object keys, not constructors), andmatchTags/TaggedError/fromPromise/fromSafePromise/.toAsync()and theresult.isOk()/isErr()/isDefect()narrowing are all unchanged.See the Migrating from neverthrow guide.
@temporal-contract/contract@3.0.0
Major Changes
-
8d0750f: Replace
neverthrowwithunthrownfor the Result/error-handling spine across all packages. This is a breaking change to the public API.What changed
ResultAsync<T, E>→AsyncResult<T, E>. Every activity, workflow-context, child-workflow, schedule, and typed-client method that returned aResultAsyncnow returns anAsyncResult. Theunthrownpeer dependency replacesneverthrow.- No
okAsync/errAsync. Lift a synchronousResultwith.toAsync()instead:ok(value).toAsync(),err(failure).toAsync(). Promise boundaries usefromPromise(promise, qualify)/fromSafePromise(promise). - Narrow before accessing the payload. Both the
result.isOk()/isErr()/isDefect()methods and the matching free functionsisOk(result)/isErr(result)/isDefect(result)(imported fromunthrown) are type guards; the codebase uses the methods. Narrow before touching.value/.error/.cause. - New
defectchannel. Unanticipated throws (a thrown exception the code did not model) now surface onunthrown's thirddefectchannel — inspected viaresult.isDefect()/result.causeand re-thrown at the edge — rather than as a typederr. Deliberate boundary classification (e.g. mapping a Temporal SDK rejection toWorkflowExecutionNotFoundError) still produces a modelederr.result.match({ ok, err, defect })folds all three. WorkflowScopeErrorremoved. Non-cancellation errors thrown insidecancellableScope/nonCancellableScopeare unmodeled failures and now ride thedefectchannel. The scopes' error union narrows toWorkflowCancelledError.- The client's "unexpected"
RuntimeClientErrorwrap is gone. An unanticipated rejection in a client operation now surfaces as a defect, not a manufacturedRuntimeClientError.RuntimeClientErroris still produced by deliberate boundary classification. - Error classes use
TaggedError. The workerWorkerErrorhierarchy and the entire clientTypedClientErrorhierarchy are now built withunthrown'sTaggedError, each carrying a_tagdiscriminant (foldable withmatchTags). The_tagis package-namespaced — e.g."@temporal-contract/WorkflowExecutionNotFoundError"— so it never collides with a consumer's own tags; each error's.namestays the bare class name for readable logs.ChildWorkflowCancelledErroris now a sibling ofChildWorkflowError(distinct_tag) rather than a subclass — discriminate on_tag/instanceof ChildWorkflowCancelledErrorinstead of relying oninstanceof ChildWorkflowErrormatching cancellation. The worker'sValidationErrorsubclasses are unchanged — they still extend Temporal'sApplicationFailurefor terminal-failure semantics.
See the Migrating from neverthrow guide.
@temporal-contract/client@4.0.0
Major Changes
-
ebf7683: Upgrade to
unthrown1.0.0.unthrown 1.0.0 renames the result constructors to PascalCase:
ok→Ok,err→Err,defect→Defect. All packages are updated, and theunthrownpeer-dependency range moves to^1.Breaking for consumers who construct results directly (e.g. in activity implementations): replace
ok(value)/err(failure)withOk(value)/Err(failure)(andok(value).toAsync()/err(failure).toAsync()at promise boundaries), and bumpunthrownto^1. Theresult.match({ ok, err, defect })handler keys are unchanged (they are object keys, not constructors), andmatchTags/TaggedError/fromPromise/fromSafePromise/.toAsync()and theresult.isOk()/isErr()/isDefect()narrowing are all unchanged.See the Migrating from neverthrow guide.
Patch Changes
- Updated dependencies [ebf7683]
- @temporal-contract/contract@4.0.0
@temporal-contract/client@3.0.0
Major Changes
-
8d0750f: Replace
neverthrowwithunthrownfor the Result/error-handling spine across all packages. This is a breaking change to the public API.What changed
ResultAsync<T, E>→AsyncResult<T, E>. Every activity, workflow-context, child-workflow, schedule, and typed-client method that returned aResultAsyncnow returns anAsyncResult. Theunthrownpeer dependency replacesneverthrow.- No
okAsync/errAsync. Lift a synchronousResultwith.toAsync()instead:ok(value).toAsync(),err(failure).toAsync(). Promise boundaries usefromPromise(promise, qualify)/fromSafePromise(promise). - Narrow before accessing the payload. Both the
result.isOk()/isErr()/isDefect()methods and the matching free functionsisOk(result)/isErr(result)/isDefect(result)(imported fromunthrown) are type guards; the codebase uses the methods. Narrow before touching.value/.error/.cause. - New
defectchannel. Unanticipated throws (a thrown exception the code did not model) now surface onunthrown's thirddefectchannel — inspected viaresult.isDefect()/result.causeand re-thrown at the edge — rather than as a typederr. Deliberate boundary classification (e.g. mapping a Temporal SDK rejection toWorkflowExecutionNotFoundError) still produces a modelederr.result.match({ ok, err, defect })folds all three. WorkflowScopeErrorremoved. Non-cancellation errors thrown insidecancellableScope/nonCancellableScopeare unmodeled failures and now ride thedefectchannel. The scopes' error union narrows toWorkflowCancelledError.- The client's "unexpected"
RuntimeClientErrorwrap is gone. An unanticipated rejection in a client operation now surfaces as a defect, not a manufacturedRuntimeClientError.RuntimeClientErroris still produced by deliberate boundary classification. - Error classes use
TaggedError. The workerWorkerErrorhierarchy and the entire clientTypedClientErrorhierarchy are now built withunthrown'sTaggedError, each carrying a_tagdiscriminant (foldable withmatchTags). The_tagis package-namespaced — e.g."@temporal-contract/WorkflowExecutionNotFoundError"— so it never collides with a consumer's own tags; each error's.namestays the bare class name for readable logs.ChildWorkflowCancelledErroris now a sibling ofChildWorkflowError(distinct_tag) rather than a subclass — discriminate on_tag/instanceof ChildWorkflowCancelledErrorinstead of relying oninstanceof ChildWorkflowErrormatching cancellation. The worker'sValidationErrorsubclasses are unchanged — they still extend Temporal'sApplicationFailurefor terminal-failure semantics.
See the Migrating from neverthrow guide.
Patch Changes
- Updated dependencies [8d0750f]
- @temporal-contract/contract@3.0.0
@temporal-contract/worker@2.4.0
Minor Changes
-
eae7aae: Declare
engines.node: ">=22.19.0"on every published package. The floor is set byundici@8(pulled in transitively bytestcontainersvia@temporal-contract/testing), which already fails at runtime on Node ≤22.18 — the engines field just surfaces that reality at install time so consumers get a clear signal instead of a stack trace. Also bumps@temporalio/*1.18.0 → 1.18.1 andtestcontainers12.0.1 → 12.0.2 in the catalog. -
2c18aa4: Make contract validation failures fail the execution terminally instead of hanging the workflow.
Previously, the worker's runtime validation errors (
WorkflowInputValidationError,WorkflowOutputValidationError,ActivityInputValidationError,ActivityOutputValidationError, and the signal/query/update equivalents) were plainErrors. The TypeScript SDK classifies a non-TemporalFailurethrown from workflow code as a Workflow Task failure and retries it indefinitely, so a deterministic validation failure produced a silently hung workflow (stuckRunning, only a repeatingWorkflowTaskFailedevent) rather than a failed execution. The same hazard applied at the activity boundary, where Temporal's default retry policy is unlimited. See #251.These error classes now extend Temporal's
ApplicationFailurewithnonRetryable: true. Because contract schemas are static, a validation failure can never pass on retry, so the execution now fails fast and terminally with aWorkflowExecutionFailedevent. The concrete error name is preserved as the failuretype(e.g."WorkflowInputValidationError"), so it stays discriminable viafailure.typeafter crossing Temporal's serialization boundary, and the failing field path remains in the human-readablemessage.The error classes keep their names and identity, so existing
instanceof WorkflowInputValidationErrorchecks (and the new sharedValidationErrorbase, now exported from@temporal-contract/worker/workflowand/activity) continue to work. If you previously wrappeddeclareWorkflow(...)to rethrow these asApplicationFailure.nonRetryableyourself, that workaround is no longer needed.
Patch Changes
- Updated dependencies [eae7aae]
- @temporal-contract/contract@2.4.0
@temporal-contract/testing@2.4.0
Minor Changes
- eae7aae: Declare
engines.node: ">=22.19.0"on every published package. The floor is set byundici@8(pulled in transitively bytestcontainersvia@temporal-contract/testing), which already fails at runtime on Node ≤22.18 — the engines field just surfaces that reality at install time so consumers get a clear signal instead of a stack trace. Also bumps@temporalio/*1.18.0 → 1.18.1 andtestcontainers12.0.1 → 12.0.2 in the catalog.