@proofofwork-agency/toolpin 0.2.3
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/CONTRIBUTING.md +117 -0
- package/LICENSE +183 -0
- package/README.md +323 -0
- package/SECURITY.md +61 -0
- package/action.yml +134 -0
- package/dist/canonicalJson.js +38 -0
- package/dist/capabilities.js +139 -0
- package/dist/ci.js +26 -0
- package/dist/cli.js +1843 -0
- package/dist/clientSupport.js +76 -0
- package/dist/codexToml.js +213 -0
- package/dist/config.js +337 -0
- package/dist/constants.js +3 -0
- package/dist/continueYaml.js +76 -0
- package/dist/doctor.js +163 -0
- package/dist/install.js +191 -0
- package/dist/installed.js +405 -0
- package/dist/integrity.js +14 -0
- package/dist/inventory.js +169 -0
- package/dist/packageIntegrity.js +153 -0
- package/dist/plan.js +595 -0
- package/dist/policy.js +310 -0
- package/dist/registry.js +1610 -0
- package/dist/runtimeAdvisory.js +80 -0
- package/dist/safeFetch.js +157 -0
- package/dist/sarif.js +162 -0
- package/dist/scan.js +113 -0
- package/dist/search.js +44 -0
- package/dist/secrets.js +165 -0
- package/dist/signing.js +146 -0
- package/dist/tester.js +240 -0
- package/dist/trust.js +528 -0
- package/dist/tui/app.js +1731 -0
- package/dist/tui/command.js +50 -0
- package/dist/tui/configSnippet.js +11 -0
- package/dist/tui/constants.js +37 -0
- package/dist/tui/format.js +31 -0
- package/dist/tui/installedState.js +23 -0
- package/dist/tui/layout.js +65 -0
- package/dist/tui/selectors.js +282 -0
- package/dist/tui/types.js +1 -0
- package/dist/tui/ui/trust.js +77 -0
- package/dist/tui/views/installed.js +82 -0
- package/dist/tui/views/panels.js +637 -0
- package/dist/tui.js +12 -0
- package/dist/types.js +1 -0
- package/dist/verificationTrust.js +103 -0
- package/dist/verify.js +537 -0
- package/dist/version.js +1 -0
- package/dist/versions.js +127 -0
- package/docs/assets/readme/terminal-demo.svg +174 -0
- package/docs/assets/readme/tui-browse-overview.jpg +0 -0
- package/docs/assets/readme/tui-config-preview.jpg +0 -0
- package/docs/assets/readme/tui-help.jpg +0 -0
- package/docs/assets/readme/tui-installed-inventory.jpg +0 -0
- package/docs/how-to/catch-drift-in-ci.md +189 -0
- package/docs/how-to/custom-registries.md +156 -0
- package/docs/how-to/toolpin-curated-registry.md +153 -0
- package/package.json +76 -0
- package/registry/README.md +92 -0
- package/registry/v0/servers +115 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { CHROME, ERR, MUTED, OK, SURFACE, WARN } from "../constants.js";
|
|
4
|
+
import { listWindowStart } from "../layout.js";
|
|
5
|
+
import { shortPath, truncate } from "../format.js";
|
|
6
|
+
export function InstalledServersView({ rows, selected, height, width, loading, }) {
|
|
7
|
+
const visibleCount = Math.max(3, height - 3);
|
|
8
|
+
const start = listWindowStart(selected, visibleCount, rows.length);
|
|
9
|
+
const visible = rows.slice(start, start + visibleCount);
|
|
10
|
+
const selectedRow = rows[selected];
|
|
11
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 3, height: height, children: [_jsxs(Box, { justifyContent: "space-between", children: [_jsx(Text, { color: MUTED, children: "Installed MCP servers" }), _jsx(Text, { color: loading ? WARN : MUTED, children: loading ? "refreshing..." : `${rows.length} found` })] }), rows.length === 0 ? _jsx(Text, { color: MUTED, children: "No installed MCP server entries found in checked config files." }) : null, visible.map((row, index) => (_jsx(InstalledRow, { row: row, selected: start + index === selected, width: width }, row.id))), selectedRow ? (_jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsx(Text, { color: CHROME, children: "-".repeat(Math.max(0, width - 6)) }), _jsxs(Text, { color: CHROME, wrap: "truncate", children: [" ", "selected ", selected + 1, " of ", rows.length, " u registry+lock v/V version U update locked x delete t test-installed d doctor g scope"] })] })) : null] }));
|
|
12
|
+
}
|
|
13
|
+
export function InstalledServerDetails({ row, width, selectedVersion, selectedTarget, runtimeAdvisory, }) {
|
|
14
|
+
if (!row) {
|
|
15
|
+
return (_jsx(Box, { flexDirection: "column", backgroundColor: SURFACE, paddingX: 2, paddingY: 1, flexGrow: 1, children: _jsx(Text, { color: MUTED, children: "No installed server selected." }) }));
|
|
16
|
+
}
|
|
17
|
+
return (_jsxs(Box, { flexDirection: "column", backgroundColor: SURFACE, paddingX: 2, paddingY: 1, flexGrow: 1, children: [_jsx(Text, { bold: true, color: "white", wrap: "truncate", children: row.serverName }), _jsxs(Text, { color: MUTED, wrap: "truncate", children: [row.client, " ", scopeText(row.scope), " ", shortPath(row.file)] }), _jsx(Spacer, {}), _jsx(Metric, { label: "lock", value: row.locked ? row.lockDrift ? "drift" : "locked" : "unlocked", color: row.lockDrift ? ERR : row.locked ? OK : WARN }), _jsx(Metric, { label: "version", value: versionText(row), color: row.updateAvailable ? WARN : row.locked ? OK : MUTED }), _jsx(Metric, { label: "source", value: row.source ?? "unknown" }), _jsx(Metric, { label: "runtime", value: row.runningStatus, color: row.runningStatus === "reachable" ? OK : row.runningStatus === "stale" ? WARN : MUTED }), runtimeAdvisory ? _jsx(Metric, { label: "endpoint", value: `${runtimeAdvisory.url} ${runtimeAdvisory.running ? "accepting connections" : "not accepting connections"}`, color: runtimeAdvisory.running ? OK : WARN }) : null, _jsx(Metric, { label: "match", value: matchText(row), color: row.registryMatch ? OK : MUTED }), _jsx(Metric, { label: "actions", value: actionText(row), color: row.canUpdate ? WARN : MUTED }), row.lifecycleAction !== "none" || selectedVersion ? _jsx(Metric, { label: "u action", value: lifecycleExplanation(row, selectedVersion), color: WARN }) : null, _jsx(Metric, { label: "test target", value: row.testSource === "config" ? `installed config: ${shortPath(row.file)}` : row.testSource, color: row.canTest ? OK : MUTED }), selectedTarget ? _jsx(Metric, { label: selectedVersion ? "selected" : "target", value: `${selectedTarget.name}@${selectedTarget.version}${selectedVersion ? " (press u to apply)" : ""}`, color: row.lifecycleAction === "none" && !selectedVersion ? MUTED : WARN }) : null, row.issue ? _jsxs(Text, { color: WARN, wrap: "truncate", children: ["drift ", truncate(row.issue, width - 18)] }) : null, row.testResult ? (_jsxs(_Fragment, { children: [_jsx(Spacer, {}), _jsxs(Text, { color: row.testResult.ok ? OK : ERR, wrap: "truncate", children: ["test ", row.testResult.ok ? "passed" : "failed", ": ", truncate(row.testResult.message, width - 20)] }), _jsxs(Text, { color: MUTED, wrap: "truncate", children: ["target ", truncate(row.testResult.target, width - 18)] }), row.testResult.tools.slice(0, 4).map((tool) => (_jsxs(Text, { color: "white", wrap: "truncate", children: ["tool ", tool.name, tool.description ? _jsxs(Text, { color: MUTED, children: [" - ", truncate(tool.description, width - tool.name.length - 20)] }) : null] }, tool.name)))] })) : null] }));
|
|
18
|
+
}
|
|
19
|
+
function InstalledRow({ row, selected, width }) {
|
|
20
|
+
const contentWidth = Math.max(32, width - 6);
|
|
21
|
+
const registryWidth = contentWidth < 88 ? 12 : 15;
|
|
22
|
+
const versionWidth = contentWidth < 88 ? 10 : 13;
|
|
23
|
+
const actionWidth = contentWidth < 88 ? 0 : 12;
|
|
24
|
+
const testWidth = contentWidth >= 112 ? 12 : 0;
|
|
25
|
+
const fileWidth = contentWidth >= 132 ? Math.min(24, contentWidth - 108) : 0;
|
|
26
|
+
const fixedWidth = 1 + 8 + 10 + 9 + versionWidth + registryWidth + actionWidth + testWidth + fileWidth;
|
|
27
|
+
const nameWidth = Math.max(14, contentWidth - fixedWidth);
|
|
28
|
+
const version = row.updateAvailable
|
|
29
|
+
? `${row.lockedVersion ?? "unknown"} -> ${row.latestVersion}`
|
|
30
|
+
: row.lockedVersion ?? row.currentVersion ?? "unknown";
|
|
31
|
+
const lock = row.lockDrift ? "drift" : row.locked ? "locked" : "unlocked";
|
|
32
|
+
const registry = `registry:${row.registryStatus}`;
|
|
33
|
+
const action = `action:${row.lifecycleAction}`;
|
|
34
|
+
const test = `test:${row.testSource}`;
|
|
35
|
+
return (_jsxs(Text, { wrap: "truncate", children: [_jsx(Text, { color: selected ? OK : CHROME, children: selected ? ">" : ":" }), _jsx(Text, { color: scopeColor(row.scope), children: column(row.scope, 8) }), _jsx(Text, { color: MUTED, children: column(row.client, 10) }), _jsx(Text, { bold: selected, color: "white", children: column(row.serverName, nameWidth) }), _jsx(Text, { color: lock === "drift" ? ERR : lock === "locked" ? OK : WARN, children: lock.padEnd(9) }), _jsx(Text, { color: row.updateAvailable ? WARN : MUTED, children: column(version, versionWidth) }), _jsx(Text, { color: row.registryStatus === "none" ? MUTED : OK, children: column(registry, registryWidth) }), actionWidth > 0 ? _jsx(Text, { color: row.lifecycleAction === "none" ? MUTED : WARN, children: column(action, actionWidth) }) : null, testWidth > 0 ? _jsx(Text, { color: row.testSource === "none" ? MUTED : OK, children: column(test, testWidth) }) : null, fileWidth > 0 ? _jsx(Text, { color: CHROME, children: column(shortPath(row.file), fileWidth) }) : null] }));
|
|
36
|
+
}
|
|
37
|
+
function column(value, width) {
|
|
38
|
+
return ` ${truncate(value, Math.max(0, width - 1)).padEnd(Math.max(0, width - 1))}`;
|
|
39
|
+
}
|
|
40
|
+
function Metric({ label, value, color }) {
|
|
41
|
+
return (_jsxs(Text, { wrap: "truncate", children: [_jsx(Text, { color: MUTED, children: label.padEnd(12) }), _jsx(Text, { color: color ?? "white", children: value })] }));
|
|
42
|
+
}
|
|
43
|
+
function versionText(row) {
|
|
44
|
+
if (row.updateAvailable)
|
|
45
|
+
return `${row.lockedVersion ?? "unknown"} -> ${row.latestVersion}`;
|
|
46
|
+
if (row.lockedVersion)
|
|
47
|
+
return row.latestVersion && row.latestVersion !== row.lockedVersion ? `${row.lockedVersion} latest ${row.latestVersion}` : row.lockedVersion;
|
|
48
|
+
return row.latestVersion ? `unlocked latest ${row.latestVersion}` : "unknown";
|
|
49
|
+
}
|
|
50
|
+
function actionText(row) {
|
|
51
|
+
const actions = [];
|
|
52
|
+
if (row.lifecycleAction !== "none")
|
|
53
|
+
actions.push(row.lifecycleAction);
|
|
54
|
+
if (row.canDelete)
|
|
55
|
+
actions.push("delete");
|
|
56
|
+
if (row.canTest)
|
|
57
|
+
actions.push("test-installed");
|
|
58
|
+
return actions.join(", ") || "none";
|
|
59
|
+
}
|
|
60
|
+
function lifecycleExplanation(row, selectedVersion) {
|
|
61
|
+
if (selectedVersion)
|
|
62
|
+
return "rewrite installed config and mcp-lock.json for selected version";
|
|
63
|
+
if (row.lifecycleAction === "adopt")
|
|
64
|
+
return "find registry match, replace alias if needed, write mcp-lock.json";
|
|
65
|
+
if (row.lifecycleAction === "update")
|
|
66
|
+
return "resolve locked server in registry, update config, update mcp-lock.json";
|
|
67
|
+
return "none";
|
|
68
|
+
}
|
|
69
|
+
function matchText(row) {
|
|
70
|
+
if (row.registryCandidates?.length)
|
|
71
|
+
return `ambiguous alias: ${row.registryCandidates.join(", ")}`;
|
|
72
|
+
return row.registryMatch ? `${row.registryMatch} registry` : "none";
|
|
73
|
+
}
|
|
74
|
+
function scopeText(scope) {
|
|
75
|
+
return scope === "project" ? "folder/project" : "global/user";
|
|
76
|
+
}
|
|
77
|
+
function scopeColor(scope) {
|
|
78
|
+
return scope === "project" ? OK : WARN;
|
|
79
|
+
}
|
|
80
|
+
function Spacer() {
|
|
81
|
+
return _jsx(Text, { children: " " });
|
|
82
|
+
}
|