@wirecat/tg-cli 0.119.0 → 0.121.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 (112) hide show
  1. package/contracts/wirecat.json +27 -3
  2. package/dist/bin/tg.js +2 -2
  3. package/dist/bundle/{adapter-NEQQOANM.js → adapter-GVSBFSBY.js} +62 -58
  4. package/dist/bundle/{all-profiles-QFT46FTF.js → all-profiles-CTOGU4XR.js} +10 -10
  5. package/dist/bundle/{anthropic-UJ4RYCWU.js → anthropic-7472H6ES.js} +16 -7
  6. package/dist/bundle/{app-server-NE3EL5IK.js → app-server-GZWV4NPR.js} +47 -46
  7. package/dist/bundle/{bot-api-D4H5SCP5.js → bot-api-PPVAKICN.js} +53 -50
  8. package/dist/bundle/{bot-history-KF2PUMWA.js → bot-history-7YY7MCR4.js} +18 -18
  9. package/dist/bundle/{bun-F7MH5YKA.js → bun-KCN62RMD.js} +2 -2
  10. package/dist/bundle/{bun-sqlite-FYDJXUHF.js → bun-sqlite-2BNE56MY.js} +5 -5
  11. package/dist/bundle/{chunk-23JGV5FQ.js → chunk-24DWSW6H.js} +37 -122
  12. package/dist/bundle/{chunk-6ERQJRL2.js → chunk-3E35VJME.js} +2 -2
  13. package/dist/bundle/{chunk-CX2WCEQU.js → chunk-3EGVR7OF.js} +1795 -545
  14. package/dist/bundle/{chunk-RGU2G3KL.js → chunk-3HNI6GI7.js} +4 -4
  15. package/dist/bundle/{chunk-RUNFFBJU.js → chunk-4HJCWFPN.js} +119 -107
  16. package/dist/bundle/{chunk-7C6POLLO.js → chunk-4J34T6IQ.js} +1 -1
  17. package/dist/bundle/{chunk-QG5U6HCI.js → chunk-4W4EVVL4.js} +4 -4
  18. package/dist/bundle/{chunk-6K5R3YPN.js → chunk-54KFRAHF.js} +2 -2
  19. package/dist/bundle/{chunk-ROOUBFUW.js → chunk-5P43K3GL.js} +18950 -17132
  20. package/dist/bundle/{chunk-OG2CG2GS.js → chunk-6LRKWXCS.js} +17 -17
  21. package/dist/bundle/{chunk-QD27C3BG.js → chunk-6SQAE7NM.js} +10 -8
  22. package/dist/bundle/{chunk-IAGX5VFL.js → chunk-7DPWVKYS.js} +4 -4
  23. package/dist/bundle/{chunk-5EHJWIW4.js → chunk-7I6YVQHW.js} +2 -2
  24. package/dist/bundle/{chunk-ZEQ7ONPZ.js → chunk-7MXRFFIT.js} +3 -3
  25. package/dist/bundle/{chunk-3K65KTXD.js → chunk-7UIMMQOV.js} +2 -2
  26. package/dist/bundle/{chunk-7VUNJDYU.js → chunk-AYDLA27G.js} +4 -4
  27. package/dist/bundle/{chunk-TKHEVAEG.js → chunk-BJTJBNR7.js} +8 -8
  28. package/dist/bundle/{chunk-HPQQ76WF.js → chunk-CLMRF6XR.js} +3 -3
  29. package/dist/bundle/{chunk-D6YTBJY6.js → chunk-CMEWPXKU.js} +1 -1
  30. package/dist/bundle/{chunk-DQELQ7BL.js → chunk-CPDYPZIG.js} +4525 -4753
  31. package/dist/bundle/{chunk-QQ3QZFFD.js → chunk-DAK2J3FG.js} +8 -8
  32. package/dist/bundle/{chunk-S3HAFJVC.js → chunk-DG44ORQ3.js} +86 -29
  33. package/dist/bundle/{chunk-F223KYWG.js → chunk-ESLV57MC.js} +1 -1
  34. package/dist/bundle/{chunk-TEZKCH5B.js → chunk-FATTEYZH.js} +2 -2
  35. package/dist/bundle/{chunk-4AACB23H.js → chunk-FERGNQYA.js} +13 -13
  36. package/dist/bundle/{chunk-HGMMRT4G.js → chunk-GB55EDOF.js} +2 -2
  37. package/dist/bundle/chunk-GNGYV5NX.js +116 -0
  38. package/dist/bundle/{chunk-6OE5I3PR.js → chunk-KKD5ZPGD.js} +6 -6
  39. package/dist/bundle/{chunk-G3MQOH6Z.js → chunk-KPAUPIC3.js} +3 -3
  40. package/dist/bundle/chunk-KVW7LCZK.js +109 -0
  41. package/dist/bundle/{chunk-D4Y2KL5V.js → chunk-LTAHG7BO.js} +4 -4
  42. package/dist/bundle/{chunk-NDSRND3E.js → chunk-LVGX7VTD.js} +4 -4
  43. package/dist/bundle/{chunk-Z4CGZAFQ.js → chunk-M47CXY5J.js} +39 -58
  44. package/dist/bundle/{chunk-L33G5ARH.js → chunk-M73VM67N.js} +1920 -1325
  45. package/dist/bundle/{chunk-JKKEMVW3.js → chunk-MAPJUOTD.js} +4 -4
  46. package/dist/bundle/{chunk-5FEEFXJA.js → chunk-MCPOZNWG.js} +1 -1
  47. package/dist/bundle/{chunk-QTFXYR5W.js → chunk-MKAKM3V7.js} +4 -4
  48. package/dist/bundle/{chunk-FRW3CWC7.js → chunk-NR7PGYPO.js} +44 -42
  49. package/dist/bundle/chunk-PLBEUSZP.js +18 -0
  50. package/dist/bundle/{chunk-FJKP6MMP.js → chunk-QMNUQTA2.js} +2 -2
  51. package/dist/bundle/{chunk-FQ3C6DFV.js → chunk-QNNUNGPL.js} +3 -3
  52. package/dist/bundle/{chunk-CIDFV3IT.js → chunk-QQ264PXQ.js} +1 -1
  53. package/dist/bundle/{chunk-2BAJ6ORN.js → chunk-R6KXHBMW.js} +1 -1
  54. package/dist/bundle/{chunk-72QLHHSO.js → chunk-RPBO5XL3.js} +21 -19
  55. package/dist/bundle/{chunk-KBHK5UGL.js → chunk-RX5CJ55S.js} +1 -1
  56. package/dist/bundle/{chunk-W2BIBPRU.js → chunk-RZX7RDXY.js} +88 -48
  57. package/dist/bundle/{chunk-HV5YYAJX.js → chunk-S7P5X23R.js} +66 -29
  58. package/dist/bundle/{chunk-UBCLVM7C.js → chunk-SHIHW2YN.js} +3 -3
  59. package/dist/bundle/{chunk-YMWPRHXG.js → chunk-SQWTUENZ.js} +2063 -949
  60. package/dist/bundle/{chunk-XM3P7LLT.js → chunk-T7ONSJAA.js} +2 -2
  61. package/dist/bundle/{chunk-X5PDWCG7.js → chunk-TEMCXODM.js} +1 -1
  62. package/dist/bundle/{chunk-V5Z2JO6X.js → chunk-U6HEZPCR.js} +19 -19
  63. package/dist/bundle/{chunk-65BWMPCI.js → chunk-VAAZL6OD.js} +6 -6
  64. package/dist/bundle/{chunk-TT4CIXVH.js → chunk-VPNLTNQD.js} +6 -6
  65. package/dist/bundle/{chunk-SMHLQEE2.js → chunk-VUBZFMGP.js} +2 -2
  66. package/dist/bundle/{chunk-XDMJVWWR.js → chunk-W77WC6ZK.js} +3 -3
  67. package/dist/bundle/{chunk-KC4MQRAB.js → chunk-WGGSFGNZ.js} +8 -8
  68. package/dist/bundle/{chunk-BXIPT2BO.js → chunk-Y4CSR5RP.js} +3 -1
  69. package/dist/bundle/{chunk-3EQ7USKJ.js → chunk-YMJKHMHX.js} +2 -2
  70. package/dist/bundle/{chunk-FQZSS3AB.js → chunk-YRY752BB.js} +6 -6
  71. package/dist/bundle/{chunk-MDLSI3EN.js → chunk-ZSW7LN7T.js} +43 -597
  72. package/dist/bundle/command-contract-3W73W27G.js +33 -0
  73. package/dist/bundle/command-server-entry-37PKBJ5A.js +146 -0
  74. package/dist/bundle/{decode-5N4ERCHC.js → decode-F7KC7WT4.js} +5 -5
  75. package/dist/bundle/{dispatch-TBGXBDHE.js → dispatch-U2DW6UI7.js} +8 -8
  76. package/dist/bundle/{echarts-YDEBAMXT.js → echarts-4VYG66GX.js} +2 -2
  77. package/dist/bundle/{embed-T7H62XFR.js → embed-ENZ6R4HF.js} +6 -6
  78. package/dist/bundle/{embedder-AW3O2TR3.js → embedder-4CBICMFO.js} +9 -9
  79. package/dist/bundle/entry-XQ562EDO.js +21 -0
  80. package/dist/bundle/{failure-AWHPW2HE.js → failure-HJD7S5UA.js} +2 -2
  81. package/dist/bundle/{first-run-6PBZSRZU.js → first-run-PPXOC6ID.js} +11 -11
  82. package/dist/bundle/first-screen-JC6BYZYD.js +31 -0
  83. package/dist/bundle/{instructions-C3NJERO7.js → instructions-XLCMJ5PJ.js} +1 -1
  84. package/dist/bundle/{mcp-CWLASTLV.js → mcp-7KQUJNFN.js} +2 -2
  85. package/dist/bundle/{node-P3CIIYWU.js → node-SSAC67R5.js} +2 -2
  86. package/dist/bundle/{node-sqlite-YVHMNRVA.js → node-sqlite-SUUUSYSZ.js} +6 -6
  87. package/dist/bundle/{oauth-5OQYA2SV.js → oauth-2ZNHMPEX.js} +7 -7
  88. package/dist/bundle/{open-YGWUVSU7.js → open-EFNT7V2Q.js} +5 -5
  89. package/dist/bundle/{openai-U45JBQ6F.js → openai-7STFVJXA.js} +16 -16
  90. package/dist/bundle/{process-DCYX5EDG.js → process-63F4PNWH.js} +1 -1
  91. package/dist/bundle/{program-UZBFH2EZ.js → program-C2E3TQNK.js} +70 -67
  92. package/dist/bundle/{prompt-HPVTPTFI.js → prompt-QPO7EKD5.js} +5 -5
  93. package/dist/bundle/{proxy-transport-D7MCHGSV.js → proxy-transport-ENU2SJYT.js} +5 -5
  94. package/dist/bundle/{recognize-IJCPFJ76.js → recognize-MLXEHFYL.js} +4 -4
  95. package/dist/bundle/{remote-MWDYQWFW.js → remote-DO7FLJEF.js} +7 -7
  96. package/dist/bundle/{rerank-SXG64475.js → rerank-W3WSBDAM.js} +7 -7
  97. package/dist/bundle/{serve-KJQENHEH.js → serve-Z3TOTEMQ.js} +14 -14
  98. package/dist/bundle/{server-MXVXZWN6.js → server-BYSOJCUA.js} +36 -36
  99. package/dist/bundle/server-IRUVLXD4.js +61 -0
  100. package/dist/bundle/{state-CKKJWH27.js → state-PKRPBCMY.js} +6 -6
  101. package/dist/bundle/{store-R3BE4V56.js → store-Y4G7CNJT.js} +13 -13
  102. package/dist/bundle/store-maintenance-command-PHK43OSM.js +49 -0
  103. package/dist/bundle/tg.js +13 -13
  104. package/dist/version.d.ts +1 -1
  105. package/dist/version.js +1 -1
  106. package/package.json +3 -3
  107. package/dist/bundle/command-contract-7TGMZRBE.js +0 -33
  108. package/dist/bundle/entry-L2LJ2VPY.js +0 -18
  109. package/dist/bundle/first-screen-UKCD7D2R.js +0 -31
  110. package/dist/bundle/server-RTMCRKQF.js +0 -60
  111. package/dist/bundle/store-maintenance-command-KDGBSBNU.js +0 -49
  112. /package/dist/bundle/{chunk-DWX4DE2I.js → chunk-YVNHQFLC.js} +0 -0
