@keystrokehq/cli 0.1.2 → 0.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 (237) hide show
  1. package/dist/alias-RTYYYW3D-CLFgrowj.mjs +98 -0
  2. package/dist/alias-RTYYYW3D-CLFgrowj.mjs.map +1 -0
  3. package/dist/awk2-LA3USKJP-BbsfXVlR.mjs +2737 -0
  4. package/dist/awk2-LA3USKJP-BbsfXVlR.mjs.map +1 -0
  5. package/dist/base64-C2AIWVNC-C0WIgu5V.mjs +123 -0
  6. package/dist/base64-C2AIWVNC-C0WIgu5V.mjs.map +1 -0
  7. package/dist/basename-UB3CIYNI-BgNN3bGm.mjs +53 -0
  8. package/dist/basename-UB3CIYNI-BgNN3bGm.mjs.map +1 -0
  9. package/dist/bash-YZ33HQZQ-N6YyKtUH.mjs +118 -0
  10. package/dist/bash-YZ33HQZQ-N6YyKtUH.mjs.map +1 -0
  11. package/dist/cat-TSFMZVYS-Dz3-oHsV.mjs +63 -0
  12. package/dist/cat-TSFMZVYS-Dz3-oHsV.mjs.map +1 -0
  13. package/dist/chmod-TFEPA42X-YF02QJUv.mjs +125 -0
  14. package/dist/chmod-TFEPA42X-YF02QJUv.mjs.map +1 -0
  15. package/dist/chunk-27JIFWUR-B6ZjjMMI.mjs +100 -0
  16. package/dist/chunk-27JIFWUR-B6ZjjMMI.mjs.map +1 -0
  17. package/dist/chunk-4I3HOE5Z-BixWWVkW.mjs +719 -0
  18. package/dist/chunk-4I3HOE5Z-BixWWVkW.mjs.map +1 -0
  19. package/dist/chunk-4RUAZWKT-D60fyWAB.mjs +22543 -0
  20. package/dist/chunk-4RUAZWKT-D60fyWAB.mjs.map +1 -0
  21. package/dist/chunk-4WKZNNJK-CiwxAWRf.mjs +69 -0
  22. package/dist/chunk-4WKZNNJK-CiwxAWRf.mjs.map +1 -0
  23. package/dist/chunk-5H5SCKJM-BvfXlL01.mjs +606 -0
  24. package/dist/chunk-5H5SCKJM-BvfXlL01.mjs.map +1 -0
  25. package/dist/chunk-AQ6FYS2X-CkVetjym.mjs +37 -0
  26. package/dist/chunk-AQ6FYS2X-CkVetjym.mjs.map +1 -0
  27. package/dist/chunk-BZUGFHVS-CPWRFwK8.mjs +34 -0
  28. package/dist/chunk-BZUGFHVS-CPWRFwK8.mjs.map +1 -0
  29. package/dist/chunk-CHFEPBH4-BUdgjFtD.mjs +594 -0
  30. package/dist/chunk-CHFEPBH4-BUdgjFtD.mjs.map +1 -0
  31. package/dist/chunk-DLL7UR66-BUYgzxnR.mjs +14 -0
  32. package/dist/chunk-DLL7UR66-BUYgzxnR.mjs.map +1 -0
  33. package/dist/chunk-DiodbrVj.mjs +27 -0
  34. package/dist/chunk-EBAPSGAO-Ctfslw2R.mjs +247 -0
  35. package/dist/chunk-EBAPSGAO-Ctfslw2R.mjs.map +1 -0
  36. package/dist/chunk-FOCWZZDE-BIntqBh2.mjs +19 -0
  37. package/dist/chunk-FOCWZZDE-BIntqBh2.mjs.map +1 -0
  38. package/dist/chunk-HBVMHTO5-CJyD-QZX.mjs +10 -0
  39. package/dist/chunk-HBVMHTO5-CJyD-QZX.mjs.map +1 -0
  40. package/dist/chunk-L2UW7DWF-B3tEHhPF.mjs +14 -0
  41. package/dist/chunk-L2UW7DWF-B3tEHhPF.mjs.map +1 -0
  42. package/dist/chunk-L64BMZUV-CyR7RKok.mjs +30 -0
  43. package/dist/chunk-L64BMZUV-CyR7RKok.mjs.map +1 -0
  44. package/dist/chunk-LEKBROJD-CJMrAyu9.mjs +3113 -0
  45. package/dist/chunk-LEKBROJD-CJMrAyu9.mjs.map +1 -0
  46. package/dist/chunk-NRSASXYY-CuWyREpD.mjs +41 -0
  47. package/dist/chunk-NRSASXYY-CuWyREpD.mjs.map +1 -0
  48. package/dist/chunk-QAYAQNCG-Bl0Kbd53.mjs +63 -0
  49. package/dist/chunk-QAYAQNCG-Bl0Kbd53.mjs.map +1 -0
  50. package/dist/chunk-QIQMJJZ4-BwKdslXs.mjs +93 -0
  51. package/dist/chunk-QIQMJJZ4-BwKdslXs.mjs.map +1 -0
  52. package/dist/chunk-SAI2SPQQ-CVRoDNs9.mjs +26 -0
  53. package/dist/chunk-SAI2SPQQ-CVRoDNs9.mjs.map +1 -0
  54. package/dist/chunk-SO6R3ZKN-tTw_RMDX.mjs +140 -0
  55. package/dist/chunk-SO6R3ZKN-tTw_RMDX.mjs.map +1 -0
  56. package/dist/chunk-STHBFACM-lyj-j2a-.mjs +8 -0
  57. package/dist/chunk-STHBFACM-lyj-j2a-.mjs.map +1 -0
  58. package/dist/chunk-SX2HC7SO-Cc4Hpis1.mjs +20 -0
  59. package/dist/chunk-SX2HC7SO-Cc4Hpis1.mjs.map +1 -0
  60. package/dist/chunk-TDD4NFYE-wsWW75MX.mjs +21 -0
  61. package/dist/chunk-TDD4NFYE-wsWW75MX.mjs.map +1 -0
  62. package/dist/chunk-TN7HHBQW-CSB_R-XD.mjs +1137 -0
  63. package/dist/chunk-TN7HHBQW-CSB_R-XD.mjs.map +1 -0
  64. package/dist/chunk-VPADYNBD-BKlA28GJ.mjs +122 -0
  65. package/dist/chunk-VPADYNBD-BKlA28GJ.mjs.map +1 -0
  66. package/dist/chunk-W5DWRFSU-lCyWk0ph.mjs +11 -0
  67. package/dist/chunk-W5DWRFSU-lCyWk0ph.mjs.map +1 -0
  68. package/dist/chunk-WNH3HOQA-BCZUOjCJ.mjs +34 -0
  69. package/dist/chunk-WNH3HOQA-BCZUOjCJ.mjs.map +1 -0
  70. package/dist/chunk-XRFHFXFP-BGxzVZgK.mjs +16 -0
  71. package/dist/chunk-XRFHFXFP-BGxzVZgK.mjs.map +1 -0
  72. package/dist/chunk-YCLFEX4T-COc1AThz.mjs +77 -0
  73. package/dist/chunk-YCLFEX4T-COc1AThz.mjs.map +1 -0
  74. package/dist/clear-HKGFEOF6-CekN2x-O.mjs +28 -0
  75. package/dist/clear-HKGFEOF6-CekN2x-O.mjs.map +1 -0
  76. package/dist/column-XT6UFXNQ-DHENV9D2.mjs +143 -0
  77. package/dist/column-XT6UFXNQ-DHENV9D2.mjs.map +1 -0
  78. package/dist/comm-VV2LDX2J-ppxDJFkY.mjs +87 -0
  79. package/dist/comm-VV2LDX2J-ppxDJFkY.mjs.map +1 -0
  80. package/dist/cp-BISAAS7A-CMWayU4n.mjs +106 -0
  81. package/dist/cp-BISAAS7A-CMWayU4n.mjs.map +1 -0
  82. package/dist/cut-OKARJCCV-Bt8b58eI.mjs +119 -0
  83. package/dist/cut-OKARJCCV-Bt8b58eI.mjs.map +1 -0
  84. package/dist/date-UUUPW43J-B7T5OTZZ.mjs +188 -0
  85. package/dist/date-UUUPW43J-B7T5OTZZ.mjs.map +1 -0
  86. package/dist/diff-MWJFIG7X-DhnPc_5r.mjs +755 -0
  87. package/dist/diff-MWJFIG7X-DhnPc_5r.mjs.map +1 -0
  88. package/dist/dirname-MPHRFUTI-Dkb3S4OX.mjs +43 -0
  89. package/dist/dirname-MPHRFUTI-Dkb3S4OX.mjs.map +1 -0
  90. package/dist/{dist-DjfxlOWX.mjs → dist-C47GdlWY.mjs} +18 -93
  91. package/dist/{dist-DjfxlOWX.mjs.map → dist-C47GdlWY.mjs.map} +1 -1
  92. package/dist/{dist-DWcRd4Se.mjs → dist-CJL2zYbP.mjs} +4 -71
  93. package/dist/dist-CJL2zYbP.mjs.map +1 -0
  94. package/dist/dist-Ch53z2P3.mjs +3 -0
  95. package/dist/dist-CwR72_PS.mjs +1887 -0
  96. package/dist/dist-CwR72_PS.mjs.map +1 -0
  97. package/dist/du-572XNP42-ClP4jXB1.mjs +176 -0
  98. package/dist/du-572XNP42-ClP4jXB1.mjs.map +1 -0
  99. package/dist/echo-NDWZZHPO-CCp_-MxA.mjs +137 -0
  100. package/dist/echo-NDWZZHPO-CCp_-MxA.mjs.map +1 -0
  101. package/dist/env-36M5BO7M-CsP_aiWr.mjs +119 -0
  102. package/dist/env-36M5BO7M-CsP_aiWr.mjs.map +1 -0
  103. package/dist/expand-JSPG6VOP-B-YUvYpu.mjs +145 -0
  104. package/dist/expand-JSPG6VOP-B-YUvYpu.mjs.map +1 -0
  105. package/dist/expr-5JAACS4X-1TBq84gG.mjs +153 -0
  106. package/dist/expr-5JAACS4X-1TBq84gG.mjs.map +1 -0
  107. package/dist/file-IPZJC3FQ-DcZNOWyY.mjs +4201 -0
  108. package/dist/file-IPZJC3FQ-DcZNOWyY.mjs.map +1 -0
  109. package/dist/find-INTH3OLC-6p47KeeT.mjs +1332 -0
  110. package/dist/find-INTH3OLC-6p47KeeT.mjs.map +1 -0
  111. package/dist/fold-4TQNYMSW-C54bHzLd.mjs +138 -0
  112. package/dist/fold-4TQNYMSW-C54bHzLd.mjs.map +1 -0
  113. package/dist/grep-V3LQVMRQ-D99Bq7Kj.mjs +335 -0
  114. package/dist/grep-V3LQVMRQ-D99Bq7Kj.mjs.map +1 -0
  115. package/dist/gzip-O5ASJAFY-CZDRROqP.mjs +592 -0
  116. package/dist/gzip-O5ASJAFY-CZDRROqP.mjs.map +1 -0
  117. package/dist/head-442HYESI-D96RMdki.mjs +36 -0
  118. package/dist/head-442HYESI-D96RMdki.mjs.map +1 -0
  119. package/dist/help-HZ6M2CKN--DK8mY2L.mjs +123 -0
  120. package/dist/help-HZ6M2CKN--DK8mY2L.mjs.map +1 -0
  121. package/dist/history-WYYKSLSZ-ACNQVupn.mjs +48 -0
  122. package/dist/history-WYYKSLSZ-ACNQVupn.mjs.map +1 -0
  123. package/dist/hostname-C4HQXXUP-CXVVFkUK.mjs +24 -0
  124. package/dist/hostname-C4HQXXUP-CXVVFkUK.mjs.map +1 -0
  125. package/dist/html-to-markdown-JW4MSQZO-DQOxFIvF.mjs +15890 -0
  126. package/dist/html-to-markdown-JW4MSQZO-DQOxFIvF.mjs.map +1 -0
  127. package/dist/index.mjs +20 -18
  128. package/dist/index.mjs.map +1 -1
  129. package/dist/join-TBRGI3LQ-B8I9tkJ5.mjs +198 -0
  130. package/dist/join-TBRGI3LQ-B8I9tkJ5.mjs.map +1 -0
  131. package/dist/jq-4XLYLOS5-wFZYfsfJ.mjs +257 -0
  132. package/dist/jq-4XLYLOS5-wFZYfsfJ.mjs.map +1 -0
  133. package/dist/js-exec-N5KEZBH7-CgtG-I6s.mjs +333 -0
  134. package/dist/js-exec-N5KEZBH7-CgtG-I6s.mjs.map +1 -0
  135. package/dist/lib-D4GpdNNK.mjs +45 -0
  136. package/dist/lib-D4GpdNNK.mjs.map +1 -0
  137. package/dist/ln-4LGSXXGD-Dg0R9i5G.mjs +101 -0
  138. package/dist/ln-4LGSXXGD-Dg0R9i5G.mjs.map +1 -0
  139. package/dist/ls-ZJGQER7M-DLDSfI4x.mjs +1891 -0
  140. package/dist/ls-ZJGQER7M-DLDSfI4x.mjs.map +1 -0
  141. package/dist/lzma-CTMDi254.mjs +1135 -0
  142. package/dist/lzma-CTMDi254.mjs.map +1 -0
  143. package/dist/{maybe-auto-update-Ou7H6dXT.mjs → maybe-auto-update-B0kal2FM.mjs} +2 -2
  144. package/dist/{maybe-auto-update-Ou7H6dXT.mjs.map → maybe-auto-update-B0kal2FM.mjs.map} +1 -1
  145. package/dist/md5sum-SPU24VSG-DQc8sqXO.mjs +16 -0
  146. package/dist/md5sum-SPU24VSG-DQc8sqXO.mjs.map +1 -0
  147. package/dist/mkdir-MEPGZOB6-BjUKzhdL.mjs +58 -0
  148. package/dist/mkdir-MEPGZOB6-BjUKzhdL.mjs.map +1 -0
  149. package/dist/mv-W5BIQ646-CdSIyY-U.mjs +93 -0
  150. package/dist/mv-W5BIQ646-CdSIyY-U.mjs.map +1 -0
  151. package/dist/nl-WSDW7I4O-DmtCnyKU.mjs +208 -0
  152. package/dist/nl-WSDW7I4O-DmtCnyKU.mjs.map +1 -0
  153. package/dist/od-WOKFDJTP-DZ2nxQNJ.mjs +73 -0
  154. package/dist/od-WOKFDJTP-DZ2nxQNJ.mjs.map +1 -0
  155. package/dist/paste-7JC6S4DX-CtmM5Qy8.mjs +113 -0
  156. package/dist/paste-7JC6S4DX-CtmM5Qy8.mjs.map +1 -0
  157. package/dist/printf-TWGXF445-B7cTysaa.mjs +880 -0
  158. package/dist/printf-TWGXF445-B7cTysaa.mjs.map +1 -0
  159. package/dist/pwd-WE6EN5AV-CO8o2WQS.mjs +34 -0
  160. package/dist/pwd-WE6EN5AV-CO8o2WQS.mjs.map +1 -0
  161. package/dist/python3-POMOR4OA-CKy80mpF.mjs +299 -0
  162. package/dist/python3-POMOR4OA-CKy80mpF.mjs.map +1 -0
  163. package/dist/readlink-OPJF4DL5-Rc1Mz_Xx.mjs +76 -0
  164. package/dist/readlink-OPJF4DL5-Rc1Mz_Xx.mjs.map +1 -0
  165. package/dist/rev-5EHFX4EJ-3dd9vwHW.mjs +66 -0
  166. package/dist/rev-5EHFX4EJ-3dd9vwHW.mjs.map +1 -0
  167. package/dist/rg-S4FXYXWB-BbXVo6JX.mjs +1539 -0
  168. package/dist/rg-S4FXYXWB-BbXVo6JX.mjs.map +1 -0
  169. package/dist/rm-SSGETQVQ-Ch53Rmrr.mjs +81 -0
  170. package/dist/rm-SSGETQVQ-Ch53Rmrr.mjs.map +1 -0
  171. package/dist/rmdir-OC4ZLPYA-D3QCHlIB.mjs +132 -0
  172. package/dist/rmdir-OC4ZLPYA-D3QCHlIB.mjs.map +1 -0
  173. package/dist/sed-S5UIK574-DE1KeTk3.mjs +1722 -0
  174. package/dist/sed-S5UIK574-DE1KeTk3.mjs.map +1 -0
  175. package/dist/seq-M5EC7Q57-BHfGjQvK.mjs +85 -0
  176. package/dist/seq-M5EC7Q57-BHfGjQvK.mjs.map +1 -0
  177. package/dist/sha1sum-2PTOAFR6-DNjSNcYK.mjs +16 -0
  178. package/dist/sha1sum-2PTOAFR6-DNjSNcYK.mjs.map +1 -0
  179. package/dist/sha256sum-NS7D3IXX-BMaCKkT5.mjs +16 -0
  180. package/dist/sha256sum-NS7D3IXX-BMaCKkT5.mjs.map +1 -0
  181. package/dist/sleep-X22JJINO-Do5hEQQW.mjs +67 -0
  182. package/dist/sleep-X22JJINO-Do5hEQQW.mjs.map +1 -0
  183. package/dist/sort-SW2YEO5B-B7j1zw8k.mjs +320 -0
  184. package/dist/sort-SW2YEO5B-B7j1zw8k.mjs.map +1 -0
  185. package/dist/split-4KKZZXXE-h8GD4HP4.mjs +248 -0
  186. package/dist/split-4KKZZXXE-h8GD4HP4.mjs.map +1 -0
  187. package/dist/sqlite3-CGOEFJAO-DvzzghDg.mjs +2879 -0
  188. package/dist/sqlite3-CGOEFJAO-DvzzghDg.mjs.map +1 -0
  189. package/dist/stat-CD34IZ4P-B5ZOJh4J.mjs +65 -0
  190. package/dist/stat-CD34IZ4P-B5ZOJh4J.mjs.map +1 -0
  191. package/dist/strings-6WDHLGMX-DdiEdoL-.mjs +179 -0
  192. package/dist/strings-6WDHLGMX-DdiEdoL-.mjs.map +1 -0
  193. package/dist/tac-2STMMJYW-DPyeWM9R.mjs +53 -0
  194. package/dist/tac-2STMMJYW-DPyeWM9R.mjs.map +1 -0
  195. package/dist/tail-R4PCA2C4-CUfroNeu.mjs +37 -0
  196. package/dist/tail-R4PCA2C4-CUfroNeu.mjs.map +1 -0
  197. package/dist/tar-STHHZTZ6-DRf60e-G.mjs +2838 -0
  198. package/dist/tar-STHHZTZ6-DRf60e-G.mjs.map +1 -0
  199. package/dist/tee-YUZ2FKCJ-po_dfyc_.mjs +46 -0
  200. package/dist/tee-YUZ2FKCJ-po_dfyc_.mjs.map +1 -0
  201. package/dist/time-D4LNBSWX-DVWhAldK.mjs +112 -0
  202. package/dist/time-D4LNBSWX-DVWhAldK.mjs.map +1 -0
  203. package/dist/timeout-YDCRSLPQ-B_yntmXU.mjs +113 -0
  204. package/dist/timeout-YDCRSLPQ-B_yntmXU.mjs.map +1 -0
  205. package/dist/touch-UA33VN3N-oW1SBT1r.mjs +104 -0
  206. package/dist/touch-UA33VN3N-oW1SBT1r.mjs.map +1 -0
  207. package/dist/tr-36LHWFRQ-CTq3z6wq.mjs +167 -0
  208. package/dist/tr-36LHWFRQ-CTq3z6wq.mjs.map +1 -0
  209. package/dist/tree-YLD52CNT-CIozNsLQ.mjs +186 -0
  210. package/dist/tree-YLD52CNT-CIozNsLQ.mjs.map +1 -0
  211. package/dist/true-FHQXJXBE-DsJOznSp.mjs +31 -0
  212. package/dist/true-FHQXJXBE-DsJOznSp.mjs.map +1 -0
  213. package/dist/unexpand-CADSA4VO-Cq9DTcUg.mjs +155 -0
  214. package/dist/unexpand-CADSA4VO-Cq9DTcUg.mjs.map +1 -0
  215. package/dist/uniq-XSIZR6PB-D5lt-IXF.mjs +92 -0
  216. package/dist/uniq-XSIZR6PB-D5lt-IXF.mjs.map +1 -0
  217. package/dist/{version-n-JpPeUF.mjs → version-Dxl3y5p6.mjs} +2 -2
  218. package/dist/{version-n-JpPeUF.mjs.map → version-Dxl3y5p6.mjs.map} +1 -1
  219. package/dist/wc-LF7NU4LA-BFPabrwD.mjs +111 -0
  220. package/dist/wc-LF7NU4LA-BFPabrwD.mjs.map +1 -0
  221. package/dist/which-XEM24D5D-2LvlkpUo.mjs +62 -0
  222. package/dist/which-XEM24D5D-2LvlkpUo.mjs.map +1 -0
  223. package/dist/whoami-XMTX52VE-24Kwqrk6.mjs +24 -0
  224. package/dist/whoami-XMTX52VE-24Kwqrk6.mjs.map +1 -0
  225. package/dist/xan-Y6WF3IRG-DjKO96Pj.mjs +2832 -0
  226. package/dist/xan-Y6WF3IRG-DjKO96Pj.mjs.map +1 -0
  227. package/dist/xan-view-HDVKHFC2-DhDNVE_V.mjs +12 -0
  228. package/dist/xan-view-HDVKHFC2-DhDNVE_V.mjs.map +1 -0
  229. package/dist/xargs-MGZPH7AX-D2bIgrdg.mjs +112 -0
  230. package/dist/xargs-MGZPH7AX-D2bIgrdg.mjs.map +1 -0
  231. package/dist/yq-4QJW3EQG-XhB3aACo.mjs +8610 -0
  232. package/dist/yq-4QJW3EQG-XhB3aACo.mjs.map +1 -0
  233. package/package.json +1 -1
  234. package/dist/dist-DWcRd4Se.mjs.map +0 -1
  235. package/dist/dist-DitNZUHA.mjs +0 -3
  236. package/dist/dist-vwoMCz6d.mjs +0 -775
  237. package/dist/dist-vwoMCz6d.mjs.map +0 -1
