@wirecat/notion-cli 0.1.0 → 0.3.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 (212) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +14 -4
  3. package/contracts/wirecat.json +698 -1
  4. package/dist/bin/notion.js +2 -2
  5. package/dist/bundle/{all-profiles-OETMCOLN.js → all-profiles-4IONYZB6.js} +10 -10
  6. package/dist/bundle/{anthropic-5Y3O2TYM.js → anthropic-OXF74J4P.js} +6 -6
  7. package/dist/bundle/{app-server-IVWBIVHC.js → app-server-M2VF6ABM.js} +61 -52
  8. package/dist/bundle/{bun-EO636SAD.js → bun-DLA6QRLL.js} +2 -2
  9. package/dist/bundle/{bun-sqlite-C2T7QJ2M.js → bun-sqlite-F4BYLW3F.js} +7 -7
  10. package/dist/bundle/{chunk-QBC23NHD.js → chunk-2MHMKNWD.js} +1 -1
  11. package/dist/bundle/{chunk-TSCIIXN3.js → chunk-4KUJTSHG.js} +2 -2
  12. package/dist/bundle/{chunk-24FAYAML.js → chunk-4TQVZXOV.js} +3 -3
  13. package/dist/bundle/{chunk-FF4DDBCB.js → chunk-5LBJNTEJ.js} +6 -6
  14. package/dist/bundle/chunk-5UA2TYMI.js +29 -0
  15. package/dist/bundle/{chunk-DIM5YWBU.js → chunk-5XP4KQ2F.js} +1 -1
  16. package/dist/bundle/{chunk-WM7663C2.js → chunk-6GN7KU7X.js} +9 -9
  17. package/dist/bundle/chunk-6JBLIQQN.js +16 -0
  18. package/dist/bundle/{chunk-CLG2ISQH.js → chunk-7NF3V5L2.js} +4 -4
  19. package/dist/bundle/{chunk-TR7R5DL4.js → chunk-7NGFGFE5.js} +12 -63
  20. package/dist/bundle/{chunk-YA4LSSDZ.js → chunk-7NVPM55S.js} +2913 -2371
  21. package/dist/bundle/{chunk-XC5CKHX2.js → chunk-7YZPBAQX.js} +1 -1
  22. package/dist/bundle/{chunk-RSIS7BR7.js → chunk-AYU5TFDU.js} +21 -21
  23. package/dist/bundle/{chunk-64D5VUZ4.js → chunk-BEPFGITI.js} +68 -64
  24. package/dist/bundle/{chunk-HRTIRRXR.js → chunk-CBGBFAYJ.js} +41 -6
  25. package/dist/bundle/{chunk-QC3KOJT4.js → chunk-CDGZZNGY.js} +6 -6
  26. package/dist/bundle/{chunk-JK44XO2S.js → chunk-CIVXTBJY.js} +56 -56
  27. package/dist/bundle/{chunk-OWJDC4CB.js → chunk-COH7OEER.js} +14 -13
  28. package/dist/bundle/{chunk-XL2HXHP3.js → chunk-D6RCRBDH.js} +2 -2
  29. package/dist/bundle/{chunk-47R43UVJ.js → chunk-EQPAZ33O.js} +19 -19
  30. package/dist/bundle/{chunk-AE2KQ37N.js → chunk-EY6S7FV3.js} +6 -6
  31. package/dist/bundle/chunk-FEMHUSGO.js +88 -0
  32. package/dist/bundle/{chunk-NLDYZBTC.js → chunk-FSJHASRQ.js} +1146 -2555
  33. package/dist/bundle/chunk-GBFEEHQC.js +385 -0
  34. package/dist/bundle/{chunk-IQWEJEB5.js → chunk-GCCPFKSU.js} +26264 -21086
  35. package/dist/bundle/{chunk-RDZ7SVBZ.js → chunk-GK4GLPG2.js} +3 -3
  36. package/dist/bundle/{chunk-B2XKEEFX.js → chunk-GSNE7OB4.js} +4 -4
  37. package/dist/bundle/{chunk-UWW24JQF.js → chunk-HTKSCSJU.js} +4 -4
  38. package/dist/bundle/{chunk-7FII4DCE.js → chunk-IJMFG7HB.js} +7 -7
  39. package/dist/bundle/{chunk-WVZFXI36.js → chunk-JIRRF6BM.js} +4 -4
  40. package/dist/bundle/{chunk-ST2UC7FS.js → chunk-JODE2XED.js} +31 -27
  41. package/dist/bundle/{chunk-CWVAYQXI.js → chunk-K5I64ZVI.js} +9 -9
  42. package/dist/bundle/chunk-KFVDL2QS.js +146 -0
  43. package/dist/bundle/{chunk-JKIN5TOU.js → chunk-KL3P5TQK.js} +4 -4
  44. package/dist/bundle/chunk-L62XTC7N.js +726 -0
  45. package/dist/bundle/chunk-L6H7PY4X.js +170 -0
  46. package/dist/bundle/{chunk-F6MLJ3V5.js → chunk-LIQMUDIZ.js} +2 -2
  47. package/dist/bundle/{chunk-HWRKURQH.js → chunk-M2EEIYBU.js} +2 -2
  48. package/dist/bundle/chunk-M6DGZ2O6.js +823 -0
  49. package/dist/bundle/chunk-MGUEZYFA.js +5546 -0
  50. package/dist/bundle/{chunk-UWIA2G6Q.js → chunk-MRA62W5K.js} +404 -537
  51. package/dist/bundle/{chunk-XYIT2XB3.js → chunk-MVA5HVKL.js} +20 -0
  52. package/dist/bundle/{chunk-GA3URWIF.js → chunk-NO2LIHWA.js} +1 -1
  53. package/dist/bundle/{chunk-ESZT4WW3.js → chunk-OCDJ4FFA.js} +4 -4
  54. package/dist/bundle/{chunk-B4B65XIO.js → chunk-OI5DWZJG.js} +3 -3
  55. package/dist/bundle/chunk-P3P6DA6K.js +259 -0
  56. package/dist/bundle/chunk-QX3TPFEX.js +1977 -0
  57. package/dist/bundle/{chunk-EU5WCOMQ.js → chunk-R6SDRSZK.js} +76 -35
  58. package/dist/bundle/{chunk-K5TWMQSY.js → chunk-RMJMID5D.js} +8 -8
  59. package/dist/bundle/{chunk-RLSFOR2D.js → chunk-SGBS5QCU.js} +4 -4
  60. package/dist/bundle/{chunk-3D3PFXBP.js → chunk-T5UNSFES.js} +10 -15
  61. package/dist/bundle/{chunk-RAZKIHGH.js → chunk-TFNRCCGR.js} +4 -4
  62. package/dist/bundle/{chunk-WK3OSDNV.js → chunk-TJCPTRYD.js} +7 -7
  63. package/dist/bundle/{chunk-BWICUW7W.js → chunk-TXONV3HW.js} +2 -2
  64. package/dist/bundle/{chunk-AQZO3ITW.js → chunk-TZ2QJ53V.js} +2 -2
  65. package/dist/bundle/{chunk-35K5T6WV.js → chunk-UKE3CGHK.js} +1 -1
  66. package/dist/bundle/{chunk-7N5QB6NL.js → chunk-UROEWCOG.js} +5 -3
  67. package/dist/bundle/chunk-WHJWURZB.js +335 -0
  68. package/dist/bundle/{chunk-R6ZM45NF.js → chunk-WU3XHGOB.js} +185 -57
  69. package/dist/bundle/{chunk-2YR3RYT4.js → chunk-WZEEEQGC.js} +3 -3
  70. package/dist/bundle/{chunk-B2WFKFYL.js → chunk-XCTOCVMW.js} +20 -116
  71. package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
  72. package/dist/bundle/{chunk-EGTBL3MJ.js → chunk-Y5LAJWR5.js} +1 -1
  73. package/dist/bundle/{chunk-66PL7P4C.js → chunk-YAPDU3SV.js} +1 -1
  74. package/dist/bundle/{chunk-WWMB4UHF.js → chunk-YFWLHTNO.js} +1 -1
  75. package/dist/bundle/{chunk-KHOVVPLC.js → chunk-YGCI3DHS.js} +1 -1
  76. package/dist/bundle/{chunk-4GC5DBHW.js → chunk-Z53LYX4M.js} +3 -3
  77. package/dist/bundle/{chunk-EPAZ7DJB.js → chunk-ZC6ZQQ55.js} +48 -45
  78. package/dist/bundle/command-contract-UBXS6NHI.js +38 -0
  79. package/dist/bundle/{command-server-entry-A66DJ3MH.js → command-server-entry-2SORMVRM.js} +27 -24
  80. package/dist/bundle/decode-5O7IEFPN.js +297 -0
  81. package/dist/bundle/{dispatch-FEKU5UXC.js → dispatch-YHQX6FEJ.js} +8 -8
  82. package/dist/bundle/{dist-YFKABFFF.js → dist-ILNOLGYN.js} +1 -1
  83. package/dist/bundle/{echarts-XD2JSWU4.js → echarts-ARLMVQC7.js} +2 -2
  84. package/dist/bundle/{embed-F3HYGAF7.js → embed-FUDUKQ3K.js} +7 -7
  85. package/dist/bundle/{embedder-GSEDDUH7.js → embedder-HDRV7GX3.js} +10 -10
  86. package/dist/bundle/{failure-HDJLR2YJ.js → failure-JHXICWIL.js} +3 -3
  87. package/dist/bundle/first-run-BGEFTXOE.js +29 -0
  88. package/dist/bundle/first-screen-F5F3VS6Y.js +38 -0
  89. package/dist/bundle/{instructions-NZGJ4FW5.js → instructions-MEFIKCDI.js} +1 -1
  90. package/dist/bundle/{mcp-VFIOZDVY.js → mcp-VMS6PBCU.js} +2 -2
  91. package/dist/bundle/mdast-util-from-markdown-R66F4HZA.js +1958 -0
  92. package/dist/bundle/mdast-util-gfm-LN2ELINH.js +2699 -0
  93. package/dist/bundle/meeting-combined-HNSS3FQY.js +24 -0
  94. package/dist/bundle/meeting-model-REZVYGQW.js +26 -0
  95. package/dist/bundle/meeting-semantic-R4CSLVRG.js +22 -0
  96. package/dist/bundle/micromark-extension-gfm-5X7YT43T.js +1838 -0
  97. package/dist/bundle/{node-RPKPDYQS.js → node-MAQALPLA.js} +2 -2
  98. package/dist/bundle/{node-sqlite-KH2UUYVO.js → node-sqlite-J7IJYNBO.js} +8 -8
  99. package/dist/bundle/notion.js +14 -14
  100. package/dist/bundle/{oauth-NKAI7TQD.js → oauth-AMV4YGJD.js} +8 -8
  101. package/dist/bundle/{open-WSAEAA2V.js → open-AB27MTGR.js} +6 -6
  102. package/dist/bundle/{openai-JPVDGHG5.js → openai-D77MU5XV.js} +31 -29
  103. package/dist/bundle/{process-5ZFVKOQX.js → process-SIOWTRJ6.js} +1 -1
  104. package/dist/bundle/{program-M3D56D6T.js → program-QC5MX4ZJ.js} +7533 -1997
  105. package/dist/bundle/{prompt-FROYQ5LV.js → prompt-W77YDHA6.js} +6 -6
  106. package/dist/bundle/{recognize-NYCHQMCX.js → recognize-3JAXQQ36.js} +5 -5
  107. package/dist/bundle/{remote-4OERF3Z4.js → remote-PSOJXCXO.js} +11 -11
  108. package/dist/bundle/{rerank-TEGXFUWY.js → rerank-EE44ZTGL.js} +8 -8
  109. package/dist/bundle/{schemas-MZNNOEYN.js → schemas-LBYUMBC6.js} +2 -2
  110. package/dist/bundle/{serve-HLYYBAXY.js → serve-XJMGAMFW.js} +10 -10
  111. package/dist/bundle/{server-D5OYNEUW.js → server-ASU6CP5R.js} +53 -44
  112. package/dist/bundle/server-WSPQ5EOA.js +72 -0
  113. package/dist/bundle/services-PT4PA4J6.js +588 -0
  114. package/dist/bundle/{sqlite-runtime-H2S5RR2F.js → sqlite-runtime-YHXRTVXE.js} +7 -7
  115. package/dist/bundle/{state-OPOXCDZL.js → state-T6ZKFWGD.js} +7 -7
  116. package/dist/bundle/{store-NHMXEJPD.js → store-3MUCZEI3.js} +20 -14
  117. package/dist/bundle/{store-Y3KRLCJ7.js → store-E5EE25FY.js} +30 -21
  118. package/dist/bundle/store-maintenance-command-ZZ55BBBG.js +63 -0
  119. package/dist/commands/api.d.ts.map +1 -1
  120. package/dist/commands/api.js +13 -4
  121. package/dist/commands/api.js.map +1 -1
  122. package/dist/commands/documents.d.ts +10 -1
  123. package/dist/commands/documents.d.ts.map +1 -1
  124. package/dist/commands/documents.js +175 -5
  125. package/dist/commands/documents.js.map +1 -1
  126. package/dist/commands/library.d.ts +10 -0
  127. package/dist/commands/library.d.ts.map +1 -0
  128. package/dist/commands/library.js +470 -0
  129. package/dist/commands/library.js.map +1 -0
  130. package/dist/commands/session.d.ts.map +1 -1
  131. package/dist/commands/session.js +4 -3
  132. package/dist/commands/session.js.map +1 -1
  133. package/dist/config.d.ts +19 -0
  134. package/dist/config.d.ts.map +1 -1
  135. package/dist/config.js +73 -5
  136. package/dist/config.js.map +1 -1
  137. package/dist/context.d.ts +8 -0
  138. package/dist/context.d.ts.map +1 -1
  139. package/dist/context.js +15 -3
  140. package/dist/context.js.map +1 -1
  141. package/dist/generated/types.d.ts +485 -375
  142. package/dist/generated/types.d.ts.map +1 -1
  143. package/dist/identity.d.ts.map +1 -1
  144. package/dist/identity.js +1 -0
  145. package/dist/identity.js.map +1 -1
  146. package/dist/knowledge.d.ts +27 -0
  147. package/dist/knowledge.d.ts.map +1 -0
  148. package/dist/knowledge.js +87 -0
  149. package/dist/knowledge.js.map +1 -0
  150. package/dist/library.d.ts +44 -0
  151. package/dist/library.d.ts.map +1 -0
  152. package/dist/library.js +149 -0
  153. package/dist/library.js.map +1 -0
  154. package/dist/notion/client.d.ts +4 -1
  155. package/dist/notion/client.d.ts.map +1 -1
  156. package/dist/notion/client.js +5 -2
  157. package/dist/notion/client.js.map +1 -1
  158. package/dist/notion/errors.d.ts +5 -0
  159. package/dist/notion/errors.d.ts.map +1 -1
  160. package/dist/notion/errors.js +33 -1
  161. package/dist/notion/errors.js.map +1 -1
  162. package/dist/notion/reads.d.ts +4 -0
  163. package/dist/notion/reads.d.ts.map +1 -1
  164. package/dist/notion/writes.d.ts +40 -0
  165. package/dist/notion/writes.d.ts.map +1 -0
  166. package/dist/notion/writes.js +112 -0
  167. package/dist/notion/writes.js.map +1 -0
  168. package/dist/program.js +2 -2
  169. package/dist/program.js.map +1 -1
  170. package/dist/sync/cursor.d.ts +93 -0
  171. package/dist/sync/cursor.d.ts.map +1 -1
  172. package/dist/sync/cursor.js +63 -2
  173. package/dist/sync/cursor.js.map +1 -1
  174. package/dist/sync/files.d.ts +87 -0
  175. package/dist/sync/files.d.ts.map +1 -0
  176. package/dist/sync/files.js +31 -0
  177. package/dist/sync/files.js.map +1 -0
  178. package/dist/sync/markdown.d.ts +4 -1
  179. package/dist/sync/markdown.d.ts.map +1 -1
  180. package/dist/sync/markdown.js +8 -6
  181. package/dist/sync/markdown.js.map +1 -1
  182. package/dist/sync/source.d.ts +6 -59
  183. package/dist/sync/source.d.ts.map +1 -1
  184. package/dist/sync/source.js +650 -271
  185. package/dist/sync/source.js.map +1 -1
  186. package/dist/version.d.ts +1 -1
  187. package/dist/version.js +1 -1
  188. package/package.json +3 -3
  189. package/skills/notion-cli/SKILL.md +18 -1
  190. package/dist/bundle/command-contract-6G5DC2FN.js +0 -35
  191. package/dist/bundle/decode-7XOFRAAT.js +0 -163
  192. package/dist/bundle/first-run-TXNTIUSP.js +0 -28
  193. package/dist/bundle/first-screen-JZPJND7J.js +0 -33
  194. package/dist/bundle/server-LWZGVMNW.js +0 -62
  195. package/dist/bundle/store-maintenance-command-D4W7WSLQ.js +0 -53
  196. package/dist/commands/comments.d.ts +0 -3
  197. package/dist/commands/comments.d.ts.map +0 -1
  198. package/dist/commands/comments.js +0 -114
  199. package/dist/commands/comments.js.map +0 -1
  200. package/dist/sample/comments.d.ts +0 -61
  201. package/dist/sample/comments.d.ts.map +0 -1
  202. package/dist/sample/comments.js +0 -39
  203. package/dist/sample/comments.js.map +0 -1
  204. package/dist/sample/records.d.ts +0 -16
  205. package/dist/sample/records.d.ts.map +0 -1
  206. package/dist/sample/records.js +0 -22
  207. package/dist/sample/records.js.map +0 -1
  208. package/dist/sample/transport.d.ts +0 -42
  209. package/dist/sample/transport.d.ts.map +0 -1
  210. package/dist/sample/transport.js +0 -153
  211. package/dist/sample/transport.js.map +0 -1
  212. /package/dist/bundle/{chunk-ZI3YTXSF.js → chunk-SHTHNBHG.js} +0 -0
