@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
|
@@ -3,12 +3,12 @@ const require = __bundleRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
CliError,
|
|
5
5
|
isCliError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IBQZT2YD.js";
|
|
7
7
|
import {
|
|
8
8
|
__name
|
|
9
9
|
} from "./chunk-ZVVMGPBJ.js";
|
|
10
10
|
|
|
11
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
11
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/hosts.js
|
|
12
12
|
var LABEL = "[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?";
|
|
13
13
|
var HOST_PATTERN = new RegExp(`^(?:${LABEL}(?:\\.${LABEL})*|\\*\\.${LABEL}(?:\\.${LABEL})+)$`);
|
|
14
14
|
var hostProblems = /* @__PURE__ */ __name((hosts) => [
|
|
@@ -20,7 +20,7 @@ var hostCovered = /* @__PURE__ */ __name((hostname, hosts) => {
|
|
|
20
20
|
return hosts.some((host) => host.startsWith("*.") ? name.endsWith(host.slice(1)) : name === host);
|
|
21
21
|
}, "hostCovered");
|
|
22
22
|
|
|
23
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
23
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/fetch.js
|
|
24
24
|
var HOST_FETCH_TIMEOUT_MS = 3e4;
|
|
25
25
|
var REDIRECTS = 5;
|
|
26
26
|
var REDIRECT_STATUSES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
|
|
@@ -55,11 +55,32 @@ var checked = /* @__PURE__ */ __name((url, hosts) => {
|
|
|
55
55
|
throw undeclared(url);
|
|
56
56
|
return url;
|
|
57
57
|
}, "checked");
|
|
58
|
+
var ENCODED_SLASH = /%2f|%5c/i;
|
|
59
|
+
var scopeOf = /* @__PURE__ */ __name((scope) => {
|
|
60
|
+
if (scope === void 0)
|
|
61
|
+
return void 0;
|
|
62
|
+
if (!URL.canParse(scope))
|
|
63
|
+
throw new CliError("configuration_error", `credentialScope ${scope} is not a URL`);
|
|
64
|
+
const { origin, pathname } = new URL(scope);
|
|
65
|
+
const prefix = pathname.endsWith("/") ? pathname : `${pathname}/`;
|
|
66
|
+
return (url) => url.origin === origin && (url.pathname === pathname || url.pathname.startsWith(prefix)) && !ENCODED_SLASH.test(url.pathname);
|
|
67
|
+
}, "scopeOf");
|
|
68
|
+
var signedHeaders = /* @__PURE__ */ __name((headers) => CREDENTIAL_HEADERS.some((name) => headers.has(name)), "signedHeaders");
|
|
69
|
+
var NOT_SENT = /* @__PURE__ */ new Set(["EAI_AGAIN", "ENOTFOUND", "ECONNREFUSED"]);
|
|
70
|
+
var neverSent = /* @__PURE__ */ __name((error) => {
|
|
71
|
+
for (let at = error, depth = 0; at instanceof Error && depth < 4; at = at.cause, depth++) {
|
|
72
|
+
const code = at.code;
|
|
73
|
+
if (typeof code === "string" && NOT_SENT.has(code))
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
return false;
|
|
77
|
+
}, "neverSent");
|
|
58
78
|
var hostFetch = /* @__PURE__ */ __name((options) => {
|
|
59
79
|
const problems = hostProblems(options.hosts);
|
|
60
80
|
if (problems.length > 0)
|
|
61
81
|
throw new CliError("configuration_error", problems.join("; "));
|
|
62
82
|
const { hosts, fetch: send = globalThis.fetch, timeoutMs = HOST_FETCH_TIMEOUT_MS, redirects = REDIRECTS } = options;
|
|
83
|
+
const inScope = scopeOf(options.credentialScope);
|
|
63
84
|
return async (input, init = {}) => {
|
|
64
85
|
const request = input instanceof Request ? input : void 0;
|
|
65
86
|
let url = checked(new URL(request?.url ?? String(input)), hosts);
|
|
@@ -70,8 +91,14 @@ var hostFetch = /* @__PURE__ */ __name((options) => {
|
|
|
70
91
|
let method = (init.method ?? request?.method ?? "GET").toUpperCase();
|
|
71
92
|
let body = init.body ?? request?.body ?? void 0;
|
|
72
93
|
const headers = new Headers(init.headers ?? request?.headers);
|
|
94
|
+
if (inScope && signedHeaders(headers) && !inScope(url))
|
|
95
|
+
throw new CliError("configuration_error", `the sign-in goes only under ${options.credentialScope}, not ${url.origin}${url.pathname}`, {
|
|
96
|
+
sent: false
|
|
97
|
+
});
|
|
98
|
+
let answered = false;
|
|
73
99
|
try {
|
|
74
100
|
let response = await send(input, { ...init, signal, ...follow ? { redirect: "manual" } : {} });
|
|
101
|
+
answered = true;
|
|
75
102
|
for (let hop = 0; follow && REDIRECT_STATUSES.has(response.status); hop += 1) {
|
|
76
103
|
const location = response.headers.get("location");
|
|
77
104
|
if (!location)
|
|
@@ -88,7 +115,7 @@ var hostFetch = /* @__PURE__ */ __name((options) => {
|
|
|
88
115
|
headers.delete("content-length");
|
|
89
116
|
} else if (body instanceof ReadableStream)
|
|
90
117
|
throw new CliError("invalid_response", `${url.hostname} redirected a streamed body, which cannot be sent again`);
|
|
91
|
-
if (next.origin !== url.origin)
|
|
118
|
+
if (inScope ? !inScope(next) : next.origin !== url.origin)
|
|
92
119
|
for (const name of CREDENTIAL_HEADERS)
|
|
93
120
|
headers.delete(name);
|
|
94
121
|
url = next;
|
|
@@ -103,12 +130,15 @@ var hostFetch = /* @__PURE__ */ __name((options) => {
|
|
|
103
130
|
throw isCliError(caller.reason) ? caller.reason : new CliError("cancelled", "request cancelled");
|
|
104
131
|
if (timeout.signal.aborted)
|
|
105
132
|
throw new CliError("timeout", `${url.hostname} did not answer within ${timeoutMs} ms`, { retryable: true });
|
|
106
|
-
throw new CliError("network_error", `${url.hostname} could not be reached`, {
|
|
133
|
+
throw new CliError("network_error", `${url.hostname} could not be reached`, {
|
|
134
|
+
retryable: true,
|
|
135
|
+
...!answered && neverSent(error) ? { sent: false } : {}
|
|
136
|
+
});
|
|
107
137
|
}
|
|
108
138
|
};
|
|
109
139
|
}, "hostFetch");
|
|
110
140
|
|
|
111
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
141
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/body.js
|
|
112
142
|
var interrupted = /* @__PURE__ */ __name((signal) => isCliError(signal.reason) ? signal.reason : new CliError(signal.reason instanceof Error && signal.reason.name === "TimeoutError" ? "timeout" : "cancelled", "HTTP response read was interrupted"), "interrupted");
|
|
113
143
|
var checked2 = /* @__PURE__ */ __name((signal) => {
|
|
114
144
|
if (signal?.aborted)
|
|
@@ -193,7 +223,7 @@ var readJsonResponse = /* @__PURE__ */ __name(async (response, options) => {
|
|
|
193
223
|
}
|
|
194
224
|
}, "readJsonResponse");
|
|
195
225
|
|
|
196
|
-
// node_modules/.pnpm/@wirecat+cli-base@0.
|
|
226
|
+
// node_modules/.pnpm/@wirecat+cli-base@0.130.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/index.js
|
|
197
227
|
var parseRetryAfter = /* @__PURE__ */ __name((header, now) => {
|
|
198
228
|
if (!header)
|
|
199
229
|
return void 0;
|
|
@@ -234,7 +264,7 @@ var statusToCode = /* @__PURE__ */ __name((status) => {
|
|
|
234
264
|
return "provider_error";
|
|
235
265
|
}, "statusToCode");
|
|
236
266
|
|
|
237
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
267
|
+
// 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/models/endpoint.js
|
|
238
268
|
var endpoint = /* @__PURE__ */ __name((value) => {
|
|
239
269
|
try {
|
|
240
270
|
const url = new URL(value);
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// 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/store/driver.js
|
|
8
8
|
var TIME_LIMIT_FUNCTION = "wc_time_limit";
|
|
9
9
|
var TimeLimitReached = class extends Error {
|
|
10
10
|
static {
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
CLIENT_INFO_META_KEY
|
|
5
|
+
} from "./chunk-PL5P7UKW.js";
|
|
6
|
+
import {
|
|
7
|
+
agentOf,
|
|
8
|
+
clientHash,
|
|
9
|
+
currentCaller
|
|
10
|
+
} from "./chunk-PMAV3RNP.js";
|
|
11
|
+
import {
|
|
12
|
+
__name
|
|
13
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
14
|
+
|
|
15
|
+
// 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/mcp/caller.js
|
|
16
|
+
var callingAgent = /* @__PURE__ */ __name((fallback, caller = currentCaller()) => {
|
|
17
|
+
const client = caller?.agent?.client?.name;
|
|
18
|
+
if (client && client !== "unknown")
|
|
19
|
+
return client;
|
|
20
|
+
const kind = caller?.agent?.kind;
|
|
21
|
+
return kind && kind !== "mcp-client" ? kind : fallback;
|
|
22
|
+
}, "callingAgent");
|
|
23
|
+
var CALLER_META_KEY = "wirecat.dev/caller";
|
|
24
|
+
var PROXY_CLIENT_NAME = "all-profiles";
|
|
25
|
+
var NAME = /^[\w .@()/+-]{1,64}$/;
|
|
26
|
+
var plain = /* @__PURE__ */ __name((value) => typeof value === "string" && NAME.test(value.trim()) ? value.trim() : void 0, "plain");
|
|
27
|
+
var clientFrom = /* @__PURE__ */ __name((value) => {
|
|
28
|
+
if (!value || typeof value !== "object")
|
|
29
|
+
return void 0;
|
|
30
|
+
const { name, version } = value;
|
|
31
|
+
const named = plain(name);
|
|
32
|
+
if (!named)
|
|
33
|
+
return void 0;
|
|
34
|
+
const versioned = plain(version);
|
|
35
|
+
return { name: named, ...versioned ? { version: versioned } : {} };
|
|
36
|
+
}, "clientFrom");
|
|
37
|
+
var callerOf = /* @__PURE__ */ __name((ctx, tool, source) => {
|
|
38
|
+
const meta = ctx?.mcpReq?._meta;
|
|
39
|
+
const requestId = ctx?.mcpReq?.id;
|
|
40
|
+
const initialized = source.client?.();
|
|
41
|
+
const proxied = initialized?.name === PROXY_CLIENT_NAME && !ctx?.http ? passedOn(meta?.[CALLER_META_KEY], tool) : void 0;
|
|
42
|
+
if (proxied)
|
|
43
|
+
return proxied;
|
|
44
|
+
const client = clientFrom(meta?.[CLIENT_INFO_META_KEY]) ?? clientFrom(initialized);
|
|
45
|
+
const mcp = /* @__PURE__ */ __name((connection) => ({
|
|
46
|
+
tool,
|
|
47
|
+
...requestId === void 0 ? {} : { request_id: String(requestId) },
|
|
48
|
+
...connection ? { connection_id: connection } : {}
|
|
49
|
+
}), "mcp");
|
|
50
|
+
const auth = ctx?.http?.authInfo;
|
|
51
|
+
if (auth) {
|
|
52
|
+
const registered = plain(auth.extra?.clientName);
|
|
53
|
+
return {
|
|
54
|
+
via: "mcp-http",
|
|
55
|
+
agent: {
|
|
56
|
+
kind: "mcp-client",
|
|
57
|
+
session_id: ctx?.sessionId ?? null,
|
|
58
|
+
client: {
|
|
59
|
+
name: registered ?? client?.name ?? "unknown",
|
|
60
|
+
...client?.version ? { version: client.version } : {},
|
|
61
|
+
id: clientHash(auth.clientId)
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
mcp: mcp(ctx?.sessionId)
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const agent = agentOf(source.env) ?? { kind: "mcp-client", session_id: null };
|
|
68
|
+
return { via: "mcp-stdio", agent: { ...agent, ...client ? { client } : {} }, mcp: mcp(source.connectionId) };
|
|
69
|
+
}, "callerOf");
|
|
70
|
+
var passedOn = /* @__PURE__ */ __name((value, tool) => {
|
|
71
|
+
if (!value || typeof value !== "object")
|
|
72
|
+
return void 0;
|
|
73
|
+
const { via, agent, mcp } = value;
|
|
74
|
+
if (via !== "mcp-stdio" && via !== "mcp-http")
|
|
75
|
+
return void 0;
|
|
76
|
+
const a = agent && typeof agent === "object" ? agent : void 0;
|
|
77
|
+
const kind = plain(a?.kind);
|
|
78
|
+
const session = typeof a?.session_id === "string" && /^[A-Za-z0-9._:-]{1,128}$/.test(a.session_id) ? a.session_id : null;
|
|
79
|
+
const client = clientFrom(a?.client);
|
|
80
|
+
const id = a?.client && typeof a.client === "object" ? a.client.id : void 0;
|
|
81
|
+
const m = mcp && typeof mcp === "object" ? mcp : {};
|
|
82
|
+
const request = plain(m.request_id);
|
|
83
|
+
const connection = typeof m.connection_id === "string" && /^[\w-]{1,128}$/.test(m.connection_id) ? m.connection_id : void 0;
|
|
84
|
+
return {
|
|
85
|
+
via,
|
|
86
|
+
...kind ? {
|
|
87
|
+
agent: {
|
|
88
|
+
kind,
|
|
89
|
+
session_id: session,
|
|
90
|
+
...a?.from_chat === true ? { from_chat: true } : {},
|
|
91
|
+
...client ? { client: { ...client, ...typeof id === "string" && /^[0-9a-f]{8}$/.test(id) ? { id } : {} } } : {}
|
|
92
|
+
}
|
|
93
|
+
} : {},
|
|
94
|
+
mcp: {
|
|
95
|
+
tool,
|
|
96
|
+
...request ? { request_id: request } : {},
|
|
97
|
+
...connection ? { connection_id: connection } : {},
|
|
98
|
+
proxied: true
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}, "passedOn");
|
|
102
|
+
|
|
103
|
+
export {
|
|
104
|
+
callingAgent,
|
|
105
|
+
CALLER_META_KEY,
|
|
106
|
+
PROXY_CLIENT_NAME,
|
|
107
|
+
callerOf
|
|
108
|
+
};
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
__name
|
|
5
5
|
} from "./chunk-ZVVMGPBJ.js";
|
|
6
6
|
|
|
7
|
-
// node_modules/.pnpm/@wirecat+cli-core@0.
|
|
7
|
+
// 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/store/normalize.js
|
|
8
8
|
var NORMALIZER_VERSION = 1;
|
|
9
9
|
var fold = /* @__PURE__ */ __name((text) => text.normalize("NFKD").replace(new RegExp("\\p{M}+", "gu"), "").normalize("NFC").toLowerCase(), "fold");
|
|
10
10
|
var normalize = /* @__PURE__ */ __name((text) => fold(text).replace(new RegExp("\\p{Cc}", "gu"), " ").replace(/\s+/gu, " ").trim(), "normalize");
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
questionTerms
|
|
5
|
+
} from "./chunk-R3EDZWXF.js";
|
|
6
|
+
import {
|
|
7
|
+
validateVector
|
|
8
|
+
} from "./chunk-XKWQDQ4B.js";
|
|
9
|
+
import {
|
|
10
|
+
meaningFloor
|
|
11
|
+
} from "./chunk-JZ65CQWK.js";
|
|
12
|
+
import {
|
|
13
|
+
RRF_K,
|
|
14
|
+
plainQuery
|
|
15
|
+
} from "./chunk-CP2TZXAG.js";
|
|
16
|
+
import {
|
|
17
|
+
MEETING_FIELD_NAMES,
|
|
18
|
+
formatMeetingReference,
|
|
19
|
+
liftMeetingFields,
|
|
20
|
+
parseMeetingReference,
|
|
21
|
+
refreshMeetingIndex
|
|
22
|
+
} from "./chunk-IE3R46YN.js";
|
|
23
|
+
import {
|
|
24
|
+
CliError
|
|
25
|
+
} from "./chunk-IBQZT2YD.js";
|
|
26
|
+
import {
|
|
27
|
+
__name
|
|
28
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
29
|
+
|
|
30
|
+
// 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/services/meeting-combined.js
|
|
31
|
+
import { createHash } from "node:crypto";
|
|
32
|
+
|
|
33
|
+
// 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/services/meeting-hit-search.js
|
|
34
|
+
var resolveMeetingSelection = /* @__PURE__ */ __name(async (store, request) => {
|
|
35
|
+
const { project, tag, topic, ...input } = request;
|
|
36
|
+
input.signal?.throwIfAborted();
|
|
37
|
+
if (project !== void 0 && input.projectId !== void 0 || [tag, topic].filter((value) => value !== void 0).length + Number(input.tagId !== void 0) > 1)
|
|
38
|
+
throw new CliError("validation_error", "choose one project selector and one tag or topic selector");
|
|
39
|
+
const selection = [];
|
|
40
|
+
const knowledge = store.knowledge;
|
|
41
|
+
if (!knowledge && [project, tag, topic].some((value) => value !== void 0))
|
|
42
|
+
throw new CliError("configuration_error", "this store cannot resolve project, tag or topic names");
|
|
43
|
+
for (const [kind, name] of [
|
|
44
|
+
["project", project],
|
|
45
|
+
["tag", tag],
|
|
46
|
+
["topic", topic]
|
|
47
|
+
]) {
|
|
48
|
+
if (name === void 0)
|
|
49
|
+
continue;
|
|
50
|
+
if (!knowledge)
|
|
51
|
+
continue;
|
|
52
|
+
const found = await knowledge.resolveVocabulary(name, { kind, signal: input.signal });
|
|
53
|
+
input.signal?.throwIfAborted();
|
|
54
|
+
if (found.ambiguous || found.matches.length !== 1)
|
|
55
|
+
throw new CliError(found.matches.length ? "validation_error" : "not_found", `the ${kind} name needs one canonical record`, {
|
|
56
|
+
candidates: found.matches.map((entry2) => ({ kind: entry2.kind, id: entry2.id, name: entry2.name }))
|
|
57
|
+
});
|
|
58
|
+
const entry = found.matches[0];
|
|
59
|
+
const id = Number(entry?.id);
|
|
60
|
+
if (!entry || entry.kind !== kind || !Number.isSafeInteger(id) || id < 1)
|
|
61
|
+
throw new CliError("invalid_response", "vocabulary resolution returned an invalid canonical record");
|
|
62
|
+
if (kind === "project")
|
|
63
|
+
input.projectId = id;
|
|
64
|
+
else
|
|
65
|
+
input.tagId = id;
|
|
66
|
+
selection.push({ kind, id, name: entry.name, by: "explicit-link" });
|
|
67
|
+
}
|
|
68
|
+
return { input, selection };
|
|
69
|
+
}, "resolveMeetingSelection");
|
|
70
|
+
var searchMeetingHits = /* @__PURE__ */ __name(async (store, query, request, options = {}) => {
|
|
71
|
+
const lifted = liftMeetingFields(plainQuery(query, MEETING_FIELD_NAMES), request);
|
|
72
|
+
const { input, selection } = await resolveMeetingSelection(store, lifted.request);
|
|
73
|
+
if (options.refreshIndex !== false)
|
|
74
|
+
await refreshMeetingIndex(store.meetings, input.accountId, input.signal);
|
|
75
|
+
const result = await store.meetings.searchHits(lifted.query, input);
|
|
76
|
+
input.signal?.throwIfAborted();
|
|
77
|
+
return { ...result, selection };
|
|
78
|
+
}, "searchMeetingHits");
|
|
79
|
+
|
|
80
|
+
// 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/services/meeting-combined.js
|
|
81
|
+
var DEPTH = 200;
|
|
82
|
+
var cursorOf = /* @__PURE__ */ __name((value, key) => {
|
|
83
|
+
if (value === void 0)
|
|
84
|
+
return 0;
|
|
85
|
+
let cursor;
|
|
86
|
+
try {
|
|
87
|
+
cursor = JSON.parse(Buffer.from(value, "base64url").toString("utf8"));
|
|
88
|
+
} catch {
|
|
89
|
+
throw new CliError("validation_error", "the cursor is not from a combined meeting search; search again");
|
|
90
|
+
}
|
|
91
|
+
if (cursor?.version !== 1 || cursor.key !== key || !Number.isSafeInteger(cursor.offset) || cursor.offset < 0)
|
|
92
|
+
throw new CliError("validation_error", "the cursor belongs to another query, filter or model; search again");
|
|
93
|
+
return cursor.offset;
|
|
94
|
+
}, "cursorOf");
|
|
95
|
+
var searchMeetingsCombined = /* @__PURE__ */ __name(async (store, embedder, typed, request) => {
|
|
96
|
+
const { maxChunks, maxRows, maxTextBytes, ...chosen } = request;
|
|
97
|
+
const { query, request: words } = liftMeetingFields(typed, chosen);
|
|
98
|
+
const { input, selection } = await resolveMeetingSelection(store, words);
|
|
99
|
+
const { after, limit = 20, maxReadBytes, ...filters } = input;
|
|
100
|
+
const terms = questionTerms(query);
|
|
101
|
+
const wordQuery = terms === null ? query : terms.join(" ");
|
|
102
|
+
const key = createHash("sha256").update(JSON.stringify([query, embedder.key, Object.entries(filters).filter(([name]) => name !== "signal")])).digest("base64url");
|
|
103
|
+
const offset = cursorOf(after, key);
|
|
104
|
+
let byWords = [];
|
|
105
|
+
let indexing = "ready";
|
|
106
|
+
let refused;
|
|
107
|
+
if (wordQuery.trim()) {
|
|
108
|
+
await refreshMeetingIndex(store.meetings, input.accountId, input.signal);
|
|
109
|
+
try {
|
|
110
|
+
const page = await store.meetings.searchHits(wordQuery, { ...filters, limit: DEPTH, maxReadBytes });
|
|
111
|
+
byWords = page.items;
|
|
112
|
+
indexing = page.coverage.indexing;
|
|
113
|
+
} catch (error) {
|
|
114
|
+
if (!(error instanceof CliError) || error.code !== "validation_error")
|
|
115
|
+
throw error;
|
|
116
|
+
refused = error.message;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
input.signal?.throwIfAborted();
|
|
120
|
+
const vectors = await embedder.embed([query], "query");
|
|
121
|
+
if (vectors.length !== 1)
|
|
122
|
+
throw new CliError("invalid_response", "Meeting query model returned another vector count");
|
|
123
|
+
const vector = vectors[0];
|
|
124
|
+
const ranked = await store.meetingVectors.ranked(embedder.key, validateVector(vector, embedder.dims), {
|
|
125
|
+
...filters,
|
|
126
|
+
limit: DEPTH,
|
|
127
|
+
...maxChunks === void 0 ? {} : { maxChunks },
|
|
128
|
+
...maxRows === void 0 ? {} : { maxRows },
|
|
129
|
+
...maxTextBytes === void 0 ? {} : { maxTextBytes }
|
|
130
|
+
});
|
|
131
|
+
const floor = meaningFloor(embedder.key);
|
|
132
|
+
const byMeaning = ranked.items.filter(({ score }) => score > floor);
|
|
133
|
+
const merged = /* @__PURE__ */ new Map();
|
|
134
|
+
byMeaning.forEach((hit, rank) => {
|
|
135
|
+
const reference = { type: "meeting", accountId: input.accountId, meetingId: hit.meetingId };
|
|
136
|
+
const first = formatMeetingReference({
|
|
137
|
+
...reference,
|
|
138
|
+
transcriptId: hit.transcriptId,
|
|
139
|
+
cuePosition: hit.firstPosition
|
|
140
|
+
});
|
|
141
|
+
merged.set(`${hit.transcriptId}:${hit.firstPosition}`, {
|
|
142
|
+
ref: first,
|
|
143
|
+
meetingId: hit.meetingId,
|
|
144
|
+
scope: "transcript",
|
|
145
|
+
text: hit.text,
|
|
146
|
+
startMs: null,
|
|
147
|
+
source: { title: hit.title, startedAt: hit.startedAt, url: null },
|
|
148
|
+
by: ["meaning"],
|
|
149
|
+
score: hit.score,
|
|
150
|
+
passage: {
|
|
151
|
+
first,
|
|
152
|
+
last: formatMeetingReference({ ...reference, transcriptId: hit.transcriptId, cuePosition: hit.lastPosition })
|
|
153
|
+
},
|
|
154
|
+
fused: 1 / (RRF_K + rank + 1)
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
byWords.forEach((hit, rank) => {
|
|
158
|
+
const share = 1 / (RRF_K + rank + 1);
|
|
159
|
+
const cue = hit.scope === "transcript" ? parseMeetingReference(hit.ref) : void 0;
|
|
160
|
+
const within = cue?.cuePosition === void 0 ? void 0 : byMeaning.find((passage) => passage.transcriptId === cue.transcriptId && passage.firstPosition <= cue.cuePosition && cue.cuePosition <= passage.lastPosition);
|
|
161
|
+
const held = within && merged.get(`${within.transcriptId}:${within.firstPosition}`);
|
|
162
|
+
const found = {
|
|
163
|
+
ref: hit.ref,
|
|
164
|
+
text: hit.text,
|
|
165
|
+
startMs: hit.startMs,
|
|
166
|
+
...hit.match === void 0 ? {} : { match: hit.match },
|
|
167
|
+
...hit.corrections === void 0 ? {} : { corrections: hit.corrections }
|
|
168
|
+
};
|
|
169
|
+
if (held && !held.by.includes("words")) {
|
|
170
|
+
Object.assign(held, found, { by: ["words", "meaning"], fused: held.fused + share });
|
|
171
|
+
if (hit.source?.url)
|
|
172
|
+
held.source.url = hit.source.url;
|
|
173
|
+
} else if (held)
|
|
174
|
+
held.fused += share;
|
|
175
|
+
else
|
|
176
|
+
merged.set(`w:${hit.ref}:${hit.scope}:${hit.id}`, {
|
|
177
|
+
...found,
|
|
178
|
+
meetingId: hit.meetingId,
|
|
179
|
+
scope: hit.scope,
|
|
180
|
+
source: {
|
|
181
|
+
title: hit.source?.title ?? null,
|
|
182
|
+
startedAt: hit.source?.startedAt ?? null,
|
|
183
|
+
url: hit.source?.url ?? null
|
|
184
|
+
},
|
|
185
|
+
by: ["words"],
|
|
186
|
+
score: null,
|
|
187
|
+
fused: share
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
const ordered = [...merged.values()].sort((a, b) => b.fused - a.fused || Number(b.by.includes("words")) - Number(a.by.includes("words")) || (b.score ?? -2) - (a.score ?? -2));
|
|
191
|
+
const items = ordered.slice(offset, offset + limit).map(({ fused: _, ...hit }) => hit);
|
|
192
|
+
const hasMore = ordered.length > offset + limit;
|
|
193
|
+
return {
|
|
194
|
+
items,
|
|
195
|
+
hasMore,
|
|
196
|
+
nextCursor: hasMore ? Buffer.from(JSON.stringify({ version: 1, key, offset: offset + limit })).toString("base64url") : null,
|
|
197
|
+
selection,
|
|
198
|
+
words: {
|
|
199
|
+
query: wordQuery,
|
|
200
|
+
...terms === null ? {} : { from: "question" },
|
|
201
|
+
...refused === void 0 ? {} : { refused }
|
|
202
|
+
},
|
|
203
|
+
model: { key: embedder.key, model: embedder.model, kind: embedder.kind, dims: embedder.dims },
|
|
204
|
+
coverage: {
|
|
205
|
+
archiveCompleteness: "unknown",
|
|
206
|
+
indexCompleteness: "unknown",
|
|
207
|
+
indexing,
|
|
208
|
+
/** Every vector of the selection was compared; false when `maxChunks` stopped the scan. */
|
|
209
|
+
meaningScanComplete: ranked.complete,
|
|
210
|
+
scanned: ranked.scanned,
|
|
211
|
+
/** Each side ranks this many at most; pages past them hold nothing more. */
|
|
212
|
+
depth: DEPTH
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
}, "searchMeetingsCombined");
|
|
216
|
+
|
|
217
|
+
export {
|
|
218
|
+
resolveMeetingSelection,
|
|
219
|
+
searchMeetingHits,
|
|
220
|
+
searchMeetingsCombined
|
|
221
|
+
};
|