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 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.1.1`](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.0`](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
2 changes: 1 addition & 1 deletion 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.1.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.
`@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.

## Root package

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.1.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.
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.

## Prerequisites

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

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

`/agent` is optional. Import the root package alone when tool metadata is sufficient.
Expand Down
12 changes: 6 additions & 6 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.1.1` 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.0` 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.1.1
npm install @theorvane/type-chain@0.2.0
```

| 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.1.1 @langchain/core langchain zod
npm install @theorvane/type-chain@0.2.0 @langchain/core langchain zod

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

## Begin with one declared tool
Expand Down Expand Up @@ -127,7 +127,7 @@ export const tools = await createTypeMcpLangChainTools(PetstoreServer, {
});
```

The TypeMCP-decorated server must keep a zero-argument constructor under the published `0.2.2` `@McpServer` contract. The resolver configures application dependencies before conversion; the explicit resolver remains application-owned. TypeMCP validates the MCP declaration and resolves the server instance; TypeChain adapts the resulting tools; LangChain owns agent construction. No stdio or HTTP transport is started. Use TypeMCP’s transport hosts separately when tools must be accessed across process boundaries.
The TypeMCP-decorated server must keep a zero-argument constructor under the published `0.3.0` `@McpServer` contract. The resolver configures application dependencies before conversion; the explicit resolver remains application-owned. TypeMCP validates the MCP declaration and resolves the server instance; TypeChain adapts the resulting tools; LangChain owns agent construction. No stdio or HTTP transport is started. Use TypeMCP’s transport hosts separately when tools must be accessed across process boundaries.

## Run and verify

Expand Down Expand Up @@ -177,6 +177,6 @@ TypeChain owns explicit tool/policy metadata and the selected adapter. The appli
- [LangChain integration](langchain-integration.md) covers standard structured-tool adaptation.
- [Agent builder](agent-builder.md) details direct agent construction and guarded agents.
- [TypeMCP bridge](typemcp-bridge.md) explains the in-process TypeMCP composition boundary.
- [Decorator API contract](../api/decorator-api.md) lists every public `0.1.1` import surface.
- [Decorator API contract](../api/decorator-api.md) lists every public `0.2.0` import surface.

The selected subpath should match the integration boundary, not the product label. Use the root package for declarations, the LangChain adapter for existing LangChain composition, the agent bridge only when the application owns a model, and the TypeMCP bridge only for in-process composition.
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.1.1`](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.0`](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.1.1
# Getting started with @theorvane/type-chain@0.2.0

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.1.1`, configures Stage 3 decorators, and declares a first tool.
This guide installs the published package `@theorvane/type-chain@0.2.0`, 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.1.1`, configu
## Install

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

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.1.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.
`@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.

## Prerequisites

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

```bash
npm install @theorvane/type-chain@0.1.1 @langchain/core langchain zod
npm install @theorvane/type-chain@0.2.0 @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.1.1` and `zod` installed.
- Node.js 20 or later with `@theorvane/type-chain@0.2.0` 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.1.1 zod
npm install @theorvane/type-chain@0.2.0 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.2.2 @langchain/core langchain
npm install @theorvane/type-mcp@0.3.0 @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.1.1`](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.0`](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.1.1 zod
npm install @theorvane/type-chain@0.2.0 zod
npm install --save-dev typescript tsx @types/node
npm pkg set type=module
npm pkg set scripts.check="tsc --noEmit"
Expand Down
10 changes: 5 additions & 5 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.1.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.
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.

> **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.1.1 zod
npm install @theorvane/type-chain@0.2.0 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.1.1 @langchain/core langchain zod
npm install @theorvane/type-chain@0.2.0 @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.1.1 @theorvane/type-mcp@0.2.2 @langchain/core langchain zod
npm install @theorvane/type-chain@0.2.0 @theorvane/type-mcp@0.3.0 @langchain/core langchain zod
```

Create `src/petstore-server.ts`:
Expand Down Expand Up @@ -181,7 +181,7 @@ export const tools = await createTypeMcpLangChainTools(PetstoreServer, {
});
```

The TypeMCP-decorated class deliberately keeps a zero-argument constructor because that is the published `@McpServer` contract in `0.2.2`. The explicit resolver configures the application-owned client before conversion; keep that composition-root seam while preserving the TypeMCP declaration contract.
The TypeMCP-decorated class deliberately keeps a zero-argument constructor because that is the published `@McpServer` contract in `0.3.0`. The explicit resolver configures the application-owned client before conversion; keep that composition-root seam while preserving the TypeMCP declaration contract.

The resolver and `petstoreClient` remain application-owned. The bridge converts TypeMCP tools to native LangChain tools in process. It does not start stdio/HTTP, create an MCP client/session, or grant cross-process access. Use TypeMCP transport hosts separately when a client must reach another process.

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.1.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.
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.

## Prerequisites

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

```bash
npm install @theorvane/type-chain@0.1.1 zod
npm install @theorvane/type-chain@0.2.0 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.1.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.
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.

## Prerequisites

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

```bash
npm install @theorvane/type-chain@0.1.1 zod
npm install @theorvane/type-chain@0.2.0 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.1.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.
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.

## Prerequisites

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

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

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

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@theorvane/type-chain",
"version": "0.1.1",
"version": "0.2.0",
"description": "Decorator-first, type-safe authoring layer for LangChain JS tools and agents.",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -83,7 +83,7 @@
],
"peerDependencies": {
"@langchain/core": "^1.2.3",
"@theorvane/type-mcp": "^0.2.0",
"@theorvane/type-mcp": "^0.3.0",
"langchain": "^1.5.4"
},
"peerDependenciesMeta": {
Expand All @@ -100,7 +100,7 @@
"devDependencies": {
"@biomejs/biome": "^2.5.5",
"@langchain/core": "1.2.3",
"@theorvane/type-mcp": "0.2.2",
"@theorvane/type-mcp": "0.3.0",
"langchain": "1.5.4",
"tsup": "^8.5.1",
"typescript": "^5.9.3",
Expand Down
Loading
Loading