terse-types 0.0.12 → 0.0.14

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/Triggers.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { GitHubEventType, WorkOSEventType, gitHubEventTypeSchema, gmailEventTypeSchema, linearEventTypeSchema, slackEventTypeSchema, workOSEventTypeSchema } from "./Configs.js";
2
+ import { GitHubEventType, WorkOSEventType, frequencyUnitSchema, gitHubEventTypeSchema, gmailEventTypeSchema, linearEventTypeSchema, slackEventTypeSchema, workOSEventTypeSchema } from "./Configs.js";
3
3
  import { IntegrationType, integrationTypeEnum } from "./Integrations.js";
4
4
  import { SlackChannelType } from "./SlackTypes.js";
5
5
  import { debugTrigger as debugTriggerWithPresenter, formatTriggerForAgent as formatTriggerForAgentWithPresenter } from "./TriggerPresenters.js";
@@ -229,6 +229,7 @@ export const workOSWebhookPayloadSchema = z.object({
229
229
  // MARK: Canonical Trigger Events
230
230
  export const webhookTriggerTypeSchema = z.literal("webhook");
231
231
  export const cronTriggerTypeSchema = z.literal("cron");
232
+ export const webMonitorTriggerTypeSchema = z.literal("webmonitor");
232
233
  export const manualSampleTriggerTypeSchema = z.literal("manual_sample");
233
234
  export const TriggerTypeSchema = z.union([
234
235
  slackEventTypeSchema,
@@ -238,6 +239,7 @@ export const TriggerTypeSchema = z.union([
238
239
  workOSEventTypeSchema,
239
240
  webhookTriggerTypeSchema,
240
241
  cronTriggerTypeSchema,
242
+ webMonitorTriggerTypeSchema,
241
243
  manualSampleTriggerTypeSchema
242
244
  ]);
243
245
  export const baseTriggerSchema = z.object({
@@ -401,6 +403,51 @@ export const cronTriggerSchema = baseTriggerSchema.extend({
401
403
  isManualTrigger: z.boolean().optional(),
402
404
  manualContext: z.string().optional()
403
405
  });
406
+ export const ParallelMonitorDetectedWebhookPayloadSchema = z.object({
407
+ type: z.literal("monitor.event.detected"),
408
+ timestamp: z.string(),
409
+ data: z.object({
410
+ event: z.object({
411
+ event_group_id: z.string()
412
+ }),
413
+ metadata: z.record(z.string(), z.string()),
414
+ monitor_id: z.string()
415
+ })
416
+ });
417
+ export const ParallelMonitorTextResultSchema = z.object({
418
+ type: z.literal("text"),
419
+ content: z.string()
420
+ });
421
+ export const ParallelMonitorJsonResultSchema = z.object({
422
+ type: z.literal("json"),
423
+ content: z.unknown()
424
+ });
425
+ export const ParallelMonitorEventSchema = z.object({
426
+ type: z.literal("event"),
427
+ event_group_id: z.string(),
428
+ output: z.string(),
429
+ event_date: z.string(),
430
+ source_urls: z.array(z.string()),
431
+ result: z.discriminatedUnion("type", [ParallelMonitorTextResultSchema, ParallelMonitorJsonResultSchema])
432
+ });
433
+ export const webMonitorTriggerSchema = baseTriggerSchema.extend({
434
+ integrationType: z.literal(IntegrationType.WEBMONITOR),
435
+ eventType: webMonitorTriggerTypeSchema,
436
+ inputId: z.string(),
437
+ query: z.string(),
438
+ frequency: z.object({
439
+ number: z.number().min(1).max(30).int(),
440
+ unit: frequencyUnitSchema
441
+ }),
442
+ monitorId: z.string(),
443
+ eventGroupId: z.string(),
444
+ metadata: z.record(z.string(), z.string()),
445
+ outputType: z.enum(["text", "json"]),
446
+ rawPayload: z.string().optional(),
447
+ payload: z.unknown(),
448
+ eventDate: z.string(),
449
+ sourceUrls: z.array(z.string())
450
+ });
404
451
  export const manualSampleTriggerSchema = baseTriggerSchema.extend({
405
452
  eventType: manualSampleTriggerTypeSchema
406
453
  });
@@ -412,6 +459,7 @@ export const TriggerSchema = z.union([
412
459
  workOSTriggerSchema,
413
460
  webhookTriggerSchema,
414
461
  cronTriggerSchema,
462
+ webMonitorTriggerSchema,
415
463
  manualSampleTriggerSchema
416
464
  ]);
417
465
  export function createManualTrigger(params = {}) {
@@ -1813,7 +1813,13 @@
1813
1813
  "eventType": {
1814
1814
  "$ref": "#/$defs/WebhookTriggerType"
1815
1815
  },
1816
- "body": {},
1816
+ "body": {
1817
+ "type": "object",
1818
+ "propertyNames": {
1819
+ "type": "string"
1820
+ },
1821
+ "additionalProperties": {}
1822
+ },
1817
1823
  "headers": {
1818
1824
  "type": "object",
1819
1825
  "propertyNames": {
@@ -3600,15 +3606,8 @@
3600
3606
  "text": {
3601
3607
  "type": "string"
3602
3608
  },
3603
- "remoteServerUrl": {
3604
- "anyOf": [
3605
- {
3606
- "type": "string"
3607
- },
3608
- {
3609
- "type": "null"
3610
- }
3611
- ]
3609
+ "jobUrl": {
3610
+ "type": "string"
3612
3611
  }
3613
3612
  },
3614
3613
  "required": [
@@ -3757,72 +3756,6 @@
3757
3756
  ],
3758
3757
  "additionalProperties": false
3759
3758
  },
3760
- "AgentFileContentResponse": {
3761
- "type": "object",
3762
- "properties": {
3763
- "path": {
3764
- "type": "string"
3765
- },
3766
- "fileName": {
3767
- "type": "string"
3768
- },
3769
- "contentBase64": {
3770
- "type": "string"
3771
- },
3772
- "mimeType": {
3773
- "type": "string"
3774
- }
3775
- },
3776
- "required": [
3777
- "path",
3778
- "fileName",
3779
- "contentBase64"
3780
- ],
3781
- "additionalProperties": false
3782
- },
3783
- "AgentFilesResponse": {
3784
- "type": "object",
3785
- "properties": {
3786
- "id": {
3787
- "type": "string"
3788
- },
3789
- "files": {
3790
- "type": "array",
3791
- "items": {
3792
- "$ref": "#/$defs/__schema0"
3793
- }
3794
- }
3795
- },
3796
- "required": [
3797
- "id",
3798
- "files"
3799
- ],
3800
- "additionalProperties": false,
3801
- "$defs": {
3802
- "__schema0": {
3803
- "type": "object",
3804
- "properties": {
3805
- "id": {
3806
- "type": "string"
3807
- },
3808
- "name": {
3809
- "type": "string"
3810
- },
3811
- "children": {
3812
- "type": "array",
3813
- "items": {
3814
- "$ref": "#/$defs/__schema0"
3815
- }
3816
- }
3817
- },
3818
- "required": [
3819
- "id",
3820
- "name"
3821
- ],
3822
- "additionalProperties": false
3823
- }
3824
- }
3825
- },
3826
3759
  "AgentIdParams": {
3827
3760
  "type": "object",
3828
3761
  "properties": {
@@ -5104,9 +5037,6 @@
5104
5037
  "type": "string",
5105
5038
  "const": "Cancelled"
5106
5039
  },
5107
- "id": {
5108
- "type": "string"
5109
- },
5110
5040
  "reason": {
5111
5041
  "type": "string"
5112
5042
  },
@@ -5929,9 +5859,6 @@
5929
5859
  "type": "string",
5930
5860
  "const": "FilterResult"
5931
5861
  },
5932
- "id": {
5933
- "type": "string"
5934
- },
5935
5862
  "timestamp": {
5936
5863
  "type": "number"
5937
5864
  }
@@ -10073,9 +10000,6 @@
10073
10000
  "type": "string",
10074
10001
  "const": "Snippet"
10075
10002
  },
10076
- "id": {
10077
- "type": "string"
10078
- },
10079
10003
  "timestamp": {
10080
10004
  "type": "number"
10081
10005
  },
@@ -10090,42 +10014,6 @@
10090
10014
  ],
10091
10015
  "additionalProperties": false
10092
10016
  },
10093
- "ProcessOutput": {
10094
- "type": "object",
10095
- "properties": {
10096
- "type": {
10097
- "type": "string",
10098
- "const": "ProcessOutput"
10099
- },
10100
- "id": {
10101
- "type": "string"
10102
- },
10103
- "stream": {
10104
- "type": "string",
10105
- "enum": [
10106
- "stdout",
10107
- "stderr"
10108
- ]
10109
- },
10110
- "content": {
10111
- "type": "string"
10112
- },
10113
- "label": {
10114
- "type": "string"
10115
- },
10116
- "timestamp": {
10117
- "type": "number"
10118
- }
10119
- },
10120
- "required": [
10121
- "type",
10122
- "stream",
10123
- "content",
10124
- "label",
10125
- "timestamp"
10126
- ],
10127
- "additionalProperties": false
10128
- },
10129
10017
  "Thinking": {
10130
10018
  "type": "object",
10131
10019
  "properties": {
@@ -10136,9 +10024,6 @@
10136
10024
  "type": "string",
10137
10025
  "const": "Thinking"
10138
10026
  },
10139
- "id": {
10140
- "type": "string"
10141
- },
10142
10027
  "timestamp": {
10143
10028
  "type": "number"
10144
10029
  }
@@ -10157,9 +10042,6 @@
10157
10042
  "type": "string",
10158
10043
  "const": "UserMessage"
10159
10044
  },
10160
- "id": {
10161
- "type": "string"
10162
- },
10163
10045
  "message": {
10164
10046
  "type": "string"
10165
10047
  },
@@ -10192,9 +10074,6 @@
10192
10074
  "type": "string",
10193
10075
  "const": "NaturalStop"
10194
10076
  },
10195
- "id": {
10196
- "type": "string"
10197
- },
10198
10077
  "timestamp": {
10199
10078
  "type": "number"
10200
10079
  }
@@ -10213,9 +10092,6 @@
10213
10092
  "type": "string",
10214
10093
  "const": "RunError"
10215
10094
  },
10216
- "id": {
10217
- "type": "string"
10218
- },
10219
10095
  "error": {
10220
10096
  "type": "string"
10221
10097
  },
@@ -10246,9 +10122,6 @@
10246
10122
  "type": "string",
10247
10123
  "const": "TextDelta"
10248
10124
  },
10249
- "id": {
10250
- "type": "string"
10251
- },
10252
10125
  "timestamp": {
10253
10126
  "type": "number"
10254
10127
  }
@@ -10299,9 +10172,6 @@
10299
10172
  "type": "string",
10300
10173
  "const": "ToolCallComplete"
10301
10174
  },
10302
- "id": {
10303
- "type": "string"
10304
- },
10305
10175
  "changed_items": {
10306
10176
  "type": "array",
10307
10177
  "items": {
@@ -10345,9 +10215,6 @@
10345
10215
  "type": "string",
10346
10216
  "const": "ToolCall"
10347
10217
  },
10348
- "id": {
10349
- "type": "string"
10350
- },
10351
10218
  "parameters": {
10352
10219
  "type": "string"
10353
10220
  },
@@ -10381,9 +10248,6 @@
10381
10248
  "type": "string",
10382
10249
  "const": "ToolCallGenerating"
10383
10250
  },
10384
- "id": {
10385
- "type": "string"
10386
- },
10387
10251
  "timestamp": {
10388
10252
  "type": "number"
10389
10253
  }
@@ -10406,9 +10270,6 @@
10406
10270
  "type": "string",
10407
10271
  "const": "ToolApprovalRequest"
10408
10272
  },
