@wirecat/drive-cli 0.44.0 → 0.45.1

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 (168) hide show
  1. package/dist/bin/drive.js +35 -40
  2. package/dist/bundle/all-profiles-O7CNQ7FO.js +26 -0
  3. package/dist/bundle/anthropic-6T67J2CE.js +71 -0
  4. package/dist/bundle/app-server-BVBZT3UY.js +237 -0
  5. package/dist/bundle/bun-O6RL6LRQ.js +169 -0
  6. package/dist/bundle/bun-sqlite-54W7JUY3.js +70 -0
  7. package/dist/bundle/chunk-2DLAJGRN.js +62 -0
  8. package/dist/bundle/chunk-37MAA6F2.js +5624 -0
  9. package/dist/bundle/chunk-3HRDEJJW.js +161 -0
  10. package/dist/bundle/chunk-3Z7WSD2A.js +433 -0
  11. package/dist/bundle/chunk-44FV5JAS.js +1855 -0
  12. package/dist/bundle/chunk-4DW6QGEV.js +164 -0
  13. package/dist/bundle/chunk-4NGLRHWO.js +24 -0
  14. package/dist/bundle/chunk-5DPV7X27.js +663 -0
  15. package/dist/bundle/chunk-5FONRUG6.js +24805 -0
  16. package/dist/bundle/chunk-5MGIL5LW.js +846 -0
  17. package/dist/bundle/chunk-5TC3NCAF.js +42 -0
  18. package/dist/bundle/chunk-6Y2BYFXQ.js +65 -0
  19. package/dist/bundle/chunk-A3FU4RR6.js +150 -0
  20. package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
  21. package/dist/bundle/chunk-AIXLOMH4.js +63 -0
  22. package/dist/bundle/chunk-AOOD3RMK.js +384 -0
  23. package/dist/bundle/chunk-AUS6TKP5.js +1975 -0
  24. package/dist/bundle/chunk-B2J6FJNL.js +19 -0
  25. package/dist/bundle/chunk-BEXHAGXH.js +3542 -0
  26. package/dist/bundle/chunk-BHE7ZY2N.js +2352 -0
  27. package/dist/bundle/chunk-BJ3JRO34.js +2356 -0
  28. package/dist/bundle/chunk-BQUPOB5H.js +2315 -0
  29. package/dist/bundle/chunk-CFZWPIVC.js +1092 -0
  30. package/dist/bundle/chunk-CKR3DVUK.js +754 -0
  31. package/dist/bundle/chunk-CVIKKIGE.js +76 -0
  32. package/dist/bundle/chunk-D67JGWSC.js +190 -0
  33. package/dist/bundle/chunk-DDYR6DYL.js +78 -0
  34. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  35. package/dist/bundle/chunk-DL7D6Y3B.js +18102 -0
  36. package/dist/bundle/chunk-DORXXBFC.js +484 -0
  37. package/dist/bundle/chunk-DXKVEOSS.js +53 -0
  38. package/dist/bundle/chunk-DXQEJWI3.js +522 -0
  39. package/dist/bundle/chunk-FEULDMWM.js +35598 -0
  40. package/dist/bundle/chunk-G3FAOS52.js +630 -0
  41. package/dist/bundle/chunk-GHOWRW7E.js +237 -0
  42. package/dist/bundle/chunk-GNFHZZ55.js +264 -0
  43. package/dist/bundle/chunk-GNI7INK6.js +18 -0
  44. package/dist/bundle/chunk-GOR3Z2FR.js +17 -0
  45. package/dist/bundle/chunk-GQW4GRYR.js +886 -0
  46. package/dist/bundle/chunk-GWPKIRNQ.js +220 -0
  47. package/dist/bundle/chunk-GYCUY4CL.js +9 -0
  48. package/dist/bundle/chunk-HEPIOCHN.js +8181 -0
  49. package/dist/bundle/chunk-HTQTIKWP.js +928 -0
  50. package/dist/bundle/chunk-IAW5A7OR.js +1913 -0
  51. package/dist/bundle/chunk-IGMRWQP3.js +1071 -0
  52. package/dist/bundle/chunk-IKNU5A5Y.js +82 -0
  53. package/dist/bundle/chunk-JVTVAZ5X.js +1054 -0
  54. package/dist/bundle/chunk-K74PQVQZ.js +168 -0
  55. package/dist/bundle/chunk-K7FRUB33.js +795 -0
  56. package/dist/bundle/chunk-KADPV4YA.js +45 -0
  57. package/dist/bundle/chunk-KJMBV574.js +16225 -0
  58. package/dist/bundle/chunk-LHIL46I3.js +31 -0
  59. package/dist/bundle/chunk-LJARCTGL.js +60 -0
  60. package/dist/bundle/chunk-LOTQ2HMT.js +3954 -0
  61. package/dist/bundle/chunk-MAXN7COO.js +99 -0
  62. package/dist/bundle/chunk-MFS52LTZ.js +570 -0
  63. package/dist/bundle/chunk-MFSIOSUM.js +1714 -0
  64. package/dist/bundle/chunk-NB2N6L3R.js +138 -0
  65. package/dist/bundle/chunk-NDNTLUPS.js +58 -0
  66. package/dist/bundle/chunk-NLEB26GA.js +288 -0
  67. package/dist/bundle/chunk-NP3XLLN3.js +73 -0
  68. package/dist/bundle/chunk-NW7IMGRR.js +6848 -0
  69. package/dist/bundle/chunk-O5EHUB2V.js +2 -0
  70. package/dist/bundle/chunk-OWXTPXIQ.js +215 -0
  71. package/dist/bundle/chunk-PDBBBUY7.js +166 -0
  72. package/dist/bundle/chunk-PH74B2VZ.js +122 -0
  73. package/dist/bundle/chunk-PJ7IQVOM.js +421 -0
  74. package/dist/bundle/chunk-Q2Z3VCM4.js +2 -0
  75. package/dist/bundle/chunk-QTJUH3LS.js +15572 -0
  76. package/dist/bundle/chunk-QW36EOAM.js +106 -0
  77. package/dist/bundle/chunk-QWSRPXCJ.js +281 -0
  78. package/dist/bundle/chunk-R2A3K7ZF.js +193 -0
  79. package/dist/bundle/chunk-R2QRP7EJ.js +835 -0
  80. package/dist/bundle/chunk-RCS2SCX5.js +375 -0
  81. package/dist/bundle/chunk-RJ633GFA.js +25 -0
  82. package/dist/bundle/chunk-SBZB7HMU.js +1055 -0
  83. package/dist/bundle/chunk-SMHQA5J6.js +459 -0
  84. package/dist/bundle/chunk-SWMMR3FR.js +48 -0
  85. package/dist/bundle/chunk-TRMIV3OA.js +18 -0
  86. package/dist/bundle/chunk-VAGF723Z.js +74 -0
  87. package/dist/bundle/chunk-VCYFEWPD.js +18078 -0
  88. package/dist/bundle/chunk-VHQNVG3J.js +263 -0
  89. package/dist/bundle/chunk-VHT2WI4I.js +2941 -0
  90. package/dist/bundle/chunk-VYBOYBLX.js +100 -0
  91. package/dist/bundle/chunk-WUFCYDKB.js +71 -0
  92. package/dist/bundle/chunk-XAZQTJXR.js +3402 -0
  93. package/dist/bundle/chunk-XEBFFKXO.js +111 -0
  94. package/dist/bundle/chunk-XF5MFUEB.js +498 -0
  95. package/dist/bundle/chunk-XFLCVHSQ.js +50 -0
  96. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  97. package/dist/bundle/chunk-ZBM4GEV2.js +120 -0
  98. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  99. package/dist/bundle/command-contract-MXCBV3GJ.js +38 -0
  100. package/dist/bundle/dist-MWTMOYWT.js +7577 -0
  101. package/dist/bundle/dist-PY3MVR3G.js +21 -0
  102. package/dist/bundle/drive.js +50 -0
  103. package/dist/bundle/echarts-LD3AI55P.js +42501 -0
  104. package/dist/bundle/embed-FJKIIM43.js +37 -0
  105. package/dist/bundle/embedder-NNQ5ZC25.js +110 -0
  106. package/dist/bundle/entry-ZYSNPDSD.js +15 -0
  107. package/dist/bundle/failure-MJJXFR63.js +37 -0
  108. package/dist/bundle/first-run-KA2UPZAU.js +24 -0
  109. package/dist/bundle/first-screen-VQ3RXDMF.js +36 -0
  110. package/dist/bundle/google-ZYDFTHLN.js +32 -0
  111. package/dist/bundle/google-api-2GT5PAW2.js +82 -0
  112. package/dist/bundle/identity-JQFQXQIR.js +10 -0
  113. package/dist/bundle/instructions-RZMSW3OC.js +11 -0
  114. package/dist/bundle/login-JU6NKW5P.js +158 -0
  115. package/dist/bundle/mcp-2PZDI7WE.js +501 -0
  116. package/dist/bundle/mcp-JOQMFGBC.js +95 -0
  117. package/dist/bundle/mcp-OQBZXELQ.js +165 -0
  118. package/dist/bundle/mdast-util-from-markdown-FXEPSNER.js +1958 -0
  119. package/dist/bundle/mdast-util-gfm-SZM5GBDF.js +2103 -0
  120. package/dist/bundle/micromark-extension-gfm-GRL24TU6.js +1838 -0
  121. package/dist/bundle/node-P4E63KXA.js +2340 -0
  122. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  123. package/dist/bundle/node-ZRLYQL7J.js +176 -0
  124. package/dist/bundle/node-sqlite-TXPSRROT.js +46 -0
  125. package/dist/bundle/oauth-NAIBKERJ.js +18 -0
  126. package/dist/bundle/open-3P5EPXPV.js +20 -0
  127. package/dist/bundle/process-LL77573L.js +91 -0
  128. package/dist/bundle/program-CZ55L6EW.js +24078 -0
  129. package/dist/bundle/prompt-3TX2SWOY.js +13 -0
  130. package/dist/bundle/reasons-GF2TYGX6.js +11 -0
  131. package/dist/bundle/recognize-IFXOJHEA.js +191 -0
  132. package/dist/bundle/remote-663M42Y5.js +28 -0
  133. package/dist/bundle/rerank-OT2F2DBV.js +51 -0
  134. package/dist/bundle/serve-PDNNI6O6.js +20 -0
  135. package/dist/bundle/server-BFOEPMR7.js +56 -0
  136. package/dist/bundle/server-K566PJ7H.js +69 -0
  137. package/dist/bundle/services-5MCTECBU.js +333 -0
  138. package/dist/bundle/sqlite-runtime-BF3KDM7W.js +17 -0
  139. package/dist/bundle/state-SZX65E74.js +34 -0
  140. package/dist/bundle/store-TCWNLA3V.js +125 -0
  141. package/dist/bundle/store-UKPGGAPW.js +142 -0
  142. package/dist/bundle/store-maintenance-command-QHLUVBTJ.js +57 -0
  143. package/dist/bundle/terminal-TFCTWLOS.js +11 -0
  144. package/dist/bundle/tokens-DFCFRF7I.js +103 -0
  145. package/dist/commands/mcp.d.ts.map +1 -1
  146. package/dist/commands/mcp.js +82 -36
  147. package/dist/commands/mcp.js.map +1 -1
  148. package/dist/contract-overrides.d.ts.map +1 -1
  149. package/dist/contract-overrides.js +59 -53
  150. package/dist/contract-overrides.js.map +1 -1
  151. package/dist/mcp.d.ts +6 -5
  152. package/dist/mcp.d.ts.map +1 -1
  153. package/dist/mcp.js +13 -10
  154. package/dist/mcp.js.map +1 -1
  155. package/dist/program.js +4 -4
  156. package/dist/program.js.map +1 -1
  157. package/dist/registry.d.ts +2 -2
  158. package/dist/registry.d.ts.map +1 -1
  159. package/dist/registry.js +3 -3
  160. package/dist/registry.js.map +1 -1
  161. package/dist/state.d.ts +13 -2
  162. package/dist/state.d.ts.map +1 -1
  163. package/dist/state.js +12 -2
  164. package/dist/state.js.map +1 -1
  165. package/dist/version.d.ts +1 -1
  166. package/dist/version.js +1 -1
  167. package/package.json +7 -5
  168. package/skills/drive-cli/SKILL.md +1 -0
