@wirecat/drive-cli 0.71.0 → 0.72.0
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-23OB2NZP.js +46 -0
- package/dist/bundle/{all-profiles-3QJG2NAN.js → all-profiles-GXGDVNQJ.js} +67 -25
- package/dist/bundle/{anthropic-PSWTEU6G.js → anthropic-H5C4GQHC.js} +9 -9
- package/dist/bundle/{app-server-PVTA6ABR.js → app-server-EQ3UK4C7.js} +97 -79
- package/dist/bundle/{bun-LU5LP3JI.js → bun-DTJVSRY3.js} +2 -2
- package/dist/bundle/{bun-sqlite-PYMKLBRU.js → bun-sqlite-JIFY7MAE.js} +9 -9
- package/dist/bundle/chunk-2Q325BBD.js +353 -0
- package/dist/bundle/chunk-35FIJGTT.js +52 -0
- package/dist/bundle/{chunk-RWDKMU74.js → chunk-3FRQ6V4T.js} +3 -3
- package/dist/bundle/chunk-47L262VI.js +340 -0
- package/dist/bundle/chunk-4HP6KGBI.js +32 -0
- package/dist/bundle/{chunk-YVI5SQPY.js → chunk-4HPXWYTE.js} +1 -1
- package/dist/bundle/{chunk-QETR5HIZ.js → chunk-4IUNYYYL.js} +4385 -2684
- package/dist/bundle/{chunk-I4RWW3UD.js → chunk-4JS32SRX.js} +20 -5
- package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
- package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
- package/dist/bundle/{chunk-3N2OFXB5.js → chunk-55FH6IEL.js} +5 -5
- package/dist/bundle/{chunk-6TNNT2MQ.js → chunk-5BNMWSU2.js} +483 -176
- package/dist/bundle/{chunk-6XFIITOG.js → chunk-5H747A76.js} +5532 -3265
- package/dist/bundle/{chunk-MNLL5YLM.js → chunk-5KWCO56H.js} +2 -2
- package/dist/bundle/{chunk-GZ2D4KXG.js → chunk-5U3NCE5R.js} +35 -12
- package/dist/bundle/{chunk-CJLVYIOP.js → chunk-6CCO3JCM.js} +30 -21
- package/dist/bundle/{chunk-26DHFMGZ.js → chunk-6ZW2ZJYC.js} +2 -2
- package/dist/bundle/{chunk-COJSWDNU.js → chunk-75DAHQOV.js} +3 -3
- package/dist/bundle/{chunk-Q7DOMFJ4.js → chunk-77OBW43F.js} +6 -6
- package/dist/bundle/{chunk-FCS26CYQ.js → chunk-7EFM6AW3.js} +4 -4
- package/dist/bundle/{chunk-XMMFBPGC.js → chunk-A3S7QM5L.js} +3 -3
- package/dist/bundle/{chunk-ASMMG72J.js → chunk-AA4LKC6W.js} +244 -565
- package/dist/bundle/chunk-ASTKHB6B.js +3233 -0
- package/dist/bundle/{chunk-LXKYKRHD.js → chunk-BM6V7456.js} +8 -227
- package/dist/bundle/chunk-BO6EDBYJ.js +50 -0
- package/dist/bundle/{chunk-YPFWNVHV.js → chunk-BPA3R4KN.js} +2 -100
- package/dist/bundle/chunk-CIFE4KPX.js +2159 -0
- package/dist/bundle/chunk-CKB4XZZJ.js +730 -0
- package/dist/bundle/{chunk-RJOQH5YY.js → chunk-COJTCEZP.js} +111 -859
- package/dist/bundle/{chunk-FJH7DJWK.js → chunk-CWPYDT73.js} +6 -6
- package/dist/bundle/{chunk-BKSQBBYG.js → chunk-D4JNCXS7.js} +9 -9
- package/dist/bundle/chunk-DCPWZIOV.js +696 -0
- package/dist/bundle/{chunk-PRW6SYA3.js → chunk-DHMNCOQI.js} +313 -257
- package/dist/bundle/chunk-DOQMH4DC.js +280 -0
- package/dist/bundle/chunk-DQSOYH6N.js +20 -0
- package/dist/bundle/{chunk-YJIGGUPI.js → chunk-DWRUOLBF.js} +4 -4
- package/dist/bundle/{chunk-6W763DZN.js → chunk-E3VWZC3K.js} +14 -13
- package/dist/bundle/chunk-ECYOTDJM.js +14 -0
- package/dist/bundle/{chunk-KGYVHPGE.js → chunk-EVG3AA5M.js} +2 -2
- package/dist/bundle/chunk-F4BX7TH2.js +15 -0
- package/dist/bundle/{chunk-Y2NWGNUB.js → chunk-FBEZSA76.js} +5 -5
- package/dist/bundle/{chunk-2BVVU7GG.js → chunk-FBQJN74J.js} +1 -1
- package/dist/bundle/{chunk-Z56QFOBR.js → chunk-FIZOPJYY.js} +1 -1
- package/dist/bundle/chunk-FNAYSZWK.js +783 -0
- package/dist/bundle/{chunk-GPQ44Y2R.js → chunk-FRCJHGZM.js} +2 -2
- package/dist/bundle/{chunk-35SCQ4VI.js → chunk-FTG5QBSD.js} +41 -33
- package/dist/bundle/{chunk-KYKW2W6X.js → chunk-FUDUXIVG.js} +1 -1
- package/dist/bundle/{chunk-NYECVHFH.js → chunk-G4NHRFS7.js} +755 -0
- package/dist/bundle/{chunk-FT3LN3HP.js → chunk-GIEZYBRC.js} +1 -1
- package/dist/bundle/chunk-GTPPUBYU.js +1876 -0
- package/dist/bundle/chunk-GU6ICH53.js +108 -0
- package/dist/bundle/{chunk-ACUAV6VX.js → chunk-GUMKKRE6.js} +107 -71
- package/dist/bundle/{chunk-KGERXYTV.js → chunk-GWCDOYSC.js} +1 -1
- package/dist/bundle/{chunk-OJSBWP3F.js → chunk-GXGSC622.js} +69 -7
- package/dist/bundle/chunk-HAGXTGJC.js +188 -0
- package/dist/bundle/{chunk-XF4EXO2C.js → chunk-IMAWQC5K.js} +6 -6
- package/dist/bundle/{chunk-HKY7X6NY.js → chunk-IVGVVSPW.js} +4 -4
- package/dist/bundle/{chunk-P7CUM5IB.js → chunk-J4NUHSM7.js} +1 -1
- package/dist/bundle/{chunk-MIA7P6FZ.js → chunk-K652FYCO.js} +6 -6
- package/dist/bundle/chunk-K6ZWNTXY.js +561 -0
- package/dist/bundle/{chunk-COOOO5B3.js → chunk-KF3ZBQJV.js} +4 -4
- package/dist/bundle/chunk-KFZCHJRT.js +80 -0
- package/dist/bundle/chunk-KLPFDFLI.js +221 -0
- package/dist/bundle/{chunk-EOEU3AZN.js → chunk-KP2XMCNT.js} +13 -13
- package/dist/bundle/{chunk-FP54WSIR.js → chunk-KWDZ3KVH.js} +4 -4
- package/dist/bundle/{chunk-QNRRK3CN.js → chunk-KX4C32WD.js} +2 -2
- package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
- package/dist/bundle/{chunk-2LHAVY4U.js → chunk-M2ZWYVWO.js} +1 -1
- package/dist/bundle/chunk-MEYYH47C.js +25 -0
- package/dist/bundle/{chunk-3EBBLKIT.js → chunk-ML2QIWX2.js} +4 -4
- package/dist/bundle/{chunk-ZM63SUHG.js → chunk-MUFF2YTH.js} +2 -2
- package/dist/bundle/{chunk-2PUNKUYJ.js → chunk-N24YSLED.js} +9150 -9869
- package/dist/bundle/chunk-N4GTCPML.js +7 -0
- package/dist/bundle/{chunk-B5KSXHJ7.js → chunk-NBMGDRP4.js} +1 -1
- package/dist/bundle/chunk-NMQRSEZM.js +37 -0
- package/dist/bundle/{chunk-JDV7HNNQ.js → chunk-NNGA4QDR.js} +13 -26
- package/dist/bundle/{chunk-5DPV7X27.js → chunk-NTZWY5R3.js} +321 -0
- package/dist/bundle/chunk-O7CZZ36M.js +80 -0
- package/dist/bundle/{chunk-ICDCAQ6K.js → chunk-OAONP6KI.js} +13 -9
- package/dist/bundle/{chunk-WVDCCYS3.js → chunk-OESP4PHB.js} +17 -17
- package/dist/bundle/chunk-OHR6IZNH.js +116 -0
- package/dist/bundle/{chunk-4QNW4NK6.js → chunk-OLCU7Q2B.js} +1 -1
- package/dist/bundle/{chunk-SDKQNOL5.js → chunk-OLDQLEPA.js} +6 -6
- package/dist/bundle/{chunk-ZCR3IRZ2.js → chunk-OPIPG6AP.js} +16 -9
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/chunk-PRYMT3OG.js +30 -0
- package/dist/bundle/chunk-QDUIVMEW.js +36 -0
- package/dist/bundle/{chunk-ZZ32DXTH.js → chunk-QKBPCX7Y.js} +1 -1
- package/dist/bundle/{chunk-QXC6IEH6.js → chunk-QSLOACDT.js} +201 -423
- package/dist/bundle/{chunk-7PDHGZN4.js → chunk-QUZFDU4K.js} +4 -4
- package/dist/bundle/{chunk-3UGYFXH6.js → chunk-R32DHS6J.js} +187 -379
- package/dist/bundle/{chunk-6SJOTNHF.js → chunk-R57QUYBG.js} +6 -28
- package/dist/bundle/{chunk-UTO2GO4P.js → chunk-R64OSDOD.js} +45 -66
- package/dist/bundle/{chunk-GBKNJWOZ.js → chunk-RSPBVKOC.js} +8 -8
- package/dist/bundle/{chunk-HL52XXZX.js → chunk-SPNPJ3FZ.js} +3 -4
- package/dist/bundle/chunk-SQHDSIFL.js +388 -0
- package/dist/bundle/{chunk-YPNWIB6H.js → chunk-ST35FIUG.js} +3 -3
- package/dist/bundle/{chunk-37MAA6F2.js → chunk-STUPCKAA.js} +11 -2221
- package/dist/bundle/chunk-SZ7XJZGH.js +2231 -0
- package/dist/bundle/chunk-TRYYWV7J.js +291 -0
- package/dist/bundle/{chunk-X4TIMMKJ.js → chunk-TTPWKTVR.js} +1 -1
- package/dist/bundle/{chunk-TAFHYHKA.js → chunk-U7VEJ3CW.js} +45 -27
- package/dist/bundle/{chunk-6Y2BYFXQ.js → chunk-UC7JLE6J.js} +0 -7
- package/dist/bundle/{chunk-4HWJOU7N.js → chunk-UIQ35CA5.js} +1 -1
- package/dist/bundle/{chunk-SAKO3P4H.js → chunk-UJY26HW4.js} +1 -1
- package/dist/bundle/{chunk-D5TGYUVU.js → chunk-UWG3PRY7.js} +9 -60
- package/dist/bundle/{chunk-JZHBZOJR.js → chunk-VAR3MJU6.js} +3 -3
- package/dist/bundle/{chunk-GOWXXYEF.js → chunk-VPQSI5IU.js} +4 -4
- package/dist/bundle/{chunk-QFR2PNJN.js → chunk-VQPT3Y7W.js} +12 -12
- package/dist/bundle/{chunk-Z3KUSRCF.js → chunk-WMG3H2VK.js} +2 -2
- package/dist/bundle/{chunk-4PA4DHYV.js → chunk-X5BGAZC5.js} +6 -6
- package/dist/bundle/{chunk-2UUWXPOB.js → chunk-XC6TRWLZ.js} +3 -3
- package/dist/bundle/{chunk-OF422U5D.js → chunk-XQZEMRCU.js} +402 -402
- package/dist/bundle/{chunk-72C4YOCH.js → chunk-XZ7MO6EU.js} +7 -7
- package/dist/bundle/{chunk-SERXSCN3.js → chunk-YAIOEPKU.js} +337 -390
- package/dist/bundle/chunk-YHWFF6DN.js +39 -0
- package/dist/bundle/{chunk-RESDD3Q4.js → chunk-YWOLQEDV.js} +16 -3
- package/dist/bundle/{chunk-YMJ6IDGT.js → chunk-ZFDSJ5YJ.js} +38 -8
- package/dist/bundle/{chunk-HMS6EEQL.js → chunk-ZFUZEFU6.js} +3 -3
- package/dist/bundle/{chunk-TAUBRNC5.js → chunk-ZJKXSMXK.js} +72 -59
- package/dist/bundle/{chunk-22QQUKWA.js → chunk-ZKWT6HXT.js} +1 -1
- package/dist/bundle/chunk-ZPUY3COZ.js +250 -0
- package/dist/bundle/{cli-556DERZL.js → cli-2P5FW2RL.js} +201 -98
- package/dist/bundle/command-contract-BMQT2G5X.js +45 -0
- package/dist/bundle/{command-server-entry-AYLGNZWD.js → command-server-entry-KP2UDGLA.js} +36 -34
- package/dist/bundle/{decode-QU24MWMN.js → decode-K2JZ5D6V.js} +10 -10
- package/dist/bundle/{dispatch-4KODNOXV.js → dispatch-KOQZA74A.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-URO3QGCG.js} +2 -2
- package/dist/bundle/{embed-KG27KG3D.js → embed-JLIPWTNN.js} +10 -10
- package/dist/bundle/{embedder-IPAVUQUV.js → embedder-LUTDO3HS.js} +15 -15
- package/dist/bundle/entry-AVF6LMG7.js +25 -0
- package/dist/bundle/{failure-ESL7ETL4.js → failure-GJMQLM7O.js} +4 -4
- package/dist/bundle/first-run-VYTIEUDA.js +31 -0
- package/dist/bundle/first-screen-QVZPF7KL.js +45 -0
- package/dist/bundle/google-VX7IPACN.js +46 -0
- package/dist/bundle/{google-api-VCDBSNOW.js → google-api-RFXKRLL4.js} +88 -73
- package/dist/bundle/grants-4XWJFVD6.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-FXPB5EMT.js} +7 -6
- package/dist/bundle/{instructions-2VECIDXF.js → instructions-IROIUVZI.js} +1 -1
- package/dist/bundle/{login-7GBONT7V.js → login-WIY5VQU7.js} +96 -81
- package/dist/bundle/{mcp-O6ACR2DX.js → mcp-NJIOKW3E.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-JUNV35GM.js +28 -0
- package/dist/bundle/meeting-model-XY4UNWWK.js +29 -0
- package/dist/bundle/{meeting-semantic-G7PFOKU7.js → meeting-semantic-62QNQMOM.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-IACCI2CW.js} +2 -2
- package/dist/bundle/{node-sqlite-OLQMAYB4.js → node-sqlite-WYIRC7C7.js} +10 -10
- package/dist/bundle/notes-search-DEDUJKSN.js +70 -0
- package/dist/bundle/oauth-HXBXF4VI.js +22 -0
- package/dist/bundle/{open-OXTE672W.js → open-H32B6BCT.js} +8 -8
- package/dist/bundle/{openai-EB3TPIZY.js → openai-VHMPJJUG.js} +22 -21
- package/dist/bundle/{process-F6TKXWWA.js → process-RNHPF5OK.js} +1 -1
- package/dist/bundle/{program-4IFDZ7FM.js → program-GYMJ3DDH.js} +275 -1148
- package/dist/bundle/{prompt-F5RRHPN2.js → prompt-TOG2CRCE.js} +8 -8
- package/dist/bundle/{reasons-UORHJDHK.js → reasons-TLFQ45YX.js} +6 -5
- package/dist/bundle/{recognize-DAVNZND3.js → recognize-GYGY45EY.js} +7 -7
- package/dist/bundle/remote-6XN2QLI5.js +35 -0
- package/dist/bundle/{rerank-CND2GVLZ.js → rerank-HJO3O4TW.js} +11 -11
- package/dist/bundle/{serve-ZHSPUIGX.js → serve-XPCNLHCR.js} +19 -19
- package/dist/bundle/server-UBJZ66XE.js +97 -0
- package/dist/bundle/{server-YMAK4LHC.js → server-WPT3NC5B.js} +89 -70
- package/dist/bundle/{services-ZILSFJ6E.js → services-253KKKVU.js} +109 -89
- package/dist/bundle/{sqlite-runtime-S5VPMZQH.js → sqlite-runtime-EZASGJXW.js} +9 -9
- package/dist/bundle/{start-CR6X25RT.js → start-UHI35JFL.js} +7 -7
- package/dist/bundle/{state-YFPHVIIJ.js → state-KJTSPFGK.js} +9 -9
- package/dist/bundle/{store-UODRT6X4.js → store-62J2H2A3.js} +36 -25
- package/dist/bundle/{store-CL4ZJZRI.js → store-G5B7T7M7.js} +38 -23
- package/dist/bundle/store-maintenance-command-C6T4YLVF.js +85 -0
- package/dist/bundle/surface-3OT64BHS.js +83 -0
- package/dist/bundle/tokens-EHYO6D2X.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,696 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
QUERY_LIMITS,
|
|
5
|
+
exhausted,
|
|
6
|
+
searchError
|
|
7
|
+
} from "./chunk-OPIPG6AP.js";
|
|
8
|
+
import {
|
|
9
|
+
fold
|
|
10
|
+
} from "./chunk-TTPWKTVR.js";
|
|
11
|
+
import {
|
|
12
|
+
looksLikeReference,
|
|
13
|
+
parseReference,
|
|
14
|
+
providerLabel,
|
|
15
|
+
providerNamed
|
|
16
|
+
} from "./chunk-COJTCEZP.js";
|
|
17
|
+
import {
|
|
18
|
+
singleLine
|
|
19
|
+
} from "./chunk-FUDUXIVG.js";
|
|
20
|
+
import {
|
|
21
|
+
CliError
|
|
22
|
+
} from "./chunk-OLCU7Q2B.js";
|
|
23
|
+
import {
|
|
24
|
+
__name
|
|
25
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
26
|
+
|
|
27
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/search/lucene/resolved.js
|
|
28
|
+
var hasText = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? node.field === "text" || node.field === "exact" : node.clauses.some(({ node: node2 }) => hasText(node2)), "hasText");
|
|
29
|
+
var isStemmed = /* @__PURE__ */ __name((node) => node.field === "text" && (node.operator === "term" || node.operator === "phrase") && node.value !== "", "isStemmed");
|
|
30
|
+
var hasStems = /* @__PURE__ */ __name((node) => node.kind === "predicate" ? isStemmed(node) : node.clauses.some(({ node: node2 }) => hasStems(node2)), "hasStems");
|
|
31
|
+
|
|
32
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/domain/ref-summaries.js
|
|
33
|
+
var PROFILE_PLACEHOLDER = "<profile>";
|
|
34
|
+
var unregistered = /* @__PURE__ */ __name((provider) => `no CLI has registered ${provider} in this store yet; run its CLI once`, "unregistered");
|
|
35
|
+
var profilesOn = /* @__PURE__ */ __name((profiles, app, key) => Object.entries(profiles[app] ?? {}).filter(([, saved]) => saved.provider === key.provider && saved.account === key.account).map(([name]) => name), "profilesOn");
|
|
36
|
+
var storedProfilesFor = /* @__PURE__ */ __name((profiles) => (provider, account) => {
|
|
37
|
+
const tool = providerNamed(provider)?.command;
|
|
38
|
+
if (tool === void 0)
|
|
39
|
+
return { why: unregistered(provider), profiles: [] };
|
|
40
|
+
if (account === null)
|
|
41
|
+
return { why: `${provider} names no account here`, profiles: [] };
|
|
42
|
+
const named = profilesOn(profiles, tool, { provider, account });
|
|
43
|
+
if (named.length === 1)
|
|
44
|
+
return { profile: named[0] };
|
|
45
|
+
return {
|
|
46
|
+
why: named.length === 0 ? `no ${tool} profile has run on ${provider}:${account} here; run \`${tool} <profile>\` with it once` : `${named.length} ${tool} profiles are on ${provider}:${account}: ${named.join(", ")}; the owner chooses one`,
|
|
47
|
+
profiles: named
|
|
48
|
+
};
|
|
49
|
+
}, "storedProfilesFor");
|
|
50
|
+
var keyText = /* @__PURE__ */ __name((key) => `${key.provider}:${key.account}`, "keyText");
|
|
51
|
+
var writesWithOf = /* @__PURE__ */ __name((account, profilesFor, { allowed } = {}) => {
|
|
52
|
+
if (account === null)
|
|
53
|
+
return null;
|
|
54
|
+
const tool = providerNamed(account.provider)?.command ?? null;
|
|
55
|
+
if (tool === null)
|
|
56
|
+
return { tool, account, profile: null, profiles: [], why: unregistered(account.provider) };
|
|
57
|
+
const asked = profilesFor(account.provider, account.account);
|
|
58
|
+
const named = "profile" in asked ? [asked.profile] : asked.profiles;
|
|
59
|
+
const kept = allowed ? named.filter((profile) => allowed(tool, profile)) : named;
|
|
60
|
+
if (kept.length === 1 && ("profile" in asked || allowed))
|
|
61
|
+
return { tool, account, profile: kept[0], profiles: kept, why: null };
|
|
62
|
+
if (kept.length === named.length && !("profile" in asked))
|
|
63
|
+
return { tool, account, profile: null, profiles: asked.profiles, why: asked.why };
|
|
64
|
+
return {
|
|
65
|
+
tool,
|
|
66
|
+
account,
|
|
67
|
+
profile: null,
|
|
68
|
+
profiles: kept,
|
|
69
|
+
why: kept.length === 0 ? `no ${tool} profile on ${keyText(account)} is allowed in this run` : `${kept.length} ${tool} profiles allowed in this run are on ${keyText(account)}: ${kept.join(", ")}; the owner chooses one`
|
|
70
|
+
};
|
|
71
|
+
}, "writesWithOf");
|
|
72
|
+
var oneLine = /* @__PURE__ */ __name((text) => singleLine(text.replace(/\s+/g, " ").trim()), "oneLine");
|
|
73
|
+
var openKind = /* @__PURE__ */ __name((kind) => kind === "email" ? "message" : kind === "email_thread" ? "chat" : kind === "unknown" ? void 0 : kind, "openKind");
|
|
74
|
+
var openOf = /* @__PURE__ */ __name((summary, ports) => {
|
|
75
|
+
const kind = openKind(summary.kind);
|
|
76
|
+
if (kind === void 0)
|
|
77
|
+
return { argv: null, profiles: [], why: `${summary.ref} is not a reference` };
|
|
78
|
+
const entry = summary.provider === null ? void 0 : providerNamed(summary.provider);
|
|
79
|
+
const words = entry?.command === void 0 ? void 0 : entry.opens?.[kind];
|
|
80
|
+
if (entry?.command !== void 0 && words !== void 0 && summary.provider !== null) {
|
|
81
|
+
const command = [...words.split(" "), summary.ref];
|
|
82
|
+
const asked = ports.profilesFor(summary.provider, summary.account);
|
|
83
|
+
return "profile" in asked ? { argv: [entry.command, asked.profile, ...command], profiles: [asked.profile], why: null } : { argv: [entry.command, PROFILE_PLACEHOLDER, ...command], profiles: asked.profiles, why: asked.why };
|
|
84
|
+
}
|
|
85
|
+
const local = ports.local?.[kind];
|
|
86
|
+
if (local !== void 0)
|
|
87
|
+
return { argv: [...local, summary.ref], profiles: [], why: null };
|
|
88
|
+
return {
|
|
89
|
+
argv: null,
|
|
90
|
+
profiles: [],
|
|
91
|
+
why: summary.provider === null ? `nothing here opens a ${kind}` : unregistered(summary.provider)
|
|
92
|
+
};
|
|
93
|
+
}, "openOf");
|
|
94
|
+
var WORDS = {
|
|
95
|
+
message: "Message",
|
|
96
|
+
chat: "Chat",
|
|
97
|
+
contact: "Contact",
|
|
98
|
+
folder: "Folder",
|
|
99
|
+
meeting: "Meeting",
|
|
100
|
+
event: "Event",
|
|
101
|
+
note: "Note",
|
|
102
|
+
document: "Document",
|
|
103
|
+
person: "Person",
|
|
104
|
+
organization: "Organization",
|
|
105
|
+
project: "Project",
|
|
106
|
+
task: "Task",
|
|
107
|
+
memory: "Memory",
|
|
108
|
+
fact: "Fact",
|
|
109
|
+
bot: "Bot",
|
|
110
|
+
invoice: "Invoice",
|
|
111
|
+
payment: "Payment",
|
|
112
|
+
order: "Order",
|
|
113
|
+
deal: "Deal",
|
|
114
|
+
lead: "Lead",
|
|
115
|
+
pipeline: "Pipeline",
|
|
116
|
+
product: "Product",
|
|
117
|
+
contract: "Contract",
|
|
118
|
+
subscription: "Subscription",
|
|
119
|
+
wallet: "Wallet",
|
|
120
|
+
transaction: "Transaction",
|
|
121
|
+
email: "Email",
|
|
122
|
+
email_thread: "Email thread",
|
|
123
|
+
unknown: "Unknown"
|
|
124
|
+
};
|
|
125
|
+
var refLabel = /* @__PURE__ */ __name((summary) => {
|
|
126
|
+
const named = summary.title === null ? summary.ref : `\xAB${oneLine(summary.title)}\xBB`;
|
|
127
|
+
const notes = [summary.in === null ? null : oneLine(summary.in), summary.state === "available" ? null : summary.state].filter((one) => one !== null).join(", ");
|
|
128
|
+
return `${WORDS[summary.kind]} ${named}${notes === "" ? "" : ` (${notes})`}`;
|
|
129
|
+
}, "refLabel");
|
|
130
|
+
|
|
131
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
|
|
132
|
+
var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
|
|
133
|
+
var literal = /* @__PURE__ */ __name((c) => ({
|
|
134
|
+
kind: "char",
|
|
135
|
+
ranges: [[c.codePointAt(0) ?? 0, c.codePointAt(0) ?? 0]],
|
|
136
|
+
negate: false
|
|
137
|
+
}), "literal");
|
|
138
|
+
var compileAutomaton = /* @__PURE__ */ __name((pattern, span = { start: 0, end: pattern.length }) => {
|
|
139
|
+
if (pattern.length > QUERY_LIMITS.pattern * 2)
|
|
140
|
+
exhausted("pattern");
|
|
141
|
+
const chars = [...pattern];
|
|
142
|
+
if (chars.length > QUERY_LIMITS.pattern)
|
|
143
|
+
exhausted("pattern");
|
|
144
|
+
let at = 0, depth = 0;
|
|
145
|
+
const failure = /* @__PURE__ */ __name(() => searchError("query.invalid-regex", span, "use the supported Lucene regex subset"), "failure");
|
|
146
|
+
const character = /* @__PURE__ */ __name(() => {
|
|
147
|
+
if (at >= chars.length)
|
|
148
|
+
return failure();
|
|
149
|
+
return chars[at++];
|
|
150
|
+
}, "character");
|
|
151
|
+
const predefined = /* @__PURE__ */ __name(() => {
|
|
152
|
+
if (chars[at] !== "\\")
|
|
153
|
+
return void 0;
|
|
154
|
+
const name = chars[at + 1] ?? "";
|
|
155
|
+
let ranges;
|
|
156
|
+
if (name.toLowerCase() === "d")
|
|
157
|
+
ranges = [[48, 57]];
|
|
158
|
+
if (name.toLowerCase() === "w")
|
|
159
|
+
ranges = [
|
|
160
|
+
[48, 57],
|
|
161
|
+
[65, 90],
|
|
162
|
+
[95, 95],
|
|
163
|
+
[97, 122]
|
|
164
|
+
];
|
|
165
|
+
if (name.toLowerCase() === "s")
|
|
166
|
+
ranges = [
|
|
167
|
+
[9, 10],
|
|
168
|
+
[13, 13],
|
|
169
|
+
[32, 32]
|
|
170
|
+
];
|
|
171
|
+
if (ranges) {
|
|
172
|
+
at += 2;
|
|
173
|
+
return { kind: "char", ranges, negate: name === name.toUpperCase() };
|
|
174
|
+
}
|
|
175
|
+
if (/^[a-zA-Z]$/u.test(name))
|
|
176
|
+
return failure();
|
|
177
|
+
return void 0;
|
|
178
|
+
}, "predefined");
|
|
179
|
+
const escaped = /* @__PURE__ */ __name(() => {
|
|
180
|
+
if (chars[at] === "\\")
|
|
181
|
+
at++;
|
|
182
|
+
return character();
|
|
183
|
+
}, "escaped");
|
|
184
|
+
const union = /* @__PURE__ */ __name(() => {
|
|
185
|
+
if (++depth > QUERY_LIMITS.depth)
|
|
186
|
+
exhausted("pattern depth");
|
|
187
|
+
const children = [concat()];
|
|
188
|
+
while (chars[at] === "|") {
|
|
189
|
+
at++;
|
|
190
|
+
children.push(concat());
|
|
191
|
+
}
|
|
192
|
+
depth--;
|
|
193
|
+
return children.length === 1 ? children[0] : { kind: "union", children };
|
|
194
|
+
}, "union");
|
|
195
|
+
const concat = /* @__PURE__ */ __name(() => {
|
|
196
|
+
const children = [];
|
|
197
|
+
do {
|
|
198
|
+
children.push(repeat());
|
|
199
|
+
} while (at < chars.length && ![")", "|", "&"].includes(chars[at] ?? ""));
|
|
200
|
+
if (chars[at] === "&")
|
|
201
|
+
searchError("query.unsupported-regex", span, "automaton intersection is not supported");
|
|
202
|
+
return children.length === 1 ? children[0] : { kind: "concat", children };
|
|
203
|
+
}, "concat");
|
|
204
|
+
const repeat = /* @__PURE__ */ __name(() => {
|
|
205
|
+
let child = simple();
|
|
206
|
+
while (["?", "*", "+", "{"].includes(chars[at] ?? "")) {
|
|
207
|
+
const op = character();
|
|
208
|
+
let min = op === "+" ? 1 : 0, max = op === "?" ? 1 : null;
|
|
209
|
+
if (op === "{") {
|
|
210
|
+
const number = /* @__PURE__ */ __name(() => {
|
|
211
|
+
const start2 = at;
|
|
212
|
+
while (/^[0-9]$/u.test(chars[at] ?? ""))
|
|
213
|
+
at++;
|
|
214
|
+
if (at === start2)
|
|
215
|
+
return failure();
|
|
216
|
+
return Number(chars.slice(start2, at).join(""));
|
|
217
|
+
}, "number");
|
|
218
|
+
min = number();
|
|
219
|
+
max = min;
|
|
220
|
+
if (chars[at] === ",") {
|
|
221
|
+
at++;
|
|
222
|
+
max = chars[at] === "}" ? null : number();
|
|
223
|
+
}
|
|
224
|
+
if (character() !== "}" || max !== null && max < min)
|
|
225
|
+
return failure();
|
|
226
|
+
}
|
|
227
|
+
if (min > QUERY_LIMITS.states || max !== null && max > QUERY_LIMITS.states)
|
|
228
|
+
exhausted("automaton states");
|
|
229
|
+
child = { kind: "repeat", child, min, max };
|
|
230
|
+
}
|
|
231
|
+
return child;
|
|
232
|
+
}, "repeat");
|
|
233
|
+
const simple = /* @__PURE__ */ __name(() => {
|
|
234
|
+
const predefinedAtom = predefined();
|
|
235
|
+
if (predefinedAtom)
|
|
236
|
+
return predefinedAtom;
|
|
237
|
+
const c = character();
|
|
238
|
+
if (c === "~" || c === "<")
|
|
239
|
+
searchError("query.unsupported-regex", span, "complement, named automata and numeric intervals are not supported");
|
|
240
|
+
if (c === ".")
|
|
241
|
+
return any;
|
|
242
|
+
if (c === "#")
|
|
243
|
+
return { kind: "empty" };
|
|
244
|
+
if (c === "@")
|
|
245
|
+
return { kind: "repeat", child: any, min: 0, max: null };
|
|
246
|
+
if (c === '"') {
|
|
247
|
+
const children = [];
|
|
248
|
+
while (chars[at] !== '"')
|
|
249
|
+
children.push(literal(character()));
|
|
250
|
+
at++;
|
|
251
|
+
return { kind: "concat", children };
|
|
252
|
+
}
|
|
253
|
+
if (c === "(") {
|
|
254
|
+
if (chars[at] === ")") {
|
|
255
|
+
at++;
|
|
256
|
+
return { kind: "epsilon" };
|
|
257
|
+
}
|
|
258
|
+
if (chars[at] === "?")
|
|
259
|
+
searchError("query.unsupported-regex", span, "JavaScript groups and lookaround are not Lucene operators");
|
|
260
|
+
const child = union();
|
|
261
|
+
if (character() !== ")")
|
|
262
|
+
return failure();
|
|
263
|
+
return child;
|
|
264
|
+
}
|
|
265
|
+
if (c === "[") {
|
|
266
|
+
const negate = chars[at] === "^";
|
|
267
|
+
if (negate)
|
|
268
|
+
at++;
|
|
269
|
+
const choices = [];
|
|
270
|
+
do {
|
|
271
|
+
const pre = predefined();
|
|
272
|
+
if (pre) {
|
|
273
|
+
choices.push(pre);
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
const lo = escaped().codePointAt(0) ?? 0;
|
|
277
|
+
let hi = lo;
|
|
278
|
+
if (chars[at] === "-") {
|
|
279
|
+
at++;
|
|
280
|
+
hi = escaped().codePointAt(0) ?? 0;
|
|
281
|
+
}
|
|
282
|
+
if (hi < lo)
|
|
283
|
+
return failure();
|
|
284
|
+
choices.push({ kind: "char", ranges: [[lo, hi]], negate: false });
|
|
285
|
+
} while (at < chars.length && chars[at] !== "]");
|
|
286
|
+
if (character() !== "]")
|
|
287
|
+
return failure();
|
|
288
|
+
if (!negate)
|
|
289
|
+
return { kind: "union", children: choices };
|
|
290
|
+
const ranges = [];
|
|
291
|
+
for (const choice of choices) {
|
|
292
|
+
if (choice.kind !== "char" || choice.negate)
|
|
293
|
+
searchError("query.unsupported-regex", span, "negative predefined classes inside a negated class are not supported");
|
|
294
|
+
ranges.push(...choice.ranges);
|
|
295
|
+
}
|
|
296
|
+
return { kind: "char", ranges, negate: true };
|
|
297
|
+
}
|
|
298
|
+
if (c === "\\")
|
|
299
|
+
return literal(character());
|
|
300
|
+
return literal(c);
|
|
301
|
+
}, "simple");
|
|
302
|
+
const expression = chars.length === 0 ? { kind: "epsilon" } : union();
|
|
303
|
+
if (at !== chars.length)
|
|
304
|
+
return failure();
|
|
305
|
+
const states = [];
|
|
306
|
+
const state = /* @__PURE__ */ __name(() => {
|
|
307
|
+
if (states.length >= QUERY_LIMITS.states)
|
|
308
|
+
exhausted("automaton states");
|
|
309
|
+
states.push({ epsilon: [], edges: [] });
|
|
310
|
+
return states.length - 1;
|
|
311
|
+
}, "state");
|
|
312
|
+
const epsilon = /* @__PURE__ */ __name((from, to) => {
|
|
313
|
+
;
|
|
314
|
+
states[from].epsilon.push(to);
|
|
315
|
+
}, "epsilon");
|
|
316
|
+
const build = /* @__PURE__ */ __name((node, from, to) => {
|
|
317
|
+
if (node.kind === "char") {
|
|
318
|
+
;
|
|
319
|
+
states[from].edges.push({ to, atom: node });
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
if (node.kind === "empty")
|
|
323
|
+
return;
|
|
324
|
+
if (node.kind === "epsilon") {
|
|
325
|
+
epsilon(from, to);
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (node.kind === "union") {
|
|
329
|
+
for (const child of node.children)
|
|
330
|
+
build(child, from, to);
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
if (node.kind === "concat") {
|
|
334
|
+
let current2 = from;
|
|
335
|
+
node.children.forEach((child, index) => {
|
|
336
|
+
const next = index === node.children.length - 1 ? to : state();
|
|
337
|
+
build(child, current2, next);
|
|
338
|
+
current2 = next;
|
|
339
|
+
});
|
|
340
|
+
if (node.children.length === 0)
|
|
341
|
+
epsilon(from, to);
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
let current = from;
|
|
345
|
+
for (let i = 0; i < node.min; i++) {
|
|
346
|
+
const next = state();
|
|
347
|
+
build(node.child, current, next);
|
|
348
|
+
current = next;
|
|
349
|
+
}
|
|
350
|
+
if (node.max === null) {
|
|
351
|
+
epsilon(current, to);
|
|
352
|
+
const end2 = state();
|
|
353
|
+
build(node.child, current, end2);
|
|
354
|
+
epsilon(end2, current);
|
|
355
|
+
} else {
|
|
356
|
+
for (let i = node.min; i < node.max; i++) {
|
|
357
|
+
epsilon(current, to);
|
|
358
|
+
const next = state();
|
|
359
|
+
build(node.child, current, next);
|
|
360
|
+
current = next;
|
|
361
|
+
}
|
|
362
|
+
epsilon(current, to);
|
|
363
|
+
}
|
|
364
|
+
}, "build");
|
|
365
|
+
const start = state(), end = state();
|
|
366
|
+
build(expression, start, end);
|
|
367
|
+
return {
|
|
368
|
+
states: states.length,
|
|
369
|
+
test: /* @__PURE__ */ __name((text, budget = { work: 0 }) => {
|
|
370
|
+
const spend = /* @__PURE__ */ __name(() => {
|
|
371
|
+
if (++budget.work > (budget.maxWork ?? QUERY_LIMITS.work))
|
|
372
|
+
exhausted("automaton work");
|
|
373
|
+
}, "spend");
|
|
374
|
+
const closure = /* @__PURE__ */ __name((initial) => {
|
|
375
|
+
const stack = [...initial];
|
|
376
|
+
while (stack.length) {
|
|
377
|
+
const id = stack.pop();
|
|
378
|
+
for (const next of states[id].epsilon) {
|
|
379
|
+
spend();
|
|
380
|
+
if (!initial.has(next)) {
|
|
381
|
+
initial.add(next);
|
|
382
|
+
stack.push(next);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
return initial;
|
|
387
|
+
}, "closure");
|
|
388
|
+
let current = closure(/* @__PURE__ */ new Set([start]));
|
|
389
|
+
for (const c of text) {
|
|
390
|
+
const point = c.codePointAt(0) ?? 0;
|
|
391
|
+
const next = /* @__PURE__ */ new Set();
|
|
392
|
+
for (const id of current)
|
|
393
|
+
for (const edge of states[id].edges) {
|
|
394
|
+
spend();
|
|
395
|
+
const inside = edge.atom.ranges.some(([lo, hi]) => point >= lo && point <= hi);
|
|
396
|
+
if (inside !== edge.atom.negate)
|
|
397
|
+
next.add(edge.to);
|
|
398
|
+
}
|
|
399
|
+
current = closure(next);
|
|
400
|
+
if (current.size === 0)
|
|
401
|
+
return false;
|
|
402
|
+
}
|
|
403
|
+
return current.has(end);
|
|
404
|
+
}, "test")
|
|
405
|
+
};
|
|
406
|
+
}, "compileAutomaton");
|
|
407
|
+
var wildcardPattern = /* @__PURE__ */ __name((value) => {
|
|
408
|
+
const chars = [...value];
|
|
409
|
+
let pattern = "";
|
|
410
|
+
for (let at = 0; at < chars.length; at++) {
|
|
411
|
+
const c = chars[at];
|
|
412
|
+
if (c === "\\") {
|
|
413
|
+
const escaped = chars[++at];
|
|
414
|
+
if (escaped === void 0)
|
|
415
|
+
searchError("query.invalid-escape", { start: 0, end: value.length });
|
|
416
|
+
pattern += /[|&?*+(){}[\].#@<>"~\\]/u.test(escaped) ? `\\${escaped}` : escaped;
|
|
417
|
+
} else
|
|
418
|
+
pattern += c === "*" ? ".*" : c === "?" ? "." : /[|&?*+(){}[\].#@<>"~\\]/u.test(c) ? `\\${c}` : c;
|
|
419
|
+
}
|
|
420
|
+
return pattern;
|
|
421
|
+
}, "wildcardPattern");
|
|
422
|
+
var FOLD_RANGE = 4096;
|
|
423
|
+
var unfoldable = /* @__PURE__ */ __name((span, what) => searchError("query.unsupported-regex", span, `${what} has no single lowercase form without accents, which is what text: words are \u2014 write it that way, or use body:/\u2026/ to match the original text`), "unfoldable");
|
|
424
|
+
var classChar = /* @__PURE__ */ __name((point) => {
|
|
425
|
+
const c = String.fromCodePoint(point);
|
|
426
|
+
return /[\p{L}\p{N}]/u.test(c) ? c : `\\${c}`;
|
|
427
|
+
}, "classChar");
|
|
428
|
+
var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
|
|
429
|
+
const chars = [...pattern.normalize("NFC")];
|
|
430
|
+
let out = "";
|
|
431
|
+
let at = 0;
|
|
432
|
+
const literal2 = /* @__PURE__ */ __name((c) => {
|
|
433
|
+
if (!/[\p{L}\p{N}\p{M}]/u.test(c))
|
|
434
|
+
return c;
|
|
435
|
+
const folded = fold(c);
|
|
436
|
+
if (folded === "")
|
|
437
|
+
return unfoldable(span, `"${c}"`);
|
|
438
|
+
if ([...folded].length === 1 && /[\p{L}\p{N}]/u.test(folded))
|
|
439
|
+
return folded;
|
|
440
|
+
if (folded.includes('"'))
|
|
441
|
+
return unfoldable(span, `"${c}"`);
|
|
442
|
+
return `"${folded}"`;
|
|
443
|
+
}, "literal");
|
|
444
|
+
const characterClass = /* @__PURE__ */ __name(() => {
|
|
445
|
+
const begin = at - 1;
|
|
446
|
+
let negate = "";
|
|
447
|
+
if (chars[at] === "^") {
|
|
448
|
+
negate = "^";
|
|
449
|
+
at++;
|
|
450
|
+
}
|
|
451
|
+
const kept = [];
|
|
452
|
+
const points = /* @__PURE__ */ new Set();
|
|
453
|
+
do {
|
|
454
|
+
const start = at;
|
|
455
|
+
if (chars[at] === "\\" && /^[a-zA-Z]$/u.test(chars[at + 1] ?? "")) {
|
|
456
|
+
kept.push(`\\${chars[at + 1]}`);
|
|
457
|
+
at += 2;
|
|
458
|
+
continue;
|
|
459
|
+
}
|
|
460
|
+
const escaped = /* @__PURE__ */ __name(() => {
|
|
461
|
+
if (chars[at] === "\\")
|
|
462
|
+
at++;
|
|
463
|
+
return (chars[at++] ?? "").codePointAt(0) ?? 0;
|
|
464
|
+
}, "escaped");
|
|
465
|
+
const lo = escaped();
|
|
466
|
+
let hi = lo;
|
|
467
|
+
if (chars[at] === "-") {
|
|
468
|
+
at++;
|
|
469
|
+
hi = escaped();
|
|
470
|
+
}
|
|
471
|
+
if (at > chars.length) {
|
|
472
|
+
out += chars.slice(begin).join("");
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
const single = /* @__PURE__ */ __name((point) => [...fold(String.fromCodePoint(point))], "single");
|
|
476
|
+
if (hi < lo)
|
|
477
|
+
kept.push(chars.slice(start, at).join(""));
|
|
478
|
+
else if (hi - lo >= FOLD_RANGE) {
|
|
479
|
+
if (single(lo).join("") !== String.fromCodePoint(lo) || single(hi).join("") !== String.fromCodePoint(hi))
|
|
480
|
+
unfoldable(span, `the range ${chars.slice(start, at).join("")}`);
|
|
481
|
+
kept.push(chars.slice(start, at).join(""));
|
|
482
|
+
} else
|
|
483
|
+
for (let point = lo; point <= hi; point++) {
|
|
484
|
+
const folded = single(point);
|
|
485
|
+
if (folded.length === 1)
|
|
486
|
+
points.add(folded[0]?.codePointAt(0) ?? 0);
|
|
487
|
+
else if (lo === hi)
|
|
488
|
+
unfoldable(span, `"${String.fromCodePoint(point)}"`);
|
|
489
|
+
}
|
|
490
|
+
} while (at < chars.length && chars[at] !== "]");
|
|
491
|
+
const sorted = [...points].sort((a, b) => a - b);
|
|
492
|
+
const ranges = [];
|
|
493
|
+
for (let i = 0; i < sorted.length; i++) {
|
|
494
|
+
const first = sorted[i];
|
|
495
|
+
while (sorted[i + 1] === sorted[i] + 1)
|
|
496
|
+
i++;
|
|
497
|
+
const last = sorted[i];
|
|
498
|
+
ranges.push(last === first ? classChar(first) : `${classChar(first)}-${classChar(last)}`);
|
|
499
|
+
}
|
|
500
|
+
if (!kept.length && !ranges.length)
|
|
501
|
+
unfoldable(span, "the class");
|
|
502
|
+
out += `[${negate}${kept.join("")}${ranges.join("")}`;
|
|
503
|
+
}, "characterClass");
|
|
504
|
+
while (at < chars.length) {
|
|
505
|
+
const c = chars[at++];
|
|
506
|
+
if (c === "\\") {
|
|
507
|
+
const next = chars[at++];
|
|
508
|
+
if (next === void 0)
|
|
509
|
+
out += c;
|
|
510
|
+
else
|
|
511
|
+
out += (next.codePointAt(0) ?? 0) < 128 ? `${c}${next}` : literal2(next);
|
|
512
|
+
} else if (c === '"') {
|
|
513
|
+
const end = chars.indexOf('"', at);
|
|
514
|
+
if (end < 0) {
|
|
515
|
+
out += chars.slice(at - 1).join("");
|
|
516
|
+
break;
|
|
517
|
+
}
|
|
518
|
+
const folded = fold(chars.slice(at, end).join(""));
|
|
519
|
+
if (folded.includes('"'))
|
|
520
|
+
unfoldable(span, `"${chars.slice(at, end).join("")}"`);
|
|
521
|
+
out += `"${folded}"`;
|
|
522
|
+
at = end + 1;
|
|
523
|
+
} else if (c === "[")
|
|
524
|
+
characterClass();
|
|
525
|
+
else
|
|
526
|
+
out += literal2(c);
|
|
527
|
+
}
|
|
528
|
+
return out;
|
|
529
|
+
}, "foldRegex");
|
|
530
|
+
|
|
531
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
|
|
532
|
+
var TAKES = {
|
|
533
|
+
chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
|
|
534
|
+
message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
|
|
535
|
+
};
|
|
536
|
+
var article = /* @__PURE__ */ __name((word) => /^[aeiou]/.test(word) ? "an" : "a", "article");
|
|
537
|
+
var wrongKind = /* @__PURE__ */ __name((text, kind, takes) => new CliError("validation_error", `${text} names ${article(kind)} ${kind}; this takes ${TAKES[takes]}`, {
|
|
538
|
+
reason: "ref.wrong-kind"
|
|
539
|
+
}), "wrongKind");
|
|
540
|
+
var wrongProvider = /* @__PURE__ */ __name((text, provider, kind) => {
|
|
541
|
+
const entry = providerNamed(provider);
|
|
542
|
+
const command = entry?.command;
|
|
543
|
+
const opens = kind === "entity" ? void 0 : entry?.opens?.[kind];
|
|
544
|
+
const how = command && opens ? `open it with ${command} <profile> ${opens} ${text}` : "open it with its own CLI";
|
|
545
|
+
const label = providerLabel(provider);
|
|
546
|
+
return new CliError("validation_error", `${text} is ${article(label.toLowerCase())} ${label} ${kind}; ${how}`, {
|
|
547
|
+
reason: "ref.wrong-provider"
|
|
548
|
+
});
|
|
549
|
+
}, "wrongProvider");
|
|
550
|
+
var chatReferenceOf = /* @__PURE__ */ __name((text, provider, takes = "chat") => {
|
|
551
|
+
const trimmed = text.trim();
|
|
552
|
+
if (!looksLikeReference(trimmed))
|
|
553
|
+
return void 0;
|
|
554
|
+
const reference = parseReference(trimmed);
|
|
555
|
+
if (reference.type !== "chat" && reference.type !== "message")
|
|
556
|
+
throw wrongKind(trimmed, reference.type, takes);
|
|
557
|
+
if (reference.provider !== provider)
|
|
558
|
+
throw wrongProvider(trimmed, reference.provider, reference.type);
|
|
559
|
+
const found = {
|
|
560
|
+
text: trimmed,
|
|
561
|
+
provider: reference.provider,
|
|
562
|
+
account: reference.account,
|
|
563
|
+
chat: reference.chat,
|
|
564
|
+
...reference.type === "message" ? { message: reference.message } : {}
|
|
565
|
+
};
|
|
566
|
+
return found;
|
|
567
|
+
}, "chatReferenceOf");
|
|
568
|
+
var contactReferenceOf = /* @__PURE__ */ __name((text, provider) => {
|
|
569
|
+
const trimmed = text.trim();
|
|
570
|
+
if (!trimmed.startsWith("contact:"))
|
|
571
|
+
return void 0;
|
|
572
|
+
const reference = parseReference(trimmed);
|
|
573
|
+
if (reference.type !== "contact")
|
|
574
|
+
return void 0;
|
|
575
|
+
if (provider !== void 0 && reference.provider !== provider)
|
|
576
|
+
throw wrongProvider(trimmed, reference.provider, reference.type);
|
|
577
|
+
return reference.id;
|
|
578
|
+
}, "contactReferenceOf");
|
|
579
|
+
var wrongAccount = /* @__PURE__ */ __name((reference, scope, profiles) => {
|
|
580
|
+
const here = scope.account === void 0 ? "the account of this profile is not known yet" : `${scope.profile === void 0 ? "this profile" : `profile ${scope.profile}`} is account ${scope.account}`;
|
|
581
|
+
const others = profiles === void 0 ? "" : `. Profiles signed in to ${reference.account}: ${profiles.length > 0 ? profiles.join(", ") : "none here"}`;
|
|
582
|
+
return new CliError("validation_error", `${reference.text} belongs to account ${reference.account}; ${here}${others}`, { reason: "ref.wrong-account" });
|
|
583
|
+
}, "wrongAccount");
|
|
584
|
+
var ensureAccount = /* @__PURE__ */ __name(async (reference, scope, profilesOn2) => {
|
|
585
|
+
if (scope.account !== void 0 && scope.account === reference.account)
|
|
586
|
+
return;
|
|
587
|
+
const profiles = await profilesOn2?.(reference.account).catch(() => void 0);
|
|
588
|
+
throw wrongAccount(reference, scope, profiles);
|
|
589
|
+
}, "ensureAccount");
|
|
590
|
+
|
|
591
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/search/trigrams.js
|
|
592
|
+
var trigrams = /* @__PURE__ */ __name((term) => {
|
|
593
|
+
const padded = ` ${term} `;
|
|
594
|
+
const pieces = /* @__PURE__ */ new Set();
|
|
595
|
+
for (let at = 0; at + 3 <= padded.length; at++)
|
|
596
|
+
pieces.add(padded.slice(at, at + 3));
|
|
597
|
+
return [...pieces];
|
|
598
|
+
}, "trigrams");
|
|
599
|
+
|
|
600
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.722.0_@wirecat+cli-base@0.128.0_commander@15.0.0_esbuild@0.28.2_typ_a55806ccf2eb39d6be3eaf4c54d1a60a/node_modules/@wirecat/cli-core/dist/resolve.js
|
|
601
|
+
var isId = /* @__PURE__ */ __name((reference) => /^-?\d+$/.test(reference.trim()), "isId");
|
|
602
|
+
var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
|
|
603
|
+
var pickChat = /* @__PURE__ */ __name((reference, chats) => {
|
|
604
|
+
const wanted = foldName(reference.trim());
|
|
605
|
+
const matches = chats.filter((chat) => chat.title !== null && foldName(chat.title).includes(wanted));
|
|
606
|
+
if (matches.length === 1 && matches[0])
|
|
607
|
+
return matches[0];
|
|
608
|
+
if (matches.length === 0)
|
|
609
|
+
throw new CliError("not_found", `no chat matches "${reference}"`);
|
|
610
|
+
throw ambiguous(reference, "chats", matches.map((chat) => ({ id: chat.id, title: chat.title })), ({ title }) => singleLine(String(title)));
|
|
611
|
+
}, "pickChat");
|
|
612
|
+
var pickPerson = /* @__PURE__ */ __name((reference, people) => {
|
|
613
|
+
const trimmed = reference.trim();
|
|
614
|
+
const contact = contactReferenceOf(trimmed, people.provider);
|
|
615
|
+
if (contact !== void 0) {
|
|
616
|
+
const named = people.get(contact);
|
|
617
|
+
if (named)
|
|
618
|
+
return named;
|
|
619
|
+
throw new CliError("not_found", `no person ${contact} in what this account has seen`);
|
|
620
|
+
}
|
|
621
|
+
const known = people.get(trimmed);
|
|
622
|
+
if (known)
|
|
623
|
+
return known;
|
|
624
|
+
if (isId(trimmed))
|
|
625
|
+
throw new CliError("not_found", `no person ${trimmed} in what this account has seen`);
|
|
626
|
+
const wanted = foldName(trimmed.replace(/^@/, ""));
|
|
627
|
+
const everyone = people.all().toSorted((a, b) => (a.name ?? "").localeCompare(b.name ?? ""));
|
|
628
|
+
const exact = everyone.filter((person) => namesOf(person).includes(wanted));
|
|
629
|
+
const containing = everyone.filter((person) => namesOf(person).some((one) => one.includes(wanted)));
|
|
630
|
+
if (exact.length === 1 && exact[0])
|
|
631
|
+
return exact[0];
|
|
632
|
+
if (containing.length === 1 && containing[0])
|
|
633
|
+
return containing[0];
|
|
634
|
+
if (containing.length === 0)
|
|
635
|
+
throw new CliError("not_found", `nobody matches "${reference}"`);
|
|
636
|
+
const matches = exact.length > 0 ? [...exact, ...containing.filter((person) => !exact.includes(person))] : containing;
|
|
637
|
+
throw ambiguous(reference, "people", matches.map(({ id, name, username }) => ({ id, name, username })), ({ name, username }) => singleLine([name, username && `@${username}`].filter(isPresent).join(" ")));
|
|
638
|
+
}, "pickPerson");
|
|
639
|
+
var namesOf = /* @__PURE__ */ __name((person, byAddress = false) => [person.alias, person.name, person.username, byAddress ? person.id : void 0].filter(isPresent).map(foldName), "namesOf");
|
|
640
|
+
var chatNamesOf = /* @__PURE__ */ __name((chat) => [chat.title, chat.providerMetadata?.username].filter((one) => typeof one === "string" && one !== "").map(foldName), "chatNamesOf");
|
|
641
|
+
var namePattern = /* @__PURE__ */ __name((pattern) => {
|
|
642
|
+
const automaton = compileAutomaton(wildcardPattern(foldName(pattern.trim().replace(/^@/, ""))));
|
|
643
|
+
return (names) => names.some((one) => automaton.test(one));
|
|
644
|
+
}, "namePattern");
|
|
645
|
+
var peopleMatching = /* @__PURE__ */ __name((pattern, people, { byAddress = false } = {}) => {
|
|
646
|
+
const fits = namePattern(pattern);
|
|
647
|
+
return people.filter((person) => fits(namesOf(person, byAddress)));
|
|
648
|
+
}, "peopleMatching");
|
|
649
|
+
var chatsMatching = /* @__PURE__ */ __name((pattern, chats) => {
|
|
650
|
+
const fits = namePattern(pattern);
|
|
651
|
+
return chats.filter((chat) => fits(chatNamesOf(chat)));
|
|
652
|
+
}, "chatsMatching");
|
|
653
|
+
var nearest = /* @__PURE__ */ __name((pattern, items, names, most = 5) => {
|
|
654
|
+
const pieces = /* @__PURE__ */ __name((text) => foldName(text).split(/\s+/u).flatMap(trigrams), "pieces");
|
|
655
|
+
const wanted = new Set(pieces(pattern.replace(/\\(.)/gu, "$1").replace(/[*?@]/gu, " ").trim()));
|
|
656
|
+
if (wanted.size === 0)
|
|
657
|
+
return [];
|
|
658
|
+
return items.map((item) => ({
|
|
659
|
+
item,
|
|
660
|
+
score: names(item).flatMap(pieces).filter((piece) => wanted.has(piece)).length
|
|
661
|
+
})).filter(({ score }) => score > 1).toSorted((a, b) => b.score - a.score).slice(0, most).map(({ item }) => item);
|
|
662
|
+
}, "nearest");
|
|
663
|
+
var ambiguous = /* @__PURE__ */ __name((reference, what, candidates, label) => {
|
|
664
|
+
const width = Math.max(...candidates.map(({ id }) => id.length));
|
|
665
|
+
const lines = candidates.map((candidate) => ` ${candidate.id.padEnd(width)} ${label(candidate)}`).join("\n");
|
|
666
|
+
return new CliError("validation_error", `"${singleLine(reference)}" matches ${candidates.length} ${what} \u2014 name one by its id:
|
|
667
|
+
${lines}`, { candidates });
|
|
668
|
+
}, "ambiguous");
|
|
669
|
+
var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
|
|
670
|
+
|
|
671
|
+
export {
|
|
672
|
+
compileAutomaton,
|
|
673
|
+
wildcardPattern,
|
|
674
|
+
foldRegex,
|
|
675
|
+
hasText,
|
|
676
|
+
isStemmed,
|
|
677
|
+
hasStems,
|
|
678
|
+
chatReferenceOf,
|
|
679
|
+
wrongAccount,
|
|
680
|
+
ensureAccount,
|
|
681
|
+
trigrams,
|
|
682
|
+
isId,
|
|
683
|
+
foldName,
|
|
684
|
+
pickChat,
|
|
685
|
+
pickPerson,
|
|
686
|
+
peopleMatching,
|
|
687
|
+
chatsMatching,
|
|
688
|
+
nearest,
|
|
689
|
+
PROFILE_PLACEHOLDER,
|
|
690
|
+
profilesOn,
|
|
691
|
+
storedProfilesFor,
|
|
692
|
+
writesWithOf,
|
|
693
|
+
oneLine,
|
|
694
|
+
openOf,
|
|
695
|
+
refLabel
|
|
696
|
+
};
|