# @lssm-tech/lib.typescript-runtime

Owned TypeScript compiler API boundary for ContractSpec tooling

## Source and release context

- Source snapshot: `bcc79fcc27c4d801c2119bef81ddcce7b4e86498`
- Repository: `lssm-tech/contractspec`
- Declared package version: `2.0.5`
- Package path: `packages/tools/typescript-runtime`
- Manifest path: `packages/tools/typescript-runtime/package.json`
- Manifest Git blob: `6879308da658fde4f38945ad6ad30d26bec9ab3d`
- Manifest origin: pinned GitHub manifest fetch
- Manual: [@lssm-tech/lib.typescript-runtime](https://lssm.co/docs/packages/lib.typescript-runtime/)
- 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/tools/typescript-runtime)
- [Manifest source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/typescript-runtime/package.json)
- [Readme source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/typescript-runtime/README.md)
- [Guide source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/apps/web-landing/public/llms-packages/lib.typescript-runtime.txt)

## Package metadata

```json
{
  "layer": "tools",
  "physicalArea": null,
  "primaryArea": "tooling-and-agent-delivery",
  "classification": {
    "privateDeclared": null,
    "catalogFamily": "runtime",
    "catalogKind": "library",
    "catalogStatus": "active",
    "adoptionMode": "adoptable",
    "stability": "experimental"
  },
  "descriptionOrigin": "package.json",
  "manifestComplete": true,
  "publicationPolicyApplied": false
}
```

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

