@wirecat/tg-cli 0.120.0 → 0.122.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 (94) hide show
  1. package/contracts/wirecat.json +25 -3
  2. package/dist/bin/tg.js +2 -2
  3. package/dist/bundle/{adapter-OJKHXGBC.js → adapter-ZI57T2L5.js} +53 -49
  4. package/dist/bundle/{all-profiles-URIWNL23.js → all-profiles-7VXJF42C.js} +6 -6
  5. package/dist/bundle/{anthropic-YUKNB63B.js → anthropic-DKRXIWVV.js} +13 -4
  6. package/dist/bundle/{app-server-H5QNHGH4.js → app-server-F5MKHZ7S.js} +43 -42
  7. package/dist/bundle/{bot-api-27GN4Y3D.js → bot-api-F24NWJT3.js} +47 -44
  8. package/dist/bundle/{bot-history-VVSWLVZM.js → bot-history-U3WM3A7S.js} +12 -12
  9. package/dist/bundle/{bun-PAAJX3GU.js → bun-OMTJAXGK.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-TPEBWFZH.js → bun-sqlite-HSYLO46A.js} +2 -2
  11. package/dist/bundle/{chunk-WLBPNLDF.js → chunk-27SVHRHV.js} +2 -2
  12. package/dist/bundle/{chunk-3FPFRDG2.js → chunk-2FXA32RJ.js} +6 -6
  13. package/dist/bundle/{chunk-4JATS2J5.js → chunk-2UHANFLM.js} +2 -2
  14. package/dist/bundle/{chunk-FPWXG53C.js → chunk-33ELXJRR.js} +37 -121
  15. package/dist/bundle/{chunk-KP26Y5OA.js → chunk-4MFMUBHH.js} +4901 -4827
  16. package/dist/bundle/{chunk-HDSKBXAF.js → chunk-4N2WJYLE.js} +2 -2
  17. package/dist/bundle/{chunk-7WS3ULOO.js → chunk-6DLRATDC.js} +1159 -801
  18. package/dist/bundle/{chunk-YQKEPT22.js → chunk-6LMEIELG.js} +1 -1
  19. package/dist/bundle/{chunk-DH7VKHTZ.js → chunk-7FWU4RON.js} +3 -3
  20. package/dist/bundle/{chunk-4OWY7QBE.js → chunk-7GCVON7M.js} +5 -5
  21. package/dist/bundle/{chunk-HIBYYKGO.js → chunk-7X6YLKTK.js} +1 -1
  22. package/dist/bundle/{chunk-D2WNQJUQ.js → chunk-ALW7ROTM.js} +1 -1
  23. package/dist/bundle/{chunk-6XHZV7AQ.js → chunk-ARKB3M5X.js} +3 -3
  24. package/dist/bundle/{chunk-KTV5Y5EX.js → chunk-C5CB6RIX.js} +1 -1
  25. package/dist/bundle/{chunk-7VNV426X.js → chunk-CB6AHU6H.js} +44 -22
  26. package/dist/bundle/{chunk-CGUDXNJE.js → chunk-CW3C7FSO.js} +1 -1
  27. package/dist/bundle/{chunk-3SANNNWS.js → chunk-D3ODL4P7.js} +2 -2
  28. package/dist/bundle/{chunk-34DSPJNN.js → chunk-DCGGZUNJ.js} +2 -2
  29. package/dist/bundle/{chunk-CYWV2RLN.js → chunk-DDSAJKPO.js} +4 -4
  30. package/dist/bundle/{chunk-KRCMKFUV.js → chunk-DTTONQW7.js} +1 -1
  31. package/dist/bundle/{chunk-PDYTNTQI.js → chunk-E3MFMMVY.js} +5 -5
  32. package/dist/bundle/{chunk-ZON7K5QE.js → chunk-FHWUOFWX.js} +2 -2
  33. package/dist/bundle/{chunk-ZRRZTPSB.js → chunk-FYHFAOPM.js} +2219 -1052
  34. package/dist/bundle/{chunk-H5XC2WYO.js → chunk-FZKHFTKH.js} +22 -22
  35. package/dist/bundle/{chunk-THJHYMFR.js → chunk-GJBGZQHN.js} +3626 -3596
  36. package/dist/bundle/{chunk-DDKFAUQD.js → chunk-GJFICFQB.js} +1 -1
  37. package/dist/bundle/{chunk-CLURRDNU.js → chunk-HAR76KJG.js} +4 -4
  38. package/dist/bundle/{chunk-JJY3TQTM.js → chunk-LQRZUNYF.js} +2 -2
  39. package/dist/bundle/{chunk-LLCGOZ44.js → chunk-MFWWZ6XL.js} +2 -2
  40. package/dist/bundle/{chunk-LS72R7DN.js → chunk-N7WDVH2O.js} +37 -35
  41. package/dist/bundle/chunk-NE3EGYPD.js +109 -0
  42. package/dist/bundle/{chunk-YBOVL25O.js → chunk-NU4RMUMQ.js} +16 -16
  43. package/dist/bundle/{chunk-JQLGS3SG.js → chunk-O5A4IS2D.js} +1 -1
  44. package/dist/bundle/{chunk-DE7QIEUP.js → chunk-PG3V225O.js} +30 -49
  45. package/dist/bundle/{chunk-WQ55F4Y3.js → chunk-QROAXWDU.js} +7 -7
  46. package/dist/bundle/{chunk-U2TPRUWK.js → chunk-R2IW6JBV.js} +81 -81
  47. package/dist/bundle/{chunk-CLTMVPGT.js → chunk-RFFU6KQ5.js} +12 -12
  48. package/dist/bundle/{chunk-DQTQO6PB.js → chunk-SODUFMDW.js} +1651 -948
  49. package/dist/bundle/{chunk-KW6JZGG3.js → chunk-TKJZENAZ.js} +1 -1
  50. package/dist/bundle/{chunk-B7B65ZLU.js → chunk-UGEYQWEO.js} +1 -1
  51. package/dist/bundle/chunk-V4BPS7MH.js +185 -0
  52. package/dist/bundle/{chunk-3GLLWDM6.js → chunk-VC6J7X76.js} +16 -16
  53. package/dist/bundle/{chunk-S6OC367D.js → chunk-VDFEWSCS.js} +2 -2
  54. package/dist/bundle/{chunk-KLHOQ6XQ.js → chunk-VQL4RVXZ.js} +3 -1
  55. package/dist/bundle/{chunk-JSEIT2WO.js → chunk-W34QQMBK.js} +1 -1
  56. package/dist/bundle/{chunk-MMPISXSU.js → chunk-Y52T5EMB.js} +1 -1
  57. package/dist/bundle/{chunk-MTD6WZKV.js → chunk-Y74WJL3M.js} +6 -6
  58. package/dist/bundle/chunk-YDMKP7PO.js +18 -0
  59. package/dist/bundle/{chunk-VUUR2SRS.js → chunk-YFEH7OWG.js} +33 -16
  60. package/dist/bundle/{chunk-YDROJG2Y.js → chunk-ZKHXWSKD.js} +4 -4
  61. package/dist/bundle/{chunk-7N4IUEX3.js → chunk-ZNPRTCUO.js} +6 -6
  62. package/dist/bundle/{command-contract-KW6FNOJO.js → command-contract-247AKZTE.js} +12 -12
  63. package/dist/bundle/command-server-entry-N32NX4QW.js +162 -0
  64. package/dist/bundle/{decode-RVWSCZW4.js → decode-ZKJWSFXF.js} +2 -2
  65. package/dist/bundle/{echarts-6VNUD3JF.js → echarts-QLVLIP73.js} +2 -2
  66. package/dist/bundle/{embed-LWLCQKIK.js → embed-LC6K7P3S.js} +3 -3
  67. package/dist/bundle/{embedder-CXKHLRJT.js → embedder-6C3OQBOV.js} +6 -6
  68. package/dist/bundle/{entry-HV4NSX3Z.js → entry-5H6LB3MP.js} +7 -4
  69. package/dist/bundle/{first-run-OPI6NIWQ.js → first-run-IOYQ4XQK.js} +5 -5
  70. package/dist/bundle/{first-screen-BVQLF4LN.js → first-screen-NVK7PFX4.js} +13 -13
  71. package/dist/bundle/{instructions-TK4HXL3A.js → instructions-SZUMEDY3.js} +1 -1
  72. package/dist/bundle/{node-WFPNBUCU.js → node-V76RRFIA.js} +2 -2
  73. package/dist/bundle/{node-sqlite-L5BRGJLK.js → node-sqlite-2DTVOT7L.js} +3 -3
  74. package/dist/bundle/{oauth-CGVWL35B.js → oauth-CT7EBDRY.js} +4 -4
  75. package/dist/bundle/{open-HLL55C5S.js → open-G3VHOOMV.js} +2 -2
  76. package/dist/bundle/{openai-YFCNXIJ4.js → openai-F4K7MVTZ.js} +13 -13
  77. package/dist/bundle/{process-4A5JP5LO.js → process-XH3KEHSF.js} +1 -1
  78. package/dist/bundle/{program-IFGQGSUF.js → program-FLGIHTHM.js} +63 -60
  79. package/dist/bundle/{prompt-B5FYE2DQ.js → prompt-JWQ6UQ6R.js} +2 -2
  80. package/dist/bundle/{recognize-ZHMHGIV3.js → recognize-Z26T3SYD.js} +1 -1
  81. package/dist/bundle/{remote-A3W5HE52.js → remote-7KHT6V3O.js} +4 -4
  82. package/dist/bundle/{rerank-HWJAQOZM.js → rerank-6QVI74QY.js} +4 -4
  83. package/dist/bundle/{serve-PP326Q2F.js → serve-WYDZTONY.js} +11 -11
  84. package/dist/bundle/server-UXQT7LZT.js +61 -0
  85. package/dist/bundle/{server-MV6CL63L.js → server-Y4J2NCFA.js} +32 -32
  86. package/dist/bundle/{state-Y3RJ7ZXB.js → state-YCXBKOD2.js} +3 -3
  87. package/dist/bundle/{store-EVNI2MHZ.js → store-QECSDJRP.js} +9 -9
  88. package/dist/bundle/store-maintenance-command-5YW6TRJA.js +49 -0
  89. package/dist/bundle/tg.js +4 -4
  90. package/dist/version.d.ts +1 -1
  91. package/dist/version.js +1 -1
  92. package/package.json +2 -2
  93. package/dist/bundle/server-TZGGOJ26.js +0 -60
  94. package/dist/bundle/store-maintenance-command-XPQE47RE.js +0 -49
