@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,635 @@
|
|
|
1
|
+
import { checkoutIssueSchema, createIssueSchema, reportIssueCommitSchema, updateIssueSchema, } from "@rudderhq/shared";
|
|
2
|
+
import { validate } from "../middleware/validate.js";
|
|
3
|
+
import { logActivity, } from "../services/index.js";
|
|
4
|
+
import { logger } from "../middleware/logger.js";
|
|
5
|
+
import { forbidden, HttpError, unprocessable } from "../errors.js";
|
|
6
|
+
import { assertCompanyAccess, getActorInfo } from "./authz.js";
|
|
7
|
+
import { shouldWakeAssigneeOnCheckout } from "./issues-checkout-wakeup.js";
|
|
8
|
+
import { queueIssueAssignmentWakeup } from "../services/issue-assignment-wakeup.js";
|
|
9
|
+
import { buildIssueReviewWakeupOptions, queueIssueReviewWakeup } from "../services/issue-review-wakeup.js";
|
|
10
|
+
export function registerIssueMutationRoutes(ctx) {
|
|
11
|
+
const { router, db, storage, svc, access, agentsSvc, projectsSvc, goalsSvc, heartbeat, issueApprovalsSvc, automationsSvc, executionWorkspacesSvc, assertCanAssignTasks, boardUserId, assertAgentRunCheckoutOwnership, resolveAgentIssueRunId, requireAgentRunId, issueHasReviewer, isReviewerAgentForIssue, canAgentCompleteIssue, statusForReviewDecision, statusAcceptsReviewerDecision, reviewerDecisionRequiresHumanHandoff, commitSubject, } = ctx;
|
|
12
|
+
router.post("/orgs/:orgId/issues", validate(createIssueSchema), async (req, res) => {
|
|
13
|
+
const orgId = req.params.orgId;
|
|
14
|
+
assertCompanyAccess(req, orgId);
|
|
15
|
+
if (req.body.assigneeAgentId || req.body.assigneeUserId || req.body.reviewerAgentId || req.body.reviewerUserId) {
|
|
16
|
+
await assertCanAssignTasks(req, orgId);
|
|
17
|
+
}
|
|
18
|
+
const actor = getActorInfo(req);
|
|
19
|
+
const createInput = {
|
|
20
|
+
...req.body,
|
|
21
|
+
createdByAgentId: actor.agentId,
|
|
22
|
+
createdByUserId: actor.actorType === "user" ? actor.actorId : null,
|
|
23
|
+
};
|
|
24
|
+
const hasExplicitAssignee = Object.prototype.hasOwnProperty.call(req.body, "assigneeAgentId") ||
|
|
25
|
+
Object.prototype.hasOwnProperty.call(req.body, "assigneeUserId");
|
|
26
|
+
if (actor.actorType === "agent" && actor.agentId && !hasExplicitAssignee) {
|
|
27
|
+
createInput.assigneeAgentId = actor.agentId;
|
|
28
|
+
}
|
|
29
|
+
const issue = await svc.create(orgId, {
|
|
30
|
+
...createInput,
|
|
31
|
+
});
|
|
32
|
+
await logActivity(db, {
|
|
33
|
+
orgId,
|
|
34
|
+
actorType: actor.actorType,
|
|
35
|
+
actorId: actor.actorId,
|
|
36
|
+
agentId: actor.agentId,
|
|
37
|
+
runId: actor.runId,
|
|
38
|
+
action: "issue.created",
|
|
39
|
+
entityType: "issue",
|
|
40
|
+
entityId: issue.id,
|
|
41
|
+
details: { title: issue.title, identifier: issue.identifier },
|
|
42
|
+
});
|
|
43
|
+
void queueIssueAssignmentWakeup({
|
|
44
|
+
heartbeat,
|
|
45
|
+
issue,
|
|
46
|
+
reason: "issue_assigned",
|
|
47
|
+
mutation: "create",
|
|
48
|
+
contextSource: "issue.create",
|
|
49
|
+
requestedByActorType: actor.actorType,
|
|
50
|
+
requestedByActorId: actor.actorId,
|
|
51
|
+
});
|
|
52
|
+
void queueIssueReviewWakeup({
|
|
53
|
+
heartbeat,
|
|
54
|
+
issue,
|
|
55
|
+
mutation: "create_in_review",
|
|
56
|
+
contextSource: "issue.create",
|
|
57
|
+
requestedByActorType: actor.actorType,
|
|
58
|
+
requestedByActorId: actor.actorId,
|
|
59
|
+
actorAgentId: actor.agentId,
|
|
60
|
+
});
|
|
61
|
+
res.status(201).json(issue);
|
|
62
|
+
});
|
|
63
|
+
router.patch("/issues/:id", validate(updateIssueSchema), async (req, res) => {
|
|
64
|
+
const id = req.params.id;
|
|
65
|
+
const existing = await svc.getById(id);
|
|
66
|
+
if (!existing) {
|
|
67
|
+
res.status(404).json({ error: "Issue not found" });
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
assertCompanyAccess(req, existing.orgId);
|
|
71
|
+
const assigneeWillChange = (req.body.assigneeAgentId !== undefined && req.body.assigneeAgentId !== existing.assigneeAgentId) ||
|
|
72
|
+
(req.body.assigneeUserId !== undefined && req.body.assigneeUserId !== existing.assigneeUserId);
|
|
73
|
+
const reviewerWillChange = (req.body.reviewerAgentId !== undefined && req.body.reviewerAgentId !== existing.reviewerAgentId) ||
|
|
74
|
+
(req.body.reviewerUserId !== undefined && req.body.reviewerUserId !== existing.reviewerUserId);
|
|
75
|
+
const isAgentReturningIssueToCreator = req.actor.type === "agent" &&
|
|
76
|
+
!!req.actor.agentId &&
|
|
77
|
+
existing.assigneeAgentId === req.actor.agentId &&
|
|
78
|
+
req.body.assigneeAgentId === null &&
|
|
79
|
+
typeof req.body.assigneeUserId === "string" &&
|
|
80
|
+
!!existing.createdByUserId &&
|
|
81
|
+
req.body.assigneeUserId === existing.createdByUserId;
|
|
82
|
+
if (assigneeWillChange) {
|
|
83
|
+
if (!isAgentReturningIssueToCreator) {
|
|
84
|
+
await assertCanAssignTasks(req, existing.orgId);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (reviewerWillChange) {
|
|
88
|
+
await assertCanAssignTasks(req, existing.orgId);
|
|
89
|
+
}
|
|
90
|
+
if (!(await assertAgentRunCheckoutOwnership(req, res, existing)))
|
|
91
|
+
return;
|
|
92
|
+
const actor = getActorInfo(req);
|
|
93
|
+
const isClosed = existing.status === "done" || existing.status === "cancelled";
|
|
94
|
+
const { comment: commentBody, reopen: reopenRequested, hiddenAt: hiddenAtRaw, reviewDecision, ...updateFields } = req.body;
|
|
95
|
+
if (hiddenAtRaw !== undefined) {
|
|
96
|
+
updateFields.hiddenAt = hiddenAtRaw ? new Date(hiddenAtRaw) : null;
|
|
97
|
+
}
|
|
98
|
+
if (commentBody && reopenRequested === true && isClosed && updateFields.status === undefined) {
|
|
99
|
+
updateFields.status = "todo";
|
|
100
|
+
}
|
|
101
|
+
if (reviewDecision !== undefined) {
|
|
102
|
+
if (!commentBody) {
|
|
103
|
+
throw unprocessable("Reviewer decisions require a comment");
|
|
104
|
+
}
|
|
105
|
+
if (!statusAcceptsReviewerDecision(existing.status)) {
|
|
106
|
+
throw unprocessable("Reviewer decisions can only be recorded while the issue is in_review or blocked");
|
|
107
|
+
}
|
|
108
|
+
if (actor.actorType === "agent" && !isReviewerAgentForIssue(actor, existing)) {
|
|
109
|
+
throw forbidden("Only the reviewer agent can record a reviewer decision");
|
|
110
|
+
}
|
|
111
|
+
const decisionStatus = statusForReviewDecision(reviewDecision);
|
|
112
|
+
if (decisionStatus) {
|
|
113
|
+
updateFields.status = decisionStatus;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
delete updateFields.status;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
let reviewedCompletionNormalized = false;
|
|
120
|
+
if (updateFields.status === "done" &&
|
|
121
|
+
!canAgentCompleteIssue(actor, existing)) {
|
|
122
|
+
res.status(403).json({ error: "Only the checked-out assignee or reviewer can complete issue" });
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (updateFields.status === "done" &&
|
|
126
|
+
issueHasReviewer(existing) &&
|
|
127
|
+
actor.actorType === "agent" &&
|
|
128
|
+
!(statusAcceptsReviewerDecision(existing.status) && isReviewerAgentForIssue(actor, existing))) {
|
|
129
|
+
updateFields.status = "in_review";
|
|
130
|
+
reviewedCompletionNormalized = true;
|
|
131
|
+
}
|
|
132
|
+
let issue;
|
|
133
|
+
try {
|
|
134
|
+
issue = await svc.update(id, updateFields);
|
|
135
|
+
}
|
|
136
|
+
catch (err) {
|
|
137
|
+
if (err instanceof HttpError && err.status === 422) {
|
|
138
|
+
logger.warn({
|
|
139
|
+
issueId: id,
|
|
140
|
+
orgId: existing.orgId,
|
|
141
|
+
assigneePatch: {
|
|
142
|
+
assigneeAgentId: req.body.assigneeAgentId === undefined ? "__omitted__" : req.body.assigneeAgentId,
|
|
143
|
+
assigneeUserId: req.body.assigneeUserId === undefined ? "__omitted__" : req.body.assigneeUserId,
|
|
144
|
+
reviewerAgentId: req.body.reviewerAgentId === undefined ? "__omitted__" : req.body.reviewerAgentId,
|
|
145
|
+
reviewerUserId: req.body.reviewerUserId === undefined ? "__omitted__" : req.body.reviewerUserId,
|
|
146
|
+
},
|
|
147
|
+
currentAssignee: {
|
|
148
|
+
assigneeAgentId: existing.assigneeAgentId,
|
|
149
|
+
assigneeUserId: existing.assigneeUserId,
|
|
150
|
+
reviewerAgentId: existing.reviewerAgentId,
|
|
151
|
+
reviewerUserId: existing.reviewerUserId,
|
|
152
|
+
},
|
|
153
|
+
error: err.message,
|
|
154
|
+
details: err.details,
|
|
155
|
+
}, "issue update rejected with 422");
|
|
156
|
+
}
|
|
157
|
+
throw err;
|
|
158
|
+
}
|
|
159
|
+
if (!issue) {
|
|
160
|
+
res.status(404).json({ error: "Issue not found" });
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
await automationsSvc.syncRunStatusForIssue(issue.id);
|
|
164
|
+
if (actor.runId) {
|
|
165
|
+
await heartbeat.reportRunActivity(actor.runId).catch((err) => logger.warn({ err, runId: actor.runId }, "failed to clear detached run warning after issue activity"));
|
|
166
|
+
}
|
|
167
|
+
// Build activity details with previous values for changed fields
|
|
168
|
+
const previous = {};
|
|
169
|
+
for (const key of Object.keys(updateFields)) {
|
|
170
|
+
if (key in existing && existing[key] !== updateFields[key]) {
|
|
171
|
+
previous[key] = existing[key];
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
const hasFieldChanges = Object.keys(previous).length > 0;
|
|
175
|
+
const reopened = commentBody &&
|
|
176
|
+
reopenRequested === true &&
|
|
177
|
+
isClosed &&
|
|
178
|
+
previous.status !== undefined &&
|
|
179
|
+
issue.status === "todo";
|
|
180
|
+
const reopenFromStatus = reopened ? existing.status : null;
|
|
181
|
+
await logActivity(db, {
|
|
182
|
+
orgId: issue.orgId,
|
|
183
|
+
actorType: actor.actorType,
|
|
184
|
+
actorId: actor.actorId,
|
|
185
|
+
agentId: actor.agentId,
|
|
186
|
+
runId: actor.runId,
|
|
187
|
+
action: "issue.updated",
|
|
188
|
+
entityType: "issue",
|
|
189
|
+
entityId: issue.id,
|
|
190
|
+
details: {
|
|
191
|
+
...updateFields,
|
|
192
|
+
identifier: issue.identifier,
|
|
193
|
+
...(commentBody ? { source: "comment" } : {}),
|
|
194
|
+
...(reopened ? { reopened: true, reopenedFrom: reopenFromStatus } : {}),
|
|
195
|
+
...(reviewedCompletionNormalized
|
|
196
|
+
? {
|
|
197
|
+
normalizedFromStatus: "done",
|
|
198
|
+
normalizedReason: "reviewed_issue_assignee_completion",
|
|
199
|
+
}
|
|
200
|
+
: {}),
|
|
201
|
+
_previous: hasFieldChanges ? previous : undefined,
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
let comment = null;
|
|
205
|
+
if (commentBody) {
|
|
206
|
+
comment = await svc.addComment(id, commentBody, {
|
|
207
|
+
agentId: actor.agentId ?? undefined,
|
|
208
|
+
userId: actor.actorType === "user" ? actor.actorId : undefined,
|
|
209
|
+
});
|
|
210
|
+
await logActivity(db, {
|
|
211
|
+
orgId: issue.orgId,
|
|
212
|
+
actorType: actor.actorType,
|
|
213
|
+
actorId: actor.actorId,
|
|
214
|
+
agentId: actor.agentId,
|
|
215
|
+
runId: actor.runId,
|
|
216
|
+
action: "issue.comment_added",
|
|
217
|
+
entityType: "issue",
|
|
218
|
+
entityId: issue.id,
|
|
219
|
+
details: {
|
|
220
|
+
commentId: comment.id,
|
|
221
|
+
bodySnippet: comment.body.slice(0, 120),
|
|
222
|
+
identifier: issue.identifier,
|
|
223
|
+
issueTitle: issue.title,
|
|
224
|
+
...(reopened ? { reopened: true, reopenedFrom: reopenFromStatus, source: "comment" } : {}),
|
|
225
|
+
...(hasFieldChanges ? { updated: true } : {}),
|
|
226
|
+
},
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
if (reviewDecision !== undefined) {
|
|
230
|
+
const reviewOutcome = reviewDecision === "blocked" ? "human_handoff" : "review_closed";
|
|
231
|
+
await logActivity(db, {
|
|
232
|
+
orgId: issue.orgId,
|
|
233
|
+
actorType: actor.actorType,
|
|
234
|
+
actorId: actor.actorId,
|
|
235
|
+
agentId: actor.agentId,
|
|
236
|
+
runId: actor.runId,
|
|
237
|
+
action: "issue.review_decision_recorded",
|
|
238
|
+
entityType: "issue",
|
|
239
|
+
entityId: issue.id,
|
|
240
|
+
details: {
|
|
241
|
+
decision: reviewDecision,
|
|
242
|
+
outcome: reviewOutcome,
|
|
243
|
+
operatorActionRequired: reviewOutcome === "human_handoff",
|
|
244
|
+
status: issue.status,
|
|
245
|
+
identifier: issue.identifier,
|
|
246
|
+
commentId: comment?.id ?? null,
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
if (reviewerDecisionRequiresHumanHandoff(reviewDecision)) {
|
|
250
|
+
await logActivity(db, {
|
|
251
|
+
orgId: issue.orgId,
|
|
252
|
+
actorType: actor.actorType,
|
|
253
|
+
actorId: actor.actorId,
|
|
254
|
+
agentId: actor.agentId,
|
|
255
|
+
runId: actor.runId,
|
|
256
|
+
action: "issue.human_intervention_required",
|
|
257
|
+
entityType: "issue",
|
|
258
|
+
entityId: issue.id,
|
|
259
|
+
details: {
|
|
260
|
+
decision: reviewDecision,
|
|
261
|
+
status: issue.status,
|
|
262
|
+
identifier: issue.identifier,
|
|
263
|
+
issueTitle: issue.title,
|
|
264
|
+
commentId: comment?.id ?? null,
|
|
265
|
+
previousReviewerAgentId: existing.reviewerAgentId,
|
|
266
|
+
previousReviewerUserId: existing.reviewerUserId,
|
|
267
|
+
nextAction: "Human/operator intervention is required before agent review can continue.",
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
const assigneeChanged = assigneeWillChange;
|
|
273
|
+
const reviewerChanged = reviewerWillChange;
|
|
274
|
+
const statusChangedFromBacklog = existing.status === "backlog" &&
|
|
275
|
+
issue.status !== "backlog" &&
|
|
276
|
+
updateFields.status !== undefined;
|
|
277
|
+
const statusChangedToInReview = existing.status !== "in_review" &&
|
|
278
|
+
issue.status === "in_review" &&
|
|
279
|
+
updateFields.status !== undefined;
|
|
280
|
+
const statusChangedToBlocked = existing.status !== "blocked" &&
|
|
281
|
+
issue.status === "blocked" &&
|
|
282
|
+
updateFields.status !== undefined;
|
|
283
|
+
const statusReturnedFromReviewToAssignee = statusAcceptsReviewerDecision(existing.status) &&
|
|
284
|
+
(issue.status === "in_progress" || issue.status === "todo") &&
|
|
285
|
+
updateFields.status !== undefined;
|
|
286
|
+
const reviewerChangedInReviewableStatus = reviewerChanged &&
|
|
287
|
+
statusAcceptsReviewerDecision(existing.status) &&
|
|
288
|
+
statusAcceptsReviewerDecision(issue.status);
|
|
289
|
+
// Merge all wakeups from this update into one enqueue per agent to avoid duplicate runs.
|
|
290
|
+
void (async () => {
|
|
291
|
+
const wakeups = new Map();
|
|
292
|
+
if (assigneeChanged && issue.assigneeAgentId && issue.status !== "backlog") {
|
|
293
|
+
wakeups.set(issue.assigneeAgentId, {
|
|
294
|
+
source: "assignment",
|
|
295
|
+
triggerDetail: "system",
|
|
296
|
+
reason: "issue_assigned",
|
|
297
|
+
payload: { issueId: issue.id, mutation: "update" },
|
|
298
|
+
requestedByActorType: actor.actorType,
|
|
299
|
+
requestedByActorId: actor.actorId,
|
|
300
|
+
contextSnapshot: {
|
|
301
|
+
issueId: issue.id,
|
|
302
|
+
source: "issue.update",
|
|
303
|
+
wakeSource: "assignment",
|
|
304
|
+
wakeReason: "issue_assigned",
|
|
305
|
+
issue: {
|
|
306
|
+
id: issue.id,
|
|
307
|
+
title: issue.title,
|
|
308
|
+
description: issue.description,
|
|
309
|
+
status: issue.status,
|
|
310
|
+
priority: issue.priority,
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
if (!assigneeChanged && statusChangedFromBacklog && issue.assigneeAgentId) {
|
|
316
|
+
wakeups.set(issue.assigneeAgentId, {
|
|
317
|
+
source: "automation",
|
|
318
|
+
triggerDetail: "system",
|
|
319
|
+
reason: "issue_status_changed",
|
|
320
|
+
payload: { issueId: issue.id, mutation: "update" },
|
|
321
|
+
requestedByActorType: actor.actorType,
|
|
322
|
+
requestedByActorId: actor.actorId,
|
|
323
|
+
contextSnapshot: {
|
|
324
|
+
issueId: issue.id,
|
|
325
|
+
source: "issue.status_change",
|
|
326
|
+
wakeSource: "automation",
|
|
327
|
+
wakeReason: "issue_status_changed",
|
|
328
|
+
issue: {
|
|
329
|
+
id: issue.id,
|
|
330
|
+
title: issue.title,
|
|
331
|
+
description: issue.description,
|
|
332
|
+
status: issue.status,
|
|
333
|
+
priority: issue.priority,
|
|
334
|
+
},
|
|
335
|
+
},
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
if (!assigneeChanged && statusReturnedFromReviewToAssignee && issue.assigneeAgentId) {
|
|
339
|
+
const commentContext = comment
|
|
340
|
+
? {
|
|
341
|
+
commentId: comment.id,
|
|
342
|
+
wakeCommentId: comment.id,
|
|
343
|
+
comment: {
|
|
344
|
+
id: comment.id,
|
|
345
|
+
body: comment.body,
|
|
346
|
+
authorAgentId: comment.authorAgentId,
|
|
347
|
+
authorUserId: comment.authorUserId,
|
|
348
|
+
},
|
|
349
|
+
}
|
|
350
|
+
: {};
|
|
351
|
+
wakeups.set(issue.assigneeAgentId, {
|
|
352
|
+
source: "assignment",
|
|
353
|
+
triggerDetail: "system",
|
|
354
|
+
reason: "issue_changes_requested",
|
|
355
|
+
payload: {
|
|
356
|
+
issueId: issue.id,
|
|
357
|
+
mutation: "review_changes_requested",
|
|
358
|
+
...(comment ? { commentId: comment.id } : {}),
|
|
359
|
+
},
|
|
360
|
+
requestedByActorType: actor.actorType,
|
|
361
|
+
requestedByActorId: actor.actorId,
|
|
362
|
+
contextSnapshot: {
|
|
363
|
+
issueId: issue.id,
|
|
364
|
+
taskId: issue.id,
|
|
365
|
+
source: "issue.review_changes_requested",
|
|
366
|
+
wakeSource: "assignment",
|
|
367
|
+
wakeReason: "issue_changes_requested",
|
|
368
|
+
issue: {
|
|
369
|
+
id: issue.id,
|
|
370
|
+
title: issue.title,
|
|
371
|
+
description: issue.description,
|
|
372
|
+
status: issue.status,
|
|
373
|
+
priority: issue.priority,
|
|
374
|
+
},
|
|
375
|
+
...commentContext,
|
|
376
|
+
},
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
if ((statusChangedToInReview || statusChangedToBlocked || reviewerChangedInReviewableStatus) && issue.reviewerAgentId) {
|
|
380
|
+
const mutation = statusChangedToInReview
|
|
381
|
+
? "status_to_in_review"
|
|
382
|
+
: statusChangedToBlocked
|
|
383
|
+
? "status_to_blocked"
|
|
384
|
+
: issue.status === "blocked"
|
|
385
|
+
? "reviewer_changed_blocked"
|
|
386
|
+
: "reviewer_changed_in_review";
|
|
387
|
+
const actorIsReviewerAgent = actor.actorType === "agent" && actor.actorId === issue.reviewerAgentId;
|
|
388
|
+
const actorIsAssigneeAgent = actor.actorType === "agent" && actor.actorId === issue.assigneeAgentId;
|
|
389
|
+
const assigneeHandoffToReview = (statusChangedToInReview || statusChangedToBlocked) && actorIsAssigneeAgent;
|
|
390
|
+
if (!actorIsReviewerAgent || assigneeHandoffToReview) {
|
|
391
|
+
wakeups.set(issue.reviewerAgentId, buildIssueReviewWakeupOptions({
|
|
392
|
+
issue,
|
|
393
|
+
mutation,
|
|
394
|
+
contextSource: statusChangedToInReview || statusChangedToBlocked ? "issue.status_change" : "issue.reviewer_change",
|
|
395
|
+
requestedByActorType: actor.actorType,
|
|
396
|
+
requestedByActorId: actor.actorId,
|
|
397
|
+
}));
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
if (commentBody && comment) {
|
|
401
|
+
let mentionedIds = [];
|
|
402
|
+
try {
|
|
403
|
+
mentionedIds = await svc.findMentionedAgents(issue.orgId, commentBody);
|
|
404
|
+
}
|
|
405
|
+
catch (err) {
|
|
406
|
+
logger.warn({ err, issueId: id }, "failed to resolve @-mentions");
|
|
407
|
+
}
|
|
408
|
+
for (const mentionedId of mentionedIds) {
|
|
409
|
+
if (wakeups.has(mentionedId))
|
|
410
|
+
continue;
|
|
411
|
+
if (actor.actorType === "agent" && actor.actorId === mentionedId)
|
|
412
|
+
continue;
|
|
413
|
+
wakeups.set(mentionedId, {
|
|
414
|
+
source: "automation",
|
|
415
|
+
triggerDetail: "system",
|
|
416
|
+
reason: "issue_comment_mentioned",
|
|
417
|
+
payload: { issueId: id, commentId: comment.id },
|
|
418
|
+
requestedByActorType: actor.actorType,
|
|
419
|
+
requestedByActorId: actor.actorId,
|
|
420
|
+
contextSnapshot: {
|
|
421
|
+
issueId: id,
|
|
422
|
+
taskId: id,
|
|
423
|
+
commentId: comment.id,
|
|
424
|
+
wakeCommentId: comment.id,
|
|
425
|
+
wakeReason: "issue_comment_mentioned",
|
|
426
|
+
wakeSource: "comment.mention",
|
|
427
|
+
source: "comment.mention",
|
|
428
|
+
issue: {
|
|
429
|
+
id: issue.id,
|
|
430
|
+
title: issue.title,
|
|
431
|
+
description: issue.description,
|
|
432
|
+
status: issue.status,
|
|
433
|
+
priority: issue.priority,
|
|
434
|
+
},
|
|
435
|
+
comment: {
|
|
436
|
+
id: comment.id,
|
|
437
|
+
body: comment.body,
|
|
438
|
+
authorAgentId: comment.authorAgentId,
|
|
439
|
+
authorUserId: comment.authorUserId,
|
|
440
|
+
},
|
|
441
|
+
},
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
for (const [agentId, wakeup] of wakeups.entries()) {
|
|
446
|
+
heartbeat
|
|
447
|
+
.wakeup(agentId, wakeup)
|
|
448
|
+
.catch((err) => logger.warn({ err, issueId: issue.id, agentId }, "failed to wake agent on issue update"));
|
|
449
|
+
}
|
|
450
|
+
})();
|
|
451
|
+
res.json({ ...issue, comment });
|
|
452
|
+
});
|
|
453
|
+
router.delete("/issues/:id", async (req, res) => {
|
|
454
|
+
const id = req.params.id;
|
|
455
|
+
const existing = await svc.getById(id);
|
|
456
|
+
if (!existing) {
|
|
457
|
+
res.status(404).json({ error: "Issue not found" });
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
assertCompanyAccess(req, existing.orgId);
|
|
461
|
+
const attachments = await svc.listAttachments(id);
|
|
462
|
+
const issue = await svc.remove(id);
|
|
463
|
+
if (!issue) {
|
|
464
|
+
res.status(404).json({ error: "Issue not found" });
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
for (const attachment of attachments) {
|
|
468
|
+
try {
|
|
469
|
+
await storage.deleteObject(attachment.orgId, attachment.objectKey);
|
|
470
|
+
}
|
|
471
|
+
catch (err) {
|
|
472
|
+
logger.warn({ err, issueId: id, attachmentId: attachment.id }, "failed to delete attachment object during issue delete");
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
const actor = getActorInfo(req);
|
|
476
|
+
await logActivity(db, {
|
|
477
|
+
orgId: issue.orgId,
|
|
478
|
+
actorType: actor.actorType,
|
|
479
|
+
actorId: actor.actorId,
|
|
480
|
+
agentId: actor.agentId,
|
|
481
|
+
runId: actor.runId,
|
|
482
|
+
action: "issue.deleted",
|
|
483
|
+
entityType: "issue",
|
|
484
|
+
entityId: issue.id,
|
|
485
|
+
});
|
|
486
|
+
res.json(issue);
|
|
487
|
+
});
|
|
488
|
+
router.post("/issues/:id/checkout", validate(checkoutIssueSchema), async (req, res) => {
|
|
489
|
+
const id = req.params.id;
|
|
490
|
+
const issue = await svc.getById(id);
|
|
491
|
+
if (!issue) {
|
|
492
|
+
res.status(404).json({ error: "Issue not found" });
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
assertCompanyAccess(req, issue.orgId);
|
|
496
|
+
if (issue.projectId) {
|
|
497
|
+
const project = await projectsSvc.getById(issue.projectId);
|
|
498
|
+
if (project?.pausedAt) {
|
|
499
|
+
res.status(409).json({
|
|
500
|
+
error: project.pauseReason === "budget"
|
|
501
|
+
? "Project is paused because its budget hard-stop was reached"
|
|
502
|
+
: "Project is paused",
|
|
503
|
+
});
|
|
504
|
+
return;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
if (req.actor.type === "agent" && req.actor.agentId !== req.body.agentId) {
|
|
508
|
+
res.status(403).json({ error: "Agent can only checkout as itself" });
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
const checkoutRunId = requireAgentRunId(req, res);
|
|
512
|
+
if (req.actor.type === "agent" && !checkoutRunId)
|
|
513
|
+
return;
|
|
514
|
+
const updated = await svc.checkout(id, req.body.agentId, req.body.expectedStatuses, checkoutRunId);
|
|
515
|
+
const actor = getActorInfo(req);
|
|
516
|
+
await logActivity(db, {
|
|
517
|
+
orgId: issue.orgId,
|
|
518
|
+
actorType: actor.actorType,
|
|
519
|
+
actorId: actor.actorId,
|
|
520
|
+
agentId: actor.agentId,
|
|
521
|
+
runId: actor.runId,
|
|
522
|
+
action: "issue.checked_out",
|
|
523
|
+
entityType: "issue",
|
|
524
|
+
entityId: issue.id,
|
|
525
|
+
details: { agentId: req.body.agentId },
|
|
526
|
+
});
|
|
527
|
+
if (shouldWakeAssigneeOnCheckout({
|
|
528
|
+
actorType: req.actor.type,
|
|
529
|
+
actorAgentId: req.actor.type === "agent" ? req.actor.agentId ?? null : null,
|
|
530
|
+
checkoutAgentId: req.body.agentId,
|
|
531
|
+
checkoutRunId,
|
|
532
|
+
})) {
|
|
533
|
+
void heartbeat
|
|
534
|
+
.wakeup(req.body.agentId, {
|
|
535
|
+
source: "assignment",
|
|
536
|
+
triggerDetail: "system",
|
|
537
|
+
reason: "issue_checked_out",
|
|
538
|
+
payload: { issueId: issue.id, mutation: "checkout" },
|
|
539
|
+
requestedByActorType: actor.actorType,
|
|
540
|
+
requestedByActorId: actor.actorId,
|
|
541
|
+
contextSnapshot: { issueId: issue.id, source: "issue.checkout" },
|
|
542
|
+
})
|
|
543
|
+
.catch((err) => logger.warn({ err, issueId: issue.id }, "failed to wake assignee on issue checkout"));
|
|
544
|
+
}
|
|
545
|
+
res.json(updated);
|
|
546
|
+
});
|
|
547
|
+
router.post("/issues/:id/release", async (req, res) => {
|
|
548
|
+
const id = req.params.id;
|
|
549
|
+
const existing = await svc.getById(id);
|
|
550
|
+
if (!existing) {
|
|
551
|
+
res.status(404).json({ error: "Issue not found" });
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
assertCompanyAccess(req, existing.orgId);
|
|
555
|
+
if (!(await assertAgentRunCheckoutOwnership(req, res, existing)))
|
|
556
|
+
return;
|
|
557
|
+
const actorRunId = requireAgentRunId(req, res);
|
|
558
|
+
if (req.actor.type === "agent" && !actorRunId)
|
|
559
|
+
return;
|
|
560
|
+
const released = await svc.release(id, req.actor.type === "agent" ? req.actor.agentId : undefined, actorRunId);
|
|
561
|
+
if (!released) {
|
|
562
|
+
res.status(404).json({ error: "Issue not found" });
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
const actor = getActorInfo(req);
|
|
566
|
+
await logActivity(db, {
|
|
567
|
+
orgId: released.orgId,
|
|
568
|
+
actorType: actor.actorType,
|
|
569
|
+
actorId: actor.actorId,
|
|
570
|
+
agentId: actor.agentId,
|
|
571
|
+
runId: actor.runId,
|
|
572
|
+
action: "issue.released",
|
|
573
|
+
entityType: "issue",
|
|
574
|
+
entityId: released.id,
|
|
575
|
+
});
|
|
576
|
+
res.json(released);
|
|
577
|
+
});
|
|
578
|
+
router.post("/issues/:id/commit", validate(reportIssueCommitSchema), async (req, res) => {
|
|
579
|
+
const id = req.params.id;
|
|
580
|
+
const issue = await svc.getById(id);
|
|
581
|
+
if (!issue) {
|
|
582
|
+
res.status(404).json({ error: "Issue not found" });
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
assertCompanyAccess(req, issue.orgId);
|
|
586
|
+
if (req.actor.type !== "agent") {
|
|
587
|
+
res.status(403).json({ error: "Agent authentication required" });
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
if (!(await assertAgentRunCheckoutOwnership(req, res, issue)))
|
|
591
|
+
return;
|
|
592
|
+
const actor = getActorInfo(req);
|
|
593
|
+
const commitRun = await resolveAgentIssueRunId(req, res, issue);
|
|
594
|
+
if (!commitRun.ok)
|
|
595
|
+
return;
|
|
596
|
+
const sha = req.body.sha.trim().toLowerCase();
|
|
597
|
+
const subject = commitSubject(req.body.message);
|
|
598
|
+
const shortSha = sha.slice(0, 7);
|
|
599
|
+
if (commitRun.runId) {
|
|
600
|
+
await heartbeat.reportRunActivity(commitRun.runId).catch((err) => logger.warn({ err, runId: commitRun.runId }, "failed to clear detached run warning after issue commit activity"));
|
|
601
|
+
}
|
|
602
|
+
await logActivity(db, {
|
|
603
|
+
orgId: issue.orgId,
|
|
604
|
+
actorType: actor.actorType,
|
|
605
|
+
actorId: actor.actorId,
|
|
606
|
+
agentId: actor.agentId,
|
|
607
|
+
runId: commitRun.runId,
|
|
608
|
+
action: "issue.code_committed",
|
|
609
|
+
entityType: "issue",
|
|
610
|
+
entityId: issue.id,
|
|
611
|
+
details: {
|
|
612
|
+
sha,
|
|
613
|
+
shortSha,
|
|
614
|
+
message: req.body.message,
|
|
615
|
+
subject,
|
|
616
|
+
identifier: issue.identifier,
|
|
617
|
+
issueTitle: issue.title,
|
|
618
|
+
branch: req.body.branch ?? null,
|
|
619
|
+
repoPath: req.body.repoPath ?? null,
|
|
620
|
+
workspacePath: req.body.workspacePath ?? null,
|
|
621
|
+
commitCount: req.body.commitCount ?? 1,
|
|
622
|
+
},
|
|
623
|
+
});
|
|
624
|
+
res.status(201).json({
|
|
625
|
+
ok: true,
|
|
626
|
+
issueId: issue.id,
|
|
627
|
+
sha,
|
|
628
|
+
shortSha,
|
|
629
|
+
message: req.body.message,
|
|
630
|
+
subject,
|
|
631
|
+
runId: commitRun.runId,
|
|
632
|
+
});
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
//# sourceMappingURL=issues.mutations.js.map
|