@aotter/mantle 0.2.0-alpha.6 → 0.2.0-alpha.8
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 +157 -45
- package/dist/auth/adapter.d.ts +32 -0
- package/dist/auth/adapter.js +285 -0
- package/dist/auth/admin.d.ts +3 -0
- package/dist/auth/admin.js +21 -0
- package/dist/auth/caller.d.ts +86 -0
- package/dist/auth/caller.js +155 -0
- package/dist/auth/hardening.d.ts +24 -0
- package/dist/auth/hardening.js +40 -0
- package/dist/auth/identity.d.ts +121 -0
- package/dist/auth/identity.js +203 -0
- package/dist/auth/oauth.d.ts +63 -0
- package/dist/auth/oauth.js +217 -0
- package/dist/auth/resource-seeds.js +10 -0
- package/dist/auth/routes.d.ts +32 -0
- package/dist/auth/routes.js +225 -0
- package/dist/build/compiler.d.ts +712 -0
- package/dist/build/compiler.js +6896 -0
- package/dist/{spec → build/spec}/domain/model/ManifestGrammar.d.ts +30 -47
- package/dist/{spec → build/spec}/domain/model/RuntimePlan.d.ts +77 -3
- package/dist/{spec → build/spec}/domain/model/SqlIr.d.ts +37 -6
- package/dist/build/spec/domain/model/UserFields.d.ts +20 -0
- package/dist/{spec → build/spec}/domain/service/PlanFingerprint.d.ts +4 -1
- package/dist/{spec → build/spec}/kernel/diagnostic.d.ts +1 -30
- package/dist/bun/assets.d.ts +2 -0
- package/dist/bun/assets.js +24 -0
- package/dist/domain/adminOrder.js +24 -0
- package/dist/domain/columns.js +55 -0
- package/dist/domain/describe/chunk-ZVXBGP7Y.js +424 -0
- package/dist/domain/describe/index.d.ts +58 -0
- package/dist/domain/describe/index.js +115 -0
- package/dist/domain/describe/target-hash.d.ts +8 -0
- package/dist/domain/describe/target-hash.js +12 -0
- package/dist/domain/describe/targets.d.ts +40 -0
- package/dist/domain/entry.js +33 -0
- package/dist/domain/generated-tools.js +19 -0
- package/dist/domain/generation.d.ts +16 -0
- package/dist/domain/generation.js +1 -0
- package/dist/domain/input.js +17 -0
- package/dist/domain/model.js +1 -0
- package/dist/domain/paging.js +230 -0
- package/dist/domain/recipes.js +19 -0
- package/dist/domain/userReferences.js +5 -0
- package/dist/domain/wireScalars.js +47 -0
- package/dist/infrastructure/adminEntries.js +153 -0
- package/dist/infrastructure/adminPaging.js +72 -0
- package/dist/infrastructure/artifacts.js +71 -0
- package/dist/infrastructure/authSchema.js +83 -0
- package/dist/infrastructure/bundle.js +174 -0
- package/dist/infrastructure/cli.js +97 -0
- package/dist/infrastructure/generate.d.ts +12 -0
- package/dist/infrastructure/generate.js +174 -0
- package/dist/infrastructure/generateAuth.d.ts +8 -0
- package/dist/infrastructure/generateAuth.js +23 -0
- package/dist/infrastructure/inputs.js +41 -0
- package/dist/infrastructure/wrangler.js +94 -0
- package/dist/kernel/authorization.d.ts +4 -0
- package/dist/kernel/authorization.js +16 -0
- package/dist/kernel/binds.d.ts +51 -0
- package/dist/kernel/binds.js +45 -0
- package/dist/kernel/caller-identity.d.ts +24 -0
- package/dist/kernel/caller-identity.js +22 -0
- package/dist/kernel/contract-error.d.ts +12 -0
- package/dist/kernel/contract-error.js +14 -0
- package/dist/kernel/contracts.d.ts +139 -0
- package/dist/kernel/contracts.js +92 -0
- package/dist/{spec/domain/service/CloudflareCron.d.ts → kernel/cron.d.ts} +0 -1
- package/dist/{spec/domain/service/CloudflareCron.js → kernel/cron.js} +1 -6
- package/dist/kernel/dialect/common.d.ts +39 -0
- package/dist/kernel/dialect/common.js +6 -0
- package/dist/kernel/dialect/postgres.d.ts +16 -0
- package/dist/kernel/dialect/postgres.js +18 -0
- package/dist/kernel/dialect/sqlite.d.ts +20 -0
- package/dist/kernel/dialect/sqlite.js +34 -0
- package/dist/kernel/drain.d.ts +5 -0
- package/dist/kernel/drain.js +35 -0
- package/dist/kernel/driver/bun-sqlite.d.ts +19 -0
- package/dist/kernel/driver/bun-sqlite.js +77 -0
- package/dist/kernel/driver/d1.d.ts +24 -0
- package/dist/kernel/driver/d1.js +22 -0
- package/dist/kernel/driver/postgres.d.ts +25 -0
- package/dist/kernel/driver/postgres.js +98 -0
- package/dist/kernel/driver/transaction-context.d.ts +10 -0
- package/dist/kernel/driver/transaction-context.js +29 -0
- package/dist/kernel/email.d.ts +28 -0
- package/dist/{auth/emailTemplates.js → kernel/email.js} +13 -2
- package/dist/kernel/host-access.d.ts +10 -0
- package/dist/kernel/host-access.js +65 -0
- package/dist/kernel/host-caller.d.ts +39 -0
- package/dist/kernel/host-caller.js +56 -0
- package/dist/kernel/json-body.d.ts +4 -0
- package/dist/kernel/json-body.js +44 -0
- package/dist/kernel/mcp-apps.d.ts +69 -0
- package/dist/kernel/mcp-apps.js +40 -0
- package/dist/kernel/mcp-call.d.ts +5 -0
- package/dist/kernel/mcp-call.js +25 -0
- package/dist/kernel/mcp-handler.js +371 -0
- package/dist/kernel/mcp.d.ts +106 -0
- package/dist/kernel/mcp.js +49 -0
- package/dist/kernel/media.d.ts +27 -0
- package/dist/kernel/media.js +216 -0
- package/dist/kernel/paging.d.ts +55 -0
- package/dist/kernel/paging.js +95 -0
- package/dist/kernel/publishing.d.ts +4 -0
- package/dist/kernel/publishing.js +16 -0
- package/dist/{cloudflare/r2Media.d.ts → kernel/r2-media.d.ts} +4 -5
- package/dist/kernel/r2-media.js +78 -0
- package/dist/kernel/rest-dispatch.js +38 -0
- package/dist/kernel/rest-router.js +64 -0
- package/dist/kernel/rest.d.ts +58 -0
- package/dist/kernel/rest.js +41 -0
- package/dist/kernel/scalars.d.ts +6 -0
- package/dist/kernel/scalars.js +43 -0
- package/dist/kernel/search.js +5 -0
- package/dist/{core/site.d.ts → kernel/site-types.d.ts} +38 -9
- package/dist/kernel/site-types.js +1 -0
- package/dist/kernel/site.d.ts +39 -0
- package/dist/kernel/site.js +32 -0
- package/dist/kernel/store.d.ts +165 -0
- package/dist/kernel/store.js +257 -0
- package/dist/kernel/surface.d.ts +10 -0
- package/dist/kernel/surface.js +19 -0
- package/dist/kernel/sweep.d.ts +17 -0
- package/dist/kernel/sweep.js +27 -0
- package/dist/kernel/translations.d.ts +1 -0
- package/dist/kernel/translations.js +13 -0
- package/dist/kernel/user-caller.d.ts +31 -0
- package/dist/kernel/user-caller.js +67 -0
- package/dist/kernel/user-field-name.js +3 -0
- package/dist/kernel/user-fields.d.ts +34 -0
- package/dist/kernel/user-fields.js +71 -0
- package/dist/kernel/validation.d.ts +15 -0
- package/dist/kernel/validation.js +54 -0
- package/dist/kernel/web-gateway.js +68 -0
- package/dist/kernel/web-head.js +15 -0
- package/dist/kernel/web-response.js +8 -0
- package/dist/kernel/web.d.ts +77 -0
- package/dist/kernel/web.js +158 -0
- package/dist/kernel/where.js +27 -0
- package/dist/testing/index.d.ts +1 -37
- package/dist/testing/index.js +1 -43
- package/dist/usecase/adminBindings.js +141 -0
- package/dist/usecase/adminClient.js +87 -0
- package/dist/usecase/adminDescriptors.js +107 -0
- package/dist/usecase/generate.js +165 -0
- package/dist/usecase/handlers.js +21 -0
- package/dist/usecase/mcp-media.js +17 -0
- package/dist/usecase/mcp.js +100 -0
- package/dist/usecase/paging.js +71 -0
- package/dist/usecase/publishing.js +63 -0
- package/dist/usecase/refusals.js +27 -0
- package/dist/usecase/rest.js +54 -0
- package/dist/usecase/search.js +7 -0
- package/dist/usecase/site.js +40 -0
- package/dist/usecase/stores.js +62 -0
- package/dist/usecase/tool-version.js +9 -0
- package/dist/usecase/translations.js +78 -0
- package/dist/usecase/ttl.js +20 -0
- package/dist/usecase/validation.js +233 -0
- package/dist/usecase/web.js +23 -0
- package/docs/examples/README.md +31 -16
- package/docs/examples/app-shell/README.md +86 -0
- package/docs/examples/app-shell/package.json +42 -0
- package/docs/examples/app-shell/pnpm-workspace.yaml +8 -0
- package/docs/examples/app-shell/smoke-kit.mjs +154 -0
- package/docs/examples/app-shell/src/auth.ts +57 -0
- package/docs/examples/app-shell/src/handlers.ts +5 -0
- package/docs/examples/app-shell/src/index.ts +4 -0
- package/docs/examples/app-shell/src/routes.ts +13 -0
- package/docs/examples/app-shell/src/schedule.ts +8 -0
- package/docs/examples/app-shell/src/service.ts +70 -0
- package/docs/examples/app-shell/src/sign-in.ts +41 -0
- package/docs/examples/app-shell/src/signup.ts +8 -0
- package/docs/examples/{reference-service → app-shell}/tsconfig.json +6 -2
- package/docs/examples/app-shell/worker-configuration.d.ts +22 -0
- package/docs/examples/app-shell/wrangler.jsonc +62 -0
- package/docs/examples/club-events/README.md +60 -0
- package/docs/examples/club-events/manifests/club-events.yaml +225 -0
- package/docs/examples/club-events/smoke.mjs +121 -0
- package/docs/examples/club-events/src/handlers.ts +25 -0
- package/docs/examples/club-events/src/signup.ts +9 -0
- package/docs/examples/generated-web/README.md +78 -0
- package/docs/examples/generated-web/posts.yaml +38 -0
- package/docs/examples/generated-web/seed.sql +6 -0
- package/docs/examples/generated-web/src/worker.ts +43 -0
- package/docs/examples/generated-web/tsconfig.json +8 -0
- package/docs/examples/generated-web/wrangler.jsonc +8 -0
- package/docs/examples/purchasing/.dev.vars.example +6 -0
- package/docs/examples/purchasing/README.md +90 -0
- package/docs/examples/purchasing/manifests/purchasing.yaml +341 -0
- package/docs/examples/purchasing/seed.sql +4 -0
- package/docs/examples/purchasing/smoke.mjs +177 -0
- package/docs/examples/purchasing/src/admin.tsx +13 -0
- package/docs/examples/purchasing/src/handlers.ts +33 -0
- package/docs/examples/purchasing/src/notify.ts +29 -0
- package/docs/examples/purchasing/src/requests-page.ts +57 -0
- package/docs/examples/purchasing/src/routes.ts +53 -0
- package/docs/examples/purchasing/src/schedule.ts +31 -0
- package/docs/examples/purchasing/src/signup.ts +5 -0
- package/docs/examples/purchasing/src/supplier.ts +32 -0
- package/docs/examples/purchasing/wrangler.jsonc +69 -0
- package/docs/examples/recipes/README.md +58 -0
- package/docs/examples/recipes/manifests/recipes.yaml +75 -0
- package/docs/examples/recipes/smoke.mjs +102 -0
- package/docs/examples/recipes/src/media.ts +13 -0
- package/docs/examples/recipes/src/pages.ts +99 -0
- package/docs/examples/recipes/src/routes.ts +71 -0
- package/docs/examples/recipes/src/site-config.ts +12 -0
- package/docs/examples/recipes/wrangler.jsonc +74 -0
- package/docs/handbook/cloudflare/authentication.md +164 -214
- package/docs/handbook/cloudflare/chatgpt-sites.md +4 -113
- package/docs/handbook/cloudflare/deploy-and-operate.md +38 -103
- package/docs/handbook/cloudflare/media-r2.md +62 -133
- package/docs/handbook/cloudflare/service-entry.md +210 -119
- package/docs/handbook/concepts/authorization.md +10 -123
- package/docs/handbook/concepts/four-atoms.md +9 -92
- package/docs/handbook/concepts/lifecycle-and-locales.md +9 -80
- package/docs/handbook/concepts/mcp-and-agents.md +24 -136
- package/docs/handbook/concepts/procedures-and-triggers.md +5 -162
- package/docs/handbook/concepts/runtime-and-adapters.md +15 -224
- package/docs/handbook/concepts/views.md +10 -109
- package/docs/handbook/examples/hub.md +2 -18
- package/docs/handbook/guides/adapter-guide.md +11 -0
- package/docs/handbook/guides/admin-ui.md +111 -164
- package/docs/handbook/guides/agent-setup.md +32 -27
- package/docs/handbook/guides/email.md +86 -0
- package/docs/handbook/guides/mcp-apps.md +483 -0
- package/docs/handbook/guides/native-admin.md +543 -0
- package/docs/handbook/guides/native-execution.md +132 -0
- package/docs/handbook/guides/oauth.md +161 -0
- package/docs/handbook/guides/postgres-adapters.md +56 -0
- package/docs/handbook/guides/public-pages.md +53 -0
- package/docs/handbook/guides/size-and-startup.md +9 -0
- package/docs/handbook/guides/typed-queries.md +39 -102
- package/docs/handbook/navigation.json +160 -31
- package/docs/handbook/reference/admin-descriptors.md +53 -0
- package/docs/handbook/reference/authorization.md +44 -52
- package/docs/handbook/reference/describe.md +56 -0
- package/docs/handbook/reference/diagnostics.md +15 -79
- package/docs/handbook/reference/features.md +45 -53
- package/docs/handbook/reference/manifest.md +6 -69
- package/docs/handbook/reference/procedure.md +11 -116
- package/docs/handbook/reference/schema.md +85 -185
- package/docs/handbook/reference/site-config.md +5 -65
- package/docs/handbook/reference/surface.md +389 -97
- package/docs/handbook/reference/trigger.md +54 -90
- package/docs/handbook/reference/view.md +32 -160
- package/docs/handbook/releases/index.md +120 -13
- package/docs/handbook/start/overview.md +9 -56
- package/docs/handbook/start/project-and-cli.md +40 -149
- package/docs/handbook/start/quickstart-worker.md +38 -116
- package/docs/skills/develop/SKILL.md +35 -123
- package/docs/skills/develop/mcp-app.md +37 -77
- package/docs/skills/integrate/SKILL.md +42 -84
- package/docs/skills/media-gc/SKILL.md +21 -8
- package/docs/skills/provision/SKILL.md +28 -91
- package/docs/skills/update/SKILL.md +19 -43
- package/docs/source/scripts/postgres-adapter.ts +101 -0
- package/docs/upgrade-0.1-to-0.2.md +25 -9
- package/package.json +97 -112
- package/skills/.keep +0 -0
- package/skills/README.md +67 -0
- package/skills/mantle/SKILL.md +135 -0
- package/skills/mantle/references/local-testing.md +15 -0
- package/skills/mantle/references/web.md +41 -0
- package/skills/mantle/references/website.md +49 -0
- package/dist/admin/consent.d.ts +0 -17
- package/dist/admin/consent.d.ts.map +0 -1
- package/dist/admin/consent.js +0 -17
- package/dist/admin/consent.js.map +0 -1
- package/dist/admin/createAdminSurface.d.ts +0 -25
- package/dist/admin/createAdminSurface.d.ts.map +0 -1
- package/dist/admin/createAdminSurface.js +0 -635
- package/dist/admin/createAdminSurface.js.map +0 -1
- package/dist/admin/design.d.ts +0 -7
- package/dist/admin/design.d.ts.map +0 -1
- package/dist/admin/design.js +0 -18
- package/dist/admin/design.js.map +0 -1
- package/dist/admin/developerConsole.d.ts +0 -267
- package/dist/admin/developerConsole.d.ts.map +0 -1
- package/dist/admin/developerConsole.js +0 -136
- package/dist/admin/developerConsole.js.map +0 -1
- package/dist/admin/extensions.d.ts +0 -290
- package/dist/admin/extensions.d.ts.map +0 -1
- package/dist/admin/extensions.js +0 -532
- package/dist/admin/extensions.js.map +0 -1
- package/dist/admin/identity.d.ts +0 -62
- package/dist/admin/identity.d.ts.map +0 -1
- package/dist/admin/identity.js +0 -7
- package/dist/admin/identity.js.map +0 -1
- package/dist/admin/index.d.ts +0 -7
- package/dist/admin/index.d.ts.map +0 -1
- package/dist/admin/index.js +0 -7
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/procedureFlow.d.ts +0 -38
- package/dist/admin/procedureFlow.d.ts.map +0 -1
- package/dist/admin/procedureFlow.js +0 -188
- package/dist/admin/procedureFlow.js.map +0 -1
- package/dist/auth/ConsoleEmailSender.d.ts +0 -15
- package/dist/auth/ConsoleEmailSender.d.ts.map +0 -1
- package/dist/auth/ConsoleEmailSender.js +0 -19
- package/dist/auth/ConsoleEmailSender.js.map +0 -1
- package/dist/auth/appleClientSecret.d.ts +0 -75
- package/dist/auth/appleClientSecret.d.ts.map +0 -1
- package/dist/auth/appleClientSecret.js +0 -116
- package/dist/auth/appleClientSecret.js.map +0 -1
- package/dist/auth/buildAuth.d.ts +0 -4568
- package/dist/auth/buildAuth.d.ts.map +0 -1
- package/dist/auth/buildAuth.js +0 -312
- package/dist/auth/buildAuth.js.map +0 -1
- package/dist/auth/callerResolver.d.ts +0 -52
- package/dist/auth/callerResolver.d.ts.map +0 -1
- package/dist/auth/callerResolver.js +0 -52
- package/dist/auth/callerResolver.js.map +0 -1
- package/dist/auth/createAuthRoutes.d.ts +0 -22
- package/dist/auth/createAuthRoutes.d.ts.map +0 -1
- package/dist/auth/createAuthRoutes.js +0 -129
- package/dist/auth/createAuthRoutes.js.map +0 -1
- package/dist/auth/createMantleAuth.d.ts +0 -3
- package/dist/auth/createMantleAuth.d.ts.map +0 -1
- package/dist/auth/createMantleAuth.js +0 -504
- package/dist/auth/createMantleAuth.js.map +0 -1
- package/dist/auth/db.d.ts +0 -18
- package/dist/auth/db.d.ts.map +0 -1
- package/dist/auth/db.js +0 -27
- package/dist/auth/db.js.map +0 -1
- package/dist/auth/emailTemplates.d.ts +0 -7
- package/dist/auth/emailTemplates.d.ts.map +0 -1
- package/dist/auth/emailTemplates.js.map +0 -1
- package/dist/auth/index.d.ts +0 -9
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -7
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/methods.d.ts +0 -717
- package/dist/auth/methods.d.ts.map +0 -1
- package/dist/auth/methods.js +0 -321
- package/dist/auth/methods.js.map +0 -1
- package/dist/auth/oauthTokens.d.ts +0 -24
- package/dist/auth/oauthTokens.d.ts.map +0 -1
- package/dist/auth/oauthTokens.js +0 -146
- package/dist/auth/oauthTokens.js.map +0 -1
- package/dist/auth/setupIncomplete.d.ts +0 -16
- package/dist/auth/setupIncomplete.d.ts.map +0 -1
- package/dist/auth/setupIncomplete.js +0 -50
- package/dist/auth/setupIncomplete.js.map +0 -1
- package/dist/auth/types.d.ts +0 -440
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js +0 -10
- package/dist/auth/types.js.map +0 -1
- package/dist/bun/index.d.ts +0 -21
- package/dist/bun/index.d.ts.map +0 -1
- package/dist/bun/index.js +0 -46
- package/dist/bun/index.js.map +0 -1
- package/dist/cli/emitModule.d.ts +0 -7
- package/dist/cli/emitModule.d.ts.map +0 -1
- package/dist/cli/emitModule.js +0 -127
- package/dist/cli/emitModule.js.map +0 -1
- package/dist/cli/generate.d.ts +0 -8
- package/dist/cli/generate.d.ts.map +0 -1
- package/dist/cli/generate.js +0 -391
- package/dist/cli/generate.js.map +0 -1
- package/dist/cli/main.d.ts +0 -3
- package/dist/cli/main.d.ts.map +0 -1
- package/dist/cli/main.js +0 -21
- package/dist/cli/main.js.map +0 -1
- package/dist/cli/preset.d.ts +0 -18
- package/dist/cli/preset.d.ts.map +0 -1
- package/dist/cli/preset.js +0 -405
- package/dist/cli/preset.js.map +0 -1
- package/dist/cloudflare/index.d.ts +0 -25
- package/dist/cloudflare/index.d.ts.map +0 -1
- package/dist/cloudflare/index.js +0 -16
- package/dist/cloudflare/index.js.map +0 -1
- package/dist/cloudflare/r2Media.d.ts.map +0 -1
- package/dist/cloudflare/r2Media.js +0 -69
- package/dist/cloudflare/r2Media.js.map +0 -1
- package/dist/core/caller.d.ts +0 -35
- package/dist/core/caller.d.ts.map +0 -1
- package/dist/core/caller.js +0 -3
- package/dist/core/caller.js.map +0 -1
- package/dist/core/createMantle.d.ts +0 -22
- package/dist/core/createMantle.d.ts.map +0 -1
- package/dist/core/createMantle.js +0 -117
- package/dist/core/createMantle.js.map +0 -1
- package/dist/core/dialect.d.ts +0 -53
- package/dist/core/dialect.d.ts.map +0 -1
- package/dist/core/dialect.js +0 -7
- package/dist/core/dialect.js.map +0 -1
- package/dist/core/driver.d.ts +0 -24
- package/dist/core/driver.d.ts.map +0 -1
- package/dist/core/driver.js +0 -2
- package/dist/core/driver.js.map +0 -1
- package/dist/core/email.d.ts +0 -17
- package/dist/core/email.d.ts.map +0 -1
- package/dist/core/email.js +0 -2
- package/dist/core/email.js.map +0 -1
- package/dist/core/index.d.ts +0 -16
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -16
- package/dist/core/index.js.map +0 -1
- package/dist/core/invocation.d.ts +0 -66
- package/dist/core/invocation.d.ts.map +0 -1
- package/dist/core/invocation.js +0 -3
- package/dist/core/invocation.js.map +0 -1
- package/dist/core/observation.d.ts +0 -3
- package/dist/core/observation.d.ts.map +0 -1
- package/dist/core/observation.js +0 -10
- package/dist/core/observation.js.map +0 -1
- package/dist/core/runtime/auth.d.ts +0 -9
- package/dist/core/runtime/auth.d.ts.map +0 -1
- package/dist/core/runtime/auth.js +0 -39
- package/dist/core/runtime/auth.js.map +0 -1
- package/dist/core/runtime/createRuntime.d.ts +0 -23
- package/dist/core/runtime/createRuntime.d.ts.map +0 -1
- package/dist/core/runtime/createRuntime.js +0 -214
- package/dist/core/runtime/createRuntime.js.map +0 -1
- package/dist/core/runtime/verifyPlan.d.ts +0 -34
- package/dist/core/runtime/verifyPlan.d.ts.map +0 -1
- package/dist/core/runtime/verifyPlan.js +0 -301
- package/dist/core/runtime/verifyPlan.js.map +0 -1
- package/dist/core/service.d.ts +0 -45
- package/dist/core/service.d.ts.map +0 -1
- package/dist/core/service.js +0 -2
- package/dist/core/service.js.map +0 -1
- package/dist/core/sessionUser.d.ts +0 -14
- package/dist/core/sessionUser.d.ts.map +0 -1
- package/dist/core/sessionUser.js +0 -4
- package/dist/core/sessionUser.js.map +0 -1
- package/dist/core/site.d.ts.map +0 -1
- package/dist/core/site.js +0 -2
- package/dist/core/site.js.map +0 -1
- package/dist/core/siteConfig.d.ts +0 -5
- package/dist/core/siteConfig.d.ts.map +0 -1
- package/dist/core/siteConfig.js +0 -24
- package/dist/core/siteConfig.js.map +0 -1
- package/dist/core/sql/allowlist.d.ts +0 -67
- package/dist/core/sql/allowlist.d.ts.map +0 -1
- package/dist/core/sql/allowlist.js +0 -737
- package/dist/core/sql/allowlist.js.map +0 -1
- package/dist/core/sql/ast.d.ts +0 -24
- package/dist/core/sql/ast.d.ts.map +0 -1
- package/dist/core/sql/ast.js +0 -32
- package/dist/core/sql/ast.js.map +0 -1
- package/dist/core/sql/compile.d.ts +0 -50
- package/dist/core/sql/compile.d.ts.map +0 -1
- package/dist/core/sql/compile.js +0 -48
- package/dist/core/sql/compile.js.map +0 -1
- package/dist/core/sql/policy.d.ts +0 -123
- package/dist/core/sql/policy.d.ts.map +0 -1
- package/dist/core/sql/policy.js +0 -398
- package/dist/core/sql/policy.js.map +0 -1
- package/dist/core/sql/positions.d.ts +0 -30
- package/dist/core/sql/positions.d.ts.map +0 -1
- package/dist/core/sql/positions.js +0 -22
- package/dist/core/sql/positions.js.map +0 -1
- package/dist/core/sql/run.d.ts +0 -68
- package/dist/core/sql/run.d.ts.map +0 -1
- package/dist/core/sql/run.js +0 -384
- package/dist/core/sql/run.js.map +0 -1
- package/dist/core/store/createStore.d.ts +0 -49
- package/dist/core/store/createStore.d.ts.map +0 -1
- package/dist/core/store/createStore.js +0 -227
- package/dist/core/store/createStore.js.map +0 -1
- package/dist/core/store/cursor.d.ts +0 -4
- package/dist/core/store/cursor.d.ts.map +0 -1
- package/dist/core/store/cursor.js +0 -22
- package/dist/core/store/cursor.js.map +0 -1
- package/dist/core/store/json.d.ts +0 -80
- package/dist/core/store/json.d.ts.map +0 -1
- package/dist/core/store/json.js +0 -342
- package/dist/core/store/json.js.map +0 -1
- package/dist/core/store.d.ts +0 -160
- package/dist/core/store.d.ts.map +0 -1
- package/dist/core/store.js +0 -2
- package/dist/core/store.js.map +0 -1
- package/dist/core/wire.d.ts +0 -20
- package/dist/core/wire.d.ts.map +0 -1
- package/dist/core/wire.js +0 -84
- package/dist/core/wire.js.map +0 -1
- package/dist/core/withCaller.d.ts +0 -24
- package/dist/core/withCaller.d.ts.map +0 -1
- package/dist/core/withCaller.js +0 -35
- package/dist/core/withCaller.js.map +0 -1
- package/dist/d1/adapter.d.ts +0 -12
- package/dist/d1/adapter.d.ts.map +0 -1
- package/dist/d1/adapter.js +0 -23
- package/dist/d1/adapter.js.map +0 -1
- package/dist/d1/codec.d.ts +0 -14
- package/dist/d1/codec.d.ts.map +0 -1
- package/dist/d1/codec.js +0 -136
- package/dist/d1/codec.js.map +0 -1
- package/dist/d1/compile/index.d.ts +0 -9
- package/dist/d1/compile/index.d.ts.map +0 -1
- package/dist/d1/compile/index.js +0 -9
- package/dist/d1/compile/index.js.map +0 -1
- package/dist/d1/dialect.d.ts +0 -4
- package/dist/d1/dialect.d.ts.map +0 -1
- package/dist/d1/dialect.js +0 -13
- package/dist/d1/dialect.js.map +0 -1
- package/dist/d1/executor.d.ts +0 -15
- package/dist/d1/executor.d.ts.map +0 -1
- package/dist/d1/executor.js +0 -96
- package/dist/d1/executor.js.map +0 -1
- package/dist/d1/index.d.ts +0 -6
- package/dist/d1/index.d.ts.map +0 -1
- package/dist/d1/index.js +0 -6
- package/dist/d1/index.js.map +0 -1
- package/dist/d1/lower.d.ts +0 -8
- package/dist/d1/lower.d.ts.map +0 -1
- package/dist/d1/lower.js +0 -167
- package/dist/d1/lower.js.map +0 -1
- package/dist/d1/media.d.ts +0 -5
- package/dist/d1/media.d.ts.map +0 -1
- package/dist/d1/media.js +0 -157
- package/dist/d1/media.js.map +0 -1
- package/dist/d1/migrations.d.ts +0 -12
- package/dist/d1/migrations.d.ts.map +0 -1
- package/dist/d1/migrations.js +0 -111
- package/dist/d1/migrations.js.map +0 -1
- package/dist/d1/print.d.ts +0 -28
- package/dist/d1/print.d.ts.map +0 -1
- package/dist/d1/print.js +0 -54
- package/dist/d1/print.js.map +0 -1
- package/dist/d1/site.d.ts +0 -17
- package/dist/d1/site.d.ts.map +0 -1
- package/dist/d1/site.js +0 -63
- package/dist/d1/site.js.map +0 -1
- package/dist/d1/storage.d.ts +0 -34
- package/dist/d1/storage.d.ts.map +0 -1
- package/dist/d1/storage.js +0 -288
- package/dist/d1/storage.js.map +0 -1
- package/dist/d1/tz.d.ts +0 -21
- package/dist/d1/tz.d.ts.map +0 -1
- package/dist/d1/tz.js +0 -54
- package/dist/d1/tz.js.map +0 -1
- package/dist/d1/validator.d.ts +0 -10
- package/dist/d1/validator.d.ts.map +0 -1
- package/dist/d1/validator.js +0 -33
- package/dist/d1/validator.js.map +0 -1
- package/dist/mcp/apps.d.ts +0 -43
- package/dist/mcp/apps.d.ts.map +0 -1
- package/dist/mcp/apps.js +0 -57
- package/dist/mcp/apps.js.map +0 -1
- package/dist/mcp/catalog.d.ts +0 -55
- package/dist/mcp/catalog.d.ts.map +0 -1
- package/dist/mcp/catalog.js +0 -81
- package/dist/mcp/catalog.js.map +0 -1
- package/dist/mcp/createMcpSurface.d.ts +0 -60
- package/dist/mcp/createMcpSurface.d.ts.map +0 -1
- package/dist/mcp/createMcpSurface.js +0 -182
- package/dist/mcp/createMcpSurface.js.map +0 -1
- package/dist/mcp/index.d.ts +0 -4
- package/dist/mcp/index.d.ts.map +0 -1
- package/dist/mcp/index.js +0 -4
- package/dist/mcp/index.js.map +0 -1
- package/dist/mcp/media.d.ts +0 -9
- package/dist/mcp/media.d.ts.map +0 -1
- package/dist/mcp/media.js +0 -33
- package/dist/mcp/media.js.map +0 -1
- package/dist/postgres/adapter.d.ts +0 -23
- package/dist/postgres/adapter.d.ts.map +0 -1
- package/dist/postgres/adapter.js +0 -50
- package/dist/postgres/adapter.js.map +0 -1
- package/dist/postgres/codec.d.ts +0 -13
- package/dist/postgres/codec.d.ts.map +0 -1
- package/dist/postgres/codec.js +0 -110
- package/dist/postgres/codec.js.map +0 -1
- package/dist/postgres/compile/index.d.ts +0 -9
- package/dist/postgres/compile/index.d.ts.map +0 -1
- package/dist/postgres/compile/index.js +0 -9
- package/dist/postgres/compile/index.js.map +0 -1
- package/dist/postgres/driver.d.ts +0 -109
- package/dist/postgres/driver.d.ts.map +0 -1
- package/dist/postgres/driver.js +0 -186
- package/dist/postgres/driver.js.map +0 -1
- package/dist/postgres/executor.d.ts +0 -28
- package/dist/postgres/executor.d.ts.map +0 -1
- package/dist/postgres/executor.js +0 -96
- package/dist/postgres/executor.js.map +0 -1
- package/dist/postgres/index.d.ts +0 -8
- package/dist/postgres/index.d.ts.map +0 -1
- package/dist/postgres/index.js +0 -8
- package/dist/postgres/index.js.map +0 -1
- package/dist/postgres/lower.d.ts +0 -6
- package/dist/postgres/lower.d.ts.map +0 -1
- package/dist/postgres/lower.js +0 -152
- package/dist/postgres/lower.js.map +0 -1
- package/dist/postgres/print.d.ts +0 -11
- package/dist/postgres/print.d.ts.map +0 -1
- package/dist/postgres/print.js +0 -108
- package/dist/postgres/print.js.map +0 -1
- package/dist/postgres/session.d.ts +0 -9
- package/dist/postgres/session.d.ts.map +0 -1
- package/dist/postgres/session.js +0 -111
- package/dist/postgres/session.js.map +0 -1
- package/dist/postgres/storage.d.ts +0 -32
- package/dist/postgres/storage.d.ts.map +0 -1
- package/dist/postgres/storage.js +0 -283
- package/dist/postgres/storage.js.map +0 -1
- package/dist/postgres/validator.d.ts +0 -13
- package/dist/postgres/validator.d.ts.map +0 -1
- package/dist/postgres/validator.js +0 -53
- package/dist/postgres/validator.js.map +0 -1
- package/dist/spec/domain/index.d.ts +0 -3
- package/dist/spec/domain/index.d.ts.map +0 -1
- package/dist/spec/domain/index.js +0 -3
- package/dist/spec/domain/index.js.map +0 -1
- package/dist/spec/domain/model/ContentState.d.ts +0 -8
- package/dist/spec/domain/model/ContentState.d.ts.map +0 -1
- package/dist/spec/domain/model/ContentState.js +0 -7
- package/dist/spec/domain/model/ContentState.js.map +0 -1
- package/dist/spec/domain/model/Entry.d.ts +0 -29
- package/dist/spec/domain/model/Entry.d.ts.map +0 -1
- package/dist/spec/domain/model/Entry.js +0 -16
- package/dist/spec/domain/model/Entry.js.map +0 -1
- package/dist/spec/domain/model/Locale.d.ts +0 -30
- package/dist/spec/domain/model/Locale.d.ts.map +0 -1
- package/dist/spec/domain/model/Locale.js +0 -33
- package/dist/spec/domain/model/Locale.js.map +0 -1
- package/dist/spec/domain/model/ManifestGrammar.d.ts.map +0 -1
- package/dist/spec/domain/model/ManifestGrammar.js +0 -153
- package/dist/spec/domain/model/ManifestGrammar.js.map +0 -1
- package/dist/spec/domain/model/MediaMimeAccept.d.ts +0 -55
- package/dist/spec/domain/model/MediaMimeAccept.d.ts.map +0 -1
- package/dist/spec/domain/model/MediaMimeAccept.js +0 -90
- package/dist/spec/domain/model/MediaMimeAccept.js.map +0 -1
- package/dist/spec/domain/model/RuntimePlan.d.ts.map +0 -1
- package/dist/spec/domain/model/RuntimePlan.js +0 -4
- package/dist/spec/domain/model/RuntimePlan.js.map +0 -1
- package/dist/spec/domain/model/SiteConfig.d.ts +0 -173
- package/dist/spec/domain/model/SiteConfig.d.ts.map +0 -1
- package/dist/spec/domain/model/SiteConfig.js +0 -13
- package/dist/spec/domain/model/SiteConfig.js.map +0 -1
- package/dist/spec/domain/model/SqlIr.d.ts.map +0 -1
- package/dist/spec/domain/model/SqlIr.js +0 -95
- package/dist/spec/domain/model/SqlIr.js.map +0 -1
- package/dist/spec/domain/model/index.d.ts +0 -14
- package/dist/spec/domain/model/index.d.ts.map +0 -1
- package/dist/spec/domain/model/index.js +0 -14
- package/dist/spec/domain/model/index.js.map +0 -1
- package/dist/spec/domain/service/CloudflareCron.d.ts.map +0 -1
- package/dist/spec/domain/service/CloudflareCron.js.map +0 -1
- package/dist/spec/domain/service/CrossSchemaChecker.d.ts +0 -34
- package/dist/spec/domain/service/CrossSchemaChecker.d.ts.map +0 -1
- package/dist/spec/domain/service/CrossSchemaChecker.js +0 -114
- package/dist/spec/domain/service/CrossSchemaChecker.js.map +0 -1
- package/dist/spec/domain/service/EntryDataValidator.d.ts +0 -56
- package/dist/spec/domain/service/EntryDataValidator.d.ts.map +0 -1
- package/dist/spec/domain/service/EntryDataValidator.js +0 -88
- package/dist/spec/domain/service/EntryDataValidator.js.map +0 -1
- package/dist/spec/domain/service/JsonSchemaToZod.d.ts +0 -29
- package/dist/spec/domain/service/JsonSchemaToZod.d.ts.map +0 -1
- package/dist/spec/domain/service/JsonSchemaToZod.js +0 -156
- package/dist/spec/domain/service/JsonSchemaToZod.js.map +0 -1
- package/dist/spec/domain/service/LifecycleStateMachine.d.ts +0 -75
- package/dist/spec/domain/service/LifecycleStateMachine.d.ts.map +0 -1
- package/dist/spec/domain/service/LifecycleStateMachine.js +0 -76
- package/dist/spec/domain/service/LifecycleStateMachine.js.map +0 -1
- package/dist/spec/domain/service/LocaleCanonicalizer.d.ts +0 -29
- package/dist/spec/domain/service/LocaleCanonicalizer.d.ts.map +0 -1
- package/dist/spec/domain/service/LocaleCanonicalizer.js +0 -96
- package/dist/spec/domain/service/LocaleCanonicalizer.js.map +0 -1
- package/dist/spec/domain/service/ManifestFieldChecks.d.ts +0 -60
- package/dist/spec/domain/service/ManifestFieldChecks.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestFieldChecks.js +0 -116
- package/dist/spec/domain/service/ManifestFieldChecks.js.map +0 -1
- package/dist/spec/domain/service/ManifestGraphValidator.d.ts +0 -15
- package/dist/spec/domain/service/ManifestGraphValidator.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestGraphValidator.js +0 -225
- package/dist/spec/domain/service/ManifestGraphValidator.js.map +0 -1
- package/dist/spec/domain/service/ManifestLinker.d.ts +0 -45
- package/dist/spec/domain/service/ManifestLinker.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestLinker.js +0 -92
- package/dist/spec/domain/service/ManifestLinker.js.map +0 -1
- package/dist/spec/domain/service/ManifestLocaleTrimmer.d.ts +0 -16
- package/dist/spec/domain/service/ManifestLocaleTrimmer.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestLocaleTrimmer.js +0 -76
- package/dist/spec/domain/service/ManifestLocaleTrimmer.js.map +0 -1
- package/dist/spec/domain/service/ManifestParser.d.ts +0 -49
- package/dist/spec/domain/service/ManifestParser.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestParser.js +0 -203
- package/dist/spec/domain/service/ManifestParser.js.map +0 -1
- package/dist/spec/domain/service/ManifestPartition.d.ts +0 -9
- package/dist/spec/domain/service/ManifestPartition.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestPartition.js +0 -19
- package/dist/spec/domain/service/ManifestPartition.js.map +0 -1
- package/dist/spec/domain/service/ManifestPathDiagnoser.d.ts +0 -33
- package/dist/spec/domain/service/ManifestPathDiagnoser.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestPathDiagnoser.js +0 -43
- package/dist/spec/domain/service/ManifestPathDiagnoser.js.map +0 -1
- package/dist/spec/domain/service/ManifestSourceSpans.d.ts +0 -10
- package/dist/spec/domain/service/ManifestSourceSpans.d.ts.map +0 -1
- package/dist/spec/domain/service/ManifestSourceSpans.js +0 -76
- package/dist/spec/domain/service/ManifestSourceSpans.js.map +0 -1
- package/dist/spec/domain/service/McpToolNaming.d.ts +0 -25
- package/dist/spec/domain/service/McpToolNaming.d.ts.map +0 -1
- package/dist/spec/domain/service/McpToolNaming.js +0 -50
- package/dist/spec/domain/service/McpToolNaming.js.map +0 -1
- package/dist/spec/domain/service/PlanFingerprint.d.ts.map +0 -1
- package/dist/spec/domain/service/PlanFingerprint.js +0 -14
- package/dist/spec/domain/service/PlanFingerprint.js.map +0 -1
- package/dist/spec/domain/service/ProcedureViewSpecChecks.d.ts +0 -4
- package/dist/spec/domain/service/ProcedureViewSpecChecks.d.ts.map +0 -1
- package/dist/spec/domain/service/ProcedureViewSpecChecks.js +0 -211
- package/dist/spec/domain/service/ProcedureViewSpecChecks.js.map +0 -1
- package/dist/spec/domain/service/SchemaAdminUiChecker.d.ts +0 -44
- package/dist/spec/domain/service/SchemaAdminUiChecker.d.ts.map +0 -1
- package/dist/spec/domain/service/SchemaAdminUiChecker.js +0 -333
- package/dist/spec/domain/service/SchemaAdminUiChecker.js.map +0 -1
- package/dist/spec/domain/service/SchemaIndexChecker.d.ts +0 -33
- package/dist/spec/domain/service/SchemaIndexChecker.d.ts.map +0 -1
- package/dist/spec/domain/service/SchemaIndexChecker.js +0 -256
- package/dist/spec/domain/service/SchemaIndexChecker.js.map +0 -1
- package/dist/spec/domain/service/SchemaSearchChecker.d.ts +0 -11
- package/dist/spec/domain/service/SchemaSearchChecker.d.ts.map +0 -1
- package/dist/spec/domain/service/SchemaSearchChecker.js +0 -78
- package/dist/spec/domain/service/SchemaSearchChecker.js.map +0 -1
- package/dist/spec/domain/service/SchemaSpecChecks.d.ts +0 -31
- package/dist/spec/domain/service/SchemaSpecChecks.d.ts.map +0 -1
- package/dist/spec/domain/service/SchemaSpecChecks.js +0 -445
- package/dist/spec/domain/service/SchemaSpecChecks.js.map +0 -1
- package/dist/spec/domain/service/SiteDefaultsValidator.d.ts +0 -39
- package/dist/spec/domain/service/SiteDefaultsValidator.d.ts.map +0 -1
- package/dist/spec/domain/service/SiteDefaultsValidator.js +0 -194
- package/dist/spec/domain/service/SiteDefaultsValidator.js.map +0 -1
- package/dist/spec/domain/service/SqlClassify.d.ts +0 -19
- package/dist/spec/domain/service/SqlClassify.d.ts.map +0 -1
- package/dist/spec/domain/service/SqlClassify.js +0 -42
- package/dist/spec/domain/service/SqlClassify.js.map +0 -1
- package/dist/spec/domain/service/SqlRefusal.d.ts +0 -16
- package/dist/spec/domain/service/SqlRefusal.d.ts.map +0 -1
- package/dist/spec/domain/service/SqlRefusal.js +0 -20
- package/dist/spec/domain/service/SqlRefusal.js.map +0 -1
- package/dist/spec/domain/service/SqlTypes.d.ts +0 -40
- package/dist/spec/domain/service/SqlTypes.d.ts.map +0 -1
- package/dist/spec/domain/service/SqlTypes.js +0 -110
- package/dist/spec/domain/service/SqlTypes.js.map +0 -1
- package/dist/spec/domain/service/StaffRoleHierarchy.d.ts +0 -3
- package/dist/spec/domain/service/StaffRoleHierarchy.d.ts.map +0 -1
- package/dist/spec/domain/service/StaffRoleHierarchy.js +0 -19
- package/dist/spec/domain/service/StaffRoleHierarchy.js.map +0 -1
- package/dist/spec/domain/service/TriggerGraphChecks.d.ts +0 -16
- package/dist/spec/domain/service/TriggerGraphChecks.d.ts.map +0 -1
- package/dist/spec/domain/service/TriggerGraphChecks.js +0 -337
- package/dist/spec/domain/service/TriggerGraphChecks.js.map +0 -1
- package/dist/spec/domain/service/TriggerSpecChecks.d.ts +0 -4
- package/dist/spec/domain/service/TriggerSpecChecks.d.ts.map +0 -1
- package/dist/spec/domain/service/TriggerSpecChecks.js +0 -89
- package/dist/spec/domain/service/TriggerSpecChecks.js.map +0 -1
- package/dist/spec/domain/service/ValidatedAdminUiProjection.d.ts +0 -11
- package/dist/spec/domain/service/ValidatedAdminUiProjection.d.ts.map +0 -1
- package/dist/spec/domain/service/ValidatedAdminUiProjection.js +0 -26
- package/dist/spec/domain/service/ValidatedAdminUiProjection.js.map +0 -1
- package/dist/spec/domain/service/ViewAdminUiChecker.d.ts +0 -14
- package/dist/spec/domain/service/ViewAdminUiChecker.d.ts.map +0 -1
- package/dist/spec/domain/service/ViewAdminUiChecker.js +0 -58
- package/dist/spec/domain/service/ViewAdminUiChecker.js.map +0 -1
- package/dist/spec/domain/service/index.d.ts +0 -24
- package/dist/spec/domain/service/index.d.ts.map +0 -1
- package/dist/spec/domain/service/index.js +0 -24
- package/dist/spec/domain/service/index.js.map +0 -1
- package/dist/spec/index.d.ts +0 -10
- package/dist/spec/index.d.ts.map +0 -1
- package/dist/spec/index.js +0 -12
- package/dist/spec/index.js.map +0 -1
- package/dist/spec/infrastructure/cli/parseArgsError.d.ts +0 -16
- package/dist/spec/infrastructure/cli/parseArgsError.d.ts.map +0 -1
- package/dist/spec/infrastructure/cli/parseArgsError.js +0 -34
- package/dist/spec/infrastructure/cli/parseArgsError.js.map +0 -1
- package/dist/spec/infrastructure/index.d.ts +0 -2
- package/dist/spec/infrastructure/index.d.ts.map +0 -1
- package/dist/spec/infrastructure/index.js +0 -2
- package/dist/spec/infrastructure/index.js.map +0 -1
- package/dist/spec/infrastructure/sql/PgQueryParser.d.ts +0 -18
- package/dist/spec/infrastructure/sql/PgQueryParser.d.ts.map +0 -1
- package/dist/spec/infrastructure/sql/PgQueryParser.js +0 -17
- package/dist/spec/infrastructure/sql/PgQueryParser.js.map +0 -1
- package/dist/spec/infrastructure/sql/compilePlan.d.ts +0 -37
- package/dist/spec/infrastructure/sql/compilePlan.d.ts.map +0 -1
- package/dist/spec/infrastructure/sql/compilePlan.js +0 -287
- package/dist/spec/infrastructure/sql/compilePlan.js.map +0 -1
- package/dist/spec/infrastructure/sql/compileSql.d.ts +0 -35
- package/dist/spec/infrastructure/sql/compileSql.d.ts.map +0 -1
- package/dist/spec/infrastructure/sql/compileSql.js +0 -92
- package/dist/spec/infrastructure/sql/compileSql.js.map +0 -1
- package/dist/spec/infrastructure/sql/frontEnd.d.ts +0 -8
- package/dist/spec/infrastructure/sql/frontEnd.d.ts.map +0 -1
- package/dist/spec/infrastructure/sql/frontEnd.js +0 -100
- package/dist/spec/infrastructure/sql/frontEnd.js.map +0 -1
- package/dist/spec/infrastructure/sql/index.d.ts +0 -4
- package/dist/spec/infrastructure/sql/index.d.ts.map +0 -1
- package/dist/spec/infrastructure/sql/index.js +0 -4
- package/dist/spec/infrastructure/sql/index.js.map +0 -1
- package/dist/spec/kernel/diagnostic.d.ts.map +0 -1
- package/dist/spec/kernel/diagnostic.js +0 -301
- package/dist/spec/kernel/diagnostic.js.map +0 -1
- package/dist/spec/kernel/index.d.ts +0 -8
- package/dist/spec/kernel/index.d.ts.map +0 -1
- package/dist/spec/kernel/index.js +0 -8
- package/dist/spec/kernel/index.js.map +0 -1
- package/dist/spec/usecase/EmitTypes.d.ts +0 -22
- package/dist/spec/usecase/EmitTypes.d.ts.map +0 -1
- package/dist/spec/usecase/EmitTypes.js +0 -182
- package/dist/spec/usecase/EmitTypes.js.map +0 -1
- package/dist/spec/usecase/ValidateManifestsUseCase.d.ts +0 -8
- package/dist/spec/usecase/ValidateManifestsUseCase.d.ts.map +0 -1
- package/dist/spec/usecase/ValidateManifestsUseCase.js +0 -101
- package/dist/spec/usecase/ValidateManifestsUseCase.js.map +0 -1
- package/dist/spec/usecase/dto/ValidateManifestsRequest.d.ts +0 -27
- package/dist/spec/usecase/dto/ValidateManifestsRequest.d.ts.map +0 -1
- package/dist/spec/usecase/dto/ValidateManifestsRequest.js +0 -2
- package/dist/spec/usecase/dto/ValidateManifestsRequest.js.map +0 -1
- package/dist/spec/usecase/dto/ValidateManifestsResponse.d.ts +0 -14
- package/dist/spec/usecase/dto/ValidateManifestsResponse.d.ts.map +0 -1
- package/dist/spec/usecase/dto/ValidateManifestsResponse.js +0 -2
- package/dist/spec/usecase/dto/ValidateManifestsResponse.js.map +0 -1
- package/dist/spec/usecase/dto/index.d.ts +0 -3
- package/dist/spec/usecase/dto/index.d.ts.map +0 -1
- package/dist/spec/usecase/dto/index.js +0 -3
- package/dist/spec/usecase/dto/index.js.map +0 -1
- package/dist/spec/usecase/index.d.ts +0 -10
- package/dist/spec/usecase/index.d.ts.map +0 -1
- package/dist/spec/usecase/index.js +0 -10
- package/dist/spec/usecase/index.js.map +0 -1
- package/dist/testing/cases/before-hook.d.ts +0 -4
- package/dist/testing/cases/before-hook.d.ts.map +0 -1
- package/dist/testing/cases/before-hook.js +0 -71
- package/dist/testing/cases/before-hook.js.map +0 -1
- package/dist/testing/cases/corpus.d.ts +0 -14
- package/dist/testing/cases/corpus.d.ts.map +0 -1
- package/dist/testing/cases/corpus.js +0 -93
- package/dist/testing/cases/corpus.js.map +0 -1
- package/dist/testing/cases/policy.d.ts +0 -87
- package/dist/testing/cases/policy.d.ts.map +0 -1
- package/dist/testing/cases/policy.js +0 -143
- package/dist/testing/cases/policy.js.map +0 -1
- package/dist/testing/cases/printer.d.ts +0 -4
- package/dist/testing/cases/printer.d.ts.map +0 -1
- package/dist/testing/cases/printer.js +0 -34
- package/dist/testing/cases/printer.js.map +0 -1
- package/dist/testing/cases/report-view.d.ts +0 -5
- package/dist/testing/cases/report-view.d.ts.map +0 -1
- package/dist/testing/cases/report-view.js +0 -51
- package/dist/testing/cases/report-view.js.map +0 -1
- package/dist/testing/cases/requisition.d.ts +0 -4
- package/dist/testing/cases/requisition.d.ts.map +0 -1
- package/dist/testing/cases/requisition.js +0 -38
- package/dist/testing/cases/requisition.js.map +0 -1
- package/dist/testing/cases/search-places.d.ts +0 -4
- package/dist/testing/cases/search-places.d.ts.map +0 -1
- package/dist/testing/cases/search-places.js +0 -60
- package/dist/testing/cases/search-places.js.map +0 -1
- package/dist/testing/cases/stock.d.ts +0 -4
- package/dist/testing/cases/stock.d.ts.map +0 -1
- package/dist/testing/cases/stock.js +0 -35
- package/dist/testing/cases/stock.js.map +0 -1
- package/dist/testing/cases/store.d.ts +0 -4
- package/dist/testing/cases/store.d.ts.map +0 -1
- package/dist/testing/cases/store.js +0 -100
- package/dist/testing/cases/store.js.map +0 -1
- package/dist/testing/harness.d.ts +0 -94
- package/dist/testing/harness.d.ts.map +0 -1
- package/dist/testing/harness.js +0 -168
- package/dist/testing/harness.js.map +0 -1
- package/dist/testing/index.d.ts.map +0 -1
- package/dist/testing/index.js.map +0 -1
- package/dist/testing/report.d.ts +0 -15
- package/dist/testing/report.d.ts.map +0 -1
- package/dist/testing/report.js +0 -22
- package/dist/testing/report.js.map +0 -1
- package/dist/web/createRestSurface.d.ts +0 -7
- package/dist/web/createRestSurface.d.ts.map +0 -1
- package/dist/web/createRestSurface.js +0 -41
- package/dist/web/createRestSurface.js.map +0 -1
- package/dist/web/index.d.ts +0 -2
- package/dist/web/index.d.ts.map +0 -1
- package/dist/web/index.js +0 -2
- package/dist/web/index.js.map +0 -1
- package/docs/adr/0001-four-atom-manifest-model.md +0 -440
- package/docs/adr/0002-closed-enums-for-bindings.md +0 -253
- package/docs/adr/0007-ai-as-primary-author.md +0 -473
- package/docs/adr/0008-structured-diagnostic-shape.md +0 -338
- package/docs/adr/0009-consumer-supplied-manifests.md +0 -149
- package/docs/adr/0010-locale-and-translates.md +0 -453
- package/docs/adr/0011-adapter-port-spec.md +0 -281
- package/docs/adr/0012-views-as-public-rest.md +0 -161
- package/docs/adr/0013-agent-provisioned-consumer-projects.md +0 -154
- package/docs/adr/0014-auth-better-auth-and-multi-tenant-mcp.md +0 -939
- package/docs/adr/0016-site-semantic-layer.md +0 -70
- package/docs/adr/0017-media-multi-variant-agent-side-optimization.md +0 -181
- package/docs/adr/0018-core-starters-repository-boundary.md +0 -179
- package/docs/adr/0019-sealed-manifest-runtime-pipeline.md +0 -244
- package/docs/adr/0020-builtin-handler-contracts-and-matched-upsert.md +0 -199
- package/docs/adr/0021-retire-starter-scaffolding.md +0 -30
- package/docs/adr/0022-caller-observed-version-occ.md +0 -212
- package/docs/adr/0023-port-failure-contract.md +0 -69
- package/docs/adr/0024-manifest-native-schema-tables.md +0 -264
- package/docs/adr/0025-reserved-native-columns-and-published-only-public-views.md +0 -105
- package/docs/adr/0026-progressive-generate.md +0 -36
- package/docs/adr/0027-scheduled-procedure-triggers.md +0 -31
- package/docs/adr/0028-schema-ttl-expiry.md +0 -33
- package/docs/adr/0029-mcp-apps-interaction-contracts.md +0 -324
- package/docs/adr/0030-store.md +0 -40
- package/docs/adr/0031-host-cloud-core-contract.md +0 -102
- package/docs/adr/0032-store-centric-core-and-service-contract.md +0 -384
- package/docs/adr/0033-storage-converges-to-the-plan.md +0 -92
- package/docs/adr/0034-store-is-authored-as-sql.md +0 -192
- package/docs/adr/0035-sql-dialects.md +0 -154
- package/docs/adr/0036-host-and-dialect.md +0 -65
- package/docs/adr/0037-postgresql-is-the-reference-dialect.md +0 -125
- package/docs/adr/0038-bun-native-host.md +0 -63
- package/docs/adr/0039-postgresql-is-native.md +0 -130
- package/docs/adr/README.md +0 -98
- package/docs/adr/adr-lite-1376-admin-extensions.md +0 -330
- package/docs/adr/adr-lite-803-request-diagnostics.md +0 -38
- package/docs/adr/adr-lite-808-route-readiness.md +0 -47
- package/docs/adr/adr-lite-809-bounded-public-content.md +0 -71
- package/docs/adr/adr-lite-812-native-parity.md +0 -150
- package/docs/adr/adr-lite-823-home-statistics.md +0 -64
- package/docs/adr/adr-lite-842-mcp-authoring.md +0 -30
- package/docs/adr/adr-lite-845-frontend-client.md +0 -38
- package/docs/adr/adr-lite-861-admin-webmcp.md +0 -48
- package/docs/adr/adr-lite-909-admin-ui-kit.md +0 -37
- package/docs/examples/commerce-inventory.md +0 -498
- package/docs/examples/commerce.md +0 -254
- package/docs/examples/guarded-api.md +0 -238
- package/docs/examples/intake-hooks.md +0 -237
- package/docs/examples/intake.md +0 -127
- package/docs/examples/legal-documents.md +0 -218
- package/docs/examples/procurement.md +0 -226
- package/docs/examples/publication.md +0 -211
- package/docs/examples/reference-service/.mantle/generated/mantle.ts +0 -174
- package/docs/examples/reference-service/.mantle/generated/plan.json +0 -1936
- package/docs/examples/reference-service/README.md +0 -33
- package/docs/examples/reference-service/manifests/catalog.yaml +0 -103
- package/docs/examples/reference-service/manifests/orders.yaml +0 -120
- package/docs/examples/reference-service/mantle.config.json +0 -1
- package/docs/examples/reference-service/package.json +0 -27
- package/docs/examples/reference-service/smoke.mjs +0 -160
- package/docs/examples/reference-service/src/handlers.ts +0 -36
- package/docs/examples/reference-service/src/index.ts +0 -33
- package/docs/examples/reference-service/src/service.ts +0 -78
- package/docs/examples/reference-service/wrangler.jsonc +0 -26
- package/docs/examples/reservation.md +0 -142
- package/docs/handbook/guides/admin-extensions.md +0 -191
- /package/docs/examples/{reference-service → app-shell}/.dev.vars.example +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
// Club events acceptance: only listed members sign up; officers create events in Admin, members register/cancel their own seats over REST and MCP.
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { smoke } from "./smoke-kit.mjs";
|
|
4
|
+
|
|
5
|
+
await smoke(async ({ call, mcp, signIn, sql, owner, step, logs }) => {
|
|
6
|
+
assert.equal((await call("POST", "/api/registrations", { body: { eventId: "x" } })).status, 401);
|
|
7
|
+
assert.equal((await call("GET", "/api/views/events")).status, 401);
|
|
8
|
+
step("anonymous: register and the event list are 401");
|
|
9
|
+
|
|
10
|
+
const admin = await signIn(owner);
|
|
11
|
+
assert.equal((await call("GET", "/admin/api/me", { cookie: admin })).body.role.split(",")[0], "admin");
|
|
12
|
+
step("ADMIN_EMAIL signs in although the members list is empty, and becomes the officer (admin)");
|
|
13
|
+
|
|
14
|
+
// A verified email that is not on the list: the code is sent, but creating the account is refused.
|
|
15
|
+
const stranger = "stranger@example.test", ip = "198.51.100.7", logStart = logs().length;
|
|
16
|
+
assert.equal((await call("POST", "/api/auth/email-otp/send-verification-otp", { body: { email: stranger, type: "sign-in" }, ip })).status, 200);
|
|
17
|
+
let code;
|
|
18
|
+
for (let i = 0; i < 40 && !code; i++) {
|
|
19
|
+
code = /stranger@example\.test: one-time code is (\d{6})/.exec(logs().slice(logStart))?.[1];
|
|
20
|
+
if (!code) await new Promise(resolve => setTimeout(resolve, 100));
|
|
21
|
+
}
|
|
22
|
+
assert.ok(code, "no one-time code for the stranger");
|
|
23
|
+
const refused = await call("POST", "/api/auth/sign-in/email-otp", { body: { email: stranger, otp: code }, ip });
|
|
24
|
+
assert.equal(refused.status, 403, JSON.stringify(refused.body));
|
|
25
|
+
assert.equal(refused.headers.getSetCookie().length, 0);
|
|
26
|
+
assert.equal((await sql(`SELECT count(*) AS n FROM user WHERE email = '${stranger}'`))[0].n, 0);
|
|
27
|
+
step("an email not on the members list cannot sign up: 403, no session cookie, no user row");
|
|
28
|
+
|
|
29
|
+
for (const name of ["alice", "bob", "carol", "dave", "erin", "frank"]) {
|
|
30
|
+
const added = await call("POST", "/admin/api/operations/add-member", { cookie: admin, body: { email: `${name}@example.test`, name } });
|
|
31
|
+
assert.equal(added.status, 200, JSON.stringify(added.body));
|
|
32
|
+
}
|
|
33
|
+
const mixed = await call("POST", "/admin/api/operations/add-member", { cookie: admin, body: { email: "Grace@example.test" } });
|
|
34
|
+
assert.equal(mixed.status, 200, JSON.stringify(mixed.body));
|
|
35
|
+
assert.equal((await sql("SELECT email FROM members WHERE email = 'grace@example.test'")).length, 1);
|
|
36
|
+
step("the officer adds members through the add-member operation in Admin (a mixed-case email is stored lowercased)");
|
|
37
|
+
const create = async (title, seats, closed = false) => {
|
|
38
|
+
const created = await call("POST", "/admin/api/operations/create-event", { cookie: admin, body: { title, startsAt: "2026-11-01T10:00:00Z", capacity: seats } });
|
|
39
|
+
assert.equal(created.status, 200, JSON.stringify(created.body));
|
|
40
|
+
if (!closed) return;
|
|
41
|
+
// Closing is an ordinary Admin edit: operational collections are editable, only creation needs a Procedure.
|
|
42
|
+
const id = created.body.output.results[0][0].id;
|
|
43
|
+
const { version } = (await call("GET", `/admin/api/entries/${id}?collection=events`, { cookie: admin })).body.entry;
|
|
44
|
+
assert.equal((await call("PATCH", `/admin/api/entries/${id}?collection=events`, { cookie: admin, body: { data: { closed: true }, expectedVersion: version } })).status, 200);
|
|
45
|
+
};
|
|
46
|
+
await create("Hike", 3);
|
|
47
|
+
await create("Workshop", 1);
|
|
48
|
+
await create("Members' dinner", 10, true);
|
|
49
|
+
step("an officer creates events through the create-event operation and closes one with an ordinary edit");
|
|
50
|
+
|
|
51
|
+
const alice = await signIn("alice@example.test");
|
|
52
|
+
const events = async cookie => Object.fromEntries((await call("GET", "/api/views/events", { cookie })).body.rows.map(e => [e.title, e]));
|
|
53
|
+
const { Hike: hike, Workshop: workshop, "Members' dinner": dinner } = await events(alice);
|
|
54
|
+
const seatsOf = async id => (await sql(`SELECT capacity - seats_taken AS seats_left FROM events WHERE id = '${id}'`))[0].seats_left;
|
|
55
|
+
const mine = async cookie => (await call("GET", "/api/views/my-registrations", { cookie })).body.rows;
|
|
56
|
+
|
|
57
|
+
const registered = await call("POST", "/api/registrations", { cookie: alice, body: { eventId: hike.id } });
|
|
58
|
+
assert.equal(registered.status, 200, JSON.stringify(registered.body));
|
|
59
|
+
assert.equal(await seatsOf(hike.id), 2);
|
|
60
|
+
assert.deepEqual((await mine(alice)).map(r => r.title), ["Hike"]);
|
|
61
|
+
step("a member registers: the insert and seats_left 3 -> 2 run in one program");
|
|
62
|
+
|
|
63
|
+
const twice = await call("POST", "/api/registrations", { cookie: alice, body: { eventId: hike.id } });
|
|
64
|
+
assert.equal(twice.status, 409, JSON.stringify(twice.body));
|
|
65
|
+
assert.equal(await seatsOf(hike.id), 2);
|
|
66
|
+
step("registering twice is 409 (uniqueIndexes [eventId, member]) and takes no seat");
|
|
67
|
+
|
|
68
|
+
assert.equal((await call("POST", "/api/registrations", { cookie: alice, body: { eventId: dinner.id } })).status, 409);
|
|
69
|
+
assert.equal((await call("POST", "/api/registrations", { cookie: alice, body: { eventId: "no-such-event" } })).status, 404);
|
|
70
|
+
step("the register handler checks first: a closed event is 409, a missing one 404");
|
|
71
|
+
|
|
72
|
+
const bob = await signIn("bob@example.test");
|
|
73
|
+
const [aliceHike] = await mine(alice);
|
|
74
|
+
assert.deepEqual(await mine(bob), []);
|
|
75
|
+
const foreign = await call("POST", "/api/registrations/cancel", { cookie: bob, body: { id: aliceHike.id } });
|
|
76
|
+
assert.equal(foreign.status, 409, JSON.stringify(foreign.body));
|
|
77
|
+
assert.equal((await sql(`SELECT count(*) AS n FROM registrations WHERE id = '${aliceHike.id}'`))[0].n, 1);
|
|
78
|
+
assert.equal(await seatsOf(hike.id), 2);
|
|
79
|
+
step("another member neither sees nor cancels it: cancel is 409, the row and seats_left are unchanged (restrict)");
|
|
80
|
+
|
|
81
|
+
const racers = [];
|
|
82
|
+
for (const name of ["carol", "dave", "erin", "frank"]) racers.push(await signIn(`${name}@example.test`));
|
|
83
|
+
const race = await Promise.all(racers.map(cookie => call("POST", "/api/registrations", { cookie, body: { eventId: workshop.id } })));
|
|
84
|
+
assert.deepEqual(race.map(r => r.status).sort(), [200, 409, 409, 409], JSON.stringify(race.map(r => r.body)));
|
|
85
|
+
assert.equal(await seatsOf(workshop.id), 0);
|
|
86
|
+
assert.equal((await sql(`SELECT count(*) AS n FROM registrations WHERE eventId = '${workshop.id}'`))[0].n, 1);
|
|
87
|
+
step("four members race for the last seat: exactly one wins, seats_left is 0, the losers' inserts rolled back");
|
|
88
|
+
|
|
89
|
+
const cancelled = await call("POST", "/api/registrations/cancel", { cookie: alice, body: { id: aliceHike.id } });
|
|
90
|
+
assert.equal(cancelled.status, 200, JSON.stringify(cancelled.body));
|
|
91
|
+
assert.equal(await seatsOf(hike.id), 3);
|
|
92
|
+
assert.deepEqual(await mine(alice), []);
|
|
93
|
+
step("the member cancels their own registration and the seat returns (2 -> 3)");
|
|
94
|
+
|
|
95
|
+
assert.ok((await mcp("/mcp", bob)).body.result.tools.some(t => t.name === "register"));
|
|
96
|
+
const viaAi = await mcp("/mcp", bob, "register", { eventId: hike.id });
|
|
97
|
+
assert.equal(viaAi.body.result?.isError, undefined, JSON.stringify(viaAi.body));
|
|
98
|
+
assert.equal(await seatsOf(hike.id), 2);
|
|
99
|
+
assert.deepEqual((await mine(bob)).map(r => r.title), ["Hike"]);
|
|
100
|
+
step("the member's AI registers through the public MCP tool `register`");
|
|
101
|
+
|
|
102
|
+
const all = await call("GET", "/admin/api/entries?collection=registrations", { cookie: admin });
|
|
103
|
+
assert.equal(all.status, 200, JSON.stringify(all.body));
|
|
104
|
+
assert.deepEqual(all.body.items.map(r => r.data.eventId).sort(), [hike.id, workshop.id].sort());
|
|
105
|
+
assert.equal((await call("GET", "/admin/api/entries?collection=registrations", { cookie: bob })).status, 403);
|
|
106
|
+
assert.equal((await call("GET", "/admin/api/me", { cookie: bob })).status, 403);
|
|
107
|
+
assert.ok(all.body.items.every(r => r.data.memberName && r.data.memberName !== r.data.member), JSON.stringify(all.body.items));
|
|
108
|
+
step("officers see every member's registrations, with names, through Admin's API; a member gets 403 on Admin");
|
|
109
|
+
|
|
110
|
+
const entry = async id => (await call("GET", `/admin/api/entries/${id}?collection=events`, { cookie: admin })).body.entry;
|
|
111
|
+
const before = await seatsOf(hike.id), read = await entry(hike.id);
|
|
112
|
+
// The console saves whole records: an edit that echoes seats_taken (or tries to change it) only changes the other fields.
|
|
113
|
+
const edited = await call("PATCH", `/admin/api/entries/${hike.id}?collection=events`, { cookie: admin, body: { data: { ...read.data, title: "Hike (rescheduled)", seats_taken: 0 }, expectedVersion: read.version } });
|
|
114
|
+
assert.equal(edited.status, 200, JSON.stringify(edited.body));
|
|
115
|
+
assert.equal((await entry(hike.id)).data.title, "Hike (rescheduled)");
|
|
116
|
+
assert.equal(await seatsOf(hike.id), before);
|
|
117
|
+
const shrunk = await call("PATCH", `/admin/api/entries/${hike.id}?collection=events`, { cookie: admin, body: { data: { capacity: 0 }, expectedVersion: (await entry(hike.id)).version } });
|
|
118
|
+
assert.equal(shrunk.status, 409, JSON.stringify(shrunk.body));
|
|
119
|
+
assert.equal(await seatsOf(hike.id), before);
|
|
120
|
+
step("officers edit an event with the whole record; the server-maintained seats_taken is ignored, and capacity below the seats taken is 409");
|
|
121
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ContractError } from "@aotter/mantle/contracts";
|
|
2
|
+
import { userOf } from "@aotter/mantle/auth";
|
|
3
|
+
import type { Handlers } from "../generated/generated.js";
|
|
4
|
+
|
|
5
|
+
export const handlers: Handlers = {
|
|
6
|
+
register: async ({ caller, store }, { eventId }) => {
|
|
7
|
+
if (caller.kind !== "user") throw new ContractError("AUTH_DENIED", "Sign in as a member to register.", "procedures/register");
|
|
8
|
+
// Check before writing: a clear refusal for a missing or closed event. Seats are NOT checked here;
|
|
9
|
+
// the `seats_taken <= capacity` check in register-write is what holds under concurrent requests.
|
|
10
|
+
const event = await store.collection("events").findById(eventId);
|
|
11
|
+
if (!event) throw new ContractError("NOT_FOUND", "No such event.", "procedures/register");
|
|
12
|
+
if (event.closed) throw new ContractError("CONFLICT", "Registration for this event is closed.", "procedures/register");
|
|
13
|
+
try {
|
|
14
|
+
// `member` comes from the verified caller, never from request input; uniqueIndexes [eventId, member] refuses a second seat.
|
|
15
|
+
// userOf: the Better Auth user record the caller was resolved from (any credential), so officers see who registered.
|
|
16
|
+
const user = userOf(caller);
|
|
17
|
+
return await store.procedures["register-write"]({ eventId, member: caller.subject, memberName: user?.name || user?.email || caller.subject });
|
|
18
|
+
} catch (error) {
|
|
19
|
+
// register-write's only Schema check is the capacity one.
|
|
20
|
+
if (error instanceof ContractError && error.code === "CONFLICT" && error.message.startsWith("A check of the Schema failed"))
|
|
21
|
+
throw new ContractError("CONFLICT", "The event is full.", "procedures/register");
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { store } from "../generated/generated.js";
|
|
2
|
+
import { handlers } from "./handlers.js";
|
|
3
|
+
|
|
4
|
+
/** Members-only sign-up: an email may create an account only when officers listed it in the `members` Schema (Admin). */
|
|
5
|
+
export async function allowSignUp(env: Env, email: string): Promise<boolean> {
|
|
6
|
+
// No user exists yet, so the lookup runs as an application-created system caller (never wire input).
|
|
7
|
+
const members = store(env.DB, { kind: "system", reason: "sign-up allowlist" }, { handlers }).collection("members");
|
|
8
|
+
return (await members.count({ email: email.toLowerCase() })) > 0;
|
|
9
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Generated public website
|
|
2
|
+
|
|
3
|
+
A minimal application-owned Cloudflare D1 Worker: an HTML list and detail page,
|
|
4
|
+
REST, `llms.txt`, sitemap, Markdown alternates and canonical head tags. It uses the
|
|
5
|
+
positional native generator documented by the installed `@aotter/mantle` version.
|
|
6
|
+
The frontend has no runtime dependencies. It renders Markdown as escaped text,
|
|
7
|
+
preserving the source for the `.md` alternate.
|
|
8
|
+
|
|
9
|
+
Copy this directory outside the SDK checkout. In that directory, set
|
|
10
|
+
`"type": "module"` in `package.json`, install the exact selected Mantle version
|
|
11
|
+
and host tools, then run:
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install --save-exact @aotter/mantle@<version>
|
|
15
|
+
npm install --save-dev typescript @cloudflare/workers-types wrangler
|
|
16
|
+
npx mantle generate cloudflare-d1 generated posts.yaml
|
|
17
|
+
npx tsc --noEmit
|
|
18
|
+
git init
|
|
19
|
+
git add generated src/worker.ts wrangler.jsonc
|
|
20
|
+
git commit -m "Generate native website contracts"
|
|
21
|
+
npx wrangler d1 execute mantle-generated-web --local --file generated/schema.sql
|
|
22
|
+
npx wrangler d1 execute mantle-generated-web --local --file seed.sql
|
|
23
|
+
npx wrangler dev --local
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Keep generated TypeScript, `schema.sql` and the configured Wrangler file in
|
|
27
|
+
version control. The workflow is generate → typecheck → implement any listed ref
|
|
28
|
+
handlers → typecheck → commit generated output. This manifest has no ref handlers.
|
|
29
|
+
Use the installed version's documented commands. CI runs
|
|
30
|
+
`mantle generate cloudflare-d1 generated posts.yaml --check` to refuse stale or
|
|
31
|
+
missing generated files without writing them. `dist/`
|
|
32
|
+
and local Wrangler state stay ignored.
|
|
33
|
+
|
|
34
|
+
For a linked pre-release SDK, use its installed `mantle` CLI instead of installing
|
|
35
|
+
an unpublished version. Generation adds Wrangler's split build automatically.
|
|
36
|
+
The seed is local test data; never apply it to an existing production database.
|
|
37
|
+
For deployment, set the real D1 binding and `PUBLIC_ORIGIN` to the public origin.
|
|
38
|
+
The app passes a verified anonymous Caller for this public-only site; an
|
|
39
|
+
application with sign-in resolves its Caller once and supplies it to each entry.
|
|
40
|
+
|
|
41
|
+
Open `/`, `/posts/hello`, `/posts/hello.md`, `/api/views/posts`, `/llms.txt` and
|
|
42
|
+
`/sitemap.xml`. The list pages with an opaque cursor; the detail reads the Store,
|
|
43
|
+
which enforces publication in SQL. `site.head()` reads the declared public View
|
|
44
|
+
and supplies canonical and Markdown alternate tags, even when the request host
|
|
45
|
+
differs from `PUBLIC_ORIGIN`. Both HTML pages have Markdown alternates (`/.md`
|
|
46
|
+
for the index) and a canonical. REST and web fall through to the HTML renderer.
|
|
47
|
+
|
|
48
|
+
Acceptance:
|
|
49
|
+
|
|
50
|
+
- Walk every `/api/views/posts` cursor: its rows must match the `llms.txt` detail
|
|
51
|
+
links and sitemap detail URLs below the documented index caps.
|
|
52
|
+
- Each HTML page includes `rel="canonical"` and a `type="text/markdown"`
|
|
53
|
+
alternate whose GET returns its current source. The index canonical is `/`.
|
|
54
|
+
- `/posts/draft` and `/posts/draft.md` return 404; the draft is absent from REST,
|
|
55
|
+
HTML links, `llms.txt` and sitemap. HTML source escapes the fixture's `<world>`.
|
|
56
|
+
- Malformed/foreign list cursors return structured 400 errors with `no-store`.
|
|
57
|
+
- HTML HEAD has no body. Unknown pages return 404 with `no-store`.
|
|
58
|
+
|
|
59
|
+
Ordinary HTML detail performs two native reads: one Store read for the body, then one
|
|
60
|
+
public View read in `site.head()`. The index likewise performs two reads (list
|
|
61
|
+
and home head). The current head API accepts no preloaded row; there is no
|
|
62
|
+
request cache or extra authentication lookup in this public example. IDs ending
|
|
63
|
+
in `.md` need one additional exact-page probe before HTML rendering (three reads
|
|
64
|
+
total). Markdown may perform two View reads when checking an exact `.md` page
|
|
65
|
+
before its alternate.
|
|
66
|
+
|
|
67
|
+
Web indexes have deliberate ceilings: 5,000 scanned rows, 10 queries and 1 MiB
|
|
68
|
+
for `llms.txt`; 50,000 rows, 100 queries and 50 MiB for a sitemap. An authored SQL `LIMIT 3` means at most three rows in the entire index,
|
|
69
|
+
not three rows per query. Omit SQL LIMIT to enumerate the whole authorized
|
|
70
|
+
result up to these web ceilings. The renderer requests pages of up to 500
|
|
71
|
+
through generated paging options; transport page size does not expand the
|
|
72
|
+
authored result set. Migration: remove LIMIT only when it was mistakenly
|
|
73
|
+
being used as a page-size setting; retain a business-defined top-N limit. Translation-aware web indexes/hreflang remain a separate
|
|
74
|
+
follow-up; `locales[0]` supplies the currently supported locale alternate.
|
|
75
|
+
|
|
76
|
+
The SDK runs this exact Worker against a native SQLite database in
|
|
77
|
+
`tests/web-example.test.ts` and bundles/typechecks its D1 form. No measurement
|
|
78
|
+
scripts or benchmark data are part of the example.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
apiVersion: cms.mantle.aotter.net/v2
|
|
2
|
+
kind: Schema
|
|
3
|
+
metadata: {name: posts}
|
|
4
|
+
spec:
|
|
5
|
+
title: Posts
|
|
6
|
+
lifecycle: publishing
|
|
7
|
+
schema:
|
|
8
|
+
type: object
|
|
9
|
+
required: [title, body]
|
|
10
|
+
properties:
|
|
11
|
+
title: {type: string}
|
|
12
|
+
body: {type: string}
|
|
13
|
+
---
|
|
14
|
+
apiVersion: cms.mantle.aotter.net/v2
|
|
15
|
+
kind: View
|
|
16
|
+
metadata: {name: posts}
|
|
17
|
+
spec:
|
|
18
|
+
surface: public
|
|
19
|
+
sql: SELECT id, title FROM posts WHERE id <> 'home' ORDER BY id
|
|
20
|
+
---
|
|
21
|
+
apiVersion: cms.mantle.aotter.net/v2
|
|
22
|
+
kind: View
|
|
23
|
+
metadata: {name: post}
|
|
24
|
+
spec:
|
|
25
|
+
surface: public
|
|
26
|
+
input:
|
|
27
|
+
type: object
|
|
28
|
+
required: [id]
|
|
29
|
+
additionalProperties: false
|
|
30
|
+
properties: {id: {type: string, minLength: 1}}
|
|
31
|
+
sql: SELECT id, title, body FROM posts WHERE id = input.id ORDER BY id
|
|
32
|
+
---
|
|
33
|
+
apiVersion: cms.mantle.aotter.net/v2
|
|
34
|
+
kind: View
|
|
35
|
+
metadata: {name: home}
|
|
36
|
+
spec:
|
|
37
|
+
surface: public
|
|
38
|
+
sql: SELECT id, title, body FROM posts WHERE id = 'home' ORDER BY id
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
-- Local fixture only. Production publishing goes through the generated Procedures.
|
|
2
|
+
INSERT INTO posts (id, version, created_at, updated_at, title, body, status, published_at) VALUES
|
|
3
|
+
('home', 1, 0, 0, 'Posts', '# Posts — browse the HTML index for articles.', 'published', 0),
|
|
4
|
+
('hello', 1, 0, 0, 'Hello <world>', '# Hello world', 'published', 0),
|
|
5
|
+
('second', 1, 0, 0, 'Second post', '# Second post', 'published', 0),
|
|
6
|
+
('draft', 1, 0, 0, 'Hidden draft', '# Draft', 'draft', NULL);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { surfaceFailure } from "@aotter/mantle/contracts";
|
|
2
|
+
import { store } from '../generated/generated.js';
|
|
3
|
+
import { rest } from '../generated/rest.js';
|
|
4
|
+
import { web } from '../generated/web.js';
|
|
5
|
+
import page from '../generated/paged/views/posts.js';
|
|
6
|
+
|
|
7
|
+
interface Env { DB: Parameters<typeof store>[0]; PUBLIC_ORIGIN: string }
|
|
8
|
+
const caller = { kind: 'anonymous' } as const;
|
|
9
|
+
const escape = (text: unknown) => String(text).replace(/[&<>"']/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c]!));
|
|
10
|
+
const segment = (text: string) => encodeURIComponent(text).replace(/[()]/g, c => '%' + c.charCodeAt(0).toString(16).toUpperCase());
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
async fetch(request: Request, env: Env): Promise<Response> {
|
|
14
|
+
try {
|
|
15
|
+
const site = web({ db: env.DB, caller, origin: env.PUBLIC_ORIGIN, title: 'Posts', description: 'A small public website',
|
|
16
|
+
pages: { '/': { view: 'home', markdown: 'body' }, '/posts/{id}': { view: 'post', list: 'posts', markdown: 'body' } } });
|
|
17
|
+
const api = await rest<Env>({ db: env => env.DB, caller: async () => caller })(request, env);
|
|
18
|
+
if (api) return api;
|
|
19
|
+
const output = await site.fetch(request, env);
|
|
20
|
+
if (output) return output;
|
|
21
|
+
const url = new URL(request.url), detail = /^\/posts\/([^/]+)$/.exec(url.pathname);
|
|
22
|
+
if (url.pathname !== '/' && !detail) return new Response('Not found', { status: 404, headers: { 'cache-control': 'no-store' } });
|
|
23
|
+
if (!['GET', 'HEAD'].includes(request.method)) return new Response(null, { status: 405, headers: { allow: 'GET, HEAD', 'cache-control': 'no-store' } });
|
|
24
|
+
let title = 'Posts', body: string;
|
|
25
|
+
if (detail) {
|
|
26
|
+
let id: string;
|
|
27
|
+
try { id = decodeURIComponent(detail[1]!); } catch { return new Response('Invalid path', { status: 400, headers: { 'cache-control': 'no-store' } }); }
|
|
28
|
+
// The Store applies publishing visibility in SQL. An anonymous caller cannot read a draft.
|
|
29
|
+
const post = await store(env.DB, caller).collection('posts').findById(id);
|
|
30
|
+
if (!post) return new Response('Not found', { status: 404, headers: { 'cache-control': 'no-store' } });
|
|
31
|
+
title = post.title ?? 'Untitled';
|
|
32
|
+
// Markdown stays plain text here; no untrusted HTML or Markdown renderer is needed.
|
|
33
|
+
body = `<p><a href="/">All posts</a></p><pre>${escape(post.body ?? '')}</pre>`;
|
|
34
|
+
} else {
|
|
35
|
+
const result = await page(env.DB, caller, {}, { limit: 50, cursor: url.searchParams.get('cursor') ?? undefined });
|
|
36
|
+
body = '<ul>' + result.rows.map(row => `<li><a href="/posts/${segment(String(row.id))}">${escape(row.title)}</a></li>`).join('') + '</ul>';
|
|
37
|
+
if (result.nextCursor) body += `<a href="/?cursor=${encodeURIComponent(result.nextCursor)}">Next page</a>`;
|
|
38
|
+
}
|
|
39
|
+
const html = `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>${escape(title)}</title>${await site.head(request, env)}</head><body><h1>${escape(title)}</h1>${body}</body></html>`;
|
|
40
|
+
return new Response(request.method === 'HEAD' ? null : html, { headers: { 'content-type': 'text/html; charset=utf-8', 'cache-control': 'no-store' } });
|
|
41
|
+
} catch (error) { return surfaceFailure(error); }
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022", "module": "NodeNext", "moduleResolution": "NodeNext",
|
|
4
|
+
"strict": true, "noEmit": true, "skipLibCheck": true, "lib": ["ES2022", "DOM"],
|
|
5
|
+
"types": ["@cloudflare/workers-types"]
|
|
6
|
+
},
|
|
7
|
+
"include": ["src", "generated"]
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mantle-generated-web",
|
|
3
|
+
"main": "src/worker.ts",
|
|
4
|
+
"compatibility_date": "2026-09-28",
|
|
5
|
+
"compatibility_flags": ["nodejs_compat", "global_fetch_strictly_public"],
|
|
6
|
+
"vars": { "PUBLIC_ORIGIN": "http://localhost:8787" },
|
|
7
|
+
"d1_databases": [{ "binding": "DB", "database_name": "mantle-generated-web", "database_id": "local-example" }]
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Copy to .dev.vars for local sign-in: one-time codes are printed to the wrangler log. Never deploy these values.
|
|
2
|
+
PUBLIC_ORIGIN=http://127.0.0.1:8787
|
|
3
|
+
ADMIN_EMAIL=you@example.com
|
|
4
|
+
BETTER_AUTH_SECRET=replace-with-a-random-32-byte-secret
|
|
5
|
+
SUPPLIER_API_URL=http://127.0.0.1:9999/orders
|
|
6
|
+
SUPPLIER_WEBHOOK_SECRET=replace-with-the-secret-the-supplier-signs-with
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Purchasing
|
|
2
|
+
|
|
3
|
+
An internal purchase-request workflow. Any signed-in employee submits a request against a department budget. An admin
|
|
4
|
+
approves or rejects it, in Admin or through an AI agent on the admin MCP endpoint. Approval spends the budget and writes a
|
|
5
|
+
ledger row in one transaction. The app then orders from the supplier's API and waits for the supplier's signed callback
|
|
6
|
+
to mark the request confirmed. Requesters get an email on each decision, and a daily cron emails admins about requests
|
|
7
|
+
that have been waiting too long.
|
|
8
|
+
|
|
9
|
+
## Capabilities shown
|
|
10
|
+
|
|
11
|
+
- **Status workflow with guarded transitions**: the write Procedures use
|
|
12
|
+
`UPDATE requests SET requestStatus = 'approved' ... WHERE id = input.id AND requestStatus = 'submitted'`. A match on
|
|
13
|
+
0 rows is a `CONFLICT` (409). See `manifests/purchasing.yaml` (`approve-request-write`, `reject-request-write`,
|
|
14
|
+
`change-amount`, `mark-ordered`, `confirm-order`). The column is `requestStatus` because `status` is reserved for
|
|
15
|
+
publishing Schemas. `requests` and `ledger` set `readOnly: true`, so Admin's generic editor cannot bypass the state
|
|
16
|
+
machine (for example by moving an ordered request back to `submitted` and approving it again).
|
|
17
|
+
- **Admin-only operations**: `approve-request` and `reject-request` declare `requires: ctx.admin` and a `target`, so
|
|
18
|
+
Admin shows them as operations on a request. Their `kind: mcp, surface: admin` Triggers make them
|
|
19
|
+
`approve_request` / `reject_request` tools on `/mcp/admin`. They are not listed on `/mcp`.
|
|
20
|
+
- **Optimistic concurrency**: clients send `expectedVersion`, and the SQL matches `version = input.expectedVersion`.
|
|
21
|
+
If the requester changes the amount (`change-amount`, only their own request and only while it is `submitted`)
|
|
22
|
+
after an admin reviewed it, that admin's approval is a 409. When two admins approve the same version, one succeeds
|
|
23
|
+
and the other gets a 409.
|
|
24
|
+
- **Several writes in one transaction**: `approve-request-write` runs three statements as one program: the status
|
|
25
|
+
change, `UPDATE budgets SET remaining = remaining - ...` and `INSERT INTO ledger`. If the request would overspend,
|
|
26
|
+
`checks: ["remaining >= 0"]` on `budgets` rolls back all three. `src/handlers.ts` turns that failure into a 409.
|
|
27
|
+
- **External API + signed callback**: after the transaction commits, `src/supplier.ts` POSTs the order to
|
|
28
|
+
`env.SUPPLIER_API_URL` (request id as the idempotency key, 10 s timeout) and then sets the request to `ordered`.
|
|
29
|
+
If the supplier cannot be reached, the request stays `approved` and the daily cron retries it as a system caller
|
|
30
|
+
(`mark-ordered` has no `requires` for that reason, and no Trigger).
|
|
31
|
+
`src/routes.ts` serves `POST /callbacks/supplier`. It first checks an HMAC-SHA256 of the timestamp and the **raw**
|
|
32
|
+
body with `env.SUPPLIER_WEBHOOK_SECRET`, and only then parses the JSON. It then calls the generated `confirm-order`
|
|
33
|
+
Procedure as a `system` caller. No Trigger exposes that Procedure. The callback may arrive before `ordered` is
|
|
34
|
+
written, so `approved` is confirmed too. A replay of an applied callback answers 204 again.
|
|
35
|
+
- **Email + cron as app code**: `src/notify.ts` sends through an `EmailSender` from `@aotter/mantle/email`
|
|
36
|
+
(`ConsoleEmailSender` locally). `src/schedule.ts` uses `toCloudflareCron`, and its cron is listed in
|
|
37
|
+
`wrangler.jsonc`. The cron retries failed orders (internal View `approved-requests`) and sends the reminder
|
|
38
|
+
(internal View `stale-requests`) to admins who are not banned.
|
|
39
|
+
- Employees see only their own requests through `my-requests` (`restrict: { requests: "author_id = auth.uid()" }`).
|
|
40
|
+
- **Sidebar for the approver's day**: `src/admin.tsx` declares an Approvals group (`defineAdmin` `nav.groups`) above Admin's built-in
|
|
41
|
+
groups; `pending-requests` and `requests` move into it with `uiSchema.nav: { group, order }`.
|
|
42
|
+
- **A page only signed-in employees reach**: `src/requests-page.ts` serves `GET /requests`. An anonymous visitor gets a
|
|
43
|
+
303 to the shell's `/sign-in?return=/requests` (`src/sign-in.ts`, email code, then back). Signed in, the table reads
|
|
44
|
+
`my-requests` as the visitor's own caller. The form keeps `action="/api/requests" method="post"`; a small script sends
|
|
45
|
+
its fields as JSON to that REST Trigger, so the manifest's validation, `requires` and origin check apply and app code
|
|
46
|
+
never hands request data to a Procedure. Unstyled on purpose. `src/signup.ts` lets only `@EMPLOYEE_DOMAIN` emails
|
|
47
|
+
create an account (`vars` in `wrangler.jsonc`).
|
|
48
|
+
|
|
49
|
+
Search for `AGENT:` to find what a real app must still provide: an email sender, the supplier's real API and signature
|
|
50
|
+
scheme.
|
|
51
|
+
|
|
52
|
+
## Combine with
|
|
53
|
+
|
|
54
|
+
- Need members to own rows, prevent duplicates or cap capacity? Add club-events' `uniqueIndexes` and capacity `checks`.
|
|
55
|
+
- Need public pages, SEO or media for the approved items? Add recipes' publishing lifecycle and visitor pages.
|
|
56
|
+
- Need another approval flow? Copy the pattern: a ref Procedure (admin-only, side effects) that wraps a guarded SQL
|
|
57
|
+
write Procedure (one transaction).
|
|
58
|
+
|
|
59
|
+
## Copy
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
cp -R node_modules/@aotter/mantle/docs/examples/app-shell/. my-app/
|
|
63
|
+
cp -R node_modules/@aotter/mantle/docs/examples/purchasing/. my-app/
|
|
64
|
+
cd my-app && pnpm install && pnpm generate && pnpm types && pnpm check
|
|
65
|
+
cp .dev.vars.example .dev.vars # then set SUPPLIER_API_URL and SUPPLIER_WEBHOOK_SECRET
|
|
66
|
+
pnpm db:init && pnpm db:seed && pnpm dev
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## What `pnpm smoke` proves
|
|
70
|
+
|
|
71
|
+
`smoke.mjs` starts a stand-in supplier API on a local port (which it can switch to 503) and passes its URL and the
|
|
72
|
+
webhook secret through `smoke(scenario, { vars })`. It then checks the following:
|
|
73
|
+
|
|
74
|
+
1. Employees submit requests and see only their own. A department without a budget creates nothing.
|
|
75
|
+
2. An employee gets 403 on the Admin operation. The approve and reject tools exist only on `/mcp/admin`, and the
|
|
76
|
+
internal write Procedures are on neither MCP surface.
|
|
77
|
+
3. Rejecting through the admin MCP tool emails the requester. Approving that request afterwards, with its current
|
|
78
|
+
version, is a 409 because the `requestStatus` guard matches no row.
|
|
79
|
+
4. Approving more than the department has left is a 409. The request stays `submitted`, and the budget and ledger are
|
|
80
|
+
unchanged.
|
|
81
|
+
5. Admin's generic editor cannot change a request. Another employee cannot change its amount (409); the requester can,
|
|
82
|
+
and then approving the version the admin reviewed is a 409 that changes nothing.
|
|
83
|
+
6. Two admins approve the same version at the same time: one gets 200 and the other 409. The budget is deducted and
|
|
84
|
+
the ledger row written once.
|
|
85
|
+
7. Approval places exactly one supplier order, sets `ordered` and emails the requester.
|
|
86
|
+
8. The admin MCP tool approves too. With the supplier down, approvals still commit and stay `approved`.
|
|
87
|
+
9. A callback with a bad signature is a 401 and changes nothing. A correctly signed callback sets `confirmed`, also
|
|
88
|
+
while the request is still `approved`; a replay is 204; a wrong order id or a `submitted` request is 409.
|
|
89
|
+
10. The daily cron places the failed order (`ordered`) and emails every admin about requests pending more than 3
|
|
90
|
+
days, and only about those.
|