@@ -7,7 +7,7 @@ import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/ports/app.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/ports/app.js
11
11
  var envName = /* @__PURE__ */ __name((app, name) => `${app.envPrefix}_${name}`, "envName");
12
12
  var readOnlyLockOf = /* @__PURE__ */ __name((app, env) => {
13
13
  const name = envName(app, "READ_ONLY");
@@ -2,7 +2,7 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  storePath
5
- } from "./chunk-MMPISXSU.js";
5
+ } from "./chunk-Y52T5EMB.js";
6
6
  import {
7
7
  resolvePaths
8
8
  } from "./chunk-U6HEZPCR.js";
@@ -14,11 +14,11 @@ import {
14
14
  __name
15
15
  } from "./chunk-ZVVMGPBJ.js";
16
16
 
17
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/store/shared-config.js
17
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/store/shared-config.js
18
18
  import { mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
19
19
  import { dirname, join, resolve } from "node:path";
20
20
 
21
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/domain/task-categories.js
21
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/domain/task-categories.js
22
22
  var DEFAULT_TASK_CATEGORIES = [
23
23
  {
24
24
  name: "taxes",
@@ -773,7 +773,7 @@ var storedTaskCategories = /* @__PURE__ */ __name((json) => {
773
773
  }
774
774
  }, "storedTaskCategories");
775
775
 
776
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/store/shared-config.js
776
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/store/shared-config.js
777
777
  var SECTION = "task_categories";
778
778
  var sharedConfigPath = /* @__PURE__ */ __name((store, env = process.env) => {
779
779
  const paths = resolvePaths({ appName: "WireCat", prefix: "WIRECAT", env });
@@ -4,7 +4,7 @@ import {
4
4
  MAX_SECRET_INPUT,
5
5
  bufferedInput,
6
6
  inputPolicy
7
- } from "./chunk-KTV5Y5EX.js";
7
+ } from "./chunk-C5CB6RIX.js";
8
8
  import {
9
9
  CliError
10
10
  } from "./chunk-VUBZFMGP.js";
@@ -12,7 +12,7 @@ import {
12
12
  __name
13
13
  } from "./chunk-ZVVMGPBJ.js";
14
14
 
15
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/terminal/prompt.js
15
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/terminal/prompt.js
16
16
  import { createInterface } from "node:readline";
17
17
  import { Writable } from "node:stream";
18
18
  var EMPTY_TRIES = 3;
@@ -7,7 +7,7 @@ import {
7
7
  describeOptions,
8
8
  keyForCommand,
9
9
  metaOf
10
- } from "./chunk-THJHYMFR.js";
10
+ } from "./chunk-GJBGZQHN.js";
11
11
  import {
12
12
  jsonSchemaOf
13
13
  } from "./chunk-WGGSFGNZ.js";
@@ -18,7 +18,7 @@ import {
18
18
  __name
19
19
  } from "./chunk-ZVVMGPBJ.js";
20
20
 
21
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/cli/command-contract.js
21
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/cli/command-contract.js
22
22
  var SCHEMA_DIALECT = "https://json-schema.org/draft/2020-12/schema";
23
23
  var outputOf = /* @__PURE__ */ __name((command) => {
24
24
  const entity = answerEntitySchema(command);
@@ -20,7 +20,7 @@ import {
20
20
  tool,
21
21
  toolKey,
22
22
  toolsFromCommands
23
- } from "./chunk-VUUR2SRS.js";
23
+ } from "./chunk-YFEH7OWG.js";
24
24
  import {
25
25
  CHART_KINDS,
26
26
  CHART_SIZE,
@@ -32,32 +32,34 @@ import {
32
32
  mcpUrlOf,
33
33
  refuseWriteBeforeConnecting,
34
34
  registerPrompts,
35
- stdinFieldOf,
36
35
  syncsFirst
37
- } from "./chunk-DE7QIEUP.js";
36
+ } from "./chunk-PG3V225O.js";
38
37
  import {
39
38
  agentJson,
40
39
  skillResource
41
- } from "./chunk-7VNV426X.js";
40
+ } from "./chunk-CB6AHU6H.js";
42
41
  import {
43
42
  instructions
44
- } from "./chunk-YQKEPT22.js";
43
+ } from "./chunk-6LMEIELG.js";
44
+ import {
45
+ mcpHttpMarker
46
+ } from "./chunk-DDSAJKPO.js";
45
47
  import {
46
48
  answeredWire
47
- } from "./chunk-JSEIT2WO.js";
49
+ } from "./chunk-W34QQMBK.js";
48
50
  import {
49
51
  StdioServerTransport,
50
52
  callerOf,
51
53
  callingAgent,
52
54
  serveStdio
53
- } from "./chunk-34DSPJNN.js";
55
+ } from "./chunk-DCGGZUNJ.js";
54
56
  import {
55
57
  McpServer,
56
58
  ResourceTemplate
57
59
  } from "./chunk-5D4AEUVA.js";
