@wirecat/mail-cli 0.30.0 → 0.32.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 (105) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/bin/mail.js +2 -2
  3. package/dist/bundle/{all-profiles-523GLORJ.js → all-profiles-OTCWJSJS.js} +19 -29
  4. package/dist/bundle/{anthropic-KKYGROQR.js → anthropic-GUXHDK32.js} +2 -2
  5. package/dist/bundle/{app-server-RJR7U5NT.js → app-server-GX7DOE4O.js} +45 -60
  6. package/dist/bundle/{bun-EBQHHLKR.js → bun-V5QLYBZU.js} +2 -2
  7. package/dist/bundle/{bun-sqlite-LTG2RRSL.js → bun-sqlite-AXD5CCO3.js} +3 -3
  8. package/dist/bundle/{chunk-L2D5QYI3.js → chunk-2IYAZRTC.js} +2 -2
  9. package/dist/bundle/{chunk-ONA3UI3R.js → chunk-2UMEZY6D.js} +2 -2
  10. package/dist/bundle/{chunk-XGEPAJBY.js → chunk-3URYKAJP.js} +1 -1
  11. package/dist/bundle/{chunk-SPWKGRTO.js → chunk-4YNUQGDP.js} +1 -1
  12. package/dist/bundle/{chunk-MVDP7VL6.js → chunk-6SJ7HHAE.js} +1 -1
  13. package/dist/bundle/{chunk-T7A6HSBF.js → chunk-6TRKNME5.js} +1 -1
  14. package/dist/bundle/{chunk-YNI57LTZ.js → chunk-6XNTELM5.js} +1 -1
  15. package/dist/bundle/{chunk-NMN7RTX5.js → chunk-7GW4D3OW.js} +19 -18
  16. package/dist/bundle/{chunk-3HCEKXXB.js → chunk-AJY2IT25.js} +6 -6
  17. package/dist/bundle/{chunk-KE2RQUQO.js → chunk-ANYADN3S.js} +17 -17
  18. package/dist/bundle/{chunk-FL2TKSZY.js → chunk-CAQ5GW3A.js} +1 -1
  19. package/dist/bundle/{chunk-SNZFQ5SS.js → chunk-CD3TAITM.js} +14 -2
  20. package/dist/bundle/{chunk-54JKDFOV.js → chunk-FA3B2DHZ.js} +1 -1
  21. package/dist/bundle/{chunk-Q23EEGPC.js → chunk-GDDCKTBR.js} +1 -1
  22. package/dist/bundle/{chunk-HVJ2WQI7.js → chunk-GPOTPA3S.js} +10 -10
  23. package/dist/bundle/{chunk-S2KKQA7O.js → chunk-GSXCMQWV.js} +41 -49
  24. package/dist/bundle/{chunk-GXKFRZUP.js → chunk-HFA6AZWA.js} +3 -3
  25. package/dist/bundle/{chunk-DBI22GQL.js → chunk-HUWQ7LXZ.js} +506 -338
  26. package/dist/bundle/{chunk-5X5A3CAX.js → chunk-IBCGCYRU.js} +1 -1
  27. package/dist/bundle/{chunk-4F7WQHDO.js → chunk-IVD3JTN5.js} +1 -1
  28. package/dist/bundle/{chunk-IIV43UIC.js → chunk-JRGPPS6H.js} +12 -12
  29. package/dist/bundle/{chunk-3ECFSRLQ.js → chunk-JUS4Y4BW.js} +3 -3
  30. package/dist/bundle/{chunk-F22PLRCG.js → chunk-KLFF54AF.js} +7 -7
  31. package/dist/bundle/{chunk-J5PUHGK2.js → chunk-KLGZX6QT.js} +1 -1
  32. package/dist/bundle/{chunk-CWAA73PJ.js → chunk-LVFI3TCG.js} +5 -5
  33. package/dist/bundle/{chunk-GDFJKUMK.js → chunk-LVJWN2PR.js} +6 -6
  34. package/dist/bundle/{chunk-E2SL7HIZ.js → chunk-MENP3FF5.js} +11 -12
  35. package/dist/bundle/{chunk-HZUUVNWC.js → chunk-MHXZ62CU.js} +1 -1
  36. package/dist/bundle/{chunk-B3NXAN6J.js → chunk-MSK7RNOM.js} +149 -148
  37. package/dist/bundle/{chunk-D3J4T5OZ.js → chunk-MT2WDBG2.js} +12 -12
  38. package/dist/bundle/{chunk-2M7PPII5.js → chunk-MVMNZ3Q3.js} +745 -336
  39. package/dist/bundle/{chunk-ZG2XBWFT.js → chunk-NMN5JUYL.js} +3 -3
  40. package/dist/bundle/{chunk-JKWNPRZD.js → chunk-O7OP5NQO.js} +1 -1
  41. package/dist/bundle/{chunk-NV2REPY6.js → chunk-OUM4ZO53.js} +1 -1
  42. package/dist/bundle/{chunk-KIZYN3NG.js → chunk-PALY5PGE.js} +5 -5
  43. package/dist/bundle/{chunk-LM4K6K2R.js → chunk-PCMQYGEM.js} +4 -4
  44. package/dist/bundle/{chunk-GCSFZTRI.js → chunk-PCWAZVAD.js} +30 -5
  45. package/dist/bundle/{chunk-6C7SA4LD.js → chunk-QHXOXYAT.js} +57 -54
  46. package/dist/bundle/{chunk-WXQK5RO5.js → chunk-RNBG75HW.js} +33 -23
  47. package/dist/bundle/{chunk-TIMBTN5Z.js → chunk-SDAYOJLL.js} +5 -5
  48. package/dist/bundle/{chunk-LN2LWPN2.js → chunk-SEJBS7SI.js} +1 -1
  49. package/dist/bundle/{chunk-U7VYDTXN.js → chunk-SWXKS7JK.js} +16 -16
  50. package/dist/bundle/{chunk-R3IFRHZ2.js → chunk-SZZJOSIS.js} +2 -2
  51. package/dist/bundle/{chunk-WHS3CTTM.js → chunk-T577U52I.js} +7 -7
  52. package/dist/bundle/{chunk-SN5V6CKH.js → chunk-TDTCCHAI.js} +98 -6
  53. package/dist/bundle/{chunk-FYXGD6R6.js → chunk-TWHIZJAZ.js} +2 -2
  54. package/dist/bundle/{chunk-K5FTIIYR.js → chunk-U346WBJ5.js} +4 -4
  55. package/dist/bundle/{chunk-MP572GP7.js → chunk-U57QRUP7.js} +2 -2
  56. package/dist/bundle/{chunk-YMJXGIYG.js → chunk-U7RLFLTM.js} +23 -23
  57. package/dist/bundle/{chunk-ENKZEQ4Y.js → chunk-WNGMI6AZ.js} +2 -2
  58. package/dist/bundle/{chunk-BOGGQOVO.js → chunk-WQOGHND4.js} +1 -1
  59. package/dist/bundle/{chunk-A3YXTDTP.js → chunk-XXXVVNGI.js} +18 -15
  60. package/dist/bundle/{chunk-RLPWLGP6.js → chunk-Z6OKVD3R.js} +7 -7
  61. package/dist/bundle/{chunk-QGIQ62KV.js → chunk-ZAD7K4TI.js} +382 -366
  62. package/dist/bundle/{chunk-26H2HVJD.js → chunk-ZDP6A2VL.js} +2 -2
  63. package/dist/bundle/{command-contract-ETECA2AC.js → command-contract-DZ6XRIOI.js} +15 -15
  64. package/dist/bundle/{command-server-entry-BFXRYTBC.js → command-server-entry-BVXOPKXH.js} +21 -21
  65. package/dist/bundle/{decode-4QRYNPD5.js → decode-STN3EHT7.js} +2 -2
  66. package/dist/bundle/{dist-MHJPECI4.js → dist-B2JWWTNN.js} +15 -11
  67. package/dist/bundle/{echarts-EJXBKCJT.js → echarts-QIXLXS3G.js} +2 -2
  68. package/dist/bundle/{embed-46WZZMUQ.js → embed-4NC4ELYP.js} +3 -3
  69. package/dist/bundle/{embedder-56WHJKJE.js → embedder-HBRDIFQC.js} +6 -6
  70. package/dist/bundle/{first-run-CATDBOBV.js → first-run-6QF67AAZ.js} +6 -6
  71. package/dist/bundle/first-screen-LXSZMK2P.js +34 -0
  72. package/dist/bundle/{instructions-Z7GVGWXS.js → instructions-MD2RZT5Z.js} +1 -1
  73. package/dist/bundle/mail.js +2 -2
  74. package/dist/bundle/{node-L2PVEW3N.js → node-IEVT2FSJ.js} +2 -2
  75. package/dist/bundle/{node-sqlite-RIGII7U7.js → node-sqlite-EOTTDMOG.js} +4 -4
  76. package/dist/bundle/{oauth-OWT6NYRS.js → oauth-A5BEFGCI.js} +4 -4
  77. package/dist/bundle/{open-D3SPYL7O.js → open-HWN2EZYG.js} +2 -2
  78. package/dist/bundle/{openai-IPTZDMFD.js → openai-PJKJ4CIU.js} +12 -12
  79. package/dist/bundle/{process-MNZTQ2DA.js → process-6Q23D3TO.js} +1 -1
  80. package/dist/bundle/{program-QCHTCOCR.js → program-WR43NPAV.js} +523 -454
  81. package/dist/bundle/{prompt-BN6AKRWN.js → prompt-E7Q2662O.js} +2 -2
  82. package/dist/bundle/{recognize-I5TH7OEW.js → recognize-4F4PIL4B.js} +1 -1
  83. package/dist/bundle/{remote-R324LAUL.js → remote-RGJXO7XK.js} +6 -6
  84. package/dist/bundle/{rerank-ZMGZCUJV.js → rerank-EDY7PHMG.js} +4 -4
  85. package/dist/bundle/{serve-YUFZSNJC.js → serve-Q4XF6ID2.js} +6 -6
  86. package/dist/bundle/server-2Y5NSP2U.js +67 -0
  87. package/dist/bundle/{server-54ULZ3RA.js → server-5I72DSDF.js} +43 -41
  88. package/dist/bundle/{sqlite-runtime-AYQTUQXM.js → sqlite-runtime-PU3Z2H7C.js} +3 -3
  89. package/dist/bundle/{state-PHEBOYYI.js → state-CWSXJBU2.js} +3 -3
  90. package/dist/bundle/{store-NGX3A5XT.js → store-KQPKS3PX.js} +15 -15
  91. package/dist/bundle/{store-4PHDSXEV.js → store-ZAMKKM2A.js} +13 -13
  92. package/dist/bundle/store-maintenance-command-PMTTDR6J.js +58 -0
  93. package/dist/commands/rules.d.ts.map +1 -1
  94. package/dist/commands/rules.js +73 -22
  95. package/dist/commands/rules.js.map +1 -1
  96. package/dist/mail/rules/apply.d.ts.map +1 -1
  97. package/dist/mail/rules/apply.js +1 -9
  98. package/dist/mail/rules/apply.js.map +1 -1
  99. package/dist/version.d.ts +1 -1
  100. package/dist/version.js +1 -1
  101. package/package.json +2 -2
  102. package/dist/bundle/chunk-IJONJTST.js +0 -76
  103. package/dist/bundle/first-screen-WCDR3QUR.js +0 -34
  104. package/dist/bundle/server-UD75CYDG.js +0 -68
  105. package/dist/bundle/store-maintenance-command-WHBIV6HC.js +0 -58
