@transcend-io/cli 12.1.2 → 12.1.4

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.
Files changed (163) hide show
  1. package/dist/{app-CnGAV_Tf.mjs → app-CsryyVyP.mjs} +16 -16
  2. package/dist/{app-CnGAV_Tf.mjs.map → app-CsryyVyP.mjs.map} +1 -1
  3. package/dist/{approvePrivacyRequests-fmkUKYAm.mjs → approvePrivacyRequests-C0muFWCU.mjs} +2 -2
  4. package/dist/{approvePrivacyRequests-fmkUKYAm.mjs.map → approvePrivacyRequests-C0muFWCU.mjs.map} +1 -1
  5. package/dist/bin/bash-complete.mjs +1 -1
  6. package/dist/bin/cli.mjs +1 -1
  7. package/dist/bin/deprecated-command.mjs +1 -1
  8. package/dist/{buildExamples-DB_puA14.mjs → buildExamples-CiNg3tTN.mjs} +2 -2
  9. package/dist/{buildExamples-DB_puA14.mjs.map → buildExamples-CiNg3tTN.mjs.map} +1 -1
  10. package/dist/{buildXdiSyncEndpoint-CwABTp_y.mjs → buildXdiSyncEndpoint-DZtSxC6c.mjs} +2 -2
  11. package/dist/{buildXdiSyncEndpoint-CwABTp_y.mjs.map → buildXdiSyncEndpoint-DZtSxC6c.mjs.map} +1 -1
  12. package/dist/{bulkRestartRequests-3OpVNSrk.mjs → bulkRestartRequests-Y9CfKTw_.mjs} +2 -2
  13. package/dist/{bulkRestartRequests-3OpVNSrk.mjs.map → bulkRestartRequests-Y9CfKTw_.mjs.map} +1 -1
  14. package/dist/{bulkRetryEnrichers-CdcXcHsx.mjs → bulkRetryEnrichers-ciLaGX2W.mjs} +2 -2
  15. package/dist/{bulkRetryEnrichers-CdcXcHsx.mjs.map → bulkRetryEnrichers-ciLaGX2W.mjs.map} +1 -1
  16. package/dist/{cancelPrivacyRequests-Dcl2KZfB.mjs → cancelPrivacyRequests-BjltZFLz.mjs} +2 -2
  17. package/dist/{cancelPrivacyRequests-Dcl2KZfB.mjs.map → cancelPrivacyRequests-BjltZFLz.mjs.map} +1 -1
  18. package/dist/{command-BcxEDvsy.mjs → command-C52pNmp5.mjs} +2 -2
  19. package/dist/{command-BcxEDvsy.mjs.map → command-C52pNmp5.mjs.map} +1 -1
  20. package/dist/{constants-boymUaFC.mjs → constants-CXMjsQ0a.mjs} +2 -2
  21. package/dist/{constants-boymUaFC.mjs.map → constants-CXMjsQ0a.mjs.map} +1 -1
  22. package/dist/{createPoolingCommandUi-D7gyxeTT.mjs → createPoolingCommandUi-DOOGd85C.mjs} +2 -2
  23. package/dist/{createPoolingCommandUi-D7gyxeTT.mjs.map → createPoolingCommandUi-DOOGd85C.mjs.map} +1 -1
  24. package/dist/{downloadPrivacyRequestFiles-930ENWDi.mjs → downloadPrivacyRequestFiles-DgcvbEMQ.mjs} +2 -2
  25. package/dist/{downloadPrivacyRequestFiles-930ENWDi.mjs.map → downloadPrivacyRequestFiles-DgcvbEMQ.mjs.map} +1 -1
  26. package/dist/{generateCrossAccountApiKeys-B_p8gQ2C.mjs → generateCrossAccountApiKeys-Baa_kNwU.mjs} +2 -2
  27. package/dist/{generateCrossAccountApiKeys-B_p8gQ2C.mjs.map → generateCrossAccountApiKeys-Baa_kNwU.mjs.map} +1 -1
  28. package/dist/{impl-D9kZ4naw.mjs → impl-1jDZ_mKw.mjs} +2 -2
  29. package/dist/{impl-D9kZ4naw.mjs.map → impl-1jDZ_mKw.mjs.map} +1 -1
  30. package/dist/{impl-2VeGCbJq.mjs → impl-2j5-mUmH.mjs} +2 -2
  31. package/dist/{impl-2VeGCbJq.mjs.map → impl-2j5-mUmH.mjs.map} +1 -1
  32. package/dist/{impl-5Pko18bX.mjs → impl-2zSnVzmN.mjs} +2 -2
  33. package/dist/{impl-5Pko18bX.mjs.map → impl-2zSnVzmN.mjs.map} +1 -1
  34. package/dist/{impl-DBMuhicF.mjs → impl-8QdaTZ72.mjs} +2 -2
  35. package/dist/{impl-DBMuhicF.mjs.map → impl-8QdaTZ72.mjs.map} +1 -1
  36. package/dist/{impl-D3LHj5lS.mjs → impl-B0Qyv21X.mjs} +2 -2
  37. package/dist/{impl-D3LHj5lS.mjs.map → impl-B0Qyv21X.mjs.map} +1 -1
  38. package/dist/{impl-BbzX8auO.mjs → impl-B5m1qcQh.mjs} +2 -2
  39. package/dist/{impl-BbzX8auO.mjs.map → impl-B5m1qcQh.mjs.map} +1 -1
  40. package/dist/{impl-CwBa15M42.mjs → impl-BEiCEzl_2.mjs} +2 -2
  41. package/dist/{impl-CwBa15M42.mjs.map → impl-BEiCEzl_2.mjs.map} +1 -1
  42. package/dist/{impl-CY8C-Fvj2.mjs → impl-BHEAKFX02.mjs} +2 -2
  43. package/dist/{impl-CY8C-Fvj2.mjs.map → impl-BHEAKFX02.mjs.map} +1 -1
  44. package/dist/{impl-B5-UipRP.mjs → impl-BOYIfXzg.mjs} +2 -2
  45. package/dist/{impl-B5-UipRP.mjs.map → impl-BOYIfXzg.mjs.map} +1 -1
  46. package/dist/{impl-C4AjYGSc.mjs → impl-Bo0QQ6wm.mjs} +2 -2
  47. package/dist/{impl-C4AjYGSc.mjs.map → impl-Bo0QQ6wm.mjs.map} +1 -1
  48. package/dist/{impl-7YqcGwra.mjs → impl-BoLR69pK.mjs} +2 -2
  49. package/dist/{impl-7YqcGwra.mjs.map → impl-BoLR69pK.mjs.map} +1 -1
  50. package/dist/{impl-DRmJog0S2.mjs → impl-C4sn-3gC2.mjs} +2 -2
  51. package/dist/{impl-DRmJog0S2.mjs.map → impl-C4sn-3gC2.mjs.map} +1 -1
  52. package/dist/{impl-BPdvRtQ9.mjs → impl-C8Ft1xEP.mjs} +2 -2
  53. package/dist/{impl-BPdvRtQ9.mjs.map → impl-C8Ft1xEP.mjs.map} +1 -1
  54. package/dist/{impl-DGm6q0bm.mjs → impl-CEX3vttu.mjs} +2 -2
  55. package/dist/{impl-DGm6q0bm.mjs.map → impl-CEX3vttu.mjs.map} +1 -1
  56. package/dist/{impl-CtMcCdUA.mjs → impl-CQI_neVJ.mjs} +2 -2
  57. package/dist/{impl-CtMcCdUA.mjs.map → impl-CQI_neVJ.mjs.map} +1 -1
  58. package/dist/{impl-xR4iG_u5.mjs → impl-CdvjzYeu.mjs} +2 -2
  59. package/dist/{impl-xR4iG_u5.mjs.map → impl-CdvjzYeu.mjs.map} +1 -1
  60. package/dist/{impl-CKeiISid.mjs → impl-CiGah6mv.mjs} +2 -2
  61. package/dist/{impl-CKeiISid.mjs.map → impl-CiGah6mv.mjs.map} +1 -1
  62. package/dist/{impl-DDsOdK7O.mjs → impl-CnE2Ph2T.mjs} +2 -2
  63. package/dist/{impl-DDsOdK7O.mjs.map → impl-CnE2Ph2T.mjs.map} +1 -1
  64. package/dist/{impl-CwWY8MCP.mjs → impl-CszgclpX.mjs} +2 -2
  65. package/dist/{impl-CwWY8MCP.mjs.map → impl-CszgclpX.mjs.map} +1 -1
  66. package/dist/{impl-yJETNVcT.mjs → impl-DBp-O291.mjs} +2 -2
  67. package/dist/{impl-yJETNVcT.mjs.map → impl-DBp-O291.mjs.map} +1 -1
  68. package/dist/{impl-qTeP2Voo2.mjs → impl-DD_MeWsL2.mjs} +2 -2
  69. package/dist/{impl-qTeP2Voo2.mjs.map → impl-DD_MeWsL2.mjs.map} +1 -1
  70. package/dist/{impl-CwjhuIx0.mjs → impl-DJ3dRBFE.mjs} +2 -2
  71. package/dist/{impl-CwjhuIx0.mjs.map → impl-DJ3dRBFE.mjs.map} +1 -1
  72. package/dist/{impl-CPyd-ahE.mjs → impl-DNHK5CZt.mjs} +2 -2
  73. package/dist/{impl-CPyd-ahE.mjs.map → impl-DNHK5CZt.mjs.map} +1 -1
  74. package/dist/{impl-C36c5NfN.mjs → impl-DUYRVzMo.mjs} +2 -2
  75. package/dist/{impl-C36c5NfN.mjs.map → impl-DUYRVzMo.mjs.map} +1 -1
  76. package/dist/{impl-D-Cz399O.mjs → impl-DXF2BvZk.mjs} +2 -2
  77. package/dist/{impl-D-Cz399O.mjs.map → impl-DXF2BvZk.mjs.map} +1 -1
  78. package/dist/{impl-Cx97QWq8.mjs → impl-DdzqhQ1G.mjs} +2 -2
  79. package/dist/{impl-Cx97QWq8.mjs.map → impl-DdzqhQ1G.mjs.map} +1 -1
  80. package/dist/{impl-DFhAp1Ky.mjs → impl-DhRoKdr5.mjs} +2 -2
  81. package/dist/{impl-DFhAp1Ky.mjs.map → impl-DhRoKdr5.mjs.map} +1 -1
  82. package/dist/{impl-CKlQglut.mjs → impl-Dw4dUDc_.mjs} +2 -2
  83. package/dist/{impl-CKlQglut.mjs.map → impl-Dw4dUDc_.mjs.map} +1 -1
  84. package/dist/{impl-B8PyNdje2.mjs → impl-DxrqGYjm2.mjs} +2 -2
  85. package/dist/{impl-B8PyNdje2.mjs.map → impl-DxrqGYjm2.mjs.map} +1 -1
  86. package/dist/{impl-Bs4T0u8t.mjs → impl-Dxzy0Ksg.mjs} +2 -2
  87. package/dist/{impl-Bs4T0u8t.mjs.map → impl-Dxzy0Ksg.mjs.map} +1 -1
  88. package/dist/{impl-Ds6ROQi7.mjs → impl-DzwqivKg.mjs} +2 -2
  89. package/dist/{impl-Ds6ROQi7.mjs.map → impl-DzwqivKg.mjs.map} +1 -1
  90. package/dist/{impl-DT4VbZ-Q2.mjs → impl-GGs8OmpV2.mjs} +2 -2
  91. package/dist/{impl-DT4VbZ-Q2.mjs.map → impl-GGs8OmpV2.mjs.map} +1 -1
  92. package/dist/{impl-BtIse0WU.mjs → impl-GWNrdIf0.mjs} +2 -2
  93. package/dist/{impl-BtIse0WU.mjs.map → impl-GWNrdIf0.mjs.map} +1 -1
  94. package/dist/{impl-2YeOxW2m.mjs → impl-KwUoQ4Mi.mjs} +2 -2
  95. package/dist/{impl-2YeOxW2m.mjs.map → impl-KwUoQ4Mi.mjs.map} +1 -1
  96. package/dist/{impl-BIYT-9BY.mjs → impl-QVaJa-ut.mjs} +2 -2
  97. package/dist/{impl-BIYT-9BY.mjs.map → impl-QVaJa-ut.mjs.map} +1 -1
  98. package/dist/{impl-DPb4YZxb.mjs → impl-TeuLYZCx.mjs} +2 -2
  99. package/dist/{impl-DPb4YZxb.mjs.map → impl-TeuLYZCx.mjs.map} +1 -1
  100. package/dist/{impl-DG-041kN.mjs → impl-VgI7mr67.mjs} +2 -2
  101. package/dist/{impl-DG-041kN.mjs.map → impl-VgI7mr67.mjs.map} +1 -1
  102. package/dist/{impl-P1hltmA6.mjs → impl-Y5rjrfgs.mjs} +2 -2
  103. package/dist/{impl-P1hltmA6.mjs.map → impl-Y5rjrfgs.mjs.map} +1 -1
  104. package/dist/{impl-BP110k4H.mjs → impl-ZtYIzB9o.mjs} +2 -2
  105. package/dist/{impl-BP110k4H.mjs.map → impl-ZtYIzB9o.mjs.map} +1 -1
  106. package/dist/{impl-defjX-97.mjs → impl-qNF5eqX-.mjs} +2 -2
  107. package/dist/{impl-defjX-97.mjs.map → impl-qNF5eqX-.mjs.map} +1 -1
  108. package/dist/{impl-BUJbKCd4.mjs → impl-sEJHkjPw.mjs} +2 -2
  109. package/dist/{impl-BUJbKCd4.mjs.map → impl-sEJHkjPw.mjs.map} +1 -1
  110. package/dist/{impl-XztvsE6N.mjs → impl-tNT_EfWf.mjs} +2 -2
  111. package/dist/{impl-XztvsE6N.mjs.map → impl-tNT_EfWf.mjs.map} +1 -1
  112. package/dist/{impl-CFyD51rZ.mjs → impl-w6TtbzCB.mjs} +2 -2
  113. package/dist/{impl-CFyD51rZ.mjs.map → impl-w6TtbzCB.mjs.map} +1 -1
  114. package/dist/index.mjs +1 -1
  115. package/dist/{markRequestDataSiloIdsCompleted-CU0ba_mE.mjs → markRequestDataSiloIdsCompleted-63FCcKgi.mjs} +2 -2
  116. package/dist/{markRequestDataSiloIdsCompleted-CU0ba_mE.mjs.map → markRequestDataSiloIdsCompleted-63FCcKgi.mjs.map} +1 -1
  117. package/dist/{markSilentPrivacyRequests-Bf_4pCaq.mjs → markSilentPrivacyRequests--bQ3UAKC.mjs} +2 -2
  118. package/dist/{markSilentPrivacyRequests-Bf_4pCaq.mjs.map → markSilentPrivacyRequests--bQ3UAKC.mjs.map} +1 -1
  119. package/dist/{notifyPrivacyRequestsAdditionalTime-rnUXdvBR.mjs → notifyPrivacyRequestsAdditionalTime-DQ9_6DaJ.mjs} +2 -2
  120. package/dist/{notifyPrivacyRequestsAdditionalTime-rnUXdvBR.mjs.map → notifyPrivacyRequestsAdditionalTime-DQ9_6DaJ.mjs.map} +1 -1
  121. package/dist/{policy-bundle-manifest-B1Herd_n.mjs → policy-bundle-manifest-C8Oqz895.mjs} +2 -2
  122. package/dist/{policy-bundle-manifest-B1Herd_n.mjs.map → policy-bundle-manifest-C8Oqz895.mjs.map} +1 -1
  123. package/dist/{policy-project-discovery-oc49b2gr.mjs → policy-project-discovery-BR9EiTHd.mjs} +2 -2
  124. package/dist/{policy-project-discovery-oc49b2gr.mjs.map → policy-project-discovery-BR9EiTHd.mjs.map} +1 -1
  125. package/dist/{policy-scaffold-config-CpXR9KgF.mjs → policy-scaffold-config-CLIwzEFs.mjs} +4 -2
  126. package/dist/policy-scaffold-config-CLIwzEFs.mjs.map +1 -0
  127. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-BcBj9prQ.mjs → pullChunkedCustomSiloOutstandingIdentifiers-B0TFbcgJ.mjs} +2 -2
  128. package/dist/{pullChunkedCustomSiloOutstandingIdentifiers-BcBj9prQ.mjs.map → pullChunkedCustomSiloOutstandingIdentifiers-B0TFbcgJ.mjs.map} +1 -1
  129. package/dist/{pullManualEnrichmentIdentifiersToCsv-BSUXUp8v.mjs → pullManualEnrichmentIdentifiersToCsv-Bbg5FOIJ.mjs} +2 -2
  130. package/dist/{pullManualEnrichmentIdentifiersToCsv-BSUXUp8v.mjs.map → pullManualEnrichmentIdentifiersToCsv-Bbg5FOIJ.mjs.map} +1 -1
  131. package/dist/{pushCronIdentifiersFromCsv-D-l3erLO.mjs → pushCronIdentifiersFromCsv-DLmgvrjn.mjs} +2 -2
  132. package/dist/{pushCronIdentifiersFromCsv-D-l3erLO.mjs.map → pushCronIdentifiersFromCsv-DLmgvrjn.mjs.map} +1 -1
  133. package/dist/{pushManualEnrichmentIdentifiersFromCsv-CqLIw5MV.mjs → pushManualEnrichmentIdentifiersFromCsv-Cih6wgBt.mjs} +2 -2
  134. package/dist/{pushManualEnrichmentIdentifiersFromCsv-CqLIw5MV.mjs.map → pushManualEnrichmentIdentifiersFromCsv-Cih6wgBt.mjs.map} +1 -1
  135. package/dist/{removeUnverifiedRequestIdentifiers-B-Az2HJ8.mjs → removeUnverifiedRequestIdentifiers-DkbeJa9c.mjs} +2 -2
  136. package/dist/{removeUnverifiedRequestIdentifiers-B-Az2HJ8.mjs.map → removeUnverifiedRequestIdentifiers-DkbeJa9c.mjs.map} +1 -1
  137. package/dist/resolveBundleIdByName-D7NUOpLc.mjs +2 -0
  138. package/dist/resolveBundleIdByName-D7NUOpLc.mjs.map +1 -0
  139. package/dist/resolvePolicyBundleVersion-CKbF9vqc.mjs +2 -0
  140. package/dist/resolvePolicyBundleVersion-CKbF9vqc.mjs.map +1 -0
  141. package/dist/{retryRequestDataSilos-D70pC9JF.mjs → retryRequestDataSilos-MxpSNKuV.mjs} +2 -2
  142. package/dist/{retryRequestDataSilos-D70pC9JF.mjs.map → retryRequestDataSilos-MxpSNKuV.mjs.map} +1 -1
  143. package/dist/{scaffold-planning-CaetLfv8.mjs → scaffold-planning-BrX-pcz6.mjs} +3 -1
  144. package/dist/scaffold-planning-BrX-pcz6.mjs.map +1 -0
  145. package/dist/{skipPreflightJobs-B0YG7mhP.mjs → skipPreflightJobs-enp_ioAV.mjs} +2 -2
  146. package/dist/{skipPreflightJobs-B0YG7mhP.mjs.map → skipPreflightJobs-enp_ioAV.mjs.map} +1 -1
  147. package/dist/{skipRequestDataSilos-DV5Dy5Dw.mjs → skipRequestDataSilos-B23W9ZJe.mjs} +2 -2
  148. package/dist/{skipRequestDataSilos-DV5Dy5Dw.mjs.map → skipRequestDataSilos-B23W9ZJe.mjs.map} +1 -1
  149. package/dist/{streamPrivacyRequestsToCsv-Qm2r7Iy2.mjs → streamPrivacyRequestsToCsv-Cx5QIQT6.mjs} +2 -2
  150. package/dist/{streamPrivacyRequestsToCsv-Qm2r7Iy2.mjs.map → streamPrivacyRequestsToCsv-Cx5QIQT6.mjs.map} +1 -1
  151. package/dist/{updateConsentManagerVersionToLatest-cryDInky.mjs → updateConsentManagerVersionToLatest-B2Ke4QhR.mjs} +2 -2
  152. package/dist/{updateConsentManagerVersionToLatest-cryDInky.mjs.map → updateConsentManagerVersionToLatest-B2Ke4QhR.mjs.map} +1 -1
  153. package/dist/{uploadConsents-Din2Qdws.mjs → uploadConsents-BkvhwPJ6.mjs} +2 -2
  154. package/dist/{uploadConsents-Din2Qdws.mjs.map → uploadConsents-BkvhwPJ6.mjs.map} +1 -1
  155. package/dist/{uploadPrivacyRequestsFromCsv-DHYbgV8h.mjs → uploadPrivacyRequestsFromCsv-BGv8UH5q.mjs} +2 -2
  156. package/dist/{uploadPrivacyRequestsFromCsv-DHYbgV8h.mjs.map → uploadPrivacyRequestsFromCsv-BGv8UH5q.mjs.map} +1 -1
  157. package/package.json +1 -1
  158. package/dist/policy-scaffold-config-CpXR9KgF.mjs.map +0 -1
  159. package/dist/resolveBundleIdByName-BPrMkU0w.mjs +0 -2
  160. package/dist/resolveBundleIdByName-BPrMkU0w.mjs.map +0 -1
  161. package/dist/resolvePolicyBundleVersion-BrVz4LKN.mjs +0 -2
  162. package/dist/resolvePolicyBundleVersion-BrVz4LKN.mjs.map +0 -1
  163. package/dist/scaffold-planning-CaetLfv8.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolveBundleIdByName-BPrMkU0w.mjs","names":[],"sources":["../src/commands/policy/helpers/resolveBundleIdByName.ts"],"sourcesContent":["import type { Got } from 'got';\n\nimport type { PolicyBundle, PolicyBundleListResponse } from '../types.js';\nimport { policyEngineRequest } from './formatPolicyEngineRequestError.js';\n\n/**\n * Resolves a bundle name to its parent record via the bundleName list filter.\n *\n * @param client - Policy Engine REST client\n * @param bundleName - Bundle name to resolve\n * @returns Matching bundle when found\n */\nexport async function resolveBundleByName(\n client: Got,\n bundleName: string,\n): Promise<PolicyBundle | undefined> {\n const body = await policyEngineRequest(\n client\n .get('v1/policy-engine/policy-bundles', {\n searchParams: { 'filter[bundleName]': bundleName, limit: 1, offset: 0 },\n })\n .json<PolicyBundleListResponse>(),\n );\n\n return body.nodes[0];\n}\n\n/**\n * Resolves a bundle name to its UUID via the bundleName list filter.\n *\n * @param client - Policy Engine REST client\n * @param bundleName - Bundle name to resolve\n * @returns Bundle UUID when found\n */\nexport async function resolveBundleIdByName(\n client: Got,\n bundleName: string,\n): Promise<string | undefined> {\n const bundle = await resolveBundleByName(client, bundleName);\n return bundle?.id;\n}\n"],"mappings":"+CAYA,eAAsB,EACpB,EACA,EACmC,CASnC,OAAO,MARY,EACjB,EACG,IAAI,kCAAmC,CACtC,aAAc,CAAE,qBAAsB,EAAY,MAAO,EAAG,OAAQ,EAAG,CACxE,CAAC,CACD,MAAgC,CACpC,EAEW,MAAM,GAUpB,eAAsB,EACpB,EACA,EAC6B,CAE7B,OAAO,MADc,EAAoB,EAAQ,EAAW,GAC7C"}