58
60
  import {
59
61
  connectedFor
60
- } from "./chunk-H5XC2WYO.js";
62
+ } from "./chunk-FZKHFTKH.js";
61
63
  import {
62
64
  capability,
63
65
  dateWindow,
@@ -67,10 +69,20 @@ import {
67
69
  servicesFor,
68
70
  storedDeps,
69
71
  wholeList
70
- } from "./chunk-7WS3ULOO.js";
72
+ } from "./chunk-6DLRATDC.js";
73
+ import {
74
+ openStore,
75
+ pdfPreviewLimits
76
+ } from "./chunk-FYHFAOPM.js";
77
+ import {
78
+ warmEmbedders
79
+ } from "./chunk-7GCVON7M.js";
80
+ import {
81
+ stdinFieldOf
82
+ } from "./chunk-YDMKP7PO.js";
71
83
  import {
72
84
  findCommand
73
- } from "./chunk-LLCGOZ44.js";
85
+ } from "./chunk-MFWWZ6XL.js";
74
86
  import {
75
87
  DEFAULT_OUTPUT_BYTES,
76
88
  changesAuthorityAt,
@@ -85,30 +97,20 @@ import {
85
97
  rootOf2 as rootOf,
86
98
  sealed,
87
99
  snakeKeys
88
- } from "./chunk-THJHYMFR.js";
100
+ } from "./chunk-GJBGZQHN.js";
89
101
  import {
90
102
  withCaller
91
- } from "./chunk-3FPFRDG2.js";
103
+ } from "./chunk-2FXA32RJ.js";
92
104
  import {
93
105
  readOnlyLockOf
94
- } from "./chunk-DDKFAUQD.js";
95
- import {
96
- mcpHttpMarker
97
- } from "./chunk-CYWV2RLN.js";
98
- import {
99
- openStore,
100
- pdfPreviewLimits
101
- } from "./chunk-ZRRZTPSB.js";
106
+ } from "./chunk-GJFICFQB.js";
102
107
  import {
103
108
  timezoneOf,
104
109
  typedCommand
105
- } from "./chunk-KP26Y5OA.js";
110
+ } from "./chunk-4MFMUBHH.js";
106
111
  import {
107
112
  isCliFailure
108
- } from "./chunk-WLBPNLDF.js";
109
- import {
110
- warmEmbedders
111
- } from "./chunk-4OWY7QBE.js";
113
+ } from "./chunk-27SVHRHV.js";
112
114
  import {
113
115
  description,
114
116
  integer,
@@ -133,10 +135,10 @@ import {
133
135
  __name
134
136
  } from "./chunk-ZVVMGPBJ.js";
135
137
 
136
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/mcp/server.js
138
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/server.js
137
139
  import { randomUUID } from "node:crypto";
138
140
 
139
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/mcp/agent-log.js
141
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/agent-log.js
140
142
  var agentLog = /* @__PURE__ */ __name((open) => {
141
143
  let held;
142
144
  return {
@@ -155,7 +157,7 @@ var agentLog = /* @__PURE__ */ __name((open) => {
155
157
  };
156
158
  }, "agentLog");
157
159
 
158
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/mcp/resources.js
160
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/resources.js
159
161
  var LISTED = 100;
160
162
  var registerResources = /* @__PURE__ */ __name((server, session, { command, name, limit, recorded, withStore, messenger, guard, assertRead }) => {
161
163
  server.registerResource("chat", new ResourceTemplate(`${command}://chat/{id}`, {
@@ -193,7 +195,7 @@ var registerResources = /* @__PURE__ */ __name((server, session, { command, name
193
195
  });
194
196
  }, "registerResources");
195
197
 
196
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/mcp/session.js
198
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/session.js
197
199
  var HARMLESS = /* @__PURE__ */ new Set(["validation_error", "not_found", "permission_error", "confirmation_required", "rate_limited"]);
198
200
  var harmless = /* @__PURE__ */ __name((code) => HARMLESS.has(code), "harmless");
199
201
  var MessengerSession = class {
@@ -268,7 +270,7 @@ var MessengerSession = class {
268
270
  }
269
271
  };
270
272
 
271
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/mcp/tools/attachments.js
273
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/tools/attachments.js
272
274
  var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
273
275
  const _command = messenger.app.command;
274
276
  return {
@@ -322,7 +324,7 @@ var attachmentsTools = /* @__PURE__ */ __name((messenger) => {
322
324
  };
323
325
  }, "attachmentsTools");
324
326
 
325
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/mcp/tools/messages-photo.js
327
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/tools/messages-photo.js
326
328
  var PHOTO_LIMIT = 512 * 1024;
327
329
  var IMAGE_TYPES = [
328
330
  ["image/jpeg", (b) => b[0] === 255 && b[1] === 216 && b[2] === 255],
@@ -376,7 +378,7 @@ var readUpTo = /* @__PURE__ */ __name(async (file, limit, saveIt) => {
376
378
  return new Uint8Array(Buffer.concat(chunks));
377
379
  }, "readUpTo");
378
380
 
379
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/mcp/tools/stats.js
381
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/tools/stats.js
380
382
  var statsTools = /* @__PURE__ */ __name((messenger) => ({
381
383
  stats_charts: tool({
382
384
  title: "A chart from a chat's statistics",
@@ -413,14 +415,14 @@ var statsTools = /* @__PURE__ */ __name((messenger) => ({
413
415
  })
414
416
  }), "statsTools");
415
417
 
416
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/mcp/tools.js
418
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/tools.js
417
419
  var pictureTools = /* @__PURE__ */ __name((messenger) => Object.fromEntries(Object.entries({
418
420
  ...messagesPhotoTools(messenger),
419
421
  ...attachmentsTools(messenger),
420
422
  ...statsTools(messenger)
421
423
  }).map(([name, definition]) => [name, { ...definition, input: strictObject(definition.input.entries) }])), "pictureTools");
422
424
 
423
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/mcp/server.js
425
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/mcp/server.js
424
426
  var PER_RUN = /* @__PURE__ */ new Set([
425
427
  "streams",
426
428
  "stdin",
@@ -744,7 +746,7 @@ var serveOverStdio = /* @__PURE__ */ __name(async (command, context, messenger,
744
746
  }, "serveOverStdio");
745
747
  var serveOverHttpUntilStopped = /* @__PURE__ */ __name(async (command, context, messenger, options, http) => {
746
748
  const { session, embedders, build, log } = createServer(command, context, messenger, options);
747
- const { serveOverHttp } = await import("./serve-PP326Q2F.js");
749
+ const { serveOverHttp } = await import("./serve-WYDZTONY.js");
748
750
  const appName = messenger.app.command;
749
751
  const appEnvPrefix = messenger.app.envPrefix;
750
752
  const listening = await serveOverHttp(build, {
@@ -0,0 +1,109 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ CAPABILITY_STATEMENTS,
5
+ storeCapable
6
+ } from "./chunk-E3MFMMVY.js";
7
+ import {
8
+ importFrom
9
+ } from "./chunk-Y5E2WNWB.js";
10
+ import {
11
+ __name
12
+ } from "./chunk-ZVVMGPBJ.js";
13
+
14
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/sqlite-runtime.js
15
+ import { spawn, spawnSync } from "node:child_process";
16
+ import { readFileSync } from "node:fs";
17
+ import { dirname } from "node:path";
18
+ var RESTARTED = "CLI_MESSAGING_SQLITE_RESTARTED";
19
+ var USER_LIBRARY_PATH = "CLI_MESSAGING_USER_LD_LIBRARY_PATH";
20
+ var FORWARDED = ["SIGTERM", "SIGHUP", "SIGQUIT"];
21
+ var ensureSqlite = /* @__PURE__ */ __name(async (runtime = nodeRuntime()) => {
22
+ const { env } = runtime;
23
+ if (env[RESTARTED]) {
24
+ if (env[USER_LIBRARY_PATH] === void 0)
25
+ delete env.LD_LIBRARY_PATH;
26
+ else
27
+ env.LD_LIBRARY_PATH = env[USER_LIBRARY_PATH];
28
+ delete env[USER_LIBRARY_PATH];
29
+ delete env[RESTARTED];
30
+ return;
31
+ }
32
+ if (runtime.bun || runtime.platform !== "linux")
33
+ return;
34
+ const maps = runtime.maps();
35
+ if (!maps.includes("libsqlite3"))
36
+ return;
37
+ if (await runtime.capable())
38
+ return;
39
+ const library = await runtime.library(maps.includes("ld-musl"));
40
+ if (!library)
41
+ return;
42
+ const restarted = {
43
+ ...env,
44
+ LD_LIBRARY_PATH: [dirname(library.path), env.LD_LIBRARY_PATH].filter(Boolean).join(":"),
45
+ [RESTARTED]: "1"
46
+ };
47
+ if (env.LD_LIBRARY_PATH !== void 0)
48
+ restarted[USER_LIBRARY_PATH] = env.LD_LIBRARY_PATH;
49
+ if (!runtime.works(restarted, library.version))
50
+ return;
51
+ await runtime.restart(restarted);
52
+ }, "ensureSqlite");
53
+ var trialScript = /* @__PURE__ */ __name((version) => `
54
+ const { DatabaseSync } = await import("node:sqlite")
55
+ const database = new DatabaseSync(":memory:")
56
+ if (database.prepare("SELECT sqlite_version() AS v").get().v !== ${JSON.stringify(version)}) process.exit(1)
57
+ for (const statement of ${JSON.stringify(CAPABILITY_STATEMENTS)}) database.exec(statement)
58
+ `, "trialScript");
59
+ var nodeRuntime = /* @__PURE__ */ __name(() => ({
60
+ env: process.env,
61
+ platform: process.platform,
62
+ bun: "Bun" in globalThis,
63
+ maps: /* @__PURE__ */ __name(() => {
64
+ try {
65
+ return readFileSync("/proc/self/maps", "utf8");
66
+ } catch {
67
+ return "";
68
+ }
69
+ }, "maps"),
70
+ capable: /* @__PURE__ */ __name(() => storeCapable().then(() => true, () => false), "capable"),
71
+ library: /* @__PURE__ */ __name(async (musl) => {
72
+ try {
73
+ const { libraryFor, SQLITE_VERSION } = await importFrom(new URL("sqlite-runtime.js", import.meta.resolve("@wirecat/cli-core")).href, "@wirecat/cli-core-sqlite");
74
+ const path = libraryFor({ musl });
75
+ return path === void 0 ? void 0 : { path, version: SQLITE_VERSION };
76
+ } catch {
77
+ return void 0;
78
+ }
79
+ }, "library"),
80
+ works: /* @__PURE__ */ __name((env, version) => spawnSync(process.execPath, ["--no-warnings", "--input-type=module", "-e", trialScript(version)], {
81
+ env,
82
+ stdio: "ignore",
83
+ timeout: 1e4
84
+ }).status === 0, "works"),
85
+ restart: /* @__PURE__ */ __name((env) => relay(spawn(process.execPath, [...process.execArgv, ...process.argv.slice(1)], { env, stdio: "inherit" })), "restart")
86
+ }), "nodeRuntime");
87
+ var relay = /* @__PURE__ */ __name((child, host = process) => new Promise(() => {
88
+ for (const signal of FORWARDED)
89
+ host.on(signal, () => child.kill(signal));
90
+ host.on("SIGINT", () => {
91
+ });
92
+ child.on("error", () => host.exit(1));
93
+ child.on("exit", (code, signal) => {
94
+ if (signal) {
95
+ host.removeAllListeners(signal);
96
+ host.kill(host.pid, signal);
97
+ } else
98
+ host.exit(code ?? 1);
99
+ });
100
+ }), "relay");
101
+
102
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/node_modules/@wirecat/cli-core/dist/cli/command-server-argv.js
103
+ var COMMAND_SERVER_ARGV = ["commands", "--serve"];
104
+ var isCommandServer = /* @__PURE__ */ __name((args) => args.length === COMMAND_SERVER_ARGV.length && COMMAND_SERVER_ARGV.every((word, at) => args[at] === word), "isCommandServer");
105
+
106
+ export {
107
+ ensureSqlite,
108
+ isCommandServer
109
+ };
@@ -1,8 +1,5 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
- import {
4
- hostFetch
5
- } from "./chunk-LVGX7VTD.js";
6
3
  import {
7
4
  ADMIN_RIGHTS,
8
5
  BotTokenStore,
@@ -16,7 +13,10 @@ import {
16
13
  privateFiles,
17
14
  providerRequest,
18
15
  withSqliteSidecars
19
- } from "./chunk-DQTQO6PB.js";
16
+ } from "./chunk-SODUFMDW.js";
17
+ import {
18
+ hostFetch
19
+ } from "./chunk-LVGX7VTD.js";
20
20
  import {
21
21
  parseProxy,
22
22
  proxyAddress,
@@ -26,23 +26,23 @@ import {
26
26
  } from "./chunk-FATTEYZH.js";
27
27
  import {
28
28
  messengerContext
29
- } from "./chunk-H5XC2WYO.js";
29
+ } from "./chunk-FZKHFTKH.js";
30
30
  import {
31
31
  uploadBlob
32
- } from "./chunk-7WS3ULOO.js";
32
+ } from "./chunk-6DLRATDC.js";
33
+ import {
34
+ DESKTOP,
35
+ TG
36
+ } from "./chunk-DTTONQW7.js";
33
37
  import {
34
38
  asFirstWord,
35
39
  environmentOf,
36
40
  fromFile,
37
41
  settingsFor
38
- } from "./chunk-THJHYMFR.js";
42
+ } from "./chunk-GJBGZQHN.js";
39
43
  import {
40
44
  currentAttempt
41
- } from "./chunk-KP26Y5OA.js";
42
- import {
43
- DESKTOP,
44
- TG
45
- } from "./chunk-KRCMKFUV.js";
45
+ } from "./chunk-4MFMUBHH.js";
46
46
  import {
47
47
  Credentials,
48
48
  pathsAreOverridden,
@@ -173,7 +173,7 @@ var logOut = /* @__PURE__ */ __name(async (profile, sessionPath, context) => {
173
173
  checks: checkWords("tg", profile),
174
174
  ...keyring ? { keyring } : {}
175
175
  });
176
- const { TelegramAdapter } = await import("./adapter-OJKHXGBC.js");
176
+ const { TelegramAdapter } = await import("./adapter-ZI57T2L5.js");
177
177
  const adapter = await TelegramAdapter.open({ credentials, sessionPath, ...through ? { proxy: through.proxy } : {} });
178
178
  try {
179
179
  await adapter.logout();
@@ -236,7 +236,7 @@ var telegramOf = /* @__PURE__ */ __name((command, base) => {
236
236
  throw new CliError(temporary ? "provider_unavailable" : "authentication_error", loggedIn ? `no Telegram app credentials found for profile "${profile}", although it has logged in on this machine \u2014 the keyring is probably out of reach (cron, ssh, an MCP client that trims the environment: set XDG_RUNTIME_DIR); \`tg ${asFirstWord(profile)}doctor\` shows it. Log in again only if they were removed` : `no Telegram app credentials for profile "${profile}" \u2014 run ${setup} in a local terminal first, or sign in from ${desktop}; agents: read \`tg skill show\``, temporary ? { reason: "credentials.unreachable" } : {});
237
237
  }
238
238
  const options = { credentials: resolved, sessionPath, ...connecting };
239
- return environment.adapter ? await environment.adapter(options) : await (await import("./adapter-OJKHXGBC.js")).TelegramAdapter.open({
239
+ return environment.adapter ? await environment.adapter(options) : await (await import("./adapter-ZI57T2L5.js")).TelegramAdapter.open({
240
240
  ...options,
241
241
  ...proxyOption(proxy()),
242
242
  diagnostic: /* @__PURE__ */ __name((line) => base.streams.diagnostic(line), "diagnostic"),
@@ -961,7 +961,7 @@ var TELEGRAM_BOT = {
961
961
  const botId = token.split(":", 1)[0] ?? "";
962
962
  if (!/^\d+$/.test(botId))
963
963
  throw new CliError("authentication_error", "the bot token has no valid bot id");
964
- const reader = await (environment.botHistory ?? (await import("./bot-history-VVSWLVZM.js")).openBotHistory)({
964
+ const reader = await (environment.botHistory ?? (await import("./bot-history-U3WM3A7S.js")).openBotHistory)({
965
965
  credentials,
966
966
  sessionPath: botSessionFile(profile, botId, env),
967
967
  token,
@@ -981,7 +981,7 @@ var TELEGRAM_BOT = {
981
981
  return void 0;
982
982
  let personal;
983
983
  try {
984
- personal = environment.adapter ? await environment.adapter({ credentials, sessionPath: personalPath }) : await (await import("./adapter-OJKHXGBC.js")).TelegramAdapter.open({
984
+ personal = environment.adapter ? await environment.adapter({ credentials, sessionPath: personalPath }) : await (await import("./adapter-ZI57T2L5.js")).TelegramAdapter.open({
985
985
  credentials,
986
986
  sessionPath: personalPath,
987
987
  checks: words,
@@ -4,7 +4,7 @@ import {
4
4
  __name
5
5
  } from "./chunk-ZVVMGPBJ.js";
6
6
 
7
- // node_modules/.pnpm/@wirecat+cli-core@0.619.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._3343d636b3fedf7ef3285e4c7a47096e/node_modules/@wirecat/cli-core/dist/background/processes.js
7
+ // node_modules/.pnpm/@wirecat+cli-core@0.630.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._c57a4ca23893bad5bbd6c181f9c73774/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) => {