@wirecat/zoom-cli 0.73.0 → 0.74.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 (133) hide show
  1. package/dist/bin/zm.js +2 -2
  2. package/dist/bundle/{all-profiles-V47CUJFK.js → all-profiles-SDOAABLC.js} +7 -7
  3. package/dist/bundle/answer-policy-RHS74QYY.js +110 -0
  4. package/dist/bundle/{anthropic-SID7Z3QN.js → anthropic-HCVY2PIN.js} +2 -2
  5. package/dist/bundle/{app-server-KCMUSY4A.js → app-server-V64VS6KN.js} +48 -50
  6. package/dist/bundle/{bun-PWMM6L45.js → bun-EBQHHLKR.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-3TLKUN5A.js → bun-sqlite-PVMXO2JB.js} +3 -3
  8. package/dist/bundle/chunk-2PNG76LV.js +707 -0
  9. package/dist/bundle/{chunk-OU5OXA6Q.js → chunk-3ROL6MBJ.js} +1535 -649
  10. package/dist/bundle/{chunk-MOKEB656.js → chunk-3TYNBHBK.js} +1 -1
  11. package/dist/bundle/{chunk-NBA2V6LB.js → chunk-4ELLWJT4.js} +7 -7
  12. package/dist/bundle/{chunk-KK2IVZUQ.js → chunk-4EZKR6Q4.js} +5 -5
  13. package/dist/bundle/{chunk-XLY7V2LB.js → chunk-5KDBLEUF.js} +10 -10
  14. package/dist/bundle/{chunk-PKON63JH.js → chunk-5R6EBM5Z.js} +1 -1
  15. package/dist/bundle/{chunk-44YVZIA4.js → chunk-6EMOZGSN.js} +2 -2
  16. package/dist/bundle/{chunk-4LFFDUUW.js → chunk-6GPBDVQ2.js} +3 -3
  17. package/dist/bundle/{chunk-IE7YBRUO.js → chunk-7NE3LB7A.js} +1 -1
  18. package/dist/bundle/{chunk-QS6DWXDB.js → chunk-7R4UU65O.js} +12 -12
  19. package/dist/bundle/{chunk-HAMDPWEZ.js → chunk-7W23N2YW.js} +5 -5
  20. package/dist/bundle/{chunk-N3SOTKXC.js → chunk-AFUHT7F7.js} +5 -5
  21. package/dist/bundle/{chunk-3ADFJ3UP.js → chunk-APLV37JA.js} +2 -2
  22. package/dist/bundle/{chunk-OFA22L4G.js → chunk-BKMC4ETU.js} +4 -4
  23. package/dist/bundle/{chunk-UIKVP23D.js → chunk-BOGGQOVO.js} +1 -1
  24. package/dist/bundle/{chunk-DPSTOVKC.js → chunk-DSRG5NRF.js} +2 -2
  25. package/dist/bundle/{chunk-35CYSRGJ.js → chunk-DXZN3DU6.js} +2 -2
  26. package/dist/bundle/{chunk-Y3IH7EZC.js → chunk-F6PUM6ZK.js} +16 -16
  27. package/dist/bundle/{chunk-AIEMFRBU.js → chunk-FL2TKSZY.js} +1 -1
  28. package/dist/bundle/{chunk-ZAIE3G5I.js → chunk-FY2X6U6O.js} +2 -2
  29. package/dist/bundle/{chunk-JIS34MLC.js → chunk-GPGIU3OG.js} +7 -7
  30. package/dist/bundle/{chunk-VPPNYUQM.js → chunk-HGUYJUNO.js} +322 -11
  31. package/dist/bundle/{chunk-PJ3FKBXG.js → chunk-HZUUVNWC.js} +1 -1
  32. package/dist/bundle/{chunk-G3SIY4MQ.js → chunk-I2D4ZZOD.js} +19 -21
  33. package/dist/bundle/{chunk-R5FTCNLJ.js → chunk-IJONJTST.js} +1 -1
  34. package/dist/bundle/{chunk-LQYMN36C.js → chunk-IS6FUZCP.js} +1 -1
  35. package/dist/bundle/{chunk-G2TSDMTA.js → chunk-IZUOL4Q6.js} +3 -3
  36. package/dist/bundle/{chunk-ETQNHS3A.js → chunk-KBRIMLVN.js} +6 -6
  37. package/dist/bundle/{chunk-CQBLPBZU.js → chunk-KCPRTZBZ.js} +2 -2
  38. package/dist/bundle/{chunk-2VYEGKQ3.js → chunk-KYL5FYOW.js} +1 -1
  39. package/dist/bundle/{chunk-V5Q2QKYM.js → chunk-LHPYSVGP.js} +23 -25
  40. package/dist/bundle/{chunk-EXWZCI5G.js → chunk-LN2LWPN2.js} +1 -1
  41. package/dist/bundle/{chunk-LVDTSCIN.js → chunk-LQR4V5EY.js} +10 -10
  42. package/dist/bundle/{chunk-CIUJEQH4.js → chunk-LUBG5GKK.js} +9 -9
  43. package/dist/bundle/{chunk-ERQRY6WZ.js → chunk-LZ4AVHBS.js} +1 -1
  44. package/dist/bundle/{chunk-KUL7S5Y3.js → chunk-N7KCNMKL.js} +10 -10
  45. package/dist/bundle/{chunk-IKNOTHG2.js → chunk-NKBMLSWK.js} +53 -53
  46. package/dist/bundle/{chunk-ZVQDOKDY.js → chunk-NV2REPY6.js} +1 -1
  47. package/dist/bundle/{chunk-PGPHEC2X.js → chunk-OP6HK2QL.js} +1 -1
  48. package/dist/bundle/{chunk-VJVYGTPM.js → chunk-OPUGV7VW.js} +1 -1
  49. package/dist/bundle/{chunk-PACLT6IW.js → chunk-P53CLAXD.js} +64 -66
  50. package/dist/bundle/{chunk-2NQPB6MT.js → chunk-PKM2UKAZ.js} +5 -1
  51. package/dist/bundle/{chunk-Z5XCU4S7.js → chunk-PMHMKZEJ.js} +32 -32
  52. package/dist/bundle/{chunk-Q43KX56Z.js → chunk-QAGSAOYS.js} +2 -2
  53. package/dist/bundle/{chunk-L6YSKCC3.js → chunk-QLKCKTM4.js} +1 -1
  54. package/dist/bundle/{chunk-DYLYH7VE.js → chunk-QSWR7VDA.js} +3 -3
  55. package/dist/bundle/{chunk-OMLVWOEF.js → chunk-R35YGFKQ.js} +158 -15
  56. package/dist/bundle/{chunk-6AO2RSYH.js → chunk-R4J4DLJV.js} +1167 -839
  57. package/dist/bundle/{chunk-6WUTUCKH.js → chunk-RJJ4OYNH.js} +2 -2
  58. package/dist/bundle/{chunk-ZX4QWTMQ.js → chunk-RQJ2RXFO.js} +25 -27
  59. package/dist/bundle/{chunk-KSNJK4QM.js → chunk-RRW54FK6.js} +12 -12
  60. package/dist/bundle/{chunk-JQF4LM3V.js → chunk-SKDQNYKA.js} +16 -16
  61. package/dist/bundle/{chunk-KHBZ4OEP.js → chunk-SPWKGRTO.js} +1 -1
  62. package/dist/bundle/{chunk-CMWFYZ45.js → chunk-SY4MIIWF.js} +1 -1
  63. package/dist/bundle/{chunk-K5JFX5TK.js → chunk-TKPIDOW5.js} +18 -18
  64. package/dist/bundle/{chunk-K7EMVFJ7.js → chunk-TLNZUPGU.js} +13 -13
  65. package/dist/bundle/{chunk-UYBLNGZ2.js → chunk-TMCXUWTY.js} +1 -1
  66. package/dist/bundle/{chunk-FJMRDRPN.js → chunk-TN2YUZBF.js} +1147 -482
  67. package/dist/bundle/{chunk-SYIOT45G.js → chunk-UGLNVUFX.js} +4 -4
  68. package/dist/bundle/{chunk-SO52EJ2W.js → chunk-UVWNUY3W.js} +2 -2
  69. package/dist/bundle/{chunk-LSVQCI6V.js → chunk-UW3BB2XW.js} +22 -22
  70. package/dist/bundle/{chunk-HO3GBTIT.js → chunk-UXSTXFZQ.js} +1526 -912
  71. package/dist/bundle/{chunk-QWGEOQHA.js → chunk-WRRGO246.js} +1 -1
  72. package/dist/bundle/{chunk-ILDGZBZD.js → chunk-WYV5IITK.js} +6 -6
  73. package/dist/bundle/{chunk-MG2CCAVG.js → chunk-XCC7R47Z.js} +2 -2
  74. package/dist/bundle/{chunk-6NI4FE5G.js → chunk-XFT3YIHU.js} +3 -3
  75. package/dist/bundle/{chunk-QVJMFZFW.js → chunk-XGEPAJBY.js} +1 -1
  76. package/dist/bundle/{chunk-OKOJEBHK.js → chunk-Y4KWWPIO.js} +2 -2
  77. package/dist/bundle/{chunk-P4FU6R3Z.js → chunk-YFLTHGB3.js} +7 -7
  78. package/dist/bundle/{chunk-FZLJ2G7A.js → chunk-YM6ZATEK.js} +4 -4
  79. package/dist/bundle/{chunk-TI2OANJZ.js → chunk-YNI57LTZ.js} +1 -1
  80. package/dist/bundle/{chunk-GCZMYDKU.js → chunk-ZYMTS3CI.js} +2 -2
  81. package/dist/bundle/{cli-4ZYJ6OZE.js → cli-5ALOQCAC.js} +103 -82
  82. package/dist/bundle/command-contract-WO5QJVLZ.js +41 -0
  83. package/dist/bundle/{command-server-entry-CASONRIJ.js → command-server-entry-ICOMIJIH.js} +24 -26
  84. package/dist/bundle/config-YQA5TJ7Y.js +97 -0
  85. package/dist/bundle/{decode-KEFCVGEB.js → decode-7LFOROWF.js} +2 -2
  86. package/dist/bundle/{dist-GCQ7KCKN.js → dist-KJOOYNCP.js} +13 -14
  87. package/dist/bundle/{echarts-SDZA2SWG.js → echarts-EJXBKCJT.js} +2 -2
  88. package/dist/bundle/{embed-43VJEPM6.js → embed-TOZCKRRO.js} +3 -3
  89. package/dist/bundle/{embedder-Q4ZHAGRP.js → embedder-QKEKUCS5.js} +6 -6
  90. package/dist/bundle/{first-run-CPOLQVNA.js → first-run-S7CQVGK6.js} +6 -6
  91. package/dist/bundle/first-screen-6GW6FD6S.js +39 -0
  92. package/dist/bundle/{instructions-7T6JJIFS.js → instructions-Z7GVGWXS.js} +1 -1
  93. package/dist/bundle/{main-NA3QVPXS.js → main-RL3GC4OX.js} +15 -15
  94. package/dist/bundle/{meetings-7CVIQJTA.js → meetings-JCMLE5AO.js} +1 -1
  95. package/dist/bundle/{node-BZDMUFTW.js → node-L2PVEW3N.js} +2 -2
  96. package/dist/bundle/{node-sqlite-QHGB23B4.js → node-sqlite-4YW3W4XI.js} +4 -4
  97. package/dist/bundle/{oauth-BMEMCM2I.js → oauth-NNHWAT6A.js} +4 -4
  98. package/dist/bundle/{open-JGU2NRJP.js → open-PF2JHJIY.js} +2 -2
  99. package/dist/bundle/{openai-VTXXFNCS.js → openai-C72ADYMD.js} +10 -10
  100. package/dist/bundle/{process-756VBE7E.js → process-MNZTQ2DA.js} +1 -1
  101. package/dist/bundle/{program-XM6CDIJ2.js → program-FOCBZZZS.js} +81 -85
  102. package/dist/bundle/{prompt-2IPFXJ4B.js → prompt-RBSUKMV7.js} +2 -2
  103. package/dist/bundle/{recognize-672E2RIB.js → recognize-RM6TQKK3.js} +1 -1
  104. package/dist/bundle/{remote-YLHRVPDS.js → remote-UKHTU3YR.js} +6 -6
  105. package/dist/bundle/{rerank-NBXQG3OS.js → rerank-3LBRVESU.js} +4 -4
  106. package/dist/bundle/{run-log-3WITBT2F.js → run-log-UXINNGKA.js} +55 -57
  107. package/dist/bundle/{serve-FNLOUMYP.js → serve-OOZFTW3W.js} +6 -6
  108. package/dist/bundle/server-DM5ZPFZB.js +75 -0
  109. package/dist/bundle/{server-7ZB5AK5H.js → server-YNQPNIJD.js} +39 -41
  110. package/dist/bundle/{services-Z4UWN64R.js → services-SLEOMN4B.js} +43 -28
  111. package/dist/bundle/{speech-XSYVCKR3.js → speech-FZZ6QVGU.js} +12 -12
  112. package/dist/bundle/{sqlite-runtime-GAPXJNWU.js → sqlite-runtime-WUR4PWYB.js} +3 -3
  113. package/dist/bundle/{state-QSA53EF5.js → state-ET36L4TY.js} +3 -3
  114. package/dist/bundle/{store-EKI4OAJH.js → store-DI6OUBXA.js} +14 -14
  115. package/dist/bundle/{store-NOF5EYUC.js → store-SQB2DOVJ.js} +20 -16
  116. package/dist/bundle/store-connection-M6LVRAZ5.js +90 -0
  117. package/dist/bundle/store-maintenance-command-B66KWG6K.js +65 -0
  118. package/dist/bundle/{tokens-WJQYQ3FK.js → tokens-SUHRRQ25.js} +4 -4
  119. package/dist/bundle/zm.js +2 -2
  120. package/dist/bundle/{zoom-app-Y7RMWLVU.js → zoom-app-GE4SSHOP.js} +2 -2
  121. package/dist/version.d.ts +1 -1
  122. package/dist/version.js +1 -1
  123. package/package.json +2 -2
  124. package/dist/bundle/answer-policy-W6H72X2R.js +0 -112
  125. package/dist/bundle/chunk-2BAZRRJP.js +0 -1239
  126. package/dist/bundle/chunk-KQD4ZVNC.js +0 -153
  127. package/dist/bundle/chunk-USIMMGWS.js +0 -997
  128. package/dist/bundle/command-contract-FJDDCHYP.js +0 -43
  129. package/dist/bundle/config-4DZHX2WX.js +0 -99
  130. package/dist/bundle/first-screen-XYESRGWW.js +0 -41
  131. package/dist/bundle/server-GGRGD4SH.js +0 -77
  132. package/dist/bundle/store-connection-2OZQGEIO.js +0 -92
  133. package/dist/bundle/store-maintenance-command-GNX3SOZ6.js +0 -67
