@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
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: The generated src/service.ts and src/index.ts of a Mantle 0.2.0 Cloudflare service — how the surfaces are mounted, and how to add your own routes, bindings and scheduled work.
|
|
3
|
+
---
|
|
4
|
+
# The service and its entry
|
|
5
|
+
|
|
6
|
+
On host `cloudflare`, `mantle generate` writes two files once, then they are
|
|
7
|
+
yours (host `bun` writes a `Bun.serve` entry instead, ADR-0038):
|
|
8
|
+
|
|
9
|
+
- `src/service.ts` composes the service: storage, identity, surfaces, and the
|
|
10
|
+
`mantle` object from `createMantle`;
|
|
11
|
+
- `src/index.ts` is the Cloudflare entry: `fetch` and `scheduled`.
|
|
12
|
+
|
|
13
|
+
Mantle owns no route of its own. What is mounted, and where, is this code.
|
|
14
|
+
|
|
15
|
+
## `src/service.ts`
|
|
16
|
+
|
|
17
|
+
With identity `mantle` and every feature (the
|
|
18
|
+
[reference service](../../examples/reference-service/src/service.ts) is this
|
|
19
|
+
file, unchanged):
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
function mount(runtime: MantleRuntime, env: Env) {
|
|
23
|
+
const auth = createAuth(env, origin); // createMantleAuth, or a setup-incomplete stub
|
|
24
|
+
const resolver = createCallerResolver(auth, { jwtBearer: { audience: `${origin}/mcp`, scopes: ["mcp"] } });
|
|
25
|
+
const authRoutes = createAuthRoutes(auth, { resolver });
|
|
26
|
+
const guard = (surface, options?) => withCaller(resolver, surface, options);
|
|
27
|
+
const admin = guard(createAdminSurface(runtime, { basePath: "/admin", assets: (path) => adminAsset(env.ASSETS, path), identity: { … }, site: { mcpEndpoints: { public: "/mcp", staff: "/mcp/staff" } } }));
|
|
28
|
+
const mcp = guard(createMcpSurface(runtime, { basePath: "/mcp", surface: "public", resourceMetadata }), { resourceMetadata });
|
|
29
|
+
// MCP Apps hosts render each staff View's rows, and the operations on one row, in the chat
|
|
30
|
+
const staffMcp = guard(createMcpSurface(runtime, { basePath: "/mcp/staff", surface: "staff", apps: { resources: [planApp(runtime.plan, { surface: "staff", html: mantleAppHtml })] }, resourceMetadata }), { resourceMetadata });
|
|
31
|
+
const rest = guard(createRestSurface(runtime, { basePath: "/api" }));
|
|
32
|
+
return async (request, waitUntil) => {
|
|
33
|
+
const owned = await authRoutes(request, { waitUntil });
|
|
34
|
+
if (owned) return owned;
|
|
35
|
+
if (under("/admin")) return admin(request);
|
|
36
|
+
if (under("/mcp/staff")) return staffMcp(request);
|
|
37
|
+
if (under("/mcp")) return mcp(request);
|
|
38
|
+
return rest(request);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const service: MantleService<Env> = {
|
|
43
|
+
handlers,
|
|
44
|
+
fetch: (request, env, { runtime, waitUntil }) => (routes ??= mount(runtime, env))(request, waitUntil),
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const mantle = createMantle(service, { plan, storage: (env) => d1Storage(env.DB), schedules: true });
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
- `Env` lists the bindings and vars the service reads. Add yours there.
|
|
51
|
+
- The surfaces are built once per isolate, on the first request.
|
|
52
|
+
- With identity `custom` the resolver is your `src/identity.ts`; with `none`
|
|
53
|
+
every surface gets `{ kind: "anonymous" }` and no auth routes are mounted.
|
|
54
|
+
|
|
55
|
+
## Add your own routes
|
|
56
|
+
|
|
57
|
+
Put them in the function `mount` returns, where they belong in the order:
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
return async (request, waitUntil) => {
|
|
61
|
+
const { pathname } = new URL(request.url);
|
|
62
|
+
await auth.ready?.catch((error) => { routes = undefined; throw error; }); // first, before any route answers
|
|
63
|
+
if (pathname === "/healthz") return new Response("ok"); // no caller
|
|
64
|
+
if (pathname === "/payments/callback") return handleCallback(request, runtime, env);
|
|
65
|
+
const owned = await authRoutes(request, { waitUntil });
|
|
66
|
+
if (owned) return owned;
|
|
67
|
+
…
|
|
68
|
+
};
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
- With identity `mantle`, keep `await auth.ready` above every route. `mount`
|
|
72
|
+
starts Better Auth inside an isolate's first request, and Workers cancels I/O
|
|
73
|
+
that a finished request started: a route that answers that first request
|
|
74
|
+
before `auth.ready` settles leaves the context pending for ever, and every
|
|
75
|
+
later request waits on it (under `wrangler dev` too). The wait costs only the
|
|
76
|
+
isolate's first request.
|
|
77
|
+
|
|
78
|
+
- A route that acts for a caller resolves it the same way:
|
|
79
|
+
`withCaller(resolver, (request, caller) => …)` gives you the caller, the 401
|
|
80
|
+
for a bad credential, and the cross-origin check.
|
|
81
|
+
- Reach data through `runtime.store.as(caller)` or
|
|
82
|
+
`runtime.invokeProcedure({ procedure, input, caller, cause: { kind: "internal", id } })`;
|
|
83
|
+
`runtime.store` alone is unscoped, for trusted code only.
|
|
84
|
+
- Server-rendered pages, a SPA's assets, a signed webhook: all are routes
|
|
85
|
+
here. Mantle renders no public pages in 0.2.0.
|
|
86
|
+
|
|
87
|
+
## `src/index.ts`
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
export default {
|
|
91
|
+
fetch: (request, env) => mantle.fetch(request, env, ctx),
|
|
92
|
+
async scheduled(controller, env) { … mantle.invokeSchedule(cron, controller.scheduledTime, env, ctx) … },
|
|
93
|
+
} satisfies ExportedHandler<Env>;
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
- `ctx` is `{ waitUntil }` from `cloudflare:workers`, which is not bound to one
|
|
97
|
+
request, so a handler's `ctx.waitUntil` never lands on a finished request.
|
|
98
|
+
- Manifest crons are POSIX; Cloudflare names a cron as `wrangler.jsonc` spells
|
|
99
|
+
it. The entry maps each Cloudflare cron back to every POSIX expression that
|
|
100
|
+
shares it, runs them all, and reports every failure together. A cron no
|
|
101
|
+
Trigger maps to throws.
|
|
102
|
+
- There is no `queue` handler: no Mantle path produces queue messages. Add
|
|
103
|
+
your own `queue` beside `fetch` if your service uses one.
|
|
104
|
+
|
|
105
|
+
## Bindings
|
|
106
|
+
|
|
107
|
+
`wrangler.jsonc` starts with `DB` (D1), or with dialect `postgres` a
|
|
108
|
+
`HYPERDRIVE` binding whose `id` is a placeholder until
|
|
109
|
+
`wrangler hyperdrive create <name> --caching-disabled --connection-string=…`
|
|
110
|
+
gives one, `triggers.crons`, and with feature `admin` the console's files:
|
|
111
|
+
|
|
112
|
+
```jsonc
|
|
113
|
+
"assets": { "directory": "node_modules/@aotter/mantle-ui/dist/admin", "binding": "ASSETS", "run_worker_first": true, "html_handling": "none" }
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`run_worker_first` sends every request through the Worker, so Admin answers
|
|
117
|
+
every `/admin` path and nothing is served at the files' bare paths; keep it
|
|
118
|
+
when you add assets of your own (serve those through the same binding or a
|
|
119
|
+
route). `mantle generate` warns when `admin` is selected and no `ASSETS` is
|
|
120
|
+
bound. Add the rest:
|
|
121
|
+
|
|
122
|
+
| Need | `wrangler.jsonc` | Code |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| Media | `r2_buckets: [{ binding: "MEDIA", bucket_name: … }]` | [Media uploads with R2](./media-r2.md) |
|
|
125
|
+
| A secret | `wrangler secret put NAME` (`.dev.vars` locally) | `env.NAME` |
|
|
126
|
+
| A plain var | `vars: { NAME: "…" }` | `env.NAME` |
|
|
127
|
+
| Email | `send_email: [{ name: "EMAIL" }]` | your `EmailSender` for sign-in, or a handler's `ctx.env.EMAIL` |
|
|
128
|
+
| KV, Queues, Durable Objects | their usual keys | your own code; Mantle reads none of them |
|
|
129
|
+
|
|
130
|
+
Handlers receive the same `env` as `ctx.env`. Mantle-owned rows are reached
|
|
131
|
+
only through Store; never write a Schema's table with `env.DB` directly. Your
|
|
132
|
+
own tables in the same database are yours.
|
|
133
|
+
|
|
134
|
+
## When the preset changes
|
|
135
|
+
|
|
136
|
+
The preset is never rewritten. After an SDK upgrade, compare your files with
|
|
137
|
+
a fresh preset: generate into an empty directory with the same manifests and
|
|
138
|
+
`mantle.config.json`, and diff `src/service.ts` and `src/index.ts`.
|
|
@@ -1,116 +1,126 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: The Caller, the one CallerResolver at the service entry, requires predicates, guards, Schema scope and auth.uid(), and how staff roles fit.
|
|
3
3
|
---
|
|
4
4
|
# Authorization
|
|
5
5
|
|
|
6
|
-
Mantle
|
|
6
|
+
Mantle never owns your users. The service resolves who is calling once per
|
|
7
|
+
request, and Mantle enforces the manifests against that answer.
|
|
7
8
|
|
|
8
|
-
## The
|
|
9
|
-
|
|
10
|
-
Every protected invocation runs the same five steps:
|
|
11
|
-
|
|
12
|
-
1. Verify and normalize the transport credential.
|
|
13
|
-
2. Evaluate the static predicates in `requires.auth.all`, before any input-schema detail is exposed.
|
|
14
|
-
3. Validate and coerce the target input, or the View params.
|
|
15
|
-
4. Invoke the guard Procedure with that validated value and the same context.
|
|
16
|
-
5. Invoke the target only after the guard succeeds.
|
|
17
|
-
|
|
18
|
-
Static predicates run before validation so an unauthorized caller cannot probe a schema by reading its error messages. The guard runs after validation so it can decide on the actual arguments. Every stage fails closed.
|
|
19
|
-
|
|
20
|
-
## Identity kinds
|
|
21
|
-
|
|
22
|
-
The adapter verifies the transport, then hands the runtime normalized, non-secret metadata. Handlers see this and nothing else:
|
|
9
|
+
## The Caller
|
|
23
10
|
|
|
24
11
|
```ts
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
readonly clientId: string | null;
|
|
32
|
-
readonly scopes: readonly string[];
|
|
33
|
-
};
|
|
34
|
-
}
|
|
12
|
+
type Caller =
|
|
13
|
+
| { kind: "anonymous" }
|
|
14
|
+
| { kind: "user"; subject: string; issuer?: string; role: "owner" | "editor" | "contributor" | null;
|
|
15
|
+
scopes: readonly string[]; credential: "session" | "oauth" | "api-key" | "personal-token";
|
|
16
|
+
credentialId: string | null; clientId: string | null }
|
|
17
|
+
| { kind: "system"; reason: string };
|
|
35
18
|
```
|
|
36
19
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
20
|
+
- `subject` is the application's subject key: opaque, stable, unique across
|
|
21
|
+
every issuer, never an email. `auth.uid()`, a scope field and `author_id`
|
|
22
|
+
store it. A resolver over several identity providers namespaces it
|
|
23
|
+
(`chatgpt:<sub>`, `account:<id>`).
|
|
24
|
+
- `role` is a staff role or `null`. Admin's vocabulary is `owner`, `editor`,
|
|
25
|
+
`contributor`; a resolver maps its own roles onto it, or leaves `null` and
|
|
26
|
+
uses scopes and guards.
|
|
27
|
+
- The `system` caller comes only from host code (`systemCaller(reason)`):
|
|
28
|
+
schedules, maintenance, a verified webhook. No request can produce one.
|
|
42
29
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
## Predicates versus the guard
|
|
46
|
-
|
|
47
|
-
| | Static predicates | Guard Procedure |
|
|
48
|
-
|---|---|---|
|
|
49
|
-
| Declared as | `requires.auth.all` | `requires.guard.procedure` |
|
|
50
|
-
| Answers | Is this caller of the right kind, with the right role and scopes? | Is this verified caller allowed to do this business action right now? |
|
|
51
|
-
| Evaluated | Before input validation | After input validation, on every call, never cached |
|
|
52
|
-
| Reads | The compiled plan only | Your tables, your provider state, `ctx.env` |
|
|
53
|
-
| Typical failure | `401` or `403` | `402` |
|
|
54
|
-
|
|
55
|
-
Anything that changes independently of the credential belongs in the guard: payment state, subscription or membership status, seat counts, per-tenant entitlement. A key stays valid while a subscription lapses, so the fact that a caller paid is not something a token can carry. The guard is an ordinary unguarded `handler.kind: ref` Procedure — not a fifth atom — and it throws a structured diagnostic to deny:
|
|
30
|
+
## One boundary: `CallerResolver` and `withCaller`
|
|
56
31
|
|
|
57
32
|
```ts
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
code: "ENTITLEMENT_REQUIRED",
|
|
61
|
-
severity: "error",
|
|
62
|
-
path: `site:membership/${ctx.user!.id}`,
|
|
63
|
-
message: "Active membership is required.",
|
|
64
|
-
}),
|
|
65
|
-
);
|
|
33
|
+
type CallerResolver = (request: Request) =>
|
|
34
|
+
Promise<{ caller: Caller } | { invalid: true; challenge?: string; status?: 401 | 403 }>;
|
|
66
35
|
```
|
|
67
36
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
37
|
+
The generated `src/service.ts` wraps every surface in
|
|
38
|
+
`withCaller(resolver, surface)`:
|
|
39
|
+
|
|
40
|
+
- A credential that was presented but fails is answered 401 before any
|
|
41
|
+
surface runs. It is never treated as anonymous; only "no credential" is.
|
|
42
|
+
- A cookie session may not mutate across origins: a non-GET request with a
|
|
43
|
+
session needs a same-origin `Origin` or `Sec-Fetch-Site`, or it is 403.
|
|
44
|
+
- Identity `mantle` resolves Better Auth sessions and OAuth bearer tokens;
|
|
45
|
+
identity `custom` is your `src/identity.ts`; identity `none` passes
|
|
46
|
+
`{ kind: "anonymous" }`. See [Authentication](../cloudflare/authentication.md).
|
|
47
|
+
|
|
48
|
+
## `requires`
|
|
49
|
+
|
|
50
|
+
Views and Procedures take the same block:
|
|
51
|
+
|
|
52
|
+
```yaml
|
|
53
|
+
requires:
|
|
54
|
+
auth:
|
|
55
|
+
all:
|
|
56
|
+
- ctx.user
|
|
57
|
+
- { ctx.staff: [owner, editor] }
|
|
58
|
+
- { ctx.auth.scope: "exports:read" }
|
|
59
|
+
guard: { procedure: require-active-plan }
|
|
60
|
+
```
|
|
89
61
|
|
|
90
|
-
|
|
|
62
|
+
| Predicate | Holds when |
|
|
91
63
|
|---|---|
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
|
|
96
|
-
|
|
64
|
+
| `ctx.user` | the caller is a `user` |
|
|
65
|
+
| `ctx.auth` | the caller is a `user` (any verified credential) |
|
|
66
|
+
| `{ ctx.staff: [roles] }` | the caller's `role` is one of them |
|
|
67
|
+
| `{ ctx.auth.scope: "<scope>" }` | the caller's `scopes` include it; repeat for several |
|
|
68
|
+
|
|
69
|
+
Every predicate in `all` must hold. A system or anonymous caller satisfies
|
|
70
|
+
none. A failure is 401 `UNAUTHENTICATED` for an anonymous caller and 403
|
|
71
|
+
`AUTH_DENIED` for a signed-in one. The optional guard is a `ref` Procedure
|
|
72
|
+
that runs next and may reject with any code, for example
|
|
73
|
+
`ENTITLEMENT_REQUIRED` (402).
|
|
74
|
+
|
|
75
|
+
`requires` is checked on every path: REST, MCP, Admin operations,
|
|
76
|
+
`ctx.invoke` and `runtime.invokeProcedure`. Listing a tool is not permission
|
|
77
|
+
to call it.
|
|
78
|
+
|
|
79
|
+
## Rows: scope and `auth.uid()`
|
|
80
|
+
|
|
81
|
+
`requires` decides whether a caller may run a View or Procedure. Which
|
|
82
|
+
**rows** it reaches is decided in the data:
|
|
83
|
+
|
|
84
|
+
**Scope** hides rows from everyone but their owner:
|
|
85
|
+
|
|
86
|
+
```yaml
|
|
87
|
+
kind: Schema
|
|
88
|
+
metadata: { name: orders }
|
|
89
|
+
spec:
|
|
90
|
+
scope: { owner: auth.uid() }
|
|
91
|
+
indexes: [[owner]]
|
|
92
|
+
schema:
|
|
93
|
+
required: [owner, …]
|
|
94
|
+
```
|
|
97
95
|
|
|
98
|
-
|
|
96
|
+
- The scope field is a required string, the first column of an index, and the
|
|
97
|
+
first column of every `uniqueIndexes` entry.
|
|
98
|
+
- Every read and write of a user caller is limited to rows whose `owner` is its
|
|
99
|
+
subject key; an anonymous caller reaches none. Store fills `owner` on insert,
|
|
100
|
+
and no write may set it, so a row can never move to another owner.
|
|
101
|
+
- Staff are user callers too: scope hides other users' rows from them as
|
|
102
|
+
well. Use scope only for rows that no one but the owner may ever see.
|
|
103
|
+
- `runtime.store` and the system caller are not scoped.
|
|
104
|
+
|
|
105
|
+
**`auth.uid()` in SQL** covers the rest. When staff must see every row but a
|
|
106
|
+
member sees only their own, store the writer and filter on it:
|
|
107
|
+
|
|
108
|
+
```sql
|
|
109
|
+
INSERT INTO requisitions (requestedBy, item) VALUES (auth.uid(), input.item);
|
|
110
|
+
SELECT … FROM requisitions WHERE requestedBy = auth.uid();
|
|
111
|
+
```
|
|
99
112
|
|
|
100
|
-
|
|
113
|
+
The writer comes from the caller, never from an input. See
|
|
114
|
+
[Procurement approvals](../../examples/procurement.md).
|
|
101
115
|
|
|
102
|
-
|
|
116
|
+
## Admin
|
|
103
117
|
|
|
104
|
-
|
|
118
|
+
Admin's gate admits any staff role, and each Admin route names the least role
|
|
119
|
+
it needs. Admin reads and writes through `runtime.store.as(caller)`, so scope
|
|
120
|
+
and `requires` apply to staff exactly as to anyone. See
|
|
121
|
+
[Customize Admin](../guides/admin-ui.md).
|
|
105
122
|
|
|
106
|
-
|
|
107
|
-
- [Guarded API access](../../examples/cf-primitives-guarded-api.md) — a full resolver, guards and the REST/MCP outcome tables.
|
|
108
|
-
- [Reads: Views, REST and MCP](./views.md) — the `$ctx.user` identity-View sentinel.
|
|
109
|
-
- [Authentication](../cloudflare/authentication.md) — sessions, first owner, role management routes.
|
|
123
|
+
## Further reading
|
|
110
124
|
|
|
111
|
-
|
|
112
|
-
- [
|
|
113
|
-
- [`packages/mantle-runtime/src/domain/model/HandlerContext.ts`](../../../packages/mantle-runtime/src/domain/model/HandlerContext.ts)
|
|
114
|
-
- [`packages/mantle-runtime/src/usecase/procedure/InvokeProcedureUseCase.ts`](../../../packages/mantle-runtime/src/usecase/procedure/InvokeProcedureUseCase.ts)
|
|
115
|
-
- [`packages/adapters/cloudflare/src/mount/resolveCaller.ts`](../../../packages/adapters/cloudflare/src/mount/resolveCaller.ts)
|
|
116
|
-
- [`packages/mantle-spec/src/domain/service/StaffRoleHierarchy.ts`](../../../packages/mantle-spec/src/domain/service/StaffRoleHierarchy.ts)
|
|
125
|
+
- [Authorization reference](../reference/authorization.md)
|
|
126
|
+
- [Guarded API access](../../examples/guarded-api.md)
|
|
@@ -1,173 +1,97 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Schema, View, Procedure
|
|
2
|
+
description: The four manifest atoms of Mantle 0.2.0 (Schema, View, Procedure, Trigger), what each compiles to, and how they reference each other.
|
|
3
3
|
---
|
|
4
4
|
# The four atoms
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
## The four kinds
|
|
9
|
-
|
|
10
|
-
They map one-to-one onto the primitives Postgres has shipped for thirty years.
|
|
11
|
-
|
|
12
|
-
| Atom | Postgres equivalent | Externally exposed by itself? | Has user code? |
|
|
13
|
-
|---|---|---|---|
|
|
14
|
-
| `Schema` | `CREATE TABLE` | No. Reached only through a View or a Procedure. | No |
|
|
15
|
-
| `View` | `CREATE VIEW` | Yes. Auto-mounted on its declared `public` or `staff` REST and MCP surface. | No |
|
|
16
|
-
| `Procedure` | `CREATE FUNCTION` | No. Transport-agnostic; needs a Trigger to gain a surface. | Yes — a handler in your project's registry. |
|
|
17
|
-
| `Trigger` | `CREATE TRIGGER` plus route and tool binding | Yes. It is the binding atom. | No |
|
|
18
|
-
|
|
19
|
-
A four-word gloss covers most questions: Schema is state, View is the read API, Procedure is the write API, Trigger is the binding.
|
|
20
|
-
|
|
21
|
-
## Reads and writes are asymmetric on purpose
|
|
22
|
-
|
|
23
|
-
Views mount themselves; Procedures do not. That asymmetry matches HTTP safe-versus-unsafe semantics. A View is a named, read-only query: idempotent, cacheable, and safe to expose the moment its `surface` is declared. A Procedure changes state, so its path, method, tool name and authorization are decisions an author must make explicitly, one Trigger at a time. There is no `Schema.spec.expose.rest` switch and no `/api/<collection>` shortcut; exposing collections directly was considered and rejected, because a Schema stores drafts, server-stamped fields and rows the author never meant to publish.
|
|
24
|
-
|
|
25
|
-
The consequence for authors: a Procedure that has no Trigger is unreachable from outside the runtime, and calling its name as a URL returns `404`.
|
|
26
|
-
|
|
27
|
-
## The composition rule
|
|
28
|
-
|
|
29
|
-
Anything more domain-shaped than these four is not an atom. A Form, Membership, Email, Webhook, Workflow or ScheduledJob is a composition of Schemas, Views, Procedures and Triggers plus your own TypeScript. A fifth kind would recreate the same overlap: authors would have to decide whether a contact form was a Form, a Workflow or an Email.
|
|
30
|
-
|
|
31
|
-
If you find yourself wanting another kind, sketch the same thing as a composition of the four first. Almost always it works.
|
|
32
|
-
|
|
33
|
-
## The Manifest envelope
|
|
34
|
-
|
|
35
|
-
Every document carries the same four top-level keys. Unknown keys at any known level are rejected with `INVALID_MANIFEST_ENVELOPE`.
|
|
6
|
+
Every manifest document is one atom:
|
|
36
7
|
|
|
37
8
|
```yaml
|
|
38
|
-
apiVersion: cms.mantle.aotter.net/
|
|
9
|
+
apiVersion: cms.mantle.aotter.net/v2
|
|
39
10
|
kind: Schema | View | Procedure | Trigger
|
|
40
|
-
metadata:
|
|
41
|
-
|
|
42
|
-
spec: {}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
There is no `namespace` field. Names are unique within a kind, so a Schema and a View may share a name; two Schemas may not. Multi-tenancy belongs in your application layer, not in manifest metadata.
|
|
46
|
-
|
|
47
|
-
One feature usually needs several atoms, so YAML's `---` separator keeps the file count down. Core reads every immediate `.yaml` and `.yml` file in the manifest directory and parses each document independently:
|
|
48
|
-
|
|
49
|
-
```yaml
|
|
50
|
-
# manifests/contact.yaml
|
|
51
|
-
apiVersion: cms.mantle.aotter.net/v1
|
|
52
|
-
kind: Procedure
|
|
53
|
-
metadata:
|
|
54
|
-
name: send-contact-message
|
|
55
|
-
spec:
|
|
56
|
-
input:
|
|
57
|
-
type: object
|
|
58
|
-
additionalProperties: false
|
|
59
|
-
required: [name, message]
|
|
60
|
-
properties:
|
|
61
|
-
name: { type: string, minLength: 1, maxLength: 80 }
|
|
62
|
-
message: { type: string, minLength: 1, maxLength: 4000 }
|
|
63
|
-
output: { type: object }
|
|
64
|
-
handler: { kind: ref, ref: send-contact-message }
|
|
65
|
-
---
|
|
66
|
-
apiVersion: cms.mantle.aotter.net/v1
|
|
67
|
-
kind: Trigger
|
|
68
|
-
metadata:
|
|
69
|
-
name: contact-http
|
|
70
|
-
spec:
|
|
71
|
-
source: { kind: http, method: POST, path: /api/contact }
|
|
72
|
-
target: { procedure: send-contact-message }
|
|
11
|
+
metadata: { name: <name> }
|
|
12
|
+
spec: { … }
|
|
73
13
|
```
|
|
74
14
|
|
|
75
|
-
|
|
15
|
+
| Atom | Declares | Compiles to | Code |
|
|
16
|
+
|---|---|---|---|
|
|
17
|
+
| **Schema** | rows: a JSON Schema of fields, indexes, `checks`, scope, TTL, lifecycle | one table (`STRICT` on SQLite) with native columns and one column per scalar field | none |
|
|
18
|
+
| **View** | a read: one SQL `SELECT`, its `input`, `surface` and `requires` | validated SQL IR in the plan | none |
|
|
19
|
+
| **Procedure** | a write: `input`, `output`, `requires` and a handler, either SQL statements or a `ref` | IR for `sql`, a name for `ref` | only `ref` |
|
|
20
|
+
| **Trigger** | when a Procedure runs: an HTTP route, an MCP tool, a lifecycle hook or a schedule | a binding in the plan | none |
|
|
76
21
|
|
|
77
|
-
|
|
22
|
+
Views read and Procedures write; a View never writes and a Procedure's SQL
|
|
23
|
+
holds write statements only. Custom code exists only behind a Procedure's
|
|
24
|
+
`ref`.
|
|
78
25
|
|
|
79
|
-
|
|
26
|
+
## How they reference each other
|
|
80
27
|
|
|
81
|
-
```yaml
|
|
82
|
-
apiVersion: cms.mantle.aotter.net/v1
|
|
83
|
-
kind: Schema
|
|
84
|
-
metadata:
|
|
85
|
-
name: notes
|
|
86
|
-
spec:
|
|
87
|
-
title: Notes
|
|
88
|
-
lifecycle: publishing
|
|
89
|
-
schema:
|
|
90
|
-
type: object
|
|
91
|
-
additionalProperties: false
|
|
92
|
-
required: [title, body]
|
|
93
|
-
properties:
|
|
94
|
-
title: { type: string, minLength: 1, maxLength: 200 }
|
|
95
|
-
body: { type: string, x-mcp-hint: markdown }
|
|
96
|
-
searchableFields: [title]
|
|
97
28
|
```
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
```yaml
|
|
106
|
-
apiVersion: cms.mantle.aotter.net/v1
|
|
107
|
-
kind: View
|
|
108
|
-
metadata:
|
|
109
|
-
name: published-notes
|
|
110
|
-
spec:
|
|
111
|
-
title: Published notes
|
|
112
|
-
surface: public
|
|
113
|
-
from: notes
|
|
114
|
-
fields: [id, title, updatedAt]
|
|
115
|
-
filter:
|
|
116
|
-
eq: { field: status, value: published }
|
|
117
|
-
orderBy:
|
|
118
|
-
- { field: updatedAt, direction: desc }
|
|
119
|
-
limit: 20
|
|
29
|
+
Trigger ──target──▶ Procedure ──SQL writes / ctx.store──▶ Schema
|
|
30
|
+
▲ │ ▲
|
|
31
|
+
requires.guard│ └─ctx.invoke──▶ Procedure │
|
|
32
|
+
│ │
|
|
33
|
+
View ────────────SQL SELECT (joins, subqueries)──────────────┘
|
|
34
|
+
Trigger(lifecycle) ◀── a write to its Schema
|
|
120
35
|
```
|
|
121
36
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
37
|
+
- A View's or Procedure's SQL names Schemas by `metadata.name`; a name that is
|
|
38
|
+
not a plain identifier is quoted (`"support-tickets"`).
|
|
39
|
+
- A Trigger targets one Procedure. A lifecycle Trigger also names the Schema
|
|
40
|
+
it watches.
|
|
41
|
+
- `requires.guard` names a `ref` Procedure that runs before the target.
|
|
42
|
+
- `x-mantle-ref` on a field points at another Schema's `id` or unique field;
|
|
43
|
+
Admin uses it to relate rows and bind operations.
|
|
127
44
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
handler: { kind: builtin, op: create, schema: notes }
|
|
131
|
-
```
|
|
45
|
+
`mantle generate` links every reference and refuses a dangling one, a
|
|
46
|
+
duplicate name, or two names that differ only in case.
|
|
132
47
|
|
|
133
|
-
|
|
48
|
+
## Native columns
|
|
134
49
|
|
|
135
|
-
|
|
50
|
+
Every Schema table carries native columns that Store fills and no write may
|
|
51
|
+
set:
|
|
136
52
|
|
|
137
|
-
|
|
53
|
+
| SQL name | Store JSON name | Meaning |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `id` | `id` | text id, generated unless a `ref` handler passes `ctx.store.id()` |
|
|
56
|
+
| `status` | `status` | `draft`, `published` or `archived`; on a `publishing` Schema only (an `operational` one has no `status` column) |
|
|
57
|
+
| `version` | `version` | starts at 1, bumps on every write; the optimistic lock |
|
|
58
|
+
| `created_at`, `updated_at` | `createdAt`, `updatedAt` | timestamps |
|
|
59
|
+
| `author_id` | `authorId` | the subject key of the caller that created the row |
|
|
138
60
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
source: { kind: http, method: POST, path: /api/contact }
|
|
142
|
-
# or: { kind: mcp, surface: public }
|
|
143
|
-
# or: { kind: lifecycle, schema: notes, on: [before_create] }
|
|
144
|
-
target: { procedure: send-contact-message }
|
|
145
|
-
```
|
|
61
|
+
SQL spells them snake_case; the JSON of `ctx.store` keeps camelCase. A Schema
|
|
62
|
+
field may not reuse these names.
|
|
146
63
|
|
|
147
|
-
|
|
64
|
+
## Values in SQL
|
|
148
65
|
|
|
149
|
-
|
|
66
|
+
| Reference | Is |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `input.<name>` | a declared `input` property |
|
|
69
|
+
| `auth.uid()` | the caller's subject key (`NULL` for an anonymous caller) |
|
|
70
|
+
| `auth.role()` | the caller's staff role, or `NULL` |
|
|
71
|
+
| `now()` | the invocation time |
|
|
72
|
+
| `mantle.search(t, q)`, `mantle.search_rank(t)`, `mantle.near(...)`, `mantle.distance(...)` | full-text search and geo functions |
|
|
150
73
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
3. **What operations?** One `Procedure` each. One Procedure equals one typed function call. Compose in handler code, not in YAML.
|
|
154
|
-
4. **What invokes them?** One `Trigger` per declared HTTP, MCP or lifecycle source.
|
|
155
|
-
5. **Who is allowed?** `requires.auth` for static identity and scope, plus one optional `requires.guard.procedure` for a live business check. See [Authorization](./authorization.md).
|
|
74
|
+
A SQL literal is a literal. There are no `$`-prefixed references and no
|
|
75
|
+
positional `$1`.
|
|
156
76
|
|
|
157
|
-
##
|
|
77
|
+
## What the runtime adds
|
|
158
78
|
|
|
159
|
-
|
|
79
|
+
Every Schema reference in every statement, joins and subqueries included, is
|
|
80
|
+
rewritten before it runs:
|
|
160
81
|
|
|
161
|
-
-
|
|
162
|
-
|
|
163
|
-
-
|
|
82
|
+
- **Scope**: on a Schema with `scope`, a user caller sees and writes only the
|
|
83
|
+
rows whose scope field is its own subject key.
|
|
84
|
+
- **TTL**: expired rows are invisible.
|
|
85
|
+
- **Published-only**: a public View reading a `publishing` Schema sees
|
|
86
|
+
published rows only.
|
|
87
|
+
- **Locks**: `WHERE id = … AND version = input.…` pins one row; writing none is
|
|
88
|
+
`CONFLICT`.
|
|
164
89
|
|
|
165
|
-
|
|
90
|
+
Authors write the business query; they never repeat these rules. See
|
|
91
|
+
[Authorization](./authorization.md) and [Lifecycle and locales](./lifecycle-and-locales.md).
|
|
166
92
|
|
|
167
|
-
##
|
|
93
|
+
## Further reading
|
|
168
94
|
|
|
169
|
-
- [
|
|
170
|
-
- [
|
|
171
|
-
- [
|
|
172
|
-
- [`packages/mantle-spec/src/domain/service/ManifestParser.ts`](../../../packages/mantle-spec/src/domain/service/ManifestParser.ts)
|
|
173
|
-
- [`docs/skills/develop/SKILL.md`](../../skills/develop/SKILL.md)
|
|
95
|
+
- [Reads: Views, REST and MCP](./views.md)
|
|
96
|
+
- [Writes: Procedures, Triggers and hooks](./procedures-and-triggers.md)
|
|
97
|
+
- [Feature table](../reference/features.md)
|