@@ -1,2 +0,0 @@
1
- import{n as e,r as t}from"./printResult-Dmwv78e7.mjs";function n(e){return{id:e.versionId,version:e.version,sha256:e.sha256,sizeBytes:e.sizeBytes,description:e.description,createdBy:``,activatedAt:e.activatedAt,deactivatedAt:e.deactivatedAt,createdAt:e.uploadedAt,updatedAt:e.uploadedAt}}async function r(t,n,r){return(await e(t.get(`v1/policy-engine/policy-bundles/${n}/versions`,{searchParams:r}).json())).nodes[0]}async function i(r,i,a){let o;try{o=await r.get(`v1/policy-engine/policy-bundle-versions/${a}`).json()}catch(e){if(e&&typeof e==`object`&&`response`in e&&e.response?.statusCode===404)throw Error(`Version id "${a}" was not found for this policy bundle.`);t(e)}let s=await e(r.get(`v1/policy-engine/policy-bundles/${i}`).json());if(o.bundleName!==s.bundleName)throw Error(`Version id "${a}" was not found for this policy bundle.`);return n(o)}async function a(e,t,n){if(n.versionId)return i(e,t,n.versionId);let a={limit:1};n.version&&(a[`filter[version]`]=n.version);let o=await r(e,t,a);if(!o)throw n.version?Error(`Version "${n.version}" was not found for this policy bundle.`):Error(`No versions found for this policy bundle.`);return o}export{a as t};
2
- //# sourceMappingURL=resolvePolicyBundleVersion-BrVz4LKN.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolvePolicyBundleVersion-BrVz4LKN.mjs","names":[],"sources":["../src/commands/policy/helpers/resolvePolicyBundleVersion.ts"],"sourcesContent":["import type { Got } from 'got';\n\nimport type {\n GetPolicyBundleVersionResponse,\n PolicyBundle,\n PolicyBundleVersion,\n PolicyBundleVersionListResponse,\n} from '../types.js';\nimport {\n policyEngineRequest,\n throwPolicyEngineRequestError,\n} from './formatPolicyEngineRequestError.js';\n\n/** Options for resolving a policy bundle version. */\nexport interface ResolvePolicyBundleVersionOptions {\n /** Caller-supplied version label; omitted to pick the latest by createdAt */\n version?: string;\n /** Version UUID */\n versionId?: string;\n}\n\n/**\n * Maps a direct version-by-id API response to the canonical version record shape.\n *\n * @param body - Version metadata from `GET /policy-bundle-versions/:versionId`\n * @returns Version record used by CLI commands\n */\nfunction mapGetPolicyBundleVersionResponse(\n body: GetPolicyBundleVersionResponse,\n): PolicyBundleVersion {\n return {\n id: body.versionId,\n version: body.version,\n sha256: body.sha256,\n sizeBytes: body.sizeBytes,\n description: body.description,\n createdBy: '',\n activatedAt: body.activatedAt,\n deactivatedAt: body.deactivatedAt,\n createdAt: body.uploadedAt,\n updatedAt: body.uploadedAt,\n };\n}\n\n/**\n * Fetches a version scoped to a parent bundle via list filters or direct id lookup.\n *\n * @param client - Policy Engine REST client\n * @param bundleId - Parent bundle UUID\n * @param searchParams - List endpoint query parameters\n * @returns First matching version on the page\n */\nasync function fetchPolicyBundleVersionPage(\n client: Got,\n bundleId: string,\n searchParams: Record<string, string | number>,\n): Promise<PolicyBundleVersion | undefined> {\n const body = await policyEngineRequest(\n client\n .get(`v1/policy-engine/policy-bundles/${bundleId}/versions`, {\n searchParams,\n })\n .json<PolicyBundleVersionListResponse>(),\n );\n\n return body.nodes[0];\n}\n\n/**\n * Resolves a version by UUID and verifies it belongs to the given parent bundle.\n *\n * @param client - Policy Engine REST client\n * @param bundleId - Parent bundle UUID\n * @param versionId - Version UUID\n * @returns Matching version record\n */\nasync function resolvePolicyBundleVersionById(\n client: Got,\n bundleId: string,\n versionId: string,\n): Promise<PolicyBundleVersion> {\n let body: GetPolicyBundleVersionResponse;\n try {\n body = await client\n .get(`v1/policy-engine/policy-bundle-versions/${versionId}`)\n .json<GetPolicyBundleVersionResponse>();\n } catch (error) {\n if (\n error &&\n typeof error === 'object' &&\n 'response' in error &&\n (error as { response?: { statusCode?: number } }).response?.statusCode === 404\n ) {\n throw new Error(`Version id \"${versionId}\" was not found for this policy bundle.`);\n }\n throwPolicyEngineRequestError(error);\n }\n\n const bundle = await policyEngineRequest(\n client.get(`v1/policy-engine/policy-bundles/${bundleId}`).json<PolicyBundle>(),\n );\n\n if (body.bundleName !== bundle.bundleName) {\n throw new Error(`Version id \"${versionId}\" was not found for this policy bundle.`);\n }\n\n return mapGetPolicyBundleVersionResponse(body);\n}\n\n/**\n * Resolves a version label or UUID to a version record, or picks the latest by createdAt.\n *\n * @param client - Policy Engine REST client\n * @param bundleId - Parent bundle UUID\n * @param options - Version lookup options\n * @returns Matching or latest version record\n */\nexport async function resolvePolicyBundleVersion(\n client: Got,\n bundleId: string,\n options: ResolvePolicyBundleVersionOptions,\n): Promise<PolicyBundleVersion> {\n if (options.versionId) {\n return resolvePolicyBundleVersionById(client, bundleId, options.versionId);\n }\n\n const searchParams: Record<string, string | number> = { limit: 1 };\n if (options.version) {\n searchParams['filter[version]'] = options.version;\n }\n\n const match = await fetchPolicyBundleVersionPage(client, bundleId, searchParams);\n\n if (!match) {\n if (options.version) {\n throw new Error(`Version \"${options.version}\" was not found for this policy bundle.`);\n }\n throw new Error('No versions found for this policy bundle.');\n }\n\n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CUSTOM_FUNCTION_SETUP_REFERENCE_MD","CUSTOM_FUNCTION_WRITING_REFERENCE_MD"],"sources":["../../../skills/transcend-custom-functions/references/setup.md","../../../skills/transcend-custom-functions/references/writing-custom-functions.md","../../../skills/transcend-custom-functions/SKILL.md","../src/lib/custom-functions/custom-function-skill.ts","../src/lib/custom-functions/ai-handoff.ts","../src/lib/custom-functions/scaffold-output.ts","../src/lib/custom-functions/scaffold-artifacts.ts","../src/lib/custom-functions/scaffold-config.ts","../src/lib/custom-functions/scaffold-planning.ts"],"sourcesContent":[null,null,null,"import CUSTOM_FUNCTION_SETUP_REFERENCE_MD from '../../../../../skills/transcend-custom-functions/references/setup.md';\nimport CUSTOM_FUNCTION_WRITING_REFERENCE_MD from '../../../../../skills/transcend-custom-functions/references/writing-custom-functions.md';\nimport CUSTOM_FUNCTION_SKILL_MD from '../../../../../skills/transcend-custom-functions/SKILL.md';\nimport type { AgentSkillFile } from '../scaffolding/agent-skill.js';\n\n/** Namespaced directory and frontmatter name for the installed Agent Skill. */\nexport const CUSTOM_FUNCTION_SKILL_NAME = 'transcend-custom-functions';\n\nexport {\n CUSTOM_FUNCTION_SETUP_REFERENCE_MD,\n CUSTOM_FUNCTION_SKILL_MD,\n CUSTOM_FUNCTION_WRITING_REFERENCE_MD,\n};\n\n/** Complete portable Agent Skill file set. */\nexport const CUSTOM_FUNCTION_SKILL_FILES: readonly AgentSkillFile[] = [\n { path: 'SKILL.md', contents: CUSTOM_FUNCTION_SKILL_MD },\n { path: 'references/setup.md', contents: CUSTOM_FUNCTION_SETUP_REFERENCE_MD },\n {\n path: 'references/writing-custom-functions.md',\n contents: CUSTOM_FUNCTION_WRITING_REFERENCE_MD,\n },\n];\n","import { quoteShellArgument } from '../scaffolding/project-plan-output.js';\nimport { CUSTOM_FUNCTION_SKILL_NAME } from './custom-function-skill.js';\nimport { SUPPORTED_DENO_MAJOR_VERSION } from './deno-runtime.js';\nimport { buildCustomFunctionProjectArguments, buildPlaceholderVariablesArgument } from './paths.js';\n\n/**\n * Build a compact AI handoff after project initialization.\n *\n * @param options - Generated setup context\n * @returns Copyable agent instruction\n */\nexport function buildInitAiHandoff(options: {\n /** Display path to the Custom Function project. */\n targetDirectory: string;\n /** Display path to the manifest. */\n manifestPath: string;\n /** Exact CLI version used by generated CI. */\n cliVersion: string;\n /** Whether the authoring skill was installed. */\n hasSkill: boolean;\n /** Whether a GitHub Actions workflow was generated. */\n hasGithubWorkflow: boolean;\n}): string {\n const prefix = options.hasSkill\n ? `Use the \\`${CUSTOM_FUNCTION_SKILL_NAME}\\` skill to`\n : 'Ask your coding agent to';\n const checkCommand = `transcend custom-functions check ${buildCustomFunctionProjectArguments(\n options.targetDirectory,\n options.manifestPath,\n )} --noInteractive`;\n if (options.hasGithubWorkflow) {\n return `${prefix} review the Custom Function setup in \\`${options.targetDirectory}\\`, adapt the generated GitHub Actions workflow to this repository's conventions, and run \\`${checkCommand}\\`.`;\n }\n return `${prefix} review the Custom Function setup in \\`${options.targetDirectory}\\` and add equivalent CI for this repository: install Deno ${SUPPORTED_DENO_MAJOR_VERSION} and \\`@transcend-io/cli@${options.cliVersion}\\`, then run \\`${checkCommand}\\`.`;\n}\n\n/**\n * Build a compact AI handoff after adding one function.\n *\n * @param options - Generated function context\n * @returns Copyable agent instruction\n */\nexport function buildNewFunctionAiHandoff(options: {\n /** Customer-visible function name. */\n displayName: string;\n /** Display path to the generated source. */\n sourcePath: string;\n /** Display path to the Custom Function project. */\n targetDirectory: string;\n /** Display path to the selected manifest. */\n manifestPath: string;\n /** Whether the authoring skill is expected in this project. */\n hasSkill: boolean;\n /** Manifest variables required by this function. */\n variableNames: readonly string[];\n}): string {\n const prefix = options.hasSkill\n ? `Use the \\`${CUSTOM_FUNCTION_SKILL_NAME}\\` skill to`\n : 'Ask your coding agent to';\n const variablesArgument = buildPlaceholderVariablesArgument(options.variableNames);\n const checkCommand = `transcend custom-functions check ${buildCustomFunctionProjectArguments(\n options.targetDirectory,\n options.manifestPath,\n )}${variablesArgument}`;\n const runCommand =\n `transcend custom-functions run ` +\n `${buildCustomFunctionProjectArguments(options.targetDirectory, options.manifestPath)} ` +\n `--function=${quoteShellArgument(options.displayName)}${variablesArgument}`;\n return `${prefix} implement \\`${options.displayName}\\` in \\`${options.sourcePath}\\`, replace the example fixtures with realistic cases, run \\`${runCommand}\\` to exercise it locally, and finish with \\`${checkCommand}\\`.`;\n}\n","import {\n toPublicPlannedChange,\n type PublicPlannedChange,\n} from '../scaffolding/project-plan-output.js';\nimport type { CustomFunctionProjectPlan } from './scaffold-model.js';\n\n/** Stable JSON scaffold result. */\nexport interface CustomFunctionPlanResult {\n /** JSON contract version. */\n version: number;\n /** Command that produced the plan. */\n command: 'init' | 'new';\n /** Whether the plan was applied. */\n applied: boolean;\n /** Whether this was a dry run. */\n dryRun: boolean;\n /** Absolute target directory. */\n targetDirectory: string;\n /** Absolute manifest path. */\n manifestPath: string;\n /** Planned mutations without file contents. */\n changes: PublicPlannedChange[];\n /** Non-fatal warnings. */\n warnings: string[];\n /** Suggested next commands. */\n nextSteps: string[];\n /** Compact prompt for continuing with a coding agent. */\n aiHandoff: string;\n}\n\n/**\n * Build the stable machine-readable scaffold result.\n *\n * @param plan - Project plan\n * @param options - Apply state\n * @returns JSON result\n */\nexport function buildPlanResult(\n plan: CustomFunctionProjectPlan,\n options: {\n /** Whether the plan was applied. */\n applied: boolean;\n /** Whether the invocation was a dry run. */\n dryRun: boolean;\n /** Working directory for portable paths. */\n cwd: string;\n /** Compact prompt for continuing with a coding agent. */\n aiHandoff: string;\n },\n): CustomFunctionPlanResult {\n return {\n version: plan.version,\n command: plan.command,\n applied: options.applied,\n dryRun: options.dryRun,\n targetDirectory: plan.targetDirectory,\n manifestPath: plan.manifestPath,\n changes: plan.changes.map((change) => toPublicPlannedChange(options.cwd, change)),\n warnings: plan.warnings,\n nextSteps: plan.nextSteps,\n aiHandoff: options.aiHandoff,\n };\n}\n","import { createHash } from 'node:crypto';\n\nimport { RECOMMENDED_DENO_VERSION } from './deno-runtime.js';\n\n/** Immutable actions/checkout v6 release commit. */\nconst ACTIONS_CHECKOUT_SHA = 'd23441a48e516b6c34aea4fa41551a30e30af803';\n\n/** Immutable denoland/setup-deno v2.0.5 release commit. */\nconst SETUP_DENO_SHA = '22d081ff2d3a40755e97629de92e3bcbfa7cf2ed';\n\n/**\n * Escape a repository path before embedding intentional GitHub glob syntax.\n *\n * @param path - Literal repository-relative path\n * @returns Path with GitHub glob metacharacters escaped\n */\nfunction escapeGithubPath(path: string): string {\n return path.replace(/([!*?[\\]\\\\])/gu, '\\\\$1');\n}\n\n/**\n * Check whether a generated workflow still matches its ownership digest.\n *\n * @param contents - Existing workflow\n * @returns Whether automatic replacement is safe\n */\nexport function isUnmodifiedCustomFunctionWorkflow(contents: string): boolean {\n const marker = contents.match(\n /# managed-by: @transcend-io\\/cli; content-sha256: ([a-f0-9]{64})\\s*$/u,\n );\n if (!marker || marker.index === undefined) {\n return false;\n }\n const body = contents.slice(0, marker.index).trimEnd();\n return createHash('sha256').update(body).digest('hex') === marker[1];\n}\n\n/**\n * Generate the conservative Custom Function GitHub Actions workflow.\n *\n * @param options - Workflow paths and pinned CLI version\n * @returns Workflow YAML\n */\nexport function generateGithubActionsWorkflow(options: {\n /** Exact released CLI version. */\n cliVersion: string;\n /** Target directory relative to the repository root. */\n targetDirectory: string;\n /** Manifest directory where generated source, payload, and Deno files live. */\n contentDirectory?: string;\n /** Manifest path relative to the repository root. */\n manifestPath: string;\n /** Additional manifest-referenced files that should trigger validation. */\n watchedPaths?: readonly string[];\n}): string {\n const { cliVersion, targetDirectory, manifestPath } = options;\n const contentDirectory = options.contentDirectory ?? targetDirectory;\n const pathPrefix =\n contentDirectory === '.' ? '' : `${escapeGithubPath(contentDirectory.replace(/\\/+$/u, ''))}/`;\n const watchedPaths = [\n `${pathPrefix}functions/**`,\n `${pathPrefix}test-payloads/**`,\n escapeGithubPath(manifestPath),\n `${pathPrefix}deno.json*`,\n ...(options.watchedPaths ?? []).map(escapeGithubPath),\n ].filter((path, index, paths) => paths.indexOf(path) === index);\n const pathFilters = watchedPaths.map((path) => ` - ${JSON.stringify(path)}`).join('\\n');\n const body = `# Generated by transcend custom-functions init.\nname: Transcend Custom Functions\n\non:\n pull_request:\n paths:\n${pathFilters}\n push:\n paths:\n${pathFilters}\n\npermissions:\n contents: read\n\njobs:\n check:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@${ACTIONS_CHECKOUT_SHA} # v6\n - uses: denoland/setup-deno@${SETUP_DENO_SHA} # v2.0.5\n with:\n deno-version: ${RECOMMENDED_DENO_VERSION}\n - name: Install the Transcend CLI\n run: npm install --global @transcend-io/cli@${cliVersion}\n - name: Validate Custom Functions\n env:\n CUSTOM_FUNCTION_DIRECTORY: ${JSON.stringify(targetDirectory)}\n CUSTOM_FUNCTION_MANIFEST: ${JSON.stringify(manifestPath)}\n run: >-\n transcend custom-functions check \"$CUSTOM_FUNCTION_DIRECTORY\"\n --manifest=\"$CUSTOM_FUNCTION_MANIFEST\"\n --variables=TRANSCEND_API_KEY:placeholder\n --noInteractive\n --json\n`;\n const digest = createHash('sha256').update(body.trimEnd()).digest('hex');\n return `${body.trimEnd()}\\n\\n# managed-by: @transcend-io/cli; content-sha256: ${digest}\\n`;\n}\n","import { relative, sep } from 'node:path';\n\nimport {\n mergeJsonc,\n mergeStringArray,\n parseJsoncObject,\n type JsoncUpdate,\n} from '../scaffolding/jsonc.js';\nimport { buildCustomFunctionProjectArguments } from './paths.js';\n\n/**\n * Build target-scoped Deno authoring configuration.\n *\n * @param contents - Existing deno.json/jsonc contents\n * @param contractVersion - Exact authoring-contract version\n * @param manifestFileName - Manifest path relative to this Deno configuration\n * @param referencedPaths - Existing manifest-relative source and payload paths\n * @returns Merged configuration\n */\nexport function mergeDenoConfiguration(\n contents: string | null,\n contractVersion: string,\n manifestFileName = 'transcend-functions.yml',\n referencedPaths: {\n /** Existing source paths. */\n sources?: readonly string[];\n /** Existing payload paths. */\n payloads?: readonly string[];\n } = {},\n): string {\n const current = parseJsoncObject(contents ?? '{}\\n', 'Deno configuration');\n const compilerOptions =\n current.compilerOptions &&\n typeof current.compilerOptions === 'object' &&\n !Array.isArray(current.compilerOptions)\n ? (current.compilerOptions as Record<string, unknown>)\n : {};\n const lint =\n current.lint && typeof current.lint === 'object' && !Array.isArray(current.lint)\n ? (current.lint as Record<string, unknown>)\n : {};\n const fmt =\n current.fmt && typeof current.fmt === 'object' && !Array.isArray(current.fmt)\n ? (current.fmt as Record<string, unknown>)\n : {};\n const tasks =\n current.tasks && typeof current.tasks === 'object' && !Array.isArray(current.tasks)\n ? (current.tasks as Record<string, unknown>)\n : {};\n const taskName = 'custom-functions:check';\n const legacyTaskCommand =\n 'deno check functions/**/*.ts && deno lint functions/ && deno fmt --check functions/ test-payloads/';\n const previousTaskCommand = `transcend custom-functions check ${buildCustomFunctionProjectArguments(\n '.',\n manifestFileName,\n )} --noInteractive`;\n const taskCommand = `transcend custom-functions check ${buildCustomFunctionProjectArguments(\n '.',\n manifestFileName,\n )} --variables=TRANSCEND_API_KEY:placeholder --noInteractive`;\n if (\n tasks[taskName] !== undefined &&\n tasks[taskName] !== legacyTaskCommand &&\n tasks[taskName] !== previousTaskCommand &&\n tasks[taskName] !== taskCommand\n ) {\n throw new Error(\n `Deno task \"${taskName}\" already has a different command; apply the patch manually.`,\n );\n }\n const updates: JsoncUpdate[] = [\n {\n path: ['imports', '@transcend-io/custom-function-types'],\n value: `npm:@transcend-io/custom-function-types@${contractVersion}`,\n },\n { path: ['compilerOptions', 'strict'], value: true },\n {\n path: ['compilerOptions', 'lib'],\n value: mergeStringArray(compilerOptions.lib, ['deno.ns', 'dom', 'dom.iterable', 'esnext']),\n },\n {\n path: ['lint', 'include'],\n value: mergeStringArray(lint.include, ['functions/', ...(referencedPaths.sources ?? [])]),\n },\n {\n path: ['fmt', 'include'],\n value: mergeStringArray(fmt.include, [\n 'functions/',\n 'test-payloads/',\n manifestFileName,\n ...(referencedPaths.sources ?? []),\n ...(referencedPaths.payloads ?? []),\n ]),\n },\n { path: ['fmt', 'singleQuote'], value: true },\n { path: ['fmt', 'lineWidth'], value: 100 },\n { path: ['tasks', taskName], value: taskCommand },\n ];\n return mergeJsonc(contents, updates, 'Deno configuration');\n}\n\n/**\n * Merge VS Code-compatible Deno settings scoped to the target.\n *\n * @param contents - Existing settings JSONC\n * @param repositoryRoot - Repository root\n * @param targetDirectory - Custom Function project directory\n * @returns Merged settings\n */\nexport function mergeEditorSettings(\n contents: string | null,\n repositoryRoot: string,\n targetDirectory: string,\n): string {\n const current = parseJsoncObject(contents ?? '{}\\n', 'editor settings');\n const target = relative(repositoryRoot, targetDirectory).split(sep).join('/') || '.';\n return mergeJsonc(\n contents,\n [\n { path: ['deno.enable'], value: true },\n {\n path: ['deno.enablePaths'],\n value: mergeStringArray(current['deno.enablePaths'], [target]),\n },\n ],\n 'editor settings',\n );\n}\n\n/**\n * Merge the recommended Deno editor extension.\n *\n * @param contents - Existing extensions JSONC\n * @returns Merged extensions\n */\nexport function mergeEditorExtensions(contents: string | null): string {\n const current = parseJsoncObject(contents ?? '{}\\n', 'editor extension recommendations');\n return mergeJsonc(\n contents,\n [\n {\n path: ['recommendations'],\n value: mergeStringArray(current.recommendations, ['denoland.vscode-deno']),\n },\n ],\n 'editor extension recommendations',\n );\n}\n","import { basename, isAbsolute, join, relative, resolve, sep } from 'node:path';\n\nimport {\n getManagedAgentSkillCandidatePaths,\n planManagedAgentSkill,\n type ManagedAgentSkillDefinition,\n} from '../scaffolding/agent-skill.js';\nimport { displayProjectPath, quoteShellArgument } from '../scaffolding/project-plan-output.js';\nimport {\n getPlanningFileSnapshot,\n planFileChange,\n type PlanningPathSnapshot,\n} from '../scaffolding/project-plan.js';\nimport {\n CUSTOM_FUNCTION_SKILL_FILES,\n CUSTOM_FUNCTION_SKILL_NAME,\n} from './custom-function-skill.js';\nimport { insertCustomFunctionManifestEntry, parseCustomFunctionsManifest } from './manifest.js';\nimport { buildCustomFunctionProjectArguments, buildPlaceholderVariablesArgument } from './paths.js';\nimport {\n generateGithubActionsWorkflow,\n isUnmodifiedCustomFunctionWorkflow,\n} from './scaffold-artifacts.js';\nimport {\n mergeDenoConfiguration,\n mergeEditorExtensions,\n mergeEditorSettings,\n} from './scaffold-config.js';\nimport {\n CUSTOM_FUNCTION_RESULT_VERSION,\n CustomFunctionSetupFeature,\n type CustomFunctionProjectPlan,\n type CustomFunctionProjectState,\n type CustomFunctionSetupFeature as CustomFunctionSetupFeatureType,\n} from './scaffold-model.js';\nimport {\n generateCustomFunctionTemplate,\n type GeneratedCustomFunctionTemplate,\n} from './scaffold-templates.js';\n\n/** Empty manifest used for first initialization. */\nexport const EMPTY_CUSTOM_FUNCTION_MANIFEST = `# Custom Functions managed as code.\nfunctions: []\n`;\n\n/** Managed Custom Function Agent Skill definition. */\nconst CUSTOM_FUNCTION_MANAGED_SKILL: ManagedAgentSkillDefinition = {\n name: CUSTOM_FUNCTION_SKILL_NAME,\n displayName: 'Custom Function',\n owner: '@transcend-io/cli',\n files: CUSTOM_FUNCTION_SKILL_FILES,\n};\n\n/** In-memory input consumed by pure project planners. */\nexport interface CustomFunctionPlanningInput {\n /** Project discovery state. */\n state: CustomFunctionProjectState;\n /** Potential mutation paths keyed by absolute path. */\n snapshots: Readonly<Record<string, PlanningPathSnapshot>>;\n}\n\n/**\n * Find parameter placeholders in a generated manifest value.\n *\n * @param value - Generated manifest entry\n * @returns Unique parameter names in encounter order\n */\nexport function parameterNamesInManifestValue(value: unknown): string[] {\n const serialized = JSON.stringify(value) ?? '';\n return [\n ...new Set(Array.from(serialized.matchAll(/<<parameters\\.([^>]+)>>/gu), (match) => match[1]!)),\n ];\n}\n\n/** In-memory input required only by project initialization. */\nexport interface CustomFunctionInitPlanningInput extends CustomFunctionPlanningInput {\n /** Exact authoring contract version. */\n contractVersion: string;\n /** Exact CLI version. */\n cliVersion: string;\n}\n\n/** Options shared by init and implicit init. */\nexport interface InitPlanOptions {\n /** Selected setup features. */\n features: readonly CustomFunctionSetupFeatureType[];\n}\n\n/**\n * Determine the repository-owned base for optional setup.\n *\n * @param state - Discovery state\n * @returns Repository root or target\n */\nfunction setupRoot(state: CustomFunctionProjectState): string {\n return state.projectRoot;\n}\n\n/**\n * Enumerate all paths that could be included in a plan.\n *\n * @param state - Discovery state\n * @param options - Selected setup and optional scaffold\n * @returns Absolute candidate paths\n */\nexport function getInitPlanningCandidatePaths(\n state: CustomFunctionProjectState,\n options: {\n /** Selected setup features. */\n features: readonly CustomFunctionSetupFeatureType[];\n },\n): string[] {\n const root = setupRoot(state);\n const paths = new Set<string>([state.manifestPath]);\n const selected = new Set(options.features);\n if (selected.has(CustomFunctionSetupFeature.Deno)) {\n paths.add(state.denoConfigPath);\n }\n if (selected.has(CustomFunctionSetupFeature.Editor)) {\n paths.add(join(root, '.vscode', 'settings.json'));\n paths.add(join(root, '.vscode', 'extensions.json'));\n }\n if (selected.has(CustomFunctionSetupFeature.Skill)) {\n getManagedAgentSkillCandidatePaths(\n root,\n state.existingSkillDirectories,\n CUSTOM_FUNCTION_MANAGED_SKILL,\n ).forEach((path) => paths.add(path));\n }\n if (selected.has(CustomFunctionSetupFeature.Ci)) {\n paths.add(join(root, '.github', 'workflows', 'transcend-custom-functions.yml'));\n }\n return [...paths].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Enumerate paths touched when adding one function to an initialized project.\n *\n * @param state - Project discovery state\n * @param generated - Generated function files\n * @returns Absolute candidate paths\n */\nexport function getAddFunctionPlanningCandidatePaths(\n state: CustomFunctionProjectState,\n generated: GeneratedCustomFunctionTemplate,\n): string[] {\n return [\n state.manifestPath,\n join(state.manifestDirectory, generated.sourceFile.path),\n ...generated.payloadFiles.map((file) => join(state.manifestDirectory, file.path)),\n ].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Ensure a mutation stays below an approved project root.\n *\n * @param root - Approved root\n * @param path - Candidate path\n */\nfunction assertContained(root: string, path: string): void {\n const child = relative(root, path);\n if (child === '..' || child.startsWith(`..${sep}`) || isAbsolute(child)) {\n throw new Error(`Refusing to modify path outside project root: ${path}`);\n }\n}\n\n/**\n * Validate roots and case-insensitive destinations.\n *\n * @param state - Discovery state\n * @param paths - Planned destination paths\n */\nfunction validatePlanDestinations(\n state: CustomFunctionProjectState,\n paths: readonly string[],\n): void {\n const root = setupRoot(state);\n assertContained(state.targetDirectory, state.manifestPath);\n paths.forEach((path) => assertContained(root, path));\n const existing = new Map(\n state.relativePaths.map((path) => [path.toLocaleLowerCase('en-US'), path]),\n );\n paths.forEach((path) => {\n const relativePath = relative(state.manifestDirectory, path).split(sep).join('/');\n if (relativePath.startsWith('../')) {\n return;\n }\n const components = relativePath.split('/');\n for (let length = 1; length <= components.length; length += 1) {\n const candidate = components.slice(0, length).join('/');\n const collision = existing.get(candidate.toLocaleLowerCase('en-US'));\n if (collision && collision !== candidate) {\n throw new Error(\n `Case-insensitive path collision: \"${candidate}\" conflicts with \"${collision}\".`,\n );\n }\n }\n });\n}\n\n/**\n * Add or classify a regular-file mutation.\n *\n * @param plan - Plan being assembled\n * @param input - Planning input\n * @param options - Desired file\n */\nfunction addFileChange(\n plan: CustomFunctionProjectPlan,\n input: CustomFunctionPlanningInput,\n options: {\n /** Absolute path. */\n path: string;\n /** Complete desired contents. */\n contents: string;\n /** Human-readable reason. */\n description: string;\n /** Refuse existing contents. */\n createOnly?: boolean;\n },\n): void {\n const change = planFileChange({\n snapshot: getPlanningFileSnapshot(input.snapshots, options.path),\n after: options.contents,\n description: options.description,\n ...(options.createOnly === undefined ? {} : { createOnly: options.createOnly }),\n });\n if (change) {\n plan.changes.push(change);\n } else {\n plan.unchanged.push(options.path);\n }\n}\n\n/**\n * Create the base plan and optional repository setup.\n *\n * @param input - Collected project state\n * @param options - Selected setup\n * @returns Validated project plan\n */\nexport function buildInitPlan(\n input: CustomFunctionInitPlanningInput,\n options: InitPlanOptions,\n): CustomFunctionProjectPlan {\n const { state } = input;\n const projectArguments = buildCustomFunctionProjectArguments(\n state.targetDirectory,\n state.manifestPath,\n state.invocationDirectory,\n );\n const plan: CustomFunctionProjectPlan = {\n version: CUSTOM_FUNCTION_RESULT_VERSION,\n command: 'init',\n rootDirectory: setupRoot(state),\n targetDirectory: state.targetDirectory,\n manifestPath: state.manifestPath,\n changes: [],\n unchanged: [],\n warnings: [],\n nextSteps: [\n `transcend custom-functions new ${projectArguments}`,\n `transcend custom-functions check ${projectArguments}`,\n ],\n };\n const manifestSnapshot = getPlanningFileSnapshot(input.snapshots, state.manifestPath);\n const existingManifest =\n manifestSnapshot.contents === null\n ? undefined\n : parseCustomFunctionsManifest(manifestSnapshot.contents);\n if (manifestSnapshot.contents === null) {\n addFileChange(plan, input, {\n path: state.manifestPath,\n contents: EMPTY_CUSTOM_FUNCTION_MANIFEST,\n description: 'Create the Custom Function manifest',\n });\n } else {\n plan.unchanged.push(state.manifestPath);\n }\n\n const selected = new Set(options.features);\n if (selected.has(CustomFunctionSetupFeature.Deno)) {\n const snapshot = getPlanningFileSnapshot(input.snapshots, state.denoConfigPath);\n const sourcePaths = (existingManifest?.functions ?? [])\n .map(({ code }) => code)\n .filter((path) => !path.includes('<<parameters.'));\n const payloadPaths = (existingManifest?.functions ?? [])\n .flatMap((entry) => [\n ...(entry['test-payload'] ? [entry['test-payload']] : []),\n ...(entry['test-payloads'] ?? []).map(({ payload }) => payload),\n ])\n .filter((path) => !path.includes('<<parameters.'));\n addFileChange(plan, input, {\n path: state.denoConfigPath,\n contents: mergeDenoConfiguration(\n snapshot.contents,\n input.contractVersion,\n basename(state.manifestPath),\n { sources: sourcePaths, payloads: payloadPaths },\n ),\n description: 'Merge strict target-scoped Deno authoring configuration',\n });\n }\n\n const root = setupRoot(state);\n if (selected.has(CustomFunctionSetupFeature.Editor)) {\n const settingsPath = join(root, '.vscode', 'settings.json');\n const extensionsPath = join(root, '.vscode', 'extensions.json');\n const settingsSnapshot = getPlanningFileSnapshot(input.snapshots, settingsPath);\n const extensionsSnapshot = getPlanningFileSnapshot(input.snapshots, extensionsPath);\n addFileChange(plan, input, {\n path: settingsPath,\n contents: mergeEditorSettings(settingsSnapshot.contents, root, state.targetDirectory),\n description: 'Scope Deno language support to Custom Functions',\n });\n addFileChange(plan, input, {\n path: extensionsPath,\n contents: mergeEditorExtensions(extensionsSnapshot.contents),\n description: 'Recommend the Deno editor extension',\n });\n }\n\n if (selected.has(CustomFunctionSetupFeature.Skill)) {\n const skillPlan = planManagedAgentSkill({\n rootDirectory: root,\n existingDirectories: state.existingSkillDirectories,\n snapshots: input.snapshots,\n skill: CUSTOM_FUNCTION_MANAGED_SKILL,\n });\n plan.changes.push(...skillPlan.changes);\n plan.unchanged.push(...skillPlan.unchanged);\n plan.warnings.push(...skillPlan.warnings);\n }\n if (selected.has(CustomFunctionSetupFeature.Ci)) {\n if (!state.repositoryRoot || !state.usesGithub) {\n plan.warnings.push(\n 'GitHub Actions setup was selected, but this target is not inside a detected GitHub repository.',\n );\n } else {\n const workflowPath = join(\n state.repositoryRoot,\n '.github',\n 'workflows',\n 'transcend-custom-functions.yml',\n );\n const target =\n relative(state.repositoryRoot, state.targetDirectory).split(sep).join('/') || '.';\n const contentDirectory =\n relative(state.repositoryRoot, state.manifestDirectory).split(sep).join('/') || '.';\n const manifest = relative(state.repositoryRoot, state.manifestPath).split(sep).join('/');\n const watchedPaths = (existingManifest?.functions ?? [])\n .flatMap((entry) => [\n entry.code,\n ...(entry['test-payload'] ? [entry['test-payload']] : []),\n ...(entry['test-payloads'] ?? []).map(({ payload }) => payload),\n ])\n .filter((path) => !path.includes('<<parameters.'))\n .map((path) =>\n relative(state.repositoryRoot!, resolve(state.manifestDirectory, path))\n .split(sep)\n .join('/'),\n );\n const workflowContents = generateGithubActionsWorkflow({\n cliVersion: input.cliVersion,\n targetDirectory: target,\n contentDirectory,\n manifestPath: manifest,\n watchedPaths,\n });\n const workflowSnapshot = getPlanningFileSnapshot(input.snapshots, workflowPath);\n if (workflowSnapshot.contents === null) {\n addFileChange(plan, input, {\n path: workflowPath,\n contents: workflowContents,\n description: 'Add credential-free Custom Function checks',\n createOnly: true,\n });\n } else if (workflowSnapshot.contents === workflowContents) {\n plan.unchanged.push(workflowPath);\n } else if (isUnmodifiedCustomFunctionWorkflow(workflowSnapshot.contents)) {\n addFileChange(plan, input, {\n path: workflowPath,\n contents: workflowContents,\n description: 'Update managed Custom Function checks',\n });\n } else {\n plan.unchanged.push(workflowPath);\n plan.warnings.push(`Existing GitHub Actions workflow was left unchanged: ${workflowPath}`);\n }\n }\n }\n validatePlanDestinations(\n state,\n plan.changes.map(({ path }) => path),\n );\n return plan;\n}\n\n/**\n * Add a new function to an initialized project in one transaction.\n *\n * @param input - Collected project state\n * @param options - Generated function\n * @returns Validated project plan\n */\nexport function buildAddFunctionPlan(\n input: CustomFunctionPlanningInput,\n options: {\n /** Generated function scaffold. */\n generated: GeneratedCustomFunctionTemplate;\n },\n): CustomFunctionProjectPlan {\n const { state } = input;\n const currentManifest = getPlanningFileSnapshot(input.snapshots, state.manifestPath).contents;\n if (currentManifest === null) {\n throw new Error(`Custom Function manifest does not exist: ${state.manifestPath}`);\n }\n const sourceRelativePath = options.generated.sourceFile.path.split(sep).join('/');\n const sourceCollision = state.relativePaths.find(\n (path) => path.toLocaleLowerCase('en-US') === sourceRelativePath.toLocaleLowerCase('en-US'),\n );\n if (sourceCollision) {\n throw new Error(\n `Custom Function name \"${options.generated.displayName}\" maps to ${sourceRelativePath}, ` +\n `which conflicts with existing path ${sourceCollision}. Choose another name.`,\n );\n }\n const existingSourceEntry = parseCustomFunctionsManifest(currentManifest).functions.find(\n (entry) =>\n resolve(state.manifestDirectory, entry.code) ===\n resolve(state.manifestDirectory, sourceRelativePath),\n );\n if (existingSourceEntry) {\n throw new Error(\n `Custom Function name \"${options.generated.displayName}\" maps to source used by ` +\n `\"${existingSourceEntry.name}\". Choose another name.`,\n );\n }\n const plan: CustomFunctionProjectPlan = {\n version: CUSTOM_FUNCTION_RESULT_VERSION,\n command: 'new',\n rootDirectory: state.manifestDirectory,\n targetDirectory: state.targetDirectory,\n manifestPath: state.manifestPath,\n changes: [],\n unchanged: [],\n warnings: [],\n nextSteps: [],\n };\n const updatedManifest = insertCustomFunctionManifestEntry(\n currentManifest,\n options.generated.manifestEntry,\n );\n addFileChange(plan, input, {\n path: state.manifestPath,\n contents: updatedManifest,\n description: `Register ${options.generated.displayName} in the manifest`,\n });\n\n const generatedFiles = [options.generated.sourceFile, ...options.generated.payloadFiles];\n generatedFiles.forEach((file) => {\n addFileChange(plan, input, {\n path: join(state.manifestDirectory, file.path),\n contents: file.contents,\n description:\n file === options.generated.sourceFile\n ? `Create ${options.generated.displayName} source`\n : `Create ${options.generated.displayName} test payload`,\n createOnly: true,\n });\n });\n const sourcePath = join(state.manifestDirectory, options.generated.sourceFile.path);\n const projectArguments = buildCustomFunctionProjectArguments(\n state.targetDirectory,\n state.manifestPath,\n state.invocationDirectory,\n );\n const variableNames = parameterNamesInManifestValue(options.generated.manifestEntry);\n const variablesArgument = buildPlaceholderVariablesArgument(variableNames);\n plan.nextSteps = [\n `Edit ${quoteShellArgument(displayProjectPath(state.invocationDirectory, sourcePath))}`,\n `transcend custom-functions run ${projectArguments} --function=${quoteShellArgument(\n options.generated.displayName,\n )}${variablesArgument}`,\n `transcend custom-functions check ${projectArguments}${variablesArgument}`,\n `transcend custom-functions push ${projectArguments} --dryRun${variablesArgument}`,\n ];\n if (variableNames.length > 0) {\n plan.warnings.push(\n `Supply ${variableNames.join(', ')} through --variables when running or pushing; never commit secret values.`,\n );\n }\n validatePlanDestinations(\n state,\n plan.changes.map(({ path }) => path),\n );\n return plan;\n}\n\n/**\n * Generate the template before collecting its destination snapshots.\n *\n * @param displayName - Custom Function display name\n * @param template - Template name\n * @returns Pure template output\n */\nexport function prepareGeneratedCustomFunction(\n displayName: string,\n template: Parameters<typeof generateCustomFunctionTemplate>[1],\n): GeneratedCustomFunctionTemplate {\n return generateCustomFunctionTemplate(displayName, template);\n}\n"],"mappings":"ulBAAA;;;;;;;;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