@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.
Files changed (75) hide show
  1. package/dist/adapters/codex.d.ts +2 -0
  2. package/dist/adapters/index.d.ts +2 -1
  3. package/dist/adapters/json.d.ts +26 -0
  4. package/dist/adapters/pi.d.ts +9 -0
  5. package/dist/chunk-0xt563m1.js +126 -0
  6. package/dist/{chunk-btbww96n.js → chunk-1mrkz29t.js} +69 -56
  7. package/dist/{chunk-6mxr34tc.js → chunk-1v66g9d6.js} +4 -3
  8. package/dist/chunk-1yq3yb66.js +126 -0
  9. package/dist/chunk-27mq4agf.js +33 -0
  10. package/dist/{chunk-t4hqf6yh.js → chunk-4aafp444.js} +8136 -8262
  11. package/dist/chunk-4xym942z.js +36 -0
  12. package/dist/{chunk-tnhekcpv.js → chunk-56z18csx.js} +1 -1
  13. package/dist/{chunk-bnbz55g6.js → chunk-65kshh9w.js} +1 -1
  14. package/dist/{chunk-xydajvzg.js → chunk-7ky3rsw9.js} +1 -1
  15. package/dist/chunk-7rq88hb3.js +563 -0
  16. package/dist/chunk-8v13hqrp.js +825 -0
  17. package/dist/chunk-a2gen8bn.js +730 -0
  18. package/dist/{chunk-01s7rhx3.js → chunk-brxwa30j.js} +130 -113
  19. package/dist/chunk-chaj8a8b.js +45 -0
  20. package/dist/chunk-e96643mj.js +26 -0
  21. package/dist/{chunk-d2v9rxy0.js → chunk-ew06e41w.js} +12 -6
  22. package/dist/chunk-ezk8txcy.js +23 -0
  23. package/dist/{chunk-4y0t0tfj.js → chunk-grkz21sq.js} +29 -3
  24. package/dist/{chunk-12vgqm89.js → chunk-gvjxpk98.js} +1 -1
  25. package/dist/chunk-h9kp47rp.js +18 -0
  26. package/dist/chunk-hahs24dv.js +127 -0
  27. package/dist/{chunk-y9a1rx7j.js → chunk-jv0s0cp6.js} +5 -3
  28. package/dist/{chunk-enzmq965.js → chunk-n0462d52.js} +1 -1
  29. package/dist/chunk-nh6hhv29.js +138 -0
  30. package/dist/chunk-p7yzyt87.js +19426 -0
  31. package/dist/chunk-q86c5s6r.js +7 -0
  32. package/dist/chunk-qf8bj9y7.js +254 -0
  33. package/dist/chunk-t20f49g3.js +30 -0
  34. package/dist/{chunk-am903qjk.js → chunk-v041118a.js} +11 -5
  35. package/dist/{chunk-91vcwk5m.js → chunk-v14bg5yp.js} +1 -1
  36. package/dist/chunk-wvzap0na.js +18166 -0
  37. package/dist/chunk-wztmp5b4.js +30479 -0
  38. package/dist/chunk-xvqr1q9b.js +14 -0
  39. package/dist/{chunk-h158rkts.js → chunk-yj7mpczw.js} +17 -5
  40. package/dist/chunk-yr0txkw0.js +31 -0
  41. package/dist/cli.js +3879 -1061
  42. package/dist/core/adoption.d.ts +62 -0
  43. package/dist/core/analytics.d.ts +17 -0
  44. package/dist/core/consumers.d.ts +8 -0
  45. package/dist/core/control.d.ts +12 -0
  46. package/dist/core/daemon.d.ts +2 -2
  47. package/dist/core/file-state.d.ts +5 -0
  48. package/dist/core/harnesses.d.ts +25 -0
  49. package/dist/core/index.d.ts +12 -4
  50. package/dist/core/index.js +109 -71
  51. package/dist/core/managed-index-lock.d.ts +1 -1
  52. package/dist/core/management.d.ts +32 -0
  53. package/dist/core/native-document.d.ts +4 -0
  54. package/dist/core/operations.d.ts +52 -0
  55. package/dist/core/plugin-projections.d.ts +1 -0
  56. package/dist/core/runtime-entry.d.ts +6 -0
  57. package/dist/core/runtime-snapshot.d.ts +6 -0
  58. package/dist/core/secret-keychain.d.ts +31 -0
  59. package/dist/core/secrets.d.ts +12 -2
  60. package/dist/core/served-skills.d.ts +62 -0
  61. package/dist/core/status.d.ts +1 -0
  62. package/dist/core/sync-plan.d.ts +14 -0
  63. package/dist/core/sync.d.ts +3 -0
  64. package/dist/core/telemetry.d.ts +2 -2
  65. package/dist/core/tui.d.ts +20 -0
  66. package/dist/core/verify-upstreams.d.ts +4 -0
  67. package/dist/core/work-limiter.d.ts +10 -0
  68. package/dist/gateway/server.d.ts +2 -0
  69. package/dist/types.d.ts +62 -1
  70. package/dist/util/fs.d.ts +2 -0
  71. package/dist/version.d.ts +1 -1
  72. package/package.json +1 -1
  73. package/dist/adapters/opencode.d.ts +0 -11
  74. package/dist/chunk-56whm3hm.js +0 -4055
  75. package/dist/chunk-fw8dyt89.js +0 -344
@@ -10,8 +10,10 @@ import {
10
10
  unregisterProject,
11
11
  updateServer,
12
12
  validateServerName
13
- } from "./chunk-fw8dyt89.js";
14
- import"./chunk-4y0t0tfj.js";
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=616E9B1E72DFEFBA64756E2164756E21
33
+ //# debugId=C3D1D7BBE2A2B6FA64756E2164756E21
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-c7zg7ey3.js";
4
4
  import {
5
5
  require_src
6
- } from "./chunk-tnhekcpv.js";
6
+ } from "./chunk-56z18csx.js";
7
7
  import {
8
8
  __commonJS,
9
9
  __require
@@ -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