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
34 changes: 20 additions & 14 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish @verdict/node to npm
name: Publish @bodanglin/verdict-node to npm

on:
release:
Expand Down Expand Up @@ -26,13 +26,15 @@ jobs:
run: npm run build
- name: Run tests
run: npm test
- name: Verify package contents
run: npm pack --dry-run
- name: Upload package artifacts
- name: Verify package contents and smoke install
run: npm run verify:package
- name: Dry-run publish gate
run: npm publish --dry-run --access public
- name: Upload release notes
uses: actions/upload-artifact@v7
with:
name: verdict-node-package
path: dist/
name: verdict-node-release-notes
path: CHANGELOG.md

publish-to-npm:
needs: build-and-test
Expand All @@ -46,12 +48,16 @@ jobs:
with:
node-version: "22"
registry-url: https://registry.npmjs.org
- name: Download package artifacts
uses: actions/download-artifact@v7
with:
name: verdict-node-package
path: dist/
- name: Publish to npm
run: npm publish --access public --provenance
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Verify package before publish
run: npm run verify:package
- name: Assert requested version matches package.json
if: ${{ github.event_name == 'workflow_dispatch' && inputs.version != '' }}
run: node -e "const expected=process.env.INPUT_VERSION; const actual=require('./package.json').version; if (actual !== expected) throw new Error(`workflow version ${expected} != package.json ${actual}`)"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
INPUT_VERSION: ${{ inputs.version }}
- name: Publish to npm
run: npm publish --access public --provenance
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @verdict/node — TypeScript Middleware for Verdict Routing
# @bodanglin/verdict-node — TypeScript Middleware for Verdict Routing

[![npm](https://img.shields.io/npm/v/@verdict/node.svg)](https://www.npmjs.com/package/@verdict/node)
[![npm](https://img.shields.io/npm/v/@bodanglin/verdict-node.svg)](https://www.npmjs.com/package/@bodanglin/verdict-node)
[![TypeScript](https://img.shields.io/badge/typescript-strict-blue.svg)](https://www.typescriptlang.org/)
[![Tests](https://img.shields.io/badge/tests-139%20passing-brightgreen.svg)](<>)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
Expand All @@ -9,9 +9,9 @@

---

## What is @verdict/node?
## What is @bodanglin/verdict-node?

`@verdict/node` is the TypeScript gateway integration layer for the **Verdict** ecosystem. It accepts an Express/Next.js request, classifies criticality, discovers models from your configured OpenAI-compatible upstream (default: OmniRoute at `http://localhost:20128/v1`), rewrites the selected model, and forwards non-streaming SSE responses.
`@bodanglin/verdict-node` is the TypeScript gateway integration layer for the **Verdict** ecosystem. It accepts an Express/Next.js request, classifies criticality, discovers models from your configured OpenAI-compatible upstream (default: OmniRoute at `http://localhost:20128/v1`), rewrites the selected model, and forwards non-streaming SSE responses.

**Works with any OpenAI-compatible client**: Claude Code, Codex, Cursor, Cline, Hermes, Agents SDK, raw HTTP.

Expand Down Expand Up @@ -51,11 +51,11 @@ behind an install fallback.
## Install

```bash
npm install @verdict/node
npm install @bodanglin/verdict-node
# or
pnpm add @verdict/node
pnpm add @bodanglin/verdict-node
# or
yarn add @verdict/node
yarn add @bodanglin/verdict-node
```

**Peer dependency**: `express@>=5.0.0 <6`
Expand All @@ -66,7 +66,7 @@ yarn add @verdict/node

```typescript
import express from 'express';
import { verdictMiddleware } from '@verdict/node/middleware';
import { verdictMiddleware } from '@bodanglin/verdict-node/middleware';

const app = express();
app.use(express.json());
Expand Down Expand Up @@ -96,7 +96,7 @@ node dist/index.js
## Configuration

```typescript
import { verdictMiddleware, VerdictConfig } from '@verdict/node/middleware';
import { verdictMiddleware, VerdictConfig } from '@bodanglin/verdict-node/middleware';

const config: VerdictConfig = {
// Upstream OpenAI-compatible endpoint
Expand Down Expand Up @@ -146,14 +146,14 @@ Express middleware that:
### Types

```typescript
// From @verdict/node
// From @bodanglin/verdict-node
import type {
VerdictConfig,
ModelInfo,
CriticalityLevel,
ChatCompletionRequest,
ChatCompletionResponse,
} from '@verdict/node';
} from '@bodanglin/verdict-node';
```

---
Expand Down Expand Up @@ -226,7 +226,7 @@ verdict-node/
| Package | Purpose |
| ----------------------------------------------------------------- | -------------------------------------- |
| [`verdict-core`](https://github.com/verdict/verdict-core) | Python control plane |
| `@verdict/node` | Express/Next.js middleware (this repo) |
| `@bodanglin/verdict-node` | Express/Next.js middleware (this repo) |
| [`verdict-cockpit`](https://github.com/verdict/verdict-cockpit) | Next.js dashboard |
| [`verdict-risk`](https://github.com/verdict/verdict-risk) | Risk engine |
| [`verdict-edge`](https://github.com/verdict/verdict-edge) | Edge mining framework |
Expand Down
4 changes: 2 additions & 2 deletions scripts/verify-package.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { tmpdir } from 'node:os';
import { basename, join, resolve } from 'node:path';

const packageName = '@bodanglin/verdict-node';
const repoCompiler = resolve(process.cwd(), 'node_modules/.bin/tsc');
const allowedTopLevel = new Set(['CHANGELOG.md', 'LICENSE', 'README.md', 'dist', 'package.json']);
const requiredFiles = new Set([
'CHANGELOG.md',
Expand Down Expand Up @@ -157,9 +158,8 @@ void validate;
)}\n`,
'utf8'
);
const tsc = resolve('node_modules/.bin/tsc');
try {
run(tsc, ['--project', join(consumerDirectory, 'tsconfig.json')], {
run(repoCompiler, ['--project', join(consumerDirectory, 'tsconfig.json')], {
cwd: consumerDirectory,
});
} catch (error) {
Expand Down