@@ -18,12 +18,12 @@ import {
18
18
  jitCompatCheck,
19
19
  refineSqliteCodecs,
20
20
  sql
21
- } from "./chunk-EGTBL3MJ.js";
21
+ } from "./chunk-Y5LAJWR5.js";
22
22
  import {
23
23
  __name
24
24
  } from "./chunk-ZVVMGPBJ.js";
25
25
 
26
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_8be6aa3a41727a76ce87cf0d5a7bd659/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/node.js
26
+ // node_modules/.pnpm/@wirecat+cli-core@0.680.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_620ac9b386657c249f5c9038159a7caa/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/node.js
27
27
  import { DatabaseSync } from "node:sqlite";
28
28
  var nodeSQLiteCodecs = refineSqliteCodecs({
29
29
  "integer:boolean": { normalize: booleanFromInteger },
@@ -3,24 +3,24 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  loadVectorExtension,
5
5
  vectorExtension
6
- } from "./chunk-AQZO3ITW.js";
6
+ } from "./chunk-TZ2QJ53V.js";
7
7
  import {
8
8
  refuseOwnerStoreInTests
9
- } from "./chunk-HWRKURQH.js";
9
+ } from "./chunk-M2EEIYBU.js";
10
10
  import {
11
11
  TIME_LIMIT_FUNCTION,
12
12
  beforeTimeLimit
13
- } from "./chunk-QBC23NHD.js";
14
- import "./chunk-RSIS7BR7.js";
15
- import "./chunk-WM7663C2.js";
16
- import "./chunk-XYIT2XB3.js";
13
+ } from "./chunk-2MHMKNWD.js";
14
+ import "./chunk-AYU5TFDU.js";
15
+ import "./chunk-6GN7KU7X.js";
16
+ import "./chunk-MVA5HVKL.js";
17
17
  import "./chunk-Y5E2WNWB.js";
