code-squad-cli 1.2.6 → 1.2.9

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 (316) hide show
  1. package/dist/flip/constants/filters.d.ts +2 -0
  2. package/dist/flip/constants/filters.js +30 -0
  3. package/dist/flip/events/SSEManager.d.ts +10 -0
  4. package/dist/flip/events/SSEManager.js +28 -0
  5. package/dist/flip/events/types.d.ts +11 -0
  6. package/dist/flip/events/types.js +1 -0
  7. package/dist/flip/index.js +2 -2
  8. package/dist/flip/output/autopaste.js +15 -3
  9. package/dist/flip/output/clipboard.js +56 -2
  10. package/dist/flip/routes/events.d.ts +3 -0
  11. package/dist/flip/routes/events.js +25 -0
  12. package/dist/flip/routes/files.d.ts +8 -1
  13. package/dist/flip/routes/files.js +40 -70
  14. package/dist/flip/routes/static.js +4 -2
  15. package/dist/flip/routes/submit.js +14 -7
  16. package/dist/flip/server/Server.d.ts +1 -1
  17. package/dist/flip/server/Server.js +24 -2
  18. package/dist/flip/watcher/FileWatcher.d.ts +29 -0
  19. package/dist/flip/watcher/FileWatcher.js +128 -0
  20. package/dist/flip-ui/dist/assets/index-B2PjDe6F.js +217 -0
  21. package/dist/flip-ui/dist/assets/index-DYY1gRRa.css +1 -0
  22. package/dist/flip-ui/dist/index.html +2 -2
  23. package/dist/index.js +373 -130
  24. package/package.json +3 -2
  25. package/dist/flip-ui/dist/assets/abap-BdImnpbu.js +0 -1
  26. package/dist/flip-ui/dist/assets/actionscript-3-CfeIJUat.js +0 -1
  27. package/dist/flip-ui/dist/assets/ada-bCR0ucgS.js +0 -1
  28. package/dist/flip-ui/dist/assets/andromeeda-C-Jbm3Hp.js +0 -1
  29. package/dist/flip-ui/dist/assets/angular-html-CU67Zn6k.js +0 -1
  30. package/dist/flip-ui/dist/assets/angular-ts-BwZT4LLn.js +0 -1
  31. package/dist/flip-ui/dist/assets/apache-Pmp26Uib.js +0 -1
  32. package/dist/flip-ui/dist/assets/apex-D8_7TLub.js +0 -1
  33. package/dist/flip-ui/dist/assets/apl-dKokRX4l.js +0 -1
  34. package/dist/flip-ui/dist/assets/applescript-Co6uUVPk.js +0 -1
  35. package/dist/flip-ui/dist/assets/ara-BRHolxvo.js +0 -1
  36. package/dist/flip-ui/dist/assets/asciidoc-Dv7Oe6Be.js +0 -1
  37. package/dist/flip-ui/dist/assets/asm-D_Q5rh1f.js +0 -1
  38. package/dist/flip-ui/dist/assets/astro-CbQHKStN.js +0 -1
  39. package/dist/flip-ui/dist/assets/aurora-x-D-2ljcwZ.js +0 -1
  40. package/dist/flip-ui/dist/assets/awk-DMzUqQB5.js +0 -1
  41. package/dist/flip-ui/dist/assets/ayu-dark-CmMr59Fi.js +0 -1
  42. package/dist/flip-ui/dist/assets/ballerina-BFfxhgS-.js +0 -1
  43. package/dist/flip-ui/dist/assets/bat-BkioyH1T.js +0 -1
  44. package/dist/flip-ui/dist/assets/beancount-k_qm7-4y.js +0 -1
  45. package/dist/flip-ui/dist/assets/berry-uYugtg8r.js +0 -1
  46. package/dist/flip-ui/dist/assets/bibtex-CHM0blh-.js +0 -1
  47. package/dist/flip-ui/dist/assets/bicep-Bmn6On1c.js +0 -1
  48. package/dist/flip-ui/dist/assets/blade-D4QpJJKB.js +0 -1
  49. package/dist/flip-ui/dist/assets/bsl-BO_Y6i37.js +0 -1
  50. package/dist/flip-ui/dist/assets/c-BIGW1oBm.js +0 -1
  51. package/dist/flip-ui/dist/assets/c3-VCDPK7BO.js +0 -1
  52. package/dist/flip-ui/dist/assets/cadence-Bv_4Rxtq.js +0 -1
  53. package/dist/flip-ui/dist/assets/cairo-KRGpt6FW.js +0 -1
  54. package/dist/flip-ui/dist/assets/catppuccin-frappe-DFWUc33u.js +0 -1
  55. package/dist/flip-ui/dist/assets/catppuccin-latte-C9dUb6Cb.js +0 -1
  56. package/dist/flip-ui/dist/assets/catppuccin-macchiato-DQyhUUbL.js +0 -1
  57. package/dist/flip-ui/dist/assets/catppuccin-mocha-D87Tk5Gz.js +0 -1
  58. package/dist/flip-ui/dist/assets/clarity-D53aC0YG.js +0 -1
  59. package/dist/flip-ui/dist/assets/clojure-P80f7IUj.js +0 -1
  60. package/dist/flip-ui/dist/assets/cmake-D1j8_8rp.js +0 -1
  61. package/dist/flip-ui/dist/assets/cobol-nwyudZeR.js +0 -1
  62. package/dist/flip-ui/dist/assets/codeowners-Bp6g37R7.js +0 -1
  63. package/dist/flip-ui/dist/assets/codeql-DsOJ9woJ.js +0 -1
  64. package/dist/flip-ui/dist/assets/coffee-Ch7k5sss.js +0 -1
  65. package/dist/flip-ui/dist/assets/common-lisp-Cg-RD9OK.js +0 -1
  66. package/dist/flip-ui/dist/assets/coq-DkFqJrB1.js +0 -1
  67. package/dist/flip-ui/dist/assets/cpp-CofmeUqb.js +0 -1
  68. package/dist/flip-ui/dist/assets/crystal-tKQVLTB8.js +0 -1
  69. package/dist/flip-ui/dist/assets/csharp-K5feNrxe.js +0 -1
  70. package/dist/flip-ui/dist/assets/css-DPfMkruS.js +0 -1
  71. package/dist/flip-ui/dist/assets/csv-fuZLfV_i.js +0 -1
  72. package/dist/flip-ui/dist/assets/cue-D82EKSYY.js +0 -1
  73. package/dist/flip-ui/dist/assets/cypher-COkxafJQ.js +0 -1
  74. package/dist/flip-ui/dist/assets/d-85-TOEBH.js +0 -1
  75. package/dist/flip-ui/dist/assets/dark-plus-C3mMm8J8.js +0 -1
  76. package/dist/flip-ui/dist/assets/dart-CF10PKvl.js +0 -1
  77. package/dist/flip-ui/dist/assets/dax-CEL-wOlO.js +0 -1
  78. package/dist/flip-ui/dist/assets/desktop-BmXAJ9_W.js +0 -1
  79. package/dist/flip-ui/dist/assets/diff-D97Zzqfu.js +0 -1
  80. package/dist/flip-ui/dist/assets/docker-BcOcwvcX.js +0 -1
  81. package/dist/flip-ui/dist/assets/dotenv-Da5cRb03.js +0 -1
  82. package/dist/flip-ui/dist/assets/dracula-BzJJZx-M.js +0 -1
  83. package/dist/flip-ui/dist/assets/dracula-soft-BXkSAIEj.js +0 -1
  84. package/dist/flip-ui/dist/assets/dream-maker-BtqSS_iP.js +0 -1
  85. package/dist/flip-ui/dist/assets/edge-BkV0erSs.js +0 -1
  86. package/dist/flip-ui/dist/assets/elixir-CDX3lj18.js +0 -1
  87. package/dist/flip-ui/dist/assets/elm-DbKCFpqz.js +0 -1
  88. package/dist/flip-ui/dist/assets/emacs-lisp-C9XAeP06.js +0 -1
  89. package/dist/flip-ui/dist/assets/erb-BOJIQeun.js +0 -1
  90. package/dist/flip-ui/dist/assets/erlang-DsQrWhSR.js +0 -1
  91. package/dist/flip-ui/dist/assets/everforest-dark-BgDCqdQA.js +0 -1
  92. package/dist/flip-ui/dist/assets/everforest-light-C8M2exoo.js +0 -1
  93. package/dist/flip-ui/dist/assets/fennel-BYunw83y.js +0 -1
  94. package/dist/flip-ui/dist/assets/fish-BvzEVeQv.js +0 -1
  95. package/dist/flip-ui/dist/assets/fluent-C4IJs8-o.js +0 -1
  96. package/dist/flip-ui/dist/assets/fortran-fixed-form-CkoXwp7k.js +0 -1
  97. package/dist/flip-ui/dist/assets/fortran-free-form-BxgE0vQu.js +0 -1
  98. package/dist/flip-ui/dist/assets/fsharp-CXgrBDvD.js +0 -1
  99. package/dist/flip-ui/dist/assets/gdresource-B7Tvp0Sc.js +0 -1
  100. package/dist/flip-ui/dist/assets/gdscript-DTMYz4Jt.js +0 -1
  101. package/dist/flip-ui/dist/assets/gdshader-DkwncUOv.js +0 -1
  102. package/dist/flip-ui/dist/assets/genie-D0YGMca9.js +0 -1
  103. package/dist/flip-ui/dist/assets/gherkin-DyxjwDmM.js +0 -1
  104. package/dist/flip-ui/dist/assets/git-commit-F4YmCXRG.js +0 -1
  105. package/dist/flip-ui/dist/assets/git-rebase-r7XF79zn.js +0 -1
  106. package/dist/flip-ui/dist/assets/github-dark-DHJKELXO.js +0 -1
  107. package/dist/flip-ui/dist/assets/github-dark-default-Cuk6v7N8.js +0 -1
  108. package/dist/flip-ui/dist/assets/github-dark-dimmed-DH5Ifo-i.js +0 -1
  109. package/dist/flip-ui/dist/assets/github-dark-high-contrast-E3gJ1_iC.js +0 -1
  110. package/dist/flip-ui/dist/assets/github-light-DAi9KRSo.js +0 -1
  111. package/dist/flip-ui/dist/assets/github-light-default-D7oLnXFd.js +0 -1
  112. package/dist/flip-ui/dist/assets/github-light-high-contrast-BfjtVDDH.js +0 -1
  113. package/dist/flip-ui/dist/assets/gleam-BspZqrRM.js +0 -1
  114. package/dist/flip-ui/dist/assets/glimmer-js-Rg0-pVw9.js +0 -1
  115. package/dist/flip-ui/dist/assets/glimmer-ts-U6CK756n.js +0 -1
  116. package/dist/flip-ui/dist/assets/glsl-DplSGwfg.js +0 -1
  117. package/dist/flip-ui/dist/assets/gn-n2N0HUVH.js +0 -1
  118. package/dist/flip-ui/dist/assets/gnuplot-DdkO51Og.js +0 -1
  119. package/dist/flip-ui/dist/assets/go-Dn2_MT6a.js +0 -1
  120. package/dist/flip-ui/dist/assets/graphql-ChdNCCLP.js +0 -1
  121. package/dist/flip-ui/dist/assets/groovy-gcz8RCvz.js +0 -1
  122. package/dist/flip-ui/dist/assets/gruvbox-dark-hard-CFHQjOhq.js +0 -1
  123. package/dist/flip-ui/dist/assets/gruvbox-dark-medium-GsRaNv29.js +0 -1
  124. package/dist/flip-ui/dist/assets/gruvbox-dark-soft-CVdnzihN.js +0 -1
  125. package/dist/flip-ui/dist/assets/gruvbox-light-hard-CH1njM8p.js +0 -1
  126. package/dist/flip-ui/dist/assets/gruvbox-light-medium-DRw_LuNl.js +0 -1
  127. package/dist/flip-ui/dist/assets/gruvbox-light-soft-hJgmCMqR.js +0 -1
  128. package/dist/flip-ui/dist/assets/hack-CaT9iCJl.js +0 -1
  129. package/dist/flip-ui/dist/assets/haml-B8DHNrY2.js +0 -1
  130. package/dist/flip-ui/dist/assets/handlebars-BL8al0AC.js +0 -1
  131. package/dist/flip-ui/dist/assets/haskell-Df6bDoY_.js +0 -1
  132. package/dist/flip-ui/dist/assets/haxe-CzTSHFRz.js +0 -1
  133. package/dist/flip-ui/dist/assets/hcl-BWvSN4gD.js +0 -1
  134. package/dist/flip-ui/dist/assets/hjson-D5-asLiD.js +0 -1
  135. package/dist/flip-ui/dist/assets/hlsl-D3lLCCz7.js +0 -1
  136. package/dist/flip-ui/dist/assets/houston-DnULxvSX.js +0 -1
  137. package/dist/flip-ui/dist/assets/html-GMplVEZG.js +0 -1
  138. package/dist/flip-ui/dist/assets/html-derivative-BFtXZ54Q.js +0 -1
  139. package/dist/flip-ui/dist/assets/http-jrhK8wxY.js +0 -1
  140. package/dist/flip-ui/dist/assets/hurl-irOxFIW8.js +0 -1
  141. package/dist/flip-ui/dist/assets/hxml-Bvhsp5Yf.js +0 -1
  142. package/dist/flip-ui/dist/assets/hy-DFXneXwc.js +0 -1
  143. package/dist/flip-ui/dist/assets/imba-DGztddWO.js +0 -1
  144. package/dist/flip-ui/dist/assets/index-DTf1sRAX.css +0 -1
  145. package/dist/flip-ui/dist/assets/index-DmJdj9bX.js +0 -154
  146. package/dist/flip-ui/dist/assets/ini-BEwlwnbL.js +0 -1
  147. package/dist/flip-ui/dist/assets/java-CylS5w8V.js +0 -1
  148. package/dist/flip-ui/dist/assets/javascript-wDzz0qaB.js +0 -1
  149. package/dist/flip-ui/dist/assets/jinja-4LBKfQ-Z.js +0 -1
  150. package/dist/flip-ui/dist/assets/jison-wvAkD_A8.js +0 -1
  151. package/dist/flip-ui/dist/assets/json-Cp-IABpG.js +0 -1
  152. package/dist/flip-ui/dist/assets/json5-C9tS-k6U.js +0 -1
  153. package/dist/flip-ui/dist/assets/jsonc-Des-eS-w.js +0 -1
  154. package/dist/flip-ui/dist/assets/jsonl-DcaNXYhu.js +0 -1
  155. package/dist/flip-ui/dist/assets/jsonnet-DFQXde-d.js +0 -1
  156. package/dist/flip-ui/dist/assets/jssm-C2t-YnRu.js +0 -1
  157. package/dist/flip-ui/dist/assets/jsx-g9-lgVsj.js +0 -1
  158. package/dist/flip-ui/dist/assets/julia-CxzCAyBv.js +0 -1
  159. package/dist/flip-ui/dist/assets/kanagawa-dragon-CkXjmgJE.js +0 -1
  160. package/dist/flip-ui/dist/assets/kanagawa-lotus-CfQXZHmo.js +0 -1
  161. package/dist/flip-ui/dist/assets/kanagawa-wave-DWedfzmr.js +0 -1
  162. package/dist/flip-ui/dist/assets/kdl-DV7GczEv.js +0 -1
  163. package/dist/flip-ui/dist/assets/kotlin-BdnUsdx6.js +0 -1
  164. package/dist/flip-ui/dist/assets/kusto-DZf3V79B.js +0 -1
  165. package/dist/flip-ui/dist/assets/laserwave-DUszq2jm.js +0 -1
  166. package/dist/flip-ui/dist/assets/latex-B4uzh10-.js +0 -1
  167. package/dist/flip-ui/dist/assets/lean-BZvkOJ9d.js +0 -1
  168. package/dist/flip-ui/dist/assets/less-B1dDrJ26.js +0 -1
  169. package/dist/flip-ui/dist/assets/light-plus-B7mTdjB0.js +0 -1
  170. package/dist/flip-ui/dist/assets/liquid-DYVedYrR.js +0 -1
  171. package/dist/flip-ui/dist/assets/llvm-BtvRca6l.js +0 -1
  172. package/dist/flip-ui/dist/assets/log-2UxHyX5q.js +0 -1
  173. package/dist/flip-ui/dist/assets/logo-BtOb2qkB.js +0 -1
  174. package/dist/flip-ui/dist/assets/lua-BbnMAYS6.js +0 -1
  175. package/dist/flip-ui/dist/assets/luau-C-HG3fhB.js +0 -1
  176. package/dist/flip-ui/dist/assets/make-CHLpvVh8.js +0 -1
  177. package/dist/flip-ui/dist/assets/markdown-Cvjx9yec.js +0 -1
  178. package/dist/flip-ui/dist/assets/marko-DZsq8hO1.js +0 -1
  179. package/dist/flip-ui/dist/assets/material-theme-D5KoaKCx.js +0 -1
  180. package/dist/flip-ui/dist/assets/material-theme-darker-BfHTSMKl.js +0 -1
  181. package/dist/flip-ui/dist/assets/material-theme-lighter-B0m2ddpp.js +0 -1
  182. package/dist/flip-ui/dist/assets/material-theme-ocean-CyktbL80.js +0 -1
  183. package/dist/flip-ui/dist/assets/material-theme-palenight-Csfq5Kiy.js +0 -1
  184. package/dist/flip-ui/dist/assets/matlab-D7o27uSR.js +0 -1
  185. package/dist/flip-ui/dist/assets/mdc-DUICxH0z.js +0 -1
  186. package/dist/flip-ui/dist/assets/mdx-Cmh6b_Ma.js +0 -1
  187. package/dist/flip-ui/dist/assets/mermaid-mWjccvbQ.js +0 -1
  188. package/dist/flip-ui/dist/assets/min-dark-CafNBF8u.js +0 -1
  189. package/dist/flip-ui/dist/assets/min-light-CTRr51gU.js +0 -1
  190. package/dist/flip-ui/dist/assets/mipsasm-CKIfxQSi.js +0 -1
  191. package/dist/flip-ui/dist/assets/mojo-B93PlW-d.js +0 -1
  192. package/dist/flip-ui/dist/assets/monokai-D4h5O-jR.js +0 -1
  193. package/dist/flip-ui/dist/assets/moonbit-Ba13S78F.js +0 -1
  194. package/dist/flip-ui/dist/assets/move-Bu9oaDYs.js +0 -1
  195. package/dist/flip-ui/dist/assets/narrat-DRg8JJMk.js +0 -1
  196. package/dist/flip-ui/dist/assets/nextflow-BrzmwbiE.js +0 -1
  197. package/dist/flip-ui/dist/assets/nginx-DknmC5AR.js +0 -1
  198. package/dist/flip-ui/dist/assets/night-owl-C39BiMTA.js +0 -1
  199. package/dist/flip-ui/dist/assets/nim-CVrawwO9.js +0 -1
  200. package/dist/flip-ui/dist/assets/nix-CwoSXNpI.js +0 -1
  201. package/dist/flip-ui/dist/assets/nord-Ddv68eIx.js +0 -1
  202. package/dist/flip-ui/dist/assets/nushell-C-sUppwS.js +0 -1
  203. package/dist/flip-ui/dist/assets/objective-c-DXmwc3jG.js +0 -1
  204. package/dist/flip-ui/dist/assets/objective-cpp-CLxacb5B.js +0 -1
  205. package/dist/flip-ui/dist/assets/ocaml-C0hk2d4L.js +0 -1
  206. package/dist/flip-ui/dist/assets/one-dark-pro-DVMEJ2y_.js +0 -1
  207. package/dist/flip-ui/dist/assets/one-light-PoHY5YXO.js +0 -1
  208. package/dist/flip-ui/dist/assets/openscad-C4EeE6gA.js +0 -1
  209. package/dist/flip-ui/dist/assets/pascal-D93ZcfNL.js +0 -1
  210. package/dist/flip-ui/dist/assets/perl-C0TMdlhV.js +0 -1
  211. package/dist/flip-ui/dist/assets/php-CDn_0X-4.js +0 -1
  212. package/dist/flip-ui/dist/assets/pkl-u5AG7uiY.js +0 -1
  213. package/dist/flip-ui/dist/assets/plastic-3e1v2bzS.js +0 -1
  214. package/dist/flip-ui/dist/assets/plsql-ChMvpjG-.js +0 -1
  215. package/dist/flip-ui/dist/assets/po-BTJTHyun.js +0 -1
  216. package/dist/flip-ui/dist/assets/poimandres-CS3Unz2-.js +0 -1
  217. package/dist/flip-ui/dist/assets/polar-C0HS_06l.js +0 -1
  218. package/dist/flip-ui/dist/assets/postcss-CXtECtnM.js +0 -1
  219. package/dist/flip-ui/dist/assets/powerquery-CEu0bR-o.js +0 -1
  220. package/dist/flip-ui/dist/assets/powershell-Dpen1YoG.js +0 -1
  221. package/dist/flip-ui/dist/assets/prisma-Dd19v3D-.js +0 -1
  222. package/dist/flip-ui/dist/assets/prolog-CbFg5uaA.js +0 -1
  223. package/dist/flip-ui/dist/assets/proto-C7zT0LnQ.js +0 -1
  224. package/dist/flip-ui/dist/assets/pug-CGlum2m_.js +0 -1
  225. package/dist/flip-ui/dist/assets/puppet-BMWR74SV.js +0 -1
  226. package/dist/flip-ui/dist/assets/purescript-CklMAg4u.js +0 -1
  227. package/dist/flip-ui/dist/assets/python-B6aJPvgy.js +0 -1
  228. package/dist/flip-ui/dist/assets/qml-3beO22l8.js +0 -1
  229. package/dist/flip-ui/dist/assets/qmldir-C8lEn-DE.js +0 -1
  230. package/dist/flip-ui/dist/assets/qss-IeuSbFQv.js +0 -1
  231. package/dist/flip-ui/dist/assets/r-Dspwwk_N.js +0 -1
  232. package/dist/flip-ui/dist/assets/racket-BqYA7rlc.js +0 -1
  233. package/dist/flip-ui/dist/assets/raku-DXvB9xmW.js +0 -1
  234. package/dist/flip-ui/dist/assets/razor-C1TweQQi.js +0 -1
  235. package/dist/flip-ui/dist/assets/red-bN70gL4F.js +0 -1
  236. package/dist/flip-ui/dist/assets/reg-C-SQnVFl.js +0 -1
  237. package/dist/flip-ui/dist/assets/regexp-CDVJQ6XC.js +0 -1
  238. package/dist/flip-ui/dist/assets/rel-C3B-1QV4.js +0 -1
  239. package/dist/flip-ui/dist/assets/riscv-BM1_JUlF.js +0 -1
  240. package/dist/flip-ui/dist/assets/rose-pine-dawn-DHQR4-dF.js +0 -1
  241. package/dist/flip-ui/dist/assets/rose-pine-moon-D4_iv3hh.js +0 -1
  242. package/dist/flip-ui/dist/assets/rose-pine-qdsjHGoJ.js +0 -1
  243. package/dist/flip-ui/dist/assets/rosmsg-BJDFO7_C.js +0 -1
  244. package/dist/flip-ui/dist/assets/rst-B0xPkSld.js +0 -1
  245. package/dist/flip-ui/dist/assets/ruby-BvKwtOVI.js +0 -1
  246. package/dist/flip-ui/dist/assets/rust-B1yitclQ.js +0 -1
  247. package/dist/flip-ui/dist/assets/sas-cz2c8ADy.js +0 -1
  248. package/dist/flip-ui/dist/assets/sass-Cj5Yp3dK.js +0 -1
  249. package/dist/flip-ui/dist/assets/scala-C151Ov-r.js +0 -1
  250. package/dist/flip-ui/dist/assets/scheme-C98Dy4si.js +0 -1
  251. package/dist/flip-ui/dist/assets/scss-OYdSNvt2.js +0 -1
  252. package/dist/flip-ui/dist/assets/sdbl-DVxCFoDh.js +0 -1
  253. package/dist/flip-ui/dist/assets/shaderlab-Dg9Lc6iA.js +0 -1
  254. package/dist/flip-ui/dist/assets/shellscript-Yzrsuije.js +0 -1
  255. package/dist/flip-ui/dist/assets/shellsession-BADoaaVG.js +0 -1
  256. package/dist/flip-ui/dist/assets/slack-dark-BthQWCQV.js +0 -1
  257. package/dist/flip-ui/dist/assets/slack-ochin-DqwNpetd.js +0 -1
  258. package/dist/flip-ui/dist/assets/smalltalk-BERRCDM3.js +0 -1
  259. package/dist/flip-ui/dist/assets/snazzy-light-Bw305WKR.js +0 -1
  260. package/dist/flip-ui/dist/assets/solarized-dark-DXbdFlpD.js +0 -1
  261. package/dist/flip-ui/dist/assets/solarized-light-L9t79GZl.js +0 -1
  262. package/dist/flip-ui/dist/assets/solidity-rGO070M0.js +0 -1
  263. package/dist/flip-ui/dist/assets/soy-Brmx7dQM.js +0 -1
  264. package/dist/flip-ui/dist/assets/sparql-rVzFXLq3.js +0 -1
  265. package/dist/flip-ui/dist/assets/splunk-BtCnVYZw.js +0 -1
  266. package/dist/flip-ui/dist/assets/sql-BLtJtn59.js +0 -1
  267. package/dist/flip-ui/dist/assets/ssh-config-_ykCGR6B.js +0 -1
  268. package/dist/flip-ui/dist/assets/stata-BH5u7GGu.js +0 -1
  269. package/dist/flip-ui/dist/assets/stylus-BEDo0Tqx.js +0 -1
  270. package/dist/flip-ui/dist/assets/svelte-zxCyuUbr.js +0 -1
  271. package/dist/flip-ui/dist/assets/swift-Dg5xB15N.js +0 -1
  272. package/dist/flip-ui/dist/assets/synthwave-84-CbfX1IO0.js +0 -1
  273. package/dist/flip-ui/dist/assets/system-verilog-CnnmHF94.js +0 -1
  274. package/dist/flip-ui/dist/assets/systemd-4A_iFExJ.js +0 -1
  275. package/dist/flip-ui/dist/assets/talonscript-CkByrt1z.js +0 -1
  276. package/dist/flip-ui/dist/assets/tasl-QIJgUcNo.js +0 -1
  277. package/dist/flip-ui/dist/assets/tcl-dwOrl1Do.js +0 -1
  278. package/dist/flip-ui/dist/assets/templ-W15q3VgB.js +0 -1
  279. package/dist/flip-ui/dist/assets/terraform-BETggiCN.js +0 -1
  280. package/dist/flip-ui/dist/assets/tex-CvyZ59Mk.js +0 -1
  281. package/dist/flip-ui/dist/assets/tokyo-night-hegEt444.js +0 -1
  282. package/dist/flip-ui/dist/assets/toml-vGWfd6FD.js +0 -1
  283. package/dist/flip-ui/dist/assets/ts-tags-zn1MmPIZ.js +0 -1
  284. package/dist/flip-ui/dist/assets/tsv-B_m7g4N7.js +0 -1
  285. package/dist/flip-ui/dist/assets/tsx-COt5Ahok.js +0 -1
  286. package/dist/flip-ui/dist/assets/turtle-BsS91CYL.js +0 -1
  287. package/dist/flip-ui/dist/assets/twig-CO9l9SDP.js +0 -1
  288. package/dist/flip-ui/dist/assets/typescript-BPQ3VLAy.js +0 -1
  289. package/dist/flip-ui/dist/assets/typespec-BGHnOYBU.js +0 -1
  290. package/dist/flip-ui/dist/assets/typst-DHCkPAjA.js +0 -1
  291. package/dist/flip-ui/dist/assets/v-BcVCzyr7.js +0 -1
  292. package/dist/flip-ui/dist/assets/vala-CsfeWuGM.js +0 -1
  293. package/dist/flip-ui/dist/assets/vb-D17OF-Vu.js +0 -1
  294. package/dist/flip-ui/dist/assets/verilog-BQ8w6xss.js +0 -1
  295. package/dist/flip-ui/dist/assets/vesper-DU1UobuO.js +0 -1
  296. package/dist/flip-ui/dist/assets/vhdl-CeAyd5Ju.js +0 -1
  297. package/dist/flip-ui/dist/assets/viml-CJc9bBzg.js +0 -1
  298. package/dist/flip-ui/dist/assets/vitesse-black-Bkuqu6BP.js +0 -1
  299. package/dist/flip-ui/dist/assets/vitesse-dark-D0r3Knsf.js +0 -1
  300. package/dist/flip-ui/dist/assets/vitesse-light-CVO1_9PV.js +0 -1
  301. package/dist/flip-ui/dist/assets/vue-DN_0RTcg.js +0 -1
  302. package/dist/flip-ui/dist/assets/vue-html-AaS7Mt5G.js +0 -1
  303. package/dist/flip-ui/dist/assets/vue-vine-CQOfvN7w.js +0 -1
  304. package/dist/flip-ui/dist/assets/vyper-CDx5xZoG.js +0 -1
  305. package/dist/flip-ui/dist/assets/wasm-CG6Dc4jp.js +0 -1
  306. package/dist/flip-ui/dist/assets/wasm-MzD3tlZU.js +0 -1
  307. package/dist/flip-ui/dist/assets/wenyan-BV7otONQ.js +0 -1
  308. package/dist/flip-ui/dist/assets/wgsl-Dx-B1_4e.js +0 -1
  309. package/dist/flip-ui/dist/assets/wikitext-BhOHFoWU.js +0 -1
  310. package/dist/flip-ui/dist/assets/wit-5i3qLPDT.js +0 -1
  311. package/dist/flip-ui/dist/assets/wolfram-lXgVvXCa.js +0 -1
  312. package/dist/flip-ui/dist/assets/xml-sdJ4AIDG.js +0 -1
  313. package/dist/flip-ui/dist/assets/xsl-CtQFsRM5.js +0 -1
  314. package/dist/flip-ui/dist/assets/yaml-Buea-lGh.js +0 -1
  315. package/dist/flip-ui/dist/assets/zenscript-DVFEvuxE.js +0 -1
  316. package/dist/flip-ui/dist/assets/zig-VOosw3JB.js +0 -1
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // dist/index.js
4
- import * as path10 from "path";
5
- import * as fs10 from "fs";
6
- import * as os4 from "os";
4
+ import * as path12 from "path";
5
+ import * as fs11 from "fs";
6
+ import * as os5 from "os";
7
7
  import * as crypto from "crypto";
