@wirecat/drive-cli 0.71.0 → 0.72.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.
- package/README.md +150 -71
- package/contracts/wirecat.json +77 -8
- package/dist/bin/drive.js +2 -2
- package/dist/bundle/agent-GOCD4ZW2.js +46 -0
- package/dist/bundle/{all-profiles-3QJG2NAN.js → all-profiles-PZVP3G73.js} +67 -25
- package/dist/bundle/{anthropic-PSWTEU6G.js → anthropic-PUOTKSYV.js} +9 -9
- package/dist/bundle/{app-server-PVTA6ABR.js → app-server-MKDCXRZM.js} +97 -79
- package/dist/bundle/{bun-LU5LP3JI.js → bun-NS5YLOQT.js} +2 -2
- package/dist/bundle/{bun-sqlite-PYMKLBRU.js → bun-sqlite-KSKWRLLO.js} +9 -9
- package/dist/bundle/{chunk-COOOO5B3.js → chunk-2CG3LUQS.js} +4 -4
- package/dist/bundle/{chunk-YVI5SQPY.js → chunk-2TVHFJKV.js} +1 -1
- package/dist/bundle/chunk-35FIJGTT.js +52 -0
- package/dist/bundle/chunk-35GROSBS.js +3233 -0
- package/dist/bundle/{chunk-D5TGYUVU.js → chunk-3CH7I452.js} +9 -60
- package/dist/bundle/{chunk-ICDCAQ6K.js → chunk-3QBRS3JT.js} +13 -9
- package/dist/bundle/chunk-3T7JIHSO.js +353 -0
- package/dist/bundle/{chunk-Q7DOMFJ4.js → chunk-3VIEGRBA.js} +6 -6
- package/dist/bundle/chunk-3YCUYFTD.js +2159 -0
- package/dist/bundle/{chunk-CJLVYIOP.js → chunk-3ZGWJYSG.js} +30 -21
- package/dist/bundle/{chunk-YPFWNVHV.js → chunk-43PCMVTZ.js} +2 -100
- package/dist/bundle/{chunk-OF422U5D.js → chunk-4DK55MLP.js} +402 -402
- package/dist/bundle/chunk-4HP6KGBI.js +32 -0
- package/dist/bundle/chunk-4P6D6CUS.js +282 -0
- package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
- package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
- package/dist/bundle/{chunk-6W763DZN.js → chunk-54O5NJRC.js} +14 -13
- package/dist/bundle/{chunk-MNLL5YLM.js → chunk-5BHP4FVM.js} +2 -2
- package/dist/bundle/{chunk-ACUAV6VX.js → chunk-6JU4KLAZ.js} +108 -72
- package/dist/bundle/{chunk-YMJ6IDGT.js → chunk-6KND2DYT.js} +38 -8
- package/dist/bundle/{chunk-4HWJOU7N.js → chunk-7YPZPJTB.js} +1 -1
- package/dist/bundle/chunk-A5XNUMW7.js +108 -0
- package/dist/bundle/{chunk-X4TIMMKJ.js → chunk-AG34MPVN.js} +1 -1
- package/dist/bundle/chunk-B5V2U7IS.js +221 -0
- package/dist/bundle/chunk-B6JC5RS3.js +696 -0
- package/dist/bundle/chunk-BDZXGDGI.js +80 -0
- package/dist/bundle/{chunk-B5KSXHJ7.js → chunk-BMTMGMGE.js} +1 -1
- package/dist/bundle/{chunk-ZCR3IRZ2.js → chunk-CP2TZXAG.js} +16 -9
- package/dist/bundle/{chunk-TAUBRNC5.js → chunk-DOEP4EPW.js} +72 -59
- package/dist/bundle/chunk-DQSOYH6N.js +20 -0
- package/dist/bundle/{chunk-QETR5HIZ.js → chunk-E2TMWONO.js} +4385 -2684
- package/dist/bundle/chunk-E5EYJU5R.js +7 -0
- package/dist/bundle/chunk-ECYOTDJM.js +14 -0
- package/dist/bundle/{chunk-HL52XXZX.js → chunk-EXHTGQR2.js} +3 -4
- package/dist/bundle/chunk-F4BX7TH2.js +15 -0
- package/dist/bundle/{chunk-ASMMG72J.js → chunk-FJQO5OHR.js} +261 -565
- package/dist/bundle/{chunk-RJOQH5YY.js → chunk-FKP4T7A4.js} +111 -859
- package/dist/bundle/{chunk-JDV7HNNQ.js → chunk-FTL3WXZB.js} +13 -26
- package/dist/bundle/{chunk-FP54WSIR.js → chunk-G2CH4FRW.js} +4 -4
- package/dist/bundle/chunk-G2KKMQRN.js +30 -0
- package/dist/bundle/{chunk-NYECVHFH.js → chunk-G4NHRFS7.js} +755 -0
- package/dist/bundle/{chunk-Y2NWGNUB.js → chunk-G7SKXAVZ.js} +5 -5
- package/dist/bundle/{chunk-FT3LN3HP.js → chunk-GFI3UUIU.js} +1 -1
- package/dist/bundle/chunk-GTPPUBYU.js +1876 -0
- package/dist/bundle/{chunk-QFR2PNJN.js → chunk-GTROGY74.js} +12 -12
- package/dist/bundle/{chunk-UTO2GO4P.js → chunk-GYAPDUF5.js} +45 -66
- package/dist/bundle/{chunk-GBKNJWOZ.js → chunk-HCMEU7AF.js} +8 -8
- package/dist/bundle/{chunk-FJH7DJWK.js → chunk-HDGJ7IDE.js} +6 -6
- package/dist/bundle/{chunk-Z3KUSRCF.js → chunk-HMN26CVU.js} +2 -2
- package/dist/bundle/{chunk-I4RWW3UD.js → chunk-HOICQNJX.js} +20 -5
- package/dist/bundle/{chunk-P7CUM5IB.js → chunk-HPS2YGSZ.js} +1 -1
- package/dist/bundle/{chunk-HMS6EEQL.js → chunk-HSASPXRW.js} +3 -3
- package/dist/bundle/{chunk-KGYVHPGE.js → chunk-IABPGOMT.js} +2 -2
- package/dist/bundle/{chunk-4QNW4NK6.js → chunk-IBQZT2YD.js} +1 -1
- package/dist/bundle/{chunk-PRW6SYA3.js → chunk-IE3R46YN.js} +313 -257
- package/dist/bundle/{chunk-7PDHGZN4.js → chunk-IE6O7463.js} +4 -4
- package/dist/bundle/{chunk-3UGYFXH6.js → chunk-IPBYU43F.js} +192 -379
- package/dist/bundle/{chunk-RWDKMU74.js → chunk-IS7STZEB.js} +3 -3
- package/dist/bundle/{chunk-GOWXXYEF.js → chunk-IV77ZFF4.js} +4 -4
- package/dist/bundle/{chunk-6XFIITOG.js → chunk-JDGF3YYS.js} +4811 -3486
- package/dist/bundle/{chunk-GPQ44Y2R.js → chunk-JHAACT4I.js} +2 -2
- package/dist/bundle/{chunk-SERXSCN3.js → chunk-JRED7BNX.js} +337 -390
- package/dist/bundle/{chunk-MIA7P6FZ.js → chunk-JSYUB4SM.js} +6 -6
- package/dist/bundle/{chunk-RESDD3Q4.js → chunk-JVM75M4H.js} +16 -3
- package/dist/bundle/{chunk-XF4EXO2C.js → chunk-JZ65CQWK.js} +6 -6
- package/dist/bundle/{chunk-QNRRK3CN.js → chunk-KBR7OC5S.js} +2 -2
- package/dist/bundle/chunk-KI6OOW6D.js +123 -0
- package/dist/bundle/chunk-KOI5G7NM.js +388 -0
- package/dist/bundle/{chunk-ZZ32DXTH.js → chunk-KPBUJQKT.js} +1 -1
- package/dist/bundle/{chunk-2LHAVY4U.js → chunk-KVBGIZ2C.js} +1 -1
- package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
- package/dist/bundle/{chunk-SAKO3P4H.js → chunk-LKUWH6KU.js} +1 -1
- package/dist/bundle/chunk-MA6U4XH2.js +36 -0
- package/dist/bundle/{chunk-TAFHYHKA.js → chunk-MA7ETVTZ.js} +43 -186
- package/dist/bundle/{chunk-KYKW2W6X.js → chunk-MDJUYCHT.js} +1 -1
- package/dist/bundle/chunk-MEYYH47C.js +25 -0
- package/dist/bundle/{chunk-Z56QFOBR.js → chunk-MGC2BAD2.js} +1 -1
- package/dist/bundle/chunk-NMQRSEZM.js +37 -0
- package/dist/bundle/{chunk-5DPV7X27.js → chunk-NTZWY5R3.js} +321 -0
- package/dist/bundle/{chunk-OJSBWP3F.js → chunk-OBDPKDGB.js} +69 -7
- package/dist/bundle/{chunk-WVDCCYS3.js → chunk-ODTBJGWQ.js} +17 -17
- package/dist/bundle/chunk-PB6ACIME.js +80 -0
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-72C4YOCH.js → chunk-PMAV3RNP.js} +7 -7
- package/dist/bundle/chunk-PSY67L73.js +783 -0
- package/dist/bundle/{chunk-6TNNT2MQ.js → chunk-PUVQOZ2N.js} +483 -176
- package/dist/bundle/{chunk-SDKQNOL5.js → chunk-QB7K6PIP.js} +6 -6
- package/dist/bundle/chunk-QK7GKFKB.js +188 -0
- package/dist/bundle/{chunk-4PA4DHYV.js → chunk-QMUWHKP5.js} +6 -6
- package/dist/bundle/chunk-QURQ2OU2.js +250 -0
- package/dist/bundle/{chunk-LXKYKRHD.js → chunk-R3EDZWXF.js} +8 -227
- package/dist/bundle/{chunk-KGERXYTV.js → chunk-RM4DO2WZ.js} +1 -1
- package/dist/bundle/chunk-S27UKJVL.js +730 -0
- package/dist/bundle/{chunk-22QQUKWA.js → chunk-S3SLDYTU.js} +1 -1
- package/dist/bundle/{chunk-FCS26CYQ.js → chunk-SAEBHENE.js} +4 -4
- package/dist/bundle/chunk-SM7Z2BQF.js +561 -0
- package/dist/bundle/{chunk-QXC6IEH6.js → chunk-SODB63MR.js} +201 -423
- package/dist/bundle/{chunk-2PUNKUYJ.js → chunk-SSFGSY77.js} +10320 -9907
- package/dist/bundle/{chunk-37MAA6F2.js → chunk-STUPCKAA.js} +11 -2221
- package/dist/bundle/{chunk-BKSQBBYG.js → chunk-SUQT4KI2.js} +9 -9
- package/dist/bundle/{chunk-YPNWIB6H.js → chunk-SWQDKO6D.js} +3 -3
- package/dist/bundle/chunk-SZ7XJZGH.js +2231 -0
- package/dist/bundle/{chunk-3N2OFXB5.js → chunk-T3OK6AYZ.js} +5 -5
- package/dist/bundle/{chunk-HKY7X6NY.js → chunk-TFIAD57H.js} +4 -4
- package/dist/bundle/chunk-TRYYWV7J.js +291 -0
- package/dist/bundle/{chunk-XMMFBPGC.js → chunk-TUL6MCTY.js} +3 -3
- package/dist/bundle/{chunk-6Y2BYFXQ.js → chunk-UC7JLE6J.js} +0 -7
- package/dist/bundle/{chunk-YJIGGUPI.js → chunk-UL5HSHFU.js} +4 -4
- package/dist/bundle/{chunk-3EBBLKIT.js → chunk-UT64BBEP.js} +4 -4
- package/dist/bundle/{chunk-26DHFMGZ.js → chunk-VBIZD5V5.js} +2 -2
- package/dist/bundle/chunk-VHTELRUA.js +50 -0
- package/dist/bundle/chunk-VOQICE3G.js +340 -0
- package/dist/bundle/{chunk-GZ2D4KXG.js → chunk-WDJRUNQN.js} +35 -12
- package/dist/bundle/{chunk-2UUWXPOB.js → chunk-X5CXANSA.js} +3 -3
- package/dist/bundle/{chunk-35SCQ4VI.js → chunk-X6HPQKAI.js} +43 -35
- package/dist/bundle/{chunk-COJSWDNU.js → chunk-XKWQDQ4B.js} +3 -3
- package/dist/bundle/{chunk-6SJOTNHF.js → chunk-XZEVHUKI.js} +6 -28
- package/dist/bundle/{chunk-JZHBZOJR.js → chunk-YE7DJB3F.js} +3 -3
- package/dist/bundle/chunk-YHWFF6DN.js +39 -0
- package/dist/bundle/{chunk-2BVVU7GG.js → chunk-YJVQ5GST.js} +1 -1
- package/dist/bundle/{chunk-ZM63SUHG.js → chunk-YRCGFSRR.js} +2 -2
- package/dist/bundle/{chunk-EOEU3AZN.js → chunk-ZNFXKFGF.js} +13 -13
- package/dist/bundle/{cli-556DERZL.js → cli-KXRWXGTS.js} +217 -114
- package/dist/bundle/command-contract-BGNT7MTQ.js +45 -0
- package/dist/bundle/{command-server-entry-AYLGNZWD.js → command-server-entry-7FZX74T6.js} +36 -34
- package/dist/bundle/{decode-QU24MWMN.js → decode-SZ6W34U3.js} +10 -10
- package/dist/bundle/{dispatch-4KODNOXV.js → dispatch-4KNSZ3PI.js} +10 -10
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/drive.js +11 -11
- package/dist/bundle/{echarts-BXX4OQWC.js → echarts-ISH62J4E.js} +2 -2
- package/dist/bundle/{embed-KG27KG3D.js → embed-6ODGTZPK.js} +10 -10
- package/dist/bundle/{embedder-IPAVUQUV.js → embedder-6FY67FTQ.js} +15 -15
- package/dist/bundle/entry-2SA6ZX7E.js +25 -0
- package/dist/bundle/{failure-ESL7ETL4.js → failure-V3ILKUTX.js} +4 -4
- package/dist/bundle/first-run-ZNKPPD6M.js +31 -0
- package/dist/bundle/first-screen-WF6GYLPN.js +45 -0
- package/dist/bundle/google-QCADNPCQ.js +46 -0
- package/dist/bundle/{google-api-VCDBSNOW.js → google-api-ZTI3NKZX.js} +88 -73
- package/dist/bundle/grants-BPN5AGDK.js +133 -0
- package/dist/bundle/hast-util-from-html-X2DCPS3T.js +10531 -0
- package/dist/bundle/hast-util-to-html-VP6XLPKJ.js +998 -0
- package/dist/bundle/hast-util-to-mdast-IZ5PRX72.js +2272 -0
- package/dist/bundle/{identity-LOWMVGZY.js → identity-YX4IPGOO.js} +7 -6
- package/dist/bundle/{instructions-2VECIDXF.js → instructions-G5ZGHVFB.js} +1 -1
- package/dist/bundle/{login-7GBONT7V.js → login-CVX5VJX6.js} +96 -81
- package/dist/bundle/{mcp-O6ACR2DX.js → mcp-MQ2L5IIM.js} +2 -2
- package/dist/bundle/{mdast-util-from-markdown-FXEPSNER.js → mdast-util-from-markdown-HEZF7KJ4.js} +137 -195
- package/dist/bundle/mdast-util-gfm-AQW6R6MG.js +925 -0
- package/dist/bundle/mdast-util-to-hast-DF2QVIRV.js +879 -0
- package/dist/bundle/mdast-util-to-markdown-XYLXB3Z3.js +18 -0
- package/dist/bundle/meeting-combined-HKZJMJ6Q.js +28 -0
- package/dist/bundle/meeting-model-DSE4GRVE.js +29 -0
- package/dist/bundle/{meeting-semantic-G7PFOKU7.js → meeting-semantic-OHG2QN2G.js} +10 -10
- package/dist/bundle/{micromark-extension-gfm-GRL24TU6.js → micromark-extension-gfm-OE2GBORZ.js} +11 -78
- package/dist/bundle/{node-MPEQSFI3.js → node-NLJINXVQ.js} +2 -2
- package/dist/bundle/{node-sqlite-OLQMAYB4.js → node-sqlite-KDFQDYVZ.js} +10 -10
- package/dist/bundle/notes-search-3VBVSQ3R.js +70 -0
- package/dist/bundle/oauth-M3E62ZHC.js +22 -0
- package/dist/bundle/{open-OXTE672W.js → open-WVRUVBIZ.js} +8 -8
- package/dist/bundle/{openai-EB3TPIZY.js → openai-JJWOSJMV.js} +22 -21
- package/dist/bundle/{process-F6TKXWWA.js → process-LPVAYRO7.js} +1 -1
- package/dist/bundle/{program-4IFDZ7FM.js → program-ZJRIP25J.js} +276 -1149
- package/dist/bundle/{prompt-F5RRHPN2.js → prompt-XCDHTEAO.js} +8 -8
- package/dist/bundle/{reasons-UORHJDHK.js → reasons-REEEQDAZ.js} +6 -5
- package/dist/bundle/{recognize-DAVNZND3.js → recognize-OZLFDJAT.js} +7 -7
- package/dist/bundle/remote-MDPYVCZB.js +35 -0
- package/dist/bundle/{rerank-CND2GVLZ.js → rerank-FLZWJNHA.js} +11 -11
- package/dist/bundle/{serve-ZHSPUIGX.js → serve-5UV5VLRV.js} +19 -19
- package/dist/bundle/{server-YMAK4LHC.js → server-53A2X2MK.js} +89 -70
- package/dist/bundle/server-5GMURMDE.js +97 -0
- package/dist/bundle/{services-ZILSFJ6E.js → services-XSMH7BXB.js} +109 -89
- package/dist/bundle/{sqlite-runtime-S5VPMZQH.js → sqlite-runtime-E3L7ENFU.js} +9 -9
- package/dist/bundle/{start-CR6X25RT.js → start-4S2VNR4J.js} +7 -7
- package/dist/bundle/{state-YFPHVIIJ.js → state-TQI4JSH7.js} +9 -9
- package/dist/bundle/{store-CL4ZJZRI.js → store-GS7PU6PJ.js} +38 -23
- package/dist/bundle/{store-UODRT6X4.js → store-VYJPL7MW.js} +36 -25
- package/dist/bundle/store-maintenance-command-JJVYUZMG.js +85 -0
- package/dist/bundle/surface-JC4XVMZR.js +83 -0
- package/dist/bundle/tokens-KJQ5EAPW.js +133 -0
- package/dist/commands/documents.d.ts.map +1 -1
- package/dist/commands/documents.js +11 -1
- package/dist/commands/documents.js.map +1 -1
- package/dist/commands/remote.d.ts.map +1 -1
- package/dist/commands/remote.js +8 -22
- package/dist/commands/remote.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +14 -4
- package/dist/commands/sync.js.map +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -0
- package/dist/config.js.map +1 -1
- package/dist/first-screen.d.ts.map +1 -1
- package/dist/first-screen.js +2 -1
- package/dist/first-screen.js.map +1 -1
- package/dist/generated/manifest.d.ts +2 -1
- package/dist/generated/manifest.d.ts.map +1 -1
- package/dist/generated/manifest.js +782 -0
- package/dist/generated/manifest.js.map +1 -1
- package/dist/generated/types.d.ts +262 -58
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/google.d.ts.map +1 -1
- package/dist/google.js +5 -5
- package/dist/google.js.map +1 -1
- package/dist/model.d.ts +5 -2
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js.map +1 -1
- package/dist/policy-keys.js +1 -1
- package/dist/policy-keys.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +9 -4
- package/dist/program.js.map +1 -1
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +6 -1
- package/dist/state.js.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +2 -7
- package/dist/store.js.map +1 -1
- package/dist/supported.d.ts +2 -2
- package/dist/supported.d.ts.map +1 -1
- package/dist/supported.js +2 -3
- package/dist/supported.js.map +1 -1
- package/dist/sync.d.ts +2 -1
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +5 -2
- package/dist/sync.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/scenarios/find-decision.md +1 -1
- package/skills/drive-cli/SKILL.md +4 -2
- package/dist/bundle/chunk-J5Q5FS2N.js +0 -593
- package/dist/bundle/chunk-L46C6HQ7.js +0 -729
- package/dist/bundle/chunk-UDMNY63V.js +0 -899
- package/dist/bundle/chunk-VKE77B3F.js +0 -2
- package/dist/bundle/command-contract-VRTOAV6W.js +0 -43
- package/dist/bundle/entry-MVXQETWS.js +0 -25
- package/dist/bundle/first-run-4UVLW2WR.js +0 -31
- package/dist/bundle/first-screen-JAKAIINI.js +0 -41
- package/dist/bundle/google-22NXXJX5.js +0 -45
- package/dist/bundle/grants-MQMTVCRQ.js +0 -118
- package/dist/bundle/mdast-util-gfm-SZM5GBDF.js +0 -2103
- package/dist/bundle/meeting-combined-LVP4AZKA.js +0 -27
- package/dist/bundle/meeting-model-RAY5XDXZ.js +0 -29
- package/dist/bundle/oauth-SGH2I2BY.js +0 -22
- package/dist/bundle/remote-D5EYYIAU.js +0 -35
- package/dist/bundle/server-DUVJWP3Q.js +0 -80
- package/dist/bundle/store-maintenance-command-DY5XIBWR.js +0 -72
- package/dist/bundle/tokens-AF7QOFOF.js +0 -118
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
throughWrapper
|
|
5
|
+
} from "./chunk-G2KKMQRN.js";
|
|
6
|
+
import {
|
|
7
|
+
environmentOf
|
|
8
|
+
} from "./chunk-JRED7BNX.js";
|
|
9
|
+
import {
|
|
10
|
+
readOnlyLockOf
|
|
11
|
+
} from "./chunk-5BHP4FVM.js";
|
|
12
|
+
import {
|
|
13
|
+
array,
|
|
14
|
+
boolean,
|
|
15
|
+
check,
|
|
16
|
+
pipe,
|
|
17
|
+
record,
|
|
18
|
+
safeParse,
|
|
19
|
+
strictObject,
|
|
20
|
+
string
|
|
21
|
+
} from "./chunk-OBDPKDGB.js";
|
|
22
|
+
import {
|
|
23
|
+
CliError
|
|
24
|
+
} from "./chunk-IBQZT2YD.js";
|
|
25
|
+
import {
|
|
26
|
+
__name
|
|
27
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
28
|
+
|
|
29
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/background/relay.js
|
|
30
|
+
import { createHash } from "node:crypto";
|
|
31
|
+
import { chmodSync, lstatSync, mkdirSync, rmSync } from "node:fs";
|
|
32
|
+
import { createConnection, createServer } from "node:net";
|
|
33
|
+
import { tmpdir } from "node:os";
|
|
34
|
+
import { dirname, isAbsolute, join } from "node:path";
|
|
35
|
+
import { PassThrough, Writable } from "node:stream";
|
|
36
|
+
var RELAY_PROTOCOL = 1;
|
|
37
|
+
var requestSchema = strictObject({
|
|
38
|
+
argv: array(string()),
|
|
39
|
+
env: record(string(), string()),
|
|
40
|
+
cwd: pipe(string(), check((path) => isAbsolute(path))),
|
|
41
|
+
tty: boolean(),
|
|
42
|
+
stdinTty: boolean()
|
|
43
|
+
});
|
|
44
|
+
var MAX_CLIENT_LINE = 1024 * 1024;
|
|
45
|
+
var MAX_SERVE_LINE = 64 * 1024 * 1024;
|
|
46
|
+
var MAX_SOCKET_PATH = 100;
|
|
47
|
+
var relayPath = /* @__PURE__ */ __name((lockPath) => {
|
|
48
|
+
const beside = lockPath.replace(/\.lock$/, ".sock");
|
|
49
|
+
if (beside.length <= MAX_SOCKET_PATH)
|
|
50
|
+
return beside;
|
|
51
|
+
const hash = createHash("sha256").update(beside).digest("hex").slice(0, 16);
|
|
52
|
+
const name = join(`wirecat-relay-${process.getuid?.() ?? "user"}`, `${hash}.sock`);
|
|
53
|
+
const temporary = join(tmpdir(), name);
|
|
54
|
+
if (temporary.length <= MAX_SOCKET_PATH || process.platform === "win32")
|
|
55
|
+
return temporary;
|
|
56
|
+
return join("/tmp", name);
|
|
57
|
+
}, "relayPath");
|
|
58
|
+
var privateDirectory = /* @__PURE__ */ __name((dir) => {
|
|
59
|
+
mkdirSync(dir, { recursive: true, mode: 448 });
|
|
60
|
+
const stat = lstatSync(dir);
|
|
61
|
+
const mine = process.getuid === void 0 || stat.uid === process.getuid();
|
|
62
|
+
if (!stat.isDirectory() || !mine || (stat.mode & 63) !== 0) {
|
|
63
|
+
throw new CliError("permission_error", `${dir} is not a private directory, so serve does not listen there`);
|
|
64
|
+
}
|
|
65
|
+
}, "privateDirectory");
|
|
66
|
+
var lines = /* @__PURE__ */ __name((socket, max, onLine, onTooLong) => {
|
|
67
|
+
let buffered = "";
|
|
68
|
+
socket.setEncoding("utf8");
|
|
69
|
+
socket.on("data", (chunk) => {
|
|
70
|
+
buffered += chunk;
|
|
71
|
+
for (let end = buffered.indexOf("\n"); end >= 0; end = buffered.indexOf("\n")) {
|
|
72
|
+
const line = buffered.slice(0, end);
|
|
73
|
+
buffered = buffered.slice(end + 1);
|
|
74
|
+
if (line)
|
|
75
|
+
onLine(line);
|
|
76
|
+
}
|
|
77
|
+
if (buffered.length > max)
|
|
78
|
+
onTooLong();
|
|
79
|
+
});
|
|
80
|
+
}, "lines");
|
|
81
|
+
var frame = /* @__PURE__ */ __name((socket, value) => {
|
|
82
|
+
if (!socket.destroyed)
|
|
83
|
+
socket.write(`${JSON.stringify(value)}
|
|
84
|
+
`);
|
|
85
|
+
}, "frame");
|
|
86
|
+
var listenRelay = /* @__PURE__ */ __name(async (path, run) => {
|
|
87
|
+
privateDirectory(dirname(path));
|
|
88
|
+
rmSync(path, { force: true });
|
|
89
|
+
const open = /* @__PURE__ */ new Set();
|
|
90
|
+
const running = /* @__PURE__ */ new Set();
|
|
91
|
+
const server = createServer((socket) => {
|
|
92
|
+
open.add(socket);
|
|
93
|
+
const stop = new AbortController();
|
|
94
|
+
const stdin = new PassThrough();
|
|
95
|
+
let started = false;
|
|
96
|
+
socket.on("error", () => {
|
|
97
|
+
});
|
|
98
|
+
socket.on("close", () => {
|
|
99
|
+
open.delete(socket);
|
|
100
|
+
stop.abort(new CliError("cancelled", "the client went away", { retryable: false }));
|
|
101
|
+
if (!stdin.writableEnded)
|
|
102
|
+
stdin.end();
|
|
103
|
+
});
|
|
104
|
+
lines(socket, MAX_CLIENT_LINE, (line) => {
|
|
105
|
+
let message;
|
|
106
|
+
try {
|
|
107
|
+
message = JSON.parse(line);
|
|
108
|
+
} catch {
|
|
109
|
+
socket.destroy();
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (!started) {
|
|
113
|
+
started = true;
|
|
114
|
+
if (message.v !== RELAY_PROTOCOL) {
|
|
115
|
+
frame(socket, { diagnostic: `serve speaks relay protocol ${RELAY_PROTOCOL}; restart it`, exit: 1 });
|
|
116
|
+
socket.end();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const parsed = safeParse(requestSchema, message.run);
|
|
120
|
+
if (!parsed.success) {
|
|
121
|
+
socket.destroy();
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
stdin.isTTY = parsed.output.stdinTty;
|
|
125
|
+
if (parsed.output.stdinTty)
|
|
126
|
+
stdin.end();
|
|
127
|
+
const job = serve(socket, parsed.output, stdin, stop.signal, run);
|
|
128
|
+
running.add(job);
|
|
129
|
+
void job.then(() => running.delete(job), () => running.delete(job));
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (typeof message.stdin === "string" && !stdin.writableEnded)
|
|
133
|
+
stdin.write(Buffer.from(message.stdin, "base64"));
|
|
134
|
+
if (message.stdinEnd === true && !stdin.writableEnded)
|
|
135
|
+
stdin.end();
|
|
136
|
+
}, () => socket.destroy());
|
|
137
|
+
});
|
|
138
|
+
await new Promise((resolve, reject) => {
|
|
139
|
+
server.once("error", reject);
|
|
140
|
+
server.listen(path, () => {
|
|
141
|
+
server.off("error", reject);
|
|
142
|
+
resolve();
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
chmodSync(path, 384);
|
|
146
|
+
return {
|
|
147
|
+
close: /* @__PURE__ */ __name(async () => {
|
|
148
|
+
for (const socket of open)
|
|
149
|
+
socket.destroy();
|
|
150
|
+
await new Promise((resolve) => server.close(() => resolve()));
|
|
151
|
+
await Promise.allSettled(running);
|
|
152
|
+
rmSync(path, { force: true });
|
|
153
|
+
}, "close")
|
|
154
|
+
};
|
|
155
|
+
}, "listenRelay");
|
|
156
|
+
var serve = /* @__PURE__ */ __name(async (socket, request, stdin, signal, run) => {
|
|
157
|
+
const streams = {
|
|
158
|
+
data: /* @__PURE__ */ __name((text) => frame(socket, { data: text }), "data"),
|
|
159
|
+
diagnostic: /* @__PURE__ */ __name((text) => frame(socket, { diagnostic: text }), "diagnostic"),
|
|
160
|
+
progress: /* @__PURE__ */ __name((text) => frame(socket, { progress: text }), "progress")
|
|
161
|
+
};
|
|
162
|
+
const stdout = new Writable({
|
|
163
|
+
write: /* @__PURE__ */ __name((chunk, _encoding, done) => {
|
|
164
|
+
frame(socket, { raw: Buffer.from(chunk).toString("base64") });
|
|
165
|
+
done();
|
|
166
|
+
}, "write")
|
|
167
|
+
});
|
|
168
|
+
let code = 1;
|
|
169
|
+
try {
|
|
170
|
+
code = await run(request, { streams, stdin, stdout, signal });
|
|
171
|
+
} finally {
|
|
172
|
+
frame(socket, { exit: code });
|
|
173
|
+
socket.end();
|
|
174
|
+
}
|
|
175
|
+
}, "serve");
|
|
176
|
+
var relayCommand = /* @__PURE__ */ __name((path, request, options) => new Promise((resolve, reject) => {
|
|
177
|
+
const { streams, stdin, stdout, signal, deadlineMs, writes, holder, listens = false } = options;
|
|
178
|
+
const socket = createConnection(path);
|
|
179
|
+
let connected = false;
|
|
180
|
+
let settled = false;
|
|
181
|
+
let timer;
|
|
182
|
+
const forward = /* @__PURE__ */ __name((chunk) => frame(socket, { stdin: Buffer.from(chunk).toString("base64") }), "forward");
|
|
183
|
+
const ended = /* @__PURE__ */ __name(() => frame(socket, { stdinEnd: true }), "ended");
|
|
184
|
+
const brokenPipe = /* @__PURE__ */ __name((error) => {
|
|
185
|
+
if (error.code === "EPIPE")
|
|
186
|
+
finish({ code: 0 });
|
|
187
|
+
}, "brokenPipe");
|
|
188
|
+
const finish = /* @__PURE__ */ __name((outcome) => {
|
|
189
|
+
if (settled)
|
|
190
|
+
return;
|
|
191
|
+
settled = true;
|
|
192
|
+
if (timer)
|
|
193
|
+
clearTimeout(timer);
|
|
194
|
+
stdout.off("error", brokenPipe);
|
|
195
|
+
signal.removeEventListener("abort", aborted);
|
|
196
|
+
stdin.off("data", forward).off("end", ended);
|
|
197
|
+
stdin.pause();
|
|
198
|
+
socket.destroy();
|
|
199
|
+
if ("code" in outcome)
|
|
200
|
+
resolve(outcome.code);
|
|
201
|
+
else
|
|
202
|
+
reject(outcome.error);
|
|
203
|
+
}, "finish");
|
|
204
|
+
const stopped = /* @__PURE__ */ __name(() => writes ? new CliError("outcome_unknown", `${holder} stopped before the command finished; it may have run \u2014 check before repeating it`, { retryable: false }) : new CliError("provider_unavailable", `${holder} stopped before the command finished`, { retryable: true }), "stopped");
|
|
205
|
+
const aborted = /* @__PURE__ */ __name(() => finish(listens ? { code: 0 } : { error: signal.reason }), "aborted");
|
|
206
|
+
if (signal.aborted)
|
|
207
|
+
return aborted();
|
|
208
|
+
signal.addEventListener("abort", aborted, { once: true });
|
|
209
|
+
stdout.on("error", brokenPipe);
|
|
210
|
+
if (deadlineMs !== void 0)
|
|
211
|
+
timer = setTimeout(() => finish({ error: stopped() }), deadlineMs);
|
|
212
|
+
socket.on("connect", () => {
|
|
213
|
+
connected = true;
|
|
214
|
+
frame(socket, { v: RELAY_PROTOCOL, run: request });
|
|
215
|
+
if (request.stdinTty)
|
|
216
|
+
ended();
|
|
217
|
+
else {
|
|
218
|
+
stdin.on("data", forward).once("end", ended);
|
|
219
|
+
stdin.resume();
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
socket.on("error", (error) => {
|
|
223
|
+
if (connected)
|
|
224
|
+
return finish({ error: stopped() });
|
|
225
|
+
finish({
|
|
226
|
+
error: new CliError("provider_unavailable", `${holder} holds the connection but does not answer its relay (${error.code ?? error.message}) \u2014 restart it`, { retryable: false, sent: false })
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
socket.on("close", () => finish({ error: stopped() }));
|
|
230
|
+
lines(socket, MAX_SERVE_LINE, (line) => {
|
|
231
|
+
let message;
|
|
232
|
+
try {
|
|
233
|
+
message = JSON.parse(line);
|
|
234
|
+
} catch {
|
|
235
|
+
return finish({ error: stopped() });
|
|
236
|
+
}
|
|
237
|
+
if (typeof message.data === "string")
|
|
238
|
+
streams.data(message.data);
|
|
239
|
+
if (typeof message.diagnostic === "string")
|
|
240
|
+
streams.diagnostic(message.diagnostic);
|
|
241
|
+
if (typeof message.progress === "string")
|
|
242
|
+
streams.progress?.(message.progress);
|
|
243
|
+
if (typeof message.raw === "string")
|
|
244
|
+
stdout.write(Buffer.from(message.raw, "base64"));
|
|
245
|
+
if (typeof message.exit === "number")
|
|
246
|
+
finish({ code: message.exit });
|
|
247
|
+
}, () => finish({ error: stopped() }));
|
|
248
|
+
}), "relayCommand");
|
|
249
|
+
|
|
250
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/cli/messenger/serve-relay.js
|
|
251
|
+
var lentConnection = /* @__PURE__ */ __name((connection, watchers) => throughWrapper(connection, {
|
|
252
|
+
close: /* @__PURE__ */ __name(async () => {
|
|
253
|
+
}, "close"),
|
|
254
|
+
feed: void 0,
|
|
255
|
+
storedChats: void 0,
|
|
256
|
+
listen: void 0,
|
|
257
|
+
listenHistory: void 0,
|
|
258
|
+
...connection.watch && watchers ? {
|
|
259
|
+
// A watcher that throws (its output limit, a closed reader) ends its own watch, never serve's.
|
|
260
|
+
watch: /* @__PURE__ */ __name(async (onEvent, signal, onReady) => {
|
|
261
|
+
let watcher;
|
|
262
|
+
try {
|
|
263
|
+
await new Promise((resolve, reject) => {
|
|
264
|
+
watcher = /* @__PURE__ */ __name((event) => {
|
|
265
|
+
try {
|
|
266
|
+
onEvent(event);
|
|
267
|
+
} catch (error) {
|
|
268
|
+
reject(error);
|
|
269
|
+
}
|
|
270
|
+
}, "watcher");
|
|
271
|
+
watchers.add(watcher);
|
|
272
|
+
signal.addEventListener("abort", () => resolve(), { once: true });
|
|
273
|
+
onReady?.();
|
|
274
|
+
if (signal.aborted)
|
|
275
|
+
resolve();
|
|
276
|
+
});
|
|
277
|
+
} finally {
|
|
278
|
+
if (watcher)
|
|
279
|
+
watchers.delete(watcher);
|
|
280
|
+
}
|
|
281
|
+
}, "watch")
|
|
282
|
+
} : { watch: void 0 }
|
|
283
|
+
}), "lentConnection");
|
|
284
|
+
var serveRelay = /* @__PURE__ */ __name((command, messenger) => {
|
|
285
|
+
let held;
|
|
286
|
+
let relay;
|
|
287
|
+
const watchers = /* @__PURE__ */ new Set();
|
|
288
|
+
const borrowed = /* @__PURE__ */ __name(() => {
|
|
289
|
+
const connection = held;
|
|
290
|
+
if (!connection)
|
|
291
|
+
throw new CliError("provider_unavailable", "serve is not connected yet", { retryable: true });
|
|
292
|
+
return lentConnection(connection, watchers);
|
|
293
|
+
}, "borrowed");
|
|
294
|
+
return {
|
|
295
|
+
messenger: {
|
|
296
|
+
...messenger,
|
|
297
|
+
connect: /* @__PURE__ */ __name(async (...args) => {
|
|
298
|
+
held = await messenger.connect(...args);
|
|
299
|
+
return held;
|
|
300
|
+
}, "connect")
|
|
301
|
+
},
|
|
302
|
+
arrived: /* @__PURE__ */ __name((event) => {
|
|
303
|
+
for (const watcher of watchers)
|
|
304
|
+
watcher(event);
|
|
305
|
+
}, "arrived"),
|
|
306
|
+
/** Listens beside the lock; the address goes into it, which is how a client finds it. */
|
|
307
|
+
open: /* @__PURE__ */ __name(async (lockPath, profile) => {
|
|
308
|
+
const environment = environmentOf(command);
|
|
309
|
+
const runCommand = environment.runCommand;
|
|
310
|
+
if (!runCommand)
|
|
311
|
+
return void 0;
|
|
312
|
+
const readOnly = readOnlyLockOf(messenger.app, environment.env ?? process.env);
|
|
313
|
+
const path = relayPath(lockPath);
|
|
314
|
+
relay = await listenRelay(path, (request, io) => runCommand(request.argv, {
|
|
315
|
+
env: {
|
|
316
|
+
...request.env,
|
|
317
|
+
...readOnly ? { [`${messenger.app.envPrefix}_READ_ONLY`]: "1" } : {}
|
|
318
|
+
},
|
|
319
|
+
streams: io.streams,
|
|
320
|
+
stdin: io.stdin,
|
|
321
|
+
stdout: io.stdout,
|
|
322
|
+
tty: request.tty,
|
|
323
|
+
signal: io.signal,
|
|
324
|
+
answer: /* @__PURE__ */ __name(() => null, "answer"),
|
|
325
|
+
relayed: { profile, cwd: request.cwd, connection: borrowed }
|
|
326
|
+
}));
|
|
327
|
+
return { path, protocol: RELAY_PROTOCOL };
|
|
328
|
+
}, "open"),
|
|
329
|
+
close: /* @__PURE__ */ __name(async () => {
|
|
330
|
+
await relay?.close();
|
|
331
|
+
}, "close")
|
|
332
|
+
};
|
|
333
|
+
}, "serveRelay");
|
|
334
|
+
|
|
335
|
+
export {
|
|
336
|
+
RELAY_PROTOCOL,
|
|
337
|
+
relayCommand,
|
|
338
|
+
lentConnection,
|
|
339
|
+
serveRelay
|
|
340
|
+
};
|
|
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
normalize
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AG34MPVN.js";
|
|
6
6
|
import {
|
|
7
7
|
CliError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IBQZT2YD.js";
|
|
9
9
|
import {
|
|
10
10
|
__name
|
|
11
11
|
} from "./chunk-ZVVMGPBJ.js";
|
|
12
12
|
|
|
13
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/search/languages.js
|
|
14
14
|
var LANGUAGES = [
|
|
15
15
|
{ name: "russian", code: "ru", label: "Russian", script: "cyrillic", dictionary: "dictionary-ru" },
|
|
16
16
|
{ name: "english", code: "en", label: "English", script: "latin", dictionary: "dictionary-en" },
|
|
@@ -18,7 +18,7 @@ var LANGUAGES = [
|
|
|
18
18
|
];
|
|
19
19
|
var languagesOf = /* @__PURE__ */ __name((script) => LANGUAGES.filter((one) => one.script === script).map(({ name }) => name), "languagesOf");
|
|
20
20
|
|
|
21
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
21
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/search/snowball/base-stemmer.js
|
|
22
22
|
var BaseStemmer = class {
|
|
23
23
|
static {
|
|
24
24
|
__name(this, "BaseStemmer");
|
|
@@ -393,7 +393,7 @@ var BaseStemmer = class {
|
|
|
393
393
|
}
|
|
394
394
|
};
|
|
395
395
|
|
|
396
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
396
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/search/snowball/english-stemmer.js
|
|
397
397
|
var a_0 = [
|
|
398
398
|
["arsen", -1],
|
|
399
399
|
["commun", -1],
|
|
@@ -1094,7 +1094,7 @@ var english_stemmer_default = class extends BaseStemmer {
|
|
|
1094
1094
|
stemWord = this.stem;
|
|
1095
1095
|
};
|
|
1096
1096
|
|
|
1097
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1097
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/search/snowball/russian-stemmer.js
|
|
1098
1098
|
var a_02 = [
|
|
1099
1099
|
["\u0432", 1],
|
|
1100
1100
|
["\u0438\u0432", 2, 1],
|
|
@@ -1517,7 +1517,7 @@ var russian_stemmer_default = class extends BaseStemmer {
|
|
|
1517
1517
|
stemWord = this.stem;
|
|
1518
1518
|
};
|
|
1519
1519
|
|
|
1520
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
1520
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/search/snowball/spanish-stemmer.js
|
|
1521
1521
|
var a_03 = [
|
|
1522
1522
|
["", 6],
|
|
1523
1523
|
["\xE1", 1, 1],
|
|
@@ -2193,12 +2193,13 @@ var spanish_stemmer_default = class extends BaseStemmer {
|
|
|
2193
2193
|
stemWord = this.stem;
|
|
2194
2194
|
};
|
|
2195
2195
|
|
|
2196
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
2196
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/search/stem.js
|
|
2197
2197
|
var SNOWBALL_VERSION = "3.1.1";
|
|
2198
2198
|
var CYRILLIC_STEMMERS = [...languagesOf("cyrillic"), "none"];
|
|
2199
2199
|
var LATIN_STEMMERS = [...languagesOf("latin"), "none"];
|
|
2200
2200
|
var DEFAULT_STEMMERS = { cyrillic: "russian", latin: "english,spanish" };
|
|
2201
2201
|
var DEFAULT_STEMMERS_VERSION = 2;
|
|
2202
|
+
var START_LETTERS = 4;
|
|
2202
2203
|
var STEM_SEPARATOR = "0stemsep0";
|
|
2203
2204
|
var STEM_CACHE_LIMIT = 2e5;
|
|
2204
2205
|
var analyzerIdentity = /* @__PURE__ */ __name((stemmers) => `snowball-${SNOWBALL_VERSION} cyrillic=${stemmers.cyrillic} latin=${stemmers.latin}`, "analyzerIdentity");
|
|
@@ -2233,7 +2234,12 @@ var snowball = {
|
|
|
2233
2234
|
english: /* @__PURE__ */ __name(() => new english_stemmer_default(), "english"),
|
|
2234
2235
|
none: /* @__PURE__ */ __name(() => null, "none")
|
|
2235
2236
|
};
|
|
2236
|
-
var
|
|
2237
|
+
var cutsDeep = /* @__PURE__ */ __name((stemmer, token) => {
|
|
2238
|
+
const word = [...normalize(token.normalize("NFC").toLowerCase().replace(MARKS, ""))];
|
|
2239
|
+
const stem = [...stemmer.stemToken(token)];
|
|
2240
|
+
return stem.length < 4 && word.length - stem.length >= 2;
|
|
2241
|
+
}, "cutsDeep");
|
|
2242
|
+
var createStemmer = /* @__PURE__ */ __name((stemmers = DEFAULT_STEMMERS, { cacheLimit = STEM_CACHE_LIMIT, whole = /* @__PURE__ */ new Set() } = {}) => {
|
|
2237
2243
|
const valid = parseStemmers(stemmers);
|
|
2238
2244
|
const cyrillic = snowball[valid.cyrillic]();
|
|
2239
2245
|
const latinNames = valid.latin.split(",");
|
|
@@ -2258,6 +2264,21 @@ var createStemmer = /* @__PURE__ */ __name((stemmers = DEFAULT_STEMMERS, { cache
|
|
|
2258
2264
|
return stem;
|
|
2259
2265
|
}, "stemOf");
|
|
2260
2266
|
const stemToken = /* @__PURE__ */ __name((token) => stemOf(token, 0), "stemToken");
|
|
2267
|
+
const queryStemOf = /* @__PURE__ */ __name((token, variant) => {
|
|
2268
|
+
const word = normalize(token.normalize("NFC").toLowerCase().replace(MARKS, ""));
|
|
2269
|
+
return whole.has(word) ? word : stemOf(token, variant);
|
|
2270
|
+
}, "queryStemOf");
|
|
2271
|
+
const querySequences = /* @__PURE__ */ __name((text) => {
|
|
2272
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2273
|
+
return latins.flatMap((_, variant) => {
|
|
2274
|
+
const sequence = tokensOf(text).map((token) => queryStemOf(token, variant)).filter(Boolean);
|
|
2275
|
+
const key = sequence.join(" ");
|
|
2276
|
+
if (seen.has(key))
|
|
2277
|
+
return [];
|
|
2278
|
+
seen.add(key);
|
|
2279
|
+
return [sequence];
|
|
2280
|
+
});
|
|
2281
|
+
}, "querySequences");
|
|
2261
2282
|
const tokensOf = /* @__PURE__ */ __name((text) => text.normalize("NFC").toLowerCase().match(TOKEN) ?? [], "tokensOf");
|
|
2262
2283
|
const stemSequences = /* @__PURE__ */ __name((text) => {
|
|
2263
2284
|
const tokens = tokensOf(text);
|
|
@@ -2279,16 +2300,16 @@ var createStemmer = /* @__PURE__ */ __name((stemmers = DEFAULT_STEMMERS, { cache
|
|
|
2279
2300
|
stemSequences,
|
|
2280
2301
|
indexText: /* @__PURE__ */ __name((text) => stemSequences(text).map((sequence) => sequence.join(" ")).filter(Boolean).join(` ${STEM_SEPARATOR} `), "indexText"),
|
|
2281
2302
|
phrases: /* @__PURE__ */ __name((text) => {
|
|
2282
|
-
const phrases =
|
|
2303
|
+
const phrases = querySequences(text).filter((sequence) => sequence.length > 0).map((sequence) => `"${sequence.join(" ").replaceAll('"', '""')}"`);
|
|
2283
2304
|
return phrases.length ? phrases.join(" OR ") : void 0;
|
|
2284
2305
|
}, "phrases"),
|
|
2285
|
-
explain: /* @__PURE__ */ __name((text) => tokensOf(text).flatMap((word) => {
|
|
2306
|
+
explain: /* @__PURE__ */ __name((text, { query = false } = {}) => tokensOf(text).flatMap((word) => {
|
|
2286
2307
|
const bare = word.replace(MARKS, "");
|
|
2287
2308
|
const script = CYRILLIC.test(bare) ? "cyrillic" : LATIN.test(bare) ? "latin" : "none";
|
|
2288
2309
|
const variants = script === "latin" ? latinNames.map((name, variant) => ({ name, variant })) : [{ name: script === "cyrillic" ? valid.cyrillic : "none", variant: 0 }];
|
|
2289
2310
|
const seen = /* @__PURE__ */ new Set();
|
|
2290
2311
|
return variants.flatMap(({ name, variant }) => {
|
|
2291
|
-
const stem = stemOf(word, variant);
|
|
2312
|
+
const stem = query ? queryStemOf(word, variant) : stemOf(word, variant);
|
|
2292
2313
|
if (!stem || seen.has(stem))
|
|
2293
2314
|
return [];
|
|
2294
2315
|
seen.add(stem);
|
|
@@ -2303,8 +2324,10 @@ export {
|
|
|
2303
2324
|
SNOWBALL_VERSION,
|
|
2304
2325
|
DEFAULT_STEMMERS,
|
|
2305
2326
|
DEFAULT_STEMMERS_VERSION,
|
|
2327
|
+
START_LETTERS,
|
|
2306
2328
|
STEM_SEPARATOR,
|
|
2307
2329
|
analyzerIdentity,
|
|
2308
2330
|
parseStemmers,
|
|
2331
|
+
cutsDeep,
|
|
2309
2332
|
createStemmer
|
|
2310
2333
|
};
|
|
@@ -2,15 +2,15 @@ import { createRequire as __bundleRequire } from "node:module";
|
|
|
2
2
|
const require = __bundleRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
singleLine
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MDJUYCHT.js";
|
|
6
6
|
import {
|
|
7
7
|
CliError
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IBQZT2YD.js";
|
|
9
9
|
import {
|
|
10
10
|
__name
|
|
11
11
|
} from "./chunk-ZVVMGPBJ.js";
|
|
12
12
|
|
|
13
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
13
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/domain/tags.js
|
|
14
14
|
var TAG_TYPES = ["chat", "contact", "message", "task"];
|
|
15
15
|
var TAG = /^[a-z0-9-]{1,32}$/;
|
|
16
16
|
var tagOf = /* @__PURE__ */ __name((value) => {
|