@mcpjam/cli 3.12.0 → 3.13.0
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/index.js +33 -7
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { spawn } from 'child_process';
|
|
|
10
10
|
import { createRequire } from 'module';
|
|
11
11
|
import os, { homedir } from 'os';
|
|
12
12
|
import { cancelEvalRunOperation, listEvalRunIterationsOperation, getEvalIterationTraceOperation, getEvalRunStepsOperation, getEvalSuiteOperation, updateEvalSuiteOperation, deleteEvalSuiteOperation, setEvalSuiteScheduleOperation, listEvalCasesOperation, getEvalCaseOperation, runEvalCaseOperation, createEvalCaseOperation, updateEvalCaseOperation, deleteEvalCaseOperation, generateEvalCasesOperation, createHostOperation, updateHostOperation, createEnvironmentOperation, updateEnvironmentOperation, createTunnelOperation, DEFAULT_PLATFORM_API_BASE_URL, PlatformApiClient, isPlatformApiError, PlatformApiError, listProjectsOperation, listProjectServersOperation, showServersOperation, createEvalSuiteOperation, listEvalSuitesOperation, runEvalSuiteOperation, getEvalRunOperation, listHostsOperation, getHostOperation, deleteHostOperation, listEnvironmentsOperation, getEnvironmentOperation, buildEnvironmentOperation, listEnvironmentBuildsOperation, useEnvironmentOperation, resetComputerOperation, promoteEnvironmentOperation, deleteEnvironmentOperation } from '@mcpjam/sdk/platform';
|
|
13
|
-
import { buildMarketHostProfiles, scanWidgetUsage, evaluateMarketHosts } from '@mcpjam/sdk/host-compat';
|
|
13
|
+
import { buildHostProfilesFromCatalog, buildMarketHostProfiles, scanWidgetUsage, evaluateMarketHosts, fetchHostCompatCatalog } from '@mcpjam/sdk/host-compat';
|
|
14
14
|
import { HOST_TEMPLATES as HOST_TEMPLATES$1, HOST_TEMPLATE_IDS, seedHostTemplate } from '@mcpjam/sdk/host-config/templates';
|
|
15
15
|
import { applyVisibilityPolicyAndCountSignals, isAppOnlyTool, extractHostExecutionPolicy, hostConnectionProfile } from '@mcpjam/sdk/host-config/internal';
|
|
16
16
|
import { StdioServerTransport, McpServer } from '@modelcontextprotocol/server';
|
|
@@ -23,7 +23,7 @@ import { WebSocket } from 'ws';
|
|
|
23
23
|
|
|
24
24
|
// package.json
|
|
25
25
|
var package_default = {
|
|
26
|
-
version: "3.
|
|
26
|
+
version: "3.13.0"};
|
|
27
27
|
|
|
28
28
|
// src/lib/output.ts
|
|
29
29
|
var DEFAULT_OUTPUT_FORMAT = "json";
|
|
@@ -3486,6 +3486,14 @@ async function withEphemeralManager(config, fn, options) {
|
|
|
3486
3486
|
|
|
3487
3487
|
// src/commands/compat.ts
|
|
3488
3488
|
var TOOLS_PAGE_CAP2 = 50;
|
|
3489
|
+
var CATALOG_FETCH_TIMEOUT_MS = 2500;
|
|
3490
|
+
async function resolveHostCatalog(options) {
|
|
3491
|
+
if (options.offline) return null;
|
|
3492
|
+
return fetchHostCompatCatalog({
|
|
3493
|
+
baseUrl: options.catalogUrl,
|
|
3494
|
+
timeoutMs: CATALOG_FETCH_TIMEOUT_MS
|
|
3495
|
+
});
|
|
3496
|
+
}
|
|
3489
3497
|
function registerCompatCommands(program) {
|
|
3490
3498
|
addRetryOptions(
|
|
3491
3499
|
addSharedServerOptions(
|
|
@@ -3496,21 +3504,28 @@ function registerCompatCommands(program) {
|
|
|
3496
3504
|
"Only report this host id. Repeat for several. Default: all.",
|
|
3497
3505
|
(value, previous = []) => [...previous, value],
|
|
3498
3506
|
[]
|
|
3507
|
+
).option(
|
|
3508
|
+
"--offline",
|
|
3509
|
+
"Skip the live host-catalog fetch and use the bundled catalog (zero MCPJam network)."
|
|
3510
|
+
).option(
|
|
3511
|
+
"--catalog-url <url>",
|
|
3512
|
+
"Base URL to fetch the live host catalog from. Default: the hosted MCPJam API."
|
|
3499
3513
|
)
|
|
3500
3514
|
)
|
|
3501
3515
|
).action(async (options, command) => {
|
|
3502
3516
|
const globalOptions = getGlobalOptions(command);
|
|
3503
3517
|
const retryPolicy = parseRetryPolicy(options);
|
|
3504
|
-
const
|
|
3518
|
+
const catalogResult = await resolveHostCatalog(options);
|
|
3519
|
+
const liveCatalog = catalogResult?.ok && catalogResult.source === "live" ? catalogResult.catalog : void 0;
|
|
3520
|
+
const catalogSource = liveCatalog ? "live" : "bundled";
|
|
3521
|
+
const validHostIds = (liveCatalog ? buildHostProfilesFromCatalog(liveCatalog) : buildMarketHostProfiles()).map((p) => p.id);
|
|
3505
3522
|
const requestedHosts = options.host;
|
|
3506
3523
|
const unknownHosts = requestedHosts.filter(
|
|
3507
3524
|
(id) => !validHostIds.includes(id)
|
|
3508
3525
|
);
|
|
3509
3526
|
if (unknownHosts.length > 0) {
|
|
3510
3527
|
throw usageError(
|
|
3511
|
-
`Unknown host id${unknownHosts.length === 1 ? "" : "s"}: ${unknownHosts.join(
|
|
3512
|
-
", "
|
|
3513
|
-
)}. Valid: ${validHostIds.join(", ")}`
|
|
3528
|
+
`Unknown host id${unknownHosts.length === 1 ? "" : "s"}: ${unknownHosts.join(", ")}. Valid: ${validHostIds.join(", ")}`
|
|
3514
3529
|
);
|
|
3515
3530
|
}
|
|
3516
3531
|
const config = parseServerConfig({
|
|
@@ -3539,7 +3554,8 @@ function registerCompatCommands(program) {
|
|
|
3539
3554
|
});
|
|
3540
3555
|
const { requirements, reports } = evaluateMarketHosts(toolsData, {
|
|
3541
3556
|
widgetUsage,
|
|
3542
|
-
toolsTruncated: truncated
|
|
3557
|
+
toolsTruncated: truncated,
|
|
3558
|
+
catalog: liveCatalog
|
|
3543
3559
|
});
|
|
3544
3560
|
const hostFilter = new Set(options.host);
|
|
3545
3561
|
const hosts = (hostFilter.size > 0 ? reports.filter((r) => hostFilter.has(r.hostId)) : reports).map((r) => ({
|
|
@@ -3553,6 +3569,11 @@ function registerCompatCommands(program) {
|
|
|
3553
3569
|
for (const h of hosts) summary[h.verdict] += 1;
|
|
3554
3570
|
return {
|
|
3555
3571
|
target: describeTarget(options),
|
|
3572
|
+
catalogSource,
|
|
3573
|
+
// Always present for a stable contract: the backend publish version
|
|
3574
|
+
// when live, else 0 (the "not a backend publish" sentinel) for the
|
|
3575
|
+
// bundled/offline fallback.
|
|
3576
|
+
catalogVersion: liveCatalog && catalogResult?.ok ? catalogResult.version : 0,
|
|
3556
3577
|
widgets: {
|
|
3557
3578
|
total: requirements.widgets.mcpAppsOnly.length + requirements.widgets.openaiAppsOnly.length + requirements.widgets.dual.length,
|
|
3558
3579
|
appOnly: requirements.appOnlyWidgets.length
|
|
@@ -3567,6 +3588,11 @@ function registerCompatCommands(program) {
|
|
|
3567
3588
|
retryPolicy
|
|
3568
3589
|
}
|
|
3569
3590
|
);
|
|
3591
|
+
if (!globalOptions.quiet) {
|
|
3592
|
+
const catalogNote = liveCatalog && catalogResult?.ok ? `host catalog: live v${catalogResult.version}` : `host catalog: bundled${options.offline ? " (--offline)" : ""}`;
|
|
3593
|
+
process.stderr.write(`\x1B[2m${catalogNote}\x1B[0m
|
|
3594
|
+
`);
|
|
3595
|
+
}
|
|
3570
3596
|
writeResult(result, globalOptions.format);
|
|
3571
3597
|
});
|
|
3572
3598
|
}
|