18
- import "./chunk-F6MLJ3V5.js";
18
+ import "./chunk-LIQMUDIZ.js";
19
19
  import {
20
20
  __name
21
21
  } from "./chunk-ZVVMGPBJ.js";
22
22
 
23
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_8be6aa3a41727a76ce87cf0d5a7bd659/node_modules/@wirecat/cli-core/dist/store/drivers/node-sqlite.js
23
+ // node_modules/.pnpm/@wirecat+cli-core@0.680.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_620ac9b386657c249f5c9038159a7caa/node_modules/@wirecat/cli-core/dist/store/drivers/node-sqlite.js
24
24
  import { DatabaseSync } from "node:sqlite";
25
25
  var openWithNodeSqlite = /* @__PURE__ */ __name(async (path) => cacheOverNodeSqlite(await nodeClient(path)), "openWithNodeSqlite");
26
26
  var nodeClient = /* @__PURE__ */ __name(async (path, { readOnly = false } = {}) => {
@@ -3,12 +3,12 @@ import { createRequire as __bundleRequire } from "node:module";
3
3
  const require = __bundleRequire(import.meta.url);
4
4
  import {
5
5
  DESKTOP
6
- } from "./chunk-HRTIRRXR.js";
6
+ } from "./chunk-CBGBFAYJ.js";
7
7
  import {
8
8
  installerOf
9
- } from "./chunk-66PL7P4C.js";
10
- import "./chunk-ZI3YTXSF.js";
11
- import "./chunk-QC3KOJT4.js";
9
+ } from "./chunk-YAPDU3SV.js";
10
+ import "./chunk-SHTHNBHG.js";
11
+ import "./chunk-CDGZZNGY.js";
12
12
  import {
13
13
  DESCRIBE_FLAG,
14
14
  DISPATCH_FLAG,
@@ -19,14 +19,14 @@ import {
19
19
  fileState,
20
20
  shimFiles,
21
21
  writeShim
22
- } from "./chunk-CLG2ISQH.js";
23
- import "./chunk-RSIS7BR7.js";
22
+ } from "./chunk-7NF3V5L2.js";
23
+ import "./chunk-AYU5TFDU.js";
24
24
  import {
25
25
  catchCrashes
26
- } from "./chunk-WM7663C2.js";
27
- import "./chunk-XYIT2XB3.js";
26
+ } from "./chunk-6GN7KU7X.js";
27
+ import "./chunk-MVA5HVKL.js";
28
28
  import "./chunk-Y5E2WNWB.js";
