offsite 0.0.0 → 0.0.1

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 (361) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +41 -0
  3. package/apps/server/dist/args.js +11 -0
  4. package/apps/server/dist/claude.js +196 -0
  5. package/apps/server/dist/config.js +184 -0
  6. package/apps/server/dist/content.js +172 -0
  7. package/apps/server/dist/files.js +50 -0
  8. package/apps/server/dist/folders.js +12 -0
  9. package/apps/server/dist/git.js +133 -0
  10. package/apps/server/dist/history.js +103 -0
  11. package/apps/server/dist/hub.js +10 -0
  12. package/apps/server/dist/main.js +64 -0
  13. package/apps/server/dist/protocol.js +20 -0
  14. package/apps/server/dist/push.js +152 -0
  15. package/apps/server/dist/run.js +371 -0
  16. package/apps/server/dist/runs.js +102 -0
  17. package/apps/server/dist/schemes.js +262 -0
  18. package/apps/server/dist/sessions.js +64 -0
  19. package/apps/server/dist/socket.js +139 -0
  20. package/apps/server/dist/storage.js +22 -0
  21. package/apps/server/dist/terminal/alerts.js +145 -0
  22. package/apps/server/dist/terminal/process.js +207 -0
  23. package/apps/server/dist/terminal/shell-check.js +91 -0
  24. package/apps/server/dist/terminal/shell-integration.js +112 -0
  25. package/apps/server/dist/terminal/terminal.js +402 -0
  26. package/apps/server/src/terminal/shell-integration/bash/offsite.bash +112 -0
  27. package/apps/server/src/terminal/shell-integration/fish/offsite.fish +22 -0
  28. package/apps/server/src/terminal/shell-integration/zsh/.zshenv +100 -0
  29. package/apps/web/dist/assets/CaskaydiaCove-Bold-EtG3C8NJ.woff2 +0 -0
  30. package/apps/web/dist/assets/CaskaydiaCove-Regular-C8p8BuDw.woff2 +0 -0
  31. package/apps/web/dist/assets/FiraCode-Bold-CWkMdXEH.woff2 +0 -0
  32. package/apps/web/dist/assets/FiraCode-Regular-DlIV_a-6.woff2 +0 -0
  33. package/apps/web/dist/assets/Hack-Bold-CJ2nw9Fn.woff2 +0 -0
  34. package/apps/web/dist/assets/Hack-Regular-DQT7wDXD.woff2 +0 -0
  35. package/apps/web/dist/assets/JetBrainsMono-Bold-C3RVijod.woff2 +0 -0
  36. package/apps/web/dist/assets/JetBrainsMono-Regular-BhNseNRl.woff2 +0 -0
  37. package/apps/web/dist/assets/abap-CLvhMVsD.js +1 -0
  38. package/apps/web/dist/assets/actionscript-3-Cs6JJXT5.js +1 -0
  39. package/apps/web/dist/assets/ada-X3Y2mlq2.js +1 -0
  40. package/apps/web/dist/assets/ahk-DwADkxyd.js +1 -0
  41. package/apps/web/dist/assets/ahk2-_6rzW9BS.js +1 -0
  42. package/apps/web/dist/assets/andromeeda-vGVdxbeo.js +1 -0
  43. package/apps/web/dist/assets/angular-html-_TZra42G.js +1 -0
  44. package/apps/web/dist/assets/angular-ts-CVVZOQsp.js +1 -0
  45. package/apps/web/dist/assets/apache-U0d_L8uA.js +1 -0
  46. package/apps/web/dist/assets/apex-KFGFyKwG.js +1 -0
  47. package/apps/web/dist/assets/apl-Cyzt__4P.js +1 -0
  48. package/apps/web/dist/assets/applescript-CCn79oCD.js +1 -0
  49. package/apps/web/dist/assets/ara-4CJ0cIlV.js +1 -0
  50. package/apps/web/dist/assets/asciidoc-SCjQUq34.js +1 -0
  51. package/apps/web/dist/assets/asm-Cmm7eHzH.js +1 -0
  52. package/apps/web/dist/assets/astro-DvoD4nYz.js +1 -0
  53. package/apps/web/dist/assets/aurora-x-CDeNXAV0.js +1 -0
  54. package/apps/web/dist/assets/awk-BWXHIvNe.js +1 -0
  55. package/apps/web/dist/assets/ayu-dark-DluEY0Gj.js +1 -0
  56. package/apps/web/dist/assets/ayu-light-C3h-C4tm.js +1 -0
  57. package/apps/web/dist/assets/ayu-mirage-Bqwy1Gya.js +1 -0
  58. package/apps/web/dist/assets/ballerina-B7ZEbQpA.js +1 -0
  59. package/apps/web/dist/assets/bat-qdxAdBWQ.js +1 -0
  60. package/apps/web/dist/assets/beancount-C2IN4Vk8.js +1 -0
  61. package/apps/web/dist/assets/berry-DKpUyyne.js +1 -0
  62. package/apps/web/dist/assets/bibtex-Ci_nEsc7.js +1 -0
  63. package/apps/web/dist/assets/bicep-CUHmPFLl.js +1 -0
  64. package/apps/web/dist/assets/bird2-CYIUgYqB.js +1 -0
  65. package/apps/web/dist/assets/blade-SFrvNJcM.js +1 -0
  66. package/apps/web/dist/assets/bsl-_VjlB9mv.js +1 -0
  67. package/apps/web/dist/assets/c-BzXljoEl.js +1 -0
  68. package/apps/web/dist/assets/c3-D0apG41V.js +1 -0
  69. package/apps/web/dist/assets/cadence-CQ2zXKGN.js +1 -0
  70. package/apps/web/dist/assets/cairo-DLTphjLi.js +1 -0
  71. package/apps/web/dist/assets/catppuccin-frappe-C9Q5zVZY.js +1 -0
  72. package/apps/web/dist/assets/catppuccin-latte-CtsyrtPq.js +1 -0
  73. package/apps/web/dist/assets/catppuccin-macchiato-R8nAf1vR.js +1 -0
  74. package/apps/web/dist/assets/catppuccin-mocha-DjuaAJKi.js +1 -0
  75. package/apps/web/dist/assets/chapel-CSqeAvDr.js +1 -0
  76. package/apps/web/dist/assets/clarity-CtfBBspg.js +1 -0
  77. package/apps/web/dist/assets/clojure-DqKBuwfJ.js +1 -0
  78. package/apps/web/dist/assets/cmake-Bj61d0ZC.js +1 -0
  79. package/apps/web/dist/assets/cobol-DnK1h_4j.js +1 -0
  80. package/apps/web/dist/assets/codeowners-C8r90Shi.js +1 -0
  81. package/apps/web/dist/assets/codeql-oeQT6MSM.js +1 -0
  82. package/apps/web/dist/assets/coffee-BrM2hs_V.js +1 -0
  83. package/apps/web/dist/assets/common-lisp-Cv5bFMCO.js +1 -0
  84. package/apps/web/dist/assets/coq-CGaSfhwR.js +1 -0
  85. package/apps/web/dist/assets/cpp-C_7gVSp4.js +1 -0
  86. package/apps/web/dist/assets/crystal-DbpY_y_D.js +1 -0
  87. package/apps/web/dist/assets/csharp-dmMxLVLW.js +1 -0
  88. package/apps/web/dist/assets/css-CcKWTG1c.js +1 -0
  89. package/apps/web/dist/assets/csv-Dx-8-gkx.js +1 -0
  90. package/apps/web/dist/assets/cue-CE9AQfxI.js +1 -0
  91. package/apps/web/dist/assets/cypher-ClKdZ_lG.js +1 -0
  92. package/apps/web/dist/assets/d-qD-0Kul2.js +1 -0
  93. package/apps/web/dist/assets/dark-plus-Cs2F2srj.js +1 -0
  94. package/apps/web/dist/assets/dart-CHZY9Xhz.js +1 -0
  95. package/apps/web/dist/assets/dax-BkyTk9wS.js +1 -0
  96. package/apps/web/dist/assets/desktop-Dlh5hvp9.js +1 -0
  97. package/apps/web/dist/assets/diff-woXpYk--.js +1 -0
  98. package/apps/web/dist/assets/docker-IyjqRm3v.js +1 -0
  99. package/apps/web/dist/assets/dotenv-CuH5my32.js +1 -0
  100. package/apps/web/dist/assets/dracula-BHWKrbxM.js +1 -0
  101. package/apps/web/dist/assets/dracula-soft-5eyTD99u.js +1 -0
  102. package/apps/web/dist/assets/dream-maker-DW3nJb8Q.js +1 -0
  103. package/apps/web/dist/assets/edge-CqcnepJa.js +1 -0
  104. package/apps/web/dist/assets/elixir-DG0UMMTO.js +1 -0
  105. package/apps/web/dist/assets/elm-D81_16hi.js +1 -0
  106. package/apps/web/dist/assets/emacs-lisp-DR2vtWaj.js +1 -0
  107. package/apps/web/dist/assets/erb-BHb0Ji2T.js +1 -0
  108. package/apps/web/dist/assets/erlang-Cphh6RMH.js +1 -0
  109. package/apps/web/dist/assets/everforest-dark-sB-x3p7T.js +1 -0
  110. package/apps/web/dist/assets/everforest-light-Df2xbC6M.js +1 -0
  111. package/apps/web/dist/assets/fennel-DQxkIbk2.js +1 -0
  112. package/apps/web/dist/assets/fish-BJitypiv.js +1 -0
  113. package/apps/web/dist/assets/fluent-C03EYrpw.js +1 -0
  114. package/apps/web/dist/assets/fortran-fixed-form-DEKoE2YW.js +1 -0
  115. package/apps/web/dist/assets/fortran-free-form-CYNrtFtB.js +1 -0
  116. package/apps/web/dist/assets/fsharp-D13ZGOAj.js +1 -0
  117. package/apps/web/dist/assets/gdresource-xMC7jr7x.js +1 -0
  118. package/apps/web/dist/assets/gdscript-DYvRD3hg.js +1 -0
  119. package/apps/web/dist/assets/gdshader-CBce3t8t.js +1 -0
  120. package/apps/web/dist/assets/genie-CV2tkWYe.js +1 -0
  121. package/apps/web/dist/assets/gherkin-DExj1W_8.js +1 -0
  122. package/apps/web/dist/assets/ghostty-vt-CQAu1Gs5.wasm +0 -0
  123. package/apps/web/dist/assets/git-commit-BSykSTBG.js +1 -0
  124. package/apps/web/dist/assets/git-rebase-Bzcz_AWI.js +1 -0
  125. package/apps/web/dist/assets/github-dark-C-LZuMrd.js +1 -0
  126. package/apps/web/dist/assets/github-dark-default-DXG-b-1a.js +1 -0
  127. package/apps/web/dist/assets/github-dark-dimmed-Bx1FflLF.js +1 -0
  128. package/apps/web/dist/assets/github-dark-high-contrast-B_tTalzw.js +1 -0
  129. package/apps/web/dist/assets/github-light-EUqPIrTm.js +1 -0
  130. package/apps/web/dist/assets/github-light-default-BXViO-2h.js +1 -0
  131. package/apps/web/dist/assets/github-light-high-contrast-B68TUdTA.js +1 -0
  132. package/apps/web/dist/assets/gleam-CSRkHgEL.js +1 -0
  133. package/apps/web/dist/assets/glimmer-js-BbGaPXN7.js +1 -0
  134. package/apps/web/dist/assets/glimmer-ts-B2OBt1Cw.js +1 -0
  135. package/apps/web/dist/assets/glsl-Cuu3Xc_3.js +1 -0
  136. package/apps/web/dist/assets/gn-CAXYAgV-.js +1 -0
  137. package/apps/web/dist/assets/gnuplot-7GGW24-e.js +1 -0
  138. package/apps/web/dist/assets/go-rLFTqkRN.js +1 -0
  139. package/apps/web/dist/assets/graphql-XBGrkq1T.js +1 -0
  140. package/apps/web/dist/assets/groovy-CacY0gHj.js +1 -0
  141. package/apps/web/dist/assets/gruvbox-dark-hard-C820rvS2.js +1 -0
  142. package/apps/web/dist/assets/gruvbox-dark-medium-BPjhmG05.js +1 -0
  143. package/apps/web/dist/assets/gruvbox-dark-soft-MrdJrrXF.js +1 -0
  144. package/apps/web/dist/assets/gruvbox-light-hard-BC_s9l72.js +1 -0
  145. package/apps/web/dist/assets/gruvbox-light-medium-BAWPOn9u.js +1 -0
  146. package/apps/web/dist/assets/gruvbox-light-soft-BSMLrYjP.js +1 -0
  147. package/apps/web/dist/assets/hack-D-n58M0B.js +1 -0
  148. package/apps/web/dist/assets/haml-06aMoWFC.js +1 -0
  149. package/apps/web/dist/assets/handlebars-BSCSPRHp.js +1 -0
  150. package/apps/web/dist/assets/haskell-D8IpX4py.js +1 -0
  151. package/apps/web/dist/assets/haxe-C8oCnwJJ.js +1 -0
  152. package/apps/web/dist/assets/hcl-Dh228itO.js +1 -0
  153. package/apps/web/dist/assets/hjson-CxZEssPk.js +1 -0
  154. package/apps/web/dist/assets/hlsl-Cvrh5tZx.js +1 -0
  155. package/apps/web/dist/assets/horizon-CE9ld1lL.js +1 -0
  156. package/apps/web/dist/assets/horizon-bright-DSNQnXHK.js +1 -0
  157. package/apps/web/dist/assets/houston-CsvMBhTu.js +1 -0
  158. package/apps/web/dist/assets/html-CRYhxgas.js +1 -0
  159. package/apps/web/dist/assets/html-derivative-El-EKb6H.js +1 -0
  160. package/apps/web/dist/assets/http-Cj-Wbb2c.js +1 -0
  161. package/apps/web/dist/assets/hurl--dF5MzC1.js +1 -0
  162. package/apps/web/dist/assets/hxml-Dcm88srW.js +1 -0
  163. package/apps/web/dist/assets/hy-CZbG8q4J.js +1 -0
  164. package/apps/web/dist/assets/imba-DsUTQ-LC.js +1 -0
  165. package/apps/web/dist/assets/index-CN9uEzWa.js +899 -0
  166. package/apps/web/dist/assets/index-Ck79gpc3.css +2 -0
  167. package/apps/web/dist/assets/ini-B5eOa1yu.js +1 -0
  168. package/apps/web/dist/assets/java-_zuIdTC3.js +1 -0
  169. package/apps/web/dist/assets/javascript-Dw2bor_9.js +1 -0
  170. package/apps/web/dist/assets/jinja-CtYhL6FS.js +1 -0
  171. package/apps/web/dist/assets/jison-BS6VCOAt.js +1 -0
  172. package/apps/web/dist/assets/json-D6Mznwzn.js +1 -0
  173. package/apps/web/dist/assets/json5-BR5RXkoi.js +1 -0
  174. package/apps/web/dist/assets/jsonc-CYpm1nAK.js +1 -0
  175. package/apps/web/dist/assets/jsonl-CmCQp5Yx.js +1 -0
  176. package/apps/web/dist/assets/jsonnet-CJTPZ8u_.js +1 -0
  177. package/apps/web/dist/assets/jssm-DXw9l8Rf.js +1 -0
  178. package/apps/web/dist/assets/jsx-DLuxOqjU.js +1 -0
  179. package/apps/web/dist/assets/julia-CMgTtdec.js +1 -0
  180. package/apps/web/dist/assets/just-D_e2Cdol.js +1 -0
  181. package/apps/web/dist/assets/kanagawa-dragon-Bozd7klA.js +1 -0
  182. package/apps/web/dist/assets/kanagawa-lotus-BmuOG9ZW.js +1 -0
  183. package/apps/web/dist/assets/kanagawa-wave-BML5mF2J.js +1 -0
  184. package/apps/web/dist/assets/kdl-CsD5j6eV.js +1 -0
  185. package/apps/web/dist/assets/kotlin-DhhofPvG.js +1 -0
  186. package/apps/web/dist/assets/kusto-C7mF5XQf.js +1 -0
  187. package/apps/web/dist/assets/laserwave-C_8bwKvT.js +1 -0
  188. package/apps/web/dist/assets/latex-C7F9cbcZ.js +1 -0
  189. package/apps/web/dist/assets/lean-CewbzKMR.js +1 -0
  190. package/apps/web/dist/assets/less-DVTAwKKz.js +1 -0
  191. package/apps/web/dist/assets/light-plus-DVQuIRkW.js +1 -0
  192. package/apps/web/dist/assets/liquid-DZ0eHbL-.js +1 -0
  193. package/apps/web/dist/assets/llvm-DqHOMS-s.js +1 -0
  194. package/apps/web/dist/assets/log-BNLmms1o.js +1 -0
  195. package/apps/web/dist/assets/logo-Cluzi2Zq.js +1 -0
  196. package/apps/web/dist/assets/lua-DA_XbnYa.js +1 -0
  197. package/apps/web/dist/assets/luau-VGWVLoqX.js +1 -0
  198. package/apps/web/dist/assets/make-Dixweg8N.js +1 -0
  199. package/apps/web/dist/assets/markdown-BYOwaDjH.js +1 -0
  200. package/apps/web/dist/assets/marko-BOjbwMe_.js +1 -0
  201. package/apps/web/dist/assets/material-theme-Bm3Qr25_.js +1 -0
  202. package/apps/web/dist/assets/material-theme-darker-2IIEA8gg.js +1 -0
  203. package/apps/web/dist/assets/material-theme-lighter-uhdI0v04.js +1 -0
  204. package/apps/web/dist/assets/material-theme-ocean-CHQ94UKr.js +1 -0
  205. package/apps/web/dist/assets/material-theme-palenight-B5W6OYN7.js +1 -0
  206. package/apps/web/dist/assets/matlab-D7qyCx1q.js +1 -0
  207. package/apps/web/dist/assets/mdc-BLQdrSL9.js +1 -0
  208. package/apps/web/dist/assets/mdx-DQZ5AkYe.js +1 -0
  209. package/apps/web/dist/assets/mermaid-BxpfTIzt.js +1 -0
  210. package/apps/web/dist/assets/min-dark-BSWPekZh.js +1 -0
  211. package/apps/web/dist/assets/min-light-DDpmG2fV.js +1 -0
  212. package/apps/web/dist/assets/mipsasm-BMqwQI7S.js +1 -0
  213. package/apps/web/dist/assets/mojo-fg40_ntQ.js +1 -0
  214. package/apps/web/dist/assets/monokai-BscAjiQZ.js +1 -0
  215. package/apps/web/dist/assets/moonbit-D9W784E_.js +1 -0
  216. package/apps/web/dist/assets/move-BYnGhZoM.js +1 -0
  217. package/apps/web/dist/assets/narrat-_X_XdTYD.js +1 -0
  218. package/apps/web/dist/assets/nextflow-CSgcYZcx.js +1 -0
  219. package/apps/web/dist/assets/nextflow-groovy-D7IRt6Pp.js +1 -0
  220. package/apps/web/dist/assets/nginx-CRuAoyv9.js +1 -0
  221. package/apps/web/dist/assets/night-owl-DhmEMT88.js +1 -0
  222. package/apps/web/dist/assets/night-owl-light-eJ-hLW7d.js +1 -0
  223. package/apps/web/dist/assets/nim--m3L_KpX.js +1 -0
  224. package/apps/web/dist/assets/nix-IvuFDN5E.js +1 -0
  225. package/apps/web/dist/assets/nord-Cb4Vim4T.js +1 -0
  226. package/apps/web/dist/assets/nsis-CjNLYCLg.js +1 -0
  227. package/apps/web/dist/assets/nushell--0fT3PI1.js +1 -0
  228. package/apps/web/dist/assets/objective-c-D1A_Heim.js +1 -0
  229. package/apps/web/dist/assets/objective-cpp-BsSzOQcm.js +1 -0
  230. package/apps/web/dist/assets/ocaml-O90oeIOV.js +1 -0
  231. package/apps/web/dist/assets/odin-B1RWQWA5.js +1 -0
  232. package/apps/web/dist/assets/one-dark-pro-C6YyR8OD.js +1 -0
  233. package/apps/web/dist/assets/one-light-D7Lr4KcI.js +1 -0
  234. package/apps/web/dist/assets/openscad-BUDT5pXO.js +1 -0
  235. package/apps/web/dist/assets/org-BNxSv-BH.js +1 -0
  236. package/apps/web/dist/assets/pascal-4ZHwLPI5.js +1 -0
  237. package/apps/web/dist/assets/perl-DEB_cAoG.js +1 -0
  238. package/apps/web/dist/assets/php-Cei4P5ds.js +1 -0
  239. package/apps/web/dist/assets/pierre-dark-CpLgRqie.js +1 -0
  240. package/apps/web/dist/assets/pierre-dark-protanopia-deuteranopia-B35FxJx-.js +1 -0
  241. package/apps/web/dist/assets/pierre-dark-soft-kZQmAZld.js +1 -0
  242. package/apps/web/dist/assets/pierre-dark-tritanopia-CpjhbsIL.js +1 -0
  243. package/apps/web/dist/assets/pierre-dark-vibrant-CpQYzh95.js +1 -0
  244. package/apps/web/dist/assets/pierre-light-CoaEpmwp.js +1 -0
  245. package/apps/web/dist/assets/pierre-light-protanopia-deuteranopia-0fSaH845.js +1 -0
  246. package/apps/web/dist/assets/pierre-light-soft-lWLdNTOI.js +1 -0
  247. package/apps/web/dist/assets/pierre-light-tritanopia-CEbqgOJL.js +1 -0
  248. package/apps/web/dist/assets/pierre-light-vibrant-D80Fkn33.js +1 -0
  249. package/apps/web/dist/assets/pkl-ot-7Btpt.js +1 -0
  250. package/apps/web/dist/assets/plastic-DQwYfKfQ.js +1 -0
  251. package/apps/web/dist/assets/plsql-DGHpHOYJ.js +1 -0
  252. package/apps/web/dist/assets/po-BiJDBrnU.js +1 -0
  253. package/apps/web/dist/assets/poimandres-DRFjx7u4.js +1 -0
  254. package/apps/web/dist/assets/polar-C7UOKdEL.js +1 -0
  255. package/apps/web/dist/assets/postcss-BXeXVLqQ.js +1 -0
  256. package/apps/web/dist/assets/powerquery-DNMTfnFr.js +1 -0
  257. package/apps/web/dist/assets/powershell-QtSnmXcu.js +1 -0
  258. package/apps/web/dist/assets/prisma-DMgNhnYS.js +1 -0
  259. package/apps/web/dist/assets/prolog-iXnhIJG7.js +1 -0
  260. package/apps/web/dist/assets/proto-DB4EqR-F.js +1 -0
  261. package/apps/web/dist/assets/pug-BtkQ8Y8B.js +1 -0
  262. package/apps/web/dist/assets/puppet-CDv2pdJW.js +1 -0
  263. package/apps/web/dist/assets/purescript-9MfHhQsQ.js +1 -0
  264. package/apps/web/dist/assets/python-gzcpVVnB.js +1 -0
  265. package/apps/web/dist/assets/qml-yI-6sShm.js +1 -0
  266. package/apps/web/dist/assets/qmldir-DCQb3MpD.js +1 -0
  267. package/apps/web/dist/assets/qss-Fe1Jh2GI.js +1 -0
  268. package/apps/web/dist/assets/r-CJ8zo4yy.js +1 -0
  269. package/apps/web/dist/assets/racket-DcIDlBhZ.js +1 -0
  270. package/apps/web/dist/assets/raku-B3gFvitq.js +1 -0
  271. package/apps/web/dist/assets/razor-CTPI_hHO.js +1 -0
  272. package/apps/web/dist/assets/rbs-C0MpOrj4.js +1 -0
  273. package/apps/web/dist/assets/red-CYlAq2b0.js +1 -0
  274. package/apps/web/dist/assets/reg-CRGYupPL.js +1 -0
  275. package/apps/web/dist/assets/regexp-j43xPEIH.js +1 -0
  276. package/apps/web/dist/assets/rel-BtDbiS_P.js +1 -0
  277. package/apps/web/dist/assets/riscv-Ckw8ddFX.js +1 -0
  278. package/apps/web/dist/assets/ron-VUp2lXgN.js +1 -0
  279. package/apps/web/dist/assets/rose-pine-aMsaMD1D.js +1 -0
  280. package/apps/web/dist/assets/rose-pine-dawn-8PwUyIlP.js +1 -0
  281. package/apps/web/dist/assets/rose-pine-moon-DO-qXg-I.js +1 -0
  282. package/apps/web/dist/assets/rosmsg-CAekHB0j.js +1 -0
  283. package/apps/web/dist/assets/rst-CfIeFcNC.js +1 -0
  284. package/apps/web/dist/assets/ruby-CtmudUkS.js +1 -0
  285. package/apps/web/dist/assets/rust-DpiIf5JO.js +1 -0
  286. package/apps/web/dist/assets/sas-BBgd1Oa5.js +1 -0
  287. package/apps/web/dist/assets/sass-DXrisJhu.js +1 -0
  288. package/apps/web/dist/assets/scala-BiFt_7mu.js +1 -0
  289. package/apps/web/dist/assets/scheme-DQCgrYNe.js +1 -0
  290. package/apps/web/dist/assets/scss-BOSyZrIf.js +1 -0
  291. package/apps/web/dist/assets/sdbl-bTVj8UrX.js +1 -0
  292. package/apps/web/dist/assets/shaderlab-TOUzSsQk.js +1 -0
  293. package/apps/web/dist/assets/shellscript-BES_U9_l.js +1 -0
  294. package/apps/web/dist/assets/shellsession-CdF1AgdN.js +1 -0
  295. package/apps/web/dist/assets/slack-dark-DnToyrRv.js +1 -0
  296. package/apps/web/dist/assets/slack-ochin-B2OO5cIa.js +1 -0
  297. package/apps/web/dist/assets/smalltalk-BHpQb5nM.js +1 -0
  298. package/apps/web/dist/assets/smithy-Dgaz7aur.js +1 -0
  299. package/apps/web/dist/assets/snazzy-light-4G7pJPwS.js +1 -0
  300. package/apps/web/dist/assets/solarized-dark-b97czJOk.js +1 -0
  301. package/apps/web/dist/assets/solarized-light-DFPxpIYQ.js +1 -0
  302. package/apps/web/dist/assets/solidity-Bj7E1mRn.js +1 -0
  303. package/apps/web/dist/assets/soy-hqjXYWz3.js +1 -0
  304. package/apps/web/dist/assets/sparql-D_iOobhT.js +1 -0
  305. package/apps/web/dist/assets/splunk-BC2Px7Mm.js +1 -0
  306. package/apps/web/dist/assets/sql-D5hYy2r7.js +1 -0
  307. package/apps/web/dist/assets/ssh-config-BgfXC-Er.js +1 -0
  308. package/apps/web/dist/assets/stata-GNNI7e-r.js +1 -0
  309. package/apps/web/dist/assets/stylus-B6D30XZt.js +1 -0
  310. package/apps/web/dist/assets/surrealql-gm8__PDR.js +1 -0
  311. package/apps/web/dist/assets/svelte-DK6xQ-Vs.js +1 -0
  312. package/apps/web/dist/assets/swift-CyEgAFGc.js +1 -0
  313. package/apps/web/dist/assets/synthwave-84-nFMaYfgc.js +1 -0
  314. package/apps/web/dist/assets/system-verilog-Dh5ihWbf.js +1 -0
  315. package/apps/web/dist/assets/systemd-BxMlprV5.js +1 -0
  316. package/apps/web/dist/assets/talonscript-CohzipZa.js +1 -0
  317. package/apps/web/dist/assets/tasl-DMoTqEGO.js +1 -0
  318. package/apps/web/dist/assets/tcl-CZd0xW_V.js +1 -0
  319. package/apps/web/dist/assets/templ-Dy-PHEH0.js +1 -0
  320. package/apps/web/dist/assets/terraform-DswuEJGm.js +1 -0
  321. package/apps/web/dist/assets/tex-gYu3IM_T.js +1 -0
  322. package/apps/web/dist/assets/tokyo-night-oM2G3aXe.js +1 -0
  323. package/apps/web/dist/assets/toml-CcmNWLt0.js +1 -0
  324. package/apps/web/dist/assets/ts-tags-C8akqtaV.js +1 -0
  325. package/apps/web/dist/assets/tsv-sltzmVWM.js +1 -0
  326. package/apps/web/dist/assets/tsx-CtF99HYc.js +1 -0
  327. package/apps/web/dist/assets/turtle-ByJddavk.js +1 -0
  328. package/apps/web/dist/assets/twig-D7-O9s37.js +1 -0
  329. package/apps/web/dist/assets/typescript-o4QHcKOF.js +1 -0
  330. package/apps/web/dist/assets/typespec-BGhR2SqG.js +1 -0
  331. package/apps/web/dist/assets/typst-CsLzgkYX.js +1 -0
  332. package/apps/web/dist/assets/v-DBj4K9d_.js +1 -0
  333. package/apps/web/dist/assets/vala-zf12oZj6.js +1 -0
  334. package/apps/web/dist/assets/vb-DOwzaHZ0.js +1 -0
  335. package/apps/web/dist/assets/verilog-B2gwz-sJ.js +1 -0
  336. package/apps/web/dist/assets/vesper-DdrHHSXu.js +1 -0
  337. package/apps/web/dist/assets/vhdl-BroJfC0k.js +1 -0
  338. package/apps/web/dist/assets/viml-DvXPmvsu.js +1 -0
  339. package/apps/web/dist/assets/vitesse-black-fwtXNY1n.js +1 -0
  340. package/apps/web/dist/assets/vitesse-dark-BZCL-v6S.js +1 -0
  341. package/apps/web/dist/assets/vitesse-light-VbXTXTou.js +1 -0
  342. package/apps/web/dist/assets/vue-C67X0ZYE.js +1 -0
  343. package/apps/web/dist/assets/vue-html-3wcw93oK.js +1 -0
  344. package/apps/web/dist/assets/vue-vine-Bq8-4EKU.js +1 -0
  345. package/apps/web/dist/assets/vyper-CgoNMtux.js +1 -0
  346. package/apps/web/dist/assets/wasm-BnjxR4X6.js +1 -0
  347. package/apps/web/dist/assets/wasm-ByWQv1Qj.js +1 -0
  348. package/apps/web/dist/assets/wenyan-C8pVoKbM.js +1 -0
  349. package/apps/web/dist/assets/wgsl-BsKzXJz4.js +1 -0
  350. package/apps/web/dist/assets/wikitext-ClFFjSW2.js +1 -0
  351. package/apps/web/dist/assets/wit-DdvCle-K.js +1 -0
  352. package/apps/web/dist/assets/wolfram-DLL8P-h_.js +1 -0
  353. package/apps/web/dist/assets/xml-DXCI-6Wi.js +1 -0
  354. package/apps/web/dist/assets/xsl-Dr0qfgBg.js +1 -0
  355. package/apps/web/dist/assets/yaml-DHhOWIuf.js +1 -0
  356. package/apps/web/dist/assets/zenscript-BnlCZFoB.js +1 -0
  357. package/apps/web/dist/assets/zig-CMLA9XwU.js +1 -0
  358. package/apps/web/dist/index.html +17 -0
  359. package/apps/web/dist/sw.js +81 -0
  360. package/bin/offsite.js +2 -0
  361. package/package.json +19 -1
