--- title: "Code Mode" description: "The shared tool abstractions and adapter packages that connect sources to execution." --- The codemode packages are the bridge between imported integrations and executable tools. They provide the shared tool abstractions that both the control plane and runtime can depend on. ## Core role The codemode layer is where executor turns "some external thing" into a discoverable and invokable tool surface. That is why it exists as a separate layer instead of being buried directly inside each product surface. ## Main packages ### `packages/codemode-core` This package holds the common tool model: - tool definitions - tool catalogs - tool invokers - discovery helpers - schema-aware tool contracts - shared system-tool concepts This is the main abstraction boundary that other layers build on. ### `packages/codemode-openapi` This package handles OpenAPI-specific extraction and tool generation. Its job is to understand OpenAPI and compile it into the shared codemode tool model, not to own workspace persistence or auth lifecycle. ### `packages/codemode-mcp` This package handles MCP-specific tool discovery and invocation behavior and adapts remote MCP tools into the same shared tool model. ## Why this layer exists Without the codemode layer, the control plane would have to understand every source format and execution detail directly. Instead, executor keeps the core model broad and pushes format-specific transformation logic into focused packages. That is what makes the system extensible: - new adapters can target the same internal tool model - the runtime can execute against one logical tool surface - the same abstractions can be reused outside the control plane, including SDK-style consumers ## How it fits with the control plane The control plane owns: - bindings - credentials - revisions and materialization - tool indexing - policy and invocation lifecycle The codemode layer owns: - how external formats become tools - how those tools are described - how format-specific invocation helpers are implemented That boundary is what keeps the architecture adapter-based instead of turning the control plane into one large protocol-specific switch statement.