@wirecat/zoom-cli 0.56.0 → 0.57.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.
Files changed (145) hide show
  1. package/README.md +1 -1
  2. package/dist/bin/zm.js +35 -5
  3. package/dist/bundle/all-profiles-EKHWTGOY.js +25 -0
  4. package/dist/bundle/answer-policy-KH2IFXPN.js +96 -0
  5. package/dist/bundle/anthropic-VL54IUGF.js +70 -0
  6. package/dist/bundle/bun-ADJVI4HY.js +169 -0
  7. package/dist/bundle/bun-sqlite-2SDA3YOT.js +69 -0
  8. package/dist/bundle/chunk-2IKY7VBH.js +9 -0
  9. package/dist/bundle/chunk-2WOGZDZG.js +431 -0
  10. package/dist/bundle/chunk-4R7HYNZS.js +73 -0
  11. package/dist/bundle/chunk-4VCA7QU3.js +538 -0
  12. package/dist/bundle/chunk-4YLS4YLS.js +29 -0
  13. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  14. package/dist/bundle/chunk-5F7IOESV.js +281 -0
  15. package/dist/bundle/chunk-5QESMCQK.js +122 -0
  16. package/dist/bundle/chunk-6M6FJV5D.js +138 -0
  17. package/dist/bundle/chunk-6MX5T6AQ.js +17 -0
  18. package/dist/bundle/chunk-6P3YHT54.js +385 -0
  19. package/dist/bundle/chunk-7A6PZUDR.js +938 -0
  20. package/dist/bundle/chunk-7GUG6UZS.js +884 -0
  21. package/dist/bundle/chunk-7JZJMHQY.js +487 -0
  22. package/dist/bundle/chunk-A4ETXPMZ.js +98 -0
  23. package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
  24. package/dist/bundle/chunk-AE4BOXH7.js +5292 -0
  25. package/dist/bundle/chunk-AN3GVZTU.js +76 -0
  26. package/dist/bundle/chunk-BAYNCCNM.js +215 -0
  27. package/dist/bundle/chunk-BW2WPOXP.js +166 -0
  28. package/dist/bundle/chunk-BW52AJ4R.js +3387 -0
  29. package/dist/bundle/chunk-CB5UTASG.js +18 -0
  30. package/dist/bundle/chunk-CLMXBW53.js +1028 -0
  31. package/dist/bundle/chunk-DCTXOMOR.js +35 -0
  32. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  33. package/dist/bundle/chunk-EOQFWJJD.js +1095 -0
  34. package/dist/bundle/chunk-G4R4ZIGD.js +3569 -0
  35. package/dist/bundle/chunk-G4VZDINN.js +161 -0
  36. package/dist/bundle/chunk-GARCOIB6.js +409 -0
  37. package/dist/bundle/chunk-GKMGS7G5.js +1938 -0
  38. package/dist/bundle/chunk-HCNMFFG3.js +82 -0
  39. package/dist/bundle/chunk-HG5KRV55.js +1970 -0
  40. package/dist/bundle/chunk-HKYLSIZ2.js +82 -0
  41. package/dist/bundle/chunk-HTQTIKWP.js +928 -0
  42. package/dist/bundle/chunk-I4VQDXFR.js +100 -0
  43. package/dist/bundle/chunk-ICSKEDPI.js +36139 -0
  44. package/dist/bundle/chunk-IP4OK7RQ.js +24 -0
  45. package/dist/bundle/chunk-IVQ6342B.js +2 -0
  46. package/dist/bundle/chunk-K72SEMYI.js +160 -0
  47. package/dist/bundle/chunk-LHRCJYFC.js +19 -0
  48. package/dist/bundle/chunk-LPTIQLDW.js +192 -0
  49. package/dist/bundle/chunk-LQ3T2ZIX.js +124 -0
  50. package/dist/bundle/chunk-LSVI3A5X.js +836 -0
  51. package/dist/bundle/chunk-LW2G4U6W.js +570 -0
  52. package/dist/bundle/chunk-LXB6ONWC.js +3517 -0
  53. package/dist/bundle/chunk-LY26NW3I.js +6848 -0
  54. package/dist/bundle/chunk-MAEFLDHG.js +6092 -0
  55. package/dist/bundle/chunk-MZH4GDR4.js +45 -0
  56. package/dist/bundle/chunk-NN5B24KP.js +1109 -0
  57. package/dist/bundle/chunk-NO7CJEYV.js +22 -0
  58. package/dist/bundle/chunk-NTDWAAGL.js +18435 -0
  59. package/dist/bundle/chunk-NW3X3G5X.js +264 -0
  60. package/dist/bundle/chunk-O66V2WHK.js +48 -0
  61. package/dist/bundle/chunk-OCGPZHXW.js +25 -0
  62. package/dist/bundle/chunk-OIHDCGV4.js +151 -0
  63. package/dist/bundle/chunk-OVSWVPXL.js +8190 -0
  64. package/dist/bundle/chunk-PIN5RZ3D.js +63 -0
  65. package/dist/bundle/chunk-QLIB3PEC.js +1146 -0
  66. package/dist/bundle/chunk-QTR6D5HT.js +58 -0
  67. package/dist/bundle/chunk-QUJPQMHJ.js +2315 -0
  68. package/dist/bundle/chunk-R3HPOCZD.js +188 -0
  69. package/dist/bundle/chunk-RMV4C2YL.js +482 -0
  70. package/dist/bundle/chunk-RRRBMQ2E.js +844 -0
  71. package/dist/bundle/chunk-S4S7E54J.js +60 -0
  72. package/dist/bundle/chunk-SB6WOSHG.js +1109 -0
  73. package/dist/bundle/chunk-SE75DPBY.js +31 -0
  74. package/dist/bundle/chunk-SQJ7EH2D.js +97 -0
  75. package/dist/bundle/chunk-TKCHUT2H.js +422 -0
  76. package/dist/bundle/chunk-TLQUKHEM.js +193 -0
  77. package/dist/bundle/chunk-TZ2MKETI.js +100 -0
  78. package/dist/bundle/chunk-UC44ZMQV.js +78 -0
  79. package/dist/bundle/chunk-UI5UTMSZ.js +275 -0
  80. package/dist/bundle/chunk-VPPYYWOH.js +630 -0
  81. package/dist/bundle/chunk-WJHK5D7Z.js +35612 -0
  82. package/dist/bundle/chunk-WQ24UC44.js +239 -0
  83. package/dist/bundle/chunk-X5DFDGWS.js +2 -0
  84. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  85. package/dist/bundle/chunk-YB4DMKYX.js +119 -0
  86. package/dist/bundle/chunk-Z4TZ6TAF.js +288 -0
  87. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  88. package/dist/bundle/cli-72EQATJF.js +825 -0
  89. package/dist/bundle/command-contract-4MHSZUN3.js +38 -0
  90. package/dist/bundle/config-GFIJK6G2.js +79 -0
  91. package/dist/bundle/dist-IBNHCQXT.js +136 -0
  92. package/dist/bundle/dist-XUFQCJXW.js +7577 -0
  93. package/dist/bundle/echarts-RFTK737T.js +42501 -0
  94. package/dist/bundle/embed-7QYA2ZZE.js +35 -0
  95. package/dist/bundle/embedder-YNN6PCHG.js +108 -0
  96. package/dist/bundle/first-run-EVSRQKZJ.js +23 -0
  97. package/dist/bundle/first-screen-RG4GUKW7.js +36 -0
  98. package/dist/bundle/folders-JEPOMYM4.js +13 -0
  99. package/dist/bundle/instructions-FHNL7CMW.js +9 -0
  100. package/dist/bundle/main-NYGJXPH7.js +130 -0
  101. package/dist/bundle/mcp-IXFC2VVR.js +165 -0
  102. package/dist/bundle/mcp-VGSZDCKK.js +189 -0
  103. package/dist/bundle/mcp-XKP2PXLS.js +92 -0
  104. package/dist/bundle/meetings-IBPI4MM4.js +215 -0
  105. package/dist/bundle/node-P4E63KXA.js +2340 -0
  106. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  107. package/dist/bundle/node-ZMCACJVS.js +176 -0
  108. package/dist/bundle/node-sqlite-ZNGOBA5Q.js +45 -0
  109. package/dist/bundle/oauth-Q6LKF7DB.js +17 -0
  110. package/dist/bundle/open-LJ332Y5O.js +19 -0
  111. package/dist/bundle/output-file-RYQZ3RTE.js +63 -0
  112. package/dist/bundle/process-ZPTLNVQS.js +91 -0
  113. package/dist/bundle/program-IBRQBQ6W.js +5845 -0
  114. package/dist/bundle/prompt-RT7GUUXH.js +12 -0
  115. package/dist/bundle/recognize-QXGE7YJH.js +190 -0
  116. package/dist/bundle/remote-FD4MZQV3.js +26 -0
  117. package/dist/bundle/rerank-V6AVV755.js +49 -0
  118. package/dist/bundle/run-log-RE2EI3UU.js +111 -0
  119. package/dist/bundle/serve-HIJTFAW7.js +19 -0
  120. package/dist/bundle/server-3QOXOYYL.js +53 -0
  121. package/dist/bundle/server-WLJCU7KK.js +812 -0
  122. package/dist/bundle/services-KC5KQFBS.js +330 -0
  123. package/dist/bundle/speech-5JOXLYDA.js +44 -0
  124. package/dist/bundle/state-PPGRB3T6.js +33 -0
  125. package/dist/bundle/store-LODVDPK3.js +141 -0
  126. package/dist/bundle/store-WB5BICTG.js +124 -0
  127. package/dist/bundle/store-connection-EG6Z5ITP.js +76 -0
  128. package/dist/bundle/store-maintenance-command-Q5WMFUZ2.js +54 -0
  129. package/dist/bundle/streaming-UGFFNOXL.js +15 -0
  130. package/dist/bundle/tokens-AF5CPY2F.js +17 -0
  131. package/dist/bundle/zm.js +8 -0
  132. package/dist/contract-overrides.d.ts.map +1 -1
  133. package/dist/contract-overrides.js +18 -16
  134. package/dist/contract-overrides.js.map +1 -1
  135. package/dist/mcp-command.d.ts +3 -2
  136. package/dist/mcp-command.d.ts.map +1 -1
  137. package/dist/mcp-command.js +62 -10
  138. package/dist/mcp-command.js.map +1 -1
  139. package/dist/program-bindings.d.ts.map +1 -1
  140. package/dist/program-bindings.js +1 -0
  141. package/dist/program-bindings.js.map +1 -1
  142. package/dist/version.d.ts +1 -1
  143. package/dist/version.js +1 -1
  144. package/package.json +7 -5
  145. 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