@@ -23,20 +23,20 @@ import {
23
23
  tagMemberIds,
24
24
  thingOf,
25
25
  write
26
- } from "./chunk-HO3GBTIT.js";
26
+ } from "./chunk-UXSTXFZQ.js";
27
27
  import {
28
28
  fold
29
- } from "./chunk-KHBZ4OEP.js";
29
+ } from "./chunk-SPWKGRTO.js";
30
30
  import {
31
31
  damagedFile
32
- } from "./chunk-UYBLNGZ2.js";
32
+ } from "./chunk-TMCXUWTY.js";
33
33
  import {
34
34
  ADDED_PROVIDER,
35
35
  filesAccountSql,
36
36
  folderProviderOf,
37
37
  folderProviderSql,
38
38
  isDocumentAccountProvider
39
- } from "./chunk-QS6DWXDB.js";
39
+ } from "./chunk-7R4UU65O.js";
40
40
  import {
41
41
  CliError
42
42
  } from "./chunk-EA2OB75T.js";
@@ -44,7 +44,7 @@ import {
44
44
  __name
45
45
  } from "./chunk-ZVVMGPBJ.js";
46
46
 
47
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/damage.js
47
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/damage.js
48
48
  var DERIVED = /* @__PURE__ */ new Set(["mentions", "involvements", "embeddings"]);
