gitx.do 0.1.1 → 0.1.3
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 +40 -353
- package/dist/do/logger.d.ts +50 -0
- package/dist/do/logger.d.ts.map +1 -0
- package/dist/do/logger.js +122 -0
- package/dist/do/logger.js.map +1 -0
- package/dist/{durable-object → do}/schema.d.ts +3 -3
- package/dist/do/schema.d.ts.map +1 -0
- package/dist/{durable-object → do}/schema.js +4 -3
- package/dist/do/schema.js.map +1 -0
- package/dist/do/types.d.ts +267 -0
- package/dist/do/types.d.ts.map +1 -0
- package/dist/do/types.js +62 -0
- package/dist/do/types.js.map +1 -0
- package/dist/index.d.ts +15 -469
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -481
- package/dist/index.js.map +1 -1
- package/dist/mcp/auth.d.ts +77 -0
- package/dist/mcp/auth.d.ts.map +1 -0
- package/dist/mcp/auth.js +278 -0
- package/dist/mcp/auth.js.map +1 -0
- package/dist/mcp/index.d.ts +13 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +19 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +200 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +275 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-registry.d.ts +47 -0
- package/dist/mcp/tool-registry.d.ts.map +1 -0
- package/dist/mcp/tool-registry.js +284 -0
- package/dist/mcp/tool-registry.js.map +1 -0
- package/dist/mcp/tools.d.ts +103 -515
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +676 -3087
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/types.d.ts +124 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +9 -0
- package/dist/mcp/types.js.map +1 -0
- package/package.json +19 -21
- package/dist/cli/commands/add.d.ts +0 -176
- package/dist/cli/commands/add.d.ts.map +0 -1
- package/dist/cli/commands/add.js +0 -979
- package/dist/cli/commands/add.js.map +0 -1
- package/dist/cli/commands/blame.d.ts +0 -259
- package/dist/cli/commands/blame.d.ts.map +0 -1
- package/dist/cli/commands/blame.js +0 -609
- package/dist/cli/commands/blame.js.map +0 -1
- package/dist/cli/commands/branch.d.ts +0 -249
- package/dist/cli/commands/branch.d.ts.map +0 -1
- package/dist/cli/commands/branch.js +0 -693
- package/dist/cli/commands/branch.js.map +0 -1
- package/dist/cli/commands/checkout.d.ts +0 -73
- package/dist/cli/commands/checkout.d.ts.map +0 -1
- package/dist/cli/commands/checkout.js +0 -725
- package/dist/cli/commands/checkout.js.map +0 -1
- package/dist/cli/commands/commit.d.ts +0 -182
- package/dist/cli/commands/commit.d.ts.map +0 -1
- package/dist/cli/commands/commit.js +0 -457
- package/dist/cli/commands/commit.js.map +0 -1
- package/dist/cli/commands/diff.d.ts +0 -464
- package/dist/cli/commands/diff.d.ts.map +0 -1
- package/dist/cli/commands/diff.js +0 -959
- package/dist/cli/commands/diff.js.map +0 -1
- package/dist/cli/commands/log.d.ts +0 -239
- package/dist/cli/commands/log.d.ts.map +0 -1
- package/dist/cli/commands/log.js +0 -535
- package/dist/cli/commands/log.js.map +0 -1
- package/dist/cli/commands/merge.d.ts +0 -106
- package/dist/cli/commands/merge.d.ts.map +0 -1
- package/dist/cli/commands/merge.js +0 -852
- package/dist/cli/commands/merge.js.map +0 -1
- package/dist/cli/commands/review.d.ts +0 -457
- package/dist/cli/commands/review.d.ts.map +0 -1
- package/dist/cli/commands/review.js +0 -558
- package/dist/cli/commands/review.js.map +0 -1
- package/dist/cli/commands/stash.d.ts +0 -157
- package/dist/cli/commands/stash.d.ts.map +0 -1
- package/dist/cli/commands/stash.js +0 -655
- package/dist/cli/commands/stash.js.map +0 -1
- package/dist/cli/commands/status.d.ts +0 -269
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/status.js +0 -492
- package/dist/cli/commands/status.js.map +0 -1
- package/dist/cli/commands/web.d.ts +0 -199
- package/dist/cli/commands/web.d.ts.map +0 -1
- package/dist/cli/commands/web.js +0 -697
- package/dist/cli/commands/web.js.map +0 -1
- package/dist/cli/fs-adapter.d.ts +0 -656
- package/dist/cli/fs-adapter.d.ts.map +0 -1
- package/dist/cli/fs-adapter.js +0 -1177
- package/dist/cli/fs-adapter.js.map +0 -1
- package/dist/cli/fsx-cli-adapter.d.ts +0 -359
- package/dist/cli/fsx-cli-adapter.d.ts.map +0 -1
- package/dist/cli/fsx-cli-adapter.js +0 -619
- package/dist/cli/fsx-cli-adapter.js.map +0 -1
- package/dist/cli/index.d.ts +0 -387
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -579
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/ui/components/DiffView.d.ts +0 -12
- package/dist/cli/ui/components/DiffView.d.ts.map +0 -1
- package/dist/cli/ui/components/DiffView.js +0 -11
- package/dist/cli/ui/components/DiffView.js.map +0 -1
- package/dist/cli/ui/components/ErrorDisplay.d.ts +0 -10
- package/dist/cli/ui/components/ErrorDisplay.d.ts.map +0 -1
- package/dist/cli/ui/components/ErrorDisplay.js +0 -11
- package/dist/cli/ui/components/ErrorDisplay.js.map +0 -1
- package/dist/cli/ui/components/FuzzySearch.d.ts +0 -15
- package/dist/cli/ui/components/FuzzySearch.d.ts.map +0 -1
- package/dist/cli/ui/components/FuzzySearch.js +0 -12
- package/dist/cli/ui/components/FuzzySearch.js.map +0 -1
- package/dist/cli/ui/components/LoadingSpinner.d.ts +0 -10
- package/dist/cli/ui/components/LoadingSpinner.d.ts.map +0 -1
- package/dist/cli/ui/components/LoadingSpinner.js +0 -10
- package/dist/cli/ui/components/LoadingSpinner.js.map +0 -1
- package/dist/cli/ui/components/NavigationList.d.ts +0 -14
- package/dist/cli/ui/components/NavigationList.d.ts.map +0 -1
- package/dist/cli/ui/components/NavigationList.js +0 -11
- package/dist/cli/ui/components/NavigationList.js.map +0 -1
- package/dist/cli/ui/components/ScrollableContent.d.ts +0 -13
- package/dist/cli/ui/components/ScrollableContent.d.ts.map +0 -1
- package/dist/cli/ui/components/ScrollableContent.js +0 -11
- package/dist/cli/ui/components/ScrollableContent.js.map +0 -1
- package/dist/cli/ui/components/index.d.ts +0 -7
- package/dist/cli/ui/components/index.d.ts.map +0 -1
- package/dist/cli/ui/components/index.js +0 -9
- package/dist/cli/ui/components/index.js.map +0 -1
- package/dist/cli/ui/terminal-ui.d.ts +0 -85
- package/dist/cli/ui/terminal-ui.d.ts.map +0 -1
- package/dist/cli/ui/terminal-ui.js +0 -121
- package/dist/cli/ui/terminal-ui.js.map +0 -1
- package/dist/do/BashModule.d.ts +0 -871
- package/dist/do/BashModule.d.ts.map +0 -1
- package/dist/do/BashModule.js +0 -1143
- package/dist/do/BashModule.js.map +0 -1
- package/dist/do/FsModule.d.ts +0 -612
- package/dist/do/FsModule.d.ts.map +0 -1
- package/dist/do/FsModule.js +0 -1120
- package/dist/do/FsModule.js.map +0 -1
- package/dist/do/GitModule.d.ts +0 -635
- package/dist/do/GitModule.d.ts.map +0 -1
- package/dist/do/GitModule.js +0 -784
- package/dist/do/GitModule.js.map +0 -1
- package/dist/do/GitRepoDO.d.ts +0 -281
- package/dist/do/GitRepoDO.d.ts.map +0 -1
- package/dist/do/GitRepoDO.js +0 -479
- package/dist/do/GitRepoDO.js.map +0 -1
- package/dist/do/bash-ast.d.ts +0 -246
- package/dist/do/bash-ast.d.ts.map +0 -1
- package/dist/do/bash-ast.js +0 -888
- package/dist/do/bash-ast.js.map +0 -1
- package/dist/do/container-executor.d.ts +0 -491
- package/dist/do/container-executor.d.ts.map +0 -1
- package/dist/do/container-executor.js +0 -731
- package/dist/do/container-executor.js.map +0 -1
- package/dist/do/index.d.ts +0 -53
- package/dist/do/index.d.ts.map +0 -1
- package/dist/do/index.js +0 -91
- package/dist/do/index.js.map +0 -1
- package/dist/do/tiered-storage.d.ts +0 -403
- package/dist/do/tiered-storage.d.ts.map +0 -1
- package/dist/do/tiered-storage.js +0 -689
- package/dist/do/tiered-storage.js.map +0 -1
- package/dist/do/withBash.d.ts +0 -231
- package/dist/do/withBash.d.ts.map +0 -1
- package/dist/do/withBash.js +0 -244
- package/dist/do/withBash.js.map +0 -1
- package/dist/do/withFs.d.ts +0 -237
- package/dist/do/withFs.d.ts.map +0 -1
- package/dist/do/withFs.js +0 -387
- package/dist/do/withFs.js.map +0 -1
- package/dist/do/withGit.d.ts +0 -180
- package/dist/do/withGit.d.ts.map +0 -1
- package/dist/do/withGit.js +0 -271
- package/dist/do/withGit.js.map +0 -1
- package/dist/durable-object/object-store.d.ts +0 -633
- package/dist/durable-object/object-store.d.ts.map +0 -1
- package/dist/durable-object/object-store.js +0 -1164
- package/dist/durable-object/object-store.js.map +0 -1
- package/dist/durable-object/schema.d.ts.map +0 -1
- package/dist/durable-object/schema.js.map +0 -1
- package/dist/durable-object/wal.d.ts +0 -416
- package/dist/durable-object/wal.d.ts.map +0 -1
- package/dist/durable-object/wal.js +0 -445
- package/dist/durable-object/wal.js.map +0 -1
- package/dist/mcp/adapter.d.ts +0 -772
- package/dist/mcp/adapter.d.ts.map +0 -1
- package/dist/mcp/adapter.js +0 -895
- package/dist/mcp/adapter.js.map +0 -1
- package/dist/mcp/sandbox/miniflare-evaluator.d.ts +0 -22
- package/dist/mcp/sandbox/miniflare-evaluator.d.ts.map +0 -1
- package/dist/mcp/sandbox/miniflare-evaluator.js +0 -140
- package/dist/mcp/sandbox/miniflare-evaluator.js.map +0 -1
- package/dist/mcp/sandbox/object-store-proxy.d.ts +0 -32
- package/dist/mcp/sandbox/object-store-proxy.d.ts.map +0 -1
- package/dist/mcp/sandbox/object-store-proxy.js +0 -30
- package/dist/mcp/sandbox/object-store-proxy.js.map +0 -1
- package/dist/mcp/sandbox/template.d.ts +0 -17
- package/dist/mcp/sandbox/template.d.ts.map +0 -1
- package/dist/mcp/sandbox/template.js +0 -71
- package/dist/mcp/sandbox/template.js.map +0 -1
- package/dist/mcp/sandbox.d.ts +0 -764
- package/dist/mcp/sandbox.d.ts.map +0 -1
- package/dist/mcp/sandbox.js +0 -1362
- package/dist/mcp/sandbox.js.map +0 -1
- package/dist/mcp/sdk-adapter.d.ts +0 -835
- package/dist/mcp/sdk-adapter.d.ts.map +0 -1
- package/dist/mcp/sdk-adapter.js +0 -974
- package/dist/mcp/sdk-adapter.js.map +0 -1
- package/dist/mcp/tools/do.d.ts +0 -32
- package/dist/mcp/tools/do.d.ts.map +0 -1
- package/dist/mcp/tools/do.js +0 -117
- package/dist/mcp/tools/do.js.map +0 -1
- package/dist/ops/blame.d.ts +0 -551
- package/dist/ops/blame.d.ts.map +0 -1
- package/dist/ops/blame.js +0 -1037
- package/dist/ops/blame.js.map +0 -1
- package/dist/ops/branch.d.ts +0 -766
- package/dist/ops/branch.d.ts.map +0 -1
- package/dist/ops/branch.js +0 -950
- package/dist/ops/branch.js.map +0 -1
- package/dist/ops/commit-traversal.d.ts +0 -349
- package/dist/ops/commit-traversal.d.ts.map +0 -1
- package/dist/ops/commit-traversal.js +0 -821
- package/dist/ops/commit-traversal.js.map +0 -1
- package/dist/ops/commit.d.ts +0 -555
- package/dist/ops/commit.d.ts.map +0 -1
- package/dist/ops/commit.js +0 -826
- package/dist/ops/commit.js.map +0 -1
- package/dist/ops/merge-base.d.ts +0 -397
- package/dist/ops/merge-base.d.ts.map +0 -1
- package/dist/ops/merge-base.js +0 -691
- package/dist/ops/merge-base.js.map +0 -1
- package/dist/ops/merge.d.ts +0 -855
- package/dist/ops/merge.d.ts.map +0 -1
- package/dist/ops/merge.js +0 -1551
- package/dist/ops/merge.js.map +0 -1
- package/dist/ops/tag.d.ts +0 -247
- package/dist/ops/tag.d.ts.map +0 -1
- package/dist/ops/tag.js +0 -649
- package/dist/ops/tag.js.map +0 -1
- package/dist/ops/tree-builder.d.ts +0 -178
- package/dist/ops/tree-builder.d.ts.map +0 -1
- package/dist/ops/tree-builder.js +0 -271
- package/dist/ops/tree-builder.js.map +0 -1
- package/dist/ops/tree-diff.d.ts +0 -291
- package/dist/ops/tree-diff.d.ts.map +0 -1
- package/dist/ops/tree-diff.js +0 -705
- package/dist/ops/tree-diff.js.map +0 -1
- package/dist/pack/delta.d.ts +0 -248
- package/dist/pack/delta.d.ts.map +0 -1
- package/dist/pack/delta.js +0 -740
- package/dist/pack/delta.js.map +0 -1
- package/dist/pack/format.d.ts +0 -446
- package/dist/pack/format.d.ts.map +0 -1
- package/dist/pack/format.js +0 -572
- package/dist/pack/format.js.map +0 -1
- package/dist/pack/full-generation.d.ts +0 -612
- package/dist/pack/full-generation.d.ts.map +0 -1
- package/dist/pack/full-generation.js +0 -1378
- package/dist/pack/full-generation.js.map +0 -1
- package/dist/pack/generation.d.ts +0 -441
- package/dist/pack/generation.d.ts.map +0 -1
- package/dist/pack/generation.js +0 -707
- package/dist/pack/generation.js.map +0 -1
- package/dist/pack/index.d.ts +0 -502
- package/dist/pack/index.d.ts.map +0 -1
- package/dist/pack/index.js +0 -833
- package/dist/pack/index.js.map +0 -1
- package/dist/refs/branch.d.ts +0 -683
- package/dist/refs/branch.d.ts.map +0 -1
- package/dist/refs/branch.js +0 -881
- package/dist/refs/branch.js.map +0 -1
- package/dist/refs/storage.d.ts +0 -833
- package/dist/refs/storage.d.ts.map +0 -1
- package/dist/refs/storage.js +0 -1023
- package/dist/refs/storage.js.map +0 -1
- package/dist/refs/tag.d.ts +0 -860
- package/dist/refs/tag.d.ts.map +0 -1
- package/dist/refs/tag.js +0 -996
- package/dist/refs/tag.js.map +0 -1
- package/dist/storage/backend.d.ts +0 -425
- package/dist/storage/backend.d.ts.map +0 -1
- package/dist/storage/backend.js +0 -41
- package/dist/storage/backend.js.map +0 -1
- package/dist/storage/fsx-adapter.d.ts +0 -204
- package/dist/storage/fsx-adapter.d.ts.map +0 -1
- package/dist/storage/fsx-adapter.js +0 -518
- package/dist/storage/fsx-adapter.js.map +0 -1
- package/dist/storage/lru-cache.d.ts +0 -691
- package/dist/storage/lru-cache.d.ts.map +0 -1
- package/dist/storage/lru-cache.js +0 -813
- package/dist/storage/lru-cache.js.map +0 -1
- package/dist/storage/object-index.d.ts +0 -585
- package/dist/storage/object-index.d.ts.map +0 -1
- package/dist/storage/object-index.js +0 -532
- package/dist/storage/object-index.js.map +0 -1
- package/dist/storage/r2-pack.d.ts +0 -1257
- package/dist/storage/r2-pack.d.ts.map +0 -1
- package/dist/storage/r2-pack.js +0 -1773
- package/dist/storage/r2-pack.js.map +0 -1
- package/dist/tiered/cdc-pipeline.d.ts +0 -1888
- package/dist/tiered/cdc-pipeline.d.ts.map +0 -1
- package/dist/tiered/cdc-pipeline.js +0 -1880
- package/dist/tiered/cdc-pipeline.js.map +0 -1
- package/dist/tiered/migration.d.ts +0 -1104
- package/dist/tiered/migration.d.ts.map +0 -1
- package/dist/tiered/migration.js +0 -1217
- package/dist/tiered/migration.js.map +0 -1
- package/dist/tiered/parquet-writer.d.ts +0 -1145
- package/dist/tiered/parquet-writer.d.ts.map +0 -1
- package/dist/tiered/parquet-writer.js +0 -1183
- package/dist/tiered/parquet-writer.js.map +0 -1
- package/dist/tiered/read-path.d.ts +0 -835
- package/dist/tiered/read-path.d.ts.map +0 -1
- package/dist/tiered/read-path.js +0 -487
- package/dist/tiered/read-path.js.map +0 -1
- package/dist/types/capability.d.ts +0 -1385
- package/dist/types/capability.d.ts.map +0 -1
- package/dist/types/capability.js +0 -36
- package/dist/types/capability.js.map +0 -1
- package/dist/types/index.d.ts +0 -13
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -18
- package/dist/types/index.js.map +0 -1
- package/dist/types/interfaces.d.ts +0 -673
- package/dist/types/interfaces.d.ts.map +0 -1
- package/dist/types/interfaces.js +0 -26
- package/dist/types/interfaces.js.map +0 -1
- package/dist/types/objects.d.ts +0 -692
- package/dist/types/objects.d.ts.map +0 -1
- package/dist/types/objects.js +0 -837
- package/dist/types/objects.js.map +0 -1
- package/dist/types/storage.d.ts +0 -603
- package/dist/types/storage.d.ts.map +0 -1
- package/dist/types/storage.js +0 -191
- package/dist/types/storage.js.map +0 -1
- package/dist/types/worker-loader.d.ts +0 -60
- package/dist/types/worker-loader.d.ts.map +0 -1
- package/dist/types/worker-loader.js +0 -62
- package/dist/types/worker-loader.js.map +0 -1
- package/dist/utils/hash.d.ts +0 -198
- package/dist/utils/hash.d.ts.map +0 -1
- package/dist/utils/hash.js +0 -272
- package/dist/utils/hash.js.map +0 -1
- package/dist/utils/sha1.d.ts +0 -325
- package/dist/utils/sha1.d.ts.map +0 -1
- package/dist/utils/sha1.js +0 -635
- package/dist/utils/sha1.js.map +0 -1
- package/dist/wire/capabilities.d.ts +0 -1044
- package/dist/wire/capabilities.d.ts.map +0 -1
- package/dist/wire/capabilities.js +0 -941
- package/dist/wire/capabilities.js.map +0 -1
- package/dist/wire/path-security.d.ts +0 -157
- package/dist/wire/path-security.d.ts.map +0 -1
- package/dist/wire/path-security.js +0 -307
- package/dist/wire/path-security.js.map +0 -1
- package/dist/wire/pkt-line.d.ts +0 -345
- package/dist/wire/pkt-line.d.ts.map +0 -1
- package/dist/wire/pkt-line.js +0 -381
- package/dist/wire/pkt-line.js.map +0 -1
- package/dist/wire/receive-pack.d.ts +0 -1059
- package/dist/wire/receive-pack.d.ts.map +0 -1
- package/dist/wire/receive-pack.js +0 -1414
- package/dist/wire/receive-pack.js.map +0 -1
- package/dist/wire/smart-http.d.ts +0 -799
- package/dist/wire/smart-http.d.ts.map +0 -1
- package/dist/wire/smart-http.js +0 -945
- package/dist/wire/smart-http.js.map +0 -1
- package/dist/wire/upload-pack.d.ts +0 -727
- package/dist/wire/upload-pack.d.ts.map +0 -1
- package/dist/wire/upload-pack.js +0 -1141
- package/dist/wire/upload-pack.js.map +0 -1
|
@@ -1,445 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Write-Ahead Log (WAL) Manager for Transaction Durability
|
|
3
|
-
*
|
|
4
|
-
* This module provides a Write-Ahead Log implementation for ensuring durability
|
|
5
|
-
* and crash recovery in the Git object storage. All operations are logged before
|
|
6
|
-
* being applied, allowing recovery after failures.
|
|
7
|
-
*
|
|
8
|
-
* **Key Features**:
|
|
9
|
-
* - Transaction support with begin/commit/rollback semantics
|
|
10
|
-
* - Checkpoint creation for efficient recovery
|
|
11
|
-
* - WAL truncation after successful checkpoints
|
|
12
|
-
* - Unflushed entry recovery for crash recovery
|
|
13
|
-
*
|
|
14
|
-
* @module durable-object/wal
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```typescript
|
|
18
|
-
* import { WALManager } from './durable-object/wal'
|
|
19
|
-
*
|
|
20
|
-
* const wal = new WALManager(storage)
|
|
21
|
-
*
|
|
22
|
-
* // Simple operation logging
|
|
23
|
-
* const entryId = await wal.append('PUT', payload)
|
|
24
|
-
*
|
|
25
|
-
* // Transaction support
|
|
26
|
-
* const txId = await wal.beginTransaction()
|
|
27
|
-
* await wal.append('PUT', payload1, txId)
|
|
28
|
-
* await wal.append('PUT', payload2, txId)
|
|
29
|
-
* await wal.commitTransaction(txId)
|
|
30
|
-
*
|
|
31
|
-
* // Create checkpoint for recovery point
|
|
32
|
-
* const checkpoint = await wal.createCheckpoint()
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
// ============================================================================
|
|
36
|
-
// Helper Functions
|
|
37
|
-
// ============================================================================
|
|
38
|
-
/**
|
|
39
|
-
* Generate a unique transaction ID.
|
|
40
|
-
*
|
|
41
|
-
* @description
|
|
42
|
-
* Creates a unique identifier for transactions using timestamp
|
|
43
|
-
* and random components to avoid collisions.
|
|
44
|
-
*
|
|
45
|
-
* @returns Unique transaction ID string (e.g., 'tx-lxyz123-abc12345')
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
function generateTransactionId() {
|
|
49
|
-
const timestamp = Date.now().toString(36);
|
|
50
|
-
const random = Math.random().toString(36).substring(2, 10);
|
|
51
|
-
return `tx-${timestamp}-${random}`;
|
|
52
|
-
}
|
|
53
|
-
// ============================================================================
|
|
54
|
-
// WALManager Class
|
|
55
|
-
// ============================================================================
|
|
56
|
-
/**
|
|
57
|
-
* Write-Ahead Log Manager for transaction durability.
|
|
58
|
-
*
|
|
59
|
-
* @description
|
|
60
|
-
* Provides durability guarantees by logging all operations before they are applied.
|
|
61
|
-
* Supports transactions with begin/commit/rollback semantics and checkpoint management.
|
|
62
|
-
*
|
|
63
|
-
* **Usage Pattern**:
|
|
64
|
-
* 1. Log operations using `append()` before applying them
|
|
65
|
-
* 2. Use transactions for atomic multi-operation changes
|
|
66
|
-
* 3. Create checkpoints periodically for efficient recovery
|
|
67
|
-
* 4. Truncate WAL after successful checkpoints
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* ```typescript
|
|
71
|
-
* const wal = new WALManager(storage)
|
|
72
|
-
*
|
|
73
|
-
* // Single operation
|
|
74
|
-
* const payload = new TextEncoder().encode(JSON.stringify({ sha: 'abc123' }))
|
|
75
|
-
* const id = await wal.append('PUT', payload)
|
|
76
|
-
*
|
|
77
|
-
* // Transaction
|
|
78
|
-
* const txId = await wal.beginTransaction()
|
|
79
|
-
* try {
|
|
80
|
-
* await wal.append('PUT', payload1, txId)
|
|
81
|
-
* await wal.append('PUT', payload2, txId)
|
|
82
|
-
* await wal.commitTransaction(txId)
|
|
83
|
-
* } catch (e) {
|
|
84
|
-
* await wal.rollbackTransaction(txId)
|
|
85
|
-
* throw e
|
|
86
|
-
* }
|
|
87
|
-
*
|
|
88
|
-
* // Checkpoint and cleanup
|
|
89
|
-
* const checkpoint = await wal.createCheckpoint()
|
|
90
|
-
* await wal.truncateBeforeCheckpoint(checkpoint)
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
export class WALManager {
|
|
94
|
-
/** Durable Object storage interface */
|
|
95
|
-
storage;
|
|
96
|
-
/** In-memory transaction tracking */
|
|
97
|
-
transactions = new Map();
|
|
98
|
-
/** Current WAL position for entry ID assignment */
|
|
99
|
-
currentWalPosition = 0;
|
|
100
|
-
/**
|
|
101
|
-
* Create a new WALManager.
|
|
102
|
-
*
|
|
103
|
-
* @param storage - Durable Object storage interface with SQL support
|
|
104
|
-
*/
|
|
105
|
-
constructor(storage) {
|
|
106
|
-
this.storage = storage;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Append an operation to the WAL.
|
|
110
|
-
*
|
|
111
|
-
* @description
|
|
112
|
-
* Logs an operation to the WAL before it is applied. Operations can
|
|
113
|
-
* optionally be associated with a transaction for atomic commit/rollback.
|
|
114
|
-
*
|
|
115
|
-
* @param operation - The type of operation being logged
|
|
116
|
-
* @param payload - Binary data describing the operation (usually JSON-encoded)
|
|
117
|
-
* @param transactionId - Optional transaction ID to associate with this operation
|
|
118
|
-
* @returns The ID of the appended WAL entry
|
|
119
|
-
*
|
|
120
|
-
* @example
|
|
121
|
-
* ```typescript
|
|
122
|
-
* // Simple append
|
|
123
|
-
* const payload = new TextEncoder().encode(JSON.stringify({
|
|
124
|
-
* sha: 'abc123',
|
|
125
|
-
* type: 'blob',
|
|
126
|
-
* timestamp: Date.now()
|
|
127
|
-
* }))
|
|
128
|
-
* const entryId = await wal.append('PUT', payload)
|
|
129
|
-
*
|
|
130
|
-
* // Append within transaction
|
|
131
|
-
* const txId = await wal.beginTransaction()
|
|
132
|
-
* await wal.append('PUT', payload, txId)
|
|
133
|
-
* ```
|
|
134
|
-
*/
|
|
135
|
-
async append(operation, payload, transactionId) {
|
|
136
|
-
const result = this.storage.sql.exec('INSERT INTO wal (operation, payload, transaction_id) VALUES (?, ?, ?)', operation, payload, transactionId ?? null);
|
|
137
|
-
const rows = result.toArray();
|
|
138
|
-
const entryId = rows[0]?.id ?? this.currentWalPosition + 1;
|
|
139
|
-
this.currentWalPosition = entryId;
|
|
140
|
-
// Track operation in transaction if applicable
|
|
141
|
-
if (transactionId) {
|
|
142
|
-
const tx = this.transactions.get(transactionId);
|
|
143
|
-
if (tx) {
|
|
144
|
-
tx.operations.push(entryId);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return entryId;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Flush all unflushed WAL entries.
|
|
151
|
-
*
|
|
152
|
-
* @description
|
|
153
|
-
* Marks all unflushed entries as flushed, indicating they have been
|
|
154
|
-
* durably persisted. This is typically called before creating a checkpoint.
|
|
155
|
-
*
|
|
156
|
-
* @returns The number of entries that were flushed
|
|
157
|
-
*
|
|
158
|
-
* @example
|
|
159
|
-
* ```typescript
|
|
160
|
-
* const count = await wal.flush()
|
|
161
|
-
* console.log(`Flushed ${count} entries`)
|
|
162
|
-
* ```
|
|
163
|
-
*/
|
|
164
|
-
async flush() {
|
|
165
|
-
// Get count of unflushed entries
|
|
166
|
-
const countResult = this.storage.sql.exec('SELECT COUNT(*) as count FROM wal WHERE flushed = 0');
|
|
167
|
-
const countRows = countResult.toArray();
|
|
168
|
-
const count = countRows[0]?.count ?? 0;
|
|
169
|
-
if (count === 0) {
|
|
170
|
-
return 0;
|
|
171
|
-
}
|
|
172
|
-
// Mark all unflushed entries as flushed
|
|
173
|
-
this.storage.sql.exec('UPDATE wal SET flushed = 1 WHERE flushed = 0');
|
|
174
|
-
return count;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Recover unflushed WAL entries for replay.
|
|
178
|
-
*
|
|
179
|
-
* @description
|
|
180
|
-
* Returns all unflushed WAL entries in order for replay during
|
|
181
|
-
* crash recovery. Entries should be replayed in order by ID.
|
|
182
|
-
*
|
|
183
|
-
* @returns Array of unflushed WAL entries sorted by ID
|
|
184
|
-
*
|
|
185
|
-
* @example
|
|
186
|
-
* ```typescript
|
|
187
|
-
* const entries = await wal.recover()
|
|
188
|
-
* for (const entry of entries) {
|
|
189
|
-
* console.log(`Replaying ${entry.operation} ${entry.id}`)
|
|
190
|
-
* // Apply the operation...
|
|
191
|
-
* }
|
|
192
|
-
* ```
|
|
193
|
-
*/
|
|
194
|
-
async recover() {
|
|
195
|
-
const result = this.storage.sql.exec('SELECT id, operation, payload, transaction_id, created_at, flushed FROM wal WHERE flushed = 0 ORDER BY id ASC');
|
|
196
|
-
const rows = result.toArray();
|
|
197
|
-
return rows.sort((a, b) => a.id - b.id);
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Begin a new transaction.
|
|
201
|
-
*
|
|
202
|
-
* @description
|
|
203
|
-
* Starts a new transaction and returns its ID. Operations appended
|
|
204
|
-
* with this transaction ID will be atomically committed or rolled back.
|
|
205
|
-
*
|
|
206
|
-
* @returns The unique transaction ID
|
|
207
|
-
*
|
|
208
|
-
* @example
|
|
209
|
-
* ```typescript
|
|
210
|
-
* const txId = await wal.beginTransaction()
|
|
211
|
-
* try {
|
|
212
|
-
* await wal.append('PUT', payload1, txId)
|
|
213
|
-
* await wal.append('DELETE', payload2, txId)
|
|
214
|
-
* await wal.commitTransaction(txId)
|
|
215
|
-
* } catch (e) {
|
|
216
|
-
* await wal.rollbackTransaction(txId)
|
|
217
|
-
* }
|
|
218
|
-
* ```
|
|
219
|
-
*/
|
|
220
|
-
async beginTransaction() {
|
|
221
|
-
const txId = generateTransactionId();
|
|
222
|
-
const transaction = {
|
|
223
|
-
id: txId,
|
|
224
|
-
state: 'ACTIVE',
|
|
225
|
-
startedAt: Date.now(),
|
|
226
|
-
operations: []
|
|
227
|
-
};
|
|
228
|
-
this.transactions.set(txId, transaction);
|
|
229
|
-
// Log transaction begin
|
|
230
|
-
this.storage.sql.exec('INSERT INTO transactions (id, state) VALUES (?, ?)', txId, 'ACTIVE');
|
|
231
|
-
// Append TX_BEGIN entry to WAL
|
|
232
|
-
await this.append('TX_BEGIN', new TextEncoder().encode(JSON.stringify({ txId })), txId);
|
|
233
|
-
return txId;
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Commit a transaction.
|
|
237
|
-
*
|
|
238
|
-
* @description
|
|
239
|
-
* Commits all operations in the transaction, making them permanent.
|
|
240
|
-
* After commit, the transaction cannot be rolled back.
|
|
241
|
-
*
|
|
242
|
-
* @param transactionId - The transaction ID to commit
|
|
243
|
-
* @throws Error if transaction not found or not active
|
|
244
|
-
*
|
|
245
|
-
* @example
|
|
246
|
-
* ```typescript
|
|
247
|
-
* const txId = await wal.beginTransaction()
|
|
248
|
-
* await wal.append('PUT', payload, txId)
|
|
249
|
-
* await wal.commitTransaction(txId)
|
|
250
|
-
* // Transaction is now committed
|
|
251
|
-
* ```
|
|
252
|
-
*/
|
|
253
|
-
async commitTransaction(transactionId) {
|
|
254
|
-
const tx = this.transactions.get(transactionId);
|
|
255
|
-
if (!tx) {
|
|
256
|
-
// Check if transaction exists in storage
|
|
257
|
-
const result = this.storage.sql.exec('SELECT id, state FROM transactions WHERE id = ?', transactionId);
|
|
258
|
-
const rows = result.toArray();
|
|
259
|
-
if (rows.length === 0) {
|
|
260
|
-
throw new Error('Transaction not found');
|
|
261
|
-
}
|
|
262
|
-
throw new Error('Transaction not active');
|
|
263
|
-
}
|
|
264
|
-
if (tx.state !== 'ACTIVE') {
|
|
265
|
-
throw new Error('Transaction not active');
|
|
266
|
-
}
|
|
267
|
-
// Append TX_COMMIT entry to WAL
|
|
268
|
-
await this.append('TX_COMMIT', new TextEncoder().encode(JSON.stringify({ txId: transactionId })), transactionId);
|
|
269
|
-
// Update transaction state
|
|
270
|
-
tx.state = 'COMMITTED';
|
|
271
|
-
this.storage.sql.exec('UPDATE transactions SET state = ? WHERE id = ?', 'COMMITTED', transactionId);
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Rollback a transaction.
|
|
275
|
-
*
|
|
276
|
-
* @description
|
|
277
|
-
* Rolls back all operations in the transaction, undoing their effects.
|
|
278
|
-
* After rollback, the transaction is marked as rolled back.
|
|
279
|
-
*
|
|
280
|
-
* @param transactionId - The transaction ID to rollback
|
|
281
|
-
* @throws Error if transaction not found or not active
|
|
282
|
-
*
|
|
283
|
-
* @example
|
|
284
|
-
* ```typescript
|
|
285
|
-
* const txId = await wal.beginTransaction()
|
|
286
|
-
* try {
|
|
287
|
-
* await wal.append('PUT', payload, txId)
|
|
288
|
-
* throw new Error('Something went wrong')
|
|
289
|
-
* } catch (e) {
|
|
290
|
-
* await wal.rollbackTransaction(txId)
|
|
291
|
-
* // All operations in transaction are undone
|
|
292
|
-
* }
|
|
293
|
-
* ```
|
|
294
|
-
*/
|
|
295
|
-
async rollbackTransaction(transactionId) {
|
|
296
|
-
const tx = this.transactions.get(transactionId);
|
|
297
|
-
if (!tx) {
|
|
298
|
-
const result = this.storage.sql.exec('SELECT id, state FROM transactions WHERE id = ?', transactionId);
|
|
299
|
-
const rows = result.toArray();
|
|
300
|
-
if (rows.length === 0) {
|
|
301
|
-
throw new Error('Transaction not found');
|
|
302
|
-
}
|
|
303
|
-
throw new Error('Transaction not active');
|
|
304
|
-
}
|
|
305
|
-
if (tx.state !== 'ACTIVE') {
|
|
306
|
-
throw new Error('Transaction not active');
|
|
307
|
-
}
|
|
308
|
-
// Delete transaction entries from WAL (except TX_BEGIN)
|
|
309
|
-
this.storage.sql.exec('DELETE FROM wal WHERE transaction_id = ? AND operation NOT IN (?, ?)', transactionId, 'TX_BEGIN', 'TX_ROLLBACK');
|
|
310
|
-
// Append TX_ROLLBACK entry to WAL
|
|
311
|
-
await this.append('TX_ROLLBACK', new TextEncoder().encode(JSON.stringify({ txId: transactionId })), transactionId);
|
|
312
|
-
// Update transaction state
|
|
313
|
-
tx.state = 'ROLLED_BACK';
|
|
314
|
-
this.storage.sql.exec('UPDATE transactions SET state = ? WHERE id = ?', 'ROLLED_BACK', transactionId);
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* Get the state of a transaction.
|
|
318
|
-
*
|
|
319
|
-
* @description
|
|
320
|
-
* Returns the current state of a transaction, checking both in-memory
|
|
321
|
-
* cache and persistent storage.
|
|
322
|
-
*
|
|
323
|
-
* @param transactionId - The transaction ID to check
|
|
324
|
-
* @returns Transaction state or null if not found
|
|
325
|
-
*
|
|
326
|
-
* @example
|
|
327
|
-
* ```typescript
|
|
328
|
-
* const state = await wal.getTransactionState(txId)
|
|
329
|
-
* if (state === 'COMMITTED') {
|
|
330
|
-
* console.log('Transaction was committed')
|
|
331
|
-
* }
|
|
332
|
-
* ```
|
|
333
|
-
*/
|
|
334
|
-
async getTransactionState(transactionId) {
|
|
335
|
-
const tx = this.transactions.get(transactionId);
|
|
336
|
-
if (tx) {
|
|
337
|
-
return tx.state;
|
|
338
|
-
}
|
|
339
|
-
const result = this.storage.sql.exec('SELECT state FROM transactions WHERE id = ?', transactionId);
|
|
340
|
-
const rows = result.toArray();
|
|
341
|
-
return rows.length > 0 ? rows[0].state : null;
|
|
342
|
-
}
|
|
343
|
-
/**
|
|
344
|
-
* Create a checkpoint at the current WAL position.
|
|
345
|
-
*
|
|
346
|
-
* @description
|
|
347
|
-
* Creates a checkpoint marking a consistent point where all prior
|
|
348
|
-
* operations have been successfully applied. Flushes pending entries first.
|
|
349
|
-
*
|
|
350
|
-
* @param metadata - Optional descriptive metadata for the checkpoint
|
|
351
|
-
* @returns The created checkpoint
|
|
352
|
-
*
|
|
353
|
-
* @example
|
|
354
|
-
* ```typescript
|
|
355
|
-
* // Create checkpoint after batch of operations
|
|
356
|
-
* const checkpoint = await wal.createCheckpoint('Post-push checkpoint')
|
|
357
|
-
* console.log(`Checkpoint at position ${checkpoint.walPosition}`)
|
|
358
|
-
* ```
|
|
359
|
-
*/
|
|
360
|
-
async createCheckpoint(metadata) {
|
|
361
|
-
// Flush all pending entries before creating checkpoint
|
|
362
|
-
await this.flush();
|
|
363
|
-
// Get current WAL position
|
|
364
|
-
const countResult = this.storage.sql.exec('SELECT MAX(id) as max_id FROM wal');
|
|
365
|
-
const countRows = countResult.toArray();
|
|
366
|
-
const walPosition = countRows[0]?.max_id ?? 0;
|
|
367
|
-
// Create checkpoint entry
|
|
368
|
-
const result = this.storage.sql.exec('INSERT INTO checkpoints (wal_position, metadata) VALUES (?, ?)', walPosition, metadata ?? null);
|
|
369
|
-
const rows = result.toArray();
|
|
370
|
-
const checkpointId = rows[0]?.id ?? 1;
|
|
371
|
-
const checkpoint = {
|
|
372
|
-
id: checkpointId,
|
|
373
|
-
walPosition,
|
|
374
|
-
createdAt: Date.now(),
|
|
375
|
-
metadata: metadata ?? null
|
|
376
|
-
};
|
|
377
|
-
return checkpoint;
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Get the most recent checkpoint.
|
|
381
|
-
*
|
|
382
|
-
* @description
|
|
383
|
-
* Returns the last checkpoint created, or null if none exist.
|
|
384
|
-
* Useful for determining where to start recovery.
|
|
385
|
-
*
|
|
386
|
-
* @returns The last checkpoint or null
|
|
387
|
-
*
|
|
388
|
-
* @example
|
|
389
|
-
* ```typescript
|
|
390
|
-
* const lastCheckpoint = await wal.getLastCheckpoint()
|
|
391
|
-
* if (lastCheckpoint) {
|
|
392
|
-
* console.log(`Last checkpoint at position ${lastCheckpoint.walPosition}`)
|
|
393
|
-
* }
|
|
394
|
-
* ```
|
|
395
|
-
*/
|
|
396
|
-
async getLastCheckpoint() {
|
|
397
|
-
const result = this.storage.sql.exec('SELECT id, wal_position, created_at, metadata FROM checkpoints ORDER BY id DESC LIMIT 1');
|
|
398
|
-
const rows = result.toArray();
|
|
399
|
-
return rows.length > 0 ? rows[0] : null;
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Truncate WAL entries before a checkpoint.
|
|
403
|
-
*
|
|
404
|
-
* @description
|
|
405
|
-
* Removes all WAL entries before (and including) the checkpoint position
|
|
406
|
-
* that have been flushed. This reclaims space after a successful checkpoint.
|
|
407
|
-
*
|
|
408
|
-
* **Note**: Only truncates flushed entries to avoid data loss.
|
|
409
|
-
*
|
|
410
|
-
* @param checkpoint - The checkpoint to truncate before
|
|
411
|
-
*
|
|
412
|
-
* @example
|
|
413
|
-
* ```typescript
|
|
414
|
-
* const checkpoint = await wal.createCheckpoint()
|
|
415
|
-
* // After verifying all operations are applied...
|
|
416
|
-
* await wal.truncateBeforeCheckpoint(checkpoint)
|
|
417
|
-
* ```
|
|
418
|
-
*/
|
|
419
|
-
async truncateBeforeCheckpoint(checkpoint) {
|
|
420
|
-
this.storage.sql.exec('DELETE FROM wal WHERE id <= ? AND flushed = 1', checkpoint.walPosition);
|
|
421
|
-
}
|
|
422
|
-
/**
|
|
423
|
-
* Get the count of unflushed WAL entries.
|
|
424
|
-
*
|
|
425
|
-
* @description
|
|
426
|
-
* Returns the number of WAL entries that have not yet been flushed.
|
|
427
|
-
* Useful for monitoring WAL growth and deciding when to flush.
|
|
428
|
-
*
|
|
429
|
-
* @returns Number of unflushed entries
|
|
430
|
-
*
|
|
431
|
-
* @example
|
|
432
|
-
* ```typescript
|
|
433
|
-
* const count = await wal.getUnflushedCount()
|
|
434
|
-
* if (count > 1000) {
|
|
435
|
-
* await wal.flush()
|
|
436
|
-
* }
|
|
437
|
-
* ```
|
|
438
|
-
*/
|
|
439
|
-
async getUnflushedCount() {
|
|
440
|
-
const result = this.storage.sql.exec('SELECT COUNT(*) as count FROM wal WHERE flushed = 0');
|
|
441
|
-
const rows = result.toArray();
|
|
442
|
-
return rows[0]?.count ?? 0;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
//# sourceMappingURL=wal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wal.js","sourceRoot":"","sources":["../../src/durable-object/wal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AA2HH,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;;;;;;;;GASG;AACH,SAAS,qBAAqB;IAC5B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IACzC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAC1D,OAAO,MAAM,SAAS,IAAI,MAAM,E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