- import { enableCompileCache } from "node:module";
3
- // Static imports would compile before this call; loading the program after it lets later runs reuse the cache.
4
- enableCompileCache();
5
- await import("./main.js");
6
- //# sourceMappingURL=zm.js.map
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.57.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-EKHWTGOY.js","../bundle/answer-policy-KH2IFXPN.js","../bundle/anthropic-VL54IUGF.js","../bundle/bun-ADJVI4HY.js","../bundle/bun-sqlite-2SDA3YOT.js","../bundle/cli-72EQATJF.js","../bundle/command-contract-4MHSZUN3.js","../bundle/config-GFIJK6G2.js","../bundle/dist-IBNHCQXT.js","../bundle/dist-XUFQCJXW.js","../bundle/echarts-RFTK737T.js","../bundle/embed-7QYA2ZZE.js","../bundle/embedder-YNN6PCHG.js","../bundle/first-run-EVSRQKZJ.js","../bundle/first-screen-RG4GUKW7.js","../bundle/folders-JEPOMYM4.js","../bundle/instructions-FHNL7CMW.js","../bundle/main-NYGJXPH7.js","../bundle/mcp-IXFC2VVR.js","../bundle/mcp-VGSZDCKK.js","../bundle/mcp-XKP2PXLS.js","../bundle/meetings-IBPI4MM4.js","../bundle/node-P4E63KXA.js","../bundle/node-TLZSIHIJ.js","../bundle/node-ZMCACJVS.js","../bundle/node-sqlite-ZNGOBA5Q.js","../bundle/oauth-Q6LKF7DB.js","../bundle/open-LJ332Y5O.js","../bundle/output-file-RYQZ3RTE.js","../bundle/process-ZPTLNVQS.js","../bundle/program-IBRQBQ6W.js","../bundle/prompt-RT7GUUXH.js","../bundle/recognize-QXGE7YJH.js","../bundle/remote-FD4MZQV3.js","../bundle/rerank-V6AVV755.js","../bundle/run-log-RE2EI3UU.js","../bundle/serve-HIJTFAW7.js","../bundle/server-3QOXOYYL.js","../bundle/server-WLJCU7KK.js","../bundle/services-KC5KQFBS.js","../bundle/speech-5JOXLYDA.js","../bundle/state-PPGRB3T6.js","../bundle/store-LODVDPK3.js","../bundle/store-WB5BICTG.js","../bundle/store-connection-EG6Z5ITP.js","../bundle/store-maintenance-command-Q5WMFUZ2.js","../bundle/streaming-UGFFNOXL.js","../bundle/tokens-AF5CPY2F.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-5F7IOESV.js";
10
+ import "./chunk-AN3GVZTU.js";
11
+ import "./chunk-VPPYYWOH.js";
12
+ import "./chunk-5D4AEUVA.js";
13
+ import "./chunk-2WOGZDZG.js";
14
+ import "./chunk-NO7CJEYV.js";
15
+ import "./chunk-IVQ6342B.js";
16
+ import "./chunk-AE4BOXH7.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-2IKY7VBH.js";
6
+ import "./chunk-NTDWAAGL.js";
7
+ import "./chunk-UI5UTMSZ.js";
8
+ import "./chunk-IP4OK7RQ.js";
9
+ import "./chunk-UC44ZMQV.js";
10
+ import "./chunk-SB6WOSHG.js";
11
+ import "./chunk-O66V2WHK.js";
12
+ import "./chunk-4VCA7QU3.js";
13
+ import "./chunk-G4VZDINN.js";
14
+ import "./chunk-OVSWVPXL.js";
15
+ import "./chunk-GKMGS7G5.js";
16
+ import "./chunk-QLIB3PEC.js";
17
+ import "./chunk-4R7HYNZS.js";
18
+ import "./chunk-ICSKEDPI.js";
19
+ import "./chunk-RRRBMQ2E.js";
20
+ import "./chunk-7JZJMHQY.js";
21
+ import "./chunk-BW2WPOXP.js";
22
+ import "./chunk-G4R4ZIGD.js";
23
+ import {
24
+ judgedEffects,
25
+ judgedTargets
26
+ } from "./chunk-MAEFLDHG.js";
27
+ import "./chunk-OCGPZHXW.js";
28
+ import "./chunk-PIN5RZ3D.js";
29
+ import "./chunk-2WOGZDZG.js";
30
+ import "./chunk-EOQFWJJD.js";
31
+ import "./chunk-NO7CJEYV.js";
32
+ import "./chunk-YB4DMKYX.js";
33
+ import "./chunk-BAYNCCNM.js";
34
+ import "./chunk-OIHDCGV4.js";
35
+ import "./chunk-LW2G4U6W.js";
36
+ import "./chunk-S4S7E54J.js";
37
+ import "./chunk-HG5KRV55.js";
38
+ import {
39
+ failureContext
40
+ } from "./chunk-WQ24UC44.js";
41
+ import "./chunk-LPTIQLDW.js";
42
+ import "./chunk-RMV4C2YL.js";
43
+ import "./chunk-HTQTIKWP.js";
44
+ import "./chunk-LQ3T2ZIX.js";
45
+ import "./chunk-TKCHUT2H.js";
46
+ import "./chunk-HKYLSIZ2.js";
47
+ import "./chunk-HCNMFFG3.js";
48
+ import "./chunk-SE75DPBY.js";
49
+ import "./chunk-MZH4GDR4.js";
50
+ import "./chunk-5QESMCQK.js";
51
+ import "./chunk-CLMXBW53.js";
52
+ import "./chunk-NW3X3G5X.js";
53
+ import "./chunk-WJHK5D7Z.js";
54
+ import "./chunk-6M6FJV5D.js";
55
+ import "./chunk-QUJPQMHJ.js";
56
+ import "./chunk-7GUG6UZS.js";
57
+ import "./chunk-GARCOIB6.js";
58
+ import "./chunk-4YLS4YLS.js";
59
+ import "./chunk-CB5UTASG.js";
60
+ import "./chunk-TZ2MKETI.js";
61
+ import "./chunk-LXB6ONWC.js";
62
+ import "./chunk-LSVI3A5X.js";
63
+ import "./chunk-IVQ6342B.js";
64
+ import {
65
+ errorObjectOf,
66
+ errorRecordOf,
67
+ exitCodeOfError,
68
+ renderError
69
+ } from "./chunk-AE4BOXH7.js";
70
+ import "./chunk-Y5E2WNWB.js";
71
+ import "./chunk-LY26NW3I.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-SE75DPBY.js";
6
+ import {
7
+ messagesFor,
8
+ systemFor
9
+ } from "./chunk-MZH4GDR4.js";
10
+ import {
11
+ Anthropic
12
+ } from "./chunk-ADLS6FVG.js";
13
+ import {
14
+ array,
15
+ optional,
16
+ strictObject,
17
+ string
18
+ } from "./chunk-AE4BOXH7.js";
19
+ import "./chunk-Y5E2WNWB.js";
20
+ import {
21
+ __name
22
+ } from "./chunk-ZVVMGPBJ.js";
23
+
24
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/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,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-LY26NW3I.js";
22
+ import {
23
+ __name
24
+ } from "./chunk-ZVVMGPBJ.js";
25
+
26
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/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
+ };
@@ -0,0 +1,69 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ loadVectorExtension,
5
+ vectorExtension
6
+ } from "./chunk-QTR6D5HT.js";
7
+ import "./chunk-AE4BOXH7.js";
8
+ import {
9
+ importFrom
10
+ } from "./chunk-Y5E2WNWB.js";
11
+ import {
12
+ __name
13
+ } from "./chunk-ZVVMGPBJ.js";
14
+
15
+ // node_modules/.pnpm/@wirecat+cli-core@0.469.0_@wirecat+cli-base@0.65.0_commander@15.0.0_typescript@7.0.2_vi_80b586dbc8b099637a6e461856c2ee6b/node_modules/@wirecat/cli-core/dist/store/drivers/bun-sqlite.js
16
+ var customised = false;
17
+ var ownLibrary = /* @__PURE__ */ __name(async () => {
18
+ try {
19
+ const { libraryFor } = await importFrom(new URL("store/drivers/bun-sqlite.js", import.meta.resolve("@wirecat/cli-core")).href, "@wirecat/cli-core-sqlite");
20
+ return libraryFor();
21
+ } catch {
22
+ return void 0;
23
+ }
24
+ }, "ownLibrary");
25
+ var bunDatabase = /* @__PURE__ */ __name(async () => {
26
+ const specifier = "bun:sqlite";
27
+ const { Database } = await importFrom(new URL("store/drivers/bun-sqlite.js", import.meta.resolve("@wirecat/cli-core")).href, specifier);
28
+ if (process.platform === "darwin" && !customised) {
29
+ customised = true;
30
+ const library = await ownLibrary();
31
+ if (library)
32
+ Database.setCustomSQLite(library);
33
+ }
34
+ return Database;
35
+ }, "bunDatabase");
36
+ var openWithBunSqlite = /* @__PURE__ */ __name(async (path) => cacheOverBunSqlite(await bunClient(path)), "openWithBunSqlite");
37
+ var bunClient = /* @__PURE__ */ __name(async (path, options) => {
38
+ const Database = await bunDatabase();
39
+ const extension = await vectorExtension();
40
+ const client = options ? new Database(path, options) : new Database(path);
41
+ try {
42
+ loadVectorExtension(client, extension);
43
+ return client;
44
+ } catch (error) {
45
+ client.close();
46
+ throw error;
47
+ }
48
+ }, "bunClient");
49
+ var cacheOverBunSqlite = /* @__PURE__ */ __name((database) => {
50
+ return {
51
+ exec: /* @__PURE__ */ __name((sql) => database.exec(sql), "exec"),
52
+ prepare: /* @__PURE__ */ __name((sql) => {
53
+ const statement = database.query(sql);
54
+ return {
55
+ run: /* @__PURE__ */ __name((...parameters) => ({ changes: Number(statement.run(...parameters).changes) }), "run"),
56
+ // Bun answers null for no row; the seam promises undefined, and `!== undefined` checks rely on it.
57
+ get: /* @__PURE__ */ __name((...parameters) => statement.get(...parameters) ?? void 0, "get"),
58
+ all: /* @__PURE__ */ __name((...parameters) => statement.all(...parameters), "all")
59
+ };
60
+ }, "prepare"),
61
+ close: /* @__PURE__ */ __name(() => database.close(), "close")
62
+ };
63
+ }, "cacheOverBunSqlite");
64
+ export {
65
+ bunClient,
66
+ bunDatabase,
67
+ cacheOverBunSqlite,
68
+ openWithBunSqlite
69
+ };
@@ -0,0 +1,9 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+
4
+ // dist/version.js
5
+ var VERSION = "0.57.0";
6
+
7
+ export {
8
+ VERSION
9
+ };