Primary area: [CLI, authoring and agent tooling](https://lssm.co/docs/areas/tooling-and-agent-delivery/)

## Package guide

```json
{
  "status": "available",
  "sourcePath": "packages/tools/typescript-runtime/README.md",
  "sourceUrl": "https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/typescript-runtime/README.md",
  "blobSha": "7ecfd45539c8fea82c670ed0b25be523ca09d863",
  "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.typescript-runtime

Owned runtime boundary for TypeScript compiler and AST access.

Consumers import AST helpers and source parsing from this package so TypeScript
upgrades have one repair point. The adapter isolates TypeScript 7's unstable
AST and asynchronous compiler APIs while preserving a stable asynchronous
parser contract for callers.

```ts
import {
	TypeScriptSourceParser,
	isVariableStatement,
} from "@lssm-tech/lib.typescript-runtime";
```


Call `close()` on long-lived parsers after use.

The explicit server-only `@lssm-tech/lib.typescript-runtime/docs-manifest-builder`
entry owns compiler-backed same-file DocBlock extraction and package manifest
generation. It exports `extractModuleDocData` and `buildPackageDocManifest` with
their existing asynchronous signatures and is the canonical import path. The
deprecated `@lssm-tech/lib.contracts-spec/docs/manifest-builder` subpath
forwards the same function identities until the next major release of
`@lssm-tech/lib.contracts-spec` removes it; new code imports this entry. This
entry rejects browser resolution and is not reexported by the root AST adapter.
Manifest and DocBlock types remain owned by surface-runtime and
contracts-spec-core, respectively.

`buildPackageDocManifest({ followReexports: true, ... })` additionally follows
static value reexports to canonical same-file DocBlocks. The option is additive
and defaults to `false`; existing callers keep their source-root-only behavior.
The compatibility package's `docs:manifest` producer imports this entry directly
and enables it so moving a contract into its canonical owner does not remove its
documentation. Traversal does not execute source modules or scan private sibling
files. Named aliases, cycles, and explicit export precedence are respected;
ambiguous documentation bindings, duplicate identifiers/routes, and missing
references fail validation.
DocBlock identifiers and payloads are preserved, while `sourceModule` identifies
the canonical package and source file for documentation outside the input root.

Each parser owns an isolated temporary workspace and native TypeScript session.
On Windows, the adapter uses the compiler client's supported stdio transport;
other platforms retain Unix sockets. This avoids Windows named-pipe readiness
and naming races without changing the asynchronous parser API or snapshot
semantics. The matching native TypeScript executable must be installed.

The root build targets Node-compatible server execution (including Bun). It
requires filesystem, process, or native compiler facilities and does not advertise
a browser export condition. Browser applications should use the relevant
browser-safe contracts or UI entry points instead of importing this server root.


## Declared capabilities

### Lib Typescript Runtime

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

Owned TypeScript compiler API boundary for ContractSpec tooling

Use cases:

- Adopt owned typescript compiler api boundary for contractspec tooling

Constraints:

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

Other capability declarations:

```json
{
  "status": "active",
  "aliases": [
    "contractspec",
    "typescript",
    "compiler",
    "ast",
    "lib",
    "runtime"
  ],
  "pythonEquivalents": [],
  "alternatives": [],
  "relationships": [],
  "resolutionPriority": 50
}
```

Capability imports:

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

## Catalogue metadata

```json
{
  "family": "runtime",
  "kind": "library",
  "status": "active",
  "adoptionMode": "adoptable",
  "stability": "experimental",
  "platforms": [
    "server"
  ],
  "runtimes": [
    "node"
  ],
  "entrypoints": [
    ".",
    "./docs-manifest-builder"
  ],
  "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.typescript.runtime",
    "from": "@lssm-tech/lib.typescript-runtime",
    "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.typescript-runtime` — subpath `.`
  - `unconditional`: `./src/index.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/typescript-runtime/src/index.ts); verified source file.

- `@lssm-tech/lib.typescript-runtime/docs-manifest-builder` — subpath `./docs-manifest-builder`
  - Conditional target declaration: `{"types":"./src/docs-manifest-builder.ts","browser":null,"bun":"./src/docs-manifest-builder.ts","node":"./src/docs-manifest-builder.ts","default":"./src/docs-manifest-builder.ts"}`
  - `types`: `./src/docs-manifest-builder.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/typescript-runtime/src/docs-manifest-builder.ts); verified source file.
  - `browser`: **blocked by manifest (null)**; blocked export.
  - `bun`: `./src/docs-manifest-builder.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/typescript-runtime/src/docs-manifest-builder.ts); verified source file.
  - `node`: `./src/docs-manifest-builder.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/typescript-runtime/src/docs-manifest-builder.ts); verified source file.
  - `default`: `./src/docs-manifest-builder.ts` — [pinned source](https://github.com/lssm-tech/contractspec/blob/bcc79fcc27c4d801c2119bef81ddcce7b4e86498/packages/tools/typescript-runtime/src/docs-manifest-builder.ts); verified source file.

## Package publication metadata

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

```json
{
  "types": "./dist/index.d.ts",
  "files": [
    "dist",
    "README.md"
  ],
  "publishExports": {
    ".": {
      "types": "./dist/index.d.ts",
      "bun": "./dist/index.js",
      "node": "./dist/node/index.js",
      "default": "./dist/index.js"
    },
    "./docs-manifest-builder": {
      "types": "./dist/docs-manifest-builder.d.ts",
      "browser": null,
      "bun": "./dist/docs-manifest-builder.js",
      "node": "./dist/node/docs-manifest-builder.js",
      "default": "./dist/docs-manifest-builder.js"
    }
  }
}
```

## Dependencies

Metadata status: complete pinned manifest.

### Runtime dependencies

- [@lssm-tech/lib.contracts-spec-core](https://lssm.co/docs/packages/lib.contracts-spec-core/): `workspace:^`
- [@lssm-tech/lib.surface-runtime](https://lssm.co/docs/packages/lib.surface-runtime/): `workspace:^`
- `typescript`: `catalog:`

### Peer dependencies

No declarations in the inspected manifest.

### Optional dependencies

No declarations in the inspected manifest.

### Development dependencies

- [@lssm-tech/tool.bun](https://lssm.co/docs/packages/tool.bun/): `workspace:*`
- [@lssm-tech/tool.typescript](https://lssm.co/docs/packages/tool.typescript/): `workspace:*`

### Peer dependency metadata

```json
{}
```

### 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
{
  "build": "contractspec-bun-build build",
  "build:bundle": "contractspec-bun-build transpile",
  "build:types": "contractspec-bun-build types",
  "clean": "rm -rf dist",
  "dev": "contractspec-bun-build dev",
  "lint": "bun run lint:fix",
  "lint:check": "node ../../../scripts/biome.cjs check .",
  "lint:fix": "node ../../../scripts/biome.cjs check --write .",
  "prebuild": "contractspec-bun-build prebuild",
  "test": "bun test",
  "typecheck": "tsgo --noEmit"
}
```

## Declared documentation links

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

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

## Existing agent-guide projection

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