@@ -0,0 +1,402 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import { mkdirSync, statSync, writeFileSync } from 'node:fs';
3
+ import path from 'node:path';
4
+ import { decodeFrame, encodeFrame, FRAME_INPUT, FRAME_OUTPUT, FRAME_REPLAY, FRAME_REPLY, } from '../protocol.js';
5
+ import { pushActive, sendPush } from '../push.js';
6
+ import { home } from '../storage.js';
7
+ import { ALERT_DELAY, Alerts, Scanner } from './alerts.js';
8
+ import { busyProgram, currentDirectory, gitBranch, startShell, } from './process.js';
9
+ const HISTORY_LIMIT = 2 * 1024 * 1024;
10
+ const OUTPUT_LIMIT = 1024 * 1024;
11
+ const STALL_LIMIT = 10_000;
12
+ const SILENCE_LIMIT = 90_000;
13
+ const KILL_DELAY = 3000;
14
+ const pasteTypes = {
15
+ 'image/png': 'png',
16
+ 'image/jpeg': 'jpg',
17
+ 'image/gif': 'gif',
18
+ 'image/webp': 'webp',
19
+ };
20
+ const instance = `${Date.now()}-${randomUUID()}`;
21
+ const projects = new Map();
22
+ const terminals = new Map();
23
+ const connections = new Map();
24
+ const paused = new Set();
25
+ const branchFailures = new Set();
26
+ let nextTab = 0;
27
+ let draining = null;
28
+ let watching = false;
29
+ if (process.platform !== 'win32')
30
+ setInterval(() => void watchBranches(), 1000);
31
+ export async function terminalRequest(client, message) {
32
+ if (message.type === 'attach') {
33
+ attach(client);
34
+ return;
35
+ }
36
+ const connection = connections.get(client);
37
+ if (connection === undefined)
38
+ throw new Error('the terminal is not attached');
39
+ await request(connection, message);
40
+ }
41
+ export function terminalInput(client, frame) {
42
+ const connection = connections.get(client);
43
+ if (connection === undefined) {
44
+ console.warn('terminal input from a browser that is not attached');
45
+ return;
46
+ }
47
+ input(connection, frame);
48
+ }
49
+ export function detachTerminal(client) {
50
+ const connection = connections.get(client);
51
+ if (connection === undefined)
52
+ return;
53
+ connections.delete(client);
54
+ for (const terminal of terminals.values())
55
+ if (terminal.owner === connection)
56
+ terminal.owner = null;
57
+ }
58
+ export async function busyTerminal(id) {
59
+ const terminal = terminals.get(id);
60
+ if (terminal === undefined)
61
+ return { program: null };
62
+ try {
63
+ return { program: await busyProgram(terminal.pty.pid) };
64
+ }
65
+ catch (error) {
66
+ console.warn(`could not tell if terminal ${id} is busy: ${error}`);
67
+ return { error: String(error) };
68
+ }
69
+ }
70
+ export function savePastedImage(type, data) {
71
+ const extension = pasteTypes[type];
72
+ if (extension === undefined)
73
+ throw new Error('pasted image must be a PNG, JPEG, GIF or WebP image');
74
+ const directory = path.join(home, 'paste');
75
+ mkdirSync(directory, { recursive: true });
76
+ const file = path.join(directory, `${Date.now()}-${randomUUID()}.${extension}`);
77
+ writeFileSync(file, data);
78
+ return file;
79
+ }
80
+ function attach(client) {
81
+ detachTerminal(client);
82
+ const connection = { client, sizes: new Map() };
83
+ connections.set(client, connection);
84
+ send(connection, {
85
+ type: 'active',
86
+ layout: layout(),
87
+ instance,
88
+ branches: Object.fromEntries([...terminals].flatMap(([id, terminal]) => terminal.branch === null ? [] : [[id, terminal.branch]])),
89
+ });
90
+ for (const project of projects.values())
91
+ for (const tab of project.tabs)
92
+ forward(connection, tab.id, true, Buffer.concat(terminals.get(tab.id)?.history ?? []));
93
+ }
94
+ async function request(connection, message) {
95
+ switch (message.type) {
96
+ case 'resize': {
97
+ const terminal = terminals.get(message.id);
98
+ if (terminal === undefined)
99
+ return;
100
+ connection.sizes.set(message.id, {
101
+ cols: message.cols,
102
+ rows: message.rows,
103
+ });
104
+ terminal.owner = connection;
105
+ terminal.pty.resize(message.cols, message.rows);
106
+ return;
107
+ }
108
+ case 'createTab':
109
+ await createTab(message.cwd);
110
+ break;
111
+ case 'closeTab':
112
+ closeTab(message.id);
113
+ break;
114
+ case 'renameTab': {
115
+ const tab = findTab(message.id);
116
+ if (tab === undefined)
117
+ return;
118
+ tab.customName = message.name === '' ? null : message.name;
119
+ break;
120
+ }
121
+ case 'minimizeTab': {
122
+ const project = [...projects.values()].find((item) => item.tabs.some((tab) => tab.id === message.id));
123
+ if (project === undefined)
124
+ return;
125
+ if (!project.tabs.some((tab) => tab.id !== message.id && !tab.minimized))
126
+ return;
127
+ const index = project.tabs.findIndex((tab) => tab.id === message.id);
128
+ project.tabs[index].minimized = true;
129
+ if (project.activeTab === message.id) {
130
+ const next = nearestVisible(project.tabs, index);
131
+ project.activeTab = next === undefined ? null : project.tabs[next].id;
132
+ }
133
+ break;
134
+ }
135
+ case 'select': {
136
+ const project = projects.get(message.cwd) ?? {
137
+ tabs: [],
138
+ activeTab: null,
139
+ };
140
+ projects.set(message.cwd, project);
141
+ const tab = project.tabs.find((item) => item.id === message.tabId);
142
+ if (tab !== undefined) {
143
+ tab.minimized = false;
144
+ project.activeTab = tab.id;
145
+ }
146
+ if (project.tabs.length === 0)
147
+ await createTab(message.cwd);
148
+ break;
149
+ }
150
+ }
151
+ publish();
152
+ }
153
+ function input(connection, bytes) {
154
+ let frame;
155
+ try {
156
+ frame = decodeFrame(bytes);
157
+ }
158
+ catch (error) {
159
+ console.warn(`ignoring terminal input: ${error}`);
160
+ return;
161
+ }
162
+ const terminal = terminals.get(frame.id);
163
+ if (terminal === undefined) {
164
+ console.warn(`input for terminal ${frame.id}, which does not exist`);
165
+ return;
166
+ }
167
+ if (frame.kind === FRAME_REPLY) {
168
+ if (terminal.owner !== null && terminal.owner !== connection)
169
+ return;
170
+ }
171
+ else if (frame.kind === FRAME_INPUT) {
172
+ const size = connection.sizes.get(frame.id);
173
+ if (terminal.owner !== connection && size !== undefined) {
174
+ terminal.owner = connection;
175
+ terminal.pty.resize(size.cols, size.rows);
176
+ }
177
+ }
178
+ else {
179
+ console.warn(`ignoring terminal input of unknown kind ${frame.kind}`);
180
+ return;
181
+ }
182
+ terminal.pty.write(Buffer.from(frame.data));
183
+ }
184
+ async function createTab(cwd) {
185
+ if (!statSync(cwd, { throwIfNoEntry: false })?.isDirectory()) {
186
+ console.error(`${cwd} is not a folder, terminal not created`);
187
+ return;
188
+ }
189
+ const project = projects.get(cwd) ?? { tabs: [], activeTab: null };
190
+ projects.set(cwd, project);
191
+ const active = project.activeTab === null ? undefined : terminals.get(project.activeTab);
192
+ let directory = cwd;
193
+ if (active !== undefined) {
194
+ try {
195
+ directory = await currentDirectory(active.pty.pid);
196
+ }
197
+ catch (error) {
198
+ console.warn(`starting in the project folder, could not read the folder of the active terminal: ${error}`);
199
+ }
200
+ }
201
+ nextTab += 1;
202
+ const id = nextTab;
203
+ let pty;
204
+ try {
205
+ pty = startShell(directory);
206
+ }
207
+ catch (error) {
208
+ console.error(`could not start terminal ${id}: ${error}`);
209
+ return;
210
+ }
211
+ const terminal = {
212
+ pty,
213
+ history: [],
214
+ historySize: 0,
215
+ branch: null,
216
+ owner: null,
217
+ alerts: new Alerts(),
218
+ scanner: new Scanner(),
219
+ };
220
+ terminals.set(id, terminal);
221
+ project.tabs.push({ id, customName: null, minimized: false });
222
+ project.activeTab = id;
223
+ pty.onData((data) => output(id, terminal, data));
224
+ pty.onExit(() => {
225
+ terminals.delete(id);
226
+ paused.delete(pty);
227
+ branchFailures.delete(id);
228
+ if (closeTab(id))
229
+ publish();
230
+ });
231
+ }
232
+ function closeTab(id) {
233
+ const project = [...projects.values()].find((item) => item.tabs.some((tab) => tab.id === id));
234
+ if (project === undefined)
235
+ return false;
236
+ const index = project.tabs.findIndex((tab) => tab.id === id);
237
+ project.tabs.splice(index, 1);
238
+ if (project.activeTab === id) {
239
+ let next = nearestVisible(project.tabs, index);
240
+ if (next === undefined && project.tabs.length > 0)
241
+ next = Math.min(index, project.tabs.length - 1);
242
+ if (next !== undefined)
243
+ project.tabs[next].minimized = false;
244
+ project.activeTab = next === undefined ? null : project.tabs[next].id;
245
+ }
246
+ const terminal = terminals.get(id);
247
+ if (terminal === undefined)
248
+ return true;
249
+ terminal.pty.kill();
250
+ if (process.platform !== 'win32')
251
+ setTimeout(() => {
252
+ if (terminals.get(id) === terminal)
253
+ terminal.pty.kill('SIGKILL');
254
+ }, KILL_DELAY);
255
+ return true;
256
+ }
257
+ function output(id, terminal, data) {
258
+ terminal.history.push(data);
259
+ terminal.historySize += data.length;
260
+ while (terminal.historySize > HISTORY_LIMIT && terminal.history.length > 1) {
261
+ terminal.historySize -= terminal.history[0].length;
262
+ terminal.history.shift();
263
+ }
264
+ for (const connection of connections.values())
265
+ forward(connection, id, false, data);
266
+ scan(id, terminal, data);
267
+ if ([...connections.values()].some((connection) => connection.client.socket.bufferedAmount > OUTPUT_LIMIT)) {
268
+ terminal.pty.pause();
269
+ paused.add(terminal.pty);
270
+ draining ??= drain();
271
+ }
272
+ }
273
+ function drain() {
274
+ const progress = new Map();
275
+ return setInterval(() => {
276
+ let full = false;
277
+ for (const connection of connections.values()) {
278
+ const queued = connection.client.socket.bufferedAmount;
279
+ if (queued <= OUTPUT_LIMIT)
280
+ continue;
281
+ const now = Date.now();
282
+ const last = progress.get(connection) ?? { queued: Infinity, at: now };
283
+ if (queued < last.queued)
284
+ last.at = now;
285
+ last.queued = queued;
286
+ progress.set(connection, last);
287
+ if (now - last.at > STALL_LIMIT) {
288
+ console.warn('a browser is not reading fast enough, disconnecting it');
289
+ connection.client.socket.terminate();
290
+ continue;
291
+ }
292
+ full = true;
293
+ }
294
+ if (full)
295
+ return;
296
+ if (draining !== null)
297
+ clearInterval(draining);
298
+ draining = null;
299
+ for (const pty of paused)
300
+ pty.resume();
301
+ paused.clear();
302
+ }, 10);
303
+ }
304
+ function scan(id, terminal, data) {
305
+ if (!pushActive()) {
306
+ terminal.scanner = new Scanner();
307
+ return;
308
+ }
309
+ const alert = terminal.scanner.scan(data);
310
+ if (alert === null || browserOpen())
311
+ return;
312
+ const started = alert.type === 'bell'
313
+ ? terminal.alerts.startBell()
314
+ : terminal.alerts.startNotification();
315
+ if (!started)
316
+ return;
317
+ const windowTitle = terminal.scanner.title;
318
+ setTimeout(() => push(id, alert, windowTitle), ALERT_DELAY);
319
+ }
320
+ function push(id, alert, windowTitle) {
321
+ const terminal = terminals.get(id);
322
+ if (terminal === undefined)
323
+ return;
324
+ let title = '';
325
+ let body;
326
+ if (alert.type === 'bell') {
327
+ if (!terminal.alerts.finishBell())
328
+ return;
329
+ body = 'Bell';
330
+ }
331
+ else {
332
+ title = alert.title;
333
+ body = alert.body;
334
+ }
335
+ if (browserOpen())
336
+ return;
337
+ const entry = [...projects].find(([, project]) => project.tabs.some((tab) => tab.id === id));
338
+ if (entry === undefined)
339
+ return;
340
+ const tab = findTab(id);
341
+ if (title === '')
342
+ title = tab?.customName ?? (windowTitle || 'Terminal');
343
+ void sendPush({ title, body, cwd: entry[0], tabId: id });
344
+ }
345
+ function browserOpen() {
346
+ return [...connections.values()].some((connection) => Date.now() - connection.client.heardAt < SILENCE_LIMIT);
347
+ }
348
+ async function watchBranches() {
349
+ if (watching)
350
+ return;
351
+ watching = true;
352
+ for (const [id, terminal] of terminals) {
353
+ let branch;
354
+ try {
355
+ branch = await gitBranch(await currentDirectory(terminal.pty.pid));
356
+ }
357
+ catch (error) {
358
+ if (!branchFailures.has(id))
359
+ console.warn(`could not read the git branch of terminal ${id}: ${error}`);
360
+ branchFailures.add(id);
361
+ continue;
362
+ }
363
+ branchFailures.delete(id);
364
+ if (terminal.branch === branch || terminals.get(id) !== terminal)
365
+ continue;
366
+ terminal.branch = branch;
367
+ for (const connection of connections.values())
368
+ send(connection, { type: 'branch', id, branch });
369
+ }
370
+ watching = false;
371
+ }
372
+ function findTab(id) {
373
+ for (const project of projects.values()) {
374
+ const tab = project.tabs.find((item) => item.id === id);
375
+ if (tab !== undefined)
376
+ return tab;
377
+ }
378
+ return undefined;
379
+ }
380
+ function nearestVisible(tabs, index) {
381
+ for (let position = index; position < tabs.length; position++)
382
+ if (!tabs[position].minimized)
383
+ return position;
384
+ for (let position = Math.min(index, tabs.length) - 1; position >= 0; position--)
385
+ if (!tabs[position].minimized)
386
+ return position;
387
+ return undefined;
388
+ }
389
+ function layout() {
390
+ return Object.fromEntries(projects);
391
+ }
392
+ function publish() {
393
+ const event = { type: 'layout', layout: layout() };
394
+ for (const connection of connections.values())
395
+ send(connection, event);
396
+ }
397
+ function forward(connection, id, replay, data) {
398
+ connection.client.socket.send(encodeFrame(replay ? FRAME_REPLAY : FRAME_OUTPUT, id, data));
399
+ }
400
+ function send(connection, event) {
401
+ connection.client.send({ type: 'terminal', event });
402
+ }
@@ -0,0 +1,112 @@
1
+ __offsite_last=$_ __offsite_status=$? __offsite_values=("${PIPESTATUS[@]}")
2
+ builtin declare -a __offsite_last __offsite_status __offsite_errexit __offsite_running __offsite_ready __offsite_pipestatus __offsite_loop
3
+ builtin unset ENV
4
+ builtin export -n HISTFILE
5
+ builtin set +o posix
6
+ builtin shopt -u inherit_errexit 2>/dev/null
7
+ MAILCHECK=60
8
+ __offsite_errexit=0
9
+ __offsite_running=0
10
+ __offsite_ready=0
11
+ __offsite_ps1_mark=('' $'\001\e]6973;B\a\002')
12
+ __offsite_ps0_mark=('' $'\e]6973;C\a')
13
+ __offsite_ps1='${__offsite_ps1_mark+${__offsite_ps1_mark[${__offsite_ready-0}]-}}'
14
+ __offsite_ps0='${__offsite_ps0_mark[${__offsite_ready-0} ? (__offsite_running = 1, __offsite_ready = 0, 1) : 0]-}'
15
+ __offsite_trap='{ __offsite_returned; } 2>/dev/null'
16
+
17
+ __offsite_returned() {
18
+ __offsite_last=$_ __offsite_status=$? __offsite_values=("${PIPESTATUS[@]}")
19
+ if (( ${#BASH_SOURCE[@]} == 2 )) && [[ -o errexit ]]; then
20
+ __offsite_errexit=1
21
+ builtin set +e
22
+ fi
23
+ }
24
+
25
+ __offsite_return() {
26
+ builtin local index
27
+ __offsite_pipestatus=0
28
+ for index in "${!__offsite_values[@]}"; do
29
+ __offsite_pipestatus+=",PIPESTATUS[$index]=${__offsite_values[index]}"
30
+ done
31
+ builtin return "$__offsite_status"
32
+ }
33
+
34
+ __offsite_prompt() {
35
+ __offsite_status=$? __offsite_last=$1 __offsite_values=("${PIPESTATUS[@]}")
36
+ builtin local attributes
37
+ if [[ $__offsite_running == 1 ]]; then
38
+ builtin printf '\e]6973;D;%s\a' "$__offsite_status"
39
+ fi
40
+ builtin printf '\e]6973;A\a'
41
+ __offsite_running=0
42
+ __offsite_ready=0
43
+ if [[ -v PS1 && ${PS1@a} != *r* ]]; then
44
+ attributes=${PS1@a}
45
+ PS1=${PS1//"$__offsite_ps1"/}
46
+ if [[ $attributes != *x* ]]; then
47
+ if builtin shopt -q promptvars && [[ $PS1 != *\\ ]]; then
48
+ PS1+=$__offsite_ps1
49
+ __offsite_ready=1
50
+ fi
51
+ builtin export -n PS1
52
+ fi
53
+ fi
54
+ if [[ ! -v PS0 || ${PS0@a} != *r* ]]; then
55
+ attributes=
56
+ if [[ -v PS0 ]]; then
57
+ attributes=${PS0@a}
58
+ PS0=${PS0//"$__offsite_ps0"/}
59
+ fi
60
+ if [[ $attributes != *x* ]]; then
61
+ if (( __offsite_ready )) && [[ ${PS0-} != *\\ ]]; then
62
+ PS0+=$__offsite_ps0
63
+ fi
64
+ if [[ -v PS0 ]]; then
65
+ builtin export -n PS0
66
+ fi
67
+ fi
68
+ fi
69
+ if [[ ${PS0-} != *"$__offsite_ps0" ]]; then
70
+ __offsite_ready=0
71
+ fi
72
+ __offsite_return
73
+ }
74
+
75
+ __offsite_setup() {
76
+ builtin unset -f __offsite_returned __offsite_setup
77
+ builtin unset __offsite_trap
78
+ builtin local commands=${PROMPT_COMMAND-}
79
+ if (( BASH_VERSINFO[0] > 5 || (BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 1) )); then
80
+ commands=${PROMPT_COMMAND[*]-}
81
+ fi
82
+ if (( BASH_VERSINFO[0] > 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] >= 4) )) && [[ ! -v PROMPT_COMMAND || ${PROMPT_COMMAND@a} != *[rx]* ]] && [[ -n $commands || -z $1 ]]; then
83
+ PROMPT_COMMAND='for ((__offsite_loop = 1; __offsite_loop--; __offsite_pipestatus)); do __offsite_prompt "$_" && ((1)); done 2> /dev/null'${PROMPT_COMMAND:+"; $PROMPT_COMMAND"}
84
+ builtin export -n PROMPT_COMMAND
85
+ else
86
+ builtin unset -f __offsite_prompt
87
+ builtin unset __offsite_running __offsite_ready __offsite_ps1_mark __offsite_ps0_mark __offsite_ps1 __offsite_ps0
88
+ fi
89
+ if (( __offsite_errexit )); then
90
+ builtin set -e
91
+ fi
92
+ builtin unset __offsite_errexit
93
+ __offsite_return
94
+ }
95
+
96
+ builtin trap "$__offsite_trap" RETURN
97
+ if [[ -e /etc/profile ]]; then
98
+ builtin source /etc/profile
99
+ fi
100
+ if (( __offsite_errexit )); then
101
+ __offsite_errexit=0
102
+ builtin set -e
103
+ fi
104
+ if [[ -e $HOME/.bash_profile ]]; then
105
+ builtin source "$HOME/.bash_profile"
106
+ elif [[ -e $HOME/.bash_login ]]; then
107
+ builtin source "$HOME/.bash_login"
108
+ elif [[ -e $HOME/.profile ]]; then
109
+ builtin source "$HOME/.profile"
110
+ fi
111
+ if [[ $(builtin trap -p RETURN) == "trap -- '$__offsite_trap' RETURN" ]]; then builtin trap - RETURN; fi 2>/dev/null
112
+ for ((__offsite_loop = 1; __offsite_loop--; __offsite_pipestatus)); do __offsite_setup "$(builtin trap -p DEBUG)" "$__offsite_last" && ((1)); done 2>/dev/null
@@ -0,0 +1,22 @@
1
+ if status is-interactive
2
+ set --local native 0
3
+ if test (string match --regex '^\d+' -- $version) -ge 4
4
+ status test-feature mark-prompt
5
+ if test $status -ne 1
6
+ set native 1
7
+ end
8
+ end
9
+ if test $native = 0
10
+ function __offsite_prompt_start --on-event fish_prompt
11
+ printf '\e]6973;A\a'
12
+ end
13
+
14
+ function __offsite_output_start --on-event fish_preexec
15
+ printf '\e]6973;C\a'
16
+ end
17
+
18
+ function __offsite_output_end --on-event fish_postexec
19
+ printf '\e]6973;D;%s\a' $status
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,100 @@
1
+ __offsite_status=($?) __offsite_last=("$_")
2
+ __offsite_aliases=(${options[aliases]})
3
+ 'builtin' 'unsetopt' 'aliases'
4
+ builtin unset ZDOTDIR
5
+
6
+ if [[ -o interactive ]]; then
7
+ __offsite_install() {
8
+ {
9
+ builtin emulate -L zsh
10
+ __offsite_running=0
11
+ precmd_functions=(${precmd_functions:#__offsite_install} __offsite_precmd)
12
+ preexec_functions+=(__offsite_preexec)
13
+ if [[ ${widgets[zle-line-init]} == user:azhw:* ]] && (( $+functions[add-zle-hook-widget] )); then
14
+ add-zle-hook-widget zle-line-init __offsite_line_init
15
+ else
16
+ if (( $+widgets[zle-line-init] )); then
17
+ builtin zle -A zle-line-init __offsite_line_init_original
18
+ fi
19
+ builtin zle -N zle-line-init __offsite_line_init
20
+ fi
21
+ __offsite_precmd
22
+ } 2>/dev/null
23
+ }
24
+
25
+ __offsite_precmd() {
26
+ {
27
+ builtin local exit_status=$?
28
+ builtin emulate -L zsh
29
+ if builtin zle; then
30
+ builtin return
31
+ fi
32
+ if (( __offsite_running )); then
33
+ builtin print -n "\e]6973;D;${exit_status}\a"
34
+ fi
35
+ __offsite_running=0
36
+ builtin print -n '\e]6973;A\a'
37
+ } 2>/dev/null
38
+ }
39
+
40
+ __offsite_preexec() {
41
+ {
42
+ builtin emulate -L zsh
43
+ builtin print -n '\e]6973;C\a'
44
+ __offsite_running=1
45
+ } 2>/dev/null
46
+ }
47
+
48
+ __offsite_line_init() {
49
+ if [[ $CONTEXT == start ]]; then
50
+ builtin print -n '\e]6973;B\a'
51
+ fi
52
+ if (( ${+widgets[__offsite_line_init_original]} )); then
53
+ builtin zle __offsite_line_init_original -N -- "$@"
54
+ fi
55
+ }
56
+ fi
57
+
58
+ {
59
+ {
60
+ __offsite_argzero=(0)
61
+ if [[ $__offsite_aliases == on ]]; then
62
+ builtin setopt aliases
63
+ fi
64
+ if [[ -r "$HOME/.zshenv" ]]; then
65
+ __offsite_file=("${(%):-%x}")
66
+ if [[ -o function_argzero ]]; then
67
+ __offsite_argzero=(1)
68
+ builtin unsetopt function_argzero
69
+ builtin trap 'if [[ ${(%):-%x} != "$__offsite_file" ]]; then __offsite_argzero=(0); builtin setopt function_argzero; builtin trap - DEBUG; fi' DEBUG
70
+ fi
71
+ () { builtin return $__offsite_status; } && builtin :
72
+ builtin source "$HOME/.zshenv"
73
+ () {
74
+ __offsite_status=($1) __offsite_last=("$2")
75
+ } $? "$_" 2>/dev/null
76
+ {
77
+ builtin return $__offsite_status
78
+ } 2>/dev/null
79
+ fi
80
+ builtin return $__offsite_status
81
+ } always {
82
+ {
83
+ () {
84
+ builtin emulate -L zsh
85
+ TRY_BLOCK_ERROR=0
86
+ if [[ -o interactive ]]; then
87
+ precmd_functions+=(__offsite_install)
88
+ fi
89
+ }
90
+ if (( __offsite_argzero )); then
91
+ builtin setopt function_argzero
92
+ builtin trap - DEBUG
93
+ fi
94
+ () {
95
+ builtin unset __offsite_file __offsite_argzero __offsite_aliases __offsite_status __offsite_last
96
+ } "$__offsite_last"
97
+ } 2>/dev/null
98
+ }
99
+ { :; : ${__offsite_status:?}; } 2>/dev/null
100
+ }