@aotter/mantle 0.2.0 → 0.2.1-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 +6 -2
- package/dist/build/compiler.d.ts +4 -4
- package/dist/build/compiler.js +6 -3
- package/dist/build/spec/domain/model/ManifestGrammar.d.ts +39 -1
- package/dist/build/spec/domain/model/RuntimePlan.d.ts +16 -3
- package/dist/build/spec/domain/model/SqlIr.d.ts +30 -0
- package/dist/build/spec/kernel/diagnostic.d.ts +1 -1
- package/dist/domain/describe/chunk-P6PP6VVV.js +1 -0
- package/dist/domain/describe/index.d.ts +1 -0
- package/dist/domain/describe/index.js +1 -1
- package/dist/domain/describe/match.d.ts +19 -0
- package/dist/domain/describe/target-hash.js +1 -1
- package/dist/infrastructure/adminEntries.js +19 -3
- package/dist/infrastructure/bundle.js +43 -8
- package/dist/infrastructure/cli.js +1 -1
- package/dist/infrastructure/generate.js +17 -3
- package/dist/kernel/binds.d.ts +18 -3
- package/dist/kernel/binds.js +1 -1
- package/dist/kernel/contracts.d.ts +7 -0
- package/dist/kernel/contracts.js +9 -0
- package/dist/kernel/driver/bun-sqlite.js +3 -3
- package/dist/kernel/driver/d1.d.ts +1 -1
- package/dist/kernel/driver/d1.js +6 -3
- package/dist/kernel/driver/postgres.d.ts +2 -1
- package/dist/kernel/driver/postgres.js +11 -6
- package/dist/kernel/mcp-handler.js +2 -1
- package/dist/kernel/rest-router.js +3 -5
- package/dist/kernel/rest.d.ts +2 -1
- package/dist/kernel/rest.js +1 -0
- package/dist/kernel/route-pattern.d.ts +26 -0
- package/dist/kernel/route-pattern.js +34 -0
- package/dist/kernel/store.d.ts +15 -1
- package/dist/kernel/store.js +51 -18
- package/dist/usecase/adminBindings.js +2 -2
- package/dist/usecase/adminClient.js +4 -1
- package/dist/usecase/generate.js +7 -5
- package/dist/usecase/handlers.js +1 -1
- package/dist/usecase/publishing.js +20 -7
- package/dist/usecase/rest.js +5 -5
- package/dist/usecase/stores.js +8 -3
- package/docs/examples/README.md +1 -1
- package/docs/examples/app-shell/README.md +58 -10
- package/docs/examples/app-shell/package.json +6 -6
- package/docs/examples/club-events/manifests/club-events.yaml +2 -0
- package/docs/examples/generated-web/seed.sql +5 -4
- package/docs/examples/purchasing/manifests/purchasing.yaml +3 -0
- package/docs/handbook/cloudflare/media-r2.md +6 -3
- package/docs/handbook/cloudflare/service-entry.md +2 -0
- package/docs/handbook/concepts/lifecycle-and-locales.md +21 -1
- package/docs/handbook/examples/hub.md +1 -1
- package/docs/handbook/guides/admin-ui.md +1 -1
- package/docs/handbook/guides/agent-setup.md +13 -8
- package/docs/handbook/guides/agent-workflow-acceptance.md +129 -19
- package/docs/handbook/guides/local-testing.md +50 -5
- package/docs/handbook/guides/native-admin.md +218 -11
- package/docs/handbook/guides/native-execution.md +5 -4
- package/docs/handbook/guides/revisions.md +584 -0
- package/docs/handbook/guides/size-and-startup.md +140 -0
- package/docs/handbook/guides/sql-patterns.md +47 -1
- package/docs/handbook/guides/typed-queries.md +8 -3
- package/docs/handbook/navigation.json +4 -0
- package/docs/handbook/reference/authorization.md +2 -0
- package/docs/handbook/reference/describe.md +42 -0
- package/docs/handbook/reference/diagnostics.md +12 -3
- package/docs/handbook/reference/procedure.md +4 -4
- package/docs/handbook/reference/schema.md +71 -7
- package/docs/handbook/reference/sql.md +2 -1
- package/docs/handbook/reference/surface.md +3 -2
- package/docs/handbook/reference/trigger.md +12 -0
- package/docs/handbook/releases/index.md +44 -1
- package/docs/handbook/start/agents.md +6 -2
- package/docs/handbook/start/project-and-cli.md +4 -0
- package/docs/handbook/start/quickstart-worker.md +1 -1
- package/docs/skills/develop/SKILL.md +15 -3
- package/docs/skills/integrate/SKILL.md +3 -1
- package/docs/skills/performance/SKILL.md +169 -0
- package/docs/skills/update/SKILL.md +9 -5
- package/docs/upgrade-0.1-to-0.2.md +151 -39
- package/package.json +9 -9
- package/skills/README.md +6 -2
- package/skills/mantle/SKILL.md +19 -5
- package/dist/domain/describe/chunk-SGMRVDGE.js +0 -1
package/README.md
CHANGED
|
@@ -159,8 +159,12 @@ Writes are lazy thenables: await `collection.insert/update/delete(...)` to execu
|
|
|
159
159
|
or pass unused Writes from the same Store to `store.batch([...])` for atomic results in input order;
|
|
160
160
|
a stale lock, excluded row or unique clash rolls back the whole batch with `CONFLICT`.
|
|
161
161
|
A batch step cannot use a previous step's result. D1 supports only batch.
|
|
162
|
-
On bun:sqlite and PostgreSQL, `store.transaction(async tx => { ... })` binds `collection`, `views`
|
|
163
|
-
and `procedures` to one transaction: resolve commits, throw rolls back; nested transactions
|
|
162
|
+
On bun:sqlite and PostgreSQL, `store.transaction(async tx => { ... })` binds `collection`, `batch`, `views`
|
|
163
|
+
and `procedures` to one transaction: resolve commits, throw rolls back; nested transactions are refused.
|
|
164
|
+
`tx.batch` and a ref handler's `ctx.store.batch` join that same transaction, without a savepoint or another BEGIN.
|
|
165
|
+
A rejected batch makes the whole outer transaction rollback-only: even if the callback catches the error and returns,
|
|
166
|
+
its transaction rejects with the first batch failure and rolls back every write. This includes batch validation errors.
|
|
167
|
+
Ref handlers can use `ctx.store.batch` on every target, including D1, without creating another Store.
|
|
164
168
|
PostgreSQL defaults to serializable; `{ isolation: "read committed" }` selects another level. There is no automatic retry.
|
|
165
169
|
SQLite uses BEGIN IMMEDIATE and queues all Store/generated driver calls on the same Database until COMMIT/ROLLBACK;
|
|
166
170
|
Inside a transaction callback the outer Store or handle passed to a Mantle driver throws `INPUT_VALIDATION_FAILED`; use `tx`.
|
package/dist/build/compiler.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { SqlNode, SqlSchemaDef, SqlDiagnostic, SqlContext, SqlPlan, checkShapeProblem, CHECK_FUNCTIONS, storageColumnClash, notNullColumns, NATIVE_COLUMNS, NATIVE_NOT_NULL, AGGREGATES, storageColumns, viewCacheProblem, SqlDiagnosticCode, SchemaColumns, PG_GRAMMAR } from "./spec/domain/model/SqlIr.js";
|
|
2
|
-
export { SqlNode, SqlSchemaDef, SqlDiagnostic, SqlContext, SqlPlan, checkShapeProblem, CHECK_FUNCTIONS, storageColumnClash, notNullColumns, NATIVE_COLUMNS, NATIVE_NOT_NULL, AGGREGATES, storageColumns, viewCacheProblem, SqlDiagnosticCode, SchemaColumns, PG_GRAMMAR };
|
|
1
|
+
import { SqlNode, SqlSchemaDef, SqlDiagnostic, SqlContext, SqlPlan, lockIndexProblem, lockShapeProblem, checkShapeProblem, CHECK_FUNCTIONS, storageColumnClash, notNullColumns, NATIVE_COLUMNS, NATIVE_NOT_NULL, AGGREGATES, storageColumns, viewCacheProblem, SqlDiagnosticCode, SchemaColumns, SqlLock, PG_GRAMMAR } from "./spec/domain/model/SqlIr.js";
|
|
2
|
+
export { SqlNode, SqlSchemaDef, SqlDiagnostic, SqlContext, SqlPlan, lockIndexProblem, lockShapeProblem, checkShapeProblem, CHECK_FUNCTIONS, storageColumnClash, notNullColumns, NATIVE_COLUMNS, NATIVE_NOT_NULL, AGGREGATES, storageColumns, viewCacheProblem, SqlDiagnosticCode, SchemaColumns, SqlLock, PG_GRAMMAR };
|
|
3
3
|
import { RuntimePlan, PlanRestrict, NATIVE_OUTPUT_TYPES, PlanLowered, PlanTrigger, PlanProcedure, PlanView, PlanSchema, RUNTIME_PLAN_VERSION, LoweredStatement, LoweredView, LoweredMode, LoweredPage } from "./spec/domain/model/RuntimePlan.js";
|
|
4
4
|
export { RuntimePlan, PlanRestrict, NATIVE_OUTPUT_TYPES, PlanLowered, PlanTrigger, PlanProcedure, PlanView, PlanSchema, RUNTIME_PLAN_VERSION, LoweredStatement, LoweredView, LoweredMode, LoweredPage };
|
|
5
5
|
import { UserFieldSpec, UserScope, RowTemplate, parseRowTemplate } from "./spec/domain/model/UserFields.js";
|
|
6
6
|
export { UserFieldSpec, UserScope, RowTemplate, parseRowTemplate };
|
|
7
|
-
import { ProcedureMcpAnnotations, JsonSchema, AuthorizationRequirements, RESERVED_PROCEDURE_INPUT_NAMES, INPUT_RULE_KEYWORDS, EXPECTED_VERSION_PROPERTY, RESERVED_ENTRY_COLUMNS, TriggerManifest, ProcedureManifest, ViewManifest, SchemaManifest, Manifest, HttpMethod, McpTriggerSurface, McpTriggerSource, MCP_TRIGGER_SURFACES, LifecycleHook, LifecycleTriggerSource, LIFECYCLE_HOOKS, HttpTriggerSource, ScheduleTriggerSource, TriggerSource, TriggerManifestSpec, AdminRole, isAdminRole, CtxAuthScopePredicate, CtxAuthPredicate, CtxUserPredicate, AuthPredicate, HandlerSqlBinding, HandlerRefBinding, HandlerBinding, PROCEDURE_MCP_ANNOTATION_KEYS, PROCEDURE_TARGET_KEYS, ProcedureTarget, LocalizedText, ProcedureManifestSpec, VIEW_INPUT_RESERVED, ViewCachePolicy, ViewSurface, ViewManifestSpec, VIEW_SURFACES, LifecycleMode, TranslatesBinding, SchemaManifestSpec, ManifestMetadata, ApiVersion, ManifestKind, resolveLocalizedText, isLocalizedText, MANTLE_BIND_KEYWORD, MCP_HINT_KEYWORD, MantleRefTarget, resolveMantleRef, enumOptions, MANTLE_REF_KEYWORD, MediaMcpHint, isMediaMcpHint, API_VERSION } from "./spec/domain/model/ManifestGrammar.js";
|
|
8
|
-
export { ProcedureMcpAnnotations, JsonSchema, AuthorizationRequirements, RESERVED_PROCEDURE_INPUT_NAMES, INPUT_RULE_KEYWORDS, EXPECTED_VERSION_PROPERTY, RESERVED_ENTRY_COLUMNS, TriggerManifest, ProcedureManifest, ViewManifest, SchemaManifest, Manifest, HttpMethod, McpTriggerSurface, McpTriggerSource, MCP_TRIGGER_SURFACES, LifecycleHook, LifecycleTriggerSource, LIFECYCLE_HOOKS, HttpTriggerSource, ScheduleTriggerSource, TriggerSource, TriggerManifestSpec, AdminRole, isAdminRole, CtxAuthScopePredicate, CtxAuthPredicate, CtxUserPredicate, AuthPredicate, HandlerSqlBinding, HandlerRefBinding, HandlerBinding, PROCEDURE_MCP_ANNOTATION_KEYS, PROCEDURE_TARGET_KEYS, ProcedureTarget, LocalizedText, ProcedureManifestSpec, VIEW_INPUT_RESERVED, ViewCachePolicy, ViewSurface, ViewManifestSpec, VIEW_SURFACES, LifecycleMode, TranslatesBinding, SchemaManifestSpec, ManifestMetadata, ApiVersion, ManifestKind, resolveLocalizedText, isLocalizedText, MANTLE_BIND_KEYWORD, MCP_HINT_KEYWORD, MantleRefTarget, resolveMantleRef, enumOptions, MANTLE_REF_KEYWORD, MediaMcpHint, isMediaMcpHint, API_VERSION };
|
|
7
|
+
import { ProcedureMcpAnnotations, JsonSchema, AuthorizationRequirements, RESERVED_PROCEDURE_INPUT_NAMES, INPUT_RULE_KEYWORDS, EXPECTED_VERSION_PROPERTY, RESERVED_ENTRY_COLUMNS, TriggerManifest, ProcedureManifest, ViewManifest, SchemaManifest, Manifest, HttpMethod, McpTriggerSurface, McpTriggerSource, MCP_TRIGGER_SURFACES, LifecycleHook, LifecycleTriggerSource, LIFECYCLE_HOOKS, HttpTriggerSource, ScheduleTriggerSource, TriggerSource, TriggerManifestSpec, AdminRole, isAdminRole, CtxAuthScopePredicate, CtxAuthPredicate, CtxUserPredicate, AuthPredicate, HandlerStep, stepProgram, HANDLER_STEP_KEYS, HandlerSqlBinding, HandlerRefBinding, HandlerBinding, PROCEDURE_MCP_ANNOTATION_KEYS, PROCEDURE_TARGET_KEYS, ProcedureTarget, LocalizedText, ProcedureManifestSpec, VIEW_INPUT_RESERVED, ViewCachePolicy, ViewSurface, ViewManifestSpec, VIEW_SURFACES, LifecycleMode, TranslatesBinding, LockVerb, SchemaLock, LOCK_VERBS, SchemaManifestSpec, ManifestMetadata, ApiVersion, ManifestKind, resolveLocalizedText, isLocalizedText, MANTLE_BIND_KEYWORD, MCP_HINT_KEYWORD, MantleRefTarget, resolveMantleRef, enumOptions, MANTLE_REF_KEYWORD, MediaMcpHint, isMediaMcpHint, API_VERSION } from "./spec/domain/model/ManifestGrammar.js";
|
|
8
|
+
export { ProcedureMcpAnnotations, JsonSchema, AuthorizationRequirements, RESERVED_PROCEDURE_INPUT_NAMES, INPUT_RULE_KEYWORDS, EXPECTED_VERSION_PROPERTY, RESERVED_ENTRY_COLUMNS, TriggerManifest, ProcedureManifest, ViewManifest, SchemaManifest, Manifest, HttpMethod, McpTriggerSurface, McpTriggerSource, MCP_TRIGGER_SURFACES, LifecycleHook, LifecycleTriggerSource, LIFECYCLE_HOOKS, HttpTriggerSource, ScheduleTriggerSource, TriggerSource, TriggerManifestSpec, AdminRole, isAdminRole, CtxAuthScopePredicate, CtxAuthPredicate, CtxUserPredicate, AuthPredicate, HandlerStep, stepProgram, HANDLER_STEP_KEYS, HandlerSqlBinding, HandlerRefBinding, HandlerBinding, PROCEDURE_MCP_ANNOTATION_KEYS, PROCEDURE_TARGET_KEYS, ProcedureTarget, LocalizedText, ProcedureManifestSpec, VIEW_INPUT_RESERVED, ViewCachePolicy, ViewSurface, ViewManifestSpec, VIEW_SURFACES, LifecycleMode, TranslatesBinding, LockVerb, SchemaLock, LOCK_VERBS, SchemaManifestSpec, ManifestMetadata, ApiVersion, ManifestKind, resolveLocalizedText, isLocalizedText, MANTLE_BIND_KEYWORD, MCP_HINT_KEYWORD, MantleRefTarget, resolveMantleRef, enumOptions, MANTLE_REF_KEYWORD, MediaMcpHint, isMediaMcpHint, API_VERSION };
|
|
9
9
|
import { Diagnostic, DiagnosticError, runtimeDiagnostic, bootDiagnostic, validateDiagnostic, makeDiagnostic, SourceLocation, Phase, DiagnosticCode, SourceSpan, SourcePosition, DIAGNOSTIC_CODES } from "./spec/kernel/diagnostic.js";
|
|
10
10
|
export { Diagnostic, DiagnosticError, runtimeDiagnostic, bootDiagnostic, validateDiagnostic, makeDiagnostic, SourceLocation, Phase, DiagnosticCode, SourceSpan, SourcePosition, DIAGNOSTIC_CODES };
|
|
11
11
|
import { planFingerprint, fnv, canonical } from "./spec/domain/service/PlanFingerprint.js";
|