@wirecat/drive-cli 0.70.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 -70
- 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-FW3GK3QO.js → all-profiles-GXGDVNQJ.js} +67 -25
- package/dist/bundle/{anthropic-QVKJT3II.js → anthropic-H5C4GQHC.js} +9 -9
- package/dist/bundle/{app-server-QU73RD5R.js → app-server-EQ3UK4C7.js} +97 -79
- package/dist/bundle/{bun-5XCD5CBB.js → bun-DTJVSRY3.js} +2 -2
- package/dist/bundle/{bun-sqlite-TIGSVNSV.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-7C5KENNU.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-GA3URWIF.js → chunk-4HPXWYTE.js} +1 -1
- package/dist/bundle/{chunk-HYXXMSVD.js → chunk-4IUNYYYL.js} +4473 -2685
- package/dist/bundle/{chunk-FYPW7NMH.js → chunk-4JS32SRX.js} +64 -4
- package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
- package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
- package/dist/bundle/{chunk-SONPLYV7.js → chunk-55FH6IEL.js} +5 -5
- package/dist/bundle/{chunk-VVN6GHAZ.js → chunk-5BNMWSU2.js} +659 -255
- package/dist/bundle/{chunk-FVTKFIQH.js → chunk-5H747A76.js} +5496 -3195
- package/dist/bundle/{chunk-PR7XD2DI.js → chunk-5KWCO56H.js} +2 -2
- package/dist/bundle/{chunk-3AHBZP33.js → chunk-5U3NCE5R.js} +35 -12
- package/dist/bundle/{chunk-HRATXUFH.js → chunk-6CCO3JCM.js} +31 -22
- package/dist/bundle/{chunk-RLNZ7NX5.js → chunk-6ZW2ZJYC.js} +2 -2
- package/dist/bundle/{chunk-RQNRYF6D.js → chunk-75DAHQOV.js} +3 -3
- package/dist/bundle/{chunk-7QSRODXM.js → chunk-77OBW43F.js} +6 -6
- package/dist/bundle/{chunk-GV5DGHSA.js → chunk-7EFM6AW3.js} +4 -4
- package/dist/bundle/{chunk-BXPC5TFG.js → chunk-A3S7QM5L.js} +3 -3
- package/dist/bundle/{chunk-IGNIUDI3.js → chunk-AA4LKC6W.js} +251 -565
- package/dist/bundle/chunk-ASTKHB6B.js +3233 -0
- package/dist/bundle/{chunk-3TCMANIM.js → chunk-BM6V7456.js} +8 -227
- package/dist/bundle/chunk-BO6EDBYJ.js +50 -0
- package/dist/bundle/{chunk-F5KJWRF5.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-YCL3SK4T.js → chunk-COJTCEZP.js} +113 -860
- package/dist/bundle/{chunk-BD2K2ONK.js → chunk-CWPYDT73.js} +6 -6
- package/dist/bundle/{chunk-6BMTW5A6.js → chunk-D4JNCXS7.js} +9 -9
- package/dist/bundle/chunk-DCPWZIOV.js +696 -0
- package/dist/bundle/{chunk-P7PLKNPX.js → chunk-DHMNCOQI.js} +415 -272
- package/dist/bundle/chunk-DOQMH4DC.js +280 -0
- package/dist/bundle/chunk-DQSOYH6N.js +20 -0
- package/dist/bundle/{chunk-ML3R2UHV.js → chunk-DWRUOLBF.js} +4 -4
- package/dist/bundle/{chunk-5JTB4URG.js → chunk-E3VWZC3K.js} +14 -13
- package/dist/bundle/chunk-ECYOTDJM.js +14 -0
- package/dist/bundle/{chunk-7IBENBCK.js → chunk-EVG3AA5M.js} +2 -2
- package/dist/bundle/chunk-F4BX7TH2.js +15 -0
- package/dist/bundle/{chunk-FCSHWUMW.js → chunk-FBEZSA76.js} +5 -5
- package/dist/bundle/{chunk-RHSBXOQM.js → chunk-FBQJN74J.js} +1 -1
- package/dist/bundle/{chunk-4WK26MPY.js → chunk-FIZOPJYY.js} +1 -1
- package/dist/bundle/chunk-FNAYSZWK.js +783 -0
- package/dist/bundle/{chunk-LINBDWJK.js → chunk-FRCJHGZM.js} +2 -2
- package/dist/bundle/{chunk-RCTOWLCD.js → chunk-FTG5QBSD.js} +41 -33
- package/dist/bundle/{chunk-ABZ2NYDT.js → chunk-FUDUXIVG.js} +1 -1
- package/dist/bundle/{chunk-NYECVHFH.js → chunk-G4NHRFS7.js} +755 -0
- package/dist/bundle/{chunk-PAPY6Q6H.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-REM5WHHQ.js → chunk-GUMKKRE6.js} +107 -71
- package/dist/bundle/{chunk-QBAOIMVB.js → chunk-GWCDOYSC.js} +1 -1
- package/dist/bundle/{chunk-HHAZ6DCY.js → chunk-GXGSC622.js} +69 -7
- package/dist/bundle/chunk-HAGXTGJC.js +188 -0
- package/dist/bundle/{chunk-TNKQDS5A.js → chunk-IMAWQC5K.js} +6 -6
- package/dist/bundle/{chunk-ZHZYGY5R.js → chunk-IVGVVSPW.js} +4 -4
- package/dist/bundle/{chunk-EDO5LZVF.js → chunk-J4NUHSM7.js} +1 -1
- package/dist/bundle/{chunk-DVVUJ254.js → chunk-K652FYCO.js} +6 -6
- package/dist/bundle/chunk-K6ZWNTXY.js +561 -0
- package/dist/bundle/{chunk-FONIFRYI.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-LMJBQFW6.js → chunk-KP2XMCNT.js} +13 -13
- package/dist/bundle/{chunk-FADAOLGB.js → chunk-KWDZ3KVH.js} +4 -4
- package/dist/bundle/{chunk-MXNQZAJQ.js → chunk-KX4C32WD.js} +2 -2
- package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
- package/dist/bundle/{chunk-ILAQIBEO.js → chunk-M2ZWYVWO.js} +1 -1
- package/dist/bundle/chunk-MEYYH47C.js +25 -0
- package/dist/bundle/{chunk-ZCXWV4XO.js → chunk-ML2QIWX2.js} +4 -4
- package/dist/bundle/{chunk-XOL346TJ.js → chunk-MUFF2YTH.js} +2 -2
- package/dist/bundle/{chunk-GAHIHE4K.js → chunk-N24YSLED.js} +9166 -9751
- package/dist/bundle/chunk-N4GTCPML.js +7 -0
- package/dist/bundle/{chunk-DVI72ZQG.js → chunk-NBMGDRP4.js} +1 -1
- package/dist/bundle/chunk-NMQRSEZM.js +37 -0
- package/dist/bundle/{chunk-I7YSHUPW.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-HWUPU6WX.js → chunk-OAONP6KI.js} +13 -9
- package/dist/bundle/{chunk-3CHW7JGR.js → chunk-OESP4PHB.js} +17 -17
- package/dist/bundle/chunk-OHR6IZNH.js +116 -0
- package/dist/bundle/{chunk-54NDYVZA.js → chunk-OLCU7Q2B.js} +1 -1
- package/dist/bundle/{chunk-FN3RXBO7.js → chunk-OLDQLEPA.js} +6 -6
- package/dist/bundle/{chunk-7DJNURKV.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-66PL7P4C.js → chunk-QKBPCX7Y.js} +1 -1
- package/dist/bundle/{chunk-PN4JYURZ.js → chunk-QSLOACDT.js} +201 -423
- package/dist/bundle/{chunk-3UWRAIWA.js → chunk-QUZFDU4K.js} +4 -4
- package/dist/bundle/{chunk-KSJAFMU5.js → chunk-R32DHS6J.js} +211 -380
- package/dist/bundle/{chunk-2SBC4DVV.js → chunk-R57QUYBG.js} +6 -28
- package/dist/bundle/{chunk-IFTX7AQU.js → chunk-R64OSDOD.js} +45 -66
- package/dist/bundle/{chunk-WJK6KTCS.js → chunk-RSPBVKOC.js} +8 -8
- package/dist/bundle/{chunk-GPDPEHYX.js → chunk-SPNPJ3FZ.js} +3 -4
- package/dist/bundle/chunk-SQHDSIFL.js +388 -0
- package/dist/bundle/{chunk-XZBA6FVH.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-OY7TNUEC.js → chunk-TTPWKTVR.js} +1 -1
- package/dist/bundle/{chunk-3UZ4OH22.js → chunk-U7VEJ3CW.js} +49 -129
- package/dist/bundle/{chunk-6Y2BYFXQ.js → chunk-UC7JLE6J.js} +0 -7
- package/dist/bundle/{chunk-HK225DAG.js → chunk-UIQ35CA5.js} +1 -1
- package/dist/bundle/{chunk-GK3BJMGK.js → chunk-UJY26HW4.js} +1 -1
- package/dist/bundle/{chunk-EG62WVR2.js → chunk-UWG3PRY7.js} +9 -60
- package/dist/bundle/{chunk-BBRMDMIR.js → chunk-VAR3MJU6.js} +3 -3
- package/dist/bundle/{chunk-GJZSVSV3.js → chunk-VPQSI5IU.js} +4 -4
- package/dist/bundle/{chunk-YZPE72GE.js → chunk-VQPT3Y7W.js} +12 -12
- package/dist/bundle/{chunk-T5D4OGDC.js → chunk-WMG3H2VK.js} +2 -2
- package/dist/bundle/{chunk-6DPOWBKA.js → chunk-X5BGAZC5.js} +6 -6
- package/dist/bundle/{chunk-DHX27E5M.js → chunk-XC6TRWLZ.js} +3 -3
- package/dist/bundle/{chunk-Q5C6YKAY.js → chunk-XQZEMRCU.js} +402 -402
- package/dist/bundle/{chunk-54BQWRJL.js → chunk-XZ7MO6EU.js} +7 -7
- package/dist/bundle/{chunk-TGS5VPJD.js → chunk-YAIOEPKU.js} +341 -433
- package/dist/bundle/chunk-YHWFF6DN.js +39 -0
- package/dist/bundle/{chunk-WWE5GO6G.js → chunk-YWOLQEDV.js} +16 -3
- package/dist/bundle/{chunk-DR57KDAY.js → chunk-ZFDSJ5YJ.js} +38 -8
- package/dist/bundle/{chunk-BBFXQPKD.js → chunk-ZFUZEFU6.js} +3 -3
- package/dist/bundle/{chunk-YRUR3E3E.js → chunk-ZJKXSMXK.js} +72 -59
- package/dist/bundle/{chunk-BFKFKDPC.js → chunk-ZKWT6HXT.js} +1 -1
- package/dist/bundle/chunk-ZPUY3COZ.js +250 -0
- package/dist/bundle/{cli-K4D4DIGQ.js → cli-2P5FW2RL.js} +201 -98
- package/dist/bundle/command-contract-BMQT2G5X.js +45 -0
- package/dist/bundle/{command-server-entry-WREK3QBB.js → command-server-entry-KP2UDGLA.js} +36 -34
- package/dist/bundle/{decode-SEETPKBH.js → decode-K2JZ5D6V.js} +10 -10
- package/dist/bundle/{dispatch-SQCEURVK.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-WZ5RKFCX.js → echarts-URO3QGCG.js} +2 -2
- package/dist/bundle/{embed-B2UCRZZR.js → embed-JLIPWTNN.js} +10 -10
- package/dist/bundle/{embedder-4R6Z7G7L.js → embedder-LUTDO3HS.js} +15 -15
- package/dist/bundle/entry-AVF6LMG7.js +25 -0
- package/dist/bundle/{failure-CYNXH3RQ.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-SAND2F7L.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-JVVGS4U6.js → identity-FXPB5EMT.js} +7 -6
- package/dist/bundle/{instructions-JSMTSB22.js → instructions-IROIUVZI.js} +1 -1
- package/dist/bundle/{login-6WG3YBDU.js → login-WIY5VQU7.js} +96 -81
- package/dist/bundle/{mcp-VFIOZDVY.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-5U7JQCFF.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-VJMVHOWD.js → node-IACCI2CW.js} +2 -2
- package/dist/bundle/{node-sqlite-DCNT3HVE.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-NFOEHVW7.js → open-H32B6BCT.js} +8 -8
- package/dist/bundle/{openai-D47WY7EC.js → openai-VHMPJJUG.js} +22 -21
- package/dist/bundle/{process-Q2FRU5VA.js → process-RNHPF5OK.js} +1 -1
- package/dist/bundle/{program-T2AJJQEM.js → program-GYMJ3DDH.js} +276 -1132
- package/dist/bundle/{prompt-YJSDABXN.js → prompt-TOG2CRCE.js} +8 -8
- package/dist/bundle/{reasons-WEHPCSJX.js → reasons-TLFQ45YX.js} +6 -5
- package/dist/bundle/{recognize-6OBEIEB3.js → recognize-GYGY45EY.js} +7 -7
- package/dist/bundle/remote-6XN2QLI5.js +35 -0
- package/dist/bundle/{rerank-L6F5SLIB.js → rerank-HJO3O4TW.js} +11 -11
- package/dist/bundle/{serve-GYSWIWH4.js → serve-XPCNLHCR.js} +19 -19
- package/dist/bundle/server-UBJZ66XE.js +97 -0
- package/dist/bundle/{server-GWWP3RIT.js → server-WPT3NC5B.js} +89 -70
- package/dist/bundle/{services-BDQBRXT5.js → services-253KKKVU.js} +109 -89
- package/dist/bundle/{sqlite-runtime-ZSZGAUYB.js → sqlite-runtime-EZASGJXW.js} +9 -9
- package/dist/bundle/{start-BJ275RUK.js → start-UHI35JFL.js} +7 -7
- package/dist/bundle/{state-HLNGFI2T.js → state-KJTSPFGK.js} +9 -9
- package/dist/bundle/{store-I43KZNJW.js → store-62J2H2A3.js} +36 -25
- package/dist/bundle/{store-OSRTGYGI.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 +7 -1
- 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 +6 -4
- package/dist/sync.js.map +1 -1
- package/dist/transcripts.d.ts +0 -6
- package/dist/transcripts.d.ts.map +1 -1
- package/dist/transcripts.js +0 -13
- package/dist/transcripts.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-AV5UKJZM.js +0 -729
- package/dist/bundle/chunk-NP7LJATI.js +0 -598
- package/dist/bundle/chunk-P77FL6RY.js +0 -896
- package/dist/bundle/chunk-ZI3YTXSF.js +0 -2
- package/dist/bundle/command-contract-V3F452QI.js +0 -43
- package/dist/bundle/entry-ORZYRJ5N.js +0 -25
- package/dist/bundle/first-run-KAKA6KBY.js +0 -31
- package/dist/bundle/first-screen-R645UHRH.js +0 -41
- package/dist/bundle/google-BSO3YB7N.js +0 -45
- package/dist/bundle/grants-PLNFYARD.js +0 -118
- package/dist/bundle/mdast-util-gfm-SZM5GBDF.js +0 -2103
- package/dist/bundle/meeting-combined-SUKMFK3F.js +0 -27
- package/dist/bundle/meeting-model-S4YGKIFI.js +0 -29
- package/dist/bundle/oauth-KCMNQ3ZP.js +0 -22
- package/dist/bundle/remote-3SL2QJ7T.js +0 -35
- package/dist/bundle/server-BI46BSRE.js +0 -80
- package/dist/bundle/store-maintenance-command-FO7LEVSL.js +0 -72
- package/dist/bundle/tokens-DB7O7QNB.js +0 -118
|
@@ -1,598 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
DOC
|
|
5
|
-
} from "./chunk-VVN6GHAZ.js";
|
|
6
|
-
import {
|
|
7
|
-
operations
|
|
8
|
-
} from "./chunk-NYECVHFH.js";
|
|
9
|
-
import {
|
|
10
|
-
privateFiles
|
|
11
|
-
} from "./chunk-FVTKFIQH.js";
|
|
12
|
-
import {
|
|
13
|
-
commandPathKey,
|
|
14
|
-
commandPermissions
|
|
15
|
-
} from "./chunk-3UZ4OH22.js";
|
|
16
|
-
import {
|
|
17
|
-
listQuery,
|
|
18
|
-
queryTerms,
|
|
19
|
-
typedQuery,
|
|
20
|
-
withQuery
|
|
21
|
-
} from "./chunk-GAHIHE4K.js";
|
|
22
|
-
import {
|
|
23
|
-
AI_ENTRIES,
|
|
24
|
-
LEVELS,
|
|
25
|
-
answerEntity,
|
|
26
|
-
checkConfigText,
|
|
27
|
-
issueMessage,
|
|
28
|
-
settingsFor,
|
|
29
|
-
usableProfileName,
|
|
30
|
-
withSettingDefaults
|
|
31
|
-
} from "./chunk-TGS5VPJD.js";
|
|
32
|
-
import {
|
|
33
|
-
MAX_TEXT_CHARS
|
|
34
|
-
} from "./chunk-BBRMDMIR.js";
|
|
35
|
-
import {
|
|
36
|
-
dateRange,
|
|
37
|
-
queryError,
|
|
38
|
-
queryFieldsOf,
|
|
39
|
-
timezoneOf
|
|
40
|
-
} from "./chunk-Q5C6YKAY.js";
|
|
41
|
-
import {
|
|
42
|
-
DRIVE_APP
|
|
43
|
-
} from "./chunk-XOL346TJ.js";
|
|
44
|
-
import {
|
|
45
|
-
BASE_CONSTANTS,
|
|
46
|
-
baseConstantsSchema,
|
|
47
|
-
loadConstants,
|
|
48
|
-
resolvePaths,
|
|
49
|
-
saveConfigFile
|
|
50
|
-
} from "./chunk-HRATXUFH.js";
|
|
51
|
-
import {
|
|
52
|
-
array,
|
|
53
|
-
boolean,
|
|
54
|
-
integer,
|
|
55
|
-
isoTime,
|
|
56
|
-
literal,
|
|
57
|
-
looseObject,
|
|
58
|
-
maxLength,
|
|
59
|
-
maxValue,
|
|
60
|
-
minLength,
|
|
61
|
-
minValue,
|
|
62
|
-
nonEmpty,
|
|
63
|
-
nullable,
|
|
64
|
-
number,
|
|
65
|
-
object,
|
|
66
|
-
optional,
|
|
67
|
-
parse,
|
|
68
|
-
picklist,
|
|
69
|
-
pipe,
|
|
70
|
-
record,
|
|
71
|
-
regex,
|
|
72
|
-
strictObject,
|
|
73
|
-
string,
|
|
74
|
-
transform,
|
|
75
|
-
trim,
|
|
76
|
-
union
|
|
77
|
-
} from "./chunk-HHAZ6DCY.js";
|
|
78
|
-
import {
|
|
79
|
-
CliError
|
|
80
|
-
} from "./chunk-54NDYVZA.js";
|
|
81
|
-
import {
|
|
82
|
-
__name
|
|
83
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
84
|
-
|
|
85
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/oauth/client-file.js
|
|
86
|
-
import { readFileSync } from "node:fs";
|
|
87
|
-
var readClientFile = /* @__PURE__ */ __name((location, options = {}) => {
|
|
88
|
-
if (!options.shipped && typeof location === "string") {
|
|
89
|
-
const mode = privateFiles({ files: [location], dirs: [] }, options.platform);
|
|
90
|
-
if (mode.checked && !mode.ok)
|
|
91
|
-
throw new CliError("configuration_error", `the client file can be read by other users of this computer; run chmod 600 ${location} and try again`, { reason: "sign-in.client-file-open" });
|
|
92
|
-
}
|
|
93
|
-
try {
|
|
94
|
-
const { installed } = JSON.parse(readFileSync(location, "utf8"));
|
|
95
|
-
const { client_id: clientId, client_secret: clientSecret } = installed;
|
|
96
|
-
if (typeof clientId !== "string" || !clientId)
|
|
97
|
-
throw new TypeError("client_id");
|
|
98
|
-
if (clientSecret !== void 0 && typeof clientSecret !== "string")
|
|
99
|
-
throw new TypeError("client_secret");
|
|
100
|
-
return { clientId, ...clientSecret ? { clientSecret } : {} };
|
|
101
|
-
} catch {
|
|
102
|
-
throw options.invalid ?? new CliError("configuration_error", "could not read a Desktop app OAuth client JSON from the client file; its contents were not logged", { reason: "sign-in.client-file-invalid" });
|
|
103
|
-
}
|
|
104
|
-
}, "readClientFile");
|
|
105
|
-
|
|
106
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/constants/obscure.js
|
|
107
|
-
import { createDecipheriv } from "node:crypto";
|
|
108
|
-
var KEY = Buffer.from("d43012779aa2dded3e98092a3dbcf5d8980c564172f5ce0a5fd0574e5f740339", "hex");
|
|
109
|
-
var reveal = /* @__PURE__ */ __name((obscured) => {
|
|
110
|
-
const bytes = Buffer.from(obscured, "base64url");
|
|
111
|
-
const decipher = createDecipheriv("aes-256-ctr", KEY, bytes.subarray(0, 16));
|
|
112
|
-
return Buffer.concat([decipher.update(bytes.subarray(16)), decipher.final()]).toString("utf8");
|
|
113
|
-
}, "reveal");
|
|
114
|
-
|
|
115
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.666.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_02b130a271480a962759fcca79b3d7ec/node_modules/@wirecat/cli-core/dist/constants/index.js
|
|
116
|
-
var CORE_CONSTANTS = new URL("../../constants.json", new URL("constants/index.js", import.meta.resolve("@wirecat/cli-core")).href);
|
|
117
|
-
var constantsSchema = object({
|
|
118
|
-
...baseConstantsSchema.entries,
|
|
119
|
-
google: object({
|
|
120
|
-
app: object({
|
|
121
|
-
client_id: pipe(string(), nonEmpty(), transform(reveal)),
|
|
122
|
-
client_secret: optional(pipe(string(), transform(reveal)))
|
|
123
|
-
})
|
|
124
|
-
}),
|
|
125
|
-
microsoft: object({ app: object({ client_id: pipe(string(), nonEmpty()) }) })
|
|
126
|
-
});
|
|
127
|
-
var loaded = /* @__PURE__ */ new Map();
|
|
128
|
-
var constants = /* @__PURE__ */ __name((toolLayer, schema) => {
|
|
129
|
-
const key = toolLayer?.href ?? "";
|
|
130
|
-
if (!loaded.has(key)) {
|
|
131
|
-
const layers = toolLayer ? [BASE_CONSTANTS, CORE_CONSTANTS, toolLayer] : [BASE_CONSTANTS, CORE_CONSTANTS];
|
|
132
|
-
loaded.set(key, loadConstants(layers, schema ?? constantsSchema));
|
|
133
|
-
}
|
|
134
|
-
return loaded.get(key);
|
|
135
|
-
}, "constants");
|
|
136
|
-
var oauthApp = /* @__PURE__ */ __name((options) => {
|
|
137
|
-
const { env, prefix, provider } = options;
|
|
138
|
-
const name = `${prefix}_${provider.toUpperCase()}_CLIENT`;
|
|
139
|
-
const clientSecret = env[`${name}_SECRET`];
|
|
140
|
-
const own = [
|
|
141
|
-
[options.clientId, "flag"],
|
|
142
|
-
[env[`${name}_ID`], "env"],
|
|
143
|
-
[options.configClientId, "config"]
|
|
144
|
-
];
|
|
145
|
-
const [clientId, source] = own.find(([id]) => id) ?? [];
|
|
146
|
-
if (clientId && source)
|
|
147
|
-
return app({ clientId, ...clientSecret ? { clientSecret } : {} }, source);
|
|
148
|
-
if (clientSecret)
|
|
149
|
-
throw new CliError("configuration_error", `${name}_SECRET is set without a client id; set ${name}_ID too, or unset it to use WireCat's app`, { reason: "sign-in.secret-without-id" });
|
|
150
|
-
const wirecat = options.wirecat;
|
|
151
|
-
if (!wirecat?.client_id)
|
|
152
|
-
return void 0;
|
|
153
|
-
return app({ clientId: wirecat.client_id, ...wirecat.client_secret ? { clientSecret: wirecat.client_secret } : {} }, "constants");
|
|
154
|
-
}, "oauthApp");
|
|
155
|
-
var app = /* @__PURE__ */ __name((client, source) => ({ client: { ...client, source }, source }), "app");
|
|
156
|
-
var googleApp = /* @__PURE__ */ __name((options) => {
|
|
157
|
-
const { clientFile, platform } = options;
|
|
158
|
-
if (clientFile)
|
|
159
|
-
return app(readClientFile(clientFile, platform ? { platform } : {}), "flag");
|
|
160
|
-
const wirecat = (options.constants ?? constants()).google.app;
|
|
161
|
-
return oauthApp({ ...options, provider: "google", wirecat });
|
|
162
|
-
}, "googleApp");
|
|
163
|
-
var oauthClientReport = /* @__PURE__ */ __name((app2, reason) => app2?.source ? { client: app2.source === "constants" ? "wirecat" : "own", source: app2.source } : { client: null, source: null, ...reason ? { reason } : {} }, "oauthClientReport");
|
|
164
|
-
|
|
165
|
-
// dist/policy-keys.js
|
|
166
|
-
var permissionKeys = /* @__PURE__ */ __name((paths2) => {
|
|
167
|
-
const keys = /* @__PURE__ */ new Set([
|
|
168
|
-
"mcp.authority",
|
|
169
|
-
"mcp",
|
|
170
|
-
"sheets.create",
|
|
171
|
-
"sheets.rename",
|
|
172
|
-
"sheets.insert",
|
|
173
|
-
"sheets.format",
|
|
174
|
-
"sheets.update"
|
|
175
|
-
]);
|
|
176
|
-
for (const path of paths2)
|
|
177
|
-
keys.add(path.join("."));
|
|
178
|
-
for (const operation of operations)
|
|
179
|
-
for (const key of methodPolicyKeys(operation.id))
|
|
180
|
-
keys.add(key);
|
|
181
|
-
return keys;
|
|
182
|
-
}, "permissionKeys");
|
|
183
|
-
var permissionNames = /* @__PURE__ */ __name((keys) => {
|
|
184
|
-
const names = /* @__PURE__ */ new Set();
|
|
185
|
-
for (const key of keys) {
|
|
186
|
-
const parts = key.split(".");
|
|
187
|
-
for (let end = 1; end <= parts.length; end++)
|
|
188
|
-
names.add(parts.slice(0, end).join("."));
|
|
189
|
-
}
|
|
190
|
-
return names;
|
|
191
|
-
}, "permissionNames");
|
|
192
|
-
var DEFAULT_LEVELS = {
|
|
193
|
-
"mcp.authority": "deny",
|
|
194
|
-
...Object.fromEntries(operations.filter((op) => op.effect === "destructive").map((op) => [`api.${op.id}`, "ask"]))
|
|
195
|
-
};
|
|
196
|
-
var methodPolicyKeys = /* @__PURE__ */ __name((method, body) => {
|
|
197
|
-
const parts = method.split(".");
|
|
198
|
-
const verb = parts.at(-1);
|
|
199
|
-
const alias = method.startsWith("drive.files.") ? `files.${verb}` : method.startsWith("docs.documents.") ? `documents.${verb === "batchUpdate" ? "update" : verb}` : method.startsWith("sheets.spreadsheets.") ? `sheets.${method === "sheets.spreadsheets.get" ? "info" : method === "sheets.spreadsheets.values.get" ? "show" : verb === "append" ? "add" : verb}` : method === "driveactivity.activity.query" ? "documents.history" : method.startsWith("drive.") ? `${parts[1]}.${verb}` : void 0;
|
|
200
|
-
const keys = [`api.${method}`, ...alias ? [alias] : []];
|
|
201
|
-
if (method === "drive.replies.create" && body)
|
|
202
|
-
keys.push(body.action === "resolve" ? "comments.resolve" : body.action === "reopen" ? "comments.reopen" : "comments.reply");
|
|
203
|
-
if (method === "drive.replies.create" && body?.content !== void 0)
|
|
204
|
-
keys.push("comments.reply");
|
|
205
|
-
if (method === "sheets.spreadsheets.batchUpdate" && Array.isArray(body?.requests)) {
|
|
206
|
-
const object2 = /* @__PURE__ */ __name((value) => !!value && typeof value === "object" && !Array.isArray(value), "object");
|
|
207
|
-
for (const request of body.requests) {
|
|
208
|
-
if (!object2(request))
|
|
209
|
-
continue;
|
|
210
|
-
if (request.addSheet || request.duplicateSheet)
|
|
211
|
-
keys.push("sheets.create");
|
|
212
|
-
if (object2(request.updateSheetProperties)) {
|
|
213
|
-
const update = request.updateSheetProperties;
|
|
214
|
-
if (object2(update.properties) && update.properties.title !== void 0 || String(update.fields).split(",").some((field) => field.trim() === "title" || field.trim() === "*"))
|
|
215
|
-
keys.push("sheets.rename");
|
|
216
|
-
if (object2(update.properties) && update.properties.gridProperties)
|
|
217
|
-
keys.push("sheets.insert");
|
|
218
|
-
}
|
|
219
|
-
if (request.insertDimension || request.appendDimension || request.insertRange)
|
|
220
|
-
keys.push("sheets.insert");
|
|
221
|
-
if (request.repeatCell || request.updateCells || request.appendCells || request.updateBorders || request.addConditionalFormatRule || request.updateConditionalFormatRule || request.deleteConditionalFormatRule || request.addBanding || request.updateBanding || request.deleteBanding)
|
|
222
|
-
keys.push("sheets.format");
|
|
223
|
-
if (request.updateCells || request.appendCells || request.findReplace || request.pasteData || request.copyPaste || request.cutPaste || request.autoFill)
|
|
224
|
-
keys.push("sheets.update");
|
|
225
|
-
if (request.pasteData || request.copyPaste || request.cutPaste || request.autoFill)
|
|
226
|
-
keys.push("sheets.format");
|
|
227
|
-
if (object2(request.repeatCell) && (String(request.repeatCell.fields).split(",").some((field) => field.trim() === "*" || field.includes("userEnteredValue")) || object2(request.repeatCell.cell) && request.repeatCell.cell.userEnteredValue !== void 0))
|
|
228
|
-
keys.push("sheets.update");
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
return [...new Set(keys)];
|
|
232
|
-
}, "methodPolicyKeys");
|
|
233
|
-
|
|
234
|
-
// dist/config.js
|
|
235
|
-
import { readFileSync as readFileSync2 } from "node:fs";
|
|
236
|
-
import { join } from "node:path";
|
|
237
|
-
|
|
238
|
-
// dist/list-queries.js
|
|
239
|
-
var registry = /* @__PURE__ */ __name((entity, schema, native, examples) => ({
|
|
240
|
-
entity,
|
|
241
|
-
backend: "native",
|
|
242
|
-
fields: queryFieldsOf(schema, { native, examples }).map((field) => field.native ? { ...field, operators: ["term", "phrase"] } : field)
|
|
243
|
-
}), "registry");
|
|
244
|
-
var sessionRow = strictObject({
|
|
245
|
-
profile: string(),
|
|
246
|
-
selected_folders: number(),
|
|
247
|
-
storage: picklist(["keyring", "file"])
|
|
248
|
-
});
|
|
249
|
-
var fileRow = looseObject({
|
|
250
|
-
id: optional(string()),
|
|
251
|
-
name: optional(string()),
|
|
252
|
-
trashed: optional(boolean()),
|
|
253
|
-
modified_time: optional(isoTime),
|
|
254
|
-
created_time: optional(isoTime),
|
|
255
|
-
viewed_by_me_time: optional(isoTime)
|
|
256
|
-
});
|
|
257
|
-
var transcriptRow = strictObject({
|
|
258
|
-
id: string(),
|
|
259
|
-
name: string(),
|
|
260
|
-
url: string(),
|
|
261
|
-
owned_by_me: nullable(boolean()),
|
|
262
|
-
modified_at: nullable(string())
|
|
263
|
-
});
|
|
264
|
-
var TRANSCRIPTS_QUERY = registry("drive_transcript", transcriptRow, ["owned_by_me"], {
|
|
265
|
-
owned_by_me: "owned_by_me:false"
|
|
266
|
-
});
|
|
267
|
-
var SESSIONS_QUERY = registry("drive_session", sessionRow, ["profile", "storage"], {
|
|
268
|
-
profile: "profile:personal",
|
|
269
|
-
storage: "storage:keyring"
|
|
270
|
-
});
|
|
271
|
-
var FILES_QUERY = {
|
|
272
|
-
entity: "drive_remote_file",
|
|
273
|
-
backend: "native",
|
|
274
|
-
fields: queryFieldsOf(fileRow, {
|
|
275
|
-
native: ["name", "trashed", "modified_time", "created_time", "viewed_by_me_time"],
|
|
276
|
-
examples: {
|
|
277
|
-
name: 'name:"Example plan"',
|
|
278
|
-
trashed: "trashed:false",
|
|
279
|
-
modified_time: "modified_time>=2026-01-01",
|
|
280
|
-
created_time: "created_time>=2026-01-01",
|
|
281
|
-
viewed_by_me_time: "viewed_by_me_time>=2026-01-01"
|
|
282
|
-
}
|
|
283
|
-
}).map((field) => field.native ? { ...field, operators: field.type === "time" ? ["term", "range"] : ["term", "phrase"] } : field),
|
|
284
|
-
defaults: ["trashed:false"]
|
|
285
|
-
};
|
|
286
|
-
var bindQuery = /* @__PURE__ */ __name((command, query, schema) => answerEntity(withQuery(command, query), query.entity, schema), "bindQuery");
|
|
287
|
-
var termsOf = /* @__PURE__ */ __name((words, query, command) => Object.fromEntries(queryTerms(words, query, command)), "termsOf");
|
|
288
|
-
var quote = /* @__PURE__ */ __name((value) => `'${value.replaceAll("\\", "\\\\").replaceAll("'", "\\'")}'`, "quote");
|
|
289
|
-
var driveFileQuery = /* @__PURE__ */ __name((words, timezone) => {
|
|
290
|
-
const ast = listQuery(typedQuery(words), FILES_QUERY, "files list");
|
|
291
|
-
const zone = timezoneOf(timezone);
|
|
292
|
-
const column = {
|
|
293
|
-
modified_time: "modifiedTime",
|
|
294
|
-
created_time: "createdTime",
|
|
295
|
-
viewed_by_me_time: "viewedByMeTime"
|
|
296
|
-
};
|
|
297
|
-
const render = /* @__PURE__ */ __name((node) => {
|
|
298
|
-
if (node.kind === "boolean") {
|
|
299
|
-
if (node.clauses.some((clause) => clause.occur !== "must"))
|
|
300
|
-
queryError("query.unsupported-operator", node.span, "files list accepts AND terms only");
|
|
301
|
-
return node.clauses.map((clause) => render(clause.node)).join(" and ");
|
|
302
|
-
}
|
|
303
|
-
if (node.field === "name")
|
|
304
|
-
return `name = ${quote(node.value)}`;
|
|
305
|
-
if (node.field === "trashed")
|
|
306
|
-
return `trashed = ${node.value.toLowerCase()}`;
|
|
307
|
-
const range = dateRange(node.value, node.operator === "range" ? node.upper ?? "*" : node.value, node.lower_inclusive ?? true, node.upper_inclusive ?? true, zone, node.span);
|
|
308
|
-
return [
|
|
309
|
-
range.lower === void 0 ? void 0 : `${column[node.field]} ${range.lower_inclusive ? ">=" : ">"} ${quote(new Date(range.lower).toISOString())}`,
|
|
310
|
-
range.upper === void 0 ? void 0 : `${column[node.field]} ${range.upper_inclusive ? "<=" : "<"} ${quote(new Date(range.upper).toISOString())}`
|
|
311
|
-
].filter(Boolean).join(" and ");
|
|
312
|
-
}, "render");
|
|
313
|
-
return { query: ast ? render(ast.root) : "trashed = false", timezone: zone };
|
|
314
|
-
}, "driveFileQuery");
|
|
315
|
-
|
|
316
|
-
// dist/transcripts.js
|
|
317
|
-
var TRANSCRIPT_MODES = ["include", "skip", "exclude"];
|
|
318
|
-
var TRANSCRIPT_WORDS = [
|
|
319
|
-
"Transcript",
|
|
320
|
-
"Notes by Gemini",
|
|
321
|
-
"\u0422\u0440\u0430\u043D\u0441\u043A\u0440\u0438\u043F\u0442",
|
|
322
|
-
"\u0417\u0430\u043C\u0435\u0442\u043A\u0438 Gemini",
|
|
323
|
-
"Transcripci\xF3n",
|
|
324
|
-
"Notas de Gemini"
|
|
325
|
-
];
|
|
326
|
-
var folded = /* @__PURE__ */ __name((text) => text.normalize("NFC").toLowerCase(), "folded");
|
|
327
|
-
var isTranscript = /* @__PURE__ */ __name((words) => (file) => file.mime === DOC && !file.trashed && words.some((word) => folded(file.name).includes(folded(word))), "isTranscript");
|
|
328
|
-
var transcriptsDriveQuery = /* @__PURE__ */ __name((words) => {
|
|
329
|
-
const longest = /* @__PURE__ */ __name((phrase) => phrase.trim().split(/\s+/).reduce((a, b) => b.length > a.length ? b : a, ""), "longest");
|
|
330
|
-
const asked = [...new Set(words.map(longest).filter(Boolean))];
|
|
331
|
-
return `mimeType = '${DOC}' and trashed = false and (${asked.map((word) => `name contains ${quote(word)}`).join(" or ")})`;
|
|
332
|
-
}, "transcriptsDriveQuery");
|
|
333
|
-
var findTranscripts = /* @__PURE__ */ __name(async (search, words) => {
|
|
334
|
-
if (!search)
|
|
335
|
-
throw new CliError("configuration_error", "finding transcripts needs a signed-in Google account");
|
|
336
|
-
const matches = isTranscript(words);
|
|
337
|
-
return (await search(transcriptsDriveQuery(words))).filter(matches);
|
|
338
|
-
}, "findTranscripts");
|
|
339
|
-
var transcriptQuery = /* @__PURE__ */ __name((mode, words, search) => {
|
|
340
|
-
if (mode === void 0 || mode === "skip")
|
|
341
|
-
return void 0;
|
|
342
|
-
const key = JSON.stringify([...new Set(words.map(folded))].sort());
|
|
343
|
-
const query = { key, mode, matches: isTranscript(words) };
|
|
344
|
-
return mode === "include" ? { ...query, list: /* @__PURE__ */ __name(() => findTranscripts(search, words), "list") } : query;
|
|
345
|
-
}, "transcriptQuery");
|
|
346
|
-
|
|
347
|
-
// dist/config.js
|
|
348
|
-
var Common = {
|
|
349
|
-
...AI_ENTRIES,
|
|
350
|
-
permissions: optional(record(string(), picklist(LEVELS))),
|
|
351
|
-
max_text_chars: optional(pipe(number(), integer(), minValue(1), maxValue(MAX_TEXT_CHARS))),
|
|
352
|
-
google_client_id: optional(pipe(string(), trim(), minLength(1)))
|
|
353
|
-
};
|
|
354
|
-
var RunSettings = {
|
|
355
|
-
record: optional(boolean()),
|
|
356
|
-
keep_runs_for_days: optional(pipe(number(), integer(), minValue(1))),
|
|
357
|
-
keep_successful_runs_for_days: optional(pipe(number(), integer(), minValue(1))),
|
|
358
|
-
runs_size_limit_mb: optional(pipe(number(), integer(), minValue(1))),
|
|
359
|
-
record_input: optional(union([boolean(), literal("failed")]))
|
|
360
|
-
};
|
|
361
|
-
var DEFAULT_ADD_PROFILES = 5;
|
|
362
|
-
var MOST_ADD_PROFILES = 50;
|
|
363
|
-
var AcrossProfiles = {
|
|
364
|
-
max_add_profiles: optional(pipe(number(), integer(), minValue(1), maxValue(MOST_ADD_PROFILES)))
|
|
365
|
-
};
|
|
366
|
-
var SharedDefaults = {
|
|
367
|
-
limit: optional(pipe(number(), integer(), minValue(1))),
|
|
368
|
-
sends_per_hour: optional(pipe(number(), integer(), minValue(0))),
|
|
369
|
-
update_check: optional(boolean()),
|
|
370
|
-
skill_hint: optional(boolean())
|
|
371
|
-
};
|
|
372
|
-
var DEFAULTS_ONLY = /* @__PURE__ */ new Set([
|
|
373
|
-
...Object.keys(RunSettings),
|
|
374
|
-
...Object.keys(AcrossProfiles),
|
|
375
|
-
"update_check",
|
|
376
|
-
"skill_hint"
|
|
377
|
-
]);
|
|
378
|
-
var Transcripts = {
|
|
379
|
-
transcripts: optional(picklist(TRANSCRIPT_MODES)),
|
|
380
|
-
transcript_words: optional(pipe(array(pipe(string(), trim(), minLength(1), maxLength(100))), minLength(1), maxLength(50)))
|
|
381
|
-
};
|
|
382
|
-
var PROFILE_ONLY = /* @__PURE__ */ new Set(["picture_search", ...Object.keys(Transcripts)]);
|
|
383
|
-
var SETTING_NAMES = /* @__PURE__ */ new Set([...Object.keys(Common), ...PROFILE_ONLY, ...DEFAULTS_ONLY]);
|
|
384
|
-
var Mirror = strictObject({
|
|
385
|
-
id: pipe(string(), regex(/^[a-z0-9-]{1,40}$/)),
|
|
386
|
-
path: pipe(string(), minLength(1)),
|
|
387
|
-
folder: pipe(string(), regex(/^[A-Za-z0-9_-]{1,200}$/))
|
|
388
|
-
});
|
|
389
|
-
var Profile = strictObject({
|
|
390
|
-
principal: string(),
|
|
391
|
-
roots: optional(array(pipe(string(), regex(/^[A-Za-z0-9_-]{1,200}$/))), []),
|
|
392
|
-
mirrors: optional(array(Mirror)),
|
|
393
|
-
storage: picklist(["keyring", "file"]),
|
|
394
|
-
picture_search: optional(boolean()),
|
|
395
|
-
...Transcripts,
|
|
396
|
-
...Common
|
|
397
|
-
});
|
|
398
|
-
var ConfigSchema = strictObject({
|
|
399
|
-
profiles: optional(record(string(), Profile), {}),
|
|
400
|
-
defaults: optional(strictObject({ ...Common, ...RunSettings, ...AcrossProfiles, ...SharedDefaults }))
|
|
401
|
-
});
|
|
402
|
-
var keyOf = /* @__PURE__ */ __name((path) => {
|
|
403
|
-
if (path[0] !== "api" || path[1] === void 0)
|
|
404
|
-
return commandPathKey(path);
|
|
405
|
-
if (["call", "list", "show"].includes(path[1]))
|
|
406
|
-
return null;
|
|
407
|
-
const operation = operations.find((one) => one.command === path[1]);
|
|
408
|
-
return operation ? `api.${operation.id}` : commandPathKey(path);
|
|
409
|
-
}, "keyOf");
|
|
410
|
-
var permissions = commandPermissions({ keyOf, extra: [...permissionKeys([])], defaults: DEFAULT_LEVELS });
|
|
411
|
-
var configuration = settingsFor(DRIVE_APP, {
|
|
412
|
-
configRepair: false,
|
|
413
|
-
// drive's own schema decides what the file may hold, so `doctor` names a profile that lacks its principal.
|
|
414
|
-
schema: ConfigSchema,
|
|
415
|
-
profile: {
|
|
416
|
-
principal: optional(string()),
|
|
417
|
-
roots: optional(array(pipe(string(), regex(/^[A-Za-z0-9_-]{1,200}$/)))),
|
|
418
|
-
mirrors: optional(array(Mirror)),
|
|
419
|
-
storage: optional(picklist(["keyring", "file"])),
|
|
420
|
-
max_text_chars: Common.max_text_chars,
|
|
421
|
-
google_client_id: Common.google_client_id,
|
|
422
|
-
...Transcripts
|
|
423
|
-
},
|
|
424
|
-
settings: [
|
|
425
|
-
{
|
|
426
|
-
key: "max_text_chars",
|
|
427
|
-
default: MAX_TEXT_CHARS,
|
|
428
|
-
description: "the most characters of text one file may have to be imported"
|
|
429
|
-
},
|
|
430
|
-
{
|
|
431
|
-
key: "max_add_profiles",
|
|
432
|
-
default: DEFAULT_ADD_PROFILES,
|
|
433
|
-
description: "the most profiles documents add may try for one document"
|
|
434
|
-
}
|
|
435
|
-
],
|
|
436
|
-
permissions
|
|
437
|
-
});
|
|
438
|
-
var paths = /* @__PURE__ */ __name((env) => resolvePaths({ appName: "drive-cli", prefix: "DRIVE", env }), "paths");
|
|
439
|
-
var configPath = /* @__PURE__ */ __name((env) => join(paths(env).config, "config.json"), "configPath");
|
|
440
|
-
var TOOL = "drive";
|
|
441
|
-
var isNode = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isNode");
|
|
442
|
-
var withoutIncomplete = /* @__PURE__ */ __name((raw, issues) => {
|
|
443
|
-
const incomplete = new Set(issues.flatMap((issue) => issue.kind === "missing_setting" && issue.profile ? [issue.profile] : []));
|
|
444
|
-
if (!incomplete.size || !isNode(raw) || !isNode(raw.profiles))
|
|
445
|
-
return void 0;
|
|
446
|
-
return {
|
|
447
|
-
...raw,
|
|
448
|
-
profiles: Object.fromEntries(Object.entries(raw.profiles).filter(([name]) => !incomplete.has(name)))
|
|
449
|
-
};
|
|
450
|
-
}, "withoutIncomplete");
|
|
451
|
-
var examine = /* @__PURE__ */ __name((text, file, knownPermissions) => {
|
|
452
|
-
const check = /* @__PURE__ */ __name((body) => checkConfigText(body, {
|
|
453
|
-
file,
|
|
454
|
-
tool: TOOL,
|
|
455
|
-
schema: ConfigSchema,
|
|
456
|
-
repair: false,
|
|
457
|
-
...knownPermissions ? { knownPermissions } : {}
|
|
458
|
-
}), "check");
|
|
459
|
-
const first = check(text);
|
|
460
|
-
if (first.issues.some((issue) => issue.kind === "invalid_json"))
|
|
461
|
-
return { raw: {}, config: { profiles: {} }, issues: first.issues };
|
|
462
|
-
const raw = JSON.parse(text);
|
|
463
|
-
if (first.config)
|
|
464
|
-
return { raw, config: first.config, issues: first.issues };
|
|
465
|
-
const rest = withoutIncomplete(raw, first.issues);
|
|
466
|
-
const second = rest && check(JSON.stringify(rest));
|
|
467
|
-
return {
|
|
468
|
-
raw,
|
|
469
|
-
config: second?.config ?? { profiles: {} },
|
|
470
|
-
// Saved permissions are checked only in what loads, and the first pass loaded nothing.
|
|
471
|
-
issues: [...first.issues, ...(second?.issues ?? []).filter((issue) => issue.kind === "unknown_permission")]
|
|
472
|
-
};
|
|
473
|
-
}, "examine");
|
|
474
|
-
var inspectConfig = /* @__PURE__ */ __name((env, knownPermissions) => {
|
|
475
|
-
const path = configPath(env);
|
|
476
|
-
let text;
|
|
477
|
-
try {
|
|
478
|
-
text = readFileSync2(path, "utf8");
|
|
479
|
-
} catch {
|
|
480
|
-
return { path, found: false, raw: {}, config: { profiles: {} }, issues: [] };
|
|
481
|
-
}
|
|
482
|
-
return { path, found: true, ...examine(text, path, knownPermissions) };
|
|
483
|
-
}, "inspectConfig");
|
|
484
|
-
var configIssues = /* @__PURE__ */ __name((raw, file, knownPermissions) => examine(JSON.stringify(raw), file, knownPermissions).issues, "configIssues");
|
|
485
|
-
var refusal = /* @__PURE__ */ __name((issues) => new CliError("configuration_error", issueMessage(issues)), "refusal");
|
|
486
|
-
var readConfig = /* @__PURE__ */ __name((env, knownPermissions) => {
|
|
487
|
-
const { config, issues } = inspectConfig(env, knownPermissions);
|
|
488
|
-
if (issues.length)
|
|
489
|
-
throw refusal(issues);
|
|
490
|
-
return config;
|
|
491
|
-
}, "readConfig");
|
|
492
|
-
var writeConfig = /* @__PURE__ */ __name((env, config) => {
|
|
493
|
-
const [issue] = configIssues(config, "drive settings");
|
|
494
|
-
if (issue)
|
|
495
|
-
throw new CliError("configuration_error", `drive settings: ${issue.profile === void 0 ? "" : `profile ${issue.profile}: `}${issue.what}`);
|
|
496
|
-
saveConfigFile(configPath(env), withDefaults(parse(ConfigSchema, config)));
|
|
497
|
-
}, "writeConfig");
|
|
498
|
-
var withDefaults = /* @__PURE__ */ __name((raw, except = []) => withSettingDefaults(isNode(raw) && !Object.hasOwn(raw, "defaults") ? { ...raw, defaults: {} } : raw, configuration.declaredSettings.filter(({ key }) => !except.includes(key))).config, "withDefaults");
|
|
499
|
-
var profileName = usableProfileName;
|
|
500
|
-
var fileId = /* @__PURE__ */ __name((input) => {
|
|
501
|
-
let id = input;
|
|
502
|
-
if (input.startsWith("https://")) {
|
|
503
|
-
const url = new URL(input);
|
|
504
|
-
if (url.hostname !== "drive.google.com" && url.hostname !== "docs.google.com")
|
|
505
|
-
throw new CliError("validation_error", "use a Google Drive/Docs URL or file ID");
|
|
506
|
-
id = url.pathname.match(/\/(?:folders|d)\/([^/]+)/)?.[1] ?? "";
|
|
507
|
-
}
|
|
508
|
-
if (!/^[A-Za-z0-9_-]{1,200}$/.test(id))
|
|
509
|
-
throw new CliError("validation_error", "invalid Google file ID");
|
|
510
|
-
return id;
|
|
511
|
-
}, "fileId");
|
|
512
|
-
var unknownProfile = /* @__PURE__ */ __name((name, profiles) => new CliError("not_found", profiles.length ? `no profile ${name} here \u2014 profiles here: ${profiles.join(", ")}; a new one signs in with drive ${name} session start` : `no profiles here yet; create one with drive ${name} session start`, { reason: "profile.unknown", profiles }), "unknownProfile");
|
|
513
|
-
var activeProfile = /* @__PURE__ */ __name((env, name) => {
|
|
514
|
-
const config = readConfig(env);
|
|
515
|
-
const profile = config.profiles[profileName(name)];
|
|
516
|
-
if (!profile)
|
|
517
|
-
throw unknownProfile(name, Object.keys(config.profiles).sort());
|
|
518
|
-
return profile;
|
|
519
|
-
}, "activeProfile");
|
|
520
|
-
var checkTextLimit = /* @__PURE__ */ __name((value) => {
|
|
521
|
-
if (typeof value !== "number" || !Number.isInteger(value) || value < 1)
|
|
522
|
-
throw new CliError("validation_error", "max_text_chars must be a positive whole number of characters");
|
|
523
|
-
if (value > MAX_TEXT_CHARS)
|
|
524
|
-
throw new CliError("validation_error", `max_text_chars can be at most ${MAX_TEXT_CHARS}: the document readers return at most that many characters`);
|
|
525
|
-
return value;
|
|
526
|
-
}, "checkTextLimit");
|
|
527
|
-
var textLimit = /* @__PURE__ */ __name((env, name) => activeProfile(env, name).max_text_chars ?? readConfig(env).defaults?.max_text_chars ?? MAX_TEXT_CHARS, "textLimit");
|
|
528
|
-
var transcriptsOf = /* @__PURE__ */ __name((env, name) => {
|
|
529
|
-
const profile = activeProfile(env, name);
|
|
530
|
-
return { mode: profile.transcripts, words: profile.transcript_words ?? [...TRANSCRIPT_WORDS] };
|
|
531
|
-
}, "transcriptsOf");
|
|
532
|
-
var pictureSearch = /* @__PURE__ */ __name((env, name) => activeProfile(env, name).picture_search ?? false, "pictureSearch");
|
|
533
|
-
var googleAppOf = /* @__PURE__ */ __name((env, { file, clientId, profile } = {}) => {
|
|
534
|
-
const own = file || clientId || env.DRIVE_GOOGLE_CLIENT_ID;
|
|
535
|
-
const config = own ? void 0 : readConfig(env);
|
|
536
|
-
const configClientId = (profile === void 0 ? void 0 : config?.profiles[profileName(profile)]?.google_client_id) ?? config?.defaults?.google_client_id;
|
|
537
|
-
return googleApp({ env, prefix: "DRIVE", clientFile: file, clientId, configClientId });
|
|
538
|
-
}, "googleAppOf");
|
|
539
|
-
var application = /* @__PURE__ */ __name((env, choice = {}) => googleAppOf(env, choice).client, "application");
|
|
540
|
-
var selectedFolders = /* @__PURE__ */ __name((env, profile, filter = {}) => activeProfile(env, profile).roots.flatMap((id) => filter.id === void 0 || id === filter.id ? [{ id }] : []), "selectedFolders");
|
|
541
|
-
var configuredSessions = /* @__PURE__ */ __name((env, filter, knownPermissions) => Object.entries(readConfig(env, knownPermissions).profiles).flatMap(([name, row]) => (filter.profile === void 0 || filter.profile === name) && (filter.storage === void 0 || filter.storage === row.storage) ? [{ profile: name, selected_folders: row.roots.length, storage: row.storage }] : []), "configuredSessions");
|
|
542
|
-
var maxAddProfiles = /* @__PURE__ */ __name((env) => readConfig(env).defaults?.max_add_profiles ?? DEFAULT_ADD_PROFILES, "maxAddProfiles");
|
|
543
|
-
var checkAddProfiles = /* @__PURE__ */ __name((value) => {
|
|
544
|
-
if (typeof value !== "number" || !Number.isInteger(value) || value < 1 || value > MOST_ADD_PROFILES)
|
|
545
|
-
throw new CliError("validation_error", `max_add_profiles is a whole number from 1 to ${MOST_ADD_PROFILES}`);
|
|
546
|
-
return value;
|
|
547
|
-
}, "checkAddProfiles");
|
|
548
|
-
var profileLocked = /* @__PURE__ */ __name((lock, named) => new CliError("permission_error", `this process is locked to profile ${lock} (DRIVE_PROFILE_LOCK) \u2014 ${named} is refused`, {
|
|
549
|
-
reason: "profile.locked"
|
|
550
|
-
}), "profileLocked");
|
|
551
|
-
var profileRequired = /* @__PURE__ */ __name((choices, how = "drive <profile> \u2026") => new CliError("validation_error", choices.length ? `name a profile: ${how} \u2014 profiles here: ${choices.join(", ")} (or set DRIVE_PROFILE)` : "no profiles here yet; create one with drive personal session start (any name in place of personal)", { reason: "profile.required", profiles: [...choices] }), "profileRequired");
|
|
552
|
-
|
|
553
|
-
export {
|
|
554
|
-
oauthClientReport,
|
|
555
|
-
permissionKeys,
|
|
556
|
-
permissionNames,
|
|
557
|
-
DEFAULT_LEVELS,
|
|
558
|
-
methodPolicyKeys,
|
|
559
|
-
sessionRow,
|
|
560
|
-
fileRow,
|
|
561
|
-
transcriptRow,
|
|
562
|
-
TRANSCRIPTS_QUERY,
|
|
563
|
-
SESSIONS_QUERY,
|
|
564
|
-
FILES_QUERY,
|
|
565
|
-
bindQuery,
|
|
566
|
-
termsOf,
|
|
567
|
-
driveFileQuery,
|
|
568
|
-
findTranscripts,
|
|
569
|
-
transcriptQuery,
|
|
570
|
-
DEFAULTS_ONLY,
|
|
571
|
-
PROFILE_ONLY,
|
|
572
|
-
SETTING_NAMES,
|
|
573
|
-
configuration,
|
|
574
|
-
paths,
|
|
575
|
-
configPath,
|
|
576
|
-
inspectConfig,
|
|
577
|
-
configIssues,
|
|
578
|
-
refusal,
|
|
579
|
-
readConfig,
|
|
580
|
-
writeConfig,
|
|
581
|
-
withDefaults,
|
|
582
|
-
profileName,
|
|
583
|
-
fileId,
|
|
584
|
-
unknownProfile,
|
|
585
|
-
activeProfile,
|
|
586
|
-
checkTextLimit,
|
|
587
|
-
textLimit,
|
|
588
|
-
transcriptsOf,
|
|
589
|
-
pictureSearch,
|
|
590
|
-
googleAppOf,
|
|
591
|
-
application,
|
|
592
|
-
selectedFolders,
|
|
593
|
-
configuredSessions,
|
|
594
|
-
maxAddProfiles,
|
|
595
|
-
checkAddProfiles,
|
|
596
|
-
profileLocked,
|
|
597
|
-
profileRequired
|
|
598
|
-
};
|