diff --git a/README.md b/README.md index 9cfc82e..cfabddd 100644 --- a/README.md +++ b/README.md @@ -5,19 +5,17 @@ Run a DeepSeek agent loop inside a SQLite-backed Cloudflare Durable Object. The ## Install ```sh -bun add github:checkfu/deepseek-durable-objects#v0.0.1 +npm install @checkfu/deepseek-durable-objects ``` -GitHub releases also include an installable tarball and its SHA-256 checksum. Checkfu pins this repository to an exact commit in its Bun catalog. - ## Use with a Worker -Import `openDeepSeekSession` from `deepseek-durable-objects`. Construct one runtime per Durable Object. Pass the object's SQLite storage, a stable session ID, the initial model configuration, and a tool host. Keep the provider and model pinned for that runtime. +Import `openDeepSeekSession` from `@checkfu/deepseek-durable-objects`. Construct one runtime per Durable Object. Pass the object's SQLite storage, a stable session ID, the initial model configuration, and a tool host. Keep the provider and model pinned for that runtime. -Call `submit`, `settle`, and `abort` from the host's turn lifecycle. Use the same operation ID when recovering or resuming a turn. Drive recovery from the Durable Object alarm. The host supplies credentials and decides which tools can run, how to publish replies, and how to record usage. Use `withDeepSeekDispatch` from `deepseek-durable-objects/transport` to intercept a model dispatch for accounting. +Call `submit`, `settle`, and `abort` from the host's turn lifecycle. Use the same operation ID when recovering or resuming a turn. Drive recovery from the Durable Object alarm. The host supplies credentials and decides which tools can run, how to publish replies, and how to record usage. Use `withDeepSeekDispatch` from `@checkfu/deepseek-durable-objects/transport` to intercept a model dispatch for accounting. -Add `deepSeekWorkerdBuild` from `deepseek-durable-objects/workerd` to the Worker bundler using Cloudflare's Node compatibility. With Alchemy, load the plugin in the Worker source provider so the build sidecar can resolve it. The [standalone Worker fixture](test/fixtures/worker.mjs) shows the storage and tool interfaces in use. +Add `deepSeekWorkerdBuild` from `@checkfu/deepseek-durable-objects/workerd` to the Worker bundler using Cloudflare's Node compatibility. With Alchemy, load the plugin in the Worker source provider so the build sidecar can resolve it. The [standalone Worker fixture](test/fixtures/worker.mjs) shows the storage and tool interfaces in use. ## Develop -Run `bun install --frozen-lockfile` and `bun run verify`. The checks include the compiled package, direct provider fixtures, and a Workerd restart against the same SQLite Durable Object. Commit the generated `dist/` after changing the source so pinned Git installs can use it directly. To release, update the version and lockfile, merge to `main`, and push the matching `v` tag. +Run `bun install --frozen-lockfile` and `bun run verify`. The checks include the compiled package, direct provider fixtures, and a Workerd restart against the same SQLite Durable Object. Commit the generated `dist/` after changing the source; CI checks that it matches. To release, update the version and lockfile, merge to `main`, push the matching `v` tag, and run `npm publish` from that commit. diff --git a/package.json b/package.json index 730b9ba..40af6ea 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "deepseek-durable-objects", + "name": "@checkfu/deepseek-durable-objects", "version": "0.0.1", "description": "DeepSeek agent sessions for SQLite-backed Cloudflare Durable Objects.", "license": "MIT", diff --git a/scripts/check-consumer.mjs b/scripts/check-consumer.mjs index faa471c..d0d8018 100644 --- a/scripts/check-consumer.mjs +++ b/scripts/check-consumer.mjs @@ -1,9 +1,9 @@ import assert from "node:assert/strict"; import { access } from "node:fs/promises"; import { fileURLToPath } from "node:url"; -import { openDeepSeekSession } from "deepseek-durable-objects"; -import { withDeepSeekDispatch } from "deepseek-durable-objects/transport"; -import { deepSeekWorkerdBuild } from "deepseek-durable-objects/workerd"; +import { openDeepSeekSession } from "@checkfu/deepseek-durable-objects"; +import { withDeepSeekDispatch } from "@checkfu/deepseek-durable-objects/transport"; +import { deepSeekWorkerdBuild } from "@checkfu/deepseek-durable-objects/workerd"; assert.equal(typeof openDeepSeekSession, "function"); assert.equal(typeof withDeepSeekDispatch, "function"); diff --git a/test/Runtime.test.ts b/test/Runtime.test.ts index 4e0bf4b..d4e1fda 100644 --- a/test/Runtime.test.ts +++ b/test/Runtime.test.ts @@ -2,8 +2,8 @@ import assert from "node:assert/strict"; import { createServer } from "node:http"; import { once } from "node:events"; import { text } from "node:stream/consumers"; -import { openDeepSeekSession } from "deepseek-durable-objects"; -import type { DeepSeekStorage, DeepSeekTurn } from "deepseek-durable-objects"; +import { openDeepSeekSession } from "@checkfu/deepseek-durable-objects"; +import type { DeepSeekStorage, DeepSeekTurn } from "@checkfu/deepseek-durable-objects"; import { expect, it } from "vitest"; import { scriptedMessage } from "./helpers/ScriptedMessages.ts"; diff --git a/test/Workerd.test.ts b/test/Workerd.test.ts index 439bb24..c0d096f 100644 --- a/test/Workerd.test.ts +++ b/test/Workerd.test.ts @@ -3,7 +3,7 @@ import { mkdtemp, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; import { fileURLToPath } from "node:url"; -import { deepSeekWorkerdBuild } from "deepseek-durable-objects/workerd"; +import { deepSeekWorkerdBuild } from "@checkfu/deepseek-durable-objects/workerd"; import { convertV4MiniflareOptions, Miniflare } from "miniflare"; import { rolldown } from "rolldown"; import { expect, it } from "vitest"; diff --git a/test/fixtures/worker.mjs b/test/fixtures/worker.mjs index 7bb27cd..d1c6d15 100644 --- a/test/fixtures/worker.mjs +++ b/test/fixtures/worker.mjs @@ -1,5 +1,5 @@ import { DurableObject } from "cloudflare:workers"; -import { openDeepSeekSession } from "deepseek-durable-objects"; +import { openDeepSeekSession } from "@checkfu/deepseek-durable-objects"; const turn = { operationId: "turn:1",