@@ -18,12 +18,12 @@ import {
18
18
  jitCompatCheck,
19
19
  refineSqliteCodecs,
20
20
  sql
21
- } from "./chunk-X5PDWCG7.js";
21
+ } from "./chunk-TEMCXODM.js";
22
22
  import {
23
23
  __name
24
24
  } from "./chunk-ZVVMGPBJ.js";
25
25
 
26
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.87.0_commander@15._c25084c4731872baba927966435ce31d/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/bun.js
26
+ // node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/store/sqlite/drizzle/bun.js
27
27
  import { Database } from "bun:sqlite";
28
28
  var bunSQLiteCodecs = refineSqliteCodecs({
29
29
  "integer:boolean": { normalize: booleanFromInteger },
@@ -3,18 +3,18 @@ const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  loadVectorExtension,
5
5
  vectorExtension
6
- } from "./chunk-3EQ7USKJ.js";
7
- import "./chunk-V5Z2JO6X.js";
8
- import "./chunk-KC4MQRAB.js";
6
+ } from "./chunk-YMJKHMHX.js";
7
+ import "./chunk-U6HEZPCR.js";
8
+ import "./chunk-WGGSFGNZ.js";
9
9
  import {
10
10
  importFrom
11
11
  } from "./chunk-Y5E2WNWB.js";