49
49
  var named = /* @__PURE__ */ __name((tables) => tables.length <= 5 ? tables.join(", ") : `${tables.slice(0, 5).join(", ")} and ${tables.length - 5} more`, "named");
50
50
  var isDerivedTable = /* @__PURE__ */ __name((table, searchIndexes) => DERIVED.has(table) || table.startsWith("vector_index_") || searchIndexes.some((index) => table === index || table.startsWith(`${index}_`)), "isDerivedTable");
@@ -147,11 +147,11 @@ var storeDamageReport = /* @__PURE__ */ __name(({ health, command, mark = null,
147
147
  };
148
148
  }, "storeDamageReport");
149
149
 
150
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
150
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
151
151
  import { realpathSync, statSync } from "node:fs";
152
152
  import { resolve } from "node:path";
153
153
 
154
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/people.js
154
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/people.js
155
155
  var planPeople = /* @__PURE__ */ __name((database, snapshot, mappings, bindings, conflicts) => {
156
156
  const creatable = /* @__PURE__ */ new Set();
157
157
  let people = 0, identities = 0;
@@ -214,11 +214,11 @@ var copyPeople = /* @__PURE__ */ __name((database, snapshot, mappings, now) => {
214
214
  }
215
215
  }, "copyPeople");
216
216
 
217
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/document-transfer/digest.js
217
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/document-transfer/digest.js
218
218
  import { createHash } from "node:crypto";
219
219
  var digest = /* @__PURE__ */ __name((value) => createHash("sha256").update(JSON.stringify(value)).digest("hex"), "digest");
220
220
 
221
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/collection.js
221
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/collection.js
222
222
  var documentsKeyOf = /* @__PURE__ */ __name((collection) => {
223
223
  const colon = collection.indexOf(":");
224
224
  const provider = collection.slice(0, colon);
@@ -262,7 +262,7 @@ var currentCollection = /* @__PURE__ */ __name((row) => {
262
262
  };
263
263
  }, "currentCollection");
264
264
 
265
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/plan.js
265
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/plan.js
266
266
  var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindings) => {
267
267
  const mappings = /* @__PURE__ */ new Map();
268
268
  const missing = /* @__PURE__ */ new Set(), conflicts = /* @__PURE__ */ new Set();
@@ -429,7 +429,7 @@ var planTransfer = /* @__PURE__ */ __name((database, snapshot, sourceKey, bindin
429
429
  };
430
430
  }, "planTransfer");
431
431
 
432
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
432
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/snapshot.js
433
433
  var TRANSFER_TABLES = { document: "documents", note: "notes", memory: "memories", fact: "facts" };
434
434
  var MAX_ENTITIES = 1e3;
435
435
  var MAX_AUXILIARY = 1e4;
@@ -591,7 +591,7 @@ var transferSnapshot = /* @__PURE__ */ __name((database, collection) => read(dat
591
591
  };
592
592
  }), "transferSnapshot");
