CodeVetter · Repo Unpack · Extension points
effect-ts/effect
Extension primarily happens through typed service implementations and declarative builders. HTTP groups, RPC tags, command trees, SQL drivers, AI providers, and workflow handlers each define explicit registration contracts. Schema compilation also has a shared registry, though its internal functions are not public plugin APIs. Extensions must preserve their error channels, required services, lifecycle ownership, and published export boundaries.
- Context.Service and Context.Reference define injectable keys; Layer.fromBuild provides a low-level constructor receiving MemoMap and Scope, creates a child scope, and closes it if acquisition fails.
- New HTTP handlers plug into HttpApiBuilder.group's handler builder and become routes through handlerToRoute; endpoint middleware is resolved from Context, with security middleware receiving credential-aware adapters.
- RpcGroup.make indexes definitions by _tag; add, merge, omit, and middleware compose protocols, and toHandlers registers implementation functions under each rpc.key with their captured service Context.
- The CLI command factory accepts config, contextConfig, globalFlags, aliases, examples, subcommands, custom parse functions, and a handler; runWith builds flag registries and supplies setting values as Context services before execution.
- SQL drivers plug connection acquirers, a Statement compiler, transaction controls, row transforms, and tracing attributes into SqlClient.make; transaction-aware acquisition keeps statements on the current transaction connection.
- AI providers implement LanguageModel.make's generateText and streamText hooks plus an optional codecTransformer; application tools use Toolkit.make and toLayer to register handlers, while OpenAI offers construction-time and request-context HttpClient transforms.
- The internal schema registry supports per-AST set/setCompiler and global install, caches entries in a WeakMap, and falls back to interpreted operations when compiled implementations are unavailable; global JIT enabling is a separate side-effect import.
- Workflow.make defines payload/result schemas and an idempotencyKey; workflow.toLayer delegates handler registration to WorkflowEngine.register. The in-memory engine indexes registered workflows by tag and executions by executionId, rejecting unregistered workflow execution.