Reference
Architecture
Package boundaries and dependency direction.
Yolk packages are reusable mechanics. Apps provide product policy.
host app / runtime / UI
-> @yolk-sdk/agent
-> @yolk-sdk/mcp
-> @yolk-sdk/knowledge
-> @yolk-sdk/connectors
-> @yolk-sdk/sandbox
-> @yolk-sdk/codemode
-> @yolk-sdk/extractors
-> @yolk-sdk/files
-> @yolk-sdk/pool
-> @yolk-sdk/vercel-workflows
-> @yolk-sdk/harness
host tests / fixture scripts
-> @yolk-sdk/conformance (experimental)
-> @yolk-sdk/emulators (experimental)Rules of thumb:
- packages expose contracts and helpers
- apps own auth, storage, prompts, providers, enabled tools, approvals, and UI
- use explicit subpaths
- keep provider/platform-specific code behind provider/platform subpaths
Dependency direction
agent/protocolis the shared wire vocabulary.agent/loopis stateless and provider/tool-service driven.agent/runtimeadds generic session orchestration, not app persistence.mcpadapts MCP tools/results to agent protocol, but the loop stays MCP-agnostic.knowledge,connectors, andsandboxexpose optional agent adapters behind explicit subpaths.codemodebuilds on the agent tool contract (callableBy, nested tool access) and depends only onagentamong Yolk packages; its root is runtime-neutral, the Node pi executor lives behindcodemode/node, and the Dynamic Worker executor behindcodemode/cloudflare.agentnever imports it.extractorsturns uploaded files into bounded text. Its root is runtime-portable (contract, errors, limits, and theFileExtractortag), the Node parsers live behindextractors/node, and onlyextractors/knowledgeimportsknowledge(extractors/knowledge -> knowledge);knowledgenever imports it. SheetJS is an optional peer installed from the SheetJS CDN.filesbuilds on the agent tool contract (capture inagent/toolsstoresFilePartbytes through a hostFileStoreApi) and depends only onagent; the sandbox is a structural port thatsandboxsatisfies, and storage and the upload transport are host ports.agentnever imports it.poolwraps severalLLMProviders into one and depends only onagent(agent/loop,agent/protocol,agent/providers/subscription-usage); its store is a host port.agentnever imports it.vercel-workflowsstays generic over serializableunknownpayloads and does not import agent protocol.harnessowns run lifecycle (claims, inbox, drains). It is not the agent loop and does not add a Workflow driver.conformance(experimental) depends only oneffect: it records, replays, and fault-injects HTTP wire fixtures for tests, defines port fixtures for non-HTTP host ports (such asEmailClient), defines conformance cases, and runs them behind a safety policy; it never performs network I/O itself. Provider fixture and case modules such asagent/providers/vercel/conformanceimport it; runtime code does not.emulators(experimental) depends oneffectand never imports other Yolk packages: emulators follow the recorded fixture wire shapes and name the conformance cases behind each route.routerswapsHttpClientlayers to reach them;emailandr2are plain-JSON fakeEmailClientandR2Presigner/R2ObjectClientbackends that connectors bridge structurally (connectors never import emulators); only thenode,fortnox,microsoft,dropbox,notion,todoist,telegram,github,google,linkedin-search, andmcpsubpaths use Node builtins, and onlyfortnox,microsoft,dropbox,notion,todoist,telegram,github,google,linkedin-search, andmcpuse the upstream@emulators/coreruntime (pinned exactly).
Strict boundaries let the packages fit many hosts: Next.js, Workers, Durable Objects, Workflows, CLIs, and tests.