@wirecat/tg-cli 0.122.0 → 0.124.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 (132) hide show
  1. package/contracts/wirecat.json +62 -4
  2. package/dist/bin/tg.js +2 -2
  3. package/dist/bundle/{adapter-ZI57T2L5.js → adapter-GEIZVMWU.js} +55 -53
  4. package/dist/bundle/{all-profiles-7VXJF42C.js → all-profiles-EY4GJFWN.js} +10 -10
  5. package/dist/bundle/{anthropic-DKRXIWVV.js → anthropic-RIANJ7WM.js} +17 -10
  6. package/dist/bundle/{app-server-F5MKHZ7S.js → app-server-LW7WBFIF.js} +62 -52
  7. package/dist/bundle/{bot-api-F24NWJT3.js → bot-api-FHIQ66OM.js} +54 -52
  8. package/dist/bundle/{bot-history-U3WM3A7S.js → bot-history-O34YZEFH.js} +18 -18
  9. package/dist/bundle/{bun-OMTJAXGK.js → bun-MJWD4VGV.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-HSYLO46A.js → bun-sqlite-LCHVO3OB.js} +9 -5
  11. package/dist/bundle/{chunk-DCGGZUNJ.js → chunk-2GFGZDWS.js} +2 -2
  12. package/dist/bundle/{chunk-7FWU4RON.js → chunk-2NG4JPP7.js} +4 -4
  13. package/dist/bundle/{chunk-UGEYQWEO.js → chunk-2YLIVDWJ.js} +2 -2
  14. package/dist/bundle/chunk-3PLMMFP6.js +1068 -0
  15. package/dist/bundle/{chunk-27SVHRHV.js → chunk-3VVZFBE2.js} +23 -4
  16. package/dist/bundle/{chunk-FYHFAOPM.js → chunk-42R4YO4L.js} +12064 -9579
  17. package/dist/bundle/{chunk-U6HEZPCR.js → chunk-4CIVGT4P.js} +57 -28
  18. package/dist/bundle/{chunk-CB6AHU6H.js → chunk-4EGB7GSW.js} +96 -19
  19. package/dist/bundle/chunk-54JPEGQA.js +71 -0
  20. package/dist/bundle/chunk-5EL6E6PW.js +13 -0
  21. package/dist/bundle/{chunk-QROAXWDU.js → chunk-7AWJZ6NJ.js} +8 -8
  22. package/dist/bundle/{chunk-2UHANFLM.js → chunk-A5RWKKBZ.js} +3 -3
  23. package/dist/bundle/{chunk-7I6YVQHW.js → chunk-ASEBKZFY.js} +2 -2
  24. package/dist/bundle/{chunk-SODUFMDW.js → chunk-BV3HZYOX.js} +7435 -6559
  25. package/dist/bundle/{chunk-FHWUOFWX.js → chunk-CDSSKK5J.js} +3 -3
  26. package/dist/bundle/{chunk-6LMEIELG.js → chunk-DFSLHF46.js} +1 -1
  27. package/dist/bundle/{chunk-Y74WJL3M.js → chunk-E66JBGZZ.js} +6 -6
  28. package/dist/bundle/{chunk-VUBZFMGP.js → chunk-E6VSARSU.js} +2 -2
  29. package/dist/bundle/{chunk-MFWWZ6XL.js → chunk-F3GHTPAO.js} +4 -4
  30. package/dist/bundle/{chunk-NU4RMUMQ.js → chunk-GUL6QLNI.js} +40 -21
  31. package/dist/bundle/{chunk-E3MFMMVY.js → chunk-HEV23NIB.js} +6 -6
  32. package/dist/bundle/{chunk-FZKHFTKH.js → chunk-HSRO77SW.js} +35 -29
  33. package/dist/bundle/{chunk-FATTEYZH.js → chunk-I4JUKRW7.js} +2 -2
  34. package/dist/bundle/{chunk-YDMKP7PO.js → chunk-IK6XKMLL.js} +1 -1
  35. package/dist/bundle/{chunk-DDSAJKPO.js → chunk-ISGXVFA4.js} +4 -4
  36. package/dist/bundle/chunk-IVFUSI7G.js +53 -0
  37. package/dist/bundle/{chunk-DTTONQW7.js → chunk-KVJSCJGZ.js} +2 -2
  38. package/dist/bundle/{chunk-NE3EGYPD.js → chunk-LKMZ53GC.js} +4 -7
  39. package/dist/bundle/{chunk-YFEH7OWG.js → chunk-M4W4Y5YR.js} +132 -40
  40. package/dist/bundle/{chunk-R2IW6JBV.js → chunk-N5UM63JW.js} +343 -112
  41. package/dist/bundle/{chunk-V4BPS7MH.js → chunk-NL4COYPY.js} +9 -9
  42. package/dist/bundle/{chunk-ZNPRTCUO.js → chunk-NQXVZ5WT.js} +15 -117
  43. package/dist/bundle/{chunk-4MFMUBHH.js → chunk-OH3IZ6GW.js} +2395 -2369
  44. package/dist/bundle/{chunk-RX5CJ55S.js → chunk-OIF4B526.js} +1 -1
  45. package/dist/bundle/{chunk-4W4EVVL4.js → chunk-OK4M4MWI.js} +4 -4
  46. package/dist/bundle/{chunk-W34QQMBK.js → chunk-OVDB5CQM.js} +1 -1
  47. package/dist/bundle/{chunk-7GCVON7M.js → chunk-PI4XXMPG.js} +6 -6
  48. package/dist/bundle/{chunk-MCPOZNWG.js → chunk-PJGOQSE5.js} +1 -1
  49. package/dist/bundle/{chunk-D3ODL4P7.js → chunk-PP4ZBLS4.js} +69 -6
  50. package/dist/bundle/{chunk-LVGX7VTD.js → chunk-PZ6H65D6.js} +4 -4
  51. package/dist/bundle/{chunk-ARKB3M5X.js → chunk-QFV36CAH.js} +4 -4
  52. package/dist/bundle/{chunk-7X6YLKTK.js → chunk-QGCVQRHV.js} +1 -1
  53. package/dist/bundle/{chunk-O5A4IS2D.js → chunk-QK4T3VN7.js} +1 -1
  54. package/dist/bundle/{chunk-VC6J7X76.js → chunk-QWAMX6CN.js} +12 -12
  55. package/dist/bundle/{chunk-ALW7ROTM.js → chunk-RBV4M2TC.js} +1 -1
  56. package/dist/bundle/{chunk-GJBGZQHN.js → chunk-RHJHOOUL.js} +354 -184
  57. package/dist/bundle/{chunk-4N2WJYLE.js → chunk-SGBH3D5D.js} +3 -3
  58. package/dist/bundle/{chunk-N7WDVH2O.js → chunk-UII3D3HR.js} +51 -51
  59. package/dist/bundle/{chunk-HAR76KJG.js → chunk-UP3J3YXH.js} +6 -6
  60. package/dist/bundle/{chunk-WGGSFGNZ.js → chunk-UR62DZ7Q.js} +48 -9
  61. package/dist/bundle/{chunk-RFFU6KQ5.js → chunk-VAKSXD4F.js} +13 -13
  62. package/dist/bundle/{chunk-TKJZENAZ.js → chunk-VGUWIHXD.js} +1 -1
  63. package/dist/bundle/chunk-VIIIC5LU.js +32 -0
  64. package/dist/bundle/{chunk-VDFEWSCS.js → chunk-VMWJGUVV.js} +14 -5
  65. package/dist/bundle/{chunk-C5CB6RIX.js → chunk-W4LMTNN2.js} +2 -2
  66. package/dist/bundle/{chunk-33ELXJRR.js → chunk-WKOVQ4OU.js} +14 -12
  67. package/dist/bundle/{chunk-6DLRATDC.js → chunk-WSLIXJET.js} +3817 -3378
  68. package/dist/bundle/{chunk-LQRZUNYF.js → chunk-XDHGM2Z7.js} +3 -3
  69. package/dist/bundle/{chunk-7DPWVKYS.js → chunk-XSGUG5WG.js} +4 -4
  70. package/dist/bundle/{chunk-CW3C7FSO.js → chunk-YQFO7WXQ.js} +2 -2
  71. package/dist/bundle/{chunk-2FXA32RJ.js → chunk-ZL5YG2WK.js} +14 -9
  72. package/dist/bundle/{chunk-VQL4RVXZ.js → chunk-ZNICTHSC.js} +1 -1
  73. package/dist/bundle/{chunk-PG3V225O.js → chunk-ZTMV5M3D.js} +32 -27
  74. package/dist/bundle/command-contract-UKOL455D.js +34 -0
  75. package/dist/bundle/{command-server-entry-N32NX4QW.js → command-server-entry-K52OEKIO.js} +24 -22
  76. package/dist/bundle/{decode-ZKJWSFXF.js → decode-OAE25LEJ.js} +5 -5
  77. package/dist/bundle/{dispatch-U2DW6UI7.js → dispatch-6GVTXIZ2.js} +8 -8
  78. package/dist/bundle/{echarts-QLVLIP73.js → echarts-EO4ZGKMN.js} +2 -2
  79. package/dist/bundle/{embed-LC6K7P3S.js → embed-TB2AS4AT.js} +6 -6
  80. package/dist/bundle/{embedder-6C3OQBOV.js → embedder-YKC42G6L.js} +9 -9
  81. package/dist/bundle/{entry-5H6LB3MP.js → entry-AB6FU7BN.js} +9 -8
  82. package/dist/bundle/{failure-HJD7S5UA.js → failure-CY7ACT6V.js} +2 -2
  83. package/dist/bundle/{first-run-IOYQ4XQK.js → first-run-CMQZHDI5.js} +11 -11
  84. package/dist/bundle/first-screen-XZ73W3VE.js +32 -0
  85. package/dist/bundle/{instructions-SZUMEDY3.js → instructions-RM3IB6ID.js} +1 -1
  86. package/dist/bundle/{mcp-7KQUJNFN.js → mcp-M5YCSWJJ.js} +2 -2
  87. package/dist/bundle/{node-V76RRFIA.js → node-D2PM62TA.js} +2 -2
  88. package/dist/bundle/{node-sqlite-2DTVOT7L.js → node-sqlite-UK5DE525.js} +10 -6
  89. package/dist/bundle/{oauth-CT7EBDRY.js → oauth-SKRG67A2.js} +7 -7
  90. package/dist/bundle/{open-G3VHOOMV.js → open-XP3SY62D.js} +5 -5
  91. package/dist/bundle/{openai-F4K7MVTZ.js → openai-Q3U46UPA.js} +21 -17
  92. package/dist/bundle/{process-XH3KEHSF.js → process-YJ4LHMJB.js} +1 -1
  93. package/dist/bundle/{program-FLGIHTHM.js → program-EEPEFKTR.js} +80 -63
  94. package/dist/bundle/{prompt-JWQ6UQ6R.js → prompt-WYTODP4U.js} +5 -5
  95. package/dist/bundle/{proxy-transport-ENU2SJYT.js → proxy-transport-HJMQ5QFT.js} +5 -5
  96. package/dist/bundle/{recognize-Z26T3SYD.js → recognize-K2S5QQU2.js} +4 -4
  97. package/dist/bundle/{remote-7KHT6V3O.js → remote-7RSAJ3JC.js} +9 -7
  98. package/dist/bundle/{rerank-6QVI74QY.js → rerank-RJX77BKD.js} +7 -7
  99. package/dist/bundle/{serve-WYDZTONY.js → serve-3E7NN3VW.js} +14 -14
  100. package/dist/bundle/server-ITHYDPWQ.js +62 -0
  101. package/dist/bundle/{server-Y4J2NCFA.js → server-O3KU56A4.js} +36 -35
  102. package/dist/bundle/sqlite-runtime-RCS5WSG5.js +19 -0
  103. package/dist/bundle/{state-YCXBKOD2.js → state-PLWSPSAG.js} +6 -6
  104. package/dist/bundle/store-3FYLH53Z.js +276 -0
  105. package/dist/bundle/{store-QECSDJRP.js → store-DWMKCXYL.js} +15 -13
  106. package/dist/bundle/store-maintenance-command-3UEKINRB.js +52 -0
  107. package/dist/bundle/tg.js +13 -13
  108. package/dist/commands/account-removal.d.ts.map +1 -1
  109. package/dist/commands/account-removal.js +5 -3
  110. package/dist/commands/account-removal.js.map +1 -1
  111. package/dist/commands/session.d.ts.map +1 -1
  112. package/dist/commands/session.js +21 -3
  113. package/dist/commands/session.js.map +1 -1
  114. package/dist/paths.d.ts +6 -0
  115. package/dist/paths.d.ts.map +1 -1
  116. package/dist/paths.js +23 -2
  117. package/dist/paths.js.map +1 -1
  118. package/dist/program.d.ts +4 -1
  119. package/dist/program.d.ts.map +1 -1
  120. package/dist/program.js +5 -2
  121. package/dist/program.js.map +1 -1
  122. package/dist/version.d.ts +1 -1
  123. package/dist/version.js +1 -1
  124. package/package.json +4 -4
  125. package/dist/bundle/chunk-GJFICFQB.js +0 -27
  126. package/dist/bundle/chunk-Y52T5EMB.js +0 -35
  127. package/dist/bundle/chunk-ZKHXWSKD.js +0 -265
  128. package/dist/bundle/command-contract-247AKZTE.js +0 -33
  129. package/dist/bundle/first-screen-NVK7PFX4.js +0 -31
  130. package/dist/bundle/server-UXQT7LZT.js +0 -61
  131. package/dist/bundle/store-maintenance-command-5YW6TRJA.js +0 -49
  132. /package/dist/bundle/{chunk-YVNHQFLC.js → chunk-HVJJWJYQ.js} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/installer.js
