clikcode 1.0.3 → 1.0.5
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.
- package/README.md +25 -14
- package/dist/chunk-23TDEBGZ.js +71 -0
- package/dist/chunk-25T3GVS7.js +425 -0
- package/dist/chunk-2BBELGHY.js +11 -0
- package/dist/chunk-2EOL5PZL.js +208 -0
- package/dist/chunk-2GAB36IE.js +26 -0
- package/dist/chunk-2OLS7V66.js +2440 -0
- package/dist/chunk-2QFO2URB.js +179 -0
- package/dist/chunk-2QWPQRSU.js +254 -0
- package/dist/chunk-2YPAPAR3.js +184 -0
- package/dist/chunk-2ZAG5372.js +33 -0
- package/dist/chunk-32IKAIZC.js +12507 -0
- package/dist/chunk-34AZEGYW.js +95 -0
- package/dist/chunk-34JQYQCA.js +175 -0
- package/dist/chunk-34ZISPAO.js +67 -0
- package/dist/chunk-3AAAARE6.js +46 -0
- package/dist/chunk-3AJ6Q3OY.js +510 -0
- package/dist/chunk-3B2CHX7M.js +884 -0
- package/dist/chunk-3BUFORRX.js +59 -0
- package/dist/chunk-3QLHYYFK.js +30 -0
- package/dist/chunk-3RXBMYKZ.js +140 -0
- package/dist/chunk-3TFNIJWS.js +52 -0
- package/dist/chunk-3W3IPDFP.js +119 -0
- package/dist/chunk-3WMS7SEE.js +417 -0
- package/dist/chunk-435ZNSZ3.js +23 -0
- package/dist/chunk-4AQ5NINV.js +39 -0
- package/dist/chunk-4GVEJ5FK.js +168 -0
- package/dist/chunk-4GXAO3UY.js +262 -0
- package/dist/chunk-4L2ZZM4Q.js +332 -0
- package/dist/chunk-4LPDG57B.js +17 -0
- package/dist/chunk-4NN3XQQT.js +223 -0
- package/dist/chunk-4QZEZME7.js +54 -0
- package/dist/chunk-4R6CSC3S.js +38 -0
- package/dist/chunk-4RHXTL3W.js +514 -0
- package/dist/chunk-4SJMPTVQ.js +18 -0
- package/dist/chunk-4VY7G6TX.js +114 -0
- package/dist/chunk-5642PBF7.js +124 -0
- package/dist/chunk-5B6TVO4A.js +33 -0
- package/dist/chunk-5BJLDUPL.js +62 -0
- package/dist/chunk-5HMFFJWU.js +19 -0
- package/dist/chunk-5IKLK33T.js +69 -0
- package/dist/chunk-5NQ5FFMX.js +44 -0
- package/dist/chunk-5QNNW5L6.js +176 -0
- package/dist/chunk-5SM5UAWN.js +239 -0
- package/dist/chunk-5WYJTA6O.js +74 -0
- package/dist/chunk-5ZSR2Y5T.js +227 -0
- package/dist/chunk-5ZWUM5GH.js +39 -0
- package/dist/chunk-64E7D4HY.js +364 -0
- package/dist/chunk-6CK466BC.js +99 -0
- package/dist/chunk-6ES45HHO.js +138 -0
- package/dist/chunk-6HYEZFGL.js +277 -0
- package/dist/chunk-6Y7HLXGW.js +29 -0
- package/dist/chunk-6YKK4FYR.js +258 -0
- package/dist/chunk-74WNMLMS.js +117 -0
- package/dist/chunk-7AULZ7OD.js +55 -0
- package/dist/chunk-7DOKGSUN.js +101 -0
- package/dist/chunk-7IH5LTIZ.js +195 -0
- package/dist/chunk-7ISTS5NS.js +21 -0
- package/dist/chunk-7NMUTGOW.js +527 -0
- package/dist/chunk-7PNHUZEL.js +153 -0
- package/dist/chunk-7TSQLONI.js +88 -0
- package/dist/chunk-AE7TOLD5.js +30 -0
- package/dist/chunk-AEMHSXKA.js +130 -0
- package/dist/chunk-AKRYTS2D.js +211 -0
- package/dist/chunk-AMNSE36L.js +59 -0
- package/dist/chunk-AZVD74ZV.js +23 -0
- package/dist/chunk-B35DVOTK.js +1981 -0
- package/dist/chunk-B4HNJRAH.js +626 -0
- package/dist/chunk-B5WYPPHS.js +13 -0
- package/dist/chunk-BBOVDXQM.js +59 -0
- package/dist/chunk-BD3ECZLK.js +62 -0
- package/dist/chunk-BDGSOT74.js +4578 -0
- package/dist/chunk-BF5VEOPK.js +31 -0
- package/dist/chunk-BFFRW4XH.js +47 -0
- package/dist/chunk-BFPC6PEW.js +208 -0
- package/dist/chunk-BGEMY2JJ.js +376 -0
- package/dist/chunk-BISGNHKD.js +35 -0
- package/dist/chunk-BMRAEBRY.js +21 -0
- package/dist/chunk-BNTXAZXW.js +127 -0
- package/dist/chunk-BOQBXGSN.js +75 -0
- package/dist/chunk-BTJDSTQP.js +213 -0
- package/dist/chunk-BUOPJQP5.js +218 -0
- package/dist/chunk-BXFJS65Q.js +52 -0
- package/dist/chunk-BXPQFSX5.js +59 -0
- package/dist/chunk-C57LIWNY.js +1269 -0
- package/dist/chunk-C6YVCCWR.js +74 -0
- package/dist/chunk-CAADDF6M.js +167 -0
- package/dist/chunk-CBANJFBO.js +69 -0
- package/dist/chunk-CERF3RIB.js +597 -0
- package/dist/chunk-COAS5ETR.js +46 -0
- package/dist/chunk-CQ7J6UQ7.js +78 -0
- package/dist/chunk-CRUVYGO2.js +26 -0
- package/dist/chunk-CVFVFRGN.js +58 -0
- package/dist/chunk-D2UK66HM.js +37 -0
- package/dist/chunk-D2W7SA4R.js +18 -0
- package/dist/chunk-DA44ZENT.js +501 -0
- package/dist/chunk-DAJ76TOC.js +99 -0
- package/dist/chunk-DCZ6CIUM.js +147 -0
- package/dist/chunk-DF35KMXM.js +1314 -0
- package/dist/chunk-DGASQT26.js +151 -0
- package/dist/chunk-DJT57C5P.js +55 -0
- package/dist/chunk-DKDPZTD3.js +44 -0
- package/dist/chunk-DQYVQ2N7.js +77 -0
- package/dist/chunk-DRTP2RTY.js +266 -0
- package/dist/chunk-DW2BMUKY.js +61 -0
- package/dist/chunk-DW5T5ZVU.js +307 -0
- package/dist/chunk-DXKNDNFC.js +164 -0
- package/dist/chunk-DZEQ7UYR.js +291 -0
- package/dist/chunk-E4F4OUAC.js +463 -0
- package/dist/chunk-EE4B6A7W.js +69 -0
- package/dist/chunk-EISKIYWG.js +23 -0
- package/dist/chunk-EKAQK7UQ.js +235 -0
- package/dist/chunk-EOBTJV32.js +123 -0
- package/dist/chunk-ESF3DIZY.js +325 -0
- package/dist/chunk-EVOHOZ4U.js +45 -0
- package/dist/chunk-EXN4KHLB.js +110 -0
- package/dist/chunk-F252T6Y3.js +78 -0
- package/dist/chunk-F3DP4ZA2.js +40 -0
- package/dist/chunk-F6F47QAY.js +58 -0
- package/dist/chunk-FA3Y23ZW.js +57 -0
- package/dist/chunk-FBKXE4EJ.js +640 -0
- package/dist/chunk-FCGEB3H6.js +23 -0
- package/dist/chunk-FF7ZVYJF.js +3732 -0
- package/dist/chunk-FFGKN6L3.js +39 -0
- package/dist/chunk-FFGU4GCC.js +94 -0
- package/dist/chunk-FSFDAOVP.js +74 -0
- package/dist/chunk-FT5TX7OX.js +1573 -0
- package/dist/chunk-G3QP67Z7.js +232 -0
- package/dist/chunk-G5ORJKV2.js +179 -0
- package/dist/chunk-GFNC62PE.js +111 -0
- package/dist/chunk-GGK43Q3N.js +67 -0
- package/dist/chunk-GGYKY4GF.js +11537 -0
- package/dist/chunk-GGYNHGNJ.js +55 -0
- package/dist/chunk-GLY7RM3C.js +354 -0
- package/dist/chunk-GQBZU6EO.js +20 -0
- package/dist/chunk-GSXENUZL.js +9 -0
- package/dist/chunk-GTOAT5D3.js +40 -0
- package/dist/chunk-GWCMDPQU.js +1007 -0
- package/dist/chunk-GXYSMYHJ.js +152 -0
- package/dist/chunk-GYMAI5NY.js +14 -0
- package/dist/chunk-H2VZMKPE.js +30 -0
- package/dist/chunk-H4THUNBM.js +2091 -0
- package/dist/chunk-HGRVSNUZ.js +361 -0
- package/dist/chunk-HI4VY473.js +27 -0
- package/dist/chunk-HOJRSD3Q.js +447 -0
- package/dist/chunk-HRX25W35.js +82 -0
- package/dist/chunk-HSE4AQYV.js +55 -0
- package/dist/chunk-HU5SSUFX.js +383 -0
- package/dist/chunk-I3GDBJLH.js +196 -0
- package/dist/chunk-I75EDU75.js +684 -0
- package/dist/chunk-IBA7DMIO.js +20 -0
- package/dist/chunk-IC6N4NZA.js +231 -0
- package/dist/chunk-IF43HIGV.js +284 -0
- package/dist/chunk-IGZ6C2MC.js +439 -0
- package/dist/chunk-IMLTL2MY.js +192 -0
- package/dist/chunk-IMZL6SGR.js +33 -0
- package/dist/chunk-IS4USJPY.js +516 -0
- package/dist/chunk-ISFSPN2F.js +82 -0
- package/dist/chunk-IXE7GTFI.js +55 -0
- package/dist/chunk-IZ77QJQG.js +36 -0
- package/dist/chunk-J2PACWRQ.js +34 -0
- package/dist/chunk-J6EGFVQX.js +180 -0
- package/dist/chunk-JEKOD43D.js +22 -0
- package/dist/chunk-JGIWATSG.js +30 -0
- package/dist/chunk-JYBONKD4.js +43 -0
- package/dist/chunk-K2NLG2HK.js +454 -0
- package/dist/chunk-KCQ4TBLS.js +164 -0
- package/dist/chunk-KD5KIVMS.js +176 -0
- package/dist/chunk-KHW6TX6I.js +63 -0
- package/dist/chunk-KI5GZFCE.js +520 -0
- package/dist/chunk-KN34B7NO.js +105 -0
- package/dist/chunk-KYUHIFP3.js +136 -0
- package/dist/chunk-KZL5VS4B.js +300 -0
- package/dist/chunk-L3VW3QIH.js +48 -0
- package/dist/chunk-LA6MG4ET.js +2110 -0
- package/dist/chunk-LAVFOA3S.js +66 -0
- package/dist/chunk-LB4OA77N.js +13 -0
- package/dist/chunk-LBFRF2K4.js +196 -0
- package/dist/chunk-LM6EIA4B.js +93 -0
- package/dist/chunk-LPCNRGJ7.js +692 -0
- package/dist/chunk-LSLNL5T3.js +168 -0
- package/dist/chunk-LVRRWP4W.js +568 -0
- package/dist/chunk-LWCFBRHL.js +33 -0
- package/dist/chunk-LXFTMGZZ.js +166 -0
- package/dist/chunk-M33LVA4M.js +151 -0
- package/dist/chunk-M3FO5UMK.js +4944 -0
- package/dist/chunk-M5QNDBAY.js +66 -0
- package/dist/chunk-M6ND6KBE.js +1291 -0
- package/dist/chunk-M7H3WQTE.js +76 -0
- package/dist/chunk-MCBRVPA7.js +191 -0
- package/dist/chunk-MCSDWZET.js +91 -0
- package/dist/chunk-MDT5XDXL.js +289 -0
- package/dist/chunk-MJG3IQY4.js +91 -0
- package/dist/chunk-MOU3N2UL.js +44 -0
- package/dist/chunk-MP4KZOQC.js +3451 -0
- package/dist/chunk-MPAJ446F.js +66 -0
- package/dist/chunk-MVJZZ6AL.js +16 -0
- package/dist/chunk-MXS6S2PY.js +253 -0
- package/dist/chunk-N3SFDYM7.js +291 -0
- package/dist/chunk-NAOX3JUB.js +13 -0
- package/dist/chunk-NEKKIBCX.js +283 -0
- package/dist/chunk-NKDATMEM.js +133 -0
- package/dist/chunk-NR4FMC4K.js +395 -0
- package/dist/chunk-NSOHOJBR.js +221 -0
- package/dist/chunk-NTDB6QKF.js +29 -0
- package/dist/chunk-NWEYRBWK.js +25 -0
- package/dist/chunk-O2YSNYWD.js +23 -0
- package/dist/chunk-O3EW7LAY.js +54 -0
- package/dist/chunk-O7BNJIXU.js +366 -0
- package/dist/chunk-OARL2NXZ.js +116 -0
- package/dist/chunk-OHKZUEJW.js +351 -0
- package/dist/chunk-OKU45BXA.js +647 -0
- package/dist/chunk-OL4JBD3J.js +59 -0
- package/dist/chunk-OLUO5DDR.js +192 -0
- package/dist/chunk-OQ245JLA.js +196 -0
- package/dist/chunk-P72UZAQI.js +289 -0
- package/dist/chunk-PAL2ENB6.js +20 -0
- package/dist/chunk-PAXYQZH7.js +53 -0
- package/dist/chunk-PDPEM5VW.js +51 -0
- package/dist/chunk-PEWCDI2C.js +668 -0
- package/dist/chunk-PGZ54EDX.js +27 -0
- package/dist/chunk-PRWVLDZF.js +73 -0
- package/dist/chunk-PSQQ75VJ.js +52 -0
- package/dist/chunk-PUOVIFHW.js +118 -0
- package/dist/chunk-PWBF2X3V.js +107 -0
- package/dist/chunk-PWXII6HF.js +43 -0
- package/dist/chunk-Q35VLJRT.js +80 -0
- package/dist/chunk-QJP7EYGL.js +128 -0
- package/dist/chunk-QPQKX2MK.js +8836 -0
- package/dist/chunk-QQRLPY25.js +1053 -0
- package/dist/chunk-QUS4ER2W.js +407 -0
- package/dist/chunk-QYHI3YET.js +29 -0
- package/dist/chunk-QYRU2UQI.js +32 -0
- package/dist/chunk-R6XVVQGC.js +13 -0
- package/dist/chunk-R7QN6ONS.js +483 -0
- package/dist/chunk-RD23MPGC.js +221 -0
- package/dist/chunk-RDDWQBEM.js +185 -0
- package/dist/chunk-RDLLDYFO.js +104 -0
- package/dist/chunk-RE4TGORR.js +84 -0
- package/dist/chunk-RJLHVYQY.js +217 -0
- package/dist/chunk-RJLPTWHW.js +905 -0
- package/dist/chunk-RKUVLRZI.js +295 -0
- package/dist/chunk-ROGXPGYR.js +37 -0
- package/dist/chunk-RSZGEL5U.js +163 -0
- package/dist/chunk-RVUOIJXN.js +909 -0
- package/dist/chunk-RW7F4JRP.js +11 -0
- package/dist/chunk-S4UO3AO3.js +53 -0
- package/dist/chunk-S5JAAF6S.js +585 -0
- package/dist/chunk-SNU37TQI.js +56 -0
- package/dist/chunk-SQVUDO2O.js +31 -0
- package/dist/chunk-SYVHIYQT.js +66 -0
- package/dist/chunk-SZBQMTG2.js +85 -0
- package/dist/chunk-T5VCXA3J.js +25 -0
- package/dist/chunk-TK6NSP56.js +30 -0
- package/dist/chunk-TKWVMA6L.js +22 -0
- package/dist/chunk-TQDKJHWX.js +59 -0
- package/dist/chunk-TQDM7S5N.js +127 -0
- package/dist/chunk-TULAXS77.js +23 -0
- package/dist/chunk-TVT45XNH.js +4625 -0
- package/dist/chunk-TWCVV2JO.js +467 -0
- package/dist/chunk-U4DKAD6S.js +47 -0
- package/dist/chunk-UA5K2BTI.js +564 -0
- package/dist/chunk-UAMKCMOK.js +40 -0
- package/dist/chunk-UBMVADBF.js +51 -0
- package/dist/chunk-UFQ5A5PW.js +645 -0
- package/dist/chunk-UOD2SOLL.js +1301 -0
- package/dist/chunk-UTSB4LOW.js +156 -0
- package/dist/chunk-UVXNIUTN.js +412 -0
- package/dist/chunk-UXVPXYPE.js +90 -0
- package/dist/chunk-UYEEMIWR.js +374 -0
- package/dist/chunk-VBGM5ZBW.js +54 -0
- package/dist/chunk-VEWPCZPG.js +762 -0
- package/dist/chunk-VIRDLZ5E.js +108 -0
- package/dist/chunk-VMPO7WKN.js +52 -0
- package/dist/chunk-W2NVSDO5.js +5122 -0
- package/dist/chunk-W3YYPBEA.js +176 -0
- package/dist/chunk-W5AYOICN.js +280 -0
- package/dist/chunk-W5GZOIUF.js +27 -0
- package/dist/chunk-WHKNLZ3C.js +76 -0
- package/dist/chunk-WKBEPPQ5.js +1409 -0
- package/dist/chunk-WM3Z6QKQ.js +151 -0
- package/dist/chunk-WMI2TPMA.js +31 -0
- package/dist/chunk-WNX5VD7S.js +150 -0
- package/dist/chunk-WOVTYST3.js +60 -0
- package/dist/chunk-WPB5WEZJ.js +546 -0
- package/dist/chunk-WUO5EOAT.js +44 -0
- package/dist/chunk-WWLJMP6D.js +133 -0
- package/dist/chunk-WZMLH3XP.js +58 -0
- package/dist/chunk-WZYVLUVQ.js +79 -0
- package/dist/chunk-X2OCPVU5.js +135 -0
- package/dist/chunk-X3CL6DTR.js +95 -0
- package/dist/chunk-X6WF7JEV.js +354 -0
- package/dist/chunk-XAHGBPWT.js +44 -0
- package/dist/chunk-XCKQ5BM2.js +228 -0
- package/dist/chunk-XIBYREEY.js +106 -0
- package/dist/chunk-XKW5NDMR.js +378 -0
- package/dist/chunk-XRDALAO3.js +100 -0
- package/dist/chunk-XUP22EAS.js +41 -0
- package/dist/chunk-XWAC3MKW.js +243 -0
- package/dist/chunk-Y3R7JMXB.js +59 -0
- package/dist/chunk-Y54LTP4W.js +82 -0
- package/dist/chunk-Y7UECI4M.js +99 -0
- package/dist/chunk-YACGDFHC.js +47 -0
- package/dist/chunk-YHNIQPKY.js +71 -0
- package/dist/chunk-YMBR6HYP.js +111 -0
- package/dist/chunk-YMCH3L2S.js +26 -0
- package/dist/chunk-Z4ZU6T7V.js +99 -0
- package/dist/chunk-ZDPF67ZZ.js +173 -0
- package/dist/chunk-ZFC2Q67K.js +101 -0
- package/dist/chunk-ZGHNNSCT.js +114 -0
- package/dist/chunk-ZGX3ERAT.js +173 -0
- package/dist/chunk-ZI3YHEBY.js +37 -0
- package/dist/chunk-ZN7G6JLS.js +639 -0
- package/dist/chunk-ZNPFQMXT.js +47 -0
- package/dist/chunk-ZOU3LV4U.js +63 -0
- package/dist/chunk-ZT7B4H2V.js +117 -0
- package/dist/chunk-ZZCBDNZI.js +58 -0
- package/dist/cli.js +498 -112593
- package/dist/computer-tools.js +36642 -21258
- package/dist/harness-catalog.cjs +88 -43
- package/dist/index.js +1 -1
- package/dist/local-model-supervisor.cjs +555 -0
- package/package.json +3 -4
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import { createRequire as __clikcodeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __clikcodeCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
BUILD_WATCH_MS,
|
|
5
|
+
RETIRE_QUIET_MS
|
|
6
|
+
} from "./chunk-RW7F4JRP.js";
|
|
7
|
+
import {
|
|
8
|
+
IdeBridge,
|
|
9
|
+
captureStdout,
|
|
10
|
+
ideInstallReporter
|
|
11
|
+
} from "./chunk-B35DVOTK.js";
|
|
12
|
+
import "./chunk-WKBEPPQ5.js";
|
|
13
|
+
import "./chunk-PAL2ENB6.js";
|
|
14
|
+
import "./chunk-Y7UECI4M.js";
|
|
15
|
+
import "./chunk-LPCNRGJ7.js";
|
|
16
|
+
import "./chunk-5ZSR2Y5T.js";
|
|
17
|
+
import {
|
|
18
|
+
IDE_PROTOCOL
|
|
19
|
+
} from "./chunk-VEWPCZPG.js";
|
|
20
|
+
import "./chunk-O2YSNYWD.js";
|
|
21
|
+
import "./chunk-X6WF7JEV.js";
|
|
22
|
+
import "./chunk-IC6N4NZA.js";
|
|
23
|
+
import "./chunk-6CK466BC.js";
|
|
24
|
+
import "./chunk-Z4ZU6T7V.js";
|
|
25
|
+
import "./chunk-UFQ5A5PW.js";
|
|
26
|
+
import "./chunk-AZVD74ZV.js";
|
|
27
|
+
import "./chunk-KD5KIVMS.js";
|
|
28
|
+
import "./chunk-ZGHNNSCT.js";
|
|
29
|
+
import "./chunk-S5JAAF6S.js";
|
|
30
|
+
import "./chunk-COAS5ETR.js";
|
|
31
|
+
import "./chunk-H4THUNBM.js";
|
|
32
|
+
import "./chunk-5642PBF7.js";
|
|
33
|
+
import "./chunk-OKU45BXA.js";
|
|
34
|
+
import "./chunk-EKAQK7UQ.js";
|
|
35
|
+
import "./chunk-32IKAIZC.js";
|
|
36
|
+
import "./chunk-Y3R7JMXB.js";
|
|
37
|
+
import "./chunk-E4F4OUAC.js";
|
|
38
|
+
import "./chunk-OHKZUEJW.js";
|
|
39
|
+
import "./chunk-M6ND6KBE.js";
|
|
40
|
+
import "./chunk-LM6EIA4B.js";
|
|
41
|
+
import "./chunk-WZMLH3XP.js";
|
|
42
|
+
import "./chunk-UVXNIUTN.js";
|
|
43
|
+
import "./chunk-RDLLDYFO.js";
|
|
44
|
+
import "./chunk-74WNMLMS.js";
|
|
45
|
+
import "./chunk-GLY7RM3C.js";
|
|
46
|
+
import "./chunk-M7H3WQTE.js";
|
|
47
|
+
import "./chunk-QPQKX2MK.js";
|
|
48
|
+
import "./chunk-X2OCPVU5.js";
|
|
49
|
+
import "./chunk-ROGXPGYR.js";
|
|
50
|
+
import "./chunk-T5VCXA3J.js";
|
|
51
|
+
import "./chunk-BTJDSTQP.js";
|
|
52
|
+
import "./chunk-W2NVSDO5.js";
|
|
53
|
+
import "./chunk-EXN4KHLB.js";
|
|
54
|
+
import "./chunk-BNTXAZXW.js";
|
|
55
|
+
import "./chunk-LAVFOA3S.js";
|
|
56
|
+
import "./chunk-2GAB36IE.js";
|
|
57
|
+
import "./chunk-WOVTYST3.js";
|
|
58
|
+
import "./chunk-3RXBMYKZ.js";
|
|
59
|
+
import "./chunk-34JQYQCA.js";
|
|
60
|
+
import "./chunk-JYBONKD4.js";
|
|
61
|
+
import "./chunk-MCSDWZET.js";
|
|
62
|
+
import "./chunk-BOQBXGSN.js";
|
|
63
|
+
import "./chunk-DAJ76TOC.js";
|
|
64
|
+
import "./chunk-KCQ4TBLS.js";
|
|
65
|
+
import "./chunk-FBKXE4EJ.js";
|
|
66
|
+
import "./chunk-DW2BMUKY.js";
|
|
67
|
+
import "./chunk-B4HNJRAH.js";
|
|
68
|
+
import "./chunk-OQ245JLA.js";
|
|
69
|
+
import "./chunk-25T3GVS7.js";
|
|
70
|
+
import "./chunk-4GXAO3UY.js";
|
|
71
|
+
import "./chunk-SNU37TQI.js";
|
|
72
|
+
import "./chunk-XAHGBPWT.js";
|
|
73
|
+
import "./chunk-ZOU3LV4U.js";
|
|
74
|
+
import "./chunk-LBFRF2K4.js";
|
|
75
|
+
import "./chunk-J6EGFVQX.js";
|
|
76
|
+
import "./chunk-FT5TX7OX.js";
|
|
77
|
+
import "./chunk-7NMUTGOW.js";
|
|
78
|
+
import "./chunk-FFGU4GCC.js";
|
|
79
|
+
import "./chunk-DXKNDNFC.js";
|
|
80
|
+
import "./chunk-RJLPTWHW.js";
|
|
81
|
+
import "./chunk-2EOL5PZL.js";
|
|
82
|
+
import "./chunk-MDT5XDXL.js";
|
|
83
|
+
import "./chunk-UYEEMIWR.js";
|
|
84
|
+
import "./chunk-TVT45XNH.js";
|
|
85
|
+
import "./chunk-K2NLG2HK.js";
|
|
86
|
+
import "./chunk-EOBTJV32.js";
|
|
87
|
+
import "./chunk-7AULZ7OD.js";
|
|
88
|
+
import "./chunk-UA5K2BTI.js";
|
|
89
|
+
import "./chunk-IF43HIGV.js";
|
|
90
|
+
import "./chunk-7TSQLONI.js";
|
|
91
|
+
import "./chunk-2YPAPAR3.js";
|
|
92
|
+
import "./chunk-DGASQT26.js";
|
|
93
|
+
import "./chunk-PUOVIFHW.js";
|
|
94
|
+
import "./chunk-WNX5VD7S.js";
|
|
95
|
+
import "./chunk-34AZEGYW.js";
|
|
96
|
+
import "./chunk-UTSB4LOW.js";
|
|
97
|
+
import "./chunk-WM3Z6QKQ.js";
|
|
98
|
+
import "./chunk-LA6MG4ET.js";
|
|
99
|
+
import "./chunk-N3SFDYM7.js";
|
|
100
|
+
import "./chunk-X3CL6DTR.js";
|
|
101
|
+
import "./chunk-4RHXTL3W.js";
|
|
102
|
+
import "./chunk-W5AYOICN.js";
|
|
103
|
+
import "./chunk-2OLS7V66.js";
|
|
104
|
+
import "./chunk-2QWPQRSU.js";
|
|
105
|
+
import "./chunk-IS4USJPY.js";
|
|
106
|
+
import "./chunk-2BBELGHY.js";
|
|
107
|
+
import "./chunk-QYHI3YET.js";
|
|
108
|
+
import "./chunk-4LPDG57B.js";
|
|
109
|
+
import "./chunk-TQDM7S5N.js";
|
|
110
|
+
import "./chunk-TQDKJHWX.js";
|
|
111
|
+
import "./chunk-GQBZU6EO.js";
|
|
112
|
+
import "./chunk-SQVUDO2O.js";
|
|
113
|
+
import "./chunk-RE4TGORR.js";
|
|
114
|
+
import "./chunk-DCZ6CIUM.js";
|
|
115
|
+
import "./chunk-M3FO5UMK.js";
|
|
116
|
+
import "./chunk-CERF3RIB.js";
|
|
117
|
+
import "./chunk-QQRLPY25.js";
|
|
118
|
+
import "./chunk-DA44ZENT.js";
|
|
119
|
+
import "./chunk-F252T6Y3.js";
|
|
120
|
+
import "./chunk-XWAC3MKW.js";
|
|
121
|
+
import "./chunk-CVFVFRGN.js";
|
|
122
|
+
import "./chunk-QJP7EYGL.js";
|
|
123
|
+
import "./chunk-ESF3DIZY.js";
|
|
124
|
+
import "./chunk-R7QN6ONS.js";
|
|
125
|
+
import "./chunk-ZN7G6JLS.js";
|
|
126
|
+
import "./chunk-ZGX3ERAT.js";
|
|
127
|
+
import "./chunk-PEWCDI2C.js";
|
|
128
|
+
import "./chunk-TULAXS77.js";
|
|
129
|
+
import "./chunk-KI5GZFCE.js";
|
|
130
|
+
import "./chunk-UBMVADBF.js";
|
|
131
|
+
import "./chunk-ZZCBDNZI.js";
|
|
132
|
+
import {
|
|
133
|
+
readState
|
|
134
|
+
} from "./chunk-MXS6S2PY.js";
|
|
135
|
+
import "./chunk-BISGNHKD.js";
|
|
136
|
+
import "./chunk-RKUVLRZI.js";
|
|
137
|
+
import "./chunk-BGEMY2JJ.js";
|
|
138
|
+
import "./chunk-XCKQ5BM2.js";
|
|
139
|
+
import "./chunk-NWEYRBWK.js";
|
|
140
|
+
import "./chunk-TWCVV2JO.js";
|
|
141
|
+
import "./chunk-PDPEM5VW.js";
|
|
142
|
+
import "./chunk-WWLJMP6D.js";
|
|
143
|
+
import "./chunk-CRUVYGO2.js";
|
|
144
|
+
import "./chunk-FF7ZVYJF.js";
|
|
145
|
+
import "./chunk-IMLTL2MY.js";
|
|
146
|
+
import "./chunk-BUOPJQP5.js";
|
|
147
|
+
import "./chunk-3B2CHX7M.js";
|
|
148
|
+
import "./chunk-RVUOIJXN.js";
|
|
149
|
+
import {
|
|
150
|
+
currentWorkerBuild
|
|
151
|
+
} from "./chunk-QUS4ER2W.js";
|
|
152
|
+
import "./chunk-DQYVQ2N7.js";
|
|
153
|
+
import "./chunk-KYUHIFP3.js";
|
|
154
|
+
import "./chunk-RSZGEL5U.js";
|
|
155
|
+
import "./chunk-NKDATMEM.js";
|
|
156
|
+
import {
|
|
157
|
+
setHarnessInstallReporter
|
|
158
|
+
} from "./chunk-DF35KMXM.js";
|
|
159
|
+
import "./chunk-ZT7B4H2V.js";
|
|
160
|
+
import "./chunk-OL4JBD3J.js";
|
|
161
|
+
import "./chunk-IGZ6C2MC.js";
|
|
162
|
+
import "./chunk-4NN3XQQT.js";
|
|
163
|
+
import "./chunk-4AQ5NINV.js";
|
|
164
|
+
import "./chunk-WPB5WEZJ.js";
|
|
165
|
+
import "./chunk-GYMAI5NY.js";
|
|
166
|
+
import "./chunk-CQ7J6UQ7.js";
|
|
167
|
+
import "./chunk-XKW5NDMR.js";
|
|
168
|
+
import "./chunk-W3YYPBEA.js";
|
|
169
|
+
import "./chunk-XIBYREEY.js";
|
|
170
|
+
import "./chunk-EE4B6A7W.js";
|
|
171
|
+
import "./chunk-WZYVLUVQ.js";
|
|
172
|
+
import "./chunk-O3EW7LAY.js";
|
|
173
|
+
import "./chunk-KHW6TX6I.js";
|
|
174
|
+
import "./chunk-MP4KZOQC.js";
|
|
175
|
+
import "./chunk-PWBF2X3V.js";
|
|
176
|
+
import "./chunk-HU5SSUFX.js";
|
|
177
|
+
import "./chunk-AKRYTS2D.js";
|
|
178
|
+
import "./chunk-4GVEJ5FK.js";
|
|
179
|
+
import "./chunk-O7BNJIXU.js";
|
|
180
|
+
import "./chunk-MCBRVPA7.js";
|
|
181
|
+
import "./chunk-RJLHVYQY.js";
|
|
182
|
+
import "./chunk-YMCH3L2S.js";
|
|
183
|
+
import "./chunk-I75EDU75.js";
|
|
184
|
+
import "./chunk-64E7D4HY.js";
|
|
185
|
+
import "./chunk-JGIWATSG.js";
|
|
186
|
+
import "./chunk-5B6TVO4A.js";
|
|
187
|
+
import {
|
|
188
|
+
CLIKCODE_COMMIT,
|
|
189
|
+
CLIKCODE_VERSION
|
|
190
|
+
} from "./chunk-NAOX3JUB.js";
|
|
191
|
+
import "./chunk-4QZEZME7.js";
|
|
192
|
+
import "./chunk-LVRRWP4W.js";
|
|
193
|
+
import "./chunk-GGYKY4GF.js";
|
|
194
|
+
import "./chunk-5SM5UAWN.js";
|
|
195
|
+
import "./chunk-PAXYQZH7.js";
|
|
196
|
+
import "./chunk-CAADDF6M.js";
|
|
197
|
+
import "./chunk-G3QP67Z7.js";
|
|
198
|
+
import "./chunk-4L2ZZM4Q.js";
|
|
199
|
+
import "./chunk-F6F47QAY.js";
|
|
200
|
+
import {
|
|
201
|
+
lifecycle,
|
|
202
|
+
quiet,
|
|
203
|
+
setLifecycleSessionSource
|
|
204
|
+
} from "./chunk-RDDWQBEM.js";
|
|
205
|
+
import "./chunk-MPAJ446F.js";
|
|
206
|
+
import "./chunk-CBANJFBO.js";
|
|
207
|
+
import "./chunk-PWXII6HF.js";
|
|
208
|
+
|
|
209
|
+
// src/ide/bridge-mux.ts
|
|
210
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
211
|
+
|
|
212
|
+
// src/ide/bridge-retire.ts
|
|
213
|
+
var BRIDGE_RETIRE_REASON = "replaced by a newer ClikCode build";
|
|
214
|
+
function watchForNewerBuild(options) {
|
|
215
|
+
const startBuild = "startBuild" in options ? options.startBuild : currentWorkerBuild();
|
|
216
|
+
const currentBuild = options.currentBuild ?? currentWorkerBuild;
|
|
217
|
+
const quietMs = options.quietMs ?? RETIRE_QUIET_MS;
|
|
218
|
+
const now = options.now ?? Date.now;
|
|
219
|
+
let done = false;
|
|
220
|
+
let held = "";
|
|
221
|
+
const note = (state) => {
|
|
222
|
+
if (state === held) return;
|
|
223
|
+
held = state;
|
|
224
|
+
lifecycle("bridge.retire.wait", { state });
|
|
225
|
+
};
|
|
226
|
+
const check = () => {
|
|
227
|
+
if (done || !startBuild) return;
|
|
228
|
+
const live = currentBuild();
|
|
229
|
+
if (!live || live === startBuild) return;
|
|
230
|
+
const blocker = options.blocker();
|
|
231
|
+
if (blocker) {
|
|
232
|
+
note(`held: ${blocker}`);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const quietFor = now() - options.lastActivityAt();
|
|
236
|
+
if (quietFor < quietMs) {
|
|
237
|
+
note("held: leaving for the newer build once it is quiet");
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
done = true;
|
|
241
|
+
clearInterval(timer);
|
|
242
|
+
lifecycle("bridge.retire", { reason: BRIDGE_RETIRE_REASON });
|
|
243
|
+
options.retire();
|
|
244
|
+
};
|
|
245
|
+
const timer = setInterval(check, options.watchMs ?? BUILD_WATCH_MS);
|
|
246
|
+
timer.unref();
|
|
247
|
+
return { check, stop: () => {
|
|
248
|
+
done = true;
|
|
249
|
+
clearInterval(timer);
|
|
250
|
+
} };
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// src/ide/bridge-mux.ts
|
|
254
|
+
var MultiplexHost = class {
|
|
255
|
+
constructor(send, create) {
|
|
256
|
+
this.send = send;
|
|
257
|
+
this.create = create;
|
|
258
|
+
}
|
|
259
|
+
send;
|
|
260
|
+
create;
|
|
261
|
+
chats = /* @__PURE__ */ new Map();
|
|
262
|
+
current = new AsyncLocalStorage();
|
|
263
|
+
stopping;
|
|
264
|
+
/** A chat joining or leaving is activity too. */
|
|
265
|
+
changedAt = Date.now();
|
|
266
|
+
/** What reaches "the editor" from code that does not know which chat it
|
|
267
|
+
* runs for (stdout, an install's busy line): the chat it runs for, or
|
|
268
|
+
* nobody -- false, so the caller can log it instead. */
|
|
269
|
+
routed = {
|
|
270
|
+
send: (event) => {
|
|
271
|
+
this.routed.sendRouted(event);
|
|
272
|
+
},
|
|
273
|
+
sendRouted: (event) => {
|
|
274
|
+
const chat = this.current.getStore();
|
|
275
|
+
if (!chat || !this.chats.has(chat.id)) return false;
|
|
276
|
+
if (event.type === "output" && chat.bridge.quietOutput && event.payload.panel !== "error") return true;
|
|
277
|
+
chat.channel.send(event);
|
|
278
|
+
return true;
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
/** The conversation of the chat whose code is running (the lifecycle log). */
|
|
282
|
+
sessionOfCurrent() {
|
|
283
|
+
return this.current.getStore()?.bridge.conversation;
|
|
284
|
+
}
|
|
285
|
+
get size() {
|
|
286
|
+
return this.chats.size;
|
|
287
|
+
}
|
|
288
|
+
/** What keeps a newer build from replacing this process: the first chat's reason. */
|
|
289
|
+
retireBlocker() {
|
|
290
|
+
if (this.stopping) return "stopping";
|
|
291
|
+
for (const chat of this.chats.values()) {
|
|
292
|
+
if (chat.closing) return "a chat is closing";
|
|
293
|
+
const blocker = chat.bridge.retireBlocker();
|
|
294
|
+
if (blocker) return blocker;
|
|
295
|
+
}
|
|
296
|
+
return void 0;
|
|
297
|
+
}
|
|
298
|
+
/** When anything last happened in any chat. */
|
|
299
|
+
get lastActivityAt() {
|
|
300
|
+
return Math.max(this.changedAt, ...[...this.chats.values()].map((chat) => chat.bridge.lastActivityAt));
|
|
301
|
+
}
|
|
302
|
+
/** Leaves for a newer build: says so (`host-retiring`) before anything
|
|
303
|
+
* else, so the editor reads what follows -- each chat closed, then the
|
|
304
|
+
* process gone -- as a reconnect, not a failure. */
|
|
305
|
+
retire() {
|
|
306
|
+
if (this.stopping) return this.stopping;
|
|
307
|
+
this.send({ type: "host-retiring", reason: "newer-build" });
|
|
308
|
+
return this.shutdown();
|
|
309
|
+
}
|
|
310
|
+
handle(message) {
|
|
311
|
+
if (this.stopping) return;
|
|
312
|
+
if (message.type === "chat-attach" || message.type === "chat" && message.request.type === "close") this.changedAt = Date.now();
|
|
313
|
+
if (message.type === "chat-attach") {
|
|
314
|
+
this.attach(message.chat);
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
if (message.type === "host-peer") {
|
|
318
|
+
void import("./chunk-NTDB6QKF.js").then(({ recordPeer }) => recordPeer(message.machine)).then((outcome) => lifecycle("bridge.peer", { outcome, machine: message.machine?.name }), () => void 0);
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
if (message.type === "chat") {
|
|
322
|
+
const chat = this.chats.get(message.chat);
|
|
323
|
+
if (!chat) return;
|
|
324
|
+
if (message.request.type === "close") {
|
|
325
|
+
void this.close(chat);
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
this.current.run(chat, () => chat.bridge.handle(message.request));
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
if (message.type === "close") void this.shutdown();
|
|
332
|
+
}
|
|
333
|
+
attach(id) {
|
|
334
|
+
if (this.chats.has(id)) return;
|
|
335
|
+
const channel = { send: (event) => this.send({ type: "chat", chat: id, event }) };
|
|
336
|
+
const siblings = {
|
|
337
|
+
showingElsewhere: (self) => new Set([...this.chats.values()].filter((other) => other.bridge !== self).flatMap((other) => other.bridge.conversation ? [other.bridge.conversation] : []))
|
|
338
|
+
};
|
|
339
|
+
const chat = { id, channel, bridge: void 0 };
|
|
340
|
+
chat.bridge = this.create(channel, siblings);
|
|
341
|
+
this.chats.set(id, chat);
|
|
342
|
+
lifecycle("bridge.chat.attach", { chats: this.chats.size });
|
|
343
|
+
this.current.run(chat, () => chat.bridge.start());
|
|
344
|
+
}
|
|
345
|
+
/** One chat leaves: its bridge shuts down (leaving its conversation), and
|
|
346
|
+
* the editor is told. The others carry on. */
|
|
347
|
+
close(chat) {
|
|
348
|
+
chat.closing ??= this.current.run(chat, () => chat.bridge.shutdown()).catch(quiet("ide/bridge-mux")).finally(() => {
|
|
349
|
+
this.chats.delete(chat.id);
|
|
350
|
+
lifecycle("bridge.chat.close", { chats: this.chats.size });
|
|
351
|
+
this.send({ type: "chat-closed", chat: chat.id });
|
|
352
|
+
});
|
|
353
|
+
return chat.closing;
|
|
354
|
+
}
|
|
355
|
+
/** Every chat, once however many ask (a `close`, then the disconnect). */
|
|
356
|
+
shutdown() {
|
|
357
|
+
this.stopping ??= Promise.all([...this.chats.values()].map((chat) => this.close(chat))).then(() => void 0);
|
|
358
|
+
return this.stopping;
|
|
359
|
+
}
|
|
360
|
+
};
|
|
361
|
+
async function runMultiplexedBridge(config, send) {
|
|
362
|
+
let sent = Promise.resolve();
|
|
363
|
+
const host = new MultiplexHost(
|
|
364
|
+
(event) => {
|
|
365
|
+
if (process.connected) sent = new Promise((resolve) => send(event, void 0, {}, () => resolve()));
|
|
366
|
+
},
|
|
367
|
+
(channel, siblings) => new IdeBridge(config, channel, siblings)
|
|
368
|
+
);
|
|
369
|
+
const log = (line) => {
|
|
370
|
+
process.stderr.write(`${line}
|
|
371
|
+
`);
|
|
372
|
+
};
|
|
373
|
+
captureStdout({ send: (event) => {
|
|
374
|
+
if (!host.routed.sendRouted(event)) log(`output outside any chat: ${JSON.stringify(event).slice(0, 300)}`);
|
|
375
|
+
} });
|
|
376
|
+
setHarnessInstallReporter(ideInstallReporter(host.routed));
|
|
377
|
+
setLifecycleSessionSource(() => host.sessionOfCurrent());
|
|
378
|
+
process.on("message", (message) => {
|
|
379
|
+
if (message && typeof message === "object" && typeof message.type === "string") host.handle(message);
|
|
380
|
+
});
|
|
381
|
+
process.on("disconnect", () => {
|
|
382
|
+
lifecycle("bridge.stop", { reason: "editor disconnected", chats: host.size });
|
|
383
|
+
void host.shutdown().finally(() => process.exit(0));
|
|
384
|
+
});
|
|
385
|
+
process.on("SIGTERM", () => {
|
|
386
|
+
lifecycle("bridge.stop", { reason: "SIGTERM", chats: host.size });
|
|
387
|
+
void host.shutdown().finally(() => process.exit(0));
|
|
388
|
+
});
|
|
389
|
+
watchForNewerBuild({
|
|
390
|
+
blocker: () => host.retireBlocker(),
|
|
391
|
+
lastActivityAt: () => host.lastActivityAt,
|
|
392
|
+
retire: () => {
|
|
393
|
+
void host.retire().then(() => sent).finally(() => process.exit(0));
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
const installationId = await Promise.race([
|
|
397
|
+
readState({ transcripts: [] }).then((state) => state.installationId, () => void 0),
|
|
398
|
+
new Promise((resolve) => setTimeout(() => resolve(void 0), 2e3).unref())
|
|
399
|
+
]);
|
|
400
|
+
const build = currentWorkerBuild();
|
|
401
|
+
send({
|
|
402
|
+
type: "host-ready",
|
|
403
|
+
version: CLIKCODE_VERSION,
|
|
404
|
+
protocol: IDE_PROTOCOL.version,
|
|
405
|
+
revision: IDE_PROTOCOL.revision,
|
|
406
|
+
...build ? { build } : {},
|
|
407
|
+
pid: process.pid,
|
|
408
|
+
...CLIKCODE_COMMIT ? { commit: CLIKCODE_COMMIT } : {},
|
|
409
|
+
...installationId ? { installationId } : {}
|
|
410
|
+
}, void 0, {}, () => void 0);
|
|
411
|
+
await new Promise(() => {
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
export {
|
|
415
|
+
MultiplexHost,
|
|
416
|
+
runMultiplexedBridge
|
|
417
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRequire as __clikcodeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __clikcodeCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
DEFAULT_TAB,
|
|
5
|
+
knownKeyPagesFor,
|
|
6
|
+
liveKeygrab,
|
|
7
|
+
liveKeygrabPort,
|
|
8
|
+
lookAt,
|
|
9
|
+
siteOf
|
|
10
|
+
} from "./chunk-KZL5VS4B.js";
|
|
11
|
+
import "./chunk-DW2BMUKY.js";
|
|
12
|
+
import "./chunk-RDDWQBEM.js";
|
|
13
|
+
import "./chunk-MPAJ446F.js";
|
|
14
|
+
import "./chunk-CBANJFBO.js";
|
|
15
|
+
import "./chunk-PWXII6HF.js";
|
|
16
|
+
export {
|
|
17
|
+
DEFAULT_TAB,
|
|
18
|
+
knownKeyPagesFor,
|
|
19
|
+
liveKeygrab,
|
|
20
|
+
liveKeygrabPort,
|
|
21
|
+
lookAt,
|
|
22
|
+
siteOf
|
|
23
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { createRequire as __clikcodeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __clikcodeCreateRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// src/gateway/login/link-info.ts
|
|
5
|
+
function shortenLoginUrl(url, maxLength = 56) {
|
|
6
|
+
if (url.length <= maxLength) return url;
|
|
7
|
+
let shown;
|
|
8
|
+
try {
|
|
9
|
+
const parsed = new URL(url);
|
|
10
|
+
shown = `${parsed.origin}/\u2026`;
|
|
11
|
+
} catch {
|
|
12
|
+
return `${url.slice(0, maxLength - 1)}\u2026`;
|
|
13
|
+
}
|
|
14
|
+
return shown.length <= maxLength ? shown : `${shown.slice(0, maxLength - 1)}\u2026`;
|
|
15
|
+
}
|
|
16
|
+
function loginCallbackPort(url) {
|
|
17
|
+
try {
|
|
18
|
+
const auth = new URL(url);
|
|
19
|
+
const redirect = auth.searchParams.get("redirect_uri") ?? auth.searchParams.get("redirect_url") ?? auth.searchParams.get("callback_url") ?? auth.searchParams.get("callback");
|
|
20
|
+
const callback = redirect ? new URL(redirect) : auth;
|
|
21
|
+
if (callback.protocol !== "http:" || !["localhost", "127.0.0.1", "[::1]"].includes(callback.hostname)) return void 0;
|
|
22
|
+
const port = Number(callback.port);
|
|
23
|
+
return Number.isInteger(port) && port > 0 && port < 65536 ? port : void 0;
|
|
24
|
+
} catch {
|
|
25
|
+
return void 0;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function loginPortForwardHint(url, environment = process.env) {
|
|
29
|
+
const port = loginCallbackPort(url);
|
|
30
|
+
if (!port) return void 0;
|
|
31
|
+
return environment.CLIKDEPLOY_REMOTE_TERMINAL === "1" ? `Consent callback port ${port} \xB7 tap this link in ClikDeploy to forward automatically` : `Consent callback port ${port} \xB7 over SSH forward with ssh -L ${port}:127.0.0.1:${port} <host>`;
|
|
32
|
+
}
|
|
33
|
+
var BROWSER_OPENERS = ["xdg-open", "open", "gio", "sensible-browser", "x-www-browser", "www-browser"];
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
shortenLoginUrl,
|
|
37
|
+
loginPortForwardHint,
|
|
38
|
+
BROWSER_OPENERS
|
|
39
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { createRequire as __clikcodeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __clikcodeCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
pidIsAlive
|
|
5
|
+
} from "./chunk-4L2ZZM4Q.js";
|
|
6
|
+
import {
|
|
7
|
+
atomicWriteFile
|
|
8
|
+
} from "./chunk-F6F47QAY.js";
|
|
9
|
+
import {
|
|
10
|
+
quiet,
|
|
11
|
+
swallowed
|
|
12
|
+
} from "./chunk-RDDWQBEM.js";
|
|
13
|
+
|
|
14
|
+
// src/agent/computer/handoff-desk-store.ts
|
|
15
|
+
import { randomBytes } from "node:crypto";
|
|
16
|
+
import fs from "node:fs/promises";
|
|
17
|
+
import path from "node:path";
|
|
18
|
+
var DESK_WAIT_MS = 12 * 36e5;
|
|
19
|
+
var DESK_DONE_MS = 24 * 36e5;
|
|
20
|
+
var deskDir = (stateDir) => path.join(stateDir, "computer", "desk");
|
|
21
|
+
var itemsDir = (stateDir) => path.join(deskDir(stateDir), "items");
|
|
22
|
+
var itemFile = (stateDir, id) => path.join(itemsDir(stateDir), `${id.replace(/[^A-Za-z0-9_-]/g, "_")}.json`);
|
|
23
|
+
var infoFile = (stateDir) => path.join(deskDir(stateDir), "desk.json");
|
|
24
|
+
var tokenFile = (stateDir) => path.join(deskDir(stateDir), "token");
|
|
25
|
+
var DESK_TOKEN_MAX_AGE_MS = 7 * 24 * 36e5;
|
|
26
|
+
var TOKEN_SHAPE = /^[A-Za-z0-9_-]{24,}$/;
|
|
27
|
+
async function deskToken(stateDir, options = {}) {
|
|
28
|
+
const now = options.now ?? Date.now();
|
|
29
|
+
if (!options.rotate) {
|
|
30
|
+
try {
|
|
31
|
+
const text = (await fs.readFile(tokenFile(stateDir), "utf8")).trim();
|
|
32
|
+
let saved;
|
|
33
|
+
try {
|
|
34
|
+
saved = JSON.parse(text);
|
|
35
|
+
} catch {
|
|
36
|
+
saved = { token: text, createdAt: (await fs.stat(tokenFile(stateDir))).mtimeMs };
|
|
37
|
+
}
|
|
38
|
+
if (typeof saved.token === "string" && TOKEN_SHAPE.test(saved.token) && typeof saved.createdAt === "number" && now - saved.createdAt < DESK_TOKEN_MAX_AGE_MS && saved.createdAt <= now + 6e4) return saved.token;
|
|
39
|
+
} catch {
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const token = randomBytes(24).toString("base64url");
|
|
43
|
+
await fs.mkdir(deskDir(stateDir), { recursive: true, mode: 448 });
|
|
44
|
+
await atomicWriteFile(tokenFile(stateDir), JSON.stringify({ token, createdAt: now }), { mode: 384 });
|
|
45
|
+
return token;
|
|
46
|
+
}
|
|
47
|
+
async function writeDeskInfo(stateDir, info) {
|
|
48
|
+
await fs.mkdir(deskDir(stateDir), { recursive: true, mode: 448 });
|
|
49
|
+
await fs.writeFile(infoFile(stateDir), JSON.stringify(info), { mode: 384 });
|
|
50
|
+
}
|
|
51
|
+
async function clearDeskInfo(stateDir, pid) {
|
|
52
|
+
const info = await readDeskInfo(stateDir, () => true);
|
|
53
|
+
if (info?.pid === pid) await fs.unlink(infoFile(stateDir)).catch(quiet("agent/computer/handoff-desk-store"));
|
|
54
|
+
}
|
|
55
|
+
async function readDeskInfo(stateDir, alive = pidIsAlive) {
|
|
56
|
+
try {
|
|
57
|
+
const info = JSON.parse(await fs.readFile(infoFile(stateDir), "utf8"));
|
|
58
|
+
if (typeof info.pid !== "number" || typeof info.host !== "string" || typeof info.port !== "number" || typeof info.token !== "string") return void 0;
|
|
59
|
+
return alive(info.pid) ? info : void 0;
|
|
60
|
+
} catch {
|
|
61
|
+
return void 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
var deskAddress = (info) => `http://${info.host}:${info.port}/${info.token}/`;
|
|
65
|
+
var deskItemAddress = (info, id) => `${deskAddress(info)}t/${id}/`;
|
|
66
|
+
async function listDeskItems(stateDir) {
|
|
67
|
+
const names = await fs.readdir(itemsDir(stateDir)).catch(() => []);
|
|
68
|
+
const items = [];
|
|
69
|
+
for (const name of names) {
|
|
70
|
+
if (!name.endsWith(".json")) continue;
|
|
71
|
+
try {
|
|
72
|
+
const item = JSON.parse(await fs.readFile(path.join(itemsDir(stateDir), name), "utf8"));
|
|
73
|
+
if (typeof item.id === "string" && typeof item.targetId === "string" && Number.isFinite(item.createdAt)) items.push(item);
|
|
74
|
+
} catch (error) {
|
|
75
|
+
swallowed("agent/computer/handoff-desk-store", error);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return items.sort((a, b) => a.createdAt - b.createdAt);
|
|
79
|
+
}
|
|
80
|
+
async function readDeskItem(stateDir, id) {
|
|
81
|
+
return (await listDeskItems(stateDir)).find((item) => item.id === id);
|
|
82
|
+
}
|
|
83
|
+
async function writeDeskItem(stateDir, item) {
|
|
84
|
+
await fs.mkdir(itemsDir(stateDir), { recursive: true, mode: 448 });
|
|
85
|
+
await atomicWriteFile(itemFile(stateDir, item.id), JSON.stringify(item), { durable: false });
|
|
86
|
+
}
|
|
87
|
+
async function removeDeskItem(stateDir, id) {
|
|
88
|
+
await fs.unlink(itemFile(stateDir, id)).catch(quiet("agent/computer/handoff-desk-store"));
|
|
89
|
+
}
|
|
90
|
+
var clean = (text, max) => text.replace(/\s+/g, " ").trim().slice(0, max);
|
|
91
|
+
async function addDeskItem(stateDir, input, now = Date.now()) {
|
|
92
|
+
const before = (await listDeskItems(stateDir)).find((item2) => item2.targetId === input.targetId && item2.status === "waiting");
|
|
93
|
+
if (before) return before;
|
|
94
|
+
let host;
|
|
95
|
+
try {
|
|
96
|
+
host = input.url ? new URL(input.url).host : void 0;
|
|
97
|
+
} catch {
|
|
98
|
+
host = void 0;
|
|
99
|
+
}
|
|
100
|
+
const item = {
|
|
101
|
+
id: randomBytes(9).toString("base64url"),
|
|
102
|
+
label: clean(input.label, 60) || "Browser step",
|
|
103
|
+
kind: input.kind ?? "other",
|
|
104
|
+
...input.note ? { note: clean(input.note, 200) } : {},
|
|
105
|
+
targetId: input.targetId,
|
|
106
|
+
...host ? { host } : {},
|
|
107
|
+
createdAt: now,
|
|
108
|
+
status: "waiting",
|
|
109
|
+
...input.resume ? { resume: input.resume } : {}
|
|
110
|
+
};
|
|
111
|
+
await writeDeskItem(stateDir, item);
|
|
112
|
+
return item;
|
|
113
|
+
}
|
|
114
|
+
async function finishDeskItem(stateDir, id, status, now = Date.now()) {
|
|
115
|
+
const item = await readDeskItem(stateDir, id);
|
|
116
|
+
if (!item || item.status !== "waiting") return item;
|
|
117
|
+
const next = { ...item, status, doneAt: now };
|
|
118
|
+
await writeDeskItem(stateDir, next);
|
|
119
|
+
return next;
|
|
120
|
+
}
|
|
121
|
+
async function takeFinishedResumes(stateDir) {
|
|
122
|
+
const taken = [];
|
|
123
|
+
for (const item of await listDeskItems(stateDir)) {
|
|
124
|
+
if (item.status !== "done" || !item.resume || item.resumeSent) continue;
|
|
125
|
+
await writeDeskItem(stateDir, { ...item, resumeSent: true });
|
|
126
|
+
taken.push(item);
|
|
127
|
+
}
|
|
128
|
+
return taken;
|
|
129
|
+
}
|
|
130
|
+
async function tidyDesk(stateDir, liveTargets, now = Date.now()) {
|
|
131
|
+
const changed = [];
|
|
132
|
+
for (const item of await listDeskItems(stateDir)) {
|
|
133
|
+
if (item.status === "waiting") {
|
|
134
|
+
if (now - item.createdAt >= DESK_WAIT_MS || liveTargets && !liveTargets.has(item.targetId)) {
|
|
135
|
+
const closed = await finishDeskItem(stateDir, item.id, "closed", now);
|
|
136
|
+
if (closed) changed.push(closed);
|
|
137
|
+
}
|
|
138
|
+
} else if (now - (item.doneAt ?? item.createdAt) >= DESK_DONE_MS) {
|
|
139
|
+
await removeDeskItem(stateDir, item.id);
|
|
140
|
+
changed.push(item);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return changed;
|
|
144
|
+
}
|
|
145
|
+
async function deskHeldTargets(stateDir, now = Date.now()) {
|
|
146
|
+
const held = /* @__PURE__ */ new Set();
|
|
147
|
+
for (const item of await listDeskItems(stateDir)) if (item.status === "waiting" && now - item.createdAt < DESK_WAIT_MS) held.add(item.targetId);
|
|
148
|
+
return held;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export {
|
|
152
|
+
DESK_WAIT_MS,
|
|
153
|
+
DESK_TOKEN_MAX_AGE_MS,
|
|
154
|
+
deskToken,
|
|
155
|
+
writeDeskInfo,
|
|
156
|
+
clearDeskInfo,
|
|
157
|
+
readDeskInfo,
|
|
158
|
+
deskAddress,
|
|
159
|
+
deskItemAddress,
|
|
160
|
+
listDeskItems,
|
|
161
|
+
readDeskItem,
|
|
162
|
+
removeDeskItem,
|
|
163
|
+
addDeskItem,
|
|
164
|
+
finishDeskItem,
|
|
165
|
+
takeFinishedResumes,
|
|
166
|
+
tidyDesk,
|
|
167
|
+
deskHeldTargets
|
|
168
|
+
};
|