@muggleai/works 5.26.0-staging.208 → 5.26.0-staging.210

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/{chunk-HOKMW4AL.js → chunk-DLNSKLZD.js} +109 -6
  3. package/dist/{chunk-ZR7KLGHQ.js → chunk-H62MFQKC.js} +597 -26
  4. package/dist/cli.js +2 -2
  5. package/dist/index.js +2 -2
  6. package/dist/plugin/.claude-plugin/plugin.json +1 -1
  7. package/dist/plugin/.codex-mcp.json +1 -1
  8. package/dist/plugin/.codex-plugin/plugin.json +1 -1
  9. package/dist/plugin/.cursor-plugin/plugin.json +1 -1
  10. package/dist/plugin/.mcp.json +1 -1
  11. package/dist/plugin/agents/acceptance-tester.md +18 -2
  12. package/dist/plugin/agents/test-prepare-runner.md +1 -1
  13. package/dist/plugin/hooks/README.md +5 -4
  14. package/dist/plugin/hooks/codex-hooks.json +2 -2
  15. package/dist/plugin/hooks/hooks.json +2 -2
  16. package/dist/plugin/scripts/guardrail-record-delegation.sh +25 -0
  17. package/dist/plugin/scripts/guardrail-walkthrough-gate.sh +6 -6
  18. package/dist/plugin/scripts/guardrails.mjs +161 -32
  19. package/dist/plugin/skills/_shared/dev-loop/run.md +2 -0
  20. package/dist/plugin/skills/do/background-e2e.md +89 -0
  21. package/dist/plugin/skills/do/e2e-acceptance.md +4 -0
  22. package/dist/plugin/skills/do/e2e-repair.md +1 -1
  23. package/dist/plugin/skills/do/open-prs/forward.md +3 -3
  24. package/dist/plugin/skills/do/pre-flight.md +4 -3
  25. package/dist/plugin/skills/do/wave-e2e.md +3 -3
  26. package/dist/plugin/skills/do/wave-or-stream.md +51 -0
  27. package/dist/plugin/skills/muggle-do/SKILL.md +6 -2
  28. package/dist/plugin/skills/muggle-test-prepare/SKILL.md +6 -3
  29. package/dist/plugin/skills/muggle-test-prepare/steps/check-running.md +1 -0
  30. package/dist/plugin/skills/muggle-test-prepare/steps/claim-stack.md +43 -0
  31. package/dist/plugin/skills/muggle-test-prepare/steps/replay-or-learn.md +1 -1
  32. package/dist/release-manifest.json +3 -3
  33. package/dist/src-A45WRSIF.js +1 -0
  34. package/package.json +1 -1
  35. package/plugin/.claude-plugin/plugin.json +1 -1
  36. package/plugin/.codex-mcp.json +1 -1
  37. package/plugin/.codex-plugin/plugin.json +1 -1
  38. package/plugin/.cursor-plugin/plugin.json +1 -1
  39. package/plugin/.mcp.json +1 -1
  40. package/plugin/agents/acceptance-tester.md +18 -2
  41. package/plugin/agents/test-prepare-runner.md +1 -1
  42. package/plugin/hooks/README.md +5 -4
  43. package/plugin/hooks/codex-hooks.json +2 -2
  44. package/plugin/hooks/hooks.json +2 -2
  45. package/plugin/scripts/guardrail-record-delegation.sh +25 -0
  46. package/plugin/scripts/guardrail-walkthrough-gate.sh +6 -6
  47. package/plugin/scripts/guardrails.mjs +161 -32
  48. package/plugin/skills/_shared/dev-loop/run.md +2 -0
  49. package/plugin/skills/do/background-e2e.md +89 -0
  50. package/plugin/skills/do/e2e-acceptance.md +4 -0
  51. package/plugin/skills/do/e2e-repair.md +1 -1
  52. package/plugin/skills/do/open-prs/forward.md +3 -3
  53. package/plugin/skills/do/pre-flight.md +4 -3
  54. package/plugin/skills/do/wave-e2e.md +3 -3
  55. package/plugin/skills/do/wave-or-stream.md +51 -0
  56. package/plugin/skills/muggle-do/SKILL.md +6 -2
  57. package/plugin/skills/muggle-test-prepare/SKILL.md +6 -3
  58. package/plugin/skills/muggle-test-prepare/steps/check-running.md +1 -0
  59. package/plugin/skills/muggle-test-prepare/steps/claim-stack.md +43 -0
  60. package/plugin/skills/muggle-test-prepare/steps/replay-or-learn.md +1 -1
  61. package/dist/src-J2TJ76XG.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.26.0-staging.208"