7
+ // node_modules/.pnpm/@wirecat+cli-base@0.98.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/installer.js
8
8
  var installerOf = /* @__PURE__ */ __name((scriptPath) => {
9
9
  const path = scriptPath.replaceAll("\\", "/");
10
10
  if (path.includes("/_npx/"))
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  singleLine
5
- } from "./chunk-VUBZFMGP.js";
5
+ } from "./chunk-E6VSARSU.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/names.js
10
+ // node_modules/.pnpm/@wirecat+cli-base@0.98.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/names.js
11
11
  var FIRST_PARTY_TOOLS = [
12
12
  { name: "tg", package: "@wirecat/tg-cli" },
13
13
  { name: "max", package: "@wirecat/max-cli" },
@@ -31,7 +31,7 @@ var DESCRIBE_FLAG = "--wcat-describe";
31
31
  var DESCRIBE_MAX_BYTES = 64 * 1024;
32
32
  var DISPATCH_FLAG = "--wcat-dispatch";
33
33
 
34
- // node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/describe.js
34
+ // node_modules/.pnpm/@wirecat+cli-base@0.98.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/describe.js
35
35
  var DESCRIBE_FORMAT = 1;
36
36
  var DESCRIBE_MANIFEST_FORMAT = 2;
37
37
  var describeAnswer = /* @__PURE__ */ __name((tool, manifest) => {
@@ -74,7 +74,7 @@ var parseDescribe = /* @__PURE__ */ __name((text) => {
74
74
  };
75
75
  }, "parseDescribe");
76
76
 
77
- // node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/shim.js
77
+ // node_modules/.pnpm/@wirecat+cli-base@0.98.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/shim.js
78
78
  import { lstatSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
79
79
  import { join } from "node:path";
80
80
  var SHIM_FORMAT = 2;
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/stdio-wire.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/mcp/stdio-wire.js
8
8
  import { PassThrough, Writable } from "node:stream";
9
9
  var lineReader = /* @__PURE__ */ __name((onMessage) => {
10
10
  let rest = "";
@@ -5,23 +5,23 @@ import {
5
5
  installFiles,
6
6
  megabytes,
7
7
  sharedModelsDirectory
8
- } from "./chunk-7FWU4RON.js";
8
+ } from "./chunk-2NG4JPP7.js";
9
9
  import {
10
10
  importFrom
11
11
  } from "./chunk-Y5E2WNWB.js";
12
12
  import {
13
13
  CliError
14
- } from "./chunk-VUBZFMGP.js";
14
+ } from "./chunk-E6VSARSU.js";
15
15
  import {
16
16
  __name
17
17
  } from "./chunk-ZVVMGPBJ.js";
18
18
 
19
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/embeddings/embed.js
19
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/embeddings/embed.js
20
20
  import { readFileSync as readFileSync2 } from "node:fs";
21
21
  import { availableParallelism } from "node:os";
22
22
  import { basename, join as join2 } from "node:path";
23
23
 
24
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/embeddings/onnx-runtime.js
24
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/embeddings/onnx-runtime.js
25
25
  import { createHash } from "node:crypto";
26
26
  import { copyFileSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
27
27
  import { join } from "node:path";
@@ -678,7 +678,7 @@ var Unzip = /* @__PURE__ */ (function() {
678
678
  return Unzip2;
679
679
  })();
680
680
 
681
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/embeddings/onnx-runtime.js
681
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/embeddings/onnx-runtime.js
682
682
  var ONNX_RUNTIME_VERSION = "1.30.0";
683
683
  var release = /* @__PURE__ */ __name((name, sha256, bytes) => ({
684
684
  name,
@@ -858,7 +858,7 @@ var openSession = /* @__PURE__ */ __name(async (bytes, threads, options = {}) =>
858
858
  return { ort, session: await ort.InferenceSession.create(bytes, options) };
859
859
  }, "openSession");
860
860
 
861
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/embeddings/embed.js
861
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/embeddings/embed.js
862
862
  var textModelsDirectory = /* @__PURE__ */ __name((env = process.env) => sharedModelsDirectory("text", env), "textModelsDirectory");
863
863
  var placedText = /* @__PURE__ */ __name((model, directory) => model.files.map((file) => [file, join2(directory, model.id, file.name)]), "placedText");
864
864
  var isTextModelInstalled = /* @__PURE__ */ __name((model, directory) => filesPresent(placedText(model, directory)), "isTextModelInstalled");
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/executable.js
7
+ // node_modules/.pnpm/@wirecat+cli-base@0.98.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/executable.js
8
8
  import { existsSync } from "node:fs";
9
9
  import { win32 } from "node:path";
10
10
  var variable = /* @__PURE__ */ __name((env, name) => Object.entries(env).find(([key]) => key.toUpperCase() === name)?.[1], "variable");
@@ -2,16 +2,73 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  unit
5
- } from "./chunk-7GCVON7M.js";
5
+ } from "./chunk-PI4XXMPG.js";
6
+ import {
7
+ PLAIN_HTTP_REFUSED,
8
+ modelAddressAllowed,
9
+ onThisComputer
10
+ } from "./chunk-VIIIC5LU.js";
11
+ import {
12
+ readSharedSection,
13
+ sharedConfigPath,
14
+ writeSharedSection
15
+ } from "./chunk-UP3J3YXH.js";
16
+ import {
17
+ storePath
18
+ } from "./chunk-IVFUSI7G.js";
19
+ import {
20
+ boolean,
21
+ isoTimestamp,
22
+ pipe,
23
+ safeParse,
24
+ strictObject,
25
+ string
26
+ } from "./chunk-UR62DZ7Q.js";
6
27
  import {
7
28
  CliError
8
- } from "./chunk-VUBZFMGP.js";
29
+ } from "./chunk-E6VSARSU.js";
9
30
  import {
10
31
  __name
11
32
  } from "./chunk-ZVVMGPBJ.js";
12
33
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
34
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
14
35
  import { setTimeout } from "node:timers/promises";
36
+
37
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/models/local-only.js
38
+ var SECTION = "local_only";
39
+ var Setting = strictObject({
40
+ on: boolean(),
41
+ at: pipe(string(), isoTimestamp())
42
+ });
43
+ var pathOf = /* @__PURE__ */ __name((env) => sharedConfigPath(storePath(env), env), "pathOf");
44
+ var readLocalOnly = /* @__PURE__ */ __name((env) => {
45
+ const section = readSharedSection(pathOf(env), SECTION);
46
+ if (section === void 0 || section === null)
47
+ return void 0;
48
+ const checked = safeParse(Setting, section);
49
+ return checked.success ? checked.output : { on: true, at: (/* @__PURE__ */ new Date(0)).toISOString() };
50
+ }, "readLocalOnly");
51
+ var localOnly = /* @__PURE__ */ __name((env) => readLocalOnly(env)?.on === true, "localOnly");
52
+ var writeLocalOnly = /* @__PURE__ */ __name((env, on) => writeSharedSection(pathOf(env), SECTION, on ? { on: true, at: (/* @__PURE__ */ new Date()).toISOString() } : void 0), "writeLocalOnly");
53
+ var localOnlyRefusal = /* @__PURE__ */ __name((what, where) => new CliError("permission_error", `local only is on: ${what} would go to ${where}, which is not this computer; nothing was sent. Choose a model on this computer, or turn local only off with \`models local-only set off\``, { reason: "local-only.refused" }), "localOnlyRefusal");
54
+ var refuseOffComputer = /* @__PURE__ */ __name((env, address, what) => {
55
+ if (!onThisComputer(address) && localOnly(env))
56
+ throw localOnlyRefusal(what, hostOf(address));
57
+ }, "refuseOffComputer");
58
+ var hostOf = /* @__PURE__ */ __name((address) => {
59
+ try {
60
+ return new URL(address).host;
61
+ } catch {
62
+ return address;
63
+ }
64
+ }, "hostOf");
65
+ var refuseModelAddress = /* @__PURE__ */ __name((env, address, what) => {
66
+ if (!modelAddressAllowed(address))
67
+ throw new CliError("validation_error", PLAIN_HTTP_REFUSED, { reason: "model.address-refused" });
68
+ refuseOffComputer(env, address, what);
69
+ }, "refuseModelAddress");
70
+
71
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
15
72
  var OPENAI_URL = "https://api.openai.com/v1";
16
73
  var OPENAI_MODELS = {
17
74
  "text-embedding-3-small": { dims: 1536, perMillion: 0.02 },
@@ -19,8 +76,7 @@ var OPENAI_MODELS = {
19
76
  };
20
77
  var DEFAULT_OPENAI_MODEL = "text-embedding-3-small";
21
78
  var PER_REQUEST = 256;
22
- var LOCAL = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]", "::1"]);
23
- var isLocal = /* @__PURE__ */ __name((baseUrl) => LOCAL.has(new URL(baseUrl).hostname), "isLocal");
79
+ var isLocal = /* @__PURE__ */ __name((baseUrl) => onThisComputer(baseUrl), "isLocal");
24
80
  var remoteModel = /* @__PURE__ */ __name(({ model = DEFAULT_OPENAI_MODEL, baseUrl, dims }) => {
25
81
  const known = baseUrl === void 0 ? OPENAI_MODELS[model] : void 0;
26
82
  if (baseUrl === void 0 && !known) {
@@ -39,7 +95,8 @@ var remoteModel = /* @__PURE__ */ __name(({ model = DEFAULT_OPENAI_MODEL, baseUr
39
95
  };
40
96
  }, "remoteModel");
41
97
  var remoteKey = /* @__PURE__ */ __name(({ provider, model, dims }) => `${provider}:${model}:${dims}`, "remoteKey");
42
- var openRemote = /* @__PURE__ */ __name((remote, apiKey, { concurrency = 4, fetch: post = fetch, tries = 5 } = {}) => {
98
+ var openRemote = /* @__PURE__ */ __name((remote, apiKey, { concurrency = 4, fetch: post = fetch, tries = 5, env }) => {
99
+ refuseModelAddress(env ?? process.env, remote.baseUrl, "text to embed");
43
100
  const request = /* @__PURE__ */ __name(async (input) => {
44
101
  for (let attempt = 1; ; attempt++) {
45
102
  let response;
@@ -112,6 +169,12 @@ var errorCode = /* @__PURE__ */ __name(async (response) => {
112
169
  }, "errorCode");
113
170
 
114
171
  export {
172
+ readLocalOnly,
173
+ localOnly,
174
+ writeLocalOnly,
175
+ localOnlyRefusal,
176
+ refuseOffComputer,
177
+ refuseModelAddress,
115
178
  OPENAI_URL,
116
179
  OPENAI_MODELS,
117
180
  DEFAULT_OPENAI_MODEL,
@@ -3,12 +3,12 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError,
5
5
  isCliError
6
- } from "./chunk-VUBZFMGP.js";
6
+ } from "./chunk-E6VSARSU.js";
7
7
  import {
8
8
  __name
9
9
  } from "./chunk-ZVVMGPBJ.js";
10
10
 
11
- // node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/hosts.js
11
+ // node_modules/.pnpm/@wirecat+cli-base@0.98.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/hosts.js
12
12
  var LABEL = "[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?";
13
13
  var HOST_PATTERN = new RegExp(`^(?:${LABEL}(?:\\.${LABEL})*|\\*\\.${LABEL}(?:\\.${LABEL})+)$`);
14
14
  var hostProblems = /* @__PURE__ */ __name((hosts) => [
@@ -20,7 +20,7 @@ var hostCovered = /* @__PURE__ */ __name((hostname, hosts) => {
20
20
  return hosts.some((host) => host.startsWith("*.") ? name.endsWith(host.slice(1)) : name === host);
21
21
  }, "hostCovered");
22
22
 
23
- // node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/fetch.js
23
+ // node_modules/.pnpm/@wirecat+cli-base@0.98.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/fetch.js
24
24
  var HOST_FETCH_TIMEOUT_MS = 3e4;
25
25
  var REDIRECTS = 5;
26
26
  var REDIRECT_STATUSES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
@@ -108,7 +108,7 @@ var hostFetch = /* @__PURE__ */ __name((options) => {
108
108
  };
109
109
  }, "hostFetch");
110
110
 
111
- // node_modules/.pnpm/@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/index.js
111
+ // node_modules/.pnpm/@wirecat+cli-base@0.98.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/http/index.js
112
112
  var parseRetryAfter = /* @__PURE__ */ __name((header, now) => {
113
113
  if (!header)
114
114
  return void 0;
@@ -5,15 +5,15 @@ import {
5
5
  } from "./chunk-Y5E2WNWB.js";
6
6
  import {
7
7
  CliError
8
- } from "./chunk-VUBZFMGP.js";
8
+ } from "./chunk-E6VSARSU.js";
9
9
  import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/speech/recognize.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/speech/recognize.js
14
14
  import { createRequire } from "node:module";
15
15
 
16
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/speech/ogg-limit.js
16
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/speech/ogg-limit.js
17
17
  var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "local transcription needs a complete mono or stereo Ogg Opus recording"), "invalid");
18
18
  var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
19
19
  const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
@@ -70,7 +70,7 @@ var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
70
70
  throw invalid();
71
71
  }, "checkOggDuration");
72
72
 
73
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/speech/recognize.js
73
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/speech/recognize.js
74
74
  var SAMPLE_RATE = 16e3;
75
75
  var LEAD = SAMPLE_RATE / 2;
76
76
  var toModelRate = /* @__PURE__ */ __name((samples, rate) => {
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/shared-55XJMTPA.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/shared-55XJMTPA.js
8
8
  var entityKind = /* @__PURE__ */ Symbol.for("drizzle:entityKind");
9
9
  var kindsByConstructor = /* @__PURE__ */ new WeakMap();
10
10
  function collectKinds(ctor) {
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/background/processes.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/background/processes.js
8
8
  import { execFileSync } from "node:child_process";
9
9
  import { readdirSync, readFileSync, readlinkSync } from "node:fs";
10
10
  var alive = /* @__PURE__ */ __name((pid) => {
@@ -2,31 +2,31 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  updateCommand
5
- } from "./chunk-7DPWVKYS.js";
5
+ } from "./chunk-XSGUG5WG.js";
6
6
  import {
7
7
  DEFAULT_STEMMERS,
8
8
  LANGUAGES
9
- } from "./chunk-QROAXWDU.js";
9
+ } from "./chunk-7AWJZ6NJ.js";
10
10
  import {
11
11
  installerOf
12
- } from "./chunk-RX5CJ55S.js";
12
+ } from "./chunk-OIF4B526.js";
13
13
  import {
14
14
  QUESTIONS,
15
15
  readSetupAnswers,
16
16
  unanswered,
17
17
  writeSetupAnswers
18
- } from "./chunk-4N2WJYLE.js";
18
+ } from "./chunk-SGBH3D5D.js";
19
19
  import {
20
20
  sharedConfigPath
21
- } from "./chunk-HAR76KJG.js";
21
+ } from "./chunk-UP3J3YXH.js";
22
22
  import {
23
23
  storePath
24
- } from "./chunk-Y52T5EMB.js";
24
+ } from "./chunk-IVFUSI7G.js";
25
25
  import {
26
26
  __name
27
27
  } from "./chunk-ZVVMGPBJ.js";
28
28
 
29
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/cli/first-run.js
29
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/cli/first-run.js
30
30
  import { spawnSync } from "node:child_process";
31
31
  import { accessSync, constants, realpathSync } from "node:fs";
32
32
  import { delimiter, join } from "node:path";
@@ -84,7 +84,7 @@ var suggested = /* @__PURE__ */ __name((env, contentLanguages) => {
84
84
  return (own.length ? own : LANGUAGES.filter(({ code }) => code === "en" || code === system)).map(({ name }) => name);
85
85
  }, "suggested");
86
86
  var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLanguages }) => {
87
- const { openStore } = await import("./store-QECSDJRP.js");
87
+ const { openStore } = await import("./store-DWMKCXYL.js");
88
88
  const store = await openStore({ env });
89
89
  let rebuild = false;
90
90
  try {
@@ -113,8 +113,8 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
113
113
  if (!rebuild)
114
114
  return;
115
115
  const [{ openCache }, { buildStems }] = await Promise.all([
116
- import("./open-G3VHOOMV.js"),
117
- import("./store-maintenance-command-5YW6TRJA.js")
116
+ import("./open-XP3SY62D.js"),
117
+ import("./store-maintenance-command-3UEKINRB.js")
118
118
  ]);
119
119
  const database = await openCache(storePath(env));
120
120
  try {
@@ -126,7 +126,7 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
126
126
  var askTools = /* @__PURE__ */ __name(async (run) => {
127
127
  const { command, env, io } = run;
128
128
  const installed = run.installed ?? ((name) => onPath(name, env));
129
- const { WIRECAT_TOOLS } = await import("./first-screen-NVK7PFX4.js");
129
+ const { WIRECAT_TOOLS } = await import("./first-screen-XZ73W3VE.js");
130
130
  const others = WIRECAT_TOOLS.filter((tool) => tool.command !== command);
131
131
  const missing = others.filter((tool) => !installed(tool.command));
132
132
  io.say("Other WireCat tools \u2014 they share this store, so one search finds everything:");
@@ -199,7 +199,7 @@ var setupAtStart = /* @__PURE__ */ __name(async (start) => {
199
199
  contentLanguages: start.contentLanguages,
200
200
  all: start.path[0] === "setup",
201
201
  io: {
202
- ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-JWQ6UQ6R.js")).readSecret(prompt, { input, echo: true }), "ask"),
202
+ ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-WYTODP4U.js")).readSecret(prompt, { input, echo: true }), "ask"),
203
203
  say: /* @__PURE__ */ __name((text) => process.stderr.write(`${text}
204
204
  `), "say")
205
205
  }
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/http/listen.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.648.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.98.0_commander@15._22e948f6f1aa7f4572ea465a838ccfd1/node_modules/@wirecat/cli-core/dist/http/listen.js
8
8
  import { createServer } from "node:http";
9
9
  import { Readable } from "node:stream";
10
10
  var MAX_BODY = 4 * 1024 * 1024;