@wirecat/drive-cli 0.67.0 → 0.69.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 (127) hide show
  1. package/dist/bin/drive.js +2 -2
  2. package/dist/bundle/{all-profiles-DVZUVAPQ.js → all-profiles-B4A737YW.js} +20 -30
  3. package/dist/bundle/{anthropic-Y45C45O2.js → anthropic-RZGPDESM.js} +3 -3
  4. package/dist/bundle/{app-server-GTXUOUGD.js → app-server-OWEW7DY5.js} +51 -63
  5. package/dist/bundle/{bun-QVJV76QJ.js → bun-V5QLYBZU.js} +2 -2
  6. package/dist/bundle/{bun-sqlite-CC7PIAMH.js → bun-sqlite-KHLHXXGH.js} +4 -4
  7. package/dist/bundle/{chunk-ETAFFY3J.js → chunk-22SH77TG.js} +65 -64
  8. package/dist/bundle/{chunk-2Y3YBDZX.js → chunk-25FT44S3.js} +1482 -464
  9. package/dist/bundle/{chunk-YVUAG7RF.js → chunk-2DS2TDGW.js} +29 -28
  10. package/dist/bundle/{chunk-JJHDV32D.js → chunk-2Q4CB4EI.js} +1 -1
  11. package/dist/bundle/{chunk-HJF2QGOX.js → chunk-2VFAXC6O.js} +30 -17
  12. package/dist/bundle/{chunk-ULH3TNUP.js → chunk-376ZGVUZ.js} +4 -4
  13. package/dist/bundle/{chunk-NWYVOHIX.js → chunk-3RLRJHAI.js} +1646 -976
  14. package/dist/bundle/{chunk-SXJDCRXE.js → chunk-3URYKAJP.js} +1 -1
  15. package/dist/bundle/{chunk-7AZCAUST.js → chunk-3YKAFLXY.js} +1 -1
  16. package/dist/bundle/{chunk-MF46W7PQ.js → chunk-4J5GJJ2I.js} +1 -1
  17. package/dist/bundle/{chunk-3RG6LL25.js → chunk-4YECZ6CN.js} +11 -11
  18. package/dist/bundle/{chunk-SJE7UGOW.js → chunk-4ZFO2CVH.js} +4 -4
  19. package/dist/bundle/{chunk-UFNE57VY.js → chunk-533XOW74.js} +2 -2
  20. package/dist/bundle/{chunk-6ERQE4FS.js → chunk-5B5NOAIA.js} +100 -55
  21. package/dist/bundle/{chunk-MW46BLWH.js → chunk-5SJZDEIO.js} +2 -0
  22. package/dist/bundle/{chunk-RC72RU66.js → chunk-6D44YQ5X.js} +5 -5
  23. package/dist/bundle/{chunk-2MEVCMBW.js → chunk-6EL5AVXX.js} +3 -5
  24. package/dist/bundle/{chunk-ZU5VQYNY.js → chunk-6XNTELM5.js} +1 -1
  25. package/dist/bundle/{chunk-7J2IP3WL.js → chunk-AD7VI3XU.js} +6 -6
  26. package/dist/bundle/{chunk-Y5WSRG3F.js → chunk-AMQGKMLZ.js} +2 -2
  27. package/dist/bundle/{chunk-UOAHZV3K.js → chunk-BBJVV4E2.js} +28 -29
  28. package/dist/bundle/{chunk-XZCF5XU7.js → chunk-BVVXYZSU.js} +5 -5
  29. package/dist/bundle/{chunk-E3XA56TS.js → chunk-CAQ5GW3A.js} +1 -1
  30. package/dist/bundle/{chunk-MEQNAZ6R.js → chunk-CDSB7WVG.js} +323 -12
  31. package/dist/bundle/{chunk-P6A77LMP.js → chunk-CU6RATZH.js} +5 -7
  32. package/dist/bundle/{chunk-MEY7URZZ.js → chunk-CZ4UEXCE.js} +4 -4
  33. package/dist/bundle/{chunk-JLUQZZ26.js → chunk-E7URRFBB.js} +7 -7
  34. package/dist/bundle/{chunk-JCNEPYQZ.js → chunk-EL2E3ABX.js} +12 -12
  35. package/dist/bundle/{chunk-BHSLMJF7.js → chunk-EWUQIUTB.js} +4 -4
  36. package/dist/bundle/{chunk-4VH7M2OD.js → chunk-F5UUJU6R.js} +2 -2
  37. package/dist/bundle/{chunk-CWDC6QJM.js → chunk-GHFBT2ZM.js} +4 -4
  38. package/dist/bundle/{chunk-2PIA45FC.js → chunk-GK6KXBL6.js} +1 -1
  39. package/dist/bundle/{chunk-T2VAEDJS.js → chunk-GTDCP5OG.js} +3 -3
  40. package/dist/bundle/{chunk-IRULPE5M.js → chunk-HEBZCKMU.js} +1695 -672
  41. package/dist/bundle/{chunk-EXWOOST5.js → chunk-I55XYREN.js} +667 -230
  42. package/dist/bundle/{chunk-5TSILGTO.js → chunk-IQ2QU2X6.js} +1613 -1101
  43. package/dist/bundle/{chunk-WKIQKGOF.js → chunk-KUQDBWPU.js} +42 -32
  44. package/dist/bundle/{chunk-AJ3DFPRT.js → chunk-L342KHIZ.js} +105 -1
  45. package/dist/bundle/{chunk-JY2GZDJL.js → chunk-LRCSDAYK.js} +3 -3
  46. package/dist/bundle/{chunk-U2ERT45N.js → chunk-LUZRVBQR.js} +4 -4
  47. package/dist/bundle/{chunk-AAZPDWRD.js → chunk-MHXZ62CU.js} +1 -1
  48. package/dist/bundle/{chunk-ZK46UHDP.js → chunk-N4ACIIQB.js} +2 -2
  49. package/dist/bundle/{chunk-FS2PG2PE.js → chunk-NVDR72GP.js} +19 -19
  50. package/dist/bundle/{chunk-VZ5KETIX.js → chunk-O6PD7RZY.js} +2 -2
  51. package/dist/bundle/{chunk-PDHN4GHU.js → chunk-OOIAJRKQ.js} +1 -1
  52. package/dist/bundle/{chunk-JEMBW6IO.js → chunk-OUM4ZO53.js} +1 -1
  53. package/dist/bundle/{chunk-QOKPRFHM.js → chunk-PB6NWKH3.js} +2 -2
  54. package/dist/bundle/{chunk-C72WYRXD.js → chunk-QJGFQRTL.js} +10 -10
  55. package/dist/bundle/chunk-RLGQMMYE.js +707 -0
  56. package/dist/bundle/{chunk-4G7WQNG7.js → chunk-RWQ7T4Y5.js} +2 -2
  57. package/dist/bundle/{chunk-ZH4H5XTA.js → chunk-SEJBS7SI.js} +1 -1
  58. package/dist/bundle/{chunk-OOBSSU2G.js → chunk-SY2HLH5R.js} +33 -19
  59. package/dist/bundle/{chunk-LSAIXPAX.js → chunk-SYUXKV2E.js} +1 -1
  60. package/dist/bundle/{chunk-FOMQ4MG3.js → chunk-T4FMXDDV.js} +2 -2
  61. package/dist/bundle/{chunk-5DMPGTNR.js → chunk-T6X6EZ5N.js} +3 -3
  62. package/dist/bundle/{chunk-RLH6BOEG.js → chunk-TZ75K6R7.js} +6 -6
  63. package/dist/bundle/{chunk-D4MVEOU2.js → chunk-U3RXH6RY.js} +1 -1
  64. package/dist/bundle/{chunk-ABJQ6IDU.js → chunk-V4FMN5A6.js} +16 -16
  65. package/dist/bundle/{chunk-WBKYZZQT.js → chunk-VUPWDCYV.js} +1 -1
  66. package/dist/bundle/{chunk-V7E25BUU.js → chunk-WNMPIRRF.js} +98 -6
  67. package/dist/bundle/{chunk-DAFKV6DJ.js → chunk-WOUIHZRI.js} +13 -15
  68. package/dist/bundle/{chunk-WWW7YTFG.js → chunk-WQOGHND4.js} +1 -1
  69. package/dist/bundle/{chunk-NFIR346J.js → chunk-XUHQ7DVT.js} +1 -1
  70. package/dist/bundle/{chunk-YI4DXASF.js → chunk-XVH3WZSZ.js} +49 -55
  71. package/dist/bundle/{chunk-ZEPDEFVT.js → chunk-ZBYKCVSV.js} +1 -1
  72. package/dist/bundle/{chunk-LXRBTXCZ.js → chunk-ZUG67442.js} +2 -2
  73. package/dist/bundle/{cli-U4LSBYDV.js → cli-BS4L3HAP.js} +100 -70
  74. package/dist/bundle/{command-contract-UU5T24ZZ.js → command-contract-HYURWSD6.js} +16 -17
  75. package/dist/bundle/{command-server-entry-PK6FBUPO.js → command-server-entry-CJ2CV7ZV.js} +23 -24
  76. package/dist/bundle/{decode-3ZE6NBKV.js → decode-E2NM5SSM.js} +3 -3
  77. package/dist/bundle/drive.js +4 -4
  78. package/dist/bundle/{echarts-6FWNCNXK.js → echarts-QIXLXS3G.js} +2 -2
  79. package/dist/bundle/{embed-DGYBBZUW.js → embed-YNZW5X6M.js} +4 -4
  80. package/dist/bundle/{embedder-O7A6VMWI.js → embedder-LRC2PKTS.js} +7 -7
  81. package/dist/bundle/{entry-CDJ2QSU2.js → entry-2IMSWRJU.js} +7 -7
  82. package/dist/bundle/{first-run-UOQW7DN5.js → first-run-7CPHQDM5.js} +7 -7
  83. package/dist/bundle/first-screen-OKZ7GMFR.js +38 -0
  84. package/dist/bundle/{google-HPX52KMC.js → google-WDKDBDD4.js} +15 -15
  85. package/dist/bundle/{google-api-HIMN4XL5.js → google-api-7JDZDCWE.js} +52 -53
  86. package/dist/bundle/{grants-RO42I6E4.js → grants-AU25GWKF.js} +57 -58
  87. package/dist/bundle/{identity-NFGHDPLL.js → identity-E43WKN5F.js} +1 -1
  88. package/dist/bundle/{instructions-6JAQYCM6.js → instructions-MD2RZT5Z.js} +1 -1
  89. package/dist/bundle/{login-RZOQN63N.js → login-RBDJPQAG.js} +57 -58
  90. package/dist/bundle/{node-KSIX3GIH.js → node-IEVT2FSJ.js} +2 -2
  91. package/dist/bundle/{node-sqlite-4FJ6WJXN.js → node-sqlite-IENH4TRX.js} +5 -5
  92. package/dist/bundle/{oauth-BKZAMFKK.js → oauth-3JGSN47Z.js} +5 -5
  93. package/dist/bundle/{open-4AQJGH42.js → open-TZ5H7NYM.js} +3 -3
  94. package/dist/bundle/{openai-24F2OX55.js → openai-XF2KB7W2.js} +14 -14
  95. package/dist/bundle/{process-7NOA2T7H.js → process-6Q23D3TO.js} +1 -1
  96. package/dist/bundle/{program-7JHMLDEX.js → program-D5XWOHV5.js} +88 -88
  97. package/dist/bundle/{prompt-NM66MAZ4.js → prompt-KUC5D4GX.js} +3 -3
  98. package/dist/bundle/{recognize-DBKV2JYZ.js → recognize-DPFW7HO3.js} +2 -2
  99. package/dist/bundle/{remote-ABWUTBVB.js → remote-MODTSUNH.js} +8 -8
  100. package/dist/bundle/{rerank-FQAU4ENY.js → rerank-JK7SERLE.js} +5 -5
  101. package/dist/bundle/{serve-QLJG4QZD.js → serve-BV2WHZLW.js} +7 -7
  102. package/dist/bundle/server-6YDI4Y36.js +72 -0
  103. package/dist/bundle/{server-VGZNK5XD.js → server-N3WPEU7Z.js} +47 -44
  104. package/dist/bundle/{services-5KARVUHK.js → services-SV6CFUCS.js} +42 -27
  105. package/dist/bundle/{sqlite-runtime-ILF6EFQJ.js → sqlite-runtime-RZ5PLZVQ.js} +4 -4
  106. package/dist/bundle/{state-R2M56GPU.js → state-RAZIREVG.js} +4 -4
  107. package/dist/bundle/{store-DA4K7HWW.js → store-2DLGLYS6.js} +18 -14
  108. package/dist/bundle/{store-2OBVMUQL.js → store-DQKJKX2G.js} +12 -12
  109. package/dist/bundle/store-maintenance-command-UJ5F5L4H.js +64 -0
  110. package/dist/bundle/tokens-LY3WML55.js +110 -0
  111. package/dist/policy.d.ts +2 -0
  112. package/dist/policy.d.ts.map +1 -1
  113. package/dist/policy.js +2 -1
  114. package/dist/policy.js.map +1 -1
  115. package/dist/program.d.ts.map +1 -1
  116. package/dist/program.js +3 -2
  117. package/dist/program.js.map +1 -1
  118. package/dist/version.d.ts +1 -1
  119. package/dist/version.js +1 -1
  120. package/package.json +2 -2
  121. package/dist/bundle/chunk-AZKFZ7J7.js +0 -76
  122. package/dist/bundle/chunk-JO7BJYAP.js +0 -1235
  123. package/dist/bundle/chunk-MBLB4TQI.js +0 -1316
  124. package/dist/bundle/first-screen-SNDV4YKF.js +0 -39
  125. package/dist/bundle/server-NUBLY5SV.js +0 -74
  126. package/dist/bundle/store-maintenance-command-KSIPI5B5.js +0 -65
  127. package/dist/bundle/tokens-VQDGSHRB.js +0 -111
