From ec4b0d8024a0dd81c6fe5256d980eae39e64e789 Mon Sep 17 00:00:00 2001 From: ratchaw Date: Sun, 12 Jul 2026 19:13:29 +0100 Subject: [PATCH] Rename npm package to @ratchaw/extractkit Scoped under the ratchaw npm account with publishConfig.access: public (scoped packages default to private). Updates all workspace imports, manifests, README examples, and the ROADMAP publish instructions. Co-Authored-By: Claude Fable 5 --- README.md | 4 ++-- ROADMAP.md | 2 +- apps/playground/README.md | 2 +- apps/playground/package.json | 2 +- .../src/client/components/DocumentViewer.tsx | 2 +- .../playground/src/client/components/ResultPanel.tsx | 2 +- apps/playground/src/client/lib/fields.ts | 2 +- apps/playground/src/client/lib/geometry.ts | 2 +- apps/playground/src/client/lib/snap.ts | 2 +- apps/playground/src/server/app.ts | 4 ++-- apps/playground/src/server/models.ts | 2 +- apps/playground/src/shared/api.ts | 2 +- apps/playground/test/helpers.ts | 2 +- packages/core/README.md | 6 +++--- packages/core/package.json | 5 ++++- packages/evals/package.json | 2 +- packages/evals/src/datasets/cord-source.ts | 2 +- packages/evals/src/datasets/cord.ts | 2 +- packages/evals/src/datasets/docile.ts | 2 +- packages/evals/src/metrics.ts | 2 +- packages/evals/src/models.ts | 2 +- packages/evals/src/runner.ts | 4 ++-- packages/evals/src/types.ts | 2 +- packages/evals/test/metrics.test.ts | 2 +- pnpm-lock.yaml | 12 ++++++------ 25 files changed, 38 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 05c7463..77f3a65 100644 --- a/README.md +++ b/README.md @@ -9,14 +9,14 @@ ## Quickstart ```sh -npm install extractkit ai zod +npm install @ratchaw/extractkit ai zod ``` `ai` (Vercel AI SDK v7) and `zod` (v4) are peer dependencies. Bring any AI SDK provider — `@ai-sdk/anthropic`, `@ai-sdk/openai`, `@ai-sdk/google`, … — and pass its model to `extract`: ```ts import { anthropic } from '@ai-sdk/anthropic'; -import { extract } from 'extractkit'; +import { extract } from '@ratchaw/extractkit'; import { readFile } from 'node:fs/promises'; import { z } from 'zod'; diff --git a/ROADMAP.md b/ROADMAP.md index b86dbbe..496803b 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -32,7 +32,7 @@ Live-provider path validated via the playground and the first Phase 2 eval run ( - [x] README final: pitch, benchmark table, demo GIF, quickstart - [x] MIT license (repo root + shipped in the npm package) -- [ ] Publish `extractkit` to npm — package is publish-ready (tarball verified: dist + README + LICENSE, 13.5 kB); blocked on `npm login`, then `pnpm --filter extractkit publish` (human action) +- [ ] Publish `@ratchaw/extractkit` to npm — package is publish-ready (tarball verified: dist + README + LICENSE; scoped, `publishConfig.access: public`); blocked on `npm login`, then `pnpm --filter @ratchaw/extractkit publish` (human action) ## Non-goals for v1 diff --git a/apps/playground/README.md b/apps/playground/README.md index fc21177..db1e4a8 100644 --- a/apps/playground/README.md +++ b/apps/playground/README.md @@ -10,7 +10,7 @@ From the repo root (the core library must be built once so the server can import ```sh pnpm install -pnpm --filter extractkit build +pnpm --filter @ratchaw/extractkit build ``` Set at least one provider key — copy `.env.example` to `.env` and fill one in, or export it: diff --git a/apps/playground/package.json b/apps/playground/package.json index 623ef81..02e87ef 100644 --- a/apps/playground/package.json +++ b/apps/playground/package.json @@ -22,7 +22,7 @@ "@ai-sdk/openai": "^4.0.11", "@hono/node-server": "^2.0.8", "ai": "^7.0.16", - "extractkit": "workspace:*", + "@ratchaw/extractkit": "workspace:*", "hono": "^4.12.29", "pdfjs-dist": "^6.1.200", "react": "^19.2.7", diff --git a/apps/playground/src/client/components/DocumentViewer.tsx b/apps/playground/src/client/components/DocumentViewer.tsx index 1ea12a1..69aa41f 100644 --- a/apps/playground/src/client/components/DocumentViewer.tsx +++ b/apps/playground/src/client/components/DocumentViewer.tsx @@ -3,7 +3,7 @@ import type { DragEvent } from 'react'; import { GlobalWorkerOptions, Util, getDocument } from 'pdfjs-dist'; import type { PDFDocumentLoadingTask, PDFPageProxy } from 'pdfjs-dist'; import workerSrc from 'pdfjs-dist/build/pdf.worker.min.mjs?url'; -import type { BBox as BBoxRect } from 'extractkit'; +import type { BBox as BBoxRect } from '@ratchaw/extractkit'; import type { FieldEntry } from '../lib/fields'; import { formatPath, formatValue } from '../lib/fields'; import { bboxToStyle } from '../lib/geometry'; diff --git a/apps/playground/src/client/components/ResultPanel.tsx b/apps/playground/src/client/components/ResultPanel.tsx index 0e27f4b..a39bfc3 100644 --- a/apps/playground/src/client/components/ResultPanel.tsx +++ b/apps/playground/src/client/components/ResultPanel.tsx @@ -2,7 +2,7 @@ import type { ApiError, SerializedResult } from '../../shared/api'; import type { Phase } from '../App'; import type { AnyField, FieldEntry } from '../lib/fields'; import { formatPath, formatValue, isField, leafLabel, pathKey } from '../lib/fields'; -import type { FieldPath } from 'extractkit'; +import type { FieldPath } from '@ratchaw/extractkit'; interface ResultPanelProps { phase: Phase; diff --git a/apps/playground/src/client/lib/fields.ts b/apps/playground/src/client/lib/fields.ts index b2afc14..c868e5c 100644 --- a/apps/playground/src/client/lib/fields.ts +++ b/apps/playground/src/client/lib/fields.ts @@ -1,4 +1,4 @@ -import type { ExtractedField, FieldPath } from 'extractkit'; +import type { ExtractedField, FieldPath } from '@ratchaw/extractkit'; export type AnyField = ExtractedField; diff --git a/apps/playground/src/client/lib/geometry.ts b/apps/playground/src/client/lib/geometry.ts index 524b203..1980f90 100644 --- a/apps/playground/src/client/lib/geometry.ts +++ b/apps/playground/src/client/lib/geometry.ts @@ -1,4 +1,4 @@ -import type { BBox } from 'extractkit'; +import type { BBox } from '@ratchaw/extractkit'; export interface BoxStyle { left: string; diff --git a/apps/playground/src/client/lib/snap.ts b/apps/playground/src/client/lib/snap.ts index 3359cdd..4c90963 100644 --- a/apps/playground/src/client/lib/snap.ts +++ b/apps/playground/src/client/lib/snap.ts @@ -1,4 +1,4 @@ -import type { BBox } from 'extractkit'; +import type { BBox } from '@ratchaw/extractkit'; /** A positioned text run from the PDF text layer, normalized 0–1, origin top-left. */ export interface TextSpan { diff --git a/apps/playground/src/server/app.ts b/apps/playground/src/server/app.ts index 91387af..3f3eabd 100644 --- a/apps/playground/src/server/app.ts +++ b/apps/playground/src/server/app.ts @@ -1,5 +1,5 @@ -import { ExtractKitError, MissingRequiredFieldsError, streamExtract } from 'extractkit'; -import type { ExtractResult } from 'extractkit'; +import { ExtractKitError, MissingRequiredFieldsError, streamExtract } from '@ratchaw/extractkit'; +import type { ExtractResult } from '@ratchaw/extractkit'; import { Hono } from 'hono'; import { bodyLimit } from 'hono/body-limit'; import { streamSSE } from 'hono/streaming'; diff --git a/apps/playground/src/server/models.ts b/apps/playground/src/server/models.ts index 0e1f923..12ce703 100644 --- a/apps/playground/src/server/models.ts +++ b/apps/playground/src/server/models.ts @@ -2,7 +2,7 @@ import { anthropic } from '@ai-sdk/anthropic'; import { google } from '@ai-sdk/google'; import { openai } from '@ai-sdk/openai'; import type { LanguageModel } from 'ai'; -import type { Pricing } from 'extractkit'; +import type { Pricing } from '@ratchaw/extractkit'; import type { ModelInfo } from '../shared/api'; /** A model the playground can run, plus how to build it and price it. */ diff --git a/apps/playground/src/shared/api.ts b/apps/playground/src/shared/api.ts index 524416c..6d8d7f5 100644 --- a/apps/playground/src/shared/api.ts +++ b/apps/playground/src/shared/api.ts @@ -1,4 +1,4 @@ -import type { ExtractedField, ExtractUsage, FieldPath } from 'extractkit'; +import type { ExtractedField, ExtractUsage, FieldPath } from '@ratchaw/extractkit'; /** A single extracted leaf with its provenance, as sent over the wire. */ export type WireField = ExtractedField; diff --git a/apps/playground/test/helpers.ts b/apps/playground/test/helpers.ts index b4320d1..094b457 100644 --- a/apps/playground/test/helpers.ts +++ b/apps/playground/test/helpers.ts @@ -1,6 +1,6 @@ import { MockLanguageModelV4, simulateReadableStream } from 'ai/test'; import type { LanguageModel } from 'ai'; -import type { Pricing } from 'extractkit'; +import type { Pricing } from '@ratchaw/extractkit'; import type { PlaygroundModel } from '../src/server/models'; /** A 12-byte buffer with a valid PNG signature — enough for normalizeDocument. */ diff --git a/packages/core/README.md b/packages/core/README.md index 8cfef08..de8f8a2 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -7,7 +7,7 @@ ## Install ```sh -npm install extractkit ai zod +npm install @ratchaw/extractkit ai zod ``` `ai` (Vercel AI SDK v7) and `zod` (v4) are peer dependencies. Bring any AI SDK provider — e.g. `@ai-sdk/anthropic`, `@ai-sdk/openai`, or `@ai-sdk/google` — and pass its model to `extract`. @@ -16,7 +16,7 @@ npm install extractkit ai zod ```ts import { anthropic } from '@ai-sdk/anthropic'; -import { extract } from 'extractkit'; +import { extract } from '@ratchaw/extractkit'; import { readFile } from 'node:fs/promises'; import { z } from 'zod'; @@ -57,7 +57,7 @@ Every leaf of your schema comes back twice: the plain value in `data` (validated ## Streaming ```ts -import { streamExtract } from 'extractkit'; +import { streamExtract } from '@ratchaw/extractkit'; const stream = streamExtract({ schema: invoice, document, model }); diff --git a/packages/core/package.json b/packages/core/package.json index 4a540d8..bfbdb3c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,5 +1,8 @@ { - "name": "extractkit", + "name": "@ratchaw/extractkit", + "publishConfig": { + "access": "public" + }, "version": "0.1.0", "description": "Schema-first document extraction with per-field provenance: Zod schema + PDF/image in, validated JSON with page, bbox, and confidence out.", "license": "MIT", diff --git a/packages/evals/package.json b/packages/evals/package.json index ef1db67..c2cc821 100644 --- a/packages/evals/package.json +++ b/packages/evals/package.json @@ -20,7 +20,7 @@ "@ai-sdk/google": "^4.0.12", "@ai-sdk/openai": "^4.0.11", "ai": "^7.0.16", - "extractkit": "workspace:*", + "@ratchaw/extractkit": "workspace:*", "hyparquet": "^1.14.0", "zod": "^4.4.3" }, diff --git a/packages/evals/src/datasets/cord-source.ts b/packages/evals/src/datasets/cord-source.ts index e7a3acd..fdf5702 100644 --- a/packages/evals/src/datasets/cord-source.ts +++ b/packages/evals/src/datasets/cord-source.ts @@ -1,5 +1,5 @@ import { asyncBufferFromFile, parquetMetadataAsync, parquetReadObjects } from 'hyparquet'; -import { sniffMediaType } from 'extractkit'; +import { sniffMediaType } from '@ratchaw/extractkit'; import { sha256Hex, type CordPin, type Manifest } from '../manifest.js'; import { cordToGroundTruth, type CordGroundTruth } from './cord.js'; import type { EvalDocument } from '../types.js'; diff --git a/packages/evals/src/datasets/cord.ts b/packages/evals/src/datasets/cord.ts index 0df24d4..c316b67 100644 --- a/packages/evals/src/datasets/cord.ts +++ b/packages/evals/src/datasets/cord.ts @@ -1,4 +1,4 @@ -import type { BBox } from 'extractkit'; +import type { BBox } from '@ratchaw/extractkit'; import { valuesMatch } from '../normalize.js'; import type { CompareKind, GroundTruthField, GroundTruthRegion } from '../types.js'; diff --git a/packages/evals/src/datasets/docile.ts b/packages/evals/src/datasets/docile.ts index e9e311e..c9f128c 100644 --- a/packages/evals/src/datasets/docile.ts +++ b/packages/evals/src/datasets/docile.ts @@ -1,4 +1,4 @@ -import type { BBox } from 'extractkit'; +import type { BBox } from '@ratchaw/extractkit'; import { normalizeValue } from '../normalize.js'; import type { CompareKind, GroundTruthField, GroundTruthRegion } from '../types.js'; diff --git a/packages/evals/src/metrics.ts b/packages/evals/src/metrics.ts index 753d1d1..ef1420e 100644 --- a/packages/evals/src/metrics.ts +++ b/packages/evals/src/metrics.ts @@ -1,4 +1,4 @@ -import type { BBox, ExtractedField } from 'extractkit'; +import type { BBox, ExtractedField } from '@ratchaw/extractkit'; import { valuesMatch } from './normalize.js'; import type { DocResult, EvalDocument, FieldResult, GroundTruthField, ModelRun, SchemaId } from './types.js'; diff --git a/packages/evals/src/models.ts b/packages/evals/src/models.ts index a9740da..7c5202e 100644 --- a/packages/evals/src/models.ts +++ b/packages/evals/src/models.ts @@ -2,7 +2,7 @@ import { anthropic } from '@ai-sdk/anthropic'; import { google } from '@ai-sdk/google'; import { openai } from '@ai-sdk/openai'; import type { LanguageModel } from 'ai'; -import type { Pricing } from 'extractkit'; +import type { Pricing } from '@ratchaw/extractkit'; import type { EvalModel } from './types.js'; export type Provider = 'anthropic' | 'openai' | 'google'; diff --git a/packages/evals/src/runner.ts b/packages/evals/src/runner.ts index 10cea3b..00130af 100644 --- a/packages/evals/src/runner.ts +++ b/packages/evals/src/runner.ts @@ -1,5 +1,5 @@ -import { extract, ExtractKitError, MissingRequiredFieldsError } from 'extractkit'; -import type { ExtractUsage } from 'extractkit'; +import { extract, ExtractKitError, MissingRequiredFieldsError } from '@ratchaw/extractkit'; +import type { ExtractUsage } from '@ratchaw/extractkit'; import { scoreExtraction, scoreFailure } from './metrics.js'; import { schemas } from './schemas.js'; import type { DocResult, EvalDocument, EvalModel, ModelRun } from './types.js'; diff --git a/packages/evals/src/types.ts b/packages/evals/src/types.ts index bdd2089..4a6932a 100644 --- a/packages/evals/src/types.ts +++ b/packages/evals/src/types.ts @@ -1,4 +1,4 @@ -import type { BBox, Pricing, SupportedMediaType } from 'extractkit'; +import type { BBox, Pricing, SupportedMediaType } from '@ratchaw/extractkit'; import type { LanguageModel } from 'ai'; export type DatasetId = 'cord' | 'docile'; diff --git a/packages/evals/test/metrics.test.ts b/packages/evals/test/metrics.test.ts index 494d4a0..ba19b0b 100644 --- a/packages/evals/test/metrics.test.ts +++ b/packages/evals/test/metrics.test.ts @@ -1,4 +1,4 @@ -import type { ExtractedField } from 'extractkit'; +import type { ExtractedField } from '@ratchaw/extractkit'; import { describe, expect, it } from 'vitest'; import { iou, scoreExtraction, scoreFailure, summarizeRun } from '../src/metrics.js'; import type { EvalDocument, GroundTruthField, ModelRun } from '../src/types.js'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7000eab..58e256c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,12 +22,12 @@ importers: '@hono/node-server': specifier: ^2.0.8 version: 2.0.8(hono@4.12.29) + '@ratchaw/extractkit': + specifier: workspace:* + version: link:../../packages/core ai: specifier: ^7.0.16 version: 7.0.16(zod@4.4.3) - extractkit: - specifier: workspace:* - version: link:../../packages/core hono: specifier: ^4.12.29 version: 4.12.29 @@ -108,12 +108,12 @@ importers: '@ai-sdk/openai': specifier: ^4.0.11 version: 4.0.11(zod@4.4.3) + '@ratchaw/extractkit': + specifier: workspace:* + version: link:../core ai: specifier: ^7.0.16 version: 7.0.16(zod@4.4.3) - extractkit: - specifier: workspace:* - version: link:../core hyparquet: specifier: ^1.14.0 version: 1.26.2