12
+ "version": "5.26.0-staging.210"
13
13
  }
14
14
  ]
15
15
  }
@@ -1,4 +1,4 @@
1
- import { __export, getLogger, 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, buildElectronAppChecksumsUrl, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, resolvePreferences, OnboardingBlanketChoice, PreferenceKey, getDataDir } from './chunk-ZR7KLGHQ.js';
1
+ import { __export, getLogger, 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, buildElectronAppChecksumsUrl, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, claimServiceStack, BUSY_EXIT_CODE, checkServiceStack, releaseServiceStack, readServiceStackStatus, resolvePreferences, OnboardingBlanketChoice, PreferenceKey, getDataDir } from './chunk-H62MFQKC.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';
@@ -1068,7 +1068,7 @@ async function resolveGsScreenshotUrls(report, opts) {
1068
1068
  if (gsUrls.length === 0) {
1069
1069
  return report;
1070
1070
  }
1071
- const mcps = await import('./src-J2TJ76XG.js');
1071
+ const mcps = await import('./src-A45WRSIF.js');
1072
1072
  const credentials = await mcps.getCallerCredentialsAsync();
1073
1073
  if (!credentials.bearerToken && !credentials.apiKey) {
1074
1074
  stderrWrite(
@@ -3684,6 +3684,99 @@ The archive may be corrupted or in an unexpected format.`
3684
3684
  process.exit(1);
3685
3685
  }
3686
3686
  }
3687
+
3688
+ // src/cli/service-stack.ts
3689
+ var NEED_PATTERN = /^(\d+)=(.+?)(?:@([0-9a-f]{7,40}))?$/i;
3690
+ function parseStackNeed(value) {
3691
+ const match = NEED_PATTERN.exec(value.trim());
3692
+ if (!match) throw new Error(`--need "${value}" is not <port>=<run-dir>[@<sha>]`);
3693
+ return { port: Number(match[1]), runDir: match[2], headSha: match[3] };
3694
+ }
3695
+ function renderStackClaimSummary(report) {
3696
+ if (report.verdict === "GRANTED" /* Granted */) {
3697
+ const lines2 = [`${report.verdict}: the stack is this checkout's to use (${report.cwd})`];
3698
+ for (const port of report.plan) {
3699
+ const current = port.current ? ` \u2014 now ${port.current.dir} @ ${shortSha(port.current.headSha)} (PID ${port.current.pid})` : "";
3700
+ lines2.push(`${port.action} ${port.port}: ${port.runDir} @ ${shortSha(port.headSha)}${current}`);
3701
+ }
3702
+ for (const peer of report.sharedWith) lines2.push(`shared with: ${peer}`);
3703
+ return lines2.join("\n");
3704
+ }
3705
+ const lines = [`${report.verdict}: place ${report.position} of ${report.queueLength} in line`];
3706
+ for (const blocker of report.blockers) {
3707
+ const who = blocker.blockingLabel ? `${blocker.blockingLabel} (${blocker.blockingCwd})` : blocker.blockingCwd;
3708
+ const how = blocker.isQueuedAhead ? "is ahead in line for" : "holds";
3709
+ const heldFor = blocker.isQueuedAhead ? "" : ` (for ${seconds(blocker.heldForMs ?? 0)})`;
3710
+ lines.push(`port ${blocker.port}: ${who} ${how} ${blocker.needsRunDir} @ ${shortSha(blocker.needsHeadSha)}${heldFor}`);
3711
+ }
3712
+ lines.push(`retry in ~${seconds(report.retryAfterMs ?? 0)}; your place is kept while you keep asking`);
3713
+ return lines.join("\n");
3714
+ }
3715
+ function renderStackCheckSummary(report) {
3716
+ const lines = [`${report.verdict}: ${report.reason}`];
3717
+ for (const mismatch of report.mismatches) {
3718
+ const actual = mismatch.actual ? `${mismatch.actual.dir} @ ${shortSha(mismatch.actual.headSha)}` : "nothing tracked";
3719
+ lines.push(`port ${mismatch.need.port}: claimed ${mismatch.need.runDir} @ ${shortSha(mismatch.need.headSha)}, serving ${actual}`);
3720
+ }
3721
+ return lines.join("\n");
3722
+ }
3723
+ function renderStackStatusSummary(report) {
3724
+ const now = Date.now();
3725
+ const lines = [`generation ${report.generation}`];
3726
+ if (report.leases.length === 0) lines.push("leases: none");
3727
+ for (const lease of report.leases) {
3728
+ const ports = lease.needs.map((need) => `${need.port}=${need.runDir}@${shortSha(need.headSha)}`).join(", ");
3729
+ lines.push(`lease: ${lease.label ?? lease.cwd} \u2014 ${ports} (held ${seconds(now - lease.grantedAt)}, renewed ${seconds(now - lease.lastSeenAt)} ago)`);
3730
+ }
3731
+ report.queue.forEach((ticket, index) => {
3732
+ const ports = ticket.needs.map((need) => need.port).join(", ");
3733
+ lines.push(`waiting ${index + 1}: ${ticket.label ?? ticket.cwd} \u2014 port ${ports} (asked ${seconds(now - ticket.lastSeenAt)} ago)`);
3734
+ });
3735
+ for (const service of report.services) {
3736
+ lines.push(`service: ${service.port} ${service.name} \u2014 ${service.dir} @ ${shortSha(service.headSha)} (PID ${service.pid})`);
3737
+ }
3738
+ return lines.join("\n");
3739
+ }
3740
+ async function stackClaimCommand(flags) {
3741
+ const needs = flags.need.map((value) => parseStackNeed(value));
3742
+ const report = await claimServiceStack({
3743
+ cwd: flags.cwd ?? process.cwd(),
3744
+ label: flags.label,
3745
+ needs,
3746
+ waitMs: flags.wait === void 0 ? void 0 : Number(flags.wait) * 1e3
3747
+ });
3748
+ writeReport({ json: flags.json, report, summary: renderStackClaimSummary(report) });
3749
+ if (report.verdict === "BUSY" /* Busy */) process.exitCode = BUSY_EXIT_CODE;
3750
+ }
3751
+ async function stackCheckCommand(flags) {
3752
+ const report = await checkServiceStack({
3753
+ cwd: flags.cwd ?? process.cwd(),
3754
+ port: flags.port === void 0 ? void 0 : Number(flags.port),
3755
+ shouldRenew: true
3756
+ });
3757
+ writeReport({ json: flags.json, report, summary: renderStackCheckSummary(report) });
3758
+ if (report.verdict === "STALE" /* Stale */ || report.verdict === "PEER_LEASE" /* PeerLease */) process.exitCode = 1;
3759
+ }
3760
+ async function stackReleaseCommand(flags) {
3761
+ const isReleased = await releaseServiceStack({ cwd: flags.cwd ?? process.cwd() });
3762
+ const summary = isReleased ? "released" : "nothing to release";
3763
+ writeReport({ json: flags.json, report: { released: isReleased }, summary });
3764
+ }
3765
+ async function stackStatusCommand(flags) {
3766
+ const report = await readServiceStackStatus();
3767
+ writeReport({ json: flags.json, report, summary: renderStackStatusSummary(report) });
3768
+ }
3769
+ function writeReport(params) {
3770
+ const output = params.json ? JSON.stringify(params.report, null, 2) : params.summary;
3771
+ process.stdout.write(`${output}
3772
+ `);
3773
+ }
3774
+ function shortSha(sha) {
3775
+ return sha ? sha.slice(0, 7) : "unknown";
3776
+ }
3777
+ function seconds(ms) {
3778
+ return `${Math.max(0, Math.round(ms / 1e3))}s`;
3779
+ }
3687
3780
  var logger7 = getLogger();
3688
3781
  var GITHUB_RELEASES_API = "https://api.github.com/repos/multiplex-ai/muggle-ai-works/releases?per_page=100";
3689
3782
  var INSTALL_METADATA_FILE_NAME2 = ".install-metadata.json";
@@ -4027,7 +4120,7 @@ function formatDuration(durationMs) {
4027
4120
  function shortSessionId(sessionId) {
4028
4121
  return sessionId.slice(0, 8);
4029
4122
  }
4030
- function shortSha(sha) {
4123
+ function shortSha2(sha) {
4031
4124
  return sha ? sha.slice(0, 8) : "?";
4032
4125
  }
4033
4126
 
@@ -4366,7 +4459,7 @@ function watcherFinding(assessment, subject) {
4366
4459
  }
4367
4460
  function prStateFindings(assessment, live, subject) {
4368
4461
  const prFindings = [];
4369
- const head = shortSha(live.headSha);
4462
+ const head = shortSha2(live.headSha);
4370
4463
  if (live.ciRollup === "FAILURE" /* Failure */ || live.ciRollup === "ERROR" /* Error */) {
4371
4464
  prFindings.push(finding(
4372
4465
  "CI_FAILING" /* CiFailing */,
@@ -4791,8 +4884,8 @@ function readWindowsProcessTable(runCommand, nowMs) {
4791
4884
  function parsePsElapsedSeconds(elapsed) {
4792
4885
  const parts = elapsed.match(/^(?:(\d+)-)?(?:(\d+):)?(\d+):(\d+)$/);
4793
4886
  if (!parts) return void 0;
4794
- const [, days, hours, minutes, seconds] = parts;
4795
- return Number(days ?? 0) * 86400 + Number(hours ?? 0) * 3600 + Number(minutes) * 60 + Number(seconds);
4887
+ const [, days, hours, minutes, seconds2] = parts;
4888
+ return Number(days ?? 0) * 86400 + Number(hours ?? 0) * 3600 + Number(minutes) * 60 + Number(seconds2);
4796
4889
  }
4797
4890
  function executableNameOf(commandLine) {
4798
4891
  const firstToken = commandLine.trim().split(/\s+/)[0] ?? "";
@@ -5527,6 +5620,16 @@ function createProgram() {
5527
5620
  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);
5528
5621
  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);
5529
5622
  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);
5623
+ const stack = program.command("stack").description("Share one set of local services between agents in different checkouts");
5624
+ stack.command("claim").description("Claim the ports this checkout's E2E run needs; answers granted or busy at once").option("--cwd <dir>", "Directory inside the claiming checkout (default: the current directory)").option(
5625
+ "--need <port=run-dir[@sha]>",
5626
+ "A port and the directory (and commit) it must serve; repeat per port",
5627
+ (value, previous) => [...previous, value],
5628
+ []
5629
+ ).option("--label <name>", "Name shown to peers waiting on this checkout").option("--wait <seconds>", "Keep re-asking this long while busy").option("--json", "Print the full report as JSON").action(stackClaimCommand);
5630
+ stack.command("check").description("Check that the stack still serves what this checkout claimed, renewing the lease").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);
5631
+ 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);
5632
+ stack.command("status").description("Show every lease, the line, and the services prepare tracks").option("--json", "Print the full report as JSON").action(stackStatusCommand);
5530
5633
  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);
5531
5634
  const watch = program.command("watch").description("Standing watch over Claude/Codex sessions, their processes, and PR watchers");
5532
5635
  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("--json", "Print the full snapshot as JSON").action(watchTickCommand);