12
- import "./chunk-SMHLQEE2.js";
12
+ import "./chunk-VUBZFMGP.js";
13
13
  import {
14
14
  __name
15
15
  } from "./chunk-ZVVMGPBJ.js";
16
16
 
17
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.87.0_commander@15._c25084c4731872baba927966435ce31d/node_modules/@wirecat/cli-core/dist/store/drivers/bun-sqlite.js
17
+ // node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/store/drivers/bun-sqlite.js
18
18
  var customised = false;
19
19
  var ownLibrary = /* @__PURE__ */ __name(async () => {
20
20
  try {
@@ -1,118 +1,27 @@
1
1
  import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ ensureSqlite,
5
+ isCommandServer
6
+ } from "./chunk-KVW7LCZK.js";
3
7
  import {
4
8
  envName,
5
9
  readOnlyLockOf
6
- } from "./chunk-6ERQJRL2.js";
7
- import {
8
- CAPABILITY_STATEMENTS,
9
- storeCapable
10
- } from "./chunk-TT4CIXVH.js";
10
+ } from "./chunk-3E35VJME.js";
11
11
  import {
12
12
  catchCrashes
13
- } from "./chunk-KC4MQRAB.js";
14
- import {
15
- importFrom
16
- } from "./chunk-Y5E2WNWB.js";
13
+ } from "./chunk-WGGSFGNZ.js";
17
14
  import {
18
15
  CliError
19
- } from "./chunk-SMHLQEE2.js";
16
+ } from "./chunk-VUBZFMGP.js";
20
17
  import {
21
18
  __name
22
19
  } from "./chunk-ZVVMGPBJ.js";
