@powerhousedao/reactor 6.2.3-dev.23 → 6.2.3-dev.24

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.
Files changed (26) hide show
  1. package/dist/{build-worker-executor-DUjyF4NM.js → build-worker-executor-DxmDJ4QQ.js} +24 -8
  2. package/dist/build-worker-executor-DxmDJ4QQ.js.map +1 -0
  3. package/dist/{document-indexer-CQzTEE1o.js → document-indexer-Dn9RB0sg.js} +3 -3
  4. package/dist/{document-indexer-CQzTEE1o.js.map → document-indexer-Dn9RB0sg.js.map} +1 -1
  5. package/dist/{drive-container-types-CS5IxDiA.js → drive-container-types-Be5-EY9W.js} +843 -144
  6. package/dist/drive-container-types-Be5-EY9W.js.map +1 -0
  7. package/dist/entry.js +10 -5
  8. package/dist/entry.js.map +1 -1
  9. package/dist/index.d.ts +1951 -1805
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +203 -99
  12. package/dist/index.js.map +1 -1
  13. package/dist/projection-entry.js +4 -4
  14. package/dist/{projection-shard-manager-CUo4bF4O.js → projection-shard-manager-mQhfVipO.js} +2 -2
  15. package/dist/{projection-shard-manager-CUo4bF4O.js.map → projection-shard-manager-mQhfVipO.js.map} +1 -1
  16. package/dist/{types-DMKLa0Ok.js → types-DxDCmtId.js} +3 -2
  17. package/dist/types-DxDCmtId.js.map +1 -0
  18. package/dist/{worker-g03lNM42.js → worker-BDVzCtuf.js} +2 -2
  19. package/dist/{worker-g03lNM42.js.map → worker-BDVzCtuf.js.map} +1 -1
  20. package/dist/{worker-handle-CrERzl8s.js → worker-handle-B3p-nuqG.js} +14 -9
  21. package/dist/worker-handle-B3p-nuqG.js.map +1 -0
  22. package/package.json +6 -7
  23. package/dist/build-worker-executor-DUjyF4NM.js.map +0 -1
  24. package/dist/drive-container-types-CS5IxDiA.js.map +0 -1
  25. package/dist/types-DMKLa0Ok.js.map +0 -1
  26. package/dist/worker-handle-CrERzl8s.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { $ as parsePagingOptions, A as targetDocumentId, B as DuplicateOperationError, C as InvalidModuleError, D as createEmptyConsistencyToken, E as createConsistencyToken, F as buildDecisionModel, G as AuthorizationDeniedError, H as RevisionMismatchError, I as APPEND_CONDITION_FAILED_PREFIX, J as ExcessiveReshuffleError, K as DocumentDeletedError, L as AppendConditionFailedError, M as selectDecisionModel, N as documentDecisionModel, O as submittedActionIds, P as authDecisionModel, Q as matchesScope, R as DocumentAlreadyExistsError, S as DuplicateModuleError, T as GATED_DOCUMENT_ACTIONS, U as AuthEnforcementDisabledError, V as OptimisticLockError, W as AuthTimestampNotMonotonicError, X as RelationshipNotFoundError, Y as InvalidOperationTimestampError, Z as UpgradePreconditionFailedError, _ as DocumentMetaCache, a as createForwardingPoolInstrumentation, b as JobExecutorEventTypes, c as KyselyKeyframeStore, d as DriveCollectionId, et as throwIfAborted, f as KyselyExecutionScope, g as KyselyOperationIndex, h as KyselyWriteCache, i as runMigrations, j as decideAtHead, k as summarizeSubmittedActions, l as DocumentModelRegistry, m as EventBus, n as REACTOR_SCHEMA, o as instrumentPgPool, p as resolveFeatureFlags, q as DocumentNotFoundError, r as getMigrationStatus, s as KyselyOperationStore, t as DEFAULT_DRIVE_CONTAINER_TYPES, u as SimpleJobExecutor, v as CollectionMembershipCache, w as ModuleNotFoundError, x as DuplicateManifestError, y as DEFAULT_DEFERRED_JOB_TTL_MS, z as DocumentExistence } from "./drive-container-types-CS5IxDiA.js";
2
- import { n as ReactorEventTypes, t as EventBusAggregateError } from "./types-DMKLa0Ok.js";
1
+ import { $ as RelationshipNotFoundError, A as submittedActionIds, B as DocumentAlreadyExistsError, C as DuplicateManifestError, D as GATED_DOCUMENT_ACTIONS, E as ModuleNotFoundError, F as documentDecisionModel, G as AuthEnforcementDisabledError, H as DuplicateOperationError, I as authDecisionModel, J as DocumentDeletedError, K as AuthTimestampNotMonotonicError, L as buildDecisionModel, M as targetDocumentId, N as decideAtHead, O as createConsistencyToken, P as selectDecisionModel, Q as InvalidSignatureError, R as APPEND_CONDITION_FAILED_PREFIX, S as JobExecutorEventTypes, T as InvalidModuleError, U as OptimisticLockError, V as DocumentExistence, W as RevisionMismatchError, X as ExcessiveReshuffleError, Y as DocumentNotFoundError, Z as InvalidOperationTimestampError, _ as KyselyWriteCache, a as createForwardingPoolInstrumentation, b as CollectionMembershipCache, c as KyselyKeyframeStore, d as verifyActionSignature, et as UpgradePreconditionFailedError, f as PassthroughSigner, g as EventBus, h as resolveFeatureFlags, i as runMigrations, j as summarizeSubmittedActions, k as createEmptyConsistencyToken, l as DocumentModelRegistry, m as KyselyExecutionScope, n as REACTOR_SCHEMA, nt as parsePagingOptions, o as instrumentPgPool, p as DriveCollectionId, q as AuthorizationDeniedError, r as getMigrationStatus, rt as throwIfAborted, s as KyselyOperationStore, t as DEFAULT_DRIVE_CONTAINER_TYPES, tt as matchesScope, u as SimpleJobExecutor, v as KyselyOperationIndex, w as DuplicateModuleError, x as DEFAULT_DEFERRED_JOB_TTL_MS, y as DocumentMetaCache, z as AppendConditionFailedError } from "./drive-container-types-Be5-EY9W.js";
2
+ import { n as ReactorEventTypes, t as EventBusAggregateError } from "./types-DxDCmtId.js";
3
3
  import { i as WorkerInitFailedError, r as WorkerExitedError, t as WorkerAbortTimeoutError } from "./errors-D3S6Eysd.js";
