@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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";var T=Object.defineProperty;var r=(t,s)=>T(t,"name",{value:s,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.gitPartBlobs=exports.gitOwnFile=exports.gitOwnRef=exports.GIT_PACKED_REFS=exports.GIT_PARTS=void 0,exports.gitParts=$,exports.gitPartsChanged=C;const f=require("../entities/bytes.js"),_=require("./artifact.js"),h=require("./refs.js"),A=require("./tag.js"),S=require("./state.js"),d=require("./text.js");exports.GIT_PARTS=["refs","stash","staged","operation","settings"];const a=/^(MERGE_(HEAD|MSG|MODE|AUTOSTASH)|AUTO_MERGE|CHERRY_PICK_HEAD|REVERT_HEAD|REBASE_HEAD|SQUASH_MSG|BISECT_[A-Z_]+|(rebase-merge|rebase-apply|sequencer)\/.+)$/,E=/^(config|config\.worktree|hooks(\/.+)?|info\/(exclude|attributes|sparse-checkout)|description)$/,P=/^refs\/(remotes|prefetch)\//,w=/^(HEAD|config\.worktree|info\/sparse-checkout|refs\/(bisect|worktree|rewritten)\/.+)$/,g="logs/refs/stash",u="config";exports.GIT_PACKED_REFS="packed-refs";const m=r(t=>(t==="HEAD"||t.startsWith("refs/"))&&!P.test(t),"gitOwnRef");exports.gitOwnRef=m;const G=r(t=>t===g||a.test(t)||E.test(t),"gitOwnFile");exports.gitOwnFile=G;const p=r(t=>(0,exports.gitOwnRef)(t)&&t!=="refs/stash","isRef");function R(t){const s=(0,S.gitSelfHeld)(t.home)?`${t.home.path}/`:null,n=new Map;for(const e of t.files)e.oid!==null&&(s===null?n.set(e.path,e):e.path.startsWith(s)?n.set(e.path.slice(s.length),e):!e.path.startsWith("worktrees/")&&!w.test(e.path)&&!a.test(e.path)&&n.set(e.path,e));return n}r(R,"view");const I=r(t=>[...R(t)].filter(([s])=>s===exports.GIT_PACKED_REFS||s===g||s===u).map(([,s])=>s.oid),"gitPartBlobs");exports.gitPartBlobs=I;const l=r((t,s)=>[...t].filter(([n])=>s(n)).sort(([n],[e])=>(0,d.compareGitText)(n,e)).map(([n,e])=>`${n} ${e.mode} ${e.oid}
|
|
2
|
+
`).join(""),"lines");function O(t,s,n){if([...t.keys()].some(o=>o.startsWith("reftable/")))return l(t,o=>o.startsWith("reftable/"));const e=new Map,c=t.get(exports.GIT_PACKED_REFS);for(const[o,i]of c?(0,h.gitPackedRefs)(s(c)):[])p(o)&&e.set(o,(0,_.gitBlobId)((0,f.utf8Encode)(`${i}
|
|
3
|
+
`),n));for(const[o,i]of t)p(o)&&e.set(o,i.oid);return[...e].sort(([o],[i])=>(0,d.compareGitText)(o,i)).map(([o,i])=>`${o} ${i}
|
|
4
|
+
`).join("")}r(O,"refs");function b(t,s){const n=t.get(g);return n===void 0?"":s(n).split(`
|
|
5
|
+
`).filter(e=>e!=="").map(e=>`${e.split(" ",2)[1]}
|
|
6
|
+
`).join("")}r(b,"stash");function D(t,s,n){const e=t.get(u),c=new Map(t);return e!==void 0&&c.set(u,{...e,oid:(0,_.gitBlobId)((0,f.utf8Encode)((0,A.gitConfigUntagged)(s(e))),n)}),l(c,o=>E.test(o))}r(D,"settings");function $(t,s,n){const e=R(t),c=r(i=>(0,f.utf8Decode)(s(i.oid)),"text"),o={refs:O(e,c,n),stash:b(e,c),staged:t.index?.meaning??"",operation:l(e,i=>a.test(i)),settings:D(e,c,n)};return exports.GIT_PARTS.map(i=>n((0,f.utf8Encode)(`amalgm.git-part.v1 ${i}
|
|
7
|
+
${o[i]}`))).join(".")}r($,"gitParts");function C(t,s){const n=t.split("."),e=s.split(".");return exports.GIT_PARTS.filter((c,o)=>n[o]!==e[o])}r(C,"gitPartsChanged");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var u=Object.defineProperty;var l=(s,e)=>u(s,"name",{value:e,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.gitPlacements=a;const c=require("./holds.js"),i=l((s,e)=>s===null?e===null:e!==null&&s.oid===e.oid&&s.fileMode===e.fileMode,"samePlace");function a(s,e){const n=[];for(const t of new Set([...s.keys(),...e.keys()])){const o=(0,c.gitPlace)(e.get(t));i((0,c.gitPlace)(s.get(t)),o)||n.push({path:t,place:o})}return n}l(a,"gitPlacements");
|
package/dist-cjs/git/plan.js
CHANGED
|
@@ -1,100 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* What a receiver writes to make its Git directory the target's, decided
|
|
4
|
-
* here so every host applies the same rule. The host performs the steps in
|
|
5
|
-
* this order, after installing the target's objects so nothing written names
|
|
6
|
-
* a missing one:
|
|
7
|
-
*
|
|
8
|
-
* 0. `drop`, before any object installs: the storage a state in byte form
|
|
9
|
-
* left here, when the target travels as Git. Its pack is whole (its
|
|
10
|
-
* parent named no roots), and Git, installing it, would stop at an object
|
|
11
|
-
* it cannot read that stands under the same ID;
|
|
12
|
-
* 1. `clear`: entries standing where the target needs the other kind (a
|
|
13
|
-
* folder for a file or back);
|
|
14
|
-
* 2. `writes`: folders, then files, HEAD last;
|
|
15
|
-
* 3. `index`: the index files, `index` itself last, only when the index
|
|
16
|
-
* means something else;
|
|
17
|
-
* 4. `removals`: everything else the target lacks.
|
|
18
|
-
*
|
|
19
|
-
* HEAD and `index` are the worktree's own under a self-held home (state.ts).
|
|
20
|
-
*
|
|
21
|
-
* A target in byte form is reached file for file, storage included, from
|
|
22
|
-
* the state here read in byte form; its receiver installs no objects.
|
|
23
|
-
*
|
|
24
|
-
* Every file is written the way Git writes one, under `<path>.lock`, so a
|
|
25
|
-
* Git command running on the receiver meets this writer as it would meet
|
|
26
|
-
* another Git command. The target replaces what stands: a record whose basis
|
|
27
|
-
* is not the state here is played onto it first (play.ts), and the played
|
|
28
|
-
* state is the target.
|
|
29
|
-
*
|
|
30
|
-
* No state lists a lock (state.ts), so no plan writes, clears or removes
|
|
31
|
-
* one: a lock standing here is this machine's, and its writer meets it at
|
|
32
|
-
* the file it guards, as one Git command meets another's.
|
|
33
|
-
*/
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.gitApplyPlan = gitApplyPlan;
|
|
36
|
-
const validate_js_1 = require("../contracts/validate.js");
|
|
37
|
-
const state_js_1 = require("./state.js");
|
|
38
|
-
const text_js_1 = require("./text.js");
|
|
39
|
-
const isFolder = (file) => file.mode === '040000';
|
|
40
|
-
const same = (left, right) => left !== undefined && left.mode === right.mode && left.oid === right.oid;
|
|
41
|
-
const deepestFirst = (left, right) => (0, text_js_1.compareGitText)(right.path, left.path);
|
|
42
|
-
/** The steps from the state a Git directory holds to the target. A receiver
|
|
43
|
-
* without the repository first creates it, empty, in the target's format. */
|
|
44
|
-
function gitApplyPlan(here, target) {
|
|
45
|
-
if (here.format !== target.format)
|
|
46
|
-
return (0, validate_js_1.fail)(`a ${here.format} repository cannot hold a ${target.format} state`);
|
|
47
|
-
const bytes = (0, state_js_1.gitBytesForm)(target);
|
|
48
|
-
if (bytes && !(0, state_js_1.gitBytesForm)(here))
|
|
49
|
-
return (0, validate_js_1.fail)('a state in byte form is reached from the state here read in byte form');
|
|
50
|
-
const storage = (file) => !bytes && (0, state_js_1.isGitStoragePath)(file.path, target.home);
|
|
51
|
-
const drop = here.files.filter(file => storage(file) && !isFolder(file)).sort(deepestFirst);
|
|
52
|
-
const current = { ...here, files: here.files.filter(file => !storage(file)) };
|
|
53
|
-
const wanted = new Map(target.files.map(file => [file.path, file]));
|
|
54
|
-
const clashes = new Set(current.files
|
|
55
|
-
.filter(file => wanted.has(file.path) && isFolder(wanted.get(file.path)) !== isFolder(file))
|
|
56
|
-
.map(file => file.path));
|
|
57
|
-
const clashed = (path) => {
|
|
58
|
-
for (let at = path.length; at > 0; at = path.lastIndexOf('/', at - 1))
|
|
59
|
-
if (clashes.has(path.slice(0, at)))
|
|
60
|
-
return true;
|
|
61
|
-
return false;
|
|
62
|
-
};
|
|
63
|
-
const clear = [], removals = [];
|
|
64
|
-
const standing = new Map();
|
|
65
|
-
for (const file of current.files) {
|
|
66
|
-
if (clashed(file.path))
|
|
67
|
-
clear.push(file);
|
|
68
|
-
else if (wanted.has(file.path))
|
|
69
|
-
standing.set(file.path, file);
|
|
70
|
-
else
|
|
71
|
-
removals.push(file);
|
|
72
|
-
}
|
|
73
|
-
const changed = target.files.filter(file => !same(standing.get(file.path), file));
|
|
74
|
-
const isHead = (file) => (0, state_js_1.gitOwnPath)(file.path) === 'HEAD';
|
|
75
|
-
const writes = [
|
|
76
|
-
...changed.filter(isFolder),
|
|
77
|
-
...changed.filter(file => !isFolder(file) && !isHead(file)),
|
|
78
|
-
...changed.filter(isHead),
|
|
79
|
-
];
|
|
80
|
-
const meaning = (state) => state.index?.meaning ?? null;
|
|
81
|
-
const index = [];
|
|
82
|
-
if (meaning(current) !== meaning(target)) {
|
|
83
|
-
const held = new Map(current.index?.files.map(file => [file.path, file]));
|
|
84
|
-
const kept = new Set(target.index?.files.map(file => file.path));
|
|
85
|
-
for (const file of target.index?.files ?? [])
|
|
86
|
-
if (!same(held.get(file.path), file))
|
|
87
|
-
index.push(file);
|
|
88
|
-
const last = (file) => Number((0, state_js_1.gitOwnPath)(file.path) === 'index');
|
|
89
|
-
index.sort((left, right) => last(left) - last(right));
|
|
90
|
-
removals.push(...current.index?.files.filter(file => !kept.has(file.path)) ?? []);
|
|
91
|
-
}
|
|
92
|
-
return (0, validate_js_1.pass)({
|
|
93
|
-
drop,
|
|
94
|
-
clear: clear.sort(deepestFirst),
|
|
95
|
-
writes,
|
|
96
|
-
index,
|
|
97
|
-
removals: removals.sort(deepestFirst),
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
//# sourceMappingURL=plan.js.map
|
|
1
|
+
"use strict";var q=Object.defineProperty;var a=(e,s)=>q(e,"name",{value:s,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.gitApplyPlan=S;const h=require("../contracts/validate.js"),r=require("./state.js"),A=require("./text.js"),l=a(e=>e.mode==="040000","isFolder"),b=a((e,s)=>e!==void 0&&e.mode===s.mode&&e.oid===s.oid,"same"),m=a((e,s)=>(0,A.compareGitText)(s.path,e.path),"deepestFirst");function S(e,s){if(e.format!==s.format)return(0,h.fail)(`a ${e.format} repository cannot hold a ${s.format} state`);const u=(0,r.gitBytesForm)(s);if(u&&!(0,r.gitBytesForm)(e))return(0,h.fail)("a state in byte form is reached from the state here read in byte form");const x=a(t=>!u&&(0,r.isGitStoragePath)(t.path,s.home),"storage"),j=e.files.filter(t=>x(t)&&!l(t)).sort(m),i={...e,files:e.files.filter(t=>!x(t))},c=new Map(s.files.map(t=>[t.path,t])),v=new Set(i.files.filter(t=>c.has(t.path)&&l(c.get(t.path))!==l(t)).map(t=>t.path)),F=a(t=>{for(let o=t.length;o>0;o=t.lastIndexOf("/",o-1))if(v.has(t.slice(0,o)))return!0;return!1},"clashed"),w=[],f=[],y=new Map;for(const t of i.files)F(t.path)?w.push(t):c.has(t.path)?y.set(t.path,t):f.push(t);const p=s.files.filter(t=>!b(y.get(t.path),t)),_=a(t=>(0,r.gitOwnPath)(t.path)==="HEAD","isHead"),M=[...p.filter(l),...p.filter(t=>!l(t)&&!_(t)),...p.filter(_)],g=a(t=>t.index?.meaning??null,"meaning"),d=[];if(g(i)!==g(s)){const t=new Map(i.index?.files.map(n=>[n.path,n])),o=new Set(s.index?.files.map(n=>n.path));for(const n of s.index?.files??[])b(t.get(n.path),n)||d.push(n);const P=a(n=>+((0,r.gitOwnPath)(n.path)==="index"),"last");d.sort((n,O)=>P(n)-P(O)),f.push(...i.index?.files.filter(n=>!o.has(n.path))??[])}return(0,h.pass)({drop:j,clear:w.sort(m),writes:M,index:d,removals:f.sort(m)})}a(S,"gitApplyPlan");
|
package/dist-cjs/git/play.js
CHANGED
|
@@ -1,323 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* A record states the Git directory its sender's change was made from (V,
|
|
6
|
-
* its artifact's basis) and what it became (Y). The state here is the line
|
|
7
|
-
* before it (L). When L is V the record's state replaces it. Otherwise the
|
|
8
|
-
* record's change is played onto L, and every machine that plays the same
|
|
9
|
-
* records in the same order makes the same state, since nothing here names
|
|
10
|
-
* the machine playing:
|
|
11
|
-
*
|
|
12
|
-
* - Every ref and every other Git-directory file is the record's when the
|
|
13
|
-
* record changed it from V, else L's: a record moves what it moved, and
|
|
14
|
-
* what it left alone stays as the line holds it. A ref the record removed
|
|
15
|
-
* stays removed.
|
|
16
|
-
* - A branch the line moved too is never rolled back. It follows the record
|
|
17
|
-
* only where the record's commit was built on the line's, as Git's own
|
|
18
|
-
* fast-forward. A record that diverged (made offline, or with no turn:
|
|
19
|
-
* docs/git-turns.md) leaves the line's branch where it stands, and its
|
|
20
|
-
* commits are kept beside it on a branch of their own,
|
|
21
|
-
* `amalgm/<branch>-<id>` (`GitPlayed.aside`). The next record made on those
|
|
22
|
-
* commits moves that same branch on, so one computer's offline work is one
|
|
23
|
-
* branch however many commits it holds.
|
|
24
|
-
* - A reflog keeps L's lines less those the record removed, then the
|
|
25
|
-
* record's new ones. When its ref ends where none of those lines put it,
|
|
26
|
-
* one more line moves it there, so `@{0}` names where the ref stands. The
|
|
27
|
-
* stash is such a reflog: a stack whose top is `refs/stash`.
|
|
28
|
-
* - The index follows HEAD. What is staged is the index read against the
|
|
29
|
-
* commit HEAD names, so a record claims the index when it changed either
|
|
30
|
-
* half: the index's meaning, or the commit HEAD names (a switch to another
|
|
31
|
-
* name for the same commit moves neither). The claimed index, the
|
|
32
|
-
* record's, else L's, is carried from its own commit to the commit HEAD
|
|
33
|
-
* ends at: each path it stages keeps its entry, and every other path takes
|
|
34
|
-
* that commit's (`GitPlayGit.carryIndex`).
|
|
35
|
-
*
|
|
36
|
-
* Where the line has no answer the record replaces L (`gitPlayable`): refs
|
|
37
|
-
* kept in reftable, a linked worktree, whose branches its main checkout's
|
|
38
|
-
* state holds, a checkout that shares another's Git directory, sides that
|
|
39
|
-
* differ in format, home or borrowed storage, and any side in byte form,
|
|
40
|
-
* whose files Git refused (state.ts).
|
|
41
|
-
* Everything Git computes is the host's, through `GitPlayGit`.
|
|
42
|
-
*/
|
|
43
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
-
exports.gitOwnChange = gitOwnChange;
|
|
45
|
-
exports.gitPlayable = gitPlayable;
|
|
46
|
-
exports.gitPlayRecord = gitPlayRecord;
|
|
47
|
-
const bytes_js_1 = require("../entities/bytes.js");
|
|
48
|
-
const alternates_js_1 = require("./alternates.js");
|
|
49
|
-
const artifact_js_1 = require("./artifact.js");
|
|
50
|
-
const refs_js_1 = require("./refs.js");
|
|
51
|
-
const state_js_1 = require("./state.js");
|
|
52
|
-
const text_js_1 = require("./text.js");
|
|
53
|
-
/** The artifact of a repository change this machine recorded, when that
|
|
54
|
-
* change is one the line has to play: the record made the Git directory or
|
|
55
|
-
* changed it (`create`, `retype`, `content`) and leaves it active. A record
|
|
56
|
-
* that only renamed, moved, trashed or restored the repository names an
|
|
57
|
-
* artifact its line already holds, and plays as nothing.
|
|
58
|
-
*
|
|
59
|
-
* What a machine shows is its line with each of its own records the line has
|
|
60
|
-
* not reached played on top, oldest first, each from its own basis: its own
|
|
61
|
-
* work, never the files Apply wrote, is what it carries. */
|
|
62
|
-
function gitOwnChange(change) {
|
|
63
|
-
const changed = change.facets.some(facet => facet === 'create' || facet === 'retype' || facet === 'content');
|
|
64
|
-
return changed && change.result.status === 'active' ? change.result.transportVersion : null;
|
|
65
|
-
}
|
|
66
|
-
/** Whether the record can be played onto the line; otherwise it replaces it. */
|
|
67
|
-
function gitPlayable({ line, basis, record }) {
|
|
68
|
-
const borrowed = (state) => state.files.find(file => file.path === alternates_js_1.GIT_ALTERNATES_PATH)?.oid ?? null;
|
|
69
|
-
const reftable = (state) => state.files.some(file => file.path === 'reftable');
|
|
70
|
-
return line.format === record.format && (basis === null || basis.format === record.format)
|
|
71
|
-
&& !(0, state_js_1.gitSharesObjects)(line) && !(0, state_js_1.gitSelfHeld)(line.home) && !(0, state_js_1.gitSharesGitDir)(line.home)
|
|
72
|
-
&& line.home?.entity === record.home?.entity && line.home?.path === record.home?.path
|
|
73
|
-
&& borrowed(line) === borrowed(record)
|
|
74
|
-
&& ![line, record, ...basis ? [basis] : []].some(side => reftable(side) || (0, state_js_1.gitBytesForm)(side));
|
|
75
|
-
}
|
|
76
|
-
const FOLDER = '040000';
|
|
77
|
-
const byPath = (files) => new Map(files.map(file => [file.path, file]));
|
|
78
|
-
const same = (left, right) => left === undefined ? right === undefined : right !== undefined && left.mode === right.mode && left.oid === right.oid;
|
|
79
|
-
const parents = (path) => {
|
|
80
|
-
const found = [];
|
|
81
|
-
for (let at = path.indexOf('/'); at > 0; at = path.indexOf('/', at + 1))
|
|
82
|
-
found.push(path.slice(0, at));
|
|
83
|
-
return found;
|
|
84
|
-
};
|
|
85
|
-
/** A tree again, sorted: where an entry stands beneath a file, the record's
|
|
86
|
-
* whole subtree there replaces both sides', and every parent folder stands. */
|
|
87
|
-
function asTree(played, record) {
|
|
88
|
-
const clashes = new Set();
|
|
89
|
-
for (const path of played.keys()) {
|
|
90
|
-
const clash = parents(path).find(parent => played.has(parent) && played.get(parent).mode !== FOLDER);
|
|
91
|
-
if (clash !== undefined)
|
|
92
|
-
clashes.add(clash);
|
|
93
|
-
}
|
|
94
|
-
const clashed = (path) => clashes.has(path) || parents(path).some(parent => clashes.has(parent));
|
|
95
|
-
if (clashes.size > 0) {
|
|
96
|
-
for (const path of [...played.keys()])
|
|
97
|
-
if (clashed(path))
|
|
98
|
-
played.delete(path);
|
|
99
|
-
for (const [path, file] of record)
|
|
100
|
-
if (clashed(path))
|
|
101
|
-
played.set(path, file);
|
|
102
|
-
}
|
|
103
|
-
for (const path of [...played.keys()]) {
|
|
104
|
-
for (const parent of parents(path))
|
|
105
|
-
if (!played.has(parent))
|
|
106
|
-
played.set(parent, { path: parent, mode: FOLDER, oid: null });
|
|
107
|
-
}
|
|
108
|
-
return [...played.values()].sort((left, right) => (0, text_js_1.compareGitText)(left.path, right.path));
|
|
109
|
-
}
|
|
110
|
-
const SIDES = ['line', 'basis', 'record'];
|
|
111
|
-
const isLooseRef = (file) => file.mode !== FOLDER
|
|
112
|
-
&& (file.path === 'HEAD' || file.path.startsWith('refs/'));
|
|
113
|
-
const isRefFile = (file) => isLooseRef(file) || file.path === 'packed-refs';
|
|
114
|
-
const isReflogPath = (path) => path.startsWith('logs/');
|
|
115
|
-
const STASH = 'refs/stash';
|
|
116
|
-
const BRANCHES = 'refs/heads/';
|
|
117
|
-
/** Where aside branches stand, and the least of a commit's ID one is named by. */
|
|
118
|
-
const ASIDE = `${BRANCHES}amalgm`;
|
|
119
|
-
const ASIDE_ID = 7;
|
|
120
|
-
const ASIDE_NAMED = /^[0-9a-f]{7,}$/;
|
|
121
|
-
const beneath = (path, folder) => path.startsWith(`${folder}/`);
|
|
122
|
-
/** The record played onto the line. `bytes` reads any blob a side's files
|
|
123
|
-
* name. */
|
|
124
|
-
async function gitPlayRecord(sides, bytes, git, sha256) {
|
|
125
|
-
const empty = { format: sides.record.format, home: sides.record.home, files: [], index: null };
|
|
126
|
-
const states = { line: sides.line, basis: sides.basis ?? empty, record: sides.record };
|
|
127
|
-
const files = {
|
|
128
|
-
line: byPath(states.line.files), basis: byPath(states.basis.files), record: byPath(states.record.files),
|
|
129
|
-
};
|
|
130
|
-
const made = new Map();
|
|
131
|
-
const make = (path, text) => {
|
|
132
|
-
const content = (0, bytes_js_1.utf8Encode)(text), oid = (0, artifact_js_1.gitBlobId)(content, sha256);
|
|
133
|
-
made.set(oid, content);
|
|
134
|
-
return { path, mode: '100644', oid };
|
|
135
|
-
};
|
|
136
|
-
const read = async (file) => file?.oid ? (0, bytes_js_1.utf8Decode)(made.get(file.oid) ?? await bytes(file.oid)) : '';
|
|
137
|
-
const packed = new Map();
|
|
138
|
-
const packedOf = (side) => {
|
|
139
|
-
if (!packed.has(side))
|
|
140
|
-
packed.set(side, read(files[side].get('packed-refs')).then(refs_js_1.gitPackedRefs));
|
|
141
|
-
return packed.get(side);
|
|
142
|
-
};
|
|
143
|
-
const value = async (side, name) => {
|
|
144
|
-
const loose = files[side].get(name);
|
|
145
|
-
if (loose !== undefined && isLooseRef(loose))
|
|
146
|
-
return (0, refs_js_1.gitLooseRef)(await read(loose));
|
|
147
|
-
return name === 'HEAD' ? null : (await packedOf(side)).get(name) ?? null;
|
|
148
|
-
};
|
|
149
|
-
/** Whether the record changed a file from its basis. */
|
|
150
|
-
const recordChanged = (path) => !same(files.basis.get(path), files.record.get(path));
|
|
151
|
-
// Every file: the record's when it changed it, else the line's.
|
|
152
|
-
const played = new Map();
|
|
153
|
-
for (const path of new Set([...files.line.keys(), ...files.basis.keys(), ...files.record.keys()])) {
|
|
154
|
-
const file = recordChanged(path) ? files.record.get(path) : files.line.get(path);
|
|
155
|
-
if (file !== undefined)
|
|
156
|
-
played.set(path, file);
|
|
157
|
-
}
|
|
158
|
-
// Every ref some side holds differently: the loose files that differ, and
|
|
159
|
-
// every packed ref when packed-refs does.
|
|
160
|
-
const names = new Set();
|
|
161
|
-
for (const path of new Set(SIDES.flatMap(side => [...files[side].keys()]))) {
|
|
162
|
-
const [line, basis, record] = SIDES.map(side => files[side].get(path));
|
|
163
|
-
if (same(line, basis) && same(basis, record))
|
|
164
|
-
continue;
|
|
165
|
-
if (path === 'packed-refs')
|
|
166
|
-
for (const side of SIDES)
|
|
167
|
-
for (const name of (await packedOf(side)).keys())
|
|
168
|
-
names.add(name);
|
|
169
|
-
else if ([line, basis, record].some(file => file !== undefined && isLooseRef(file)))
|
|
170
|
-
names.add(path);
|
|
171
|
-
}
|
|
172
|
-
// A reflog: the line's lines less those the record removed, then its new
|
|
173
|
-
// ones; the stash's top is its ref.
|
|
174
|
-
const playLog = async (path) => {
|
|
175
|
-
const [line, basis, record] = SIDES.map(side => files[side].get(path));
|
|
176
|
-
if ([line, basis, record].some(file => file?.mode === FOLDER))
|
|
177
|
-
return read(line);
|
|
178
|
-
return (0, refs_js_1.gitReflogPlay)(await read(basis), await read(record), await read(line));
|
|
179
|
-
};
|
|
180
|
-
const stashLog = `logs/${STASH}`;
|
|
181
|
-
let stash = null;
|
|
182
|
-
if (recordChanged(stashLog)) {
|
|
183
|
-
stash = (0, refs_js_1.gitChainReflog)(await playLog(stashLog));
|
|
184
|
-
if (stash === '')
|
|
185
|
-
played.delete(stashLog);
|
|
186
|
-
else
|
|
187
|
-
played.set(stashLog, make(stashLog, stash));
|
|
188
|
-
}
|
|
189
|
-
const finals = new Map();
|
|
190
|
-
const diverged = [];
|
|
191
|
-
for (const name of [...names].sort(text_js_1.compareGitText)) {
|
|
192
|
-
const [line, basis, record] = await Promise.all(SIDES.map(side => value(side, name)));
|
|
193
|
-
let final = basis !== record ? record : line;
|
|
194
|
-
if (name === STASH) {
|
|
195
|
-
if (stash === null)
|
|
196
|
-
continue;
|
|
197
|
-
final = (0, refs_js_1.gitReflogTop)(stash);
|
|
198
|
-
}
|
|
199
|
-
else if (name.startsWith(BRANCHES) && line !== null && line !== basis && final !== line
|
|
200
|
-
&& [line, record].every(oid => oid === null || (0, state_js_1.isGitOid)(sides.record.format, oid))) {
|
|
201
|
-
// Both sides moved this branch: the line's stands unless the record's
|
|
202
|
-
// was built on it.
|
|
203
|
-
if (record === null || !await git.builtOn(record, line)) {
|
|
204
|
-
final = line;
|
|
205
|
-
if (record !== null && !await git.builtOn(line, record))
|
|
206
|
-
diverged.push({ name, basis, record });
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
if (final !== line)
|
|
210
|
-
finals.set(name, final);
|
|
211
|
-
}
|
|
212
|
-
// Each diverged commit goes to the aside branch that stood at the commit it
|
|
213
|
-
// was made from, else to a new one named by as much of its ID as leaves the
|
|
214
|
-
// name free. Where no name can stand, since Git holds no branch beneath
|
|
215
|
-
// another, the commit is kept by its branch's reflog alone.
|
|
216
|
-
const aside = [];
|
|
217
|
-
if (diverged.length > 0) {
|
|
218
|
-
const held = new Map();
|
|
219
|
-
for (const name of new Set([...files.line.keys(), ...(await packedOf('line')).keys(), ...finals.keys()])) {
|
|
220
|
-
if (name !== ASIDE && !beneath(name, ASIDE))
|
|
221
|
-
continue;
|
|
222
|
-
const oid = finals.has(name) ? finals.get(name) : await value('line', name);
|
|
223
|
-
if (oid !== null)
|
|
224
|
-
held.set(name, oid);
|
|
225
|
-
}
|
|
226
|
-
const free = (name, commit) => (held.get(name) ?? commit) === commit
|
|
227
|
-
&& ![...held.keys()].some(other => beneath(name, other) || beneath(other, name));
|
|
228
|
-
for (const { name, basis, record } of diverged) {
|
|
229
|
-
const stem = `${ASIDE}/${name.slice(BRANCHES.length)}-`;
|
|
230
|
-
let branch = [...held.keys()].sort(text_js_1.compareGitText).find(other => held.get(other) === basis
|
|
231
|
-
&& other.startsWith(stem) && ASIDE_NAMED.test(other.slice(stem.length)));
|
|
232
|
-
for (let size = ASIDE_ID; branch === undefined && size <= record.length; size += 1) {
|
|
233
|
-
if (free(stem + record.slice(0, size), record))
|
|
234
|
-
branch = stem + record.slice(0, size);
|
|
235
|
-
}
|
|
236
|
-
if (branch === undefined)
|
|
237
|
-
continue;
|
|
238
|
-
if (await value('line', branch) !== record)
|
|
239
|
-
finals.set(branch, record);
|
|
240
|
-
held.set(branch, record);
|
|
241
|
-
aside.push({ branch, from: name, commit: record });
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
// The line's ref files, with each ref that ends elsewhere written loose or
|
|
245
|
-
// dropped.
|
|
246
|
-
for (const [path, file] of [...played])
|
|
247
|
-
if (isRefFile(file))
|
|
248
|
-
played.delete(path);
|
|
249
|
-
for (const file of states.line.files)
|
|
250
|
-
if (isRefFile(file))
|
|
251
|
-
played.set(file.path, file);
|
|
252
|
-
const dropped = new Set();
|
|
253
|
-
for (const [name, target] of finals) {
|
|
254
|
-
if (target !== null)
|
|
255
|
-
played.set(name, make(name, `${target}\n`));
|
|
256
|
-
else {
|
|
257
|
-
if (played.has(name) && isLooseRef(played.get(name)))
|
|
258
|
-
played.delete(name);
|
|
259
|
-
dropped.add(name);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
const packedRefs = files.line.get('packed-refs');
|
|
263
|
-
if (dropped.size > 0 && packedRefs !== undefined) {
|
|
264
|
-
const text = await read(packedRefs), rest = (0, refs_js_1.gitDropPackedRefs)(text, dropped);
|
|
265
|
-
if (rest !== text)
|
|
266
|
-
played.set('packed-refs', make('packed-refs', rest));
|
|
267
|
-
}
|
|
268
|
-
const final = (name) => finals.has(name) ? Promise.resolve(finals.get(name)) : value('line', name);
|
|
269
|
-
const commitOf = async (head, valueOf) => head?.startsWith('ref: ') ? valueOf(head.slice('ref: '.length)) : head;
|
|
270
|
-
const headCommit = await commitOf(await final('HEAD'), final);
|
|
271
|
-
// Every other reflog the record changed, or whose ref the play moved.
|
|
272
|
-
const logs = new Set();
|
|
273
|
-
for (const side of SIDES)
|
|
274
|
-
for (const path of files[side].keys())
|
|
275
|
-
if (isReflogPath(path) && path !== stashLog)
|
|
276
|
-
logs.add(path);
|
|
277
|
-
for (const name of finals.keys())
|
|
278
|
-
if (name !== STASH)
|
|
279
|
-
logs.add(`logs/${name}`);
|
|
280
|
-
if (headCommit !== await commitOf(await value('line', 'HEAD'), name => value('line', name)))
|
|
281
|
-
logs.add('logs/HEAD');
|
|
282
|
-
for (const path of [...logs].sort(text_js_1.compareGitText)) {
|
|
283
|
-
const name = path.slice('logs/'.length);
|
|
284
|
-
const ends = name === 'HEAD' ? headCommit : await final(name);
|
|
285
|
-
const changed = recordChanged(path);
|
|
286
|
-
if (!changed && (ends === null || name !== 'HEAD' && !finals.has(name) || !files.line.has(path)))
|
|
287
|
-
continue;
|
|
288
|
-
let text = changed ? await playLog(path) : await read(files.line.get(path));
|
|
289
|
-
const top = (0, refs_js_1.gitReflogTop)(text);
|
|
290
|
-
if (ends !== null && top !== null && top !== ends && (0, state_js_1.isGitOid)(sides.record.format, ends)) {
|
|
291
|
-
const last = text.trimEnd().split('\n').at(-1);
|
|
292
|
-
text += `${top} ${ends}${last.slice(last.indexOf(' ', last.indexOf(' ') + 1))}\n`;
|
|
293
|
-
}
|
|
294
|
-
if (text === '')
|
|
295
|
-
played.delete(path);
|
|
296
|
-
else
|
|
297
|
-
played.set(path, make(path, text));
|
|
298
|
-
}
|
|
299
|
-
// The index follows HEAD: the record claims it when it changed the index
|
|
300
|
-
// or the commit HEAD names.
|
|
301
|
-
const headOf = (side) => value(side, 'HEAD').then(head => commitOf(head, name => value(side, name)));
|
|
302
|
-
const recordHead = await headOf('record');
|
|
303
|
-
const claims = sides.record.index?.meaning !== sides.basis?.index?.meaning
|
|
304
|
-
|| recordHead !== (sides.basis === null ? null : await headOf('basis'));
|
|
305
|
-
const [chosen, from] = claims
|
|
306
|
-
? [sides.record.index, recordHead]
|
|
307
|
-
: [sides.line.index, await headOf('line')];
|
|
308
|
-
let index = chosen;
|
|
309
|
-
if (chosen?.files.length === 1 && from !== null && headCommit !== null && from !== headCommit) {
|
|
310
|
-
const carried = await git.carryIndex(await bytes(chosen.files[0].oid), from, headCommit);
|
|
311
|
-
if (carried !== null) {
|
|
312
|
-
const content = carried.bytes, oid = (0, artifact_js_1.gitBlobId)(content, sha256);
|
|
313
|
-
made.set(oid, content);
|
|
314
|
-
index = { meaning: carried.meaning, files: [{ path: 'index', mode: '100644', oid }] };
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
return {
|
|
318
|
-
state: { format: sides.record.format, home: sides.record.home, files: asTree(played, files.record), index },
|
|
319
|
-
made,
|
|
320
|
-
aside,
|
|
321
|
-
};
|
|
322
|
-
}
|
|
323
|
-
//# sourceMappingURL=play.js.map
|
|
1
|
+
"use strict";var ae=Object.defineProperty;var r=(t,i)=>ae(t,"name",{value:i,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.gitOwnChange=se,exports.gitLineChanges=re,exports.gitPlayable=fe,exports.gitPlayRecord=ge;const te=require("../entities/bytes.js"),ce=require("./alternates.js"),ne=require("./artifact.js"),b=require("./refs.js"),E=require("./state.js"),H=require("./text.js");function se(t){return t.facets.some(c=>c==="create"||c==="retype"||c==="content")&&t.result.status==="active"?t.result.transportVersion:null}r(se,"gitOwnChange");function re(t){let i=[],c=!1;for(const g of t){if(g.result.type!=="repo.git"){i=[],c=!0;continue}const d=se(g);d!==null&&i.push(d)}return{reached:i,ended:c}}r(re,"gitLineChanges");function fe({line:t,basis:i,record:c}){const g=r(l=>l.files.find(f=>f.path===ce.GIT_ALTERNATES_PATH)?.oid??null,"borrowed"),d=r(l=>l.files.some(f=>f.path==="reftable"),"reftable");return t.format===c.format&&(i===null||i.format===c.format)&&!(0,E.gitSharesObjects)(t)&&!(0,E.gitSelfHeld)(t.home)&&!(0,E.gitSharesGitDir)(t.home)&&t.home?.entity===c.home?.entity&&t.home?.path===c.home?.path&&g(t)===g(c)&&![t,c,...i?[i]:[]].some(l=>d(l)||(0,E.gitBytesForm)(l))}r(fe,"gitPlayable");const P="040000",z=r(t=>new Map(t.map(i=>[i.path,i])),"byPath"),F=r((t,i)=>t===void 0?i===void 0:i!==void 0&&t.mode===i.mode&&t.oid===i.oid,"same"),N=r(t=>{const i=[];for(let c=t.indexOf("/");c>0;c=t.indexOf("/",c+1))i.push(t.slice(0,c));return i},"parents");function le(t,i){const c=new Set;for(const d of t.keys()){const l=N(d).find(f=>t.has(f)&&t.get(f).mode!==P);l!==void 0&&c.add(l)}const g=r(d=>c.has(d)||N(d).some(l=>c.has(l)),"clashed");if(c.size>0){for(const d of[...t.keys()])g(d)&&t.delete(d);for(const[d,l]of i)g(d)&&t.set(d,l)}for(const d of[...t.keys()])for(const l of N(d))t.has(l)||t.set(l,{path:l,mode:P,oid:null});return[...t.values()].sort((d,l)=>(0,H.compareGitText)(d.path,l.path))}r(le,"asTree");const S=["line","basis","record"],T=r(t=>t.mode!==P&&(t.path==="HEAD"||t.path.startsWith("refs/")),"isLooseRef"),oe=r(t=>T(t)||t.path==="packed-refs","isRefFile"),de=r(t=>t.startsWith("logs/"),"isReflogPath"),V="refs/stash",J="refs/heads/",K=`${J}amalgm`,ue=7,he=/^[0-9a-f]{7,}$/,Q=r((t,i)=>t.startsWith(`${i}/`),"beneath");async function ge(t,i,c,g){const d={format:t.record.format,home:t.record.home,files:[],index:null},l={line:t.line,basis:t.basis??d,record:t.record},f={line:z(l.line.files),basis:z(l.basis.files),record:z(l.record.files)},A=new Map,O=r((e,n)=>{const s=(0,te.utf8Encode)(n),a=(0,ne.gitBlobId)(s,g);return A.set(a,s),{path:e,mode:"100644",oid:a}},"make"),w=r(async e=>e?.oid?(0,te.utf8Decode)(A.get(e.oid)??await i(e.oid)):"","read"),$=new Map,I=r(e=>($.has(e)||$.set(e,w(f[e].get("packed-refs")).then(b.gitPackedRefs)),$.get(e)),"packedOf"),y=r(async(e,n)=>{const s=f[e].get(n);return s!==void 0&&T(s)?(0,b.gitLooseRef)(await w(s)):n==="HEAD"?null:(await I(e)).get(n)??null},"value"),M=r(e=>!F(f.basis.get(e),f.record.get(e)),"recordChanged"),h=new Map;for(const e of new Set([...f.line.keys(),...f.basis.keys(),...f.record.keys()])){const n=M(e)?f.record.get(e):f.line.get(e);n!==void 0&&h.set(e,n)}const j=new Set;for(const e of new Set(S.flatMap(n=>[...f[n].keys()]))){const[n,s,a]=S.map(o=>f[o].get(e));if(!(F(n,s)&&F(s,a)))if(e==="packed-refs")for(const o of S)for(const u of(await I(o)).keys())j.add(u);else[n,s,a].some(o=>o!==void 0&&T(o))&&j.add(e)}const U=r(async e=>{const[n,s,a]=S.map(o=>f[o].get(e));return[n,s,a].some(o=>o?.mode===P)?w(n):(0,b.gitReflogPlay)(await w(s),await w(a),await w(n))},"playLog"),x=`logs/${V}`;let D=null;M(x)&&(D=(0,b.gitChainReflog)(await U(x)),D===""?h.delete(x):h.set(x,O(x,D)));const p=new Map,C=[];for(const e of[...j].sort(H.compareGitText)){const[n,s,a]=await Promise.all(S.map(u=>y(u,e)));let o=s!==a?a:n;if(e===V){if(D===null)continue;o=(0,b.gitReflogTop)(D)}else e.startsWith(J)&&n!==null&&n!==s&&o!==n&&[n,a].every(u=>u===null||(0,E.isGitOid)(t.record.format,u))&&(a===null||!await c.builtOn(a,n))&&(o=n,a!==null&&!await c.builtOn(n,a)&&C.push({name:e,basis:s,record:a}));o!==n&&p.set(e,o)}const X=[];if(C.length>0){const e=new Map;for(const s of new Set([...f.line.keys(),...(await I("line")).keys(),...p.keys()])){if(s!==K&&!Q(s,K))continue;const a=p.has(s)?p.get(s):await y("line",s);a!==null&&e.set(s,a)}const n=r((s,a)=>(e.get(s)??a)===a&&![...e.keys()].some(o=>Q(s,o)||Q(o,s)),"free");for(const{name:s,basis:a,record:o}of C){const u=`${K}/${s.slice(J.length)}-`;let m=[...e.keys()].sort(H.compareGitText).find(k=>e.get(k)===a&&k.startsWith(u)&&he.test(k.slice(u.length)));for(let k=ue;m===void 0&&k<=o.length;k+=1)n(u+o.slice(0,k),o)&&(m=u+o.slice(0,k));m!==void 0&&(await y("line",m)!==o&&p.set(m,o),e.set(m,o),X.push({branch:m,from:s,commit:o}))}}for(const[e,n]of[...h])oe(n)&&h.delete(e);for(const e of l.line.files)oe(e)&&h.set(e.path,e);const G=new Set;for(const[e,n]of p)n!==null?h.set(e,O(e,`${n}
|
|
2
|
+
`)):(h.has(e)&&T(h.get(e))&&h.delete(e),G.add(e));const Y=f.line.get("packed-refs");if(G.size>0&&Y!==void 0){const e=await w(Y),n=(0,b.gitDropPackedRefs)(e,G);n!==e&&h.set("packed-refs",O("packed-refs",n))}const L=r(e=>p.has(e)?Promise.resolve(p.get(e)):y("line",e),"final"),v=r(async(e,n)=>e?.startsWith("ref: ")?n(e.slice(5)):e,"commitOf"),_=await v(await L("HEAD"),L),R=new Set;for(const e of S)for(const n of f[e].keys())de(n)&&n!==x&&R.add(n);for(const e of p.keys())e!==V&&R.add(`logs/${e}`);_!==await v(await y("line","HEAD"),e=>y("line",e))&&R.add("logs/HEAD");for(const e of[...R].sort(H.compareGitText)){const n=e.slice(5),s=n==="HEAD"?_:await L(n),a=M(e);if(!a&&(s===null||n!=="HEAD"&&!p.has(n)||!f.line.has(e)))continue;let o=a?await U(e):await w(f.line.get(e));const u=(0,b.gitReflogTop)(o);if(s!==null&&u!==null&&u!==s&&(0,E.isGitOid)(t.record.format,s)){const m=o.trimEnd().split(`
|
|
3
|
+
`).at(-1);o+=`${u} ${s}${m.slice(m.indexOf(" ",m.indexOf(" ")+1))}
|
|
4
|
+
`}o===""?h.delete(e):h.set(e,O(e,o))}const q=r(e=>y(e,"HEAD").then(n=>v(n,s=>y(e,s))),"headOf"),Z=await q("record"),ie=t.record.index?.meaning!==t.basis?.index?.meaning||Z!==(t.basis===null?null:await q("basis")),[W,B]=ie?[t.record.index,Z]:[t.line.index,await q("line")];let ee=W;if(W?.files.length===1&&B!==null&&_!==null&&B!==_){const e=await c.carryIndex(await i(W.files[0].oid),B,_);if(e!==null){const n=e.bytes,s=(0,ne.gitBlobId)(n,g);A.set(s,n),ee={meaning:e.meaning,files:[{path:"index",mode:"100644",oid:s}]}}}return{state:{format:t.record.format,home:t.record.home,files:le(h,f.record),index:ee},made:A,aside:X}}r(ge,"gitPlayRecord");
|
package/dist-cjs/git/refs.js
CHANGED
|
@@ -1,72 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.gitReflogTop = exports.gitLooseRef = void 0;
|
|
11
|
-
exports.gitPackedRefs = gitPackedRefs;
|
|
12
|
-
exports.gitDropPackedRefs = gitDropPackedRefs;
|
|
13
|
-
exports.gitReflogPlay = gitReflogPlay;
|
|
14
|
-
exports.gitChainReflog = gitChainReflog;
|
|
15
|
-
/** A loose ref file's value: its one line. */
|
|
16
|
-
const gitLooseRef = (text) => text.split('\n', 1)[0].trimEnd();
|
|
17
|
-
exports.gitLooseRef = gitLooseRef;
|
|
18
|
-
const packedName = (line) => {
|
|
19
|
-
const space = line.indexOf(' ');
|
|
20
|
-
return line.startsWith('#') || line.startsWith('^') || space <= 0 ? null : line.slice(space + 1);
|
|
21
|
-
};
|
|
22
|
-
/** packed-refs' refs by name: every `<oid> <name>` line, skipping its header
|
|
23
|
-
* and the `^<oid>` line that peels an annotated tag. */
|
|
24
|
-
function gitPackedRefs(text) {
|
|
25
|
-
const refs = new Map();
|
|
26
|
-
for (const line of text.split('\n')) {
|
|
27
|
-
const name = packedName(line);
|
|
28
|
-
if (name !== null)
|
|
29
|
-
refs.set(name, line.slice(0, line.indexOf(' ')));
|
|
30
|
-
}
|
|
31
|
-
return refs;
|
|
32
|
-
}
|
|
33
|
-
/** packed-refs without these refs: each one's line and the peel after it. */
|
|
34
|
-
function gitDropPackedRefs(text, names) {
|
|
35
|
-
const kept = [];
|
|
36
|
-
let dropping = false;
|
|
37
|
-
for (const line of text.split('\n')) {
|
|
38
|
-
if (!line.startsWith('^'))
|
|
39
|
-
dropping = names.has(packedName(line) ?? '');
|
|
40
|
-
if (!dropping)
|
|
41
|
-
kept.push(line);
|
|
42
|
-
}
|
|
43
|
-
return kept.join('\n');
|
|
44
|
-
}
|
|
45
|
-
const lines = (text) => text.split('\n').filter(line => line !== '');
|
|
46
|
-
/** A line known by all but the object it moved from, which Git rewrites
|
|
47
|
-
* when it drops the line before it (`git stash drop`). */
|
|
48
|
-
const entry = (line) => line.slice(line.indexOf(' ') + 1);
|
|
49
|
-
/** A reflog once a record is played onto the line: the line's lines, less
|
|
50
|
-
* those the record removed from its basis, then the record's new ones.
|
|
51
|
-
* Playing the same record again changes nothing. */
|
|
52
|
-
function gitReflogPlay(basis, record, line) {
|
|
53
|
-
const was = new Set(lines(basis).map(entry)), own = lines(record), kept = new Set(own.map(entry));
|
|
54
|
-
const shown = lines(line), seen = new Set(shown.map(entry));
|
|
55
|
-
return [...shown.filter(text => !was.has(entry(text)) || kept.has(entry(text))),
|
|
56
|
-
...own.filter(text => !was.has(entry(text)) && !seen.has(entry(text)))].map(text => `${text}\n`).join('');
|
|
57
|
-
}
|
|
58
|
-
/** A stack kept as a reflog, the stash, as Git keeps it: each line moves the
|
|
59
|
-
* ref from where the line before it left it, the first from nothing. */
|
|
60
|
-
function gitChainReflog(text) {
|
|
61
|
-
let from = null;
|
|
62
|
-
return lines(text).map(line => {
|
|
63
|
-
const to = line.split(' ', 2)[1];
|
|
64
|
-
const chained = `${from ?? '0'.repeat(to.length)}${line.slice(line.indexOf(' '))}\n`;
|
|
65
|
-
from = to;
|
|
66
|
-
return chained;
|
|
67
|
-
}).join('');
|
|
68
|
-
}
|
|
69
|
-
/** The object a reflog's last line moved its ref to; null for no lines. */
|
|
70
|
-
const gitReflogTop = (text) => lines(text).at(-1)?.split(' ', 2)[1] ?? null;
|
|
71
|
-
exports.gitReflogTop = gitReflogTop;
|
|
72
|
-
//# sourceMappingURL=refs.js.map
|
|
1
|
+
"use strict";var u=Object.defineProperty;var o=(t,e)=>u(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.gitReflogTop=exports.gitLooseRef=void 0,exports.gitPackedRefs=h,exports.gitDropPackedRefs=R,exports.gitReflogPlay=m,exports.gitChainReflog=k;const d=o(t=>t.split(`
|
|
2
|
+
`,1)[0].trimEnd(),"gitLooseRef");exports.gitLooseRef=d;const r=o(t=>{const e=t.indexOf(" ");return t.startsWith("#")||t.startsWith("^")||e<=0?null:t.slice(e+1)},"packedName");function h(t){const e=new Map;for(const n of t.split(`
|
|
3
|
+
`)){const s=r(n);s!==null&&e.set(s,n.slice(0,n.indexOf(" ")))}return e}o(h,"gitPackedRefs");function R(t,e){const n=[];let s=!1;for(const i of t.split(`
|
|
4
|
+
`))i.startsWith("^")||(s=e.has(r(i)??"")),s||n.push(i);return n.join(`
|
|
5
|
+
`)}o(R,"gitDropPackedRefs");const a=o(t=>t.split(`
|
|
6
|
+
`).filter(e=>e!==""),"lines"),l=o(t=>t.slice(t.indexOf(" ")+1),"entry");function m(t,e,n){const s=new Set(a(t).map(l)),i=a(e),p=new Set(i.map(l)),c=a(n),g=new Set(c.map(l));return[...c.filter(f=>!s.has(l(f))||p.has(l(f))),...i.filter(f=>!s.has(l(f))&&!g.has(l(f)))].map(f=>`${f}
|
|
7
|
+
`).join("")}o(m,"gitReflogPlay");function k(t){let e=null;return a(t).map(n=>{const s=n.split(" ",2)[1],i=`${e??"0".repeat(s.length)}${n.slice(n.indexOf(" "))}
|
|
8
|
+
`;return e=s,i}).join("")}o(k,"gitChainReflog");const w=o(t=>a(t).at(-1)?.split(" ",2)[1]??null,"gitReflogTop");exports.gitReflogTop=w;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var I=Object.defineProperty;var n=(s,r)=>I(s,"name",{value:r,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.gitRestoreGoal=A;const f=require("../contracts/validate.js"),u=require("../entities/bytes.js"),$=require("./artifact.js"),a=require("./parts.js"),p=require("./refs.js"),_=require("./state.js"),x=require("./text.js"),j=/^(rebase-merge|rebase-apply|sequencer)(\/|$)/,l=n(s=>s.mode==="040000","isFolder"),O=n(s=>(0,a.gitOwnRef)(s)||(0,a.gitOwnFile)(s),"restored");function A(s,r,T,q){for(const e of[s,r]){if((0,_.gitBytesForm)(e))return(0,f.fail)("a repository in byte form cannot be restored");if(e.files.some(t=>t.path.startsWith("reftable/")))return(0,f.fail)("a reftable repository cannot be restored");if((0,_.gitSelfHeld)(e.home))return(0,f.fail)("a worktree of storage outside every folder cannot be restored")}if(s.format!==r.format)return(0,f.fail)(`a ${s.format} repository cannot take a ${r.format} version`);const d=new Map,g=n((e,t)=>{const i=(0,$.gitBlobId)(t,q);return d.set(i,t),{path:e,mode:"100644",oid:i}},"blob"),h=n(e=>e.files.find(t=>t.path===a.GIT_PACKED_REFS),"packed"),k=n(e=>{const t=h(e);return t===void 0?null:(0,u.utf8Decode)(T(t.oid))},"packedText"),c=k(s),R=k(r),m=R===null?new Map:(0,p.gitPackedRefs)(R),w=n((e,t)=>new Set([...e.files.filter(i=>!l(i)&&(0,a.gitOwnRef)(i.path)).map(i=>i.path),...[...t.keys()].filter(a.gitOwnRef)]),"ownRefs"),G=w(r,m),M=new Set([...w(s,c===null?new Map:(0,p.gitPackedRefs)(c))].filter(e=>!G.has(e)).map(e=>`logs/${e}`)),o=new Map;for(const[e,t]of m)(0,a.gitOwnRef)(e)&&o.set(e,g(e,(0,u.utf8Encode)(`${t}
|
|
2
|
+
`)));for(const e of r.files)(l(e)?j.test(e.path):O(e.path))&&o.set(e.path,e);if(c!==null){const e=(0,p.gitDropPackedRefs)(c,new Set([...(0,p.gitPackedRefs)(c).keys()].filter(a.gitOwnRef)));o.set(a.GIT_PACKED_REFS,e===c?h(s):g(a.GIT_PACKED_REFS,(0,u.utf8Encode)(e)))}const b=n(e=>{const t=e.split("/");return t.slice(1).map((i,D)=>t.slice(0,D+1).join("/"))},"ancestors"),y=new Set([...o.keys()].flatMap(b)),v=n(e=>o.has(e.path)||!l(e)&&y.has(e.path)||b(e.path).some(t=>o.has(t)&&!l(o.get(t))),"inTheWay");for(const e of s.files)(l(e)?!j.test(e.path):e.path!==a.GIT_PACKED_REFS&&!O(e.path)&&!M.has(e.path))&&!v(e)&&o.set(e.path,e);for(const e of y)o.has(e)||o.set(e,{path:e,mode:"040000",oid:null});const E=[...o.values()].sort((e,t)=>(0,x.compareGitText)(e.path,t.path)),P={...s,files:E,index:r.index},S=(0,_.checkGitState)(P);if(!S.ok)return(0,f.fail)(`the version cannot stand over this repository: ${S.error}`);const F=new Map(E.flatMap(e=>d.has(e.oid)?[[e.oid,d.get(e.oid)]]:[]));return(0,f.pass)({state:P,blobs:F})}n(A,"gitRestoreGoal");
|