23
20
 
24
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.87.0_commander@15._c25084c4731872baba927966435ce31d/node_modules/@wirecat/cli-core/dist/cli/entry.js
25
- import { spawn as spawn2 } from "node:child_process";
21
+ // node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/cli/entry.js
22
+ import { spawn } from "node:child_process";
26
23
 
27
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.87.0_commander@15._c25084c4731872baba927966435ce31d/node_modules/@wirecat/cli-core/dist/sqlite-runtime.js
28
- import { spawn, spawnSync } from "node:child_process";
29
- import { readFileSync } from "node:fs";
30
- import { dirname } from "node:path";
31
- var RESTARTED = "CLI_MESSAGING_SQLITE_RESTARTED";
32
- var USER_LIBRARY_PATH = "CLI_MESSAGING_USER_LD_LIBRARY_PATH";
33
- var FORWARDED = ["SIGTERM", "SIGHUP", "SIGQUIT"];
34
- var ensureSqlite = /* @__PURE__ */ __name(async (runtime = nodeRuntime()) => {
35
- const { env } = runtime;
36
- if (env[RESTARTED]) {
37
- if (env[USER_LIBRARY_PATH] === void 0)
38
- delete env.LD_LIBRARY_PATH;
39
- else
40
- env.LD_LIBRARY_PATH = env[USER_LIBRARY_PATH];
41
- delete env[USER_LIBRARY_PATH];
42
- delete env[RESTARTED];
43
- return;
44
- }
45
- if (runtime.bun || runtime.platform !== "linux")
46
- return;
47
- const maps = runtime.maps();
48
- if (!maps.includes("libsqlite3"))
49
- return;
50
- if (await runtime.capable())
51
- return;
52
- const library = await runtime.library(maps.includes("ld-musl"));
53
- if (!library)
54
- return;
55
- const restarted = {
56
- ...env,
57
- LD_LIBRARY_PATH: [dirname(library.path), env.LD_LIBRARY_PATH].filter(Boolean).join(":"),
58
- [RESTARTED]: "1"
59
- };
60
- if (env.LD_LIBRARY_PATH !== void 0)
61
- restarted[USER_LIBRARY_PATH] = env.LD_LIBRARY_PATH;
62
- if (!runtime.works(restarted, library.version))
63
- return;
64
- await runtime.restart(restarted);
65
- }, "ensureSqlite");
66
- var trialScript = /* @__PURE__ */ __name((version) => `
67
- const { DatabaseSync } = await import("node:sqlite")
68
- const database = new DatabaseSync(":memory:")
69
- if (database.prepare("SELECT sqlite_version() AS v").get().v !== ${JSON.stringify(version)}) process.exit(1)
70
- for (const statement of ${JSON.stringify(CAPABILITY_STATEMENTS)}) database.exec(statement)
71
- `, "trialScript");
72
- var nodeRuntime = /* @__PURE__ */ __name(() => ({
73
- env: process.env,
74
- platform: process.platform,
75
- bun: "Bun" in globalThis,
76
- maps: /* @__PURE__ */ __name(() => {
77
- try {
78
- return readFileSync("/proc/self/maps", "utf8");
79
- } catch {
80
- return "";
81
- }
82
- }, "maps"),
83
- capable: /* @__PURE__ */ __name(() => storeCapable().then(() => true, () => false), "capable"),
84
- library: /* @__PURE__ */ __name(async (musl) => {
85
- try {
86
- const { libraryFor, SQLITE_VERSION } = await importFrom(new URL("sqlite-runtime.js", import.meta.resolve("@wirecat/cli-core")).href, "@wirecat/cli-core-sqlite");
87
- const path = libraryFor({ musl });
88
- return path === void 0 ? void 0 : { path, version: SQLITE_VERSION };
89
- } catch {
90
- return void 0;
91
- }
92
- }, "library"),
93
- works: /* @__PURE__ */ __name((env, version) => spawnSync(process.execPath, ["--no-warnings", "--input-type=module", "-e", trialScript(version)], {
94
- env,
95
- stdio: "ignore",
96
- timeout: 1e4
97
- }).status === 0, "works"),
98
- restart: /* @__PURE__ */ __name((env) => relay(spawn(process.execPath, [...process.execArgv, ...process.argv.slice(1)], { env, stdio: "inherit" })), "restart")
99
- }), "nodeRuntime");
100
- var relay = /* @__PURE__ */ __name((child, host = process) => new Promise(() => {
101
- for (const signal of FORWARDED)
102
- host.on(signal, () => child.kill(signal));
103
- host.on("SIGINT", () => {
104
- });
105
- child.on("error", () => host.exit(1));
106
- child.on("exit", (code, signal) => {
107
- if (signal) {
108
- host.removeAllListeners(signal);
109
- host.kill(host.pid, signal);
110
- } else
111
- host.exit(code ?? 1);
112
- });
113
- }), "relay");
114
-
115
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.87.0_commander@15._c25084c4731872baba927966435ce31d/node_modules/@wirecat/cli-core/dist/cli/argv-log.js
24
+ // node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/cli/argv-log.js
116
25
  import { appendFileSync } from "node:fs";
