permdock 0.6.0 → 0.7.0

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 (399) hide show
  1. package/README.md +1 -0
  2. package/dist/{2020-C9VN-x8c.js → 2020-CJbO8Bvz.js} +1 -3
  3. package/dist/a2a/index.d.ts +5 -5
  4. package/dist/a2a/index.js +4 -4
  5. package/dist/{adoption-scan-DCYe60Pi.js → adoption-scan-D-feE7BE.js} +1 -1
  6. package/dist/agent/index.d.ts +3 -3
  7. package/dist/agent/index.js +1 -1
  8. package/dist/ai-sdk/index.d.ts +21 -6
  9. package/dist/ai-sdk/index.js +19 -9
  10. package/dist/{approval-prompt-DvSSPQJX.d.ts → approval-prompt-K0faOLFp.d.ts} +2 -2
  11. package/dist/approvals/index.d.ts +4 -4
  12. package/dist/approvals/index.js +4 -4
  13. package/dist/{approvals-p1PGoVjb.js → approvals-CMRfsbBh.js} +74 -48
  14. package/dist/{arazzo-41WuzHou.js → arazzo-ClrF3PVb.js} +2 -2
  15. package/dist/{arazzo-CaUVBn7D.js → arazzo-rdeJ8n1J.js} +4 -4
  16. package/dist/{args-IIolxxKA.js → args-CC3OwyHW.js} +112 -2
  17. package/dist/astro/index.d.ts +6 -6
  18. package/dist/astro/index.js +2 -2
  19. package/dist/{audience-DabClFLQ.js → audience-BrMs8c4o.js} +1 -1
  20. package/dist/{auth-DRLEizbL.js → auth-CscUX8Sy.js} +3 -4
  21. package/dist/authzen/index.d.ts +162 -22
  22. package/dist/authzen/index.js +315 -146
  23. package/dist/{automation-BNM3TtDo.d.ts → automation-DOtAFWdy.d.ts} +3 -3
  24. package/dist/{automation-DVjOckjV.js → automation-ySsxp_Yp.js} +1 -1
  25. package/dist/base-url-BQbddZO5.js +9 -0
  26. package/dist/better-auth/index.d.ts +2 -2
  27. package/dist/better-auth/index.js +2 -2
  28. package/dist/better-supabase/index.d.ts +50 -8
  29. package/dist/better-supabase/index.js +94 -32
  30. package/dist/{bind-CAvgUuKs.js → bind-D1nO6fiC.js} +5 -5
  31. package/dist/{bind-DOyrv6zi.d.ts → bind-JDuvxjuW.d.ts} +7 -7
  32. package/dist/{build-instance-Bu_eDqYw.js → build-instance-DxE7czo9.js} +1 -1
  33. package/dist/{canonical-json-BC8_nMTw.js → canonical-json-DwilZ1iB.js} +6 -3
  34. package/dist/{capability-Drg-1YhL.d.ts → capability-D4UC9TTW.d.ts} +2 -2
  35. package/dist/{capability-N1K9IpqS.js → capability-L7NnfhiE.js} +1 -1
  36. package/dist/{casbin-Cr7RLtA3.js → casbin-BHijLuHY.js} +2 -2
  37. package/dist/{casbin-Dyu2gnUD.js → casbin-BW9pS47J.js} +1 -1
  38. package/dist/{casl-64gpT-8x.js → casl-CmJlgziS.js} +2 -2
  39. package/dist/{casl-DjEDhTCP.js → casl-UbI8v-Wq.js} +1 -1
  40. package/dist/catalog/index.d.ts +70 -10
  41. package/dist/catalog/index.js +112 -6
  42. package/dist/catalog-BCCjSAdH.js +1 -0
  43. package/dist/{catalog-DZVbrF-z.js → catalog-BaMQfQ6Y.js} +3 -3
  44. package/dist/{catalog-HD2gf5mY.js → catalog-D69WhFii.js} +43 -13
  45. package/dist/{catalog-doc-Cdn7-0pQ.js → catalog-doc-CV9s6B1S.js} +28 -5
  46. package/dist/{catalog-fingerprint-CCP0-yQS.js → catalog-fingerprint-C144oW4M.js} +1 -1
  47. package/dist/{create-CQWIpUG-.js → challenge-nGWma08S.js} +122 -25
  48. package/dist/chat/index.d.ts +1 -1
  49. package/dist/chat/index.js +2 -2
  50. package/dist/chat-sdk/index.d.ts +3 -3
  51. package/dist/checks-BC_0mPIq.js +37 -0
  52. package/dist/claude-agent/index.d.ts +3 -3
  53. package/dist/claude-agent/index.js +2 -2
  54. package/dist/clerk/index.d.ts +3 -3
  55. package/dist/clerk/index.js +1 -1
  56. package/dist/cli/bin.js +2 -2
  57. package/dist/cli/index.d.ts +3 -3
  58. package/dist/cli/index.js +3 -3
  59. package/dist/cloud/index.d.ts +127 -11
  60. package/dist/cloud/index.js +251 -3
  61. package/dist/{cloud-ytQ3uviA.js → cloud-CO8pYtwr.js} +5 -5
  62. package/dist/{codemod-ua2hHy7w.js → codemod-BP6n8N9L.js} +3 -3
  63. package/dist/{codemod-5mpSpnUY.js → codemod-i4N2BhDc.js} +3 -3
  64. package/dist/{collect-mLTY4nwb.js → collect-BaWeMjwV.js} +17 -8
  65. package/dist/{collect-Ci6akVwH.js → collect-DNm3oKOk.js} +6 -5
  66. package/dist/collect-k_Dulxr5.js +1 -0
  67. package/dist/compile/index.d.ts +1 -1
  68. package/dist/compile/index.js +1 -1
  69. package/dist/{compile-CMqMx_IN.js → compile-BAEO5bOk.js} +2 -2
  70. package/dist/{compile-1bsAezL0.d.ts → compile-COM2VKuN.d.ts} +3 -3
  71. package/dist/{completion-BTFrHZhX.js → completion-BNdVf7X2.js} +3 -3
  72. package/dist/{config-bs_kZeYq.js → config-CoQHDrDi.js} +7 -3
  73. package/dist/{config-Bj2Ixq3d.js → config-DGZzMV1B.js} +2 -2
  74. package/dist/{config-report-DSpsLpCE.js → config-report-Cm7UITNA.js} +3 -3
  75. package/dist/connector-schema-_VCSsdtD.js +433 -0
  76. package/dist/{context-B_u3_bDJ.js → context--uM9V3Ui.js} +2 -2
  77. package/dist/convex/index.d.ts +5 -5
  78. package/dist/convex/index.js +2 -2
  79. package/dist/core-B5-w6Kw9.js +335 -0
  80. package/dist/core-CQkE8Esr.d.ts +179 -0
  81. package/dist/{create-B30OMUOJ.d.ts → create-B2-CQqCI.d.ts} +5 -5
  82. package/dist/{create-CGm28gyI.js → create-Cb86Z8Im.js} +9 -8
  83. package/dist/{create-DCF2SvoT.js → create-DJrlhEp9.js} +5 -5
  84. package/dist/{create-D_NmPOdH.d.ts → create-QHuuPw3q.d.ts} +7 -7
  85. package/dist/{create-CBMmFie-.d.ts → create-UTnUVETj.d.ts} +30 -10
  86. package/dist/{credential-BcoiejpY.js → credential-CIM7wHwA.js} +4 -4
  87. package/dist/{credentials-DPyHmYz5.js → credentials-BpuTwd7a.js} +1 -1
  88. package/dist/{deciding-columns-Sq12mEA6.js → deciding-columns-DRo2QM6E.js} +13 -2
  89. package/dist/{delegation-j6-rc37o.js → delegation-C5rOdTp5.js} +5 -5
  90. package/dist/delivery/index.d.ts +5 -5
  91. package/dist/delivery/index.js +4 -3
  92. package/dist/{delivery-DCAgNyCn.js → delivery-rwOKLWRm.js} +51 -2
  93. package/dist/{denied-text-CiFQNuMV.d.ts → denied-text-D4qkEtFz.d.ts} +2 -2
  94. package/dist/{describe-BybMRY7A.js → describe-DZlnEtLy.js} +1 -0
  95. package/dist/{describe-B5qgDvEW.d.ts → describe-O0SwYIK8.d.ts} +2 -2
  96. package/dist/{diff-CmuSD3vc.js → diff-Btr1c1Ow.js} +2 -2
  97. package/dist/{diff-3jbx6Rm4.js → diff-DzT-xD13.js} +10 -10
  98. package/dist/{doctor-BdZw53-k.js → doctor-BU1szn63.js} +241 -49
  99. package/dist/{doctor-3ZqNHX_G.js → doctor-BoK_y0KO.js} +4 -4
  100. package/dist/drizzle/index.d.ts +3 -3
  101. package/dist/drizzle/index.js +1 -1
  102. package/dist/elysia/index.d.ts +5 -5
  103. package/dist/elysia/index.js +3 -3
  104. package/dist/{errors-DH5QEGXh.d.ts → errors-B_Qg9D3e.d.ts} +2 -2
  105. package/dist/{errors-CWTY6uih.js → errors-DpP_U6Bf.js} +1 -0
  106. package/dist/{evaluate-CNClBvcj.js → evaluate-B_oqFbWC.js} +55 -12
  107. package/dist/{evaluations-C_1vdSZc.d.ts → evaluations-BCddEOfO.d.ts} +4 -4
  108. package/dist/{evaluations-beAooV0n.js → evaluations-DReoiVBw.js} +4 -4
  109. package/dist/eve/index.d.ts +5 -5
  110. package/dist/eve/index.js +3 -3
  111. package/dist/express/index.d.ts +5 -5
  112. package/dist/express/index.js +3 -3
  113. package/dist/fastify/index.d.ts +5 -5
  114. package/dist/fastify/index.js +3 -3
  115. package/dist/{fetch-adapter-Dw0MTS3D.d.ts → fetch-adapter-CuhyYwC1.d.ts} +4 -4
  116. package/dist/{fetch-adapter-DD_gfmrC.js → fetch-adapter-De-u6vhJ.js} +3 -3
  117. package/dist/{fields-OYG_JR78.js → fields-ClcQLrVc.js} +48 -13
  118. package/dist/{files-C5ZI27eV.js → files-acUbNwWt.js} +15 -2
  119. package/dist/{fixtures-B7XrLeY7.js → fixtures-BTMW6zgU.js} +2 -2
  120. package/dist/{flags-C3DktBDY.js → flags-aaeRAdiD.js} +2 -2
  121. package/dist/{from-snapshot-CTCMsFZk.js → from-snapshot-Bz469dIh.js} +17 -10
  122. package/dist/generate-3FNO5P5Q.js +159 -0
  123. package/dist/{grantee-hxrUsbpM.js → grantee-BrRANrpT.js} +1 -1
  124. package/dist/{grantee-conditions-CcXf8hMM.js → grantee-conditions-C6P1Tvol.js} +1 -1
  125. package/dist/{grantee-match-DbENBHLB.js → grantee-match-0RtHWQDx.js} +3 -3
  126. package/dist/h3/index.d.ts +4 -4
  127. package/dist/h3/index.js +3 -3
  128. package/dist/{helpers-CBYVMjwh.js → helpers-DY3vXuGs.js} +3 -3
  129. package/dist/hono/index.d.ts +5 -5
  130. package/dist/hono/index.js +3 -3
  131. package/dist/{hosted-BPk51-kX.d.ts → hosted-BmjzxQhp.d.ts} +14 -2
  132. package/dist/{hosted-B46-5LYE.js → hosted-XBgU6RGT.js} +34 -12
  133. package/dist/{http-DXJ37RDA.js → http-Ca3Sr5x1.js} +1 -1
  134. package/dist/{import-wyqXUyjm.js → import-Bz0GefWg.js} +5 -5
  135. package/dist/{import-CNV7I2Dw.js → import-DB2EG_iy.js} +3 -3
  136. package/dist/{index-C-6Letxg.d.ts → index-BE8y3moU.d.ts} +50 -8
  137. package/dist/{index-B8YjkEZ4.d.ts → index-BSfRl0hZ.d.ts} +6 -6
  138. package/dist/{index-DuWxc5dt.d.ts → index-BTkwrK7v.d.ts} +143 -14
  139. package/dist/index-CMiPH2Tv.d.ts +206 -0
  140. package/dist/{index-Ch8LpNDp.d.ts → index-DH9DUDEM.d.ts} +18 -3
  141. package/dist/{index-CueFnxQc.d.ts → index-DLwcuCN_.d.ts} +86 -7
  142. package/dist/index.d.ts +18 -17
  143. package/dist/index.js +27 -25
  144. package/dist/{init-GG6Jh8HD.js → init-5TXNji88.js} +5 -5
  145. package/dist/{init-DeMYsnYJ.js → init-B-4t1NzC.js} +4 -4
  146. package/dist/{instance-options-BsVpyGIk.d.ts → instance-options-CU0YQCLH.d.ts} +1 -1
  147. package/dist/{instance-snapshot-BOEhcqIF.js → instance-snapshot-CjcwnEiV.js} +16 -11
  148. package/dist/jwt/index.d.ts +83 -5
  149. package/dist/jwt/index.js +143 -5
  150. package/dist/{kernel-D0NVb1cK.js → kernel-DVExUwkp.js} +138 -12
  151. package/dist/kysely/index.d.ts +3 -3
  152. package/dist/kysely/index.js +1 -1
  153. package/dist/load-DrMHXzgN.js +1 -0
  154. package/dist/{load-DFS_ry0W.js → load-DxroEzH1.js} +2 -2
  155. package/dist/{login-Dfe5RlYk.js → login-ClSJh5t5.js} +4 -4
  156. package/dist/{login-imhuwvn3.js → login-WC9HPJpU.js} +6 -10
  157. package/dist/{manifest-C8IzW3Do.js → manifest-B79YuF2T.js} +6 -2
  158. package/dist/{manifest-mx5ghSFM.d.ts → manifest-BVhExYhw.d.ts} +23 -2
  159. package/dist/{manifest-dvL2XEe1.js → manifest-Dv6q4i5s.js} +54 -35
  160. package/dist/{manifest-schema-C0kK_8V0.js → manifest-schema-Cv492Qev.js} +37 -7
  161. package/dist/{map-claims-D3oRmTk0.js → map-claims-etGIS_Dv.js} +14 -11
  162. package/dist/{map-error-Dr70oA_3.js → map-error-BQGyDm_M.js} +1 -1
  163. package/dist/mcp/index.d.ts +64 -10
  164. package/dist/mcp/index.js +151 -22
  165. package/dist/{migrate-CIq4-E9F.js → migrate-Dodel0IJ.js} +77 -24
  166. package/dist/nest/index.d.ts +5 -5
  167. package/dist/nest/index.js +3 -3
  168. package/dist/next/index.d.ts +9 -9
  169. package/dist/next/index.js +5 -5
  170. package/dist/next/plugin.d.ts +1 -1
  171. package/dist/next/plugin.js +2 -2
  172. package/dist/node/index.d.ts +5 -5
  173. package/dist/node/index.js +2 -2
  174. package/dist/openai/index.d.ts +5 -5
  175. package/dist/openai/index.js +3 -3
  176. package/dist/openapi/index.d.ts +14 -4
  177. package/dist/openapi/index.js +1 -1
  178. package/dist/{openapi-C4dDTVEd.js → openapi-DMocl1bh.js} +4 -4
  179. package/dist/{openapi-B7HZ0f-r.js → openapi-Ddb4628T.js} +2 -7
  180. package/dist/{openapi-DD1SV-5-.js → openapi-ztVaux6j.js} +8 -8
  181. package/dist/{operation-findings-DgATDpvh.js → operation-findings-kRcEp8lE.js} +1 -1
  182. package/dist/{operations-X0VM7F3m.d.ts → operations-BNLes61x.d.ts} +1 -1
  183. package/dist/orpc/index.d.ts +6 -6
  184. package/dist/orpc/index.js +4 -4
  185. package/dist/otel/index.d.ts +3 -3
  186. package/dist/otel/index.js +1 -1
  187. package/dist/{output-1im__-08.js → output-DgSDLrta.js} +7 -3
  188. package/dist/{output-files-DhRBBE4n.js → output-files-CCMdcFWb.js} +2 -2
  189. package/dist/output-files-DPAY7-GX.js +1 -0
  190. package/dist/{ownership-DqaJNJPn.js → ownership-Z2LpxsGa.js} +443 -40
  191. package/dist/parse-Ddhz2xf4.js +148 -0
  192. package/dist/{parse-local-manifest-CVSs6J9I.js → parse-local-manifest-T1Q8X3A2.js} +24 -1
  193. package/dist/{parse-local-manifest-5ODwqu8b.d.ts → parse-local-manifest-e4mdwAKd.d.ts} +1 -1
  194. package/dist/pdp/index.d.ts +3 -3
  195. package/dist/pdp/index.js +7 -3
  196. package/dist/peer-12Q5I_RH.js +976 -0
  197. package/dist/{peer-CRvC7Hg1.js → peer-DOzzMfZL.js} +1 -1
  198. package/dist/{permdock-BrAscV28.js → permdock-BfWEeMqk.js} +177 -49
  199. package/dist/{permdock-SV8ZINYT.d.ts → permdock-Dco6dyCK.d.ts} +34 -5
  200. package/dist/{permission-registry-Br4jSNVi.js → permission-registry-DpPtSKNZ.js} +1 -1
  201. package/dist/{vocabulary-CN8H_9UF.d.ts → permission-types-DhNEmoRG.d.ts} +4 -64
  202. package/dist/{permissions-u_KHg-sN.d.ts → permissions-CoqCOfJ3.d.ts} +2 -1
  203. package/dist/{permissions-B-wCP5ZC.js → permissions-CyH2MV_B.js} +1 -1
  204. package/dist/{permissions-BPxlwVhN.js → permissions-DArULThq.js} +4 -4
  205. package/dist/pkce-5h8NgMQJ.js +21 -0
  206. package/dist/{policies-DP2nqRoF.js → policies-B2lZIurj.js} +3 -3
  207. package/dist/{policy-77FSAq_V.d.ts → policy-B7dg_yzu.d.ts} +2 -2
  208. package/dist/{policy-DbM5YYtV.js → policy-DaJy4nK4.js} +17 -8
  209. package/dist/{policy-from-catalog-C2gMa2Dj.js → policy-from-catalog-DFWYkNdu.js} +9 -9
  210. package/dist/{policy-types-n0uRTsW8.d.ts → policy-types-B-F-qAZk.d.ts} +83 -4
  211. package/dist/postgres-store-BL9M_CA1.js +1001 -0
  212. package/dist/{postgrest-CEgRbefE.d.ts → postgrest-CYacM_u7.d.ts} +12 -1
  213. package/dist/{postgrest-DAjUkF9w.js → postgrest-r5faDIzD.js} +37 -4
  214. package/dist/{powersync-DISt6SUe.js → powersync-13odBwiM.js} +3 -3
  215. package/dist/powersync-53ryOZip.js +1059 -0
  216. package/dist/powersync-CExtTLyA.js +1 -0
  217. package/dist/preset/index.js +1 -1
  218. package/dist/{preset-DZdU0tne.js → preset-CHTbd-DQ.js} +2 -2
  219. package/dist/prisma/index.d.ts +2 -2
  220. package/dist/prisma/index.js +1 -1
  221. package/dist/{problem-details-B45V5d2b.d.ts → problem-details-Tcfmj3bV.d.ts} +1 -1
  222. package/dist/prompt-DwtVemER.js +935 -0
  223. package/dist/{protected-RFGpakN9.d.ts → protected-BwZYL1X_.d.ts} +6 -5
  224. package/dist/{protected-BlF0F6wL.js → protected-DXE3cQYg.js} +2 -2
  225. package/dist/{provider-B1al-AZz.js → provider-BQsTYYy0.js} +2 -2
  226. package/dist/{provider-DILL9oPK.d.ts → provider-Csk-THAn.d.ts} +1 -1
  227. package/dist/{provider-store-DM6DNcta.js → provider-store-IgqQipCO.js} +2 -2
  228. package/dist/{pull-jEwbf80J.js → pull-CN5OLxrF.js} +7 -7
  229. package/dist/pull-Cty6Ovyu.js +1 -0
  230. package/dist/{push-BD4f15co.js → push-tVdG8dUL.js} +54 -14
  231. package/dist/{pushed-policy-DCW91KQU.d.ts → pushed-policy-BbcY9r_4.d.ts} +1 -1
  232. package/dist/{pushed-policy-CqtxkV4G.js → pushed-policy-CmYeSQqq.js} +1 -1
  233. package/dist/react/index.d.ts +6 -6
  234. package/dist/react/index.js +3 -3
  235. package/dist/react/provider-client.d.ts +1 -1
  236. package/dist/react/provider-client.js +1 -1
  237. package/dist/react-native/index.d.ts +25 -11
  238. package/dist/react-native/index.js +209 -21
  239. package/dist/{refs-K6eWUJ0H.js → refs-CNJBiTFo.js} +15 -1
  240. package/dist/{replay-Bkm-Ne4l.d.ts → replay-DCDD_ZfL.d.ts} +1 -1
  241. package/dist/{request-context-C81Pip9n.js → request-context-BykKLmyE.js} +2 -2
  242. package/dist/resend/index.d.ts +4 -4
  243. package/dist/{retire-CALjIQ7e.js → retire-Wj6dkyDE.js} +2 -2
  244. package/dist/{rls-BAqP4q66.js → rls-Ck_PocSp.js} +32 -8
  245. package/dist/{rls-DTvYd-lI.js → rls-CxBZb4rZ.js} +478 -534
  246. package/dist/{role-builder-uWQZ4v84.js → role-builder-C1VJzvcr.js} +3 -3
  247. package/dist/rolldown-runtime-C3I60J0A.js +4 -0
  248. package/dist/{rpc-VSl5ylaQ.js → rpc-Bk1bE-ch.js} +1 -1
  249. package/dist/run-Bz7DXGEv.js +1 -0
  250. package/dist/{run-ticket-sxFI6LAk.js → run-ticket-B5d_63Ma.js} +22 -1
  251. package/dist/{run-ticket-DocwaTKn.d.ts → run-ticket-BpNi7BCi.d.ts} +8 -3
  252. package/dist/{run-CUKuz0A8.js → run-uLD2aWuO.js} +7 -7
  253. package/dist/{runtime-D3VTAiCA.js → runtime-Vif3_-zf.js} +1 -1
  254. package/dist/{saas-BCXRuXca.js → saas-Az_Kz-4D.js} +7 -7
  255. package/dist/{scan-qvOe0hS3.js → scan-DSljDE1Y.js} +1 -1
  256. package/dist/{schema-yLuBWWsh.js → schema-gIcCx7zM.js} +1 -1
  257. package/dist/scim/index.d.ts +3 -2
  258. package/dist/scim/index.js +3 -1
  259. package/dist/scim-C7JYhySg.js +44 -0
  260. package/dist/{scim-ClHtpyV3.js → scim-YNieBO1U.js} +3 -537
  261. package/dist/{scopes-CUPSjo9q.js → scopes-BHsc-wp-.js} +1 -1
  262. package/dist/server/index.d.ts +11 -11
  263. package/dist/server/index.js +7 -7
  264. package/dist/{server-C3WXAHZj.js → server-Bnga6I50.js} +3 -3
  265. package/dist/{server-types-CKQiCnON.d.ts → server-types-C4gZUEZy.d.ts} +9 -9
  266. package/dist/{shared-DvvFzYXe.js → shared-C8LjUdVU.js} +1 -1
  267. package/dist/{shared-BAK8t4Uo.js → shared-fMKOv8hP.js} +44 -38
  268. package/dist/{sink-4-eQIRWf.d.ts → sink-Cp_Eot9W.d.ts} +4 -4
  269. package/dist/{skills-B6lVdD_W.js → skills-Dcjw9_1C.js} +5 -5
  270. package/dist/{skills-CTYwkl44.js → skills-g_3BS9NC.js} +3 -3
  271. package/dist/{snapshot-B7DkYg6g.js → snapshot-CbGmYiJx.js} +4 -4
  272. package/dist/{snapshot-cache-DZHQ0KF6.js → snapshot-cache-DT2Kx1F8.js} +1 -1
  273. package/dist/{snapshot-cache-PXI-vGpY.d.ts → snapshot-cache-Pahd3IYJ.d.ts} +1 -1
  274. package/dist/solid/index.d.ts +6 -5
  275. package/dist/solid/index.js +4 -4
  276. package/dist/solid-start/index.d.ts +6 -6
  277. package/dist/solid-start/index.js +3 -3
  278. package/dist/{sources-vs5dGOsS.js → sources-B-zYB4GS.js} +111 -25
  279. package/dist/{sources-Xc4zkszI.d.ts → sources-DEEuGb8S.d.ts} +63 -14
  280. package/dist/sources-qoIJQrJv.js +11 -0
  281. package/dist/{sql-B5T1IL83.js → sql-B96movIM.js} +5 -1
  282. package/dist/sql-CDEPCA0g.d.ts +10 -0
  283. package/dist/{src-Cu2m75uo.js → src-DLFrtrrC.js} +140 -48
  284. package/dist/ssf/index.d.ts +4 -4
  285. package/dist/ssf/index.js +640 -211
  286. package/dist/{standard-webhooks-rbD7LS6h.d.ts → standard-webhooks-B_qRg0ws.d.ts} +2 -2
  287. package/dist/{store-BDutJkDL.js → store-DSP9oGvh.js} +15 -7
  288. package/dist/{store-options-u0ycEe8s.js → store-options-B_poyYvg.js} +6 -6
  289. package/dist/{stores-BUGNbJTt.d.ts → stores-BAZwSYZA.d.ts} +6 -5
  290. package/dist/{stores-CGhM8BN_.js → stores-BqEuHC05.js} +2 -2
  291. package/dist/{stream-CeCMJmBB.d.ts → stream-2Vwhl7Er.d.ts} +2 -2
  292. package/dist/{style-Uao76wO7.js → style-Cqo7-73x.js} +1 -0
  293. package/dist/{style-DiKWnAvn.js → style-Ds1gNm77.js} +1 -1
  294. package/dist/supabase/index.d.ts +8 -7
  295. package/dist/supabase/index.js +5 -5
  296. package/dist/supabase/middleware.d.ts +6 -6
  297. package/dist/supabase/middleware.js +6 -6
  298. package/dist/{supabase-x5JtR2tc.js → supabase--0aJdLEd.js} +8 -6
  299. package/dist/{supabase-By_frk3U.js → supabase-Bqp7iIY2.js} +3 -3
  300. package/dist/supabase-hook-DJxC4PoP.js +1 -0
  301. package/dist/{supabase-hook-BMoEhZir.js → supabase-hook-Dg0SrQWR.js} +1060 -119
  302. package/dist/supautils-MESd81bF.js +689 -0
  303. package/dist/{support-session-C6xJQYut.js → support-session-Cna49-3f.js} +2 -2
  304. package/dist/svelte/index.d.ts +5 -5
  305. package/dist/svelte/index.js +5 -5
  306. package/dist/svelte/runtime.d.ts +3 -3
  307. package/dist/svelte/runtime.js +3 -3
  308. package/dist/svelte/source.d.ts +5 -5
  309. package/dist/svelte/source.js +2 -2
  310. package/dist/sveltekit/index.d.ts +6 -6
  311. package/dist/sveltekit/index.js +2 -2
  312. package/dist/tanstack-start/index.d.ts +6 -6
  313. package/dist/tanstack-start/index.js +2 -2
  314. package/dist/{tenancy-DN2QAx9z.js → tenancy-CmeBQ6Nv.js} +12 -3
  315. package/dist/terminal/index.d.ts +6 -6
  316. package/dist/terminal/index.js +3 -3
  317. package/dist/testing/core.d.ts +2 -0
  318. package/dist/testing/core.js +1 -0
  319. package/dist/testing/fixtures/index.d.ts +12 -0
  320. package/dist/testing/fixtures/index.js +770 -0
  321. package/dist/testing/index.d.ts +41 -174
  322. package/dist/testing/index.js +241 -731
  323. package/dist/testing/saas/index.d.ts +5 -5
  324. package/dist/testing/saas/index.js +2 -2
  325. package/dist/testing/saas/permissions.d.ts +1 -1
  326. package/dist/testing/saas/permissions.js +1 -1
  327. package/dist/text-diff-DhITNCnD.js +444 -0
  328. package/dist/{token-BLZcjQgt.js → token-2qYDvXz2.js} +1 -1
  329. package/dist/{tool-refusal-CMLN5xhn.js → tool-refusal-reAhIzdl.js} +1 -1
  330. package/dist/trpc/index.d.ts +6 -6
  331. package/dist/trpc/index.js +3 -3
  332. package/dist/{types-Dfv0aTER.d.ts → types-BWZybqs9.d.ts} +110 -8
  333. package/dist/{types-Druu9wLM.d.ts → types-BXMYB7BY.d.ts} +2 -2
  334. package/dist/{types-BzzaHxt3.d.ts → types-BfVmNJO5.d.ts} +14 -3
  335. package/dist/{types-lUlG3TVd.d.ts → types-CIeZcG8v.d.ts} +2 -2
  336. package/dist/{types-B3_ooZgZ.d.ts → types-CKV71kKh.d.ts} +4 -4
  337. package/dist/{types-CX7AvRqP.d.ts → types-CQVEQawv.d.ts} +4 -4
  338. package/dist/{types-C863OQiR.d.ts → types-CeIscIKp.d.ts} +4 -4
  339. package/dist/{types-C_IiEs64.d.ts → types-CfiKC5aN.d.ts} +1 -1
  340. package/dist/{types-_WhUP7ud.d.ts → types-D3A19w4A.d.ts} +8 -4
  341. package/dist/{types-8RnwUAvE.d.ts → types-DBHftjgS.d.ts} +15 -8
  342. package/dist/{types-BdtSDbBO.d.ts → types-DC44-hqb.d.ts} +2 -2
  343. package/dist/{types-CVZSNocA.d.ts → types-DXmwu78Z.d.ts} +4 -4
  344. package/dist/{types-C791HFu9.d.ts → types-cTos-H7p.d.ts} +2 -2
  345. package/dist/{types-BtHtcKMr.d.ts → types-g7Oy6Zg4.d.ts} +3 -3
  346. package/dist/unplugin/index.d.ts +1 -1
  347. package/dist/unplugin/index.js +2 -2
  348. package/dist/{usage-SveTRTyr.js → usage-Bybmck7f.js} +7 -7
  349. package/dist/{usage-CRVl9V3t.js → usage-CDaLXCfL.js} +2 -2
  350. package/dist/usage-y-kBNdqs.js +1 -0
  351. package/dist/{validation-error-DHUrAkku.d.ts → validation-error-CQpoquwj.d.ts} +1 -1
  352. package/dist/{verify-BaAKx7t6.js → verify-pe8rL_Qw.js} +350 -83
  353. package/dist/{views-DTIIO-oQ.js → views-BB8E9dTP.js} +1 -1
  354. package/dist/vocabulary-Bg3eeT2H.d.ts +67 -0
  355. package/dist/vue/index.d.ts +6 -5
  356. package/dist/vue/index.js +4 -4
  357. package/dist/{waiter-B986w1oK.d.ts → waiter-DwEyouan.d.ts} +2 -2
  358. package/dist/watch-Bd9mx3rd.js +1 -0
  359. package/dist/{watch-vea54PRw.js → watch-C-4VmFlL.js} +3 -3
  360. package/dist/webmcp/index.d.ts +2 -2
  361. package/dist/webmcp/index.js +2 -2
  362. package/dist/{where-scope-C9vfEphl.js → where-scope-wq2coopv.js} +41 -21
  363. package/dist/{who-can-DWBAcaCQ.js → who-can-BwNsI_Js.js} +6 -6
  364. package/dist/workflow/index.d.ts +3 -3
  365. package/dist/workflow/index.js +5 -5
  366. package/dist/workflow-sdk/index.d.ts +5 -5
  367. package/dist/{wrap-C5jC6sKI.d.ts → wrap-B6R0cMRL.d.ts} +2 -2
  368. package/dist/{wrap-gX61EtpB.js → wrap-CiSc_KCq.js} +8 -2
  369. package/package.json +22 -11
  370. package/schemas/cli-result-v1.json +1 -0
  371. package/schemas/cloud-api-v1.json +152 -7
  372. package/schemas/connector-v1.json +8 -0
  373. package/schemas/supabase-claims-v1.json +5 -0
  374. package/schemas/supabase-manifest-v1.json +276 -75
  375. package/skills/permdock/SKILL.md +1 -0
  376. package/skills/permdock-agents/references/runtimes.md +3 -1
  377. package/skills/permdock-approvals/references/stores-and-resume.md +2 -1
  378. package/skills/permdock-data/references/queries-and-rls.md +4 -1
  379. package/skills/permdock-tenancy/SKILL.md +1 -1
  380. package/skills/permdock-tenancy/references/ownership-and-custom-roles.md +1 -0
  381. package/skills/permdock-wire/references/adapters.md +14 -0
  382. package/skills/permdock-wire/references/policy-options.md +1 -0
  383. package/dist/catalog-BoWglDPI.js +0 -1
  384. package/dist/collect-D7eQDffE.js +0 -1
  385. package/dist/index-Cp_ilKi1.d.ts +0 -91
  386. package/dist/load-BxEtwlBS.js +0 -1
  387. package/dist/output-files-B3IZJksC.js +0 -1
  388. package/dist/parse-Cxq0WxrA.js +0 -53
  389. package/dist/peer-C8swJ2GH.js +0 -50
  390. package/dist/powersync-BkWWCS1K.js +0 -538
  391. package/dist/powersync-MMJ2mI2q.js +0 -1
  392. package/dist/prompt-DfZLJLIn.js +0 -32
  393. package/dist/pull-CvpINcMK.js +0 -1
  394. package/dist/run-DDwUaJDU.js +0 -1
  395. package/dist/supabase-hook-CCw5m35C.js +0 -1
  396. package/dist/supautils-B6HYL9eL.js +0 -91
  397. package/dist/text-diff-BQcUapOb.js +0 -15
  398. package/dist/usage-CZpSQP6L.js +0 -1
  399. package/dist/watch--ovlPOc0.js +0 -1
@@ -0,0 +1,935 @@
1
+ import { t as __commonJSMin } from "./rolldown-runtime-C3I60J0A.js";
2
+ import { styleText } from "node:util";
3
+ import "node:fs";
4
+ import "node:path";
5
+ import l__default from "node:readline";
6
+ import process$1, { stdin, stdout } from "node:process";
7
+ import "node:tty";
8
+ //#region ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
9
+ const getCodePointsLength = (() => {
10
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
11
+ return (input) => {
12
+ let surrogatePairsNr = 0;
13
+ SURROGATE_PAIR_RE.lastIndex = 0;
14
+ while (SURROGATE_PAIR_RE.test(input)) surrogatePairsNr += 1;
15
+ return input.length - surrogatePairsNr;
16
+ };
17
+ })();
18
+ const isFullWidth = (x) => {
19
+ return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
20
+ };
21
+ const isWideNotCJKTNotEmoji = (x) => {
22
+ return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
23
+ };
24
+ //#endregion
25
+ //#region ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
26
+ const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
27
+ const CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
28
+ const CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy;
29
+ const TAB_RE = /\t{1,1000}/y;
30
+ const EMOJI_RE = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy;
31
+ const LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
32
+ const MODIFIER_RE = /\p{M}+/gu;
33
+ const NO_TRUNCATION$1 = {
34
+ limit: Infinity,
35
+ ellipsis: ""
36
+ };
37
+ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
38
+ const LIMIT = truncationOptions.limit ?? Infinity;
39
+ const ELLIPSIS = truncationOptions.ellipsis ?? "";
40
+ const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION$1, widthOptions).width : 0);
41
+ const ANSI_WIDTH = 0;
42
+ const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
43
+ const TAB_WIDTH = widthOptions.tabWidth ?? 8;
44
+ const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
45
+ const FULL_WIDTH_WIDTH = 2;
46
+ const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
47
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
48
+ const PARSE_BLOCKS = [
49
+ [LATIN_RE, REGULAR_WIDTH],
50
+ [ANSI_RE, ANSI_WIDTH],
51
+ [CONTROL_RE, CONTROL_WIDTH],
52
+ [TAB_RE, TAB_WIDTH],
53
+ [EMOJI_RE, EMOJI_WIDTH],
54
+ [CJKT_WIDE_RE, WIDE_WIDTH]
55
+ ];
56
+ let indexPrev = 0;
57
+ let index = 0;
58
+ let length = input.length;
59
+ let lengthExtra = 0;
60
+ let truncationEnabled = false;
61
+ let truncationIndex = length;
62
+ let truncationLimit = Math.max(0, LIMIT - ELLIPSIS_WIDTH);
63
+ let unmatchedStart = 0;
64
+ let unmatchedEnd = 0;
65
+ let width = 0;
66
+ let widthExtra = 0;
67
+ outer: while (true) {
68
+ if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
69
+ const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
70
+ lengthExtra = 0;
71
+ for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
72
+ const codePoint = char.codePointAt(0) || 0;
73
+ if (isFullWidth(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
74
+ else if (isWideNotCJKTNotEmoji(codePoint)) widthExtra = WIDE_WIDTH;
75
+ else widthExtra = REGULAR_WIDTH;
76
+ if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
77
+ if (width + widthExtra > LIMIT) {
78
+ truncationEnabled = true;
79
+ break outer;
80
+ }
81
+ lengthExtra += char.length;
82
+ width += widthExtra;
83
+ }
84
+ unmatchedStart = unmatchedEnd = 0;
85
+ }
86
+ if (index >= length) break outer;
87
+ for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {
88
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
89
+ BLOCK_RE.lastIndex = index;
90
+ if (BLOCK_RE.test(input)) {
91
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
92
+ widthExtra = lengthExtra * BLOCK_WIDTH;
93
+ if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
94
+ if (width + widthExtra > LIMIT) {
95
+ truncationEnabled = true;
96
+ break outer;
97
+ }
98
+ width += widthExtra;
99
+ unmatchedStart = indexPrev;
100
+ unmatchedEnd = index;
101
+ index = indexPrev = BLOCK_RE.lastIndex;
102
+ continue outer;
103
+ }
104
+ }
105
+ index += 1;
106
+ }
107
+ return {
108
+ width: truncationEnabled ? truncationLimit : width,
109
+ index: truncationEnabled ? truncationIndex : length,
110
+ truncated: truncationEnabled,
111
+ ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
112
+ };
113
+ };
114
+ //#endregion
115
+ //#region ../../node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
116
+ const NO_TRUNCATION = {
117
+ limit: Infinity,
118
+ ellipsis: "",
119
+ ellipsisWidth: 0
120
+ };
121
+ const fastStringWidth = (input, options = {}) => {
122
+ return getStringTruncatedWidth(input, NO_TRUNCATION, options).width;
123
+ };
124
+ //#endregion
125
+ //#region ../../node_modules/.pnpm/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js
126
+ const ESC = "\x1B";
127
+ const CSI = "›";
128
+ const END_CODE = 39;
129
+ const ANSI_ESCAPE_BELL = "\x07";
130
+ const ANSI_CSI = "[";
131
+ const ANSI_OSC = "]";
132
+ const ANSI_SGR_TERMINATOR = "m";
133
+ const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
134
+ const GROUP_REGEX = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`, "y");
135
+ const getClosingCode = (openingCode) => {
136
+ if (openingCode >= 30 && openingCode <= 37) return 39;
137
+ if (openingCode >= 90 && openingCode <= 97) return 39;
138
+ if (openingCode >= 40 && openingCode <= 47) return 49;
139
+ if (openingCode >= 100 && openingCode <= 107) return 49;
140
+ if (openingCode === 1 || openingCode === 2) return 22;
141
+ if (openingCode === 3) return 23;
142
+ if (openingCode === 4) return 24;
143
+ if (openingCode === 7) return 27;
144
+ if (openingCode === 8) return 28;
145
+ if (openingCode === 9) return 29;
146
+ if (openingCode === 0) return 0;
147
+ };
148
+ const wrapAnsiCode = (code) => `${ESC}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
149
+ const wrapAnsiHyperlink = (url) => `${ESC}${ANSI_ESCAPE_LINK}${url}${ANSI_ESCAPE_BELL}`;
150
+ const wrapWord = (rows, word, columns) => {
151
+ const characters = word[Symbol.iterator]();
152
+ let isInsideEscape = false;
153
+ let isInsideLinkEscape = false;
154
+ let lastRow = rows.at(-1);
155
+ let visible = lastRow === void 0 ? 0 : fastStringWidth(lastRow);
156
+ let currentCharacter = characters.next();
157
+ let nextCharacter = characters.next();
158
+ let rawCharacterIndex = 0;
159
+ while (!currentCharacter.done) {
160
+ const character = currentCharacter.value;
161
+ const characterLength = fastStringWidth(character);
162
+ if (visible + characterLength <= columns) rows[rows.length - 1] += character;
163
+ else {
164
+ rows.push(character);
165
+ visible = 0;
166
+ }
167
+ if (character === ESC || character === CSI) {
168
+ isInsideEscape = true;
169
+ isInsideLinkEscape = word.startsWith(ANSI_ESCAPE_LINK, rawCharacterIndex + 1);
170
+ }
171
+ if (isInsideEscape) {
172
+ if (isInsideLinkEscape) {
173
+ if (character === ANSI_ESCAPE_BELL) {
174
+ isInsideEscape = false;
175
+ isInsideLinkEscape = false;
176
+ }
177
+ } else if (character === ANSI_SGR_TERMINATOR) isInsideEscape = false;
178
+ } else {
179
+ visible += characterLength;
180
+ if (visible === columns && !nextCharacter.done) {
181
+ rows.push("");
182
+ visible = 0;
183
+ }
184
+ }
185
+ currentCharacter = nextCharacter;
186
+ nextCharacter = characters.next();
187
+ rawCharacterIndex += character.length;
188
+ }
189
+ lastRow = rows.at(-1);
190
+ if (!visible && lastRow !== void 0 && lastRow.length && rows.length > 1) rows[rows.length - 2] += rows.pop();
191
+ };
192
+ const stringVisibleTrimSpacesRight = (string) => {
193
+ const words = string.split(" ");
194
+ let last = words.length;
195
+ while (last) {
196
+ if (fastStringWidth(words[last - 1])) break;
197
+ last--;
198
+ }
199
+ if (last === words.length) return string;
200
+ return words.slice(0, last).join(" ") + words.slice(last).join("");
201
+ };
202
+ const exec = (string, columns, options = {}) => {
203
+ if (options.trim !== false && string.trim() === "") return "";
204
+ let returnValue = "";
205
+ let escapeCode;
206
+ let escapeUrl;
207
+ const words = string.split(" ");
208
+ let rows = [""];
209
+ let rowLength = 0;
210
+ for (let index = 0; index < words.length; index++) {
211
+ const word = words[index];
212
+ if (options.trim !== false) {
213
+ const row = rows.at(-1) ?? "";
214
+ const trimmed = row.trimStart();
215
+ if (row.length !== trimmed.length) {
216
+ rows[rows.length - 1] = trimmed;
217
+ rowLength = fastStringWidth(trimmed);
218
+ }
219
+ }
220
+ if (index !== 0) {
221
+ if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
222
+ rows.push("");
223
+ rowLength = 0;
224
+ }
225
+ if (rowLength || options.trim === false) {
226
+ rows[rows.length - 1] += " ";
227
+ rowLength++;
228
+ }
229
+ }
230
+ const wordLength = fastStringWidth(word);
231
+ if (options.hard && wordLength > columns) {
232
+ const remainingColumns = columns - rowLength;
233
+ const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
234
+ if (Math.floor((wordLength - 1) / columns) < breaksStartingThisLine) rows.push("");
235
+ wrapWord(rows, word, columns);
236
+ rowLength = fastStringWidth(rows.at(-1) ?? "");
237
+ continue;
238
+ }
239
+ if (rowLength + wordLength > columns && rowLength && wordLength) {
240
+ if (options.wordWrap === false && rowLength < columns) {
241
+ wrapWord(rows, word, columns);
242
+ rowLength = fastStringWidth(rows.at(-1) ?? "");
243
+ continue;
244
+ }
245
+ rows.push("");
246
+ rowLength = 0;
247
+ }
248
+ if (rowLength + wordLength > columns && options.wordWrap === false) {
249
+ wrapWord(rows, word, columns);
250
+ rowLength = fastStringWidth(rows.at(-1) ?? "");
251
+ continue;
252
+ }
253
+ rows[rows.length - 1] += word;
254
+ rowLength += wordLength;
255
+ }
256
+ if (options.trim !== false) rows = rows.map((row) => stringVisibleTrimSpacesRight(row));
257
+ const preString = rows.join("\n");
258
+ let inSurrogate = false;
259
+ for (let i = 0; i < preString.length; i++) {
260
+ const character = preString[i];
261
+ returnValue += character;
262
+ if (!inSurrogate) {
263
+ inSurrogate = character >= "\ud800" && character <= "\udbff";
264
+ if (inSurrogate) continue;
265
+ } else inSurrogate = false;
266
+ if (character === ESC || character === CSI) {
267
+ GROUP_REGEX.lastIndex = i + 1;
268
+ const groups = GROUP_REGEX.exec(preString)?.groups;
269
+ if (groups?.code !== void 0) {
270
+ const code = Number.parseFloat(groups.code);
271
+ escapeCode = code === END_CODE ? void 0 : code;
272
+ } else if (groups?.uri !== void 0) escapeUrl = groups.uri.length === 0 ? void 0 : groups.uri;
273
+ }
274
+ if (preString[i + 1] === "\n") {
275
+ if (escapeUrl) returnValue += wrapAnsiHyperlink("");
276
+ const closingCode = escapeCode ? getClosingCode(escapeCode) : void 0;
277
+ if (escapeCode && closingCode) returnValue += wrapAnsiCode(closingCode);
278
+ } else if (character === "\n") {
279
+ if (escapeCode && getClosingCode(escapeCode)) returnValue += wrapAnsiCode(escapeCode);
280
+ if (escapeUrl) returnValue += wrapAnsiHyperlink(escapeUrl);
281
+ }
282
+ }
283
+ return returnValue;
284
+ };
285
+ const CRLF_OR_LF = /\r?\n/;
286
+ function wrapAnsi(string, columns, options) {
287
+ return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
288
+ }
289
+ //#endregion
290
+ //#region ../../node_modules/.pnpm/@clack+core@1.5.1/node_modules/@clack/core/dist/index.mjs
291
+ var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
292
+ const ESC = "\x1B";
293
+ const CSI = `${ESC}[`;
294
+ const beep = "\x07";
295
+ const cursor = {
296
+ to(x, y) {
297
+ if (!y) return `${CSI}${x + 1}G`;
298
+ return `${CSI}${y + 1};${x + 1}H`;
299
+ },
300
+ move(x, y) {
301
+ let ret = "";
302
+ if (x < 0) ret += `${CSI}${-x}D`;
303
+ else if (x > 0) ret += `${CSI}${x}C`;
304
+ if (y < 0) ret += `${CSI}${-y}A`;
305
+ else if (y > 0) ret += `${CSI}${y}B`;
306
+ return ret;
307
+ },
308
+ up: (count = 1) => `${CSI}${count}A`,
309
+ down: (count = 1) => `${CSI}${count}B`,
310
+ forward: (count = 1) => `${CSI}${count}C`,
311
+ backward: (count = 1) => `${CSI}${count}D`,
312
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
313
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
314
+ left: `${CSI}G`,
315
+ hide: `${CSI}?25l`,
316
+ show: `${CSI}?25h`,
317
+ save: `${ESC}7`,
318
+ restore: `${ESC}8`
319
+ };
320
+ module.exports = {
321
+ cursor,
322
+ scroll: {
323
+ up: (count = 1) => `${CSI}S`.repeat(count),
324
+ down: (count = 1) => `${CSI}T`.repeat(count)
325
+ },
326
+ erase: {
327
+ screen: `${CSI}2J`,
328
+ up: (count = 1) => `${CSI}1J`.repeat(count),
329
+ down: (count = 1) => `${CSI}J`.repeat(count),
330
+ line: `${CSI}2K`,
331
+ lineEnd: `${CSI}K`,
332
+ lineStart: `${CSI}1K`,
333
+ lines(count) {
334
+ let clear = "";
335
+ for (let i = 0; i < count; i++) clear += this.line + (i < count - 1 ? cursor.up() : "");
336
+ if (count) clear += cursor.left;
337
+ return clear;
338
+ }
339
+ },
340
+ beep
341
+ };
342
+ })))();
343
+ function findCursor(s, o, l) {
344
+ if (!l.some((r) => !r.disabled)) return s;
345
+ const t = s + o, n = Math.max(l.length - 1, 0), e = t < 0 ? n : t > n ? 0 : t;
346
+ return l[e]?.disabled ? findCursor(e, o < 0 ? -1 : 1, l) : e;
347
+ }
348
+ const settings = {
349
+ actions: /* @__PURE__ */ new Set([
350
+ "up",
351
+ "down",
352
+ "left",
353
+ "right",
354
+ "space",
355
+ "enter",
356
+ "cancel"
357
+ ]),
358
+ aliases: /* @__PURE__ */ new Map([
359
+ ["k", "up"],
360
+ ["j", "down"],
361
+ ["h", "left"],
362
+ ["l", "right"],
363
+ ["", "cancel"],
364
+ ["escape", "cancel"]
365
+ ]),
366
+ messages: {
367
+ cancel: "Canceled",
368
+ error: "Something went wrong"
369
+ },
370
+ withGuide: true,
371
+ accessible: void 0,
372
+ date: {
373
+ monthNames: [...[
374
+ "January",
375
+ "February",
376
+ "March",
377
+ "April",
378
+ "May",
379
+ "June",
380
+ "July",
381
+ "August",
382
+ "September",
383
+ "October",
384
+ "November",
385
+ "December"
386
+ ]],
387
+ messages: {
388
+ required: "Please enter a valid date",
389
+ invalidMonth: "There are only 12 months in a year",
390
+ invalidDay: (n, e) => `There are only ${n} days in ${e}`,
391
+ afterMin: (n) => `Date must be on or after ${n.toISOString().slice(0, 10)}`,
392
+ beforeMax: (n) => `Date must be on or before ${n.toISOString().slice(0, 10)}`
393
+ }
394
+ }
395
+ };
396
+ function isAccessible(n) {
397
+ if (n !== void 0) return n;
398
+ if (settings.accessible !== void 0) return settings.accessible;
399
+ const e = process.env.ACCESSIBLE;
400
+ return e !== void 0 && e !== "" && e !== "0" && e !== "false";
401
+ }
402
+ function isActionKey(n, e) {
403
+ if (typeof n == "string") return settings.aliases.get(n) === e;
404
+ for (const s of n) if (s !== void 0 && isActionKey(s, e)) return true;
405
+ return false;
406
+ }
407
+ function diffLines(i, s) {
408
+ if (i === s) return;
409
+ const e = i.split(`
410
+ `), t = s.split(`
411
+ `), r = Math.max(e.length, t.length), f = [];
412
+ for (let n = 0; n < r; n++) e[n] !== t[n] && f.push(n);
413
+ return {
414
+ lines: f,
415
+ numLinesBefore: e.length,
416
+ numLinesAfter: t.length,
417
+ numLines: r
418
+ };
419
+ }
420
+ globalThis.process.platform.startsWith("win");
421
+ const CANCEL_SYMBOL = Symbol("clack:cancel");
422
+ function isCancel(e) {
423
+ return e === CANCEL_SYMBOL;
424
+ }
425
+ function setRawMode(e, r) {
426
+ const o = e;
427
+ o.isTTY && o.setRawMode(r);
428
+ }
429
+ const getColumns = (e) => "columns" in e && typeof e.columns == "number" ? e.columns : 80;
430
+ const getRows = (e) => "rows" in e && typeof e.rows == "number" ? e.rows : 20;
431
+ function wrapTextWithPrefix(e, r, o, n = o, s = o, t) {
432
+ return wrapAnsi(r, getColumns(e ?? stdout) - o.length, {
433
+ hard: true,
434
+ trim: false
435
+ }).split(`
436
+ `).map((c, i, m) => {
437
+ const d = t ? t(c, i) : c;
438
+ return i === 0 ? `${n}${d}` : i === m.length - 1 ? `${s}${d}` : `${o}${d}`;
439
+ }).join(`
440
+ `);
441
+ }
442
+ function runValidation(e, a) {
443
+ if ("~standard" in e) {
444
+ const n = e["~standard"].validate(a);
445
+ return n instanceof Promise ? n.then((r) => r.issues?.at(0)?.message) : n.issues?.at(0)?.message;
446
+ }
447
+ return e(a);
448
+ }
449
+ var y = class {
450
+ input;
451
+ output;
452
+ _abortSignal;
453
+ rl;
454
+ opts;
455
+ _render;
456
+ _track = false;
457
+ _prevFrame = "";
458
+ _subscribers = /* @__PURE__ */ new Map();
459
+ _cursor = 0;
460
+ state = "initial";
461
+ error = "";
462
+ value;
463
+ userInput = "";
464
+ /**
465
+ * Whether accessible (static, screen-reader friendly) output is enabled for
466
+ * this prompt, resolved from the `accessible` option, the global setting,
467
+ * and the `ACCESSIBLE` env var.
468
+ */
469
+ get accessible() {
470
+ return isAccessible(this.opts.accessible);
471
+ }
472
+ constructor(t, e = true) {
473
+ const { input: i = stdin, output: s = stdout, render: r, signal: n, ...o } = t;
474
+ this.opts = o, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = r.bind(this), this._track = e, this._abortSignal = n, this.input = i, this.output = s;
475
+ }
476
+ /**
477
+ * Unsubscribe all listeners
478
+ */
479
+ unsubscribe() {
480
+ this._subscribers.clear();
481
+ }
482
+ /**
483
+ * Set a subscriber with opts
484
+ * @param event - The event name
485
+ */
486
+ setSubscriber(t, e) {
487
+ const i = this._subscribers.get(t) ?? [];
488
+ i.push(e), this._subscribers.set(t, i);
489
+ }
490
+ /**
491
+ * Subscribe to an event
492
+ * @param event - The event name
493
+ * @param cb - The callback
494
+ */
495
+ on(t, e) {
496
+ this.setSubscriber(t, { cb: e });
497
+ }
498
+ /**
499
+ * Subscribe to an event once
500
+ * @param event - The event name
501
+ * @param cb - The callback
502
+ */
503
+ once(t, e) {
504
+ this.setSubscriber(t, {
505
+ cb: e,
506
+ once: true
507
+ });
508
+ }
509
+ /**
510
+ * Emit an event with data
511
+ * @param event - The event name
512
+ * @param data - The data to pass to the callback
513
+ */
514
+ emit(t, ...e) {
515
+ const i = this._subscribers.get(t) ?? [], s = [];
516
+ for (const r of i) r.cb(...e), r.once && s.push(() => i.splice(i.indexOf(r), 1));
517
+ for (const r of s) r();
518
+ }
519
+ prompt() {
520
+ return new Promise((t) => {
521
+ if (this._abortSignal) {
522
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), t(CANCEL_SYMBOL);
523
+ this._abortSignal.addEventListener("abort", () => {
524
+ this.state = "cancel", this.close();
525
+ }, { once: true });
526
+ }
527
+ this.rl = l__default.createInterface({
528
+ input: this.input,
529
+ tabSize: 2,
530
+ prompt: "",
531
+ escapeCodeTimeout: 50,
532
+ terminal: true
533
+ }), this.rl.prompt(), this.opts.initialUserInput !== void 0 && this._setUserInput(this.opts.initialUserInput, true), this.input.on("keypress", this.onKeypress), setRawMode(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
534
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t(this.value);
535
+ }), this.once("cancel", () => {
536
+ this.output.write(import_src.cursor.show), this.output.off("resize", this.render), setRawMode(this.input, false), t(CANCEL_SYMBOL);
537
+ });
538
+ });
539
+ }
540
+ _isActionKey(t, e) {
541
+ return t === " ";
542
+ }
543
+ _shouldSubmit(t, e) {
544
+ return true;
545
+ }
546
+ _setValue(t) {
547
+ this.value = t, this.emit("value", this.value);
548
+ }
549
+ _setUserInput(t, e) {
550
+ this.userInput = t ?? "", this.emit("userInput", this.userInput), e && this._track && this.rl && (this.rl.write(this.userInput), this._cursor = this.rl.cursor);
551
+ }
552
+ _clearUserInput() {
553
+ this.rl?.write(null, {
554
+ ctrl: true,
555
+ name: "u"
556
+ }), this._setUserInput("");
557
+ }
558
+ async onKeypress(t, e) {
559
+ if (this.state !== "validating") {
560
+ if (this._track && e.name !== "return" && (e.name && this._isActionKey(t, e) && this.rl?.write(null, {
561
+ ctrl: true,
562
+ name: "h"
563
+ }), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), e?.name && (!this._track && settings.aliases.has(e.name) && this.emit("cursor", settings.aliases.get(e.name)), settings.actions.has(e.name) && this.emit("cursor", e.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t, e), e?.name === "return" && this._shouldSubmit(t, e)) {
564
+ if (this.opts.validate) {
565
+ const i = runValidation(this.opts.validate, this.value);
566
+ let s;
567
+ i instanceof Promise ? (this.state = "validating", this.render(), s = await i) : s = i, s && (this.error = s instanceof Error ? s.message : s, this.state = "error", this.rl?.write(this.userInput));
568
+ }
569
+ this.state !== "error" && (this.state = "submit");
570
+ }
571
+ isActionKey([
572
+ t,
573
+ e?.name,
574
+ e?.sequence
575
+ ], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
576
+ }
577
+ }
578
+ close() {
579
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
580
+ `), setRawMode(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
581
+ }
582
+ restoreCursor() {
583
+ const t = wrapAnsi(this._prevFrame, process.stdout.columns, {
584
+ hard: true,
585
+ trim: false
586
+ }).split(`
587
+ `).length - 1;
588
+ this.output.write(import_src.cursor.move(-999, t * -1));
589
+ }
590
+ render() {
591
+ const t = wrapAnsi(this._render(this) ?? "", process.stdout.columns, {
592
+ hard: true,
593
+ trim: false
594
+ });
595
+ if (t !== this._prevFrame) {
596
+ if (this.state === "initial") this.output.write(import_src.cursor.hide);
597
+ else {
598
+ const e = diffLines(this._prevFrame, t), i = getRows(this.output);
599
+ if (this.restoreCursor(), e) {
600
+ const s = Math.max(0, e.numLinesAfter - i), r = Math.max(0, e.numLinesBefore - i);
601
+ let n = e.lines.find((o) => o >= s);
602
+ if (n === void 0) {
603
+ this._prevFrame = t;
604
+ return;
605
+ }
606
+ if (e.lines.length === 1) {
607
+ this.output.write(import_src.cursor.move(0, n - r)), this.output.write(import_src.erase.lines(1));
608
+ const o = t.split(`
609
+ `);
610
+ this.output.write(o[n]), this._prevFrame = t, this.output.write(import_src.cursor.move(0, o.length - n - 1));
611
+ return;
612
+ } else if (e.lines.length > 1) {
613
+ if (s < r) n = s;
614
+ else {
615
+ const h = n - r;
616
+ h > 0 && this.output.write(import_src.cursor.move(0, h));
617
+ }
618
+ this.output.write(import_src.erase.down());
619
+ const f = t.split(`
620
+ `).slice(n);
621
+ this.output.write(f.join(`
622
+ `)), this._prevFrame = t;
623
+ return;
624
+ }
625
+ }
626
+ this.output.write(import_src.erase.down());
627
+ }
628
+ this.output.write(t), this.state === "initial" && (this.state = "active"), this._prevFrame = t;
629
+ }
630
+ }
631
+ };
632
+ var r = class extends y {
633
+ get cursor() {
634
+ return this.value ? 0 : 1;
635
+ }
636
+ get _value() {
637
+ return this.cursor === 0;
638
+ }
639
+ constructor(t) {
640
+ super(t, false), this.value = !!t.initialValue, this.on("userInput", () => {
641
+ this.value = this._value;
642
+ }), this.on("confirm", (i) => {
643
+ this.output.write(import_src.cursor.move(0, -1)), this.value = i, this.state = "submit", this.close();
644
+ }), this.on("cursor", () => {
645
+ this.value = !this.value;
646
+ });
647
+ }
648
+ };
649
+ var a = class extends y {
650
+ options;
651
+ cursor = 0;
652
+ get _value() {
653
+ return this.options[this.cursor]?.value;
654
+ }
655
+ get _enabledOptions() {
656
+ return this.options.filter((e) => e.disabled !== true);
657
+ }
658
+ toggleAll() {
659
+ const e = this._enabledOptions, i = this.value !== void 0 && this.value.length === e.length;
660
+ this.value = i ? [] : e.map((t) => t.value);
661
+ }
662
+ toggleInvert() {
663
+ const e = this.value;
664
+ if (!e) return;
665
+ const i = this._enabledOptions.filter((t) => !e.includes(t.value));
666
+ this.value = i.map((t) => t.value);
667
+ }
668
+ toggleValue() {
669
+ this.value === void 0 && (this.value = []);
670
+ const e = this.value.includes(this._value);
671
+ this.value = e ? this.value.filter((i) => i !== this._value) : [...this.value, this._value];
672
+ }
673
+ constructor(e) {
674
+ super(e, false), this.options = e.options, this.value = [...e.initialValues ?? []];
675
+ const i = Math.max(this.options.findIndex(({ value: t }) => t === e.cursorAt), 0);
676
+ this.cursor = this.options[i]?.disabled ? findCursor(i, 1, this.options) : i, this.on("key", (t, l) => {
677
+ l.name === "a" && this.toggleAll(), l.name === "i" && this.toggleInvert();
678
+ }), this.on("cursor", (t) => {
679
+ switch (t) {
680
+ case "left":
681
+ case "up":
682
+ this.cursor = findCursor(this.cursor, -1, this.options);
683
+ break;
684
+ case "down":
685
+ case "right":
686
+ this.cursor = findCursor(this.cursor, 1, this.options);
687
+ break;
688
+ case "space": this.toggleValue();
689
+ }
690
+ });
691
+ }
692
+ };
693
+ //#endregion
694
+ //#region ../../node_modules/.pnpm/@clack+prompts@1.8.1/node_modules/@clack/prompts/dist/index.mjs
695
+ function isUnicodeSupported() {
696
+ if (process$1.platform !== "win32") return process$1.env.TERM !== "linux";
697
+ return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
698
+ }
699
+ const unicode = isUnicodeSupported();
700
+ const unicodeOr = (o, e) => unicode ? o : e;
701
+ const S_STEP_ACTIVE = unicodeOr("◆", "*");
702
+ const S_STEP_CANCEL = unicodeOr("■", "x");
703
+ const S_STEP_ERROR = unicodeOr("▲", "x");
704
+ const S_STEP_SUBMIT = unicodeOr("◇", "o");
705
+ const S_BAR = unicodeOr("│", "|");
706
+ const S_BAR_END = unicodeOr("└", "—");
707
+ const S_RADIO_ACTIVE = unicodeOr("●", ">");
708
+ const S_RADIO_INACTIVE = unicodeOr("○", " ");
709
+ const S_CHECKBOX_ACTIVE = unicodeOr("◻", "[•]");
710
+ const S_CHECKBOX_SELECTED = unicodeOr("◼", "[+]");
711
+ const S_CHECKBOX_INACTIVE = unicodeOr("◻", "[ ]");
712
+ const symbol = (o) => {
713
+ switch (o) {
714
+ case "initial":
715
+ case "active": return styleText("cyan", S_STEP_ACTIVE);
716
+ case "cancel": return styleText("red", S_STEP_CANCEL);
717
+ case "error": return styleText("yellow", S_STEP_ERROR);
718
+ case "submit": return styleText("green", S_STEP_SUBMIT);
719
+ case "validating": return styleText("dim", S_STEP_ACTIVE);
720
+ }
721
+ };
722
+ const symbolBar = (o) => {
723
+ switch (o) {
724
+ case "initial":
725
+ case "active": return styleText("cyan", S_BAR);
726
+ case "cancel": return styleText("red", S_BAR);
727
+ case "error": return styleText("yellow", S_BAR);
728
+ case "submit": return styleText("green", S_BAR);
729
+ }
730
+ };
731
+ function formatInstructionFooter(o, e) {
732
+ const r = [`${e ? `${styleText("cyan", S_BAR)} ` : ""}${o.join(" • ")}`];
733
+ return e && r.push(styleText("cyan", S_BAR_END)), r;
734
+ }
735
+ const I = (l, e, w, p, b, C = false) => {
736
+ let r = e, O = 0;
737
+ if (C) for (let i = p - 1; i >= w; i--) {
738
+ const m = l[i];
739
+ if (m && (r -= m.length), O++, r <= b) break;
740
+ }
741
+ else for (let i = w; i < p; i++) {
742
+ const m = l[i];
743
+ if (m && (r -= m.length), O++, r <= b) break;
744
+ }
745
+ return {
746
+ lineCount: r,
747
+ removals: O
748
+ };
749
+ };
750
+ const limitOptions = ({ cursor: l, options: e, style: w, output: p = process.stdout, maxItems: b = Number.POSITIVE_INFINITY, columnPadding: C = 0, rowPadding: r = 4 }) => {
751
+ const i = getColumns(p) - C, m = getRows(p), M = styleText("dim", "..."), v = Math.max(m - r, 0), a = Math.max(Math.min(b, v), 5);
752
+ let f = 0;
753
+ l >= a - 3 && (f = Math.max(Math.min(l - a + 3, e.length - a), 0));
754
+ let d = a < e.length && f > 0, c = a < e.length && f + a < e.length;
755
+ const W = Math.min(f + a, e.length), s = [];
756
+ let g = 0;
757
+ d && g++, c && g++;
758
+ const T = f + (d ? 1 : 0), y = W - (c ? 1 : 0);
759
+ for (let t = T; t < y; t++) {
760
+ const n = e[t], h = wrapAnsi(n ? w(n, t === l) : "", i, {
761
+ hard: true,
762
+ trim: false
763
+ }).split(`
764
+ `);
765
+ s.push(h), g += h.length;
766
+ }
767
+ if (g > v) {
768
+ let t = 0, n = 0, o = g;
769
+ const h = l - T;
770
+ let u = v;
771
+ const L = () => I(s, o, 0, h, u), E = () => I(s, o, h + 1, s.length, u, true);
772
+ d ? ({lineCount: o, removals: t} = L(), o > u && (c || (u -= 1), {lineCount: o, removals: n} = E())) : (c || (u -= 1), {lineCount: o, removals: n} = E(), o > u && (u -= 1, {lineCount: o, removals: t} = L())), t > 0 && (d = true, s.splice(0, t)), n > 0 && (c = true, s.splice(s.length - n, n));
773
+ }
774
+ const x = [];
775
+ d && x.push(M);
776
+ for (const t of s) for (const n of t) x.push(n);
777
+ return c && x.push(M), x;
778
+ };
779
+ const confirm = (e) => {
780
+ const a = e.active ?? "Yes", o = e.inactive ?? "No";
781
+ return new r({
782
+ active: a,
783
+ inactive: o,
784
+ signal: e.signal,
785
+ input: e.input,
786
+ output: e.output,
787
+ initialValue: e.initialValue ?? true,
788
+ render() {
789
+ const i = e.withGuide ?? settings.withGuide, u = `${symbol(this.state)} `, l = i ? `${styleText("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(e.output, e.message, l, u), s = `${i ? `${styleText("gray", S_BAR)}
790
+ ` : ""}${f}
791
+ `, c = this.value ? a : o;
792
+ switch (this.state) {
793
+ case "submit": return `${s}${i ? `${styleText("gray", S_BAR)} ` : ""}${styleText("dim", c)}`;
794
+ case "cancel": return `${s}${i ? `${styleText("gray", S_BAR)} ` : ""}${styleText(["strikethrough", "dim"], c)}${i ? `
795
+ ${styleText("gray", S_BAR)}` : ""}`;
796
+ default: {
797
+ const r = i ? `${styleText("cyan", S_BAR)} ` : "", g = i ? styleText("cyan", S_BAR_END) : "";
798
+ return `${s}${r}${this.value ? `${styleText("green", S_RADIO_ACTIVE)} ${a}` : `${styleText("dim", S_RADIO_INACTIVE)} ${styleText("dim", a)}`}${e.vertical ? i ? `
799
+ ${styleText("cyan", S_BAR)} ` : `
800
+ ` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", S_RADIO_INACTIVE)} ${styleText("dim", o)}` : `${styleText("green", S_RADIO_ACTIVE)} ${o}`}
801
+ ${g}
802
+ `;
803
+ }
804
+ }
805
+ }
806
+ }).prompt();
807
+ };
808
+ const MULTISELECT_INSTRUCTIONS = [
809
+ `${styleText("dim", "↑/↓")} to navigate`,
810
+ `${styleText("dim", "Space:")} select`,
811
+ `${styleText("dim", "Enter:")} confirm`
812
+ ];
813
+ const m = (i, u) => i.split(`
814
+ `).map((d) => u(d)).join(`
815
+ `);
816
+ const multiselect = (i) => {
817
+ const u = (t, a) => {
818
+ const r = t.label ?? String(t.value);
819
+ return a === "disabled" ? `${styleText("gray", S_CHECKBOX_INACTIVE)} ${m(r, (o) => styleText(["strikethrough", "gray"], o))}${t.hint ? ` ${styleText("dim", `(${t.hint ?? "disabled"})`)}` : ""}` : a === "active" ? `${styleText("cyan", S_CHECKBOX_ACTIVE)} ${r}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "selected" ? `${styleText("green", S_CHECKBOX_SELECTED)} ${m(r, (o) => styleText("dim", o))}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "cancelled" ? `${m(r, (o) => styleText(["strikethrough", "dim"], o))}` : a === "active-selected" ? `${styleText("green", S_CHECKBOX_SELECTED)} ${r}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : a === "submitted" ? `${m(r, (o) => styleText("dim", o))}` : `${styleText("dim", S_CHECKBOX_INACTIVE)} ${m(r, (o) => styleText("dim", o))}`;
820
+ }, d = i.required ?? true, x = i.showInstructions ?? true;
821
+ return new a({
822
+ options: i.options,
823
+ signal: i.signal,
824
+ input: i.input,
825
+ output: i.output,
826
+ initialValues: i.initialValues,
827
+ required: d,
828
+ cursorAt: i.cursorAt,
829
+ validate(t) {
830
+ if (d && (t === void 0 || t.length === 0)) return `Please select at least one option.
831
+ ${styleText("reset", styleText("dim", `Press ${styleText([
832
+ "gray",
833
+ "bgWhite",
834
+ "inverse"
835
+ ], " space ")} to select, ${styleText("gray", styleText("bgWhite", styleText("inverse", " enter ")))} to submit`))}`;
836
+ },
837
+ render() {
838
+ const t = i.withGuide ?? settings.withGuide, a = wrapTextWithPrefix(i.output, i.message, t ? `${symbolBar(this.state)} ` : "", `${symbol(this.state)} `), r = `${t ? `${styleText("gray", S_BAR)}
839
+ ` : ""}${a}
840
+ `, o = this.value ?? [], g = (n, l) => {
841
+ if (n.disabled) return u(n, "disabled");
842
+ const s = o.includes(n.value);
843
+ return l && s ? u(n, "active-selected") : s ? u(n, "selected") : u(n, l ? "active" : "inactive");
844
+ };
845
+ switch (this.state) {
846
+ case "submit": {
847
+ const n = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none");
848
+ return `${r}${wrapTextWithPrefix(i.output, n, t ? `${styleText("gray", S_BAR)} ` : "")}`;
849
+ }
850
+ case "cancel": {
851
+ const n = this.options.filter(({ value: s }) => o.includes(s)).map((s) => u(s, "cancelled")).join(styleText("dim", ", "));
852
+ if (n.trim() === "") return `${r}${styleText("gray", S_BAR)}`;
853
+ return `${r}${wrapTextWithPrefix(i.output, n, t ? `${styleText("gray", S_BAR)} ` : "")}${t ? `
854
+ ${styleText("gray", S_BAR)}` : ""}`;
855
+ }
856
+ case "error": {
857
+ const n = t ? `${styleText("yellow", S_BAR)} ` : "", l = this.error.split(`
858
+ `).map(($, v) => v === 0 ? `${t ? `${styleText("yellow", S_BAR_END)} ` : ""}${styleText("yellow", $)}` : ` ${$}`).join(`
859
+ `), s = r.split(`
860
+ `).length, h = l.split(`
861
+ `).length + 1;
862
+ return `${r}${n}${limitOptions({
863
+ output: i.output,
864
+ options: this.options,
865
+ cursor: this.cursor,
866
+ maxItems: i.maxItems,
867
+ columnPadding: n.length,
868
+ rowPadding: s + h,
869
+ style: g
870
+ }).join(`
871
+ ${n}`)}
872
+ ${l}
873
+ `;
874
+ }
875
+ default: {
876
+ const n = t ? `${styleText("cyan", S_BAR)} ` : "", l = r.split(`
877
+ `).length, s = x ? formatInstructionFooter(MULTISELECT_INSTRUCTIONS, t) : t ? [styleText("cyan", S_BAR_END)] : [], h = s.join(`
878
+ `), $ = s.length + 1;
879
+ return `${r}${n}${limitOptions({
880
+ output: i.output,
881
+ options: this.options,
882
+ cursor: this.cursor,
883
+ maxItems: i.maxItems,
884
+ columnPadding: n.length,
885
+ rowPadding: l + $,
886
+ style: g
887
+ }).join(`
888
+ ${n}`)}
889
+ ${h}
890
+ `;
891
+ }
892
+ }
893
+ }
894
+ }).prompt();
895
+ };
896
+ const cancel = (o = "", t) => {
897
+ const i = t?.output ?? process.stdout, e = t?.withGuide ?? settings.withGuide ? `${styleText("gray", S_BAR_END)} ` : "";
898
+ i.write(`${e}${styleText("red", o)}
899
+
900
+ `);
901
+ };
902
+ `${styleText("dim", "↑/↓")}`, `${styleText("dim", "Enter:")}`;
903
+ `${styleText("gray", S_BAR)}`;
904
+ //#endregion
905
+ //#region src/cli/core/prompt.ts
906
+ /** What a command reports when the person at the terminal cancels a prompt. */
907
+ const CANCELLED = {
908
+ code: 130,
909
+ output: "Cancelled."
910
+ };
911
+ /** A yes or no question; `undefined` when cancelled. */
912
+ async function ask(message) {
913
+ const answer = await confirm({ message });
914
+ if (isCancel(answer)) {
915
+ cancel();
916
+ return;
917
+ }
918
+ return answer;
919
+ }
920
+ /** Pick one or more of `options`, `initial` preselected; `undefined` when cancelled. */
921
+ async function pick(message, options, initial) {
922
+ const answer = await multiselect({
923
+ message,
924
+ options: options.map((option) => ({ ...option })),
925
+ initialValues: [...initial],
926
+ required: true
927
+ });
928
+ if (isCancel(answer)) {
929
+ cancel();
930
+ return;
931
+ }
932
+ return answer;
933
+ }
934
+ //#endregion
935
+ export { ask as n, pick as r, CANCELLED as t };