graphddb 0.7.0 → 0.7.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/dist/index.js CHANGED
@@ -5,8 +5,10 @@ import {
5
5
  BatchGetResult,
6
6
  DDBModel,
7
7
  EDGE_WRITES_MARKER,
8
+ LOGICAL_EFFECT_CATEGORIES,
8
9
  MARKER_ROW_ENTITY,
9
10
  OLD_VALUE_NAMESPACE,
11
+ PREPARED_FORMAT_VERSION,
10
12
  PREPARE_CACHE_MAX,
11
13
  PreparedReadStatement,
12
14
  PreparedWriteStatement,
@@ -21,6 +23,7 @@ import {
21
23
  buildContexts,
22
24
  buildContracts,
23
25
  buildManifest,
26
+ buildManifestEntity,
24
27
  buildOperations,
25
28
  buildProjection,
26
29
  buildQuerySpec,
@@ -44,6 +47,7 @@ import {
44
47
  deriveModelEdgeWriteItems,
45
48
  edgeWrites,
46
49
  encodeCursor,
50
+ entityFingerprint,
47
51
  evaluateFilter,
48
52
  execute,
49
53
  executeBatchGet,
@@ -52,6 +56,8 @@ import {
52
56
  executeExplain,
53
57
  executeList,
54
58
  executeListInternal,
59
+ executeLogicalParallelWrites,
60
+ executeLogicalWriteOps,
55
61
  executeQuery,
56
62
  from,
57
63
  getEdgeWrites,
@@ -83,7 +89,7 @@ import {
83
89
  validateDepth,
84
90
  when,
85
91
  wholeKeysSentinel
86
- } from "./chunk-GFGVDF4W.js";
92
+ } from "./chunk-C5Q2NMRW.js";
87
93
  import {
88
94
  CdcEmulator,
89
95
  MAINT_OUTBOX_PK_PREFIX,
@@ -1282,6 +1288,256 @@ async function executeRangeFanout(op, keys, params = {}) {
1282
1288
  return out;
1283
1289
  }
1284
1290
 
1291
+ // src/runtime/prepared-loader.ts
1292
+ var LOAD_LABEL = "graphddb.loadPreparedPlan";
1293
+ function slotOfBind(bind) {
1294
+ if ("param" in bind) return { kind: "param", name: bind.param };
1295
+ if ("literal" in bind) return { kind: "literal", value: bind.literal };
1296
+ if ("literalDate" in bind) return { kind: "literal", value: new Date(bind.literalDate) };
1297
+ return { kind: "literal", value: BigInt(bind.literalBigInt) };
1298
+ }
1299
+ function slotsOfBindMap(map2) {
1300
+ const out = {};
1301
+ for (const [field2, bind] of Object.entries(map2 ?? {})) out[field2] = slotOfBind(bind);
1302
+ return out;
1303
+ }
1304
+ function bindValues(slots, params) {
1305
+ const out = {};
1306
+ for (const [field2, slot] of Object.entries(slots)) {
1307
+ out[field2] = slot.kind === "param" ? params[slot.name] : slot.value;
1308
+ }
1309
+ return out;
1310
+ }
1311
+ function resolveModelByName(name, planId) {
1312
+ for (const modelClass of MetadataRegistry.getAll().keys()) {
1313
+ if (modelClass.name === name) return modelClass;
1314
+ }
1315
+ throw new Error(
1316
+ `${LOAD_LABEL}: static plan '${planId}' targets entity '${name}', which is not a registered model in this process. Ensure the model module is imported before the plan executes, or regenerate the artifact (graphddb transform prepared --aot).`
1317
+ );
1318
+ }
1319
+ function bindEntities(plan2, planId) {
1320
+ const classes = /* @__PURE__ */ new Map();
1321
+ const entities = {};
1322
+ const tables = {};
1323
+ for (const [name, expected] of Object.entries(plan2.entities)) {
1324
+ const modelClass = resolveModelByName(name, planId);
1325
+ const metadata = MetadataRegistry.get(modelClass);
1326
+ const actual = entityFingerprint(metadata);
1327
+ if (actual !== expected) {
1328
+ throw new Error(
1329
+ `${LOAD_LABEL}: static plan '${planId}' is STALE \u2014 entity '${name}' has changed since the plan artifact was generated (declaration fingerprint mismatch: expected ${expected.slice(0, 12)}\u2026, live ${actual.slice(0, 12)}\u2026). A stale static plan never executes. Regenerate the artifact: \`graphddb transform prepared --aot <artifact> --write\` (CI: run the check mode to catch this at build time).`
1330
+ );
1331
+ }
1332
+ classes.set(name, modelClass);
1333
+ const entity = buildManifestEntity(metadata);
1334
+ entities[name] = entity;
1335
+ tables[metadata.tableName] = { physicalName: TableMapping.resolve(metadata.tableName) };
1336
+ }
1337
+ return { classes, manifest: { version: SPEC_VERSION, tables, entities } };
1338
+ }
1339
+ function templateParams(values) {
1340
+ const out = {};
1341
+ for (const [k2, v] of Object.entries(values)) {
1342
+ out[k2] = v instanceof Date ? v.toISOString() : v;
1343
+ }
1344
+ return out;
1345
+ }
1346
+ function renderSpecItem(transaction, index, manifest, params) {
1347
+ const single = {
1348
+ params: transaction.params,
1349
+ items: [transaction.items[index]]
1350
+ };
1351
+ return expandTransactionItems(single, manifest, params);
1352
+ }
1353
+ function renderEffectsForOp(op, boundParams) {
1354
+ const rendered = templateParams(boundParams);
1355
+ const effects = {};
1356
+ const checks = [];
1357
+ const modelBySignature = /* @__PURE__ */ new Map();
1358
+ const { transaction, categories } = op.spec;
1359
+ for (let i = 0; i < transaction.items.length; i++) {
1360
+ const category = categories[i];
1361
+ if (category === "base") continue;
1362
+ for (const out of renderSpecItem(transaction, i, op.manifest, rendered)) {
1363
+ const item = out.item;
1364
+ if (category === "check") {
1365
+ if (item.ConditionCheck !== void 0) checks.push(item.ConditionCheck);
1366
+ continue;
1367
+ }
1368
+ const family = category;
1369
+ if (!LOGICAL_EFFECT_CATEGORIES.includes(family)) {
1370
+ throw new Error(
1371
+ `${LOAD_LABEL}: unknown effect category '${String(category)}' in a static plan (artifact format skew \u2014 regenerate the artifact).`
1372
+ );
1373
+ }
1374
+ (effects[family] ??= []).push(item);
1375
+ if (out.model !== void 0) {
1376
+ modelBySignature.set(execItemKeySignature(item), out.model);
1377
+ }
1378
+ }
1379
+ }
1380
+ return { effects, checks, modelBySignature };
1381
+ }
1382
+ var INTENT_TO_KIND = { create: "put", update: "update", remove: "delete" };
1383
+ var AotPreparedWriteStatement = class {
1384
+ /** @internal */
1385
+ constructor(ops) {
1386
+ this.ops = ops;
1387
+ }
1388
+ ops;
1389
+ async execute(params = {}, options = {}) {
1390
+ const logical = this.ops.map((op) => {
1391
+ const bound = {
1392
+ ...bindValues(op.inputSlots, params),
1393
+ ...bindValues(op.keySlots, params)
1394
+ };
1395
+ const condition = op.conditionSlots !== void 0 ? bindValues(op.conditionSlots, params) : void 0;
1396
+ return {
1397
+ kind: INTENT_TO_KIND[op.spec.intent],
1398
+ modelClass: op.modelClass,
1399
+ modelStatic: op.modelStatic,
1400
+ keyFields: op.spec.keyFields,
1401
+ params: bound,
1402
+ // A `create` guards with attribute_not_exists — the same condition the
1403
+ // compiled base op carries; an explicit gate on a create was rejected at
1404
+ // BUILD time (mirroring the compiled core's `withCondition` reject).
1405
+ ...op.spec.intent === "create" ? { condition: { notExists: true } } : condition !== void 0 ? { condition } : {},
1406
+ ...op.spec.result !== void 0 ? { result: op.spec.result } : {},
1407
+ renderEffects: (postW1) => renderEffectsForOp(op, postW1)
1408
+ };
1409
+ });
1410
+ const mode = options.mode ?? "transaction";
1411
+ const runOpts = {
1412
+ label: LOAD_LABEL,
1413
+ ...options.retry !== void 0 ? { retry: options.retry } : {},
1414
+ ...options.context !== void 0 ? { context: options.context } : {}
1415
+ };
1416
+ if (mode === "transaction") {
1417
+ const { readBacks } = await executeLogicalWriteOps(logical, runOpts);
1418
+ const out2 = {};
1419
+ this.ops.forEach((op, i) => {
1420
+ if (op.spec.result !== void 0) out2[op.alias] = readBacks[i];
1421
+ });
1422
+ return out2;
1423
+ }
1424
+ const settled = await executeLogicalParallelWrites(logical, runOpts);
1425
+ const out = {};
1426
+ this.ops.forEach((op, i) => {
1427
+ const res = settled[i];
1428
+ out[op.alias] = res.ok ? { ok: true, value: op.spec.result !== void 0 ? res.value : void 0 } : { ok: false, error: res.error };
1429
+ });
1430
+ return out;
1431
+ }
1432
+ };
1433
+ function bindReadPlan(plan2, planId) {
1434
+ const { classes } = bindEntities(plan2, planId);
1435
+ const routes = (plan2.reads ?? []).map((r) => {
1436
+ const modelClass = classes.get(r.entity);
1437
+ if (modelClass === void 0) {
1438
+ throw new Error(
1439
+ `${LOAD_LABEL}: static plan '${planId}' route '${r.alias}' targets entity '${r.entity}', which the plan does not fingerprint (artifact skew \u2014 regenerate).`
1440
+ );
1441
+ }
1442
+ const consistentReadSlot = r.consistentRead !== void 0 ? slotOfBind(r.consistentRead) : void 0;
1443
+ const limitSlot = r.limit !== void 0 ? slotOfBind(r.limit) : void 0;
1444
+ const afterSlot = r.after !== void 0 ? slotOfBind(r.after) : void 0;
1445
+ return {
1446
+ alias: r.alias,
1447
+ kind: r.op,
1448
+ modelClass,
1449
+ select: r.select,
1450
+ keySlots: slotsOfBindMap(r.key),
1451
+ ...r.maxDepth !== void 0 ? { maxDepth: r.maxDepth } : {},
1452
+ ...r.order !== void 0 ? { order: r.order } : {},
1453
+ ...r.filter !== void 0 ? { filter: r.filter } : {},
1454
+ ...consistentReadSlot !== void 0 ? { consistentReadSlot } : {},
1455
+ ...limitSlot !== void 0 ? { limitSlot } : {},
1456
+ ...afterSlot !== void 0 ? { afterSlot } : {}
1457
+ };
1458
+ });
1459
+ return new PreparedReadStatement(routes);
1460
+ }
1461
+ function bindWritePlan(plan2, planId) {
1462
+ const { classes, manifest } = bindEntities(plan2, planId);
1463
+ const ops = (plan2.writes ?? []).map((w) => {
1464
+ const modelClass = classes.get(w.entity);
1465
+ if (modelClass === void 0) {
1466
+ throw new Error(
1467
+ `${LOAD_LABEL}: static plan '${planId}' op '${w.alias}' targets entity '${w.entity}', which the plan does not fingerprint (artifact skew \u2014 regenerate).`
1468
+ );
1469
+ }
1470
+ const modelStatic = modelClass.asModel();
1471
+ return {
1472
+ alias: w.alias,
1473
+ spec: w,
1474
+ modelClass,
1475
+ modelStatic,
1476
+ keySlots: slotsOfBindMap(w.key),
1477
+ inputSlots: slotsOfBindMap(w.input),
1478
+ ...w.condition !== void 0 ? { conditionSlots: slotsOfBindMap(w.condition) } : {},
1479
+ manifest
1480
+ };
1481
+ });
1482
+ return new AotPreparedWriteStatement(ops);
1483
+ }
1484
+ function bindPlan(doc, planId) {
1485
+ if (doc === null || typeof doc !== "object" || doc.plans === void 0) {
1486
+ throw new Error(`${LOAD_LABEL}: not a prepared-plan document.`);
1487
+ }
1488
+ if (doc.formatVersion !== PREPARED_FORMAT_VERSION) {
1489
+ throw new Error(
1490
+ `${LOAD_LABEL}: unsupported artifact format version '${String(doc.formatVersion)}' (this runtime supports '${PREPARED_FORMAT_VERSION}'). Regenerate the artifact with the installed graphddb version.`
1491
+ );
1492
+ }
1493
+ if (doc.specVersion !== SPEC_VERSION) {
1494
+ throw new Error(
1495
+ `${LOAD_LABEL}: the artifact was compiled against operation-IR version '${String(doc.specVersion)}' but this runtime speaks '${SPEC_VERSION}'. A version-skewed static plan never executes \u2014 regenerate the artifact.`
1496
+ );
1497
+ }
1498
+ const plan2 = doc.plans[planId];
1499
+ if (plan2 === void 0) {
1500
+ const available = Object.keys(doc.plans).sort().slice(0, 8).join(", ");
1501
+ throw new Error(
1502
+ `${LOAD_LABEL}: the artifact carries no plan '${planId}' (available: ${available}${Object.keys(doc.plans).length > 8 ? ", \u2026" : ""}). The source and the artifact have drifted \u2014 regenerate: \`graphddb transform prepared --aot <artifact> --write\`.`
1503
+ );
1504
+ }
1505
+ return plan2.kind === "read" ? bindReadPlan(plan2, planId) : bindWritePlan(plan2, planId);
1506
+ }
1507
+ var BOUND = /* @__PURE__ */ new WeakMap();
1508
+ var LazyAotHandle = class {
1509
+ constructor(doc, planId) {
1510
+ this.doc = doc;
1511
+ this.planId = planId;
1512
+ }
1513
+ doc;
1514
+ planId;
1515
+ bound;
1516
+ resolve() {
1517
+ if (this.bound !== void 0) return this.bound;
1518
+ let perDoc = BOUND.get(this.doc);
1519
+ if (perDoc === void 0) {
1520
+ perDoc = /* @__PURE__ */ new Map();
1521
+ BOUND.set(this.doc, perDoc);
1522
+ }
1523
+ let handle = perDoc.get(this.planId);
1524
+ if (handle === void 0) {
1525
+ handle = bindPlan(this.doc, this.planId);
1526
+ perDoc.set(this.planId, handle);
1527
+ }
1528
+ this.bound = handle;
1529
+ return handle;
1530
+ }
1531
+ async execute(params, options) {
1532
+ const target = this.resolve();
1533
+ return target.execute(params, options);
1534
+ }
1535
+ };
1536
+ function loadPreparedPlan(doc, planId, body) {
1537
+ void body;
1538
+ return new LazyAotHandle(doc, planId);
1539
+ }
1540
+
1285
1541
  // src/relation/maintenance-rebuild.ts
1286
1542
  function toClass(m) {
1287
1543
  try {
@@ -1858,6 +2114,7 @@ function assertDefinition(name, def) {
1858
2114
  }
1859
2115
  }
1860
2116
  export {
2117
+ AotPreparedWriteStatement,
1861
2118
  BATCH_GET_MAX_KEYS,
1862
2119
  BATCH_WRITE_MAX_ITEMS,
1863
2120
  BatchGetResult,
@@ -2006,6 +2263,7 @@ export {
2006
2263
  lifecyclePhaseForIntent,
2007
2264
  list,
2008
2265
  literal,
2266
+ loadPreparedPlan,
2009
2267
  maintainTrigger,
2010
2268
  maintainedFrom,
2011
2269
  map,
@@ -1,7 +1,7 @@
1
- import { L as LintRule } from '../registry-Cv9nl_3i.js';
2
- export { a as LintResult, b as Linter } from '../registry-Cv9nl_3i.js';
3
- export { c as createDefaultLinter, g as gsiAmbiguityRule, m as missingGsiRule, n as noScanRule, q as queryBoundaryRule, r as relationDepthRule, a as requireLimitRule } from '../relation-depth-BR0y7Q1i.js';
4
- import '../maintenance-view-adapter-BP2CJDdz.js';
1
+ import { L as LintRule } from '../registry-BndKbZbg.js';
2
+ export { a as LintResult, b as Linter } from '../registry-BndKbZbg.js';
3
+ export { c as createDefaultLinter, g as gsiAmbiguityRule, m as missingGsiRule, n as noScanRule, q as queryBoundaryRule, r as relationDepthRule, a as requireLimitRule } from '../relation-depth-CCGHLTOv.js';
4
+ import '../maintenance-view-adapter-NBTZbE8-.js';
5
5
  import '@aws-sdk/client-dynamodb';
6
6
 
7
7
  /**
@@ -4135,8 +4135,17 @@ declare function buildMaintenanceGraph(registry?: ReadonlyMap<Function, EntityMe
4135
4135
  * `PROFILE`).
4136
4136
  */
4137
4137
 
4138
- /** The schema version emitted in every manifest / operations document. */
4139
- declare const SPEC_VERSION: "1.0";
4138
+ /**
4139
+ * The schema version emitted in every manifest / operations document.
4140
+ *
4141
+ * `1.1` (issue #208, B案): the operation IR gained the **list fan-out binding
4142
+ * form** ({@link SourceListSpec} on a `BatchGetItem` relation op), lifting the
4143
+ * #197 `refs` loud-reject. The op vocabulary (the physical DynamoDB API surface)
4144
+ * is unchanged — only the dataflow (source→key) binding grammar grew. Purely
4145
+ * additive: every `1.0` document is a valid `1.1` document, and a document that
4146
+ * uses no `refs` relation serializes byte-identically apart from this version.
4147
+ */
4148
+ declare const SPEC_VERSION: "1.1";
4140
4149
  /** Field type as carried in the manifest (derived from the DynamoDB type). */
4141
4150
  type ManifestFieldType = 'string' | 'number' | 'boolean' | 'binary' | 'stringSet' | 'numberSet' | 'list' | 'map';
4142
4151
  interface ManifestField {
@@ -4306,6 +4315,45 @@ interface OperationSpec {
4306
4315
  * drive this operation's `{result.*}` placeholders. Absent on the root op.
4307
4316
  */
4308
4317
  readonly sourceField?: string;
4318
+ /**
4319
+ * The **list fan-out binding form** (issue #208, B案 — the shared-IR
4320
+ * generalization that lifted the #197 `refs` loud-reject). Present only on a
4321
+ * `BatchGetItem` relation operation that resolves a `refs` relation: instead of
4322
+ * reading ONE scalar `parent[sourceField]`, the runtime reads the parent **list
4323
+ * attribute** {@link SourceListSpec.from} and binds `{result.<sourceField>}`
4324
+ * once per element — `element[key]` for an object element, the element itself
4325
+ * for a bare scalar — skipping null/undefined refs. All element keys across all
4326
+ * parents fan into ONE deduped `BatchGetItem` (the existing chunk/retry
4327
+ * machinery), and the operation's `resultPath` (`…<prop>.items`) receives a
4328
+ * connection `{ items, cursor: null }` whose items are the resolved child
4329
+ * bodies in **first-seen element order**, deduped, with missing bodies dropped
4330
+ * — byte-matching the TS in-process `fetchRefsList` semantics. Absent on every
4331
+ * scalar-bound relation op (a pre-#208 document is byte-identical).
4332
+ */
4333
+ readonly sourceList?: SourceListSpec;
4334
+ }
4335
+ /**
4336
+ * The list-valued source descriptor of a fan-out `BatchGetItem` operation (issue
4337
+ * #208 B案; the operation-IR mirror of the manifest's `ManifestRelation.refs`).
4338
+ */
4339
+ interface SourceListSpec {
4340
+ /** The parent LIST attribute holding the inline reference elements (e.g. `tagRefs`). */
4341
+ readonly from: string;
4342
+ /**
4343
+ * The field read off each element (e.g. `tagId`). Always equals the operation's
4344
+ * `sourceField` (the `{result.<sourceField>}` token name); carried explicitly so
4345
+ * the op is self-describing.
4346
+ */
4347
+ readonly key: string;
4348
+ /**
4349
+ * `true` when the parent list attribute was NOT selected by the query and was
4350
+ * projected onto the parent operation **solely** to drive this fan-out. The
4351
+ * runtime must then delete `from` from every parent node after ALL relation
4352
+ * operations are applied — mirroring the TS hydrator, which projects implicit
4353
+ * relation-source fields but strips them from the assembled result. Absent when
4354
+ * the query's select projects the attribute itself (it stays in the result).
4355
+ */
4356
+ readonly implicit?: boolean;
4309
4357
  }
4310
4358
  /**
4311
4359
  * The **execution plan** for a multi-operation read (issue #70a). It is the
@@ -6368,7 +6416,9 @@ interface PreparedReadExecOptions {
6368
6416
  /**
6369
6417
  * A recorded binding: a value is either a param slot (bind from `params[name]`) or
6370
6418
  * a static literal (used verbatim). Discovered ONCE at prepare from the recording
6371
- * `$` proxy, replayed per `execute`.
6419
+ * `$` proxy, replayed per `execute`. Exported (@internal) for the #208 AOT
6420
+ * emitter (`src/spec/prepared.ts`) and loader (`src/runtime/prepared-loader.ts`),
6421
+ * which serialize / rebind exactly this structure.
6372
6422
  */
6373
6423
  type Slot = {
6374
6424
  readonly kind: 'param';
@@ -6386,6 +6436,9 @@ interface CompiledWriteOp {
6386
6436
  readonly conditionSlots?: Readonly<Record<string, Slot>>;
6387
6437
  readonly result?: PreparedWriteRoute['result'];
6388
6438
  }
6439
+ /** @internal — exported for the #208 AOT loader, which reconstructs these
6440
+ * routes from the static plan artifact and executes them through the SAME
6441
+ * {@link PreparedReadStatement}. */
6389
6442
  interface CompiledReadRoute {
6390
6443
  readonly alias: string;
6391
6444
  readonly kind: 'query' | 'list';
@@ -7316,4 +7369,4 @@ interface ViewDefinition {
7316
7369
  */
7317
7370
  declare function collectViewDefinitions(registry?: ReadonlyMap<Function, EntityMetadata>): ViewDefinition[];
7318
7371
 
7319
- export { type BridgeBundle as $, type Param as A, type BatchResult as B, type CdcEmulatorOptions as C, type DynamoDBOperation as D, type EventLog as E, type FaultSpec as F, type QueryMethodSpec as G, type CommandModelContract as H, type CommandMethodSpec as I, type ContractSpec as J, type QuerySpec as K, type CommandSpec as L, type ModelStatic as M, type TransactionSpec as N, type ContextSpec as O, type PutInput as P, type QueryModelContract as Q, type ReplayOptions as R, type ShardId as S, type TransactWriteExecItem as T, type Unsubscribe as U, type ViewDefinition as V, type WriteExecOptions as W, type DefinitionMap as X, type OperationsDocument as Y, type AnyOperationDefinition as Z, type Manifest as _, type CdcMode as a, type DynamoType as a$, type ConditionSpec as a0, type CommandContractMethodSpec as a1, type CommandResolutionTarget as a2, type CompiledFragment as a3, type CompiledMutationPlan as a4, type ComposeSpec as a5, type CompositionPlanSpec as a6, type ContractCardinality as a7, type ContractCommandResult as a8, type ContractInputArity as a9, type ReadOperationType as aA, SPEC_VERSION as aB, type TransactionItemSpec as aC, type TransactionItemType as aD, type WhenSpec as aE, type WriteOperationType as aF, assertNoCrossFragmentMaintainCollision as aG, compileFragment as aH, compileMutationPlan as aI, compileSingleFragmentPlan as aJ, resetMaintenanceGraphCache as aK, resolveLifecycle as aL, resolveMaintainers as aM, type SelectableOf as aN, type PrimaryKeyOf as aO, type RequestContext as aP, type Middleware as aQ, type ReadRequestKind as aR, type CtxModel as aS, type ReadParams as aT, type ReadRequestCtx as aU, type Item as aV, type RetryPolicy as aW, type KeyDefinition as aX, type GsiDefinition as aY, type ModelKind as aZ, type FieldOptions as a_, type ContractKeySpec as aa, type ContractKind as ab, type ContractResolution as ac, type DerivedConditionCheck as ad, type DerivedEdgeWrite as ae, type DerivedIdempotencyGuard as af, type DerivedMaintainOutbox as ag, type DerivedMaintainWrite as ah, type DerivedOutboxEvent as ai, type DerivedUniqueGuard as aj, type DerivedUpdate as ak, type EntityRefResolver as al, type ExecutionPlanSpec as am, type FilterSpec as an, MAX_TRANSACT_COMPOSE_ITEMS as ao, type ManifestEntity as ap, type ManifestField as aq, type ManifestFieldType as ar, type ManifestGsi as as, type ManifestKey as at, type ManifestRelation as au, type ManifestTable as av, type OperationSpec as aw, type ParamSpec as ax, type QueryContractMethodSpec as ay, type RangeConditionSpec as az, type ChangeBatch as b, type DeleteOptions as b$, type ProjectionTransform as b0, type MaintainEvent as b1, type MembershipPredicate as b2, type MaintainConsistency as b3, type MaintainUpdateMode as b4, type MembershipPredicateOp as b5, type RelationOptions as b6, type AggregateOptions as b7, type AggregateValue as b8, type SelectBuilderSpec as b9, type CollectionOptions as bA, type Column as bB, type ColumnMap as bC, type CommandInputShape as bD, type CommandMethod as bE, type CommandPlan as bF, type CommandResultKind as bG, type CommandSelectShape as bH, type CondSlot as bI, type ConditionCheckInput as bJ, type Connection as bK, type ContractCallSignature as bL, type ContractCommandParams as bM, type ContractComposeNode as bN, type ContractFromRef as bO, type ContractItem as bP, type ContractKeyFieldRef as bQ, type ContractKeyInput as bR, type ContractKeyRef as bS, type ContractMethodOp as bT, type ContractParamRef as bU, type ContractQueryParams as bV, type CounterAggregate as bW, type CounterEffect as bX, type CtxBase as bY, DEFAULT_MAX_ATTEMPTS as bZ, DEFAULT_RETRY_POLICY as b_, type RawCondition as ba, type RetryOverride as bb, type ExecutionPlan as bc, type FieldMetadata as bd, type ResolvedKey as be, type RelationMetadata as bf, type MaintainEffect as bg, type OperationDefinition as bh, type WriteDefinitionOptions as bi, type PartialQueryKeyOf as bj, type StrictSelectSpec as bk, type ReadDefinitionOptions as bl, type EntityInput as bm, type UniqueQueryKeyOf as bn, type AggregateMetadata as bo, type BatchDeleteRequest as bp, type BatchGetOptions as bq, type BatchGetRequest as br, BatchGetResult as bs, type BatchPutRequest as bt, type BatchWriteRequest as bu, CONTRACT_RANGE_FANOUT_CONCURRENCY as bv, type CdcModelRegistry as bw, type CdcSubscribeHandlers as bx, type Change as by, type CollectionEffect as bz, type ChangeEvent as c, type ProjectionTransformOp as c$, type DeriveEffect as c0, type DescriptorBinding as c1, ENTITY_WRITES_MARKER as c2, type EdgeEffect as c3, type EffectPath as c4, type EmbeddedMetadata as c5, type EmitEffect as c6, type EntityWritesDefinition as c7, type EntityWritesShape as c8, type ExecutableCommandContract as c9, type MutateTransactionResult as cA, type MutationBody as cB, type MutationDescriptorMap as cC, type MutationFragment as cD, type MutationInputProxy as cE, type MutationInputRef as cF, type MutationIntent as cG, type NumberParam as cH, type OperationKind as cI, PREPARE_CACHE_MAX as cJ, type ParallelOpResult as cK, type ParamKind as cL, type ParamStructure as cM, type PersistCtx as cN, type PersistOrigin as cO, type PlannedCommandMethod as cP, type PreparedBody as cQ, type PreparedInputProxy as cR, type PreparedParamRef as cS, type PreparedReadExecOptions as cT, type PreparedReadRoute as cU, PreparedReadStatement as cV, type PreparedStatement as cW, type PreparedWriteExecOptions as cX, type PreparedWriteRoute as cY, PreparedWriteStatement as cZ, type ProjectionMap as c_, type ExecutableQueryContract as ca, type FilterInput as cb, type FragmentInput as cc, type GsiDefinitionMarker as cd, type GsiOptions as ce, type IdempotencyEffect as cf, type InProcessWriteDescriptor as cg, type InlineSnapshotSpec as ch, type InputArity as ci, type KeyDefinitionMarker as cj, type KeySegment as ck, type KeySlot as cl, type KeyStructure as cm, type KeyedResult as cn, LIFECYCLE_CONTRACT_MARKER as co, type LifecycleContract as cp, type LifecycleEffects as cq, type LiteralParam as cr, type MaintainItem as cs, type MaintainTrigger as ct, type MaintenanceGraph as cu, type MembershipEffect as cv, type ModelRef as cw, type MutateMode as cx, type MutateOptions as cy, type MutateParallelResult as cz, type ChangeEventName as d, executeQueryMethod as d$, type PutOptions as d0, type QueryEnvelopeResult as d1, type QueryKeyOf as d2, type QueryMethod as d3, type QueryResult as d4, type ReadEnvelope as d5, type ReadOpCtx as d6, type ReadOpKind as d7, type ReadRouteDescriptor as d8, type ReadRouteOptions as d9, type UpdateOptions as dA, type ViewSourceSlice as dB, type WriteCtx as dC, type WriteDescriptor as dD, type WriteEnvelope as dE, type WriteInput as dF, type WriteKind as dG, type WriteLifecyclePhase as dH, type WriteMiddleware as dI, type WriteRecorder as dJ, type WriteResultProjection as dK, attachModelClass as dL, buildDeleteInput as dM, buildMaintenanceGraph as dN, buildPutInput as dO, buildUpdateInput as dP, collectViewDefinitions as dQ, cond as dR, contractOfMethodSpec as dS, definePlan as dT, entityWrites as dU, executeBatchGet as dV, executeBatchWrite as dW, executeCommandMethod as dX, executeDelete as dY, executeKeyedBatchGet as dZ, executePut as d_, type ReadRouteResult as da, type RecordedCompose as db, type RelationBuilder as dc, type RelationConsistency as dd, type RelationLimitOptions as de, type RelationPattern as df, type RelationProjection as dg, type RelationReadOptions as dh, type RelationSelect as di, type RelationSpec as dj, type RelationUpdateMode as dk, type RelationWriteOptions as dl, type RequiresEffect as dm, type Resolution as dn, type RetryInfo as dp, type RetryOperationKind as dq, type SegmentSpec as dr, type SegmentedKey as ds, type SelectBuilder as dt, type SelectOf as du, type SnapshotEffect as dv, type StringParam as dw, TransactionContext as dx, type UniqueEffect as dy, type Updatable as dz, type ChangeHandler as e, executeRangeFanout as e0, executeTransaction as e1, executeUpdate as e2, from as e3, getEntityWrites as e4, gsi as e5, identity as e6, isColumn as e7, isCommandModelContract as e8, isCommandPlan as e9, preview as eA, publicCommandModel as eB, publicQueryModel as eC, query as eD, wholeKeysSentinel as eE, isContractComposeNode as ea, isContractFromRef as eb, isContractKeyFieldRef as ec, isContractKeyRef as ed, isContractParamRef as ee, isEntityWritesDefinition as ef, isKeySegment as eg, isLifecycleContract as eh, isMaintainTrigger as ei, isMutationFragment as ej, isMutationInputRef as ek, isParam as el, isPlannedCommandMethod as em, isPreparedParamRef as en, isQueryModelContract as eo, isRetryableError as ep, isRetryableTransactionCancellation as eq, k as er, key as es, lifecyclePhaseForIntent as et, maintainTrigger as eu, mintContractKeyFieldRef as ev, mintContractParamRef as ew, mutation as ex, param as ey, prepare as ez, type ClockMode as f, type ConcurrentRecomputeRef as g, type StartingPosition as h, type StreamViewType as i, type SubscribeHandler as j, type SubscribeHandlers as k, buildSubscribeHandler as l, type EntityMetadata as m, type Executor as n, type ReadExecOptions as o, type ExecutorResult as p, type BatchGetExecInput as q, type WriteResult as r, type UpdateInput as s, type DeleteInput as t, type BatchWriteExecItem as u, type BatchExecOptions as v, DDBModel as w, type ParamDescriptor as x, type EntityRef as y, type ConditionInput as z };
7372
+ export { type OperationsDocument as $, type ContractSpec as A, type BatchResult as B, type CdcEmulatorOptions as C, type DynamoDBOperation as D, type EventLog as E, type FaultSpec as F, type QuerySpec as G, type CommandSpec as H, type TransactionSpec as I, type ContextSpec as J, SPEC_VERSION as K, type ParamSpec as L, type ModelStatic as M, type PreparedBody as N, type ParamDescriptor as O, type PutInput as P, type QueryModelContract as Q, type ReplayOptions as R, type ShardId as S, type TransactWriteExecItem as T, type Unsubscribe as U, type ViewDefinition as V, type WriteExecOptions as W, type EntityRef as X, type ConditionInput as Y, type Param as Z, type DefinitionMap as _, type CdcMode as a, type FieldOptions as a$, type AnyOperationDefinition as a0, type Manifest as a1, type BridgeBundle as a2, type ConditionSpec as a3, type CommandContractMethodSpec as a4, type CommandResolutionTarget as a5, type CompiledFragment as a6, type CompiledMutationPlan as a7, type ComposeSpec as a8, type CompositionPlanSpec as a9, type QueryContractMethodSpec as aA, type RangeConditionSpec as aB, type ReadOperationType as aC, type TransactionItemSpec as aD, type TransactionItemType as aE, type WhenSpec as aF, type WriteOperationType as aG, assertNoCrossFragmentMaintainCollision as aH, compileFragment as aI, compileMutationPlan as aJ, compileSingleFragmentPlan as aK, resetMaintenanceGraphCache as aL, resolveLifecycle as aM, resolveMaintainers as aN, type SelectableOf as aO, type PrimaryKeyOf as aP, type RequestContext as aQ, type Middleware as aR, type ReadRequestKind as aS, type CtxModel as aT, type ReadParams as aU, type ReadRequestCtx as aV, type Item as aW, type RetryPolicy as aX, type KeyDefinition as aY, type GsiDefinition as aZ, type ModelKind as a_, type ContractCardinality as aa, type ContractCommandResult as ab, type ContractInputArity as ac, type ContractKeySpec as ad, type ContractKind as ae, type ContractResolution as af, type DerivedConditionCheck as ag, type DerivedEdgeWrite as ah, type DerivedIdempotencyGuard as ai, type DerivedMaintainOutbox as aj, type DerivedMaintainWrite as ak, type DerivedOutboxEvent as al, type DerivedUniqueGuard as am, type DerivedUpdate as an, type EntityRefResolver as ao, type ExecutionPlanSpec as ap, type FilterSpec as aq, MAX_TRANSACT_COMPOSE_ITEMS as ar, type ManifestEntity as as, type ManifestField as at, type ManifestFieldType as au, type ManifestGsi as av, type ManifestKey as aw, type ManifestRelation as ax, type ManifestTable as ay, type OperationSpec as az, type ChangeBatch as b, type ContractQueryParams as b$, type DynamoType as b0, type ProjectionTransform as b1, type MaintainEvent as b2, type MembershipPredicate as b3, type MaintainConsistency as b4, type MaintainUpdateMode as b5, type MembershipPredicateOp as b6, type RelationOptions as b7, type AggregateOptions as b8, type AggregateValue as b9, type BatchWriteRequest as bA, CONTRACT_RANGE_FANOUT_CONCURRENCY as bB, type CdcModelRegistry as bC, type CdcSubscribeHandlers as bD, type Change as bE, type CollectionEffect as bF, type CollectionOptions as bG, type Column as bH, type ColumnMap as bI, type CommandInputShape as bJ, type CommandMethod as bK, type CommandPlan as bL, type CommandResultKind as bM, type CommandSelectShape as bN, type CondSlot as bO, type ConditionCheckInput as bP, type Connection as bQ, type ContractCallSignature as bR, type ContractCommandParams as bS, type ContractComposeNode as bT, type ContractFromRef as bU, type ContractItem as bV, type ContractKeyFieldRef as bW, type ContractKeyInput as bX, type ContractKeyRef as bY, type ContractMethodOp as bZ, type ContractParamRef as b_, type SelectBuilderSpec as ba, type RawCondition as bb, type RetryOverride as bc, type ExecutionPlan as bd, type FieldMetadata as be, type ResolvedKey as bf, type Slot as bg, type PreparedWriteExecOptions as bh, type CommandReturn as bi, type ParallelOpResult as bj, type PreparedStatement as bk, type RelationMetadata as bl, type MaintainEffect as bm, type OperationDefinition as bn, type WriteDefinitionOptions as bo, type PartialQueryKeyOf as bp, type StrictSelectSpec as bq, type ReadDefinitionOptions as br, type EntityInput as bs, type UniqueQueryKeyOf as bt, type AggregateMetadata as bu, type BatchDeleteRequest as bv, type BatchGetOptions as bw, type BatchGetRequest as bx, BatchGetResult as by, type BatchPutRequest as bz, type ChangeEvent as c, PreparedWriteStatement as c$, type CounterAggregate as c0, type CounterEffect as c1, type CtxBase as c2, DEFAULT_MAX_ATTEMPTS as c3, DEFAULT_RETRY_POLICY as c4, type DeleteOptions as c5, type DeriveEffect as c6, type DescriptorBinding as c7, ENTITY_WRITES_MARKER as c8, type EdgeEffect as c9, type MaintenanceGraph as cA, type MembershipEffect as cB, type ModelRef as cC, type MutateMode as cD, type MutateOptions as cE, type MutateParallelResult as cF, type MutateTransactionResult as cG, type MutationBody as cH, type MutationDescriptorMap as cI, type MutationFragment as cJ, type MutationInputProxy as cK, type MutationInputRef as cL, type MutationIntent as cM, type NumberParam as cN, type OperationKind as cO, PREPARE_CACHE_MAX as cP, type ParamKind as cQ, type ParamStructure as cR, type PersistCtx as cS, type PersistOrigin as cT, type PlannedCommandMethod as cU, type PreparedInputProxy as cV, type PreparedParamRef as cW, type PreparedReadExecOptions as cX, type PreparedReadRoute as cY, PreparedReadStatement as cZ, type PreparedWriteRoute as c_, type EffectPath as ca, type EmbeddedMetadata as cb, type EmitEffect as cc, type EntityWritesDefinition as cd, type EntityWritesShape as ce, type ExecutableCommandContract as cf, type ExecutableQueryContract as cg, type FilterInput as ch, type FragmentInput as ci, type GsiDefinitionMarker as cj, type GsiOptions as ck, type IdempotencyEffect as cl, type InProcessWriteDescriptor as cm, type InlineSnapshotSpec as cn, type InputArity as co, type KeyDefinitionMarker as cp, type KeySegment as cq, type KeySlot as cr, type KeyStructure as cs, type KeyedResult as ct, LIFECYCLE_CONTRACT_MARKER as cu, type LifecycleContract as cv, type LifecycleEffects as cw, type LiteralParam as cx, type MaintainItem as cy, type MaintainTrigger as cz, type ChangeEventName as d, executeKeyedBatchGet as d$, type ProjectionMap as d0, type ProjectionTransformOp as d1, type PutOptions as d2, type QueryEnvelopeResult as d3, type QueryKeyOf as d4, type QueryMethod as d5, type QueryResult as d6, type ReadEnvelope as d7, type ReadOpCtx as d8, type ReadOpKind as d9, type UniqueEffect as dA, type Updatable as dB, type UpdateOptions as dC, type ViewSourceSlice as dD, type WriteCtx as dE, type WriteDescriptor as dF, type WriteEnvelope as dG, type WriteInput as dH, type WriteKind as dI, type WriteLifecyclePhase as dJ, type WriteMiddleware as dK, type WriteRecorder as dL, type WriteResultProjection as dM, attachModelClass as dN, buildDeleteInput as dO, buildMaintenanceGraph as dP, buildPutInput as dQ, buildUpdateInput as dR, collectViewDefinitions as dS, cond as dT, contractOfMethodSpec as dU, definePlan as dV, entityWrites as dW, executeBatchGet as dX, executeBatchWrite as dY, executeCommandMethod as dZ, executeDelete as d_, type ReadRouteDescriptor as da, type ReadRouteOptions as db, type ReadRouteResult as dc, type RecordedCompose as dd, type RelationBuilder as de, type RelationConsistency as df, type RelationLimitOptions as dg, type RelationPattern as dh, type RelationProjection as di, type RelationReadOptions as dj, type RelationSelect as dk, type RelationSpec as dl, type RelationUpdateMode as dm, type RelationWriteOptions as dn, type RequiresEffect as dp, type Resolution as dq, type RetryInfo as dr, type RetryOperationKind as ds, type SegmentSpec as dt, type SegmentedKey as du, type SelectBuilder as dv, type SelectOf as dw, type SnapshotEffect as dx, type StringParam as dy, TransactionContext as dz, type ChangeHandler as e, executePut as e0, executeQueryMethod as e1, executeRangeFanout as e2, executeTransaction as e3, executeUpdate as e4, from as e5, getEntityWrites as e6, gsi as e7, identity as e8, isColumn as e9, param as eA, prepare as eB, preview as eC, publicCommandModel as eD, publicQueryModel as eE, query as eF, wholeKeysSentinel as eG, isCommandModelContract as ea, isCommandPlan as eb, isContractComposeNode as ec, isContractFromRef as ed, isContractKeyFieldRef as ee, isContractKeyRef as ef, isContractParamRef as eg, isEntityWritesDefinition as eh, isKeySegment as ei, isLifecycleContract as ej, isMaintainTrigger as ek, isMutationFragment as el, isMutationInputRef as em, isParam as en, isPlannedCommandMethod as eo, isPreparedParamRef as ep, isQueryModelContract as eq, isRetryableError as er, isRetryableTransactionCancellation as es, k as et, key as eu, lifecyclePhaseForIntent as ev, maintainTrigger as ew, mintContractKeyFieldRef as ex, mintContractParamRef as ey, mutation as ez, type ClockMode as f, type ConcurrentRecomputeRef as g, type StartingPosition as h, type StreamViewType as i, type SubscribeHandler as j, type SubscribeHandlers as k, buildSubscribeHandler as l, type EntityMetadata as m, type Executor as n, type ReadExecOptions as o, type ExecutorResult as p, type BatchGetExecInput as q, type WriteResult as r, type UpdateInput as s, type DeleteInput as t, type BatchWriteExecItem as u, type BatchExecOptions as v, DDBModel as w, type QueryMethodSpec as x, type CommandModelContract as y, type CommandMethodSpec as z };
@@ -1,4 +1,4 @@
1
- import { m as EntityMetadata } from './maintenance-view-adapter-BP2CJDdz.js';
1
+ import { m as EntityMetadata } from './maintenance-view-adapter-NBTZbE8-.js';
2
2
 
3
3
  interface LintRule {
4
4
  id: string;
@@ -1,4 +1,4 @@
1
- import { b as Linter, L as LintRule } from './registry-Cv9nl_3i.js';
1
+ import { b as Linter, L as LintRule } from './registry-BndKbZbg.js';
2
2
 
3
3
  /**
4
4
  * Creates a Linter pre-loaded with rules safe for Entity registration.
@@ -1,4 +1,4 @@
1
- export { $ as BridgeBundle, a1 as CommandContractMethodSpec, a2 as CommandResolutionTarget, L as CommandSpec, a3 as CompiledFragment, a4 as CompiledMutationPlan, a5 as ComposeSpec, a6 as CompositionPlanSpec, a0 as ConditionSpec, O as ContextSpec, a7 as ContractCardinality, a8 as ContractCommandResult, a9 as ContractInputArity, aa as ContractKeySpec, ab as ContractKind, ac as ContractResolution, J as ContractSpec, ad as DerivedConditionCheck, ae as DerivedEdgeWrite, af as DerivedIdempotencyGuard, ag as DerivedMaintainOutbox, ah as DerivedMaintainWrite, ai as DerivedOutboxEvent, aj as DerivedUniqueGuard, ak as DerivedUpdate, al as EntityRefResolver, am as ExecutionPlanSpec, an as FilterSpec, ao as MAX_TRANSACT_COMPOSE_ITEMS, _ as Manifest, ap as ManifestEntity, aq as ManifestField, ar as ManifestFieldType, as as ManifestGsi, at as ManifestKey, au as ManifestRelation, av as ManifestTable, aw as OperationSpec, Y as OperationsDocument, ax as ParamSpec, ay as QueryContractMethodSpec, K as QuerySpec, az as RangeConditionSpec, aA as ReadOperationType, aB as SPEC_VERSION, aC as TransactionItemSpec, aD as TransactionItemType, N as TransactionSpec, aE as WhenSpec, aF as WriteOperationType, aG as assertNoCrossFragmentMaintainCollision, aH as compileFragment, aI as compileMutationPlan, aJ as compileSingleFragmentPlan, aK as resetMaintenanceGraphCache, aL as resolveLifecycle, aM as resolveMaintainers } from '../maintenance-view-adapter-BP2CJDdz.js';
2
- export { A as AnyModelContract, B as BuiltContracts, C as ContextOwnership, a as ContextOwnershipMap, b as ContractBoundaryViolation, c as ContractInputs, d as ContractMap, e as ContractN1Violation, o as assertBundleSerializable, p as assertContractBoundaries, q as assertContractN1Safe, r as assertJsonSerializable, s as assertSupportedCondition, t as buildBridgeBundle, u as buildContexts, v as buildContracts, w as buildManifest, x as buildOperations, y as buildQuerySpec, z as buildTransactionSpec, D as buildTransactions, E as collectContractBoundaryViolations, F as collectContractN1Violations } from '../index-Eg94ChE1.js';
3
- import '../registry-Cv9nl_3i.js';
1
+ export { a2 as BridgeBundle, a4 as CommandContractMethodSpec, a5 as CommandResolutionTarget, H as CommandSpec, a6 as CompiledFragment, a7 as CompiledMutationPlan, a8 as ComposeSpec, a9 as CompositionPlanSpec, a3 as ConditionSpec, J as ContextSpec, aa as ContractCardinality, ab as ContractCommandResult, ac as ContractInputArity, ad as ContractKeySpec, ae as ContractKind, af as ContractResolution, A as ContractSpec, ag as DerivedConditionCheck, ah as DerivedEdgeWrite, ai as DerivedIdempotencyGuard, aj as DerivedMaintainOutbox, ak as DerivedMaintainWrite, al as DerivedOutboxEvent, am as DerivedUniqueGuard, an as DerivedUpdate, ao as EntityRefResolver, ap as ExecutionPlanSpec, aq as FilterSpec, ar as MAX_TRANSACT_COMPOSE_ITEMS, a1 as Manifest, as as ManifestEntity, at as ManifestField, au as ManifestFieldType, av as ManifestGsi, aw as ManifestKey, ax as ManifestRelation, ay as ManifestTable, az as OperationSpec, $ as OperationsDocument, L as ParamSpec, aA as QueryContractMethodSpec, G as QuerySpec, aB as RangeConditionSpec, aC as ReadOperationType, K as SPEC_VERSION, aD as TransactionItemSpec, aE as TransactionItemType, I as TransactionSpec, aF as WhenSpec, aG as WriteOperationType, aH as assertNoCrossFragmentMaintainCollision, aI as compileFragment, aJ as compileMutationPlan, aK as compileSingleFragmentPlan, aL as resetMaintenanceGraphCache, aM as resolveLifecycle, aN as resolveMaintainers } from '../maintenance-view-adapter-NBTZbE8-.js';
2
+ export { A as AnyModelContract, B as BuiltContracts, C as ContextOwnership, b as ContextOwnershipMap, c as ContractBoundaryViolation, d as ContractInputs, e as ContractMap, f as ContractN1Violation, O as PREPARED_FORMAT_VERSION, Q as PreparedBindMap, g as PreparedBindSpec, a as PreparedPlanDocument, h as PreparedPlanSpec, i as PreparedReadRouteSpec, P as PreparedWriteOpSpec, s as assertBundleSerializable, t as assertContractBoundaries, u as assertContractN1Safe, v as assertJsonSerializable, w as assertSupportedCondition, x as buildBridgeBundle, y as buildContexts, z as buildContracts, D as buildManifest, E as buildOperations, R as buildPreparedPlanDocument, F as buildQuerySpec, G as buildTransactionSpec, H as buildTransactions, S as canonicalJson, I as collectContractBoundaryViolations, J as collectContractN1Violations, U as compilePreparedPlan, V as entityFingerprint, X as planFingerprint } from '../index-CvS9ATKB.js';
3
+ import '../registry-BndKbZbg.js';
4
4
  import '@aws-sdk/client-dynamodb';
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  MAX_TRANSACT_COMPOSE_ITEMS,
3
+ PREPARED_FORMAT_VERSION,
3
4
  SPEC_VERSION,
4
5
  assertBundleSerializable,
5
6
  assertContractBoundaries,
@@ -12,22 +13,28 @@ import {
12
13
  buildContracts,
13
14
  buildManifest,
14
15
  buildOperations,
16
+ buildPreparedPlanDocument,
15
17
  buildQuerySpec,
16
18
  buildTransactionSpec,
17
19
  buildTransactions,
20
+ canonicalJson,
18
21
  collectContractBoundaryViolations,
19
22
  collectContractN1Violations,
20
23
  compileFragment,
21
24
  compileMutationPlan,
25
+ compilePreparedPlan,
22
26
  compileSingleFragmentPlan,
27
+ entityFingerprint,
28
+ planFingerprint,
23
29
  resetMaintenanceGraphCache,
24
30
  resolveLifecycle,
25
31
  resolveMaintainers
26
- } from "../chunk-GFGVDF4W.js";
32
+ } from "../chunk-C5Q2NMRW.js";
27
33
  import "../chunk-F2DI3GTI.js";
28
34
  import "../chunk-PDUVTYC5.js";
29
35
  export {
30
36
  MAX_TRANSACT_COMPOSE_ITEMS,
37
+ PREPARED_FORMAT_VERSION,
31
38
  SPEC_VERSION,
32
39
  assertBundleSerializable,
33
40
  assertContractBoundaries,
@@ -40,14 +47,19 @@ export {
40
47
  buildContracts,
41
48
  buildManifest,
42
49
  buildOperations,
50
+ buildPreparedPlanDocument,
43
51
  buildQuerySpec,
44
52
  buildTransactionSpec,
45
53
  buildTransactions,
54
+ canonicalJson,
46
55
  collectContractBoundaryViolations,
47
56
  collectContractN1Violations,
48
57
  compileFragment,
49
58
  compileMutationPlan,
59
+ compilePreparedPlan,
50
60
  compileSingleFragmentPlan,
61
+ entityFingerprint,
62
+ planFingerprint,
51
63
  resetMaintenanceGraphCache,
52
64
  resolveLifecycle,
53
65
  resolveMaintainers
@@ -1,4 +1,4 @@
1
- import { n as Executor, D as DynamoDBOperation, o as ReadExecOptions, p as ExecutorResult, q as BatchGetExecInput, P as PutInput, W as WriteExecOptions, r as WriteResult, s as UpdateInput, t as DeleteInput, u as BatchWriteExecItem, v as BatchExecOptions, T as TransactWriteExecItem, M as ModelStatic, w as DDBModel, c as ChangeEvent } from '../maintenance-view-adapter-BP2CJDdz.js';
1
+ import { n as Executor, D as DynamoDBOperation, o as ReadExecOptions, p as ExecutorResult, q as BatchGetExecInput, P as PutInput, W as WriteExecOptions, r as WriteResult, s as UpdateInput, t as DeleteInput, u as BatchWriteExecItem, v as BatchExecOptions, T as TransactWriteExecItem, M as ModelStatic, w as DDBModel, c as ChangeEvent } from '../maintenance-view-adapter-NBTZbE8-.js';
2
2
  import '@aws-sdk/client-dynamodb';
3
3
 
4
4
  /**
@@ -115,7 +115,10 @@ type PreparedDiagnosticCode =
115
115
  /** The `prepare` argument is not a statically visible function body. */
116
116
  | 'unverifiable-body'
117
117
  /** Informational: an inline call site the transform hoists (check mode). */
118
- | 'hoistable';
118
+ | 'hoistable'
119
+ /** Informational (#208 --aot check mode): a `DDBModel.prepare` call site not
120
+ * yet rewritten to the static-plan loader (`--aot … --write` rewrites it). */
121
+ | 'aot-pending';
119
122
  /** One lint / transform diagnostic, positioned in the original source. */
120
123
  interface PreparedDiagnostic {
121
124
  readonly code: PreparedDiagnosticCode;
@@ -163,5 +166,51 @@ declare function transformPreparedSource(fileName: string, sourceText: string, o
163
166
  * reported as `hoistable` notes so a build can surface silent-slow fallbacks.
164
167
  */
165
168
  declare function lintPreparedSource(fileName: string, sourceText: string): readonly PreparedDiagnostic[];
169
+ /** The local identifier the rewrite binds `loadPreparedPlan` to. */
170
+ declare const AOT_LOADER_LOCAL = "__gddbLoadPreparedPlan";
171
+ /** The local identifier the rewrite binds the artifact document to. */
172
+ declare const AOT_PLANS_LOCAL = "__gddbPreparedPlans";
173
+ /** The named export of an evaluation shim: `{ <siteIndex>: <bodyFn> }`. */
174
+ declare const AOT_SHIM_EXPORT = "__gddbAotBodies";
175
+ /** One discovered prepared call site (either form), verified and numbered. */
176
+ interface PreparedAotSite {
177
+ /** 1-based document-order index within the file. */
178
+ readonly index: number;
179
+ /** The stable plan id: `<planIdPrefix>#<index>`. */
180
+ readonly planId: string;
181
+ /** `prepare` (original form) or `aot` (already rewritten). */
182
+ readonly form: 'prepare' | 'aot';
183
+ }
184
+ /** The per-file result of the AOT pass. */
185
+ interface PreparedAotFileResult {
186
+ readonly fileName: string;
187
+ /** The rewritten source (identical to the input in check mode / no change). */
188
+ readonly text: string;
189
+ readonly changed: boolean;
190
+ readonly sites: readonly PreparedAotSite[];
191
+ /**
192
+ * The evaluation-shim module source (present when the file has ≥1 verified
193
+ * site and no violations). Importing it yields `{ [AOT_SHIM_EXPORT]:
194
+ * Record<siteIndex, PreparedBody> }`.
195
+ */
196
+ readonly shimSource?: string;
197
+ readonly diagnostics: readonly PreparedDiagnostic[];
198
+ readonly errorCount: number;
199
+ }
200
+ interface PreparedAotOptions {
201
+ /** `transform` rewrites call sites; `check` only discovers + lints (drift mode). */
202
+ readonly mode: 'transform' | 'check';
203
+ /** The plan-id prefix — the project-relative source path (POSIX separators). */
204
+ readonly planIdPrefix: string;
205
+ /** The module specifier the rewrite imports the artifact document from. */
206
+ readonly artifactImport: string;
207
+ }
208
+ /**
209
+ * The #208 AOT pass over one source file: discover + verify every prepared call
210
+ * site (both forms), assign stable plan ids, build the evaluation shim, and (in
211
+ * `transform` mode) rewrite `DDBModel.prepare` sites to the static-plan loader.
212
+ * See the section header above for the full contract.
213
+ */
214
+ declare function transformPreparedSourceAot(fileName: string, sourceText: string, options: PreparedAotOptions): PreparedAotFileResult;
166
215
 
167
- export { HOIST_SLOT_PREFIX, type PreparedDiagnostic, type PreparedDiagnosticCode, type PreparedTransformOptions, type PreparedTransformResult, lintPreparedSource, transformPreparedSource };
216
+ export { AOT_LOADER_LOCAL, AOT_PLANS_LOCAL, AOT_SHIM_EXPORT, HOIST_SLOT_PREFIX, type PreparedAotFileResult, type PreparedAotOptions, type PreparedAotSite, type PreparedDiagnostic, type PreparedDiagnosticCode, type PreparedTransformOptions, type PreparedTransformResult, lintPreparedSource, transformPreparedSource, transformPreparedSourceAot };