@pithy-sh/core 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/dist/address/address.d.ts +2 -0
  2. package/dist/address/address.js +2 -0
  3. package/dist/audit/auditEvent.d.ts +2 -0
  4. package/dist/audit/auditEvent.js +2 -0
  5. package/dist/audit/recorder.d.ts +2 -0
  6. package/dist/audit/recorder.js +2 -0
  7. package/dist/capability/bindings.d.ts +2 -0
  8. package/dist/capability/bindings.js +2 -0
  9. package/dist/capability/capability.d.ts +2 -0
  10. package/dist/capability/capability.js +2 -0
  11. package/dist/capability/client.d.ts +2 -0
  12. package/dist/capability/client.js +2 -0
  13. package/dist/capability/compose.d.ts +2 -0
  14. package/dist/capability/compose.js +2 -0
  15. package/dist/capability/composition.d.ts +2 -0
  16. package/dist/capability/composition.js +2 -0
  17. package/dist/capability/config.d.ts +2 -0
  18. package/dist/capability/config.js +2 -0
  19. package/dist/capability/devSecret.d.ts +2 -0
  20. package/dist/capability/devSecret.js +2 -0
  21. package/dist/capability/manifest.d.ts +2 -0
  22. package/dist/capability/manifest.js +2 -0
  23. package/dist/capability/secretOrigin.d.ts +2 -0
  24. package/dist/capability/secretOrigin.js +2 -0
  25. package/dist/capability/settings.d.ts +2 -0
  26. package/dist/capability/settings.js +2 -0
  27. package/dist/capability/validateBindings.d.ts +2 -0
  28. package/dist/capability/validateBindings.js +2 -0
  29. package/dist/capability/vanishingKey.d.ts +2 -0
  30. package/dist/capability/vanishingKey.js +2 -0
  31. package/dist/controlPlane/audit/actions.d.ts +2 -0
  32. package/dist/controlPlane/audit/actions.js +2 -0
  33. package/dist/controlPlane/capability.d.ts +2 -0
  34. package/dist/controlPlane/capability.js +2 -0
  35. package/dist/controlPlane/config/config.d.ts +2 -0
  36. package/dist/controlPlane/config/config.js +2 -0
  37. package/dist/controlPlane/context.d.ts +2 -0
  38. package/dist/controlPlane/context.js +2 -0
  39. package/dist/controlPlane/data/connection.d.ts +2 -0
  40. package/dist/controlPlane/data/connection.js +2 -0
  41. package/dist/controlPlane/data/keyLifecycle.d.ts +2 -0
  42. package/dist/controlPlane/data/keyLifecycle.js +2 -0
  43. package/dist/controlPlane/data/replay.d.ts +2 -0
  44. package/dist/controlPlane/data/replay.js +2 -0
  45. package/dist/controlPlane/data/tables.d.ts +2 -0
  46. package/dist/controlPlane/data/tables.js +2 -0
  47. package/dist/controlPlane/discovery/adminRoute.d.ts +2 -0
  48. package/dist/controlPlane/discovery/adminRoute.js +2 -0
  49. package/dist/controlPlane/discovery/configuration.d.ts +2 -0
  50. package/dist/controlPlane/discovery/configuration.js +2 -0
  51. package/dist/controlPlane/discovery/drift.d.ts +2 -0
  52. package/dist/controlPlane/discovery/drift.js +2 -0
  53. package/dist/controlPlane/discovery/health.d.ts +2 -0
  54. package/dist/controlPlane/discovery/health.js +2 -0
  55. package/dist/controlPlane/discovery/healthSummary.d.ts +2 -0
  56. package/dist/controlPlane/discovery/healthSummary.js +2 -0
  57. package/dist/controlPlane/error/errors.d.ts +2 -0
  58. package/dist/controlPlane/error/errors.js +2 -0
  59. package/dist/controlPlane/http/cors.d.ts +2 -0
  60. package/dist/controlPlane/http/cors.js +2 -0
  61. package/dist/controlPlane/http/guard.d.ts +2 -0
  62. package/dist/controlPlane/http/guard.js +2 -0
  63. package/dist/controlPlane/http/handlers.d.ts +2 -0
  64. package/dist/controlPlane/http/handlers.js +2 -0
  65. package/dist/controlPlane/http/responses.d.ts +2 -0
  66. package/dist/controlPlane/http/responses.js +2 -0
  67. package/dist/controlPlane/http/routes.d.ts +2 -0
  68. package/dist/controlPlane/http/routes.js +2 -0
  69. package/dist/controlPlane/http/schemas.d.ts +2 -0
  70. package/dist/controlPlane/http/schemas.js +2 -0
  71. package/dist/controlPlane/http/verify.d.ts +2 -0
  72. package/dist/controlPlane/http/verify.js +2 -0
  73. package/dist/controlPlane/migrations/0001_init.d.ts +2 -0
  74. package/dist/controlPlane/migrations/0001_init.js +2 -0
  75. package/dist/controlPlane/replay/d1Guard.d.ts +2 -0
  76. package/dist/controlPlane/replay/d1Guard.js +2 -0
  77. package/dist/controlPlane/replay/guard.d.ts +2 -0
  78. package/dist/controlPlane/replay/guard.js +2 -0
  79. package/dist/controlPlane/replay/kvGuard.d.ts +2 -0
  80. package/dist/controlPlane/replay/kvGuard.js +2 -0
  81. package/dist/controlPlane/scope/scope.d.ts +2 -0
  82. package/dist/controlPlane/scope/scope.js +2 -0
  83. package/dist/controlPlane/token/base64url.d.ts +2 -0
  84. package/dist/controlPlane/token/base64url.js +2 -0
  85. package/dist/controlPlane/token/claims.d.ts +2 -0
  86. package/dist/controlPlane/token/claims.js +2 -0
  87. package/dist/controlPlane/token/digest.d.ts +2 -0
  88. package/dist/controlPlane/token/digest.js +2 -0
  89. package/dist/controlPlane/token/jws.d.ts +2 -0
  90. package/dist/controlPlane/token/jws.js +2 -0
  91. package/dist/controlPlane/token/mint.d.ts +2 -0
  92. package/dist/controlPlane/token/mint.js +2 -0
  93. package/dist/controlPlane/wire.d.ts +2 -0
  94. package/dist/controlPlane/wire.js +2 -0
  95. package/dist/createBackend.d.ts +2 -0
  96. package/dist/createBackend.js +2 -0
  97. package/dist/createEntrypoint.d.ts +2 -0
  98. package/dist/createEntrypoint.js +2 -0
  99. package/dist/data/boundParameters.d.ts +2 -0
  100. package/dist/data/boundParameters.js +2 -0
  101. package/dist/data/codecs.d.ts +2 -0
  102. package/dist/data/codecs.js +2 -0
  103. package/dist/data/cursor.d.ts +2 -0
  104. package/dist/data/cursor.js +2 -0
  105. package/dist/data/databases.d.ts +2 -0
  106. package/dist/data/databases.js +2 -0
  107. package/dist/data/db.d.ts +2 -0
  108. package/dist/data/db.js +2 -0
  109. package/dist/data/withD1Retry.d.ts +2 -0
  110. package/dist/data/withD1Retry.js +2 -0
  111. package/dist/entitlement/entitlement.d.ts +2 -0
  112. package/dist/entitlement/entitlement.js +2 -0
  113. package/dist/entitlement/gateScan.d.ts +2 -0
  114. package/dist/entitlement/gateScan.js +2 -0
  115. package/dist/entitlement/require.d.ts +2 -0
  116. package/dist/entitlement/require.js +2 -0
  117. package/dist/env/ambient.d.ts +2 -0
  118. package/dist/env/ambient.js +2 -0
  119. package/dist/env/ci.d.ts +2 -0
  120. package/dist/env/ci.js +2 -0
  121. package/dist/env/stem.d.ts +2 -0
  122. package/dist/env/stem.js +2 -0
  123. package/dist/error/cause.d.ts +68 -0
  124. package/dist/error/cause.d.ts.map +1 -1
  125. package/dist/error/cause.js +94 -1
  126. package/dist/error/client.d.ts +2 -0
  127. package/dist/error/client.js +2 -0
  128. package/dist/error/extend.d.ts +2 -0
  129. package/dist/error/extend.js +2 -0
  130. package/dist/error/http.d.ts +2 -0
  131. package/dist/error/http.js +2 -0
  132. package/dist/error/payload.d.ts +2 -0
  133. package/dist/error/payload.js +2 -0
  134. package/dist/error/pithyError.d.ts +2 -0
  135. package/dist/error/pithyError.js +2 -0
  136. package/dist/error/terminal.d.ts +2 -0
  137. package/dist/error/terminal.js +2 -0
  138. package/dist/http/authContext.d.ts +2 -0
  139. package/dist/http/authContext.js +2 -0
  140. package/dist/http/routeContract.d.ts +2 -0
  141. package/dist/http/routeContract.js +2 -0
  142. package/dist/http/sameOrigin.d.ts +2 -0
  143. package/dist/http/sameOrigin.js +2 -0
  144. package/dist/http/signedWebhook.d.ts +2 -0
  145. package/dist/http/signedWebhook.js +2 -0
  146. package/dist/http/validation.d.ts +2 -0
  147. package/dist/http/validation.js +2 -0
  148. package/dist/http/verification.d.ts +2 -0
  149. package/dist/http/verification.js +2 -0
  150. package/dist/i18n/acceptLanguage.d.ts +2 -0
  151. package/dist/i18n/acceptLanguage.js +2 -0
  152. package/dist/i18n/catalog.d.ts +2 -0
  153. package/dist/i18n/catalog.js +2 -0
  154. package/dist/i18n/locale.d.ts +2 -0
  155. package/dist/i18n/locale.js +2 -0
  156. package/dist/i18n/localeMarker.d.ts +2 -0
  157. package/dist/i18n/localeMarker.js +2 -0
  158. package/dist/i18n/match.d.ts +2 -0
  159. package/dist/i18n/match.js +2 -0
  160. package/dist/i18n/registry.d.ts +2 -0
  161. package/dist/i18n/registry.js +2 -0
  162. package/dist/i18n/translator.d.ts +2 -0
  163. package/dist/i18n/translator.js +2 -0
  164. package/dist/index.d.ts +2 -0
  165. package/dist/index.js +2 -0
  166. package/dist/kv/kv.d.ts +2 -0
  167. package/dist/kv/kv.js +2 -0
  168. package/dist/kv/namespaces.d.ts +2 -0
  169. package/dist/kv/namespaces.js +2 -0
  170. package/dist/logger/local.d.ts +2 -0
  171. package/dist/logger/local.js +2 -0
  172. package/dist/logger/logger.d.ts +2 -0
  173. package/dist/logger/logger.js +2 -0
  174. package/dist/logger/record.d.ts +2 -0
  175. package/dist/logger/record.js +2 -0
  176. package/dist/logger/worker.d.ts +2 -0
  177. package/dist/logger/worker.js +2 -0
  178. package/dist/migrations/batch.d.ts +2 -0
  179. package/dist/migrations/batch.js +2 -0
  180. package/dist/migrations/bookkeeping.d.ts +2 -0
  181. package/dist/migrations/bookkeeping.js +2 -0
  182. package/dist/migrations/owner.d.ts +2 -0
  183. package/dist/migrations/owner.js +2 -0
  184. package/dist/migrations/registry.d.ts +2 -0
  185. package/dist/migrations/registry.js +2 -0
  186. package/dist/migrations/runner.d.ts +2 -0
  187. package/dist/migrations/runner.js +2 -0
  188. package/dist/naming/domains.d.ts +2 -0
  189. package/dist/naming/domains.js +2 -0
  190. package/dist/naming/environment.d.ts +2 -0
  191. package/dist/naming/environment.js +2 -0
  192. package/dist/naming/feature.d.ts +2 -0
  193. package/dist/naming/feature.js +2 -0
  194. package/dist/naming/limits.d.ts +2 -0
  195. package/dist/naming/limits.js +2 -0
  196. package/dist/naming/provisionScope.d.ts +2 -0
  197. package/dist/naming/provisionScope.js +2 -0
  198. package/dist/naming/resource.d.ts +2 -0
  199. package/dist/naming/resource.js +2 -0
  200. package/dist/naming/resourceNames.d.ts +2 -0
  201. package/dist/naming/resourceNames.js +2 -0
  202. package/dist/naming/segment.d.ts +2 -0
  203. package/dist/naming/segment.js +2 -0
  204. package/dist/projection/asRead.d.ts +2 -0
  205. package/dist/projection/asRead.js +2 -0
  206. package/dist/projection/published.d.ts +2 -0
  207. package/dist/projection/published.js +2 -0
  208. package/dist/schema/describedness.d.ts +2 -0
  209. package/dist/schema/describedness.js +2 -0
  210. package/dist/seed/compose.d.ts +2 -0
  211. package/dist/seed/compose.js +2 -0
  212. package/dist/seed/devLogin.d.ts +2 -0
  213. package/dist/seed/devLogin.js +2 -0
  214. package/dist/seed/exampleIdentities.d.ts +2 -0
  215. package/dist/seed/exampleIdentities.js +2 -0
  216. package/dist/seed/metadata.d.ts +2 -0
  217. package/dist/seed/metadata.js +2 -0
  218. package/dist/seed/seed.d.ts +2 -0
  219. package/dist/seed/seed.js +2 -0
  220. package/dist/seed/seededRows.d.ts +2 -0
  221. package/dist/seed/seededRows.js +2 -0
  222. package/dist/seed/writeD1.d.ts +2 -0
  223. package/dist/seed/writeD1.js +2 -0
  224. package/dist/seed/writeKv.d.ts +2 -0
  225. package/dist/seed/writeKv.js +2 -0
  226. package/dist/semver/semver.d.ts +2 -0
  227. package/dist/semver/semver.js +2 -0
  228. package/dist/text/comments.d.ts +2 -0
  229. package/dist/text/comments.js +2 -0
  230. package/dist/version.generated.d.ts +3 -1
  231. package/dist/version.generated.js +3 -1
  232. package/dist/worker/health.d.ts +2 -0
  233. package/dist/worker/health.js +2 -0
  234. package/dist/worker/identity.d.ts +2 -0
  235. package/dist/worker/identity.js +2 -0
  236. package/dist/workflow/bindings.d.ts +2 -0
  237. package/dist/workflow/bindings.js +2 -0
  238. package/dist/workflow/dispatch.d.ts +2 -0
  239. package/dist/workflow/dispatch.js +2 -0
  240. package/dist/workflow/dispatchRoute.d.ts +2 -0
  241. package/dist/workflow/dispatchRoute.js +2 -0
  242. package/dist/workflow/faults.d.ts +2 -0
  243. package/dist/workflow/faults.js +2 -0
  244. package/dist/workflow/host.d.ts +2 -0
  245. package/dist/workflow/host.js +2 -0
  246. package/dist/workflow/hostEntry.d.ts +2 -0
  247. package/dist/workflow/hostEntry.js +2 -0
  248. package/dist/workflow/hostEnv.d.ts +2 -0
  249. package/dist/workflow/hostEnv.js +2 -0
  250. package/dist/workflow/loopback.d.ts +2 -0
  251. package/dist/workflow/loopback.js +2 -0
  252. package/dist/workflow/naming.d.ts +2 -0
  253. package/dist/workflow/naming.js +2 -0
  254. package/dist/workflow/register.d.ts +2 -0
  255. package/dist/workflow/register.js +2 -0
  256. package/dist/workflow/schemas.d.ts +2 -0
  257. package/dist/workflow/schemas.js +2 -0
  258. package/dist/workflow/spec.d.ts +2 -0
  259. package/dist/workflow/spec.js +2 -0
  260. package/dist/workflow/stepMessage.d.ts +2 -0
  261. package/dist/workflow/stepMessage.js +2 -0
  262. package/package.json +2 -2
  263. package/src/error/cause.ts +116 -0
  264. package/src/version.generated.ts +1 -1
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * Email addresses: the one rule for deciding whether two strings are the same person.
3
5
  *
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/address/address.ts
2
4
  /**
3
5
  * Email addresses: the one rule for deciding whether two strings are the same person.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * The action taxonomy is **federated, not centralized**: `action` is an open, namespace-validated
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * The action taxonomy is **federated, not centralized**: `action` is an open, namespace-validated
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { AuditEventInput } from "./auditEvent";
2
4
  /**
3
5
  * The recorder seam. `emit()` on the request context (`c.var.emit`) takes one {@link AuditEventInput}
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/audit/recorder.ts
2
4
  /**
3
5
  * The default recorder when no audit capability is composed: accept the event and drop it. Resolves
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  export declare const BindingType: z.ZodUnion<readonly [z.ZodLiteral<"d1">, z.ZodLiteral<"kv">, z.ZodLiteral<"r2">, z.ZodLiteral<"ai">, z.ZodLiteral<"vectorize">, z.ZodLiteral<"queue">, z.ZodLiteral<"ratelimit">, z.ZodLiteral<"email">, z.ZodLiteral<"secret">, z.ZodLiteral<"workflow">, z.ZodLiteral<"service">, z.ZodLiteral<"durable_object">]>;
3
5
  export type BindingType = z.infer<typeof BindingType>;
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { NAME_SEGMENT } from "../naming/segment.js";
2
4
  import { z } from "zod";
3
5
  //#region src/capability/bindings.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { ExecutionContext, ForwardableEmailMessage } from "@cloudflare/workers-types";
2
4
  import type { Hono } from "hono";
3
5
  import type { z } from "zod";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { BindingSpec } from "./bindings.js";
2
4
  //#region src/capability/capability.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  import type { Capability } from "./capability";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { fromZodError } from "../error/pithyError.js";
2
4
  import { refusesVanishingKey } from "./vanishingKey.js";
3
5
  import { z } from "zod";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { Capability } from "./capability";
2
4
  /** A logical group bound to one CF binding, holding named items — D1 tables, or KV stores. */
