@rudderhq/server 0.2.5-canary.8 → 0.2.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/bootstrap/plugin-host-runtime.d.ts +39 -39
- package/dist/bundled-plugins/plugin-linear/dist/worker.js +101 -147
- package/dist/bundled-plugins/plugin-linear/dist/worker.js.map +2 -2
- package/dist/bundled-plugins/plugin-linear/package.json +1 -1
- package/dist/routes/access-onboarding.helpers.d.ts +142 -0
- package/dist/routes/access-onboarding.helpers.d.ts.map +1 -0
- package/dist/routes/access-onboarding.helpers.js +762 -0
- package/dist/routes/access-onboarding.helpers.js.map +1 -0
- package/dist/routes/access.d.ts +2 -48
- package/dist/routes/access.d.ts.map +1 -1
- package/dist/routes/access.helpers.d.ts +109 -0
- package/dist/routes/access.helpers.d.ts.map +1 -0
- package/dist/routes/access.helpers.js +460 -0
- package/dist/routes/access.helpers.js.map +1 -0
- package/dist/routes/access.js +6 -1218
- package/dist/routes/access.js.map +1 -1
- package/dist/routes/agents.d.ts.map +1 -1
- package/dist/routes/agents.js +55 -1057
- package/dist/routes/agents.js.map +1 -1
- package/dist/routes/agents.management-routes.d.ts +12 -0
- package/dist/routes/agents.management-routes.d.ts.map +1 -0
- package/dist/routes/agents.management-routes.js +1067 -0
- package/dist/routes/agents.management-routes.js.map +1 -0
- package/dist/routes/chats.d.ts.map +1 -1
- package/dist/routes/chats.js +42 -652
- package/dist/routes/chats.js.map +1 -1
- package/dist/routes/chats.stream-routes.d.ts +12 -0
- package/dist/routes/chats.stream-routes.d.ts.map +1 -0
- package/dist/routes/chats.stream-routes.js +666 -0
- package/dist/routes/chats.stream-routes.js.map +1 -0
- package/dist/routes/issues.comments-attachments.d.ts +12 -0
- package/dist/routes/issues.comments-attachments.d.ts.map +1 -0
- package/dist/routes/issues.comments-attachments.js +511 -0
- package/dist/routes/issues.comments-attachments.js.map +1 -0
- package/dist/routes/issues.d.ts.map +1 -1
- package/dist/routes/issues.js +43 -1128
- package/dist/routes/issues.js.map +1 -1
- package/dist/routes/issues.mutations.d.ts +12 -0
- package/dist/routes/issues.mutations.d.ts.map +1 -0
- package/dist/routes/issues.mutations.js +635 -0
- package/dist/routes/issues.mutations.js.map +1 -0
- package/dist/routes/plugins.d.ts.map +1 -1
- package/dist/routes/plugins.js +14 -694
- package/dist/routes/plugins.js.map +1 -1
- package/dist/routes/plugins.operations-routes.d.ts +28 -0
- package/dist/routes/plugins.operations-routes.d.ts.map +1 -0
- package/dist/routes/plugins.operations-routes.js +720 -0
- package/dist/routes/plugins.operations-routes.js.map +1 -0
- package/dist/services/access.d.ts +21 -21
- package/dist/services/activity.d.ts +19 -19
- package/dist/services/agents.d.ts +158 -158
- package/dist/services/approvals.d.ts +29 -29
- package/dist/services/assets.d.ts +8 -8
- package/dist/services/automations.d.ts +41 -27
- package/dist/services/automations.d.ts.map +1 -1
- package/dist/services/automations.js +287 -110
- package/dist/services/automations.js.map +1 -1
- package/dist/services/automations.scheduler.d.ts +9 -0
- package/dist/services/automations.scheduler.d.ts.map +1 -0
- package/dist/services/automations.scheduler.js +101 -0
- package/dist/services/automations.scheduler.js.map +1 -0
- package/dist/services/board-auth.d.ts +32 -32
- package/dist/services/calendar.d.ts +26 -26
- package/dist/services/chat-assistant.d.ts +3 -47
- package/dist/services/chat-assistant.d.ts.map +1 -1
- package/dist/services/chat-assistant.helpers.d.ts +156 -0
- package/dist/services/chat-assistant.helpers.d.ts.map +1 -0
- package/dist/services/chat-assistant.helpers.js +862 -0
- package/dist/services/chat-assistant.helpers.js.map +1 -0
- package/dist/services/chat-assistant.js +2 -861
- package/dist/services/chat-assistant.js.map +1 -1
- package/dist/services/chats.d.ts +149 -247
- package/dist/services/chats.d.ts.map +1 -1
- package/dist/services/chats.helpers.d.ts +117 -0
- package/dist/services/chats.helpers.d.ts.map +1 -0
- package/dist/services/chats.helpers.js +285 -0
- package/dist/services/chats.helpers.js.map +1 -0
- package/dist/services/chats.js +6 -286
- package/dist/services/chats.js.map +1 -1
- package/dist/services/costs.d.ts +8 -8
- package/dist/services/finance.d.ts +18 -18
- package/dist/services/goals.d.ts +30 -30
- package/dist/services/heartbeat.d.ts +3 -1
- package/dist/services/heartbeat.d.ts.map +1 -1
- package/dist/services/heartbeat.js +3 -1
- package/dist/services/heartbeat.js.map +1 -1
- package/dist/services/issue-approvals.d.ts +4 -4
- package/dist/services/issue-review-wakeup.d.ts +3 -3
- package/dist/services/issues.comments-attachments.d.ts +141 -0
- package/dist/services/issues.comments-attachments.d.ts.map +1 -0
- package/dist/services/issues.comments-attachments.js +313 -0
- package/dist/services/issues.comments-attachments.js.map +1 -0
- package/dist/services/issues.d.ts +205 -256
- package/dist/services/issues.d.ts.map +1 -1
- package/dist/services/issues.helpers.d.ts +87 -0
- package/dist/services/issues.helpers.d.ts.map +1 -0
- package/dist/services/issues.helpers.js +270 -0
- package/dist/services/issues.helpers.js.map +1 -0
- package/dist/services/issues.js +5 -569
- package/dist/services/issues.js.map +1 -1
- package/dist/services/knowledge-portability/organization-portability.core.d.ts +210 -0
- package/dist/services/knowledge-portability/organization-portability.core.d.ts.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.core.js +997 -0
- package/dist/services/knowledge-portability/organization-portability.core.js.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.d.ts +6 -28
- package/dist/services/knowledge-portability/organization-portability.d.ts.map +1 -1
- package/dist/services/knowledge-portability/organization-portability.export.d.ts +24 -0
- package/dist/services/knowledge-portability/organization-portability.export.d.ts.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.export.js +607 -0
- package/dist/services/knowledge-portability/organization-portability.export.js.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.files.d.ts +69 -0
- package/dist/services/knowledge-portability/organization-portability.files.d.ts.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.files.js +597 -0
- package/dist/services/knowledge-portability/organization-portability.files.js.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.import.d.ts +31 -0
- package/dist/services/knowledge-portability/organization-portability.import.d.ts.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.import.js +575 -0
- package/dist/services/knowledge-portability/organization-portability.import.js.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.js +37 -3848
- package/dist/services/knowledge-portability/organization-portability.js.map +1 -1
- package/dist/services/knowledge-portability/organization-portability.package.d.ts +72 -0
- package/dist/services/knowledge-portability/organization-portability.package.d.ts.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.package.js +749 -0
- package/dist/services/knowledge-portability/organization-portability.package.js.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.preview.d.ts +18 -0
- package/dist/services/knowledge-portability/organization-portability.preview.d.ts.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.preview.js +333 -0
- package/dist/services/knowledge-portability/organization-portability.preview.js.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.resolve-source.d.ts +4 -0
- package/dist/services/knowledge-portability/organization-portability.resolve-source.d.ts.map +1 -0
- package/dist/services/knowledge-portability/organization-portability.resolve-source.js +86 -0
- package/dist/services/knowledge-portability/organization-portability.resolve-source.js.map +1 -0
- package/dist/services/knowledge-portability/organization-skills.catalog.d.ts +221 -0
- package/dist/services/knowledge-portability/organization-skills.catalog.d.ts.map +1 -0
- package/dist/services/knowledge-portability/organization-skills.catalog.js +999 -0
- package/dist/services/knowledge-portability/organization-skills.catalog.js.map +1 -0
- package/dist/services/knowledge-portability/organization-skills.d.ts +4 -75
- package/dist/services/knowledge-portability/organization-skills.d.ts.map +1 -1
- package/dist/services/knowledge-portability/organization-skills.js +11 -2008
- package/dist/services/knowledge-portability/organization-skills.js.map +1 -1
- package/dist/services/knowledge-portability/organization-skills.scans.d.ts +16 -0
- package/dist/services/knowledge-portability/organization-skills.scans.d.ts.map +1 -0
- package/dist/services/knowledge-portability/organization-skills.scans.js +300 -0
- package/dist/services/knowledge-portability/organization-skills.scans.js.map +1 -0
- package/dist/services/knowledge-portability/organization-skills.sources.d.ts +68 -0
- package/dist/services/knowledge-portability/organization-skills.sources.d.ts.map +1 -0
- package/dist/services/knowledge-portability/organization-skills.sources.js +728 -0
- package/dist/services/knowledge-portability/organization-skills.sources.js.map +1 -0
- package/dist/services/messenger.d.ts +2 -2
- package/dist/services/messenger.js +2 -2
- package/dist/services/messenger.js.map +1 -1
- package/dist/services/organization-skills.d.ts +3 -1
- package/dist/services/organization-skills.d.ts.map +1 -1
- package/dist/services/organization-skills.js +3 -1
- package/dist/services/organization-skills.js.map +1 -1
- package/dist/services/orgs.d.ts +9 -9
- package/dist/services/plugin-loader.core.d.ts +14 -0
- package/dist/services/plugin-loader.core.d.ts.map +1 -0
- package/dist/services/plugin-loader.core.js +905 -0
- package/dist/services/plugin-loader.core.js.map +1 -0
- package/dist/services/plugin-loader.d.ts +3 -440
- package/dist/services/plugin-loader.d.ts.map +1 -1
- package/dist/services/plugin-loader.helpers.d.ts +468 -0
- package/dist/services/plugin-loader.helpers.d.ts.map +1 -0
- package/dist/services/plugin-loader.helpers.js +263 -0
- package/dist/services/plugin-loader.helpers.js.map +1 -0
- package/dist/services/plugin-loader.js +3 -1191
- package/dist/services/plugin-loader.js.map +1 -1
- package/dist/services/plugin-loader.worker-paths.d.ts +7 -0
- package/dist/services/plugin-loader.worker-paths.d.ts.map +1 -0
- package/dist/services/plugin-loader.worker-paths.js +85 -0
- package/dist/services/plugin-loader.worker-paths.js.map +1 -0
- package/dist/services/plugin-registry.d.ts +123 -123
- package/dist/services/projects.d.ts +8 -8
- package/dist/services/runtime-kernel/heartbeat.core.d.ts +725 -0
- package/dist/services/runtime-kernel/heartbeat.core.d.ts.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.core.js +525 -0
- package/dist/services/runtime-kernel/heartbeat.core.js.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.d.ts +38 -259
- package/dist/services/runtime-kernel/heartbeat.d.ts.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.execute.d.ts +5 -0
- package/dist/services/runtime-kernel/heartbeat.execute.d.ts.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.execute.js +1052 -0
- package/dist/services/runtime-kernel/heartbeat.execute.js.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.js +50 -4142
- package/dist/services/runtime-kernel/heartbeat.js.map +1 -1
- package/dist/services/runtime-kernel/heartbeat.misc.d.ts +30 -0
- package/dist/services/runtime-kernel/heartbeat.misc.d.ts.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.misc.js +483 -0
- package/dist/services/runtime-kernel/heartbeat.misc.js.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.recovery.d.ts +38 -0
- package/dist/services/runtime-kernel/heartbeat.recovery.d.ts.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.recovery.js +605 -0
- package/dist/services/runtime-kernel/heartbeat.recovery.js.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.release.d.ts +6 -0
- package/dist/services/runtime-kernel/heartbeat.release.d.ts.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.release.js +398 -0
- package/dist/services/runtime-kernel/heartbeat.release.js.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.sessions.d.ts +229 -0
- package/dist/services/runtime-kernel/heartbeat.sessions.d.ts.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.sessions.js +708 -0
- package/dist/services/runtime-kernel/heartbeat.sessions.js.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.wakeup.d.ts +5 -0
- package/dist/services/runtime-kernel/heartbeat.wakeup.d.ts.map +1 -0
- package/dist/services/runtime-kernel/heartbeat.wakeup.js +552 -0
- package/dist/services/runtime-kernel/heartbeat.wakeup.js.map +1 -0
- package/dist/services/secrets.d.ts +25 -25
- package/dist/services/sidebar-badges.js +1 -1
- package/dist/services/sidebar-badges.js.map +1 -1
- package/dist/services/workspace-runtime.comments.d.ts +6 -0
- package/dist/services/workspace-runtime.comments.d.ts.map +1 -0
- package/dist/services/workspace-runtime.comments.js +17 -0
- package/dist/services/workspace-runtime.comments.js.map +1 -0
- package/dist/services/workspace-runtime.d.ts +4 -163
- package/dist/services/workspace-runtime.d.ts.map +1 -1
- package/dist/services/workspace-runtime.helpers.d.ts +163 -0
- package/dist/services/workspace-runtime.helpers.d.ts.map +1 -0
- package/dist/services/workspace-runtime.helpers.js +360 -0
- package/dist/services/workspace-runtime.helpers.js.map +1 -0
- package/dist/services/workspace-runtime.js +4 -1236
- package/dist/services/workspace-runtime.js.map +1 -1
- package/dist/services/workspace-runtime.lifecycle.d.ts +35 -0
- package/dist/services/workspace-runtime.lifecycle.d.ts.map +1 -0
- package/dist/services/workspace-runtime.lifecycle.js +266 -0
- package/dist/services/workspace-runtime.lifecycle.js.map +1 -0
- package/dist/services/workspace-runtime.services.d.ts +140 -0
- package/dist/services/workspace-runtime.services.d.ts.map +1 -0
- package/dist/services/workspace-runtime.services.js +606 -0
- package/dist/services/workspace-runtime.services.js.map +1 -0
- package/package.json +21 -15
- package/ui-dist/assets/{_basePickBy-DeCw-kw3.js → _basePickBy-N8I9ml5Y.js} +1 -1
- package/ui-dist/assets/{_baseUniq-CVepsVZm.js → _baseUniq-BuSlpRSQ.js} +1 -1
- package/ui-dist/assets/{arc-QifRrkx2.js → arc-qX-dPyA1.js} +1 -1
- package/ui-dist/assets/{architectureDiagram-2XIMDMQ5-CT4me0hw.js → architectureDiagram-2XIMDMQ5-DhjkbXsp.js} +1 -1
- package/ui-dist/assets/{blockDiagram-WCTKOSBZ-uD6J91MI.js → blockDiagram-WCTKOSBZ-JS-tTu3J.js} +1 -1
- package/ui-dist/assets/{c4Diagram-IC4MRINW-D2GM2pzG.js → c4Diagram-IC4MRINW-4DqwCWIx.js} +1 -1
- package/ui-dist/assets/channel-CccCW5_a.js +1 -0
- package/ui-dist/assets/{chunk-4BX2VUAB-D8pPrlss.js → chunk-4BX2VUAB-T37SqBpp.js} +1 -1
- package/ui-dist/assets/{chunk-55IACEB6-CHF68vwj.js → chunk-55IACEB6-BSj9hdqK.js} +1 -1
- package/ui-dist/assets/{chunk-FMBD7UC4-CKmGUf9X.js → chunk-FMBD7UC4-Dkrlh0Wk.js} +1 -1
- package/ui-dist/assets/{chunk-JSJVCQXG-CTBCV-7X.js → chunk-JSJVCQXG-C0ZE3QdB.js} +1 -1
- package/ui-dist/assets/{chunk-KX2RTZJC-DV5XzGob.js → chunk-KX2RTZJC-DOZQM9gW.js} +1 -1
- package/ui-dist/assets/{chunk-NQ4KR5QH-B7diT0e4.js → chunk-NQ4KR5QH-5Yr3U2k8.js} +1 -1
- package/ui-dist/assets/{chunk-QZHKN3VN-BphcSb1i.js → chunk-QZHKN3VN-CvKTufwF.js} +1 -1
- package/ui-dist/assets/{chunk-WL4C6EOR-Bs_jQBMG.js → chunk-WL4C6EOR-IoEM0jyx.js} +1 -1
- package/ui-dist/assets/classDiagram-VBA2DB6C-JKk4tCW2.js +1 -0
- package/ui-dist/assets/classDiagram-v2-RAHNMMFH-JKk4tCW2.js +1 -0
- package/ui-dist/assets/clone-Onaweg8D.js +1 -0
- package/ui-dist/assets/{cose-bilkent-S5V4N54A-BxfO0pV9.js → cose-bilkent-S5V4N54A-CTvr1OFj.js} +1 -1
- package/ui-dist/assets/{dagre-KLK3FWXG-BiDkAX-Z.js → dagre-KLK3FWXG-UZ-SNjVK.js} +1 -1
- package/ui-dist/assets/{diagram-E7M64L7V-Btz_oxkC.js → diagram-E7M64L7V-D7RAN0Hr.js} +1 -1
- package/ui-dist/assets/{diagram-IFDJBPK2-Cdp8lQxJ.js → diagram-IFDJBPK2-B4LViaFR.js} +1 -1
- package/ui-dist/assets/{diagram-P4PSJMXO-DuTbeAS1.js → diagram-P4PSJMXO-CY1be7ak.js} +1 -1
- package/ui-dist/assets/{erDiagram-INFDFZHY-CzoQlOwo.js → erDiagram-INFDFZHY-Dca0KkvJ.js} +1 -1
- package/ui-dist/assets/{flowDiagram-PKNHOUZH-Diz_MWi3.js → flowDiagram-PKNHOUZH-i-qMvfwg.js} +1 -1
- package/ui-dist/assets/{ganttDiagram-A5KZAMGK-CWeGI1E-.js → ganttDiagram-A5KZAMGK-Wxq2lhbh.js} +1 -1
- package/ui-dist/assets/{gitGraphDiagram-K3NZZRJ6-C3QhZnAN.js → gitGraphDiagram-K3NZZRJ6-DwzgPlAY.js} +1 -1
- package/ui-dist/assets/{graph-KQH4eaLv.js → graph-BAqf89Tz.js} +1 -1
- package/ui-dist/assets/{index-CkEEsJ_9.js → index-4eCzaLuY.js} +1 -1
- package/ui-dist/assets/{index-DCOA92Vt.js → index-8uu-nKqK.js} +1 -1
- package/ui-dist/assets/{index-DtsZnqcf.js → index-B-1NEcI_.js} +1 -1
- package/ui-dist/assets/{index-BvGpil9e.js → index-B0b_3Eu5.js} +1 -1
- package/ui-dist/assets/{index-BMhxh9sB.js → index-B8v0eZjP.js} +1 -1
- package/ui-dist/assets/{index-aKvEm2pJ.js → index-BN7Moj3u.js} +1 -1
- package/ui-dist/assets/{index-iJyjaIGd.js → index-BSpxh3cY.js} +1 -1
- package/ui-dist/assets/{index-DhRKQjzu.js → index-BY44RIi9.js} +1 -1
- package/ui-dist/assets/{index-Z4rTzdcL.js → index-BhyQJhdZ.js} +1 -1
- package/ui-dist/assets/{index-DBxBUiZC.js → index-BkPL_iGU.js} +1 -1
- package/ui-dist/assets/{index-CsSppW5U.js → index-BsPfoHXS.js} +1 -1
- package/ui-dist/assets/{index-B8J1oewY.js → index-BstW7nmv.js} +1 -1
- package/ui-dist/assets/{index-CVZYu_kq.js → index-BwB67Zyz.js} +1 -1
- package/ui-dist/assets/index-C2peSkmT.css +1 -0
- package/ui-dist/assets/{index-Djz3PL1M.js → index-C3ktOsS_.js} +1 -1
- package/ui-dist/assets/{index-BMZfWLwr.js → index-CMyABlS-.js} +1 -1
- package/ui-dist/assets/{index-Cqdw7Lnc.js → index-CyBJ8ujC.js} +1 -1
- package/ui-dist/assets/{index-Ctp_0y5X.js → index-DAxM2W3O.js} +1 -1
- package/ui-dist/assets/{index-_jGthZ-1.js → index-DVZXPmhk.js} +1 -1
- package/ui-dist/assets/{index-CBLnbZVL.js → index-Dc19uAyw.js} +1 -1
- package/ui-dist/assets/index-DzHrwZu1.js +1511 -0
- package/ui-dist/assets/{index-ChTjk1gO.js → index-LJuf53Ye.js} +1 -1
- package/ui-dist/assets/{index-wXEAD8rI.js → index-Ugw5VWWz.js} +1 -1
- package/ui-dist/assets/{index-ciyPUpT9.js → index-YGraEFR7.js} +1 -1
- package/ui-dist/assets/{infoDiagram-LFFYTUFH-DbMzKsuw.js → infoDiagram-LFFYTUFH-jLmDtFVR.js} +1 -1
- package/ui-dist/assets/{ishikawaDiagram-PHBUUO56-CcKXcf2V.js → ishikawaDiagram-PHBUUO56-6OGMyLT8.js} +1 -1
- package/ui-dist/assets/{journeyDiagram-4ABVD52K-BY2GuHyR.js → journeyDiagram-4ABVD52K-yQjl6E0t.js} +1 -1
- package/ui-dist/assets/{kanban-definition-K7BYSVSG-BlZWM0Uz.js → kanban-definition-K7BYSVSG-DkdCeQlS.js} +1 -1
- package/ui-dist/assets/{layout-qHGAYgRY.js → layout-CqSYvZ_w.js} +1 -1
- package/ui-dist/assets/{linear-BigkGXbh.js → linear-B8xGZaoi.js} +1 -1
- package/ui-dist/assets/{mermaid.core-DZ099nW4.js → mermaid.core-AKL_cdyk.js} +4 -4
- package/ui-dist/assets/{mindmap-definition-YRQLILUH-CElDqDe0.js → mindmap-definition-YRQLILUH-Zr-dXC0x.js} +1 -1
- package/ui-dist/assets/{pieDiagram-SKSYHLDU-I2LDYrgm.js → pieDiagram-SKSYHLDU-BvDAU-Nk.js} +1 -1
- package/ui-dist/assets/{quadrantDiagram-337W2JSQ-D-U35edU.js → quadrantDiagram-337W2JSQ-Dn9kM62o.js} +1 -1
- package/ui-dist/assets/{requirementDiagram-Z7DCOOCP-FAWtaOKe.js → requirementDiagram-Z7DCOOCP-GIsIh7Sd.js} +1 -1
- package/ui-dist/assets/{sankeyDiagram-WA2Y5GQK-CzFHHNNh.js → sankeyDiagram-WA2Y5GQK-CUCuBkuf.js} +1 -1
- package/ui-dist/assets/{sequenceDiagram-2WXFIKYE-Cy-UViPL.js → sequenceDiagram-2WXFIKYE-MDpUY2HM.js} +1 -1
- package/ui-dist/assets/{stateDiagram-RAJIS63D-BEdt3CLl.js → stateDiagram-RAJIS63D-BymMpuUU.js} +1 -1
- package/ui-dist/assets/stateDiagram-v2-FVOUBMTO-Bi2oCU6d.js +1 -0
- package/ui-dist/assets/{timeline-definition-YZTLITO2-YD1e-WHS.js → timeline-definition-YZTLITO2-B6ofPhhy.js} +1 -1
- package/ui-dist/assets/{treemap-KZPCXAKY-BnqlVkAC.js → treemap-KZPCXAKY-DnLO6w1l.js} +1 -1
- package/ui-dist/assets/{vennDiagram-LZ73GAT5-f4WCy3o6.js → vennDiagram-LZ73GAT5-D0MyZIDl.js} +1 -1
- package/ui-dist/assets/{xychartDiagram-JWTSCODW-CWA35znA.js → xychartDiagram-JWTSCODW-rADY1iUG.js} +1 -1
- package/ui-dist/index.html +2 -2
- package/ui-dist/assets/channel-BV7st2TW.js +0 -1
- package/ui-dist/assets/classDiagram-VBA2DB6C-Cw_xj5ie.js +0 -1
- package/ui-dist/assets/classDiagram-v2-RAHNMMFH-Cw_xj5ie.js +0 -1
- package/ui-dist/assets/clone-DGshofUt.js +0 -1
- package/ui-dist/assets/index-Ded0dPwB.css +0 -1
- package/ui-dist/assets/index-Jhxth516.js +0 -1510
- package/ui-dist/assets/stateDiagram-v2-FVOUBMTO-cW7aES_v.js +0 -1
|
@@ -0,0 +1,607 @@
|
|
|
1
|
+
import { deriveProjectUrlKey, normalizeAgentUrlKey, } from "@rudderhq/shared";
|
|
2
|
+
import { notFound } from "../../errors.js";
|
|
3
|
+
import { generateReadme } from "../organization-export-readme.js";
|
|
4
|
+
import { renderOrgChartPng } from "../../routes/org-chart-svg.js";
|
|
5
|
+
import { issueService } from "../issues.js";
|
|
6
|
+
import { projectService } from "../projects.js";
|
|
7
|
+
import { automationService } from "../automations.js";
|
|
8
|
+
import { ADAPTER_DEFAULT_RULES_BY_TYPE, COMPANY_LOGO_FILE_NAME, RUNTIME_DEFAULT_RULES, asString, buildOrgTreeFromManifest, buildPortableProjectWorkspaces, buildSkillExportDirMap, classifyPortableFileKind, exportPortableProjectExecutionWorkspacePolicy, isPlainRecord, normalizeSkillKey, normalizeSkillSlug, stripEmptyValues, toSafeSlug, uniqueSlug, } from "./organization-portability.core.js";
|
|
9
|
+
import { buildMarkdown, bufferToPortableBinaryFile, extractPortableEnvInputs, filterExportFiles, isAbsoluteCommand, normalizeInclude, normalizePortableConfig, normalizePortablePath, normalizePortableSidebarOrder, pruneDefaultLikeValue, resolveCompanyLogoExtension, sortAgentsBySidebarOrder, streamToBuffer, } from "./organization-portability.files.js";
|
|
10
|
+
import { buildEnvInputMap, buildManifestFromPackageFiles, buildReferencedSkillMarkdown, buildYamlFile, dedupeEnvInputs, ensurePortableAgentEntryFile, shouldReferenceSkillOnExport, withSkillSourceMetadata, } from "./organization-portability.package.js";
|
|
11
|
+
export function createOrganizationPortabilityExportHandlers(context) {
|
|
12
|
+
const { db, storage, organizations, agents, assetRecords, instructions, organizationSkills } = context;
|
|
13
|
+
async function exportBundle(orgId, input, options = {}) {
|
|
14
|
+
const totalProgressSteps = 8;
|
|
15
|
+
const assertNotAborted = () => {
|
|
16
|
+
if (options.signal?.aborted) {
|
|
17
|
+
throw new Error("Export build canceled");
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const reportProgress = (stage, message, completed, fileCount) => {
|
|
21
|
+
options.onProgress?.({
|
|
22
|
+
stage,
|
|
23
|
+
message,
|
|
24
|
+
completed,
|
|
25
|
+
total: totalProgressSteps,
|
|
26
|
+
fileCount: fileCount ?? null,
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
assertNotAborted();
|
|
30
|
+
reportProgress("collecting", "Collecting organization data.", 1);
|
|
31
|
+
const include = normalizeInclude({
|
|
32
|
+
...input.include,
|
|
33
|
+
agents: input.agents && input.agents.length > 0 ? true : input.include?.agents,
|
|
34
|
+
projects: input.projects && input.projects.length > 0 ? true : input.include?.projects,
|
|
35
|
+
issues: (input.issues && input.issues.length > 0) || (input.projectIssues && input.projectIssues.length > 0)
|
|
36
|
+
? true
|
|
37
|
+
: input.include?.issues,
|
|
38
|
+
skills: input.skills && input.skills.length > 0 ? true : input.include?.skills,
|
|
39
|
+
});
|
|
40
|
+
const organization = await organizations.getById(orgId);
|
|
41
|
+
assertNotAborted();
|
|
42
|
+
if (!organization)
|
|
43
|
+
throw notFound("Organization not found");
|
|
44
|
+
const files = {};
|
|
45
|
+
const warnings = [];
|
|
46
|
+
const envInputs = [];
|
|
47
|
+
const requestedSidebarOrder = normalizePortableSidebarOrder(input.sidebarOrder);
|
|
48
|
+
const rootPath = normalizeAgentUrlKey(organization.name) ?? "organization-package";
|
|
49
|
+
let companyLogoPath = null;
|
|
50
|
+
const allAgentRows = include.agents ? await agents.list(orgId, { includeTerminated: true }) : [];
|
|
51
|
+
assertNotAborted();
|
|
52
|
+
const liveAgentRows = allAgentRows.filter((agent) => agent.status !== "terminated");
|
|
53
|
+
const organizationSkillRows = include.skills || include.agents ? await organizationSkills.listFull(orgId) : [];
|
|
54
|
+
assertNotAborted();
|
|
55
|
+
if (include.agents) {
|
|
56
|
+
const skipped = allAgentRows.length - liveAgentRows.length;
|
|
57
|
+
if (skipped > 0) {
|
|
58
|
+
warnings.push(`Skipped ${skipped} terminated agent${skipped === 1 ? "" : "s"} from export.`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const agentByReference = new Map();
|
|
62
|
+
for (const agent of liveAgentRows) {
|
|
63
|
+
agentByReference.set(agent.id, agent);
|
|
64
|
+
agentByReference.set(agent.name, agent);
|
|
65
|
+
const normalizedName = normalizeAgentUrlKey(agent.name);
|
|
66
|
+
if (normalizedName) {
|
|
67
|
+
agentByReference.set(normalizedName, agent);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const selectedAgents = new Map();
|
|
71
|
+
for (const selector of input.agents ?? []) {
|
|
72
|
+
const trimmed = selector.trim();
|
|
73
|
+
if (!trimmed)
|
|
74
|
+
continue;
|
|
75
|
+
const normalized = normalizeAgentUrlKey(trimmed) ?? trimmed;
|
|
76
|
+
const match = agentByReference.get(trimmed) ?? agentByReference.get(normalized);
|
|
77
|
+
if (!match) {
|
|
78
|
+
warnings.push(`Agent selector "${selector}" was not found and was skipped.`);
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
selectedAgents.set(match.id, match);
|
|
82
|
+
}
|
|
83
|
+
if (include.agents && selectedAgents.size === 0) {
|
|
84
|
+
for (const agent of liveAgentRows) {
|
|
85
|
+
selectedAgents.set(agent.id, agent);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const agentRows = Array.from(selectedAgents.values())
|
|
89
|
+
.sort((left, right) => left.name.localeCompare(right.name));
|
|
90
|
+
const usedSlugs = new Set();
|
|
91
|
+
const idToSlug = new Map();
|
|
92
|
+
for (const agent of agentRows) {
|
|
93
|
+
const baseSlug = toSafeSlug(agent.name, "agent");
|
|
94
|
+
const slug = uniqueSlug(baseSlug, usedSlugs);
|
|
95
|
+
idToSlug.set(agent.id, slug);
|
|
96
|
+
}
|
|
97
|
+
const projectsSvc = projectService(db);
|
|
98
|
+
const issuesSvc = issueService(db);
|
|
99
|
+
const automationsSvc = automationService(db);
|
|
100
|
+
const allProjectsRaw = include.projects || include.issues ? await projectsSvc.list(orgId) : [];
|
|
101
|
+
assertNotAborted();
|
|
102
|
+
const allProjects = allProjectsRaw.filter((project) => !project.archivedAt);
|
|
103
|
+
const allAutomations = include.issues ? await automationsSvc.list(orgId) : [];
|
|
104
|
+
assertNotAborted();
|
|
105
|
+
const projectById = new Map(allProjects.map((project) => [project.id, project]));
|
|
106
|
+
const projectByReference = new Map();
|
|
107
|
+
for (const project of allProjects) {
|
|
108
|
+
projectByReference.set(project.id, project);
|
|
109
|
+
projectByReference.set(project.urlKey, project);
|
|
110
|
+
}
|
|
111
|
+
const selectedProjects = new Map();
|
|
112
|
+
const normalizeProjectSelector = (selector) => selector.trim().toLowerCase();
|
|
113
|
+
for (const selector of input.projects ?? []) {
|
|
114
|
+
const match = projectByReference.get(selector) ?? projectByReference.get(normalizeProjectSelector(selector));
|
|
115
|
+
if (!match) {
|
|
116
|
+
warnings.push(`Project selector "${selector}" was not found and was skipped.`);
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
selectedProjects.set(match.id, match);
|
|
120
|
+
}
|
|
121
|
+
const selectedIssues = new Map();
|
|
122
|
+
const selectedAutomations = new Map();
|
|
123
|
+
const automationById = new Map(allAutomations.map((automation) => [automation.id, automation]));
|
|
124
|
+
const resolveIssueBySelector = async (selector) => {
|
|
125
|
+
const trimmed = selector.trim();
|
|
126
|
+
if (!trimmed)
|
|
127
|
+
return null;
|
|
128
|
+
return trimmed.includes("-")
|
|
129
|
+
? issuesSvc.getByIdentifier(trimmed)
|
|
130
|
+
: issuesSvc.getById(trimmed);
|
|
131
|
+
};
|
|
132
|
+
for (const selector of input.issues ?? []) {
|
|
133
|
+
const issue = await resolveIssueBySelector(selector);
|
|
134
|
+
if (!issue || issue.orgId !== orgId) {
|
|
135
|
+
const automation = automationById.get(selector.trim());
|
|
136
|
+
if (automation) {
|
|
137
|
+
selectedAutomations.set(automation.id, automation);
|
|
138
|
+
if (automation.projectId) {
|
|
139
|
+
const parentProject = projectById.get(automation.projectId);
|
|
140
|
+
if (parentProject)
|
|
141
|
+
selectedProjects.set(parentProject.id, parentProject);
|
|
142
|
+
}
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
warnings.push(`Issue selector "${selector}" was not found and was skipped.`);
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
selectedIssues.set(issue.id, issue);
|
|
149
|
+
if (issue.projectId) {
|
|
150
|
+
const parentProject = projectById.get(issue.projectId);
|
|
151
|
+
if (parentProject)
|
|
152
|
+
selectedProjects.set(parentProject.id, parentProject);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
for (const selector of input.projectIssues ?? []) {
|
|
156
|
+
const match = projectByReference.get(selector) ?? projectByReference.get(normalizeProjectSelector(selector));
|
|
157
|
+
if (!match) {
|
|
158
|
+
warnings.push(`Project-issues selector "${selector}" was not found and was skipped.`);
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
selectedProjects.set(match.id, match);
|
|
162
|
+
const projectIssues = await issuesSvc.list(orgId, { projectId: match.id });
|
|
163
|
+
assertNotAborted();
|
|
164
|
+
for (const issue of projectIssues) {
|
|
165
|
+
selectedIssues.set(issue.id, issue);
|
|
166
|
+
}
|
|
167
|
+
for (const automation of allAutomations.filter((entry) => entry.projectId === match.id)) {
|
|
168
|
+
selectedAutomations.set(automation.id, automation);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
if (include.projects && selectedProjects.size === 0) {
|
|
172
|
+
for (const project of allProjects) {
|
|
173
|
+
selectedProjects.set(project.id, project);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (include.issues && selectedIssues.size === 0) {
|
|
177
|
+
const allIssues = await issuesSvc.list(orgId);
|
|
178
|
+
assertNotAborted();
|
|
179
|
+
for (const issue of allIssues) {
|
|
180
|
+
selectedIssues.set(issue.id, issue);
|
|
181
|
+
if (issue.projectId) {
|
|
182
|
+
const parentProject = projectById.get(issue.projectId);
|
|
183
|
+
if (parentProject)
|
|
184
|
+
selectedProjects.set(parentProject.id, parentProject);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
if (selectedAutomations.size === 0) {
|
|
188
|
+
for (const automation of allAutomations) {
|
|
189
|
+
selectedAutomations.set(automation.id, automation);
|
|
190
|
+
if (automation.projectId) {
|
|
191
|
+
const parentProject = projectById.get(automation.projectId);
|
|
192
|
+
if (parentProject)
|
|
193
|
+
selectedProjects.set(parentProject.id, parentProject);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
const selectedProjectRows = Array.from(selectedProjects.values())
|
|
199
|
+
.sort((left, right) => left.name.localeCompare(right.name));
|
|
200
|
+
const selectedIssueRows = Array.from(selectedIssues.values())
|
|
201
|
+
.filter((issue) => issue != null)
|
|
202
|
+
.sort((left, right) => (left.identifier ?? left.title).localeCompare(right.identifier ?? right.title));
|
|
203
|
+
const selectedAutomationSummaries = Array.from(selectedAutomations.values())
|
|
204
|
+
.sort((left, right) => left.title.localeCompare(right.title));
|
|
205
|
+
const selectedAutomationRows = (await Promise.all(selectedAutomationSummaries.map((automation) => automationsSvc.getDetail(automation.id)))).filter((automation) => automation !== null);
|
|
206
|
+
assertNotAborted();
|
|
207
|
+
reportProgress("resolving_selection", `Resolved ${selectedAgents.size} agents, ${selectedProjects.size} projects, and ${selectedIssues.size + selectedAutomations.size} tasks.`, 2, Object.keys(files).length);
|
|
208
|
+
const taskSlugByIssueId = new Map();
|
|
209
|
+
const taskSlugByAutomationId = new Map();
|
|
210
|
+
const usedTaskSlugs = new Set();
|
|
211
|
+
for (const issue of selectedIssueRows) {
|
|
212
|
+
const baseSlug = normalizeAgentUrlKey(issue.identifier ?? issue.title) ?? "task";
|
|
213
|
+
taskSlugByIssueId.set(issue.id, uniqueSlug(baseSlug, usedTaskSlugs));
|
|
214
|
+
}
|
|
215
|
+
for (const automation of selectedAutomationRows) {
|
|
216
|
+
const baseSlug = normalizeAgentUrlKey(automation.title) ?? "task";
|
|
217
|
+
taskSlugByAutomationId.set(automation.id, uniqueSlug(baseSlug, usedTaskSlugs));
|
|
218
|
+
}
|
|
219
|
+
const projectSlugById = new Map();
|
|
220
|
+
const projectWorkspaceKeyByProjectId = new Map();
|
|
221
|
+
const usedProjectSlugs = new Set();
|
|
222
|
+
for (const project of selectedProjectRows) {
|
|
223
|
+
const baseSlug = deriveProjectUrlKey(project.name, project.name);
|
|
224
|
+
projectSlugById.set(project.id, uniqueSlug(baseSlug, usedProjectSlugs));
|
|
225
|
+
}
|
|
226
|
+
const sidebarOrder = requestedSidebarOrder ?? stripEmptyValues({
|
|
227
|
+
agents: sortAgentsBySidebarOrder(Array.from(selectedAgents.values()))
|
|
228
|
+
.map((agent) => idToSlug.get(agent.id))
|
|
229
|
+
.filter((slug) => Boolean(slug)),
|
|
230
|
+
projects: selectedProjectRows
|
|
231
|
+
.map((project) => projectSlugById.get(project.id))
|
|
232
|
+
.filter((slug) => Boolean(slug)),
|
|
233
|
+
});
|
|
234
|
+
const companyPath = "ORGANIZATION.md";
|
|
235
|
+
files[companyPath] = buildMarkdown({
|
|
236
|
+
name: organization.name,
|
|
237
|
+
description: organization.description ?? null,
|
|
238
|
+
schema: "agentorganizations/v1",
|
|
239
|
+
slug: rootPath,
|
|
240
|
+
}, "");
|
|
241
|
+
if (include.organization && organization.logoAssetId) {
|
|
242
|
+
if (!storage) {
|
|
243
|
+
warnings.push("Skipped organization logo from export because storage is unavailable.");
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
const logoAsset = await assetRecords.getById(organization.logoAssetId);
|
|
247
|
+
if (!logoAsset) {
|
|
248
|
+
warnings.push(`Skipped organization logo ${organization.logoAssetId} because the asset record was not found.`);
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
try {
|
|
252
|
+
const object = await storage.getObject(organization.id, logoAsset.objectKey);
|
|
253
|
+
const body = await streamToBuffer(object.stream);
|
|
254
|
+
companyLogoPath = `images/${COMPANY_LOGO_FILE_NAME}${resolveCompanyLogoExtension(logoAsset.contentType, logoAsset.originalFilename)}`;
|
|
255
|
+
files[companyLogoPath] = bufferToPortableBinaryFile(body, logoAsset.contentType);
|
|
256
|
+
}
|
|
257
|
+
catch (err) {
|
|
258
|
+
warnings.push(`Failed to export organization logo ${organization.logoAssetId}: ${err instanceof Error ? err.message : String(err)}`);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
const rudderAgentsOut = {};
|
|
264
|
+
const rudderProjectsOut = {};
|
|
265
|
+
const rudderTasksOut = {};
|
|
266
|
+
const unportableTaskWorkspaceRefs = new Map();
|
|
267
|
+
const rudderAutomationsOut = {};
|
|
268
|
+
const skillByReference = new Map();
|
|
269
|
+
for (const skill of organizationSkillRows) {
|
|
270
|
+
skillByReference.set(skill.id, skill);
|
|
271
|
+
skillByReference.set(skill.key, skill);
|
|
272
|
+
skillByReference.set(skill.slug, skill);
|
|
273
|
+
skillByReference.set(skill.name, skill);
|
|
274
|
+
}
|
|
275
|
+
const selectedSkills = new Map();
|
|
276
|
+
for (const selector of input.skills ?? []) {
|
|
277
|
+
const trimmed = selector.trim();
|
|
278
|
+
if (!trimmed)
|
|
279
|
+
continue;
|
|
280
|
+
const normalized = normalizeSkillKey(trimmed) ?? normalizeSkillSlug(trimmed) ?? trimmed;
|
|
281
|
+
const match = skillByReference.get(trimmed) ?? skillByReference.get(normalized);
|
|
282
|
+
if (!match) {
|
|
283
|
+
warnings.push(`Skill selector "${selector}" was not found and was skipped.`);
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
selectedSkills.set(match.id, match);
|
|
287
|
+
}
|
|
288
|
+
if (selectedSkills.size === 0) {
|
|
289
|
+
for (const skill of organizationSkillRows) {
|
|
290
|
+
selectedSkills.set(skill.id, skill);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
const selectedSkillRows = Array.from(selectedSkills.values())
|
|
294
|
+
.sort((left, right) => left.key.localeCompare(right.key));
|
|
295
|
+
const skillExportDirs = buildSkillExportDirMap(selectedSkillRows, organization.issuePrefix);
|
|
296
|
+
if (selectedSkillRows.length > 0) {
|
|
297
|
+
reportProgress("rendering_skills", `Rendering ${selectedSkillRows.length} skill files.`, 3, Object.keys(files).length);
|
|
298
|
+
}
|
|
299
|
+
for (const skill of selectedSkillRows) {
|
|
300
|
+
assertNotAborted();
|
|
301
|
+
const packageDir = skillExportDirs.get(skill.key) ?? `skills/${normalizeSkillSlug(skill.slug) ?? "skill"}`;
|
|
302
|
+
if (shouldReferenceSkillOnExport(skill, Boolean(input.expandReferencedSkills))) {
|
|
303
|
+
files[`${packageDir}/SKILL.md`] = await buildReferencedSkillMarkdown(skill);
|
|
304
|
+
assertNotAborted();
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
for (const inventoryEntry of skill.fileInventory) {
|
|
308
|
+
assertNotAborted();
|
|
309
|
+
const fileDetail = await organizationSkills.readFile(orgId, skill.id, inventoryEntry.path).catch(() => null);
|
|
310
|
+
if (!fileDetail)
|
|
311
|
+
continue;
|
|
312
|
+
const filePath = `${packageDir}/${inventoryEntry.path}`;
|
|
313
|
+
files[filePath] = inventoryEntry.path === "SKILL.md"
|
|
314
|
+
? await withSkillSourceMetadata(skill, fileDetail.content)
|
|
315
|
+
: fileDetail.content;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
if (include.agents) {
|
|
319
|
+
reportProgress("rendering_agents", `Rendering ${agentRows.length} agent files.`, 4, Object.keys(files).length);
|
|
320
|
+
for (const agent of agentRows) {
|
|
321
|
+
assertNotAborted();
|
|
322
|
+
const slug = idToSlug.get(agent.id);
|
|
323
|
+
const exportedInstructions = await instructions.exportFiles(agent);
|
|
324
|
+
assertNotAborted();
|
|
325
|
+
warnings.push(...exportedInstructions.warnings);
|
|
326
|
+
const portableInstructions = ensurePortableAgentEntryFile(exportedInstructions.files, exportedInstructions.entryFile, asString(agent.agentRuntimeConfig.promptTemplate) ?? "");
|
|
327
|
+
const envInputsStart = envInputs.length;
|
|
328
|
+
const exportedEnvInputs = extractPortableEnvInputs(slug, agent.agentRuntimeConfig.env, warnings);
|
|
329
|
+
envInputs.push(...exportedEnvInputs);
|
|
330
|
+
const adapterDefaultRules = ADAPTER_DEFAULT_RULES_BY_TYPE[agent.agentRuntimeType] ?? [];
|
|
331
|
+
const portableAdapterConfig = pruneDefaultLikeValue(normalizePortableConfig(agent.agentRuntimeConfig), {
|
|
332
|
+
dropFalseBooleans: true,
|
|
333
|
+
defaultRules: adapterDefaultRules,
|
|
334
|
+
});
|
|
335
|
+
const portableRuntimeConfig = pruneDefaultLikeValue(normalizePortableConfig(agent.runtimeConfig), {
|
|
336
|
+
dropFalseBooleans: true,
|
|
337
|
+
defaultRules: RUNTIME_DEFAULT_RULES,
|
|
338
|
+
});
|
|
339
|
+
const portablePermissions = pruneDefaultLikeValue(agent.permissions ?? {}, { dropFalseBooleans: true });
|
|
340
|
+
const agentEnvInputs = dedupeEnvInputs(envInputs
|
|
341
|
+
.slice(envInputsStart)
|
|
342
|
+
.filter((inputValue) => inputValue.agentSlug === slug));
|
|
343
|
+
const reportsToSlug = agent.reportsTo ? (idToSlug.get(agent.reportsTo) ?? null) : null;
|
|
344
|
+
const desiredSkills = await organizationSkills.getEnabledSkillKeysForAgent(agent.orgId, agent);
|
|
345
|
+
assertNotAborted();
|
|
346
|
+
const commandValue = asString(portableAdapterConfig.command);
|
|
347
|
+
if (commandValue && isAbsoluteCommand(commandValue)) {
|
|
348
|
+
warnings.push(`Agent ${slug} command ${commandValue} was omitted from export because it is system-dependent.`);
|
|
349
|
+
delete portableAdapterConfig.command;
|
|
350
|
+
}
|
|
351
|
+
for (const [relativePath, content] of Object.entries(portableInstructions.files)) {
|
|
352
|
+
const targetPath = `agents/${slug}/${relativePath}`;
|
|
353
|
+
if (relativePath === portableInstructions.entryFile) {
|
|
354
|
+
files[targetPath] = buildMarkdown(stripEmptyValues({
|
|
355
|
+
name: agent.name,
|
|
356
|
+
title: agent.title ?? null,
|
|
357
|
+
reportsTo: reportsToSlug,
|
|
358
|
+
skills: desiredSkills.length > 0 ? desiredSkills : undefined,
|
|
359
|
+
}), content);
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
files[targetPath] = content;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
const extension = stripEmptyValues({
|
|
366
|
+
role: agent.role !== "agent" ? agent.role : undefined,
|
|
367
|
+
icon: agent.icon ?? null,
|
|
368
|
+
capabilities: agent.capabilities ?? null,
|
|
369
|
+
adapter: {
|
|
370
|
+
type: agent.agentRuntimeType,
|
|
371
|
+
config: portableAdapterConfig,
|
|
372
|
+
},
|
|
373
|
+
runtime: portableRuntimeConfig,
|
|
374
|
+
permissions: portablePermissions,
|
|
375
|
+
budgetMonthlyCents: (agent.budgetMonthlyCents ?? 0) > 0 ? agent.budgetMonthlyCents : undefined,
|
|
376
|
+
metadata: agent.metadata ?? null,
|
|
377
|
+
});
|
|
378
|
+
if (isPlainRecord(extension) && agentEnvInputs.length > 0) {
|
|
379
|
+
extension.inputs = {
|
|
380
|
+
env: buildEnvInputMap(agentEnvInputs),
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
rudderAgentsOut[slug] = isPlainRecord(extension) ? extension : {};
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
if (selectedProjectRows.length > 0) {
|
|
387
|
+
reportProgress("rendering_projects", `Rendering ${selectedProjectRows.length} project files.`, 5, Object.keys(files).length);
|
|
388
|
+
}
|
|
389
|
+
for (const project of selectedProjectRows) {
|
|
390
|
+
assertNotAborted();
|
|
391
|
+
const slug = projectSlugById.get(project.id);
|
|
392
|
+
const projectPath = `projects/${slug}/PROJECT.md`;
|
|
393
|
+
const portableWorkspaces = await buildPortableProjectWorkspaces(slug, project.workspaces, warnings);
|
|
394
|
+
projectWorkspaceKeyByProjectId.set(project.id, portableWorkspaces.workspaceKeyById);
|
|
395
|
+
files[projectPath] = buildMarkdown({
|
|
396
|
+
name: project.name,
|
|
397
|
+
description: project.description ?? null,
|
|
398
|
+
owner: project.leadAgentId ? (idToSlug.get(project.leadAgentId) ?? null) : null,
|
|
399
|
+
}, project.description ?? "");
|
|
400
|
+
const extension = stripEmptyValues({
|
|
401
|
+
leadAgentSlug: project.leadAgentId ? (idToSlug.get(project.leadAgentId) ?? null) : null,
|
|
402
|
+
targetDate: project.targetDate ?? null,
|
|
403
|
+
color: project.color ?? null,
|
|
404
|
+
status: project.status,
|
|
405
|
+
executionWorkspacePolicy: exportPortableProjectExecutionWorkspacePolicy(slug, project.executionWorkspacePolicy, portableWorkspaces.workspaceKeyById, warnings) ?? undefined,
|
|
406
|
+
workspaces: portableWorkspaces.extension,
|
|
407
|
+
});
|
|
408
|
+
rudderProjectsOut[slug] = isPlainRecord(extension) ? extension : {};
|
|
409
|
+
}
|
|
410
|
+
if (selectedIssueRows.length > 0 || selectedAutomationRows.length > 0) {
|
|
411
|
+
reportProgress("rendering_tasks", `Rendering ${selectedIssueRows.length + selectedAutomationRows.length} task files.`, 6, Object.keys(files).length);
|
|
412
|
+
}
|
|
413
|
+
for (const issue of selectedIssueRows) {
|
|
414
|
+
assertNotAborted();
|
|
415
|
+
const taskSlug = taskSlugByIssueId.get(issue.id);
|
|
416
|
+
const projectSlug = issue.projectId ? (projectSlugById.get(issue.projectId) ?? null) : null;
|
|
417
|
+
// All tasks go in top-level tasks/ folder, never nested under projects/
|
|
418
|
+
const taskPath = `tasks/${taskSlug}/TASK.md`;
|
|
419
|
+
const assigneeSlug = issue.assigneeAgentId ? (idToSlug.get(issue.assigneeAgentId) ?? null) : null;
|
|
420
|
+
const parentSlug = issue.parentId ? (taskSlugByIssueId.get(issue.parentId) ?? null) : null;
|
|
421
|
+
const projectWorkspaceKey = issue.projectId && issue.projectWorkspaceId
|
|
422
|
+
? projectWorkspaceKeyByProjectId.get(issue.projectId)?.get(issue.projectWorkspaceId) ?? null
|
|
423
|
+
: null;
|
|
424
|
+
if (issue.projectWorkspaceId && !projectWorkspaceKey) {
|
|
425
|
+
const aggregateKey = `${issue.projectId ?? "no-project"}:${issue.projectWorkspaceId}`;
|
|
426
|
+
const existing = unportableTaskWorkspaceRefs.get(aggregateKey);
|
|
427
|
+
if (existing) {
|
|
428
|
+
existing.taskSlugs.push(taskSlug);
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
unportableTaskWorkspaceRefs.set(aggregateKey, {
|
|
432
|
+
workspaceId: issue.projectWorkspaceId,
|
|
433
|
+
taskSlugs: [taskSlug],
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
files[taskPath] = buildMarkdown({
|
|
438
|
+
name: issue.title,
|
|
439
|
+
project: projectSlug,
|
|
440
|
+
assignee: assigneeSlug,
|
|
441
|
+
parent: parentSlug,
|
|
442
|
+
}, issue.description ?? "");
|
|
443
|
+
const extension = stripEmptyValues({
|
|
444
|
+
identifier: issue.identifier,
|
|
445
|
+
status: issue.status,
|
|
446
|
+
priority: issue.priority,
|
|
447
|
+
labelIds: issue.labelIds ?? undefined,
|
|
448
|
+
billingCode: issue.billingCode ?? null,
|
|
449
|
+
projectWorkspaceKey: projectWorkspaceKey ?? undefined,
|
|
450
|
+
executionWorkspaceSettings: issue.executionWorkspaceSettings ?? undefined,
|
|
451
|
+
assigneeAgentRuntimeOverrides: issue.assigneeAgentRuntimeOverrides ?? undefined,
|
|
452
|
+
parentIssueSlug: parentSlug ?? undefined,
|
|
453
|
+
});
|
|
454
|
+
rudderTasksOut[taskSlug] = isPlainRecord(extension) ? extension : {};
|
|
455
|
+
}
|
|
456
|
+
for (const { workspaceId, taskSlugs } of unportableTaskWorkspaceRefs.values()) {
|
|
457
|
+
const preview = taskSlugs.slice(0, 4).join(", ");
|
|
458
|
+
const remainder = taskSlugs.length > 4 ? ` and ${taskSlugs.length - 4} more` : "";
|
|
459
|
+
warnings.push(`Tasks ${preview}${remainder} reference workspace ${workspaceId}, but that workspace could not be exported portably.`);
|
|
460
|
+
}
|
|
461
|
+
for (const automation of selectedAutomationRows) {
|
|
462
|
+
assertNotAborted();
|
|
463
|
+
const taskSlug = taskSlugByAutomationId.get(automation.id);
|
|
464
|
+
const projectSlug = automation.projectId ? (projectSlugById.get(automation.projectId) ?? null) : null;
|
|
465
|
+
const taskPath = `tasks/${taskSlug}/TASK.md`;
|
|
466
|
+
const assigneeSlug = idToSlug.get(automation.assigneeAgentId) ?? null;
|
|
467
|
+
files[taskPath] = buildMarkdown({
|
|
468
|
+
name: automation.title,
|
|
469
|
+
project: projectSlug,
|
|
470
|
+
assignee: assigneeSlug,
|
|
471
|
+
recurring: true,
|
|
472
|
+
}, automation.description ?? "");
|
|
473
|
+
const extension = stripEmptyValues({
|
|
474
|
+
status: automation.status !== "active" ? automation.status : undefined,
|
|
475
|
+
priority: automation.priority !== "medium" ? automation.priority : undefined,
|
|
476
|
+
concurrencyPolicy: automation.concurrencyPolicy !== "coalesce_if_active" ? automation.concurrencyPolicy : undefined,
|
|
477
|
+
catchUpPolicy: automation.catchUpPolicy !== "skip_missed" ? automation.catchUpPolicy : undefined,
|
|
478
|
+
triggers: automation.triggers.map((trigger) => stripEmptyValues({
|
|
479
|
+
kind: trigger.kind,
|
|
480
|
+
label: trigger.label ?? null,
|
|
481
|
+
enabled: trigger.enabled ? undefined : false,
|
|
482
|
+
cronExpression: trigger.kind === "schedule" ? trigger.cronExpression ?? null : undefined,
|
|
483
|
+
timezone: trigger.kind === "schedule" ? trigger.timezone ?? null : undefined,
|
|
484
|
+
signingMode: trigger.kind === "webhook" && trigger.signingMode !== "bearer" ? trigger.signingMode ?? null : undefined,
|
|
485
|
+
replayWindowSec: trigger.kind === "webhook" && trigger.replayWindowSec !== 300
|
|
486
|
+
? trigger.replayWindowSec ?? null
|
|
487
|
+
: undefined,
|
|
488
|
+
})),
|
|
489
|
+
});
|
|
490
|
+
rudderAutomationsOut[taskSlug] = isPlainRecord(extension) ? extension : {};
|
|
491
|
+
}
|
|
492
|
+
const rudderExtensionPath = ".rudder.yaml";
|
|
493
|
+
const rudderAgents = Object.fromEntries(Object.entries(rudderAgentsOut).filter(([, value]) => isPlainRecord(value) && Object.keys(value).length > 0));
|
|
494
|
+
const rudderProjects = Object.fromEntries(Object.entries(rudderProjectsOut).filter(([, value]) => isPlainRecord(value) && Object.keys(value).length > 0));
|
|
495
|
+
const rudderTasks = Object.fromEntries(Object.entries(rudderTasksOut).filter(([, value]) => isPlainRecord(value) && Object.keys(value).length > 0));
|
|
496
|
+
const rudderAutomations = Object.fromEntries(Object.entries(rudderAutomationsOut).filter(([, value]) => isPlainRecord(value) && Object.keys(value).length > 0));
|
|
497
|
+
files[rudderExtensionPath] = buildYamlFile({
|
|
498
|
+
schema: "rudder/v1",
|
|
499
|
+
organization: stripEmptyValues({
|
|
500
|
+
brandColor: organization.brandColor ?? null,
|
|
501
|
+
logoPath: companyLogoPath,
|
|
502
|
+
requireBoardApprovalForNewAgents: organization.requireBoardApprovalForNewAgents ? undefined : false,
|
|
503
|
+
}),
|
|
504
|
+
sidebar: stripEmptyValues(sidebarOrder),
|
|
505
|
+
agents: Object.keys(rudderAgents).length > 0 ? rudderAgents : undefined,
|
|
506
|
+
projects: Object.keys(rudderProjects).length > 0 ? rudderProjects : undefined,
|
|
507
|
+
tasks: Object.keys(rudderTasks).length > 0 ? rudderTasks : undefined,
|
|
508
|
+
automations: Object.keys(rudderAutomations).length > 0 ? rudderAutomations : undefined,
|
|
509
|
+
}, { preserveEmptyStrings: true });
|
|
510
|
+
let finalFiles = filterExportFiles(files, input.selectedFiles, rudderExtensionPath);
|
|
511
|
+
let resolved = buildManifestFromPackageFiles(finalFiles, {
|
|
512
|
+
sourceLabel: {
|
|
513
|
+
orgId: organization.id,
|
|
514
|
+
organizationName: organization.name,
|
|
515
|
+
},
|
|
516
|
+
});
|
|
517
|
+
resolved.manifest.includes = {
|
|
518
|
+
organization: resolved.manifest.organization !== null,
|
|
519
|
+
agents: resolved.manifest.agents.length > 0,
|
|
520
|
+
projects: resolved.manifest.projects.length > 0,
|
|
521
|
+
issues: resolved.manifest.issues.length > 0,
|
|
522
|
+
skills: resolved.manifest.skills.length > 0,
|
|
523
|
+
};
|
|
524
|
+
resolved.manifest.envInputs = dedupeEnvInputs(envInputs);
|
|
525
|
+
resolved.warnings.unshift(...warnings);
|
|
526
|
+
// Generate org chart PNG from manifest agents
|
|
527
|
+
if (resolved.manifest.agents.length > 0) {
|
|
528
|
+
try {
|
|
529
|
+
assertNotAborted();
|
|
530
|
+
reportProgress("generating_assets", "Generating organization chart image.", 7, Object.keys(finalFiles).length);
|
|
531
|
+
const orgNodes = buildOrgTreeFromManifest(resolved.manifest.agents);
|
|
532
|
+
const pngBuffer = await renderOrgChartPng(orgNodes);
|
|
533
|
+
assertNotAborted();
|
|
534
|
+
finalFiles["images/org-chart.png"] = bufferToPortableBinaryFile(pngBuffer, "image/png");
|
|
535
|
+
}
|
|
536
|
+
catch (err) {
|
|
537
|
+
if (options.signal?.aborted)
|
|
538
|
+
throw err;
|
|
539
|
+
// Non-fatal: export still works without the org chart image
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
reportProgress("finalizing", "Finalizing export manifest and README.", 7, Object.keys(finalFiles).length);
|
|
543
|
+
if (!input.selectedFiles || input.selectedFiles.some((entry) => normalizePortablePath(entry) === "README.md")) {
|
|
544
|
+
finalFiles["README.md"] = generateReadme(resolved.manifest, {
|
|
545
|
+
organizationName: organization.name,
|
|
546
|
+
organizationDescription: organization.description ?? null,
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
resolved = buildManifestFromPackageFiles(finalFiles, {
|
|
550
|
+
sourceLabel: {
|
|
551
|
+
orgId: organization.id,
|
|
552
|
+
organizationName: organization.name,
|
|
553
|
+
},
|
|
554
|
+
});
|
|
555
|
+
resolved.manifest.includes = {
|
|
556
|
+
organization: resolved.manifest.organization !== null,
|
|
557
|
+
agents: resolved.manifest.agents.length > 0,
|
|
558
|
+
projects: resolved.manifest.projects.length > 0,
|
|
559
|
+
issues: resolved.manifest.issues.length > 0,
|
|
560
|
+
skills: resolved.manifest.skills.length > 0,
|
|
561
|
+
};
|
|
562
|
+
resolved.manifest.envInputs = dedupeEnvInputs(envInputs);
|
|
563
|
+
resolved.warnings.unshift(...warnings);
|
|
564
|
+
assertNotAborted();
|
|
565
|
+
reportProgress("ready", "Export package is ready.", 8, Object.keys(finalFiles).length);
|
|
566
|
+
return {
|
|
567
|
+
rootPath,
|
|
568
|
+
manifest: resolved.manifest,
|
|
569
|
+
files: finalFiles,
|
|
570
|
+
warnings: resolved.warnings,
|
|
571
|
+
rudderExtensionPath,
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
async function previewExport(orgId, input) {
|
|
575
|
+
const previewInput = {
|
|
576
|
+
...input,
|
|
577
|
+
include: {
|
|
578
|
+
...input.include,
|
|
579
|
+
issues: input.include?.issues
|
|
580
|
+
?? Boolean((input.issues && input.issues.length > 0) || (input.projectIssues && input.projectIssues.length > 0))
|
|
581
|
+
?? false,
|
|
582
|
+
},
|
|
583
|
+
};
|
|
584
|
+
if (previewInput.include && previewInput.include.issues === undefined) {
|
|
585
|
+
previewInput.include.issues = false;
|
|
586
|
+
}
|
|
587
|
+
const exported = await exportBundle(orgId, previewInput);
|
|
588
|
+
return {
|
|
589
|
+
...exported,
|
|
590
|
+
fileInventory: Object.keys(exported.files)
|
|
591
|
+
.sort((left, right) => left.localeCompare(right))
|
|
592
|
+
.map((filePath) => ({
|
|
593
|
+
path: filePath,
|
|
594
|
+
kind: classifyPortableFileKind(filePath),
|
|
595
|
+
})),
|
|
596
|
+
counts: {
|
|
597
|
+
files: Object.keys(exported.files).length,
|
|
598
|
+
agents: exported.manifest.agents.length,
|
|
599
|
+
skills: exported.manifest.skills.length,
|
|
600
|
+
projects: exported.manifest.projects.length,
|
|
601
|
+
issues: exported.manifest.issues.length,
|
|
602
|
+
},
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
return { exportBundle, previewExport };
|
|
606
|
+
}
|
|
607
|
+
//# sourceMappingURL=organization-portability.export.js.map
|