@catamorphic/fastify-plugin 0.1.0-alpha.31 → 0.1.0-alpha.33
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.js +39 -2
- package/dist/index.js.map +4 -4
- package/dist/routes/workflows.d.ts.map +1 -1
- package/dist/schemas.d.ts +173 -2
- package/dist/schemas.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/routes/workflows.ts +11 -4
- package/src/schemas.ts +30 -0
package/dist/index.js
CHANGED
|
@@ -853,11 +853,32 @@ var RunsQuerySchema = PaginationQuerySchema.extend({
|
|
|
853
853
|
correlationKey: CorrelationKeySchema.optional()
|
|
854
854
|
});
|
|
855
855
|
var SignalRunSchema = z.object({
|
|
856
|
+
runId: z.string().uuid(),
|
|
856
857
|
correlationKey: CorrelationKeySchema,
|
|
857
858
|
signal: z.string().min(1).max(255),
|
|
858
859
|
idempotencyKey: z.string().min(1).max(255),
|
|
859
860
|
value: JsonValueSchema
|
|
860
861
|
});
|
|
862
|
+
var RunSignalReceiptSchema = z.discriminatedUnion("status", [
|
|
863
|
+
z.object({
|
|
864
|
+
id: z.string().uuid(),
|
|
865
|
+
runId: z.string().uuid(),
|
|
866
|
+
status: z.literal("buffered"),
|
|
867
|
+
pauseId: z.null()
|
|
868
|
+
}),
|
|
869
|
+
z.object({
|
|
870
|
+
id: z.string().uuid(),
|
|
871
|
+
runId: z.string().uuid(),
|
|
872
|
+
status: z.literal("resumed"),
|
|
873
|
+
pauseId: z.string().uuid()
|
|
874
|
+
}),
|
|
875
|
+
z.object({
|
|
876
|
+
id: z.string().uuid(),
|
|
877
|
+
runId: z.string().uuid(),
|
|
878
|
+
status: z.literal("discarded"),
|
|
879
|
+
pauseId: z.null()
|
|
880
|
+
})
|
|
881
|
+
]);
|
|
861
882
|
var CancelRunByKeySchema = z.object({
|
|
862
883
|
correlationKey: CorrelationKeySchema,
|
|
863
884
|
reason: z.string().max(1000).optional()
|
|
@@ -1255,6 +1276,12 @@ var TurnErrorSchema = describes()(z.object({
|
|
|
1255
1276
|
kind: z.enum(["auth", "rate_limit", "unavailable", "model_incompat"]).optional(),
|
|
1256
1277
|
retrySafe: z.boolean().optional()
|
|
1257
1278
|
}));
|
|
1279
|
+
var ProviderRetrySchema = z.object({
|
|
1280
|
+
error: TurnErrorSchema.omit({ retrySafe: true }),
|
|
1281
|
+
attempt: z.number().int().positive().nullable(),
|
|
1282
|
+
maxAttempts: z.number().int().positive().nullable(),
|
|
1283
|
+
retryAt: z.string().nullable()
|
|
1284
|
+
});
|
|
1258
1285
|
var AgentTurnUsageSchema = describes()(z.object({
|
|
1259
1286
|
model: z.string().optional(),
|
|
1260
1287
|
inputTokens: z.number().optional(),
|
|
@@ -1295,6 +1322,7 @@ var TurnSchema = describes()(z.object({
|
|
|
1295
1322
|
priority: z.number(),
|
|
1296
1323
|
activity: z.string().nullable(),
|
|
1297
1324
|
activityAt: z.string().nullable(),
|
|
1325
|
+
providerRetry: ProviderRetrySchema.nullable(),
|
|
1298
1326
|
attemptCount: z.number().int(),
|
|
1299
1327
|
activeAttemptId: z.string().nullable(),
|
|
1300
1328
|
providerThreadId: z.string().nullable(),
|
|
@@ -10199,6 +10227,8 @@ import {
|
|
|
10199
10227
|
ProjectNotFoundError as ProjectNotFoundError11,
|
|
10200
10228
|
RunCapabilityError as RunCapabilityError3,
|
|
10201
10229
|
RunResumeConflictError as RunResumeConflictError2,
|
|
10230
|
+
RunSignalInvalidError,
|
|
10231
|
+
RunSignalLimitError,
|
|
10202
10232
|
RunSignalNotFoundError,
|
|
10203
10233
|
WorkflowNotFoundError as WorkflowNotFoundError3
|
|
10204
10234
|
} from "@catamorphic/core";
|
|
@@ -10391,7 +10421,9 @@ function registerWorkflowRoutes(app, ctx) {
|
|
|
10391
10421
|
params: WorkflowNameParamsSchema,
|
|
10392
10422
|
body: SignalRunSchema,
|
|
10393
10423
|
response: {
|
|
10394
|
-
200:
|
|
10424
|
+
200: RunSignalReceiptSchema,
|
|
10425
|
+
400: ErrorSchema,
|
|
10426
|
+
429: ErrorSchema,
|
|
10395
10427
|
404: ErrorSchema,
|
|
10396
10428
|
409: ErrorSchema,
|
|
10397
10429
|
503: ErrorSchema
|
|
@@ -10406,6 +10438,7 @@ function registerWorkflowRoutes(app, ctx) {
|
|
|
10406
10438
|
projectId: request.params.projectId,
|
|
10407
10439
|
workflowName: request.params.name,
|
|
10408
10440
|
correlationKey: request.body.correlationKey,
|
|
10441
|
+
runId: request.body.runId,
|
|
10409
10442
|
signal: request.body.signal,
|
|
10410
10443
|
idempotencyKey: request.body.idempotencyKey,
|
|
10411
10444
|
value: request.body.value
|
|
@@ -10417,6 +10450,10 @@ function registerWorkflowRoutes(app, ctx) {
|
|
|
10417
10450
|
if (err instanceof RunSignalNotFoundError) {
|
|
10418
10451
|
return reply.status(404).send({ error: err.message });
|
|
10419
10452
|
}
|
|
10453
|
+
if (err instanceof RunSignalInvalidError)
|
|
10454
|
+
return reply.status(400).send({ error: err.message });
|
|
10455
|
+
if (err instanceof RunSignalLimitError)
|
|
10456
|
+
return reply.status(429).send({ error: err.message });
|
|
10420
10457
|
if (err instanceof RunResumeConflictError2 || err instanceof RunCapabilityError3) {
|
|
10421
10458
|
return reply.status(409).send({ error: err.message });
|
|
10422
10459
|
}
|
|
@@ -10880,5 +10917,5 @@ export {
|
|
|
10880
10917
|
serveSpaDist
|
|
10881
10918
|
};
|
|
10882
10919
|
|
|
10883
|
-
//# debugId=
|
|
10920
|
+
//# debugId=7A02B8B0343F43C764756E2164756E21
|
|
10884
10921
|
//# sourceMappingURL=index.js.map
|