3
5
  export interface BindingGroup<Item> {
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { InternalError } from "../error/pithyError.js";
2
4
  //#region src/capability/compose.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { Capability } from "./capability";
2
4
  /**
3
5
  * Record the composed set. Called once by `createBackend`, after every `compose` hook has run — so a
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { InternalError } from "../error/pithyError.js";
2
4
  //#region src/capability/composition.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  import type { Capability } from "./capability";
3
5
  /** Compose each capability's config schema into one object keyed by capability name. */
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  //#region src/capability/config.ts
3
5
  /** Compose each capability's config schema into one object keyed by capability name. */
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * A secret whose value is **arbitrary**, and can therefore be minted for local dev.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  //#region src/capability/devSecret.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * What a manifest states as an option's rendered value: a JSON value other than `null`, nested freely,
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { BindingSpec } from "./bindings.js";
2
4
  import { ValidationError } from "../error/pithyError.js";
3
5
  import { manifestRecord } from "./vanishingKey.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * How a secret's value comes to exist, and how it is replaced.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { manifestRecord } from "./vanishingKey.js";
2
4
  import { z } from "zod";
3
5
  //#region src/capability/secretOrigin.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  import type { HostEnvReport } from "../workflow/hostEnv";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { hostEnvProviderSentence } from "../workflow/hostEnv.js";
2
4
  import { z } from "zod";
3
5
  //#region src/capability/settings.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { type BindingSpec } from "./bindings";
2
4
  /** Throw a typed error if any non-optional binding is absent from `env`. */
3
5
  export declare function validateBindings(env: Record<string, unknown>, required: BindingSpec[]): void;
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { isProvisionedBinding } from "./bindings.js";
2
4
  import { InternalError } from "../error/pithyError.js";
3
5
  //#region src/capability/validateBindings.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * Whether a value states no key that would vanish during parsing.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  //#region src/capability/vanishingKey.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { AuditEventInput } from "../../audit/auditEvent";
2
4
  import type { AuditEmit } from "../../audit/recorder";
3
5
  import type { Logger } from "../../logger/logger";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/controlPlane/audit/actions.ts
2
4
  /**
3
5
  * The audit action codes the `control-plane` seam emits, as `domain/reason` strings under the
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { type Capability } from "../capability/capability";
2
4
  import type { DatabaseSpecMap } from "../data/databases";
3
5
  import type { KvNamespaceSpecMap } from "../kv/namespaces";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { defineCapability } from "../capability/capability.js";
2
4
  import { PACKAGE_VERSION } from "../version.generated.js";
3
5
  import "../worker/identity.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  export declare const ControlPlaneConfig: z.ZodObject<{
3
5
  basePath: z.ZodDefault<z.ZodString>;
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import "../token/claims.js";
2
4
  import { z } from "zod";
3
5
  //#region src/controlPlane/config/config.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * The verified control-plane caller, on `c.var.controlPlane`.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { ControlPlaneScope } from "./scope/scope.js";
2
4
  import { z } from "zod";
3
5
  //#region src/controlPlane/context.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * The registration record: who may call this Worker's control-plane routes, from where, with what
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { ControlPlaneScope } from "../scope/scope.js";
2
4
  import { JsonDate, SQLiteDate, sqliteJson } from "../../data/codecs.js";
3
5
  import { z } from "zod";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { RegisteredKey } from "./connection";
2
4
  /**
3
5
  * The registered-key lifecycle: pure array logic over a connection's `keys` column.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { ControlPlaneKeyConflictError, ControlPlaneKeyNotFoundError } from "../error/errors.js";
2
4
  //#region src/controlPlane/data/keyLifecycle.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * One spent control-plane token, as a row.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { SQLiteDate } from "../../data/codecs.js";
2
4
  import { z } from "zod";
3
5
  //#region src/controlPlane/data/replay.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { D1Database } from "@cloudflare/workers-types";
2
4
  import type { Kysely } from "kysely";
3
5
  import type { z } from "zod";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { ControlPlaneConnection } from "./connection.js";
2
4
  import { createDatabase } from "../../data/db.js";
3
5
  import { ControlPlaneReplay } from "./replay.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * What a capability tells a management client about its own admin surface.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { ControlPlaneScope } from "../scope/scope.js";
2
4
  import { CapabilityHealthReport, HealthSummary, HealthSummaryKey, healthReport, healthWire } from "./healthSummary.js";
3
5
  import { ManifestConfigKey, ManifestConfigValues } from "./configuration.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * One configured fact's value. A string, a number, or a boolean — never anything else.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { InternalError } from "../../error/pithyError.js";
2
4
  import { z } from "zod";
3
5
  //#region src/controlPlane/discovery/configuration.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { Hono } from "hono";
2
4
  import type { Capability } from "../../capability/capability";
3
5
  import type { AdminRoute } from "./adminRoute";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { isControlPlaneGuard } from "../http/guard.js";
2
4
  //#region src/controlPlane/discovery/drift.ts
3
5
  /** `app.routes` entries, reduced to the pairs worth comparing. */
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { Context } from "hono";
2
4
  import type { z } from "zod";
3
5
  import type { Capability, PithyHonoEnv } from "../../capability/capability";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { InternalError } from "../../error/pithyError.js";
2
4
  import { HealthSummaryKey } from "./healthSummary.js";
3
5
  //#region src/controlPlane/discovery/health.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /** What kind of scalar a key reports. */
3
5
  export declare const HealthValueKind: z.ZodEnum<{
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { ControlPlaneScope } from "../scope/scope.js";
2
4
  import { z } from "zod";
3
5
  //#region src/controlPlane/discovery/healthSummary.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PithyError } from "../../error/pithyError";
2
4
  import type { MessageParams } from "../../i18n/catalog";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PithyError } from "../../error/pithyError.js";
2
4
  //#region src/controlPlane/error/errors.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { Hono, MiddlewareHandler } from "hono";
2
4
  import type { PithyHonoEnv } from "../../capability/capability";
3
5
  import type { AdminRoute } from "../discovery/adminRoute";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import "../../worker/identity.js";
2
4
  import { CONTROL_PLANE_HEADER, CONTROL_PLANE_VERSION_CREATED_HEADER, CONTROL_PLANE_VERSION_HEADER } from "../wire.js";
3
5
  import "../../naming/environment.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { MiddlewareHandler } from "hono";
2
4
  import type { PithyHonoEnv } from "../../capability/capability";
3
5
  import type { ControlPlaneContext } from "../context";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { PithyError } from "../../error/pithyError.js";
2
4
  import { workerVersionMetadata } from "../../worker/identity.js";
3
5
  import { ControlPlaneAuditActions, safeEmit } from "../audit/actions.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { Context } from "hono";
2
4
  import type { PithyHonoEnv } from "../../capability/capability";
3
5
  import type { ControlPlaneConfig } from "../config/config";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { workerVersion } from "../../worker/identity.js";
2
4
  import { ControlPlaneConnection } from "../data/connection.js";
3
5
  import { CONTROL_PLANE_CONNECTIONS_TABLE } from "../data/tables.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * What the seam's own routes return, as Zod objects a management client can validate against.
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { Ed25519PublicJwk } from "../data/connection.js";
2
4
  import { z } from "zod";
3
5
  //#region src/controlPlane/http/responses.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { Hono } from "hono";
2
4
  import type { PithyHonoEnv } from "../../capability/capability";
3
5
  import type { AdminRoute } from "../discovery/adminRoute";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { ANY_VERIFIED_CALLER, KEYS_ROTATE_SCOPE, MANIFEST_READ_SCOPE } from "../scope/scope.js";
2
4
  import { requireControlPlane } from "./guard.js";
3
5
  import { validationHook } from "../../http/validation.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * The request contract for the seam's own routes. Every input surface is validated here and read in a
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { Ed25519PublicJwk } from "../data/connection.js";
2
4
  import { z } from "zod";
3
5
  //#region src/controlPlane/http/schemas.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { ControlPlaneConfig } from "../config/config";
2
4
  import { ControlPlaneContext } from "../context";
3
5
  import type { ControlPlaneConnection } from "../data/connection";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { scopeCovers } from "../scope/scope.js";
2
4
  import { ControlPlaneInsufficientScopeError, ControlPlaneInvalidCredentialError, ControlPlaneNotConnectedError } from "../error/errors.js";
3
5
  import { CONTROL_PLANE_HEADER, CONTROL_PLANE_VERSION_HEADER } from "../wire.js";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import type { Migration } from "kysely/migration";
2
4
  /**
3
5
  * The control-plane seam's tables: which management client may call this Worker, and which of its tokens
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  //#region src/controlPlane/migrations/0001_init.ts
2
4
  /**
3
5
  * The control-plane seam's tables: which management client may call this Worker, and which of its tokens
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { type ControlPlaneDatabase } from "../data/tables";
2
4
  import type { ReplayGuard } from "./guard";
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { ControlPlaneReplay } from "../data/replay.js";
2
4
  import { CONTROL_PLANE_REPLAYS_TABLE } from "../data/tables.js";
3
5
  //#region src/controlPlane/replay/d1Guard.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /**
2
4
  * The replay guard: a control-plane token is spendable exactly once.
3
5
  *
@@ -0,0 +1,2 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  import type { TypedKv } from "../../kv/kv";
3
5
  import type { ReplayGuard } from "./guard";
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import "../token/claims.js";
2
4
  import { z } from "zod";
3
5
  //#region src/controlPlane/replay/kvGuard.ts
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * One granted operation. Validated on the way into the connection row and on the way out of a token,
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * One granted operation. Validated on the way into the connection row and on the way out of a token,
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  /** Encode raw bytes as unpadded base64url. */
2
4
  export declare function base64UrlEncode(bytes: Uint8Array): string;
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { ControlPlaneInvalidCredentialError } from "../error/errors.js";
2
4
  //#region src/controlPlane/token/base64url.ts
3
5
  /**
@@ -1,3 +1,5 @@
1
+ // SPDX-FileCopyrightText: 2026 Pithy
2
+ // SPDX-License-Identifier: MIT
1
3
  import { z } from "zod";
2
4
  /**
3
5
  * The token a management client presents: what it claims, and what shape the envelope around it must