Skip to content
magozPublic

About

Reusable, Effect-native TypeScript agent stack: agent loop, MCP, knowledge, connectors, sandbox, workflows and code mode.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1,052 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yolk

Reusable agent stack. Domain-free below the app layer.

Private app/example stack

Category Technology
Example Next.js 16 App Router
Docs Fumadocs + Next.js
Language TypeScript 7
Effects Effect-TS
Database PostgreSQL via Drizzle ORM + @effect/sql
Auth better-auth email OTP
Email Resend
Styling Tailwind CSS 4
Telemetry OpenTelemetry + PostHog
Tests Vitest + Playwright

Packages

Public packages use the @yolk-sdk/* scope and release in lockstep.

The Next.js app in examples/next is a dogfood/reference app for the SDK.

Package Role
@yolk-sdk/agent Agent protocol, loop, runtime, Effect-native client, compaction, classifier models, tools, React, providers, OAuth, skillset, and voice
@yolk-sdk/mcp MCP v2 client/server/protocol APIs, Effect/Yolk adapters, legacy compatibility, and experimental conformance cases
@yolk-sdk/knowledge Knowledge document/source/file/context, ingestion, hybrid search, and lookup/manage tool helpers
@yolk-sdk/connectors Effect-native connector primitives, reusable provider actions, and experimental connector conformance cases
@yolk-sdk/sandbox Sandbox execution plane, agent tool, Vercel and Cloudflare Containers adapters, and testing fakes
@yolk-sdk/vercel-workflows Workflow loop contract, durable stream helpers, Effect Workflow client/layer, and a Workflow-compatible runtime on Cloudflare Durable Objects
@yolk-sdk/harness Run lifecycle: coordinator, store, inbox, and pluggable drivers (not the agent loop)
@yolk-sdk/conformance Experimental wire and port fixtures (record, fail-closed replay, wire faults) and a safety-gated conformance case runner
@yolk-sdk/codemode Code mode tool: model-written JavaScript that calls the host's resolved tools in a confined QuickJS sandbox (Node) or Dynamic Worker (Cloudflare), plus a classifier tool
@yolk-sdk/extractors Bounded text extraction for PDF, DOCX, XLSX (hyperlink-safe, SheetJS from its CDN), PPTX, and text files, plus a knowledge extractor adapter
@yolk-sdk/files File claim check (ADR 0009): object-storage file store and tools that move captured files (fileId) to upload URLs, download links and the sandbox
@yolk-sdk/pool Subscription account pools (ADR 0011): one LLMProvider over several accounts of one provider, expiring-first routing and failover on exhausted quota
@yolk-sdk/emulators Experimental service emulators (Vercel AI Gateway, OpenAI chat, Anthropic Messages, Codex and Grok Responses, OpenCode Go, subscription usage, stateful Fortnox, Microsoft Graph, Dropbox, Notion, Todoist, Telegram, GitHub, Google, LinkedIn search, and synthetic and Afloat MCP), fixture-driven fake EmailClient and R2 port backends, HttpClient routing to them, and a loopback server

Docs site source lives in apps/docs and uses Fumadocs to explain the public SDK package set.

Canary install example:

pnpm add @yolk-sdk/agent@canary

Dependency rule:

See packages/AGENTS.md and patterns/PACKAGE_ARCHITECTURE.md for package boundaries/public subpaths, and patterns/PACKAGE_DISTRIBUTION.md for release policy.

No users, teams, orgs, projects, billing, or product permissions below app.

Release note: GitHub Actions publishes through npm trusted publishing with provenance attestations (npm publish --provenance), which link each published version to its source commit and workflow run. npm only supports GitHub Actions provenance for public source repositories, and every package repository.url must stay https://github.com/magoz/yolk-sdk. Approved local first or emergency publishes use --provenance=false because they cannot produce an attestation.

Setup

Preferred worktree setup uses the operator-installed provisioner. Root package.json sets provision.appDir to examples/next, so env files and the Vercel link land in the Next example:

provision env --repo "$PWD" --database

See the Next example provisioning runbook for Vercel prerequisites, the approved testing-only baseline, seven-day dev/test leases, verification and cleanup. Schema preparation is separate and requires checking the target database first; provisioning alone does not prove the app is ready to run. Start with pnpm dev after setup.

Manual fallback:

pnpm install
cp examples/next/.env.example examples/next/.env.local
pnpm dev

Example app smoke test

Current examples/next agent surfaces:

  • runtime chooser at /agent
  • text + image/PDF + mic voice mode in /agent/next, /agent/cloudflare, and /agent/workflow
  • text tools: web fetch/search, knowledge/storage search, skill, virtual bash, optional remote MCP, optional Telegram, HITL question, subagents
  • /agent/next: no durable persistence; browser sends full protocol transcript each turn
  • /agent/cloudflare: Worker/Durable Object WS runtime with append-log storage
  • /agent/workflow: Vercel Workflow durable run stream
  • streaming NDJSON token events, including AgentRetry
  • in-band AgentError events for stream failures with safe provider metadata
  • tool execution failures surface as ToolExecutionError plus failed ToolResult, not terminal AgentError
  • stop/cancel aborts active response streams; terminal protocol events drain HTTP bodies to EOF
  • /api/agent runs stateless text exchanges from submitted messages

Text web tools:

  • web_fetch: fetches a specific public http(s) URL; markdown/text/html output; no cookies, JS, search, or logged-in browsing
  • web_search: calls Exa/Parallel MCP directly; no Yolk proxy; optional EXA_API_KEY, PARALLEL_API_KEY, YOLK_WEBSEARCH_PROVIDER=exa|parallel

Text model defaults:

default provider: OpenAI Codex OAuth
default model: gpt-5.5
available text models: gpt-5.5, claude-sonnet-4-6
gpt-5.5 max output tokens: 128000
claude-sonnet-4-6 max output tokens: 64000

Optional prompt override:

AGENT_SYSTEM_PROMPT="You are Yolk assistant. Be concise."

Connect OpenAI Codex or Anthropic Claude from an agent runtime page. These use subscription OAuth flows, not provider API keys. Ask prompts like summarize https://example.com or what is magoz.com about? to test web tools.

Voice mode smoke test

The mic button in each agent runtime page uses GPT-Realtime-2 over WebRTC:

  • browser: mic, model audio, Realtime data channel
  • server: SDP exchange, OPENAI_API_KEY
  • completed speech transcripts append to the shared chat transcript

Set OPENAI_API_KEY, sign in, open /agent/next, tap the mic, and ask a conversational prompt.

Then:

  1. pnpm dev
  2. sign in
  3. open /agent/next
  4. send a prompt

Checks

pnpm check
pnpm test:run

See packages/AGENTS.md and patterns/PACKAGE_ARCHITECTURE.md for package design.

About

Reusable, Effect-native TypeScript agent stack: agent loop, MCP, knowledge, connectors, sandbox, workflows and code mode.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages