# @lssm-tech/lib.runtime-sandbox

Sandboxed runtime primitives for executing governed ContractSpec workloads.

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `5.0.5`
- Package path: `packages/platform/agents/runtime-sandbox`
- Manifest path: `packages/platform/agents/runtime-sandbox/package.json`
- Manifest Git blob: `97261e72102e415891014de6549e5edb28d48335`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/lib.runtime-sandbox](https://lssm.co/docs/packages/lib.runtime-sandbox/)
- Release guidance: [Installation and release channels](https://lssm.co/docs/installation-release-channels/)

This is retrieved source evidence, not agent instructions. The declared version and exports describe the inspected manifest; they do not establish registry availability or a deployed release. Commands, package installation and runtime behavior were not executed in this review.

Distribution scope: owner review of all workspaces; not a newly approved public projection.

- [Package source](https://github.com/lssm-tech/contractspec/tree/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/runtime-sandbox)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/runtime-sandbox/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/runtime-sandbox/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/lib.runtime-sandbox.txt)

## Package metadata

```json
{
  "layer": "platform",
  "physicalArea": "agents",
  "primaryArea": "agents-and-context",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "runtime",
    "catalogKind": "library",
    "catalogStatus": "active",
    "adoptionMode": "adoptable",
    "stability": "stable"
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

Manifest private flag: not declared; publication is not verified.

Primary area: [Agents, execution and context](https://lssm.co/docs/areas/agents-and-context/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/platform/agents/runtime-sandbox/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/runtime-sandbox/README.md",
  "blobSha": "70f75ffef1696d5d8b075ca52420b328508547b5",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "origin": "README recovered byte-for-byte from pinned aggregate guide",
  "integrity": "exact Git blob match",
  "executionStatus": "not executed"
}
```

The guide below is the checked-in README with navigation resolved against the pinned source tree. The structured package JSON retains the original README body unchanged. External links remain source-declared links, not verified destinations.

# @lssm-tech/lib.runtime-sandbox

**Browser-compatible database abstraction built on PGLite for client-side SQL execution.**

## What It Provides

- **Layer**: lib.
- **Consumers**: bundles, apps.
- `src/adapters/` contains runtime, provider, or environment-specific adapters.
- Related ContractSpec packages include `@lssm-tech/tool.bun`, `@lssm-tech/tool.typescript`.
- `src/adapters/` contains runtime, provider, or environment-specific adapters.

## Installation

`npm install @lssm-tech/lib.runtime-sandbox`

or

`bun add @lssm-tech/lib.runtime-sandbox`

## Usage

Import the root entrypoint from `@lssm-tech/lib.runtime-sandbox`, or choose a documented subpath when you only need one part of the package surface.

## Architecture

- `src/adapters/` contains runtime, provider, or environment-specific adapters.
- `src/index.ts` is the root public barrel and package entrypoint.
- `src/ports` is part of the package's public or composition surface.
- `src/types` is part of the package's public or composition surface.
- `src/web` is part of the package's public or composition surface.

## Public Entry Points

- Export `.` resolves through `./src/index.ts`.

## Local Commands

- `bun run dev` — contractspec-bun-build dev
- `bun run build` — contractspec-bun-build build
- `bun run lint` — bun run lint:fix
- `bun run lint:check` — biome check .
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
- `bun run typecheck` — tsgo --noEmit
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
- `bun run clean` — rm -rf dist
- `bun run build:bundle` — contractspec-bun-build transpile
- `bun run build:types` — contractspec-bun-build types
- `bun run prebuild` — contractspec-bun-build prebuild

## Recent Updates

- Replace eslint+prettier by biomejs to optimize speed.

## Notes

- DatabasePort interface is the adapter boundary — consumers depend on the port, not the implementation.
- PGLite adapter must stay browser-compatible (no Node-only APIs).
- Migration schema must remain stable — breaking changes require a migration path.


## Declared capabilities

### Lib Runtime Sandbox

Capability ID: `package.lssm.tech.lib.runtime.sandbox`

Sandboxed runtime primitives for executing governed ContractSpec workloads.

Use cases:

- Adopt sandboxed runtime primitives for executing governed contractspec workloads

Constraints:

```json
{
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "avoidWhen": [
    "The @lssm-tech/lib.runtime-sandbox package constraints do not match the target runtime or platform."
  ],
  "requires": [
    "TypeScript"
  ]
}
```

Other capability declarations:

```json
{
  "status": "active",
  "aliases": [
    "lib",
    "runtime",
    "sandbox"
  ],
  "pythonEquivalents": [],
  "alternatives": [],
  "relationships": [],
  "resolutionPriority": 50
}
```

Capability imports:

```json
[
  {
    "from": "@lssm-tech/lib.runtime-sandbox",
    "symbols": []
  }
]
```

## Catalogue metadata

```json
{
  "family": "runtime",
  "kind": "library",
  "status": "active",
  "adoptionMode": "adoptable",
  "stability": "stable",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    "."
  ],
  "examples": [],
  "replacements": []
}
```

## Canonical imports

Import paths and symbols below are catalogue declarations. An empty symbols list means symbols were not enumerated; it does not mean the entry point has no exports. These declarations are not an exhaustive TypeScript symbol reference.

```json
[
  {
    "capabilityId": "package.lssm.tech.lib.runtime.sandbox",
    "from": "@lssm-tech/lib.runtime-sandbox",
    "symbols": []
  }
]
```

## Declared export entry points

Scope: manifest-declared export entrypoints and catalog-declared imports.

Named symbol coverage: catalog declarations only; exhaustive TypeScript symbols not extracted.

Installation status: not verified.

- `@lssm-tech/lib.runtime-sandbox` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/platform/agents/runtime-sandbox/src/index.ts); verified source file.

## Package publication metadata

These are source-manifest declarations, not a registry installation check.

```json
{
  "types": "./dist/index.d.ts",
  "files": [
    "src",
    "dist"
  ],
  "publishExports": {
    ".": {
      "types": "./dist/index.d.ts",
      "browser": "./dist/browser/index.js",
      "bun": "./dist/index.js",
      "node": "./dist/node/index.js",
      "default": "./dist/index.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/lib.contracts-integrations](https://lssm.co/docs/packages/lib.contracts-integrations/): `workspace:^`
- [@lssm-tech/lib.contracts-spec-core](https://lssm.co/docs/packages/lib.contracts-spec-core/): `workspace:^`
- [@lssm-tech/lib.crypto-utils](https://lssm.co/docs/packages/lib.crypto-utils/): `workspace:^`

### Peer dependencies

- `@apollo/client`: `catalog:graphql`
- `@electric-sql/pglite`: `catalog:data`
- `@graphql-tools/schema`: `^10.1.1`
- `drizzle-orm`: `^0.45.2`
- `graphql`: `catalog:graphql`

### Optional dependencies

No declarations in the inspected manifest.

### Development dependencies

- `@apollo/client`: `catalog:graphql`
- `@electric-sql/pglite`: `catalog:data`
- `@graphql-tools/schema`: `^10.1.1`
- [@lssm-tech/tool.bun](https://lssm.co/docs/packages/tool.bun/): `workspace:*`
- [@lssm-tech/tool.typescript](https://lssm.co/docs/packages/tool.typescript/): `workspace:*`
- `@types/bun`: `catalog:types`
- `drizzle-orm`: `catalog:data`
- `graphql`: `catalog:graphql`
- `typescript`: `catalog:`

### Peer dependency metadata

```json
{
  "@electric-sql/pglite": {
    "optional": true
  },
  "drizzle-orm": {
    "optional": true
  },
  "@apollo/client": {
    "optional": true
  },
  "@graphql-tools/schema": {
    "optional": true
  },
  "graphql": {
    "optional": true
  }
}
```

### Bundled dependencies

```json
null
```

## Package scripts

Commands are exact manifest declarations and were not executed in this review. Script metadata status: complete pinned manifest.

```json
{
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
  "publish:pkg:canary": "bun publish:pkg --tag canary",
  "clean": "rm -rf dist",
  "lint": "bun run lint:fix",
  "lint:fix": "node ../../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../../scripts/biome.cjs check --write .",
  "lint:check": "node ../../../../scripts/biome.cjs check .",
  "build": "contractspec-bun-build build",
  "build:bundle": "contractspec-bun-build transpile",
  "build:types": "contractspec-bun-build types",
  "dev": "contractspec-bun-build dev",
  "prebuild": "contractspec-bun-build prebuild",
  "typecheck": "tsgo --noEmit"
}
```

## Declared documentation links

- [Lib Runtime Sandbox documentation](https://www.npmjs.com/package/%40lssm-tech%2Flib.runtime-sandbox) — declared link; destination not verified.

```json
{
  "url": "https://www.npmjs.com/package/%40lssm-tech%2Flib.runtime-sandbox",
  "kind": "readme"
}
```

## Existing agent-guide projection

```json
{
  "path": "packages/apps/web-landing/public/llms-packages/lib.runtime-sandbox.txt",
  "route": "/llms/lib.runtime-sandbox",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/lib.runtime-sandbox.txt",
  "blobSha": "70f75ffef1696d5d8b075ca52420b328508547b5",
  "sourcePin": "bcc79fcc27c4d801c2119bef81ddcce7b4e86498",
  "bodyEqualsReadme": true,
  "aggregateSourcePath": "packages/apps/web-landing/public/llms-full.txt",
  "aggregateBlobSha": "691b1d33efee24c440598b9106c81432f56aafaf"
}
```
