diff --git a/CHANGELOG.md b/CHANGELOG.md index 8912ac7..0f28e0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -206,14 +206,13 @@ always called out under their own heading. rolls back every new row from that call. Bus publish and optional host `enqueue` run only after commit for newly inserted ids; enqueue throws are logged and swallowed (same posture as bus publish). -- **Instance-address detection tolerates the upstream `isAgentAddress` -> - `isRunAddress` rename in `@intx/types` (INTR-358).** `recipients.ts` now - imports through `intx-types-compat.ts`, which prefers `isRunAddress` and - falls back to `isAgentAddress`, so this package works against both the - pre-rename and post-rename `@intx/types` without a peer version bump. - ### Breaking +- **`hono-openapi` is a peer, and the remaining dependency is a caret range.** + Route descriptions merge into the host's own OpenAPI document instead of a + second copy of `hono-openapi`. `arktype` is `^2.2.3`; the unused + `@intx/crypto`, the `drizzle-orm` override, the git-install `prepare` build + and the `isAgentAddress` compatibility shim are gone. - **`runMailboxMigrations(config, { schema })` replaces `runMailboxMigrations(db)`.** It takes the same `DBConfig` (`@intx/db`, now a peer) and `schema` the host passes Interchange's `runMigrations`. `schema` is the host schema holding diff --git a/README.md b/README.md index 82ef2e2..ae374a5 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ Give a **person** in an Interchange hub an inbox: list, read, flag, send, and li ## Runtime support -Node >= 24 consumes built `dist/`. Bun >= 1.2 runs TypeScript source. Peers: `@intx/db`, `@intx/hub-api`, `@intx/log`, `@intx/mailbox`, `@intx/mime`, `@intx/types`, `drizzle-orm`, `hono`, `postgres`. +Node >= 24 consumes built `dist/`. Bun >= 1.2 runs TypeScript source. Peers: `@intx/db`, `@intx/hub-api`, `@intx/log`, `@intx/mailbox`, `@intx/mime`, `@intx/types`, `drizzle-orm`, `hono`, `hono-openapi` (with its own peers), `postgres`. ## Quickstart ```bash -npm add @corbits/mailbox @intx/db @intx/hub-api @intx/log @intx/mailbox @intx/mime @intx/types drizzle-orm hono postgres +npm add @corbits/mailbox @intx/db @intx/hub-api @intx/log @intx/mailbox @intx/mime @intx/types drizzle-orm hono hono-openapi @standard-community/standard-json @standard-community/standard-openapi postgres ``` ```ts diff --git a/bun.lock b/bun.lock index 048bf68..506f43a 100644 --- a/bun.lock +++ b/bun.lock @@ -5,25 +5,24 @@ "": { "name": "@corbits/mailbox", "dependencies": { - "@hono/standard-validator": "0.2.3", - "@intx/crypto": "0.4.0", - "@standard-community/standard-json": "0.3.5", - "@standard-community/standard-openapi": "0.2.9", - "arktype": "2.1.29", - "hono-openapi": "1.3.1", + "arktype": "^2.2.3", }, "devDependencies": { + "@hono/standard-validator": "0.2.3", "@intx/db": "0.4.0", "@intx/hub-api": "0.4.0", "@intx/log": "0.4.0", "@intx/mailbox": "0.4.0", "@intx/mime": "0.4.0", "@intx/types": "0.4.0", + "@standard-community/standard-json": "0.3.5", + "@standard-community/standard-openapi": "0.2.9", "@types/bun": "1.1.14", "@types/json-schema": "7.0.15", "@types/node": "22.10.5", "drizzle-orm": "0.45.2", "hono": "4.12.32", + "hono-openapi": "1.3.1", "openapi-types": "12.1.3", "postgres": "3.4.9", "typescript": "5.7.2", @@ -37,17 +36,15 @@ "@intx/types": "^0.4.0", "drizzle-orm": "^0.45.2", "hono": "^4.12.0", + "hono-openapi": "^1.3.1", "postgres": "^3.4.0", }, }, }, - "overrides": { - "drizzle-orm": "0.45.2", - }, "packages": { - "@ark/schema": ["@ark/schema@0.56.0", "", { "dependencies": { "@ark/util": "0.56.0" } }, "sha512-ECg3hox/6Z/nLajxXqNhgPtNdHWC9zNsDyskwO28WinoFEnWow4IsERNz9AnXRhTZJnYIlAJ4uGn3nlLk65vZA=="], + "@ark/schema": ["@ark/schema@0.56.4", "", { "dependencies": { "@ark/util": "0.56.4" } }, "sha512-nd4OqaWdKZJeGF5zNmZysDQO7NyyJ1ycl4S7i16Hj1VxqL+x72Z66lOn7ErpsoMUZtCtslAMHMjqJhuQSxciyw=="], - "@ark/util": ["@ark/util@0.56.0", "", {}, "sha512-BghfRC8b9pNs3vBoDJhcta0/c1J1rsoS1+HgVUreMFPdhz/CRAKReAu57YEllNaSy98rWAdY1gE+gFup7OXpgA=="], + "@ark/util": ["@ark/util@0.56.4", "", {}, "sha512-KKqwGSia44cvuuDY70jGfbiUdG2E8F2cM4npdqvJ22S5a0LknlwG6nIrfQG1nF8fzxpzP30098wp0a8ASs0prQ=="], "@better-auth/core": ["@better-auth/core@1.7.6", "", { "dependencies": { "@opentelemetry/semantic-conventions": "^1.41.1", "@standard-schema/spec": "^1.1.0", "zod": "^4.5.4" }, "peerDependencies": { "@better-auth/utils": "0.4.2", "@better-fetch/fetch": "1.3.2", "@opentelemetry/api": "^1.9.0", "better-call": "1.4.0", "jose": "^6.1.0", "kysely": "^0.28.5 || ^0.29.0", "nanostores": "^1.0.1" }, "optionalPeers": ["@opentelemetry/api"] }, "sha512-yBDDO0J4VCHT1qEZtzj6aMexX4etyLesitoxehcWHzPrzYqrFHwe/hgskye+imlGhQVOysuljMg8M8BA6GrtIg=="], @@ -145,9 +142,9 @@ "agent-base": ["agent-base@7.1.4", "", {}, "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ=="], - "arkregex": ["arkregex@0.0.5", "", { "dependencies": { "@ark/util": "0.56.0" } }, "sha512-ncYjBdLlh5/QnVsAA8De16Tc9EqmYM7y/WU9j+236KcyYNUXogpz3sC4ATIZYzzLxwI+0sEOaQLEmLmRleaEXw=="], + "arkregex": ["arkregex@0.0.10", "", { "dependencies": { "@ark/util": "0.56.4" } }, "sha512-+iDWBYBjH8w7wqEv8VY4loBwRldFxX84KNwKbobH3FJPay/18XI9sTesmXYpKyIrgbC5z/s16+vSJYHCC9FEvQ=="], - "arktype": ["arktype@2.1.29", "", { "dependencies": { "@ark/schema": "0.56.0", "@ark/util": "0.56.0", "arkregex": "0.0.5" } }, "sha512-jyfKk4xIOzvYNayqnD8ZJQqOwcrTOUbIU4293yrzAjA3O1dWh61j71ArMQ6tS/u4pD7vabSPe7nG3RCyoXW6RQ=="], + "arktype": ["arktype@2.2.5", "", { "dependencies": { "@ark/schema": "0.56.4", "@ark/util": "0.56.4", "arkregex": "0.0.10" } }, "sha512-c9oqY1eBab2LceqvpWX50xae2HB8P/nJPxRhuhPVf5lEDi3WQpf7WQflJFMsyCiA3NGh6zENOlse30gWBzlwDg=="], "async-lock": ["async-lock@1.4.1", "", {}, "sha512-Az2ZTpuytrtqENulXwO3GGv1Bztugx6TT37NIo7imr/Qo0gsYiGtSdBa2B6fsXhTpVZDNfu1Qn3pk531e3q+nQ=="], diff --git a/package.json b/package.json index 6a316b9..9d0d50d 100644 --- a/package.json +++ b/package.json @@ -29,9 +29,6 @@ "engines": { "node": ">=24" }, - "corbits": { - "minimumIntxVersion": "0.4.0" - }, "main": "./dist/index.js", "types": "./dist/index.d.ts", "exports": { @@ -53,12 +50,7 @@ "test": "bun test src tests" }, "dependencies": { - "@hono/standard-validator": "0.2.3", - "@intx/crypto": "0.4.0", - "@standard-community/standard-json": "0.3.5", - "@standard-community/standard-openapi": "0.2.9", - "arktype": "2.1.29", - "hono-openapi": "1.3.1" + "arktype": "^2.2.3" }, "peerDependencies": { "@intx/db": "^0.4.0", @@ -69,25 +61,27 @@ "@intx/types": "^0.4.0", "drizzle-orm": "^0.45.2", "hono": "^4.12.0", + "hono-openapi": "^1.3.1", "postgres": "^3.4.0" }, "devDependencies": { + "@hono/standard-validator": "0.2.3", "@intx/db": "0.4.0", "@intx/hub-api": "0.4.0", "@intx/log": "0.4.0", "@intx/mailbox": "0.4.0", "@intx/mime": "0.4.0", "@intx/types": "0.4.0", + "@standard-community/standard-json": "0.3.5", + "@standard-community/standard-openapi": "0.2.9", "@types/bun": "1.1.14", "@types/json-schema": "7.0.15", "@types/node": "22.10.5", "drizzle-orm": "0.45.2", "hono": "4.12.32", + "hono-openapi": "1.3.1", "openapi-types": "12.1.3", "postgres": "3.4.9", "typescript": "5.7.2" - }, - "overrides": { - "drizzle-orm": "0.45.2" } } diff --git a/src/intx-types-compat.test.ts b/src/intx-types-compat.test.ts deleted file mode 100644 index 7b362da..0000000 --- a/src/intx-types-compat.test.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { describe, expect, test } from "bun:test"; -import { resolveIsRunAddress } from "./intx-types-compat.js"; - -describe("resolveIsRunAddress", () => { - test("uses isRunAddress on a post-rename module", () => { - const isRunAddress = (address: string) => address.startsWith("run_"); - const resolved = resolveIsRunAddress({ isRunAddress }); - expect(resolved("run_abc@x.example")).toBe(true); - expect(resolved("usr_abc@x.example")).toBe(false); - }); - - test("falls back to isAgentAddress on a pre-rename module", () => { - const isAgentAddress = (address: string) => address.startsWith("ins_"); - const resolved = resolveIsRunAddress({ isAgentAddress }); - expect(resolved("ins_run42@x.example")).toBe(true); - expect(resolved("usr_alice@x.example")).toBe(false); - }); - - test("prefers isRunAddress when a module exposes both", () => { - const isRunAddress = () => true; - const isAgentAddress = () => false; - const resolved = resolveIsRunAddress({ isRunAddress, isAgentAddress }); - expect(resolved("anything@x.example")).toBe(true); - }); - - test("throws when a module exposes neither export", () => { - expect(() => resolveIsRunAddress({})).toThrow( - "@intx/types exports neither isRunAddress nor isAgentAddress", - ); - }); -}); diff --git a/src/intx-types-compat.ts b/src/intx-types-compat.ts deleted file mode 100644 index 481aa9f..0000000 --- a/src/intx-types-compat.ts +++ /dev/null @@ -1,25 +0,0 @@ -// `@intx/types` renamed `isAgentAddress` to `isRunAddress` (INTR-358). This -// module bridges both shapes so the package keeps working against the -// pre-rename (^0.2.2) and post-rename builds without a version bump — import -// from here instead of naming either export directly. -import * as intxTypes from "@intx/types"; - -export type IntxTypesCompatModule = { - isRunAddress?: (address: string) => boolean; - isAgentAddress?: (address: string) => boolean; -}; - -export function resolveIsRunAddress( - mod: IntxTypesCompatModule, -): (address: string) => boolean { - const resolved = mod.isRunAddress ?? mod.isAgentAddress; - if (!resolved) { - throw new Error( - "@intx/types exports neither isRunAddress nor isAgentAddress", - ); - } - return resolved; -} - -export const isRunAddress: (address: string) => boolean = - resolveIsRunAddress(intxTypes); diff --git a/src/recipients.ts b/src/recipients.ts index 64e8a7a..bdbb7c2 100644 --- a/src/recipients.ts +++ b/src/recipients.ts @@ -2,7 +2,7 @@ // deciding which of those addresses are principal mailboxes this tenant owns. import { extractAddrSpec } from "@intx/mime"; -import { isRunAddress } from "./intx-types-compat.js"; +import { isRunAddress } from "@intx/types"; /** * Split an address-list header (`To:`, `Cc:`) into its individual addresses.