@@ -0,0 +1,42 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ CliError
5
+ } from "./chunk-BJ3JRO34.js";
6
+ import {
7
+ __name
8
+ } from "./chunk-ZVVMGPBJ.js";
9
+
10
+ // node_modules/.pnpm/@wirecat+cli-core@0.473.0_@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_type_39633e3162553a2c86dde989a9811fcb/node_modules/@wirecat/cli-core/dist/attachments/limits.js
11
+ var MAX_FILE_BYTES = 50 * 1024 * 1024;
12
+ var MAX_TEXT_CHARS = 2e6;
13
+ var ATTACHMENT_LIMIT_ENV = [
14
+ "MESSAGING_BATCH_MAX_ERROR_PERCENT",
15
+ "MESSAGING_ATTACHMENT_MAX_MIB",
16
+ "MESSAGING_PDF_PREVIEW_MAX_PIXELS",
17
+ "MESSAGING_PDF_PREVIEW_MAX_MIB"
18
+ ];
19
+ var positive = /* @__PURE__ */ __name((env, name, fallback, factor = 1) => {
20
+ const raw = env[name];
21
+ if (raw === void 0)
22
+ return fallback;
23
+ const value = Number(raw);
24
+ if (!/^[0-9]+$/.test(raw) || value < 1 || !Number.isSafeInteger(value * factor))
25
+ throw new CliError("validation_error", `${name} must be a positive whole number within the safe numeric range`);
26
+ return value * factor;
27
+ }, "positive");
28
+ var attachmentMaxBytes = /* @__PURE__ */ __name((env = process.env) => positive(env, "MESSAGING_ATTACHMENT_MAX_MIB", MAX_FILE_BYTES, 1024 * 1024), "attachmentMaxBytes");
29
+ var pdfPreviewLimits = /* @__PURE__ */ __name((env = process.env) => {
30
+ const pixels = positive(env, "MESSAGING_PDF_PREVIEW_MAX_PIXELS", 4e3);
31
+ if (!Number.isSafeInteger(pixels * pixels))
32
+ throw new CliError("validation_error", "MESSAGING_PDF_PREVIEW_MAX_PIXELS squared must fit the safe numeric range");
33
+ return { pixels, bytes: positive(env, "MESSAGING_PDF_PREVIEW_MAX_MIB", 8 * 1024 * 1024, 1024 * 1024) };
34
+ }, "pdfPreviewLimits");
35
+
36
+ export {
37
+ MAX_FILE_BYTES,
38
+ MAX_TEXT_CHARS,
39
+ ATTACHMENT_LIMIT_ENV,
40
+ attachmentMaxBytes,
41
+ pdfPreviewLimits
42
+ };
@@ -0,0 +1,65 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ __name
5
+ } from "./chunk-ZVVMGPBJ.js";
6
+
7
+ // node_modules/.pnpm/micromark-util-normalize-identifier@2.0.1/node_modules/micromark-util-normalize-identifier/index.js
8
+ function normalizeIdentifier(value) {
9
+ return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
10
+ }
11
+ __name(normalizeIdentifier, "normalizeIdentifier");
12
+
13
+ // node_modules/.pnpm/micromark-util-character@2.1.1/node_modules/micromark-util-character/index.js
14
+ var asciiAlpha = regexCheck(/[A-Za-z]/);
15
+ var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
16
+ var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
17
+ function asciiControl(code) {
18
+ return (
19
+ // Special whitespace codes (which have negative values), C0 and Control
20
+ // character DEL
21
+ code !== null && (code < 32 || code === 127)
22
+ );
23
+ }
24
+ __name(asciiControl, "asciiControl");
25
+ var asciiDigit = regexCheck(/\d/);
26
+ var asciiHexDigit = regexCheck(/[\dA-Fa-f]/);
27
+ var asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);
28
+ function markdownLineEnding(code) {
29
+ return code !== null && code < -2;
30
+ }
31
+ __name(markdownLineEnding, "markdownLineEnding");
32
+ function markdownLineEndingOrSpace(code) {
33
+ return code !== null && (code < 0 || code === 32);
34
+ }
35
+ __name(markdownLineEndingOrSpace, "markdownLineEndingOrSpace");
36
+ function markdownSpace(code) {
37
+ return code === -2 || code === -1 || code === 32;
38
+ }
39
+ __name(markdownSpace, "markdownSpace");
40
+ var unicodePunctuation = regexCheck(new RegExp("\\p{P}|\\p{S}", "u"));
41
+ var unicodeWhitespace = regexCheck(/\s/);
42
+ function regexCheck(regex) {
43
+ return check;
44
+ function check(code) {
45
+ return code !== null && code > -1 && regex.test(String.fromCharCode(code));
46
+ }
47
+ __name(check, "check");
48
+ }
49
+ __name(regexCheck, "regexCheck");
50
+
51
+ export {
52
+ normalizeIdentifier,
53
+ asciiAlpha,
54
+ asciiAlphanumeric,
55
+ asciiAtext,
56
+ asciiControl,
57
+ asciiDigit,
58
+ asciiHexDigit,
59
+ asciiPunctuation,
60
+ markdownLineEnding,
61
+ markdownLineEndingOrSpace,
62
+ markdownSpace,
63
+ unicodePunctuation,
64
+ unicodeWhitespace
65
+ };
@@ -0,0 +1,150 @@
1
+ import { createRequire as __bundleRequire } from "node:module";
2
+ const require = __bundleRequire(import.meta.url);
3
+ import {
4
+ executableEnvironment,
5
+ executableOnPath,
6
+ require_cross_spawn
7
+ } from "./chunk-MFS52LTZ.js";
8
+ import {
9
+ loadConfigFile,
10
+ saveConfigFile
11
+ } from "./chunk-VHT2WI4I.js";
12
+ import {
13
+ number,
14
+ object,
15
+ optional,
16
+ string
17
+ } from "./chunk-BJ3JRO34.js";
18
+ import {
19
+ __name,
20
+ __toESM
21
+ } from "./chunk-ZVVMGPBJ.js";
22
+
23
+ // node_modules/.pnpm/@wirecat+cli-base@0.65.0_commander@15.0.0_esbuild@0.28.2_typescript@7.0.2_vitest@5.0.5/node_modules/@wirecat/cli-base/dist/update/index.js
24
+ var import_cross_spawn = __toESM(require_cross_spawn(), 1);
25
+ import { existsSync } from "node:fs";
26
+ var installerOf = /* @__PURE__ */ __name((scriptPath) => {
27
+ const path = scriptPath.replaceAll("\\", "/");
28
+ if (path.includes("/_npx/"))
29
+ return "npx";
30
+ if (path.includes("/install/global/node_modules/"))
31
+ return "bun";
32
+ if (/\/\.?pnpm\//.test(path))
33
+ return "pnpm";
34
+ if (path.includes("/node_modules/"))
35
+ return "npm";
36
+ return path.includes("/dist/") ? "checkout" : "unknown";
37
+ }, "installerOf");
38
+ var updateCommand = /* @__PURE__ */ __name((installer, packageName) => {
39
+ const target = `${packageName}@latest`;
40
+ switch (installer) {
41
+ // pnpm 11 installs only versions a day old (minimumReleaseAge 1440); a fix must reach users the day it ships.
42
+ // Only the package's own scope is exempt — every other dependency keeps the wait.
43
+ case "pnpm":
44
+ return ["pnpm", "add", "-g", target, `--config.minimumReleaseAgeExclude=${ownScope(packageName)}`];
45
+ case "npm":
46
+ return ["npm", "install", "-g", target];
47
+ case "bun":
48
+ return ["bun", "add", "-g", target];
49
+ default:
50
+ return void 0;
51
+ }
52
+ }, "updateCommand");
53
+ var ownScope = /* @__PURE__ */ __name((packageName) => packageName.startsWith("@") ? `${packageName.split("/", 1)[0]}/*` : packageName, "ownScope");
54
+ var isNewer = /* @__PURE__ */ __name((candidate, current) => {
55
+ const parse = /* @__PURE__ */ __name((version) => /^\d+\.\d+\.\d+$/.test(version) ? version.split(".").map(Number) : void 0, "parse");
56
+ const a = parse(candidate);
57
+ const b = parse(current);
58
+ if (!a || !b)
59
+ return false;
60
+ for (let i = 0; i < 3; i++) {
61
+ if (a[i] !== b[i])
62
+ return a[i] > b[i];
63
+ }
64
+ return false;
65
+ }, "isNewer");
66
+ var latestVersion = /* @__PURE__ */ __name(async (packageName, fetch, { timeoutMs = 1e3 } = {}) => {
67
+ try {
68
+ const response = await fetch(`https://registry.npmjs.org/${packageName}/latest`, {
69
+ signal: AbortSignal.timeout(timeoutMs),
70
+ headers: { accept: "application/json" }
71
+ });
72
+ if (!response.ok)
73
+ return void 0;
74
+ const { version } = await response.json();
75
+ return typeof version === "string" ? version : void 0;
76
+ } catch {
77
+ return void 0;
78
+ }
79
+ }, "latestVersion");
80
+ var CHECK_EVERY_MS = 24 * 60 * 60 * 1e3;
81
+ var mayNotify = /* @__PURE__ */ __name(({ format, stderrIsTTY, quiet, enabled, installer, env, offVariables = [] }) => enabled && format === "pretty" && stderrIsTTY && !quiet && updateCommand(installer, "any") !== void 0 && !env.CI && !env.NO_UPDATE_NOTIFIER && offVariables.every((name) => !env[name]), "mayNotify");
82
+ var updateState = object({
83
+ checkedAt: number(),
84
+ latest: optional(string()),
85
+ /** When the skill hint (`cli-base/skill`) was last shown — the other daily notice kept in this file. */
86
+ skillHintAt: optional(number())
87
+ });
88
+ var readNoticeState = /* @__PURE__ */ __name((path) => {
89
+ try {
90
+ return loadConfigFile(path, updateState, () => ({ checkedAt: 0 }));
91
+ } catch {
92
+ return { checkedAt: 0 };
93
+ }
94
+ }, "readNoticeState");
95
+ var readUpdateState = /* @__PURE__ */ __name((path) => {
96
+ const state = readNoticeState(path);
97
+ return state.checkedAt > 0 ? state : void 0;
98
+ }, "readUpdateState");
99
+ var writeUpdateState = /* @__PURE__ */ __name((path, state) => {
100
+ try {
101
+ saveConfigFile(path, { ...readNoticeState(path), ...state });
102
+ } catch {
103
+ }
104
+ }, "writeUpdateState");
105
+ var checkIsDue = /* @__PURE__ */ __name((state, now) => state === void 0 || now - state.checkedAt >= CHECK_EVERY_MS, "checkIsDue");
106
+ var spawnPlan = /* @__PURE__ */ __name(([command, ...args], platform = process.platform, env = process.env, exists = existsSync) => ({ file: executableOnPath(command, env, platform, exists), args, shell: false }), "spawnPlan");
107
+ var runUpdate = /* @__PURE__ */ __name((argv) => {
108
+ const { file, args, shell } = spawnPlan(argv);
109
+ const { status, error } = import_cross_spawn.default.sync(file, args, {
110
+ stdio: ["inherit", 2, 2],
111
+ shell,
112
+ env: executableEnvironment(process.env)
113
+ });
114
+ if (error)
115
+ throw new Error(`could not start ${argv[0]}: ${error.message}`);
116
+ return status ?? 1;
117
+ }, "runUpdate");
118
+ var updateNotice = /* @__PURE__ */ __name(async ({ argv, packageName, command, upgradeCommand = "upgrade", version, statePath, fetch, now = Date.now, ...context }) => {
119
+ try {
120
+ const path = commandWords(argv).slice(0, 2);
121
+ if (path.includes("complete") || path.includes(upgradeCommand))
122
+ return void 0;
123
+ if (!mayNotify(context))
124
+ return void 0;
125
+ const at = now();
126
+ let state = readUpdateState(statePath);
127
+ if (checkIsDue(state, at)) {
128
+ const found = await latestVersion(packageName, fetch, { timeoutMs: 1e3 });
129
+ const seen = found ?? state?.latest;
130
+ state = seen ? { checkedAt: at, latest: seen } : { checkedAt: at };
131
+ writeUpdateState(statePath, state);
132
+ }
133
+ return state?.latest && isNewer(state.latest, version) ? `${command} ${state.latest} is out \u2014 you have ${version}. \`${command} ${upgradeCommand}\` installs it.` : void 0;
134
+ } catch {
135
+ return void 0;
136
+ }
137
+ }, "updateNotice");
138
+ var commandWords = /* @__PURE__ */ __name((argv) => {
139
+ const end = argv.indexOf("--");
140
+ return argv.slice(0, end < 0 ? void 0 : end).filter((word) => !word.startsWith("-"));
141
+ }, "commandWords");
142
+
143
+ export {
144
+ installerOf,
145
+ updateCommand,
146
+ isNewer,
147
+ latestVersion,
148
+ runUpdate,
149
+ updateNotice
150
+ };