4
- import { a as KyselyDocumentView, c as ReadModelCoordinator, d as DEFAULT_READ_MODEL_YIELD_DEADLINE_MS, f as defaultReadModelIndexingConfig, i as DeletedDocumentRead, l as BaseReadModel, n as ConsistencyTracker, o as DOCUMENT_INDEXER_READ_MODEL, p as unchunkedReadModelIndexingConfig, r as makeConsistencyKey, s as DOCUMENT_VIEW_READ_MODEL, t as KyselyDocumentIndexer, u as DEFAULT_COMMIT_CHUNK_SIZE } from "./document-indexer-CQzTEE1o.js";
4
+ import { a as KyselyDocumentView, c as ReadModelCoordinator, d as DEFAULT_READ_MODEL_YIELD_DEADLINE_MS, f as defaultReadModelIndexingConfig, i as DeletedDocumentRead, l as BaseReadModel, n as ConsistencyTracker, o as DOCUMENT_INDEXER_READ_MODEL, p as unchunkedReadModelIndexingConfig, r as makeConsistencyKey, s as DOCUMENT_VIEW_READ_MODEL, t as KyselyDocumentIndexer, u as DEFAULT_COMMIT_CHUNK_SIZE } from "./document-indexer-Dn9RB0sg.js";
5
5
  import { n as errorToInfo, r as sanitizeArg, t as createForwardingLogger } from "./forwarding-logger-BBkMSxuJ.js";
6
- import { t as workerEntryPath } from "./worker-g03lNM42.js";
7
- import { DowngradeNotSupportedError, MAX_AUTH_GRANTS, UnsupportedDocumentModelVersionError, actions, actions as documentActions, createPresignedHeader, decide, deserializeSignature, garbageCollect, generateId, groupDocumentType, groupMembershipActionTypes, hashDocumentStateForScope, normalizeDocumentModelVersion, sortOperations, toTransportAction } from "@powerhousedao/shared/document-model";
6
+ import { t as workerEntryPath } from "./worker-BDVzCtuf.js";
7
+ import { DEFAULT_SIGNATURE_POLICY, DowngradeNotSupportedError, MAX_AUTH_GRANTS, UnsupportedDocumentModelVersionError, actionSignerIdentity, actionSigningTarget, actions, actions as documentActions, createCopyHeader, decide, deserializeSignature, garbageCollect, generateId, groupDocumentType, groupMembershipActionTypes, hashDocumentStateForScope, normalizeDocumentModelVersion, requestedSignaturePolicy, sortOperations, toTransportAction, withSignaturePolicy } from "@powerhousedao/shared/document-model";
8
8
  import { addFile, addFolder, copyNode, deleteNode, driveCreateDocument, generateNodesCopy, getDescendants, handleTargetNameCollisions, isFileNode, isFolderNode, moveNode, updateNode } from "@powerhousedao/shared/document-drive";
9
9
  import { v4 } from "uuid";
10
10
  import { ConsoleLogger, childLogger } from "document-model";
@@ -237,37 +237,31 @@ function getSharedActionScope(actions) {
237
237
  return baseScope;
238
238
  }
239
239
  /**
240
- * Signs an action with the provided signer.
241
- * If the action already has valid signatures, it is returned unchanged.
240
+ * Signs an action for `target`, the log it is written to. An action already
241
+ * signed under a key is returned unchanged; one whose signer or last tuple has
242
+ * no key is unsigned, and is signed like any other.
242
243
  */
243
- const signAction = async (action, signer, signal) => {
244
- const existingSignatures = action.context?.signer?.signatures;
245
- if (existingSignatures && existingSignatures.length > 0) return action;
246
- const signature = await signer.signAction(action, signal);
244
+ const signAction = async (action, signer, target, signal) => {
245
+ const existing = action.context?.signer;
246
+ if (existing?.app?.key && existing.signatures.at(-1)?.[1]) return action;
247
+ const signature = await signer.signAction(action, target, signal);
247
248
  return {
248
249
  ...action,
249
250
  context: {
250
251
  ...action.context,
251
252
  signer: {
252
- user: {
253
- address: signer.user?.address || "",
254
- networkId: signer.user?.networkId || "",
255
- chainId: signer.user?.chainId || 0
256
- },
257
- app: {
258
- name: signer.app?.name || "",
259
- key: signer.app?.key || ""
260
- },
253
+ ...actionSignerIdentity(signer),
261
254
  signatures: [signature]
262
255
  }
263
256
  }
264
257
  };
265
258
  };
266
259
  /**
267
- * Signs multiple actions with the provided signer
260
+ * Signs the actions of a job on `job.documentId`, each for the log it is
261
+ * written to: a relationship action lands in its source document.
268
262
  */
269
- const signActions = async (actions, signer, signal) => {
270
- return Promise.all(actions.map((action) => signAction(action, signer, signal)));
263
+ const signActions = async (actions, signer, job, signal) => {
264
+ return Promise.all(actions.map((action) => signAction(action, signer, actionSigningTarget(action, job.documentId, job.branch), signal)));
271
265
  };
272
266
  function buildSingleJobMeta(jobId, callerMeta) {
273
267
  return {
@@ -329,11 +323,11 @@ var DriveClient = class {
329
323
  }
330
324
  async create(input, signal) {
331
325
  this.logger.verbose("drives.create(@input)", input);
332
- const driveDoc = driveCreateDocument({ global: {
326
+ const driveDoc = withSignaturePolicy(driveCreateDocument({ global: {
333
327
  name: input.global.name || "",
334
328
  icon: input.global.icon ?? null,
335
329
  nodes: []
336
- } });
330
+ } }), requestedSignaturePolicy(input, await this.client.getCreateSignaturePolicy()), { protocolVersions: input.protocolVersions });
337
331
  if (input.preferredEditor) driveDoc.header.meta = {
338
332
  ...driveDoc.header.meta,
339
333
  preferredEditor: input.preferredEditor
@@ -369,13 +363,19 @@ var DriveClient = class {
369
363
  initialState: document.state
370
364
  }),
371
365
  addRelationshipAction(driveIdentifier, documentId, "child")
372
- ], this.signer, signal);
366
+ ], this.signer, {
367
+ documentId,
368
+ branch: "main"
369
+ }, signal);
373
370
  const driveActions = await signActions([addFile({
374
371
  id: documentId,
375
372
  name: document.header.name || documentId,
376
373
  documentType: document.header.documentType,
377
374
  parentFolder
378
- })], this.signer, signal);
375
+ })], this.signer, {
376
+ documentId: driveIdentifier,
377
+ branch: "main"
378
+ }, signal);
379
379
  await this.runJobs([{
380
380
  key: "document",
381
381
  documentId,
@@ -465,18 +465,20 @@ var DriveClient = class {
465
465
  });
466
466
  resolvedNamesByTargetId.set(entry.targetId, resolved);
467
467
  }
468
+ const policy = await this.client.getCreateSignaturePolicy();
468
469
  for (const entry of copyPlan) {
469
470
  const node = drive.state.global.nodes.find((n) => n.id === entry.srcId);
470
471
  if (!node || !isFileNode(node)) continue;
471
472
  const srcDoc = await this.client.get(entry.srcId, void 0, signal);
472
473
  const duplicated = {
473
474
  ...srcDoc,
474
- header: createPresignedHeader(entry.targetId, srcDoc.header.documentType),
475
+ header: createCopyHeader(srcDoc.header, entry.targetId, policy),
475
476
  initialState: srcDoc.state,
476
477
  operations: {}
477
478
  };
478
479
  const resolvedName = resolvedNamesByTargetId.get(entry.targetId);
479
480
  if (resolvedName) duplicated.header.name = resolvedName;
481
+ entry.targetId = duplicated.header.id;
480
482
  await this.addFile(driveIdentifier, duplicated, entry.targetParentFolder ?? void 0, signal);
481
483
  }
482
484
  return this.client.execute(driveIdentifier, "main", copyPlan.map((entry) => copyNode(entry)), signal);
@@ -529,8 +531,14 @@ var DriveClient = class {
529
531
  }
530
532
  }