29
- import "./chunk-F6MLJ3V5.js";
29
+ import "./chunk-LIQMUDIZ.js";
30
30
  import {
31
31
  __name
32
32
  } from "./chunk-ZVVMGPBJ.js";
@@ -34,13 +34,13 @@ import {
34
34
  // dist/bin/notion.js
35
35
  import { enableCompileCache } from "node:module";
36
36
 
37
- // node_modules/.pnpm/@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/start.js
37
+ // node_modules/.pnpm/@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/start.js
38
38
  import { createHash } from "node:crypto";
39
39
  import { existsSync, readFileSync as readFileSync2, realpathSync } from "node:fs";
40
40
  import { dirname as dirname2, join as join2 } from "node:path";
41
41
  import { fileURLToPath } from "node:url";
42
42
 
43
- // node_modules/.pnpm/@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/launcher.js
43
+ // node_modules/.pnpm/@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/launcher.js
44
44
  import { readFileSync } from "node:fs";
45
45
  import { basename, dirname, join, resolve } from "node:path";
46
46
  var posix = /* @__PURE__ */ __name((path) => path.replaceAll("\\", "/"), "posix");
@@ -126,7 +126,7 @@ var ensureLauncher = /* @__PURE__ */ __name(({ dir, program, platform }) => {
126
126
  }
127
127
  }, "ensureLauncher");
