@lostgradient/weft 0.19.0 → 0.21.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/README.md +2 -2
- package/dist/cli/generated/operation-catalog.snapshot.json +1334 -0
- package/dist/cli/generated/operation-client.generated.d.ts +9 -2
- package/dist/cli/generated/operation-client.generated.js +2 -0
- package/dist/core/engine/activity-reconciliation.d.ts +2 -2
- package/dist/core/engine/activity-reconciliation.js +12 -8
- package/dist/core/engine/async-activity-completion.js +12 -4
- package/dist/core/engine/async-activity-records.d.ts +11 -1
- package/dist/core/engine/async-activity-records.js +4 -3
- package/dist/core/engine/attributes-tags.d.ts +11 -1
- package/dist/core/engine/attributes-tags.js +4 -3
- package/dist/core/engine/bulk-operations-purge.js +5 -2
- package/dist/core/engine/bulk-operations.js +17 -5
- package/dist/core/engine/callback-creators-bundles.js +1 -1
- package/dist/core/engine/callback-creators-core.js +4 -2
- package/dist/core/engine/checkpoint-io.js +1 -1
- package/dist/core/engine/child-workflow.js +2 -1
- package/dist/core/engine/completed-review-storage.js +1 -1
- package/dist/core/engine/condition-waiters.d.ts +45 -3
- package/dist/core/engine/condition-waiters.js +12 -3
- package/dist/core/engine/disposal.js +6 -0
- package/dist/core/engine/engine-internal-types.d.ts +12 -4
- package/dist/core/engine/fenced-write.d.ts +46 -15
- package/dist/core/engine/fenced-write.js +39 -6
- package/dist/core/engine/finalizer-state.d.ts +3 -1
- package/dist/core/engine/handle-result.d.ts +49 -1
- package/dist/core/engine/handle-result.js +95 -20
- package/dist/core/engine/index.d.ts +13 -5
- package/dist/core/engine/index.js +155 -5
- package/dist/core/engine/inline-launch-queue.js +9 -0
- package/dist/core/engine/internals.d.ts +73 -0
- package/dist/core/engine/invoke-update-handler.d.ts +19 -0
- package/dist/core/engine/invoke-update-handler.js +7 -0
- package/dist/core/engine/lease-deposition.d.ts +132 -0
- package/dist/core/engine/lease-deposition.js +31 -0
- package/dist/core/engine/lease-errors.d.ts +80 -9
- package/dist/core/engine/lease-errors.js +28 -2
- package/dist/core/engine/lifecycle/resume.js +3 -1
- package/dist/core/engine/lifecycle/standalone-claim-acquire.d.ts +33 -0
- package/dist/core/engine/lifecycle/standalone-claim-acquire.js +25 -0
- package/dist/core/engine/lifecycle/start-commit.js +20 -6
- package/dist/core/engine/lifecycle/transition.d.ts +15 -1
- package/dist/core/engine/lifecycle/transition.js +6 -3
- package/dist/core/engine/operations-activity.js +1 -1
- package/dist/core/engine/operations-time.js +21 -7
- package/dist/core/engine/owner-side-signal-poll.d.ts +132 -0
- package/dist/core/engine/owner-side-signal-poll.js +22 -0
- package/dist/core/engine/owner-side-update-poll.d.ts +116 -0
- package/dist/core/engine/owner-side-update-poll.js +22 -0
- package/dist/core/engine/ownership-bootstrap.d.ts +280 -0
- package/dist/core/engine/ownership-bootstrap.js +89 -0
- package/dist/core/engine/ownership-mode-marker.d.ts +82 -0
- package/dist/core/engine/ownership-mode-marker.js +52 -0
- package/dist/core/engine/ownership-options.d.ts +22 -6
- package/dist/core/engine/ownership-options.js +42 -12
- package/dist/core/engine/pending-updates.js +35 -24
- package/dist/core/engine/queries.d.ts +70 -0
- package/dist/core/engine/queries.js +58 -4
- package/dist/core/engine/schedules.js +1 -1
- package/dist/core/engine/signals.d.ts +11 -1
- package/dist/core/engine/signals.js +11 -7
- package/dist/core/engine/sleep-timer-acknowledgements.d.ts +68 -0
- package/dist/core/engine/sleep-timer-acknowledgements.js +19 -0
- package/dist/core/engine/storage-io.d.ts +58 -10
- package/dist/core/engine/storage-io.js +27 -9
- package/dist/core/engine/termination/cleanup.d.ts +5 -4
- package/dist/core/engine/termination/complete.js +23 -4
- package/dist/core/engine/termination/finalizer-claim.js +4 -4
- package/dist/core/engine/termination/state-commit-callbacks.d.ts +15 -0
- package/dist/core/engine/termination/state-commit-callbacks.js +0 -0
- package/dist/core/engine/termination/suspend.js +1 -1
- package/dist/core/engine/update-validation.d.ts +28 -0
- package/dist/core/engine/update-validation.js +37 -0
- package/dist/core/engine/updates.d.ts +17 -16
- package/dist/core/engine/updates.js +24 -47
- package/dist/core/engine/wake-ownership-check.d.ts +86 -0
- package/dist/core/engine/wake-ownership-check.js +19 -0
- package/dist/core/engine/wake-ownership-guard.d.ts +46 -0
- package/dist/core/engine/wake-ownership-guard.js +23 -0
- package/dist/core/engine/workflow-claim-codec.d.ts +64 -0
- package/dist/core/engine/workflow-claim-codec.js +44 -0
- package/dist/core/engine/workflow-claim-cooldown.d.ts +60 -0
- package/dist/core/engine/workflow-claim-cooldown.js +17 -0
- package/dist/core/engine/workflow-claim-fold.d.ts +82 -0
- package/dist/core/engine/workflow-claim-fold.js +53 -0
- package/dist/core/engine/workflow-claim-metrics.d.ts +131 -0
- package/dist/core/engine/workflow-claim-metrics.js +62 -0
- package/dist/core/engine/workflow-claim-reclaim-scan.d.ts +96 -0
- package/dist/core/engine/workflow-claim-reclaim-scan.js +66 -0
- package/dist/core/engine/workflow-claim-reclaim-target.d.ts +107 -0
- package/dist/core/engine/workflow-claim-reclaim-target.js +155 -0
- package/dist/core/engine/workflow-claim-registry.d.ts +227 -0
- package/dist/core/engine/workflow-claim-registry.js +198 -0
- package/dist/core/engine/workflow-claim-renewal-interval.d.ts +50 -0
- package/dist/core/engine/workflow-claim-renewal-interval.js +132 -0
- package/dist/core/engine/workflow-claim-renewal-subpasses.d.ts +265 -0
- package/dist/core/engine/workflow-claim-renewal-subpasses.js +104 -0
- package/dist/core/engine/workflow-claim-renewal-task.d.ts +159 -0
- package/dist/core/engine/workflow-claim-renewal-task.js +65 -0
- package/dist/core/engine/workflow-claim-transitions.d.ts +186 -0
- package/dist/core/engine/workflow-claim-transitions.js +120 -0
- package/dist/core/inline-execution-strategy.d.ts +20 -0
- package/dist/core/inline-execution-strategy.js +15 -4
- package/dist/core/scheduler/scheduler-class.js +3 -3
- package/dist/core/scheduler/timer-sources.d.ts +13 -0
- package/dist/core/scheduler/timer-sources.js +1 -1
- package/dist/core/types/options.d.ts +17 -1
- package/dist/core/weft-error.d.ts +1 -1
- package/dist/core/weft-error.js +2 -1
- package/dist/http.js +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8 -0
- package/dist/indexeddb.js +1 -1
- package/dist/json-schema.js +3 -3
- package/dist/observability/index.js +2 -2
- package/dist/server/operations/get-task-detail-schema.d.ts +341 -0
- package/dist/server/operations/get-task-detail-schema.js +118 -0
- package/dist/server/operations/get-task-detail.d.ts +346 -0
- package/dist/server/operations/get-task-detail.js +215 -0
- package/dist/server/operations/static-registrations.js +3 -0
- package/dist/storage/auto.js +1 -1
- package/dist/storage/bun-sql.js +113 -0
- package/dist/storage/compressed-storage.js +1 -1
- package/dist/storage/index.d.ts +38 -35
- package/dist/storage/interface.d.ts +87 -125
- package/dist/storage/interface.js +1 -1
- package/dist/storage/key-encoding.d.ts +51 -0
- package/dist/storage/key-encoding.js +13 -0
- package/dist/storage/key-prefixes.d.ts +1 -1
- package/dist/storage/key-prefixes.js +3 -0
- package/dist/storage/lmdb.js +1 -1
- package/dist/storage/memory.js +1 -1
- package/dist/storage/neon.js +2 -2
- package/dist/storage/node-sqlite.js +113 -0
- package/dist/storage/ownership-keys.d.ts +55 -0
- package/dist/storage/ownership-keys.js +6 -0
- package/dist/storage/postgres.js +2 -2
- package/dist/storage/resolve.js +1 -1
- package/dist/storage/scoped-storage.js +1 -1
- package/dist/storage/testing.js +1 -1
- package/dist/storage/turso.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/web-extension.js +1 -1
- package/dist/worker/protocol.js +1 -1
- package/package.json +1 -1
package/dist/storage/bun-sql.js
CHANGED
|
@@ -9,6 +9,9 @@ function requireStorageCapability(storage, capability, featureName) {
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
// src/storage/default-scope.ts
|
|
13
|
+
var DEFAULT_SCOPE = "default";
|
|
14
|
+
|
|
12
15
|
// src/storage/derived-operations.ts
|
|
13
16
|
async function storageHasCore(storage, key) {
|
|
14
17
|
return await storage.get(key) !== null;
|
|
@@ -48,6 +51,18 @@ async function storageDeleteRangeCore(storage, prefix, options) {
|
|
|
48
51
|
return operations.length;
|
|
49
52
|
}
|
|
50
53
|
|
|
54
|
+
// src/storage/key-encoding.ts
|
|
55
|
+
function encodeStorageKeyComponent(value) {
|
|
56
|
+
return encodeURIComponent(value);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// src/storage/ownership-keys.ts
|
|
60
|
+
var OWNERSHIP_CLAIM_KEYS = {
|
|
61
|
+
workflowOwnerEpoch: (workflowId) => `wf-owner-epoch:${encodeStorageKeyComponent(workflowId)}`,
|
|
62
|
+
workflowOwnerHolder: (workflowId) => `wf-owner-holder:${encodeStorageKeyComponent(workflowId)}`,
|
|
63
|
+
ownershipModeMarker: () => "ownership-mode-marker"
|
|
64
|
+
};
|
|
65
|
+
|
|
51
66
|
// src/storage/interface.ts
|
|
52
67
|
var MAX_BATCH_OPERATIONS = 1e4;
|
|
53
68
|
class StorageBatchOperationLimitExceededError extends Error {
|
|
@@ -117,6 +132,104 @@ async function storageConditionalBatch(storage, conditions, operations) {
|
|
|
117
132
|
}
|
|
118
133
|
return storage.conditionalBatch(conditions, operations);
|
|
119
134
|
}
|
|
135
|
+
var formatSortableTimestamp = (timestamp) => String(timestamp).padStart(16, "0");
|
|
136
|
+
var SIGNAL_SORT_CLASS_START = "0";
|
|
137
|
+
var SIGNAL_SORT_CLASS_NORMAL = "1";
|
|
138
|
+
var signalStorageKey = (workflowId, name, id, sortClass) => `sig:${encodeStorageKeyComponent(workflowId)}:${encodeStorageKeyComponent(name)}:${sortClass}:${encodeStorageKeyComponent(id)}`;
|
|
139
|
+
var KEYS = {
|
|
140
|
+
workflow: (id) => `wf:${encodeStorageKeyComponent(id)}`,
|
|
141
|
+
checkpoint: (id) => `wf:${encodeStorageKeyComponent(id)}:ckpt`,
|
|
142
|
+
checkpointHistory: (id, step) => `wf:${encodeStorageKeyComponent(id)}:ckpt:${String(step).padStart(10, "0")}`,
|
|
143
|
+
timelinePrefix: (id) => `wf:${encodeStorageKeyComponent(id)}:timeline:`,
|
|
144
|
+
timeline: (id, step) => `wf:${encodeStorageKeyComponent(id)}:timeline:${String(step).padStart(10, "0")}`,
|
|
145
|
+
schedule: (id) => `schedule:${encodeStorageKeyComponent(id)}`,
|
|
146
|
+
scheduleTick: (fireAt, id) => `schedule-due:${String(fireAt).padStart(16, "0")}:${encodeStorageKeyComponent(id)}`,
|
|
147
|
+
scheduleRun: (workflowId) => `schedule-run:${encodeStorageKeyComponent(workflowId)}`,
|
|
148
|
+
scheduleRunLink: (workflowId) => `schedule-run-link:${encodeStorageKeyComponent(workflowId)}`,
|
|
149
|
+
scheduleRunBySchedulePrefix: (scheduleId) => `schedule-run-by-schedule:${encodeStorageKeyComponent(scheduleId)}:`,
|
|
150
|
+
scheduleRunBySchedule: (scheduleId, workflowId) => `schedule-run-by-schedule:${encodeStorageKeyComponent(scheduleId)}:${encodeStorageKeyComponent(workflowId)}`,
|
|
151
|
+
operation: (queue, scheduledAt, id) => `op:${queue}:${formatSortableTimestamp(scheduledAt)}:${id}`,
|
|
152
|
+
operationInflight: (id) => `op:inflight:${id}`,
|
|
153
|
+
operationQueued: (id) => `op:queued:${id}`,
|
|
154
|
+
operationResolved: (id) => `op:resolved:${id}`,
|
|
155
|
+
bulkOperationAuditPrefix: () => "audit:bulk:",
|
|
156
|
+
bulkOperationAudit: (timestamp, requestId, confirmationToken) => `audit:bulk:${formatSortableTimestamp(timestamp)}:${encodeStorageKeyComponent(requestId)}:${encodeStorageKeyComponent(confirmationToken)}`,
|
|
157
|
+
operationResolvedByTimePrefix: () => "op:resolved-by-time:",
|
|
158
|
+
operationResolvedByTime: (resolvedAt, id) => `op:resolved-by-time:${formatSortableTimestamp(resolvedAt)}:${encodeStorageKeyComponent(id)}`,
|
|
159
|
+
asyncActivity: (workflowId, token) => `async-act:v1:${encodeStorageKeyComponent(workflowId)}:${encodeStorageKeyComponent(token)}`,
|
|
160
|
+
asyncActivityResolution: (workflowId, token) => `async-act:v1:${encodeStorageKeyComponent(workflowId)}:${encodeStorageKeyComponent(token)}:resolution`,
|
|
161
|
+
activityReconciliationPrefix: (workflowId) => `actrec:v1:${encodeStorageKeyComponent(workflowId)}:`,
|
|
162
|
+
activityReconciliation: (workflowId, activityName, idempotencyKeyDigest) => `actrec:v1:${encodeStorageKeyComponent(workflowId)}:${encodeStorageKeyComponent(activityName)}:${idempotencyKeyDigest}`,
|
|
163
|
+
eventPrefix: (workflowId) => `ev:${encodeStorageKeyComponent(workflowId)}:`,
|
|
164
|
+
event: (workflowId, sequence) => `ev:${encodeStorageKeyComponent(workflowId)}:${String(sequence).padStart(10, "0")}`,
|
|
165
|
+
eventHead: (workflowId) => `ev:${encodeStorageKeyComponent(workflowId)}:head`,
|
|
166
|
+
eventWatermark: (workflowId) => `ev:${encodeStorageKeyComponent(workflowId)}:watermark`,
|
|
167
|
+
fleetEventPrefix: () => "fleet-event:",
|
|
168
|
+
fleetEvent: (sequence) => `fleet-event:${String(sequence).padStart(10, "0")}`,
|
|
169
|
+
fleetEventTail: () => "fleet-event-tail",
|
|
170
|
+
fleetEventByWorkflowPrefix: (workflowId) => `fleet-event-by-workflow:${encodeStorageKeyComponent(workflowId)}:`,
|
|
171
|
+
fleetEventByWorkflow: (workflowId, sequence) => `fleet-event-by-workflow:${encodeStorageKeyComponent(workflowId)}:${String(sequence).padStart(10, "0")}`,
|
|
172
|
+
signal: (workflowId, name, id) => signalStorageKey(workflowId, name, id, SIGNAL_SORT_CLASS_NORMAL),
|
|
173
|
+
startSignal: (workflowId, name, id) => signalStorageKey(workflowId, name, id, SIGNAL_SORT_CLASS_START),
|
|
174
|
+
signalSequence: (workflowId) => `sigseq:v1:${encodeStorageKeyComponent(workflowId)}`,
|
|
175
|
+
signalAcceptedResponsePrefix: (workflowId) => `sigres:v1:${encodeStorageKeyComponent(workflowId)}:`,
|
|
176
|
+
signalAcceptedResponse: (workflowId, name, signalId) => `sigres:v1:${encodeStorageKeyComponent(workflowId)}:${encodeStorageKeyComponent(name)}:${encodeStorageKeyComponent(signalId)}`,
|
|
177
|
+
deadline: (deadline, workflowId) => `wf-deadline:${formatSortableTimestamp(deadline)}:${encodeStorageKeyComponent(workflowId)}`,
|
|
178
|
+
terminalCleanup: (fireAt, timerId) => `wf-cleanup:${formatSortableTimestamp(fireAt)}:${encodeStorageKeyComponent(timerId)}`,
|
|
179
|
+
teardownTimer: (fireAt, timerId) => `wf-teardown:${formatSortableTimestamp(fireAt)}:${encodeStorageKeyComponent(timerId)}`,
|
|
180
|
+
delayedStart: (startAt, workflowId) => `wf-delayed:${formatSortableTimestamp(startAt)}:${encodeStorageKeyComponent(workflowId)}`,
|
|
181
|
+
terminalWorkflowPrefix: () => "wf-terminal:",
|
|
182
|
+
terminalWorkflow: (updatedAt, workflowId) => `wf-terminal:${formatSortableTimestamp(updatedAt)}:${encodeStorageKeyComponent(workflowId)}`,
|
|
183
|
+
attribute: (workflowId) => `attr:${encodeStorageKeyComponent(workflowId)}`,
|
|
184
|
+
attributeIndex: (attributeName, encodedValue, workflowId) => `idx:${attributeName}:${encodedValue}:${encodeStorageKeyComponent(workflowId)}`,
|
|
185
|
+
tagIndex: (tag, workflowId) => `tag:${encodeStorageKeyComponent(tag)}:${encodeStorageKeyComponent(workflowId)}`,
|
|
186
|
+
updatePrefix: (workflowId) => `upd:${encodeStorageKeyComponent(workflowId)}:`,
|
|
187
|
+
update: (workflowId, updateId) => `upd:${encodeStorageKeyComponent(workflowId)}:${updateId}`,
|
|
188
|
+
updateResponse: (updateId) => `upr:${updateId}`,
|
|
189
|
+
updateIdempotency: (workflowId, key) => `upk:${encodeStorageKeyComponent(workflowId)}:${key}`,
|
|
190
|
+
startIdempotency: (key) => `start-idem:${encodeStorageKeyComponent(key)}`,
|
|
191
|
+
startIdempotencySignalId: (key) => `start-idem:${key}`,
|
|
192
|
+
livenessPrefix: () => "liveness:",
|
|
193
|
+
liveness: (instanceId) => `liveness:${encodeStorageKeyComponent(instanceId)}`,
|
|
194
|
+
leasePrefix: () => "lease:",
|
|
195
|
+
leaseEpoch: () => "lease:epoch",
|
|
196
|
+
leaseHolder: () => "lease:holder",
|
|
197
|
+
...OWNERSHIP_CLAIM_KEYS,
|
|
198
|
+
budget: (namespace, period, date) => `budget:${namespace}:${period}:${date}`,
|
|
199
|
+
review: (workflowId, reviewId) => `review:${encodeStorageKeyComponent(workflowId)}:${reviewId}`,
|
|
200
|
+
workflowHeaders: (workflowId) => `wf-headers:${encodeStorageKeyComponent(workflowId)}`,
|
|
201
|
+
childCancellationPrefix: (workflowId) => `child-cancel:${encodeStorageKeyComponent(workflowId)}:`,
|
|
202
|
+
childCancellation: (workflowId, childWorkflowId) => `child-cancel:${encodeStorageKeyComponent(workflowId)}:${encodeStorageKeyComponent(childWorkflowId)}`,
|
|
203
|
+
childWorkflowByParentPrefix: (parentWorkflowId, parentWorkflowExecutionToken) => `child-by-parent:${encodeStorageKeyComponent(parentWorkflowId)}:${parentWorkflowExecutionToken === undefined ? "" : `${encodeStorageKeyComponent(parentWorkflowExecutionToken)}:`}`,
|
|
204
|
+
childWorkflowByParent: (parentWorkflowId, parentWorkflowExecutionToken, childWorkflowId) => `child-by-parent:${encodeStorageKeyComponent(parentWorkflowId)}:${parentWorkflowExecutionToken === undefined ? "" : `${encodeStorageKeyComponent(parentWorkflowExecutionToken)}:`}${encodeStorageKeyComponent(childWorkflowId)}`,
|
|
205
|
+
terminalCleanupNeeded: (workflowId) => `wf-cleanup-needed:${encodeStorageKeyComponent(workflowId)}`,
|
|
206
|
+
workflowConcurrency: (workflowType, partitionKey) => `wf-concurrency:${encodeStorageKeyComponent(workflowType)}:${encodeStorageKeyComponent(partitionKey)}`,
|
|
207
|
+
workflowConcurrencyHolder: (workflowId) => `wf-concurrency-holder:${encodeStorageKeyComponent(workflowId)}`,
|
|
208
|
+
workflowHasServices: (workflowId) => `wf-has-services:${encodeStorageKeyComponent(workflowId)}`,
|
|
209
|
+
finalizerState: (workflowId) => `wf-finalizer-state:${encodeStorageKeyComponent(workflowId)}`,
|
|
210
|
+
teardownOwed: (workflowId) => `wf-teardown-needed:${encodeStorageKeyComponent(workflowId)}`,
|
|
211
|
+
teardownSucceeded: (workflowId) => `wf-teardown-succeeded:${encodeStorageKeyComponent(workflowId)}`,
|
|
212
|
+
teardownDeadLetter: (workflowId) => `wf-teardown-deadletter:${encodeStorageKeyComponent(workflowId)}`,
|
|
213
|
+
offload: (workflowId, key) => `offload:${encodeStorageKeyComponent(workflowId)}:${key}`,
|
|
214
|
+
archive: (workflowId, key) => `archive:${encodeStorageKeyComponent(workflowId)}:${key}`,
|
|
215
|
+
stateExecution: (ownerWorkflowId, key) => `state:execution:${encodeStorageKeyComponent(ownerWorkflowId)}:${encodeStorageKeyComponent(key)}`,
|
|
216
|
+
stateWorkflow: (workflowType, key) => `state:workflow-scope:${DEFAULT_SCOPE}:${encodeStorageKeyComponent(workflowType)}:${encodeStorageKeyComponent(key)}`,
|
|
217
|
+
streamChunkPrefix: (workflowId, key) => `blob:${encodeStorageKeyComponent(workflowId)}:${key}:chunk:`,
|
|
218
|
+
streamChunk: (workflowId, key, chunkIndex) => `blob:${encodeStorageKeyComponent(workflowId)}:${key}:chunk:${String(chunkIndex).padStart(10, "0")}`,
|
|
219
|
+
streamTail: (workflowId, key) => `blob:${encodeStorageKeyComponent(workflowId)}:${key}:tail`,
|
|
220
|
+
streamMetadata: (workflowId, key) => `blob:${encodeStorageKeyComponent(workflowId)}:${key}:meta`,
|
|
221
|
+
budgetCharged: (operationId) => `budget-charged:${operationId}`,
|
|
222
|
+
toolEffect: (workflowId, agentId, semanticHash) => `tool-effect:${encodeStorageKeyComponent(workflowId)}:${agentId}:${semanticHash}`,
|
|
223
|
+
workflowVisibilityStatus: (status, workflowId) => `wf-idx-status:${encodeStorageKeyComponent(status)}:${encodeStorageKeyComponent(workflowId)}`,
|
|
224
|
+
workflowVisibilityType: (type, workflowId) => `wf-idx-type:${encodeStorageKeyComponent(type)}:${encodeStorageKeyComponent(workflowId)}`,
|
|
225
|
+
workflowVisibilityCreated: (createdAt, workflowId) => `wf-idx-created:${formatSortableTimestamp(createdAt)}:${encodeStorageKeyComponent(workflowId)}`,
|
|
226
|
+
workflowVisibilityUpdated: (updatedAt, workflowId) => `wf-idx-updated:${formatSortableTimestamp(updatedAt)}:${encodeStorageKeyComponent(workflowId)}`,
|
|
227
|
+
workflowVisibilityDeadline: (deadline, workflowId) => `wf-idx-deadline:${formatSortableTimestamp(deadline)}:${encodeStorageKeyComponent(workflowId)}`,
|
|
228
|
+
workflowVisibilityManifest: (workflowId) => `wf-idx-manifest:${encodeStorageKeyComponent(workflowId)}`,
|
|
229
|
+
workflowVisibilityMetaVersion: () => "wf-idx-meta:version",
|
|
230
|
+
workflowVisibilityMetaBuiltAt: () => "wf-idx-meta:built-at",
|
|
231
|
+
workflowVisibilityMetaCursor: () => "wf-idx-meta:cursor"
|
|
232
|
+
};
|
|
120
233
|
|
|
121
234
|
// src/storage/conditional-batch-body.ts
|
|
122
235
|
function runConditionalBatchBody(conditions, operations, handlers) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var i=import.meta.require,t=(F,X,Y)=>{if(X!=null){if(typeof X!=="object"&&typeof X!=="function")throw TypeError('Object expected to be assigned to "using" declaration');let $;if(Y)$=X[Symbol.asyncDispose];if($===void 0)$=X[Symbol.dispose];if(typeof $!=="function")throw TypeError("Object not disposable");F.push([Y,$,X])}else if(Y)F.push([Y]);return X},r=(F,X,Y)=>{let $=(j)=>X=Y?new SuppressedError(j,X,"An error was suppressed during disposal"):(Y=!0,j),V=(j)=>{while(j=F.pop())try{var K=j[1]&&j[1].call(j[2]);if(j[0])return Promise.resolve(K).then(V,(C)=>($(C),V()))}catch(C){$(C)}if(Y)throw X};return V()};function D(F,X,Y){if(!F.capabilities()[X])throw Error(`Feature "${Y}" requires storage capability "${X}", but this storage backend does not provide it.`)}function g(F){let X=F.capabilities(),Y=[];if(X.persistence!=="local"&&X.persistence!=="remote")Y.push(`persistence must be "local" or "remote" (got "${X.persistence}")`);if(X.readAfterWrite!=="linearizable")Y.push(`readAfterWrite must be "linearizable" (got "${X.readAfterWrite}")`);if(X.scanConsistency!=="snapshot")Y.push(`scanConsistency must be "snapshot" (got "${X.scanConsistency}")`);if(!X.atomicBatch)Y.push("atomicBatch must be true");if(!X.conditionalBatch)Y.push("conditionalBatch must be true");if(Y.length>0)throw Error(`Storage is not durable enough for recovery: ${Y.join("; ")}.`)}var G="default";async function M(F,X){return await F.get(X)!==null}async function*q(F,X,Y){for await(let[$]of F.scan(X,Y))yield $}async function N(F,X){let Y=0;for await(let $ of q(F,X))Y++;return Y}async function H(F,X){let Y=[];for await(let $ of q(F,X))Y.push({type:"delete",key:$});if(Y.length===0)return 0;return await F.batch(Y),Y.length}async function XF(F,X,Y){let $=[];for await(let V of q(F,X,Y))$.push({type:"delete",key:V});if($.length===0)return 0;return await F.batch($),$.length}var u=["actrec:","archive:","async-act:","attr:","audit:bulk:","blob:","budget:","budget-charged:","child-by-parent:","ev:","fleet-event-by-workflow:","fleet-event:","fleet-event-tail","idx:","lease:","liveness:","offload:","op:","review:","schedule:","schedule-due:","schedule-run-by-schedule:","schedule-run-link:","schedule-run:","sig:","sigres:","sigseq:","start-idem:","state:","tag:","tool-effect:","upd:","upk:","upr:","wf:","wf-cleanup:","wf-cleanup-needed:","wf-concurrency:","wf-concurrency-holder:","wf-deadline:","wf-delayed:","wf-finalizer-state:","wf-has-services:","wf-headers:","wf-idx-","wf-teardown:","wf-teardown-deadletter:","wf-teardown-needed:","wf-teardown-succeeded:","wf-terminal:"];var L=1e4,QF=1e4;class v extends Error{code="StorageBatchOperationLimitExceededError";cap=L;count;target;constructor(F,X){super(`${F} count ${X} exceeds MAX_BATCH_OPERATIONS (${L}).`);this.name="StorageBatchOperationLimitExceededError",this.target=F,this.count=X}}function z(F,X){if(X>L)throw new v(F,X)}function UF(F){return F.length>0?F.slice(0,-1)+String.fromCharCode(F.charCodeAt(F.length-1)+1):"\xFF"}function VF(F,X={}){if(X.gt!==void 0&&F<=X.gt)return!1;if(X.gte!==void 0&&F<X.gte)return!1;if(X.lt!==void 0&&F>=X.lt)return!1;if(X.lte!==void 0&&F>X.lte)return!1;return!0}function PF(F,X){if(F===null||X===null)return F===X;if(F.byteLength!==X.byteLength)return!1;for(let Y=0;Y<F.byteLength;Y++)if(F[Y]!==X[Y])return!1;return!0}async function qF(F,X){if(F.has)return F.has(X);return M(F,X)}function zF(F,X,Y){if(F.keys)return F.keys(X,Y);return q(F,X,Y)}async function WF(F,X){if(F.count)return F.count(X);return N(F,X)}async function CF(F,X){if(F.deletePrefix)return F.deletePrefix(X);return H(F,X)}async function DF(F,X){z("batch operations",X.length),await F.batch(X)}async function GF(F,X,Y){if(z("conditionalBatch conditions",X.length),z("conditionalBatch operations",Y.length),D(F,"conditionalBatch","storageConditionalBatch"),!F.conditionalBatch)throw Error("This storage backend reports conditionalBatch capability but does not implement the conditionalBatch() method.");return F.conditionalBatch(X,Y)}function J(F){return encodeURIComponent(F)}function LF(F){return decodeURIComponent(F)}function SF(F){try{return decodeURIComponent(F)}catch{return null}}var Q=(F)=>String(F).padStart(16,"0"),f="0",p="1",B=(F,X,Y,$)=>`sig:${J(F)}:${J(X)}:${$}:${J(Y)}`,ZF={workflow:(F)=>`wf:${J(F)}`,checkpoint:(F)=>`wf:${J(F)}:ckpt`,checkpointHistory:(F,X)=>`wf:${J(F)}:ckpt:${String(X).padStart(10,"0")}`,timelinePrefix:(F)=>`wf:${J(F)}:timeline:`,timeline:(F,X)=>`wf:${J(F)}:timeline:${String(X).padStart(10,"0")}`,schedule:(F)=>`schedule:${J(F)}`,scheduleTick:(F,X)=>`schedule-due:${String(F).padStart(16,"0")}:${J(X)}`,scheduleRun:(F)=>`schedule-run:${J(F)}`,scheduleRunLink:(F)=>`schedule-run-link:${J(F)}`,scheduleRunBySchedulePrefix:(F)=>`schedule-run-by-schedule:${J(F)}:`,scheduleRunBySchedule:(F,X)=>`schedule-run-by-schedule:${J(F)}:${J(X)}`,operation:(F,X,Y)=>`op:${F}:${Q(X)}:${Y}`,operationInflight:(F)=>`op:inflight:${F}`,operationQueued:(F)=>`op:queued:${F}`,operationResolved:(F)=>`op:resolved:${F}`,bulkOperationAuditPrefix:()=>"audit:bulk:",bulkOperationAudit:(F,X,Y)=>`audit:bulk:${Q(F)}:${J(X)}:${J(Y)}`,operationResolvedByTimePrefix:()=>"op:resolved-by-time:",operationResolvedByTime:(F,X)=>`op:resolved-by-time:${Q(F)}:${J(X)}`,asyncActivity:(F,X)=>`async-act:v1:${J(F)}:${J(X)}`,asyncActivityResolution:(F,X)=>`async-act:v1:${J(F)}:${J(X)}:resolution`,activityReconciliationPrefix:(F)=>`actrec:v1:${J(F)}:`,activityReconciliation:(F,X,Y)=>`actrec:v1:${J(F)}:${J(X)}:${Y}`,eventPrefix:(F)=>`ev:${J(F)}:`,event:(F,X)=>`ev:${J(F)}:${String(X).padStart(10,"0")}`,eventHead:(F)=>`ev:${J(F)}:head`,eventWatermark:(F)=>`ev:${J(F)}:watermark`,fleetEventPrefix:()=>"fleet-event:",fleetEvent:(F)=>`fleet-event:${String(F).padStart(10,"0")}`,fleetEventTail:()=>"fleet-event-tail",fleetEventByWorkflowPrefix:(F)=>`fleet-event-by-workflow:${J(F)}:`,fleetEventByWorkflow:(F,X)=>`fleet-event-by-workflow:${J(F)}:${String(X).padStart(10,"0")}`,signal:(F,X,Y)=>B(F,X,Y,p),startSignal:(F,X,Y)=>B(F,X,Y,f),signalSequence:(F)=>`sigseq:v1:${J(F)}`,signalAcceptedResponsePrefix:(F)=>`sigres:v1:${J(F)}:`,signalAcceptedResponse:(F,X,Y)=>`sigres:v1:${J(F)}:${J(X)}:${J(Y)}`,deadline:(F,X)=>`wf-deadline:${Q(F)}:${J(X)}`,terminalCleanup:(F,X)=>`wf-cleanup:${Q(F)}:${J(X)}`,teardownTimer:(F,X)=>`wf-teardown:${Q(F)}:${J(X)}`,delayedStart:(F,X)=>`wf-delayed:${Q(F)}:${J(X)}`,terminalWorkflowPrefix:()=>"wf-terminal:",terminalWorkflow:(F,X)=>`wf-terminal:${Q(F)}:${J(X)}`,attribute:(F)=>`attr:${J(F)}`,attributeIndex:(F,X,Y)=>`idx:${F}:${X}:${J(Y)}`,tagIndex:(F,X)=>`tag:${J(F)}:${J(X)}`,updatePrefix:(F)=>`upd:${J(F)}:`,update:(F,X)=>`upd:${J(F)}:${X}`,updateResponse:(F)=>`upr:${F}`,updateIdempotency:(F,X)=>`upk:${J(F)}:${X}`,startIdempotency:(F)=>`start-idem:${J(F)}`,startIdempotencySignalId:(F)=>`start-idem:${F}`,livenessPrefix:()=>"liveness:",liveness:(F)=>`liveness:${J(F)}`,leasePrefix:()=>"lease:",leaseEpoch:()=>"lease:epoch",leaseHolder:()=>"lease:holder",budget:(F,X,Y)=>`budget:${F}:${X}:${Y}`,review:(F,X)=>`review:${J(F)}:${X}`,workflowHeaders:(F)=>`wf-headers:${J(F)}`,childCancellationPrefix:(F)=>`child-cancel:${J(F)}:`,childCancellation:(F,X)=>`child-cancel:${J(F)}:${J(X)}`,childWorkflowByParentPrefix:(F,X)=>`child-by-parent:${J(F)}:${X===void 0?"":`${J(X)}:`}`,childWorkflowByParent:(F,X,Y)=>`child-by-parent:${J(F)}:${X===void 0?"":`${J(X)}:`}${J(Y)}`,terminalCleanupNeeded:(F)=>`wf-cleanup-needed:${J(F)}`,workflowConcurrency:(F,X)=>`wf-concurrency:${J(F)}:${J(X)}`,workflowConcurrencyHolder:(F)=>`wf-concurrency-holder:${J(F)}`,workflowHasServices:(F)=>`wf-has-services:${J(F)}`,finalizerState:(F)=>`wf-finalizer-state:${J(F)}`,teardownOwed:(F)=>`wf-teardown-needed:${J(F)}`,teardownSucceeded:(F)=>`wf-teardown-succeeded:${J(F)}`,teardownDeadLetter:(F)=>`wf-teardown-deadletter:${J(F)}`,offload:(F,X)=>`offload:${J(F)}:${X}`,archive:(F,X)=>`archive:${J(F)}:${X}`,stateExecution:(F,X)=>`state:execution:${J(F)}:${J(X)}`,stateWorkflow:(F,X)=>`state:workflow-scope:${G}:${J(F)}:${J(X)}`,streamChunkPrefix:(F,X)=>`blob:${J(F)}:${X}:chunk:`,streamChunk:(F,X,Y)=>`blob:${J(F)}:${X}:chunk:${String(Y).padStart(10,"0")}`,streamTail:(F,X)=>`blob:${J(F)}:${X}:tail`,streamMetadata:(F,X)=>`blob:${J(F)}:${X}:meta`,budgetCharged:(F)=>`budget-charged:${F}`,toolEffect:(F,X,Y)=>`tool-effect:${J(F)}:${X}:${Y}`,workflowVisibilityStatus:(F,X)=>`wf-idx-status:${J(F)}:${J(X)}`,workflowVisibilityType:(F,X)=>`wf-idx-type:${J(F)}:${J(X)}`,workflowVisibilityCreated:(F,X)=>`wf-idx-created:${Q(F)}:${J(X)}`,workflowVisibilityUpdated:(F,X)=>`wf-idx-updated:${Q(F)}:${J(X)}`,workflowVisibilityDeadline:(F,X)=>`wf-idx-deadline:${Q(F)}:${J(X)}`,workflowVisibilityManifest:(F)=>`wf-idx-manifest:${J(F)}`,workflowVisibilityMetaVersion:()=>"wf-idx-meta:version",workflowVisibilityMetaBuiltAt:()=>"wf-idx-meta:built-at",workflowVisibilityMetaCursor:()=>"wf-idx-meta:cursor"};var P;function I(){if(P&&"bun"in P)return P.bun;return globalThis.Bun}function E(){return typeof I()<"u"}function k(){if(P&&"process"in P)return P.process;return globalThis.process}function O(F){let Y=k()?.getBuiltinModule;if(typeof Y!=="function")return;return Y(F)}function x(){let F=O("node:zlib");if(!F)throw Error("gzip/gunzip require Bun or Node 22.5+ (process.getBuiltinModule). "+"Not available in browser or edge runtimes \u2014 use CompressionStream directly.");return F}function A(F){if(E())return new Uint8Array(Bun.gzipSync(new Uint8Array(F)));return new Uint8Array(x().gzipSync(F))}function h(F){if(E())return new Uint8Array(Bun.gunzipSync(new Uint8Array(F)));return new Uint8Array(x().gunzipSync(F))}function T(){return O("node:zlib")}function R(){let F=T();if(!F)throw Error("Brotli compression requires Bun or Node 22.5+ with process.getBuiltinModule support. Use gzip compression for browser/edge runtimes.");return F}function w(F){return new Uint8Array(R().brotliCompressSync(F))}function n(F){return new Uint8Array(R().brotliDecompressSync(F))}var W=193,S=0,b=1,c=2,U=2;function y(F){return l(F)}function l(F){switch(F){case"gzip":return{algorithm:"gzip",compress(X){return A(X)}};case"brotli":return{algorithm:"brotli",compress(X){return w(X)}};case"none":return{algorithm:"none",compress(X){return X}}}}async function Z(F,X,Y){if(F.length<Y||X.algorithm==="none"){let K=new Uint8Array(F.length+U);return K[0]=W,K[1]=S,K.set(F,U),K}let $=await X.compress(F);if($.length+U>=F.length+U){let K=new Uint8Array(F.length+U);return K[0]=W,K[1]=S,K.set(F,U),K}let V=X.algorithm==="gzip"?b:c,j=new Uint8Array($.length+U);return j[0]=W,j[1]=V,j.set($,U),j}async function _(F){if(F.length<U)throw Error("Compression payload missing 2-byte header.");if(F[0]!==W)throw Error("Compression payload missing magic byte 0xC1.");let X=F[1],Y=F.slice(U);switch(X){case S:return Y;case b:return h(Y);case c:return n(Y);default:throw Error(`Compression payload uses unsupported algorithm byte 0x${X.toString(16).padStart(2,"0")}.`)}}var s=4096,d="gzip";function m(F){return{threshold:F?.threshold??s,algorithm:F?.algorithm??d}}class a{#F;#X;#J;constructor(F,X){this.#F=F;let Y=m(X);if(this.#X=y(Y.algorithm),this.#J=Y.threshold,F.query){let $=F.query.bind(F);Object.defineProperty(this,"query",{value:$,enumerable:!0,configurable:!0})}}capabilities(){let F=this.#F.capabilities();return{persistence:F.persistence,readAfterWrite:F.readAfterWrite,scanConsistency:F.scanConsistency,atomicBatch:F.atomicBatch,conditionalBatch:!1,boundedRangeDelete:!1}}async get(F){let X=await this.#F.get(F);if(!X)return null;return _(X)}async put(F,X){let Y=await Z(X,this.#X,this.#J);return this.#F.put(F,Y)}async delete(F){return this.#F.delete(F)}async*scan(F,X){for await(let[Y,$]of this.#F.scan(F,X))yield[Y,await _($)]}async batch(F){z("batch operations",F.length);let X=await Promise.all(F.map(async(Y)=>{if(Y.type==="put")return{type:"put",key:Y.key,value:await Z(Y.value,this.#X,this.#J)};return Y}));return this.#F.batch(X)}[Symbol.dispose](){this.#F[Symbol.dispose]()}}export{a as CompressedStorage};
|
|
2
|
+
var r=import.meta.require;function L(F,X,$){if(!F.capabilities()[X])throw Error(`Feature "${$}" requires storage capability "${X}", but this storage backend does not provide it.`)}function g(F){let X=F.capabilities(),$=[];if(X.persistence!=="local"&&X.persistence!=="remote")$.push(`persistence must be "local" or "remote" (got "${X.persistence}")`);if(X.readAfterWrite!=="linearizable")$.push(`readAfterWrite must be "linearizable" (got "${X.readAfterWrite}")`);if(X.scanConsistency!=="snapshot")$.push(`scanConsistency must be "snapshot" (got "${X.scanConsistency}")`);if(!X.atomicBatch)$.push("atomicBatch must be true");if(!X.conditionalBatch)$.push("conditionalBatch must be true");if($.length>0)throw Error(`Storage is not durable enough for recovery: ${$.join("; ")}.`)}var Z="default";async function C(F,X){return await F.get(X)!==null}async function*P(F,X,$){for await(let[j]of F.scan(X,$))yield j}async function H(F,X){let $=0;for await(let j of P(F,X))$++;return $}async function N(F,X){let $=[];for await(let j of P(F,X))$.push({type:"delete",key:j});if($.length===0)return 0;return await F.batch($),$.length}async function XF(F,X,$){let j=[];for await(let W of P(F,X,$))j.push({type:"delete",key:W});if(j.length===0)return 0;return await F.batch(j),j.length}function Y(F){return encodeURIComponent(F)}function u(F){return decodeURIComponent(F)}function f(F){try{return decodeURIComponent(F)}catch{return null}}var S={workflowOwnerEpoch:(F)=>`wf-owner-epoch:${Y(F)}`,workflowOwnerHolder:(F)=>`wf-owner-holder:${Y(F)}`,ownershipModeMarker:()=>"ownership-mode-marker"};var I=["actrec:","archive:","async-act:","attr:","audit:bulk:","blob:","budget:","budget-charged:","child-by-parent:","ev:","fleet-event-by-workflow:","fleet-event:","fleet-event-tail","idx:","lease:","liveness:","offload:","ownership-mode-marker","op:","review:","schedule:","schedule-due:","schedule-run-by-schedule:","schedule-run-link:","schedule-run:","sig:","sigres:","sigseq:","start-idem:","state:","tag:","tool-effect:","upd:","upk:","upr:","wf:","wf-cleanup:","wf-cleanup-needed:","wf-concurrency:","wf-concurrency-holder:","wf-deadline:","wf-delayed:","wf-finalizer-state:","wf-has-services:","wf-headers:","wf-idx-","wf-owner-epoch:","wf-owner-holder:","wf-teardown:","wf-teardown-deadletter:","wf-teardown-needed:","wf-teardown-succeeded:","wf-terminal:"];var _=1e4,zF=1e4;class E extends Error{code="StorageBatchOperationLimitExceededError";cap=_;count;target;constructor(F,X){super(`${F} count ${X} exceeds MAX_BATCH_OPERATIONS (${_}).`);this.name="StorageBatchOperationLimitExceededError",this.target=F,this.count=X}}function K(F,X){if(X>_)throw new E(F,X)}function WF(F){return F.length>0?F.slice(0,-1)+String.fromCharCode(F.charCodeAt(F.length-1)+1):"\xFF"}function LF(F,X={}){if(X.gt!==void 0&&F<=X.gt)return!1;if(X.gte!==void 0&&F<X.gte)return!1;if(X.lt!==void 0&&F>=X.lt)return!1;if(X.lte!==void 0&&F>X.lte)return!1;return!0}function ZF(F,X){if(F===null||X===null)return F===X;if(F.byteLength!==X.byteLength)return!1;for(let $=0;$<F.byteLength;$++)if(F[$]!==X[$])return!1;return!0}async function _F(F,X){if(F.has)return F.has(X);return C(F,X)}function GF(F,X,$){if(F.keys)return F.keys(X,$);return P(F,X,$)}async function MF(F,X){if(F.count)return F.count(X);return H(F,X)}async function DF(F,X){if(F.deletePrefix)return F.deletePrefix(X);return N(F,X)}async function CF(F,X){K("batch operations",X.length),await F.batch(X)}async function HF(F,X,$){if(K("conditionalBatch conditions",X.length),K("conditionalBatch operations",$.length),L(F,"conditionalBatch","storageConditionalBatch"),!F.conditionalBatch)throw Error("This storage backend reports conditionalBatch capability but does not implement the conditionalBatch() method.");return F.conditionalBatch(X,$)}var J=(F)=>String(F).padStart(16,"0"),p="0",k="1",B=(F,X,$,j)=>`sig:${Y(F)}:${Y(X)}:${j}:${Y($)}`,NF={workflow:(F)=>`wf:${Y(F)}`,checkpoint:(F)=>`wf:${Y(F)}:ckpt`,checkpointHistory:(F,X)=>`wf:${Y(F)}:ckpt:${String(X).padStart(10,"0")}`,timelinePrefix:(F)=>`wf:${Y(F)}:timeline:`,timeline:(F,X)=>`wf:${Y(F)}:timeline:${String(X).padStart(10,"0")}`,schedule:(F)=>`schedule:${Y(F)}`,scheduleTick:(F,X)=>`schedule-due:${String(F).padStart(16,"0")}:${Y(X)}`,scheduleRun:(F)=>`schedule-run:${Y(F)}`,scheduleRunLink:(F)=>`schedule-run-link:${Y(F)}`,scheduleRunBySchedulePrefix:(F)=>`schedule-run-by-schedule:${Y(F)}:`,scheduleRunBySchedule:(F,X)=>`schedule-run-by-schedule:${Y(F)}:${Y(X)}`,operation:(F,X,$)=>`op:${F}:${J(X)}:${$}`,operationInflight:(F)=>`op:inflight:${F}`,operationQueued:(F)=>`op:queued:${F}`,operationResolved:(F)=>`op:resolved:${F}`,bulkOperationAuditPrefix:()=>"audit:bulk:",bulkOperationAudit:(F,X,$)=>`audit:bulk:${J(F)}:${Y(X)}:${Y($)}`,operationResolvedByTimePrefix:()=>"op:resolved-by-time:",operationResolvedByTime:(F,X)=>`op:resolved-by-time:${J(F)}:${Y(X)}`,asyncActivity:(F,X)=>`async-act:v1:${Y(F)}:${Y(X)}`,asyncActivityResolution:(F,X)=>`async-act:v1:${Y(F)}:${Y(X)}:resolution`,activityReconciliationPrefix:(F)=>`actrec:v1:${Y(F)}:`,activityReconciliation:(F,X,$)=>`actrec:v1:${Y(F)}:${Y(X)}:${$}`,eventPrefix:(F)=>`ev:${Y(F)}:`,event:(F,X)=>`ev:${Y(F)}:${String(X).padStart(10,"0")}`,eventHead:(F)=>`ev:${Y(F)}:head`,eventWatermark:(F)=>`ev:${Y(F)}:watermark`,fleetEventPrefix:()=>"fleet-event:",fleetEvent:(F)=>`fleet-event:${String(F).padStart(10,"0")}`,fleetEventTail:()=>"fleet-event-tail",fleetEventByWorkflowPrefix:(F)=>`fleet-event-by-workflow:${Y(F)}:`,fleetEventByWorkflow:(F,X)=>`fleet-event-by-workflow:${Y(F)}:${String(X).padStart(10,"0")}`,signal:(F,X,$)=>B(F,X,$,k),startSignal:(F,X,$)=>B(F,X,$,p),signalSequence:(F)=>`sigseq:v1:${Y(F)}`,signalAcceptedResponsePrefix:(F)=>`sigres:v1:${Y(F)}:`,signalAcceptedResponse:(F,X,$)=>`sigres:v1:${Y(F)}:${Y(X)}:${Y($)}`,deadline:(F,X)=>`wf-deadline:${J(F)}:${Y(X)}`,terminalCleanup:(F,X)=>`wf-cleanup:${J(F)}:${Y(X)}`,teardownTimer:(F,X)=>`wf-teardown:${J(F)}:${Y(X)}`,delayedStart:(F,X)=>`wf-delayed:${J(F)}:${Y(X)}`,terminalWorkflowPrefix:()=>"wf-terminal:",terminalWorkflow:(F,X)=>`wf-terminal:${J(F)}:${Y(X)}`,attribute:(F)=>`attr:${Y(F)}`,attributeIndex:(F,X,$)=>`idx:${F}:${X}:${Y($)}`,tagIndex:(F,X)=>`tag:${Y(F)}:${Y(X)}`,updatePrefix:(F)=>`upd:${Y(F)}:`,update:(F,X)=>`upd:${Y(F)}:${X}`,updateResponse:(F)=>`upr:${F}`,updateIdempotency:(F,X)=>`upk:${Y(F)}:${X}`,startIdempotency:(F)=>`start-idem:${Y(F)}`,startIdempotencySignalId:(F)=>`start-idem:${F}`,livenessPrefix:()=>"liveness:",liveness:(F)=>`liveness:${Y(F)}`,leasePrefix:()=>"lease:",leaseEpoch:()=>"lease:epoch",leaseHolder:()=>"lease:holder",...S,budget:(F,X,$)=>`budget:${F}:${X}:${$}`,review:(F,X)=>`review:${Y(F)}:${X}`,workflowHeaders:(F)=>`wf-headers:${Y(F)}`,childCancellationPrefix:(F)=>`child-cancel:${Y(F)}:`,childCancellation:(F,X)=>`child-cancel:${Y(F)}:${Y(X)}`,childWorkflowByParentPrefix:(F,X)=>`child-by-parent:${Y(F)}:${X===void 0?"":`${Y(X)}:`}`,childWorkflowByParent:(F,X,$)=>`child-by-parent:${Y(F)}:${X===void 0?"":`${Y(X)}:`}${Y($)}`,terminalCleanupNeeded:(F)=>`wf-cleanup-needed:${Y(F)}`,workflowConcurrency:(F,X)=>`wf-concurrency:${Y(F)}:${Y(X)}`,workflowConcurrencyHolder:(F)=>`wf-concurrency-holder:${Y(F)}`,workflowHasServices:(F)=>`wf-has-services:${Y(F)}`,finalizerState:(F)=>`wf-finalizer-state:${Y(F)}`,teardownOwed:(F)=>`wf-teardown-needed:${Y(F)}`,teardownSucceeded:(F)=>`wf-teardown-succeeded:${Y(F)}`,teardownDeadLetter:(F)=>`wf-teardown-deadletter:${Y(F)}`,offload:(F,X)=>`offload:${Y(F)}:${X}`,archive:(F,X)=>`archive:${Y(F)}:${X}`,stateExecution:(F,X)=>`state:execution:${Y(F)}:${Y(X)}`,stateWorkflow:(F,X)=>`state:workflow-scope:${Z}:${Y(F)}:${Y(X)}`,streamChunkPrefix:(F,X)=>`blob:${Y(F)}:${X}:chunk:`,streamChunk:(F,X,$)=>`blob:${Y(F)}:${X}:chunk:${String($).padStart(10,"0")}`,streamTail:(F,X)=>`blob:${Y(F)}:${X}:tail`,streamMetadata:(F,X)=>`blob:${Y(F)}:${X}:meta`,budgetCharged:(F)=>`budget-charged:${F}`,toolEffect:(F,X,$)=>`tool-effect:${Y(F)}:${X}:${$}`,workflowVisibilityStatus:(F,X)=>`wf-idx-status:${Y(F)}:${Y(X)}`,workflowVisibilityType:(F,X)=>`wf-idx-type:${Y(F)}:${Y(X)}`,workflowVisibilityCreated:(F,X)=>`wf-idx-created:${J(F)}:${Y(X)}`,workflowVisibilityUpdated:(F,X)=>`wf-idx-updated:${J(F)}:${Y(X)}`,workflowVisibilityDeadline:(F,X)=>`wf-idx-deadline:${J(F)}:${Y(X)}`,workflowVisibilityManifest:(F)=>`wf-idx-manifest:${Y(F)}`,workflowVisibilityMetaVersion:()=>"wf-idx-meta:version",workflowVisibilityMetaBuiltAt:()=>"wf-idx-meta:built-at",workflowVisibilityMetaCursor:()=>"wf-idx-meta:cursor"};var V;function w(){if(V&&"bun"in V)return V.bun;return globalThis.Bun}function v(){return typeof w()<"u"}function l(){if(V&&"process"in V)return V.process;return globalThis.process}function O(F){let $=l()?.getBuiltinModule;if(typeof $!=="function")return;return $(F)}function x(){let F=O("node:zlib");if(!F)throw Error("gzip/gunzip require Bun or Node 22.5+ (process.getBuiltinModule). "+"Not available in browser or edge runtimes \u2014 use CompressionStream directly.");return F}function A(F){if(v())return new Uint8Array(Bun.gzipSync(new Uint8Array(F)));return new Uint8Array(x().gzipSync(F))}function T(F){if(v())return new Uint8Array(Bun.gunzipSync(new Uint8Array(F)));return new Uint8Array(x().gunzipSync(F))}function R(){return O("node:zlib")}function b(){let F=R();if(!F)throw Error("Brotli compression requires Bun or Node 22.5+ with process.getBuiltinModule support. Use gzip compression for browser/edge runtimes.");return F}function n(F){return new Uint8Array(b().brotliCompressSync(F))}function s(F){return new Uint8Array(b().brotliDecompressSync(F))}var z=193,G=0,h=1,c=2,Q=2;function y(F){return d(F)}function d(F){switch(F){case"gzip":return{algorithm:"gzip",compress(X){return A(X)}};case"brotli":return{algorithm:"brotli",compress(X){return n(X)}};case"none":return{algorithm:"none",compress(X){return X}}}}async function M(F,X,$){if(F.length<$||X.algorithm==="none"){let U=new Uint8Array(F.length+Q);return U[0]=z,U[1]=G,U.set(F,Q),U}let j=await X.compress(F);if(j.length+Q>=F.length+Q){let U=new Uint8Array(F.length+Q);return U[0]=z,U[1]=G,U.set(F,Q),U}let W=X.algorithm==="gzip"?h:c,q=new Uint8Array(j.length+Q);return q[0]=z,q[1]=W,q.set(j,Q),q}async function D(F){if(F.length<Q)throw Error("Compression payload missing 2-byte header.");if(F[0]!==z)throw Error("Compression payload missing magic byte 0xC1.");let X=F[1],$=F.slice(Q);switch(X){case G:return $;case h:return T($);case c:return s($);default:throw Error(`Compression payload uses unsupported algorithm byte 0x${X.toString(16).padStart(2,"0")}.`)}}var a=4096,i="gzip";function m(F){return{threshold:F?.threshold??a,algorithm:F?.algorithm??i}}class t{#F;#X;#Y;constructor(F,X){this.#F=F;let $=m(X);if(this.#X=y($.algorithm),this.#Y=$.threshold,F.query){let j=F.query.bind(F);Object.defineProperty(this,"query",{value:j,enumerable:!0,configurable:!0})}}capabilities(){let F=this.#F.capabilities();return{persistence:F.persistence,readAfterWrite:F.readAfterWrite,scanConsistency:F.scanConsistency,atomicBatch:F.atomicBatch,conditionalBatch:!1,boundedRangeDelete:!1}}async get(F){let X=await this.#F.get(F);if(!X)return null;return D(X)}async put(F,X){let $=await M(X,this.#X,this.#Y);return this.#F.put(F,$)}async delete(F){return this.#F.delete(F)}async*scan(F,X){for await(let[$,j]of this.#F.scan(F,X))yield[$,await D(j)]}async batch(F){K("batch operations",F.length);let X=await Promise.all(F.map(async($)=>{if($.type==="put")return{type:"put",key:$.key,value:await M($.value,this.#X,this.#Y)};return $}));return this.#F.batch(X)}[Symbol.dispose](){this.#F[Symbol.dispose]()}}export{t as CompressedStorage};
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -82,6 +82,43 @@ declare const exportedCopyTextKeyValueRowsToStorage: typeof copyTextKeyValueRows
|
|
|
82
82
|
* ```
|
|
83
83
|
*/
|
|
84
84
|
declare const exportedKeys: {
|
|
85
|
+
readonly budget: (namespace: string, period: string, date: string) => string;
|
|
86
|
+
readonly review: (workflowId: string, reviewId: string) => string;
|
|
87
|
+
readonly workflowHeaders: (workflowId: string) => string;
|
|
88
|
+
readonly childCancellationPrefix: (workflowId: string) => string;
|
|
89
|
+
readonly childCancellation: (workflowId: string, childWorkflowId: string) => string;
|
|
90
|
+
readonly childWorkflowByParentPrefix: (parentWorkflowId: string, parentWorkflowExecutionToken?: string) => string;
|
|
91
|
+
readonly childWorkflowByParent: (parentWorkflowId: string, parentWorkflowExecutionToken: string | undefined, childWorkflowId: string) => string;
|
|
92
|
+
readonly terminalCleanupNeeded: (workflowId: string) => string;
|
|
93
|
+
readonly workflowConcurrency: (workflowType: string, partitionKey: string) => string;
|
|
94
|
+
readonly workflowConcurrencyHolder: (workflowId: string) => string;
|
|
95
|
+
readonly workflowHasServices: (workflowId: string) => string;
|
|
96
|
+
readonly finalizerState: (workflowId: string) => string;
|
|
97
|
+
readonly teardownOwed: (workflowId: string) => string;
|
|
98
|
+
readonly teardownSucceeded: (workflowId: string) => string;
|
|
99
|
+
readonly teardownDeadLetter: (workflowId: string) => string;
|
|
100
|
+
readonly offload: (workflowId: string, key: string) => string;
|
|
101
|
+
readonly archive: (workflowId: string, key: string) => string;
|
|
102
|
+
readonly stateExecution: (ownerWorkflowId: string, key: string) => string;
|
|
103
|
+
readonly stateWorkflow: (workflowType: string, key: string) => string;
|
|
104
|
+
readonly streamChunkPrefix: (workflowId: string, key: string) => string;
|
|
105
|
+
readonly streamChunk: (workflowId: string, key: string, chunkIndex: number) => string;
|
|
106
|
+
readonly streamTail: (workflowId: string, key: string) => string;
|
|
107
|
+
readonly streamMetadata: (workflowId: string, key: string) => string;
|
|
108
|
+
readonly budgetCharged: (operationId: string) => string;
|
|
109
|
+
readonly toolEffect: (workflowId: string, agentId: string, semanticHash: string) => string;
|
|
110
|
+
readonly workflowVisibilityStatus: (status: string, workflowId: string) => string;
|
|
111
|
+
readonly workflowVisibilityType: (type: string, workflowId: string) => string;
|
|
112
|
+
readonly workflowVisibilityCreated: (createdAt: number, workflowId: string) => string;
|
|
113
|
+
readonly workflowVisibilityUpdated: (updatedAt: number, workflowId: string) => string;
|
|
114
|
+
readonly workflowVisibilityDeadline: (deadline: number, workflowId: string) => string;
|
|
115
|
+
readonly workflowVisibilityManifest: (workflowId: string) => string;
|
|
116
|
+
readonly workflowVisibilityMetaVersion: () => string;
|
|
117
|
+
readonly workflowVisibilityMetaBuiltAt: () => string;
|
|
118
|
+
readonly workflowVisibilityMetaCursor: () => string;
|
|
119
|
+
readonly workflowOwnerEpoch: (workflowId: string) => string;
|
|
120
|
+
readonly workflowOwnerHolder: (workflowId: string) => string;
|
|
121
|
+
readonly ownershipModeMarker: () => string;
|
|
85
122
|
readonly workflow: (id: string) => string;
|
|
86
123
|
readonly checkpoint: (id: string) => string;
|
|
87
124
|
readonly checkpointHistory: (id: string, step: number) => string;
|
|
@@ -139,40 +176,6 @@ declare const exportedKeys: {
|
|
|
139
176
|
readonly leasePrefix: () => string;
|
|
140
177
|
readonly leaseEpoch: () => string;
|
|
141
178
|
readonly leaseHolder: () => string;
|
|
142
|
-
readonly budget: (namespace: string, period: string, date: string) => string;
|
|
143
|
-
readonly review: (workflowId: string, reviewId: string) => string;
|
|
144
|
-
readonly workflowHeaders: (workflowId: string) => string;
|
|
145
|
-
readonly childCancellationPrefix: (workflowId: string) => string;
|
|
146
|
-
readonly childCancellation: (workflowId: string, childWorkflowId: string) => string;
|
|
147
|
-
readonly childWorkflowByParentPrefix: (parentWorkflowId: string, parentWorkflowExecutionToken?: string) => string;
|
|
148
|
-
readonly childWorkflowByParent: (parentWorkflowId: string, parentWorkflowExecutionToken: string | undefined, childWorkflowId: string) => string;
|
|
149
|
-
readonly terminalCleanupNeeded: (workflowId: string) => string;
|
|
150
|
-
readonly workflowConcurrency: (workflowType: string, partitionKey: string) => string;
|
|
151
|
-
readonly workflowConcurrencyHolder: (workflowId: string) => string;
|
|
152
|
-
readonly workflowHasServices: (workflowId: string) => string;
|
|
153
|
-
readonly finalizerState: (workflowId: string) => string;
|
|
154
|
-
readonly teardownOwed: (workflowId: string) => string;
|
|
155
|
-
readonly teardownSucceeded: (workflowId: string) => string;
|
|
156
|
-
readonly teardownDeadLetter: (workflowId: string) => string;
|
|
157
|
-
readonly offload: (workflowId: string, key: string) => string;
|
|
158
|
-
readonly archive: (workflowId: string, key: string) => string;
|
|
159
|
-
readonly stateExecution: (ownerWorkflowId: string, key: string) => string;
|
|
160
|
-
readonly stateWorkflow: (workflowType: string, key: string) => string;
|
|
161
|
-
readonly streamChunkPrefix: (workflowId: string, key: string) => string;
|
|
162
|
-
readonly streamChunk: (workflowId: string, key: string, chunkIndex: number) => string;
|
|
163
|
-
readonly streamTail: (workflowId: string, key: string) => string;
|
|
164
|
-
readonly streamMetadata: (workflowId: string, key: string) => string;
|
|
165
|
-
readonly budgetCharged: (operationId: string) => string;
|
|
166
|
-
readonly toolEffect: (workflowId: string, agentId: string, semanticHash: string) => string;
|
|
167
|
-
readonly workflowVisibilityStatus: (status: string, workflowId: string) => string;
|
|
168
|
-
readonly workflowVisibilityType: (type: string, workflowId: string) => string;
|
|
169
|
-
readonly workflowVisibilityCreated: (createdAt: number, workflowId: string) => string;
|
|
170
|
-
readonly workflowVisibilityUpdated: (updatedAt: number, workflowId: string) => string;
|
|
171
|
-
readonly workflowVisibilityDeadline: (deadline: number, workflowId: string) => string;
|
|
172
|
-
readonly workflowVisibilityManifest: (workflowId: string) => string;
|
|
173
|
-
readonly workflowVisibilityMetaVersion: () => string;
|
|
174
|
-
readonly workflowVisibilityMetaBuiltAt: () => string;
|
|
175
|
-
readonly workflowVisibilityMetaCursor: () => string;
|
|
176
179
|
};
|
|
177
180
|
/**
|
|
178
181
|
* Re-exported {@link MAX_BATCH_OPERATIONS}. See the original declaration for full docs.
|
|
@@ -353,7 +356,7 @@ declare const exportedTextValueStore: typeof textValueStore;
|
|
|
353
356
|
* void isWeftKey;
|
|
354
357
|
* ```
|
|
355
358
|
*/
|
|
356
|
-
declare const exportedWeftReservedKeyPrefixes: readonly ["actrec:", "archive:", "async-act:", "attr:", "audit:bulk:", "blob:", "budget:", "budget-charged:", "child-by-parent:", "ev:", "fleet-event-by-workflow:", "fleet-event:", "fleet-event-tail", "idx:", "lease:", "liveness:", "offload:", "op:", "review:", "schedule:", "schedule-due:", "schedule-run-by-schedule:", "schedule-run-link:", "schedule-run:", "sig:", "sigres:", "sigseq:", "start-idem:", "state:", "tag:", "tool-effect:", "upd:", "upk:", "upr:", "wf:", "wf-cleanup:", "wf-cleanup-needed:", "wf-concurrency:", "wf-concurrency-holder:", "wf-deadline:", "wf-delayed:", "wf-finalizer-state:", "wf-has-services:", "wf-headers:", "wf-idx-", "wf-teardown:", "wf-teardown-deadletter:", "wf-teardown-needed:", "wf-teardown-succeeded:", "wf-terminal:"];
|
|
359
|
+
declare const exportedWeftReservedKeyPrefixes: readonly ["actrec:", "archive:", "async-act:", "attr:", "audit:bulk:", "blob:", "budget:", "budget-charged:", "child-by-parent:", "ev:", "fleet-event-by-workflow:", "fleet-event:", "fleet-event-tail", "idx:", "lease:", "liveness:", "offload:", "ownership-mode-marker", "op:", "review:", "schedule:", "schedule-due:", "schedule-run-by-schedule:", "schedule-run-link:", "schedule-run:", "sig:", "sigres:", "sigseq:", "start-idem:", "state:", "tag:", "tool-effect:", "upd:", "upk:", "upr:", "wf:", "wf-cleanup:", "wf-cleanup-needed:", "wf-concurrency:", "wf-concurrency-holder:", "wf-deadline:", "wf-delayed:", "wf-finalizer-state:", "wf-has-services:", "wf-headers:", "wf-idx-", "wf-owner-epoch:", "wf-owner-holder:", "wf-teardown:", "wf-teardown-deadletter:", "wf-teardown-needed:", "wf-teardown-succeeded:", "wf-terminal:"];
|
|
357
360
|
/**
|
|
358
361
|
* Re-exported {@link withCodec}. See the original declaration for full docs.
|
|
359
362
|
*
|
|
@@ -298,57 +298,16 @@ export declare function storageBatch(storage: Storage, operations: BatchOperatio
|
|
|
298
298
|
* ```
|
|
299
299
|
*/
|
|
300
300
|
export declare function storageConditionalBatch(storage: Storage, conditions: ConditionalBatchCondition[], operations: BatchOperation[]): Promise<boolean>;
|
|
301
|
-
|
|
302
|
-
* Encode an untrusted string so it is safe to embed in a colon-delimited storage key.
|
|
303
|
-
*
|
|
304
|
-
* @example
|
|
305
|
-
* ```ts
|
|
306
|
-
* import { encodeStorageKeyComponent } from '@lostgradient/weft/storage/interface';
|
|
307
|
-
*
|
|
308
|
-
* const safe = encodeStorageKeyComponent('user:123/profile');
|
|
309
|
-
* console.log(safe); // 'user%3A123%2Fprofile'
|
|
310
|
-
* ```
|
|
311
|
-
*/
|
|
312
|
-
export declare function encodeStorageKeyComponent(value: string): string;
|
|
313
|
-
/**
|
|
314
|
-
* Decode a storage-key component produced by {@link encodeStorageKeyComponent}.
|
|
315
|
-
* Throws when `value` is malformed percent-encoded text. Callers handling
|
|
316
|
-
* untrusted input should prefer {@link tryDecodeStorageKeyComponent}.
|
|
317
|
-
*
|
|
318
|
-
* @throws {URIError} When `value` contains malformed percent-encoded data.
|
|
319
|
-
*
|
|
320
|
-
* @example
|
|
321
|
-
* ```ts
|
|
322
|
-
* import { encodeStorageKeyComponent, decodeStorageKeyComponent } from '@lostgradient/weft/storage/interface';
|
|
323
|
-
*
|
|
324
|
-
* const encoded = encodeStorageKeyComponent('user:123');
|
|
325
|
-
* const decoded = decodeStorageKeyComponent(encoded);
|
|
326
|
-
* console.log(decoded); // 'user:123'
|
|
327
|
-
* ```
|
|
328
|
-
*/
|
|
329
|
-
export declare function decodeStorageKeyComponent(value: string): string;
|
|
330
|
-
/**
|
|
331
|
-
* Decode a storage-key component produced by {@link encodeStorageKeyComponent}.
|
|
332
|
-
* Returns `null` when the component is malformed instead of throwing.
|
|
333
|
-
*
|
|
334
|
-
* @example
|
|
335
|
-
* ```ts
|
|
336
|
-
* import { tryDecodeStorageKeyComponent } from '@lostgradient/weft/storage/interface';
|
|
337
|
-
*
|
|
338
|
-
* console.log(tryDecodeStorageKeyComponent('user%3A123')); // 'user:123'
|
|
339
|
-
* console.log(tryDecodeStorageKeyComponent('%GG')); // null
|
|
340
|
-
* ```
|
|
341
|
-
*/
|
|
342
|
-
export declare function tryDecodeStorageKeyComponent(value: string): string | null;
|
|
301
|
+
export { decodeStorageKeyComponent, encodeStorageKeyComponent, tryDecodeStorageKeyComponent, } from './key-encoding.ts';
|
|
343
302
|
/**
|
|
344
303
|
* Key layout constants for hierarchical key encoding. Timestamps are
|
|
345
304
|
* zero-padded to 16 digits for lexicographic ordering.
|
|
346
305
|
*
|
|
347
306
|
* This registry grows as storage features are added, which is why this file
|
|
348
|
-
* carries a `max-lines
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
307
|
+
* carries a `max-lines` override in `.oxlintrc.json` above the repository
|
|
308
|
+
* default of 500. Extracting `KEYS` into its own module — and dropping the
|
|
309
|
+
* override — is tracked in WFT-90. Prefer adding new key families as a separate
|
|
310
|
+
* module spread into `KEYS` (see `ownership-keys.ts`) over growing this file.
|
|
352
311
|
*
|
|
353
312
|
* @example
|
|
354
313
|
* ```ts
|
|
@@ -357,6 +316,88 @@ export declare function tryDecodeStorageKeyComponent(value: string): string | nu
|
|
|
357
316
|
* ```
|
|
358
317
|
*/
|
|
359
318
|
export declare const KEYS: {
|
|
319
|
+
readonly budget: (namespace: string, period: string, date: string) => string;
|
|
320
|
+
readonly review: (workflowId: string, reviewId: string) => string;
|
|
321
|
+
readonly workflowHeaders: (workflowId: string) => string;
|
|
322
|
+
readonly childCancellationPrefix: (workflowId: string) => string;
|
|
323
|
+
readonly childCancellation: (workflowId: string, childWorkflowId: string) => string;
|
|
324
|
+
readonly childWorkflowByParentPrefix: (parentWorkflowId: string, parentWorkflowExecutionToken?: string) => string;
|
|
325
|
+
readonly childWorkflowByParent: (parentWorkflowId: string, parentWorkflowExecutionToken: string | undefined, childWorkflowId: string) => string;
|
|
326
|
+
readonly terminalCleanupNeeded: (workflowId: string) => string;
|
|
327
|
+
readonly workflowConcurrency: (workflowType: string, partitionKey: string) => string;
|
|
328
|
+
readonly workflowConcurrencyHolder: (workflowId: string) => string;
|
|
329
|
+
/**
|
|
330
|
+
* Presence-only marker written at start only when a run is launched with a
|
|
331
|
+
* non-serialized `services` value (see `start-batch.ts`). It lets a
|
|
332
|
+
* fresh-process recovery tell a run whose services were lost on crash apart
|
|
333
|
+
* from one that never had any — the services value itself is never persisted,
|
|
334
|
+
* so this bit is the only durable trace. Cleared on terminal cleanup.
|
|
335
|
+
*/
|
|
336
|
+
readonly workflowHasServices: (workflowId: string) => string;
|
|
337
|
+
/**
|
|
338
|
+
* Last-write-wins payload that `ctx.setFinalizerState(value)` records for a
|
|
339
|
+
* workflow's definition-level `finalizer` activity (issue #446). Staged as a
|
|
340
|
+
* pending atomic side-effect so it commits with the next checkpoint or the
|
|
341
|
+
* terminal batch, and swept on terminal cleanup.
|
|
342
|
+
*
|
|
343
|
+
* **Current behavior (this release): recorded only.** Nothing reads this value
|
|
344
|
+
* yet. **Planned behavior (future release):** the engine will pass the decoded
|
|
345
|
+
* value as the finalizer's input when driving teardown after a
|
|
346
|
+
* `cancelled`/`timed-out` terminal, where presence means "a resource was
|
|
347
|
+
* recorded" and absence means the finalizer is skipped.
|
|
348
|
+
*/
|
|
349
|
+
readonly finalizerState: (workflowId: string) => string;
|
|
350
|
+
/**
|
|
351
|
+
* Durable execution-claim + attempt marker for a workflow that owes a finalizer
|
|
352
|
+
* run after a `cancelled`/`timed-out` terminal (issue #446 Phase 2). Mirrors the
|
|
353
|
+
* `wf-cleanup-needed:` lifecycle. The value is the encoded claim record
|
|
354
|
+
* `{ status: 'owed' | 'running'; attempts: number; token: string; claimedAt?: number }`:
|
|
355
|
+
* the engine fenced-CAS's `owed → running` (stamping `claimedAt`) before invoking the
|
|
356
|
+
* finalizer, and settle-CAS's the exact `running` bytes it wrote when clearing or
|
|
357
|
+
* rescheduling. Liveness is decided purely by TIME: a `running` claim is reclaimable
|
|
358
|
+
* once `claimedAt` is older than the finalizer's per-attempt timeout plus a margin
|
|
359
|
+
* (see `teardownStaleThresholdMs`), so crash recovery is an ordinary stale-claim retry
|
|
360
|
+
* driven by the timer that survived the terminal batch — there is no in-memory liveness
|
|
361
|
+
* set and no epoch in the record. The cost is that a finalizer running past the stale
|
|
362
|
+
* threshold may be re-driven concurrently, which is why workflow finalizers must be
|
|
363
|
+
* idempotent. Present while teardown is outstanding; deleted by the finalizer on
|
|
364
|
+
* success or when it dead-letters, which is what unblocks purge.
|
|
365
|
+
*/
|
|
366
|
+
readonly teardownOwed: (workflowId: string) => string;
|
|
367
|
+
/** Durable successful finalizer outcome, retained until workflow purge or retention. */
|
|
368
|
+
readonly teardownSucceeded: (workflowId: string) => string;
|
|
369
|
+
/**
|
|
370
|
+
* Durable audit record written when a workflow's finalizer permanently fails — the
|
|
371
|
+
* retry horizon is reached, or the recorded resource state vanished so the finalizer
|
|
372
|
+
* can never run (issue #446 Phase 2). Holds the `TeardownDeadLetterRecord` shape
|
|
373
|
+
* `{ type, lastError, attempts, deadLetteredAt, workflowExecutionToken?, finalizerInput? }`.
|
|
374
|
+
* **Excluded from the workflow purge delete-set** so it survives as the operator's
|
|
375
|
+
* evidence of a leaked external resource and remains queryable through the durable
|
|
376
|
+
* finalizer-status API after purge.
|
|
377
|
+
*/
|
|
378
|
+
readonly teardownDeadLetter: (workflowId: string) => string;
|
|
379
|
+
readonly offload: (workflowId: string, key: string) => string;
|
|
380
|
+
readonly archive: (workflowId: string, key: string) => string;
|
|
381
|
+
readonly stateExecution: (ownerWorkflowId: string, key: string) => string;
|
|
382
|
+
readonly stateWorkflow: (workflowType: string, key: string) => string;
|
|
383
|
+
readonly streamChunkPrefix: (workflowId: string, key: string) => string;
|
|
384
|
+
readonly streamChunk: (workflowId: string, key: string, chunkIndex: number) => string;
|
|
385
|
+
readonly streamTail: (workflowId: string, key: string) => string;
|
|
386
|
+
readonly streamMetadata: (workflowId: string, key: string) => string;
|
|
387
|
+
readonly budgetCharged: (operationId: string) => string;
|
|
388
|
+
readonly toolEffect: (workflowId: string, agentId: string, semanticHash: string) => string;
|
|
389
|
+
readonly workflowVisibilityStatus: (status: string, workflowId: string) => string;
|
|
390
|
+
readonly workflowVisibilityType: (type: string, workflowId: string) => string;
|
|
391
|
+
readonly workflowVisibilityCreated: (createdAt: number, workflowId: string) => string;
|
|
392
|
+
readonly workflowVisibilityUpdated: (updatedAt: number, workflowId: string) => string;
|
|
393
|
+
readonly workflowVisibilityDeadline: (deadline: number, workflowId: string) => string;
|
|
394
|
+
readonly workflowVisibilityManifest: (workflowId: string) => string;
|
|
395
|
+
readonly workflowVisibilityMetaVersion: () => string;
|
|
396
|
+
readonly workflowVisibilityMetaBuiltAt: () => string;
|
|
397
|
+
readonly workflowVisibilityMetaCursor: () => string;
|
|
398
|
+
readonly workflowOwnerEpoch: (workflowId: string) => string;
|
|
399
|
+
readonly workflowOwnerHolder: (workflowId: string) => string;
|
|
400
|
+
readonly ownershipModeMarker: () => string;
|
|
360
401
|
readonly workflow: (id: string) => string;
|
|
361
402
|
readonly checkpoint: (id: string) => string;
|
|
362
403
|
readonly checkpointHistory: (id: string, step: number) => string;
|
|
@@ -472,83 +513,4 @@ export declare const KEYS: {
|
|
|
472
513
|
* {@link KEYS.leaseEpoch}.
|
|
473
514
|
*/
|
|
474
515
|
readonly leaseHolder: () => string;
|
|
475
|
-
readonly budget: (namespace: string, period: string, date: string) => string;
|
|
476
|
-
readonly review: (workflowId: string, reviewId: string) => string;
|
|
477
|
-
readonly workflowHeaders: (workflowId: string) => string;
|
|
478
|
-
readonly childCancellationPrefix: (workflowId: string) => string;
|
|
479
|
-
readonly childCancellation: (workflowId: string, childWorkflowId: string) => string;
|
|
480
|
-
readonly childWorkflowByParentPrefix: (parentWorkflowId: string, parentWorkflowExecutionToken?: string) => string;
|
|
481
|
-
readonly childWorkflowByParent: (parentWorkflowId: string, parentWorkflowExecutionToken: string | undefined, childWorkflowId: string) => string;
|
|
482
|
-
readonly terminalCleanupNeeded: (workflowId: string) => string;
|
|
483
|
-
readonly workflowConcurrency: (workflowType: string, partitionKey: string) => string;
|
|
484
|
-
readonly workflowConcurrencyHolder: (workflowId: string) => string;
|
|
485
|
-
/**
|
|
486
|
-
* Presence-only marker written at start only when a run is launched with a
|
|
487
|
-
* non-serialized `services` value (see `start-batch.ts`). It lets a
|
|
488
|
-
* fresh-process recovery tell a run whose services were lost on crash apart
|
|
489
|
-
* from one that never had any — the services value itself is never persisted,
|
|
490
|
-
* so this bit is the only durable trace. Cleared on terminal cleanup.
|
|
491
|
-
*/
|
|
492
|
-
readonly workflowHasServices: (workflowId: string) => string;
|
|
493
|
-
/**
|
|
494
|
-
* Last-write-wins payload that `ctx.setFinalizerState(value)` records for a
|
|
495
|
-
* workflow's definition-level `finalizer` activity (issue #446). Staged as a
|
|
496
|
-
* pending atomic side-effect so it commits with the next checkpoint or the
|
|
497
|
-
* terminal batch, and swept on terminal cleanup.
|
|
498
|
-
*
|
|
499
|
-
* **Current behavior (this release): recorded only.** Nothing reads this value
|
|
500
|
-
* yet. **Planned behavior (future release):** the engine will pass the decoded
|
|
501
|
-
* value as the finalizer's input when driving teardown after a
|
|
502
|
-
* `cancelled`/`timed-out` terminal, where presence means "a resource was
|
|
503
|
-
* recorded" and absence means the finalizer is skipped.
|
|
504
|
-
*/
|
|
505
|
-
readonly finalizerState: (workflowId: string) => string;
|
|
506
|
-
/**
|
|
507
|
-
* Durable execution-claim + attempt marker for a workflow that owes a finalizer
|
|
508
|
-
* run after a `cancelled`/`timed-out` terminal (issue #446 Phase 2). Mirrors the
|
|
509
|
-
* `wf-cleanup-needed:` lifecycle. The value is the encoded claim record
|
|
510
|
-
* `{ status: 'owed' | 'running'; attempts: number; token: string; claimedAt?: number }`:
|
|
511
|
-
* the engine fenced-CAS's `owed → running` (stamping `claimedAt`) before invoking the
|
|
512
|
-
* finalizer, and settle-CAS's the exact `running` bytes it wrote when clearing or
|
|
513
|
-
* rescheduling. Liveness is decided purely by TIME: a `running` claim is reclaimable
|
|
514
|
-
* once `claimedAt` is older than the finalizer's per-attempt timeout plus a margin
|
|
515
|
-
* (see `teardownStaleThresholdMs`), so crash recovery is an ordinary stale-claim retry
|
|
516
|
-
* driven by the timer that survived the terminal batch — there is no in-memory liveness
|
|
517
|
-
* set and no epoch in the record. The cost is that a finalizer running past the stale
|
|
518
|
-
* threshold may be re-driven concurrently, which is why workflow finalizers must be
|
|
519
|
-
* idempotent. Present while teardown is outstanding; deleted by the finalizer on
|
|
520
|
-
* success or when it dead-letters, which is what unblocks purge.
|
|
521
|
-
*/
|
|
522
|
-
readonly teardownOwed: (workflowId: string) => string;
|
|
523
|
-
/** Durable successful finalizer outcome, retained until workflow purge or retention. */
|
|
524
|
-
readonly teardownSucceeded: (workflowId: string) => string;
|
|
525
|
-
/**
|
|
526
|
-
* Durable audit record written when a workflow's finalizer permanently fails — the
|
|
527
|
-
* retry horizon is reached, or the recorded resource state vanished so the finalizer
|
|
528
|
-
* can never run (issue #446 Phase 2). Holds the `TeardownDeadLetterRecord` shape
|
|
529
|
-
* `{ type, lastError, attempts, deadLetteredAt, workflowExecutionToken?, finalizerInput? }`.
|
|
530
|
-
* **Excluded from the workflow purge delete-set** so it survives as the operator's
|
|
531
|
-
* evidence of a leaked external resource and remains queryable through the durable
|
|
532
|
-
* finalizer-status API after purge.
|
|
533
|
-
*/
|
|
534
|
-
readonly teardownDeadLetter: (workflowId: string) => string;
|
|
535
|
-
readonly offload: (workflowId: string, key: string) => string;
|
|
536
|
-
readonly archive: (workflowId: string, key: string) => string;
|
|
537
|
-
readonly stateExecution: (ownerWorkflowId: string, key: string) => string;
|
|
538
|
-
readonly stateWorkflow: (workflowType: string, key: string) => string;
|
|
539
|
-
readonly streamChunkPrefix: (workflowId: string, key: string) => string;
|
|
540
|
-
readonly streamChunk: (workflowId: string, key: string, chunkIndex: number) => string;
|
|
541
|
-
readonly streamTail: (workflowId: string, key: string) => string;
|
|
542
|
-
readonly streamMetadata: (workflowId: string, key: string) => string;
|
|
543
|
-
readonly budgetCharged: (operationId: string) => string;
|
|
544
|
-
readonly toolEffect: (workflowId: string, agentId: string, semanticHash: string) => string;
|
|
545
|
-
readonly workflowVisibilityStatus: (status: string, workflowId: string) => string;
|
|
546
|
-
readonly workflowVisibilityType: (type: string, workflowId: string) => string;
|
|
547
|
-
readonly workflowVisibilityCreated: (createdAt: number, workflowId: string) => string;
|
|
548
|
-
readonly workflowVisibilityUpdated: (updatedAt: number, workflowId: string) => string;
|
|
549
|
-
readonly workflowVisibilityDeadline: (deadline: number, workflowId: string) => string;
|
|
550
|
-
readonly workflowVisibilityManifest: (workflowId: string) => string;
|
|
551
|
-
readonly workflowVisibilityMetaVersion: () => string;
|
|
552
|
-
readonly workflowVisibilityMetaBuiltAt: () => string;
|
|
553
|
-
readonly workflowVisibilityMetaCursor: () => string;
|
|
554
516
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
2
|
+
var K=import.meta.require;function X(E,_,P){if(!E.capabilities()[_])throw Error(`Feature "${P}" requires storage capability "${_}", but this storage backend does not provide it.`)}function J(E){let _=E.capabilities(),P=[];if(_.persistence!=="local"&&_.persistence!=="remote")P.push(`persistence must be "local" or "remote" (got "${_.persistence}")`);if(_.readAfterWrite!=="linearizable")P.push(`readAfterWrite must be "linearizable" (got "${_.readAfterWrite}")`);if(_.scanConsistency!=="snapshot")P.push(`scanConsistency must be "snapshot" (got "${_.scanConsistency}")`);if(!_.atomicBatch)P.push("atomicBatch must be true");if(!_.conditionalBatch)P.push("conditionalBatch must be true");if(P.length>0)throw Error(`Storage is not durable enough for recovery: ${P.join("; ")}.`)}var S="default";async function M(E,_){return await E.get(_)!==null}async function*U(E,_,P){for await(let[R]of E.scan(_,P))yield R}async function Q(E,_){let P=0;for await(let R of U(E,_))P++;return P}async function Z(E,_){let P=[];for await(let R of U(E,_))P.push({type:"delete",key:R});if(P.length===0)return 0;return await E.batch(P),P.length}async function W(E,_,P){let R=[];for await(let B of U(E,_,P))R.push({type:"delete",key:B});if(R.length===0)return 0;return await E.batch(R),R.length}function F(E){return encodeURIComponent(E)}function O(E){return decodeURIComponent(E)}function G(E){try{return decodeURIComponent(E)}catch{return null}}var $={workflowOwnerEpoch:(E)=>`wf-owner-epoch:${F(E)}`,workflowOwnerHolder:(E)=>`wf-owner-holder:${F(E)}`,ownershipModeMarker:()=>"ownership-mode-marker"};var H=["actrec:","archive:","async-act:","attr:","audit:bulk:","blob:","budget:","budget-charged:","child-by-parent:","ev:","fleet-event-by-workflow:","fleet-event:","fleet-event-tail","idx:","lease:","liveness:","offload:","ownership-mode-marker","op:","review:","schedule:","schedule-due:","schedule-run-by-schedule:","schedule-run-link:","schedule-run:","sig:","sigres:","sigseq:","start-idem:","state:","tag:","tool-effect:","upd:","upk:","upr:","wf:","wf-cleanup:","wf-cleanup-needed:","wf-concurrency:","wf-concurrency-holder:","wf-deadline:","wf-delayed:","wf-finalizer-state:","wf-has-services:","wf-headers:","wf-idx-","wf-owner-epoch:","wf-owner-holder:","wf-teardown:","wf-teardown-deadletter:","wf-teardown-needed:","wf-teardown-succeeded:","wf-terminal:"];var L=1e4,p=1e4;class z extends Error{code="StorageBatchOperationLimitExceededError";cap=L;count;target;constructor(E,_){super(`${E} count ${_} exceeds MAX_BATCH_OPERATIONS (${L}).`);this.name="StorageBatchOperationLimitExceededError",this.target=E,this.count=_}}function V(E,_){if(_>L)throw new z(E,_)}function I(E){return E.length>0?E.slice(0,-1)+String.fromCharCode(E.charCodeAt(E.length-1)+1):"\xFF"}function f(E,_={}){if(_.gt!==void 0&&E<=_.gt)return!1;if(_.gte!==void 0&&E<_.gte)return!1;if(_.lt!==void 0&&E>=_.lt)return!1;if(_.lte!==void 0&&E>_.lte)return!1;return!0}function s(E,_){if(E===null||_===null)return E===_;if(E.byteLength!==_.byteLength)return!1;for(let P=0;P<E.byteLength;P++)if(E[P]!==_[P])return!1;return!0}async function n(E,_){if(E.has)return E.has(_);return M(E,_)}function a(E,_,P){if(E.keys)return E.keys(_,P);return U(E,_,P)}async function l(E,_){if(E.count)return E.count(_);return Q(E,_)}async function k(E,_){if(E.deletePrefix)return E.deletePrefix(_);return Z(E,_)}async function i(E,_){V("batch operations",_.length),await E.batch(_)}async function d(E,_,P){if(V("conditionalBatch conditions",_.length),V("conditionalBatch operations",P.length),X(E,"conditionalBatch","storageConditionalBatch"),!E.conditionalBatch)throw Error("This storage backend reports conditionalBatch capability but does not implement the conditionalBatch() method.");return E.conditionalBatch(_,P)}var Y=(E)=>String(E).padStart(16,"0"),D="0",v="1",j=(E,_,P,R)=>`sig:${F(E)}:${F(_)}:${R}:${F(P)}`,w={workflow:(E)=>`wf:${F(E)}`,checkpoint:(E)=>`wf:${F(E)}:ckpt`,checkpointHistory:(E,_)=>`wf:${F(E)}:ckpt:${String(_).padStart(10,"0")}`,timelinePrefix:(E)=>`wf:${F(E)}:timeline:`,timeline:(E,_)=>`wf:${F(E)}:timeline:${String(_).padStart(10,"0")}`,schedule:(E)=>`schedule:${F(E)}`,scheduleTick:(E,_)=>`schedule-due:${String(E).padStart(16,"0")}:${F(_)}`,scheduleRun:(E)=>`schedule-run:${F(E)}`,scheduleRunLink:(E)=>`schedule-run-link:${F(E)}`,scheduleRunBySchedulePrefix:(E)=>`schedule-run-by-schedule:${F(E)}:`,scheduleRunBySchedule:(E,_)=>`schedule-run-by-schedule:${F(E)}:${F(_)}`,operation:(E,_,P)=>`op:${E}:${Y(_)}:${P}`,operationInflight:(E)=>`op:inflight:${E}`,operationQueued:(E)=>`op:queued:${E}`,operationResolved:(E)=>`op:resolved:${E}`,bulkOperationAuditPrefix:()=>"audit:bulk:",bulkOperationAudit:(E,_,P)=>`audit:bulk:${Y(E)}:${F(_)}:${F(P)}`,operationResolvedByTimePrefix:()=>"op:resolved-by-time:",operationResolvedByTime:(E,_)=>`op:resolved-by-time:${Y(E)}:${F(_)}`,asyncActivity:(E,_)=>`async-act:v1:${F(E)}:${F(_)}`,asyncActivityResolution:(E,_)=>`async-act:v1:${F(E)}:${F(_)}:resolution`,activityReconciliationPrefix:(E)=>`actrec:v1:${F(E)}:`,activityReconciliation:(E,_,P)=>`actrec:v1:${F(E)}:${F(_)}:${P}`,eventPrefix:(E)=>`ev:${F(E)}:`,event:(E,_)=>`ev:${F(E)}:${String(_).padStart(10,"0")}`,eventHead:(E)=>`ev:${F(E)}:head`,eventWatermark:(E)=>`ev:${F(E)}:watermark`,fleetEventPrefix:()=>"fleet-event:",fleetEvent:(E)=>`fleet-event:${String(E).padStart(10,"0")}`,fleetEventTail:()=>"fleet-event-tail",fleetEventByWorkflowPrefix:(E)=>`fleet-event-by-workflow:${F(E)}:`,fleetEventByWorkflow:(E,_)=>`fleet-event-by-workflow:${F(E)}:${String(_).padStart(10,"0")}`,signal:(E,_,P)=>j(E,_,P,v),startSignal:(E,_,P)=>j(E,_,P,D),signalSequence:(E)=>`sigseq:v1:${F(E)}`,signalAcceptedResponsePrefix:(E)=>`sigres:v1:${F(E)}:`,signalAcceptedResponse:(E,_,P)=>`sigres:v1:${F(E)}:${F(_)}:${F(P)}`,deadline:(E,_)=>`wf-deadline:${Y(E)}:${F(_)}`,terminalCleanup:(E,_)=>`wf-cleanup:${Y(E)}:${F(_)}`,teardownTimer:(E,_)=>`wf-teardown:${Y(E)}:${F(_)}`,delayedStart:(E,_)=>`wf-delayed:${Y(E)}:${F(_)}`,terminalWorkflowPrefix:()=>"wf-terminal:",terminalWorkflow:(E,_)=>`wf-terminal:${Y(E)}:${F(_)}`,attribute:(E)=>`attr:${F(E)}`,attributeIndex:(E,_,P)=>`idx:${E}:${_}:${F(P)}`,tagIndex:(E,_)=>`tag:${F(E)}:${F(_)}`,updatePrefix:(E)=>`upd:${F(E)}:`,update:(E,_)=>`upd:${F(E)}:${_}`,updateResponse:(E)=>`upr:${E}`,updateIdempotency:(E,_)=>`upk:${F(E)}:${_}`,startIdempotency:(E)=>`start-idem:${F(E)}`,startIdempotencySignalId:(E)=>`start-idem:${E}`,livenessPrefix:()=>"liveness:",liveness:(E)=>`liveness:${F(E)}`,leasePrefix:()=>"lease:",leaseEpoch:()=>"lease:epoch",leaseHolder:()=>"lease:holder",...$,budget:(E,_,P)=>`budget:${E}:${_}:${P}`,review:(E,_)=>`review:${F(E)}:${_}`,workflowHeaders:(E)=>`wf-headers:${F(E)}`,childCancellationPrefix:(E)=>`child-cancel:${F(E)}:`,childCancellation:(E,_)=>`child-cancel:${F(E)}:${F(_)}`,childWorkflowByParentPrefix:(E,_)=>`child-by-parent:${F(E)}:${_===void 0?"":`${F(_)}:`}`,childWorkflowByParent:(E,_,P)=>`child-by-parent:${F(E)}:${_===void 0?"":`${F(_)}:`}${F(P)}`,terminalCleanupNeeded:(E)=>`wf-cleanup-needed:${F(E)}`,workflowConcurrency:(E,_)=>`wf-concurrency:${F(E)}:${F(_)}`,workflowConcurrencyHolder:(E)=>`wf-concurrency-holder:${F(E)}`,workflowHasServices:(E)=>`wf-has-services:${F(E)}`,finalizerState:(E)=>`wf-finalizer-state:${F(E)}`,teardownOwed:(E)=>`wf-teardown-needed:${F(E)}`,teardownSucceeded:(E)=>`wf-teardown-succeeded:${F(E)}`,teardownDeadLetter:(E)=>`wf-teardown-deadletter:${F(E)}`,offload:(E,_)=>`offload:${F(E)}:${_}`,archive:(E,_)=>`archive:${F(E)}:${_}`,stateExecution:(E,_)=>`state:execution:${F(E)}:${F(_)}`,stateWorkflow:(E,_)=>`state:workflow-scope:${S}:${F(E)}:${F(_)}`,streamChunkPrefix:(E,_)=>`blob:${F(E)}:${_}:chunk:`,streamChunk:(E,_,P)=>`blob:${F(E)}:${_}:chunk:${String(P).padStart(10,"0")}`,streamTail:(E,_)=>`blob:${F(E)}:${_}:tail`,streamMetadata:(E,_)=>`blob:${F(E)}:${_}:meta`,budgetCharged:(E)=>`budget-charged:${E}`,toolEffect:(E,_,P)=>`tool-effect:${F(E)}:${_}:${P}`,workflowVisibilityStatus:(E,_)=>`wf-idx-status:${F(E)}:${F(_)}`,workflowVisibilityType:(E,_)=>`wf-idx-type:${F(E)}:${F(_)}`,workflowVisibilityCreated:(E,_)=>`wf-idx-created:${Y(E)}:${F(_)}`,workflowVisibilityUpdated:(E,_)=>`wf-idx-updated:${Y(E)}:${F(_)}`,workflowVisibilityDeadline:(E,_)=>`wf-idx-deadline:${Y(E)}:${F(_)}`,workflowVisibilityManifest:(E)=>`wf-idx-manifest:${F(E)}`,workflowVisibilityMetaVersion:()=>"wf-idx-meta:version",workflowVisibilityMetaBuiltAt:()=>"wf-idx-meta:built-at",workflowVisibilityMetaCursor:()=>"wf-idx-meta:cursor"};export{G as tryDecodeStorageKeyComponent,s as storageValuesEqual,a as storageKeys,n as storageHas,k as storageDeletePrefix,l as storageCount,d as storageConditionalBatch,i as storageBatch,I as resolvePrefixRangeEnd,X as requireStorageCapability,f as matchesScanOptions,F as encodeStorageKeyComponent,O as decodeStorageKeyComponent,V as assertStorageBatchOperationCount,J as assertDurableStorageForRecovery,H as WEFT_RESERVED_KEY_PREFIXES,z as StorageBatchOperationLimitExceededError,p as MAX_SCAN_LIMIT,L as MAX_BATCH_OPERATIONS,w as KEYS,S as DEFAULT_SCOPE};
|