@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,109 +0,0 @@
|
|
|
1
|
-
import type { Hono } from 'hono';
|
|
2
|
-
import { DiagnosticError, makeDiagnostic } from '@aotter/mantle/spec';
|
|
3
|
-
import { extensionForMime, type MediaStorage, type MediaAsset, type MediaVariant } from '@aotter/mantle/runtime';
|
|
4
|
-
import type { AdminAuth } from '@aotter/mantle/admin';
|
|
5
|
-
import type { Env } from './chatgpt-auth';
|
|
6
|
-
|
|
7
|
-
const mimes = new Set(['image/jpeg', 'image/png', 'image/webp']);
|
|
8
|
-
const groupPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
|
|
9
|
-
const filePattern = /^(primary|alternate|fallback)\.(jpg|png|webp)$/;
|
|
10
|
-
|
|
11
|
-
type Pending = { expiresAt: number; variants: { mimeType: string; storageKey: string; expectedSize: number; maxBytes: number }[] };
|
|
12
|
-
|
|
13
|
-
function failure(code: 'MEDIA_OBJECT_NOT_FOUND' | 'MEDIA_MIME_REJECTED' | 'MEDIA_VARIANT_SIZE_EXCEEDED') {
|
|
14
|
-
return new DiagnosticError(makeDiagnostic({code, phase:'runtime', severity:'error', path:'sites/R2MediaStorage'}));
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** Public media over the Sites R2 binding; no S3 credentials or public bucket URL. */
|
|
18
|
-
export class SitesR2MediaStorage implements MediaStorage {
|
|
19
|
-
constructor(private readonly bucket:R2Bucket, private readonly origin:string) {}
|
|
20
|
-
|
|
21
|
-
async createUpload(args:Parameters<MediaStorage['createUpload']>[0]) {
|
|
22
|
-
const capabilities=args.variants.map(variant=>{
|
|
23
|
-
const storageKey=`${args.purpose}/${args.uploadGroupId}/${variant.role}.${extensionForMime(variant.mimeType)}`;
|
|
24
|
-
return {
|
|
25
|
-
mimeType:variant.mimeType, role:variant.role, method:'PUT' as const,
|
|
26
|
-
uploadUrl:`${this.origin}/admin/media-upload/${args.uploadGroupId}/${storageKey.split('/').at(-1)}`,
|
|
27
|
-
storageKey, publicUrl:`${this.origin}/media/${storageKey}`,
|
|
28
|
-
requiredHeaders:{'Content-Type':variant.mimeType},
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
return {uploadGroupId:args.uploadGroupId, capabilities, expiresAt:args.expiresAt};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async commitUpload(args:Parameters<MediaStorage['commitUpload']>[0]):Promise<MediaAsset> {
|
|
35
|
-
const checked=[] as {spec:(typeof args.variants)[number]; size:number}[];
|
|
36
|
-
for(const spec of args.variants) {
|
|
37
|
-
const head=await this.bucket.head(spec.storageKey);
|
|
38
|
-
if(!head)throw failure('MEDIA_OBJECT_NOT_FOUND');
|
|
39
|
-
if(head.httpMetadata?.contentType!==spec.mimeType)throw failure('MEDIA_MIME_REJECTED');
|
|
40
|
-
if(head.size>spec.maxBytes)throw failure('MEDIA_VARIANT_SIZE_EXCEEDED');
|
|
41
|
-
checked.push({spec,size:head.size});
|
|
42
|
-
}
|
|
43
|
-
const variants:MediaVariant[]=[];
|
|
44
|
-
for(const {spec,size} of checked) {
|
|
45
|
-
const object=await this.bucket.get(spec.storageKey);
|
|
46
|
-
if(!object)throw failure('MEDIA_OBJECT_NOT_FOUND');
|
|
47
|
-
await this.bucket.put(spec.storageKey,object.body,{
|
|
48
|
-
httpMetadata:{contentType:spec.mimeType},
|
|
49
|
-
customMetadata:{...object.customMetadata,committedAt:String(args.now),uploadGroupId:args.uploadGroupId,role:spec.role,filename:args.filename},
|
|
50
|
-
});
|
|
51
|
-
variants.push({mimeType:spec.mimeType,role:spec.role,storageKey:spec.storageKey,byteSize:size,publicUrl:await this.getPublicUrl({storageKey:spec.storageKey})});
|
|
52
|
-
}
|
|
53
|
-
return {id:args.uploadGroupId,variants,alt:args.alt,caption:args.caption,createdAt:args.now,metadata:{filename:args.filename}};
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
async getPublicUrl({storageKey}:Parameters<MediaStorage['getPublicUrl']>[0]) {return `${this.origin}/media/${storageKey}`;}
|
|
57
|
-
async deleteObject({storageKey}:Parameters<MediaStorage['deleteObject']>[0]) {await this.bucket.delete(storageKey);}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export function mountMedia(app:Hono<{Bindings:Env}>,auth:AdminAuth,env:Env) {
|
|
61
|
-
app.put('/admin/media-upload/:group/:file',async c=>{
|
|
62
|
-
const session=await auth.getSession(c.req.raw);
|
|
63
|
-
if(!session)return c.json({error:'unauthenticated'},401);
|
|
64
|
-
if(session.user.role!=='owner'&&session.user.role!=='editor')return c.json({error:'editor_required'},403);
|
|
65
|
-
if(c.req.header('origin')!==env.PUBLIC_ORIGIN)return c.json({error:'cross_origin'},403);
|
|
66
|
-
const group=c.req.param('group'),file=c.req.param('file');
|
|
67
|
-
if(!groupPattern.test(group)||!filePattern.test(file))return c.json({error:'invalid_upload'},400);
|
|
68
|
-
const row=await env.DB.prepare('SELECT record FROM pending_media_uploads WHERE id=?').bind(group).first<{record:string}>();
|
|
69
|
-
if(!row)return c.json({error:'upload_expired'},410);
|
|
70
|
-
const pending=JSON.parse(row.record) as Pending;
|
|
71
|
-
if(pending.expiresAt<=Date.now())return c.json({error:'upload_expired'},410);
|
|
72
|
-
const key=`content/${group}/${file}`;
|
|
73
|
-
const variant=pending.variants.find(v=>v.storageKey===key);
|
|
74
|
-
if(!variant||!mimes.has(variant.mimeType))return c.json({error:'invalid_upload'},400);
|
|
75
|
-
if(c.req.header('content-type')!==variant.mimeType)return c.json({error:'mime_rejected'},415);
|
|
76
|
-
const length=Number(c.req.header('content-length'));
|
|
77
|
-
if(Number.isFinite(length)&&length>variant.expectedSize)return c.json({error:'size_exceeded'},413);
|
|
78
|
-
if(!c.req.raw.body)return c.json({error:'empty_upload'},400);
|
|
79
|
-
// R2 put requires a fixed-length body. Bound memory to this validated 5 MB policy.
|
|
80
|
-
const reader=c.req.raw.body.getReader(),chunks:Uint8Array[]=[];
|
|
81
|
-
let bytes=0;
|
|
82
|
-
for(;;) {
|
|
83
|
-
const {done,value}=await reader.read();
|
|
84
|
-
if(done)break;
|
|
85
|
-
bytes+=value.byteLength;
|
|
86
|
-
if(bytes>variant.expectedSize){await reader.cancel();return c.json({error:'size_exceeded'},413);}
|
|
87
|
-
chunks.push(value);
|
|
88
|
-
}
|
|
89
|
-
if(bytes!==variant.expectedSize)return c.json({error:'size_mismatch'},400);
|
|
90
|
-
const body=new Uint8Array(bytes);
|
|
91
|
-
let offset=0;
|
|
92
|
-
for(const chunk of chunks){body.set(chunk,offset);offset+=chunk.byteLength;}
|
|
93
|
-
await env.MEDIA_BUCKET.put(key,body,{httpMetadata:{contentType:variant.mimeType}});
|
|
94
|
-
return c.body(null,204);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
app.get('/media/:purpose/:group/:file',async c=>{
|
|
98
|
-
const {purpose,group,file}=c.req.param();
|
|
99
|
-
if(purpose!=='content'||!groupPattern.test(group)||!filePattern.test(file))return c.notFound();
|
|
100
|
-
const key=`${purpose}/${group}/${file}`;
|
|
101
|
-
const row=await env.DB.prepare('SELECT variants FROM media_assets WHERE id=?').bind(group).first<{variants:string}>();
|
|
102
|
-
if(!row)return c.notFound();
|
|
103
|
-
const variants=JSON.parse(row.variants) as MediaVariant[];
|
|
104
|
-
if(!variants.some(v=>v.storageKey===key))return c.notFound();
|
|
105
|
-
const object=await env.MEDIA_BUCKET.get(key);
|
|
106
|
-
if(!object||!mimes.has(object.httpMetadata?.contentType??''))return c.notFound();
|
|
107
|
-
return new Response(object.body,{headers:{'Content-Type':object.httpMetadata!.contentType!,'Content-Length':String(object.size),'Cache-Control':'public, max-age=3600','X-Content-Type-Options':'nosniff'}});
|
|
108
|
-
});
|
|
109
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { Hono } from 'hono';
|
|
2
|
-
import type { AdminAuth } from '@aotter/mantle/admin';
|
|
3
|
-
import type { Env } from './chatgpt-auth';
|
|
4
|
-
|
|
5
|
-
// Deliberately a binding probe, not an implementation of Mantle's public MediaStorage port.
|
|
6
|
-
export function mountR2Lab(app:Hono<{Bindings:Env}>,auth:AdminAuth,env:Env) {
|
|
7
|
-
app.use('/admin/lab*',async(c,next)=>{
|
|
8
|
-
const session=await auth.getSession(c.req.raw);
|
|
9
|
-
if(!session)return c.json({error:'unauthenticated'},401);
|
|
10
|
-
if(session.user.role!=='owner')return c.json({error:'owner_required'},403);
|
|
11
|
-
if(c.req.method!=='GET'&&c.req.header('origin')!==env.PUBLIC_ORIGIN)return c.json({error:'cross_origin'},403);
|
|
12
|
-
await next();
|
|
13
|
-
});
|
|
14
|
-
app.get('/admin/lab',c=>c.html(`<!doctype html><html lang="zh-Hant"><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>R2 驗證 · Mantle Sites</title><style>body{font:18px system-ui;max-width:760px;margin:60px auto;padding:24px;background:#101820;color:#eef5ff}a{color:#69dbff}button{font:inherit;padding:12px 20px;cursor:pointer}pre{white-space:pre-wrap}</style><h1>R2 binding 驗證</h1><p>以目前的 owner 身分寫入一個測試物件,在另一個請求讀取並核對內容,最後清理該物件。這不是媒體庫上傳測試。</p><button id="run">執行 R2 測試</button><pre id="result" role="status"></pre><a href="/admin">回管理後台</a><script>
|
|
15
|
-
const button=document.querySelector('#run'),result=document.querySelector('#result');
|
|
16
|
-
button.onclick=async()=>{button.disabled=true;result.textContent='測試中…';let id;try{
|
|
17
|
-
const send=async(method,path)=>{const r=await fetch(path,{method});if(!r.ok)throw Error('HTTP '+r.status);return r.json()};
|
|
18
|
-
const created=await send('POST','/admin/lab/r2');id=created.id;
|
|
19
|
-
const read=await send('GET','/admin/lab/r2/'+id);if(!read.matches)throw Error('內容不一致');
|
|
20
|
-
const deleted=await send('DELETE','/admin/lab/r2/'+id);if(!deleted.deleted)throw Error('清理未完成');id=null;
|
|
21
|
-
result.textContent='PASS:R2 PUT → HEAD / GET(另一個請求)→ 內容核對 → DELETE / HEAD 確認已清理。';
|
|
22
|
-
}catch(e){result.textContent='FAIL:'+e.message+(id?';待清理測試 ID:'+id:'')}finally{button.disabled=false}};
|
|
23
|
-
</script></html>`));
|
|
24
|
-
app.post('/admin/lab/r2',async c=>{
|
|
25
|
-
const id=crypto.randomUUID();
|
|
26
|
-
await env.MEDIA_BUCKET.put(`_sites_binding_probe/${id}`,`mantle-sites-r2:${id}`,{httpMetadata:{contentType:'text/plain'},customMetadata:{purpose:'disposable-binding-probe'}});
|
|
27
|
-
return c.json({id});
|
|
28
|
-
});
|
|
29
|
-
app.on(['GET','DELETE'],'/admin/lab/r2/:id',async c=>{
|
|
30
|
-
const id=c.req.param('id');
|
|
31
|
-
if(!/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(id))return c.json({error:'invalid_id'},400);
|
|
32
|
-
const key=`_sites_binding_probe/${id}`,head=await env.MEDIA_BUCKET.head(key);
|
|
33
|
-
if(!head||head.customMetadata?.purpose!=='disposable-binding-probe')return c.json({error:'not_found'},404);
|
|
34
|
-
if(c.req.method==='DELETE'){await env.MEDIA_BUCKET.delete(key);return c.json({deleted:await env.MEDIA_BUCKET.head(key)===null});}
|
|
35
|
-
const object=await env.MEDIA_BUCKET.get(key);
|
|
36
|
-
return c.json({matches:!!object&&await object.text()===`mantle-sites-r2:${id}`,size:head.size});
|
|
37
|
-
});
|
|
38
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"9ef85f9933e22328140e924045820af6be2a6985ed8ecc19b63a4f2a37826618"
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Hono } from 'hono';
|
|
2
|
-
import type { MantleAdminRuntime } from '@aotter/mantle/admin';
|
|
3
|
-
import { createMantleWeb, createPublicPathResolver, composeEntrySeoMeta, composePageSeoMeta, renderSeoTagsHtml, serializeEntryAsMarkdown, TemplateRegistry } from '@aotter/mantle-web';
|
|
4
|
-
import { micromark } from 'micromark';
|
|
5
|
-
import type { Env } from './chatgpt-auth';
|
|
6
|
-
|
|
7
|
-
const paths=createPublicPathResolver({collectionRoutes:{articles:{segment:'articles'}}});
|
|
8
|
-
const escape=(value:unknown)=>String(value??'').replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]!));
|
|
9
|
-
const articlePath=(id:string)=>`/articles/${encodeURIComponent(id)}`;
|
|
10
|
-
const shell=(title:string,head:string,body:string)=>`<!doctype html><html lang="zh-Hant"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${escape(title)}</title>${head}<link rel="stylesheet" href="/site.css"><style>.article-cover{margin:36px 0}.article-cover img{display:block;width:100%;height:auto;border-radius:12px}.prose img{max-width:100%;height:auto}</style></head><body><header class="topbar"><a class="brand" href="/"><span class="mark">M</span><span>Mantle <em>×</em> Sites</span></a><nav aria-label="主要導覽"><a href="/articles">文章</a><a href="/admin">管理後台 ↗</a></nav></header>${body}<footer><span>Mantle on ChatGPT Sites</span><a href="/llms.txt">給 AI 的內容索引</a></footer></body></html>`;
|
|
11
|
-
const templates=new TemplateRegistry();
|
|
12
|
-
templates.registerListTemplate('articles',({entries,nextPageUrl})=>`<section class="article-list">${entries.length?entries.map(entry=>`<article class="article-row"><div class="article-number">${new Date(entry.updatedAt).toLocaleDateString('zh-TW',{timeZone:'UTC'})}</div><div><h2><a href="${articlePath(entry.id)}">${escape(entry.data.title)}</a></h2><p>${escape(entry.data.summary||'閱讀完整文章')}</p></div><span aria-hidden="true">↗</span></article>`).join(''):'<div class="empty"><h2>文章準備中</h2><p>在管理後台發布文章後,就會自動出現在這裡。</p></div>'}</section>${nextPageUrl?`<nav class="pagination" aria-label="分頁"><a rel="next" href="${escape(nextPageUrl)}">更多文章 →</a></nav>`:''}`);
|
|
13
|
-
|
|
14
|
-
export function mountWeb(app:Hono<{Bindings:Env}>,get:()=>Promise<MantleAdminRuntime>) {
|
|
15
|
-
const load=async()=>{const runtime=await get();return {runtime,site:await runtime.siteConfig.load(),web:createMantleWeb(runtime,{templates,paths})};};
|
|
16
|
-
const list=async(cursor?:string)=>{const {site,web}=await load();const seo=composePageSeoMeta({site,locale:'zh-TW',publicPath:'/articles',title:`文章|${site.title}`,description:site.description||'由 Mantle 管理與發布的文章。',markdown:false,pathForLocale:()=>'/articles'});const page=await web.renderListLive.execute({collection:'articles',locale:'zh-TW',contentLocale:null,site,seo,cursor,limit:20,pathForPage:next=>`/articles?cursor=${encodeURIComponent(next)}`});return shell(`文章|${site.title}`,renderSeoTagsHtml(seo),`<main><section class="hero small"><p class="eyebrow">THE JOURNAL</p><h1>文章與觀察<span class="dot">.</span></h1><p class="hero-copy">內容由 Mantle 後台管理,從 D1 即時讀取。</p></section><div class="content-wrap">${page?.html.replace(/^<!doctype html>/i,'')??''}</div></main>`);};
|
|
17
|
-
app.get('/',async c=>{const {site}=await load();const seo=composePageSeoMeta({site,locale:'zh-TW',publicPath:'/',title:site.title,description:site.description||'Mantle 在 ChatGPT Sites 上的內容實驗。',markdown:false,pathForLocale:()=>'/'});return c.html(shell(site.title,renderSeoTagsHtml(seo),`<main><section class="hero"><p class="eyebrow">BUILT WITH MANTLE · RUNNING ON CHATGPT SITES</p><h1>內容、資料、<br>與下一種網站<span class="dot">.</span></h1><p class="hero-copy">這個站點連接 Mantle 管理後台與 Sites 的 D1 資料庫。文章發布後,會自動生成可閱讀、可索引的頁面。</p><div class="actions"><a class="button" href="/articles">探索文章 <span>↗</span></a><a class="text-link" href="/admin">進入管理後台 →</a></div></section><section class="feature-grid" aria-label="網站能力"><div><span class="feature-index">01 / CONTENT</span><h2>一處編輯</h2><p>文章在 Mantle 後台建立與發布,前台直接讀取同一份內容。</p></div><div><span class="feature-index">02 / DISCOVERY</span><h2>搜尋與 AI 可讀</h2><p>標準 metadata、結構化資料、Markdown 鏡像與內容索引。</p></div><div><span class="feature-index">03 / PLATFORM</span><h2>託管於 Sites</h2><p>D1 保存文章,R2 圖片可在後台上傳並綁定文章封面。</p></div></section></main>`));});
|
|
18
|
-
app.get('/articles',async c=>c.html(await list(c.req.query('cursor'))));
|
|
19
|
-
app.get('/articles/:id',async c=>{const {runtime,site}=await load();const rawId=c.req.param('id');const markdown=rawId.endsWith('.md');const entry=await runtime.entries.readById({collection:'articles',id:markdown?rawId.slice(0,-3):rawId});if(!entry||entry.status!=='published')return c.notFound();if(markdown){const text=serializeEntryAsMarkdown(entry);return text?c.text(text,200,{'Content-Type':'text/markdown; charset=utf-8'}):c.notFound();}
|
|
20
|
-
const coverId=typeof entry.data.coverAssetId==='string'?entry.data.coverAssetId:'';
|
|
21
|
-
const cover=coverId?await runtime.media?.resolve(coverId):null;
|
|
22
|
-
const primary=cover?.variants.find(v=>v.role==='primary');
|
|
23
|
-
const coverUrl=primary?.publicUrl;
|
|
24
|
-
const seoEntry=coverUrl?{...entry,data:{...entry.data,coverUrl}}:entry;
|
|
25
|
-
const path=articlePath(entry.id),seo=composeEntrySeoMeta({entry:seoEntry,site,publicPath:path,locale:'zh-TW',type:'article'});
|
|
26
|
-
const title=String(entry.data.title??site.title);
|
|
27
|
-
const image=coverUrl?`<figure class="article-cover"><img src="${escape(coverUrl)}" alt="${escape(cover?.alt||title)}" loading="eager"></figure>`:'';
|
|
28
|
-
const body=micromark(String(entry.data.body??''),{allowDangerousHtml:false,allowDangerousProtocol:false});
|
|
29
|
-
return c.html(shell(`${title}|${site.title}`,renderSeoTagsHtml(seo),`<main class="article-page"><a class="back" href="/articles">← 返回文章</a><article><p class="eyebrow">ARTICLE · ${new Date(entry.updatedAt).toLocaleDateString('zh-TW',{timeZone:'UTC'})}</p><h1>${escape(title)}</h1>${entry.data.summary?`<p class="lede">${escape(entry.data.summary)}</p>`:''}${image}<div class="prose">${body}</div></article></main>`));});
|
|
30
|
-
// ponytail: one discovery page is enough for this lab; expose cursor pages when published articles exceed the SDK page limit.
|
|
31
|
-
app.get('/llms.txt',async c=>{const {site,web}=await load();const page=await web.composeLlmsTxt.execute({collections:['articles'],locale:null,site,pathFor:e=>articlePath(e.id)});const body=page?.body??`# ${site.title}\n\n文章索引:${site.origin}/articles\n`;return c.text(body,200,{'Content-Type':'text/plain; charset=utf-8'});});
|
|
32
|
-
// ponytail: first 1000 published URLs; add sitemap index parts only when the catalogue reaches that ceiling.
|
|
33
|
-
app.get('/sitemap.xml',async c=>{const {site,web}=await load();const page=await web.composeSitemap.execute({site,collections:['articles'],pathFor:e=>articlePath(e.id),additionalPaths:['/','/articles'],maxUrls:1000});return c.text(page.body,200,{'Content-Type':'application/xml; charset=utf-8'});});
|
|
34
|
-
app.get('/robots.txt',async c=>c.text(`User-agent: *\nAllow: /\nSitemap: ${c.env.PUBLIC_ORIGIN}/sitemap.xml\n`));
|
|
35
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"compilerOptions":{"target":"ES2022","module":"ESNext","moduleResolution":"Bundler","strict":true,"skipLibCheck":true,"noEmit":true,"types":["@cloudflare/workers-types"],"lib":["ES2022","DOM"]},"include":["src/**/*.ts",".mantle/generated/**/*.ts"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mantle-sites-reference",
|
|
3
|
-
"main": "dist/server/index.js",
|
|
4
|
-
"compatibility_date": "2026-09-08",
|
|
5
|
-
"compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"],
|
|
6
|
-
"assets": {"directory":"dist/client","binding":"ASSETS","run_worker_first":true},
|
|
7
|
-
"d1_databases": [{"binding":"DB","database_name":"mantle-sites-reference-local","database_id":"local","migrations_dir":"drizzle"}],
|
|
8
|
-
"r2_buckets": [{"binding":"MEDIA_BUCKET","bucket_name":"mantle-sites-reference-local-media"}],
|
|
9
|
-
"vars": {"PUBLIC_ORIGIN":"http://localhost:4174","OWNER_EMAIL":"owner@example.test"}
|
|
10
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
# Local Admin OTP
|
|
2
|
-
|
|
3
|
-
This is the opt-in Dev UI path: a directly authored Cloudflare application
|
|
4
|
-
that opens Mantle Admin locally with email OTP. Admin is not required to
|
|
5
|
-
ship a complete service. It is not a Starter or CLI generator. Business
|
|
6
|
-
Manifests live in the [Examples hub](../README.md). The notes
|
|
7
|
-
Schema is example business data; `mantle generate` never invents it.
|
|
8
|
-
|
|
9
|
-
Spec + adapter without Admin:
|
|
10
|
-
[`docs/examples/host-minimal-worker`](../host-minimal-worker/README.md).
|
|
11
|
-
|
|
12
|
-
This reference depends on every `@aotter/mantle*` package via the `latest`
|
|
13
|
-
dist-tag, so a fresh install always resolves the current stable release.
|
|
14
|
-
Core's test runner substitutes its exact candidate in a disposable copy.
|
|
15
|
-
|
|
16
|
-
## One-shot
|
|
17
|
-
|
|
18
|
-
Outside the SDK workspace, with Node 22+ and pnpm 9+:
|
|
19
|
-
|
|
20
|
-
```sh
|
|
21
|
-
pnpm install && pnpm generate && pnpm dev
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
`predev` copies `.dev.vars.example` to `.dev.vars` when that file is
|
|
25
|
-
missing. `pnpm dev` binds `127.0.0.1:8787` so wrangler's Ready-on origin
|
|
26
|
-
matches `PUBLIC_ORIGIN` (`http://127.0.0.1:8787`). Open that Ready-on
|
|
27
|
-
URL. Browsing `http://localhost:8787` still serves HTML, but the OTP
|
|
28
|
-
Origin header mismatches `PUBLIC_ORIGIN` and Better Auth returns
|
|
29
|
-
`INVALID_ORIGIN`. Then:
|
|
30
|
-
|
|
31
|
-
1. Open `http://127.0.0.1:8787/admin/sign-in`.
|
|
32
|
-
2. Sign in with the bootstrap owner email from `.dev.vars` (`owner@example.com`
|
|
33
|
-
in the example).
|
|
34
|
-
3. Read the one-time code from the wrangler log line
|
|
35
|
-
`[ConsoleEmailSender] auth.email-otp.sign-in → …`.
|
|
36
|
-
4. Land in the Admin / Dev UI as `owner`.
|
|
37
|
-
|
|
38
|
-
`mantle generate` syncs the prebuilt Admin SPA from `@aotter/mantle-admin-ui`
|
|
39
|
-
into `public/_mantle/admin/`. There is no Vite or frontend build step unless
|
|
40
|
-
you are developing `admin-ui` itself.
|
|
41
|
-
|
|
42
|
-
## Hard requirements for Admin
|
|
43
|
-
|
|
44
|
-
Admin is not a Worker route that paints itself. These must all be present:
|
|
45
|
-
|
|
46
|
-
| Piece | Why |
|
|
47
|
-
|---|---|
|
|
48
|
-
| `@aotter/mantle-admin` and `@aotter/mantle-admin-ui` | Admin API plus the prebuilt SPA |
|
|
49
|
-
| `assets.directory = ./public` and `binding = ASSETS` | Serves `/_mantle/admin/assets/*` |
|
|
50
|
-
| `createAuth` `email-otp` + `ConsoleEmailSender` | Local human sign-in; code is in wrangler logs |
|
|
51
|
-
| `bootstrapOwner.match: email` | First matching sign-in becomes `owner` |
|
|
52
|
-
| `PUBLIC_ORIGIN` and `BETTER_AUTH_SECRET` | Auth construction; copied from `.dev.vars.example` |
|
|
53
|
-
|
|
54
|
-
If `/admin` returns HTML `200` while `/_mantle/admin/assets/*` is `404`, the
|
|
55
|
-
SPA white-screens. That is a missing or misconfigured `ASSETS` binding, not a
|
|
56
|
-
failed frontend build. Do not put `/_mantle` in `run_worker_first`; asset
|
|
57
|
-
paths must fall through to Static Assets.
|
|
58
|
-
|
|
59
|
-
`ConsoleEmailSender` is the local path only. Do not wire it in production.
|
|
60
|
-
|
|
61
|
-
## Local traps
|
|
62
|
-
|
|
63
|
-
- Prefer `http://127.0.0.1:8787` over `http://localhost:8787`. Wrangler still
|
|
64
|
-
serves HTML on localhost, but the OTP `Origin` header will not match
|
|
65
|
-
`PUBLIC_ORIGIN` and Better Auth returns `INVALID_ORIGIN`.
|
|
66
|
-
- `pnpm check` runs `smoke.mjs`, which rewrites `.dev.vars` to a smoke-only
|
|
67
|
-
port (`18787`). Restore `.dev.vars` from `.dev.vars.example` (or delete it
|
|
68
|
-
and let `predev` recopy) before `pnpm dev`, or OTP will fail with
|
|
69
|
-
`INVALID_ORIGIN` against the Ready-on `8787` origin.
|
|
70
|
-
|
|
71
|
-
## What this project does not do
|
|
72
|
-
|
|
73
|
-
`/` is `404`: no visitor frontend is installed. Public GET
|
|
74
|
-
`/api/views/published-notes` still works against fresh local D1. Conventional
|
|
75
|
-
GitHub Auth (`MANTLE_AUTH_MODE`) is not used; the Worker replaces construction
|
|
76
|
-
with `createAuth` while Core still owns `/admin` and `/api/auth/*`.
|
|
77
|
-
|
|
78
|
-
Commit the resolved lockfile in a real application and use frozen installs
|
|
79
|
-
afterwards. Configure a real D1 `database_id`, a production email sender, and
|
|
80
|
-
secrets before any remote deploy. Never commit `.dev.vars`.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
apiVersion: cms.mantle.aotter.net/v1
|
|
2
|
-
kind: Schema
|
|
3
|
-
metadata:
|
|
4
|
-
name: notes
|
|
5
|
-
spec:
|
|
6
|
-
title: Notes
|
|
7
|
-
schema:
|
|
8
|
-
type: object
|
|
9
|
-
required: [title]
|
|
10
|
-
properties:
|
|
11
|
-
title: { type: string }
|
|
12
|
-
lifecycle: publishing
|
|
13
|
-
---
|
|
14
|
-
apiVersion: cms.mantle.aotter.net/v1
|
|
15
|
-
kind: View
|
|
16
|
-
metadata:
|
|
17
|
-
name: published-notes
|
|
18
|
-
spec:
|
|
19
|
-
surface: public
|
|
20
|
-
from: notes
|
|
21
|
-
cache: { sharedMaxAge: 3600 }
|
|
22
|
-
fields: [id, title]
|
|
23
|
-
filter:
|
|
24
|
-
eq: { field: status, value: published }
|
|
25
|
-
limit: 20
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mantle-local-admin-otp",
|
|
3
|
-
"private": true,
|
|
4
|
-
"type": "module",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"generate": "mantle generate",
|
|
7
|
-
"validate": "mantle validate",
|
|
8
|
-
"typecheck": "tsc --noEmit",
|
|
9
|
-
"predev": "node ensure-dev-vars.mjs",
|
|
10
|
-
"dev": "wrangler dev --local --ip 127.0.0.1 --port 8787",
|
|
11
|
-
"check": "node ensure-dev-vars.mjs && mantle generate && mantle generate --check && mantle validate && mantle skills && mantle skills --check && tsc --noEmit && node smoke.mjs"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"@aotter/mantle": "latest",
|
|
15
|
-
"@aotter/mantle-admin": "latest",
|
|
16
|
-
"@aotter/mantle-admin-ui": "latest",
|
|
17
|
-
"@aotter/mantle-cloudflare": "latest",
|
|
18
|
-
"better-auth": "1.7.2",
|
|
19
|
-
"hono": "^4.13.3",
|
|
20
|
-
"zod": "^4.5.4",
|
|
21
|
-
"aws4fetch": "^1.0.20"
|
|
22
|
-
},
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"@cloudflare/workers-types": "^5.20260907.1",
|
|
25
|
-
"typescript": "^6.0.3",
|
|
26
|
-
"wrangler": "^4.125.0"
|
|
27
|
-
},
|
|
28
|
-
"packageManager": "pnpm@9.15.0"
|
|
29
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Static Assets root. `mantle generate` writes public/_mantle/admin/ here.
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { spawn } from "node:child_process";
|
|
3
|
-
import { readFileSync, writeFileSync } from "node:fs";
|
|
4
|
-
|
|
5
|
-
await import("./ensure-dev-vars.mjs");
|
|
6
|
-
|
|
7
|
-
const ownerEmail = "owner@example.com";
|
|
8
|
-
const port = 18787;
|
|
9
|
-
const origin = `http://127.0.0.1:${port}`;
|
|
10
|
-
writeFileSync(".dev.vars", [
|
|
11
|
-
`PUBLIC_ORIGIN=${origin}`,
|
|
12
|
-
"BETTER_AUTH_SECRET=local-admin-otp-dev-secret-do-not-use-in-prod",
|
|
13
|
-
`ADMIN_EMAIL=${ownerEmail}`,
|
|
14
|
-
"",
|
|
15
|
-
].join("\n"));
|
|
16
|
-
const logs = [];
|
|
17
|
-
|
|
18
|
-
const wrangler = spawn("pnpm", [
|
|
19
|
-
"exec",
|
|
20
|
-
"wrangler",
|
|
21
|
-
"dev",
|
|
22
|
-
"--local",
|
|
23
|
-
"--ip",
|
|
24
|
-
"127.0.0.1",
|
|
25
|
-
"--port",
|
|
26
|
-
String(port),
|
|
27
|
-
"--inspector-port",
|
|
28
|
-
"0",
|
|
29
|
-
"--persist-to",
|
|
30
|
-
".wrangler/smoke",
|
|
31
|
-
], {
|
|
32
|
-
env: { ...process.env, WRANGLER_SEND_METRICS: "false", CI: "1" },
|
|
33
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const onLog = (chunk) => {
|
|
37
|
-
logs.push(String(chunk));
|
|
38
|
-
};
|
|
39
|
-
wrangler.stdout.on("data", onLog);
|
|
40
|
-
wrangler.stderr.on("data", onLog);
|
|
41
|
-
|
|
42
|
-
try {
|
|
43
|
-
await waitForReady(origin);
|
|
44
|
-
const signIn = await fetch(`${origin}/admin/sign-in`);
|
|
45
|
-
assert.equal(signIn.status, 200, `/admin/sign-in ${signIn.status}`);
|
|
46
|
-
const html = await signIn.text();
|
|
47
|
-
assert.match(html, /<!doctype html|<html/i);
|
|
48
|
-
const assets = [...html.matchAll(/(?:href|src)="(\/_mantle\/admin\/[^"]+)"/g)]
|
|
49
|
-
.map((match) => match[1])
|
|
50
|
-
.filter((path, index, all) => all.indexOf(path) === index);
|
|
51
|
-
assert.ok(assets.length > 0, "Admin HTML must reference /_mantle/admin assets");
|
|
52
|
-
for (const path of assets) {
|
|
53
|
-
const asset = await fetch(`${origin}${path}`);
|
|
54
|
-
assert.equal(asset.status, 200, `${path} ${asset.status}`);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const methods = await fetch(`${origin}/api/auth/methods`);
|
|
58
|
-
assert.equal(methods.status, 200);
|
|
59
|
-
assert.deepEqual(await methods.json(), { methods: [{ kind: "email-otp" }] });
|
|
60
|
-
|
|
61
|
-
const sent = await fetch(`${origin}/api/auth/email-otp/send-verification-otp`, {
|
|
62
|
-
method: "POST",
|
|
63
|
-
headers: { origin, "content-type": "application/json" },
|
|
64
|
-
body: JSON.stringify({ email: ownerEmail, type: "sign-in" }),
|
|
65
|
-
});
|
|
66
|
-
assert.equal(sent.status, 200, `send OTP ${sent.status} ${await sent.text()}`);
|
|
67
|
-
const otp = await waitForOtp();
|
|
68
|
-
const signedIn = await fetch(`${origin}/api/auth/sign-in/email-otp`, {
|
|
69
|
-
method: "POST",
|
|
70
|
-
headers: { origin, "content-type": "application/json" },
|
|
71
|
-
body: JSON.stringify({ email: ownerEmail, otp }),
|
|
72
|
-
});
|
|
73
|
-
assert.equal(signedIn.status, 200, `sign-in ${signedIn.status} ${await signedIn.text()}`);
|
|
74
|
-
const cookie = cookieHeader(signedIn);
|
|
75
|
-
assert.ok(cookie, "sign-in must set a session cookie");
|
|
76
|
-
|
|
77
|
-
const shell = await fetch(`${origin}/admin`, { headers: { cookie } });
|
|
78
|
-
assert.equal(shell.status, 200, `/admin ${shell.status}`);
|
|
79
|
-
const settings = await fetch(`${origin}/admin/api/site-settings`, { headers: { cookie } });
|
|
80
|
-
assert.equal(settings.status, 200, `/admin/api/site-settings ${settings.status}`);
|
|
81
|
-
const pkg = JSON.parse(readFileSync("node_modules/@aotter/mantle/package.json", "utf8"));
|
|
82
|
-
console.log(`Mantle ${pkg.version}: /admin assets 200, OTP ${otp} in wrangler logs, owner Admin shell 200`);
|
|
83
|
-
} finally {
|
|
84
|
-
wrangler.kill("SIGTERM");
|
|
85
|
-
await waitForExit(wrangler);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function cookieHeader(response) {
|
|
89
|
-
const cookies = typeof response.headers.getSetCookie === "function"
|
|
90
|
-
? response.headers.getSetCookie()
|
|
91
|
-
: [response.headers.get("set-cookie")].filter(Boolean);
|
|
92
|
-
return cookies.map((value) => value.split(";", 1)[0]).join("; ");
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
async function waitForReady(url) {
|
|
96
|
-
const deadline = Date.now() + 60_000;
|
|
97
|
-
while (Date.now() < deadline) {
|
|
98
|
-
if (wrangler.exitCode !== null) {
|
|
99
|
-
throw new Error(`wrangler exited ${wrangler.exitCode}\n${logs.join("")}`);
|
|
100
|
-
}
|
|
101
|
-
try {
|
|
102
|
-
const response = await fetch(`${url}/admin/sign-in`);
|
|
103
|
-
if (response.status === 200) return;
|
|
104
|
-
} catch {
|
|
105
|
-
// Worker still booting.
|
|
106
|
-
}
|
|
107
|
-
await delay(250);
|
|
108
|
-
}
|
|
109
|
-
throw new Error(`wrangler did not become ready\n${logs.join("")}`);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
async function waitForOtp() {
|
|
113
|
-
const deadline = Date.now() + 15_000;
|
|
114
|
-
while (Date.now() < deadline) {
|
|
115
|
-
const match = logs.join("").match(/Your Mantle sign-in code: (\d{6})/);
|
|
116
|
-
if (match) return match[1];
|
|
117
|
-
await delay(100);
|
|
118
|
-
}
|
|
119
|
-
throw new Error(`OTP log line missing\n${logs.join("")}`);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function waitForExit(child) {
|
|
123
|
-
return new Promise((resolve) => {
|
|
124
|
-
if (child.exitCode !== null) {
|
|
125
|
-
resolve();
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const timer = setTimeout(() => {
|
|
129
|
-
child.kill("SIGKILL");
|
|
130
|
-
resolve();
|
|
131
|
-
}, 5_000);
|
|
132
|
-
child.once("exit", () => {
|
|
133
|
-
clearTimeout(timer);
|
|
134
|
-
resolve();
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
function delay(ms) {
|
|
140
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
141
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ConsoleEmailSender,
|
|
3
|
-
createAuth,
|
|
4
|
-
createMantleWorker,
|
|
5
|
-
type MantleCloudflareEnv,
|
|
6
|
-
} from "@aotter/mantle/cloudflare";
|
|
7
|
-
import { plan } from "../.mantle/generated/mantle.js";
|
|
8
|
-
|
|
9
|
-
export interface Env extends MantleCloudflareEnv {
|
|
10
|
-
readonly ASSETS: Fetcher;
|
|
11
|
-
readonly BETTER_AUTH_SECRET: string;
|
|
12
|
-
readonly ADMIN_EMAIL: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const sender = new ConsoleEmailSender();
|
|
16
|
-
|
|
17
|
-
export default createMantleWorker<Env>({
|
|
18
|
-
plan,
|
|
19
|
-
cacheScope: "local-admin-otp",
|
|
20
|
-
siteDefaults: (env) => ({
|
|
21
|
-
brand: "Local Admin",
|
|
22
|
-
title: "Local Admin",
|
|
23
|
-
origin: originOf(env),
|
|
24
|
-
}),
|
|
25
|
-
auth: (env) => {
|
|
26
|
-
const origin = originOf(env);
|
|
27
|
-
const secret = required(env.BETTER_AUTH_SECRET, "BETTER_AUTH_SECRET");
|
|
28
|
-
const ownerEmail = required(env.ADMIN_EMAIL, "ADMIN_EMAIL");
|
|
29
|
-
return createAuth({
|
|
30
|
-
database: env.DB,
|
|
31
|
-
baseURL: origin,
|
|
32
|
-
secret,
|
|
33
|
-
methods: [{ kind: "email-otp", sender }],
|
|
34
|
-
bootstrapOwner: { match: "email", value: ownerEmail },
|
|
35
|
-
oauthProvider: {
|
|
36
|
-
loginPage: "/admin/sign-in",
|
|
37
|
-
consentPage: "/oauth/consent",
|
|
38
|
-
scopes: ["mcp"],
|
|
39
|
-
mcpResource: `${origin}/mcp`,
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
function originOf(env: Env): string {
|
|
46
|
-
return env.PUBLIC_ORIGIN?.replace(/\/+$/, "") ?? "http://127.0.0.1:8787";
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function required(value: string | undefined, name: string): string {
|
|
50
|
-
if (!value) {
|
|
51
|
-
throw new Error(`${name} is required. Copy .dev.vars.example to .dev.vars.`);
|
|
52
|
-
}
|
|
53
|
-
return value;
|
|
54
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"noEmit": true,
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
"types": [
|
|
10
|
-
"@cloudflare/workers-types"
|
|
11
|
-
]
|
|
12
|
-
},
|
|
13
|
-
"include": [
|
|
14
|
-
"src/**/*.ts",
|
|
15
|
-
".mantle/generated/**/*.ts"
|
|
16
|
-
]
|
|
17
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "node_modules/wrangler/config-schema.json",
|
|
3
|
-
"name": "mantle-local-admin-otp",
|
|
4
|
-
"main": "src/index.ts",
|
|
5
|
-
"compatibility_date": "2026-09-08",
|
|
6
|
-
"compatibility_flags": [
|
|
7
|
-
"nodejs_compat",
|
|
8
|
-
"global_fetch_strictly_public"
|
|
9
|
-
],
|
|
10
|
-
"observability": {
|
|
11
|
-
"enabled": true
|
|
12
|
-
},
|
|
13
|
-
"assets": {
|
|
14
|
-
"directory": "./public",
|
|
15
|
-
"binding": "ASSETS"
|
|
16
|
-
},
|
|
17
|
-
"d1_databases": [
|
|
18
|
-
{
|
|
19
|
-
"binding": "DB",
|
|
20
|
-
"database_name": "mantle-local-admin-otp"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Minimal Worker reference
|
|
2
|
-
|
|
3
|
-
This is a directly authored, API-only application and executable consumer test.
|
|
4
|
-
It is not a Starter, template catalog or CLI generator. Admin is opt-in; this
|
|
5
|
-
reference has none. When humans need a console, see
|
|
6
|
-
[`docs/examples/host-local-admin-otp`](../host-local-admin-otp/README.md). Business
|
|
7
|
-
Manifests live in the [Examples hub](../README.md). The notes
|
|
8
|
-
Schema/View is example business data; `mantle generate` never invents it.
|
|
9
|
-
|
|
10
|
-
For your own project, author package.json, manifests, Worker/provider config
|
|
11
|
-
and TypeScript settings for your requirements. Pin all selected `@aotter/mantle*`
|
|
12
|
-
dependencies to the same intended release. The checked-in `latest` values are
|
|
13
|
-
placeholders for Core's disposable release test; resolve and pin one exact
|
|
14
|
-
version before installing a copied application.
|
|
15
|
-
|
|
16
|
-
Outside the SDK workspace, with Node 22+ and pnpm 9+:
|
|
17
|
-
|
|
18
|
-
```sh
|
|
19
|
-
MANTLE_VERSION=$(pnpm view @aotter/mantle@latest version)
|
|
20
|
-
pnpm add --save-exact "@aotter/mantle@$MANTLE_VERSION" "@aotter/mantle-cloudflare@$MANTLE_VERSION"
|
|
21
|
-
pnpm check
|
|
22
|
-
pnpm dev
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Commit the resolved lockfile in a real application and use frozen installs
|
|
26
|
-
subsequently. `generate` writes `.mantle/generated/mantle.ts`; `skills` separately
|
|
27
|
-
projects version-matched instructions. Public GET `/api/views/published-notes`
|
|
28
|
-
returns an empty result against fresh local D1. `/` is 404: no visitor frontend
|
|
29
|
-
is installed or rendered. Auth routes fail closed until auth is configured.
|
|
30
|
-
No provider resources or secrets are needed for this local reference.
|
|
31
|
-
The View declares a one-hour shared-cache hint and the Worker supplies the
|
|
32
|
-
stable `minimal-worker-local` cache scope; authenticated requests remain private.
|
|
33
|
-
|
|
34
|
-
`mantle-web` is optional runtime document composition; it does not generate a
|
|
35
|
-
home page. Add application-owned routes/templates/frontend only when needed.
|
|
36
|
-
Configure real D1 identity and the chosen auth mode before any remote deploy;
|
|
37
|
-
never copy test names over an existing project's bindings or commit secrets.
|
|
38
|
-
|
|
39
|
-
Maintainers run `pnpm check:worker-consumer` from the SDK root for exact packed
|
|
40
|
-
packages. The release controller also runs the same check against public npm
|
|
41
|
-
artifacts before promoting any public channel.
|