@wirecat/zoom-cli 0.70.0 → 0.72.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 (180) hide show
  1. package/dist/answer-entities.d.ts +2 -0
  2. package/dist/answer-entities.d.ts.map +1 -1
  3. package/dist/answers.d.ts +56 -0
  4. package/dist/answers.d.ts.map +1 -1
  5. package/dist/bin/zm.js +2 -2
  6. package/dist/bundle/{all-profiles-GE2TFJJP.js → all-profiles-XFIPF4GF.js} +12 -12
  7. package/dist/bundle/answer-policy-AT6CDEE5.js +110 -0
  8. package/dist/bundle/{anthropic-FA6NHENI.js → anthropic-SSUBR3BC.js} +29 -13
  9. package/dist/bundle/{app-server-IRADMSNX.js → app-server-7DJHHF2F.js} +68 -56
  10. package/dist/bundle/{bun-ZYZGGCX5.js → bun-6HBYWQIX.js} +2 -2
  11. package/dist/bundle/{bun-sqlite-Y24TUIGS.js → bun-sqlite-4L3Q55NB.js} +10 -6
  12. package/dist/bundle/{chunk-JULBAECW.js → chunk-23J2ANZ7.js} +16 -6
  13. package/dist/bundle/{chunk-4DSIWYGO.js → chunk-24OFZNRC.js} +39296 -24139
  14. package/dist/bundle/{chunk-LXXCLQCW.js → chunk-2MIBRVSV.js} +2 -2
  15. package/dist/bundle/{chunk-CHGUNZ3L.js → chunk-37NF5CBJ.js} +4 -4
  16. package/dist/bundle/chunk-3KRTEX5M.js +53 -0
  17. package/dist/bundle/{chunk-VNU5L37V.js → chunk-4SY67IUA.js} +34 -42
  18. package/dist/bundle/{chunk-XWQNJKTP.js → chunk-4XQWF3U2.js} +6 -6
  19. package/dist/bundle/{chunk-OAQLVV6W.js → chunk-4YIGXTBP.js} +3 -3
  20. package/dist/bundle/{chunk-RB33VTUW.js → chunk-5AELTC52.js} +810 -210
  21. package/dist/bundle/chunk-5MGICK47.js +1243 -0
  22. package/dist/bundle/{chunk-RRRJCHUC.js → chunk-5X4IY5JH.js} +4504 -1622
  23. package/dist/bundle/{chunk-EOSVN2ER.js → chunk-63QXCE5Z.js} +242 -242
  24. package/dist/bundle/{chunk-OE7EIP5L.js → chunk-6DCLZLGX.js} +1 -1
  25. package/dist/bundle/chunk-7GLJSJ7M.js +16 -0
  26. package/dist/bundle/{chunk-KM736RMJ.js → chunk-7IFO43Q5.js} +2 -2
  27. package/dist/bundle/{chunk-IWPXWGF7.js → chunk-7JYMGXLI.js} +44 -42
  28. package/dist/bundle/{chunk-LAG5O2FV.js → chunk-7OD3522V.js} +4162 -3769
  29. package/dist/bundle/{chunk-DCUWJITQ.js → chunk-7S4D5SM2.js} +60 -608
  30. package/dist/bundle/{chunk-3KC7C465.js → chunk-7SUWPMZG.js} +10 -15
  31. package/dist/bundle/{chunk-6IF5ZHDS.js → chunk-ADKMBXY4.js} +1 -1
  32. package/dist/bundle/{chunk-56OV5ASY.js → chunk-B3SILJBU.js} +18 -18
  33. package/dist/bundle/{chunk-CIZ25UPK.js → chunk-CANRIRNZ.js} +8241 -5553
  34. package/dist/bundle/{chunk-YUHM2OJM.js → chunk-CW46FWKW.js} +38 -123
  35. package/dist/bundle/{chunk-VSLDWT4E.js → chunk-D24OQAHM.js} +4 -4
  36. package/dist/bundle/{chunk-ZBKWRYRS.js → chunk-D5EUMWD5.js} +3 -3
  37. package/dist/bundle/{chunk-CSEBB4OP.js → chunk-DEPXZJ2V.js} +21 -150
  38. package/dist/bundle/{chunk-YJSPBUGB.js → chunk-DOCVEKP2.js} +51 -67
  39. package/dist/bundle/{chunk-V2E7QFZ3.js → chunk-EFF2XBHP.js} +2 -2
  40. package/dist/bundle/{chunk-XRFHQGOD.js → chunk-EG25AY4L.js} +1 -1
  41. package/dist/bundle/{chunk-FEM2JQN2.js → chunk-ELJUBPY4.js} +1 -1
  42. package/dist/bundle/{chunk-2U6SER67.js → chunk-ERJYJ36F.js} +2 -2
  43. package/dist/bundle/chunk-FSCPQQS5.js +244 -0
  44. package/dist/bundle/{chunk-BVWF4B33.js → chunk-H53WFZBN.js} +16 -139
  45. package/dist/bundle/{chunk-VJ5ZU4UF.js → chunk-I7CUMZD6.js} +3 -3
  46. package/dist/bundle/{chunk-OA37BWE5.js → chunk-IACWKZWS.js} +1 -1
  47. package/dist/bundle/{chunk-BSS6HX4O.js → chunk-IFBIXU6C.js} +2 -2
  48. package/dist/bundle/{chunk-UVPL7YAY.js → chunk-IU4DUUB3.js} +7 -7
  49. package/dist/bundle/{chunk-W7ZEEC4K.js → chunk-IXO4SCKE.js} +1 -1
  50. package/dist/bundle/{chunk-J3SKXICS.js → chunk-JAEPK457.js} +359 -765
  51. package/dist/bundle/{chunk-ZV3INEKM.js → chunk-JFPUYQSP.js} +5 -5
  52. package/dist/bundle/{chunk-ZS55EERO.js → chunk-JG4MNYG2.js} +1 -1
  53. package/dist/bundle/{chunk-IINZIP73.js → chunk-JRCH4YZP.js} +17 -10
  54. package/dist/bundle/{chunk-2JEM2YNV.js → chunk-JZ4XNNL7.js} +1 -1
  55. package/dist/bundle/chunk-K6HR6HCO.js +32 -0
  56. package/dist/bundle/{chunk-SNIY3JDN.js → chunk-KFZL67JP.js} +328 -60
  57. package/dist/bundle/{chunk-CEJJBZAE.js → chunk-KPIQXFNB.js} +375 -10
  58. package/dist/bundle/{chunk-M7VUXXGS.js → chunk-KWURWGGB.js} +137 -7
  59. package/dist/bundle/{chunk-M6JIXMQZ.js → chunk-LA6QUVGQ.js} +3 -2
  60. package/dist/bundle/{chunk-AISJCF7A.js → chunk-LLUNHAZ7.js} +4 -4
  61. package/dist/bundle/{chunk-KWRCP55G.js → chunk-LTWJM3ED.js} +17 -17
  62. package/dist/bundle/{chunk-IS3ZTT2Z.js → chunk-M3DMXDX6.js} +6 -6
  63. package/dist/bundle/{chunk-VW6BF6M7.js → chunk-MCPOZNWG.js} +1 -1
  64. package/dist/bundle/{chunk-L24UOUWG.js → chunk-MSQHSW4C.js} +2 -2
  65. package/dist/bundle/chunk-N4QNYWWG.js +71 -0
  66. package/dist/bundle/chunk-NMZQTYKJ.js +18 -0
  67. package/dist/bundle/{chunk-DNR4B5YV.js → chunk-OHCLQJOV.js} +3 -3
  68. package/dist/bundle/{chunk-MVOMLJYQ.js → chunk-OP5PGE2N.js} +4 -4
  69. package/dist/bundle/{chunk-QL7EMFIC.js → chunk-OY6N2ABP.js} +29 -23
  70. package/dist/bundle/chunk-PJWSGXOB.js +185 -0
  71. package/dist/bundle/{chunk-YTN2JN6N.js → chunk-QA6KIL7Q.js} +12 -8
  72. package/dist/bundle/{chunk-6HJFIMT7.js → chunk-QQUY4MZY.js} +1 -1
  73. package/dist/bundle/{chunk-ZSKE7N2U.js → chunk-QW7YTRV2.js} +3 -3
  74. package/dist/bundle/chunk-RJTGENHZ.js +109 -0
  75. package/dist/bundle/{chunk-RIPAUCKJ.js → chunk-RLCVPECY.js} +74 -67
  76. package/dist/bundle/{chunk-M7E44TMT.js → chunk-RN5SU2RN.js} +6 -6
  77. package/dist/bundle/{chunk-P3ASN72F.js → chunk-RX5CJ55S.js} +1 -1
  78. package/dist/bundle/{chunk-7QC4M4HS.js → chunk-RZUJMAMK.js} +4 -4
  79. package/dist/bundle/{chunk-OORMSM6O.js → chunk-S7SXSHRC.js} +21 -21
  80. package/dist/bundle/{chunk-SVF3NDAO.js → chunk-SXZGCD6E.js} +3 -3
  81. package/dist/bundle/{chunk-DXCTW3MV.js → chunk-T27IMG6X.js} +3 -1
  82. package/dist/bundle/{chunk-PV6OHXHN.js → chunk-TF2WKPNW.js} +18 -18
  83. package/dist/bundle/{chunk-X4ZF4XXI.js → chunk-U32VL3MA.js} +1 -1
  84. package/dist/bundle/{chunk-RQG5VOGH.js → chunk-U3NJBGLA.js} +3 -3
  85. package/dist/bundle/{chunk-WOIHSQAL.js → chunk-UVZLK3M4.js} +33 -9
  86. package/dist/bundle/chunk-VIV64MQM.js +779 -0
  87. package/dist/bundle/{chunk-2QFPVUM3.js → chunk-W3YTVEWV.js} +69 -6
  88. package/dist/bundle/{chunk-AUNW7N4I.js → chunk-WLVG4RBZ.js} +1 -1
  89. package/dist/bundle/{chunk-JRO2FWO2.js → chunk-WOAYHCM2.js} +1 -1
  90. package/dist/bundle/{chunk-RO3ZR4VP.js → chunk-WXTYYWZI.js} +13 -13
  91. package/dist/bundle/{chunk-RWIILYKW.js → chunk-WZGKHTA4.js} +2 -2
  92. package/dist/bundle/{chunk-GB5X3GBE.js → chunk-X2MP634F.js} +14 -5
  93. package/dist/bundle/{chunk-RGJ7OWHU.js → chunk-XPWZSW6Y.js} +61 -21
  94. package/dist/bundle/{chunk-D3PNCJD5.js → chunk-YVVJ6Y5C.js} +7 -7
  95. package/dist/bundle/chunk-ZHA56THL.js +2355 -0
  96. package/dist/bundle/{chunk-QO2KPU26.js → chunk-ZVFYGTGJ.js} +101 -44
  97. package/dist/bundle/{chunk-V5GRSOCZ.js → chunk-ZW5KHKMA.js} +5 -5
  98. package/dist/bundle/{cli-VRSQ7HAE.js → cli-IYYI7GAM.js} +215 -100
  99. package/dist/bundle/command-contract-TX7NSUBM.js +42 -0
  100. package/dist/bundle/command-server-entry-FXX4LJWF.js +171 -0
  101. package/dist/bundle/config-YKNM33J7.js +96 -0
  102. package/dist/bundle/{decode-523PUQMR.js → decode-SRGOOGBW.js} +6 -6
  103. package/dist/bundle/{dispatch-IZCAK47P.js → dispatch-OUHRPFUL.js} +11 -11
  104. package/dist/bundle/{dist-6WWKPEVW.js → dist-UZLNLAIO.js} +97 -56
  105. package/dist/bundle/{echarts-S5UMX2D3.js → echarts-7CM2MCMW.js} +2 -2
  106. package/dist/bundle/{embed-ODPDVHUK.js → embed-VEE56BOB.js} +7 -7
  107. package/dist/bundle/{embedder-PAXRBSZE.js → embedder-SZFYR543.js} +10 -10
  108. package/dist/bundle/{failure-R2OIHCE5.js → failure-MZBNM7M5.js} +3 -3
  109. package/dist/bundle/first-run-KWC7RKF2.js +29 -0
  110. package/dist/bundle/first-screen-DWKMNSEI.js +40 -0
  111. package/dist/bundle/{folders-ZXTOFY4T.js → folders-UQXRSDJJ.js} +5 -5
  112. package/dist/bundle/{instructions-DUB7E6C5.js → instructions-R7OHVAWH.js} +1 -1
  113. package/dist/bundle/{main-A7JSYQI6.js → main-EFUN2O3K.js} +21 -20
  114. package/dist/bundle/{mcp-M4QN2E7R.js → mcp-7KQUJNFN.js} +2 -2
  115. package/dist/bundle/{meetings-BDZQV3HR.js → meetings-5I2BDNTA.js} +9 -7
  116. package/dist/bundle/{node-E25KP53H.js → node-3N2JGZ7V.js} +2 -2
  117. package/dist/bundle/{node-sqlite-PHWDFZCP.js → node-sqlite-2UVEE2WM.js} +11 -7
  118. package/dist/bundle/{oauth-G2K46IYP.js → oauth-AYGD7UU3.js} +8 -8
  119. package/dist/bundle/{open-INWS5HIZ.js → open-3GUVDLGD.js} +6 -6
  120. package/dist/bundle/openai-NHCDLWWY.js +28 -0
  121. package/dist/bundle/{output-file-YGQYZCBJ.js → output-file-72JFXVHQ.js} +6 -6
  122. package/dist/bundle/{process-UJ2JHMJN.js → process-YAHHUFR5.js} +1 -1
  123. package/dist/bundle/{program-LYTGFV6L.js → program-OSZROCTK.js} +113 -118
  124. package/dist/bundle/{prompt-VTUCRCE4.js → prompt-HMCW4XQJ.js} +6 -6
  125. package/dist/bundle/{recognize-3CEPOW2F.js → recognize-VF5CA7EM.js} +5 -5
  126. package/dist/bundle/{remote-DRQEXEZL.js → remote-5C6VTPR2.js} +10 -8
  127. package/dist/bundle/{rerank-UL4KNNVN.js → rerank-ER7NEDOI.js} +8 -8
  128. package/dist/bundle/run-log-JKTLKXSK.js +124 -0
  129. package/dist/bundle/{serve-P5UWUOWQ.js → serve-QJWXJOM7.js} +10 -10
  130. package/dist/bundle/{server-M6XK2Y3X.js → server-KCIK3Y2P.js} +50 -48
  131. package/dist/bundle/server-LLGFDLLJ.js +75 -0
  132. package/dist/bundle/{services-4HRYNY62.js → services-LQMYJQG3.js} +121 -52
  133. package/dist/bundle/{speech-BBPBMFAO.js → speech-74GJQNQH.js} +20 -17
  134. package/dist/bundle/{state-GDSUNUSY.js → state-4XDGCHDF.js} +7 -7
  135. package/dist/bundle/{store-LBQ6FZP2.js → store-5Y5HK2L2.js} +28 -19
  136. package/dist/bundle/{store-VWLABMLF.js → store-Y56AHJ2Y.js} +64 -31
  137. package/dist/bundle/store-connection-4WI32AYU.js +89 -0
  138. package/dist/bundle/store-maintenance-command-PCXO5AH4.js +65 -0
  139. package/dist/bundle/{streaming-EJ3NM2C2.js → streaming-E5CR6HSR.js} +7 -7
  140. package/dist/bundle/{tokens-BE6CJMR5.js → tokens-E2QNVC4F.js} +7 -7
  141. package/dist/bundle/zm.js +34 -10
  142. package/dist/bundle/{zoom-app-YIEJLWCW.js → zoom-app-NVL7HEAX.js} +8 -8
  143. package/dist/contract-overrides.d.ts.map +1 -1
  144. package/dist/contract-overrides.js +0 -6
  145. package/dist/contract-overrides.js.map +1 -1
  146. package/dist/ingestion-search-commands.d.ts.map +1 -1
  147. package/dist/ingestion-search-commands.js +0 -10
  148. package/dist/ingestion-search-commands.js.map +1 -1
  149. package/dist/meeting-integration-commands.d.ts.map +1 -1
  150. package/dist/meeting-integration-commands.js +8 -6
  151. package/dist/meeting-integration-commands.js.map +1 -1
  152. package/dist/meeting-integration.d.ts +3 -1
  153. package/dist/meeting-integration.d.ts.map +1 -1
  154. package/dist/store-connection.d.ts.map +1 -1
  155. package/dist/store-connection.js +4 -3
  156. package/dist/store-connection.js.map +1 -1
  157. package/dist/unified-search.d.ts +4 -4
  158. package/dist/unified-search.d.ts.map +1 -1
  159. package/dist/unified-search.js +1 -24
  160. package/dist/unified-search.js.map +1 -1
  161. package/dist/version.d.ts +1 -1
  162. package/dist/version.js +1 -1
  163. package/package.json +4 -4
  164. package/skills/zoom-cli/SKILL.md +2 -2
  165. package/dist/bundle/answer-policy-GOXSDYDD.js +0 -104
  166. package/dist/bundle/chunk-5XWCBLUR.js +0 -27
  167. package/dist/bundle/chunk-AT2XKNFN.js +0 -342
  168. package/dist/bundle/chunk-GVT5363M.js +0 -35
  169. package/dist/bundle/chunk-VE2VNECR.js +0 -380
  170. package/dist/bundle/chunk-Y6C3N7YG.js +0 -12434
  171. package/dist/bundle/command-contract-RPRKHVU6.js +0 -41
  172. package/dist/bundle/config-QU6A6VIO.js +0 -90
  173. package/dist/bundle/first-run-NVTDR5VO.js +0 -28
  174. package/dist/bundle/first-screen-5RWZDWLK.js +0 -39
  175. package/dist/bundle/openai-T44ORVGQ.js +0 -25
  176. package/dist/bundle/run-log-UZAB5CWF.js +0 -118
  177. package/dist/bundle/server-F3NPVMS2.js +0 -72
  178. package/dist/bundle/store-connection-XEBFP56U.js +0 -83
  179. package/dist/bundle/store-maintenance-command-G43JN57J.js +0 -61
  180. /package/dist/bundle/{chunk-VOXIGICJ.js → chunk-YVNHQFLC.js} +0 -0