@@ -20,10 +20,10 @@ import {
20
20
  providerLabel,
21
21
  providerNamed,
22
22
  queryError
23
- } from "./chunk-2M7PPII5.js";
23
+ } from "./chunk-MVMNZ3Q3.js";
24
24
  import {
25
25
  fold
26
- } from "./chunk-SPWKGRTO.js";
26
+ } from "./chunk-4YNUQGDP.js";
27
27
  import {
28
28
  CliError,
29
29
  isCliError,
@@ -33,7 +33,7 @@ import {
33
33
  __name
34
34
  } from "./chunk-ZVVMGPBJ.js";
35
35
 
36
- // 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/phone-plans.generated.js
36
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/phone-plans.generated.js
37
37
  var PHONE_PLANS = [
38
38
  {
39
39
  country: "us",
@@ -413,7 +413,7 @@ var PHONE_PLANS = [
413
413
  }
414
414
  ];
415
415
 
416
- // 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/phones.js
416
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/phones.js
417
417
  var PHONE_COUNTRIES = PHONE_PLANS.map((plan) => plan.country);
418
418
  var DEFAULT_PHONE_COUNTRIES = ["ru"];
419
419
  var parsePhoneCountries = /* @__PURE__ */ __name((value) => {
@@ -488,7 +488,7 @@ var storedPhone = /* @__PURE__ */ __name((raw, provider) => {
488
488
  return found ? `+${found[1]}` : void 0;
489
489
  }, "storedPhone");
490
490
 
491
- // 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/record-fields.js
491
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/record-fields.js
492
492
  var DECIMAL_PATTERN = "^[0-9]{1,16}(\\.[0-9]{1,6})?$";
493
493
  var SIGNED_DECIMAL = "^-?[0-9]{1,16}(\\.[0-9]{1,6})?$";
494
494
  var DAY = "^[0-9]{4}-[0-9]{2}-[0-9]{2}$";
@@ -538,7 +538,7 @@ var arrayOf = /* @__PURE__ */ __name((item, maxItems, description) => ({
538
538
  }), "arrayOf");
539
539
  var isObject = /* @__PURE__ */ __name((value) => typeof value === "object" && value !== null && !Array.isArray(value), "isObject");
540
540
 
541
- // 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/record-types.js
541
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/record-types.js
542
542
  var kept = /* @__PURE__ */ __name((description) => ({ description }), "kept");
543
543
  var PARTY = ["person", "organization"];
544
544
  var ORGANIZATION = ["organization"];
@@ -933,7 +933,7 @@ var hasV1Roles = /* @__PURE__ */ __name((type) => rolesOf(type).some(([, role])
933
933
  var IDENTITY_TYPES = RECORD_ENTITY_TYPES.filter((type) => RECORD_TYPES[type].review === "identity");
934
934
  var article = /* @__PURE__ */ __name((word) => /^[aeiou]/.test(word) ? "an" : "a", "article");
935
935
 
936
- // 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/ref-arguments.js
936
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/ref-arguments.js
937
937
  var TAKES = {
938
938
  chat: "a chat: chat:<provider>/<account>/<chat>, its id or its title",
939
939
  message: "a message: msg:<provider>/<account>/<chat>/<message>, or a chat and the message's id"
@@ -993,7 +993,7 @@ var ensureAccount = /* @__PURE__ */ __name(async (reference, scope, profilesOn)
993
993
  throw wrongAccount(reference, scope, profiles);
994
994
  }, "ensureAccount");
995
995
 
996
- // 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/search/lucene/types.js
996
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/lucene/types.js
997
997
  var QUERY_VERSION = 1;
998
998
  var QUERY_LIMITS2 = {
999
999
  ...QUERY_LIMITS,
@@ -1038,7 +1038,7 @@ function tooWideTerm([term], budget) {
1038
1038
  }
1039
1039
  __name(tooWideTerm, "tooWideTerm");
1040
1040
 
1041
- // 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/search/lucene/automaton.js
1041
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/lucene/automaton.js
1042
1042
  var any = { kind: "char", ranges: [[0, 1114111]], negate: false };
1043
1043
  var literal = /* @__PURE__ */ __name((c) => ({
1044
1044
  kind: "char",
@@ -1438,7 +1438,7 @@ var foldRegex = /* @__PURE__ */ __name((pattern, span) => {
1438
1438
  return out;
1439
1439
  }, "foldRegex");
1440
1440
 
1441
- // 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/search/trigrams.js
1441
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/search/trigrams.js
1442
1442
  var trigrams = /* @__PURE__ */ __name((term) => {
1443
1443
  const padded = ` ${term} `;
1444
1444
  const pieces = /* @__PURE__ */ new Set();
@@ -1447,7 +1447,7 @@ var trigrams = /* @__PURE__ */ __name((term) => {
1447
1447
  return [...pieces];
1448
1448
  }, "trigrams");
1449
1449
 
1450
- // 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/resolve.js
1450
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/resolve.js
1451
1451
  var isId = /* @__PURE__ */ __name((reference) => /^-?\d+$/.test(reference.trim()), "isId");
1452
1452
  var foldName = /* @__PURE__ */ __name((name) => name.normalize("NFC").replace(/[\uFE0E\uFE0F\u200D]/g, "").toLowerCase().replaceAll("\u0451", "\u0435"), "foldName");
1453
1453
  var pickChat = /* @__PURE__ */ __name((reference, chats) => {
@@ -1518,7 +1518,7 @@ ${lines}`, { candidates });
1518
1518
  }, "ambiguous");
1519
1519
  var isPresent = /* @__PURE__ */ __name((value) => value !== null && value !== void 0, "isPresent");
1520
1520
 
1521
- // 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/addresses.js
1521
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/addresses.js
1522
1522
  var EMAIL_ADDRESS = /^[^\s@]+@[^\s@]+\.[^\s@]+$/u;
1523
1523
  var isEmailAddress = /* @__PURE__ */ __name((value) => EMAIL_ADDRESS.test(value), "isEmailAddress");
1524
1524
  var ROLE_ADDRESS_WORDS = {
@@ -1580,7 +1580,7 @@ var PERSON_LIKE = /* @__PURE__ */ new Set(["hr"]);
1580
1580
  var isPersonLikeRoleAddress = /* @__PURE__ */ __name((address) => PERSON_LIKE.has(localWord(address)), "isPersonLikeRoleAddress");
1581
1581
  var isNoReplyAddress = /* @__PURE__ */ __name((address) => NO_REPLY.has(localWord(address)), "isNoReplyAddress");
1582
1582
 
1583
- // 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/display-names.js
1583
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/display-names.js
1584
1584
  var QUOTES = [
1585
1585
  ['"', '"'],
1586
1586
  ["'", "'"],
@@ -1638,7 +1638,7 @@ var nameKey = /* @__PURE__ */ __name((name) => {
1638
1638
  }, "nameKey");
1639
1639
  var isReadable = /* @__PURE__ */ __name((shown) => shown !== null && READABLE.test(shown), "isReadable");
1640
1640
 
1641
- // 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/counters.js
1641
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/counters.js
1642
1642
  var COUNTER_FIELDS = ["views", "reactions", "comments"];
1643
1643
  var validCounter = /* @__PURE__ */ __name((value) => typeof value === "number" && Number.isFinite(value) && value >= 0, "validCounter");
1644
1644
  var counterValue = /* @__PURE__ */ __name((message, field) => {
@@ -1675,7 +1675,7 @@ var counterFreshness = /* @__PURE__ */ __name((states) => {
1675
1675
  return states.some((one) => one.freshness === "stale") ? "stale" : "fresh";
1676
1676
  }, "counterFreshness");
1677
1677
 
1678
- // 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/rankings-options.js
1678
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/rankings-options.js
1679
1679
  var MESSAGE_MEASURES = ["views", "reactions", "forwards", "comments", "replies", "thread-size"];
1680
1680
  var AUTHOR_MEASURES = [
1681
1681
  "messages",
@@ -1815,7 +1815,7 @@ var withoutUrls = /* @__PURE__ */ __name((text2) => text2.replace(/\S+/gu, (toke
1815
1815
  var rankingWords = /* @__PURE__ */ __name((text2) => withoutUrls(text2).match(/[\p{L}\p{N}]+/gu)?.length ?? 0, "rankingWords");
1816
1816
  var rankingQuestion = /* @__PURE__ */ __name((text2) => withoutUrls(text2).includes("?"), "rankingQuestion");
1817
1817
 
1818
- // 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/records.js
1818
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/records.js
1819
1819
  import { createHash } from "node:crypto";
1820
1820
  var RECORDS_SCHEMA_VERSION = 1;
1821
1821
  var RECORD_OPERATIONS = ["upsert", "delete"];
@@ -1987,7 +1987,7 @@ var fieldReferences = /* @__PURE__ */ __name((record, options = {}) => {
1987
1987
  return found;
1988
1988
  }, "fieldReferences");
1989
1989
 
1990
- // 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/relation-role-labels.js
1990
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/domain/relation-role-labels.js
1991
1991
  var label = /* @__PURE__ */ __name((en, ru, es) => ({ en, ru, es }), "label");
1992
1992
  var ROLE_LABELS = {
1993
1993
  organization: {
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
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
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/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");
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  QUERY_REASONS
5
- } from "./chunk-2M7PPII5.js";
5
+ } from "./chunk-MVMNZ3Q3.js";
6
6
  import {
7
7
  defineReasons
8
8
  } from "./chunk-ECZSYLSL.js";
@@ -10,7 +10,7 @@ import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // 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/errors/reasons.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/errors/reasons.js
14
14
  var validation = /* @__PURE__ */ __name((reason, message) => [reason, "validation_error", message], "validation");
15
15
  var QUERY = [
16
16
  ["query.aborted", "the search was stopped before it finished"],
@@ -63,6 +63,8 @@ var PROVIDER_API = [
63
63
  validation("api.unknown-method", "the provider has no method by this name"),
64
64
  ["api.disabled", "configuration_error", "the provider's API is turned off for this OAuth project"],
65
65
  ["provider.usage-limit", "rate_limited", "the account's usage limit at the provider is reached; wait, do not retry"],
66
+ ["access.denied", "permission_error", "the provider refused this account access to the item"],
67
+ ["item.not-found", "not_found", "the provider has no item by this id, or this account cannot see it"],
66
68
  ["file.not-found", "not_found", "the file named, or its folder, does not exist"],
67
69
  validation("file.not-a-file", "the path names a folder or another thing that is not a file"),
68
70
  ["file.denied", "permission_error", "the file cannot be opened: permission denied"]
@@ -245,6 +247,16 @@ var OTHERS = [
245
247
  ["calendar.no-upcoming", "not_found", "no upcoming meeting with other attendees is stored for this account"],
246
248
  ["chat.not-read", "not_found", "a chat shared with this person is not held whole in the store"],
247
249
  ["meetings.index-pending", "not_found", "some stored meetings are not indexed by person yet"],
250
+ ["meetings.server-offline", "permission_error", "meetings list and show ask the service; --offline was given"],
251
+ ["meetings.server-unreachable", "network_error", "the meetings service could not be reached"],
252
+ ["meetings.server-signed-out", "authentication_error", "the meetings service needs a sign-in"],
253
+ ["meetings.server-refused", "permission_error", "the meetings service refused the request"],
254
+ ["meetings.server-failed", "provider_error", "the meetings service could not be read, or what it returned kept"],
255
+ [
256
+ "meetings.server-capped",
257
+ "outcome_unknown",
258
+ "the meetings service may hold more matches than the calls and pages one list asks"
259
+ ],
248
260
  ["profile.locked", "permission_error", "a profile lock pins this process to its own account"],
249
261
  ["busy.offline", "permission_error", "calendars busy asks the provider; --offline was given"],
250
262
  ["busy.unanswered", "provider_error", "the provider gave no busy times for a calendar or person that was asked"],
@@ -7,7 +7,7 @@ import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // 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/path.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/store/path.js
11
11
  import { realpathSync } from "node:fs";
12
12
  import { userInfo } from "node:os";
13
13
  import { basename, dirname, isAbsolute, join, relative, resolve } from "node:path";
@@ -132,7 +132,7 @@ var parseRateLimitReset = /* @__PURE__ */ __name((header, now) => {
132
132
  }, "parseRateLimitReset");
133
133
  var providerWaitMs = /* @__PURE__ */ __name((headers, now) => parseRetryAfter(headers.get("retry-after"), now) ?? parseRateLimitReset(headers.get("x-ratelimit-reset"), now), "providerWaitMs");
134
134
 
135
- // 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/endpoint.js
135
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/models/endpoint.js
136
136
  var endpoint = /* @__PURE__ */ __name((value) => {
137
137
  try {
138
138
  const url = new URL(value);
@@ -8,25 +8,25 @@ import {
8
8
  readSetupAnswers,
9
9
  unanswered,
10
10
  writeSetupAnswers
11
- } from "./chunk-MP572GP7.js";
11
+ } from "./chunk-U57QRUP7.js";
12
12
  import {
13
13
  DEFAULT_STEMMERS,
14
14
  LANGUAGES
15
- } from "./chunk-F22PLRCG.js";
15
+ } from "./chunk-KLFF54AF.js";
16
16
  import {
17
17
  sharedConfigPath
18
- } from "./chunk-KIZYN3NG.js";
18
+ } from "./chunk-PALY5PGE.js";
19
19
  import {
20
20
  installerOf
21
21
  } from "./chunk-M4OP5ASJ.js";
22
22
  import {
23
23
  storePath
24
- } from "./chunk-54JKDFOV.js";
24
+ } from "./chunk-FA3B2DHZ.js";
25
25
  import {
26
26
  __name
27
27
  } from "./chunk-ZVVMGPBJ.js";
28
28
 
29
- // 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/first-run.js
29
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/cli/first-run.js
30
30
  import { spawnSync } from "node:child_process";
31
31
  import { accessSync, constants, realpathSync } from "node:fs";
32
32
  import { delimiter, join } from "node:path";
@@ -84,7 +84,7 @@ var suggested = /* @__PURE__ */ __name((env, contentLanguages) => {
84
84
  return (own.length ? own : LANGUAGES.filter(({ code }) => code === "en" || code === system)).map(({ name }) => name);
85
85
  }, "suggested");
86
86
  var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLanguages }) => {
87
- const { openStore } = await import("./store-4PHDSXEV.js");
87
+ const { openStore } = await import("./store-ZAMKKM2A.js");
88
88
  const store = await openStore({ env });
89
89
  let rebuild = false;
90
90
  try {
@@ -113,8 +113,8 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
113
113
  if (!rebuild)
114
114
  return;
115
115
  const [{ openCache }, { buildStems }] = await Promise.all([
116
- import("./open-D3SPYL7O.js"),
117
- import("./store-maintenance-command-WHBIV6HC.js")
116
+ import("./open-HWN2EZYG.js"),
117
+ import("./store-maintenance-command-PMTTDR6J.js")
118
118
  ]);
119
119
  const database = await openCache(storePath(env));
120
120
  try {
@@ -126,7 +126,7 @@ var askLanguages = /* @__PURE__ */ __name(async ({ command, env, io, contentLang
126
126
  var askTools = /* @__PURE__ */ __name(async (run) => {
127
127
  const { command, env, io } = run;
128
128
  const installed = run.installed ?? ((name) => onPath(name, env));
129
- const { WIRECAT_TOOLS } = await import("./first-screen-WCDR3QUR.js");
129
+ const { WIRECAT_TOOLS } = await import("./first-screen-LXSZMK2P.js");
130
130
  const others = WIRECAT_TOOLS.filter((tool) => tool.command !== command);
131
131
  const missing = others.filter((tool) => !installed(tool.command));
132
132
  io.say("Other WireCat tools \u2014 they share this store, so one search finds everything:");
@@ -199,7 +199,7 @@ var setupAtStart = /* @__PURE__ */ __name(async (start) => {
199
199
  contentLanguages: start.contentLanguages,
200
200
  all: start.path[0] === "setup",
201
201
  io: {
202
- ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-BN6AKRWN.js")).readSecret(prompt, { input, echo: true }), "ask"),
202
+ ask: /* @__PURE__ */ __name(async (prompt) => (await import("./prompt-E7Q2662O.js")).readSecret(prompt, { input, echo: true }), "ask"),
203
203
  say: /* @__PURE__ */ __name((text) => process.stderr.write(`${text}
204
204
  `), "say")
205
205
  }
@@ -12,10 +12,10 @@ import {
12
12
  refuseWriteBeforeConnecting,
13
13
  registerPrompts,
14
14
  syncsFirst
15
- } from "./chunk-WXQK5RO5.js";
15
+ } from "./chunk-RNBG75HW.js";
16
16
  import {
17
17
  stdinFieldOf
18
- } from "./chunk-HZUUVNWC.js";
18
+ } from "./chunk-MHXZ62CU.js";
19
19
  import {
20
20
  BinaryResource,
21
21
  Picture,
@@ -36,33 +36,31 @@ import {
36
36
  tool,
37
37
  toolKey,
38
38
  toolsFromCommands
39
- } from "./chunk-NMN7RTX5.js";
39
+ } from "./chunk-7GW4D3OW.js";
40
40
  import {
41
41
  agentJson,
42
42
  skillResource
43
- } from "./chunk-E2SL7HIZ.js";
43
+ } from "./chunk-MENP3FF5.js";
44
44
  import {
45
45
  instructions
46
- } from "./chunk-FL2TKSZY.js";
47
- import {
48
- answeredWire
49
- } from "./chunk-IJONJTST.js";
46
+ } from "./chunk-CAQ5GW3A.js";
50
47
  import {
51
48
  StdioServerTransport,
49
+ answeredWire,
52
50
  callerOf,
53
51
  callingAgent,
54
52
  serveStdio
55
- } from "./chunk-SN5V6CKH.js";
53
+ } from "./chunk-TDTCCHAI.js";
56
54
  import {
57
55
  McpServer,
58
56
  ResourceTemplate
59
57
  } from "./chunk-5D4AEUVA.js";
60
58
  import {
61
59
  mcpHttpMarker
62
- } from "./chunk-K5FTIIYR.js";
60
+ } from "./chunk-U346WBJ5.js";
63
61
  import {
64
62
  connectedFor
65
- } from "./chunk-A3YXTDTP.js";
63
+ } from "./chunk-XXXVVNGI.js";
66
64
  import {
67
65
  capability,
68
66
  dateWindow,
@@ -72,10 +70,10 @@ import {
72
70
  servicesFor,
73
71
  storedDeps,
74
72
  wholeList
75
- } from "./chunk-DBI22GQL.js";
73
+ } from "./chunk-HUWQ7LXZ.js";
76
74
  import {
77
75
  findCommand
78
- } from "./chunk-ZG2XBWFT.js";
76
+ } from "./chunk-NMN5JUYL.js";
79
77
  import {
80
78
  DEFAULT_OUTPUT_BYTES,
81
79
  changesAuthorityAt,
@@ -90,32 +88,34 @@ import {
90
88
  rootOf2 as rootOf,
91
89
  sealed,
92
90
  snakeKeys
93
- } from "./chunk-B3NXAN6J.js";
91
+ } from "./chunk-MSK7RNOM.js";
94
92
  import {
93
+ fetchesAt,
95
94
  levelFor,
96
95
  readKeysForCommand
97
- } from "./chunk-GCSFZTRI.js";
96
+ } from "./chunk-PCWAZVAD.js";
98
97
  import {
99
98
  withCaller
100
- } from "./chunk-RLPWLGP6.js";
99
+ } from "./chunk-Z6OKVD3R.js";
101
100
  import {
102
101
  openStore,
103
102
  pdfPreviewLimits
104
- } from "./chunk-QGIQ62KV.js";
103
+ } from "./chunk-ZAD7K4TI.js";
105
104
  import {
106
105
  typedCommand
107
- } from "./chunk-YMJXGIYG.js";
106
+ } from "./chunk-U7RLFLTM.js";
108
107
  import {
109
108
  timezoneOf
110
- } from "./chunk-2M7PPII5.js";
109
+ } from "./chunk-MVMNZ3Q3.js";
111
110
  import {
112
111
  isCliFailure
113
- } from "./chunk-JKWNPRZD.js";
112
+ } from "./chunk-O7OP5NQO.js";
114
113
  import {
115
114
  warmEmbedders
116
- } from "./chunk-CWAA73PJ.js";
115
+ } from "./chunk-LVFI3TCG.js";
117
116
  import {
118
117
  description,
118
+ errorObjectOf,
119
119
  integer,
120
120
  maxValue,
121
121
  mcpErrorResult,
@@ -138,10 +138,10 @@ import {
138
138
  __name
139
139
  } from "./chunk-ZVVMGPBJ.js";
140
140
 
141
- // 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/server.js
141
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mcp/server.js
142
142
  import { randomUUID } from "node:crypto";
143
143
 
144
- // 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/agent-log.js
144
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mcp/agent-log.js
145
145
  var agentLog = /* @__PURE__ */ __name((open) => {
146
146
  let held;
147
147
  return {
@@ -160,7 +160,7 @@ var agentLog = /* @__PURE__ */ __name((open) => {
160
160
  };
161
161
  }, "agentLog");
162
162
 
163
- // 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/resources.js
163
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mcp/resources.js
164
164
  var LISTED = 100;
165
165
  var registerResources = /* @__PURE__ */ __name((server, session, { command, name, limit, recorded, withStore, messenger, guard, assertRead }) => {
166
166
  server.registerResource("chat", new ResourceTemplate(`${command}://chat/{id}`, {
@@ -198,7 +198,7 @@ var registerResources = /* @__PURE__ */ __name((server, session, { command, name
198
198
  });
199
199
  }, "registerResources");
200
200
 
201
- // 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/session.js
201
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mcp/session.js
202
202
  var HARMLESS = /* @__PURE__ */ new Set(["validation_error", "not_found", "permission_error", "confirmation_required", "rate_limited"]);
203
203
  var harmless = /* @__PURE__ */ __name((code) => HARMLESS.has(code), "harmless");
204
204
  var MessengerSession = class {
@@ -273,7 +273,7 @@ var MessengerSession = class {
273
273
  }
274
274
  };
275
275
 
276
- // 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/tools/attachments.js
276
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mcp/tools/attachments.js
277
277
  var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
278
278
  const _command = messenger.app.command;
279
279
  return {
@@ -327,7 +327,7 @@ var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
327
327
  };
328
328
  }, "attachmentsTools");
329
329
 
330
- // 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/tools/messages-photo.js
330
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mcp/tools/messages-photo.js
331
331
  var PHOTO_LIMIT = 512 * 1024;
332
332
  var IMAGE_TYPES = [
333
333
  ["image/jpeg", (b) => b[0] === 255 && b[1] === 216 && b[2] === 255],
@@ -343,14 +343,16 @@ var messagesPhotoTools = /* @__PURE__ */ __name((messenger) => ({
343
343
  input: object({
344
344
  chat: chatOf(messenger),
345
345
  message,
346
- index: optional(pipe(number(), integer(), minValue(0), description("attachment index from 0; omit for the first photo")))
346
+ attachment: optional(pipe(number(), integer(), minValue(1), description("which file of the message, from 1; omit for the first photo")))
347
347
  }),
348
348
  annotations: READ,
349
349
  online: /* @__PURE__ */ __name(async (adapter, args, defaults) => {
350
350
  const { id: chatId } = await adapter.resolve(args.chat);
351
351
  const saveIt = `the owner can save it with \`${typedCommand(messenger.app.command, `messages download ${chatId} ${args.message}`)}\``;
352
352
  const { files } = await capability(adapter, "download", "download attachments")(chatId, args.message);
353
- const photo = args.index === void 0 ? files.find((file) => file.kind === "photo") : files[args.index];
353
+ if (args.attachment !== void 0 && args.attachment > files.length)
354
+ throw new CliError("not_found", `message ${args.message} has ${files.length} file${files.length === 1 ? "" : "s"}, no file ${args.attachment}`);
355
+ const photo = args.attachment === void 0 ? files.find((file) => file.kind === "photo") : files[args.attachment - 1];
354
356
  if (!photo) {
355
357
  const kinds = files.map((file) => file.kind).join(", ");
356
358
  throw new CliError(files.length === 0 ? "not_found" : "validation_error", files.length === 0 ? `message ${args.message} has no photo` : `the message has a ${kinds}, not a photo \u2014 ${saveIt}`);
@@ -381,7 +383,7 @@ var readUpTo = /* @__PURE__ */ __name(async (file, limit, saveIt) => {
381
383
  return new Uint8Array(Buffer.concat(chunks));
382
384
  }, "readUpTo");
383
385
 
384
- // 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/tools/stats.js
386
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mcp/tools/stats.js
385
387
  var statsTools = /* @__PURE__ */ __name((messenger) => ({
386
388
  stats_charts: tool({
387
389
  title: "A chart from a chat's statistics",
@@ -418,14 +420,14 @@ var statsTools = /* @__PURE__ */ __name((messenger) => ({
418
420
  })
419
421
  }), "statsTools");
420
422
 
421
- // 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/tools.js
423
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mcp/tools.js
422
424
  var pictureTools = /* @__PURE__ */ __name((messenger) => Object.fromEntries(Object.entries({
423
425
  ...messagesPhotoTools(messenger),
424
426
  ...attachmentsTools(messenger),
425
427
  ...statsTools(messenger)
426
428
  }).map(([name, definition]) => [name, { ...definition, input: strictObject(definition.input.entries) }])), "pictureTools");
427
429
 
428
- // 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/server.js
430
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/mcp/server.js
429
431
  var PER_RUN = /* @__PURE__ */ new Set([
430
432
  "streams",
431
433
  "stdin",
@@ -484,7 +486,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
484
486
  return void 0;
485
487
  }
486
488
  }, "stdin");
487
- const syncAllowed = /* @__PURE__ */ __name((path) => syncsFirst(messenger) && levelOf("messages.sync-first") === "allow" && (path[0] !== "stats" || levelOf(`${path.join(".")}.sync-first`) === "allow"), "syncAllowed");
489
+ const syncAllowed = /* @__PURE__ */ __name((path) => syncsFirst(messenger) && fetchesAt(levelOf("messages.sync-first")) && (path[0] !== "stats" || fetchesAt(levelOf(`${path.join(".")}.sync-first`))), "syncAllowed");
488
490
  const generated = toolsFromCommands(program.commands, {
489
491
  includeUnavailable: true,
490
492
  exclude: [["bot"]],
@@ -590,8 +592,8 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
590
592
  });
591
593
  }), "invoke");
592
594
  let queue = Promise.resolve();
593
- const queued = /* @__PURE__ */ __name((one, input, env, caller) => {
594
- const next = queue.then(() => invoke(one, input, env, caller));
595
+ const queued = /* @__PURE__ */ __name((one, input, env, caller, signal) => {
596
+ const next = queue.then(() => signal?.aborted ? { error: errorObjectOf(new CliError("cancelled", `${one.command} was cancelled before it started`)) } : invoke(one, input, env, caller));
595
597
  queue = next.catch(() => void 0);
596
598
  return next;
597
599
  }, "queued");
@@ -607,7 +609,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
607
609
  const traceparent = ctx?.mcpReq?._meta?.traceparent;
608
610
  const env = typeof traceparent === "string" ? { ...context.env, TRACEPARENT: traceparent } : context.env;
609
611
  const caller = callerOf(ctx, keyOfCommand(one.command), source);
610
- const answer = await withCaller(caller, () => queued(one, args, env, caller));
612
+ const answer = await withCaller(caller, () => queued(one, args, env, caller, ctx?.mcpReq?.signal));
611
613
  const result = "error" in answer ? mcpErrorResult(JSON.parse(agentJson(answer.error))) : (() => {
612
614
  try {
613
615
  return answered(envelope(one.command, answer.result), DEFAULT_OUTPUT_BYTES, targets);
@@ -663,7 +665,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
663
665
  spawnJob: sessionOptions.spawnJob,
664
666
  limit: settings.limit,
665
667
  get syncAllowed() {
666
- return syncsFirst(messenger) && levelOf("messages.sync-first") === "allow";
668
+ return syncsFirst(messenger) && fetchesAt(levelOf("messages.sync-first"));
667
669
  },
668
670
  guard,
669
671
  settings,
@@ -730,18 +732,8 @@ var serveOverStdio = /* @__PURE__ */ __name(async (command, context, messenger,
730
732
  transport: new StdioServerTransport(wire.input, wire.output),
731
733
  onerror: /* @__PURE__ */ __name((error) => context.renderer.note(`mcp: ${error.message}`), "onerror")
732
734
  });
733
- const ended = await new Promise((resolve) => {
734
- wire.ended.then(() => resolve("input"));
735
- if (own)
736
- signal?.addEventListener("abort", () => resolve("stopped"), { once: true });
737
- else {
738
- process.once("SIGINT", () => resolve("stopped"));
739
- process.once("SIGTERM", () => resolve("stopped"));
740
- }
741
- });
735
+ await wire.finished(own ? signal : void 0);
742
736
  try {
743
- if (ended === "input")
744
- await wire.answered();
745
737
  wire.release();
746
738
  await handle.close();
747
739
  await session.close();
@@ -752,7 +744,7 @@ var serveOverStdio = /* @__PURE__ */ __name(async (command, context, messenger,
752
744
  }, "serveOverStdio");
753
745
  var serveOverHttpUntilStopped = /* @__PURE__ */ __name(async (command, context, messenger, options, http) => {
754
746
  const { session, embedders, build, log } = createServer(command, context, messenger, options);
755
- const { serveOverHttp } = await import("./serve-YUFZSNJC.js");
747
+ const { serveOverHttp } = await import("./serve-Q4XF6ID2.js");
756
748
  const appName = messenger.app.command;
757
749
  const appEnvPrefix = messenger.app.envPrefix;
758
750
  const listening = await serveOverHttp(build, {
@@ -10,10 +10,10 @@ import {
10
10
  __name
11
11
  } from "./chunk-ZVVMGPBJ.js";
12
12
 
13
- // 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/speech/recognize.js
13
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/speech/recognize.js
14
14
  import { createRequire } from "node:module";
15
15
 
16
- // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/speech/ogg-limit.js
16
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/speech/ogg-limit.js
17
17
  var invalid = /* @__PURE__ */ __name(() => new CliError("validation_error", "local transcription needs a complete mono or stereo Ogg Opus recording"), "invalid");
18
18
  var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
19
19
  const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
@@ -70,7 +70,7 @@ var checkOggDuration = /* @__PURE__ */ __name((bytes) => {
70
70
  throw invalid();
71
71
  }, "checkOggDuration");
72
72
 
73
- // node_modules/.pnpm/@wirecat+cli-core@0.659.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_2476fb045fb1ee08e5e46f4aab8c07fa/node_modules/@wirecat/cli-core/dist/speech/recognize.js
73
+ // node_modules/.pnpm/@wirecat+cli-core@0.662.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_b96f03b0a44798bffec19d0b8a7273db/node_modules/@wirecat/cli-core/dist/speech/recognize.js
74
74
  var SAMPLE_RATE = 16e3;
75
75
  var LEAD = SAMPLE_RATE / 2;
76
76
  var toModelRate = /* @__PURE__ */ __name((samples, rate) => {