@pithy-sh/core 0.1.4 → 0.2.0
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.
- package/dist/address/address.d.ts +2 -0
- package/dist/address/address.js +2 -0
- package/dist/audit/auditEvent.d.ts +2 -0
- package/dist/audit/auditEvent.js +2 -0
- package/dist/audit/recorder.d.ts +2 -0
- package/dist/audit/recorder.js +2 -0
- package/dist/capability/bindings.d.ts +2 -0
- package/dist/capability/bindings.js +2 -0
- package/dist/capability/capability.d.ts +20 -0
- package/dist/capability/capability.d.ts.map +1 -1
- package/dist/capability/capability.js +2 -0
- package/dist/capability/client.d.ts +2 -0
- package/dist/capability/client.js +2 -0
- package/dist/capability/compose.d.ts +2 -0
- package/dist/capability/compose.js +2 -0
- package/dist/capability/composition.d.ts +2 -0
- package/dist/capability/composition.js +2 -0
- package/dist/capability/config.d.ts +2 -0
- package/dist/capability/config.js +2 -0
- package/dist/capability/devSecret.d.ts +2 -0
- package/dist/capability/devSecret.js +2 -0
- package/dist/capability/manifest.d.ts +63 -0
- package/dist/capability/manifest.d.ts.map +1 -1
- package/dist/capability/manifest.js +63 -1
- package/dist/capability/secretOrigin.d.ts +2 -0
- package/dist/capability/secretOrigin.js +2 -0
- package/dist/capability/settings.d.ts +2 -0
- package/dist/capability/settings.js +2 -0
- package/dist/capability/validateBindings.d.ts +2 -0
- package/dist/capability/validateBindings.js +2 -0
- package/dist/capability/vanishingKey.d.ts +2 -0
- package/dist/capability/vanishingKey.js +2 -0
- package/dist/controlPlane/audit/actions.d.ts +2 -0
- package/dist/controlPlane/audit/actions.js +2 -0
- package/dist/controlPlane/capability.d.ts +2 -0
- package/dist/controlPlane/capability.js +2 -0
- package/dist/controlPlane/config/config.d.ts +2 -0
- package/dist/controlPlane/config/config.js +2 -0
- package/dist/controlPlane/context.d.ts +2 -0
- package/dist/controlPlane/context.js +2 -0
- package/dist/controlPlane/data/connection.d.ts +2 -0
- package/dist/controlPlane/data/connection.js +2 -0
- package/dist/controlPlane/data/keyLifecycle.d.ts +2 -0
- package/dist/controlPlane/data/keyLifecycle.js +2 -0
- package/dist/controlPlane/data/replay.d.ts +2 -0
- package/dist/controlPlane/data/replay.js +2 -0
- package/dist/controlPlane/data/tables.d.ts +2 -0
- package/dist/controlPlane/data/tables.js +2 -0
- package/dist/controlPlane/discovery/adminRoute.d.ts +2 -0
- package/dist/controlPlane/discovery/adminRoute.js +2 -0
- package/dist/controlPlane/discovery/configuration.d.ts +2 -0
- package/dist/controlPlane/discovery/configuration.js +2 -0
- package/dist/controlPlane/discovery/drift.d.ts +2 -0
- package/dist/controlPlane/discovery/drift.js +2 -0
- package/dist/controlPlane/discovery/health.d.ts +2 -0
- package/dist/controlPlane/discovery/health.js +2 -0
- package/dist/controlPlane/discovery/healthSummary.d.ts +2 -0
- package/dist/controlPlane/discovery/healthSummary.js +2 -0
- package/dist/controlPlane/error/errors.d.ts +2 -0
- package/dist/controlPlane/error/errors.js +2 -0
- package/dist/controlPlane/http/cors.d.ts +2 -0
- package/dist/controlPlane/http/cors.js +2 -0
- package/dist/controlPlane/http/guard.d.ts +2 -0
- package/dist/controlPlane/http/guard.js +2 -0
- package/dist/controlPlane/http/handlers.d.ts +2 -0
- package/dist/controlPlane/http/handlers.js +2 -0
- package/dist/controlPlane/http/responses.d.ts +2 -0
- package/dist/controlPlane/http/responses.js +2 -0
- package/dist/controlPlane/http/routes.d.ts +2 -0
- package/dist/controlPlane/http/routes.js +2 -0
- package/dist/controlPlane/http/schemas.d.ts +2 -0
- package/dist/controlPlane/http/schemas.js +2 -0
- package/dist/controlPlane/http/verify.d.ts +2 -0
- package/dist/controlPlane/http/verify.js +2 -0
- package/dist/controlPlane/migrations/0001_init.d.ts +2 -0
- package/dist/controlPlane/migrations/0001_init.js +2 -0
- package/dist/controlPlane/replay/d1Guard.d.ts +2 -0
- package/dist/controlPlane/replay/d1Guard.js +2 -0
- package/dist/controlPlane/replay/guard.d.ts +2 -0
- package/dist/controlPlane/replay/guard.js +2 -0
- package/dist/controlPlane/replay/kvGuard.d.ts +2 -0
- package/dist/controlPlane/replay/kvGuard.js +2 -0
- package/dist/controlPlane/scope/scope.d.ts +2 -0
- package/dist/controlPlane/scope/scope.js +2 -0
- package/dist/controlPlane/token/base64url.d.ts +2 -0
- package/dist/controlPlane/token/base64url.js +2 -0
- package/dist/controlPlane/token/claims.d.ts +2 -0
- package/dist/controlPlane/token/claims.js +2 -0
- package/dist/controlPlane/token/digest.d.ts +2 -0
- package/dist/controlPlane/token/digest.js +2 -0
- package/dist/controlPlane/token/jws.d.ts +2 -0
- package/dist/controlPlane/token/jws.js +2 -0
- package/dist/controlPlane/token/mint.d.ts +2 -0
- package/dist/controlPlane/token/mint.js +2 -0
- package/dist/controlPlane/wire.d.ts +2 -0
- package/dist/controlPlane/wire.js +2 -0
- package/dist/createBackend.d.ts +2 -0
- package/dist/createBackend.js +2 -0
- package/dist/createEntrypoint.d.ts +2 -0
- package/dist/createEntrypoint.d.ts.map +1 -1
- package/dist/createEntrypoint.js +3 -0
- package/dist/data/boundParameters.d.ts +2 -0
- package/dist/data/boundParameters.js +2 -0
- package/dist/data/codecs.d.ts +2 -0
- package/dist/data/codecs.js +2 -0
- package/dist/data/cursor.d.ts +2 -0
- package/dist/data/cursor.js +2 -0
- package/dist/data/databases.d.ts +2 -0
- package/dist/data/databases.js +2 -0
- package/dist/data/db.d.ts +2 -0
- package/dist/data/db.js +2 -0
- package/dist/data/withD1Retry.d.ts +2 -0
- package/dist/data/withD1Retry.js +2 -0
- package/dist/entitlement/entitlement.d.ts +2 -0
- package/dist/entitlement/entitlement.js +2 -0
- package/dist/entitlement/gateScan.d.ts +2 -0
- package/dist/entitlement/gateScan.js +2 -0
- package/dist/entitlement/require.d.ts +2 -0
- package/dist/entitlement/require.js +2 -0
- package/dist/env/ambient.d.ts +2 -0
- package/dist/env/ambient.js +2 -0
- package/dist/env/ci.d.ts +2 -0
- package/dist/env/ci.js +2 -0
- package/dist/env/stem.d.ts +2 -0
- package/dist/env/stem.js +2 -0
- package/dist/error/cause.d.ts +68 -0
- package/dist/error/cause.d.ts.map +1 -1
- package/dist/error/cause.js +94 -1
- package/dist/error/client.d.ts +2 -0
- package/dist/error/client.js +2 -0
- package/dist/error/extend.d.ts +2 -0
- package/dist/error/extend.js +2 -0
- package/dist/error/http.d.ts +2 -0
- package/dist/error/http.js +2 -0
- package/dist/error/payload.d.ts +2 -0
- package/dist/error/payload.js +2 -0
- package/dist/error/pithyError.d.ts +2 -0
- package/dist/error/pithyError.js +2 -0
- package/dist/error/terminal.d.ts +2 -0
- package/dist/error/terminal.js +2 -0
- package/dist/http/authContext.d.ts +2 -0
- package/dist/http/authContext.js +2 -0
- package/dist/http/routeContract.d.ts +2 -0
- package/dist/http/routeContract.js +2 -0
- package/dist/http/sameOrigin.d.ts +2 -0
- package/dist/http/sameOrigin.js +2 -0
- package/dist/http/signedWebhook.d.ts +2 -0
- package/dist/http/signedWebhook.js +2 -0
- package/dist/http/validation.d.ts +2 -0
- package/dist/http/validation.js +2 -0
- package/dist/http/verification.d.ts +2 -0
- package/dist/http/verification.js +2 -0
- package/dist/i18n/acceptLanguage.d.ts +2 -0
- package/dist/i18n/acceptLanguage.js +2 -0
- package/dist/i18n/catalog.d.ts +2 -0
- package/dist/i18n/catalog.js +2 -0
- package/dist/i18n/locale.d.ts +2 -0
- package/dist/i18n/locale.js +2 -0
- package/dist/i18n/localeMarker.d.ts +2 -0
- package/dist/i18n/localeMarker.js +2 -0
- package/dist/i18n/match.d.ts +2 -0
- package/dist/i18n/match.js +2 -0
- package/dist/i18n/registry.d.ts +2 -0
- package/dist/i18n/registry.js +2 -0
- package/dist/i18n/translator.d.ts +2 -0
- package/dist/i18n/translator.js +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/kv/kv.d.ts +2 -0
- package/dist/kv/kv.js +2 -0
- package/dist/kv/namespaces.d.ts +2 -0
- package/dist/kv/namespaces.js +2 -0
- package/dist/logger/local.d.ts +2 -0
- package/dist/logger/local.js +2 -0
- package/dist/logger/logger.d.ts +2 -0
- package/dist/logger/logger.js +2 -0
- package/dist/logger/record.d.ts +2 -0
- package/dist/logger/record.js +2 -0
- package/dist/logger/worker.d.ts +2 -0
- package/dist/logger/worker.js +2 -0
- package/dist/migrations/batch.d.ts +2 -0
- package/dist/migrations/batch.js +2 -0
- package/dist/migrations/bookkeeping.d.ts +2 -0
- package/dist/migrations/bookkeeping.js +2 -0
- package/dist/migrations/owner.d.ts +2 -0
- package/dist/migrations/owner.js +2 -0
- package/dist/migrations/registry.d.ts +2 -0
- package/dist/migrations/registry.js +2 -0
- package/dist/migrations/runner.d.ts +2 -0
- package/dist/migrations/runner.js +2 -0
- package/dist/naming/domains.d.ts +2 -0
- package/dist/naming/domains.js +2 -0
- package/dist/naming/environment.d.ts +2 -0
- package/dist/naming/environment.js +2 -0
- package/dist/naming/feature.d.ts +2 -0
- package/dist/naming/feature.js +2 -0
- package/dist/naming/limits.d.ts +2 -0
- package/dist/naming/limits.js +2 -0
- package/dist/naming/provisionScope.d.ts +2 -0
- package/dist/naming/provisionScope.js +2 -0
- package/dist/naming/resource.d.ts +2 -0
- package/dist/naming/resource.js +2 -0
- package/dist/naming/resourceNames.d.ts +2 -0
- package/dist/naming/resourceNames.js +2 -0
- package/dist/naming/segment.d.ts +2 -0
- package/dist/naming/segment.js +2 -0
- package/dist/projection/asRead.d.ts +2 -0
- package/dist/projection/asRead.js +2 -0
- package/dist/projection/published.d.ts +2 -0
- package/dist/projection/published.js +2 -0
- package/dist/schema/describedness.d.ts +2 -0
- package/dist/schema/describedness.js +2 -0
- package/dist/seed/compose.d.ts +2 -0
- package/dist/seed/compose.js +2 -0
- package/dist/seed/devLogin.d.ts +2 -0
- package/dist/seed/devLogin.js +2 -0
- package/dist/seed/exampleIdentities.d.ts +2 -0
- package/dist/seed/exampleIdentities.js +2 -0
- package/dist/seed/metadata.d.ts +2 -0
- package/dist/seed/metadata.js +2 -0
- package/dist/seed/seed.d.ts +2 -0
- package/dist/seed/seed.js +2 -0
- package/dist/seed/seededRows.d.ts +2 -0
- package/dist/seed/seededRows.js +2 -0
- package/dist/seed/writeD1.d.ts +2 -0
- package/dist/seed/writeD1.js +2 -0
- package/dist/seed/writeKv.d.ts +2 -0
- package/dist/seed/writeKv.js +2 -0
- package/dist/semver/semver.d.ts +2 -0
- package/dist/semver/semver.js +2 -0
- package/dist/text/comments.d.ts +2 -0
- package/dist/text/comments.js +2 -0
- package/dist/version.generated.d.ts +3 -1
- package/dist/version.generated.js +3 -1
- package/dist/worker/health.d.ts +2 -0
- package/dist/worker/health.js +2 -0
- package/dist/worker/identity.d.ts +2 -0
- package/dist/worker/identity.js +2 -0
- package/dist/workflow/bindings.d.ts +2 -0
- package/dist/workflow/bindings.js +2 -0
- package/dist/workflow/dispatch.d.ts +2 -0
- package/dist/workflow/dispatch.js +2 -0
- package/dist/workflow/dispatchRoute.d.ts +2 -0
- package/dist/workflow/dispatchRoute.js +2 -0
- package/dist/workflow/faults.d.ts +2 -0
- package/dist/workflow/faults.js +2 -0
- package/dist/workflow/host.d.ts +2 -0
- package/dist/workflow/host.js +2 -0
- package/dist/workflow/hostEntry.d.ts +2 -0
- package/dist/workflow/hostEntry.js +2 -0
- package/dist/workflow/hostEnv.d.ts +2 -0
- package/dist/workflow/hostEnv.js +2 -0
- package/dist/workflow/loopback.d.ts +2 -0
- package/dist/workflow/loopback.js +2 -0
- package/dist/workflow/naming.d.ts +2 -0
- package/dist/workflow/naming.js +2 -0
- package/dist/workflow/register.d.ts +2 -0
- package/dist/workflow/register.js +2 -0
- package/dist/workflow/schemas.d.ts +2 -0
- package/dist/workflow/schemas.js +2 -0
- package/dist/workflow/spec.d.ts +2 -0
- package/dist/workflow/spec.js +2 -0
- package/dist/workflow/stepMessage.d.ts +2 -0
- package/dist/workflow/stepMessage.js +2 -0
- package/package.json +2 -2
- package/src/capability/capability.ts +18 -0
- package/src/capability/manifest.ts +94 -0
- package/src/createEntrypoint.ts +5 -0
- package/src/error/cause.ts +116 -0
- package/src/version.generated.ts +1 -1
package/dist/address/address.js
CHANGED
package/dist/audit/auditEvent.js
CHANGED
package/dist/audit/recorder.d.ts
CHANGED
package/dist/audit/recorder.js
CHANGED
|
@@ -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 type { ExecutionContext, ForwardableEmailMessage } from "@cloudflare/workers-types";
|
|
2
4
|
import type { Hono } from "hono";
|
|
3
5
|
import type { z } from "zod";
|
|
@@ -390,6 +392,24 @@ export interface Capability<Databases extends DatabaseSpecMap = DatabaseSpecMap,
|
|
|
390
392
|
* every {@link Capability.secretRegistry} slice here into one combined registry.
|
|
391
393
|
*/
|
|
392
394
|
compose?: (context: CapabilityComposeContext) => void;
|
|
395
|
+
/**
|
|
396
|
+
* Optional **entrypoint** hook, called once by {@link createEntrypoint} with every composed
|
|
397
|
+
* capability, after {@link Capability.compose} has run for all of them.
|
|
398
|
+
*
|
|
399
|
+
* **The distinction from `compose` is the audience, and it is load-bearing.** `createBackend` assembles
|
|
400
|
+
* a backend for anything that wants to look at one, and the CLI is a caller: `pithy ui` builds the app
|
|
401
|
+
* to read its route tree, and `composeCapabilities` runs every `compose` hook to read what a capability
|
|
402
|
+
* reports. `createEntrypoint` is the other thing — it is only ever called by a Worker's own
|
|
403
|
+
* `src/index.ts`, so a throw from here is a Worker that does not serve, and nothing else.
|
|
404
|
+
*
|
|
405
|
+
* So this is where a capability refuses a composition that must never take a request but must still
|
|
406
|
+
* *load*, because the adopter's own toolchain has to keep working on the project while they fix it.
|
|
407
|
+
* `@pithy-sh/payments` is the case it exists for: `pithy add` scaffolds an unimplemented
|
|
408
|
+
* `resolveSubject`, every CLI command keeps loading that config, and the Worker refuses to boot until
|
|
409
|
+
* the adopter has written it (#500). A check that can be made at composition still belongs at
|
|
410
|
+
* composition — earlier is better, and a refusal the CLI can raise is a refusal an adopter sees sooner.
|
|
411
|
+
*/
|
|
412
|
+
boot?: (context: CapabilityComposeContext) => void;
|
|
393
413
|
/** Mounts a Hono sub-router. */
|
|
394
414
|
routes?: (app: Hono<PithyHonoEnv>) => void;
|
|
395
415
|
/** Composable middleware (e.g. turnstile(), requireAuth()). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../../src/capability/capability.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE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
|
|
3
5
|
* What a manifest states as an option's rendered value: a JSON value other than `null`, nested freely,
|
|
@@ -116,6 +118,22 @@ export declare function renderConfigOptionLine(key: string, value: ConfigOptionV
|
|
|
116
118
|
* cannot reach the throw, because every manifest is parsed before it is rendered.
|
|
117
119
|
*/
|
|
118
120
|
export declare function renderConfigOptionComment(describe: string, indent: string): string;
|
|
121
|
+
/**
|
|
122
|
+
* The line a writer puts in `pithy.config.ts` for a **seam** — the option a capability takes that is a
|
|
123
|
+
* function, so no renderer can ever state its value.
|
|
124
|
+
*
|
|
125
|
+
* Shorthand (`resolveSubject,`) rather than `key: value`, because the two are the same identifier: the
|
|
126
|
+
* scaffolded module exports the name the factory takes, and a config that spelled it twice would invite
|
|
127
|
+
* an adopter to rename one half of it.
|
|
128
|
+
*
|
|
129
|
+
* **It takes the seam's key and nothing else.** That is the same closed-set argument
|
|
130
|
+
* {@link CONFIG_CONSTANTS} makes one function up, and it has to be made again here for a stronger
|
|
131
|
+
* reason: a constant is one identifier in an expression position, and a seam is an identifier *plus* an
|
|
132
|
+
* import statement plus a file written into the adopter's repository. A manifest states which seam, by a
|
|
133
|
+
* key this package enumerates; every character that reaches the adopter's TypeScript comes from
|
|
134
|
+
* {@link CONFIG_SEAMS}.
|
|
135
|
+
*/
|
|
136
|
+
export declare function renderConfigSeamLine(seam: ConfigSeam, indent: string): string;
|
|
119
137
|
/**
|
|
120
138
|
* The one import line a capability's wiring is written as.
|
|
121
139
|
*
|
|
@@ -197,11 +215,55 @@ export declare const ConfigConstant: z.ZodEnum<{
|
|
|
197
215
|
publicOrigin: "publicOrigin";
|
|
198
216
|
}>;
|
|
199
217
|
export type ConfigConstant = z.infer<typeof ConfigConstant>;
|
|
218
|
+
/** One seam a capability takes: what `pithy add` writes for it, and what the config then references. */
|
|
219
|
+
export interface ConfigSeamSpec {
|
|
220
|
+
/** The identifier the scaffolded module exports, and the key the capability's factory takes for it. */
|
|
221
|
+
readonly binding: string;
|
|
222
|
+
/** The module `pithy add` writes, relative to the Worker's own directory. */
|
|
223
|
+
readonly module: string;
|
|
224
|
+
/** How that module is imported from the Worker's `pithy.config.ts`. */
|
|
225
|
+
readonly specifier: string;
|
|
226
|
+
/** The comment written above the seam's line, saying what the adopter still owes it. */
|
|
227
|
+
readonly describe: string;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* The seams `pithy add` knows how to scaffold — a capability option whose value is **behavior**, named
|
|
231
|
+
* from a closed set exactly as {@link CONFIG_CONSTANTS} names an identifier.
|
|
232
|
+
*
|
|
233
|
+
* A missing *value* has always been scaffoldable: `pithy add secrets` writes an empty registry and the
|
|
234
|
+
* project still loads, because an empty registry is a valid empty state. A missing *behavior* was not,
|
|
235
|
+
* so `payments`' `billingSubject: "organization"` was refused outright — and its remedy routed through
|
|
236
|
+
* `--set billingSubject=user`, a value that is untrue for every project that wanted the other one (#500).
|
|
237
|
+
*
|
|
238
|
+
* What makes the behavior scaffoldable is that the scaffold is **not a stub that answers**. A resolver
|
|
239
|
+
* returning nothing composes cleanly and then denies every gate, which is indistinguishable from a
|
|
240
|
+
* customer who has not paid. The module written here is branded as unimplemented by the capability that
|
|
241
|
+
* owns it, and that capability refuses the Worker's entrypoint while the brand is still on it — so the
|
|
242
|
+
* adopter says what they mean, gets the file and the signature, and the project still refuses to boot
|
|
243
|
+
* until they have written the one thing only they can write.
|
|
244
|
+
*
|
|
245
|
+
* One entry today. Every string in it is this package's, because all four of them reach the adopter's
|
|
246
|
+
* repository unquoted: an identifier, a path, an import specifier, a comment.
|
|
247
|
+
*/
|
|
248
|
+
export declare const CONFIG_SEAMS: {
|
|
249
|
+
readonly paymentsSubject: {
|
|
250
|
+
readonly binding: "resolveSubject";
|
|
251
|
+
readonly module: "src/billing/subject.ts";
|
|
252
|
+
readonly specifier: "./src/billing/subject";
|
|
253
|
+
readonly describe: "Which organization this caller is acting for. Scaffolded unimplemented — this Worker refuses to boot until src/billing/subject.ts answers it.";
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
/** Which scaffolded seam a choice needs, by key. */
|
|
257
|
+
export declare const ConfigSeam: z.ZodEnum<{
|
|
258
|
+
paymentsSubject: "paymentsSubject";
|
|
259
|
+
}>;
|
|
260
|
+
export type ConfigSeam = z.infer<typeof ConfigSeam>;
|
|
200
261
|
export declare const ConfigOption: z.ZodObject<{
|
|
201
262
|
key: z.ZodString;
|
|
202
263
|
default: z.ZodOptional<z.ZodType<ConfigOptionValue, unknown, z.core.$ZodTypeInternals<ConfigOptionValue, unknown>>>;
|
|
203
264
|
choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
204
265
|
choicesNeedingCode: z.ZodOptional<z.ZodPipe<z.ZodCustom<Record<string, string>, Record<string, string>>, z.ZodType<Record<string, string>, Record<string, string>, z.core.$ZodTypeInternals<Record<string, string>, Record<string, string>>>>>;
|
|
266
|
+
choicesNeedingSeam: z.ZodOptional<z.ZodPipe<z.ZodCustom<Record<string, "paymentsSubject">, Record<string, "paymentsSubject">>, z.ZodType<Record<string, "paymentsSubject">, Record<string, "paymentsSubject">, z.core.$ZodTypeInternals<Record<string, "paymentsSubject">, Record<string, "paymentsSubject">>>>>;
|
|
205
267
|
constant: z.ZodOptional<z.ZodEnum<{
|
|
206
268
|
publicOrigin: "publicOrigin";
|
|
207
269
|
}>>;
|
|
@@ -287,6 +349,7 @@ export declare const CapabilityManifest: z.ZodObject<{
|
|
|
287
349
|
default: z.ZodOptional<z.ZodType<ConfigOptionValue, unknown, z.core.$ZodTypeInternals<ConfigOptionValue, unknown>>>;
|
|
288
350
|
choices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
289
351
|
choicesNeedingCode: z.ZodOptional<z.ZodPipe<z.ZodCustom<Record<string, string>, Record<string, string>>, z.ZodType<Record<string, string>, Record<string, string>, z.core.$ZodTypeInternals<Record<string, string>, Record<string, string>>>>>;
|
|
352
|
+
choicesNeedingSeam: z.ZodOptional<z.ZodPipe<z.ZodCustom<Record<string, "paymentsSubject">, Record<string, "paymentsSubject">>, z.ZodType<Record<string, "paymentsSubject">, Record<string, "paymentsSubject">, z.core.$ZodTypeInternals<Record<string, "paymentsSubject">, Record<string, "paymentsSubject">>>>>;
|
|
290
353
|
constant: z.ZodOptional<z.ZodEnum<{
|
|
291
354
|
publicOrigin: "publicOrigin";
|
|
292
355
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/capability/manifest.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgDxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,iBAAiB,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAA;CAAE,CAAC;AAEvH,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,CAUgD,CAAC;AA6D5G;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CASlE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IAChC,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;CACnC;AAOD,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,iBAAiB,GAAG,iBAAiB,EAC5C,MAAM,EAAE,MAAM,GACb,MAAM,CAaR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CASlF;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-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";
|
|
@@ -173,6 +175,24 @@ function renderConfigOptionComment(describe, indent) {
|
|
|
173
175
|
return `${indent}// ${describe}`;
|
|
174
176
|
}
|
|
175
177
|
/**
|
|
178
|
+
* The line a writer puts in `pithy.config.ts` for a **seam** — the option a capability takes that is a
|
|
179
|
+
* function, so no renderer can ever state its value.
|
|
180
|
+
*
|
|
181
|
+
* Shorthand (`resolveSubject,`) rather than `key: value`, because the two are the same identifier: the
|
|
182
|
+
* scaffolded module exports the name the factory takes, and a config that spelled it twice would invite
|
|
183
|
+
* an adopter to rename one half of it.
|
|
184
|
+
*
|
|
185
|
+
* **It takes the seam's key and nothing else.** That is the same closed-set argument
|
|
186
|
+
* {@link CONFIG_CONSTANTS} makes one function up, and it has to be made again here for a stronger
|
|
187
|
+
* reason: a constant is one identifier in an expression position, and a seam is an identifier *plus* an
|
|
188
|
+
* import statement plus a file written into the adopter's repository. A manifest states which seam, by a
|
|
189
|
+
* key this package enumerates; every character that reaches the adopter's TypeScript comes from
|
|
190
|
+
* {@link CONFIG_SEAMS}.
|
|
191
|
+
*/
|
|
192
|
+
function renderConfigSeamLine(seam, indent) {
|
|
193
|
+
return `${indent}${CONFIG_SEAMS[seam].binding},`;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
176
196
|
* A capability's own name, as generated source carries it.
|
|
177
197
|
*
|
|
178
198
|
* The same shape a config option's key is held to, and for the same reason: it is written **bare**, and
|
|
@@ -297,11 +317,39 @@ function renderCapabilityRegistration({ name, indent, optionLines = [], trailing
|
|
|
297
317
|
const CONFIG_CONSTANTS = { publicOrigin: "PUBLIC_ORIGIN" };
|
|
298
318
|
/** Which scaffolded constant an option's value is, by key. */
|
|
299
319
|
const ConfigConstant = z.enum(Object.keys(CONFIG_CONSTANTS)).describe("A constant the scaffolded pithy.config.ts defines, named from a closed set rather than spelled out.");
|
|
320
|
+
/**
|
|
321
|
+
* The seams `pithy add` knows how to scaffold — a capability option whose value is **behavior**, named
|
|
322
|
+
* from a closed set exactly as {@link CONFIG_CONSTANTS} names an identifier.
|
|
323
|
+
*
|
|
324
|
+
* A missing *value* has always been scaffoldable: `pithy add secrets` writes an empty registry and the
|
|
325
|
+
* project still loads, because an empty registry is a valid empty state. A missing *behavior* was not,
|
|
326
|
+
* so `payments`' `billingSubject: "organization"` was refused outright — and its remedy routed through
|
|
327
|
+
* `--set billingSubject=user`, a value that is untrue for every project that wanted the other one (#500).
|
|
328
|
+
*
|
|
329
|
+
* What makes the behavior scaffoldable is that the scaffold is **not a stub that answers**. A resolver
|
|
330
|
+
* returning nothing composes cleanly and then denies every gate, which is indistinguishable from a
|
|
331
|
+
* customer who has not paid. The module written here is branded as unimplemented by the capability that
|
|
332
|
+
* owns it, and that capability refuses the Worker's entrypoint while the brand is still on it — so the
|
|
333
|
+
* adopter says what they mean, gets the file and the signature, and the project still refuses to boot
|
|
334
|
+
* until they have written the one thing only they can write.
|
|
335
|
+
*
|
|
336
|
+
* One entry today. Every string in it is this package's, because all four of them reach the adopter's
|
|
337
|
+
* repository unquoted: an identifier, a path, an import specifier, a comment.
|
|
338
|
+
*/
|
|
339
|
+
const CONFIG_SEAMS = { paymentsSubject: {
|
|
340
|
+
binding: "resolveSubject",
|
|
341
|
+
module: "src/billing/subject.ts",
|
|
342
|
+
specifier: "./src/billing/subject",
|
|
343
|
+
describe: "Which organization this caller is acting for. Scaffolded unimplemented — this Worker refuses to boot until src/billing/subject.ts answers it."
|
|
344
|
+
} };
|
|
345
|
+
/** Which scaffolded seam a choice needs, by key. */
|
|
346
|
+
const ConfigSeam = z.enum(Object.keys(CONFIG_SEAMS)).describe("A seam pithy add knows how to scaffold, named from a closed set rather than described.");
|
|
300
347
|
const ConfigOption = z.object({
|
|
301
348
|
key: z.string().regex(BARE_KEY, { error: (issue) => `A config option key must be a bare identifier, and ${JSON.stringify(issue.input)} is not — it is written bare into pithy.config.ts.` }).describe("Option name passed to the capability factory (e.g. \"basePath\"); a bare identifier."),
|
|
302
349
|
default: ConfigOptionValue.optional().describe("The value rendered into pithy.config.ts when no override is given — and **its absence is what makes an option required**. There is no flag beside it saying so: an option that states a default has an answer the kit is willing to pick, and an option that states none has one only the adopter can. A required option is settled before a byte is written — a prompt asks it with nothing to accept by pressing enter, `--set key=value` answers it non-interactively, and a run carrying neither is refused naming the flag. Nothing is guessed, because a decision worth refusing over is one that is expensive to reverse: payments' `billingSubject` decides whether an entitlement is held by a person or a company, and it lands in a column and a UNIQUE index."),
|
|
303
350
|
choices: z.array(PrintableString).min(1).optional().describe("The values this option accepts, when they are a closed set. Three things follow from stating them, and none of them can be had without: the prompt is a select rather than free text, `--set` refuses a value outside them instead of writing it into the config, and a refusal can name what is legal — which is the whole of what a caller needs in order to answer a required option. Held to the same printable-string rule as a default, because a choice becomes the value written into the adopter's TypeScript."),
|
|
304
351
|
choicesNeedingCode: manifestRecord(z.record(PrintableString, z.string().min(1))).optional().describe("Choices `pithy add` must refuse, each mapped to the sentence telling the adopter what to do instead — a value whose composition needs a seam only they can write. `pithy add` renders JSON into `pithy.config.ts`; it cannot render a function, so a choice whose validity depends on one is a choice it can write and the kit will then refuse to load. `payments`' `billingSubject: \"organization\"` is the one: it requires a `resolveSubject` saying which organization a caller acts for, deliberately has no default because a capability that guessed would key a company's plan to whoever signed in first, and so a config carrying the choice without the seam is refused at assembly — bricking every later command in the project, since they all begin by loading the config (#483). Refusing the choice up front costs the adopter one hand-edit; writing it costs them the project."),
|
|
352
|
+
choicesNeedingSeam: manifestRecord(z.record(PrintableString, ConfigSeam)).optional().describe("Choices `pithy add` writes **together with the code they need** — the other half of `choicesNeedingCode`, for a choice whose missing half the kit can scaffold. Each names a seam from `CONFIG_SEAMS`; `pithy add` writes that module into the Worker, imports it, and passes it to the capability's factory beside the choice. `payments`' `billingSubject: \"organization\"` is the one: reaching it used to mean passing `--set billingSubject=user`, a value that is wrong for the project, and then hand-editing both halves (#500). The scaffolded module is deliberately **not** a working stub — it is branded unimplemented, and the capability refuses the Worker's entrypoint while the brand is on it, because a resolver that answers nothing denies every gate and reads exactly like a customer who has not paid. A choice states this or `choicesNeedingCode`, never both: one is a refusal and the other is a scaffold."),
|
|
305
353
|
constant: ConfigConstant.optional().describe("A constant the scaffolded pithy.config.ts defines, rendered *unquoted* in place of `default` when the target config declares it. The one that exists is `publicOrigin` — `PUBLIC_ORIGIN`, this Worker's address for the environment it composes in. An option whose value is an origin must name it rather than state a URL, because a URL written down is production's URL written into staging: it is what mailed staging's testers magic links into production and unsubscribed them there (#256). `default` is still required *for such an option* and is what a config with no such constant gets, so an older project is never handed an identifier it does not define — the one place the absent-default rule does not reach, and it is checked rather than trusted."),
|
|
306
354
|
describe: z.string().min(1).refine(isPrintableComment, { error: (issue) => `A config option's rationale must be one line with no trailing whitespace, and ${JSON.stringify(issue.input)} is not — it is written into pithy.config.ts as a // comment.` }).describe("Rationale rendered as the comment above this option in pithy.config.ts; one line.")
|
|
307
355
|
}).check((ctx) => {
|
|
@@ -318,6 +366,20 @@ const ConfigOption = z.object({
|
|
|
318
366
|
path: ["choicesNeedingCode", choice],
|
|
319
367
|
message: `A choice needing code must be one this option offers, and ${JSON.stringify(choice)} is not — ${option.key} offers ${JSON.stringify(option.choices ?? [])}.`
|
|
320
368
|
});
|
|
369
|
+
for (const choice of Object.keys(option.choicesNeedingSeam ?? {})) {
|
|
370
|
+
if (!option.choices?.includes(choice)) ctx.issues.push({
|
|
371
|
+
code: "custom",
|
|
372
|
+
input: choice,
|
|
373
|
+
path: ["choicesNeedingSeam", choice],
|
|
374
|
+
message: `A choice needing a seam must be one this option offers, and ${JSON.stringify(choice)} is not — ${option.key} offers ${JSON.stringify(option.choices ?? [])}.`
|
|
375
|
+
});
|
|
376
|
+
if (option.choicesNeedingCode?.[choice] !== void 0) ctx.issues.push({
|
|
377
|
+
code: "custom",
|
|
378
|
+
input: choice,
|
|
379
|
+
path: ["choicesNeedingSeam", choice],
|
|
380
|
+
message: `A choice is refused or scaffolded, never both, and ${option.key} states ${JSON.stringify(choice)} in choicesNeedingCode and choicesNeedingSeam alike.`
|
|
381
|
+
});
|
|
382
|
+
}
|
|
321
383
|
if (option.constant !== void 0 && option.default === void 0) ctx.issues.push({
|
|
322
384
|
code: "custom",
|
|
323
385
|
input: option.constant,
|
|
@@ -353,4 +415,4 @@ const CapabilityManifest = z.object({
|
|
|
353
415
|
whenToEnable: z.string().optional().describe("Self-documenting rationale the CLI surfaces when offering this capability.")
|
|
354
416
|
}).describe("Declarative, CLI-facing description of a capability (pithy.manifest.json).");
|
|
355
417
|
//#endregion
|
|
356
|
-
export { CONFIG_CONSTANTS, CONFIG_LINE_WIDTH, CONFIG_OPTION_INDENT, CapabilityManifest, ConfigConstant, ConfigOption, ConfigOptionValue, renderCapabilityImport, renderCapabilityRegistration, renderConfigOptionComment, renderConfigOptionLine, renderConfigValue };
|
|
418
|
+
export { CONFIG_CONSTANTS, CONFIG_LINE_WIDTH, CONFIG_OPTION_INDENT, CONFIG_SEAMS, CapabilityManifest, ConfigConstant, ConfigOption, ConfigOptionValue, ConfigSeam, renderCapabilityImport, renderCapabilityRegistration, renderConfigOptionComment, renderConfigOptionLine, renderConfigSeamLine, renderConfigValue };
|
|
@@ -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 { ControlPlaneScope } from "../scope/scope.js";
|
|
2
4
|
import { CapabilityHealthReport, HealthSummary, HealthSummaryKey, healthReport, healthWire } from "./healthSummary.js";
|
|
3
5
|
import { ManifestConfigKey, ManifestConfigValues } from "./configuration.js";
|