@wirecat/drive-cli 0.71.0 → 0.72.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +150 -71
- package/contracts/wirecat.json +77 -8
- package/dist/bin/drive.js +2 -2
- package/dist/bundle/agent-GOCD4ZW2.js +46 -0
- package/dist/bundle/{all-profiles-3QJG2NAN.js → all-profiles-PZVP3G73.js} +67 -25
- package/dist/bundle/{anthropic-PSWTEU6G.js → anthropic-PUOTKSYV.js} +9 -9
- package/dist/bundle/{app-server-PVTA6ABR.js → app-server-MKDCXRZM.js} +97 -79
- package/dist/bundle/{bun-LU5LP3JI.js → bun-NS5YLOQT.js} +2 -2
- package/dist/bundle/{bun-sqlite-PYMKLBRU.js → bun-sqlite-KSKWRLLO.js} +9 -9
- package/dist/bundle/{chunk-COOOO5B3.js → chunk-2CG3LUQS.js} +4 -4
- package/dist/bundle/{chunk-YVI5SQPY.js → chunk-2TVHFJKV.js} +1 -1
- package/dist/bundle/chunk-35FIJGTT.js +52 -0
- package/dist/bundle/chunk-35GROSBS.js +3233 -0
- package/dist/bundle/{chunk-D5TGYUVU.js → chunk-3CH7I452.js} +9 -60
- package/dist/bundle/{chunk-ICDCAQ6K.js → chunk-3QBRS3JT.js} +13 -9
- package/dist/bundle/chunk-3T7JIHSO.js +353 -0
- package/dist/bundle/{chunk-Q7DOMFJ4.js → chunk-3VIEGRBA.js} +6 -6
- package/dist/bundle/chunk-3YCUYFTD.js +2159 -0
- package/dist/bundle/{chunk-CJLVYIOP.js → chunk-3ZGWJYSG.js} +30 -21
- package/dist/bundle/{chunk-YPFWNVHV.js → chunk-43PCMVTZ.js} +2 -100
- package/dist/bundle/{chunk-OF422U5D.js → chunk-4DK55MLP.js} +402 -402
- package/dist/bundle/chunk-4HP6KGBI.js +32 -0
- package/dist/bundle/chunk-4P6D6CUS.js +282 -0
- package/dist/bundle/chunk-4ZAQMDLD.js +1308 -0
- package/dist/bundle/chunk-4ZTB7LS3.js +87 -0
- package/dist/bundle/{chunk-6W763DZN.js → chunk-54O5NJRC.js} +14 -13
- package/dist/bundle/{chunk-MNLL5YLM.js → chunk-5BHP4FVM.js} +2 -2
- package/dist/bundle/{chunk-ACUAV6VX.js → chunk-6JU4KLAZ.js} +108 -72
- package/dist/bundle/{chunk-YMJ6IDGT.js → chunk-6KND2DYT.js} +38 -8
- package/dist/bundle/{chunk-4HWJOU7N.js → chunk-7YPZPJTB.js} +1 -1
- package/dist/bundle/chunk-A5XNUMW7.js +108 -0
- package/dist/bundle/{chunk-X4TIMMKJ.js → chunk-AG34MPVN.js} +1 -1
- package/dist/bundle/chunk-B5V2U7IS.js +221 -0
- package/dist/bundle/chunk-B6JC5RS3.js +696 -0
- package/dist/bundle/chunk-BDZXGDGI.js +80 -0
- package/dist/bundle/{chunk-B5KSXHJ7.js → chunk-BMTMGMGE.js} +1 -1
- package/dist/bundle/{chunk-ZCR3IRZ2.js → chunk-CP2TZXAG.js} +16 -9
- package/dist/bundle/{chunk-TAUBRNC5.js → chunk-DOEP4EPW.js} +72 -59
- package/dist/bundle/chunk-DQSOYH6N.js +20 -0
- package/dist/bundle/{chunk-QETR5HIZ.js → chunk-E2TMWONO.js} +4385 -2684
- package/dist/bundle/chunk-E5EYJU5R.js +7 -0
- package/dist/bundle/chunk-ECYOTDJM.js +14 -0
- package/dist/bundle/{chunk-HL52XXZX.js → chunk-EXHTGQR2.js} +3 -4
- package/dist/bundle/chunk-F4BX7TH2.js +15 -0
- package/dist/bundle/{chunk-ASMMG72J.js → chunk-FJQO5OHR.js} +261 -565
- package/dist/bundle/{chunk-RJOQH5YY.js → chunk-FKP4T7A4.js} +111 -859
- package/dist/bundle/{chunk-JDV7HNNQ.js → chunk-FTL3WXZB.js} +13 -26
- package/dist/bundle/{chunk-FP54WSIR.js → chunk-G2CH4FRW.js} +4 -4
- package/dist/bundle/chunk-G2KKMQRN.js +30 -0
- package/dist/bundle/{chunk-NYECVHFH.js → chunk-G4NHRFS7.js} +755 -0
- package/dist/bundle/{chunk-Y2NWGNUB.js → chunk-G7SKXAVZ.js} +5 -5
- package/dist/bundle/{chunk-FT3LN3HP.js → chunk-GFI3UUIU.js} +1 -1
- package/dist/bundle/chunk-GTPPUBYU.js +1876 -0
- package/dist/bundle/{chunk-QFR2PNJN.js → chunk-GTROGY74.js} +12 -12
- package/dist/bundle/{chunk-UTO2GO4P.js → chunk-GYAPDUF5.js} +45 -66
- package/dist/bundle/{chunk-GBKNJWOZ.js → chunk-HCMEU7AF.js} +8 -8
- package/dist/bundle/{chunk-FJH7DJWK.js → chunk-HDGJ7IDE.js} +6 -6
- package/dist/bundle/{chunk-Z3KUSRCF.js → chunk-HMN26CVU.js} +2 -2
- package/dist/bundle/{chunk-I4RWW3UD.js → chunk-HOICQNJX.js} +20 -5
- package/dist/bundle/{chunk-P7CUM5IB.js → chunk-HPS2YGSZ.js} +1 -1
- package/dist/bundle/{chunk-HMS6EEQL.js → chunk-HSASPXRW.js} +3 -3
- package/dist/bundle/{chunk-KGYVHPGE.js → chunk-IABPGOMT.js} +2 -2
- package/dist/bundle/{chunk-4QNW4NK6.js → chunk-IBQZT2YD.js} +1 -1
- package/dist/bundle/{chunk-PRW6SYA3.js → chunk-IE3R46YN.js} +313 -257
- package/dist/bundle/{chunk-7PDHGZN4.js → chunk-IE6O7463.js} +4 -4
- package/dist/bundle/{chunk-3UGYFXH6.js → chunk-IPBYU43F.js} +192 -379
- package/dist/bundle/{chunk-RWDKMU74.js → chunk-IS7STZEB.js} +3 -3
- package/dist/bundle/{chunk-GOWXXYEF.js → chunk-IV77ZFF4.js} +4 -4
- package/dist/bundle/{chunk-6XFIITOG.js → chunk-JDGF3YYS.js} +4811 -3486
- package/dist/bundle/{chunk-GPQ44Y2R.js → chunk-JHAACT4I.js} +2 -2
- package/dist/bundle/{chunk-SERXSCN3.js → chunk-JRED7BNX.js} +337 -390
- package/dist/bundle/{chunk-MIA7P6FZ.js → chunk-JSYUB4SM.js} +6 -6
- package/dist/bundle/{chunk-RESDD3Q4.js → chunk-JVM75M4H.js} +16 -3
- package/dist/bundle/{chunk-XF4EXO2C.js → chunk-JZ65CQWK.js} +6 -6
- package/dist/bundle/{chunk-QNRRK3CN.js → chunk-KBR7OC5S.js} +2 -2
- package/dist/bundle/chunk-KI6OOW6D.js +123 -0
- package/dist/bundle/chunk-KOI5G7NM.js +388 -0
- package/dist/bundle/{chunk-ZZ32DXTH.js → chunk-KPBUJQKT.js} +1 -1
- package/dist/bundle/{chunk-2LHAVY4U.js → chunk-KVBGIZ2C.js} +1 -1
- package/dist/bundle/chunk-L7P3LUDQ.js +286 -0
- package/dist/bundle/{chunk-SAKO3P4H.js → chunk-LKUWH6KU.js} +1 -1
- package/dist/bundle/chunk-MA6U4XH2.js +36 -0
- package/dist/bundle/{chunk-TAFHYHKA.js → chunk-MA7ETVTZ.js} +43 -186
- package/dist/bundle/{chunk-KYKW2W6X.js → chunk-MDJUYCHT.js} +1 -1
- package/dist/bundle/chunk-MEYYH47C.js +25 -0
- package/dist/bundle/{chunk-Z56QFOBR.js → chunk-MGC2BAD2.js} +1 -1
- package/dist/bundle/chunk-NMQRSEZM.js +37 -0
- package/dist/bundle/{chunk-5DPV7X27.js → chunk-NTZWY5R3.js} +321 -0
- package/dist/bundle/{chunk-OJSBWP3F.js → chunk-OBDPKDGB.js} +69 -7
- package/dist/bundle/{chunk-WVDCCYS3.js → chunk-ODTBJGWQ.js} +17 -17
- package/dist/bundle/chunk-PB6ACIME.js +80 -0
- package/dist/bundle/{chunk-5D4AEUVA.js → chunk-PL5P7UKW.js} +434 -1
- package/dist/bundle/{chunk-72C4YOCH.js → chunk-PMAV3RNP.js} +7 -7
- package/dist/bundle/chunk-PSY67L73.js +783 -0
- package/dist/bundle/{chunk-6TNNT2MQ.js → chunk-PUVQOZ2N.js} +483 -176
- package/dist/bundle/{chunk-SDKQNOL5.js → chunk-QB7K6PIP.js} +6 -6
- package/dist/bundle/chunk-QK7GKFKB.js +188 -0
- package/dist/bundle/{chunk-4PA4DHYV.js → chunk-QMUWHKP5.js} +6 -6
- package/dist/bundle/chunk-QURQ2OU2.js +250 -0
- package/dist/bundle/{chunk-LXKYKRHD.js → chunk-R3EDZWXF.js} +8 -227
- package/dist/bundle/{chunk-KGERXYTV.js → chunk-RM4DO2WZ.js} +1 -1
- package/dist/bundle/chunk-S27UKJVL.js +730 -0
- package/dist/bundle/{chunk-22QQUKWA.js → chunk-S3SLDYTU.js} +1 -1
- package/dist/bundle/{chunk-FCS26CYQ.js → chunk-SAEBHENE.js} +4 -4
- package/dist/bundle/chunk-SM7Z2BQF.js +561 -0
- package/dist/bundle/{chunk-QXC6IEH6.js → chunk-SODB63MR.js} +201 -423
- package/dist/bundle/{chunk-2PUNKUYJ.js → chunk-SSFGSY77.js} +10320 -9907
- package/dist/bundle/{chunk-37MAA6F2.js → chunk-STUPCKAA.js} +11 -2221
- package/dist/bundle/{chunk-BKSQBBYG.js → chunk-SUQT4KI2.js} +9 -9
- package/dist/bundle/{chunk-YPNWIB6H.js → chunk-SWQDKO6D.js} +3 -3
- package/dist/bundle/chunk-SZ7XJZGH.js +2231 -0
- package/dist/bundle/{chunk-3N2OFXB5.js → chunk-T3OK6AYZ.js} +5 -5
- package/dist/bundle/{chunk-HKY7X6NY.js → chunk-TFIAD57H.js} +4 -4
- package/dist/bundle/chunk-TRYYWV7J.js +291 -0
- package/dist/bundle/{chunk-XMMFBPGC.js → chunk-TUL6MCTY.js} +3 -3
- package/dist/bundle/{chunk-6Y2BYFXQ.js → chunk-UC7JLE6J.js} +0 -7
- package/dist/bundle/{chunk-YJIGGUPI.js → chunk-UL5HSHFU.js} +4 -4
- package/dist/bundle/{chunk-3EBBLKIT.js → chunk-UT64BBEP.js} +4 -4
- package/dist/bundle/{chunk-26DHFMGZ.js → chunk-VBIZD5V5.js} +2 -2
- package/dist/bundle/chunk-VHTELRUA.js +50 -0
- package/dist/bundle/chunk-VOQICE3G.js +340 -0
- package/dist/bundle/{chunk-GZ2D4KXG.js → chunk-WDJRUNQN.js} +35 -12
- package/dist/bundle/{chunk-2UUWXPOB.js → chunk-X5CXANSA.js} +3 -3
- package/dist/bundle/{chunk-35SCQ4VI.js → chunk-X6HPQKAI.js} +43 -35
- package/dist/bundle/{chunk-COJSWDNU.js → chunk-XKWQDQ4B.js} +3 -3
- package/dist/bundle/{chunk-6SJOTNHF.js → chunk-XZEVHUKI.js} +6 -28
- package/dist/bundle/{chunk-JZHBZOJR.js → chunk-YE7DJB3F.js} +3 -3
- package/dist/bundle/chunk-YHWFF6DN.js +39 -0
- package/dist/bundle/{chunk-2BVVU7GG.js → chunk-YJVQ5GST.js} +1 -1
- package/dist/bundle/{chunk-ZM63SUHG.js → chunk-YRCGFSRR.js} +2 -2
- package/dist/bundle/{chunk-EOEU3AZN.js → chunk-ZNFXKFGF.js} +13 -13
- package/dist/bundle/{cli-556DERZL.js → cli-KXRWXGTS.js} +217 -114
- package/dist/bundle/command-contract-BGNT7MTQ.js +45 -0
- package/dist/bundle/{command-server-entry-AYLGNZWD.js → command-server-entry-7FZX74T6.js} +36 -34
- package/dist/bundle/{decode-QU24MWMN.js → decode-SZ6W34U3.js} +10 -10
- package/dist/bundle/{dispatch-4KODNOXV.js → dispatch-4KNSZ3PI.js} +10 -10
- package/dist/bundle/dist-PAKDDIBT.js +191 -0
- package/dist/bundle/drive.js +11 -11
- package/dist/bundle/{echarts-BXX4OQWC.js → echarts-ISH62J4E.js} +2 -2
- package/dist/bundle/{embed-KG27KG3D.js → embed-6ODGTZPK.js} +10 -10
- package/dist/bundle/{embedder-IPAVUQUV.js → embedder-6FY67FTQ.js} +15 -15
- package/dist/bundle/entry-2SA6ZX7E.js +25 -0
- package/dist/bundle/{failure-ESL7ETL4.js → failure-V3ILKUTX.js} +4 -4
- package/dist/bundle/first-run-ZNKPPD6M.js +31 -0
- package/dist/bundle/first-screen-WF6GYLPN.js +45 -0
- package/dist/bundle/google-QCADNPCQ.js +46 -0
- package/dist/bundle/{google-api-VCDBSNOW.js → google-api-ZTI3NKZX.js} +88 -73
- package/dist/bundle/grants-BPN5AGDK.js +133 -0
- package/dist/bundle/hast-util-from-html-X2DCPS3T.js +10531 -0
- package/dist/bundle/hast-util-to-html-VP6XLPKJ.js +998 -0
- package/dist/bundle/hast-util-to-mdast-IZ5PRX72.js +2272 -0
- package/dist/bundle/{identity-LOWMVGZY.js → identity-YX4IPGOO.js} +7 -6
- package/dist/bundle/{instructions-2VECIDXF.js → instructions-G5ZGHVFB.js} +1 -1
- package/dist/bundle/{login-7GBONT7V.js → login-CVX5VJX6.js} +96 -81
- package/dist/bundle/{mcp-O6ACR2DX.js → mcp-MQ2L5IIM.js} +2 -2
- package/dist/bundle/{mdast-util-from-markdown-FXEPSNER.js → mdast-util-from-markdown-HEZF7KJ4.js} +137 -195
- package/dist/bundle/mdast-util-gfm-AQW6R6MG.js +925 -0
- package/dist/bundle/mdast-util-to-hast-DF2QVIRV.js +879 -0
- package/dist/bundle/mdast-util-to-markdown-XYLXB3Z3.js +18 -0
- package/dist/bundle/meeting-combined-HKZJMJ6Q.js +28 -0
- package/dist/bundle/meeting-model-DSE4GRVE.js +29 -0
- package/dist/bundle/{meeting-semantic-G7PFOKU7.js → meeting-semantic-OHG2QN2G.js} +10 -10
- package/dist/bundle/{micromark-extension-gfm-GRL24TU6.js → micromark-extension-gfm-OE2GBORZ.js} +11 -78
- package/dist/bundle/{node-MPEQSFI3.js → node-NLJINXVQ.js} +2 -2
- package/dist/bundle/{node-sqlite-OLQMAYB4.js → node-sqlite-KDFQDYVZ.js} +10 -10
- package/dist/bundle/notes-search-3VBVSQ3R.js +70 -0
- package/dist/bundle/oauth-M3E62ZHC.js +22 -0
- package/dist/bundle/{open-OXTE672W.js → open-WVRUVBIZ.js} +8 -8
- package/dist/bundle/{openai-EB3TPIZY.js → openai-JJWOSJMV.js} +22 -21
- package/dist/bundle/{process-F6TKXWWA.js → process-LPVAYRO7.js} +1 -1
- package/dist/bundle/{program-4IFDZ7FM.js → program-ZJRIP25J.js} +276 -1149
- package/dist/bundle/{prompt-F5RRHPN2.js → prompt-XCDHTEAO.js} +8 -8
- package/dist/bundle/{reasons-UORHJDHK.js → reasons-REEEQDAZ.js} +6 -5
- package/dist/bundle/{recognize-DAVNZND3.js → recognize-OZLFDJAT.js} +7 -7
- package/dist/bundle/remote-MDPYVCZB.js +35 -0
- package/dist/bundle/{rerank-CND2GVLZ.js → rerank-FLZWJNHA.js} +11 -11
- package/dist/bundle/{serve-ZHSPUIGX.js → serve-5UV5VLRV.js} +19 -19
- package/dist/bundle/{server-YMAK4LHC.js → server-53A2X2MK.js} +89 -70
- package/dist/bundle/server-5GMURMDE.js +97 -0
- package/dist/bundle/{services-ZILSFJ6E.js → services-XSMH7BXB.js} +109 -89
- package/dist/bundle/{sqlite-runtime-S5VPMZQH.js → sqlite-runtime-E3L7ENFU.js} +9 -9
- package/dist/bundle/{start-CR6X25RT.js → start-4S2VNR4J.js} +7 -7
- package/dist/bundle/{state-YFPHVIIJ.js → state-TQI4JSH7.js} +9 -9
- package/dist/bundle/{store-CL4ZJZRI.js → store-GS7PU6PJ.js} +38 -23
- package/dist/bundle/{store-UODRT6X4.js → store-VYJPL7MW.js} +36 -25
- package/dist/bundle/store-maintenance-command-JJVYUZMG.js +85 -0
- package/dist/bundle/surface-JC4XVMZR.js +83 -0
- package/dist/bundle/tokens-KJQ5EAPW.js +133 -0
- package/dist/commands/documents.d.ts.map +1 -1
- package/dist/commands/documents.js +11 -1
- package/dist/commands/documents.js.map +1 -1
- package/dist/commands/remote.d.ts.map +1 -1
- package/dist/commands/remote.js +8 -22
- package/dist/commands/remote.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +14 -4
- package/dist/commands/sync.js.map +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -0
- package/dist/config.js.map +1 -1
- package/dist/first-screen.d.ts.map +1 -1
- package/dist/first-screen.js +2 -1
- package/dist/first-screen.js.map +1 -1
- package/dist/generated/manifest.d.ts +2 -1
- package/dist/generated/manifest.d.ts.map +1 -1
- package/dist/generated/manifest.js +782 -0
- package/dist/generated/manifest.js.map +1 -1
- package/dist/generated/types.d.ts +262 -58
- package/dist/generated/types.d.ts.map +1 -1
- package/dist/google.d.ts.map +1 -1
- package/dist/google.js +5 -5
- package/dist/google.js.map +1 -1
- package/dist/model.d.ts +5 -2
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js.map +1 -1
- package/dist/policy-keys.js +1 -1
- package/dist/policy-keys.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +9 -4
- package/dist/program.js.map +1 -1
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +6 -1
- package/dist/state.js.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +2 -7
- package/dist/store.js.map +1 -1
- package/dist/supported.d.ts +2 -2
- package/dist/supported.d.ts.map +1 -1
- package/dist/supported.js +2 -3
- package/dist/supported.js.map +1 -1
- package/dist/sync.d.ts +2 -1
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +5 -2
- package/dist/sync.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/scenarios/find-decision.md +1 -1
- package/skills/drive-cli/SKILL.md +4 -2
- package/dist/bundle/chunk-J5Q5FS2N.js +0 -593
- package/dist/bundle/chunk-L46C6HQ7.js +0 -729
- package/dist/bundle/chunk-UDMNY63V.js +0 -899
- package/dist/bundle/chunk-VKE77B3F.js +0 -2
- package/dist/bundle/command-contract-VRTOAV6W.js +0 -43
- package/dist/bundle/entry-MVXQETWS.js +0 -25
- package/dist/bundle/first-run-4UVLW2WR.js +0 -31
- package/dist/bundle/first-screen-JAKAIINI.js +0 -41
- package/dist/bundle/google-22NXXJX5.js +0 -45
- package/dist/bundle/grants-MQMTVCRQ.js +0 -118
- package/dist/bundle/mdast-util-gfm-SZM5GBDF.js +0 -2103
- package/dist/bundle/meeting-combined-LVP4AZKA.js +0 -27
- package/dist/bundle/meeting-model-RAY5XDXZ.js +0 -29
- package/dist/bundle/oauth-SGH2I2BY.js +0 -22
- package/dist/bundle/remote-D5EYYIAU.js +0 -35
- package/dist/bundle/server-DUVJWP3Q.js +0 -80
- package/dist/bundle/store-maintenance-command-DY5XIBWR.js +0 -72
- package/dist/bundle/tokens-AF7QOFOF.js +0 -118
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
__name
|
|
5
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
6
|
+
|
|
7
|
+
// node_modules/.pnpm/zwitch@2.0.4/node_modules/zwitch/index.js
|
|
8
|
+
var own = {}.hasOwnProperty;
|
|
9
|
+
function zwitch(key, options) {
|
|
10
|
+
const settings = options || {};
|
|
11
|
+
function one(value, ...parameters) {
|
|
12
|
+
let fn = one.invalid;
|
|
13
|
+
const handlers = one.handlers;
|
|
14
|
+
if (value && own.call(value, key)) {
|
|
15
|
+
const id = String(value[key]);
|
|
16
|
+
fn = own.call(handlers, id) ? handlers[id] : one.unknown;
|
|
17
|
+
}
|
|
18
|
+
if (fn) {
|
|
19
|
+
return fn.call(this, value, ...parameters);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
__name(one, "one");
|
|
23
|
+
one.handlers = settings.handlers || {};
|
|
24
|
+
one.invalid = settings.invalid;
|
|
25
|
+
one.unknown = settings.unknown;
|
|
26
|
+
return one;
|
|
27
|
+
}
|
|
28
|
+
__name(zwitch, "zwitch");
|
|
29
|
+
|
|
30
|
+
export {
|
|
31
|
+
zwitch
|
|
32
|
+
};
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
activeProfile,
|
|
5
|
+
paths
|
|
6
|
+
} from "./chunk-35GROSBS.js";
|
|
7
|
+
import {
|
|
8
|
+
READ_SCOPE,
|
|
9
|
+
WRITE_SCOPE
|
|
10
|
+
} from "./chunk-G4NHRFS7.js";
|
|
11
|
+
import {
|
|
12
|
+
googleError
|
|
13
|
+
} from "./chunk-YJVQ5GST.js";
|
|
14
|
+
import {
|
|
15
|
+
credentialStorage,
|
|
16
|
+
driveSessionCodec,
|
|
17
|
+
tokenKeeper
|
|
18
|
+
} from "./chunk-JDGF3YYS.js";
|
|
19
|
+
import {
|
|
20
|
+
providerRequest
|
|
21
|
+
} from "./chunk-SSFGSY77.js";
|
|
22
|
+
import {
|
|
23
|
+
hostFetch
|
|
24
|
+
} from "./chunk-6KND2DYT.js";
|
|
25
|
+
import {
|
|
26
|
+
DESKTOP
|
|
27
|
+
} from "./chunk-YRCGFSRR.js";
|
|
28
|
+
import {
|
|
29
|
+
Credentials,
|
|
30
|
+
isMovedRun,
|
|
31
|
+
systemKeyring
|
|
32
|
+
} from "./chunk-3ZGWJYSG.js";
|
|
33
|
+
import {
|
|
34
|
+
minLength,
|
|
35
|
+
nullable,
|
|
36
|
+
number,
|
|
37
|
+
object,
|
|
38
|
+
optional,
|
|
39
|
+
pipe,
|
|
40
|
+
safeParse,
|
|
41
|
+
string
|
|
42
|
+
} from "./chunk-OBDPKDGB.js";
|
|
43
|
+
import {
|
|
44
|
+
CliError,
|
|
45
|
+
isCliError
|
|
46
|
+
} from "./chunk-IBQZT2YD.js";
|
|
47
|
+
import {
|
|
48
|
+
__name
|
|
49
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
50
|
+
|
|
51
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.724.0_@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typ_7eee7c5df32146a12ad3bd2be9b828b8/node_modules/@wirecat/cli-core/dist/oauth/provider.js
|
|
52
|
+
var googleProvider = /* @__PURE__ */ __name((client, { loginHint } = {}) => ({
|
|
53
|
+
id: "google",
|
|
54
|
+
name: "Google",
|
|
55
|
+
authorizeUrl: "https://accounts.google.com/o/oauth2/v2/auth",
|
|
56
|
+
tokenUrl: "https://oauth2.googleapis.com/token",
|
|
57
|
+
revokeUrl: "https://oauth2.googleapis.com/revoke",
|
|
58
|
+
client,
|
|
59
|
+
redirect: { kind: "loopback" },
|
|
60
|
+
// Without offline access Google returns no refresh token; without consent it does not return one again.
|
|
61
|
+
authorizeParams: {
|
|
62
|
+
access_type: "offline",
|
|
63
|
+
prompt: "select_account consent",
|
|
64
|
+
...loginHint ? { login_hint: loginHint } : {}
|
|
65
|
+
}
|
|
66
|
+
}), "googleProvider");
|
|
67
|
+
|
|
68
|
+
// dist/tokens.js
|
|
69
|
+
import { OAuth2Client } from "google-auth-library";
|
|
70
|
+
var Session = object({
|
|
71
|
+
principal: string(),
|
|
72
|
+
clientId: string(),
|
|
73
|
+
clientSecret: optional(string()),
|
|
74
|
+
tokens: object({
|
|
75
|
+
access_token: optional(nullable(string())),
|
|
76
|
+
refresh_token: pipe(string(), minLength(1)),
|
|
77
|
+
expiry_date: optional(nullable(number())),
|
|
78
|
+
scope: optional(string()),
|
|
79
|
+
token_type: optional(nullable(string()))
|
|
80
|
+
})
|
|
81
|
+
});
|
|
82
|
+
var viaDeclaredHosts = /* @__PURE__ */ __name((timeoutMs) => (input, init) => hostFetch({ hosts: DESKTOP.hosts, ...timeoutMs ? { timeoutMs } : {} })(input, init), "viaDeclaredHosts");
|
|
83
|
+
var googleFetch = viaDeclaredHosts();
|
|
84
|
+
var sdkFetch = viaDeclaredHosts(24 * 60 * 6e4);
|
|
85
|
+
var transporterOptions = /* @__PURE__ */ __name((signal) => ({
|
|
86
|
+
timeout: 3e4,
|
|
87
|
+
fetchImplementation: sdkFetch,
|
|
88
|
+
...signal ? { signal } : {}
|
|
89
|
+
}), "transporterOptions");
|
|
90
|
+
var credentialOptions = /* @__PURE__ */ __name((env, storage, keyring) => ({
|
|
91
|
+
configDir: paths(env).config,
|
|
92
|
+
service: "drive-cli",
|
|
93
|
+
// The keyring falls back to the private file by itself (WC-SECR-4); `file` skips the keyring.
|
|
94
|
+
storage: storage === "keyring" ? "auto" : storage,
|
|
95
|
+
env,
|
|
96
|
+
isolated: isMovedRun({ appName: "drive-cli", prefix: "DRIVE", env }),
|
|
97
|
+
...keyring ? { keyring } : {}
|
|
98
|
+
}), "credentialOptions");
|
|
99
|
+
var credentials = /* @__PURE__ */ __name((env, storage, keyring) => new Credentials(credentialOptions(env, storage, keyring)), "credentials");
|
|
100
|
+
var notSaved = /* @__PURE__ */ __name(() => new CliError("configuration_error", "could not save Google sign-in: the private credentials file cannot be read; move it aside and sign in again", { reason: "oauth.not-saved" }), "notSaved");
|
|
101
|
+
var saveSession = /* @__PURE__ */ __name((env, name, session, storage, keyring) => {
|
|
102
|
+
try {
|
|
103
|
+
credentials(env, storage, keyring).write(name, JSON.stringify(session));
|
|
104
|
+
} catch {
|
|
105
|
+
throw notSaved();
|
|
106
|
+
}
|
|
107
|
+
}, "saveSession");
|
|
108
|
+
var sessionKeeper = /* @__PURE__ */ __name((options) => tokenKeeper({
|
|
109
|
+
provider: googleProvider(options.client),
|
|
110
|
+
storage: credentialStorage({
|
|
111
|
+
credentials: { ...credentialOptions(options.env, options.storage), keyring: options.keyring ?? systemKeyring },
|
|
112
|
+
account: options.name,
|
|
113
|
+
codec: driveSessionCodec
|
|
114
|
+
}),
|
|
115
|
+
lockDir: paths(options.env).config,
|
|
116
|
+
fetch: options.fetch ?? googleFetch,
|
|
117
|
+
signInCommand: `drive ${options.name} session start`,
|
|
118
|
+
// Above the client's own 5-minute early refresh, so a token it asks to replace is replaced.
|
|
119
|
+
freshForMs: 6 * 6e4,
|
|
120
|
+
...options.signal ? { signal: options.signal } : {}
|
|
121
|
+
}), "sessionKeeper");
|
|
122
|
+
var authorizedClient = /* @__PURE__ */ __name((env, name, keyring, signal) => {
|
|
123
|
+
const profile = activeProfile(env, name);
|
|
124
|
+
const unreadable = /* @__PURE__ */ __name(() => new CliError("authentication_error", `could not load Google sign-in \u2014 run drive ${name} session start again`, {
|
|
125
|
+
reason: "oauth.expired"
|
|
126
|
+
}), "unreadable");
|
|
127
|
+
let secret;
|
|
128
|
+
try {
|
|
129
|
+
secret = credentials(env, profile.storage, keyring).read(name)?.secret;
|
|
130
|
+
} catch {
|
|
131
|
+
throw unreadable();
|
|
132
|
+
}
|
|
133
|
+
if (!secret)
|
|
134
|
+
throw new CliError("authentication_error", `this profile has no saved Google sign-in \u2014 run drive ${name} session start`, {
|
|
135
|
+
reason: "session.missing"
|
|
136
|
+
});
|
|
137
|
+
let parsed;
|
|
138
|
+
try {
|
|
139
|
+
parsed = safeParse(Session, JSON.parse(secret));
|
|
140
|
+
} catch {
|
|
141
|
+
throw unreadable();
|
|
142
|
+
}
|
|
143
|
+
if (!parsed.success || parsed.output.principal !== profile.principal)
|
|
144
|
+
throw new CliError("authentication_error", "saved sign-in is invalid or belongs to another account", {
|
|
145
|
+
reason: "oauth.expired"
|
|
146
|
+
});
|
|
147
|
+
const session = parsed.output;
|
|
148
|
+
const keeper = sessionKeeper({
|
|
149
|
+
env,
|
|
150
|
+
name,
|
|
151
|
+
storage: profile.storage,
|
|
152
|
+
client: { clientId: session.clientId, ...session.clientSecret ? { clientSecret: session.clientSecret } : {} },
|
|
153
|
+
...keyring ? { keyring } : {},
|
|
154
|
+
...signal ? { signal } : {}
|
|
155
|
+
});
|
|
156
|
+
const client = new OAuth2Client({
|
|
157
|
+
clientId: session.clientId,
|
|
158
|
+
clientSecret: session.clientSecret,
|
|
159
|
+
transporterOptions: transporterOptions(signal)
|
|
160
|
+
});
|
|
161
|
+
client.refreshHandler = async () => {
|
|
162
|
+
try {
|
|
163
|
+
const tokens = await keeper.tokens();
|
|
164
|
+
if (!tokens.accessToken || tokens.expiresAt === void 0)
|
|
165
|
+
throw new Error("no access token");
|
|
166
|
+
return { access_token: tokens.accessToken, expiry_date: tokens.expiresAt };
|
|
167
|
+
} catch (error) {
|
|
168
|
+
if (isCliError(error) && error.code !== "authentication_error")
|
|
169
|
+
throw error;
|
|
170
|
+
throw new CliError("authentication_error", `Google sign-in expired \u2014 run drive ${name} session start again`, {
|
|
171
|
+
reason: "oauth.expired"
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
const { refresh_token: _refresh, ...current } = session.tokens;
|
|
176
|
+
client.setCredentials(current);
|
|
177
|
+
return observeRequests(client);
|
|
178
|
+
}, "authorizedClient");
|
|
179
|
+
var covers = /* @__PURE__ */ __name((granted, required) => granted.includes(required) || required === READ_SCOPE && granted.includes(WRITE_SCOPE), "covers");
|
|
180
|
+
var grantedScopes = /* @__PURE__ */ __name((env, name, keyring) => {
|
|
181
|
+
try {
|
|
182
|
+
const secret = credentials(env, activeProfile(env, name).storage, keyring).read(name)?.secret;
|
|
183
|
+
const parsed = secret ? safeParse(Session, JSON.parse(secret)) : void 0;
|
|
184
|
+
if (!parsed?.success)
|
|
185
|
+
return [];
|
|
186
|
+
return parsed.output.tokens.scope?.split(/\s+/).filter(Boolean);
|
|
187
|
+
} catch {
|
|
188
|
+
return [];
|
|
189
|
+
}
|
|
190
|
+
}, "grantedScopes");
|
|
191
|
+
var checkAuthorization = /* @__PURE__ */ __name(async (client, required = READ_SCOPE) => {
|
|
192
|
+
try {
|
|
193
|
+
const { token } = await client.getAccessToken();
|
|
194
|
+
if (!token)
|
|
195
|
+
throw new CliError("authentication_error", "Google returned no access token");
|
|
196
|
+
const info = await client.getTokenInfo(token);
|
|
197
|
+
if (!covers(info.scopes, required))
|
|
198
|
+
throw new CliError("permission_error", "sign-in lacks the required permission; run drive <profile> session start --grant write, activity or apps when needed", { reason: "oauth.scope-missing" });
|
|
199
|
+
} catch (error) {
|
|
200
|
+
throw googleError(error);
|
|
201
|
+
}
|
|
202
|
+
}, "checkAuthorization");
|
|
203
|
+
var WORD = /^[a-z][a-z_]{0,23}$/;
|
|
204
|
+
var VERB = /^[a-z][A-Za-z]{0,31}$/;
|
|
205
|
+
var segment = /* @__PURE__ */ __name((part) => {
|
|
206
|
+
if (/^v\d+$/.test(part) || WORD.test(part))
|
|
207
|
+
return part;
|
|
208
|
+
const verb = part.split(":")[1];
|
|
209
|
+
return verb !== void 0 && VERB.test(verb) ? `:id:${verb}` : ":id";
|
|
210
|
+
}, "segment");
|
|
211
|
+
var operationOf = /* @__PURE__ */ __name((method, url) => {
|
|
212
|
+
let path = "";
|
|
213
|
+
try {
|
|
214
|
+
path = new URL(String(url ?? "")).pathname;
|
|
215
|
+
} catch {
|
|
216
|
+
}
|
|
217
|
+
const template = path.split("/").filter(Boolean).map((part) => segment(decodeURIComponent(part))).join("/");
|
|
218
|
+
return `${(method ?? "GET").toUpperCase()} /${template}`;
|
|
219
|
+
}, "operationOf");
|
|
220
|
+
var reasonOf = /* @__PURE__ */ __name((data) => {
|
|
221
|
+
const error = data?.error;
|
|
222
|
+
const reason = error?.errors?.[0]?.reason ?? error?.status;
|
|
223
|
+
return typeof reason === "string" ? reason : void 0;
|
|
224
|
+
}, "reasonOf");
|
|
225
|
+
var observeRequests = /* @__PURE__ */ __name((client) => {
|
|
226
|
+
const transporter = client.transporter;
|
|
227
|
+
const request = transporter.request.bind(transporter);
|
|
228
|
+
transporter.request = (async (options) => {
|
|
229
|
+
const method = (options.method ?? "GET").toUpperCase();
|
|
230
|
+
const operation = operationOf(method, options.url);
|
|
231
|
+
const call = { method, endpointTemplate: operation.slice(method.length + 1), transport: "http" };
|
|
232
|
+
let ended;
|
|
233
|
+
const adapter = /* @__PURE__ */ __name(async (prepared, next) => {
|
|
234
|
+
const attempt = (prepared.retryConfig?.currentRetryAttempt ?? 0) + 1;
|
|
235
|
+
const waitMs = ended === void 0 ? void 0 : Math.round(performance.now() - ended);
|
|
236
|
+
const answered = providerRequest(operation, void 0, {
|
|
237
|
+
...call,
|
|
238
|
+
attempt,
|
|
239
|
+
...waitMs === void 0 ? {} : { waitMs }
|
|
240
|
+
});
|
|
241
|
+
try {
|
|
242
|
+
const response = await (options.adapter ? options.adapter(prepared, next) : next(prepared));
|
|
243
|
+
const failed = !(prepared.validateStatus?.(response.status) ?? response.status < 400);
|
|
244
|
+
const providerError = failed ? reasonOf(response.data) : void 0;
|
|
245
|
+
answered({
|
|
246
|
+
status: response.status,
|
|
247
|
+
...failed ? { errorCode: "provider_error" } : {},
|
|
248
|
+
...providerError ? { providerError } : {}
|
|
249
|
+
});
|
|
250
|
+
return response;
|
|
251
|
+
} catch (error) {
|
|
252
|
+
answered({ error, errorCode: googleError(error).code });
|
|
253
|
+
throw error;
|
|
254
|
+
} finally {
|
|
255
|
+
ended = performance.now();
|
|
256
|
+
}
|
|
257
|
+
}, "adapter");
|
|
258
|
+
try {
|
|
259
|
+
return await request({ ...options, adapter });
|
|
260
|
+
} catch (error) {
|
|
261
|
+
if (ended === void 0)
|
|
262
|
+
providerRequest(operation, void 0, { ...call, attempt: 1 })({ error, errorCode: googleError(error).code });
|
|
263
|
+
throw error;
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
return client;
|
|
267
|
+
}, "observeRequests");
|
|
268
|
+
|
|
269
|
+
export {
|
|
270
|
+
googleFetch,
|
|
271
|
+
transporterOptions,
|
|
272
|
+
credentials,
|
|
273
|
+
notSaved,
|
|
274
|
+
saveSession,
|
|
275
|
+
sessionKeeper,
|
|
276
|
+
authorizedClient,
|
|
277
|
+
covers,
|
|
278
|
+
grantedScopes,
|
|
279
|
+
checkAuthorization,
|
|
280
|
+
operationOf,
|
|
281
|
+
observeRequests
|
|
282
|
+
};
|