531
533
  async removeFileNode(driveId, fileId, signal) {
532
- const relationshipActions = await signActions([removeRelationshipAction(driveId, fileId, "child")], this.signer, signal);
533
- const driveActions = await signActions([deleteNode({ id: fileId })], this.signer, signal);
534
+ const relationshipActions = await signActions([removeRelationshipAction(driveId, fileId, "child")], this.signer, {
535
+ documentId: driveId,
536
+ branch: "main"
537
+ }, signal);
538
+ const driveActions = await signActions([deleteNode({ id: fileId })], this.signer, {
539
+ documentId: driveId,
540
+ branch: "main"
541
+ }, signal);
534
542
  const batchResult = await this.reactor.executeBatch({ jobs: [{
535
543
  key: "relationship",
536
544
  documentId: driveId,
@@ -1049,8 +1057,9 @@ var ReactorClient = class {
1049
1057
  documentView;
1050
1058
  readGate;
1051
1059
  actionEvaluation;
1060
+ createSignaturePolicy;
1052
1061
  drives;
1053
- constructor(logger, reactor, signer, subscriptionManager, jobAwaiter, documentIndexer, documentView, readGate = new BareReadGate(), actionEvaluation) {
1062
+ constructor(logger, reactor, signer, subscriptionManager, jobAwaiter, documentIndexer, documentView, readGate = new BareReadGate(), actionEvaluation, createSignaturePolicy = DEFAULT_SIGNATURE_POLICY) {
1054
1063
  this.logger = logger;
1055
1064
  this.reactor = reactor;
1056
1065
  this.signer = signer;
@@ -1060,6 +1069,7 @@ var ReactorClient = class {
1060
1069
  this.documentView = documentView;
1061
1070
  this.readGate = readGate;
1062
1071
  this.actionEvaluation = actionEvaluation;
1072
+ this.createSignaturePolicy = createSignaturePolicy;
1063
1073
  this.drives = new DriveClient(this, logger, reactor, signer);
1064
1074
  this.logger.verbose("ReactorClient initialized");
1065
1075
  }
@@ -1403,12 +1413,16 @@ var ReactorClient = class {
1403
1413
  scopeStates: document.state ?? {}
1404
1414
  };
1405
1415
  }
1416
+ getCreateSignaturePolicy() {
1417
+ return Promise.resolve(this.createSignaturePolicy);
1418
+ }
1406
1419
  /**
1407
1420
  * Creates a document and waits for completion
1408
1421
  */
1409
1422
  async create(document, parentIdentifier, signal) {
1410
1423
  this.logger.verbose("create(@id, @parentIdentifier)", document.header.id, parentIdentifier);
1411
1424
  const documentId = document.header.id;
1425
+ const branch = document.header.branch || "main";
1412
1426
  const createActions = await signActions([createDocumentAction({
1413
1427
  model: document.header.documentType,
1414
1428
  version: 0,
@@ -1431,17 +1445,23 @@ var ReactorClient = class {
1431
1445
  fromVersion: 0,
1432
1446
  toVersion: normalizeDocumentModelVersion(document.state.document?.version),
1433
1447
  initialState: document.state
1434
- })], this.signer, signal);
1448
+ })], this.signer, {
1449
+ documentId,
1450
+ branch
1451
+ }, signal);
1435
1452
  const jobs = [{
1436
1453
  key: "create",
1437
1454
  documentId,
1438
1455
  scope: getSharedActionScope(createActions),
1439
- branch: "main",
1456
+ branch,
1440
1457
  actions: createActions,
1441
1458
  dependsOn: []
1442
1459
  }];
1443
1460
  if (parentIdentifier) {
1444
- const parentActions = await signActions([addRelationshipAction(parentIdentifier, documentId, "child")], this.signer, signal);
1461
+ const parentActions = await signActions([addRelationshipAction(parentIdentifier, documentId, "child")], this.signer, {
1462
+ documentId: parentIdentifier,
1463
+ branch: "main"
1464
+ }, signal);
1445
1465
  jobs.push({
1446
1466
  key: "parent",
1447
1467
  documentId: parentIdentifier,
@@ -1475,7 +1495,7 @@ var ReactorClient = class {
1475
1495
  }, void 0);
1476
1496
  if (!module) throw new Error(`Document model not found for type: ${documentModelType}`);
1477
1497
  }
1478
- const document = module.utils.createDocument();
1498
+ const document = withSignaturePolicy(module.utils.createDocument(), requestedSignaturePolicy(options, this.createSignaturePolicy), { protocolVersions: options?.protocolVersions });
1479
1499
  document.state.document.version = normalizeDocumentModelVersion(module.version);
1480
1500
  return this.create(document, options?.parentIdentifier, signal);
1481
1501
  }
@@ -1510,7 +1530,10 @@ var ReactorClient = class {
1510
1530
  fromVersion,
1511
1531
  toVersion: targetVersion,
1512
1532
  revision: { ...document.header.revision }
1513
- })], this.signer, signal);
1533
+ })], this.signer, {
1534
+ documentId,
1535
+ branch
1536
+ }, signal);
1514
1537
  const jobInfo = await this.reactor.execute(documentId, branch, signedActions, signal);