117
26
  var logParsedArgv = /* @__PURE__ */ __name((file, action) => {
118
27
  const words = [];
@@ -136,7 +45,7 @@ var logVersion = /* @__PURE__ */ __name((file) => {
136
45
  `);
137
46
  }, "logVersion");
138
47
 
139
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.87.0_commander@15._c25084c4731872baba927966435ce31d/node_modules/@wirecat/cli-core/dist/cli/entry.js
48
+ // node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/node_modules/@wirecat/cli-core/dist/cli/entry.js
140
49
  var processIo = /* @__PURE__ */ __name(() => ({
141
50
  argv: process.argv,
142
51
  env: process.env,
@@ -148,13 +57,17 @@ var processIo = /* @__PURE__ */ __name(() => ({
148
57
  setExitCode: /* @__PURE__ */ __name((code) => {
149
58
  process.exitCode = code;
150
59
  }, "setExitCode"),
151
- spawn: spawn2
60
+ spawn
152
61
  }), "processIo");
153
62
  var startCli = /* @__PURE__ */ __name(async (entry) => {
154
63
  const io = { ...processIo(), ...entry.io };
155
64
  const args = io.argv.slice(2);
156
65
  if (args.length === 1 && (args[0] === "--version" || args[0] === "-V"))
157
66
  return printVersion(entry.app, io);
67
+ if (isCommandServer(args)) {
68
+ const { serveEntry } = await import("./command-server-entry-37PKBJ5A.js");
69
+ return serveEntry(entry, io, { firstRunAt, commanderExit });
70
+ }
158
71
  const tty = io.stdout.isTTY === true;
159
72
  const release = catchCrashes({
160
73
  cli: entry.app.command,
@@ -186,27 +99,11 @@ var startCli = /* @__PURE__ */ __name(async (entry) => {
186
99
  env: io.env,
187
100
  tty,
188
101
  signal: controller.signal,
189
- atStart: /* @__PURE__ */ __name(async (command) => {
190
- if (command.optsWithGlobals().dryRun === true)
191
- return;
192
- const [{ setupAtStart }, { commandPathOf }] = await Promise.all([
193
- import("./first-run-6PBZSRZU.js"),
194
- import("./command-contract-7TGMZRBE.js")
195
- ]);
196
- await setupAtStart({
197
- command: entry.app.command,
198
- env: io.env,
199
- contentLanguages: entry.app.contentLanguages,
200
- path: commandPathOf(command),
201
- headless: headless(command),
202
- readOnlyLock: readOnlyLockOf(entry.app, io.env),
203
- input: io.stdin
204
- });
205
- }, "atStart"),
102
+ atStart: firstRunAt(entry, io, headless),
206
103
  ask: /* @__PURE__ */ __name(async (question, command) => {
207
104
  if (headless(command) || io.stdin.isTTY !== true)
208
105
  return false;
209
- const { readSecret } = await import("./prompt-HPVTPTFI.js");
106
+ const { readSecret } = await import("./prompt-QPO7EKD5.js");
210
107
  const answer = await readSecret(`${question} [y/N] `, {
211
108
  input: io.stdin,
212
109
  output: io.stderr,
@@ -244,6 +141,23 @@ var startCli = /* @__PURE__ */ __name(async (entry) => {
244
141
  else if (code !== void 0)
245
142
  io.setExitCode(code);
246
143
  }, "startCli");
144
+ var firstRunAt = /* @__PURE__ */ __name((entry, io, headless) => async (command) => {
145
+ if (command.optsWithGlobals().dryRun === true)
146
+ return;
147
+ const [{ setupAtStart }, { commandPathOf }] = await Promise.all([
148
+ import("./first-run-PPXOC6ID.js"),
149
+ import("./command-contract-3W73W27G.js")
150
+ ]);
151
+ await setupAtStart({
152
+ command: entry.app.command,
153
+ env: io.env,
154
+ contentLanguages: entry.app.contentLanguages,
155
+ path: commandPathOf(command),
156
+ headless: headless(command),
157
+ readOnlyLock: readOnlyLockOf(entry.app, io.env),
158
+ input: io.stdin
159
+ });
160
+ }, "firstRunAt");
247
161
  var printVersion = /* @__PURE__ */ __name((app, io) => {
248
162
  const argvLog = io.env[envName(app, "TEST_ARGV_LOG")];
249
163
  if (argvLog)
@@ -261,7 +175,7 @@ var commanderExit = /* @__PURE__ */ __name((error) => {
261
175
  return 0;
262
176
  return code === "commander.help" ? 2 : void 0;
263
177
  }, "commanderExit");
264
- var openBrowser = /* @__PURE__ */ __name((url, browser, io = { platform: process.platform, spawn: spawn2 }) => {
178
+ var openBrowser = /* @__PURE__ */ __name((url, browser, io = { platform: process.platform, spawn }) => {
265
179
  const [command, prefix] = browser !== void 0 ? [browser, []] : io.platform === "darwin" ? ["open", []] : io.platform === "win32" ? ["rundll32.exe", ["url.dll,FileProtocolHandler"]] : ["xdg-open", []];
266
180
  return new Promise((resolve, reject) => {
267
181
  const child = io.spawn(command, [...prefix, url], { detached: true, stdio: "ignore", windowsHide: true });
@@ -277,5 +191,6 @@ export {
277
191
  logParsedArgv,
278
192
  logVersion,
279
193
  startCli,
194
+ firstRunAt,
280
195
  openBrowser
281
196
  };
@@ -2,12 +2,12 @@ import { createRequire as __bundleRequire } from "node:module";
2
2
  const require = __bundleRequire(import.meta.url);
3
3
  import {
4
4
  CliError
5
- } from "./chunk-SMHLQEE2.js";
5
+ } from "./chunk-VUBZFMGP.js";
6
6
  import {
7
7
  __name
8
8
  } from "./chunk-ZVVMGPBJ.js";
9
9
 
10
- // node_modules/.pnpm/@wirecat+cli-core@0.618.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.87.0_commander@15._c25084c4731872baba927966435ce31d/node_modules/@wirecat/cli-core/dist/ports/app.js
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.624.0_@napi-rs+canvas@1.0.13_@wirecat+cli-base@0.93.0_commander@15._325ff8c9daf4b8769887d5253d3c1255/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");