terse-types 0.0.53 → 0.0.55

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/types.d.ts CHANGED
@@ -1446,6 +1446,7 @@ export declare const runHistoryRecordSchema: z.ZodObject<{
1446
1446
  readonly SKIPPED: "skipped";
1447
1447
  readonly IN_PROGRESS: "in_progress";
1448
1448
  readonly AWAITING_APPROVAL: "awaiting_approval";
1449
+ readonly SUSPENDED: "suspended";
1449
1450
  }>;
1450
1451
  isManuallyTriggered: z.ZodBoolean;
1451
1452
  isTest: z.ZodOptional<z.ZodBoolean>;
@@ -1501,6 +1502,7 @@ export declare const runHistoryRecordWithAgentSchema: z.ZodObject<{
1501
1502
  readonly SKIPPED: "skipped";
1502
1503
  readonly IN_PROGRESS: "in_progress";
1503
1504
  readonly AWAITING_APPROVAL: "awaiting_approval";
1505
+ readonly SUSPENDED: "suspended";
1504
1506
  }>;
1505
1507
  isManuallyTriggered: z.ZodBoolean;
1506
1508
  isTest: z.ZodOptional<z.ZodBoolean>;
@@ -3978,6 +3980,7 @@ export declare const statsResponseSchema: z.ZodObject<{
3978
3980
  readonly SKIPPED: "skipped";
3979
3981
  readonly IN_PROGRESS: "in_progress";
3980
3982
  readonly AWAITING_APPROVAL: "awaiting_approval";
3983
+ readonly SUSPENDED: "suspended";
3981
3984
  }>;
3982
3985
  isManuallyTriggered: z.ZodBoolean;
3983
3986
  isTest: z.ZodOptional<z.ZodBoolean>;
@@ -8454,6 +8457,72 @@ export declare const sdkApprovalDecisionRequestBodySchema: z.ZodObject<{
8454
8457
  approved: z.ZodBoolean;
8455
8458
  }, z.core.$strip>;
8456
8459
  export type SdkApprovalDecisionRequestBody = z.infer<typeof sdkApprovalDecisionRequestBodySchema>;
