@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,136 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* The one reducer: the resolved graph at watermark N is what playing the
|
|
4
|
-
* complete accepted prefix through N, in the authority's acceptance order,
|
|
5
|
-
* leaves. Each accepted change plays onto the row the changes before it
|
|
6
|
-
* left, setting only its facets (`play.ts`); a move relocates the live
|
|
7
|
-
* subtree, because children keep their parent pointers. Tombstones stay
|
|
8
|
-
* rows, as absence, and nothing plays onto one.
|
|
9
|
-
*
|
|
10
|
-
* Container versions are derived membership. A record never carries the
|
|
11
|
-
* membership the reducer resolves, so every container whose membership or
|
|
12
|
-
* own row a change moved re-derives its version from its active children.
|
|
13
|
-
*
|
|
14
|
-
* The reduction can be held (Reduction): playing (q, p] onto the reduction
|
|
15
|
-
* through q is playing (M, p] at once, however the changes are chunked.
|
|
16
|
-
*/
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.Reduction = void 0;
|
|
19
|
-
exports.playChangesSteps = playChangesSteps;
|
|
20
|
-
exports.playChanges = playChanges;
|
|
21
|
-
const cloud_js_1 = require("./cloud.js");
|
|
22
|
-
const bodmas_js_1 = require("../clash/bodmas.js");
|
|
23
|
-
const rules_js_1 = require("./rules.js");
|
|
24
|
-
const types_js_1 = require("./types.js");
|
|
25
|
-
const steps_js_1 = require("../steps.js");
|
|
26
|
-
/** The reducer held between plays: the rows resolved through every record
|
|
27
|
-
* played so far, each row's children, and every UUID a change touched. */
|
|
28
|
-
class Reduction {
|
|
29
|
-
sha256Hex;
|
|
30
|
-
#rows = new Map();
|
|
31
|
-
#children = new Map();
|
|
32
|
-
#touched = new Set();
|
|
33
|
-
constructor(sha256Hex) {
|
|
34
|
-
this.sha256Hex = sha256Hex;
|
|
35
|
-
}
|
|
36
|
-
/** A reduction of a resolved base: a published graph or any graph already
|
|
37
|
-
* resolved through the same law. */
|
|
38
|
-
static *openSteps(base, sha256Hex) {
|
|
39
|
-
const reduction = new Reduction(sha256Hex);
|
|
40
|
-
yield* (0, steps_js_1.eachStep)((yield* (0, cloud_js_1.snapshotFromRecordsSteps)(base)).records, (record) => reduction.#set(record));
|
|
41
|
-
return reduction;
|
|
42
|
-
}
|
|
43
|
-
/** Every UUID whose own row a change moved, and every container a row entered
|
|
44
|
-
* or left. */
|
|
45
|
-
get touched() {
|
|
46
|
-
return this.#touched;
|
|
47
|
-
}
|
|
48
|
-
touches(uuid) {
|
|
49
|
-
return this.#touched.has(uuid);
|
|
50
|
-
}
|
|
51
|
-
row(uuid) {
|
|
52
|
-
return this.#rows.get(uuid);
|
|
53
|
-
}
|
|
54
|
-
/** The UUIDs whose rows name `uuid` as parent, any status. */
|
|
55
|
-
childrenOf(uuid) {
|
|
56
|
-
return [...(this.#children.get(uuid) ?? [])];
|
|
57
|
-
}
|
|
58
|
-
/** Play `changes` in acceptance order, each onto what the ones before it
|
|
59
|
-
* left (`play.ts`): a change sets only its facets. */
|
|
60
|
-
*playSteps(changes) {
|
|
61
|
-
const derive = new Set();
|
|
62
|
-
// A move into the entity itself or beneath it, as the rows stand.
|
|
63
|
-
const loops = (uuid, parentUUID) => {
|
|
64
|
-
const seen = new Set();
|
|
65
|
-
for (let at = parentUUID; at !== null && !seen.has(at); at = this.#rows.get(at)?.parentUUID ?? null) {
|
|
66
|
-
if (at === uuid)
|
|
67
|
-
return true;
|
|
68
|
-
seen.add(at);
|
|
69
|
-
}
|
|
70
|
-
return false;
|
|
71
|
-
};
|
|
72
|
-
for (let index = 0; index < changes.length; index += 1) {
|
|
73
|
-
const { facets, result, joins } = changes[index];
|
|
74
|
-
const previous = this.#rows.get(result.uuid) ?? null;
|
|
75
|
-
const refused = previous !== null && result.parentUUID !== null && facets.includes('move')
|
|
76
|
-
&& loops(result.uuid, result.parentUUID) ? { keeps: previous.parentUUID } : undefined;
|
|
77
|
-
const { row } = (0, bodmas_js_1.playChange)(previous, { facets, result: (0, cloud_js_1.assertRecord)(result), joins }, this.sha256Hex, refused);
|
|
78
|
-
if (row !== null && row !== previous)
|
|
79
|
-
this.#place(row, derive);
|
|
80
|
-
if ((index + 1) % steps_js_1.ITEMS_PER_BOUNDARY === 0)
|
|
81
|
-
yield;
|
|
82
|
-
}
|
|
83
|
-
yield* this.#derive(derive);
|
|
84
|
-
}
|
|
85
|
-
#place(row, derive) {
|
|
86
|
-
const previous = this.#rows.get(row.uuid);
|
|
87
|
-
if (previous?.parentUUID)
|
|
88
|
-
derive.add(previous.parentUUID);
|
|
89
|
-
if (row.parentUUID !== null)
|
|
90
|
-
derive.add(row.parentUUID);
|
|
91
|
-
derive.add(row.uuid);
|
|
92
|
-
this.#set(row);
|
|
93
|
-
}
|
|
94
|
-
*#derive(derive) {
|
|
95
|
-
for (const uuid of derive) {
|
|
96
|
-
this.#touched.add(uuid);
|
|
97
|
-
const container = this.#rows.get(uuid);
|
|
98
|
-
if (!container || !types_js_1.DERIVED_PAYLOAD.has(container.type))
|
|
99
|
-
continue;
|
|
100
|
-
const children = this.childrenOf(uuid).map((child) => this.#rows.get(child)).filter(({ status }) => status === 'active');
|
|
101
|
-
const version = (0, rules_js_1.membershipVersion)(container, children, this.sha256Hex);
|
|
102
|
-
if (version !== container.version)
|
|
103
|
-
this.#rows.set(uuid, { ...container, version });
|
|
104
|
-
yield;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
/** The resolved graph in snapshot order. */
|
|
108
|
-
*recordsSteps() {
|
|
109
|
-
return yield* (0, steps_js_1.sortSteps)(this.#rows.values(), (left, right) => (left.uuid < right.uuid ? -1 : left.uuid > right.uuid ? 1 : 0));
|
|
110
|
-
}
|
|
111
|
-
#set(record) {
|
|
112
|
-
const previous = this.#rows.get(record.uuid);
|
|
113
|
-
if (previous?.parentUUID)
|
|
114
|
-
this.#children.get(previous.parentUUID)?.delete(record.uuid);
|
|
115
|
-
this.#rows.set(record.uuid, record);
|
|
116
|
-
if (record.parentUUID === null)
|
|
117
|
-
return;
|
|
118
|
-
const siblings = this.#children.get(record.parentUUID);
|
|
119
|
-
if (siblings)
|
|
120
|
-
siblings.add(record.uuid);
|
|
121
|
-
else
|
|
122
|
-
this.#children.set(record.parentUUID, new Set([record.uuid]));
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
exports.Reduction = Reduction;
|
|
126
|
-
/** Play accepted changes onto a resolved base, in acceptance order. The
|
|
127
|
-
* result is the resolved graph after the last change, in snapshot order. */
|
|
128
|
-
function* playChangesSteps(base, changes, sha256Hex) {
|
|
129
|
-
const reduction = yield* Reduction.openSteps(base, sha256Hex);
|
|
130
|
-
yield* reduction.playSteps(changes);
|
|
131
|
-
return { records: yield* reduction.recordsSteps(), touched: reduction.touched };
|
|
132
|
-
}
|
|
133
|
-
function playChanges(base, changes, sha256Hex) {
|
|
134
|
-
return (0, steps_js_1.finishSteps)(playChangesSteps(base, changes, sha256Hex)).records;
|
|
135
|
-
}
|
|
136
|
-
//# sourceMappingURL=reducer.js.map
|
|
1
|
+
"use strict";var y=Object.defineProperty;var d=(o,e)=>y(o,"name",{value:e,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.Reduction=void 0,exports.playChangesSteps=U,exports.playChanges=I;const h=require("./cloud.js"),D=require("../clash/bodmas.js"),S=require("./rules.js"),g=require("./types.js"),l=require("../steps.js");class p{static{d(this,"Reduction")}sha256Hex;#e=new Map;#t=new Map;#s=new Set;constructor(e){this.sha256Hex=e}static*openSteps(e,t){const s=new p(t);return yield*(0,l.eachStep)((yield*(0,h.snapshotFromRecordsSteps)(e)).records,i=>s.#n(i)),s}get touched(){return this.#s}touches(e){return this.#s.has(e)}row(e){return this.#e.get(e)}childrenOf(e){return[...this.#t.get(e)??[]]}*playSteps(e){const t=new Set,s=d((i,r)=>{const n=new Set;for(let u=r;u!==null&&!n.has(u);u=this.#e.get(u)?.parentUUID??null){if(u===i)return!0;n.add(u)}return!1},"loops");for(let i=0;i<e.length;i+=1){const{facets:r,result:n,joins:u}=e[i],a=this.#e.get(n.uuid)??null,f=a!==null&&n.parentUUID!==null&&r.includes("move")&&s(n.uuid,n.parentUUID)?{keeps:a.parentUUID}:void 0,{row:c}=(0,D.playChange)(a,{facets:r,result:(0,h.assertRecord)(n),joins:u},this.sha256Hex,f);c!==null&&c!==a&&this.#i(c,t),(i+1)%l.ITEMS_PER_BOUNDARY===0&&(yield)}yield*this.#u(t)}#i(e,t){const s=this.#e.get(e.uuid);s?.parentUUID&&t.add(s.parentUUID),e.parentUUID!==null&&t.add(e.parentUUID),t.add(e.uuid),this.#n(e)}*#u(e){for(const t of e){this.#s.add(t);const s=this.#e.get(t);if(!s||!g.DERIVED_PAYLOAD.has(s.type))continue;const i=this.childrenOf(t).map(n=>this.#e.get(n)).filter(({status:n})=>n==="active"),r=(0,S.membershipVersion)(s,i,this.sha256Hex);r!==s.version&&this.#e.set(t,{...s,version:r}),yield}}*recordsSteps(){return yield*(0,l.sortSteps)(this.#e.values(),(e,t)=>e.uuid<t.uuid?-1:e.uuid>t.uuid?1:0)}#n(e){const t=this.#e.get(e.uuid);if(t?.parentUUID&&this.#t.get(t.parentUUID)?.delete(e.uuid),this.#e.set(e.uuid,e),e.parentUUID===null)return;const s=this.#t.get(e.parentUUID);s?s.add(e.uuid):this.#t.set(e.parentUUID,new Set([e.uuid]))}}exports.Reduction=p;function*U(o,e,t){const s=yield*p.openSteps(o,t);return yield*s.playSteps(e),{records:yield*s.recordsSteps(),touched:s.touched}}d(U,"playChangesSteps");function I(o,e,t){return(0,l.finishSteps)(U(o,e,t)).records}d(I,"playChanges");
|
|
@@ -1,483 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* The registry graph as a reader holds it: a computer, or the authority
|
|
4
|
-
* answering one admitted read.
|
|
5
|
-
*
|
|
6
|
-
* The authority stores the graph as a small head naming each root's immutable
|
|
7
|
-
* pages, and a reader holds exactly that: the head, plus the records of
|
|
8
|
-
* only the roots the current operation materializes. Nothing ever
|
|
9
|
-
* materializes the whole account — and most reads materialize nothing.
|
|
10
|
-
*
|
|
11
|
-
* Two page lists per root (graph-pages.ts) make every point read cheap:
|
|
12
|
-
* - Record pages hold the root in (parentUUID, uuid) order, so one folder's
|
|
13
|
-
* children are found from the references alone and read from the few pages
|
|
14
|
-
* that hold them.
|
|
15
|
-
* - The parent index names each record's parent in uuid order, so an entity
|
|
16
|
-
* whose parent is unknown costs one parent-index page, then one record page.
|
|
17
|
-
*
|
|
18
|
-
* A reader proves each page it reads against its reference and believes the
|
|
19
|
-
* head for the rest; the authority proved every root whole before it
|
|
20
|
-
* committed it. Pages are parsed transiently and dropped, so a point read's
|
|
21
|
-
* memory is O(page), never O(root). Where H holds an entity never changes
|
|
22
|
-
* under one graph, so each entity's root and parent are read once.
|
|
23
|
-
*
|
|
24
|
-
* A resource whose authority snapshot is still records-shaped (a login's
|
|
25
|
-
* initial publication, before any head has committed) is held with a null
|
|
26
|
-
* head and every record in memory — such graphs are one machine's first
|
|
27
|
-
* publication and small by construction.
|
|
28
|
-
*/
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.RegistryGraph = void 0;
|
|
31
|
-
exports.registryGraphFromSnapshot = registryGraphFromSnapshot;
|
|
32
|
-
const steps_js_1 = require("../steps.js");
|
|
33
|
-
const bytes_js_1 = require("./bytes.js");
|
|
34
|
-
const cloud_js_1 = require("./cloud.js");
|
|
35
|
-
const graph_head_js_1 = require("./graph-head.js");
|
|
36
|
-
const graph_pages_js_1 = require("./graph-pages.js");
|
|
37
|
-
const finishNow = async (steps) => (0, steps_js_1.finishSteps)(steps);
|
|
38
|
-
/** How many pages a scan fetches ahead of its in-order proof. Bounds
|
|
39
|
-
* transient page bytes at PAGE_PREFETCH page budgets. */
|
|
40
|
-
const PAGE_PREFETCH = 4;
|
|
41
|
-
const NO_PAGES = { pages: [], parents: [] };
|
|
42
|
-
function rawUuid(row) {
|
|
43
|
-
return String(row?.uuid ?? '');
|
|
44
|
-
}
|
|
45
|
-
function rawKey(row) {
|
|
46
|
-
const parent = row?.parentUUID;
|
|
47
|
-
return [typeof parent === 'string' ? parent : null, rawUuid(row)];
|
|
48
|
-
}
|
|
49
|
-
/** One raw page row through the canonical record law, before anyone reads it. */
|
|
50
|
-
function assertedRecord(row) {
|
|
51
|
-
return (0, cloud_js_1.snapshotFromRecords)([row]).records[0];
|
|
52
|
-
}
|
|
53
|
-
/** The index of `target` in ascending `rows`, or -1. */
|
|
54
|
-
function search(rows, target, compare) {
|
|
55
|
-
let low = 0;
|
|
56
|
-
let high = rows.length - 1;
|
|
57
|
-
while (low <= high) {
|
|
58
|
-
const middle = (low + high) >> 1;
|
|
59
|
-
const order = compare(rows[middle], target);
|
|
60
|
-
if (order === 0)
|
|
61
|
-
return middle;
|
|
62
|
-
if (order < 0)
|
|
63
|
-
low = middle + 1;
|
|
64
|
-
else
|
|
65
|
-
high = middle - 1;
|
|
66
|
-
}
|
|
67
|
-
return -1;
|
|
68
|
-
}
|
|
69
|
-
function parentPair(row) {
|
|
70
|
-
if (!Array.isArray(row) || row.length !== 2 || typeof row[0] !== 'string'
|
|
71
|
-
|| !(row[1] === null || typeof row[1] === 'string')) {
|
|
72
|
-
throw new Error('cloud graph parent index holds an invalid entry');
|
|
73
|
-
}
|
|
74
|
-
return [row[0], row[1]];
|
|
75
|
-
}
|
|
76
|
-
const byPairUuid = (row, uuid) => {
|
|
77
|
-
const named = parentPair(row)[0];
|
|
78
|
-
return named < uuid ? -1 : named > uuid ? 1 : 0;
|
|
79
|
-
};
|
|
80
|
-
function grouped(groups, key, open) {
|
|
81
|
-
const held = groups.get(key);
|
|
82
|
-
if (held !== undefined)
|
|
83
|
-
return held;
|
|
84
|
-
const opened = open();
|
|
85
|
-
groups.set(key, opened);
|
|
86
|
-
return opened;
|
|
87
|
-
}
|
|
88
|
-
function misplaced(rootId, uuid) {
|
|
89
|
-
return new Error(`cloud graph root ${rootId}'s parent index names ${uuid}, but its pages do not hold it`);
|
|
90
|
-
}
|
|
91
|
-
class RegistryGraph {
|
|
92
|
-
/** The committed head, or null while the authority still holds a
|
|
93
|
-
* records-shaped snapshot. */
|
|
94
|
-
head;
|
|
95
|
-
roots;
|
|
96
|
-
readPage;
|
|
97
|
-
sha256Hex;
|
|
98
|
-
finish;
|
|
99
|
-
/** Where H holds each uuid already asked about: its holder, or null once
|
|
100
|
-
* every root has said it holds none. */
|
|
101
|
-
placed = new Map();
|
|
102
|
-
constructor(head, roots, readPage, sha256Hex, finish) {
|
|
103
|
-
this.head = head;
|
|
104
|
-
this.roots = roots;
|
|
105
|
-
this.readPage = readPage;
|
|
106
|
-
this.sha256Hex = sha256Hex;
|
|
107
|
-
this.finish = finish;
|
|
108
|
-
}
|
|
109
|
-
/** Hold a records-shaped snapshot fully materialized: it is a first
|
|
110
|
-
* publication's own graph and carries no page identities to defer to. */
|
|
111
|
-
static fromRecords(records, sha256Hex) {
|
|
112
|
-
const roots = new Map();
|
|
113
|
-
for (const [rootId, group] of (0, graph_head_js_1.recordsByRoot)(records)) {
|
|
114
|
-
roots.set(rootId, {
|
|
115
|
-
refs: NO_PAGES,
|
|
116
|
-
records: group,
|
|
117
|
-
loading: null,
|
|
118
|
-
rootRecord: group.find((record) => record.uuid === rootId) ?? null,
|
|
119
|
-
byUuid: null,
|
|
120
|
-
byParent: null,
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
const reader = () => {
|
|
124
|
-
throw new Error('a records-shaped graph has no pages to read');
|
|
125
|
-
};
|
|
126
|
-
return new RegistryGraph(null, roots, reader, sha256Hex, finishNow);
|
|
127
|
-
}
|
|
128
|
-
/** Hold a committed head lazily: every root starts as page identities. */
|
|
129
|
-
static fromHead(head, readPage, sha256Hex, finish = finishNow) {
|
|
130
|
-
const roots = new Map();
|
|
131
|
-
for (const root of head.roots) {
|
|
132
|
-
roots.set(root.rootId, {
|
|
133
|
-
refs: { pages: root.pages, parents: root.parents },
|
|
134
|
-
records: null,
|
|
135
|
-
loading: null,
|
|
136
|
-
rootRecord: null,
|
|
137
|
-
byUuid: null,
|
|
138
|
-
byParent: null,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
return new RegistryGraph(head, roots, readPage, sha256Hex, finish);
|
|
142
|
-
}
|
|
143
|
-
rootIds() {
|
|
144
|
-
return [...this.roots.keys()];
|
|
145
|
-
}
|
|
146
|
-
/** The records of one root as this machine has already materialized them,
|
|
147
|
-
* or null when that root is still page identities. */
|
|
148
|
-
loadedRecords(rootId) {
|
|
149
|
-
return this.roots.get(rootId.toLowerCase())?.records ?? null;
|
|
150
|
-
}
|
|
151
|
-
/** Materialize one root: every record page proven and parsed in order with
|
|
152
|
-
* a bounded prefetch, bytes dropped as they are consumed, then the complete
|
|
153
|
-
* subtree law over what they hold. An absent root answers empty rather than
|
|
154
|
-
* faulting — reading a root that is not there is how callers learn it is
|
|
155
|
-
* not there. */
|
|
156
|
-
async recordsFor(rootId) {
|
|
157
|
-
const normalized = rootId.toLowerCase();
|
|
158
|
-
const state = this.roots.get(normalized);
|
|
159
|
-
if (!state)
|
|
160
|
-
return [];
|
|
161
|
-
if (state.records)
|
|
162
|
-
return state.records;
|
|
163
|
-
state.loading ??= (async () => {
|
|
164
|
-
const assembled = [];
|
|
165
|
-
await this.scanPages(state.refs.pages, (rows) => {
|
|
166
|
-
assembled.push(...rows);
|
|
167
|
-
});
|
|
168
|
-
const records = await this.finish((0, cloud_js_1.completeRootsFromRecordsSteps)([normalized], assembled));
|
|
169
|
-
state.records = records;
|
|
170
|
-
state.rootRecord = records.find((record) => record.uuid === normalized) ?? null;
|
|
171
|
-
return records;
|
|
172
|
-
})();
|
|
173
|
-
try {
|
|
174
|
-
return await state.loading;
|
|
175
|
-
}
|
|
176
|
-
catch (error) {
|
|
177
|
-
state.loading = null;
|
|
178
|
-
throw error;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
/** One root's own record — the discovery unit. It opens the root's first
|
|
182
|
-
* record page, since no parent sorts before every parent. */
|
|
183
|
-
async rootRecord(rootId) {
|
|
184
|
-
const normalized = rootId.toLowerCase();
|
|
185
|
-
const state = this.roots.get(normalized);
|
|
186
|
-
if (!state)
|
|
187
|
-
throw new Error(`cloud graph has no root ${normalized}`);
|
|
188
|
-
if (state.rootRecord)
|
|
189
|
-
return state.rootRecord;
|
|
190
|
-
const first = state.records ? null : state.refs.pages[0];
|
|
191
|
-
const rows = first ? await this.rows(first) : [];
|
|
192
|
-
const found = rows.length > 0 ? assertedRecord(rows[0]) : null;
|
|
193
|
-
if (!found || found.uuid !== normalized || found.parentUUID !== null) {
|
|
194
|
-
throw new Error(`cloud graph root ${normalized} does not hold its own record`);
|
|
195
|
-
}
|
|
196
|
-
state.rootRecord = found;
|
|
197
|
-
return found;
|
|
198
|
-
}
|
|
199
|
-
/** Every root's own record, for discovery over the whole account — which
|
|
200
|
-
* root is the core, which roots are workspaces — at one page per root. */
|
|
201
|
-
async rootRecords() {
|
|
202
|
-
return Promise.all([...this.roots.keys()].map((rootId) => this.rootRecord(rootId)));
|
|
203
|
-
}
|
|
204
|
-
/** H's chain of each uuid the graph holds: the uuid, then each parent up
|
|
205
|
-
* to its root. Each level climbs by the parent index, reading each page
|
|
206
|
-
* that could name that level's ancestors once. */
|
|
207
|
-
async chains(uuids) {
|
|
208
|
-
const placed = await this.holders(uuids);
|
|
209
|
-
const parentOf = new Map();
|
|
210
|
-
for (let level = placed; level.size > 0;) {
|
|
211
|
-
for (const [uuid, { parent }] of level)
|
|
212
|
-
parentOf.set(uuid, parent);
|
|
213
|
-
const climbing = new Map();
|
|
214
|
-
for (const { root, parent } of level.values()) {
|
|
215
|
-
if (parent !== null && !parentOf.has(parent))
|
|
216
|
-
grouped(climbing, root, () => new Set()).add(parent);
|
|
217
|
-
}
|
|
218
|
-
const next = new Map();
|
|
219
|
-
for (const [root, ancestors] of climbing) {
|
|
220
|
-
const unknown = [...ancestors].filter((ancestor) => this.heldAt(ancestor) === undefined);
|
|
221
|
-
if (unknown.length > 0)
|
|
222
|
-
await this.holdersIn(root, unknown);
|
|
223
|
-
for (const ancestor of ancestors) {
|
|
224
|
-
const holder = this.heldAt(ancestor);
|
|
225
|
-
if (!holder || holder.root !== root)
|
|
226
|
-
throw misplaced(root, ancestor);
|
|
227
|
-
next.set(ancestor, holder);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
level = next;
|
|
231
|
-
}
|
|
232
|
-
const chains = new Map();
|
|
233
|
-
for (const uuid of placed.keys()) {
|
|
234
|
-
const chain = [uuid];
|
|
235
|
-
for (let at = parentOf.get(uuid); at !== null; at = parentOf.get(at)) {
|
|
236
|
-
if (chain.length > parentOf.size)
|
|
237
|
-
throw new Error(`cloud graph entity ${uuid} has a parent cycle`);
|
|
238
|
-
chain.push(at);
|
|
239
|
-
}
|
|
240
|
-
chains.set(uuid, chain);
|
|
241
|
-
}
|
|
242
|
-
return chains;
|
|
243
|
-
}
|
|
244
|
-
/** H's row of each uuid the graph holds: its parent from the parent index,
|
|
245
|
-
* then the one record page its key falls in, each page read once. */
|
|
246
|
-
async records(uuids) {
|
|
247
|
-
const found = new Map();
|
|
248
|
-
const asked = new Map();
|
|
249
|
-
for (const [uuid, { root, parent }] of await this.holders(uuids)) {
|
|
250
|
-
const state = this.roots.get(root);
|
|
251
|
-
if (state.records)
|
|
252
|
-
found.set(uuid, this.byUuid(state).get(uuid));
|
|
253
|
-
else if (parent === null)
|
|
254
|
-
found.set(uuid, await this.rootRecord(root));
|
|
255
|
-
else {
|
|
256
|
-
const key = [parent, uuid];
|
|
257
|
-
const index = (0, graph_pages_js_1.pageHolding)(state.refs.pages, key);
|
|
258
|
-
if (index < 0)
|
|
259
|
-
throw misplaced(root, uuid);
|
|
260
|
-
grouped(grouped(asked, root, () => new Map()), index, () => []).push(key);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
for (const [root, pages] of asked) {
|
|
264
|
-
const refs = this.roots.get(root).refs.pages;
|
|
265
|
-
const indexes = [...pages.keys()].sort((left, right) => left - right);
|
|
266
|
-
await this.scanPages(indexes.map((index) => refs[index]), (rows, position) => {
|
|
267
|
-
for (const key of pages.get(indexes[position])) {
|
|
268
|
-
const at = search(rows, key, (row, target) => (0, graph_pages_js_1.compareGraphKeys)(rawKey(row), target));
|
|
269
|
-
const record = at < 0 ? null : assertedRecord(rows[at]);
|
|
270
|
-
if (!record || record.uuid !== key[1] || record.parentUUID !== key[0])
|
|
271
|
-
throw misplaced(root, key[1]);
|
|
272
|
-
found.set(key[1], record);
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
return found;
|
|
277
|
-
}
|
|
278
|
-
/** H's rows directly beneath each parent the graph holds, any status, in
|
|
279
|
-
* uuid order: read from the record pages that can hold them, each once.
|
|
280
|
-
* Where H holds each row is then known. */
|
|
281
|
-
async children(parents) {
|
|
282
|
-
const found = new Map();
|
|
283
|
-
const asked = new Map();
|
|
284
|
-
for (const [parent, { root }] of await this.holders(parents)) {
|
|
285
|
-
const state = this.roots.get(root);
|
|
286
|
-
if (state.records)
|
|
287
|
-
found.set(parent, this.byParent(state).get(parent) ?? []);
|
|
288
|
-
else
|
|
289
|
-
grouped(asked, root, () => new Set()).add(parent);
|
|
290
|
-
}
|
|
291
|
-
for (const [root, named] of asked) {
|
|
292
|
-
const refs = this.roots.get(root).refs.pages;
|
|
293
|
-
const indexes = new Set();
|
|
294
|
-
for (const parent of named) {
|
|
295
|
-
const [from, to] = (0, graph_pages_js_1.pagesHoldingChildren)(refs, parent);
|
|
296
|
-
for (let index = from; index <= to; index += 1)
|
|
297
|
-
indexes.add(index);
|
|
298
|
-
}
|
|
299
|
-
const held = new Map([...named].map((parent) => [parent, []]));
|
|
300
|
-
const sorted = [...indexes].sort((left, right) => left - right);
|
|
301
|
-
await this.scanPages(sorted.map((index) => refs[index]), (rows) => {
|
|
302
|
-
for (const row of rows) {
|
|
303
|
-
const parent = rawKey(row)[0];
|
|
304
|
-
if (parent !== null)
|
|
305
|
-
held.get(parent)?.push(row);
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
for (const [parent, rows] of held) {
|
|
309
|
-
const records = (0, cloud_js_1.snapshotFromRecords)(rows).records;
|
|
310
|
-
// A row read says where H holds it, so a walk beneath it reads no
|
|
311
|
-
// parent index.
|
|
312
|
-
for (const record of records)
|
|
313
|
-
this.placed.set(record.uuid, { root, parent });
|
|
314
|
-
found.set(parent, records);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
return found;
|
|
318
|
-
}
|
|
319
|
-
/** Which root holds each uuid the graph holds. */
|
|
320
|
-
async rootsOf(uuids) {
|
|
321
|
-
return new Map([...await this.holders(uuids)].map(([uuid, { root }]) => [uuid, root]));
|
|
322
|
-
}
|
|
323
|
-
/** The checksum the authority holds for this graph right now. */
|
|
324
|
-
checksum() {
|
|
325
|
-
if (this.head !== null)
|
|
326
|
-
return (0, graph_head_js_1.graphHeadChecksum)(this.head, this.sha256Hex);
|
|
327
|
-
return this.sha256Hex((0, cloud_js_1.stableJson)(this.recordsShapedSnapshot()));
|
|
328
|
-
}
|
|
329
|
-
/** The records shape of a headless graph — a first publication's own small
|
|
330
|
-
* snapshot. A committed head never flattens: readers are root-scoped. */
|
|
331
|
-
recordsShapedSnapshot() {
|
|
332
|
-
if (this.head !== null) {
|
|
333
|
-
throw new Error('a committed graph head is never flattened to records');
|
|
334
|
-
}
|
|
335
|
-
const records = [];
|
|
336
|
-
for (const state of this.roots.values())
|
|
337
|
-
for (const record of state.records ?? [])
|
|
338
|
-
records.push(record);
|
|
339
|
-
return {
|
|
340
|
-
schemaVersion: cloud_js_1.ENTITY_CLOUD_SCHEMA_VERSION,
|
|
341
|
-
kind: 'amalgm-entity-registry',
|
|
342
|
-
records: (0, cloud_js_1.snapshotFromRecords)(records).records,
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
byUuid(state) {
|
|
346
|
-
return state.byUuid ??= new Map(state.records.map((record) => [record.uuid, record]));
|
|
347
|
-
}
|
|
348
|
-
byParent(state) {
|
|
349
|
-
if (state.byParent)
|
|
350
|
-
return state.byParent;
|
|
351
|
-
const byParent = new Map();
|
|
352
|
-
for (const record of state.records) {
|
|
353
|
-
if (record.parentUUID === null)
|
|
354
|
-
continue;
|
|
355
|
-
const siblings = byParent.get(record.parentUUID);
|
|
356
|
-
if (siblings)
|
|
357
|
-
siblings.push(record);
|
|
358
|
-
else
|
|
359
|
-
byParent.set(record.parentUUID, [record]);
|
|
360
|
-
}
|
|
361
|
-
return state.byParent = byParent;
|
|
362
|
-
}
|
|
363
|
-
/** Where H holds each uuid: its root and its parent. A uuid naming a root
|
|
364
|
-
* is answered directly, one already placed from memory, and a materialized
|
|
365
|
-
* root from its records; every other root reads each parent-index page that
|
|
366
|
-
* could name a uuid still unplaced once. */
|
|
367
|
-
async holders(uuids) {
|
|
368
|
-
const found = new Map();
|
|
369
|
-
let unplaced = [];
|
|
370
|
-
for (const uuid of new Set(uuids)) {
|
|
371
|
-
const holder = this.heldAt(uuid);
|
|
372
|
-
if (holder)
|
|
373
|
-
found.set(uuid, holder);
|
|
374
|
-
else if (holder === undefined)
|
|
375
|
-
unplaced.push(uuid);
|
|
376
|
-
}
|
|
377
|
-
const materializedFirst = [...this.roots].sort(([, left], [, right]) => Number(!left.records) - Number(!right.records));
|
|
378
|
-
for (const [root] of materializedFirst) {
|
|
379
|
-
if (unplaced.length === 0)
|
|
380
|
-
break;
|
|
381
|
-
for (const [uuid, holder] of await this.holdersIn(root, unplaced))
|
|
382
|
-
found.set(uuid, holder);
|
|
383
|
-
unplaced = unplaced.filter((uuid) => !found.has(uuid));
|
|
384
|
-
}
|
|
385
|
-
for (const uuid of unplaced)
|
|
386
|
-
this.placed.set(uuid, null);
|
|
387
|
-
return found;
|
|
388
|
-
}
|
|
389
|
-
/** Where H is already known to hold `uuid`: its holder, null for nowhere,
|
|
390
|
-
* or undefined while unasked. */
|
|
391
|
-
heldAt(uuid) {
|
|
392
|
-
return this.roots.has(uuid) ? { root: uuid, parent: null } : this.placed.get(uuid);
|
|
393
|
-
}
|
|
394
|
-
/** The holders one root has for `uuids`, remembered. */
|
|
395
|
-
async holdersIn(root, uuids) {
|
|
396
|
-
const found = new Map();
|
|
397
|
-
for (const [uuid, parent] of await this.parentsIn(this.roots.get(root), uuids)) {
|
|
398
|
-
const holder = { root, parent };
|
|
399
|
-
this.placed.set(uuid, holder);
|
|
400
|
-
found.set(uuid, holder);
|
|
401
|
-
}
|
|
402
|
-
return found;
|
|
403
|
-
}
|
|
404
|
-
/** The parent one root names for each uuid it holds — null for the root
|
|
405
|
-
* itself. */
|
|
406
|
-
async parentsIn(state, uuids) {
|
|
407
|
-
const found = new Map();
|
|
408
|
-
if (state.records) {
|
|
409
|
-
const held = this.byUuid(state);
|
|
410
|
-
for (const uuid of uuids) {
|
|
411
|
-
const row = held.get(uuid);
|
|
412
|
-
if (row)
|
|
413
|
-
found.set(uuid, row.parentUUID);
|
|
414
|
-
}
|
|
415
|
-
return found;
|
|
416
|
-
}
|
|
417
|
-
const asked = new Map();
|
|
418
|
-
for (const uuid of uuids) {
|
|
419
|
-
const index = (0, graph_pages_js_1.parentPageHolding)(state.refs.parents, uuid);
|
|
420
|
-
if (index >= 0)
|
|
421
|
-
grouped(asked, index, () => []).push(uuid);
|
|
422
|
-
}
|
|
423
|
-
const indexes = [...asked.keys()].sort((left, right) => left - right);
|
|
424
|
-
await this.scanPages(indexes.map((index) => state.refs.parents[index]), (pairs, position) => {
|
|
425
|
-
for (const uuid of asked.get(indexes[position])) {
|
|
426
|
-
const at = search(pairs, uuid, byPairUuid);
|
|
427
|
-
if (at >= 0)
|
|
428
|
-
found.set(uuid, parentPair(pairs[at])[1]);
|
|
429
|
-
}
|
|
430
|
-
});
|
|
431
|
-
return found;
|
|
432
|
-
}
|
|
433
|
-
/** One page proven against its reference and parsed. */
|
|
434
|
-
async rows(ref) {
|
|
435
|
-
return (0, graph_pages_js_1.parseGraphPage)(ref, await this.readPage(ref), this.sha256Hex);
|
|
436
|
-
}
|
|
437
|
-
/** Prove, parse, and visit pages in order, fetching a bounded window ahead
|
|
438
|
-
* so the network pipeline stays full while transient memory stays at a few
|
|
439
|
-
* page budgets. */
|
|
440
|
-
async scanPages(refs, visit) {
|
|
441
|
-
const pending = [];
|
|
442
|
-
let ahead = 0;
|
|
443
|
-
try {
|
|
444
|
-
for (let index = 0; index < refs.length; index += 1) {
|
|
445
|
-
while (ahead < refs.length && pending.length < PAGE_PREFETCH) {
|
|
446
|
-
pending.push(this.readPage(refs[ahead]));
|
|
447
|
-
ahead += 1;
|
|
448
|
-
}
|
|
449
|
-
visit((0, graph_pages_js_1.parseGraphPage)(refs[index], await pending.shift(), this.sha256Hex), index);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
finally {
|
|
453
|
-
// A fault must strand no in-flight read unobserved.
|
|
454
|
-
await Promise.allSettled(pending);
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
exports.RegistryGraph = RegistryGraph;
|
|
459
|
-
/** Hold the authority's stored snapshot bytes as this machine's graph. A head
|
|
460
|
-
* is held lazily — no page is read here — and a records-shaped snapshot is
|
|
461
|
-
* grouped in place. */
|
|
462
|
-
function registryGraphFromSnapshot(bytes, readPage, sha256Hex, finish = finishNow) {
|
|
463
|
-
if (!snapshotIsGraphHead(bytes)) {
|
|
464
|
-
return RegistryGraph.fromRecords((0, cloud_js_1.parseSnapshot)(bytes).records, sha256Hex);
|
|
465
|
-
}
|
|
466
|
-
return RegistryGraph.fromHead((0, graph_head_js_1.parseGraphHead)(bytes), readPage, sha256Hex, finish);
|
|
467
|
-
}
|
|
468
|
-
/** Which shape the authority's snapshot bytes carry. Both shapes declare their
|
|
469
|
-
* kind ahead of their payload, and no record carries a `kind` of its own, so
|
|
470
|
-
* the first declaration in the opening bytes is the snapshot's — the shape is
|
|
471
|
-
* decided from a few bytes rather than by parsing a whole graph. */
|
|
472
|
-
function snapshotIsGraphHead(bytes) {
|
|
473
|
-
const declared = /"kind":"([^"]*)"/
|
|
474
|
-
.exec((0, bytes_js_1.utf8Decode)(bytes.subarray(0, SNAPSHOT_KIND_PREFIX_BYTES)));
|
|
475
|
-
if (!declared)
|
|
476
|
-
throw new Error('cloud registry snapshot declares no kind');
|
|
477
|
-
return declared[1] === graph_head_js_1.GRAPH_HEAD_KIND;
|
|
478
|
-
}
|
|
479
|
-
/** Enough opening bytes to hold the kind declaration of either shape, whatever
|
|
480
|
-
* small members precede it. The authority reads the same prefix to decide the
|
|
481
|
-
* same question. */
|
|
482
|
-
const SNAPSHOT_KIND_PREFIX_BYTES = 128;
|
|
483
|
-
//# sourceMappingURL=registry-graph.js.map
|
|
1
|
+
"use strict";var E=Object.defineProperty;var f=(a,e)=>E(a,"name",{value:e,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.RegistryGraph=void 0,exports.registryGraphFromSnapshot=F;const H=require("../steps.js"),k=require("./bytes.js"),g=require("./cloud.js"),P=require("./graph-head.js"),w=require("./graph-pages.js"),R=f(async a=>(0,H.finishSteps)(a),"finishNow"),x=4,A={pages:[],parents:[]};function D(a){return String(a?.uuid??"")}f(D,"rawUuid");function U(a){const e=a?.parentUUID;return[typeof e=="string"?e:null,D(a)]}f(U,"rawKey");function M(a){return(0,g.snapshotFromRecords)([a]).records[0]}f(M,"assertedRecord");function _(a,e,s){let t=0,n=a.length-1;for(;t<=n;){const r=t+n>>1,o=s(a[r],e);if(o===0)return r;o<0?t=r+1:n=r-1}return-1}f(_,"search");function I(a){if(!Array.isArray(a)||a.length!==2||typeof a[0]!="string"||!(a[1]===null||typeof a[1]=="string"))throw new Error("cloud graph parent index holds an invalid entry");return[a[0],a[1]]}f(I,"parentPair");const G=f((a,e)=>{const s=I(a)[0];return s<e?-1:s>e?1:0},"byPairUuid");function m(a,e,s){const t=a.get(e);if(t!==void 0)return t;const n=s();return a.set(e,n),n}f(m,"grouped");function b(a,e){return new Error(`cloud graph root ${a}'s parent index names ${e}, but its pages do not hold it`)}f(b,"misplaced");class y{static{f(this,"RegistryGraph")}head;roots;readPage;sha256Hex;finish;placed=new Map;constructor(e,s,t,n,r){this.head=e,this.roots=s,this.readPage=t,this.sha256Hex=n,this.finish=r}static fromRecords(e,s){const t=new Map;for(const[r,o]of(0,P.recordsByRoot)(e))t.set(r,{refs:A,records:o,loading:null,rootRecord:o.find(i=>i.uuid===r)??null,byUuid:null,byParent:null});const n=f(()=>{throw new Error("a records-shaped graph has no pages to read")},"reader");return new y(null,t,n,s,R)}static fromHead(e,s,t,n=R){const r=new Map;for(const o of e.roots)r.set(o.rootId,{refs:{pages:o.pages,parents:o.parents},records:null,loading:null,rootRecord:null,byUuid:null,byParent:null});return new y(e,r,s,t,n)}rootIds(){return[...this.roots.keys()]}loadedRecords(e){return this.roots.get(e.toLowerCase())?.records??null}async recordsFor(e){const s=e.toLowerCase(),t=this.roots.get(s);if(!t)return[];if(t.records)return t.records;t.loading??=(async()=>{const n=[];await this.scanPages(t.refs.pages,o=>{n.push(...o)});const r=await this.finish((0,g.completeRootsFromRecordsSteps)([s],n));return t.records=r,t.rootRecord=r.find(o=>o.uuid===s)??null,r})();try{return await t.loading}catch(n){throw t.loading=null,n}}async rootRecord(e){const s=e.toLowerCase(),t=this.roots.get(s);if(!t)throw new Error(`cloud graph has no root ${s}`);if(t.rootRecord)return t.rootRecord;const n=t.records?null:t.refs.pages[0],r=n?await this.rows(n):[],o=r.length>0?M(r[0]):null;if(!o||o.uuid!==s||o.parentUUID!==null)throw new Error(`cloud graph root ${s} does not hold its own record`);return t.rootRecord=o,o}async rootRecords(){return Promise.all([...this.roots.keys()].map(e=>this.rootRecord(e)))}async chains(e){const s=await this.holders(e),t=new Map;for(let r=s;r.size>0;){for(const[c,{parent:h}]of r)t.set(c,h);const o=new Map;for(const{root:c,parent:h}of r.values())h!==null&&!t.has(h)&&m(o,c,()=>new Set).add(h);const i=new Map;for(const[c,h]of o){const d=[...h].filter(l=>this.heldAt(l)===void 0);d.length>0&&await this.holdersIn(c,d);for(const l of h){const u=this.heldAt(l);if(!u||u.root!==c)throw b(c,l);i.set(l,u)}}r=i}const n=new Map;for(const r of s.keys()){const o=[r];for(let i=t.get(r);i!==null;i=t.get(i)){if(o.length>t.size)throw new Error(`cloud graph entity ${r} has a parent cycle`);o.push(i)}n.set(r,o)}return n}async records(e){const s=new Map,t=new Map;for(const[n,{root:r,parent:o}]of await this.holders(e)){const i=this.roots.get(r);if(i.records)s.set(n,this.byUuid(i).get(n));else if(o===null)s.set(n,await this.rootRecord(r));else{const c=[o,n],h=(0,w.pageHolding)(i.refs.pages,c);if(h<0)throw b(r,n);m(m(t,r,()=>new Map),h,()=>[]).push(c)}}for(const[n,r]of t){const o=this.roots.get(n).refs.pages,i=[...r.keys()].sort((c,h)=>c-h);await this.scanPages(i.map(c=>o[c]),(c,h)=>{for(const d of r.get(i[h])){const l=_(c,d,(p,S)=>(0,w.compareGraphKeys)(U(p),S)),u=l<0?null:M(c[l]);if(!u||u.uuid!==d[1]||u.parentUUID!==d[0])throw b(n,d[1]);s.set(d[1],u)}})}return s}async children(e){const s=new Map,t=new Map;for(const[n,{root:r}]of await this.holders(e)){const o=this.roots.get(r);o.records?s.set(n,this.byParent(o).get(n)??[]):m(t,r,()=>new Set).add(n)}for(const[n,r]of t){const o=this.roots.get(n).refs.pages,i=new Set;for(const d of r){const[l,u]=(0,w.pagesHoldingChildren)(o,d);for(let p=l;p<=u;p+=1)i.add(p)}const c=new Map([...r].map(d=>[d,[]])),h=[...i].sort((d,l)=>d-l);await this.scanPages(h.map(d=>o[d]),d=>{for(const l of d){const u=U(l)[0];u!==null&&c.get(u)?.push(l)}});for(const[d,l]of c){const u=(0,g.snapshotFromRecords)(l).records;for(const p of u)this.placed.set(p.uuid,{root:n,parent:d});s.set(d,u)}}return s}async rootsOf(e){return new Map([...await this.holders(e)].map(([s,{root:t}])=>[s,t]))}checksum(){return this.head!==null?(0,P.graphHeadChecksum)(this.head,this.sha256Hex):this.sha256Hex((0,g.stableJson)(this.recordsShapedSnapshot()))}recordsShapedSnapshot(){if(this.head!==null)throw new Error("a committed graph head is never flattened to records");const e=[];for(const s of this.roots.values())for(const t of s.records??[])e.push(t);return{schemaVersion:g.ENTITY_CLOUD_SCHEMA_VERSION,kind:"amalgm-entity-registry",records:(0,g.snapshotFromRecords)(e).records}}byUuid(e){return e.byUuid??=new Map(e.records.map(s=>[s.uuid,s]))}byParent(e){if(e.byParent)return e.byParent;const s=new Map;for(const t of e.records){if(t.parentUUID===null)continue;const n=s.get(t.parentUUID);n?n.push(t):s.set(t.parentUUID,[t])}return e.byParent=s}async holders(e){const s=new Map;let t=[];for(const r of new Set(e)){const o=this.heldAt(r);o?s.set(r,o):o===void 0&&t.push(r)}const n=[...this.roots].sort(([,r],[,o])=>+!r.records-+!o.records);for(const[r]of n){if(t.length===0)break;for(const[o,i]of await this.holdersIn(r,t))s.set(o,i);t=t.filter(o=>!s.has(o))}for(const r of t)this.placed.set(r,null);return s}heldAt(e){return this.roots.has(e)?{root:e,parent:null}:this.placed.get(e)}async holdersIn(e,s){const t=new Map;for(const[n,r]of await this.parentsIn(this.roots.get(e),s)){const o={root:e,parent:r};this.placed.set(n,o),t.set(n,o)}return t}async parentsIn(e,s){const t=new Map;if(e.records){const o=this.byUuid(e);for(const i of s){const c=o.get(i);c&&t.set(i,c.parentUUID)}return t}const n=new Map;for(const o of s){const i=(0,w.parentPageHolding)(e.refs.parents,o);i>=0&&m(n,i,()=>[]).push(o)}const r=[...n.keys()].sort((o,i)=>o-i);return await this.scanPages(r.map(o=>e.refs.parents[o]),(o,i)=>{for(const c of n.get(r[i])){const h=_(o,c,G);h>=0&&t.set(c,I(o[h])[1])}}),t}async rows(e){return(0,w.parseGraphPage)(e,await this.readPage(e),this.sha256Hex)}async scanPages(e,s){const t=[];let n=0;try{for(let r=0;r<e.length;r+=1){for(;n<e.length&&t.length<x;)t.push(this.readPage(e[n])),n+=1;s((0,w.parseGraphPage)(e[r],await t.shift(),this.sha256Hex),r)}}finally{await Promise.allSettled(t)}}}exports.RegistryGraph=y;function F(a,e,s,t=R){return N(a)?y.fromHead((0,P.parseGraphHead)(a),e,s,t):y.fromRecords((0,g.parseSnapshot)(a).records,s)}f(F,"registryGraphFromSnapshot");function N(a){const e=/"kind":"([^"]*)"/.exec((0,k.utf8Decode)(a.subarray(0,C)));if(!e)throw new Error("cloud registry snapshot declares no kind");return e[1]===P.GRAPH_HEAD_KIND}f(N,"snapshotIsGraphHead");const C=128;
|