@@ -2,26 +2,31 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  validateFormattedText
5
- } from "./chunk-BVWF4B33.js";
5
+ } from "./chunk-H53WFZBN.js";
6
6
  import {
7
7
  inputPolicy
8
- } from "./chunk-V2E7QFZ3.js";
8
+ } from "./chunk-EFF2XBHP.js";
9
+ import {
10
+ RECORDS_SCHEMA_VERSION,
11
+ RECORD_TYPES,
12
+ pointerOf
13
+ } from "./chunk-ZHA56THL.js";
9
14
  import {
10
15
  indent
11
- } from "./chunk-OORMSM6O.js";
16
+ } from "./chunk-S7SXSHRC.js";
12
17
  import {
13
18
  CliError
14
- } from "./chunk-FEM2JQN2.js";
19
+ } from "./chunk-ELJUBPY4.js";
15
20
  import {
16
21
  __name
17
22
  } from "./chunk-ZVVMGPBJ.js";
18
23
 
19
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/domain/checks.js
24
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/domain/checks.js
20
25
  var spelled = /* @__PURE__ */ __name((check, args) => `${check.replaceAll(".", " ")}${args === void 0 ? "" : ` ${args}`}`, "spelled");
21
26
  var bareCheck = /* @__PURE__ */ __name((check, args) => `\`${spelled(check, args)}\``, "bareCheck");