8
8
  import chalk2 from "chalk";
9
9
 
@@ -44,11 +44,11 @@ var GitAdapter = class {
44
44
  const headMatch = headLine.match(/^HEAD (.+)$/);
45
45
  const branchMatch = branchLine?.match(/^branch refs\/heads\/(.+)$/);
46
46
  if (pathMatch && headMatch) {
47
- const path11 = pathMatch[1];
47
+ const path13 = pathMatch[1];
48
48
  const head = headMatch[1];
49
49
  const branch = branchMatch ? branchMatch[1] : "HEAD";
50
- if (path11 !== workspaceRoot) {
51
- worktrees.push({ path: path11, branch, head });
50
+ if (path13 !== workspaceRoot) {
51
+ worktrees.push({ path: path13, branch, head });
52
52
  }
53
53
  }
54
54
  i += 3;
@@ -79,19 +79,19 @@ var GitAdapter = class {
79
79
  throw new Error(`Failed to delete branch: ${error.message}`);
80
80
  }
81
81
  }
82
- async isValidWorktree(path11, workspaceRoot) {
82
+ async isValidWorktree(path13, workspaceRoot) {
83
83
  try {
84
- await fs.promises.access(path11, fs.constants.R_OK);
84
+ await fs.promises.access(path13, fs.constants.R_OK);
85
85
  } catch {
86
86
  return false;
87
87
  }
88
88
  try {
89
- await exec(`cd "${path11}" && git rev-parse --git-dir`, execOptions);
89
+ await exec(`cd "${path13}" && git rev-parse --git-dir`, execOptions);
90
90
  } catch {
91
91
  return false;
92
92
  }
93
93
  const worktrees = await this.listWorktrees(workspaceRoot);
94
- return worktrees.some((wt) => wt.path === path11);
94
+ return worktrees.some((wt) => wt.path === path13);
95
95
  }
96
96
  async getWorktreeBranch(worktreePath) {
97
97
  try {
@@ -423,59 +423,39 @@ import net from "net";
423
423
  import { Router } from "express";
424
424
  import fs2 from "fs";
425
425
  import path2 from "path";
426
- var router = Router();
427
- var DEFAULT_IGNORES = [
426
+
427
+ // dist/flip/constants/filters.js
428
+ var FILTERED_PATTERNS = /* @__PURE__ */ new Set([
429
+ // Package managers
428
430
  "node_modules",
431
+ "vendor",
432
+ ".pnpm-store",
433
+ // VCS internal
429
434
  ".git",
430
435
  ".svn",
431
436
  ".hg",
437
+ // OS metadata
438
+ ".DS_Store",
439
+ "Thumbs.db",
440
+ // Build output
432
441
  "dist",
433
442
  "build",
434
443
  "out",
444
+ // Cache directories
435
445
  ".cache",
436
446
  ".next",
437
447
  ".nuxt",
438
448
  "coverage",
439
449
  "__pycache__",
440
450
  ".pytest_cache",
441
- "target",
442
- "Cargo.lock",
443
- "package-lock.json",
444
- "pnpm-lock.yaml",
445
- "yarn.lock",
446
- ".DS_Store"
447
- ];
448
- var VISIBLE_DOTFILES = /* @__PURE__ */ new Set([
449
- ".gitignore",
450
- ".gitattributes",
451
- ".env.example",
452
- ".env.local.example",
453
- ".eslintrc",
454
- ".eslintrc.js",
455
- ".eslintrc.cjs",
456
- ".eslintrc.json",
457
- ".eslintrc.yml",
458
- ".prettierrc",
459
- ".prettierrc.js",
460
- ".prettierrc.cjs",
461
- ".prettierrc.json",
462
- ".prettierrc.yml",
463
- ".editorconfig",
464
- ".npmrc",
465
- ".nvmrc",
466
- ".node-version",
467
- ".dockerignore",
468
- ".browserslistrc",
469
- ".babelrc",
470
- ".babelrc.js",
471
- ".babelrc.json"
451
+ "target"
472
452
  ]);
473
- function shouldIgnore(name) {
474
- if (name.startsWith(".")) {
475
- return !VISIBLE_DOTFILES.has(name);
476
- }
477
- return DEFAULT_IGNORES.includes(name);
453
+ function isFiltered(name) {
454
+ return FILTERED_PATTERNS.has(name);
478
455
  }
456
+
457
+ // dist/flip/routes/files.js
458
+ var router = Router();
479
459
  function buildFileTree(rootPath, currentPath, maxDepth, depth = 0) {
480
460
  if (depth > maxDepth)
481
461
  return [];
@@ -489,39 +469,49 @@ function buildFileTree(rootPath, currentPath, maxDepth, depth = 0) {
489
469
  return a.name.localeCompare(b.name);
490
470
  });
491
471
  for (const entry of entries) {
492
- if (shouldIgnore(entry.name))
493
- continue;
494
472
  const fullPath = path2.join(currentPath, entry.name);
495
473
  const relativePath = path2.relative(rootPath, fullPath);
474
+ const filtered = isFiltered(entry.name);
496
475
  const node = {
497
476
  path: relativePath,
498
477
  name: entry.name,
499
- type: entry.isDirectory() ? "directory" : "file"
478
+ type: entry.isDirectory() ? "directory" : "file",
479
+ ...filtered && { filtered: true }
500
480
  };
501
- if (entry.isDirectory()) {
481
+ if (entry.isDirectory() && !filtered) {
502
482
  node.children = buildFileTree(rootPath, fullPath, maxDepth, depth + 1);
503
483
  }
504
484
  nodes.push(node);
505
485
  }
506
486
  return nodes;
507
487
  }
508
- function collectFlatFiles(rootPath, currentPath, maxDepth, depth = 0) {
488
+ function collectFlatFiles(rootPath, currentPath, maxDepth, depth = 0, result = { files: [], filteredDirs: [] }) {
509
489
  if (depth > maxDepth)
510
- return [];
490
+ return result;
511
491
  const entries = fs2.readdirSync(currentPath, { withFileTypes: true });
512
- const files = [];
513
492
  for (const entry of entries) {
514
- if (shouldIgnore(entry.name))
515
- continue;
516
493
  const fullPath = path2.join(currentPath, entry.name);
517
494
  const relativePath = path2.relative(rootPath, fullPath);
495
+ if (isFiltered(entry.name)) {
496
+ if (entry.isDirectory()) {
497
+ result.filteredDirs.push(relativePath);
498
+ }
499
+ continue;
500
+ }
518
501
  if (entry.isFile()) {
519
- files.push(relativePath);
502
+ try {
503
+ const stat = fs2.statSync(fullPath);
504
+ result.files.push({
505
+ path: relativePath,
506
+ mtime: stat.mtimeMs
507
+ });
508
+ } catch {
509
+ }
520
510
  } else if (entry.isDirectory()) {
521
- files.push(...collectFlatFiles(rootPath, fullPath, maxDepth, depth + 1));
511
+ collectFlatFiles(rootPath, fullPath, maxDepth, depth + 1, result);
522
512
  }
523
513
  }
524
- return files;
514
+ return result;
525
515
  }
526
516
  router.get("/", (req, res) => {
527
517
  const state = req.app.locals.state;
@@ -534,10 +524,18 @@ router.get("/", (req, res) => {
534
524
  });
535
525
  router.get("/flat", (req, res) => {
536
526
  const state = req.app.locals.state;
537
- const files = collectFlatFiles(state.cwd, state.cwd, 10);
538
- files.sort();
527
+ const result = collectFlatFiles(state.cwd, state.cwd, 10);
528
+ result.files.sort((a, b) => a.path.localeCompare(b.path));
529
+ result.filteredDirs.sort();
530
+ let recentFile = null;
531
+ if (result.files.length > 0) {
532
+ const mostRecent = result.files.reduce((prev, curr) => curr.mtime > prev.mtime ? curr : prev);
533
+ recentFile = mostRecent.path;
534
+ }
539
535
  const response = {
540
- files
536
+ files: result.files,
537
+ filteredDirs: result.filteredDirs,
538
+ recentFile
541
539
  };
542
540
  res.json(response);
543
541
  });
@@ -920,16 +918,61 @@ function formatComments(comments) {
920
918
  }
921
919
 
922
920
  // dist/flip/output/clipboard.js
923
- import clipboardy from "clipboardy";
921
+ import { spawn } from "child_process";
922
+ import fs5 from "fs";
923
+ import path5 from "path";
924
+ import os from "os";
924
925
  async function copyToClipboard(text) {
925
- await clipboardy.write(text);
926
+ if (process.platform === "darwin") {
927
+ const tmpFile = path5.join(os.tmpdir(), `flip-clipboard-${Date.now()}.txt`);
928
+ try {
929
+ fs5.writeFileSync(tmpFile, text);
930
+ const child = spawn("sh", ["-c", `cat "${tmpFile}" | pbcopy && rm "${tmpFile}"`], {
931
+ detached: true,
932
+ stdio: "ignore"
933
+ });
934
+ child.unref();
935
+ } catch (e) {
936
+ console.log(`Output saved to: ${tmpFile}`);
937
+ throw e;
938
+ }
939
+ } else if (process.platform === "linux") {
940
+ const tmpFile = path5.join(os.tmpdir(), `flip-clipboard-${Date.now()}.txt`);
941
+ fs5.writeFileSync(tmpFile, text);
942
+ try {
943
+ const child = spawn("sh", ["-c", `cat "${tmpFile}" | xclip -selection clipboard && rm "${tmpFile}"`], {
944
+ detached: true,
945
+ stdio: "ignore"
946
+ });
947
+ child.unref();
948
+ } catch {
949
+ try {
950
+ const child = spawn("sh", ["-c", `cat "${tmpFile}" | xsel --clipboard --input && rm "${tmpFile}"`], {
951
+ detached: true,
952
+ stdio: "ignore"
953
+ });
954
+ child.unref();
955
+ } catch (e) {
956
+ console.log(`Output saved to: ${tmpFile}`);
957
+ throw e;
958
+ }
959
+ }
960
+ } else if (process.platform === "win32") {
961
+ const tmpFile = path5.join(os.tmpdir(), `flip-clipboard-${Date.now()}.txt`);
962
+ fs5.writeFileSync(tmpFile, text);
963
+ const child = spawn("cmd", ["/c", `type "${tmpFile}" | clip && del "${tmpFile}"`], {
964
+ detached: true,
965
+ stdio: "ignore"
966
+ });
967
+ child.unref();
968
+ }
926
969
  }
927
970
 
928
971
  // dist/flip/output/autopaste.js
929
- import { execSync as execSync2 } from "child_process";
930
- import fs5 from "fs";
931
- import path5 from "path";
932
- import os from "os";
972
+ import { spawn as spawn2 } from "child_process";
973
+ import fs6 from "fs";
974
+ import path6 from "path";
975
+ import os2 from "os";
933
976
  async function schedulePaste(sessionId) {
934
977
  if (process.platform !== "darwin") {
935
978
  console.error("Auto-paste not supported on this platform. Please paste manually (Ctrl+V).");
@@ -938,10 +981,10 @@ async function schedulePaste(sessionId) {
938
981
  await pasteToOriginalSession(sessionId);
939
982
  }
940
983
  async function pasteToOriginalSession(sessionId) {
941
- const sessionFile = path5.join(os.tmpdir(), `flip-view-session-${sessionId}`);
984
+ const sessionFile = path6.join(os2.tmpdir(), `flip-view-session-${sessionId}`);
942
985
  let itermSessionId;
943
986
  try {
944
- itermSessionId = fs5.readFileSync(sessionFile, "utf-8").trim();
987
+ itermSessionId = fs6.readFileSync(sessionFile, "utf-8").trim();
945
988
  } catch {
946
989
  }
947
990
  let script;
@@ -969,7 +1012,7 @@ async function pasteToOriginalSession(sessionId) {
969
1012
  end tell
970
1013
  `;
971
1014
  try {
972
- fs5.unlinkSync(sessionFile);
1015
+ fs6.unlinkSync(sessionFile);
973
1016
  } catch {
974
1017
  }
975
1018
  } else {
@@ -985,9 +1028,19 @@ async function pasteToOriginalSession(sessionId) {
985
1028
  `;
986
1029
  }
987
1030
  try {
988
- execSync2(`osascript -e '${script.replace(/'/g, `'"'"'`)}'`, {
989
- stdio: "pipe"
1031
+ const tmpScript = path6.join(os2.tmpdir(), `flip-paste-${Date.now()}.scpt`);
1032
+ fs6.writeFileSync(tmpScript, script);
1033
+ const child = spawn2("osascript", [tmpScript], {
1034
+ detached: true,
1035
+ stdio: "ignore"
990
1036
  });
1037
+ child.unref();
1038
+ setTimeout(() => {
1039
+ try {
1040
+ fs6.unlinkSync(tmpScript);
1041
+ } catch {
1042
+ }
1043
+ }, 5e3);
991
1044
  } catch (e) {
992
1045
  console.error("Failed to paste to iTerm:", e);
993
1046
  }
@@ -1009,15 +1062,22 @@ router4.post("/", async (req, res) => {
1009
1062
  text: item.comment
1010
1063
  }));
1011
1064
  const formatted = formatComments(comments);
1065
+ let clipboardSuccess = false;
1012
1066
  try {
1013
1067
  await copyToClipboard(formatted);
1068
+ clipboardSuccess = true;
1014
1069
  } catch (e) {
1015
1070
  console.error("Failed to copy to clipboard:", e);
1071
+ console.log("\n--- Output (copy manually) ---");
1072
+ console.log(formatted);
1073
+ console.log("--- End of output ---\n");
1016
1074
  }
1017
- try {
1018
- await schedulePaste(body.session_id);
1019
- } catch (e) {
1020
- console.error("Failed to schedule paste:", e);
1075
+ if (clipboardSuccess) {
1076
+ try {
1077
+ await schedulePaste(body.session_id);
1078
+ } catch (e) {
1079
+ console.error("Failed to schedule paste:", e);
1080
+ }
1021
1081
  }
1022
1082
  res.json({ status: "ok" });
1023
1083
  if (state.resolve) {
@@ -1039,19 +1099,19 @@ router5.post("/", (req, res) => {
1039
1099
  // dist/flip/routes/static.js
1040
1100
  import { Router as Router6 } from "express";
1041
1101
  import express from "express";
1042
- import path6 from "path";
1102
+ import path7 from "path";
1043
1103
  import { fileURLToPath } from "url";
1044
- import fs6 from "fs";
1104
+ import fs7 from "fs";
1045
1105
  function createStaticRouter() {
1046
1106
  const router6 = Router6();
1047
1107
  const __filename = fileURLToPath(import.meta.url);
1048
- const __dirname = path6.dirname(__filename);
1049
- const distPath = path6.resolve(__dirname, "flip-ui/dist");
1050
- if (fs6.existsSync(distPath)) {
1108
+ const __dirname = path7.dirname(__filename);
1109
+ const distPath = path7.resolve(__dirname, "../../../flip-ui/dist");
1110
+ if (fs7.existsSync(distPath)) {
1051
1111
  router6.use(express.static(distPath));
1052
1112
  router6.get("*", (req, res) => {
1053
- const indexPath = path6.join(distPath, "index.html");
1054
- if (fs6.existsSync(indexPath)) {
1113
+ const indexPath = path7.join(distPath, "index.html");
1114
+ if (fs7.existsSync(indexPath)) {
1055
1115
  res.sendFile(indexPath);
1056
1116
  } else {
1057
1117
  res.status(404).send("Not Found");
@@ -1065,6 +1125,175 @@ function createStaticRouter() {
1065
1125
  return router6;
1066
1126
  }
1067
1127
 
1128
+ // dist/flip/routes/events.js
1129
+ import { Router as Router7 } from "express";
1130
+ function createEventsRouter(sseManager) {
1131
+ const router6 = Router7();
1132
+ router6.get("/", (req, res) => {
1133
+ res.setHeader("Content-Type", "text/event-stream");
1134
+ res.setHeader("Cache-Control", "no-cache");
1135
+ res.setHeader("Connection", "keep-alive");
1136
+ res.setHeader("X-Accel-Buffering", "no");
1137
+ res.write('data: {"type":"connected"}\n\n');
1138
+ sseManager.addClient(res);
1139
+ const heartbeat = setInterval(() => {
1140
+ res.write(":heartbeat\n\n");
1141
+ }, 3e4);
1142
+ req.on("close", () => {
1143
+ clearInterval(heartbeat);
1144
+ });
1145
+ });
1146
+ return router6;
1147
+ }
1148
+
1149
+ // dist/flip/watcher/FileWatcher.js
1150
+ import chokidar from "chokidar";
1151
+ import * as path8 from "path";
1152
+ var FileWatcher = class {
1153
+ watcher = null;
1154
+ cwd;
1155
+ debounceMs;
1156
+ filesChangedCallbacks = [];
1157
+ fileChangedCallbacks = [];
1158
+ gitChangedCallbacks = [];
1159
+ filesDebounceTimer = null;
1160
+ gitDebounceTimer = null;
1161
+ fileDebounceTimers = /* @__PURE__ */ new Map();
1162
+ constructor(options) {
1163
+ this.cwd = options.cwd;
1164
+ this.debounceMs = options.debounceMs ?? 300;
1165
+ }
1166
+ start() {
1167
+ const ignoredPatterns = Array.from(FILTERED_PATTERNS).map((pattern) => {
1168
+ if (pattern === ".git") {
1169
+ return void 0;
1170
+ }
1171
+ return `**/${pattern}/**`;
1172
+ }).filter(Boolean);
1173
+ this.watcher = chokidar.watch(this.cwd, {
1174
+ ignored: ignoredPatterns,
1175
+ persistent: true,
1176
+ ignoreInitial: true,
1177
+ awaitWriteFinish: {
1178
+ stabilityThreshold: 100,
1179
+ pollInterval: 50
1180
+ }
1181
+ });
1182
+ this.watcher.on("add", (filePath) => this.handleFileEvent(filePath, "add")).on("unlink", (filePath) => this.handleFileEvent(filePath, "unlink")).on("change", (filePath) => this.handleFileEvent(filePath, "change")).on("addDir", (filePath) => this.handleDirEvent(filePath, "addDir")).on("unlinkDir", (filePath) => this.handleDirEvent(filePath, "unlinkDir")).on("error", (error) => console.error("Watcher error:", error));
1183
+ }
1184
+ async stop() {
1185
+ if (this.filesDebounceTimer) {
1186
+ clearTimeout(this.filesDebounceTimer);
1187
+ }
1188
+ if (this.gitDebounceTimer) {
1189
+ clearTimeout(this.gitDebounceTimer);
1190
+ }
1191
+ Array.from(this.fileDebounceTimers.values()).forEach((timer) => {
1192
+ clearTimeout(timer);
1193
+ });
1194
+ this.fileDebounceTimers.clear();
1195
+ if (this.watcher) {
1196
+ await this.watcher.close();
1197
+ this.watcher = null;
1198
+ }
1199
+ }
1200
+ onFilesChanged(callback) {
1201
+ this.filesChangedCallbacks.push(callback);
1202
+ }
1203
+ onFileChanged(callback) {
1204
+ this.fileChangedCallbacks.push(callback);
1205
+ }
1206
+ onGitChanged(callback) {
1207
+ this.gitChangedCallbacks.push(callback);
1208
+ }
1209
+ handleFileEvent(filePath, event) {
1210
+ const relativePath = path8.relative(this.cwd, filePath);
1211
+ if (relativePath.startsWith(".git")) {
1212
+ this.emitGitChanged();
1213
+ return;
1214
+ }
1215
+ if (event === "add" || event === "unlink") {
1216
+ this.emitFilesChanged();
1217
+ }
1218
+ if (event === "change" || event === "add") {
1219
+ this.emitFileChanged(relativePath);
1220
+ }
1221
+ this.emitGitChanged();
1222
+ }
1223
+ handleDirEvent(dirPath, event) {
1224
+ const relativePath = path8.relative(this.cwd, dirPath);
1225
+ if (relativePath.startsWith(".git")) {
1226
+ return;
1227
+ }
1228
+ this.emitFilesChanged();
1229
+ }
1230
+ emitFilesChanged() {
1231
+ if (this.filesDebounceTimer) {
1232
+ clearTimeout(this.filesDebounceTimer);
1233
+ }
1234
+ this.filesDebounceTimer = setTimeout(() => {
1235
+ for (const callback of this.filesChangedCallbacks) {
1236
+ callback();
1237
+ }
1238
+ }, this.debounceMs);
1239
+ }
1240
+ emitFileChanged(relativePath) {
1241
+ const existingTimer = this.fileDebounceTimers.get(relativePath);
1242
+ if (existingTimer) {
1243
+ clearTimeout(existingTimer);
1244
+ }
1245
+ const timer = setTimeout(() => {
1246
+ this.fileDebounceTimers.delete(relativePath);
1247
+ for (const callback of this.fileChangedCallbacks) {
1248
+ callback(relativePath);
1249
+ }
1250
+ }, this.debounceMs);
1251
+ this.fileDebounceTimers.set(relativePath, timer);
1252
+ }
1253
+ emitGitChanged() {
1254
+ if (this.gitDebounceTimer) {
1255
+ clearTimeout(this.gitDebounceTimer);
1256
+ }
1257
+ this.gitDebounceTimer = setTimeout(() => {
1258
+ for (const callback of this.gitChangedCallbacks) {
1259
+ callback();
1260
+ }
1261
+ }, this.debounceMs);
1262
+ }
1263
+ };
1264
+
1265
+ // dist/flip/events/SSEManager.js
1266
+ var SSEManager = class {
1267
+ clients = /* @__PURE__ */ new Set();
1268
+ addClient(res) {
1269
+ this.clients.add(res);
1270
+ res.on("close", () => {
1271
+ this.clients.delete(res);
1272
+ });
1273
+ }
1274
+ removeClient(res) {
1275
+ this.clients.delete(res);
1276
+ }
1277
+ broadcast(event) {
1278
+ const data = JSON.stringify(event);
1279
+ const message = `data: ${data}
1280
+
1281
+ `;
1282
+ this.clients.forEach((client) => {
1283
+ client.write(message);
1284
+ });
1285
+ }
1286
+ closeAll() {
1287
+ this.clients.forEach((client) => {
1288
+ client.end();
1289
+ });
1290
+ this.clients.clear();
1291
+ }
1292
+ get clientCount() {
1293
+ return this.clients.size;
1294
+ }
1295
+ };
1296
+
1068
1297
  // dist/flip/server/Server.js
1069
1298
  var Server = class {
1070
1299
  cwd;
@@ -1083,15 +1312,30 @@ var Server = class {
1083
1312
  app.use(cors());
1084
1313
  app.use(express2.json());
1085
1314
  app.locals.state = state;
1315
+ const sseManager = new SSEManager();
1316
+ const fileWatcher = new FileWatcher({ cwd: this.cwd });
1317
+ fileWatcher.onFilesChanged(() => {
1318
+ sseManager.broadcast({ type: "files-changed" });
1319
+ });
1320
+ fileWatcher.onFileChanged((path13) => {
1321
+ sseManager.broadcast({ type: "file-changed", path: path13 });
1322
+ });
1323
+ fileWatcher.onGitChanged(() => {
1324
+ sseManager.broadcast({ type: "git-changed" });
1325
+ });
1326
+ fileWatcher.start();
1086
1327
  app.use("/api/files", router);
1087
1328
  app.use("/api/file", router2);
1088
1329
  app.use("/api/git", router3);
1089
1330
  app.use("/api/submit", router4);
1090
1331
  app.use("/api/cancel", router5);
1332
+ app.use("/api/events", createEventsRouter(sseManager));
1091
1333
  app.use(createStaticRouter());
1092
1334
  const server = http.createServer(app);
1093
- state.resolve = (output) => {
1094
- server.close();
1335
+ state.resolve = async (output) => {
1336
+ await fileWatcher.stop();
1337
+ sseManager.closeAll();
1338
+ await new Promise((res) => server.close(() => res()));
1095
1339
  resolve2(output);
1096
1340
  };
1097
1341
  server.listen(this.port, "127.0.0.1", () => {
@@ -1116,12 +1360,11 @@ async function findFreePort(preferred) {
1116
1360
 
1117
1361
  // dist/flip/index.js
1118
1362
  import open from "open";
1119
- import path7 from "path";
1120
- import fs7 from "fs";
1121
- import os2 from "os";
1122
- import { execSync as execSync3 } from "child_process";
1363
+ import path9 from "path";
1364
+ import fs8 from "fs";
1365
+ import os3 from "os";
1366
+ import { execSync as execSync2 } from "child_process";
1123
1367
  import { confirm as confirm2 } from "@inquirer/prompts";
1124
- import clipboardy2 from "clipboardy";
1125
1368
  var DEFAULT_PORT = 51234;
1126
1369
  function formatTime() {
1127
1370
  const now = /* @__PURE__ */ new Date();
@@ -1169,7 +1412,7 @@ async function runFlip(args) {
1169
1412
  } else {
1170
1413
  command = "oneshot";
1171
1414
  }
1172
- const cwd = pathArg ? path7.resolve(pathArg) : process.cwd();
1415
+ const cwd = pathArg ? path9.resolve(pathArg) : process.cwd();
1173
1416
  switch (command) {
1174
1417
  case "setup": {
1175
1418
  await setupHotkey();
@@ -1241,17 +1484,17 @@ function printUsage() {
1241
1484
  console.error(" --session <uuid> Session ID for paste-back tracking");
1242
1485
  }
1243
1486
  async function setupHotkey() {
1244
- const configDir = path7.join(os2.homedir(), ".config", "flip");
1245
- const applescriptPath = path7.join(configDir, "flip.applescript");
1246
- const shPath = path7.join(configDir, "flip.sh");
1487
+ const configDir = path9.join(os3.homedir(), ".config", "flip");
1488
+ const applescriptPath = path9.join(configDir, "flip.applescript");
1489
+ const shPath = path9.join(configDir, "flip.sh");
1247
1490
  let nodePath;
1248
1491
  try {
1249
- nodePath = execSync3("which node", { encoding: "utf-8" }).trim();
1492
+ nodePath = execSync2("which node", { encoding: "utf-8" }).trim();
1250
1493
  } catch {
1251
1494
  nodePath = "/usr/local/bin/node";
1252
1495
  }
1253
1496
  const csqPath = new URL(import.meta.url).pathname;
1254
- fs7.mkdirSync(configDir, { recursive: true });
1497
+ fs8.mkdirSync(configDir, { recursive: true });
1255
1498
  const applescriptContent = `#!/usr/bin/osascript
1256
1499
 
1257
1500
  -- flip hotkey script
@@ -1268,13 +1511,13 @@ tell application "iTerm2"
1268
1511
  end tell
1269
1512
 
1270
1513
  return ""`;
1271
- fs7.writeFileSync(applescriptPath, applescriptContent);
1272
- fs7.chmodSync(applescriptPath, "755");
1514
+ fs8.writeFileSync(applescriptPath, applescriptContent);
1515
+ fs8.chmodSync(applescriptPath, "755");
1273
1516
  const shContent = `#!/bin/bash
1274
1517
  osascript ${applescriptPath} > /dev/null 2>&1
1275
1518
  `;
1276
- fs7.writeFileSync(shPath, shContent);
1277
- fs7.chmodSync(shPath, "755");
1519
+ fs8.writeFileSync(shPath, shContent);
1520
+ fs8.chmodSync(shPath, "755");
1278
1521
  console.log("");
1279
1522
  console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510");
1280
1523
  console.log("\u2502 Flip Hotkey Setup Wizard \u2502");
@@ -1289,7 +1532,7 @@ osascript ${applescriptPath} > /dev/null 2>&1
1289
1532
  });
1290
1533
  if (openSettings) {
1291
1534
  try {
1292
- execSync3(`osascript -e 'tell application "iTerm2" to activate' -e 'tell application "System Events" to keystroke "," using command down'`);
1535
+ execSync2(`osascript -e 'tell application "iTerm2" to activate' -e 'tell application "System Events" to keystroke "," using command down'`);
1293
1536
  console.log("");
1294
1537
  console.log(" \u2192 iTerm2 Settings opened. Navigate to: Keys \u2192 Key Bindings");
1295
1538
  } catch {
@@ -1318,7 +1561,7 @@ osascript ${applescriptPath} > /dev/null 2>&1
1318
1561
  console.log("\u2502 3. Command: Paste the path (copied below) \u2502");
1319
1562
  console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518");
1320
1563
  console.log("");
1321
- await clipboardy2.write(shPath);
1564
+ await copyToClipboard(shPath);
1322
1565
  console.log(`\u2713 Copied to clipboard: ${shPath}`);
1323
1566
  console.log("");
1324
1567
  await confirm2({
@@ -1339,13 +1582,13 @@ osascript ${applescriptPath} > /dev/null 2>&1
1339
1582
  }
1340
1583
 
1341
1584
  // dist/config.js
1342
- import * as fs8 from "fs";
1343
- import * as os3 from "os";
1344
- import * as path8 from "path";
1345
- var GLOBAL_CONFIG_PATH = path8.join(os3.homedir(), ".code-squad", "config.json");
1585
+ import * as fs9 from "fs";
1586
+ import * as os4 from "os";
1587
+ import * as path10 from "path";
1588
+ var GLOBAL_CONFIG_PATH = path10.join(os4.homedir(), ".code-squad", "config.json");
1346
1589
  async function loadGlobalConfig() {
1347
1590
  try {
1348
- const content = await fs8.promises.readFile(GLOBAL_CONFIG_PATH, "utf-8");
1591
+ const content = await fs9.promises.readFile(GLOBAL_CONFIG_PATH, "utf-8");
1349
1592
  return JSON.parse(content);
1350
1593
  } catch (error) {
1351
1594
  if (error instanceof Error && "code" in error && error.code === "ENOENT") {
@@ -1357,7 +1600,7 @@ async function loadGlobalConfig() {
1357
1600
  }
1358
1601
  async function loadConfig(workspaceRoot) {
1359
1602
  const globalConfig = await loadGlobalConfig();
1360
- const normalizedPath = path8.resolve(workspaceRoot);
1603
+ const normalizedPath = path10.resolve(workspaceRoot);
1361
1604
  const projectConfig = globalConfig.projects?.[normalizedPath] ?? {};
1362
1605
  const defaults = globalConfig.defaults ?? {};
1363
1606
  return {
@@ -1376,8 +1619,8 @@ function getWorktreeCopyPatterns(config) {
1376
1619
  }
1377
1620
 
1378
1621
  // dist/fileUtils.js
1379
- import * as fs9 from "fs";
1380
- import * as path9 from "path";
1622
+ import * as fs10 from "fs";
1623
+ import * as path11 from "path";
1381
1624
  import fg from "fast-glob";
1382
1625
  async function copyFilesWithPatterns(sourceRoot, destRoot, patterns) {
1383
1626
  const copied = [];
@@ -1397,10 +1640,10 @@ async function copyFilesWithPatterns(sourceRoot, destRoot, patterns) {
1397
1640
  for (const absolutePath of files) {
1398
1641
  try {
1399
1642
  await copySingleFile(absolutePath, sourceRoot, destRoot);
1400
- const relativePath = path9.relative(sourceRoot, absolutePath);
1643
+ const relativePath = path11.relative(sourceRoot, absolutePath);
1401
1644
  copied.push(relativePath);
1402
1645
  } catch {
1403
- const relativePath = path9.relative(sourceRoot, absolutePath);
1646
+ const relativePath = path11.relative(sourceRoot, absolutePath);
1404
1647
  failed.push(relativePath);
1405
1648
  }
1406
1649
  }
@@ -1410,11 +1653,11 @@ async function copyFilesWithPatterns(sourceRoot, destRoot, patterns) {
1410
1653
  return { copied, failed };
1411
1654
  }
1412
1655
  async function copySingleFile(absolutePath, sourceRoot, destRoot) {
1413
- const relativePath = path9.relative(sourceRoot, absolutePath);
1414
- const destPath = path9.join(destRoot, relativePath);
1415
- const destDir = path9.dirname(destPath);
1416
- await fs9.promises.mkdir(destDir, { recursive: true });
1417
- await fs9.promises.copyFile(absolutePath, destPath);
1656
+ const relativePath = path11.relative(sourceRoot, absolutePath);
1657
+ const destPath = path11.join(destRoot, relativePath);
1658
+ const destDir = path11.dirname(destPath);
1659
+ await fs10.promises.mkdir(destDir, { recursive: true });
1660
+ await fs10.promises.copyFile(absolutePath, destPath);
1418
1661
  }
1419
1662
 
1420
1663
  // dist/index.js
@@ -1469,13 +1712,13 @@ function getProjectHash(workspaceRoot) {
1469
1712
  }
1470
1713
  function getSessionsPath(workspaceRoot) {
1471
1714
  const projectHash = getProjectHash(workspaceRoot);
1472
- const projectName = path10.basename(workspaceRoot);
1473
- return path10.join(os4.homedir(), ".code-squad", "sessions", `${projectName}-${projectHash}.json`);
1715
+ const projectName = path12.basename(workspaceRoot);
1716
+ return path12.join(os5.homedir(), ".code-squad", "sessions", `${projectName}-${projectHash}.json`);
1474
1717
  }
1475
1718
  async function loadLocalThreads(workspaceRoot) {
1476
1719
  const sessionsPath = getSessionsPath(workspaceRoot);
1477
1720
  try {
1478
- const content = await fs10.promises.readFile(sessionsPath, "utf-8");
1721
+ const content = await fs11.promises.readFile(sessionsPath, "utf-8");
1479
1722
  const data = JSON.parse(content);
1480
1723
  return data.localThreads || [];
1481
1724
  } catch {
@@ -1484,9 +1727,9 @@ async function loadLocalThreads(workspaceRoot) {
1484
1727
  }
1485
1728
  async function saveLocalThreads(workspaceRoot, threads) {
1486
1729
  const sessionsPath = getSessionsPath(workspaceRoot);
1487
- const dir = path10.dirname(sessionsPath);
1488
- await fs10.promises.mkdir(dir, { recursive: true });
1489
- await fs10.promises.writeFile(sessionsPath, JSON.stringify({ localThreads: threads }, null, 2));
1730
+ const dir = path12.dirname(sessionsPath);
1731
+ await fs11.promises.mkdir(dir, { recursive: true });
1732
+ await fs11.promises.writeFile(sessionsPath, JSON.stringify({ localThreads: threads }, null, 2));
1490
1733
  }
1491
1734
  async function addLocalThread(workspaceRoot, name) {
1492
1735
  const threads = await loadLocalThreads(workspaceRoot);
@@ -1584,9 +1827,9 @@ async function createWorktreeCommand(workspaceRoot, args) {
1584
1827
  console.error(chalk2.dim("Usage: csq new <name> [-s|--split]"));
1585
1828
  process.exit(1);
1586
1829
  }
1587
- const repoName = path10.basename(workspaceRoot);
1588
- const defaultBasePath = path10.join(path10.dirname(workspaceRoot), `${repoName}.worktree`);
1589
- const worktreePath = path10.join(defaultBasePath, name);
1830
+ const repoName = path12.basename(workspaceRoot);
1831
+ const defaultBasePath = path12.join(path12.dirname(workspaceRoot), `${repoName}.worktree`);
1832
+ const worktreePath = path12.join(defaultBasePath, name);
1590
1833
  try {
1591
1834
  await gitAdapter.createWorktree(worktreePath, name, workspaceRoot);
1592
1835
  console.log(chalk2.green(`\u2713 Created worktree: ${name}`));
@@ -1765,7 +2008,7 @@ async function executeDelete(thread, workspaceRoot) {
1765
2008
  }
1766
2009
  async function runInteraction(workspaceRoot, _persistent = false) {
1767
2010
  const threads = await getAllThreads(workspaceRoot);
1768
- const repoName = path10.basename(workspaceRoot);
2011
+ const repoName = path12.basename(workspaceRoot);
1769
2012
  const choice = await selectThread(threads, repoName);
1770
2013
  if (choice.type === "exit") {
1771
2014
  return { exit: true };
@@ -1796,7 +2039,7 @@ async function runInteraction(workspaceRoot, _persistent = false) {
1796
2039
  return null;
1797
2040
  }
1798
2041
  if (newType === "worktree") {
1799
- const defaultBasePath = path10.join(path10.dirname(workspaceRoot), `${repoName}.worktree`);
2042
+ const defaultBasePath = path12.join(path12.dirname(workspaceRoot), `${repoName}.worktree`);
1800
2043
  const form = await newWorktreeForm(defaultBasePath);
1801
2044
  if (!form) {
1802
2045
  return null;