@muggleai/works 5.38.0-staging.351 → 5.38.0-staging.353
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/.claude-plugin/marketplace.json +1 -1
- package/dist/{chunk-RMPZ7ZQC.js → chunk-2GSA5O6H.js} +377 -11
- package/dist/{chunk-OIFLV2QN.js → chunk-VTGELNSG.js} +125 -4
- package/dist/cli.js +2 -2
- package/dist/index.js +2 -2
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.codex-mcp.json +1 -1
- package/dist/plugin/.codex-plugin/plugin.json +1 -1
- package/dist/plugin/.cursor-plugin/plugin.json +1 -1
- package/dist/plugin/.mcp.json +1 -1
- package/dist/release-manifest.json +3 -3
- package/dist/{src-5Z6EIGHT.js → src-MRBTJCCI.js} +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-mcp.json +1 -1
- package/plugin/.codex-plugin/plugin.json +1 -1
- package/plugin/.cursor-plugin/plugin.json +1 -1
- package/plugin/.mcp.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __export, getLogger, TelemetryEnvironment, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir2, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, resolveElectronAppExecutablePath, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, getActiveElectronAppReleaseStream, buildToolInputJsonSchema, toolRequiresAuth, getCallerCredentials, parseElectronAppDirName, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, ElectronAppReleaseStream, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, buildLlmSourcePlan, describeLlmSourceStatus, resolveLlmSourceStatus, e2e_exports, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, claimServiceStack, BUSY_EXIT_CODE, checkServiceStack, releaseServiceStack, readServiceStackStatus, resolvePreferences, buildElectronAppChecksumsUrl, OnboardingBlanketChoice, PreferenceKey, LlmSource, applyLlmSourceSelection, describeStackMismatch, ELECTRON_APP_CHECKSUMS_ASSET_NAME, getDataDir, DEFAULT_LOCAL_LLM_BASE_URL, isValidLocalBaseUrl
|
|
1
|
+
import { __export, getLogger, TelemetryEnvironment, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir2, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, resolveElectronAppExecutablePath, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, getActiveElectronAppReleaseStream, buildToolInputJsonSchema, toolRequiresAuth, getCallerCredentials, parseElectronAppDirName, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, ElectronAppReleaseStream, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, buildLlmSourcePlan, describeLlmSourceStatus, resolveLlmSourceStatus, e2e_exports, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, claimServiceStack, BUSY_EXIT_CODE, checkServiceStack, releaseServiceStack, readServiceStackStatus, resolvePreferences, buildElectronAppChecksumsUrl, OnboardingBlanketChoice, PreferenceKey, LlmSource, applyLlmSourceSelection, describeStackMismatch, local_exports, ELECTRON_APP_CHECKSUMS_ASSET_NAME, getDataDir, DEFAULT_LOCAL_LLM_BASE_URL, isValidLocalBaseUrl } from './chunk-VTGELNSG.js';
|
|
2
2
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
3
|
import { ListToolsRequestSchema, CallToolRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
import { v4 } from 'uuid';
|
|
@@ -327,8 +327,8 @@ function createUnifiedMcpServer(options) {
|
|
|
327
327
|
errors: error.issues
|
|
328
328
|
});
|
|
329
329
|
const issueMessages = error.issues.slice(0, 3).map((issue) => {
|
|
330
|
-
const
|
|
331
|
-
return
|
|
330
|
+
const path9 = issue.path.join(".");
|
|
331
|
+
return path9 ? `'${path9}': ${issue.message}` : issue.message;
|
|
332
332
|
});
|
|
333
333
|
return {
|
|
334
334
|
content: [
|
|
@@ -1375,7 +1375,7 @@ async function resolveGsScreenshotUrls(report, opts) {
|
|
|
1375
1375
|
if (gsUrls.length === 0) {
|
|
1376
1376
|
return report;
|
|
1377
1377
|
}
|
|
1378
|
-
const mcps = await import('./src-
|
|
1378
|
+
const mcps = await import('./src-MRBTJCCI.js');
|
|
1379
1379
|
const credentials = await mcps.getCallerCredentialsAsync();
|
|
1380
1380
|
if (!credentials.bearerToken && !credentials.apiKey) {
|
|
1381
1381
|
stderrWrite(
|
|
@@ -1612,12 +1612,12 @@ var WORKFLOW_WRITING_OUTCOMES = /* @__PURE__ */ new Set([
|
|
|
1612
1612
|
"replaced" /* Replaced */
|
|
1613
1613
|
]);
|
|
1614
1614
|
var CI_INSTALL_MESSAGES = {
|
|
1615
|
-
["installed" /* Installed */]: (
|
|
1615
|
+
["installed" /* Installed */]: (path9) => `Wrote ${path9}
|
|
1616
1616
|
Commit it, and every pull request here will owe a settled Muggle AI walkthrough comment.`,
|
|
1617
|
-
["updated" /* Updated */]: (
|
|
1618
|
-
["already-current" /* AlreadyCurrent */]: (
|
|
1619
|
-
["kept-customized" /* KeptCustomized */]: (
|
|
1620
|
-
["replaced" /* Replaced */]: (
|
|
1617
|
+
["updated" /* Updated */]: (path9) => `Updated ${path9} from an earlier Muggle release to the current workflow. Commit it.`,
|
|
1618
|
+
["already-current" /* AlreadyCurrent */]: (path9) => `${path9} is already the current workflow \u2014 nothing to do.`,
|
|
1619
|
+
["kept-customized" /* KeptCustomized */]: (path9) => `${path9} has been edited since Muggle wrote it \u2014 left untouched. Re-run with --force to replace it.`,
|
|
1620
|
+
["replaced" /* Replaced */]: (path9) => `Replaced ${path9} with the current workflow. Commit it.`,
|
|
1621
1621
|
["not-a-repository" /* NotARepository */]: () => "Not a git repository \u2014 run this from the repo that should carry the check."
|
|
1622
1622
|
};
|
|
1623
1623
|
|
|
@@ -2873,8 +2873,8 @@ ${title}`, COLORS.bold + COLORS.cyan);
|
|
|
2873
2873
|
function cmd(cmd2) {
|
|
2874
2874
|
return colorize(cmd2, COLORS.green);
|
|
2875
2875
|
}
|
|
2876
|
-
function path4(
|
|
2877
|
-
return colorize(
|
|
2876
|
+
function path4(path9) {
|
|
2877
|
+
return colorize(path9, COLORS.yellow);
|
|
2878
2878
|
}
|
|
2879
2879
|
function getHelpGuidance() {
|
|
2880
2880
|
const lines = [
|
|
@@ -2941,6 +2941,10 @@ function getHelpGuidance() {
|
|
|
2941
2941
|
` ${cmd("muggle upgrade")} Check for updates`,
|
|
2942
2942
|
` ${cmd("muggle upgrade --check")} Check updates without installing`,
|
|
2943
2943
|
"",
|
|
2944
|
+
` ${colorize("Local Runs:", COLORS.bold)}`,
|
|
2945
|
+
` ${cmd("muggle scan --local")} Scan a site for use-case candidates in the local Studio`,
|
|
2946
|
+
` ${cmd("muggle generate --local")} Generate a test script in the local Studio and upload the run`,
|
|
2947
|
+
"",
|
|
2944
2948
|
` ${colorize("Inspecting Runs:", COLORS.bold)}`,
|
|
2945
2949
|
` ${cmd("muggle run-view")} Show a run's steps beside the frames they produced`,
|
|
2946
2950
|
` ${cmd("muggle run-view --html")} Render those frames as a self-contained page`,
|
|
@@ -3960,6 +3964,366 @@ async function llmSourceCommand(options) {
|
|
|
3960
3964
|
await runLlmSourceStep();
|
|
3961
3965
|
}
|
|
3962
3966
|
|
|
3967
|
+
// src/cli/local/local-generate-constants.ts
|
|
3968
|
+
var LOCAL_FLAG_REQUIRED_MESSAGE = "Only local generation is supported from the CLI: pass --local to run it in the local Studio.";
|
|
3969
|
+
var LOCAL_GENERATE_COMMAND_LOG_LEVEL = "warn";
|
|
3970
|
+
var LOCAL_GENERATE_CANCEL_SIGNALS = ["SIGINT", "SIGTERM"];
|
|
3971
|
+
var COPIED_TEST_CASE_FIELDS = [
|
|
3972
|
+
"id",
|
|
3973
|
+
"title",
|
|
3974
|
+
"description",
|
|
3975
|
+
"goal",
|
|
3976
|
+
"expectedResult",
|
|
3977
|
+
"precondition",
|
|
3978
|
+
"url",
|
|
3979
|
+
"projectId",
|
|
3980
|
+
"useCaseId",
|
|
3981
|
+
"displayOptions",
|
|
3982
|
+
"pinnedAccount",
|
|
3983
|
+
"alwaysStartsFreshSession"
|
|
3984
|
+
];
|
|
3985
|
+
|
|
3986
|
+
// src/cli/local/local-generate-args.ts
|
|
3987
|
+
function requireNonEmptyOption(params) {
|
|
3988
|
+
const trimmedValue = params.value?.trim() ?? "";
|
|
3989
|
+
if (trimmedValue === "") {
|
|
3990
|
+
throw new Error(`${params.flagName} is required.`);
|
|
3991
|
+
}
|
|
3992
|
+
return trimmedValue;
|
|
3993
|
+
}
|
|
3994
|
+
function parseTimeoutMs(rawTimeoutMs) {
|
|
3995
|
+
if (rawTimeoutMs === void 0) {
|
|
3996
|
+
return void 0;
|
|
3997
|
+
}
|
|
3998
|
+
const timeoutMs = Number(rawTimeoutMs);
|
|
3999
|
+
if (!Number.isInteger(timeoutMs) || timeoutMs <= 0) {
|
|
4000
|
+
throw new Error(`--timeout-ms must be a positive integer, got '${rawTimeoutMs}'.`);
|
|
4001
|
+
}
|
|
4002
|
+
return timeoutMs;
|
|
4003
|
+
}
|
|
4004
|
+
function parseLocalGenerateArgs(options) {
|
|
4005
|
+
if (options.local !== true) {
|
|
4006
|
+
throw new Error(LOCAL_FLAG_REQUIRED_MESSAGE);
|
|
4007
|
+
}
|
|
4008
|
+
return {
|
|
4009
|
+
projectId: requireNonEmptyOption({ value: options.projectId, flagName: "--project-id" }),
|
|
4010
|
+
testCaseId: requireNonEmptyOption({ value: options.testCaseId, flagName: "--test-case-id" }),
|
|
4011
|
+
isLightMode: options.light === true,
|
|
4012
|
+
isUiShown: options.showUi === true,
|
|
4013
|
+
...options.timeoutMs !== void 0 ? { timeoutMs: parseTimeoutMs(options.timeoutMs) } : {},
|
|
4014
|
+
isJsonOutput: options.json === true
|
|
4015
|
+
};
|
|
4016
|
+
}
|
|
4017
|
+
|
|
4018
|
+
// src/cli/local/local-generate-remote.ts
|
|
4019
|
+
async function callRemoteToolAsync(params) {
|
|
4020
|
+
const toolResult = await e2e_exports.executeQaTool(params.toolName, params.toolInput, params.correlationId);
|
|
4021
|
+
const payload = JSON.parse(String(toolResult.content));
|
|
4022
|
+
if (toolResult.isError) {
|
|
4023
|
+
throw new Error(`${params.toolName} failed: ${payload.message ?? String(toolResult.content)}`);
|
|
4024
|
+
}
|
|
4025
|
+
return payload;
|
|
4026
|
+
}
|
|
4027
|
+
async function fetchRemoteTestCaseAsync(params) {
|
|
4028
|
+
return await callRemoteToolAsync({
|
|
4029
|
+
toolName: e2e_exports.TEST_CASE_GET_TOOL_NAME,
|
|
4030
|
+
toolInput: { testCaseId: params.testCaseId },
|
|
4031
|
+
correlationId: params.correlationId
|
|
4032
|
+
});
|
|
4033
|
+
}
|
|
4034
|
+
|
|
4035
|
+
// src/cli/local/local-generate-test-case.ts
|
|
4036
|
+
function toGenerationTestCase(params) {
|
|
4037
|
+
const { remoteTestCase } = params;
|
|
4038
|
+
if (remoteTestCase.projectId !== params.expectedProjectId) {
|
|
4039
|
+
throw new Error(
|
|
4040
|
+
`Test case ${String(remoteTestCase.id)} belongs to project ${String(remoteTestCase.projectId)}, not ${params.expectedProjectId}.`
|
|
4041
|
+
);
|
|
4042
|
+
}
|
|
4043
|
+
if (typeof remoteTestCase.url !== "string" || remoteTestCase.url.trim() === "") {
|
|
4044
|
+
throw new Error(`Test case ${String(remoteTestCase.id)} has no URL to generate against.`);
|
|
4045
|
+
}
|
|
4046
|
+
const copiedFields = {};
|
|
4047
|
+
for (const fieldName of COPIED_TEST_CASE_FIELDS) {
|
|
4048
|
+
const fieldValue = remoteTestCase[fieldName];
|
|
4049
|
+
const isKeptNull = fieldName === "pinnedAccount" && fieldValue === null;
|
|
4050
|
+
if (fieldValue !== void 0 && (fieldValue !== null || isKeptNull)) {
|
|
4051
|
+
copiedFields[fieldName] = fieldValue;
|
|
4052
|
+
}
|
|
4053
|
+
}
|
|
4054
|
+
return local_exports.TestCaseDetailsSchema.parse(copiedFields);
|
|
4055
|
+
}
|
|
4056
|
+
|
|
4057
|
+
// src/cli/local/local-generate.ts
|
|
4058
|
+
function toErrorMessage(error) {
|
|
4059
|
+
return error instanceof Error ? error.message : String(error);
|
|
4060
|
+
}
|
|
4061
|
+
function toErrorHeadline(message) {
|
|
4062
|
+
return message.split("\n").find((line) => line.trim() !== "")?.trim() ?? message;
|
|
4063
|
+
}
|
|
4064
|
+
function resolveStoredStatus(storedStatus) {
|
|
4065
|
+
switch (storedStatus) {
|
|
4066
|
+
case "passed" /* Passed */:
|
|
4067
|
+
return "passed" /* Passed */;
|
|
4068
|
+
case "failed" /* Failed */:
|
|
4069
|
+
return "failed" /* Failed */;
|
|
4070
|
+
case "cancelled" /* Cancelled */:
|
|
4071
|
+
return "cancelled" /* Cancelled */;
|
|
4072
|
+
default:
|
|
4073
|
+
return "error" /* Error */;
|
|
4074
|
+
}
|
|
4075
|
+
}
|
|
4076
|
+
function cancelActiveGenerations() {
|
|
4077
|
+
for (const activeExecution of local_exports.listActiveExecutions()) {
|
|
4078
|
+
local_exports.cancelExecution({ runId: activeExecution.runId });
|
|
4079
|
+
}
|
|
4080
|
+
}
|
|
4081
|
+
async function runLocalGenerateAsync(params) {
|
|
4082
|
+
const { args } = params;
|
|
4083
|
+
const correlationId = randomUUID();
|
|
4084
|
+
const buildResult = (resultFields) => ({
|
|
4085
|
+
status: resultFields.status,
|
|
4086
|
+
runId: resultFields.runId,
|
|
4087
|
+
testCaseId: args.testCaseId,
|
|
4088
|
+
actionScriptId: resultFields.actionScriptId,
|
|
4089
|
+
testScriptId: resultFields.testScriptId,
|
|
4090
|
+
durationMs: Date.now() - params.commandStartedAt,
|
|
4091
|
+
error: resultFields.error
|
|
4092
|
+
});
|
|
4093
|
+
for (const signal of LOCAL_GENERATE_CANCEL_SIGNALS) {
|
|
4094
|
+
process.on(signal, cancelActiveGenerations);
|
|
4095
|
+
}
|
|
4096
|
+
try {
|
|
4097
|
+
const remoteTestCase = await fetchRemoteTestCaseAsync({ testCaseId: args.testCaseId, correlationId });
|
|
4098
|
+
const testCase = toGenerationTestCase({ remoteTestCase, expectedProjectId: args.projectId });
|
|
4099
|
+
const toolResult = await local_exports.executeTool(
|
|
4100
|
+
local_exports.EXECUTE_TEST_GENERATION_TOOL_NAME,
|
|
4101
|
+
{
|
|
4102
|
+
testCase,
|
|
4103
|
+
localUrl: testCase.url,
|
|
4104
|
+
cwd: process.cwd(),
|
|
4105
|
+
showUi: args.isUiShown,
|
|
4106
|
+
lightMode: args.isLightMode,
|
|
4107
|
+
...args.timeoutMs !== void 0 ? { timeoutMs: args.timeoutMs } : {}
|
|
4108
|
+
},
|
|
4109
|
+
correlationId
|
|
4110
|
+
);
|
|
4111
|
+
const generationRun = toolResult.data;
|
|
4112
|
+
if (!generationRun?.id) {
|
|
4113
|
+
return buildResult({
|
|
4114
|
+
status: "error" /* Error */,
|
|
4115
|
+
runId: null,
|
|
4116
|
+
actionScriptId: null,
|
|
4117
|
+
testScriptId: null,
|
|
4118
|
+
error: toErrorHeadline(toolResult.content)
|
|
4119
|
+
});
|
|
4120
|
+
}
|
|
4121
|
+
const storedRun = local_exports.getRunResultStorageService().getRunResult(generationRun.id);
|
|
4122
|
+
const status = resolveStoredStatus(storedRun?.status ?? generationRun.status);
|
|
4123
|
+
const actionScriptId = storedRun?.cloudActionScriptId ?? null;
|
|
4124
|
+
const testScriptId = storedRun?.cloudTestScriptId ?? null;
|
|
4125
|
+
const failureMessage = storedRun?.errorMessage ?? generationRun.errorMessage;
|
|
4126
|
+
return buildResult({
|
|
4127
|
+
status,
|
|
4128
|
+
runId: generationRun.id,
|
|
4129
|
+
actionScriptId,
|
|
4130
|
+
testScriptId,
|
|
4131
|
+
error: status === "passed" /* Passed */ ? null : toErrorHeadline(failureMessage ?? `Run ended ${status}.`)
|
|
4132
|
+
});
|
|
4133
|
+
} catch (error) {
|
|
4134
|
+
return buildResult({
|
|
4135
|
+
status: "error" /* Error */,
|
|
4136
|
+
runId: null,
|
|
4137
|
+
actionScriptId: null,
|
|
4138
|
+
testScriptId: null,
|
|
4139
|
+
error: toErrorHeadline(toErrorMessage(error))
|
|
4140
|
+
});
|
|
4141
|
+
} finally {
|
|
4142
|
+
for (const signal of LOCAL_GENERATE_CANCEL_SIGNALS) {
|
|
4143
|
+
process.off(signal, cancelActiveGenerations);
|
|
4144
|
+
}
|
|
4145
|
+
}
|
|
4146
|
+
}
|
|
4147
|
+
function renderLocalGenerateText(generationOutcome) {
|
|
4148
|
+
return [
|
|
4149
|
+
`Generation ${generationOutcome.status} (target ${getActiveRuntimeTarget()})`,
|
|
4150
|
+
` Test case: ${generationOutcome.testCaseId}`,
|
|
4151
|
+
` Local run: ${generationOutcome.runId ?? "none"}`,
|
|
4152
|
+
` Action script: ${generationOutcome.actionScriptId ?? "not published"}`,
|
|
4153
|
+
` Test script: ${generationOutcome.testScriptId ?? "not uploaded"}`,
|
|
4154
|
+
` Duration: ${generationOutcome.durationMs}ms`,
|
|
4155
|
+
...generationOutcome.error ? [` Error: ${generationOutcome.error}`] : []
|
|
4156
|
+
].join("\n");
|
|
4157
|
+
}
|
|
4158
|
+
async function generateCommand(options) {
|
|
4159
|
+
const commandStartedAt = Date.now();
|
|
4160
|
+
let args;
|
|
4161
|
+
try {
|
|
4162
|
+
args = parseLocalGenerateArgs(options);
|
|
4163
|
+
} catch (error) {
|
|
4164
|
+
console.error(toErrorMessage(error));
|
|
4165
|
+
process.exitCode = 1;
|
|
4166
|
+
return;
|
|
4167
|
+
}
|
|
4168
|
+
getLogger().level = LOCAL_GENERATE_COMMAND_LOG_LEVEL;
|
|
4169
|
+
const generationOutcome = await runLocalGenerateAsync({ args, commandStartedAt });
|
|
4170
|
+
process.stdout.write(
|
|
4171
|
+
args.isJsonOutput ? `${JSON.stringify(generationOutcome)}
|
|
4172
|
+
` : `${renderLocalGenerateText(generationOutcome)}
|
|
4173
|
+
`
|
|
4174
|
+
);
|
|
4175
|
+
process.exitCode = 0;
|
|
4176
|
+
}
|
|
4177
|
+
|
|
4178
|
+
// src/cli/local/local-scan-constants.ts
|
|
4179
|
+
var DEFAULT_LOCAL_SCAN_MAX_CANDIDATES = 30;
|
|
4180
|
+
var LOCAL_SCAN_COMMAND_LOG_LEVEL = "warn";
|
|
4181
|
+
var SCAN_REQUIRES_LOCAL_FLAG_MESSAGE = "muggle scan runs in the local Studio only: pass --local. Cloud scans start from the dashboard or the Muggle MCP tools.";
|
|
4182
|
+
var DROPPED_CANDIDATE_STATUS = "dropped";
|
|
4183
|
+
var SIGNED_IN_FLOW_PATTERN = /\b(log ?in|logs in|logged[ -]in|logging in|sign[ -]?in|signs in|signed[ -]in|signing in|authenticated)\b/i;
|
|
4184
|
+
|
|
4185
|
+
// src/cli/local/website-scan-candidates.ts
|
|
4186
|
+
function parseLocalScanLimits(params) {
|
|
4187
|
+
return {
|
|
4188
|
+
maxCandidates: parsePositiveInteger({
|
|
4189
|
+
optionName: "--max-candidates",
|
|
4190
|
+
optionValue: params.maxCandidatesOption,
|
|
4191
|
+
defaultValue: DEFAULT_LOCAL_SCAN_MAX_CANDIDATES
|
|
4192
|
+
}),
|
|
4193
|
+
timeoutMs: parsePositiveInteger({
|
|
4194
|
+
optionName: "--timeout-ms",
|
|
4195
|
+
optionValue: params.timeoutMsOption,
|
|
4196
|
+
defaultValue: params.defaultTimeoutMs
|
|
4197
|
+
})
|
|
4198
|
+
};
|
|
4199
|
+
}
|
|
4200
|
+
function parsePositiveInteger(params) {
|
|
4201
|
+
if (params.optionValue === void 0) {
|
|
4202
|
+
return params.defaultValue;
|
|
4203
|
+
}
|
|
4204
|
+
const parsedValue = Number(params.optionValue);
|
|
4205
|
+
if (!Number.isInteger(parsedValue) || parsedValue <= 0) {
|
|
4206
|
+
throw new Error(`${params.optionName} must be a positive integer, got "${params.optionValue}".`);
|
|
4207
|
+
}
|
|
4208
|
+
return parsedValue;
|
|
4209
|
+
}
|
|
4210
|
+
function isSignedInFlow(useCase) {
|
|
4211
|
+
const searchableText = [
|
|
4212
|
+
useCase.title,
|
|
4213
|
+
useCase.description,
|
|
4214
|
+
useCase.userStory,
|
|
4215
|
+
JSON.stringify(useCase.useCaseBreakdown ?? [])
|
|
4216
|
+
].join("\n");
|
|
4217
|
+
return SIGNED_IN_FLOW_PATTERN.test(searchableText);
|
|
4218
|
+
}
|
|
4219
|
+
function listCandidatesAddedByScan(params) {
|
|
4220
|
+
return (params.memory?.useCaseCandidates ?? []).filter((candidate) => !params.baselineCandidateIds.has(candidate.id)).sort((first, second) => (first.createdAt ?? 0) - (second.createdAt ?? 0));
|
|
4221
|
+
}
|
|
4222
|
+
function toReportCandidates(params) {
|
|
4223
|
+
return params.addedCandidates.filter((candidate) => candidate.status.toLowerCase() !== DROPPED_CANDIDATE_STATUS).slice(0, params.maxCandidates).map((candidate) => ({
|
|
4224
|
+
title: candidate.useCase.title ?? "",
|
|
4225
|
+
description: candidate.useCase.description ?? "",
|
|
4226
|
+
startUrl: candidate.useCase.url || params.siteUrl,
|
|
4227
|
+
requiresSignIn: isSignedInFlow(candidate.useCase)
|
|
4228
|
+
}));
|
|
4229
|
+
}
|
|
4230
|
+
function resolveLocalScanStatus(params) {
|
|
4231
|
+
if (params.exit === local_exports.WebsiteScanExitEnum.Failed) {
|
|
4232
|
+
return "error" /* Error */;
|
|
4233
|
+
}
|
|
4234
|
+
if (params.exit === local_exports.WebsiteScanExitEnum.TimedOut || params.addedCandidateCount >= params.maxCandidates) {
|
|
4235
|
+
return "capped" /* Capped */;
|
|
4236
|
+
}
|
|
4237
|
+
return "finished" /* Finished */;
|
|
4238
|
+
}
|
|
4239
|
+
|
|
4240
|
+
// src/cli/local/local-scan.ts
|
|
4241
|
+
async function readDiscoveryMemoryAsync(projectId) {
|
|
4242
|
+
const toolResult = await e2e_exports.executeQaTool(
|
|
4243
|
+
e2e_exports.USE_CASE_DISCOVERY_MEMORY_GET_TOOL_NAME,
|
|
4244
|
+
{ projectId },
|
|
4245
|
+
randomUUID()
|
|
4246
|
+
);
|
|
4247
|
+
if (toolResult.isError) {
|
|
4248
|
+
const failure = JSON.parse(String(toolResult.content));
|
|
4249
|
+
throw new Error(`Could not read the project's use-case discovery memory: ${failure.message ?? String(toolResult.content)}`);
|
|
4250
|
+
}
|
|
4251
|
+
return JSON.parse(String(toolResult.content)).memory;
|
|
4252
|
+
}
|
|
4253
|
+
function summarizeScanFailure(params) {
|
|
4254
|
+
const headline = (params.failureMessage ?? "Studio failed.").split("\n")[0];
|
|
4255
|
+
const logsDir = path2.join(local_exports.getStorageService().getSessionsDir(), params.runId);
|
|
4256
|
+
return `${headline} Studio logs: ${logsDir}`;
|
|
4257
|
+
}
|
|
4258
|
+
async function runLocalScanAsync(options) {
|
|
4259
|
+
const startedAt = Date.now();
|
|
4260
|
+
try {
|
|
4261
|
+
const limits = parseLocalScanLimits({
|
|
4262
|
+
maxCandidatesOption: options.maxCandidates,
|
|
4263
|
+
timeoutMsOption: options.timeoutMs,
|
|
4264
|
+
defaultTimeoutMs: local_exports.DEFAULT_WEBSITE_SCAN_TIMEOUT_MS
|
|
4265
|
+
});
|
|
4266
|
+
const memoryBeforeScan = await readDiscoveryMemoryAsync(options.projectId);
|
|
4267
|
+
const baselineCandidateIds = new Set((memoryBeforeScan?.useCaseCandidates ?? []).map((candidate) => candidate.id));
|
|
4268
|
+
const scanResult = await local_exports.executeWebsiteScan({
|
|
4269
|
+
projectId: options.projectId,
|
|
4270
|
+
url: options.url,
|
|
4271
|
+
cwd: process.cwd(),
|
|
4272
|
+
useCaseDiscoverMemoryId: memoryBeforeScan?.id ?? randomUUID(),
|
|
4273
|
+
// Studio stops at a total memory count, so the existing candidates are added to the cap.
|
|
4274
|
+
targetUseCaseCandidateCount: baselineCandidateIds.size + limits.maxCandidates,
|
|
4275
|
+
timeoutMs: limits.timeoutMs,
|
|
4276
|
+
showUi: options.showUi
|
|
4277
|
+
});
|
|
4278
|
+
const addedCandidates = listCandidatesAddedByScan({
|
|
4279
|
+
memory: await readDiscoveryMemoryAsync(options.projectId),
|
|
4280
|
+
baselineCandidateIds
|
|
4281
|
+
});
|
|
4282
|
+
const status = resolveLocalScanStatus({
|
|
4283
|
+
exit: scanResult.exit,
|
|
4284
|
+
addedCandidateCount: addedCandidates.length,
|
|
4285
|
+
maxCandidates: limits.maxCandidates
|
|
4286
|
+
});
|
|
4287
|
+
return {
|
|
4288
|
+
status,
|
|
4289
|
+
candidates: toReportCandidates({
|
|
4290
|
+
addedCandidates,
|
|
4291
|
+
maxCandidates: limits.maxCandidates,
|
|
4292
|
+
siteUrl: options.url
|
|
4293
|
+
}),
|
|
4294
|
+
durationMs: Date.now() - startedAt,
|
|
4295
|
+
error: status === "error" /* Error */ ? summarizeScanFailure({ failureMessage: scanResult.failureMessage, runId: scanResult.runId }) : null
|
|
4296
|
+
};
|
|
4297
|
+
} catch (error) {
|
|
4298
|
+
return {
|
|
4299
|
+
status: "error" /* Error */,
|
|
4300
|
+
candidates: [],
|
|
4301
|
+
durationMs: Date.now() - startedAt,
|
|
4302
|
+
error: error instanceof Error ? error.message : String(error)
|
|
4303
|
+
};
|
|
4304
|
+
}
|
|
4305
|
+
}
|
|
4306
|
+
function renderLocalScanText(report) {
|
|
4307
|
+
const lines = [`Scan ${report.status}: ${report.candidates.length} candidate(s) in ${Math.round(report.durationMs / 1e3)}s`];
|
|
4308
|
+
if (report.error) {
|
|
4309
|
+
lines.push(report.error);
|
|
4310
|
+
}
|
|
4311
|
+
for (const candidate of report.candidates) {
|
|
4312
|
+
lines.push(` - ${candidate.title}${candidate.requiresSignIn ? " (signed in)" : ""} ${candidate.startUrl}`);
|
|
4313
|
+
}
|
|
4314
|
+
return lines.join("\n");
|
|
4315
|
+
}
|
|
4316
|
+
async function localScanCommand(options) {
|
|
4317
|
+
if (!options.local) {
|
|
4318
|
+
console.error(SCAN_REQUIRES_LOCAL_FLAG_MESSAGE);
|
|
4319
|
+
process.exitCode = 1;
|
|
4320
|
+
return;
|
|
4321
|
+
}
|
|
4322
|
+
getLogger().level = LOCAL_SCAN_COMMAND_LOG_LEVEL;
|
|
4323
|
+
const report = await runLocalScanAsync(options);
|
|
4324
|
+
console.log(options.json ? JSON.stringify(report) : renderLocalScanText(report));
|
|
4325
|
+
}
|
|
4326
|
+
|
|
3963
4327
|
// src/cli/login.ts
|
|
3964
4328
|
var logger4 = getLogger();
|
|
3965
4329
|
async function loginCommand(options) {
|
|
@@ -7944,6 +8308,8 @@ function createProgram() {
|
|
|
7944
8308
|
stack.command("check").description("Check that the stack still serves what this checkout claimed; only runs keep the lease alive").option("--cwd <dir>", "Directory inside the checkout (default: the current directory)").option("--port <port>", "Port the run will target").option("--json", "Print the full report as JSON").action(stackCheckCommand);
|
|
7945
8309
|
stack.command("release").description("Give up this checkout's lease and place in line").option("--cwd <dir>", "Directory inside the checkout (default: the current directory)").option("--json", "Print the result as JSON").action(stackReleaseCommand);
|
|
7946
8310
|
stack.command("status").description("Show every lease, the line, and the services prepare tracks").option("--json", "Print the full report as JSON").action(stackStatusCommand);
|
|
8311
|
+
program.command("scan").description("Scan a site for use-case candidates; reports candidates, never approves them").option("--local", "Run the scan in the local Studio on the model source you chose (muggle llm-source)").requiredOption("--project-id <id>", "Cloud project the candidates belong to").requiredOption("--url <siteUrl>", "Site URL the scan starts from").option("--max-candidates <n>", "Stop once the scan has found this many candidates (default 30)").option("--timeout-ms <n>", "Stop the scan after this long, keeping what it found (default 1800000)").option("--show-ui", "Show the Studio window").option("--json", "Print the report as one JSON line").action(localScanCommand);
|
|
8312
|
+
program.command("generate").description("Generate a test script for one cloud test case; with --local the local Studio runs it and uploads the run").option("--local", "Run in the local Studio on the model source you chose (muggle llm-source); required for now").requiredOption("--project-id <id>", "Project the test case belongs to").requiredOption("--test-case-id <id>", "Test case to generate a script for").option("--light", "Run the prediction agent on the light (Sonnet) tier").option("--show-ui", "Show the Studio window (the showElectronBrowser preference can override)").option("--timeout-ms <n>", "Run time limit in milliseconds (default: the generation default)").option("--json", "Print the result as one JSON line").action(generateCommand);
|
|
7947
8313
|
program.command("ci-install").description("Add the Muggle walkthrough check to this repository's GitHub Actions").option("--force", "Replace an existing workflow file").action(ciInstallCommand);
|
|
7948
8314
|
const watch = program.command("watch").description("Standing watch over Claude/Codex sessions, their processes, and PR watchers");
|
|
7949
8315
|
watch.command("tick").description("Run one watch pass (the scheduled task runs this)").option("--no-auto-reload", "Do not start a plugin reload fan-out when installed plugins change").option("--no-recovery", "Report dead watchers without resuming their owner sessions").option("--no-remote-control", "Report sessions off Remote Control without restarting them").option("--no-limit-resume", "Report sessions a usage limit cut off without continuing them").option("--no-mcp-recover", "Report sessions whose Muggle MCP server is gone without restarting them").option("--json", "Print the full snapshot as JSON").action(watchTickCommand);
|
|
@@ -3194,6 +3194,12 @@ function escapeRegex(str) {
|
|
|
3194
3194
|
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3195
3195
|
}
|
|
3196
3196
|
|
|
3197
|
+
// packages/mcps/src/mcp/local/services/website-scan-constants.ts
|
|
3198
|
+
var WEBSITE_SCAN_WORKFLOW_TYPE = "Website Scan Workflow";
|
|
3199
|
+
var WEBSITE_SCAN_GOAL = "If login is possible, explore the post-login content to discover business-critical user stories. Look for navigation bar and menus to explore every pages of the website, until I tell you to stop.";
|
|
3200
|
+
var WEBSITE_SCAN_PRECONDITION = "Try to 'register an new account' or 'log in' with managed profile or user-provided credentials; Must clear all dialogs, popups, tutorial, and notifications that block the main content first.";
|
|
3201
|
+
var WEBSITE_SCAN_EXPECTED_RESULT = "Logged in successfully and explored the website until I tell you to stop.";
|
|
3202
|
+
|
|
3197
3203
|
// packages/mcps/src/mcp/local/services/action-script-builders.ts
|
|
3198
3204
|
function getRequiredStringField(params) {
|
|
3199
3205
|
const value = params.source[params.fieldName];
|
|
@@ -3278,6 +3284,36 @@ function buildGenerationActionScript(params) {
|
|
|
3278
3284
|
status: "active"
|
|
3279
3285
|
};
|
|
3280
3286
|
}
|
|
3287
|
+
function buildWebsiteScanActionScript(params) {
|
|
3288
|
+
const scanName = `Local Website Scan ${params.url}`;
|
|
3289
|
+
return {
|
|
3290
|
+
actionScriptId: params.runId,
|
|
3291
|
+
actionScriptName: scanName,
|
|
3292
|
+
actionType: "Exploratory",
|
|
3293
|
+
actionParams: {
|
|
3294
|
+
type: WEBSITE_SCAN_WORKFLOW_TYPE,
|
|
3295
|
+
name: scanName,
|
|
3296
|
+
ownerId: params.ownerUserId,
|
|
3297
|
+
projectId: params.projectId,
|
|
3298
|
+
workflowRunId: params.runId,
|
|
3299
|
+
useCaseDiscoverMemoryId: params.useCaseDiscoverMemoryId,
|
|
3300
|
+
targetUseCaseCandidateCount: params.targetUseCaseCandidateCount,
|
|
3301
|
+
// Resolved server-side per project; the MCP has no client-side source for it.
|
|
3302
|
+
sharedTestMemoryId: "",
|
|
3303
|
+
runEnvironmentType: "local"
|
|
3304
|
+
},
|
|
3305
|
+
goal: WEBSITE_SCAN_GOAL,
|
|
3306
|
+
url: params.url,
|
|
3307
|
+
description: scanName,
|
|
3308
|
+
precondition: WEBSITE_SCAN_PRECONDITION,
|
|
3309
|
+
expectedResult: WEBSITE_SCAN_EXPECTED_RESULT,
|
|
3310
|
+
steps: [],
|
|
3311
|
+
ownerId: params.ownerUserId,
|
|
3312
|
+
createdAt: Date.now(),
|
|
3313
|
+
isRemoteScript: false,
|
|
3314
|
+
status: "active"
|
|
3315
|
+
};
|
|
3316
|
+
}
|
|
3281
3317
|
function buildReplayActionScript(params) {
|
|
3282
3318
|
const testScriptRecord = params.testScript;
|
|
3283
3319
|
const projectId = getRequiredStringField({
|
|
@@ -3393,6 +3429,7 @@ function describeStoppedRun(params) {
|
|
|
3393
3429
|
// packages/mcps/src/mcp/local/services/execution-timeout-constants.ts
|
|
3394
3430
|
var DEFAULT_GENERATION_TIMEOUT_MS = 3e5;
|
|
3395
3431
|
var DEFAULT_REPLAY_TIMEOUT_MS = 18e4;
|
|
3432
|
+
var DEFAULT_WEBSITE_SCAN_TIMEOUT_MS = 18e5;
|
|
3396
3433
|
|
|
3397
3434
|
// packages/mcps/src/shared/queue-priority/queue-priority-constants.ts
|
|
3398
3435
|
var PR_LOOKUP_TIMEOUT_MS = 1e4;
|
|
@@ -3695,6 +3732,14 @@ async function readStudioBuildAsync(params) {
|
|
|
3695
3732
|
}
|
|
3696
3733
|
}
|
|
3697
3734
|
|
|
3735
|
+
// packages/mcps/src/mcp/local/services/website-scan-types.ts
|
|
3736
|
+
var WebsiteScanExitEnum = /* @__PURE__ */ ((WebsiteScanExitEnum2) => {
|
|
3737
|
+
WebsiteScanExitEnum2["Completed"] = "completed";
|
|
3738
|
+
WebsiteScanExitEnum2["TimedOut"] = "timed_out";
|
|
3739
|
+
WebsiteScanExitEnum2["Failed"] = "failed";
|
|
3740
|
+
return WebsiteScanExitEnum2;
|
|
3741
|
+
})(WebsiteScanExitEnum || {});
|
|
3742
|
+
|
|
3698
3743
|
// packages/mcps/src/mcp/local/services/execution-service.ts
|
|
3699
3744
|
var logger5 = getLogger();
|
|
3700
3745
|
function extractStudioCloudRefs(studioReturnedResult) {
|
|
@@ -3978,7 +4023,7 @@ function resolveFailedRunStatus(executionResult) {
|
|
|
3978
4023
|
return executionResult.stopReason !== void 0 ? resolveStoppedRunStatus(executionResult.stopReason) : "failed";
|
|
3979
4024
|
}
|
|
3980
4025
|
async function executeElectronAppAsync(params) {
|
|
3981
|
-
const mode = params.runType === "
|
|
4026
|
+
const mode = params.runType === "replay" ? "engine" : "explore";
|
|
3982
4027
|
const electronAppPath = requireElectronAppPath(params.electronAppPath);
|
|
3983
4028
|
const spawnArgs = [mode, params.scriptFilePath, params.mutationsFilePath ?? "", params.authFilePath];
|
|
3984
4029
|
if (params.showUi) {
|
|
@@ -4462,6 +4507,66 @@ async function runReplayLocked(params) {
|
|
|
4462
4507
|
};
|
|
4463
4508
|
}
|
|
4464
4509
|
}
|
|
4510
|
+
async function executeWebsiteScan(params) {
|
|
4511
|
+
const timeoutMs = params.timeoutMs ?? DEFAULT_WEBSITE_SCAN_TIMEOUT_MS;
|
|
4512
|
+
const lockHandle = await acquireLocalExecutionLock({ cwd: params.cwd, runTimeoutMs: timeoutMs });
|
|
4513
|
+
try {
|
|
4514
|
+
return await runWebsiteScanLocked({ ...params, timeoutMs });
|
|
4515
|
+
} finally {
|
|
4516
|
+
await lockHandle.release();
|
|
4517
|
+
}
|
|
4518
|
+
}
|
|
4519
|
+
async function runWebsiteScanLocked(params) {
|
|
4520
|
+
const runId = randomUUID();
|
|
4521
|
+
const startedAt = Date.now();
|
|
4522
|
+
const authContent = await buildStudioAuthContentAsync();
|
|
4523
|
+
const inputFilePath = await writeTempFile({
|
|
4524
|
+
filename: `${runId}_input.json`,
|
|
4525
|
+
data: buildWebsiteScanActionScript({
|
|
4526
|
+
projectId: params.projectId,
|
|
4527
|
+
url: params.url,
|
|
4528
|
+
runId,
|
|
4529
|
+
ownerUserId: authContent.userId,
|
|
4530
|
+
useCaseDiscoverMemoryId: params.useCaseDiscoverMemoryId,
|
|
4531
|
+
targetUseCaseCandidateCount: params.targetUseCaseCandidateCount
|
|
4532
|
+
})
|
|
4533
|
+
});
|
|
4534
|
+
const authFilePath = await writeTempFile({ filename: `${runId}_auth.json`, data: authContent });
|
|
4535
|
+
try {
|
|
4536
|
+
const executionResult = await executeElectronAppAsync({
|
|
4537
|
+
runId,
|
|
4538
|
+
runType: "websiteScan",
|
|
4539
|
+
electronAppPath: resolveElectronAppPathOrNull(),
|
|
4540
|
+
scriptFilePath: inputFilePath,
|
|
4541
|
+
authFilePath,
|
|
4542
|
+
timeoutMs: params.timeoutMs,
|
|
4543
|
+
showUi: params.showUi
|
|
4544
|
+
});
|
|
4545
|
+
await writeExecutionLogs({ runId, stdout: executionResult.stdout, stderr: executionResult.stderr });
|
|
4546
|
+
const durationMs = Date.now() - startedAt;
|
|
4547
|
+
if (executionResult.stopReason === "timeout" /* Timeout */) {
|
|
4548
|
+
return { runId, exit: "timed_out" /* TimedOut */, durationMs, failureMessage: null };
|
|
4549
|
+
}
|
|
4550
|
+
if (executionResult.exitCode !== 0 || executionResult.stopReason !== void 0) {
|
|
4551
|
+
return {
|
|
4552
|
+
runId,
|
|
4553
|
+
exit: "failed" /* Failed */,
|
|
4554
|
+
durationMs,
|
|
4555
|
+
failureMessage: describeElectronFailure({ executionResult, timeoutMs: params.timeoutMs })
|
|
4556
|
+
};
|
|
4557
|
+
}
|
|
4558
|
+
return { runId, exit: "completed" /* Completed */, durationMs, failureMessage: null };
|
|
4559
|
+
} catch (error) {
|
|
4560
|
+
return {
|
|
4561
|
+
runId,
|
|
4562
|
+
exit: "failed" /* Failed */,
|
|
4563
|
+
durationMs: Date.now() - startedAt,
|
|
4564
|
+
failureMessage: error instanceof Error ? error.message : String(error)
|
|
4565
|
+
};
|
|
4566
|
+
} finally {
|
|
4567
|
+
await cleanupTempFiles({ filePaths: [inputFilePath, authFilePath] });
|
|
4568
|
+
}
|
|
4569
|
+
}
|
|
4465
4570
|
function cancelExecution(params) {
|
|
4466
4571
|
const process2 = activeProcesses.get(params.runId);
|
|
4467
4572
|
if (!process2) {
|
|
@@ -6580,6 +6685,8 @@ var e2e_exports = {};
|
|
|
6580
6685
|
__export(e2e_exports, {
|
|
6581
6686
|
PRICING_GET_TOOL_NAME: () => PRICING_GET_TOOL_NAME,
|
|
6582
6687
|
STRIPE_MINOR_UNITS_PER_MAJOR_UNIT: () => STRIPE_MINOR_UNITS_PER_MAJOR_UNIT,
|
|
6688
|
+
TEST_CASE_GET_TOOL_NAME: () => TEST_CASE_GET_TOOL_NAME,
|
|
6689
|
+
USE_CASE_DISCOVERY_MEMORY_GET_TOOL_NAME: () => USE_CASE_DISCOVERY_MEMORY_GET_TOOL_NAME,
|
|
6583
6690
|
WALLET_PACKAGES_PATH: () => WALLET_PACKAGES_PATH,
|
|
6584
6691
|
allQaToolDefinitions: () => allQaToolDefinitions,
|
|
6585
6692
|
executeQaTool: () => executeQaTool,
|
|
@@ -8191,6 +8298,10 @@ function mapWalletPackageList(response) {
|
|
|
8191
8298
|
};
|
|
8192
8299
|
}
|
|
8193
8300
|
|
|
8301
|
+
// packages/mcps/src/mcp/tools/e2e/tool-name-constants.ts
|
|
8302
|
+
var TEST_CASE_GET_TOOL_NAME = "muggle-remote-test-case-get";
|
|
8303
|
+
var USE_CASE_DISCOVERY_MEMORY_GET_TOOL_NAME = "muggle-remote-use-case-discovery-memory-get";
|
|
8304
|
+
|
|
8194
8305
|
// packages/mcps/src/mcp/tools/e2e/project-display-resolutions-constants.ts
|
|
8195
8306
|
var KNOWN_DISPLAY_RESOLUTIONS = new Set(Object.values(DisplayResolution));
|
|
8196
8307
|
var KNOWN_RUN_STRATEGIES = new Set(Object.values(RunStrategy));
|
|
@@ -8646,7 +8757,7 @@ var projectTools = [
|
|
|
8646
8757
|
];
|
|
8647
8758
|
var useCaseTools = [
|
|
8648
8759
|
{
|
|
8649
|
-
name:
|
|
8760
|
+
name: USE_CASE_DISCOVERY_MEMORY_GET_TOOL_NAME,
|
|
8650
8761
|
description: "Get the use case discovery memory for a project, including all discovered use case candidates.",
|
|
8651
8762
|
inputSchema: UseCaseDiscoveryMemoryGetInputSchema,
|
|
8652
8763
|
mapToUpstream: (input) => {
|
|
@@ -8841,7 +8952,7 @@ var testCaseTools = [
|
|
|
8841
8952
|
}
|
|
8842
8953
|
},
|
|
8843
8954
|
{
|
|
8844
|
-
name:
|
|
8955
|
+
name: TEST_CASE_GET_TOOL_NAME,
|
|
8845
8956
|
description: "Get details of a specific test case.",
|
|
8846
8957
|
inputSchema: TestCaseGetInputSchema,
|
|
8847
8958
|
entityReferenceFields: [TEST_CASE_ID_REFERENCE_FIELD],
|
|
@@ -10666,6 +10777,7 @@ function safeTrack(event) {
|
|
|
10666
10777
|
// packages/mcps/src/mcp/tools/local/index.ts
|
|
10667
10778
|
var local_exports = {};
|
|
10668
10779
|
__export(local_exports, {
|
|
10780
|
+
EXECUTE_TEST_GENERATION_TOOL_NAME: () => EXECUTE_TEST_GENERATION_TOOL_NAME,
|
|
10669
10781
|
allLocalQaTools: () => allLocalQaTools,
|
|
10670
10782
|
executeTool: () => executeTool,
|
|
10671
10783
|
getTool: () => getTool
|
|
@@ -10875,6 +10987,9 @@ function writeLastHost(cwd, host) {
|
|
|
10875
10987
|
function clearLastHost(cwd) {
|
|
10876
10988
|
clearCwdEntry(LAST_HOST_CACHE, cwd);
|
|
10877
10989
|
}
|
|
10990
|
+
|
|
10991
|
+
// packages/mcps/src/mcp/tools/local/tool-name-constants.ts
|
|
10992
|
+
var EXECUTE_TEST_GENERATION_TOOL_NAME = "muggle-local-execute-test-generation";
|
|
10878
10993
|
var REFUSING_VERDICTS = /* @__PURE__ */ new Set([
|
|
10879
10994
|
"PEER_LEASE" /* PeerLease */,
|
|
10880
10995
|
"STALE" /* Stale */,
|
|
@@ -11343,7 +11458,7 @@ function formatRunViewUrlLine(runId) {
|
|
|
11343
11458
|
return formatViewUrlLine(getRunResultStorageService().getRunResult(runId)?.viewUrl);
|
|
11344
11459
|
}
|
|
11345
11460
|
var executeTestGenerationTool = {
|
|
11346
|
-
name:
|
|
11461
|
+
name: EXECUTE_TEST_GENERATION_TOOL_NAME,
|
|
11347
11462
|
description: `Generate an end-to-end (E2E) acceptance test script by launching a real browser against your web app. The browser navigates your app, executes the test case steps (like signing up, filling forms, clicking through flows), and produces a replayable test script with screenshots. Use this to create new browser tests for any user flow. Requires a test case (from muggle-remote-test-case-get) and a localhost URL. ${TEST_CASE_LIMIT_GUIDANCE} Launches an Electron browser \u2014 the user's showElectronBrowser preference decides whether its window shows when set to always or never; under ask it defaults to a visible window and showUi: false runs it headless.`,
|
|
11348
11463
|
inputSchema: ExecuteTestGenerationInputSchema,
|
|
11349
11464
|
execute: async (ctx) => {
|
|
@@ -11859,6 +11974,7 @@ __export(e2e_exports2, {
|
|
|
11859
11974
|
SecretTypeEnum: () => SecretTypeEnum,
|
|
11860
11975
|
SecretUpdateInputSchema: () => SecretUpdateInputSchema,
|
|
11861
11976
|
StripePaymentMethodIdSchema: () => StripePaymentMethodIdSchema,
|
|
11977
|
+
TEST_CASE_GET_TOOL_NAME: () => TEST_CASE_GET_TOOL_NAME,
|
|
11862
11978
|
TestCaseAncestorsGetInputSchema: () => TestCaseAncestorsGetInputSchema,
|
|
11863
11979
|
TestCaseCreateInputSchema: () => TestCaseCreateInputSchema,
|
|
11864
11980
|
TestCaseDeleteInputSchema: () => TestCaseDeleteInputSchema,
|
|
@@ -11889,6 +12005,7 @@ __export(e2e_exports2, {
|
|
|
11889
12005
|
TestStateUpdateInputSchema: () => TestStateUpdateInputSchema,
|
|
11890
12006
|
TokenPackageIdSchema: () => TokenPackageIdSchema,
|
|
11891
12007
|
TokenUsageFilterTypeSchema: () => TokenUsageFilterTypeSchema,
|
|
12008
|
+
USE_CASE_DISCOVERY_MEMORY_GET_TOOL_NAME: () => USE_CASE_DISCOVERY_MEMORY_GET_TOOL_NAME,
|
|
11892
12009
|
UseCaseCandidatesApproveInputSchema: () => UseCaseCandidatesApproveInputSchema,
|
|
11893
12010
|
UseCaseCreateFromPromptsInputSchema: () => UseCaseCreateFromPromptsInputSchema,
|
|
11894
12011
|
UseCaseCreateInputSchema: () => UseCaseCreateInputSchema,
|
|
@@ -11954,9 +12071,11 @@ __export(local_exports2, {
|
|
|
11954
12071
|
CancelExecutionInputSchema: () => CancelExecutionInputSchema,
|
|
11955
12072
|
CleanupSessionsInputSchema: () => CleanupSessionsInputSchema,
|
|
11956
12073
|
CloudMappingEntityType: () => CloudMappingEntityType,
|
|
12074
|
+
DEFAULT_WEBSITE_SCAN_TIMEOUT_MS: () => DEFAULT_WEBSITE_SCAN_TIMEOUT_MS,
|
|
11957
12075
|
DeviceCodePollStatus: () => DeviceCodePollStatus,
|
|
11958
12076
|
DisplayResolution: () => DisplayResolution,
|
|
11959
12077
|
DisplayResolutionSchema: () => DisplayResolutionSchema,
|
|
12078
|
+
EXECUTE_TEST_GENERATION_TOOL_NAME: () => EXECUTE_TEST_GENERATION_TOOL_NAME,
|
|
11960
12079
|
EmptyInputSchema: () => EmptyInputSchema2,
|
|
11961
12080
|
EventTelemetryEmitInputSchema: () => EventTelemetryEmitInputSchema,
|
|
11962
12081
|
ExecuteReplayInputSchema: () => ExecuteReplayInputSchema,
|
|
@@ -11991,6 +12110,7 @@ __export(local_exports2, {
|
|
|
11991
12110
|
TestScriptDetailsSchema: () => TestScriptDetailsSchema,
|
|
11992
12111
|
TestScriptGetInputSchema: () => TestScriptGetInputSchema2,
|
|
11993
12112
|
TestScriptListInputSchema: () => TestScriptListInputSchema2,
|
|
12113
|
+
WebsiteScanExitEnum: () => WebsiteScanExitEnum,
|
|
11994
12114
|
WorkflowEventType: () => WorkflowEventType,
|
|
11995
12115
|
acquireLocalExecutionLock: () => acquireLocalExecutionLock,
|
|
11996
12116
|
allLocalQaTools: () => allLocalQaTools,
|
|
@@ -11999,6 +12119,7 @@ __export(local_exports2, {
|
|
|
11999
12119
|
executeReplay: () => executeReplay,
|
|
12000
12120
|
executeTestGeneration: () => executeTestGeneration,
|
|
12001
12121
|
executeTool: () => executeTool,
|
|
12122
|
+
executeWebsiteScan: () => executeWebsiteScan,
|
|
12002
12123
|
findRunCheckoutRefusal: () => findRunCheckoutRefusal,
|
|
12003
12124
|
getAuthService: () => getAuthService,
|
|
12004
12125
|
getLocalQaTools: () => getLocalQaTools,
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-
|
|
2
|
-
export { createChildLogger, e2e_exports as e2e, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, e2e_exports as qa, src_exports as shared } from './chunk-
|
|
1
|
+
export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-2GSA5O6H.js';
|
|
2
|
+
export { createChildLogger, e2e_exports as e2e, getConfig, getLocalQaTools, getLogger, getQaTools, local_exports as localQa, mcp_exports as mcp, e2e_exports as qa, src_exports as shared } from './chunk-VTGELNSG.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
|
|
4
|
-
"version": "5.38.0-staging.
|
|
4
|
+
"version": "5.38.0-staging.353",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|
|
7
7
|
"email": "support@muggle-ai.com"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"displayName": "Muggle AI",
|
|
4
4
|
"description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
|
|
5
|
-
"version": "5.38.0-staging.
|
|
5
|
+
"version": "5.38.0-staging.353",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Muggle AI",
|
|
8
8
|
"email": "support@muggle-ai.com"
|
package/dist/plugin/.mcp.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release": "5.38.0-staging.
|
|
3
|
-
"buildId": "run-
|
|
4
|
-
"commitSha": "
|
|
2
|
+
"release": "5.38.0-staging.353",
|
|
3
|
+
"buildId": "run-353-1",
|
|
4
|
+
"commitSha": "1f8c1b3b8d364c5afbe9f3d86984fa296550aae2",
|
|
5
5
|
"buildTime": "2026-11-12T07:45:22Z",
|
|
6
6
|
"serviceName": "muggle-ai-works-mcp"
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ACTION_SCRIPT_FILE_NAME, BASE_REMOTE_NAME, BLOCKING_FRESHNESS_VERDICTS, BRANCH_CREATION_REFLOG_PREFIX, BUSY_EXIT_CODE, CLAUDE_CODE_AUTH_STATUS_ARGS, CLAUDE_CODE_CHECK_TIMEOUT_MS, CLAUDE_CODE_EXECUTABLE, CLAUDE_CODE_EXECUTABLE_NOT_FOUND_CODE, CLAUDE_CODE_SESSION_LINK_ENV_VARS, CLAUDE_CODE_VERSION_ARGS, CheckoutFreshnessVerdict, ClaudeCodeReadiness, DEFAULT_LOCAL_LLM_BASE_URL, DEFAULT_PREFERENCES, ELECTRON_APP_CHECKSUMS_ASSET_NAME, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ELECTRON_APP_RESOURCES_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, LLM_CREDENTIALS_FILE_MODE, LLM_CREDENTIALS_FILE_NAME, LLM_SOURCE_HEADER, LLM_SOURCE_OPTIONS, LLM_SOURCE_OWNED_ENV_NAMES, LLM_SOURCE_PROMPT, LLM_SOURCE_SCOPE_NOTE, LlmSource, MASKED_API_KEY_PREFIX, MASKED_API_KEY_VISIBLE_CHARS, MAX_LISTED_INHERITED_COMMITS, ONBOARDING_BLANKET_OPTIONS, ONBOARDING_CHOICE_GROUPS, ONBOARDING_MAX_OFFERS, ONBOARDING_PRIMER_BULLETS, ONBOARDING_PRIMER_HEADLINE, ONBOARDING_TOGGLE_GROUPS, ONBOARDING_TOGGLE_PROMPT, ONBOARDING_UNSELECTED_TOGGLE_VALUE, OnboardingBlanketChoice, OnboardingGroupKind, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ProjectPreferencesReconcileOutcome, RUN_SESSIONS_DIR_NAME, RUN_VIEW_DASHBOARD_LINK_LABEL, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, StackCheckVerdict, StackClaimVerdict, StackLeaseEndReason, StackMismatchKind, StackPortAction, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyLlmSourceSelection, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildLlmSourcePlan, buildOnboardingPlan, buildToolInputJsonSchema, calculateFileChecksum, checkServiceStack, claimServiceStack, compareQueuePlaces, completeOnboarding, createApiKeyWithToken, createChildLogger, decideStackClaim, decideStackReap, decideStackRelease, decideStackRunEnd, decideStackRunStart, deleteApiKeyData, deleteCredentials, describeLlmSourceStatus, describeStackMismatch, e2e_exports as e2e, evaluateCheckoutFreshness, findVacatedNeeds, finishStackRun, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLlmSourceOption, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, isValidLocalBaseUrl, loadApiKeyData, loadCredentials, local_exports as localQa, lookUpCheckoutPullRequest, markOnboardingCompleted, maskLlmApiKey, mcp_exports as mcp, needsConflict, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, portOfUrl, e2e_exports as qa, readPreferencesMetadata, readRunView, readServiceStackStatus, reapServiceStack, reconcileProjectPreferences, recordOnboardingSkip, releaseServiceStack, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveElectronAppResourcesDir, resolveLlmSourceStatus, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, runGitCommand, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, startStackRun, stopVacatedServices, toDisplayRef, toolRequiresAuth, validatePreference, verifyFileChecksum, writeLlmEnvBlock, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-
|
|
1
|
+
export { ACTION_SCRIPT_FILE_NAME, BASE_REMOTE_NAME, BLOCKING_FRESHNESS_VERDICTS, BRANCH_CREATION_REFLOG_PREFIX, BUSY_EXIT_CODE, CLAUDE_CODE_AUTH_STATUS_ARGS, CLAUDE_CODE_CHECK_TIMEOUT_MS, CLAUDE_CODE_EXECUTABLE, CLAUDE_CODE_EXECUTABLE_NOT_FOUND_CODE, CLAUDE_CODE_SESSION_LINK_ENV_VARS, CLAUDE_CODE_VERSION_ARGS, CheckoutFreshnessVerdict, ClaudeCodeReadiness, DEFAULT_LOCAL_LLM_BASE_URL, DEFAULT_PREFERENCES, ELECTRON_APP_CHECKSUMS_ASSET_NAME, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ELECTRON_APP_RESOURCES_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, LLM_CREDENTIALS_FILE_MODE, LLM_CREDENTIALS_FILE_NAME, LLM_SOURCE_HEADER, LLM_SOURCE_OPTIONS, LLM_SOURCE_OWNED_ENV_NAMES, LLM_SOURCE_PROMPT, LLM_SOURCE_SCOPE_NOTE, LlmSource, MASKED_API_KEY_PREFIX, MASKED_API_KEY_VISIBLE_CHARS, MAX_LISTED_INHERITED_COMMITS, ONBOARDING_BLANKET_OPTIONS, ONBOARDING_CHOICE_GROUPS, ONBOARDING_MAX_OFFERS, ONBOARDING_PRIMER_BULLETS, ONBOARDING_PRIMER_HEADLINE, ONBOARDING_TOGGLE_GROUPS, ONBOARDING_TOGGLE_PROMPT, ONBOARDING_UNSELECTED_TOGGLE_VALUE, OnboardingBlanketChoice, OnboardingGroupKind, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ProjectPreferencesReconcileOutcome, RUN_SESSIONS_DIR_NAME, RUN_VIEW_DASHBOARD_LINK_LABEL, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, StackCheckVerdict, StackClaimVerdict, StackLeaseEndReason, StackMismatchKind, StackPortAction, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyLlmSourceSelection, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildLlmSourcePlan, buildOnboardingPlan, buildToolInputJsonSchema, calculateFileChecksum, checkServiceStack, claimServiceStack, compareQueuePlaces, completeOnboarding, createApiKeyWithToken, createChildLogger, decideStackClaim, decideStackReap, decideStackRelease, decideStackRunEnd, decideStackRunStart, deleteApiKeyData, deleteCredentials, describeLlmSourceStatus, describeStackMismatch, e2e_exports as e2e, evaluateCheckoutFreshness, findVacatedNeeds, finishStackRun, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLlmSourceOption, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, isValidLocalBaseUrl, loadApiKeyData, loadCredentials, local_exports as localQa, lookUpCheckoutPullRequest, markOnboardingCompleted, maskLlmApiKey, mcp_exports as mcp, needsConflict, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, portOfUrl, e2e_exports as qa, readPreferencesMetadata, readRunView, readServiceStackStatus, reapServiceStack, reconcileProjectPreferences, recordOnboardingSkip, releaseServiceStack, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveElectronAppResourcesDir, resolveLlmSourceStatus, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, runGitCommand, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, startStackRun, stopVacatedServices, toDisplayRef, toolRequiresAuth, validatePreference, verifyFileChecksum, writeLlmEnvBlock, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-VTGELNSG.js';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muggleai/works",
|
|
3
3
|
"mcpName": "io.github.multiplex-ai/muggleai",
|
|
4
|
-
"version": "5.38.0-staging.
|
|
4
|
+
"version": "5.38.0-staging.353",
|
|
5
5
|
"description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
|
|
4
|
-
"version": "5.38.0-staging.
|
|
4
|
+
"version": "5.38.0-staging.353",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|
|
7
7
|
"email": "support@muggle-ai.com"
|
package/plugin/.codex-mcp.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"displayName": "Muggle AI",
|
|
4
4
|
"description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
|
|
5
|
-
"version": "5.38.0-staging.
|
|
5
|
+
"version": "5.38.0-staging.353",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Muggle AI",
|
|
8
8
|
"email": "support@muggle-ai.com"
|