@sheetxl/utils-node 0.8.0-beta.14 → 0.8.0-beta.16
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.
- package/LICENSE.md +17 -7
- package/node/esm/index.mjs +247 -199
- package/package.json +2 -2
- package/types/src/info/InfoTypes.d.ts +10 -12
- package/types/src/info/mcpClients.d.ts +7 -2
- package/types/src/info/updateCheck.d.ts +20 -6
package/LICENSE.md
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Copyright (c) 2026-present SheetXL Inc. & Michael T. Ford
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/node/esm/index.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-node - SheetXL - Node-only utilities: terminal presentation, environment reporting, tool logging - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/utils-node - SheetXL - Node-only utilities: terminal presentation, environment reporting, tool logging - v0.8.0-beta.16
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License:
|
|
5
|
+
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
import { createRequire as e } from "node:module";
|
|
8
8
|
import t from "chalk";
|
|
9
9
|
import * as n from "node:os";
|
|
10
10
|
import * as s from "node:path";
|
|
11
|
-
import { existsSync as
|
|
11
|
+
import { existsSync as r, readFileSync as o } from "node:fs";
|
|
12
12
|
import { appendFile as i, mkdir as a, readFile as l, readdir as c, stat as u, unlink as h, writeFile as d } from "node:fs/promises";
|
|
13
13
|
import { fileURLToPath as p } from "node:url";
|
|
14
14
|
import { createHash as f } from "node:crypto";
|
|
15
|
-
var m = (e) => /^#{1,4} /.test(e) ? t.cyan.bold(e) : ((e) => e.replace(/`([^`]+)`/g, (e, n) => t.yellow(n)).replace(/\*\*([^*]+)\*\*/g, (e, n) => t.bold(n)).replace(/(?<=^|\s)_([^_\s](?:[^_]*[^_\s])?)_(?=[\s.,)]|$)/g, (e, n) => t.italic(n)))(e),
|
|
15
|
+
var m = (e) => /^#{1,4} /.test(e) ? t.cyan.bold(e) : ((e) => e.replace(/`([^`]+)`/g, (e, n) => t.yellow(n)).replace(/\*\*([^*]+)\*\*/g, (e, n) => t.bold(n)).replace(/(?<=^|\s)_([^_\s](?:[^_]*[^_\s])?)_(?=[\s.,)]|$)/g, (e, n) => t.italic(n)))(e), g = (e, t) => {
|
|
16
16
|
const n = t?.stream ?? process.stdout;
|
|
17
|
-
n.write(
|
|
18
|
-
},
|
|
17
|
+
n.write(v(e.endsWith("\n") ? e : e + "\n", n));
|
|
18
|
+
}, v = (e, t = process.stdout) => t.isTTY ? e.split("\n").map(m).join("\n") : e;
|
|
19
19
|
function w(e) {
|
|
20
20
|
const t = new Date(e);
|
|
21
21
|
if (Number.isNaN(t.getTime())) return e;
|
|
@@ -26,14 +26,14 @@ function y(e, t) {
|
|
|
26
26
|
return e && "local" !== e ? e : t ? `local ${w(t)}` : "local";
|
|
27
27
|
}
|
|
28
28
|
var k = () => s.join(n.homedir(), ".sheetxl", "locks");
|
|
29
|
-
async function
|
|
29
|
+
async function x(e) {
|
|
30
30
|
try {
|
|
31
31
|
return JSON.parse(await l(e, "utf-8"));
|
|
32
32
|
} catch {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
async function
|
|
36
|
+
async function $(e) {
|
|
37
37
|
try {
|
|
38
38
|
return (await fetch(`http://127.0.0.1:${e.port}/sheetxl-mcp/ping`, {
|
|
39
39
|
headers: { Authorization: `Bearer ${e.token}` },
|
|
@@ -47,9 +47,9 @@ async function j() {
|
|
|
47
47
|
const e = (() => {
|
|
48
48
|
const e = process.env.SHEETXL_WORKSPACE ?? process.cwd(), t = f("sha256").update(e).digest("hex").slice(0, 8);
|
|
49
49
|
return s.join(k(), `${t}.lock`);
|
|
50
|
-
})(), t = await
|
|
50
|
+
})(), t = await x(e);
|
|
51
51
|
if (t) {
|
|
52
|
-
if (await
|
|
52
|
+
if (await $(t)) return t;
|
|
53
53
|
await h(e).catch(() => {});
|
|
54
54
|
}
|
|
55
55
|
return async function() {
|
|
@@ -66,9 +66,9 @@ async function j() {
|
|
|
66
66
|
})));
|
|
67
67
|
t.sort((e, t) => t.mtime - e.mtime);
|
|
68
68
|
for (const { f: e } of t) {
|
|
69
|
-
const t = s.join(k(), e), n = await
|
|
69
|
+
const t = s.join(k(), e), n = await x(t);
|
|
70
70
|
if (n) {
|
|
71
|
-
if (await
|
|
71
|
+
if (await $(n)) return n;
|
|
72
72
|
await h(t).catch(() => {});
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -82,65 +82,104 @@ async function b(e) {
|
|
|
82
82
|
})).json();
|
|
83
83
|
}
|
|
84
84
|
var S = () => s.join(n.homedir(), ".sheetxl", "cache", "update.json");
|
|
85
|
-
|
|
86
|
-
const
|
|
85
|
+
function A(e, t) {
|
|
86
|
+
const n = e.includes("-") ? ["beta", "latest"] : ["latest"];
|
|
87
|
+
let s = null;
|
|
88
|
+
for (const e of n) {
|
|
89
|
+
const n = t[e];
|
|
90
|
+
n && (!s || N(n, s.latest) > 0) && (s = {
|
|
91
|
+
latest: n,
|
|
92
|
+
tag: e
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return s;
|
|
96
|
+
}
|
|
97
|
+
async function O(e, t = Date.now()) {
|
|
98
|
+
const n = (t, n) => {
|
|
99
|
+
const s = A(e, t);
|
|
100
|
+
return s ? {
|
|
101
|
+
...s,
|
|
102
|
+
cacheStatus: n
|
|
103
|
+
} : {
|
|
104
|
+
latest: null,
|
|
105
|
+
tag: null,
|
|
106
|
+
cacheStatus: "missing"
|
|
107
|
+
};
|
|
108
|
+
}, r = await async function() {
|
|
87
109
|
try {
|
|
88
110
|
const e = JSON.parse(await l(S(), "utf-8"));
|
|
89
|
-
return "
|
|
111
|
+
return "object" == typeof e?.tags && e.tags && "number" == typeof e?.checkedAt ? e : null;
|
|
90
112
|
} catch {
|
|
91
113
|
return null;
|
|
92
114
|
}
|
|
93
115
|
}();
|
|
94
|
-
if (
|
|
95
|
-
latest: t.latest,
|
|
96
|
-
cacheStatus: "fresh"
|
|
97
|
-
};
|
|
116
|
+
if (r && t - r.checkedAt < 864e5) return n(r.tags, "fresh");
|
|
98
117
|
try {
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (!t.ok) throw new Error(String(t.status));
|
|
104
|
-
const n = (await t.json()).version;
|
|
105
|
-
if (!n) throw new Error("no version");
|
|
118
|
+
const e = await fetch("https://registry.npmjs.org/-/package/@sheetxl%2fsdk/dist-tags", { signal: AbortSignal.timeout(1500) });
|
|
119
|
+
if (!e.ok) throw new Error(String(e.status));
|
|
120
|
+
const r = await e.json();
|
|
121
|
+
if ("string" != typeof r?.latest) throw new Error("no latest tag");
|
|
106
122
|
return await async function(e) {
|
|
107
123
|
try {
|
|
108
124
|
await a(s.dirname(S()), { recursive: !0 }), await d(S(), JSON.stringify(e), "utf-8");
|
|
109
125
|
} catch {}
|
|
110
126
|
}({
|
|
111
|
-
checkedAt:
|
|
112
|
-
|
|
113
|
-
}),
|
|
114
|
-
latest: n,
|
|
115
|
-
cacheStatus: "refreshed"
|
|
116
|
-
};
|
|
127
|
+
checkedAt: t,
|
|
128
|
+
tags: r
|
|
129
|
+
}), n(r, "refreshed");
|
|
117
130
|
} catch {
|
|
118
|
-
return
|
|
119
|
-
latest: t.latest,
|
|
120
|
-
cacheStatus: "fresh"
|
|
121
|
-
} : {
|
|
131
|
+
return r ? n(r.tags, "fresh") : {
|
|
122
132
|
latest: null,
|
|
133
|
+
tag: null,
|
|
123
134
|
cacheStatus: "missing"
|
|
124
135
|
};
|
|
125
136
|
}
|
|
126
137
|
}
|
|
127
|
-
function
|
|
128
|
-
const n = (e) =>
|
|
138
|
+
function N(e, t) {
|
|
139
|
+
const n = (e) => {
|
|
140
|
+
const t = e.indexOf("-"), n = t < 0 ? e : e.slice(0, t), s = t < 0 ? [] : e.slice(t + 1).split(".");
|
|
141
|
+
return [n.split(".").map((e) => Number.parseInt(e, 10) || 0), s];
|
|
142
|
+
}, [s, r] = n(e), [o, i] = n(t);
|
|
129
143
|
for (let e = 0; e < Math.max(s.length, o.length); e++) {
|
|
130
144
|
const t = (s[e] ?? 0) - (o[e] ?? 0);
|
|
131
145
|
if (0 !== t) return t;
|
|
132
146
|
}
|
|
147
|
+
if (!r.length || !i.length) return i.length - r.length;
|
|
148
|
+
for (let e = 0; e < Math.max(r.length, i.length); e++) {
|
|
149
|
+
const t = r[e], n = i[e];
|
|
150
|
+
if (void 0 === t) return -1;
|
|
151
|
+
if (void 0 === n) return 1;
|
|
152
|
+
const s = /^\d+$/.test(t), o = /^\d+$/.test(n);
|
|
153
|
+
if (s && o) {
|
|
154
|
+
const e = Number(t) - Number(n);
|
|
155
|
+
if (0 !== e) return e;
|
|
156
|
+
} else {
|
|
157
|
+
if (s !== o) return s ? -1 : 1;
|
|
158
|
+
if (t !== n) return t < n ? -1 : 1;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
133
161
|
return 0;
|
|
134
162
|
}
|
|
135
|
-
var
|
|
136
|
-
|
|
163
|
+
var C = "claude mcp add sheetxl -- npx -y @sheetxl/mcp", _ = {
|
|
164
|
+
command: "npx",
|
|
165
|
+
args: ["-y", "@sheetxl/mcp"]
|
|
166
|
+
}, T = "npx -y sheetxl setup agent", P = () => n.homedir();
|
|
167
|
+
function L(e) {
|
|
168
|
+
const t = s.resolve(e).replace(/\\/g, "/").replace(/\/+$/, "");
|
|
169
|
+
return "win32" === process.platform || "darwin" === process.platform ? t.toLowerCase() : t;
|
|
170
|
+
}
|
|
171
|
+
async function M(e) {
|
|
137
172
|
const t = [];
|
|
138
173
|
return await Promise.all(function(e) {
|
|
139
|
-
const t = process.env.APPDATA, n = "win32" === process.platform ? t ? s.join(t, "Claude", "claude_desktop_config.json") : null : "darwin" === process.platform ? s.join(
|
|
174
|
+
const t = process.env.APPDATA, n = "win32" === process.platform ? t ? s.join(t, "Claude", "claude_desktop_config.json") : null : "darwin" === process.platform ? s.join(P(), "Library", "Application Support", "Claude", "claude_desktop_config.json") : s.join(P(), ".config", "Claude", "claude_desktop_config.json");
|
|
140
175
|
return [
|
|
141
176
|
{
|
|
142
177
|
name: "claude-code",
|
|
143
|
-
file: s.join(
|
|
178
|
+
file: s.join(P(), ".claude.json")
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: "claude-code (plugin)",
|
|
182
|
+
file: s.join(P(), ".claude", "settings.json")
|
|
144
183
|
},
|
|
145
184
|
{
|
|
146
185
|
name: "claude-code (project)",
|
|
@@ -152,7 +191,7 @@ async function C(e) {
|
|
|
152
191
|
},
|
|
153
192
|
{
|
|
154
193
|
name: "cursor",
|
|
155
|
-
file: s.join(
|
|
194
|
+
file: s.join(P(), ".cursor", "mcp.json")
|
|
156
195
|
},
|
|
157
196
|
{
|
|
158
197
|
name: "cursor (project)",
|
|
@@ -160,7 +199,7 @@ async function C(e) {
|
|
|
160
199
|
},
|
|
161
200
|
{
|
|
162
201
|
name: "windsurf",
|
|
163
|
-
file: s.join(
|
|
202
|
+
file: s.join(P(), ".codeium", "windsurf", "mcp_config.json")
|
|
164
203
|
},
|
|
165
204
|
{
|
|
166
205
|
name: "vscode (project)",
|
|
@@ -168,20 +207,22 @@ async function C(e) {
|
|
|
168
207
|
},
|
|
169
208
|
{
|
|
170
209
|
name: "codex",
|
|
171
|
-
file: s.join(
|
|
210
|
+
file: s.join(P(), ".codex", "config.toml")
|
|
172
211
|
}
|
|
173
212
|
];
|
|
174
|
-
}(e).map(async ({ name:
|
|
175
|
-
if (
|
|
176
|
-
(function(e, t) {
|
|
213
|
+
}(e).map(async ({ name: n, file: s }) => {
|
|
214
|
+
if (s) try {
|
|
215
|
+
(function(e, t, n) {
|
|
177
216
|
if (t.endsWith(".toml")) return /sheetxl/i.test(e);
|
|
178
217
|
try {
|
|
179
|
-
const t = JSON.parse(e), n = [
|
|
218
|
+
const t = JSON.parse(e), s = L(n), r = [
|
|
180
219
|
t.mcpServers,
|
|
181
220
|
t.servers,
|
|
182
|
-
|
|
221
|
+
t.enabledPlugins,
|
|
222
|
+
...Object.entries(t.projects ?? {}).filter(([e]) => L(e) === s).map(([, e]) => e?.mcpServers)
|
|
183
223
|
];
|
|
184
|
-
for (const e of
|
|
224
|
+
for (const e of r) if (e && "object" == typeof e) for (const [t, n] of Object.entries(e)) {
|
|
225
|
+
if (!1 === n) continue;
|
|
185
226
|
if (/sheetxl/i.test(t)) return !0;
|
|
186
227
|
const e = JSON.stringify(n ?? "");
|
|
187
228
|
if (/sheetxl/i.test(e)) return !0;
|
|
@@ -190,17 +231,17 @@ async function C(e) {
|
|
|
190
231
|
} catch {
|
|
191
232
|
return /sheetxl/i.test(e);
|
|
192
233
|
}
|
|
193
|
-
})(await l(
|
|
194
|
-
name:
|
|
195
|
-
file:
|
|
234
|
+
})(await l(s, "utf-8"), s, e) && t.push({
|
|
235
|
+
name: n,
|
|
236
|
+
file: s
|
|
196
237
|
});
|
|
197
238
|
} catch {}
|
|
198
239
|
})), t.sort((e, t) => e.name.localeCompare(t.name));
|
|
199
240
|
}
|
|
200
|
-
var
|
|
201
|
-
function
|
|
241
|
+
var E = e(import.meta.url);
|
|
242
|
+
function D(e) {
|
|
202
243
|
try {
|
|
203
|
-
return s.dirname(
|
|
244
|
+
return s.dirname(E.resolve(`${e}/package.json`));
|
|
204
245
|
} catch {}
|
|
205
246
|
for (const t of function(e) {
|
|
206
247
|
const t = [];
|
|
@@ -208,13 +249,13 @@ function E(e) {
|
|
|
208
249
|
t.push(p(import.meta.resolve(e)));
|
|
209
250
|
} catch {}
|
|
210
251
|
try {
|
|
211
|
-
t.push(
|
|
252
|
+
t.push(E.resolve(e));
|
|
212
253
|
} catch {}
|
|
213
254
|
return t;
|
|
214
255
|
}(e)) {
|
|
215
256
|
let n = s.dirname(t);
|
|
216
257
|
for (let t = 0; t < 8; t++) {
|
|
217
|
-
if (
|
|
258
|
+
if (I(n) === e) return n;
|
|
218
259
|
const t = s.dirname(n);
|
|
219
260
|
if (t === n) break;
|
|
220
261
|
n = t;
|
|
@@ -222,73 +263,73 @@ function E(e) {
|
|
|
222
263
|
}
|
|
223
264
|
return null;
|
|
224
265
|
}
|
|
225
|
-
function
|
|
266
|
+
function I(e) {
|
|
226
267
|
try {
|
|
227
|
-
return JSON.parse(
|
|
268
|
+
return JSON.parse(o(s.join(e, "package.json"), "utf-8")).name ?? null;
|
|
228
269
|
} catch {
|
|
229
270
|
return null;
|
|
230
271
|
}
|
|
231
272
|
}
|
|
232
|
-
function
|
|
273
|
+
function J(e) {
|
|
233
274
|
return {
|
|
234
275
|
version: e.getBuildVersion() || "local",
|
|
235
276
|
build: e.getBuildDate() || null
|
|
236
277
|
};
|
|
237
278
|
}
|
|
238
|
-
async function
|
|
239
|
-
const { surface: t, offline: i = !1, includeHost: a = !1, serverCount: c } = e, u = e.workspace ?? process.env.SHEETXL_WORKSPACE ?? process.cwd(), h = e.license(), d = h.then((e) => i || "local" ===
|
|
279
|
+
async function B(e) {
|
|
280
|
+
const { surface: t, offline: i = !1, includeHost: a = !1, serverCount: c } = e, u = e.workspace ?? process.env.SHEETXL_WORKSPACE ?? process.cwd(), h = e.license(), d = h.then((e) => i || "local" === J(e).version ? null : O(J(e).version)), [f, m, g, v] = await Promise.all([
|
|
240
281
|
h,
|
|
241
|
-
|
|
282
|
+
W(e, i),
|
|
242
283
|
d,
|
|
243
|
-
|
|
244
|
-
]),
|
|
245
|
-
const n = e.getExceptions(), s = e.isEval() ? "evaluation" : (e.getType() || "unlicensed").toLowerCase(), o = e.getExpiration(), r = o && !Number.isNaN(o.getTime()) ? o : null, i = null !== r && r.getTime() - Date.now() < 2592e6, a = r ? `expire${r.getTime() < Date.now() ? "d" : "s"} ${r.toISOString().slice(0, 10)}` : void 0;
|
|
246
|
-
let l;
|
|
247
|
-
if (t) {
|
|
248
|
-
const t = e.getKeyFrom(), n = !t || /^no key$/i.test(t) ? "local" : t, s = e.getCpuCount(), o = e.getMemory();
|
|
249
|
-
l = [`key: ${n}`, 0 === s && 0 === o ? "unmetered" : [s ? `${s} cores` : null, o ? `${o} GB` : null].filter(Boolean).join(" · ")].filter(Boolean).join(" · ");
|
|
250
|
-
}
|
|
284
|
+
M(u)
|
|
285
|
+
]), k = J(f), x = function(e, t) {
|
|
251
286
|
return {
|
|
252
287
|
name: "license",
|
|
253
|
-
|
|
254
|
-
value: s,
|
|
255
|
-
detail: n.length ? n.join("; ") : [i || t ? a : void 0, l].filter(Boolean).join(" — "),
|
|
256
|
-
fix: n.length ? "sheetxl license activate <key>" : void 0
|
|
288
|
+
...e.getSummary(t)
|
|
257
289
|
};
|
|
258
|
-
}(
|
|
290
|
+
}(f, a), $ = [], j = "local" === k.version;
|
|
259
291
|
$.push({
|
|
260
292
|
name: "engine",
|
|
261
293
|
level: "ok",
|
|
262
|
-
value: `@sheetxl/sdk ${y(
|
|
263
|
-
detail:
|
|
294
|
+
value: `@sheetxl/sdk ${y(k.version, k.build)}`,
|
|
295
|
+
detail: j ? "workspace build — unpublished" : k.build ? `built ${w(k.build)}` : void 0
|
|
264
296
|
});
|
|
265
|
-
const
|
|
297
|
+
const b = Number.parseInt(process.version.slice(1), 10);
|
|
266
298
|
$.push({
|
|
267
299
|
name: "node",
|
|
268
|
-
level:
|
|
300
|
+
level: b < 24 ? "error" : "ok",
|
|
269
301
|
value: process.version,
|
|
270
|
-
detail:
|
|
271
|
-
fix:
|
|
302
|
+
detail: b < 24 ? "minimum is v24" : void 0,
|
|
303
|
+
fix: b < 24 ? "install Node.js v24 or newer" : void 0
|
|
272
304
|
});
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
305
|
+
const S = function() {
|
|
306
|
+
let e = s.dirname(p(import.meta.url));
|
|
307
|
+
for (let t = 0; t < 2; t++) {
|
|
308
|
+
const t = s.join(e, "types", "scripting.d.ts");
|
|
309
|
+
if (r(t)) return {
|
|
310
|
+
path: t,
|
|
311
|
+
exists: !0
|
|
312
|
+
};
|
|
313
|
+
e = s.dirname(e);
|
|
314
|
+
}
|
|
315
|
+
const t = D("@sheetxl/sdk");
|
|
316
|
+
if (!t) return {
|
|
276
317
|
path: null,
|
|
277
318
|
exists: !1
|
|
278
319
|
};
|
|
279
320
|
try {
|
|
280
|
-
const
|
|
321
|
+
const e = JSON.parse(o(s.join(t, "package.json"), "utf-8")), n = e.exports?.["."]?.types ?? e.types;
|
|
281
322
|
if (!n) return {
|
|
282
323
|
path: null,
|
|
283
324
|
exists: !1
|
|
284
325
|
};
|
|
285
|
-
const i = s.resolve(
|
|
286
|
-
return
|
|
326
|
+
const i = s.resolve(t, n), a = s.join(s.dirname(i), "scripting.d.ts");
|
|
327
|
+
return r(a) ? {
|
|
287
328
|
path: a,
|
|
288
329
|
exists: !0
|
|
289
330
|
} : {
|
|
290
331
|
path: i,
|
|
291
|
-
exists:
|
|
332
|
+
exists: r(i)
|
|
292
333
|
};
|
|
293
334
|
} catch {
|
|
294
335
|
return {
|
|
@@ -297,21 +338,21 @@ async function D(e) {
|
|
|
297
338
|
};
|
|
298
339
|
}
|
|
299
340
|
}();
|
|
300
|
-
$.push(
|
|
341
|
+
$.push(S.exists ? {
|
|
301
342
|
name: "types",
|
|
302
343
|
level: "ok",
|
|
303
|
-
value:
|
|
344
|
+
value: S.path,
|
|
304
345
|
detail: `\`${e.apiCommand ?? ("mcp" === t ? "api" : "sheetxl api")} <Type>\` lists what a type can do without reading this`
|
|
305
346
|
} : {
|
|
306
347
|
name: "types",
|
|
307
348
|
level: "warn",
|
|
308
|
-
value:
|
|
309
|
-
detail:
|
|
310
|
-
fix:
|
|
349
|
+
value: S.path ?? "not resolved",
|
|
350
|
+
detail: S.path ? "declared but not present — the engine build may be incomplete" : "@sheetxl/sdk is not reachable from here",
|
|
351
|
+
fix: T
|
|
311
352
|
});
|
|
312
|
-
const
|
|
313
|
-
const
|
|
314
|
-
const t =
|
|
353
|
+
const A = await async function(e, t) {
|
|
354
|
+
const o = await async function(e) {
|
|
355
|
+
const t = D(e);
|
|
315
356
|
if (!t) return null;
|
|
316
357
|
try {
|
|
317
358
|
return JSON.parse(await l(s.join(t, "package.json"), "utf-8")).version ?? null;
|
|
@@ -319,7 +360,7 @@ async function D(e) {
|
|
|
319
360
|
return null;
|
|
320
361
|
}
|
|
321
362
|
}("@sheetxl/skills");
|
|
322
|
-
if (!
|
|
363
|
+
if (!o) return null;
|
|
323
364
|
const i = "mcp" === e ? "load with the `skill` prompt or the `sheetxl://skills/*` resources" : "read with `sheetxl skills`", a = function(e) {
|
|
324
365
|
const t = n.homedir();
|
|
325
366
|
return [
|
|
@@ -330,17 +371,17 @@ async function D(e) {
|
|
|
330
371
|
s.join(t, ".codex", "skills", "sheetxl"),
|
|
331
372
|
s.join(t, ".cursor", "skills", "sheetxl")
|
|
332
373
|
];
|
|
333
|
-
}(t).find((e) =>
|
|
334
|
-
if ("0.0.0" ===
|
|
374
|
+
}(t).find((e) => r(e));
|
|
375
|
+
if ("0.0.0" === o) return {
|
|
335
376
|
name: "skills",
|
|
336
377
|
level: "ok",
|
|
337
|
-
value:
|
|
378
|
+
value: D("@sheetxl/skills") ?? "@sheetxl/skills (workspace)",
|
|
338
379
|
detail: [`workspace copy — SKILL.md and references/ — ${i}`, a ? `read this copy first: it tracks the engine you are running; the installed copy at ${a} tracks a release and is the fallback` : null].filter(Boolean).join("; ")
|
|
339
380
|
};
|
|
340
381
|
if (!a) return {
|
|
341
382
|
name: "skills",
|
|
342
383
|
level: "ok",
|
|
343
|
-
value: `@sheetxl/skills ${
|
|
384
|
+
value: `@sheetxl/skills ${o}`,
|
|
344
385
|
detail: `version-matched to this ${"mcp" === e ? "server" : "install"} — ${i}`
|
|
345
386
|
};
|
|
346
387
|
const c = await async function(e) {
|
|
@@ -349,10 +390,10 @@ async function D(e) {
|
|
|
349
390
|
if (!t.startsWith("---")) return null;
|
|
350
391
|
const n = t.indexOf("\n---", 3);
|
|
351
392
|
if (-1 === n) return null;
|
|
352
|
-
const
|
|
353
|
-
if (!
|
|
354
|
-
const
|
|
355
|
-
return
|
|
393
|
+
const r = t.slice(3, n).match(/^version:\s*(.*)$/m);
|
|
394
|
+
if (!r) return null;
|
|
395
|
+
const o = r[1].trim().replace(/^["']|["']$/g, "");
|
|
396
|
+
return o && "0.0.0" !== o ? o : null;
|
|
356
397
|
} catch {
|
|
357
398
|
return null;
|
|
358
399
|
}
|
|
@@ -360,20 +401,20 @@ async function D(e) {
|
|
|
360
401
|
if (!c) return {
|
|
361
402
|
name: "skills",
|
|
362
403
|
level: "ok",
|
|
363
|
-
value: `@sheetxl/skills ${
|
|
404
|
+
value: `@sheetxl/skills ${o}`,
|
|
364
405
|
detail: `installed at ${a} (version not stamped)`
|
|
365
406
|
};
|
|
366
|
-
const u =
|
|
407
|
+
const u = N(o, c) > 0;
|
|
367
408
|
return {
|
|
368
409
|
name: "skills",
|
|
369
410
|
level: u ? "warn" : "ok",
|
|
370
|
-
value: `@sheetxl/skills ${
|
|
411
|
+
value: `@sheetxl/skills ${o}`,
|
|
371
412
|
detail: u ? `installed copy is ${c} — stale; prefer this ${"mcp" === e ? "server" : "install"}'s: ${i}` : "current",
|
|
372
413
|
...u && "cli" === e ? { fix: "sheetxl skills" } : {}
|
|
373
414
|
};
|
|
374
415
|
}(t, u);
|
|
375
|
-
|
|
376
|
-
const
|
|
416
|
+
A && $.push(A);
|
|
417
|
+
const C = m.some((e) => e.hasView ?? "attended" === e.kind);
|
|
377
418
|
return "mcp" === t ? $.push(function(e) {
|
|
378
419
|
const t = function(e) {
|
|
379
420
|
const t = "win32" === process.platform ? [
|
|
@@ -382,7 +423,7 @@ async function D(e) {
|
|
|
382
423
|
"sheetxl"
|
|
383
424
|
] : ["sheetxl"], n = [s.join(e, "node_modules", ".bin"), ...(process.env.PATH ?? "").split(s.delimiter).filter(Boolean)];
|
|
384
425
|
for (const e of n) for (const n of t) try {
|
|
385
|
-
if (
|
|
426
|
+
if (r(s.join(e, n))) return s.join(e, n);
|
|
386
427
|
} catch {}
|
|
387
428
|
return null;
|
|
388
429
|
}(e), n = "same engine, one dialect — for terminal-shaped work (`--json` piping, stdin, scripts); sessions stay here";
|
|
@@ -397,64 +438,71 @@ async function D(e) {
|
|
|
397
438
|
value: "not found on PATH",
|
|
398
439
|
detail: `if you can run commands, \`npx -y sheetxl\` runs it anywhere Node does — ${n}`
|
|
399
440
|
};
|
|
400
|
-
}(u)) :
|
|
401
|
-
|
|
402
|
-
name: "mcp",
|
|
403
|
-
level: "ok",
|
|
404
|
-
value: `registered (${e.map((e) => e.name).join(", ")})`,
|
|
405
|
-
detail: "not connected from the CLI — a registered server attaches at the client's next session"
|
|
406
|
-
} : {
|
|
441
|
+
}(u)) : $.push(function(e, t) {
|
|
442
|
+
if (!e.length) return {
|
|
407
443
|
name: "mcp",
|
|
408
444
|
level: "warn",
|
|
409
445
|
value: "server available — no client registration found here",
|
|
410
|
-
detail: t ? "a client UI has a workbook open (see sessions), but no config here gives this agent the MCP tools — register to act on it (sessions, undo, in-grid highlights, prompts)" : "the server
|
|
411
|
-
fix: "sheetxl setup"
|
|
446
|
+
detail: t ? "a client UI has a workbook open (see sessions), but no config here gives this agent the MCP tools — register to act on it (sessions, undo, in-grid highlights, prompts)" : "the server runs through npx (`npx -y @sheetxl/mcp`); until a client registers it, sessions, undo, in-grid highlights and prompts are unavailable",
|
|
447
|
+
fix: "sheetxl setup agent"
|
|
448
|
+
};
|
|
449
|
+
const n = `registered (${e.map((e) => e.name).join(", ")})`, s = e.filter((e) => e.name.startsWith("claude-code"));
|
|
450
|
+
return s.length > 1 ? {
|
|
451
|
+
name: "mcp",
|
|
452
|
+
level: "warn",
|
|
453
|
+
value: n,
|
|
454
|
+
detail: `Claude Code has SheetXL registered ${s.length} times (${s.map((e) => e.file).join(", ")}) and will launch a server for each — keep one. With the plugin enabled, the VS Code extension removes its own \`.mcp.json\` entry.`
|
|
455
|
+
} : {
|
|
456
|
+
name: "mcp",
|
|
457
|
+
level: "ok",
|
|
458
|
+
value: n,
|
|
459
|
+
detail: "not connected from the CLI — a registered server attaches at the client's next session"
|
|
412
460
|
};
|
|
413
|
-
}(v,
|
|
461
|
+
}(v, C)), void 0 !== c && c > 1 && $.push({
|
|
414
462
|
name: "instances",
|
|
415
463
|
level: "warn",
|
|
416
464
|
value: `${c} servers launched by this MCP client for this workspace`,
|
|
417
465
|
detail: "a duplicate MCP registration — sandbox sessions are per-process and are not shared between them, so a session_id created through one is unusable through another",
|
|
418
466
|
fix: "remove the duplicate sheetxl entry from one of the MCP client configs"
|
|
419
|
-
}), $.push(
|
|
467
|
+
}), $.push(x), $.push({
|
|
420
468
|
name: "workspace",
|
|
421
469
|
level: "ok",
|
|
422
470
|
value: u,
|
|
423
471
|
detail: "relative paths resolve here"
|
|
424
|
-
}),
|
|
472
|
+
}), j ? $.push({
|
|
425
473
|
name: "update",
|
|
426
474
|
level: "ok",
|
|
427
475
|
value: "not applicable — local build",
|
|
428
476
|
detail: "no published channel to update from; rebuild the workspace to pick up changes"
|
|
429
|
-
}) :
|
|
477
|
+
}) : g && $.push(function(e, t, n) {
|
|
430
478
|
if (!t.latest) return {
|
|
431
479
|
name: "update",
|
|
432
480
|
level: "ok",
|
|
433
481
|
value: "unknown",
|
|
434
482
|
detail: "registry not reachable"
|
|
435
483
|
};
|
|
436
|
-
const
|
|
484
|
+
const s = N(t.latest, e) > 0;
|
|
437
485
|
return {
|
|
438
486
|
name: "update",
|
|
439
|
-
level:
|
|
440
|
-
value:
|
|
441
|
-
detail: n ? `running ${e}` : void 0,
|
|
442
|
-
fix: n ?
|
|
487
|
+
level: s ? "warn" : "ok",
|
|
488
|
+
value: s ? `${t.latest} available` : "current",
|
|
489
|
+
detail: s ? "mcp" === n ? `running ${e} — the MCP client's config decides which server runs (the VS Code extension updates itself)` : `running ${e}` : void 0,
|
|
490
|
+
fix: s ? "mcp" === n ? `npx -y @sheetxl/mcp@${t.tag}` : `npm install -g sheetxl@${t.tag}` : void 0
|
|
443
491
|
};
|
|
444
|
-
}(
|
|
492
|
+
}(k.version, g, t)), {
|
|
445
493
|
product: "SheetXL",
|
|
446
|
-
version:
|
|
447
|
-
build:
|
|
494
|
+
version: k.version,
|
|
495
|
+
build: k.build,
|
|
448
496
|
surface: t,
|
|
449
497
|
collectedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
450
498
|
ok: !$.some((e) => "error" === e.level),
|
|
451
|
-
attended:
|
|
452
|
-
sessions:
|
|
499
|
+
attended: C,
|
|
500
|
+
sessions: m,
|
|
453
501
|
checks: $,
|
|
454
|
-
host: a ?
|
|
502
|
+
host: a ? H() : void 0
|
|
455
503
|
};
|
|
456
504
|
}
|
|
457
|
-
async function
|
|
505
|
+
async function W(e, t) {
|
|
458
506
|
if (e.sessions) return [...await e.sessions()];
|
|
459
507
|
if (t) return [];
|
|
460
508
|
try {
|
|
@@ -472,8 +520,8 @@ async function M(e, t) {
|
|
|
472
520
|
return [];
|
|
473
521
|
}
|
|
474
522
|
}
|
|
475
|
-
function
|
|
476
|
-
const e = n.cpus(), t = process.memoryUsage(),
|
|
523
|
+
function H() {
|
|
524
|
+
const e = n.cpus(), t = process.memoryUsage(), r = n.totalmem();
|
|
477
525
|
return {
|
|
478
526
|
platform: n.platform(),
|
|
479
527
|
release: n.release(),
|
|
@@ -482,39 +530,39 @@ function I() {
|
|
|
482
530
|
arch: process.arch,
|
|
483
531
|
cpuCount: e.length,
|
|
484
532
|
cpuModel: e[0]?.model?.trim() ?? "unknown",
|
|
485
|
-
memoryTotal:
|
|
486
|
-
memoryUsed:
|
|
533
|
+
memoryTotal: r,
|
|
534
|
+
memoryUsed: r - n.freemem(),
|
|
487
535
|
heapTotal: t.heapTotal,
|
|
488
536
|
heapUsed: t.heapUsed,
|
|
489
537
|
nodeEnv: "production",
|
|
490
538
|
configStore: s.join(n.homedir(), ".config", "configstore", "sheetxl.json")
|
|
491
539
|
};
|
|
492
540
|
}
|
|
493
|
-
var
|
|
541
|
+
var V = {
|
|
494
542
|
ok: " ",
|
|
495
543
|
warn: "!",
|
|
496
544
|
error: "✗"
|
|
497
|
-
},
|
|
498
|
-
function
|
|
545
|
+
}, U = (e, n) => "error" === e ? t.red(n) : "warn" === e ? t.yellow(n) : t.white(n);
|
|
546
|
+
function X(e) {
|
|
499
547
|
const t = e.ok ? "engine ready" : "not ready", n = e.attended ? "attended" : "unattended";
|
|
500
|
-
return `${e.product} — ${t} · ${n} · as of ${
|
|
548
|
+
return `${e.product} — ${t} · ${n} · as of ${K(e.collectedAt)}`;
|
|
501
549
|
}
|
|
502
|
-
function
|
|
550
|
+
function K(e) {
|
|
503
551
|
const t = new Date(e);
|
|
504
552
|
return Number.isNaN(t.getTime()) ? "unknown" : t.toTimeString().slice(0, 8);
|
|
505
553
|
}
|
|
506
|
-
function
|
|
507
|
-
const n = e.checks, s = Math.max(...n.map((e) => e.name.length)) + 2,
|
|
508
|
-
|
|
554
|
+
function R(e) {
|
|
555
|
+
const n = e.checks, s = Math.max(...n.map((e) => e.name.length)) + 2, r = " ".repeat(s + 4), o = [];
|
|
556
|
+
o.push(e.ok ? t.cyanBright(X(e)) : t.yellow(X(e))), o.push("");
|
|
509
557
|
for (const e of n) {
|
|
510
|
-
const n = "ok" === e.level ? " " :
|
|
511
|
-
|
|
558
|
+
const n = "ok" === e.level ? " " : U(e.level, V[e.level]), i = t.dim(e.name.padEnd(s)), a = e.detail && e.detail.length <= 44 ? ` ${t.dim(`· ${e.detail}`)}` : "";
|
|
559
|
+
o.push(` ${n} ${i}${U(e.level, e.value)}${a}`), e.detail && !a && o.push(`${r}${t.dim(e.detail)}`), e.fix && o.push(`${r}${t.yellow("→ ")}${t.yellow(e.fix)}`);
|
|
512
560
|
}
|
|
513
|
-
return
|
|
561
|
+
return o.join("\n");
|
|
514
562
|
}
|
|
515
|
-
function
|
|
563
|
+
function Y(e) {
|
|
516
564
|
const t = [];
|
|
517
|
-
t.push(`**${
|
|
565
|
+
t.push(`**${X(e)}**`), t.push("");
|
|
518
566
|
for (const n of e.checks) {
|
|
519
567
|
const e = "ok" === n.level ? "" : "warn" === n.level ? "⚠ " : "✗ ", s = n.detail ? ` — ${n.detail}` : "";
|
|
520
568
|
t.push(`- ${e}**${n.name}**: ${n.value}${s}`);
|
|
@@ -528,8 +576,8 @@ function V(e) {
|
|
|
528
576
|
n.kind,
|
|
529
577
|
void 0 === n.hasView ? null : n.hasView ? "view" : "headless",
|
|
530
578
|
n.active ? "active" : null
|
|
531
|
-
].filter(Boolean).join(", "), s = n.path ? ` path: \`${n.path}\`` : "",
|
|
532
|
-
t.push(`- **${n.name}** id: \`${n.id}\` (${e})${s}${
|
|
579
|
+
].filter(Boolean).join(", "), s = n.path ? ` path: \`${n.path}\`` : "", r = void 0 !== n.openedAt ? ` open since ${K(new Date(n.openedAt).toISOString())}` : "";
|
|
580
|
+
t.push(`- **${n.name}** id: \`${n.id}\` (${e})${s}${r}`);
|
|
533
581
|
}
|
|
534
582
|
}
|
|
535
583
|
const n = e.checks.filter((e) => e.fix);
|
|
@@ -539,86 +587,86 @@ function V(e) {
|
|
|
539
587
|
}
|
|
540
588
|
return t.join("\n");
|
|
541
589
|
}
|
|
542
|
-
var
|
|
590
|
+
var z = "SHEETXL_TOOL_LOG", F = /* @__PURE__ */ new Set([
|
|
543
591
|
"code",
|
|
544
592
|
"source",
|
|
545
593
|
"script",
|
|
546
594
|
"argv"
|
|
547
|
-
]),
|
|
548
|
-
function
|
|
595
|
+
]), q = /(^|[._-])(key|token|secret|password|credential)s?($|[._-])|licen[cs]e/i, G = null, Q = null, Z = Promise.resolve(), ee = {}, te = null;
|
|
596
|
+
function ne(e) {
|
|
549
597
|
const t = function() {
|
|
550
|
-
const e = process.env[
|
|
598
|
+
const e = process.env[z];
|
|
551
599
|
if (void 0 === e) return null;
|
|
552
600
|
const t = e.trim();
|
|
553
601
|
return "" === t || /^(0|false|no|off)$/i.test(t) ? null : /^(1|true|yes|on)$/i.test(t) ? s.join(n.homedir(), ".sheetxl", "logs") : s.resolve(t);
|
|
554
602
|
}();
|
|
555
|
-
if (!t) return
|
|
556
|
-
const
|
|
557
|
-
return
|
|
603
|
+
if (!t) return G = null, null;
|
|
604
|
+
const r = /* @__PURE__ */ new Date(), o = `${r.getFullYear()}${String(r.getMonth() + 1).padStart(2, "0")}${String(r.getDate()).padStart(2, "0")}`, i = e.tag ? `${o}-${e.tag}-${process.pid}.jsonl` : `${o}-${process.pid}.jsonl`;
|
|
605
|
+
return G = s.join(t, i), ee = { transport: e.transport }, G;
|
|
558
606
|
}
|
|
559
|
-
function
|
|
560
|
-
return
|
|
607
|
+
function se() {
|
|
608
|
+
return G;
|
|
561
609
|
}
|
|
562
|
-
function
|
|
563
|
-
return null !==
|
|
610
|
+
function re() {
|
|
611
|
+
return null !== G;
|
|
564
612
|
}
|
|
565
|
-
function
|
|
566
|
-
|
|
567
|
-
...
|
|
613
|
+
function oe(e) {
|
|
614
|
+
ee = {
|
|
615
|
+
...ee,
|
|
568
616
|
...e
|
|
569
617
|
};
|
|
570
618
|
}
|
|
571
|
-
function
|
|
572
|
-
|
|
619
|
+
function ie(e) {
|
|
620
|
+
te = e;
|
|
573
621
|
}
|
|
574
|
-
function
|
|
622
|
+
function ae(e, t) {
|
|
575
623
|
return e.length <= t ? e : e.slice(0, t) + "…[truncated]";
|
|
576
624
|
}
|
|
577
|
-
function
|
|
578
|
-
if (
|
|
625
|
+
function le(e, t) {
|
|
626
|
+
if (q.test(e)) return "[redacted]";
|
|
579
627
|
const n = F.has(e) ? 16384 : 2048;
|
|
580
|
-
return "string" == typeof t ?
|
|
628
|
+
return "string" == typeof t ? ae(t, n) : Array.isArray(t) ? t.map((t) => le(e, t)) : t && "object" == typeof t ? Object.fromEntries(Object.entries(t).filter(([, e]) => void 0 !== e).map(([t, n]) => [t, le(F.has(e) ? e : t, n)])) : t;
|
|
581
629
|
}
|
|
582
|
-
function
|
|
583
|
-
return null == e ? e :
|
|
630
|
+
function ce(e) {
|
|
631
|
+
return null == e ? e : le("", e);
|
|
584
632
|
}
|
|
585
|
-
function
|
|
586
|
-
return
|
|
633
|
+
function ue(e) {
|
|
634
|
+
return ae(e, 2048);
|
|
587
635
|
}
|
|
588
|
-
function
|
|
589
|
-
const t =
|
|
590
|
-
if (!t && !
|
|
591
|
-
const n =
|
|
592
|
-
if (
|
|
593
|
-
|
|
636
|
+
function he(e) {
|
|
637
|
+
const t = G;
|
|
638
|
+
if (!t && !te) return;
|
|
639
|
+
const n = de(e);
|
|
640
|
+
if (te) try {
|
|
641
|
+
te(n);
|
|
594
642
|
} catch {}
|
|
595
643
|
if (!t) return;
|
|
596
|
-
let
|
|
644
|
+
let r;
|
|
597
645
|
try {
|
|
598
|
-
|
|
646
|
+
r = JSON.stringify(n), r.length > 65536 && (r = JSON.stringify({
|
|
599
647
|
...n,
|
|
600
648
|
args: {
|
|
601
649
|
_dropped: !0,
|
|
602
|
-
_bytes:
|
|
650
|
+
_bytes: r.length
|
|
603
651
|
},
|
|
604
|
-
resultPreview: n.resultPreview ?
|
|
652
|
+
resultPreview: n.resultPreview ? ae(n.resultPreview, 1024) : void 0
|
|
605
653
|
}));
|
|
606
654
|
} catch {
|
|
607
655
|
return;
|
|
608
656
|
}
|
|
609
|
-
|
|
610
|
-
|
|
657
|
+
Z = Z.then(async () => {
|
|
658
|
+
Q || (Q = a(s.dirname(t), { recursive: !0 }).then(() => {})), await Q, await i(t, r + "\n", "utf-8");
|
|
611
659
|
}).catch(() => {});
|
|
612
660
|
}
|
|
613
|
-
function
|
|
661
|
+
function de(e) {
|
|
614
662
|
return {
|
|
615
663
|
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
616
664
|
pid: process.pid,
|
|
617
|
-
...
|
|
665
|
+
...ee,
|
|
618
666
|
...e
|
|
619
667
|
};
|
|
620
668
|
}
|
|
621
|
-
function
|
|
622
|
-
return
|
|
669
|
+
function pe() {
|
|
670
|
+
return Z;
|
|
623
671
|
}
|
|
624
|
-
export {
|
|
672
|
+
export { C as CLAUDE_CODE_FIX, T as GENERIC_FIX, _ as MCP_LAUNCH, z as TOOL_LOG_ENV, ce as capArgs, ue as capPreview, O as checkForUpdate, B as collectInfo, N as compareVersions, j as discoverRelay, de as enrichToolLogRecord, b as fetchRelayWorkbooks, M as findMcpRegistrations, pe as flushToolLog, w as formatBuildInstant, y as formatBuildLabel, se as getToolLogPath, ne as initToolLog, re as isToolLogEnabled, he as logToolCall, A as pickUpdate, g as printMarkdown, R as renderInfo, Y as renderInfoMarkdown, oe as setToolLogContext, ie as setToolLogMirror, v as styleMarkdown };
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/utils-node",
|
|
3
3
|
"description": "SheetXL - Node-only utilities: terminal presentation, environment reporting, tool logging",
|
|
4
|
-
"version": "0.8.0-beta.
|
|
5
|
-
"license": "
|
|
4
|
+
"version": "0.8.0-beta.16",
|
|
5
|
+
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
@@ -151,23 +151,21 @@ export declare namespace Info {
|
|
|
151
151
|
* satisfies this without either side knowing about the other — `LicenseManager.getDetails()`
|
|
152
152
|
* is what both surfaces actually pass.
|
|
153
153
|
*
|
|
154
|
-
* Only what a report reads is listed
|
|
155
|
-
*
|
|
154
|
+
* Only what a report reads is listed — the build's identity, and the license row the engine
|
|
155
|
+
* composes itself. What a license means (editions, exceptions, the evaluation's dates, the fix)
|
|
156
|
+
* is the engine's business; this package only lays the row out.
|
|
156
157
|
*/
|
|
157
158
|
interface LicenseSource {
|
|
158
159
|
/** The engine build this license was issued against, and when it was built. */
|
|
159
160
|
getBuildVersion(): string;
|
|
160
161
|
getBuildDate(): string;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
/** Entitlement ceilings, in their stated units (memory is GB). Zero means unmetered. */
|
|
169
|
-
getCpuCount(): number;
|
|
170
|
-
getMemory(): number;
|
|
162
|
+
/** The license as a report row; `includeHost` adds the key's source and capacity. */
|
|
163
|
+
getSummary(includeHost?: boolean): {
|
|
164
|
+
level: 'ok' | 'warn';
|
|
165
|
+
value: string;
|
|
166
|
+
detail?: string;
|
|
167
|
+
fix?: string;
|
|
168
|
+
};
|
|
171
169
|
}
|
|
172
170
|
/** How much the caller is willing to pay for, and what it can answer that the report cannot. */
|
|
173
171
|
interface CollectOptions {
|
|
@@ -10,8 +10,13 @@ export interface McpRegistration {
|
|
|
10
10
|
* telling an agent to "add it to the config" invites it to invent a schema. So the generic fix
|
|
11
11
|
* points at the one-command setup path instead of a file to hand-edit.
|
|
12
12
|
*/
|
|
13
|
-
export declare const CLAUDE_CODE_FIX = "claude mcp add sheetxl -- npx -y sheetxl
|
|
14
|
-
|
|
13
|
+
export declare const CLAUDE_CODE_FIX = "claude mcp add sheetxl -- npx -y @sheetxl/mcp";
|
|
14
|
+
/** The launch line every other client's config carries. */
|
|
15
|
+
export declare const MCP_LAUNCH: {
|
|
16
|
+
readonly command: "npx";
|
|
17
|
+
readonly args: readonly ["-y", "@sheetxl/mcp"];
|
|
18
|
+
};
|
|
19
|
+
export declare const GENERIC_FIX = "npx -y sheetxl setup agent";
|
|
15
20
|
/** Every client config found on this machine that registers the SheetXL MCP server. */
|
|
16
21
|
export declare function findMcpRegistrations(workspace: string): Promise<McpRegistration[]>;
|
|
17
22
|
//# sourceMappingURL=mcpClients.d.ts.map
|
|
@@ -7,24 +7,38 @@
|
|
|
7
7
|
* goes unnoticed for months.
|
|
8
8
|
*/
|
|
9
9
|
export interface UpdateStatus {
|
|
10
|
+
/** The newest version on the running build's channel, or `null` when unknown. */
|
|
10
11
|
readonly latest: string | null;
|
|
12
|
+
/** The dist-tag that installs {@link latest}. */
|
|
13
|
+
readonly tag: string | null;
|
|
11
14
|
readonly cacheStatus: 'fresh' | 'refreshed' | 'missing';
|
|
12
15
|
}
|
|
13
16
|
/**
|
|
14
|
-
* The
|
|
17
|
+
* The newest release a `current` build should move to.
|
|
15
18
|
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* A stable build follows `latest`. A prerelease follows `beta` — `latest` stays on the last
|
|
21
|
+
* stable release for the whole beta — but still hears about a stable release that overtakes it.
|
|
22
|
+
*/
|
|
23
|
+
export declare function pickUpdate(current: string, tags: Readonly<Record<string, string>>): {
|
|
24
|
+
latest: string;
|
|
25
|
+
tag: string;
|
|
26
|
+
} | null;
|
|
27
|
+
/**
|
|
28
|
+
* The newest published SheetXL on `current`'s channel, from cache when fresh.
|
|
29
|
+
*
|
|
30
|
+
* @param current The running engine version; its prerelease tail picks the channel.
|
|
16
31
|
* @param now Injected so the TTL is testable without a clock.
|
|
17
32
|
*/
|
|
18
|
-
export declare function checkForUpdate(now?: number): Promise<UpdateStatus>;
|
|
33
|
+
export declare function checkForUpdate(current: string, now?: number): Promise<UpdateStatus>;
|
|
19
34
|
/**
|
|
20
|
-
* Compares two
|
|
35
|
+
* Compares two versions with semver precedence.
|
|
21
36
|
*
|
|
22
37
|
* @returns positive when `a` is newer than `b`.
|
|
23
38
|
*
|
|
24
39
|
* @remarks
|
|
25
|
-
* Not a semver dependency for one comparison.
|
|
26
|
-
* prerelease
|
|
27
|
-
* deliberately installed a `-next` build.
|
|
40
|
+
* Not a semver dependency for one comparison. A prerelease sorts before its release, and
|
|
41
|
+
* prerelease identifiers compare numerically when both are numbers (`beta.10` after `beta.9`).
|
|
28
42
|
*/
|
|
29
43
|
export declare function compareVersions(a: string, b: string): number;
|
|
30
44
|
//# sourceMappingURL=updateCheck.d.ts.map
|