10409
- "id": {
10410
- "type": "string"
10411
- },
10412
10273
  "name": {
10413
10274
  "type": "string"
10414
10275
  },
@@ -10438,9 +10299,6 @@
10438
10299
  "type": "string",
10439
10300
  "const": "ToolApprovalResponse"
10440
10301
  },
10441
- "id": {
10442
- "type": "string"
10443
- },
10444
10302
  "approved": {
10445
10303
  "type": "boolean"
10446
10304
  },
@@ -10499,9 +10357,6 @@
10499
10357
  },
10500
10358
  {
10501
10359
  "$ref": "#/$defs/ModelEventChatSnippet"
10502
- },
10503
- {
10504
- "$ref": "#/$defs/ProcessOutput"
10505
10360
  }
10506
10361
  ]
10507
10362
  },
@@ -10512,9 +10367,6 @@
10512
10367
  "type": "string",
10513
10368
  "const": "SendModelRequest"
10514
10369
  },
10515
- "id": {
10516
- "type": "string"
10517
- },
10518
10370
  "user_message": {
10519
10371
  "type": "string"
10520
10372
  },
@@ -12911,8 +12763,8 @@
12911
12763
  "prompt": {
12912
12764
  "type": "string"
12913
12765
  },
12914
- "message": {
12915
- "type": "string"
12766
+ "event": {
12767
+ "$ref": "#/$defs/Trigger"
12916
12768
  },
12917
12769
  "skills": {
12918
12770
  "type": "array",
@@ -12930,9 +12782,6 @@
12930
12782
  }
12931
12783
  }
