@aotter/mantle 0.1.4 → 0.2.0-alpha.1
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/README.md +39 -306
- package/dist/admin/consent.d.ts +17 -0
- package/dist/admin/consent.d.ts.map +1 -0
- package/dist/admin/consent.js +17 -0
- package/dist/admin/consent.js.map +1 -0
- package/dist/admin/createAdminSurface.d.ts +22 -0
- package/dist/admin/createAdminSurface.d.ts.map +1 -0
- package/dist/admin/createAdminSurface.js +589 -0
- package/dist/admin/createAdminSurface.js.map +1 -0
- package/dist/admin/developerConsole.d.ts +264 -0
- package/dist/admin/developerConsole.d.ts.map +1 -0
- package/dist/admin/developerConsole.js +136 -0
- package/dist/admin/developerConsole.js.map +1 -0
- package/dist/admin/identity.d.ts +62 -0
- package/dist/admin/identity.d.ts.map +1 -0
- package/dist/admin/identity.js +7 -0
- package/dist/admin/identity.js.map +1 -0
- package/dist/admin/index.d.ts +4 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +4 -0
- package/dist/admin/index.js.map +1 -0
- package/dist/admin/procedureFlow.d.ts +25 -0
- package/dist/admin/procedureFlow.d.ts.map +1 -0
- package/dist/admin/procedureFlow.js +154 -0
- package/dist/admin/procedureFlow.js.map +1 -0
- package/dist/auth/ConsoleEmailSender.d.ts +15 -0
- package/dist/auth/ConsoleEmailSender.d.ts.map +1 -0
- package/dist/auth/ConsoleEmailSender.js +19 -0
- package/dist/auth/ConsoleEmailSender.js.map +1 -0
- package/dist/auth/appleClientSecret.d.ts +75 -0
- package/dist/auth/appleClientSecret.d.ts.map +1 -0
- package/dist/auth/appleClientSecret.js +116 -0
- package/dist/auth/appleClientSecret.js.map +1 -0
- package/dist/auth/buildAuth.d.ts +4565 -0
- package/dist/auth/buildAuth.d.ts.map +1 -0
- package/dist/auth/buildAuth.js +307 -0
- package/dist/auth/buildAuth.js.map +1 -0
- package/dist/auth/callerResolver.d.ts +48 -0
- package/dist/auth/callerResolver.d.ts.map +1 -0
- package/dist/auth/callerResolver.js +49 -0
- package/dist/auth/callerResolver.js.map +1 -0
- package/dist/auth/createAuthRoutes.d.ts +22 -0
- package/dist/auth/createAuthRoutes.d.ts.map +1 -0
- package/dist/auth/createAuthRoutes.js +128 -0
- package/dist/auth/createAuthRoutes.js.map +1 -0
- package/dist/auth/createMantleAuth.d.ts +3 -0
- package/dist/auth/createMantleAuth.d.ts.map +1 -0
- package/dist/auth/createMantleAuth.js +483 -0
- package/dist/auth/createMantleAuth.js.map +1 -0
- package/dist/auth/db.d.ts +17 -0
- package/dist/auth/db.d.ts.map +1 -0
- package/dist/auth/db.js +24 -0
- package/dist/auth/db.js.map +1 -0
- package/dist/auth/emailTemplates.d.ts +7 -0
- package/dist/auth/emailTemplates.d.ts.map +1 -0
- package/dist/auth/emailTemplates.js +27 -0
- package/dist/auth/emailTemplates.js.map +1 -0
- package/dist/auth/index.d.ts +9 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +7 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/methods.d.ts +717 -0
- package/dist/auth/methods.d.ts.map +1 -0
- package/dist/auth/methods.js +321 -0
- package/dist/auth/methods.js.map +1 -0
- package/dist/auth/oauthTokens.d.ts +24 -0
- package/dist/auth/oauthTokens.d.ts.map +1 -0
- package/dist/auth/oauthTokens.js +146 -0
- package/dist/auth/oauthTokens.js.map +1 -0
- package/dist/auth/setupIncomplete.d.ts +16 -0
- package/dist/auth/setupIncomplete.d.ts.map +1 -0
- package/dist/auth/setupIncomplete.js +50 -0
- package/dist/auth/setupIncomplete.js.map +1 -0
- package/dist/auth/types.d.ts +440 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +10 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/bun/index.d.ts +65 -0
- package/dist/bun/index.d.ts.map +1 -0
- package/dist/bun/index.js +130 -0
- package/dist/bun/index.js.map +1 -0
- package/dist/cli/emitModule.d.ts +7 -0
- package/dist/cli/emitModule.d.ts.map +1 -0
- package/dist/cli/emitModule.js +127 -0
- package/dist/cli/emitModule.js.map +1 -0
- package/dist/cli/generate.d.ts +4 -16
- package/dist/cli/generate.d.ts.map +1 -1
- package/dist/cli/generate.js +332 -165
- package/dist/cli/generate.js.map +1 -1
- package/dist/cli/main.d.ts +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +15 -71
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/preset.d.ts +18 -0
- package/dist/cli/preset.d.ts.map +1 -0
- package/dist/cli/preset.js +352 -0
- package/dist/cli/preset.js.map +1 -0
- package/dist/cloudflare/index.d.ts +21 -0
- package/dist/cloudflare/index.d.ts.map +1 -0
- package/dist/cloudflare/index.js +14 -0
- package/dist/cloudflare/index.js.map +1 -0
- package/dist/cloudflare/r2Media.d.ts +43 -0
- package/dist/cloudflare/r2Media.d.ts.map +1 -0
- package/dist/cloudflare/r2Media.js +69 -0
- package/dist/cloudflare/r2Media.js.map +1 -0
- package/dist/core/caller.d.ts +35 -0
- package/dist/core/caller.d.ts.map +1 -0
- package/dist/core/caller.js +3 -0
- package/dist/core/caller.js.map +1 -0
- package/dist/core/createMantle.d.ts +22 -0
- package/dist/core/createMantle.d.ts.map +1 -0
- package/dist/core/createMantle.js +117 -0
- package/dist/core/createMantle.js.map +1 -0
- package/dist/core/dialect.d.ts +41 -0
- package/dist/core/dialect.d.ts.map +1 -0
- package/dist/core/dialect.js +7 -0
- package/dist/core/dialect.js.map +1 -0
- package/dist/core/driver.d.ts +17 -0
- package/dist/core/driver.d.ts.map +1 -0
- package/dist/core/driver.js +2 -0
- package/dist/core/driver.js.map +1 -0
- package/dist/core/email.d.ts +17 -0
- package/dist/core/email.d.ts.map +1 -0
- package/dist/core/email.js +2 -0
- package/dist/core/email.js.map +1 -0
- package/dist/core/index.d.ts +16 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +16 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/invocation.d.ts +66 -0
- package/dist/core/invocation.d.ts.map +1 -0
- package/dist/core/invocation.js +3 -0
- package/dist/core/invocation.js.map +1 -0
- package/dist/core/runtime/auth.d.ts +9 -0
- package/dist/core/runtime/auth.d.ts.map +1 -0
- package/dist/core/runtime/auth.js +39 -0
- package/dist/core/runtime/auth.js.map +1 -0
- package/dist/core/runtime/createRuntime.d.ts +23 -0
- package/dist/core/runtime/createRuntime.d.ts.map +1 -0
- package/dist/core/runtime/createRuntime.js +214 -0
- package/dist/core/runtime/createRuntime.js.map +1 -0
- package/dist/core/runtime/verifyPlan.d.ts +34 -0
- package/dist/core/runtime/verifyPlan.d.ts.map +1 -0
- package/dist/core/runtime/verifyPlan.js +301 -0
- package/dist/core/runtime/verifyPlan.js.map +1 -0
- package/dist/core/service.d.ts +45 -0
- package/dist/core/service.d.ts.map +1 -0
- package/dist/core/service.js +2 -0
- package/dist/core/service.js.map +1 -0
- package/dist/core/site.d.ts +117 -0
- package/dist/core/site.d.ts.map +1 -0
- package/dist/core/site.js +2 -0
- package/dist/core/site.js.map +1 -0
- package/dist/core/siteConfig.d.ts +5 -0
- package/dist/core/siteConfig.d.ts.map +1 -0
- package/dist/core/siteConfig.js +24 -0
- package/dist/core/siteConfig.js.map +1 -0
- package/dist/core/sql/allowlist.d.ts +65 -0
- package/dist/core/sql/allowlist.d.ts.map +1 -0
- package/dist/core/sql/allowlist.js +705 -0
- package/dist/core/sql/allowlist.js.map +1 -0
- package/dist/core/sql/ast.d.ts +24 -0
- package/dist/core/sql/ast.d.ts.map +1 -0
- package/dist/core/sql/ast.js +32 -0
- package/dist/core/sql/ast.js.map +1 -0
- package/dist/core/sql/compile.d.ts +50 -0
- package/dist/core/sql/compile.d.ts.map +1 -0
- package/dist/core/sql/compile.js +48 -0
- package/dist/core/sql/compile.js.map +1 -0
- package/dist/core/sql/policy.d.ts +121 -0
- package/dist/core/sql/policy.d.ts.map +1 -0
- package/dist/core/sql/policy.js +379 -0
- package/dist/core/sql/policy.js.map +1 -0
- package/dist/core/sql/positions.d.ts +30 -0
- package/dist/core/sql/positions.d.ts.map +1 -0
- package/dist/core/sql/positions.js +22 -0
- package/dist/core/sql/positions.js.map +1 -0
- package/dist/core/sql/run.d.ts +76 -0
- package/dist/core/sql/run.d.ts.map +1 -0
- package/dist/core/sql/run.js +267 -0
- package/dist/core/sql/run.js.map +1 -0
- package/dist/core/store/createStore.d.ts +49 -0
- package/dist/core/store/createStore.d.ts.map +1 -0
- package/dist/core/store/createStore.js +227 -0
- package/dist/core/store/createStore.js.map +1 -0
- package/dist/core/store/cursor.d.ts +4 -0
- package/dist/core/store/cursor.d.ts.map +1 -0
- package/dist/core/store/cursor.js +22 -0
- package/dist/core/store/cursor.js.map +1 -0
- package/dist/core/store/json.d.ts +80 -0
- package/dist/core/store/json.d.ts.map +1 -0
- package/dist/core/store/json.js +342 -0
- package/dist/core/store/json.js.map +1 -0
- package/dist/core/store.d.ts +160 -0
- package/dist/core/store.d.ts.map +1 -0
- package/dist/core/store.js +2 -0
- package/dist/core/store.js.map +1 -0
- package/dist/core/wire.d.ts +20 -0
- package/dist/core/wire.d.ts.map +1 -0
- package/dist/core/wire.js +84 -0
- package/dist/core/wire.js.map +1 -0
- package/dist/core/withCaller.d.ts +16 -0
- package/dist/core/withCaller.d.ts.map +1 -0
- package/dist/core/withCaller.js +29 -0
- package/dist/core/withCaller.js.map +1 -0
- package/dist/d1/adapter.d.ts +12 -0
- package/dist/d1/adapter.d.ts.map +1 -0
- package/dist/d1/adapter.js +23 -0
- package/dist/d1/adapter.js.map +1 -0
- package/dist/d1/codec.d.ts +14 -0
- package/dist/d1/codec.d.ts.map +1 -0
- package/dist/d1/codec.js +136 -0
- package/dist/d1/codec.js.map +1 -0
- package/dist/d1/compile/index.d.ts +9 -0
- package/dist/d1/compile/index.d.ts.map +1 -0
- package/dist/d1/compile/index.js +9 -0
- package/dist/d1/compile/index.js.map +1 -0
- package/dist/d1/dialect.d.ts +4 -0
- package/dist/d1/dialect.d.ts.map +1 -0
- package/dist/d1/dialect.js +13 -0
- package/dist/d1/dialect.js.map +1 -0
- package/dist/d1/executor.d.ts +13 -0
- package/dist/d1/executor.d.ts.map +1 -0
- package/dist/d1/executor.js +91 -0
- package/dist/d1/executor.js.map +1 -0
- package/dist/d1/index.d.ts +6 -0
- package/dist/d1/index.d.ts.map +1 -0
- package/dist/d1/index.js +6 -0
- package/dist/d1/index.js.map +1 -0
- package/dist/d1/lower.d.ts +8 -0
- package/dist/d1/lower.d.ts.map +1 -0
- package/dist/d1/lower.js +167 -0
- package/dist/d1/lower.js.map +1 -0
- package/dist/d1/media.d.ts +5 -0
- package/dist/d1/media.d.ts.map +1 -0
- package/dist/d1/media.js +157 -0
- package/dist/d1/media.js.map +1 -0
- package/dist/d1/migrations.d.ts +12 -0
- package/dist/d1/migrations.d.ts.map +1 -0
- package/dist/d1/migrations.js +111 -0
- package/dist/d1/migrations.js.map +1 -0
- package/dist/d1/print.d.ts +28 -0
- package/dist/d1/print.d.ts.map +1 -0
- package/dist/d1/print.js +54 -0
- package/dist/d1/print.js.map +1 -0
- package/dist/d1/site.d.ts +17 -0
- package/dist/d1/site.d.ts.map +1 -0
- package/dist/d1/site.js +63 -0
- package/dist/d1/site.js.map +1 -0
- package/dist/d1/storage.d.ts +34 -0
- package/dist/d1/storage.d.ts.map +1 -0
- package/dist/d1/storage.js +288 -0
- package/dist/d1/storage.js.map +1 -0
- package/dist/d1/tz.d.ts +21 -0
- package/dist/d1/tz.d.ts.map +1 -0
- package/dist/d1/tz.js +54 -0
- package/dist/d1/tz.js.map +1 -0
- package/dist/d1/validator.d.ts +10 -0
- package/dist/d1/validator.d.ts.map +1 -0
- package/dist/d1/validator.js +33 -0
- package/dist/d1/validator.js.map +1 -0
- package/dist/mcp/apps.d.ts +43 -0
- package/dist/mcp/apps.d.ts.map +1 -0
- package/dist/mcp/apps.js +57 -0
- package/dist/mcp/apps.js.map +1 -0
- package/dist/mcp/catalog.d.ts +55 -0
- package/dist/mcp/catalog.d.ts.map +1 -0
- package/dist/mcp/catalog.js +81 -0
- package/dist/mcp/catalog.js.map +1 -0
- package/dist/mcp/createMcpSurface.d.ts +34 -0
- package/dist/mcp/createMcpSurface.d.ts.map +1 -0
- package/dist/mcp/createMcpSurface.js +150 -0
- package/dist/mcp/createMcpSurface.js.map +1 -0
- package/dist/mcp/index.d.ts +4 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +4 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/postgres/adapter.d.ts +20 -0
- package/dist/postgres/adapter.d.ts.map +1 -0
- package/dist/postgres/adapter.js +44 -0
- package/dist/postgres/adapter.js.map +1 -0
- package/dist/postgres/codec.d.ts +13 -0
- package/dist/postgres/codec.d.ts.map +1 -0
- package/dist/postgres/codec.js +110 -0
- package/dist/postgres/codec.js.map +1 -0
- package/dist/postgres/compile/index.d.ts +9 -0
- package/dist/postgres/compile/index.d.ts.map +1 -0
- package/dist/postgres/compile/index.js +9 -0
- package/dist/postgres/compile/index.js.map +1 -0
- package/dist/postgres/driver.d.ts +92 -0
- package/dist/postgres/driver.d.ts.map +1 -0
- package/dist/postgres/driver.js +110 -0
- package/dist/postgres/driver.js.map +1 -0
- package/dist/postgres/executor.d.ts +20 -0
- package/dist/postgres/executor.d.ts.map +1 -0
- package/dist/postgres/executor.js +69 -0
- package/dist/postgres/executor.js.map +1 -0
- package/dist/postgres/index.d.ts +7 -0
- package/dist/postgres/index.d.ts.map +1 -0
- package/dist/postgres/index.js +7 -0
- package/dist/postgres/index.js.map +1 -0
- package/dist/postgres/lower.d.ts +6 -0
- package/dist/postgres/lower.d.ts.map +1 -0
- package/dist/postgres/lower.js +157 -0
- package/dist/postgres/lower.js.map +1 -0
- package/dist/postgres/print.d.ts +11 -0
- package/dist/postgres/print.d.ts.map +1 -0
- package/dist/postgres/print.js +121 -0
- package/dist/postgres/print.js.map +1 -0
- package/dist/postgres/storage.d.ts +19 -0
- package/dist/postgres/storage.d.ts.map +1 -0
- package/dist/postgres/storage.js +201 -0
- package/dist/postgres/storage.js.map +1 -0
- package/dist/postgres/textRows.d.ts +10 -0
- package/dist/postgres/textRows.d.ts.map +1 -0
- package/dist/postgres/textRows.js +44 -0
- package/dist/postgres/textRows.js.map +1 -0
- package/dist/postgres/validator.d.ts +12 -0
- package/dist/postgres/validator.d.ts.map +1 -0
- package/dist/postgres/validator.js +46 -0
- package/dist/postgres/validator.js.map +1 -0
- package/dist/spec/domain/index.d.ts +3 -0
- package/dist/spec/domain/index.d.ts.map +1 -0
- package/dist/spec/domain/index.js +3 -0
- package/dist/spec/domain/index.js.map +1 -0
- package/dist/spec/domain/model/ContentState.d.ts +8 -0
- package/dist/spec/domain/model/ContentState.d.ts.map +1 -0
- package/dist/spec/domain/model/ContentState.js +7 -0
- package/dist/spec/domain/model/ContentState.js.map +1 -0
- package/dist/spec/domain/model/Entry.d.ts +29 -0
- package/dist/spec/domain/model/Entry.d.ts.map +1 -0
- package/dist/spec/domain/model/Entry.js +16 -0
- package/dist/spec/domain/model/Entry.js.map +1 -0
- package/dist/spec/domain/model/Locale.d.ts +30 -0
- package/dist/spec/domain/model/Locale.d.ts.map +1 -0
- package/dist/spec/domain/model/Locale.js +33 -0
- package/dist/spec/domain/model/Locale.js.map +1 -0
- package/dist/spec/domain/model/ManifestGrammar.d.ts +452 -0
- package/dist/spec/domain/model/ManifestGrammar.d.ts.map +1 -0
- package/dist/spec/domain/model/ManifestGrammar.js +149 -0
- package/dist/spec/domain/model/ManifestGrammar.js.map +1 -0
- package/dist/spec/domain/model/MediaMimeAccept.d.ts +55 -0
- package/dist/spec/domain/model/MediaMimeAccept.d.ts.map +1 -0
- package/dist/spec/domain/model/MediaMimeAccept.js +90 -0
- package/dist/spec/domain/model/MediaMimeAccept.js.map +1 -0
- package/dist/spec/domain/model/RuntimePlan.d.ts +94 -0
- package/dist/spec/domain/model/RuntimePlan.d.ts.map +1 -0
- package/dist/spec/domain/model/RuntimePlan.js +4 -0
- package/dist/spec/domain/model/RuntimePlan.js.map +1 -0
- package/dist/spec/domain/model/SiteConfig.d.ts +173 -0
- package/dist/spec/domain/model/SiteConfig.d.ts.map +1 -0
- package/dist/spec/domain/model/SiteConfig.js +13 -0
- package/dist/spec/domain/model/SiteConfig.js.map +1 -0
- package/dist/spec/domain/model/SqlIr.d.ts +96 -0
- package/dist/spec/domain/model/SqlIr.d.ts.map +1 -0
- package/dist/spec/domain/model/SqlIr.js +95 -0
- package/dist/spec/domain/model/SqlIr.js.map +1 -0
- package/dist/spec/domain/model/index.d.ts +14 -0
- package/dist/spec/domain/model/index.d.ts.map +1 -0
- package/dist/spec/domain/model/index.js +14 -0
- package/dist/spec/domain/model/index.js.map +1 -0
- package/dist/spec/domain/service/CloudflareCron.d.ts +2 -0
- package/dist/spec/domain/service/CloudflareCron.d.ts.map +1 -0
- package/dist/spec/domain/service/CloudflareCron.js +63 -0
- package/dist/spec/domain/service/CloudflareCron.js.map +1 -0
- package/dist/spec/domain/service/CrossSchemaChecker.d.ts +34 -0
- package/dist/spec/domain/service/CrossSchemaChecker.d.ts.map +1 -0
- package/dist/spec/domain/service/CrossSchemaChecker.js +114 -0
- package/dist/spec/domain/service/CrossSchemaChecker.js.map +1 -0
- package/dist/spec/domain/service/EntryDataValidator.d.ts +56 -0
- package/dist/spec/domain/service/EntryDataValidator.d.ts.map +1 -0
- package/dist/spec/domain/service/EntryDataValidator.js +88 -0
- package/dist/spec/domain/service/EntryDataValidator.js.map +1 -0
- package/dist/spec/domain/service/JsonSchemaToZod.d.ts +29 -0
- package/dist/spec/domain/service/JsonSchemaToZod.d.ts.map +1 -0
- package/dist/spec/domain/service/JsonSchemaToZod.js +156 -0
- package/dist/spec/domain/service/JsonSchemaToZod.js.map +1 -0
- package/dist/spec/domain/service/LifecycleStateMachine.d.ts +75 -0
- package/dist/spec/domain/service/LifecycleStateMachine.d.ts.map +1 -0
- package/dist/spec/domain/service/LifecycleStateMachine.js +76 -0
- package/dist/spec/domain/service/LifecycleStateMachine.js.map +1 -0
- package/dist/spec/domain/service/LocaleCanonicalizer.d.ts +29 -0
- package/dist/spec/domain/service/LocaleCanonicalizer.d.ts.map +1 -0
- package/dist/spec/domain/service/LocaleCanonicalizer.js +96 -0
- package/dist/spec/domain/service/LocaleCanonicalizer.js.map +1 -0
- package/dist/spec/domain/service/ManifestFieldChecks.d.ts +60 -0
- package/dist/spec/domain/service/ManifestFieldChecks.d.ts.map +1 -0
- package/dist/spec/domain/service/ManifestFieldChecks.js +116 -0
- package/dist/spec/domain/service/ManifestFieldChecks.js.map +1 -0
- package/dist/spec/domain/service/ManifestGraphValidator.d.ts +15 -0
- package/dist/spec/domain/service/ManifestGraphValidator.d.ts.map +1 -0
- package/dist/spec/domain/service/ManifestGraphValidator.js +225 -0
- package/dist/spec/domain/service/ManifestGraphValidator.js.map +1 -0
- package/dist/spec/domain/service/ManifestLinker.d.ts +45 -0
- package/dist/spec/domain/service/ManifestLinker.d.ts.map +1 -0
- package/dist/spec/domain/service/ManifestLinker.js +92 -0
- package/dist/spec/domain/service/ManifestLinker.js.map +1 -0
- package/dist/spec/domain/service/ManifestLocaleTrimmer.d.ts +16 -0
- package/dist/spec/domain/service/ManifestLocaleTrimmer.d.ts.map +1 -0
- package/dist/spec/domain/service/ManifestLocaleTrimmer.js +76 -0
- package/dist/spec/domain/service/ManifestLocaleTrimmer.js.map +1 -0
- package/dist/spec/domain/service/ManifestParser.d.ts +49 -0
- package/dist/spec/domain/service/ManifestParser.d.ts.map +1 -0
- package/dist/spec/domain/service/ManifestParser.js +203 -0
- package/dist/spec/domain/service/ManifestParser.js.map +1 -0
- package/dist/spec/domain/service/ManifestPartition.d.ts +9 -0
- package/dist/spec/domain/service/ManifestPartition.d.ts.map +1 -0
- package/dist/spec/domain/service/ManifestPartition.js +19 -0
- package/dist/spec/domain/service/ManifestPartition.js.map +1 -0
- package/dist/spec/domain/service/ManifestPathDiagnoser.d.ts +33 -0
- package/dist/spec/domain/service/ManifestPathDiagnoser.d.ts.map +1 -0
- package/dist/spec/domain/service/ManifestPathDiagnoser.js +43 -0
- package/dist/spec/domain/service/ManifestPathDiagnoser.js.map +1 -0
- package/dist/spec/domain/service/ManifestSourceSpans.d.ts +10 -0
- package/dist/spec/domain/service/ManifestSourceSpans.d.ts.map +1 -0
- package/dist/spec/domain/service/ManifestSourceSpans.js +76 -0
- package/dist/spec/domain/service/ManifestSourceSpans.js.map +1 -0
- package/dist/spec/domain/service/McpToolNaming.d.ts +25 -0
- package/dist/spec/domain/service/McpToolNaming.d.ts.map +1 -0
- package/dist/spec/domain/service/McpToolNaming.js +50 -0
- package/dist/spec/domain/service/McpToolNaming.js.map +1 -0
- package/dist/spec/domain/service/PlanFingerprint.d.ts +4 -0
- package/dist/spec/domain/service/PlanFingerprint.d.ts.map +1 -0
- package/dist/spec/domain/service/PlanFingerprint.js +14 -0
- package/dist/spec/domain/service/PlanFingerprint.js.map +1 -0
- package/dist/spec/domain/service/ProcedureViewSpecChecks.d.ts +4 -0
- package/dist/spec/domain/service/ProcedureViewSpecChecks.d.ts.map +1 -0
- package/dist/spec/domain/service/ProcedureViewSpecChecks.js +211 -0
- package/dist/spec/domain/service/ProcedureViewSpecChecks.js.map +1 -0
- package/dist/spec/domain/service/SchemaAdminUiChecker.d.ts +42 -0
- package/dist/spec/domain/service/SchemaAdminUiChecker.d.ts.map +1 -0
- package/dist/spec/domain/service/SchemaAdminUiChecker.js +289 -0
- package/dist/spec/domain/service/SchemaAdminUiChecker.js.map +1 -0
- package/dist/spec/domain/service/SchemaIndexChecker.d.ts +33 -0
- package/dist/spec/domain/service/SchemaIndexChecker.d.ts.map +1 -0
- package/dist/spec/domain/service/SchemaIndexChecker.js +256 -0
- package/dist/spec/domain/service/SchemaIndexChecker.js.map +1 -0
- package/dist/spec/domain/service/SchemaSearchChecker.d.ts +11 -0
- package/dist/spec/domain/service/SchemaSearchChecker.d.ts.map +1 -0
- package/dist/spec/domain/service/SchemaSearchChecker.js +78 -0
- package/dist/spec/domain/service/SchemaSearchChecker.js.map +1 -0
- package/dist/spec/domain/service/SchemaSpecChecks.d.ts +31 -0
- package/dist/spec/domain/service/SchemaSpecChecks.d.ts.map +1 -0
- package/dist/spec/domain/service/SchemaSpecChecks.js +445 -0
- package/dist/spec/domain/service/SchemaSpecChecks.js.map +1 -0
- package/dist/spec/domain/service/SiteDefaultsValidator.d.ts +39 -0
- package/dist/spec/domain/service/SiteDefaultsValidator.d.ts.map +1 -0
- package/dist/spec/domain/service/SiteDefaultsValidator.js +194 -0
- package/dist/spec/domain/service/SiteDefaultsValidator.js.map +1 -0
- package/dist/spec/domain/service/SqlClassify.d.ts +19 -0
- package/dist/spec/domain/service/SqlClassify.d.ts.map +1 -0
- package/dist/spec/domain/service/SqlClassify.js +42 -0
- package/dist/spec/domain/service/SqlClassify.js.map +1 -0
- package/dist/spec/domain/service/SqlRefusal.d.ts +16 -0
- package/dist/spec/domain/service/SqlRefusal.d.ts.map +1 -0
- package/dist/spec/domain/service/SqlRefusal.js +20 -0
- package/dist/spec/domain/service/SqlRefusal.js.map +1 -0
- package/dist/spec/domain/service/SqlTypes.d.ts +40 -0
- package/dist/spec/domain/service/SqlTypes.d.ts.map +1 -0
- package/dist/spec/domain/service/SqlTypes.js +110 -0
- package/dist/spec/domain/service/SqlTypes.js.map +1 -0
- package/dist/spec/domain/service/StaffRoleHierarchy.d.ts +3 -0
- package/dist/spec/domain/service/StaffRoleHierarchy.d.ts.map +1 -0
- package/dist/spec/domain/service/StaffRoleHierarchy.js +19 -0
- package/dist/spec/domain/service/StaffRoleHierarchy.js.map +1 -0
- package/dist/spec/domain/service/TriggerGraphChecks.d.ts +16 -0
- package/dist/spec/domain/service/TriggerGraphChecks.d.ts.map +1 -0
- package/dist/spec/domain/service/TriggerGraphChecks.js +337 -0
- package/dist/spec/domain/service/TriggerGraphChecks.js.map +1 -0
- package/dist/spec/domain/service/TriggerSpecChecks.d.ts +4 -0
- package/dist/spec/domain/service/TriggerSpecChecks.d.ts.map +1 -0
- package/dist/spec/domain/service/TriggerSpecChecks.js +89 -0
- package/dist/spec/domain/service/TriggerSpecChecks.js.map +1 -0
- package/dist/spec/domain/service/ValidatedAdminUiProjection.d.ts +11 -0
- package/dist/spec/domain/service/ValidatedAdminUiProjection.d.ts.map +1 -0
- package/dist/spec/domain/service/ValidatedAdminUiProjection.js +26 -0
- package/dist/spec/domain/service/ValidatedAdminUiProjection.js.map +1 -0
- package/dist/spec/domain/service/ViewAdminUiChecker.d.ts +14 -0
- package/dist/spec/domain/service/ViewAdminUiChecker.d.ts.map +1 -0
- package/dist/spec/domain/service/ViewAdminUiChecker.js +53 -0
- package/dist/spec/domain/service/ViewAdminUiChecker.js.map +1 -0
- package/dist/spec/domain/service/index.d.ts +24 -0
- package/dist/spec/domain/service/index.d.ts.map +1 -0
- package/dist/spec/domain/service/index.js +24 -0
- package/dist/spec/domain/service/index.js.map +1 -0
- package/dist/spec/index.d.ts +10 -0
- package/dist/spec/index.d.ts.map +1 -0
- package/dist/spec/index.js +12 -0
- package/dist/spec/index.js.map +1 -0
- package/dist/spec/infrastructure/cli/parseArgsError.d.ts +16 -0
- package/dist/spec/infrastructure/cli/parseArgsError.d.ts.map +1 -0
- package/dist/spec/infrastructure/cli/parseArgsError.js +34 -0
- package/dist/spec/infrastructure/cli/parseArgsError.js.map +1 -0
- package/dist/spec/infrastructure/index.d.ts +2 -0
- package/dist/spec/infrastructure/index.d.ts.map +1 -0
- package/dist/spec/infrastructure/index.js +2 -0
- package/dist/spec/infrastructure/index.js.map +1 -0
- package/dist/spec/infrastructure/sql/PgQueryParser.d.ts +18 -0
- package/dist/spec/infrastructure/sql/PgQueryParser.d.ts.map +1 -0
- package/dist/spec/infrastructure/sql/PgQueryParser.js +17 -0
- package/dist/spec/infrastructure/sql/PgQueryParser.js.map +1 -0
- package/dist/spec/infrastructure/sql/compilePlan.d.ts +37 -0
- package/dist/spec/infrastructure/sql/compilePlan.d.ts.map +1 -0
- package/dist/spec/infrastructure/sql/compilePlan.js +282 -0
- package/dist/spec/infrastructure/sql/compilePlan.js.map +1 -0
- package/dist/spec/infrastructure/sql/compileSql.d.ts +35 -0
- package/dist/spec/infrastructure/sql/compileSql.d.ts.map +1 -0
- package/dist/spec/infrastructure/sql/compileSql.js +92 -0
- package/dist/spec/infrastructure/sql/compileSql.js.map +1 -0
- package/dist/spec/infrastructure/sql/frontEnd.d.ts +8 -0
- package/dist/spec/infrastructure/sql/frontEnd.d.ts.map +1 -0
- package/dist/spec/infrastructure/sql/frontEnd.js +100 -0
- package/dist/spec/infrastructure/sql/frontEnd.js.map +1 -0
- package/dist/spec/infrastructure/sql/index.d.ts +4 -0
- package/dist/spec/infrastructure/sql/index.d.ts.map +1 -0
- package/dist/spec/infrastructure/sql/index.js +4 -0
- package/dist/spec/infrastructure/sql/index.js.map +1 -0
- package/dist/spec/kernel/diagnostic.d.ts +137 -0
- package/dist/spec/kernel/diagnostic.d.ts.map +1 -0
- package/dist/spec/kernel/diagnostic.js +296 -0
- package/dist/spec/kernel/diagnostic.js.map +1 -0
- package/dist/spec/kernel/index.d.ts +8 -0
- package/dist/spec/kernel/index.d.ts.map +1 -0
- package/dist/spec/kernel/index.js +8 -0
- package/dist/spec/kernel/index.js.map +1 -0
- package/dist/spec/usecase/EmitTypes.d.ts +22 -0
- package/dist/spec/usecase/EmitTypes.d.ts.map +1 -0
- package/dist/spec/usecase/EmitTypes.js +182 -0
- package/dist/spec/usecase/EmitTypes.js.map +1 -0
- package/dist/spec/usecase/ValidateManifestsUseCase.d.ts +8 -0
- package/dist/spec/usecase/ValidateManifestsUseCase.d.ts.map +1 -0
- package/dist/spec/usecase/ValidateManifestsUseCase.js +101 -0
- package/dist/spec/usecase/ValidateManifestsUseCase.js.map +1 -0
- package/dist/spec/usecase/dto/ValidateManifestsRequest.d.ts +27 -0
- package/dist/spec/usecase/dto/ValidateManifestsRequest.d.ts.map +1 -0
- package/dist/spec/usecase/dto/ValidateManifestsRequest.js +2 -0
- package/dist/spec/usecase/dto/ValidateManifestsRequest.js.map +1 -0
- package/dist/spec/usecase/dto/ValidateManifestsResponse.d.ts +14 -0
- package/dist/spec/usecase/dto/ValidateManifestsResponse.d.ts.map +1 -0
- package/dist/spec/usecase/dto/ValidateManifestsResponse.js +2 -0
- package/dist/spec/usecase/dto/ValidateManifestsResponse.js.map +1 -0
- package/dist/spec/usecase/dto/index.d.ts +3 -0
- package/dist/spec/usecase/dto/index.d.ts.map +1 -0
- package/dist/spec/usecase/dto/index.js +3 -0
- package/dist/spec/usecase/dto/index.js.map +1 -0
- package/dist/spec/usecase/index.d.ts +10 -0
- package/dist/spec/usecase/index.d.ts.map +1 -0
- package/dist/spec/usecase/index.js +10 -0
- package/dist/spec/usecase/index.js.map +1 -0
- package/dist/testing/cases/before-hook.d.ts +4 -0
- package/dist/testing/cases/before-hook.d.ts.map +1 -0
- package/dist/testing/cases/before-hook.js +71 -0
- package/dist/testing/cases/before-hook.js.map +1 -0
- package/dist/testing/cases/corpus.d.ts +12 -0
- package/dist/testing/cases/corpus.d.ts.map +1 -0
- package/dist/testing/cases/corpus.js +91 -0
- package/dist/testing/cases/corpus.js.map +1 -0
- package/dist/testing/cases/policy.d.ts +74 -0
- package/dist/testing/cases/policy.d.ts.map +1 -0
- package/dist/testing/cases/policy.js +142 -0
- package/dist/testing/cases/policy.js.map +1 -0
- package/dist/testing/cases/printer.d.ts +4 -0
- package/dist/testing/cases/printer.d.ts.map +1 -0
- package/dist/testing/cases/printer.js +32 -0
- package/dist/testing/cases/printer.js.map +1 -0
- package/dist/testing/cases/report-view.d.ts +5 -0
- package/dist/testing/cases/report-view.d.ts.map +1 -0
- package/dist/testing/cases/report-view.js +33 -0
- package/dist/testing/cases/report-view.js.map +1 -0
- package/dist/testing/cases/requisition.d.ts +4 -0
- package/dist/testing/cases/requisition.d.ts.map +1 -0
- package/dist/testing/cases/requisition.js +38 -0
- package/dist/testing/cases/requisition.js.map +1 -0
- package/dist/testing/cases/search-places.d.ts +4 -0
- package/dist/testing/cases/search-places.d.ts.map +1 -0
- package/dist/testing/cases/search-places.js +60 -0
- package/dist/testing/cases/search-places.js.map +1 -0
- package/dist/testing/cases/stock.d.ts +4 -0
- package/dist/testing/cases/stock.d.ts.map +1 -0
- package/dist/testing/cases/stock.js +35 -0
- package/dist/testing/cases/stock.js.map +1 -0
- package/dist/testing/cases/store.d.ts +4 -0
- package/dist/testing/cases/store.d.ts.map +1 -0
- package/dist/testing/cases/store.js +100 -0
- package/dist/testing/cases/store.js.map +1 -0
- package/dist/testing/harness.d.ts +94 -0
- package/dist/testing/harness.d.ts.map +1 -0
- package/dist/testing/harness.js +168 -0
- package/dist/testing/harness.js.map +1 -0
- package/dist/testing/index.d.ts +37 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +43 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/report.d.ts +15 -0
- package/dist/testing/report.d.ts.map +1 -0
- package/dist/testing/report.js +22 -0
- package/dist/testing/report.js.map +1 -0
- package/dist/web/createRestSurface.d.ts +7 -0
- package/dist/web/createRestSurface.d.ts.map +1 -0
- package/dist/web/createRestSurface.js +39 -0
- package/dist/web/createRestSurface.js.map +1 -0
- package/dist/web/index.d.ts +2 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +2 -0
- package/dist/web/index.js.map +1 -0
- package/docs/adr/0008-structured-diagnostic-shape.md +2 -2
- package/docs/adr/0011-adapter-port-spec.md +2 -2
- package/docs/adr/0014-auth-better-auth-and-multi-tenant-mcp.md +21 -2
- package/docs/adr/0019-sealed-manifest-runtime-pipeline.md +5 -1
- package/docs/adr/0021-retire-starter-scaffolding.md +1 -1
- package/docs/adr/0022-caller-observed-version-occ.md +1 -1
- package/docs/adr/0024-manifest-native-schema-tables.md +2 -2
- package/docs/adr/0026-progressive-generate.md +36 -0
- package/docs/adr/0027-scheduled-procedure-triggers.md +31 -0
- package/docs/adr/0028-schema-ttl-expiry.md +33 -0
- package/docs/adr/0029-mcp-apps-interaction-contracts.md +324 -0
- package/docs/adr/0030-store.md +40 -0
- package/docs/adr/0031-host-cloud-core-contract.md +25 -0
- package/docs/adr/0032-store-centric-core-and-service-contract.md +361 -0
- package/docs/adr/0033-storage-converges-to-the-plan.md +92 -0
- package/docs/adr/0034-store-is-authored-as-sql.md +192 -0
- package/docs/adr/0035-sql-dialects.md +154 -0
- package/docs/adr/0036-host-and-dialect.md +65 -0
- package/docs/adr/0037-postgresql-is-the-reference-dialect.md +124 -0
- package/docs/adr/0038-bun-native-host.md +63 -0
- package/docs/adr/README.md +26 -8
- package/docs/adr/adr-lite-861-admin-webmcp.md +6 -0
- package/docs/adr/adr-lite-909-admin-ui-kit.md +1 -1
- package/docs/examples/README.md +16 -18
- package/docs/examples/commerce-inventory.md +481 -0
- package/docs/examples/commerce.md +254 -0
- package/docs/examples/guarded-api.md +238 -0
- package/docs/examples/intake-hooks.md +237 -0
- package/docs/examples/intake.md +127 -0
- package/docs/examples/legal-documents.md +218 -0
- package/docs/examples/procurement.md +215 -0
- package/docs/examples/publication.md +211 -0
- package/docs/examples/reference-service/.dev.vars.example +4 -0
- package/docs/examples/reference-service/.mantle/generated/mantle.ts +174 -0
- package/docs/examples/reference-service/.mantle/generated/plan.json +1936 -0
- package/docs/examples/reference-service/README.md +33 -0
- package/docs/examples/reference-service/manifests/catalog.yaml +103 -0
- package/docs/examples/reference-service/manifests/orders.yaml +120 -0
- package/docs/examples/reference-service/mantle.config.json +1 -0
- package/docs/examples/reference-service/package.json +27 -0
- package/docs/examples/reference-service/smoke.mjs +156 -0
- package/docs/examples/reference-service/src/handlers.ts +36 -0
- package/docs/examples/reference-service/src/index.ts +33 -0
- package/docs/examples/reference-service/src/service.ts +78 -0
- package/docs/examples/{host-minimal-worker → reference-service}/tsconfig.json +7 -2
- package/docs/examples/reference-service/wrangler.jsonc +26 -0
- package/docs/examples/reservation.md +142 -0
- package/docs/handbook/cloudflare/authentication.md +96 -299
- package/docs/handbook/cloudflare/chatgpt-sites.md +104 -15
- package/docs/handbook/cloudflare/deploy-and-operate.md +77 -71
- package/docs/handbook/cloudflare/media-r2.md +64 -187
- package/docs/handbook/cloudflare/service-entry.md +138 -0
- package/docs/handbook/concepts/authorization.md +104 -94
- package/docs/handbook/concepts/four-atoms.md +68 -144
- package/docs/handbook/concepts/lifecycle-and-locales.md +62 -114
- package/docs/handbook/concepts/mcp-and-agents.md +112 -117
- package/docs/handbook/concepts/procedures-and-triggers.md +126 -181
- package/docs/handbook/concepts/runtime-and-adapters.md +177 -156
- package/docs/handbook/concepts/views.md +97 -173
- package/docs/handbook/examples/hub.md +17 -6
- package/docs/handbook/guides/admin-ui.md +101 -96
- package/docs/handbook/guides/agent-setup.md +56 -71
- package/docs/handbook/guides/typed-queries.md +105 -111
- package/docs/handbook/navigation.json +8 -32
- package/docs/handbook/reference/authorization.md +52 -271
- package/docs/handbook/reference/diagnostics.md +69 -173
- package/docs/handbook/reference/features.md +48 -50
- package/docs/handbook/reference/manifest.md +56 -116
- package/docs/handbook/reference/procedure.md +92 -229
- package/docs/handbook/reference/schema.md +156 -215
- package/docs/handbook/reference/site-config.md +58 -211
- package/docs/handbook/reference/surface.md +69 -181
- package/docs/handbook/reference/trigger.md +73 -162
- package/docs/handbook/reference/view.md +140 -241
- package/docs/handbook/releases/index.md +58 -22
- package/docs/handbook/start/overview.md +59 -48
- package/docs/handbook/start/project-and-cli.md +127 -116
- package/docs/handbook/start/quickstart-worker.md +102 -151
- package/docs/skills/develop/SKILL.md +114 -232
- package/docs/skills/develop/mcp-app.md +79 -0
- package/docs/skills/integrate/SKILL.md +96 -0
- package/docs/skills/media-gc/SKILL.md +21 -10
- package/docs/skills/provision/SKILL.md +68 -162
- package/docs/skills/update/SKILL.md +33 -34
- package/docs/upgrade-0.1-to-0.2.md +211 -0
- package/package.json +87 -105
- package/dist/admin-ui.d.ts +0 -2
- package/dist/admin-ui.d.ts.map +0 -1
- package/dist/admin-ui.js +0 -2
- package/dist/admin-ui.js.map +0 -1
- package/dist/admin.d.ts +0 -2
- package/dist/admin.d.ts.map +0 -1
- package/dist/admin.js +0 -2
- package/dist/admin.js.map +0 -1
- package/dist/auth.d.ts +0 -2
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js +0 -2
- package/dist/auth.js.map +0 -1
- package/dist/bun.d.ts +0 -2
- package/dist/bun.d.ts.map +0 -1
- package/dist/bun.js +0 -2
- package/dist/bun.js.map +0 -1
- package/dist/cli/harness.d.ts +0 -3
- package/dist/cli/harness.d.ts.map +0 -1
- package/dist/cli/harness.js +0 -214
- package/dist/cli/harness.js.map +0 -1
- package/dist/cli/skills.d.ts +0 -3
- package/dist/cli/skills.d.ts.map +0 -1
- package/dist/cli/skills.js +0 -128
- package/dist/cli/skills.js.map +0 -1
- package/dist/cloudflare.d.ts +0 -2
- package/dist/cloudflare.d.ts.map +0 -1
- package/dist/cloudflare.js +0 -2
- package/dist/cloudflare.js.map +0 -1
- package/dist/codegen/emitMantleModule.d.ts +0 -22
- package/dist/codegen/emitMantleModule.d.ts.map +0 -1
- package/dist/codegen/emitMantleModule.js +0 -291
- package/dist/codegen/emitMantleModule.js.map +0 -1
- package/dist/codegen.d.ts +0 -2
- package/dist/codegen.d.ts.map +0 -1
- package/dist/codegen.js +0 -2
- package/dist/codegen.js.map +0 -1
- package/dist/runtime-testing.d.ts +0 -2
- package/dist/runtime-testing.d.ts.map +0 -1
- package/dist/runtime-testing.js +0 -2
- package/dist/runtime-testing.js.map +0 -1
- package/dist/runtime.d.ts +0 -2
- package/dist/runtime.d.ts.map +0 -1
- package/dist/runtime.js +0 -2
- package/dist/runtime.js.map +0 -1
- package/dist/spec.d.ts +0 -2
- package/dist/spec.d.ts.map +0 -1
- package/dist/spec.js +0 -2
- package/dist/spec.js.map +0 -1
- package/dist/vercel-libsql.d.ts +0 -2
- package/dist/vercel-libsql.d.ts.map +0 -1
- package/dist/vercel-libsql.js +0 -2
- package/dist/vercel-libsql.js.map +0 -1
- package/dist/vercel.d.ts +0 -2
- package/dist/vercel.d.ts.map +0 -1
- package/dist/vercel.js +0 -2
- package/dist/vercel.js.map +0 -1
- package/dist/web.d.ts +0 -2
- package/dist/web.d.ts.map +0 -1
- package/dist/web.js +0 -2
- package/dist/web.js.map +0 -1
- package/docs/adapter-guide.md +0 -222
- package/docs/agent-prompts.md +0 -102
- package/docs/api-mcp-authorization.md +0 -5
- package/docs/assets/mantle-admin-developer.png +0 -0
- package/docs/assets/mantle-admin-operations.png +0 -0
- package/docs/assets/mantle-hero.jpg +0 -0
- package/docs/auth-hosting-model.md +0 -166
- package/docs/cloudflare-low-level-composition.md +0 -5
- package/docs/consumer-onboarding-audit.md +0 -65
- package/docs/deferred-lifecycle-queues.md +0 -5
- package/docs/design-atoms.md +0 -16
- package/docs/design-references/editorial-blog-2026-05-05.md +0 -218
- package/docs/direct-authoring.md +0 -5
- package/docs/examples/builtin-commerce.md +0 -269
- package/docs/examples/builtin-intake.md +0 -143
- package/docs/examples/builtin-legal-documents.md +0 -189
- package/docs/examples/builtin-procurement.md +0 -241
- package/docs/examples/builtin-publication.md +0 -241
- package/docs/examples/builtin-reservation.md +0 -149
- package/docs/examples/cf-primitives-commerce-inventory.md +0 -809
- package/docs/examples/cf-primitives-guarded-api.md +0 -429
- package/docs/examples/cf-primitives-intake-hooks.md +0 -319
- package/docs/examples/host-chatgpt-sites/.openai/hosting.json +0 -1
- package/docs/examples/host-chatgpt-sites/README.md +0 -70
- package/docs/examples/host-chatgpt-sites/drizzle/0000_sites_users.sql +0 -8
- package/docs/examples/host-chatgpt-sites/drizzle/0001_mantle.sql +0 -294
- package/docs/examples/host-chatgpt-sites/drizzle/0002_article_cover.sql +0 -5
- package/docs/examples/host-chatgpt-sites/drizzle/0003_store_instance_id.sql +0 -1
- package/docs/examples/host-chatgpt-sites/drizzle/meta/_journal.json +0 -1
- package/docs/examples/host-chatgpt-sites/manifests/site.yaml +0 -27
- package/docs/examples/host-chatgpt-sites/package.json +0 -1
- package/docs/examples/host-chatgpt-sites/public/site.css +0 -1
- package/docs/examples/host-chatgpt-sites/scripts/build.mjs +0 -13
- package/docs/examples/host-chatgpt-sites/scripts/check.mjs +0 -101
- package/docs/examples/host-chatgpt-sites/scripts/migration.mjs +0 -9
- package/docs/examples/host-chatgpt-sites/src/chatgpt-auth.ts +0 -63
- package/docs/examples/host-chatgpt-sites/src/index.ts +0 -46
- package/docs/examples/host-chatgpt-sites/src/mcp.ts +0 -49
- package/docs/examples/host-chatgpt-sites/src/media.ts +0 -109
- package/docs/examples/host-chatgpt-sites/src/r2-lab.ts +0 -38
- package/docs/examples/host-chatgpt-sites/src/storage-fingerprint.json +0 -1
- package/docs/examples/host-chatgpt-sites/src/web.ts +0 -35
- package/docs/examples/host-chatgpt-sites/tsconfig.json +0 -1
- package/docs/examples/host-chatgpt-sites/wrangler.jsonc +0 -10
- package/docs/examples/host-local-admin-otp/.dev.vars.example +0 -3
- package/docs/examples/host-local-admin-otp/README.md +0 -80
- package/docs/examples/host-local-admin-otp/ensure-dev-vars.mjs +0 -5
- package/docs/examples/host-local-admin-otp/manifests/site.yaml +0 -25
- package/docs/examples/host-local-admin-otp/package.json +0 -29
- package/docs/examples/host-local-admin-otp/public/.gitkeep +0 -1
- package/docs/examples/host-local-admin-otp/smoke.mjs +0 -141
- package/docs/examples/host-local-admin-otp/src/index.ts +0 -54
- package/docs/examples/host-local-admin-otp/tsconfig.json +0 -17
- package/docs/examples/host-local-admin-otp/wrangler.jsonc +0 -23
- package/docs/examples/host-minimal-worker/README.md +0 -41
- package/docs/examples/host-minimal-worker/manifests/site.yaml +0 -25
- package/docs/examples/host-minimal-worker/package.json +0 -26
- package/docs/examples/host-minimal-worker/smoke.mjs +0 -23
- package/docs/examples/host-minimal-worker/src/index.ts +0 -4
- package/docs/examples/host-minimal-worker/wrangler.jsonc +0 -22
- package/docs/handbook/chatgpt-sites/equipment-checkout.md +0 -231
- package/docs/handbook/chatgpt-sites/host-reference.md +0 -113
- package/docs/handbook/chatgpt-sites/index.md +0 -123
- package/docs/handbook/cloudflare/bindings.md +0 -298
- package/docs/handbook/cloudflare/conventional-worker.md +0 -162
- package/docs/handbook/cloudflare/deferred-hooks-queues.md +0 -170
- package/docs/handbook/cloudflare/low-level-composition.md +0 -169
- package/docs/handbook/cloudflare/public-web.md +0 -144
- package/docs/handbook/cloudflare/site-chrome.md +0 -75
- package/docs/handbook/examples/commerce-transaction.md +0 -11
- package/docs/handbook/examples/commerce.md +0 -11
- package/docs/handbook/examples/guarded-api.md +0 -10
- package/docs/handbook/examples/intake-form.md +0 -12
- package/docs/handbook/examples/intake-hooks.md +0 -11
- package/docs/handbook/examples/legal-documents.md +0 -10
- package/docs/handbook/examples/procurement-approvals.md +0 -10
- package/docs/handbook/examples/publication.md +0 -10
- package/docs/handbook/examples/reservation.md +0 -10
- package/docs/handbook/start/quickstart-admin.md +0 -50
- package/docs/labels.md +0 -71
- package/docs/media-uploads.md +0 -5
- package/docs/migration-0.1.2.md +0 -13
- package/docs/performance-harness.md +0 -228
- package/docs/release-process.md +0 -244
- package/docs/schema-indexes.md +0 -5
- package/docs/sealed-pipeline-ownership.md +0 -101
- package/docs/skills/plugin/SKILL.md +0 -132
- package/docs/skills/theme/SKILL.md +0 -77
- package/docs/spec-only-host-adoption.md +0 -157
- package/docs/transaction-patterns.md +0 -5
- package/skills/README.md +0 -125
- package/skills/develop/SKILL.md +0 -250
- package/skills/install/SKILL.md +0 -149
- package/skills/media-gc/SKILL.md +0 -85
- package/skills/plugin/SKILL.md +0 -132
- package/skills/provision/SKILL.md +0 -194
- package/skills/theme/SKILL.md +0 -77
- package/skills/update/SKILL.md +0 -51
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Each Cloudflare primitive a Mantle Worker can bind, what Mantle uses it for, the wrangler snippet, and the Env type.
|
|
3
|
-
---
|
|
4
|
-
# Bindings and primitives
|
|
5
|
-
|
|
6
|
-
This page lists every Cloudflare binding a Mantle Worker commonly declares: which are required, what Mantle does with each, the `wrangler.jsonc` snippet, and the matching `Env` field. Read it when you write or review a Worker's configuration.
|
|
7
|
-
|
|
8
|
-
## Compatibility flags
|
|
9
|
-
|
|
10
|
-
Every Mantle Worker keeps both flags:
|
|
11
|
-
|
|
12
|
-
```jsonc
|
|
13
|
-
"compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"]
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
`nodejs_compat` is required by the adapter and its Auth dependencies. `global_fetch_strictly_public` is required because MCP client metadata (CIMD) is fetched through the public Internet boundary.
|
|
17
|
-
|
|
18
|
-
## The composition-root rule
|
|
19
|
-
|
|
20
|
-
Bindings appear in two places only: the Worker entry (`createMantleWorker` options and the `bindings` hook) and `wrangler.jsonc`. Procedure handlers receive them through `ctx.env`. An application may own additional tables behind its own repository, but it never queries Mantle-owned native Schema tables, site settings, media or Auth tables outside the runtime. Use `runtime.entries`, generated `bindMantle(runtime)` and Views instead.
|
|
21
|
-
|
|
22
|
-
## The Env interface
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
import type { DeferredHookEnvelope } from "@aotter/mantle/runtime";
|
|
26
|
-
import type { MantleCloudflareEnv } from "@aotter/mantle/cloudflare";
|
|
27
|
-
|
|
28
|
-
interface EmailBinding {
|
|
29
|
-
send(message: { to: string; from: string; subject: string; text?: string; replyTo?: string }): Promise<unknown>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface Env extends MantleCloudflareEnv {
|
|
33
|
-
// MantleCloudflareEnv already declares DB, ASSETS?, MANTLE_KV? and the auth vars.
|
|
34
|
-
readonly DB: D1Database; // required
|
|
35
|
-
readonly ASSETS: Fetcher; // Admin bundle + your frontend
|
|
36
|
-
readonly PUBLIC_ORIGIN: string;
|
|
37
|
-
readonly MANTLE_KV?: KVNamespace; // optional MCP catalog cache
|
|
38
|
-
readonly MEDIA_BUCKET?: R2Bucket; // optional media
|
|
39
|
-
readonly R2_ACCOUNT_ID?: string;
|
|
40
|
-
readonly R2_ACCESS_KEY_ID?: string;
|
|
41
|
-
readonly R2_SECRET_ACCESS_KEY?: string;
|
|
42
|
-
readonly MEDIA_PUBLIC_URL_BASE?: string;
|
|
43
|
-
readonly AUDIT?: AnalyticsEngineDataset; // optional MCP tools/call audit trail
|
|
44
|
-
readonly MANTLE_INTERNAL_QUEUE?: Queue<DeferredHookEnvelope>; // optional deferred hooks
|
|
45
|
-
readonly ORDER_EXPIRY_QUEUE?: Queue<{ type: "expire-order"; orderToken: string }>; // application queue
|
|
46
|
-
readonly INVENTORY_COORDINATOR?: DurableObjectNamespace; // application-owned
|
|
47
|
-
readonly EMAIL?: EmailBinding; // Email Service
|
|
48
|
-
readonly TURNSTILE_SECRET_KEY?: string; // secret
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## D1: `DB` (required)
|
|
53
|
-
|
|
54
|
-
D1 is canonical storage. It holds one native table per Manifest Schema, Mantle's
|
|
55
|
-
`_mantle_*` envelope and migration metadata, site settings, media metadata and
|
|
56
|
-
pending uploads, and the Better Auth tables. `createConventionalBindings`
|
|
57
|
-
throws without `DB`.
|
|
58
|
-
|
|
59
|
-
```jsonc
|
|
60
|
-
"d1_databases": [
|
|
61
|
-
{ "binding": "DB", "database_name": "my-site", "database_id": "<production-id>" }
|
|
62
|
-
]
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Omit `database_id` only for local development. Set the production id before any remote deploy.
|
|
66
|
-
|
|
67
|
-
## Static Assets: `ASSETS`
|
|
68
|
-
|
|
69
|
-
```jsonc
|
|
70
|
-
"assets": { "directory": "./public", "binding": "ASSETS" }
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
`ASSETS` is a hard requirement for Admin. `mantle generate` syncs the **prebuilt** Admin SPA into `public/_mantle/admin/` when `@aotter/mantle-admin-ui` is installed — there is no Vite step unless you are developing `admin-ui` itself. The facade wraps `ASSETS` as the Admin asset server and falls back to `/_mantle/admin/index.html` for client-side Admin routes. The same binding serves your own CSS, JS and icons.
|
|
74
|
-
|
|
75
|
-
Without this binding, `/admin` can still return SPA HTML (`200`) while `/_mantle/admin/assets/*` is `404`. That white-screens the Dev UI.
|
|
76
|
-
|
|
77
|
-
When Worker routes and static paths overlap, list Worker-owned paths in `run_worker_first` and keep `not_found_handling` at `"none"` so unmatched requests fall through to the Worker. **Leave `/_mantle` out of `run_worker_first`** so hashed Admin JS/CSS stay on the assets layer. A production configuration lists `/admin`, `/admin/*`, `/mcp`, `/mcp/*`, `/oauth`, `/oauth/*`, `/.well-known/*`, `/api/*`, `/llms.txt`, `/robots.txt`, `/sitemap.xml`, `/*/llms.txt` and every public content prefix there, so a static file can never shadow a Mantle route.
|
|
78
|
-
|
|
79
|
-
## Workers Cache
|
|
80
|
-
|
|
81
|
-
```jsonc
|
|
82
|
-
"cache": { "enabled": true }
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
With a valid `cacheScope`, Mantle marks anonymous `200` `GET`/`HEAD` responses from the public mount (HTML, `.md`, `llms.txt`, sitemap) and eligible Views with a shared lifetime and a deployment-scoped `Cache-Tag`; everything else is `private, no-store`. Supplying a custom `credentialResolver` disables shared responses because Core cannot infer which request headers carry identity. Publishing-content and site-setting writes purge the tag after the canonical write. Purge failure is logged and does not turn a committed write into an error. The local emulator does not simulate the entrypoint cache or its purge API. See [Public web](./public-web.md#cache-contract).
|
|
86
|
-
|
|
87
|
-
## KV: `MANTLE_KV` (optional)
|
|
88
|
-
|
|
89
|
-
```jsonc
|
|
90
|
-
"kv_namespaces": [
|
|
91
|
-
{ "binding": "MANTLE_KV", "id": "<production-id>", "preview_id": "<development-id>" }
|
|
92
|
-
]
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
A deployment-owned namespace that caches the caller-independent MCP catalog projection (brand, description, origin, icons, media-purpose policy) so an authenticated MCP catalog does not read D1 site settings. D1 stays canonical; missing or expired snapshots are repaired from D1 within one hour, and a KV failure never fails a committed write. Never store tokens, sessions or content here. `createMantleWorker` uses this binding only when `cacheScope` is valid, producing keys such as `mantle:my-site-production:site-config:v1:mcp`. KV is eventually consistent across regions, so invalidation is not a global read-after-write guarantee.
|
|
96
|
-
|
|
97
|
-
## R2: `MEDIA_BUCKET` (optional)
|
|
98
|
-
|
|
99
|
-
```jsonc
|
|
100
|
-
"r2_buckets": [{ "binding": "MEDIA_BUCKET", "bucket_name": "<project>-media" }]
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Staff media uploads through Staff MCP presigned PUT. The binding alone cannot sign URLs; you also need `R2_ACCOUNT_ID`, `MEDIA_PUBLIC_URL_BASE` and the two S3 credential secrets. See [Media uploads with R2](./media-r2.md).
|
|
104
|
-
|
|
105
|
-
## Analytics Engine: `AUDIT` (optional)
|
|
106
|
-
|
|
107
|
-
```jsonc
|
|
108
|
-
"analytics_engine_datasets": [{ "binding": "AUDIT", "dataset": "mantle_mcp_audit" }]
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
An MCP `tools/call` audit trail: who called which tool on which surface, with
|
|
112
|
-
what outcome and how long it took. The runtime's `McpJsonRpcDispatcher` is the
|
|
113
|
-
single write point; it records nothing unless the composition root passes an
|
|
114
|
-
`AuditSink`, and the write happens through `waitUntil`, off the response path.
|
|
115
|
-
Request and response payloads are never recorded.
|
|
116
|
-
|
|
117
|
-
```ts
|
|
118
|
-
import { analyticsEngineAuditSink, createMantleWorker } from "@aotter/mantle/cloudflare";
|
|
119
|
-
|
|
120
|
-
export default createMantleWorker<Env>({
|
|
121
|
-
plan,
|
|
122
|
-
audit: (env) => env.AUDIT
|
|
123
|
-
? analyticsEngineAuditSink(env.AUDIT, { index: env.PUBLIC_ORIGIN })
|
|
124
|
-
: undefined,
|
|
125
|
-
});
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
One dataset may hold many deployments: `index` is the deployment's public
|
|
129
|
-
origin, the only column Analytics Engine filters cheaply. Columns, in order:
|
|
130
|
-
|
|
131
|
-
| Column | Field |
|
|
132
|
-
|---|---|
|
|
133
|
-
| `index1` | the configured `index` |
|
|
134
|
-
| `blob1` … `blob7` | `surface`, `callerId`, `clientId`, `credential`, `tool`, `outcome`, `operationId` |
|
|
135
|
-
| `double1`, `double2` | `at` (epoch ms), `durationMs` |
|
|
136
|
-
|
|
137
|
-
`outcome` is `ok`, a runtime Diagnostic code such as `UNAUTHENTICATED` or
|
|
138
|
-
`AUTH_DENIED`, `UNKNOWN_TOOL`, `INVALID_PARAMS`, `INTERNAL`, or a transport gate denial
|
|
139
|
-
(`INVALID_TOKEN`, `INSUFFICIENT_SCOPE`, `INSUFFICIENT_ROLE`, `CROSS_ORIGIN`): a
|
|
140
|
-
`tools/call` refused before it reaches the dispatcher is recorded too, with
|
|
141
|
-
whatever identity the gate established. Its body goes through the same 1 MiB
|
|
142
|
-
bounded reader as an admitted call; a denied request whose body is oversized
|
|
143
|
-
or not JSON is still recorded, with `tool` set to `(unreadable)`, so padding a
|
|
144
|
-
body cannot hide a credential probe. `operationId` is the string argument whose
|
|
145
|
-
schema declares `x-mcp-hint: idempotency-key`, falling back to the conventional
|
|
146
|
-
`operationId` argument when the tool declares no hint. It is empty when that
|
|
147
|
-
argument is absent and is resolved the same way on admitted and denied calls.
|
|
148
|
-
Read it with the
|
|
149
|
-
[SQL API](https://developers.cloudflare.com/analytics/analytics-engine/sql-api/):
|
|
150
|
-
|
|
151
|
-
```sql
|
|
152
|
-
SELECT timestamp, blob2 AS caller, blob5 AS tool, blob6 AS outcome, double2 AS ms
|
|
153
|
-
FROM mantle_mcp_audit
|
|
154
|
-
WHERE index1 IN ('https://site-a.example', 'https://site-b.example')
|
|
155
|
-
AND timestamp > NOW() - INTERVAL '7' DAY
|
|
156
|
-
ORDER BY timestamp DESC
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
Analytics Engine keeps data for a bounded window and samples under very high
|
|
160
|
-
write rates. Longer retention or a tamper-evident trail is an export job on top
|
|
161
|
-
of this dataset. Self-hosted runtimes may implement `AuditSink` over any store;
|
|
162
|
-
the interface is one `record(event)` method.
|
|
163
|
-
|
|
164
|
-
## Queues
|
|
165
|
-
|
|
166
|
-
```jsonc
|
|
167
|
-
"queues": {
|
|
168
|
-
"producers": [
|
|
169
|
-
{ "binding": "MANTLE_INTERNAL_QUEUE", "queue": "mantle-internal" },
|
|
170
|
-
{ "binding": "ORDER_EXPIRY_QUEUE", "queue": "my-site-order-expiry" }
|
|
171
|
-
],
|
|
172
|
-
"consumers": [
|
|
173
|
-
{ "queue": "mantle-internal", "max_batch_size": 10, "max_batch_timeout": 5,
|
|
174
|
-
"max_retries": 5, "retry_delay": 60, "dead_letter_queue": "mantle-internal-dlq" },
|
|
175
|
-
{ "queue": "my-site-order-expiry", "max_concurrency": 1, "max_batch_size": 10,
|
|
176
|
-
"max_retries": 5, "retry_delay": 30, "dead_letter_queue": "my-site-order-expiry-dlq" }
|
|
177
|
-
]
|
|
178
|
-
}
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
`MANTLE_INTERNAL_QUEUE` carries deferred `after_*` lifecycle hooks. Application queues share the same Worker; the `queue()` export switches on `batch.queue`. See [Deferred hooks with Queues](./deferred-hooks-queues.md).
|
|
182
|
-
|
|
183
|
-
## Cron Triggers
|
|
184
|
-
|
|
185
|
-
```jsonc
|
|
186
|
-
"triggers": { "crons": ["*/5 * * * *"] }
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
A `scheduled()` handler reuses the fetch path's runtime and invokes a Procedure that has no Trigger of its own:
|
|
190
|
-
|
|
191
|
-
```ts
|
|
192
|
-
import { bindMantle } from "../.mantle/generated/mantle.js";
|
|
193
|
-
|
|
194
|
-
const worker = createMantleWorker<Env>({ plan, handlers });
|
|
195
|
-
|
|
196
|
-
export default {
|
|
197
|
-
fetch: worker.fetch,
|
|
198
|
-
async scheduled(_controller, env, ctx) {
|
|
199
|
-
const mantle = bindMantle(await worker.getRuntime(env));
|
|
200
|
-
const result = await mantle.procedures.sweepExpiredOrders(
|
|
201
|
-
{ now: Date.now() },
|
|
202
|
-
{ user: null, staff: null, env, waitUntil: (p) => ctx.waitUntil(p) },
|
|
203
|
-
);
|
|
204
|
-
if (!result.ok) throw new Error(`sweep failed: ${result.diagnostic.code}`);
|
|
205
|
-
},
|
|
206
|
-
} satisfies ExportedHandler<Env>;
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
## Durable Objects (application-owned)
|
|
210
|
-
|
|
211
|
-
Durable Objects are not a Core primitive. Use one as an application-owned coordinator when a decision must be serialized, for example reserving inventory exactly once. Export the class from the Worker entry, then bind and migrate it:
|
|
212
|
-
|
|
213
|
-
```jsonc
|
|
214
|
-
"durable_objects": { "bindings": [{ "name": "INVENTORY_COORDINATOR", "class_name": "InventoryCoordinator" }] },
|
|
215
|
-
"migrations": [{ "tag": "inventory-v1", "new_sqlite_classes": ["InventoryCoordinator"] }]
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
```ts
|
|
219
|
-
export { InventoryCoordinator } from "./commerce/InventoryCoordinator.js";
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
The coordinator keeps its own state; Mantle entries mirror the result. See [Commerce inventory](../../examples/cf-primitives-commerce-inventory.md).
|
|
223
|
-
|
|
224
|
-
## Email Service: `[[send_email]]`
|
|
225
|
-
|
|
226
|
-
```jsonc
|
|
227
|
-
"send_email": [{ "name": "EMAIL" }]
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
Send from an `after_create` handler with `errorPolicy: continue`, and fail soft when the binding or addresses are absent so submissions still save on a fresh deployment:
|
|
231
|
-
|
|
232
|
-
```ts
|
|
233
|
-
export async function notifyIntake(input: { name?: string; email?: string }, ctx: HandlerContext) {
|
|
234
|
-
const env = ctx.env as Env & { INTAKE_NOTIFY_TO?: string; INTAKE_NOTIFY_FROM?: string };
|
|
235
|
-
if (!env.EMAIL || !env.INTAKE_NOTIFY_TO || !env.INTAKE_NOTIFY_FROM) {
|
|
236
|
-
console.info("[intake] notification not configured");
|
|
237
|
-
return { ok: true };
|
|
238
|
-
}
|
|
239
|
-
await env.EMAIL.send({
|
|
240
|
-
to: env.INTAKE_NOTIFY_TO,
|
|
241
|
-
from: env.INTAKE_NOTIFY_FROM,
|
|
242
|
-
subject: `New intake response from ${input.name ?? "website"}`,
|
|
243
|
-
text: `Email: ${input.email ?? ""}`,
|
|
244
|
-
...(input.email ? { replyTo: input.email } : {}),
|
|
245
|
-
});
|
|
246
|
-
return { ok: true };
|
|
247
|
-
}
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
## Turnstile
|
|
251
|
-
|
|
252
|
-
Store the secret with `wrangler secret put TURNSTILE_SECRET_KEY`. Declare the token in the Procedure input, then verify it in a `before_create` lifecycle Trigger that aborts on failure:
|
|
253
|
-
|
|
254
|
-
```yaml
|
|
255
|
-
apiVersion: cms.mantle.aotter.net/v1
|
|
256
|
-
kind: Trigger
|
|
257
|
-
metadata:
|
|
258
|
-
name: intake-before-create-verify-turnstile
|
|
259
|
-
spec:
|
|
260
|
-
source:
|
|
261
|
-
kind: lifecycle
|
|
262
|
-
schema: intake-submissions
|
|
263
|
-
on: [before_create]
|
|
264
|
-
errorPolicy: abort
|
|
265
|
-
target:
|
|
266
|
-
procedure: verify-intake-turnstile
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
The adapter exports a handler factory for the `siteverify` call:
|
|
270
|
-
|
|
271
|
-
```ts
|
|
272
|
-
import { cloudflareTurnstileCheck } from "@aotter/mantle/cloudflare";
|
|
273
|
-
|
|
274
|
-
extend: ({ env }) => ({
|
|
275
|
-
handlers: {
|
|
276
|
-
"verify-intake-turnstile": cloudflareTurnstileCheck({
|
|
277
|
-
secret: env.TURNSTILE_SECRET_KEY ?? "dev-stub",
|
|
278
|
-
tokenField: "turnstileToken",
|
|
279
|
-
}),
|
|
280
|
-
},
|
|
281
|
-
}),
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
Authenticated callers (`ctx.user` set) bypass the check. The literal secret `"dev-stub"` skips the network and rejects only the token `"fail"`. Rejection throws `AUTH_DENIED`, which maps to HTTP `403`. See [Intake Turnstile and email hooks](../../examples/cf-primitives-intake-hooks.md).
|
|
285
|
-
|
|
286
|
-
## Source
|
|
287
|
-
- [`packages/adapters/cloudflare/README.md`](../../../packages/adapters/cloudflare/README.md)
|
|
288
|
-
- [`packages/adapters/cloudflare/src/bindings/conventionalBindings.ts`](../../../packages/adapters/cloudflare/src/bindings/conventionalBindings.ts)
|
|
289
|
-
- [`packages/adapters/cloudflare/src/mount/cmsConfig.ts`](../../../packages/adapters/cloudflare/src/mount/cmsConfig.ts)
|
|
290
|
-
- [`packages/adapters/cloudflare/src/worker/createMantleWorker.ts`](../../../packages/adapters/cloudflare/src/worker/createMantleWorker.ts)
|
|
291
|
-
- [`packages/adapters/cloudflare/src/handlers/turnstile.ts`](../../../packages/adapters/cloudflare/src/handlers/turnstile.ts)
|
|
292
|
-
- [`packages/mantle/src/cli/generate.ts`](../../../packages/mantle/src/cli/generate.ts)
|
|
293
|
-
- [`docs/deferred-lifecycle-queues.md`](../../../docs/deferred-lifecycle-queues.md)
|
|
294
|
-
- [`docs/media-uploads.md`](../../../docs/media-uploads.md)
|
|
295
|
-
- [`docs/performance-harness.md`](../../../docs/performance-harness.md)
|
|
296
|
-
- [`docs/cloudflare-low-level-composition.md`](../../../docs/cloudflare-low-level-composition.md)
|
|
297
|
-
- [`docs/examples/host-local-admin-otp/wrangler.jsonc`](../../../docs/examples/host-local-admin-otp/wrangler.jsonc)
|
|
298
|
-
- [`docs/examples/host-minimal-worker/wrangler.jsonc`](../../../docs/examples/host-minimal-worker/wrangler.jsonc)
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Assemble a Mantle Worker with createMantleWorker, add handlers and routes through extend, and respect Core-owned paths.
|
|
3
|
-
---
|
|
4
|
-
# The conventional Worker
|
|
5
|
-
|
|
6
|
-
`createMantleWorker` is the normal Cloudflare entry for a Mantle application. This page covers its options, what the facade owns, how to add application handlers and routes, and the readiness and reserved-path rules that keep those extensions safe.
|
|
7
|
-
|
|
8
|
-
## Minimal entry
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { createMantleWorker } from "@aotter/mantle/cloudflare";
|
|
12
|
-
import { plan } from "../.mantle/generated/mantle.js";
|
|
13
|
-
|
|
14
|
-
export default createMantleWorker({ plan, cacheScope: "my-site-production" });
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
`plan` is the sealed plan that `mantle generate` writes to `.mantle/generated/mantle.ts`. With only `plan`, the Worker serves public View REST, HTTP Triggers, Admin, Auth, OAuth and MCP. It renders no public pages and `/` is a 404; see [Public web](./public-web.md). Local Admin with email OTP replaces Auth construction; see [Quickstart: local Admin](../start/quickstart-admin.md). Admin still requires the `ASSETS` binding.
|
|
18
|
-
|
|
19
|
-
## Options
|
|
20
|
-
|
|
21
|
-
| Option | Type | Purpose |
|
|
22
|
-
|---|---|---|
|
|
23
|
-
| `plan` | `RuntimePlan` | Required. Generated plan; a fingerprint or version mismatch fails immediately and asks you to regenerate. |
|
|
24
|
-
| `handlers` | `Record<string, AnyHandler>` | Implementations for `handler.kind: ref` Procedures. Merged with `extend().handlers`; a name registered twice throws. |
|
|
25
|
-
| `siteDefaults` | `SiteDefaults \| (env) => SiteDefaults` | Brand, title, description, origin, locales, icons, media purposes. Use the function form to read `env.PUBLIC_ORIGIN`. See [Site config](../reference/site-config.md). |
|
|
26
|
-
| `cacheScope` | `string \| (env) => string` | Stable deployment/site identifier for public cache tags and optional `MANTLE_KV` keys. Lowercase letters, digits, `_` and `-`, up to 64 characters. Shared caching is disabled when absent or invalid. |
|
|
27
|
-
| `templates` | `TemplateRegistry` | Entry and list templates for public HTML. |
|
|
28
|
-
| `publicPathResolver` | `PublicPathResolver` | Collection-to-URL mapping used for canonical URLs, sitemap and hreflang. |
|
|
29
|
-
| `mediaAllowSvg` | `boolean \| (env) => boolean` | Accept SVG uploads. Default `false`. |
|
|
30
|
-
| `auth` | `(env) => Auth` | Replace Auth construction only. Core still owns the Auth routes. |
|
|
31
|
-
| `bindings` | `(env, conventional) => MantleWorkerBindings` | Augment the conventional adapters, for example `mediaStorage` or `deferredHookDispatcher`. |
|
|
32
|
-
| `extend` | `(ctx) => MantleWorkerExtension \| void` | The one seam for handlers, credential resolution, JWT bearer verification and new Hono routes. |
|
|
33
|
-
|
|
34
|
-
`extend` receives `{ env, auth, bindings, getRuntime }` and may return:
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
{
|
|
38
|
-
handlers?: Record<string, AnyHandler>;
|
|
39
|
-
credentialResolver?: ConsumerCredentialResolver; // site-owned API keys and personal tokens
|
|
40
|
-
jwtBearer?: { audience: string; scopes?: readonly string[] };
|
|
41
|
-
mount?: ({ app, ref, env, auth, bindings, getRuntime }) => void;
|
|
42
|
-
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
`extend` may run again after a failed initialization. Keep external side effects out of it.
|
|
46
|
-
|
|
47
|
-
## What the facade owns
|
|
48
|
-
|
|
49
|
-
Once per isolate, `createMantleWorker` assembles and memoizes:
|
|
50
|
-
|
|
51
|
-
- Conventional bindings: `DB` becomes the D1 driver, `ASSETS` serves the Admin bundle, `MANTLE_KV` (when bound) becomes the MCP catalog projection. See [Bindings](./bindings.md).
|
|
52
|
-
- Conventional Auth chosen by `MANTLE_AUTH_MODE`, or your `auth` factory. See [Authentication](./authentication.md).
|
|
53
|
-
- Runtime endpoints: manifest HTTP Triggers, `GET /api/views` and `GET /api/views/<name>` for public Views.
|
|
54
|
-
- Admin at `/admin` when Admin assets are present, OAuth consent and discovery, and MCP at `/mcp` and `/mcp/staff`. The MCP transport is Streamable HTTP, POST-only: no session header, no server-initiated stream (`GET` answers `405`), and `tools/call` answers `401` with an OAuth challenge so a client can authenticate mid-session and retry. Verified against the official TypeScript client SDK `@modelcontextprotocol/client` 2.0.0 in the adapter's conformance test; that pin is the gate when the SDK is upgraded.
|
|
55
|
-
- A `/favicon.ico` route derived from `siteDefaults.icons`. This is a convention, not a reserved path; an existing host route wins.
|
|
56
|
-
- The final cache policy on every response, and best-effort purge of the deployment-scoped public tag after publishing-content and site-setting writes.
|
|
57
|
-
- A redacted error boundary: an unexpected failure returns `500` with `{ "ok": false, "error": "internal_error" }` and `private, no-store`.
|
|
58
|
-
|
|
59
|
-
If `auth.ready` rejects, the memoized assembly is evicted so the next request rebuilds instead of reusing a poisoned isolate.
|
|
60
|
-
|
|
61
|
-
## The returned handler
|
|
62
|
-
|
|
63
|
-
```ts
|
|
64
|
-
const worker = createMantleWorker<Env>({ plan });
|
|
65
|
-
worker.fetch(request, env, ctx); // HTTP entry
|
|
66
|
-
worker.getRuntime(env); // the runtime fetch uses, resolved after auth.ready
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
Queue and scheduled handlers call `worker.getRuntime(env)` and then generated `bindMantle(runtime)` so they reuse the assembled runtime and never write Mantle tables directly. See [Bindings](./bindings.md#cron-triggers) and [Deferred hooks](./deferred-hooks-queues.md).
|
|
70
|
-
|
|
71
|
-
## Readiness rule
|
|
72
|
-
|
|
73
|
-
Standard protected routes establish readiness themselves: the facade awaits `getRuntime()` before Auth, `/oauth`, `/mcp`, `/admin/api` and `/.well-known/oauth*` requests. Extension routes do not. Before an extension route reads or writes Mantle data, or relies on database-backed Auth, it must `await ref.get()` (inside `mount`) or `await getRuntime()`.
|
|
74
|
-
|
|
75
|
-
`getRuntime` rejects when called synchronously inside `extend` before it returns. Retain the function and call it later, for example inside a request handler.
|
|
76
|
-
|
|
77
|
-
## Reserved paths
|
|
78
|
-
|
|
79
|
-
Extensions add routes; they never replace Core surfaces. These registrations are rejected:
|
|
80
|
-
|
|
81
|
-
- `/admin`, `/_mantle`, `/api/auth`, `/api/views`, `/oauth`, `/mcp`, and anything beneath them
|
|
82
|
-
- `/.well-known/oauth*`
|
|
83
|
-
- the custom Auth factory's `basePath`
|
|
84
|
-
- global `*` and `/*` handlers
|
|
85
|
-
- any exact method and path pair that a manifest HTTP Trigger already owns
|
|
86
|
-
|
|
87
|
-
Static literals fail TypeScript during your build (`MantleExtensionPath`). Computed paths cannot be proven statically, so after `mount` returns the facade inspects Hono's assembled route table and throws before serving any request. There is no override option. The `app` passed to `mount` exposes `get`, `post`, `put`, `patch`, `delete`, `options`, `all`, `on`, `use` and `route`; it omits global error and not-found hooks.
|
|
88
|
-
|
|
89
|
-
## Handlers and routes
|
|
90
|
-
|
|
91
|
-
```ts
|
|
92
|
-
import { createMantleWorker, type MantleCloudflareEnv } from "@aotter/mantle/cloudflare";
|
|
93
|
-
import { plan } from "../.mantle/generated/mantle.js";
|
|
94
|
-
import { notifyIntake } from "./handlers/notifyIntake.js";
|
|
95
|
-
|
|
96
|
-
interface Env extends MantleCloudflareEnv {
|
|
97
|
-
readonly PUBLIC_ORIGIN: string;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export default createMantleWorker<Env>({
|
|
101
|
-
plan,
|
|
102
|
-
siteDefaults: (env) => ({
|
|
103
|
-
brand: "Example",
|
|
104
|
-
title: "Example",
|
|
105
|
-
description: "Example site.",
|
|
106
|
-
origin: env.PUBLIC_ORIGIN,
|
|
107
|
-
locales: ["en"],
|
|
108
|
-
icons: [
|
|
109
|
-
{ src: "/site-icon.png", mimeType: "image/png", sizes: ["64x64"] },
|
|
110
|
-
{ src: "/site-icon.svg", mimeType: "image/svg+xml", sizes: ["any"] },
|
|
111
|
-
],
|
|
112
|
-
}),
|
|
113
|
-
extend: () => ({
|
|
114
|
-
handlers: { "notify-intake": notifyIntake },
|
|
115
|
-
mount({ app, ref }) {
|
|
116
|
-
app.get("/api/health", (c) => c.json({ ok: true }));
|
|
117
|
-
app.get("/api/locales", async (c) => {
|
|
118
|
-
const runtime = await ref.get(); // readiness before data
|
|
119
|
-
const site = await runtime.siteConfig.load();
|
|
120
|
-
return c.json({ locales: site.locales });
|
|
121
|
-
});
|
|
122
|
-
},
|
|
123
|
-
}),
|
|
124
|
-
});
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
Handler keys match `spec.handler.ref` in Procedure manifests; see [Procedures and Triggers](../concepts/procedures-and-triggers.md).
|
|
128
|
-
|
|
129
|
-
## A `bindings` hook
|
|
130
|
-
|
|
131
|
-
`bindings` receives the conventional set and returns the set the runtime uses. Spread the conventional bindings, then add capability adapters:
|
|
132
|
-
|
|
133
|
-
```ts
|
|
134
|
-
import {
|
|
135
|
-
createMantleWorker,
|
|
136
|
-
WorkersQueueHookDispatcher,
|
|
137
|
-
} from "@aotter/mantle/cloudflare";
|
|
138
|
-
|
|
139
|
-
export default createMantleWorker<Env>({
|
|
140
|
-
plan,
|
|
141
|
-
bindings: (env, conventional) => ({
|
|
142
|
-
...conventional,
|
|
143
|
-
mediaStorage: buildMediaStorage(env), // see media-r2.md
|
|
144
|
-
deferredHookDispatcher: new WorkersQueueHookDispatcher(env.MANTLE_INTERNAL_QUEUE),
|
|
145
|
-
}),
|
|
146
|
-
});
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
The conventional set is `{ db, adminAssets, mcpCatalogKv? }`. Never drop `db`.
|
|
150
|
-
|
|
151
|
-
## Site identity
|
|
152
|
-
|
|
153
|
-
`siteDefaults.icons` is one identity reused by browser favicons, Admin chrome and MCP `serverInfo.icons`. Keep the SVG as the editable source and add a PNG rendition for MCP clients that need raster formats. Both files live in `public/`.
|
|
154
|
-
|
|
155
|
-
## Source
|
|
156
|
-
- [`packages/mantle/README.md`](../../../packages/mantle/README.md)
|
|
157
|
-
- [`packages/adapters/cloudflare/README.md`](../../../packages/adapters/cloudflare/README.md)
|
|
158
|
-
- [`packages/adapters/cloudflare/src/worker/createMantleWorker.ts`](../../../packages/adapters/cloudflare/src/worker/createMantleWorker.ts)
|
|
159
|
-
- [`packages/adapters/cloudflare/src/bindings/conventionalBindings.ts`](../../../packages/adapters/cloudflare/src/bindings/conventionalBindings.ts)
|
|
160
|
-
- [`packages/adapters/cloudflare/src/mount/cmsConfig.ts`](../../../packages/adapters/cloudflare/src/mount/cmsConfig.ts)
|
|
161
|
-
- [`docs/examples/host-local-admin-otp/src/index.ts`](../../../docs/examples/host-local-admin-otp/src/index.ts)
|
|
162
|
-
- [`docs/examples/host-minimal-worker/src/index.ts`](../../../docs/examples/host-minimal-worker/src/index.ts)
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Move after_* lifecycle Triggers onto Cloudflare Queues with at-least-once delivery, idempotent handlers and a DLQ.
|
|
3
|
-
---
|
|
4
|
-
# Deferred hooks with Queues
|
|
5
|
-
|
|
6
|
-
`after_create`, `after_update`, `after_delete` and `after_publish` lifecycle Triggers run inline by default. Binding a Cloudflare Queue moves them off the request path. This page covers the guarantees, the setup, the Worker wiring and how to write handlers that survive replay.
|
|
7
|
-
|
|
8
|
-
## When to defer
|
|
9
|
-
|
|
10
|
-
Defer hooks that must not add request latency and that tolerate a short delay: notifications, projections, upstream API calls. Keep synchronous `before_*` hooks for validation and abuse prevention; they may read request-only input such as a CAPTCHA token, which deferred envelopes never retain.
|
|
11
|
-
|
|
12
|
-
## Guarantees
|
|
13
|
-
|
|
14
|
-
- The entry write commits first. D1 and the Queue do not share a transaction, so a Worker failure between them can lose the enqueue.
|
|
15
|
-
- Delivery is at-least-once. A message can run more than once.
|
|
16
|
-
- A rejected or ambiguous `Queue.send()` falls back to `ctx.waitUntil` (or inline when unavailable) with the same event identity. That fallback is best-effort.
|
|
17
|
-
- A consumer runs every captured Trigger before acknowledging; a later failure can replay an earlier success.
|
|
18
|
-
- Malformed, oversized, removed-Trigger and persistently failing messages are retried and then land in the dead-letter queue. Without a DLQ, Cloudflare discards them after `max_retries`.
|
|
19
|
-
|
|
20
|
-
Handlers must therefore be idempotent. Mantle does not promise exactly-once execution.
|
|
21
|
-
|
|
22
|
-
## The v1 envelope
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
interface DeferredHookEnvelope {
|
|
26
|
-
version: 1;
|
|
27
|
-
eventId: string;
|
|
28
|
-
triggerNames: readonly string[];
|
|
29
|
-
hook: "after_create" | "after_update" | "after_delete" | "after_publish";
|
|
30
|
-
schema: string;
|
|
31
|
-
entry: EntryRow;
|
|
32
|
-
ctxSnapshot: CtxSnapshot | null;
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Each handler receives the persisted `entry.data` as input and `ctx.event = { id, trigger, hook, schema, entry }`. Use `${ctx.event.id}:${ctx.event.trigger}` as the idempotency key; it is stable across fallback, retries and replay. `ctxSnapshot` holds normalized actor and credential metadata, never cookies, tokens or API keys.
|
|
37
|
-
|
|
38
|
-
Cloudflare's 128 KB message limit is decimal and includes platform metadata. The dispatcher rejects non-JSON-safe envelopes and any encoded envelope of 127,000 bytes or more before calling `Queue.send`. Keep entry payloads well below that.
|
|
39
|
-
|
|
40
|
-
## Setup
|
|
41
|
-
|
|
42
|
-
```sh
|
|
43
|
-
pnpm wrangler queues create mantle-internal
|
|
44
|
-
pnpm wrangler queues create mantle-internal-dlq
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
```jsonc
|
|
48
|
-
"queues": {
|
|
49
|
-
"producers": [{ "binding": "MANTLE_INTERNAL_QUEUE", "queue": "mantle-internal" }],
|
|
50
|
-
"consumers": [{
|
|
51
|
-
"queue": "mantle-internal",
|
|
52
|
-
"max_batch_size": 10,
|
|
53
|
-
"max_batch_timeout": 5,
|
|
54
|
-
"max_retries": 5,
|
|
55
|
-
"retry_delay": 60,
|
|
56
|
-
"dead_letter_queue": "mantle-internal-dlq"
|
|
57
|
-
}]
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
These are adapter settings, not manifest grammar. See [Trigger](../reference/trigger.md) for the `lifecycle` source shape.
|
|
62
|
-
|
|
63
|
-
## Worker wiring
|
|
64
|
-
|
|
65
|
-
```ts
|
|
66
|
-
import type { DeferredHookEnvelope } from "@aotter/mantle/runtime";
|
|
67
|
-
import {
|
|
68
|
-
WorkersQueueHookDispatcher,
|
|
69
|
-
createMantleWorker,
|
|
70
|
-
createQueueHandler,
|
|
71
|
-
type MantleCloudflareEnv,
|
|
72
|
-
} from "@aotter/mantle/cloudflare";
|
|
73
|
-
import { plan } from "../.mantle/generated/mantle.js";
|
|
74
|
-
|
|
75
|
-
interface Env extends MantleCloudflareEnv {
|
|
76
|
-
readonly MANTLE_INTERNAL_QUEUE: Queue<DeferredHookEnvelope>;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const worker = createMantleWorker<Env>({
|
|
80
|
-
plan,
|
|
81
|
-
handlers,
|
|
82
|
-
bindings: (env, conventional) => ({
|
|
83
|
-
...conventional,
|
|
84
|
-
deferredHookDispatcher: new WorkersQueueHookDispatcher(env.MANTLE_INTERNAL_QUEUE),
|
|
85
|
-
}),
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
export default {
|
|
89
|
-
fetch: worker.fetch,
|
|
90
|
-
queue(batch, env) {
|
|
91
|
-
return createQueueHandler<Env>({ get: () => worker.getRuntime(env) })(batch, env);
|
|
92
|
-
},
|
|
93
|
-
} satisfies ExportedHandler<Env>;
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
The same Worker is producer and consumer. Opt-in adds only the dispatcher binding and the `queue` export; Auth, MCP, cache and runtime assembly stay on the standard path.
|
|
97
|
-
|
|
98
|
-
## Multiplexing application queues
|
|
99
|
-
|
|
100
|
-
Route on `batch.queue` when the Worker also consumes its own queues:
|
|
101
|
-
|
|
102
|
-
```ts
|
|
103
|
-
queue(batch, env, ctx) {
|
|
104
|
-
const mantleQueue = createQueueHandler<Env>({ get: () => worker.getRuntime(env) });
|
|
105
|
-
switch (batch.queue) {
|
|
106
|
-
case "mantle-internal": return mantleQueue(batch, env);
|
|
107
|
-
case "billing-jobs": return consumeBilling(batch, env, ctx);
|
|
108
|
-
default:
|
|
109
|
-
batch.retryAll();
|
|
110
|
-
console.error(`No consumer for queue '${batch.queue}'`);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Application consumers own their own acknowledgement. A common pattern is to `bindMantle(await worker.getRuntime(env))` and call a Procedure, then `ack()` on success, `retry()` on `INTERNAL_ERROR` or `CONFLICT`, and `ack()` on other diagnostics so a poison message does not loop. See [Bindings](./bindings.md#queues).
|
|
116
|
-
|
|
117
|
-
## Consumer semantics
|
|
118
|
-
|
|
119
|
-
- At most five messages run concurrently within a delivered batch, even if `max_batch_size` is higher.
|
|
120
|
-
- Runtime boot failure calls `batch.retryAll()` so per-message attempt counters advance and `max_retries` and the DLQ apply.
|
|
121
|
-
- Each message is acknowledged exactly once after every captured Trigger succeeds; any failure calls `retry()` on that message only.
|
|
122
|
-
|
|
123
|
-
## An idempotent D1 handler
|
|
124
|
-
|
|
125
|
-
Make the event key a unique database key:
|
|
126
|
-
|
|
127
|
-
```sql
|
|
128
|
-
CREATE TABLE notification_jobs (
|
|
129
|
-
idempotency_key TEXT PRIMARY KEY,
|
|
130
|
-
entry_id TEXT NOT NULL,
|
|
131
|
-
payload TEXT NOT NULL,
|
|
132
|
-
created_at INTEGER NOT NULL
|
|
133
|
-
);
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
```ts
|
|
137
|
-
import type { HandlerContext } from "@aotter/mantle/runtime";
|
|
138
|
-
|
|
139
|
-
export async function enqueueNotification(input: Record<string, unknown>, ctx: HandlerContext) {
|
|
140
|
-
if (!ctx.event?.entry) throw new Error("lifecycle entry event required");
|
|
141
|
-
const key = `${ctx.event.id}:${ctx.event.trigger}`;
|
|
142
|
-
await (ctx.env as Env).DB.prepare(
|
|
143
|
-
`INSERT OR IGNORE INTO notification_jobs (idempotency_key, entry_id, payload, created_at)
|
|
144
|
-
VALUES (?, ?, ?, ?)`,
|
|
145
|
-
).bind(key, ctx.event.entry.id, JSON.stringify(input), Date.now()).run();
|
|
146
|
-
return { ok: true };
|
|
147
|
-
}
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
For an upstream API, send the same key as `Idempotency-Key` and throw on a non-OK response so the Queue retries. Core adds no outbox, job registry or provider retry wrapper; those remain application-owned.
|
|
151
|
-
|
|
152
|
-
## The removed-Trigger footgun
|
|
153
|
-
|
|
154
|
-
`triggerNames` is captured when the mutation runs. Renaming or removing a captured Trigger makes every older message fail validation at dispatch and eventually reach the DLQ; it never silently changes meaning. Drain the queue before removing a deferred Trigger, and inspect the DLQ before raising `max_retries`.
|
|
155
|
-
|
|
156
|
-
## Verify
|
|
157
|
-
|
|
158
|
-
In the SDK checkout the contract test is:
|
|
159
|
-
|
|
160
|
-
```sh
|
|
161
|
-
pnpm --filter @aotter/mantle-cloudflare test -- mantle-internal-queue.test.ts
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
For a site, run `wrangler dev`, submit a mutation that has an `after_*` Trigger, and read the consumer log. Make one handler fail once and confirm the replay carries the same `ctx.event.id` and `ctx.event.trigger`.
|
|
165
|
-
|
|
166
|
-
## Source
|
|
167
|
-
- [`docs/deferred-lifecycle-queues.md`](../../../docs/deferred-lifecycle-queues.md)
|
|
168
|
-
- [`packages/adapters/cloudflare/src/bindings/WorkersQueueHookDispatcher.ts`](../../../packages/adapters/cloudflare/src/bindings/WorkersQueueHookDispatcher.ts)
|
|
169
|
-
- [`packages/adapters/cloudflare/src/mount/cmsConfig.ts`](../../../packages/adapters/cloudflare/src/mount/cmsConfig.ts)
|
|
170
|
-
- [`packages/adapters/cloudflare/README.md`](../../../packages/adapters/cloudflare/README.md)
|