@extension.dev/mcp 7.0.0 → 10.0.0
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +271 -0
- package/README.md +13 -21
- package/claude/ARCHITECTURE.md +4 -4
- package/claude/CLAUDE.md +2 -2
- package/claude/README.md +1 -1
- package/claude/commands/extension-add.md +1 -1
- package/claude/commands/extension-debug.md +1 -1
- package/claude/commands/extension-publish.md +1 -1
- package/claude/commands/extension.md +3 -3
- package/claude/rules/mcp-tools.md +67 -59
- package/dist/module.js +2946 -2043
- package/dist/src/lib/act.d.ts +4 -1
- package/dist/src/lib/boot-verdict.d.ts +53 -0
- package/dist/src/lib/bridge-tabs.d.ts +2 -2
- package/dist/src/lib/common-schema.d.ts +28 -0
- package/dist/src/lib/envelope.d.ts +35 -0
- package/dist/src/lib/launch-flags.d.ts +6 -6
- package/dist/src/lib/legacy-stdout.d.ts +7 -0
- package/dist/src/lib/session-identity.d.ts +16 -0
- package/dist/src/tools/add-feature.d.ts +2 -2
- package/dist/src/tools/analyze.d.ts +29 -0
- package/dist/src/tools/auth.d.ts +33 -0
- package/dist/src/tools/browsers.d.ts +39 -0
- package/dist/src/tools/build.d.ts +5 -6
- package/dist/src/tools/detect-browsers.d.ts +1 -20
- package/dist/src/tools/dev.d.ts +11 -11
- package/dist/src/tools/{dom-inspect.d.ts → dom-snapshot.d.ts} +6 -6
- package/dist/src/tools/eval.d.ts +6 -6
- package/dist/src/tools/get-template-source.d.ts +1 -22
- package/dist/src/tools/inspect.d.ts +33 -5
- package/dist/src/tools/install-browser.d.ts +1 -18
- package/dist/src/tools/list-browsers.d.ts +1 -9
- package/dist/src/tools/list-extensions.d.ts +4 -4
- package/dist/src/tools/list-templates.d.ts +1 -35
- package/dist/src/tools/login.d.ts +1 -23
- package/dist/src/tools/logout.d.ts +1 -9
- package/dist/src/tools/logs-schema.d.ts +2 -2
- package/dist/src/tools/open.d.ts +6 -6
- package/dist/src/tools/preview-web.d.ts +4 -4
- package/dist/src/tools/publish.d.ts +2 -2
- package/dist/src/tools/release-list.d.ts +1 -23
- package/dist/src/tools/release-promote.d.ts +2 -2
- package/dist/src/tools/release-status.d.ts +37 -0
- package/dist/src/tools/reload.d.ts +6 -6
- package/dist/src/tools/shares.d.ts +2 -2
- package/dist/src/tools/start.d.ts +16 -10
- package/dist/src/tools/stop.d.ts +2 -2
- package/dist/src/tools/storage.d.ts +6 -6
- package/dist/src/tools/store-status.d.ts +1 -23
- package/dist/src/tools/{deploy.d.ts → submit.d.ts} +4 -4
- package/dist/src/tools/{source-inspect.d.ts → templates.d.ts} +27 -23
- package/dist/src/tools/uninstall-browser.d.ts +1 -21
- package/dist/src/tools/wait.d.ts +4 -4
- package/dist/src/tools/whoami.d.ts +1 -9
- package/extensions/live-preview/chromium/action/index.js +1 -9
- package/extensions/live-preview/chromium/background/service_worker.js +3 -11
- package/extensions/live-preview/chromium/manifest.json +1 -1
- package/package.json +5 -5
- package/server.json +3 -3
- package/dist/src/__tests__/fixtures/ready-contract.d.ts +0 -7
- package/dist/src/__tests__/setup-session-dir.d.ts +0 -1
- package/dist/src/tools/preview.d.ts +0 -66
- /package/dist/src/tools/{source-inspect-gecko.d.ts → inspect-gecko.d.ts} +0 -0
|
@@ -53,7 +53,7 @@ These map directly to existing programmatic APIs and provide immediate value.
|
|
|
53
53
|
```json
|
|
54
54
|
{
|
|
55
55
|
"name": "extension_create",
|
|
56
|
-
"description": "Create a new browser extension project from a template in the extension.dev template catalog. Use
|
|
56
|
+
"description": "Create a new browser extension project from a template in the extension.dev template catalog. Use extension_templates to see available options.",
|
|
57
57
|
"inputSchema": {
|
|
58
58
|
"type": "object",
|
|
59
59
|
"properties": {
|
|
@@ -64,7 +64,7 @@ These map directly to existing programmatic APIs and provide immediate value.
|
|
|
64
64
|
"template": {
|
|
65
65
|
"type": "string",
|
|
66
66
|
"default": "typescript",
|
|
67
|
-
"description": "Template slug from the extension.dev template catalog (e.g. 'react', 'sidebar-claude', 'content-vue'). Use
|
|
67
|
+
"description": "Template slug from the extension.dev template catalog (e.g. 'react', 'sidebar-claude', 'content-vue'). Use extension_templates to discover options."
|
|
68
68
|
},
|
|
69
69
|
"install": {
|
|
70
70
|
"type": "boolean",
|
|
@@ -83,7 +83,7 @@ These map directly to existing programmatic APIs and provide immediate value.
|
|
|
83
83
|
|
|
84
84
|
---
|
|
85
85
|
|
|
86
|
-
#### `
|
|
86
|
+
#### `extension_templates` (action: `"list"`)
|
|
87
87
|
|
|
88
88
|
**Source:** New, fetches and queries `templates-meta.json`
|
|
89
89
|
|
|
@@ -91,7 +91,7 @@ These map directly to existing programmatic APIs and provide immediate value.
|
|
|
91
91
|
|
|
92
92
|
```json
|
|
93
93
|
{
|
|
94
|
-
"name": "
|
|
94
|
+
"name": "extension_templates",
|
|
95
95
|
"description": "List available extension templates from the extension.dev template catalog. Filter by surface, framework, or tags. Returns structured metadata from templates-meta.json.",
|
|
96
96
|
"inputSchema": {
|
|
97
97
|
"type": "object",
|
|
@@ -154,7 +154,7 @@ These map directly to existing programmatic APIs and provide immediate value.
|
|
|
154
154
|
```json
|
|
155
155
|
{
|
|
156
156
|
"name": "extension_build",
|
|
157
|
-
"description": "Build a browser extension for production.
|
|
157
|
+
"description": "Build a browser extension for production. The output lands in dist/<browser>/. Pass zip:true to also package a .zip for store submission. The build refuses a manifest with build-blocking errors unless you pass skipValidation:true, because such a manifest yields a broken bundle the bundler itself never flags.",
|
|
158
158
|
"inputSchema": {
|
|
159
159
|
"type": "object",
|
|
160
160
|
"properties": {
|
|
@@ -290,13 +290,13 @@ These map directly to existing programmatic APIs and provide immediate value.
|
|
|
290
290
|
|
|
291
291
|
**Returns:** When `wait: true`, returns the `ready.json` contract: `{ status, browser, port, pid, distPath, manifestPath, compiledAt }`. Otherwise returns `{ pid, browser }`.
|
|
292
292
|
|
|
293
|
-
Both `
|
|
293
|
+
Both `extension_dev` and `extension_start` also accept `port`, `noBrowser`, and the shared launch flags: `profile`, `startingUrl`, `chromiumBinary`, `geckoBinary`, `host`, `publicHost`, `extensions` (same shapes as on `extension_dev`).
|
|
294
294
|
|
|
295
295
|
**Why this is distinct from dev:** `dev` uses HMR and watches files. `start` builds once in production mode and launches, what you'd use to verify a production build works before publishing.
|
|
296
296
|
|
|
297
297
|
---
|
|
298
298
|
|
|
299
|
-
#### `
|
|
299
|
+
#### `extension_start` (build: `false`)
|
|
300
300
|
|
|
301
301
|
**Source:** `programs/develop/module.ts` → `extensionPreview()`
|
|
302
302
|
|
|
@@ -304,7 +304,7 @@ Both `extension_start` and `extension_preview` also accept `port`, `noBrowser`,
|
|
|
304
304
|
|
|
305
305
|
```json
|
|
306
306
|
{
|
|
307
|
-
"name": "
|
|
307
|
+
"name": "extension_start",
|
|
308
308
|
"description": "Preview a production-built extension in a browser. Uses dist/ output directly.",
|
|
309
309
|
"inputSchema": {
|
|
310
310
|
"type": "object",
|
|
@@ -330,7 +330,7 @@ Both `extension_start` and `extension_preview` also accept `port`, `noBrowser`,
|
|
|
330
330
|
|
|
331
331
|
These combine extension.dev knowledge with the examples repo to make Claude _smart_ about extensions, not just a CLI wrapper.
|
|
332
332
|
|
|
333
|
-
#### `
|
|
333
|
+
#### `extension_templates` (action: `"source"`)
|
|
334
334
|
|
|
335
335
|
**Source:** New, reads files from the examples repo
|
|
336
336
|
|
|
@@ -338,7 +338,7 @@ These combine extension.dev knowledge with the examples repo to make Claude _sma
|
|
|
338
338
|
|
|
339
339
|
```json
|
|
340
340
|
{
|
|
341
|
-
"name": "
|
|
341
|
+
"name": "extension_templates",
|
|
342
342
|
"description": "Read source files from a template in the extension.dev template catalog. Use this to learn implementation patterns before building something similar.",
|
|
343
343
|
"inputSchema": {
|
|
344
344
|
"type": "object",
|
|
@@ -406,7 +406,7 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
406
406
|
|
|
407
407
|
---
|
|
408
408
|
|
|
409
|
-
#### `
|
|
409
|
+
#### `extension_analyze`
|
|
410
410
|
|
|
411
411
|
**Source:** New tool; static analysis of the built `dist/` output
|
|
412
412
|
|
|
@@ -414,8 +414,8 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
414
414
|
|
|
415
415
|
```json
|
|
416
416
|
{
|
|
417
|
-
"name": "
|
|
418
|
-
"description": "
|
|
417
|
+
"name": "extension_analyze",
|
|
418
|
+
"description": "Analyze a built extension: file sizes, entry points, permissions used, and dependency analysis.",
|
|
419
419
|
"inputSchema": {
|
|
420
420
|
"type": "object",
|
|
421
421
|
"properties": {
|
|
@@ -484,11 +484,11 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
484
484
|
}
|
|
485
485
|
```
|
|
486
486
|
|
|
487
|
-
**Implementation:** Internally calls `
|
|
487
|
+
**Implementation:** Internally calls `extension_templates` with `action: "source"` to fetch the canonical pattern for the requested surface+framework combination, then generates the files and updates manifest.json. The examples repo is the codegen source, not hard-coded templates.
|
|
488
488
|
|
|
489
489
|
---
|
|
490
490
|
|
|
491
|
-
#### `
|
|
491
|
+
#### `extension_inspect`
|
|
492
492
|
|
|
493
493
|
**Source:** `programs/extension/browsers/` → CDP/RDP source inspection system
|
|
494
494
|
|
|
@@ -496,7 +496,7 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
496
496
|
|
|
497
497
|
```json
|
|
498
498
|
{
|
|
499
|
-
"name": "
|
|
499
|
+
"name": "extension_inspect",
|
|
500
500
|
"description": "Inspect a running extension's live state: DOM structure, content script injection, console messages, and selector queries. Requires an active dev or start session.",
|
|
501
501
|
"inputSchema": {
|
|
502
502
|
"type": "object",
|
|
@@ -610,23 +610,35 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
610
610
|
}
|
|
611
611
|
```
|
|
612
612
|
|
|
613
|
-
**Returns:** The `ready.json` contract
|
|
613
|
+
**Returns:** The schema-1 envelope, carrying the `ready.json` contract under `value`:
|
|
614
614
|
|
|
615
615
|
```json
|
|
616
616
|
{
|
|
617
|
+
"schema": 1,
|
|
618
|
+
"ok": true,
|
|
619
|
+
"command": "extension_wait",
|
|
617
620
|
"status": "ready",
|
|
618
|
-
"
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
621
|
+
"value": {
|
|
622
|
+
"compiled": true,
|
|
623
|
+
"browserAttached": true,
|
|
624
|
+
"sessionCommand": "dev",
|
|
625
|
+
"browser": "chrome",
|
|
626
|
+
"port": 8080,
|
|
627
|
+
"pid": 12345,
|
|
628
|
+
"distPath": "/path/to/dist/chrome",
|
|
629
|
+
"manifestPath": "/path/to/dist/chrome/manifest.json",
|
|
630
|
+
"compiledAt": "2026-04-14T10:30:00.000Z",
|
|
631
|
+
"startedAt": "2026-04-14T10:29:55.000Z"
|
|
632
|
+
},
|
|
633
|
+
"error": null,
|
|
634
|
+
"warnings": []
|
|
626
635
|
}
|
|
627
636
|
```
|
|
628
637
|
|
|
629
|
-
|
|
638
|
+
The envelope's `command` names the tool, so the ready contract's own `command`
|
|
639
|
+
is carried as `value.sessionCommand`.
|
|
640
|
+
|
|
641
|
+
**Why this matters for MCP:** When Claude starts a dev session via `extension_dev`, it needs to know when the extension is actually loaded and ready before calling `extension_inspect`. This tool provides that gate.
|
|
630
642
|
|
|
631
643
|
---
|
|
632
644
|
|
|
@@ -673,7 +685,7 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
673
685
|
|
|
674
686
|
### Tier 3, Browser management tools
|
|
675
687
|
|
|
676
|
-
#### `
|
|
688
|
+
#### `extension_browsers` (action: `"install"`)
|
|
677
689
|
|
|
678
690
|
**Source:** `programs/install/module.ts` → `extensionInstall()`
|
|
679
691
|
|
|
@@ -681,7 +693,7 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
681
693
|
|
|
682
694
|
```json
|
|
683
695
|
{
|
|
684
|
-
"name": "
|
|
696
|
+
"name": "extension_browsers",
|
|
685
697
|
"description": "Install a managed browser binary for extension testing. Useful in CI or fresh environments.",
|
|
686
698
|
"inputSchema": {
|
|
687
699
|
"type": "object",
|
|
@@ -696,7 +708,7 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
696
708
|
}
|
|
697
709
|
```
|
|
698
710
|
|
|
699
|
-
#### `
|
|
711
|
+
#### `extension_browsers` (action: `"list"`)
|
|
700
712
|
|
|
701
713
|
**Source:** `programs/install/module.ts` → `getManagedBrowsersCacheRoot()`
|
|
702
714
|
|
|
@@ -704,7 +716,7 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
704
716
|
|
|
705
717
|
---
|
|
706
718
|
|
|
707
|
-
#### `
|
|
719
|
+
#### `extension_browsers` (action: `"detect"`)
|
|
708
720
|
|
|
709
721
|
**Source:** `programs/extension/browsers/` → binary resolution chain
|
|
710
722
|
|
|
@@ -712,7 +724,7 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
712
724
|
|
|
713
725
|
```json
|
|
714
726
|
{
|
|
715
|
-
"name": "
|
|
727
|
+
"name": "extension_browsers",
|
|
716
728
|
"description": "Detect which browsers are available for extension development. Returns paths and capabilities for each detected browser.",
|
|
717
729
|
"inputSchema": {
|
|
718
730
|
"type": "object",
|
|
@@ -758,11 +770,11 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
758
770
|
}
|
|
759
771
|
```
|
|
760
772
|
|
|
761
|
-
**Why this matters:** Before Claude runs `extension_dev --browser=firefox`, it should know if Firefox is actually installed. This prevents "browser not found" errors and lets Claude suggest `
|
|
773
|
+
**Why this matters:** Before Claude runs `extension_dev --browser=firefox`, it should know if Firefox is actually installed. This prevents "browser not found" errors and lets Claude suggest `extension_browsers` when needed. Especially important for Docker/devcontainer environments.
|
|
762
774
|
|
|
763
775
|
---
|
|
764
776
|
|
|
765
|
-
#### `
|
|
777
|
+
#### `extension_browsers` (action: `"uninstall"`)
|
|
766
778
|
|
|
767
779
|
**Source:** `extension-install` → `extensionUninstall()`
|
|
768
780
|
|
|
@@ -770,7 +782,7 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
770
782
|
|
|
771
783
|
```json
|
|
772
784
|
{
|
|
773
|
-
"name": "
|
|
785
|
+
"name": "extension_browsers",
|
|
774
786
|
"inputSchema": {
|
|
775
787
|
"type": "object",
|
|
776
788
|
"properties": {
|
|
@@ -800,20 +812,18 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
800
812
|
| ------------------------------- | -------------------- | ----------------------------------------- | ------------------------------------------- | ------------------------------------------ |
|
|
801
813
|
| **Tier 1, Core** | | | | |
|
|
802
814
|
| `extension_create` | `programs/create` | `extensionCreate()` | examples repo via go-git-it | Thin wrapper only |
|
|
803
|
-
| `
|
|
815
|
+
| `extension_templates` | New | n/a | `templates-meta.json` release asset + raw GitHub | `list` fetches, filters and caches; `source` reads files |
|
|
804
816
|
| `extension_build` | `programs/develop` | `extensionBuild()` | n/a | Thin wrapper only |
|
|
805
817
|
| `extension_dev` | `programs/develop` | `extensionDev()` | n/a | Thin wrapper + process management |
|
|
806
|
-
| `extension_start` | `programs/extension` | `extensionBuild()` + `extensionPreview()` | n/a | Thin wrapper
|
|
807
|
-
| `extension_preview` | `programs/develop` | `extensionPreview()` | n/a | Thin wrapper only |
|
|
818
|
+
| `extension_start` | `programs/extension` | `extensionBuild()` + `extensionPreview()` | n/a | Thin wrapper; `build: false` calls `extensionPreview()` alone |
|
|
808
819
|
| **Tier 2, Intelligence** | | | | |
|
|
809
|
-
| `extension_get_template_source` | New | n/a | `templates-meta.json` + raw GitHub | Fetch + read files |
|
|
810
820
|
| `extension_manifest_validate` | `programs/develop` | `plugin-web-extension` | `templates-meta.json` for similar templates | Extract validation logic |
|
|
811
|
-
| `
|
|
812
|
-
| `
|
|
821
|
+
| `extension_analyze` | `programs/develop` | `--source` flag logic | n/a | Extract into callable API |
|
|
822
|
+
| `extension_inspect` | `programs/extension` | CDP client / RDP transport | Live browser via debugging protocol | Wire to running session |
|
|
813
823
|
| `extension_list_extensions` | MCP `lib/cdp` | `Extensions.getExtensionInfo` (read-only) | Live browser via CDP (Chromium) | MCP tool (no CLI verb) |
|
|
814
824
|
| `extension_wait` | `programs/extension` | `dev-wait.ts` | `ready.json` contract file | Thin wrapper (exists in CLI) |
|
|
815
825
|
| `extension_stop` | MCP `lib/process-manager` | session registry + group signal | Session registry + `ready.json` pid | MCP tool (no CLI verb) |
|
|
816
|
-
| `extension_add_feature` | New | `
|
|
826
|
+
| `extension_add_feature` | New | `extension_templates` | examples repo patterns | Codegen from examples |
|
|
817
827
|
| **Agent bridge, act / triggers** | | | | |
|
|
818
828
|
| `extension_eval` | `programs/extension` | bridge control channel | Live extension context | Wraps `extension eval` (`--allow-eval`) |
|
|
819
829
|
| `extension_storage` | `programs/extension` | bridge control channel | `chrome.storage` | Wraps `extension storage` |
|
|
@@ -821,9 +831,7 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
821
831
|
| `extension_open` | `programs/extension` | bridge control channel | Surfaces + `action`/`command` replay | Wraps `extension open` |
|
|
822
832
|
| `extension_logs` | `programs/extension` | bridge log/control channel | `logs.ndjson` + live channel | Wraps `extension logs` |
|
|
823
833
|
| **Tier 3, Browser management** | | | | |
|
|
824
|
-
| `
|
|
825
|
-
| `extension_list_browsers` | `programs/install` | `getManagedBrowsersCacheRoot()` | n/a | Thin wrapper only |
|
|
826
|
-
| `extension_detect_browsers` | `programs/extension` | Binary resolution chain | System PATH + managed cache | Extract from launch logic |
|
|
834
|
+
| `extension_browsers` | `programs/install` | `extensionInstall()`, `getManagedBrowsersCacheRoot()`, binary resolution chain | System PATH + managed cache | One tool, four actions |
|
|
827
835
|
|
|
828
836
|
## Changes needed in existing programs
|
|
829
837
|
|
|
@@ -836,7 +844,7 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
836
844
|
|
|
837
845
|
### `programs/create/`
|
|
838
846
|
|
|
839
|
-
- **Template listing API.** Add `extensionListTemplates(filters?)` that fetches+caches `templates-meta.json` and returns filtered results. This serves both the MCP `
|
|
847
|
+
- **Template listing API.** Add `extensionListTemplates(filters?)` that fetches+caches `templates-meta.json` and returns filtered results. This serves both the MCP `extension_templates` tool and any future CLI `extension list` command.
|
|
840
848
|
- **Dry-run mode.** Add `dryRun` option to `extensionCreate()` that returns the file list without writing. Useful for Claude to explain what will be created before doing it.
|
|
841
849
|
- **Template caching.** The current no-cache approach (re-download from GitHub every time) works but is slow. An MCP server that handles many create calls should cache the examples repo or individual template tarballs with a TTL.
|
|
842
850
|
|
|
@@ -849,7 +857,7 @@ The `similarTemplates` field lists templates from the catalog with similar surfa
|
|
|
849
857
|
- **`--json` flag for all commands.** Machine-readable output for every command. This benefits not just MCP but any programmatic consumer. The `--ai-help` / `--format json` flags already exist, extend this pattern to command output.
|
|
850
858
|
- **Exit codes.** Ensure distinct exit codes for different failure modes (missing manifest, build error, browser not found, etc.)
|
|
851
859
|
- **`extension list` command.** Expose `extensionListTemplates()` as a CLI command. Shows the catalog in terminal or JSON.
|
|
852
|
-
- **Extract binary detection into callable API.** The browser resolution chain (managed cache → WSL → custom binary → npm location packages) is embedded in `chromium-launch/index.ts` and `firefox-launch/index.ts`. Extract into `extensionDetectBrowsers()` for the `
|
|
860
|
+
- **Extract binary detection into callable API.** The browser resolution chain (managed cache → WSL → custom binary → npm location packages) is embedded in `chromium-launch/index.ts` and `firefox-launch/index.ts`. Extract into `extensionDetectBrowsers()` for the `extension_browsers` MCP tool.
|
|
853
861
|
- **Extract source inspection into MCP-callable API.** The `--source` system is deeply integrated into the browser launch lifecycle. For MCP, we need a way to call it against an _already-running_ dev session. The ready.json contract already gives us port/pid, the MCP server can connect to the CDP/RDP port directly.
|
|
854
862
|
- **Extract wait mode into callable API.** The `dev-wait.ts` logic is CLI-only. Expose `extensionWait(projectPath, browser, timeout)` as a programmatic function.
|
|
855
863
|
- **Expose the `start` command programmatically.** Currently `start` is CLI-only orchestration (build then preview). Add `extensionStart()` that chains `extensionBuild()` + `extensionPreview()` with the ready.json contract.
|
|
@@ -919,7 +927,7 @@ const CURATED_ALLOWED_KEYS = [
|
|
|
919
927
|
}
|
|
920
928
|
```
|
|
921
929
|
|
|
922
|
-
These fields enable `
|
|
930
|
+
These fields enable `extension_templates` to match user intent ("I want to build an AI sidebar") to the right template with `action: "list"`, and to read only the key files with `action: "source"`.
|
|
923
931
|
|
|
924
932
|
---
|
|
925
933
|
|
|
@@ -939,28 +947,28 @@ These fields enable `extension_list_templates` to match user intent ("I want to
|
|
|
939
947
|
### Phase 2: MCP Server package
|
|
940
948
|
|
|
941
949
|
1. New package: `programs/mcp` or standalone `@extension.dev/mcp`
|
|
942
|
-
2. Implement Tier 1 tools: `extension_create`, `
|
|
943
|
-
3. `
|
|
950
|
+
2. Implement Tier 1 tools: `extension_create`, `extension_templates`, `extension_build`, `extension_dev`, `extension_start`
|
|
951
|
+
3. `extension_templates` caches `templates-meta.json` with 1-hour TTL
|
|
944
952
|
4. Register on MCP directory (npmjs.com + modelcontextprotocol.io)
|
|
945
953
|
|
|
946
954
|
### Phase 3: Live inspection tools
|
|
947
955
|
|
|
948
956
|
1. `extension_wait`, poll ready.json contract (gate for inspection tools)
|
|
949
|
-
2. `
|
|
950
|
-
3. `
|
|
951
|
-
4. `
|
|
957
|
+
2. `extension_inspect`, connect to running session's CDP/RDP port for live DOM inspection
|
|
958
|
+
3. `extension_browsers`, system browser detection
|
|
959
|
+
4. `extension_templates` `action: "source"`, reads from examples repo via raw.githubusercontent.com
|
|
952
960
|
5. `extension_manifest_validate`, cross-browser validation + similar template suggestions
|
|
953
961
|
|
|
954
962
|
### Phase 4: Codegen + advanced tools
|
|
955
963
|
|
|
956
|
-
1. `
|
|
964
|
+
1. `extension_analyze`, static build analysis from `--source` extraction
|
|
957
965
|
2. `extension_add_feature`, codegen sourced from examples repo patterns
|
|
958
966
|
|
|
959
967
|
### Phase 5: Feedback loop
|
|
960
968
|
|
|
961
969
|
1. MCP server reports which templates Claude recommends most → feed into `featured` rankings
|
|
962
970
|
2. Track which `aiPromptExamples` lead to successful creates → improve matching
|
|
963
|
-
3. New templates added to examples repo are immediately available via `
|
|
971
|
+
3. New templates added to examples repo are immediately available via `extension_templates` (no MCP server update needed, it reads `templates-meta.json` at runtime)
|
|
964
972
|
|
|
965
973
|
---
|
|
966
974
|
|
|
@@ -977,12 +985,12 @@ Typical power-user workflows that drive tool prioritization:
|
|
|
977
985
|
|
|
978
986
|
| Workflow | Tool | Why |
|
|
979
987
|
| ---------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
|
|
980
|
-
| Debugging injection failures | `
|
|
981
|
-
| Docker/devcontainer | `
|
|
988
|
+
| Debugging injection failures | `extension_inspect` | `probe: ["[data-extension-root]"]` shows injection state, reinject generation, console errors, no manual DevTools needed |
|
|
989
|
+
| Docker/devcontainer | `extension_browsers` + `extension_wait` | Check browser availability, gate on dev server readiness |
|
|
982
990
|
| Multi-browser | `extension_manifest_validate` + `extension_build` | Catch manifest divergence early, build for `chrome,firefox` |
|
|
983
|
-
| Learning patterns | `
|
|
991
|
+
| Learning patterns | `extension_templates` (`list` then `source`) | Read `content-multi-one-entry`, `content-multi-three-entries` for multi-level import patterns |
|
|
984
992
|
| Rapid prototyping | `extension_add_feature` | "Add a sidebar" generates correct manifest + files + background handler |
|
|
985
993
|
|
|
986
|
-
**Why the examples repo is central:** Complex patterns (multi-level content script imports, MAIN world isolation, cross-browser sidebars) are documented as working examples. `
|
|
994
|
+
**Why the examples repo is central:** Complex patterns (multi-level content script imports, MAIN world isolation, cross-browser sidebars) are documented as working examples. `extension_templates` gives Claude the canonical implementation to reference when building or debugging these patterns.
|
|
987
995
|
|
|
988
|
-
**Why source inspection is the highest-value tool:** The most time-consuming extension debugging failure is "it didn't load." `
|
|
996
|
+
**Why source inspection is the highest-value tool:** The most time-consuming extension debugging failure is "it didn't load." `extension_inspect` with `probe` and `console_summary` turns manual Chrome DevTools investigation into a one-call Claude diagnosis.
|