viby

Package entry points

@viby/sdk publishes explicit entry points so portable application code does not accidentally load filesystem, process, PostgreSQL, Docker, browser-driver, or provider SDK dependencies.

Primary entry points

ImportUse it for
@viby/sdkBackward-compatible full Node client, public types, core helpers, and high-level resources.
@viby/sdk/coreWeb-standard contracts and helpers shared with browsers, Workers, Bun, or Node. No Node built-ins are reachable from this graph.
@viby/sdk/nodeExplicit full Node client and Node-owned defaults. Recommended for new server applications.
@viby/sdk/node/migrationsProgrammatic PostgreSQL migration helpers. The viby db migrate CLI is the usual deploy-time path.
@viby/sdk/node/skillsLocal filesystem and skills.sh/GitHub skill resolution.
@viby/sdk/package.jsonPackage metadata for tooling.
@viby/sdk/testingAggregated provider-neutral conformance suites and deterministic scripted generation fixtures for host tests.
@viby/sdk/schemaPortable OpenAPI 3.1 builder, complete Web API operation inventory, and JSON Schema Draft 2020-12 bundle.

The portable core uses Web Request, Response, Headers, ReadableStream, AbortSignal, Uint8Array, text encoding, structured cloning, and Web Crypto-compatible shapes. It also includes pure product helpers such as titleFromPrompt() that do not require a model or runtime-specific APIs.

Storage and persistence

ImportExports and behavior
@viby/sdk/storage/postgrespostgres(...), the explicit structured-database adapter using PostgreSQL.
@viby/sdk/persistenceProvider-neutral durable PersistenceAdapter contract.
@viby/sdk/persistence/postgresLow-level PostgreSQL persistence implementation.
@viby/sdk/persistence/sqliteEmbedded SQLite persistence implementation for Node.js 22.5+.
@viby/sdk/persistence/conformanceReusable durable adapter lifecycle and isolation tests.
@viby/sdk/artifact/filesystemLocal filesystem artifact store for development and single-host deployments.
@viby/sdk/storage/s3S3-compatible artifact store for AWS S3, Cloudflare R2, MinIO, and compatible services.
@viby/sdk/artifact/s3Alias of the same S3-compatible artifact adapter.
@viby/sdk/artifact/conformanceReusable artifact-store immutability, checksum, scope, and deletion tests.
@viby/sdk/environment/postgresPostgreSQL project-environment metadata store. Secret bytes still use SecretStore.
@viby/sdk/storage/sqliteCategorized embedded SQLite database factory for local, desktop, example, and test hosts.

The S3 adapter requires optional peer @aws-sdk/client-s3.

Sandboxes

ImportOptional peer / environment
@viby/sdk/sandbox/e2be2b
@viby/sdk/sandbox/vercel@vercel/sandbox
@viby/sdk/sandbox/dockerDocker CLI and daemon
@viby/sdk/sandbox/daytona@daytona/sdk
@viby/sdk/sandbox/modalmodal
@viby/sdk/sandbox/cloudflare@cloudflare/sandbox and configured Worker bindings
@viby/sdk/sandbox/conformanceNo provider peer; pass a caller-owned disposable adapter fixture.

Provider SDK types stay inside their adapter configuration and never enter SandboxAdapter.

Browser and generation conformance

ImportUse it for
@viby/sdk/browser/playwrightPlaywright browser adapter with screenshot, DOM, console, readiness, and accessibility support.
@viby/sdk/browser/conformanceReusable browser lifecycle and normalized-result tests.
@viby/sdk/generation/conformanceReusable conformance checks for custom provider-neutral generation engines.

The Playwright adapter requires playwright; accessibility scans additionally use optional @axe-core/playwright.

Testing hosts and adapters

@viby/sdk/testing collects every public conformance suite behind one stable import and includes a queue-driven engine for deterministic API, worker, and UI tests:

import {
  createScriptedGenerationEngine,
  verifyPersistenceAdapter,
  verifySandboxAdapter,
} from "@viby/sdk/testing";

const scripted = createScriptedGenerationEngine({
  steps: [{ kind: "project", title, summary, files, usage, finishReason: "stop" }],
});

const viby = createViby({
  framework: "farmjs",
  generation: { engine: scripted.engine },
});

Each call consumes exactly one step. An unexpected extra attempt throws ScriptedGenerationEngineExhaustedError instead of inventing fallback output. calls, remaining, enqueue(), and clear() let tests assert retries and prepare later outcomes. Conformance suites may create external disposable resources; use dedicated test accounts and provider cleanup hooks.

Integration entry points

ImportUse it for
@viby/sdk/integrations/postgresPostgreSQL connection metadata and encrypted secret-store defaults.
@viby/sdk/integrations/conformanceConnection-store and authorization lifecycle conformance.
@viby/sdk/integrations/repository/conformanceDisposable repository discovery, source, push, conflict, and PR tests.
@viby/sdk/integrations/deployment/conformanceDisposable project create, deploy, lookup, idempotency, and cancellation tests.
@viby/sdk/integrations/githubGitHub repository adapter.
@viby/sdk/integrations/bitbucketBitbucket Cloud repository adapter.
@viby/sdk/integrations/gitlabGitLab.com and self-managed GitLab repository adapter.
@viby/sdk/integrations/vercelVercel deployment adapter.
@viby/sdk/integrations/cloudflareCloudflare Pages deployment adapter.
@viby/sdk/integrations/netlifyNetlify atomic deployment adapter for static assets and prebuilt server functions.

MCP entry points

ImportDirection
@viby/sdk/tools/mcpConsumes host-configured MCP servers as generation tool sources. Requires optional @modelcontextprotocol/client.
@viby/sdk/mcpExposes a supplied ScopedViby as MCP server tools. Requires optional @modelcontextprotocol/server.

Runtime rules

  • Import types and Web helpers from @viby/sdk/core in portable/shared modules.
  • Import the full client from @viby/sdk/node in new Node-only server code.
  • Import providers only from their explicit subpaths.
  • Install optional peers only for adapters the application actually configures.
  • Do not deep-import files under dist; they are not part of the compatibility contract.
  • Run the relevant conformance suite for every custom adapter implementation.

See Runtime boundaries for compatibility gates and supported runtimes.