@muggleai/works 5.35.0-staging.328 → 5.35.0-staging.330

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 (46) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/{chunk-JK62L5EO.js → chunk-3MGYJFPU.js} +12 -6
  3. package/dist/{chunk-XQQ2VU45.js → chunk-4TPA2XBD.js} +2 -2
  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/scripts/guardrail-build-router.sh +34 -7
  12. package/dist/plugin/scripts/guardrail-capability-claim.sh +21 -9
  13. package/dist/plugin/scripts/guardrail-classify-gate.sh +1 -1
  14. package/dist/plugin/scripts/guardrail-pr-opened.sh +1 -1
  15. package/dist/plugin/scripts/guardrail-pr-terminal.sh +14 -0
  16. package/dist/plugin/scripts/guardrail-record-comment-replies.sh +1 -1
  17. package/dist/plugin/scripts/guardrail-record-delegation.sh +1 -1
  18. package/dist/plugin/scripts/guardrail-record-stage-signals.sh +1 -1
  19. package/dist/plugin/scripts/guardrail-report-format.sh +1 -1
  20. package/dist/plugin/scripts/guardrail-resolve-gate.sh +1 -1
  21. package/dist/plugin/scripts/guardrail-walkthrough-heading.sh +1 -1
  22. package/dist/plugin/scripts/guardrail-walkthrough-progress.sh +1 -1
  23. package/dist/plugin/scripts/guardrail-walkthrough-rerun.sh +1 -1
  24. package/dist/plugin/skills/_shared/dev-loop/run.md +1 -1
  25. package/dist/release-manifest.json +4 -4
  26. package/dist/{src-CTTMRHCL.js → src-BHOSJEAJ.js} +1 -1
  27. package/package.json +10 -10
  28. package/plugin/.claude-plugin/plugin.json +1 -1
  29. package/plugin/.codex-mcp.json +1 -1
  30. package/plugin/.codex-plugin/plugin.json +1 -1
  31. package/plugin/.cursor-plugin/plugin.json +1 -1
  32. package/plugin/.mcp.json +1 -1
  33. package/plugin/scripts/guardrail-build-router.sh +34 -7
  34. package/plugin/scripts/guardrail-capability-claim.sh +21 -9
  35. package/plugin/scripts/guardrail-classify-gate.sh +1 -1
  36. package/plugin/scripts/guardrail-pr-opened.sh +1 -1
  37. package/plugin/scripts/guardrail-pr-terminal.sh +14 -0
  38. package/plugin/scripts/guardrail-record-comment-replies.sh +1 -1
  39. package/plugin/scripts/guardrail-record-delegation.sh +1 -1
  40. package/plugin/scripts/guardrail-record-stage-signals.sh +1 -1
  41. package/plugin/scripts/guardrail-report-format.sh +1 -1
  42. package/plugin/scripts/guardrail-resolve-gate.sh +1 -1
  43. package/plugin/scripts/guardrail-walkthrough-heading.sh +1 -1
  44. package/plugin/scripts/guardrail-walkthrough-progress.sh +1 -1
  45. package/plugin/scripts/guardrail-walkthrough-rerun.sh +1 -1
  46. package/plugin/skills/_shared/dev-loop/run.md +1 -1
@@ -9,7 +9,7 @@
9
9
  "name": "muggleai",
10
10
  "source": "./plugin",
11
11
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
12
- "version": "5.35.0-staging.328"
12
+ "version": "5.35.0-staging.330"
13
13
  }
14
14
  ]
15
15
  }
@@ -6512,12 +6512,18 @@ var PinnedAccountSchema = z.object({
6512
6512
  });
6513
6513
 
6514
6514
  // packages/mcps/src/shared/llm-tier-constants.ts
6515
- var WORKFLOW_LLM_PARAMS_DESCRIPTION = "Set tier to 'light' to run Studio in Light mode \u2014 a faster, lower-cost model (Claude Sonnet 5.5). Omit to inherit the project/use case/test case setting.";
6516
- var LIGHT_MODE_INPUT_DESCRIPTION = "Run Studio in Light mode \u2014 faster, lower-cost model (Claude Sonnet 5.5). Default false.";
6517
6515
  var LLM_TIER_DISPLAY_LABELS = {
6518
- ["standard" /* Standard */]: "Standard",
6519
- ["light" /* Light */]: "Light mode"
6516
+ ["standard" /* Standard */]: "Premium",
6517
+ ["light" /* Light */]: "Standard"
6520
6518
  };
6519
+ var LLM_TIER_MODEL_NAMES = {
6520
+ ["standard" /* Standard */]: "Claude Opus 5.5",
6521
+ ["light" /* Light */]: "Claude Sonnet 5.5"
6522
+ };
6523
+ var LIGHT_TIER_SUMMARY = `the ${LLM_TIER_DISPLAY_LABELS["light" /* Light */]} tier (${LLM_TIER_MODEL_NAMES["light" /* Light */]}, faster and lower cost)`;
6524
+ var DEFAULT_TIER_SUMMARY = `the ${LLM_TIER_DISPLAY_LABELS["standard" /* Standard */]} tier (${LLM_TIER_MODEL_NAMES["standard" /* Standard */]}, the default)`;
6525
+ var WORKFLOW_LLM_PARAMS_DESCRIPTION = `Model tier override. tier '${"light" /* Light */}' runs ${LIGHT_TIER_SUMMARY}; tier '${"standard" /* Standard */}' runs ${DEFAULT_TIER_SUMMARY}. Omit to inherit the project/use case/test case setting.`;
6526
+ var LIGHT_MODE_INPUT_DESCRIPTION = `true runs ${LIGHT_TIER_SUMMARY}. Default false runs ${DEFAULT_TIER_SUMMARY}.`;
6521
6527
 
6522
6528
  // packages/mcps/src/shared/workflow-max-run-time-constants.ts
6523
6529
  var MIN_WORKFLOW_MAX_RUN_TIME_OVERRIDE_MS = 60 * 1e3;