12932
12784
  },
12933
- "required": [
12934
- "message"
12935
- ],
12936
12785
  "additionalProperties": false
12937
12786
  },
12938
12787
  "SdkAgentRunResponseContract": {
@@ -13174,11 +13023,25 @@
13174
13023
  "items": {
13175
13024
  "$ref": "#/$defs/TriggerConfigData"
13176
13025
  }
13026
+ },
13027
+ "outputs": {
13028
+ "type": "array",
13029
+ "items": {
13030
+ "$ref": "#/$defs/SkillConfigData"
13031
+ }
13032
+ },
13033
+ "toolApprovals": {
13034
+ "type": "array",
13035
+ "items": {
13036
+ "type": "string"
13037
+ }
13177
13038
  }
13178
13039
  },
13179
13040
  "required": [
13180
13041
  "jobName",
13181
- "triggers"
13042
+ "triggers",
13043
+ "outputs",
13044
+ "toolApprovals"
13182
13045
  ],
13183
13046
  "additionalProperties": false
13184
13047
  },
@@ -13207,7 +13070,7 @@
13207
13070
  "$ref": "#/$defs/SdkDeployJob"
13208
13071
  }
13209
13072
  },
13210
- "remoteServerUrl": {
13073
+ "jobUrl": {
13211
13074
  "type": "string"
13212
13075
  },
13213
13076
  "sourceZipBase64": {
@@ -13231,9 +13094,6 @@
13231
13094
  "isUpdate": {
13232
13095
  "type": "boolean"
13233
13096
  },
13234
- "signingSecret": {
13235
- "type": "string"
13236
- },
13237
13097
  "triggers": {
13238
13098
  "type": "array",
13239
13099
  "items": {
@@ -13298,8 +13158,8 @@
13298
13158
  "http",
13299
13159
  "json",
13300
13160
  "response_schema",
13301
- "challenge_echo",
13302
- "challenge_signature"
13161
+ "token",
13162
+ "org"
13303
13163
  ]
13304
13164
  },
13305
13165
  "SdkJobServerCheckResponse": {
@@ -13327,46 +13187,6 @@
13327
13187
  ],
13328
13188
  "additionalProperties": false
13329
13189
  },
13330
- "SerializedEvent": {
13331
- "type": "object",
13332
- "properties": {
13333
- "integrationType": {
13334
- "$ref": "#/$defs/IntegrationTypeEnum"
13335
- },
13336
- "eventType": {
13337
- "$ref": "#/$defs/TriggerType"
13338
- },
13339
- "formattedContent": {
13340
- "type": "string"
13341
- },
13342
- "debugLog": {
13343
- "type": "string"
13344
- },
13345
- "data": {
13346
- "$ref": "#/$defs/Trigger"
13347
- }
13348
- },
13349
- "required": [
13350
- "integrationType",
13351
- "eventType",
13352
- "formattedContent",
13353
- "debugLog",
13354
- "data"
13355
- ],
13356
- "additionalProperties": false
13357
- },
13358
- "SdkRunTriggerEventResponse": {
13359
- "type": "object",
13360
- "properties": {
13361
- "event": {
13362
- "$ref": "#/$defs/SerializedEvent"
13363
- }
13364
- },
13365
- "required": [
13366
- "event"
13367
- ],
13368
- "additionalProperties": false
13369
- },
13370
13190
  "SdkSampleEventsRequest": {
13371
13191
  "type": "object",
13372
13192
  "properties": {
@@ -14367,6 +14187,34 @@
14367
14187
  ],
14368
14188
  "additionalProperties": false
14369
14189
  },
14190
+ "SerializedEvent": {
14191
+ "type": "object",
14192
+ "properties": {
14193
+ "integrationType": {
14194
+ "$ref": "#/$defs/IntegrationTypeEnum"
14195
+ },
14196
+ "eventType": {
14197
+ "$ref": "#/$defs/TriggerType"
14198
+ },
14199
+ "formattedContent": {
14200
+ "type": "string"
14201
+ },
14202
+ "debugLog": {
14203
+ "type": "string"
14204
+ },
14205
+ "data": {
14206
+ "$ref": "#/$defs/Trigger"
14207
+ }
14208
+ },
14209
+ "required": [
14210
+ "integrationType",
14211
+ "eventType",
14212
+ "formattedContent",
14213
+ "debugLog",
14214
+ "data"
14215
+ ],
14216
+ "additionalProperties": false
14217
+ },
14370
14218
  "SlackChannelListItem": {
14371
14219
  "type": "object",
14372
14220
  "properties": {
@@ -15832,39 +15680,16 @@
15832
15680
  "WebhookJobChallengeRequest": {
15833
15681
  "type": "object",
15834
15682
  "properties": {
15835
- "type": {
15836
- "type": "string",
15837
- "const": "challenge"
15838
- },
15839
15683
  "challenge": {
15840
- "type": "string",
15841
- "minLength": 1
15684
+ "type": "boolean",
15685
+ "const": true
15842
15686
  }
15843
15687
  },
15844
15688
  "required": [
15845
- "type",
15846
15689
  "challenge"
15847
15690
  ],
15848
15691
  "additionalProperties": false
15849
15692
  },
15850
- "WebhookJobChallengeResponse": {
15851
- "type": "object",
15852
- "properties": {
15853
- "challenge": {
15854
- "type": "string",
15855
- "minLength": 1
15856
- },
15857
- "signature": {
15858
- "type": "string",
15859
- "minLength": 1
15860
- }
15861
- },
15862
- "required": [
15863
- "challenge",
15864
- "signature"
15865
- ],
15866
- "additionalProperties": false
15867
- },
15868
15693
  "WebhookJobTriggerRequest": {
15869
15694
  "type": "object",
15870
15695
  "properties": {
@@ -15891,10 +15716,17 @@
15891
15716
  "status": {
15892
15717
  "type": "string"
15893
15718
  },
15719
+ "apiKey": {
15720
+ "type": "string",
15721
+ "minLength": 1
15722
+ },
15894
15723
  "filtered": {
15895
15724
  "type": "boolean"
15896
15725
  }
15897
15726
  },
15727
+ "required": [
15728
+ "apiKey"
15729
+ ],
15898
15730
  "additionalProperties": false
15899
15731
  },
15900
15732
  "WebhookWorkOSTriggerParams": {