@@ -2,41 +2,39 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  DOC
5
- } from "./chunk-FS2PG2PE.js";
5
+ } from "./chunk-NVDR72GP.js";
6
6
  import {
7
7
  operations
8
8
  } from "./chunk-NYECVHFH.js";
9
9
  import {
10
10
  privateFiles
11
- } from "./chunk-5TSILGTO.js";
11
+ } from "./chunk-IQ2QU2X6.js";
12
12
  import {
13
13
  commandPathKey,
14
14
  commandPermissions
15
- } from "./chunk-YVUAG7RF.js";
15
+ } from "./chunk-2DS2TDGW.js";
16
16
  import {
17
17
  listQuery,
18
18
  queryTerms,
19
19
  typedQuery,
20
20
  withQuery
21
- } from "./chunk-JO7BJYAP.js";
21
+ } from "./chunk-HEBZCKMU.js";
22
22
  import {
23
23
  AI_ENTRIES,
24
+ LEVELS,
24
25
  answerEntity,
25
26
  checkConfigText,
26
27
  issueMessage,
27
28
  settingsFor,
28
29
  usableProfileName,
29
30
  withSettingDefaults
30
- } from "./chunk-2Y3YBDZX.js";
31
- import {
32
- LEVELS
33
- } from "./chunk-MBLB4TQI.js";
31
+ } from "./chunk-25FT44S3.js";
34
32
  import {
35
33
  note
36
- } from "./chunk-UFNE57VY.js";
34
+ } from "./chunk-533XOW74.js";
37
35
  import {
38
36
  MAX_TEXT_CHARS
39
- } from "./chunk-LXRBTXCZ.js";
37
+ } from "./chunk-ZUG67442.js";
40
38
  import {
41
39
  dateRange,
42
40
  queryError,
@@ -45,14 +43,14 @@ import {
45
43
  } from "./chunk-UPCEHSIZ.js";
46
44
  import {
47
45
  DRIVE_APP
48
- } from "./chunk-LSAIXPAX.js";
46
+ } from "./chunk-SYUXKV2E.js";
49
47
  import {
50
48
  BASE_CONSTANTS,
51
49
  baseConstantsSchema,
52
50
  loadConstants,
53
51
  resolvePaths,
54
52
  saveConfigFile
55
- } from "./chunk-MW46BLWH.js";
53
+ } from "./chunk-5SJZDEIO.js";
56
54
  import {
57
55
  array,
58
56
  boolean,
@@ -88,7 +86,7 @@ import {
88
86
  __name
89
87
  } from "./chunk-ZVVMGPBJ.js";
90
88
 
91
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/oauth/client-file.js
89
+ // 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/oauth/client-file.js
92
90
  import { readFileSync } from "node:fs";
93
91
  var readClientFile = /* @__PURE__ */ __name((location, options = {}) => {
94
92
  if (!options.shipped && typeof location === "string") {
@@ -109,7 +107,7 @@ var readClientFile = /* @__PURE__ */ __name((location, options = {}) => {
109
107
  }
110
108
  }, "readClientFile");
111
109
 
112
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/constants/obscure.js
110
+ // 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/constants/obscure.js
113
111
  import { createDecipheriv } from "node:crypto";
114
112
  var KEY = Buffer.from("d43012779aa2dded3e98092a3dbcf5d8980c564172f5ce0a5fd0574e5f740339", "hex");
115
113
  var reveal = /* @__PURE__ */ __name((obscured) => {
@@ -118,7 +116,7 @@ var reveal = /* @__PURE__ */ __name((obscured) => {
118
116
  return Buffer.concat([decipher.update(bytes.subarray(16)), decipher.final()]).toString("utf8");
119
117
  }, "reveal");
120
118
 
121
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/constants/index.js
119
+ // 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/constants/index.js
122
120
  var CORE_CONSTANTS = new URL("../../constants.json", new URL("constants/index.js", import.meta.resolve("@wirecat/cli-core")).href);
123
121
  var constantsSchema = object({
124
122
  ...baseConstantsSchema.entries,
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/background/processes.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/background/processes.js
8
8
  import { execFileSync } from "node:child_process";
9
9
  import { readdirSync, readFileSync, readlinkSync } from "node:fs";
10
10
  var alive = /* @__PURE__ */ __name((pid) => {
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/cli/command-server-argv.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/cli/command-server-argv.js
8
8
  var COMMAND_SERVER_ARGV = ["commands", "--serve"];
9
9
  var isCommandServer = /* @__PURE__ */ __name((args) => args.length === COMMAND_SERVER_ARGV.length && COMMAND_SERVER_ARGV.every((word, at) => args[at] === word), "isCommandServer");
10
10
 
@@ -20,7 +20,7 @@ import {
20
20
  tool,
21
21
  toolKey,
22
22
  toolsFromCommands
23
- } from "./chunk-UOAHZV3K.js";
23
+ } from "./chunk-BBJVV4E2.js";
24
24
  import {
25
25
  CHART_KINDS,
26
26
  CHART_SIZE,
@@ -33,95 +33,94 @@ import {
33
33
  refuseWriteBeforeConnecting,
34
34
  registerPrompts,
35
35
  syncsFirst
36
- } from "./chunk-WKIQKGOF.js";
36
+ } from "./chunk-KUQDBWPU.js";
37
37
  import {
38
38
  agentJson,
39
39
  skillResource
40
- } from "./chunk-OOBSSU2G.js";
40
+ } from "./chunk-SY2HLH5R.js";
41
41
  import {
42
42
  instructions
43
- } from "./chunk-E3XA56TS.js";
44
- import {
45
- answeredWire
46
- } from "./chunk-AZKFZ7J7.js";
43
+ } from "./chunk-CAQ5GW3A.js";
47
44
  import {
48
45
  StdioServerTransport,
46
+ answeredWire,
49
47
  callerOf,
50
48
  callingAgent,
51
49
  serveStdio
52
- } from "./chunk-V7E25BUU.js";
50
+ } from "./chunk-WNMPIRRF.js";
53
51
  import {
54
52
  McpServer,
55
53
  ResourceTemplate
56
54
  } from "./chunk-5D4AEUVA.js";
57
55
  import {
58
56
  connectedFor
59
- } from "./chunk-YVUAG7RF.js";
57
+ } from "./chunk-2DS2TDGW.js";
60
58
  import {
61
59
  lackedNeed,
62
60
  wholeList
63
- } from "./chunk-JO7BJYAP.js";
61
+ } from "./chunk-RLGQMMYE.js";
64
62
  import {
65
63
  capability,
66
64
  dateWindow,
67
65
  guardFor,
68
66
  servicesFor,
69
67
  storedDeps
70
- } from "./chunk-IRULPE5M.js";
68
+ } from "./chunk-HEBZCKMU.js";
71
69
  import {
72
70
  imageSize
73
- } from "./chunk-6ERQE4FS.js";
71
+ } from "./chunk-5B5NOAIA.js";
74
72
  import {
75
73
  mcpHttpMarker
76
- } from "./chunk-ULH3TNUP.js";
74
+ } from "./chunk-376ZGVUZ.js";
77
75
  import {
78
76
  warmEmbedders
79
- } from "./chunk-BHSLMJF7.js";
77
+ } from "./chunk-EWUQIUTB.js";
80
78
  import {
81
79
  stdinFieldOf
82
- } from "./chunk-AAZPDWRD.js";
80
+ } from "./chunk-MHXZ62CU.js";
83
81
  import {
84
82
  findCommand
85
- } from "./chunk-2MEVCMBW.js";
83
+ } from "./chunk-6EL5AVXX.js";
86
84
  import {
87
85
  DEFAULT_OUTPUT_BYTES,
88
86
  changesAuthorityAt,
89
87
  describeProgram,
90
88
  environmentOf,
89
+ fetchesAt,
90
+ fetchesOnlyAt,
91
91
  itemOf,
92
92
  judgedTargets,
93
+ levelFor,
94
+ readKeysForCommand,
93
95
  readsOverMcpAt,
94
96
  recalledAccount,
95
97
  rootOf2 as rootOf,
96
98
  sealed,
97
99
  snakeKeys
98
- } from "./chunk-2Y3YBDZX.js";
100
+ } from "./chunk-25FT44S3.js";
99
101
  import {
100
102
  withCaller
101
- } from "./chunk-7J2IP3WL.js";
102
- import {
103
- levelFor,
104
- readKeysForCommand
105
- } from "./chunk-MBLB4TQI.js";
103
+ } from "./chunk-AD7VI3XU.js";
106
104
  import {
107
105
  readOnlyLockOf
108
- } from "./chunk-ZEPDEFVT.js";
106
+ } from "./chunk-ZBYKCVSV.js";
109
107
  import {
110
108
  openStore
111
- } from "./chunk-NWYVOHIX.js";
109
+ } from "./chunk-3RLRJHAI.js";
112
110
  import {
113
111
  pdfPreviewLimits
114
- } from "./chunk-LXRBTXCZ.js";
112
+ } from "./chunk-ZUG67442.js";
115
113
  import {
116
114
  typedCommand
117
- } from "./chunk-EXWOOST5.js";
115
+ } from "./chunk-I55XYREN.js";
118
116
  import {
119
117
  timezoneOf
120
118
  } from "./chunk-UPCEHSIZ.js";