128
128
 
129
- // node_modules/.pnpm/@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/start.js
129
+ // node_modules/.pnpm/@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/wcat/start.js
130
130
  var wcatStart = /* @__PURE__ */ __name(async (tool, io = {}) => {
131
131
  const argv = io.argv ?? process.argv;
132
132
  const env = io.env ?? process.env;
@@ -139,7 +139,7 @@ var wcatStart = /* @__PURE__ */ __name(async (tool, io = {}) => {
139
139
  return { code: 0 };
140
140
  }
141
141
  if (first === DISPATCH_FLAG) {
142
- const { runWcat } = await import("./dispatch-FEKU5UXC.js");
142
+ const { runWcat } = await import("./dispatch-YHQX6FEJ.js");
143
143
  const code = await runWcat(rest, { env, platform, stdout, stderr: io.stderr ?? process.stderr, self: tool });
144
144
  return { code };
145
145
  }
@@ -179,7 +179,7 @@ var wcat = await wcatStart(DESKTOP);
179
179
  if (wcat.code !== void 0) {
180
180
  process.exitCode = wcat.code;
181
181
  } else {
182
- const { run } = await import("./program-M3D56D6T.js");
182
+ const { run } = await import("./program-QC5MX4ZJ.js");
183
183
  process.exitCode = await run(process.argv.slice(2));
184
184
  }
185
185
  stopCatching();
@@ -3,16 +3,16 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  ownerLogin,
5
5
  revokeAll
6
- } from "./chunk-BWICUW7W.js";
6
+ } from "./chunk-TXONV3HW.js";
7
7
  import "./chunk-5D4AEUVA.js";
8
- import "./chunk-RLSFOR2D.js";
9
- import "./chunk-B4B65XIO.js";
10
- import "./chunk-XC5CKHX2.js";
11
- import "./chunk-RSIS7BR7.js";
12
- import "./chunk-WM7663C2.js";
13
- import "./chunk-XYIT2XB3.js";
8
+ import "./chunk-SGBS5QCU.js";
9
+ import "./chunk-OI5DWZJG.js";
10
+ import "./chunk-7YZPBAQX.js";
11
+ import "./chunk-AYU5TFDU.js";
12
+ import "./chunk-6GN7KU7X.js";
13
+ import "./chunk-MVA5HVKL.js";
14
14
  import "./chunk-Y5E2WNWB.js";
15
- import "./chunk-F6MLJ3V5.js";
15
+ import "./chunk-LIQMUDIZ.js";
16
16
  import "./chunk-ZVVMGPBJ.js";
17
17
  export {
18
18
  ownerLogin,
@@ -6,13 +6,13 @@ import {
6
6
  openCache,
7
7
  openFile,
8
8
  storeCapable
9
- } from "./chunk-AE2KQ37N.js";
10
- import "./chunk-QBC23NHD.js";
11
- import "./chunk-RSIS7BR7.js";
12
- import "./chunk-WM7663C2.js";
13
- import "./chunk-XYIT2XB3.js";
9
+ } from "./chunk-EY6S7FV3.js";
10
+ import "./chunk-2MHMKNWD.js";
11
+ import "./chunk-AYU5TFDU.js";
12
+ import "./chunk-6GN7KU7X.js";
13
+ import "./chunk-MVA5HVKL.js";
14
14
  import "./chunk-Y5E2WNWB.js";
15
- import "./chunk-F6MLJ3V5.js";
15
+ import "./chunk-LIQMUDIZ.js";
16
16
  import "./chunk-ZVVMGPBJ.js";
17
17
  export {
18
18
  CAPABILITY_STATEMENTS,
@@ -3,46 +3,47 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  SAMPLE_RATE,
5
5
  toModelRate
6
- } from "./chunk-B2XKEEFX.js";
7
- import "./chunk-JK44XO2S.js";
6
+ } from "./chunk-GSNE7OB4.js";
7
+ import "./chunk-CIVXTBJY.js";
8
8
  import {
9
9
  OPENAI_URL,
10
10
  refuseModelAddress
11
- } from "./chunk-CWVAYQXI.js";
11
+ } from "./chunk-K5I64ZVI.js";
12
12
  import {
13
- endpointFetch
14
- } from "./chunk-2YR3RYT4.js";
15
- import "./chunk-WK3OSDNV.js";
16
- import "./chunk-FF4DDBCB.js";
13
+ endpointFetch,
14
+ onThisComputer
15
+ } from "./chunk-WZEEEQGC.js";
16
+ import "./chunk-TJCPTRYD.js";
17
+ import "./chunk-5LBJNTEJ.js";
17
18
  import {
18
19
  OPENAI_TRANSCRIBE_MODEL,
19
20
  VAD,
20
21
  filesPresent,
21
22
  modelsDirectory,
22
23
  vadPath
23
- } from "./chunk-WVZFXI36.js";
24
+ } from "./chunk-JIRRF6BM.js";
24
25
  import {
25
26
  providerWaitMs
26
- } from "./chunk-QC3KOJT4.js";
27
- import "./chunk-HWRKURQH.js";
27
+ } from "./chunk-CDGZZNGY.js";
28
+ import "./chunk-M2EEIYBU.js";
28
29
  import {
29
30
  DEFAULT_RETRY,
30
31
  backoffMs
31
- } from "./chunk-RSIS7BR7.js";
32
- import "./chunk-WM7663C2.js";
33
- import "./chunk-XYIT2XB3.js";
32
+ } from "./chunk-AYU5TFDU.js";
33
+ import "./chunk-6GN7KU7X.js";
34
+ import "./chunk-MVA5HVKL.js";
34
35
  import "./chunk-Y5E2WNWB.js";
