terse-types 0.0.1
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/README.md +44 -0
- package/dist/ApiRouteBuilder.d.ts +185 -0
- package/dist/ApiRouteBuilder.js +11 -0
- package/dist/ApiRoutes.json +184 -0
- package/dist/ApprovalTypes.d.ts +28 -0
- package/dist/ApprovalTypes.js +7 -0
- package/dist/ClientBoundTools.d.ts +36 -0
- package/dist/ClientBoundTools.js +36 -0
- package/dist/Configs.d.ts +628 -0
- package/dist/Configs.js +868 -0
- package/dist/DonatedState.d.ts +4 -0
- package/dist/DonatedState.js +12 -0
- package/dist/Entities.d.ts +7 -0
- package/dist/Entities.js +8 -0
- package/dist/FrontendRoutes.json +28 -0
- package/dist/FrontendRoutesBuilder.d.ts +30 -0
- package/dist/FrontendRoutesBuilder.js +13 -0
- package/dist/Integrations.d.ts +254 -0
- package/dist/Integrations.js +210 -0
- package/dist/InvalidationKeys.d.ts +52 -0
- package/dist/InvalidationKeys.js +165 -0
- package/dist/ModelEvents.d.ts +175 -0
- package/dist/ModelEvents.js +28 -0
- package/dist/Notifications.d.ts +42 -0
- package/dist/Notifications.js +5 -0
- package/dist/RunHistoryTypes.d.ts +103 -0
- package/dist/RunHistoryTypes.js +29 -0
- package/dist/SentNotifications.d.ts +29 -0
- package/dist/SentNotifications.js +12 -0
- package/dist/SocketEvents.d.ts +48 -0
- package/dist/SocketEvents.js +52 -0
- package/dist/Survey.d.ts +9 -0
- package/dist/Survey.js +1 -0
- package/dist/TicketSystem.d.ts +153 -0
- package/dist/TicketSystem.js +20 -0
- package/dist/ToolDisplayUtils.d.ts +29 -0
- package/dist/ToolDisplayUtils.js +1162 -0
- package/dist/Tools.d.ts +9202 -0
- package/dist/Tools.js +2099 -0
- package/dist/ToolsTypes.d.ts +17 -0
- package/dist/ToolsTypes.js +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +20 -0
- package/dist/types.d.ts +704 -0
- package/dist/types.js +115 -0
- package/package.json +45 -0
package/dist/Configs.js
ADDED
|
@@ -0,0 +1,868 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { IntegrationType, integrationTypeEnum } from "./Integrations.js";
|
|
3
|
+
export var ConfigType;
|
|
4
|
+
(function (ConfigType) {
|
|
5
|
+
ConfigType["GMAIL"] = "gmail";
|
|
6
|
+
ConfigType["GMAIL_OUTPUT"] = "gmail_output";
|
|
7
|
+
ConfigType["GMAIL_DRAFT_OUTPUT"] = "gmail_draft_output";
|
|
8
|
+
ConfigType["FIGMA"] = "figma";
|
|
9
|
+
ConfigType["SLACK"] = "slack";
|
|
10
|
+
ConfigType["SLACK_OUTPUT"] = "slack_output";
|
|
11
|
+
ConfigType["NOTION"] = "notion";
|
|
12
|
+
ConfigType["LINEAR_INPUT"] = "linear_input";
|
|
13
|
+
ConfigType["LINEAR_OUTPUT"] = "linear_output";
|
|
14
|
+
ConfigType["GITHUB"] = "github";
|
|
15
|
+
ConfigType["JIRA"] = "jira";
|
|
16
|
+
ConfigType["CONFLUENCE"] = "confluence";
|
|
17
|
+
ConfigType["POSTHOG"] = "POSTHOG";
|
|
18
|
+
ConfigType["DATADOG"] = "DATADOG";
|
|
19
|
+
ConfigType["TIME_TRIGGER"] = "time_trigger";
|
|
20
|
+
ConfigType["LAUNCHDARKLY"] = "launchdarkly";
|
|
21
|
+
ConfigType["TERSE"] = "terse";
|
|
22
|
+
ConfigType["WORKOS_INPUT"] = "workos_input";
|
|
23
|
+
ConfigType["WORKOS_OUTPUT"] = "workos_output";
|
|
24
|
+
ConfigType["ATTIO_OUTPUT"] = "attio_output";
|
|
25
|
+
ConfigType["SNOWFLAKE_OUTPUT"] = "snowflake_output";
|
|
26
|
+
})(ConfigType || (ConfigType = {}));
|
|
27
|
+
export const configTypeEnum = z.enum(ConfigType);
|
|
28
|
+
// Metadata objects - using const objects instead of classes
|
|
29
|
+
export const GmailConfigMetadata = {
|
|
30
|
+
configType: ConfigType.GMAIL,
|
|
31
|
+
name: "Gmail",
|
|
32
|
+
description: "Monitor incoming emails",
|
|
33
|
+
integrationType: IntegrationType.GMAIL,
|
|
34
|
+
isInput: true,
|
|
35
|
+
isOutput: false
|
|
36
|
+
};
|
|
37
|
+
export const FigmaConfigMetadata = {
|
|
38
|
+
configType: ConfigType.FIGMA,
|
|
39
|
+
name: "Figma",
|
|
40
|
+
description: "Monitor design changes in Figma files",
|
|
41
|
+
integrationType: IntegrationType.FIGMA,
|
|
42
|
+
isInput: true,
|
|
43
|
+
isOutput: false
|
|
44
|
+
};
|
|
45
|
+
export const SlackConfigMetadata = {
|
|
46
|
+
configType: ConfigType.SLACK,
|
|
47
|
+
name: "Slack",
|
|
48
|
+
description: "Monitor messages in Slack channels or DMs",
|
|
49
|
+
integrationType: IntegrationType.SLACK,
|
|
50
|
+
isInput: true,
|
|
51
|
+
isOutput: false
|
|
52
|
+
};
|
|
53
|
+
export const SlackOutputConfigMetadata = {
|
|
54
|
+
configType: ConfigType.SLACK_OUTPUT,
|
|
55
|
+
name: "Slack",
|
|
56
|
+
description: "Send messages to Slack channels, group DMs, or direct messages",
|
|
57
|
+
integrationType: IntegrationType.SLACK,
|
|
58
|
+
isInput: false,
|
|
59
|
+
isOutput: true
|
|
60
|
+
};
|
|
61
|
+
export const GmailOutputConfigMetadata = {
|
|
62
|
+
configType: ConfigType.GMAIL_OUTPUT,
|
|
63
|
+
name: "Gmail",
|
|
64
|
+
description: "Send emails via Gmail",
|
|
65
|
+
integrationType: IntegrationType.GMAIL,
|
|
66
|
+
isInput: false,
|
|
67
|
+
isOutput: true
|
|
68
|
+
};
|
|
69
|
+
export const GmailDraftOutputConfigMetadata = {
|
|
70
|
+
configType: ConfigType.GMAIL_DRAFT_OUTPUT,
|
|
71
|
+
name: "Gmail Draft",
|
|
72
|
+
description: "Create draft emails in Gmail",
|
|
73
|
+
integrationType: IntegrationType.GMAIL,
|
|
74
|
+
isInput: false,
|
|
75
|
+
isOutput: true
|
|
76
|
+
};
|
|
77
|
+
export const NotionConfigMetadata = {
|
|
78
|
+
configType: ConfigType.NOTION,
|
|
79
|
+
name: "Notion",
|
|
80
|
+
description: "Update and monitor Notion pages and databases",
|
|
81
|
+
integrationType: IntegrationType.NOTION,
|
|
82
|
+
isInput: false,
|
|
83
|
+
isOutput: true
|
|
84
|
+
};
|
|
85
|
+
export const LinearInputConfigMetadata = {
|
|
86
|
+
configType: ConfigType.LINEAR_INPUT,
|
|
87
|
+
name: "Linear",
|
|
88
|
+
description: "Monitor Linear issues",
|
|
89
|
+
integrationType: IntegrationType.LINEAR,
|
|
90
|
+
isInput: true,
|
|
91
|
+
isOutput: false
|
|
92
|
+
};
|
|
93
|
+
export const LinearOutputConfigMetadata = {
|
|
94
|
+
configType: ConfigType.LINEAR_OUTPUT,
|
|
95
|
+
name: "Linear",
|
|
96
|
+
description: "Update Linear issues",
|
|
97
|
+
integrationType: IntegrationType.LINEAR,
|
|
98
|
+
isInput: false,
|
|
99
|
+
isOutput: true
|
|
100
|
+
};
|
|
101
|
+
export const GitHubConfigMetadata = {
|
|
102
|
+
configType: ConfigType.GITHUB,
|
|
103
|
+
name: "GitHub",
|
|
104
|
+
description: "Monitor and read Github repositories",
|
|
105
|
+
integrationType: IntegrationType.GITHUB,
|
|
106
|
+
isInput: true,
|
|
107
|
+
isOutput: true
|
|
108
|
+
};
|
|
109
|
+
export const JiraConfigMetadata = {
|
|
110
|
+
configType: ConfigType.JIRA,
|
|
111
|
+
name: "Jira",
|
|
112
|
+
description: "Monitor and update Jira issues",
|
|
113
|
+
integrationType: IntegrationType.ATLASSIAN,
|
|
114
|
+
isInput: true,
|
|
115
|
+
isOutput: true
|
|
116
|
+
};
|
|
117
|
+
export const ConfluenceConfigMetadata = {
|
|
118
|
+
configType: ConfigType.CONFLUENCE,
|
|
119
|
+
name: "Confluence",
|
|
120
|
+
description: "Update Confluence pages",
|
|
121
|
+
integrationType: IntegrationType.ATLASSIAN,
|
|
122
|
+
isInput: false,
|
|
123
|
+
isOutput: true
|
|
124
|
+
};
|
|
125
|
+
export const PosthogConfigMetadata = {
|
|
126
|
+
configType: ConfigType.POSTHOG,
|
|
127
|
+
name: "Posthog",
|
|
128
|
+
description: "Track user events",
|
|
129
|
+
integrationType: IntegrationType.POSTHOG,
|
|
130
|
+
isInput: false,
|
|
131
|
+
isOutput: true
|
|
132
|
+
};
|
|
133
|
+
export const DatadogConfigMetadata = {
|
|
134
|
+
configType: ConfigType.DATADOG,
|
|
135
|
+
name: "Datadog",
|
|
136
|
+
description: "Search logs in Datadog",
|
|
137
|
+
integrationType: IntegrationType.DATADOG,
|
|
138
|
+
isInput: false,
|
|
139
|
+
isOutput: true
|
|
140
|
+
};
|
|
141
|
+
export const TimeTriggerConfigMetadata = {
|
|
142
|
+
configType: ConfigType.TIME_TRIGGER,
|
|
143
|
+
name: "Time Trigger",
|
|
144
|
+
description: "Run on a schedule (daily, weekly, etc.)",
|
|
145
|
+
integrationType: IntegrationType.CRON_JOB,
|
|
146
|
+
isInput: true,
|
|
147
|
+
isOutput: false
|
|
148
|
+
};
|
|
149
|
+
export const LaunchDarklyConfigMetadata = {
|
|
150
|
+
configType: ConfigType.LAUNCHDARKLY,
|
|
151
|
+
name: "LaunchDarkly",
|
|
152
|
+
description: "Query feature flags",
|
|
153
|
+
integrationType: IntegrationType.LAUNCHDARKLY,
|
|
154
|
+
isInput: false,
|
|
155
|
+
isOutput: true
|
|
156
|
+
};
|
|
157
|
+
export const TerseConfigMetadata = {
|
|
158
|
+
configType: ConfigType.TERSE,
|
|
159
|
+
name: "Terse Skills",
|
|
160
|
+
description: "Built-in capabilities like web search (always available to agents)",
|
|
161
|
+
integrationType: IntegrationType.TERSE,
|
|
162
|
+
isInput: false,
|
|
163
|
+
isOutput: true
|
|
164
|
+
};
|
|
165
|
+
export const WorkOSInputConfigMetadata = {
|
|
166
|
+
configType: ConfigType.WORKOS_INPUT,
|
|
167
|
+
name: "WorkOS",
|
|
168
|
+
description: "Trigger on user signup, deletion, or membership changes in your app",
|
|
169
|
+
integrationType: IntegrationType.WORKOS,
|
|
170
|
+
isInput: true,
|
|
171
|
+
isOutput: false
|
|
172
|
+
};
|
|
173
|
+
export const WorkOSOutputConfigMetadata = {
|
|
174
|
+
configType: ConfigType.WORKOS_OUTPUT,
|
|
175
|
+
name: "WorkOS",
|
|
176
|
+
description: "Fetch and search users from your WorkOS account",
|
|
177
|
+
integrationType: IntegrationType.WORKOS,
|
|
178
|
+
isInput: false,
|
|
179
|
+
isOutput: true
|
|
180
|
+
};
|
|
181
|
+
export const AttioOutputConfigMetadata = {
|
|
182
|
+
configType: ConfigType.ATTIO_OUTPUT,
|
|
183
|
+
name: "Attio",
|
|
184
|
+
description: "Add and update contacts in Attio",
|
|
185
|
+
integrationType: IntegrationType.ATTIO,
|
|
186
|
+
isInput: false,
|
|
187
|
+
isOutput: true
|
|
188
|
+
};
|
|
189
|
+
export const SnowflakeOutputConfigMetadata = {
|
|
190
|
+
configType: ConfigType.SNOWFLAKE_OUTPUT,
|
|
191
|
+
name: "Snowflake",
|
|
192
|
+
description: "Run read-only queries against Snowflake data warehouses",
|
|
193
|
+
integrationType: IntegrationType.SNOWFLAKE,
|
|
194
|
+
isInput: false,
|
|
195
|
+
isOutput: true
|
|
196
|
+
};
|
|
197
|
+
export const CONFIG_DETAILS = {
|
|
198
|
+
[ConfigType.GMAIL]: GmailConfigMetadata,
|
|
199
|
+
[ConfigType.GMAIL_OUTPUT]: GmailOutputConfigMetadata,
|
|
200
|
+
[ConfigType.GMAIL_DRAFT_OUTPUT]: GmailDraftOutputConfigMetadata,
|
|
201
|
+
[ConfigType.FIGMA]: FigmaConfigMetadata,
|
|
202
|
+
[ConfigType.SLACK]: SlackConfigMetadata,
|
|
203
|
+
[ConfigType.SLACK_OUTPUT]: SlackOutputConfigMetadata,
|
|
204
|
+
[ConfigType.NOTION]: NotionConfigMetadata,
|
|
205
|
+
[ConfigType.LINEAR_INPUT]: LinearInputConfigMetadata,
|
|
206
|
+
[ConfigType.LINEAR_OUTPUT]: LinearOutputConfigMetadata,
|
|
207
|
+
[ConfigType.GITHUB]: GitHubConfigMetadata,
|
|
208
|
+
[ConfigType.JIRA]: JiraConfigMetadata,
|
|
209
|
+
[ConfigType.CONFLUENCE]: ConfluenceConfigMetadata,
|
|
210
|
+
[ConfigType.POSTHOG]: PosthogConfigMetadata,
|
|
211
|
+
[ConfigType.DATADOG]: DatadogConfigMetadata,
|
|
212
|
+
[ConfigType.TIME_TRIGGER]: TimeTriggerConfigMetadata,
|
|
213
|
+
[ConfigType.LAUNCHDARKLY]: LaunchDarklyConfigMetadata,
|
|
214
|
+
[ConfigType.TERSE]: TerseConfigMetadata,
|
|
215
|
+
[ConfigType.WORKOS_INPUT]: WorkOSInputConfigMetadata,
|
|
216
|
+
[ConfigType.WORKOS_OUTPUT]: WorkOSOutputConfigMetadata,
|
|
217
|
+
[ConfigType.ATTIO_OUTPUT]: AttioOutputConfigMetadata,
|
|
218
|
+
[ConfigType.SNOWFLAKE_OUTPUT]: SnowflakeOutputConfigMetadata
|
|
219
|
+
};
|
|
220
|
+
// MARK: Event Types — specific events within each integration trigger
|
|
221
|
+
export var SlackEventType;
|
|
222
|
+
(function (SlackEventType) {
|
|
223
|
+
SlackEventType["MESSAGE"] = "message";
|
|
224
|
+
SlackEventType["APP_MENTION"] = "app_mention";
|
|
225
|
+
SlackEventType["REACTION_ADDED"] = "reaction_added";
|
|
226
|
+
})(SlackEventType || (SlackEventType = {}));
|
|
227
|
+
export var GitHubEventType;
|
|
228
|
+
(function (GitHubEventType) {
|
|
229
|
+
GitHubEventType["PUSH"] = "push";
|
|
230
|
+
GitHubEventType["PR_OPENED"] = "pull_request.opened";
|
|
231
|
+
GitHubEventType["PR_MERGED"] = "pull_request.merged";
|
|
232
|
+
GitHubEventType["PR_CLOSED"] = "pull_request.closed";
|
|
233
|
+
GitHubEventType["PR_SYNCHRONIZE"] = "pull_request.synchronize";
|
|
234
|
+
})(GitHubEventType || (GitHubEventType = {}));
|
|
235
|
+
export var LinearEventType;
|
|
236
|
+
(function (LinearEventType) {
|
|
237
|
+
LinearEventType["ISSUE_CREATED"] = "issue.created";
|
|
238
|
+
LinearEventType["ISSUE_UPDATED"] = "issue.updated";
|
|
239
|
+
LinearEventType["COMMENT_CREATED"] = "comment.created";
|
|
240
|
+
})(LinearEventType || (LinearEventType = {}));
|
|
241
|
+
export var JiraEventType;
|
|
242
|
+
(function (JiraEventType) {
|
|
243
|
+
JiraEventType["ISSUE_CREATED"] = "issue.created";
|
|
244
|
+
JiraEventType["ISSUE_UPDATED"] = "issue.updated";
|
|
245
|
+
})(JiraEventType || (JiraEventType = {}));
|
|
246
|
+
export var FigmaEventType;
|
|
247
|
+
(function (FigmaEventType) {
|
|
248
|
+
FigmaEventType["FILE_COMMENT"] = "file_comment";
|
|
249
|
+
})(FigmaEventType || (FigmaEventType = {}));
|
|
250
|
+
export var GmailEventType;
|
|
251
|
+
(function (GmailEventType) {
|
|
252
|
+
GmailEventType["EMAIL_RECEIVED"] = "email.received";
|
|
253
|
+
})(GmailEventType || (GmailEventType = {}));
|
|
254
|
+
export var WorkOSEventType;
|
|
255
|
+
(function (WorkOSEventType) {
|
|
256
|
+
WorkOSEventType["USER_CREATED"] = "user.created";
|
|
257
|
+
WorkOSEventType["USER_UPDATED"] = "user.updated";
|
|
258
|
+
WorkOSEventType["USER_DELETED"] = "user.deleted";
|
|
259
|
+
WorkOSEventType["ORGANIZATION_CREATED"] = "organization.created";
|
|
260
|
+
WorkOSEventType["ORGANIZATION_MEMBERSHIP_CREATED"] = "organization_membership.created";
|
|
261
|
+
WorkOSEventType["ORGANIZATION_MEMBERSHIP_UPDATED"] = "organization_membership.updated";
|
|
262
|
+
WorkOSEventType["ORGANIZATION_MEMBERSHIP_DELETED"] = "organization_membership.deleted";
|
|
263
|
+
WorkOSEventType["INVITATION_CREATED"] = "invitation.created";
|
|
264
|
+
WorkOSEventType["INVITATION_ACCEPTED"] = "invitation.accepted";
|
|
265
|
+
WorkOSEventType["INVITATION_RESENT"] = "invitation.resent";
|
|
266
|
+
WorkOSEventType["INVITATION_REVOKED"] = "invitation.revoked";
|
|
267
|
+
})(WorkOSEventType || (WorkOSEventType = {}));
|
|
268
|
+
export const ConfigInstanceSchema = z.object({
|
|
269
|
+
integrationId: z.string(),
|
|
270
|
+
integrationType: integrationTypeEnum,
|
|
271
|
+
configType: configTypeEnum
|
|
272
|
+
});
|
|
273
|
+
class BaseConfigInstance {
|
|
274
|
+
integrationId;
|
|
275
|
+
integrationType;
|
|
276
|
+
configType;
|
|
277
|
+
constructor(integrationId, integrationType, configType) {
|
|
278
|
+
this.integrationId = integrationId;
|
|
279
|
+
this.integrationType = integrationType;
|
|
280
|
+
this.configType = configType;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
export const GmailConfigSchema = ConfigInstanceSchema.extend({
|
|
284
|
+
integrationType: z.literal(IntegrationType.GMAIL),
|
|
285
|
+
configType: z.literal(ConfigType.GMAIL),
|
|
286
|
+
eventTypes: z.array(z.enum(GmailEventType)).optional()
|
|
287
|
+
});
|
|
288
|
+
export class GmailConfig extends BaseConfigInstance {
|
|
289
|
+
eventTypes;
|
|
290
|
+
constructor(integrationId, eventTypes) {
|
|
291
|
+
super(integrationId, IntegrationType.GMAIL, ConfigType.GMAIL);
|
|
292
|
+
this.eventTypes = eventTypes;
|
|
293
|
+
}
|
|
294
|
+
isComplete() {
|
|
295
|
+
return true;
|
|
296
|
+
}
|
|
297
|
+
formatForAgent() {
|
|
298
|
+
return `Type: Gmail\nIntegration ID: ${this.integrationId}`;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
export const FigmaConfigSchema = ConfigInstanceSchema.extend({
|
|
302
|
+
integrationType: z.literal(IntegrationType.FIGMA),
|
|
303
|
+
configType: z.literal(ConfigType.FIGMA),
|
|
304
|
+
fileKey: z.string(),
|
|
305
|
+
fileName: z.string(),
|
|
306
|
+
teamId: z.string(),
|
|
307
|
+
eventTypes: z.array(z.enum(FigmaEventType)).optional()
|
|
308
|
+
});
|
|
309
|
+
export class FigmaConfig extends BaseConfigInstance {
|
|
310
|
+
fileKey;
|
|
311
|
+
fileName;
|
|
312
|
+
teamId;
|
|
313
|
+
eventTypes;
|
|
314
|
+
constructor(integrationId, fileKey, fileName, teamId, eventTypes) {
|
|
315
|
+
super(integrationId, IntegrationType.FIGMA, ConfigType.FIGMA);
|
|
316
|
+
this.fileKey = fileKey;
|
|
317
|
+
this.fileName = fileName;
|
|
318
|
+
this.teamId = teamId;
|
|
319
|
+
this.eventTypes = eventTypes;
|
|
320
|
+
}
|
|
321
|
+
isComplete() {
|
|
322
|
+
return !!(this.fileKey && this.teamId);
|
|
323
|
+
}
|
|
324
|
+
formatForAgent() {
|
|
325
|
+
const parts = [`Type: Figma`, `Integration ID: ${this.integrationId}`];
|
|
326
|
+
if (this.fileName) {
|
|
327
|
+
parts.push(`File: ${this.fileName}`);
|
|
328
|
+
}
|
|
329
|
+
if (this.fileKey) {
|
|
330
|
+
parts.push(`File Key: ${this.fileKey}`);
|
|
331
|
+
}
|
|
332
|
+
return parts.join("\n");
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
export const SlackConfigSchema = ConfigInstanceSchema.extend({
|
|
336
|
+
integrationType: z.literal(IntegrationType.SLACK),
|
|
337
|
+
configType: z.literal(ConfigType.SLACK),
|
|
338
|
+
channelId: z.string().optional(),
|
|
339
|
+
channelName: z.string().optional(),
|
|
340
|
+
listenToUserDms: z.boolean().default(false),
|
|
341
|
+
userIds: z.array(z.string()).optional(),
|
|
342
|
+
eventTypes: z.array(z.enum(SlackEventType)).optional()
|
|
343
|
+
});
|
|
344
|
+
export class SlackConfig extends BaseConfigInstance {
|
|
345
|
+
channelId;
|
|
346
|
+
channelName;
|
|
347
|
+
listenToUserDms;
|
|
348
|
+
userIds;
|
|
349
|
+
eventTypes;
|
|
350
|
+
constructor(integrationId, channelId, channelName, listenToUserDms = false, userIds, eventTypes) {
|
|
351
|
+
super(integrationId, IntegrationType.SLACK, ConfigType.SLACK);
|
|
352
|
+
this.channelId = channelId;
|
|
353
|
+
this.channelName = channelName;
|
|
354
|
+
this.listenToUserDms = listenToUserDms;
|
|
355
|
+
this.userIds = userIds;
|
|
356
|
+
this.eventTypes = eventTypes;
|
|
357
|
+
}
|
|
358
|
+
isComplete() {
|
|
359
|
+
// Slack is complete if either channelId is set OR listenToUserDms is true
|
|
360
|
+
return !!(this.channelId || this.listenToUserDms);
|
|
361
|
+
}
|
|
362
|
+
formatForAgent() {
|
|
363
|
+
const parts = [`Type: Slack`, `Integration ID: ${this.integrationId}`];
|
|
364
|
+
if (this.channelName) {
|
|
365
|
+
parts.push(`Channel: ${this.channelName}`);
|
|
366
|
+
}
|
|
367
|
+
else if (this.channelId) {
|
|
368
|
+
parts.push(`Channel ID: ${this.channelId}`);
|
|
369
|
+
}
|
|
370
|
+
if (this.listenToUserDms) {
|
|
371
|
+
parts.push(`Listening to user DMs: Yes`);
|
|
372
|
+
}
|
|
373
|
+
if (this.userIds) {
|
|
374
|
+
parts.push(`Users: ${this.userIds.join(", ")}`);
|
|
375
|
+
}
|
|
376
|
+
return parts.join("\n");
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
export const SlackOutputConfigSchema = ConfigInstanceSchema.extend({
|
|
380
|
+
integrationType: z.literal(IntegrationType.SLACK),
|
|
381
|
+
configType: z.literal(ConfigType.SLACK_OUTPUT),
|
|
382
|
+
channelId: z.string().optional(),
|
|
383
|
+
channelName: z.string().optional(),
|
|
384
|
+
userIds: z.array(z.string()).optional(),
|
|
385
|
+
userNames: z.array(z.string()).optional(),
|
|
386
|
+
listenToUserDms: z.boolean().default(false)
|
|
387
|
+
});
|
|
388
|
+
export class SlackOutputConfig extends BaseConfigInstance {
|
|
389
|
+
channelId;
|
|
390
|
+
channelName;
|
|
391
|
+
userIds;
|
|
392
|
+
userNames;
|
|
393
|
+
listenToUserDms;
|
|
394
|
+
constructor(integrationId, channelId, channelName, userIds, userNames, listenToUserDms = false) {
|
|
395
|
+
super(integrationId, IntegrationType.SLACK, ConfigType.SLACK_OUTPUT);
|
|
396
|
+
this.channelId = channelId;
|
|
397
|
+
this.channelName = channelName;
|
|
398
|
+
this.userIds = userIds;
|
|
399
|
+
this.userNames = userNames;
|
|
400
|
+
this.listenToUserDms = listenToUserDms;
|
|
401
|
+
}
|
|
402
|
+
isComplete() {
|
|
403
|
+
// Slack output is complete if a channel is set, DM users are set, or "listen to user DMs" is enabled.
|
|
404
|
+
return !!(this.channelId || (this.userIds?.length ?? 0) > 0 || this.listenToUserDms);
|
|
405
|
+
}
|
|
406
|
+
formatForAgent() {
|
|
407
|
+
const parts = [`Type: Slack Output`, `Integration ID: ${this.integrationId}`];
|
|
408
|
+
if (this.channelId) {
|
|
409
|
+
parts.push(`Channel ID: ${this.channelId}`);
|
|
410
|
+
}
|
|
411
|
+
if (this.listenToUserDms) {
|
|
412
|
+
parts.push(`Listen to user DMs: Yes`);
|
|
413
|
+
}
|
|
414
|
+
if (this.userIds?.length) {
|
|
415
|
+
parts.push(`DM user IDs: ${this.userIds.join(", ")}`);
|
|
416
|
+
}
|
|
417
|
+
return parts.join("\n");
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
export const GmailOutputConfigSchema = ConfigInstanceSchema.extend({
|
|
421
|
+
integrationType: z.literal(IntegrationType.GMAIL),
|
|
422
|
+
configType: z.literal(ConfigType.GMAIL_OUTPUT)
|
|
423
|
+
});
|
|
424
|
+
export class GmailOutputConfig extends BaseConfigInstance {
|
|
425
|
+
constructor(integrationId) {
|
|
426
|
+
super(integrationId, IntegrationType.GMAIL, ConfigType.GMAIL_OUTPUT);
|
|
427
|
+
}
|
|
428
|
+
isComplete() {
|
|
429
|
+
// Gmail output only requires integrationId
|
|
430
|
+
return true;
|
|
431
|
+
}
|
|
432
|
+
formatForAgent() {
|
|
433
|
+
return `Type: Gmail Output\nIntegration ID: ${this.integrationId}`;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
export const GmailDraftOutputConfigSchema = ConfigInstanceSchema.extend({
|
|
437
|
+
integrationType: z.literal(IntegrationType.GMAIL),
|
|
438
|
+
configType: z.literal(ConfigType.GMAIL_DRAFT_OUTPUT)
|
|
439
|
+
});
|
|
440
|
+
export class GmailDraftOutputConfig extends BaseConfigInstance {
|
|
441
|
+
constructor(integrationId) {
|
|
442
|
+
super(integrationId, IntegrationType.GMAIL, ConfigType.GMAIL_DRAFT_OUTPUT);
|
|
443
|
+
}
|
|
444
|
+
isComplete() {
|
|
445
|
+
return true;
|
|
446
|
+
}
|
|
447
|
+
formatForAgent() {
|
|
448
|
+
return `Type: Gmail Draft Output\nIntegration ID: ${this.integrationId}`;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
export const NotionConfigSchema = ConfigInstanceSchema.extend({
|
|
452
|
+
integrationType: z.literal(IntegrationType.NOTION),
|
|
453
|
+
configType: z.literal(ConfigType.NOTION),
|
|
454
|
+
databaseIds: z.array(z.string()).default([]),
|
|
455
|
+
databaseNames: z.array(z.string()).default([]),
|
|
456
|
+
pageIds: z.array(z.string()).default([]),
|
|
457
|
+
pageNames: z.array(z.string()).default([])
|
|
458
|
+
});
|
|
459
|
+
export class NotionConfig extends BaseConfigInstance {
|
|
460
|
+
databaseIds;
|
|
461
|
+
databaseNames;
|
|
462
|
+
pageIds;
|
|
463
|
+
pageNames;
|
|
464
|
+
constructor(integrationId, databaseIds = [], databaseNames = [], pageIds = [], pageNames = []) {
|
|
465
|
+
super(integrationId, IntegrationType.NOTION, ConfigType.NOTION);
|
|
466
|
+
this.databaseIds = databaseIds;
|
|
467
|
+
this.databaseNames = databaseNames;
|
|
468
|
+
this.pageIds = pageIds;
|
|
469
|
+
this.pageNames = pageNames;
|
|
470
|
+
}
|
|
471
|
+
isComplete() {
|
|
472
|
+
return (this.databaseIds?.length ?? 0) > 0 || (this.pageIds?.length ?? 0) > 0;
|
|
473
|
+
}
|
|
474
|
+
formatForAgent() {
|
|
475
|
+
const parts = [`Type: Notion`, `Integration ID: ${this.integrationId}`];
|
|
476
|
+
const dbIds = this.databaseIds ?? [];
|
|
477
|
+
const dbNames = this.databaseNames ?? [];
|
|
478
|
+
if (dbIds.length > 0) {
|
|
479
|
+
parts.push(`Databases: ${dbIds.map((id, i) => dbNames[i] || id).join(", ")}`);
|
|
480
|
+
}
|
|
481
|
+
const pageIds = this.pageIds ?? [];
|
|
482
|
+
const pageNames = this.pageNames ?? [];
|
|
483
|
+
if (pageIds.length > 0) {
|
|
484
|
+
parts.push(`Pages: ${pageIds.map((id, i) => pageNames[i] || id).join(", ")}`);
|
|
485
|
+
}
|
|
486
|
+
return parts.join("\n");
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
export const LinearInputConfigSchema = ConfigInstanceSchema.extend({
|
|
490
|
+
integrationType: z.literal(IntegrationType.LINEAR),
|
|
491
|
+
configType: z.literal(ConfigType.LINEAR_INPUT),
|
|
492
|
+
projectId: z.string().optional(),
|
|
493
|
+
projectName: z.string().optional(),
|
|
494
|
+
eventTypes: z.array(z.enum(LinearEventType)).optional()
|
|
495
|
+
});
|
|
496
|
+
export class LinearInputConfig extends BaseConfigInstance {
|
|
497
|
+
projectId;
|
|
498
|
+
projectName;
|
|
499
|
+
eventTypes;
|
|
500
|
+
constructor(integrationId, projectId, projectName, eventTypes) {
|
|
501
|
+
super(integrationId, IntegrationType.LINEAR, ConfigType.LINEAR_INPUT);
|
|
502
|
+
this.projectId = projectId;
|
|
503
|
+
this.projectName = projectName;
|
|
504
|
+
this.eventTypes = eventTypes;
|
|
505
|
+
}
|
|
506
|
+
isComplete() {
|
|
507
|
+
return true;
|
|
508
|
+
}
|
|
509
|
+
formatForAgent() {
|
|
510
|
+
const parts = [`Type: Linear`, `Integration ID: ${this.integrationId}`];
|
|
511
|
+
if (this.projectName) {
|
|
512
|
+
parts.push(`Project: ${this.projectName}`);
|
|
513
|
+
}
|
|
514
|
+
else if (this.projectId) {
|
|
515
|
+
parts.push(`Project ID: ${this.projectId}`);
|
|
516
|
+
}
|
|
517
|
+
return parts.join("\n");
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
export const LinearOutputConfigSchema = ConfigInstanceSchema.extend({
|
|
521
|
+
integrationType: z.literal(IntegrationType.LINEAR),
|
|
522
|
+
configType: z.literal(ConfigType.LINEAR_OUTPUT),
|
|
523
|
+
teamId: z.string().optional(),
|
|
524
|
+
teamName: z.string().optional(),
|
|
525
|
+
projectId: z.string().optional(),
|
|
526
|
+
projectName: z.string().optional()
|
|
527
|
+
});
|
|
528
|
+
export class LinearOutputConfig extends BaseConfigInstance {
|
|
529
|
+
teamId;
|
|
530
|
+
teamName;
|
|
531
|
+
projectId;
|
|
532
|
+
projectName;
|
|
533
|
+
constructor(integrationId, teamId, teamName, projectId, projectName) {
|
|
534
|
+
super(integrationId, IntegrationType.LINEAR, ConfigType.LINEAR_OUTPUT);
|
|
535
|
+
this.teamId = teamId;
|
|
536
|
+
this.teamName = teamName;
|
|
537
|
+
this.projectId = projectId;
|
|
538
|
+
this.projectName = projectName;
|
|
539
|
+
}
|
|
540
|
+
isComplete() {
|
|
541
|
+
return !!this.integrationId;
|
|
542
|
+
}
|
|
543
|
+
formatForAgent() {
|
|
544
|
+
const parts = [`Type: Linear`, `Integration ID: ${this.integrationId}`];
|
|
545
|
+
if (this.teamName) {
|
|
546
|
+
parts.push(`Team: ${this.teamName}`);
|
|
547
|
+
}
|
|
548
|
+
else if (this.teamId) {
|
|
549
|
+
parts.push(`Team ID: ${this.teamId}`);
|
|
550
|
+
}
|
|
551
|
+
if (this.projectName) {
|
|
552
|
+
parts.push(`Project: ${this.projectName}`);
|
|
553
|
+
}
|
|
554
|
+
else if (this.projectId) {
|
|
555
|
+
parts.push(`Project ID: ${this.projectId}`);
|
|
556
|
+
}
|
|
557
|
+
return parts.join("\n");
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
export const GitHubConfigSchema = ConfigInstanceSchema.extend({
|
|
561
|
+
integrationType: z.literal(IntegrationType.GITHUB),
|
|
562
|
+
configType: z.literal(ConfigType.GITHUB),
|
|
563
|
+
repositoryIds: z.array(z.number()),
|
|
564
|
+
eventTypes: z.array(z.enum(GitHubEventType)).optional()
|
|
565
|
+
});
|
|
566
|
+
export class GitHubConfig extends BaseConfigInstance {
|
|
567
|
+
repositoryIds;
|
|
568
|
+
eventTypes;
|
|
569
|
+
constructor(integrationId, repositoryIds, eventTypes) {
|
|
570
|
+
super(integrationId, IntegrationType.GITHUB, ConfigType.GITHUB);
|
|
571
|
+
this.repositoryIds = repositoryIds;
|
|
572
|
+
this.eventTypes = eventTypes;
|
|
573
|
+
}
|
|
574
|
+
isComplete() {
|
|
575
|
+
return (this.repositoryIds?.length ?? 0) > 0;
|
|
576
|
+
}
|
|
577
|
+
formatForAgent() {
|
|
578
|
+
const parts = [`Type: GitHub`, `Integration ID: ${this.integrationId}`];
|
|
579
|
+
if (this.repositoryIds.length > 0) {
|
|
580
|
+
parts.push(`Repositories: ${this.repositoryIds.join(", ")}`);
|
|
581
|
+
}
|
|
582
|
+
return parts.join("\n");
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
export const JiraConfigSchema = ConfigInstanceSchema.extend({
|
|
586
|
+
integrationType: z.literal(IntegrationType.ATLASSIAN),
|
|
587
|
+
configType: z.literal(ConfigType.JIRA),
|
|
588
|
+
projectKey: z.string().optional(),
|
|
589
|
+
projectId: z.string().optional(),
|
|
590
|
+
eventTypes: z.array(z.enum(JiraEventType)).optional()
|
|
591
|
+
});
|
|
592
|
+
export class JiraConfig extends BaseConfigInstance {
|
|
593
|
+
projectKey;
|
|
594
|
+
projectId;
|
|
595
|
+
eventTypes;
|
|
596
|
+
constructor(integrationId, projectKey, projectId, eventTypes) {
|
|
597
|
+
super(integrationId, IntegrationType.ATLASSIAN, ConfigType.JIRA);
|
|
598
|
+
this.projectKey = projectKey;
|
|
599
|
+
this.projectId = projectId;
|
|
600
|
+
this.eventTypes = eventTypes;
|
|
601
|
+
}
|
|
602
|
+
isComplete() {
|
|
603
|
+
// Jira only requires integrationId (base check handled in isInputComplete)
|
|
604
|
+
return true;
|
|
605
|
+
}
|
|
606
|
+
formatForAgent() {
|
|
607
|
+
const parts = [`Type: Jira`, `Integration ID: ${this.integrationId}`];
|
|
608
|
+
if (this.projectKey) {
|
|
609
|
+
parts.push(`Project Key: ${this.projectKey}`);
|
|
610
|
+
}
|
|
611
|
+
else if (this.projectId) {
|
|
612
|
+
parts.push(`Project ID: ${this.projectId}`);
|
|
613
|
+
}
|
|
614
|
+
return parts.join("\n");
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
export const ConfluenceConfigSchema = ConfigInstanceSchema.extend({
|
|
618
|
+
integrationType: z.literal(IntegrationType.ATLASSIAN),
|
|
619
|
+
configType: z.literal(ConfigType.CONFLUENCE),
|
|
620
|
+
spaceName: z.string(),
|
|
621
|
+
spaceId: z.string(),
|
|
622
|
+
pageId: z.string(),
|
|
623
|
+
pageName: z.string()
|
|
624
|
+
});
|
|
625
|
+
export class ConfluenceConfig extends BaseConfigInstance {
|
|
626
|
+
spaceName;
|
|
627
|
+
spaceId;
|
|
628
|
+
pageId;
|
|
629
|
+
pageName;
|
|
630
|
+
constructor(integrationId, spaceName, spaceId, pageId, // Page ID (required for outputs - specific page to write to)
|
|
631
|
+
pageName // Page display name (for UI, optional)
|
|
632
|
+
) {
|
|
633
|
+
super(integrationId, IntegrationType.ATLASSIAN, ConfigType.CONFLUENCE);
|
|
634
|
+
this.spaceName = spaceName;
|
|
635
|
+
this.spaceId = spaceId;
|
|
636
|
+
this.pageId = pageId;
|
|
637
|
+
this.pageName = pageName;
|
|
638
|
+
}
|
|
639
|
+
isComplete() {
|
|
640
|
+
// Confluence only requires integrationId (base check handled in isInputComplete)
|
|
641
|
+
return true;
|
|
642
|
+
}
|
|
643
|
+
formatForAgent() {
|
|
644
|
+
const parts = [`Type: Confluence`, `Integration ID: ${this.integrationId}`];
|
|
645
|
+
if (this.spaceName) {
|
|
646
|
+
parts.push(`Space: ${this.spaceName}`);
|
|
647
|
+
}
|
|
648
|
+
if (this.pageName) {
|
|
649
|
+
parts.push(`Page: ${this.pageName}`);
|
|
650
|
+
}
|
|
651
|
+
else if (this.pageId) {
|
|
652
|
+
parts.push(`Page ID: ${this.pageId}`);
|
|
653
|
+
}
|
|
654
|
+
return parts.join("\n");
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
export const PosthogConfigSchema = ConfigInstanceSchema.extend({
|
|
658
|
+
integrationType: z.literal(IntegrationType.POSTHOG),
|
|
659
|
+
configType: z.literal(ConfigType.POSTHOG),
|
|
660
|
+
projectId: z.string(),
|
|
661
|
+
projectName: z.string().optional()
|
|
662
|
+
});
|
|
663
|
+
export class PosthogConfig extends BaseConfigInstance {
|
|
664
|
+
projectId;
|
|
665
|
+
projectName;
|
|
666
|
+
constructor(integrationId, projectId, projectName) {
|
|
667
|
+
super(integrationId, IntegrationType.POSTHOG, ConfigType.POSTHOG);
|
|
668
|
+
this.projectId = projectId;
|
|
669
|
+
this.projectName = projectName;
|
|
670
|
+
}
|
|
671
|
+
isComplete() {
|
|
672
|
+
return !!this.projectId;
|
|
673
|
+
}
|
|
674
|
+
formatForAgent() {
|
|
675
|
+
const parts = [`Type: Posthog`, `Integration ID: ${this.integrationId}`];
|
|
676
|
+
if (this.projectId) {
|
|
677
|
+
parts.push(`Project ID: ${this.projectId}`);
|
|
678
|
+
}
|
|
679
|
+
if (this.projectName) {
|
|
680
|
+
parts.push(`Project: ${this.projectName}`);
|
|
681
|
+
}
|
|
682
|
+
return parts.join("\n");
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
export const DatadogConfigSchema = ConfigInstanceSchema.extend({
|
|
686
|
+
integrationType: z.literal(IntegrationType.DATADOG),
|
|
687
|
+
configType: z.literal(ConfigType.DATADOG),
|
|
688
|
+
defaultIndexes: z.array(z.string()).default(["main"])
|
|
689
|
+
});
|
|
690
|
+
export class DatadogConfig extends BaseConfigInstance {
|
|
691
|
+
defaultIndexes;
|
|
692
|
+
constructor(integrationId, defaultIndexes = ["main"]) {
|
|
693
|
+
super(integrationId, IntegrationType.DATADOG, ConfigType.DATADOG);
|
|
694
|
+
this.defaultIndexes = defaultIndexes;
|
|
695
|
+
}
|
|
696
|
+
isComplete() {
|
|
697
|
+
return !!this.integrationId;
|
|
698
|
+
}
|
|
699
|
+
formatForAgent() {
|
|
700
|
+
const parts = [`Type: Datadog`, `Integration ID: ${this.integrationId}`];
|
|
701
|
+
if (this.defaultIndexes && this.defaultIndexes.length > 0) {
|
|
702
|
+
parts.push(`Default indexes: ${this.defaultIndexes.join(", ")}`);
|
|
703
|
+
}
|
|
704
|
+
return parts.join("\n");
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
export const TimeTriggerConfigSchema = ConfigInstanceSchema.extend({
|
|
708
|
+
integrationId: z.literal("system"),
|
|
709
|
+
integrationType: z.literal(IntegrationType.CRON_JOB),
|
|
710
|
+
configType: z.literal(ConfigType.TIME_TRIGGER),
|
|
711
|
+
cronExpression: z.string()
|
|
712
|
+
});
|
|
713
|
+
export class TimeTriggerConfig extends BaseConfigInstance {
|
|
714
|
+
cronExpression;
|
|
715
|
+
constructor(cronExpression) {
|
|
716
|
+
super("system", IntegrationType.CRON_JOB, ConfigType.TIME_TRIGGER);
|
|
717
|
+
this.cronExpression = cronExpression;
|
|
718
|
+
}
|
|
719
|
+
isComplete() {
|
|
720
|
+
return !!this.cronExpression;
|
|
721
|
+
}
|
|
722
|
+
formatForAgent() {
|
|
723
|
+
const parts = [`Type: Time Trigger`];
|
|
724
|
+
if (this.cronExpression) {
|
|
725
|
+
parts.push(`Schedule (UTC): ${this.cronExpression}`);
|
|
726
|
+
}
|
|
727
|
+
return parts.join("\n");
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
export const LaunchDarklyConfigSchema = ConfigInstanceSchema.extend({
|
|
731
|
+
integrationType: z.literal(IntegrationType.LAUNCHDARKLY),
|
|
732
|
+
configType: z.literal(ConfigType.LAUNCHDARKLY),
|
|
733
|
+
projectKey: z.string(),
|
|
734
|
+
environmentKeys: z.array(z.string())
|
|
735
|
+
});
|
|
736
|
+
export class LaunchDarklyConfig extends BaseConfigInstance {
|
|
737
|
+
projectKey;
|
|
738
|
+
environmentKeys;
|
|
739
|
+
constructor(integrationId, projectKey, environmentKeys // ["production", "staging"]
|
|
740
|
+
) {
|
|
741
|
+
super(integrationId, IntegrationType.LAUNCHDARKLY, ConfigType.LAUNCHDARKLY);
|
|
742
|
+
this.projectKey = projectKey;
|
|
743
|
+
this.environmentKeys = environmentKeys;
|
|
744
|
+
}
|
|
745
|
+
isComplete() {
|
|
746
|
+
return !!(this.projectKey && this.environmentKeys.length > 0);
|
|
747
|
+
}
|
|
748
|
+
formatForAgent() {
|
|
749
|
+
const parts = [`Type: LaunchDarkly`, `Integration ID: ${this.integrationId}`];
|
|
750
|
+
if (this.projectKey) {
|
|
751
|
+
parts.push(`Project Key: ${this.projectKey}`);
|
|
752
|
+
}
|
|
753
|
+
if (this.environmentKeys.length > 0) {
|
|
754
|
+
parts.push(`Environments: ${this.environmentKeys.join(", ")}`);
|
|
755
|
+
}
|
|
756
|
+
return parts.join("\n");
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
export const TerseConfigSchema = ConfigInstanceSchema.extend({
|
|
760
|
+
integrationId: z.literal("system"),
|
|
761
|
+
integrationType: z.literal(IntegrationType.TERSE),
|
|
762
|
+
configType: z.literal(ConfigType.TERSE)
|
|
763
|
+
});
|
|
764
|
+
export class TerseConfig extends BaseConfigInstance {
|
|
765
|
+
constructor() {
|
|
766
|
+
super("system", IntegrationType.TERSE, ConfigType.TERSE);
|
|
767
|
+
}
|
|
768
|
+
isComplete() {
|
|
769
|
+
return true;
|
|
770
|
+
}
|
|
771
|
+
formatForAgent() {
|
|
772
|
+
return "Type: Terse Skills";
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
export const WorkOSInputConfigSchema = ConfigInstanceSchema.extend({
|
|
776
|
+
integrationType: z.literal(IntegrationType.WORKOS),
|
|
777
|
+
configType: z.literal(ConfigType.WORKOS_INPUT),
|
|
778
|
+
eventTypes: z.array(z.enum(WorkOSEventType)).default([])
|
|
779
|
+
});
|
|
780
|
+
export class WorkOSInputConfig extends BaseConfigInstance {
|
|
781
|
+
eventTypes;
|
|
782
|
+
constructor(integrationId, eventTypes = []) {
|
|
783
|
+
super(integrationId, IntegrationType.WORKOS, ConfigType.WORKOS_INPUT);
|
|
784
|
+
this.eventTypes = eventTypes;
|
|
785
|
+
}
|
|
786
|
+
isComplete() {
|
|
787
|
+
return this.eventTypes.length > 0;
|
|
788
|
+
}
|
|
789
|
+
formatForAgent() {
|
|
790
|
+
return `Type: WorkOS Events\nListening for: ${this.eventTypes.join(", ")}`;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
export const WorkOSOutputConfigSchema = ConfigInstanceSchema.extend({
|
|
794
|
+
integrationType: z.literal(IntegrationType.WORKOS),
|
|
795
|
+
configType: z.literal(ConfigType.WORKOS_OUTPUT)
|
|
796
|
+
});
|
|
797
|
+
export class WorkOSOutputConfig extends BaseConfigInstance {
|
|
798
|
+
constructor(integrationId) {
|
|
799
|
+
super(integrationId, IntegrationType.WORKOS, ConfigType.WORKOS_OUTPUT);
|
|
800
|
+
}
|
|
801
|
+
isComplete() {
|
|
802
|
+
return !!this.integrationId;
|
|
803
|
+
}
|
|
804
|
+
formatForAgent() {
|
|
805
|
+
return `Type: WorkOS Skill\nIntegration ID: ${this.integrationId}`;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
export const AttioOutputConfigSchema = ConfigInstanceSchema.extend({
|
|
809
|
+
integrationType: z.literal(IntegrationType.ATTIO),
|
|
810
|
+
configType: z.literal(ConfigType.ATTIO_OUTPUT),
|
|
811
|
+
objectSlug: z.string().optional()
|
|
812
|
+
});
|
|
813
|
+
export class AttioOutputConfig extends BaseConfigInstance {
|
|
814
|
+
objectSlug;
|
|
815
|
+
constructor(integrationId, objectSlug) {
|
|
816
|
+
super(integrationId, IntegrationType.ATTIO, ConfigType.ATTIO_OUTPUT);
|
|
817
|
+
this.objectSlug = objectSlug;
|
|
818
|
+
}
|
|
819
|
+
isComplete() {
|
|
820
|
+
return !!this.objectSlug;
|
|
821
|
+
}
|
|
822
|
+
formatForAgent() {
|
|
823
|
+
const parts = [`Type: Attio Output`, `Integration ID: ${this.integrationId}`];
|
|
824
|
+
if (this.objectSlug) {
|
|
825
|
+
parts.push(`Object: ${this.objectSlug}`);
|
|
826
|
+
}
|
|
827
|
+
return parts.join("\n");
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
export const SnowflakeOutputConfigSchema = ConfigInstanceSchema.extend({
|
|
831
|
+
integrationType: z.literal(IntegrationType.SNOWFLAKE),
|
|
832
|
+
configType: z.literal(ConfigType.SNOWFLAKE_OUTPUT)
|
|
833
|
+
});
|
|
834
|
+
export class SnowflakeOutputConfig extends BaseConfigInstance {
|
|
835
|
+
constructor(integrationId) {
|
|
836
|
+
super(integrationId, IntegrationType.SNOWFLAKE, ConfigType.SNOWFLAKE_OUTPUT);
|
|
837
|
+
}
|
|
838
|
+
isComplete() {
|
|
839
|
+
return !!this.integrationId;
|
|
840
|
+
}
|
|
841
|
+
formatForAgent() {
|
|
842
|
+
const parts = [`Type: Snowflake Output`, `Integration ID: ${this.integrationId}`];
|
|
843
|
+
return parts.join("\n");
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
export const CONFIG_METADATA = {
|
|
847
|
+
[ConfigType.GMAIL]: GmailConfig,
|
|
848
|
+
[ConfigType.GMAIL_OUTPUT]: GmailOutputConfig,
|
|
849
|
+
[ConfigType.GMAIL_DRAFT_OUTPUT]: GmailDraftOutputConfig,
|
|
850
|
+
[ConfigType.FIGMA]: FigmaConfig,
|
|
851
|
+
[ConfigType.SLACK]: SlackConfig,
|
|
852
|
+
[ConfigType.SLACK_OUTPUT]: SlackOutputConfig,
|
|
853
|
+
[ConfigType.NOTION]: NotionConfig,
|
|
854
|
+
[ConfigType.LINEAR_INPUT]: LinearInputConfig,
|
|
855
|
+
[ConfigType.LINEAR_OUTPUT]: LinearOutputConfig,
|
|
856
|
+
[ConfigType.GITHUB]: GitHubConfig,
|
|
857
|
+
[ConfigType.JIRA]: JiraConfig,
|
|
858
|
+
[ConfigType.CONFLUENCE]: ConfluenceConfig,
|
|
859
|
+
[ConfigType.POSTHOG]: PosthogConfig,
|
|
860
|
+
[ConfigType.DATADOG]: DatadogConfig,
|
|
861
|
+
[ConfigType.TIME_TRIGGER]: TimeTriggerConfig,
|
|
862
|
+
[ConfigType.LAUNCHDARKLY]: LaunchDarklyConfig,
|
|
863
|
+
[ConfigType.TERSE]: TerseConfig,
|
|
864
|
+
[ConfigType.WORKOS_INPUT]: WorkOSInputConfig,
|
|
865
|
+
[ConfigType.WORKOS_OUTPUT]: WorkOSOutputConfig,
|
|
866
|
+
[ConfigType.ATTIO_OUTPUT]: AttioOutputConfig,
|
|
867
|
+
[ConfigType.SNOWFLAKE_OUTPUT]: SnowflakeOutputConfig
|
|
868
|
+
};
|