@@ -10324,7 +10330,7 @@ var ExecuteTestGenerationInputSchema = z.object({
10324
10330
  runSettingsId: z.string().optional().describe(
10325
10331
  "Local runSettings record to record this run against, e.g. a local script's runSettingsId. Pass its resolution as displayResolution."
10326
10332
  ),
10327
- /** Run Studio's prediction agent on the Light mode model tier. */
10333
+ /** Run Studio's prediction agent on the light tier. */
10328
10334
  lightMode: z.boolean().optional().describe(LIGHT_MODE_INPUT_DESCRIPTION)
10329
10335
  });
10330
10336
  var ExecuteReplayInputSchema = z.object({
@@ -10354,7 +10360,7 @@ var ExecuteReplayInputSchema = z.object({
10354
10360
  displayResolution: DisplayResolutionSchema.optional().describe(
10355
10361
  "Browser resolution, e.g. R_0390x0844. Defaults to the script's recorded size."
10356
10362
  ),
10357
- /** Run Studio's prediction agent on the Light mode model tier. */
10363
+ /** Run Studio's prediction agent on the light tier. */
10358
10364
  lightMode: z.boolean().optional().describe(LIGHT_MODE_INPUT_DESCRIPTION)
10359
10365
  });
10360
10366
  var CancelExecutionInputSchema = z.object({
@@ -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, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, buildLlmSourcePlan, describeLlmSourceStatus, resolveLlmSourceStatus, e2e_exports, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, claimServiceStack, BUSY_EXIT_CODE, checkServiceStack, releaseServiceStack, readServiceStackStatus, resolvePreferences, buildElectronAppChecksumsUrl, OnboardingBlanketChoice, PreferenceKey, LlmSource, applyLlmSourceSelection, describeStackMismatch, ELECTRON_APP_CHECKSUMS_ASSET_NAME, getDataDir, DEFAULT_LOCAL_LLM_BASE_URL, isValidLocalBaseUrl, local_exports } from './chunk-JK62L5EO.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, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, buildLlmSourcePlan, describeLlmSourceStatus, resolveLlmSourceStatus, e2e_exports, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, evaluateCheckoutFreshness, runGitCommand, BLOCKING_FRESHNESS_VERDICTS, claimServiceStack, BUSY_EXIT_CODE, checkServiceStack, releaseServiceStack, readServiceStackStatus, resolvePreferences, buildElectronAppChecksumsUrl, OnboardingBlanketChoice, PreferenceKey, LlmSource, applyLlmSourceSelection, describeStackMismatch, ELECTRON_APP_CHECKSUMS_ASSET_NAME, getDataDir, DEFAULT_LOCAL_LLM_BASE_URL, isValidLocalBaseUrl, local_exports } from './chunk-3MGYJFPU.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';
@@ -1341,7 +1341,7 @@ async function resolveGsScreenshotUrls(report, opts) {
1341
1341
  if (gsUrls.length === 0) {
1342
1342
  return report;
1343
1343
  }
1344
- const mcps = await import('./src-CTTMRHCL.js');
1344
+ const mcps = await import('./src-BHOSJEAJ.js');
1345
1345
  const credentials = await mcps.getCallerCredentialsAsync();
1346
1346
  if (!credentials.bearerToken && !credentials.apiKey) {
1347
1347
  stderrWrite(
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from './chunk-XQQ2VU45.js';
3
- import './chunk-JK62L5EO.js';
2
+ import { runCli } from './chunk-4TPA2XBD.js';
3
+ import './chunk-3MGYJFPU.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-XQQ2VU45.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-JK62L5EO.js';
1
+ export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-4TPA2XBD.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-3MGYJFPU.js';
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "muggle",
3
3
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
4
- "version": "5.35.0-staging.328",
4
+ "version": "5.35.0-staging.330",
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.35.0-staging.328",
7
+ "@muggleai/works@5.35.0-staging.330",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.35.0-staging.328",
3
+ "version": "5.35.0-staging.330",
4
4
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
5
5
  "author": {
6
6
  "name": "Muggle AI",
@@ -2,7 +2,7 @@
2
2
  "name": "muggle",
3
3
  "displayName": "Muggle AI",
4
4
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
5
- "version": "5.35.0-staging.328",
5
+ "version": "5.35.0-staging.330",
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.35.0-staging.328",
7
+ "@muggleai/works@5.35.0-staging.330",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -21,6 +21,13 @@ set -uo pipefail
21
21
  # never fire again, so its state flag ends the check in-shell. detectBuildIntent
22
22
  # drops a question or a slash command whatever verbs it holds, so those end here
23
23
  # too, except a /muggle-do or /mdo command, which Node must see to arm the gate.
24
+ #
25
+ # A pasted log makes the prompt hundreds of KB, and capturing it with a regex costs
26
+ # about 1.5 ms per KB, so the prompt is never extracted. The payload is cut at its
27
+ # "prompt" key, which a string value cannot spell unescaped, and the question and
28
+ # slash checks read only the head of what follows while the verbs are glob
29
+ # substring tests, several times cheaper than one alternation regex. Whatever
30
+ # follows the prompt in the payload is searched too, which only over-matches.
24
31
 
25
32
  guardrail_script_dir="${BASH_SOURCE[0]%/*}"
26
33
  [[ $guardrail_script_dir == "${BASH_SOURCE[0]}" ]] && guardrail_script_dir=.
@@ -28,27 +35,47 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
28
35
 
29
36
  GUARDRAIL_SUBCOMMAND="build-router"
30
37
 
38
+ # Matched case-insensitively as substrings, so "muggle-do" and "mdo" cover every
39
+ # /muggle-do, /muggle:mdo and $mdo spelling.
40
+ BUILD_ROUTER_WORDS=(implement build add create write fix refactor "wire up" "hook up" make "change the" conflict merged passing green muggle-do mdo)
41
+
31
42
  guardrail_wants() {
32
43
  if guardrail_load_state && guardrail_state_has '"buildIntentRouted": true'; then
33
44
  return 1
34
45
  fi
35
- guardrail_payload_field prompt || return 1
46
+ local prompt_key='"prompt"'
47
+ [[ $GUARDRAIL_PAYLOAD == *"$prompt_key"* ]] || return 1
48
+ local prompt_onward="${GUARDRAIL_PAYLOAD#*"$prompt_key"}"
49
+ local value_opening_pattern='^[[:space:]]*:[[:space:]]*"'
50
+ [[ ${prompt_onward:0:64} =~ $value_opening_pattern ]] || return 1
51
+ prompt_onward="${prompt_onward:${#BASH_REMATCH[0]}}"
52
+ local prompt_head="${prompt_onward:0:256}"
36
53
  # The prompt is still JSON-escaped: an escaped newline, return or tab counts as leading
37
- # space, and any other escape leaves the prompt to Node.
54
+ # space, and any other escape leaves the prompt to Node. The value's closing quote ends
55
+ # a command name the way the end of the prompt does.
38
56
  local leading_space='^([[:space:]]|\\[nrt])*'
39
57
  local question_pattern="$leading_space"'(why|what|how|when|where|who|is|are|does|do|can you (explain|tell)|explain)([^A-Za-z0-9_]|$)'
40
58
  local slash_command_pattern="$leading_space"'/'
41
- local muggle_do_command_pattern="$leading_space"'/([A-Za-z0-9_-]+:)?(muggle-do|mdo)([[:space:]]|\\|$)'
59
+ local muggle_do_command_pattern="$leading_space"'/([A-Za-z0-9_-]+:)?(muggle-do|mdo)([[:space:]]|\\|"|$)'
42
60
  local is_rejected_by_node=1
43
61
  shopt -s nocasematch
44
- if [[ $GUARDRAIL_FIELD_VALUE =~ $question_pattern ]]; then
62
+ if [[ $prompt_head =~ $question_pattern ]]; then
45
63
  is_rejected_by_node=0
46
- elif [[ $GUARDRAIL_FIELD_VALUE =~ $slash_command_pattern && ! $GUARDRAIL_FIELD_VALUE =~ $muggle_do_command_pattern ]]; then
64
+ elif [[ $prompt_head =~ $slash_command_pattern && ! $prompt_head =~ $muggle_do_command_pattern ]]; then
47
65
  is_rejected_by_node=0
48
66
  fi
67
+ local is_build_word_found=1
68
+ if ((is_rejected_by_node == 1)); then
69
+ local build_word
70
+ for build_word in "${BUILD_ROUTER_WORDS[@]}"; do
71
+ if [[ $prompt_onward == *"$build_word"* ]]; then
72
+ is_build_word_found=0
73
+ break
74
+ fi
75
+ done
76
+ fi
49
77
  shopt -u nocasematch
50
- ((is_rejected_by_node == 0)) && return 1
51
- guardrail_fields_match prompt '(implement|build|add|create|write|fix|refactor|wire up|hook up|make|change the|conflict|merged|passing|green|[/$](muggle:)?(muggle-do|mdo))'
78
+ return "$is_build_word_found"
52
79
  }
53
80
 
54
81
  if guardrail_is_hook_script; then
@@ -10,8 +10,8 @@ set -uo pipefail
10
10
  # it fires on EVERY turn end, so the pre-filter has to be cheap. The claim lives
11
11
  # in the assistant's prose. A payload carrying the closing message
12
12
  # (`last_assistant_message` — Codex always sends it, Claude Code may) is
13
- # searched in-shell; otherwise the filter greps the transcript tail for an
14
- # impossibility word in-shell and spawns Node only on a hit. Node then applies
13
+ # searched in-shell; otherwise the filter greps the transcript tail for the
14
+ # detector's three word groups in-shell and spawns Node only on a hit. Node then applies
15
15
  # the real per-sentence detector, which is what keeps a genuine SMS/TOTP limit
16
16
  # from being "corrected". Over-matching here costs a needless spawn; it can
17
17
  # never emit a spurious nudge. Degrades to {} so it never blocks on its own
@@ -23,14 +23,30 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
23
23
 
24
24
  GUARDRAIL_SUBCOMMAND="capability-claim-gate"
25
25
 
26
+ # Whether the text holds all three word groups detectFalseCapabilityClaim needs in one sentence:
27
+ # an impossibility, a flow a managed profile clears, and a testing context. Each is a superset of
28
+ # its capabilityClaim.ts pattern, matched anywhere in the text, so it never drops a claim Node
29
+ # would catch. An impossibility word alone hits most turn ends, which say "can't" about anything.
30
+ # The apostrophe slot takes a curly quote as UTF-8 bytes or as the backslash-u2019 escape JSON may carry.
31
+ capability_claim_text_could_match() {
32
+ local text="$1"
33
+ local impossibility_pattern='can(.{1,3}|\\u2019)t|could ?n(.{1,3}|\\u2019)?t|unable to|no way to|not able to|untestable|unverifiable|not testable|impossible|infeasible|blocked from|no (local )?(mail|email|smtp) path'
34
+ local cleared_flow_pattern='link|otp|code|password|verif|2fa|factor|inbox|mail|smtp|captcha|log ?in|logged|sign|auth|credential|sms|text|totp'
35
+ local testing_context_pattern='e2e|end.to.end|test|verif|validat|automat|coverage|covered|exercis|reproduc|replay|script|muggle|playwright|cypress|selenium'
36
+ local matched=1
37
+ shopt -s nocasematch
38
+ [[ $text =~ $impossibility_pattern && $text =~ $cleared_flow_pattern && $text =~ $testing_context_pattern ]] && matched=0
39
+ shopt -u nocasematch
40
+ return "$matched"
41
+ }
42
+
26
43
  guardrail_wants() {
27
44
  if guardrail_load_state && guardrail_state_has '"capabilityClaimNudged": true'; then
28
45
  return 1
29
46
  fi
30
- local claim_pattern='can.t|cannot|unable to|no way to|untestable|unverifiable|impossible|infeasible'
31
47
  local closing_message_pattern='"last_assistant_message"[[:space:]]*:[[:space:]]*"'
32
48
  if [[ $GUARDRAIL_PAYLOAD =~ $closing_message_pattern ]]; then
33
- guardrail_payload_matches "$claim_pattern"
49
+ capability_claim_text_could_match "$GUARDRAIL_PAYLOAD"
34
50
  return
35
51
  fi
36
52
  local transcript_pattern='"transcript_path"[[:space:]]*:[[:space:]]*"([^"]*)"'
@@ -42,11 +58,7 @@ guardrail_wants() {
42
58
  # in-shell costs more than a tail. Gone for the session once the gate has nudged.
43
59
  local transcript_tail
44
60
  transcript_tail="$(tail -c 20000 "$transcript" 2>/dev/null)"
45
- local matched=1
46
- shopt -s nocasematch
47
- [[ $transcript_tail =~ $claim_pattern ]] && matched=0
48
- shopt -u nocasematch
49
- return "$matched"
61
+ capability_claim_text_could_match "$transcript_tail"
50
62
  }
51
63
 
52
64
  if guardrail_is_hook_script; then
@@ -21,7 +21,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
21
21
  GUARDRAIL_SUBCOMMAND="classify-gate"
22
22
 
23
23
  guardrail_wants() {
24
- guardrail_payload_matches 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
24
+ guardrail_fields_match tool_name 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
25
25
  }
26
26
 
27
27
  if guardrail_is_hook_script; then
@@ -18,7 +18,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
18
18
  GUARDRAIL_SUBCOMMAND="pr-opened"
19
19
 
20
20
  guardrail_wants() {
21
- guardrail_payload_matches 'gh[[:space:]]+pr[[:space:]]+(create|ready)|glab[[:space:]]+mr[[:space:]]+(create|update)'
21
+ guardrail_fields_match command 'gh[[:space:]]+pr[[:space:]]+(create|ready)|glab[[:space:]]+mr[[:space:]]+(create|update)'
22
22
  }
23
23
 
24
24
  if guardrail_is_hook_script; then
@@ -14,6 +14,12 @@ set -uo pipefail
14
14
  # dropped it a close+reopen — routine, to re-fire a lost workflow trigger — left
15
15
  # the handoff armed on a change that is open again. Degrades to {} so it never
16
16
  # blocks.
17
+ #
18
+ # The output shapes are searched across the whole payload, which carries the
19
+ # command's full output, so the command is checked first: detectPrTerminal only
20
+ # reads the output of a merge, close or reopen, or of the watch scripts, and a
21
+ # payload with no command at all is left to it. Every other command ends here
22
+ # before its output is scanned.
17
23
 
18
24
  guardrail_script_dir="${BASH_SOURCE[0]%/*}"
19
25
  [[ $guardrail_script_dir == "${BASH_SOURCE[0]}" ]] && guardrail_script_dir=.
@@ -22,6 +28,14 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
22
28
  GUARDRAIL_SUBCOMMAND="pr-terminal"
23
29
 
24
30
  guardrail_wants() {
31
+ if guardrail_payload_field command; then
32
+ local terminal_command_pattern='(gh|glab)[[:space:]]+(pr|mr)[[:space:]]+(merge|close|reopen)|pr-watch-(loop|arm)\.sh'
33
+ local is_terminal_command=1
34
+ shopt -s nocasematch
35
+ [[ $GUARDRAIL_FIELD_VALUE =~ $terminal_command_pattern ]] && is_terminal_command=0
36
+ shopt -u nocasematch
37
+ ((is_terminal_command == 0)) || return 1
38
+ fi
25
39
  guardrail_payload_matches '(merged|closed|reopened) pull request|TERMINAL pr='
26
40
  }
27
41
 
@@ -25,7 +25,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
25
25
  GUARDRAIL_SUBCOMMAND="record-comment-replies"
26
26
 
27
27
  guardrail_wants() {
28
- guardrail_payload_matches 'reviewThreads|merge_requests/[0-9]+/discussions|comments/[0-9]+/replies|discussions/[A-Za-z0-9_-]+/notes|MUGGLE_[A-Z0-9_]+_SKIP'
28
+ guardrail_fields_match command 'reviewThreads|merge_requests/[0-9]+/discussions|comments/[0-9]+/replies|discussions/[A-Za-z0-9_-]+/notes|MUGGLE_[A-Z0-9_]+_SKIP'
29
29
  }
30
30
 
31
31
  if guardrail_is_hook_script; then
@@ -17,7 +17,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
17
17
  GUARDRAIL_SUBCOMMAND="record-delegation"
18
18
 
19
19
  guardrail_wants() {
20
- guardrail_payload_matches 'acceptance-tester'
20
+ guardrail_fields_match subagent_type 'acceptance-tester'
21
21
  }
22
22
 
23
23
  if guardrail_is_hook_script; then
@@ -20,7 +20,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
20
20
  GUARDRAIL_SUBCOMMAND="record-stage-signals"
21
21
 
22
22
  guardrail_wants() {
23
- guardrail_payload_matches 'MUGGLE_[A-Z0-9_]+_SKIP|muggle.*(telemetry[-_]event[-_]emit|user[-_]feedback[-_]create)'
23
+ guardrail_fields_match command tool_name 'MUGGLE_[A-Z0-9_]+_SKIP|muggle.*(telemetry[-_]event[-_]emit|user[-_]feedback[-_]create)'
24
24
  }
25
25
 
26
26
  if guardrail_is_hook_script; then
@@ -24,7 +24,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
24
24
  GUARDRAIL_SUBCOMMAND="report-gate"
25
25
 
26
26
  guardrail_wants() {
27
- guardrail_payload_matches 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
27
+ guardrail_fields_match command 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
28
28
  }
29
29
 
30
30
  if guardrail_is_hook_script; then
@@ -19,7 +19,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
19
19
  GUARDRAIL_SUBCOMMAND="resolve-gate"
20
20
 
21
21
  guardrail_wants() {
22
- guardrail_payload_matches 'resolveReviewThread|resolved=(true|false)'
22
+ guardrail_fields_match command 'resolveReviewThread|resolved=(true|false)'
23
23
  }
24
24
 
25
25
  if guardrail_is_hook_script; then
@@ -21,7 +21,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
21
21
  GUARDRAIL_SUBCOMMAND="walkthrough-heading-gate"
22
22
 
23
23
  guardrail_wants() {
24
- guardrail_payload_matches 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
24
+ guardrail_fields_match command 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
25
25
  }
26
26
 
27
27
  if guardrail_is_hook_script; then
@@ -18,7 +18,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
18
18
  GUARDRAIL_SUBCOMMAND="walkthrough-progress-update"
19
19
 
20
20
  guardrail_wants() {
21
- guardrail_payload_matches 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
21
+ guardrail_fields_match tool_name 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
22
22
  }
23
23
 
24
24
  if guardrail_is_hook_script; then
@@ -18,7 +18,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
18
18
  GUARDRAIL_SUBCOMMAND="walkthrough-rerun-notice"
19
19
 
20
20
  guardrail_wants() {
21
- guardrail_payload_matches 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
21
+ guardrail_fields_match tool_name 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
22
22
  }
23
23
 
24
24
  if guardrail_is_hook_script; then
@@ -14,7 +14,7 @@ The caller resolves these before the loop and supplies them per test case:
14
14
  - `baseBranch` — the change's base, only when it is not the remote default (a stacked change, a PR into a release branch). Omitted, the tools check `cwd` against the remote default.
15
15
  - `testCase` / `cloudTestCaseId` / `projectId` — the cloud test case, its id and its project.
16
16
  - `showUi` — from the caller's `showElectronBrowser` resolution: omit for visible, `false` for headless.
17
- - `lightMode` — `true` only when the user asks for Light mode (faster, lower-cost model, Claude Sonnet 5.5); omit otherwise.
17
+ - `lightMode` — `true` only when the user asks for the Standard tier (Claude Sonnet 5.5, faster and lower cost), whether they call it Standard, light, faster or cheaper; omit otherwise, which runs the Premium tier (Claude Opus 5.5, the default).
18
18
 
19
19
  The tool boundary is fixed: cloud reads (`muggle-remote-*`) resolve definitions and scripts; local tools (`muggle-local-*`) run the browser, fetch results, and publish.
20
20
 
@@ -1,7 +1,7 @@
1
1
  {
2
- "release": "5.35.0-staging.328",
3
- "buildId": "run-328-1",
4
- "commitSha": "3162d721a3d25f687ab53afb59245c9bf9c41746",
5
- "buildTime": "2026-11-10T23:25:16Z",
2
+ "release": "5.35.0-staging.330",
3
+ "buildId": "run-330-1",
4
+ "commitSha": "9e9e21ceb30371ab267c84fd62346a0ae9858ce8",
5
+ "buildTime": "2026-11-11T03:01:40Z",
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_CHECKSUMS_ASSET_NAME, 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-JK62L5EO.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_CHECKSUMS_ASSET_NAME, 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-3MGYJFPU.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.35.0-staging.328",
4
+ "version": "5.35.0-staging.330",
5
5
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
@@ -66,21 +66,21 @@
66
66
  "typecheck:browser-bench": "tsc --noEmit -p internal/browser-bench/tsconfig.json"
67
67
  },
68
68
  "muggleConfig": {
69
- "electronAppVersion": "1.24.13",
69
+ "electronAppVersion": "1.24.16",
70
70
  "downloadBaseUrl": "https://github.com/multiplex-ai/muggle-ai-works/releases/download",
71
71
  "runtimeTargetDefault": "staging",
72
72
  "checksumsByStream": {
73
73
  "production": {
74
- "win32-x64": "a194f436b0ce5bb64aebe3330b28da58a8aeaa1e8b47bef5df9950b1c9066355",
75
- "linux-x64": "0bd2640042a6115f5e736fe3318b8e32f95a061ea3ee358ce98323adcd3f9772",
76
- "darwin-arm64": "61094420812cf01295f770d39b1744060f2b81365ba7d5886ed81ca84e92c40d",
77
- "darwin-x64": "87c13b5642dd0cd338eca667bfca812d565a3cd6883b519a6896bcae0884df5f"
74
+ "win32-x64": "9645ed8e777fada8893c9f61abc1cdad827808385a68a462c4c087c02dcbaea0",
75
+ "linux-x64": "7067dc5b8fc805c72f615237c6a91f9b5b39381f1b39ce24618b67b2d38fbfe3",
76
+ "darwin-arm64": "19389b118394f576ae206737a129f797b386cd8d138f2f4d58e0ad121e89a174",
77
+ "darwin-x64": "258a27c4474bd875b441d432f1c5d992b1ce485f72a1ac4849e4dd3af1fa2c4f"
78
78
  },
79
79
  "staging": {
80
- "darwin-arm64": "e826af755072e2b068c93250ebd35d45d8929f1a9cf747ec3df56893a92d6d58",
81
- "linux-x64": "092d108de6d39719bcd32d40731abc9712b683f061bf054d6894f599f56bc7b2",
82
- "win32-x64": "08d48826f7b34a496a5b30a6e801410d27da006cfb59c4734016907d72b23fad",
83
- "darwin-x64": "0f14fd6f2cbd88fc29d5a249534eac272ecd28cfcf0fdcf402e658e39aa28a19"
80
+ "darwin-arm64": "2c408bae15a83eb1ddf2946fa82c1108ec9cdb918753f539e66c0fddbb0d3091",
81
+ "linux-x64": "5fe31d7544c2b89714730afe583ceaf1365247496815757a3c6fd7d4703ac8a7",
82
+ "win32-x64": "28ba946a81e4bc1aa70aa3597bfa102c54ff006d4b787e5ea4710db7e26b7764",
83
+ "darwin-x64": "87806b5ca988aeb4cce35a12ae7d1e79a6b8387ee5bf24d0af64fd08d32ee98a"
84
84
  }
85
85
  },
86
86
  "electronAppSignedFromVersion": "1.10.0",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "muggle",
3
3
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
4
- "version": "5.35.0-staging.328",
4
+ "version": "5.35.0-staging.330",
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.35.0-staging.328",
7
+ "@muggleai/works@5.35.0-staging.330",
8
8
  "serve"
9
9
  ],
10
10
  "env": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muggle",
3
- "version": "5.35.0-staging.328",
3
+ "version": "5.35.0-staging.330",
4
4
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
5
5
  "author": {
6
6
  "name": "Muggle AI",
@@ -2,7 +2,7 @@
2
2
  "name": "muggle",
3
3
  "displayName": "Muggle AI",
4
4
  "description": "Acceptance test agent for coding agents: real-browser tests, with screenshots on the PR.",
5
- "version": "5.35.0-staging.328",
5
+ "version": "5.35.0-staging.330",
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.35.0-staging.328",
7
+ "@muggleai/works@5.35.0-staging.330",
8
8
  "serve"
9
9
  ]
10
10
  }
@@ -21,6 +21,13 @@ set -uo pipefail
21
21
  # never fire again, so its state flag ends the check in-shell. detectBuildIntent
22
22
  # drops a question or a slash command whatever verbs it holds, so those end here
23
23
  # too, except a /muggle-do or /mdo command, which Node must see to arm the gate.
24
+ #
25
+ # A pasted log makes the prompt hundreds of KB, and capturing it with a regex costs
26
+ # about 1.5 ms per KB, so the prompt is never extracted. The payload is cut at its
27
+ # "prompt" key, which a string value cannot spell unescaped, and the question and
28
+ # slash checks read only the head of what follows while the verbs are glob
29
+ # substring tests, several times cheaper than one alternation regex. Whatever
30
+ # follows the prompt in the payload is searched too, which only over-matches.
24
31
 
25
32
  guardrail_script_dir="${BASH_SOURCE[0]%/*}"
26
33
  [[ $guardrail_script_dir == "${BASH_SOURCE[0]}" ]] && guardrail_script_dir=.
@@ -28,27 +35,47 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
28
35
 
29
36
  GUARDRAIL_SUBCOMMAND="build-router"
30
37
 
38
+ # Matched case-insensitively as substrings, so "muggle-do" and "mdo" cover every
39
+ # /muggle-do, /muggle:mdo and $mdo spelling.
40
+ BUILD_ROUTER_WORDS=(implement build add create write fix refactor "wire up" "hook up" make "change the" conflict merged passing green muggle-do mdo)
41
+
31
42
  guardrail_wants() {
32
43
  if guardrail_load_state && guardrail_state_has '"buildIntentRouted": true'; then
33
44
  return 1
34
45
  fi
35
- guardrail_payload_field prompt || return 1
46
+ local prompt_key='"prompt"'
47
+ [[ $GUARDRAIL_PAYLOAD == *"$prompt_key"* ]] || return 1
48
+ local prompt_onward="${GUARDRAIL_PAYLOAD#*"$prompt_key"}"
49
+ local value_opening_pattern='^[[:space:]]*:[[:space:]]*"'
50
+ [[ ${prompt_onward:0:64} =~ $value_opening_pattern ]] || return 1
51
+ prompt_onward="${prompt_onward:${#BASH_REMATCH[0]}}"
52
+ local prompt_head="${prompt_onward:0:256}"
36
53
  # The prompt is still JSON-escaped: an escaped newline, return or tab counts as leading
37
- # space, and any other escape leaves the prompt to Node.
54
+ # space, and any other escape leaves the prompt to Node. The value's closing quote ends
55
+ # a command name the way the end of the prompt does.
38
56
  local leading_space='^([[:space:]]|\\[nrt])*'
39
57
  local question_pattern="$leading_space"'(why|what|how|when|where|who|is|are|does|do|can you (explain|tell)|explain)([^A-Za-z0-9_]|$)'
40
58
  local slash_command_pattern="$leading_space"'/'
41
- local muggle_do_command_pattern="$leading_space"'/([A-Za-z0-9_-]+:)?(muggle-do|mdo)([[:space:]]|\\|$)'
59
+ local muggle_do_command_pattern="$leading_space"'/([A-Za-z0-9_-]+:)?(muggle-do|mdo)([[:space:]]|\\|"|$)'
42
60
  local is_rejected_by_node=1
43
61
  shopt -s nocasematch
44
- if [[ $GUARDRAIL_FIELD_VALUE =~ $question_pattern ]]; then
62
+ if [[ $prompt_head =~ $question_pattern ]]; then
45
63
  is_rejected_by_node=0
46
- elif [[ $GUARDRAIL_FIELD_VALUE =~ $slash_command_pattern && ! $GUARDRAIL_FIELD_VALUE =~ $muggle_do_command_pattern ]]; then
64
+ elif [[ $prompt_head =~ $slash_command_pattern && ! $prompt_head =~ $muggle_do_command_pattern ]]; then
47
65
  is_rejected_by_node=0
48
66
  fi
67
+ local is_build_word_found=1
68
+ if ((is_rejected_by_node == 1)); then
69
+ local build_word
70
+ for build_word in "${BUILD_ROUTER_WORDS[@]}"; do
71
+ if [[ $prompt_onward == *"$build_word"* ]]; then
72
+ is_build_word_found=0
73
+ break
74
+ fi
75
+ done
76
+ fi
49
77
  shopt -u nocasematch
50
- ((is_rejected_by_node == 0)) && return 1
51
- guardrail_fields_match prompt '(implement|build|add|create|write|fix|refactor|wire up|hook up|make|change the|conflict|merged|passing|green|[/$](muggle:)?(muggle-do|mdo))'
78
+ return "$is_build_word_found"
52
79
  }
53
80
 
54
81
  if guardrail_is_hook_script; then
@@ -10,8 +10,8 @@ set -uo pipefail
10
10
  # it fires on EVERY turn end, so the pre-filter has to be cheap. The claim lives
11
11
  # in the assistant's prose. A payload carrying the closing message
12
12
  # (`last_assistant_message` — Codex always sends it, Claude Code may) is
13
- # searched in-shell; otherwise the filter greps the transcript tail for an
14
- # impossibility word in-shell and spawns Node only on a hit. Node then applies
13
+ # searched in-shell; otherwise the filter greps the transcript tail for the
14
+ # detector's three word groups in-shell and spawns Node only on a hit. Node then applies
15
15
  # the real per-sentence detector, which is what keeps a genuine SMS/TOTP limit
16
16
  # from being "corrected". Over-matching here costs a needless spawn; it can
17
17
  # never emit a spurious nudge. Degrades to {} so it never blocks on its own
@@ -23,14 +23,30 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
23
23
 
24
24
  GUARDRAIL_SUBCOMMAND="capability-claim-gate"
25
25
 
26
+ # Whether the text holds all three word groups detectFalseCapabilityClaim needs in one sentence:
27
+ # an impossibility, a flow a managed profile clears, and a testing context. Each is a superset of
28
+ # its capabilityClaim.ts pattern, matched anywhere in the text, so it never drops a claim Node
29
+ # would catch. An impossibility word alone hits most turn ends, which say "can't" about anything.
30
+ # The apostrophe slot takes a curly quote as UTF-8 bytes or as the backslash-u2019 escape JSON may carry.
31
+ capability_claim_text_could_match() {
32
+ local text="$1"
33
+ local impossibility_pattern='can(.{1,3}|\\u2019)t|could ?n(.{1,3}|\\u2019)?t|unable to|no way to|not able to|untestable|unverifiable|not testable|impossible|infeasible|blocked from|no (local )?(mail|email|smtp) path'
34
+ local cleared_flow_pattern='link|otp|code|password|verif|2fa|factor|inbox|mail|smtp|captcha|log ?in|logged|sign|auth|credential|sms|text|totp'
35
+ local testing_context_pattern='e2e|end.to.end|test|verif|validat|automat|coverage|covered|exercis|reproduc|replay|script|muggle|playwright|cypress|selenium'
36
+ local matched=1
37
+ shopt -s nocasematch
38
+ [[ $text =~ $impossibility_pattern && $text =~ $cleared_flow_pattern && $text =~ $testing_context_pattern ]] && matched=0
39
+ shopt -u nocasematch
40
+ return "$matched"
41
+ }
42
+
26
43
  guardrail_wants() {
27
44
  if guardrail_load_state && guardrail_state_has '"capabilityClaimNudged": true'; then
28
45
  return 1
29
46
  fi
30
- local claim_pattern='can.t|cannot|unable to|no way to|untestable|unverifiable|impossible|infeasible'
31
47
  local closing_message_pattern='"last_assistant_message"[[:space:]]*:[[:space:]]*"'
32
48
  if [[ $GUARDRAIL_PAYLOAD =~ $closing_message_pattern ]]; then
33
- guardrail_payload_matches "$claim_pattern"
49
+ capability_claim_text_could_match "$GUARDRAIL_PAYLOAD"
34
50
  return
35
51
  fi
36
52
  local transcript_pattern='"transcript_path"[[:space:]]*:[[:space:]]*"([^"]*)"'
@@ -42,11 +58,7 @@ guardrail_wants() {
42
58
  # in-shell costs more than a tail. Gone for the session once the gate has nudged.
43
59
  local transcript_tail
44
60
  transcript_tail="$(tail -c 20000 "$transcript" 2>/dev/null)"
45
- local matched=1
46
- shopt -s nocasematch
47
- [[ $transcript_tail =~ $claim_pattern ]] && matched=0
48
- shopt -u nocasematch
49
- return "$matched"
61
+ capability_claim_text_could_match "$transcript_tail"
50
62
  }
51
63
 
52
64
  if guardrail_is_hook_script; then
@@ -21,7 +21,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
21
21
  GUARDRAIL_SUBCOMMAND="classify-gate"
22
22
 
23
23
  guardrail_wants() {
24
- guardrail_payload_matches 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
24
+ guardrail_fields_match tool_name 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
25
25
  }
26
26
 
27
27
  if guardrail_is_hook_script; then
@@ -18,7 +18,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
18
18
  GUARDRAIL_SUBCOMMAND="pr-opened"
19
19
 
20
20
  guardrail_wants() {
21
- guardrail_payload_matches 'gh[[:space:]]+pr[[:space:]]+(create|ready)|glab[[:space:]]+mr[[:space:]]+(create|update)'
21
+ guardrail_fields_match command 'gh[[:space:]]+pr[[:space:]]+(create|ready)|glab[[:space:]]+mr[[:space:]]+(create|update)'
22
22
  }
23
23
 
24
24
  if guardrail_is_hook_script; then
@@ -14,6 +14,12 @@ set -uo pipefail
14
14
  # dropped it a close+reopen — routine, to re-fire a lost workflow trigger — left
15
15
  # the handoff armed on a change that is open again. Degrades to {} so it never
16
16
  # blocks.
17
+ #
18
+ # The output shapes are searched across the whole payload, which carries the
19
+ # command's full output, so the command is checked first: detectPrTerminal only
20
+ # reads the output of a merge, close or reopen, or of the watch scripts, and a
21
+ # payload with no command at all is left to it. Every other command ends here
22
+ # before its output is scanned.
17
23
 
18
24
  guardrail_script_dir="${BASH_SOURCE[0]%/*}"
19
25
  [[ $guardrail_script_dir == "${BASH_SOURCE[0]}" ]] && guardrail_script_dir=.
@@ -22,6 +28,14 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
22
28
  GUARDRAIL_SUBCOMMAND="pr-terminal"
23
29
 
24
30
  guardrail_wants() {
31
+ if guardrail_payload_field command; then
32
+ local terminal_command_pattern='(gh|glab)[[:space:]]+(pr|mr)[[:space:]]+(merge|close|reopen)|pr-watch-(loop|arm)\.sh'
33
+ local is_terminal_command=1
34
+ shopt -s nocasematch
35
+ [[ $GUARDRAIL_FIELD_VALUE =~ $terminal_command_pattern ]] && is_terminal_command=0
36
+ shopt -u nocasematch
37
+ ((is_terminal_command == 0)) || return 1
38
+ fi
25
39
  guardrail_payload_matches '(merged|closed|reopened) pull request|TERMINAL pr='
26
40
  }
27
41
 
@@ -25,7 +25,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
25
25
  GUARDRAIL_SUBCOMMAND="record-comment-replies"
26
26
 
27
27
  guardrail_wants() {
28
- guardrail_payload_matches 'reviewThreads|merge_requests/[0-9]+/discussions|comments/[0-9]+/replies|discussions/[A-Za-z0-9_-]+/notes|MUGGLE_[A-Z0-9_]+_SKIP'
28
+ guardrail_fields_match command 'reviewThreads|merge_requests/[0-9]+/discussions|comments/[0-9]+/replies|discussions/[A-Za-z0-9_-]+/notes|MUGGLE_[A-Z0-9_]+_SKIP'
29
29
  }
30
30
 
31
31
  if guardrail_is_hook_script; then
@@ -17,7 +17,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
17
17
  GUARDRAIL_SUBCOMMAND="record-delegation"
18
18
 
19
19
  guardrail_wants() {
20
- guardrail_payload_matches 'acceptance-tester'
20
+ guardrail_fields_match subagent_type 'acceptance-tester'
21
21
  }
22
22
 
23
23
  if guardrail_is_hook_script; then
@@ -20,7 +20,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
20
20
  GUARDRAIL_SUBCOMMAND="record-stage-signals"
21
21
 
22
22
  guardrail_wants() {
23
- guardrail_payload_matches 'MUGGLE_[A-Z0-9_]+_SKIP|muggle.*(telemetry[-_]event[-_]emit|user[-_]feedback[-_]create)'
23
+ guardrail_fields_match command tool_name 'MUGGLE_[A-Z0-9_]+_SKIP|muggle.*(telemetry[-_]event[-_]emit|user[-_]feedback[-_]create)'
24
24
  }
25
25
 
26
26
  if guardrail_is_hook_script; then
@@ -24,7 +24,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
24
24
  GUARDRAIL_SUBCOMMAND="report-gate"
25
25
 
26
26
  guardrail_wants() {
27
- guardrail_payload_matches 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
27
+ guardrail_fields_match command 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
28
28
  }
29
29
 
30
30
  if guardrail_is_hook_script; then
@@ -19,7 +19,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
19
19
  GUARDRAIL_SUBCOMMAND="resolve-gate"
20
20
 
21
21
  guardrail_wants() {
22
- guardrail_payload_matches 'resolveReviewThread|resolved=(true|false)'
22
+ guardrail_fields_match command 'resolveReviewThread|resolved=(true|false)'
23
23
  }
24
24
 
25
25
  if guardrail_is_hook_script; then
@@ -21,7 +21,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
21
21
  GUARDRAIL_SUBCOMMAND="walkthrough-heading-gate"
22
22
 
23
23
  guardrail_wants() {
24
- guardrail_payload_matches 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
24
+ guardrail_fields_match command 'gh[[:space:]]+pr[[:space:]]+(comment|create|edit)|issues/comments/[0-9]'
25
25
  }
26
26
 
27
27
  if guardrail_is_hook_script; then
@@ -18,7 +18,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
18
18
  GUARDRAIL_SUBCOMMAND="walkthrough-progress-update"
19
19
 
20
20
  guardrail_wants() {
21
- guardrail_payload_matches 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
21
+ guardrail_fields_match tool_name 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
22
22
  }
23
23
 
24
24
  if guardrail_is_hook_script; then
@@ -18,7 +18,7 @@ guardrail_script_dir="${BASH_SOURCE[0]%/*}"
18
18
  GUARDRAIL_SUBCOMMAND="walkthrough-rerun-notice"
19
19
 
20
20
  guardrail_wants() {
21
- guardrail_payload_matches 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
21
+ guardrail_fields_match tool_name 'muggle[-_]local[-_](execute[-_]test[-_]generation|execute[-_]replay)'
22
22
  }
23
23
 
24
24
  if guardrail_is_hook_script; then
@@ -14,7 +14,7 @@ The caller resolves these before the loop and supplies them per test case:
14
14
  - `baseBranch` — the change's base, only when it is not the remote default (a stacked change, a PR into a release branch). Omitted, the tools check `cwd` against the remote default.
15
15
  - `testCase` / `cloudTestCaseId` / `projectId` — the cloud test case, its id and its project.
16
16
  - `showUi` — from the caller's `showElectronBrowser` resolution: omit for visible, `false` for headless.
17
- - `lightMode` — `true` only when the user asks for Light mode (faster, lower-cost model, Claude Sonnet 5.5); omit otherwise.
17
+ - `lightMode` — `true` only when the user asks for the Standard tier (Claude Sonnet 5.5, faster and lower cost), whether they call it Standard, light, faster or cheaper; omit otherwise, which runs the Premium tier (Claude Opus 5.5, the default).
18
18
 
19
19
  The tool boundary is fixed: cloud reads (`muggle-remote-*`) resolve definitions and scripts; local tools (`muggle-local-*`) run the browser, fetch results, and publish.
20
20