@muggleai/works 5.27.0-staging.244 → 5.27.0-staging.245

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.27.0-staging.244"
12
+ "version": "5.27.0-staging.245"
13
13
  }
14
14
  ]
15
15
  }
@@ -5375,7 +5375,7 @@ function readProcessTable(platform4, runCommand, nowMs) {
5375
5375
  function resumeOnReconcile(target, runCommand, waitForExit) {
5376
5376
  if (target.runningShortId !== void 0) {
5377
5377
  runCommand("claude", ["stop", target.runningShortId]);
5378
- if (!waitForExit(target.sessionId)) return false;
5378
+ if (!waitForExit(target.runningSessionId ?? target.sessionId)) return false;
5379
5379
  }
5380
5380
  const resumed = runCommand("claude", ["--resume", target.sessionId, "--bg", RECOVERY_RESUME_PROMPT], { cwd: target.cwd });
5381
5381
  return resumed?.exitCode === 0;
@@ -5383,17 +5383,21 @@ function resumeOnReconcile(target, runCommand, waitForExit) {
5383
5383
 
5384
5384
  // src/watch/recovery.ts
5385
5385
  function isRecoverable(assessment, ownerSession) {
5386
- const isOwnerRestartable = assessment.isOwnerSessionActive === false || assessment.isOwnerSessionActive === true && ownerSession !== void 0 && isIdleBackgroundSession(ownerSession);
5386
+ const isOwnerRestartable = ownerSession === void 0 ? assessment.isOwnerSessionActive === false : isIdleBackgroundSession(ownerSession);
5387
5387
  return assessment.isRegistered && assessment.watcher === "dead" /* Dead */ && assessment.live?.state === "OPEN" /* Open */ && assessment.ownerSessionId !== void 0 && isOwnerRestartable;
5388
5388
  }
5389
5389
  function isSlotCloseOutDue(assessment) {
5390
5390
  return isTerminalPrState(assessment.live?.state) && assessment.watcher === "dead" /* Dead */ && assessment.isOwnerSessionActive !== true;
5391
5391
  }
5392
+ function findRunningOwner(sessionsById, ownerSessionId) {
5393
+ const ownerShortId = shortSessionId(ownerSessionId);
5394
+ return sessionsById.get(ownerSessionId) ?? [...sessionsById.values()].find((session) => session.shortId === ownerShortId);
5395
+ }
5392
5396
  function planWatcherRecoveries(assessments, attemptsByOwner, nowMs, isPollingDisabled, sessionsById = /* @__PURE__ */ new Map(), isStoppedAtUsageLimit2 = () => false) {
5393
5397
  if (isPollingDisabled) return [];
5394
5398
  const slugsByOwner = /* @__PURE__ */ new Map();
5395
5399
  for (const assessment of assessments) {
5396
- const ownerSession = assessment.ownerSessionId === void 0 ? void 0 : sessionsById.get(assessment.ownerSessionId);
5400
+ const ownerSession = assessment.ownerSessionId === void 0 ? void 0 : findRunningOwner(sessionsById, assessment.ownerSessionId);
5397
5401
  if (!isRecoverable(assessment, ownerSession)) continue;
5398
5402
  const ownerSessionId = assessment.ownerSessionId;
5399
5403
  const slugs = slugsByOwner.get(ownerSessionId) ?? /* @__PURE__ */ new Set();
@@ -5405,18 +5409,20 @@ function planWatcherRecoveries(assessments, attemptsByOwner, nowMs, isPollingDis
5405
5409
  for (const ownerSessionId of [...slugsByOwner.keys()].sort()) {
5406
5410
  const recentAttemptsMs = (attemptsByOwner[ownerSessionId] ?? []).map((attemptedAt) => Date.parse(attemptedAt)).filter((attemptedAtMs) => !Number.isNaN(attemptedAtMs) && nowMs - attemptedAtMs < RECOVERY_ATTEMPT_WINDOW_MS);
5407
5411
  const lastAttemptMs = Math.max(-Infinity, ...recentAttemptsMs);
5408
- const isCapReached = recentAttemptsMs.length >= RECOVERY_MAX_ATTEMPTS && !isStoppedAtUsageLimit2(ownerSessionId);
5412
+ const runningOwner = findRunningOwner(sessionsById, ownerSessionId);
5413
+ const isRunningAtUsageLimit = runningOwner !== void 0 && [ownerSessionId, runningOwner.sessionId].some((sessionId) => isStoppedAtUsageLimit2(sessionId));
5409
5414
  let outcome = "resume-due" /* ResumeDue */;
5410
- if (isCapReached) outcome = "attempts-exhausted" /* AttemptsExhausted */;
5415
+ if (isRunningAtUsageLimit) outcome = "awaiting-usage-limit-reset" /* AwaitingUsageLimitReset */;
5416
+ else if (recentAttemptsMs.length >= RECOVERY_MAX_ATTEMPTS) outcome = "attempts-exhausted" /* AttemptsExhausted */;
5411
5417
  else if (nowMs - lastAttemptMs < RECOVERY_COOLDOWN_MS) outcome = "cooling-down" /* CoolingDown */;
5412
5418
  else if (resumesPlanned >= MAX_RESUMES_PER_TICK) outcome = "deferred-by-tick-cap" /* DeferredByTickCap */;
5413
5419
  if (outcome === "resume-due" /* ResumeDue */) resumesPlanned++;
5414
- const runningOwner = sessionsById.get(ownerSessionId);
5415
5420
  recoveries.push({
5416
5421
  ownerSessionId,
5417
5422
  slotSlugs: [...slugsByOwner.get(ownerSessionId) ?? []].sort(),
5418
5423
  outcome,
5419
- ...runningOwner?.shortId === void 0 ? {} : { ownerShortId: runningOwner.shortId }
5424
+ ...runningOwner?.shortId === void 0 ? {} : { ownerShortId: runningOwner.shortId },
5425
+ ...runningOwner === void 0 || runningOwner.sessionId === ownerSessionId ? {} : { ownerRunningSessionId: runningOwner.sessionId }
5420
5426
  });
5421
5427
  }
5422
5428
  return recoveries;
@@ -5444,7 +5450,7 @@ function executeWatcherRecoveries(planned, attemptsByOwner, deps) {
5444
5450
  return { ...recovery, cwd, outcome: "restart-refused" /* RestartRefused */ };
5445
5451
  }
5446
5452
  const isResumed = resumeOnReconcile(
5447
- { sessionId: recovery.ownerSessionId, cwd, runningShortId: recovery.ownerShortId },
5453
+ { sessionId: recovery.ownerSessionId, cwd, runningShortId: recovery.ownerShortId, runningSessionId: recovery.ownerRunningSessionId },
5448
5454
  deps.runCommand,
5449
5455
  deps.waitForExit
5450
5456
  );
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from './chunk-EPIM27JX.js';
2
+ import { runCli } from './chunk-SJBYMBC2.js';
3
3
  import './chunk-FI6VHHZN.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-EPIM27JX.js';
1
+ export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-SJBYMBC2.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-FI6VHHZN.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.27.0-staging.244",
4
+ "version": "5.27.0-staging.245",
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.27.0-staging.244",
7
+ "@muggleai/works@5.27.0-staging.245",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.27.0-staging.244",
3
+ "version": "5.27.0-staging.245",
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.27.0-staging.244",
5
+ "version": "5.27.0-staging.245",
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.27.0-staging.244",
7
+ "@muggleai/works@5.27.0-staging.245",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "release": "5.26.0",
3
- "buildId": "run-244-1",
4
- "commitSha": "fb9f2c87a167841819586590920404641ecc3359",
5
- "buildTime": "2026-10-29T00:22:55Z",
3
+ "buildId": "run-245-1",
4
+ "commitSha": "d4e56d068786541b25d22819c6336d5c5f5baf6b",
5
+ "buildTime": "2026-10-29T16:50:53Z",
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.27.0-staging.244",
4
+ "version": "5.27.0-staging.245",
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.27.0-staging.244",
4
+ "version": "5.27.0-staging.245",
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.27.0-staging.244",
7
+ "@muggleai/works@5.27.0-staging.245",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.27.0-staging.244",
3
+ "version": "5.27.0-staging.245",
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.27.0-staging.244",
5
+ "version": "5.27.0-staging.245",
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.27.0-staging.244",
7
+ "@muggleai/works@5.27.0-staging.245",
8
8
  "serve"
9
9
  ]
10
10
  }