121
119
  import {
122
120
  isCliFailure
123
- } from "./chunk-7AZCAUST.js";
121
+ } from "./chunk-3YKAFLXY.js";
124
122
  import {
123
+ errorObjectOf,
125
124
  mcpErrorResult
126
125
  } from "./chunk-PV3AWPHR.js";
127
126
  import {
@@ -149,10 +148,10 @@ import {
149
148
  __name
150
149
  } from "./chunk-ZVVMGPBJ.js";
151
150
 
152
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/mcp/server.js
151
+ // 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
153
152
  import { randomUUID } from "node:crypto";
154
153
 
155
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/mcp/agent-log.js
154
+ // 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
156
155
  var agentLog = /* @__PURE__ */ __name((open) => {
157
156
  let held;
158
157
  return {
@@ -171,7 +170,7 @@ var agentLog = /* @__PURE__ */ __name((open) => {
171
170
  };
172
171
  }, "agentLog");
173
172
 
174
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/mcp/resources.js
173
+ // 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
175
174
  var LISTED = 100;
176
175
  var registerResources = /* @__PURE__ */ __name((server, session, { command, name, limit, recorded, withStore, messenger, guard, assertRead }) => {
177
176
  server.registerResource("chat", new ResourceTemplate(`${command}://chat/{id}`, {
@@ -209,7 +208,7 @@ var registerResources = /* @__PURE__ */ __name((server, session, { command, name
209
208
  });
210
209
  }, "registerResources");
211
210
 
212
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/mcp/session.js
211
+ // 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
213
212
  var HARMLESS = /* @__PURE__ */ new Set(["validation_error", "not_found", "permission_error", "confirmation_required", "rate_limited"]);
214
213
  var harmless = /* @__PURE__ */ __name((code) => HARMLESS.has(code), "harmless");
215
214
  var MessengerSession = class {
@@ -284,7 +283,7 @@ var MessengerSession = class {
284
283
  }
285
284
  };
286
285
 
287
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/mcp/tools/attachments.js
286
+ // 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
288
287
  var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
289
288
  const _command = messenger.app.command;
290
289
  return {
@@ -338,7 +337,7 @@ var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
338
337
  };
339
338
  }, "attachmentsTools");
340
339
 
341
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/mcp/tools/messages-photo.js
340
+ // 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
342
341
  var PHOTO_LIMIT = 512 * 1024;
343
342
  var IMAGE_TYPES = [
344
343
  ["image/jpeg", (b) => b[0] === 255 && b[1] === 216 && b[2] === 255],
@@ -354,14 +353,16 @@ var messagesPhotoTools = /* @__PURE__ */ __name((messenger) => ({
354
353
  input: object({
355
354
  chat: chatOf(messenger),
356
355
  message,
357
- index: optional(pipe(number(), integer(), minValue(0), description("attachment index from 0; omit for the first photo")))
356
+ attachment: optional(pipe(number(), integer(), minValue(1), description("which file of the message, from 1; omit for the first photo")))
358
357
  }),
359
358
  annotations: READ,
360
359
  online: /* @__PURE__ */ __name(async (adapter, args, defaults) => {
361
360
  const { id: chatId } = await adapter.resolve(args.chat);
362
361
  const saveIt = `the owner can save it with \`${typedCommand(messenger.app.command, `messages download ${chatId} ${args.message}`)}\``;
363
362
  const { files } = await capability(adapter, "download", "download attachments")(chatId, args.message);
364
- const photo = args.index === void 0 ? files.find((file) => file.kind === "photo") : files[args.index];
363
+ if (args.attachment !== void 0 && args.attachment > files.length)
364
+ throw new CliError("not_found", `message ${args.message} has ${files.length} file${files.length === 1 ? "" : "s"}, no file ${args.attachment}`);
365
+ const photo = args.attachment === void 0 ? files.find((file) => file.kind === "photo") : files[args.attachment - 1];
365
366
  if (!photo) {
366
367
  const kinds = files.map((file) => file.kind).join(", ");
367
368
  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}`);
@@ -392,7 +393,7 @@ var readUpTo = /* @__PURE__ */ __name(async (file, limit, saveIt) => {
392
393
  return new Uint8Array(Buffer.concat(chunks));
393
394
  }, "readUpTo");
394
395
 
395
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/mcp/tools/stats.js
396
+ // 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
396
397
  var statsTools = /* @__PURE__ */ __name((messenger) => ({
397
398
  stats_charts: tool({
398
399
  title: "A chart from a chat's statistics",
@@ -429,14 +430,14 @@ var statsTools = /* @__PURE__ */ __name((messenger) => ({
429
430
  })
430
431
  }), "statsTools");
431
432
 
432
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/mcp/tools.js
433
+ // 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
433
434
  var pictureTools = /* @__PURE__ */ __name((messenger) => Object.fromEntries(Object.entries({
434
435
  ...messagesPhotoTools(messenger),
435
436
  ...attachmentsTools(messenger),
436
437
  ...statsTools(messenger)
437
438
  }).map(([name, definition]) => [name, { ...definition, input: strictObject(definition.input.entries) }])), "pictureTools");
438
439
 
439
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/mcp/server.js
440
+ // 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
440
441
  var PER_RUN = /* @__PURE__ */ new Set([
441
442
  "streams",
442
443
  "stdin",
@@ -487,6 +488,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
487
488
  }
488
489
  }, "keyOf");
489
490
  const authority = changesAuthorityAt(root);
491
+ const fetches = fetchesOnlyAt(root);
490
492
  const stdin = /* @__PURE__ */ __name((path) => {
491
493
  try {
492
494
  return stdinFieldOf(findCommand(root, path));
@@ -494,7 +496,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
494
496
  return void 0;
495
497
  }
496
498
  }, "stdin");
497
- const syncAllowed = /* @__PURE__ */ __name((path) => syncsFirst(messenger) && levelOf("messages.sync-first") === "allow" && (path[0] !== "stats" || levelOf(`${path.join(".")}.sync-first`) === "allow"), "syncAllowed");
499
+ const syncAllowed = /* @__PURE__ */ __name((path) => syncsFirst(messenger) && fetchesAt(levelOf("messages.sync-first")) && (path[0] !== "stats" || fetchesAt(levelOf(`${path.join(".")}.sync-first`))), "syncAllowed");
498
500
  const generated = toolsFromCommands(program.commands, {
499
501
  includeUnavailable: true,
500
502
  exclude: [["bot"]],
@@ -507,6 +509,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
507
509
  keyOf,
508
510
  authority,
509
511
  fetchOnly: readsOverMcpAt(root),
512
+ fetches,
510
513
  offline: true,
511
514
  stdin
512
515
  }).map((one) => "sync_first" in one.input.entries && !syncAllowed(one.path) ? {
@@ -587,6 +590,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
587
590
  overrides,
588
591
  keyOf,
589
592
  authority,
593
+ fetches,
590
594
  stdin,
591
595
  connection,
592
596
  environment: agentEnvironment,
@@ -598,8 +602,8 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
598
602
  });
599
603
  }), "invoke");
600
604
  let queue = Promise.resolve();
601
- const queued = /* @__PURE__ */ __name((one, input, env, caller) => {
602
- const next = queue.then(() => invoke(one, input, env, caller));
605
+ const queued = /* @__PURE__ */ __name((one, input, env, caller, signal) => {
606
+ const next = queue.then(() => signal?.aborted ? { error: errorObjectOf(new CliError("cancelled", `${one.command} was cancelled before it started`)) } : invoke(one, input, env, caller));
603
607
  queue = next.catch(() => void 0);
604
608
  return next;
605
609
  }, "queued");
@@ -615,7 +619,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
615
619
  const traceparent = ctx?.mcpReq?._meta?.traceparent;
616
620
  const env = typeof traceparent === "string" ? { ...context.env, TRACEPARENT: traceparent } : context.env;
617
621
  const caller = callerOf(ctx, keyOfCommand(one.command), source);
618
- const answer = await withCaller(caller, () => queued(one, args, env, caller));
622
+ const answer = await withCaller(caller, () => queued(one, args, env, caller, ctx?.mcpReq?.signal));
619
623
  const result = "error" in answer ? mcpErrorResult(JSON.parse(agentJson(answer.error))) : (() => {
620
624
  try {
621
625
  return answered(envelope(one.command, answer.result), DEFAULT_OUTPUT_BYTES, targets);
@@ -671,7 +675,7 @@ var createServer = /* @__PURE__ */ __name((command, context, messenger, sessionO
671
675
  spawnJob: sessionOptions.spawnJob,
672
676
  limit: settings.limit,
673
677
  get syncAllowed() {
674
- return syncsFirst(messenger) && levelOf("messages.sync-first") === "allow";
678
+ return syncsFirst(messenger) && fetchesAt(levelOf("messages.sync-first"));
675
679
  },
676
680
  guard,
677
681
  settings,
@@ -738,18 +742,8 @@ var serveOverStdio = /* @__PURE__ */ __name(async (command, context, messenger,
738
742
  transport: new StdioServerTransport(wire.input, wire.output),
739
743
  onerror: /* @__PURE__ */ __name((error) => context.renderer.note(`mcp: ${error.message}`), "onerror")
740
744
  });
741
- const ended = await new Promise((resolve) => {
742
- wire.ended.then(() => resolve("input"));
743
- if (own)
744
- signal?.addEventListener("abort", () => resolve("stopped"), { once: true });
745
- else {
746
- process.once("SIGINT", () => resolve("stopped"));
747
- process.once("SIGTERM", () => resolve("stopped"));
748
- }
749
- });
745
+ await wire.finished(own ? signal : void 0);
750
746
  try {
751
- if (ended === "input")
752
- await wire.answered();
753
747
  wire.release();
754
748
  await handle.close();
755
749
  await session.close();
@@ -760,7 +754,7 @@ var serveOverStdio = /* @__PURE__ */ __name(async (command, context, messenger,
760
754
  }, "serveOverStdio");
761
755
  var serveOverHttpUntilStopped = /* @__PURE__ */ __name(async (command, context, messenger, options, http) => {
762
756
  const { session, embedders, build, log } = createServer(command, context, messenger, options);
763
- const { serveOverHttp } = await import("./serve-QLJG4QZD.js");
757
+ const { serveOverHttp } = await import("./serve-BV2WHZLW.js");
764
758
  const appName = messenger.app.command;
765
759
  const appEnvPrefix = messenger.app.envPrefix;
766
760
  const listening = await serveOverHttp(build, {
@@ -7,7 +7,7 @@ import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/ports/app.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/ports/app.js
11
11
  import { readFileSync } from "node:fs";
12
12
  var envName = /* @__PURE__ */ __name((app, name) => `${app.envPrefix}_${name}`, "envName");
13
13
  var locking = /* @__PURE__ */ __name((value) => value !== void 0 && value.trim() !== "" && value !== "0", "locking");
@@ -7,7 +7,7 @@ import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/attachments/limits.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/attachments/limits.js
11
11
  var MAX_FILE_BYTES = 50 * 1024 * 1024;
12
12
  var MAX_TEXT_CHARS = 2e6;
13
13
  var ATTACHMENT_LIMIT_ENV = [
@@ -33,7 +33,7 @@ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
33
33
  return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
34
34
  }, "pdfPreviewLimits");
35
35
 
36
- // node_modules/.pnpm/@wirecat+cli-core@0.652.0_@wirecat+cli-base@0.99.0_commander@15.0.0_esbuild@0.28.2_type_8be4ae3be01c4720e564a3a01e19fd64/node_modules/@wirecat/cli-core/dist/domain/google-documents.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/google-documents.js
37
37
  var LINK = /https?:\/\/(?:(?:docs|drive|sheets|slides)\.google\.com|forms\.gle)(?:[/?#][^\s<>"'`]*)?/gi;
38
38
  var ID = /^[\w-]{10,}$/;
39
39
  var trimUrl = /* @__PURE__ */ __name((url) => {