@amalgm/live 0.2.81-preview.45708334404 → 0.2.81-preview.46146788616
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apply/contracts.d.ts +17 -348
- package/dist/apply/contracts.js +1 -108
- package/dist/apply/fetch-ahead.d.ts +0 -45
- package/dist/apply/fetch-ahead.js +1 -169
- package/dist/apply/index.d.ts +0 -2
- package/dist/apply/index.js +1 -10
- package/dist/apply/journey.d.ts +0 -35
- package/dist/apply/journey.js +1 -403
- package/dist/apply/lane.d.ts +0 -34
- package/dist/apply/lane.js +1 -72
- package/dist/apply/line.d.ts +0 -28
- package/dist/apply/line.js +1 -81
- package/dist/apply/plans.d.ts +0 -14
- package/dist/apply/plans.js +1 -182
- package/dist/apply/rail.d.ts +0 -60
- package/dist/apply/rail.js +1 -776
- package/dist/apply/selection.d.ts +0 -15
- package/dist/apply/selection.js +1 -111
- package/dist/apply/settling.d.ts +0 -57
- package/dist/apply/settling.js +1 -63
- package/dist/apply/showing.d.ts +1 -95
- package/dist/apply/showing.js +1 -203
- package/dist/apply/type-adapters.d.ts +0 -8
- package/dist/apply/type-adapters.js +1 -39
- package/dist/apply/window.d.ts +0 -109
- package/dist/apply/window.js +1 -323
- package/dist/clash/bodmas.d.ts +1 -51
- package/dist/clash/bodmas.js +1 -130
- package/dist/clash/echo.d.ts +0 -27
- package/dist/clash/echo.js +1 -35
- package/dist/clash/index.d.ts +0 -1
- package/dist/clash/index.js +1 -6
- package/dist/clash/local-work.d.ts +0 -36
- package/dist/clash/local-work.js +1 -51
- package/dist/clash/resolution.d.ts +0 -13
- package/dist/clash/resolution.js +1 -15
- package/dist/clash/tetris.d.ts +0 -18
- package/dist/clash/tetris.js +1 -26
- package/dist/{sharing/command-input.d.ts → commands/input.d.ts} +5 -9
- package/dist/commands/input.js +1 -0
- package/dist/commands/mcp.d.ts +23 -0
- package/dist/commands/mcp.js +1 -0
- package/dist/contracts/content.d.ts +0 -78
- package/dist/contracts/content.js +1 -251
- package/dist/contracts/index.d.ts +0 -6
- package/dist/contracts/index.js +1 -9
- package/dist/contracts/protection.d.ts +16 -22
- package/dist/contracts/protection.js +1 -53
- package/dist/contracts/validate.d.ts +0 -18
- package/dist/contracts/validate.js +1 -23
- package/dist/detection/adapter-contract.d.ts +0 -75
- package/dist/detection/adapter-contract.js +1 -130
- package/dist/detection/batch.d.ts +1 -14
- package/dist/detection/batch.js +1 -75
- package/dist/detection/classify.d.ts +6 -40
- package/dist/detection/classify.js +1 -45
- package/dist/detection/content.d.ts +0 -17
- package/dist/detection/content.js +1 -76
- package/dist/detection/dispositions.d.ts +3 -82
- package/dist/detection/dispositions.js +0 -20
- package/dist/detection/echo.d.ts +0 -20
- package/dist/detection/echo.js +1 -33
- package/dist/detection/identity.d.ts +0 -56
- package/dist/detection/identity.js +1 -229
- package/dist/detection/ignore-lines.d.ts +0 -15
- package/dist/detection/ignore-lines.js +2 -212
- package/dist/detection/index.d.ts +0 -31
- package/dist/detection/index.js +1 -48
- package/dist/detection/package-proposal.d.ts +0 -24
- package/dist/detection/package-proposal.js +1 -114
- package/dist/detection/record-order.d.ts +5 -19
- package/dist/detection/record-order.js +1 -311
- package/dist/detection/record-proposal.d.ts +0 -98
- package/dist/detection/record-proposal.js +1 -384
- package/dist/detection/refusal.d.ts +0 -69
- package/dist/detection/refusal.js +1 -78
- package/dist/detection/removals.d.ts +0 -8
- package/dist/detection/removals.js +1 -51
- package/dist/detection/scoped-identity.d.ts +1 -61
- package/dist/detection/scoped-identity.js +1 -189
- package/dist/detection/skip-defaults.d.ts +0 -16
- package/dist/detection/skip-defaults.js +3 -20
- package/dist/detection/skip-policy.d.ts +0 -58
- package/dist/detection/skip-policy.js +1 -203
- package/dist/detection/watch-boundary.d.ts +0 -16
- package/dist/detection/watch-boundary.js +1 -47
- package/dist/drive/contracts.d.ts +0 -182
- package/dist/drive/contracts.js +1 -30
- package/dist/drive/drive.d.ts +0 -147
- package/dist/drive/drive.js +1 -414
- package/dist/drive/held-removals.d.ts +0 -49
- package/dist/drive/held-removals.js +1 -136
- package/dist/drive/index.d.ts +0 -7
- package/dist/drive/index.js +1 -16
- package/dist/drive/kept.d.ts +0 -10
- package/dist/drive/kept.js +1 -33
- package/dist/drive/listing.d.ts +2 -13
- package/dist/drive/listing.js +1 -84
- package/dist/drive/map-index.d.ts +0 -59
- package/dist/drive/map-index.js +1 -240
- package/dist/drive/placements.d.ts +0 -71
- package/dist/drive/placements.js +1 -164
- package/dist/drive/records.d.ts +0 -43
- package/dist/drive/records.js +1 -85
- package/dist/drive/where.d.ts +7 -94
- package/dist/drive/where.js +2 -378
- package/dist/entities/accepted-view.d.ts +0 -47
- package/dist/entities/accepted-view.js +1 -260
- package/dist/entities/bytes.d.ts +0 -16
- package/dist/entities/bytes.js +1 -112
- package/dist/entities/cloud.d.ts +0 -125
- package/dist/entities/cloud.js +1 -430
- package/dist/entities/graph-head.d.ts +0 -32
- package/dist/entities/graph-head.js +1 -114
- package/dist/entities/graph-pages.d.ts +0 -75
- package/dist/entities/graph-pages.js +1 -239
- package/dist/entities/index.d.ts +0 -28
- package/dist/entities/index.js +1 -40
- package/dist/entities/package-pages.d.ts +0 -28
- package/dist/entities/package-pages.js +1 -91
- package/dist/entities/placement-owed.d.ts +0 -27
- package/dist/entities/placement-owed.js +1 -86
- package/dist/entities/reducer.d.ts +0 -30
- package/dist/entities/reducer.js +1 -130
- package/dist/entities/registry-graph.d.ts +0 -80
- package/dist/entities/registry-graph.js +1 -478
- package/dist/entities/rules.d.ts +7 -72
- package/dist/entities/rules.js +1 -230
- package/dist/entities/types.d.ts +0 -71
- package/dist/entities/types.js +1 -55
- package/dist/entities/units.d.ts +0 -25
- package/dist/entities/units.js +1 -27
- package/dist/faults/classify.d.ts +0 -24
- package/dist/faults/classify.js +1 -77
- package/dist/faults/index.d.ts +0 -8
- package/dist/faults/index.js +1 -13
- package/dist/faults/need.d.ts +0 -24
- package/dist/faults/need.js +1 -76
- package/dist/faults/recover.d.ts +0 -18
- package/dist/faults/recover.js +1 -44
- package/dist/faults/report.d.ts +0 -23
- package/dist/faults/report.js +1 -130
- package/dist/faults/scrub.d.ts +0 -27
- package/dist/faults/scrub.js +3 -159
- package/dist/faults/wire.d.ts +0 -13
- package/dist/faults/wire.js +1 -42
- package/dist/files/accepted-files.d.ts +0 -37
- package/dist/files/accepted-files.js +1 -129
- package/dist/files/api.d.ts +0 -1
- package/dist/files/api.js +1 -83
- package/dist/files/browse-types.d.ts +7 -7
- package/dist/files/browse-types.js +1 -46
- package/dist/files/browser.d.ts +4 -2
- package/dist/files/browser.js +1 -100
- package/dist/files/cloud-files.d.ts +6 -5
- package/dist/files/cloud-files.js +1 -153
- package/dist/files/commands.d.ts +0 -54
- package/dist/files/commands.js +1 -140
- package/dist/files/computer-address.d.ts +0 -10
- package/dist/files/computer-address.js +1 -48
- package/dist/files/index.d.ts +1 -3
- package/dist/files/index.js +1 -18
- package/dist/files/local-files.d.ts +0 -2
- package/dist/files/local-files.js +1 -104
- package/dist/files/media-type.d.ts +0 -1
- package/dist/files/media-type.js +1 -50
- package/dist/files/own-folders.d.ts +0 -29
- package/dist/files/own-folders.js +1 -50
- package/dist/files/plans.d.ts +1 -16
- package/dist/files/plans.js +1 -36
- package/dist/files/trash.d.ts +0 -97
- package/dist/files/trash.js +1 -287
- package/dist/files/usage-categories.d.ts +0 -13
- package/dist/files/usage-categories.js +1 -33
- package/dist/files/usage-chain.d.ts +0 -27
- package/dist/files/usage-chain.js +1 -44
- package/dist/files/usage-effect.d.ts +0 -34
- package/dist/files/usage-effect.js +1 -29
- package/dist/files/usage.d.ts +3 -47
- package/dist/files/usage.js +1 -132
- package/dist/git/alternates.d.ts +0 -21
- package/dist/git/alternates.js +1 -79
- package/dist/git/artifact.d.ts +0 -69
- package/dist/git/artifact.js +1 -190
- package/dist/git/chain.d.ts +0 -32
- package/dist/git/chain.js +1 -55
- package/dist/git/holds.d.ts +30 -0
- package/dist/git/holds.js +1 -0
- package/dist/git/index.d.ts +4 -2
- package/dist/git/index.js +1 -11
- package/dist/git/parts.d.ts +10 -0
- package/dist/git/parts.js +7 -0
- package/dist/git/places.d.ts +6 -0
- package/dist/git/places.js +1 -0
- package/dist/git/plan.d.ts +0 -40
- package/dist/git/plan.js +1 -97
- package/dist/git/play.d.ts +11 -72
- package/dist/git/play.js +4 -318
- package/dist/git/refs.d.ts +0 -18
- package/dist/git/refs.js +8 -63
- package/dist/git/restore.d.ts +8 -0
- package/dist/git/restore.js +2 -0
- package/dist/git/state.d.ts +0 -103
- package/dist/git/state.js +3 -209
- package/dist/git/tag.d.ts +5 -51
- package/dist/git/tag.js +3 -68
- package/dist/git/text.d.ts +0 -3
- package/dist/git/text.js +1 -4
- package/dist/git/turns.d.ts +0 -104
- package/dist/git/turns.js +1 -153
- package/dist/history/history.d.ts +2 -14
- package/dist/history/history.js +1 -51
- package/dist/history/identity.d.ts +11 -0
- package/dist/history/identity.js +1 -0
- package/dist/history/index.d.ts +6 -9
- package/dist/history/index.js +1 -10
- package/dist/history/rule.d.ts +3 -38
- package/dist/history/rule.js +1 -78
- package/dist/history/runs.d.ts +17 -0
- package/dist/history/runs.js +1 -0
- package/dist/history/types.d.ts +6 -64
- package/dist/history/types.js +0 -9
- package/dist/history/version.d.ts +2 -8
- package/dist/history/version.js +1 -32
- package/dist/index.d.ts +0 -15
- package/dist/index.js +1 -32
- package/dist/records/authority.d.ts +0 -7
- package/dist/records/authority.js +1 -28
- package/dist/records/codec.d.ts +0 -2
- package/dist/records/codec.js +1 -43
- package/dist/records/contracts.d.ts +0 -20
- package/dist/records/contracts.js +1 -190
- package/dist/records/inbox.d.ts +0 -3
- package/dist/records/inbox.js +1 -40
- package/dist/records/index.d.ts +0 -2
- package/dist/records/index.js +1 -18
- package/dist/records/intentional.d.ts +0 -24
- package/dist/records/intentional.js +1 -58
- package/dist/records/outbox.d.ts +0 -10
- package/dist/records/outbox.js +1 -46
- package/dist/records/owned-effects.d.ts +0 -8
- package/dist/records/owned-effects.js +1 -37
- package/dist/records/publication.d.ts +1 -67
- package/dist/records/publication.js +1 -583
- package/dist/records/rail-ports.d.ts +2 -81
- package/dist/records/rail-ports.js +0 -3
- package/dist/records/rail.d.ts +1 -42
- package/dist/records/rail.js +1 -195
- package/dist/records/receive-channel.d.ts +0 -42
- package/dist/records/receive-channel.js +1 -131
- package/dist/records/receive-loop.d.ts +0 -48
- package/dist/records/receive-loop.js +1 -278
- package/dist/records/receive-pages.d.ts +0 -23
- package/dist/records/receive-pages.js +1 -98
- package/dist/records/retry-clock.d.ts +0 -3
- package/dist/records/retry-clock.js +1 -35
- package/dist/records/send-batch.d.ts +0 -45
- package/dist/records/send-batch.js +1 -119
- package/dist/records/send-freeing.d.ts +4 -42
- package/dist/records/send-freeing.js +1 -124
- package/dist/records/send-line.d.ts +1 -82
- package/dist/records/send-line.js +1 -411
- package/dist/records/send-preparation.d.ts +0 -39
- package/dist/records/send-preparation.js +1 -226
- package/dist/records/submit-frame.d.ts +0 -28
- package/dist/records/submit-frame.js +1 -161
- package/dist/records/unsent-count.d.ts +0 -24
- package/dist/records/unsent-count.js +1 -91
- package/dist/records/wire.d.ts +0 -10
- package/dist/records/wire.js +1 -121
- package/dist/registration/home-layout.d.ts +0 -18
- package/dist/registration/home-layout.js +1 -34
- package/dist/registration/index.d.ts +0 -3
- package/dist/registration/index.js +1 -5
- package/dist/registration/user-ground.d.ts +0 -165
- package/dist/registration/user-ground.js +1 -399
- package/dist/sharing/access.d.ts +0 -8
- package/dist/sharing/access.js +1 -51
- package/dist/sharing/cli.d.ts +0 -7
- package/dist/sharing/cli.js +8 -88
- package/dist/sharing/commands.d.ts +3 -16
- package/dist/sharing/commands.js +1 -164
- package/dist/sharing/construct.d.ts +0 -10
- package/dist/sharing/construct.js +1 -47
- package/dist/sharing/download.d.ts +0 -12
- package/dist/sharing/download.js +1 -45
- package/dist/sharing/entity.d.ts +0 -11
- package/dist/sharing/entity.js +1 -53
- package/dist/sharing/errors.d.ts +0 -2
- package/dist/sharing/errors.js +1 -11
- package/dist/sharing/grants.d.ts +0 -15
- package/dist/sharing/grants.js +1 -103
- package/dist/sharing/index.d.ts +3 -9
- package/dist/sharing/index.js +1 -16
- package/dist/sharing/mcp.d.ts +2 -25
- package/dist/sharing/mcp.js +1 -31
- package/dist/sharing/permissions.d.ts +0 -8
- package/dist/sharing/permissions.js +1 -45
- package/dist/sharing/publish.d.ts +0 -8
- package/dist/sharing/publish.js +1 -42
- package/dist/sharing/share.d.ts +0 -10
- package/dist/sharing/share.js +1 -31
- package/dist/sharing/sharing.d.ts +0 -5
- package/dist/sharing/sharing.js +1 -22
- package/dist/sharing/types.d.ts +0 -47
- package/dist/sharing/types.js +1 -15
- package/dist/steps.d.ts +0 -18
- package/dist/steps.js +1 -58
- package/dist/transfer/artifacts.d.ts +0 -19
- package/dist/transfer/artifacts.js +1 -89
- package/dist/transfer/batches.d.ts +0 -11
- package/dist/transfer/batches.js +1 -40
- package/dist/transfer/cargo-pack.d.ts +39 -0
- package/dist/transfer/cargo-pack.js +1 -0
- package/dist/transfer/cargo.d.ts +0 -39
- package/dist/transfer/cargo.js +1 -130
- package/dist/transfer/dispute.d.ts +9 -0
- package/dist/transfer/dispute.js +1 -0
- package/dist/transfer/download.d.ts +0 -97
- package/dist/transfer/download.js +1 -627
- package/dist/transfer/index.d.ts +2 -3
- package/dist/transfer/index.js +1 -10
- package/dist/transfer/parallel.d.ts +0 -19
- package/dist/transfer/parallel.js +1 -136
- package/dist/transfer/ranges.d.ts +0 -22
- package/dist/transfer/ranges.js +1 -59
- package/dist/transfer/refs.d.ts +0 -22
- package/dist/transfer/refs.js +1 -41
- package/dist/transfer/upload.d.ts +0 -49
- package/dist/transfer/upload.js +1 -248
- package/dist/versions/admit.d.ts +8 -0
- package/dist/versions/admit.js +1 -0
- package/dist/versions/api.d.ts +3 -0
- package/dist/versions/api.js +1 -0
- package/dist/versions/cli-text.d.ts +3 -0
- package/dist/versions/cli-text.js +5 -0
- package/dist/versions/cli.d.ts +12 -0
- package/dist/versions/cli.js +19 -0
- package/dist/versions/commands.d.ts +31 -0
- package/dist/versions/commands.js +1 -0
- package/dist/versions/content.d.ts +4 -0
- package/dist/versions/content.js +1 -0
- package/dist/versions/dates.d.ts +15 -0
- package/dist/versions/dates.js +1 -0
- package/dist/versions/deliver.d.ts +25 -0
- package/dist/versions/deliver.js +2 -0
- package/dist/versions/errors.d.ts +10 -0
- package/dist/versions/errors.js +1 -0
- package/dist/versions/index.d.ts +18 -0
- package/dist/versions/index.js +1 -0
- package/dist/versions/line.d.ts +8 -0
- package/dist/versions/line.js +1 -0
- package/dist/versions/list.d.ts +5 -0
- package/dist/versions/list.js +1 -0
- package/dist/versions/mcp.d.ts +3 -0
- package/dist/versions/mcp.js +1 -0
- package/dist/versions/ports.d.ts +46 -0
- package/dist/versions/ports.js +0 -0
- package/dist/versions/read.d.ts +12 -0
- package/dist/versions/read.js +1 -0
- package/dist/versions/restore.d.ts +5 -0
- package/dist/versions/restore.js +1 -0
- package/dist/versions/services.d.ts +4 -0
- package/dist/versions/services.js +1 -0
- package/dist/versions/show.d.ts +5 -0
- package/dist/versions/show.js +1 -0
- package/dist/versions/types.d.ts +64 -0
- package/dist/versions/types.js +0 -0
- package/dist/versions/versions.d.ts +10 -0
- package/dist/versions/versions.js +1 -0
- package/dist/watching/coverage.d.ts +0 -23
- package/dist/watching/coverage.js +1 -44
- package/dist/watching/index.d.ts +0 -6
- package/dist/watching/index.js +1 -9
- package/dist/watching/maintenance.d.ts +0 -66
- package/dist/watching/maintenance.js +1 -204
- package/dist/watching/suspicion.d.ts +0 -59
- package/dist/watching/suspicion.js +1 -513
- package/dist/workspace/api.d.ts +0 -1
- package/dist/workspace/api.js +1 -108
- package/dist/workspace/entries.d.ts +0 -3
- package/dist/workspace/entries.js +1 -77
- package/dist/workspace/identity.d.ts +0 -2
- package/dist/workspace/identity.js +1 -27
- package/dist/workspace/index.d.ts +0 -1
- package/dist/workspace/index.js +1 -5
- package/dist/workspace/registry.d.ts +0 -12
- package/dist/workspace/registry.js +1 -255
- package/dist/workspace/types.d.ts +0 -19
- package/dist/workspace/types.js +0 -2
- package/dist-cjs/apply/contracts.js +1 -115
- package/dist-cjs/apply/fetch-ahead.js +1 -174
- package/dist-cjs/apply/index.js +1 -26
- package/dist-cjs/apply/journey.js +1 -408
- package/dist-cjs/apply/lane.js +1 -76
- package/dist-cjs/apply/line.js +1 -91
- package/dist-cjs/apply/plans.js +1 -185
- package/dist-cjs/apply/rail.js +1 -780
- package/dist-cjs/apply/selection.js +1 -117
- package/dist-cjs/apply/settling.js +1 -67
- package/dist-cjs/apply/showing.js +1 -211
- package/dist-cjs/apply/type-adapters.js +1 -43
- package/dist-cjs/apply/window.js +1 -331
- package/dist-cjs/clash/bodmas.js +1 -133
- package/dist-cjs/clash/echo.js +1 -38
- package/dist-cjs/clash/index.js +1 -22
- package/dist-cjs/clash/local-work.js +1 -57
- package/dist-cjs/clash/resolution.js +1 -19
- package/dist-cjs/clash/tetris.js +1 -29
- package/dist-cjs/commands/input.js +1 -0
- package/dist-cjs/commands/mcp.js +1 -0
- package/dist-cjs/contracts/content.js +1 -267
- package/dist-cjs/contracts/index.js +1 -25
- package/dist-cjs/contracts/protection.js +1 -58
- package/dist-cjs/contracts/validate.js +1 -31
- package/dist-cjs/detection/adapter-contract.js +1 -135
- package/dist-cjs/detection/batch.js +1 -78
- package/dist-cjs/detection/classify.js +1 -52
- package/dist-cjs/detection/content.js +1 -82
- package/dist-cjs/detection/dispositions.js +1 -21
- package/dist-cjs/detection/echo.js +1 -36
- package/dist-cjs/detection/identity.js +1 -239
- package/dist-cjs/detection/ignore-lines.js +2 -216
- package/dist-cjs/detection/index.js +1 -64
- package/dist-cjs/detection/package-proposal.js +1 -120
- package/dist-cjs/detection/record-order.js +1 -314
- package/dist-cjs/detection/record-proposal.js +1 -398
- package/dist-cjs/detection/refusal.js +1 -88
- package/dist-cjs/detection/removals.js +1 -54
- package/dist-cjs/detection/scoped-identity.js +1 -192
- package/dist-cjs/detection/skip-defaults.js +2 -22
- package/dist-cjs/detection/skip-policy.js +1 -208
- package/dist-cjs/detection/watch-boundary.js +1 -51
- package/dist-cjs/drive/contracts.js +1 -34
- package/dist-cjs/drive/drive.js +1 -418
- package/dist-cjs/drive/held-removals.js +1 -140
- package/dist-cjs/drive/index.js +1 -32
- package/dist-cjs/drive/kept.js +1 -36
- package/dist-cjs/drive/listing.js +1 -87
- package/dist-cjs/drive/map-index.js +1 -245
- package/dist-cjs/drive/placements.js +1 -168
- package/dist-cjs/drive/records.js +1 -93
- package/dist-cjs/drive/where.js +2 -394
- package/dist-cjs/entities/accepted-view.js +1 -264
- package/dist-cjs/entities/bytes.js +1 -124
- package/dist-cjs/entities/cloud.js +1 -451
- package/dist-cjs/entities/graph-head.js +1 -121
- package/dist-cjs/entities/graph-pages.js +1 -257
- package/dist-cjs/entities/index.js +1 -56
- package/dist-cjs/entities/package-pages.js +1 -99
- package/dist-cjs/entities/placement-owed.js +1 -91
- package/dist-cjs/entities/reducer.js +1 -136
- package/dist-cjs/entities/registry-graph.js +1 -483
- package/dist-cjs/entities/rules.js +1 -251
- package/dist-cjs/entities/types.js +1 -61
- package/dist-cjs/entities/units.js +1 -30
- package/dist-cjs/faults/classify.js +1 -83
- package/dist-cjs/faults/index.js +1 -32
- package/dist-cjs/faults/need.js +1 -84
- package/dist-cjs/faults/recover.js +1 -49
- package/dist-cjs/faults/report.js +1 -135
- package/dist-cjs/faults/scrub.js +3 -169
- package/dist-cjs/faults/wire.js +1 -47
- package/dist-cjs/files/accepted-files.js +1 -135
- package/dist-cjs/files/api.js +1 -85
- package/dist-cjs/files/browse-types.js +1 -54
- package/dist-cjs/files/browser.js +1 -104
- package/dist-cjs/files/cloud-files.js +1 -159
- package/dist-cjs/files/commands.js +1 -145
- package/dist-cjs/files/computer-address.js +1 -52
- package/dist-cjs/files/index.js +1 -65
- package/dist-cjs/files/local-files.js +1 -108
- package/dist-cjs/files/media-type.js +1 -53
- package/dist-cjs/files/own-folders.js +1 -53
- package/dist-cjs/files/plans.js +1 -40
- package/dist-cjs/files/trash.js +1 -299
- package/dist-cjs/files/usage-categories.js +1 -37
- package/dist-cjs/files/usage-chain.js +1 -49
- package/dist-cjs/files/usage-effect.js +1 -34
- package/dist-cjs/files/usage.js +1 -140
- package/dist-cjs/git/alternates.js +1 -84
- package/dist-cjs/git/artifact.js +1 -202
- package/dist-cjs/git/chain.js +1 -59
- package/dist-cjs/git/holds.js +1 -0
- package/dist-cjs/git/index.js +1 -29
- package/dist-cjs/git/parts.js +7 -0
- package/dist-cjs/git/places.js +1 -0
- package/dist-cjs/git/plan.js +1 -100
- package/dist-cjs/git/play.js +4 -323
- package/dist-cjs/git/refs.js +8 -72
- package/dist-cjs/git/restore.js +2 -0
- package/dist-cjs/git/state.js +3 -230
- package/dist-cjs/git/tag.js +3 -72
- package/dist-cjs/git/text.js +1 -8
- package/dist-cjs/git/turns.js +1 -162
- package/dist-cjs/history/history.js +1 -53
- package/dist-cjs/history/identity.js +1 -0
- package/dist-cjs/history/index.js +1 -21
- package/dist-cjs/history/rule.js +1 -83
- package/dist-cjs/history/runs.js +1 -0
- package/dist-cjs/history/types.js +1 -10
- package/dist-cjs/history/version.js +1 -36
- package/dist-cjs/index.js +1 -48
- package/dist-cjs/records/authority.js +1 -31
- package/dist-cjs/records/codec.js +1 -49
- package/dist-cjs/records/contracts.js +1 -196
- package/dist-cjs/records/inbox.js +1 -43
- package/dist-cjs/records/index.js +1 -47
- package/dist-cjs/records/intentional.js +1 -61
- package/dist-cjs/records/outbox.js +1 -50
- package/dist-cjs/records/owned-effects.js +1 -41
- package/dist-cjs/records/publication.js +1 -593
- package/dist-cjs/records/rail-ports.js +1 -4
- package/dist-cjs/records/rail.js +1 -199
- package/dist-cjs/records/receive-channel.js +1 -136
- package/dist-cjs/records/receive-loop.js +1 -282
- package/dist-cjs/records/receive-pages.js +1 -103
- package/dist-cjs/records/retry-clock.js +1 -39
- package/dist-cjs/records/send-batch.js +1 -126
- package/dist-cjs/records/send-freeing.js +1 -128
- package/dist-cjs/records/send-line.js +1 -415
- package/dist-cjs/records/send-preparation.js +1 -230
- package/dist-cjs/records/submit-frame.js +1 -167
- package/dist-cjs/records/unsent-count.js +1 -95
- package/dist-cjs/records/wire.js +1 -127
- package/dist-cjs/registration/home-layout.js +1 -38
- package/dist-cjs/registration/index.js +1 -21
- package/dist-cjs/registration/user-ground.js +1 -407
- package/dist-cjs/sharing/access.js +1 -56
- package/dist-cjs/sharing/cli.js +8 -93
- package/dist-cjs/sharing/commands.js +1 -169
- package/dist-cjs/sharing/construct.js +1 -53
- package/dist-cjs/sharing/download.js +1 -48
- package/dist-cjs/sharing/entity.js +1 -59
- package/dist-cjs/sharing/errors.js +1 -14
- package/dist-cjs/sharing/grants.js +1 -108
- package/dist-cjs/sharing/index.js +1 -36
- package/dist-cjs/sharing/mcp.js +1 -33
- package/dist-cjs/sharing/permissions.js +1 -47
- package/dist-cjs/sharing/publish.js +1 -45
- package/dist-cjs/sharing/share.js +1 -36
- package/dist-cjs/sharing/sharing.js +1 -24
- package/dist-cjs/sharing/types.js +1 -19
- package/dist-cjs/steps.js +1 -64
- package/dist-cjs/transfer/artifacts.js +1 -95
- package/dist-cjs/transfer/batches.js +1 -44
- package/dist-cjs/transfer/cargo-pack.js +1 -0
- package/dist-cjs/transfer/cargo.js +1 -135
- package/dist-cjs/transfer/dispute.js +1 -0
- package/dist-cjs/transfer/download.js +1 -634
- package/dist-cjs/transfer/index.js +1 -30
- package/dist-cjs/transfer/parallel.js +1 -143
- package/dist-cjs/transfer/ranges.js +1 -63
- package/dist-cjs/transfer/refs.js +1 -45
- package/dist-cjs/transfer/upload.js +1 -256
- package/dist-cjs/versions/admit.js +1 -0
- package/dist-cjs/versions/api.js +1 -0
- package/dist-cjs/versions/cli-text.js +5 -0
- package/dist-cjs/versions/cli.js +19 -0
- package/dist-cjs/versions/commands.js +1 -0
- package/dist-cjs/versions/content.js +1 -0
- package/dist-cjs/versions/dates.js +1 -0
- package/dist-cjs/versions/deliver.js +2 -0
- package/dist-cjs/versions/errors.js +1 -0
- package/dist-cjs/versions/index.js +1 -0
- package/dist-cjs/versions/line.js +1 -0
- package/dist-cjs/versions/list.js +1 -0
- package/dist-cjs/versions/mcp.js +1 -0
- package/dist-cjs/versions/ports.js +1 -0
- package/dist-cjs/versions/read.js +1 -0
- package/dist-cjs/versions/restore.js +1 -0
- package/dist-cjs/versions/services.js +1 -0
- package/dist-cjs/versions/show.js +1 -0
- package/dist-cjs/versions/types.js +1 -0
- package/dist-cjs/versions/versions.js +1 -0
- package/dist-cjs/watching/coverage.js +1 -48
- package/dist-cjs/watching/index.js +1 -25
- package/dist-cjs/watching/maintenance.js +1 -208
- package/dist-cjs/watching/suspicion.js +1 -517
- package/dist-cjs/workspace/api.js +1 -110
- package/dist-cjs/workspace/entries.js +1 -82
- package/dist-cjs/workspace/identity.js +1 -32
- package/dist-cjs/workspace/index.js +1 -15
- package/dist-cjs/workspace/registry.js +1 -259
- package/dist-cjs/workspace/types.js +1 -3
- package/package.json +22 -7
- package/PURPOSE.md +0 -697
- package/dist/apply/contracts.d.ts.map +0 -1
- package/dist/apply/contracts.js.map +0 -1
- package/dist/apply/fetch-ahead.d.ts.map +0 -1
- package/dist/apply/fetch-ahead.js.map +0 -1
- package/dist/apply/index.d.ts.map +0 -1
- package/dist/apply/index.js.map +0 -1
- package/dist/apply/journey.d.ts.map +0 -1
- package/dist/apply/journey.js.map +0 -1
- package/dist/apply/lane.d.ts.map +0 -1
- package/dist/apply/lane.js.map +0 -1
- package/dist/apply/line.d.ts.map +0 -1
- package/dist/apply/line.js.map +0 -1
- package/dist/apply/plans.d.ts.map +0 -1
- package/dist/apply/plans.js.map +0 -1
- package/dist/apply/rail.d.ts.map +0 -1
- package/dist/apply/rail.js.map +0 -1
- package/dist/apply/selection.d.ts.map +0 -1
- package/dist/apply/selection.js.map +0 -1
- package/dist/apply/settling.d.ts.map +0 -1
- package/dist/apply/settling.js.map +0 -1
- package/dist/apply/showing.d.ts.map +0 -1
- package/dist/apply/showing.js.map +0 -1
- package/dist/apply/type-adapters.d.ts.map +0 -1
- package/dist/apply/type-adapters.js.map +0 -1
- package/dist/apply/window.d.ts.map +0 -1
- package/dist/apply/window.js.map +0 -1
- package/dist/clash/bodmas.d.ts.map +0 -1
- package/dist/clash/bodmas.js.map +0 -1
- package/dist/clash/echo.d.ts.map +0 -1
- package/dist/clash/echo.js.map +0 -1
- package/dist/clash/index.d.ts.map +0 -1
- package/dist/clash/index.js.map +0 -1
- package/dist/clash/local-work.d.ts.map +0 -1
- package/dist/clash/local-work.js.map +0 -1
- package/dist/clash/resolution.d.ts.map +0 -1
- package/dist/clash/resolution.js.map +0 -1
- package/dist/clash/tetris.d.ts.map +0 -1
- package/dist/clash/tetris.js.map +0 -1
- package/dist/contracts/content.d.ts.map +0 -1
- package/dist/contracts/content.js.map +0 -1
- package/dist/contracts/index.d.ts.map +0 -1
- package/dist/contracts/index.js.map +0 -1
- package/dist/contracts/protection.d.ts.map +0 -1
- package/dist/contracts/protection.js.map +0 -1
- package/dist/contracts/validate.d.ts.map +0 -1
- package/dist/contracts/validate.js.map +0 -1
- package/dist/detection/adapter-contract.d.ts.map +0 -1
- package/dist/detection/adapter-contract.js.map +0 -1
- package/dist/detection/batch.d.ts.map +0 -1
- package/dist/detection/batch.js.map +0 -1
- package/dist/detection/classify.d.ts.map +0 -1
- package/dist/detection/classify.js.map +0 -1
- package/dist/detection/content.d.ts.map +0 -1
- package/dist/detection/content.js.map +0 -1
- package/dist/detection/dispositions.d.ts.map +0 -1
- package/dist/detection/dispositions.js.map +0 -1
- package/dist/detection/echo.d.ts.map +0 -1
- package/dist/detection/echo.js.map +0 -1
- package/dist/detection/identity.d.ts.map +0 -1
- package/dist/detection/identity.js.map +0 -1
- package/dist/detection/ignore-lines.d.ts.map +0 -1
- package/dist/detection/ignore-lines.js.map +0 -1
- package/dist/detection/index.d.ts.map +0 -1
- package/dist/detection/index.js.map +0 -1
- package/dist/detection/package-proposal.d.ts.map +0 -1
- package/dist/detection/package-proposal.js.map +0 -1
- package/dist/detection/record-order.d.ts.map +0 -1
- package/dist/detection/record-order.js.map +0 -1
- package/dist/detection/record-proposal.d.ts.map +0 -1
- package/dist/detection/record-proposal.js.map +0 -1
- package/dist/detection/refusal.d.ts.map +0 -1
- package/dist/detection/refusal.js.map +0 -1
- package/dist/detection/removals.d.ts.map +0 -1
- package/dist/detection/removals.js.map +0 -1
- package/dist/detection/scoped-identity.d.ts.map +0 -1
- package/dist/detection/scoped-identity.js.map +0 -1
- package/dist/detection/skip-defaults.d.ts.map +0 -1
- package/dist/detection/skip-defaults.js.map +0 -1
- package/dist/detection/skip-policy.d.ts.map +0 -1
- package/dist/detection/skip-policy.js.map +0 -1
- package/dist/detection/watch-boundary.d.ts.map +0 -1
- package/dist/detection/watch-boundary.js.map +0 -1
- package/dist/drive/contracts.d.ts.map +0 -1
- package/dist/drive/contracts.js.map +0 -1
- package/dist/drive/drive.d.ts.map +0 -1
- package/dist/drive/drive.js.map +0 -1
- package/dist/drive/held-removals.d.ts.map +0 -1
- package/dist/drive/held-removals.js.map +0 -1
- package/dist/drive/index.d.ts.map +0 -1
- package/dist/drive/index.js.map +0 -1
- package/dist/drive/kept.d.ts.map +0 -1
- package/dist/drive/kept.js.map +0 -1
- package/dist/drive/listing.d.ts.map +0 -1
- package/dist/drive/listing.js.map +0 -1
- package/dist/drive/map-index.d.ts.map +0 -1
- package/dist/drive/map-index.js.map +0 -1
- package/dist/drive/placements.d.ts.map +0 -1
- package/dist/drive/placements.js.map +0 -1
- package/dist/drive/records.d.ts.map +0 -1
- package/dist/drive/records.js.map +0 -1
- package/dist/drive/where.d.ts.map +0 -1
- package/dist/drive/where.js.map +0 -1
- package/dist/entities/accepted-view.d.ts.map +0 -1
- package/dist/entities/accepted-view.js.map +0 -1
- package/dist/entities/bytes.d.ts.map +0 -1
- package/dist/entities/bytes.js.map +0 -1
- package/dist/entities/cloud.d.ts.map +0 -1
- package/dist/entities/cloud.js.map +0 -1
- package/dist/entities/graph-head.d.ts.map +0 -1
- package/dist/entities/graph-head.js.map +0 -1
- package/dist/entities/graph-pages.d.ts.map +0 -1
- package/dist/entities/graph-pages.js.map +0 -1
- package/dist/entities/index.d.ts.map +0 -1
- package/dist/entities/index.js.map +0 -1
- package/dist/entities/package-pages.d.ts.map +0 -1
- package/dist/entities/package-pages.js.map +0 -1
- package/dist/entities/placement-owed.d.ts.map +0 -1
- package/dist/entities/placement-owed.js.map +0 -1
- package/dist/entities/reducer.d.ts.map +0 -1
- package/dist/entities/reducer.js.map +0 -1
- package/dist/entities/registry-graph.d.ts.map +0 -1
- package/dist/entities/registry-graph.js.map +0 -1
- package/dist/entities/rules.d.ts.map +0 -1
- package/dist/entities/rules.js.map +0 -1
- package/dist/entities/types.d.ts.map +0 -1
- package/dist/entities/types.js.map +0 -1
- package/dist/entities/units.d.ts.map +0 -1
- package/dist/entities/units.js.map +0 -1
- package/dist/faults/classify.d.ts.map +0 -1
- package/dist/faults/classify.js.map +0 -1
- package/dist/faults/index.d.ts.map +0 -1
- package/dist/faults/index.js.map +0 -1
- package/dist/faults/need.d.ts.map +0 -1
- package/dist/faults/need.js.map +0 -1
- package/dist/faults/recover.d.ts.map +0 -1
- package/dist/faults/recover.js.map +0 -1
- package/dist/faults/report.d.ts.map +0 -1
- package/dist/faults/report.js.map +0 -1
- package/dist/faults/scrub.d.ts.map +0 -1
- package/dist/faults/scrub.js.map +0 -1
- package/dist/faults/wire.d.ts.map +0 -1
- package/dist/faults/wire.js.map +0 -1
- package/dist/files/accepted-files.d.ts.map +0 -1
- package/dist/files/accepted-files.js.map +0 -1
- package/dist/files/api.d.ts.map +0 -1
- package/dist/files/api.js.map +0 -1
- package/dist/files/browse-types.d.ts.map +0 -1
- package/dist/files/browse-types.js.map +0 -1
- package/dist/files/browser.d.ts.map +0 -1
- package/dist/files/browser.js.map +0 -1
- package/dist/files/cloud-files.d.ts.map +0 -1
- package/dist/files/cloud-files.js.map +0 -1
- package/dist/files/commands.d.ts.map +0 -1
- package/dist/files/commands.js.map +0 -1
- package/dist/files/computer-address.d.ts.map +0 -1
- package/dist/files/computer-address.js.map +0 -1
- package/dist/files/index.d.ts.map +0 -1
- package/dist/files/index.js.map +0 -1
- package/dist/files/local-files.d.ts.map +0 -1
- package/dist/files/local-files.js.map +0 -1
- package/dist/files/media-type.d.ts.map +0 -1
- package/dist/files/media-type.js.map +0 -1
- package/dist/files/own-folders.d.ts.map +0 -1
- package/dist/files/own-folders.js.map +0 -1
- package/dist/files/plans.d.ts.map +0 -1
- package/dist/files/plans.js.map +0 -1
- package/dist/files/trash.d.ts.map +0 -1
- package/dist/files/trash.js.map +0 -1
- package/dist/files/usage-categories.d.ts.map +0 -1
- package/dist/files/usage-categories.js.map +0 -1
- package/dist/files/usage-chain.d.ts.map +0 -1
- package/dist/files/usage-chain.js.map +0 -1
- package/dist/files/usage-effect.d.ts.map +0 -1
- package/dist/files/usage-effect.js.map +0 -1
- package/dist/files/usage.d.ts.map +0 -1
- package/dist/files/usage.js.map +0 -1
- package/dist/git/alternates.d.ts.map +0 -1
- package/dist/git/alternates.js.map +0 -1
- package/dist/git/artifact.d.ts.map +0 -1
- package/dist/git/artifact.js.map +0 -1
- package/dist/git/chain.d.ts.map +0 -1
- package/dist/git/chain.js.map +0 -1
- package/dist/git/commands.d.ts +0 -3
- package/dist/git/commands.d.ts.map +0 -1
- package/dist/git/commands.js +0 -35
- package/dist/git/commands.js.map +0 -1
- package/dist/git/index.d.ts.map +0 -1
- package/dist/git/index.js.map +0 -1
- package/dist/git/plan.d.ts.map +0 -1
- package/dist/git/plan.js.map +0 -1
- package/dist/git/play.d.ts.map +0 -1
- package/dist/git/play.js.map +0 -1
- package/dist/git/refs.d.ts.map +0 -1
- package/dist/git/refs.js.map +0 -1
- package/dist/git/state.d.ts.map +0 -1
- package/dist/git/state.js.map +0 -1
- package/dist/git/tag.d.ts.map +0 -1
- package/dist/git/tag.js.map +0 -1
- package/dist/git/text.d.ts.map +0 -1
- package/dist/git/text.js.map +0 -1
- package/dist/git/turns.d.ts.map +0 -1
- package/dist/git/turns.js.map +0 -1
- package/dist/history/history.d.ts.map +0 -1
- package/dist/history/history.js.map +0 -1
- package/dist/history/index.d.ts.map +0 -1
- package/dist/history/index.js.map +0 -1
- package/dist/history/rule.d.ts.map +0 -1
- package/dist/history/rule.js.map +0 -1
- package/dist/history/types.d.ts.map +0 -1
- package/dist/history/types.js.map +0 -1
- package/dist/history/version.d.ts.map +0 -1
- package/dist/history/version.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/records/authority.d.ts.map +0 -1
- package/dist/records/authority.js.map +0 -1
- package/dist/records/codec.d.ts.map +0 -1
- package/dist/records/codec.js.map +0 -1
- package/dist/records/contracts.d.ts.map +0 -1
- package/dist/records/contracts.js.map +0 -1
- package/dist/records/inbox.d.ts.map +0 -1
- package/dist/records/inbox.js.map +0 -1
- package/dist/records/index.d.ts.map +0 -1
- package/dist/records/index.js.map +0 -1
- package/dist/records/intentional.d.ts.map +0 -1
- package/dist/records/intentional.js.map +0 -1
- package/dist/records/outbox.d.ts.map +0 -1
- package/dist/records/outbox.js.map +0 -1
- package/dist/records/owned-effects.d.ts.map +0 -1
- package/dist/records/owned-effects.js.map +0 -1
- package/dist/records/publication.d.ts.map +0 -1
- package/dist/records/publication.js.map +0 -1
- package/dist/records/rail-ports.d.ts.map +0 -1
- package/dist/records/rail-ports.js.map +0 -1
- package/dist/records/rail.d.ts.map +0 -1
- package/dist/records/rail.js.map +0 -1
- package/dist/records/receive-channel.d.ts.map +0 -1
- package/dist/records/receive-channel.js.map +0 -1
- package/dist/records/receive-loop.d.ts.map +0 -1
- package/dist/records/receive-loop.js.map +0 -1
- package/dist/records/receive-pages.d.ts.map +0 -1
- package/dist/records/receive-pages.js.map +0 -1
- package/dist/records/retry-clock.d.ts.map +0 -1
- package/dist/records/retry-clock.js.map +0 -1
- package/dist/records/send-batch.d.ts.map +0 -1
- package/dist/records/send-batch.js.map +0 -1
- package/dist/records/send-freeing.d.ts.map +0 -1
- package/dist/records/send-freeing.js.map +0 -1
- package/dist/records/send-line.d.ts.map +0 -1
- package/dist/records/send-line.js.map +0 -1
- package/dist/records/send-preparation.d.ts.map +0 -1
- package/dist/records/send-preparation.js.map +0 -1
- package/dist/records/submit-frame.d.ts.map +0 -1
- package/dist/records/submit-frame.js.map +0 -1
- package/dist/records/unsent-count.d.ts.map +0 -1
- package/dist/records/unsent-count.js.map +0 -1
- package/dist/records/wire.d.ts.map +0 -1
- package/dist/records/wire.js.map +0 -1
- package/dist/registration/home-layout.d.ts.map +0 -1
- package/dist/registration/home-layout.js.map +0 -1
- package/dist/registration/index.d.ts.map +0 -1
- package/dist/registration/index.js.map +0 -1
- package/dist/registration/user-ground.d.ts.map +0 -1
- package/dist/registration/user-ground.js.map +0 -1
- package/dist/sharing/access.d.ts.map +0 -1
- package/dist/sharing/access.js.map +0 -1
- package/dist/sharing/cli.d.ts.map +0 -1
- package/dist/sharing/cli.js.map +0 -1
- package/dist/sharing/command-input.d.ts.map +0 -1
- package/dist/sharing/command-input.js +0 -63
- package/dist/sharing/command-input.js.map +0 -1
- package/dist/sharing/commands.d.ts.map +0 -1
- package/dist/sharing/commands.js.map +0 -1
- package/dist/sharing/construct.d.ts.map +0 -1
- package/dist/sharing/construct.js.map +0 -1
- package/dist/sharing/download.d.ts.map +0 -1
- package/dist/sharing/download.js.map +0 -1
- package/dist/sharing/entity.d.ts.map +0 -1
- package/dist/sharing/entity.js.map +0 -1
- package/dist/sharing/errors.d.ts.map +0 -1
- package/dist/sharing/errors.js.map +0 -1
- package/dist/sharing/grants.d.ts.map +0 -1
- package/dist/sharing/grants.js.map +0 -1
- package/dist/sharing/index.d.ts.map +0 -1
- package/dist/sharing/index.js.map +0 -1
- package/dist/sharing/mcp.d.ts.map +0 -1
- package/dist/sharing/mcp.js.map +0 -1
- package/dist/sharing/permissions.d.ts.map +0 -1
- package/dist/sharing/permissions.js.map +0 -1
- package/dist/sharing/publish.d.ts.map +0 -1
- package/dist/sharing/publish.js.map +0 -1
- package/dist/sharing/share.d.ts.map +0 -1
- package/dist/sharing/share.js.map +0 -1
- package/dist/sharing/sharing.d.ts.map +0 -1
- package/dist/sharing/sharing.js.map +0 -1
- package/dist/sharing/types.d.ts.map +0 -1
- package/dist/sharing/types.js.map +0 -1
- package/dist/steps.d.ts.map +0 -1
- package/dist/steps.js.map +0 -1
- package/dist/transfer/artifacts.d.ts.map +0 -1
- package/dist/transfer/artifacts.js.map +0 -1
- package/dist/transfer/batches.d.ts.map +0 -1
- package/dist/transfer/batches.js.map +0 -1
- package/dist/transfer/cargo-frame.d.ts +0 -42
- package/dist/transfer/cargo-frame.d.ts.map +0 -1
- package/dist/transfer/cargo-frame.js +0 -98
- package/dist/transfer/cargo-frame.js.map +0 -1
- package/dist/transfer/cargo.d.ts.map +0 -1
- package/dist/transfer/cargo.js.map +0 -1
- package/dist/transfer/download.d.ts.map +0 -1
- package/dist/transfer/download.js.map +0 -1
- package/dist/transfer/index.d.ts.map +0 -1
- package/dist/transfer/index.js.map +0 -1
- package/dist/transfer/parallel.d.ts.map +0 -1
- package/dist/transfer/parallel.js.map +0 -1
- package/dist/transfer/ranges.d.ts.map +0 -1
- package/dist/transfer/ranges.js.map +0 -1
- package/dist/transfer/refs.d.ts.map +0 -1
- package/dist/transfer/refs.js.map +0 -1
- package/dist/transfer/upload.d.ts.map +0 -1
- package/dist/transfer/upload.js.map +0 -1
- package/dist/watching/coverage.d.ts.map +0 -1
- package/dist/watching/coverage.js.map +0 -1
- package/dist/watching/index.d.ts.map +0 -1
- package/dist/watching/index.js.map +0 -1
- package/dist/watching/maintenance.d.ts.map +0 -1
- package/dist/watching/maintenance.js.map +0 -1
- package/dist/watching/suspicion.d.ts.map +0 -1
- package/dist/watching/suspicion.js.map +0 -1
- package/dist/workspace/api.d.ts.map +0 -1
- package/dist/workspace/api.js.map +0 -1
- package/dist/workspace/entries.d.ts.map +0 -1
- package/dist/workspace/entries.js.map +0 -1
- package/dist/workspace/identity.d.ts.map +0 -1
- package/dist/workspace/identity.js.map +0 -1
- package/dist/workspace/index.d.ts.map +0 -1
- package/dist/workspace/index.js.map +0 -1
- package/dist/workspace/registry.d.ts.map +0 -1
- package/dist/workspace/registry.js.map +0 -1
- package/dist/workspace/types.d.ts.map +0 -1
- package/dist/workspace/types.js.map +0 -1
- package/dist-cjs/apply/contracts.js.map +0 -1
- package/dist-cjs/apply/fetch-ahead.js.map +0 -1
- package/dist-cjs/apply/index.js.map +0 -1
- package/dist-cjs/apply/journey.js.map +0 -1
- package/dist-cjs/apply/lane.js.map +0 -1
- package/dist-cjs/apply/line.js.map +0 -1
- package/dist-cjs/apply/plans.js.map +0 -1
- package/dist-cjs/apply/rail.js.map +0 -1
- package/dist-cjs/apply/selection.js.map +0 -1
- package/dist-cjs/apply/settling.js.map +0 -1
- package/dist-cjs/apply/showing.js.map +0 -1
- package/dist-cjs/apply/type-adapters.js.map +0 -1
- package/dist-cjs/apply/window.js.map +0 -1
- package/dist-cjs/clash/bodmas.js.map +0 -1
- package/dist-cjs/clash/echo.js.map +0 -1
- package/dist-cjs/clash/index.js.map +0 -1
- package/dist-cjs/clash/local-work.js.map +0 -1
- package/dist-cjs/clash/resolution.js.map +0 -1
- package/dist-cjs/clash/tetris.js.map +0 -1
- package/dist-cjs/contracts/content.js.map +0 -1
- package/dist-cjs/contracts/index.js.map +0 -1
- package/dist-cjs/contracts/protection.js.map +0 -1
- package/dist-cjs/contracts/validate.js.map +0 -1
- package/dist-cjs/detection/adapter-contract.js.map +0 -1
- package/dist-cjs/detection/batch.js.map +0 -1
- package/dist-cjs/detection/classify.js.map +0 -1
- package/dist-cjs/detection/content.js.map +0 -1
- package/dist-cjs/detection/dispositions.js.map +0 -1
- package/dist-cjs/detection/echo.js.map +0 -1
- package/dist-cjs/detection/identity.js.map +0 -1
- package/dist-cjs/detection/ignore-lines.js.map +0 -1
- package/dist-cjs/detection/index.js.map +0 -1
- package/dist-cjs/detection/package-proposal.js.map +0 -1
- package/dist-cjs/detection/record-order.js.map +0 -1
- package/dist-cjs/detection/record-proposal.js.map +0 -1
- package/dist-cjs/detection/refusal.js.map +0 -1
- package/dist-cjs/detection/removals.js.map +0 -1
- package/dist-cjs/detection/scoped-identity.js.map +0 -1
- package/dist-cjs/detection/skip-defaults.js.map +0 -1
- package/dist-cjs/detection/skip-policy.js.map +0 -1
- package/dist-cjs/detection/watch-boundary.js.map +0 -1
- package/dist-cjs/drive/contracts.js.map +0 -1
- package/dist-cjs/drive/drive.js.map +0 -1
- package/dist-cjs/drive/held-removals.js.map +0 -1
- package/dist-cjs/drive/index.js.map +0 -1
- package/dist-cjs/drive/kept.js.map +0 -1
- package/dist-cjs/drive/listing.js.map +0 -1
- package/dist-cjs/drive/map-index.js.map +0 -1
- package/dist-cjs/drive/placements.js.map +0 -1
- package/dist-cjs/drive/records.js.map +0 -1
- package/dist-cjs/drive/where.js.map +0 -1
- package/dist-cjs/entities/accepted-view.js.map +0 -1
- package/dist-cjs/entities/bytes.js.map +0 -1
- package/dist-cjs/entities/cloud.js.map +0 -1
- package/dist-cjs/entities/graph-head.js.map +0 -1
- package/dist-cjs/entities/graph-pages.js.map +0 -1
- package/dist-cjs/entities/index.js.map +0 -1
- package/dist-cjs/entities/package-pages.js.map +0 -1
- package/dist-cjs/entities/placement-owed.js.map +0 -1
- package/dist-cjs/entities/reducer.js.map +0 -1
- package/dist-cjs/entities/registry-graph.js.map +0 -1
- package/dist-cjs/entities/rules.js.map +0 -1
- package/dist-cjs/entities/types.js.map +0 -1
- package/dist-cjs/entities/units.js.map +0 -1
- package/dist-cjs/faults/classify.js.map +0 -1
- package/dist-cjs/faults/index.js.map +0 -1
- package/dist-cjs/faults/need.js.map +0 -1
- package/dist-cjs/faults/recover.js.map +0 -1
- package/dist-cjs/faults/report.js.map +0 -1
- package/dist-cjs/faults/scrub.js.map +0 -1
- package/dist-cjs/faults/wire.js.map +0 -1
- package/dist-cjs/files/accepted-files.js.map +0 -1
- package/dist-cjs/files/api.js.map +0 -1
- package/dist-cjs/files/browse-types.js.map +0 -1
- package/dist-cjs/files/browser.js.map +0 -1
- package/dist-cjs/files/cloud-files.js.map +0 -1
- package/dist-cjs/files/commands.js.map +0 -1
- package/dist-cjs/files/computer-address.js.map +0 -1
- package/dist-cjs/files/index.js.map +0 -1
- package/dist-cjs/files/local-files.js.map +0 -1
- package/dist-cjs/files/media-type.js.map +0 -1
- package/dist-cjs/files/own-folders.js.map +0 -1
- package/dist-cjs/files/plans.js.map +0 -1
- package/dist-cjs/files/trash.js.map +0 -1
- package/dist-cjs/files/usage-categories.js.map +0 -1
- package/dist-cjs/files/usage-chain.js.map +0 -1
- package/dist-cjs/files/usage-effect.js.map +0 -1
- package/dist-cjs/files/usage.js.map +0 -1
- package/dist-cjs/git/alternates.js.map +0 -1
- package/dist-cjs/git/artifact.js.map +0 -1
- package/dist-cjs/git/chain.js.map +0 -1
- package/dist-cjs/git/commands.js +0 -39
- package/dist-cjs/git/commands.js.map +0 -1
- package/dist-cjs/git/index.js.map +0 -1
- package/dist-cjs/git/plan.js.map +0 -1
- package/dist-cjs/git/play.js.map +0 -1
- package/dist-cjs/git/refs.js.map +0 -1
- package/dist-cjs/git/state.js.map +0 -1
- package/dist-cjs/git/tag.js.map +0 -1
- package/dist-cjs/git/text.js.map +0 -1
- package/dist-cjs/git/turns.js.map +0 -1
- package/dist-cjs/history/history.js.map +0 -1
- package/dist-cjs/history/index.js.map +0 -1
- package/dist-cjs/history/rule.js.map +0 -1
- package/dist-cjs/history/types.js.map +0 -1
- package/dist-cjs/history/version.js.map +0 -1
- package/dist-cjs/index.js.map +0 -1
- package/dist-cjs/records/authority.js.map +0 -1
- package/dist-cjs/records/codec.js.map +0 -1
- package/dist-cjs/records/contracts.js.map +0 -1
- package/dist-cjs/records/inbox.js.map +0 -1
- package/dist-cjs/records/index.js.map +0 -1
- package/dist-cjs/records/intentional.js.map +0 -1
- package/dist-cjs/records/outbox.js.map +0 -1
- package/dist-cjs/records/owned-effects.js.map +0 -1
- package/dist-cjs/records/publication.js.map +0 -1
- package/dist-cjs/records/rail-ports.js.map +0 -1
- package/dist-cjs/records/rail.js.map +0 -1
- package/dist-cjs/records/receive-channel.js.map +0 -1
- package/dist-cjs/records/receive-loop.js.map +0 -1
- package/dist-cjs/records/receive-pages.js.map +0 -1
- package/dist-cjs/records/retry-clock.js.map +0 -1
- package/dist-cjs/records/send-batch.js.map +0 -1
- package/dist-cjs/records/send-freeing.js.map +0 -1
- package/dist-cjs/records/send-line.js.map +0 -1
- package/dist-cjs/records/send-preparation.js.map +0 -1
- package/dist-cjs/records/submit-frame.js.map +0 -1
- package/dist-cjs/records/unsent-count.js.map +0 -1
- package/dist-cjs/records/wire.js.map +0 -1
- package/dist-cjs/registration/home-layout.js.map +0 -1
- package/dist-cjs/registration/index.js.map +0 -1
- package/dist-cjs/registration/user-ground.js.map +0 -1
- package/dist-cjs/sharing/access.js.map +0 -1
- package/dist-cjs/sharing/cli.js.map +0 -1
- package/dist-cjs/sharing/command-input.js +0 -69
- package/dist-cjs/sharing/command-input.js.map +0 -1
- package/dist-cjs/sharing/commands.js.map +0 -1
- package/dist-cjs/sharing/construct.js.map +0 -1
- package/dist-cjs/sharing/download.js.map +0 -1
- package/dist-cjs/sharing/entity.js.map +0 -1
- package/dist-cjs/sharing/errors.js.map +0 -1
- package/dist-cjs/sharing/grants.js.map +0 -1
- package/dist-cjs/sharing/index.js.map +0 -1
- package/dist-cjs/sharing/mcp.js.map +0 -1
- package/dist-cjs/sharing/permissions.js.map +0 -1
- package/dist-cjs/sharing/publish.js.map +0 -1
- package/dist-cjs/sharing/share.js.map +0 -1
- package/dist-cjs/sharing/sharing.js.map +0 -1
- package/dist-cjs/sharing/types.js.map +0 -1
- package/dist-cjs/steps.js.map +0 -1
- package/dist-cjs/transfer/artifacts.js.map +0 -1
- package/dist-cjs/transfer/batches.js.map +0 -1
- package/dist-cjs/transfer/cargo-frame.js +0 -104
- package/dist-cjs/transfer/cargo-frame.js.map +0 -1
- package/dist-cjs/transfer/cargo.js.map +0 -1
- package/dist-cjs/transfer/download.js.map +0 -1
- package/dist-cjs/transfer/index.js.map +0 -1
- package/dist-cjs/transfer/parallel.js.map +0 -1
- package/dist-cjs/transfer/ranges.js.map +0 -1
- package/dist-cjs/transfer/refs.js.map +0 -1
- package/dist-cjs/transfer/upload.js.map +0 -1
- package/dist-cjs/watching/coverage.js.map +0 -1
- package/dist-cjs/watching/index.js.map +0 -1
- package/dist-cjs/watching/maintenance.js.map +0 -1
- package/dist-cjs/watching/suspicion.js.map +0 -1
- package/dist-cjs/workspace/api.js.map +0 -1
- package/dist-cjs/workspace/entries.js.map +0 -1
- package/dist-cjs/workspace/identity.js.map +0 -1
- package/dist-cjs/workspace/index.js.map +0 -1
- package/dist-cjs/workspace/registry.js.map +0 -1
- package/dist-cjs/workspace/types.js.map +0 -1
package/dist-cjs/records/rail.js
CHANGED
|
@@ -1,199 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* One entity record rail: the Send line and the Receive loop over one
|
|
4
|
-
* authority, composed. Hosts inject every effect.
|
|
5
|
-
*
|
|
6
|
-
* Send never delays Receive, and Receive never waits for Send. They meet in
|
|
7
|
-
* two places only: a stamp rings Receive, because the origin computer
|
|
8
|
-
* follows its own accepted record through the same Inbox path as every
|
|
9
|
-
* other computer; and flush, which owes Receive exactly what its durable
|
|
10
|
-
* stamps name.
|
|
11
|
-
*/
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.EntityRecordRail = void 0;
|
|
14
|
-
const receive_loop_js_1 = require("./receive-loop.js");
|
|
15
|
-
const send_line_js_1 = require("./send-line.js");
|
|
16
|
-
const unsent_count_js_1 = require("./unsent-count.js");
|
|
17
|
-
class EntityRecordRail {
|
|
18
|
-
#authorityId;
|
|
19
|
-
#store;
|
|
20
|
-
#schedule;
|
|
21
|
-
#onOutboxAccepted;
|
|
22
|
-
#onBackgroundError;
|
|
23
|
-
#receive;
|
|
24
|
-
#send;
|
|
25
|
-
#unsent;
|
|
26
|
-
#started = false;
|
|
27
|
-
#stopping = null;
|
|
28
|
-
constructor(options) {
|
|
29
|
-
if (!options.authorityId.trim())
|
|
30
|
-
throw new Error('entity record authority is required');
|
|
31
|
-
this.#authorityId = options.authorityId;
|
|
32
|
-
this.#store = options.store;
|
|
33
|
-
this.#schedule = options.schedule;
|
|
34
|
-
this.#onOutboxAccepted = options.onOutboxAccepted ?? (() => undefined);
|
|
35
|
-
this.#onBackgroundError = options.onBackgroundError ?? (() => undefined);
|
|
36
|
-
const onError = (error) => this.#report(error);
|
|
37
|
-
this.#receive = new receive_loop_js_1.ReceiveLoop({
|
|
38
|
-
authorityId: options.authorityId,
|
|
39
|
-
store: options.store,
|
|
40
|
-
authority: options.authority,
|
|
41
|
-
schedule: options.schedule,
|
|
42
|
-
channels: options.channels ?? [],
|
|
43
|
-
onInboxCommitted: options.onInboxCommitted ?? (() => undefined),
|
|
44
|
-
onError,
|
|
45
|
-
});
|
|
46
|
-
this.#send = new send_line_js_1.SendLine({
|
|
47
|
-
store: options.store,
|
|
48
|
-
cargo: options.cargo,
|
|
49
|
-
authority: options.authority,
|
|
50
|
-
schedule: options.schedule,
|
|
51
|
-
onStamped: (stamps) => this.#stamped(stamps),
|
|
52
|
-
onError,
|
|
53
|
-
});
|
|
54
|
-
const onUnsent = options.onUnsent;
|
|
55
|
-
this.#unsent = onUnsent
|
|
56
|
-
? new unsent_count_js_1.UnsentCount({ read: () => options.store.countPending(), say: onUnsent, onError, schedule: options.schedule })
|
|
57
|
-
: null;
|
|
58
|
-
}
|
|
59
|
-
/** Starting is local. Receive listens and begins catching up from its
|
|
60
|
-
* durable cursors, and Send inherits the saved Outbox; it resolves once
|
|
61
|
-
* Send has read it, never on an authority answer, so a computer with no
|
|
62
|
-
* network starts and records. A caller that needs the authority's history
|
|
63
|
-
* asks for it: receiveCurrent, receiveThrough. */
|
|
64
|
-
async start() {
|
|
65
|
-
if (this.#started)
|
|
66
|
-
throw new Error('entity record rail already started');
|
|
67
|
-
if (this.#stopping)
|
|
68
|
-
throw new Error('entity record rail is stopped');
|
|
69
|
-
this.#started = true;
|
|
70
|
-
this.#unsent?.changed();
|
|
71
|
-
this.#receive.start();
|
|
72
|
-
await this.#send.start();
|
|
73
|
-
}
|
|
74
|
-
/** Why Send is paused, or null while it sends: the authority refused its
|
|
75
|
-
* head over the storage limit, and rings when that may change. */
|
|
76
|
-
get sendPaused() {
|
|
77
|
-
return this.#send.paused;
|
|
78
|
-
}
|
|
79
|
-
/** Record calls this only after its local Outbox transaction commits. */
|
|
80
|
-
localRecordsAvailable() {
|
|
81
|
-
this.#unsent?.changed();
|
|
82
|
-
this.#send.wake();
|
|
83
|
-
}
|
|
84
|
-
/** Begin following one entity channel: a grant arrived. Idempotent. */
|
|
85
|
-
hold(entityId) {
|
|
86
|
-
this.#receive.hold(entityId);
|
|
87
|
-
}
|
|
88
|
-
/** Stop following one entity channel: a grant was revoked. Idempotent. */
|
|
89
|
-
release(entityId) {
|
|
90
|
-
this.#receive.release(entityId);
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Await the rows the Outbox holds now, and only those. Every one is durably
|
|
94
|
-
* stamped, and Receive has covered each stamp's original position, read
|
|
95
|
-
* back from the durable stamps: this authority's delivery cursor reaches
|
|
96
|
-
* it, or, for another authority's entity, that entity's cursor does,
|
|
97
|
-
* whether or not its channel is held. An installed snapshot that raised a
|
|
98
|
-
* cursor past a position covers it. Later rows and availability never
|
|
99
|
-
* extend it; a failure past its rows never answers it.
|
|
100
|
-
*/
|
|
101
|
-
async flush() {
|
|
102
|
-
if (!this.#started)
|
|
103
|
-
throw new Error('entity record rail has not started');
|
|
104
|
-
if (this.#stopping)
|
|
105
|
-
throw new Error('entity record rail is stopped');
|
|
106
|
-
await this.#receive.coverReceipts(await this.#send.settle());
|
|
107
|
-
}
|
|
108
|
-
/** Resolves once this authority's gap-free delivery cursor reaches
|
|
109
|
-
* `watermark`; see ReceiveLoop.receiveThrough. */
|
|
110
|
-
async receiveThrough(watermark) {
|
|
111
|
-
if (!this.#started)
|
|
112
|
-
throw new Error('entity record rail has not started');
|
|
113
|
-
await this.#receive.receiveThrough(watermark);
|
|
114
|
-
}
|
|
115
|
-
/** Resolves once this authority's tail holds the history as it stands;
|
|
116
|
-
* see ReceiveLoop.receiveCurrent. */
|
|
117
|
-
async receiveCurrent() {
|
|
118
|
-
if (!this.#started)
|
|
119
|
-
throw new Error('entity record rail has not started');
|
|
120
|
-
await this.#receive.receiveCurrent();
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Spend at most `budgetMs` sending what the Outbox holds now, then stop:
|
|
124
|
-
* `interrupt` cancels the requests still in flight, and close resolves once
|
|
125
|
-
* they settle. What remains is reported, never claimed as synchronized; a
|
|
126
|
-
* line paused over the storage limit closes at once, its rows held here.
|
|
127
|
-
*/
|
|
128
|
-
async close(budgetMs, interrupt) {
|
|
129
|
-
if (!Number.isFinite(budgetMs) || budgetMs < 0) {
|
|
130
|
-
throw new Error('entity record close budget must be a non-negative number of milliseconds');
|
|
131
|
-
}
|
|
132
|
-
const stamped = this.#send.stamped;
|
|
133
|
-
if (this.#started && !this.#stopping && budgetMs > 0) {
|
|
134
|
-
let expire = () => undefined;
|
|
135
|
-
const deadline = new Promise((resolve) => { expire = resolve; });
|
|
136
|
-
const timer = this.#schedule.schedule(budgetMs, () => expire());
|
|
137
|
-
try {
|
|
138
|
-
const sent = this.#send.settle();
|
|
139
|
-
await Promise.race([sent.catch((error) => {
|
|
140
|
-
// A paused line was reported when it paused; closing says nothing new.
|
|
141
|
-
if (!this.#stopping && error !== this.#send.paused)
|
|
142
|
-
this.#report(error);
|
|
143
|
-
}), deadline]);
|
|
144
|
-
}
|
|
145
|
-
finally {
|
|
146
|
-
timer.cancel();
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
const stopped = this.stop();
|
|
150
|
-
await interrupt();
|
|
151
|
-
await stopped;
|
|
152
|
-
return {
|
|
153
|
-
accepted: this.#send.stamped - stamped,
|
|
154
|
-
pending: await this.#store.countPending(),
|
|
155
|
-
unconfirmed: await this.#store.countPending(this.#send.uncertainThrough),
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
/** Stop accepting events, and resolve once in-flight work settles. Closing
|
|
159
|
-
* the injected wire may interrupt a request. Every call shares one stop. */
|
|
160
|
-
stop() {
|
|
161
|
-
this.#stopping ??= Promise.all([
|
|
162
|
-
this.#receive.stop(),
|
|
163
|
-
this.#send.stop(),
|
|
164
|
-
this.#unsent?.stop(),
|
|
165
|
-
]).then(() => undefined);
|
|
166
|
-
return this.#stopping;
|
|
167
|
-
}
|
|
168
|
-
#stamped(stamps) {
|
|
169
|
-
this.#unsent?.changed();
|
|
170
|
-
const entityIds = new Set();
|
|
171
|
-
let ownTail = false;
|
|
172
|
-
for (const { accepted } of stamps) {
|
|
173
|
-
entityIds.add(accepted.entityId);
|
|
174
|
-
if (accepted.authorityId === this.#authorityId)
|
|
175
|
-
ownTail = true;
|
|
176
|
-
else
|
|
177
|
-
this.#receive.ring({ authorityId: accepted.authorityId, entityId: accepted.entityId });
|
|
178
|
-
}
|
|
179
|
-
if (ownTail)
|
|
180
|
-
this.#receive.ring({ authorityId: this.#authorityId, entityId: null });
|
|
181
|
-
try {
|
|
182
|
-
this.#onOutboxAccepted([...entityIds]);
|
|
183
|
-
}
|
|
184
|
-
catch (error) {
|
|
185
|
-
this.#report(error);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
/** Report a background failure. A failing reporter changes nothing. */
|
|
189
|
-
#report(error) {
|
|
190
|
-
try {
|
|
191
|
-
this.#onBackgroundError(error);
|
|
192
|
-
}
|
|
193
|
-
catch {
|
|
194
|
-
// The failure was already handled; only its report was lost.
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
exports.EntityRecordRail = EntityRecordRail;
|
|
199
|
-
//# sourceMappingURL=rail.js.map
|
|
1
|
+
"use strict";var u=Object.defineProperty;var s=(h,t)=>u(h,"name",{value:t,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.EntityRecordRail=void 0;const l=require("./receive-loop.js"),y=require("./send-line.js"),w=require("./unsent-count.js");class f{static{s(this,"EntityRecordRail")}#n;#h;#d;#o;#c;#e;#t;#s;#r=!1;#i=null;constructor(t){if(!t.authorityId.trim())throw new Error("entity record authority is required");this.#n=t.authorityId,this.#h=t.store,this.#d=t.schedule,this.#o=t.onOutboxAccepted??(()=>{}),this.#c=t.onBackgroundError??(()=>{});const r=s(e=>this.#a(e),"onError");this.#e=new l.ReceiveLoop({authorityId:t.authorityId,store:t.store,authority:t.authority,schedule:t.schedule,channels:t.channels??[],onInboxCommitted:t.onInboxCommitted??(()=>{}),onError:r}),this.#t=new y.SendLine({store:t.store,cargo:t.cargo,authority:t.authority,schedule:t.schedule,onStamped:s(e=>this.#u(e),"onStamped"),onError:r});const i=t.onUnsent;this.#s=i?new w.UnsentCount({read:s(()=>t.store.countPending(),"read"),say:i,onError:r,schedule:t.schedule}):null}async start(){if(this.#r)throw new Error("entity record rail already started");if(this.#i)throw new Error("entity record rail is stopped");this.#r=!0,this.#s?.changed(),this.#e.start(),await this.#t.start()}get sendPaused(){return this.#t.paused}get sendHeld(){return this.#t.held}localRecordsAvailable(){this.#s?.changed(),this.#t.wake()}hold(t){this.#e.hold(t)}release(t){this.#e.release(t)}async flush(){if(!this.#r)throw new Error("entity record rail has not started");if(this.#i)throw new Error("entity record rail is stopped");await this.#e.coverReceipts(await this.#t.settle())}async receiveThrough(t){if(!this.#r)throw new Error("entity record rail has not started");await this.#e.receiveThrough(t)}async receiveCurrent(){if(!this.#r)throw new Error("entity record rail has not started");await this.#e.receiveCurrent()}async close(t,r){if(!Number.isFinite(t)||t<0)throw new Error("entity record close budget must be a non-negative number of milliseconds");const i=this.#t.stamped;if(this.#r&&!this.#i&&t>0){let a=s(()=>{},"expire");const o=new Promise(n=>{a=n}),c=this.#d.schedule(t,()=>a());try{const n=this.#t.settle();await Promise.race([n.catch(d=>{!this.#i&&d!==this.#t.paused&&this.#a(d)}),o])}finally{c.cancel()}}const e=this.stop();return await r(),await e,{accepted:this.#t.stamped-i,pending:await this.#h.countPending(),unconfirmed:await this.#h.countPending(this.#t.uncertainThrough)}}stop(){return this.#i??=Promise.all([this.#e.stop(),this.#t.stop(),this.#s?.stop()]).then(()=>{}),this.#i}#u(t){this.#s?.changed();const r=new Set;let i=!1;for(const{accepted:e}of t)r.add(e.entityId),e.authorityId===this.#n?i=!0:this.#e.ring({authorityId:e.authorityId,entityId:e.entityId});i&&this.#e.ring({authorityId:this.#n,entityId:null});try{this.#o([...r])}catch(e){this.#a(e)}}#a(t){try{this.#c(t)}catch{}}}exports.EntityRecordRail=f;
|
|
@@ -1,136 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* One history Receive follows: this authority's delivery tail, or one
|
|
4
|
-
* entity's channel. It keeps the highest durable cursor Receive has observed
|
|
5
|
-
* there, and the callers waiting for a position the authority committed.
|
|
6
|
-
*
|
|
7
|
-
* Waiting is synchronous against that frontier, so no commit can slip
|
|
8
|
-
* between reading a cursor and waiting on it: a target the frontier covers
|
|
9
|
-
* answers at once, and any other waits for the channel's turns, each of
|
|
10
|
-
* which first reads the durable cursor. A commit answers every target it
|
|
11
|
-
* covers, so later pages can neither delay nor fail it. Each waiter is owed
|
|
12
|
-
* only by turns that begin after it: a turn that ends caught up below its
|
|
13
|
-
* target proves that history unavailable from this cursor, and a failed turn
|
|
14
|
-
* answers it with that failure. A turn that ends on a full page answers
|
|
15
|
-
* nothing; another turn follows. A caller that names no target waits for
|
|
16
|
-
* the history as it stands: the first turn begun after it that ends caught
|
|
17
|
-
* up answers it, holding every position the authority had committed when
|
|
18
|
-
* that turn read.
|
|
19
|
-
*
|
|
20
|
-
* Receive keeps a channel while it is needed: a grant holds it, a caller
|
|
21
|
-
* waits on it, or a turn owns it. Only an unneeded channel is forgotten, so
|
|
22
|
-
* a later doorbell always finds the one channel a hold left behind.
|
|
23
|
-
*/
|
|
24
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.ReceiveChannel = exports.EntityRecordHistoryUnavailableError = void 0;
|
|
26
|
-
/** A tail or channel ended below a position it already named: that prefix
|
|
27
|
-
* is no longer followable from this cursor. The cursor is never skipped;
|
|
28
|
-
* only a verified snapshot at or past the watermark can recover. History the
|
|
29
|
-
* cloud promised to keep is gone: a `history-missing` need on the entity, or
|
|
30
|
-
* on the authority for its tail. */
|
|
31
|
-
class EntityRecordHistoryUnavailableError extends Error {
|
|
32
|
-
/** The authority tail, or the entity channel, that fell short. */
|
|
33
|
-
channel;
|
|
34
|
-
reached;
|
|
35
|
-
watermark;
|
|
36
|
-
need;
|
|
37
|
-
constructor(channel, entityId, reached, watermark) {
|
|
38
|
-
super(`${channel} delivered through ${reached}, below its watermark ${watermark}`);
|
|
39
|
-
this.name = 'EntityRecordHistoryUnavailableError';
|
|
40
|
-
this.channel = channel;
|
|
41
|
-
this.reached = reached;
|
|
42
|
-
this.watermark = watermark;
|
|
43
|
-
this.need = {
|
|
44
|
-
law: 'history-missing',
|
|
45
|
-
trigger: 'below-watermark',
|
|
46
|
-
subject: entityId === null ? { id: channel, type: 'authority' } : { id: entityId, type: null },
|
|
47
|
-
lost: String(watermark),
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.EntityRecordHistoryUnavailableError = EntityRecordHistoryUnavailableError;
|
|
52
|
-
class ReceiveChannel {
|
|
53
|
-
/** The authority for the tail, or the entity, as unavailable errors name it. */
|
|
54
|
-
name;
|
|
55
|
-
/** The followed entity, or null for this authority's tail. */
|
|
56
|
-
entityId;
|
|
57
|
-
/** A grant holds this channel. The tail is always held. */
|
|
58
|
-
held;
|
|
59
|
-
/** The highest durable cursor observed; -1 before the first turn. */
|
|
60
|
-
#frontier = -1;
|
|
61
|
-
#turns = 0;
|
|
62
|
-
#turning = false;
|
|
63
|
-
#waiting = [];
|
|
64
|
-
constructor(name, entityId, held) {
|
|
65
|
-
this.name = name;
|
|
66
|
-
this.entityId = entityId;
|
|
67
|
-
this.held = held;
|
|
68
|
-
}
|
|
69
|
-
/** Receive must keep it: a grant holds it, a caller waits on it, or a
|
|
70
|
-
* turn owns it. */
|
|
71
|
-
get needed() {
|
|
72
|
-
return this.held || this.#waiting.length > 0 || this.#turning;
|
|
73
|
-
}
|
|
74
|
-
covers(target) {
|
|
75
|
-
return target <= this.#frontier;
|
|
76
|
-
}
|
|
77
|
-
/** Wait for a target the frontier does not cover yet, or, with null, for
|
|
78
|
-
* the next turn that ends caught up. */
|
|
79
|
-
wait(target) {
|
|
80
|
-
return new Promise((resolve, reject) => {
|
|
81
|
-
this.#waiting.push({ target, since: this.#turns, resolve, reject });
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
/** A turn begins; the waiters already here are owed by it. */
|
|
85
|
-
beginTurn() {
|
|
86
|
-
this.#turning = true;
|
|
87
|
-
this.#turns += 1;
|
|
88
|
-
return this.#turns;
|
|
89
|
-
}
|
|
90
|
-
/** The turn in flight ended, however it ended. */
|
|
91
|
-
endTurn() {
|
|
92
|
-
this.#turning = false;
|
|
93
|
-
}
|
|
94
|
-
/** The durable cursor was observed at `cursor`. */
|
|
95
|
-
observe(cursor) {
|
|
96
|
-
if (cursor <= this.#frontier)
|
|
97
|
-
return;
|
|
98
|
-
this.#frontier = cursor;
|
|
99
|
-
this.#answer((waiter) => waiter.target !== null && waiter.target <= cursor ? () => waiter.resolve() : null);
|
|
100
|
-
}
|
|
101
|
-
/** Turn `turn` ended caught up, holding everything the authority had. */
|
|
102
|
-
caughtUp(turn) {
|
|
103
|
-
const reached = this.#frontier;
|
|
104
|
-
this.#answer(({ since, target, resolve, reject }) => {
|
|
105
|
-
if (since >= turn)
|
|
106
|
-
return null;
|
|
107
|
-
if (target === null)
|
|
108
|
-
return resolve;
|
|
109
|
-
return () => reject(new EntityRecordHistoryUnavailableError(this.name, this.entityId, reached, target));
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
/** Turn `turn` failed. */
|
|
113
|
-
failed(turn, error) {
|
|
114
|
-
this.#answer((waiter) => waiter.since < turn ? () => waiter.reject(error) : null);
|
|
115
|
-
}
|
|
116
|
-
/** Answer every waiter left with this failure. */
|
|
117
|
-
stop(error) {
|
|
118
|
-
this.#answer((waiter) => () => waiter.reject(error));
|
|
119
|
-
}
|
|
120
|
-
#answer(answer) {
|
|
121
|
-
const waiting = [];
|
|
122
|
-
const answers = [];
|
|
123
|
-
for (const waiter of this.#waiting) {
|
|
124
|
-
const settle = answer(waiter);
|
|
125
|
-
if (settle)
|
|
126
|
-
answers.push(settle);
|
|
127
|
-
else
|
|
128
|
-
waiting.push(waiter);
|
|
129
|
-
}
|
|
130
|
-
this.#waiting = waiting;
|
|
131
|
-
for (const settle of answers)
|
|
132
|
-
settle();
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
exports.ReceiveChannel = ReceiveChannel;
|
|
136
|
-
//# sourceMappingURL=receive-channel.js.map
|
|
1
|
+
"use strict";var a=Object.defineProperty;var h=(n,e)=>a(n,"name",{value:e,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReceiveChannel=exports.EntityRecordHistoryUnavailableError=void 0;class l extends Error{static{h(this,"EntityRecordHistoryUnavailableError")}channel;reached;watermark;need;constructor(e,t,i,r){super(`${e} delivered through ${i}, below its watermark ${r}`),this.name="EntityRecordHistoryUnavailableError",this.channel=e,this.reached=i,this.watermark=r,this.need={law:"history-missing",trigger:"below-watermark",subject:t===null?{id:e,type:"authority"}:{id:t,type:null},lost:String(r)}}}exports.EntityRecordHistoryUnavailableError=l;class u{static{h(this,"ReceiveChannel")}name;entityId;held;#e=-1;#r=0;#s=!1;#t=[];constructor(e,t,i){this.name=e,this.entityId=t,this.held=i}get needed(){return this.held||this.#t.length>0||this.#s}covers(e){return e<=this.#e}wait(e){return new Promise((t,i)=>{this.#t.push({target:e,since:this.#r,resolve:t,reject:i})})}beginTurn(){return this.#s=!0,this.#r+=1,this.#r}endTurn(){this.#s=!1}observe(e){e<=this.#e||(this.#e=e,this.#i(t=>t.target!==null&&t.target<=e?()=>t.resolve():null))}caughtUp(e){const t=this.#e;this.#i(({since:i,target:r,resolve:s,reject:o})=>i>=e?null:r===null?s:()=>o(new l(this.name,this.entityId,t,r)))}failed(e,t){this.#i(i=>i.since<e?()=>i.reject(t):null)}stop(e){this.#i(t=>()=>t.reject(e))}#i(e){const t=[],i=[];for(const r of this.#t){const s=e(r);s?i.push(s):t.push(r)}this.#t=t;for(const r of i)r()}}exports.ReceiveChannel=u;
|
|
@@ -1,282 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Receive is one loop over one authority's delivery tail and the entity
|
|
4
|
-
* channels this computer follows: those a grant holds, and those a caller
|
|
5
|
-
* waits on. It subscribes before it catches up and reads from its durable
|
|
6
|
-
* cursors. A doorbell only flags a channel; the tail and the channels are
|
|
7
|
-
* the truth. Idle, it reads nothing.
|
|
8
|
-
*
|
|
9
|
-
* Flagged channels take turns, one page each (receive-pages.ts), in the
|
|
10
|
-
* order they were flagged, so no channel's traffic can delay another's by
|
|
11
|
-
* more than one page per channel. A channel whose page was full takes its
|
|
12
|
-
* next turn after the others. A failed turn parks only its own channel, and
|
|
13
|
-
* answers only the callers it owed (receive-channel.ts), until the backoff
|
|
14
|
-
* fires; disconnect parks every channel. The backoff resets once every
|
|
15
|
-
* channel has caught up. Starting waits for no answer: a caller that needs
|
|
16
|
-
* the authority's history asks for it (receiveCurrent, receiveThrough).
|
|
17
|
-
*
|
|
18
|
-
* The loop owns every effect a turn starts (owned-effects.ts): after stop a
|
|
19
|
-
* turn starts nothing more and acts on no late answer. Receive keeps a
|
|
20
|
-
* channel while a grant holds it, a caller waits on it, or a turn owns it,
|
|
21
|
-
* so a channel released and held again mid-turn stays the one channel.
|
|
22
|
-
*/
|
|
23
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.ReceiveLoop = void 0;
|
|
25
|
-
const receive_channel_js_1 = require("./receive-channel.js");
|
|
26
|
-
const receive_pages_js_1 = require("./receive-pages.js");
|
|
27
|
-
const owned_effects_js_1 = require("./owned-effects.js");
|
|
28
|
-
const retry_clock_js_1 = require("./retry-clock.js");
|
|
29
|
-
const stopped = () => new Error('entity record rail stopped before reaching its watermark');
|
|
30
|
-
const checkPosition = (position) => {
|
|
31
|
-
if (!Number.isSafeInteger(position) || position < 0) {
|
|
32
|
-
throw new Error('entity record watermark must be a non-negative integer');
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
class ReceiveLoop {
|
|
36
|
-
#authorityId;
|
|
37
|
-
#store;
|
|
38
|
-
#authority;
|
|
39
|
-
#pages;
|
|
40
|
-
#onError;
|
|
41
|
-
#retry;
|
|
42
|
-
#effects = new owned_effects_js_1.OwnedEffects(stopped);
|
|
43
|
-
#tail;
|
|
44
|
-
/** Every entity channel Receive keeps now. */
|
|
45
|
-
#entities = new Map();
|
|
46
|
-
/** Flagged channels, in turn order, each at most once. */
|
|
47
|
-
#flagged = new Set();
|
|
48
|
-
/** Channels that wait for the backoff. */
|
|
49
|
-
#parked = new Set();
|
|
50
|
-
#started = false;
|
|
51
|
-
#stopped = false;
|
|
52
|
-
/** The turns in flight. Never rejects. */
|
|
53
|
-
#receiving = null;
|
|
54
|
-
#removeListeners = [];
|
|
55
|
-
constructor(options) {
|
|
56
|
-
this.#authorityId = options.authorityId;
|
|
57
|
-
this.#store = options.store;
|
|
58
|
-
this.#authority = options.authority;
|
|
59
|
-
this.#onError = options.onError;
|
|
60
|
-
this.#pages = {
|
|
61
|
-
store: options.store,
|
|
62
|
-
authority: options.authority,
|
|
63
|
-
run: (effect) => this.#effects.run(effect),
|
|
64
|
-
// The commit is durable whether or not its doorbell rings: a failing
|
|
65
|
-
// doorbell is reported, never charged to the read that committed.
|
|
66
|
-
onInboxCommitted: () => {
|
|
67
|
-
try {
|
|
68
|
-
options.onInboxCommitted();
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
this.#onError(error);
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
this.#retry = new retry_clock_js_1.RetryClock(options.schedule);
|
|
76
|
-
this.#tail = new receive_channel_js_1.ReceiveChannel(options.authorityId, null, true);
|
|
77
|
-
for (const entityId of options.channels)
|
|
78
|
-
this.#entity(entityId).held = true;
|
|
79
|
-
}
|
|
80
|
-
/** Listen, then begin catching up from the durable cursors. */
|
|
81
|
-
start() {
|
|
82
|
-
this.#started = true;
|
|
83
|
-
this.#removeListeners = [
|
|
84
|
-
this.#authority.onAvailable((signal) => this.ring(signal)),
|
|
85
|
-
this.#authority.onDisconnect(() => {
|
|
86
|
-
if (this.#stopped)
|
|
87
|
-
return;
|
|
88
|
-
for (const channel of this.#channels())
|
|
89
|
-
this.#park(channel);
|
|
90
|
-
}),
|
|
91
|
-
];
|
|
92
|
-
for (const channel of this.#channels())
|
|
93
|
-
this.#flag(channel);
|
|
94
|
-
}
|
|
95
|
-
/** Flag what one availability names: a followed channel, or this tail. */
|
|
96
|
-
ring(signal) {
|
|
97
|
-
if (signal.entityId !== null) {
|
|
98
|
-
const channel = this.#entities.get(signal.entityId);
|
|
99
|
-
if (channel)
|
|
100
|
-
this.#flag(channel);
|
|
101
|
-
}
|
|
102
|
-
else if (signal.authorityId === this.#authorityId) {
|
|
103
|
-
this.#flag(this.#tail);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
hold(entityId) {
|
|
107
|
-
if (this.#stopped)
|
|
108
|
-
return;
|
|
109
|
-
const channel = this.#entity(entityId);
|
|
110
|
-
if (channel.held)
|
|
111
|
-
return;
|
|
112
|
-
channel.held = true;
|
|
113
|
-
this.#flag(channel);
|
|
114
|
-
}
|
|
115
|
-
release(entityId) {
|
|
116
|
-
const channel = this.#entities.get(entityId);
|
|
117
|
-
if (!channel)
|
|
118
|
-
return;
|
|
119
|
-
channel.held = false;
|
|
120
|
-
this.#forgetIfUnneeded(channel);
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Resolves once this authority's gap-free delivery cursor reaches
|
|
124
|
-
* `watermark`, a position the authority has committed: as soon as the page
|
|
125
|
-
* that covers it commits, however much tail follows. A turn that begins
|
|
126
|
-
* after it and ends caught up below it rejects as unavailable; one that
|
|
127
|
-
* fails rejects with its failure. A caller never waits for another
|
|
128
|
-
* caller's larger watermark or for Send.
|
|
129
|
-
*/
|
|
130
|
-
async receiveThrough(watermark) {
|
|
131
|
-
checkPosition(watermark);
|
|
132
|
-
await this.#reach(this.#tail, watermark);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Resolves once this authority's tail holds the history as it stands: the
|
|
136
|
-
* first turn begun after this call that ends caught up holds every
|
|
137
|
-
* position above this computer's basis that the authority had committed
|
|
138
|
-
* when it read. It answers nothing about positions committed later, and a
|
|
139
|
-
* failed turn rejects it. With no basis nothing lies above it, so a caller
|
|
140
|
-
* keeps its head first.
|
|
141
|
-
*/
|
|
142
|
-
async receiveCurrent() {
|
|
143
|
-
if (this.#stopped)
|
|
144
|
-
throw stopped();
|
|
145
|
-
const current = this.#tail.wait(null);
|
|
146
|
-
this.#flag(this.#tail);
|
|
147
|
-
await current;
|
|
148
|
-
}
|
|
149
|
-
/** The same for one entity's dense sequence, read from that entity's own
|
|
150
|
-
* channel whether or not this computer holds it. */
|
|
151
|
-
async receiveEntityThrough(entityId, globalSequence) {
|
|
152
|
-
checkPosition(globalSequence);
|
|
153
|
-
if (this.#stopped)
|
|
154
|
-
throw stopped();
|
|
155
|
-
await this.#reach(this.#entity(entityId), globalSequence);
|
|
156
|
-
}
|
|
157
|
-
/** Resolves once Receive covers every position the stamped Outbox rows at
|
|
158
|
-
* or before `through` name, read from their durable stamps: this
|
|
159
|
-
* authority's delivery positions, and each other authority's entity
|
|
160
|
-
* sequences. */
|
|
161
|
-
async coverReceipts(through) {
|
|
162
|
-
const receipts = await this.#effects.run(() => this.#store.readReceipts(this.#authorityId, through));
|
|
163
|
-
const covered = await Promise.allSettled([
|
|
164
|
-
this.receiveThrough(receipts.delivery),
|
|
165
|
-
...receipts.entities.map(({ entityId, globalSequence }) => this.receiveEntityThrough(entityId, globalSequence)),
|
|
166
|
-
]);
|
|
167
|
-
for (const result of covered)
|
|
168
|
-
if (result.status === 'rejected')
|
|
169
|
-
throw result.reason;
|
|
170
|
-
}
|
|
171
|
-
/** Stop listening, join the turn and effects in flight, then answer every
|
|
172
|
-
* caller still waiting. */
|
|
173
|
-
async stop() {
|
|
174
|
-
this.#stopped = true;
|
|
175
|
-
this.#retry.cancel();
|
|
176
|
-
for (const remove of this.#removeListeners)
|
|
177
|
-
remove();
|
|
178
|
-
this.#removeListeners = [];
|
|
179
|
-
await Promise.allSettled([this.#receiving, this.#effects.stop()]);
|
|
180
|
-
for (const channel of this.#channels())
|
|
181
|
-
channel.stop(stopped());
|
|
182
|
-
}
|
|
183
|
-
#channels() {
|
|
184
|
-
return [this.#tail, ...this.#entities.values()];
|
|
185
|
-
}
|
|
186
|
-
#entity(entityId) {
|
|
187
|
-
let channel = this.#entities.get(entityId);
|
|
188
|
-
if (!channel)
|
|
189
|
-
this.#entities.set(entityId, channel = new receive_channel_js_1.ReceiveChannel(entityId, entityId, false));
|
|
190
|
-
return channel;
|
|
191
|
-
}
|
|
192
|
-
#reach(channel, target) {
|
|
193
|
-
if (this.#stopped)
|
|
194
|
-
return Promise.reject(stopped());
|
|
195
|
-
if (channel.covers(target))
|
|
196
|
-
return Promise.resolve();
|
|
197
|
-
const reached = channel.wait(target);
|
|
198
|
-
this.#flag(channel);
|
|
199
|
-
return reached;
|
|
200
|
-
}
|
|
201
|
-
/** A channel needs a turn. A parked one takes it when the backoff fires. */
|
|
202
|
-
#flag(channel) {
|
|
203
|
-
if (this.#stopped || this.#parked.has(channel))
|
|
204
|
-
return;
|
|
205
|
-
this.#flagged.add(channel);
|
|
206
|
-
this.#kick();
|
|
207
|
-
}
|
|
208
|
-
#park(channel) {
|
|
209
|
-
this.#flagged.delete(channel);
|
|
210
|
-
this.#parked.add(channel);
|
|
211
|
-
this.#retry.arm(() => {
|
|
212
|
-
const parked = [...this.#parked];
|
|
213
|
-
this.#parked.clear();
|
|
214
|
-
for (const waiting of parked)
|
|
215
|
-
this.#flag(waiting);
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
#forgetIfUnneeded(channel) {
|
|
219
|
-
if (channel.needed || channel.entityId === null)
|
|
220
|
-
return;
|
|
221
|
-
this.#entities.delete(channel.entityId);
|
|
222
|
-
this.#flagged.delete(channel);
|
|
223
|
-
this.#parked.delete(channel);
|
|
224
|
-
}
|
|
225
|
-
#kick() {
|
|
226
|
-
if (!this.#started || this.#stopped || this.#receiving)
|
|
227
|
-
return;
|
|
228
|
-
const receiving = this.#receive();
|
|
229
|
-
this.#receiving = receiving;
|
|
230
|
-
void receiving.then(() => {
|
|
231
|
-
this.#receiving = null;
|
|
232
|
-
if (this.#stopped)
|
|
233
|
-
return;
|
|
234
|
-
if (this.#flagged.size > 0) {
|
|
235
|
-
this.#kick();
|
|
236
|
-
}
|
|
237
|
-
else if (this.#parked.size === 0) {
|
|
238
|
-
this.#retry.succeeded();
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
async #receive() {
|
|
243
|
-
for (let channel = this.#next(); channel && !this.#stopped; channel = this.#next()) {
|
|
244
|
-
await this.#turn(channel);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
#next() {
|
|
248
|
-
const [channel] = this.#flagged;
|
|
249
|
-
if (channel)
|
|
250
|
-
this.#flagged.delete(channel);
|
|
251
|
-
return channel;
|
|
252
|
-
}
|
|
253
|
-
/** One page of one channel. Never rejects. */
|
|
254
|
-
async #turn(channel) {
|
|
255
|
-
const turn = channel.beginTurn();
|
|
256
|
-
const observe = (cursor) => channel.observe(cursor);
|
|
257
|
-
try {
|
|
258
|
-
const full = channel.entityId === null
|
|
259
|
-
? await (0, receive_pages_js_1.receiveTailPage)(this.#pages, this.#authorityId, observe)
|
|
260
|
-
: await (0, receive_pages_js_1.receiveEntityPage)(this.#pages, channel.entityId, observe);
|
|
261
|
-
if (this.#stopped)
|
|
262
|
-
return;
|
|
263
|
-
if (full)
|
|
264
|
-
this.#flag(channel);
|
|
265
|
-
else
|
|
266
|
-
channel.caughtUp(turn);
|
|
267
|
-
}
|
|
268
|
-
catch (error) {
|
|
269
|
-
if (this.#stopped)
|
|
270
|
-
return;
|
|
271
|
-
channel.failed(turn, error);
|
|
272
|
-
this.#park(channel);
|
|
273
|
-
this.#onError(error);
|
|
274
|
-
}
|
|
275
|
-
finally {
|
|
276
|
-
channel.endTurn();
|
|
277
|
-
this.#forgetIfUnneeded(channel);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
exports.ReceiveLoop = ReceiveLoop;
|
|
282
|
-
//# sourceMappingURL=receive-loop.js.map
|
|
1
|
+
"use strict";var f=Object.defineProperty;var r=(h,t)=>f(h,"name",{value:t,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReceiveLoop=void 0;const o=require("./receive-channel.js"),c=require("./receive-pages.js"),l=require("./owned-effects.js"),d=require("./retry-clock.js"),n=r(()=>new Error("entity record rail stopped before reaching its watermark"),"stopped"),a=r(h=>{if(!Number.isSafeInteger(h)||h<0)throw new Error("entity record watermark must be a non-negative integer")},"checkPosition");class y{static{r(this,"ReceiveLoop")}#n;#w;#a;#u;#f;#o;#l=new l.OwnedEffects(n);#i;#s=new Map;#r=new Set;#h=new Set;#g=!1;#t=!1;#c=null;#d=[];constructor(t){this.#n=t.authorityId,this.#w=t.store,this.#a=t.authority,this.#f=t.onError,this.#u={store:t.store,authority:t.authority,run:r(e=>this.#l.run(e),"run"),onInboxCommitted:r(()=>{try{t.onInboxCommitted()}catch(e){this.#f(e)}},"onInboxCommitted")},this.#o=new d.RetryClock(t.schedule),this.#i=new o.ReceiveChannel(t.authorityId,null,!0);for(const e of t.channels)this.#v(e).held=!0}start(){this.#g=!0,this.#d=[this.#a.onAvailable(t=>this.ring(t)),this.#a.onDisconnect(()=>{if(!this.#t)for(const t of this.#y())this.#p(t)})];for(const t of this.#y())this.#e(t)}ring(t){if(t.entityId!==null){const e=this.#s.get(t.entityId);e&&this.#e(e)}else t.authorityId===this.#n&&this.#e(this.#i)}hold(t){if(this.#t)return;const e=this.#v(t);e.held||(e.held=!0,this.#e(e))}release(t){const e=this.#s.get(t);e&&(e.held=!1,this.#_(e))}async receiveThrough(t){a(t),await this.#m(this.#i,t)}async receiveCurrent(){if(this.#t)throw n();const t=this.#i.wait(null);this.#e(this.#i),await t}async receiveEntityThrough(t,e){if(a(e),this.#t)throw n();await this.#m(this.#v(t),e)}async coverReceipts(t){const e=await this.#l.run(()=>this.#w.readReceipts(this.#n,t)),s=await Promise.allSettled([this.receiveThrough(e.delivery),...e.entities.map(({entityId:i,globalSequence:u})=>this.receiveEntityThrough(i,u))]);for(const i of s)if(i.status==="rejected")throw i.reason}async stop(){this.#t=!0,this.#o.cancel();for(const t of this.#d)t();this.#d=[],await Promise.allSettled([this.#c,this.#l.stop()]);for(const t of this.#y())t.stop(n())}#y(){return[this.#i,...this.#s.values()]}#v(t){let e=this.#s.get(t);return e||this.#s.set(t,e=new o.ReceiveChannel(t,t,!1)),e}#m(t,e){if(this.#t)return Promise.reject(n());if(t.covers(e))return Promise.resolve();const s=t.wait(e);return this.#e(t),s}#e(t){this.#t||this.#h.has(t)||(this.#r.add(t),this.#I())}#p(t){this.#r.delete(t),this.#h.add(t),this.#o.arm(()=>{const e=[...this.#h];this.#h.clear();for(const s of e)this.#e(s)})}#_(t){t.needed||t.entityId===null||(this.#s.delete(t.entityId),this.#r.delete(t),this.#h.delete(t))}#I(){if(!this.#g||this.#t||this.#c)return;const t=this.#k();this.#c=t,t.then(()=>{this.#c=null,!this.#t&&(this.#r.size>0?this.#I():this.#h.size===0&&this.#o.succeeded())})}async#k(){for(let t=this.#b();t&&!this.#t;t=this.#b())await this.#E(t)}#b(){const[t]=this.#r;return t&&this.#r.delete(t),t}async#E(t){const e=t.beginTurn(),s=r(i=>t.observe(i),"observe");try{const i=t.entityId===null?await(0,c.receiveTailPage)(this.#u,this.#n,s):await(0,c.receiveEntityPage)(this.#u,t.entityId,s);if(this.#t)return;i?this.#e(t):t.caughtUp(e)}catch(i){if(this.#t)return;t.failed(e,i),this.#p(t),this.#f(i)}finally{t.endTurn(),this.#_(t)}}}exports.ReceiveLoop=y;
|