@wirecat/amo-cli 0.5.0 → 0.7.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 +33 -0
- package/README.md +2 -2
- package/contracts/wirecat.json +14 -0
- package/dist/amo/button.js +1 -1
- package/dist/amo/json.js +1 -1
- package/dist/amo/oauth.js +3 -5
- package/dist/amo/transport.js +3 -7
- package/dist/api-keys.js +1 -1
- package/dist/bin/amo.js +11 -11
- package/dist/bundle/amo.js +5 -183
- package/dist/bundle/{chunk-3PYE55JY.js → chunk-3HWD4BKU.js} +4 -6
- package/dist/bundle/{chunk-M6VZXAJC.js → chunk-4EXURQQQ.js} +21 -19
- package/dist/bundle/chunk-AEWYRB6F.js +8 -0
- package/dist/bundle/{chunk-WUFX4TKA.js → chunk-GL7CRTHR.js} +3 -3
- package/dist/bundle/chunk-N2UB32VN.js +76 -0
- package/dist/bundle/{chunk-KZ2FIDI3.js → chunk-PVVSHDMQ.js} +7 -15
- package/dist/bundle/program-SQH3SPOW.js +2352 -0
- package/dist/bundle/{instructions-AMH5RWVJ.js → source-C65ZJUTW.js} +5 -6
- package/dist/bundle/store-SJ2TOUGU.js +12 -0
- package/dist/bundle/writer-I7GBI3VE.js +12 -0
- package/dist/commands/account.js +1 -1
- package/dist/commands/api.js +1 -3
- package/dist/commands/crm-shared.js +2 -3
- package/dist/commands/schedule.js +1 -1
- package/dist/commands/session.js +1 -8
- package/dist/commands/write.js +1 -2
- package/dist/config.js +1 -2
- package/dist/context.js +1 -2
- package/dist/crm/activities.js +1 -1
- package/dist/crm/records.js +1 -1
- package/dist/crm/source.js +1 -1
- package/dist/crm/writer.js +1 -1
- package/dist/identity.js +4 -0
- package/dist/program.js +1 -2
- package/dist/setup/flow.js +1 -1
- package/dist/store.js +1 -1
- package/dist/version.js +1 -1
- package/dist/whoami.js +1 -1
- package/package.json +3 -3
- package/scenarios/first-sync.md +13 -11
- package/scenarios/keep-in-sync.md +7 -6
- package/scenarios/safe-agent-writes.md +10 -9
- package/dist/amo/account.d.ts +0 -18
- package/dist/amo/account.d.ts.map +0 -1
- package/dist/amo/account.js.map +0 -1
- package/dist/amo/allow-list.d.ts +0 -31
- package/dist/amo/allow-list.d.ts.map +0 -1
- package/dist/amo/allow-list.js.map +0 -1
- package/dist/amo/button.d.ts +0 -53
- package/dist/amo/button.d.ts.map +0 -1
- package/dist/amo/button.js.map +0 -1
- package/dist/amo/errors.d.ts +0 -12
- package/dist/amo/errors.d.ts.map +0 -1
- package/dist/amo/errors.js.map +0 -1
- package/dist/amo/json.d.ts +0 -3
- package/dist/amo/json.d.ts.map +0 -1
- package/dist/amo/json.js.map +0 -1
- package/dist/amo/oauth.d.ts +0 -64
- package/dist/amo/oauth.d.ts.map +0 -1
- package/dist/amo/oauth.js.map +0 -1
- package/dist/amo/operation.d.ts +0 -45
- package/dist/amo/operation.d.ts.map +0 -1
- package/dist/amo/operation.js.map +0 -1
- package/dist/amo/operations.d.ts +0 -3
- package/dist/amo/operations.d.ts.map +0 -1
- package/dist/amo/operations.js.map +0 -1
- package/dist/amo/routes.d.ts +0 -67
- package/dist/amo/routes.d.ts.map +0 -1
- package/dist/amo/routes.js.map +0 -1
- package/dist/amo/transport.d.ts +0 -62
- package/dist/amo/transport.d.ts.map +0 -1
- package/dist/amo/transport.js.map +0 -1
- package/dist/api-keys.d.ts +0 -47
- package/dist/api-keys.d.ts.map +0 -1
- package/dist/api-keys.js.map +0 -1
- package/dist/bin/amo.d.ts +0 -3
- package/dist/bin/amo.d.ts.map +0 -1
- package/dist/bin/amo.js.map +0 -1
- package/dist/bundle/agent-EFMUK732.js +0 -41
- package/dist/bundle/all-profiles-PIWUQWBA.js +0 -320
- package/dist/bundle/anthropic-47CMXBPQ.js +0 -90
- package/dist/bundle/app-server-QRBQODF2.js +0 -257
- package/dist/bundle/areas-QVHVU57Z.js +0 -63
- package/dist/bundle/bun-OPDGMZZQ.js +0 -169
- package/dist/bundle/bun-sqlite-7I4X7CZW.js +0 -75
- package/dist/bundle/chunk-2JHVQMVC.js +0 -16
- package/dist/bundle/chunk-2XBDILVW.js +0 -53
- package/dist/bundle/chunk-3DEQUYEG.js +0 -185
- package/dist/bundle/chunk-3GX6KM2E.js +0 -5302
- package/dist/bundle/chunk-3HC5F3P7.js +0 -24
- package/dist/bundle/chunk-3YM4B2GT.js +0 -63
- package/dist/bundle/chunk-43OW5NTG.js +0 -338
- package/dist/bundle/chunk-43PMSR33.js +0 -357
- package/dist/bundle/chunk-4N7PP76S.js +0 -6848
- package/dist/bundle/chunk-4VN7RI4I.js +0 -1718
- package/dist/bundle/chunk-57HFPNMF.js +0 -189
- package/dist/bundle/chunk-5UTB3ADZ.js +0 -360
- package/dist/bundle/chunk-633NQY2R.js +0 -80
- package/dist/bundle/chunk-63N46DJU.js +0 -12278
- package/dist/bundle/chunk-6D4VWSJD.js +0 -259
- package/dist/bundle/chunk-6JTHXWPE.js +0 -64
- package/dist/bundle/chunk-6QGUK3H7.js +0 -161
- package/dist/bundle/chunk-6WS6GJ4V.js +0 -30
- package/dist/bundle/chunk-7IR2G5XY.js +0 -559
- package/dist/bundle/chunk-7IWIFVXH.js +0 -52
- package/dist/bundle/chunk-ABX7BBS4.js +0 -388
- package/dist/bundle/chunk-ADLS6FVG.js +0 -24600
- package/dist/bundle/chunk-ADTI5RUO.js +0 -1007
- package/dist/bundle/chunk-AKRIUNYP.js +0 -1197
- package/dist/bundle/chunk-BIKOE2IW.js +0 -614
- package/dist/bundle/chunk-BVVMIAQ6.js +0 -37727
- package/dist/bundle/chunk-CGW5R4UD.js +0 -362
- package/dist/bundle/chunk-D4NE7EON.js +0 -170
- package/dist/bundle/chunk-D72URWJE.js +0 -532
- package/dist/bundle/chunk-DFDN6AUB.js +0 -21
- package/dist/bundle/chunk-DNCLQPOM.js +0 -7
- package/dist/bundle/chunk-DPV53EZC.js +0 -206
- package/dist/bundle/chunk-DQ6S5TFZ.js +0 -9539
- package/dist/bundle/chunk-DSJ6EAOA.js +0 -4172
- package/dist/bundle/chunk-DVZ75WZJ.js +0 -3752
- package/dist/bundle/chunk-EH6ZEJGT.js +0 -932
- package/dist/bundle/chunk-EHK73OSW.js +0 -2017
- package/dist/bundle/chunk-FNV5HLHX.js +0 -1068
- package/dist/bundle/chunk-FV4GQNIK.js +0 -136
- package/dist/bundle/chunk-G2TU5RYY.js +0 -332
- package/dist/bundle/chunk-GDK7ETSB.js +0 -218
- package/dist/bundle/chunk-GGMAIIVE.js +0 -38
- package/dist/bundle/chunk-GLYWZQY4.js +0 -86
- package/dist/bundle/chunk-H4AFNENN.js +0 -1343
- package/dist/bundle/chunk-HOF7GQWW.js +0 -142
- package/dist/bundle/chunk-HSPEU6S7.js +0 -209
- package/dist/bundle/chunk-IA7LLLEI.js +0 -100
- package/dist/bundle/chunk-IB55P46L.js +0 -334
- package/dist/bundle/chunk-IG2TJQJ7.js +0 -79
- package/dist/bundle/chunk-JG6LCSEX.js +0 -407
- package/dist/bundle/chunk-JLXXUEAM.js +0 -72
- package/dist/bundle/chunk-JXT6GY4V.js +0 -1023
- package/dist/bundle/chunk-K7YY6SXR.js +0 -738
- package/dist/bundle/chunk-KEKXERBE.js +0 -67181
- package/dist/bundle/chunk-KZN2BG3P.js +0 -721
- package/dist/bundle/chunk-LKH3UKLO.js +0 -230
- package/dist/bundle/chunk-LZPKBN3C.js +0 -193
- package/dist/bundle/chunk-MDEPJZYJ.js +0 -106
- package/dist/bundle/chunk-NB7EOAUZ.js +0 -123
- package/dist/bundle/chunk-NISH4UXM.js +0 -58
- package/dist/bundle/chunk-NSKMNIY6.js +0 -460
- package/dist/bundle/chunk-PL5P7UKW.js +0 -25216
- package/dist/bundle/chunk-PPSAWFJD.js +0 -1293
- package/dist/bundle/chunk-Q7ICVP25.js +0 -18
- package/dist/bundle/chunk-QFOP3KUP.js +0 -2603
- package/dist/bundle/chunk-R53XXHEI.js +0 -76
- package/dist/bundle/chunk-RIMPFMZE.js +0 -1251
- package/dist/bundle/chunk-RN6RT5CB.js +0 -58
- package/dist/bundle/chunk-RRTMPSQR.js +0 -29
- package/dist/bundle/chunk-S4ZHQMNM.js +0 -133
- package/dist/bundle/chunk-S6JG4YUH.js +0 -72
- package/dist/bundle/chunk-TAVI73RW.js +0 -288
- package/dist/bundle/chunk-TLG6ECZ2.js +0 -54
- package/dist/bundle/chunk-TXDR6YSF.js +0 -23
- package/dist/bundle/chunk-TY7NDMFY.js +0 -46
- package/dist/bundle/chunk-U5RJJ2EC.js +0 -353
- package/dist/bundle/chunk-UDSL3MUU.js +0 -2333
- package/dist/bundle/chunk-V2CNGXWX.js +0 -798
- package/dist/bundle/chunk-VB7FZOYX.js +0 -633
- package/dist/bundle/chunk-VZ5PPYDG.js +0 -77
- package/dist/bundle/chunk-W5JRXIG6.js +0 -27995
- package/dist/bundle/chunk-WIHN3ELW.js +0 -2793
- package/dist/bundle/chunk-WOPVBRPV.js +0 -29
- package/dist/bundle/chunk-WXJYMMEL.js +0 -95
- package/dist/bundle/chunk-XCCU2E3Z.js +0 -274
- package/dist/bundle/chunk-XEQQJBBO.js +0 -92
- package/dist/bundle/chunk-XUT7DSM5.js +0 -108
- package/dist/bundle/chunk-Y5E2WNWB.js +0 -35
- package/dist/bundle/chunk-YWDFYQOU.js +0 -82
- package/dist/bundle/chunk-ZLUIRFJX.js +0 -780
- package/dist/bundle/chunk-ZVVMGPBJ.js +0 -50
- package/dist/bundle/cli-3NXOSENF.js +0 -1239
- package/dist/bundle/command-contract-LNSAV5LA.js +0 -39
- package/dist/bundle/command-server-entry-4ZQPNUL4.js +0 -168
- package/dist/bundle/decode-K7U7X5EL.js +0 -296
- package/dist/bundle/dispatch-56FECRCU.js +0 -411
- package/dist/bundle/dist-PAKDDIBT.js +0 -191
- package/dist/bundle/dist-T54K3FJV.js +0 -7577
- package/dist/bundle/echarts-O3TNDAXJ.js +0 -42501
- package/dist/bundle/embed-SWLVG73O.js +0 -37
- package/dist/bundle/embedder-EJN75BPV.js +0 -110
- package/dist/bundle/failure-WDSX6H3B.js +0 -24
- package/dist/bundle/first-run-WPGUUC4Z.js +0 -28
- package/dist/bundle/first-screen-JMNEUQ46.js +0 -40
- package/dist/bundle/mcp-5HFPWC3W.js +0 -167
- package/dist/bundle/meeting-combined-5TKG2RYD.js +0 -24
- package/dist/bundle/meeting-model-YXXNETKC.js +0 -24
- package/dist/bundle/meeting-semantic-U7EUB3ET.js +0 -21
- package/dist/bundle/node-EGMCBAO7.js +0 -176
- package/dist/bundle/node-P4E63KXA.js +0 -2340
- package/dist/bundle/node-TLZSIHIJ.js +0 -21
- package/dist/bundle/node-sqlite-YVOGMDSP.js +0 -73
- package/dist/bundle/oauth-2SNRBIJM.js +0 -19
- package/dist/bundle/open-ABCPY5IH.js +0 -22
- package/dist/bundle/openai-4D6PXJR7.js +0 -237
- package/dist/bundle/process-SGHEN6MQ.js +0 -91
- package/dist/bundle/program-CBDQBZZ3.js +0 -4971
- package/dist/bundle/prompt-2QUK5QST.js +0 -16
- package/dist/bundle/recognize-QMQSJRIH.js +0 -25
- package/dist/bundle/remote-U7TC2BLZ.js +0 -30
- package/dist/bundle/rerank-5UPVXGVV.js +0 -51
- package/dist/bundle/serve-VX6GUM6J.js +0 -198
- package/dist/bundle/server-FOPC6DJ3.js +0 -219
- package/dist/bundle/server-OIVNOMVK.js +0 -87
- package/dist/bundle/source-HWS5SJIV.js +0 -46
- package/dist/bundle/sqlite-runtime-77NKDEXN.js +0 -19
- package/dist/bundle/state-X2HU6GB2.js +0 -35
- package/dist/bundle/store-2U4U6KL4.js +0 -184
- package/dist/bundle/store-3CHPHFP7.js +0 -301
- package/dist/bundle/store-Z3747L5F.js +0 -34
- package/dist/bundle/store-maintenance-command-UOSZJTVP.js +0 -74
- package/dist/bundle/surface-MUT72QON.js +0 -73
- package/dist/bundle/writer-RBKQ64ZM.js +0 -48
- package/dist/commands/account.d.ts +0 -4
- package/dist/commands/account.d.ts.map +0 -1
- package/dist/commands/account.js.map +0 -1
- package/dist/commands/api.d.ts +0 -3
- package/dist/commands/api.d.ts.map +0 -1
- package/dist/commands/api.js.map +0 -1
- package/dist/commands/crm-shared.d.ts +0 -8
- package/dist/commands/crm-shared.d.ts.map +0 -1
- package/dist/commands/crm-shared.js.map +0 -1
- package/dist/commands/schedule.d.ts +0 -3
- package/dist/commands/schedule.d.ts.map +0 -1
- package/dist/commands/schedule.js.map +0 -1
- package/dist/commands/session.d.ts +0 -35
- package/dist/commands/session.d.ts.map +0 -1
- package/dist/commands/session.js.map +0 -1
- package/dist/commands/write.d.ts +0 -14
- package/dist/commands/write.d.ts.map +0 -1
- package/dist/commands/write.js.map +0 -1
- package/dist/config.d.ts +0 -4
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/context.d.ts +0 -62
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/crm/activities.d.ts +0 -32
- package/dist/crm/activities.d.ts.map +0 -1
- package/dist/crm/activities.js.map +0 -1
- package/dist/crm/records.d.ts +0 -20
- package/dist/crm/records.d.ts.map +0 -1
- package/dist/crm/records.js.map +0 -1
- package/dist/crm/source.d.ts +0 -41
- package/dist/crm/source.d.ts.map +0 -1
- package/dist/crm/source.js.map +0 -1
- package/dist/crm/writer.d.ts +0 -14
- package/dist/crm/writer.d.ts.map +0 -1
- package/dist/crm/writer.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/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.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/reasons.d.ts +0 -10
- package/dist/reasons.d.ts.map +0 -1
- package/dist/reasons.js.map +0 -1
- package/dist/setup/flow.d.ts +0 -2
- package/dist/setup/flow.d.ts.map +0 -1
- package/dist/setup/flow.js.map +0 -1
- package/dist/store.d.ts +0 -15
- 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
- package/dist/whoami.d.ts +0 -24
- package/dist/whoami.d.ts.map +0 -1
- package/dist/whoami.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-WIHN3ELW.js";
|
|
9
|
-
import "./chunk-QFOP3KUP.js";
|
|
10
|
-
import "./chunk-Y5E2WNWB.js";
|
|
11
|
-
import "./chunk-S6JG4YUH.js";
|
|
12
|
-
import "./chunk-ZVVMGPBJ.js";
|
|
13
|
-
export {
|
|
14
|
-
pasteHint,
|
|
15
|
-
readSecret
|
|
16
|
-
};
|
|
@@ -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-WIHN3ELW.js";
|
|
13
|
-
import "./chunk-QFOP3KUP.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-3DEQUYEG.js";
|
|
12
|
-
import "./chunk-G2TU5RYY.js";
|
|
13
|
-
import "./chunk-ADTI5RUO.js";
|
|
14
|
-
import "./chunk-XCCU2E3Z.js";
|
|
15
|
-
import "./chunk-AKRIUNYP.js";
|
|
16
|
-
import "./chunk-TLG6ECZ2.js";
|
|
17
|
-
import "./chunk-WIHN3ELW.js";
|
|
18
|
-
import "./chunk-QFOP3KUP.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-ADTI5RUO.js";
|
|
8
|
-
import "./chunk-XCCU2E3Z.js";
|
|
9
|
-
import "./chunk-TLG6ECZ2.js";
|
|
10
|
-
import "./chunk-WIHN3ELW.js";
|
|
11
|
-
import "./chunk-QFOP3KUP.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-TAVI73RW.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-6QGUK3H7.js";
|
|
24
|
-
import "./chunk-GLYWZQY4.js";
|
|
25
|
-
import "./chunk-3YM4B2GT.js";
|
|
26
|
-
import "./chunk-WIHN3ELW.js";
|
|
27
|
-
import "./chunk-QFOP3KUP.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
|
-
};
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
botInstructions
|
|
5
|
-
} from "./chunk-3HC5F3P7.js";
|
|
6
|
-
import {
|
|
7
|
-
skillResources
|
|
8
|
-
} from "./chunk-ABX7BBS4.js";
|
|
9
|
-
import {
|
|
10
|
-
StdioServerTransport,
|
|
11
|
-
answeredWire,
|
|
12
|
-
serveStdio
|
|
13
|
-
} from "./chunk-VB7FZOYX.js";
|
|
14
|
-
import {
|
|
15
|
-
wholeList
|
|
16
|
-
} from "./chunk-U5RJJ2EC.js";
|
|
17
|
-
import {
|
|
18
|
-
runCommandForAgent,
|
|
19
|
-
toolsFromCommands
|
|
20
|
-
} from "./chunk-DVZ75WZJ.js";
|
|
21
|
-
import "./chunk-7IWIFVXH.js";
|
|
22
|
-
import "./chunk-43OW5NTG.js";
|
|
23
|
-
import {
|
|
24
|
-
answered,
|
|
25
|
-
normal,
|
|
26
|
-
registerCommands
|
|
27
|
-
} from "./chunk-7IR2G5XY.js";
|
|
28
|
-
import {
|
|
29
|
-
agentJson
|
|
30
|
-
} from "./chunk-HSPEU6S7.js";
|
|
31
|
-
import "./chunk-BVVMIAQ6.js";
|
|
32
|
-
import "./chunk-JG6LCSEX.js";
|
|
33
|
-
import "./chunk-3GX6KM2E.js";
|
|
34
|
-
import "./chunk-NB7EOAUZ.js";
|
|
35
|
-
import "./chunk-HOF7GQWW.js";
|
|
36
|
-
import "./chunk-TY7NDMFY.js";
|
|
37
|
-
import {
|
|
38
|
-
callerOf
|
|
39
|
-
} from "./chunk-XUT7DSM5.js";
|
|
40
|
-
import "./chunk-6WS6GJ4V.js";
|
|
41
|
-
import "./chunk-K7YY6SXR.js";
|
|
42
|
-
import "./chunk-WOPVBRPV.js";
|
|
43
|
-
import {
|
|
44
|
-
McpServer
|
|
45
|
-
} from "./chunk-PL5P7UKW.js";
|
|
46
|
-
import "./chunk-R53XXHEI.js";
|
|
47
|
-
import "./chunk-6D4VWSJD.js";
|
|
48
|
-
import "./chunk-5UTB3ADZ.js";
|
|
49
|
-
import "./chunk-D4NE7EON.js";
|
|
50
|
-
import {
|
|
51
|
-
MESSENGER_CHANGE_REFUSAL,
|
|
52
|
-
changesMessenger,
|
|
53
|
-
flatten,
|
|
54
|
-
itemOf,
|
|
55
|
-
readOnlyLockOf,
|
|
56
|
-
readOnlyRefusal
|
|
57
|
-
} from "./chunk-63N46DJU.js";
|
|
58
|
-
import "./chunk-CGW5R4UD.js";
|
|
59
|
-
import "./chunk-RN6RT5CB.js";
|
|
60
|
-
import "./chunk-IB55P46L.js";
|
|
61
|
-
import "./chunk-3YM4B2GT.js";
|
|
62
|
-
import "./chunk-FNV5HLHX.js";
|
|
63
|
-
import "./chunk-6JTHXWPE.js";
|
|
64
|
-
import "./chunk-KEKXERBE.js";
|
|
65
|
-
import "./chunk-UDSL3MUU.js";
|
|
66
|
-
import "./chunk-633NQY2R.js";
|
|
67
|
-
import "./chunk-KZN2BG3P.js";
|
|
68
|
-
import "./chunk-PPSAWFJD.js";
|
|
69
|
-
import "./chunk-JLXXUEAM.js";
|
|
70
|
-
import "./chunk-3DEQUYEG.js";
|
|
71
|
-
import "./chunk-G2TU5RYY.js";
|
|
72
|
-
import "./chunk-ADTI5RUO.js";
|
|
73
|
-
import "./chunk-XCCU2E3Z.js";
|
|
74
|
-
import "./chunk-JXT6GY4V.js";
|
|
75
|
-
import "./chunk-NSKMNIY6.js";
|
|
76
|
-
import "./chunk-TXDR6YSF.js";
|
|
77
|
-
import "./chunk-BIKOE2IW.js";
|
|
78
|
-
import "./chunk-EHK73OSW.js";
|
|
79
|
-
import "./chunk-IG2TJQJ7.js";
|
|
80
|
-
import "./chunk-2JHVQMVC.js";
|
|
81
|
-
import "./chunk-ZLUIRFJX.js";
|
|
82
|
-
import "./chunk-XEQQJBBO.js";
|
|
83
|
-
import "./chunk-RRTMPSQR.js";
|
|
84
|
-
import "./chunk-DSJ6EAOA.js";
|
|
85
|
-
import "./chunk-DNCLQPOM.js";
|
|
86
|
-
import "./chunk-AKRIUNYP.js";
|
|
87
|
-
import "./chunk-D72URWJE.js";
|
|
88
|
-
import "./chunk-YWDFYQOU.js";
|
|
89
|
-
import "./chunk-TLG6ECZ2.js";
|
|
90
|
-
import "./chunk-WXJYMMEL.js";
|
|
91
|
-
import "./chunk-GGMAIIVE.js";
|
|
92
|
-
import "./chunk-WIHN3ELW.js";
|
|
93
|
-
import {
|
|
94
|
-
mcpErrorResult,
|
|
95
|
-
object
|
|
96
|
-
} from "./chunk-QFOP3KUP.js";
|
|
97
|
-
import "./chunk-Y5E2WNWB.js";
|
|
98
|
-
import "./chunk-S6JG4YUH.js";
|
|
99
|
-
import "./chunk-4N7PP76S.js";
|
|
100
|
-
import {
|
|
101
|
-
__name
|
|
102
|
-
} from "./chunk-ZVVMGPBJ.js";
|
|
103
|
-
|
|
104
|
-
// 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/bot/server.js
|
|
105
|
-
import { randomUUID } from "node:crypto";
|
|
106
|
-
var body = /* @__PURE__ */ __name((command, value) => Array.isArray(value) ? wholeList(`bot ${command}`, value) : value !== null && typeof value === "object" && ("item" in value || "items" in value) ? value : itemOf(value !== null && typeof value === "object" ? value : { value }), "body");
|
|
107
|
-
var createBotServer = /* @__PURE__ */ __name((options) => {
|
|
108
|
-
const { bot, program, settings, env } = options;
|
|
109
|
-
const command = bot.app.command;
|
|
110
|
-
const levels = options.levels ?? (() => settings.permissions);
|
|
111
|
-
const authority = /* @__PURE__ */ __name((path) => options.authority?.(path) === true || path[0] === "config" && (path[1] === "set" || path[1] === "unset"), "authority");
|
|
112
|
-
const catalogue = {
|
|
113
|
-
includeUnavailable: true,
|
|
114
|
-
levels: settings.permissions,
|
|
115
|
-
currentLevels: levels,
|
|
116
|
-
readOnly: readOnlyLockOf(bot.app, env) !== void 0,
|
|
117
|
-
...options.keyOf ? { keyOf: options.keyOf } : {},
|
|
118
|
-
authority,
|
|
119
|
-
...options.fetchOnly ? { fetchOnly: options.fetchOnly } : {},
|
|
120
|
-
...options.fetches ? { fetches: options.fetches } : {},
|
|
121
|
-
offline: true,
|
|
122
|
-
// Another bot's copy is this bot's to read only where `read_other_bots` says so.
|
|
123
|
-
...settings.readOtherBots ? {} : { omit: ["all_bots", "bots"] }
|
|
124
|
-
};
|
|
125
|
-
const tools = [
|
|
126
|
-
...toolsFromCommands(program.commands, { ...catalogue, root: ["bot"] }),
|
|
127
|
-
...toolsFromCommands(program.commands.filter((one) => one.path[0] === "config"), {
|
|
128
|
-
...catalogue,
|
|
129
|
-
omit: ["bot", "personal", "defaults"]
|
|
130
|
-
})
|
|
131
|
-
];
|
|
132
|
-
const writes = tools.filter((tool) => tool.writes && tool.availability?.().available !== false).map((tool) => tool.command);
|
|
133
|
-
const skills = options.skill ? skillResources(bot.app, options.skill) : [];
|
|
134
|
-
const skill = skills[0];
|
|
135
|
-
let queue = Promise.resolve();
|
|
136
|
-
const invoke = /* @__PURE__ */ __name((path, input, caller) => {
|
|
137
|
-
const next = queue.then(() => runCommandForAgent(program, path, path[0] === "config" ? { ...input, bot: true } : input, {
|
|
138
|
-
profile: settings.profile,
|
|
139
|
-
readOnly: readOnlyLockOf(bot.app, env) !== void 0,
|
|
140
|
-
env,
|
|
141
|
-
levels,
|
|
142
|
-
...options.keyOf ? { keyOf: options.keyOf } : {},
|
|
143
|
-
authority,
|
|
144
|
-
...options.fetches ? { fetches: options.fetches } : {},
|
|
145
|
-
...caller ? { caller } : {}
|
|
146
|
-
}));
|
|
147
|
-
queue = next.catch(() => void 0);
|
|
148
|
-
return next;
|
|
149
|
-
}, "invoke");
|
|
150
|
-
const build = /* @__PURE__ */ __name(() => {
|
|
151
|
-
const callers = { env, client: /* @__PURE__ */ __name(() => server.server.getClientVersion(), "client"), connectionId: randomUUID() };
|
|
152
|
-
const server = new McpServer({ name: `${command}-bot-${settings.profile}`, version: bot.app.version }, {
|
|
153
|
-
instructions: botInstructions({
|
|
154
|
-
command,
|
|
155
|
-
name: bot.name ?? command,
|
|
156
|
-
profile: settings.profile,
|
|
157
|
-
writes,
|
|
158
|
-
...skill ? { skill: skill.instruction } : {}
|
|
159
|
-
})
|
|
160
|
-
});
|
|
161
|
-
for (const { uri, name, title, description, mimeType, read } of skills)
|
|
162
|
-
server.registerResource(name, uri, { title, description, mimeType }, read);
|
|
163
|
-
const commands = Object.fromEntries(tools.map((tool) => [
|
|
164
|
-
tool.command,
|
|
165
|
-
{
|
|
166
|
-
title: tool.title,
|
|
167
|
-
description: tool.description,
|
|
168
|
-
writes: tool.writes,
|
|
169
|
-
availability: tool.availability,
|
|
170
|
-
input: tool.input,
|
|
171
|
-
run: /* @__PURE__ */ __name(async (args, ctx) => {
|
|
172
|
-
const caller = callerOf(ctx, `${command}_${tool.command.replaceAll(" ", "_")}`, callers);
|
|
173
|
-
const answer = await invoke(tool.path, args, caller);
|
|
174
|
-
return "error" in answer ? mcpErrorResult(JSON.parse(agentJson(answer.error))) : answered(body(tool.command, answer.result));
|
|
175
|
-
}, "run")
|
|
176
|
-
}
|
|
177
|
-
]));
|
|
178
|
-
commands.status = {
|
|
179
|
-
title: "This server's bot and profile",
|
|
180
|
-
description: "Which profile this server speaks for, where its bot token comes from, which bot it is, and which writing commands are on. Sends nothing.",
|
|
181
|
-
writes: false,
|
|
182
|
-
input: object({}),
|
|
183
|
-
run: /* @__PURE__ */ __name(async () => {
|
|
184
|
-
const auth = await invoke(["bot", "auth", "show"], {});
|
|
185
|
-
const shown = "error" in auth ? auth.error : auth.result?.item ?? auth.result;
|
|
186
|
-
return answered(itemOf({
|
|
187
|
-
profile: settings.profile,
|
|
188
|
-
kind: "bot",
|
|
189
|
-
auth: shown,
|
|
190
|
-
writes: tools.filter((tool) => tool.writes && tool.availability?.().available !== false).map((tool) => tool.command),
|
|
191
|
-
permissions: levels()
|
|
192
|
-
}));
|
|
193
|
-
}, "run")
|
|
194
|
-
};
|
|
195
|
-
registerCommands(server, `${command}_bot`, commands, void 0, (asked) => {
|
|
196
|
-
const lock = readOnlyLockOf(bot.app, env);
|
|
197
|
-
const one = flatten(program.commands).find((info) => info.path[0] === "bot" && normal(info.path.slice(1).join(" ")) === asked);
|
|
198
|
-
if (lock && one && changesMessenger(one))
|
|
199
|
-
throw readOnlyRefusal(lock, MESSENGER_CHANGE_REFUSAL);
|
|
200
|
-
}, bot.app.messenger);
|
|
201
|
-
return server;
|
|
202
|
-
}, "build");
|
|
203
|
-
return { build, tools, offered: tools.map((tool) => tool.command) };
|
|
204
|
-
}, "createBotServer");
|
|
205
|
-
var serveBotOverStdio = /* @__PURE__ */ __name(async (options, note) => {
|
|
206
|
-
const { build } = createBotServer(options);
|
|
207
|
-
const wire = answeredWire(process.stdin, process.stdout);
|
|
208
|
-
const handle = serveStdio(build, {
|
|
209
|
-
transport: new StdioServerTransport(wire.input, wire.output),
|
|
210
|
-
onerror: /* @__PURE__ */ __name((error) => note(`mcp: ${error.message}`), "onerror")
|
|
211
|
-
});
|
|
212
|
-
await wire.finished();
|
|
213
|
-
wire.release();
|
|
214
|
-
await handle.close();
|
|
215
|
-
}, "serveBotOverStdio");
|
|
216
|
-
export {
|
|
217
|
-
createBotServer,
|
|
218
|
-
serveBotOverStdio
|
|
219
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
PER_RUN,
|
|
5
|
-
createServer,
|
|
6
|
-
envelope,
|
|
7
|
-
serveOverHttpUntilStopped,
|
|
8
|
-
serveOverStdio
|
|
9
|
-
} from "./chunk-V2CNGXWX.js";
|
|
10
|
-
import "./chunk-H4AFNENN.js";
|
|
11
|
-
import "./chunk-ABX7BBS4.js";
|
|
12
|
-
import "./chunk-VB7FZOYX.js";
|
|
13
|
-
import "./chunk-Q7ICVP25.js";
|
|
14
|
-
import "./chunk-RIMPFMZE.js";
|
|
15
|
-
import "./chunk-U5RJJ2EC.js";
|
|
16
|
-
import "./chunk-DVZ75WZJ.js";
|
|
17
|
-
import "./chunk-7IWIFVXH.js";
|
|
18
|
-
import "./chunk-43OW5NTG.js";
|
|
19
|
-
import "./chunk-2XBDILVW.js";
|
|
20
|
-
import "./chunk-7IR2G5XY.js";
|
|
21
|
-
import "./chunk-HSPEU6S7.js";
|
|
22
|
-
import "./chunk-BVVMIAQ6.js";
|
|
23
|
-
import "./chunk-JG6LCSEX.js";
|
|
24
|
-
import "./chunk-3GX6KM2E.js";
|
|
25
|
-
import "./chunk-NB7EOAUZ.js";
|
|
26
|
-
import "./chunk-HOF7GQWW.js";
|
|
27
|
-
import "./chunk-TY7NDMFY.js";
|
|
28
|
-
import "./chunk-XUT7DSM5.js";
|
|
29
|
-
import "./chunk-6WS6GJ4V.js";
|
|
30
|
-
import "./chunk-K7YY6SXR.js";
|
|
31
|
-
import "./chunk-WOPVBRPV.js";
|
|
32
|
-
import "./chunk-PL5P7UKW.js";
|
|
33
|
-
import "./chunk-R53XXHEI.js";
|
|
34
|
-
import "./chunk-6D4VWSJD.js";
|
|
35
|
-
import "./chunk-5UTB3ADZ.js";
|
|
36
|
-
import "./chunk-D4NE7EON.js";
|
|
37
|
-
import "./chunk-6QGUK3H7.js";
|
|
38
|
-
import "./chunk-GLYWZQY4.js";
|
|
39
|
-
import "./chunk-S4ZHQMNM.js";
|
|
40
|
-
import "./chunk-63N46DJU.js";
|
|
41
|
-
import "./chunk-CGW5R4UD.js";
|
|
42
|
-
import "./chunk-RN6RT5CB.js";
|
|
43
|
-
import "./chunk-IB55P46L.js";
|
|
44
|
-
import "./chunk-3YM4B2GT.js";
|
|
45
|
-
import "./chunk-FNV5HLHX.js";
|
|
46
|
-
import "./chunk-6JTHXWPE.js";
|
|
47
|
-
import "./chunk-KEKXERBE.js";
|
|
48
|
-
import "./chunk-UDSL3MUU.js";
|
|
49
|
-
import "./chunk-633NQY2R.js";
|
|
50
|
-
import "./chunk-KZN2BG3P.js";
|
|
51
|
-
import "./chunk-PPSAWFJD.js";
|
|
52
|
-
import "./chunk-JLXXUEAM.js";
|
|
53
|
-
import "./chunk-3DEQUYEG.js";
|
|
54
|
-
import "./chunk-G2TU5RYY.js";
|
|
55
|
-
import "./chunk-ADTI5RUO.js";
|
|
56
|
-
import "./chunk-XCCU2E3Z.js";
|
|
57
|
-
import "./chunk-JXT6GY4V.js";
|
|
58
|
-
import "./chunk-NSKMNIY6.js";
|
|
59
|
-
import "./chunk-TXDR6YSF.js";
|
|
60
|
-
import "./chunk-BIKOE2IW.js";
|
|
61
|
-
import "./chunk-EHK73OSW.js";
|
|
62
|
-
import "./chunk-IG2TJQJ7.js";
|
|
63
|
-
import "./chunk-2JHVQMVC.js";
|
|
64
|
-
import "./chunk-ZLUIRFJX.js";
|
|
65
|
-
import "./chunk-XEQQJBBO.js";
|
|
66
|
-
import "./chunk-RRTMPSQR.js";
|
|
67
|
-
import "./chunk-DSJ6EAOA.js";
|
|
68
|
-
import "./chunk-DNCLQPOM.js";
|
|
69
|
-
import "./chunk-AKRIUNYP.js";
|
|
70
|
-
import "./chunk-D72URWJE.js";
|
|
71
|
-
import "./chunk-YWDFYQOU.js";
|
|
72
|
-
import "./chunk-TLG6ECZ2.js";
|
|
73
|
-
import "./chunk-WXJYMMEL.js";
|
|
74
|
-
import "./chunk-GGMAIIVE.js";
|
|
75
|
-
import "./chunk-WIHN3ELW.js";
|
|
76
|
-
import "./chunk-QFOP3KUP.js";
|
|
77
|
-
import "./chunk-Y5E2WNWB.js";
|
|
78
|
-
import "./chunk-S6JG4YUH.js";
|
|
79
|
-
import "./chunk-4N7PP76S.js";
|
|
80
|
-
import "./chunk-ZVVMGPBJ.js";
|
|
81
|
-
export {
|
|
82
|
-
PER_RUN,
|
|
83
|
-
createServer,
|
|
84
|
-
envelope,
|
|
85
|
-
serveOverHttpUntilStopped,
|
|
86
|
-
serveOverStdio
|
|
87
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
-
const require = __bundleRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
amoCrmSource
|
|
5
|
-
} from "./chunk-M6VZXAJC.js";
|
|
6
|
-
import "./chunk-3PYE55JY.js";
|
|
7
|
-
import "./chunk-3GX6KM2E.js";
|
|
8
|
-
import "./chunk-NB7EOAUZ.js";
|
|
9
|
-
import "./chunk-K7YY6SXR.js";
|
|
10
|
-
import "./chunk-WOPVBRPV.js";
|
|
11
|
-
import "./chunk-63N46DJU.js";
|
|
12
|
-
import "./chunk-CGW5R4UD.js";
|
|
13
|
-
import "./chunk-RN6RT5CB.js";
|
|
14
|
-
import "./chunk-IB55P46L.js";
|
|
15
|
-
import "./chunk-3YM4B2GT.js";
|
|
16
|
-
import "./chunk-6JTHXWPE.js";
|
|
17
|
-
import "./chunk-KEKXERBE.js";
|
|
18
|
-
import "./chunk-UDSL3MUU.js";
|
|
19
|
-
import "./chunk-633NQY2R.js";
|
|
20
|
-
import "./chunk-KZN2BG3P.js";
|
|
21
|
-
import "./chunk-PPSAWFJD.js";
|
|
22
|
-
import "./chunk-JLXXUEAM.js";
|
|
23
|
-
import "./chunk-G2TU5RYY.js";
|
|
24
|
-
import "./chunk-XCCU2E3Z.js";
|
|
25
|
-
import "./chunk-BIKOE2IW.js";
|
|
26
|
-
import "./chunk-EHK73OSW.js";
|
|
27
|
-
import "./chunk-IG2TJQJ7.js";
|
|
28
|
-
import "./chunk-2JHVQMVC.js";
|
|
29
|
-
import "./chunk-ZLUIRFJX.js";
|
|
30
|
-
import "./chunk-XEQQJBBO.js";
|
|
31
|
-
import "./chunk-RRTMPSQR.js";
|
|
32
|
-
import "./chunk-DSJ6EAOA.js";
|
|
33
|
-
import "./chunk-DNCLQPOM.js";
|
|
34
|
-
import "./chunk-AKRIUNYP.js";
|
|
35
|
-
import "./chunk-TLG6ECZ2.js";
|
|
36
|
-
import "./chunk-WXJYMMEL.js";
|
|
37
|
-
import "./chunk-GGMAIIVE.js";
|
|
38
|
-
import "./chunk-WIHN3ELW.js";
|
|
39
|
-
import "./chunk-QFOP3KUP.js";
|
|
40
|
-
import "./chunk-Y5E2WNWB.js";
|
|
41
|
-
import "./chunk-S6JG4YUH.js";
|
|
42
|
-
import "./chunk-4N7PP76S.js";
|
|
43
|
-
import "./chunk-ZVVMGPBJ.js";
|
|
44
|
-
export {
|
|
45
|
-
amoCrmSource
|
|
46
|
-
};
|