8460
+ export declare const sdkJobSuspendRequestBodySchema: z.ZodObject<{
8461
+ runId: z.ZodString;
8462
+ name: z.ZodString;
8463
+ delaySeconds: z.ZodNumber;
8464
+ idempotencyKey: z.ZodOptional<z.ZodString>;
8465
+ }, z.core.$strip>;
8466
+ export type SdkJobSuspendRequestBody = z.infer<typeof sdkJobSuspendRequestBodySchema>;
8467
+ export declare const sdkJobSuspendResponseBodySchema: z.ZodObject<{
8468
+ success: z.ZodBoolean;
8469
+ }, z.core.$strip>;
8470
+ export type SdkJobSuspendResponseBody = z.infer<typeof sdkJobSuspendResponseBodySchema>;
8471
+ export declare const sdkInputRequestOptionSchema: z.ZodObject<{
8472
+ id: z.ZodString;
8473
+ label: z.ZodString;
8474
+ description: z.ZodOptional<z.ZodString>;
8475
+ freeText: z.ZodOptional<z.ZodBoolean>;
8476
+ }, z.core.$strip>;
8477
+ export type SdkInputRequestOption = z.infer<typeof sdkInputRequestOptionSchema>;
8478
+ export declare const sdkInputRequestTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
8479
+ provider: z.ZodLiteral<"slack">;
8480
+ channelId: z.ZodString;
8481
+ }, z.core.$strip>], "provider">;
8482
+ export type SdkInputRequestTarget = z.infer<typeof sdkInputRequestTargetSchema>;
8483
+ export declare const sdkInputRequestRegisterBodySchema: z.ZodObject<{
8484
+ token: z.ZodString;
8485
+ runId: z.ZodString;
8486
+ prompt: z.ZodString;
8487
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
8488
+ options: z.ZodArray<z.ZodObject<{
8489
+ id: z.ZodString;
8490
+ label: z.ZodString;
8491
+ description: z.ZodOptional<z.ZodString>;
8492
+ freeText: z.ZodOptional<z.ZodBoolean>;
8493
+ }, z.core.$strip>>;
8494
+ via: z.ZodDiscriminatedUnion<[z.ZodObject<{
8495
+ provider: z.ZodLiteral<"slack">;
8496
+ channelId: z.ZodString;
8497
+ }, z.core.$strip>], "provider">;
8498
+ }, z.core.$strip>;
8499
+ export type SdkInputRequestRegisterBody = z.infer<typeof sdkInputRequestRegisterBodySchema>;
8500
+ export declare const sdkInputRequestDeliverySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
8501
+ provider: z.ZodLiteral<"slack">;
8502
+ channelId: z.ZodString;
8503
+ messageTs: z.ZodString;
8504
+ }, z.core.$strip>], "provider">;
8505
+ export type SdkInputRequestDelivery = z.infer<typeof sdkInputRequestDeliverySchema>;
8506
+ export declare const sdkInputRequestRegisterResponseSchema: z.ZodObject<{
8507
+ success: z.ZodBoolean;
8508
+ delivery: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
8509
+ provider: z.ZodLiteral<"slack">;
8510
+ channelId: z.ZodString;
8511
+ messageTs: z.ZodString;
8512
+ }, z.core.$strip>], "provider">>;
8513
+ error: z.ZodOptional<z.ZodString>;
8514
+ }, z.core.$strip>;
8515
+ export type SdkInputRequestRegisterResponse = z.infer<typeof sdkInputRequestRegisterResponseSchema>;
8516
+ export declare const sdkInputResponsePayloadSchema: z.ZodObject<{
8517
+ choice: z.ZodString;
8518
+ text: z.ZodOptional<z.ZodString>;
8519
+ respondent: z.ZodObject<{
8520
+ provider: z.ZodString;
8521
+ userId: z.ZodString;
8522
+ displayName: z.ZodOptional<z.ZodString>;
8523
+ }, z.core.$strip>;
8524
+ }, z.core.$strip>;
8525
+ export type SdkInputResponsePayload = z.infer<typeof sdkInputResponsePayloadSchema>;
8457
8526
  export declare const sdkCreateProjectRequestBodySchema: z.ZodObject<{
8458
8527
  name: z.ZodString;
8459
8528
  }, z.core.$strip>;
package/dist/types.js CHANGED
@@ -499,6 +499,58 @@ export const sdkApprovalDecisionRequestBodySchema = z.object({
499
499
  stepId: z.string(),
500
500
  approved: z.boolean()
501
501
  });
