@kwonye/mcpx 0.1.105 → 0.1.106
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/adapters/codex.d.ts +2 -0
- package/dist/adapters/index.d.ts +2 -1
- package/dist/adapters/json.d.ts +26 -0
- package/dist/adapters/pi.d.ts +9 -0
- package/dist/chunk-0xt563m1.js +126 -0
- package/dist/{chunk-btbww96n.js → chunk-1mrkz29t.js} +69 -56
- package/dist/{chunk-6mxr34tc.js → chunk-1v66g9d6.js} +4 -3
- package/dist/chunk-1yq3yb66.js +126 -0
- package/dist/chunk-27mq4agf.js +33 -0
- package/dist/{chunk-t4hqf6yh.js → chunk-4aafp444.js} +8136 -8262
- package/dist/chunk-4xym942z.js +36 -0
- package/dist/{chunk-tnhekcpv.js → chunk-56z18csx.js} +1 -1
- package/dist/{chunk-bnbz55g6.js → chunk-65kshh9w.js} +1 -1
- package/dist/{chunk-xydajvzg.js → chunk-7ky3rsw9.js} +1 -1
- package/dist/chunk-7rq88hb3.js +563 -0
- package/dist/chunk-8v13hqrp.js +825 -0
- package/dist/chunk-a2gen8bn.js +730 -0
- package/dist/{chunk-01s7rhx3.js → chunk-brxwa30j.js} +130 -113
- package/dist/chunk-chaj8a8b.js +45 -0
- package/dist/chunk-e96643mj.js +26 -0
- package/dist/{chunk-d2v9rxy0.js → chunk-ew06e41w.js} +12 -6
- package/dist/chunk-ezk8txcy.js +23 -0
- package/dist/{chunk-4y0t0tfj.js → chunk-grkz21sq.js} +29 -3
- package/dist/{chunk-12vgqm89.js → chunk-gvjxpk98.js} +1 -1
- package/dist/chunk-h9kp47rp.js +18 -0
- package/dist/chunk-hahs24dv.js +127 -0
- package/dist/{chunk-y9a1rx7j.js → chunk-jv0s0cp6.js} +5 -3
- package/dist/{chunk-enzmq965.js → chunk-n0462d52.js} +1 -1
- package/dist/chunk-nh6hhv29.js +138 -0
- package/dist/chunk-p7yzyt87.js +19426 -0
- package/dist/chunk-q86c5s6r.js +7 -0
- package/dist/chunk-qf8bj9y7.js +254 -0
- package/dist/chunk-t20f49g3.js +30 -0
- package/dist/{chunk-am903qjk.js → chunk-v041118a.js} +11 -5
- package/dist/{chunk-91vcwk5m.js → chunk-v14bg5yp.js} +1 -1
- package/dist/chunk-wvzap0na.js +18166 -0
- package/dist/chunk-wztmp5b4.js +30479 -0
- package/dist/chunk-xvqr1q9b.js +14 -0
- package/dist/{chunk-h158rkts.js → chunk-yj7mpczw.js} +17 -5
- package/dist/chunk-yr0txkw0.js +31 -0
- package/dist/cli.js +3879 -1061
- package/dist/core/adoption.d.ts +62 -0
- package/dist/core/analytics.d.ts +17 -0
- package/dist/core/consumers.d.ts +8 -0
- package/dist/core/control.d.ts +12 -0
- package/dist/core/daemon.d.ts +2 -2
- package/dist/core/file-state.d.ts +5 -0
- package/dist/core/harnesses.d.ts +25 -0
- package/dist/core/index.d.ts +12 -4
- package/dist/core/index.js +109 -71
- package/dist/core/managed-index-lock.d.ts +1 -1
- package/dist/core/management.d.ts +32 -0
- package/dist/core/native-document.d.ts +4 -0
- package/dist/core/operations.d.ts +52 -0
- package/dist/core/plugin-projections.d.ts +1 -0
- package/dist/core/runtime-entry.d.ts +6 -0
- package/dist/core/runtime-snapshot.d.ts +6 -0
- package/dist/core/secret-keychain.d.ts +31 -0
- package/dist/core/secrets.d.ts +12 -2
- package/dist/core/served-skills.d.ts +62 -0
- package/dist/core/status.d.ts +1 -0
- package/dist/core/sync-plan.d.ts +14 -0
- package/dist/core/sync.d.ts +3 -0
- package/dist/core/telemetry.d.ts +2 -2
- package/dist/core/tui.d.ts +20 -0
- package/dist/core/verify-upstreams.d.ts +4 -0
- package/dist/core/work-limiter.d.ts +10 -0
- package/dist/gateway/server.d.ts +2 -0
- package/dist/types.d.ts +62 -1
- package/dist/util/fs.d.ts +2 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/adapters/opencode.d.ts +0 -11
- package/dist/chunk-56whm3hm.js +0 -4055
- package/dist/chunk-fw8dyt89.js +0 -344
|
@@ -10,8 +10,10 @@ import {
|
|
|
10
10
|
unregisterProject,
|
|
11
11
|
updateServer,
|
|
12
12
|
validateServerName
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import"./chunk-
|
|
13
|
+
} from "./chunk-8v13hqrp.js";
|
|
14
|
+
import"./chunk-chaj8a8b.js";
|
|
15
|
+
import"./chunk-p7yzyt87.js";
|
|
16
|
+
import"./chunk-grkz21sq.js";
|
|
15
17
|
import"./chunk-bjw71y54.js";
|
|
16
18
|
import"./chunk-wj4tjacg.js";
|
|
17
19
|
export {
|
|
@@ -28,4 +30,4 @@ export {
|
|
|
28
30
|
validateServerName
|
|
29
31
|
};
|
|
30
32
|
|
|
31
|
-
//# debugId=
|
|
33
|
+
//# debugId=C3D1D7BBE2A2B6FA64756E2164756E21
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
listAuthBindings,
|
|
3
|
+
secretRefName
|
|
4
|
+
} from "./chunk-0xt563m1.js";
|
|
5
|
+
import {
|
|
6
|
+
getDaemonStatus
|
|
7
|
+
} from "./chunk-wvzap0na.js";
|
|
8
|
+
import {
|
|
9
|
+
getAdapters,
|
|
10
|
+
getGatewayInternalUrl,
|
|
11
|
+
getGatewayUrl,
|
|
12
|
+
installationAdapters
|
|
13
|
+
} from "./chunk-wztmp5b4.js";
|
|
14
|
+
import {
|
|
15
|
+
SecretsManager,
|
|
16
|
+
ensureGatewayToken
|
|
17
|
+
} from "./chunk-8v13hqrp.js";
|
|
18
|
+
import {
|
|
19
|
+
isServerEnabled
|
|
20
|
+
} from "./chunk-bjw71y54.js";
|
|
21
|
+
|
|
22
|
+
// src/core/status.ts
|
|
23
|
+
var STATUS_CLIENTS = getAdapters().map((adapter) => adapter.id);
|
|
24
|
+
function describeServerTarget(spec) {
|
|
25
|
+
if (spec.transport === "http") {
|
|
26
|
+
return spec.url;
|
|
27
|
+
}
|
|
28
|
+
const args = (spec.args ?? []).join(" ");
|
|
29
|
+
const command = `${spec.command}${args ? ` ${args}` : ""}`;
|
|
30
|
+
return spec.cwd ? `${command} (cwd: ${spec.cwd})` : command;
|
|
31
|
+
}
|
|
32
|
+
function deriveClientStatus(managed, configured) {
|
|
33
|
+
if (configured) {
|
|
34
|
+
return configured;
|
|
35
|
+
}
|
|
36
|
+
return managed ? "SYNCED" : "SKIPPED";
|
|
37
|
+
}
|
|
38
|
+
function buildClientMappings(config, managedIndex, serverName) {
|
|
39
|
+
return installationAdapters(config).map(({ adapter }) => {
|
|
40
|
+
const clientId = adapter.id;
|
|
41
|
+
const configState = config.clients[clientId];
|
|
42
|
+
const managedClient = managedIndex.managed[clientId];
|
|
43
|
+
const managedEntry = managedClient?.entries?.[adapter.managedName?.(serverName) ?? `${serverName} (mcpx)`];
|
|
44
|
+
const managed = Boolean(managedEntry);
|
|
45
|
+
return {
|
|
46
|
+
clientId,
|
|
47
|
+
managed,
|
|
48
|
+
status: deriveClientStatus(managed, configState?.status),
|
|
49
|
+
configPath: managedClient?.configPath ?? configState?.configPath,
|
|
50
|
+
message: configState?.message,
|
|
51
|
+
lastSyncAt: managedEntry?.lastSyncedAt ?? configState?.lastSyncAt
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function buildAuthBindings(spec) {
|
|
56
|
+
return listAuthBindings(spec).map((binding) => ({
|
|
57
|
+
kind: binding.kind,
|
|
58
|
+
key: binding.key,
|
|
59
|
+
value: binding.value,
|
|
60
|
+
secretName: secretRefName(binding.value) ?? undefined
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
async function fetchTokenCounts(gatewayUrl, token) {
|
|
64
|
+
try {
|
|
65
|
+
const res = await fetch(gatewayUrl, {
|
|
66
|
+
method: "POST",
|
|
67
|
+
headers: {
|
|
68
|
+
authorization: `Bearer ${token}`
|
|
69
|
+
},
|
|
70
|
+
signal: AbortSignal.timeout(65000)
|
|
71
|
+
});
|
|
72
|
+
if (!res.ok) {
|
|
73
|
+
return { counts: {}, fetchError: `HTTP ${res.status}` };
|
|
74
|
+
}
|
|
75
|
+
const data = await res.json();
|
|
76
|
+
return { counts: data?.counts ?? {} };
|
|
77
|
+
} catch (error) {
|
|
78
|
+
return { counts: {}, fetchError: error instanceof Error ? error.message : String(error) };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function buildStatusReport(config, managedIndex, daemon = getDaemonStatus(config)) {
|
|
82
|
+
const secrets = new SecretsManager;
|
|
83
|
+
const token = ensureGatewayToken(config, secrets);
|
|
84
|
+
const gatewayUrl = getGatewayUrl(config);
|
|
85
|
+
let tokenCounts = {};
|
|
86
|
+
let tokenCountFetchError;
|
|
87
|
+
if (daemon.running) {
|
|
88
|
+
const result = await fetchTokenCounts(getGatewayInternalUrl(config, "/internal/token-counts"), token);
|
|
89
|
+
tokenCounts = result.counts;
|
|
90
|
+
tokenCountFetchError = result.fetchError;
|
|
91
|
+
}
|
|
92
|
+
const projectEntries = Object.values(config.projects ?? {});
|
|
93
|
+
let totalGlobalTokens = 0;
|
|
94
|
+
const totalProjectTokens = {};
|
|
95
|
+
const serverNames = Object.keys(config.servers).sort((left, right) => left.localeCompare(right));
|
|
96
|
+
const servers = serverNames.map((name) => {
|
|
97
|
+
const spec = config.servers[name];
|
|
98
|
+
let tokenCount = tokenCounts[name];
|
|
99
|
+
if (tokenCount?.error && buildAuthBindings(spec).length > 0 && tokenCount.total > 0) {
|
|
100
|
+
tokenCount = { ...tokenCount, error: undefined };
|
|
101
|
+
}
|
|
102
|
+
const health = tokenCount ? tokenCount.error || tokenCount.runtimeError ? "error" : "ok" : "unknown";
|
|
103
|
+
const serverEntry = {
|
|
104
|
+
name,
|
|
105
|
+
enabled: isServerEnabled(spec),
|
|
106
|
+
transport: spec.transport,
|
|
107
|
+
target: describeServerTarget(spec),
|
|
108
|
+
authBindings: buildAuthBindings(spec),
|
|
109
|
+
clients: buildClientMappings(config, managedIndex, name),
|
|
110
|
+
tokenCount,
|
|
111
|
+
health
|
|
112
|
+
};
|
|
113
|
+
if (serverEntry.enabled && tokenCount) {
|
|
114
|
+
totalGlobalTokens += tokenCount.total;
|
|
115
|
+
for (const projectEntry of projectEntries) {
|
|
116
|
+
if (!(projectEntry.disabledServers ?? []).includes(name)) {
|
|
117
|
+
totalProjectTokens[projectEntry.path] = (totalProjectTokens[projectEntry.path] ?? 0) + tokenCount.total;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return serverEntry;
|
|
122
|
+
});
|
|
123
|
+
return {
|
|
124
|
+
gatewayUrl,
|
|
125
|
+
fetchError: tokenCountFetchError,
|
|
126
|
+
daemon,
|
|
127
|
+
upstreamCount: servers.length,
|
|
128
|
+
servers,
|
|
129
|
+
clients: config.clients,
|
|
130
|
+
projects: config.projects,
|
|
131
|
+
totalGlobalTokens,
|
|
132
|
+
totalProjectTokens
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export { STATUS_CLIENTS, buildStatusReport };
|
|
137
|
+
|
|
138
|
+
//# debugId=5813D4CDEF97EC7C64756E2164756E21
|