@wirecat/drive-cli 0.72.1 → 0.73.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 +4 -0
- package/contracts/wirecat.json +82 -18
- package/dist/bin/drive.js +2 -2
- package/dist/bundle/agent-ZOHMLVWI.js +46 -0
- package/dist/bundle/{all-profiles-PZVP3G73.js → all-profiles-HGQGKCKQ.js} +14 -14
- package/dist/bundle/{anthropic-PUOTKSYV.js → anthropic-2L5DN3HF.js} +8 -8
- package/dist/bundle/{app-server-MKDCXRZM.js → app-server-TRSOKYYF.js} +79 -79
- package/dist/bundle/{bun-NS5YLOQT.js → bun-AFA5HULK.js} +2 -2
- package/dist/bundle/{bun-sqlite-KSKWRLLO.js → bun-sqlite-5MW2BWV4.js} +9 -9
- package/dist/bundle/{chunk-JHAACT4I.js → chunk-2G24DYSZ.js} +2 -2
- package/dist/bundle/{chunk-MDJUYCHT.js → chunk-2MCMUZCE.js} +1 -1
- package/dist/bundle/{chunk-FKP4T7A4.js → chunk-2NAMKBBV.js} +31 -23
- package/dist/bundle/{chunk-3YCUYFTD.js → chunk-2WAGRBQT.js} +50 -47
- package/dist/bundle/{chunk-S3SLDYTU.js → chunk-33RQ3YVC.js} +1 -1
- package/dist/bundle/{chunk-54O5NJRC.js → chunk-36256UTA.js} +12 -12
- package/dist/bundle/{chunk-ZNFXKFGF.js → chunk-4FTGSEBR.js} +6 -6
- package/dist/bundle/{chunk-YRCGFSRR.js → chunk-4KOMZRN6.js} +2 -2
- package/dist/bundle/{chunk-HPS2YGSZ.js → chunk-4LLO4USI.js} +1 -1
- package/dist/bundle/{chunk-HDGJ7IDE.js → chunk-4VTAPSZE.js} +4 -4
- package/dist/bundle/{chunk-QB7K6PIP.js → chunk-4ZP3IK5I.js} +6 -6
- package/dist/bundle/{chunk-KVBGIZ2C.js → chunk-5CYWWYIG.js} +6 -1
- package/dist/bundle/{chunk-FJQO5OHR.js → chunk-5EZCDENA.js} +61 -35
- package/dist/bundle/{chunk-RM4DO2WZ.js → chunk-5R2VPXVT.js} +1 -1
- package/dist/bundle/{chunk-2CG3LUQS.js → chunk-5SQHQRNO.js} +4 -4
- package/dist/bundle/{chunk-3VIEGRBA.js → chunk-6AVHD6WB.js} +6 -6
- package/dist/bundle/{chunk-JSYUB4SM.js → chunk-6EC3LAVC.js} +2 -2
- package/dist/bundle/{chunk-SWQDKO6D.js → chunk-6HZKX65K.js} +3 -3
- package/dist/bundle/{chunk-YE7DJB3F.js → chunk-6TGZCOYR.js} +3 -3
- package/dist/bundle/{chunk-SUQT4KI2.js → chunk-6V5556NF.js} +7 -7
- package/dist/bundle/{chunk-R3EDZWXF.js → chunk-6WZLP4CI.js} +5 -5
- package/dist/bundle/{chunk-UT64BBEP.js → chunk-77SAHCDZ.js} +4 -4
- package/dist/bundle/{chunk-FTL3WXZB.js → chunk-AGATODLO.js} +12 -12
- package/dist/bundle/{chunk-IBQZT2YD.js → chunk-B6YBN6VK.js} +1 -1
- package/dist/bundle/{chunk-AG34MPVN.js → chunk-BAG4KIN5.js} +1 -1
- package/dist/bundle/{chunk-MA7ETVTZ.js → chunk-BAHWXDWN.js} +16 -16
- package/dist/bundle/{chunk-2TVHFJKV.js → chunk-BFESDJPU.js} +1 -1
- package/dist/bundle/{chunk-SODB63MR.js → chunk-BOHC2GPY.js} +36 -36
- package/dist/bundle/{chunk-VHTELRUA.js → chunk-BY5D2LXE.js} +3 -3
- package/dist/bundle/{chunk-G7SKXAVZ.js → chunk-CMB6URN7.js} +5 -5
- package/dist/bundle/{chunk-HOICQNJX.js → chunk-CY2MNN3I.js} +5 -5
- package/dist/bundle/{chunk-G2KKMQRN.js → chunk-DAYHLKTM.js} +2 -2
- package/dist/bundle/{chunk-JVM75M4H.js → chunk-DOUFW7RK.js} +3 -3
- package/dist/bundle/{chunk-S27UKJVL.js → chunk-DZG5SAO6.js} +14 -14
- package/dist/bundle/{chunk-X6HPQKAI.js → chunk-E3UFICXC.js} +33 -29
- package/dist/bundle/{chunk-MA6U4XH2.js → chunk-EBGI3Z6U.js} +1 -1
- package/dist/bundle/{chunk-DOEP4EPW.js → chunk-EQGVNLUN.js} +42 -42
- package/dist/bundle/{chunk-HMN26CVU.js → chunk-F5XMZDR5.js} +2 -2
- package/dist/bundle/{chunk-VBIZD5V5.js → chunk-FITKBN46.js} +2 -2
- package/dist/bundle/{chunk-6KND2DYT.js → chunk-FRQBKAPV.js} +6 -6
- package/dist/bundle/{chunk-IE3R46YN.js → chunk-GW7L2G4I.js} +57 -57
- package/dist/bundle/{chunk-MGC2BAD2.js → chunk-HGXFOXSA.js} +1 -1
- package/dist/bundle/{chunk-SSFGSY77.js → chunk-HYJEBBFK.js} +489 -317
- package/dist/bundle/{chunk-KOI5G7NM.js → chunk-I2KGZ6XQ.js} +6 -6
- package/dist/bundle/{chunk-PMAV3RNP.js → chunk-I3DZHZHM.js} +7 -7
- package/dist/bundle/{chunk-HSASPXRW.js → chunk-I3MLLVPE.js} +3 -3
- package/dist/bundle/{chunk-PUVQOZ2N.js → chunk-IDJKYHVG.js} +2246 -2047
- package/dist/bundle/{chunk-EXHTGQR2.js → chunk-IEGU6GG7.js} +1 -1
- package/dist/bundle/{chunk-QURQ2OU2.js → chunk-IKW3PRNG.js} +13 -13
- package/dist/bundle/{chunk-XZEVHUKI.js → chunk-J3I4WOBI.js} +3 -3
- package/dist/bundle/{chunk-B6JC5RS3.js → chunk-JA37PJL4.js} +11 -11
- package/dist/bundle/{chunk-3QBRS3JT.js → chunk-JJGKHGBX.js} +8 -8
- package/dist/bundle/{chunk-7YPZPJTB.js → chunk-JWNM6FCC.js} +1 -1
- package/dist/bundle/{chunk-IPBYU43F.js → chunk-JZYNXTMH.js} +46 -15
- package/dist/bundle/{chunk-KPBUJQKT.js → chunk-K34B37AP.js} +1 -1
- package/dist/bundle/{chunk-QK7GKFKB.js → chunk-KERX3BQL.js} +4 -4
- package/dist/bundle/{chunk-IE6O7463.js → chunk-KV232TIK.js} +4 -4
- package/dist/bundle/{chunk-HCMEU7AF.js → chunk-KXETGAU4.js} +8 -8
- package/dist/bundle/{chunk-IV77ZFF4.js → chunk-L5ZZ6RLL.js} +2 -2
- package/dist/bundle/{chunk-CP2TZXAG.js → chunk-LGRZNEMA.js} +8 -8
- package/dist/bundle/{chunk-QMUWHKP5.js → chunk-M3VJTLFM.js} +6 -6
- package/dist/bundle/{chunk-JDGF3YYS.js → chunk-MTH76YSQ.js} +418 -404
- package/dist/bundle/{chunk-XKWQDQ4B.js → chunk-NA4HEM4Z.js} +3 -3
- package/dist/bundle/{chunk-5BHP4FVM.js → chunk-OCZWU2H4.js} +2 -2
- package/dist/bundle/{chunk-6JU4KLAZ.js → chunk-OHKAL25R.js} +62 -62
- package/dist/bundle/{chunk-BDZXGDGI.js → chunk-P2FOF6RR.js} +3 -3
- package/dist/bundle/{chunk-KI6OOW6D.js → chunk-PMYTDTT4.js} +1 -1
- package/dist/bundle/{chunk-4DK55MLP.js → chunk-PQSCABAC.js} +10 -10
- package/dist/bundle/{chunk-A5XNUMW7.js → chunk-PSFACXOC.js} +2 -2
- package/dist/bundle/{chunk-BMTMGMGE.js → chunk-PSWVHX53.js} +1 -1
- package/dist/bundle/{chunk-PB6ACIME.js → chunk-Q2L3W7PS.js} +2 -2
- package/dist/bundle/{chunk-GTROGY74.js → chunk-QMDVQ4AN.js} +12 -12
- package/dist/bundle/{chunk-OBDPKDGB.js → chunk-QZXFWDTX.js} +6 -6
- package/dist/bundle/{chunk-GYAPDUF5.js → chunk-R2GLRHNK.js} +5 -5
- package/dist/bundle/{chunk-PSY67L73.js → chunk-R6K36FZ7.js} +23 -23
- package/dist/bundle/{chunk-SAEBHENE.js → chunk-RHS3OBO5.js} +4 -4
- package/dist/bundle/{chunk-LKUWH6KU.js → chunk-RNLLWYPV.js} +1 -1
- package/dist/bundle/{chunk-3ZGWJYSG.js → chunk-RX6D64YA.js} +20 -20
- package/dist/bundle/{chunk-YJVQ5GST.js → chunk-S7EQIYNF.js} +1 -1
- package/dist/bundle/{chunk-UL5HSHFU.js → chunk-SIC2CGYE.js} +4 -4
- package/dist/bundle/{chunk-T3OK6AYZ.js → chunk-SNY4WYPH.js} +5 -5
- package/dist/bundle/{chunk-TUL6MCTY.js → chunk-SQODI3DH.js} +2 -2
- package/dist/bundle/{chunk-IABPGOMT.js → chunk-SRRNRQSQ.js} +2 -2
- package/dist/bundle/{chunk-TFIAD57H.js → chunk-SYQKLEP3.js} +4 -4
- package/dist/bundle/{chunk-WDJRUNQN.js → chunk-TAQUEQ5B.js} +8 -8
- package/dist/bundle/{chunk-GFI3UUIU.js → chunk-TPIGO4JJ.js} +1 -1
- package/dist/bundle/{chunk-4P6D6CUS.js → chunk-U5SB2WDG.js} +10 -10
- package/dist/bundle/{chunk-G2CH4FRW.js → chunk-UDP7EQNY.js} +4 -4
- package/dist/bundle/{chunk-E2TMWONO.js → chunk-UZAOKKGK.js} +753 -494
- package/dist/bundle/{chunk-SM7Z2BQF.js → chunk-V5GIK53Z.js} +17 -17
- package/dist/bundle/{chunk-3T7JIHSO.js → chunk-VENGEFU4.js} +8 -8
- package/dist/bundle/{chunk-E5EYJU5R.js → chunk-VHPNTMJJ.js} +1 -1
- package/dist/bundle/{chunk-3CH7I452.js → chunk-VM3IERRK.js} +7 -7
- package/dist/bundle/{chunk-B5V2U7IS.js → chunk-VQ7K2EAW.js} +9 -9
- package/dist/bundle/{chunk-IS7STZEB.js → chunk-VQC4GYIQ.js} +3 -3
- package/dist/bundle/{chunk-X5CXANSA.js → chunk-VZTDELYM.js} +3 -3
- package/dist/bundle/{chunk-35GROSBS.js → chunk-W3OKRT6L.js} +179 -135
- package/dist/bundle/{chunk-KBR7OC5S.js → chunk-WB46DJSK.js} +2 -2
- package/dist/bundle/{chunk-43PCMVTZ.js → chunk-WITO2RZO.js} +1 -1
- package/dist/bundle/{chunk-ODTBJGWQ.js → chunk-WJ7E6TPR.js} +17 -17
- package/dist/bundle/{chunk-JRED7BNX.js → chunk-WUVNBZWC.js} +191 -160
- package/dist/bundle/{chunk-VOQICE3G.js → chunk-ZDYWRT3X.js} +7 -7
- package/dist/bundle/{chunk-JZ65CQWK.js → chunk-ZQMURHTL.js} +6 -6
- package/dist/bundle/{cli-KXRWXGTS.js → cli-A7MMBLGR.js} +83 -83
- package/dist/bundle/command-contract-WCGIIXYM.js +45 -0
- package/dist/bundle/{command-server-entry-7FZX74T6.js → command-server-entry-557ZCX63.js} +35 -35
- package/dist/bundle/{decode-SZ6W34U3.js → decode-3IPZIY2P.js} +8 -8
- package/dist/bundle/{dispatch-4KNSZ3PI.js → dispatch-UWS7A35Q.js} +9 -9
- package/dist/bundle/drive.js +11 -11
- package/dist/bundle/{echarts-ISH62J4E.js → echarts-JLCV6NKC.js} +2 -2
- package/dist/bundle/{embed-6ODGTZPK.js → embed-Q6H3QSMC.js} +9 -9
- package/dist/bundle/{embedder-6FY67FTQ.js → embedder-536EI65E.js} +12 -12
- package/dist/bundle/entry-3PKJTP5E.js +25 -0
- package/dist/bundle/{failure-V3ILKUTX.js → failure-W3VT5D3H.js} +4 -4
- package/dist/bundle/first-run-XTLP6VXF.js +31 -0
- package/dist/bundle/first-screen-3GQGULPE.js +45 -0
- package/dist/bundle/google-MEPVU4EP.js +46 -0
- package/dist/bundle/{google-api-ZTI3NKZX.js → google-api-SY25TRXJ.js} +85 -85
- package/dist/bundle/grants-77W5MSWQ.js +133 -0
- package/dist/bundle/{identity-YX4IPGOO.js → identity-ZBMVHXUY.js} +6 -6
- package/dist/bundle/{instructions-G5ZGHVFB.js → instructions-XQOWVU6J.js} +1 -1
- package/dist/bundle/{login-CVX5VJX6.js → login-LXXYFMD3.js} +91 -91
- package/dist/bundle/{mcp-MQ2L5IIM.js → mcp-VNOYBWW2.js} +2 -2
- package/dist/bundle/meeting-combined-NWWZCYN4.js +28 -0
- package/dist/bundle/meeting-model-K7UQ7TO5.js +29 -0
- package/dist/bundle/{meeting-semantic-OHG2QN2G.js → meeting-semantic-Z7FAOSLQ.js} +10 -10
- package/dist/bundle/{node-NLJINXVQ.js → node-MPZ3SVB4.js} +2 -2
- package/dist/bundle/{node-sqlite-KDFQDYVZ.js → node-sqlite-VL5BMY34.js} +10 -10
- package/dist/bundle/notes-search-MF7QKFQD.js +74 -0
- package/dist/bundle/oauth-EYJXUTXZ.js +22 -0
- package/dist/bundle/{open-WVRUVBIZ.js → open-SERV3YXC.js} +8 -8
- package/dist/bundle/{openai-JJWOSJMV.js → openai-HUXETQVC.js} +20 -20
- package/dist/bundle/{process-LPVAYRO7.js → process-RFIII6TW.js} +1 -1
- package/dist/bundle/{program-ZJRIP25J.js → program-VQ6IKDBJ.js} +352 -130
- package/dist/bundle/{prompt-XCDHTEAO.js → prompt-LCD5ZR7Q.js} +8 -8
- package/dist/bundle/{reasons-REEEQDAZ.js → reasons-GDQIXGWT.js} +5 -5
- package/dist/bundle/{recognize-OZLFDJAT.js → recognize-GWKRFWHF.js} +7 -7
- package/dist/bundle/{remote-MDPYVCZB.js → remote-XM2CRZJY.js} +13 -13
- package/dist/bundle/{rerank-FLZWJNHA.js → rerank-HR5J35V6.js} +10 -10
- package/dist/bundle/{serve-5UV5VLRV.js → serve-PP3XR3GA.js} +12 -12
- package/dist/bundle/{server-53A2X2MK.js → server-DD3DE536.js} +71 -71
- package/dist/bundle/server-NB4RGNYM.js +97 -0
- package/dist/bundle/{services-XSMH7BXB.js → services-4Y7R425J.js} +62 -58
- package/dist/bundle/{sqlite-runtime-E3L7ENFU.js → sqlite-runtime-CVYBPVKO.js} +9 -9
- package/dist/bundle/{start-4S2VNR4J.js → start-2KFZDMWM.js} +7 -7
- package/dist/bundle/{state-TQI4JSH7.js → state-AUXW4REW.js} +9 -9
- package/dist/bundle/{store-VYJPL7MW.js → store-B7X6UN75.js} +28 -28
- package/dist/bundle/{store-GS7PU6PJ.js → store-RADARFIH.js} +26 -26
- package/dist/bundle/store-maintenance-command-UTZWPNUF.js +85 -0
- package/dist/bundle/surface-4MUNDC3D.js +83 -0
- package/dist/bundle/tokens-AIKNGAOI.js +133 -0
- package/dist/commands/file-edit.d.ts +18 -0
- package/dist/commands/file-edit.d.ts.map +1 -0
- package/dist/commands/file-edit.js +39 -0
- package/dist/commands/file-edit.js.map +1 -0
- package/dist/commands/remote.d.ts +4 -0
- package/dist/commands/remote.d.ts.map +1 -1
- package/dist/commands/remote.js +59 -17
- package/dist/commands/remote.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +17 -1
- package/dist/config.js.map +1 -1
- package/dist/drive-files.d.ts +26 -0
- package/dist/drive-files.d.ts.map +1 -0
- package/dist/drive-files.js +127 -0
- package/dist/drive-files.js.map +1 -0
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +52 -1
- package/dist/program.js.map +1 -1
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +5 -0
- package/dist/reasons.js.map +1 -1
- package/dist/upload.d.ts +3 -1
- package/dist/upload.d.ts.map +1 -1
- package/dist/upload.js +5 -4
- package/dist/upload.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/drive-cli/SKILL.md +4 -0
- package/dist/bundle/agent-GOCD4ZW2.js +0 -46
- package/dist/bundle/command-contract-BGNT7MTQ.js +0 -45
- package/dist/bundle/entry-2SA6ZX7E.js +0 -25
- package/dist/bundle/first-run-ZNKPPD6M.js +0 -31
- package/dist/bundle/first-screen-WF6GYLPN.js +0 -45
- package/dist/bundle/google-QCADNPCQ.js +0 -46
- package/dist/bundle/grants-BPN5AGDK.js +0 -133
- package/dist/bundle/meeting-combined-HKZJMJ6Q.js +0 -28
- package/dist/bundle/meeting-model-DSE4GRVE.js +0 -29
- package/dist/bundle/notes-search-3VBVSQ3R.js +0 -70
- package/dist/bundle/oauth-M3E62ZHC.js +0 -22
- package/dist/bundle/server-5GMURMDE.js +0 -97
- package/dist/bundle/store-maintenance-command-JJVYUZMG.js +0 -85
- package/dist/bundle/surface-JC4XVMZR.js +0 -83
- package/dist/bundle/tokens-KJQ5EAPW.js +0 -133
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
describeDriveProgram,
|
|
11
11
|
examples,
|
|
12
12
|
markProfileFree
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VQC4GYIQ.js";
|
|
14
14
|
import {
|
|
15
15
|
apiMethod,
|
|
16
16
|
apiMethods,
|
|
@@ -19,11 +19,12 @@ import {
|
|
|
19
19
|
schemas,
|
|
20
20
|
validateApiParams,
|
|
21
21
|
validateRequest
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-J3I4WOBI.js";
|
|
23
23
|
import {
|
|
24
24
|
CATALOG_FIELDS,
|
|
25
25
|
DEFAULTS_ONLY,
|
|
26
26
|
DEFAULT_LEVELS,
|
|
27
|
+
DELETE_KEY,
|
|
27
28
|
FILES_QUERY,
|
|
28
29
|
PROFILE_ONLY,
|
|
29
30
|
SESSIONS_QUERY,
|
|
@@ -37,6 +38,7 @@ import {
|
|
|
37
38
|
addDocumentMirrorCommands,
|
|
38
39
|
addDocumentSearchCommand,
|
|
39
40
|
addDocumentSyncCommands,
|
|
41
|
+
addFileEditCommands,
|
|
40
42
|
addLocalDocumentCommands,
|
|
41
43
|
application,
|
|
42
44
|
bindQuery,
|
|
@@ -77,14 +79,14 @@ import {
|
|
|
77
79
|
unknownProfile,
|
|
78
80
|
withDefaults,
|
|
79
81
|
writeConfig
|
|
80
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-W3OKRT6L.js";
|
|
81
83
|
import {
|
|
82
84
|
operations
|
|
83
85
|
} from "./chunk-G4NHRFS7.js";
|
|
84
86
|
import {
|
|
85
87
|
MAX_ENTRIES,
|
|
86
88
|
supported
|
|
87
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-SQODI3DH.js";
|
|
88
90
|
import {
|
|
89
91
|
DOC,
|
|
90
92
|
DOCUMENT_LIST_FIELDS,
|
|
@@ -96,17 +98,19 @@ import {
|
|
|
96
98
|
documentIngestion,
|
|
97
99
|
documentKnowledge,
|
|
98
100
|
fileMirrorState,
|
|
101
|
+
fileText,
|
|
102
|
+
fileVersions,
|
|
99
103
|
markdownBlocks,
|
|
100
104
|
mergeBlocks,
|
|
101
105
|
metadataJson,
|
|
102
106
|
normalizeInlines,
|
|
103
107
|
spliceMarkdown,
|
|
104
108
|
syncDocuments
|
|
105
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-IDJKYHVG.js";
|
|
106
110
|
import {
|
|
107
111
|
googleError,
|
|
108
112
|
offlineRefused
|
|
109
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-S7EQIYNF.js";
|
|
110
114
|
import {
|
|
111
115
|
DISCOVERY_DESCRIPTIONS,
|
|
112
116
|
MEMO_SCENARIOS,
|
|
@@ -131,25 +135,25 @@ import {
|
|
|
131
135
|
signInSteps,
|
|
132
136
|
skillCommand,
|
|
133
137
|
upgradeCommand
|
|
134
|
-
} from "./chunk-
|
|
135
|
-
import "./chunk-
|
|
136
|
-
import "./chunk-
|
|
137
|
-
import "./chunk-
|
|
138
|
-
import "./chunk-
|
|
139
|
-
import "./chunk-
|
|
140
|
-
import "./chunk-
|
|
141
|
-
import "./chunk-
|
|
142
|
-
import "./chunk-
|
|
143
|
-
import "./chunk-
|
|
138
|
+
} from "./chunk-MTH76YSQ.js";
|
|
139
|
+
import "./chunk-5R2VPXVT.js";
|
|
140
|
+
import "./chunk-IEGU6GG7.js";
|
|
141
|
+
import "./chunk-E3UFICXC.js";
|
|
142
|
+
import "./chunk-I2KGZ6XQ.js";
|
|
143
|
+
import "./chunk-36256UTA.js";
|
|
144
|
+
import "./chunk-QMDVQ4AN.js";
|
|
145
|
+
import "./chunk-SYQKLEP3.js";
|
|
146
|
+
import "./chunk-BY5D2LXE.js";
|
|
147
|
+
import "./chunk-JZYNXTMH.js";
|
|
144
148
|
import {
|
|
145
149
|
storeInfo
|
|
146
|
-
} from "./chunk-
|
|
147
|
-
import "./chunk-
|
|
148
|
-
import "./chunk-
|
|
149
|
-
import "./chunk-
|
|
150
|
-
import "./chunk-
|
|
151
|
-
import "./chunk-
|
|
152
|
-
import "./chunk-
|
|
150
|
+
} from "./chunk-OHKAL25R.js";
|
|
151
|
+
import "./chunk-JJGKHGBX.js";
|
|
152
|
+
import "./chunk-BAHWXDWN.js";
|
|
153
|
+
import "./chunk-VENGEFU4.js";
|
|
154
|
+
import "./chunk-DOUFW7RK.js";
|
|
155
|
+
import "./chunk-ZDYWRT3X.js";
|
|
156
|
+
import "./chunk-Q2L3W7PS.js";
|
|
153
157
|
import {
|
|
154
158
|
RecipientList,
|
|
155
159
|
SendJournal,
|
|
@@ -162,52 +166,52 @@ import {
|
|
|
162
166
|
parseApiJson,
|
|
163
167
|
readApiBody,
|
|
164
168
|
sendGuard
|
|
165
|
-
} from "./chunk-
|
|
169
|
+
} from "./chunk-HYJEBBFK.js";
|
|
166
170
|
import {
|
|
167
171
|
columnName,
|
|
168
172
|
readSpreadsheet
|
|
169
|
-
} from "./chunk-
|
|
170
|
-
import "./chunk-
|
|
173
|
+
} from "./chunk-BOHC2GPY.js";
|
|
174
|
+
import "./chunk-AGATODLO.js";
|
|
171
175
|
import {
|
|
172
176
|
latestVersion,
|
|
173
177
|
runUpdate,
|
|
174
178
|
updateNotice
|
|
175
|
-
} from "./chunk-
|
|
176
|
-
import "./chunk-
|
|
179
|
+
} from "./chunk-UDP7EQNY.js";
|
|
180
|
+
import "./chunk-BFESDJPU.js";
|
|
177
181
|
import {
|
|
178
182
|
queryTerms,
|
|
179
183
|
termField,
|
|
180
184
|
typedQuery,
|
|
181
185
|
unfilteredQuery,
|
|
182
186
|
withQuery
|
|
183
|
-
} from "./chunk-
|
|
184
|
-
import "./chunk-
|
|
187
|
+
} from "./chunk-DZG5SAO6.js";
|
|
188
|
+
import "./chunk-2WAGRBQT.js";
|
|
185
189
|
import {
|
|
186
190
|
modelGateway
|
|
187
|
-
} from "./chunk-
|
|
188
|
-
import "./chunk-
|
|
189
|
-
import "./chunk-
|
|
190
|
-
import "./chunk-
|
|
191
|
-
import "./chunk-
|
|
192
|
-
import "./chunk-
|
|
193
|
-
import "./chunk-
|
|
194
|
-
import "./chunk-
|
|
191
|
+
} from "./chunk-IKW3PRNG.js";
|
|
192
|
+
import "./chunk-EBGI3Z6U.js";
|
|
193
|
+
import "./chunk-DAYHLKTM.js";
|
|
194
|
+
import "./chunk-6AVHD6WB.js";
|
|
195
|
+
import "./chunk-VQ7K2EAW.js";
|
|
196
|
+
import "./chunk-6WZLP4CI.js";
|
|
197
|
+
import "./chunk-NA4HEM4Z.js";
|
|
198
|
+
import "./chunk-VM3IERRK.js";
|
|
195
199
|
import "./chunk-HTQTIKWP.js";
|
|
196
|
-
import "./chunk-
|
|
197
|
-
import "./chunk-
|
|
198
|
-
import "./chunk-
|
|
199
|
-
import "./chunk-
|
|
200
|
+
import "./chunk-PMYTDTT4.js";
|
|
201
|
+
import "./chunk-77SAHCDZ.js";
|
|
202
|
+
import "./chunk-CMB6URN7.js";
|
|
203
|
+
import "./chunk-4ZP3IK5I.js";
|
|
200
204
|
import {
|
|
201
205
|
applyDocumentTransfer,
|
|
202
206
|
previewDocumentTransfer
|
|
203
|
-
} from "./chunk-
|
|
204
|
-
import "./chunk-
|
|
207
|
+
} from "./chunk-WJ7E6TPR.js";
|
|
208
|
+
import "./chunk-R2GLRHNK.js";
|
|
205
209
|
import "./chunk-NTZWY5R3.js";
|
|
206
|
-
import "./chunk-
|
|
207
|
-
import "./chunk-
|
|
208
|
-
import "./chunk-
|
|
209
|
-
import "./chunk-
|
|
210
|
-
import "./chunk-
|
|
210
|
+
import "./chunk-6V5556NF.js";
|
|
211
|
+
import "./chunk-4LLO4USI.js";
|
|
212
|
+
import "./chunk-PSWVHX53.js";
|
|
213
|
+
import "./chunk-2G24DYSZ.js";
|
|
214
|
+
import "./chunk-KV232TIK.js";
|
|
211
215
|
import {
|
|
212
216
|
CEILING_KEY,
|
|
213
217
|
FETCH,
|
|
@@ -243,79 +247,79 @@ import {
|
|
|
243
247
|
settingRows,
|
|
244
248
|
sharedContracts,
|
|
245
249
|
snakeKeys
|
|
246
|
-
} from "./chunk-
|
|
247
|
-
import "./chunk-
|
|
250
|
+
} from "./chunk-WUVNBZWC.js";
|
|
251
|
+
import "./chunk-I3DZHZHM.js";
|
|
248
252
|
import {
|
|
249
253
|
setupPermissionCeiling
|
|
250
|
-
} from "./chunk-
|
|
251
|
-
import "./chunk-
|
|
254
|
+
} from "./chunk-RHS3OBO5.js";
|
|
255
|
+
import "./chunk-HGXFOXSA.js";
|
|
252
256
|
import {
|
|
253
257
|
guardedWrite
|
|
254
|
-
} from "./chunk-
|
|
258
|
+
} from "./chunk-KERX3BQL.js";
|
|
255
259
|
import {
|
|
256
260
|
modelTarget
|
|
257
|
-
} from "./chunk-
|
|
261
|
+
} from "./chunk-CY2MNN3I.js";
|
|
258
262
|
import {
|
|
259
263
|
readOnlyLockOf,
|
|
260
264
|
readOnlyRefusal
|
|
261
|
-
} from "./chunk-
|
|
262
|
-
import "./chunk-
|
|
265
|
+
} from "./chunk-OCZWU2H4.js";
|
|
266
|
+
import "./chunk-ZQMURHTL.js";
|
|
263
267
|
import {
|
|
264
268
|
hostFetch
|
|
265
|
-
} from "./chunk-
|
|
266
|
-
import "./chunk-
|
|
267
|
-
import "./chunk-
|
|
268
|
-
import "./chunk-
|
|
269
|
-
import "./chunk-
|
|
269
|
+
} from "./chunk-FRQBKAPV.js";
|
|
270
|
+
import "./chunk-I3MLLVPE.js";
|
|
271
|
+
import "./chunk-5SQHQRNO.js";
|
|
272
|
+
import "./chunk-6HZKX65K.js";
|
|
273
|
+
import "./chunk-WB46DJSK.js";
|
|
270
274
|
import {
|
|
271
275
|
openStore
|
|
272
|
-
} from "./chunk-
|
|
273
|
-
import "./chunk-
|
|
274
|
-
import "./chunk-
|
|
275
|
-
import "./chunk-
|
|
276
|
-
import "./chunk-
|
|
277
|
-
import "./chunk-
|
|
278
|
-
import "./chunk-
|
|
279
|
-
import "./chunk-
|
|
280
|
-
import "./chunk-
|
|
281
|
-
import "./chunk-
|
|
276
|
+
} from "./chunk-UZAOKKGK.js";
|
|
277
|
+
import "./chunk-6TGZCOYR.js";
|
|
278
|
+
import "./chunk-P2FOF6RR.js";
|
|
279
|
+
import "./chunk-JA37PJL4.js";
|
|
280
|
+
import "./chunk-TAQUEQ5B.js";
|
|
281
|
+
import "./chunk-LGRZNEMA.js";
|
|
282
|
+
import "./chunk-BAG4KIN5.js";
|
|
283
|
+
import "./chunk-M3VJTLFM.js";
|
|
284
|
+
import "./chunk-R6K36FZ7.js";
|
|
285
|
+
import "./chunk-RNLLWYPV.js";
|
|
282
286
|
import {
|
|
283
287
|
inRun
|
|
284
|
-
} from "./chunk-
|
|
285
|
-
import "./chunk-
|
|
286
|
-
import "./chunk-
|
|
287
|
-
import "./chunk-
|
|
288
|
+
} from "./chunk-2NAMKBBV.js";
|
|
289
|
+
import "./chunk-FITKBN46.js";
|
|
290
|
+
import "./chunk-VZTDELYM.js";
|
|
291
|
+
import "./chunk-GW7L2G4I.js";
|
|
288
292
|
import {
|
|
289
293
|
timezoneOf,
|
|
290
294
|
zonedMoment
|
|
291
|
-
} from "./chunk-
|
|
292
|
-
import "./chunk-
|
|
293
|
-
import "./chunk-
|
|
295
|
+
} from "./chunk-PQSCABAC.js";
|
|
296
|
+
import "./chunk-KXETGAU4.js";
|
|
297
|
+
import "./chunk-TPIGO4JJ.js";
|
|
294
298
|
import "./chunk-D72URWJE.js";
|
|
295
299
|
import {
|
|
296
300
|
installerOf
|
|
297
|
-
} from "./chunk-
|
|
301
|
+
} from "./chunk-K34B37AP.js";
|
|
298
302
|
import {
|
|
299
303
|
DRIVE_APP,
|
|
300
304
|
PACKAGE,
|
|
301
305
|
VERSION
|
|
302
|
-
} from "./chunk-
|
|
306
|
+
} from "./chunk-4KOMZRN6.js";
|
|
303
307
|
import {
|
|
304
308
|
REASONS
|
|
305
|
-
} from "./chunk-
|
|
306
|
-
import "./chunk-
|
|
307
|
-
import "./chunk-
|
|
309
|
+
} from "./chunk-5CYWWYIG.js";
|
|
310
|
+
import "./chunk-VHPNTMJJ.js";
|
|
311
|
+
import "./chunk-JWNM6FCC.js";
|
|
308
312
|
import {
|
|
309
313
|
storePath
|
|
310
|
-
} from "./chunk-
|
|
314
|
+
} from "./chunk-F5XMZDR5.js";
|
|
311
315
|
import {
|
|
312
316
|
processStreams,
|
|
313
317
|
saveConfigFile,
|
|
314
318
|
writeSecurely
|
|
315
|
-
} from "./chunk-
|
|
316
|
-
import "./chunk-
|
|
317
|
-
import "./chunk-
|
|
318
|
-
import "./chunk-
|
|
319
|
+
} from "./chunk-RX6D64YA.js";
|
|
320
|
+
import "./chunk-SNY4WYPH.js";
|
|
321
|
+
import "./chunk-2MCMUZCE.js";
|
|
322
|
+
import "./chunk-SRRNRQSQ.js";
|
|
319
323
|
import {
|
|
320
324
|
array,
|
|
321
325
|
boolean,
|
|
@@ -338,11 +342,11 @@ import {
|
|
|
338
342
|
string,
|
|
339
343
|
unknown,
|
|
340
344
|
writes
|
|
341
|
-
} from "./chunk-
|
|
345
|
+
} from "./chunk-QZXFWDTX.js";
|
|
342
346
|
import {
|
|
343
347
|
CliError,
|
|
344
348
|
isCliError
|
|
345
|
-
} from "./chunk-
|
|
349
|
+
} from "./chunk-B6YBN6VK.js";
|
|
346
350
|
import "./chunk-Y5E2WNWB.js";
|
|
347
351
|
import {
|
|
348
352
|
__commonJS,
|
|
@@ -861,8 +865,8 @@ var require_graceful_fs = __commonJS({
|
|
|
861
865
|
function patch(fs2) {
|
|
862
866
|
polyfills(fs2);
|
|
863
867
|
fs2.gracefulify = patch;
|
|
864
|
-
fs2.createReadStream =
|
|
865
|
-
fs2.createWriteStream =
|
|
868
|
+
fs2.createReadStream = createReadStream3;
|
|
869
|
+
fs2.createWriteStream = createWriteStream3;
|
|
866
870
|
var fs$readFile = fs2.readFile;
|
|
867
871
|
fs2.readFile = readFile;
|
|
868
872
|
function readFile(path, options, cb) {
|
|
@@ -1085,14 +1089,14 @@ var require_graceful_fs = __commonJS({
|
|
|
1085
1089
|
});
|
|
1086
1090
|
}
|
|
1087
1091
|
__name(WriteStream$open, "WriteStream$open");
|
|
1088
|
-
function
|
|
1092
|
+
function createReadStream3(path, options) {
|
|
1089
1093
|
return new fs2.ReadStream(path, options);
|
|
1090
1094
|
}
|
|
1091
|
-
__name(
|
|
1092
|
-
function
|
|
1095
|
+
__name(createReadStream3, "createReadStream");
|
|
1096
|
+
function createWriteStream3(path, options) {
|
|
1093
1097
|
return new fs2.WriteStream(path, options);
|
|
1094
1098
|
}
|
|
1095
|
-
__name(
|
|
1099
|
+
__name(createWriteStream3, "createWriteStream");
|
|
1096
1100
|
var fs$open = fs2.open;
|
|
1097
1101
|
fs2.open = open2;
|
|
1098
1102
|
function open2(path, flags, mode, cb) {
|
|
@@ -2187,7 +2191,7 @@ var profileLocked2 = /* @__PURE__ */ __name((env, name) => import_proper_lockfil
|
|
|
2187
2191
|
var removal = {
|
|
2188
2192
|
signOut: /* @__PURE__ */ __name(async (profile, { env, keyring, mayRevoke }) => {
|
|
2189
2193
|
const storage = readConfig(env).profiles[profile]?.storage ?? "keyring";
|
|
2190
|
-
const { sessionKeeper } = await import("./tokens-
|
|
2194
|
+
const { sessionKeeper } = await import("./tokens-AIKNGAOI.js");
|
|
2191
2195
|
const { revoked } = await sessionKeeper({
|
|
2192
2196
|
env,
|
|
2193
2197
|
name: profile,
|
|
@@ -2565,7 +2569,7 @@ var installModelCommands = /* @__PURE__ */ __name((program, { env, output, strea
|
|
|
2565
2569
|
const download = /* @__PURE__ */ __name(async (kind, id, acceptTerms) => {
|
|
2566
2570
|
if (policyFlags().offline)
|
|
2567
2571
|
throw offlineRefused("downloading a model needs the network");
|
|
2568
|
-
const { downloadImageModel, downloadTextModel } = await import("./services-
|
|
2572
|
+
const { downloadImageModel, downloadTextModel } = await import("./services-4Y7R425J.js");
|
|
2569
2573
|
const progress = /* @__PURE__ */ __name((line) => {
|
|
2570
2574
|
if (!program.opts().quiet)
|
|
2571
2575
|
streams.diagnostic(line);
|
|
@@ -3864,6 +3868,9 @@ var installMirrorCommands = /* @__PURE__ */ __name((program, context, { call })
|
|
|
3864
3868
|
});
|
|
3865
3869
|
}, "installMirrorCommands");
|
|
3866
3870
|
|
|
3871
|
+
// dist/commands/remote.js
|
|
3872
|
+
import { createHash as createHash4 } from "node:crypto";
|
|
3873
|
+
|
|
3867
3874
|
// dist/age.js
|
|
3868
3875
|
var SYNC = defineSteps([
|
|
3869
3876
|
{ id: "sync.run", command: "sync", args: [], why: "copy the changes Google has made into the local store" }
|
|
@@ -3947,6 +3954,113 @@ var saveDownload = /* @__PURE__ */ __name(async (path, overwrite, read, createDi
|
|
|
3947
3954
|
return size2;
|
|
3948
3955
|
}, "saveDownload");
|
|
3949
3956
|
|
|
3957
|
+
// dist/drive-files.js
|
|
3958
|
+
import { createHash as createHash3 } from "node:crypto";
|
|
3959
|
+
import { createReadStream, createWriteStream as createWriteStream2 } from "node:fs";
|
|
3960
|
+
import { Readable } from "node:stream";
|
|
3961
|
+
import { pipeline as pipeline2 } from "node:stream/promises";
|
|
3962
|
+
var FIELDS = "id,name,mimeType,trashed,size,sha256Checksum,md5Checksum,modifiedTime";
|
|
3963
|
+
var NATIVE = "application/vnd.google-apps.";
|
|
3964
|
+
var EXTRACTED = /\.(pdf|docx|xlsx)$/iu;
|
|
3965
|
+
var EXTRACTED_MIME = /* @__PURE__ */ new Set([
|
|
3966
|
+
"application/pdf",
|
|
3967
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
3968
|
+
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
3969
|
+
]);
|
|
3970
|
+
var sha256Of = /* @__PURE__ */ __name((path) => new Promise((done2, fail) => {
|
|
3971
|
+
const hash = createHash3("sha256");
|
|
3972
|
+
createReadStream(path).on("data", (chunk) => hash.update(chunk)).on("error", fail).on("end", () => done2(hash.digest("hex")));
|
|
3973
|
+
}), "sha256Of");
|
|
3974
|
+
var unsupported = /* @__PURE__ */ __name((what) => () => {
|
|
3975
|
+
throw new Error(`drive's file edits do not ${what}`);
|
|
3976
|
+
}, "unsupported");
|
|
3977
|
+
var driveFileTarget = /* @__PURE__ */ __name((port) => {
|
|
3978
|
+
const meta = /* @__PURE__ */ __name(async (id) => {
|
|
3979
|
+
try {
|
|
3980
|
+
return await port.call("drive.files.get", { fileId: id, fields: FIELDS, supportsAllDrives: true });
|
|
3981
|
+
} catch (error) {
|
|
3982
|
+
if (isCliError(error) && error.code === "not_found")
|
|
3983
|
+
return void 0;
|
|
3984
|
+
throw error;
|
|
3985
|
+
}
|
|
3986
|
+
}, "meta");
|
|
3987
|
+
const editable = /* @__PURE__ */ __name((id, file) => {
|
|
3988
|
+
const mime = file.mimeType ?? "";
|
|
3989
|
+
if (mime === FOLDER)
|
|
3990
|
+
throw new CliError("validation_error", `${id} is a folder; give the id of a file`, { reason: "file.not-a-file" });
|
|
3991
|
+
if (mime.startsWith(NATIVE))
|
|
3992
|
+
throw new CliError("validation_error", `${id} is a Google ${mime.slice(NATIVE.length)} file, which has no stored content to edit. Change a Google Doc with ${port.prefix} documents update and a Google Sheet with ${port.prefix} sheets update`, { reason: "file.native-google" });
|
|
3993
|
+
if (port.plainText && (EXTRACTED_MIME.has(mime) || EXTRACTED.test(file.name ?? "")))
|
|
3994
|
+
throw new CliError("validation_error", `${id} is not a plain-text file; change a .docx with files documents update and a .xlsx with files sheets update`, { reason: "file.not-plain-text" });
|
|
3995
|
+
return file;
|
|
3996
|
+
}, "editable");
|
|
3997
|
+
const there = /* @__PURE__ */ __name(async (id) => {
|
|
3998
|
+
const file = await meta(id);
|
|
3999
|
+
return file && !file.trashed ? editable(id, file) : void 0;
|
|
4000
|
+
}, "there");
|
|
4001
|
+
const holds = /* @__PURE__ */ __name(async (id, file, sha256) => {
|
|
4002
|
+
if (file.sha256Checksum === sha256)
|
|
4003
|
+
return true;
|
|
4004
|
+
const source = await port.download(id);
|
|
4005
|
+
const hash = createHash3("sha256");
|
|
4006
|
+
if (source instanceof Uint8Array)
|
|
4007
|
+
hash.update(source);
|
|
4008
|
+
else
|
|
4009
|
+
for await (const chunk of source)
|
|
4010
|
+
hash.update(chunk);
|
|
4011
|
+
return hash.digest("hex") === sha256;
|
|
4012
|
+
}, "holds");
|
|
4013
|
+
const changed = /* @__PURE__ */ __name((id) => new CliError("conflict", `${id} is not the file that was read`, { reason: "mirror.remote-changed" }), "changed");
|
|
4014
|
+
return {
|
|
4015
|
+
identity: port.identity,
|
|
4016
|
+
exists: /* @__PURE__ */ __name(async (id) => await there(id) !== void 0, "exists"),
|
|
4017
|
+
download: /* @__PURE__ */ __name(async (id, into) => {
|
|
4018
|
+
const file = await meta(id);
|
|
4019
|
+
if (!file || file.trashed)
|
|
4020
|
+
throw new CliError("not_found", `no file ${id} in Google Drive`, { reason: "file.not-found" });
|
|
4021
|
+
editable(id, file);
|
|
4022
|
+
const source = await port.download(id);
|
|
4023
|
+
await pipeline2(source instanceof Uint8Array ? Readable.from([source]) : source, createWriteStream2(into, { flags: "wx", mode: 384 }));
|
|
4024
|
+
}, "download"),
|
|
4025
|
+
upload: /* @__PURE__ */ __name(async (id, from, expect) => {
|
|
4026
|
+
if ("absent" in expect)
|
|
4027
|
+
throw new CliError("not_found", `no file ${id} in Google Drive to write; Google Drive names a file by its id, so a new file goes there with ${port.prefix} files upload`, { reason: "file.not-found" });
|
|
4028
|
+
const file = await there(id);
|
|
4029
|
+
if (!file || !await holds(id, file, expect.sha256))
|
|
4030
|
+
throw changed(id);
|
|
4031
|
+
const done2 = await port.replace(id, from, file.mimeType);
|
|
4032
|
+
return {
|
|
4033
|
+
path: id,
|
|
4034
|
+
id: done2.id,
|
|
4035
|
+
size: done2.size,
|
|
4036
|
+
sha256: await sha256Of(from),
|
|
4037
|
+
md5: done2.md5,
|
|
4038
|
+
modifiedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
4039
|
+
};
|
|
4040
|
+
}, "upload"),
|
|
4041
|
+
list: unsupported("list folders"),
|
|
4042
|
+
trash: unsupported("trash files"),
|
|
4043
|
+
ensureFolder: unsupported("create folders")
|
|
4044
|
+
};
|
|
4045
|
+
}, "driveFileTarget");
|
|
4046
|
+
var bytesOf = /* @__PURE__ */ __name(async (source, max) => {
|
|
4047
|
+
if (source instanceof Uint8Array)
|
|
4048
|
+
return source;
|
|
4049
|
+
const chunks = [];
|
|
4050
|
+
let size2 = 0;
|
|
4051
|
+
for await (const chunk of source) {
|
|
4052
|
+
size2 += chunk.length;
|
|
4053
|
+
if (size2 > max) {
|
|
4054
|
+
source.destroy();
|
|
4055
|
+
throw new CliError("validation_error", `the file is larger than ${max} bytes; save it with --output`, {
|
|
4056
|
+
reason: "file.too-large"
|
|
4057
|
+
});
|
|
4058
|
+
}
|
|
4059
|
+
chunks.push(chunk);
|
|
4060
|
+
}
|
|
4061
|
+
return Buffer.concat(chunks);
|
|
4062
|
+
}, "bytesOf");
|
|
4063
|
+
|
|
3950
4064
|
// dist/output.js
|
|
3951
4065
|
var VERBATIM = /* @__PURE__ */ new Set([
|
|
3952
4066
|
"frontMatter",
|
|
@@ -21212,6 +21326,33 @@ var localTimes = /* @__PURE__ */ __name((value, zone) => {
|
|
|
21212
21326
|
return { value: result, changed };
|
|
21213
21327
|
}, "localTimes");
|
|
21214
21328
|
|
|
21329
|
+
// dist/commands/file-edit.js
|
|
21330
|
+
var plainText = /* @__PURE__ */ __name((command) => command.name() === "update" && command.parent?.name() === "files", "plainText");
|
|
21331
|
+
var installFileEditCommands = /* @__PURE__ */ __name((files, edits, output, untrash) => {
|
|
21332
|
+
addFileEditCommands(files, {
|
|
21333
|
+
words: DRIVE_WORDS,
|
|
21334
|
+
output: /* @__PURE__ */ __name((body) => output(body), "output"),
|
|
21335
|
+
path: fileId,
|
|
21336
|
+
reread: /* @__PURE__ */ __name((input) => `${edits.prefix()} files download ${input} --json`, "reread"),
|
|
21337
|
+
stdin: /* @__PURE__ */ __name(() => edits.stdin(), "stdin"),
|
|
21338
|
+
write: /* @__PURE__ */ __name(async (extra, act, command) => {
|
|
21339
|
+
await edits.check(extra);
|
|
21340
|
+
return act(edits.port(plainText(command)));
|
|
21341
|
+
}, "write"),
|
|
21342
|
+
read: /* @__PURE__ */ __name((act) => act(edits.port(false)), "read"),
|
|
21343
|
+
restoreFromTrash: /* @__PURE__ */ __name((input) => untrash(fileId(input)), "restoreFromTrash"),
|
|
21344
|
+
deleteKey: DELETE_KEY
|
|
21345
|
+
});
|
|
21346
|
+
for (const command of files.commands.flatMap((one) => [one, ...one.commands]))
|
|
21347
|
+
if (hasSharedContract(command) && metaOf(command).examples?.length)
|
|
21348
|
+
overrideSharedContract(command, "Google Drive names a file by its id, not a path, and files update writes only over a file already there.", (one) => {
|
|
21349
|
+
const lines = (metaOf(one).examples ?? []).filter((line) => !line.endsWith('update /notes.md --text "# Notes"')).map((line) => line.replace(/\/(notes\.md|budget\.xlsx|report\.docx)/u, "FILE_ID"));
|
|
21350
|
+
annotate(one, { examples: lines });
|
|
21351
|
+
if (one.name() === "update" && one.parent === files)
|
|
21352
|
+
one.summary(one.summary().replace(", or create a text file", "")).description(one.description().replace(", or create a text file", ""));
|
|
21353
|
+
});
|
|
21354
|
+
}, "installFileEditCommands");
|
|
21355
|
+
|
|
21215
21356
|
// dist/sheets-input.js
|
|
21216
21357
|
var cellRectangle = /* @__PURE__ */ __name((range2) => {
|
|
21217
21358
|
const match = /^([A-Za-z]{1,3})([1-9]\d*)(?::([A-Za-z]{1,3})([1-9]\d*))?$/.exec(range2);
|
|
@@ -21381,6 +21522,8 @@ var installSheetsCommands = /* @__PURE__ */ __name((program, { call, output }) =
|
|
|
21381
21522
|
}, "installSheetsCommands");
|
|
21382
21523
|
|
|
21383
21524
|
// dist/commands/remote.js
|
|
21525
|
+
var TEXT_LIMIT = 2e5;
|
|
21526
|
+
var MAX_TEXT_BYTES = 64 * 1024 * 1024;
|
|
21384
21527
|
var API_METHOD_QUERY = {
|
|
21385
21528
|
entity: "api_method",
|
|
21386
21529
|
backend: "native",
|
|
@@ -21436,18 +21579,48 @@ var installRemoteCommands = /* @__PURE__ */ __name((program, helpers) => {
|
|
|
21436
21579
|
installSheetsCommands(program, helpers);
|
|
21437
21580
|
const files = annotate(program.command("files"), { effects: GOOGLE_READ }).description("read and change files in Google Drive; nothing is imported");
|
|
21438
21581
|
for (const exporting of [false, true]) {
|
|
21439
|
-
const command = examples(annotate(files.command(exporting ? "export" : "download"), { effects: FETCH }).argument("<file>", fileArgument).
|
|
21440
|
-
|
|
21441
|
-
|
|
21582
|
+
const command = examples(annotate(files.command(exporting ? "export" : "download"), { effects: FETCH }).argument("<file>", fileArgument).summary(exporting ? "export a Google document to a local file" : "download a stored file, or answer its text").description(exporting ? "export a Google document to a local file" : `download a stored file to a local file, or answer its text and sha256 without --output. A text longer than ${TEXT_LIMIT.toLocaleString("en")} characters is cut there with truncated: true and no sha256: never write a cut text back over the file, it would lose the rest`), exporting ? ["drive personal files export DOC_ID --format pdf --output document.pdf"] : [
|
|
21583
|
+
"drive personal files download FILE_ID --output download.bin",
|
|
21584
|
+
"drive personal files download FILE_ID --json"
|
|
21585
|
+
]);
|
|
21442
21586
|
if (exporting)
|
|
21443
|
-
command.addOption(new Option("--format <format>", "format Google should export").choices(Object.keys(EXPORT_FORMATS)).makeOptionMandatory());
|
|
21587
|
+
command.requiredOption("--output <file>", "local file to write").addOption(new Option("--format <format>", "format Google should export").choices(Object.keys(EXPORT_FORMATS)).makeOptionMandatory());
|
|
21588
|
+
else
|
|
21589
|
+
command.option("--output <file>", "local file to write, instead of answering the text");
|
|
21590
|
+
command.option("--overwrite", "replace an existing output file");
|
|
21444
21591
|
command.action(async (input, args) => {
|
|
21445
21592
|
const id = fileId(input);
|
|
21593
|
+
if (args.output === void 0)
|
|
21594
|
+
return output(itemOf(await textOf(id)));
|
|
21446
21595
|
const mime = args.format ? EXPORT_FORMATS[args.format] : void 0;
|
|
21447
21596
|
const bytes = await saveDownload(args.output, args.overwrite === true, () => helpers.download(id, mime), helpers.mcp === true);
|
|
21448
21597
|
output(itemOf({ id, bytes, ...args.format ? { format: args.format } : {} }));
|
|
21449
21598
|
});
|
|
21450
21599
|
}
|
|
21600
|
+
const textOf = /* @__PURE__ */ __name(async (id) => {
|
|
21601
|
+
const file = await call("drive.files.get", {
|
|
21602
|
+
fileId: id,
|
|
21603
|
+
fields: "id,name,mimeType,size",
|
|
21604
|
+
supportsAllDrives: true
|
|
21605
|
+
});
|
|
21606
|
+
const mime = file.mimeType ?? "application/octet-stream";
|
|
21607
|
+
if (mime.startsWith("application/vnd.google-apps."))
|
|
21608
|
+
throw new CliError("validation_error", `${id} is a Google ${mime.slice("application/vnd.google-apps.".length)} file with no stored content; read a Google Doc with documents get, or save any native file with files export`, { reason: "file.native-google" });
|
|
21609
|
+
const bytes = await bytesOf(await helpers.download(id), MAX_TEXT_BYTES);
|
|
21610
|
+
const name = file.name ?? id;
|
|
21611
|
+
const text = await fileText(bytes, { name, mime }, "drive");
|
|
21612
|
+
const truncated = text.length > TEXT_LIMIT;
|
|
21613
|
+
const whole = !truncated && Buffer.from(bytes).toString("utf8") === text;
|
|
21614
|
+
return {
|
|
21615
|
+
id,
|
|
21616
|
+
name,
|
|
21617
|
+
mime_type: mime,
|
|
21618
|
+
size: bytes.byteLength,
|
|
21619
|
+
sha256: whole ? createHash4("sha256").update(bytes).digest("hex") : null,
|
|
21620
|
+
text: text.slice(0, TEXT_LIMIT),
|
|
21621
|
+
truncated
|
|
21622
|
+
};
|
|
21623
|
+
}, "textOf");
|
|
21451
21624
|
bindQuery(page(examples(annotate(files.command("list"), { effects: GOOGLE_READ }).description("list files in Google Drive, one page at a time"), ["drive personal files list --parent FOLDER_ID", `drive personal files list 'name:"Example plan"' --limit 20`])), FILES_QUERY, fileRow).option("--parent <id>", "only the files directly inside this folder id").option("--timezone <zone>", "zone for query dates without an offset").action(async (words, args) => {
|
|
21452
21625
|
const { query, timezone } = driveFileQuery(words, args.timezone);
|
|
21453
21626
|
const typed2 = typedQuery(words);
|
|
@@ -21472,9 +21645,8 @@ var installRemoteCommands = /* @__PURE__ */ __name((program, helpers) => {
|
|
|
21472
21645
|
...args.oldParent ? { removeParents: fileId(args.oldParent) } : {},
|
|
21473
21646
|
supportsAllDrives: true
|
|
21474
21647
|
}, {}))));
|
|
21475
|
-
|
|
21476
|
-
|
|
21477
|
-
examples(annotate(files.command(name), { effects: GOOGLE_WRITE }).description(name === "trash" ? "move a file to the Google Drive trash" : "take a file out of the trash").argument("<file>", fileArgument), [`drive personal files ${name} FILE_ID`]).action(async (id) => output(itemOf(await call("drive.files.update", { fileId: fileId(id), supportsAllDrives: true }, { trashed: name === "trash" }))));
|
|
21648
|
+
const trashed = /* @__PURE__ */ __name((id, trashed2) => call("drive.files.update", { fileId: id, supportsAllDrives: true }, { trashed: trashed2 }), "trashed");
|
|
21649
|
+
examples(annotate(files.command("trash"), { effects: GOOGLE_WRITE }).description("move a file to the Google Drive trash").argument("<file>", fileArgument), ["drive personal files trash FILE_ID"]).action(async (id) => output(itemOf(await trashed(fileId(id), true))));
|
|
21478
21650
|
examples(annotate(files.command("mkdir"), { effects: GOOGLE_WRITE }).description("create an empty folder in Google Drive").argument("<name>", "folder name"), ["drive personal files mkdir Reports --parent FOLDER_ID"]).option("--parent <id>", "folder id to create it in; My Drive when omitted").action(async (name, args) => output(itemOf(await call("drive.files.create", { supportsAllDrives: true }, {
|
|
21479
21651
|
name,
|
|
21480
21652
|
mimeType: "application/vnd.google-apps.folder",
|
|
@@ -21484,6 +21656,7 @@ var installRemoteCommands = /* @__PURE__ */ __name((program, helpers) => {
|
|
|
21484
21656
|
...args.name ? { name: args.name } : {},
|
|
21485
21657
|
...args.parent ? { parent: fileId(args.parent) } : {}
|
|
21486
21658
|
}))));
|
|
21659
|
+
installFileEditCommands(files, helpers.edits, output, (id) => trashed(id, false));
|
|
21487
21660
|
const documents = program.commands.find((command) => command.name() === "documents");
|
|
21488
21661
|
const documentArgument = "document id or Google Docs URL";
|
|
21489
21662
|
examples(annotate(documents.command("get"), { effects: GOOGLE_READ }).argument("<document>", documentArgument).description("read a document live from Google Docs, as JSON with every tab"), ["drive personal documents get DOC_ID --json"]).action(async (id) => output(itemOf(await call("docs.documents.get", { documentId: fileId(id), includeTabsContent: true }))));
|
|
@@ -21601,7 +21774,7 @@ var installSessionCommands = /* @__PURE__ */ __name((program, context) => {
|
|
|
21601
21774
|
const app = application(env, { file: args.clientFile, clientId: args.clientId, profile: selected() });
|
|
21602
21775
|
if (!app.clientSecret)
|
|
21603
21776
|
streams.diagnostic("your Google app has no secret here, and Google refuses a Desktop app without one: set DRIVE_GOOGLE_CLIENT_SECRET\n");
|
|
21604
|
-
const { login } = await import("./login-
|
|
21777
|
+
const { login } = await import("./login-LXXYFMD3.js");
|
|
21605
21778
|
output(itemOf(await login({
|
|
21606
21779
|
env,
|
|
21607
21780
|
profile: selected(),
|
|
@@ -21632,7 +21805,7 @@ var installSessionCommands = /* @__PURE__ */ __name((program, context) => {
|
|
|
21632
21805
|
const name = selected();
|
|
21633
21806
|
const config = readConfig(env);
|
|
21634
21807
|
const profile = activeProfile(env, name);
|
|
21635
|
-
const { credentials } = await import("./tokens-
|
|
21808
|
+
const { credentials } = await import("./tokens-AIKNGAOI.js");
|
|
21636
21809
|
const store = credentials(env, profile.storage, options.keyring);
|
|
21637
21810
|
store.remove(name);
|
|
21638
21811
|
writeConfig(env, config);
|
|
@@ -21679,7 +21852,7 @@ var selection = /* @__PURE__ */ __name((env, name, source) => {
|
|
|
21679
21852
|
return { profile, state, options: { source, destination, collection: `google-drive:${profile.principal}`, env } };
|
|
21680
21853
|
}, "selection");
|
|
21681
21854
|
var checkStoreImport = /* @__PURE__ */ __name(async (env, name, source, bindings) => {
|
|
21682
|
-
const { ensureSqlite } = await import("./sqlite-runtime-
|
|
21855
|
+
const { ensureSqlite } = await import("./sqlite-runtime-CVYBPVKO.js");
|
|
21683
21856
|
await ensureSqlite();
|
|
21684
21857
|
const { state, options } = selection(env, name, source);
|
|
21685
21858
|
const preview = await previewDocumentTransfer({ ...options, bindings });
|
|
@@ -21892,7 +22065,7 @@ var installTranscriptCommands = /* @__PURE__ */ __name((program, context) => {
|
|
|
21892
22065
|
// dist/commands/upgrade.js
|
|
21893
22066
|
import { join as join8 } from "node:path";
|
|
21894
22067
|
|
|
21895
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
22068
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.735.0_@wirecat+cli-base@0.132.0_commander@15.0.0_esbuild@0.28.2_typ_7fb22530c6bf05ba7be1bbee4c3f13e5/node_modules/@wirecat/cli-core/dist/update/index.js
|
|
21896
22069
|
import { realpathSync } from "node:fs";
|
|
21897
22070
|
import { fileURLToPath } from "node:url";
|
|
21898
22071
|
var npmRegistry = /* @__PURE__ */ __name(() => hostFetch({ hosts: ["registry.npmjs.org"] }), "npmRegistry");
|
|
@@ -22321,7 +22494,7 @@ var openIndex = /* @__PURE__ */ __name(async (env, name, rescan = false) => {
|
|
|
22321
22494
|
activeProfile(env, name);
|
|
22322
22495
|
if (env.DRIVE_STORE)
|
|
22323
22496
|
throw new CliError("configuration_error", "DRIVE_STORE has been retired; use MESSAGING_STORE to select the shared database", { reason: "store.override-retired" });
|
|
22324
|
-
const { openAppStore } = await import("./cli-
|
|
22497
|
+
const { openAppStore } = await import("./cli-A7MMBLGR.js");
|
|
22325
22498
|
const store = await openAppStore(env, { app: { command: "drive", version: VERSION }, provider: DRIVE_PROVIDER });
|
|
22326
22499
|
const index = indexOver(store, env);
|
|
22327
22500
|
try {
|
|
@@ -22369,7 +22542,7 @@ var indexOver = /* @__PURE__ */ __name((store, env, pictureEmbedder) => {
|
|
|
22369
22542
|
linkMessages: /* @__PURE__ */ __name((documents, since) => store.notes.linkMessages({ documents, ...since ? { since } : {} }), "linkMessages"),
|
|
22370
22543
|
knowledge: documentKnowledge2(store, async (principal) => (await folder(principal, false))?.id),
|
|
22371
22544
|
openPictures: /* @__PURE__ */ __name(async () => {
|
|
22372
|
-
const { openPictureEmbedderFor, savePicture } = await import("./services-
|
|
22545
|
+
const { openPictureEmbedderFor, savePicture } = await import("./services-4Y7R425J.js");
|
|
22373
22546
|
const embedder = pictureEmbedder ?? await openPictureEmbedderFor({ env, command: "drive" });
|
|
22374
22547
|
return {
|
|
22375
22548
|
save: /* @__PURE__ */ __name((reference, bytes) => savePicture(store, { ref: reference }, bytes, { embedder }), "save"),
|
|
@@ -22388,7 +22561,7 @@ var indexOver = /* @__PURE__ */ __name((store, env, pictureEmbedder) => {
|
|
|
22388
22561
|
has_more: false,
|
|
22389
22562
|
meaning_skipped: "this Google account has no imported sources"
|
|
22390
22563
|
};
|
|
22391
|
-
const { searchNotes } = await import("./services-
|
|
22564
|
+
const { searchNotes } = await import("./services-4Y7R425J.js");
|
|
22392
22565
|
const result = await searchNotes(store, query, {
|
|
22393
22566
|
...options,
|
|
22394
22567
|
folderIds: selected ? [selected.id] : [],
|
|
@@ -22421,7 +22594,7 @@ var indexOver = /* @__PURE__ */ __name((store, env, pictureEmbedder) => {
|
|
|
22421
22594
|
};
|
|
22422
22595
|
}, "search"),
|
|
22423
22596
|
embed: /* @__PURE__ */ __name(async (max) => {
|
|
22424
|
-
const { embedNotes } = await import("./services-
|
|
22597
|
+
const { embedNotes } = await import("./services-4Y7R425J.js");
|
|
22425
22598
|
return embedNotes(store, { maxChunks: max, env, command: "drive" });
|
|
22426
22599
|
}, "embed"),
|
|
22427
22600
|
close: /* @__PURE__ */ __name(() => store.close(), "close")
|
|
@@ -22429,17 +22602,17 @@ var indexOver = /* @__PURE__ */ __name((store, env, pictureEmbedder) => {
|
|
|
22429
22602
|
}, "indexOver");
|
|
22430
22603
|
|
|
22431
22604
|
// dist/upload.js
|
|
22432
|
-
import { createHash as
|
|
22433
|
-
import { createReadStream, mkdirSync as mkdirSync3, readFileSync as readFileSync5, rmSync as rmSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
22605
|
+
import { createHash as createHash5 } from "node:crypto";
|
|
22606
|
+
import { createReadStream as createReadStream2, mkdirSync as mkdirSync3, readFileSync as readFileSync5, rmSync as rmSync2, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
|
|
22434
22607
|
import { open } from "node:fs/promises";
|
|
22435
22608
|
import { basename, join as join10, resolve as resolve5 } from "node:path";
|
|
22436
22609
|
var START = "https://www.googleapis.com/upload/drive/v3/files";
|
|
22437
|
-
var
|
|
22610
|
+
var FIELDS2 = "id,name,size,md5Checksum,mimeType,parents";
|
|
22438
22611
|
var QUANTUM = 256 * 1024;
|
|
22439
22612
|
var CHUNK_BYTES = 32 * QUANTUM;
|
|
22440
22613
|
var md5Of = /* @__PURE__ */ __name((path) => new Promise((done2, fail) => {
|
|
22441
|
-
const hash =
|
|
22442
|
-
|
|
22614
|
+
const hash = createHash5("md5");
|
|
22615
|
+
createReadStream2(path).on("data", (chunk) => hash.update(chunk)).on("error", fail).on("end", () => done2(hash.digest("hex")));
|
|
22443
22616
|
}), "md5Of");
|
|
22444
22617
|
var nextByte = /* @__PURE__ */ __name((response) => {
|
|
22445
22618
|
const range2 = /bytes=0-(\d+)/.exec(response.header("range") ?? "");
|
|
@@ -22458,11 +22631,12 @@ var uploadFile = /* @__PURE__ */ __name(async (input) => {
|
|
|
22458
22631
|
throw new CliError("validation_error", "upload takes one file, not a folder", { reason: "file.not-a-file" });
|
|
22459
22632
|
const size2 = stat.size;
|
|
22460
22633
|
const name = input.name ?? basename(path);
|
|
22634
|
+
const replacing = input.fileId;
|
|
22461
22635
|
const chunk = input.chunkBytes ?? CHUNK_BYTES;
|
|
22462
22636
|
if (chunk % QUANTUM !== 0)
|
|
22463
22637
|
throw new CliError("validation_error", "a chunk must be a multiple of 256 KiB");
|
|
22464
22638
|
const sleep = input.sleep ?? ((ms) => new Promise((wake) => setTimeout(wake, ms)));
|
|
22465
|
-
const key =
|
|
22639
|
+
const key = createHash5("sha256").update(JSON.stringify([path, size2, stat.mtimeMs, name, input.parent ?? "", ...replacing ? [replacing] : []])).digest("hex").slice(0, 24);
|
|
22466
22640
|
const checkpointPath = join10(input.stateDir, "uploads", `${key}.json`);
|
|
22467
22641
|
const readCheckpoint = /* @__PURE__ */ __name(() => {
|
|
22468
22642
|
try {
|
|
@@ -22484,10 +22658,10 @@ var uploadFile = /* @__PURE__ */ __name(async (input) => {
|
|
|
22484
22658
|
}, "saveCheckpoint");
|
|
22485
22659
|
const clearCheckpoint = /* @__PURE__ */ __name(() => rmSync2(checkpointPath, { force: true }), "clearCheckpoint");
|
|
22486
22660
|
const start = /* @__PURE__ */ __name(async () => {
|
|
22487
|
-
const metadata = JSON.stringify({ name, ...input.parent ? { parents: [input.parent] } : {} });
|
|
22661
|
+
const metadata = JSON.stringify(replacing ? {} : { name, ...input.parent ? { parents: [input.parent] } : {} });
|
|
22488
22662
|
const response = await input.request({
|
|
22489
|
-
url: `${START}?uploadType=resumable&supportsAllDrives=true&fields=${
|
|
22490
|
-
method: "POST",
|
|
22663
|
+
url: `${START}${replacing ? `/${replacing}` : ""}?uploadType=resumable&supportsAllDrives=true&fields=${FIELDS2}`,
|
|
22664
|
+
method: replacing ? "PATCH" : "POST",
|
|
22491
22665
|
headers: {
|
|
22492
22666
|
"Content-Type": "application/json; charset=UTF-8",
|
|
22493
22667
|
"X-Upload-Content-Type": input.mime ?? "application/octet-stream",
|
|
@@ -22707,7 +22881,7 @@ var installDrive = /* @__PURE__ */ __name((program) => {
|
|
|
22707
22881
|
}, "output");
|
|
22708
22882
|
const signal = /* @__PURE__ */ __name(() => environment().signal, "signal");
|
|
22709
22883
|
const signedIn = /* @__PURE__ */ __name(async (name, scope2) => {
|
|
22710
|
-
const { authorizedClient, checkAuthorization } = await import("./tokens-
|
|
22884
|
+
const { authorizedClient, checkAuthorization } = await import("./tokens-AIKNGAOI.js");
|
|
22711
22885
|
const client = authorizedClient(env, name, environment().keyring, signal());
|
|
22712
22886
|
await checkAuthorization(client, scope2);
|
|
22713
22887
|
return client;
|
|
@@ -22717,7 +22891,7 @@ var installDrive = /* @__PURE__ */ __name((program) => {
|
|
|
22717
22891
|
const fake = environment().source;
|
|
22718
22892
|
if (fake)
|
|
22719
22893
|
return fake(name);
|
|
22720
|
-
const [{ googleSource }, client] = await Promise.all([import("./google-
|
|
22894
|
+
const [{ googleSource }, client] = await Promise.all([import("./google-MEPVU4EP.js"), signedIn(name)]);
|
|
22721
22895
|
return googleSource(client);
|
|
22722
22896
|
}, "source");
|
|
22723
22897
|
const withIndex = /* @__PURE__ */ __name(async (fn, profile) => {
|
|
@@ -22867,7 +23041,7 @@ var installDrive = /* @__PURE__ */ __name((program) => {
|
|
|
22867
23041
|
if (fake)
|
|
22868
23042
|
return await fake.call(method, params, body);
|
|
22869
23043
|
const [{ googleApi }, client] = await Promise.all([
|
|
22870
|
-
import("./google-api-
|
|
23044
|
+
import("./google-api-SY25TRXJ.js"),
|
|
22871
23045
|
signedIn(selected(), descriptor.scope)
|
|
22872
23046
|
]);
|
|
22873
23047
|
return await googleApi(client).call(method, params, body);
|
|
@@ -22893,11 +23067,59 @@ var installDrive = /* @__PURE__ */ __name((program) => {
|
|
|
22893
23067
|
if (fake)
|
|
22894
23068
|
return fake(id, mime);
|
|
22895
23069
|
const [{ googleDownload }, client] = await Promise.all([
|
|
22896
|
-
import("./google-api-
|
|
23070
|
+
import("./google-api-SY25TRXJ.js"),
|
|
22897
23071
|
signedIn(selected(), apiMethod(method).scope)
|
|
22898
23072
|
]);
|
|
22899
23073
|
return googleDownload(client)(id, mime);
|
|
22900
23074
|
}, "download"),
|
|
23075
|
+
replace: /* @__PURE__ */ __name(async (id, from, mime) => {
|
|
23076
|
+
const method = "drive.files.update";
|
|
23077
|
+
const flags = policyFlags();
|
|
23078
|
+
for (const key of methodPolicyKeys(method))
|
|
23079
|
+
await checkPolicy(env, selected(), key, true, flags, askOnce);
|
|
23080
|
+
const act = /* @__PURE__ */ __name(async () => {
|
|
23081
|
+
let request = environment().uploadRequest;
|
|
23082
|
+
if (!request) {
|
|
23083
|
+
const [{ googleUploadRequest }, client] = await Promise.all([
|
|
23084
|
+
import("./google-api-SY25TRXJ.js"),
|
|
23085
|
+
signedIn(selected(), apiMethod(method).scope)
|
|
23086
|
+
]);
|
|
23087
|
+
request = googleUploadRequest(client);
|
|
23088
|
+
}
|
|
23089
|
+
return uploadFile({
|
|
23090
|
+
path: from,
|
|
23091
|
+
fileId: id,
|
|
23092
|
+
...mime ? { mime } : {},
|
|
23093
|
+
stateDir: profileDir(env, selected()),
|
|
23094
|
+
request
|
|
23095
|
+
});
|
|
23096
|
+
}, "act");
|
|
23097
|
+
return guardedGoogleWrite(env, selected(), `api.${method}`, act, flags, askOnce, newOperationId());
|
|
23098
|
+
}, "replace"),
|
|
23099
|
+
edits: {
|
|
23100
|
+
port: /* @__PURE__ */ __name((plainText2) => {
|
|
23101
|
+
const stop = signal();
|
|
23102
|
+
return {
|
|
23103
|
+
target: driveFileTarget({
|
|
23104
|
+
call: /* @__PURE__ */ __name((method, params, body) => remote.call(method, params, body), "call"),
|
|
23105
|
+
download: /* @__PURE__ */ __name((id) => remote.download(id), "download"),
|
|
23106
|
+
replace: /* @__PURE__ */ __name((id, from, mime) => remote.replace(id, from, mime), "replace"),
|
|
23107
|
+
identity: /* @__PURE__ */ __name(async () => activeProfile(env, selected()).principal ?? selected(), "identity"),
|
|
23108
|
+
prefix: `drive ${selected()}`,
|
|
23109
|
+
plainText: plainText2
|
|
23110
|
+
}),
|
|
23111
|
+
versions: fileVersions(join11(profileDir(env, selected()), "files.versions")),
|
|
23112
|
+
...stop ? { signal: stop } : {}
|
|
23113
|
+
};
|
|
23114
|
+
}, "port"),
|
|
23115
|
+
check: /* @__PURE__ */ __name(async (keys) => {
|
|
23116
|
+
const flags = policyFlags();
|
|
23117
|
+
for (const key of keys)
|
|
23118
|
+
await checkPolicy(env, selected(), key, true, flags, askOnce);
|
|
23119
|
+
}, "check"),
|
|
23120
|
+
prefix: /* @__PURE__ */ __name(() => `drive ${selected()}`, "prefix"),
|
|
23121
|
+
stdin: /* @__PURE__ */ __name(() => environment().stdin ?? process.stdin, "stdin")
|
|
23122
|
+
},
|
|
22901
23123
|
upload: /* @__PURE__ */ __name(async (path, args) => {
|
|
22902
23124
|
const method = "drive.files.create";
|
|
22903
23125
|
const flags = policyFlags();
|
|
@@ -22911,7 +23133,7 @@ var installDrive = /* @__PURE__ */ __name((program) => {
|
|
|
22911
23133
|
let request = environment().uploadRequest;
|
|
22912
23134
|
if (!request) {
|
|
22913
23135
|
const [{ googleUploadRequest }, client] = await Promise.all([
|
|
22914
|
-
import("./google-api-
|
|
23136
|
+
import("./google-api-SY25TRXJ.js"),
|
|
22915
23137
|
signedIn(selected(), apiMethod(method).scope)
|
|
22916
23138
|
]);
|
|
22917
23139
|
request = googleUploadRequest(client);
|
|
@@ -23022,7 +23244,7 @@ Availability: unavailable \u2014 ${availability.reason}
|
|
|
23022
23244
|
refuseUnderReadOnly(env, "change a setting");
|
|
23023
23245
|
return previewWrite();
|
|
23024
23246
|
}
|
|
23025
|
-
if (agent() && EXPORTS.has(words)) {
|
|
23247
|
+
if (agent() && EXPORTS.has(words) && !(words === "files download" && action.opts().output === void 0)) {
|
|
23026
23248
|
const name = action.opts().output;
|
|
23027
23249
|
if (typeof name !== "string" || !/^[A-Za-z0-9][A-Za-z0-9._-]{0,199}$/.test(name))
|
|
23028
23250
|
throw new CliError("validation_error", "MCP exports take a filename inside the profile export folder");
|
|
@@ -23124,7 +23346,7 @@ var mcpCommand = /* @__PURE__ */ __name(() => {
|
|
|
23124
23346
|
const environment = environmentOf(action);
|
|
23125
23347
|
if (environment.api)
|
|
23126
23348
|
return;
|
|
23127
|
-
const { grantAvailability } = await import("./grants-
|
|
23349
|
+
const { grantAvailability } = await import("./grants-77W5MSWQ.js");
|
|
23128
23350
|
availability = grantAvailability(rootOf(root), environment.env ?? process.env, environment.keyring);
|
|
23129
23351
|
});
|
|
23130
23352
|
}, "mcpCommand");
|