@mcpjam/cli 3.3.4 → 3.3.5
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 +16 -16
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import os, { homedir } from 'os';
|
|
|
12
12
|
|
|
13
13
|
// package.json
|
|
14
14
|
var package_default = {
|
|
15
|
-
version: "3.3.
|
|
15
|
+
version: "3.3.5"};
|
|
16
16
|
|
|
17
17
|
// src/lib/output.ts
|
|
18
18
|
var DEFAULT_OUTPUT_FORMAT = "json";
|
|
@@ -4418,11 +4418,11 @@ async function runUiRender(options) {
|
|
|
4418
4418
|
openBrowser,
|
|
4419
4419
|
skipDiscovery: options.skipDiscovery,
|
|
4420
4420
|
startIfNeeded: options.startIfNeeded ?? true,
|
|
4421
|
-
tab: "
|
|
4421
|
+
tab: "playground",
|
|
4422
4422
|
timeoutMs: options.timeoutMs
|
|
4423
4423
|
});
|
|
4424
4424
|
if (openBrowser) {
|
|
4425
|
-
options.onProgress?.(`Inspector
|
|
4425
|
+
options.onProgress?.(`Inspector Playground URL: ${ensureResult.url}`);
|
|
4426
4426
|
if (!ensureResult.hasActiveClient) {
|
|
4427
4427
|
options.onProgress?.(
|
|
4428
4428
|
"Waiting for Inspector browser client to connect..."
|
|
@@ -4432,7 +4432,7 @@ async function runUiRender(options) {
|
|
|
4432
4432
|
if (!ensureResult.hasActiveClient && !openBrowser) {
|
|
4433
4433
|
const startedNote = ensureResult.started ? " Inspector was just started by the CLI and is still running." : "";
|
|
4434
4434
|
throw operationalError(
|
|
4435
|
-
`Inspector has no active browser client.${startedNote} Open the Inspector
|
|
4435
|
+
`Inspector has no active browser client.${startedNote} Open the Inspector Playground URL in your browser, then rerun \`tools call --ui\`; or pass \`--open\` to let the CLI open a system browser.`,
|
|
4436
4436
|
{
|
|
4437
4437
|
hasActiveClient: ensureResult.hasActiveClient,
|
|
4438
4438
|
inspectorBrowserUrl: ensureResult.url,
|
|
@@ -4465,13 +4465,13 @@ async function runUiRender(options) {
|
|
|
4465
4465
|
};
|
|
4466
4466
|
}
|
|
4467
4467
|
async function runInspectorAppRender(options) {
|
|
4468
|
-
const
|
|
4469
|
-
type: "
|
|
4468
|
+
const openPlayground = await executeInspectorCommandWithClient(options, {
|
|
4469
|
+
type: "openPlayground",
|
|
4470
4470
|
payload: { serverName: options.serverName },
|
|
4471
4471
|
timeoutMs: options.timeoutMs
|
|
4472
4472
|
});
|
|
4473
|
-
if (
|
|
4474
|
-
return {
|
|
4473
|
+
if (openPlayground.status === "error") {
|
|
4474
|
+
return { openPlayground };
|
|
4475
4475
|
}
|
|
4476
4476
|
const contextPayload = compactRecord(options.renderContext);
|
|
4477
4477
|
const setAppContext = Object.keys(contextPayload).length > 0 ? await executeInspectorCommandWithClient(options, {
|
|
@@ -4480,12 +4480,12 @@ async function runInspectorAppRender(options) {
|
|
|
4480
4480
|
timeoutMs: options.timeoutMs
|
|
4481
4481
|
}) : void 0;
|
|
4482
4482
|
if (setAppContext?.status === "error") {
|
|
4483
|
-
return {
|
|
4483
|
+
return { openPlayground, setAppContext };
|
|
4484
4484
|
}
|
|
4485
4485
|
const renderToolResult = await executeInspectorCommandWithClient(options, {
|
|
4486
4486
|
type: "renderToolResult",
|
|
4487
4487
|
payload: {
|
|
4488
|
-
surface: "
|
|
4488
|
+
surface: "playground",
|
|
4489
4489
|
serverName: options.serverName,
|
|
4490
4490
|
toolName: options.toolName,
|
|
4491
4491
|
parameters: options.params,
|
|
@@ -4495,18 +4495,18 @@ async function runInspectorAppRender(options) {
|
|
|
4495
4495
|
});
|
|
4496
4496
|
if (renderToolResult.status === "error") {
|
|
4497
4497
|
return {
|
|
4498
|
-
|
|
4498
|
+
openPlayground,
|
|
4499
4499
|
...setAppContext ? { setAppContext } : {},
|
|
4500
4500
|
renderToolResult
|
|
4501
4501
|
};
|
|
4502
4502
|
}
|
|
4503
4503
|
const snapshotApp = await executeInspectorCommandWithClient(options, {
|
|
4504
4504
|
type: "snapshotApp",
|
|
4505
|
-
payload: { surface: "
|
|
4505
|
+
payload: { surface: "playground" },
|
|
4506
4506
|
timeoutMs: options.timeoutMs
|
|
4507
4507
|
});
|
|
4508
4508
|
return {
|
|
4509
|
-
|
|
4509
|
+
openPlayground,
|
|
4510
4510
|
...setAppContext ? { setAppContext } : {},
|
|
4511
4511
|
renderToolResult,
|
|
4512
4512
|
snapshot: snapshotApp
|
|
@@ -4570,7 +4570,7 @@ function findInspectorRenderError(renderResult) {
|
|
|
4570
4570
|
const priority = [
|
|
4571
4571
|
"renderToolResult",
|
|
4572
4572
|
"setAppContext",
|
|
4573
|
-
"
|
|
4573
|
+
"openPlayground",
|
|
4574
4574
|
"snapshot",
|
|
4575
4575
|
"snapshotApp"
|
|
4576
4576
|
];
|
|
@@ -4704,7 +4704,7 @@ function registerToolsCommands(program) {
|
|
|
4704
4704
|
"Write a structured debug artifact to a file"
|
|
4705
4705
|
).option(
|
|
4706
4706
|
"--ui",
|
|
4707
|
-
"Render the tool result in Inspector
|
|
4707
|
+
"Render the tool result in Inspector Playground; opens a browser by default in a TTY"
|
|
4708
4708
|
).option(
|
|
4709
4709
|
"--require-render",
|
|
4710
4710
|
"Treat skipped Inspector renders as errors (with --ui)"
|
|
@@ -5091,7 +5091,7 @@ function writeInspectorRenderWarning(options) {
|
|
|
5091
5091
|
}
|
|
5092
5092
|
const browserUrl = typeof options.render.browserUrl === "string" ? options.render.browserUrl : void 0;
|
|
5093
5093
|
process.stderr.write(
|
|
5094
|
-
`Tip: open the Inspector
|
|
5094
|
+
`Tip: open the Inspector Playground${browserUrl ? ` at ${browserUrl}` : ""}, or rerun without --no-open or with --open to launch a browser automatically.
|
|
5095
5095
|
`
|
|
5096
5096
|
);
|
|
5097
5097
|
}
|