@abloatai/ablo 0.26.0 → 0.27.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/CHANGELOG.md +14 -0
- package/README.md +101 -85
- package/dist/BaseSyncedStore.d.ts +85 -88
- package/dist/BaseSyncedStore.js +131 -147
- package/dist/Database.d.ts +54 -68
- package/dist/Database.js +97 -113
- package/dist/{ObjectPool.d.ts → InstanceCache.d.ts} +10 -13
- package/dist/{ObjectPool.js → InstanceCache.js} +85 -83
- package/dist/LazyReferenceCollection.d.ts +11 -15
- package/dist/LazyReferenceCollection.js +12 -16
- package/dist/Model.d.ts +37 -52
- package/dist/Model.js +46 -61
- package/dist/ModelRegistry.d.ts +21 -19
- package/dist/ModelRegistry.js +23 -27
- package/dist/NetworkMonitor.d.ts +5 -6
- package/dist/NetworkMonitor.js +5 -6
- package/dist/SyncClient.d.ts +112 -112
- package/dist/SyncClient.js +165 -172
- package/dist/adapters/alwaysOnline.d.ts +6 -8
- package/dist/adapters/alwaysOnline.js +6 -8
- package/dist/adapters/inMemoryStorage.d.ts +9 -9
- package/dist/adapters/inMemoryStorage.js +9 -9
- package/dist/agent/Agent.d.ts +27 -32
- package/dist/agent/Agent.js +18 -19
- package/dist/agent/index.d.ts +4 -4
- package/dist/agent/index.js +5 -5
- package/dist/agent/session.d.ts +47 -44
- package/dist/agent/session.js +37 -48
- package/dist/agent/types.d.ts +26 -31
- package/dist/agent/types.js +6 -7
- package/dist/ai-sdk/coordinatedTool.d.ts +108 -0
- package/dist/ai-sdk/{coordinated-tool.js → coordinatedTool.js} +44 -38
- package/dist/ai-sdk/coordinationContext.d.ts +46 -0
- package/dist/ai-sdk/{coordination-context.js → coordinationContext.js} +26 -33
- package/dist/ai-sdk/index.d.ts +25 -22
- package/dist/ai-sdk/index.js +25 -22
- package/dist/ai-sdk/wrap.d.ts +6 -7
- package/dist/ai-sdk/wrap.js +1 -1
- package/dist/auth/credentialPolicy.d.ts +69 -74
- package/dist/auth/credentialPolicy.js +51 -56
- package/dist/auth/credentialSource.d.ts +6 -5
- package/dist/auth/credentialSource.js +9 -10
- package/dist/auth/index.d.ts +59 -58
- package/dist/auth/index.js +31 -37
- package/dist/auth/schemas.d.ts +5 -4
- package/dist/auth/schemas.js +5 -4
- package/dist/batching/index.d.ts +19 -21
- package/dist/batching/index.js +14 -17
- package/dist/cli.cjs +167 -119
- package/dist/client/Ablo.d.ts +73 -73
- package/dist/client/Ablo.js +125 -160
- package/dist/client/ApiClient.d.ts +30 -19
- package/dist/client/ApiClient.js +133 -38
- package/dist/client/auth.d.ts +47 -47
- package/dist/client/auth.js +108 -117
- package/dist/client/claimHeartbeatLoop.d.ts +50 -0
- package/dist/client/claimHeartbeatLoop.js +88 -0
- package/dist/client/consoleLogger.d.ts +5 -6
- package/dist/client/consoleLogger.js +5 -6
- package/dist/client/createInternalComponents.d.ts +14 -17
- package/dist/client/createInternalComponents.js +25 -30
- package/dist/client/createModelProxy.d.ts +130 -120
- package/dist/client/createModelProxy.js +152 -122
- package/dist/client/credentialEndpoint.d.ts +40 -42
- package/dist/client/credentialEndpoint.js +35 -36
- package/dist/client/functionalUpdate.d.ts +29 -27
- package/dist/client/functionalUpdate.js +21 -21
- package/dist/client/hostedEndpoints.d.ts +9 -12
- package/dist/client/hostedEndpoints.js +9 -12
- package/dist/client/httpClient.d.ts +57 -53
- package/dist/client/httpClient.js +29 -31
- package/dist/client/identity.d.ts +15 -20
- package/dist/client/identity.js +47 -58
- package/dist/client/modelRegistration.d.ts +5 -9
- package/dist/client/modelRegistration.js +67 -87
- package/dist/client/options.d.ts +134 -157
- package/dist/client/options.js +3 -7
- package/dist/client/registerDataSource.d.ts +9 -9
- package/dist/client/registerDataSource.js +15 -16
- package/dist/client/resourceTypes.d.ts +64 -75
- package/dist/client/resourceTypes.js +4 -10
- package/dist/client/schemaConfig.d.ts +31 -43
- package/dist/client/schemaConfig.js +38 -50
- package/dist/client/sessionMint.d.ts +16 -12
- package/dist/client/sessionMint.js +26 -31
- package/dist/client/validateAbloOptions.d.ts +12 -14
- package/dist/client/validateAbloOptions.js +8 -9
- package/dist/client/writeOptionsSchema.d.ts +18 -16
- package/dist/client/writeOptionsSchema.js +23 -20
- package/dist/client/wsMutationExecutor.d.ts +15 -20
- package/dist/client/wsMutationExecutor.js +17 -23
- package/dist/context.d.ts +6 -4
- package/dist/context.js +6 -4
- package/dist/coordination/index.d.ts +10 -8
- package/dist/coordination/index.js +14 -12
- package/dist/coordination/schema.d.ts +176 -128
- package/dist/coordination/schema.js +197 -133
- package/dist/coordination/trace.d.ts +9 -10
- package/dist/coordination/trace.js +13 -14
- package/dist/core/DatabaseManager.d.ts +5 -7
- package/dist/core/DatabaseManager.js +15 -19
- package/dist/core/QueryProcessor.d.ts +7 -9
- package/dist/core/QueryProcessor.js +22 -28
- package/dist/core/QueryView.d.ts +8 -8
- package/dist/core/QueryView.js +2 -2
- package/dist/core/StoreManager.d.ts +12 -14
- package/dist/core/StoreManager.js +21 -24
- package/dist/core/ViewRegistry.d.ts +5 -5
- package/dist/core/ViewRegistry.js +4 -4
- package/dist/core/index.d.ts +17 -12
- package/dist/core/index.js +32 -26
- package/dist/core/openIDBWithTimeout.d.ts +38 -36
- package/dist/core/openIDBWithTimeout.js +42 -43
- package/dist/core/queryUtils.d.ts +45 -0
- package/dist/core/queryUtils.js +69 -0
- package/dist/core/storeContract.d.ts +63 -61
- package/dist/core/storeContract.js +8 -12
- package/dist/environment.d.ts +28 -0
- package/dist/environment.js +21 -0
- package/dist/errorCodes.d.ts +107 -99
- package/dist/errorCodes.js +131 -132
- package/dist/errors.d.ts +160 -166
- package/dist/errors.js +155 -158
- package/dist/index.d.ts +30 -27
- package/dist/index.js +89 -86
- package/dist/interfaces/index.d.ts +102 -113
- package/dist/interfaces/index.js +5 -4
- package/dist/keys/index.d.ts +27 -29
- package/dist/keys/index.js +41 -40
- package/dist/mutators/RecordingTransaction.d.ts +16 -16
- package/dist/mutators/RecordingTransaction.js +31 -37
- package/dist/mutators/Transaction.d.ts +18 -26
- package/dist/mutators/Transaction.js +14 -20
- package/dist/mutators/UndoManager.d.ts +122 -131
- package/dist/mutators/UndoManager.js +145 -156
- package/dist/mutators/defineMutators.d.ts +23 -34
- package/dist/mutators/defineMutators.js +14 -20
- package/dist/mutators/inverseOp.d.ts +12 -15
- package/dist/mutators/inverseOp.js +12 -15
- package/dist/mutators/mutateActions.d.ts +10 -9
- package/dist/mutators/mutateActions.js +1 -1
- package/dist/mutators/readerActions.d.ts +9 -8
- package/dist/mutators/readerActions.js +2 -2
- package/dist/mutators/undoApply.d.ts +31 -27
- package/dist/mutators/undoApply.js +26 -24
- package/dist/policy/index.d.ts +5 -3
- package/dist/policy/index.js +5 -3
- package/dist/policy/types.d.ts +104 -100
- package/dist/policy/types.js +67 -66
- package/dist/query/client.d.ts +28 -23
- package/dist/query/client.js +45 -43
- package/dist/query/types.d.ts +37 -60
- package/dist/query/types.js +13 -33
- package/dist/react/AbloProvider.d.ts +1 -1
- package/dist/react/AbloProvider.js +2 -2
- package/dist/react/context.d.ts +25 -28
- package/dist/react/context.js +9 -10
- package/dist/react/index.d.ts +41 -42
- package/dist/react/index.js +37 -38
- package/dist/react/internalContext.d.ts +17 -19
- package/dist/react/useAblo.d.ts +23 -22
- package/dist/react/useAblo.js +16 -14
- package/dist/react/useCurrentUserId.d.ts +8 -7
- package/dist/react/useCurrentUserId.js +8 -7
- package/dist/react/useErrorListener.d.ts +7 -7
- package/dist/react/useErrorListener.js +10 -11
- package/dist/react/useMutationFailureListener.d.ts +8 -8
- package/dist/react/useMutationFailureListener.js +8 -8
- package/dist/react/useMutators.d.ts +11 -11
- package/dist/react/useMutators.js +3 -3
- package/dist/react/useReactive.js +2 -2
- package/dist/react/useSyncStatus.d.ts +4 -6
- package/dist/react/useUndoScope.d.ts +7 -9
- package/dist/react/useUndoScope.js +1 -1
- package/dist/schema/coordination.d.ts +21 -25
- package/dist/schema/coordination.js +21 -25
- package/dist/schema/ddl.d.ts +43 -39
- package/dist/schema/ddl.js +75 -68
- package/dist/schema/ddlLock.d.ts +20 -24
- package/dist/schema/ddlLock.js +18 -23
- package/dist/schema/diff.d.ts +99 -61
- package/dist/schema/diff.js +43 -34
- package/dist/schema/field.d.ts +37 -42
- package/dist/schema/field.js +35 -48
- package/dist/schema/generate.d.ts +12 -12
- package/dist/schema/generate.js +12 -12
- package/dist/schema/index.d.ts +2 -2
- package/dist/schema/index.js +21 -23
- package/dist/schema/model.d.ts +118 -143
- package/dist/schema/model.js +22 -33
- package/dist/schema/openapi.d.ts +10 -9
- package/dist/schema/openapi.js +5 -3
- package/dist/schema/queries.d.ts +29 -31
- package/dist/schema/queries.js +23 -25
- package/dist/schema/relation.d.ts +89 -99
- package/dist/schema/relation.js +13 -13
- package/dist/schema/residency.d.ts +16 -13
- package/dist/schema/residency.js +16 -13
- package/dist/schema/roles.d.ts +36 -43
- package/dist/schema/roles.js +31 -37
- package/dist/schema/schema.d.ts +33 -42
- package/dist/schema/schema.js +31 -32
- package/dist/schema/select.d.ts +13 -13
- package/dist/schema/select.js +13 -13
- package/dist/schema/serialize.d.ts +28 -31
- package/dist/schema/serialize.js +27 -31
- package/dist/schema/sugar.d.ts +17 -32
- package/dist/schema/sugar.js +14 -29
- package/dist/schema/{sync-delta-row.d.ts → syncDeltaRow.d.ts} +26 -49
- package/dist/schema/syncDeltaRow.js +89 -0
- package/dist/schema/tenancy.d.ts +44 -46
- package/dist/schema/tenancy.js +46 -48
- package/dist/server/adapter.d.ts +58 -58
- package/dist/server/adapter.js +13 -14
- package/dist/server/commit.d.ts +60 -64
- package/dist/server/index.d.ts +9 -10
- package/dist/server/index.js +1 -1
- package/dist/server/readConfig.d.ts +70 -0
- package/dist/server/readConfig.js +8 -0
- package/dist/server/storageMode.d.ts +23 -0
- package/dist/server/storageMode.js +17 -0
- package/dist/source/adapter.d.ts +30 -25
- package/dist/source/adapter.js +10 -10
- package/dist/source/adapters/drizzle.d.ts +28 -23
- package/dist/source/adapters/drizzle.js +30 -25
- package/dist/source/adapters/kysely.d.ts +27 -25
- package/dist/source/adapters/kysely.js +24 -23
- package/dist/source/adapters/memory.d.ts +8 -7
- package/dist/source/adapters/memory.js +9 -8
- package/dist/source/adapters/prisma.d.ts +13 -12
- package/dist/source/adapters/prisma.js +22 -25
- package/dist/source/conformance.d.ts +18 -11
- package/dist/source/conformance.js +17 -11
- package/dist/source/connector.d.ts +31 -32
- package/dist/source/connector.js +28 -28
- package/dist/source/connectorProtocol.d.ts +160 -0
- package/dist/source/connectorProtocol.js +162 -0
- package/dist/source/contract.d.ts +26 -27
- package/dist/source/contract.js +28 -29
- package/dist/source/factory.d.ts +46 -58
- package/dist/source/factory.js +22 -27
- package/dist/source/index.d.ts +7 -9
- package/dist/source/index.js +12 -14
- package/dist/source/migrations.d.ts +9 -9
- package/dist/source/migrations.js +9 -9
- package/dist/source/next.d.ts +9 -10
- package/dist/source/next.js +6 -7
- package/dist/source/pushQueue.d.ts +69 -47
- package/dist/source/pushQueue.js +32 -28
- package/dist/source/signing.d.ts +46 -17
- package/dist/source/signing.js +28 -11
- package/dist/source/types.d.ts +121 -104
- package/dist/source/types.js +13 -14
- package/dist/stores/ObjectStore.d.ts +10 -11
- package/dist/stores/ObjectStore.js +11 -12
- package/dist/stores/ObjectStoreContract.d.ts +12 -15
- package/dist/stores/SyncActionStore.d.ts +7 -11
- package/dist/stores/SyncActionStore.js +13 -17
- package/dist/surface.d.ts +27 -20
- package/dist/surface.js +27 -20
- package/dist/sync/{BootstrapHelper.d.ts → BootstrapFetcher.d.ts} +36 -42
- package/dist/sync/{BootstrapHelper.js → BootstrapFetcher.js} +76 -76
- package/dist/sync/ConnectionManager.d.ts +39 -50
- package/dist/sync/ConnectionManager.js +55 -66
- package/dist/sync/NetworkProbe.d.ts +24 -29
- package/dist/sync/NetworkProbe.js +63 -69
- package/dist/sync/{HydrationCoordinator.d.ts → OnDemandLoader.d.ts} +42 -41
- package/dist/sync/{HydrationCoordinator.js → OnDemandLoader.js} +59 -54
- package/dist/sync/{AreaOfInterestManager.d.ts → SubscriptionManager.d.ts} +43 -57
- package/dist/sync/{AreaOfInterestManager.js → SubscriptionManager.js} +43 -51
- package/dist/sync/SyncWebSocket.d.ts +139 -165
- package/dist/sync/SyncWebSocket.js +191 -223
- package/dist/sync/awaitClaimGrant.d.ts +18 -18
- package/dist/sync/awaitClaimGrant.js +11 -11
- package/dist/sync/bootstrapApply.d.ts +34 -24
- package/dist/sync/bootstrapApply.js +27 -19
- package/dist/sync/commitFrames.d.ts +21 -20
- package/dist/sync/commitFrames.js +18 -18
- package/dist/sync/createClaimStream.d.ts +23 -22
- package/dist/sync/createClaimStream.js +105 -23
- package/dist/sync/createPresenceStream.d.ts +19 -18
- package/dist/sync/createPresenceStream.js +25 -26
- package/dist/sync/createSnapshot.d.ts +12 -14
- package/dist/sync/createSnapshot.js +20 -26
- package/dist/sync/credentialLifecycle.d.ts +104 -104
- package/dist/sync/credentialLifecycle.js +140 -147
- package/dist/sync/deltaPipeline.d.ts +36 -34
- package/dist/sync/deltaPipeline.js +64 -65
- package/dist/sync/groupChange.d.ts +63 -61
- package/dist/sync/groupChange.js +74 -78
- package/dist/sync/heartbeat.d.ts +34 -33
- package/dist/sync/heartbeat.js +31 -31
- package/dist/sync/participants.d.ts +19 -19
- package/dist/sync/schemas.d.ts +3 -2
- package/dist/sync/schemas.js +14 -10
- package/dist/sync/syncCursor.d.ts +17 -21
- package/dist/sync/syncCursor.js +17 -21
- package/dist/sync/syncPlan.d.ts +28 -36
- package/dist/sync/syncPlan.js +18 -19
- package/dist/sync/syncPosition.d.ts +54 -49
- package/dist/sync/syncPosition.js +57 -52
- package/dist/sync/wsFrameHandlers.d.ts +35 -36
- package/dist/sync/wsFrameHandlers.js +63 -67
- package/dist/testing/fixtures/bootstrap.d.ts +12 -6
- package/dist/testing/fixtures/bootstrap.js +12 -6
- package/dist/testing/fixtures/deltas.d.ts +30 -33
- package/dist/testing/fixtures/deltas.js +30 -33
- package/dist/testing/fixtures/models.d.ts +11 -10
- package/dist/testing/fixtures/models.js +11 -10
- package/dist/testing/helpers/{react-wrapper.d.ts → reactWrapper.d.ts} +13 -10
- package/dist/testing/helpers/{react-wrapper.js → reactWrapper.js} +15 -12
- package/dist/testing/helpers/{sync-engine-harness.d.ts → syncEngineHarness.d.ts} +17 -15
- package/dist/testing/helpers/{sync-engine-harness.js → syncEngineHarness.js} +12 -10
- package/dist/testing/helpers/wait.d.ts +13 -8
- package/dist/testing/helpers/wait.js +13 -8
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +2 -2
- package/dist/testing/mocks/MockMutationExecutor.d.ts +18 -17
- package/dist/testing/mocks/MockMutationExecutor.js +15 -14
- package/dist/testing/mocks/MockNetworkMonitor.d.ts +8 -8
- package/dist/testing/mocks/MockNetworkMonitor.js +8 -8
- package/dist/testing/mocks/MockSyncContext.d.ts +20 -17
- package/dist/testing/mocks/MockSyncContext.js +15 -13
- package/dist/testing/mocks/MockSyncStore.d.ts +10 -10
- package/dist/testing/mocks/MockSyncStore.js +11 -11
- package/dist/testing/mocks/MockWebSocket.d.ts +26 -22
- package/dist/testing/mocks/MockWebSocket.js +22 -21
- package/dist/transactions/TransactionQueue.d.ts +181 -176
- package/dist/transactions/TransactionQueue.js +338 -350
- package/dist/transactions/TransactionStore.d.ts +6 -4
- package/dist/transactions/TransactionStore.js +6 -4
- package/dist/transactions/UnconfirmedWrites.d.ts +82 -0
- package/dist/transactions/UnconfirmedWrites.js +104 -0
- package/dist/transactions/coalesceRules.d.ts +41 -17
- package/dist/transactions/coalesceRules.js +40 -17
- package/dist/transactions/commitPayload.d.ts +48 -52
- package/dist/transactions/commitPayload.js +48 -57
- package/dist/transactions/deltaConfirmation.d.ts +20 -22
- package/dist/transactions/deltaConfirmation.js +37 -45
- package/dist/transactions/optimisticApply.d.ts +49 -0
- package/dist/transactions/optimisticApply.js +65 -0
- package/dist/transactions/{persistedReplay.d.ts → replayValidation.d.ts} +28 -22
- package/dist/transactions/{persistedReplay.js → replayValidation.js} +33 -27
- package/dist/types/global.d.ts +46 -41
- package/dist/types/global.js +20 -19
- package/dist/types/index.d.ts +71 -77
- package/dist/types/index.js +22 -22
- package/dist/types/modelData.d.ts +6 -8
- package/dist/types/modelData.js +5 -7
- package/dist/types/participant.d.ts +10 -11
- package/dist/types/participant.js +6 -8
- package/dist/types/streams.d.ts +208 -195
- package/dist/types/streams.js +7 -7
- package/dist/utils/asyncIterator.d.ts +25 -32
- package/dist/utils/asyncIterator.js +25 -32
- package/dist/utils/duration.d.ts +12 -15
- package/dist/utils/duration.js +12 -15
- package/dist/utils/mobxSetup.d.ts +53 -0
- package/dist/utils/{mobx-setup.js → mobxSetup.js} +42 -98
- package/dist/webhooks/events.d.ts +21 -16
- package/dist/webhooks/events.js +10 -8
- package/dist/webhooks/index.d.ts +5 -7
- package/dist/webhooks/index.js +5 -7
- package/dist/{schema/sync-delta-wire.d.ts → wire/delta.d.ts} +58 -41
- package/dist/wire/delta.js +114 -0
- package/dist/wire/errorEnvelope.d.ts +30 -31
- package/dist/wire/errorEnvelope.js +34 -40
- package/dist/wire/frames.d.ts +79 -86
- package/dist/wire/frames.js +26 -33
- package/dist/wire/index.d.ts +14 -12
- package/dist/wire/index.js +30 -26
- package/dist/wire/listEnvelope.d.ts +16 -23
- package/dist/wire/listEnvelope.js +7 -6
- package/dist/wire/protocol.d.ts +25 -32
- package/dist/wire/protocol.js +25 -32
- package/dist/wire/protocolVersion.d.ts +44 -40
- package/dist/wire/protocolVersion.js +44 -40
- package/docs/coordination.md +59 -0
- package/package.json +11 -10
- package/dist/ai-sdk/coordinated-tool.d.ts +0 -101
- package/dist/ai-sdk/coordination-context.d.ts +0 -52
- package/dist/core/query-utils.d.ts +0 -34
- package/dist/core/query-utils.js +0 -59
- package/dist/schema/sync-delta-row.js +0 -103
- package/dist/schema/sync-delta-wire.js +0 -102
- package/dist/server/read-config.d.ts +0 -67
- package/dist/server/read-config.js +0 -8
- package/dist/server/storage-mode.d.ts +0 -8
- package/dist/server/storage-mode.js +0 -28
- package/dist/source/connector-protocol.d.ts +0 -159
- package/dist/source/connector-protocol.js +0 -161
- package/dist/transactions/OptimisticEchoTracker.d.ts +0 -82
- package/dist/transactions/OptimisticEchoTracker.js +0 -104
- package/dist/transactions/mutation-error-handler.d.ts +0 -5
- package/dist/transactions/mutation-error-handler.js +0 -39
- package/dist/transactions/optimistic.d.ts +0 -24
- package/dist/transactions/optimistic.js +0 -45
- package/dist/utils/mobx-setup.d.ts +0 -42
package/dist/cli.cjs
CHANGED
|
@@ -215687,9 +215687,9 @@ var require_braces = __commonJS({
|
|
|
215687
215687
|
}
|
|
215688
215688
|
});
|
|
215689
215689
|
|
|
215690
|
-
// node_modules/picomatch/lib/constants.js
|
|
215690
|
+
// node_modules/micromatch/node_modules/picomatch/lib/constants.js
|
|
215691
215691
|
var require_constants2 = __commonJS({
|
|
215692
|
-
"node_modules/picomatch/lib/constants.js"(exports2, module2) {
|
|
215692
|
+
"node_modules/micromatch/node_modules/picomatch/lib/constants.js"(exports2, module2) {
|
|
215693
215693
|
"use strict";
|
|
215694
215694
|
init_cjs_shims();
|
|
215695
215695
|
var path = require("path");
|
|
@@ -215889,9 +215889,9 @@ var require_constants2 = __commonJS({
|
|
|
215889
215889
|
}
|
|
215890
215890
|
});
|
|
215891
215891
|
|
|
215892
|
-
// node_modules/picomatch/lib/utils.js
|
|
215892
|
+
// node_modules/micromatch/node_modules/picomatch/lib/utils.js
|
|
215893
215893
|
var require_utils2 = __commonJS({
|
|
215894
|
-
"node_modules/picomatch/lib/utils.js"(exports2) {
|
|
215894
|
+
"node_modules/micromatch/node_modules/picomatch/lib/utils.js"(exports2) {
|
|
215895
215895
|
"use strict";
|
|
215896
215896
|
init_cjs_shims();
|
|
215897
215897
|
var path = require("path");
|
|
@@ -215951,9 +215951,9 @@ var require_utils2 = __commonJS({
|
|
|
215951
215951
|
}
|
|
215952
215952
|
});
|
|
215953
215953
|
|
|
215954
|
-
// node_modules/picomatch/lib/scan.js
|
|
215954
|
+
// node_modules/micromatch/node_modules/picomatch/lib/scan.js
|
|
215955
215955
|
var require_scan = __commonJS({
|
|
215956
|
-
"node_modules/picomatch/lib/scan.js"(exports2, module2) {
|
|
215956
|
+
"node_modules/micromatch/node_modules/picomatch/lib/scan.js"(exports2, module2) {
|
|
215957
215957
|
"use strict";
|
|
215958
215958
|
init_cjs_shims();
|
|
215959
215959
|
var utils = require_utils2();
|
|
@@ -216282,9 +216282,9 @@ var require_scan = __commonJS({
|
|
|
216282
216282
|
}
|
|
216283
216283
|
});
|
|
216284
216284
|
|
|
216285
|
-
// node_modules/picomatch/lib/parse.js
|
|
216285
|
+
// node_modules/micromatch/node_modules/picomatch/lib/parse.js
|
|
216286
216286
|
var require_parse2 = __commonJS({
|
|
216287
|
-
"node_modules/picomatch/lib/parse.js"(exports2, module2) {
|
|
216287
|
+
"node_modules/micromatch/node_modules/picomatch/lib/parse.js"(exports2, module2) {
|
|
216288
216288
|
"use strict";
|
|
216289
216289
|
init_cjs_shims();
|
|
216290
216290
|
var constants = require_constants2();
|
|
@@ -217285,9 +217285,9 @@ var require_parse2 = __commonJS({
|
|
|
217285
217285
|
}
|
|
217286
217286
|
});
|
|
217287
217287
|
|
|
217288
|
-
// node_modules/picomatch/lib/picomatch.js
|
|
217288
|
+
// node_modules/micromatch/node_modules/picomatch/lib/picomatch.js
|
|
217289
217289
|
var require_picomatch = __commonJS({
|
|
217290
|
-
"node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
|
|
217290
|
+
"node_modules/micromatch/node_modules/picomatch/lib/picomatch.js"(exports2, module2) {
|
|
217291
217291
|
"use strict";
|
|
217292
217292
|
init_cjs_shims();
|
|
217293
217293
|
var path = require("path");
|
|
@@ -217427,9 +217427,9 @@ var require_picomatch = __commonJS({
|
|
|
217427
217427
|
}
|
|
217428
217428
|
});
|
|
217429
217429
|
|
|
217430
|
-
// node_modules/picomatch/index.js
|
|
217430
|
+
// node_modules/micromatch/node_modules/picomatch/index.js
|
|
217431
217431
|
var require_picomatch2 = __commonJS({
|
|
217432
|
-
"node_modules/picomatch/index.js"(exports2, module2) {
|
|
217432
|
+
"node_modules/micromatch/node_modules/picomatch/index.js"(exports2, module2) {
|
|
217433
217433
|
"use strict";
|
|
217434
217434
|
init_cjs_shims();
|
|
217435
217435
|
module2.exports = require_picomatch();
|
|
@@ -276772,12 +276772,12 @@ var ERROR_CODES = {
|
|
|
276772
276772
|
// ── auth (401) ─────────────────────────────────────────────────────
|
|
276773
276773
|
apikey_invalid: wire("auth", 401, false, "This API key isn't one Ablo recognizes \u2014 it may be mistyped, truncated, or belong to a different environment. Check the key and try again."),
|
|
276774
276774
|
apikey_revoked: wire("auth", 401, false, "This API key has been revoked and can no longer be used. Mint a new key from the dashboard."),
|
|
276775
|
-
//
|
|
276776
|
-
//
|
|
276777
|
-
//
|
|
276778
|
-
//
|
|
276779
|
-
//
|
|
276780
|
-
//
|
|
276775
|
+
// The short-lived access credential — the ephemeral key (`ek_` for users,
|
|
276776
|
+
// `rk_` for agents) minted from the login and presented as a bearer token.
|
|
276777
|
+
// Its expiry is routine and re-mintable: get a fresh key from the still-valid
|
|
276778
|
+
// session and retry, rather than signing out. An agent's expired `rk_` must
|
|
276779
|
+
// not sign a human out either. This is the one code on the silent re-mint
|
|
276780
|
+
// path; see the `access_credential_expiry` recovery class.
|
|
276781
276781
|
apikey_expired: wire("auth", 401, false, "This ephemeral API key has expired. Mint a fresh key from your still-valid session and retry the request.", "access_credential_expiry"),
|
|
276782
276782
|
apikey_missing: wire("auth", 401, false, "The request arrived without an API key. Send one as `Authorization: Bearer <key>`."),
|
|
276783
276783
|
api_key_required: wire("auth", 401, false, "This operation requires an API key, and none was presented. Send one as `Authorization: Bearer <key>`."),
|
|
@@ -276786,12 +276786,13 @@ var ERROR_CODES = {
|
|
|
276786
276786
|
identity_resolve_failed: wire("auth", 401, false, "The server could not resolve an identity for this credential \u2014 the identity lookup was rejected. Check that the credential is still valid."),
|
|
276787
276787
|
auth_no_credentials: wire("auth", 401, false, "No recognized authentication credential was presented \u2014 no API key and no bearer JWT. Send `Authorization: Bearer <token>`."),
|
|
276788
276788
|
identity_missing_organization: wire("auth", 401, false, "Authentication succeeded, but the credential resolves to no organization, so requests cannot be scoped. Check that the key or token carries an organization."),
|
|
276789
|
-
// The long-lived login is gone
|
|
276789
|
+
// The long-lived login is gone; this is terminal and drives sign-out and
|
|
276790
|
+
// re-authentication.
|
|
276790
276791
|
session_expired: wire("auth", 401, false, "Your session has expired or is no longer valid. Sign in again to continue.", "session_expiry"),
|
|
276791
|
-
// `jwt_invalid` is the
|
|
276792
|
-
//
|
|
276793
|
-
//
|
|
276794
|
-
//
|
|
276792
|
+
// `jwt_invalid` is the general fallback; the codes below it split out specific
|
|
276793
|
+
// failure modes, so an integrator can tell a wrong JWKS registration from a
|
|
276794
|
+
// token with no organization claim from a wrong audience, instead of getting
|
|
276795
|
+
// one opaque code for all of them.
|
|
276795
276796
|
jwt_invalid: wire("auth", 401, false, "The bearer JWT failed validation for a reason the server could not classify further. Check the token's issuer, signature, audience, and expiry."),
|
|
276796
276797
|
jwt_malformed: wire("auth", 401, false, "The bearer token is not a well-formed JWT and could not be decoded. Check that the full, unmodified token was sent."),
|
|
276797
276798
|
jwt_missing_issuer: wire("auth", 401, false, "The bearer JWT has no `iss` (issuer) claim, so it cannot be routed to a trusted issuer."),
|
|
@@ -276800,11 +276801,10 @@ var ERROR_CODES = {
|
|
|
276800
276801
|
jwt_audience_mismatch: wire("auth", 401, false, "The bearer JWT's `aud` (audience) claim does not match the audience this issuer is registered with."),
|
|
276801
276802
|
jwt_missing_subject: wire("auth", 401, false, "The bearer JWT has no `sub` (subject) claim to identify the user."),
|
|
276802
276803
|
jwt_missing_organization: wire("auth", 401, false, "The bearer JWT carries no organization context \u2014 neither a fixed org for the issuer nor the configured organization claim."),
|
|
276803
|
-
//
|
|
276804
|
-
//
|
|
276805
|
-
//
|
|
276806
|
-
//
|
|
276807
|
-
// (which also keeps `isSessionErrorResponse` behaviour unchanged).
|
|
276804
|
+
// Applies only to the trusted-issuer path, where a customer authenticates with
|
|
276805
|
+
// a JWT from their own identity provider. When such a token expires, the
|
|
276806
|
+
// remedy is to re-authenticate against that provider, so it classifies as a
|
|
276807
|
+
// session expiry.
|
|
276808
276808
|
jwt_expired: wire("auth", 401, false, "The bearer JWT has expired. Obtain a fresh token from your identity provider and retry.", "session_expiry"),
|
|
276809
276809
|
jwt_org_membership_denied: wire("auth", 403, false, "The bearer JWT's subject is not an active member of the organization in its `org_id` claim (removed, suspended, or the claim does not match a membership)."),
|
|
276810
276810
|
file_upload_auth_required: wire("auth", 401, false, "File uploads require an authenticated session. Sign in and retry."),
|
|
@@ -276823,22 +276823,18 @@ var ERROR_CODES = {
|
|
|
276823
276823
|
database_role_unreadable: wire("permission", 403, false, "Ablo could not introspect the database role it connects with, so it cannot verify that row-level security is enforced."),
|
|
276824
276824
|
database_tables_unforced_rls: wire("permission", 403, false, "Some synced tables do not have `FORCE ROW LEVEL SECURITY` applied, so the table owner can bypass row isolation. Run `ALTER TABLE ... FORCE ROW LEVEL SECURITY` on each synced table."),
|
|
276825
276825
|
database_host_not_allowed: wire("permission", 403, false, "The database host resolves to a private, loopback, or link-local address, which Ablo's servers will not connect to. Use a publicly resolvable host."),
|
|
276826
|
-
//
|
|
276827
|
-
//
|
|
276826
|
+
// Older spellings of the `database_*` codes above, still sent by some servers
|
|
276827
|
+
// and kept so they classify identically. Prefer the `database_*` codes.
|
|
276828
276828
|
byo_role_cannot_enforce_rls: wire("permission", 403, false, "The direct Postgres connector role cannot enforce row-level security."),
|
|
276829
276829
|
byo_role_unreadable: wire("permission", 403, false, "The direct Postgres connector role could not be introspected."),
|
|
276830
276830
|
byo_tenant_tables_unforced_rls: wire("permission", 403, false, "Tenant tables do not have RLS forced under the direct Postgres connector role."),
|
|
276831
276831
|
byo_host_not_allowed: wire("permission", 403, false, "The direct Postgres connector host resolves to a private, loopback, or link-local address and cannot be used."),
|
|
276832
276832
|
// ── claim / claim conflict (409) ──────────────────────────────────
|
|
276833
|
-
//
|
|
276834
|
-
//
|
|
276835
|
-
//
|
|
276836
|
-
//
|
|
276837
|
-
//
|
|
276838
|
-
// lives at the CALLER: take a claim (`ablo.<model>.claim` queues fairly
|
|
276839
|
-
// behind the holder) or re-read and rebase. `retryable: true` here turned
|
|
276840
|
-
// every cross-client claim conflict into an infinite client resend loop
|
|
276841
|
-
// (~150ms storm — found by the claims journey, 2026-06-10).
|
|
276833
|
+
// A rejection because another participant holds a claim is not retryable.
|
|
276834
|
+
// Re-sending the same write cannot succeed while the claim is held, and a
|
|
276835
|
+
// claim can outlive any reasonable retry budget, so an automatic retry would
|
|
276836
|
+
// only loop. Recovery belongs to the caller: take a claim, which queues fairly
|
|
276837
|
+
// behind the holder (`ablo.<model>.claim`), or re-read and rebase.
|
|
276842
276838
|
claim_conflict: wire("claim", 409, false, "Another participant holds a claim on this row, so the write was rejected. Take a claim with `ablo.<model>.claim` to queue fairly behind the holder, or re-read and rebase."),
|
|
276843
276839
|
claim_lost: wire("claim", 409, false, "The claim held on this row was lost before the write could apply. Re-acquire the claim and retry."),
|
|
276844
276840
|
entity_claimed: wire("claim", 409, false, "This row is currently claimed by another participant, so the write was blocked. Queue behind the holder with `ablo.<model>.claim`, or wait for the claim to clear."),
|
|
@@ -276851,9 +276847,9 @@ var ERROR_CODES = {
|
|
|
276851
276847
|
// ── stale context / idempotency (409) ──────────────────────────────
|
|
276852
276848
|
stale_context: wire("conflict", 409, true, "The row changed after you read it \u2014 the write's `readAt` watermark is older than the current row version. Re-read the row and retry."),
|
|
276853
276849
|
// Raised by the functional `update(id, current => next)` form once its
|
|
276854
|
-
// internal reconcile budget is exhausted
|
|
276855
|
-
// contended.
|
|
276856
|
-
//
|
|
276850
|
+
// internal reconcile budget is exhausted, because the row stayed continuously
|
|
276851
|
+
// contended. The SDK has already retried; the caller decides whether to back
|
|
276852
|
+
// off, raise `retries`, or move the row to the WebSocket transport.
|
|
276857
276853
|
contention_exhausted: client("conflict", "A functional update kept losing to concurrent writes and exhausted its reconcile budget. Back off and retry, raise `retries`, or move the row to the WebSocket transport."),
|
|
276858
276854
|
update_aborted: client("conflict", "The functional update was aborted via its `AbortSignal` before the write landed; nothing was written."),
|
|
276859
276855
|
idempotency_conflict: wire("conflict", 409, false, "This `Idempotency-Key` was already used with a different request body. Reuse a key only to retry an identical request; otherwise generate a new one."),
|
|
@@ -276862,21 +276858,20 @@ var ERROR_CODES = {
|
|
|
276862
276858
|
write_options_invalid: client("validation", "The write options (`idempotencyKey` / `label` / `wait` / `readAt` / `onStale` / `claim`) failed validation against the write-options schema."),
|
|
276863
276859
|
source_operation_id_required: client("validation", "A data-source operation arrived without the entity `id` it targets."),
|
|
276864
276860
|
source_adapter_misconfigured: client("validation", "The data-source ORM adapter could not map a schema model onto the backing client \u2014 the client exposes no matching delegate or model. Check that the adapter and schema agree on model names."),
|
|
276865
|
-
//
|
|
276866
|
-
//
|
|
276867
|
-
//
|
|
276868
|
-
//
|
|
276869
|
-
// `sourceEventForOperation` when an outbox event cannot be built.
|
|
276861
|
+
// The server validates every incoming data-source event before appending it
|
|
276862
|
+
// to the log and rejects the whole batch with this code; `param` names the
|
|
276863
|
+
// offending index and field path, such as `events[3].entityId`. It is also
|
|
276864
|
+
// raised on the client when an outbound source event cannot be built.
|
|
276870
276865
|
source_event_invalid: wire("validation", 400, false, "A data-source event was malformed \u2014 missing or invalid id, model, entityId, type, or field value. The whole event batch was rejected and nothing was ingested; fix the offending outbox row and re-send."),
|
|
276871
276866
|
duration_invalid: client("validation", 'A duration value was not a number of seconds or a "500ms" | "30s" | "3m" | "24h" string.'),
|
|
276872
276867
|
schema_definition_invalid: client("validation", "A schema definition value was invalid (bad column identifier, non-finite backfill, or unsupported schema-JSON version)."),
|
|
276873
276868
|
cli_invalid_arguments: client("validation", "The CLI was invoked with an unknown flag or a malformed flag value."),
|
|
276874
276869
|
turn_validation_failed: wire("validation", 422, false, "The agent turn payload failed server-side validation and was not applied."),
|
|
276875
276870
|
commit_operation_required: wire("validation", 400, false, "A commit must carry `operation` or `operations`."),
|
|
276876
|
-
//
|
|
276877
|
-
// `/v1/commits`
|
|
276878
|
-
//
|
|
276879
|
-
//
|
|
276871
|
+
// Both commit transports — the WebSocket `commit` frame and the HTTP
|
|
276872
|
+
// `/v1/commits` endpoint — validate every operation and reject the whole batch
|
|
276873
|
+
// with this code. `param` names the offending index and field path, such as
|
|
276874
|
+
// `operations[3].readAt`.
|
|
276880
276875
|
commit_operation_invalid: wire("validation", 400, false, "A commit operation failed validation against the wire commit-operation schema \u2014 wrong field type (e.g. a string `readAt`), unknown `type`, or missing `model`. The whole batch was rejected; the error names the offending operation index and field path."),
|
|
276881
276876
|
commit_operation_model_required: wire("validation", 400, false, "A commit operation is missing its `model`."),
|
|
276882
276877
|
commit_operations_ambiguous: wire("validation", 400, false, "A commit supplied both `operation` and `operations`. Send one or the other, not both."),
|
|
@@ -276893,13 +276888,12 @@ var ERROR_CODES = {
|
|
|
276893
276888
|
model_not_found: wire("not_found", 404, false, "No row of this model exists with the requested id. It may have been deleted, or the id may belong to a different environment."),
|
|
276894
276889
|
mutate_update_entity_not_found: wire("not_found", 404, false, "The row targeted by this update does not exist \u2014 it may have been deleted since you read it. Re-read before retrying."),
|
|
276895
276890
|
task_id_missing: wire("server", 502, true, "The task-create response arrived without a task id, so the result cannot be used. Retry the request."),
|
|
276896
|
-
// ── data integrity /
|
|
276897
|
-
// Emitted when a
|
|
276898
|
-
//
|
|
276899
|
-
//
|
|
276900
|
-
//
|
|
276901
|
-
//
|
|
276902
|
-
// the driver's message text onto the wire.
|
|
276891
|
+
// ── data integrity / database constraints ──────────────────────────
|
|
276892
|
+
// Emitted when a database integrity constraint rejects a write. None are
|
|
276893
|
+
// retryable: the same payload re-sent unchanged fails identically, so the
|
|
276894
|
+
// client must roll back rather than retry. The server maps the underlying SQL
|
|
276895
|
+
// constraint to one of these codes and places the raw constraint, column, and
|
|
276896
|
+
// table detail in `details` instead of exposing the driver's message text.
|
|
276903
276897
|
not_null_violation: wire("validation", 400, false, "The database rejected the write because a required column was left empty \u2014 a not-null constraint. The error details name the column; supply a value and retry."),
|
|
276904
276898
|
foreign_key_violation: wire("conflict", 409, false, "The database rejected the write on a foreign-key constraint: a referenced row does not exist, or the row being deleted is still referenced by others. The error details name the constraint."),
|
|
276905
276899
|
unique_violation: wire("conflict", 409, false, "The write duplicates a value that must be unique \u2014 another row already holds it. Choose a different value, or update the existing row."),
|
|
@@ -276963,17 +276957,18 @@ var ERROR_CODES = {
|
|
|
276963
276957
|
// ── quota / rate limit (429) ──────────────────────────────────────
|
|
276964
276958
|
quota_exceeded: wire("rate_limit", 429, true, "Your organization has used up its configured usage quota. Requests will succeed again once the quota resets or the limit is raised."),
|
|
276965
276959
|
connection_limit_exceeded: wire("rate_limit", 429, true, "Too many concurrent WebSocket connections for this principal or organization. Close idle connections, or retry once others drain."),
|
|
276966
|
-
//
|
|
276967
|
-
//
|
|
276968
|
-
// so one noisy key backs off without affecting
|
|
276969
|
-
// `Retry-After` header carries the
|
|
276960
|
+
// A per-key request-rate limit — the fast, requests-per-second axis, as
|
|
276961
|
+
// opposed to `quota_exceeded`, which is the slower organization-wide usage
|
|
276962
|
+
// limit. It is keyed per API key, so one noisy key backs off without affecting
|
|
276963
|
+
// the rest of the organization. The `Retry-After` header carries the delay
|
|
276964
|
+
// before the next request is allowed.
|
|
276970
276965
|
rate_limit_exceeded: wire("rate_limit", 429, true, "This API key is sending requests faster than its rate limit allows. Slow down and retry after the delay in the `Retry-After` header."),
|
|
276971
276966
|
// ── server (5xx) ───────────────────────────────────────────────────
|
|
276972
276967
|
internal_error: wire("server", 500, true, "Something went wrong on Ablo's side \u2014 an unexpected server error. It is safe to retry."),
|
|
276973
276968
|
quota_lookup_failed: wire("server", 503, true, "The server could not load this organization's quota state, so the request was rejected rather than admitted unchecked. Retry shortly."),
|
|
276974
|
-
// The
|
|
276975
|
-
//
|
|
276976
|
-
//
|
|
276969
|
+
// The rate-limiter backend was unreachable and this endpoint is configured to
|
|
276970
|
+
// fail closed, so the request was rejected rather than admitted unchecked. It
|
|
276971
|
+
// is retryable: the next attempt re-probes the backend.
|
|
276977
276972
|
rate_limiter_unavailable: wire("server", 503, true, "The rate-limiter backend is unavailable and this endpoint is configured to fail closed; retry shortly."),
|
|
276978
276973
|
turn_open_failed: wire("server", 500, true, "The agent turn could not be opened on the server. It is safe to retry."),
|
|
276979
276974
|
turn_close_failed: wire("server", 500, true, "The agent turn could not be closed cleanly on the server. It is safe to retry the close."),
|
|
@@ -277016,7 +277011,7 @@ var ERROR_CODES = {
|
|
|
277016
277011
|
undo_entry_invalid: client("client", "An undo entry failed inverse-op schema validation."),
|
|
277017
277012
|
mock_mutation_failed: client("client", "A mock mutation adapter was configured to fail."),
|
|
277018
277013
|
mock_unsupported_operation: client("client", "A mock adapter received an unsupported operation."),
|
|
277019
|
-
// ── HTTP route edge codes
|
|
277014
|
+
// ── HTTP route edge codes ──────────────────────────────────────────
|
|
277020
277015
|
invalid_body: wire("validation", 400, false, "The request body was missing, unparseable, or the wrong shape."),
|
|
277021
277016
|
invalid_json: wire("validation", 400, false, "The request body was not valid JSON."),
|
|
277022
277017
|
capability_id_required: wire("validation", 400, false, "A capability id is required for this request."),
|
|
@@ -277051,6 +277046,7 @@ var ERROR_CODES = {
|
|
|
277051
277046
|
protocol_version_unsupported: wire("transport", 426, false, "The client sync-protocol version is outside the range this server supports \u2014 upgrade the SDK (or the server was rolled back mid-fleet)."),
|
|
277052
277047
|
database_unreachable: wire("validation", 400, false, "Ablo could not reach this database to check that it can stream replication. The connection string may be wrong, the host may not be reachable from Ablo's servers, or the credentials may not be accepted."),
|
|
277053
277048
|
database_not_replication_ready: wire("validation", 400, false, "This database is not set up for logical replication yet. Every failing item \u2014 wal_level, the publication, the replication grant, a replica identity \u2014 is listed in the error details with its exact fix. `ablo connect` prints the one-time setup; `ablo connect --check` verifies it."),
|
|
277049
|
+
replication_publication_drift: wire("validation", 400, false, "Your schema maps to tables that are not members of the replication publication, so their changes silently never stream and the source looks frozen. The missing tables and the exact `ALTER PUBLICATION \u2026 ADD TABLE \u2026` to add them are in the error details \u2014 Ablo never alters your database for you."),
|
|
277054
277050
|
query_unknown_relation: wire("validation", 400, false, "The query references a relation the model does not define. Check the relation name against the schema."),
|
|
277055
277051
|
query_relation_target_unknown: wire("schema", 500, false, "A relation in the query targets a model the schema does not define."),
|
|
277056
277052
|
query_invalid_identifier: wire("validation", 400, false, "The query contained an invalid identifier."),
|
|
@@ -277159,7 +277155,7 @@ var writeGuardSchema = import_zod3.z.object({
|
|
|
277159
277155
|
bypass: import_zod3.z.boolean().optional()
|
|
277160
277156
|
});
|
|
277161
277157
|
var staleNotificationSchema = import_zod3.z.object({
|
|
277162
|
-
/**
|
|
277158
|
+
/** Names this object's type; every returned object carries such a tag. */
|
|
277163
277159
|
object: import_zod3.z.literal("stale_notification").optional(),
|
|
277164
277160
|
/** Model name of the conflicting row. */
|
|
277165
277161
|
model: import_zod3.z.string(),
|
|
@@ -277179,8 +277175,8 @@ var staleNotificationSchema = import_zod3.z.object({
|
|
|
277179
277175
|
*/
|
|
277180
277176
|
conflictingFields: import_zod3.z.array(import_zod3.z.string()),
|
|
277181
277177
|
/**
|
|
277182
|
-
*
|
|
277183
|
-
* error
|
|
277178
|
+
* The live values of `conflictingFields` after the conflict — the piece a
|
|
277179
|
+
* plain stale error omits. It lets the actor reconcile without a follow-up read.
|
|
277184
277180
|
*/
|
|
277185
277181
|
currentValues: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.unknown()),
|
|
277186
277182
|
/** Who wrote the conflicting delta. */
|
|
@@ -277289,10 +277285,10 @@ var claimBeginPayloadSchema = targetRefSchema.extend({
|
|
|
277289
277285
|
/** Hint for `expiresAt`; the server caps it. */
|
|
277290
277286
|
estimatedMs: import_zod3.z.number().optional(),
|
|
277291
277287
|
/**
|
|
277292
|
-
* Opt into the fair wait queue
|
|
277293
|
-
* enqueues this claim
|
|
277294
|
-
* `claim_granted
|
|
277295
|
-
* handle the grant.
|
|
277288
|
+
* Opt into the fair wait queue. When the target is already held, the server
|
|
277289
|
+
* enqueues this claim in FIFO order and replies `claim_queued`, then
|
|
277290
|
+
* `claim_granted` later, instead of `claim_rejected`. A client that sets this
|
|
277291
|
+
* must be ready to handle the grant.
|
|
277296
277292
|
*/
|
|
277297
277293
|
queue: import_zod3.z.boolean().optional()
|
|
277298
277294
|
});
|
|
@@ -277306,6 +277302,48 @@ var claimReorderPayloadSchema = import_zod3.z.object({
|
|
|
277306
277302
|
entityId: import_zod3.z.string(),
|
|
277307
277303
|
order: import_zod3.z.array(import_zod3.z.object({ heldBy: import_zod3.z.string(), claimId: import_zod3.z.string() }))
|
|
277308
277304
|
});
|
|
277305
|
+
var claimHeartbeatFieldsSchema = import_zod3.z.object({
|
|
277306
|
+
claimId: import_zod3.z.string().optional(),
|
|
277307
|
+
entityType: import_zod3.z.string().optional(),
|
|
277308
|
+
entityId: import_zod3.z.string().optional(),
|
|
277309
|
+
/** Requested extension from now; the server clamps it, and an extension
|
|
277310
|
+
* never shortens a lease. */
|
|
277311
|
+
ttlMs: import_zod3.z.number().positive().optional(),
|
|
277312
|
+
/**
|
|
277313
|
+
* Lightweight progress the beat carries along ("42/100 pages") — stored
|
|
277314
|
+
* as the claim's `meta.progress` (last beat wins) and peer-visible via
|
|
277315
|
+
* `claim.state` while the lease is held. This is presence, not a
|
|
277316
|
+
* checkpoint: it dies with the lease. Crash-recoverable progress belongs
|
|
277317
|
+
* in the data itself — write a row, and every subscriber already sees it.
|
|
277318
|
+
*/
|
|
277319
|
+
details: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.unknown()).optional()
|
|
277320
|
+
});
|
|
277321
|
+
var claimHeartbeatPayloadSchema = claimHeartbeatFieldsSchema.refine(
|
|
277322
|
+
(payload) => payload.claimId !== void 0 || payload.entityType !== void 0 && payload.entityId !== void 0,
|
|
277323
|
+
{
|
|
277324
|
+
message: "a heartbeat must identify its claim \u2014 pass claimId, or entityType and entityId together"
|
|
277325
|
+
}
|
|
277326
|
+
);
|
|
277327
|
+
var claimHeartbeatAckPayloadSchema = import_zod3.z.object({
|
|
277328
|
+
claimId: import_zod3.z.string(),
|
|
277329
|
+
status: import_zod3.z.enum(["held", "queued", "lost"]),
|
|
277330
|
+
expiresAt: import_zod3.z.number().optional(),
|
|
277331
|
+
position: import_zod3.z.number().optional(),
|
|
277332
|
+
/**
|
|
277333
|
+
* How many participants are waiting in line behind a held lease — the
|
|
277334
|
+
* cooperative-yield pressure signal (present on `held`). A worker that can
|
|
277335
|
+
* checkpoint may choose to release early when others wait. Hard
|
|
277336
|
+
* cancellation needs no extra field: a preempted, expired, or revoked
|
|
277337
|
+
* lease answers the next beat with `lost`.
|
|
277338
|
+
*/
|
|
277339
|
+
queueDepth: import_zod3.z.number().optional()
|
|
277340
|
+
});
|
|
277341
|
+
var claimHeartbeatBatchPayloadSchema = claimHeartbeatFieldsSchema.pick(
|
|
277342
|
+
{ ttlMs: true }
|
|
277343
|
+
);
|
|
277344
|
+
var claimHeartbeatBatchAckPayloadSchema = import_zod3.z.object({
|
|
277345
|
+
results: import_zod3.z.array(claimHeartbeatAckPayloadSchema)
|
|
277346
|
+
});
|
|
277309
277347
|
var updateSubscriptionPayloadSchema = import_zod3.z.object({
|
|
277310
277348
|
syncGroups: import_zod3.z.array(syncGroupInputSchema)
|
|
277311
277349
|
});
|
|
@@ -277355,35 +277393,34 @@ var presenceUpdateFrameSchema = import_zod3.z.object({
|
|
|
277355
277393
|
|
|
277356
277394
|
// src/errors.ts
|
|
277357
277395
|
var AbloError = class extends Error {
|
|
277358
|
-
/**
|
|
277359
|
-
*
|
|
277360
|
-
*
|
|
277396
|
+
/** A discriminator string equal to the class name. Switch on `error.type` to
|
|
277397
|
+
* distinguish error kinds when `instanceof` is unreliable, such as after an
|
|
277398
|
+
* error has crossed a serialization boundary. */
|
|
277361
277399
|
type = "AbloError";
|
|
277362
|
-
/**
|
|
277363
|
-
* {@link ErrorCode} registry —
|
|
277364
|
-
* `'capability_scope_denied'
|
|
277365
|
-
*
|
|
277366
|
-
*
|
|
277367
|
-
*
|
|
277400
|
+
/** A stable, machine-readable identifier for the error, drawn from the
|
|
277401
|
+
* {@link ErrorCode} registry — for example `'apikey_invalid'` or
|
|
277402
|
+
* `'capability_scope_denied'` — suitable for logs, metrics, and `switch`
|
|
277403
|
+
* handling. It is typed as a plain `string` rather than {@link ErrorCode} so
|
|
277404
|
+
* this client can still surface a code from a newer server that it does not
|
|
277405
|
+
* yet recognize; code producers are constrained at the constructor instead. */
|
|
277368
277406
|
code;
|
|
277369
|
-
/** HTTP status code when the error originated from an HTTP response. */
|
|
277407
|
+
/** HTTP status code, when the error originated from an HTTP response. */
|
|
277370
277408
|
httpStatus;
|
|
277371
|
-
/**
|
|
277372
|
-
* `x-request-id
|
|
277409
|
+
/** A correlation id for tracing a request through the server, present when the
|
|
277410
|
+
* server returned one on the `x-request-id` header. Include it in support
|
|
277411
|
+
* requests. */
|
|
277373
277412
|
requestId;
|
|
277374
|
-
/**
|
|
277375
|
-
* `'dataroomMember.grants.subject'
|
|
277376
|
-
*
|
|
277413
|
+
/** The specific input that caused the error, as a model or field path such as
|
|
277414
|
+
* `'dataroomMember.grants.subject'`, so tooling can point at the exact
|
|
277415
|
+
* offending value. */
|
|
277377
277416
|
param;
|
|
277378
|
-
/**
|
|
277379
|
-
*
|
|
277417
|
+
/** A link to the documentation for this error's {@link code}. When not set
|
|
277418
|
+
* explicitly, it is derived from the code by {@link docUrlForCode}. */
|
|
277380
277419
|
docUrl;
|
|
277381
|
-
/**
|
|
277382
|
-
*
|
|
277383
|
-
* conflicting rows.
|
|
277384
|
-
*
|
|
277385
|
-
* structured error keeps its detail through `toJSON` instead of being
|
|
277386
|
-
* flattened to a bare message. */
|
|
277420
|
+
/** Extra structured data specific to this error, merged into the serialized
|
|
277421
|
+
* envelope — for example a schema push's `{ warnings, unexecutable }`, or the
|
|
277422
|
+
* conflicting rows of a stale write. This detail is preserved through
|
|
277423
|
+
* {@link toJSON} rather than flattened into the message. */
|
|
277387
277424
|
details;
|
|
277388
277425
|
constructor(message, options) {
|
|
277389
277426
|
super(message);
|
|
@@ -277400,9 +277437,10 @@ var AbloError = class extends Error {
|
|
|
277400
277437
|
}
|
|
277401
277438
|
}
|
|
277402
277439
|
/**
|
|
277403
|
-
*
|
|
277404
|
-
* doc_url, request_id }
|
|
277405
|
-
*
|
|
277440
|
+
* Serializes the error to its wire shape: `{ type, code, param, message,
|
|
277441
|
+
* doc_url, request_id }`, with any {@link details} merged in. This is the same
|
|
277442
|
+
* JSON shape the SDK uses across HTTP bodies, WebSocket frames, and logs, so a
|
|
277443
|
+
* consumer parses every Ablo error the same way.
|
|
277406
277444
|
*/
|
|
277407
277445
|
toJSON() {
|
|
277408
277446
|
return {
|
|
@@ -277416,12 +277454,13 @@ var AbloError = class extends Error {
|
|
|
277416
277454
|
};
|
|
277417
277455
|
}
|
|
277418
277456
|
/**
|
|
277419
|
-
*
|
|
277420
|
-
*
|
|
277457
|
+
* Formats the error as a single line for logs and string interpolation:
|
|
277458
|
+
* `AbloValidationError [code]: message (see docs) [request_id: …]`.
|
|
277421
277459
|
*
|
|
277422
|
-
*
|
|
277423
|
-
*
|
|
277424
|
-
* payload
|
|
277460
|
+
* It intentionally omits {@link details}, the cause, and the stack, which are
|
|
277461
|
+
* what turn a logged rich error into an unreadable wall of text. The full
|
|
277462
|
+
* structured payload remains available through {@link toJSON}; this is the
|
|
277463
|
+
* concise human-readable form.
|
|
277425
277464
|
*/
|
|
277426
277465
|
toString() {
|
|
277427
277466
|
const code = this.code ? ` [${this.code}]` : "";
|
|
@@ -277462,8 +277501,8 @@ var ErrorFieldSchema = import_zod4.z.preprocess(
|
|
|
277462
277501
|
import_zod4.z.union([import_zod4.z.string(), NestedErrorShapeSchema]).optional()
|
|
277463
277502
|
).catch(void 0);
|
|
277464
277503
|
var ErrorBodyShapeSchema = import_zod4.z.object({
|
|
277465
|
-
/**
|
|
277466
|
-
*
|
|
277504
|
+
/** The `error` field may be a flat code string, as some endpoints return,
|
|
277505
|
+
* or a nested error object, as a {@link CommitReceipt} carries. */
|
|
277467
277506
|
error: ErrorFieldSchema,
|
|
277468
277507
|
code: OptionalWireStringSchema,
|
|
277469
277508
|
reason: OptionalWireStringSchema,
|
|
@@ -280310,6 +280349,12 @@ async function push(argv) {
|
|
|
280310
280349
|
` This is a ${import_picocolors3.default.bold("database privilege")} error (Postgres 42501 / row-level security), not a key scope \u2014 a different API key won't help. The role behind this org's database can't write the target. Provision a writable, RLS-scoped role with ${import_picocolors3.default.bold("npx ablo migrate")}, or check the org's database registration. See docs/plans/read-path-logical-replication-vs-hosting.md.`
|
|
280311
280350
|
)
|
|
280312
280351
|
);
|
|
280352
|
+
} else if (code === "schema_provisioning_forbidden") {
|
|
280353
|
+
console.error(
|
|
280354
|
+
import_picocolors3.default.dim(
|
|
280355
|
+
` This is not a key problem \u2014 the push was authorized, but the target database refused to let the engine create tables (Postgres 42501). On the replication read path Ablo never runs DDL: register your database as a data source with ${import_picocolors3.default.bold("npx ablo connect --register")}, and pushes to that environment record the schema as metadata only \u2014 no tables are created anywhere.`
|
|
280356
|
+
)
|
|
280357
|
+
);
|
|
280313
280358
|
} else if (args.apiKey != null && classifyCredentialKind(args.apiKey) === "restricted") {
|
|
280314
280359
|
console.error(
|
|
280315
280360
|
import_picocolors3.default.dim(
|
|
@@ -280768,6 +280813,9 @@ async function runCheck() {
|
|
|
280768
280813
|
);
|
|
280769
280814
|
process.exit(1);
|
|
280770
280815
|
}
|
|
280816
|
+
function registerEndpoint(baseUrl2) {
|
|
280817
|
+
return `${baseUrl2.replace(/\/+$/, "")}/api/v1/datasources`;
|
|
280818
|
+
}
|
|
280771
280819
|
async function runRegister() {
|
|
280772
280820
|
const dbUrl = requireDatabaseUrl("--register");
|
|
280773
280821
|
const apiKey = resolveApiKey();
|
|
@@ -280792,7 +280840,7 @@ async function runRegister() {
|
|
|
280792
280840
|
const apiUrl2 = (process.env.ABLO_API_URL ?? DEFAULT_URL).replace(/\/+$/, "");
|
|
280793
280841
|
let res;
|
|
280794
280842
|
try {
|
|
280795
|
-
res = await fetch(
|
|
280843
|
+
res = await fetch(registerEndpoint(apiUrl2), {
|
|
280796
280844
|
method: "POST",
|
|
280797
280845
|
headers: { "content-type": "application/json", authorization: `Bearer ${apiKey}` },
|
|
280798
280846
|
body: JSON.stringify({ connectionString: dbUrl })
|
|
@@ -281724,9 +281772,9 @@ async function status(args = []) {
|
|
|
281724
281772
|
mode: mode2,
|
|
281725
281773
|
// The locally-active project (`ablo projects use`); null = org-default.
|
|
281726
281774
|
project: activeProject2 ?? null,
|
|
281727
|
-
// The credential the CLI resolves for requests, with its
|
|
281728
|
-
// 'env' | '.env.local' | '.env' | 'stored'
|
|
281729
|
-
//
|
|
281775
|
+
// The credential the CLI resolves for requests, with its source —
|
|
281776
|
+
// 'env' | '.env.local' | '.env' | 'stored'. Key confusion is a common
|
|
281777
|
+
// source of trouble, and the source is usually the answer.
|
|
281730
281778
|
effectiveKey: {
|
|
281731
281779
|
prefix: effective2.key ? effective2.key.slice(0, 12) : null,
|
|
281732
281780
|
source: effective2.source
|
|
@@ -281739,16 +281787,16 @@ async function status(args = []) {
|
|
|
281739
281787
|
keyMatchesStoredActiveKey: key2.keyMatchesStoredActiveKey,
|
|
281740
281788
|
keyMismatch: key2.keyMismatch,
|
|
281741
281789
|
organizationId: entry?.organizationId ?? null,
|
|
281742
|
-
// What `ablo push` would do right now — the
|
|
281743
|
-
//
|
|
281790
|
+
// What `ablo push` would do right now — the answer to "why did push
|
|
281791
|
+
// demand a different key".
|
|
281744
281792
|
push: {
|
|
281745
281793
|
flow: plan2.flow,
|
|
281746
281794
|
keyPrefix: plan2.apiKey?.slice(0, 12) ?? null,
|
|
281747
281795
|
keySource: plan2.source
|
|
281748
281796
|
},
|
|
281749
|
-
// The schema
|
|
281750
|
-
// engine enforces, which may differ from local `schema.ts`.
|
|
281751
|
-
// server
|
|
281797
|
+
// The schema active for this key's environment — the typename and conflict
|
|
281798
|
+
// rules the engine enforces, which may differ from your local `schema.ts`.
|
|
281799
|
+
// null means the server did not answer (unreachable, too old, or no key).
|
|
281752
281800
|
schema: pushed ? {
|
|
281753
281801
|
active: pushed.active,
|
|
281754
281802
|
version: pushed.version ?? null,
|
|
@@ -282633,12 +282681,12 @@ async function pull(argv) {
|
|
|
282633
282681
|
);
|
|
282634
282682
|
}
|
|
282635
282683
|
|
|
282636
|
-
// src/cli/
|
|
282684
|
+
// src/cli/prismaPull.ts
|
|
282637
282685
|
init_cjs_shims();
|
|
282638
282686
|
var import_picocolors17 = __toESM(require_picocolors(), 1);
|
|
282639
282687
|
var import_fs10 = require("fs");
|
|
282640
282688
|
|
|
282641
|
-
// src/cli/
|
|
282689
|
+
// src/cli/schemaIr.ts
|
|
282642
282690
|
init_cjs_shims();
|
|
282643
282691
|
function camelToSnake3(s) {
|
|
282644
282692
|
return s.replace(/[A-Z]/g, (ch) => `_${ch.toLowerCase()}`);
|
|
@@ -282708,7 +282756,7 @@ function emitSchemaSource(schema, importPath) {
|
|
|
282708
282756
|
return lines.join("\n");
|
|
282709
282757
|
}
|
|
282710
282758
|
|
|
282711
|
-
// src/cli/
|
|
282759
|
+
// src/cli/prismaPull.ts
|
|
282712
282760
|
var DEFAULT_SCHEMA = "prisma/schema.prisma";
|
|
282713
282761
|
var DEFAULT_OUT3 = "ablo/schema.ts";
|
|
282714
282762
|
var DEFAULT_IMPORT2 = "@abloatai/ablo/schema";
|
|
@@ -282965,7 +283013,7 @@ async function prismaPull(argv) {
|
|
|
282965
283013
|
);
|
|
282966
283014
|
}
|
|
282967
283015
|
|
|
282968
|
-
// src/cli/
|
|
283016
|
+
// src/cli/drizzlePull.ts
|
|
282969
283017
|
init_cjs_shims();
|
|
282970
283018
|
var import_picocolors18 = __toESM(require_picocolors(), 1);
|
|
282971
283019
|
var import_fs11 = require("fs");
|