502
+ const validQueueNameSchema = z.string().regex(/^__(?:[a-z][a-z0-9]*_)?wkf_(?:workflow|step)_.+$/, "Must be a valid queue name with a recognized prefix");
503
+ export const sdkJobSuspendRequestBodySchema = z.object({
504
+ runId: z.string().min(1),
505
+ name: validQueueNameSchema,
506
+ delaySeconds: z.number().int().positive(),
507
+ idempotencyKey: z.string().min(1).optional()
508
+ });
509
+ export const sdkJobSuspendResponseBodySchema = z.object({
510
+ success: z.boolean()
511
+ });
512
+ export const sdkInputRequestOptionSchema = z.object({
513
+ id: z.string().min(1),
514
+ label: z.string().min(1),
515
+ description: z.string().optional(),
516
+ freeText: z.boolean().optional()
517
+ });
518
+ export const sdkInputRequestTargetSchema = z.discriminatedUnion("provider", [
519
+ z.object({
520
+ provider: z.literal("slack"),
521
+ channelId: z.string().min(1)
522
+ })
523
+ ]);
524
+ export const sdkInputRequestRegisterBodySchema = z.object({
525
+ token: z.string().min(1),
526
+ runId: z.string().min(1),
527
+ prompt: z.string().min(1),
528
+ details: z.record(z.string(), z.string()).optional(),
529
+ options: z.array(sdkInputRequestOptionSchema).min(1),
530
+ via: sdkInputRequestTargetSchema
531
+ });
532
+ // One member per input provider; adding a provider extends this union and the target union above.
533
+ export const sdkInputRequestDeliverySchema = z.discriminatedUnion("provider", [
534
+ z.object({
535
+ provider: z.literal("slack"),
536
+ channelId: z.string().min(1),
537
+ messageTs: z.string().min(1)
538
+ })
539
+ ]);
540
+ export const sdkInputRequestRegisterResponseSchema = z.object({
541
+ success: z.boolean(),
542
+ delivery: sdkInputRequestDeliverySchema.optional(),
543
+ error: z.string().optional()
544
+ });
545
+ export const sdkInputResponsePayloadSchema = z.object({
546
+ choice: z.string().min(1),
547
+ text: z.string().optional(),
548
+ respondent: z.object({
549
+ provider: z.string(),
550
+ userId: z.string(),
551
+ displayName: z.string().optional()
552
+ })
553
+ });
502
554
  export const sdkCreateProjectRequestBodySchema = z.object({
503
555
  name: z.string().min(1)
504
556
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terse-types",
3
- "version": "0.0.53",
3
+ "version": "0.0.55",
4
4
  "type": "module",
5
5
  "description": "Shared Terse TypeScript types, enums, constants, and helpers.",
6
6
  "main": "./dist/index.js",
package/dist/Events.d.ts DELETED
@@ -1,112 +0,0 @@
1
- import { z } from "zod";
2
- export declare const eventTypeSchema: z.ZodEnum<{
3
- JOB_CREATED: "JOB_CREATED";
4
- AUTOMATION_RAN: "AUTOMATION_RAN";
5
- }>;
6
- export type EventType = z.infer<typeof eventTypeSchema>;
7
- declare const jobCreatedEventSchema: z.ZodObject<{
8
- eventType: z.ZodLiteral<"JOB_CREATED">;
9
- jobId: z.ZodString;
10
- }, z.core.$strip>;
11
- export type JobCreatedEvent = z.infer<typeof jobCreatedEventSchema>;
12
- declare const automationSnapshotSchema: z.ZodObject<{
13
- id: z.ZodString;
14
- name: z.ZodString;
15
- organizationId: z.ZodString;
16
- projectId: z.ZodString;
17
- userId: z.ZodString;
18
- requireApproval: z.ZodBoolean;
19
- }, z.core.$strip>;
20
- export type AutomationSnapshot = z.infer<typeof automationSnapshotSchema>;
21
- declare const runSnapshotSchema: z.ZodObject<{
22
- id: z.ZodString;
23
- status: z.ZodEnum<{
24
- readonly SUCCESS: "success";
25
- readonly FAILED: "failed";
26
- readonly CANCELLED: "cancelled";
27
- readonly SKIPPED: "skipped";
28
- readonly IN_PROGRESS: "in_progress";
29
- readonly AWAITING_APPROVAL: "awaiting_approval";
30
- }>;
31
- isManuallyTriggered: z.ZodBoolean;
32
- startedAt: z.ZodString;
33
- trigger: z.ZodObject<{
34
- event: z.ZodString;
35
- integration: z.ZodEnum<typeof import("./Integrations.js").IntegrationType>;
36
- source: z.ZodString;
37
- title: z.ZodOptional<z.ZodString>;
38
- subheader: z.ZodOptional<z.ZodString>;
39
- url: z.ZodOptional<z.ZodString>;
40
- }, z.core.$strip>;
41
- }, z.core.$strip>;
42
- export type RunSnapshot = z.infer<typeof runSnapshotSchema>;
43
- declare const automationRanEventSchema: z.ZodObject<{
44
- eventType: z.ZodLiteral<"AUTOMATION_RAN">;
45
- automation: z.ZodObject<{
46
- id: z.ZodString;
47
- name: z.ZodString;
48
- organizationId: z.ZodString;
49
- projectId: z.ZodString;
50
- userId: z.ZodString;
51
- requireApproval: z.ZodBoolean;
52
- }, z.core.$strip>;
53
- run: z.ZodObject<{
54
- id: z.ZodString;
55
- status: z.ZodEnum<{
56
- readonly SUCCESS: "success";
57
- readonly FAILED: "failed";
58
- readonly CANCELLED: "cancelled";
59
- readonly SKIPPED: "skipped";
60
- readonly IN_PROGRESS: "in_progress";
61
- readonly AWAITING_APPROVAL: "awaiting_approval";
62
- }>;
63
- isManuallyTriggered: z.ZodBoolean;
64
- startedAt: z.ZodString;
65
- trigger: z.ZodObject<{
66
- event: z.ZodString;
67
- integration: z.ZodEnum<typeof import("./Integrations.js").IntegrationType>;
68
- source: z.ZodString;
69
- title: z.ZodOptional<z.ZodString>;
70
- subheader: z.ZodOptional<z.ZodString>;
71
- url: z.ZodOptional<z.ZodString>;
72
- }, z.core.$strip>;
73
- }, z.core.$strip>;
74
- }, z.core.$strip>;
75
- export type AutomationRanEvent = z.infer<typeof automationRanEventSchema>;
76
- export declare const domainEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
77
- eventType: z.ZodLiteral<"JOB_CREATED">;
78
- jobId: z.ZodString;
79
- }, z.core.$strip>, z.ZodObject<{
80
- eventType: z.ZodLiteral<"AUTOMATION_RAN">;
81
- automation: z.ZodObject<{
82
- id: z.ZodString;
83
- name: z.ZodString;
84
- organizationId: z.ZodString;
85
- projectId: z.ZodString;
86
- userId: z.ZodString;
87
- requireApproval: z.ZodBoolean;
88
- }, z.core.$strip>;
89
- run: z.ZodObject<{
90
- id: z.ZodString;
91
- status: z.ZodEnum<{
92
- readonly SUCCESS: "success";
93
- readonly FAILED: "failed";
94
- readonly CANCELLED: "cancelled";
95
- readonly SKIPPED: "skipped";
96
- readonly IN_PROGRESS: "in_progress";
97
- readonly AWAITING_APPROVAL: "awaiting_approval";
98
- }>;
99
- isManuallyTriggered: z.ZodBoolean;
100
- startedAt: z.ZodString;
101
- trigger: z.ZodObject<{
102
- event: z.ZodString;
103
- integration: z.ZodEnum<typeof import("./Integrations.js").IntegrationType>;
104
- source: z.ZodString;
105
- title: z.ZodOptional<z.ZodString>;
106
- subheader: z.ZodOptional<z.ZodString>;
107
- url: z.ZodOptional<z.ZodString>;
108
- }, z.core.$strip>;
109
- }, z.core.$strip>;
110
- }, z.core.$strip>], "eventType">;
111
- export type DomainEvent = z.infer<typeof domainEventSchema>;
112
- export {};
package/dist/Events.js DELETED
@@ -1,32 +0,0 @@
1
- import { z } from "zod";
2
- import { runHistoryStatusSchema } from "./RunHistoryTypes.js";
3
- import { runHistoryTriggerSchema } from "./types.js";
4
- export const eventTypeSchema = z.enum(["JOB_CREATED", "AUTOMATION_RAN"]);
5
- const baseEventSchema = z.object({
6
- eventType: eventTypeSchema
7
- });
8
- const jobCreatedEventSchema = baseEventSchema.extend({
9
- eventType: z.literal("JOB_CREATED"),
10
- jobId: z.string()
11
- });
12
- const automationSnapshotSchema = z.object({
13
- id: z.string(),
14
- name: z.string(),
15
- organizationId: z.string(),
16
- projectId: z.string(),
17
- userId: z.string(),
18
- requireApproval: z.boolean()
19
- });
20
- const runSnapshotSchema = z.object({
21
- id: z.string(),
22
- status: runHistoryStatusSchema,
23
- isManuallyTriggered: z.boolean(),
24
- startedAt: z.string().datetime(),
25
- trigger: runHistoryTriggerSchema
26
- });
27
- const automationRanEventSchema = baseEventSchema.extend({
28
- eventType: z.literal("AUTOMATION_RAN"),
29
- automation: automationSnapshotSchema,
30
- run: runSnapshotSchema
31
- });
32
- export const domainEventSchema = z.discriminatedUnion("eventType", [jobCreatedEventSchema, automationRanEventSchema]);