593
593
 
594
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/apply.js
594
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/sqlite/document-transfer/apply.js
595
595
  var providerHere = /* @__PURE__ */ __name(({ provider, name, settings }) => {
596
596
  if (provider !== "folder" || String(name ?? "").startsWith("google-drive:"))
597
597
  return provider ?? null;
@@ -763,7 +763,7 @@ var remapEntity = /* @__PURE__ */ __name((database, entity, id, mappings) => {
763
763
  database.prepare(`UPDATE ${TRANSFER_TABLES[entity.kind]} SET ${columns.join(",")} WHERE id=?`).run(...values, id);
764
764
  }, "remapEntity");
765
765
 
766
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
766
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/document-transfer/index.js
767
767
  var locations = /* @__PURE__ */ __name((options) => {
768
768
  for (const value of [options.source, options.destination, options.collection])
769
769
  if (typeof value !== "string" || !value.trim())
@@ -865,7 +865,7 @@ var applyWith = /* @__PURE__ */ __name(async (location, options) => {
865
865
  }
866
866
  }, "applyWith");
867
867
 
868
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/health.js
868
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/health.js
869
869
  import { existsSync, statSync as statSync2 } from "node:fs";
870
870
  var JSON_COLUMNS = {
871
871
  accounts: ["settings"],
@@ -1007,7 +1007,7 @@ var storeHealth = /* @__PURE__ */ __name(async (path, { deep = false } = {}) =>
1007
1007
  }
1008
1008
  }, "storeHealth");
1009
1009
 
1010
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/project-transfer/preview.js
1010
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/project-transfer/preview.js
1011
1011
  var previewProjectAnnotationSnapshot = /* @__PURE__ */ __name(async (options) => {
1012
1012
  if (!options || typeof options !== "object" || Array.isArray(options))
1013
1013
  throw new CliError("validation_error", "project preview options are required");
@@ -1033,7 +1033,7 @@ var previewProjectAnnotationSnapshot = /* @__PURE__ */ __name(async (options) =>
1033
1033
  });
1034
1034
  }, "previewProjectAnnotationSnapshot");
1035
1035
 
1036
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot.js
1036
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/project-transfer/snapshot.js
1037
1037
  var snapshotProjectAnnotations = /* @__PURE__ */ __name(async (options) => {
1038
1038
  if (!options || typeof options !== "object" || Array.isArray(options))
1039
1039
  throw new CliError("validation_error", "snapshot options are required");
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/mcp/instructions.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/mcp/instructions.js
8
8
  var instructions = /* @__PURE__ */ __name(({ command, name, profile, writes, skill }) => {
9
9
  const all = typeof profile !== "string";
10
10
  const offers = /* @__PURE__ */ __name((key) => all || writes.includes(key), "offers");
@@ -4,7 +4,7 @@ import {
4
4
  MAX_SECRET_INPUT,
5
5
  bufferedInput,
6
6
  inputPolicy
7
- } from "./chunk-PGPHEC2X.js";
7
+ } from "./chunk-OP6HK2QL.js";
8
8
  import {
9
9
  CliError
10
10
  } from "./chunk-EA2OB75T.js";
@@ -12,7 +12,7 @@ import {
12
12
  __name
13
13
  } from "./chunk-ZVVMGPBJ.js";
14
14
 
15
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/terminal/prompt.js
15
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/terminal/prompt.js
16
16
  import { createInterface } from "node:readline";
17
17
  import { Writable } from "node:stream";
18
18
  var EMPTY_TRIES = 3;
@@ -2,20 +2,20 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  unit
5
- } from "./chunk-HAMDPWEZ.js";
5
+ } from "./chunk-7W23N2YW.js";
6
6
  import {
7
7
  PLAIN_HTTP_REFUSED,
8
8
  modelAddressAllowed,
9
9
  onThisComputer
10
- } from "./chunk-LQYMN36C.js";
10
+ } from "./chunk-IS6FUZCP.js";
11
11
  import {
12
12
  readSharedSection,
13
13
  sharedConfigPath,
14
14
  writeSharedSection
15
- } from "./chunk-VPPNYUQM.js";
15
+ } from "./chunk-HGUYJUNO.js";
16
16
  import {
17
17
  storePath
18
- } from "./chunk-ERQRY6WZ.js";
18
+ } from "./chunk-LZ4AVHBS.js";
19
19
  import {
20
20
  boolean,
21
21
  isoTimestamp,
@@ -31,10 +31,10 @@ import {
31
31
  __name
32
32
  } from "./chunk-ZVVMGPBJ.js";
33
33
 
34
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
34
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
35
35
  import { setTimeout } from "node:timers/promises";
36
36
 
37
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/models/local-only.js
37
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/models/local-only.js
38
38
  var SECTION = "local_only";
39
39
  var Setting = strictObject({
40
40
  on: boolean(),
@@ -68,7 +68,7 @@ var refuseModelAddress = /* @__PURE__ */ __name((env, address, what) => {
68
68
  refuseOffComputer(env, address, what);
69
69
  }, "refuseModelAddress");
70
70
 
71
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
71
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/embeddings/remote.js
72
72
  var OPENAI_URL = "https://api.openai.com/v1";
73
73
  var OPENAI_MODELS = {
74
74
  "text-embedding-3-small": { dims: 1536, perMillion: 0.02 },
@@ -2,9 +2,10 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  storePath
5
- } from "./chunk-ERQRY6WZ.js";
5
+ } from "./chunk-LZ4AVHBS.js";
6
6
  import {
7
- resolvePaths
7
+ resolvePaths,
8
+ writeSecurely
8
9
  } from "./chunk-HNWDEDMU.js";
9
10
  import {
10
11
  CliError
@@ -16,11 +17,295 @@ import {
16
17
  __name
17
18
  } from "./chunk-ZVVMGPBJ.js";
18
19
 
19
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/shared-config.js
20
- import { mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
20
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/shared-config.js
21
+ import { existsSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
21
22
  import { dirname, join, resolve } from "node:path";
22
23
 
23
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/domain/task-categories.js
24
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/domain/config-repair.js
25
+ var REPAIR_WORDS = {
26
+ byte_order_mark: "an invisible byte-order mark at the start",
27
+ comment: "a comment, which JSON does not allow",
28
+ trailing_comma: "a comma before a closing bracket",
29
+ missing_comma: "a missing comma",
30
+ unquoted_key: "a key without double quotes",
31
+ single_quotes: "text in single quotes",
32
+ missing_closer: "the file stops before its closing brackets \u2014 whatever followed this line was already lost"
33
+ };
34
+ var GiveUp = class {
35
+ static {
36
+ __name(this, "GiveUp");
37
+ }
38
+ at;
39
+ why;
40
+ constructor(at, why) {
41
+ this.at = at;
42
+ this.why = why;
43
+ }
44
+ };
45
+ var NUMBER = /^-?(0|[1-9]\d*)(\.\d+)?([eE][+-]?\d+)?/;
46
+ var LITERAL = /^(true|false|null)/;
47
+ var KEY = /^[A-Za-z_$][\w$.-]*/;
48
+ var ENDS_VALUE = /^[\s,\]}/]?$/;
49
+ var repairConfigText = /* @__PURE__ */ __name((text) => {
50
+ try {
51
+ JSON.parse(text);
52
+ return { state: "valid" };
53
+ } catch {
54
+ }
55
+ const fixes = [];
56
+ const lineAt = /* @__PURE__ */ __name((offset) => text.slice(0, offset).split("\n").length, "lineAt");
57
+ const fix = /* @__PURE__ */ __name((kind, offset) => fixes.push({ kind, line: lineAt(offset) }), "fix");
58
+ const giveUp = /* @__PURE__ */ __name((why, offset = at) => {
59
+ throw new GiveUp(offset, why);
60
+ }, "giveUp");
61
+ let at = 0;
62
+ let truncated = false;
63
+ let last = "open";
64
+ let lastEnd = 0;
65
+ const previous = /* @__PURE__ */ __name(() => last, "previous");
66
+ const skip = /* @__PURE__ */ __name(() => {
67
+ for (; ; ) {
68
+ while (/\s/.test(text[at] ?? ""))
69
+ at++;
70
+ if (text.startsWith("//", at)) {
71
+ fix("comment", at);
72
+ while (at < text.length && text[at] !== "\n")
73
+ at++;
74
+ } else if (text.startsWith("/*", at)) {
75
+ const end = text.indexOf("*/", at + 2);
76
+ if (end < 0)
77
+ giveUp("a /* comment is never closed");
78
+ fix("comment", at);
79
+ at = end + 2;
80
+ } else
81
+ return;
82
+ }
83
+ }, "skip");
84
+ const string = /* @__PURE__ */ __name(() => {
85
+ const quote = text[at];
86
+ const start = at;
87
+ if (quote === "'")
88
+ fix("single_quotes", at);
89
+ at++;
90
+ let body = "";
91
+ for (; ; ) {
92
+ if (at >= text.length)
93
+ giveUp("the file stops inside a quoted text", start);
94
+ const char = text[at];
95
+ if (char === quote)
96
+ break;
97
+ if (text.charCodeAt(at) < 32)
98
+ giveUp("a line break inside a quoted text");
99
+ if (char === "\\") {
100
+ const next = text[at + 1] ?? "";
101
+ if (quote === "'" && next === "'")
102
+ body += "'";
103
+ else if (/^["\\/bfnrt]$/.test(next))
104
+ body += `\\${next}`;
105
+ else if (next === "u" && /^[0-9a-fA-F]{4}$/.test(text.slice(at + 2, at + 6))) {
106
+ body += text.slice(at, at + 6);
107
+ at += 4;
108
+ } else
109
+ giveUp("an escape JSON has no meaning for");
110
+ at += 2;
111
+ continue;
112
+ }
113
+ body += char === '"' ? '\\"' : char;
114
+ at++;
115
+ }
116
+ at++;
117
+ return JSON.parse(`"${body}"`);
118
+ }, "string");
119
+ const key = /* @__PURE__ */ __name(() => {
120
+ const char = text[at] ?? "";
121
+ if (char === '"' || char === "'")
122
+ return string();
123
+ const word = KEY.exec(text.slice(at))?.[0];
124
+ if (!word)
125
+ return giveUp("something other than a key where a key should be");
126
+ fix("unquoted_key", at);
127
+ at += word.length;
128
+ return word;
129
+ }, "key");
130
+ const scalar = /* @__PURE__ */ __name(() => {
131
+ const char = text[at] ?? "";
132
+ if (char === '"' || char === "'")
133
+ return { json: JSON.stringify(string()) };
134
+ const word = (NUMBER.exec(text.slice(at)) ?? LITERAL.exec(text.slice(at)))?.[0];
135
+ if (!word || !ENDS_VALUE.test(text[at + word.length] ?? ""))
136
+ return giveUp("a value that is not JSON \u2014 text needs quotes, and only true, false and null go without");
137
+ if (at + word.length === text.length && NUMBER.test(word))
138
+ giveUp("the file stops inside a number");
139
+ at += word.length;
140
+ return { json: word };
141
+ }, "scalar");
142
+ const members = /* @__PURE__ */ __name((close, one) => {
143
+ const out = [];
144
+ at++;
145
+ last = "open";
146
+ let comma = -1;
147
+ for (; ; ) {
148
+ skip();
149
+ if (truncated)
150
+ return out;
151
+ if (at >= text.length) {
152
+ if (previous() === "close")
153
+ giveUp("the file stops after a closing bracket, so which brackets are missing has two readings");
154
+ if (previous() === "comma")
155
+ fix("trailing_comma", comma);
156
+ fix("missing_closer", text.length);
157
+ truncated = true;
158
+ return out;
159
+ }
160
+ const char = text[at];
161
+ if (char === close) {
162
+ if (previous() === "comma")
163
+ fix("trailing_comma", comma);
164
+ at++;
165
+ last = "close";
166
+ return out;
167
+ }
168
+ if (char === "}" || char === "]")
169
+ giveUp(`a ${char} where ${close} should close`);
170
+ if (char === ",") {
171
+ if (previous() !== "value" && previous() !== "close")
172
+ giveUp("a comma with nothing before it");
173
+ comma = at;
174
+ at++;
175
+ last = "comma";
176
+ continue;
177
+ }
178
+ if (previous() === "value" || previous() === "close") {
179
+ if (lineAt(at) === lineAt(lastEnd))
180
+ giveUp("two entries on one line with no comma between them");
181
+ fix("missing_comma", lastEnd);
182
+ }
183
+ out.push(one());
184
+ }
185
+ }, "members");
186
+ const value = /* @__PURE__ */ __name(() => {
187
+ const char = text[at] ?? "";
188
+ let node;
189
+ if (char === "{") {
190
+ const seen = /* @__PURE__ */ new Set();
191
+ node = {
192
+ object: members("}", () => {
193
+ const start = at;
194
+ const name = key();
195
+ if (seen.has(name))
196
+ giveUp("a key appears twice in one object", start);
197
+ seen.add(name);
198
+ skip();
199
+ if (at >= text.length)
200
+ giveUp("the file stops after a key, before its value");
201
+ if (text[at] !== ":")
202
+ giveUp("a key with no colon after it");
203
+ at++;
204
+ skip();
205
+ if (at >= text.length)
206
+ giveUp("the file stops after a key, before its value");
207
+ return [name, value()];
208
+ })
209
+ };
210
+ } else if (char === "[") {
211
+ node = {
212
+ array: members("]", () => {
213
+ return value();
214
+ })
215
+ };
216
+ } else
217
+ node = scalar();
218
+ if (!truncated) {
219
+ last = "json" in node ? "value" : "close";
220
+ lastEnd = at;
221
+ }
222
+ return node;
223
+ }, "value");
224
+ try {
225
+ if (text.includes("\0") || text.includes(String.fromCharCode(65533)))
226
+ giveUp("the file is not text", 0);
227
+ if (text.charCodeAt(0) === 65279) {
228
+ fix("byte_order_mark", 0);
229
+ at = 1;
230
+ }
231
+ skip();
232
+ if (text[at] !== "{")
233
+ giveUp(at >= text.length ? "the file is empty" : "the file does not start with {");
234
+ const root = value();
235
+ skip();
236
+ if (at < text.length)
237
+ giveUp("more text after the closing }");
238
+ const repaired = `${serialise(root, "")}
239
+ `;
240
+ JSON.parse(repaired);
241
+ return { state: "repaired", text: repaired, fixes };
242
+ } catch (error) {
243
+ if (!(error instanceof GiveUp))
244
+ throw error;
245
+ const before = text.slice(0, error.at).split("\n");
246
+ return {
247
+ state: "refused",
248
+ line: before.length,
249
+ column: (before.at(-1)?.length ?? 0) + 1,
250
+ why: error.why
251
+ };
252
+ }
253
+ }, "repairConfigText");
254
+ var serialise = /* @__PURE__ */ __name((node, indent) => {
255
+ if ("json" in node)
256
+ return node.json;
257
+ const inner = `${indent} `;
258
+ const parts = "object" in node ? node.object.map(([name, item]) => `${inner}${JSON.stringify(name)}: ${serialise(item, inner)}`) : node.array.map((item) => `${inner}${serialise(item, inner)}`);
259
+ const [open, close] = "object" in node ? ["{", "}"] : ["[", "]"];
260
+ return parts.length === 0 ? `${open}${close}` : `${open}
261
+ ${parts.join(",\n")}
262
+ ${indent}${close}`;
263
+ }, "serialise");
264
+ var SAFE_REPAIRS = /* @__PURE__ */ new Set([
265
+ "byte_order_mark",
266
+ "comment",
267
+ "trailing_comma",
268
+ "missing_comma"
269
+ ]);
270
+ var FIX_FOR = {
271
+ unquoted_key: /* @__PURE__ */ __name((line) => `put the key on line ${line} in double quotes`, "unquoted_key"),
272
+ single_quotes: /* @__PURE__ */ __name((line) => `use double quotes for the text on line ${line}`, "single_quotes"),
273
+ missing_closer: /* @__PURE__ */ __name((line) => `add the closing } or ] the file lacks after line ${line}, and check that nothing after it was lost`, "missing_closer")
274
+ };
275
+ var FIX_FOR_REFUSAL = [
276
+ [/no comma between/, (line, before) => `add a comma after ${before} on line ${line}`],
277
+ [/no colon after/, (line) => `add a colon after the key on line ${line}`],
278
+ [/comma with nothing before/, (line) => `remove the extra comma on line ${line}`],
279
+ [/inside a quoted text/, (line) => `close the quotes on line ${line}`],
280
+ [/value that is not JSON/, (line) => `put the value on line ${line} in double quotes`],
281
+ [/key appears twice/, (line) => `keep one of the two keys named on line ${line}; the file holds both`]
282
+ ];
283
+ var shown = /* @__PURE__ */ __name((line) => line.trim().replace(/("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[^\s"',:{}[\]]+)(\s*:)?/g, (token, _value, key) => key || /^(true|false|null)$/.test(token) ? token : '"\u2026"'), "shown");
284
+ var explainBrokenJson = /* @__PURE__ */ __name((text, result) => {
285
+ const lines = text.replace(/^\uFEFF/u, "").split(/\r?\n/);
286
+ const around = /* @__PURE__ */ __name((line2) => {
287
+ const near = lines[line2 - 1]?.trim() ? lines[line2 - 1] : lines[line2 - 2];
288
+ return near ? ` \u2014 near \`${shown(near)}\`` : "";
289
+ }, "around");
290
+ if (result.state === "repaired") {
291
+ const asked = result.fixes.find((one) => !SAFE_REPAIRS.has(one.kind)) ?? result.fixes[0];
292
+ if (!asked)
293
+ return "it is not valid JSON";
294
+ const fix2 = FIX_FOR[asked.kind]?.(asked.line);
295
+ return `line ${asked.line} has ${REPAIR_WORDS[asked.kind]}${around(asked.line)}${fix2 ? `; likely fix: ${fix2}` : ""}`;
296
+ }
297
+ if (result.state === "valid")
298
+ return "it is valid JSON";
299
+ const { line, why } = result;
300
+ const column = line === 1 && text.charCodeAt(0) === 65279 ? result.column - 1 : result.column;
301
+ const head = (lines[line - 1] ?? "").slice(0, column - 1);
302
+ const entry = head.slice(Math.max(head.lastIndexOf(","), head.lastIndexOf("{"), head.lastIndexOf("[")) + 1);
303
+ const before = shown(entry) || shown(lines[line - 2] ?? "");
304
+ const fix = FIX_FOR_REFUSAL.find(([pattern]) => pattern.test(why))?.[1](line, `\`${before}\``);
305
+ return `line ${line}, column ${column}: ${why}${around(line)}; likely fix: ${fix ?? "correct that part by hand"}`;
306
+ }, "explainBrokenJson");
307
+
308
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/domain/task-categories.js
24
309
  var DEFAULT_TASK_CATEGORIES = [
25
310
  {
26
311
  name: "taxes",
@@ -775,7 +1060,7 @@ var storedTaskCategories = /* @__PURE__ */ __name((json) => {
775
1060
  }
776
1061
  }, "storedTaskCategories");
777
1062
 
778
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/store/shared-config.js
1063
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/store/shared-config.js
779
1064
  var SECTION = "task_categories";
780
1065
  var sharedConfigPath = /* @__PURE__ */ __name((store, env = process.env) => {
781
1066
  const paths = resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env });
@@ -783,10 +1068,33 @@ var sharedConfigPath = /* @__PURE__ */ __name((store, env = process.env) => {
783
1068
  return join(paths.config, "config.json");
784
1069
  return resolve(store) === resolve(storePath({ ...env, MESSAGING_STORE: void 0 })) ? join(paths.config, "config.json") : join(dirname(store), "config.json");
785
1070
  }, "sharedConfigPath");
1071
+ var backupPathFor = /* @__PURE__ */ __name((file) => {
1072
+ const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
1073
+ let path = `${file}.bak-${stamp}`;
1074
+ for (let n = 2; existsSync(path); n++)
1075
+ path = `${file}.bak-${stamp}-${n}`;
1076
+ return path;
1077
+ }, "backupPathFor");
1078
+ var mended = /* @__PURE__ */ __name((path, bytes) => {
1079
+ const text = bytes.toString("utf8");
1080
+ const result = repairConfigText(text);
1081
+ if (result.state === "repaired" && result.fixes.every((one) => SAFE_REPAIRS.has(one.kind))) {
1082
+ try {
1083
+ writeSecurely(backupPathFor(path), bytes, statSync(path).mode & 511);
1084
+ writeSecurely(path, result.text, 384);
1085
+ } catch {
1086
+ }
1087
+ return JSON.parse(result.text);
1088
+ }
1089
+ throw new CliError("configuration_error", `${path} is not valid JSON, ${explainBrokenJson(text, result)}`, {
1090
+ reason: "config.invalid_json",
1091
+ file: path
1092
+ });
1093
+ }, "mended");
786
1094
  var readJson = /* @__PURE__ */ __name((path) => {
787
- let text;
1095
+ let bytes;
788
1096
  try {
789
- text = readFileSync(path, "utf8");
1097
+ bytes = readFileSync(path);
790
1098
  } catch (error) {
791
1099
  if (error.code === "ENOENT")
792
1100
  return void 0;
@@ -794,9 +1102,9 @@ var readJson = /* @__PURE__ */ __name((path) => {
794
1102
  }
795
1103
  let parsed;
796
1104
  try {
797
- parsed = JSON.parse(text.replace(/^\uFEFF/u, ""));
798
- } catch (error) {
799
- throw new CliError("configuration_error", `${path} is not valid JSON: ${error.message}`);
1105
+ parsed = JSON.parse(bytes.toString("utf8"));
1106
+ } catch {
1107
+ parsed = mended(path, bytes);
800
1108
  }
801
1109
  if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
802
1110
  throw new CliError("configuration_error", `${path} must hold a JSON object`);
@@ -871,6 +1179,8 @@ var taskCategoriesReader = /* @__PURE__ */ __name((path) => {
871
1179
  }, "taskCategoriesReader");
872
1180
 
873
1181
  export {
1182
+ REPAIR_WORDS,
1183
+ repairConfigText,
874
1184
  DEFAULT_TASK_CATEGORIES,
875
1185
  FALLBACK_CATEGORY,
876
1186
  unlistedNote,
@@ -878,6 +1188,7 @@ export {
878
1188
  taskCategoryValue,
879
1189
  storedTaskCategories,
880
1190
  sharedConfigPath,
1191
+ backupPathFor,
881
1192
  readTaskCategoryEdits,
882
1193
  applyTaskCategoryEdits,
883
1194
  editsFrom,
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.656.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_dceb8977715cf47b69a8fd97c630c977/node_modules/@wirecat/cli-core/dist/cli/stdin-field.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/cli/stdin-field.js
8
8
  var fields = /* @__PURE__ */ new WeakMap();
9
9
  var readsStdin = /* @__PURE__ */ __name((command, field) => {
10
10
  fields.set(command, field);