@wirecat/zoom-cli 0.56.0 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/bin/zm.js +35 -5
- package/dist/bundle/all-profiles-RS5IWIGR.js +25 -0
- package/dist/bundle/answer-policy-R7VZMCGE.js +96 -0
- package/dist/bundle/anthropic-5QHQR4WF.js +70 -0
- package/dist/bundle/app-server-7LANSZGE.js +232 -0
- package/dist/bundle/bun-O6RL6LRQ.js +169 -0
- package/dist/bundle/bun-sqlite-PEJM6CS4.js +69 -0
- package/dist/bundle/chunk-24DLFGES.js +97 -0
- package/dist/bundle/chunk-27P22POE.js +1109 -0
- package/dist/bundle/chunk-3SCTDFNO.js +3398 -0
- package/dist/bundle/chunk-3SERIWJD.js +36139 -0
- package/dist/bundle/chunk-4AURKUDZ.js +60 -0
- package/dist/bundle/chunk-4NGLRHWO.js +24 -0
- package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
- package/dist/bundle/chunk-5DVW77VC.js +789 -0
- package/dist/bundle/chunk-6CYLVFXM.js +9 -0
- package/dist/bundle/chunk-6FL25KC5.js +264 -0
- package/dist/bundle/chunk-7D2CD3E3.js +193 -0
- package/dist/bundle/chunk-7GVNQOV6.js +17 -0
- package/dist/bundle/chunk-7H3ZRDLW.js +630 -0
- package/dist/bundle/chunk-7Z4ANTAK.js +1095 -0
- package/dist/bundle/chunk-A6323R5P.js +22 -0
- package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
- package/dist/bundle/chunk-AIXLOMH4.js +63 -0
- package/dist/bundle/chunk-AQDWGJZT.js +188 -0
- package/dist/bundle/chunk-B32SF7J3.js +18 -0
- package/dist/bundle/chunk-BAQLQIMI.js +1938 -0
- package/dist/bundle/chunk-BGILD4CI.js +1109 -0
- package/dist/bundle/chunk-BXZ6WSVF.js +100 -0
- package/dist/bundle/chunk-CTGI4ES2.js +138 -0
- package/dist/bundle/chunk-CVIKKIGE.js +76 -0
- package/dist/bundle/chunk-DDYR6DYL.js +78 -0
- package/dist/bundle/chunk-DFDN6AUB.js +21 -0
- package/dist/bundle/chunk-DP5DX45H.js +151 -0
- package/dist/bundle/chunk-DXKVEOSS.js +53 -0
- package/dist/bundle/chunk-DXZTLB24.js +120 -0
- package/dist/bundle/chunk-G27MRA24.js +82 -0
- package/dist/bundle/chunk-HTQTIKWP.js +928 -0
- package/dist/bundle/chunk-IYAGQXED.js +433 -0
- package/dist/bundle/chunk-K76WFW4I.js +124 -0
- package/dist/bundle/chunk-KVHRHBLY.js +884 -0
- package/dist/bundle/chunk-L2UIJDWB.js +31 -0
- package/dist/bundle/chunk-L3VS3H34.js +482 -0
- package/dist/bundle/chunk-MBT7GP7K.js +1970 -0
- package/dist/bundle/chunk-MFS52LTZ.js +570 -0
- package/dist/bundle/chunk-MMT46EN4.js +29 -0
- package/dist/bundle/chunk-MNUTWGSA.js +6094 -0
- package/dist/bundle/chunk-N7GAQ27N.js +82 -0
- package/dist/bundle/chunk-NDXAZB5Z.js +409 -0
- package/dist/bundle/chunk-NOKFJJPA.js +1028 -0
- package/dist/bundle/chunk-NW7IMGRR.js +6848 -0
- package/dist/bundle/chunk-O5EHUB2V.js +2 -0
- package/dist/bundle/chunk-OBZWUNO4.js +160 -0
- package/dist/bundle/chunk-PACC5N6T.js +240 -0
- package/dist/bundle/chunk-PF25S7L4.js +422 -0
- package/dist/bundle/chunk-PKTFZAXG.js +48 -0
- package/dist/bundle/chunk-PNBEREOU.js +35626 -0
- package/dist/bundle/chunk-POOGFSRA.js +385 -0
- package/dist/bundle/chunk-PP3JGQQE.js +3517 -0
- package/dist/bundle/chunk-Q2Z3VCM4.js +2 -0
- package/dist/bundle/chunk-QCFHL4ES.js +45 -0
- package/dist/bundle/chunk-QFGBMS67.js +492 -0
- package/dist/bundle/chunk-RUP467ZX.js +948 -0
- package/dist/bundle/chunk-RXDIG23Z.js +166 -0
- package/dist/bundle/chunk-SIA7HJE2.js +8192 -0
- package/dist/bundle/chunk-SL3SXQZ5.js +100 -0
- package/dist/bundle/chunk-SV5L36WK.js +19 -0
- package/dist/bundle/chunk-T6AAM7UT.js +846 -0
- package/dist/bundle/chunk-U6QW67SU.js +18673 -0
- package/dist/bundle/chunk-UKR7KH3H.js +288 -0
- package/dist/bundle/chunk-UOFOMU3T.js +836 -0
- package/dist/bundle/chunk-URO44C5T.js +3570 -0
- package/dist/bundle/chunk-UXM7I35J.js +281 -0
- package/dist/bundle/chunk-UYJUTZTT.js +73 -0
- package/dist/bundle/chunk-VOAVOK4I.js +1146 -0
- package/dist/bundle/chunk-VSUY7PDW.js +192 -0
- package/dist/bundle/chunk-VYUSEJE4.js +98 -0
- package/dist/bundle/chunk-XFCSPOLZ.js +25 -0
- package/dist/bundle/chunk-XT7XVPEM.js +538 -0
- package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
- package/dist/bundle/chunk-YIFIY7ZE.js +58 -0
- package/dist/bundle/chunk-YIMI6O7R.js +5292 -0
- package/dist/bundle/chunk-YJRMMZI5.js +275 -0
- package/dist/bundle/chunk-YSHSCBPM.js +2315 -0
- package/dist/bundle/chunk-ZC5UXEIH.js +215 -0
- package/dist/bundle/chunk-ZHXIXDH5.js +161 -0
- package/dist/bundle/chunk-ZTOAAYFV.js +122 -0
- package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
- package/dist/bundle/cli-IQTASP44.js +831 -0
- package/dist/bundle/command-contract-WHZPF7NA.js +38 -0
- package/dist/bundle/config-IP5SGHKN.js +79 -0
- package/dist/bundle/dist-WT73DF46.js +136 -0
- package/dist/bundle/dist-XUFQCJXW.js +7577 -0
- package/dist/bundle/echarts-LD3AI55P.js +42501 -0
- package/dist/bundle/embed-XEMH4LNX.js +35 -0
- package/dist/bundle/embedder-ZCYKSKAE.js +108 -0
- package/dist/bundle/first-run-LGYDLIUM.js +23 -0
- package/dist/bundle/first-screen-LYQKPNF4.js +36 -0
- package/dist/bundle/folders-5ZBUQHAM.js +13 -0
- package/dist/bundle/instructions-RZMSW3OC.js +11 -0
- package/dist/bundle/main-NKY3JGXY.js +130 -0
- package/dist/bundle/mcp-7OXUHLTO.js +189 -0
- package/dist/bundle/mcp-OQBZXELQ.js +165 -0
- package/dist/bundle/mcp-VISEXTVC.js +92 -0
- package/dist/bundle/meetings-XPBHVZAU.js +215 -0
- package/dist/bundle/node-P4E63KXA.js +2340 -0
- package/dist/bundle/node-TLZSIHIJ.js +21 -0
- package/dist/bundle/node-ZRLYQL7J.js +176 -0
- package/dist/bundle/node-sqlite-BBEDYBWO.js +45 -0
- package/dist/bundle/oauth-UHVRGKZU.js +17 -0
- package/dist/bundle/open-J4FCAUAJ.js +19 -0
- package/dist/bundle/output-file-SXV2ANW7.js +63 -0
- package/dist/bundle/process-LL77573L.js +91 -0
- package/dist/bundle/program-EPMIJCGA.js +5845 -0
- package/dist/bundle/prompt-LUUMQTMY.js +12 -0
- package/dist/bundle/recognize-EMHQX4XF.js +190 -0
- package/dist/bundle/remote-ZXS6D7VB.js +26 -0
- package/dist/bundle/rerank-WP7RKZNB.js +49 -0
- package/dist/bundle/run-log-GS2L66G6.js +111 -0
- package/dist/bundle/serve-L6KLLXK2.js +19 -0
- package/dist/bundle/server-NOFYENP5.js +53 -0
- package/dist/bundle/server-P5TXAPBY.js +66 -0
- package/dist/bundle/services-SPOEWVK3.js +330 -0
- package/dist/bundle/speech-6OBAKMND.js +44 -0
- package/dist/bundle/state-HN5EJKXQ.js +33 -0
- package/dist/bundle/store-LEU3M6IN.js +124 -0
- package/dist/bundle/store-ZP2URKET.js +141 -0
- package/dist/bundle/store-connection-I53XZ2TS.js +76 -0
- package/dist/bundle/store-maintenance-command-PSCHEHHY.js +54 -0
- package/dist/bundle/streaming-AK6Q2ZGQ.js +15 -0
- package/dist/bundle/tokens-CCM3D4ZT.js +17 -0
- package/dist/bundle/zm.js +8 -0
- package/dist/contract-overrides.d.ts.map +1 -1
- package/dist/contract-overrides.js +29 -17
- package/dist/contract-overrides.js.map +1 -1
- package/dist/mcp-command.d.ts +3 -2
- package/dist/mcp-command.d.ts.map +1 -1
- package/dist/mcp-command.js +62 -10
- package/dist/mcp-command.js.map +1 -1
- package/dist/program-bindings.d.ts.map +1 -1
- package/dist/program-bindings.js +1 -0
- package/dist/program-bindings.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +7 -5
- package/skills/zoom-cli/SKILL.md +2 -0
package/README.md
CHANGED
|
@@ -94,7 +94,7 @@ More: [the local archive][docs/archive.md] · [search and evidence][docs/search.
|
|
|
94
94
|
- **Command line + skill.** `zm skill install` adds the packaged guide for Claude Code, Codex and
|
|
95
95
|
Gemini CLI. Every command speaks `--json` or `--jsonl`, and `zm commands --json` describes them all.
|
|
96
96
|
- **MCP.** `zm personal mcp serve` serves zm's commands to Claude Desktop, Cursor and other MCP clients, as
|
|
97
|
-
far as the profile's permissions allow.
|
|
97
|
+
far as the profile's permissions allow; `zm mcp serve --profiles all` serves every profile from one server.
|
|
98
98
|
[Connecting a client][docs/mcp.md].
|
|
99
99
|
|
|
100
100
|
Your agent. Your meetings. Your rules.
|
package/dist/bin/zm.js
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
// cli-dev bundle loader
|
|
3
|
+
import * as module from "node:module"
|
|
4
|
+
|
|
5
|
+
const words = process.argv.slice(2)
|
|
6
|
+
// As the CLI answers it, unless a test records the argv: then the CLI writes the record too.
|
|
7
|
+
if (
|
|
8
|
+
words.length === 1 &&
|
|
9
|
+
(words[0] === "--version" || words[0] === "-V") &&
|
|
10
|
+
!Object.keys(process.env).some((key) => key.endsWith("_TEST_ARGV_LOG"))
|
|
11
|
+
) {
|
|
12
|
+
process.stdout.write("0.58.0\n")
|
|
13
|
+
} else {
|
|
14
|
+
// Before the bundle compiles: the bundle's own call comes after its chunks.
|
|
15
|
+
module.enableCompileCache()
|
|
16
|
+
const serves = ((words) => {
|
|
17
|
+
const plain = words.filter((word) => !word.startsWith("-"));
|
|
18
|
+
return plain
|
|
19
|
+
.slice(0, 4)
|
|
20
|
+
.some((word, at) => word === "serve" || word === "watch" || (word === "mcp" && plain[at + 1] === undefined));
|
|
21
|
+
})(words)
|
|
22
|
+
if (serves && module.registerHooks) {
|
|
23
|
+
const bundle = new URL("../bundle/", import.meta.url).href
|
|
24
|
+
module.registerHooks({
|
|
25
|
+
resolve: (specifier, context, next) =>
|
|
26
|
+
specifier.startsWith("./") && context.parentURL?.startsWith(bundle)
|
|
27
|
+
? { url: new URL(specifier, context.parentURL).href, format: "module", shortCircuit: true }
|
|
28
|
+
: next(specifier, context),
|
|
29
|
+
})
|
|
30
|
+
}
|
|
31
|
+
const running = import("../bundle/zm.js")
|
|
32
|
+
const chunks = ["../bundle/all-profiles-RS5IWIGR.js","../bundle/answer-policy-R7VZMCGE.js","../bundle/anthropic-5QHQR4WF.js","../bundle/app-server-7LANSZGE.js","../bundle/bun-O6RL6LRQ.js","../bundle/bun-sqlite-PEJM6CS4.js","../bundle/cli-IQTASP44.js","../bundle/command-contract-WHZPF7NA.js","../bundle/config-IP5SGHKN.js","../bundle/dist-WT73DF46.js","../bundle/dist-XUFQCJXW.js","../bundle/echarts-LD3AI55P.js","../bundle/embed-XEMH4LNX.js","../bundle/embedder-ZCYKSKAE.js","../bundle/first-run-LGYDLIUM.js","../bundle/first-screen-LYQKPNF4.js","../bundle/folders-5ZBUQHAM.js","../bundle/instructions-RZMSW3OC.js","../bundle/main-NKY3JGXY.js","../bundle/mcp-7OXUHLTO.js","../bundle/mcp-OQBZXELQ.js","../bundle/mcp-VISEXTVC.js","../bundle/meetings-XPBHVZAU.js","../bundle/node-P4E63KXA.js","../bundle/node-TLZSIHIJ.js","../bundle/node-ZRLYQL7J.js","../bundle/node-sqlite-BBEDYBWO.js","../bundle/oauth-UHVRGKZU.js","../bundle/open-J4FCAUAJ.js","../bundle/output-file-SXV2ANW7.js","../bundle/process-LL77573L.js","../bundle/program-EPMIJCGA.js","../bundle/prompt-LUUMQTMY.js","../bundle/recognize-EMHQX4XF.js","../bundle/remote-ZXS6D7VB.js","../bundle/rerank-WP7RKZNB.js","../bundle/run-log-GS2L66G6.js","../bundle/serve-L6KLLXK2.js","../bundle/server-NOFYENP5.js","../bundle/server-P5TXAPBY.js","../bundle/services-SPOEWVK3.js","../bundle/speech-6OBAKMND.js","../bundle/state-HN5EJKXQ.js","../bundle/store-LEU3M6IN.js","../bundle/store-ZP2URKET.js","../bundle/store-connection-I53XZ2TS.js","../bundle/store-maintenance-command-PSCHEHHY.js","../bundle/streaming-AK6Q2ZGQ.js","../bundle/tokens-CCM3D4ZT.js"]
|
|
33
|
+
// After the server answers its first request, so it starts no later.
|
|
34
|
+
if (serves) setTimeout(() => void Promise.allSettled(chunks.map((chunk) => import(chunk))), 2000).unref()
|
|
35
|
+
await running
|
|
36
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
CHILD_IDLE_MS,
|
|
5
|
+
allProfilesServer,
|
|
6
|
+
serveAllProfilesOverHttp,
|
|
7
|
+
serveAllProfilesOverStdio,
|
|
8
|
+
withProfile
|
|
9
|
+
} from "./chunk-UXM7I35J.js";
|
|
10
|
+
import "./chunk-CVIKKIGE.js";
|
|
11
|
+
import "./chunk-7H3ZRDLW.js";
|
|
12
|
+
import "./chunk-5D4AEUVA.js";
|
|
13
|
+
import "./chunk-IYAGQXED.js";
|
|
14
|
+
import "./chunk-A6323R5P.js";
|
|
15
|
+
import "./chunk-O5EHUB2V.js";
|
|
16
|
+
import "./chunk-YIMI6O7R.js";
|
|
17
|
+
import "./chunk-Y5E2WNWB.js";
|
|
18
|
+
import "./chunk-ZVVMGPBJ.js";
|
|
19
|
+
export {
|
|
20
|
+
CHILD_IDLE_MS,
|
|
21
|
+
allProfilesServer,
|
|
22
|
+
serveAllProfilesOverHttp,
|
|
23
|
+
serveAllProfilesOverStdio,
|
|
24
|
+
withProfile
|
|
25
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
VERSION
|
|
5
|
+
} from "./chunk-6CYLVFXM.js";
|
|
6
|
+
import "./chunk-U6QW67SU.js";
|
|
7
|
+
import "./chunk-YJRMMZI5.js";
|
|
8
|
+
import "./chunk-4NGLRHWO.js";
|
|
9
|
+
import "./chunk-DDYR6DYL.js";
|
|
10
|
+
import "./chunk-27P22POE.js";
|
|
11
|
+
import "./chunk-PKTFZAXG.js";
|
|
12
|
+
import "./chunk-XT7XVPEM.js";
|
|
13
|
+
import "./chunk-ZHXIXDH5.js";
|
|
14
|
+
import "./chunk-SIA7HJE2.js";
|
|
15
|
+
import "./chunk-BAQLQIMI.js";
|
|
16
|
+
import "./chunk-VOAVOK4I.js";
|
|
17
|
+
import "./chunk-UYJUTZTT.js";
|
|
18
|
+
import "./chunk-3SERIWJD.js";
|
|
19
|
+
import "./chunk-T6AAM7UT.js";
|
|
20
|
+
import "./chunk-QFGBMS67.js";
|
|
21
|
+
import "./chunk-RXDIG23Z.js";
|
|
22
|
+
import "./chunk-URO44C5T.js";
|
|
23
|
+
import {
|
|
24
|
+
judgedEffects,
|
|
25
|
+
judgedTargets
|
|
26
|
+
} from "./chunk-MNUTWGSA.js";
|
|
27
|
+
import "./chunk-XFCSPOLZ.js";
|
|
28
|
+
import "./chunk-AIXLOMH4.js";
|
|
29
|
+
import "./chunk-IYAGQXED.js";
|
|
30
|
+
import "./chunk-7Z4ANTAK.js";
|
|
31
|
+
import "./chunk-A6323R5P.js";
|
|
32
|
+
import "./chunk-DXZTLB24.js";
|
|
33
|
+
import "./chunk-ZC5UXEIH.js";
|
|
34
|
+
import "./chunk-DP5DX45H.js";
|
|
35
|
+
import "./chunk-MFS52LTZ.js";
|
|
36
|
+
import "./chunk-4AURKUDZ.js";
|
|
37
|
+
import "./chunk-MBT7GP7K.js";
|
|
38
|
+
import {
|
|
39
|
+
failureContext
|
|
40
|
+
} from "./chunk-PACC5N6T.js";
|
|
41
|
+
import "./chunk-VSUY7PDW.js";
|
|
42
|
+
import "./chunk-L3VS3H34.js";
|
|
43
|
+
import "./chunk-HTQTIKWP.js";
|
|
44
|
+
import "./chunk-K76WFW4I.js";
|
|
45
|
+
import "./chunk-PF25S7L4.js";
|
|
46
|
+
import "./chunk-N7GAQ27N.js";
|
|
47
|
+
import "./chunk-G27MRA24.js";
|
|
48
|
+
import "./chunk-L2UIJDWB.js";
|
|
49
|
+
import "./chunk-QCFHL4ES.js";
|
|
50
|
+
import "./chunk-ZTOAAYFV.js";
|
|
51
|
+
import "./chunk-NOKFJJPA.js";
|
|
52
|
+
import "./chunk-6FL25KC5.js";
|
|
53
|
+
import "./chunk-PNBEREOU.js";
|
|
54
|
+
import "./chunk-CTGI4ES2.js";
|
|
55
|
+
import "./chunk-YSHSCBPM.js";
|
|
56
|
+
import "./chunk-KVHRHBLY.js";
|
|
57
|
+
import "./chunk-NDXAZB5Z.js";
|
|
58
|
+
import "./chunk-MMT46EN4.js";
|
|
59
|
+
import "./chunk-B32SF7J3.js";
|
|
60
|
+
import "./chunk-SL3SXQZ5.js";
|
|
61
|
+
import "./chunk-PP3JGQQE.js";
|
|
62
|
+
import "./chunk-UOFOMU3T.js";
|
|
63
|
+
import "./chunk-O5EHUB2V.js";
|
|
64
|
+
import {
|
|
65
|
+
errorObjectOf,
|
|
66
|
+
errorRecordOf,
|
|
67
|
+
exitCodeOfError,
|
|
68
|
+
renderError
|
|
69
|
+
} from "./chunk-YIMI6O7R.js";
|
|
70
|
+
import "./chunk-Y5E2WNWB.js";
|
|
71
|
+
import "./chunk-NW7IMGRR.js";
|
|
72
|
+
import {
|
|
73
|
+
__name
|
|
74
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
75
|
+
|
|
76
|
+
// dist/answer-policy.js
|
|
77
|
+
var hostFailureContext = /* @__PURE__ */ __name((registry, effects) => ({
|
|
78
|
+
...failureContext(),
|
|
79
|
+
...effects ? { effects: judgedEffects(effects) } : {},
|
|
80
|
+
...registry ? { targets: judgedTargets(registry) } : {}
|
|
81
|
+
}), "hostFailureContext");
|
|
82
|
+
var reportFailure = /* @__PURE__ */ __name((failure, args, deps, command = "zm", context = hostFailureContext()) => {
|
|
83
|
+
const end = args.indexOf("--");
|
|
84
|
+
const flags = args.slice(0, end < 0 ? void 0 : end);
|
|
85
|
+
const machine = flags.some((word) => word === "--json" || word === "--jsonl");
|
|
86
|
+
const object = errorObjectOf(failure, context);
|
|
87
|
+
const record = flags.includes("--debug") ? errorRecordOf(failure, object, { command, service: "zm", version: VERSION }) : void 0;
|
|
88
|
+
const interactive = deps.outputIsTTY === true && !machine;
|
|
89
|
+
deps.diagnostic(`${renderError(object, { cli: "zm", interactive, ...record ? { record } : {} })}
|
|
90
|
+
`);
|
|
91
|
+
return exitCodeOfError(object);
|
|
92
|
+
}, "reportFailure");
|
|
93
|
+
export {
|
|
94
|
+
hostFailureContext,
|
|
95
|
+
reportFailure
|
|
96
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
checkedOptions
|
|
5
|
+
} from "./chunk-L2UIJDWB.js";
|
|
6
|
+
import {
|
|
7
|
+
messagesFor,
|
|
8
|
+
systemFor
|
|
9
|
+
} from "./chunk-QCFHL4ES.js";
|
|
10
|
+
import {
|
|
11
|
+
Anthropic
|
|
12
|
+
} from "./chunk-ADLS6FVG.js";
|
|
13
|
+
import {
|
|
14
|
+
array,
|
|
15
|
+
optional,
|
|
16
|
+
strictObject,
|
|
17
|
+
string
|
|
18
|
+
} from "./chunk-YIMI6O7R.js";
|
|
19
|
+
import "./chunk-Y5E2WNWB.js";
|
|
20
|
+
import {
|
|
21
|
+
__name
|
|
22
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
23
|
+
|
|
24
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/models/anthropic.js
|
|
25
|
+
var options = strictObject({
|
|
26
|
+
stop_sequences: optional(array(string()))
|
|
27
|
+
});
|
|
28
|
+
var anthropic = {
|
|
29
|
+
images: true,
|
|
30
|
+
baseUrl: "https://api.anthropic.com",
|
|
31
|
+
validate: /* @__PURE__ */ __name((given) => checkedOptions("anthropic", options, given), "validate"),
|
|
32
|
+
complete: /* @__PURE__ */ __name(async (target, request, checked, apiKey, fetcher) => {
|
|
33
|
+
const client = new Anthropic({
|
|
34
|
+
apiKey: apiKey ?? "",
|
|
35
|
+
authToken: null,
|
|
36
|
+
fetch: /* @__PURE__ */ __name((input, init) => fetcher(input, { ...init, redirect: "error" }), "fetch"),
|
|
37
|
+
baseURL: target.baseUrl,
|
|
38
|
+
maxRetries: 0,
|
|
39
|
+
logLevel: "off",
|
|
40
|
+
timeout: 12e4
|
|
41
|
+
});
|
|
42
|
+
const response = await client.messages.stream({
|
|
43
|
+
...checked,
|
|
44
|
+
model: target.model,
|
|
45
|
+
system: systemFor(request),
|
|
46
|
+
messages: [
|
|
47
|
+
...messagesFor(request),
|
|
48
|
+
...request.images === void 0 ? [] : [
|
|
49
|
+
{
|
|
50
|
+
role: "user",
|
|
51
|
+
content: request.images.map((image) => ({
|
|
52
|
+
type: "image",
|
|
53
|
+
source: { type: "base64", media_type: image.mimeType, data: image.data }
|
|
54
|
+
}))
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
],
|
|
58
|
+
max_tokens: request.maxTokens
|
|
59
|
+
}).finalMessage();
|
|
60
|
+
if (response.stop_reason !== "end_turn")
|
|
61
|
+
throw new Error("incomplete response");
|
|
62
|
+
return {
|
|
63
|
+
text: response.content.filter((block) => block.type === "text").map((block) => block.text).join(""),
|
|
64
|
+
tokens: response.usage.input_tokens + response.usage.output_tokens + (response.usage.cache_creation_input_tokens ?? 0) + (response.usage.cache_read_input_tokens ?? 0)
|
|
65
|
+
};
|
|
66
|
+
}, "complete")
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
anthropic
|
|
70
|
+
};
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
PER_RUN,
|
|
5
|
+
envelope
|
|
6
|
+
} from "./chunk-5DVW77VC.js";
|
|
7
|
+
import {
|
|
8
|
+
answered,
|
|
9
|
+
failed,
|
|
10
|
+
registerCommands,
|
|
11
|
+
runCommandForAgent,
|
|
12
|
+
toolsFromCommands
|
|
13
|
+
} from "./chunk-3SCTDFNO.js";
|
|
14
|
+
import "./chunk-27P22POE.js";
|
|
15
|
+
import {
|
|
16
|
+
mcpUrlOf
|
|
17
|
+
} from "./chunk-PKTFZAXG.js";
|
|
18
|
+
import {
|
|
19
|
+
agentJson,
|
|
20
|
+
skillResource
|
|
21
|
+
} from "./chunk-XT7XVPEM.js";
|
|
22
|
+
import {
|
|
23
|
+
appInstructions
|
|
24
|
+
} from "./chunk-DXKVEOSS.js";
|
|
25
|
+
import {
|
|
26
|
+
mcpHttpMarker
|
|
27
|
+
} from "./chunk-ZHXIXDH5.js";
|
|
28
|
+
import {
|
|
29
|
+
answeredWire
|
|
30
|
+
} from "./chunk-CVIKKIGE.js";
|
|
31
|
+
import {
|
|
32
|
+
StdioServerTransport,
|
|
33
|
+
serveStdio
|
|
34
|
+
} from "./chunk-7H3ZRDLW.js";
|
|
35
|
+
import {
|
|
36
|
+
McpServer
|
|
37
|
+
} from "./chunk-5D4AEUVA.js";
|
|
38
|
+
import "./chunk-BAQLQIMI.js";
|
|
39
|
+
import "./chunk-VOAVOK4I.js";
|
|
40
|
+
import "./chunk-UYJUTZTT.js";
|
|
41
|
+
import "./chunk-3SERIWJD.js";
|
|
42
|
+
import "./chunk-T6AAM7UT.js";
|
|
43
|
+
import "./chunk-RXDIG23Z.js";
|
|
44
|
+
import "./chunk-URO44C5T.js";
|
|
45
|
+
import {
|
|
46
|
+
DEFAULT_OUTPUT_BYTES,
|
|
47
|
+
changesAuthorityAt,
|
|
48
|
+
describeProgram,
|
|
49
|
+
environmentOf,
|
|
50
|
+
fetchesOnlyAt,
|
|
51
|
+
judgedTargets,
|
|
52
|
+
rootOf2 as rootOf
|
|
53
|
+
} from "./chunk-MNUTWGSA.js";
|
|
54
|
+
import {
|
|
55
|
+
readOnlyLockOf
|
|
56
|
+
} from "./chunk-XFCSPOLZ.js";
|
|
57
|
+
import "./chunk-AIXLOMH4.js";
|
|
58
|
+
import "./chunk-IYAGQXED.js";
|
|
59
|
+
import "./chunk-7Z4ANTAK.js";
|
|
60
|
+
import "./chunk-A6323R5P.js";
|
|
61
|
+
import "./chunk-DXZTLB24.js";
|
|
62
|
+
import "./chunk-DP5DX45H.js";
|
|
63
|
+
import "./chunk-MFS52LTZ.js";
|
|
64
|
+
import "./chunk-4AURKUDZ.js";
|
|
65
|
+
import "./chunk-PACC5N6T.js";
|
|
66
|
+
import "./chunk-L3VS3H34.js";
|
|
67
|
+
import "./chunk-K76WFW4I.js";
|
|
68
|
+
import "./chunk-PF25S7L4.js";
|
|
69
|
+
import "./chunk-G27MRA24.js";
|
|
70
|
+
import "./chunk-QCFHL4ES.js";
|
|
71
|
+
import "./chunk-ZTOAAYFV.js";
|
|
72
|
+
import "./chunk-NOKFJJPA.js";
|
|
73
|
+
import "./chunk-6FL25KC5.js";
|
|
74
|
+
import "./chunk-PNBEREOU.js";
|
|
75
|
+
import "./chunk-CTGI4ES2.js";
|
|
76
|
+
import "./chunk-YSHSCBPM.js";
|
|
77
|
+
import "./chunk-KVHRHBLY.js";
|
|
78
|
+
import "./chunk-NDXAZB5Z.js";
|
|
79
|
+
import "./chunk-MMT46EN4.js";
|
|
80
|
+
import "./chunk-B32SF7J3.js";
|
|
81
|
+
import "./chunk-SL3SXQZ5.js";
|
|
82
|
+
import "./chunk-PP3JGQQE.js";
|
|
83
|
+
import "./chunk-UOFOMU3T.js";
|
|
84
|
+
import "./chunk-O5EHUB2V.js";
|
|
85
|
+
import {
|
|
86
|
+
CliError,
|
|
87
|
+
mcpErrorResult
|
|
88
|
+
} from "./chunk-YIMI6O7R.js";
|
|
89
|
+
import "./chunk-Y5E2WNWB.js";
|
|
90
|
+
import "./chunk-NW7IMGRR.js";
|
|
91
|
+
import {
|
|
92
|
+
__name
|
|
93
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
94
|
+
|
|
95
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/mcp/app-server.js
|
|
96
|
+
var EXCLUDED = [["mcp"]];
|
|
97
|
+
var createAppServer = /* @__PURE__ */ __name((command, context, options) => {
|
|
98
|
+
const { app } = options;
|
|
99
|
+
const root = rootOf(command);
|
|
100
|
+
const environment = environmentOf(command);
|
|
101
|
+
if (!environment.runCommand)
|
|
102
|
+
throw new Error("the MCP server runs inside run(), which hands it the program");
|
|
103
|
+
const program = { run: environment.runCommand, commands: describeProgram(root) };
|
|
104
|
+
const flags = command.optsWithGlobals();
|
|
105
|
+
const overrides = flags.permission ?? [];
|
|
106
|
+
const { settings } = context;
|
|
107
|
+
const levels = /* @__PURE__ */ __name(() => options.resolveSettings(flags, { env: context.env }).permissions, "levels");
|
|
108
|
+
const readOnly = /* @__PURE__ */ __name(() => readOnlyLockOf(app, context.env) !== void 0, "readOnly");
|
|
109
|
+
const authority = changesAuthorityAt(root);
|
|
110
|
+
const targets = judgedTargets(root);
|
|
111
|
+
const passed = Object.fromEntries(Object.entries(environment).filter(([key]) => !PER_RUN.has(key)));
|
|
112
|
+
const tools = toolsFromCommands(program.commands, {
|
|
113
|
+
includeUnavailable: true,
|
|
114
|
+
exclude: EXCLUDED,
|
|
115
|
+
levels: settings.permissions,
|
|
116
|
+
currentLevels: levels,
|
|
117
|
+
readOnly: readOnly(),
|
|
118
|
+
authority,
|
|
119
|
+
fetchOnly: fetchesOnlyAt(root),
|
|
120
|
+
permissions: options.permissions
|
|
121
|
+
});
|
|
122
|
+
const availability = /* @__PURE__ */ __name((one) => () => {
|
|
123
|
+
const permitted = one.availability?.() ?? { available: true };
|
|
124
|
+
if (!permitted.available)
|
|
125
|
+
return permitted;
|
|
126
|
+
return options.availability?.(one.path, settings.profile) ?? permitted;
|
|
127
|
+
}, "availability");
|
|
128
|
+
const commands = Object.fromEntries(tools.map((one) => [
|
|
129
|
+
one.command,
|
|
130
|
+
{
|
|
131
|
+
title: one.title,
|
|
132
|
+
description: one.description,
|
|
133
|
+
writes: one.writes,
|
|
134
|
+
availability: availability(one),
|
|
135
|
+
input: one.input,
|
|
136
|
+
run: /* @__PURE__ */ __name(async (input, ctx) => {
|
|
137
|
+
const own = options.availability?.(one.path, settings.profile);
|
|
138
|
+
if (own && !own.available)
|
|
139
|
+
return failed(new CliError("permission_error", `${one.command}: ${own.reason ?? "unavailable for this profile"}`, {
|
|
140
|
+
...own.permission ? { permission: own.permission } : {}
|
|
141
|
+
}), app.errors);
|
|
142
|
+
const traceparent = ctx?.mcpReq?._meta?.traceparent;
|
|
143
|
+
const env = typeof traceparent === "string" ? { ...context.env, TRACEPARENT: traceparent } : context.env;
|
|
144
|
+
const answer = await runCommandForAgent(program, one.path, input, {
|
|
145
|
+
profile: settings.profile,
|
|
146
|
+
readOnly: readOnly(),
|
|
147
|
+
env,
|
|
148
|
+
levels,
|
|
149
|
+
overrides,
|
|
150
|
+
authority,
|
|
151
|
+
permissions: options.permissions,
|
|
152
|
+
environment: passed
|
|
153
|
+
});
|
|
154
|
+
if ("error" in answer)
|
|
155
|
+
return mcpErrorResult(JSON.parse(agentJson(answer.error)));
|
|
156
|
+
try {
|
|
157
|
+
return answered(envelope(one.command, answer.result), DEFAULT_OUTPUT_BYTES, targets);
|
|
158
|
+
} catch (error) {
|
|
159
|
+
return failed(error, app.errors);
|
|
160
|
+
}
|
|
161
|
+
}, "run")
|
|
162
|
+
}
|
|
163
|
+
]));
|
|
164
|
+
const skill = options.skill ? skillResource(app, options.skill) : void 0;
|
|
165
|
+
const build = /* @__PURE__ */ __name(() => {
|
|
166
|
+
const server = new McpServer({ name: app.command, version: app.version }, {
|
|
167
|
+
instructions: appInstructions({
|
|
168
|
+
command: app.command,
|
|
169
|
+
name: options.name,
|
|
170
|
+
profile: settings.profile,
|
|
171
|
+
untrusted: options.untrusted,
|
|
172
|
+
...skill ? { skill: skill.instruction } : {}
|
|
173
|
+
})
|
|
174
|
+
});
|
|
175
|
+
registerCommands(server, app.command, commands, app.errors, void 0, app.messenger);
|
|
176
|
+
if (skill) {
|
|
177
|
+
const { uri, name, title, description, mimeType, read } = skill;
|
|
178
|
+
server.registerResource(name, uri, { title, description, mimeType }, read);
|
|
179
|
+
}
|
|
180
|
+
return server;
|
|
181
|
+
}, "build");
|
|
182
|
+
return { build, offered: Object.keys(commands) };
|
|
183
|
+
}, "createAppServer");
|
|
184
|
+
var serveAppOverStdio = /* @__PURE__ */ __name(async (command, context, options) => {
|
|
185
|
+
const { build } = createAppServer(command, context, options);
|
|
186
|
+
const { stdin, stdout, signal } = environmentOf(command);
|
|
187
|
+
const own = stdin && stdout && stdin !== process.stdin;
|
|
188
|
+
const wire = answeredWire(own ? stdin : process.stdin, own ? stdout : process.stdout);
|
|
189
|
+
const handle = serveStdio(build, {
|
|
190
|
+
transport: new StdioServerTransport(wire.input, wire.output),
|
|
191
|
+
onerror: /* @__PURE__ */ __name((error) => context.renderer.note(`mcp: ${error.message}`), "onerror")
|
|
192
|
+
});
|
|
193
|
+
const ended = await new Promise((resolve) => {
|
|
194
|
+
wire.ended.then(() => resolve("input"));
|
|
195
|
+
if (own)
|
|
196
|
+
signal?.addEventListener("abort", () => resolve("stopped"), { once: true });
|
|
197
|
+
else {
|
|
198
|
+
process.once("SIGINT", () => resolve("stopped"));
|
|
199
|
+
process.once("SIGTERM", () => resolve("stopped"));
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
if (ended === "input")
|
|
203
|
+
await wire.answered();
|
|
204
|
+
wire.release();
|
|
205
|
+
await handle.close();
|
|
206
|
+
}, "serveAppOverStdio");
|
|
207
|
+
var serveAppOverHttp = /* @__PURE__ */ __name(async (command, context, options, http) => {
|
|
208
|
+
const { app } = options;
|
|
209
|
+
const { build } = createAppServer(command, context, options);
|
|
210
|
+
const { serveOverHttp } = await import("./serve-L6KLLXK2.js");
|
|
211
|
+
const listening = await serveOverHttp(build, {
|
|
212
|
+
...http,
|
|
213
|
+
appName: app.command,
|
|
214
|
+
onCode: /* @__PURE__ */ __name((code, expires) => context.renderer.note(context.env[mcpHttpMarker(app.envPrefix)] === void 0 ? `login code for a new browser app: ${code} (until ${expires.toTimeString().slice(0, 5)}; a new one after each login)` : `a new login code for a browser app: \`${app.command} ${context.settings.profile} mcp server status\``), "onCode"),
|
|
215
|
+
onError: /* @__PURE__ */ __name((error) => context.renderer.note(`mcp: ${error.message}`), "onError")
|
|
216
|
+
}).catch((error) => {
|
|
217
|
+
if (error.code === "EADDRINUSE")
|
|
218
|
+
throw new CliError("configuration_error", `port ${http.port} is in use \u2014 pass another with --port`);
|
|
219
|
+
throw error;
|
|
220
|
+
});
|
|
221
|
+
context.renderer.note(`serving on ${listening.url.href} \u2014 point your tunnel at it; connectors use ${mcpUrlOf(http.publicUrl).href}`);
|
|
222
|
+
await new Promise((resolve) => {
|
|
223
|
+
process.once("SIGINT", resolve);
|
|
224
|
+
process.once("SIGTERM", resolve);
|
|
225
|
+
});
|
|
226
|
+
await listening.close();
|
|
227
|
+
}, "serveAppOverHttp");
|
|
228
|
+
export {
|
|
229
|
+
createAppServer,
|
|
230
|
+
serveAppOverHttp,
|
|
231
|
+
serveAppOverStdio
|
|
232
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { createRequire as __bundleRequire } from "node:module";
|
|
2
|
+
const require = __bundleRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
DefaultLogger,
|
|
5
|
+
DrizzleQueryError,
|
|
6
|
+
NoopLogger,
|
|
7
|
+
SQLiteAsyncDatabase,
|
|
8
|
+
SQLiteAsyncPreparedQuery,
|
|
9
|
+
SQLiteAsyncSession,
|
|
10
|
+
SQLiteAsyncTransaction,
|
|
11
|
+
SQLiteDialect,
|
|
12
|
+
booleanFromInteger,
|
|
13
|
+
bufferFromBytes,
|
|
14
|
+
castToText,
|
|
15
|
+
dateFromStoredMilliseconds,
|
|
16
|
+
dateFromStoredSeconds,
|
|
17
|
+
entityKind,
|
|
18
|
+
jitCompatCheck,
|
|
19
|
+
refineSqliteCodecs,
|
|
20
|
+
sql
|
|
21
|
+
} from "./chunk-NW7IMGRR.js";
|
|
22
|
+
import {
|
|
23
|
+
__name
|
|
24
|
+
} from "./chunk-ZVVMGPBJ.js";
|
|
25
|
+
|
|
26
|
+
// node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/bun.js
|
|
27
|
+
import { Database } from "bun:sqlite";
|
|
28
|
+
var bunSQLiteCodecs = refineSqliteCodecs({
|
|
29
|
+
"integer:boolean": { normalize: booleanFromInteger },
|
|
30
|
+
"integer:timestamp": { normalize: dateFromStoredSeconds },
|
|
31
|
+
"integer:timestamp_ms": { normalize: dateFromStoredMilliseconds },
|
|
32
|
+
"text:json": { normalize: JSON.parse },
|
|
33
|
+
blob: { normalize: bufferFromBytes },
|
|
34
|
+
"blob:json": {
|
|
35
|
+
cast: castToText,
|
|
36
|
+
normalize: JSON.parse
|
|
37
|
+
},
|
|
38
|
+
"blob:bigint": {
|
|
39
|
+
cast: castToText,
|
|
40
|
+
normalize: BigInt
|
|
41
|
+
},
|
|
42
|
+
numeric: {
|
|
43
|
+
cast: castToText,
|
|
44
|
+
normalize: String
|
|
45
|
+
},
|
|
46
|
+
"numeric:number": { normalize: Number },
|
|
47
|
+
"numeric:bigint": {
|
|
48
|
+
cast: castToText,
|
|
49
|
+
normalize: BigInt
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
var SQLiteBunSession = class extends SQLiteAsyncSession {
|
|
53
|
+
static {
|
|
54
|
+
__name(this, "SQLiteBunSession");
|
|
55
|
+
}
|
|
56
|
+
client;
|
|
57
|
+
relations;
|
|
58
|
+
options;
|
|
59
|
+
static [entityKind] = "SQLiteBunSession";
|
|
60
|
+
logger;
|
|
61
|
+
constructor(client, dialect, relations, options = {}) {
|
|
62
|
+
super(dialect, "sync");
|
|
63
|
+
this.client = client;
|
|
64
|
+
this.relations = relations;
|
|
65
|
+
this.options = options;
|
|
66
|
+
this.logger = options.logger ?? new NoopLogger();
|
|
67
|
+
}
|
|
68
|
+
exec(query) {
|
|
69
|
+
this.client.exec(query);
|
|
70
|
+
}
|
|
71
|
+
prepareQuery(query, mode, _prepare, executeMethod, mapper, queryMetadata) {
|
|
72
|
+
let stmt;
|
|
73
|
+
try {
|
|
74
|
+
stmt = this.client.query(query.sql);
|
|
75
|
+
} catch (e) {
|
|
76
|
+
throw new DrizzleQueryError(query.sql, this.options.paramsInErrors ? query.params : void 0, e);
|
|
77
|
+
}
|
|
78
|
+
return new SQLiteAsyncPreparedQuery("sync", executeMethod, {
|
|
79
|
+
all: /* @__PURE__ */ __name((params) => {
|
|
80
|
+
if (mode === "arrays") return stmt.values(...params);
|
|
81
|
+
return stmt.all(...params);
|
|
82
|
+
}, "all"),
|
|
83
|
+
get: /* @__PURE__ */ __name((params) => {
|
|
84
|
+
if (mode === "arrays") return stmt.values(...params)[0];
|
|
85
|
+
return stmt.get(...params);
|
|
86
|
+
}, "get"),
|
|
87
|
+
run: /* @__PURE__ */ __name((params) => {
|
|
88
|
+
return stmt.run(...params);
|
|
89
|
+
}, "run")
|
|
90
|
+
}, query, mapper, mode, this.logger, void 0, queryMetadata, void 0, this.options.paramsInErrors);
|
|
91
|
+
}
|
|
92
|
+
transaction(transaction, config = {}) {
|
|
93
|
+
const tx = new SQLiteBunTransaction("sync", this.dialect, this, this.relations);
|
|
94
|
+
let result;
|
|
95
|
+
const nativeTx = this.client.transaction(() => {
|
|
96
|
+
result = transaction(tx);
|
|
97
|
+
});
|
|
98
|
+
if (config.behavior === "concurrent") throw new Error("Concurrent transactions are not supported by driver");
|
|
99
|
+
nativeTx[config.behavior ?? "deferred"]();
|
|
100
|
+
return result;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
var SQLiteBunTransaction = class SQLiteBunTransaction2 extends SQLiteAsyncTransaction {
|
|
104
|
+
static {
|
|
105
|
+
__name(this, "SQLiteBunTransaction2");
|
|
106
|
+
}
|
|
107
|
+
static [entityKind] = "SQLiteBunTransaction";
|
|
108
|
+
transaction(transaction) {
|
|
109
|
+
const savepointName = `sp${this.nestedIndex}`;
|
|
110
|
+
const tx = new SQLiteBunTransaction2("sync", this.dialect, this.session, this._.relations, this.nestedIndex + 1);
|
|
111
|
+
this.session.run(sql.raw(`savepoint ${savepointName}`));
|
|
112
|
+
try {
|
|
113
|
+
const result = transaction(tx);
|
|
114
|
+
this.session.run(sql.raw(`release savepoint ${savepointName}`));
|
|
115
|
+
return result;
|
|
116
|
+
} catch (err) {
|
|
117
|
+
try {
|
|
118
|
+
this.session.run(sql.raw(`rollback to savepoint ${savepointName}`));
|
|
119
|
+
} catch {
|
|
120
|
+
}
|
|
121
|
+
throw err;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
var SQLiteBunDatabase = class extends SQLiteAsyncDatabase {
|
|
126
|
+
static {
|
|
127
|
+
__name(this, "SQLiteBunDatabase");
|
|
128
|
+
}
|
|
129
|
+
static [entityKind] = "SQLiteBunDatabase";
|
|
130
|
+
};
|
|
131
|
+
function construct(client, config = {}) {
|
|
132
|
+
const dialect = new SQLiteDialect({
|
|
133
|
+
codecs: config.codecs ?? bunSQLiteCodecs,
|
|
134
|
+
useJitMappers: jitCompatCheck(config.jit)
|
|
135
|
+
});
|
|
136
|
+
let logger;
|
|
137
|
+
if (config.logger === true) logger = new DefaultLogger();
|
|
138
|
+
else if (config.logger !== false) logger = config.logger;
|
|
139
|
+
const relations = config.relations ?? {};
|
|
140
|
+
const db = new SQLiteBunDatabase("sync", dialect, new SQLiteBunSession(client, dialect, relations, {
|
|
141
|
+
logger,
|
|
142
|
+
paramsInErrors: config.paramsInErrors
|
|
143
|
+
}), relations);
|
|
144
|
+
db.$client = client;
|
|
145
|
+
return db;
|
|
146
|
+
}
|
|
147
|
+
__name(construct, "construct");
|
|
148
|
+
function drizzle(...params) {
|
|
149
|
+
if (params[0] === void 0 || typeof params[0] === "string") return construct(params[0] === void 0 ? new Database() : new Database(params[0]), params[1]);
|
|
150
|
+
const { connection, client, ...DrizzleSQLiteConfig } = params[0];
|
|
151
|
+
if (client) return construct(client, DrizzleSQLiteConfig);
|
|
152
|
+
if (typeof connection === "object") {
|
|
153
|
+
const { source, ...opts } = connection;
|
|
154
|
+
const options = Object.values(opts).filter((v) => v !== void 0).length ? opts : void 0;
|
|
155
|
+
return construct(new Database(source, options), DrizzleSQLiteConfig);
|
|
156
|
+
}
|
|
157
|
+
return construct(new Database(connection), DrizzleSQLiteConfig);
|
|
158
|
+
}
|
|
159
|
+
__name(drizzle, "drizzle");
|
|
160
|
+
(function(_drizzle) {
|
|
161
|
+
function mock(config) {
|
|
162
|
+
return construct({}, config);
|
|
163
|
+
}
|
|
164
|
+
__name(mock, "mock");
|
|
165
|
+
_drizzle.mock = mock;
|
|
166
|
+
})(drizzle || (drizzle = {}));
|
|
167
|
+
export {
|
|
168
|
+
drizzle
|
|
169
|
+
};
|