Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ npm ci
npm run verify
```

For a consuming TypeScript application, use a Node-aware compiler configuration and do **not** enable TypeScript's legacy `experimentalDecorators` mode for these root Stage 3 examples. CommonJS legacy decorator consumers must import from `@theorvane/type-chain/legacy`, use Node16 module resolution, and await its LangChain adapters; see the [Decorator API contract](docs/api/decorator-api.md#legacy-cjs-decorators).
For a consuming TypeScript application, use a Node-aware compiler configuration and do **not** enable TypeScript's legacy `experimentalDecorators` mode for these root Stage 3 examples. CommonJS consumers can use Node16 module resolution with static imports of the root, `/langchain`, `/agent`, and `/typemcp` subpaths; the package selects matching CJS `.d.cts` declarations and `.cjs` runtime exports. CommonJS legacy decorator consumers must import decorators from `@theorvane/type-chain/legacy` and await its LangChain adapters; see the [Decorator API contract](docs/api/decorator-api.md#legacy-cjs-decorators).

```json
{
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TypeChain documentation

TypeChain is a decorator-first authoring layer for typed LangChain JS tools and agents. The published package is [`@theorvane/type-chain@0.2.0`](https://www.npmjs.com/package/@theorvane/type-chain).
TypeChain is a decorator-first authoring layer for typed LangChain JS tools and agents. The published package is [`@theorvane/type-chain@0.2.1`](https://www.npmjs.com/package/@theorvane/type-chain).

> **Published boundary:** TypeChain provides Stage 3 tool and policy declarations, immutable definitions, LangChain adaptation, an agent builder, and an in-process TypeMCP bridge. Applications retain ownership of **models, credentials, policy enforcement, state, hosting, deployment, and cross-process MCP transport**.

Expand Down
8 changes: 6 additions & 2 deletions docs/api/decorator-api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Decorator API contract

`@theorvane/type-chain@0.2.0` is the current public TypeChain release. It supports standard TypeScript Stage 3 decorators and explicit runtime schemas. It does not infer schemas from TypeScript parameter types or use legacy `reflect-metadata` behavior.
`@theorvane/type-chain@0.2.1` is the current public TypeChain release. It supports standard TypeScript Stage 3 decorators and explicit runtime schemas. It does not infer schemas from TypeScript parameter types or use legacy `reflect-metadata` behavior.

## Root package

Expand Down Expand Up @@ -144,7 +144,11 @@ class LegacyTools {
```

Use `"module": "Node16"`, `"moduleResolution": "Node16"`, and
`"experimentalDecorators": true` for CommonJS consumers. Legacy support is
`"experimentalDecorators": true` for CommonJS consumers. In the same Node16
compilation, static imports of the root, `/langchain`, `/agent`, and `/typemcp`
subpaths select their CJS `.d.cts` declarations and `.cjs` runtime exports.
Install the relevant optional peers (`@langchain/core`, `langchain`, and/or
`@theorvane/type-mcp`) for any subpath you import. Legacy support is
limited to public instance methods with string names; parameter, accessor,
field, private, and symbol-named decorators are excluded. Do not mix Stage 3
and legacy decorators in one TypeScript compilation unit.
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/agent-builder.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Agent builder

The published `@theorvane/type-chain@0.2.0` `/agent` subpath provides a narrow decorator-first bridge to LangChain's `createAgent()`. The application provides the model and retains ownership of the lifecycle and all runtime controls.
The published `@theorvane/type-chain@0.2.1` `/agent` subpath provides a narrow decorator-first bridge to LangChain's `createAgent()`. The application provides the model and retains ownership of the lifecycle and all runtime controls.

## Prerequisites

Expand All @@ -11,7 +11,7 @@ The published `@theorvane/type-chain@0.2.0` `/agent` subpath provides a narrow d
## Install

```bash
npm install @theorvane/type-chain@0.2.0 @langchain/core langchain zod
npm install @theorvane/type-chain@0.2.1 @langchain/core langchain zod
```

`/agent` is optional. Import the root package alone when tool metadata is sufficient.
Expand Down
8 changes: 4 additions & 4 deletions docs/guides/composition-selection.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Choose a TypeChain composition boundary

> **Release status:** This guide documents the published `@theorvane/type-chain@0.2.0` package. Every optional integration stays behind a dedicated subpath, so importing the root metadata package does not load LangChain or TypeMCP peers.
> **Release status:** This guide documents the published `@theorvane/type-chain@0.2.1` package. Every optional integration stays behind a dedicated subpath, so importing the root metadata package does not load LangChain or TypeMCP peers.

TypeChain makes tool and policy declarations explicit, then adapts those declarations at a boundary selected by the application. Start with the narrowest import that reaches the behavior you need. The application keeps ownership of models, credentials, authorization, enforcement, state, persistence, streaming, hosting, and deployment.

Expand All @@ -19,7 +19,7 @@ This is the routing chapter after an inspected root definition. It is not a seco
Install the root package first:

```bash
npm install @theorvane/type-chain@0.2.0
npm install @theorvane/type-chain@0.2.1
```

| Need | Import | Use it when | Keep in the application |
Expand All @@ -33,10 +33,10 @@ The root package has no required optional peer imports. Install only the peers f

```bash
# Standard LangChain tool or agent composition
npm install @theorvane/type-chain@0.2.0 @langchain/core langchain zod
npm install @theorvane/type-chain@0.2.1 @langchain/core langchain zod

# In-process TypeMCP composition
npm install @theorvane/type-chain@0.2.0 @theorvane/type-mcp@0.3.0 @langchain/core langchain zod
npm install @theorvane/type-chain@0.2.1 @theorvane/type-mcp@0.3.1 @langchain/core langchain zod
```

## Begin with one declared tool
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/core-concepts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Core concepts

This page explains the published [`@theorvane/type-chain@0.2.0`](https://www.npmjs.com/package/@theorvane/type-chain) model before you select an optional integration.
This page explains the published [`@theorvane/type-chain@0.2.1`](https://www.npmjs.com/package/@theorvane/type-chain) model before you select an optional integration.

> **Responsibility boundary:** TypeChain records declarations and adapts them at explicit boundaries. Applications retain ownership of **models, credentials, policy enforcement, state, hosting, deployment, and cross-process MCP transport**.

Expand Down
6 changes: 3 additions & 3 deletions docs/guides/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Getting started with @theorvane/type-chain@0.2.0
# Getting started with @theorvane/type-chain@0.2.1

TypeChain is a decorator-first, type-safe authoring layer for LangChain JS tools and agents. It records explicit tool metadata, adapts it to standard LangChain tools, and leaves model choice, credentials, authorization, retries, timeouts, persistence, redaction, and audit policy to your application.

This guide installs the published package `@theorvane/type-chain@0.2.0`, configures Stage 3 decorators, and declares a first tool.
This guide installs the published package `@theorvane/type-chain@0.2.1`, configures Stage 3 decorators, and declares a first tool.

## Requirements

Expand All @@ -12,7 +12,7 @@ This guide installs the published package `@theorvane/type-chain@0.2.0`, configu
## Install

```bash
npm install @theorvane/type-chain@0.2.0
npm install @theorvane/type-chain@0.2.1
```

The root package has no required optional peers and can be imported on its own. LangChain and TypeMCP integrations live behind dedicated subpaths (`@theorvane/type-chain/langchain`, `/agent`, `/typemcp`) and only load their respective peers when you import them.
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/langchain-integration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LangChain integration

`@theorvane/type-chain@0.2.0` exposes a dedicated `/langchain` subpath that turns decorated methods into standard LangChain structured tools. LangChain owns schema parsing and validation; TypeChain preserves the explicit name, description, schema, and receiver-bound invocation.
`@theorvane/type-chain@0.2.1` exposes a dedicated `/langchain` subpath that turns decorated methods into standard LangChain structured tools. LangChain owns schema parsing and validation; TypeChain preserves the explicit name, description, schema, and receiver-bound invocation.

## Prerequisites

Expand All @@ -11,7 +11,7 @@
## Install

```bash
npm install @theorvane/type-chain@0.2.0 @langchain/core langchain zod
npm install @theorvane/type-chain@0.2.1 @langchain/core langchain zod
```

The root package remains independent of optional peers. Import `/langchain` only where the application needs this adapter.
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/petstore-policy-and-composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This chapter continues the [Petstore TypeChain foundation](petstore-typechain-fo
## Before you start

- Complete [Petstore TypeChain foundation](petstore-typechain-foundation.md) and confirm `npm run check` and `npm run inspect-tools` work.
- Node.js 20 or later with `@theorvane/type-chain@0.2.0` and `zod` installed.
- Node.js 20 or later with `@theorvane/type-chain@0.2.1` and `zod` installed.
- Select **one** optional route only after the root declaration is useful: `/langchain`, `/agent`, or `/typemcp`.

## Workspace checkpoint
Expand All @@ -26,7 +26,7 @@ Optional routes can add `langchain-tools.ts`, `petstore-agent.ts`, or `typemcp-t
The policy metadata itself needs only the root package and Zod:

```bash
npm install @theorvane/type-chain@0.2.0 zod
npm install @theorvane/type-chain@0.2.1 zod
npm run check
```

Expand All @@ -37,7 +37,7 @@ Install optional peers only when selecting one route:
npm install @langchain/core langchain

# In-process TypeMCP bridge
npm install @theorvane/type-mcp@0.3.0 @langchain/core langchain
npm install @theorvane/type-mcp@0.3.1 @langchain/core langchain
```

## Record policy intent
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/petstore-typechain-foundation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This chapter continues a strict TypeScript Petstore workspace with one TypeChain tool. It records explicit runtime metadata, inspects immutable definitions, and leaves real domain dependencies and execution ownership in the application.

> **Published version:** The examples target [`@theorvane/type-chain@0.2.0`](https://www.npmjs.com/package/@theorvane/type-chain). They use standard TypeScript decorators rather than legacy `experimentalDecorators`.
> **Published version:** The examples target [`@theorvane/type-chain@0.2.1`](https://www.npmjs.com/package/@theorvane/type-chain). They use standard TypeScript decorators rather than legacy `experimentalDecorators`.

## Before you start

Expand Down Expand Up @@ -31,7 +31,7 @@ The project can print the `find_product` definition. It does not create a model,
From the workspace root, install the root package, a runtime schema, and local TypeScript runner if they are not already present:

```bash
npm install @theorvane/type-chain@0.2.0 zod
npm install @theorvane/type-chain@0.2.1 zod
npm install --save-dev typescript tsx @types/node
npm pkg set type=module
npm pkg set scripts.check="tsc --noEmit"
Expand Down
8 changes: 4 additions & 4 deletions docs/guides/petstore-walkthrough.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Petstore walkthrough: typed tools at the boundary you own

This walkthrough uses one Petstore catalog tool to show the published [`@theorvane/type-chain@0.2.0`](https://www.npmjs.com/package/@theorvane/type-chain) flow: declare an explicit tool, optionally attach policy intent, then choose a LangChain, agent, or in-process TypeMCP boundary.
This walkthrough uses one Petstore catalog tool to show the published [`@theorvane/type-chain@0.2.1`](https://www.npmjs.com/package/@theorvane/type-chain) flow: declare an explicit tool, optionally attach policy intent, then choose a LangChain, agent, or in-process TypeMCP boundary.

> **What this does not do:** TypeChain does not choose models, credentials, policy enforcement, state, hosting, deployment, or cross-process MCP transport. Your application supplies those decisions.

Expand All @@ -19,7 +19,7 @@ For a project-starting route, complete [Petstore TypeChain foundation](petstore-
Install the root package and Zod:

```bash
npm install @theorvane/type-chain@0.2.0 zod
npm install @theorvane/type-chain@0.2.1 zod
```

Use Node-aware TypeScript configuration:
Expand Down Expand Up @@ -89,7 +89,7 @@ This records intent. It does not enforce authorization or write an audit event a
Install optional peers only for this path:

```bash
npm install @theorvane/type-chain@0.2.0 @langchain/core langchain zod
npm install @theorvane/type-chain@0.2.1 @langchain/core langchain zod
```

Create `src/langchain-tools.ts`:
Expand Down Expand Up @@ -129,7 +129,7 @@ export const agent = buildAgent(new PetstoreAgent(), {
When a TypeMCP-decorated Petstore server and the LangChain application live in the same Node.js process, install the bridge peers:

```bash
npm install @theorvane/type-chain@0.2.0 @theorvane/type-mcp@0.3.0 @langchain/core langchain zod
npm install @theorvane/type-chain@0.2.1 @theorvane/type-mcp@0.3.1 @langchain/core langchain zod
```

Create `src/petstore-server.ts`:
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/policy.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Declarative policy and application-owned guards

The published `@theorvane/type-chain@0.2.0` package lets a tool declare policy intent. It does not provide a default allow/deny decision or enforce authorization, approvals, retries, timeouts, idempotency, auditing, or redaction.
The published `@theorvane/type-chain@0.2.1` package lets a tool declare policy intent. It does not provide a default allow/deny decision or enforce authorization, approvals, retries, timeouts, idempotency, auditing, or redaction.

## Prerequisites

Expand All @@ -11,7 +11,7 @@ The published `@theorvane/type-chain@0.2.0` package lets a tool declare policy i
## Install

```bash
npm install @theorvane/type-chain@0.2.0 zod
npm install @theorvane/type-chain@0.2.1 zod
```

Use the `/langchain` optional subpath only if the application later adapts guarded tools to LangChain.
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/tools-and-definitions.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tools and definitions

This guide uses the published `@theorvane/type-chain@0.2.0` root surface to record explicit tool metadata and inspect immutable, receiver-bound definitions. TypeChain does not infer runtime schemas from TypeScript types or start a transport.
This guide uses the published `@theorvane/type-chain@0.2.1` root surface to record explicit tool metadata and inspect immutable, receiver-bound definitions. TypeChain does not infer runtime schemas from TypeScript types or start a transport.

## Prerequisites

Expand All @@ -11,7 +11,7 @@ This guide uses the published `@theorvane/type-chain@0.2.0` root surface to reco
## Install

```bash
npm install @theorvane/type-chain@0.2.0 zod
npm install @theorvane/type-chain@0.2.1 zod
```

The root metadata package has no required optional peer. Add `/langchain`, `/agent`, or `/typemcp` only when your application chooses that integration boundary.
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/typemcp-bridge.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TypeMCP in-process bridge

The published `@theorvane/type-chain@0.2.0` `/typemcp` subpath composes a TypeMCP-decorated server into native LangChain tools in the same Node.js process. TypeMCP owns declaration validation and instance resolution; LangChain owns agent construction; the application owns models, policies, dependencies, and deployment.
The published `@theorvane/type-chain@0.2.1` `/typemcp` subpath composes a TypeMCP-decorated server into native LangChain tools in the same Node.js process. TypeMCP owns declaration validation and instance resolution; LangChain owns agent construction; the application owns models, policies, dependencies, and deployment.

## Prerequisites

Expand All @@ -12,7 +12,7 @@ The published `@theorvane/type-chain@0.2.0` `/typemcp` subpath composes a TypeMC
## Install

```bash
npm install @theorvane/type-chain@0.2.0 @theorvane/type-mcp@0.3.0 @langchain/core langchain zod
npm install @theorvane/type-chain@0.2.1 @theorvane/type-mcp@0.3.1 @langchain/core langchain zod
```

This is an optional integration boundary; the root TypeChain package does not import TypeMCP or LangChain peers.
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 35 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@theorvane/type-chain",
"version": "0.2.0",
"version": "0.2.1",
"description": "Decorator-first, type-safe authoring layer for LangChain JS tools and agents.",
"license": "MIT",
"type": "module",
Expand All @@ -12,24 +12,44 @@
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./langchain": {
"types": "./dist/langchain.d.ts",
"import": "./dist/langchain.js",
"default": "./dist/langchain.js"
"import": {
"types": "./dist/langchain.d.ts",
"default": "./dist/langchain.js"
},
"require": {
"types": "./dist/langchain.d.cts",
"default": "./dist/langchain.cjs"
}
},
"./agent": {
"types": "./dist/agent.d.ts",
"import": "./dist/agent.js",
"default": "./dist/agent.js"
"import": {
"types": "./dist/agent.d.ts",
"default": "./dist/agent.js"
},
"require": {
"types": "./dist/agent.d.cts",
"default": "./dist/agent.cjs"
}
},
"./typemcp": {
"types": "./dist/typemcp.d.ts",
"import": "./dist/typemcp.js",
"default": "./dist/typemcp.js"
"import": {
"types": "./dist/typemcp.d.ts",
"default": "./dist/typemcp.js"
},
"require": {
"types": "./dist/typemcp.d.cts",
"default": "./dist/typemcp.cjs"
}
},
"./legacy": {
"import": {
Expand All @@ -52,7 +72,7 @@
"access": "public"
},
"scripts": {
"build": "tsc --project tsconfig.build.json && tsup src/legacy.ts --format esm,cjs --dts --out-dir dist --clean=false",
"build": "tsc --project tsconfig.build.json && tsup src/index.ts src/langchain.ts src/agent.ts src/typemcp.ts src/legacy.ts --format cjs --dts --out-dir dist --clean=false && tsup src/legacy.ts --format esm --out-dir dist --clean=false",
"lint": "biome check .",
"format:check": "biome format .",
"typecheck": "tsc --noEmit",
Expand Down Expand Up @@ -100,7 +120,7 @@
"devDependencies": {
"@biomejs/biome": "^2.5.5",
"@langchain/core": "1.2.3",
"@theorvane/type-mcp": "0.3.0",
"@theorvane/type-mcp": "0.3.1",
"langchain": "1.5.4",
"tsup": "^8.5.1",
"typescript": "^5.9.3",
Expand Down
Loading
Loading