@heynixie/contract 0.62.0 → 0.64.0

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.
@@ -91,6 +91,8 @@ export declare function buildQueryUtils(client: ContractClient): {
91
91
  error?: string | undefined;
92
92
  errorLimit?: number | undefined;
93
93
  errors?: number | undefined;
94
+ isWaitingForRetry?: boolean | undefined;
95
+ reason?: string | undefined;
94
96
  retryAt?: Date | undefined;
95
97
  stepKey?: string | undefined;
96
98
  taskID: string;
@@ -197,6 +199,8 @@ export declare function buildQueryUtils(client: ContractClient): {
197
199
  error?: string | undefined;
198
200
  errorLimit?: number | undefined;
199
201
  errors?: number | undefined;
202
+ isWaitingForRetry?: boolean | undefined;
203
+ reason?: string | undefined;
200
204
  retryAt?: Date | undefined;
201
205
  stepKey?: string | undefined;
202
206
  taskID: string;
@@ -290,6 +294,28 @@ export declare function buildQueryUtils(client: ContractClient): {
290
294
  timeZone?: string | undefined;
291
295
  writtenAt?: string | undefined;
292
296
  }>;
297
+ retry: import("@orpc/tanstack-query").ProcedureUtils<Record<never, never>, {
298
+ clientActionID: string;
299
+ }, {
300
+ retriedAt: Date;
301
+ }, import("@orpc/contract").ErrorFromErrorMap<import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
302
+ UNAUTHORIZED: {
303
+ message: string;
304
+ status: number;
305
+ };
306
+ }>, {
307
+ CLIENT_ACTION_ID_REUSED: {
308
+ message: string;
309
+ status: number;
310
+ };
311
+ }>, {
312
+ NOTHING_TO_RETRY: {
313
+ message: string;
314
+ status: number;
315
+ };
316
+ }>>> & import("@orpc/tanstack-query").GeneralUtils<{
317
+ clientActionID: string;
318
+ }>;
293
319
  readImage: import("@orpc/tanstack-query").ProcedureUtils<Record<never, never>, {
294
320
  position: number;
295
321
  sequence: number;
@@ -2141,6 +2167,8 @@ export declare function buildQueryUtils(client: ContractClient): {
2141
2167
  error?: string | undefined;
2142
2168
  errorLimit?: number | undefined;
2143
2169
  errors?: number | undefined;
2170
+ isWaitingForRetry?: boolean | undefined;
2171
+ reason?: string | undefined;
2144
2172
  retryAt?: Date | undefined;
2145
2173
  stepKey?: string | undefined;
2146
2174
  taskID: string;
@@ -2262,6 +2290,8 @@ export declare function buildQueryUtils(client: ContractClient): {
2262
2290
  error?: string | undefined;
2263
2291
  errorLimit?: number | undefined;
2264
2292
  errors?: number | undefined;
2293
+ isWaitingForRetry?: boolean | undefined;
2294
+ reason?: string | undefined;
2265
2295
  retryAt?: Date | undefined;
2266
2296
  stepKey?: string | undefined;
2267
2297
  taskID: string;
@@ -111,6 +111,8 @@ export declare const contract: {
111
111
  error: z.ZodOptional<z.ZodString>;
112
112
  errorLimit: z.ZodOptional<z.ZodInt>;
113
113
  errors: z.ZodOptional<z.ZodInt>;
114
+ isWaitingForRetry: z.ZodOptional<z.ZodBoolean>;
115
+ reason: z.ZodOptional<z.ZodString>;
114
116
  retryAt: z.ZodOptional<z.ZodDate>;
115
117
  stepKey: z.ZodOptional<z.ZodString>;
116
118
  taskID: z.ZodString;
@@ -237,6 +239,8 @@ export declare const contract: {
237
239
  error: z.ZodOptional<z.ZodString>;
238
240
  errorLimit: z.ZodOptional<z.ZodInt>;
239
241
  errors: z.ZodOptional<z.ZodInt>;
242
+ isWaitingForRetry: z.ZodOptional<z.ZodBoolean>;
243
+ reason: z.ZodOptional<z.ZodString>;
240
244
  retryAt: z.ZodOptional<z.ZodDate>;
241
245
  stepKey: z.ZodOptional<z.ZodString>;
242
246
  taskID: z.ZodString;
@@ -319,6 +323,26 @@ export declare const contract: {
319
323
  status: number;
320
324
  };
321
325
  }>, Record<never, never>>;
326
+ retry: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
327
+ clientActionID: z.ZodUUID;
328
+ }, z.core.$strip>, z.ZodObject<{
329
+ retriedAt: z.ZodDate;
330
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<import("@orpc/contract").MergedErrorMap<Record<never, never>, {
331
+ UNAUTHORIZED: {
332
+ message: string;
333
+ status: number;
334
+ };
335
+ }>, {
336
+ CLIENT_ACTION_ID_REUSED: {
337
+ message: string;
338
+ status: number;
339
+ };
340
+ }>, {
341
+ NOTHING_TO_RETRY: {
342
+ message: string;
343
+ status: number;
344
+ };
345
+ }>, Record<never, never>>;
322
346
  readImage: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
323
347
  position: z.ZodInt;
324
348
  sequence: z.ZodInt;
@@ -2465,6 +2489,8 @@ export declare const contract: {
2465
2489
  error?: string | undefined;
2466
2490
  errorLimit?: number | undefined;
2467
2491
  errors?: number | undefined;
2492
+ isWaitingForRetry?: boolean | undefined;
2493
+ reason?: string | undefined;
2468
2494
  retryAt?: Date | undefined;
2469
2495
  stepKey?: string | undefined;
2470
2496
  taskID: string;
@@ -2572,6 +2598,8 @@ export declare const contract: {
2572
2598
  error?: string | undefined;
2573
2599
  errorLimit?: number | undefined;
2574
2600
  errors?: number | undefined;
2601
+ isWaitingForRetry?: boolean | undefined;
2602
+ reason?: string | undefined;
2575
2603
  retryAt?: Date | undefined;
2576
2604
  stepKey?: string | undefined;
2577
2605
  taskID: string;
@@ -2690,6 +2718,8 @@ export declare const contract: {
2690
2718
  error?: string | undefined;
2691
2719
  errorLimit?: number | undefined;
2692
2720
  errors?: number | undefined;
2721
+ isWaitingForRetry?: boolean | undefined;
2722
+ reason?: string | undefined;
2693
2723
  retryAt?: Date | undefined;
2694
2724
  stepKey?: string | undefined;
2695
2725
  taskID: string;
@@ -2797,6 +2827,8 @@ export declare const contract: {
2797
2827
  error?: string | undefined;
2798
2828
  errorLimit?: number | undefined;
2799
2829
  errors?: number | undefined;
2830
+ isWaitingForRetry?: boolean | undefined;
2831
+ reason?: string | undefined;
2800
2832
  retryAt?: Date | undefined;
2801
2833
  stepKey?: string | undefined;
2802
2834
  taskID: string;
@@ -166,6 +166,39 @@ export declare const hostContract: {
166
166
  status: number;
167
167
  };
168
168
  }>, Record<never, never>>;
169
+ raise: import("@orpc/contract").ContractProcedureBuilderWithInputOutput<z.ZodObject<{
170
+ taskID: z.ZodString;
171
+ turns: z.ZodOptional<z.ZodInt>;
172
+ dollars: z.ZodOptional<z.ZodNumber>;
173
+ }, z.core.$strict>, z.ZodObject<{
174
+ taskID: z.ZodString;
175
+ state: z.ZodEnum<{
176
+ closed: "closed";
177
+ done: "done";
178
+ failed: "failed";
179
+ paused: "paused";
180
+ ready: "ready";
181
+ running: "running";
182
+ stopped: "stopped";
183
+ waiting: "waiting";
184
+ }>;
185
+ isPauseRequested: z.ZodBoolean;
186
+ turns: z.ZodInt;
187
+ dollars: z.ZodNumber;
188
+ }, z.core.$strip>, import("@orpc/contract").MergedErrorMap<Record<never, never>, {
189
+ TASK_NOT_FOUND: {
190
+ message: string;
191
+ status: number;
192
+ };
193
+ TASK_NOT_AT_LIMIT: {
194
+ message: string;
195
+ status: number;
196
+ };
197
+ LIMIT_NOT_RAISED: {
198
+ message: string;
199
+ status: number;
200
+ };
201
+ }>, Record<never, never>>;
169
202
  };
170
203
  sessions: {
171
204
  issueCode: import("@orpc/contract").ContractProcedureBuilderWithOutput<import("@orpc/contract").Schema<unknown, unknown>, z.ZodObject<{
package/dist/index.js CHANGED
@@ -604,6 +604,8 @@ var taskSchema = z7.object({
604
604
  error: z7.string().optional(),
605
605
  errorLimit: z7.int().positive().optional(),
606
606
  errors: z7.int().positive().optional(),
607
+ isWaitingForRetry: z7.boolean().optional(),
608
+ reason: z7.string().optional(),
607
609
  retryAt: z7.date().optional(),
608
610
  stepKey: z7.string().optional(),
609
611
  taskID: z7.string()
@@ -806,6 +808,12 @@ var contract = {
806
808
  timeZone: z9.string().min(1).max(100).optional(),
807
809
  writtenAt: z9.iso.datetime().optional()
808
810
  })).output(z9.object({ duplicate: z9.boolean(), sequence: sequenceSchema })),
811
+ retry: checkedAction.errors({
812
+ NOTHING_TO_RETRY: {
813
+ message: "The last turn of the conversation did not fail, or it runs again already",
814
+ status: 409
815
+ }
816
+ }).input(z9.object({ clientActionID: clientActionIDSchema })).output(z9.object({ retriedAt: z9.date() })),
809
817
  readImage: signedIn.errors({ IMAGE_NOT_FOUND: imageNotFoundError }).input(imageRefSchema).output(z9.file()),
810
818
  forget: checkedAction.errors({
811
819
  RECORD_NOT_FOUND: {
@@ -1145,7 +1153,24 @@ var hostContract = {
1145
1153
  close: taskControl2.errors({
1146
1154
  CONVERSATION_NEVER_CLOSES: { message: "the conversation is never closed", status: 409 }
1147
1155
  }),
1148
- interrupt: taskControl2
1156
+ interrupt: taskControl2,
1157
+ raise: oc3.errors({
1158
+ TASK_NOT_FOUND: { message: "no task has that ID", status: 404 },
1159
+ TASK_NOT_AT_LIMIT: { message: "the task is not paused at its limit", status: 409 },
1160
+ LIMIT_NOT_RAISED: { message: "the new limits are not above the old ones", status: 409 }
1161
+ }).input(z10.strictObject({
1162
+ taskID: z10.string().min(1),
1163
+ turns: z10.int().positive().optional(),
1164
+ dollars: z10.number().positive().optional()
1165
+ }).refine((input) => input.turns !== undefined || input.dollars !== undefined, {
1166
+ message: "a raise sets turns, dollars or both"
1167
+ })).output(z10.object({
1168
+ taskID: z10.string(),
1169
+ state: hostTaskStateSchema,
1170
+ isPauseRequested: z10.boolean(),
1171
+ turns: z10.int().positive(),
1172
+ dollars: z10.number().positive()
1173
+ }))
1149
1174
  },
1150
1175
  sessions: {
1151
1176
  issueCode: oc3.output(z10.object({ code: z10.string(), expiresAt: z10.date() })),
@@ -3,6 +3,8 @@ export declare const taskSchema: z.ZodObject<{
3
3
  error: z.ZodOptional<z.ZodString>;
4
4
  errorLimit: z.ZodOptional<z.ZodInt>;
5
5
  errors: z.ZodOptional<z.ZodInt>;
6
+ isWaitingForRetry: z.ZodOptional<z.ZodBoolean>;
7
+ reason: z.ZodOptional<z.ZodString>;
6
8
  retryAt: z.ZodOptional<z.ZodDate>;
7
9
  stepKey: z.ZodOptional<z.ZodString>;
8
10
  taskID: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heynixie/contract",
3
- "version": "0.62.0",
3
+ "version": "0.64.0",
4
4
  "description": "The oRPC contract of the nixie API, with the types a client needs",
5
5
  "license": "MIT",
6
6
  "repository": {