@muggleai/works 5.22.0-staging.153 → 5.22.0-staging.155
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.
- package/README.md +74 -17
- package/dist/{chunk-KHHZKYJX.js → chunk-6ROSBSNR.js} +104 -4
- package/dist/{chunk-7GF5CYNK.js → chunk-E3T2RN6R.js} +8 -0
- package/dist/cli.js +2 -2
- package/dist/index.js +2 -2
- package/dist/plugin/.claude-plugin/plugin.json +1 -1
- package/dist/plugin/.codex-mcp.json +55 -0
- package/dist/plugin/.codex-plugin/plugin.json +46 -0
- package/dist/plugin/.cursor-plugin/plugin.json +1 -1
- package/dist/plugin/README.md +15 -4
- package/dist/plugin/hooks/README.md +12 -0
- package/dist/plugin/hooks/codex-hooks.json +147 -0
- package/dist/plugin/hooks/hooks.json +1 -1
- package/dist/plugin/scripts/codex-hook-windows.mjs +81 -0
- package/dist/plugin/scripts/ensure-electron-app.sh +16 -1
- package/dist/plugin/scripts/guard-run.mjs +16 -7
- package/dist/plugin/scripts/guardrail-capability-claim.sh +10 -4
- package/dist/plugin/scripts/guardrail-classify-gate.sh +3 -2
- package/dist/plugin/scripts/guardrail-record-stage-read.sh +14 -9
- package/dist/plugin/scripts/guardrail-record-stage-signals.sh +1 -1
- package/dist/plugin/scripts/guardrail-record-tests.sh +1 -1
- package/dist/plugin/scripts/guardrails.mjs +234 -64
- package/dist/plugin/skills/CLAUDE.md +6 -0
- package/dist/plugin/skills/_shared/host-tool-equivalents.md +27 -0
- package/dist/plugin/skills/m/SKILL.md +1 -1
- package/dist/plugin/skills/m/agents/openai.yaml +7 -0
- package/dist/plugin/skills/mbt/SKILL.md +1 -1
- package/dist/plugin/skills/mbt/agents/openai.yaml +7 -0
- package/dist/plugin/skills/mdo/SKILL.md +1 -1
- package/dist/plugin/skills/mdo/agents/openai.yaml +7 -0
- package/dist/plugin/skills/mfeedback/SKILL.md +1 -1
- package/dist/plugin/skills/mfeedback/agents/openai.yaml +7 -0
- package/dist/plugin/skills/mimport/SKILL.md +1 -1
- package/dist/plugin/skills/mimport/agents/openai.yaml +7 -0
- package/dist/plugin/skills/mpr/SKILL.md +1 -1
- package/dist/plugin/skills/mpr/agents/openai.yaml +7 -0
- package/dist/plugin/skills/mprefs/SKILL.md +1 -1
- package/dist/plugin/skills/mprefs/agents/openai.yaml +7 -0
- package/dist/plugin/skills/mprfollowup/SKILL.md +1 -1
- package/dist/plugin/skills/mprfollowup/agents/openai.yaml +7 -0
- package/dist/plugin/skills/mregen/SKILL.md +1 -1
- package/dist/plugin/skills/mregen/agents/openai.yaml +7 -0
- package/dist/plugin/skills/mrepair/SKILL.md +1 -1
- package/dist/plugin/skills/mrepair/agents/openai.yaml +7 -0
- package/dist/plugin/skills/mstatus/SKILL.md +1 -1
- package/dist/plugin/skills/mstatus/agents/openai.yaml +7 -0
- package/dist/plugin/skills/mtest/SKILL.md +1 -1
- package/dist/plugin/skills/mtest/agents/openai.yaml +7 -0
- package/dist/plugin/skills/mtestlocal/SKILL.md +1 -1
- package/dist/plugin/skills/mtestlocal/agents/openai.yaml +7 -0
- package/dist/plugin/skills/mtestprep/SKILL.md +1 -1
- package/dist/plugin/skills/mtestprep/agents/openai.yaml +7 -0
- package/dist/plugin/skills/muggle/SKILL.md +2 -0
- package/dist/plugin/skills/muggle-browser-task/SKILL.md +2 -0
- package/dist/plugin/skills/muggle-do/SKILL.md +2 -0
- package/dist/plugin/skills/muggle-feedback/SKILL.md +2 -0
- package/dist/plugin/skills/muggle-pr-followup/SKILL.md +2 -0
- package/dist/plugin/skills/muggle-pr-visual-walkthrough/SKILL.md +43 -41
- package/dist/plugin/skills/muggle-preferences/SKILL.md +28 -26
- package/dist/plugin/skills/muggle-repair/SKILL.md +2 -0
- package/dist/plugin/skills/muggle-status/SKILL.md +2 -0
- package/dist/plugin/skills/muggle-test/SKILL.md +2 -0
- package/dist/plugin/skills/muggle-test-feature-local/SKILL.md +2 -0
- package/dist/plugin/skills/muggle-test-import/SKILL.md +2 -0
- package/dist/plugin/skills/muggle-test-prepare/SKILL.md +145 -143
- package/dist/plugin/skills/muggle-test-regenerate-missing/SKILL.md +2 -0
- package/dist/plugin/skills/muggle-upgrade/SKILL.md +2 -0
- package/dist/plugin/skills/mupgrade/SKILL.md +1 -1
- package/dist/plugin/skills/mupgrade/agents/openai.yaml +7 -0
- package/dist/release-manifest.json +3 -3
- package/dist/{src-VVWBQMWR.js → src-V245RV7L.js} +1 -1
- package/package.json +4 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/.codex-mcp.json +55 -0
- package/plugin/.codex-plugin/plugin.json +46 -0
- package/plugin/.cursor-plugin/plugin.json +1 -1
- package/plugin/README.md +15 -4
- package/plugin/hooks/README.md +12 -0
- package/plugin/hooks/codex-hooks.json +147 -0
- package/plugin/hooks/hooks.json +1 -1
- package/plugin/scripts/codex-hook-windows.mjs +81 -0
- package/plugin/scripts/ensure-electron-app.sh +16 -1
- package/plugin/scripts/guard-run.mjs +16 -7
- package/plugin/scripts/guardrail-capability-claim.sh +10 -4
- package/plugin/scripts/guardrail-classify-gate.sh +3 -2
- package/plugin/scripts/guardrail-record-stage-read.sh +14 -9
- package/plugin/scripts/guardrail-record-stage-signals.sh +1 -1
- package/plugin/scripts/guardrail-record-tests.sh +1 -1
- package/plugin/scripts/guardrails.mjs +234 -64
- package/plugin/skills/CLAUDE.md +6 -0
- package/plugin/skills/_shared/host-tool-equivalents.md +27 -0
- package/plugin/skills/m/SKILL.md +1 -1
- package/plugin/skills/m/agents/openai.yaml +7 -0
- package/plugin/skills/mbt/SKILL.md +1 -1
- package/plugin/skills/mbt/agents/openai.yaml +7 -0
- package/plugin/skills/mdo/SKILL.md +1 -1
- package/plugin/skills/mdo/agents/openai.yaml +7 -0
- package/plugin/skills/mfeedback/SKILL.md +1 -1
- package/plugin/skills/mfeedback/agents/openai.yaml +7 -0
- package/plugin/skills/mimport/SKILL.md +1 -1
- package/plugin/skills/mimport/agents/openai.yaml +7 -0
- package/plugin/skills/mpr/SKILL.md +1 -1
- package/plugin/skills/mpr/agents/openai.yaml +7 -0
- package/plugin/skills/mprefs/SKILL.md +1 -1
- package/plugin/skills/mprefs/agents/openai.yaml +7 -0
- package/plugin/skills/mprfollowup/SKILL.md +1 -1
- package/plugin/skills/mprfollowup/agents/openai.yaml +7 -0
- package/plugin/skills/mregen/SKILL.md +1 -1
- package/plugin/skills/mregen/agents/openai.yaml +7 -0
- package/plugin/skills/mrepair/SKILL.md +1 -1
- package/plugin/skills/mrepair/agents/openai.yaml +7 -0
- package/plugin/skills/mstatus/SKILL.md +1 -1
- package/plugin/skills/mstatus/agents/openai.yaml +7 -0
- package/plugin/skills/mtest/SKILL.md +1 -1
- package/plugin/skills/mtest/agents/openai.yaml +7 -0
- package/plugin/skills/mtestlocal/SKILL.md +1 -1
- package/plugin/skills/mtestlocal/agents/openai.yaml +7 -0
- package/plugin/skills/mtestprep/SKILL.md +1 -1
- package/plugin/skills/mtestprep/agents/openai.yaml +7 -0
- package/plugin/skills/muggle/SKILL.md +2 -0
- package/plugin/skills/muggle-browser-task/SKILL.md +2 -0
- package/plugin/skills/muggle-do/SKILL.md +2 -0
- package/plugin/skills/muggle-feedback/SKILL.md +2 -0
- package/plugin/skills/muggle-pr-followup/SKILL.md +2 -0
- package/plugin/skills/muggle-pr-visual-walkthrough/SKILL.md +43 -41
- package/plugin/skills/muggle-preferences/SKILL.md +28 -26
- package/plugin/skills/muggle-repair/SKILL.md +2 -0
- package/plugin/skills/muggle-status/SKILL.md +2 -0
- package/plugin/skills/muggle-test/SKILL.md +2 -0
- package/plugin/skills/muggle-test-feature-local/SKILL.md +2 -0
- package/plugin/skills/muggle-test-import/SKILL.md +2 -0
- package/plugin/skills/muggle-test-prepare/SKILL.md +145 -143
- package/plugin/skills/muggle-test-regenerate-missing/SKILL.md +2 -0
- package/plugin/skills/muggle-upgrade/SKILL.md +2 -0
- package/plugin/skills/mupgrade/SKILL.md +1 -1
- package/plugin/skills/mupgrade/agents/openai.yaml +7 -0
package/README.md
CHANGED
|
@@ -62,7 +62,16 @@ Stage 7 refuses to run until the Definition of Done holds. Stage 8 is dispatched
|
|
|
62
62
|
|
|
63
63
|
**Cursor** — `npm install -g @muggleai/works`. The postinstall writes `~/.cursor/mcp.json` and syncs the `muggle-*` skills into `~/.cursor/skills/`. Restart Cursor.
|
|
64
64
|
|
|
65
|
-
**Codex
|
|
65
|
+
**Codex** — full plugin: skills, MCP tools, and the guardrail hooks.
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
codex plugin marketplace add multiplex-ai/muggle-ai-works
|
|
69
|
+
codex plugin add muggle@muggle-works
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Restart Codex and trust the plugin's hooks when it asks (or later, in `/hooks`). Skills are invoked as `$muggle:<skill>` — `$muggle:muggle-do`, `$muggle:muggle-test` — or picked from `/skills`. See [Codex](#codex) for what differs.
|
|
73
|
+
|
|
74
|
+
**Windsurf, any other MCP client** — install the package as above, then register the server:
|
|
66
75
|
|
|
67
76
|
```json
|
|
68
77
|
{
|
|
@@ -87,8 +96,9 @@ muggle init
|
|
|
87
96
|
Explains how the harness works, saves your preferences, and offers to install the pull-request walkthrough check. Then confirm the install is healthy:
|
|
88
97
|
|
|
89
98
|
```
|
|
90
|
-
/mstatus
|
|
91
|
-
muggle
|
|
99
|
+
/mstatus # Claude Code
|
|
100
|
+
$muggle:muggle-status # Codex
|
|
101
|
+
muggle doctor # anywhere — also checks the Codex plugin or MCP entry
|
|
92
102
|
```
|
|
93
103
|
|
|
94
104
|
Broken? `/mrepair`, or `muggle setup --force`.
|
|
@@ -116,7 +126,7 @@ Authentication starts on the first protected call: a browser opens with a verifi
|
|
|
116
126
|
|
|
117
127
|
## Commands
|
|
118
128
|
|
|
119
|
-
Every skill has a short alias. Both spellings work in Claude Code.
|
|
129
|
+
Every skill has a short alias. Both spellings work in Claude Code. In Codex, mention the skill with `$`: `$muggle:muggle-do`, or the alias `$muggle:mdo`.
|
|
120
130
|
|
|
121
131
|
| Command | Alias | What it does |
|
|
122
132
|
| :------ | :---- | :----------- |
|
|
@@ -359,7 +369,7 @@ muggle --help
|
|
|
359
369
|
|
|
360
370
|
## Configuration
|
|
361
371
|
|
|
362
|
-
**Environment targeting.** Set `MUGGLE_MCP_PROMPT_SERVICE_TARGET` (`production` or `dev`) in the MCP server's `env` block. Mismatching it against the account you log in with is the usual cause of `unauthorized_client`.
|
|
372
|
+
**Environment targeting.** Set `MUGGLE_MCP_PROMPT_SERVICE_TARGET` (`production` or `dev`) in the MCP server's `env` block — in Codex, export it in your shell; the plugin forwards it. Mismatching it against the account you log in with is the usual cause of `unauthorized_client`.
|
|
363
373
|
|
|
364
374
|
**Multi-repo cycles.** Drop a `muggle-repos.json` in your working directory so a single request can span services:
|
|
365
375
|
|
|
@@ -372,19 +382,57 @@ muggle --help
|
|
|
372
382
|
|
|
373
383
|
**Preferences.** `/mprefs` (or `muggle init`) controls the gates — whether to use a worktree, rebase onto the base branch, run acceptance tests every cycle, open the PR automatically, and arm the watcher. Each gate takes `always`, `ask`, or `never`.
|
|
374
384
|
|
|
375
|
-
When installed as a Claude Code plugin, MCP configuration ships with the plugin (`plugin/.mcp.json`) — there is nothing to copy by hand.
|
|
385
|
+
When installed as a Claude Code plugin, MCP configuration ships with the plugin (`plugin/.mcp.json`; Codex reads `plugin/.codex-mcp.json`) — there is nothing to copy by hand.
|
|
376
386
|
|
|
377
387
|
---
|
|
378
388
|
|
|
379
389
|
## Client support
|
|
380
390
|
|
|
381
|
-
| Client | MCP tools |
|
|
382
|
-
| :----- | :-------- |
|
|
383
|
-
| **Claude Code** | Yes | Yes —
|
|
384
|
-
| **
|
|
385
|
-
| **
|
|
391
|
+
| Client | MCP tools | Skills | Guardrail hooks |
|
|
392
|
+
| :----- | :-------- | :----- | :-------------- |
|
|
393
|
+
| **Claude Code** | Yes | Yes — slash commands | Yes |
|
|
394
|
+
| **Codex** | Yes | Yes — `$muggle:<skill>` | Yes, once trusted |
|
|
395
|
+
| **Cursor** | Yes, auto-configured | Synced to `~/.cursor/skills/` | Advisory |
|
|
396
|
+
| **Windsurf, others** | Yes, via MCP config | No | No |
|
|
397
|
+
|
|
398
|
+
Slash commands are plugin-managed; update them with `/plugin update muggleai@muggle-works` (Claude Code) or `codex plugin marketplace upgrade muggle-works` (Codex).
|
|
399
|
+
|
|
400
|
+
### Codex
|
|
401
|
+
|
|
402
|
+
The Codex plugin ships the same skills, MCP server, and hooks as the Claude Code one, with what Codex needs written in rather than left to defaults:
|
|
403
|
+
|
|
404
|
+
- **Long local runs.** Codex cancels an MCP call after 60 seconds unless told otherwise, and a local browser run takes minutes. The plugin's server allows 30 minutes per call and two minutes to start.
|
|
405
|
+
- **Your environment.** Codex starts MCP servers with only `HOME`, `PATH` and the locale. The plugin forwards what the server reads — `MUGGLE_MCP_PROMPT_SERVICE_TARGET`, the `AUTH0_*` and service-URL overrides, `HTTPS_PROXY`/`NO_PROXY`, and on Linux the display variables the browser runner needs.
|
|
406
|
+
- **Claude Code tools in the skills.** Codex has no `AskUserQuestion`, `Skill` tool, or background monitor. Each skill points at [`_shared/host-tool-equivalents.md`](plugin/skills/_shared/host-tool-equivalents.md), which maps them to Codex, and the session-start hook names it too.
|
|
407
|
+
- **PR watching.** Codex cannot wake a session when a reviewer comments, so `$muggle:muggle-pr-followup` handles what is outstanding each time you run it rather than watching in the background.
|
|
408
|
+
- **Sandbox.** Codex's default sandbox blocks the network and writes outside the workspace, so `gh`/`glab` and state under `~/.muggle-ai/` ask for approval. To stop the prompts, allow both in `~/.codex/config.toml`:
|
|
409
|
+
|
|
410
|
+
```toml
|
|
411
|
+
[sandbox_workspace_write]
|
|
412
|
+
network_access = true
|
|
413
|
+
writable_roots = ["/absolute/path/to/home/.muggle-ai"]
|
|
414
|
+
```
|
|
415
|
+
- **Headless runs.** `codex exec` cannot ask you anything. It refuses every muggle MCP call ("requires approval, but approval policy is never"), and it runs only hooks you have already trusted. Trust the hooks once in the TUI (`/hooks`), and approve the muggle tools in `~/.codex/config.toml`:
|
|
386
416
|
|
|
387
|
-
|
|
417
|
+
```toml
|
|
418
|
+
[plugins."muggle@muggle-works".mcp_servers.muggle]
|
|
419
|
+
default_tools_approval_mode = "approve"
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
`--dangerously-bypass-hook-trust` skips the trust step for one run. It is meant for automation that already vets hook sources.
|
|
423
|
+
|
|
424
|
+
Registering only the MCP server, without the plugin? Keep the timeout, or local runs are cut off at a minute:
|
|
425
|
+
|
|
426
|
+
```toml
|
|
427
|
+
[mcp_servers.muggle]
|
|
428
|
+
command = "muggle"
|
|
429
|
+
args = ["serve"]
|
|
430
|
+
tool_timeout_sec = 1800
|
|
431
|
+
startup_timeout_sec = 120
|
|
432
|
+
env_vars = ["MUGGLE_MCP_PROMPT_SERVICE_TARGET"]
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
`muggle doctor` checks whichever of the two you set up.
|
|
388
436
|
|
|
389
437
|
---
|
|
390
438
|
|
|
@@ -413,7 +461,7 @@ muggle login
|
|
|
413
461
|
|
|
414
462
|
| Package | Purpose | Install |
|
|
415
463
|
| :------ | :------ | :------ |
|
|
416
|
-
| **Muggle Works** (this repo) | Delivery-cycle harness, MCP server, acceptance testing | `/plugin install muggleai@muggle-works` |
|
|
464
|
+
| **Muggle Works** (this repo) | Delivery-cycle harness, MCP server, acceptance testing | `/plugin install muggleai@muggle-works` · `codex plugin add muggle@muggle-works` |
|
|
417
465
|
| **[muggle-ai-teams](https://github.com/multiplex-ai/muggle-ai-teams)** | Agent orchestration, workflow steps, rules | `npm install @muggleai/teams` |
|
|
418
466
|
|
|
419
467
|
With both installed, muggle-ai-teams folds acceptance testing into each workflow step: test instructions written per slice at **Plan**, per-slice browser tests at **Build**, a full regression sweep at **Verify**, and results published and linked in the PR at **Ship**. Frontend slices get browser tests; backend-only slices are covered by unit tests, with the skip reasoned in writing.
|
|
@@ -444,14 +492,22 @@ pnpm run verify:upgrade-experience # Existing-user upgrade still works
|
|
|
444
492
|
pnpm run verify:electron-release-checksums
|
|
445
493
|
```
|
|
446
494
|
|
|
495
|
+
Codex has its own layers, from static contracts up to model-driven evals. See [docs/compatibility-strategy.md](docs/compatibility-strategy.md#codex):
|
|
496
|
+
|
|
497
|
+
```bash
|
|
498
|
+
CODEX_BIN=$(command -v codex) pnpm run test:codex # The plugin under the real Codex CLI, against a scripted model
|
|
499
|
+
```
|
|
500
|
+
|
|
447
501
|
### Repository layout
|
|
448
502
|
|
|
449
503
|
```
|
|
450
504
|
muggle-ai-works/
|
|
451
|
-
├── plugin/ # Claude Code plugin — source of truth
|
|
505
|
+
├── plugin/ # Claude Code, Codex and Cursor plugin — source of truth
|
|
452
506
|
│ ├── skills/ # Skill definitions (muggle-do, muggle-test, _shared/vcs, …)
|
|
453
|
-
│ ├── hooks/ # Session hooks
|
|
454
|
-
│
|
|
507
|
+
│ ├── hooks/ # Session hooks (codex-hooks.json is generated from hooks.json)
|
|
508
|
+
│ ├── .mcp.json # MCP server config
|
|
509
|
+
│ ├── .codex-mcp.json # The same server, with Codex's timeouts and env passthrough
|
|
510
|
+
│ └── .codex-plugin/ # Codex manifest
|
|
455
511
|
├── src/
|
|
456
512
|
│ ├── cli/ # CLI entrypoint
|
|
457
513
|
│ └── server/ # MCP server — tool registration, stdio transport
|
|
@@ -462,7 +518,8 @@ muggle-ai-works/
|
|
|
462
518
|
├── scripts/ # Build, verification, postinstall
|
|
463
519
|
├── config/compatibility/ # Surface contract baselines
|
|
464
520
|
├── internal/ # Maintainer-only skills (not published)
|
|
465
|
-
|
|
521
|
+
├── .claude-plugin/ # Marketplace catalog (Claude Code)
|
|
522
|
+
└── .agents/plugins/ # Marketplace catalog (Codex)
|
|
466
523
|
```
|
|
467
524
|
|
|
468
525
|
### Releases
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __export, getLogger, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, toolRequiresAuth, getCallerCredentials, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, buildElectronAppChecksumsUrl, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, OnboardingBlanketChoice, PreferenceKey } from './chunk-
|
|
1
|
+
import { __export, getLogger, getConfig, createChildLogger, buildElectronAppReleaseAssetUrl, getActiveRuntimeTarget, getAuthService, hasApiKey, getElectronAppVersion, getElectronAppDir, getPlatformKey, reconcileProjectPreferences, getDataDir, PREFERENCES_FILE_NAME, isFirstRun, writePreferences, DEFAULT_PREFERENCES, isElectronAppInstalled, getElectronAppChecksums, getChecksumForPlatform, getElectronAppSignedFromVersion, getReleaseSignerIdentityUri, verifyFileChecksum, calculateFileChecksum, initTelemetry, Surface, ServiceName, track, EventName, getQaTools, getLocalQaTools, performLogout, assertDeviceCodeClientProvisioned, performLogin, toolRequiresAuth, getCallerCredentials, getElectronAppReleaseTagPrefix, hasShownDisclosure, markDisclosureShown, getBundledElectronAppVersion, getElectronAppVersionSource, getCredentialsFilePath, buildElectronAppChecksumsUrl, __require, getDisclosureCopy, buildOnboardingPlan, applyOnboardingAnswers, needsOnboarding, readRunView, RunViewError, renderRunViewText, writeRunViewHtml, openBrowserUrl, OnboardingBlanketChoice, PreferenceKey } from './chunk-E3T2RN6R.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';
|
|
@@ -831,7 +831,7 @@ async function resolveGsScreenshotUrls(report, opts) {
|
|
|
831
831
|
if (gsUrls.length === 0) {
|
|
832
832
|
return report;
|
|
833
833
|
}
|
|
834
|
-
const mcps = await import('./src-
|
|
834
|
+
const mcps = await import('./src-V245RV7L.js');
|
|
835
835
|
const credentials = await mcps.getCallerCredentialsAsync();
|
|
836
836
|
if (!credentials.bearerToken && !credentials.apiKey) {
|
|
837
837
|
stderrWrite(
|
|
@@ -884,7 +884,7 @@ var withSentinel = (s) => s ? `${REPORT_SECTION_SENTINEL}
|
|
|
884
884
|
${s}` : s;
|
|
885
885
|
async function resolveDashboardBaseUrl(stderrWrite) {
|
|
886
886
|
try {
|
|
887
|
-
const mcps = await import('./src-
|
|
887
|
+
const mcps = await import('./src-V245RV7L.js');
|
|
888
888
|
return mcps.resolveActiveProfile().dashboardBaseUrl;
|
|
889
889
|
} catch (err) {
|
|
890
890
|
stderrWrite(
|
|
@@ -1360,6 +1360,85 @@ var logger3 = getLogger();
|
|
|
1360
1360
|
function getCursorMcpConfigPath() {
|
|
1361
1361
|
return join(homedir(), ".cursor", "mcp.json");
|
|
1362
1362
|
}
|
|
1363
|
+
var CODEX_PLUGIN_ID = "muggle@muggle-works";
|
|
1364
|
+
var CODEX_PLUGIN_CACHE_PATH_SEGMENTS = ["plugins", "cache", "muggle-works", "muggle"];
|
|
1365
|
+
var LONGEST_DOCUMENTED_LOCAL_RUN_SECONDS = 900;
|
|
1366
|
+
var CODEX_PLUGIN_INSTALL_COMMAND = "codex plugin marketplace add multiplex-ai/muggle-ai-works && codex plugin add muggle@muggle-works";
|
|
1367
|
+
function getCodexHomePath() {
|
|
1368
|
+
return process.env.CODEX_HOME || join(homedir(), ".codex");
|
|
1369
|
+
}
|
|
1370
|
+
function readTomlTable(toml, tableName) {
|
|
1371
|
+
const headerVariants = /* @__PURE__ */ new Set([tableName, tableName.replaceAll('"', "'")]);
|
|
1372
|
+
const lines = toml.split(/\r?\n/);
|
|
1373
|
+
const headerIndex = lines.findIndex((line) => {
|
|
1374
|
+
const header2 = /^\s*\[([^\]]+)\]\s*(?:#.*)?$/.exec(line)?.[1]?.trim();
|
|
1375
|
+
return header2 !== void 0 && headerVariants.has(header2);
|
|
1376
|
+
});
|
|
1377
|
+
if (headerIndex < 0) {
|
|
1378
|
+
return void 0;
|
|
1379
|
+
}
|
|
1380
|
+
const bodyLines = [];
|
|
1381
|
+
for (const line of lines.slice(headerIndex + 1)) {
|
|
1382
|
+
if (/^\s*\[/.test(line)) {
|
|
1383
|
+
break;
|
|
1384
|
+
}
|
|
1385
|
+
bodyLines.push(line);
|
|
1386
|
+
}
|
|
1387
|
+
return bodyLines.join("\n");
|
|
1388
|
+
}
|
|
1389
|
+
function validateCodexIntegration() {
|
|
1390
|
+
const codexHome = getCodexHomePath();
|
|
1391
|
+
if (!existsSync(codexHome)) {
|
|
1392
|
+
return { passed: true, description: "Codex not detected (skipped)" };
|
|
1393
|
+
}
|
|
1394
|
+
const configPath = join(codexHome, "config.toml");
|
|
1395
|
+
let config = "";
|
|
1396
|
+
if (existsSync(configPath)) {
|
|
1397
|
+
try {
|
|
1398
|
+
config = readFileSync(configPath, "utf-8");
|
|
1399
|
+
} catch (error) {
|
|
1400
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
1401
|
+
return {
|
|
1402
|
+
passed: false,
|
|
1403
|
+
description: `Could not read ${configPath}: ${errorMessage}`,
|
|
1404
|
+
suggestion: `Check the file's permissions, then re-run 'muggle doctor'`
|
|
1405
|
+
};
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
const pluginTable = readTomlTable(config, `plugins."${CODEX_PLUGIN_ID}"`);
|
|
1409
|
+
const mcpServerTable = readTomlTable(config, "mcp_servers.muggle") ?? readTomlTable(config, 'mcp_servers."muggle"');
|
|
1410
|
+
const pluginCached = existsSync(join(codexHome, ...CODEX_PLUGIN_CACHE_PATH_SEGMENTS));
|
|
1411
|
+
if (pluginTable !== void 0 && pluginCached) {
|
|
1412
|
+
if (/^\s*enabled\s*=\s*false\b/m.test(pluginTable)) {
|
|
1413
|
+
return {
|
|
1414
|
+
passed: false,
|
|
1415
|
+
description: `Plugin ${CODEX_PLUGIN_ID} is installed but disabled in ${configPath}`,
|
|
1416
|
+
suggestion: `Set enabled = true under [plugins."${CODEX_PLUGIN_ID}"] in ${configPath}, then restart Codex`
|
|
1417
|
+
};
|
|
1418
|
+
}
|
|
1419
|
+
const duplicateNote = mcpServerTable === void 0 ? "" : " \u2014 config.toml also registers [mcp_servers.muggle]; Codex keeps only one server by that name, so remove the hand-written entry";
|
|
1420
|
+
return { passed: true, description: `Plugin ${CODEX_PLUGIN_ID} installed and enabled${duplicateNote}` };
|
|
1421
|
+
}
|
|
1422
|
+
if (mcpServerTable !== void 0) {
|
|
1423
|
+
const toolTimeoutSeconds = Number(/^\s*tool_timeout_sec\s*=\s*([0-9.]+)/m.exec(mcpServerTable)?.[1] ?? 0);
|
|
1424
|
+
if (toolTimeoutSeconds <= LONGEST_DOCUMENTED_LOCAL_RUN_SECONDS) {
|
|
1425
|
+
return {
|
|
1426
|
+
passed: false,
|
|
1427
|
+
description: `[mcp_servers.muggle] in ${configPath} has tool_timeout_sec ${toolTimeoutSeconds || "unset (Codex default: 60)"}, so Codex cancels local browser runs before they finish`,
|
|
1428
|
+
suggestion: `Add tool_timeout_sec = 1800 under [mcp_servers.muggle], or install the plugin, which sets it: ${CODEX_PLUGIN_INSTALL_COMMAND}`
|
|
1429
|
+
};
|
|
1430
|
+
}
|
|
1431
|
+
return {
|
|
1432
|
+
passed: true,
|
|
1433
|
+
description: `MCP server registered in ${configPath} (MCP tools only; the plugin adds the skills and hooks)`
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
return {
|
|
1437
|
+
passed: false,
|
|
1438
|
+
description: `Codex found at ${codexHome}, but Muggle is not registered with it`,
|
|
1439
|
+
suggestion: `Install the plugin: ${CODEX_PLUGIN_INSTALL_COMMAND}`
|
|
1440
|
+
};
|
|
1441
|
+
}
|
|
1363
1442
|
function getExpectedExecutablePath(versionDir) {
|
|
1364
1443
|
const os = platform();
|
|
1365
1444
|
switch (os) {
|
|
@@ -1586,6 +1665,13 @@ function runDiagnostics() {
|
|
|
1586
1665
|
description: cursorMcpConfigValidationResult.description,
|
|
1587
1666
|
suggestion: "Run 'muggle setup' to configure ~/.cursor/mcp.json"
|
|
1588
1667
|
});
|
|
1668
|
+
const codexIntegrationResult = validateCodexIntegration();
|
|
1669
|
+
results.push({
|
|
1670
|
+
name: "Codex Integration",
|
|
1671
|
+
passed: codexIntegrationResult.passed,
|
|
1672
|
+
description: codexIntegrationResult.description,
|
|
1673
|
+
suggestion: codexIntegrationResult.suggestion
|
|
1674
|
+
});
|
|
1589
1675
|
return results;
|
|
1590
1676
|
}
|
|
1591
1677
|
function formatCheckResult(result) {
|
|
@@ -1676,6 +1762,19 @@ function getHelpGuidance() {
|
|
|
1676
1762
|
` }`,
|
|
1677
1763
|
` ${colorize("}", COLORS.dim)}`,
|
|
1678
1764
|
"",
|
|
1765
|
+
` For ${colorize("Codex", COLORS.bold)}, install the plugin (skills, MCP tools, and hooks):`,
|
|
1766
|
+
"",
|
|
1767
|
+
` ${cmd("codex plugin marketplace add multiplex-ai/muggle-ai-works")}`,
|
|
1768
|
+
` ${cmd("codex plugin add muggle@muggle-works")}`,
|
|
1769
|
+
"",
|
|
1770
|
+
` then trust its hooks when Codex asks (or in ${cmd("/hooks")}). To register only the MCP server,`,
|
|
1771
|
+
` add this to ${path3("~/.codex/config.toml")} \u2014 local runs take minutes, so keep the timeout:`,
|
|
1772
|
+
"",
|
|
1773
|
+
` ${colorize("[mcp_servers.muggle]", COLORS.yellow)}`,
|
|
1774
|
+
` ${colorize("command", COLORS.yellow)} = ${colorize('"muggle"', COLORS.green)}`,
|
|
1775
|
+
` ${colorize("args", COLORS.yellow)} = [${colorize('"serve"', COLORS.green)}]`,
|
|
1776
|
+
` ${colorize("tool_timeout_sec", COLORS.yellow)} = ${colorize("1800", COLORS.green)}`,
|
|
1777
|
+
"",
|
|
1679
1778
|
` ${colorize("Step 2:", COLORS.bold)} Restart your MCP client`,
|
|
1680
1779
|
"",
|
|
1681
1780
|
` ${colorize("Step 3:", COLORS.bold)} Start testing! Ask your AI assistant:`,
|
|
@@ -2090,7 +2189,8 @@ var defaultGhRunner = (args, input) => {
|
|
|
2090
2189
|
encoding: "utf-8",
|
|
2091
2190
|
input,
|
|
2092
2191
|
timeout: GH_COMMENT_TIMEOUT_MS,
|
|
2093
|
-
stdio: ["pipe", "pipe", "ignore"]
|
|
2192
|
+
stdio: ["pipe", "pipe", "ignore"],
|
|
2193
|
+
windowsHide: true
|
|
2094
2194
|
});
|
|
2095
2195
|
} catch {
|
|
2096
2196
|
return null;
|
|
@@ -5094,7 +5094,15 @@ var GatewayError = class extends Error {
|
|
|
5094
5094
|
};
|
|
5095
5095
|
|
|
5096
5096
|
// packages/mcps/src/shared/host_detection.ts
|
|
5097
|
+
var MCP_HOST_ENV_VAR = "MUGGLE_MCP_HOST";
|
|
5098
|
+
var STAMPABLE_MCP_HOSTS = ["claude-code", "cursor", "codex", "windsurf"];
|
|
5097
5099
|
function detectMcpHost(env = process.env) {
|
|
5100
|
+
const stampedHost = STAMPABLE_MCP_HOSTS.find(
|
|
5101
|
+
(host) => host === env[MCP_HOST_ENV_VAR]?.trim().toLowerCase()
|
|
5102
|
+
);
|
|
5103
|
+
if (stampedHost) {
|
|
5104
|
+
return stampedHost;
|
|
5105
|
+
}
|
|
5098
5106
|
if (env.CLAUDE_CODE || env.CLAUDECODE || env.CLAUDE_CODE_SSE_PORT) {
|
|
5099
5107
|
return "claude-code";
|
|
5100
5108
|
}
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-
|
|
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-
|
|
1
|
+
export { src_exports as commands, createUnifiedMcpServer, server_exports as server } from './chunk-6ROSBSNR.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-E3T2RN6R.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.22.0-staging.
|
|
4
|
+
"version": "5.22.0-staging.155",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Muggle AI",
|
|
7
7
|
"email": "support@muggle-ai.com"
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"muggle": {
|
|
4
|
+
"command": "npx",
|
|
5
|
+
"args": [
|
|
6
|
+
"-y",
|
|
7
|
+
"@muggleai/works",
|
|
8
|
+
"serve"
|
|
9
|
+
],
|
|
10
|
+
"env": {
|
|
11
|
+
"MUGGLE_MCP_HOST": "codex"
|
|
12
|
+
},
|
|
13
|
+
"env_vars": [
|
|
14
|
+
"MUGGLE_MCP_PROMPT_SERVICE_TARGET",
|
|
15
|
+
"ELECTRON_APP_PATH",
|
|
16
|
+
"ELECTRON_APP_VERSION",
|
|
17
|
+
"PROMPT_SERVICE_BASE_URL",
|
|
18
|
+
"WEB_SERVICE_URL",
|
|
19
|
+
"WEB_SERVICE_PATH",
|
|
20
|
+
"AUTH0_DOMAIN",
|
|
21
|
+
"AUTH0_CLIENT_ID",
|
|
22
|
+
"AUTH0_AUDIENCE",
|
|
23
|
+
"AUTH0_SCOPE",
|
|
24
|
+
"REQUEST_TIMEOUT_MS",
|
|
25
|
+
"WORKFLOW_TIMEOUT_MS",
|
|
26
|
+
"LOG_LEVEL",
|
|
27
|
+
"MUGGLE_TELEMETRY_DISABLED",
|
|
28
|
+
"MUGGLE_LLM_PROVIDER",
|
|
29
|
+
"MUGGLE_LLM_BASE_URL",
|
|
30
|
+
"MUGGLE_LLM_API_KEY",
|
|
31
|
+
"MUGGLE_LLM_MODEL",
|
|
32
|
+
"MUGGLE_LLM_MODEL_PREDICTION",
|
|
33
|
+
"MUGGLE_LLM_MODEL_SUMMARIZER",
|
|
34
|
+
"MUGGLE_LLM_MODEL_EVAL",
|
|
35
|
+
"MUGGLE_LLM_MAX_TOKENS",
|
|
36
|
+
"MUGGLE_LLM_TEMPERATURE",
|
|
37
|
+
"MUGGLE_LLM_TOP_P",
|
|
38
|
+
"MUGGLE_LLM_TIMEOUT_MS",
|
|
39
|
+
"HTTPS_PROXY",
|
|
40
|
+
"HTTP_PROXY",
|
|
41
|
+
"NO_PROXY",
|
|
42
|
+
"https_proxy",
|
|
43
|
+
"http_proxy",
|
|
44
|
+
"no_proxy",
|
|
45
|
+
"DISPLAY",
|
|
46
|
+
"WAYLAND_DISPLAY",
|
|
47
|
+
"XAUTHORITY",
|
|
48
|
+
"XDG_RUNTIME_DIR",
|
|
49
|
+
"DBUS_SESSION_BUS_ADDRESS"
|
|
50
|
+
],
|
|
51
|
+
"startup_timeout_sec": 120,
|
|
52
|
+
"tool_timeout_sec": 1800
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "muggle",
|
|
3
|
+
"version": "5.22.0-staging.155",
|
|
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
|
+
"author": {
|
|
6
|
+
"name": "Muggle AI",
|
|
7
|
+
"email": "support@muggle-ai.com"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://www.muggletest.com",
|
|
10
|
+
"repository": "https://github.com/multiplex-ai/muggle-ai-works",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"keywords": [
|
|
13
|
+
"acceptance-testing",
|
|
14
|
+
"testing",
|
|
15
|
+
"mcp",
|
|
16
|
+
"browser-automation",
|
|
17
|
+
"ai-coding",
|
|
18
|
+
"muggle-ai",
|
|
19
|
+
"ui-validation",
|
|
20
|
+
"regression-testing",
|
|
21
|
+
"e2e-testing",
|
|
22
|
+
"ux-testing",
|
|
23
|
+
"visual-testing",
|
|
24
|
+
"frontend-testing"
|
|
25
|
+
],
|
|
26
|
+
"skills": "./skills",
|
|
27
|
+
"mcpServers": "./.codex-mcp.json",
|
|
28
|
+
"hooks": "./hooks/codex-hooks.json",
|
|
29
|
+
"interface": {
|
|
30
|
+
"displayName": "Muggle AI",
|
|
31
|
+
"shortDescription": "Real-browser E2E acceptance tests and PR walkthroughs",
|
|
32
|
+
"longDescription": "Muggle Works is the harness around your coding agent: it freezes requirements, builds the change, runs the unit suite, drives a real browser through the user flows the diff can break, and opens the pull request with step-by-step screenshots attached. Managed test identities carry live inboxes, so magic links, emailed OTPs and password resets are testable end to end.",
|
|
33
|
+
"developerName": "Muggle AI",
|
|
34
|
+
"category": "Developer Tools",
|
|
35
|
+
"capabilities": [
|
|
36
|
+
"Read",
|
|
37
|
+
"Write"
|
|
38
|
+
],
|
|
39
|
+
"websiteURL": "https://www.muggletest.com",
|
|
40
|
+
"defaultPrompt": [
|
|
41
|
+
"Use $muggle:muggle-test to test the user flows my changes affect",
|
|
42
|
+
"Use $muggle:muggle-do to build this and open a PR with browser proof",
|
|
43
|
+
"Use $muggle:muggle-status to check my Muggle AI installation"
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -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.22.0-staging.
|
|
5
|
+
"version": "5.22.0-staging.155",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Muggle AI",
|
|
8
8
|
"email": "support@muggle-ai.com"
|
package/dist/plugin/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Muggle AI Plugin for Claude Code
|
|
1
|
+
# Muggle AI Plugin for Claude Code and Codex
|
|
2
2
|
|
|
3
3
|
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
4
|
|
|
@@ -9,6 +9,15 @@ Real-browser E2E acceptance for your coding agent: test the flows you changed an
|
|
|
9
9
|
/plugin install muggleai@muggle-works
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
+
For Codex:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
codex plugin marketplace add multiplex-ai/muggle-ai-works
|
|
16
|
+
codex plugin add muggle@muggle-works
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Codex reads `.codex-plugin/plugin.json`, which points it at the same skills, at `.codex-mcp.json` (the MCP server with Codex's tool timeout and environment passthrough), and at `hooks/codex-hooks.json` (generated from `hooks/hooks.json`). Trust the hooks when Codex asks; `/hooks` manages them later.
|
|
20
|
+
|
|
12
21
|
For npm installs:
|
|
13
22
|
|
|
14
23
|
```bash
|
|
@@ -39,7 +48,7 @@ Type `muggle` to discover the full command family.
|
|
|
39
48
|
| `/muggle:muggle-repair` | `/mrepair` | Diagnose and fix broken installation automatically. |
|
|
40
49
|
| `/muggle:muggle-upgrade` | `/mupgrade` | Update Electron browser test runner and MCP server to latest version. |
|
|
41
50
|
|
|
42
|
-
Every skill ships the short alias in the table above. Type `/m` (Claude Code)
|
|
51
|
+
Every skill ships the short alias in the table above. Type `/m` (Claude Code), `m` (Cursor) or `$muggle:m` (Codex) to open the menu, or jump straight to one (e.g. `/mtest`, `$muggle:mtest`). Claude Code namespaces plugin commands, so the aliases resolve as `/muggle:mtest`; mirror them into `~/.claude/commands/` to type `/mtest` bare.
|
|
43
52
|
|
|
44
53
|
## MCP Tools
|
|
45
54
|
|
|
@@ -57,13 +66,15 @@ A `SessionStart` hook ensures the Electron browser test runner is downloaded and
|
|
|
57
66
|
## Upgrade
|
|
58
67
|
|
|
59
68
|
```
|
|
60
|
-
/plugin update muggleai@muggle-works
|
|
69
|
+
/plugin update muggleai@muggle-works # Claude Code
|
|
70
|
+
codex plugin marketplace upgrade muggle-works # Codex
|
|
61
71
|
```
|
|
62
72
|
|
|
63
73
|
## Uninstall
|
|
64
74
|
|
|
65
75
|
```
|
|
66
|
-
/plugin uninstall muggleai@muggle-works
|
|
76
|
+
/plugin uninstall muggleai@muggle-works # Claude Code
|
|
77
|
+
codex plugin remove muggle@muggle-works # Codex
|
|
67
78
|
```
|
|
68
79
|
|
|
69
80
|
## Links
|
|
@@ -54,6 +54,18 @@ Pre-filters are bash builtins only (`guardrail-lib.sh`), so an irrelevant event
|
|
|
54
54
|
| `Stop` | `guardrail-capability-claim.sh` | **enforce** | the closing turn tells the user a login- or code-gated flow can't be tested, reached, or verified | — | **block** once, citing `_shared/identity-and-inbox.md`: the managed profile's live inbox, provisioned number, stored TOTP secret, credentials, and CAPTCHA solver clear exactly that blocker. Reads the claim out of the transcript, since a Stop payload carries no message text. Per-sentence matching, and a sentence naming a voice call, an OAuth-only provider, or a deployment with no number provisioned never fires — those limits are real. Nudges once per session, then stays quiet, so a misread costs one turn |
|
|
55
55
|
| `UserPromptSubmit` | `guardrail-build-router.sh` | advise | a build/implement/fix request (first one this session) | `autoRouteBuildToMuggleDo` | route the work through `muggle-do` (build delegated to superpowers) |
|
|
56
56
|
|
|
57
|
+
## Codex
|
|
58
|
+
|
|
59
|
+
Codex runs Claude Code-format plugin hooks, from `codex-hooks.json` rather than `hooks.json` — the Codex plugin manifest (`../.codex-plugin/plugin.json`) names it. `scripts/build-codex-hooks.mjs` generates it from `hooks.json` on every build, and `pnpm run verify:plugin` fails when the committed copy drifts, so `hooks.json` stays the one manifest to edit. The generated copy differs in three ways, each written down rather than guessed at runtime:
|
|
60
|
+
|
|
61
|
+
- **Host stamp.** Codex exports `CLAUDE_PLUGIN_ROOT` to plugin hooks for compatibility, so nothing in the environment tells a guardrail it is not in Claude Code. Every command runs under `env MUGGLE_HOOK_HOST=codex`, and the guardrails word their instructions for Codex (`$muggle:muggle-test`, not `/muggle:muggle-test`).
|
|
62
|
+
- **Tool names.** A matcher naming a Claude Code tool becomes the Codex tool that plays its part — `AskUserQuestion` → `request_user_input` — and a group whose tools Codex lacks is dropped: Codex reports every shell call as `Bash`, opens files and skills through the shell, and delivers a background command's output as that command's own `Bash` event, so `PowerShell`, `Read`, `Skill` and `Monitor` never fire. An MCP tool reaches a Codex hook as `mcp__muggle__<tool>` with every character outside `[A-Za-z0-9_]` turned into `_` (`mcp__muggle__muggle_local_execute_replay`), so the MCP matchers are respelled; the wrappers' pre-filters and the guardrails' own tool checks accept either spelling.
|
|
63
|
+
- **Windows.** Codex runs `commandWindows` through the session shell — PowerShell, or cmd.exe as a fallback — so every hook also gets one that starts with a bare `node` (both shells parse it alike; a quoted path there is a PowerShell syntax error) and hands the same script to Git Bash through `../scripts/codex-hook-windows.mjs`. It looks for Git Bash beside `git.exe`, then in the default install paths; `MUGGLE_HOOK_BASH` names one it would not find. With no Git Bash the launcher prints `{}` and succeeds — the same allow-by-default every guardrail falls back to.
|
|
64
|
+
|
|
65
|
+
What Codex sends differs too, and the guardrails read either shape: a shell result arrives as the bare output string (normalized to `tool_response.output` in `hookInput.ts`), with no exit code; the Stop payload carries the closing message as `last_assistant_message`, which the capability-claim gate judges in place of the transcript, whose format is not Claude Code's; and a stage file opened with `cat` or `sed -n` counts as read, since there is no `Read` tool. With no structured question in Codex's default mode, a turn that closes on a question to the user is the post-merge offer there — under Codex only.
|
|
66
|
+
|
|
67
|
+
Codex runs a plugin's hooks only once the user trusts them: it asks at startup ("Trust all and continue"), asks again when an update changes them, and `/hooks` lists and manages them. Until then the MCP tools and skills work and no guardrail fires — `codex exec` skips untrusted hooks without a word, so a headless run that should be guarded passes `--dangerously-bypass-hook-trust` or runs under a `CODEX_HOME` whose config already trusts them. Codex never shows the model a hook that failed (bad JSON, a non-zero exit, a timeout); it lets the tool call or the turn end go through, which is why `src/test/codex/` runs these hooks under the real Codex CLI.
|
|
68
|
+
|
|
57
69
|
## Session-start reconcile nudge
|
|
58
70
|
|
|
59
71
|
`SessionStart` (`scripts/reconcile-stale-watchers.sh`) — a standalone advisory, not part of the `guardrails.mjs` decision tree above.
|