22
27
  var checkWords = /* @__PURE__ */ __name((command, profile) => (check, args) => `\`${command} ${profile === void 0 ? "" : `${profile} `}${spelled(check, args)}\``, "checkWords");
23
28
 
24
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/domain/markdown.js
29
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/domain/markdown.js
25
30
  var MARKERS = [
26
31
  ["**", "bold"],
27
32
  ["~~", "strike"],
@@ -67,7 +72,7 @@ var closing = /* @__PURE__ */ __name((input, open, marker) => {
67
72
  return end;
68
73
  }, "closing");
69
74
 
70
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/domain/markdown-spans.js
75
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/domain/markdown-spans.js
71
76
  var STYLES = [
72
77
  ["**", "bold"],
73
78
  ["__", "underline"],
@@ -227,7 +232,7 @@ var parseMarkdownSpans = /* @__PURE__ */ __name((input) => {
227
232
  return validateFormattedText(result);
228
233
  }, "parseMarkdownSpans");
229
234
 
230
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/domain/polls.js
235
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/domain/polls.js
231
236
  var countedPoll = /* @__PURE__ */ __name((poll, votes, self) => {
232
237
  const cast = votes.filter((vote) => vote.answers.length > 0);
233
238
  const mine = self === null ? void 0 : votes.find((vote) => vote.person.id === self);
@@ -242,6 +247,361 @@ var countedPoll = /* @__PURE__ */ __name((poll, votes, self) => {
242
247
  };
243
248
  }, "countedPoll");
244
249
 
250
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/domain/records-table.js
251
+ var TABLE_RECORD_TYPES = Object.keys(RECORD_TYPES).filter((type) => !RECORD_TYPES[type].importOnly);
252
+ var TableError = class extends Error {
253
+ static {
254
+ __name(this, "TableError");
255
+ }
256
+ errors;
257
+ constructor(errors) {
258
+ super(errors.map((e) => e.message).join("; "));
259
+ this.errors = errors;
260
+ }
261
+ };
262
+ var LIST_SEPARATOR = "|";
263
+ var BOM = "\uFEFF";
264
+ var specOf = /* @__PURE__ */ __name((type) => RECORD_TYPES[type], "specOf");
265
+ var typesOf = /* @__PURE__ */ __name((schema) => schema.type === void 0 ? [] : typeof schema.type === "string" ? [schema.type] : [...schema.type], "typesOf");
266
+ var shapeOf = /* @__PURE__ */ __name((schema) => {
267
+ const types = typesOf(schema);
268
+ if (types.includes("integer"))
269
+ return "integer";
270
+ if (types.includes("boolean"))
271
+ return "boolean";
272
+ if (types.includes("array"))
273
+ return "list";
274
+ if (schema.pattern?.includes("T[0-9]{2}"))
275
+ return "instant";
276
+ if (schema.pattern?.startsWith("^[0-9]{4}-"))
277
+ return "day";
278
+ if (schema.pattern?.includes("[A-Za-z]{3}"))
279
+ return "currency";
280
+ if (schema.pattern?.includes("(\\.[0-9]"))
281
+ return "decimal";
282
+ return "text";
283
+ }, "shapeOf");
284
+ var valuesOf = /* @__PURE__ */ __name((schema) => schema.enum?.filter((v) => v !== null), "valuesOf");
285
+ var flat = /* @__PURE__ */ __name((schema) => {
286
+ const types = typesOf(schema);
287
+ return !types.includes("object") && !(types.includes("array") && schema.items?.type === "object");
288
+ }, "flat");
289
+ var fieldColumn = /* @__PURE__ */ __name((name, schema, required, kind) => {
290
+ const values = valuesOf(schema);
291
+ const shape = shapeOf(schema);
292
+ return {
293
+ name,
294
+ kind,
295
+ required,
296
+ shape,
297
+ description: schema.description ?? "",
298
+ ...values ? { values } : {},
299
+ ...shape === "list" ? { many: true } : {}
300
+ };
301
+ }, "fieldColumn");
302
+ var roleColumn = /* @__PURE__ */ __name((name, role) => ({
303
+ name,
304
+ kind: "role",
305
+ required: role.required === true,
306
+ shape: "text",
307
+ description: role.targets.length === 1 ? `The ${role.targets[0]}'s external id` : `<type>:<external id>, the type one of ${role.targets.join(", ")}`,
308
+ targets: role.targets,
309
+ ...role.many ? { many: true } : {}
310
+ }), "roleColumn");
311
+ var recordColumns = /* @__PURE__ */ __name((type) => {
312
+ const spec = specOf(type);
313
+ if (!spec || spec.importOnly)
314
+ return [];
315
+ const fields = spec.fields.properties ?? {};
316
+ const required = spec.fields.required ?? [];
317
+ const lists = Object.entries(fields).filter(([, schema]) => !flat(schema));
318
+ return [
319
+ { name: "external_id", kind: "id", required: true, shape: "text", description: "Its id in your system" },
320
+ ...Object.entries(fields).filter(([, schema]) => flat(schema)).map(([name, schema]) => fieldColumn(name, schema, required.includes(name), "field")),
321
+ ...Object.entries(spec.roles).filter(([, role]) => !role.linked).map(([name, role]) => roleColumn(name, role)),
322
+ ...lists.flatMap(([list, schema]) => {
323
+ const item = schema.items ?? {};
324
+ const own = item.required ?? [];
325
+ return Object.entries(item.properties ?? {}).map(([key, s]) => fieldColumn(`${list}.${key}`, s, required.includes(list) && own.includes(key), "item"));
326
+ })
327
+ ];
328
+ }, "recordColumns");
329
+ var csvCell = /* @__PURE__ */ __name((value, separator) => /["\r\n]/.test(value) || value.includes(separator) ? `"${value.replaceAll('"', '""')}"` : value, "csvCell");
330
+ var example = /* @__PURE__ */ __name((column) => {
331
+ if (column.values?.[0])
332
+ return column.values[0];
333
+ switch (column.shape) {
334
+ case "decimal":
335
+ return "100.00";
336
+ case "day":
337
+ return "2026-01-31";
338
+ case "instant":
339
+ return "2026-01-31T09:00:00Z";
340
+ case "currency":
341
+ return "EUR";
342
+ case "integer":
343
+ return 1;
344
+ case "boolean":
345
+ return true;
346
+ case "list":
347
+ return ["\u2026"];
348
+ default:
349
+ return column.description || "\u2026";
350
+ }
351
+ }, "example");
352
+ var exampleRef = /* @__PURE__ */ __name((column) => ({
353
+ role: column.name,
354
+ type: column.targets?.[0] ?? "",
355
+ external_id: `${column.targets?.[0] ?? "record"}-1`
356
+ }), "exampleRef");
357
+ var recordTemplate = /* @__PURE__ */ __name((type, format, { source, separator = "," } = {}) => {
358
+ const columns = recordColumns(type);
359
+ if (columns.length === 0)
360
+ throw new TableError([unknownType(type)]);
361
+ if (format === "csv")
362
+ return `${BOM}${columns.map((c) => csvCell(c.name, separator)).join(separator)}\r
363
+ `;
364
+ const fields = {};
365
+ for (const c of columns.filter((c2) => c2.kind === "field"))
366
+ fields[c.name] = example(c);
367
+ for (const c of columns.filter((c2) => c2.kind === "item")) {
368
+ const [list = "", key = ""] = c.name.split(".");
369
+ fields[list] ??= [{}];
370
+ const [first] = fields[list];
371
+ if (first)
372
+ first[key] = example(c);
373
+ }
374
+ const envelope = {
375
+ schema_version: RECORDS_SCHEMA_VERSION,
376
+ source: {
377
+ provider: source?.provider ?? "sheet",
378
+ account: source?.account ?? "main",
379
+ batch_id: source?.batch_id ?? "first-import"
380
+ },
381
+ records: [
382
+ {
383
+ key: `${type}-1`,
384
+ type,
385
+ external_id: `${type}-1`,
386
+ operation: "upsert",
387
+ fields,
388
+ relations: columns.filter((c) => c.kind === "role").map(exampleRef)
389
+ }
390
+ ]
391
+ };
392
+ return `${JSON.stringify(envelope, null, 2)}
393
+ `;
394
+ }, "recordTemplate");
395
+ var csvRows = /* @__PURE__ */ __name((text, separator) => {
396
+ const rows = [];
397
+ let cells = [];
398
+ let cell = "";
399
+ let quoted = false;
400
+ let line = 1;
401
+ let start = 1;
402
+ const end = /* @__PURE__ */ __name(() => {
403
+ cells.push(cell);
404
+ cell = "";
405
+ }, "end");
406
+ for (let i = 0; i < text.length; i++) {
407
+ const c = text[i];
408
+ if (quoted) {
409
+ if (c === '"' && text[i + 1] === '"') {
410
+ cell += '"';
411
+ i++;
412
+ } else if (c === '"')
413
+ quoted = false;
414
+ else {
415
+ if (c === "\n")
416
+ line++;
417
+ cell += c;
418
+ }
419
+ } else if (c === '"' && cell === "")
420
+ quoted = true;
421
+ else if (c === separator)
422
+ end();
423
+ else if (c === "\n" || c === "\r") {
424
+ if (c === "\r" && text[i + 1] === "\n")
425
+ i++;
426
+ end();
427
+ rows.push({ cells, line: start });
428
+ cells = [];
429
+ line++;
430
+ start = line;
431
+ } else
432
+ cell += c;
433
+ }
434
+ if (cell !== "" || cells.length > 0) {
435
+ end();
436
+ rows.push({ cells, line: start });
437
+ }
438
+ return rows.filter((r) => r.cells.some((c) => c.trim() !== ""));
439
+ }, "csvRows");
440
+ var csvSeparator = /* @__PURE__ */ __name((header) => {
441
+ const count = /* @__PURE__ */ __name((s) => header.split(s).length - 1, "count");
442
+ return [";", " ", ","].reduce((best, s) => count(s) > count(best) ? s : best, ",");
443
+ }, "csvSeparator");
444
+ var DAY_DOTTED = /^(\d{1,2})[./](\d{1,2})[./](\d{4})$/;
445
+ var normalized = /* @__PURE__ */ __name((column, raw) => {
446
+ const value = raw.trim();
447
+ switch (column.shape) {
448
+ case "decimal": {
449
+ const plain = value.replace(/[\s  ]/g, "");
450
+ return /^\d+,\d+$/.test(plain) ? plain.replace(",", ".") : plain;
451
+ }
452
+ case "day": {
453
+ const dotted = DAY_DOTTED.exec(value);
454
+ return dotted ? `${dotted[3]}-${dotted[2]?.padStart(2, "0")}-${dotted[1]?.padStart(2, "0")}` : value;
455
+ }
456
+ case "currency":
457
+ return value.toUpperCase();
458
+ case "integer":
459
+ return /^-?\d+$/.test(value) ? Number(value) : value;
460
+ case "boolean":
461
+ return /^(true|yes|1|да|sí|si)$/i.test(value) ? true : /^(false|no|0|нет)$/i.test(value) ? false : value;
462
+ case "list":
463
+ return value.split(LIST_SEPARATOR).map((v) => v.trim()).filter(Boolean);
464
+ default:
465
+ return column.many ? value.split(LIST_SEPARATOR).map((v) => v.trim()).filter(Boolean) : value;
466
+ }
467
+ }, "normalized");
468
+ var unknownType = /* @__PURE__ */ __name((type) => ({
469
+ pointer: "",
470
+ code: "record.type",
471
+ message: `no table for ${type}: use one of ${TABLE_RECORD_TYPES.join(", ")}`
472
+ }), "unknownType");
473
+ var relationsOf = /* @__PURE__ */ __name((column, raw) => {
474
+ const targets = column.targets ?? [];
475
+ const values = column.many ? raw.split(LIST_SEPARATOR) : [raw];
476
+ const out = [];
477
+ for (const value of values.map((v) => v.trim()).filter(Boolean)) {
478
+ const at = value.indexOf(":");
479
+ const named = at > 0 ? value.slice(0, at) : "";
480
+ if (targets.length === 1 && !targets.includes(named)) {
481
+ out.push({ role: column.name, type: targets[0], external_id: value });
482
+ continue;
483
+ }
484
+ if (!targets.includes(named) || at === value.length - 1)
485
+ return {
486
+ pointer: "",
487
+ code: "record.invalid",
488
+ message: `${column.name} takes <type>:<external id>, the type one of ${targets.join(", ")}: not ${value}`
489
+ };
490
+ out.push({ role: column.name, type: named, external_id: value.slice(at + 1) });
491
+ }
492
+ return out;
493
+ }, "relationsOf");
494
+ var envelopeOfCsv = /* @__PURE__ */ __name((text, { type, source, options }) => {
495
+ const columns = recordColumns(type);
496
+ if (columns.length === 0)
497
+ throw new TableError([unknownType(type)]);
498
+ const body = text.startsWith(BOM) ? text.slice(1) : text;
499
+ const separator = csvSeparator(body.slice(0, body.search(/\r?\n|$/)));
500
+ const [head, ...rows] = csvRows(body, separator);
501
+ if (!head)
502
+ throw new TableError([{ pointer: "", code: "envelope.invalid", message: "the file has no header row" }]);
503
+ const byName = new Map(columns.map((c) => [c.name, c]));
504
+ const header = head.cells.map((name) => name.trim());
505
+ const unknown = header.filter((name) => name !== "" && !byName.has(name));
506
+ if (unknown.length > 0)
507
+ throw new TableError([
508
+ {
509
+ pointer: "",
510
+ code: "envelope.invalid",
511
+ message: `columns ${type} has no field for: ${unknown.join(", ")}. Download the ${type} template for the list`,
512
+ place: { line: 1, column: unknown[0] }
513
+ }
514
+ ]);
515
+ if (!header.includes("external_id"))
516
+ throw new TableError([
517
+ { pointer: "", code: "envelope.invalid", message: "the header has no external_id column", place: { line: 1 } }
518
+ ]);
519
+ const records = [];
520
+ const indexById = /* @__PURE__ */ new Map();
521
+ const places = /* @__PURE__ */ new Map();
522
+ const errors = [];
523
+ for (const row of rows) {
524
+ const cell = /* @__PURE__ */ __name((name) => row.cells[header.indexOf(name)] ?? "", "cell");
525
+ const id = cell("external_id").trim();
526
+ if (!id) {
527
+ errors.push({
528
+ pointer: "",
529
+ code: "record.invalid",
530
+ message: "a row has no external_id",
531
+ place: { line: row.line, column: "external_id" }
532
+ });
533
+ continue;
534
+ }
535
+ const known = indexById.get(id);
536
+ const index = known ?? records.length;
537
+ const record = records[index] ?? {
538
+ key: `${type}:${id}`,
539
+ type,
540
+ external_id: id,
541
+ operation: "upsert",
542
+ fields: {},
543
+ relations: []
544
+ };
545
+ if (known === void 0) {
546
+ records.push(record);
547
+ indexById.set(id, index);
548
+ places.set(pointerOf("records", index), { line: row.line });
549
+ }
550
+ const fields = record.fields;
551
+ const item = {};
552
+ let list = "";
553
+ header.forEach((name, i) => {
554
+ const column = byName.get(name);
555
+ const raw = row.cells[i] ?? "";
556
+ if (!column || column.kind === "id" || raw.trim() === "")
557
+ return;
558
+ const at = { line: row.line, column: name };
559
+ if (column.kind === "field") {
560
+ fields[name] = normalized(column, raw);
561
+ places.set(pointerOf("records", index, "fields", name), at);
562
+ } else if (column.kind === "role") {
563
+ const relations = relationsOf(column, raw);
564
+ if (!Array.isArray(relations)) {
565
+ errors.push({ ...relations, pointer: pointerOf("records", index, "relations"), key: record.key, place: at });
566
+ return;
567
+ }
568
+ record.relations = [...(record.relations ?? []).filter((r) => r.role !== name), ...relations];
569
+ places.set(pointerOf("records", index, "relations"), at);
570
+ } else {
571
+ const [of = "", key = ""] = name.split(".");
572
+ list = of;
573
+ item[key] = normalized(column, raw);
574
+ }
575
+ });
576
+ if (list) {
577
+ fields[list] ??= [];
578
+ const items = fields[list];
579
+ places.set(pointerOf("records", index, "fields", list, items.length), { line: row.line });
580
+ items.push(item);
581
+ }
582
+ }
583
+ if (errors.length > 0)
584
+ throw new TableError(errors);
585
+ const envelope = {
586
+ schema_version: RECORDS_SCHEMA_VERSION,
587
+ source,
588
+ ...options ? { options } : {},
589
+ records
590
+ };
591
+ return {
592
+ envelope,
593
+ placeOf(pointer) {
594
+ const item = /^\/records\/\d+\/fields\/([^/]+)\/\d+\/([^/]+)/.exec(pointer);
595
+ for (let at = pointer; at !== ""; at = at.slice(0, at.lastIndexOf("/"))) {
596
+ const place = places.get(at);
597
+ if (place)
598
+ return item && !place.column ? { ...place, column: `${item[1]}.${item[2]}` } : place;
599
+ }
600
+ return void 0;
601
+ }
602
+ };
603
+ }, "envelopeOfCsv");
604
+
245
605
  // node_modules/.pnpm/qrcode-generator@2.0.4/node_modules/qrcode-generator/dist/qrcode.mjs
246
606
  var qrcode = /* @__PURE__ */ __name(function(typeNumber, errorCorrectionLevel) {
247
607
  const PAD0 = 236;
@@ -1876,7 +2236,7 @@ var createDataURL = /* @__PURE__ */ __name(function(width, height, getPixel) {
1876
2236
  var qrcode_default = qrcode;
1877
2237
  var stringToBytes = qrcode.stringToBytes;
1878
2238
 
1879
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/terminal/qr.js
2239
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/terminal/qr.js
1880
2240
  var QUIET_ZONE = 4;
1881
2241
  var BLACK_ON_WHITE = "\x1B[30;107m";
1882
2242
  var RESET = "\x1B[0m";
@@ -1923,7 +2283,7 @@ var plainQr = /* @__PURE__ */ __name((link) => {
1923
2283
  return lines.join("\n");
1924
2284
  }, "plainQr");
1925
2285
 
1926
- // node_modules/.pnpm/@wirecat+cli-core@0.614.0_@wirecat+cli-base@0.80.8_commander@15.0.0_esbuild@0.28.2_type_3bb6323e04e526bd9df39f840434b06b/node_modules/@wirecat/cli-core/dist/terminal/login-qr.js
2286
+ // node_modules/.pnpm/@wirecat+cli-core@0.647.0_@wirecat+cli-base@0.93.0_commander@15.0.0_esbuild@0.28.2_type_a46df5420a4458268e3f15f3e8c41b99/node_modules/@wirecat/cli-core/dist/terminal/login-qr.js
1927
2287
  var MARGIN = 2;
1928
2288
  var atTerminal = /* @__PURE__ */ __name((input) => input.isTTY === true && !inputPolicy(input).noInput, "atTerminal");
1929
2289
  var PASTE_QR = "agents: paste the QR code above into the chat as a code block, exactly as printed; when a new one is printed, paste it and say the old one expired";
@@ -1964,6 +2324,11 @@ export {
1964
2324
  parseMarkdown,
1965
2325
  parseMarkdownSpans,
1966
2326
  countedPoll,
2327
+ TABLE_RECORD_TYPES,
2328
+ TableError,
2329
+ recordColumns,
2330
+ recordTemplate,
2331
+ envelopeOfCsv,
1967
2332
  terminalQr,
1968
2333
  plainQr,
1969
2334
  atTerminal,