@@ -0,0 +1,1887 @@
1
+ #!/usr/bin/env node
2
+ import { $t as normalizeCredentialList, an as custom, cn as object, dn as toJSONSchema, ht as PromptResponseSchema, in as array, ln as string, nn as ZodType, on as discriminatedUnion, rn as _function, sn as literal, un as union, vt as ROUTE_MANIFEST_REL_PATH } from "./dist-C47GdlWY.mjs";
3
+ import "./chunk-BZUGFHVS-CPWRFwK8.mjs";
4
+ import "./chunk-DLL7UR66-BUYgzxnR.mjs";
5
+ import "./chunk-TN7HHBQW-CSB_R-XD.mjs";
6
+ import "./chunk-L64BMZUV-CyR7RKok.mjs";
7
+ import "./chunk-4RUAZWKT-D60fyWAB.mjs";
8
+ import "./chunk-NRSASXYY-CuWyREpD.mjs";
9
+ import "./chunk-SAI2SPQQ-CVRoDNs9.mjs";
10
+ import "./chunk-STHBFACM-lyj-j2a-.mjs";
11
+ import "./chunk-W5DWRFSU-lCyWk0ph.mjs";
12
+ import "./chunk-WNH3HOQA-BCZUOjCJ.mjs";
13
+ import "./chunk-HBVMHTO5-CJyD-QZX.mjs";
14
+ import "./chunk-FOCWZZDE-BIntqBh2.mjs";
15
+ import "./chunk-L2UW7DWF-B3tEHhPF.mjs";
16
+ import "./chunk-XRFHFXFP-BGxzVZgK.mjs";
17
+ import { createRequire } from "node:module";
18
+ import "node:os";
19
+ import { basename, dirname, join, relative, sep } from "node:path";
20
+ import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
21
+ import { pathToFileURL } from "node:url";
22
+ import { readdir, stat } from "node:fs/promises";
23
+ import { AsyncLocalStorage } from "node:async_hooks";
24
+ //#region ../../node_modules/.pnpm/just-bash@3.0.1/node_modules/just-bash/dist/bundle/chunks/chunk-G5EVRAOO.js
25
+ createRequire(import.meta.url);
26
+ var p;
27
+ (function(e) {
28
+ e.EOF = "EOF", e.NEWLINE = "NEWLINE", e.SEMICOLON = "SEMICOLON", e.AMP = "AMP", e.PIPE = "PIPE", e.PIPE_AMP = "PIPE_AMP", e.AND_AND = "AND_AND", e.OR_OR = "OR_OR", e.BANG = "BANG", e.LESS = "LESS", e.GREAT = "GREAT", e.DLESS = "DLESS", e.DGREAT = "DGREAT", e.LESSAND = "LESSAND", e.GREATAND = "GREATAND", e.LESSGREAT = "LESSGREAT", e.DLESSDASH = "DLESSDASH", e.CLOBBER = "CLOBBER", e.TLESS = "TLESS", e.AND_GREAT = "AND_GREAT", e.AND_DGREAT = "AND_DGREAT", e.LPAREN = "LPAREN", e.RPAREN = "RPAREN", e.LBRACE = "LBRACE", e.RBRACE = "RBRACE", e.DSEMI = "DSEMI", e.SEMI_AND = "SEMI_AND", e.SEMI_SEMI_AND = "SEMI_SEMI_AND", e.DBRACK_START = "DBRACK_START", e.DBRACK_END = "DBRACK_END", e.DPAREN_START = "DPAREN_START", e.DPAREN_END = "DPAREN_END", e.IF = "IF", e.THEN = "THEN", e.ELSE = "ELSE", e.ELIF = "ELIF", e.FI = "FI", e.FOR = "FOR", e.WHILE = "WHILE", e.UNTIL = "UNTIL", e.DO = "DO", e.DONE = "DONE", e.CASE = "CASE", e.ESAC = "ESAC", e.IN = "IN", e.FUNCTION = "FUNCTION", e.SELECT = "SELECT", e.TIME = "TIME", e.COPROC = "COPROC", e.WORD = "WORD", e.NAME = "NAME", e.NUMBER = "NUMBER", e.ASSIGNMENT_WORD = "ASSIGNMENT_WORD", e.FD_VARIABLE = "FD_VARIABLE", e.COMMENT = "COMMENT", e.HEREDOC_CONTENT = "HEREDOC_CONTENT";
29
+ })(p || (p = {}));
30
+ new Map([
31
+ ["if", p.IF],
32
+ ["then", p.THEN],
33
+ ["else", p.ELSE],
34
+ ["elif", p.ELIF],
35
+ ["fi", p.FI],
36
+ ["for", p.FOR],
37
+ ["while", p.WHILE],
38
+ ["until", p.UNTIL],
39
+ ["do", p.DO],
40
+ ["done", p.DONE],
41
+ ["case", p.CASE],
42
+ ["esac", p.ESAC],
43
+ ["in", p.IN],
44
+ ["function", p.FUNCTION],
45
+ ["select", p.SELECT],
46
+ ["time", p.TIME],
47
+ ["coproc", p.COPROC]
48
+ ]);
49
+ p.SEMI_SEMI_AND, p.TLESS, p.AND_DGREAT;
50
+ p.DBRACK_START, p.DBRACK_END, p.DPAREN_START, p.DPAREN_END, p.AND_AND, p.OR_OR, p.DSEMI, p.SEMI_AND, p.PIPE_AMP, p.DGREAT, p.LESSAND, p.GREATAND, p.LESSGREAT, p.CLOBBER, p.AND_GREAT;
51
+ new Map([
52
+ ["|", p.PIPE],
53
+ ["&", p.AMP],
54
+ [";", p.SEMICOLON],
55
+ ["(", p.LPAREN],
56
+ [")", p.RPAREN],
57
+ ["<", p.LESS],
58
+ [">", p.GREAT]
59
+ ]);
60
+ new Set([
61
+ p.LESS,
62
+ p.GREAT,
63
+ p.DLESS,
64
+ p.DGREAT,
65
+ p.LESSAND,
66
+ p.GREATAND,
67
+ p.LESSGREAT,
68
+ p.DLESSDASH,
69
+ p.CLOBBER,
70
+ p.TLESS,
71
+ p.AND_GREAT,
72
+ p.AND_DGREAT
73
+ ]);
74
+ new Set([
75
+ p.LESS,
76
+ p.GREAT,
77
+ p.DLESS,
78
+ p.DGREAT,
79
+ p.LESSAND,
80
+ p.GREATAND,
81
+ p.LESSGREAT,
82
+ p.DLESSDASH,
83
+ p.CLOBBER,
84
+ p.TLESS
85
+ ]);
86
+ new Set([
87
+ p.LESS,
88
+ p.GREAT,
89
+ p.DLESS,
90
+ p.DGREAT,
91
+ p.LESSAND,
92
+ p.GREATAND,
93
+ p.LESSGREAT,
94
+ p.DLESSDASH,
95
+ p.CLOBBER,
96
+ p.TLESS,
97
+ p.AND_GREAT,
98
+ p.AND_DGREAT
99
+ ]);
100
+ new Set([
101
+ p.AMP,
102
+ p.PIPE,
103
+ p.PIPE_AMP,
104
+ p.SEMICOLON,
105
+ p.AND_AND,
106
+ p.OR_OR,
107
+ p.DSEMI,
108
+ p.SEMI_AND,
109
+ p.SEMI_SEMI_AND
110
+ ]);
111
+ //#endregion
112
+ //#region ../../packages/manifest/dist/discovery-CWjr_liZ.mjs
113
+ const SOURCE_EXT = /\.(ts|mts|mjs|js)$/;
114
+ const DECLARATION_FILE$1 = /\.d\.(ts|mts|cts)$/;
115
+ function entryIdFromFile(rootDir, filePath, options) {
116
+ if (DECLARATION_FILE$1.test(filePath)) return null;
117
+ const baseName = filePath.split(sep).at(-1) ?? "";
118
+ if (/\.(int\.)?test\.(ts|mts)$/.test(baseName)) return null;
119
+ const segments = relative(rootDir, filePath).replace(SOURCE_EXT, "").split(sep).filter((segment) => segment.length > 0);
120
+ if (segments.length === 1) return segments[0] ?? null;
121
+ const last = segments.at(-1);
122
+ const entryNames = new Set([options.nestedEntry]);
123
+ if (options.allowIndex !== false) entryNames.add("index");
124
+ if (!last || !entryNames.has(last)) return null;
125
+ const id = segments.slice(0, -1).join("/");
126
+ return id.length > 0 ? id : null;
127
+ }
128
+ const SOURCE_FILE = /\.(ts|mts|mjs|js)$/;
129
+ const TEST_FILE = /\.(int\.)?test\.(ts|mts)$/;
130
+ const DECLARATION_FILE = /\.d\.(ts|mts|cts)$/;
131
+ const JUNK_FILE = /^\._|\.DS_Store$/;
132
+ async function walkTypeScriptFiles(dir) {
133
+ let names;
134
+ try {
135
+ names = await readdir(dir);
136
+ } catch (error) {
137
+ if (error.code === "ENOENT") return [];
138
+ throw error;
139
+ }
140
+ const files = [];
141
+ for (const name of names) {
142
+ const path = join(dir, name);
143
+ if ((await stat(path)).isDirectory()) files.push(...await walkTypeScriptFiles(path));
144
+ else if (!JUNK_FILE.test(name) && SOURCE_FILE.test(name) && !DECLARATION_FILE.test(name) && !TEST_FILE.test(name)) files.push(path);
145
+ }
146
+ return files;
147
+ }
148
+ async function discoverEntries(rootDir, options) {
149
+ const files = await walkTypeScriptFiles(rootDir);
150
+ const byKey = /* @__PURE__ */ new Map();
151
+ for (const filePath of files) {
152
+ const id = entryIdFromFile(rootDir, filePath, options);
153
+ if (!id) continue;
154
+ const key = options.formatKey(id);
155
+ const moduleFile = relative(rootDir, filePath);
156
+ const existing = byKey.get(key);
157
+ if (existing) throw new Error(`Duplicate ${options.duplicateLabel} ${key}: ${existing.filePath} and ${filePath}`);
158
+ byKey.set(key, {
159
+ key,
160
+ filePath,
161
+ moduleFile
162
+ });
163
+ }
164
+ return [...byKey.values()];
165
+ }
166
+ async function discoverModuleFileEntries(rootDir, options) {
167
+ return (await discoverEntries(rootDir, {
168
+ nestedEntry: options.nestedEntry,
169
+ formatKey: (id) => id,
170
+ duplicateLabel: options.duplicateLabel
171
+ })).filter((entry) => options.shouldDiscoverFile?.(entry.filePath) ?? true).map(({ filePath, moduleFile }) => ({
172
+ filePath,
173
+ moduleFile
174
+ }));
175
+ }
176
+ const HEADER_BYTES = 2048;
177
+ const DIRECTIVE_RE = /@keystroke\s+ignore(?::([a-z]+))?/;
178
+ /** Parse `@keystroke ignore` directives from a file header snippet. */
179
+ function parseKeystrokeIgnoreDirective(header) {
180
+ for (const line of header.slice(0, HEADER_BYTES).split("\n")) {
181
+ const trimmed = line.trim();
182
+ if (trimmed.length === 0) continue;
183
+ if (!isCommentLine(trimmed)) break;
184
+ const match = DIRECTIVE_RE.exec(trimmed);
185
+ if (!match) continue;
186
+ const scope = match[1];
187
+ if (!scope) return "ignore";
188
+ if (scope === "deploy") return "ignore:deploy";
189
+ throw new Error(`Unknown @keystroke ignore target "${scope}" in directive "@keystroke ignore:${scope}"`);
190
+ }
191
+ return null;
192
+ }
193
+ /** Read `@keystroke ignore` directives from the top of a module file. */
194
+ function readKeystrokeIgnoreDirective(filePath) {
195
+ return parseKeystrokeIgnoreDirective(readFileSync(filePath, "utf8").slice(0, HEADER_BYTES));
196
+ }
197
+ /** Whether a discovered module file should be skipped for the given build phase. */
198
+ function shouldSkipKeystrokeModuleFile(directive, phase) {
199
+ if (!directive) return false;
200
+ if (directive === "ignore") return true;
201
+ return phase === "deploy";
202
+ }
203
+ function isCommentLine(line) {
204
+ return line.startsWith("//") || line.startsWith("/*") || line.startsWith("*");
205
+ }
206
+ //#endregion
207
+ //#region ../../packages/sandbox/dist/files-XxiqkzS0.mjs
208
+ const SandboxFileContentSchema = object({
209
+ path: string(),
210
+ file: string()
211
+ });
212
+ /** Destination path under `/workspace`. For `dir`, used as a prefix. */
213
+ const SandboxFileSchema = object({
214
+ path: string(),
215
+ /** Single file body — typically from a build-time import (`import doc from "./doc.md"`). */
216
+ file: string().optional(),
217
+ /** Directory contents — each path is relative to `path`. */
218
+ dir: array(SandboxFileContentSchema).optional()
219
+ });
220
+ object({
221
+ key: string().optional(),
222
+ files: array(SandboxFileSchema).optional()
223
+ });
224
+ const SKIP_DIRS$1 = new Set([".git", "node_modules"]);
225
+ /** Recursively read a host file or directory into sandbox-relative `{ path, file }` entries. */
226
+ function packDirFromDisk(rootPath) {
227
+ const stat = statSync(rootPath);
228
+ if (stat.isFile()) return [{
229
+ path: basename(rootPath),
230
+ file: readFileSync(rootPath, "utf8")
231
+ }];
232
+ if (!stat.isDirectory()) throw new Error(`Expected a file or directory at ${rootPath}`);
233
+ const files = [];
234
+ walkDir(rootPath, rootPath, files);
235
+ return files;
236
+ }
237
+ function walkDir(rootPath, currentPath, files) {
238
+ for (const name of readdirSync(currentPath)) {
239
+ if (SKIP_DIRS$1.has(name)) continue;
240
+ const entryPath = join(currentPath, name);
241
+ const stat = statSync(entryPath);
242
+ if (stat.isDirectory()) {
243
+ walkDir(rootPath, entryPath, files);
244
+ continue;
245
+ }
246
+ if (!stat.isFile()) continue;
247
+ files.push({
248
+ path: relative(rootPath, entryPath),
249
+ file: readFileSync(entryPath, "utf8")
250
+ });
251
+ }
252
+ }
253
+ const SKIP_DIRS$2 = new Set([".git", "node_modules"]);
254
+ /** Pack every subdir under `src/skills/` and `src/files/` into an asset manifest. */
255
+ function packAssetDirs(appRoot, srcDir = "src") {
256
+ return {
257
+ skills: packAssetRoot(join(appRoot, srcDir, "skills")),
258
+ files: packAssetRoot(join(appRoot, srcDir, "files"))
259
+ };
260
+ }
261
+ function packAssetRoot(rootPath) {
262
+ if (!statSync(rootPath, { throwIfNoEntry: false })?.isDirectory()) return {};
263
+ const manifest = {};
264
+ for (const name of readdirSync(rootPath)) {
265
+ if (SKIP_DIRS$2.has(name)) continue;
266
+ const entryPath = join(rootPath, name);
267
+ if (!statSync(entryPath).isDirectory()) continue;
268
+ manifest[name] = packDirFromDisk(entryPath);
269
+ }
270
+ return manifest;
271
+ }
272
+ const appRootStorage = new AsyncLocalStorage();
273
+ /** Run with an explicit user-app root (parallel-safe alternative to mutating `KEYSTROKE_ROOT`). */
274
+ function runWithAppRoot(appRoot, fn) {
275
+ return appRootStorage.run(appRoot, fn);
276
+ }
277
+ /** Walk upward from a module file to find the user app root (`src/agents`, `src/skills`, etc.). */
278
+ function resolveAppRoot(fromPath) {
279
+ let dir = statSync(fromPath).isDirectory() ? fromPath : dirname(fromPath);
280
+ while (dir !== dirname(dir)) {
281
+ if (hasAppLayout(dir)) return dir;
282
+ dir = dirname(dir);
283
+ }
284
+ return process.env.KEYSTROKE_ROOT ?? process.cwd();
285
+ }
286
+ function hasAppLayout(dir) {
287
+ const src = join(dir, "src");
288
+ const dist = join(dir, "dist");
289
+ return existsSync(join(src, "agents")) || existsSync(join(src, "skills")) || existsSync(join(src, "files")) || existsSync(join(dist, "agents")) || existsSync(join(dist, ".keystroke", "assets.mjs"));
290
+ }
291
+ //#endregion
292
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/system/memory/metrics.mjs
293
+ /** TypeBox instantiation metrics */
294
+ const Metrics = {
295
+ assign: 0,
296
+ create: 0,
297
+ clone: 0,
298
+ discard: 0,
299
+ update: 0
300
+ };
301
+ //#endregion
302
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/guard/guard.mjs
303
+ /** Returns true if this value is an array */
304
+ function IsArray(value) {
305
+ return Array.isArray(value);
306
+ }
307
+ /** Returns true if this value is null */
308
+ function IsNull(value) {
309
+ return IsEqual(value, null);
310
+ }
311
+ /** Returns true if this value is an object */
312
+ function IsObject(value) {
313
+ return IsEqual(typeof value, "object") && !IsNull(value);
314
+ }
315
+ function IsEqual(left, right) {
316
+ return left === right;
317
+ }
318
+ /** Returns true if the PropertyKey is Unsafe (ref: prototype-pollution). */
319
+ function IsUnsafePropertyKey(key) {
320
+ return IsEqual(key, "__proto__") || IsEqual(key, "constructor") || IsEqual(key, "prototype");
321
+ }
322
+ /** Returns true if this value has this property key */
323
+ function HasPropertyKey(value, key) {
324
+ return IsUnsafePropertyKey(key) ? Object.prototype.hasOwnProperty.call(value, key) : key in value;
325
+ }
326
+ /** Returns property keys for this object via `Object.getOwnPropertyKeys({ ... })` */
327
+ function Keys(value) {
328
+ return Object.getOwnPropertyNames(value);
329
+ }
330
+ //#endregion
331
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/system/memory/clone.mjs
332
+ function IsGuard(value) {
333
+ return IsObject(value) && HasPropertyKey(value, "~guard");
334
+ }
335
+ function FromGuard(value) {
336
+ return value;
337
+ }
338
+ function FromArray(value) {
339
+ return value.map((value) => FromValue(value));
340
+ }
341
+ function FromObject(value) {
342
+ const result = {};
343
+ const descriptors = Object.getOwnPropertyDescriptors(value);
344
+ for (const key of Object.keys(descriptors)) {
345
+ const descriptor = descriptors[key];
346
+ if (HasPropertyKey(descriptor, "value")) Object.defineProperty(result, key, {
347
+ ...descriptor,
348
+ value: FromValue(descriptor.value)
349
+ });
350
+ }
351
+ return result;
352
+ }
353
+ function FromRegExp(value) {
354
+ return new RegExp(value.source, value.flags);
355
+ }
356
+ function FromUnknown(value) {
357
+ return value;
358
+ }
359
+ function FromValue(value) {
360
+ return value instanceof RegExp ? FromRegExp(value) : IsGuard(value) ? FromGuard(value) : IsArray(value) ? FromArray(value) : IsObject(value) ? FromObject(value) : FromUnknown(value);
361
+ }
362
+ /**
363
+ * Clones a value using the TypeBox type cloning strategy. This function preserves non-enumerable
364
+ * properties from the source value. This is to ensure cloned types retain discriminable
365
+ * hidden properties.
366
+ */
367
+ function Clone(value) {
368
+ Metrics.clone += 1;
369
+ return FromValue(value);
370
+ }
371
+ //#endregion
372
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/system/settings/settings.mjs
373
+ const settings = {
374
+ immutableTypes: false,
375
+ maxErrors: 8,
376
+ useAcceleration: true,
377
+ exactOptionalPropertyTypes: false,
378
+ enumerableKind: false,
379
+ correctiveParse: false
380
+ };
381
+ /** Gets current system settings */
382
+ function Get() {
383
+ return settings;
384
+ }
385
+ //#endregion
386
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/system/memory/create.mjs
387
+ function MergeHidden(left, right) {
388
+ for (const key of Object.keys(right)) Object.defineProperty(left, key, {
389
+ configurable: true,
390
+ writable: true,
391
+ enumerable: false,
392
+ value: right[key]
393
+ });
394
+ return left;
395
+ }
396
+ function Merge(left, right) {
397
+ return {
398
+ ...left,
399
+ ...right
400
+ };
401
+ }
402
+ /**
403
+ * Creates an object with hidden, enumerable, and optional property sets. This function
404
+ * ensures types are instantiated according to configuration rules for enumerable and
405
+ * non-enumerable properties.
406
+ */
407
+ function Create(hidden, enumerable, options = {}) {
408
+ Metrics.create += 1;
409
+ const settings = Get();
410
+ const withOptions = Merge(enumerable, options);
411
+ const withHidden = settings.enumerableKind ? Merge(withOptions, hidden) : MergeHidden(withOptions, hidden);
412
+ return settings.immutableTypes ? Object.freeze(withHidden) : withHidden;
413
+ }
414
+ //#endregion
415
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/system/memory/update.mjs
416
+ /**
417
+ * Updates a value with new properties while preserving property enumerability. Use this function to modify
418
+ * existing types without altering their configuration.
419
+ */
420
+ function Update(current, hidden, enumerable) {
421
+ Metrics.update += 1;
422
+ const settings = Get();
423
+ const result = Clone(current);
424
+ for (const key of Object.keys(hidden)) Object.defineProperty(result, key, {
425
+ configurable: true,
426
+ writable: true,
427
+ enumerable: settings.enumerableKind,
428
+ value: hidden[key]
429
+ });
430
+ for (const key of Object.keys(enumerable)) Object.defineProperty(result, key, {
431
+ configurable: true,
432
+ enumerable: true,
433
+ writable: true,
434
+ value: enumerable[key]
435
+ });
436
+ return result;
437
+ }
438
+ //#endregion
439
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/type/types/schema.mjs
440
+ function IsSchema(value) {
441
+ return IsObject(value);
442
+ }
443
+ //#endregion
444
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/type/types/_optional.mjs
445
+ /** Adds Optional to the given type. */
446
+ function OptionalAdd(type) {
447
+ return Update(type, { "~optional": true }, {});
448
+ }
449
+ /** Applies an Optional modifier to the given type. */
450
+ function Optional(type) {
451
+ return OptionalAdd(type);
452
+ }
453
+ /** Returns true if the given value is TOptional */
454
+ function IsOptional(value) {
455
+ return IsSchema(value) && HasPropertyKey(value, "~optional");
456
+ }
457
+ //#endregion
458
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/type/types/array.mjs
459
+ /** Creates an Array type. */
460
+ function _Array_(items, options) {
461
+ return Create({ "~kind": "Array" }, {
462
+ type: "array",
463
+ items
464
+ }, options);
465
+ }
466
+ //#endregion
467
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/type/types/properties.mjs
468
+ /** Creates a RequiredArray derived from the given TProperties value. */
469
+ function RequiredArray(properties) {
470
+ return Keys(properties).filter((key) => !IsOptional(properties[key]));
471
+ }
472
+ //#endregion
473
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/type/types/object.mjs
474
+ /** Creates an Object type. */
475
+ function _Object_(properties, options = {}) {
476
+ const requiredKeys = RequiredArray(properties);
477
+ return Create({ "~kind": "Object" }, {
478
+ type: "object",
479
+ ...requiredKeys.length > 0 ? { required: requiredKeys } : {},
480
+ properties
481
+ }, options);
482
+ }
483
+ //#endregion
484
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/system/hashing/hash.mjs
485
+ var ByteMarker;
486
+ (function(ByteMarker) {
487
+ ByteMarker[ByteMarker["Array"] = 0] = "Array";
488
+ ByteMarker[ByteMarker["BigInt"] = 1] = "BigInt";
489
+ ByteMarker[ByteMarker["Boolean"] = 2] = "Boolean";
490
+ ByteMarker[ByteMarker["Date"] = 3] = "Date";
491
+ ByteMarker[ByteMarker["Constructor"] = 4] = "Constructor";
492
+ ByteMarker[ByteMarker["Function"] = 5] = "Function";
493
+ ByteMarker[ByteMarker["Null"] = 6] = "Null";
494
+ ByteMarker[ByteMarker["Number"] = 7] = "Number";
495
+ ByteMarker[ByteMarker["Object"] = 8] = "Object";
496
+ ByteMarker[ByteMarker["RegExp"] = 9] = "RegExp";
497
+ ByteMarker[ByteMarker["String"] = 10] = "String";
498
+ ByteMarker[ByteMarker["Symbol"] = 11] = "Symbol";
499
+ ByteMarker[ByteMarker["TypeArray"] = 12] = "TypeArray";
500
+ ByteMarker[ByteMarker["Undefined"] = 13] = "Undefined";
501
+ })(ByteMarker || (ByteMarker = {}));
502
+ Array.from({ length: 256 }).map((_, i) => BigInt(i));
503
+ const F64 = new Float64Array(1);
504
+ new DataView(F64.buffer);
505
+ new Uint8Array(F64.buffer);
506
+ new TextEncoder();
507
+ //#endregion
508
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/type/types/integer.mjs
509
+ const IntegerPattern = "-?(?:0|[1-9][0-9]*)";
510
+ /** Creates a Number type. */
511
+ function Number$1(options) {
512
+ return Create({ "~kind": "Number" }, { type: "number" }, options);
513
+ }
514
+ //#endregion
515
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/type/types/string.mjs
516
+ /** Creates a String type. */
517
+ function String$1(options) {
518
+ return Create({ "~kind": "String" }, { type: "string" }, options);
519
+ }
520
+ //#endregion
521
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/type/types/record.mjs
522
+ const IntegerKey = `^${IntegerPattern}$`;
523
+ //#endregion
524
+ //#region ../../node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/type/script/token/internal/char.mjs
525
+ function Range(start, end) {
526
+ return Array.from({ length: end - start + 1 }, (_, i) => String.fromCharCode(start + i));
527
+ }
528
+ const Alpha = [...Range(97, 122), ...Range(65, 90)];
529
+ const Digit = ["0", ...Range(49, 57)];
530
+ [...Digit];
531
+ [...[
532
+ ...Alpha,
533
+ "_",
534
+ "$"
535
+ ], ...Digit];
536
+ [...Digit];
537
+ new RegExp(IntegerKey);
538
+ //#endregion
539
+ //#region ../../packages/sandbox/dist/create-coding-tools-5--zCsRF.mjs
540
+ const replaceEditSchema = _Object_({
541
+ oldText: String$1({ description: "Exact text to replace. Must be unique in the file and must not overlap other edits in this call." }),
542
+ newText: String$1({ description: "Replacement text" })
543
+ }, { additionalProperties: false });
544
+ _Object_({
545
+ path: String$1({ description: "Path to the file to edit (under /workspace)" }),
546
+ edits: _Array_(replaceEditSchema, { description: "Replacements applied against the original file (not chained). Each oldText must be unique and non-overlapping." })
547
+ }, { additionalProperties: false });
548
+ _Object_({
549
+ path: String$1({ description: "Path to the file to read (under /workspace)" }),
550
+ offset: Optional(Number$1({ description: "Line number to start reading from (1-indexed)" })),
551
+ limit: Optional(Number$1({ description: "Maximum number of lines to read" }))
552
+ });
553
+ _Object_({
554
+ path: String$1({ description: "Path to the file to write (under /workspace)" }),
555
+ content: String$1({ description: "Content to write to the file" })
556
+ });
557
+ //#endregion
558
+ //#region ../../node_modules/.pnpm/just-bash@3.0.1/node_modules/just-bash/dist/bundle/index.js
559
+ createRequire(import.meta.url);
560
+ var tt = [
561
+ {
562
+ name: "echo",
563
+ load: async () => (await import("./echo-NDWZZHPO-CCp_-MxA.mjs")).echoCommand
564
+ },
565
+ {
566
+ name: "cat",
567
+ load: async () => (await import("./cat-TSFMZVYS-Dz3-oHsV.mjs")).catCommand
568
+ },
569
+ {
570
+ name: "printf",
571
+ load: async () => (await import("./printf-TWGXF445-B7cTysaa.mjs")).printfCommand
572
+ },
573
+ {
574
+ name: "ls",
575
+ load: async () => (await import("./ls-ZJGQER7M-DLDSfI4x.mjs")).lsCommand
576
+ },
577
+ {
578
+ name: "mkdir",
579
+ load: async () => (await import("./mkdir-MEPGZOB6-BjUKzhdL.mjs")).mkdirCommand
580
+ },
581
+ {
582
+ name: "rmdir",
583
+ load: async () => (await import("./rmdir-OC4ZLPYA-D3QCHlIB.mjs")).rmdirCommand
584
+ },
585
+ {
586
+ name: "touch",
587
+ load: async () => (await import("./touch-UA33VN3N-oW1SBT1r.mjs")).touchCommand
588
+ },
589
+ {
590
+ name: "rm",
591
+ load: async () => (await import("./rm-SSGETQVQ-Ch53Rmrr.mjs")).rmCommand
592
+ },
593
+ {
594
+ name: "cp",
595
+ load: async () => (await import("./cp-BISAAS7A-CMWayU4n.mjs")).cpCommand
596
+ },
597
+ {
598
+ name: "mv",
599
+ load: async () => (await import("./mv-W5BIQ646-CdSIyY-U.mjs")).mvCommand
600
+ },
601
+ {
602
+ name: "ln",
603
+ load: async () => (await import("./ln-4LGSXXGD-Dg0R9i5G.mjs")).lnCommand
604
+ },
605
+ {
606
+ name: "chmod",
607
+ load: async () => (await import("./chmod-TFEPA42X-YF02QJUv.mjs")).chmodCommand
608
+ },
609
+ {
610
+ name: "pwd",
611
+ load: async () => (await import("./pwd-WE6EN5AV-CO8o2WQS.mjs")).pwdCommand
612
+ },
613
+ {
614
+ name: "readlink",
615
+ load: async () => (await import("./readlink-OPJF4DL5-Rc1Mz_Xx.mjs")).readlinkCommand
616
+ },
617
+ {
618
+ name: "head",
619
+ load: async () => (await import("./head-442HYESI-D96RMdki.mjs")).headCommand
620
+ },
621
+ {
622
+ name: "tail",
623
+ load: async () => (await import("./tail-R4PCA2C4-CUfroNeu.mjs")).tailCommand
624
+ },
625
+ {
626
+ name: "wc",
627
+ load: async () => (await import("./wc-LF7NU4LA-BFPabrwD.mjs")).wcCommand
628
+ },
629
+ {
630
+ name: "stat",
631
+ load: async () => (await import("./stat-CD34IZ4P-B5ZOJh4J.mjs")).statCommand
632
+ },
633
+ {
634
+ name: "grep",
635
+ load: async () => (await import("./grep-V3LQVMRQ-D99Bq7Kj.mjs")).grepCommand
636
+ },
637
+ {
638
+ name: "fgrep",
639
+ load: async () => (await import("./grep-V3LQVMRQ-D99Bq7Kj.mjs")).fgrepCommand
640
+ },
641
+ {
642
+ name: "egrep",
643
+ load: async () => (await import("./grep-V3LQVMRQ-D99Bq7Kj.mjs")).egrepCommand
644
+ },
645
+ {
646
+ name: "rg",
647
+ load: async () => (await import("./rg-S4FXYXWB-BbXVo6JX.mjs")).rgCommand
648
+ },
649
+ {
650
+ name: "sed",
651
+ load: async () => (await import("./sed-S5UIK574-DE1KeTk3.mjs")).sedCommand
652
+ },
653
+ {
654
+ name: "awk",
655
+ load: async () => (await import("./awk2-LA3USKJP-BbsfXVlR.mjs")).awkCommand2
656
+ },
657
+ {
658
+ name: "sort",
659
+ load: async () => (await import("./sort-SW2YEO5B-B7j1zw8k.mjs")).sortCommand
660
+ },
661
+ {
662
+ name: "uniq",
663
+ load: async () => (await import("./uniq-XSIZR6PB-D5lt-IXF.mjs")).uniqCommand
664
+ },
665
+ {
666
+ name: "comm",
667
+ load: async () => (await import("./comm-VV2LDX2J-ppxDJFkY.mjs")).commCommand
668
+ },
669
+ {
670
+ name: "cut",
671
+ load: async () => (await import("./cut-OKARJCCV-Bt8b58eI.mjs")).cutCommand
672
+ },
673
+ {
674
+ name: "paste",
675
+ load: async () => (await import("./paste-7JC6S4DX-CtmM5Qy8.mjs")).pasteCommand
676
+ },
677
+ {
678
+ name: "tr",
679
+ load: async () => (await import("./tr-36LHWFRQ-CTq3z6wq.mjs")).trCommand
680
+ },
681
+ {
682
+ name: "rev",
683
+ load: async () => (await import("./rev-5EHFX4EJ-3dd9vwHW.mjs")).rev
684
+ },
685
+ {
686
+ name: "nl",
687
+ load: async () => (await import("./nl-WSDW7I4O-DmtCnyKU.mjs")).nl
688
+ },
689
+ {
690
+ name: "fold",
691
+ load: async () => (await import("./fold-4TQNYMSW-C54bHzLd.mjs")).fold
692
+ },
693
+ {
694
+ name: "expand",
695
+ load: async () => (await import("./expand-JSPG6VOP-B-YUvYpu.mjs")).expand
696
+ },
697
+ {
698
+ name: "unexpand",
699
+ load: async () => (await import("./unexpand-CADSA4VO-Cq9DTcUg.mjs")).unexpand
700
+ },
701
+ {
702
+ name: "strings",
703
+ load: async () => (await import("./strings-6WDHLGMX-DdiEdoL-.mjs")).strings
704
+ },
705
+ {
706
+ name: "split",
707
+ load: async () => (await import("./split-4KKZZXXE-h8GD4HP4.mjs")).split
708
+ },
709
+ {
710
+ name: "column",
711
+ load: async () => (await import("./column-XT6UFXNQ-DHENV9D2.mjs")).column
712
+ },
713
+ {
714
+ name: "join",
715
+ load: async () => (await import("./join-TBRGI3LQ-B8I9tkJ5.mjs")).join
716
+ },
717
+ {
718
+ name: "tee",
719
+ load: async () => (await import("./tee-YUZ2FKCJ-po_dfyc_.mjs")).teeCommand
720
+ },
721
+ {
722
+ name: "find",
723
+ load: async () => (await import("./find-INTH3OLC-6p47KeeT.mjs")).findCommand
724
+ },
725
+ {
726
+ name: "basename",
727
+ load: async () => (await import("./basename-UB3CIYNI-BgNN3bGm.mjs")).basenameCommand
728
+ },
729
+ {
730
+ name: "dirname",
731
+ load: async () => (await import("./dirname-MPHRFUTI-Dkb3S4OX.mjs")).dirnameCommand
732
+ },
733
+ {
734
+ name: "tree",
735
+ load: async () => (await import("./tree-YLD52CNT-CIozNsLQ.mjs")).treeCommand
736
+ },
737
+ {
738
+ name: "du",
739
+ load: async () => (await import("./du-572XNP42-ClP4jXB1.mjs")).duCommand
740
+ },
741
+ {
742
+ name: "env",
743
+ load: async () => (await import("./env-36M5BO7M-CsP_aiWr.mjs")).envCommand
744
+ },
745
+ {
746
+ name: "printenv",
747
+ load: async () => (await import("./env-36M5BO7M-CsP_aiWr.mjs")).printenvCommand
748
+ },
749
+ {
750
+ name: "alias",
751
+ load: async () => (await import("./alias-RTYYYW3D-CLFgrowj.mjs")).aliasCommand
752
+ },
753
+ {
754
+ name: "unalias",
755
+ load: async () => (await import("./alias-RTYYYW3D-CLFgrowj.mjs")).unaliasCommand
756
+ },
757
+ {
758
+ name: "history",
759
+ load: async () => (await import("./history-WYYKSLSZ-ACNQVupn.mjs")).historyCommand
760
+ },
761
+ {
762
+ name: "xargs",
763
+ load: async () => (await import("./xargs-MGZPH7AX-D2bIgrdg.mjs")).xargsCommand
764
+ },
765
+ {
766
+ name: "true",
767
+ load: async () => (await import("./true-FHQXJXBE-DsJOznSp.mjs")).trueCommand
768
+ },
769
+ {
770
+ name: "false",
771
+ load: async () => (await import("./true-FHQXJXBE-DsJOznSp.mjs")).falseCommand
772
+ },
773
+ {
774
+ name: "clear",
775
+ load: async () => (await import("./clear-HKGFEOF6-CekN2x-O.mjs")).clearCommand
776
+ },
777
+ {
778
+ name: "bash",
779
+ load: async () => (await import("./bash-YZ33HQZQ-N6YyKtUH.mjs")).bashCommand
780
+ },
781
+ {
782
+ name: "sh",
783
+ load: async () => (await import("./bash-YZ33HQZQ-N6YyKtUH.mjs")).shCommand
784
+ },
785
+ {
786
+ name: "jq",
787
+ load: async () => (await import("./jq-4XLYLOS5-wFZYfsfJ.mjs")).jqCommand
788
+ },
789
+ {
790
+ name: "base64",
791
+ load: async () => (await import("./base64-C2AIWVNC-C0WIgu5V.mjs")).base64Command
792
+ },
793
+ {
794
+ name: "diff",
795
+ load: async () => (await import("./diff-MWJFIG7X-DhnPc_5r.mjs")).diffCommand
796
+ },
797
+ {
798
+ name: "date",
799
+ load: async () => (await import("./date-UUUPW43J-B7T5OTZZ.mjs")).dateCommand
800
+ },
801
+ {
802
+ name: "sleep",
803
+ load: async () => (await import("./sleep-X22JJINO-Do5hEQQW.mjs")).sleepCommand
804
+ },
805
+ {
806
+ name: "timeout",
807
+ load: async () => (await import("./timeout-YDCRSLPQ-B_yntmXU.mjs")).timeoutCommand
808
+ },
809
+ {
810
+ name: "time",
811
+ load: async () => (await import("./time-D4LNBSWX-DVWhAldK.mjs")).timeCommand
812
+ },
813
+ {
814
+ name: "seq",
815
+ load: async () => (await import("./seq-M5EC7Q57-BHfGjQvK.mjs")).seqCommand
816
+ },
817
+ {
818
+ name: "expr",
819
+ load: async () => (await import("./expr-5JAACS4X-1TBq84gG.mjs")).exprCommand
820
+ },
821
+ {
822
+ name: "md5sum",
823
+ load: async () => (await import("./md5sum-SPU24VSG-DQc8sqXO.mjs")).md5sumCommand
824
+ },
825
+ {
826
+ name: "sha1sum",
827
+ load: async () => (await import("./sha1sum-2PTOAFR6-DNjSNcYK.mjs")).sha1sumCommand
828
+ },
829
+ {
830
+ name: "sha256sum",
831
+ load: async () => (await import("./sha256sum-NS7D3IXX-BMaCKkT5.mjs")).sha256sumCommand
832
+ },
833
+ {
834
+ name: "file",
835
+ load: async () => (await import("./file-IPZJC3FQ-DcZNOWyY.mjs")).fileCommand
836
+ },
837
+ {
838
+ name: "html-to-markdown",
839
+ load: async () => (await import("./html-to-markdown-JW4MSQZO-DQOxFIvF.mjs")).htmlToMarkdownCommand
840
+ },
841
+ {
842
+ name: "help",
843
+ load: async () => (await import("./help-HZ6M2CKN--DK8mY2L.mjs")).helpCommand
844
+ },
845
+ {
846
+ name: "which",
847
+ load: async () => (await import("./which-XEM24D5D-2LvlkpUo.mjs")).whichCommand
848
+ },
849
+ {
850
+ name: "tac",
851
+ load: async () => (await import("./tac-2STMMJYW-DPyeWM9R.mjs")).tac
852
+ },
853
+ {
854
+ name: "hostname",
855
+ load: async () => (await import("./hostname-C4HQXXUP-CXVVFkUK.mjs")).hostname
856
+ },
857
+ {
858
+ name: "whoami",
859
+ load: async () => (await import("./whoami-XMTX52VE-24Kwqrk6.mjs")).whoami
860
+ },
861
+ {
862
+ name: "od",
863
+ load: async () => (await import("./od-WOKFDJTP-DZ2nxQNJ.mjs")).od
864
+ },
865
+ {
866
+ name: "gzip",
867
+ load: async () => (await import("./gzip-O5ASJAFY-CZDRROqP.mjs")).gzipCommand
868
+ },
869
+ {
870
+ name: "gunzip",
871
+ load: async () => (await import("./gzip-O5ASJAFY-CZDRROqP.mjs")).gunzipCommand
872
+ },
873
+ {
874
+ name: "zcat",
875
+ load: async () => (await import("./gzip-O5ASJAFY-CZDRROqP.mjs")).zcatCommand
876
+ }
877
+ ];
878
+ (typeof __BROWSER__ > "u" || !__BROWSER__) && (tt.push({
879
+ name: "tar",
880
+ load: async () => (await import("./tar-STHHZTZ6-DRf60e-G.mjs")).tarCommand
881
+ }), tt.push({
882
+ name: "yq",
883
+ load: async () => (await import("./yq-4QJW3EQG-XhB3aACo.mjs")).yqCommand
884
+ }), tt.push({
885
+ name: "xan",
886
+ load: async () => (await import("./xan-Y6WF3IRG-DjKO96Pj.mjs")).xanCommand
887
+ }), tt.push({
888
+ name: "sqlite3",
889
+ load: async () => (await import("./sqlite3-CGOEFJAO-DvzzghDg.mjs")).sqlite3Command
890
+ }));
891
+ var Yt = [];
892
+ (typeof __BROWSER__ > "u" || !__BROWSER__) && (Yt.push({
893
+ name: "python3",
894
+ load: async () => (await import("./python3-POMOR4OA-CKy80mpF.mjs")).python3Command
895
+ }), Yt.push({
896
+ name: "python",
897
+ load: async () => (await import("./python3-POMOR4OA-CKy80mpF.mjs")).pythonCommand
898
+ }));
899
+ var Qt = [];
900
+ (typeof __BROWSER__ > "u" || !__BROWSER__) && (Qt.push({
901
+ name: "js-exec",
902
+ load: async () => (await import("./js-exec-N5KEZBH7-CgtG-I6s.mjs")).jsExecCommand
903
+ }), Qt.push({
904
+ name: "node",
905
+ load: async () => (await import("./js-exec-N5KEZBH7-CgtG-I6s.mjs")).nodeStubCommand
906
+ }));
907
+ new TextEncoder();
908
+ Object.freeze({
909
+ stdout: "",
910
+ stderr: "",
911
+ exitCode: 0
912
+ });
913
+ [...new Map([
914
+ [":", [": [arguments]", `Null command.
915
+ No effect; the command does nothing.
916
+ Exit Status:
917
+ Always succeeds.`]],
918
+ [".", [". filename [arguments]", `Execute commands from a file in the current shell.
919
+ Read and execute commands from FILENAME in the current shell.
920
+ The entries in $PATH are used to find the directory containing FILENAME.
921
+ Exit Status:
922
+ Returns the status of the last command executed in FILENAME.`]],
923
+ ["[", ["[ arg... ]", `Evaluate conditional expression.
924
+ This is a synonym for the "test" builtin, but the last argument must
925
+ be a literal \`]', to match the opening \`['.`]],
926
+ ["alias", ["alias [-p] [name[=value] ... ]", `Define or display aliases.
927
+ Without arguments, \`alias' prints the list of aliases in the reusable
928
+ form \`alias NAME=VALUE' on standard output.
929
+ Exit Status:
930
+ alias returns true unless a NAME is supplied for which no alias has been
931
+ defined.`]],
932
+ ["bg", ["bg [job_spec ...]", `Move jobs to the background.
933
+ Place the jobs identified by each JOB_SPEC in the background, as if they
934
+ had been started with \`&'.`]],
935
+ ["break", ["break [n]", `Exit for, while, or until loops.
936
+ Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing
937
+ loops.
938
+ Exit Status:
939
+ The exit status is 0 unless N is not greater than or equal to 1.`]],
940
+ ["builtin", ["builtin [shell-builtin [arg ...]]", `Execute shell builtins.
941
+ Execute SHELL-BUILTIN with arguments ARGs without performing command
942
+ lookup. This is useful when you wish to reimplement a shell builtin
943
+ as a shell function, but need to execute the builtin within the function.
944
+ Exit Status:
945
+ Returns the exit status of SHELL-BUILTIN, or false if SHELL-BUILTIN is
946
+ not a shell builtin.`]],
947
+ ["caller", ["caller [expr]", `Return the context of the current subroutine call.
948
+ Without EXPR, returns "$line $filename". With EXPR, returns
949
+ "$line $subroutine $filename"; this extra information can be used to
950
+ provide a stack trace.
951
+ Exit Status:
952
+ Returns 0 unless the shell is not executing a subroutine call or
953
+ EXPR is invalid.`]],
954
+ ["cd", ["cd [-L|-P] [dir]", `Change the shell working directory.
955
+ Change the current directory to DIR. The default DIR is the value of the
956
+ HOME shell variable.
957
+
958
+ The variable CDPATH defines the search path for the directory containing
959
+ DIR. Alternative directory names in CDPATH are separated by a colon (:).
960
+ A null directory name is the same as the current directory. If DIR begins
961
+ with a slash (/), then CDPATH is not used.
962
+
963
+ If the directory is not found, and the shell option \`cdable_vars' is set,
964
+ the word is assumed to be a variable name. If that variable has a value,
965
+ its value is used for DIR.
966
+
967
+ Options:
968
+ -L force symbolic links to be followed
969
+ -P use the physical directory structure without following symbolic
970
+ links
971
+
972
+ The default is to follow symbolic links, as if \`-L' were specified.
973
+
974
+ Exit Status:
975
+ Returns 0 if the directory is changed; non-zero otherwise.`]],
976
+ ["command", ["command [-pVv] command [arg ...]", `Execute a simple command or display information about commands.
977
+ Runs COMMAND with ARGS suppressing shell function lookup, or display
978
+ information about the specified COMMANDs.
979
+
980
+ Options:
981
+ -p use a default value for PATH that is guaranteed to find all of
982
+ the standard utilities
983
+ -v print a description of COMMAND similar to the \`type' builtin
984
+ -V print a more verbose description of each COMMAND
985
+
986
+ Exit Status:
987
+ Returns exit status of COMMAND, or failure if COMMAND is not found.`]],
988
+ ["compgen", ["compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word]", `Display possible completions depending on the options.
989
+ Intended to be used from within a shell function generating possible
990
+ completions. If the optional WORD argument is supplied, matches against
991
+ WORD are generated.
992
+ Exit Status:
993
+ Returns success unless an invalid option is supplied or an error occurs.`]],
994
+ ["complete", ["complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [name ...]", `Specify how arguments are to be completed.
995
+ For each NAME, specify how arguments are to be completed.
996
+ Exit Status:
997
+ Returns success unless an invalid option is supplied or an error occurs.`]],
998
+ ["continue", ["continue [n]", `Resume for, while, or until loops.
999
+ Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.
1000
+ If N is specified, resumes the Nth enclosing loop.
1001
+ Exit Status:
1002
+ The exit status is 0 unless N is not greater than or equal to 1.`]],
1003
+ ["declare", ["declare [-aAfFgilnrtux] [-p] [name[=value] ...]", `Set variable values and attributes.
1004
+ Declare variables and give them attributes. If no NAMEs are given,
1005
+ display the attributes and values of all variables.
1006
+
1007
+ Options:
1008
+ -a to make NAMEs indexed arrays (if supported)
1009
+ -A to make NAMEs associative arrays (if supported)
1010
+ -i to make NAMEs have the \`integer' attribute
1011
+ -l to convert the value of each NAME to lower case on assignment
1012
+ -n make NAME a reference to the variable named by its value
1013
+ -r to make NAMEs readonly
1014
+ -t to make NAMEs have the \`trace' attribute
1015
+ -u to convert the value of each NAME to upper case on assignment
1016
+ -x to make NAMEs export
1017
+
1018
+ Exit Status:
1019
+ Returns success unless an invalid option is supplied or a variable
1020
+ assignment error occurs.`]],
1021
+ ["dirs", ["dirs [-clpv] [+N] [-N]", `Display directory stack.
1022
+ Display the list of currently remembered directories. Directories
1023
+ find their way onto the list with the \`pushd' command; you can get
1024
+ back up through the list with the \`popd' command.
1025
+ Exit Status:
1026
+ Returns success unless an invalid option is supplied or an error occurs.`]],
1027
+ ["disown", ["disown [-h] [-ar] [jobspec ...]", `Remove jobs from current shell.
1028
+ Without any JOBSPECs, remove the current job.`]],
1029
+ ["echo", ["echo [-neE] [arg ...]", `Write arguments to the standard output.
1030
+ Display the ARGs, separated by a single space character and followed by a
1031
+ newline, on the standard output.
1032
+
1033
+ Options:
1034
+ -n do not append a newline
1035
+ -e enable interpretation of the following backslash escapes
1036
+ -E explicitly suppress interpretation of backslash escapes
1037
+
1038
+ Exit Status:
1039
+ Returns success unless a write error occurs.`]],
1040
+ ["enable", ["enable [-a] [-dnps] [-f filename] [name ...]", `Enable and disable shell builtins.
1041
+ Enables and disables builtin shell commands.
1042
+ Exit Status:
1043
+ Returns success unless NAME is not a shell builtin or an error occurs.`]],
1044
+ ["eval", ["eval [arg ...]", `Execute arguments as a shell command.
1045
+ Combine ARGs into a single string, use the result as input to the shell,
1046
+ and execute the resulting commands.
1047
+ Exit Status:
1048
+ Returns exit status of command or success if command is null.`]],
1049
+ ["exec", ["exec [-cl] [-a name] [command [arguments ...]] [redirection ...]", `Replace the shell with the given command.
1050
+ Execute COMMAND, replacing this shell with the specified program.
1051
+ ARGUMENTS become the arguments to COMMAND. If COMMAND is not specified,
1052
+ any redirections take effect in the current shell.
1053
+ Exit Status:
1054
+ Returns success unless COMMAND is not found or a redirection error occurs.`]],
1055
+ ["exit", ["exit [n]", `Exit the shell.
1056
+ Exits the shell with a status of N. If N is omitted, the exit status
1057
+ is that of the last command executed.`]],
1058
+ ["export", ["export [-fn] [name[=value] ...] or export -p", `Set export attribute for shell variables.
1059
+ Marks each NAME for automatic export to the environment of subsequently
1060
+ executed commands. If VALUE is supplied, assign VALUE before exporting.
1061
+
1062
+ Options:
1063
+ -f refer to shell functions
1064
+ -n remove the export property from each NAME
1065
+ -p display a list of all exported variables and functions
1066
+
1067
+ Exit Status:
1068
+ Returns success unless an invalid option is given or NAME is invalid.`]],
1069
+ ["false", ["false", `Return an unsuccessful result.
1070
+ Exit Status:
1071
+ Always fails.`]],
1072
+ ["fc", ["fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]", `Display or execute commands from the history list.
1073
+ Exit Status:
1074
+ Returns success or status of executed command.`]],
1075
+ ["fg", ["fg [job_spec]", `Move job to the foreground.
1076
+ Place the job identified by JOB_SPEC in the foreground, making it the
1077
+ current job.`]],
1078
+ ["getopts", ["getopts optstring name [arg]", `Parse option arguments.
1079
+ Getopts is used by shell procedures to parse positional parameters
1080
+ as options.
1081
+
1082
+ OPTSTRING contains the option letters to be recognized; if a letter
1083
+ is followed by a colon, the option is expected to have an argument,
1084
+ which should be separated from it by white space.
1085
+ Exit Status:
1086
+ Returns success if an option is found; fails if the end of options is
1087
+ encountered or an error occurs.`]],
1088
+ ["hash", ["hash [-lr] [-p pathname] [-dt] [name ...]", `Remember or display program locations.
1089
+ Determine and remember the full pathname of each command NAME.
1090
+ Exit Status:
1091
+ Returns success unless NAME is not found or an invalid option is given.`]],
1092
+ ["help", ["help [-s] [pattern ...]", `Display information about builtin commands.
1093
+ Displays brief summaries of builtin commands. If PATTERN is
1094
+ specified, gives detailed help on all commands matching PATTERN,
1095
+ otherwise the list of help topics is printed.
1096
+
1097
+ Options:
1098
+ -s output only a short usage synopsis for each topic matching
1099
+ PATTERN
1100
+
1101
+ Exit Status:
1102
+ Returns success unless PATTERN is not found.`]],
1103
+ ["history", ["history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]", `Display or manipulate the history list.
1104
+ Display the history list with line numbers, prefixing each modified
1105
+ entry with a \`*'.
1106
+ Exit Status:
1107
+ Returns success unless an invalid option is given or an error occurs.`]],
1108
+ ["jobs", ["jobs [-lnprs] [jobspec ...] or jobs -x command [args]", `Display status of jobs.
1109
+ Lists the active jobs.
1110
+ Exit Status:
1111
+ Returns success unless an invalid option is given or an error occurs.`]],
1112
+ ["kill", ["kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]", `Send a signal to a job.
1113
+ Send the processes identified by PID or JOBSPEC the signal named by
1114
+ SIGSPEC or SIGNUM.
1115
+ Exit Status:
1116
+ Returns success unless an invalid option is given or an error occurs.`]],
1117
+ ["let", ["let arg [arg ...]", `Evaluate arithmetic expressions.
1118
+ Evaluate each ARG as an arithmetic expression. Evaluation is done in
1119
+ fixed-width integers with no check for overflow, though division by 0
1120
+ is trapped and flagged as an error.
1121
+ Exit Status:
1122
+ If the last ARG evaluates to 0, let returns 1; 0 is returned otherwise.`]],
1123
+ ["local", ["local [option] name[=value] ...", `Define local variables.
1124
+ Create a local variable called NAME, and give it VALUE. OPTION can
1125
+ be any option accepted by \`declare'.
1126
+
1127
+ Local can only be used within a function; it makes the variable NAME
1128
+ have a visible scope restricted to that function and its children.
1129
+ Exit Status:
1130
+ Returns success unless an invalid option is supplied, a variable
1131
+ assignment error occurs, or the shell is not executing a function.`]],
1132
+ ["logout", ["logout [n]", `Exit a login shell.
1133
+ Exits a login shell with exit status N. Returns an error if not executed
1134
+ in a login shell.`]],
1135
+ ["mapfile", ["mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]", `Read lines from the standard input into an indexed array variable.
1136
+ Read lines from the standard input into the indexed array variable ARRAY,
1137
+ or from file descriptor FD if the -u option is supplied.
1138
+
1139
+ Options:
1140
+ -d delim Use DELIM to terminate lines, instead of newline
1141
+ -n count Copy at most COUNT lines
1142
+ -O origin Begin assigning to ARRAY at index ORIGIN
1143
+ -s count Discard the first COUNT lines read
1144
+ -t Remove a trailing DELIM from each line read (default newline)
1145
+ -u fd Read lines from file descriptor FD instead of standard input
1146
+
1147
+ Exit Status:
1148
+ Returns success unless an invalid option is given or ARRAY is readonly.`]],
1149
+ ["popd", ["popd [-n] [+N | -N]", `Remove directories from stack.
1150
+ Removes entries from the directory stack.
1151
+ Exit Status:
1152
+ Returns success unless an invalid argument is supplied or the directory
1153
+ change fails.`]],
1154
+ ["printf", ["printf [-v var] format [arguments]", `Formats and prints ARGUMENTS under control of the FORMAT.
1155
+
1156
+ Options:
1157
+ -v var assign the output to shell variable VAR rather than
1158
+ display it on the standard output
1159
+
1160
+ FORMAT is a character string which contains three types of objects: plain
1161
+ characters, which are simply copied to standard output; character escape
1162
+ sequences, which are converted and copied to the standard output; and
1163
+ format specifications, each of which causes printing of the next successive
1164
+ argument.
1165
+ Exit Status:
1166
+ Returns success unless an invalid option is given or a write or assignment
1167
+ error occurs.`]],
1168
+ ["pushd", ["pushd [-n] [+N | -N | dir]", `Add directories to stack.
1169
+ Adds a directory to the top of the directory stack, or rotates
1170
+ the stack, making the new top of the stack the current working
1171
+ directory.
1172
+ Exit Status:
1173
+ Returns success unless an invalid argument is supplied or the directory
1174
+ change fails.`]],
1175
+ ["pwd", ["pwd [-LP]", `Print the name of the current working directory.
1176
+
1177
+ Options:
1178
+ -L print the value of $PWD if it names the current working
1179
+ directory
1180
+ -P print the physical directory, without any symbolic links
1181
+
1182
+ By default, \`pwd' behaves as if \`-L' were specified.
1183
+ Exit Status:
1184
+ Returns 0 unless an invalid option is given or the current directory
1185
+ cannot be read.`]],
1186
+ ["read", ["read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...]", `Read a line from the standard input and split it into fields.
1187
+ Reads a single line from the standard input, or from file descriptor FD
1188
+ if the -u option is supplied. The line is split into fields as with word
1189
+ splitting, and the first word is assigned to the first NAME, the second
1190
+ word to the second NAME, and so on, with any leftover words assigned to
1191
+ the last NAME.
1192
+ Exit Status:
1193
+ The return code is zero, unless end-of-file is encountered, read times out,
1194
+ or an invalid file descriptor is supplied as the argument to -u.`]],
1195
+ ["readarray", ["readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c quantum] [array]", "Read lines from a file into an array variable.\n A synonym for `mapfile'."]],
1196
+ ["readonly", ["readonly [-aAf] [name[=value] ...] or readonly -p", `Mark shell variables as unchangeable.
1197
+ Mark each NAME as read-only; the values of these NAMEs may not be
1198
+ changed by subsequent assignment.
1199
+ Exit Status:
1200
+ Returns success unless an invalid option is given or NAME is invalid.`]],
1201
+ ["return", ["return [n]", `Return from a shell function.
1202
+ Causes a function or sourced script to exit with the return value
1203
+ specified by N. If N is omitted, the return status is that of the
1204
+ last command executed within the function or script.
1205
+ Exit Status:
1206
+ Returns N, or failure if the shell is not executing a function or script.`]],
1207
+ ["set", ["set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]", `Set or unset values of shell options and positional parameters.
1208
+ Change the value of shell attributes and positional parameters, or
1209
+ display the names and values of shell variables.
1210
+
1211
+ Options:
1212
+ -e Exit immediately if a command exits with a non-zero status.
1213
+ -u Treat unset variables as an error when substituting.
1214
+ -x Print commands and their arguments as they are executed.
1215
+ -o option-name
1216
+ Set the variable corresponding to option-name
1217
+
1218
+ Exit Status:
1219
+ Returns success unless an invalid option is given.`]],
1220
+ ["shift", ["shift [n]", `Shift positional parameters.
1221
+ Rename the positional parameters $N+1,$N+2 ... to $1,$2 ... If N is
1222
+ not given, it is assumed to be 1.
1223
+ Exit Status:
1224
+ Returns success unless N is negative or greater than $#.`]],
1225
+ ["shopt", ["shopt [-pqsu] [-o] [optname ...]", `Set and unset shell options.
1226
+ Change the setting of each shell option OPTNAME. Without any option
1227
+ arguments, list each supplied OPTNAME, or all shell options if no
1228
+ OPTNAMEs are given, with an indication of whether or not each is set.
1229
+
1230
+ Options:
1231
+ -o restrict OPTNAMEs to those defined for use with \`set -o'
1232
+ -p print each shell option with an indication of its status
1233
+ -q suppress output
1234
+ -s enable (set) each OPTNAME
1235
+ -u disable (unset) each OPTNAME
1236
+
1237
+ Exit Status:
1238
+ Returns success if OPTNAME is enabled; fails if an invalid option is
1239
+ given or OPTNAME is disabled.`]],
1240
+ ["source", ["source filename [arguments]", `Execute commands from a file in the current shell.
1241
+ Read and execute commands from FILENAME in the current shell.
1242
+ The entries in $PATH are used to find the directory containing FILENAME.
1243
+ Exit Status:
1244
+ Returns the status of the last command executed in FILENAME.`]],
1245
+ ["suspend", ["suspend [-f]", `Suspend shell execution.
1246
+ Suspend the execution of this shell until it receives a SIGCONT signal.`]],
1247
+ ["test", ["test [expr]", `Evaluate conditional expression.
1248
+ Exits with a status of 0 (true) or 1 (false) depending on
1249
+ the evaluation of EXPR. Expressions may be unary or binary.
1250
+ Exit Status:
1251
+ Returns success if EXPR evaluates to true; fails if EXPR evaluates to
1252
+ false or an invalid argument is given.`]],
1253
+ ["times", ["times", `Display process times.
1254
+ Prints the accumulated user and system times for the shell and all of its
1255
+ child processes.
1256
+ Exit Status:
1257
+ Always succeeds.`]],
1258
+ ["trap", ["trap [-lp] [[arg] signal_spec ...]", `Trap signals and other events.
1259
+ Defines and activates handlers to be run when the shell receives signals
1260
+ or other conditions.
1261
+ Exit Status:
1262
+ Returns success unless a SIGSPEC is invalid or an invalid option is given.`]],
1263
+ ["true", ["true", `Return a successful result.
1264
+ Exit Status:
1265
+ Always succeeds.`]],
1266
+ ["type", ["type [-afptP] name [name ...]", `Display information about command type.
1267
+ For each NAME, indicate how it would be interpreted if used as a
1268
+ command name.
1269
+
1270
+ Options:
1271
+ -a display all locations containing an executable named NAME
1272
+ -f suppress shell function lookup
1273
+ -P force a PATH search for each NAME, even if it is an alias,
1274
+ builtin, or function, and returns the name of the disk file
1275
+ that would be executed
1276
+ -p returns either the name of the disk file that would be executed,
1277
+ or nothing if \`type -t NAME' would not return \`file'
1278
+ -t output a single word which is one of \`alias', \`keyword',
1279
+ \`function', \`builtin', \`file' or \`', if NAME is an alias,
1280
+ shell reserved word, shell function, shell builtin, disk file,
1281
+ or not found, respectively
1282
+
1283
+ Exit Status:
1284
+ Returns success if all of the NAMEs are found; fails if any are not found.`]],
1285
+ ["typeset", ["typeset [-aAfFgilnrtux] [-p] name[=value] ...", "Set variable values and attributes.\n A synonym for `declare'."]],
1286
+ ["ulimit", ["ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]", `Modify shell resource limits.
1287
+ Provides control over the resources available to the shell and processes
1288
+ it creates, on systems that allow such control.
1289
+ Exit Status:
1290
+ Returns success unless an invalid option is supplied or an error occurs.`]],
1291
+ ["umask", ["umask [-p] [-S] [mode]", `Display or set file mode mask.
1292
+ Sets the user file-creation mask to MODE. If MODE is omitted, prints
1293
+ the current value of the mask.
1294
+ Exit Status:
1295
+ Returns success unless MODE is invalid or an invalid option is given.`]],
1296
+ ["unalias", ["unalias [-a] name [name ...]", `Remove each NAME from the list of defined aliases.
1297
+ Exit Status:
1298
+ Returns success unless a NAME is not an existing alias.`]],
1299
+ ["unset", ["unset [-f] [-v] [-n] [name ...]", `Unset values and attributes of shell variables and functions.
1300
+ For each NAME, remove the corresponding variable or function.
1301
+
1302
+ Options:
1303
+ -f treat each NAME as a shell function
1304
+ -v treat each NAME as a shell variable
1305
+ -n treat each NAME as a name reference and unset the variable itself
1306
+ rather than the variable it references
1307
+
1308
+ Without options, unset first tries to unset a variable, and if that fails,
1309
+ tries to unset a function.
1310
+ Exit Status:
1311
+ Returns success unless an invalid option is given or a NAME is read-only.`]],
1312
+ ["wait", ["wait [-fn] [id ...]", `Wait for job completion and return exit status.
1313
+ Waits for each process identified by an ID, which may be a process ID or a
1314
+ job specification, and reports its termination status.
1315
+ Exit Status:
1316
+ Returns the status of the last ID; fails if ID is invalid or an invalid
1317
+ option is given.`]]
1318
+ ]).keys()].sort();
1319
+ new TextDecoder("utf-8", { fatal: !0 });
1320
+ //#endregion
1321
+ //#region ../../packages/manifest/dist/index.mjs
1322
+ function isManifestAgent(value) {
1323
+ if (typeof value !== "object" || value === null) return false;
1324
+ const agent = value;
1325
+ return typeof agent.slug === "string" && agent.slug.trim().length > 0 && typeof agent.buildRuntime === "function" && typeof agent.model === "string" && typeof agent.systemPrompt === "string";
1326
+ }
1327
+ function validateManifestAgent(value, filePath) {
1328
+ if (!isManifestAgent(value)) throw new Error(`${filePath} must default-export defineAgent(...)`);
1329
+ return value;
1330
+ }
1331
+ function normalizeWebhookEndpoint(endpoint) {
1332
+ return endpoint.replace(/^\/+|\/+$/g, "").replace(/^triggers\/?/, "");
1333
+ }
1334
+ function agentRouteFromKey(key) {
1335
+ return `/agents/${key}`;
1336
+ }
1337
+ function workflowRouteFromKey(key) {
1338
+ return `/workflows/${key}`;
1339
+ }
1340
+ function webhookRouteFromEndpoint(endpoint) {
1341
+ const normalized = normalizeWebhookEndpoint(endpoint);
1342
+ if (!normalized) throw new Error("Webhook endpoint must not be empty");
1343
+ return `/triggers/${normalized}`;
1344
+ }
1345
+ async function discoverAgentEntries(agentsDir, options) {
1346
+ const files = await discoverModuleFileEntries(agentsDir, {
1347
+ nestedEntry: "agent",
1348
+ duplicateLabel: "agent module file"
1349
+ });
1350
+ const entries = [];
1351
+ for (const { filePath, moduleFile } of files) {
1352
+ const agent = await importAgentDefinition(filePath, options);
1353
+ entries.push({
1354
+ key: agent.slug,
1355
+ route: agentRouteFromKey(agent.slug),
1356
+ filePath,
1357
+ moduleFile
1358
+ });
1359
+ }
1360
+ return entries;
1361
+ }
1362
+ async function importAgentDefinition(filePath, options) {
1363
+ const appRoot = resolveAppRoot(filePath);
1364
+ const href = pathToFileURL(filePath).href;
1365
+ return runWithAppRoot(appRoot, async () => {
1366
+ return validateManifestAgent((await (options?.reload ? import(`${href}?keystroke=${Date.now()}`) : import(href))).default, filePath);
1367
+ });
1368
+ }
1369
+ const ACTION = Symbol.for("keystroke.action");
1370
+ function isManifestAction(value) {
1371
+ if (typeof value !== "object" || value === null) return false;
1372
+ return ACTION in value && value[ACTION] === true;
1373
+ }
1374
+ function getManifestActionCredentialRequirements(action) {
1375
+ return Array.isArray(action.credentials) ? action.credentials : void 0;
1376
+ }
1377
+ function countAgentCredentials(agent) {
1378
+ const keys = /* @__PURE__ */ new Set();
1379
+ for (const tool of agent.tools ?? []) {
1380
+ const record = tool;
1381
+ const requirements = isManifestAction(tool) ? getManifestActionCredentialRequirements(tool) : "credentials" in record && Array.isArray(record.credentials) ? record.credentials : void 0;
1382
+ if (!requirements?.length) continue;
1383
+ for (const requirement of normalizeCredentialList(requirements)) keys.add(requirement.key);
1384
+ }
1385
+ return keys.size;
1386
+ }
1387
+ const SKIP_DIRS = new Set([".git", "node_modules"]);
1388
+ function toPosix$1(path) {
1389
+ return path.split(sep).join("/");
1390
+ }
1391
+ function parseSkillFrontmatter(raw) {
1392
+ const match = raw.match(/^---\s*\n([\s\S]*?)\n---/);
1393
+ if (!match) return {};
1394
+ const out = {};
1395
+ for (const line of match[1]?.split("\n") ?? []) {
1396
+ const trimmed = line.trim();
1397
+ if (!trimmed || trimmed.startsWith("#")) continue;
1398
+ const colon = trimmed.indexOf(":");
1399
+ if (colon < 0) continue;
1400
+ const key = trimmed.slice(0, colon).trim();
1401
+ let value = trimmed.slice(colon + 1).trim();
1402
+ if (value.startsWith("\"") && value.endsWith("\"") || value.startsWith("'") && value.endsWith("'")) value = value.slice(1, -1);
1403
+ if (key === "name") out.name = value;
1404
+ else if (key === "description") out.description = value;
1405
+ }
1406
+ return out;
1407
+ }
1408
+ function walkSkillFiles(root, dir, out) {
1409
+ for (const name of readdirSync(dir).sort()) {
1410
+ const absolute = join(dir, name);
1411
+ const stats = statSync(absolute);
1412
+ if (stats.isDirectory()) {
1413
+ if (SKIP_DIRS.has(name)) continue;
1414
+ walkSkillFiles(root, absolute, out);
1415
+ continue;
1416
+ }
1417
+ if (!stats.isFile() || name !== "SKILL.md") continue;
1418
+ const moduleFile = toPosix$1(relative(root, absolute));
1419
+ const slug = toPosix$1(relative(join(root, "src", "skills"), absolute)).replace(/\/?SKILL\.md$/, "");
1420
+ if (!slug) continue;
1421
+ const frontmatter = parseSkillFrontmatter(readFileSync(absolute, "utf8"));
1422
+ out.push({
1423
+ slug,
1424
+ name: frontmatter.name,
1425
+ description: frontmatter.description,
1426
+ moduleFile
1427
+ });
1428
+ }
1429
+ }
1430
+ /** Discover skill metadata from src/skills SKILL.md files for the route manifest. */
1431
+ function discoverSkillManifestEntries(projectRoot) {
1432
+ const skillsDir = join(projectRoot, "src", "skills");
1433
+ if (!statSync(skillsDir, { throwIfNoEntry: false })?.isDirectory()) return [];
1434
+ const entries = [];
1435
+ walkSkillFiles(projectRoot, skillsDir, entries);
1436
+ return entries;
1437
+ }
1438
+ function schemaToJson(schema) {
1439
+ return toJSONSchema(schema, { target: "openapi-3.0" });
1440
+ }
1441
+ function collectIntegrationKeys(integrations) {
1442
+ return integrations.map((integration) => integration.key);
1443
+ }
1444
+ function serializeRouteManifest(manifest) {
1445
+ const entries = [];
1446
+ for (const entry of manifest) switch (entry.kind) {
1447
+ case "health":
1448
+ entries.push(entry);
1449
+ break;
1450
+ case "agent":
1451
+ entries.push({
1452
+ kind: entry.kind,
1453
+ slug: entry.slug,
1454
+ moduleFile: entry.moduleFile,
1455
+ name: entry.name,
1456
+ description: entry.description,
1457
+ model: entry.model,
1458
+ systemPrompt: entry.systemPrompt,
1459
+ toolCount: entry.toolCount,
1460
+ credentialCount: entry.credentialCount
1461
+ });
1462
+ break;
1463
+ case "workflow":
1464
+ entries.push({
1465
+ kind: entry.kind,
1466
+ slug: entry.slug,
1467
+ name: entry.name,
1468
+ description: entry.description,
1469
+ subscribable: entry.subscribable,
1470
+ moduleFile: entry.moduleFile,
1471
+ requestSchema: schemaToJson(entry.request)
1472
+ });
1473
+ break;
1474
+ case "trigger-webhook":
1475
+ entries.push({
1476
+ kind: entry.kind,
1477
+ endpoint: entry.endpoint,
1478
+ attachmentIds: entry.attachmentIds,
1479
+ moduleFile: entry.moduleFile,
1480
+ attachmentSchemas: Object.fromEntries(Object.entries(entry.attachmentSchemas).map(([attachmentKey, schemas]) => [attachmentKey, {
1481
+ requestSchema: schemaToJson(schemas.request),
1482
+ ...schemas.filter ? { filterSchema: schemaToJson(schemas.filter) } : {}
1483
+ }]))
1484
+ });
1485
+ break;
1486
+ case "trigger-poll":
1487
+ entries.push({
1488
+ kind: entry.kind,
1489
+ attachmentId: entry.attachmentId,
1490
+ moduleFile: entry.moduleFile,
1491
+ schedule: entry.schedule
1492
+ });
1493
+ break;
1494
+ case "trigger-poll-group":
1495
+ entries.push({
1496
+ kind: entry.kind,
1497
+ pollId: entry.pollId,
1498
+ attachmentIds: entry.attachmentIds,
1499
+ moduleFile: entry.moduleFile,
1500
+ schedule: entry.schedule
1501
+ });
1502
+ break;
1503
+ case "cron-schedule":
1504
+ entries.push(entry);
1505
+ break;
1506
+ default: break;
1507
+ }
1508
+ return entries;
1509
+ }
1510
+ function toStoredRouteManifest(manifest, options) {
1511
+ return {
1512
+ version: 2,
1513
+ entries: serializeRouteManifest(manifest),
1514
+ skills: options?.skills ?? [],
1515
+ integrations: options?.integrations
1516
+ };
1517
+ }
1518
+ function buildStoredRouteManifestFromContext(ctx) {
1519
+ const integrations = ctx.options?.integrations ?? ctx.options?.plugins?.map((plugin) => ({
1520
+ key: plugin.name,
1521
+ mount: plugin.register
1522
+ })) ?? [];
1523
+ return toStoredRouteManifest(ctx.manifest, {
1524
+ integrations: collectIntegrationKeys(integrations),
1525
+ skills: ctx.skills ?? (ctx.projectRoot ? discoverSkillManifestEntries(ctx.projectRoot) : void 0) ?? []
1526
+ });
1527
+ }
1528
+ function persistStoredRouteManifest(projectRoot, manifest) {
1529
+ const path = join(projectRoot, ROUTE_MANIFEST_REL_PATH);
1530
+ mkdirSync(dirname(path), { recursive: true });
1531
+ writeFileSync(path, `${JSON.stringify(manifest, null, 2)}\n`);
1532
+ }
1533
+ const WORKFLOW = Symbol.for("keystroke.workflow");
1534
+ function isManifestWorkflow(value) {
1535
+ if (typeof value !== "object" || value === null) return false;
1536
+ if (!(WORKFLOW in value) || value[WORKFLOW] !== true) return false;
1537
+ const workflow = value;
1538
+ return typeof workflow.slug === "string" && workflow.slug.trim().length > 0 && workflow.input instanceof Object && "safeParse" in workflow.input && workflow.output instanceof Object && "safeParse" in workflow.output;
1539
+ }
1540
+ function validateManifestWorkflow(value, filePath) {
1541
+ if (!isManifestWorkflow(value)) throw new Error(`${filePath} must default-export defineWorkflow(...)`);
1542
+ return value;
1543
+ }
1544
+ const TRIGGER_ATTACHMENT = Symbol.for("keystroke.triggerAttachment");
1545
+ const zodSchema = custom((value) => value instanceof ZodType, "must be a Zod schema");
1546
+ const cronScheduleSchema = string().trim().min(1, "cron schedule must be a non-empty string");
1547
+ const workflowSchema = custom((value) => isManifestWorkflow(value), "must be defineWorkflow(...)");
1548
+ const agentSchema = custom((value) => typeof value === "object" && value !== null && typeof value.slug === "string" && value.slug.trim().length > 0 && typeof value.prompt === "function", "must be defineAgent(...)");
1549
+ const promptSchema = union([string(), _function()]);
1550
+ const baseSourceShape = {
1551
+ key: string().trim().min(1),
1552
+ attach: _function()
1553
+ };
1554
+ const triggerSourceSchema = discriminatedUnion("kind", [
1555
+ object({
1556
+ kind: literal("webhook"),
1557
+ ...baseSourceShape,
1558
+ endpoint: string().min(1),
1559
+ request: zodSchema,
1560
+ filter: zodSchema.optional(),
1561
+ passes: _function()
1562
+ }),
1563
+ object({
1564
+ kind: literal("cron"),
1565
+ ...baseSourceShape,
1566
+ schedule: cronScheduleSchema
1567
+ }),
1568
+ object({
1569
+ kind: literal("poll"),
1570
+ ...baseSourceShape,
1571
+ id: string().optional(),
1572
+ schedule: cronScheduleSchema,
1573
+ run: _function(),
1574
+ filters: array(_function()),
1575
+ passes: _function()
1576
+ })
1577
+ ]);
1578
+ const triggerAttachmentCoreSchema = discriminatedUnion("target", [object({
1579
+ key: string().trim().min(1),
1580
+ source: triggerSourceSchema,
1581
+ target: literal("workflow"),
1582
+ workflow: workflowSchema,
1583
+ transform: _function().optional()
1584
+ }), object({
1585
+ key: string().trim().min(1),
1586
+ source: triggerSourceSchema,
1587
+ target: literal("agent"),
1588
+ agent: agentSchema,
1589
+ prompt: promptSchema
1590
+ })]);
1591
+ function isManifestTriggerAttachment(value) {
1592
+ if (typeof value !== "object" || value === null) return false;
1593
+ if (!(TRIGGER_ATTACHMENT in value) || value[TRIGGER_ATTACHMENT] !== true) return false;
1594
+ return triggerAttachmentCoreSchema.safeParse(value).success;
1595
+ }
1596
+ function validateManifestTriggerAttachment(value, filePath) {
1597
+ if (!isManifestTriggerAttachment(value)) throw new Error(`${filePath} must default-export a trigger attachment from .attach({ workflow }) or .attach({ agent, prompt })`);
1598
+ return value;
1599
+ }
1600
+ function shouldDiscoverTriggerFile(triggersDir, filePath) {
1601
+ return !relative(triggersDir, filePath).split(sep).includes("sources");
1602
+ }
1603
+ async function discoverTriggerAttachments(triggersDir, options) {
1604
+ const files = await discoverModuleFileEntries(triggersDir, {
1605
+ nestedEntry: "trigger",
1606
+ duplicateLabel: "trigger module file",
1607
+ shouldDiscoverFile: (filePath) => shouldDiscoverTriggerFile(triggersDir, filePath)
1608
+ });
1609
+ const attachments = [];
1610
+ for (const { filePath, moduleFile } of files) {
1611
+ const attachment = await importTriggerAttachment(filePath, options);
1612
+ attachments.push({
1613
+ key: attachment.key,
1614
+ filePath,
1615
+ moduleFile,
1616
+ attachment
1617
+ });
1618
+ }
1619
+ return attachments;
1620
+ }
1621
+ function validateImportedTriggerAttachment(def, filePath) {
1622
+ return validateManifestTriggerAttachment(def, filePath);
1623
+ }
1624
+ async function importTriggerAttachment(filePath, options) {
1625
+ const href = pathToFileURL(filePath).href;
1626
+ return validateImportedTriggerAttachment((await (options?.reload ? import(`${href}?keystroke=${Date.now()}`) : import(href))).default, filePath);
1627
+ }
1628
+ function pollGroupId(discovered) {
1629
+ const source = discovered.attachment.source;
1630
+ if (source.kind !== "poll") throw new Error(`Attachment "${discovered.key}" is not a poll trigger`);
1631
+ return source.id ?? source.key;
1632
+ }
1633
+ function buildPollGroups(attachments) {
1634
+ const byId = /* @__PURE__ */ new Map();
1635
+ for (const discovered of attachments) {
1636
+ if (discovered.attachment.source.kind !== "poll") continue;
1637
+ const id = pollGroupId(discovered);
1638
+ const group = byId.get(id) ?? [];
1639
+ group.push(discovered);
1640
+ byId.set(id, group);
1641
+ }
1642
+ return [...byId.entries()].map(([id, groupAttachments]) => ({
1643
+ id,
1644
+ attachments: groupAttachments
1645
+ }));
1646
+ }
1647
+ function buildWebhookBindingsByRoute(attachments, handlerOptionsFor) {
1648
+ const webhookBindingsByRoute = /* @__PURE__ */ new Map();
1649
+ for (const discovered of attachments) {
1650
+ const source = discovered.attachment.source;
1651
+ if (source.kind !== "webhook") continue;
1652
+ const route = webhookRouteFromEndpoint(source.endpoint);
1653
+ const bindings = webhookBindingsByRoute.get(route) ?? [];
1654
+ bindings.push({
1655
+ discovered,
1656
+ options: handlerOptionsFor(discovered.key)
1657
+ });
1658
+ webhookBindingsByRoute.set(route, bindings);
1659
+ }
1660
+ return webhookBindingsByRoute;
1661
+ }
1662
+ function webhookSchemaEntriesFromBindings(bindings) {
1663
+ return bindings.flatMap((binding) => {
1664
+ const source = binding.discovered.attachment.source;
1665
+ if (source.kind !== "webhook") return [];
1666
+ return [{
1667
+ attachmentKey: binding.discovered.key,
1668
+ request: source.request,
1669
+ ...source.filter ? { filter: source.filter } : {}
1670
+ }];
1671
+ });
1672
+ }
1673
+ function webhookMatchSchemaForBindings(bindings) {
1674
+ const schemas = bindings.flatMap((binding) => {
1675
+ const source = binding.discovered.attachment.source;
1676
+ return source.kind === "webhook" ? [source.request] : [];
1677
+ });
1678
+ if (schemas.length === 0) throw new Error("Webhook bindings require at least one webhook source");
1679
+ if (schemas.length === 1) return schemas[0];
1680
+ return union(schemas);
1681
+ }
1682
+ function webhookManifestAttachmentSchemasFromBindings(bindings) {
1683
+ return Object.fromEntries(webhookSchemaEntriesFromBindings(bindings).map((entry) => [entry.attachmentKey, {
1684
+ request: entry.request,
1685
+ ...entry.filter ? { filter: entry.filter } : {}
1686
+ }]));
1687
+ }
1688
+ async function discoverWorkflowEntries(workflowsDir, options) {
1689
+ const files = await discoverModuleFileEntries(workflowsDir, {
1690
+ nestedEntry: "workflow",
1691
+ duplicateLabel: "workflow module file"
1692
+ });
1693
+ const entries = [];
1694
+ for (const { filePath, moduleFile } of files) {
1695
+ const definition = await importWorkflowDefinition(filePath, options);
1696
+ entries.push({
1697
+ key: definition.slug,
1698
+ route: workflowRouteFromKey(definition.slug),
1699
+ filePath,
1700
+ moduleFile
1701
+ });
1702
+ }
1703
+ return entries;
1704
+ }
1705
+ function validateImportedWorkflowDefinition(def, filePath) {
1706
+ return validateManifestWorkflow(def, filePath);
1707
+ }
1708
+ async function importWorkflowDefinition(filePath, options) {
1709
+ const href = pathToFileURL(filePath).href;
1710
+ return validateImportedWorkflowDefinition((await (options?.reload ? import(`${href}?keystroke=${Date.now()}`) : import(href))).default, filePath);
1711
+ }
1712
+ async function discoverWorkflows(workflowsDir, options) {
1713
+ const entries = await discoverWorkflowEntries(workflowsDir, options);
1714
+ const workflows = [];
1715
+ for (const entry of entries) {
1716
+ const definition = await importWorkflowDefinition(entry.filePath, options);
1717
+ workflows.push({
1718
+ key: definition.slug,
1719
+ route: workflowRouteFromKey(definition.slug),
1720
+ filePath: entry.filePath,
1721
+ definition
1722
+ });
1723
+ }
1724
+ return workflows;
1725
+ }
1726
+ function resolveDistModuleDirs(projectRoot) {
1727
+ const distBase = join(projectRoot, "dist");
1728
+ if (!existsSync(distBase)) throw new Error(`Build output missing at ${distBase}. Run keystroke build before emitting the route manifest.`);
1729
+ return {
1730
+ agentsDir: join(distBase, "agents"),
1731
+ workflowsDir: join(distBase, "workflows"),
1732
+ triggersDir: join(distBase, "triggers")
1733
+ };
1734
+ }
1735
+ function toPosix(path) {
1736
+ return path.split(sep).join("/");
1737
+ }
1738
+ /**
1739
+ * Resolve manifest moduleFile values to project-root-relative source paths.
1740
+ *
1741
+ * Discovery runs over compiled `dist/` modules, so the raw moduleFile is a
1742
+ * dist-relative `.mjs` path. Dist entries are named by their source entry id
1743
+ * (`team/escalation.mjs` ← `src/agents/team/escalation/agent.ts`), so walking
1744
+ * the matching source dir by the same id rules recovers the source path. Falls
1745
+ * back to the dist-relative value when no source file matches (e.g. building
1746
+ * a dist-only artifact with no `src/`).
1747
+ */
1748
+ var SourceModuleFileResolver = class {
1749
+ projectRoot;
1750
+ mapsByKind = /* @__PURE__ */ new Map();
1751
+ constructor(projectRoot) {
1752
+ this.projectRoot = projectRoot;
1753
+ }
1754
+ async sourceMapFor(kindDir, nestedEntry) {
1755
+ const existing = this.mapsByKind.get(kindDir);
1756
+ if (existing) return existing;
1757
+ const map = /* @__PURE__ */ new Map();
1758
+ const sourceDir = join(this.projectRoot, "src", kindDir);
1759
+ for (const filePath of await walkTypeScriptFiles(sourceDir)) {
1760
+ const id = entryIdFromFile(sourceDir, filePath, { nestedEntry });
1761
+ if (id) map.set(id, toPosix(relative(this.projectRoot, filePath)));
1762
+ }
1763
+ this.mapsByKind.set(kindDir, map);
1764
+ return map;
1765
+ }
1766
+ async resolve(kindDir, nestedEntry, distDir, distFilePath) {
1767
+ const fallback = toPosix(relative(distDir, distFilePath));
1768
+ const id = entryIdFromFile(distDir, distFilePath, { nestedEntry });
1769
+ if (!id) return fallback;
1770
+ return (await this.sourceMapFor(kindDir, nestedEntry)).get(id) ?? fallback;
1771
+ }
1772
+ };
1773
+ /** Build a stored route manifest from compiled dist/ modules without starting a server. */
1774
+ async function buildStoredRouteManifestForProject(projectRoot, options) {
1775
+ const previousRoot = process.env.KEYSTROKE_ROOT;
1776
+ process.env.KEYSTROKE_ROOT = projectRoot;
1777
+ const reload = options?.reloadModules ? { reload: true } : void 0;
1778
+ try {
1779
+ const dirs = resolveDistModuleDirs(projectRoot);
1780
+ const sourcePaths = new SourceModuleFileResolver(projectRoot);
1781
+ const manifest = [{ kind: "health" }];
1782
+ const agentEntries = await discoverAgentEntries(dirs.agentsDir, reload);
1783
+ for (const entry of agentEntries) {
1784
+ const agent = await importAgentDefinition(entry.filePath, reload);
1785
+ const moduleFile = await sourcePaths.resolve("agents", "agent", dirs.agentsDir, entry.filePath);
1786
+ manifest.push({
1787
+ kind: "agent",
1788
+ slug: agent.slug,
1789
+ moduleFile,
1790
+ name: agent.name,
1791
+ description: agent.description,
1792
+ model: agent.model,
1793
+ systemPrompt: agent.systemPrompt,
1794
+ toolCount: agent.tools?.length ?? 0,
1795
+ credentialCount: countAgentCredentials(agent)
1796
+ });
1797
+ }
1798
+ const workflows = await discoverWorkflows(dirs.workflowsDir, reload);
1799
+ for (const workflow of workflows) {
1800
+ const moduleFile = await sourcePaths.resolve("workflows", "workflow", dirs.workflowsDir, workflow.filePath);
1801
+ manifest.push({
1802
+ kind: "workflow",
1803
+ slug: workflow.definition.slug,
1804
+ name: workflow.definition.name,
1805
+ description: workflow.definition.description,
1806
+ subscribable: workflow.definition.subscription?.mode === "subscribable",
1807
+ moduleFile,
1808
+ request: workflow.definition.input
1809
+ });
1810
+ }
1811
+ const attachments = await discoverTriggerAttachments(dirs.triggersDir, reload);
1812
+ const discoveredByKey = new Map(attachments.map((attachment) => [attachment.key, attachment]));
1813
+ const pollGroups = buildPollGroups(attachments);
1814
+ for (const discovered of discoveredByKey.values()) {
1815
+ const source = discovered.attachment.source;
1816
+ const moduleFile = await sourcePaths.resolve("triggers", "trigger", dirs.triggersDir, discovered.filePath);
1817
+ if (source.kind === "cron") {
1818
+ manifest.push({
1819
+ kind: "cron-schedule",
1820
+ attachmentId: discovered.key,
1821
+ moduleFile,
1822
+ schedule: source.schedule
1823
+ });
1824
+ continue;
1825
+ }
1826
+ if (source.kind === "poll") {
1827
+ manifest.push({
1828
+ kind: "trigger-poll",
1829
+ attachmentId: discovered.key,
1830
+ moduleFile,
1831
+ schedule: source.schedule,
1832
+ response: PromptResponseSchema
1833
+ });
1834
+ continue;
1835
+ }
1836
+ if (source.kind === "webhook") {
1837
+ const route = webhookRouteFromEndpoint(source.endpoint);
1838
+ const bindings = buildWebhookBindingsByRoute(discoveredByKey.values(), () => ({
1839
+ execution: { attachmentKey: discovered.key },
1840
+ attachmentKey: discovered.key
1841
+ })).get(route) ?? [{
1842
+ discovered,
1843
+ options: { attachmentKey: discovered.key }
1844
+ }];
1845
+ manifest.push({
1846
+ kind: "trigger-webhook",
1847
+ endpoint: source.endpoint,
1848
+ attachmentIds: bindings.map(({ discovered: row }) => row.key),
1849
+ moduleFile,
1850
+ request: webhookMatchSchemaForBindings(bindings),
1851
+ attachmentSchemas: webhookManifestAttachmentSchemasFromBindings(bindings),
1852
+ response: PromptResponseSchema
1853
+ });
1854
+ }
1855
+ }
1856
+ for (const group of pollGroups) {
1857
+ if (group.attachments.length <= 1) continue;
1858
+ const first = group.attachments[0];
1859
+ const source = first.attachment.source;
1860
+ manifest.push({
1861
+ kind: "trigger-poll-group",
1862
+ pollId: group.id,
1863
+ attachmentIds: group.attachments.map((attachment) => attachment.key),
1864
+ moduleFile: await sourcePaths.resolve("triggers", "trigger", dirs.triggersDir, first.filePath),
1865
+ schedule: source.kind === "poll" ? source.schedule : "",
1866
+ response: PromptResponseSchema
1867
+ });
1868
+ }
1869
+ return buildStoredRouteManifestFromContext({
1870
+ manifest,
1871
+ options: {},
1872
+ projectRoot,
1873
+ skills: discoverSkillManifestEntries(projectRoot)
1874
+ });
1875
+ } finally {
1876
+ if (previousRoot === void 0) delete process.env.KEYSTROKE_ROOT;
1877
+ else process.env.KEYSTROKE_ROOT = previousRoot;
1878
+ }
1879
+ }
1880
+ /** Write `dist/.keystroke/route-manifest.json` for the project. */
1881
+ async function emitStoredRouteManifestForProject(projectRoot) {
1882
+ persistStoredRouteManifest(projectRoot, await buildStoredRouteManifestForProject(projectRoot));
1883
+ }
1884
+ //#endregion
1885
+ export { entryIdFromFile as A, webhookManifestAttachmentSchemasFromBindings as C, packAssetDirs as D, workflowRouteFromKey as E, shouldSkipKeystrokeModuleFile as M, walkTypeScriptFiles as N, discoverEntries as O, validateImportedWorkflowDefinition as S, webhookRouteFromEndpoint as T, pollGroupId as _, buildWebhookBindingsByRoute as a, toStoredRouteManifest as b, discoverSkillManifestEntries as c, discoverWorkflows as d, emitStoredRouteManifestForProject as f, persistStoredRouteManifest as g, importWorkflowDefinition as h, buildStoredRouteManifestFromContext as i, readKeystrokeIgnoreDirective as j, discoverModuleFileEntries as k, discoverTriggerAttachments as l, importTriggerAttachment as m, buildPollGroups as n, countAgentCredentials as o, importAgentDefinition as p, buildStoredRouteManifestForProject as r, discoverAgentEntries as s, agentRouteFromKey as t, discoverWorkflowEntries as u, schemaToJson as v, webhookMatchSchemaForBindings as w, validateImportedTriggerAttachment as x, serializeRouteManifest as y };
1886
+
1887
+ //# sourceMappingURL=dist-CwR72_PS.mjs.map