@muggleai/works 5.24.0 → 5.25.0-staging.185
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/README.md +1 -0
- package/dist/{chunk-GLTZIZVT.js → chunk-53MCWNVE.js} +56 -32
- package/dist/{chunk-FEHTWWVH.js → chunk-C6OEDLIP.js} +273 -5
- 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/plugin/agents/test-prepare-runner.md +3 -3
- package/dist/plugin/skills/_shared/dev-loop/run.md +4 -1
- package/dist/plugin/skills/_shared/post-merge-cleanup.md +7 -6
- package/dist/plugin/skills/_shared/pr-branch-worktree.md +7 -6
- package/dist/plugin/skills/_shared/sync-branch-with-base.md +39 -4
- package/dist/plugin/skills/_shared/use-worktrees.md +12 -6
- package/dist/plugin/skills/do/e2e-acceptance.md +1 -1
- package/dist/plugin/skills/do/pre-flight.md +1 -1
- package/dist/plugin/skills/do/wave-e2e.md +2 -2
- package/dist/plugin/skills/muggle-preferences/preference-gates/autoRebase.md +3 -3
- package/dist/plugin/skills/muggle-test/execute-local.md +2 -2
- package/dist/plugin/skills/muggle-test-feature-local/SKILL.md +3 -8
- package/dist/plugin/skills/muggle-test-prepare/SKILL.md +42 -29
- package/dist/plugin/skills/muggle-test-prepare/steps/check-running.md +25 -10
- package/dist/plugin/skills/muggle-test-prepare/steps/e2e-instructions.md +1 -1
- package/dist/plugin/skills/muggle-test-prepare/steps/env-file.md +8 -5
- package/dist/plugin/skills/muggle-test-prepare/steps/readiness-report.md +22 -18
- package/dist/plugin/skills/muggle-test-prepare/steps/rebase-check.md +13 -1
- package/dist/plugin/skills/muggle-test-prepare/steps/replay-or-learn.md +2 -2
- package/dist/plugin/skills/muggle-test-prepare/steps/resolve-sources.md +39 -0
- package/dist/plugin/skills/muggle-test-prepare/steps/reuse-plan.md +7 -5
- package/dist/plugin/skills/muggle-test-prepare/steps/smoke-test.md +2 -2
- package/dist/plugin/skills/muggle-test-prepare/steps/start-services.md +4 -4
- package/dist/release-manifest.json +3 -3
- package/dist/src-V7DVV6KO.js +1 -0
- package/package.json +2 -2
- 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
- package/plugin/agents/test-prepare-runner.md +3 -3
- package/plugin/skills/_shared/dev-loop/run.md +4 -1
- package/plugin/skills/_shared/post-merge-cleanup.md +7 -6
- package/plugin/skills/_shared/pr-branch-worktree.md +7 -6
- package/plugin/skills/_shared/sync-branch-with-base.md +39 -4
- package/plugin/skills/_shared/use-worktrees.md +12 -6
- package/plugin/skills/do/e2e-acceptance.md +1 -1
- package/plugin/skills/do/pre-flight.md +1 -1
- package/plugin/skills/do/wave-e2e.md +2 -2
- package/plugin/skills/muggle-preferences/preference-gates/autoRebase.md +3 -3
- package/plugin/skills/muggle-test/execute-local.md +2 -2
- package/plugin/skills/muggle-test-feature-local/SKILL.md +3 -8
- package/plugin/skills/muggle-test-prepare/SKILL.md +42 -29
- package/plugin/skills/muggle-test-prepare/steps/check-running.md +25 -10
- package/plugin/skills/muggle-test-prepare/steps/e2e-instructions.md +1 -1
- package/plugin/skills/muggle-test-prepare/steps/env-file.md +8 -5
- package/plugin/skills/muggle-test-prepare/steps/readiness-report.md +22 -18
- package/plugin/skills/muggle-test-prepare/steps/rebase-check.md +13 -1
- package/plugin/skills/muggle-test-prepare/steps/replay-or-learn.md +2 -2
- package/plugin/skills/muggle-test-prepare/steps/resolve-sources.md +39 -0
- package/plugin/skills/muggle-test-prepare/steps/reuse-plan.md +7 -5
- package/plugin/skills/muggle-test-prepare/steps/smoke-test.md +2 -2
- package/plugin/skills/muggle-test-prepare/steps/start-services.md +4 -4
- package/dist/src-3MQ2UWSP.js +0 -1
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"name": "muggleai",
|
|
10
10
|
"source": "./plugin",
|
|
11
11
|
"description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
|
|
12
|
-
"version": "5.
|
|
12
|
+
"version": "5.25.0-staging.185"
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
}
|
package/README.md
CHANGED
|
@@ -352,6 +352,7 @@ muggle doctor # Diagnose installation problems
|
|
|
352
352
|
muggle run-view [runId] # A run's steps beside the frames they produced (newest run by default)
|
|
353
353
|
muggle run-view --html # Render those frames as a self-contained page
|
|
354
354
|
muggle run-view --open # Render it and open it in the browser
|
|
355
|
+
muggle checkout-freshness # Fetch the base and check this checkout is built on its latest commit
|
|
355
356
|
|
|
356
357
|
# Authentication
|
|
357
358
|
muggle login [--key-expiry 90d]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __export, getLogger, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir, 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, toolRequiresAuth, getCallerCredentials, parseElectronAppDirName, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, ElectronAppReleaseStream, buildElectronAppChecksumsUrl, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, OnboardingBlanketChoice, PreferenceKey, resolvePreferences } from './chunk-
|
|
1
|
+
import { __export, getLogger, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir, 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, buildElectronAppChecksumsUrl, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, OnboardingBlanketChoice, PreferenceKey, resolvePreferences } from './chunk-C6OEDLIP.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';
|
|
@@ -31,7 +31,7 @@ function clearTools() {
|
|
|
31
31
|
function zodToJsonSchema(schema) {
|
|
32
32
|
try {
|
|
33
33
|
if (schema && typeof schema === "object" && "safeParse" in schema) {
|
|
34
|
-
return
|
|
34
|
+
return buildToolInputJsonSchema(schema);
|
|
35
35
|
}
|
|
36
36
|
} catch {
|
|
37
37
|
}
|
|
@@ -69,66 +69,66 @@ function convertZodDef(schema) {
|
|
|
69
69
|
required.push(key);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
const
|
|
72
|
+
const jsonSchema = {
|
|
73
73
|
type: "object",
|
|
74
74
|
properties
|
|
75
75
|
};
|
|
76
76
|
if (required.length > 0) {
|
|
77
|
-
|
|
77
|
+
jsonSchema.required = required;
|
|
78
78
|
}
|
|
79
|
-
return
|
|
79
|
+
return jsonSchema;
|
|
80
80
|
}
|
|
81
81
|
case "ZodString":
|
|
82
82
|
case "string": {
|
|
83
|
-
const
|
|
84
|
-
if (def.description)
|
|
83
|
+
const jsonSchema = { type: "string" };
|
|
84
|
+
if (def.description) jsonSchema.description = def.description;
|
|
85
85
|
if (def.checks) {
|
|
86
86
|
for (const check of def.checks) {
|
|
87
|
-
if (check.kind === "min")
|
|
88
|
-
if (check.kind === "max")
|
|
89
|
-
if (check.kind === "url")
|
|
90
|
-
if (check.kind === "email")
|
|
87
|
+
if (check.kind === "min") jsonSchema.minLength = check.value;
|
|
88
|
+
if (check.kind === "max") jsonSchema.maxLength = check.value;
|
|
89
|
+
if (check.kind === "url") jsonSchema.format = "uri";
|
|
90
|
+
if (check.kind === "email") jsonSchema.format = "email";
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
return
|
|
93
|
+
return jsonSchema;
|
|
94
94
|
}
|
|
95
95
|
case "ZodNumber":
|
|
96
96
|
case "number": {
|
|
97
|
-
const
|
|
98
|
-
if (def.description)
|
|
97
|
+
const jsonSchema = { type: "number" };
|
|
98
|
+
if (def.description) jsonSchema.description = def.description;
|
|
99
99
|
if (def.checks) {
|
|
100
100
|
for (const check of def.checks) {
|
|
101
|
-
if (check.kind === "int")
|
|
102
|
-
if (check.kind === "min")
|
|
103
|
-
if (check.kind === "max")
|
|
101
|
+
if (check.kind === "int") jsonSchema.type = "integer";
|
|
102
|
+
if (check.kind === "min") jsonSchema.minimum = check.value;
|
|
103
|
+
if (check.kind === "max") jsonSchema.maximum = check.value;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
return
|
|
106
|
+
return jsonSchema;
|
|
107
107
|
}
|
|
108
108
|
case "ZodBoolean":
|
|
109
109
|
case "boolean": {
|
|
110
|
-
const
|
|
111
|
-
if (def.description)
|
|
112
|
-
return
|
|
110
|
+
const jsonSchema = { type: "boolean" };
|
|
111
|
+
if (def.description) jsonSchema.description = def.description;
|
|
112
|
+
return jsonSchema;
|
|
113
113
|
}
|
|
114
114
|
case "ZodArray":
|
|
115
115
|
case "array": {
|
|
116
|
-
const
|
|
116
|
+
const jsonSchema = {
|
|
117
117
|
type: "array",
|
|
118
118
|
items: def.innerType ? convertZodDef(def.innerType) : def.element ? convertZodDef(def.element) : {}
|
|
119
119
|
};
|
|
120
|
-
if (def.description)
|
|
121
|
-
return
|
|
120
|
+
if (def.description) jsonSchema.description = def.description;
|
|
121
|
+
return jsonSchema;
|
|
122
122
|
}
|
|
123
123
|
case "ZodEnum":
|
|
124
124
|
case "enum": {
|
|
125
125
|
const enumValues = Array.isArray(def.values) ? def.values : def.values ? Object.values(def.values) : [];
|
|
126
|
-
const
|
|
126
|
+
const jsonSchema = {
|
|
127
127
|
type: "string",
|
|
128
128
|
enum: enumValues
|
|
129
129
|
};
|
|
130
|
-
if (def.description)
|
|
131
|
-
return
|
|
130
|
+
if (def.description) jsonSchema.description = def.description;
|
|
131
|
+
return jsonSchema;
|
|
132
132
|
}
|
|
133
133
|
case "ZodOptional":
|
|
134
134
|
case "optional": {
|
|
@@ -226,7 +226,7 @@ function createUnifiedMcpServer(options) {
|
|
|
226
226
|
};
|
|
227
227
|
}
|
|
228
228
|
const startTime = Date.now();
|
|
229
|
-
const
|
|
229
|
+
const toolOutcome = await tool.execute({
|
|
230
230
|
input: toolInput,
|
|
231
231
|
correlationId
|
|
232
232
|
});
|
|
@@ -234,16 +234,16 @@ function createUnifiedMcpServer(options) {
|
|
|
234
234
|
childLogger.info("Tool call completed", {
|
|
235
235
|
tool: toolName,
|
|
236
236
|
latencyMs: latency,
|
|
237
|
-
isError:
|
|
237
|
+
isError: toolOutcome.isError
|
|
238
238
|
});
|
|
239
239
|
return {
|
|
240
240
|
content: [
|
|
241
241
|
{
|
|
242
242
|
type: "text",
|
|
243
|
-
text:
|
|
243
|
+
text: toolOutcome.content
|
|
244
244
|
}
|
|
245
245
|
],
|
|
246
|
-
isError:
|
|
246
|
+
isError: toolOutcome.isError
|
|
247
247
|
};
|
|
248
248
|
} catch (error) {
|
|
249
249
|
if (error instanceof ZodError) {
|
|
@@ -1042,7 +1042,7 @@ async function resolveGsScreenshotUrls(report, opts) {
|
|
|
1042
1042
|
if (gsUrls.length === 0) {
|
|
1043
1043
|
return report;
|
|
1044
1044
|
}
|
|
1045
|
-
const mcps = await import('./src-
|
|
1045
|
+
const mcps = await import('./src-V7DVV6KO.js');
|
|
1046
1046
|
const credentials = await mcps.getCallerCredentialsAsync();
|
|
1047
1047
|
if (!credentials.bearerToken && !credentials.apiKey) {
|
|
1048
1048
|
stderrWrite(
|
|
@@ -1169,6 +1169,29 @@ async function buildPrSectionCommand(options) {
|
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
1171
|
|
|
1172
|
+
// src/cli/checkout-freshness.ts
|
|
1173
|
+
function renderCheckoutFreshnessSummary(report) {
|
|
1174
|
+
const lines = [`${report.verdict}: ${report.reason}`];
|
|
1175
|
+
if (report.checkoutRoot) lines.push(`checkout: ${report.checkoutRoot}`);
|
|
1176
|
+
if (report.headSha) lines.push(`head: ${report.headSha}${report.branch ? ` (${report.branch})` : " (detached)"}`);
|
|
1177
|
+
if (report.baseRef && report.baseSha) lines.push(`base: ${report.baseRef} @ ${report.baseSha}`);
|
|
1178
|
+
if (report.hasFetchFailed) lines.push("warning: fetching the base failed \u2014 checked against the last fetched base");
|
|
1179
|
+
for (const commit of report.inheritedCommits) lines.push(`inherited: ${commit}`);
|
|
1180
|
+
return lines.join("\n");
|
|
1181
|
+
}
|
|
1182
|
+
async function checkoutFreshnessCommand(flags) {
|
|
1183
|
+
const report = await evaluateCheckoutFreshness({
|
|
1184
|
+
cwd: flags.cwd ?? process.cwd(),
|
|
1185
|
+
baseBranch: flags.base,
|
|
1186
|
+
shouldFetchBase: flags.fetch !== false,
|
|
1187
|
+
runGit: runGitCommand
|
|
1188
|
+
});
|
|
1189
|
+
const output = flags.json ? JSON.stringify(report, null, 2) : renderCheckoutFreshnessSummary(report);
|
|
1190
|
+
process.stdout.write(`${output}
|
|
1191
|
+
`);
|
|
1192
|
+
if (BLOCKING_FRESHNESS_VERDICTS.has(report.verdict)) process.exitCode = 1;
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1172
1195
|
// src/ci-workflow/constants.ts
|
|
1173
1196
|
var USER_WORKFLOW_PATH = ".github/workflows/muggle-walkthrough.yml";
|
|
1174
1197
|
var USER_WORKFLOW_COMMAND = "npx -y -p @muggleai/works muggle pr-walkthrough-check --check-run";
|
|
@@ -3443,6 +3466,7 @@ function createProgram() {
|
|
|
3443
3466
|
program.command("build-pr-section").description("Render a muggle-do PR body evidence block from an e2e report on stdin").option("--max-body-bytes <n>", "Max UTF-8 byte budget for the PR body (default 60000)").action(buildPrSectionCommand);
|
|
3444
3467
|
program.command("run-view").argument("[runId]", "Run id, or a unique prefix of one (default: the newest run)").description("Show a local run's steps beside the frames they produced").option("--html", "Render a self-contained HTML page instead of terminal text").option("--open", "Open the rendered page in the default browser (implies --html)").option("--out-dir <dir>", "Directory to write the page into (default: current directory)").action(runViewCommand);
|
|
3445
3468
|
program.command("pr-walkthrough-check").description("Check that a PR's Muggle AI walkthrough comment carries a result or a stated skip").option("--repo <owner/repo>", "Repository (default: $GITHUB_REPOSITORY)").option("--pr <number>", "Pull request number (default: the Actions event payload)").option("--head-sha <sha>", "Commit the check run attaches to (default: the PR head)").option("--check-run", "Publish the verdict as a check run instead of failing the process").action(prWalkthroughCheckCommand);
|
|
3469
|
+
program.command("checkout-freshness").description("Fetch the base branch and check that a checkout is built on its latest commit").option("--cwd <dir>", "Directory inside the checkout (default: the current directory)").option("--base <branch>", "Branch the change merges into (default: origin's default branch)").option("--no-fetch", "Check against the last fetched base instead of fetching").option("--json", "Print the full report as JSON").action(checkoutFreshnessCommand);
|
|
3446
3470
|
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);
|
|
3447
3471
|
program.action(() => {
|
|
3448
3472
|
helpCommand();
|
|
@@ -8,7 +8,7 @@ import { randomUUID } from 'crypto';
|
|
|
8
8
|
import * as os4 from 'os';
|
|
9
9
|
import { platform } from 'os';
|
|
10
10
|
import winston from 'winston';
|
|
11
|
-
import { exec, spawn } from 'child_process';
|
|
11
|
+
import { execFile, exec, spawn } from 'child_process';
|
|
12
12
|
import axios, { AxiosError } from 'axios';
|
|
13
13
|
import * as fs13 from 'fs/promises';
|
|
14
14
|
import { z } from 'zod';
|
|
@@ -30,11 +30,16 @@ var __export = (target, all) => {
|
|
|
30
30
|
var src_exports = {};
|
|
31
31
|
__export(src_exports, {
|
|
32
32
|
ACTION_SCRIPT_FILE_NAME: () => ACTION_SCRIPT_FILE_NAME,
|
|
33
|
+
BASE_REMOTE_NAME: () => BASE_REMOTE_NAME,
|
|
34
|
+
BLOCKING_FRESHNESS_VERDICTS: () => BLOCKING_FRESHNESS_VERDICTS,
|
|
35
|
+
BRANCH_CREATION_REFLOG_PREFIX: () => BRANCH_CREATION_REFLOG_PREFIX,
|
|
36
|
+
CheckoutFreshnessVerdict: () => CheckoutFreshnessVerdict,
|
|
33
37
|
DEFAULT_PREFERENCES: () => DEFAULT_PREFERENCES,
|
|
34
38
|
ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS: () => ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS,
|
|
35
39
|
ElectronAppPlatform: () => ElectronAppPlatform,
|
|
36
40
|
ElectronAppReleaseStream: () => ElectronAppReleaseStream,
|
|
37
41
|
HTML_VIEW_OFFER_LINE: () => HTML_VIEW_OFFER_LINE,
|
|
42
|
+
MAX_LISTED_INHERITED_COMMITS: () => MAX_LISTED_INHERITED_COMMITS,
|
|
38
43
|
ONBOARDING_BLANKET_OPTIONS: () => ONBOARDING_BLANKET_OPTIONS,
|
|
39
44
|
ONBOARDING_CHOICE_GROUPS: () => ONBOARDING_CHOICE_GROUPS,
|
|
40
45
|
ONBOARDING_MAX_OFFERS: () => ONBOARDING_MAX_OFFERS,
|
|
@@ -68,6 +73,7 @@ __export(src_exports, {
|
|
|
68
73
|
buildElectronAppReleaseAssetUrl: () => buildElectronAppReleaseAssetUrl,
|
|
69
74
|
buildElectronAppReleaseTag: () => buildElectronAppReleaseTag,
|
|
70
75
|
buildOnboardingPlan: () => buildOnboardingPlan,
|
|
76
|
+
buildToolInputJsonSchema: () => buildToolInputJsonSchema,
|
|
71
77
|
calculateFileChecksum: () => calculateFileChecksum,
|
|
72
78
|
completeOnboarding: () => completeOnboarding,
|
|
73
79
|
createApiKeyWithToken: () => createApiKeyWithToken,
|
|
@@ -75,6 +81,7 @@ __export(src_exports, {
|
|
|
75
81
|
deleteApiKeyData: () => deleteApiKeyData,
|
|
76
82
|
deleteCredentials: () => deleteCredentials,
|
|
77
83
|
e2e: () => e2e_exports2,
|
|
84
|
+
evaluateCheckoutFreshness: () => evaluateCheckoutFreshness,
|
|
78
85
|
formatPreferencesOneLiner: () => formatPreferencesOneLiner,
|
|
79
86
|
getActiveElectronAppReleaseStream: () => getActiveElectronAppReleaseStream,
|
|
80
87
|
getActiveRuntimeTarget: () => getActiveRuntimeTarget,
|
|
@@ -141,10 +148,12 @@ __export(src_exports, {
|
|
|
141
148
|
resolveRunSessionPath: () => resolveRunSessionPath,
|
|
142
149
|
resolveRuntimeTarget: () => resolveRuntimeTarget,
|
|
143
150
|
resolveTogglePreferences: () => resolveTogglePreferences,
|
|
151
|
+
runGitCommand: () => runGitCommand,
|
|
144
152
|
saveApiKey: () => saveApiKey,
|
|
145
153
|
saveApiKeyData: () => saveApiKeyData,
|
|
146
154
|
saveCredentials: () => saveCredentials,
|
|
147
155
|
startDeviceCodeFlow: () => startDeviceCodeFlow,
|
|
156
|
+
toDisplayRef: () => toDisplayRef,
|
|
148
157
|
toolRequiresAuth: () => toolRequiresAuth,
|
|
149
158
|
validatePreference: () => validatePreference,
|
|
150
159
|
verifyFileChecksum: () => verifyFileChecksum,
|
|
@@ -3945,6 +3954,183 @@ function listActiveExecutions() {
|
|
|
3945
3954
|
}));
|
|
3946
3955
|
}
|
|
3947
3956
|
|
|
3957
|
+
// packages/mcps/src/shared/checkout-freshness-types.ts
|
|
3958
|
+
var CheckoutFreshnessVerdict = /* @__PURE__ */ ((CheckoutFreshnessVerdict2) => {
|
|
3959
|
+
CheckoutFreshnessVerdict2["Fresh"] = "FRESH";
|
|
3960
|
+
CheckoutFreshnessVerdict2["BehindBase"] = "BEHIND_BASE";
|
|
3961
|
+
CheckoutFreshnessVerdict2["ForeignBase"] = "FOREIGN_BASE";
|
|
3962
|
+
CheckoutFreshnessVerdict2["NotApplicable"] = "NOT_APPLICABLE";
|
|
3963
|
+
return CheckoutFreshnessVerdict2;
|
|
3964
|
+
})(CheckoutFreshnessVerdict || {});
|
|
3965
|
+
|
|
3966
|
+
// packages/mcps/src/shared/checkout-freshness-constants.ts
|
|
3967
|
+
var BLOCKING_FRESHNESS_VERDICTS = /* @__PURE__ */ new Set([
|
|
3968
|
+
"BEHIND_BASE" /* BehindBase */,
|
|
3969
|
+
"FOREIGN_BASE" /* ForeignBase */
|
|
3970
|
+
]);
|
|
3971
|
+
var BASE_REMOTE_NAME = "origin";
|
|
3972
|
+
var BRANCH_CREATION_REFLOG_PREFIX = "branch: Created from ";
|
|
3973
|
+
var SHORT_SHA_LENGTH = 7;
|
|
3974
|
+
var MAX_LISTED_INHERITED_COMMITS = 20;
|
|
3975
|
+
var GIT_COMMAND_TIMEOUT_MS = 3e4;
|
|
3976
|
+
var runGitCommand = (args, cwd) => new Promise((resolve6) => {
|
|
3977
|
+
execFile(
|
|
3978
|
+
"git",
|
|
3979
|
+
args,
|
|
3980
|
+
{ cwd, timeout: GIT_COMMAND_TIMEOUT_MS, windowsHide: true, encoding: "utf-8" },
|
|
3981
|
+
(error, stdout) => {
|
|
3982
|
+
resolve6(error ? null : stdout.trim());
|
|
3983
|
+
}
|
|
3984
|
+
);
|
|
3985
|
+
});
|
|
3986
|
+
|
|
3987
|
+
// packages/mcps/src/shared/checkout-freshness.ts
|
|
3988
|
+
var shortSha = (sha) => sha.slice(0, SHORT_SHA_LENGTH);
|
|
3989
|
+
var pluralCommits = (count) => count === 1 ? "1 commit" : `${count} commits`;
|
|
3990
|
+
var isAncestorAsync = async (runGit, cwd, ancestorSha, descendantSha) => await runGit(["merge-base", "--is-ancestor", ancestorSha, descendantSha], cwd) !== null;
|
|
3991
|
+
var resolveMainWorktreeRootAsync = async (runGit, cwd) => {
|
|
3992
|
+
const porcelain = await runGit(["worktree", "list", "--porcelain"], cwd);
|
|
3993
|
+
const firstLine = porcelain?.split("\n")[0] ?? "";
|
|
3994
|
+
return firstLine.startsWith("worktree ") ? firstLine.slice("worktree ".length) : null;
|
|
3995
|
+
};
|
|
3996
|
+
var resolveDefaultBranchAsync = async (runGit, cwd) => {
|
|
3997
|
+
const remoteHead = await runGit(["symbolic-ref", "--short", `refs/remotes/${BASE_REMOTE_NAME}/HEAD`], cwd);
|
|
3998
|
+
const prefix = `${BASE_REMOTE_NAME}/`;
|
|
3999
|
+
return remoteHead?.startsWith(prefix) ? remoteHead.slice(prefix.length) : null;
|
|
4000
|
+
};
|
|
4001
|
+
var resolveBaseAsync = async (runGit, cwd, baseBranch) => {
|
|
4002
|
+
for (const ref of [`refs/remotes/${BASE_REMOTE_NAME}/${baseBranch}`, `refs/heads/${baseBranch}`]) {
|
|
4003
|
+
const sha = await runGit(["rev-parse", "--verify", "--quiet", `${ref}^{commit}`], cwd);
|
|
4004
|
+
if (sha) return { ref, sha };
|
|
4005
|
+
}
|
|
4006
|
+
return null;
|
|
4007
|
+
};
|
|
4008
|
+
var toDisplayRef = (ref) => ref.replace(/^refs\/(remotes|heads)\//, "");
|
|
4009
|
+
var isOwnRemoteBranch = (startPoint, branch) => startPoint === `${BASE_REMOTE_NAME}/${branch}` || startPoint === `refs/remotes/${BASE_REMOTE_NAME}/${branch}`;
|
|
4010
|
+
var readBranchCreationAsync = async (runGit, cwd, branch) => {
|
|
4011
|
+
const reflog = await runGit(["reflog", "show", "--format=%H%x09%gs", `refs/heads/${branch}`], cwd);
|
|
4012
|
+
const oldestEntry = reflog?.split("\n").at(-1) ?? "";
|
|
4013
|
+
const [sha, subject] = oldestEntry.split(" ");
|
|
4014
|
+
if (!sha || !subject?.startsWith(BRANCH_CREATION_REFLOG_PREFIX)) return null;
|
|
4015
|
+
const startPoint = subject.slice(BRANCH_CREATION_REFLOG_PREFIX.length);
|
|
4016
|
+
if (isOwnRemoteBranch(startPoint, branch)) return null;
|
|
4017
|
+
return { sha, startPoint };
|
|
4018
|
+
};
|
|
4019
|
+
var withVerdict = (report, verdict, reason) => ({ ...report, verdict, reason });
|
|
4020
|
+
async function evaluateCheckoutFreshness(request) {
|
|
4021
|
+
const { cwd, runGit } = request;
|
|
4022
|
+
let report = {
|
|
4023
|
+
verdict: "NOT_APPLICABLE" /* NotApplicable */,
|
|
4024
|
+
reason: "",
|
|
4025
|
+
checkoutRoot: null,
|
|
4026
|
+
mainWorktreeRoot: null,
|
|
4027
|
+
branch: null,
|
|
4028
|
+
headSha: null,
|
|
4029
|
+
baseRef: null,
|
|
4030
|
+
baseSha: null,
|
|
4031
|
+
behindBy: 0,
|
|
4032
|
+
creationSha: null,
|
|
4033
|
+
inheritedCommitCount: 0,
|
|
4034
|
+
inheritedCommits: [],
|
|
4035
|
+
hasFetchFailed: false
|
|
4036
|
+
};
|
|
4037
|
+
const checkoutRoot = await runGit(["rev-parse", "--show-toplevel"], cwd);
|
|
4038
|
+
if (!checkoutRoot) return withVerdict(report, "NOT_APPLICABLE" /* NotApplicable */, "not inside a git checkout");
|
|
4039
|
+
report.checkoutRoot = checkoutRoot;
|
|
4040
|
+
report.mainWorktreeRoot = await resolveMainWorktreeRootAsync(runGit, cwd);
|
|
4041
|
+
if (await runGit(["remote", "get-url", BASE_REMOTE_NAME], cwd) === null) {
|
|
4042
|
+
return withVerdict(report, "NOT_APPLICABLE" /* NotApplicable */, `the checkout has no ${BASE_REMOTE_NAME} remote`);
|
|
4043
|
+
}
|
|
4044
|
+
const baseBranch = request.baseBranch ?? await resolveDefaultBranchAsync(runGit, cwd);
|
|
4045
|
+
if (!baseBranch) {
|
|
4046
|
+
return withVerdict(
|
|
4047
|
+
report,
|
|
4048
|
+
"NOT_APPLICABLE" /* NotApplicable */,
|
|
4049
|
+
`${BASE_REMOTE_NAME}'s default branch is unknown \u2014 name the base branch explicitly`
|
|
4050
|
+
);
|
|
4051
|
+
}
|
|
4052
|
+
if (request.shouldFetchBase) {
|
|
4053
|
+
const refspec = `+refs/heads/${baseBranch}:refs/remotes/${BASE_REMOTE_NAME}/${baseBranch}`;
|
|
4054
|
+
report.hasFetchFailed = await runGit(["fetch", "--no-tags", BASE_REMOTE_NAME, refspec], cwd) === null;
|
|
4055
|
+
}
|
|
4056
|
+
const base = await resolveBaseAsync(runGit, cwd, baseBranch);
|
|
4057
|
+
if (!base) {
|
|
4058
|
+
return withVerdict(
|
|
4059
|
+
report,
|
|
4060
|
+
"NOT_APPLICABLE" /* NotApplicable */,
|
|
4061
|
+
`base branch ${baseBranch} exists neither on ${BASE_REMOTE_NAME} nor locally`
|
|
4062
|
+
);
|
|
4063
|
+
}
|
|
4064
|
+
const headSha = await runGit(["rev-parse", "--verify", "--quiet", "HEAD^{commit}"], cwd);
|
|
4065
|
+
if (!headSha) return withVerdict(report, "NOT_APPLICABLE" /* NotApplicable */, "the checkout has no commits");
|
|
4066
|
+
const baseName = toDisplayRef(base.ref);
|
|
4067
|
+
report = {
|
|
4068
|
+
...report,
|
|
4069
|
+
baseRef: base.ref,
|
|
4070
|
+
baseSha: base.sha,
|
|
4071
|
+
headSha,
|
|
4072
|
+
branch: await runGit(["symbolic-ref", "--quiet", "--short", "HEAD"], cwd)
|
|
4073
|
+
};
|
|
4074
|
+
if (!await isAncestorAsync(runGit, cwd, base.sha, headSha)) {
|
|
4075
|
+
const behindCount = await runGit(["rev-list", "--count", `${headSha}..${base.sha}`], cwd);
|
|
4076
|
+
report.behindBy = Number(behindCount ?? "0");
|
|
4077
|
+
}
|
|
4078
|
+
const creation = report.branch ? await readBranchCreationAsync(runGit, cwd, report.branch) : null;
|
|
4079
|
+
if (creation) {
|
|
4080
|
+
report.creationSha = creation.sha;
|
|
4081
|
+
const isCreatedOnBase = await isAncestorAsync(runGit, cwd, creation.sha, base.sha);
|
|
4082
|
+
const isCreationStillCarried = !isCreatedOnBase && await isAncestorAsync(runGit, cwd, creation.sha, headSha);
|
|
4083
|
+
if (isCreationStillCarried) {
|
|
4084
|
+
const inheritedRange = `${base.sha}..${creation.sha}`;
|
|
4085
|
+
report.inheritedCommitCount = Number(await runGit(["rev-list", "--count", inheritedRange], cwd) ?? "0");
|
|
4086
|
+
const inheritedLog = await runGit(
|
|
4087
|
+
["log", "--format=%h %s", `-n${MAX_LISTED_INHERITED_COMMITS}`, inheritedRange],
|
|
4088
|
+
cwd
|
|
4089
|
+
);
|
|
4090
|
+
report.inheritedCommits = inheritedLog ? inheritedLog.split("\n") : [];
|
|
4091
|
+
return withVerdict(
|
|
4092
|
+
report,
|
|
4093
|
+
"FOREIGN_BASE" /* ForeignBase */,
|
|
4094
|
+
`${report.branch} was created from ${creation.startPoint} at ${shortSha(creation.sha)}, which ${baseName} does not contain \u2014 it carries ${pluralCommits(report.inheritedCommitCount)} from that branch`
|
|
4095
|
+
);
|
|
4096
|
+
}
|
|
4097
|
+
}
|
|
4098
|
+
if (report.behindBy > 0) {
|
|
4099
|
+
return withVerdict(
|
|
4100
|
+
report,
|
|
4101
|
+
"BEHIND_BASE" /* BehindBase */,
|
|
4102
|
+
`HEAD is ${pluralCommits(report.behindBy)} behind ${baseName} (${shortSha(base.sha)})`
|
|
4103
|
+
);
|
|
4104
|
+
}
|
|
4105
|
+
return withVerdict(report, "FRESH" /* Fresh */, `HEAD contains ${baseName} (${shortSha(base.sha)})`);
|
|
4106
|
+
}
|
|
4107
|
+
|
|
4108
|
+
// packages/mcps/src/mcp/local/services/run-checkout-gate-constants.ts
|
|
4109
|
+
var LOOPBACK_HOSTNAMES = ["localhost", "127.0.0.1", "[::1]", "0.0.0.0"];
|
|
4110
|
+
var LOCALHOST_DOMAIN_SUFFIX = ".localhost";
|
|
4111
|
+
var IPV4_LOOPBACK_PREFIX = "127.";
|
|
4112
|
+
|
|
4113
|
+
// packages/mcps/src/mcp/local/services/run-checkout-gate.ts
|
|
4114
|
+
function isLoopbackUrl(url) {
|
|
4115
|
+
let hostname2;
|
|
4116
|
+
try {
|
|
4117
|
+
hostname2 = new URL(url).hostname.toLowerCase();
|
|
4118
|
+
} catch {
|
|
4119
|
+
return false;
|
|
4120
|
+
}
|
|
4121
|
+
return LOOPBACK_HOSTNAMES.includes(hostname2) || hostname2.startsWith(IPV4_LOOPBACK_PREFIX) || hostname2.endsWith(LOCALHOST_DOMAIN_SUFFIX);
|
|
4122
|
+
}
|
|
4123
|
+
async function findRunCheckoutRefusal(params) {
|
|
4124
|
+
if (!isLoopbackUrl(params.localUrl)) return null;
|
|
4125
|
+
const report = await evaluateCheckoutFreshness({
|
|
4126
|
+
cwd: params.cwd,
|
|
4127
|
+
baseBranch: params.baseBranch,
|
|
4128
|
+
shouldFetchBase: false,
|
|
4129
|
+
runGit: params.runGit ?? runGitCommand
|
|
4130
|
+
});
|
|
4131
|
+
return BLOCKING_FRESHNESS_VERDICTS.has(report.verdict) ? report : null;
|
|
4132
|
+
}
|
|
4133
|
+
|
|
3948
4134
|
// packages/mcps/src/shared/auth.ts
|
|
3949
4135
|
var logger6 = getLogger();
|
|
3950
4136
|
async function startDeviceCodeFlow(config, options) {
|
|
@@ -4278,6 +4464,44 @@ function toolRequiresAuth(toolName) {
|
|
|
4278
4464
|
];
|
|
4279
4465
|
return !noAuthTools.includes(toolName);
|
|
4280
4466
|
}
|
|
4467
|
+
var ZOD_PATTERN_BY_STRING_FORMAT = /* @__PURE__ */ new Map([
|
|
4468
|
+
["uuid", z.toJSONSchema(z.uuid()).pattern],
|
|
4469
|
+
["email", z.toJSONSchema(z.email()).pattern]
|
|
4470
|
+
]);
|
|
4471
|
+
|
|
4472
|
+
// packages/mcps/src/shared/tool-input-schema/tool-input-schema.ts
|
|
4473
|
+
function buildToolInputJsonSchema(inputSchema) {
|
|
4474
|
+
const { $schema: _dialect, ...schemaBody } = z.toJSONSchema(inputSchema);
|
|
4475
|
+
return compactSchemaNode(schemaBody);
|
|
4476
|
+
}
|
|
4477
|
+
function compactSchemaNode(node) {
|
|
4478
|
+
if (Array.isArray(node)) {
|
|
4479
|
+
return node.map(compactSchemaNode);
|
|
4480
|
+
}
|
|
4481
|
+
if (node === null || typeof node !== "object") {
|
|
4482
|
+
return node;
|
|
4483
|
+
}
|
|
4484
|
+
const schemaNode = node;
|
|
4485
|
+
const compactedNode = {};
|
|
4486
|
+
for (const [keyword, value] of Object.entries(schemaNode)) {
|
|
4487
|
+
if (!isRestatedKeyword(schemaNode, keyword, value)) {
|
|
4488
|
+
compactedNode[keyword] = compactSchemaNode(value);
|
|
4489
|
+
}
|
|
4490
|
+
}
|
|
4491
|
+
return compactedNode;
|
|
4492
|
+
}
|
|
4493
|
+
function isRestatedKeyword(schemaNode, keyword, value) {
|
|
4494
|
+
switch (keyword) {
|
|
4495
|
+
case "pattern":
|
|
4496
|
+
return typeof schemaNode.format === "string" && ZOD_PATTERN_BY_STRING_FORMAT.get(schemaNode.format) === value;
|
|
4497
|
+
case "maximum":
|
|
4498
|
+
return value === Number.MAX_SAFE_INTEGER;
|
|
4499
|
+
case "minimum":
|
|
4500
|
+
return value === Number.MIN_SAFE_INTEGER;
|
|
4501
|
+
default:
|
|
4502
|
+
return false;
|
|
4503
|
+
}
|
|
4504
|
+
}
|
|
4281
4505
|
|
|
4282
4506
|
// packages/mcps/src/mcp/index.ts
|
|
4283
4507
|
var mcp_exports = {};
|
|
@@ -7648,7 +7872,9 @@ var ExecuteTestGenerationInputSchema = z.object({
|
|
|
7648
7872
|
/** Local URL to test against. */
|
|
7649
7873
|
localUrl: z.string().url().describe("Local URL to test against (e.g., http://localhost:3000)"),
|
|
7650
7874
|
/** Absolute path identifying the caller's worktree. Drives the cross-worktree single-flight lock — same path = parallel allowed (intra-change), different path = waits its turn. Required: ambiguity here causes the lock to mis-key, splitting one logical change into two competing holders. */
|
|
7651
|
-
cwd: z.string().min(1).describe("Absolute path of the caller's worktree
|
|
7875
|
+
cwd: z.string().min(1).describe("Absolute path of the caller's worktree; keys the single-flight lock. A loopback run is refused unless it holds its base's latest commit."),
|
|
7876
|
+
/** Base of a stacked change; the run is refused unless `cwd` contains its latest commit. */
|
|
7877
|
+
baseBranch: z.string().min(1).optional().describe("Base branch if not origin's default (e.g. a stacked parent)."),
|
|
7652
7878
|
/** Optional timeout. */
|
|
7653
7879
|
timeoutMs: z.number().int().positive().optional().describe("Timeout in milliseconds (default: 300000 = 5 min)"),
|
|
7654
7880
|
/** Show the electron-app UI during execution. Default: visible window. Pass false to run headless. */
|
|
@@ -7674,13 +7900,15 @@ var ExecuteReplayInputSchema = z.object({
|
|
|
7674
7900
|
/** Local URL to test against. */
|
|
7675
7901
|
localUrl: z.string().url().describe("Local URL to test against (e.g., http://localhost:3000)"),
|
|
7676
7902
|
/** Absolute path identifying the caller's worktree. Drives the cross-worktree single-flight lock — same path = parallel allowed (intra-change), different path = waits its turn. Required: ambiguity here causes the lock to mis-key, splitting one logical change into two competing holders. */
|
|
7677
|
-
cwd: z.string().min(1).describe("Absolute path of the caller's worktree
|
|
7903
|
+
cwd: z.string().min(1).describe("Absolute path of the caller's worktree; keys the single-flight lock. A loopback run is refused unless it holds its base's latest commit."),
|
|
7904
|
+
/** Base of a stacked change; the run is refused unless `cwd` contains its latest commit. */
|
|
7905
|
+
baseBranch: z.string().min(1).optional().describe("Base branch if not origin's default (e.g. a stacked parent)."),
|
|
7678
7906
|
/** Optional timeout. */
|
|
7679
7907
|
timeoutMs: z.number().int().positive().optional().describe("Timeout in milliseconds (default: 180000 = 3 min)"),
|
|
7680
7908
|
/** Show the electron-app UI during execution. Default: visible window. Pass false to run headless. */
|
|
7681
7909
|
showUi: z.boolean().optional().describe("Show the electron-app UI during replay. Defaults to visible; pass false to run headless."),
|
|
7682
7910
|
/** Whether the replay starts from an emptied browser session, copied from the recording. */
|
|
7683
|
-
freshSession: z.boolean().optional().describe("Copy
|
|
7911
|
+
freshSession: z.boolean().optional().describe("Copy actionParams.freshSession from muggle-remote-action-script-get so the replay starts as recorded: true clears all session storage (cookies, localStorage) first. Absent there (an older recording): true only for clean-state tests (registration, login, cookie consent). Default: false."),
|
|
7684
7912
|
/** Mutation parameters passed to the LLM step predictor — a string[] where each element is an instruction describing what varies this run. Supports plain-English instructions (e.g. "The post content should be 'Hello world'") and local file paths for uploads (e.g. "Attach the image at C:\\Users\\user\\photo.jpg"). Matches the electron-app's string[] mutation file format. When provided, the electron app uses LLM-driven step prediction instead of deterministic replay. */
|
|
7685
7913
|
mutations: z.array(z.string()).optional().describe(`Mutation parameters: string[] where each element is a plain-English instruction or a local file path (e.g. ["The post content should be 'Hello'", "Attach the image at C:\\\\Users\\\\user\\\\photo.jpg"]).`),
|
|
7686
7914
|
/** Pinned account the script was recorded with, copied from the recording. */
|
|
@@ -8071,6 +8299,26 @@ function clearLastHost(cwd) {
|
|
|
8071
8299
|
clearCwdEntry(LAST_HOST_CACHE, cwd);
|
|
8072
8300
|
}
|
|
8073
8301
|
|
|
8302
|
+
// packages/mcps/src/mcp/tools/local/run-checkout-refusal.ts
|
|
8303
|
+
function formatRunCheckoutRefusal(report, cwd) {
|
|
8304
|
+
const baseName = report.baseRef ? toDisplayRef(report.baseRef) : "";
|
|
8305
|
+
const remedy = report.verdict === "FOREIGN_BASE" /* ForeignBase */ ? `Recreate the branch from \`${baseName}\` and carry over only this change's own commits \u2014 or, when the change deliberately stacks on that branch, pass it as \`baseBranch\`.` : `Rebase this checkout onto \`${baseName}\`.`;
|
|
8306
|
+
const inherited = report.inheritedCommits.length > 0 ? ["", "Inherited commits:", ...report.inheritedCommits.map((commit) => `- ${commit}`)] : [];
|
|
8307
|
+
return [
|
|
8308
|
+
`## Run refused \u2014 checkout is not on the latest ${baseName || "base"}`,
|
|
8309
|
+
"",
|
|
8310
|
+
`**Verdict:** ${report.verdict}`,
|
|
8311
|
+
`**Checkout:** ${report.checkoutRoot ?? cwd}`,
|
|
8312
|
+
`**Why:** ${report.reason}`,
|
|
8313
|
+
...inherited,
|
|
8314
|
+
"",
|
|
8315
|
+
"Nothing was launched. To clear it:",
|
|
8316
|
+
`1. \`muggle checkout-freshness --cwd "${cwd}"\` \u2014 fetches the base and re-checks.`,
|
|
8317
|
+
`2. ${remedy}`,
|
|
8318
|
+
"3. Restart the dev server from this checkout, then run again."
|
|
8319
|
+
].join("\n");
|
|
8320
|
+
}
|
|
8321
|
+
|
|
8074
8322
|
// packages/mcps/src/mcp/tools/local/tool-registry.ts
|
|
8075
8323
|
function createChildLogger2(correlationId) {
|
|
8076
8324
|
const logger7 = getLogger();
|
|
@@ -8326,6 +8574,15 @@ var executeTestGenerationTool = {
|
|
|
8326
8574
|
logger7.info("Executing muggle-local-execute-test-generation");
|
|
8327
8575
|
const input = ExecuteTestGenerationInputSchema.parse(ctx.input);
|
|
8328
8576
|
const showUi = input.showUi !== false;
|
|
8577
|
+
const checkoutRefusal = await findRunCheckoutRefusal({
|
|
8578
|
+
cwd: input.cwd,
|
|
8579
|
+
localUrl: input.localUrl,
|
|
8580
|
+
baseBranch: input.baseBranch
|
|
8581
|
+
});
|
|
8582
|
+
if (checkoutRefusal) {
|
|
8583
|
+
logger7.warn("Test generation refused: stale checkout", { verdict: checkoutRefusal.verdict, cwd: input.cwd });
|
|
8584
|
+
return { content: formatRunCheckoutRefusal(checkoutRefusal, input.cwd), isError: true, data: checkoutRefusal };
|
|
8585
|
+
}
|
|
8329
8586
|
try {
|
|
8330
8587
|
const generationRun = await executeTestGeneration({
|
|
8331
8588
|
testCase: input.testCase,
|
|
@@ -8369,6 +8626,15 @@ var executeReplayTool = {
|
|
|
8369
8626
|
logger7.info("Executing muggle-local-execute-replay");
|
|
8370
8627
|
const input = ExecuteReplayInputSchema.parse(ctx.input);
|
|
8371
8628
|
const showUi = input.showUi !== false;
|
|
8629
|
+
const checkoutRefusal = await findRunCheckoutRefusal({
|
|
8630
|
+
cwd: input.cwd,
|
|
8631
|
+
localUrl: input.localUrl,
|
|
8632
|
+
baseBranch: input.baseBranch
|
|
8633
|
+
});
|
|
8634
|
+
if (checkoutRefusal) {
|
|
8635
|
+
logger7.warn("Test replay refused: stale checkout", { verdict: checkoutRefusal.verdict, cwd: input.cwd });
|
|
8636
|
+
return { content: formatRunCheckoutRefusal(checkoutRefusal, input.cwd), isError: true, data: checkoutRefusal };
|
|
8637
|
+
}
|
|
8372
8638
|
try {
|
|
8373
8639
|
const replayRun = await executeReplay({
|
|
8374
8640
|
testScript: input.testScript,
|
|
@@ -8852,11 +9118,13 @@ __export(local_exports2, {
|
|
|
8852
9118
|
executeReplay: () => executeReplay,
|
|
8853
9119
|
executeTestGeneration: () => executeTestGeneration,
|
|
8854
9120
|
executeTool: () => executeTool,
|
|
9121
|
+
findRunCheckoutRefusal: () => findRunCheckoutRefusal,
|
|
8855
9122
|
getAuthService: () => getAuthService,
|
|
8856
9123
|
getLocalQaTools: () => getLocalQaTools,
|
|
8857
9124
|
getRunResultStorageService: () => getRunResultStorageService,
|
|
8858
9125
|
getStorageService: () => getStorageService,
|
|
8859
9126
|
getTool: () => getTool,
|
|
9127
|
+
isLoopbackUrl: () => isLoopbackUrl,
|
|
8860
9128
|
listActiveExecutions: () => listActiveExecutions,
|
|
8861
9129
|
readLocalExecutionLockState: () => readLocalExecutionLockState,
|
|
8862
9130
|
resetAuthService: () => resetAuthService,
|
|
@@ -9171,4 +9439,4 @@ function applyOnboardingAnswers(answers, dataDirOverride2, now = /* @__PURE__ */
|
|
|
9171
9439
|
return { isCompleted: true, preferences: prefs };
|
|
9172
9440
|
}
|
|
9173
9441
|
|
|
9174
|
-
export { ACTION_SCRIPT_FILE_NAME, DEFAULT_PREFERENCES, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, EventName, HTML_VIEW_OFFER_LINE, 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, ServiceName, Surface, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, __export, __require, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildOnboardingPlan, calculateFileChecksum, completeOnboarding, createApiKeyWithToken, createChildLogger, deleteApiKeyData, deleteCredentials, e2e_exports2 as e2e_exports, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDisclosureCopy, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, hasShownDisclosure, initTelemetry, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, loadApiKeyData, loadCredentials, local_exports2 as local_exports, markDisclosureShown, markOnboardingCompleted, mcp_exports, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, readPreferencesMetadata, readRunView, reconcileProjectPreferences, recordOnboardingSkip, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, saveApiKey, saveApiKeyData, saveCredentials, src_exports, startDeviceCodeFlow, toolRequiresAuth, track, validatePreference, verifyFileChecksum, writePreferences2 as writePreferences, writePreferencesWithMetadata, writeRunViewHtml };
|
|
9442
|
+
export { ACTION_SCRIPT_FILE_NAME, BASE_REMOTE_NAME, BLOCKING_FRESHNESS_VERDICTS, BRANCH_CREATION_REFLOG_PREFIX, CheckoutFreshnessVerdict, DEFAULT_PREFERENCES, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, EventName, HTML_VIEW_OFFER_LINE, 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, ServiceName, Surface, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, __export, __require, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildOnboardingPlan, buildToolInputJsonSchema, calculateFileChecksum, completeOnboarding, createApiKeyWithToken, createChildLogger, deleteApiKeyData, deleteCredentials, e2e_exports2 as e2e_exports, evaluateCheckoutFreshness, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDisclosureCopy, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, hasShownDisclosure, initTelemetry, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, loadApiKeyData, loadCredentials, local_exports2 as local_exports, markDisclosureShown, markOnboardingCompleted, mcp_exports, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, readPreferencesMetadata, readRunView, reconcileProjectPreferences, recordOnboardingSkip, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, runGitCommand, saveApiKey, saveApiKeyData, saveCredentials, src_exports, startDeviceCodeFlow, toDisplayRef, toolRequiresAuth, track, validatePreference, verifyFileChecksum, writePreferences2 as writePreferences, writePreferencesWithMetadata, writeRunViewHtml };
|
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-53MCWNVE.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-C6OEDLIP.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
3
|
"description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.25.0-staging.185",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|
|
7
7
|
"email": "support@muggle-ai.com"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "muggle",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.25.0-staging.185",
|
|
4
4
|
"description": "Real-browser E2E acceptance for your coding agent: test the flows you changed and open the PR with screenshots. Built for flows other tools can't reach: managed test identities with live inboxes (magic links, email OTP and 2FA, verification mail, password resets), an encrypted secret store for login and test credentials, and a test graph that runs prerequisite flows first. Plain-English tests become replayable scripts on localhost or preview URLs.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|