@tendrilapp/cli 0.1.9 → 0.1.10
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/dist/tendril-mcp.js +7 -0
- package/dist/tendril.js +39 -3
- package/package.json +1 -1
package/dist/tendril-mcp.js
CHANGED
|
@@ -46,6 +46,13 @@ var TOOLS = [
|
|
|
46
46
|
...i["componentSet"] !== void 0 ? ["--component-set", i["componentSet"]] : []
|
|
47
47
|
]
|
|
48
48
|
},
|
|
49
|
+
{
|
|
50
|
+
name: "tendril_doctor",
|
|
51
|
+
annotations: { readOnlyHint: true },
|
|
52
|
+
description: "Machine readiness + version status in one shot: installed vs latest version (with publish date and update remediation), browser identity, font-cache state, Figma desktop MCP reachability. Use to self-diagnose before recording/scoring, or whenever versions are in question. Exit 1 = something not ready; the report says exactly what and how to fix it.",
|
|
53
|
+
schema: z.object({}),
|
|
54
|
+
argv: () => ["doctor"]
|
|
55
|
+
},
|
|
49
56
|
{
|
|
50
57
|
name: "tendril_record_next",
|
|
51
58
|
annotations: { readOnlyHint: true },
|
package/dist/tendril.js
CHANGED
|
@@ -9405,15 +9405,51 @@ async function runDoctorChecks(options) {
|
|
|
9405
9405
|
});
|
|
9406
9406
|
return { ok: checks.filter((c) => c.name !== "figma-pat" && c.name !== "openrouter-key").every((c) => c.ok), checks };
|
|
9407
9407
|
}
|
|
9408
|
+
function versionIsNewer(a, b) {
|
|
9409
|
+
const pa = a.split(".").map(Number);
|
|
9410
|
+
const pb = b.split(".").map(Number);
|
|
9411
|
+
for (let i = 0; i < 3; i++) {
|
|
9412
|
+
if ((pb[i] ?? 0) > (pa[i] ?? 0)) return true;
|
|
9413
|
+
if ((pb[i] ?? 0) < (pa[i] ?? 0)) return false;
|
|
9414
|
+
}
|
|
9415
|
+
return false;
|
|
9416
|
+
}
|
|
9417
|
+
async function latestVersionInfo() {
|
|
9418
|
+
try {
|
|
9419
|
+
const ctl = new AbortController();
|
|
9420
|
+
const timer = setTimeout(() => ctl.abort(), 2500);
|
|
9421
|
+
const res = await fetch("https://registry.npmjs.org/@tendrilapp%2fcli", { signal: ctl.signal });
|
|
9422
|
+
clearTimeout(timer);
|
|
9423
|
+
if (!res.ok) return null;
|
|
9424
|
+
const doc = await res.json();
|
|
9425
|
+
const latest = doc["dist-tags"]?.latest;
|
|
9426
|
+
if (latest === void 0) return null;
|
|
9427
|
+
const stamp = doc.time?.[latest];
|
|
9428
|
+
return { latest, ...stamp !== void 0 ? { publishedAt: stamp.slice(0, 10) } : {} };
|
|
9429
|
+
} catch {
|
|
9430
|
+
return null;
|
|
9431
|
+
}
|
|
9432
|
+
}
|
|
9408
9433
|
async function runDoctor(flags) {
|
|
9409
9434
|
if (flags.describe) {
|
|
9410
9435
|
printDescription(DOCTOR_DESCRIPTION);
|
|
9411
9436
|
return;
|
|
9412
9437
|
}
|
|
9413
|
-
const report = await runDoctorChecks({ ...flags.mcpUrl ? { mcpUrl: flags.mcpUrl } : {} });
|
|
9414
|
-
emitData(flags, { version: cliVersion(), ...report }, () => {
|
|
9415
|
-
|
|
9438
|
+
const [report, latest] = await Promise.all([runDoctorChecks({ ...flags.mcpUrl ? { mcpUrl: flags.mcpUrl } : {} }), latestVersionInfo()]);
|
|
9439
|
+
emitData(flags, { version: cliVersion(), ...latest !== null ? { latest: latest.latest, latestPublishedAt: latest.publishedAt ?? null, updateAvailable: versionIsNewer(cliVersion(), latest.latest) } : {}, ...report }, () => {
|
|
9440
|
+
const version = cliVersion();
|
|
9441
|
+
if (latest === null) {
|
|
9442
|
+
process.stdout.write(`tendril ${version} (latest: unreachable)
|
|
9443
|
+
`);
|
|
9444
|
+
} else if (!versionIsNewer(version, latest.latest)) {
|
|
9445
|
+
process.stdout.write(`tendril ${version} (${latest.latest === version ? "latest" : `ahead of registry ${latest.latest}`}${latest.publishedAt !== void 0 ? `, published ${latest.publishedAt}` : ""})
|
|
9446
|
+
`);
|
|
9447
|
+
} else {
|
|
9448
|
+
process.stdout.write(`tendril ${version} \u2014 UPDATE AVAILABLE: ${latest.latest}${latest.publishedAt !== void 0 ? ` (published ${latest.publishedAt})` : ""}
|
|
9449
|
+
`);
|
|
9450
|
+
process.stdout.write(` \u2192 npm install -g @tendrilapp/cli@latest (plugin MCP users update automatically at next session; a stale npx cache clears with npm cache clean --force)
|
|
9416
9451
|
`);
|
|
9452
|
+
}
|
|
9417
9453
|
for (const check of report.checks) {
|
|
9418
9454
|
process.stdout.write(`${check.ok ? "\u2713" : "\u2717"} ${check.name}: ${check.detail}
|
|
9419
9455
|
`);
|