@muggleai/works 5.26.0-staging.202 → 5.26.0-staging.203

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.
@@ -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.202"
12
+ "version": "5.26.0-staging.203"
13
13
  }
14
14
  ]
15
15
  }
package/README.md CHANGED
@@ -480,7 +480,7 @@ Want it hosted, with nothing to configure? [Muggle Test](https://www.muggletest.
480
480
  ```bash
481
481
  pnpm install # This repo is pnpm-only
482
482
  pnpm run build # tsup + plugin artifact
483
- pnpm test # Test suite
483
+ pnpm test # Tests impacted since origin/master, on 25% of cores (full suite in CI; MUGGLE_VITEST_FULL=1 forces it locally)
484
484
  pnpm run lint # Lint (auto-fix)
485
485
  pnpm run typecheck # Type check
486
486
  pnpm run dev # Watch mode
@@ -2442,6 +2442,22 @@ function readClaudeSessions(runCommand, registryDir) {
2442
2442
  }
2443
2443
  return sessions;
2444
2444
  }
2445
+ function findClaudeSessionCwd(projectsDir, sessionId) {
2446
+ let projectDirNames;
2447
+ try {
2448
+ projectDirNames = readdirSync(projectsDir);
2449
+ } catch {
2450
+ return void 0;
2451
+ }
2452
+ const transcriptFileName = `${sessionId}.jsonl`;
2453
+ for (const projectDirName of projectDirNames) {
2454
+ const transcriptPath = join(projectsDir, projectDirName, transcriptFileName);
2455
+ if (!existsSync(transcriptPath)) continue;
2456
+ const head = readFileHead(transcriptPath);
2457
+ return head === void 0 ? void 0 : cwdFromSessionHead(head);
2458
+ }
2459
+ return void 0;
2460
+ }
2445
2461
  var ROLLOUT_SESSION_ID = /([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.jsonl$/i;
2446
2462
  function sortedChildDirsDescending(dir) {
2447
2463
  try {
@@ -2498,12 +2514,12 @@ var defaultCommandRunner = (executable, args, options) => {
2498
2514
  cwd: options?.cwd,
2499
2515
  encoding: "utf-8",
2500
2516
  maxBuffer: WATCH_COMMAND_MAX_BUFFER_BYTES,
2501
- stdio: ["ignore", "pipe", "ignore"],
2517
+ stdio: ["ignore", "pipe", options?.isStderrCaptured ? "pipe" : "ignore"],
2502
2518
  timeout: options?.timeoutMs ?? WATCH_COMMAND_TIMEOUT_MS,
2503
2519
  windowsHide: true
2504
2520
  });
2505
2521
  if (spawned.error || spawned.status === null) return null;
2506
- return { exitCode: spawned.status, stdout: spawned.stdout };
2522
+ return { exitCode: spawned.status, stdout: options?.isStderrCaptured ? `${spawned.stdout}${spawned.stderr}` : spawned.stdout };
2507
2523
  };
2508
2524
 
2509
2525
  // src/guardrails/constants.ts
@@ -3089,24 +3105,6 @@ function readPosixProcessTable(runCommand) {
3089
3105
  function readProcessTable(platform4, runCommand, nowMs) {
3090
3106
  return platform4 === "win32" ? readWindowsProcessTable(runCommand, nowMs) : readPosixProcessTable(runCommand);
3091
3107
  }
3092
- function findClaudeSessionCwd(projectsDir, sessionId) {
3093
- let projectDirNames;
3094
- try {
3095
- projectDirNames = readdirSync(projectsDir);
3096
- } catch {
3097
- return void 0;
3098
- }
3099
- const transcriptFileName = `${sessionId}.jsonl`;
3100
- for (const projectDirName of projectDirNames) {
3101
- const transcriptPath = join(projectsDir, projectDirName, transcriptFileName);
3102
- if (!existsSync(transcriptPath)) continue;
3103
- const head = readFileHead(transcriptPath);
3104
- return head === void 0 ? void 0 : cwdFromSessionHead(head);
3105
- }
3106
- return void 0;
3107
- }
3108
-
3109
- // src/watch/recovery.ts
3110
3108
  function isRecoverable(assessment) {
3111
3109
  return assessment.isRegistered && assessment.watcher === "dead" /* Dead */ && assessment.live?.state === "OPEN" /* Open */ && assessment.ownerSessionId !== void 0 && assessment.isOwnerSessionActive === false;
3112
3110
  }
@@ -3264,7 +3262,7 @@ function runWatchInstaller(scriptPath, installerArgs, runCommand) {
3264
3262
  return runCommand(
3265
3263
  "powershell.exe",
3266
3264
  ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", scriptPath, ...installerArgs],
3267
- { timeoutMs: WATCH_INSTALLER_TIMEOUT_MS }
3265
+ { timeoutMs: WATCH_INSTALLER_TIMEOUT_MS, isStderrCaptured: true }
3268
3266
  );
3269
3267
  }
3270
3268
 
@@ -3677,7 +3675,9 @@ function reloadRecordFor(state, targetAtMs) {
3677
3675
  return state.pendingReload?.changedAtMs === targetAtMs ? { ...fresh, ...state.pendingReload } : fresh;
3678
3676
  }
3679
3677
  function runReloadPass(record, claudeSessions, watchOwnerSessionIds, deps, at) {
3680
- const decisions = planReloadFanOut(claudeSessions, record, watchOwnerSessionIds);
3678
+ const decisions = planReloadFanOut(claudeSessions, record, watchOwnerSessionIds).map(
3679
+ (decision) => decision.action === "resume-reconcile" /* ResumeReconcile */ ? { ...decision, cwd: findClaudeSessionCwd(deps.paths.claudeProjectsDir, decision.sessionId) ?? decision.cwd } : decision
3680
+ );
3681
3681
  const report = executeReloadFanOut(decisions, deps.runCommand, (cwd) => canRestartSessionIn(cwd, deps.runCommand));
3682
3682
  return { report, pendingReload: advancePendingReload(record, report), events: reloadEvents(report, at) };
3683
3683
  }
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from './chunk-RT2SICT3.js';
2
+ import { runCli } from './chunk-7NGYZIG7.js';
3
3
  import './chunk-3XUP6R6P.js';
4
4
 
5
5
  // src/cli/main.ts
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-RT2SICT3.js';
1
+ export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-7NGYZIG7.js';
2
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-3XUP6R6P.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.26.0-staging.202",
4
+ "version": "5.26.0-staging.203",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.26.0-staging.202",
7
+ "@muggleai/works@5.26.0-staging.203",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.26.0-staging.202",
3
+ "version": "5.26.0-staging.203",
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",
@@ -2,7 +2,7 @@
2
2
  "name": "muggle",
3
3
  "displayName": "Muggle AI",
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
- "version": "5.26.0-staging.202",
5
+ "version": "5.26.0-staging.203",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.26.0-staging.202",
7
+ "@muggleai/works@5.26.0-staging.203",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "release": "5.18.0",
3
- "buildId": "run-202-1",
4
- "commitSha": "094907e8614c1aa87558b6509c363f1ce017a452",
5
- "buildTime": "2026-10-25T22:39:43Z",
3
+ "buildId": "run-203-1",
4
+ "commitSha": "9a6d967a9926a036eb0d0bdf7ab007a3c584b2ae",
5
+ "buildTime": "2026-10-26T05:14:44Z",
6
6
  "serviceName": "muggle-ai-works-mcp"
7
7
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@muggleai/works",
3
3
  "mcpName": "io.github.multiplex-ai/muggle",
4
- "version": "5.26.0-staging.202",
4
+ "version": "5.26.0-staging.203",
5
5
  "description": "13 years of Microsoft hyperscale engineering, packaged as a harness for your AI coding agent.",
6
6
  "type": "module",
7
7
  "main": "dist/index.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.26.0-staging.202",
4
+ "version": "5.26.0-staging.203",
5
5
  "author": {
6
6
  "name": "Muggle AI",
7
7
  "email": "support@muggle-ai.com"
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.26.0-staging.202",
7
+ "@muggleai/works@5.26.0-staging.203",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.26.0-staging.202",
3
+ "version": "5.26.0-staging.203",
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",
@@ -2,7 +2,7 @@
2
2
  "name": "muggle",
3
3
  "displayName": "Muggle AI",
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
- "version": "5.26.0-staging.202",
5
+ "version": "5.26.0-staging.203",
6
6
  "author": {
7
7
  "name": "Muggle AI",
8
8
  "email": "support@muggle-ai.com"
package/plugin/.mcp.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "command": "npx",
5
5
  "args": [
6
6
  "-y",
7
- "@muggleai/works@5.26.0-staging.202",
7
+ "@muggleai/works@5.26.0-staging.203",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -8,6 +8,10 @@
8
8
  # `muggle upgrade`, so the service always runs the current release. Only the
9
9
  # launcher shim is copied, to ~\.muggle-ai\watch\bin, so the task never points
10
10
  # into a checkout or worktree that may be deleted.
11
+ #
12
+ # Keep this file ASCII. Windows PowerShell 5.1 reads a script without a BOM in the
13
+ # ANSI code page, where the bytes of a UTF-8 dash decode to a curly quote that
14
+ # ends the string around it, and the whole script fails to parse.
11
15
  [CmdletBinding()]
12
16
  param(
13
17
  [ValidateRange(1, 60)]
@@ -44,7 +48,7 @@ $nodeCommand = Get-Command node -ErrorAction SilentlyContinue
44
48
  if (-not $nodeCommand) { throw "node is not on PATH; the task needs it to run muggle." }
45
49
  foreach ($requiredTool in @("claude", "gh")) {
46
50
  if (-not (Get-Command $requiredTool -ErrorAction SilentlyContinue)) {
47
- Write-Warning "$requiredTool is not on PATH — the watch will report without the data it provides."
51
+ Write-Warning "$requiredTool is not on PATH; the watch will report without the data it provides."
48
52
  }
49
53
  }
50
54
 
@@ -59,7 +63,7 @@ if ($NoAutoReload) { $tickFlags += "--no-auto-reload" }
59
63
  if ($NoRecovery) { $tickFlags += "--no-recovery" }
60
64
  $launcherArguments = @("`"$installedLauncher`"", "`"$($nodeCommand.Source)`"", "`"$MuggleEntry`"") + $tickFlags
61
65
 
62
- # wscript.exe rather than node.exe is what keeps every run off the desktop — see
66
+ # wscript.exe rather than node.exe is what keeps every run off the desktop; see
63
67
  # the header of muggle-watch-hidden.vbs.
64
68
  $taskAction = New-ScheduledTaskAction -Execute (Join-Path $env:SystemRoot "System32\wscript.exe") `
65
69
  -Argument ($launcherArguments -join " ")
@@ -93,7 +97,7 @@ while ((Get-Date) -lt $deadline) {
93
97
  $taskInfo = Get-ScheduledTaskInfo -TaskName $TaskName
94
98
  "task $TaskName registered every $IntervalMinutes min; state=$((Get-ScheduledTask -TaskName $TaskName).State) lastResult=$($taskInfo.LastTaskResult)"
95
99
  if ((Test-Path $statusFile) -and (Get-Item $statusFile).LastWriteTime -gt $previousSnapshotTime) {
96
- "first tick written: $statusFile — run 'muggle watch status' to read it"
100
+ "first tick written: $statusFile; run 'muggle watch status' to read it"
97
101
  } else {
98
102
  Write-Warning "no tick finished within 120s; check $(Join-Path $watchDir 'tick.log')"
99
103
  }