35
36
  import {
36
37
  CliError
37
- } from "./chunk-F6MLJ3V5.js";
38
+ } from "./chunk-LIQMUDIZ.js";
38
39
  import {
39
40
  __name
40
41
  } from "./chunk-ZVVMGPBJ.js";
41
42
 
42
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_8be6aa3a41727a76ce87cf0d5a7bd659/node_modules/@wirecat/cli-core/dist/speech/openai.js
43
+ // node_modules/.pnpm/@wirecat+cli-core@0.680.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_620ac9b386657c249f5c9038159a7caa/node_modules/@wirecat/cli-core/dist/speech/openai.js
43
44
  import { setTimeout as wait } from "node:timers/promises";
44
45
 
45
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_8be6aa3a41727a76ce87cf0d5a7bd659/node_modules/@wirecat/cli-core/dist/speech/wav.js
46
+ // node_modules/.pnpm/@wirecat+cli-core@0.680.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_620ac9b386657c249f5c9038159a7caa/node_modules/@wirecat/cli-core/dist/speech/wav.js
46
47
  var encodeWav = /* @__PURE__ */ __name((samples, sampleRate = 16e3) => {
47
48
  const bytes = Buffer.alloc(44 + samples.length * 2);
48
49
  bytes.write("RIFF", 0, "ascii");
@@ -63,7 +64,7 @@ var encodeWav = /* @__PURE__ */ __name((samples, sampleRate = 16e3) => {
63
64
  return new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.length);
64
65
  }, "encodeWav");
65
66
 
66
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_8be6aa3a41727a76ce87cf0d5a7bd659/node_modules/@wirecat/cli-core/dist/speech/openai.js
67
+ // node_modules/.pnpm/@wirecat+cli-core@0.680.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_620ac9b386657c249f5c9038159a7caa/node_modules/@wirecat/cli-core/dist/speech/openai.js
67
68
  var LONGEST_REQUEST_SECONDS = 600;
68
69
  var JOINED_SECONDS = 0.2;
69
70
  var PAD_SECONDS = 0.2;
@@ -118,27 +119,28 @@ var send = /* @__PURE__ */ __name(async (wav, options) => {
118
119
  const retry = options.retry ?? RETRY;
119
120
  const sleep = options.sleep ?? sleeping;
120
121
  const random = options.random ?? Math.random;
122
+ const who = options.label ?? "OpenAI";
121
123
  for (let attempt = 1; ; attempt++) {
122
124
  interrupted(options.signal);
123
125
  let response;
124
126
  try {
125
127
  response = await post(url, {
126
128
  method: "POST",
127
- headers: { authorization: `Bearer ${options.apiKey}` },
129
+ headers: options.apiKey ? { authorization: `Bearer ${options.apiKey}` } : {},
128
130
  body: formOf(wav, options),
129
131
  ...options.signal ? { signal: options.signal } : {}
130
132
  });
131
133
  } catch {
132
134
  interrupted(options.signal);
133
135
  if (attempt > retry.retries)
134
- throw new CliError("network_error", "OpenAI could not be reached", { reason: "network.failed" });
136
+ throw new CliError("network_error", `${who} could not be reached`, { reason: "network.failed" });
135
137
  await sleep(backoffMs(attempt, retry, random), options.signal);
136
138
  continue;
137
139
  }
138
140
  if (response.ok) {
139
141
  const body = await response.json().catch(() => interrupted(options.signal));
140
142
  if (typeof body?.text !== "string")
141
- throw new CliError("invalid_response", "OpenAI answered without a transcript", {
143
+ throw new CliError("invalid_response", `${who} answered without a transcript`, {
142
144
  reason: "provider.invalid-response"
143
145
  });
144
146
  return body.text.trim();
@@ -147,15 +149,15 @@ var send = /* @__PURE__ */ __name(async (wav, options) => {
147
149
  const status = response.status;
148
150
  const said = `HTTP ${status}${code ? `, ${code}` : type ? `, ${type}` : ""}`;
149
151
  if (status === 401)
150
- throw new CliError("authentication_error", `OpenAI refused the key (${said}) \u2014 set it again with \`models keys set openai\``, { reason: "auth.failed" });
152
+ throw new CliError("authentication_error", `${who} refused the key (${said}) \u2014 set it again with \`${options.keyHint ?? "models keys set openai"}\``, { reason: "auth.failed" });
151
153
  if (status === 403)
152
- throw new CliError("permission_error", `OpenAI refused the request (${said}) \u2014 it answers this when the country or region is not supported, or the key's project may not use the model`, { reason: "access.denied" });
154
+ throw new CliError("permission_error", `${who} refused the request (${said}) \u2014 OpenAI answers this when the country or region is not supported, or the key's project may not use the model`, { reason: "access.denied" });
153
155
  if (status === 413)
154
- throw new CliError("validation_error", `OpenAI refused the audio as too large (${said})`, {
156
+ throw new CliError("validation_error", `${who} refused the audio as too large (${said})`, {
155
157
  reason: "transcription.too-large"
156
158
  });
157
159
  if (EXHAUSTED.has(code ?? "") || EXHAUSTED.has(type ?? ""))
158
- throw new CliError("permission_error", `OpenAI refused: the account's credit, spend limit or usage limit is used up (${said}) \u2014 see the billing page`, { reason: "transcription.quota-exhausted" });
160
+ throw new CliError("permission_error", `${who} refused: the account's credit, spend limit or usage limit is used up (${said}) \u2014 see the billing page`, { reason: "transcription.quota-exhausted" });
159
161
  const again = status === 408 || status === 429 || status >= 500;
160
162
  const asked = providerWaitMs(response.headers, () => /* @__PURE__ */ new Date());
161
163
  if (again && attempt <= retry.retries && (asked === void 0 || asked <= retry.maxRetryAfterMs)) {
@@ -163,13 +165,13 @@ var send = /* @__PURE__ */ __name(async (wav, options) => {
163
165
  continue;
164
166
  }
165
167
  if (status === 429)
166
- throw new CliError("rate_limited", `OpenAI answered ${said}`, {
168
+ throw new CliError("rate_limited", `${who} answered ${said}`, {
167
169
  reason: "provider.rate-limited",
168
170
  ...asked === void 0 ? {} : { retry_after_ms: asked }
169
171
  });
170
172
  if (status >= 500)
171
- throw new CliError([502, 503, 504].includes(status) ? "provider_unavailable" : "provider_error", `OpenAI answered ${said}`, { reason: [502, 503, 504].includes(status) ? "provider.unavailable" : "provider.refused" });
172
- throw new CliError("provider_error", `OpenAI answered ${said}`, { reason: "provider.refused" });
173
+ throw new CliError([502, 503, 504].includes(status) ? "provider_unavailable" : "provider_error", `${who} answered ${said}`, { reason: [502, 503, 504].includes(status) ? "provider.unavailable" : "provider.refused" });
174
+ throw new CliError("provider_error", `${who} answered ${said}`, { reason: "provider.refused" });
173
175
  }
174
176
  }, "send");
175
177
  var piecesOf = /* @__PURE__ */ __name((spans, limit) => {
@@ -186,7 +188,7 @@ var piecesOf = /* @__PURE__ */ __name((spans, limit) => {
186
188
  return pieces;
187
189
  }, "piecesOf");
188
190
  var openCutter = /* @__PURE__ */ __name(async (vadModel) => {
189
- const { openSpeechCutter } = await import("./recognize-NYCHQMCX.js");
191
+ const { openSpeechCutter } = await import("./recognize-3JAXQQ36.js");
190
192
  return openSpeechCutter(vadModel);
191
193
  }, "openCutter");
192
194
  var checkKeywords = /* @__PURE__ */ __name((keywords = []) => {
@@ -196,7 +198,7 @@ var checkKeywords = /* @__PURE__ */ __name((keywords = []) => {
196
198
  }, "checkKeywords");
197
199
  var transcribeOpenAI = /* @__PURE__ */ __name(async (audio, options) => {
198
200
  refuseModelAddress(options.env ?? process.env, options.baseUrl ?? OPENAI_URL, "audio");
199
- if (!options.apiKey)
201
+ if (!options.apiKey && !onThisComputer(options.baseUrl ?? OPENAI_URL))
200
202
  throw new CliError("authentication_error", "no OpenAI key \u2014 `models keys set openai`, or OPENAI_API_KEY", {
201
203
  reason: "transcription.no-key"
202
204
  });
@@ -5,7 +5,7 @@ import {
5
5
  __name
6
6
  } from "./chunk-ZVVMGPBJ.js";
7
7
 
8
- // node_modules/.pnpm/@wirecat+cli-core@0.663.0_@wirecat+cli-base@0.101.0_commander@15.0.0_esbuild@0.28.2_typ_8be6aa3a41727a76ce87cf0d5a7bd659/node_modules/@wirecat/cli-core/dist/embeddings/process.js
8
+ // node_modules/.pnpm/@wirecat+cli-core@0.680.0_@wirecat+cli-base@0.106.0_commander@15.0.0_esbuild@0.28.2_typ_620ac9b386657c249f5c9038159a7caa/node_modules/@wirecat/cli-core/dist/embeddings/process.js
9
9
  import { spawn } from "node:child_process";
10
10
  import { createInterface } from "node:readline";
11
11
  import { fileURLToPath } from "node:url";