@rudderhq/server 0.4.2-canary.0 → 0.4.2-canary.2
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/bundled-plugins/plugin-linear/dist/worker.js +48 -3
- package/dist/bundled-plugins/plugin-linear/dist/worker.js.map +3 -3
- package/dist/routes/agents.d.ts.map +1 -1
- package/dist/routes/agents.js +81 -1
- package/dist/routes/agents.js.map +1 -1
- package/dist/routes/chats.stream-routes.d.ts.map +1 -1
- package/dist/routes/chats.stream-routes.js +10 -1
- package/dist/routes/chats.stream-routes.js.map +1 -1
- package/dist/routes/onboarding.d.ts.map +1 -1
- package/dist/routes/onboarding.js +138 -0
- package/dist/routes/onboarding.js.map +1 -1
- package/dist/services/access.d.ts +1 -1
- package/dist/services/activity.d.ts +10 -10
- package/dist/services/agent-run-context.d.ts.map +1 -1
- package/dist/services/agent-run-context.js +31 -2
- package/dist/services/agent-run-context.js.map +1 -1
- package/dist/services/agents.d.ts +3 -3
- package/dist/services/assets.d.ts +2 -2
- package/dist/services/automation-chat-output.d.ts +2 -2
- package/dist/services/automations.d.ts +2 -2
- package/dist/services/board-auth.d.ts +2 -2
- package/dist/services/calendar.d.ts +4 -4
- package/dist/services/chat-assistant.d.ts.map +1 -1
- package/dist/services/chat-assistant.helpers.d.ts +7 -0
- package/dist/services/chat-assistant.helpers.d.ts.map +1 -1
- package/dist/services/chat-assistant.helpers.js +56 -11
- package/dist/services/chat-assistant.helpers.js.map +1 -1
- package/dist/services/chat-assistant.js +18 -4
- package/dist/services/chat-assistant.js.map +1 -1
- package/dist/services/chats.d.ts +16 -16
- package/dist/services/chats.d.ts.map +1 -1
- package/dist/services/chats.js +1 -1
- package/dist/services/chats.js.map +1 -1
- package/dist/services/costs.d.ts +1 -1
- package/dist/services/finance.d.ts +4 -4
- package/dist/services/goals.d.ts +12 -12
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +1 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/integrations/agent-integrations.d.ts +10 -10
- package/dist/services/integrations/custom-integrations.d.ts +46 -0
- package/dist/services/integrations/custom-integrations.d.ts.map +1 -0
- package/dist/services/integrations/custom-integrations.js +397 -0
- package/dist/services/integrations/custom-integrations.js.map +1 -0
- package/dist/services/integrations/feishu/inbound-dispatcher.d.ts.map +1 -1
- package/dist/services/integrations/feishu/inbound-dispatcher.js +13 -2
- package/dist/services/integrations/feishu/inbound-dispatcher.js.map +1 -1
- package/dist/services/integrations/feishu/runtime.d.ts.map +1 -1
- package/dist/services/integrations/feishu/runtime.js +101 -45
- package/dist/services/integrations/feishu/runtime.js.map +1 -1
- package/dist/services/integrations/feishu/user-bindings.d.ts +1 -1
- package/dist/services/issue-review-wakeup.d.ts +3 -3
- package/dist/services/orgs.d.ts +1 -1
- package/dist/services/plugin-registry.d.ts +17 -17
- package/dist/services/projects.d.ts +1 -1
- package/dist/services/runtime-kernel/heartbeat.d.ts +6 -6
- package/dist/services/runtime-kernel/heartbeat.sessions.d.ts +1 -1
- package/dist/services/secrets.d.ts +15 -15
- package/dist/services/workspace-runtime.services.d.ts +2 -2
- package/package.json +13 -13
- package/resources/bundled-skills/rudder/SKILL.md +5 -4
- package/resources/bundled-skills/rudder/references/cli-reference.md +73 -72
- package/skills/rudder/SKILL.md +5 -4
- package/skills/rudder/references/cli-reference.md +73 -72
- package/ui-dist/assets/{_basePickBy-RX5N2cj2.js → _basePickBy-D36R7lCM.js} +1 -1
- package/ui-dist/assets/{_baseUniq-Br4fg1iw.js → _baseUniq-CDbk2EfG.js} +1 -1
- package/ui-dist/assets/{arc-B8svvCeo.js → arc-PuIVeL2L.js} +1 -1
- package/ui-dist/assets/{architectureDiagram-2XIMDMQ5-C5dYOfG1.js → architectureDiagram-2XIMDMQ5-Dpbs3CcL.js} +1 -1
- package/ui-dist/assets/{blockDiagram-WCTKOSBZ-B6XhVXfw.js → blockDiagram-WCTKOSBZ-U4sl9IrM.js} +1 -1
- package/ui-dist/assets/{c4Diagram-IC4MRINW-D31WV7FX.js → c4Diagram-IC4MRINW-B9ajWZO7.js} +1 -1
- package/ui-dist/assets/channel-XkUqsYSr.js +1 -0
- package/ui-dist/assets/{chunk-4BX2VUAB-CxoBpj5-.js → chunk-4BX2VUAB-C4vMxZfk.js} +1 -1
- package/ui-dist/assets/{chunk-55IACEB6-kF3-cxbP.js → chunk-55IACEB6-Cy_Lk5qB.js} +1 -1
- package/ui-dist/assets/{chunk-FMBD7UC4-CmnJkmf-.js → chunk-FMBD7UC4-CXNSGkmm.js} +1 -1
- package/ui-dist/assets/{chunk-JSJVCQXG-U_rZ0R1l.js → chunk-JSJVCQXG-B-CG3Z7T.js} +1 -1
- package/ui-dist/assets/{chunk-KX2RTZJC-DB5h51jY.js → chunk-KX2RTZJC-5HdmRs6h.js} +1 -1
- package/ui-dist/assets/{chunk-NQ4KR5QH-D00Zb66Y.js → chunk-NQ4KR5QH-D-1z-FdA.js} +1 -1
- package/ui-dist/assets/{chunk-QZHKN3VN-CZOQzYse.js → chunk-QZHKN3VN-CY3Bu_Gm.js} +1 -1
- package/ui-dist/assets/{chunk-WL4C6EOR-CiFO_DRi.js → chunk-WL4C6EOR-Dc9pfbbl.js} +1 -1
- package/ui-dist/assets/classDiagram-VBA2DB6C-DFbVSibj.js +1 -0
- package/ui-dist/assets/classDiagram-v2-RAHNMMFH-DFbVSibj.js +1 -0
- package/ui-dist/assets/clone-CXlxd2Cd.js +1 -0
- package/ui-dist/assets/{cose-bilkent-S5V4N54A-BvkdnfgN.js → cose-bilkent-S5V4N54A-B9zmJaNz.js} +1 -1
- package/ui-dist/assets/{dagre-KLK3FWXG-DcTva6B8.js → dagre-KLK3FWXG-DNxnA4ng.js} +1 -1
- package/ui-dist/assets/{diagram-E7M64L7V-sXDqPfE1.js → diagram-E7M64L7V-Btkn-jPO.js} +1 -1
- package/ui-dist/assets/{diagram-IFDJBPK2-BVBaBBbz.js → diagram-IFDJBPK2-Cu8VMI3x.js} +1 -1
- package/ui-dist/assets/{diagram-P4PSJMXO-cjQe9ndf.js → diagram-P4PSJMXO-CTo-U8dL.js} +1 -1
- package/ui-dist/assets/{erDiagram-INFDFZHY-CFGKze0m.js → erDiagram-INFDFZHY-Bt03USCb.js} +1 -1
- package/ui-dist/assets/{flowDiagram-PKNHOUZH-D7oV-h10.js → flowDiagram-PKNHOUZH-BP5bHelq.js} +1 -1
- package/ui-dist/assets/{ganttDiagram-A5KZAMGK-Rdv3FkwM.js → ganttDiagram-A5KZAMGK-BZFE8lFv.js} +1 -1
- package/ui-dist/assets/{gitGraphDiagram-K3NZZRJ6-BejgDMgO.js → gitGraphDiagram-K3NZZRJ6-DuMKb_1b.js} +1 -1
- package/ui-dist/assets/{graph-FYmROErt.js → graph-1sbiP2ir.js} +1 -1
- package/ui-dist/assets/{index-BArpEgpP.js → index--kF_V3iA.js} +1 -1
- package/ui-dist/assets/{index-hUcZY0te.js → index-4Ko8WWCi.js} +1 -1
- package/ui-dist/assets/{index-DDHYeuwy.js → index-B858e1rL.js} +1 -1
- package/ui-dist/assets/{index-DWxCltvd.js → index-BBDxEdvP.js} +1 -1
- package/ui-dist/assets/{index-BXKKdE9_.js → index-Be2tZxXv.js} +1 -1
- package/ui-dist/assets/{index-CaLoiEJB.js → index-Bi4QEyt8.js} +1 -1
- package/ui-dist/assets/{index-DUeBWXLE.js → index-Byo_Q_UD.js} +1 -1
- package/ui-dist/assets/{index-DYYXNc6j.js → index-C-Hx82lR.js} +1 -1
- package/ui-dist/assets/{index-BipRYXd-.js → index-CNvaLNWf.js} +1 -1
- package/ui-dist/assets/{index-DaNviTjf.js → index-CgRU4_Qv.js} +1 -1
- package/ui-dist/assets/{index-CWj4VVKu.js → index-D2aVfGVC.js} +1 -1
- package/ui-dist/assets/{index-uraSHmk-.js → index-D9acFwL3.js} +1 -1
- package/ui-dist/assets/{index-4AkwW8qm.js → index-DMizeOHD.js} +1 -1
- package/ui-dist/assets/{index-BeEzPu0t.js → index-DMpqsr2d.js} +1 -1
- package/ui-dist/assets/{index-c9oJP_Zz.js → index-DSRNx4SJ.js} +1 -1
- package/ui-dist/assets/{index-CEvBo8i0.js → index-DzPG15y2.js} +449 -444
- package/ui-dist/assets/{index-DSnSYKAK.js → index-OS7CrVxf.js} +1 -1
- package/ui-dist/assets/index-SDRiEk12.css +1 -0
- package/ui-dist/assets/{index-ul4vjkem.js → index-TA0zxqE5.js} +1 -1
- package/ui-dist/assets/{infoDiagram-LFFYTUFH-D6ROD6kG.js → infoDiagram-LFFYTUFH-D_hBPmRp.js} +1 -1
- package/ui-dist/assets/{ishikawaDiagram-PHBUUO56-DcVc0cdJ.js → ishikawaDiagram-PHBUUO56-n4YW9t0A.js} +1 -1
- package/ui-dist/assets/{journeyDiagram-4ABVD52K-BRufUm59.js → journeyDiagram-4ABVD52K-DFfG_w9s.js} +1 -1
- package/ui-dist/assets/{kanban-definition-K7BYSVSG-DEQ5w7B0.js → kanban-definition-K7BYSVSG-C3eqMEyS.js} +1 -1
- package/ui-dist/assets/{layout-F5Axhkca.js → layout-JQhsde_X.js} +1 -1
- package/ui-dist/assets/{linear-BllnS5sO.js → linear-CWzBfGIS.js} +1 -1
- package/ui-dist/assets/{mermaid.core-CK8iLvY2.js → mermaid.core-BXMH5ggS.js} +4 -4
- package/ui-dist/assets/{mindmap-definition-YRQLILUH-CXI6vt68.js → mindmap-definition-YRQLILUH-CBDz1um1.js} +1 -1
- package/ui-dist/assets/{pieDiagram-SKSYHLDU-DDUy_f_g.js → pieDiagram-SKSYHLDU-CxqiwMgz.js} +1 -1
- package/ui-dist/assets/{quadrantDiagram-337W2JSQ-Cpns5Yb1.js → quadrantDiagram-337W2JSQ-DG0cr7NO.js} +1 -1
- package/ui-dist/assets/{requirementDiagram-Z7DCOOCP-6p6V6XH6.js → requirementDiagram-Z7DCOOCP-ZwKR5MXw.js} +1 -1
- package/ui-dist/assets/{sankeyDiagram-WA2Y5GQK-C52tgQmQ.js → sankeyDiagram-WA2Y5GQK-DqvzuGLX.js} +1 -1
- package/ui-dist/assets/{sequenceDiagram-2WXFIKYE-CxlW_veo.js → sequenceDiagram-2WXFIKYE-DudiWeJe.js} +1 -1
- package/ui-dist/assets/{stateDiagram-RAJIS63D-NFOjAzLj.js → stateDiagram-RAJIS63D-BQsJce3e.js} +1 -1
- package/ui-dist/assets/stateDiagram-v2-FVOUBMTO-B-TTX9ts.js +1 -0
- package/ui-dist/assets/{timeline-definition-YZTLITO2-DvENY4C6.js → timeline-definition-YZTLITO2-DZ5LazEJ.js} +1 -1
- package/ui-dist/assets/{treemap-KZPCXAKY-BJfIPF5s.js → treemap-KZPCXAKY-CW_XmQMY.js} +1 -1
- package/ui-dist/assets/{vennDiagram-LZ73GAT5-DmGW-P4z.js → vennDiagram-LZ73GAT5-eu3fZhWQ.js} +1 -1
- package/ui-dist/assets/{xychartDiagram-JWTSCODW-bbLe3hqw.js → xychartDiagram-JWTSCODW-BLDFpHrj.js} +1 -1
- package/ui-dist/brands/github-logo.svg +1 -0
- package/ui-dist/brands/gmail-logo.svg +1 -0
- package/ui-dist/brands/google-calendar-logo.svg +1 -0
- package/ui-dist/brands/google-drive-logo.svg +1 -0
- package/ui-dist/brands/linear-logo.svg +1 -0
- package/ui-dist/brands/notion-logo.svg +1 -0
- package/ui-dist/index.html +43 -6
- package/ui-dist/assets/channel-BD332hbj.js +0 -1
- package/ui-dist/assets/classDiagram-VBA2DB6C-BJA0edKB.js +0 -1
- package/ui-dist/assets/classDiagram-v2-RAHNMMFH-BJA0edKB.js +0 -1
- package/ui-dist/assets/clone-BXc7Yvje.js +0 -1
- package/ui-dist/assets/index-BPlr2F3e.css +0 -1
- package/ui-dist/assets/stateDiagram-v2-FVOUBMTO-DblG-d9U.js +0 -1
package/dist/services/goals.d.ts
CHANGED
|
@@ -16,12 +16,12 @@ type GoalPatch = Partial<typeof goals.$inferInsert>;
|
|
|
16
16
|
export declare function getDefaultCompanyGoal(db: GoalReader, orgId: string): Promise<{
|
|
17
17
|
id: string;
|
|
18
18
|
orgId: string;
|
|
19
|
+
ownerAgentId: string | null;
|
|
20
|
+
description: string | null;
|
|
19
21
|
status: string;
|
|
20
22
|
createdAt: Date;
|
|
21
23
|
updatedAt: Date;
|
|
22
|
-
ownerAgentId: string | null;
|
|
23
24
|
title: string;
|
|
24
|
-
description: string | null;
|
|
25
25
|
parentId: string | null;
|
|
26
26
|
level: string;
|
|
27
27
|
}>;
|
|
@@ -201,12 +201,12 @@ export declare function goalService(db: Db): {
|
|
|
201
201
|
}, "single", Record<"goals", "not-null">, false, "where", {
|
|
202
202
|
id: string;
|
|
203
203
|
orgId: string;
|
|
204
|
+
ownerAgentId: string | null;
|
|
205
|
+
description: string | null;
|
|
204
206
|
status: string;
|
|
205
207
|
createdAt: Date;
|
|
206
208
|
updatedAt: Date;
|
|
207
|
-
ownerAgentId: string | null;
|
|
208
209
|
title: string;
|
|
209
|
-
description: string | null;
|
|
210
210
|
parentId: string | null;
|
|
211
211
|
level: string;
|
|
212
212
|
}[], {
|
|
@@ -384,24 +384,24 @@ export declare function goalService(db: Db): {
|
|
|
384
384
|
getById: (id: string) => Promise<{
|
|
385
385
|
id: string;
|
|
386
386
|
orgId: string;
|
|
387
|
+
ownerAgentId: string | null;
|
|
388
|
+
description: string | null;
|
|
387
389
|
status: string;
|
|
388
390
|
createdAt: Date;
|
|
389
391
|
updatedAt: Date;
|
|
390
|
-
ownerAgentId: string | null;
|
|
391
392
|
title: string;
|
|
392
|
-
description: string | null;
|
|
393
393
|
parentId: string | null;
|
|
394
394
|
level: string;
|
|
395
395
|
}>;
|
|
396
396
|
getDefaultCompanyGoal: (orgId: string) => Promise<{
|
|
397
397
|
id: string;
|
|
398
398
|
orgId: string;
|
|
399
|
+
ownerAgentId: string | null;
|
|
400
|
+
description: string | null;
|
|
399
401
|
status: string;
|
|
400
402
|
createdAt: Date;
|
|
401
403
|
updatedAt: Date;
|
|
402
|
-
ownerAgentId: string | null;
|
|
403
404
|
title: string;
|
|
404
|
-
description: string | null;
|
|
405
405
|
parentId: string | null;
|
|
406
406
|
level: string;
|
|
407
407
|
}>;
|
|
@@ -409,12 +409,12 @@ export declare function goalService(db: Db): {
|
|
|
409
409
|
create: (orgId: string, data: GoalInput) => Promise<{
|
|
410
410
|
id: string;
|
|
411
411
|
orgId: string;
|
|
412
|
+
ownerAgentId: string | null;
|
|
413
|
+
description: string | null;
|
|
412
414
|
status: string;
|
|
413
415
|
createdAt: Date;
|
|
414
416
|
updatedAt: Date;
|
|
415
|
-
ownerAgentId: string | null;
|
|
416
417
|
title: string;
|
|
417
|
-
description: string | null;
|
|
418
418
|
parentId: string | null;
|
|
419
419
|
level: string;
|
|
420
420
|
}>;
|
|
@@ -433,12 +433,12 @@ export declare function goalService(db: Db): {
|
|
|
433
433
|
remove: (id: string) => Promise<{
|
|
434
434
|
id: string;
|
|
435
435
|
orgId: string;
|
|
436
|
+
ownerAgentId: string | null;
|
|
437
|
+
description: string | null;
|
|
436
438
|
status: string;
|
|
437
439
|
createdAt: Date;
|
|
438
440
|
updatedAt: Date;
|
|
439
|
-
ownerAgentId: string | null;
|
|
440
441
|
title: string;
|
|
441
|
-
description: string | null;
|
|
442
442
|
parentId: string | null;
|
|
443
443
|
level: string;
|
|
444
444
|
} | null>;
|
package/dist/services/index.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export { heartbeatOrchestrator, heartbeatService } from "./heartbeat.js";
|
|
|
23
23
|
export { notifyHireApproved, type NotifyHireApprovedInput } from "./hire-hook.js";
|
|
24
24
|
export { instanceSettingsService } from "./instance-settings.js";
|
|
25
25
|
export { agentIntegrationService } from "./integrations/agent-integrations.js";
|
|
26
|
+
export { customIntegrationService } from "./integrations/custom-integrations.js";
|
|
26
27
|
export { createFeishuInboundDispatcherDbDeps } from "./integrations/feishu/inbound-dispatcher-db.js";
|
|
27
28
|
export { issueApprovalService } from "./issue-approvals.js";
|
|
28
29
|
export { issueService, type IssueFilters } from "./issues.js";
|
|
@@ -1 +1 @@
|
|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CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,uCAAuC,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACzG,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,0CAA0C,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/services/index.js
CHANGED
|
@@ -23,6 +23,7 @@ export { heartbeatOrchestrator, heartbeatService } from "./heartbeat.js";
|
|
|
23
23
|
export { notifyHireApproved } from "./hire-hook.js";
|
|
24
24
|
export { instanceSettingsService } from "./instance-settings.js";
|
|
25
25
|
export { agentIntegrationService } from "./integrations/agent-integrations.js";
|
|
26
|
+
export { customIntegrationService } from "./integrations/custom-integrations.js";
|
|
26
27
|
export { createFeishuInboundDispatcherDbDeps } from "./integrations/feishu/inbound-dispatcher-db.js";
|
|
27
28
|
export { issueApprovalService } from "./issue-approvals.js";
|
|
28
29
|
export { issueService } from "./issues.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAyB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAwB,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,wCAAwC,EAAE,MAAM,yBAAyB,CAAC;AAC7G,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;A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AE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sCAAsC,EAAE,MAAM,yCAAyC,CAAC;AACjG,OAAO,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC9G,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,uCAAuC,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACzG,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,0CAA0C,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -5,12 +5,15 @@ export declare function summarizeAgentIntegration(row: typeof agentIntegrations.
|
|
|
5
5
|
export declare function agentIntegrationService(db: Db): {
|
|
6
6
|
listForAgent: (orgId: string, agentId: string) => Promise<AgentIntegrationSummary[]>;
|
|
7
7
|
getAgentProvider: (orgId: string, agentId: string, provider: CreateAgentIntegration["provider"]) => Promise<{
|
|
8
|
-
appCredentialSecretId: string;
|
|
9
8
|
id: string;
|
|
10
9
|
orgId: string;
|
|
10
|
+
status: string;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
revokedAt: Date | null;
|
|
14
|
+
appCredentialSecretId: string;
|
|
11
15
|
agentId: string;
|
|
12
16
|
provider: string;
|
|
13
|
-
status: string;
|
|
14
17
|
transport: string;
|
|
15
18
|
providerRegion: string;
|
|
16
19
|
externalAppId: string;
|
|
@@ -19,17 +22,17 @@ export declare function agentIntegrationService(db: Db): {
|
|
|
19
22
|
installerUserId: string | null;
|
|
20
23
|
manageUrl: string | null;
|
|
21
24
|
installedAt: Date;
|
|
22
|
-
revokedAt: Date | null;
|
|
23
|
-
createdAt: Date;
|
|
24
|
-
updatedAt: Date;
|
|
25
25
|
}>;
|
|
26
26
|
create: (orgId: string, input: CreateAgentIntegration) => Promise<{
|
|
27
|
-
appCredentialSecretId: string;
|
|
28
27
|
id: string;
|
|
29
28
|
orgId: string;
|
|
29
|
+
status: string;
|
|
30
|
+
createdAt: Date;
|
|
31
|
+
updatedAt: Date;
|
|
32
|
+
revokedAt: Date | null;
|
|
33
|
+
appCredentialSecretId: string;
|
|
30
34
|
agentId: string;
|
|
31
35
|
provider: string;
|
|
32
|
-
status: string;
|
|
33
36
|
transport: string;
|
|
34
37
|
providerRegion: string;
|
|
35
38
|
externalAppId: string;
|
|
@@ -38,9 +41,6 @@ export declare function agentIntegrationService(db: Db): {
|
|
|
38
41
|
installerUserId: string | null;
|
|
39
42
|
manageUrl: string | null;
|
|
40
43
|
installedAt: Date;
|
|
41
|
-
revokedAt: Date | null;
|
|
42
|
-
createdAt: Date;
|
|
43
|
-
updatedAt: Date;
|
|
44
44
|
}>;
|
|
45
45
|
markErrorForAgent: (orgId: string, agentId: string, integrationId: string) => Promise<{
|
|
46
46
|
id: string;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Db } from "@rudderhq/db";
|
|
2
|
+
import { agentCustomIntegrationBindings, customIntegrationTools, customIntegrations } from "@rudderhq/db";
|
|
3
|
+
import type { CreateCustomIntegration, CreateCustomIntegrationToolCall, CustomIntegrationSummary, UpdateCustomIntegrationBinding } from "@rudderhq/shared";
|
|
4
|
+
type Actor = {
|
|
5
|
+
userId?: string | null;
|
|
6
|
+
agentId?: string | null;
|
|
7
|
+
};
|
|
8
|
+
type CustomIntegrationRow = typeof customIntegrations.$inferSelect;
|
|
9
|
+
type CustomIntegrationToolRow = typeof customIntegrationTools.$inferSelect;
|
|
10
|
+
type AgentCustomIntegrationBindingRow = typeof agentCustomIntegrationBindings.$inferSelect;
|
|
11
|
+
export declare function summarizeCustomIntegration(integration: CustomIntegrationRow, binding: AgentCustomIntegrationBindingRow | null, tools: CustomIntegrationToolRow[]): CustomIntegrationSummary;
|
|
12
|
+
export declare function customIntegrationService(db: Db): {
|
|
13
|
+
listForAgent: (orgId: string, agentId: string) => Promise<CustomIntegrationSummary[]>;
|
|
14
|
+
createForAgent: (orgId: string, agentId: string, input: CreateCustomIntegration, actor?: Actor) => Promise<CustomIntegrationSummary>;
|
|
15
|
+
updateBindingForAgent: (orgId: string, agentId: string, integrationId: string, input: UpdateCustomIntegrationBinding) => Promise<CustomIntegrationSummary>;
|
|
16
|
+
revokeForAgent: (orgId: string, agentId: string, integrationId: string, actor?: Actor) => Promise<CustomIntegrationSummary | null>;
|
|
17
|
+
listRuntimeToolsForAgent: (orgId: string, agentId: string) => Promise<{
|
|
18
|
+
integrationId: string;
|
|
19
|
+
integrationName: string;
|
|
20
|
+
kind: "custom_api" | "mcp_server";
|
|
21
|
+
scope: "organization" | "agent";
|
|
22
|
+
toolName: string;
|
|
23
|
+
externalToolName: string;
|
|
24
|
+
description: string | null;
|
|
25
|
+
}[]>;
|
|
26
|
+
recordToolCall: (orgId: string, agentId: string, integrationId: string, input: CreateCustomIntegrationToolCall) => Promise<{
|
|
27
|
+
conversationId: string | null;
|
|
28
|
+
issueId: string | null;
|
|
29
|
+
id: string;
|
|
30
|
+
orgId: string;
|
|
31
|
+
status: string;
|
|
32
|
+
createdAt: Date;
|
|
33
|
+
toolId: string;
|
|
34
|
+
runId: string | null;
|
|
35
|
+
agentId: string;
|
|
36
|
+
startedAt: Date;
|
|
37
|
+
completedAt: Date | null;
|
|
38
|
+
errorCode: string | null;
|
|
39
|
+
integrationId: string;
|
|
40
|
+
sanitizedInput: Record<string, unknown>;
|
|
41
|
+
sanitizedResult: Record<string, unknown> | null;
|
|
42
|
+
errorMessage: string | null;
|
|
43
|
+
}>;
|
|
44
|
+
};
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=custom-integrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-integrations.d.ts","sourceRoot":"","sources":["../../../src/services/integrations/custom-integrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,8BAA8B,EAG9B,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAEV,uBAAuB,EACvB,+BAA+B,EAE/B,wBAAwB,EAGxB,8BAA8B,EAC/B,MAAM,kBAAkB,CAAC;AAW1B,KAAK,KAAK,GAAG;IACX,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,KAAK,oBAAoB,GAAG,OAAO,kBAAkB,CAAC,YAAY,CAAC;AACnE,KAAK,wBAAwB,GAAG,OAAO,sBAAsB,CAAC,YAAY,CAAC;AAC3E,KAAK,gCAAgC,GAAG,OAAO,8BAA8B,CAAC,YAAY,CAAC;AA6C3F,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,oBAAoB,EACjC,OAAO,EAAE,gCAAgC,GAAG,IAAI,EAChD,KAAK,EAAE,wBAAwB,EAAE,GAChC,wBAAwB,CAa1B;AAED,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,EAAE;0BA+FV,MAAM,WAAW,MAAM;4BAwB/C,MAAM,WACJ,MAAM,SACR,uBAAuB,UACtB,KAAK;mCAgGN,MAAM,WACJ,MAAM,iBACA,MAAM,SACd,8BAA8B;4BA8DT,MAAM,WAAW,MAAM,iBAAiB,MAAM,UAAU,KAAK;sCA+CnD,MAAM,WAAW,MAAM;;;;;;;;;4BAuBtD,MAAM,WACJ,MAAM,iBACA,MAAM,SACd,+BAA+B;;;;;;;;;;;;;;;;;;EAoD3C"}
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
import { agentCustomIntegrationBindings, agents, customIntegrationToolCalls, customIntegrationTools, customIntegrations, } from "@rudderhq/db";
|
|
2
|
+
import { createCustomIntegrationSchema, createCustomIntegrationToolCallSchema, updateCustomIntegrationBindingSchema, } from "@rudderhq/shared";
|
|
3
|
+
import { and, desc, eq, inArray } from "drizzle-orm";
|
|
4
|
+
import { conflict, forbidden, notFound, unprocessable } from "../../errors.js";
|
|
5
|
+
import { logActivity } from "../activity-log.js";
|
|
6
|
+
import { secretService } from "../secrets.js";
|
|
7
|
+
function slugify(value) {
|
|
8
|
+
return value
|
|
9
|
+
.trim()
|
|
10
|
+
.toLowerCase()
|
|
11
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
12
|
+
.replace(/^-+|-+$/g, "")
|
|
13
|
+
.slice(0, 54)
|
|
14
|
+
|| "custom-integration";
|
|
15
|
+
}
|
|
16
|
+
function toolSlug(value) {
|
|
17
|
+
return value
|
|
18
|
+
.trim()
|
|
19
|
+
.toLowerCase()
|
|
20
|
+
.replace(/[^a-z0-9_]+/g, "_")
|
|
21
|
+
.replace(/^_+|_+$/g, "")
|
|
22
|
+
.slice(0, 64)
|
|
23
|
+
|| "tool";
|
|
24
|
+
}
|
|
25
|
+
function toIntegration(row) {
|
|
26
|
+
return {
|
|
27
|
+
...row,
|
|
28
|
+
scope: row.scope,
|
|
29
|
+
kind: row.kind,
|
|
30
|
+
status: row.status,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function toTool(row) {
|
|
34
|
+
return {
|
|
35
|
+
...row,
|
|
36
|
+
status: row.status,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function toBinding(row) {
|
|
40
|
+
return {
|
|
41
|
+
...row,
|
|
42
|
+
status: row.status,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function summarizeCustomIntegration(integration, binding, tools) {
|
|
46
|
+
const enabled = new Set(binding?.enabledToolIds ?? []);
|
|
47
|
+
const summarizedTools = tools.map((tool) => ({
|
|
48
|
+
...toTool(tool),
|
|
49
|
+
enabled: binding?.status === "active" && tool.status === "active" && enabled.has(tool.id),
|
|
50
|
+
}));
|
|
51
|
+
const { credentialSecretId: _credentialSecretId, ...rest } = toIntegration(integration);
|
|
52
|
+
return {
|
|
53
|
+
...rest,
|
|
54
|
+
hasCredentialSecret: Boolean(_credentialSecretId),
|
|
55
|
+
binding: binding ? toBinding(binding) : null,
|
|
56
|
+
tools: summarizedTools,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export function customIntegrationService(db) {
|
|
60
|
+
const secrets = secretService(db);
|
|
61
|
+
async function getAgentInOrg(orgId, agentId) {
|
|
62
|
+
const agent = await db
|
|
63
|
+
.select({ id: agents.id, orgId: agents.orgId, name: agents.name })
|
|
64
|
+
.from(agents)
|
|
65
|
+
.where(eq(agents.id, agentId))
|
|
66
|
+
.then((rows) => rows[0] ?? null);
|
|
67
|
+
if (!agent)
|
|
68
|
+
throw notFound("Agent not found");
|
|
69
|
+
if (agent.orgId !== orgId)
|
|
70
|
+
throw unprocessable("Agent must belong to same organization");
|
|
71
|
+
return agent;
|
|
72
|
+
}
|
|
73
|
+
async function getIntegrationInOrg(orgId, integrationId) {
|
|
74
|
+
const integration = await db
|
|
75
|
+
.select()
|
|
76
|
+
.from(customIntegrations)
|
|
77
|
+
.where(and(eq(customIntegrations.orgId, orgId), eq(customIntegrations.id, integrationId)))
|
|
78
|
+
.then((rows) => rows[0] ?? null);
|
|
79
|
+
if (!integration)
|
|
80
|
+
throw notFound("Custom integration not found");
|
|
81
|
+
return integration;
|
|
82
|
+
}
|
|
83
|
+
async function assertSecretInOrg(orgId, secretId) {
|
|
84
|
+
const secret = await secrets.getById(secretId);
|
|
85
|
+
if (!secret)
|
|
86
|
+
throw notFound("Custom integration credential secret not found");
|
|
87
|
+
if (secret.orgId !== orgId) {
|
|
88
|
+
throw unprocessable("Custom integration credential secret must belong to same organization");
|
|
89
|
+
}
|
|
90
|
+
return secret;
|
|
91
|
+
}
|
|
92
|
+
async function resolveUniqueSlug(orgId, requested) {
|
|
93
|
+
const base = slugify(requested);
|
|
94
|
+
for (let i = 0; i < 100; i += 1) {
|
|
95
|
+
const candidate = i === 0 ? base : `${base}-${i + 1}`;
|
|
96
|
+
const existing = await db
|
|
97
|
+
.select({ id: customIntegrations.id })
|
|
98
|
+
.from(customIntegrations)
|
|
99
|
+
.where(and(eq(customIntegrations.orgId, orgId), eq(customIntegrations.slug, candidate)))
|
|
100
|
+
.then((rows) => rows[0] ?? null);
|
|
101
|
+
if (!existing)
|
|
102
|
+
return candidate;
|
|
103
|
+
}
|
|
104
|
+
throw conflict("Could not allocate a unique integration slug");
|
|
105
|
+
}
|
|
106
|
+
async function buildToolName(orgId, integrationSlug, externalToolName) {
|
|
107
|
+
const base = `custom.${integrationSlug}.${toolSlug(externalToolName)}`;
|
|
108
|
+
for (let i = 0; i < 100; i += 1) {
|
|
109
|
+
const candidate = i === 0 ? base : `${base}_${i + 1}`;
|
|
110
|
+
const existing = await db
|
|
111
|
+
.select({ id: customIntegrationTools.id })
|
|
112
|
+
.from(customIntegrationTools)
|
|
113
|
+
.where(and(eq(customIntegrationTools.orgId, orgId), eq(customIntegrationTools.rudderToolName, candidate)))
|
|
114
|
+
.then((rows) => rows[0] ?? null);
|
|
115
|
+
if (!existing)
|
|
116
|
+
return candidate;
|
|
117
|
+
}
|
|
118
|
+
throw conflict("Could not allocate a unique Rudder tool name");
|
|
119
|
+
}
|
|
120
|
+
async function loadSummariesForBindings(rows) {
|
|
121
|
+
const integrationIds = rows.map((row) => row.integration.id);
|
|
122
|
+
const toolRows = integrationIds.length > 0
|
|
123
|
+
? await db
|
|
124
|
+
.select()
|
|
125
|
+
.from(customIntegrationTools)
|
|
126
|
+
.where(inArray(customIntegrationTools.integrationId, integrationIds))
|
|
127
|
+
: [];
|
|
128
|
+
const toolsByIntegration = new Map();
|
|
129
|
+
toolRows.forEach((tool) => {
|
|
130
|
+
const list = toolsByIntegration.get(tool.integrationId) ?? [];
|
|
131
|
+
list.push(tool);
|
|
132
|
+
toolsByIntegration.set(tool.integrationId, list);
|
|
133
|
+
});
|
|
134
|
+
return rows.map((row) => summarizeCustomIntegration(row.integration, row.binding, toolsByIntegration.get(row.integration.id) ?? []));
|
|
135
|
+
}
|
|
136
|
+
async function assertBindableToAgent(orgId, agentId, integration) {
|
|
137
|
+
if (integration.orgId !== orgId)
|
|
138
|
+
throw forbidden("Custom integration belongs to another organization");
|
|
139
|
+
if (integration.scope === "agent" && integration.ownerAgentId !== agentId) {
|
|
140
|
+
throw forbidden("Agent-scoped custom integrations can only be used by their owner agent");
|
|
141
|
+
}
|
|
142
|
+
if (integration.status === "revoked") {
|
|
143
|
+
throw unprocessable("Custom integration is revoked");
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async function listForAgent(orgId, agentId) {
|
|
147
|
+
await getAgentInOrg(orgId, agentId);
|
|
148
|
+
const rows = await db
|
|
149
|
+
.select({
|
|
150
|
+
integration: customIntegrations,
|
|
151
|
+
binding: agentCustomIntegrationBindings,
|
|
152
|
+
})
|
|
153
|
+
.from(agentCustomIntegrationBindings)
|
|
154
|
+
.innerJoin(customIntegrations, eq(agentCustomIntegrationBindings.integrationId, customIntegrations.id))
|
|
155
|
+
.where(and(eq(agentCustomIntegrationBindings.orgId, orgId), eq(agentCustomIntegrationBindings.agentId, agentId)))
|
|
156
|
+
.orderBy(desc(agentCustomIntegrationBindings.updatedAt));
|
|
157
|
+
return loadSummariesForBindings(rows);
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
listForAgent,
|
|
161
|
+
createForAgent: async (orgId, agentId, input, actor) => {
|
|
162
|
+
const parsed = createCustomIntegrationSchema.parse(input);
|
|
163
|
+
const agent = await getAgentInOrg(orgId, agentId);
|
|
164
|
+
if (parsed.credential && parsed.credentialSecretId) {
|
|
165
|
+
throw unprocessable("Provide credential or credentialSecretId, not both");
|
|
166
|
+
}
|
|
167
|
+
if (parsed.credentialSecretId) {
|
|
168
|
+
await assertSecretInOrg(orgId, parsed.credentialSecretId);
|
|
169
|
+
}
|
|
170
|
+
const slug = await resolveUniqueSlug(orgId, parsed.slug ?? parsed.displayName);
|
|
171
|
+
const credentialSecretId = parsed.credential
|
|
172
|
+
? (await secrets.create(orgId, {
|
|
173
|
+
name: parsed.credential.name?.trim() || `Custom integration credential - ${agent.name} - ${slug}`,
|
|
174
|
+
provider: "local_encrypted",
|
|
175
|
+
value: parsed.credential.value,
|
|
176
|
+
description: `Credential for custom integration ${parsed.displayName}`,
|
|
177
|
+
externalRef: null,
|
|
178
|
+
}, actor)).id
|
|
179
|
+
: parsed.credentialSecretId ?? null;
|
|
180
|
+
const ownerAgentId = parsed.scope === "agent" ? agentId : null;
|
|
181
|
+
const toolInputs = await Promise.all(parsed.tools.map(async (tool) => ({
|
|
182
|
+
...tool,
|
|
183
|
+
rudderToolName: tool.rudderToolName ?? await buildToolName(orgId, slug, tool.externalToolName),
|
|
184
|
+
})));
|
|
185
|
+
const created = await db.transaction(async (tx) => {
|
|
186
|
+
const integration = await tx
|
|
187
|
+
.insert(customIntegrations)
|
|
188
|
+
.values({
|
|
189
|
+
orgId,
|
|
190
|
+
ownerAgentId,
|
|
191
|
+
scope: parsed.scope,
|
|
192
|
+
kind: parsed.kind,
|
|
193
|
+
slug,
|
|
194
|
+
displayName: parsed.displayName,
|
|
195
|
+
description: parsed.description ?? null,
|
|
196
|
+
config: parsed.config ?? {},
|
|
197
|
+
credentialSecretId,
|
|
198
|
+
})
|
|
199
|
+
.returning()
|
|
200
|
+
.then((rows) => rows[0]);
|
|
201
|
+
const tools = await tx
|
|
202
|
+
.insert(customIntegrationTools)
|
|
203
|
+
.values(toolInputs.map((tool) => ({
|
|
204
|
+
orgId,
|
|
205
|
+
integrationId: integration.id,
|
|
206
|
+
externalToolName: tool.externalToolName,
|
|
207
|
+
rudderToolName: tool.rudderToolName,
|
|
208
|
+
description: tool.description ?? null,
|
|
209
|
+
inputSchema: tool.inputSchema ?? {},
|
|
210
|
+
config: tool.config ?? {},
|
|
211
|
+
})))
|
|
212
|
+
.returning();
|
|
213
|
+
const enabledNameSet = new Set(parsed.enabledToolNames ?? parsed.tools.map((tool) => tool.externalToolName));
|
|
214
|
+
const enabledToolIds = tools
|
|
215
|
+
.filter((tool) => enabledNameSet.has(tool.externalToolName) || enabledNameSet.has(tool.rudderToolName))
|
|
216
|
+
.map((tool) => tool.id);
|
|
217
|
+
const binding = await tx
|
|
218
|
+
.insert(agentCustomIntegrationBindings)
|
|
219
|
+
.values({
|
|
220
|
+
orgId,
|
|
221
|
+
agentId,
|
|
222
|
+
integrationId: integration.id,
|
|
223
|
+
enabledToolIds,
|
|
224
|
+
})
|
|
225
|
+
.returning()
|
|
226
|
+
.then((rows) => rows[0]);
|
|
227
|
+
return { integration, tools, binding };
|
|
228
|
+
});
|
|
229
|
+
await logActivity(db, {
|
|
230
|
+
orgId,
|
|
231
|
+
actorType: actor?.agentId ? "agent" : "user",
|
|
232
|
+
actorId: actor?.agentId ?? actor?.userId ?? "board",
|
|
233
|
+
action: "custom_integration.created",
|
|
234
|
+
entityType: "custom_integration",
|
|
235
|
+
entityId: created.integration.id,
|
|
236
|
+
details: {
|
|
237
|
+
agentId,
|
|
238
|
+
kind: parsed.kind,
|
|
239
|
+
scope: parsed.scope,
|
|
240
|
+
toolCount: created.tools.length,
|
|
241
|
+
},
|
|
242
|
+
});
|
|
243
|
+
return summarizeCustomIntegration(created.integration, created.binding, created.tools);
|
|
244
|
+
},
|
|
245
|
+
updateBindingForAgent: async (orgId, agentId, integrationId, input) => {
|
|
246
|
+
const parsed = updateCustomIntegrationBindingSchema.parse(input);
|
|
247
|
+
await getAgentInOrg(orgId, agentId);
|
|
248
|
+
const integration = await getIntegrationInOrg(orgId, integrationId);
|
|
249
|
+
await assertBindableToAgent(orgId, agentId, integration);
|
|
250
|
+
if (parsed.enabledToolIds.length > 0) {
|
|
251
|
+
const tools = await db
|
|
252
|
+
.select({ id: customIntegrationTools.id })
|
|
253
|
+
.from(customIntegrationTools)
|
|
254
|
+
.where(and(eq(customIntegrationTools.orgId, orgId), eq(customIntegrationTools.integrationId, integrationId), inArray(customIntegrationTools.id, parsed.enabledToolIds)));
|
|
255
|
+
if (tools.length !== parsed.enabledToolIds.length) {
|
|
256
|
+
throw unprocessable("Enabled tools must belong to the selected custom integration");
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
const existing = await db
|
|
260
|
+
.select()
|
|
261
|
+
.from(agentCustomIntegrationBindings)
|
|
262
|
+
.where(and(eq(agentCustomIntegrationBindings.orgId, orgId), eq(agentCustomIntegrationBindings.agentId, agentId), eq(agentCustomIntegrationBindings.integrationId, integrationId)))
|
|
263
|
+
.then((rows) => rows[0] ?? null);
|
|
264
|
+
const binding = existing
|
|
265
|
+
? await db
|
|
266
|
+
.update(agentCustomIntegrationBindings)
|
|
267
|
+
.set({
|
|
268
|
+
status: "active",
|
|
269
|
+
enabledToolIds: parsed.enabledToolIds,
|
|
270
|
+
revokedAt: null,
|
|
271
|
+
updatedAt: new Date(),
|
|
272
|
+
})
|
|
273
|
+
.where(eq(agentCustomIntegrationBindings.id, existing.id))
|
|
274
|
+
.returning()
|
|
275
|
+
.then((rows) => rows[0] ?? null)
|
|
276
|
+
: await db
|
|
277
|
+
.insert(agentCustomIntegrationBindings)
|
|
278
|
+
.values({
|
|
279
|
+
orgId,
|
|
280
|
+
agentId,
|
|
281
|
+
integrationId,
|
|
282
|
+
enabledToolIds: parsed.enabledToolIds,
|
|
283
|
+
})
|
|
284
|
+
.returning()
|
|
285
|
+
.then((rows) => rows[0] ?? null);
|
|
286
|
+
if (!binding)
|
|
287
|
+
throw notFound("Custom integration binding not found");
|
|
288
|
+
const tools = await db
|
|
289
|
+
.select()
|
|
290
|
+
.from(customIntegrationTools)
|
|
291
|
+
.where(and(eq(customIntegrationTools.orgId, orgId), eq(customIntegrationTools.integrationId, integrationId)));
|
|
292
|
+
return summarizeCustomIntegration(integration, binding, tools);
|
|
293
|
+
},
|
|
294
|
+
revokeForAgent: async (orgId, agentId, integrationId, actor) => {
|
|
295
|
+
await getAgentInOrg(orgId, agentId);
|
|
296
|
+
const integration = await getIntegrationInOrg(orgId, integrationId);
|
|
297
|
+
if (integration.scope === "agent" && integration.ownerAgentId !== agentId) {
|
|
298
|
+
throw forbidden("Agent-scoped custom integrations can only be revoked by their owner agent");
|
|
299
|
+
}
|
|
300
|
+
const now = new Date();
|
|
301
|
+
const revokedBinding = await db
|
|
302
|
+
.update(agentCustomIntegrationBindings)
|
|
303
|
+
.set({ status: "revoked", revokedAt: now, updatedAt: now })
|
|
304
|
+
.where(and(eq(agentCustomIntegrationBindings.orgId, orgId), eq(agentCustomIntegrationBindings.agentId, agentId), eq(agentCustomIntegrationBindings.integrationId, integrationId)))
|
|
305
|
+
.returning()
|
|
306
|
+
.then((rows) => rows[0] ?? null);
|
|
307
|
+
if (!revokedBinding)
|
|
308
|
+
return null;
|
|
309
|
+
let nextIntegration = integration;
|
|
310
|
+
if (integration.scope === "agent") {
|
|
311
|
+
nextIntegration = await db
|
|
312
|
+
.update(customIntegrations)
|
|
313
|
+
.set({ status: "revoked", revokedAt: now, updatedAt: now })
|
|
314
|
+
.where(and(eq(customIntegrations.orgId, orgId), eq(customIntegrations.id, integrationId)))
|
|
315
|
+
.returning()
|
|
316
|
+
.then((rows) => rows[0] ?? integration);
|
|
317
|
+
}
|
|
318
|
+
await logActivity(db, {
|
|
319
|
+
orgId,
|
|
320
|
+
actorType: actor?.agentId ? "agent" : "user",
|
|
321
|
+
actorId: actor?.agentId ?? actor?.userId ?? "board",
|
|
322
|
+
action: "custom_integration.revoked",
|
|
323
|
+
entityType: "custom_integration",
|
|
324
|
+
entityId: integrationId,
|
|
325
|
+
details: { agentId, scope: integration.scope },
|
|
326
|
+
});
|
|
327
|
+
const tools = await db
|
|
328
|
+
.select()
|
|
329
|
+
.from(customIntegrationTools)
|
|
330
|
+
.where(and(eq(customIntegrationTools.orgId, orgId), eq(customIntegrationTools.integrationId, integrationId)));
|
|
331
|
+
return summarizeCustomIntegration(nextIntegration, revokedBinding, tools);
|
|
332
|
+
},
|
|
333
|
+
listRuntimeToolsForAgent: async (orgId, agentId) => {
|
|
334
|
+
const summaries = await listForAgent(orgId, agentId);
|
|
335
|
+
return summaries
|
|
336
|
+
.filter((integration) => integration.status === "active"
|
|
337
|
+
&& integration.binding?.status === "active")
|
|
338
|
+
.flatMap((integration) => integration.tools
|
|
339
|
+
.filter((tool) => tool.enabled && tool.status === "active")
|
|
340
|
+
.map((tool) => ({
|
|
341
|
+
integrationId: integration.id,
|
|
342
|
+
integrationName: integration.displayName,
|
|
343
|
+
kind: integration.kind,
|
|
344
|
+
scope: integration.scope,
|
|
345
|
+
toolName: tool.rudderToolName,
|
|
346
|
+
externalToolName: tool.externalToolName,
|
|
347
|
+
description: tool.description,
|
|
348
|
+
})));
|
|
349
|
+
},
|
|
350
|
+
recordToolCall: async (orgId, agentId, integrationId, input) => {
|
|
351
|
+
const parsed = createCustomIntegrationToolCallSchema.parse(input);
|
|
352
|
+
await getAgentInOrg(orgId, agentId);
|
|
353
|
+
const tool = await db
|
|
354
|
+
.select({
|
|
355
|
+
tool: customIntegrationTools,
|
|
356
|
+
integration: customIntegrations,
|
|
357
|
+
})
|
|
358
|
+
.from(customIntegrationTools)
|
|
359
|
+
.innerJoin(customIntegrations, eq(customIntegrationTools.integrationId, customIntegrations.id))
|
|
360
|
+
.where(and(eq(customIntegrationTools.orgId, orgId), eq(customIntegrationTools.id, parsed.toolId)))
|
|
361
|
+
.then((rows) => rows[0] ?? null);
|
|
362
|
+
if (!tool)
|
|
363
|
+
throw notFound("Custom integration tool not found");
|
|
364
|
+
if (tool.integration.id !== integrationId) {
|
|
365
|
+
throw notFound("Custom integration tool not found");
|
|
366
|
+
}
|
|
367
|
+
await assertBindableToAgent(orgId, agentId, tool.integration);
|
|
368
|
+
const binding = await db
|
|
369
|
+
.select()
|
|
370
|
+
.from(agentCustomIntegrationBindings)
|
|
371
|
+
.where(and(eq(agentCustomIntegrationBindings.orgId, orgId), eq(agentCustomIntegrationBindings.agentId, agentId), eq(agentCustomIntegrationBindings.integrationId, tool.integration.id)))
|
|
372
|
+
.then((rows) => rows[0] ?? null);
|
|
373
|
+
if (!binding || binding.status !== "active" || !binding.enabledToolIds.includes(tool.tool.id)) {
|
|
374
|
+
throw forbidden("Custom integration tool is not enabled for this agent");
|
|
375
|
+
}
|
|
376
|
+
return db
|
|
377
|
+
.insert(customIntegrationToolCalls)
|
|
378
|
+
.values({
|
|
379
|
+
orgId,
|
|
380
|
+
agentId,
|
|
381
|
+
integrationId: tool.integration.id,
|
|
382
|
+
toolId: tool.tool.id,
|
|
383
|
+
runId: parsed.runId ?? null,
|
|
384
|
+
conversationId: parsed.conversationId ?? null,
|
|
385
|
+
issueId: parsed.issueId ?? null,
|
|
386
|
+
status: "blocked",
|
|
387
|
+
sanitizedInput: parsed.input ?? {},
|
|
388
|
+
errorCode: "dispatch_not_implemented",
|
|
389
|
+
errorMessage: "Custom integration dispatch is not implemented in this Rudder build.",
|
|
390
|
+
completedAt: new Date(),
|
|
391
|
+
})
|
|
392
|
+
.returning()
|
|
393
|
+
.then((rows) => rows[0]);
|
|
394
|
+
},
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
//# sourceMappingURL=custom-integrations.js.map
|