@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
|
@@ -1,226 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Preparation makes rows ready to offer: each row's exact record bytes and
|
|
3
|
-
* whatever cargo travels inside the frame.
|
|
4
|
-
*
|
|
5
|
-
* Three bounds hold at every admission: how many rows it looks ahead, how
|
|
6
|
-
* many bytes it retains, and how many cargo reads run together. Rows reserve
|
|
7
|
-
* in Outbox order, before any cargo is read, at the most their submission
|
|
8
|
-
* could weigh: a row is at most one batch, so its declared heads add inline
|
|
9
|
-
* artifacts only while it stays one, however many heads it declares (a
|
|
10
|
-
* package declares one per page). A ready row keeps only what it holds. A
|
|
11
|
-
* later row never starts before an earlier one, and the head is first to any
|
|
12
|
-
* capacity: it reclaims the bytes of later rows that are ready, newest first,
|
|
13
|
-
* while a read in flight stays charged until it settles. One batch fits the
|
|
14
|
-
* byte bound, so the head always becomes ready and no admission exceeds a
|
|
15
|
-
* bound.
|
|
16
|
-
*
|
|
17
|
-
* A row the line offers bare, and a row with no cargo, requires no cargo
|
|
18
|
-
* preparation: it is ready at once and charged its record bytes, inside the
|
|
19
|
-
* same bounds. Whether a row carries cargo is part of its preparation, so a
|
|
20
|
-
* bare preparation is never offered as one that carries cargo.
|
|
21
|
-
*/
|
|
22
|
-
import { utf8Length } from '../entities/bytes.js';
|
|
23
|
-
import { encodeEntityRecord } from './codec.js';
|
|
24
|
-
import { ENTITY_RECORD_BATCH_BYTES } from './send-batch.js';
|
|
25
|
-
import { INLINE_ARTIFACT_FRAME_BYTES, submissionBytes } from './submit-frame.js';
|
|
26
|
-
/** Pending rows Send reads and prepares ahead of the line. */
|
|
27
|
-
export const ENTITY_RECORD_LOOKAHEAD_ROWS = 512;
|
|
28
|
-
/** Bytes prepared rows retain, including rows an unanswered attempt offered.
|
|
29
|
-
* At least one batch, so the head always fits. */
|
|
30
|
-
export const ENTITY_RECORD_PREPARED_BYTES = ENTITY_RECORD_BATCH_BYTES;
|
|
31
|
-
/** Cargo reads in flight at once. */
|
|
32
|
-
export const ENTITY_RECORD_CARGO_READS = 4;
|
|
33
|
-
const settledNow = Promise.resolve();
|
|
34
|
-
export class SendPreparation {
|
|
35
|
-
#cargo;
|
|
36
|
-
#onError;
|
|
37
|
-
/** Exactly the current lookahead's preparations, by mutation identity. */
|
|
38
|
-
#preparations = new Map();
|
|
39
|
-
#window = [];
|
|
40
|
-
/** Rows at or before it are offered bare. */
|
|
41
|
-
#bareThrough = 0;
|
|
42
|
-
#reserved = 0;
|
|
43
|
-
#reading = 0;
|
|
44
|
-
#stopped = false;
|
|
45
|
-
#inFlight = new Set();
|
|
46
|
-
constructor(cargo, onError) {
|
|
47
|
-
this.#cargo = cargo;
|
|
48
|
-
this.#onError = onError;
|
|
49
|
-
}
|
|
50
|
-
/** Prepare exactly this lookahead, oldest first, offering the rows at or
|
|
51
|
-
* before `bareThrough` bare; release rows it lacks or prepared otherwise. */
|
|
52
|
-
retain(window, bareThrough) {
|
|
53
|
-
if (this.#stopped)
|
|
54
|
-
return;
|
|
55
|
-
this.#window = window;
|
|
56
|
-
this.#bareThrough = bareThrough;
|
|
57
|
-
const kept = new Map(window.map((row) => [row.record.mutationId, row]));
|
|
58
|
-
for (const [mutationId, preparation] of this.#preparations) {
|
|
59
|
-
const row = kept.get(mutationId);
|
|
60
|
-
if (!row || preparation.carriesCargo !== this.#carriesCargo(row))
|
|
61
|
-
this.#drop(mutationId);
|
|
62
|
-
}
|
|
63
|
-
this.#pump();
|
|
64
|
-
}
|
|
65
|
-
/** Release rows the line is done with: stamped rows, and a refused row,
|
|
66
|
-
* which prepares again when it is next the head. */
|
|
67
|
-
forget(rows) {
|
|
68
|
-
if (rows.length === 0)
|
|
69
|
-
return;
|
|
70
|
-
const forgotten = new Set(rows.map((row) => row.record.mutationId));
|
|
71
|
-
this.#window = this.#window.filter((row) => !forgotten.has(row.record.mutationId));
|
|
72
|
-
for (const mutationId of forgotten)
|
|
73
|
-
this.#drop(mutationId);
|
|
74
|
-
this.#pump();
|
|
75
|
-
}
|
|
76
|
-
prepared(row) {
|
|
77
|
-
return this.#preparations.get(row.record.mutationId)?.ready ?? null;
|
|
78
|
-
}
|
|
79
|
-
/** The head, ready to offer, once capacity admits it. A head whose
|
|
80
|
-
* preparation failed prepares again; this attempt fails with that
|
|
81
|
-
* preparation's failure. */
|
|
82
|
-
async head(row) {
|
|
83
|
-
if (row !== this.#window[0])
|
|
84
|
-
throw new Error('only the lookahead head is awaited');
|
|
85
|
-
if (this.#preparations.get(row.record.mutationId)?.failure)
|
|
86
|
-
this.#drop(row.record.mutationId);
|
|
87
|
-
this.#pump();
|
|
88
|
-
let preparation = this.#preparations.get(row.record.mutationId);
|
|
89
|
-
while (!preparation) {
|
|
90
|
-
if (this.#stopped)
|
|
91
|
-
throw new Error('entity record preparation stopped');
|
|
92
|
-
// Only reads in flight can hold what the head lacks; each one that
|
|
93
|
-
// settles pumps again, and the head is first.
|
|
94
|
-
if (this.#inFlight.size === 0) {
|
|
95
|
-
throw new Error(`entity record ${row.record.mutationId} exceeds the prepared byte bound`);
|
|
96
|
-
}
|
|
97
|
-
await Promise.race(this.#inFlight);
|
|
98
|
-
preparation = this.#preparations.get(row.record.mutationId);
|
|
99
|
-
}
|
|
100
|
-
await preparation.settled;
|
|
101
|
-
if (preparation.failure)
|
|
102
|
-
throw preparation.failure.error;
|
|
103
|
-
return preparation.ready;
|
|
104
|
-
}
|
|
105
|
-
/** Once every lookahead row at or before `localSequence` that the bounds
|
|
106
|
-
* admit has settled, ready or failed: an offer meant to carry that row
|
|
107
|
-
* waits for the rows before it. A row a settling read admits joins. */
|
|
108
|
-
async settledThrough(localSequence) {
|
|
109
|
-
for (;;) {
|
|
110
|
-
const waiting = [...this.#preparations.values()]
|
|
111
|
-
.filter(({ row, ready, failure }) => row.localSequence <= localSequence && !ready && !failure);
|
|
112
|
-
if (waiting.length === 0)
|
|
113
|
-
return;
|
|
114
|
-
await Promise.race(waiting.map(({ settled }) => settled));
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
/** Admit nothing more from now: a reserved row whose cargo read has not
|
|
118
|
-
* started never starts it. Release everything, and resolve once every
|
|
119
|
-
* cargo read in flight has settled. */
|
|
120
|
-
stop() {
|
|
121
|
-
this.#stopped = true;
|
|
122
|
-
this.#window = [];
|
|
123
|
-
for (const mutationId of [...this.#preparations.keys()])
|
|
124
|
-
this.#drop(mutationId);
|
|
125
|
-
return Promise.allSettled([...this.#inFlight]).then(() => undefined);
|
|
126
|
-
}
|
|
127
|
-
/** Start rows in order while each fits every bound. */
|
|
128
|
-
#pump() {
|
|
129
|
-
if (this.#stopped)
|
|
130
|
-
return;
|
|
131
|
-
for (const [index, row] of this.#window.entries()) {
|
|
132
|
-
if (this.#preparations.has(row.record.mutationId))
|
|
133
|
-
continue;
|
|
134
|
-
const declared = this.#carriesCargo(row)
|
|
135
|
-
? row.record.change.cargo.length * INLINE_ARTIFACT_FRAME_BYTES
|
|
136
|
-
: 0;
|
|
137
|
-
if (declared > 0 && this.#reading >= ENTITY_RECORD_CARGO_READS)
|
|
138
|
-
return;
|
|
139
|
-
const recordJson = encodeEntityRecord(row.record);
|
|
140
|
-
const recordBytes = utf8Length(recordJson);
|
|
141
|
-
// A row is at most one batch: its heads ride inline only while it stays one.
|
|
142
|
-
const reserve = recordBytes + Math.min(declared, Math.max(0, ENTITY_RECORD_BATCH_BYTES - recordBytes));
|
|
143
|
-
if (index === 0)
|
|
144
|
-
this.#reclaim(reserve);
|
|
145
|
-
if (this.#reserved + reserve > ENTITY_RECORD_PREPARED_BYTES)
|
|
146
|
-
return;
|
|
147
|
-
this.#start(row, recordJson, reserve);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
/** Make room for the head: release later ready rows, newest first, until
|
|
151
|
-
* it fits. They prepare again when capacity returns. */
|
|
152
|
-
#reclaim(bytes) {
|
|
153
|
-
for (let index = this.#window.length - 1; index > 0 && this.#reserved + bytes > ENTITY_RECORD_PREPARED_BYTES; index -= 1) {
|
|
154
|
-
const mutationId = this.#window[index].record.mutationId;
|
|
155
|
-
if (this.#preparations.get(mutationId)?.ready)
|
|
156
|
-
this.#drop(mutationId);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
#carriesCargo(row) {
|
|
160
|
-
return row.localSequence > this.#bareThrough && row.record.change.cargo.length > 0;
|
|
161
|
-
}
|
|
162
|
-
#start(row, recordJson, reserve) {
|
|
163
|
-
this.#reserved += reserve;
|
|
164
|
-
if (!this.#carriesCargo(row)) {
|
|
165
|
-
const submission = Object.freeze({ recordJson, cargo: Object.freeze([]) });
|
|
166
|
-
this.#preparations.set(row.record.mutationId, {
|
|
167
|
-
row,
|
|
168
|
-
carriesCargo: false,
|
|
169
|
-
reserved: reserve,
|
|
170
|
-
ready: Object.freeze({ row, submission, bytes: reserve }),
|
|
171
|
-
failure: null,
|
|
172
|
-
settled: settledNow,
|
|
173
|
-
dropped: false,
|
|
174
|
-
});
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
this.#reading += 1;
|
|
178
|
-
let preparation;
|
|
179
|
-
const settled = Promise.resolve()
|
|
180
|
-
.then(() => {
|
|
181
|
-
// Reserved before admission closed: it settles without starting.
|
|
182
|
-
if (this.#stopped)
|
|
183
|
-
throw new Error('entity record preparation stopped');
|
|
184
|
-
return this.#cargo.ensure(row.record);
|
|
185
|
-
})
|
|
186
|
-
.then((cargo) => {
|
|
187
|
-
const submission = Object.freeze({ recordJson, cargo: Object.freeze([...(cargo ?? [])]) });
|
|
188
|
-
const bytes = submissionBytes(submission);
|
|
189
|
-
if (bytes > reserve)
|
|
190
|
-
throw new Error(`cargo for ${row.record.mutationId} exceeds what one row may carry inline`);
|
|
191
|
-
preparation.ready = Object.freeze({ row, submission, bytes });
|
|
192
|
-
this.#resize(preparation, bytes);
|
|
193
|
-
})
|
|
194
|
-
.catch((error) => {
|
|
195
|
-
preparation.failure = { error };
|
|
196
|
-
this.#resize(preparation, 0);
|
|
197
|
-
})
|
|
198
|
-
.finally(() => {
|
|
199
|
-
this.#reading -= 1;
|
|
200
|
-
this.#inFlight.delete(settled);
|
|
201
|
-
if (preparation.dropped)
|
|
202
|
-
this.#resize(preparation, 0);
|
|
203
|
-
this.#pump();
|
|
204
|
-
})
|
|
205
|
-
.catch((error) => this.#onError(error));
|
|
206
|
-
preparation = { row, carriesCargo: true, reserved: reserve, ready: null, failure: null, settled, dropped: false };
|
|
207
|
-
this.#inFlight.add(settled);
|
|
208
|
-
this.#preparations.set(row.record.mutationId, preparation);
|
|
209
|
-
}
|
|
210
|
-
/** A dropped row in flight keeps its reservation until its read settles. */
|
|
211
|
-
#drop(mutationId) {
|
|
212
|
-
const preparation = this.#preparations.get(mutationId);
|
|
213
|
-
if (!preparation)
|
|
214
|
-
return;
|
|
215
|
-
this.#preparations.delete(mutationId);
|
|
216
|
-
preparation.dropped = true;
|
|
217
|
-
if (preparation.ready || preparation.failure)
|
|
218
|
-
this.#resize(preparation, 0);
|
|
219
|
-
}
|
|
220
|
-
#resize(preparation, bytes) {
|
|
221
|
-
const next = preparation.dropped ? 0 : bytes;
|
|
222
|
-
this.#reserved += next - preparation.reserved;
|
|
223
|
-
preparation.reserved = next;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
//# sourceMappingURL=send-preparation.js.map
|
|
1
|
+
var u=Object.defineProperty;var d=(a,t)=>u(a,"name",{value:t,configurable:!0});import{utf8Length as l}from"../entities/bytes.js";import{encodeEntityRecord as p}from"./codec.js";import{ENTITY_RECORD_BATCH_BYTES as c}from"./send-batch.js";import{INLINE_ARTIFACT_FRAME_BYTES as m,submissionBytes as g}from"./submit-frame.js";const O=512,f=c,E=4,I=Promise.resolve();class C{static{d(this,"SendPreparation")}#c;#f;#t=new Map;#e=[];#u=0;#o=0;#h=0;#r=!1;#i=new Set;constructor(t,e){this.#c=t,this.#f=e}retain(t,e){if(this.#r)return;this.#e=t,this.#u=e;const r=new Map(t.map(i=>[i.record.mutationId,i]));for(const[i,o]of this.#t){const s=r.get(i);(!s||o.carriesCargo!==this.#d(s))&&this.#s(i)}this.#n()}forget(t){if(t.length===0)return;const e=new Set(t.map(r=>r.record.mutationId));this.#e=this.#e.filter(r=>!e.has(r.record.mutationId));for(const r of e)this.#s(r);this.#n()}prepared(t){return this.#t.get(t.record.mutationId)?.ready??null}async head(t){if(t!==this.#e[0])throw new Error("only the lookahead head is awaited");this.#t.get(t.record.mutationId)?.failure&&this.#s(t.record.mutationId),this.#n();let e=this.#t.get(t.record.mutationId);for(;!e;){if(this.#r)throw new Error("entity record preparation stopped");if(this.#i.size===0)throw new Error(`entity record ${t.record.mutationId} exceeds the prepared byte bound`);await Promise.race(this.#i),e=this.#t.get(t.record.mutationId)}if(await e.settled,e.failure)throw e.failure.error;return e.ready}async settledThrough(t){for(;;){const e=[...this.#t.values()].filter(({row:r,ready:i,failure:o})=>r.localSequence<=t&&!i&&!o);if(e.length===0)return;await Promise.race(e.map(({settled:r})=>r))}}stop(){this.#r=!0,this.#e=[];for(const t of[...this.#t.keys()])this.#s(t);return Promise.allSettled([...this.#i]).then(()=>{})}#n(){if(!this.#r)for(const[t,e]of this.#e.entries()){if(this.#t.has(e.record.mutationId))continue;const r=this.#d(e)?e.record.change.cargo.length*m:0;if(r>0&&this.#h>=E)return;const i=p(e.record),o=l(i),s=o+Math.min(r,Math.max(0,c-o));if(t===0&&this.#l(s),this.#o+s>f)return;this.#p(e,i,s)}}#l(t){for(let e=this.#e.length-1;e>0&&this.#o+t>f;e-=1){const r=this.#e[e].record.mutationId;this.#t.get(r)?.ready&&this.#s(r)}}#d(t){return t.localSequence>this.#u&&t.record.change.cargo.length>0}#p(t,e,r){if(this.#o+=r,!this.#d(t)){const s=Object.freeze({recordJson:e,cargo:Object.freeze([])});this.#t.set(t.record.mutationId,{row:t,carriesCargo:!1,reserved:r,ready:Object.freeze({row:t,submission:s,bytes:r}),failure:null,settled:I,dropped:!1});return}this.#h+=1;let i;const o=Promise.resolve().then(()=>{if(this.#r)throw new Error("entity record preparation stopped");return this.#c.ensure(t.record)}).then(s=>{const h=Object.freeze({recordJson:e,cargo:Object.freeze([...s??[]])}),n=g(h);if(n>r)throw new Error(`cargo for ${t.record.mutationId} exceeds what one row may carry inline`);i.ready=Object.freeze({row:t,submission:h,bytes:n}),this.#a(i,n)}).catch(s=>{i.failure={error:s},this.#a(i,0)}).finally(()=>{this.#h-=1,this.#i.delete(o),i.dropped&&this.#a(i,0),this.#n()}).catch(s=>this.#f(s));i={row:t,carriesCargo:!0,reserved:r,ready:null,failure:null,settled:o,dropped:!1},this.#i.add(o),this.#t.set(t.record.mutationId,i)}#s(t){const e=this.#t.get(t);e&&(this.#t.delete(t),e.dropped=!0,(e.ready||e.failure)&&this.#a(e,0))}#a(t,e){const r=t.dropped?0:e;this.#o+=r-t.reserved,t.reserved=r}}export{E as ENTITY_RECORD_CARGO_READS,O as ENTITY_RECORD_LOOKAHEAD_ROWS,f as ENTITY_RECORD_PREPARED_BYTES,C as SendPreparation};
|
|
@@ -1,38 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The one submit frame: a small routing header and a binary body.
|
|
3
|
-
*
|
|
4
|
-
* The header names each offered row's layout; the body carries, row after
|
|
5
|
-
* row, the record's exact JSON bytes and then each inline artifact's
|
|
6
|
-
* manifest JSON followed by its blocks in chunk order. Nothing is base64 and
|
|
7
|
-
* nothing is JSON inside JSON.
|
|
8
|
-
*
|
|
9
|
-
* The authority reads the body in offered order. A malformed envelope fails
|
|
10
|
-
* the request; a row that cannot be accepted ends the readable prefix with
|
|
11
|
-
* its refusal, so a bad row never defeats the valid rows before it.
|
|
12
|
-
*/
|
|
13
1
|
import type { EntityRecordInlineCargo, LocalEntityRecord } from './contracts.js';
|
|
14
2
|
import type { EntityRecordRefusal, EntityRecordSubmission } from './rail-ports.js';
|
|
15
|
-
/** The legal size of one record's JSON. */
|
|
16
3
|
export declare const ENTITY_RECORD_MAX_BYTES: number;
|
|
17
|
-
/** The most one inline artifact adds to a frame: its manifest JSON and its
|
|
18
|
-
* blocks. */
|
|
19
4
|
export declare const INLINE_ARTIFACT_FRAME_BYTES: number;
|
|
20
|
-
/** One offered row's layout in the body. */
|
|
21
5
|
export interface EntityRecordSubmitRowFrame {
|
|
22
6
|
readonly record_bytes: number;
|
|
23
|
-
/** Each inline artifact's manifest JSON bytes; its blocks follow it. */
|
|
24
7
|
readonly manifest_bytes?: readonly number[];
|
|
25
8
|
}
|
|
26
9
|
export interface EncodedEntityRecordBatch {
|
|
27
10
|
readonly records: readonly EntityRecordSubmitRowFrame[];
|
|
28
11
|
readonly body: Uint8Array;
|
|
29
12
|
}
|
|
30
|
-
/** Exactly the body bytes one row adds to a frame. */
|
|
31
13
|
export declare function submissionBytes(submission: EntityRecordSubmission): number;
|
|
32
14
|
export declare function encodeEntityRecordBatch(batch: readonly EntityRecordSubmission[]): EncodedEntityRecordBatch;
|
|
33
|
-
/** One offered row as the authority reads it. */
|
|
34
15
|
export interface SubmittedEntityRecord {
|
|
35
|
-
/** The exact bytes offered: what the authority stores and checksums. */
|
|
36
16
|
readonly recordJson: string;
|
|
37
17
|
readonly record: LocalEntityRecord;
|
|
38
18
|
readonly cargo: readonly EntityRecordInlineCargo[];
|
|
@@ -44,12 +24,4 @@ export type SubmittedEntityRecordRow = {
|
|
|
44
24
|
readonly ok: false;
|
|
45
25
|
readonly refusal: EntityRecordRefusal;
|
|
46
26
|
};
|
|
47
|
-
/**
|
|
48
|
-
* Read one submit frame in offered order. Every row must belong to the first
|
|
49
|
-
* row's authority. A row's cargo must be exactly some of its own declared
|
|
50
|
-
* heads, each within the inline bound, every block hashing to its chunk.
|
|
51
|
-
* The result ends at the first row that fails, carrying its refusal. A body
|
|
52
|
-
* shorter than its layout, or longer once every row reads, fails the frame.
|
|
53
|
-
*/
|
|
54
27
|
export declare function readEntityRecordBatch(records: unknown, body: unknown, sha256Hex: (bytes: Uint8Array) => string): readonly SubmittedEntityRecordRow[];
|
|
55
|
-
//# sourceMappingURL=submit-frame.d.ts.map
|
|
@@ -1,161 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* The one submit frame: a small routing header and a binary body.
|
|
3
|
-
*
|
|
4
|
-
* The header names each offered row's layout; the body carries, row after
|
|
5
|
-
* row, the record's exact JSON bytes and then each inline artifact's
|
|
6
|
-
* manifest JSON followed by its blocks in chunk order. Nothing is base64 and
|
|
7
|
-
* nothing is JSON inside JSON.
|
|
8
|
-
*
|
|
9
|
-
* The authority reads the body in offered order. A malformed envelope fails
|
|
10
|
-
* the request; a row that cannot be accepted ends the readable prefix with
|
|
11
|
-
* its refusal, so a bad row never defeats the valid rows before it.
|
|
12
|
-
*/
|
|
13
|
-
import { INLINE_CARGO_MAX_BYTES, checkContentManifest, } from '../contracts/content.js';
|
|
14
|
-
import { isRecord } from '../contracts/validate.js';
|
|
15
|
-
import { utf8EncodeInto, utf8Length } from '../entities/bytes.js';
|
|
16
|
-
import { decodeLocalEntityRecord } from './codec.js';
|
|
17
|
-
import { ENTITY_RECORD_BATCH_BYTES, ENTITY_RECORD_BATCH_ROWS } from './send-batch.js';
|
|
18
|
-
/** The legal size of one record's JSON. */
|
|
19
|
-
export const ENTITY_RECORD_MAX_BYTES = 4 * 1024 * 1024;
|
|
20
|
-
const MANIFEST_MAX_BYTES = 64 * 1024;
|
|
21
|
-
/** The most one inline artifact adds to a frame: its manifest JSON and its
|
|
22
|
-
* blocks. */
|
|
23
|
-
export const INLINE_ARTIFACT_FRAME_BYTES = MANIFEST_MAX_BYTES + INLINE_CARGO_MAX_BYTES;
|
|
24
|
-
const manifestJson = (cargo) => JSON.stringify(cargo.manifest);
|
|
25
|
-
/** Exactly the body bytes one row adds to a frame. */
|
|
26
|
-
export function submissionBytes(submission) {
|
|
27
|
-
return submission.cargo.reduce((sum, item) => sum + utf8Length(manifestJson(item)) + item.manifest.bytes, utf8Length(submission.recordJson));
|
|
28
|
-
}
|
|
29
|
-
export function encodeEntityRecordBatch(batch) {
|
|
30
|
-
const rows = batch.map((submission) => {
|
|
31
|
-
const manifests = submission.cargo.map(manifestJson);
|
|
32
|
-
return {
|
|
33
|
-
submission,
|
|
34
|
-
manifests,
|
|
35
|
-
frame: Object.freeze({
|
|
36
|
-
record_bytes: utf8Length(submission.recordJson),
|
|
37
|
-
...(manifests.length ? { manifest_bytes: Object.freeze(manifests.map(utf8Length)) } : {}),
|
|
38
|
-
}),
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
const body = new Uint8Array(rows.reduce((sum, row) => sum + submissionBytes(row.submission), 0));
|
|
42
|
-
let offset = 0;
|
|
43
|
-
for (const { submission, manifests } of rows) {
|
|
44
|
-
offset += utf8EncodeInto(submission.recordJson, body.subarray(offset));
|
|
45
|
-
for (const [index, item] of submission.cargo.entries()) {
|
|
46
|
-
offset += utf8EncodeInto(manifests[index], body.subarray(offset));
|
|
47
|
-
for (const block of item.blocks) {
|
|
48
|
-
body.set(block, offset);
|
|
49
|
-
offset += block.byteLength;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (offset !== body.byteLength)
|
|
54
|
-
throw new Error('entity record batch body did not fill its exact size');
|
|
55
|
-
return Object.freeze({ records: Object.freeze(rows.map((row) => row.frame)), body });
|
|
56
|
-
}
|
|
57
|
-
/** The body disagrees with its own layout: the whole request is malformed. */
|
|
58
|
-
class FrameBodyError extends Error {
|
|
59
|
-
}
|
|
60
|
-
const byteCount = (value, max) => typeof value === 'number' && Number.isSafeInteger(value) && value >= 0 && value <= max;
|
|
61
|
-
function checkEnvelope(records, body) {
|
|
62
|
-
if (!Array.isArray(records) || records.length === 0 || records.length > ENTITY_RECORD_BATCH_ROWS) {
|
|
63
|
-
throw new Error(`an entity record batch offers 1 to ${ENTITY_RECORD_BATCH_ROWS} rows`);
|
|
64
|
-
}
|
|
65
|
-
if (!(body instanceof Uint8Array) || body.byteLength > ENTITY_RECORD_BATCH_BYTES) {
|
|
66
|
-
throw new Error(`an entity record batch body is at most ${ENTITY_RECORD_BATCH_BYTES} bytes`);
|
|
67
|
-
}
|
|
68
|
-
for (const row of records) {
|
|
69
|
-
if (!isRecord(row)
|
|
70
|
-
|| !byteCount(row.record_bytes, ENTITY_RECORD_MAX_BYTES)
|
|
71
|
-
|| (row.manifest_bytes !== undefined
|
|
72
|
-
&& (!Array.isArray(row.manifest_bytes)
|
|
73
|
-
|| row.manifest_bytes.length === 0
|
|
74
|
-
|| !row.manifest_bytes.every((bytes) => byteCount(bytes, MANIFEST_MAX_BYTES))))) {
|
|
75
|
-
throw new Error('entity record batch row layout is invalid');
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return { layouts: records, bytes: body };
|
|
79
|
-
}
|
|
80
|
-
function refusal(code, error) {
|
|
81
|
-
if (error instanceof FrameBodyError)
|
|
82
|
-
throw error;
|
|
83
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
84
|
-
return Object.freeze({ ok: false, refusal: Object.freeze({ code, message }) });
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Read one submit frame in offered order. Every row must belong to the first
|
|
88
|
-
* row's authority. A row's cargo must be exactly some of its own declared
|
|
89
|
-
* heads, each within the inline bound, every block hashing to its chunk.
|
|
90
|
-
* The result ends at the first row that fails, carrying its refusal. A body
|
|
91
|
-
* shorter than its layout, or longer once every row reads, fails the frame.
|
|
92
|
-
*/
|
|
93
|
-
export function readEntityRecordBatch(records, body, sha256Hex) {
|
|
94
|
-
const { layouts, bytes: frameBody } = checkEnvelope(records, body);
|
|
95
|
-
const decoder = new TextDecoder('utf-8', { fatal: true });
|
|
96
|
-
const take = (bytes) => {
|
|
97
|
-
if (offset + bytes > frameBody.byteLength)
|
|
98
|
-
throw new FrameBodyError('entity record batch body ends early');
|
|
99
|
-
const span = frameBody.subarray(offset, offset + bytes);
|
|
100
|
-
offset += bytes;
|
|
101
|
-
return span;
|
|
102
|
-
};
|
|
103
|
-
let offset = 0;
|
|
104
|
-
let authorityId = null;
|
|
105
|
-
const rows = [];
|
|
106
|
-
for (const layout of layouts) {
|
|
107
|
-
let recordJson;
|
|
108
|
-
let record;
|
|
109
|
-
try {
|
|
110
|
-
recordJson = decoder.decode(take(layout.record_bytes));
|
|
111
|
-
record = decodeLocalEntityRecord(recordJson);
|
|
112
|
-
}
|
|
113
|
-
catch (error) {
|
|
114
|
-
rows.push(refusal('invalid_entity_record', error));
|
|
115
|
-
return Object.freeze(rows);
|
|
116
|
-
}
|
|
117
|
-
authorityId ??= record.authorityId;
|
|
118
|
-
if (record.authorityId !== authorityId) {
|
|
119
|
-
rows.push(refusal('entity_record_authority_mismatch', 'one batch belongs to one authority'));
|
|
120
|
-
return Object.freeze(rows);
|
|
121
|
-
}
|
|
122
|
-
let cargo;
|
|
123
|
-
try {
|
|
124
|
-
cargo = readCargo(record, layout.manifest_bytes ?? [], take, decoder, sha256Hex);
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
rows.push(refusal('invalid_entity_record_cargo', error));
|
|
128
|
-
return Object.freeze(rows);
|
|
129
|
-
}
|
|
130
|
-
rows.push(Object.freeze({ ok: true, value: Object.freeze({ recordJson, record, cargo }) }));
|
|
131
|
-
}
|
|
132
|
-
if (offset !== frameBody.byteLength)
|
|
133
|
-
throw new FrameBodyError('entity record batch body exceeds its declared rows');
|
|
134
|
-
return Object.freeze(rows);
|
|
135
|
-
}
|
|
136
|
-
function readCargo(record, manifestBytes, take, decoder, sha256Hex) {
|
|
137
|
-
const heads = new Set(record.change.cargo.map((item) => item.contentHash));
|
|
138
|
-
const seen = new Set();
|
|
139
|
-
return Object.freeze(manifestBytes.map((bytes) => {
|
|
140
|
-
const manifest = checkContentManifest(JSON.parse(decoder.decode(take(bytes))));
|
|
141
|
-
if (!manifest.ok)
|
|
142
|
-
throw new Error(manifest.error);
|
|
143
|
-
const { contentHash, chunks } = manifest.value;
|
|
144
|
-
if (!heads.has(contentHash) || seen.has(contentHash)) {
|
|
145
|
-
throw new Error('inline cargo did not match the record cargo heads');
|
|
146
|
-
}
|
|
147
|
-
seen.add(contentHash);
|
|
148
|
-
if (manifest.value.bytes > INLINE_CARGO_MAX_BYTES) {
|
|
149
|
-
throw new Error('inline cargo exceeds the inline bound');
|
|
150
|
-
}
|
|
151
|
-
const blocks = chunks.map((chunk, index) => {
|
|
152
|
-
const block = take(chunk.bytes);
|
|
153
|
-
if (sha256Hex(block) !== chunk.sha256) {
|
|
154
|
-
throw new Error(`inline cargo block ${index} does not match its manifest chunk`);
|
|
155
|
-
}
|
|
156
|
-
return block;
|
|
157
|
-
});
|
|
158
|
-
return Object.freeze({ manifest: manifest.value, blocks: Object.freeze(blocks) });
|
|
159
|
-
}));
|
|
160
|
-
}
|
|
161
|
-
//# sourceMappingURL=submit-frame.js.map
|
|
1
|
+
var j=Object.defineProperty;var f=(e,t)=>j(e,"name",{value:t,configurable:!0});import{INLINE_CARGO_MAX_BYTES as E,checkContentManifest as I}from"../contracts/content.js";import{isRecord as R}from"../contracts/validate.js";import{utf8EncodeInto as g,utf8Length as l}from"../entities/bytes.js";import{decodeLocalEntityRecord as S}from"./codec.js";import{ENTITY_RECORD_BATCH_BYTES as p,ENTITY_RECORD_BATCH_ROWS as O}from"./send-batch.js";const k=4*1024*1024,T=64*1024,D=T+E,z=f(e=>JSON.stringify(e.manifest),"manifestJson");function B(e){return e.cargo.reduce((t,r)=>t+l(z(r))+r.manifest.bytes,l(e.recordJson))}f(B,"submissionBytes");function F(e){const t=e.map(o=>{const c=o.cargo.map(z);return{submission:o,manifests:c,frame:Object.freeze({record_bytes:l(o.recordJson),...c.length?{manifest_bytes:Object.freeze(c.map(l))}:{}})}}),r=new Uint8Array(t.reduce((o,c)=>o+B(c.submission),0));let n=0;for(const{submission:o,manifests:c}of t){n+=g(o.recordJson,r.subarray(n));for(const[b,a]of o.cargo.entries()){n+=g(c[b],r.subarray(n));for(const i of a.blocks)r.set(i,n),n+=i.byteLength}}if(n!==r.byteLength)throw new Error("entity record batch body did not fill its exact size");return Object.freeze({records:Object.freeze(t.map(o=>o.frame)),body:r})}f(F,"encodeEntityRecordBatch");class _ extends Error{static{f(this,"FrameBodyError")}}const A=f((e,t)=>typeof e=="number"&&Number.isSafeInteger(e)&&e>=0&&e<=t,"byteCount");function x(e,t){if(!Array.isArray(e)||e.length===0||e.length>O)throw new Error(`an entity record batch offers 1 to ${O} rows`);if(!(t instanceof Uint8Array)||t.byteLength>p)throw new Error(`an entity record batch body is at most ${p} bytes`);for(const r of e)if(!R(r)||!A(r.record_bytes,k)||r.manifest_bytes!==void 0&&(!Array.isArray(r.manifest_bytes)||r.manifest_bytes.length===0||!r.manifest_bytes.every(n=>A(n,T))))throw new Error("entity record batch row layout is invalid");return{layouts:e,bytes:t}}f(x,"checkEnvelope");function w(e,t){if(t instanceof _)throw t;const r=t instanceof Error?t.message:String(t);return Object.freeze({ok:!1,refusal:Object.freeze({code:e,message:r})})}f(w,"refusal");function H(e,t,r){const{layouts:n,bytes:o}=x(e,t),c=new TextDecoder("utf-8",{fatal:!0}),b=f(d=>{if(a+d>o.byteLength)throw new _("entity record batch body ends early");const h=o.subarray(a,a+d);return a+=d,h},"take");let a=0,i=null;const s=[];for(const d of n){let h,y;try{h=c.decode(b(d.record_bytes)),y=S(h)}catch(u){return s.push(w("invalid_entity_record",u)),Object.freeze(s)}if(i??=y.authorityId,y.authorityId!==i)return s.push(w("entity_record_authority_mismatch","one batch belongs to one authority")),Object.freeze(s);let m;try{m=N(y,d.manifest_bytes??[],b,c,r)}catch(u){return s.push(w("invalid_entity_record_cargo",u)),Object.freeze(s)}s.push(Object.freeze({ok:!0,value:Object.freeze({recordJson:h,record:y,cargo:m})}))}if(a!==o.byteLength)throw new _("entity record batch body exceeds its declared rows");return Object.freeze(s)}f(H,"readEntityRecordBatch");function N(e,t,r,n,o){const c=new Set(e.change.cargo.map(a=>a.contentHash)),b=new Set;return Object.freeze(t.map(a=>{const i=I(JSON.parse(n.decode(r(a))));if(!i.ok)throw new Error(i.error);const{contentHash:s,chunks:d}=i.value;if(!c.has(s)||b.has(s))throw new Error("inline cargo did not match the record cargo heads");if(b.add(s),i.value.bytes>E)throw new Error("inline cargo exceeds the inline bound");const h=d.map((y,m)=>{const u=r(y.bytes);if(o(u)!==y.sha256)throw new Error(`inline cargo block ${m} does not match its manifest chunk`);return u});return Object.freeze({manifest:i.value,blocks:Object.freeze(h)})}))}f(N,"readCargo");export{k as ENTITY_RECORD_MAX_BYTES,D as INLINE_ARTIFACT_FRAME_BYTES,F as encodeEntityRecordBatch,H as readEntityRecordBatch,B as submissionBytes};
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* How many rows the Outbox holds unsent, said each time that may have
|
|
3
|
-
* changed. Zero means the cloud has acknowledged every record this computer
|
|
4
|
-
* made, so losing this disk now would lose none of them. The store's count
|
|
5
|
-
* includes work saved before it is a row (`countPending`), so zero is never
|
|
6
|
-
* said while any stands.
|
|
7
|
-
*
|
|
8
|
-
* The Outbox is the only tally: each report reads it, so the number said is
|
|
9
|
-
* always one the rows held, never a running sum that could drift. Reads never
|
|
10
|
-
* overlap. A change heard during a read earns exactly one more read after it,
|
|
11
|
-
* so a burst of changes costs at most two reads and the last report follows
|
|
12
|
-
* the last change. A number equal to the one last said is not said again.
|
|
13
|
-
*
|
|
14
|
-
* A failed read is reported and says null, because this computer cannot tell
|
|
15
|
-
* what it holds unsent: a number said before the failure never stands for
|
|
16
|
-
* the Outbox after it. Null is said once while reads keep failing, and the
|
|
17
|
-
* Outbox is read again on the rail's backoff, or sooner on a change; the next
|
|
18
|
-
* successful read says its number even when it equals the one said before the
|
|
19
|
-
* failure. A failed report is reported, and the next change reads again. Once
|
|
20
|
-
* stopped, nothing more is said.
|
|
21
|
-
*/
|
|
22
1
|
import type { EntityRecordSchedulePort, MaybePromise } from './rail-ports.js';
|
|
23
2
|
export declare class UnsentCount {
|
|
24
3
|
#private;
|
|
@@ -28,9 +7,6 @@ export declare class UnsentCount {
|
|
|
28
7
|
readonly onError: (error: unknown) => void;
|
|
29
8
|
readonly schedule: EntityRecordSchedulePort;
|
|
30
9
|
});
|
|
31
|
-
/** The Outbox may hold a different number of unsent rows now. */
|
|
32
10
|
changed(): void;
|
|
33
|
-
/** Say nothing more, and resolve once the read in flight settles. */
|
|
34
11
|
stop(): Promise<void>;
|
|
35
12
|
}
|
|
36
|
-
//# sourceMappingURL=unsent-count.d.ts.map
|
|
@@ -1,91 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* How many rows the Outbox holds unsent, said each time that may have
|
|
3
|
-
* changed. Zero means the cloud has acknowledged every record this computer
|
|
4
|
-
* made, so losing this disk now would lose none of them. The store's count
|
|
5
|
-
* includes work saved before it is a row (`countPending`), so zero is never
|
|
6
|
-
* said while any stands.
|
|
7
|
-
*
|
|
8
|
-
* The Outbox is the only tally: each report reads it, so the number said is
|
|
9
|
-
* always one the rows held, never a running sum that could drift. Reads never
|
|
10
|
-
* overlap. A change heard during a read earns exactly one more read after it,
|
|
11
|
-
* so a burst of changes costs at most two reads and the last report follows
|
|
12
|
-
* the last change. A number equal to the one last said is not said again.
|
|
13
|
-
*
|
|
14
|
-
* A failed read is reported and says null, because this computer cannot tell
|
|
15
|
-
* what it holds unsent: a number said before the failure never stands for
|
|
16
|
-
* the Outbox after it. Null is said once while reads keep failing, and the
|
|
17
|
-
* Outbox is read again on the rail's backoff, or sooner on a change; the next
|
|
18
|
-
* successful read says its number even when it equals the one said before the
|
|
19
|
-
* failure. A failed report is reported, and the next change reads again. Once
|
|
20
|
-
* stopped, nothing more is said.
|
|
21
|
-
*/
|
|
22
|
-
import { RetryClock } from './retry-clock.js';
|
|
23
|
-
export class UnsentCount {
|
|
24
|
-
#read;
|
|
25
|
-
#say;
|
|
26
|
-
#onError;
|
|
27
|
-
#retry;
|
|
28
|
-
#reading = null;
|
|
29
|
-
#again = false;
|
|
30
|
-
/** The last count said; undefined until the first report. */
|
|
31
|
-
#said = undefined;
|
|
32
|
-
#stopped = false;
|
|
33
|
-
constructor(options) {
|
|
34
|
-
this.#read = options.read;
|
|
35
|
-
this.#say = options.say;
|
|
36
|
-
this.#onError = options.onError;
|
|
37
|
-
this.#retry = new RetryClock(options.schedule);
|
|
38
|
-
}
|
|
39
|
-
/** The Outbox may hold a different number of unsent rows now. */
|
|
40
|
-
changed() {
|
|
41
|
-
if (this.#stopped)
|
|
42
|
-
return;
|
|
43
|
-
this.#retry.cancel();
|
|
44
|
-
if (this.#reading) {
|
|
45
|
-
this.#again = true;
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
this.#reading = this.#readUntilQuiet().finally(() => {
|
|
49
|
-
this.#reading = null;
|
|
50
|
-
// A change heard after the loop's last check, before this read ended.
|
|
51
|
-
if (this.#again)
|
|
52
|
-
this.changed();
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
/** Say nothing more, and resolve once the read in flight settles. */
|
|
56
|
-
async stop() {
|
|
57
|
-
this.#stopped = true;
|
|
58
|
-
this.#retry.cancel();
|
|
59
|
-
await this.#reading;
|
|
60
|
-
}
|
|
61
|
-
async #readUntilQuiet() {
|
|
62
|
-
do {
|
|
63
|
-
this.#again = false;
|
|
64
|
-
let count;
|
|
65
|
-
try {
|
|
66
|
-
count = await this.#read();
|
|
67
|
-
this.#retry.succeeded();
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
if (this.#stopped)
|
|
71
|
-
return;
|
|
72
|
-
this.#onError(error);
|
|
73
|
-
count = null;
|
|
74
|
-
}
|
|
75
|
-
if (this.#stopped)
|
|
76
|
-
return;
|
|
77
|
-
if (count === null && !this.#again)
|
|
78
|
-
this.#retry.arm(() => this.changed());
|
|
79
|
-
if (count === this.#said)
|
|
80
|
-
continue;
|
|
81
|
-
try {
|
|
82
|
-
this.#say(count);
|
|
83
|
-
this.#said = count;
|
|
84
|
-
}
|
|
85
|
-
catch (error) {
|
|
86
|
-
this.#onError(error);
|
|
87
|
-
}
|
|
88
|
-
} while (this.#again && !this.#stopped);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=unsent-count.js.map
|
|
1
|
+
var e=Object.defineProperty;var h=(s,t)=>e(s,"name",{value:t,configurable:!0});import{RetryClock as r}from"./retry-clock.js";class c{static{h(this,"UnsentCount")}#r;#a;#e;#t;#h=null;#i=!1;#n=void 0;#s=!1;constructor(t){this.#r=t.read,this.#a=t.say,this.#e=t.onError,this.#t=new r(t.schedule)}changed(){if(!this.#s){if(this.#t.cancel(),this.#h){this.#i=!0;return}this.#h=this.#c().finally(()=>{this.#h=null,this.#i&&this.changed()})}}async stop(){this.#s=!0,this.#t.cancel(),await this.#h}async#c(){do{this.#i=!1;let t;try{t=await this.#r(),this.#t.succeeded()}catch(i){if(this.#s)return;this.#e(i),t=null}if(this.#s)return;if(t===null&&!this.#i&&this.#t.arm(()=>this.changed()),t!==this.#n)try{this.#a(t),this.#n=t}catch(i){this.#e(i)}}while(this.#i&&!this.#s)}}export{c as UnsentCount};
|
package/dist/records/wire.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
/** Exact wire for the entity Record/Send/Receive rail. */
|
|
2
1
|
import type { DeliveredEntityRecord, EntityRecordAuthorityPort, EntityRecordAvailability, EntityRecordBatchReply } from './rail-ports.js';
|
|
3
2
|
import { type EntityRecordSubmitRowFrame } from './submit-frame.js';
|
|
4
|
-
/** One batch offer. The rows' bytes travel in the binary body, in order. */
|
|
5
3
|
export interface EntityRecordSubmitFrame {
|
|
6
4
|
readonly type: 'entity.record.submit';
|
|
7
5
|
readonly request_id: string;
|
|
@@ -14,8 +12,6 @@ export interface EntityRecordSubscribeFrame {
|
|
|
14
12
|
readonly after_delivery_sequence: number;
|
|
15
13
|
readonly limit: number;
|
|
16
14
|
}
|
|
17
|
-
/** Follow one entity's own channel after its dense sequence. The authority
|
|
18
|
-
* proves the caller holds a role on the entity; there is no authority id. */
|
|
19
15
|
export interface EntityRecordSubscribeEntityFrame {
|
|
20
16
|
readonly type: 'entity.record.subscribe-entity';
|
|
21
17
|
readonly request_id: string;
|
|
@@ -36,8 +32,6 @@ export interface EntityRecordDeliveryFrame {
|
|
|
36
32
|
readonly delivery_sequence: number;
|
|
37
33
|
readonly record_json: string;
|
|
38
34
|
}
|
|
39
|
-
/** A committed batch answer: the accepted prefix, each record at its
|
|
40
|
-
* original delivery position, and the refusal that ended it, if one did. */
|
|
41
35
|
export interface EntityRecordAckFrame {
|
|
42
36
|
readonly type: 'entity.record.ack';
|
|
43
37
|
readonly request_id: string;
|
|
@@ -57,8 +51,6 @@ export interface EntityRecordBackfillResultFrame {
|
|
|
57
51
|
readonly request_id: string;
|
|
58
52
|
readonly records: readonly EntityRecordDeliveryFrame[];
|
|
59
53
|
}
|
|
60
|
-
/** `entity_id` names one entity channel; absent, the signal is about the
|
|
61
|
-
* authority's delivery tail. */
|
|
62
54
|
export interface EntityRecordAvailableFrame {
|
|
63
55
|
readonly type: 'entity.record.available';
|
|
64
56
|
readonly authority_id: string;
|
|
@@ -77,7 +69,5 @@ export interface EntityRecordWirePort {
|
|
|
77
69
|
export declare function decodeEntityRecordDeliveries(value: unknown): readonly DeliveredEntityRecord[];
|
|
78
70
|
export declare function decodeEntityRecordAck(value: unknown): EntityRecordBatchReply;
|
|
79
71
|
export declare function decodeEntityRecordAvailability(value: unknown): EntityRecordAvailability;
|
|
80
|
-
/** Map one authenticated request/event wire onto the portable authority port. */
|
|
81
72
|
export declare function createEntityRecordAuthorityPort(wire: EntityRecordWirePort): EntityRecordAuthorityPort;
|
|
82
73
|
export {};
|
|
83
|
-
//# sourceMappingURL=wire.d.ts.map
|