@wirecat/mail-cli 0.37.0 → 0.39.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/CHANGELOG.md +47 -0
- package/README.md +9 -7
- package/contracts/wirecat.json +64 -2
- package/dist/bin/mail.js +11 -11
- package/dist/bundle/{chunk-BNURKCQG.js → chunk-BXH2YUBR.js} +33 -5
- package/dist/bundle/mail.js +4 -166
- package/dist/bundle/program-ZSF2VJI6.js +17329 -0
- package/dist/commands/account-remove.js +1 -2
- package/dist/commands/account.js +1 -1
- package/dist/commands/attachments.js +1 -2
- package/dist/commands/context.js +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/drafts-send.js +1 -2
- package/dist/commands/drafts.js +1 -2
- package/dist/commands/export.js +1 -2
- package/dist/commands/folders.js +1 -2
- package/dist/commands/import.js +1 -1
- package/dist/commands/messages.js +1 -1
- package/dist/commands/organising.js +1 -2
- package/dist/commands/read.js +2 -4
- package/dist/commands/restore.js +1 -1
- package/dist/commands/rules.js +1 -2
- package/dist/commands/send.js +1 -2
- package/dist/commands/session-start.js +1 -1
- package/dist/commands/session.js +1 -1
- package/dist/commands/stats.js +1 -1
- package/dist/commands/status.js +3 -5
- package/dist/commands/sync.js +29 -5
- package/dist/commands/tags.js +1 -2
- package/dist/config.js +1 -1
- package/dist/identity.js +27 -0
- package/dist/mail/changes.js +3 -2
- package/dist/mail/cleanup.js +3 -2
- package/dist/mail/domain-age.js +1 -1
- package/dist/mail/memo-trash.js +47 -0
- package/dist/mail/organise.js +1 -1
- package/dist/mail/save.js +1 -1
- package/dist/mail/send-as.js +66 -0
- package/dist/mail/send.js +4 -2
- package/dist/oauth.js +1 -3
- package/dist/profile.js +1 -1
- package/dist/program.js +1 -2
- package/dist/providers.js +4 -4
- package/dist/store.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
- package/dist/bin/mail.d.ts +0 -3
- package/dist/bin/mail.d.ts.map +0 -1
- package/dist/bin/mail.js.map +0 -1
- package/dist/bundle/agent-OU4K7TKQ.js +0 -40
- package/dist/bundle/all-profiles-ICGWDPUU.js +0 -320
- package/dist/bundle/anthropic-TL4WFWGU.js +0 -90
- package/dist/bundle/app-server-YAR5EFOO.js +0 -256
- package/dist/bundle/bun-OPDGMZZQ.js +0 -169
- package/dist/bundle/bun-sqlite-WI3ZPANS.js +0 -75
- package/dist/bundle/chunk-2JHVQMVC.js +0 -16
- package/dist/bundle/chunk-2XBDILVW.js +0 -53
- package/dist/bundle/chunk-2YO3PLOE.js +0 -2843
- package/dist/bundle/chunk-3DHJF57U.js +0 -690
- package/dist/bundle/chunk-3HC5F3P7.js +0 -24
- package/dist/bundle/chunk-3SKTQ2HC.js +0 -288
- package/dist/bundle/chunk-3YM4B2GT.js +0 -63
- package/dist/bundle/chunk-3ZOOTTFW.js +0 -1007
- package/dist/bundle/chunk-4FTIHADB.js +0 -259
- package/dist/bundle/chunk-4IZ6R5FS.js +0 -730
- package/dist/bundle/chunk-4N7PP76S.js +0 -6848
- package/dist/bundle/chunk-7HRKUKKY.js +0 -1068
- package/dist/bundle/chunk-7PDGZFXD.js +0 -133
- package/dist/bundle/chunk-7YKWFERX.js +0 -330
- package/dist/bundle/chunk-BNVISIHP.js +0 -95
- package/dist/bundle/chunk-BQMJYSA4.js +0 -360
- package/dist/bundle/chunk-BYITYTRL.js +0 -86
- package/dist/bundle/chunk-CICUPYHT.js +0 -106
- package/dist/bundle/chunk-CQHLWMKK.js +0 -1333
- package/dist/bundle/chunk-CUW7Y2HJ.js +0 -334
- package/dist/bundle/chunk-D72URWJE.js +0 -532
- package/dist/bundle/chunk-DFDN6AUB.js +0 -21
- package/dist/bundle/chunk-DJZIFZOT.js +0 -52
- package/dist/bundle/chunk-DNCLQPOM.js +0 -7
- package/dist/bundle/chunk-DPV53EZC.js +0 -206
- package/dist/bundle/chunk-DTR7JO2M.js +0 -794
- package/dist/bundle/chunk-ES2FF42M.js +0 -2470
- package/dist/bundle/chunk-EV72K4IU.js +0 -274
- package/dist/bundle/chunk-EZQ5BYNL.js +0 -338
- package/dist/bundle/chunk-F2D3J5DR.js +0 -188
- package/dist/bundle/chunk-FTT7UDYV.js +0 -80
- package/dist/bundle/chunk-FXNCKPQ7.js +0 -64
- package/dist/bundle/chunk-G4VJN75G.js +0 -806
- package/dist/bundle/chunk-GGMAIIVE.js +0 -38
- package/dist/bundle/chunk-GPUC3FTU.js +0 -195
- package/dist/bundle/chunk-GQIMVR7C.js +0 -3752
- package/dist/bundle/chunk-HCRUGAIN.js +0 -1024
- package/dist/bundle/chunk-HES6YMYN.js +0 -161
- package/dist/bundle/chunk-HFY7536N.js +0 -9510
- package/dist/bundle/chunk-HTQTIKWP.js +0 -928
- package/dist/bundle/chunk-IA7LLLEI.js +0 -100
- package/dist/bundle/chunk-IUJDWEGJ.js +0 -615
- package/dist/bundle/chunk-IWFWWO37.js +0 -364
- package/dist/bundle/chunk-JG6LCSEX.js +0 -407
- package/dist/bundle/chunk-JLXXUEAM.js +0 -72
- package/dist/bundle/chunk-JNP3XGJI.js +0 -559
- package/dist/bundle/chunk-JZUYZ2XJ.js +0 -2076
- package/dist/bundle/chunk-K4DEQAEW.js +0 -1291
- package/dist/bundle/chunk-KCM3WSER.js +0 -388
- package/dist/bundle/chunk-KP5JDYY6.js +0 -2669
- package/dist/bundle/chunk-KUX54EGR.js +0 -40792
- package/dist/bundle/chunk-KXJ3JEDH.js +0 -2
- package/dist/bundle/chunk-KZD3H5QA.js +0 -108
- package/dist/bundle/chunk-LKH3UKLO.js +0 -230
- package/dist/bundle/chunk-NAOLBEFX.js +0 -12142
- package/dist/bundle/chunk-NB52JKLR.js +0 -323
- package/dist/bundle/chunk-NB7EOAUZ.js +0 -123
- package/dist/bundle/chunk-NISH4UXM.js +0 -58
- package/dist/bundle/chunk-NQSKI7XK.js +0 -52
- package/dist/bundle/chunk-OWPRJLHV.js +0 -353
- package/dist/bundle/chunk-OZKZT3ZI.js +0 -79
- package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
- package/dist/bundle/chunk-Q7ICVP25.js +0 -18
- package/dist/bundle/chunk-QLJGYDWG.js +0 -1197
- package/dist/bundle/chunk-R44KVISE.js +0 -218
- package/dist/bundle/chunk-R73VWPNL.js +0 -192
- package/dist/bundle/chunk-RRTMPSQR.js +0 -29
- package/dist/bundle/chunk-S6JG4YUH.js +0 -72
- package/dist/bundle/chunk-TMJLGR4A.js +0 -4070
- package/dist/bundle/chunk-TXDR6YSF.js +0 -23
- package/dist/bundle/chunk-TY7NDMFY.js +0 -46
- package/dist/bundle/chunk-UDSL3MUU.js +0 -2333
- package/dist/bundle/chunk-UTS5NMR3.js +0 -54
- package/dist/bundle/chunk-VB7FZOYX.js +0 -633
- package/dist/bundle/chunk-VK24UQSD.js +0 -142
- package/dist/bundle/chunk-VYCB5EVI.js +0 -721
- package/dist/bundle/chunk-VZ5PPYDG.js +0 -77
- package/dist/bundle/chunk-WOPVBRPV.js +0 -29
- package/dist/bundle/chunk-XEQQJBBO.js +0 -92
- package/dist/bundle/chunk-XQUUANA2.js +0 -24600
- package/dist/bundle/chunk-XWBTD2WP.js +0 -76
- package/dist/bundle/chunk-XXPJF2VD.js +0 -2
- package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
- package/dist/bundle/chunk-YODGIMMM.js +0 -185
- package/dist/bundle/chunk-YWDFYQOU.js +0 -82
- package/dist/bundle/chunk-Z4BLNAWI.js +0 -67228
- package/dist/bundle/chunk-ZSAPOC7B.js +0 -1247
- package/dist/bundle/chunk-ZTWTEXB2.js +0 -170
- package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
- package/dist/bundle/command-contract-UC6IGCCM.js +0 -39
- package/dist/bundle/command-server-entry-RA3ZX2KV.js +0 -168
- package/dist/bundle/decode-QVKRSRVF.js +0 -296
- package/dist/bundle/dispatch-USKS7J74.js +0 -411
- package/dist/bundle/dist-HFUVURJG.js +0 -7577
- package/dist/bundle/dist-ITIXJAXK.js +0 -317
- package/dist/bundle/dist-PAKDDIBT.js +0 -191
- package/dist/bundle/echarts-O3TNDAXJ.js +0 -42501
- package/dist/bundle/embed-2HOODFQT.js +0 -37
- package/dist/bundle/embedder-22AJGCZX.js +0 -110
- package/dist/bundle/failure-D4FGOIWF.js +0 -24
- package/dist/bundle/first-run-FU4MFXOA.js +0 -28
- package/dist/bundle/first-screen-A7SEI2ON.js +0 -40
- package/dist/bundle/instructions-AMH5RWVJ.js +0 -11
- package/dist/bundle/mcp-5HFPWC3W.js +0 -167
- package/dist/bundle/meeting-combined-KC6YGWA7.js +0 -24
- package/dist/bundle/meeting-model-QWGAOQHL.js +0 -24
- package/dist/bundle/meeting-semantic-7PVO6RNB.js +0 -21
- package/dist/bundle/node-EGMCBAO7.js +0 -176
- package/dist/bundle/node-KM3CUABH.js +0 -2340
- package/dist/bundle/node-TLZSIHIJ.js +0 -21
- package/dist/bundle/node-sqlite-JXUELLMP.js +0 -73
- package/dist/bundle/oauth-OYAYWH4K.js +0 -19
- package/dist/bundle/open-GLEUJGNA.js +0 -22
- package/dist/bundle/openai-PYTVNB6L.js +0 -237
- package/dist/bundle/process-SGHEN6MQ.js +0 -91
- package/dist/bundle/program-7CFNZ2DF.js +0 -51701
- package/dist/bundle/prompt-CYTILD7N.js +0 -16
- package/dist/bundle/public-XWMXEGEF.js +0 -196
- package/dist/bundle/recognize-26UNETSQ.js +0 -25
- package/dist/bundle/remote-PKXBQA5N.js +0 -30
- package/dist/bundle/rerank-LLKP7M6Q.js +0 -51
- package/dist/bundle/serve-ZRJEAPJI.js +0 -198
- package/dist/bundle/server-4OQ4G5JY.js +0 -218
- package/dist/bundle/server-VVRQ4A34.js +0 -86
- package/dist/bundle/sqlite-runtime-667VV4VY.js +0 -19
- package/dist/bundle/state-V3CAAJBE.js +0 -35
- package/dist/bundle/store-BJCIMIAH.js +0 -302
- package/dist/bundle/store-GLBBY4OZ.js +0 -184
- package/dist/bundle/store-maintenance-command-N7L5OVUE.js +0 -73
- package/dist/bundle/surface-26EUQNDT.js +0 -72
- package/dist/commands/account-remove.d.ts +0 -3
- package/dist/commands/account-remove.d.ts.map +0 -1
- package/dist/commands/account-remove.js.map +0 -1
- package/dist/commands/account.d.ts +0 -3
- package/dist/commands/account.d.ts.map +0 -1
- package/dist/commands/account.js.map +0 -1
- package/dist/commands/attachments.d.ts +0 -3
- package/dist/commands/attachments.d.ts.map +0 -1
- package/dist/commands/attachments.js.map +0 -1
- package/dist/commands/context.d.ts +0 -79
- package/dist/commands/context.d.ts.map +0 -1
- package/dist/commands/context.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -68
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/drafts-send.d.ts +0 -7
- package/dist/commands/drafts-send.d.ts.map +0 -1
- package/dist/commands/drafts-send.js.map +0 -1
- package/dist/commands/drafts.d.ts +0 -3
- package/dist/commands/drafts.d.ts.map +0 -1
- package/dist/commands/drafts.js.map +0 -1
- package/dist/commands/export.d.ts +0 -3
- package/dist/commands/export.d.ts.map +0 -1
- package/dist/commands/export.js.map +0 -1
- package/dist/commands/folders.d.ts +0 -3
- package/dist/commands/folders.d.ts.map +0 -1
- package/dist/commands/folders.js.map +0 -1
- package/dist/commands/import.d.ts +0 -3
- package/dist/commands/import.d.ts.map +0 -1
- package/dist/commands/import.js.map +0 -1
- package/dist/commands/login.d.ts +0 -5
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/mailbox.d.ts +0 -17
- package/dist/commands/mailbox.d.ts.map +0 -1
- package/dist/commands/mailbox.js.map +0 -1
- package/dist/commands/messages.d.ts +0 -4
- package/dist/commands/messages.d.ts.map +0 -1
- package/dist/commands/messages.js.map +0 -1
- package/dist/commands/organising.d.ts +0 -98
- package/dist/commands/organising.d.ts.map +0 -1
- package/dist/commands/organising.js.map +0 -1
- package/dist/commands/read.d.ts +0 -6
- package/dist/commands/read.d.ts.map +0 -1
- package/dist/commands/read.js.map +0 -1
- package/dist/commands/restore.d.ts +0 -3
- package/dist/commands/restore.d.ts.map +0 -1
- package/dist/commands/restore.js.map +0 -1
- package/dist/commands/rules.d.ts +0 -3
- package/dist/commands/rules.d.ts.map +0 -1
- package/dist/commands/rules.js.map +0 -1
- package/dist/commands/send.d.ts +0 -51
- package/dist/commands/send.d.ts.map +0 -1
- package/dist/commands/send.js.map +0 -1
- package/dist/commands/server-search.d.ts +0 -8
- package/dist/commands/server-search.d.ts.map +0 -1
- package/dist/commands/server-search.js.map +0 -1
- package/dist/commands/session-start.d.ts +0 -3
- package/dist/commands/session-start.d.ts.map +0 -1
- package/dist/commands/session-start.js.map +0 -1
- package/dist/commands/session.d.ts +0 -3
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/stats.d.ts +0 -3
- package/dist/commands/stats.d.ts.map +0 -1
- package/dist/commands/stats.js.map +0 -1
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/sync.d.ts +0 -11
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js.map +0 -1
- package/dist/commands/tags.d.ts +0 -3
- package/dist/commands/tags.d.ts.map +0 -1
- package/dist/commands/tags.js.map +0 -1
- package/dist/commands/words.d.ts +0 -8
- package/dist/commands/words.d.ts.map +0 -1
- package/dist/commands/words.js.map +0 -1
- package/dist/config.d.ts +0 -239
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/discovery.d.ts +0 -31
- package/dist/discovery.d.ts.map +0 -1
- package/dist/discovery.js.map +0 -1
- package/dist/export/format.d.ts +0 -19
- package/dist/export/format.d.ts.map +0 -1
- package/dist/export/format.js.map +0 -1
- package/dist/export/journal.d.ts +0 -34
- package/dist/export/journal.d.ts.map +0 -1
- package/dist/export/journal.js.map +0 -1
- package/dist/export/write.d.ts +0 -14
- package/dist/export/write.d.ts.map +0 -1
- package/dist/export/write.js.map +0 -1
- package/dist/identity.d.ts +0 -7
- package/dist/identity.d.ts.map +0 -1
- package/dist/identity.js.map +0 -1
- package/dist/mail/backend.d.ts +0 -138
- package/dist/mail/backend.d.ts.map +0 -1
- package/dist/mail/backend.js.map +0 -1
- package/dist/mail/changes.d.ts +0 -99
- package/dist/mail/changes.d.ts.map +0 -1
- package/dist/mail/changes.js.map +0 -1
- package/dist/mail/cleanup.d.ts +0 -41
- package/dist/mail/cleanup.d.ts.map +0 -1
- package/dist/mail/cleanup.js.map +0 -1
- package/dist/mail/compose.d.ts +0 -75
- package/dist/mail/compose.d.ts.map +0 -1
- package/dist/mail/compose.js.map +0 -1
- package/dist/mail/domain-age.d.ts +0 -29
- package/dist/mail/domain-age.d.ts.map +0 -1
- package/dist/mail/domain-age.js.map +0 -1
- package/dist/mail/drafts.d.ts +0 -54
- package/dist/mail/drafts.d.ts.map +0 -1
- package/dist/mail/drafts.js.map +0 -1
- package/dist/mail/imap/account.d.ts +0 -5
- package/dist/mail/imap/account.d.ts.map +0 -1
- package/dist/mail/imap/account.js.map +0 -1
- package/dist/mail/imap/connection.d.ts +0 -72
- package/dist/mail/imap/connection.d.ts.map +0 -1
- package/dist/mail/imap/connection.js.map +0 -1
- package/dist/mail/imap/errors.d.ts +0 -11
- package/dist/mail/imap/errors.d.ts.map +0 -1
- package/dist/mail/imap/errors.js.map +0 -1
- package/dist/mail/imap/index.d.ts +0 -7
- package/dist/mail/imap/index.d.ts.map +0 -1
- package/dist/mail/imap/index.js.map +0 -1
- package/dist/mail/imap/messages.d.ts +0 -17
- package/dist/mail/imap/messages.d.ts.map +0 -1
- package/dist/mail/imap/messages.js.map +0 -1
- package/dist/mail/imap/read.d.ts +0 -7
- package/dist/mail/imap/read.d.ts.map +0 -1
- package/dist/mail/imap/read.js.map +0 -1
- package/dist/mail/imap/search.d.ts +0 -19
- package/dist/mail/imap/search.d.ts.map +0 -1
- package/dist/mail/imap/search.js.map +0 -1
- package/dist/mail/imap/write.d.ts +0 -5
- package/dist/mail/imap/write.d.ts.map +0 -1
- package/dist/mail/imap/write.js.map +0 -1
- package/dist/mail/locate.d.ts +0 -32
- package/dist/mail/locate.d.ts.map +0 -1
- package/dist/mail/locate.js.map +0 -1
- package/dist/mail/mbox.d.ts +0 -9
- package/dist/mail/mbox.d.ts.map +0 -1
- package/dist/mail/mbox.js.map +0 -1
- package/dist/mail/organise.d.ts +0 -101
- package/dist/mail/organise.d.ts.map +0 -1
- package/dist/mail/organise.js.map +0 -1
- package/dist/mail/restore.d.ts +0 -22
- package/dist/mail/restore.d.ts.map +0 -1
- package/dist/mail/restore.js.map +0 -1
- package/dist/mail/rethread.d.ts +0 -14
- package/dist/mail/rethread.d.ts.map +0 -1
- package/dist/mail/rethread.js.map +0 -1
- package/dist/mail/rules/apply.d.ts +0 -48
- package/dist/mail/rules/apply.d.ts.map +0 -1
- package/dist/mail/rules/apply.js.map +0 -1
- package/dist/mail/rules/file.d.ts +0 -9
- package/dist/mail/rules/file.d.ts.map +0 -1
- package/dist/mail/rules/file.js.map +0 -1
- package/dist/mail/rules/filters.d.ts +0 -11
- package/dist/mail/rules/filters.d.ts.map +0 -1
- package/dist/mail/rules/filters.js.map +0 -1
- package/dist/mail/rules/folders.d.ts +0 -11
- package/dist/mail/rules/folders.d.ts.map +0 -1
- package/dist/mail/rules/folders.js.map +0 -1
- package/dist/mail/rules/query.d.ts +0 -16
- package/dist/mail/rules/query.d.ts.map +0 -1
- package/dist/mail/rules/query.js.map +0 -1
- package/dist/mail/rules/store.d.ts +0 -9
- package/dist/mail/rules/store.d.ts.map +0 -1
- package/dist/mail/rules/store.js.map +0 -1
- package/dist/mail/save.d.ts +0 -9
- package/dist/mail/save.d.ts.map +0 -1
- package/dist/mail/save.js.map +0 -1
- package/dist/mail/send.d.ts +0 -76
- package/dist/mail/send.d.ts.map +0 -1
- package/dist/mail/send.js.map +0 -1
- package/dist/mail/smtp.d.ts +0 -4
- package/dist/mail/smtp.d.ts.map +0 -1
- package/dist/mail/smtp.js.map +0 -1
- package/dist/oauth.d.ts +0 -75
- package/dist/oauth.d.ts.map +0 -1
- package/dist/oauth.js.map +0 -1
- package/dist/profile.d.ts +0 -20
- package/dist/profile.d.ts.map +0 -1
- package/dist/profile.js.map +0 -1
- package/dist/program.d.ts +0 -6
- package/dist/program.d.ts.map +0 -1
- package/dist/program.js.map +0 -1
- package/dist/providers.d.ts +0 -255
- package/dist/providers.d.ts.map +0 -1
- package/dist/providers.js.map +0 -1
- package/dist/reasons.d.ts +0 -9
- package/dist/reasons.d.ts.map +0 -1
- package/dist/reasons.js.map +0 -1
- package/dist/secret.d.ts +0 -31
- package/dist/secret.d.ts.map +0 -1
- package/dist/secret.js.map +0 -1
- package/dist/store.d.ts +0 -12
- package/dist/store.d.ts.map +0 -1
- package/dist/store.js.map +0 -1
- package/dist/version.d.ts +0 -2
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js.map +0 -1
- package/dist/wcat.d.ts +0 -3
- package/dist/wcat.d.ts.map +0 -1
- package/dist/wcat.js.map +0 -1
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
pasteHint,
|
|
5
|
-
readSecret
|
|
6
|
-
} from "./chunk-IA7LLLEI.js";
|
|
7
|
-
import "./chunk-YWDFYQOU.js";
|
|
8
|
-
import "./chunk-2YO3PLOE.js";
|
|
9
|
-
import "./chunk-KP5JDYY6.js";
|
|
10
|
-
import "./chunk-Y5E2WNWB.js";
|
|
11
|
-
import "./chunk-S6JG4YUH.js";
|
|
12
|
-
import "./chunk-ZVVMGPBJ.js";
|
|
13
|
-
export {
|
|
14
|
-
pasteHint,
|
|
15
|
-
readSecret
|
|
16
|
-
};
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import "./chunk-XXPJF2VD.js";
|
|
4
|
-
import {
|
|
5
|
-
QUICK_HEALTH_CHECKS,
|
|
6
|
-
applyDocumentTransfer,
|
|
7
|
-
previewDocumentTransfer,
|
|
8
|
-
previewProjectAnnotationSnapshot,
|
|
9
|
-
snapshotProjectAnnotations,
|
|
10
|
-
storeDamageReport,
|
|
11
|
-
storeHealth
|
|
12
|
-
} from "./chunk-7HRKUKKY.js";
|
|
13
|
-
import {
|
|
14
|
-
note
|
|
15
|
-
} from "./chunk-FXNCKPQ7.js";
|
|
16
|
-
import {
|
|
17
|
-
CALLBACK_PREFIX,
|
|
18
|
-
DECISION_ACTIONS,
|
|
19
|
-
DECISION_TTL_MS,
|
|
20
|
-
DEFAULT_DECISION_POLICY,
|
|
21
|
-
EVIDENCE_FINDINGS_KIND,
|
|
22
|
-
IDENTITY_LINK_KIND,
|
|
23
|
-
IDENTITY_LINK_SIGNALS,
|
|
24
|
-
IDENTITY_SPLIT_KIND,
|
|
25
|
-
LINK_WEAKNESSES,
|
|
26
|
-
MAIL_FINDINGS_KIND,
|
|
27
|
-
MIGRATIONS,
|
|
28
|
-
ORGANIZATIONS_QUERY,
|
|
29
|
-
PERSON_KINDS,
|
|
30
|
-
PROJECTS_QUERY,
|
|
31
|
-
PROJECT_ANNOTATIONS_MAX_BYTES,
|
|
32
|
-
REMINDERS_QUERY,
|
|
33
|
-
assertMayDecide,
|
|
34
|
-
callbackDataOf,
|
|
35
|
-
createTagRedirectIndex,
|
|
36
|
-
decodeProjectAnnotationSnapshot,
|
|
37
|
-
decodeProjectAnnotations,
|
|
38
|
-
isDecisionToken,
|
|
39
|
-
isOwnerOnlyKind,
|
|
40
|
-
mayDecide,
|
|
41
|
-
migrate,
|
|
42
|
-
openStore,
|
|
43
|
-
parseCallbackData,
|
|
44
|
-
planProjectAnnotationSnapshot,
|
|
45
|
-
planProjectAnnotations,
|
|
46
|
-
projectAnnotationSnapshotFingerprint,
|
|
47
|
-
projectAnnotationSnapshotSchema,
|
|
48
|
-
projectAnnotationsFingerprint,
|
|
49
|
-
registerProvider,
|
|
50
|
-
validateEvidenceFindings
|
|
51
|
-
} from "./chunk-Z4BLNAWI.js";
|
|
52
|
-
import "./chunk-JZUYZ2XJ.js";
|
|
53
|
-
import "./chunk-UDSL3MUU.js";
|
|
54
|
-
import "./chunk-FTT7UDYV.js";
|
|
55
|
-
import "./chunk-VYCB5EVI.js";
|
|
56
|
-
import "./chunk-OZKZT3ZI.js";
|
|
57
|
-
import "./chunk-2JHVQMVC.js";
|
|
58
|
-
import {
|
|
59
|
-
CLOSED_STATES,
|
|
60
|
-
FACT_STATUSES,
|
|
61
|
-
MEMORY_KINDS,
|
|
62
|
-
MEMORY_SCOPES,
|
|
63
|
-
MEMORY_STATUSES,
|
|
64
|
-
PRIORITY_LABELS,
|
|
65
|
-
SOURCE_REVIEW_CAUSES,
|
|
66
|
-
SOURCE_REVIEW_KIND,
|
|
67
|
-
TASK_STATES,
|
|
68
|
-
TASK_TYPES,
|
|
69
|
-
WORK_TASK_TYPES,
|
|
70
|
-
clearDamageMark,
|
|
71
|
-
damageMarkPath,
|
|
72
|
-
healthMarkPath,
|
|
73
|
-
isClosedState,
|
|
74
|
-
journalMarkPath,
|
|
75
|
-
markStoreDamaged,
|
|
76
|
-
organization,
|
|
77
|
-
priorityLabel,
|
|
78
|
-
priorityOf,
|
|
79
|
-
priorityOption,
|
|
80
|
-
project,
|
|
81
|
-
readDamageMark,
|
|
82
|
-
readHealthMark,
|
|
83
|
-
readJournalMark,
|
|
84
|
-
recordDeepCheck,
|
|
85
|
-
reminder
|
|
86
|
-
} from "./chunk-K4DEQAEW.js";
|
|
87
|
-
import {
|
|
88
|
-
BUSINESS_KINDS
|
|
89
|
-
} from "./chunk-G4VJN75G.js";
|
|
90
|
-
import "./chunk-JLXXUEAM.js";
|
|
91
|
-
import "./chunk-XEQQJBBO.js";
|
|
92
|
-
import "./chunk-RRTMPSQR.js";
|
|
93
|
-
import {
|
|
94
|
-
FACT_TYPES,
|
|
95
|
-
PAYMENT_DIRECTIONS,
|
|
96
|
-
PAYMENT_STATES,
|
|
97
|
-
paymentTitle,
|
|
98
|
-
validatePayment
|
|
99
|
-
} from "./chunk-TMJLGR4A.js";
|
|
100
|
-
import "./chunk-QLJGYDWG.js";
|
|
101
|
-
import "./chunk-DNCLQPOM.js";
|
|
102
|
-
import {
|
|
103
|
-
storePath
|
|
104
|
-
} from "./chunk-UTS5NMR3.js";
|
|
105
|
-
import {
|
|
106
|
-
openCache
|
|
107
|
-
} from "./chunk-BNVISIHP.js";
|
|
108
|
-
import {
|
|
109
|
-
PRAGMAS
|
|
110
|
-
} from "./chunk-GGMAIIVE.js";
|
|
111
|
-
import "./chunk-2YO3PLOE.js";
|
|
112
|
-
import "./chunk-KP5JDYY6.js";
|
|
113
|
-
import "./chunk-Y5E2WNWB.js";
|
|
114
|
-
import "./chunk-S6JG4YUH.js";
|
|
115
|
-
import "./chunk-4N7PP76S.js";
|
|
116
|
-
import "./chunk-ZVVMGPBJ.js";
|
|
117
|
-
export {
|
|
118
|
-
BUSINESS_KINDS,
|
|
119
|
-
CALLBACK_PREFIX,
|
|
120
|
-
CLOSED_STATES,
|
|
121
|
-
DECISION_ACTIONS,
|
|
122
|
-
DECISION_TTL_MS,
|
|
123
|
-
DEFAULT_DECISION_POLICY,
|
|
124
|
-
EVIDENCE_FINDINGS_KIND,
|
|
125
|
-
FACT_STATUSES,
|
|
126
|
-
FACT_TYPES,
|
|
127
|
-
IDENTITY_LINK_KIND,
|
|
128
|
-
IDENTITY_LINK_SIGNALS,
|
|
129
|
-
IDENTITY_SPLIT_KIND,
|
|
130
|
-
LINK_WEAKNESSES,
|
|
131
|
-
MAIL_FINDINGS_KIND,
|
|
132
|
-
MEMORY_KINDS,
|
|
133
|
-
MEMORY_SCOPES,
|
|
134
|
-
MEMORY_STATUSES,
|
|
135
|
-
MIGRATIONS,
|
|
136
|
-
ORGANIZATIONS_QUERY,
|
|
137
|
-
PAYMENT_DIRECTIONS,
|
|
138
|
-
PAYMENT_STATES,
|
|
139
|
-
PERSON_KINDS,
|
|
140
|
-
PRAGMAS,
|
|
141
|
-
PRIORITY_LABELS,
|
|
142
|
-
PROJECTS_QUERY,
|
|
143
|
-
PROJECT_ANNOTATIONS_MAX_BYTES,
|
|
144
|
-
QUICK_HEALTH_CHECKS,
|
|
145
|
-
REMINDERS_QUERY,
|
|
146
|
-
SOURCE_REVIEW_CAUSES,
|
|
147
|
-
SOURCE_REVIEW_KIND,
|
|
148
|
-
TASK_STATES,
|
|
149
|
-
TASK_TYPES,
|
|
150
|
-
WORK_TASK_TYPES,
|
|
151
|
-
applyDocumentTransfer,
|
|
152
|
-
assertMayDecide,
|
|
153
|
-
callbackDataOf,
|
|
154
|
-
clearDamageMark,
|
|
155
|
-
createTagRedirectIndex,
|
|
156
|
-
damageMarkPath,
|
|
157
|
-
decodeProjectAnnotationSnapshot,
|
|
158
|
-
decodeProjectAnnotations,
|
|
159
|
-
healthMarkPath,
|
|
160
|
-
isClosedState,
|
|
161
|
-
isDecisionToken,
|
|
162
|
-
isOwnerOnlyKind,
|
|
163
|
-
journalMarkPath,
|
|
164
|
-
markStoreDamaged,
|
|
165
|
-
mayDecide,
|
|
166
|
-
migrate,
|
|
167
|
-
note,
|
|
168
|
-
openCache,
|
|
169
|
-
openStore,
|
|
170
|
-
organization,
|
|
171
|
-
parseCallbackData,
|
|
172
|
-
paymentTitle,
|
|
173
|
-
planProjectAnnotationSnapshot,
|
|
174
|
-
planProjectAnnotations,
|
|
175
|
-
previewDocumentTransfer,
|
|
176
|
-
previewProjectAnnotationSnapshot,
|
|
177
|
-
priorityLabel,
|
|
178
|
-
priorityOf,
|
|
179
|
-
priorityOption,
|
|
180
|
-
project,
|
|
181
|
-
projectAnnotationSnapshotFingerprint,
|
|
182
|
-
projectAnnotationSnapshotSchema,
|
|
183
|
-
projectAnnotationsFingerprint,
|
|
184
|
-
readDamageMark,
|
|
185
|
-
readHealthMark,
|
|
186
|
-
readJournalMark,
|
|
187
|
-
recordDeepCheck,
|
|
188
|
-
registerProvider,
|
|
189
|
-
reminder,
|
|
190
|
-
snapshotProjectAnnotations,
|
|
191
|
-
storeDamageReport,
|
|
192
|
-
storeHealth,
|
|
193
|
-
storePath,
|
|
194
|
-
validateEvidenceFindings,
|
|
195
|
-
validatePayment
|
|
196
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
SAMPLE_RATE,
|
|
5
|
-
decodeOgg,
|
|
6
|
-
detector,
|
|
7
|
-
loadSherpa,
|
|
8
|
-
openRecognizer,
|
|
9
|
-
openSpeechCutter,
|
|
10
|
-
toModelRate
|
|
11
|
-
} from "./chunk-LKH3UKLO.js";
|
|
12
|
-
import "./chunk-2YO3PLOE.js";
|
|
13
|
-
import "./chunk-KP5JDYY6.js";
|
|
14
|
-
import "./chunk-Y5E2WNWB.js";
|
|
15
|
-
import "./chunk-S6JG4YUH.js";
|
|
16
|
-
import "./chunk-ZVVMGPBJ.js";
|
|
17
|
-
export {
|
|
18
|
-
SAMPLE_RATE,
|
|
19
|
-
decodeOgg,
|
|
20
|
-
detector,
|
|
21
|
-
loadSherpa,
|
|
22
|
-
openRecognizer,
|
|
23
|
-
openSpeechCutter,
|
|
24
|
-
toModelRate
|
|
25
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
DEFAULT_OPENAI_MODEL,
|
|
5
|
-
OPENAI_MODELS,
|
|
6
|
-
OPENAI_URL,
|
|
7
|
-
isLocal,
|
|
8
|
-
openRemote,
|
|
9
|
-
remoteKey,
|
|
10
|
-
remoteModel
|
|
11
|
-
} from "./chunk-YODGIMMM.js";
|
|
12
|
-
import "./chunk-7YKWFERX.js";
|
|
13
|
-
import "./chunk-QLJGYDWG.js";
|
|
14
|
-
import "./chunk-3ZOOTTFW.js";
|
|
15
|
-
import "./chunk-EV72K4IU.js";
|
|
16
|
-
import "./chunk-UTS5NMR3.js";
|
|
17
|
-
import "./chunk-2YO3PLOE.js";
|
|
18
|
-
import "./chunk-KP5JDYY6.js";
|
|
19
|
-
import "./chunk-Y5E2WNWB.js";
|
|
20
|
-
import "./chunk-S6JG4YUH.js";
|
|
21
|
-
import "./chunk-ZVVMGPBJ.js";
|
|
22
|
-
export {
|
|
23
|
-
DEFAULT_OPENAI_MODEL,
|
|
24
|
-
OPENAI_MODELS,
|
|
25
|
-
OPENAI_URL,
|
|
26
|
-
isLocal,
|
|
27
|
-
openRemote,
|
|
28
|
-
remoteKey,
|
|
29
|
-
remoteModel
|
|
30
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
defaultThreads,
|
|
5
|
-
loadModel,
|
|
6
|
-
truncated
|
|
7
|
-
} from "./chunk-3ZOOTTFW.js";
|
|
8
|
-
import "./chunk-EV72K4IU.js";
|
|
9
|
-
import "./chunk-UTS5NMR3.js";
|
|
10
|
-
import "./chunk-2YO3PLOE.js";
|
|
11
|
-
import "./chunk-KP5JDYY6.js";
|
|
12
|
-
import "./chunk-Y5E2WNWB.js";
|
|
13
|
-
import "./chunk-S6JG4YUH.js";
|
|
14
|
-
import {
|
|
15
|
-
__name
|
|
16
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
17
|
-
|
|
18
|
-
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/embeddings/rerank.js
|
|
19
|
-
var openReranker = /* @__PURE__ */ __name(async (model, directory, { threads = defaultThreads() } = {}) => {
|
|
20
|
-
const { ort, tokenizer, session } = await loadModel(model, directory, threads);
|
|
21
|
-
const typeIds = session.inputNames.includes("token_type_ids");
|
|
22
|
-
const output = session.outputNames[0];
|
|
23
|
-
const one = /* @__PURE__ */ __name(async (question, passage) => {
|
|
24
|
-
const encoded = tokenizer.encode(question, { text_pair: passage, return_token_type_ids: true });
|
|
25
|
-
const ids = truncated(encoded.ids, model.maxTokens);
|
|
26
|
-
const shape = [1, ids.length];
|
|
27
|
-
const feeds = {
|
|
28
|
-
input_ids: new ort.Tensor("int64", BigInt64Array.from(ids, BigInt), shape),
|
|
29
|
-
attention_mask: new ort.Tensor("int64", new BigInt64Array(ids.length).fill(1n), shape)
|
|
30
|
-
};
|
|
31
|
-
if (typeIds)
|
|
32
|
-
feeds.token_type_ids = new ort.Tensor("int64", BigInt64Array.from(truncated(encoded.token_type_ids, model.maxTokens), BigInt), shape);
|
|
33
|
-
const logit = (await session.run(feeds))[output]?.data[0];
|
|
34
|
-
if (typeof logit !== "number" || !Number.isFinite(logit))
|
|
35
|
-
throw new Error(`${model.id} gave no score`);
|
|
36
|
-
return logit;
|
|
37
|
-
}, "one");
|
|
38
|
-
return {
|
|
39
|
-
model,
|
|
40
|
-
score: /* @__PURE__ */ __name(async (question, passages) => {
|
|
41
|
-
const scores = [];
|
|
42
|
-
for (const passage of passages)
|
|
43
|
-
scores.push(await one(question, passage));
|
|
44
|
-
return scores;
|
|
45
|
-
}, "score"),
|
|
46
|
-
close: /* @__PURE__ */ __name(() => session.release(), "close")
|
|
47
|
-
};
|
|
48
|
-
}, "openReranker");
|
|
49
|
-
export {
|
|
50
|
-
openReranker
|
|
51
|
-
};
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
listen
|
|
5
|
-
} from "./chunk-VZ5PPYDG.js";
|
|
6
|
-
import {
|
|
7
|
-
ownerLogin
|
|
8
|
-
} from "./chunk-3SKTQ2HC.js";
|
|
9
|
-
import {
|
|
10
|
-
WebStandardStreamableHTTPServerTransport,
|
|
11
|
-
createMcpHandler,
|
|
12
|
-
getOAuthProtectedResourceMetadataUrl,
|
|
13
|
-
hostHeaderValidationResponse,
|
|
14
|
-
isLegacyRequest,
|
|
15
|
-
oauthMetadataResponse,
|
|
16
|
-
requireBearerAuth
|
|
17
|
-
} from "./chunk-PL5P7UKW.js";
|
|
18
|
-
import {
|
|
19
|
-
activityRecorder,
|
|
20
|
-
calledTools,
|
|
21
|
-
httpActivityFile,
|
|
22
|
-
httpLock
|
|
23
|
-
} from "./chunk-HES6YMYN.js";
|
|
24
|
-
import "./chunk-BYITYTRL.js";
|
|
25
|
-
import "./chunk-3YM4B2GT.js";
|
|
26
|
-
import "./chunk-2YO3PLOE.js";
|
|
27
|
-
import "./chunk-KP5JDYY6.js";
|
|
28
|
-
import "./chunk-Y5E2WNWB.js";
|
|
29
|
-
import {
|
|
30
|
-
CliError
|
|
31
|
-
} from "./chunk-S6JG4YUH.js";
|
|
32
|
-
import {
|
|
33
|
-
__name
|
|
34
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
35
|
-
|
|
36
|
-
// node_modules/.pnpm/@wirecat+cli-core@1.0.0_@wirecat+cli-base@1.0.0_commander@15.0.0_esbuild@0.28.2_typescr_dd5172c52281f8f1e2dd1d4e9555d5c3/node_modules/@wirecat/cli-core/dist/mcp/http/serve.js
|
|
37
|
-
import { randomUUID } from "node:crypto";
|
|
38
|
-
var MCP_PATH = "/mcp";
|
|
39
|
-
var AS_METADATA = "/.well-known/oauth-authorization-server";
|
|
40
|
-
var LOCAL = ["localhost", "127.0.0.1"];
|
|
41
|
-
var MAX_SESSIONS = 20;
|
|
42
|
-
var MAX_LOGIN_BODY = 64 * 1024;
|
|
43
|
-
var SESSION_IDLE_MS = 60 * 60 * 1e3;
|
|
44
|
-
var sessionMissing = /* @__PURE__ */ __name(() => new Response(JSON.stringify({ jsonrpc: "2.0", error: { code: -32001, message: "Session not found" }, id: null }), {
|
|
45
|
-
status: 404,
|
|
46
|
-
headers: { "content-type": "application/json" }
|
|
47
|
-
}), "sessionMissing");
|
|
48
|
-
var legacySessions = /* @__PURE__ */ __name((build, now) => {
|
|
49
|
-
const sessions = /* @__PURE__ */ new Map();
|
|
50
|
-
const drop = /* @__PURE__ */ __name(async (id) => {
|
|
51
|
-
const one = sessions.get(id);
|
|
52
|
-
sessions.delete(id);
|
|
53
|
-
await one?.close();
|
|
54
|
-
}, "drop");
|
|
55
|
-
const handle = /* @__PURE__ */ __name(async (request, auth) => {
|
|
56
|
-
for (const [id2, one] of sessions)
|
|
57
|
-
if (now() - one.seen > SESSION_IDLE_MS)
|
|
58
|
-
await drop(id2);
|
|
59
|
-
const id = request.headers.get("mcp-session-id");
|
|
60
|
-
if (id) {
|
|
61
|
-
const known = sessions.get(id);
|
|
62
|
-
if (!known || known.clientId !== auth.clientId)
|
|
63
|
-
return sessionMissing();
|
|
64
|
-
known.seen = now();
|
|
65
|
-
return known.transport.handleRequest(request, { authInfo: auth });
|
|
66
|
-
}
|
|
67
|
-
const server = build();
|
|
68
|
-
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
69
|
-
sessionIdGenerator: /* @__PURE__ */ __name(() => randomUUID(), "sessionIdGenerator"),
|
|
70
|
-
onsessionclosed: /* @__PURE__ */ __name((closed) => void sessions.delete(closed), "onsessionclosed")
|
|
71
|
-
});
|
|
72
|
-
await server.connect(transport);
|
|
73
|
-
const response = await transport.handleRequest(request, { authInfo: auth });
|
|
74
|
-
if (!transport.sessionId) {
|
|
75
|
-
await server.close();
|
|
76
|
-
return response;
|
|
77
|
-
}
|
|
78
|
-
sessions.set(transport.sessionId, { transport, close: /* @__PURE__ */ __name(() => server.close(), "close"), clientId: auth.clientId, seen: now() });
|
|
79
|
-
while (sessions.size > MAX_SESSIONS)
|
|
80
|
-
await drop(sessions.keys().next().value);
|
|
81
|
-
return response;
|
|
82
|
-
}, "handle");
|
|
83
|
-
return {
|
|
84
|
-
handle,
|
|
85
|
-
close: /* @__PURE__ */ __name(async () => {
|
|
86
|
-
for (const id of [...sessions.keys()])
|
|
87
|
-
await drop(id);
|
|
88
|
-
}, "close")
|
|
89
|
-
};
|
|
90
|
-
}, "legacySessions");
|
|
91
|
-
var metadataRequest = /* @__PURE__ */ __name((request, path, base) => {
|
|
92
|
-
const url = new URL(request.url);
|
|
93
|
-
const inserted = base && path === `${AS_METADATA}${base}`;
|
|
94
|
-
if (!inserted && url.pathname === path)
|
|
95
|
-
return request;
|
|
96
|
-
url.pathname = inserted ? AS_METADATA : path;
|
|
97
|
-
return new Request(url, { method: request.method, headers: request.headers });
|
|
98
|
-
}, "metadataRequest");
|
|
99
|
-
var toolsIn = /* @__PURE__ */ __name(async (request) => {
|
|
100
|
-
if (request.method !== "POST")
|
|
101
|
-
return [];
|
|
102
|
-
try {
|
|
103
|
-
return calledTools(await request.clone().json());
|
|
104
|
-
} catch {
|
|
105
|
-
return [];
|
|
106
|
-
}
|
|
107
|
-
}, "toolsIn");
|
|
108
|
-
var serveOverHttp = /* @__PURE__ */ __name(async (build, options) => {
|
|
109
|
-
const { publicUrl, port, tokenFile, appName, reaches, onCode, onError, now, lockFile, version } = options;
|
|
110
|
-
const lock = lockFile ? httpLock(lockFile, {
|
|
111
|
-
pid: process.pid,
|
|
112
|
-
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
113
|
-
port,
|
|
114
|
-
publicUrl: publicUrl.href,
|
|
115
|
-
...version ? { version } : {}
|
|
116
|
-
}) : void 0;
|
|
117
|
-
if (lock?.held)
|
|
118
|
-
throw new CliError("validation_error", `${appName} already serves MCP over HTTP for this profile on port ${lock.held.port} (PID ${lock.held.pid}, since ${lock.held.startedAt})`);
|
|
119
|
-
const base = publicUrl.pathname === "/" ? "" : publicUrl.pathname.replace(/\/+$/, "");
|
|
120
|
-
const issuer = new URL(`${publicUrl.origin}${base}`);
|
|
121
|
-
const resource = new URL(`${base}${MCP_PATH}`, publicUrl.origin);
|
|
122
|
-
const mcpPath = resource.pathname;
|
|
123
|
-
const publicPath = /* @__PURE__ */ __name((path) => base && path !== base && !path.startsWith(`${base}/`) && !path.startsWith("/.well-known/") ? `${base}${path}` : path, "publicPath");
|
|
124
|
-
const login = ownerLogin({
|
|
125
|
-
issuer,
|
|
126
|
-
resource,
|
|
127
|
-
file: tokenFile,
|
|
128
|
-
appName,
|
|
129
|
-
...reaches ? { reaches } : {},
|
|
130
|
-
onCode: /* @__PURE__ */ __name((code, expires) => {
|
|
131
|
-
lock?.update({ loginCode: code, loginCodeExpiresAt: expires.toISOString() });
|
|
132
|
-
onCode(code, expires);
|
|
133
|
-
}, "onCode"),
|
|
134
|
-
...now ? { now } : {}
|
|
135
|
-
});
|
|
136
|
-
const insecure = issuer.protocol === "http:" && LOCAL.includes(issuer.hostname);
|
|
137
|
-
const mcp = createMcpHandler(build, { legacy: "reject", ...onError ? { onerror: onError } : {} });
|
|
138
|
-
const legacy = legacySessions(build, now ?? Date.now);
|
|
139
|
-
const bearer = requireBearerAuth({
|
|
140
|
-
verifier: login.verifier,
|
|
141
|
-
resourceMetadataUrl: getOAuthProtectedResourceMetadataUrl(resource)
|
|
142
|
-
});
|
|
143
|
-
const activity = activityRecorder(httpActivityFile(tokenFile), now);
|
|
144
|
-
const allowedHosts = [.../* @__PURE__ */ new Set([publicUrl.hostname, ...LOCAL])];
|
|
145
|
-
const allowedOrigins = [publicUrl.origin];
|
|
146
|
-
const listening = await listen(async (request) => {
|
|
147
|
-
const refused = hostHeaderValidationResponse(request, allowedHosts);
|
|
148
|
-
if (refused)
|
|
149
|
-
return refused;
|
|
150
|
-
const path = publicPath(new URL(request.url).pathname);
|
|
151
|
-
const discovery = oauthMetadataResponse(metadataRequest(request, path, base), {
|
|
152
|
-
oauthMetadata: login.metadata,
|
|
153
|
-
resourceServerUrl: resource,
|
|
154
|
-
resourceName: appName,
|
|
155
|
-
...insecure ? { dangerouslyAllowInsecureIssuerUrl: true } : {}
|
|
156
|
-
});
|
|
157
|
-
if (discovery)
|
|
158
|
-
return discovery;
|
|
159
|
-
if (Number(request.headers.get("content-length") ?? 0) > MAX_LOGIN_BODY && path !== mcpPath)
|
|
160
|
-
return new Response("Request too large", { status: 413 });
|
|
161
|
-
const origin = request.headers.get("origin");
|
|
162
|
-
if (origin && !allowedOrigins.includes(origin))
|
|
163
|
-
return new Response("Origin not allowed", { status: 403 });
|
|
164
|
-
const answered = await login.handle(request, path);
|
|
165
|
-
if (answered)
|
|
166
|
-
return answered;
|
|
167
|
-
if (path !== mcpPath)
|
|
168
|
-
return new Response("Not found", { status: 404 });
|
|
169
|
-
const auth = await bearer(request);
|
|
170
|
-
if (auth instanceof Response)
|
|
171
|
-
return auth;
|
|
172
|
-
activity.record(auth.clientId, await toolsIn(request));
|
|
173
|
-
return await isLegacyRequest(request) ? legacy.handle(request, auth) : mcp.fetch(request, { authInfo: auth });
|
|
174
|
-
}, { host: "127.0.0.1", port }).catch((error) => {
|
|
175
|
-
login.close();
|
|
176
|
-
lock?.release();
|
|
177
|
-
throw error;
|
|
178
|
-
});
|
|
179
|
-
lock?.update({ listeningAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
180
|
-
return {
|
|
181
|
-
url: listening.url,
|
|
182
|
-
close: /* @__PURE__ */ __name(async () => {
|
|
183
|
-
login.close();
|
|
184
|
-
activity.flush();
|
|
185
|
-
try {
|
|
186
|
-
await listening.close();
|
|
187
|
-
await legacy.close();
|
|
188
|
-
await mcp.close();
|
|
189
|
-
} finally {
|
|
190
|
-
lock?.release();
|
|
191
|
-
}
|
|
192
|
-
}, "close")
|
|
193
|
-
};
|
|
194
|
-
}, "serveOverHttp");
|
|
195
|
-
export {
|
|
196
|
-
MCP_PATH,
|
|
197
|
-
serveOverHttp
|
|
198
|
-
};
|