Skip to content

[codex] Add extension tool contract catalog - #205

Draft
MiguelsPizza wants to merge 10 commits into
mainfrom
codex/extension-tools-direct-actions
Draft

[codex] Add extension tool contract catalog#205
MiguelsPizza wants to merge 10 commits into
mainfrom
codex/extension-tools-direct-actions

Conversation

@MiguelsPizza

@MiguelsPizza MiguelsPizza commented May 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds side-effect-free, MCP-complete contract exports for the direct-action @mcp-b/extension-tools surface covering bookmarks, history, storage, tab groups, tabs, and windows.

What changed

  • Added contract-only exports under @mcp-b/extension-tools/contracts plus targeted group subpaths.
  • Exported stable tool names, group/action IDs, Zod input schemas, MCP JSON input schemas, output schemas for structured tools, annotations, and namespaced mcp-b/extension-tools metadata.
  • Refactored the six direct-action execution classes to consume the exported contracts instead of redefining names/descriptions/schemas locally.
  • Added structuredContent wrapping for successful direct-action calls whose contracts declare an output schema.
  • Added contract tests for MCP tools/list shape, object-root schemas, annotations, metadata, side-effect-free import behavior, catalog maps, and runtime registration drift.
  • Kept browser runtime registration from advertising outputSchema for now because extension-page clients currently compile output schemas through Ajv, which violates MV3 CSP; the contract exports still carry outputSchema for Cloudflare/Node hydration.

Validation

  • pnpm --filter @mcp-b/extension-tools run check
  • pnpm --filter @mcp-b/extension-tools test
  • pnpm --filter @mcp-b/extension-tools run typecheck
  • pnpm --filter @mcp-b/extension-tools run build
  • pnpm --filter @mcp-b/extension-tools run test:e2e
  • node --input-type=module -e "delete globalThis.chrome; const m = await import('./packages/extension-tools/dist/contracts/index.js'); console.log(m.EXTENSION_TOOL_CONTRACTS.length);"

Notes

This completes the contract/source-of-truth work for the current direct-action Chrome tool groups. The remaining generated Chrome API wrappers still use their existing registration style and should be migrated with the same contract pattern in follow-up slices.

@github-actions github-actions Bot added documentation Improvements or additions to documentation packages/extension-tools Changes to @mcp-b/extension-tools testing Test-related changes config Configuration file changes dependencies Dependency updates labels May 7, 2026
@MiguelsPizza
MiguelsPizza force-pushed the codex/extension-tools-direct-actions branch from 940de3b to 873a98f Compare May 8, 2026 00:04
@github-actions github-actions Bot added the packages/webmcp-ts-sdk Changes to @mcp-b/webmcp-ts-sdk label May 8, 2026
@MiguelsPizza
MiguelsPizza force-pushed the codex/extension-tools-direct-actions branch 4 times, most recently from 286d0c3 to 1b7232e Compare May 8, 2026 15:28
@MiguelsPizza MiguelsPizza changed the title [codex] Rework extension tools into direct action tools [codex] Add extension tool contract catalog May 8, 2026
@MiguelsPizza
MiguelsPizza force-pushed the codex/extension-tools-direct-actions branch from 1b7232e to bba8de8 Compare May 8, 2026 15:30
@MiguelsPizza
MiguelsPizza force-pushed the codex/extension-tools-direct-actions branch from bba8de8 to 4823286 Compare May 8, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration file changes dependencies Dependency updates documentation Improvements or additions to documentation packages/extension-tools Changes to @mcp-b/extension-tools packages/webmcp-ts-sdk Changes to @mcp-b/webmcp-ts-sdk testing Test-related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant