@muggleai/works 5.33.0-staging.302 → 5.33.0-staging.304

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.33.0-staging.302"
12
+ "version": "5.33.0-staging.304"
13
13
  }
14
14
  ]
15
15
  }
@@ -515,7 +515,9 @@ function getMuggleConfig() {
515
515
  electronAppVersion: config.electronAppVersion,
516
516
  downloadBaseUrl: config.downloadBaseUrl,
517
517
  checksumsByStream: config.checksumsByStream || {},
518
- runtimeTargetDefault
518
+ runtimeTargetDefault,
519
+ electronAppSignedFromVersion: config.electronAppSignedFromVersion,
520
+ signerIdentityUri: config.signerIdentityUri
519
521
  };
520
522
  return muggleConfigCache;
521
523
  }
@@ -9667,7 +9669,7 @@ var apiKeyTools = [
9667
9669
  var userFeedbackTools = [
9668
9670
  {
9669
9671
  name: "muggle-remote-user-feedback-create",
9670
- description: "Submit user feedback on a generated action script \u2014 either the whole script (targetType='actionScript', targetId=actionScriptId) or a specific step (targetType='step', targetId=`${actionScriptId}:${stepIndex}` with 0-based stepIndex). Persists the feedback and triggers an async feedback-analysis workflow that may regenerate the script. The response includes the saved feedback and, when the analysis workflow was started, a feedbackAnalysisWorkflowRuntimeId for polling.",
9672
+ description: "Submit user feedback on a generated action script \u2014 either the whole script (targetType='actionScript', targetId=actionScriptId) or a specific step (targetType='step', targetId=`${actionScriptId}:${stepIndex}` with 0-based stepIndex). Persists the feedback and triggers an async feedback-analysis workflow that may regenerate the script in the cloud. A script generated on the user's machine is never regenerated there, and nothing happens for it until it runs locally: the response's localRegenerationTestCaseIds names the target when it is one, and the entry's outcome names similar test cases once the analysis ends. The response includes the saved feedback, localRegenerationTestCaseIds and, when the analysis workflow was started, a feedbackAnalysisWorkflowRuntimeId for polling.",
9671
9673
  inputSchema: UserFeedbackCreateInputSchema,
9672
9674
  mapToUpstream: (input) => {
9673
9675
  const toolInput = input;
@@ -9677,7 +9679,8 @@ var userFeedbackTools = [
9677
9679
  body: {
9678
9680
  projectId: toolInput.projectId,
9679
9681
  target: toolInput.target,
9680
- feedbackText: toolInput.feedbackText
9682
+ feedbackText: toolInput.feedbackText,
9683
+ canRegenerateLocally: true
9681
9684
  }
9682
9685
  };
9683
9686
  }
@@ -1,4 +1,4 @@
1
- import { __export, getLogger, TelemetryEnvironment, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir2, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, resolveElectronAppExecutablePath, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, getActiveElectronAppReleaseStream, buildToolInputJsonSchema, toolRequiresAuth, getCallerCredentials, parseElectronAppDirName, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, ElectronAppReleaseStream, buildElectronAppChecksumsUrl, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, buildLlmSourcePlan, describeLlmSourceStatus, resolveLlmSourceStatus, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, claimServiceStack, BUSY_EXIT_CODE, checkServiceStack, releaseServiceStack, readServiceStackStatus, resolvePreferences, OnboardingBlanketChoice, PreferenceKey, LlmSource, applyLlmSourceSelection, describeStackMismatch, getDataDir, DEFAULT_LOCAL_LLM_BASE_URL, isValidLocalBaseUrl, local_exports } from './chunk-XBOAJYJP.js';
1
+ import { __export, getLogger, TelemetryEnvironment, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir2, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, resolveElectronAppExecutablePath, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, getActiveElectronAppReleaseStream, buildToolInputJsonSchema, toolRequiresAuth, getCallerCredentials, parseElectronAppDirName, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, ElectronAppReleaseStream, buildElectronAppChecksumsUrl, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, buildLlmSourcePlan, describeLlmSourceStatus, resolveLlmSourceStatus, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, claimServiceStack, BUSY_EXIT_CODE, checkServiceStack, releaseServiceStack, readServiceStackStatus, resolvePreferences, OnboardingBlanketChoice, PreferenceKey, LlmSource, applyLlmSourceSelection, describeStackMismatch, getDataDir, DEFAULT_LOCAL_LLM_BASE_URL, isValidLocalBaseUrl, local_exports } from './chunk-AVLAELB5.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';
@@ -1255,7 +1255,7 @@ async function resolveGsScreenshotUrls(report, opts) {
1255
1255
  if (gsUrls.length === 0) {
1256
1256
  return report;
1257
1257
  }
1258
- const mcps = await import('./src-HEQU7J76.js');
1258
+ const mcps = await import('./src-MCJYWHIO.js');
1259
1259
  const credentials = await mcps.getCallerCredentialsAsync();
1260
1260
  if (!credentials.bearerToken && !credentials.apiKey) {
1261
1261
  stderrWrite(
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from './chunk-QPOBJ73B.js';
3
- import './chunk-XBOAJYJP.js';
2
+ import { runCli } from './chunk-XX64END2.js';
3
+ import './chunk-AVLAELB5.js';
4
4
 
5
5
  // src/cli/main.ts
6
6
  runCli().catch((error) => {
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-QPOBJ73B.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-XBOAJYJP.js';
1
+ export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-XX64END2.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-AVLAELB5.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.33.0-staging.302",
4
+ "version": "5.33.0-staging.304",
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.33.0-staging.302",
7
+ "@muggleai/works@5.33.0-staging.304",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.33.0-staging.302",
3
+ "version": "5.33.0-staging.304",
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.33.0-staging.302",
5
+ "version": "5.33.0-staging.304",
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.33.0-staging.302",
7
+ "@muggleai/works@5.33.0-staging.304",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -10,7 +10,7 @@ description: "Use when the user wants to flag that a generated Muggle Test actio
10
10
 
11
11
  > Running outside Claude Code (in Codex, for one)? Read [`../_shared/host-tool-equivalents.md`](../_shared/host-tool-equivalents.md) first — it maps the tools and paths this skill names to your host's.
12
12
 
13
- Capture user feedback on what a generated Muggle Test action script did wrong. The server uses each feedback row to find similar test cases via LLM and regenerate their scripts in the background.
13
+ Capture user feedback on what a generated Muggle Test action script did wrong. The server uses each feedback row to find similar test cases via LLM, then each affected script regenerates where it was made: a cloud-generated one in the background, a locally generated one on this machine, run by this skill.
14
14
 
15
15
  ## Routing
16
16
 
@@ -32,6 +32,7 @@ If intent is ambiguous, use `AskUserQuestion` once with options **Submit / List
32
32
  - **One specific step** — `target.targetType = "step"`, `target.targetId = "<actionScriptId>:<stepIndex>"` where `stepIndex` is **0-based** on the wire even though steps are shown to the user 1-based.
33
33
  - **Project scope.** All ops scope to the user's last-used project (`muggle-local-last-project-get`). If unset, ask once and persist via `muggle-local-last-project-set` so subsequent ops in this session reuse it.
34
34
  - **`feedbackText` must be non-empty.** Re-prompt the user if they leave it blank.
35
+ - **The server cannot start a local run.** It saves the feedback and names the test cases only this machine can regenerate; nothing regenerates for them until this skill runs them.
35
36
 
36
37
  ## Non-negotiables (all ops)
37
38
 
@@ -39,4 +40,5 @@ If intent is ambiguous, use `AskUserQuestion` once with options **Submit / List
39
40
  - Always render the run's steps and summary (§2) **before** collecting feedback — users can only point at what they can see.
40
41
  - Convert step numbers between 1-based (rendered to user) and 0-based (wire format) at the boundary. Never expose 0-based indices to the user.
41
42
  - One MCP submit/delete call per feedback piece — never batch into a single call.
42
- - Surface the `feedbackAnalysisWorkflowRuntimeId` returned by submit so the user knows regeneration is running. Do not poll it from this skill.
43
+ - Surface the `feedbackAnalysisWorkflowRuntimeId` returned by submit so the user knows the analysis is running.
44
+ - Say a test case is regenerating only when a run for it started. A cloud regeneration is named in the entry's `outcome.regeneratedTestCaseIds`; a local one exists only once this skill starts it ([`ops/submit.md`](ops/submit.md) §6).
@@ -53,7 +53,7 @@ Markdown table sorted by `createdAt` (newest first):
53
53
  `AskUserQuestion`:
54
54
 
55
55
  > "What next?"
56
- > - **View detail** — pick an entry, print full `feedbackText`, full ids, target, dashboard link if available.
56
+ > - **View detail** — pick an entry, print full `feedbackText`, full ids, target, `outcome.state` with the test cases it names (`regeneratedTestCaseIds` in the cloud, `localRegenerationTestCaseIds` waiting for a local run), dashboard link if available.
57
57
  > - **Delete one** — hand off to [`delete.md`](delete.md).
58
58
  > - **Submit new feedback** — hand off to [`submit.md`](submit.md).
59
59
  > - **Done**
@@ -1,6 +1,6 @@
1
1
  # Submit feedback
2
2
 
3
- Resolve the action script being commented on, render it for review, collect feedback against one or more steps and/or the whole script, then submit each piece as its own server-side row.
3
+ Resolve the action script being commented on, render it for review, collect feedback against one or more steps and/or the whole script, submit each piece as its own server-side row, then regenerate on this machine whatever only it can regenerate.
4
4
 
5
5
  ## 1. Resolve the action script (the "anchor")
6
6
 
@@ -107,11 +107,51 @@ For each piece, call `muggle-remote-user-feedback-create` once. Map fields:
107
107
  | Step `n` (1-based) | `"step"` | `` `${actionScriptId}:${n - 1}` `` (convert to 0-based) |
108
108
  | Whole script | `"actionScript"` | `actionScriptId` |
109
109
 
110
- Always pass `projectId` and `feedbackText`. Capture each response — note `feedback.id` and `feedbackAnalysisWorkflowRuntimeId` (may be undefined).
110
+ Always pass `projectId` and `feedbackText`. Capture each response — note `feedback.id`, `feedbackAnalysisWorkflowRuntimeId` (may be undefined) and `localRegenerationTestCaseIds` (test cases only this machine can regenerate; absent means none).
111
111
 
112
112
  If a single create call fails, log the error, continue with the rest, and report the failure at the end. Do not abort the batch.
113
113
 
114
- ## 5. Report
114
+ ## 5. Wait for the analysis
115
+
116
+ The create response names only the feedback target. When the analysis ends, the entry's `outcome` also names similar test cases and what regenerated in the cloud.
117
+
118
+ Skip this step when no response carries a `feedbackAnalysisWorkflowRuntimeId`. Otherwise:
119
+
120
+ 1. `muggle-remote-user-feedback-list` with `projectId` and `actionScriptId`. Find each submitted `feedback.id` in the response.
121
+ 2. While any of them has `outcome.state` `analyzing`, wait 15 seconds (`node -e "setTimeout(() => {}, 15000)"`) and list again, at most 12 times.
122
+
123
+ Build two lists of unique test case ids:
124
+
125
+ - **Cloud** — every `outcome.regeneratedTestCaseIds`. Already started; this skill does nothing more for them.
126
+ - **Local** — every create response's `localRegenerationTestCaseIds` and every `outcome.localRegenerationTestCaseIds`, the feedback target first.
127
+
128
+ An entry still `analyzing` after the last check keeps only what its create response named. `outcome.state` `failed` means the analysis stopped, so similar test cases were not checked; what the create response named still stands.
129
+
130
+ ## 6. Regenerate locally
131
+
132
+ Skip when **Local** is empty. Never start a cloud generation for a test case on this list: the cloud may not reach its site.
133
+
134
+ When this skill was invoked from a failed run's **Give feedback & rerun** option, the caller regenerates that run's test case as soon as this skill returns. Drop it from **Local**, so it is not regenerated twice, and run the rest.
135
+
136
+ Resolve once:
137
+
138
+ - `cwd` — the PR-branch worktree if one exists, else the repo root, else the current directory.
139
+ - `showUi` — gate `showElectronBrowser` (per `preference-gates/README.md`): `always` → omit `showUi`; `never` → pass `showUi: false`; `ask` → ask via `AskUserQuestion`, then map the answer the same way.
140
+
141
+ Then, one test case at a time, in **Local** order:
142
+
143
+ 1. **`localUrl`** — the first of these that yields a URL:
144
+ 1. `muggle-remote-test-script-list` with `projectId`, `testCaseId` and `runEnvironmentType: "local"` → the newest script's `url`.
145
+ 2. For the feedback target, the `url` of the action script rendered in §2.
146
+ 3. `muggle-local-last-host-get`.
147
+ 4. `AskUserQuestion`, offering the test case's `url`, with **Skip this test case** as the last option.
148
+ 2. **Reachability** — probe `localUrl` once, as [`dev-server-readiness.md`](../../_shared/dev-server-readiness.md) Stage 1 does but with a single attempt. No response means this test case cannot run.
149
+ 3. **Run** — the `regen` mode of [`run.md`](../../_shared/dev-loop/run.md), Records included, with `timeoutMs: 900000`. Leave the test case as it is and pass no `mutations`: every generation loads the project's saved feedback itself, which is how this feedback reaches the run.
150
+ 4. **Result** — read it per [`failures.md`](../../_shared/dev-loop/failures.md). A passing run: keep its `runId` and `viewUrl`. A non-passing run goes through [`debug-failed-run.md`](../../_shared/debug-failed-run.md) before the next test case. A `Run refused` result launched nothing: follow `run.md`'s rule for it once; a second refusal means this test case cannot run.
151
+
152
+ A test case that cannot run goes on a **Not run** list with its reason; move on to the next one.
153
+
154
+ ## 7. Report
115
155
 
116
156
  Print one line per submitted feedback in this shape:
117
157
 
@@ -119,9 +159,16 @@ Print one line per submitted feedback in this shape:
119
159
  ✓ feedback <id> — <target description> [analysis runtime: <id>]
120
160
  ```
121
161
 
122
- End with a one-line note:
162
+ Read the titles with `muggle-remote-test-case-get`, then print each line below that applies, and only those:
123
163
 
124
- > "Regeneration runs in the background. Re-run this test case later to use the updated script."
164
+ - **Cloud** not empty → "Regenerating in the cloud: <titles>. Re-run them later to use the updated scripts."
165
+ - A passing local run → "Regenerated locally: <title> — <viewUrl>"
166
+ - A non-passing local run → "Local regeneration failed: <title> — run <runId>: <one-line diagnosis>"
167
+ - A test case dropped for the caller's rerun → "Left for the rerun: <title>"
168
+ - **Not run** → "Not regenerated: <title> — <reason>. Your feedback is saved and reaches the next generation. To regenerate it now, <start the site at `localUrl`, or connect to the network that reaches it>, then run `/muggle-test-feature-local`, pick this test case and choose **Generate new script**."
169
+ - An entry still `analyzing` → "Still analyzing, so similar test cases may follow. Check later with `/muggle-feedback`."
170
+ - An entry `failed` → "The analysis failed, so similar test cases were not checked."
171
+ - **Cloud** and **Local** both empty, and no entry `analyzing` or `failed` → "No test case needed regenerating. Your feedback is kept as guidance for future generations."
125
172
 
126
173
  If any pieces failed, list them under a `Failed:` header with the error.
127
174
 
@@ -131,3 +178,6 @@ If any pieces failed, list them under a `Failed:` header with the error.
131
178
  - One create call per feedback piece — never concatenate paragraphs across targets.
132
179
  - Convert step numbers from 1-based (UI) to 0-based (wire) at submit time.
133
180
  - If a legacy local run carries no `cloudActionScriptId`, do the upload silently before submit; do not ask for permission for the upload itself.
181
+ - Never start a cloud generation for a test case on the **Local** list.
182
+ - Run local regenerations one at a time.
183
+ - Never report a regeneration that did not start.
@@ -1,7 +1,7 @@
1
1
  {
2
- "release": "5.33.0-staging.302",
3
- "buildId": "run-302-1",
4
- "commitSha": "9b0873074fe714f6d4616b55028e726315c5a0ba",
5
- "buildTime": "2026-11-05T08:17:03Z",
2
+ "release": "5.33.0-staging.304",
3
+ "buildId": "run-304-1",
4
+ "commitSha": "c48707f7c163db8b91b6061231c8f1724d6fa728",
5
+ "buildTime": "2026-11-05T17:22:22Z",
6
6
  "serviceName": "muggle-ai-works-mcp"
7
7
  }
@@ -1 +1 @@
1
- export { ACTION_SCRIPT_FILE_NAME, BASE_REMOTE_NAME, BLOCKING_FRESHNESS_VERDICTS, BRANCH_CREATION_REFLOG_PREFIX, BUSY_EXIT_CODE, CLAUDE_CODE_AUTH_STATUS_ARGS, CLAUDE_CODE_CHECK_TIMEOUT_MS, CLAUDE_CODE_EXECUTABLE, CLAUDE_CODE_EXECUTABLE_NOT_FOUND_CODE, CLAUDE_CODE_SESSION_LINK_ENV_VARS, CLAUDE_CODE_VERSION_ARGS, CheckoutFreshnessVerdict, ClaudeCodeReadiness, DEFAULT_LOCAL_LLM_BASE_URL, DEFAULT_PREFERENCES, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ELECTRON_APP_RESOURCES_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, LLM_CREDENTIALS_FILE_MODE, LLM_CREDENTIALS_FILE_NAME, LLM_SOURCE_HEADER, LLM_SOURCE_OPTIONS, LLM_SOURCE_OWNED_ENV_NAMES, LLM_SOURCE_PROMPT, LLM_SOURCE_SCOPE_NOTE, LlmSource, MASKED_API_KEY_PREFIX, MASKED_API_KEY_VISIBLE_CHARS, MAX_LISTED_INHERITED_COMMITS, ONBOARDING_BLANKET_OPTIONS, ONBOARDING_CHOICE_GROUPS, ONBOARDING_MAX_OFFERS, ONBOARDING_PRIMER_BULLETS, ONBOARDING_PRIMER_HEADLINE, ONBOARDING_TOGGLE_GROUPS, ONBOARDING_TOGGLE_PROMPT, ONBOARDING_UNSELECTED_TOGGLE_VALUE, OnboardingBlanketChoice, OnboardingGroupKind, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ProjectPreferencesReconcileOutcome, RUN_SESSIONS_DIR_NAME, RUN_VIEW_DASHBOARD_LINK_LABEL, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, StackCheckVerdict, StackClaimVerdict, StackLeaseEndReason, StackMismatchKind, StackPortAction, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyLlmSourceSelection, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildLlmSourcePlan, buildOnboardingPlan, buildToolInputJsonSchema, calculateFileChecksum, checkServiceStack, claimServiceStack, compareQueuePlaces, completeOnboarding, createApiKeyWithToken, createChildLogger, decideStackClaim, decideStackReap, decideStackRelease, decideStackRunEnd, decideStackRunStart, deleteApiKeyData, deleteCredentials, describeLlmSourceStatus, describeStackMismatch, e2e_exports as e2e, evaluateCheckoutFreshness, findVacatedNeeds, finishStackRun, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLlmSourceOption, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, isValidLocalBaseUrl, loadApiKeyData, loadCredentials, local_exports as localQa, lookUpCheckoutPullRequest, markOnboardingCompleted, maskLlmApiKey, mcp_exports as mcp, needsConflict, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, portOfUrl, e2e_exports as qa, readPreferencesMetadata, readRunView, readServiceStackStatus, reapServiceStack, reconcileProjectPreferences, recordOnboardingSkip, releaseServiceStack, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveElectronAppResourcesDir, resolveLlmSourceStatus, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, runGitCommand, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, startStackRun, stopVacatedServices, toDisplayRef, toolRequiresAuth, validatePreference, verifyFileChecksum, writeLlmEnvBlock, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-XBOAJYJP.js';
1
+ export { ACTION_SCRIPT_FILE_NAME, BASE_REMOTE_NAME, BLOCKING_FRESHNESS_VERDICTS, BRANCH_CREATION_REFLOG_PREFIX, BUSY_EXIT_CODE, CLAUDE_CODE_AUTH_STATUS_ARGS, CLAUDE_CODE_CHECK_TIMEOUT_MS, CLAUDE_CODE_EXECUTABLE, CLAUDE_CODE_EXECUTABLE_NOT_FOUND_CODE, CLAUDE_CODE_SESSION_LINK_ENV_VARS, CLAUDE_CODE_VERSION_ARGS, CheckoutFreshnessVerdict, ClaudeCodeReadiness, DEFAULT_LOCAL_LLM_BASE_URL, DEFAULT_PREFERENCES, ELECTRON_APP_EXECUTABLE_PATH_SEGMENTS, ELECTRON_APP_RESOURCES_PATH_SEGMENTS, ElectronAppPlatform, ElectronAppReleaseStream, HTML_VIEW_OFFER_LINE, LLM_CREDENTIALS_FILE_MODE, LLM_CREDENTIALS_FILE_NAME, LLM_SOURCE_HEADER, LLM_SOURCE_OPTIONS, LLM_SOURCE_OWNED_ENV_NAMES, LLM_SOURCE_PROMPT, LLM_SOURCE_SCOPE_NOTE, LlmSource, MASKED_API_KEY_PREFIX, MASKED_API_KEY_VISIBLE_CHARS, MAX_LISTED_INHERITED_COMMITS, ONBOARDING_BLANKET_OPTIONS, ONBOARDING_CHOICE_GROUPS, ONBOARDING_MAX_OFFERS, ONBOARDING_PRIMER_BULLETS, ONBOARDING_PRIMER_HEADLINE, ONBOARDING_TOGGLE_GROUPS, ONBOARDING_TOGGLE_PROMPT, ONBOARDING_UNSELECTED_TOGGLE_VALUE, OnboardingBlanketChoice, OnboardingGroupKind, PREFERENCES_FILE_NAME, PREFERENCES_PROJECT_DIR_NAME, PREFERENCES_SCHEMA, PREFERENCES_VERSION, PREFERENCE_ALLOWED_VALUES, PreferenceKey, PreferenceValue, ProjectPreferencesReconcileOutcome, RUN_SESSIONS_DIR_NAME, RUN_VIEW_DASHBOARD_LINK_LABEL, RunViewError, RuntimeTarget, SCREENSHOT_DIR_RELATIVE_PATH, SCREENSHOT_FILE_EXTENSION, StackCheckVerdict, StackClaimVerdict, StackLeaseEndReason, StackMismatchKind, StackPortAction, WATCHER_LIFETIME_SECONDS, WATCHER_LIFETIME_UNBOUNDED_SECONDS, applyLlmSourceSelection, applyOnboardingAnswers, assertDeviceCodeClientProvisioned, buildElectronAppChecksumsUrl, buildElectronAppDirName, buildElectronAppReleaseAssetUrl, buildElectronAppReleaseTag, buildLlmSourcePlan, buildOnboardingPlan, buildToolInputJsonSchema, calculateFileChecksum, checkServiceStack, claimServiceStack, compareQueuePlaces, completeOnboarding, createApiKeyWithToken, createChildLogger, decideStackClaim, decideStackReap, decideStackRelease, decideStackRunEnd, decideStackRunStart, deleteApiKeyData, deleteCredentials, describeLlmSourceStatus, describeStackMismatch, e2e_exports as e2e, evaluateCheckoutFreshness, findVacatedNeeds, finishStackRun, formatPreferencesOneLiner, getActiveElectronAppReleaseStream, getActiveRuntimeTarget, getApiKey, getApiKeyFilePath, getAuthService, getBundledElectronAppVersion, getCallerCredentials, getCallerCredentialsAsync, getChecksumForPlatform, getConfig, getCredentialsFilePath, getDashboardBaseUrl, getDataDir2 as getDataDir, getDownloadBaseUrl, getElectronAppChecksums, getElectronAppDir, getElectronAppReleaseTagPrefix, getElectronAppSignedFromVersion, getElectronAppVersion, getElectronAppVersionSource, getLlmSourceOption, getLocalQaTools, getLogger, getOnboardingToggleKeys, getPlatformKey, getQaTools, getReleaseSignerIdentityUri, getRunSessionsDir, getValidApiKeyData, getValidCredentials, hasApiKey, isElectronAppInstalled, isElectronAppPlatform, isFirstRun, isValidLocalBaseUrl, loadApiKeyData, loadCredentials, local_exports as localQa, lookUpCheckoutPullRequest, markOnboardingCompleted, maskLlmApiKey, mcp_exports as mcp, needsConflict, needsOnboarding, openBrowserUrl, parseElectronAppDirName, performLogin, performLogout, pollDeviceCode, portOfUrl, e2e_exports as qa, readPreferencesMetadata, readRunView, readServiceStackStatus, reapServiceStack, reconcileProjectPreferences, recordOnboardingSkip, releaseServiceStack, renderRunViewHtml, renderRunViewText, resetConfig, resetLogger, resetPreference, resolveActiveProfile, resolveActiveReleaseStream, resolveActiveReleaseTagPrefix, resolveBlanketPreferences, resolveElectronAppExecutablePath, resolveElectronAppPathOrNull, resolveElectronAppResourcesDir, resolveLlmSourceStatus, resolveOnboardingAnswers, resolvePreferences, resolveRunSessionPath, resolveRuntimeTarget, resolveTogglePreferences, runGitCommand, saveApiKey, saveApiKeyData, saveCredentials, startDeviceCodeFlow, startStackRun, stopVacatedServices, toDisplayRef, toolRequiresAuth, validatePreference, verifyFileChecksum, writeLlmEnvBlock, writePreferences, writePreferencesWithMetadata, writeRunViewHtml } from './chunk-AVLAELB5.js';
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.33.0-staging.302",
4
+ "version": "5.33.0-staging.304",
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.33.0-staging.302",
4
+ "version": "5.33.0-staging.304",
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.33.0-staging.302",
7
+ "@muggleai/works@5.33.0-staging.304",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.33.0-staging.302",
3
+ "version": "5.33.0-staging.304",
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.33.0-staging.302",
5
+ "version": "5.33.0-staging.304",
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.33.0-staging.302",
7
+ "@muggleai/works@5.33.0-staging.304",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -10,7 +10,7 @@ description: "Use when the user wants to flag that a generated Muggle Test actio
10
10
 
11
11
  > Running outside Claude Code (in Codex, for one)? Read [`../_shared/host-tool-equivalents.md`](../_shared/host-tool-equivalents.md) first — it maps the tools and paths this skill names to your host's.
12
12
 
13
- Capture user feedback on what a generated Muggle Test action script did wrong. The server uses each feedback row to find similar test cases via LLM and regenerate their scripts in the background.
13
+ Capture user feedback on what a generated Muggle Test action script did wrong. The server uses each feedback row to find similar test cases via LLM, then each affected script regenerates where it was made: a cloud-generated one in the background, a locally generated one on this machine, run by this skill.
14
14
 
15
15
  ## Routing
16
16
 
@@ -32,6 +32,7 @@ If intent is ambiguous, use `AskUserQuestion` once with options **Submit / List
32
32
  - **One specific step** — `target.targetType = "step"`, `target.targetId = "<actionScriptId>:<stepIndex>"` where `stepIndex` is **0-based** on the wire even though steps are shown to the user 1-based.
33
33
  - **Project scope.** All ops scope to the user's last-used project (`muggle-local-last-project-get`). If unset, ask once and persist via `muggle-local-last-project-set` so subsequent ops in this session reuse it.
34
34
  - **`feedbackText` must be non-empty.** Re-prompt the user if they leave it blank.
35
+ - **The server cannot start a local run.** It saves the feedback and names the test cases only this machine can regenerate; nothing regenerates for them until this skill runs them.
35
36
 
36
37
  ## Non-negotiables (all ops)
37
38
 
@@ -39,4 +40,5 @@ If intent is ambiguous, use `AskUserQuestion` once with options **Submit / List
39
40
  - Always render the run's steps and summary (§2) **before** collecting feedback — users can only point at what they can see.
40
41
  - Convert step numbers between 1-based (rendered to user) and 0-based (wire format) at the boundary. Never expose 0-based indices to the user.
41
42
  - One MCP submit/delete call per feedback piece — never batch into a single call.
42
- - Surface the `feedbackAnalysisWorkflowRuntimeId` returned by submit so the user knows regeneration is running. Do not poll it from this skill.
43
+ - Surface the `feedbackAnalysisWorkflowRuntimeId` returned by submit so the user knows the analysis is running.
44
+ - Say a test case is regenerating only when a run for it started. A cloud regeneration is named in the entry's `outcome.regeneratedTestCaseIds`; a local one exists only once this skill starts it ([`ops/submit.md`](ops/submit.md) §6).
@@ -53,7 +53,7 @@ Markdown table sorted by `createdAt` (newest first):
53
53
  `AskUserQuestion`:
54
54
 
55
55
  > "What next?"
56
- > - **View detail** — pick an entry, print full `feedbackText`, full ids, target, dashboard link if available.
56
+ > - **View detail** — pick an entry, print full `feedbackText`, full ids, target, `outcome.state` with the test cases it names (`regeneratedTestCaseIds` in the cloud, `localRegenerationTestCaseIds` waiting for a local run), dashboard link if available.
57
57
  > - **Delete one** — hand off to [`delete.md`](delete.md).
58
58
  > - **Submit new feedback** — hand off to [`submit.md`](submit.md).
59
59
  > - **Done**
@@ -1,6 +1,6 @@
1
1
  # Submit feedback
2
2
 
3
- Resolve the action script being commented on, render it for review, collect feedback against one or more steps and/or the whole script, then submit each piece as its own server-side row.
3
+ Resolve the action script being commented on, render it for review, collect feedback against one or more steps and/or the whole script, submit each piece as its own server-side row, then regenerate on this machine whatever only it can regenerate.
4
4
 
5
5
  ## 1. Resolve the action script (the "anchor")
6
6
 
@@ -107,11 +107,51 @@ For each piece, call `muggle-remote-user-feedback-create` once. Map fields:
107
107
  | Step `n` (1-based) | `"step"` | `` `${actionScriptId}:${n - 1}` `` (convert to 0-based) |
108
108
  | Whole script | `"actionScript"` | `actionScriptId` |
109
109
 
110
- Always pass `projectId` and `feedbackText`. Capture each response — note `feedback.id` and `feedbackAnalysisWorkflowRuntimeId` (may be undefined).
110
+ Always pass `projectId` and `feedbackText`. Capture each response — note `feedback.id`, `feedbackAnalysisWorkflowRuntimeId` (may be undefined) and `localRegenerationTestCaseIds` (test cases only this machine can regenerate; absent means none).
111
111
 
112
112
  If a single create call fails, log the error, continue with the rest, and report the failure at the end. Do not abort the batch.
113
113
 
114
- ## 5. Report
114
+ ## 5. Wait for the analysis
115
+
116
+ The create response names only the feedback target. When the analysis ends, the entry's `outcome` also names similar test cases and what regenerated in the cloud.
117
+
118
+ Skip this step when no response carries a `feedbackAnalysisWorkflowRuntimeId`. Otherwise:
119
+
120
+ 1. `muggle-remote-user-feedback-list` with `projectId` and `actionScriptId`. Find each submitted `feedback.id` in the response.
121
+ 2. While any of them has `outcome.state` `analyzing`, wait 15 seconds (`node -e "setTimeout(() => {}, 15000)"`) and list again, at most 12 times.
122
+
123
+ Build two lists of unique test case ids:
124
+
125
+ - **Cloud** — every `outcome.regeneratedTestCaseIds`. Already started; this skill does nothing more for them.
126
+ - **Local** — every create response's `localRegenerationTestCaseIds` and every `outcome.localRegenerationTestCaseIds`, the feedback target first.
127
+
128
+ An entry still `analyzing` after the last check keeps only what its create response named. `outcome.state` `failed` means the analysis stopped, so similar test cases were not checked; what the create response named still stands.
129
+
130
+ ## 6. Regenerate locally
131
+
132
+ Skip when **Local** is empty. Never start a cloud generation for a test case on this list: the cloud may not reach its site.
133
+
134
+ When this skill was invoked from a failed run's **Give feedback & rerun** option, the caller regenerates that run's test case as soon as this skill returns. Drop it from **Local**, so it is not regenerated twice, and run the rest.
135
+
136
+ Resolve once:
137
+
138
+ - `cwd` — the PR-branch worktree if one exists, else the repo root, else the current directory.
139
+ - `showUi` — gate `showElectronBrowser` (per `preference-gates/README.md`): `always` → omit `showUi`; `never` → pass `showUi: false`; `ask` → ask via `AskUserQuestion`, then map the answer the same way.
140
+
141
+ Then, one test case at a time, in **Local** order:
142
+
143
+ 1. **`localUrl`** — the first of these that yields a URL:
144
+ 1. `muggle-remote-test-script-list` with `projectId`, `testCaseId` and `runEnvironmentType: "local"` → the newest script's `url`.
145
+ 2. For the feedback target, the `url` of the action script rendered in §2.
146
+ 3. `muggle-local-last-host-get`.
147
+ 4. `AskUserQuestion`, offering the test case's `url`, with **Skip this test case** as the last option.
148
+ 2. **Reachability** — probe `localUrl` once, as [`dev-server-readiness.md`](../../_shared/dev-server-readiness.md) Stage 1 does but with a single attempt. No response means this test case cannot run.
149
+ 3. **Run** — the `regen` mode of [`run.md`](../../_shared/dev-loop/run.md), Records included, with `timeoutMs: 900000`. Leave the test case as it is and pass no `mutations`: every generation loads the project's saved feedback itself, which is how this feedback reaches the run.
150
+ 4. **Result** — read it per [`failures.md`](../../_shared/dev-loop/failures.md). A passing run: keep its `runId` and `viewUrl`. A non-passing run goes through [`debug-failed-run.md`](../../_shared/debug-failed-run.md) before the next test case. A `Run refused` result launched nothing: follow `run.md`'s rule for it once; a second refusal means this test case cannot run.
151
+
152
+ A test case that cannot run goes on a **Not run** list with its reason; move on to the next one.
153
+
154
+ ## 7. Report
115
155
 
116
156
  Print one line per submitted feedback in this shape:
117
157
 
@@ -119,9 +159,16 @@ Print one line per submitted feedback in this shape:
119
159
  ✓ feedback <id> — <target description> [analysis runtime: <id>]
120
160
  ```
121
161
 
122
- End with a one-line note:
162
+ Read the titles with `muggle-remote-test-case-get`, then print each line below that applies, and only those:
123
163
 
124
- > "Regeneration runs in the background. Re-run this test case later to use the updated script."
164
+ - **Cloud** not empty → "Regenerating in the cloud: <titles>. Re-run them later to use the updated scripts."
165
+ - A passing local run → "Regenerated locally: <title> — <viewUrl>"
166
+ - A non-passing local run → "Local regeneration failed: <title> — run <runId>: <one-line diagnosis>"
167
+ - A test case dropped for the caller's rerun → "Left for the rerun: <title>"
168
+ - **Not run** → "Not regenerated: <title> — <reason>. Your feedback is saved and reaches the next generation. To regenerate it now, <start the site at `localUrl`, or connect to the network that reaches it>, then run `/muggle-test-feature-local`, pick this test case and choose **Generate new script**."
169
+ - An entry still `analyzing` → "Still analyzing, so similar test cases may follow. Check later with `/muggle-feedback`."
170
+ - An entry `failed` → "The analysis failed, so similar test cases were not checked."
171
+ - **Cloud** and **Local** both empty, and no entry `analyzing` or `failed` → "No test case needed regenerating. Your feedback is kept as guidance for future generations."
125
172
 
126
173
  If any pieces failed, list them under a `Failed:` header with the error.
127
174
 
@@ -131,3 +178,6 @@ If any pieces failed, list them under a `Failed:` header with the error.
131
178
  - One create call per feedback piece — never concatenate paragraphs across targets.
132
179
  - Convert step numbers from 1-based (UI) to 0-based (wire) at submit time.
133
180
  - If a legacy local run carries no `cloudActionScriptId`, do the upload silently before submit; do not ask for permission for the upload itself.
181
+ - Never start a cloud generation for a test case on the **Local** list.
182
+ - Run local regenerations one at a time.
183
+ - Never report a regeneration that did not start.