@substrat-run/adapter-cloudflare 0.142.0 → 0.144.0

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.d.ts CHANGED
@@ -14,7 +14,7 @@
14
14
  * driving `drainDue`/`runDueSchedules` per scope (#461)
15
15
  */
16
16
  export { CloudflareScopeHost } from './host.js';
17
- export type { CloudflareScopeHostOptions, ConnectorDelegation, EventDrainDelegation, PeerSwitchDelegation, ImportCursorDelegation, SystemSwitchDelegation, LifecycleDelegation, LifecycleDeliveryReport, } from './host.js';
17
+ export type { CloudflareScopeHostOptions, ConnectorDelegation, EventDrainDelegation, PeerSwitchDelegation, ImportCursorDelegation, CapabilityDelegation, SystemSwitchDelegation, LifecycleDelegation, LifecycleDeliveryReport, } from './host.js';
18
18
  export { defineScopeDO } from './scope-do.js';
19
19
  export { ControlPlaneDO } from './control-plane-do.js';
20
20
  export { OperationQueue } from './serialization.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAE1F,OAA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OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE7E,0EAA0E;AAC1E,OAAO,EACL,oCAAoC,EACpC,gCAAgC,EAChC,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAYhD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAC1F,6FAA6F;AAC7F,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,6BAA6B,GAK9B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAQjF,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE7E,0EAA0E;AAC1E,OAAO,EACL,oCAAoC,EACpC,gCAAgC,EAChC,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
@@ -91,11 +91,19 @@ export declare function decodeLiveWithin(header: string): LiveWithin | undefined
91
91
  * fact the client can log, display, and report.
92
92
  *
93
93
  * Defined in `@substrat-run/contracts` (#1859, #1978), because the pure host's `501` names
94
- * it too and a vertical's dev server should not import this adapter to spell it.
94
+ * it too and a vertical's dev server should not import this adapter to spell it. The close
95
+ * codes (`LIVE_CLOSE`) live there for the same reason: a browser reads them.
95
96
  * Re-exported here so `host.ts` and `scope-do.ts` keep reading every wire name from this
96
97
  * one file.
97
98
  */
98
- export { LIVE_MODE_HEADER, type LiveRefusal } from '@substrat-run/contracts';
99
+ export { LIVE_CLOSE, LIVE_MODE_HEADER, type LiveRefusal } from '@substrat-run/contracts';
100
+ /**
101
+ * How many live sockets one principal may hold on one scope (#938). A tab holds one per
102
+ * feed (the desk's, and one per open conversation in ticket0's portal), and each socket is
103
+ * work on every post-commit pass, so a principal opening more is a cost on everybody else
104
+ * writing to the scope. Eight covers several tabs; past it a socket is closed `4429`.
105
+ */
106
+ export declare const LIVE_SOCKETS_PER_PRINCIPAL = 8;
99
107
  /**
100
108
  * Cloudflare's own per-request marker for orange-to-orange routing.
101
109
  *
@@ -1 +1 @@
1
- {"version":3,"file":"live-reads.d.ts","sourceRoot":"","sources":["../src/live-reads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,OAAO,EACZ,KAAK,QAAQ,EACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAoC,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEhH;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AAErD;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB,8BAA8B,CAAC;AACjE,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAC3D,eAAO,MAAM,iBAAiB,0BAA0B,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,mBAA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,GAAG,IAAI,CAsB7E;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,2FAA2F;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE1D"}
@@ -124,11 +124,19 @@ export function decodeLiveWithin(header) {
124
124
  * fact the client can log, display, and report.
125
125
  *
126
126
  * Defined in `@substrat-run/contracts` (#1859, #1978), because the pure host's `501` names
127
- * it too and a vertical's dev server should not import this adapter to spell it.
127
+ * it too and a vertical's dev server should not import this adapter to spell it. The close
128
+ * codes (`LIVE_CLOSE`) live there for the same reason: a browser reads them.
128
129
  * Re-exported here so `host.ts` and `scope-do.ts` keep reading every wire name from this
129
130
  * one file.
130
131
  */
131
- export { LIVE_MODE_HEADER } from '@substrat-run/contracts';
132
+ export { LIVE_CLOSE, LIVE_MODE_HEADER } from '@substrat-run/contracts';
133
+ /**
134
+ * How many live sockets one principal may hold on one scope (#938). A tab holds one per
135
+ * feed (the desk's, and one per open conversation in ticket0's portal), and each socket is
136
+ * work on every post-commit pass, so a principal opening more is a cost on everybody else
137
+ * writing to the scope. Eight covers several tabs; past it a socket is closed `4429`.
138
+ */
139
+ export const LIVE_SOCKETS_PER_PRINCIPAL = 8;
132
140
  /**
133
141
  * Cloudflare's own per-request marker for orange-to-orange routing.
134
142
  *
@@ -1 +1 @@
1
- {"version":3,"file":"live-reads.js","sourceRoot":"","sources":["../src/live-reads.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,aAAa,EACb,aAAa,GAKd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,eAAe,EAA0C,MAAM,sBAAsB,CAAC;AAEhH;;;;;;;;GAQG;AACH,MAAM,CAAC,M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;;GAGG;AACH,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;AAmBtD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,CAOxD;AAED,gHAAgH;AAChH,OAAO,EAAE,kBAAkB,EAAE,CAAC;AA2B9B,wBAAgB,aAAa,CAC3B,OAAO,EAAE,kBAAkB,EAAE,EAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,GACxD,KAAK,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,UAAU,KAAK,aAAa,CAAC,UAAU,CAAC,CA0gO7E"}
package/dist/scope-do.js CHANGED
@@ -2,17 +2,17 @@ import { REWIND_REFUSED } from './rewind-refusal.js';
2
2
  import { SYSTEM_DOOR_MOVED } from './system-door.js';
3
3
  import { DurableObject } from 'cloudflare:workers';
4
4
  import { ATTACHMENT_ADDED, ATTACHMENT_REMOVED, attachmentRecord, domainEvent, domainEventInput, eventId, instant, objectRef, entityObjectRef, assertModuleEmittableType, assertKernelAuthoredType, toWireFailure, grantRefFromProof, principalId, principalBecomeCapabilityInput, scopeId as scopeIdOf, tenantId as tenantIdOf, platformRequestInput, platformRequestId, MAX_PENDING_PLATFORM_REQUESTS, MAX_PENDING_SWEEP_RUNS, SWEEP_RUNS_KIND, SCOPE_TABLE_PAGE_MAX, SCOPE_QUERY_ROW_MAX, listLimitOf, pageOf, countedPageOf, requestFingerprint, substratError, errorCodeOf, assertReplayableDump, REDRAIN_BATCH, } from '@substrat-run/contracts';
5
- import { ulid, LIVE_CLOSE, LIVE_SOCKETS_PER_PRINCIPAL, DO_SQL_LIMITS, unknownRoleError, createUlid, assertAllowed, ConnectionSealingKeyUnavailableError, noSealingKeyMessage, sealTo, assertReadOnlyQuery, entitlementDenial, platformRequestHistoryQuery, platformRequestOf, PLATFORM_REQUEST_COLUMNS, PLATFORM_REQUEST_REDACTION_SQL, platformRequestRedactionParams, platformRequestRedactionQuery, intentPayloadCarriesSubject, redactSubjectJobRuns, eraseSubjectFromModules, moduleErasurePlan, redactSubjectScopeText, assertRowLimit, assertRowOffset, JOB_RUN_PATCH_SQL, JOB_RUN_CLAIM_SQL, JOB_RUN_RENEW_SQL, JOB_RUN_BEGIN_SQL, JOB_RUN_MISS_SQL, JOB_RUN_MISS_SETTLE_SQL, admissionMissOutcome, JOB_LEASE_EXPIRED_NOTE, JOB_STEP_RECORD_SQL, DELIVERY_ERROR_REDACTION_SQL, REDACTED_DELIVERY_NOTE, seatScopeTuple, delegatedRevokeSql, writeExplicitTupleIn, grantEntityShapeIn, topUpEntityGrantShapes, applyScopeRoleChange, changeScopeRole, revokeScopeRoles, scopeRoleHolders, effectiveRoleGrantQuery, switchRecordedOff, switchSystemSchedules, peerGrantsStatus, systemGrantsStatus, systemScheduleState, systemSwitchedOff, denialListQuery, refusalListQuery, mapRefusalRow, denialSummaryQuery, denialTotalsQuery, DENIAL_WINDOW_QUERY, mapDenialRow, mapDenialSummaryBuckets, PermissionDenied, assertImpersonationWrites, assertModuleEnqueueableKind, impersonationStampOf, createAtomic, NotSearchable, isSearchIndexTable, searchIndexPlans, NotListable, listIndexPlans, moduleMigrations, MIGRATION_DIGEST_FENCE_DDL, MIGRATION_DIGEST_MARK_LEGACY, assertJournalDumpCoherent, assertMigrationSql, migrationDivergence, migrationFailedError, migrationSteps, planMigrations, listQuery, cursorOf, searchLimit, searchMatchExpression, searchQuery, ATTACHMENT_TEXT_DDL, attachmentRecordOfRow, enqueueAttachmentText, reconcileAttachmentText, queueAttachmentTextBackfill, startAttachmentTextBackfill, recordAttachmentText, searchAttachments, IDEMPOTENCY_DDL, REFUSALS_TABLE_DDL, REFUSALS_INDEX, refusalInsert, refusalOf, markGuardRefusal, REFUSALS_REBUILD, refusalsAdmitGuards, assertIdempotencyKey, assertPermissionKey, idempotencyLookupQuery, idempotencyPruneStatement, idempotencyRecordStatement, idempotencyOptedOutMessage, replayFor, entityVersionQuery, entityVersionOf, assertIfMatch, OUTBOX_ENTITY_INDEX, SCHEDULE_STATE_DDL, SCHEDULE_STATE_REBUILD, scheduleStateHasKind, VERTICAL_EVENTS_DDL, EXPORT_HOPS_SQL, emptyImportResult, IMPORT_CURSORS_SQL, IMPORT_CURSOR_OF_SQL, OUTBOX_MARK_SQL, exportedSinceQuery, emittedSinceQuery, emittedReportOf, EMITTED_REPORT_CAP, IMPORT_CURSOR_ADVANCE_SQL, IMPORT_RECORD_SQL, moveImportCursor, CrossVerticalRegistry, exportReadPlan, exportReadQuery, planExportBatch, withheldNote, JOB_RUN_DDL, JOB_RUN_DUE_AT, jobRunListLimit, SYSTEM_DOOR_WAIT, ancestorsWithin, } from '@substrat-run/kernel';
6
- import { isUpgradeRequest, readSubscription, LIVE_DECIDE_ATTEMPTS, LIVE_FANOUT_LIMIT, LIVE_MODE_HEADER, LIVE_PRINCIPAL_HEADER, LIVE_SCOPE_HEADER, LIVE_SUBSCRIBE_PATH, LIVE_TENANT_HEADER, LIVE_WITHIN_HEADER, LIVE_EXPIRES_HEADER, decodeLiveWithin, liveInstant, } from './live-reads.js';
5
+ import { ulid, DO_SQL_LIMITS, unknownRoleError, createUlid, assertAllowed, ConnectionSealingKeyUnavailableError, noSealingKeyMessage, sealTo, assertReadOnlyQuery, entitlementDenial, platformRequestHistoryQuery, platformRequestOf, PLATFORM_REQUEST_COLUMNS, PLATFORM_REQUEST_REDACTION_SQL, platformRequestRedactionParams, platformRequestRedactionQuery, intentPayloadCarriesSubject, redactSubjectJobRuns, eraseSubjectFromModules, moduleErasurePlan, redactSubjectScopeText, assertRowLimit, assertRowOffset, JOB_RUN_PATCH_SQL, JOB_RUN_CLAIM_SQL, JOB_RUN_RENEW_SQL, JOB_RUN_BEGIN_SQL, JOB_RUN_MISS_SQL, JOB_RUN_MISS_SETTLE_SQL, admissionMissOutcome, JOB_LEASE_EXPIRED_NOTE, JOB_STEP_RECORD_SQL, DELIVERY_ERROR_REDACTION_SQL, REDACTED_DELIVERY_NOTE, seatScopeTuple, delegatedRevokeSql, writeExplicitTupleIn, grantEntityShapeIn, topUpEntityGrantShapes, applyScopeRoleChange, changeScopeRole, revokeScopeRoles, scopeRoleHolders, effectiveRoleGrantQuery, switchRecordedOff, switchSystemSchedules, peerGrantsStatus, systemGrantsStatus, systemScheduleState, systemSwitchedOff, denialListQuery, refusalListQuery, mapRefusalRow, denialSummaryQuery, denialTotalsQuery, DENIAL_WINDOW_QUERY, mapDenialRow, mapDenialSummaryBuckets, PermissionDenied, assertImpersonationWrites, assertModuleEnqueueableKind, impersonationStampOf, createAtomic, NotSearchable, isSearchIndexTable, searchIndexPlans, NotListable, listIndexPlans, moduleMigrations, MIGRATION_DIGEST_FENCE_DDL, MIGRATION_DIGEST_MARK_LEGACY, assertJournalDumpCoherent, assertMigrationSql, migrationDivergence, migrationFailedError, migrationSteps, planMigrations, listQuery, cursorOf, searchLimit, searchMatchExpression, searchQuery, ATTACHMENT_TEXT_DDL, attachmentRecordOfRow, enqueueAttachmentText, reconcileAttachmentText, queueAttachmentTextBackfill, startAttachmentTextBackfill, recordAttachmentText, searchAttachments, IDEMPOTENCY_DDL, REFUSALS_TABLE_DDL, REFUSALS_INDEX, refusalInsert, refusalOf, markGuardRefusal, REFUSALS_REBUILD, refusalsAdmitGuards, assertIdempotencyKey, assertPermissionKey, idempotencyLookupQuery, idempotencyPruneStatement, idempotencyRecordStatement, idempotencyOptedOutMessage, replayFor, entityVersionQuery, entityVersionOf, assertIfMatch, OUTBOX_ENTITY_INDEX, SCHEDULE_STATE_DDL, SCHEDULE_STATE_REBUILD, scheduleStateHasKind, VERTICAL_EVENTS_DDL, EXPORT_HOPS_SQL, emptyImportResult, IMPORT_CURSORS_SQL, IMPORT_CURSOR_OF_SQL, OUTBOX_MARK_SQL, exportedSinceQuery, emittedSinceQuery, emittedReportOf, EMITTED_REPORT_CAP, IMPORT_CURSOR_ADVANCE_SQL, IMPORT_RECORD_SQL, moveImportCursor, CrossVerticalRegistry, exportReadPlan, exportReadQuery, planExportBatch, withheldNote, JOB_RUN_DDL, JOB_RUN_DUE_AT, jobRunListLimit, SYSTEM_DOOR_WAIT, ancestorsWithin, } from '@substrat-run/kernel';
6
+ import { isUpgradeRequest, readSubscription, LIVE_DECIDE_ATTEMPTS, LIVE_FANOUT_LIMIT, LIVE_MODE_HEADER, LIVE_PRINCIPAL_HEADER, LIVE_SCOPE_HEADER, LIVE_SUBSCRIBE_PATH, LIVE_TENANT_HEADER, LIVE_WITHIN_HEADER, LIVE_EXPIRES_HEADER, LIVE_CLOSE, LIVE_SOCKETS_PER_PRINCIPAL, decodeLiveWithin, liveInstant, } from './live-reads.js';
7
7
  import { replyOf } from './do-reply.js';
8
8
  import { OperationQueue } from './serialization.js';
9
9
  import { assertNoWorkerdStorage, doScopedSql, doBuiltColumnsOf, doRedactionSql, doSpineSql } from './sql.js';
10
- import { actorOf, admitPeer, collectPeers, switchPeer, peerSubjectRef, subjectGrantState, assertNoSecret, CAPABILITY_DDL, COPY_ORIGIN_DDL, ENTITY_STATE_MOVES_DDL, SWITCH_FENCES_DDL, TABLE_OWNERS_DDL, assertMigrationLeavesLedgerAlone, recordOwnershipSteps, runMigrationStatements, splitSqlStatements, executableSqlStatements, blankSqlComments, CAPABILITY_EXCHANGE_OPERATION, CAPABILITY_BECOME_MINT_OPERATION, becomeMintCheck, mintBecomeCapabilityAsPrincipal, revokeBecomeCapabilityAsPrincipal, readBecomeLinkStates, capabilityAttachmentWriteRefused, createCapabilityVerbs, createEntityEdgeVerbs, createEntityStateVerbs, createTrashedReads, CONTINUATION_POSITION_CAP, visibleContinuation, searchStateWhere, uncheckedView, addStatePlans, assertNoCallerPurge, isUnreachableParent, PURGE_BATCH, heldPurgePass, lifecycleRefusal, purgeHeldBy, purgeDueOf, purgeOnlyKeysOf, runPurgePass, refuseTrashedTarget, registerTrashTargets, withheldKeysFor, statefulTablesOf, afterMigration, afterRuntimeDdl, derivesAnything, repairDerivedObjects, StateColumnLost, exchangeCapability, guardSecrets, mintBecomeCapability, redactSecrets, redactSecretText, moduleLog, asyncInvocationId, asyncLinePass, resolveCapabilitySession, revokeCapabilityAsPlatform, readCapabilityPage, domainEventOf, facetEvents, readDeadLetters, readLifecycleFlow, readOperationSeries, readHistory, readInvocation, readUndrainedOutbox, walkEventCause, walkEventEffects, } from '@substrat-run/kernel';
10
+ import { actorOf, admitPeer, collectPeers, switchPeer, peerSubjectRef, subjectGrantState, assertNoSecret, CAPABILITY_DDL, COPY_ORIGIN_DDL, ENTITY_STATE_MOVES_DDL, SWITCH_FENCES_DDL, TABLE_OWNERS_DDL, assertMigrationLeavesLedgerAlone, recordOwnershipSteps, runMigrationStatements, splitSqlStatements, executableSqlStatements, blankSqlComments, CAPABILITY_EXCHANGE_OPERATION, CAPABILITY_BECOME_MINT_OPERATION, becomeMintCheck, mintBecomeCapabilityAsPrincipal, revokeBecomeCapabilityAsPrincipal, readBecomeLinkStates, ENTITY_UNBIND_OPERATION, allowedFor, unbindEntityHolderBounded, capabilityAttachmentWriteRefused, createCapabilityVerbs, createEntityEdgeVerbs, createEntityStateVerbs, createTrashedReads, CONTINUATION_POSITION_CAP, visibleContinuation, searchStateWhere, uncheckedView, addStatePlans, assertNoCallerPurge, isUnreachableParent, PURGE_BATCH, heldPurgePass, lifecycleRefusal, purgeHeldBy, purgeDueOf, purgeOnlyKeysOf, runPurgePass, refuseTrashedTarget, assertBoundOperations, registerTrashTargets, withheldKeysFor, statefulTablesOf, afterMigration, afterRuntimeDdl, derivesAnything, repairDerivedObjects, StateColumnLost, exchangeCapability, guardSecrets, mintBecomeCapability, redactSecrets, redactSecretText, moduleLog, asyncInvocationId, asyncLinePass, resolveCapabilitySession, revokeCapabilityAsPlatform, readCapabilityPage, domainEventOf, facetEvents, readDeadLetters, readLifecycleFlow, readOperationSeries, readHistory, readInvocation, readUndrainedOutbox, walkEventCause, walkEventEffects, } from '@substrat-run/kernel';
11
11
  import { COPY_RESTORE_FENCE_LAPSED, copyRestoreFenceLapsed } from '@substrat-run/kernel';
12
12
  import { createDoTupleChecker, createLocalControlPlaneReader, scopeTupleReader } from './checker.js';
13
13
  import { settlePlatformRequestIn } from '@substrat-run/kernel';
14
14
  import { CARRIED_AWAY_KEY, COPY_MARK_CLEARED_KEY, KEPT_COPY_REFUSAL, KEPT_DIVERGENT_KEY, LOAD_STAMP_KEY, STORE_LOCAL_META_KEYS, WRITE_REVISION_KEY, carriedAwayDump, isCopyMarkInsert, isWriteStatement, assertSpineTablesBuilt, capabilitiesForLoad, clearCopyMarker, dumpRowsInsert, isSpineTable, markCopyOrigin, repointScopeGrants, settleCopiedWork, emittedHere, IS_COPY_SQL, isCopyLoad, isLifecycleWrite, readLifecycle, settleLifecycleAfterLoad, writeLifecycle, spineColumnAdditions } from '@substrat-run/kernel';
15
- import { GRANT_CHILDREN_INDEX_DDL, grantedEntitiesForContext } from '@substrat-run/kernel';
15
+ import { GRANT_CHILDREN_INDEX_DDL, SHAPE_MARKER_INDEX_DDL, grantedEntitiesForContext } from '@substrat-run/kernel';
16
16
  /** A scope's migration journal: `module@version` → the SQL digest it recorded (#2066). */
17
17
  function readAppliedMigrations(sql) {
18
18
  const rows = sql.exec('SELECT module_id, version, sql_digest FROM _substrat_migrations').toArray();
@@ -220,6 +220,7 @@ const KERNEL_DDL = `
220
220
  PRIMARY KEY (subject, relation, object)
221
221
  );
222
222
  ${GRANT_CHILDREN_INDEX_DDL};
223
+ ${SHAPE_MARKER_INDEX_DDL};
223
224
  CREATE TABLE IF NOT EXISTS _substrat_deliveries (
224
225
  event_id TEXT NOT NULL,
225
226
  consumer_module TEXT NOT NULL,
@@ -560,6 +561,15 @@ function toRpcError(err) {
560
561
  }
561
562
  return new Error(String(err));
562
563
  }
564
+ /** A throwing RPC kept for a coordinator from before #113: `fn`'s refusal, as `toRpcError` rebuilds it. */
565
+ async function thrownForRpc(fn) {
566
+ try {
567
+ return await fn();
568
+ }
569
+ catch (err) {
570
+ throw toRpcError(err);
571
+ }
572
+ }
563
573
  /** The check subject for an attachment gate (#476): the connection when the connector door
564
574
  * set one, else the principal — mirrors the invoke path's subject selection. */
565
575
  /**
@@ -832,8 +842,10 @@ export function defineScopeDO(modules, bareOps) {
832
842
  // -- module registration (port of SqliteScopeHost.registerModule) ---------
833
843
  registerModule(registration) {
834
844
  const manifest = registration.manifest;
845
+ // #1835: the binder's own value, or nothing registers — as in the pure adapter.
846
+ assertBoundOperations(manifest.id, registration.operations);
835
847
  // #119: refused before anything is recorded, as in the pure adapter.
836
- const trashTargets = registerTrashTargets(manifest.id, new Set(Object.keys(registration.operations ?? {})), registration.operationInputs, manifest.entityStates, manifest.schedules);
848
+ const trashTargets = registerTrashTargets(manifest.id, new Set(Object.keys(registration.operations?.handlers ?? {})), registration.operations?.inputs, manifest.entityStates, manifest.schedules);
837
849
  this.purgeOnlyKeys.set(manifest.id, purgeOnlyKeysOf(manifest.schedules ?? []));
838
850
  for (const schedule of manifest.schedules ?? []) {
839
851
  if (schedule.purge)
@@ -929,31 +941,31 @@ export function defineScopeDO(modules, bareOps) {
929
941
  }
930
942
  // #893: a schema declared for an operation this module does not bind
931
943
  // enforces nothing while reading as coverage — refused, as in the pure adapter.
932
- const declaredInputs = registration.operationInputs ?? {};
933
- const ownOps = new Set(Object.keys(registration.operations ?? {}));
944
+ const declaredInputs = registration.operations?.inputs ?? {};
945
+ const ownOps = new Set(Object.keys(registration.operations?.handlers ?? {}));
934
946
  const unbound = Object.keys(declaredInputs).filter((name) => !ownOps.has(name));
935
947
  if (unbound.length > 0) {
936
- throw new Error(`${manifest.id} declares operationInputs for unbound operation(s): ` +
948
+ throw new Error(`${manifest.id} declares operations.inputs for unbound operation(s): ` +
937
949
  `${unbound.sort().join(', ')} — a schema on nothing reads as a parse that is not there`);
938
950
  }
939
951
  // Same rule for a declared precondition, and it matters more: a
940
952
  // `concurrency` on an unbound name is a guarantee nothing enforces.
941
- const declaredConcurrency = registration.operationConcurrency ?? {};
953
+ const declaredConcurrency = registration.operations?.concurrency ?? {};
942
954
  const unguarded = Object.keys(declaredConcurrency).filter((name) => !ownOps.has(name));
943
955
  if (unguarded.length > 0) {
944
- throw new Error(`${manifest.id} declares operationConcurrency for unbound operation(s): ` +
956
+ throw new Error(`${manifest.id} declares operations.concurrency for unbound operation(s): ` +
945
957
  `${unguarded.sort().join(', ')} — a precondition on nothing reads as a guard that is not there`);
946
958
  }
947
959
  // #116: same rule again for an opt-out — one on an unbound name reads as a
948
960
  // deliberate exclusion of an operation that is not there.
949
- const declaredOptOuts = registration.operationIdempotencyOptOuts ?? [];
961
+ const declaredOptOuts = registration.operations?.idempotencyOptOuts ?? [];
950
962
  const unboundOptOuts = declaredOptOuts.filter((name) => !ownOps.has(name));
951
963
  if (unboundOptOuts.length > 0) {
952
964
  throw new Error(`${manifest.id} declares idempotency: false for unbound operation(s): ` +
953
965
  `${[...unboundOptOuts].sort().join(', ')} — an opt-out on nothing reads as an ` +
954
966
  'exclusion someone decided, of an operation that does not exist');
955
967
  }
956
- for (const [name, handler] of Object.entries(registration.operations ?? {})) {
968
+ for (const [name, handler] of Object.entries(registration.operations?.handlers ?? {})) {
957
969
  this.defineOperation(name, handler);
958
970
  // The schema follows the HANDLER, not the name: a withdrawn operation
959
971
  // never binds, and has nothing to parse for.
@@ -1647,19 +1659,39 @@ export function defineScopeDO(modules, bareOps) {
1647
1659
  }
1648
1660
  /**
1649
1661
  * One bounded pass of a declared shape's reconcile (#2071), with its events, in ONE
1650
- * transaction: how many it topped up, how many it took retired keys from (#2082), and
1651
- * whether the scope is done.
1652
- */
1653
- async topUpEntityGrantShapes(tenantId, scopeId, shapes, limit) {
1654
- return this.queue.enqueue(() => this.revision.transactionSync(() => topUpEntityGrantShapes(this.switchSql(), {
1662
+ * transaction: how many it topped up, how many it took retired keys from (#2082), and where
1663
+ * the next pass resumes (#2083), `null` once the scope is done.
1664
+ *
1665
+ * A host from before #2083 passes no `after` at all (a new one passes `null` to start) and
1666
+ * loops until `done`, starting each call over. A bounded pass started over never gets past a
1667
+ * window of finished markers, so that host would call forever; for it, this call runs the
1668
+ * whole reconcile here instead, a transaction per pass, and answers `done: true`. Drop the
1669
+ * branch and `done` once no host that predates the cursor can address a ScopeDO built from this.
1670
+ */
1671
+ async topUpEntityGrantShapes(tenantId, scopeId, shapes, limit, after) {
1672
+ const pass = (from) => this.queue.enqueue(() => this.revision.transactionSync(() => topUpEntityGrantShapes(this.switchSql(), {
1655
1673
  tenantId,
1656
1674
  scopeId,
1657
1675
  shapes,
1658
1676
  now: new Date().toISOString(),
1659
1677
  limit,
1678
+ after: from,
1660
1679
  mintEventId: (ms) => this.mintEventId(ms),
1661
1680
  version: this.env.SUBSTRAT_VERSION_ID ?? null,
1662
1681
  })));
1682
+ if (after !== undefined) {
1683
+ const one = await pass(after);
1684
+ return { ...one, done: one.next === null };
1685
+ }
1686
+ let [toppedUp, retired, retirementsLeftOpen, from] = [0, 0, 0, null];
1687
+ do {
1688
+ const one = await pass(from);
1689
+ toppedUp += one.toppedUp;
1690
+ retired += one.retired;
1691
+ retirementsLeftOpen += one.retirementsLeftOpen;
1692
+ from = one.next;
1693
+ } while (from);
1694
+ return { toppedUp, retired, retirementsLeftOpen, next: null, done: true };
1663
1695
  }
1664
1696
  /**
1665
1697
  * The dispatch capability's admission (#726 remedy B): this delivery may read the
@@ -2735,8 +2767,42 @@ export function defineScopeDO(modules, bareOps) {
2735
2767
  .toArray()[0];
2736
2768
  return row ? attachmentRecordOfRow(row) : null;
2737
2769
  }
2770
+ // The attachment verbs (#473) each have two doors onto one private body. The `…Reply`
2771
+ // door answers a refusal as DATA, so its code and extensions survive the hop (#113); the
2772
+ // plain one throws it as the bare `Error` `toRpcError` rebuilds, and is kept for a
2773
+ // coordinator from before #113.
2774
+ attachmentAdd(...args) {
2775
+ return thrownForRpc(() => this.addAttachment(...args));
2776
+ }
2777
+ attachmentAddReply(...args) {
2778
+ return replyOf(() => this.addAttachment(...args));
2779
+ }
2780
+ attachmentList(...args) {
2781
+ return thrownForRpc(() => this.listAttachments(...args));
2782
+ }
2783
+ attachmentListReply(...args) {
2784
+ return replyOf(() => this.listAttachments(...args));
2785
+ }
2786
+ attachmentAuthorize(...args) {
2787
+ return thrownForRpc(() => this.authorizeAttachment(...args));
2788
+ }
2789
+ attachmentAuthorizeReply(...args) {
2790
+ return replyOf(() => this.authorizeAttachment(...args));
2791
+ }
2792
+ systemAttachmentAuthorize(...args) {
2793
+ return thrownForRpc(() => this.authorizeSystemAttachment(...args));
2794
+ }
2795
+ systemAttachmentAuthorizeReply(...args) {
2796
+ return replyOf(() => this.authorizeSystemAttachment(...args));
2797
+ }
2798
+ attachmentRemove(...args) {
2799
+ return thrownForRpc(() => this.removeAttachment(...args));
2800
+ }
2801
+ attachmentRemoveReply(...args) {
2802
+ return replyOf(() => this.removeAttachment(...args));
2803
+ }
2738
2804
  /** Record an uploaded attachment: write gate + row + `attachment.added`, one txn. */
2739
- async attachmentAdd(record, principal, tenantId, scopeId,
2805
+ async addAttachment(record, principal, tenantId, scopeId,
2740
2806
  // #476: when set, the gate is checked as this CONNECTION (not `principal`, which is
2741
2807
  // then only the ctx.principal placeholder the connector door passes).
2742
2808
  connectionId) {
@@ -2772,7 +2838,7 @@ export function defineScopeDO(modules, bareOps) {
2772
2838
  if (err instanceof PermissionDenied) {
2773
2839
  this.recordDenial(attachSubject(principal, connectionId), tenantId, 'attachments.upload', err, null);
2774
2840
  }
2775
- throw toRpcError(err);
2841
+ throw err;
2776
2842
  }
2777
2843
  // #1525: null. An attachment RPC carries no invocation, exactly as its denial
2778
2844
  // records none — so the deliveries it drains name no call rather than a wrong one.
@@ -2781,7 +2847,7 @@ export function defineScopeDO(modules, bareOps) {
2781
2847
  });
2782
2848
  }
2783
2849
  /** Records for one entity, newest first — read gate first. */
2784
- async attachmentList(entity, principal, tenantId, scopeId, connectionId) {
2850
+ async listAttachments(entity, principal, tenantId, scopeId, connectionId) {
2785
2851
  await this.ensureMigrations();
2786
2852
  const gate = this.attachmentGate(entity.entityType);
2787
2853
  try {
@@ -2792,7 +2858,7 @@ export function defineScopeDO(modules, bareOps) {
2792
2858
  if (err instanceof PermissionDenied) {
2793
2859
  this.recordDenial(attachSubject(principal, connectionId), tenantId, 'attachments.list', err, null);
2794
2860
  }
2795
- throw toRpcError(err);
2861
+ throw err;
2796
2862
  }
2797
2863
  const rows = this.sql
2798
2864
  .exec(`SELECT id FROM _substrat_attachments WHERE entity_type = ? AND entity_id = ?
@@ -2804,7 +2870,7 @@ export function defineScopeDO(modules, bareOps) {
2804
2870
  * Authorize one attachment (`read` before bytes are served, `write` before a remove is
2805
2871
  * attempted elsewhere) and return its record — null for an id this scope does not know.
2806
2872
  */
2807
- async attachmentAuthorize(attachmentId, mode, principal, tenantId, scopeId, connectionId, forEventId) {
2873
+ async authorizeAttachment(attachmentId, mode, principal, tenantId, scopeId, connectionId, forEventId) {
2808
2874
  await this.ensureMigrations();
2809
2875
  const record = this.attachmentRow(attachmentId);
2810
2876
  if (!record)
@@ -2823,7 +2889,7 @@ export function defineScopeDO(modules, bareOps) {
2823
2889
  if (err instanceof PermissionDenied) {
2824
2890
  this.recordDenial(attachSubject(principal, connectionId), tenantId, 'attachments.open', err, null);
2825
2891
  }
2826
- throw toRpcError(err);
2892
+ throw err;
2827
2893
  }
2828
2894
  return record;
2829
2895
  }
@@ -2836,12 +2902,12 @@ export function defineScopeDO(modules, bareOps) {
2836
2902
  if (err instanceof PermissionDenied) {
2837
2903
  this.recordDenial(attachSubject(principal, connectionId), tenantId, 'attachments.open', err, null);
2838
2904
  }
2839
- throw toRpcError(err);
2905
+ throw err;
2840
2906
  }
2841
2907
  return record;
2842
2908
  }
2843
2909
  /** Authorize a job's read as its registered module, never as a person. */
2844
- async systemAttachmentAuthorize(attachmentId, moduleId, tenantId, scopeId,
2910
+ async authorizeSystemAttachment(attachmentId, moduleId, tenantId, scopeId,
2845
2911
  /** #1834: the instance the system door's gate read; see `invoke`. */
2846
2912
  systemDoorInstance) {
2847
2913
  await this.ensureMigrations();
@@ -2852,10 +2918,10 @@ export function defineScopeDO(modules, bareOps) {
2852
2918
  catch (err) {
2853
2919
  if (err instanceof SystemDoorMovedError)
2854
2920
  return SYSTEM_DOOR_MOVED;
2855
- throw toRpcError(err);
2921
+ throw err;
2856
2922
  }
2857
2923
  if (!this.modules.has(moduleId)) {
2858
- throw toRpcError(substratError('not_found', `module not registered in this scope: ${moduleId}`));
2924
+ throw substratError('not_found', `module not registered in this scope: ${moduleId}`);
2859
2925
  }
2860
2926
  const record = this.attachmentRow(attachmentId);
2861
2927
  if (!record)
@@ -2869,12 +2935,12 @@ export function defineScopeDO(modules, bareOps) {
2869
2935
  if (err instanceof PermissionDenied) {
2870
2936
  this.recordDenial({ kind: 'system', id: moduleId }, tenantId, 'attachments.open', err, null);
2871
2937
  }
2872
- throw toRpcError(err);
2938
+ throw err;
2873
2939
  }
2874
2940
  return record;
2875
2941
  }
2876
2942
  /** Remove an attachment's metadata fact: write gate + delete + `attachment.removed`. */
2877
- async attachmentRemove(attachmentId, principal, tenantId, scopeId, connectionId) {
2943
+ async removeAttachment(attachmentId, principal, tenantId, scopeId, connectionId) {
2878
2944
  await this.ensureMigrations();
2879
2945
  return this.queue.enqueue(async () => {
2880
2946
  const record = this.attachmentRow(attachmentId);
@@ -2901,7 +2967,7 @@ export function defineScopeDO(modules, bareOps) {
2901
2967
  if (err instanceof PermissionDenied) {
2902
2968
  this.recordDenial(attachSubject(principal, connectionId), tenantId, 'attachments.remove', err, null);
2903
2969
  }
2904
- throw toRpcError(err);
2970
+ throw err;
2905
2971
  }
2906
2972
  // #1525: null. An attachment RPC carries no invocation, exactly as its denial
2907
2973
  // records none — so the deliveries it drains name no call rather than a wrong one.
@@ -3507,6 +3573,7 @@ export function defineScopeDO(modules, bareOps) {
3507
3573
  holdings: this.checker.holdings
3508
3574
  ? (principal) => this.checker.holdings({ kind: 'principal', id: principal }, { tenantId, scopeId })
3509
3575
  : undefined,
3576
+ allowed: (principal, permission, entity) => allowedFor(this.checker, principal, { tenantId, scopeId })(permission, entity),
3510
3577
  }, secret, mode);
3511
3578
  });
3512
3579
  if (outcome)
@@ -3525,7 +3592,7 @@ export function defineScopeDO(modules, bareOps) {
3525
3592
  const minter = principalId.parse(caller);
3526
3593
  const parsed = principalBecomeCapabilityInput.parse(input);
3527
3594
  return await this.queue.enqueue(async () => {
3528
- const checked = await becomeMintCheck({ sql: doSpineSql(this.sql), checker: this.checker }, minter, parsed.principal, { tenantId, scopeId });
3595
+ const checked = await becomeMintCheck({ sql: doSpineSql(this.sql), checker: this.checker }, minter, parsed.principal, { tenantId, scopeId }, parsed.bind);
3529
3596
  if (!checked.ok)
3530
3597
  return checked;
3531
3598
  const liveSince = this.liveHighWaterMark();
@@ -3542,6 +3609,32 @@ export function defineScopeDO(modules, bareOps) {
3542
3609
  return { ok: true, minted: minted };
3543
3610
  });
3544
3611
  }
3612
+ /**
3613
+ * Unbind a binding shape's record (#1686) — its column cleared and the shape its person held
3614
+ * there through it taken back — as `caller`, who must hold the binding's key on the record. The
3615
+ * kernel's bound and the write in ONE queued body and one storage transaction; a refusal writes
3616
+ * nothing. On the spine as `entity.holder-unbound`, the caller its actor.
3617
+ */
3618
+ async unbindEntityHolderBoundedFor(tenantId, scopeId, caller, entity) {
3619
+ await this.ensureMigrations();
3620
+ const by = principalId.parse(caller);
3621
+ return await this.queue.enqueue(async () => {
3622
+ const liveSince = this.liveHighWaterMark();
3623
+ const now = instant.parse(new Date().toISOString());
3624
+ let answer = { ok: true, unbound: [] };
3625
+ await this.revision.transaction(async () => {
3626
+ answer = await unbindEntityHolderBounded({
3627
+ sql: doSpineSql(this.sql),
3628
+ now,
3629
+ allowed: allowedFor(this.checker, by, { tenantId, scopeId }),
3630
+ emit: (event) => kernelEmit(this.operationContext(by, tenantId, scopeId, undefined, undefined, undefined, undefined, undefined, ENTITY_UNBIND_OPERATION, undefined, [], now), event),
3631
+ }, entity);
3632
+ });
3633
+ if (answer.ok && answer.unbound.length > 0)
3634
+ await this.settleCommitted(tenantId, scopeId, liveSince, null);
3635
+ return answer;
3636
+ });
3637
+ }
3545
3638
  /** Where each named `become` link stands (#1686) — a pending-invite list's read. */
3546
3639
  async becomeLinkStatesFor(tenantId, scopeId, ids) {
3547
3640
  await this.ensureMigrations();
@@ -4487,12 +4580,7 @@ export function defineScopeDO(modules, bareOps) {
4487
4580
  /** A bounded page of one table. Unknown table names throw — never queried blind. Kept for a
4488
4581
  * coordinator from before #113; the current one calls `introspectTableReply`. */
4489
4582
  introspectTable(table, limit, offset) {
4490
- try {
4491
- return this.tablePage(table, limit, offset);
4492
- }
4493
- catch (e) {
4494
- throw toRpcError(e);
4495
- }
4583
+ return thrownForRpc(async () => this.tablePage(table, limit, offset));
4496
4584
  }
4497
4585
  /** `introspectTable`, its refusal answered as DATA so its code survives the hop (#113). */
4498
4586
  introspectTableReply(table, limit, offset) {
@@ -4524,13 +4612,8 @@ export function defineScopeDO(modules, bareOps) {
4524
4612
  * at SCOPE_QUERY_ROW_MAX with `truncated` set, never an error.
4525
4613
  * Kept for a coordinator from before #113; the current one calls `introspectQueryReply`.
4526
4614
  */
4527
- async introspectQuery(sql) {
4528
- try {
4529
- return await this.readOnlyQuery(sql);
4530
- }
4531
- catch (e) {
4532
- throw toRpcError(e);
4533
- }
4615
+ introspectQuery(sql) {
4616
+ return thrownForRpc(() => this.readOnlyQuery(sql));
4534
4617
  }
4535
4618
  /** `introspectQuery`, its refusal answered as DATA so its code survives the hop (#113). */
4536
4619
  introspectQueryReply(sql) {
@@ -4688,6 +4771,8 @@ export function defineScopeDO(modules, bareOps) {
4688
4771
  'ALTER TABLE _substrat_capabilities ADD COLUMN target_digest TEXT',
4689
4772
  // #1686: why the kernel revoked a link itself; NULL for every revoke already there.
4690
4773
  'ALTER TABLE _substrat_capabilities ADD COLUMN revoked_reason TEXT',
4774
+ // #1686: the action a become carries; NULL on every row already there — none carries one.
4775
+ 'ALTER TABLE _substrat_capabilities ADD COLUMN action TEXT',
4691
4776
  // #1632: legacy runs retain an unknown subject; no content-based backfill.
4692
4777
  'ALTER TABLE _substrat_job_runs ADD COLUMN subject_id TEXT',
4693
4778
  // #2034: the lease. NULL = nobody holds the run, which is right for every row already there.