@temporal-contract/client 2.2.0 → 2.3.1

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/dist/index.cjs CHANGED
@@ -6,7 +6,7 @@ let _temporalio_client = require("@temporalio/client");
6
6
  let _temporal_contract_contract_result_async = require("@temporal-contract/contract/result-async");
7
7
  //#region src/errors.ts
8
8
  /**
9
- * Base class for all typed client errors with boxed pattern
9
+ * Base class for all typed client errors.
10
10
  */
11
11
  var TypedClientError = class extends Error {
12
12
  constructor(message) {
@@ -19,6 +19,8 @@ var TypedClientError = class extends Error {
19
19
  * Generic runtime failure wrapper when no specific error type applies
20
20
  */
21
21
  var RuntimeClientError = class extends TypedClientError {
22
+ operation;
23
+ cause;
22
24
  constructor(operation, cause) {
23
25
  super(`Operation "${operation}" failed: ${cause instanceof Error ? cause.message : String(cause ?? "unknown error")}`);
24
26
  this.operation = operation;
@@ -29,6 +31,8 @@ var RuntimeClientError = class extends TypedClientError {
29
31
  * Thrown when a workflow is not found in the contract
30
32
  */
31
33
  var WorkflowNotFoundError = class extends TypedClientError {
34
+ workflowName;
35
+ availableWorkflows;
32
36
  constructor(workflowName, availableWorkflows) {
33
37
  super(`Workflow "${workflowName}" not found in contract. Available workflows: ${availableWorkflows.join(", ")}`);
34
38
  this.workflowName = workflowName;
@@ -47,6 +51,9 @@ var WorkflowNotFoundError = class extends TypedClientError {
47
51
  * without inspecting `error.cause` against a Temporal SDK class.
48
52
  */
49
53
  var WorkflowAlreadyStartedError = class extends TypedClientError {
54
+ workflowType;
55
+ workflowId;
56
+ cause;
50
57
  constructor(workflowType, workflowId, cause) {
51
58
  super(`Workflow "${workflowType}" with ID "${workflowId}" is already started or in retention.`);
52
59
  this.workflowType = workflowType;
@@ -67,6 +74,9 @@ var WorkflowAlreadyStartedError = class extends TypedClientError {
67
74
  * execution mid-flight)
68
75
  */
69
76
  var WorkflowExecutionNotFoundError = class extends TypedClientError {
77
+ workflowId;
78
+ runId;
79
+ cause;
70
80
  constructor(workflowId, runId, cause) {
71
81
  super(`Workflow execution "${workflowId}"${runId ? ` (run "${runId}")` : ""} not found in namespace.`);
72
82
  this.workflowId = workflowId;
@@ -94,6 +104,8 @@ var WorkflowExecutionNotFoundError = class extends TypedClientError {
94
104
  * Returned from `executeWorkflow` and `handle.result()`.
95
105
  */
96
106
  var WorkflowFailedError = class extends TypedClientError {
107
+ workflowId;
108
+ cause;
97
109
  constructor(workflowId, cause) {
98
110
  const causeMessage = cause instanceof Error ? cause.message : String(cause ?? "unknown failure");
99
111
  super(`Workflow "${workflowId}" completed with failure: ${causeMessage}`);
@@ -105,6 +117,9 @@ var WorkflowFailedError = class extends TypedClientError {
105
117
  * Thrown when workflow input or output validation fails
106
118
  */
107
119
  var WorkflowValidationError = class extends TypedClientError {
120
+ workflowName;
121
+ direction;
122
+ issues;
108
123
  constructor(workflowName, direction, issues) {
109
124
  super(`Validation failed for workflow "${workflowName}" ${direction}: ${(0, _temporal_contract_contract.summarizeIssues)(issues)}`);
110
125
  this.workflowName = workflowName;
@@ -116,6 +131,9 @@ var WorkflowValidationError = class extends TypedClientError {
116
131
  * Thrown when query input or output validation fails
117
132
  */
118
133
  var QueryValidationError = class extends TypedClientError {
134
+ queryName;
135
+ direction;
136
+ issues;
119
137
  constructor(queryName, direction, issues) {
120
138
  super(`Validation failed for query "${queryName}" ${direction}: ${(0, _temporal_contract_contract.summarizeIssues)(issues)}`);
121
139
  this.queryName = queryName;
@@ -127,6 +145,8 @@ var QueryValidationError = class extends TypedClientError {
127
145
  * Thrown when signal input validation fails
128
146
  */
129
147
  var SignalValidationError = class extends TypedClientError {
148
+ signalName;
149
+ issues;
130
150
  constructor(signalName, issues) {
131
151
  super(`Validation failed for signal "${signalName}": ${(0, _temporal_contract_contract.summarizeIssues)(issues)}`);
132
152
  this.signalName = signalName;
@@ -137,6 +157,9 @@ var SignalValidationError = class extends TypedClientError {
137
157
  * Thrown when update input or output validation fails
138
158
  */
139
159
  var UpdateValidationError = class extends TypedClientError {
160
+ updateName;
161
+ direction;
162
+ issues;
140
163
  constructor(updateName, direction, issues) {
141
164
  super(`Validation failed for update "${updateName}" ${direction}: ${(0, _temporal_contract_contract.summarizeIssues)(issues)}`);
142
165
  this.updateName = updateName;
@@ -252,6 +275,8 @@ function classifyResultError(operation, error, workflowId) {
252
275
  * same way Temporal's own `Client.schedule` does.
253
276
  */
254
277
  var TypedScheduleClient = class {
278
+ contract;
279
+ scheduleClient;
255
280
  constructor(contract, scheduleClient) {
256
281
  this.contract = contract;
257
282
  this.scheduleClient = scheduleClient;
@@ -405,6 +430,8 @@ async function resolveDefinitionAndValidateInput(contract, workflowName, args, s
405
430
  * defined in the contract, with explicit error handling using Result pattern.
406
431
  */
407
432
  var TypedClient = class TypedClient {
433
+ contract;
434
+ client;
408
435
  /**
409
436
  * Typed wrapper around Temporal's `client.schedule.create(...)` and
410
437
  * related lifecycle methods. Fires the underlying `startWorkflow` action
@@ -412,8 +439,10 @@ var TypedClient = class TypedClient {
412
439
  *
413
440
  * **Requires `@temporalio/client` 1.16+.** The Schedule API was added in
414
441
  * 1.16; on older versions this property is unset and any access throws.
415
- * The package's peer dep is pinned to `^1.16.0` so the standard install
416
- * paths surface a peer-dependency warning rather than a runtime crash.
442
+ * The package's peer dep allows the whole `^1` range to stay permissive
443
+ * about the installed Temporal version, so consumers on < 1.16 who never
444
+ * touch schedules keep working — the constructor below fails fast with a
445
+ * clear message for anyone who does reach for the Schedule API too early.
417
446
  *
418
447
  * @example
419
448
  * ```ts
package/dist/index.d.cts CHANGED
@@ -94,7 +94,7 @@ type ClientInferWorkflowContextActivities<TContract extends ContractDefinition,
94
94
  */
95
95
  type TemporalFailure = ApplicationFailure | CancelledFailure | TerminatedFailure | TimeoutFailure | ChildWorkflowFailure | ServerFailure | ActivityFailure;
96
96
  /**
97
- * Base class for all typed client errors with boxed pattern
97
+ * Base class for all typed client errors.
98
98
  */
99
99
  declare abstract class TypedClientError extends Error {
100
100
  protected constructor(message: string);
@@ -436,8 +436,10 @@ declare class TypedClient<TContract extends ContractDefinition> {
436
436
  *
437
437
  * **Requires `@temporalio/client` 1.16+.** The Schedule API was added in
438
438
  * 1.16; on older versions this property is unset and any access throws.
439
- * The package's peer dep is pinned to `^1.16.0` so the standard install
440
- * paths surface a peer-dependency warning rather than a runtime crash.
439
+ * The package's peer dep allows the whole `^1` range to stay permissive
440
+ * about the installed Temporal version, so consumers on < 1.16 who never
441
+ * touch schedules keep working — the constructor below fails fast with a
442
+ * clear message for anyone who does reach for the Schedule API too early.
441
443
  *
442
444
  * @example
443
445
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/types.ts","../src/errors.ts","../src/schedule.ts","../src/client.ts"],"mappings":";;;;;;;;;;;KAgBY,gBAAA;EAA6B,KAAA,EAAO,SAAA;AAAA,KAAe,gBAAA,CAAiB,UAAA,CAC9E,CAAA;;;;;KAOU,iBAAA;EAA8B,MAAA,EAAQ,SAAA;AAAA,KAAe,gBAAA,CAAiB,WAAA,CAChF,CAAA;;;;;;;AADF;;KAaY,mBAAA,mBAAsC,qBAAA,KAChD,IAAA,EAAM,gBAAA,CAAiB,SAAA,MACpB,OAAA,CAAQ,iBAAA,CAAkB,SAAA;;;;;KAMnB,mBAAA,mBAAsC,kBAAA,KAChD,IAAA,EAAM,gBAAA,CAAiB,SAAA,MACpB,OAAA,CAAQ,iBAAA,CAAkB,SAAA;;;;;KAMnB,iBAAA,iBAAkC,gBAAA,KAC5C,IAAA,EAAM,gBAAA,CAAiB,OAAA,MACpB,WAAA,OAAkB,KAAA;;;;AAlBvB;KAwBY,gBAAA,gBAAgC,eAAA,KAC1C,IAAA,EAAM,gBAAA,CAAiB,MAAA,MACpB,WAAA,CAAY,iBAAA,CAAkB,MAAA,GAAS,KAAA;;;;;KAMhC,iBAAA,iBAAkC,gBAAA,KAC5C,IAAA,EAAM,gBAAA,CAAiB,OAAA,MACpB,WAAA,CAAY,iBAAA,CAA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;AAOnE;;;;EGyYE,eAAA,6BAC8B,SAAA,4CACR,aAAA,CAAc,SAAA,cAAuB,aAAA,IAEzD,YAAA,EAAc,aAAA;IAEZ,IAAA;IACA,UAAA;IACA,UAAA;IACA,gBAAA;IAAA,GACG;EAAA,GACF,2BAAA,CAA4B,SAAA,EAAW,aAAA,EAAe,WAAA,IACxD,WAAA,CACD,oCAAA,CAAqC,SAAA,cAAuB,aAAA,IAC1D,qBAAA,GACA,uBAAA,GACA,qBAAA,GACA,2BAAA,GACA,kBAAA;EH1ZgC;;;;;;;;;;;;;;;;;;EGwepC,eAAA,6BAA4C,SAAA,wBAC1C,YAAA,EAAc,aAAA;IAEZ,IAAA;IACA,gBAAA;IAAA,GACG;EAAA,GACF,yBAAA,CAA0B,SAAA,EAAW,aAAA,IACvC,WAAA,CACD,iBAAA,CAAkB,SAAA,cAAuB,aAAA,IACvC,qBAAA,GACA,uBAAA,GACA,2BAAA,GACA,mBAAA,GACA,8BAAA,GACA,kBAAA;EHpf4D;AAOlE;;;;;;;;;;;;;;EGwkBE,SAAA,6BAAsC,SAAA,wBACpC,YAAA,EAAc,aAAA,EACd,UAAA,WACC,WAAA,CACD,mBAAA,CAAoB,SAAA,cAAuB,aAAA,IAC3C,qBAAA,GAAwB,kBAAA;EAAA,QAoBlB,iBAAA;AAAA"}
package/dist/index.d.mts CHANGED
@@ -94,7 +94,7 @@ type ClientInferWorkflowContextActivities<TContract extends ContractDefinition,
94
94
  */
95
95
  type TemporalFailure = ApplicationFailure | CancelledFailure | TerminatedFailure | TimeoutFailure | ChildWorkflowFailure | ServerFailure | ActivityFailure;
96
96
  /**
97
- * Base class for all typed client errors with boxed pattern
97
+ * Base class for all typed client errors.
98
98
  */
99
99
  declare abstract class TypedClientError extends Error {
100
100
  protected constructor(message: string);
@@ -436,8 +436,10 @@ declare class TypedClient<TContract extends ContractDefinition> {
436
436
  *
437
437
  * **Requires `@temporalio/client` 1.16+.** The Schedule API was added in
438
438
  * 1.16; on older versions this property is unset and any access throws.
439
- * The package's peer dep is pinned to `^1.16.0` so the standard install
440
- * paths surface a peer-dependency warning rather than a runtime crash.
439
+ * The package's peer dep allows the whole `^1` range to stay permissive
440
+ * about the installed Temporal version, so consumers on < 1.16 who never
441
+ * touch schedules keep working — the constructor below fails fast with a
442
+ * clear message for anyone who does reach for the Schedule API too early.
441
443
  *
442
444
  * @example
443
445
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/errors.ts","../src/schedule.ts","../src/client.ts"],"mappings":";;;;;;;;;;;KAgBY,gBAAA;EAA6B,KAAA,EAAO,SAAA;AAAA,KAAe,gBAAA,CAAiB,UAAA,CAC9E,CAAA;;;;;KAOU,iBAAA;EAA8B,MAAA,EAAQ,SAAA;AAAA,KAAe,gBAAA,CAAiB,WAAA,CAChF,CAAA;;;;;;;AADF;;KAaY,mBAAA,mBAAsC,qBAAA,KAChD,IAAA,EAAM,gBAAA,CAAiB,SAAA,MACpB,OAAA,CAAQ,iBAAA,CAAkB,SAAA;;;;;KAMnB,mBAAA,mBAAsC,kBAAA,KAChD,IAAA,EAAM,gBAAA,CAAiB,SAAA,MACpB,OAAA,CAAQ,iBAAA,CAAkB,SAAA;;;;;KAMnB,iBAAA,iBAAkC,gBAAA,KAC5C,IAAA,EAAM,gBAAA,CAAiB,OAAA,MACpB,WAAA,OAAkB,KAAA;;;;AAlBvB;KAwBY,gBAAA,gBAAgC,eAAA,KAC1C,IAAA,EAAM,gBAAA,CAAiB,MAAA,MACpB,WAAA,CAAY,iBAAA,CAAkB,MAAA,GAAS,KAAA;;;;;KAMhC,iBAAA,iBAAkC,gBAAA,KAC5C,IAAA,EAAM,gBAAA,CAAiB,OAAA,MACpB,WAAA,CAAY,iBAAA,CAAkB,OAAA,GAAU,KAAA;;;;;;;KASjC,oBAAA,mBAAuC,kBAAA,kBACrC,SAAA,gBAAyB,mBAAA,CAAoB,SAAA,cAAuB,CAAA;;;;KAMtE,qBAAA,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,IAAA;IACA,gBAAA;IAAA,GACG;EAAA,GACF,yBAAA,CAA0B,SAAA,EAAW,aAAA,IACvC,WAAA,CACD,mBAAA,CAAoB,SAAA,cAAuB,aAAA,IACzC,qBAAA,GACA,uBAAA,GACA,2BAAA,GACA,kBAAA;EHtVgC;;;;;;;;;;;;;;;;;;;;;;;;AAUtC;;EGuYE,eAAA,6BAC8B,SAAA,4CACR,aAAA,CAAc,SAAA,cAAuB,aAAA,GAAA,CAEzD,YAAA,EAAc,aAAA;IAEZ,IAAA;IACA,UAAA;IACA,UAAA;IACA,gBAAA;IAAA,GACG;EAAA,GACF,2BAAA,CAA4B,SAAA,EAAW,aAAA,EAAe,WAAA,IACxD,WAAA,CACD,oCAAA,CAAqC,SAAA,cAAuB,aAAA,IAC1D,qBAAA,GACA,uBAAA,GACA,qBAAA,GACA,2BAAA,GACA,kBAAA;EHzZ2C;;;;;;;;;;;;;;;;;;EGue/C,eAAA,6BAA4C,SAAA,uBAAA,CAC1C,YAAA,EAAc,aAAA;IAEZ,IAAA;IACA,gBAAA;IAAA,GACG;EAAA,GACF,yBAAA,CAA0B,SAAA,EAAW,aAAA,IACvC,WAAA,CACD,iBAAA,CAAkB,SAAA,cAAuB,aAAA,IACvC,qBAAA,GACA,uBAAA,GACA,2BAAA,GACA,mBAAA,GACA,8BAAA,GACA,kBAAA;EHlf2D;;;AAOjE;;;;;;;;;;;;EGskBE,SAAA,6BAAsC,SAAA,uBAAA,CACpC,YAAA,EAAc,aAAA,EACd,UAAA,WACC,WAAA,CACD,mBAAA,CAAoB,SAAA,cAAuB,aAAA,IAC3C,qBAAA,GAAwB,kBAAA;EAAA,QAoBlB,iBAAA;AAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/errors.ts","../src/schedule.ts","../src/client.ts"],"mappings":";;;;;;;;;;;KAgBY,gBAAA;EAA6B,KAAA,EAAO,SAAA;AAAA,KAAe,gBAAA,CAAiB,UAAA,CAC9E,CAAA;;;;;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UAAA;IACA,gBAAA;IAAA,GACG;EAAA,GACF,2BAAA,CAA4B,SAAA,EAAW,aAAA,EAAe,WAAA,IACxD,WAAA,CACD,oCAAA,CAAqC,SAAA,cAAuB,aAAA,IAC1D,qBAAA,GACA,uBAAA,GACA,qBAAA,GACA,2BAAA,GACA,kBAAA;EH1ZgC;;;;;;;;;;;;;;;;;;EGwepC,eAAA,6BAA4C,SAAA,wBAC1C,YAAA,EAAc,aAAA;IAEZ,IAAA;IACA,gBAAA;IAAA,GACG;EAAA,GACF,yBAAA,CAA0B,SAAA,EAAW,aAAA,IACvC,WAAA,CACD,iBAAA,CAAkB,SAAA,cAAuB,aAAA,IACvC,qBAAA,GACA,uBAAA,GACA,2BAAA,GACA,mBAAA,GACA,8BAAA,GACA,kBAAA;EHpf4D;AAOlE;;;;;;;;;;;;;;EGwkBE,SAAA,6BAAsC,SAAA,wBACpC,YAAA,EAAc,aAAA,EACd,UAAA,WACC,WAAA,CACD,mBAAA,CAAoB,SAAA,cAAuB,aAAA,IAC3C,qBAAA,GAAwB,kBAAA;EAAA,QAoBlB,iBAAA;AAAA"}
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ import { WorkflowExecutionAlreadyStartedError, WorkflowFailedError as WorkflowFa
5
5
  import { _internal_makeResultAsync } from "@temporal-contract/contract/result-async";
6
6
  //#region src/errors.ts
7
7
  /**
8
- * Base class for all typed client errors with boxed pattern
8
+ * Base class for all typed client errors.
9
9
  */
10
10
  var TypedClientError = class extends Error {
11
11
  constructor(message) {
@@ -18,6 +18,8 @@ var TypedClientError = class extends Error {
18
18
  * Generic runtime failure wrapper when no specific error type applies
19
19
  */
20
20
  var RuntimeClientError = class extends TypedClientError {
21
+ operation;
22
+ cause;
21
23
  constructor(operation, cause) {
22
24
  super(`Operation "${operation}" failed: ${cause instanceof Error ? cause.message : String(cause ?? "unknown error")}`);
23
25
  this.operation = operation;
@@ -28,6 +30,8 @@ var RuntimeClientError = class extends TypedClientError {
28
30
  * Thrown when a workflow is not found in the contract
29
31
  */
30
32
  var WorkflowNotFoundError = class extends TypedClientError {
33
+ workflowName;
34
+ availableWorkflows;
31
35
  constructor(workflowName, availableWorkflows) {
32
36
  super(`Workflow "${workflowName}" not found in contract. Available workflows: ${availableWorkflows.join(", ")}`);
33
37
  this.workflowName = workflowName;
@@ -46,6 +50,9 @@ var WorkflowNotFoundError = class extends TypedClientError {
46
50
  * without inspecting `error.cause` against a Temporal SDK class.
47
51
  */
48
52
  var WorkflowAlreadyStartedError = class extends TypedClientError {
53
+ workflowType;
54
+ workflowId;
55
+ cause;
49
56
  constructor(workflowType, workflowId, cause) {
50
57
  super(`Workflow "${workflowType}" with ID "${workflowId}" is already started or in retention.`);
51
58
  this.workflowType = workflowType;
@@ -66,6 +73,9 @@ var WorkflowAlreadyStartedError = class extends TypedClientError {
66
73
  * execution mid-flight)
67
74
  */
68
75
  var WorkflowExecutionNotFoundError = class extends TypedClientError {
76
+ workflowId;
77
+ runId;
78
+ cause;
69
79
  constructor(workflowId, runId, cause) {
70
80
  super(`Workflow execution "${workflowId}"${runId ? ` (run "${runId}")` : ""} not found in namespace.`);
71
81
  this.workflowId = workflowId;
@@ -93,6 +103,8 @@ var WorkflowExecutionNotFoundError = class extends TypedClientError {
93
103
  * Returned from `executeWorkflow` and `handle.result()`.
94
104
  */
95
105
  var WorkflowFailedError = class extends TypedClientError {
106
+ workflowId;
107
+ cause;
96
108
  constructor(workflowId, cause) {
97
109
  const causeMessage = cause instanceof Error ? cause.message : String(cause ?? "unknown failure");
98
110
  super(`Workflow "${workflowId}" completed with failure: ${causeMessage}`);
@@ -104,6 +116,9 @@ var WorkflowFailedError = class extends TypedClientError {
104
116
  * Thrown when workflow input or output validation fails
105
117
  */
106
118
  var WorkflowValidationError = class extends TypedClientError {
119
+ workflowName;
120
+ direction;
121
+ issues;
107
122
  constructor(workflowName, direction, issues) {
108
123
  super(`Validation failed for workflow "${workflowName}" ${direction}: ${summarizeIssues(issues)}`);
109
124
  this.workflowName = workflowName;
@@ -115,6 +130,9 @@ var WorkflowValidationError = class extends TypedClientError {
115
130
  * Thrown when query input or output validation fails
116
131
  */
117
132
  var QueryValidationError = class extends TypedClientError {
133
+ queryName;
134
+ direction;
135
+ issues;
118
136
  constructor(queryName, direction, issues) {
119
137
  super(`Validation failed for query "${queryName}" ${direction}: ${summarizeIssues(issues)}`);
120
138
  this.queryName = queryName;
@@ -126,6 +144,8 @@ var QueryValidationError = class extends TypedClientError {
126
144
  * Thrown when signal input validation fails
127
145
  */
128
146
  var SignalValidationError = class extends TypedClientError {
147
+ signalName;
148
+ issues;
129
149
  constructor(signalName, issues) {
130
150
  super(`Validation failed for signal "${signalName}": ${summarizeIssues(issues)}`);
131
151
  this.signalName = signalName;
@@ -136,6 +156,9 @@ var SignalValidationError = class extends TypedClientError {
136
156
  * Thrown when update input or output validation fails
137
157
  */
138
158
  var UpdateValidationError = class extends TypedClientError {
159
+ updateName;
160
+ direction;
161
+ issues;
139
162
  constructor(updateName, direction, issues) {
140
163
  super(`Validation failed for update "${updateName}" ${direction}: ${summarizeIssues(issues)}`);
141
164
  this.updateName = updateName;
@@ -251,6 +274,8 @@ function classifyResultError(operation, error, workflowId) {
251
274
  * same way Temporal's own `Client.schedule` does.
252
275
  */
253
276
  var TypedScheduleClient = class {
277
+ contract;
278
+ scheduleClient;
254
279
  constructor(contract, scheduleClient) {
255
280
  this.contract = contract;
256
281
  this.scheduleClient = scheduleClient;
@@ -404,6 +429,8 @@ async function resolveDefinitionAndValidateInput(contract, workflowName, args, s
404
429
  * defined in the contract, with explicit error handling using Result pattern.
405
430
  */
406
431
  var TypedClient = class TypedClient {
432
+ contract;
433
+ client;
407
434
  /**
408
435
  * Typed wrapper around Temporal's `client.schedule.create(...)` and
409
436
  * related lifecycle methods. Fires the underlying `startWorkflow` action
@@ -411,8 +438,10 @@ var TypedClient = class TypedClient {
411
438
  *
412
439
  * **Requires `@temporalio/client` 1.16+.** The Schedule API was added in
413
440
  * 1.16; on older versions this property is unset and any access throws.
414
- * The package's peer dep is pinned to `^1.16.0` so the standard install
415
- * paths surface a peer-dependency warning rather than a runtime crash.
441
+ * The package's peer dep allows the whole `^1` range to stay permissive
442
+ * about the installed Temporal version, so consumers on < 1.16 who never
443
+ * touch schedules keep working — the constructor below fails fast with a
444
+ * clear message for anyone who does reach for the Schedule API too early.
416
445
  *
417
446
  * @example
418
447
  * ```ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["TemporalWorkflowNotFoundError","TemporalWorkflowFailedError","TemporalWorkflowFailedError","TemporalWorkflowNotFoundError"],"sources":["../src/errors.ts","../src/internal.ts","../src/schedule.ts","../src/client.ts"],"sourcesContent":["import type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport { summarizeIssues } from \"@temporal-contract/contract\";\nimport type {\n ActivityFailure,\n ApplicationFailure,\n CancelledFailure,\n ChildWorkflowFailure,\n ServerFailure,\n TerminatedFailure,\n TimeoutFailure,\n} from \"@temporalio/common\";\n\n/**\n * Union of the actionable Temporal failure types that can surface as the\n * `cause` of a `WorkflowFailedError`. These all extend Temporal's internal\n * `TemporalFailure` base class — we list them by leaf type rather than by\n * the base class so consumer code can use a single `switch (true)` over\n * `instanceof` discriminants without an exhaustiveness escape hatch.\n *\n * Re-exported from the package entry point so consumers can import it\n * directly: `import type { TemporalFailure } from \"@temporal-contract/client\"`.\n */\nexport type TemporalFailure =\n | ApplicationFailure\n | CancelledFailure\n | TerminatedFailure\n | TimeoutFailure\n | ChildWorkflowFailure\n | ServerFailure\n | ActivityFailure;\n\n/**\n * Base class for all typed client errors with boxed pattern\n */\nabstract class TypedClientError extends Error {\n protected constructor(message: string) {\n super(message);\n this.name = this.constructor.name;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n\n/**\n * Generic runtime failure wrapper when no specific error type applies\n */\nexport class RuntimeClientError extends TypedClientError {\n constructor(\n public readonly operation: string,\n public override readonly cause?: unknown,\n ) {\n super(\n `Operation \"${operation}\" failed: ${\n cause instanceof Error ? cause.message : String(cause ?? \"unknown error\")\n }`,\n );\n }\n}\n\n/**\n * Thrown when a workflow is not found in the contract\n */\nexport class WorkflowNotFoundError extends TypedClientError {\n constructor(\n public readonly workflowName: string,\n public readonly availableWorkflows: string[],\n ) {\n super(\n `Workflow \"${workflowName}\" not found in contract. Available workflows: ${availableWorkflows.join(\", \")}`,\n );\n }\n}\n\n/**\n * Discriminated variant of {@link RuntimeClientError} surfaced when starting\n * a workflow collides with an existing execution — Temporal's\n * `WorkflowExecutionAlreadyStartedError`. The most common cause is a\n * workflowId reuse policy that rejects duplicates while a previous run is\n * still in retention.\n *\n * Distinguishing this from `RuntimeClientError` lets idempotent callers\n * branch on it explicitly (e.g. fetch the existing handle and continue)\n * without inspecting `error.cause` against a Temporal SDK class.\n */\nexport class WorkflowAlreadyStartedError extends TypedClientError {\n constructor(\n public readonly workflowType: string,\n public readonly workflowId: string,\n public override readonly cause?: unknown,\n ) {\n super(`Workflow \"${workflowType}\" with ID \"${workflowId}\" is already started or in retention.`);\n }\n}\n\n/**\n * Discriminated variant of {@link RuntimeClientError} surfaced when an\n * operation targets a workflow execution that doesn't exist in the\n * namespace — Temporal's `WorkflowNotFoundError` (distinct from this\n * package's contract-level {@link WorkflowNotFoundError}).\n *\n * Returned from:\n * - handle methods: `signal`, `query`, `executeUpdate`, `result`,\n * `terminate`, `cancel`, `describe`, `fetchHistory`\n * - `executeWorkflow` (when the underlying execute call hits a missing\n * execution mid-flight)\n */\nexport class WorkflowExecutionNotFoundError extends TypedClientError {\n constructor(\n public readonly workflowId: string,\n public readonly runId?: string,\n public override readonly cause?: unknown,\n ) {\n super(\n `Workflow execution \"${workflowId}\"${runId ? ` (run \"${runId}\")` : \"\"} not found in namespace.`,\n );\n }\n}\n\n/**\n * Discriminated variant of {@link RuntimeClientError} surfaced when waiting\n * on a workflow's result and the workflow completes with a failure —\n * Temporal's `WorkflowFailedError`.\n *\n * `cause` is the *unwrapped* underlying {@link TemporalFailure} (typically an\n * `ApplicationFailure`, `CancelledFailure`, `TerminatedFailure`, or\n * `TimeoutFailure`) lifted from Temporal's wrapper, so callers can branch\n * on the failure category in one step (`err.cause instanceof\n * ApplicationFailure`) instead of unwrapping twice via the SDK wrapper. The\n * SDK declares `WorkflowFailedError.cause` as the wider `Error | undefined`\n * (since `cause` lives on `Error`), but the runtime guarantee — driven by\n * Temporal's wire format — is that it is always a `TemporalFailure` subclass\n * when the wrapper is surfaced. `classifyResultError` narrows that wider\n * static type to the public {@link TemporalFailure} union with a cast, so\n * consumers see the precise leaf-failure typing instead of a bare `Error`.\n *\n * Returned from `executeWorkflow` and `handle.result()`.\n */\nexport class WorkflowFailedError extends TypedClientError {\n constructor(\n public readonly workflowId: string,\n public override readonly cause?: TemporalFailure,\n ) {\n const causeMessage =\n cause instanceof Error ? cause.message : String(cause ?? \"unknown failure\");\n super(`Workflow \"${workflowId}\" completed with failure: ${causeMessage}`);\n }\n}\n\n// Validation-message formatters live in `@temporal-contract/contract` so\n// client and worker share a single source of truth. The previous local\n// copies have been removed in favor of the shared `summarizeIssues` import\n// at the top of this module.\n\n/**\n * Thrown when workflow input or output validation fails\n */\nexport class WorkflowValidationError extends TypedClientError {\n constructor(\n public readonly workflowName: string,\n public readonly direction: \"input\" | \"output\",\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n super(\n `Validation failed for workflow \"${workflowName}\" ${direction}: ${summarizeIssues(issues)}`,\n );\n }\n}\n\n/**\n * Thrown when query input or output validation fails\n */\nexport class QueryValidationError extends TypedClientError {\n constructor(\n public readonly queryName: string,\n public readonly direction: \"input\" | \"output\",\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n super(`Validation failed for query \"${queryName}\" ${direction}: ${summarizeIssues(issues)}`);\n }\n}\n\n/**\n * Thrown when signal input validation fails\n */\nexport class SignalValidationError extends TypedClientError {\n constructor(\n public readonly signalName: string,\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n super(`Validation failed for signal \"${signalName}\": ${summarizeIssues(issues)}`);\n }\n}\n\n/**\n * Thrown when update input or output validation fails\n */\nexport class UpdateValidationError extends TypedClientError {\n constructor(\n public readonly updateName: string,\n public readonly direction: \"input\" | \"output\",\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n super(`Validation failed for update \"${updateName}\" ${direction}: ${summarizeIssues(issues)}`);\n }\n}\n","/**\n * Internal helpers shared across the client package's modules.\n *\n * Not part of the public API — this module is not listed in the package's\n * `exports` map, so consumers can't import from `@temporal-contract/client/internal`.\n * In-package modules and tests import it directly via relative path.\n */\nimport { WorkflowExecutionAlreadyStartedError } from \"@temporalio/client\";\nimport { WorkflowFailedError as TemporalWorkflowFailedError } from \"@temporalio/client\";\nimport {\n defineSearchAttributeKey,\n type SearchAttributePair,\n TypedSearchAttributes,\n WorkflowNotFoundError as TemporalWorkflowNotFoundError,\n} from \"@temporalio/common\";\nimport type { AnyWorkflowDefinition, SearchAttributeDefinition } from \"@temporal-contract/contract\";\nimport { _internal_makeResultAsync } from \"@temporal-contract/contract/result-async\";\nimport { ok, err, type ResultAsync, type Result } from \"neverthrow\";\nimport {\n RuntimeClientError,\n type TemporalFailure,\n WorkflowAlreadyStartedError,\n WorkflowExecutionNotFoundError,\n WorkflowFailedError,\n} from \"./errors.js\";\n\n/**\n * Translate the contract's typed `searchAttributes` map (declared\n * name → value) into a Temporal `TypedSearchAttributes` instance, so the\n * Temporal client honours indexing when starting the workflow.\n *\n * Workflows without a `searchAttributes` block (or callers passing no\n * values) resolve to `ok(undefined)`, matching the Temporal SDK's\n * \"absent ≠ empty\" semantics.\n *\n * Returns `err(RuntimeClientError)` on unknown keys. The TypeScript\n * surface already gates the happy path; the runtime check catches typed\n * escape hatches (`as never`, `as any`, raw-call interop) where a typo\n * would otherwise silently drop the attribute, leaving the workflow\n * unindexed without any signal to the caller.\n */\nexport function toTypedSearchAttributes(\n workflowDef: AnyWorkflowDefinition,\n workflowName: string,\n values: Record<string, unknown> | undefined,\n): Result<TypedSearchAttributes | undefined, RuntimeClientError> {\n if (!values) return ok(undefined);\n // Workflows that omit the `searchAttributes` block declare none. Treat\n // that as an empty declared map so a caller passing values still hits\n // the per-key \"undeclared\" check below — silently dropping them would\n // re-introduce the escape-hatch gap this helper was designed to close.\n const declared = (workflowDef.searchAttributes ?? {}) as Record<\n string,\n SearchAttributeDefinition\n >;\n const pairs: SearchAttributePair[] = [];\n for (const [name, value] of Object.entries(values)) {\n if (value === undefined) continue;\n const def = declared[name];\n if (!def) {\n return err(\n new RuntimeClientError(\n \"searchAttributes\",\n new Error(\n `Search attribute \"${name}\" is not declared on workflow \"${workflowName}\". ` +\n `Declared attributes: ${Object.keys(declared).join(\", \") || \"none\"}.`,\n ),\n ),\n );\n }\n const key = defineSearchAttributeKey(name, def.kind);\n pairs.push({ key, value } as SearchAttributePair);\n }\n return ok(pairs.length > 0 ? new TypedSearchAttributes(pairs) : undefined);\n}\n\n/**\n * Wrap an async result-producing function in a `ResultAsync`, catching any\n * unhandled rejection as a `RuntimeClientError(\"unexpected\", error)`.\n *\n * The work function is expected to handle its own domain errors and return\n * an `err(...)` for them; the catch here is a safety net for thrown\n * exceptions the work didn't anticipate.\n *\n * Used by `client.ts` (workflow operations) and `schedule.ts` (schedule\n * operations) so the unexpected-rejection shape is identical across the\n * typed client surface. Delegates to `_internal_makeResultAsync` from\n * `@temporal-contract/contract` so the same wrapper is shared between the\n * client and worker packages.\n */\nexport function makeResultAsync<T, E>(\n work: () => Promise<Result<T, E>>,\n): ResultAsync<T, E | RuntimeClientError> {\n return _internal_makeResultAsync<T, E | RuntimeClientError>(\n work,\n (e) => new RuntimeClientError(\"unexpected\", e),\n );\n}\n\n/**\n * Map a thrown error from `client.workflow.start` / `signalWithStart` into\n * the discriminated union surfaced by the typed client. Specifically\n * recognizes Temporal's `WorkflowExecutionAlreadyStartedError`; everything\n * else falls through to {@link RuntimeClientError}.\n */\nexport function classifyStartError(\n operation: string,\n error: unknown,\n): WorkflowAlreadyStartedError | RuntimeClientError {\n if (error instanceof WorkflowExecutionAlreadyStartedError) {\n return new WorkflowAlreadyStartedError(error.workflowType, error.workflowId, error);\n }\n return new RuntimeClientError(operation, error);\n}\n\n/**\n * Map a thrown error from a workflow handle method (signal, query,\n * executeUpdate, terminate, cancel, describe, fetchHistory) into the\n * discriminated union surfaced by the typed client. Recognizes Temporal's\n * `WorkflowNotFoundError`; everything else falls through to\n * {@link RuntimeClientError}.\n *\n * `fallbackWorkflowId` is used when Temporal's error carries an empty\n * `workflowId` (it normalizes missing IDs to the empty string), so the\n * surfaced error always identifies the targeted execution.\n */\nexport function classifyHandleError(\n operation: string,\n error: unknown,\n fallbackWorkflowId: string,\n): WorkflowExecutionNotFoundError | RuntimeClientError {\n if (error instanceof TemporalWorkflowNotFoundError) {\n return new WorkflowExecutionNotFoundError(\n error.workflowId || fallbackWorkflowId,\n error.runId,\n error,\n );\n }\n return new RuntimeClientError(operation, error);\n}\n\n/**\n * Map a thrown error from `handle.result()` / `client.workflow.execute()`\n * (the latter when waiting on the result phase). Recognizes Temporal's\n * `WorkflowFailedError` and `WorkflowNotFoundError`; everything else falls\n * through to {@link RuntimeClientError}.\n *\n * Temporal's `WorkflowFailedError` is itself a wrapper — the actionable\n * failure (ApplicationFailure, CancelledFailure, TerminatedFailure, etc.)\n * lives on its `cause` field. We forward that inner cause directly so\n * consumers can match `err.cause` against the underlying failure class\n * without an extra unwrap step. (If Temporal's cause is `undefined`, our\n * `cause` is too — same shape as before.)\n */\nexport function classifyResultError(\n operation: string,\n error: unknown,\n workflowId: string,\n): WorkflowFailedError | WorkflowExecutionNotFoundError | RuntimeClientError {\n if (error instanceof TemporalWorkflowFailedError) {\n // Temporal types `cause` as `Error | undefined`, but the SDK only ever\n // populates it with a `TemporalFailure` subclass when surfacing a\n // workflow result failure. Narrow with the public union so consumers\n // can branch on the leaf failure types without an extra cast.\n return new WorkflowFailedError(workflowId, error.cause as TemporalFailure | undefined);\n }\n if (error instanceof TemporalWorkflowNotFoundError) {\n return new WorkflowExecutionNotFoundError(error.workflowId || workflowId, error.runId, error);\n }\n return new RuntimeClientError(operation, error);\n}\n","import type {\n ScheduleClient,\n ScheduleDescription,\n ScheduleHandle,\n ScheduleOptions,\n ScheduleOptionsStartWorkflowAction,\n ScheduleOverlapPolicy,\n ScheduleSpec,\n} from \"@temporalio/client\";\nimport type { ContractDefinition } from \"@temporal-contract/contract\";\nimport { ResultAsync, type Result, ok, err } from \"neverthrow\";\nimport type { TypedSearchAttributeMap } from \"./client.js\";\nimport type { ClientInferInput } from \"./types.js\";\nimport { RuntimeClientError, WorkflowNotFoundError, WorkflowValidationError } from \"./errors.js\";\nimport { makeResultAsync, toTypedSearchAttributes } from \"./internal.js\";\n\n/**\n * Workflow-action–level overrides forwarded to Temporal's\n * `ScheduleOptionsStartWorkflowAction`. These live under a nested `action`\n * field so the workflow-level `memo` (per-action workflow metadata) can be\n * set independently from the schedule-level `memo` (metadata on the\n * schedule itself) — Temporal honours both, and they have separate\n * lifecycles.\n *\n * `workflowType` and `taskQueue` are owned by the contract and not exposed.\n */\nexport type TypedScheduleActionOverrides = Pick<\n ScheduleOptionsStartWorkflowAction<never>,\n | \"workflowId\"\n | \"workflowExecutionTimeout\"\n | \"workflowRunTimeout\"\n | \"workflowTaskTimeout\"\n | \"retry\"\n | \"memo\"\n | \"staticDetails\"\n | \"staticSummary\"\n>;\n\n/**\n * Options for {@link TypedScheduleClient.create}.\n *\n * `scheduleId` and `spec` come from Temporal's `ScheduleOptions`. `args` is\n * typed against the destination workflow's input schema. `policies`,\n * `state`, and `memo` mirror Temporal's own schedule-level options.\n * Workflow-action–level overrides nest under {@link action} so memo and\n * other fields with the same name don't collide between the two scopes.\n */\nexport type TypedScheduleCreateOptions<\n TContract extends ContractDefinition,\n TWorkflowName extends keyof TContract[\"workflows\"] & string,\n> = {\n /** Schedule ID. Recommended to use a meaningful business identifier. */\n scheduleId: string;\n /** When the schedule should fire (cron, interval, calendar). */\n spec: ScheduleSpec;\n /** Workflow input — validated against the contract's input schema. */\n args: ClientInferInput<TContract[\"workflows\"][TWorkflowName]>;\n /**\n * Indexed search attributes for each workflow run spawned by this\n * schedule. Keys and value types are constrained to those declared on\n * the destination workflow's contract via `defineSearchAttribute`.\n * Translated to Temporal's `typedSearchAttributes` and attached to the\n * schedule's `startWorkflow` action so each spawned run is indexed\n * identically to one started directly via `client.startWorkflow`.\n */\n searchAttributes?: TypedSearchAttributeMap<TContract[\"workflows\"][TWorkflowName]>;\n /** Temporal schedule policies (overlap, catchupWindow, pauseOnFailure, etc.). */\n policies?: ScheduleOptions[\"policies\"];\n /** Temporal schedule state (paused, note, limited, etc.). */\n state?: ScheduleOptions[\"state\"];\n /** Schedule-level memo (non-indexed metadata on the schedule itself). */\n memo?: ScheduleOptions[\"memo\"];\n /**\n * Workflow-action–level overrides. `workflowType` and `taskQueue` are\n * derived from the contract, so they don't appear here. Note that\n * `action.memo` is a *workflow-level* memo applied to each spawned run,\n * distinct from the top-level `memo` (which is metadata on the schedule\n * itself).\n */\n action?: TypedScheduleActionOverrides;\n};\n\n/**\n * Typed handle to a schedule. Mirrors Temporal's `ScheduleHandle` lifecycle\n * methods (`pause`, `unpause`, `trigger`, `describe`, `delete`) wrapped in\n * the neverthrow ResultAsync pattern so call sites match the rest of the\n * typed client.\n */\nexport type TypedScheduleHandle = {\n /** This schedule's identifier. */\n readonly scheduleId: string;\n /** Pause the schedule. Optional note becomes part of the audit trail. */\n pause: (note?: string) => ResultAsync<void, RuntimeClientError>;\n /** Resume a paused schedule. */\n unpause: (note?: string) => ResultAsync<void, RuntimeClientError>;\n /** Fire the schedule's action immediately. */\n trigger: (overlap?: ScheduleOverlapPolicy) => ResultAsync<void, RuntimeClientError>;\n /** Delete the schedule. */\n delete: () => ResultAsync<void, RuntimeClientError>;\n /** Fetch the schedule's current description from the server. */\n describe: () => ResultAsync<ScheduleDescription, RuntimeClientError>;\n};\n\n/**\n * Typed wrapper around Temporal's `ScheduleClient`. Exposed as\n * `typedClient.schedule` — keeps the typed-client surface organized the\n * same way Temporal's own `Client.schedule` does.\n */\nexport class TypedScheduleClient<TContract extends ContractDefinition> {\n constructor(\n private readonly contract: TContract,\n private readonly scheduleClient: ScheduleClient,\n ) {}\n\n /**\n * Create a new schedule that, on each fire, starts the named contract\n * workflow with validated args.\n *\n * Validates `args` against the workflow's input schema before dispatching\n * the create request to Temporal. The workflow's `taskQueue` and\n * `workflowType` are pulled from the contract automatically; the typed\n * options shape omits them so call sites don't have to repeat themselves.\n */\n create<TWorkflowName extends keyof TContract[\"workflows\"] & string>(\n workflowName: TWorkflowName,\n options: TypedScheduleCreateOptions<TContract, TWorkflowName>,\n ): ResultAsync<\n TypedScheduleHandle,\n WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError\n > {\n type Ok = TypedScheduleHandle;\n type Err = WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError;\n const work = async (): Promise<Result<Ok, Err>> => {\n const definition = this.contract.workflows[workflowName];\n if (!definition) {\n return err(new WorkflowNotFoundError(workflowName, Object.keys(this.contract.workflows)));\n }\n\n const inputResult = await definition.input[\"~standard\"].validate(options.args);\n if (inputResult.issues) {\n return err(new WorkflowValidationError(workflowName, \"input\", inputResult.issues));\n }\n\n // Translate typed search attributes for the spawned workflow runs.\n // Lives on the schedule's `startWorkflow` action (workflow-level\n // indexing), not on the schedule itself. Mirrors what\n // `client.startWorkflow` does for direct starts so schedule-spawned\n // runs share visibility with their direct-start counterparts.\n const searchAttributesResult = toTypedSearchAttributes(\n definition,\n workflowName,\n options.searchAttributes as Record<string, unknown> | undefined,\n );\n if (searchAttributesResult.isErr()) return err(searchAttributesResult.error);\n const typedSearchAttributes = searchAttributesResult.value;\n\n try {\n const overrides = options.action ?? {};\n const action: ScheduleOptionsStartWorkflowAction<never> = {\n type: \"startWorkflow\",\n workflowType: workflowName,\n taskQueue: this.contract.taskQueue,\n args: [inputResult.value] as never,\n ...(typedSearchAttributes ? { typedSearchAttributes } : {}),\n ...(overrides.workflowId !== undefined ? { workflowId: overrides.workflowId } : {}),\n ...(overrides.workflowExecutionTimeout !== undefined\n ? { workflowExecutionTimeout: overrides.workflowExecutionTimeout }\n : {}),\n ...(overrides.workflowRunTimeout !== undefined\n ? { workflowRunTimeout: overrides.workflowRunTimeout }\n : {}),\n ...(overrides.workflowTaskTimeout !== undefined\n ? { workflowTaskTimeout: overrides.workflowTaskTimeout }\n : {}),\n ...(overrides.retry !== undefined ? { retry: overrides.retry } : {}),\n ...(overrides.memo !== undefined ? { memo: overrides.memo } : {}),\n ...(overrides.staticDetails !== undefined\n ? { staticDetails: overrides.staticDetails }\n : {}),\n ...(overrides.staticSummary !== undefined\n ? { staticSummary: overrides.staticSummary }\n : {}),\n };\n\n const handle = await this.scheduleClient.create({\n scheduleId: options.scheduleId,\n spec: options.spec,\n action,\n ...(options.policies !== undefined ? { policies: options.policies } : {}),\n ...(options.state !== undefined ? { state: options.state } : {}),\n ...(options.memo !== undefined ? { memo: options.memo } : {}),\n });\n return ok(wrapScheduleHandle(handle));\n } catch (error) {\n return err(new RuntimeClientError(\"schedule.create\", error));\n }\n };\n return makeResultAsync(work);\n }\n\n /**\n * Get a typed handle to an existing schedule. Does not validate that the\n * schedule exists — handle methods (`describe`, `pause`, etc.) will\n * surface a `RuntimeClientError` if the underlying ID is unknown.\n */\n getHandle(scheduleId: string): TypedScheduleHandle {\n return wrapScheduleHandle(this.scheduleClient.getHandle(scheduleId));\n }\n}\n\nfunction wrapScheduleHandle(handle: ScheduleHandle): TypedScheduleHandle {\n return {\n scheduleId: handle.scheduleId,\n pause: (note) =>\n ResultAsync.fromPromise(\n handle.pause(note),\n (error) => new RuntimeClientError(\"schedule.pause\", error),\n ).map(() => undefined),\n unpause: (note) =>\n ResultAsync.fromPromise(\n handle.unpause(note),\n (error) => new RuntimeClientError(\"schedule.unpause\", error),\n ).map(() => undefined),\n trigger: (overlap) =>\n ResultAsync.fromPromise(\n handle.trigger(overlap),\n (error) => new RuntimeClientError(\"schedule.trigger\", error),\n ).map(() => undefined),\n delete: () =>\n ResultAsync.fromPromise(\n handle.delete(),\n (error) => new RuntimeClientError(\"schedule.delete\", error),\n ).map(() => undefined),\n describe: () =>\n ResultAsync.fromPromise(\n handle.describe(),\n (error) => new RuntimeClientError(\"schedule.describe\", error),\n ),\n };\n}\n","import { Client, WorkflowHandle } from \"@temporalio/client\";\nimport type { WorkflowSignalWithStartOptions, WorkflowStartOptions } from \"@temporalio/client\";\nimport { defineSearchAttributeKey, TypedSearchAttributes } from \"@temporalio/common\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport type {\n AnyWorkflowDefinition,\n ContractDefinition,\n SearchAttributeDefinition,\n SearchAttributeKindToType,\n SignalDefinition,\n SignalNamesOf,\n} from \"@temporal-contract/contract\";\nimport type {\n ClientInferInput,\n ClientInferOutput,\n ClientInferWorkflowQueries,\n ClientInferWorkflowSignals,\n ClientInferWorkflowUpdates,\n} from \"./types.js\";\nimport { ResultAsync, type Result, ok, err } from \"neverthrow\";\nimport {\n type TemporalFailure,\n WorkflowAlreadyStartedError,\n WorkflowExecutionNotFoundError,\n WorkflowFailedError,\n WorkflowNotFoundError,\n WorkflowValidationError,\n QueryValidationError,\n SignalValidationError,\n UpdateValidationError,\n RuntimeClientError,\n} from \"./errors.js\";\nimport { TypedScheduleClient } from \"./schedule.js\";\nimport {\n classifyHandleError,\n classifyResultError,\n classifyStartError,\n makeResultAsync,\n toTypedSearchAttributes,\n} from \"./internal.js\";\nimport { WorkflowExecutionAlreadyStartedError } from \"@temporalio/client\";\nimport { WorkflowFailedError as TemporalWorkflowFailedError } from \"@temporalio/client\";\nimport { WorkflowNotFoundError as TemporalWorkflowNotFoundError } from \"@temporalio/common\";\n\n/**\n * Typed `searchAttributes` map for a workflow, derived from the workflow's\n * declared `searchAttributes`. Each key is constrained to a declared\n * attribute name; each value's type is determined by the attribute's `kind`\n * (e.g. `KEYWORD` → `string`, `INT` → `number`, `DATETIME` → `Date`,\n * `KEYWORD_LIST` → `string[]`).\n *\n * If the workflow declares no search attributes, this resolves to `never`,\n * meaning the `searchAttributes` field is effectively absent from the start\n * options for that workflow.\n */\nexport type TypedSearchAttributeMap<TWorkflow extends AnyWorkflowDefinition> =\n TWorkflow[\"searchAttributes\"] extends Record<string, SearchAttributeDefinition>\n ? {\n [K in keyof TWorkflow[\"searchAttributes\"]]?: SearchAttributeKindToType<\n TWorkflow[\"searchAttributes\"][K][\"kind\"]\n >;\n }\n : never;\n\n/**\n * Read declared search attributes off a `TypedSearchAttributes` instance —\n * the read-side counterpart to the write-side `searchAttributes` option on\n * `startWorkflow` / `signalWithStart` / `executeWorkflow` /\n * `schedule.create`.\n *\n * Use it on the result of `handle.describe()` (or a schedule's describe) to\n * recover the typed shape of indexed attributes. The Temporal SDK only\n * exposes a `.get(key)` accessor on `TypedSearchAttributes` and requires\n * the caller to reconstruct each `SearchAttributeKey` from the contract's\n * declared `kind` — this helper does that lookup once for every declared\n * attribute, returning a `Partial<TypedSearchAttributeMap<TWorkflow>>`\n * (each declared key may or may not have been set on the workflow).\n *\n * Workflows without declared `searchAttributes` get an empty object back.\n *\n * @example\n * ```ts\n * const description = await handle.describe();\n * if (description.isOk()) {\n * const attrs = readTypedSearchAttributes(\n * myContract.workflows.processOrder,\n * description.value.typedSearchAttributes,\n * );\n * // attrs.customerId: string | undefined\n * // attrs.priority: number | undefined\n * }\n * ```\n */\nexport function readTypedSearchAttributes<TWorkflow extends AnyWorkflowDefinition>(\n workflowDef: TWorkflow,\n instance: TypedSearchAttributes,\n): Partial<TypedSearchAttributeMap<TWorkflow>> {\n const declared = workflowDef.searchAttributes as\n | Record<string, SearchAttributeDefinition>\n | undefined;\n if (!declared) return {} as Partial<TypedSearchAttributeMap<TWorkflow>>;\n\n const result: Record<string, unknown> = {};\n for (const [name, def] of Object.entries(declared)) {\n const key = defineSearchAttributeKey(name, def.kind);\n const value = instance.get(key);\n if (value !== undefined) {\n result[name] = value;\n }\n }\n return result as Partial<TypedSearchAttributeMap<TWorkflow>>;\n}\n\nexport type TypedWorkflowStartOptions<\n TContract extends ContractDefinition,\n TWorkflowName extends keyof TContract[\"workflows\"] & string,\n> = Omit<\n WorkflowStartOptions,\n \"taskQueue\" | \"args\" | \"searchAttributes\" | \"typedSearchAttributes\"\n> & {\n args: ClientInferInput<TContract[\"workflows\"][TWorkflowName]>;\n /**\n * Indexed search attributes for the started workflow. Keys and value types\n * are constrained to those declared on the workflow's contract via\n * `defineSearchAttribute`. Translated to Temporal's `typedSearchAttributes`\n * before the start request is dispatched.\n */\n searchAttributes?: TypedSearchAttributeMap<TContract[\"workflows\"][TWorkflowName]>;\n};\n\n/**\n * Options for {@link TypedClient.signalWithStart} — typed against both the\n * workflow's input schema and the named signal's input schema.\n */\nexport type TypedSignalWithStartOptions<\n TContract extends ContractDefinition,\n TWorkflowName extends keyof TContract[\"workflows\"] & string,\n TSignalName extends SignalNamesOf<TContract[\"workflows\"][TWorkflowName]>,\n> = Omit<\n WorkflowSignalWithStartOptions,\n \"taskQueue\" | \"args\" | \"signal\" | \"signalArgs\" | \"searchAttributes\" | \"typedSearchAttributes\"\n> & {\n args: ClientInferInput<TContract[\"workflows\"][TWorkflowName]>;\n signalName: TSignalName;\n signalArgs: TContract[\"workflows\"][TWorkflowName][\"signals\"][TSignalName] extends SignalDefinition\n ? ClientInferInput<TContract[\"workflows\"][TWorkflowName][\"signals\"][TSignalName]>\n : never;\n /**\n * Indexed search attributes for the started workflow. Keys and value types\n * are constrained to those declared on the workflow's contract via\n * `defineSearchAttribute`. Translated to Temporal's `typedSearchAttributes`\n * before the signalWithStart request is dispatched.\n */\n searchAttributes?: TypedSearchAttributeMap<TContract[\"workflows\"][TWorkflowName]>;\n};\n\n/**\n * Typed workflow handle returned by `signalWithStart`. Adds `signaledRunId`\n * to the standard handle so callers can correlate the signal with the\n * (possibly pre-existing) workflow execution chain.\n */\nexport type TypedWorkflowHandleWithSignaledRunId<TWorkflow extends AnyWorkflowDefinition> =\n TypedWorkflowHandle<TWorkflow> & {\n /**\n * The Run Id of the bound Workflow at the time of `signalWithStart`. Since\n * `signalWithStart` may have signaled an existing Workflow Chain, this is\n * not necessarily the `firstExecutionRunId`.\n */\n readonly signaledRunId: string;\n };\n\n/**\n * Typed workflow handle with validated results using neverthrow Result/ResultAsync\n */\nexport type TypedWorkflowHandle<TWorkflow extends AnyWorkflowDefinition> = {\n workflowId: string;\n\n /**\n * Type-safe queries based on workflow definition with Result pattern\n * Each query returns ResultAsync<T, Error> instead of Promise<T>\n */\n queries: {\n [K in keyof ClientInferWorkflowQueries<TWorkflow>]: ClientInferWorkflowQueries<TWorkflow>[K] extends (\n ...args: infer Args\n ) => ResultAsync<infer R, Error>\n ? (\n ...args: Args\n ) => ResultAsync<\n R,\n QueryValidationError | WorkflowExecutionNotFoundError | RuntimeClientError\n >\n : never;\n };\n\n /**\n * Type-safe signals based on workflow definition with Result pattern\n * Each signal returns ResultAsync<void, Error> instead of Promise<void>\n */\n signals: {\n [K in keyof ClientInferWorkflowSignals<TWorkflow>]: ClientInferWorkflowSignals<TWorkflow>[K] extends (\n ...args: infer Args\n ) => ResultAsync<void, Error>\n ? (\n ...args: Args\n ) => ResultAsync<\n void,\n SignalValidationError | WorkflowExecutionNotFoundError | RuntimeClientError\n >\n : never;\n };\n\n /**\n * Type-safe updates based on workflow definition with Result pattern\n * Each update returns ResultAsync<T, Error> instead of Promise<T>\n */\n updates: {\n [K in keyof ClientInferWorkflowUpdates<TWorkflow>]: ClientInferWorkflowUpdates<TWorkflow>[K] extends (\n ...args: infer Args\n ) => ResultAsync<infer R, Error>\n ? (\n ...args: Args\n ) => ResultAsync<\n R,\n UpdateValidationError | WorkflowExecutionNotFoundError | RuntimeClientError\n >\n : never;\n };\n\n /**\n * Get workflow result with Result pattern\n */\n result: () => ResultAsync<\n ClientInferOutput<TWorkflow>,\n | WorkflowValidationError\n | WorkflowFailedError\n | WorkflowExecutionNotFoundError\n | RuntimeClientError\n >;\n\n /**\n * Terminate workflow with Result pattern\n */\n terminate: (\n reason?: string,\n ) => ResultAsync<void, WorkflowExecutionNotFoundError | RuntimeClientError>;\n\n /**\n * Cancel workflow with Result pattern\n */\n cancel: () => ResultAsync<void, WorkflowExecutionNotFoundError | RuntimeClientError>;\n\n /**\n * Get workflow execution description including status and metadata\n */\n describe: () => ResultAsync<\n Awaited<ReturnType<WorkflowHandle[\"describe\"]>>,\n WorkflowExecutionNotFoundError | RuntimeClientError\n >;\n\n /**\n * Fetch the workflow execution history\n */\n fetchHistory: () => ResultAsync<\n Awaited<ReturnType<WorkflowHandle[\"fetchHistory\"]>>,\n WorkflowExecutionNotFoundError | RuntimeClientError\n >;\n};\n\n/**\n * Result of {@link resolveDefinitionAndValidateInput} — the contract-side\n * pre-call ritual the start/signal-with-start/execute methods share. Holds\n * the resolved workflow definition, the schema-validated input, and the\n * translated typed search attributes (or `undefined` when the workflow\n * declared none / the caller passed none).\n */\ntype ResolvedWorkflow<TWorkflow extends AnyWorkflowDefinition> = {\n definition: TWorkflow;\n validatedInput: unknown;\n typedSearchAttributes: TypedSearchAttributes | undefined;\n};\n\n/**\n * Shared pre-call ritual for the three contract-driven entry points that\n * actually start a workflow (`startWorkflow`, `signalWithStart`,\n * `executeWorkflow`):\n *\n * 1. Look up the workflow definition on the contract.\n * 2. Surface a `WorkflowNotFoundError` if absent.\n * 3. Validate `args` against the workflow's input schema.\n * 4. Surface a `WorkflowValidationError` if validation fails.\n * 5. Translate any caller-supplied `searchAttributes` into Temporal's\n * `TypedSearchAttributes` shape (or `undefined`).\n *\n * `getHandle` deliberately keeps its own three-line lookup — it doesn't\n * accept `args` or `searchAttributes`, so it can't share this helper. The\n * call-specific extras (signal validation, post-call output validation,\n * extended error classification) stay at the call site — those are the\n * differentiators that make each method distinct.\n */\nasync function resolveDefinitionAndValidateInput<\n TContract extends ContractDefinition,\n TWorkflowName extends keyof TContract[\"workflows\"] & string,\n>(\n contract: TContract,\n workflowName: TWorkflowName,\n args: unknown,\n searchAttributes: Record<string, unknown> | undefined,\n): Promise<\n Result<\n ResolvedWorkflow<TContract[\"workflows\"][TWorkflowName]>,\n WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError\n >\n> {\n const definition = contract.workflows[workflowName];\n if (!definition) {\n return err(createWorkflowNotFoundError(workflowName, contract));\n }\n\n const inputResult = await definition.input[\"~standard\"].validate(args);\n if (inputResult.issues) {\n return err(createWorkflowValidationError(workflowName, \"input\", inputResult.issues));\n }\n\n const searchAttributesResult = toTypedSearchAttributes(\n definition,\n workflowName,\n searchAttributes,\n );\n if (searchAttributesResult.isErr()) return err(searchAttributesResult.error);\n const typedSearchAttributes = searchAttributesResult.value;\n\n return ok({\n definition: definition as TContract[\"workflows\"][TWorkflowName],\n validatedInput: inputResult.value,\n typedSearchAttributes,\n });\n}\n\n/**\n * Typed Temporal client with neverthrow Result/ResultAsync pattern based on a contract\n *\n * Provides type-safe methods to start and execute workflows\n * defined in the contract, with explicit error handling using Result pattern.\n */\nexport class TypedClient<TContract extends ContractDefinition> {\n /**\n * Typed wrapper around Temporal's `client.schedule.create(...)` and\n * related lifecycle methods. Fires the underlying `startWorkflow` action\n * with args validated against the contract's input schema.\n *\n * **Requires `@temporalio/client` 1.16+.** The Schedule API was added in\n * 1.16; on older versions this property is unset and any access throws.\n * The package's peer dep is pinned to `^1.16.0` so the standard install\n * paths surface a peer-dependency warning rather than a runtime crash.\n *\n * @example\n * ```ts\n * const result = await client.schedule.create(\"processOrder\", {\n * scheduleId: \"daily-sweep\",\n * spec: { cronExpressions: [\"0 2 * * *\"] },\n * args: { orderId: \"sweep\" },\n * });\n *\n * result.match(\n * async (handle) => { await handle.pause(\"maintenance\"); },\n * (error) => console.error(\"schedule create failed\", error),\n * );\n * ```\n */\n readonly schedule: TypedScheduleClient<TContract>;\n\n private constructor(\n private readonly contract: TContract,\n private readonly client: Client,\n ) {\n // `client.schedule` is the ScheduleClient wired into Temporal's\n // top-level `Client` since 1.16. Fail early with a clear message if a\n // consumer is on an older version (peer dep is pinned to ^1.16, but\n // installs that ignore peer-dep warnings shouldn't crash with a\n // confusing `Cannot read properties of undefined`).\n if (!client.schedule) {\n throw new Error(\n \"TypedClient requires @temporalio/client >= 1.16 (the Schedule API was added in 1.16). \" +\n \"Found a Client instance without a `schedule` property — please upgrade.\",\n );\n }\n this.schedule = new TypedScheduleClient(contract, client.schedule);\n }\n\n /**\n * Create a typed Temporal client with neverthrow pattern from a contract\n *\n * @example\n * ```ts\n * const connection = await Connection.connect();\n * const temporalClient = new Client({ connection });\n * const client = TypedClient.create(myContract, temporalClient);\n *\n * const result = await client.executeWorkflow('processOrder', {\n * workflowId: 'order-123',\n * args: { ... },\n * });\n *\n * result.match(\n * (output) => console.log('Success:', output),\n * (error) => console.error('Failed:', error),\n * );\n * ```\n */\n static create<TContract extends ContractDefinition>(\n contract: TContract,\n client: Client,\n ): TypedClient<TContract> {\n return new TypedClient(contract, client);\n }\n\n /**\n * Start a workflow and return a typed handle with ResultAsync pattern\n *\n * @example\n * ```ts\n * const handleResult = await client.startWorkflow('processOrder', {\n * workflowId: 'order-123',\n * args: { orderId: 'ORD-123' },\n * workflowExecutionTimeout: '1 day',\n * retry: { maximumAttempts: 3 },\n * });\n *\n * handleResult.match(\n * async (handle) => {\n * const result = await handle.result();\n * // ... handle result\n * },\n * (error) => console.error('Failed to start:', error),\n * );\n * ```\n */\n startWorkflow<TWorkflowName extends keyof TContract[\"workflows\"] & string>(\n workflowName: TWorkflowName,\n {\n args,\n searchAttributes,\n ...temporalOptions\n }: TypedWorkflowStartOptions<TContract, TWorkflowName>,\n ): ResultAsync<\n TypedWorkflowHandle<TContract[\"workflows\"][TWorkflowName]>,\n | WorkflowNotFoundError\n | WorkflowValidationError\n | WorkflowAlreadyStartedError\n | RuntimeClientError\n > {\n type Ok = TypedWorkflowHandle<TContract[\"workflows\"][TWorkflowName]>;\n type Err =\n | WorkflowNotFoundError\n | WorkflowValidationError\n | WorkflowAlreadyStartedError\n | RuntimeClientError;\n const work = async (): Promise<Result<Ok, Err>> => {\n const resolved = await resolveDefinitionAndValidateInput(\n this.contract,\n workflowName,\n args,\n searchAttributes as Record<string, unknown> | undefined,\n );\n if (resolved.isErr()) return err(resolved.error);\n const { definition, validatedInput, typedSearchAttributes } = resolved.value;\n\n try {\n const handle = await this.client.workflow.start(workflowName, {\n ...temporalOptions,\n taskQueue: this.contract.taskQueue,\n args: [validatedInput],\n ...(typedSearchAttributes ? { typedSearchAttributes } : {}),\n });\n return ok(this.createTypedHandle(handle, definition) as Ok);\n } catch (error) {\n return err(classifyStartError(\"startWorkflow\", error));\n }\n };\n return makeResultAsync(work);\n }\n\n /**\n * Send a signal to a workflow, starting it first if it doesn't already exist.\n *\n * Validates both halves of the call against the contract:\n * - `args` against the workflow's input schema\n * - `signalArgs` against the named signal's input schema\n *\n * Returns a `TypedWorkflowHandleWithSignaledRunId` — the same shape as\n * `startWorkflow`'s handle, plus a `signaledRunId` field for correlating\n * the signal with the (possibly pre-existing) workflow execution chain.\n *\n * @example\n * ```ts\n * const result = await client.signalWithStart('processOrder', {\n * workflowId: 'order-123',\n * args: { orderId: 'ORD-123', customerId: 'CUST-1' },\n * signalName: 'cancel',\n * signalArgs: { reason: 'duplicate' },\n * });\n *\n * result.match(\n * (handle) => console.log('signaled run', handle.signaledRunId),\n * (error) => console.error('signalWithStart failed', error),\n * );\n * ```\n */\n signalWithStart<\n TWorkflowName extends keyof TContract[\"workflows\"] & string,\n TSignalName extends SignalNamesOf<TContract[\"workflows\"][TWorkflowName]>,\n >(\n workflowName: TWorkflowName,\n {\n args,\n signalName,\n signalArgs,\n searchAttributes,\n ...temporalOptions\n }: TypedSignalWithStartOptions<TContract, TWorkflowName, TSignalName>,\n ): ResultAsync<\n TypedWorkflowHandleWithSignaledRunId<TContract[\"workflows\"][TWorkflowName]>,\n | WorkflowNotFoundError\n | WorkflowValidationError\n | SignalValidationError\n | WorkflowAlreadyStartedError\n | RuntimeClientError\n > {\n type Ok = TypedWorkflowHandleWithSignaledRunId<TContract[\"workflows\"][TWorkflowName]>;\n type Err =\n | WorkflowNotFoundError\n | WorkflowValidationError\n | SignalValidationError\n | WorkflowAlreadyStartedError\n | RuntimeClientError;\n\n const work = async (): Promise<Result<Ok, Err>> => {\n const resolved = await resolveDefinitionAndValidateInput(\n this.contract,\n workflowName,\n args,\n searchAttributes as Record<string, unknown> | undefined,\n );\n if (resolved.isErr()) return err(resolved.error);\n const { definition, validatedInput, typedSearchAttributes } = resolved.value;\n\n // Validate signal input — call-site-specific, kept inline.\n const signalDef = (definition.signals as Record<string, SignalDefinition> | undefined)?.[\n signalName\n ];\n if (!signalDef) {\n // Type-level constraint should already prevent this; defensive for\n // raw-call / union-typed-name corner cases.\n return err(\n new SignalValidationError(signalName, [\n {\n message: `Signal \"${signalName}\" is not declared on workflow \"${workflowName}\".`,\n },\n ]),\n );\n }\n const signalInputResult = await signalDef.input[\"~standard\"].validate(signalArgs);\n if (signalInputResult.issues) {\n return err(new SignalValidationError(signalName, signalInputResult.issues));\n }\n\n try {\n const handle = await this.client.workflow.signalWithStart(workflowName, {\n ...temporalOptions,\n taskQueue: this.contract.taskQueue,\n args: [validatedInput],\n signal: signalName,\n signalArgs: [signalInputResult.value],\n ...(typedSearchAttributes ? { typedSearchAttributes } : {}),\n });\n const typed = this.createTypedHandle(handle, definition) as TypedWorkflowHandle<\n TContract[\"workflows\"][TWorkflowName]\n >;\n return ok({ ...typed, signaledRunId: handle.signaledRunId } as Ok);\n } catch (error) {\n return err(classifyStartError(\"signalWithStart\", error));\n }\n };\n return makeResultAsync(work);\n }\n\n /**\n * Execute a workflow (start and wait for result) with ResultAsync pattern\n *\n * @example\n * ```ts\n * const result = await client.executeWorkflow('processOrder', {\n * workflowId: 'order-123',\n * args: { orderId: 'ORD-123' },\n * workflowExecutionTimeout: '1 day',\n * retry: { maximumAttempts: 3 },\n * });\n *\n * result.match(\n * (output) => console.log('Order processed:', output.status),\n * (error) => console.error('Processing failed:', error),\n * );\n * ```\n */\n executeWorkflow<TWorkflowName extends keyof TContract[\"workflows\"] & string>(\n workflowName: TWorkflowName,\n {\n args,\n searchAttributes,\n ...temporalOptions\n }: TypedWorkflowStartOptions<TContract, TWorkflowName>,\n ): ResultAsync<\n ClientInferOutput<TContract[\"workflows\"][TWorkflowName]>,\n | WorkflowNotFoundError\n | WorkflowValidationError\n | WorkflowAlreadyStartedError\n | WorkflowFailedError\n | WorkflowExecutionNotFoundError\n | RuntimeClientError\n > {\n type Ok = ClientInferOutput<TContract[\"workflows\"][TWorkflowName]>;\n type Err =\n | WorkflowNotFoundError\n | WorkflowValidationError\n | WorkflowAlreadyStartedError\n | WorkflowFailedError\n | WorkflowExecutionNotFoundError\n | RuntimeClientError;\n const work = async (): Promise<Result<Ok, Err>> => {\n const resolved = await resolveDefinitionAndValidateInput(\n this.contract,\n workflowName,\n args,\n searchAttributes as Record<string, unknown> | undefined,\n );\n if (resolved.isErr()) return err(resolved.error);\n const { definition, validatedInput, typedSearchAttributes } = resolved.value;\n\n try {\n const result = await this.client.workflow.execute(workflowName, {\n ...temporalOptions,\n taskQueue: this.contract.taskQueue,\n args: [validatedInput],\n ...(typedSearchAttributes ? { typedSearchAttributes } : {}),\n });\n\n // Output validation runs *after* the Temporal call returns — kept\n // inline because it's specific to executeWorkflow's start-and-wait\n // shape; the helper only handles pre-call concerns.\n const outputResult = await definition.output[\"~standard\"].validate(result);\n if (outputResult.issues) {\n return err(createWorkflowValidationError(workflowName, \"output\", outputResult.issues));\n }\n\n return ok(outputResult.value as Ok);\n } catch (error) {\n // executeWorkflow combines start + result, so it can surface any of\n // the discriminated kinds. Inline the three checks rather than\n // routing through a dedicated helper — this is the only call site\n // that needs the full union.\n if (error instanceof WorkflowExecutionAlreadyStartedError) {\n return err(new WorkflowAlreadyStartedError(error.workflowType, error.workflowId, error));\n }\n if (error instanceof TemporalWorkflowFailedError) {\n // Forward Temporal's nested cause directly — see\n // {@link classifyResultError} for the same rationale: Temporal's\n // `WorkflowFailedError` is a wrapper, and the actionable failure\n // (ApplicationFailure, CancelledFailure, etc.) lives on `.cause`.\n // Temporal types `cause` as `Error | undefined`, but the SDK only\n // ever populates it with a `TemporalFailure` subclass here; narrow\n // with the public union so the typed `cause` lines up with the\n // surfaced `WorkflowFailedError`.\n return err(\n new WorkflowFailedError(\n temporalOptions.workflowId,\n error.cause as TemporalFailure | undefined,\n ),\n );\n }\n if (error instanceof TemporalWorkflowNotFoundError) {\n return err(\n new WorkflowExecutionNotFoundError(\n error.workflowId || temporalOptions.workflowId,\n error.runId,\n error,\n ),\n );\n }\n return err(createRuntimeClientError(\"executeWorkflow\", error));\n }\n };\n return makeResultAsync(work);\n }\n\n /**\n * Get a handle to an existing workflow with ResultAsync pattern\n *\n * @example\n * ```ts\n * const handleResult = await client.getHandle('processOrder', 'order-123');\n * handleResult.match(\n * async (handle) => {\n * const result = await handle.result();\n * // ... handle result\n * },\n * (error) => console.error('Failed to get handle:', error),\n * );\n * ```\n */\n getHandle<TWorkflowName extends keyof TContract[\"workflows\"] & string>(\n workflowName: TWorkflowName,\n workflowId: string,\n ): ResultAsync<\n TypedWorkflowHandle<TContract[\"workflows\"][TWorkflowName]>,\n WorkflowNotFoundError | RuntimeClientError\n > {\n type Ok = TypedWorkflowHandle<TContract[\"workflows\"][TWorkflowName]>;\n type Err = WorkflowNotFoundError | RuntimeClientError;\n const work = async (): Promise<Result<Ok, Err>> => {\n const definition = this.contract.workflows[workflowName];\n if (!definition) {\n return err(createWorkflowNotFoundError(workflowName, this.contract));\n }\n\n try {\n const handle = this.client.workflow.getHandle(workflowId);\n return ok(this.createTypedHandle(handle, definition) as Ok);\n } catch (error) {\n return err(createRuntimeClientError(\"getHandle\", error));\n }\n };\n return makeResultAsync(work);\n }\n\n private createTypedHandle<TWorkflow extends AnyWorkflowDefinition>(\n workflowHandle: WorkflowHandle,\n definition: TWorkflow,\n ): TypedWorkflowHandle<TWorkflow> {\n const queries = buildValidatedProxy({\n defs: definition.queries,\n operation: \"query\",\n workflowId: workflowHandle.workflowId,\n makeValidationError: (name, direction, issues) =>\n new QueryValidationError(name, direction, issues),\n invoke: (name, validated) => workflowHandle.query(name, validated),\n validateOutput: (def) => def.output,\n }) as TypedWorkflowHandle<TWorkflow>[\"queries\"];\n\n const signals = buildValidatedProxy({\n defs: definition.signals,\n operation: \"signal\",\n workflowId: workflowHandle.workflowId,\n makeValidationError: (name, _direction, issues) => new SignalValidationError(name, issues),\n invoke: async (name, validated) => {\n await workflowHandle.signal(name, validated);\n return undefined;\n },\n validateOutput: () => null,\n }) as TypedWorkflowHandle<TWorkflow>[\"signals\"];\n\n const updates = buildValidatedProxy({\n defs: definition.updates,\n operation: \"update\",\n workflowId: workflowHandle.workflowId,\n makeValidationError: (name, direction, issues) =>\n new UpdateValidationError(name, direction, issues),\n invoke: (name, validated) => workflowHandle.executeUpdate(name, { args: [validated] }),\n validateOutput: (def) => def.output,\n }) as TypedWorkflowHandle<TWorkflow>[\"updates\"];\n\n return {\n workflowId: workflowHandle.workflowId,\n queries,\n signals,\n updates,\n result: (): ResultAsync<\n ClientInferOutput<TWorkflow>,\n | WorkflowValidationError\n | WorkflowFailedError\n | WorkflowExecutionNotFoundError\n | RuntimeClientError\n > => {\n type Ok = ClientInferOutput<TWorkflow>;\n type Err =\n | WorkflowValidationError\n | WorkflowFailedError\n | WorkflowExecutionNotFoundError\n | RuntimeClientError;\n const work = async (): Promise<Result<Ok, Err>> => {\n try {\n const result = await workflowHandle.result();\n const outputResult = await definition.output[\"~standard\"].validate(result);\n if (outputResult.issues) {\n return err(\n new WorkflowValidationError(\n workflowHandle.workflowId,\n \"output\",\n outputResult.issues,\n ),\n );\n }\n return ok(outputResult.value as Ok);\n } catch (error) {\n return err(classifyResultError(\"result\", error, workflowHandle.workflowId));\n }\n };\n return makeResultAsync(work);\n },\n terminate: (\n reason?: string,\n ): ResultAsync<void, WorkflowExecutionNotFoundError | RuntimeClientError> =>\n ResultAsync.fromPromise(workflowHandle.terminate(reason), (error) =>\n classifyHandleError(\"terminate\", error, workflowHandle.workflowId),\n ).map(() => undefined),\n cancel: (): ResultAsync<void, WorkflowExecutionNotFoundError | RuntimeClientError> =>\n ResultAsync.fromPromise(workflowHandle.cancel(), (error) =>\n classifyHandleError(\"cancel\", error, workflowHandle.workflowId),\n ).map(() => undefined),\n describe: (): ResultAsync<\n Awaited<ReturnType<WorkflowHandle[\"describe\"]>>,\n WorkflowExecutionNotFoundError | RuntimeClientError\n > =>\n ResultAsync.fromPromise(workflowHandle.describe(), (error) =>\n classifyHandleError(\"describe\", error, workflowHandle.workflowId),\n ),\n fetchHistory: (): ResultAsync<\n Awaited<ReturnType<WorkflowHandle[\"fetchHistory\"]>>,\n WorkflowExecutionNotFoundError | RuntimeClientError\n > =>\n ResultAsync.fromPromise(workflowHandle.fetchHistory(), (error) =>\n classifyHandleError(\"fetchHistory\", error, workflowHandle.workflowId),\n ),\n };\n }\n}\n\nfunction createRuntimeClientError(operation: string, error: unknown): RuntimeClientError {\n return new RuntimeClientError(operation, error);\n}\n\nfunction createWorkflowNotFoundError(\n workflowName: string | number | symbol,\n contract: ContractDefinition,\n): WorkflowNotFoundError {\n return new WorkflowNotFoundError(String(workflowName), Object.keys(contract.workflows));\n}\n\nfunction createWorkflowValidationError(\n workflowName: string | number | symbol,\n direction: \"input\" | \"output\",\n issues: ReadonlyArray<StandardSchemaV1.Issue>,\n): WorkflowValidationError {\n return new WorkflowValidationError(String(workflowName), direction, issues);\n}\n\ntype DefWithInput = { readonly input: StandardSchemaV1 };\n\ntype ProxyOptions<TDef extends DefWithInput, TValidationError extends Error> = {\n readonly defs: Record<string, TDef> | undefined;\n readonly operation: string;\n /**\n * Workflow ID of the handle these proxies bind to. Used by\n * {@link classifyHandleError} to surface\n * {@link WorkflowExecutionNotFoundError} with the targeted ID even when\n * Temporal's error doesn't carry it.\n */\n readonly workflowId: string;\n readonly makeValidationError: (\n name: string,\n direction: \"input\" | \"output\",\n issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) => TValidationError;\n readonly invoke: (name: string, validatedInput: unknown) => Promise<unknown>;\n /**\n * Returns the schema to validate the invoke result against, or `null` to skip\n * output validation (used by signals, which don't return a value).\n */\n readonly validateOutput: (def: TDef) => StandardSchemaV1 | null;\n};\n\n/**\n * Build a `{ name: (args) => ResultAsync<...> }` proxy for a contract's\n * queries/signals/updates. The three call sites differ only in how they\n * invoke Temporal and whether they validate output, so the shared\n * input-validate → invoke → output-validate → wrap-Result pipeline lives\n * here once.\n */\nfunction buildValidatedProxy<TDef extends DefWithInput, TValidationError extends Error>({\n defs,\n operation,\n workflowId,\n makeValidationError,\n invoke,\n validateOutput,\n}: ProxyOptions<TDef, TValidationError>): Record<\n string,\n (\n args: unknown,\n ) => ResultAsync<unknown, TValidationError | WorkflowExecutionNotFoundError | RuntimeClientError>\n> {\n const proxy: Record<\n string,\n (\n args: unknown,\n ) => ResultAsync<\n unknown,\n TValidationError | WorkflowExecutionNotFoundError | RuntimeClientError\n >\n > = {};\n if (!defs) return proxy;\n\n for (const [name, def] of Object.entries(defs)) {\n proxy[name] = (args) => {\n const work = async (): Promise<\n Result<unknown, TValidationError | WorkflowExecutionNotFoundError | RuntimeClientError>\n > => {\n const inputResult = await def.input[\"~standard\"].validate(args);\n if (inputResult.issues) {\n return err(makeValidationError(name, \"input\", inputResult.issues));\n }\n\n try {\n const result = await invoke(name, inputResult.value);\n const outputSchema = validateOutput(def);\n if (!outputSchema) {\n return ok(result);\n }\n const outputResult = await outputSchema[\"~standard\"].validate(result);\n if (outputResult.issues) {\n return err(makeValidationError(name, \"output\", outputResult.issues));\n }\n return ok(outputResult.value);\n } catch (error) {\n return err(classifyHandleError(operation, error, workflowId));\n }\n };\n return makeResultAsync(work);\n };\n }\n\n return proxy;\n}\n"],"mappings":";;;;;;;;;AAkCA,IAAe,mBAAf,cAAwC,MAAM;CAC5C,YAAsB,SAAiB;AACrC,QAAM,QAAQ;AACd,OAAK,OAAO,KAAK,YAAY;AAC7B,MAAI,MAAM,kBACR,OA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W,CACtE;GACJ;;;AAIL,SAAS,yBAAyB,WAAmB,OAAoC;AACvF,QAAO,IAAI,mBAAmB,WAAW,MAAM;;AAGjD,SAAS,4BACP,cACA,UACuB;AACvB,QAAO,IAAI,sBAAsB,OAAO,aAAa,EAAE,OAAO,KAAK,SAAS,UAAU,CAAC;;AAGzF,SAAS,8BACP,cACA,WACA,QACyB;AACzB,QAAO,IAAI,wBAAwB,OAAO,aAAa,EAAE,WAAW,OAAO;;;;;;;;;AAmC7E,SAAS,oBAA+E,EACtF,MACA,WACA,YACA,qBACA,QACA,kBAMA;CACA,MAAM,QAQF,EAAE;AACN,KAAI,CAAC,KAAM,QAAO;AAElB,MAAK,MAAM,CAAC,MAAM,QAAQ,OAAO,QAAQ,KAAK,CAC5C,OAAM,SAAS,SAAS;EACtB,MAAM,OAAO,YAER;GACH,MAAM,cAAc,MAAM,IAAI,MAAM,aAAa,SAAS,KAAK;AAC/D,OAAI,YAAY,OACd,QAAO,IAAI,oBAAoB,MAAM,SAAS,YAAY,OAAO,CAAC;AAGpE,OAAI;IACF,MAAM,SAAS,MAAM,OAAO,MAAM,YAAY,MAAM;IACpD,MAAM,eAAe,eAAe,IAAI;AACxC,QAAI,CAAC,aACH,QAAO,GAAG,OAAO;IAEnB,MAAM,eAAe,MAAM,aAAa,aAAa,SAAS,OAAO;AACrE,QAAI,aAAa,OACf,QAAO,IAAI,oBAAoB,MAAM,UAAU,aAAa,OAAO,CAAC;AAEtE,WAAO,GAAG,aAAa,MAAM;YACtB,OAAO;AACd,WAAO,IAAI,oBAAoB,WAAW,OAAO,WAAW,CAAC;;;AAGjE,SAAO,gBAAgB,KAAK;;AAIhC,QAAO"}
1
+ {"version":3,"file":"index.mjs","names":["TemporalWorkflowNotFoundError","TemporalWorkflowFailedError","TemporalWorkflowFailedError","TemporalWorkflowNotFoundError"],"sources":["../src/errors.ts","../src/internal.ts","../src/schedule.ts","../src/client.ts"],"sourcesContent":["import type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport { summarizeIssues } from \"@temporal-contract/contract\";\nimport type {\n ActivityFailure,\n ApplicationFailure,\n CancelledFailure,\n ChildWorkflowFailure,\n ServerFailure,\n TerminatedFailure,\n TimeoutFailure,\n} from \"@temporalio/common\";\n\n/**\n * Union of the actionable Temporal failure types that can surface as the\n * `cause` of a `WorkflowFailedError`. These all extend Temporal's internal\n * `TemporalFailure` base class — we list them by leaf type rather than by\n * the base class so consumer code can use a single `switch (true)` over\n * `instanceof` discriminants without an exhaustiveness escape hatch.\n *\n * Re-exported from the package entry point so consumers can import it\n * directly: `import type { TemporalFailure } from \"@temporal-contract/client\"`.\n */\nexport type TemporalFailure =\n | ApplicationFailure\n | CancelledFailure\n | TerminatedFailure\n | TimeoutFailure\n | ChildWorkflowFailure\n | ServerFailure\n | ActivityFailure;\n\n/**\n * Base class for all typed client errors.\n */\nabstract class TypedClientError extends Error {\n protected constructor(message: string) {\n super(message);\n this.name = this.constructor.name;\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n}\n\n/**\n * Generic runtime failure wrapper when no specific error type applies\n */\nexport class RuntimeClientError extends TypedClientError {\n constructor(\n public readonly operation: string,\n public override readonly cause?: unknown,\n ) {\n super(\n `Operation \"${operation}\" failed: ${\n cause instanceof Error ? cause.message : String(cause ?? \"unknown error\")\n }`,\n );\n }\n}\n\n/**\n * Thrown when a workflow is not found in the contract\n */\nexport class WorkflowNotFoundError extends TypedClientError {\n constructor(\n public readonly workflowName: string,\n public readonly availableWorkflows: string[],\n ) {\n super(\n `Workflow \"${workflowName}\" not found in contract. Available workflows: ${availableWorkflows.join(\", \")}`,\n );\n }\n}\n\n/**\n * Discriminated variant of {@link RuntimeClientError} surfaced when starting\n * a workflow collides with an existing execution — Temporal's\n * `WorkflowExecutionAlreadyStartedError`. The most common cause is a\n * workflowId reuse policy that rejects duplicates while a previous run is\n * still in retention.\n *\n * Distinguishing this from `RuntimeClientError` lets idempotent callers\n * branch on it explicitly (e.g. fetch the existing handle and continue)\n * without inspecting `error.cause` against a Temporal SDK class.\n */\nexport class WorkflowAlreadyStartedError extends TypedClientError {\n constructor(\n public readonly workflowType: string,\n public readonly workflowId: string,\n public override readonly cause?: unknown,\n ) {\n super(`Workflow \"${workflowType}\" with ID \"${workflowId}\" is already started or in retention.`);\n }\n}\n\n/**\n * Discriminated variant of {@link RuntimeClientError} surfaced when an\n * operation targets a workflow execution that doesn't exist in the\n * namespace — Temporal's `WorkflowNotFoundError` (distinct from this\n * package's contract-level {@link WorkflowNotFoundError}).\n *\n * Returned from:\n * - handle methods: `signal`, `query`, `executeUpdate`, `result`,\n * `terminate`, `cancel`, `describe`, `fetchHistory`\n * - `executeWorkflow` (when the underlying execute call hits a missing\n * execution mid-flight)\n */\nexport class WorkflowExecutionNotFoundError extends TypedClientError {\n constructor(\n public readonly workflowId: string,\n public readonly runId?: string,\n public override readonly cause?: unknown,\n ) {\n super(\n `Workflow execution \"${workflowId}\"${runId ? ` (run \"${runId}\")` : \"\"} not found in namespace.`,\n );\n }\n}\n\n/**\n * Discriminated variant of {@link RuntimeClientError} surfaced when waiting\n * on a workflow's result and the workflow completes with a failure —\n * Temporal's `WorkflowFailedError`.\n *\n * `cause` is the *unwrapped* underlying {@link TemporalFailure} (typically an\n * `ApplicationFailure`, `CancelledFailure`, `TerminatedFailure`, or\n * `TimeoutFailure`) lifted from Temporal's wrapper, so callers can branch\n * on the failure category in one step (`err.cause instanceof\n * ApplicationFailure`) instead of unwrapping twice via the SDK wrapper. The\n * SDK declares `WorkflowFailedError.cause` as the wider `Error | undefined`\n * (since `cause` lives on `Error`), but the runtime guarantee — driven by\n * Temporal's wire format — is that it is always a `TemporalFailure` subclass\n * when the wrapper is surfaced. `classifyResultError` narrows that wider\n * static type to the public {@link TemporalFailure} union with a cast, so\n * consumers see the precise leaf-failure typing instead of a bare `Error`.\n *\n * Returned from `executeWorkflow` and `handle.result()`.\n */\nexport class WorkflowFailedError extends TypedClientError {\n constructor(\n public readonly workflowId: string,\n public override readonly cause?: TemporalFailure,\n ) {\n const causeMessage =\n cause instanceof Error ? cause.message : String(cause ?? \"unknown failure\");\n super(`Workflow \"${workflowId}\" completed with failure: ${causeMessage}`);\n }\n}\n\n// Validation-message formatters live in `@temporal-contract/contract` so\n// client and worker share a single source of truth. The previous local\n// copies have been removed in favor of the shared `summarizeIssues` import\n// at the top of this module.\n\n/**\n * Thrown when workflow input or output validation fails\n */\nexport class WorkflowValidationError extends TypedClientError {\n constructor(\n public readonly workflowName: string,\n public readonly direction: \"input\" | \"output\",\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n super(\n `Validation failed for workflow \"${workflowName}\" ${direction}: ${summarizeIssues(issues)}`,\n );\n }\n}\n\n/**\n * Thrown when query input or output validation fails\n */\nexport class QueryValidationError extends TypedClientError {\n constructor(\n public readonly queryName: string,\n public readonly direction: \"input\" | \"output\",\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n super(`Validation failed for query \"${queryName}\" ${direction}: ${summarizeIssues(issues)}`);\n }\n}\n\n/**\n * Thrown when signal input validation fails\n */\nexport class SignalValidationError extends TypedClientError {\n constructor(\n public readonly signalName: string,\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n super(`Validation failed for signal \"${signalName}\": ${summarizeIssues(issues)}`);\n }\n}\n\n/**\n * Thrown when update input or output validation fails\n */\nexport class UpdateValidationError extends TypedClientError {\n constructor(\n public readonly updateName: string,\n public readonly direction: \"input\" | \"output\",\n public readonly issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) {\n super(`Validation failed for update \"${updateName}\" ${direction}: ${summarizeIssues(issues)}`);\n }\n}\n","/**\n * Internal helpers shared across the client package's modules.\n *\n * Not part of the public API — this module is not listed in the package's\n * `exports` map, so consumers can't import from `@temporal-contract/client/internal`.\n * In-package modules and tests import it directly via relative path.\n */\nimport { WorkflowExecutionAlreadyStartedError } from \"@temporalio/client\";\nimport { WorkflowFailedError as TemporalWorkflowFailedError } from \"@temporalio/client\";\nimport {\n defineSearchAttributeKey,\n type SearchAttributePair,\n TypedSearchAttributes,\n WorkflowNotFoundError as TemporalWorkflowNotFoundError,\n} from \"@temporalio/common\";\nimport type { AnyWorkflowDefinition, SearchAttributeDefinition } from \"@temporal-contract/contract\";\nimport { _internal_makeResultAsync } from \"@temporal-contract/contract/result-async\";\nimport { ok, err, type ResultAsync, type Result } from \"neverthrow\";\nimport {\n RuntimeClientError,\n type TemporalFailure,\n WorkflowAlreadyStartedError,\n WorkflowExecutionNotFoundError,\n WorkflowFailedError,\n} from \"./errors.js\";\n\n/**\n * Translate the contract's typed `searchAttributes` map (declared\n * name → value) into a Temporal `TypedSearchAttributes` instance, so the\n * Temporal client honours indexing when starting the workflow.\n *\n * Workflows without a `searchAttributes` block (or callers passing no\n * values) resolve to `ok(undefined)`, matching the Temporal SDK's\n * \"absent ≠ empty\" semantics.\n *\n * Returns `err(RuntimeClientError)` on unknown keys. The TypeScript\n * surface already gates the happy path; the runtime check catches typed\n * escape hatches (`as never`, `as any`, raw-call interop) where a typo\n * would otherwise silently drop the attribute, leaving the workflow\n * unindexed without any signal to the caller.\n */\nexport function toTypedSearchAttributes(\n workflowDef: AnyWorkflowDefinition,\n workflowName: string,\n values: Record<string, unknown> | undefined,\n): Result<TypedSearchAttributes | undefined, RuntimeClientError> {\n if (!values) return ok(undefined);\n // Workflows that omit the `searchAttributes` block declare none. Treat\n // that as an empty declared map so a caller passing values still hits\n // the per-key \"undeclared\" check below — silently dropping them would\n // re-introduce the escape-hatch gap this helper was designed to close.\n const declared = (workflowDef.searchAttributes ?? {}) as Record<\n string,\n SearchAttributeDefinition\n >;\n const pairs: SearchAttributePair[] = [];\n for (const [name, value] of Object.entries(values)) {\n if (value === undefined) continue;\n const def = declared[name];\n if (!def) {\n return err(\n new RuntimeClientError(\n \"searchAttributes\",\n new Error(\n `Search attribute \"${name}\" is not declared on workflow \"${workflowName}\". ` +\n `Declared attributes: ${Object.keys(declared).join(\", \") || \"none\"}.`,\n ),\n ),\n );\n }\n const key = defineSearchAttributeKey(name, def.kind);\n pairs.push({ key, value } as SearchAttributePair);\n }\n return ok(pairs.length > 0 ? new TypedSearchAttributes(pairs) : undefined);\n}\n\n/**\n * Wrap an async result-producing function in a `ResultAsync`, catching any\n * unhandled rejection as a `RuntimeClientError(\"unexpected\", error)`.\n *\n * The work function is expected to handle its own domain errors and return\n * an `err(...)` for them; the catch here is a safety net for thrown\n * exceptions the work didn't anticipate.\n *\n * Used by `client.ts` (workflow operations) and `schedule.ts` (schedule\n * operations) so the unexpected-rejection shape is identical across the\n * typed client surface. Delegates to `_internal_makeResultAsync` from\n * `@temporal-contract/contract` so the same wrapper is shared between the\n * client and worker packages.\n */\nexport function makeResultAsync<T, E>(\n work: () => Promise<Result<T, E>>,\n): ResultAsync<T, E | RuntimeClientError> {\n return _internal_makeResultAsync<T, E | RuntimeClientError>(\n work,\n (e) => new RuntimeClientError(\"unexpected\", e),\n );\n}\n\n/**\n * Map a thrown error from `client.workflow.start` / `signalWithStart` into\n * the discriminated union surfaced by the typed client. Specifically\n * recognizes Temporal's `WorkflowExecutionAlreadyStartedError`; everything\n * else falls through to {@link RuntimeClientError}.\n */\nexport function classifyStartError(\n operation: string,\n error: unknown,\n): WorkflowAlreadyStartedError | RuntimeClientError {\n if (error instanceof WorkflowExecutionAlreadyStartedError) {\n return new WorkflowAlreadyStartedError(error.workflowType, error.workflowId, error);\n }\n return new RuntimeClientError(operation, error);\n}\n\n/**\n * Map a thrown error from a workflow handle method (signal, query,\n * executeUpdate, terminate, cancel, describe, fetchHistory) into the\n * discriminated union surfaced by the typed client. Recognizes Temporal's\n * `WorkflowNotFoundError`; everything else falls through to\n * {@link RuntimeClientError}.\n *\n * `fallbackWorkflowId` is used when Temporal's error carries an empty\n * `workflowId` (it normalizes missing IDs to the empty string), so the\n * surfaced error always identifies the targeted execution.\n */\nexport function classifyHandleError(\n operation: string,\n error: unknown,\n fallbackWorkflowId: string,\n): WorkflowExecutionNotFoundError | RuntimeClientError {\n if (error instanceof TemporalWorkflowNotFoundError) {\n return new WorkflowExecutionNotFoundError(\n error.workflowId || fallbackWorkflowId,\n error.runId,\n error,\n );\n }\n return new RuntimeClientError(operation, error);\n}\n\n/**\n * Map a thrown error from `handle.result()` / `client.workflow.execute()`\n * (the latter when waiting on the result phase). Recognizes Temporal's\n * `WorkflowFailedError` and `WorkflowNotFoundError`; everything else falls\n * through to {@link RuntimeClientError}.\n *\n * Temporal's `WorkflowFailedError` is itself a wrapper — the actionable\n * failure (ApplicationFailure, CancelledFailure, TerminatedFailure, etc.)\n * lives on its `cause` field. We forward that inner cause directly so\n * consumers can match `err.cause` against the underlying failure class\n * without an extra unwrap step. (If Temporal's cause is `undefined`, our\n * `cause` is too — same shape as before.)\n */\nexport function classifyResultError(\n operation: string,\n error: unknown,\n workflowId: string,\n): WorkflowFailedError | WorkflowExecutionNotFoundError | RuntimeClientError {\n if (error instanceof TemporalWorkflowFailedError) {\n // Temporal types `cause` as `Error | undefined`, but the SDK only ever\n // populates it with a `TemporalFailure` subclass when surfacing a\n // workflow result failure. Narrow with the public union so consumers\n // can branch on the leaf failure types without an extra cast.\n return new WorkflowFailedError(workflowId, error.cause as TemporalFailure | undefined);\n }\n if (error instanceof TemporalWorkflowNotFoundError) {\n return new WorkflowExecutionNotFoundError(error.workflowId || workflowId, error.runId, error);\n }\n return new RuntimeClientError(operation, error);\n}\n","import type {\n ScheduleClient,\n ScheduleDescription,\n ScheduleHandle,\n ScheduleOptions,\n ScheduleOptionsStartWorkflowAction,\n ScheduleOverlapPolicy,\n ScheduleSpec,\n} from \"@temporalio/client\";\nimport type { ContractDefinition } from \"@temporal-contract/contract\";\nimport { ResultAsync, type Result, ok, err } from \"neverthrow\";\nimport type { TypedSearchAttributeMap } from \"./client.js\";\nimport type { ClientInferInput } from \"./types.js\";\nimport { RuntimeClientError, WorkflowNotFoundError, WorkflowValidationError } from \"./errors.js\";\nimport { makeResultAsync, toTypedSearchAttributes } from \"./internal.js\";\n\n/**\n * Workflow-action–level overrides forwarded to Temporal's\n * `ScheduleOptionsStartWorkflowAction`. These live under a nested `action`\n * field so the workflow-level `memo` (per-action workflow metadata) can be\n * set independently from the schedule-level `memo` (metadata on the\n * schedule itself) — Temporal honours both, and they have separate\n * lifecycles.\n *\n * `workflowType` and `taskQueue` are owned by the contract and not exposed.\n */\nexport type TypedScheduleActionOverrides = Pick<\n ScheduleOptionsStartWorkflowAction<never>,\n | \"workflowId\"\n | \"workflowExecutionTimeout\"\n | \"workflowRunTimeout\"\n | \"workflowTaskTimeout\"\n | \"retry\"\n | \"memo\"\n | \"staticDetails\"\n | \"staticSummary\"\n>;\n\n/**\n * Options for {@link TypedScheduleClient.create}.\n *\n * `scheduleId` and `spec` come from Temporal's `ScheduleOptions`. `args` is\n * typed against the destination workflow's input schema. `policies`,\n * `state`, and `memo` mirror Temporal's own schedule-level options.\n * Workflow-action–level overrides nest under {@link action} so memo and\n * other fields with the same name don't collide between the two scopes.\n */\nexport type TypedScheduleCreateOptions<\n TContract extends ContractDefinition,\n TWorkflowName extends keyof TContract[\"workflows\"] & string,\n> = {\n /** Schedule ID. Recommended to use a meaningful business identifier. */\n scheduleId: string;\n /** When the schedule should fire (cron, interval, calendar). */\n spec: ScheduleSpec;\n /** Workflow input — validated against the contract's input schema. */\n args: ClientInferInput<TContract[\"workflows\"][TWorkflowName]>;\n /**\n * Indexed search attributes for each workflow run spawned by this\n * schedule. Keys and value types are constrained to those declared on\n * the destination workflow's contract via `defineSearchAttribute`.\n * Translated to Temporal's `typedSearchAttributes` and attached to the\n * schedule's `startWorkflow` action so each spawned run is indexed\n * identically to one started directly via `client.startWorkflow`.\n */\n searchAttributes?: TypedSearchAttributeMap<TContract[\"workflows\"][TWorkflowName]>;\n /** Temporal schedule policies (overlap, catchupWindow, pauseOnFailure, etc.). */\n policies?: ScheduleOptions[\"policies\"];\n /** Temporal schedule state (paused, note, limited, etc.). */\n state?: ScheduleOptions[\"state\"];\n /** Schedule-level memo (non-indexed metadata on the schedule itself). */\n memo?: ScheduleOptions[\"memo\"];\n /**\n * Workflow-action–level overrides. `workflowType` and `taskQueue` are\n * derived from the contract, so they don't appear here. Note that\n * `action.memo` is a *workflow-level* memo applied to each spawned run,\n * distinct from the top-level `memo` (which is metadata on the schedule\n * itself).\n */\n action?: TypedScheduleActionOverrides;\n};\n\n/**\n * Typed handle to a schedule. Mirrors Temporal's `ScheduleHandle` lifecycle\n * methods (`pause`, `unpause`, `trigger`, `describe`, `delete`) wrapped in\n * the neverthrow ResultAsync pattern so call sites match the rest of the\n * typed client.\n */\nexport type TypedScheduleHandle = {\n /** This schedule's identifier. */\n readonly scheduleId: string;\n /** Pause the schedule. Optional note becomes part of the audit trail. */\n pause: (note?: string) => ResultAsync<void, RuntimeClientError>;\n /** Resume a paused schedule. */\n unpause: (note?: string) => ResultAsync<void, RuntimeClientError>;\n /** Fire the schedule's action immediately. */\n trigger: (overlap?: ScheduleOverlapPolicy) => ResultAsync<void, RuntimeClientError>;\n /** Delete the schedule. */\n delete: () => ResultAsync<void, RuntimeClientError>;\n /** Fetch the schedule's current description from the server. */\n describe: () => ResultAsync<ScheduleDescription, RuntimeClientError>;\n};\n\n/**\n * Typed wrapper around Temporal's `ScheduleClient`. Exposed as\n * `typedClient.schedule` — keeps the typed-client surface organized the\n * same way Temporal's own `Client.schedule` does.\n */\nexport class TypedScheduleClient<TContract extends ContractDefinition> {\n constructor(\n private readonly contract: TContract,\n private readonly scheduleClient: ScheduleClient,\n ) {}\n\n /**\n * Create a new schedule that, on each fire, starts the named contract\n * workflow with validated args.\n *\n * Validates `args` against the workflow's input schema before dispatching\n * the create request to Temporal. The workflow's `taskQueue` and\n * `workflowType` are pulled from the contract automatically; the typed\n * options shape omits them so call sites don't have to repeat themselves.\n */\n create<TWorkflowName extends keyof TContract[\"workflows\"] & string>(\n workflowName: TWorkflowName,\n options: TypedScheduleCreateOptions<TContract, TWorkflowName>,\n ): ResultAsync<\n TypedScheduleHandle,\n WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError\n > {\n type Ok = TypedScheduleHandle;\n type Err = WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError;\n const work = async (): Promise<Result<Ok, Err>> => {\n const definition = this.contract.workflows[workflowName];\n if (!definition) {\n return err(new WorkflowNotFoundError(workflowName, Object.keys(this.contract.workflows)));\n }\n\n const inputResult = await definition.input[\"~standard\"].validate(options.args);\n if (inputResult.issues) {\n return err(new WorkflowValidationError(workflowName, \"input\", inputResult.issues));\n }\n\n // Translate typed search attributes for the spawned workflow runs.\n // Lives on the schedule's `startWorkflow` action (workflow-level\n // indexing), not on the schedule itself. Mirrors what\n // `client.startWorkflow` does for direct starts so schedule-spawned\n // runs share visibility with their direct-start counterparts.\n const searchAttributesResult = toTypedSearchAttributes(\n definition,\n workflowName,\n options.searchAttributes as Record<string, unknown> | undefined,\n );\n if (searchAttributesResult.isErr()) return err(searchAttributesResult.error);\n const typedSearchAttributes = searchAttributesResult.value;\n\n try {\n const overrides = options.action ?? {};\n const action: ScheduleOptionsStartWorkflowAction<never> = {\n type: \"startWorkflow\",\n workflowType: workflowName,\n taskQueue: this.contract.taskQueue,\n args: [inputResult.value] as never,\n ...(typedSearchAttributes ? { typedSearchAttributes } : {}),\n ...(overrides.workflowId !== undefined ? { workflowId: overrides.workflowId } : {}),\n ...(overrides.workflowExecutionTimeout !== undefined\n ? { workflowExecutionTimeout: overrides.workflowExecutionTimeout }\n : {}),\n ...(overrides.workflowRunTimeout !== undefined\n ? { workflowRunTimeout: overrides.workflowRunTimeout }\n : {}),\n ...(overrides.workflowTaskTimeout !== undefined\n ? { workflowTaskTimeout: overrides.workflowTaskTimeout }\n : {}),\n ...(overrides.retry !== undefined ? { retry: overrides.retry } : {}),\n ...(overrides.memo !== undefined ? { memo: overrides.memo } : {}),\n ...(overrides.staticDetails !== undefined\n ? { staticDetails: overrides.staticDetails }\n : {}),\n ...(overrides.staticSummary !== undefined\n ? { staticSummary: overrides.staticSummary }\n : {}),\n };\n\n const handle = await this.scheduleClient.create({\n scheduleId: options.scheduleId,\n spec: options.spec,\n action,\n ...(options.policies !== undefined ? { policies: options.policies } : {}),\n ...(options.state !== undefined ? { state: options.state } : {}),\n ...(options.memo !== undefined ? { memo: options.memo } : {}),\n });\n return ok(wrapScheduleHandle(handle));\n } catch (error) {\n return err(new RuntimeClientError(\"schedule.create\", error));\n }\n };\n return makeResultAsync(work);\n }\n\n /**\n * Get a typed handle to an existing schedule. Does not validate that the\n * schedule exists — handle methods (`describe`, `pause`, etc.) will\n * surface a `RuntimeClientError` if the underlying ID is unknown.\n */\n getHandle(scheduleId: string): TypedScheduleHandle {\n return wrapScheduleHandle(this.scheduleClient.getHandle(scheduleId));\n }\n}\n\nfunction wrapScheduleHandle(handle: ScheduleHandle): TypedScheduleHandle {\n return {\n scheduleId: handle.scheduleId,\n pause: (note) =>\n ResultAsync.fromPromise(\n handle.pause(note),\n (error) => new RuntimeClientError(\"schedule.pause\", error),\n ).map(() => undefined),\n unpause: (note) =>\n ResultAsync.fromPromise(\n handle.unpause(note),\n (error) => new RuntimeClientError(\"schedule.unpause\", error),\n ).map(() => undefined),\n trigger: (overlap) =>\n ResultAsync.fromPromise(\n handle.trigger(overlap),\n (error) => new RuntimeClientError(\"schedule.trigger\", error),\n ).map(() => undefined),\n delete: () =>\n ResultAsync.fromPromise(\n handle.delete(),\n (error) => new RuntimeClientError(\"schedule.delete\", error),\n ).map(() => undefined),\n describe: () =>\n ResultAsync.fromPromise(\n handle.describe(),\n (error) => new RuntimeClientError(\"schedule.describe\", error),\n ),\n };\n}\n","import { Client, WorkflowHandle } from \"@temporalio/client\";\nimport type { WorkflowSignalWithStartOptions, WorkflowStartOptions } from \"@temporalio/client\";\nimport { defineSearchAttributeKey, TypedSearchAttributes } from \"@temporalio/common\";\nimport type { StandardSchemaV1 } from \"@standard-schema/spec\";\nimport type {\n AnyWorkflowDefinition,\n ContractDefinition,\n SearchAttributeDefinition,\n SearchAttributeKindToType,\n SignalDefinition,\n SignalNamesOf,\n} from \"@temporal-contract/contract\";\nimport type {\n ClientInferInput,\n ClientInferOutput,\n ClientInferWorkflowQueries,\n ClientInferWorkflowSignals,\n ClientInferWorkflowUpdates,\n} from \"./types.js\";\nimport { ResultAsync, type Result, ok, err } from \"neverthrow\";\nimport {\n type TemporalFailure,\n WorkflowAlreadyStartedError,\n WorkflowExecutionNotFoundError,\n WorkflowFailedError,\n WorkflowNotFoundError,\n WorkflowValidationError,\n QueryValidationError,\n SignalValidationError,\n UpdateValidationError,\n RuntimeClientError,\n} from \"./errors.js\";\nimport { TypedScheduleClient } from \"./schedule.js\";\nimport {\n classifyHandleError,\n classifyResultError,\n classifyStartError,\n makeResultAsync,\n toTypedSearchAttributes,\n} from \"./internal.js\";\nimport { WorkflowExecutionAlreadyStartedError } from \"@temporalio/client\";\nimport { WorkflowFailedError as TemporalWorkflowFailedError } from \"@temporalio/client\";\nimport { WorkflowNotFoundError as TemporalWorkflowNotFoundError } from \"@temporalio/common\";\n\n/**\n * Typed `searchAttributes` map for a workflow, derived from the workflow's\n * declared `searchAttributes`. Each key is constrained to a declared\n * attribute name; each value's type is determined by the attribute's `kind`\n * (e.g. `KEYWORD` → `string`, `INT` → `number`, `DATETIME` → `Date`,\n * `KEYWORD_LIST` → `string[]`).\n *\n * If the workflow declares no search attributes, this resolves to `never`,\n * meaning the `searchAttributes` field is effectively absent from the start\n * options for that workflow.\n */\nexport type TypedSearchAttributeMap<TWorkflow extends AnyWorkflowDefinition> =\n TWorkflow[\"searchAttributes\"] extends Record<string, SearchAttributeDefinition>\n ? {\n [K in keyof TWorkflow[\"searchAttributes\"]]?: SearchAttributeKindToType<\n TWorkflow[\"searchAttributes\"][K][\"kind\"]\n >;\n }\n : never;\n\n/**\n * Read declared search attributes off a `TypedSearchAttributes` instance —\n * the read-side counterpart to the write-side `searchAttributes` option on\n * `startWorkflow` / `signalWithStart` / `executeWorkflow` /\n * `schedule.create`.\n *\n * Use it on the result of `handle.describe()` (or a schedule's describe) to\n * recover the typed shape of indexed attributes. The Temporal SDK only\n * exposes a `.get(key)` accessor on `TypedSearchAttributes` and requires\n * the caller to reconstruct each `SearchAttributeKey` from the contract's\n * declared `kind` — this helper does that lookup once for every declared\n * attribute, returning a `Partial<TypedSearchAttributeMap<TWorkflow>>`\n * (each declared key may or may not have been set on the workflow).\n *\n * Workflows without declared `searchAttributes` get an empty object back.\n *\n * @example\n * ```ts\n * const description = await handle.describe();\n * if (description.isOk()) {\n * const attrs = readTypedSearchAttributes(\n * myContract.workflows.processOrder,\n * description.value.typedSearchAttributes,\n * );\n * // attrs.customerId: string | undefined\n * // attrs.priority: number | undefined\n * }\n * ```\n */\nexport function readTypedSearchAttributes<TWorkflow extends AnyWorkflowDefinition>(\n workflowDef: TWorkflow,\n instance: TypedSearchAttributes,\n): Partial<TypedSearchAttributeMap<TWorkflow>> {\n const declared = workflowDef.searchAttributes as\n | Record<string, SearchAttributeDefinition>\n | undefined;\n if (!declared) return {} as Partial<TypedSearchAttributeMap<TWorkflow>>;\n\n const result: Record<string, unknown> = {};\n for (const [name, def] of Object.entries(declared)) {\n const key = defineSearchAttributeKey(name, def.kind);\n const value = instance.get(key);\n if (value !== undefined) {\n result[name] = value;\n }\n }\n return result as Partial<TypedSearchAttributeMap<TWorkflow>>;\n}\n\nexport type TypedWorkflowStartOptions<\n TContract extends ContractDefinition,\n TWorkflowName extends keyof TContract[\"workflows\"] & string,\n> = Omit<\n WorkflowStartOptions,\n \"taskQueue\" | \"args\" | \"searchAttributes\" | \"typedSearchAttributes\"\n> & {\n args: ClientInferInput<TContract[\"workflows\"][TWorkflowName]>;\n /**\n * Indexed search attributes for the started workflow. Keys and value types\n * are constrained to those declared on the workflow's contract via\n * `defineSearchAttribute`. Translated to Temporal's `typedSearchAttributes`\n * before the start request is dispatched.\n */\n searchAttributes?: TypedSearchAttributeMap<TContract[\"workflows\"][TWorkflowName]>;\n};\n\n/**\n * Options for {@link TypedClient.signalWithStart} — typed against both the\n * workflow's input schema and the named signal's input schema.\n */\nexport type TypedSignalWithStartOptions<\n TContract extends ContractDefinition,\n TWorkflowName extends keyof TContract[\"workflows\"] & string,\n TSignalName extends SignalNamesOf<TContract[\"workflows\"][TWorkflowName]>,\n> = Omit<\n WorkflowSignalWithStartOptions,\n \"taskQueue\" | \"args\" | \"signal\" | \"signalArgs\" | \"searchAttributes\" | \"typedSearchAttributes\"\n> & {\n args: ClientInferInput<TContract[\"workflows\"][TWorkflowName]>;\n signalName: TSignalName;\n signalArgs: TContract[\"workflows\"][TWorkflowName][\"signals\"][TSignalName] extends SignalDefinition\n ? ClientInferInput<TContract[\"workflows\"][TWorkflowName][\"signals\"][TSignalName]>\n : never;\n /**\n * Indexed search attributes for the started workflow. Keys and value types\n * are constrained to those declared on the workflow's contract via\n * `defineSearchAttribute`. Translated to Temporal's `typedSearchAttributes`\n * before the signalWithStart request is dispatched.\n */\n searchAttributes?: TypedSearchAttributeMap<TContract[\"workflows\"][TWorkflowName]>;\n};\n\n/**\n * Typed workflow handle returned by `signalWithStart`. Adds `signaledRunId`\n * to the standard handle so callers can correlate the signal with the\n * (possibly pre-existing) workflow execution chain.\n */\nexport type TypedWorkflowHandleWithSignaledRunId<TWorkflow extends AnyWorkflowDefinition> =\n TypedWorkflowHandle<TWorkflow> & {\n /**\n * The Run Id of the bound Workflow at the time of `signalWithStart`. Since\n * `signalWithStart` may have signaled an existing Workflow Chain, this is\n * not necessarily the `firstExecutionRunId`.\n */\n readonly signaledRunId: string;\n };\n\n/**\n * Typed workflow handle with validated results using neverthrow Result/ResultAsync\n */\nexport type TypedWorkflowHandle<TWorkflow extends AnyWorkflowDefinition> = {\n workflowId: string;\n\n /**\n * Type-safe queries based on workflow definition with Result pattern\n * Each query returns ResultAsync<T, Error> instead of Promise<T>\n */\n queries: {\n [K in keyof ClientInferWorkflowQueries<TWorkflow>]: ClientInferWorkflowQueries<TWorkflow>[K] extends (\n ...args: infer Args\n ) => ResultAsync<infer R, Error>\n ? (\n ...args: Args\n ) => ResultAsync<\n R,\n QueryValidationError | WorkflowExecutionNotFoundError | RuntimeClientError\n >\n : never;\n };\n\n /**\n * Type-safe signals based on workflow definition with Result pattern\n * Each signal returns ResultAsync<void, Error> instead of Promise<void>\n */\n signals: {\n [K in keyof ClientInferWorkflowSignals<TWorkflow>]: ClientInferWorkflowSignals<TWorkflow>[K] extends (\n ...args: infer Args\n ) => ResultAsync<void, Error>\n ? (\n ...args: Args\n ) => ResultAsync<\n void,\n SignalValidationError | WorkflowExecutionNotFoundError | RuntimeClientError\n >\n : never;\n };\n\n /**\n * Type-safe updates based on workflow definition with Result pattern\n * Each update returns ResultAsync<T, Error> instead of Promise<T>\n */\n updates: {\n [K in keyof ClientInferWorkflowUpdates<TWorkflow>]: ClientInferWorkflowUpdates<TWorkflow>[K] extends (\n ...args: infer Args\n ) => ResultAsync<infer R, Error>\n ? (\n ...args: Args\n ) => ResultAsync<\n R,\n UpdateValidationError | WorkflowExecutionNotFoundError | RuntimeClientError\n >\n : never;\n };\n\n /**\n * Get workflow result with Result pattern\n */\n result: () => ResultAsync<\n ClientInferOutput<TWorkflow>,\n | WorkflowValidationError\n | WorkflowFailedError\n | WorkflowExecutionNotFoundError\n | RuntimeClientError\n >;\n\n /**\n * Terminate workflow with Result pattern\n */\n terminate: (\n reason?: string,\n ) => ResultAsync<void, WorkflowExecutionNotFoundError | RuntimeClientError>;\n\n /**\n * Cancel workflow with Result pattern\n */\n cancel: () => ResultAsync<void, WorkflowExecutionNotFoundError | RuntimeClientError>;\n\n /**\n * Get workflow execution description including status and metadata\n */\n describe: () => ResultAsync<\n Awaited<ReturnType<WorkflowHandle[\"describe\"]>>,\n WorkflowExecutionNotFoundError | RuntimeClientError\n >;\n\n /**\n * Fetch the workflow execution history\n */\n fetchHistory: () => ResultAsync<\n Awaited<ReturnType<WorkflowHandle[\"fetchHistory\"]>>,\n WorkflowExecutionNotFoundError | RuntimeClientError\n >;\n};\n\n/**\n * Result of {@link resolveDefinitionAndValidateInput} — the contract-side\n * pre-call ritual the start/signal-with-start/execute methods share. Holds\n * the resolved workflow definition, the schema-validated input, and the\n * translated typed search attributes (or `undefined` when the workflow\n * declared none / the caller passed none).\n */\ntype ResolvedWorkflow<TWorkflow extends AnyWorkflowDefinition> = {\n definition: TWorkflow;\n validatedInput: unknown;\n typedSearchAttributes: TypedSearchAttributes | undefined;\n};\n\n/**\n * Shared pre-call ritual for the three contract-driven entry points that\n * actually start a workflow (`startWorkflow`, `signalWithStart`,\n * `executeWorkflow`):\n *\n * 1. Look up the workflow definition on the contract.\n * 2. Surface a `WorkflowNotFoundError` if absent.\n * 3. Validate `args` against the workflow's input schema.\n * 4. Surface a `WorkflowValidationError` if validation fails.\n * 5. Translate any caller-supplied `searchAttributes` into Temporal's\n * `TypedSearchAttributes` shape (or `undefined`).\n *\n * `getHandle` deliberately keeps its own three-line lookup — it doesn't\n * accept `args` or `searchAttributes`, so it can't share this helper. The\n * call-specific extras (signal validation, post-call output validation,\n * extended error classification) stay at the call site — those are the\n * differentiators that make each method distinct.\n */\nasync function resolveDefinitionAndValidateInput<\n TContract extends ContractDefinition,\n TWorkflowName extends keyof TContract[\"workflows\"] & string,\n>(\n contract: TContract,\n workflowName: TWorkflowName,\n args: unknown,\n searchAttributes: Record<string, unknown> | undefined,\n): Promise<\n Result<\n ResolvedWorkflow<TContract[\"workflows\"][TWorkflowName]>,\n WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError\n >\n> {\n const definition = contract.workflows[workflowName];\n if (!definition) {\n return err(createWorkflowNotFoundError(workflowName, contract));\n }\n\n const inputResult = await definition.input[\"~standard\"].validate(args);\n if (inputResult.issues) {\n return err(createWorkflowValidationError(workflowName, \"input\", inputResult.issues));\n }\n\n const searchAttributesResult = toTypedSearchAttributes(\n definition,\n workflowName,\n searchAttributes,\n );\n if (searchAttributesResult.isErr()) return err(searchAttributesResult.error);\n const typedSearchAttributes = searchAttributesResult.value;\n\n return ok({\n definition: definition as TContract[\"workflows\"][TWorkflowName],\n validatedInput: inputResult.value,\n typedSearchAttributes,\n });\n}\n\n/**\n * Typed Temporal client with neverthrow Result/ResultAsync pattern based on a contract\n *\n * Provides type-safe methods to start and execute workflows\n * defined in the contract, with explicit error handling using Result pattern.\n */\nexport class TypedClient<TContract extends ContractDefinition> {\n /**\n * Typed wrapper around Temporal's `client.schedule.create(...)` and\n * related lifecycle methods. Fires the underlying `startWorkflow` action\n * with args validated against the contract's input schema.\n *\n * **Requires `@temporalio/client` 1.16+.** The Schedule API was added in\n * 1.16; on older versions this property is unset and any access throws.\n * The package's peer dep allows the whole `^1` range to stay permissive\n * about the installed Temporal version, so consumers on < 1.16 who never\n * touch schedules keep working — the constructor below fails fast with a\n * clear message for anyone who does reach for the Schedule API too early.\n *\n * @example\n * ```ts\n * const result = await client.schedule.create(\"processOrder\", {\n * scheduleId: \"daily-sweep\",\n * spec: { cronExpressions: [\"0 2 * * *\"] },\n * args: { orderId: \"sweep\" },\n * });\n *\n * result.match(\n * async (handle) => { await handle.pause(\"maintenance\"); },\n * (error) => console.error(\"schedule create failed\", error),\n * );\n * ```\n */\n readonly schedule: TypedScheduleClient<TContract>;\n\n private constructor(\n private readonly contract: TContract,\n private readonly client: Client,\n ) {\n // `client.schedule` is the ScheduleClient wired into Temporal's\n // top-level `Client` since 1.16. The peer dep allows all of `^1`, so a\n // consumer can be on an older version — fail early with a clear message\n // rather than crashing later with a confusing\n // `Cannot read properties of undefined`.\n if (!client.schedule) {\n throw new Error(\n \"TypedClient requires @temporalio/client >= 1.16 (the Schedule API was added in 1.16). \" +\n \"Found a Client instance without a `schedule` property — please upgrade.\",\n );\n }\n this.schedule = new TypedScheduleClient(contract, client.schedule);\n }\n\n /**\n * Create a typed Temporal client with neverthrow pattern from a contract\n *\n * @example\n * ```ts\n * const connection = await Connection.connect();\n * const temporalClient = new Client({ connection });\n * const client = TypedClient.create(myContract, temporalClient);\n *\n * const result = await client.executeWorkflow('processOrder', {\n * workflowId: 'order-123',\n * args: { ... },\n * });\n *\n * result.match(\n * (output) => console.log('Success:', output),\n * (error) => console.error('Failed:', error),\n * );\n * ```\n */\n static create<TContract extends ContractDefinition>(\n contract: TContract,\n client: Client,\n ): TypedClient<TContract> {\n return new TypedClient(contract, client);\n }\n\n /**\n * Start a workflow and return a typed handle with ResultAsync pattern\n *\n * @example\n * ```ts\n * const handleResult = await client.startWorkflow('processOrder', {\n * workflowId: 'order-123',\n * args: { orderId: 'ORD-123' },\n * workflowExecutionTimeout: '1 day',\n * retry: { maximumAttempts: 3 },\n * });\n *\n * handleResult.match(\n * async (handle) => {\n * const result = await handle.result();\n * // ... handle result\n * },\n * (error) => console.error('Failed to start:', error),\n * );\n * ```\n */\n startWorkflow<TWorkflowName extends keyof TContract[\"workflows\"] & string>(\n workflowName: TWorkflowName,\n {\n args,\n searchAttributes,\n ...temporalOptions\n }: TypedWorkflowStartOptions<TContract, TWorkflowName>,\n ): ResultAsync<\n TypedWorkflowHandle<TContract[\"workflows\"][TWorkflowName]>,\n | WorkflowNotFoundError\n | WorkflowValidationError\n | WorkflowAlreadyStartedError\n | RuntimeClientError\n > {\n type Ok = TypedWorkflowHandle<TContract[\"workflows\"][TWorkflowName]>;\n type Err =\n | WorkflowNotFoundError\n | WorkflowValidationError\n | WorkflowAlreadyStartedError\n | RuntimeClientError;\n const work = async (): Promise<Result<Ok, Err>> => {\n const resolved = await resolveDefinitionAndValidateInput(\n this.contract,\n workflowName,\n args,\n searchAttributes as Record<string, unknown> | undefined,\n );\n if (resolved.isErr()) return err(resolved.error);\n const { definition, validatedInput, typedSearchAttributes } = resolved.value;\n\n try {\n const handle = await this.client.workflow.start(workflowName, {\n ...temporalOptions,\n taskQueue: this.contract.taskQueue,\n args: [validatedInput],\n ...(typedSearchAttributes ? { typedSearchAttributes } : {}),\n });\n return ok(this.createTypedHandle(handle, definition) as Ok);\n } catch (error) {\n return err(classifyStartError(\"startWorkflow\", error));\n }\n };\n return makeResultAsync(work);\n }\n\n /**\n * Send a signal to a workflow, starting it first if it doesn't already exist.\n *\n * Validates both halves of the call against the contract:\n * - `args` against the workflow's input schema\n * - `signalArgs` against the named signal's input schema\n *\n * Returns a `TypedWorkflowHandleWithSignaledRunId` — the same shape as\n * `startWorkflow`'s handle, plus a `signaledRunId` field for correlating\n * the signal with the (possibly pre-existing) workflow execution chain.\n *\n * @example\n * ```ts\n * const result = await client.signalWithStart('processOrder', {\n * workflowId: 'order-123',\n * args: { orderId: 'ORD-123', customerId: 'CUST-1' },\n * signalName: 'cancel',\n * signalArgs: { reason: 'duplicate' },\n * });\n *\n * result.match(\n * (handle) => console.log('signaled run', handle.signaledRunId),\n * (error) => console.error('signalWithStart failed', error),\n * );\n * ```\n */\n signalWithStart<\n TWorkflowName extends keyof TContract[\"workflows\"] & string,\n TSignalName extends SignalNamesOf<TContract[\"workflows\"][TWorkflowName]>,\n >(\n workflowName: TWorkflowName,\n {\n args,\n signalName,\n signalArgs,\n searchAttributes,\n ...temporalOptions\n }: TypedSignalWithStartOptions<TContract, TWorkflowName, TSignalName>,\n ): ResultAsync<\n TypedWorkflowHandleWithSignaledRunId<TContract[\"workflows\"][TWorkflowName]>,\n | WorkflowNotFoundError\n | WorkflowValidationError\n | SignalValidationError\n | WorkflowAlreadyStartedError\n | RuntimeClientError\n > {\n type Ok = TypedWorkflowHandleWithSignaledRunId<TContract[\"workflows\"][TWorkflowName]>;\n type Err =\n | WorkflowNotFoundError\n | WorkflowValidationError\n | SignalValidationError\n | WorkflowAlreadyStartedError\n | RuntimeClientError;\n\n const work = async (): Promise<Result<Ok, Err>> => {\n const resolved = await resolveDefinitionAndValidateInput(\n this.contract,\n workflowName,\n args,\n searchAttributes as Record<string, unknown> | undefined,\n );\n if (resolved.isErr()) return err(resolved.error);\n const { definition, validatedInput, typedSearchAttributes } = resolved.value;\n\n // Validate signal input — call-site-specific, kept inline.\n const signalDef = (definition.signals as Record<string, SignalDefinition> | undefined)?.[\n signalName\n ];\n if (!signalDef) {\n // Type-level constraint should already prevent this; defensive for\n // raw-call / union-typed-name corner cases.\n return err(\n new SignalValidationError(signalName, [\n {\n message: `Signal \"${signalName}\" is not declared on workflow \"${workflowName}\".`,\n },\n ]),\n );\n }\n const signalInputResult = await signalDef.input[\"~standard\"].validate(signalArgs);\n if (signalInputResult.issues) {\n return err(new SignalValidationError(signalName, signalInputResult.issues));\n }\n\n try {\n const handle = await this.client.workflow.signalWithStart(workflowName, {\n ...temporalOptions,\n taskQueue: this.contract.taskQueue,\n args: [validatedInput],\n signal: signalName,\n signalArgs: [signalInputResult.value],\n ...(typedSearchAttributes ? { typedSearchAttributes } : {}),\n });\n const typed = this.createTypedHandle(handle, definition) as TypedWorkflowHandle<\n TContract[\"workflows\"][TWorkflowName]\n >;\n return ok({ ...typed, signaledRunId: handle.signaledRunId } as Ok);\n } catch (error) {\n return err(classifyStartError(\"signalWithStart\", error));\n }\n };\n return makeResultAsync(work);\n }\n\n /**\n * Execute a workflow (start and wait for result) with ResultAsync pattern\n *\n * @example\n * ```ts\n * const result = await client.executeWorkflow('processOrder', {\n * workflowId: 'order-123',\n * args: { orderId: 'ORD-123' },\n * workflowExecutionTimeout: '1 day',\n * retry: { maximumAttempts: 3 },\n * });\n *\n * result.match(\n * (output) => console.log('Order processed:', output.status),\n * (error) => console.error('Processing failed:', error),\n * );\n * ```\n */\n executeWorkflow<TWorkflowName extends keyof TContract[\"workflows\"] & string>(\n workflowName: TWorkflowName,\n {\n args,\n searchAttributes,\n ...temporalOptions\n }: TypedWorkflowStartOptions<TContract, TWorkflowName>,\n ): ResultAsync<\n ClientInferOutput<TContract[\"workflows\"][TWorkflowName]>,\n | WorkflowNotFoundError\n | WorkflowValidationError\n | WorkflowAlreadyStartedError\n | WorkflowFailedError\n | WorkflowExecutionNotFoundError\n | RuntimeClientError\n > {\n type Ok = ClientInferOutput<TContract[\"workflows\"][TWorkflowName]>;\n type Err =\n | WorkflowNotFoundError\n | WorkflowValidationError\n | WorkflowAlreadyStartedError\n | WorkflowFailedError\n | WorkflowExecutionNotFoundError\n | RuntimeClientError;\n const work = async (): Promise<Result<Ok, Err>> => {\n const resolved = await resolveDefinitionAndValidateInput(\n this.contract,\n workflowName,\n args,\n searchAttributes as Record<string, unknown> | undefined,\n );\n if (resolved.isErr()) return err(resolved.error);\n const { definition, validatedInput, typedSearchAttributes } = resolved.value;\n\n try {\n const result = await this.client.workflow.execute(workflowName, {\n ...temporalOptions,\n taskQueue: this.contract.taskQueue,\n args: [validatedInput],\n ...(typedSearchAttributes ? { typedSearchAttributes } : {}),\n });\n\n // Output validation runs *after* the Temporal call returns — kept\n // inline because it's specific to executeWorkflow's start-and-wait\n // shape; the helper only handles pre-call concerns.\n const outputResult = await definition.output[\"~standard\"].validate(result);\n if (outputResult.issues) {\n return err(createWorkflowValidationError(workflowName, \"output\", outputResult.issues));\n }\n\n return ok(outputResult.value as Ok);\n } catch (error) {\n // executeWorkflow combines start + result, so it can surface any of\n // the discriminated kinds. Inline the three checks rather than\n // routing through a dedicated helper — this is the only call site\n // that needs the full union.\n if (error instanceof WorkflowExecutionAlreadyStartedError) {\n return err(new WorkflowAlreadyStartedError(error.workflowType, error.workflowId, error));\n }\n if (error instanceof TemporalWorkflowFailedError) {\n // Forward Temporal's nested cause directly — see\n // {@link classifyResultError} for the same rationale: Temporal's\n // `WorkflowFailedError` is a wrapper, and the actionable failure\n // (ApplicationFailure, CancelledFailure, etc.) lives on `.cause`.\n // Temporal types `cause` as `Error | undefined`, but the SDK only\n // ever populates it with a `TemporalFailure` subclass here; narrow\n // with the public union so the typed `cause` lines up with the\n // surfaced `WorkflowFailedError`.\n return err(\n new WorkflowFailedError(\n temporalOptions.workflowId,\n error.cause as TemporalFailure | undefined,\n ),\n );\n }\n if (error instanceof TemporalWorkflowNotFoundError) {\n return err(\n new WorkflowExecutionNotFoundError(\n error.workflowId || temporalOptions.workflowId,\n error.runId,\n error,\n ),\n );\n }\n return err(createRuntimeClientError(\"executeWorkflow\", error));\n }\n };\n return makeResultAsync(work);\n }\n\n /**\n * Get a handle to an existing workflow with ResultAsync pattern\n *\n * @example\n * ```ts\n * const handleResult = await client.getHandle('processOrder', 'order-123');\n * handleResult.match(\n * async (handle) => {\n * const result = await handle.result();\n * // ... handle result\n * },\n * (error) => console.error('Failed to get handle:', error),\n * );\n * ```\n */\n getHandle<TWorkflowName extends keyof TContract[\"workflows\"] & string>(\n workflowName: TWorkflowName,\n workflowId: string,\n ): ResultAsync<\n TypedWorkflowHandle<TContract[\"workflows\"][TWorkflowName]>,\n WorkflowNotFoundError | RuntimeClientError\n > {\n type Ok = TypedWorkflowHandle<TContract[\"workflows\"][TWorkflowName]>;\n type Err = WorkflowNotFoundError | RuntimeClientError;\n const work = async (): Promise<Result<Ok, Err>> => {\n const definition = this.contract.workflows[workflowName];\n if (!definition) {\n return err(createWorkflowNotFoundError(workflowName, this.contract));\n }\n\n try {\n const handle = this.client.workflow.getHandle(workflowId);\n return ok(this.createTypedHandle(handle, definition) as Ok);\n } catch (error) {\n return err(createRuntimeClientError(\"getHandle\", error));\n }\n };\n return makeResultAsync(work);\n }\n\n private createTypedHandle<TWorkflow extends AnyWorkflowDefinition>(\n workflowHandle: WorkflowHandle,\n definition: TWorkflow,\n ): TypedWorkflowHandle<TWorkflow> {\n const queries = buildValidatedProxy({\n defs: definition.queries,\n operation: \"query\",\n workflowId: workflowHandle.workflowId,\n makeValidationError: (name, direction, issues) =>\n new QueryValidationError(name, direction, issues),\n invoke: (name, validated) => workflowHandle.query(name, validated),\n validateOutput: (def) => def.output,\n }) as TypedWorkflowHandle<TWorkflow>[\"queries\"];\n\n const signals = buildValidatedProxy({\n defs: definition.signals,\n operation: \"signal\",\n workflowId: workflowHandle.workflowId,\n makeValidationError: (name, _direction, issues) => new SignalValidationError(name, issues),\n invoke: async (name, validated) => {\n await workflowHandle.signal(name, validated);\n return undefined;\n },\n validateOutput: () => null,\n }) as TypedWorkflowHandle<TWorkflow>[\"signals\"];\n\n const updates = buildValidatedProxy({\n defs: definition.updates,\n operation: \"update\",\n workflowId: workflowHandle.workflowId,\n makeValidationError: (name, direction, issues) =>\n new UpdateValidationError(name, direction, issues),\n invoke: (name, validated) => workflowHandle.executeUpdate(name, { args: [validated] }),\n validateOutput: (def) => def.output,\n }) as TypedWorkflowHandle<TWorkflow>[\"updates\"];\n\n return {\n workflowId: workflowHandle.workflowId,\n queries,\n signals,\n updates,\n result: (): ResultAsync<\n ClientInferOutput<TWorkflow>,\n | WorkflowValidationError\n | WorkflowFailedError\n | WorkflowExecutionNotFoundError\n | RuntimeClientError\n > => {\n type Ok = ClientInferOutput<TWorkflow>;\n type Err =\n | WorkflowValidationError\n | WorkflowFailedError\n | WorkflowExecutionNotFoundError\n | RuntimeClientError;\n const work = async (): Promise<Result<Ok, Err>> => {\n try {\n const result = await workflowHandle.result();\n const outputResult = await definition.output[\"~standard\"].validate(result);\n if (outputResult.issues) {\n return err(\n new WorkflowValidationError(\n workflowHandle.workflowId,\n \"output\",\n outputResult.issues,\n ),\n );\n }\n return ok(outputResult.value as Ok);\n } catch (error) {\n return err(classifyResultError(\"result\", error, workflowHandle.workflowId));\n }\n };\n return makeResultAsync(work);\n },\n terminate: (\n reason?: string,\n ): ResultAsync<void, WorkflowExecutionNotFoundError | RuntimeClientError> =>\n ResultAsync.fromPromise(workflowHandle.terminate(reason), (error) =>\n classifyHandleError(\"terminate\", error, workflowHandle.workflowId),\n ).map(() => undefined),\n cancel: (): ResultAsync<void, WorkflowExecutionNotFoundError | RuntimeClientError> =>\n ResultAsync.fromPromise(workflowHandle.cancel(), (error) =>\n classifyHandleError(\"cancel\", error, workflowHandle.workflowId),\n ).map(() => undefined),\n describe: (): ResultAsync<\n Awaited<ReturnType<WorkflowHandle[\"describe\"]>>,\n WorkflowExecutionNotFoundError | RuntimeClientError\n > =>\n ResultAsync.fromPromise(workflowHandle.describe(), (error) =>\n classifyHandleError(\"describe\", error, workflowHandle.workflowId),\n ),\n fetchHistory: (): ResultAsync<\n Awaited<ReturnType<WorkflowHandle[\"fetchHistory\"]>>,\n WorkflowExecutionNotFoundError | RuntimeClientError\n > =>\n ResultAsync.fromPromise(workflowHandle.fetchHistory(), (error) =>\n classifyHandleError(\"fetchHistory\", error, workflowHandle.workflowId),\n ),\n };\n }\n}\n\nfunction createRuntimeClientError(operation: string, error: unknown): RuntimeClientError {\n return new RuntimeClientError(operation, error);\n}\n\nfunction createWorkflowNotFoundError(\n workflowName: string | number | symbol,\n contract: ContractDefinition,\n): WorkflowNotFoundError {\n return new WorkflowNotFoundError(String(workflowName), Object.keys(contract.workflows));\n}\n\nfunction createWorkflowValidationError(\n workflowName: string | number | symbol,\n direction: \"input\" | \"output\",\n issues: ReadonlyArray<StandardSchemaV1.Issue>,\n): WorkflowValidationError {\n return new WorkflowValidationError(String(workflowName), direction, issues);\n}\n\ntype DefWithInput = { readonly input: StandardSchemaV1 };\n\ntype ProxyOptions<TDef extends DefWithInput, TValidationError extends Error> = {\n readonly defs: Record<string, TDef> | undefined;\n readonly operation: string;\n /**\n * Workflow ID of the handle these proxies bind to. Used by\n * {@link classifyHandleError} to surface\n * {@link WorkflowExecutionNotFoundError} with the targeted ID even when\n * Temporal's error doesn't carry it.\n */\n readonly workflowId: string;\n readonly makeValidationError: (\n name: string,\n direction: \"input\" | \"output\",\n issues: ReadonlyArray<StandardSchemaV1.Issue>,\n ) => TValidationError;\n readonly invoke: (name: string, validatedInput: unknown) => Promise<unknown>;\n /**\n * Returns the schema to validate the invoke result against, or `null` to skip\n * output validation (used by signals, which don't return a value).\n */\n readonly validateOutput: (def: TDef) => StandardSchemaV1 | null;\n};\n\n/**\n * Build a `{ name: (args) => ResultAsync<...> }` proxy for a contract's\n * queries/signals/updates. The three call sites differ only in how they\n * invoke Temporal and whether they validate output, so the shared\n * input-validate → invoke → output-validate → wrap-Result pipeline lives\n * here once.\n */\nfunction buildValidatedProxy<TDef extends DefWithInput, TValidationError extends Error>({\n defs,\n operation,\n workflowId,\n makeValidationError,\n invoke,\n validateOutput,\n}: ProxyOptions<TDef, TValidationError>): Record<\n string,\n (\n args: unknown,\n ) => ResultAsync<unknown, TValidationError | WorkflowExecutionNotFoundError | RuntimeClientError>\n> {\n const proxy: Record<\n string,\n (\n args: unknown,\n ) => ResultAsync<\n unknown,\n TValidationError | WorkflowExecutionNotFoundError | RuntimeClientError\n >\n > = {};\n if (!defs) return proxy;\n\n for (const [name, def] of Object.entries(defs)) {\n proxy[name] = (args) => {\n const work = async (): Promise<\n Result<unknown, TValidationError | WorkflowExecutionNotFoundError | RuntimeClientError>\n > => {\n const inputResult = await def.input[\"~standard\"].validate(args);\n if (inputResult.issues) {\n return err(makeValidationError(name, \"input\", inputResult.issues));\n }\n\n try {\n const result = await invoke(name, inputResult.value);\n const outputSchema = validateOutput(def);\n if (!outputSchema) {\n return ok(result);\n }\n const outputResult = await outputSchema[\"~standard\"].validate(result);\n if (outputResult.issues) {\n return err(makeValidationError(name, \"output\", outputResult.issues));\n }\n return ok(outputResult.value);\n } catch (error) {\n return err(classifyHandleError(operation, error, workflowId));\n }\n };\n return makeResultAsync(work);\n };\n }\n\n return proxy;\n}\n"],"mappings":";;;;;;;;;AAkCA,IAAe,mBAAf,cAAwC,MAAM;CAC5C,YAAsB,SAAiB;EACrC,MAAM,OAAO;EACb,KAAK,OAAO,KAAK,YAAY;EAC7B,IAAI,MAAM,mBACR,MAAM,kBAAkB,MAAM,KAAK,WAAW;CAElD;AACF;;;;AAKA,IAAa,qBAAb,cAAwC,iBAAiB;CAErC;CACS;CAF3B,YACE,WACA,OACA;EACA,MACE,cAAc,UAAU,YACtB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,SAAS,eAAe,GAE5E;EAPgB,KAAA,YAAA;EACS,KAAA,QAAA;CAO3B;AACF;;;;AAKA,IAAa,wBAAb,cAA2C,iBAAiB;CAExC;CACA;CAFlB,YACE,cACA,oBACA;EACA,MACE,aAAa,aAAa,gDAAgD,mBAAmB,KAAK,IAAI,GACxG;EALgB,KAAA,eAAA;EACA,KAAA,qBAAA;CAKlB;AACF;;;;;;;;;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
4
4
  "description": "Client utilities with neverthrow Result/ResultAsync for consuming temporal-contract workflows",
5
5
  "keywords": [
6
6
  "client",
@@ -43,28 +43,28 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@standard-schema/spec": "1.1.0",
46
- "@temporal-contract/contract": "2.2.0"
46
+ "@temporal-contract/contract": "2.3.1"
47
47
  },
48
48
  "devDependencies": {
49
- "@temporalio/client": "1.17.0",
50
- "@temporalio/common": "1.17.0",
51
- "@temporalio/worker": "1.17.0",
52
- "@temporalio/workflow": "1.17.0",
53
- "@types/node": "24.12.2",
54
- "@vitest/coverage-v8": "4.1.5",
49
+ "@temporalio/client": "1.18.0",
50
+ "@temporalio/common": "1.18.0",
51
+ "@temporalio/worker": "1.18.0",
52
+ "@temporalio/workflow": "1.18.0",
53
+ "@types/node": "24.13.1",
54
+ "@vitest/coverage-v8": "4.1.8",
55
55
  "neverthrow": "8.2.0",
56
- "tsdown": "0.21.10",
56
+ "tsdown": "0.22.2",
57
57
  "typedoc": "0.28.19",
58
- "typedoc-plugin-markdown": "4.11.0",
58
+ "typedoc-plugin-markdown": "4.12.0",
59
59
  "typescript": "6.0.3",
60
- "vitest": "4.1.5",
60
+ "vitest": "4.1.8",
61
61
  "zod": "4.4.3",
62
- "@temporal-contract/testing": "2.2.0",
63
- "@temporal-contract/tsconfig": "1.0.0",
64
- "@temporal-contract/typedoc": "0.1.0"
62
+ "@temporal-contract/testing": "2.3.1",
63
+ "@temporal-contract/typedoc": "0.1.0",
64
+ "@temporal-contract/tsconfig": "1.0.0"
65
65
  },
66
66
  "peerDependencies": {
67
- "@temporalio/client": "^1.16.0",
67
+ "@temporalio/client": "^1",
68
68
  "@temporalio/common": "^1",
69
69
  "neverthrow": "^8"
70
70
  },