1515
1538
  const completedJob = await this.waitForJob(jobInfo, signal);
1516
1539
  if (completedJob.status !== JobStatus.FAILED) {
@@ -1540,8 +1563,12 @@ var ReactorClient = class {
1540
1563
  */
1541
1564
  async execute(documentIdentifier, branch, actions, signal, subject) {
1542
1565
  this.logger.verbose("execute(@documentIdentifier, @branch, @count actions)", documentIdentifier, branch, actions.length);
1543
- const signedActions = await signActions(actions, this.signer, signal);
1544
- const jobInfo = await this.reactor.execute(documentIdentifier, branch, signedActions, signal);
1566
+ const documentId = await this.resolveWriteTarget(documentIdentifier, branch, actions, signal);
1567
+ const signedActions = await signActions(actions, this.signer, {
1568
+ documentId,
1569
+ branch
1570
+ }, signal);
1571
+ const jobInfo = await this.reactor.execute(documentId, branch, signedActions, signal);
1545
1572
  const completedJob = await this.waitForJob(jobInfo, signal);
1546
1573
  if (completedJob.status === JobStatus.FAILED) throw new Error(completedJob.error?.message);
1547
1574
  const view = {
@@ -1556,15 +1583,38 @@ var ReactorClient = class {
1556
1583
  */
1557
1584
  async executeAsync(documentIdentifier, branch, actions, signal) {
1558
1585
  this.logger.verbose("executeAsync(@documentIdentifier, @branch, @count actions)", documentIdentifier, branch, actions.length);
1559
- const signedActions = await signActions(actions, this.signer, signal);
1560
- return this.reactor.execute(documentIdentifier, branch, signedActions, signal);
1586
+ const documentId = await this.resolveWriteTarget(documentIdentifier, branch, actions, signal);
1587
+ const signedActions = await signActions(actions, this.signer, {
1588
+ documentId,
1589
+ branch
1590
+ }, signal);
1591
+ return this.reactor.execute(documentId, branch, signedActions, signal);
1592
+ }
1593
+ /**
1594
+ * The id a write on `identifier` is stored under, which its signatures bind.
1595
+ * A create names its own id, and an id no slug maps to is taken as given, so
1596
+ * a document still in flight resolves to itself.
1597
+ */
1598
+ async resolveWriteTarget(identifier, branch, actions, signal) {
1599
+ if (actions.some((action) => action.type === "CREATE_DOCUMENT")) return identifier;
1600
+ const view = { branch };
1601
+ const bySlug = await this.documentView.resolveSlug(identifier, view, void 0, signal);
1602
+ if (bySlug === void 0 || bySlug === identifier) return identifier;
1603
+ return this.documentView.resolveIdOrSlug(identifier, view, void 0, signal);
1561
1604
  }
1562
1605
  async executeBatch(request, signal) {
1563
1606
  this.logger.verbose("executeBatch(@count jobs)", request.jobs.length);
1564
- const signedJobs = await Promise.all(request.jobs.map(async (job) => ({
1565
- ...job,
1566
- actions: await signActions(job.actions, this.signer, signal)
1567
- })));
1607
+ const signedJobs = await Promise.all(request.jobs.map(async (job) => {
1608
+ const documentId = await this.resolveWriteTarget(job.documentId, job.branch, job.actions, signal);
1609
+ return {
1610
+ ...job,
1611
+ documentId,
1612
+ actions: await signActions(job.actions, this.signer, {
1613
+ documentId,
1614
+ branch: job.branch
1615
+ }, signal)
1616
+ };
1617
+ }));
1568
1618
  const batchResult = await this.reactor.executeBatch({ jobs: signedJobs }, signal);
1569
1619
  const completedJobs = await Promise.all(Object.values(batchResult.jobs).map((job) => this.waitForJob(job, signal)));
1570
1620
  for (const job of completedJobs) if (job.status === JobStatus.FAILED) throw new Error(job.error?.message);
@@ -1870,7 +1920,7 @@ var JobResultHandler = class {
1870
1920
  callbacks.deferJob(result.error.documentId, handle.job);
1871
1921
  return;
1872
1922
  }
1873
- if (result.error && (DocumentDeletedError.isError(result.error) || DocumentAlreadyExistsError.isError(result.error) || DocumentNotFoundError.isError(result.error) || AuthorizationDeniedError.isError(result.error) || AuthTimestampNotMonotonicError.isError(result.error) || InvalidOperationTimestampError.isError(result.error) || ExcessiveReshuffleError.isError(result.error) || UpgradePreconditionFailedError.isError(result.error))) {
1923
+ if (result.error && (DocumentDeletedError.isError(result.error) || DocumentAlreadyExistsError.isError(result.error) || DocumentNotFoundError.isError(result.error) || AuthorizationDeniedError.isError(result.error) || AuthTimestampNotMonotonicError.isError(result.error) || InvalidOperationTimestampError.isError(result.error) || ExcessiveReshuffleError.isError(result.error) || InvalidSignatureError.isError(result.error) || UpgradePreconditionFailedError.isError(result.error))) {
1874
1924
  const errorInfo = toErrorInfo(result.error);
1875
1925
  this.jobTracker.markFailed(handle.job.id, errorInfo, handle.job);
1876
1926
  this.eventBus.emit(ReactorEventTypes.JOB_FAILED, {
@@ -2258,6 +2308,7 @@ var WorkerPoolJobExecutorManager = class {
2258
2308
  await this.tryDispatchFor(worker);
2259
2309
  return;
2260
2310
  }
2311
+ for (const refusal of outcome.signatureRefusals ?? []) this.eventBus.emit(ReactorEventTypes.SIGNATURE_REFUSED, refusal).catch(() => {});
2261
2312
  if (outcome.result.success) {
2262
2313
  this.totalJobsProcessed++;
2263
2314
  const completedEvent = {
@@ -7807,7 +7858,7 @@ var Reactor = class {
7807
7858
  this.logger.verbose("create(@id, @type, @slug)", document.header.id, document.header.documentType, document.header.slug);
7808
7859
  const createdAtUtcIso = (/* @__PURE__ */ new Date()).toISOString();
7809
7860
  throwIfAborted(signal, () => new AbortError());
7810
- let actions = [createDocumentAction({
7861
+ const createAction = createDocumentAction({
7811
7862
  model: document.header.documentType,
7812
7863
  version: 0,
7813
7864
  documentId: document.header.id,
@@ -7823,14 +7874,20 @@ var Reactor = class {
7823
7874
  branch: document.header.branch,
7824
7875
  meta: document.header.meta,
7825
7876
  protocolVersions: document.header.protocolVersions ?? { "base-reducer": 2 }
7826
- }), upgradeDocumentAction({
7877
+ });
7878
+ const upgradeAction = upgradeDocumentAction({
7827
7879
  documentId: document.header.id,
7828
7880
  model: document.header.documentType,
7829
7881
  fromVersion: 0,
7830
7882
  toVersion: normalizeDocumentModelVersion(document.state.document?.version),
7831
7883
  initialState: document.state
7832
- })];
7833
- if (signer) actions = await signActions(actions, signer, signal);
7884
+ });
7885
+ const branch = document.header.branch || "main";
7886
+ let actions = [createAction, upgradeAction];
7887
+ if (signer) actions = await signActions(actions, signer, {
7888
+ documentId: document.header.id,
7889
+ branch
7890
+ }, signal);
7834
7891
  const jobId = v4();
7835
7892
  const jobMeta = buildSingleJobMeta(jobId, meta);
7836
7893
  const job = {
@@ -7838,7 +7895,7 @@ var Reactor = class {
7838
7895
  kind: "mutation",
7839
7896
  documentId: document.header.id,
7840
7897
  scope: "document",
7841
- branch: "main",
7898
+ branch,
7842
7899
  actions,
7843
7900
  operations: [],
7844
7901
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -7869,7 +7926,10 @@ var Reactor = class {
7869
7926
  const createdAtUtcIso = (/* @__PURE__ */ new Date()).toISOString();
7870
7927
  throwIfAborted(signal, () => new AbortError());
7871
7928
  let action = deleteDocumentAction(id);
7872
- if (signer) action = await signAction(action, signer, signal);
7929
+ if (signer) action = await signAction(action, signer, {
7930
+ documentId: id,
7931
+ branch: "main"
7932
+ }, signal);
7873
7933
  const jobId = v4();
7874
7934
  const jobMeta = buildSingleJobMeta(jobId, meta);
7875
7935
  const job = {
@@ -8126,21 +8186,30 @@ var Reactor = class {
8126
8186
  this.logger.verbose("addRelationship(@sourceId, @targetId, @relationshipType, @metadata, @branch)", sourceId, targetId, relationshipType, metadata, branch);
8127
8187
  throwIfAborted(signal, () => new AbortError());
8128
8188
  let actions = [addRelationshipAction(sourceId, targetId, relationshipType, metadata)];
8129
- if (signer) actions = await signActions(actions, signer, signal);
8189
+ if (signer) actions = await signActions(actions, signer, {
8190
+ documentId: sourceId,
8191
+ branch
8192
+ }, signal);
8130
8193
  return await this.execute(sourceId, branch, actions, signal);
8131
8194
  }
8132
8195
  async updateRelationship(sourceId, targetId, relationshipType, metadata, branch = "main", signer, signal) {
8133
8196
  this.logger.verbose("updateRelationship(@sourceId, @targetId, @relationshipType, @metadata, @branch)", sourceId, targetId, relationshipType, metadata, branch);
8134
8197
  throwIfAborted(signal, () => new AbortError());
8135
8198
  let actions = [updateRelationshipAction(sourceId, targetId, relationshipType, metadata)];
8136
- if (signer) actions = await signActions(actions, signer, signal);
8199
+ if (signer) actions = await signActions(actions, signer, {
8200
+ documentId: sourceId,
8201
+ branch
8202
+ }, signal);
8137
8203
  return await this.execute(sourceId, branch, actions, signal);
8138
8204
  }
8139
8205
  async removeRelationship(sourceId, targetId, relationshipType, branch = "main", signer, signal) {
8140
8206
  this.logger.verbose("removeRelationship(@sourceId, @targetId, @relationshipType, @branch)", sourceId, targetId, relationshipType, branch);
8141
8207
  throwIfAborted(signal, () => new AbortError());
8142
8208
  let actions = [removeRelationshipAction(sourceId, targetId, relationshipType)];
8143
- if (signer) actions = await signActions(actions, signer, signal);
8209
+ if (signer) actions = await signActions(actions, signer, {
8210
+ documentId: sourceId,
8211
+ branch
8212
+ }, signal);
8144
8213
  return await this.execute(sourceId, branch, actions, signal);
8145
8214
  }
8146
8215
  getJobStatus(jobId, signal) {
@@ -8244,8 +8313,11 @@ var ReactorBuilder = class {
8244
8313
  eventBus;
8245
8314
  readModelCoordinator;
8246
8315
  readModelCoordinatorFactory;
8247
- signatureVerifier;
8248
8316
  kyselyInstance;
8317
+ signer;
8318
+ workerSigner;
8319
+ trustPolicy;
8320
+ workerTrustPolicy;
8249
8321
  signalHandlersEnabled = false;
8250
8322
  queueInstance;
8251
8323
  channelScheme;
@@ -8344,10 +8416,34 @@ var ReactorBuilder = class {
8344
8416
  this.eventBus = eventBus;
8345
8417
  return this;
8346
8418
  }
8347
- withSignatureVerifier(verifier) {
8348
- this.signatureVerifier = verifier;
8419
+ /**
8420
+ * Signs the operations the executor synthesizes: the NOOP an UNDO becomes and
8421
+ * the action a REDO rebuilds. Without one they are stored unsigned. Pooled
8422
+ * workers import `workerSigner` to build the same signer.
8423
+ */
8424
+ withSigner(signer, workerSigner) {
8425
+ this.signer = signer;
8426
+ this.workerSigner = workerSigner;
8427
+ return this;
8428
+ }
8429
+ /** Whether {@link withSigner} was called. */
8430
+ hasSigner() {
8431
+ return this.signer !== void 0;
8432
+ }
8433
+ /**
8434
+ * Decides at admission whether a key may sign as the user it claims; see
8435
+ * {@link SignatureTrustPolicy} for the contract and the default. Pooled
8436
+ * workers import `workerTrustPolicy` to build the same policy.
8437
+ */
8438
+ withTrustPolicy(trustPolicy, workerTrustPolicy) {
8439
+ this.trustPolicy = trustPolicy;
8440
+ this.workerTrustPolicy = workerTrustPolicy;
8349
8441
  return this;
8350
8442
  }
8443
+ /** Whether {@link withTrustPolicy} was called. */
8444
+ hasTrustPolicy() {
8445
+ return this.trustPolicy !== void 0;
8446
+ }
8351
8447
  withKysely(kysely) {
8352
8448
  this.kyselyInstance = kysely;
8353
8449
  return this;
@@ -8401,8 +8497,7 @@ var ReactorBuilder = class {
8401
8497
  * this enables the pool — there is no `enabled` flag. Provide `db`
8402
8498
  * (each worker opens its own Postgres pool; the parent database is built
8403
8499
  * from it too unless {@link withKysely} is set) or a custom `factory`
8404
- * transport. `verifier` is imported by the default transport's workers;
8405
- * omitted = no executor-side signature verification.
8500
+ * transport.
8406
8501
  */
8407
8502
  withWorkerPool(options) {
8408
8503
  this.workerPool = options;
@@ -8495,13 +8590,15 @@ var ReactorBuilder = class {
8495
8590
  let factory = pool.factory;
8496
8591
  if (!factory) {
8497
8592
  if (pool.db === void 0) throw new Error("unreachable: worker pool configured without db or factory");
8498
- factory = await this.createDefaultWorkerFactory(pool.numWorkers, pool.db, pool.verifier);
8593
+ if (this.signer && !this.workerSigner) this.logger.warn("Worker pool has no signer spec; pooled workers store synthesized operations unsigned");
8594
+ if (this.trustPolicy && !this.workerTrustPolicy) this.logger.warn("Worker pool has no trust policy spec; pooled workers apply the default trust policy");
8595
+ factory = await this.createDefaultWorkerFactory(pool.numWorkers, pool.db);
8499
8596
  }
8500
8597
  const poolManager = new WorkerPoolJobExecutorManager(factory, eventBus, queue, jobTracker, this.logger, resolver, operationIndex, this.executorConfig.jobTimeoutMs, this.executorConfig.deferredJobTtlMs);
8501
8598
  executorManager = poolManager;
8502
8599
  executorStartCount = pool.numWorkers;
8503
8600
  if (resolver instanceof DocumentModelResolver) resolver.setBroadcastHook((entry) => poolManager.loadModel(entry));
8504
- } else executorManager = new SimpleJobExecutorManager(() => new SimpleJobExecutor(this.logger, documentModelRegistry, operationStore, eventBus, writeCache, operationIndex, documentMetaCache, collectionMembershipCache, this.driveContainerTypes, this.executorConfig, this.signatureVerifier, executionScope), eventBus, queue, jobTracker, this.logger, resolver, this.executorConfig.jobTimeoutMs, this.executorConfig.deferredJobTtlMs);
8601
+ } else executorManager = new SimpleJobExecutorManager(() => new SimpleJobExecutor(this.logger, documentModelRegistry, operationStore, eventBus, writeCache, operationIndex, documentMetaCache, collectionMembershipCache, this.driveContainerTypes, this.executorConfig, executionScope, this.signer, this.trustPolicy), eventBus, queue, jobTracker, this.logger, resolver, this.executorConfig.jobTimeoutMs, this.executorConfig.deferredJobTtlMs);
8505
8602
  await executorManager.start(executorStartCount);
8506
8603
  const callerReadModels = Array.from(new Set([...this.readModels]));
8507
8604
  const degradedComponents = [];
@@ -8674,7 +8771,7 @@ var ReactorBuilder = class {
8674
8771
  poolInstrumentations.push(forwarder);
8675
8772
  this.instrumentedPools.push(forwarder);
8676
8773
  }
8677
- const { ProjectionShardManager } = await import("./projection-shard-manager-CUo4bF4O.js");
8774
+ const { ProjectionShardManager } = await import("./projection-shard-manager-mQhfVipO.js");
8678
8775
  const manager = new ProjectionShardManager({
8679
8776
  shardCount: config.shardCount,
8680
8777
  db,
@@ -8716,11 +8813,11 @@ var ReactorBuilder = class {
8716
8813
  * custom `factory`. Each worker spawns a real `node:worker_threads`
8717
8814
  * Worker pointing at the compiled `worker/entry.js`.
8718
8815
  */
8719
- async createDefaultWorkerFactory(numWorkers, db, signatureVerifier) {
8816
+ async createDefaultWorkerFactory(numWorkers, db) {
8720
8817
  const [{ WorkerHandle }, { createThreadTransport }, { workerEntryPath }] = await Promise.all([
8721
- import("./worker-handle-CrERzl8s.js"),
8818
+ import("./worker-handle-B3p-nuqG.js"),
8722
8819
  import("./transport-ByGviWdZ.js"),
8723
- import("./worker-g03lNM42.js").then((n) => n.n)
8820
+ import("./worker-BDVzCtuf.js").then((n) => n.n)
8724
8821
  ]);
8725
8822
  const poolConfig = {
8726
8823
  enabled: true,
@@ -8740,9 +8837,10 @@ var ReactorBuilder = class {
8740
8837
  initPayload: {
8741
8838
  poolConfig,
8742
8839
  db,
8743
- signatureVerifier,
8744
8840
  models,
8745
- executorConfig: this.executorConfig
8841
+ executorConfig: this.executorConfig,
8842
+ signer: this.workerSigner,
8843
+ trustPolicy: this.workerTrustPolicy
8746
8844
  },
8747
8845
  logger,
8748
8846
  poolInstrumentation
@@ -8985,30 +9083,6 @@ function createHybridProjectionCoordinatorFactory(options = {}) {
8985
9083
  };
8986
9084
  }
8987
9085
  //#endregion
8988
- //#region src/signer/passthrough-signer.ts
8989
- /**
8990
- * A no-op signer that returns empty values for all methods.
8991
- * Used when signing is not required.
8992
- */
8993
- var PassthroughSigner = class {
8994
- publicKey = {};
8995
- sign() {
8996
- return Promise.resolve(new Uint8Array(0));
8997
- }
8998
- verify() {
8999
- return Promise.resolve();
9000
- }
9001
- signAction() {
9002
- return Promise.resolve([
9003
- "",
9004
- "",
9005
- "",
9006
- "",
9007
- ""
9008
- ]);
9009
- }
9010
- };
9011
- //#endregion
9012
9086
  //#region src/core/reactor-client-builder.ts
9013
9087
  /**
9014
9088
  * Builder class for constructing ReactorClient instances with proper configuration
@@ -9021,7 +9095,10 @@ var ReactorClientBuilder = class {
9021
9095
  documentIndexer;
9022
9096
  documentView;
9023
9097
  signer;
9024
- signatureVerifier;
9098
+ workerSigner;
9099
+ trustPolicy;
9100
+ workerTrustPolicy;
9101
+ createSignaturePolicy = DEFAULT_SIGNATURE_POLICY;
9025
9102
  subscriptionManager;
9026
9103
  jobAwaiter;
9027
9104
  documentModelLoader;
@@ -9055,17 +9132,28 @@ var ReactorClientBuilder = class {
9055
9132
  return this;
9056
9133
  }
9057
9134
  /**
9058
- * Sets the signer configuration for signing and verifying actions.
9059
- *
9060
- * @param config - Either an ISigner for signing only, or a SignerConfig for both signing and verification
9135
+ * Signs submitted actions, and the operations a reactor built from
9136
+ * `withReactorBuilder` synthesizes unless that builder has its own signer.
9137
+ * A `trustPolicy` reaches that builder unless it has its own.
9061
9138
  */
9062
9139
  withSigner(config) {
9063
9140
  if ("signer" in config) {
9064
9141
  this.signer = config.signer;
9065
- this.signatureVerifier = config.verifier;
9142
+ this.workerSigner = config.workerSigner;
9143
+ this.trustPolicy = config.trustPolicy;
9144
+ this.workerTrustPolicy = config.workerTrustPolicy;
9066
9145
  } else this.signer = config;
9067
9146
  return this;
9068
9147
  }
9148
+ /**
9149
+ * What the client creates new documents as when a call does not say:
9150
+ * `v2-required` (the default) or `legacy`, for a fleet with peers that
9151
+ * predate v2-required documents. Existing documents keep their policy.
9152
+ */
9153
+ withCreateSignaturePolicy(policy) {
9154
+ this.createSignaturePolicy = policy;
9155
+ return this;
9156
+ }
9069
9157
  withSubscriptionManager(subscriptionManager) {
9070
9158
  this.subscriptionManager = subscriptionManager;
9071
9159
  return this;
@@ -9130,8 +9218,9 @@ var ReactorClientBuilder = class {
9130
9218
  let documentView;
9131
9219
  let reactorModule;
9132
9220
  if (this.reactorBuilder) {
9133
- if (this.signatureVerifier) this.reactorBuilder.withSignatureVerifier(this.signatureVerifier);
9134
9221
  if (this.documentModelLoader) this.reactorBuilder.withDocumentModelLoader(this.documentModelLoader);
9222
+ if (this.signer && !this.reactorBuilder.hasSigner()) this.reactorBuilder.withSigner(this.signer, this.workerSigner);
9223
+ if (this.trustPolicy && !this.reactorBuilder.hasTrustPolicy()) this.reactorBuilder.withTrustPolicy(this.trustPolicy, this.workerTrustPolicy);
9135
9224
  reactorModule = await this.reactorBuilder.buildModule();
9136
9225
  reactor = reactorModule.reactor;
9137
9226
  eventBus = reactorModule.eventBus;
@@ -9149,7 +9238,7 @@ var ReactorClientBuilder = class {
9149
9238
  const jobAwaiter = this.jobAwaiter ?? new JobAwaiter(eventBus, (jobId, signal) => reactor.getJobStatus(jobId, signal));
9150
9239
  const decisionModel = reactorModule ? readDecisionModel(reactorModule.featureFlags, reactorModule.documentModelRegistry) : void 0;
9151
9240
  return {
9152
- client: new ReactorClient(this.logger, reactor, signer, subscriptionManager, jobAwaiter, documentIndexer, documentView, this.readGate ?? this.resolveReadGate(reactorModule, documentView, decisionModel), this.resolveActionEvaluation(reactorModule, decisionModel)),
9241
+ client: new ReactorClient(this.logger, reactor, signer, subscriptionManager, jobAwaiter, documentIndexer, documentView, this.readGate ?? this.resolveReadGate(reactorModule, documentView, decisionModel), this.resolveActionEvaluation(reactorModule, decisionModel), this.createSignaturePolicy),
9153
9242
  reactor,
9154
9243
  eventBus,
9155
9244
  documentIndexer,
@@ -9187,6 +9276,21 @@ function driveIdFromUrl(url) {
9187
9276
  return url.split("/").pop() ?? "";
9188
9277
  }
9189
9278
  //#endregion
9279
+ //#region src/signer/types.ts
9280
+ const SIGNATURE_REFUSAL_CODES = [
9281
+ "UNSIGNED_REQUIRED",
9282
+ "UNSIGNED_IDENTITY",
9283
+ "KEY_MISMATCH",
9284
+ "MALFORMED_TUPLE",
9285
+ "TIMESTAMP_MISMATCH",
9286
+ "HASH_MISMATCH",
9287
+ "BAD_SIGNATURE",
9288
+ "SCHEME_BELOW_POLICY",
9289
+ "ID_MISMATCH",
9290
+ "DUPLICATE_ACTION",
9291
+ "SIGNER_UNAUTHORIZED"
9292
+ ];
9293
+ //#endregion
9190
9294
  //#region src/decision/sync-scope-gate.ts
9191
9295
  /** What a subject may read of a document that is not there to be read. */
9192
9296
  const META_ONLY = (scope) => ALWAYS_READABLE_SCOPES.has(scope);
@@ -9414,6 +9518,6 @@ var DocumentIntegrityService = class {
9414
9518
  }
9415
9519
  };
9416
9520
  //#endregion
9417
- export { ALWAYS_READABLE_SCOPES, APPEND_CONDITION_FAILED_PREFIX, AppendConditionFailedError, AuthEnforcementDisabledError, BareReadGate, BaseReadModel, ChannelError, ChannelErrorSource, ChannelScheme, ConsistencyTracker, DEFAULT_COMMIT_CHUNK_SIZE, DEFAULT_DRIVE_CONTAINER_TYPES, DEFAULT_READ_MODEL_YIELD_DEADLINE_MS, DOCUMENT_INDEXER_READ_MODEL, DOCUMENT_VIEW_READ_MODEL, DRIVE_AUTH_ERROR_MESSAGES, DefaultSubscriptionErrorHandler, DeletedDocumentRead, DocumentAlreadyExistsError, DocumentChangeType, DocumentExistence, DocumentIntegrityService, DocumentModelRegistry, DocumentModelResolver, DriveClient, DriveCollectionId, DriveRequestError, DuplicateManifestError, DuplicateModuleError, DuplicateOperationError, EventBus, EventBusAggregateError, GqlRequestChannel, GqlRequestChannelFactory, GqlResponseChannel, GqlResponseChannelFactory, HybridProjectionCoordinator, SimpleJobExecutor as InMemoryJobExecutor, SimpleJobExecutor, InMemoryJobTracker, InMemoryQueue, IntervalPollTimer, InvalidModuleError, JobAwaiter, JobExecutorEventTypes, JobStatus, KyselyDocumentIndexer, KyselyDocumentView, KyselyKeyframeStore, KyselyOperationStore, KyselySyncCursorStorage, KyselySyncRemoteStorage, KyselyWriteCache, Mailbox, ModelReadGate, ModuleNotFoundError, NullDocumentModelResolver, OptimisticLockError, PollBehavior, PollingChannelError, ProcessorManager, PropagationMode, QueueEventTypes, REACTOR_SCHEMA, RECOVERABLE_GRAPHQL_ERROR_CODES, Reactor, ReactorBuilder, ReactorClient, ReactorClientBuilder, ReactorEventTypes, ReactorSubscriptionManager, ReadModelCoordinator, RelationalDbProcessor, RelationshipChangeType, RelationshipNotFoundError, RetryAccounting, RevisionMismatchError, SeededStateReader, SimpleJobExecutorManager, SyncBuilder, SyncEventTypes, SyncOperation, SyncOperationAggregateError, SyncOperationStatus, SyncScopeGate, SyncStatus, SyncStatusTracker, addRelationshipAction, authDecisionModel, batchOperationsByDocument, buildDecisionModel, classifyJobFailure, consolidateSyncOperations, createDocumentAction, createForwardingLogger, createHybridProjectionCoordinatorFactory, createMutableShutdownStatus, createReactorHostModuleBase, createRelationalDb, decideAtHead, defaultReadModelIndexingConfig, deleteDocumentAction, documentActions, documentDecisionModel, driveIdFromUrl, envelopesToSyncOperations, errorToInfo, firstOutOfOrderPair, getMigrationStatus, instrumentPgPool, isDriveAuthError, isRecoverableGraphQLError, makeConsistencyKey, parseDriveUrl, parsePagingOptions, quarantinesDocument, readDecisionModel, removeRelationshipAction, runMigrations, sanitizeArg, selectDecisionModel, supportsLiveReadModelRegistration, syncOperationErrorType, trimMailboxFromAckOrdinal, unchunkedReadModelIndexingConfig, updateRelationshipAction, upgradeDocumentAction, workerEntryPath };
9521
+ export { ALWAYS_READABLE_SCOPES, APPEND_CONDITION_FAILED_PREFIX, AppendConditionFailedError, AuthEnforcementDisabledError, BareReadGate, BaseReadModel, ChannelError, ChannelErrorSource, ChannelScheme, ConsistencyTracker, DEFAULT_COMMIT_CHUNK_SIZE, DEFAULT_DRIVE_CONTAINER_TYPES, DEFAULT_READ_MODEL_YIELD_DEADLINE_MS, DOCUMENT_INDEXER_READ_MODEL, DOCUMENT_VIEW_READ_MODEL, DRIVE_AUTH_ERROR_MESSAGES, DefaultSubscriptionErrorHandler, DeletedDocumentRead, DocumentAlreadyExistsError, DocumentChangeType, DocumentExistence, DocumentIntegrityService, DocumentModelRegistry, DocumentModelResolver, DriveClient, DriveCollectionId, DriveRequestError, DuplicateManifestError, DuplicateModuleError, DuplicateOperationError, EventBus, EventBusAggregateError, GqlRequestChannel, GqlRequestChannelFactory, GqlResponseChannel, GqlResponseChannelFactory, HybridProjectionCoordinator, SimpleJobExecutor as InMemoryJobExecutor, SimpleJobExecutor, InMemoryJobTracker, InMemoryQueue, IntervalPollTimer, InvalidModuleError, InvalidSignatureError, JobAwaiter, JobExecutorEventTypes, JobStatus, KyselyDocumentIndexer, KyselyDocumentView, KyselyKeyframeStore, KyselyOperationStore, KyselySyncCursorStorage, KyselySyncRemoteStorage, KyselyWriteCache, Mailbox, ModelReadGate, ModuleNotFoundError, NullDocumentModelResolver, OptimisticLockError, PollBehavior, PollingChannelError, ProcessorManager, PropagationMode, QueueEventTypes, REACTOR_SCHEMA, RECOVERABLE_GRAPHQL_ERROR_CODES, Reactor, ReactorBuilder, ReactorClient, ReactorClientBuilder, ReactorEventTypes, ReactorSubscriptionManager, ReadModelCoordinator, RelationalDbProcessor, RelationshipChangeType, RelationshipNotFoundError, RetryAccounting, RevisionMismatchError, SIGNATURE_REFUSAL_CODES, SeededStateReader, SimpleJobExecutorManager, SyncBuilder, SyncEventTypes, SyncOperation, SyncOperationAggregateError, SyncOperationStatus, SyncScopeGate, SyncStatus, SyncStatusTracker, addRelationshipAction, authDecisionModel, batchOperationsByDocument, buildDecisionModel, classifyJobFailure, consolidateSyncOperations, createDocumentAction, createForwardingLogger, createHybridProjectionCoordinatorFactory, createMutableShutdownStatus, createReactorHostModuleBase, createRelationalDb, decideAtHead, defaultReadModelIndexingConfig, deleteDocumentAction, documentActions, documentDecisionModel, driveIdFromUrl, envelopesToSyncOperations, errorToInfo, firstOutOfOrderPair, getMigrationStatus, instrumentPgPool, isDriveAuthError, isRecoverableGraphQLError, makeConsistencyKey, parseDriveUrl, parsePagingOptions, quarantinesDocument, readDecisionModel, removeRelationshipAction, runMigrations, sanitizeArg, selectDecisionModel, supportsLiveReadModelRegistration, syncOperationErrorType, trimMailboxFromAckOrdinal, unchunkedReadModelIndexingConfig, updateRelationshipAction, upgradeDocumentAction, verifyActionSignature, workerEntryPath };
9418
9522
 
9419
9523
  //# sourceMappingURL=index.js.map