From f0c2c913081bc5ba590445d7239b672a4ce872c4 Mon Sep 17 00:00:00 2001 From: Sawyer Date: Wed, 2 Sep 2026 16:29:45 -0700 Subject: [PATCH] Move the error envelope into @corbits/error-sink (CL-7383) --- apps/hub/src/hub-error-handler.ts | 2 +- .../src/templates/template-block-routes.ts | 2 +- apps/hub/src/tenant-create-guard.ts | 2 +- bun.lock | 27 +++++++++++++++++++ packages/access-policy/src/routes.ts | 8 ++---- .../src/agent-definition-draft-routes.ts | 2 +- packages/agent-directory/src/routes.ts | 2 +- .../src/workflow-capability-routes.ts | 2 +- .../src/workflow-create-routes.ts | 2 +- .../src/workflow-skill-pin-routes.ts | 2 +- packages/artifacts-hub/package.json | 1 + packages/artifacts-hub/src/routes.ts | 2 +- .../artifacts-hub/src/template-library.ts | 2 +- packages/artifacts-hub/src/workflow-routes.ts | 2 +- packages/bench/package.json | 1 + packages/bench/src/routes.ts | 2 +- packages/chat/src/routes.ts | 4 +-- packages/chat/src/workbench-tenancy-routes.ts | 2 +- .../chat/src/workflow-participant-routes.ts | 2 +- packages/commands/package.json | 1 + packages/commands/src/routes.ts | 2 +- .../connections/src/connect-github-routes.ts | 4 +-- packages/connections/src/mcp-server-routes.ts | 3 +-- packages/connections/src/routes.ts | 3 +-- .../src/error-envelope.test.ts | 0 .../src/error-envelope.ts | 4 +-- packages/error-sink/src/index.ts | 6 +++++ packages/evals/package.json | 1 + packages/evals/src/routes.ts | 2 +- packages/hub-client/src/index.ts | 7 ----- packages/inference-catalog/package.json | 1 + .../src/workflow-catalog-routes.ts | 2 +- packages/insights/package.json | 1 + packages/insights/src/routes.ts | 2 +- packages/memory-hub/package.json | 1 + packages/memory-hub/src/workflow-routes.ts | 2 +- packages/onboarding/src/routes.ts | 7 +++-- packages/preferences/package.json | 1 + packages/preferences/src/routes.ts | 2 +- packages/presence/package.json | 1 + packages/presence/src/routes.ts | 2 +- packages/routines/src/routes.ts | 2 +- packages/routines/src/targets-route.ts | 2 +- .../routines/src/workflow-routine-routes.ts | 2 +- packages/run-key-history/package.json | 1 + packages/run-key-history/src/routes.ts | 2 +- packages/run-scope/package.json | 1 + packages/run-scope/src/scope-routes.ts | 2 +- packages/sidecar-placement/package.json | 1 + packages/sidecar-placement/src/routes.ts | 2 +- packages/skills/package.json | 1 + packages/skills/src/routes.ts | 2 +- packages/skills/src/workflow-routes.ts | 2 +- .../webhook-triggers/src/ingress-routes.ts | 2 +- .../webhook-triggers/src/management-routes.ts | 2 +- .../src/authoring/workflow-routes.ts | 2 +- scripts/checks/error-envelope.ts | 8 +++--- scripts/checks/test/error-envelope.test.ts | 4 +-- 58 files changed, 98 insertions(+), 64 deletions(-) rename packages/{hub-client => error-sink}/src/error-envelope.test.ts (100%) rename packages/{hub-client => error-sink}/src/error-envelope.ts (94%) diff --git a/apps/hub/src/hub-error-handler.ts b/apps/hub/src/hub-error-handler.ts index 33c533de3..68b8b0dc0 100644 --- a/apps/hub/src/hub-error-handler.ts +++ b/apps/hub/src/hub-error-handler.ts @@ -10,7 +10,7 @@ import type { Context } from "hono"; import type { TenantEnv } from "@intx/hub-api"; import { reportError } from "@corbits/error-sink"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; /** * Duck-typed rather than an `instanceof` allowlist: any error carrying a diff --git a/apps/hub/src/templates/template-block-routes.ts b/apps/hub/src/templates/template-block-routes.ts index a07a9f4aa..d363386ef 100644 --- a/apps/hub/src/templates/template-block-routes.ts +++ b/apps/hub/src/templates/template-block-routes.ts @@ -10,7 +10,7 @@ // `AssetService` are touched and this stays testable with plain fakes. import { Hono } from "hono"; import type { RequireGrant, TenantEnv } from "@intx/hub-api"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import { buildBlockWorkflowSource, diff --git a/apps/hub/src/tenant-create-guard.ts b/apps/hub/src/tenant-create-guard.ts index 07b9f85da..e9d696373 100644 --- a/apps/hub/src/tenant-create-guard.ts +++ b/apps/hub/src/tenant-create-guard.ts @@ -28,7 +28,7 @@ import { checkSignupGate, type AccessPolicyStore, } from "@workbench/access-policy"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; const NATIVE_TENANT_CREATE_PATH = "/api/tenants"; diff --git a/bun.lock b/bun.lock index 98db73ce3..e11ae180b 100644 --- a/bun.lock +++ b/bun.lock @@ -347,6 +347,7 @@ "@corbits/artifact-ui": "workspace:*", "@corbits/artifacts": "github:corbitsdev/corbits-artifacts#81049ed24a64e927498c7238bda6ffa66b63d2ab", "@corbits/collections": "workspace:*", + "@corbits/error-sink": "workspace:*", "@corbits/folded-runs": "workspace:*", "@intx/crypto": "0.3.0", "@intx/db": "workspace:*", @@ -367,6 +368,7 @@ "version": "0.0.1", "dependencies": { "@corbits/api-query": "workspace:*", + "@corbits/error-sink": "workspace:*", "@corbits/migration-runner": "workspace:*", "@intx/hub-api": "workspace:*", "@workbench/hub-client": "workspace:*", @@ -538,6 +540,7 @@ "name": "@corbits/commands", "version": "0.0.1", "dependencies": { + "@corbits/error-sink": "workspace:*", "@intx/hub-api": "workspace:*", "@workbench/hub-client": "workspace:*", "arktype": "catalog:", @@ -664,6 +667,7 @@ "dependencies": { "@corbits/agent-directory": "workspace:*", "@corbits/assistant-workflow": "workspace:*", + "@corbits/error-sink": "workspace:*", "@corbits/migration-runner": "workspace:*", "@corbits/routines": "workspace:*", "@corbits/webhook-triggers": "workspace:*", @@ -844,6 +848,7 @@ "name": "@corbits/inference-catalog", "version": "0.0.1", "dependencies": { + "@corbits/error-sink": "workspace:*", "@corbits/migration-runner": "workspace:*", "@corbits/ollama-adapter": "workspace:*", "@intx/db": "workspace:*", @@ -878,6 +883,7 @@ "name": "@corbits/insights", "version": "0.0.1", "dependencies": { + "@corbits/error-sink": "workspace:*", "@corbits/migration-runner": "workspace:*", "@corbits/provider-pricing": "workspace:*", "@intx/db": "workspace:*", @@ -985,6 +991,7 @@ "version": "0.0.1", "dependencies": { "@corbits/artifacts-hub": "workspace:*", + "@corbits/error-sink": "workspace:*", "@corbits/memory": "github:corbitsdev/corbits-memory#9e6f213fa2c002b531d3f6af1aa0abd737b8afe3", "@workbench/hub-client": "workspace:*", "arktype": "catalog:", @@ -1109,6 +1116,7 @@ "version": "0.0.1", "dependencies": { "@corbits/api-query": "workspace:*", + "@corbits/error-sink": "workspace:*", "@corbits/migration-runner": "workspace:*", "@intx/hub-api": "workspace:*", "@workbench/hub-client": "workspace:*", @@ -1126,6 +1134,7 @@ "name": "@corbits/presence", "version": "0.0.1", "dependencies": { + "@corbits/error-sink": "workspace:*", "@intx/hub-api": "workspace:*", "@workbench/hub-client": "workspace:*", "arktype": "catalog:", @@ -1210,6 +1219,7 @@ "name": "@corbits/run-key-history", "version": "0.0.1", "dependencies": { + "@corbits/error-sink": "workspace:*", "@intx/db": "workspace:*", "@intx/hub-api": "workspace:*", "@intx/log": "0.3.0", @@ -1228,6 +1238,7 @@ "name": "@corbits/run-scope", "version": "0.0.1", "dependencies": { + "@corbits/error-sink": "workspace:*", "@corbits/folded-runs": "workspace:*", "@intx/db": "workspace:*", "@intx/hub-api": "workspace:*", @@ -1316,6 +1327,7 @@ "name": "@corbits/sidecar-placement", "version": "0.0.1", "dependencies": { + "@corbits/error-sink": "workspace:*", "@intx/db": "workspace:*", "@intx/hub-api": "workspace:*", "@intx/types": "workspace:*", @@ -1333,6 +1345,7 @@ "name": "@corbits/skills", "version": "0.0.1", "dependencies": { + "@corbits/error-sink": "workspace:*", "@intx/db": "workspace:*", "@intx/hub-api": "workspace:*", "@intx/hub-sessions": "workspace:*", @@ -3564,6 +3577,16 @@ "@babel/helper-compilation-targets/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], + "@corbits/artifacts-hub/@corbits/artifacts": ["@corbits/artifacts@github:corbitsdev/corbits-artifacts#81049ed", { "dependencies": { "@hono/standard-validator": "^0.2.3" }, "peerDependencies": { "@intx/types": "^0.2.2", "arktype": "^2.1.29", "drizzle-orm": "^0.45.2", "hono": "^4.12.32", "hono-openapi": "^1.2.0", "postgres": "^3.4.9" } }, "corbitsdev-corbits-artifacts-81049ed", "sha512-oTE0iFDyQdz0ifG1epo39pwaCaYaw19YcKXwfaZqAEQ56a1g9YIozXwH9CG4NaUTwcJKUeYGuNls6oJsMPisCw=="], + + "@corbits/chat-ui/@corbits/react-ui": ["@corbits/react-ui@github:corbitsdev/react-ui#3b12281", { "dependencies": { "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "tailwind-merge": "^3.3.1" }, "peerDependencies": { "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-dropdown-menu": "^2.1.16", "@radix-ui/react-slot": "^1.2.3", "@radix-ui/react-tooltip": "^1.2.8", "@tanstack/react-query": "^5.90.2", "lucide-react": "^0.545.0 || ^1.0.0", "react": "^18.2.0 || ^19.0.0", "react-dom": "^18.2.0 || ^19.0.0", "sonner": "^2.0.7" }, "optionalPeers": ["@tanstack/react-query"] }, "corbitsdev-react-ui-3b12281", "sha512-Abvm/DO0Gqg0ITHGT9355ZxyKRPMVJLSSQSjpd3a8qt4JPrSMOLIOS4sX8ZMNNaArIbnY9F+VKrOWkUJUyO4Nw=="], + + "@corbits/context-menu/@corbits/react-ui": ["@corbits/react-ui@github:corbitsdev/react-ui#3b12281", { "dependencies": { "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "tailwind-merge": "^3.3.1" }, "peerDependencies": { "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-dropdown-menu": "^2.1.16", "@radix-ui/react-slot": "^1.2.3", "@radix-ui/react-tooltip": "^1.2.8", "@tanstack/react-query": "^5.90.2", "lucide-react": "^0.545.0 || ^1.0.0", "react": "^18.2.0 || ^19.0.0", "react-dom": "^18.2.0 || ^19.0.0", "sonner": "^2.0.7" }, "optionalPeers": ["@tanstack/react-query"] }, "corbitsdev-react-ui-3b12281", "sha512-Abvm/DO0Gqg0ITHGT9355ZxyKRPMVJLSSQSjpd3a8qt4JPrSMOLIOS4sX8ZMNNaArIbnY9F+VKrOWkUJUyO4Nw=="], + + "@corbits/plugins-ui/@corbits/react-ui": ["@corbits/react-ui@github:corbitsdev/react-ui#3b12281", { "dependencies": { "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "tailwind-merge": "^3.3.1" }, "peerDependencies": { "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-dropdown-menu": "^2.1.16", "@radix-ui/react-slot": "^1.2.3", "@radix-ui/react-tooltip": "^1.2.8", "@tanstack/react-query": "^5.90.2", "lucide-react": "^0.545.0 || ^1.0.0", "react": "^18.2.0 || ^19.0.0", "react-dom": "^18.2.0 || ^19.0.0", "sonner": "^2.0.7" }, "optionalPeers": ["@tanstack/react-query"] }, "corbitsdev-react-ui-3b12281", "sha512-Abvm/DO0Gqg0ITHGT9355ZxyKRPMVJLSSQSjpd3a8qt4JPrSMOLIOS4sX8ZMNNaArIbnY9F+VKrOWkUJUyO4Nw=="], + + "@corbits/settings-ui/@corbits/react-ui": ["@corbits/react-ui@github:corbitsdev/react-ui#3b12281", { "dependencies": { "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "tailwind-merge": "^3.3.1" }, "peerDependencies": { "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-dropdown-menu": "^2.1.16", "@radix-ui/react-slot": "^1.2.3", "@radix-ui/react-tooltip": "^1.2.8", "@tanstack/react-query": "^5.90.2", "lucide-react": "^0.545.0 || ^1.0.0", "react": "^18.2.0 || ^19.0.0", "react-dom": "^18.2.0 || ^19.0.0", "sonner": "^2.0.7" }, "optionalPeers": ["@tanstack/react-query"] }, "corbitsdev-react-ui-3b12281", "sha512-Abvm/DO0Gqg0ITHGT9355ZxyKRPMVJLSSQSjpd3a8qt4JPrSMOLIOS4sX8ZMNNaArIbnY9F+VKrOWkUJUyO4Nw=="], + "@esbuild-kit/core-utils/esbuild": ["esbuild@0.18.20", "", { "optionalDependencies": { "@esbuild/android-arm": "0.18.20", "@esbuild/android-arm64": "0.18.20", "@esbuild/android-x64": "0.18.20", "@esbuild/darwin-arm64": "0.18.20", "@esbuild/darwin-x64": "0.18.20", "@esbuild/freebsd-arm64": "0.18.20", "@esbuild/freebsd-x64": "0.18.20", "@esbuild/linux-arm": "0.18.20", "@esbuild/linux-arm64": "0.18.20", "@esbuild/linux-ia32": "0.18.20", "@esbuild/linux-loong64": "0.18.20", "@esbuild/linux-mips64el": "0.18.20", "@esbuild/linux-ppc64": "0.18.20", "@esbuild/linux-riscv64": "0.18.20", "@esbuild/linux-s390x": "0.18.20", "@esbuild/linux-x64": "0.18.20", "@esbuild/netbsd-x64": "0.18.20", "@esbuild/openbsd-x64": "0.18.20", "@esbuild/sunos-x64": "0.18.20", "@esbuild/win32-arm64": "0.18.20", "@esbuild/win32-ia32": "0.18.20", "@esbuild/win32-x64": "0.18.20" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA=="], "@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="], @@ -3586,6 +3609,10 @@ "@typescript-eslint/eslint-plugin/ignore": ["ignore@7.0.6", "", {}, "sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw=="], + "@workbench/hub/@corbits/memory": ["@corbits/memory@github:corbitsdev/corbits-memory#9e6f213", { "dependencies": { "@intx/agent": "0.2.2", "@intx/authz": "0.2.2", "@intx/hub-api": "0.2.2", "@intx/log": "0.2.2", "@intx/workflow": "0.2.2", "arktype": "^2.1.29", "drizzle-orm": "^0.45.1", "hono": "^4.9.0", "hono-openapi": "^1.3.1", "postgres": "^3.4.7" } }, "corbitsdev-corbits-memory-9e6f213", "sha512-utnM4ZT2zmslcPXYWAAqxlDNLcpGsXFiTOtj8h7+OXnhCP0Eaw8yl25+yCTyHpvt3jcdeG4h5uFsSj7ou0BZCA=="], + + "@workbench/web/@corbits/react-ui": ["@corbits/react-ui@github:corbitsdev/react-ui#3b12281", { "dependencies": { "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "tailwind-merge": "^3.3.1" }, "peerDependencies": { "@radix-ui/react-dialog": "^1.1.15", "@radix-ui/react-dropdown-menu": "^2.1.16", "@radix-ui/react-slot": "^1.2.3", "@radix-ui/react-tooltip": "^1.2.8", "@tanstack/react-query": "^5.90.2", "lucide-react": "^0.545.0 || ^1.0.0", "react": "^18.2.0 || ^19.0.0", "react-dom": "^18.2.0 || ^19.0.0", "sonner": "^2.0.7" }, "optionalPeers": ["@tanstack/react-query"] }, "corbitsdev-react-ui-3b12281", "sha512-Abvm/DO0Gqg0ITHGT9355ZxyKRPMVJLSSQSjpd3a8qt4JPrSMOLIOS4sX8ZMNNaArIbnY9F+VKrOWkUJUyO4Nw=="], + "ajv-formats/ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="], "better-call/@better-auth/utils": ["@better-auth/utils@0.5.0", "", { "dependencies": { "@noble/hashes": "^2.0.1" } }, "sha512-BL8W4EfIZFwlu0r54m3v1ztjDhu6dDe/amLTm0xybmbZaNgYUqhD3SjpAsnq0q8YD6/ki4iwIgxJNLP/N3TxiA=="], diff --git a/packages/access-policy/src/routes.ts b/packages/access-policy/src/routes.ts index eb7ea98bf..fa4fe899e 100644 --- a/packages/access-policy/src/routes.ts +++ b/packages/access-policy/src/routes.ts @@ -9,12 +9,8 @@ import { Hono } from "hono"; import { type } from "arktype"; import type { RequireGrant, TenantEnv } from "@intx/hub-api"; -import { reportError } from "@corbits/error-sink"; -import { - cookiesFromHeader, - makeErrorEnvelope, - type ApiCall, -} from "@workbench/hub-client"; +import { makeErrorEnvelope, reportError } from "@corbits/error-sink"; +import { cookiesFromHeader, type ApiCall } from "@workbench/hub-client"; import { canCreateTenancy } from "./policy"; import type { AccessPolicyStore } from "./store"; diff --git a/packages/agent-directory/src/agent-definition-draft-routes.ts b/packages/agent-directory/src/agent-definition-draft-routes.ts index 7d3ac64a5..da14e64f0 100644 --- a/packages/agent-directory/src/agent-definition-draft-routes.ts +++ b/packages/agent-directory/src/agent-definition-draft-routes.ts @@ -20,7 +20,7 @@ import { FoldedRunFailedError, FoldedRunTimedOutError, } from "@corbits/folded-run-one-shot"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import { AgentDefinitionDraftReferenceOutOfInventoryError, AgentDefinitionDraftReplyUnparseableError, diff --git a/packages/agent-directory/src/routes.ts b/packages/agent-directory/src/routes.ts index aeaf2f67d..9ce6e74fb 100644 --- a/packages/agent-directory/src/routes.ts +++ b/packages/agent-directory/src/routes.ts @@ -72,7 +72,7 @@ import { import type { DefinitionAssetHistory } from "./definition-history"; import { listVisibleAgentDefinitions } from "./visible-definitions"; import { reportError } from "@corbits/error-sink"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; /** * Resolves the pinned skill names a definition carries into the diff --git a/packages/agent-directory/src/workflow-capability-routes.ts b/packages/agent-directory/src/workflow-capability-routes.ts index b78552af0..70f8aecfa 100644 --- a/packages/agent-directory/src/workflow-capability-routes.ts +++ b/packages/agent-directory/src/workflow-capability-routes.ts @@ -70,7 +70,7 @@ import { } from "./definition-asset"; import type { PinnedSkillIndexResolver } from "./routes"; import type { DefinitionSkillsStore } from "./skills-store"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; /** * The tenant + principal + run a presented sidecar token and run diff --git a/packages/agent-directory/src/workflow-create-routes.ts b/packages/agent-directory/src/workflow-create-routes.ts index 4fa886c18..1b60e95f3 100644 --- a/packages/agent-directory/src/workflow-create-routes.ts +++ b/packages/agent-directory/src/workflow-create-routes.ts @@ -55,7 +55,7 @@ import { CapabilityOutOfInventoryError, type CapabilityInventoryProvider, } from "./capability-inventory"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import type { WorkflowCapabilityRunScope, WorkflowRunAuthenticator, diff --git a/packages/agent-directory/src/workflow-skill-pin-routes.ts b/packages/agent-directory/src/workflow-skill-pin-routes.ts index 3257da73b..a0f7f7358 100644 --- a/packages/agent-directory/src/workflow-skill-pin-routes.ts +++ b/packages/agent-directory/src/workflow-skill-pin-routes.ts @@ -42,7 +42,7 @@ import { } from "./definition-asset"; import type { PinnedSkillIndexResolver } from "./routes"; import type { DefinitionSkillsStore } from "./skills-store"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import type { WorkflowCapabilityRunScope, WorkflowRunAuthenticator as WorkflowCapabilityRunAuthenticator, diff --git a/packages/artifacts-hub/package.json b/packages/artifacts-hub/package.json index 3afa65fd9..44c656bbd 100644 --- a/packages/artifacts-hub/package.json +++ b/packages/artifacts-hub/package.json @@ -16,6 +16,7 @@ "@corbits/artifact-ui": "workspace:*", "@corbits/artifacts": "github:corbitsdev/corbits-artifacts#81049ed24a64e927498c7238bda6ffa66b63d2ab", "@corbits/collections": "workspace:*", + "@corbits/error-sink": "workspace:*", "@corbits/folded-runs": "workspace:*", "@intx/crypto": "0.3.0", "@intx/db": "workspace:*", diff --git a/packages/artifacts-hub/src/routes.ts b/packages/artifacts-hub/src/routes.ts index 19008bf2b..c787b78cc 100644 --- a/packages/artifacts-hub/src/routes.ts +++ b/packages/artifacts-hub/src/routes.ts @@ -33,7 +33,7 @@ import { import { isTextDecodableMediaType } from "@corbits/artifact-ui/renderer-kind"; import type { RequireGrant, TenantEnv } from "@intx/hub-api"; import { Hono } from "hono"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; const DEFAULT_LIMIT = 50; const MAX_LIMIT = 100; diff --git a/packages/artifacts-hub/src/template-library.ts b/packages/artifacts-hub/src/template-library.ts index 80aca8d01..6df853341 100644 --- a/packages/artifacts-hub/src/template-library.ts +++ b/packages/artifacts-hub/src/template-library.ts @@ -41,7 +41,7 @@ import type { RequireGrant, TenantEnv } from "@intx/hub-api"; import { hexEncode } from "@intx/types"; import { and, eq, sql } from "drizzle-orm"; import { Hono } from "hono"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; export const WORKBENCH_TEMPLATE_ARTIFACT_KIND = "workbench-template"; diff --git a/packages/artifacts-hub/src/workflow-routes.ts b/packages/artifacts-hub/src/workflow-routes.ts index dc65fb769..07341f58f 100644 --- a/packages/artifacts-hub/src/workflow-routes.ts +++ b/packages/artifacts-hub/src/workflow-routes.ts @@ -41,7 +41,7 @@ import { type SerializedArtifactListItem, } from "@corbits/artifacts"; import { Hono } from "hono"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import type { ResolvedWorkflowRunScope, diff --git a/packages/bench/package.json b/packages/bench/package.json index a3cc68444..4f2a29513 100644 --- a/packages/bench/package.json +++ b/packages/bench/package.json @@ -16,6 +16,7 @@ }, "dependencies": { "@corbits/api-query": "workspace:*", + "@corbits/error-sink": "workspace:*", "@corbits/migration-runner": "workspace:*", "@intx/hub-api": "workspace:*", "@workbench/hub-client": "workspace:*", diff --git a/packages/bench/src/routes.ts b/packages/bench/src/routes.ts index 72480c99d..a259653e0 100644 --- a/packages/bench/src/routes.ts +++ b/packages/bench/src/routes.ts @@ -7,7 +7,7 @@ import { type } from "arktype"; import type { RequireGrant, TenantEnv } from "@intx/hub-api"; import type { BenchSettingsStore } from "./store"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; // `BenchCreateType` in packages/bench-ui/src/create-bench-dialog.tsx allows // exactly "global" | "sub" today; validated strictly here rather than as a diff --git a/packages/chat/src/routes.ts b/packages/chat/src/routes.ts index 3455f0f23..f95c79198 100644 --- a/packages/chat/src/routes.ts +++ b/packages/chat/src/routes.ts @@ -18,7 +18,7 @@ import type { Context } from "hono"; import { streamSSE } from "hono/streaming"; import { type } from "arktype"; import { decodedOrNull } from "@corbits/url-path"; -import { reportError } from "@corbits/error-sink"; +import { makeErrorEnvelope, reportError } from "@corbits/error-sink"; import type { TenantEnv } from "@intx/hub-api"; import type { RequireGrant } from "@intx/hub-api"; @@ -110,7 +110,7 @@ import { DefinitionProjectionMissingError, } from "@corbits/folded-runs"; import type { WorkbenchTenancyStore } from "./workbench-tenancy"; -import { cookiesFromHeader, makeErrorEnvelope } from "@workbench/hub-client"; +import { cookiesFromHeader } from "@workbench/hub-client"; import type { AgentTurnStore } from "./agent-turns"; import type { ThreadStore } from "./threads"; import { ThreadDepthCapError } from "./threads"; diff --git a/packages/chat/src/workbench-tenancy-routes.ts b/packages/chat/src/workbench-tenancy-routes.ts index be0405e02..148297710 100644 --- a/packages/chat/src/workbench-tenancy-routes.ts +++ b/packages/chat/src/workbench-tenancy-routes.ts @@ -9,7 +9,7 @@ import type { AppEnv } from "@intx/hub-api"; import { Hono } from "hono"; import { type } from "arktype"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import type { WorkbenchTenancyStore } from "./workbench-tenancy"; diff --git a/packages/chat/src/workflow-participant-routes.ts b/packages/chat/src/workflow-participant-routes.ts index 06bab8c62..f04312bb1 100644 --- a/packages/chat/src/workflow-participant-routes.ts +++ b/packages/chat/src/workflow-participant-routes.ts @@ -68,7 +68,7 @@ import { import type { WorkbenchTenancyStore } from "./workbench-tenancy"; import { MODEL_UNAVAILABLE_CONSUMER_MESSAGE } from "./model-unavailable"; import { reportError } from "@corbits/error-sink"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; /** * The tenant + principal + run a presented sidecar token and run diff --git a/packages/commands/package.json b/packages/commands/package.json index d881adc0e..ed17328d0 100644 --- a/packages/commands/package.json +++ b/packages/commands/package.json @@ -13,6 +13,7 @@ "test": "bun test" }, "dependencies": { + "@corbits/error-sink": "workspace:*", "@intx/hub-api": "workspace:*", "@workbench/hub-client": "workspace:*", "arktype": "catalog:", diff --git a/packages/commands/src/routes.ts b/packages/commands/src/routes.ts index 63987dab1..f406e7677 100644 --- a/packages/commands/src/routes.ts +++ b/packages/commands/src/routes.ts @@ -14,7 +14,7 @@ import type { TenantEnv } from "@intx/hub-api"; import type { RequireGrant } from "@intx/hub-api"; import { dispatchSlashCommand } from "./dispatch"; import type { CommandListing, CommandRegistry } from "./registry"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; export type CreateCommandRoutesDeps = { registry: CommandRegistry; diff --git a/packages/connections/src/connect-github-routes.ts b/packages/connections/src/connect-github-routes.ts index f8d0ad81e..8f8b9bfdc 100644 --- a/packages/connections/src/connect-github-routes.ts +++ b/packages/connections/src/connect-github-routes.ts @@ -25,8 +25,8 @@ import { Hono } from "hono"; import { type } from "arktype"; import type { RequireGrant, TenantEnv } from "@intx/hub-api"; -import { cookiesFromHeader, makeErrorEnvelope } from "@workbench/hub-client"; -import { reportError } from "@corbits/error-sink"; +import { cookiesFromHeader } from "@workbench/hub-client"; +import { makeErrorEnvelope, reportError } from "@corbits/error-sink"; import { fetchAuthenticatedLogin, diff --git a/packages/connections/src/mcp-server-routes.ts b/packages/connections/src/mcp-server-routes.ts index cf12fcac2..c6bf564e6 100644 --- a/packages/connections/src/mcp-server-routes.ts +++ b/packages/connections/src/mcp-server-routes.ts @@ -25,7 +25,6 @@ import { createHubAPI, ensureCredential, ensureProvider, - makeErrorEnvelope, parseAs, type ApiCall, } from "@workbench/hub-client"; @@ -35,7 +34,7 @@ import { } from "@corbits/credential-providers"; import { probeMcpServer } from "./mcp-probe"; import { fireConnectedHook, type ServiceConnectedHook } from "./connected-hook"; -import { reportError } from "@corbits/error-sink"; +import { makeErrorEnvelope, reportError } from "@corbits/error-sink"; import { MCP_PRESETS, mcpPresetBySlug } from "./mcp-presets"; /** Every stored MCP server provider is named `mcp:` — the same diff --git a/packages/connections/src/routes.ts b/packages/connections/src/routes.ts index 608c01b18..b3cdf29c4 100644 --- a/packages/connections/src/routes.ts +++ b/packages/connections/src/routes.ts @@ -22,13 +22,12 @@ import { } from "@intx/types"; import type { RequireGrant, TenantEnv } from "@intx/hub-api"; import { hasUsableModel } from "@corbits/inference-settings"; -import { reportError } from "@corbits/error-sink"; +import { makeErrorEnvelope, reportError } from "@corbits/error-sink"; import { cookiesFromHeader, createHubAPI, ensureCredential, ensureProvider, - makeErrorEnvelope, parseAs, OLLAMA_PLACEHOLDER_SECRET, seedCatalog, diff --git a/packages/hub-client/src/error-envelope.test.ts b/packages/error-sink/src/error-envelope.test.ts similarity index 100% rename from packages/hub-client/src/error-envelope.test.ts rename to packages/error-sink/src/error-envelope.test.ts diff --git a/packages/hub-client/src/error-envelope.ts b/packages/error-sink/src/error-envelope.ts similarity index 94% rename from packages/hub-client/src/error-envelope.ts rename to packages/error-sink/src/error-envelope.ts index 32249120c..75cab021b 100644 --- a/packages/hub-client/src/error-envelope.ts +++ b/packages/error-sink/src/error-envelope.ts @@ -6,10 +6,8 @@ // hub's own logger, keyed by the same `refId`, so an operator can find // it without the client ever having seen it. See CL-6360. -import { generateRefId } from "@corbits/error-sink"; import { type } from "arktype"; - -export { generateRefId }; +import { generateRefId } from "./ref-id"; export const ErrorEnvelopeShape = type({ error: { diff --git a/packages/error-sink/src/index.ts b/packages/error-sink/src/index.ts index 66d9ce767..57bfe0385 100644 --- a/packages/error-sink/src/index.ts +++ b/packages/error-sink/src/index.ts @@ -87,3 +87,9 @@ export function reportError( export type { ErrorContext } from "./context"; export { generateRefId } from "./ref-id"; +export { + ErrorEnvelopeShape, + makeErrorEnvelope, + parseErrorEnvelope, +} from "./error-envelope"; +export type { ErrorEnvelope } from "./error-envelope"; diff --git a/packages/evals/package.json b/packages/evals/package.json index ad49cd147..f17f87be0 100644 --- a/packages/evals/package.json +++ b/packages/evals/package.json @@ -15,6 +15,7 @@ "dependencies": { "@corbits/agent-directory": "workspace:*", "@corbits/assistant-workflow": "workspace:*", + "@corbits/error-sink": "workspace:*", "@corbits/migration-runner": "workspace:*", "@corbits/routines": "workspace:*", "@corbits/webhook-triggers": "workspace:*", diff --git a/packages/evals/src/routes.ts b/packages/evals/src/routes.ts index ab4ef62bf..7d2916610 100644 --- a/packages/evals/src/routes.ts +++ b/packages/evals/src/routes.ts @@ -16,7 +16,7 @@ import type { RequireGrant, TenantEnv } from "@intx/hub-api"; import { ALL_EVALS } from "./cases/index.ts"; import type { EvalRunRecord, EvalRunStore } from "./store/store.ts"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; const DEFAULT_LIMIT = 20; const MAX_LIMIT = 100; diff --git a/packages/hub-client/src/index.ts b/packages/hub-client/src/index.ts index 001873ba9..92dd216c0 100644 --- a/packages/hub-client/src/index.ts +++ b/packages/hub-client/src/index.ts @@ -12,13 +12,6 @@ export { SidecarUnavailableError, } from "./errors"; export { cookiesFromHeader } from "./cookies"; -export { - ErrorEnvelopeShape, - generateRefId, - makeErrorEnvelope, - parseErrorEnvelope, -} from "./error-envelope"; -export type { ErrorEnvelope } from "./error-envelope"; export type { DefaultWorkflow, EnsureCredentialArgs, diff --git a/packages/inference-catalog/package.json b/packages/inference-catalog/package.json index ad19a38e2..790c72551 100644 --- a/packages/inference-catalog/package.json +++ b/packages/inference-catalog/package.json @@ -18,6 +18,7 @@ "test": "bun test" }, "dependencies": { + "@corbits/error-sink": "workspace:*", "@corbits/migration-runner": "workspace:*", "@corbits/ollama-adapter": "workspace:*", "@intx/db": "workspace:*", diff --git a/packages/inference-catalog/src/workflow-catalog-routes.ts b/packages/inference-catalog/src/workflow-catalog-routes.ts index 732db1985..a38848422 100644 --- a/packages/inference-catalog/src/workflow-catalog-routes.ts +++ b/packages/inference-catalog/src/workflow-catalog-routes.ts @@ -13,7 +13,7 @@ import { Hono } from "hono"; import { type } from "arktype"; import type { ModelPricingRow, ResolvedOffering } from "@intx/db"; import { Capability } from "@intx/types"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import { CONCEPTS } from "./concepts"; import { EMPTY_POLICY, type BenchModelPolicy } from "./policy"; diff --git a/packages/insights/package.json b/packages/insights/package.json index 71672591c..39486b5aa 100644 --- a/packages/insights/package.json +++ b/packages/insights/package.json @@ -15,6 +15,7 @@ "test": "bun test" }, "dependencies": { + "@corbits/error-sink": "workspace:*", "@corbits/migration-runner": "workspace:*", "@corbits/provider-pricing": "workspace:*", "@intx/db": "workspace:*", diff --git a/packages/insights/src/routes.ts b/packages/insights/src/routes.ts index 928c4c235..a5b86c265 100644 --- a/packages/insights/src/routes.ts +++ b/packages/insights/src/routes.ts @@ -28,7 +28,7 @@ import { } from "./queries"; import type { UsageStore } from "./store"; import type { TurnLatencyStore } from "./latency-store"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; const RangeQuery = type({ "from?": "string", diff --git a/packages/memory-hub/package.json b/packages/memory-hub/package.json index 328d11641..c16c2dd2b 100644 --- a/packages/memory-hub/package.json +++ b/packages/memory-hub/package.json @@ -14,6 +14,7 @@ }, "dependencies": { "@corbits/artifacts-hub": "workspace:*", + "@corbits/error-sink": "workspace:*", "@corbits/memory": "github:corbitsdev/corbits-memory#9e6f213fa2c002b531d3f6af1aa0abd737b8afe3", "@workbench/hub-client": "workspace:*", "arktype": "catalog:", diff --git a/packages/memory-hub/src/workflow-routes.ts b/packages/memory-hub/src/workflow-routes.ts index 5a6b1e507..ab99f4980 100644 --- a/packages/memory-hub/src/workflow-routes.ts +++ b/packages/memory-hub/src/workflow-routes.ts @@ -24,7 +24,7 @@ */ import { type } from "arktype"; import { Hono } from "hono"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import type { ResolvedWorkflowRunScope, WorkflowRunAuthenticator, diff --git a/packages/onboarding/src/routes.ts b/packages/onboarding/src/routes.ts index d4814cc4c..dd8aed891 100644 --- a/packages/onboarding/src/routes.ts +++ b/packages/onboarding/src/routes.ts @@ -24,8 +24,11 @@ import { import { Hono } from "hono"; import { type } from "arktype"; import type { AccessPolicyStore } from "@workbench/access-policy"; -import { generateRefId, makeErrorEnvelope } from "@workbench/hub-client"; -import { reportError } from "@corbits/error-sink"; +import { + generateRefId, + makeErrorEnvelope, + reportError, +} from "@corbits/error-sink"; import { personalTenantSlug, diff --git a/packages/preferences/package.json b/packages/preferences/package.json index 030091158..96d1c55fc 100644 --- a/packages/preferences/package.json +++ b/packages/preferences/package.json @@ -16,6 +16,7 @@ }, "dependencies": { "@corbits/api-query": "workspace:*", + "@corbits/error-sink": "workspace:*", "@corbits/migration-runner": "workspace:*", "@intx/hub-api": "workspace:*", "@workbench/hub-client": "workspace:*", diff --git a/packages/preferences/src/routes.ts b/packages/preferences/src/routes.ts index 9e1e23198..f3553fbac 100644 --- a/packages/preferences/src/routes.ts +++ b/packages/preferences/src/routes.ts @@ -9,7 +9,7 @@ import { type } from "arktype"; import type { RequireGrant, TenantEnv } from "@intx/hub-api"; import type { PreferencesStore } from "./store"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; const PatchBody = type("Record"); diff --git a/packages/presence/package.json b/packages/presence/package.json index 3be8b6209..348a4819b 100644 --- a/packages/presence/package.json +++ b/packages/presence/package.json @@ -15,6 +15,7 @@ "test": "bun test" }, "dependencies": { + "@corbits/error-sink": "workspace:*", "@intx/hub-api": "workspace:*", "@workbench/hub-client": "workspace:*", "arktype": "catalog:", diff --git a/packages/presence/src/routes.ts b/packages/presence/src/routes.ts index 037d995ba..da1179eb8 100644 --- a/packages/presence/src/routes.ts +++ b/packages/presence/src/routes.ts @@ -21,7 +21,7 @@ import { type PresenceState, type PresenceStatePatch, } from "./room-registry"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import { MAX_DOC_UPDATE_BYTES, maxBase64LengthFor, diff --git a/packages/routines/src/routes.ts b/packages/routines/src/routes.ts index 6ca60ab76..d296a9300 100644 --- a/packages/routines/src/routes.ts +++ b/packages/routines/src/routes.ts @@ -35,7 +35,7 @@ import { validateRetarget, isDeliveryWorkbenchRequired, } from "./routine-operations"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; const log = getLogger(["routines", "routes"]); diff --git a/packages/routines/src/targets-route.ts b/packages/routines/src/targets-route.ts index 5cacfa184..716719fda 100644 --- a/packages/routines/src/targets-route.ts +++ b/packages/routines/src/targets-route.ts @@ -7,7 +7,7 @@ import { Hono } from "hono"; import { type } from "arktype"; import type { TenantEnv } from "@intx/hub-api"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import { InvalidRoutineTargetCursorError, diff --git a/packages/routines/src/workflow-routine-routes.ts b/packages/routines/src/workflow-routine-routes.ts index 3017ef765..183570172 100644 --- a/packages/routines/src/workflow-routine-routes.ts +++ b/packages/routines/src/workflow-routine-routes.ts @@ -32,7 +32,7 @@ import { type } from "arktype"; import { RoutineTrigger } from "./trigger"; import type { RoutineStore, UpdateRoutineInput } from "./store"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import { fireOnceTriggerIfNeeded, isDeliveryWorkbenchRequired, diff --git a/packages/run-key-history/package.json b/packages/run-key-history/package.json index a23b0fc03..437cc40b8 100644 --- a/packages/run-key-history/package.json +++ b/packages/run-key-history/package.json @@ -14,6 +14,7 @@ "test": "bun test" }, "dependencies": { + "@corbits/error-sink": "workspace:*", "@intx/db": "workspace:*", "@intx/hub-api": "workspace:*", "@intx/log": "0.3.0", diff --git a/packages/run-key-history/src/routes.ts b/packages/run-key-history/src/routes.ts index 3d7c9d336..c4904b6be 100644 --- a/packages/run-key-history/src/routes.ts +++ b/packages/run-key-history/src/routes.ts @@ -9,7 +9,7 @@ import { type } from "arktype"; import type { DB } from "@intx/db"; import type { RequireGrant, TenantEnv } from "@intx/hub-api"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import { countRunIdentityStates, diff --git a/packages/run-scope/package.json b/packages/run-scope/package.json index b0ca484f5..fcd4e8382 100644 --- a/packages/run-scope/package.json +++ b/packages/run-scope/package.json @@ -13,6 +13,7 @@ "test": "bun test" }, "dependencies": { + "@corbits/error-sink": "workspace:*", "@corbits/folded-runs": "workspace:*", "@intx/db": "workspace:*", "@intx/hub-api": "workspace:*", diff --git a/packages/run-scope/src/scope-routes.ts b/packages/run-scope/src/scope-routes.ts index 537369e56..204a57a16 100644 --- a/packages/run-scope/src/scope-routes.ts +++ b/packages/run-scope/src/scope-routes.ts @@ -33,7 +33,7 @@ import { getDescendantTenants, type DB } from "@intx/db"; import { workflowDefinition, workflowRun } from "@intx/db/schema"; import type { WorkflowRunStatus } from "@intx/types"; import { foldedRun } from "@corbits/folded-runs"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; /** A routine fire's parent, resolved by `resolveRoutineFires` below. */ export type RoutineFireInfo = { diff --git a/packages/sidecar-placement/package.json b/packages/sidecar-placement/package.json index 6b3871cfe..c71fe598f 100644 --- a/packages/sidecar-placement/package.json +++ b/packages/sidecar-placement/package.json @@ -13,6 +13,7 @@ "test": "bun test" }, "dependencies": { + "@corbits/error-sink": "workspace:*", "@intx/db": "workspace:*", "@intx/hub-api": "workspace:*", "@intx/types": "workspace:*", diff --git a/packages/sidecar-placement/src/routes.ts b/packages/sidecar-placement/src/routes.ts index 3ed31642a..e8468c281 100644 --- a/packages/sidecar-placement/src/routes.ts +++ b/packages/sidecar-placement/src/routes.ts @@ -6,7 +6,7 @@ import { Hono } from "hono"; import { type } from "arktype"; import type { RequireGrant, TenantEnv } from "@intx/hub-api"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import type { SidecarPlacementStore } from "./store"; diff --git a/packages/skills/package.json b/packages/skills/package.json index 6d98095af..80491cea1 100644 --- a/packages/skills/package.json +++ b/packages/skills/package.json @@ -14,6 +14,7 @@ "test": "bun test" }, "dependencies": { + "@corbits/error-sink": "workspace:*", "@intx/db": "workspace:*", "@intx/hub-api": "workspace:*", "@intx/hub-sessions": "workspace:*", diff --git a/packages/skills/src/routes.ts b/packages/skills/src/routes.ts index 73fdee539..ed6fd8cbe 100644 --- a/packages/skills/src/routes.ts +++ b/packages/skills/src/routes.ts @@ -15,7 +15,7 @@ import { type SkillRegistryErrorReason, } from "./registry"; import { parseSkillMd, SkillContentError } from "./skill-md"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; /** Which workflow definitions pin a given skill. */ export type PinnedByResolver = { diff --git a/packages/skills/src/workflow-routes.ts b/packages/skills/src/workflow-routes.ts index 3dd83533a..0ee6892e7 100644 --- a/packages/skills/src/workflow-routes.ts +++ b/packages/skills/src/workflow-routes.ts @@ -12,7 +12,7 @@ // skill. import { type } from "arktype"; import { Hono } from "hono"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import { SkillRegistryError, type SkillRegistry } from "./registry"; diff --git a/packages/webhook-triggers/src/ingress-routes.ts b/packages/webhook-triggers/src/ingress-routes.ts index 622255c2e..2cb5a34ba 100644 --- a/packages/webhook-triggers/src/ingress-routes.ts +++ b/packages/webhook-triggers/src/ingress-routes.ts @@ -24,7 +24,7 @@ import { } from "./signature"; import type { WebhookTriggerRow } from "./schema"; import type { WebhookTriggerStore } from "./store"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; const log = getLogger(["webhook-triggers", "ingress"]); diff --git a/packages/webhook-triggers/src/management-routes.ts b/packages/webhook-triggers/src/management-routes.ts index c1ff0f2a1..544a91568 100644 --- a/packages/webhook-triggers/src/management-routes.ts +++ b/packages/webhook-triggers/src/management-routes.ts @@ -20,7 +20,7 @@ import { pgErrorCode, PG_UNIQUE_VIOLATION } from "@intx/db"; import { generateWebhookSecret } from "./signature"; import type { WebhookTriggerRow } from "./schema"; import type { WebhookTriggerStore } from "./store"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; /** * True for a Postgres unique-violation (`23505`) — the shape a duplicate diff --git a/packages/workflows/src/authoring/workflow-routes.ts b/packages/workflows/src/authoring/workflow-routes.ts index f7ae72305..1681503a7 100644 --- a/packages/workflows/src/authoring/workflow-routes.ts +++ b/packages/workflows/src/authoring/workflow-routes.ts @@ -17,7 +17,7 @@ // comment on `deploy`. import { type } from "arktype"; import { Hono } from "hono"; -import { makeErrorEnvelope } from "@workbench/hub-client"; +import { makeErrorEnvelope } from "@corbits/error-sink"; import { WorkflowAuthorError } from "./errors"; import type { WorkflowAuthorRegistry } from "./registry"; diff --git a/scripts/checks/error-envelope.ts b/scripts/checks/error-envelope.ts index 8ded99938..8c7f2ea53 100644 --- a/scripts/checks/error-envelope.ts +++ b/scripts/checks/error-envelope.ts @@ -1,5 +1,5 @@ // check:error-envelope — a structural invariant: hub routes answer a -// failure with `@workbench/hub-client`'s `makeErrorEnvelope` (`code`, +// failure with `@corbits/error-sink`'s `makeErrorEnvelope` (`code`, // `userMessage`, `refId`). A locally-defined `{ error: { code, message } }` // factory is a second envelope, and a second envelope is how `refId` // support silently goes missing. This check greps for those factories — @@ -10,7 +10,7 @@ // explicit ruling that the named file may keep a helper because it // already wraps the canonical `makeErrorEnvelope` (onboarding, // connections, the hub's own template routes) or *is* the canonical -// helper (hub-client). +// helper (error-sink). import { Glob } from "bun"; import path from "node:path"; import { @@ -23,7 +23,7 @@ import { const SCAN_DIRS = ["apps", "packages", "workflows"]; const ALLOWLIST = new Set([ - "packages/hub-client/src/error-envelope.ts", + "packages/error-sink/src/error-envelope.ts", "packages/onboarding/src/routes.ts", "packages/connections/src/connect-github-routes.ts", "apps/hub/src/templates/template-block-routes.ts", @@ -73,7 +73,7 @@ export function auditLocalErrorEnvelopeFactories( if (!arrow && !fn) continue; report.violations.push( `${relPath}: defines a local { error: { code, message } } factory. ` + - `Hub routes must use makeErrorEnvelope from @workbench/hub-client ` + + `Hub routes must use makeErrorEnvelope from @corbits/error-sink ` + `so every failure carries code, userMessage, and refId.`, ); } diff --git a/scripts/checks/test/error-envelope.test.ts b/scripts/checks/test/error-envelope.test.ts index 30961ac1a..3a8523f0e 100644 --- a/scripts/checks/test/error-envelope.test.ts +++ b/scripts/checks/test/error-envelope.test.ts @@ -65,7 +65,7 @@ test("makeErrorEnvelope usage is not a violation", () => { const report = auditLocalErrorEnvelopeFactories([ { relPath: "packages/sidecar-placement/src/routes.ts", - contents: `import { makeErrorEnvelope } from "@workbench/hub-client"; + contents: `import { makeErrorEnvelope } from "@corbits/error-sink"; return c.json(makeErrorEnvelope({ code: "bad_request", userMessage: "no" }), 400);`, }, ]); @@ -100,7 +100,7 @@ test("allowlisted files that wrap makeErrorEnvelope pass", () => { }`, }, { - relPath: "packages/hub-client/src/error-envelope.ts", + relPath: "packages/error-sink/src/error-envelope.ts", contents: `export function makeErrorEnvelope(args: { code: string; userMessage: string;