terse-types 0.0.3 → 0.0.5
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/ApiRouteBuilder.d.ts +5 -21
- package/dist/ApiRoutes.json +8 -24
- package/dist/ApprovalTypes.d.ts +47 -19
- package/dist/ApprovalTypes.js +20 -0
- package/dist/Configs.d.ts +300 -166
- package/dist/Configs.js +109 -252
- package/dist/Integrations.d.ts +0 -34
- package/dist/Integrations.js +0 -30
- package/dist/InvalidationKeys.d.ts +2 -4
- package/dist/InvalidationKeys.js +2 -18
- package/dist/ModelEvents.d.ts +134 -26
- package/dist/ModelEvents.js +68 -79
- package/dist/Notifications.d.ts +19 -8
- package/dist/Notifications.js +6 -6
- package/dist/RunHistoryTypes.d.ts +34 -39
- package/dist/RunHistoryTypes.js +12 -10
- package/dist/SlackTypes.d.ts +23 -0
- package/dist/SlackTypes.js +9 -0
- package/dist/TicketSystem.d.ts +0 -1
- package/dist/TicketSystem.js +0 -1
- package/dist/ToolDisplayUtils.js +0 -76
- package/dist/Tools.d.ts +14 -907
- package/dist/Tools.js +0 -210
- package/dist/TriggerPresenters.d.ts +3 -0
- package/dist/TriggerPresenters.js +254 -0
- package/dist/Triggers.d.ts +4065 -0
- package/dist/Triggers.js +436 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/types.d.ts +5197 -2534
- package/dist/types.js +113 -236
- package/package.json +3 -1
package/dist/Configs.js
CHANGED
|
@@ -5,15 +5,12 @@ export var ConfigType;
|
|
|
5
5
|
ConfigType["GMAIL"] = "gmail";
|
|
6
6
|
ConfigType["GMAIL_OUTPUT"] = "gmail_output";
|
|
7
7
|
ConfigType["GMAIL_DRAFT_OUTPUT"] = "gmail_draft_output";
|
|
8
|
-
ConfigType["FIGMA"] = "figma";
|
|
9
8
|
ConfigType["SLACK"] = "slack";
|
|
10
9
|
ConfigType["SLACK_OUTPUT"] = "slack_output";
|
|
11
10
|
ConfigType["NOTION"] = "notion";
|
|
12
11
|
ConfigType["LINEAR_INPUT"] = "linear_input";
|
|
13
12
|
ConfigType["LINEAR_OUTPUT"] = "linear_output";
|
|
14
13
|
ConfigType["GITHUB"] = "github";
|
|
15
|
-
ConfigType["JIRA"] = "jira";
|
|
16
|
-
ConfigType["CONFLUENCE"] = "confluence";
|
|
17
14
|
ConfigType["POSTHOG"] = "POSTHOG";
|
|
18
15
|
ConfigType["DATADOG"] = "DATADOG";
|
|
19
16
|
ConfigType["TIME_TRIGGER"] = "time_trigger";
|
|
@@ -35,14 +32,6 @@ export const GmailConfigMetadata = {
|
|
|
35
32
|
isInput: true,
|
|
36
33
|
isOutput: false
|
|
37
34
|
};
|
|
38
|
-
export const FigmaConfigMetadata = {
|
|
39
|
-
configType: ConfigType.FIGMA,
|
|
40
|
-
name: "Figma",
|
|
41
|
-
description: "Monitor design changes in Figma files",
|
|
42
|
-
integrationType: IntegrationType.FIGMA,
|
|
43
|
-
isInput: true,
|
|
44
|
-
isOutput: false
|
|
45
|
-
};
|
|
46
35
|
export const SlackConfigMetadata = {
|
|
47
36
|
configType: ConfigType.SLACK,
|
|
48
37
|
name: "Slack",
|
|
@@ -107,22 +96,6 @@ export const GitHubConfigMetadata = {
|
|
|
107
96
|
isInput: true,
|
|
108
97
|
isOutput: true
|
|
109
98
|
};
|
|
110
|
-
export const JiraConfigMetadata = {
|
|
111
|
-
configType: ConfigType.JIRA,
|
|
112
|
-
name: "Jira",
|
|
113
|
-
description: "Monitor and update Jira issues",
|
|
114
|
-
integrationType: IntegrationType.ATLASSIAN,
|
|
115
|
-
isInput: true,
|
|
116
|
-
isOutput: true
|
|
117
|
-
};
|
|
118
|
-
export const ConfluenceConfigMetadata = {
|
|
119
|
-
configType: ConfigType.CONFLUENCE,
|
|
120
|
-
name: "Confluence",
|
|
121
|
-
description: "Update Confluence pages",
|
|
122
|
-
integrationType: IntegrationType.ATLASSIAN,
|
|
123
|
-
isInput: false,
|
|
124
|
-
isOutput: true
|
|
125
|
-
};
|
|
126
99
|
export const PosthogConfigMetadata = {
|
|
127
100
|
configType: ConfigType.POSTHOG,
|
|
128
101
|
name: "Posthog",
|
|
@@ -207,15 +180,12 @@ export const CONFIG_DETAILS = {
|
|
|
207
180
|
[ConfigType.GMAIL]: GmailConfigMetadata,
|
|
208
181
|
[ConfigType.GMAIL_OUTPUT]: GmailOutputConfigMetadata,
|
|
209
182
|
[ConfigType.GMAIL_DRAFT_OUTPUT]: GmailDraftOutputConfigMetadata,
|
|
210
|
-
[ConfigType.FIGMA]: FigmaConfigMetadata,
|
|
211
183
|
[ConfigType.SLACK]: SlackConfigMetadata,
|
|
212
184
|
[ConfigType.SLACK_OUTPUT]: SlackOutputConfigMetadata,
|
|
213
185
|
[ConfigType.NOTION]: NotionConfigMetadata,
|
|
214
186
|
[ConfigType.LINEAR_INPUT]: LinearInputConfigMetadata,
|
|
215
187
|
[ConfigType.LINEAR_OUTPUT]: LinearOutputConfigMetadata,
|
|
216
188
|
[ConfigType.GITHUB]: GitHubConfigMetadata,
|
|
217
|
-
[ConfigType.JIRA]: JiraConfigMetadata,
|
|
218
|
-
[ConfigType.CONFLUENCE]: ConfluenceConfigMetadata,
|
|
219
189
|
[ConfigType.POSTHOG]: PosthogConfigMetadata,
|
|
220
190
|
[ConfigType.DATADOG]: DatadogConfigMetadata,
|
|
221
191
|
[ConfigType.TIME_TRIGGER]: TimeTriggerConfigMetadata,
|
|
@@ -228,53 +198,44 @@ export const CONFIG_DETAILS = {
|
|
|
228
198
|
[ConfigType.WEBHOOK_INPUT]: WebhookInputConfigMetadata
|
|
229
199
|
};
|
|
230
200
|
// MARK: Event Types — specific events within each integration trigger
|
|
231
|
-
export
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
export
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
export
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
export
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
WorkOSEventType["ORGANIZATION_CREATED"] = "organization.created";
|
|
270
|
-
WorkOSEventType["ORGANIZATION_MEMBERSHIP_CREATED"] = "organization_membership.created";
|
|
271
|
-
WorkOSEventType["ORGANIZATION_MEMBERSHIP_UPDATED"] = "organization_membership.updated";
|
|
272
|
-
WorkOSEventType["ORGANIZATION_MEMBERSHIP_DELETED"] = "organization_membership.deleted";
|
|
273
|
-
WorkOSEventType["INVITATION_CREATED"] = "invitation.created";
|
|
274
|
-
WorkOSEventType["INVITATION_ACCEPTED"] = "invitation.accepted";
|
|
275
|
-
WorkOSEventType["INVITATION_RESENT"] = "invitation.resent";
|
|
276
|
-
WorkOSEventType["INVITATION_REVOKED"] = "invitation.revoked";
|
|
277
|
-
})(WorkOSEventType || (WorkOSEventType = {}));
|
|
201
|
+
export const SlackEventType = {
|
|
202
|
+
MESSAGE: "message",
|
|
203
|
+
APP_MENTION: "app_mention",
|
|
204
|
+
REACTION_ADDED: "reaction_added"
|
|
205
|
+
};
|
|
206
|
+
export const slackEventTypeSchema = z.enum(SlackEventType);
|
|
207
|
+
export const GitHubEventType = {
|
|
208
|
+
PUSH: "push",
|
|
209
|
+
PR_OPENED: "pull_request.opened",
|
|
210
|
+
PR_MERGED: "pull_request.merged",
|
|
211
|
+
PR_CLOSED: "pull_request.closed",
|
|
212
|
+
PR_SYNCHRONIZE: "pull_request.synchronize"
|
|
213
|
+
};
|
|
214
|
+
export const gitHubEventTypeSchema = z.enum(GitHubEventType);
|
|
215
|
+
export const LinearEventType = {
|
|
216
|
+
ISSUE_CREATED: "issue.created",
|
|
217
|
+
ISSUE_UPDATED: "issue.updated",
|
|
218
|
+
COMMENT_CREATED: "comment.created"
|
|
219
|
+
};
|
|
220
|
+
export const linearEventTypeSchema = z.enum(LinearEventType);
|
|
221
|
+
export const GmailEventType = {
|
|
222
|
+
EMAIL_RECEIVED: "email.received"
|
|
223
|
+
};
|
|
224
|
+
export const gmailEventTypeSchema = z.enum(GmailEventType);
|
|
225
|
+
export const WorkOSEventType = {
|
|
226
|
+
USER_CREATED: "user.created",
|
|
227
|
+
USER_UPDATED: "user.updated",
|
|
228
|
+
USER_DELETED: "user.deleted",
|
|
229
|
+
ORGANIZATION_CREATED: "organization.created",
|
|
230
|
+
ORGANIZATION_MEMBERSHIP_CREATED: "organization_membership.created",
|
|
231
|
+
ORGANIZATION_MEMBERSHIP_UPDATED: "organization_membership.updated",
|
|
232
|
+
ORGANIZATION_MEMBERSHIP_DELETED: "organization_membership.deleted",
|
|
233
|
+
INVITATION_CREATED: "invitation.created",
|
|
234
|
+
INVITATION_ACCEPTED: "invitation.accepted",
|
|
235
|
+
INVITATION_RESENT: "invitation.resent",
|
|
236
|
+
INVITATION_REVOKED: "invitation.revoked"
|
|
237
|
+
};
|
|
238
|
+
export const workOSEventTypeSchema = z.enum(WorkOSEventType);
|
|
278
239
|
export const ConfigInstanceSchema = z.object({
|
|
279
240
|
integrationId: z.string(),
|
|
280
241
|
integrationType: integrationTypeEnum,
|
|
@@ -293,7 +254,7 @@ class BaseConfigInstance {
|
|
|
293
254
|
export const GmailConfigSchema = ConfigInstanceSchema.extend({
|
|
294
255
|
integrationType: z.literal(IntegrationType.GMAIL),
|
|
295
256
|
configType: z.literal(ConfigType.GMAIL),
|
|
296
|
-
eventTypes: z.array(
|
|
257
|
+
eventTypes: z.array(gmailEventTypeSchema).nullable()
|
|
297
258
|
});
|
|
298
259
|
export class GmailConfig extends BaseConfigInstance {
|
|
299
260
|
eventTypes;
|
|
@@ -308,40 +269,6 @@ export class GmailConfig extends BaseConfigInstance {
|
|
|
308
269
|
return `Type: Gmail\nIntegration ID: ${this.integrationId}`;
|
|
309
270
|
}
|
|
310
271
|
}
|
|
311
|
-
export const FigmaConfigSchema = ConfigInstanceSchema.extend({
|
|
312
|
-
integrationType: z.literal(IntegrationType.FIGMA),
|
|
313
|
-
configType: z.literal(ConfigType.FIGMA),
|
|
314
|
-
fileKey: z.string(),
|
|
315
|
-
fileName: z.string(),
|
|
316
|
-
teamId: z.string(),
|
|
317
|
-
eventTypes: z.array(z.enum(FigmaEventType)).nullable()
|
|
318
|
-
});
|
|
319
|
-
export class FigmaConfig extends BaseConfigInstance {
|
|
320
|
-
fileKey;
|
|
321
|
-
fileName;
|
|
322
|
-
teamId;
|
|
323
|
-
eventTypes;
|
|
324
|
-
constructor(integrationId, fileKey, fileName, teamId, eventTypes = null) {
|
|
325
|
-
super(integrationId, IntegrationType.FIGMA, ConfigType.FIGMA);
|
|
326
|
-
this.fileKey = fileKey;
|
|
327
|
-
this.fileName = fileName;
|
|
328
|
-
this.teamId = teamId;
|
|
329
|
-
this.eventTypes = eventTypes;
|
|
330
|
-
}
|
|
331
|
-
isComplete() {
|
|
332
|
-
return !!(this.fileKey && this.teamId);
|
|
333
|
-
}
|
|
334
|
-
formatForAgent() {
|
|
335
|
-
const parts = [`Type: Figma`, `Integration ID: ${this.integrationId}`];
|
|
336
|
-
if (this.fileName) {
|
|
337
|
-
parts.push(`File: ${this.fileName}`);
|
|
338
|
-
}
|
|
339
|
-
if (this.fileKey) {
|
|
340
|
-
parts.push(`File Key: ${this.fileKey}`);
|
|
341
|
-
}
|
|
342
|
-
return parts.join("\n");
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
272
|
export const SlackConfigSchema = ConfigInstanceSchema.extend({
|
|
346
273
|
integrationType: z.literal(IntegrationType.SLACK),
|
|
347
274
|
configType: z.literal(ConfigType.SLACK),
|
|
@@ -349,7 +276,7 @@ export const SlackConfigSchema = ConfigInstanceSchema.extend({
|
|
|
349
276
|
channelName: z.string().nullable(),
|
|
350
277
|
listenToUserDms: z.boolean().default(false),
|
|
351
278
|
userIds: z.array(z.string()).nullable(),
|
|
352
|
-
eventTypes: z.array(
|
|
279
|
+
eventTypes: z.array(slackEventTypeSchema).nullable()
|
|
353
280
|
});
|
|
354
281
|
export class SlackConfig extends BaseConfigInstance {
|
|
355
282
|
channelId;
|
|
@@ -366,7 +293,6 @@ export class SlackConfig extends BaseConfigInstance {
|
|
|
366
293
|
this.eventTypes = eventTypes;
|
|
367
294
|
}
|
|
368
295
|
isComplete() {
|
|
369
|
-
// Slack is complete if either channelId is set OR listenToUserDms is true
|
|
370
296
|
return !!(this.channelId || this.listenToUserDms);
|
|
371
297
|
}
|
|
372
298
|
formatForAgent() {
|
|
@@ -383,6 +309,9 @@ export class SlackConfig extends BaseConfigInstance {
|
|
|
383
309
|
if (this.userIds) {
|
|
384
310
|
parts.push(`Users: ${this.userIds.join(", ")}`);
|
|
385
311
|
}
|
|
312
|
+
if (this.eventTypes?.length) {
|
|
313
|
+
parts.push(`Event Types: ${this.eventTypes.join(", ")}`);
|
|
314
|
+
}
|
|
386
315
|
return parts.join("\n");
|
|
387
316
|
}
|
|
388
317
|
}
|
|
@@ -499,31 +428,34 @@ export class NotionConfig extends BaseConfigInstance {
|
|
|
499
428
|
export const LinearInputConfigSchema = ConfigInstanceSchema.extend({
|
|
500
429
|
integrationType: z.literal(IntegrationType.LINEAR),
|
|
501
430
|
configType: z.literal(ConfigType.LINEAR_INPUT),
|
|
431
|
+
teamId: z.string().nullable(),
|
|
502
432
|
projectId: z.string().nullable(),
|
|
503
|
-
|
|
504
|
-
eventTypes: z.array(z.enum(LinearEventType)).nullable()
|
|
433
|
+
eventTypes: z.array(linearEventTypeSchema).nullable()
|
|
505
434
|
});
|
|
506
435
|
export class LinearInputConfig extends BaseConfigInstance {
|
|
507
436
|
projectId;
|
|
508
|
-
projectName;
|
|
509
437
|
eventTypes;
|
|
510
|
-
|
|
438
|
+
teamId;
|
|
439
|
+
constructor(integrationId, projectId = null, eventTypes = null, teamId = null) {
|
|
511
440
|
super(integrationId, IntegrationType.LINEAR, ConfigType.LINEAR_INPUT);
|
|
512
441
|
this.projectId = projectId;
|
|
513
|
-
this.projectName = projectName;
|
|
514
442
|
this.eventTypes = eventTypes;
|
|
443
|
+
this.teamId = teamId;
|
|
515
444
|
}
|
|
516
445
|
isComplete() {
|
|
517
|
-
return
|
|
446
|
+
return (this.eventTypes?.length ?? 0) > 0;
|
|
518
447
|
}
|
|
519
448
|
formatForAgent() {
|
|
520
449
|
const parts = [`Type: Linear`, `Integration ID: ${this.integrationId}`];
|
|
521
|
-
if (this.
|
|
522
|
-
parts.push(`
|
|
450
|
+
if (this.teamId) {
|
|
451
|
+
parts.push(`Team ID: ${this.teamId}`);
|
|
523
452
|
}
|
|
524
|
-
|
|
453
|
+
if (this.projectId) {
|
|
525
454
|
parts.push(`Project ID: ${this.projectId}`);
|
|
526
455
|
}
|
|
456
|
+
if (this.eventTypes?.length) {
|
|
457
|
+
parts.push(`Event Types: ${this.eventTypes.join(", ")}`);
|
|
458
|
+
}
|
|
527
459
|
return parts.join("\n");
|
|
528
460
|
}
|
|
529
461
|
}
|
|
@@ -532,20 +464,17 @@ export const LinearOutputConfigSchema = ConfigInstanceSchema.extend({
|
|
|
532
464
|
configType: z.literal(ConfigType.LINEAR_OUTPUT),
|
|
533
465
|
teamId: z.string().nullable(),
|
|
534
466
|
teamName: z.string().nullable(),
|
|
535
|
-
projectId: z.string().nullable()
|
|
536
|
-
projectName: z.string().nullable()
|
|
467
|
+
projectId: z.string().nullable()
|
|
537
468
|
});
|
|
538
469
|
export class LinearOutputConfig extends BaseConfigInstance {
|
|
539
470
|
teamId;
|
|
540
471
|
teamName;
|
|
541
472
|
projectId;
|
|
542
|
-
|
|
543
|
-
constructor(integrationId, teamId = null, teamName = null, projectId = null, projectName = null) {
|
|
473
|
+
constructor(integrationId, teamId = null, teamName = null, projectId = null) {
|
|
544
474
|
super(integrationId, IntegrationType.LINEAR, ConfigType.LINEAR_OUTPUT);
|
|
545
475
|
this.teamId = teamId;
|
|
546
476
|
this.teamName = teamName;
|
|
547
477
|
this.projectId = projectId;
|
|
548
|
-
this.projectName = projectName;
|
|
549
478
|
}
|
|
550
479
|
isComplete() {
|
|
551
480
|
return !!this.integrationId;
|
|
@@ -558,10 +487,7 @@ export class LinearOutputConfig extends BaseConfigInstance {
|
|
|
558
487
|
else if (this.teamId) {
|
|
559
488
|
parts.push(`Team ID: ${this.teamId}`);
|
|
560
489
|
}
|
|
561
|
-
if (this.
|
|
562
|
-
parts.push(`Project: ${this.projectName}`);
|
|
563
|
-
}
|
|
564
|
-
else if (this.projectId) {
|
|
490
|
+
if (this.projectId) {
|
|
565
491
|
parts.push(`Project ID: ${this.projectId}`);
|
|
566
492
|
}
|
|
567
493
|
return parts.join("\n");
|
|
@@ -571,7 +497,7 @@ export const GitHubConfigSchema = ConfigInstanceSchema.extend({
|
|
|
571
497
|
integrationType: z.literal(IntegrationType.GITHUB),
|
|
572
498
|
configType: z.literal(ConfigType.GITHUB),
|
|
573
499
|
repositoryIds: z.array(z.number().int()),
|
|
574
|
-
eventTypes: z.array(
|
|
500
|
+
eventTypes: z.array(gitHubEventTypeSchema).nullable()
|
|
575
501
|
});
|
|
576
502
|
export class GitHubConfig extends BaseConfigInstance {
|
|
577
503
|
repositoryIds;
|
|
@@ -582,88 +508,28 @@ export class GitHubConfig extends BaseConfigInstance {
|
|
|
582
508
|
this.eventTypes = eventTypes;
|
|
583
509
|
}
|
|
584
510
|
isComplete() {
|
|
585
|
-
return (this.repositoryIds?.length ?? 0) > 0;
|
|
511
|
+
return (this.repositoryIds?.length ?? 0) > 0 && (this.eventTypes?.length ?? 0) > 0;
|
|
586
512
|
}
|
|
587
513
|
formatForAgent() {
|
|
588
514
|
const parts = [`Type: GitHub`, `Integration ID: ${this.integrationId}`];
|
|
589
515
|
if (this.repositoryIds.length > 0) {
|
|
590
516
|
parts.push(`Repositories: ${this.repositoryIds.join(", ")}`);
|
|
591
517
|
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
}
|
|
595
|
-
export const JiraConfigSchema = ConfigInstanceSchema.extend({
|
|
596
|
-
integrationType: z.literal(IntegrationType.ATLASSIAN),
|
|
597
|
-
configType: z.literal(ConfigType.JIRA),
|
|
598
|
-
projectKey: z.string().nullable(),
|
|
599
|
-
projectId: z.string().nullable(),
|
|
600
|
-
eventTypes: z.array(z.enum(JiraEventType)).nullable()
|
|
601
|
-
});
|
|
602
|
-
export class JiraConfig extends BaseConfigInstance {
|
|
603
|
-
projectKey;
|
|
604
|
-
projectId;
|
|
605
|
-
eventTypes;
|
|
606
|
-
constructor(integrationId, projectKey = null, projectId = null, eventTypes = null) {
|
|
607
|
-
super(integrationId, IntegrationType.ATLASSIAN, ConfigType.JIRA);
|
|
608
|
-
this.projectKey = projectKey;
|
|
609
|
-
this.projectId = projectId;
|
|
610
|
-
this.eventTypes = eventTypes;
|
|
611
|
-
}
|
|
612
|
-
isComplete() {
|
|
613
|
-
// Jira only requires integrationId (base check handled in isInputComplete)
|
|
614
|
-
return true;
|
|
615
|
-
}
|
|
616
|
-
formatForAgent() {
|
|
617
|
-
const parts = [`Type: Jira`, `Integration ID: ${this.integrationId}`];
|
|
618
|
-
if (this.projectKey) {
|
|
619
|
-
parts.push(`Project Key: ${this.projectKey}`);
|
|
620
|
-
}
|
|
621
|
-
else if (this.projectId) {
|
|
622
|
-
parts.push(`Project ID: ${this.projectId}`);
|
|
518
|
+
if (this.eventTypes?.length) {
|
|
519
|
+
parts.push(`Event Types: ${this.eventTypes.join(", ")}`);
|
|
623
520
|
}
|
|
624
521
|
return parts.join("\n");
|
|
625
522
|
}
|
|
626
523
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
524
|
+
/**
|
|
525
|
+
* Skill-specific variant of GitHubConfigSchema.
|
|
526
|
+
* Skills do not listen for events, so eventTypes is omitted entirely.
|
|
527
|
+
*/
|
|
528
|
+
export const GitHubSkillConfigSchema = ConfigInstanceSchema.extend({
|
|
529
|
+
integrationType: z.literal(IntegrationType.GITHUB),
|
|
530
|
+
configType: z.literal(ConfigType.GITHUB),
|
|
531
|
+
repositoryIds: z.array(z.number().int())
|
|
634
532
|
});
|
|
635
|
-
export class ConfluenceConfig extends BaseConfigInstance {
|
|
636
|
-
spaceName;
|
|
637
|
-
spaceId;
|
|
638
|
-
pageId;
|
|
639
|
-
pageName;
|
|
640
|
-
constructor(integrationId, spaceName, spaceId, pageId, // Page ID (required for outputs - specific page to write to)
|
|
641
|
-
pageName // Page display name (for UI, optional)
|
|
642
|
-
) {
|
|
643
|
-
super(integrationId, IntegrationType.ATLASSIAN, ConfigType.CONFLUENCE);
|
|
644
|
-
this.spaceName = spaceName;
|
|
645
|
-
this.spaceId = spaceId;
|
|
646
|
-
this.pageId = pageId;
|
|
647
|
-
this.pageName = pageName;
|
|
648
|
-
}
|
|
649
|
-
isComplete() {
|
|
650
|
-
// Confluence only requires integrationId (base check handled in isInputComplete)
|
|
651
|
-
return true;
|
|
652
|
-
}
|
|
653
|
-
formatForAgent() {
|
|
654
|
-
const parts = [`Type: Confluence`, `Integration ID: ${this.integrationId}`];
|
|
655
|
-
if (this.spaceName) {
|
|
656
|
-
parts.push(`Space: ${this.spaceName}`);
|
|
657
|
-
}
|
|
658
|
-
if (this.pageName) {
|
|
659
|
-
parts.push(`Page: ${this.pageName}`);
|
|
660
|
-
}
|
|
661
|
-
else if (this.pageId) {
|
|
662
|
-
parts.push(`Page ID: ${this.pageId}`);
|
|
663
|
-
}
|
|
664
|
-
return parts.join("\n");
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
533
|
export const PosthogConfigSchema = ConfigInstanceSchema.extend({
|
|
668
534
|
integrationType: z.literal(IntegrationType.POSTHOG),
|
|
669
535
|
configType: z.literal(ConfigType.POSTHOG),
|
|
@@ -785,7 +651,7 @@ export class TerseConfig extends BaseConfigInstance {
|
|
|
785
651
|
export const WorkOSInputConfigSchema = ConfigInstanceSchema.extend({
|
|
786
652
|
integrationType: z.literal(IntegrationType.WORKOS),
|
|
787
653
|
configType: z.literal(ConfigType.WORKOS_INPUT),
|
|
788
|
-
eventTypes: z.array(
|
|
654
|
+
eventTypes: z.array(workOSEventTypeSchema).default([])
|
|
789
655
|
});
|
|
790
656
|
export class WorkOSInputConfig extends BaseConfigInstance {
|
|
791
657
|
eventTypes;
|
|
@@ -871,7 +737,6 @@ export class WebhookInputConfig extends BaseConfigInstance {
|
|
|
871
737
|
}
|
|
872
738
|
export const configDataSchema = z.union([
|
|
873
739
|
GmailConfigSchema,
|
|
874
|
-
FigmaConfigSchema,
|
|
875
740
|
SlackConfigSchema,
|
|
876
741
|
SlackOutputConfigSchema,
|
|
877
742
|
GmailOutputConfigSchema,
|
|
@@ -880,8 +745,7 @@ export const configDataSchema = z.union([
|
|
|
880
745
|
LinearInputConfigSchema,
|
|
881
746
|
LinearOutputConfigSchema,
|
|
882
747
|
GitHubConfigSchema,
|
|
883
|
-
|
|
884
|
-
ConfluenceConfigSchema,
|
|
748
|
+
GitHubSkillConfigSchema,
|
|
885
749
|
PosthogConfigSchema,
|
|
886
750
|
DatadogConfigSchema,
|
|
887
751
|
TimeTriggerConfigSchema,
|
|
@@ -893,6 +757,32 @@ export const configDataSchema = z.union([
|
|
|
893
757
|
SnowflakeOutputConfigSchema,
|
|
894
758
|
WebhookInputConfigSchema
|
|
895
759
|
]);
|
|
760
|
+
/** Configs that can serve as triggers (event sources). */
|
|
761
|
+
export const triggerConfigDataSchema = z.union([
|
|
762
|
+
GmailConfigSchema,
|
|
763
|
+
SlackConfigSchema,
|
|
764
|
+
LinearInputConfigSchema,
|
|
765
|
+
GitHubConfigSchema,
|
|
766
|
+
TimeTriggerConfigSchema,
|
|
767
|
+
WorkOSInputConfigSchema,
|
|
768
|
+
WebhookInputConfigSchema
|
|
769
|
+
]);
|
|
770
|
+
/** Configs that can serve as skills (tools / outputs). */
|
|
771
|
+
export const skillConfigDataSchema = z.union([
|
|
772
|
+
SlackOutputConfigSchema,
|
|
773
|
+
GmailOutputConfigSchema,
|
|
774
|
+
GmailDraftOutputConfigSchema,
|
|
775
|
+
NotionConfigSchema,
|
|
776
|
+
LinearOutputConfigSchema,
|
|
777
|
+
GitHubSkillConfigSchema,
|
|
778
|
+
PosthogConfigSchema,
|
|
779
|
+
DatadogConfigSchema,
|
|
780
|
+
LaunchDarklyConfigSchema,
|
|
781
|
+
TerseConfigSchema,
|
|
782
|
+
WorkOSOutputConfigSchema,
|
|
783
|
+
AttioOutputConfigSchema,
|
|
784
|
+
SnowflakeOutputConfigSchema
|
|
785
|
+
]);
|
|
896
786
|
export function isConfigComplete(config) {
|
|
897
787
|
if (!config) {
|
|
898
788
|
return false;
|
|
@@ -901,14 +791,11 @@ export function isConfigComplete(config) {
|
|
|
901
791
|
case ConfigType.GMAIL:
|
|
902
792
|
case ConfigType.GMAIL_OUTPUT:
|
|
903
793
|
case ConfigType.GMAIL_DRAFT_OUTPUT:
|
|
794
|
+
return true;
|
|
904
795
|
case ConfigType.LINEAR_INPUT:
|
|
905
|
-
case ConfigType.JIRA:
|
|
906
|
-
case ConfigType.CONFLUENCE:
|
|
907
796
|
case ConfigType.TERSE:
|
|
908
797
|
case ConfigType.WEBHOOK_INPUT:
|
|
909
798
|
return true;
|
|
910
|
-
case ConfigType.FIGMA:
|
|
911
|
-
return !!(config.fileKey && config.teamId);
|
|
912
799
|
case ConfigType.SLACK:
|
|
913
800
|
return !!(config.channelId || config.listenToUserDms);
|
|
914
801
|
case ConfigType.SLACK_OUTPUT:
|
|
@@ -941,14 +828,6 @@ export function formatConfigForAgent(config) {
|
|
|
941
828
|
switch (config.configType) {
|
|
942
829
|
case ConfigType.GMAIL:
|
|
943
830
|
return `Type: Gmail\nIntegration ID: ${config.integrationId}`;
|
|
944
|
-
case ConfigType.FIGMA: {
|
|
945
|
-
const parts = [`Type: Figma`, `Integration ID: ${config.integrationId}`];
|
|
946
|
-
if (config.fileName)
|
|
947
|
-
parts.push(`File: ${config.fileName}`);
|
|
948
|
-
if (config.fileKey)
|
|
949
|
-
parts.push(`File Key: ${config.fileKey}`);
|
|
950
|
-
return parts.join("\n");
|
|
951
|
-
}
|
|
952
831
|
case ConfigType.SLACK: {
|
|
953
832
|
const parts = [`Type: Slack`, `Integration ID: ${config.integrationId}`];
|
|
954
833
|
if (config.channelName) {
|
|
@@ -961,6 +840,8 @@ export function formatConfigForAgent(config) {
|
|
|
961
840
|
parts.push(`Listening to user DMs: Yes`);
|
|
962
841
|
if (config.userIds)
|
|
963
842
|
parts.push(`Users: ${config.userIds.join(", ")}`);
|
|
843
|
+
if (config.eventTypes?.length)
|
|
844
|
+
parts.push(`Event Types: ${config.eventTypes.join(", ")}`);
|
|
964
845
|
return parts.join("\n");
|
|
965
846
|
}
|
|
966
847
|
case ConfigType.SLACK_OUTPUT: {
|
|
@@ -993,12 +874,14 @@ export function formatConfigForAgent(config) {
|
|
|
993
874
|
}
|
|
994
875
|
case ConfigType.LINEAR_INPUT: {
|
|
995
876
|
const parts = [`Type: Linear`, `Integration ID: ${config.integrationId}`];
|
|
996
|
-
if (config.
|
|
997
|
-
parts.push(`
|
|
877
|
+
if (config.teamId) {
|
|
878
|
+
parts.push(`Team ID: ${config.teamId}`);
|
|
998
879
|
}
|
|
999
|
-
|
|
880
|
+
if (config.projectId) {
|
|
1000
881
|
parts.push(`Project ID: ${config.projectId}`);
|
|
1001
882
|
}
|
|
883
|
+
if (config.eventTypes?.length)
|
|
884
|
+
parts.push(`Event Types: ${config.eventTypes.join(", ")}`);
|
|
1002
885
|
return parts.join("\n");
|
|
1003
886
|
}
|
|
1004
887
|
case ConfigType.LINEAR_OUTPUT: {
|
|
@@ -1009,10 +892,7 @@ export function formatConfigForAgent(config) {
|
|
|
1009
892
|
else if (config.teamId) {
|
|
1010
893
|
parts.push(`Team ID: ${config.teamId}`);
|
|
1011
894
|
}
|
|
1012
|
-
if (config.
|
|
1013
|
-
parts.push(`Project: ${config.projectName}`);
|
|
1014
|
-
}
|
|
1015
|
-
else if (config.projectId) {
|
|
895
|
+
if (config.projectId) {
|
|
1016
896
|
parts.push(`Project ID: ${config.projectId}`);
|
|
1017
897
|
}
|
|
1018
898
|
return parts.join("\n");
|
|
@@ -1021,28 +901,8 @@ export function formatConfigForAgent(config) {
|
|
|
1021
901
|
const parts = [`Type: GitHub`, `Integration ID: ${config.integrationId}`];
|
|
1022
902
|
if (config.repositoryIds.length > 0)
|
|
1023
903
|
parts.push(`Repositories: ${config.repositoryIds.join(", ")}`);
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
case ConfigType.JIRA: {
|
|
1027
|
-
const parts = [`Type: Jira`, `Integration ID: ${config.integrationId}`];
|
|
1028
|
-
if (config.projectKey) {
|
|
1029
|
-
parts.push(`Project Key: ${config.projectKey}`);
|
|
1030
|
-
}
|
|
1031
|
-
else if (config.projectId) {
|
|
1032
|
-
parts.push(`Project ID: ${config.projectId}`);
|
|
1033
|
-
}
|
|
1034
|
-
return parts.join("\n");
|
|
1035
|
-
}
|
|
1036
|
-
case ConfigType.CONFLUENCE: {
|
|
1037
|
-
const parts = [`Type: Confluence`, `Integration ID: ${config.integrationId}`];
|
|
1038
|
-
if (config.spaceName)
|
|
1039
|
-
parts.push(`Space: ${config.spaceName}`);
|
|
1040
|
-
if (config.pageName) {
|
|
1041
|
-
parts.push(`Page: ${config.pageName}`);
|
|
1042
|
-
}
|
|
1043
|
-
else if (config.pageId) {
|
|
1044
|
-
parts.push(`Page ID: ${config.pageId}`);
|
|
1045
|
-
}
|
|
904
|
+
if ("eventTypes" in config && config.eventTypes?.length)
|
|
905
|
+
parts.push(`Event Types: ${config.eventTypes.join(", ")}`);
|
|
1046
906
|
return parts.join("\n");
|
|
1047
907
|
}
|
|
1048
908
|
case ConfigType.POSTHOG: {
|
|
@@ -1099,15 +959,12 @@ export const CONFIG_METADATA = {
|
|
|
1099
959
|
[ConfigType.GMAIL]: GmailConfig,
|
|
1100
960
|
[ConfigType.GMAIL_OUTPUT]: GmailOutputConfig,
|
|
1101
961
|
[ConfigType.GMAIL_DRAFT_OUTPUT]: GmailDraftOutputConfig,
|
|
1102
|
-
[ConfigType.FIGMA]: FigmaConfig,
|
|
1103
962
|
[ConfigType.SLACK]: SlackConfig,
|
|
1104
963
|
[ConfigType.SLACK_OUTPUT]: SlackOutputConfig,
|
|
1105
964
|
[ConfigType.NOTION]: NotionConfig,
|
|
1106
965
|
[ConfigType.LINEAR_INPUT]: LinearInputConfig,
|
|
1107
966
|
[ConfigType.LINEAR_OUTPUT]: LinearOutputConfig,
|
|
1108
967
|
[ConfigType.GITHUB]: GitHubConfig,
|
|
1109
|
-
[ConfigType.JIRA]: JiraConfig,
|
|
1110
|
-
[ConfigType.CONFLUENCE]: ConfluenceConfig,
|
|
1111
968
|
[ConfigType.POSTHOG]: PosthogConfig,
|
|
1112
969
|
[ConfigType.DATADOG]: DatadogConfig,
|
|
1113
970
|
[ConfigType.TIME_TRIGGER]: TimeTriggerConfig,
|
package/dist/Integrations.d.ts
CHANGED
|
@@ -3,10 +3,8 @@ export declare enum IntegrationType {
|
|
|
3
3
|
GITHUB = "github",
|
|
4
4
|
GMAIL = "gmail",
|
|
5
5
|
LINEAR = "linear",
|
|
6
|
-
ATLASSIAN = "atlassian",
|
|
7
6
|
SLACK = "slack",
|
|
8
7
|
NOTION = "notion",
|
|
9
|
-
FIGMA = "figma",
|
|
10
8
|
TERSE = "terse",
|
|
11
9
|
POSTHOG = "posthog",
|
|
12
10
|
DATADOG = "datadog",
|
|
@@ -53,20 +51,6 @@ export declare const SlackIntegrationMetadata: {
|
|
|
53
51
|
readonly isInput: true;
|
|
54
52
|
readonly isOutput: true;
|
|
55
53
|
};
|
|
56
|
-
export declare const FigmaIntegrationMetadata: {
|
|
57
|
-
readonly type: IntegrationType.FIGMA;
|
|
58
|
-
readonly name: "Figma";
|
|
59
|
-
readonly description: "Trigger on Figma file comments (does not support file edits or design changes)";
|
|
60
|
-
readonly isInput: true;
|
|
61
|
-
readonly isOutput: false;
|
|
62
|
-
};
|
|
63
|
-
export declare const AtlassianIntegrationMetadata: {
|
|
64
|
-
readonly type: IntegrationType.ATLASSIAN;
|
|
65
|
-
readonly name: "Atlassian";
|
|
66
|
-
readonly description: "Update documents in Atlassian";
|
|
67
|
-
readonly isInput: true;
|
|
68
|
-
readonly isOutput: false;
|
|
69
|
-
};
|
|
70
54
|
export declare const GithubIntegrationMetadata: {
|
|
71
55
|
readonly type: IntegrationType.GITHUB;
|
|
72
56
|
readonly name: "Github";
|
|
@@ -154,9 +138,7 @@ export type IntegrationInstallationOptions = EnsureExhaustiveInstallationOptions
|
|
|
154
138
|
[IntegrationType.GMAIL]: NoInstallationOptions;
|
|
155
139
|
[IntegrationType.NOTION]: NoInstallationOptions;
|
|
156
140
|
[IntegrationType.LINEAR]: NoInstallationOptions;
|
|
157
|
-
[IntegrationType.ATLASSIAN]: NoInstallationOptions;
|
|
158
141
|
[IntegrationType.GITHUB]: NoInstallationOptions;
|
|
159
|
-
[IntegrationType.FIGMA]: NoInstallationOptions;
|
|
160
142
|
[IntegrationType.TERSE]: NoInstallationOptions;
|
|
161
143
|
[IntegrationType.POSTHOG]: NoInstallationOptions;
|
|
162
144
|
[IntegrationType.DATADOG]: NoInstallationOptions;
|
|
@@ -182,28 +164,12 @@ export declare const GmailIntegrationSchema: z.ZodObject<{
|
|
|
182
164
|
watchExpiration: z.ZodOptional<z.ZodDate>;
|
|
183
165
|
}, z.core.$strip>;
|
|
184
166
|
export type GmailIntegration = z.infer<typeof GmailIntegrationSchema>;
|
|
185
|
-
export declare const FigmaIntegrationSchema: z.ZodObject<{
|
|
186
|
-
id: z.ZodString;
|
|
187
|
-
handle: z.ZodString;
|
|
188
|
-
figma_user_id: z.ZodString;
|
|
189
|
-
token_expiry: z.ZodDate;
|
|
190
|
-
}, z.core.$strip>;
|
|
191
|
-
export type FigmaIntegration = z.infer<typeof FigmaIntegrationSchema>;
|
|
192
167
|
export declare const NotionIntegrationSchema: z.ZodObject<{
|
|
193
168
|
id: z.ZodString;
|
|
194
169
|
workspaceId: z.ZodOptional<z.ZodString>;
|
|
195
170
|
workspaceName: z.ZodOptional<z.ZodString>;
|
|
196
171
|
}, z.core.$strip>;
|
|
197
172
|
export type NotionIntegration = z.infer<typeof NotionIntegrationSchema>;
|
|
198
|
-
export declare const AtlassianIntegrationSchema: z.ZodObject<{
|
|
199
|
-
id: z.ZodString;
|
|
200
|
-
baseUrl: z.ZodURL;
|
|
201
|
-
email: z.ZodEmail;
|
|
202
|
-
siteName: z.ZodOptional<z.ZodString>;
|
|
203
|
-
projectKey: z.ZodOptional<z.ZodString>;
|
|
204
|
-
projectName: z.ZodOptional<z.ZodString>;
|
|
205
|
-
}, z.core.$strip>;
|
|
206
|
-
export type AtlassianIntegration = z.infer<typeof AtlassianIntegrationSchema>;
|
|
207
173
|
export declare const GithubIntegrationSchema: z.ZodObject<{
|
|
208
174
|
id: z.ZodString;
|
|
209
175
|
installation_id: z.ZodNumber;
|