@rudderhq/server 0.2.5-canary.9 → 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-B5mJzzqZ.js → _basePickBy-N8I9ml5Y.js} +1 -1
- package/ui-dist/assets/{_baseUniq-B10Ec09o.js → _baseUniq-BuSlpRSQ.js} +1 -1
- package/ui-dist/assets/{arc-Bw7wimOa.js → arc-qX-dPyA1.js} +1 -1
- package/ui-dist/assets/{architectureDiagram-2XIMDMQ5-DZr0XEvv.js → architectureDiagram-2XIMDMQ5-DhjkbXsp.js} +1 -1
- package/ui-dist/assets/{blockDiagram-WCTKOSBZ-D0jl0LgB.js → blockDiagram-WCTKOSBZ-JS-tTu3J.js} +1 -1
- package/ui-dist/assets/{c4Diagram-IC4MRINW-BEFxBnEm.js → c4Diagram-IC4MRINW-4DqwCWIx.js} +1 -1
- package/ui-dist/assets/channel-CccCW5_a.js +1 -0
- package/ui-dist/assets/{chunk-4BX2VUAB-Cbul1GoA.js → chunk-4BX2VUAB-T37SqBpp.js} +1 -1
- package/ui-dist/assets/{chunk-55IACEB6-DuouC3bT.js → chunk-55IACEB6-BSj9hdqK.js} +1 -1
- package/ui-dist/assets/{chunk-FMBD7UC4-bN1jF9xw.js → chunk-FMBD7UC4-Dkrlh0Wk.js} +1 -1
- package/ui-dist/assets/{chunk-JSJVCQXG-B0-Ij6ZF.js → chunk-JSJVCQXG-C0ZE3QdB.js} +1 -1
- package/ui-dist/assets/{chunk-KX2RTZJC-BjI3IEjI.js → chunk-KX2RTZJC-DOZQM9gW.js} +1 -1
- package/ui-dist/assets/{chunk-NQ4KR5QH-MUoGr46n.js → chunk-NQ4KR5QH-5Yr3U2k8.js} +1 -1
- package/ui-dist/assets/{chunk-QZHKN3VN-CQoI9Ouy.js → chunk-QZHKN3VN-CvKTufwF.js} +1 -1
- package/ui-dist/assets/{chunk-WL4C6EOR-DSJh3iDp.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-BPepglgB.js → cose-bilkent-S5V4N54A-CTvr1OFj.js} +1 -1
- package/ui-dist/assets/{dagre-KLK3FWXG-DhnHVZkt.js → dagre-KLK3FWXG-UZ-SNjVK.js} +1 -1
- package/ui-dist/assets/{diagram-E7M64L7V-DNvXtoOO.js → diagram-E7M64L7V-D7RAN0Hr.js} +1 -1
- package/ui-dist/assets/{diagram-IFDJBPK2-DhGlDTgn.js → diagram-IFDJBPK2-B4LViaFR.js} +1 -1
- package/ui-dist/assets/{diagram-P4PSJMXO-BmXEloWS.js → diagram-P4PSJMXO-CY1be7ak.js} +1 -1
- package/ui-dist/assets/{erDiagram-INFDFZHY-BTYVzaLM.js → erDiagram-INFDFZHY-Dca0KkvJ.js} +1 -1
- package/ui-dist/assets/{flowDiagram-PKNHOUZH-CqMNQUVv.js → flowDiagram-PKNHOUZH-i-qMvfwg.js} +1 -1
- package/ui-dist/assets/{ganttDiagram-A5KZAMGK-B2le_64a.js → ganttDiagram-A5KZAMGK-Wxq2lhbh.js} +1 -1
- package/ui-dist/assets/{gitGraphDiagram-K3NZZRJ6-BtxOBq5A.js → gitGraphDiagram-K3NZZRJ6-DwzgPlAY.js} +1 -1
- package/ui-dist/assets/{graph-C5E6qFfm.js → graph-BAqf89Tz.js} +1 -1
- package/ui-dist/assets/{index-Piq-IPXt.js → index-4eCzaLuY.js} +1 -1
- package/ui-dist/assets/{index-DT6UN2ec.js → index-8uu-nKqK.js} +1 -1
- package/ui-dist/assets/{index-T5NVZ3nR.js → index-B-1NEcI_.js} +1 -1
- package/ui-dist/assets/{index-D-MoarxG.js → index-B0b_3Eu5.js} +1 -1
- package/ui-dist/assets/{index-CZiP3FBQ.js → index-B8v0eZjP.js} +1 -1
- package/ui-dist/assets/{index-C1Ga66FM.js → index-BN7Moj3u.js} +1 -1
- package/ui-dist/assets/{index-xBUfBdQn.js → index-BSpxh3cY.js} +1 -1
- package/ui-dist/assets/{index-CQcMWp51.js → index-BY44RIi9.js} +1 -1
- package/ui-dist/assets/{index-3a93sZNI.js → index-BhyQJhdZ.js} +1 -1
- package/ui-dist/assets/{index-BsVDit5y.js → index-BkPL_iGU.js} +1 -1
- package/ui-dist/assets/{index-88lBSTsW.js → index-BsPfoHXS.js} +1 -1
- package/ui-dist/assets/{index-CyJtcUF0.js → index-BstW7nmv.js} +1 -1
- package/ui-dist/assets/{index-BvZ0Ptfl.js → index-BwB67Zyz.js} +1 -1
- package/ui-dist/assets/index-C2peSkmT.css +1 -0
- package/ui-dist/assets/{index-vkCrQLeX.js → index-C3ktOsS_.js} +1 -1
- package/ui-dist/assets/{index-D2hZpQJT.js → index-CMyABlS-.js} +1 -1
- package/ui-dist/assets/{index-C4WCPEY4.js → index-CyBJ8ujC.js} +1 -1
- package/ui-dist/assets/{index-Bf7NB_lK.js → index-DAxM2W3O.js} +1 -1
- package/ui-dist/assets/{index-Dq7H6-Lm.js → index-DVZXPmhk.js} +1 -1
- package/ui-dist/assets/{index-CskDu6A3.js → index-Dc19uAyw.js} +1 -1
- package/ui-dist/assets/index-DzHrwZu1.js +1511 -0
- package/ui-dist/assets/{index-B20JneLK.js → index-LJuf53Ye.js} +1 -1
- package/ui-dist/assets/{index-D6McTDMQ.js → index-Ugw5VWWz.js} +1 -1
- package/ui-dist/assets/{index-CcVGS6HJ.js → index-YGraEFR7.js} +1 -1
- package/ui-dist/assets/{infoDiagram-LFFYTUFH-BiCCZcIW.js → infoDiagram-LFFYTUFH-jLmDtFVR.js} +1 -1
- package/ui-dist/assets/{ishikawaDiagram-PHBUUO56-BiwBemM5.js → ishikawaDiagram-PHBUUO56-6OGMyLT8.js} +1 -1
- package/ui-dist/assets/{journeyDiagram-4ABVD52K-D8RGr2xl.js → journeyDiagram-4ABVD52K-yQjl6E0t.js} +1 -1
- package/ui-dist/assets/{kanban-definition-K7BYSVSG-C733Fj-E.js → kanban-definition-K7BYSVSG-DkdCeQlS.js} +1 -1
- package/ui-dist/assets/{layout-CM4c3NA_.js → layout-CqSYvZ_w.js} +1 -1
- package/ui-dist/assets/{linear-DzH21Xsf.js → linear-B8xGZaoi.js} +1 -1
- package/ui-dist/assets/{mermaid.core-Z2rpoVP2.js → mermaid.core-AKL_cdyk.js} +4 -4
- package/ui-dist/assets/{mindmap-definition-YRQLILUH-DylLLj9w.js → mindmap-definition-YRQLILUH-Zr-dXC0x.js} +1 -1
- package/ui-dist/assets/{pieDiagram-SKSYHLDU-617wI_rr.js → pieDiagram-SKSYHLDU-BvDAU-Nk.js} +1 -1
- package/ui-dist/assets/{quadrantDiagram-337W2JSQ-lxoCPJIL.js → quadrantDiagram-337W2JSQ-Dn9kM62o.js} +1 -1
- package/ui-dist/assets/{requirementDiagram-Z7DCOOCP-C5XydQ9-.js → requirementDiagram-Z7DCOOCP-GIsIh7Sd.js} +1 -1
- package/ui-dist/assets/{sankeyDiagram-WA2Y5GQK--grmq-Q8.js → sankeyDiagram-WA2Y5GQK-CUCuBkuf.js} +1 -1
- package/ui-dist/assets/{sequenceDiagram-2WXFIKYE-BS2PeYH-.js → sequenceDiagram-2WXFIKYE-MDpUY2HM.js} +1 -1
- package/ui-dist/assets/{stateDiagram-RAJIS63D-CeuZtj2z.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-DxHdMpRr.js → timeline-definition-YZTLITO2-B6ofPhhy.js} +1 -1
- package/ui-dist/assets/{treemap-KZPCXAKY-Bv1ZlC5h.js → treemap-KZPCXAKY-DnLO6w1l.js} +1 -1
- package/ui-dist/assets/{vennDiagram-LZ73GAT5-DvpZSXY2.js → vennDiagram-LZ73GAT5-D0MyZIDl.js} +1 -1
- package/ui-dist/assets/{xychartDiagram-JWTSCODW-DttOu1GC.js → xychartDiagram-JWTSCODW-rADY1iUG.js} +1 -1
- package/ui-dist/index.html +2 -2
- package/ui-dist/assets/channel-DGUh6rEi.js +0 -1
- package/ui-dist/assets/classDiagram-VBA2DB6C-1ntk2IOV.js +0 -1
- package/ui-dist/assets/classDiagram-v2-RAHNMMFH-1ntk2IOV.js +0 -1
- package/ui-dist/assets/clone-BpddY88c.js +0 -1
- package/ui-dist/assets/index-C8AD6s7S.js +0 -1510
- package/ui-dist/assets/index-Ded0dPwB.css +0 -1
- package/ui-dist/assets/stateDiagram-v2-FVOUBMTO-DXq0yC5C.js +0 -1
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
import { promises as fs } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { normalizeAgentUrlKey } from "@rudderhq/shared";
|
|
5
|
+
import { unprocessable } from "../../errors.js";
|
|
6
|
+
import { PROJECT_ROOT_SKILL_SUBDIRECTORIES, PROJECT_SCAN_DIRECTORY_ROOTS, asString, classifyInventoryKind, deriveCanonicalSkillKey, deriveTrustLevel, isPlainRecord, normalizeGitHubSkillDirectory, normalizePackageFileMap, normalizePortablePath, normalizeSkillDescription, normalizeSkillSlug, readCanonicalSkillKey, statPath, } from "./organization-skills.catalog.js";
|
|
7
|
+
export function prepareYamlLines(raw) {
|
|
8
|
+
return raw
|
|
9
|
+
.split("\n")
|
|
10
|
+
.map((line) => ({
|
|
11
|
+
indent: line.match(/^ */)?.[0].length ?? 0,
|
|
12
|
+
content: line.trim(),
|
|
13
|
+
}))
|
|
14
|
+
.filter((line) => line.content.length > 0 && !line.content.startsWith("#"));
|
|
15
|
+
}
|
|
16
|
+
export function parseYamlScalar(rawValue) {
|
|
17
|
+
const trimmed = rawValue.trim();
|
|
18
|
+
if (trimmed === "")
|
|
19
|
+
return "";
|
|
20
|
+
if (trimmed === "null" || trimmed === "~")
|
|
21
|
+
return null;
|
|
22
|
+
if (trimmed === "true")
|
|
23
|
+
return true;
|
|
24
|
+
if (trimmed === "false")
|
|
25
|
+
return false;
|
|
26
|
+
if (trimmed === "[]")
|
|
27
|
+
return [];
|
|
28
|
+
if (trimmed === "{}")
|
|
29
|
+
return {};
|
|
30
|
+
if (/^-?\d+(\.\d+)?$/.test(trimmed))
|
|
31
|
+
return Number(trimmed);
|
|
32
|
+
if (trimmed.startsWith("\"") || trimmed.startsWith("[") || trimmed.startsWith("{")) {
|
|
33
|
+
try {
|
|
34
|
+
return JSON.parse(trimmed);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return trimmed;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return trimmed;
|
|
41
|
+
}
|
|
42
|
+
export function parseYamlBlockScalar(lines, startIndex, indentLevel, style) {
|
|
43
|
+
const parts = [];
|
|
44
|
+
let index = startIndex;
|
|
45
|
+
while (index < lines.length) {
|
|
46
|
+
const line = lines[index];
|
|
47
|
+
if (line.indent < indentLevel)
|
|
48
|
+
break;
|
|
49
|
+
parts.push(line.content);
|
|
50
|
+
index += 1;
|
|
51
|
+
}
|
|
52
|
+
if (style === ">") {
|
|
53
|
+
return { value: parts.join(" "), nextIndex: index };
|
|
54
|
+
}
|
|
55
|
+
return { value: parts.join("\n"), nextIndex: index };
|
|
56
|
+
}
|
|
57
|
+
export function parseYamlBlock(lines, startIndex, indentLevel) {
|
|
58
|
+
let index = startIndex;
|
|
59
|
+
while (index < lines.length && lines[index].content.length === 0)
|
|
60
|
+
index += 1;
|
|
61
|
+
if (index >= lines.length || lines[index].indent < indentLevel) {
|
|
62
|
+
return { value: {}, nextIndex: index };
|
|
63
|
+
}
|
|
64
|
+
const isArray = lines[index].indent === indentLevel && lines[index].content.startsWith("-");
|
|
65
|
+
if (isArray) {
|
|
66
|
+
const values = [];
|
|
67
|
+
while (index < lines.length) {
|
|
68
|
+
const line = lines[index];
|
|
69
|
+
if (line.indent < indentLevel)
|
|
70
|
+
break;
|
|
71
|
+
if (line.indent !== indentLevel || !line.content.startsWith("-"))
|
|
72
|
+
break;
|
|
73
|
+
const remainder = line.content.slice(1).trim();
|
|
74
|
+
index += 1;
|
|
75
|
+
if (!remainder) {
|
|
76
|
+
const nested = parseYamlBlock(lines, index, indentLevel + 2);
|
|
77
|
+
values.push(nested.value);
|
|
78
|
+
index = nested.nextIndex;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const inlineObjectSeparator = remainder.indexOf(":");
|
|
82
|
+
if (inlineObjectSeparator > 0 &&
|
|
83
|
+
!remainder.startsWith("\"") &&
|
|
84
|
+
!remainder.startsWith("{") &&
|
|
85
|
+
!remainder.startsWith("[")) {
|
|
86
|
+
const key = remainder.slice(0, inlineObjectSeparator).trim();
|
|
87
|
+
const rawValue = remainder.slice(inlineObjectSeparator + 1).trim();
|
|
88
|
+
const nextObject = {
|
|
89
|
+
[key]: parseYamlScalar(rawValue),
|
|
90
|
+
};
|
|
91
|
+
if (index < lines.length && lines[index].indent > indentLevel) {
|
|
92
|
+
const nested = parseYamlBlock(lines, index, indentLevel + 2);
|
|
93
|
+
if (isPlainRecord(nested.value)) {
|
|
94
|
+
Object.assign(nextObject, nested.value);
|
|
95
|
+
}
|
|
96
|
+
index = nested.nextIndex;
|
|
97
|
+
}
|
|
98
|
+
values.push(nextObject);
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
values.push(parseYamlScalar(remainder));
|
|
102
|
+
}
|
|
103
|
+
return { value: values, nextIndex: index };
|
|
104
|
+
}
|
|
105
|
+
const record = {};
|
|
106
|
+
while (index < lines.length) {
|
|
107
|
+
const line = lines[index];
|
|
108
|
+
if (line.indent < indentLevel)
|
|
109
|
+
break;
|
|
110
|
+
if (line.indent !== indentLevel) {
|
|
111
|
+
index += 1;
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
const separatorIndex = line.content.indexOf(":");
|
|
115
|
+
if (separatorIndex <= 0) {
|
|
116
|
+
index += 1;
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
const key = line.content.slice(0, separatorIndex).trim();
|
|
120
|
+
const remainder = line.content.slice(separatorIndex + 1).trim();
|
|
121
|
+
index += 1;
|
|
122
|
+
if (/^[>|][+-]?$/.test(remainder)) {
|
|
123
|
+
const blockScalar = parseYamlBlockScalar(lines, index, indentLevel + 2, remainder.startsWith(">") ? ">" : "|");
|
|
124
|
+
record[key] = blockScalar.value;
|
|
125
|
+
index = blockScalar.nextIndex;
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if (!remainder) {
|
|
129
|
+
const nested = parseYamlBlock(lines, index, indentLevel + 2);
|
|
130
|
+
record[key] = nested.value;
|
|
131
|
+
index = nested.nextIndex;
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
record[key] = parseYamlScalar(remainder);
|
|
135
|
+
}
|
|
136
|
+
return { value: record, nextIndex: index };
|
|
137
|
+
}
|
|
138
|
+
export function parseYamlFrontmatter(raw) {
|
|
139
|
+
const prepared = prepareYamlLines(raw);
|
|
140
|
+
if (prepared.length === 0)
|
|
141
|
+
return {};
|
|
142
|
+
const parsed = parseYamlBlock(prepared, 0, prepared[0].indent);
|
|
143
|
+
return isPlainRecord(parsed.value) ? parsed.value : {};
|
|
144
|
+
}
|
|
145
|
+
export function parseFrontmatterMarkdown(raw) {
|
|
146
|
+
const normalized = raw.replace(/\r\n/g, "\n");
|
|
147
|
+
if (!normalized.startsWith("---\n")) {
|
|
148
|
+
return { frontmatter: {}, body: normalized.trim() };
|
|
149
|
+
}
|
|
150
|
+
const closing = normalized.indexOf("\n---\n", 4);
|
|
151
|
+
if (closing < 0) {
|
|
152
|
+
return { frontmatter: {}, body: normalized.trim() };
|
|
153
|
+
}
|
|
154
|
+
const frontmatterRaw = normalized.slice(4, closing).trim();
|
|
155
|
+
const body = normalized.slice(closing + 5).trim();
|
|
156
|
+
return {
|
|
157
|
+
frontmatter: parseYamlFrontmatter(frontmatterRaw),
|
|
158
|
+
body,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
export async function fetchText(url) {
|
|
162
|
+
const response = await fetch(url);
|
|
163
|
+
if (!response.ok) {
|
|
164
|
+
throw unprocessable(`Failed to fetch ${url}: ${response.status}`);
|
|
165
|
+
}
|
|
166
|
+
return response.text();
|
|
167
|
+
}
|
|
168
|
+
export async function fetchJson(url) {
|
|
169
|
+
const response = await fetch(url, {
|
|
170
|
+
headers: {
|
|
171
|
+
accept: "application/vnd.github+json",
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
if (!response.ok) {
|
|
175
|
+
throw unprocessable(`Failed to fetch ${url}: ${response.status}`);
|
|
176
|
+
}
|
|
177
|
+
return response.json();
|
|
178
|
+
}
|
|
179
|
+
export async function resolveGitHubDefaultBranch(owner, repo) {
|
|
180
|
+
const response = await fetchJson(`https://api.github.com/repos/${owner}/${repo}`);
|
|
181
|
+
return asString(response.default_branch) ?? "main";
|
|
182
|
+
}
|
|
183
|
+
export async function resolveGitHubCommitSha(owner, repo, ref) {
|
|
184
|
+
const response = await fetchJson(`https://api.github.com/repos/${owner}/${repo}/commits/${encodeURIComponent(ref)}`);
|
|
185
|
+
const sha = asString(response.sha);
|
|
186
|
+
if (!sha) {
|
|
187
|
+
throw unprocessable(`Failed to resolve GitHub ref ${ref}`);
|
|
188
|
+
}
|
|
189
|
+
return sha;
|
|
190
|
+
}
|
|
191
|
+
export function parseGitHubSourceUrl(rawUrl) {
|
|
192
|
+
const url = new URL(rawUrl);
|
|
193
|
+
if (url.hostname !== "github.com") {
|
|
194
|
+
throw unprocessable("GitHub source must use github.com URL");
|
|
195
|
+
}
|
|
196
|
+
const parts = url.pathname.split("/").filter(Boolean);
|
|
197
|
+
if (parts.length < 2) {
|
|
198
|
+
throw unprocessable("Invalid GitHub URL");
|
|
199
|
+
}
|
|
200
|
+
const owner = parts[0];
|
|
201
|
+
const repo = parts[1].replace(/\.git$/i, "");
|
|
202
|
+
let ref = "main";
|
|
203
|
+
let basePath = "";
|
|
204
|
+
let filePath = null;
|
|
205
|
+
let explicitRef = false;
|
|
206
|
+
if (parts[2] === "tree") {
|
|
207
|
+
ref = parts[3] ?? "main";
|
|
208
|
+
basePath = parts.slice(4).join("/");
|
|
209
|
+
explicitRef = true;
|
|
210
|
+
}
|
|
211
|
+
else if (parts[2] === "blob") {
|
|
212
|
+
ref = parts[3] ?? "main";
|
|
213
|
+
filePath = parts.slice(4).join("/");
|
|
214
|
+
basePath = filePath ? path.posix.dirname(filePath) : "";
|
|
215
|
+
explicitRef = true;
|
|
216
|
+
}
|
|
217
|
+
return { owner, repo, ref, basePath, filePath, explicitRef };
|
|
218
|
+
}
|
|
219
|
+
export async function resolveGitHubPinnedRef(parsed) {
|
|
220
|
+
if (/^[0-9a-f]{40}$/i.test(parsed.ref.trim())) {
|
|
221
|
+
return {
|
|
222
|
+
pinnedRef: parsed.ref,
|
|
223
|
+
trackingRef: parsed.explicitRef ? parsed.ref : null,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
const trackingRef = parsed.explicitRef
|
|
227
|
+
? parsed.ref
|
|
228
|
+
: await resolveGitHubDefaultBranch(parsed.owner, parsed.repo);
|
|
229
|
+
const pinnedRef = await resolveGitHubCommitSha(parsed.owner, parsed.repo, trackingRef);
|
|
230
|
+
return { pinnedRef, trackingRef };
|
|
231
|
+
}
|
|
232
|
+
export function resolveRawGitHubUrl(owner, repo, ref, filePath) {
|
|
233
|
+
return `https://raw.githubusercontent.com/${owner}/${repo}/${ref}/${filePath.replace(/^\/+/, "")}`;
|
|
234
|
+
}
|
|
235
|
+
export function extractCommandTokens(raw) {
|
|
236
|
+
const matches = raw.match(/"[^"]*"|'[^']*'|\S+/g) ?? [];
|
|
237
|
+
return matches.map((token) => token.replace(/^['"]|['"]$/g, ""));
|
|
238
|
+
}
|
|
239
|
+
export function parseSkillImportSourceInput(rawInput) {
|
|
240
|
+
const trimmed = rawInput.trim();
|
|
241
|
+
if (!trimmed) {
|
|
242
|
+
throw unprocessable("Skill source is required.");
|
|
243
|
+
}
|
|
244
|
+
const warnings = [];
|
|
245
|
+
let source = trimmed;
|
|
246
|
+
let requestedSkillSlug = null;
|
|
247
|
+
if (/^npx\s+skills\s+add\s+/i.test(trimmed)) {
|
|
248
|
+
const tokens = extractCommandTokens(trimmed);
|
|
249
|
+
const addIndex = tokens.findIndex((token, index) => token === "add"
|
|
250
|
+
&& index > 0
|
|
251
|
+
&& tokens[index - 1]?.toLowerCase() === "skills");
|
|
252
|
+
if (addIndex >= 0) {
|
|
253
|
+
source = tokens[addIndex + 1] ?? "";
|
|
254
|
+
for (let index = addIndex + 2; index < tokens.length; index += 1) {
|
|
255
|
+
const token = tokens[index];
|
|
256
|
+
if (token === "--skill") {
|
|
257
|
+
requestedSkillSlug = normalizeSkillSlug(tokens[index + 1] ?? null);
|
|
258
|
+
index += 1;
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
if (token.startsWith("--skill=")) {
|
|
262
|
+
requestedSkillSlug = normalizeSkillSlug(token.slice("--skill=".length));
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
const normalizedSource = source.trim();
|
|
268
|
+
if (!normalizedSource) {
|
|
269
|
+
throw unprocessable("Skill source is required.");
|
|
270
|
+
}
|
|
271
|
+
// Key-style imports (org/repo/skill) originate from the skills.sh registry
|
|
272
|
+
if (!/^https?:\/\//i.test(normalizedSource) && /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(normalizedSource)) {
|
|
273
|
+
const [owner, repo, skillSlugRaw] = normalizedSource.split("/");
|
|
274
|
+
return {
|
|
275
|
+
resolvedSource: `https://github.com/${owner}/${repo}`,
|
|
276
|
+
requestedSkillSlug: normalizeSkillSlug(skillSlugRaw),
|
|
277
|
+
originalSkillsShUrl: `https://skills.sh/${owner}/${repo}/${skillSlugRaw}`,
|
|
278
|
+
warnings,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
if (!/^https?:\/\//i.test(normalizedSource) && /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(normalizedSource)) {
|
|
282
|
+
return {
|
|
283
|
+
resolvedSource: `https://github.com/${normalizedSource}`,
|
|
284
|
+
requestedSkillSlug,
|
|
285
|
+
originalSkillsShUrl: null,
|
|
286
|
+
warnings,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
// Detect skills.sh URLs and resolve to GitHub: https://skills.sh/org/repo/skill → org/repo/skill key
|
|
290
|
+
const skillsShMatch = normalizedSource.match(/^https?:\/\/(?:www\.)?skills\.sh\/([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+)(?:\/([A-Za-z0-9_.-]+))?(?:[?#].*)?$/i);
|
|
291
|
+
if (skillsShMatch) {
|
|
292
|
+
const [, owner, repo, skillSlugRaw] = skillsShMatch;
|
|
293
|
+
return {
|
|
294
|
+
resolvedSource: `https://github.com/${owner}/${repo}`,
|
|
295
|
+
requestedSkillSlug: skillSlugRaw ? normalizeSkillSlug(skillSlugRaw) : requestedSkillSlug,
|
|
296
|
+
originalSkillsShUrl: normalizedSource,
|
|
297
|
+
warnings,
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
return {
|
|
301
|
+
resolvedSource: normalizedSource,
|
|
302
|
+
requestedSkillSlug,
|
|
303
|
+
originalSkillsShUrl: null,
|
|
304
|
+
warnings,
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
export function resolveBundledSkillsRoot() {
|
|
308
|
+
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
309
|
+
return [
|
|
310
|
+
path.resolve(moduleDir, "../../../resources/bundled-skills"),
|
|
311
|
+
path.resolve(process.cwd(), "server/resources/bundled-skills"),
|
|
312
|
+
];
|
|
313
|
+
}
|
|
314
|
+
export async function readCommunityPresetFallbackImport(orgId, slug, skillKey, sourceUrl) {
|
|
315
|
+
for (const skillsRoot of resolveCommunityPresetSkillsRoot()) {
|
|
316
|
+
const stats = await fs.stat(skillsRoot).catch(() => null);
|
|
317
|
+
if (!stats?.isDirectory())
|
|
318
|
+
continue;
|
|
319
|
+
const skillDir = path.join(skillsRoot, slug);
|
|
320
|
+
const skillStats = await fs.stat(skillDir).catch(() => null);
|
|
321
|
+
if (!skillStats?.isDirectory())
|
|
322
|
+
continue;
|
|
323
|
+
const imported = await readLocalSkillImportFromDirectory(orgId, skillDir, {
|
|
324
|
+
metadata: {
|
|
325
|
+
sourceKind: "community_preset",
|
|
326
|
+
skillKey,
|
|
327
|
+
},
|
|
328
|
+
}).catch(() => null);
|
|
329
|
+
if (!imported)
|
|
330
|
+
continue;
|
|
331
|
+
return {
|
|
332
|
+
...imported,
|
|
333
|
+
key: skillKey,
|
|
334
|
+
slug,
|
|
335
|
+
sourceType: "github",
|
|
336
|
+
sourceLocator: sourceUrl,
|
|
337
|
+
sourceRef: imported.sourceRef ?? null,
|
|
338
|
+
metadata: {
|
|
339
|
+
...(imported.metadata ?? {}),
|
|
340
|
+
sourceKind: "community_preset",
|
|
341
|
+
skillKey,
|
|
342
|
+
},
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
export function resolveCommunityPresetSkillsRoot() {
|
|
348
|
+
const moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
349
|
+
return [
|
|
350
|
+
path.resolve(moduleDir, "../../../resources/community-skills"),
|
|
351
|
+
path.resolve(process.cwd(), "server/resources/community-skills"),
|
|
352
|
+
];
|
|
353
|
+
}
|
|
354
|
+
export function matchesRequestedSkill(relativeSkillPath, requestedSkillSlug) {
|
|
355
|
+
if (!requestedSkillSlug)
|
|
356
|
+
return true;
|
|
357
|
+
const skillDir = path.posix.dirname(relativeSkillPath);
|
|
358
|
+
return normalizeSkillSlug(path.posix.basename(skillDir)) === requestedSkillSlug;
|
|
359
|
+
}
|
|
360
|
+
export function deriveImportedSkillSlug(frontmatter, fallback) {
|
|
361
|
+
return normalizeSkillSlug(asString(frontmatter.slug))
|
|
362
|
+
?? normalizeSkillSlug(asString(frontmatter.name))
|
|
363
|
+
?? normalizeAgentUrlKey(fallback)
|
|
364
|
+
?? "skill";
|
|
365
|
+
}
|
|
366
|
+
export function deriveImportedSkillSource(frontmatter, fallbackSlug) {
|
|
367
|
+
const metadata = isPlainRecord(frontmatter.metadata) ? frontmatter.metadata : null;
|
|
368
|
+
const canonicalKey = readCanonicalSkillKey(frontmatter, metadata);
|
|
369
|
+
const rawSources = metadata && Array.isArray(metadata.sources) ? metadata.sources : [];
|
|
370
|
+
const sourceEntry = rawSources.find((entry) => isPlainRecord(entry));
|
|
371
|
+
const kind = asString(sourceEntry?.kind);
|
|
372
|
+
if (kind === "github-dir" || kind === "github-file") {
|
|
373
|
+
const repo = asString(sourceEntry?.repo);
|
|
374
|
+
const repoPath = asString(sourceEntry?.path);
|
|
375
|
+
const commit = asString(sourceEntry?.commit);
|
|
376
|
+
const trackingRef = asString(sourceEntry?.trackingRef);
|
|
377
|
+
const url = asString(sourceEntry?.url)
|
|
378
|
+
?? (repo
|
|
379
|
+
? `https://github.com/${repo}${repoPath ? `/tree/${trackingRef ?? commit ?? "main"}/${repoPath}` : ""}`
|
|
380
|
+
: null);
|
|
381
|
+
const [owner, repoName] = (repo ?? "").split("/");
|
|
382
|
+
if (repo && owner && repoName) {
|
|
383
|
+
return {
|
|
384
|
+
sourceType: "github",
|
|
385
|
+
sourceLocator: url,
|
|
386
|
+
sourceRef: commit,
|
|
387
|
+
metadata: {
|
|
388
|
+
...(canonicalKey ? { skillKey: canonicalKey } : {}),
|
|
389
|
+
sourceKind: "github",
|
|
390
|
+
owner,
|
|
391
|
+
repo: repoName,
|
|
392
|
+
ref: commit,
|
|
393
|
+
trackingRef,
|
|
394
|
+
repoSkillDir: repoPath ?? `skills/${fallbackSlug}`,
|
|
395
|
+
},
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
if (kind === "url") {
|
|
400
|
+
const url = asString(sourceEntry?.url) ?? asString(sourceEntry?.rawUrl);
|
|
401
|
+
if (url) {
|
|
402
|
+
return {
|
|
403
|
+
sourceType: "url",
|
|
404
|
+
sourceLocator: url,
|
|
405
|
+
sourceRef: null,
|
|
406
|
+
metadata: {
|
|
407
|
+
...(canonicalKey ? { skillKey: canonicalKey } : {}),
|
|
408
|
+
sourceKind: "url",
|
|
409
|
+
},
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return {
|
|
414
|
+
sourceType: "catalog",
|
|
415
|
+
sourceLocator: null,
|
|
416
|
+
sourceRef: null,
|
|
417
|
+
metadata: {
|
|
418
|
+
...(canonicalKey ? { skillKey: canonicalKey } : {}),
|
|
419
|
+
sourceKind: "catalog",
|
|
420
|
+
},
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
export function readInlineSkillImports(orgId, files) {
|
|
424
|
+
const normalizedFiles = normalizePackageFileMap(files);
|
|
425
|
+
const skillPaths = Object.keys(normalizedFiles).filter((entry) => path.posix.basename(entry).toLowerCase() === "skill.md");
|
|
426
|
+
const imports = [];
|
|
427
|
+
for (const skillPath of skillPaths) {
|
|
428
|
+
const dir = path.posix.dirname(skillPath);
|
|
429
|
+
const skillDir = dir === "." ? "" : dir;
|
|
430
|
+
const slugFallback = path.posix.basename(skillDir || path.posix.dirname(skillPath));
|
|
431
|
+
const markdown = normalizedFiles[skillPath];
|
|
432
|
+
const parsed = parseFrontmatterMarkdown(markdown);
|
|
433
|
+
const slug = deriveImportedSkillSlug(parsed.frontmatter, slugFallback);
|
|
434
|
+
const source = deriveImportedSkillSource(parsed.frontmatter, slug);
|
|
435
|
+
const inventory = Object.keys(normalizedFiles)
|
|
436
|
+
.filter((entry) => entry === skillPath || (skillDir ? entry.startsWith(`${skillDir}/`) : false))
|
|
437
|
+
.map((entry) => {
|
|
438
|
+
const relative = entry === skillPath ? "SKILL.md" : entry.slice(skillDir.length + 1);
|
|
439
|
+
return {
|
|
440
|
+
path: normalizePortablePath(relative),
|
|
441
|
+
kind: classifyInventoryKind(relative),
|
|
442
|
+
};
|
|
443
|
+
})
|
|
444
|
+
.sort((left, right) => left.path.localeCompare(right.path));
|
|
445
|
+
imports.push({
|
|
446
|
+
key: "",
|
|
447
|
+
slug,
|
|
448
|
+
name: asString(parsed.frontmatter.name) ?? slug,
|
|
449
|
+
description: normalizeSkillDescription(parsed.frontmatter.description),
|
|
450
|
+
markdown,
|
|
451
|
+
packageDir: skillDir,
|
|
452
|
+
sourceType: source.sourceType,
|
|
453
|
+
sourceLocator: source.sourceLocator,
|
|
454
|
+
sourceRef: source.sourceRef,
|
|
455
|
+
trustLevel: deriveTrustLevel(inventory),
|
|
456
|
+
compatibility: "compatible",
|
|
457
|
+
fileInventory: inventory,
|
|
458
|
+
metadata: source.metadata,
|
|
459
|
+
});
|
|
460
|
+
imports[imports.length - 1].key = deriveCanonicalSkillKey(orgId, imports[imports.length - 1]);
|
|
461
|
+
}
|
|
462
|
+
return imports;
|
|
463
|
+
}
|
|
464
|
+
export async function walkLocalFiles(root, current, out) {
|
|
465
|
+
const entries = await fs.readdir(current, { withFileTypes: true });
|
|
466
|
+
for (const entry of entries) {
|
|
467
|
+
if (entry.name === ".git" || entry.name === "node_modules")
|
|
468
|
+
continue;
|
|
469
|
+
const absolutePath = path.join(current, entry.name);
|
|
470
|
+
if (entry.isDirectory()) {
|
|
471
|
+
await walkLocalFiles(root, absolutePath, out);
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
if (!entry.isFile())
|
|
475
|
+
continue;
|
|
476
|
+
out.push(normalizePortablePath(path.relative(root, absolutePath)));
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
export async function collectLocalSkillInventory(skillDir, mode = "full") {
|
|
480
|
+
const skillFilePath = path.join(skillDir, "SKILL.md");
|
|
481
|
+
const skillFileStat = await statPath(skillFilePath);
|
|
482
|
+
if (!skillFileStat?.isFile()) {
|
|
483
|
+
throw unprocessable(`No SKILL.md file was found in ${skillDir}.`);
|
|
484
|
+
}
|
|
485
|
+
const allFiles = new Set(["SKILL.md"]);
|
|
486
|
+
if (mode === "full") {
|
|
487
|
+
const discoveredFiles = [];
|
|
488
|
+
await walkLocalFiles(skillDir, skillDir, discoveredFiles);
|
|
489
|
+
for (const relativePath of discoveredFiles) {
|
|
490
|
+
allFiles.add(relativePath);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
for (const relativeDir of PROJECT_ROOT_SKILL_SUBDIRECTORIES) {
|
|
495
|
+
const absoluteDir = path.join(skillDir, relativeDir);
|
|
496
|
+
const dirStat = await statPath(absoluteDir);
|
|
497
|
+
if (!dirStat?.isDirectory())
|
|
498
|
+
continue;
|
|
499
|
+
const discoveredFiles = [];
|
|
500
|
+
await walkLocalFiles(skillDir, absoluteDir, discoveredFiles);
|
|
501
|
+
for (const relativePath of discoveredFiles) {
|
|
502
|
+
allFiles.add(relativePath);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
return Array.from(allFiles)
|
|
507
|
+
.map((relativePath) => ({
|
|
508
|
+
path: normalizePortablePath(relativePath),
|
|
509
|
+
kind: classifyInventoryKind(relativePath),
|
|
510
|
+
}))
|
|
511
|
+
.sort((left, right) => left.path.localeCompare(right.path));
|
|
512
|
+
}
|
|
513
|
+
export async function readLocalSkillImportFromDirectory(orgId, skillDir, options) {
|
|
514
|
+
const resolvedSkillDir = path.resolve(skillDir);
|
|
515
|
+
const skillFilePath = path.join(resolvedSkillDir, "SKILL.md");
|
|
516
|
+
const markdown = await fs.readFile(skillFilePath, "utf8");
|
|
517
|
+
const parsed = parseFrontmatterMarkdown(markdown);
|
|
518
|
+
const slug = deriveImportedSkillSlug(parsed.frontmatter, path.basename(resolvedSkillDir));
|
|
519
|
+
const parsedMetadata = isPlainRecord(parsed.frontmatter.metadata) ? parsed.frontmatter.metadata : null;
|
|
520
|
+
const skillKey = readCanonicalSkillKey(parsed.frontmatter, parsedMetadata);
|
|
521
|
+
const metadata = {
|
|
522
|
+
...(skillKey ? { skillKey } : {}),
|
|
523
|
+
...(parsedMetadata ?? {}),
|
|
524
|
+
sourceKind: "local_path",
|
|
525
|
+
...(options?.metadata ?? {}),
|
|
526
|
+
};
|
|
527
|
+
const inventory = await collectLocalSkillInventory(resolvedSkillDir, options?.inventoryMode ?? "full");
|
|
528
|
+
return {
|
|
529
|
+
key: deriveCanonicalSkillKey(orgId, {
|
|
530
|
+
slug,
|
|
531
|
+
sourceType: "local_path",
|
|
532
|
+
sourceLocator: resolvedSkillDir,
|
|
533
|
+
metadata,
|
|
534
|
+
}),
|
|
535
|
+
slug,
|
|
536
|
+
name: asString(parsed.frontmatter.name) ?? slug,
|
|
537
|
+
description: normalizeSkillDescription(parsed.frontmatter.description),
|
|
538
|
+
markdown,
|
|
539
|
+
packageDir: resolvedSkillDir,
|
|
540
|
+
sourceType: "local_path",
|
|
541
|
+
sourceLocator: resolvedSkillDir,
|
|
542
|
+
sourceRef: null,
|
|
543
|
+
trustLevel: deriveTrustLevel(inventory),
|
|
544
|
+
compatibility: "compatible",
|
|
545
|
+
fileInventory: inventory,
|
|
546
|
+
metadata,
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
export async function discoverProjectWorkspaceSkillDirectories(target) {
|
|
550
|
+
const discovered = new Map();
|
|
551
|
+
const rootSkillPath = path.join(target.workspaceCwd, "SKILL.md");
|
|
552
|
+
if ((await statPath(rootSkillPath))?.isFile()) {
|
|
553
|
+
discovered.set(path.resolve(target.workspaceCwd), "project_root");
|
|
554
|
+
}
|
|
555
|
+
for (const relativeRoot of PROJECT_SCAN_DIRECTORY_ROOTS) {
|
|
556
|
+
const absoluteRoot = path.join(target.workspaceCwd, relativeRoot);
|
|
557
|
+
const rootStat = await statPath(absoluteRoot);
|
|
558
|
+
if (!rootStat?.isDirectory())
|
|
559
|
+
continue;
|
|
560
|
+
const entries = await fs.readdir(absoluteRoot, { withFileTypes: true }).catch(() => []);
|
|
561
|
+
for (const entry of entries) {
|
|
562
|
+
if (!entry.isDirectory())
|
|
563
|
+
continue;
|
|
564
|
+
const absoluteSkillDir = path.resolve(absoluteRoot, entry.name);
|
|
565
|
+
if (!(await statPath(path.join(absoluteSkillDir, "SKILL.md")))?.isFile())
|
|
566
|
+
continue;
|
|
567
|
+
discovered.set(absoluteSkillDir, "full");
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
return Array.from(discovered.entries())
|
|
571
|
+
.map(([skillDir, inventoryMode]) => ({ skillDir, inventoryMode }))
|
|
572
|
+
.sort((left, right) => left.skillDir.localeCompare(right.skillDir));
|
|
573
|
+
}
|
|
574
|
+
export async function readLocalSkillImports(orgId, sourcePath) {
|
|
575
|
+
const resolvedPath = path.resolve(sourcePath);
|
|
576
|
+
const stat = await fs.stat(resolvedPath).catch(() => null);
|
|
577
|
+
if (!stat) {
|
|
578
|
+
throw unprocessable(`Skill source path does not exist: ${sourcePath}`);
|
|
579
|
+
}
|
|
580
|
+
if (stat.isFile()) {
|
|
581
|
+
if (path.basename(resolvedPath).toLowerCase() !== "skill.md") {
|
|
582
|
+
throw unprocessable("Local skill imports must point at SKILL.md or a directory that contains skill folders.");
|
|
583
|
+
}
|
|
584
|
+
return [await readLocalSkillImportFromDirectory(orgId, path.dirname(resolvedPath))];
|
|
585
|
+
}
|
|
586
|
+
const discovered = new Set();
|
|
587
|
+
if ((await statPath(path.join(resolvedPath, "SKILL.md")))?.isFile()) {
|
|
588
|
+
discovered.add(resolvedPath);
|
|
589
|
+
}
|
|
590
|
+
for (const candidateRoot of [resolvedPath, path.join(resolvedPath, "skills")]) {
|
|
591
|
+
const candidateStat = await statPath(candidateRoot);
|
|
592
|
+
if (!candidateStat?.isDirectory())
|
|
593
|
+
continue;
|
|
594
|
+
const entries = await fs.readdir(candidateRoot, { withFileTypes: true }).catch(() => []);
|
|
595
|
+
for (const entry of entries) {
|
|
596
|
+
if (!entry.isDirectory())
|
|
597
|
+
continue;
|
|
598
|
+
const skillDir = path.join(candidateRoot, entry.name);
|
|
599
|
+
if ((await statPath(path.join(skillDir, "SKILL.md")))?.isFile()) {
|
|
600
|
+
discovered.add(path.resolve(skillDir));
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
if (discovered.size === 0) {
|
|
605
|
+
throw unprocessable("No SKILL.md files were found in the provided path.");
|
|
606
|
+
}
|
|
607
|
+
return Promise.all(Array.from(discovered)
|
|
608
|
+
.sort((left, right) => left.localeCompare(right))
|
|
609
|
+
.map((skillDir) => readLocalSkillImportFromDirectory(orgId, skillDir)));
|
|
610
|
+
}
|
|
611
|
+
export async function readUrlSkillImports(orgId, sourceUrl, requestedSkillSlug = null) {
|
|
612
|
+
const url = sourceUrl.trim();
|
|
613
|
+
const warnings = [];
|
|
614
|
+
if (url.includes("github.com/")) {
|
|
615
|
+
const parsed = parseGitHubSourceUrl(url);
|
|
616
|
+
const { pinnedRef, trackingRef } = await resolveGitHubPinnedRef(parsed);
|
|
617
|
+
let ref = pinnedRef;
|
|
618
|
+
const tree = await fetchJson(`https://api.github.com/repos/${parsed.owner}/${parsed.repo}/git/trees/${ref}?recursive=1`).catch(() => {
|
|
619
|
+
throw unprocessable(`Failed to read GitHub tree for ${url}`);
|
|
620
|
+
});
|
|
621
|
+
const allPaths = (tree.tree ?? [])
|
|
622
|
+
.filter((entry) => entry.type === "blob")
|
|
623
|
+
.map((entry) => entry.path)
|
|
624
|
+
.filter((entry) => typeof entry === "string");
|
|
625
|
+
const basePrefix = parsed.basePath ? `${parsed.basePath.replace(/^\/+|\/+$/g, "")}/` : "";
|
|
626
|
+
const scopedPaths = basePrefix
|
|
627
|
+
? allPaths.filter((entry) => entry.startsWith(basePrefix))
|
|
628
|
+
: allPaths;
|
|
629
|
+
const relativePaths = scopedPaths.map((entry) => basePrefix ? entry.slice(basePrefix.length) : entry);
|
|
630
|
+
const filteredPaths = parsed.filePath
|
|
631
|
+
? relativePaths.filter((entry) => entry === path.posix.relative(parsed.basePath || ".", parsed.filePath))
|
|
632
|
+
: relativePaths;
|
|
633
|
+
const skillPaths = filteredPaths.filter((entry) => path.posix.basename(entry).toLowerCase() === "skill.md");
|
|
634
|
+
if (skillPaths.length === 0) {
|
|
635
|
+
throw unprocessable("No SKILL.md files were found in the provided GitHub source.");
|
|
636
|
+
}
|
|
637
|
+
const skills = [];
|
|
638
|
+
for (const relativeSkillPath of skillPaths) {
|
|
639
|
+
const repoSkillPath = basePrefix ? `${basePrefix}${relativeSkillPath}` : relativeSkillPath;
|
|
640
|
+
const markdown = await fetchText(resolveRawGitHubUrl(parsed.owner, parsed.repo, ref, repoSkillPath));
|
|
641
|
+
const parsedMarkdown = parseFrontmatterMarkdown(markdown);
|
|
642
|
+
const skillDir = path.posix.dirname(relativeSkillPath);
|
|
643
|
+
const slug = deriveImportedSkillSlug(parsedMarkdown.frontmatter, path.posix.basename(skillDir));
|
|
644
|
+
const skillKey = readCanonicalSkillKey(parsedMarkdown.frontmatter, isPlainRecord(parsedMarkdown.frontmatter.metadata) ? parsedMarkdown.frontmatter.metadata : null);
|
|
645
|
+
if (requestedSkillSlug && !matchesRequestedSkill(relativeSkillPath, requestedSkillSlug) && slug !== requestedSkillSlug) {
|
|
646
|
+
continue;
|
|
647
|
+
}
|
|
648
|
+
const metadata = {
|
|
649
|
+
...(skillKey ? { skillKey } : {}),
|
|
650
|
+
sourceKind: "github",
|
|
651
|
+
owner: parsed.owner,
|
|
652
|
+
repo: parsed.repo,
|
|
653
|
+
ref: ref,
|
|
654
|
+
trackingRef,
|
|
655
|
+
repoSkillDir: normalizeGitHubSkillDirectory(basePrefix ? `${basePrefix}${skillDir}` : skillDir, slug),
|
|
656
|
+
};
|
|
657
|
+
const inventory = filteredPaths
|
|
658
|
+
.filter((entry) => entry === relativeSkillPath || entry.startsWith(`${skillDir}/`))
|
|
659
|
+
.map((entry) => ({
|
|
660
|
+
path: entry === relativeSkillPath ? "SKILL.md" : entry.slice(skillDir.length + 1),
|
|
661
|
+
kind: classifyInventoryKind(entry === relativeSkillPath ? "SKILL.md" : entry.slice(skillDir.length + 1)),
|
|
662
|
+
}))
|
|
663
|
+
.sort((left, right) => left.path.localeCompare(right.path));
|
|
664
|
+
skills.push({
|
|
665
|
+
key: deriveCanonicalSkillKey(orgId, {
|
|
666
|
+
slug,
|
|
667
|
+
sourceType: "github",
|
|
668
|
+
sourceLocator: sourceUrl,
|
|
669
|
+
metadata,
|
|
670
|
+
}),
|
|
671
|
+
slug,
|
|
672
|
+
name: asString(parsedMarkdown.frontmatter.name) ?? slug,
|
|
673
|
+
description: normalizeSkillDescription(parsedMarkdown.frontmatter.description),
|
|
674
|
+
markdown,
|
|
675
|
+
sourceType: "github",
|
|
676
|
+
sourceLocator: sourceUrl,
|
|
677
|
+
sourceRef: ref,
|
|
678
|
+
trustLevel: deriveTrustLevel(inventory),
|
|
679
|
+
compatibility: "compatible",
|
|
680
|
+
fileInventory: inventory,
|
|
681
|
+
metadata,
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
if (skills.length === 0) {
|
|
685
|
+
throw unprocessable(requestedSkillSlug
|
|
686
|
+
? `Skill ${requestedSkillSlug} was not found in the provided GitHub source.`
|
|
687
|
+
: "No SKILL.md files were found in the provided GitHub source.");
|
|
688
|
+
}
|
|
689
|
+
return { skills, warnings };
|
|
690
|
+
}
|
|
691
|
+
if (url.startsWith("http://") || url.startsWith("https://")) {
|
|
692
|
+
const markdown = await fetchText(url);
|
|
693
|
+
const parsedMarkdown = parseFrontmatterMarkdown(markdown);
|
|
694
|
+
const urlObj = new URL(url);
|
|
695
|
+
const fileName = path.posix.basename(urlObj.pathname);
|
|
696
|
+
const slug = deriveImportedSkillSlug(parsedMarkdown.frontmatter, fileName.replace(/\.md$/i, ""));
|
|
697
|
+
const skillKey = readCanonicalSkillKey(parsedMarkdown.frontmatter, isPlainRecord(parsedMarkdown.frontmatter.metadata) ? parsedMarkdown.frontmatter.metadata : null);
|
|
698
|
+
const metadata = {
|
|
699
|
+
...(skillKey ? { skillKey } : {}),
|
|
700
|
+
sourceKind: "url",
|
|
701
|
+
};
|
|
702
|
+
const inventory = [{ path: "SKILL.md", kind: "skill" }];
|
|
703
|
+
return {
|
|
704
|
+
skills: [{
|
|
705
|
+
key: deriveCanonicalSkillKey(orgId, {
|
|
706
|
+
slug,
|
|
707
|
+
sourceType: "url",
|
|
708
|
+
sourceLocator: url,
|
|
709
|
+
metadata,
|
|
710
|
+
}),
|
|
711
|
+
slug,
|
|
712
|
+
name: asString(parsedMarkdown.frontmatter.name) ?? slug,
|
|
713
|
+
description: normalizeSkillDescription(parsedMarkdown.frontmatter.description),
|
|
714
|
+
markdown,
|
|
715
|
+
sourceType: "url",
|
|
716
|
+
sourceLocator: url,
|
|
717
|
+
sourceRef: null,
|
|
718
|
+
trustLevel: deriveTrustLevel(inventory),
|
|
719
|
+
compatibility: "compatible",
|
|
720
|
+
fileInventory: inventory,
|
|
721
|
+
metadata,
|
|
722
|
+
}],
|
|
723
|
+
warnings,
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
throw unprocessable("Unsupported skill source. Use a local path or URL.");
|
|
727
|
+
}
|
|
728
|
+
//# sourceMappingURL=organization-skills.sources.js.map
|