@ricsam/r5d-worker 0.0.137 → 0.0.139
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -94
- package/dist/cjs/package.json +1 -1
- package/dist/mjs/main.mjs +46 -7543
- package/dist/mjs/package.json +1 -1
- package/dist/mjs/personal/action-scheduler.mjs +31 -0
- package/dist/mjs/personal/client.mjs +215 -0
- package/dist/mjs/personal/runtime.mjs +359 -0
- package/dist/mjs/personal/tcp.mjs +217 -0
- package/dist/mjs/runtime/adapter.mjs +42 -0
- package/dist/mjs/runtime/client.mjs +95 -0
- package/dist/mjs/runtime/daemon.mjs +131 -0
- package/dist/mjs/runtime/executor.mjs +436 -0
- package/dist/mjs/runtime/index.mjs +15 -0
- package/dist/mjs/runtime/protocol.mjs +139 -0
- package/dist/mjs/runtime/pty-host.mjs +156 -0
- package/dist/mjs/runtime/pty.mjs +127 -0
- package/dist/mjs/runtime/releases/artifacts.mjs +201 -0
- package/dist/mjs/runtime/releases/grants.mjs +93 -0
- package/dist/mjs/runtime/releases/main.mjs +101 -0
- package/dist/mjs/runtime/releases/manager.mjs +541 -0
- package/dist/mjs/runtime/releases/process.mjs +88 -0
- package/dist/mjs/runtime/releases/retirement.mjs +18 -0
- package/dist/mjs/runtime/releases/rpc-client.mjs +184 -0
- package/dist/mjs/runtime/releases/rpc-main.mjs +213 -0
- package/dist/mjs/runtime/releases/rpc-protocol.mjs +103 -0
- package/dist/mjs/runtime/storage.mjs +156 -0
- package/dist/mjs/runtime/workspace/artifacts.mjs +121 -0
- package/dist/mjs/runtime/workspace/authority.mjs +1355 -0
- package/dist/mjs/runtime/workspace/contracts.mjs +60 -0
- package/dist/mjs/runtime/workspace/file-write.mjs +23 -0
- package/dist/mjs/runtime/workspace/files.mjs +308 -0
- package/dist/mjs/runtime/workspace/http-body.mjs +45 -0
- package/dist/mjs/runtime/workspace/storage-client.mjs +59 -0
- package/dist/mjs/runtime/workspace/storage-wire.mjs +53 -0
- package/dist/types/main.d.ts +0 -1167
- package/dist/types/personal/action-scheduler.d.ts +23 -0
- package/dist/types/personal/client.d.ts +14 -0
- package/dist/types/personal/runtime.d.ts +121 -0
- package/dist/types/personal/tcp.d.ts +14 -0
- package/dist/types/runtime/client.d.ts +3 -1
- package/dist/types/runtime/executor.d.ts +6 -1
- package/dist/types/runtime/protocol.d.ts +176 -4
- package/dist/types/runtime/pty.d.ts +1 -0
- package/dist/types/runtime/releases/artifacts.d.ts +51 -0
- package/dist/types/runtime/releases/grants.d.ts +16 -0
- package/dist/types/runtime/releases/manager.d.ts +145 -0
- package/dist/types/runtime/releases/process.d.ts +14 -0
- package/dist/types/runtime/releases/retirement.d.ts +15 -0
- package/dist/types/runtime/releases/rpc-client.d.ts +52 -0
- package/dist/types/runtime/releases/rpc-main.d.ts +10 -0
- package/dist/types/runtime/releases/rpc-protocol.d.ts +1139 -0
- package/dist/types/runtime/workspace/artifacts.d.ts +30 -0
- package/dist/types/runtime/workspace/authority.d.ts +338 -0
- package/dist/types/runtime/workspace/contracts.d.ts +86 -0
- package/dist/types/runtime/workspace/file-write.d.ts +14 -0
- package/dist/types/runtime/workspace/files.d.ts +21 -0
- package/dist/types/runtime/workspace/http-body.d.ts +9 -0
- package/dist/types/runtime/workspace/storage-client.d.ts +23 -0
- package/dist/types/runtime/workspace/storage-wire.d.ts +138 -0
- package/package.json +8 -6
- package/dist/cjs/atomic-rename.cjs +0 -303
- package/dist/cjs/browser-upload.cjs +0 -73
- package/dist/cjs/cli-update.cjs +0 -108
- package/dist/cjs/command-launcher.cjs +0 -423
- package/dist/cjs/control-command-policy.cjs +0 -177
- package/dist/cjs/git-blob-hash.cjs +0 -41
- package/dist/cjs/git-identity.cjs +0 -39
- package/dist/cjs/git-process-environment.cjs +0 -133
- package/dist/cjs/inline-output.cjs +0 -62
- package/dist/cjs/main.cjs +0 -7517
- package/dist/cjs/managed-paths.cjs +0 -215
- package/dist/cjs/plan-lint.cjs +0 -165
- package/dist/cjs/plan-parser.cjs +0 -127
- package/dist/cjs/plan-paths.cjs +0 -53
- package/dist/cjs/port-forward-client.cjs +0 -206
- package/dist/cjs/process-tree.cjs +0 -117
- package/dist/cjs/project-checkout-garbage.cjs +0 -219
- package/dist/cjs/project-mirror-fetch-policy.cjs +0 -82
- package/dist/cjs/project-mirror-refs-token.cjs +0 -85
- package/dist/cjs/project-workspace-state.cjs +0 -972
- package/dist/cjs/project-worktrees.cjs +0 -1713
- package/dist/cjs/pty-output-coalescer.cjs +0 -87
- package/dist/cjs/recovery-journal-protocol.cjs +0 -56
- package/dist/cjs/recovery-journal-runtime.cjs +0 -133
- package/dist/cjs/recovery-journal-thread.cjs +0 -9
- package/dist/cjs/recovery-journal.cjs +0 -742
- package/dist/cjs/recovery-output-window.cjs +0 -77
- package/dist/cjs/recovery-protocol.cjs +0 -31
- package/dist/cjs/recovery-store.cjs +0 -252
- package/dist/cjs/registry-auth.cjs +0 -310
- package/dist/cjs/repository-transition-policy.cjs +0 -49
- package/dist/cjs/runtime-version.cjs +0 -88
- package/dist/cjs/session-file-mutations.cjs +0 -61
- package/dist/cjs/supervisor.cjs +0 -147
- package/dist/cjs/three-way-merge.cjs +0 -346
- package/dist/cjs/working-tree-mirror.cjs +0 -1872
- package/dist/cjs/workspace-automatic-sync-policy.cjs +0 -79
- package/dist/cjs/workspace-branch-incarnation-policy.cjs +0 -37
- package/dist/cjs/workspace-command-sync-policy.cjs +0 -112
- package/dist/cjs/workspace-command-targets.cjs +0 -63
- package/dist/cjs/workspace-filesystem-executor-thread.cjs +0 -36
- package/dist/cjs/workspace-filesystem-executor.cjs +0 -327
- package/dist/cjs/workspace-filesystem-job-types.cjs +0 -144
- package/dist/cjs/workspace-filesystem-jobs.cjs +0 -59
- package/dist/cjs/workspace-git-sync.cjs +0 -3595
- package/dist/cjs/workspace-hydration-ledger.cjs +0 -83
- package/dist/cjs/workspace-hydration-merge.cjs +0 -448
- package/dist/cjs/workspace-hydration-recovery-state.cjs +0 -53
- package/dist/cjs/workspace-incident-state.cjs +0 -37
- package/dist/cjs/workspace-merge-projection.cjs +0 -628
- package/dist/cjs/workspace-mount-boundary.cjs +0 -71
- package/dist/cjs/workspace-mount-hold-fence.cjs +0 -120
- package/dist/cjs/workspace-mutation-gate.cjs +0 -127
- package/dist/cjs/workspace-path-move.cjs +0 -195
- package/dist/cjs/workspace-preserve-only-policy.cjs +0 -36
- package/dist/cjs/workspace-project-config-policy.cjs +0 -53
- package/dist/cjs/workspace-projection-ledger.cjs +0 -81
- package/dist/cjs/workspace-publication-evidence.cjs +0 -46
- package/dist/cjs/workspace-sync-coalescer.cjs +0 -58
- package/dist/mjs/atomic-rename.mjs +0 -261
- package/dist/mjs/browser-upload.mjs +0 -42
- package/dist/mjs/command-launcher.mjs +0 -393
- package/dist/mjs/control-command-policy.mjs +0 -146
- package/dist/mjs/git-blob-hash.mjs +0 -16
- package/dist/mjs/git-identity.mjs +0 -15
- package/dist/mjs/git-process-environment.mjs +0 -105
- package/dist/mjs/inline-output.mjs +0 -37
- package/dist/mjs/managed-paths.mjs +0 -174
- package/dist/mjs/plan-lint.mjs +0 -129
- package/dist/mjs/plan-parser.mjs +0 -94
- package/dist/mjs/plan-paths.mjs +0 -25
- package/dist/mjs/port-forward-client.mjs +0 -172
- package/dist/mjs/project-checkout-garbage.mjs +0 -178
- package/dist/mjs/project-mirror-fetch-policy.mjs +0 -56
- package/dist/mjs/project-mirror-refs-token.mjs +0 -53
- package/dist/mjs/project-workspace-state.mjs +0 -937
- package/dist/mjs/project-worktrees.mjs +0 -1657
- package/dist/mjs/pty-output-coalescer.mjs +0 -61
- package/dist/mjs/recovery-journal-protocol.mjs +0 -30
- package/dist/mjs/recovery-journal-runtime.mjs +0 -112
- package/dist/mjs/recovery-journal-thread.mjs +0 -8
- package/dist/mjs/recovery-journal.mjs +0 -694
- package/dist/mjs/recovery-output-window.mjs +0 -53
- package/dist/mjs/recovery-protocol.mjs +0 -6
- package/dist/mjs/recovery-store.mjs +0 -217
- package/dist/mjs/registry-auth.mjs +0 -269
- package/dist/mjs/repository-transition-policy.mjs +0 -22
- package/dist/mjs/runtime-version.mjs +0 -54
- package/dist/mjs/session-file-mutations.mjs +0 -37
- package/dist/mjs/supervisor.mjs +0 -114
- package/dist/mjs/three-way-merge.mjs +0 -318
- package/dist/mjs/working-tree-mirror.mjs +0 -1817
- package/dist/mjs/workspace-automatic-sync-policy.mjs +0 -48
- package/dist/mjs/workspace-branch-incarnation-policy.mjs +0 -13
- package/dist/mjs/workspace-command-sync-policy.mjs +0 -84
- package/dist/mjs/workspace-command-targets.mjs +0 -37
- package/dist/mjs/workspace-filesystem-executor-thread.mjs +0 -38
- package/dist/mjs/workspace-filesystem-executor.mjs +0 -287
- package/dist/mjs/workspace-filesystem-job-types.mjs +0 -116
- package/dist/mjs/workspace-filesystem-jobs.mjs +0 -55
- package/dist/mjs/workspace-git-sync.mjs +0 -3553
- package/dist/mjs/workspace-hydration-ledger.mjs +0 -58
- package/dist/mjs/workspace-hydration-merge.mjs +0 -414
- package/dist/mjs/workspace-hydration-recovery-state.mjs +0 -29
- package/dist/mjs/workspace-incident-state.mjs +0 -12
- package/dist/mjs/workspace-merge-projection.mjs +0 -594
- package/dist/mjs/workspace-mount-boundary.mjs +0 -37
- package/dist/mjs/workspace-mount-hold-fence.mjs +0 -95
- package/dist/mjs/workspace-mutation-gate.mjs +0 -103
- package/dist/mjs/workspace-path-move.mjs +0 -160
- package/dist/mjs/workspace-preserve-only-policy.mjs +0 -11
- package/dist/mjs/workspace-project-config-policy.mjs +0 -27
- package/dist/mjs/workspace-projection-ledger.mjs +0 -57
- package/dist/mjs/workspace-publication-evidence.mjs +0 -21
- package/dist/mjs/workspace-sync-coalescer.mjs +0 -34
- package/dist/types/atomic-rename.d.ts +0 -78
- package/dist/types/browser-upload.d.ts +0 -7
- package/dist/types/command-launcher.d.ts +0 -104
- package/dist/types/control-command-policy.d.ts +0 -53
- package/dist/types/git-blob-hash.d.ts +0 -10
- package/dist/types/git-identity.d.ts +0 -9
- package/dist/types/git-process-environment.d.ts +0 -9
- package/dist/types/inline-output.d.ts +0 -3
- package/dist/types/managed-paths.d.ts +0 -19
- package/dist/types/plan-lint.d.ts +0 -16
- package/dist/types/plan-parser.d.ts +0 -38
- package/dist/types/plan-paths.d.ts +0 -36
- package/dist/types/port-forward-client.d.ts +0 -8
- package/dist/types/project-checkout-garbage.d.ts +0 -86
- package/dist/types/project-mirror-fetch-policy.d.ts +0 -84
- package/dist/types/project-mirror-refs-token.d.ts +0 -53
- package/dist/types/project-workspace-state.d.ts +0 -188
- package/dist/types/project-worktrees.d.ts +0 -397
- package/dist/types/pty-output-coalescer.d.ts +0 -20
- package/dist/types/recovery-journal-protocol.d.ts +0 -35
- package/dist/types/recovery-journal-runtime.d.ts +0 -12
- package/dist/types/recovery-journal-stall-fixture.d.ts +0 -1
- package/dist/types/recovery-journal-thread.d.ts +0 -1
- package/dist/types/recovery-journal.d.ts +0 -248
- package/dist/types/recovery-output-window.d.ts +0 -19
- package/dist/types/recovery-protocol.d.ts +0 -59
- package/dist/types/recovery-store.d.ts +0 -52
- package/dist/types/registry-auth.d.ts +0 -47
- package/dist/types/repository-transition-policy.d.ts +0 -26
- package/dist/types/runtime-version.d.ts +0 -1
- package/dist/types/session-file-mutations.d.ts +0 -22
- package/dist/types/supervisor-daemonized-fixture.d.ts +0 -1
- package/dist/types/supervisor-launcher-cleanup-fixture.d.ts +0 -1
- package/dist/types/supervisor-signal-fixture.d.ts +0 -1
- package/dist/types/supervisor.d.ts +0 -23
- package/dist/types/three-way-merge.d.ts +0 -77
- package/dist/types/working-tree-mirror.d.ts +0 -424
- package/dist/types/workspace-automatic-sync-policy.d.ts +0 -57
- package/dist/types/workspace-branch-incarnation-policy.d.ts +0 -14
- package/dist/types/workspace-command-sync-policy.d.ts +0 -57
- package/dist/types/workspace-command-targets.d.ts +0 -37
- package/dist/types/workspace-filesystem-executor-thread.d.ts +0 -1
- package/dist/types/workspace-filesystem-executor.d.ts +0 -123
- package/dist/types/workspace-filesystem-job-types.d.ts +0 -302
- package/dist/types/workspace-filesystem-jobs.d.ts +0 -7
- package/dist/types/workspace-git-sync.d.ts +0 -514
- package/dist/types/workspace-hydration-ledger.d.ts +0 -76
- package/dist/types/workspace-hydration-merge.d.ts +0 -103
- package/dist/types/workspace-hydration-recovery-state.d.ts +0 -10
- package/dist/types/workspace-incident-state.d.ts +0 -19
- package/dist/types/workspace-merge-projection.d.ts +0 -69
- package/dist/types/workspace-mount-boundary.d.ts +0 -10
- package/dist/types/workspace-mount-hold-fence.d.ts +0 -42
- package/dist/types/workspace-mutation-gate.d.ts +0 -42
- package/dist/types/workspace-path-move.d.ts +0 -21
- package/dist/types/workspace-preserve-only-policy.d.ts +0 -15
- package/dist/types/workspace-project-config-policy.d.ts +0 -48
- package/dist/types/workspace-projection-ledger.d.ts +0 -59
- package/dist/types/workspace-publication-evidence.d.ts +0 -17
- package/dist/types/workspace-sync-coalescer.d.ts +0 -28
- /package/dist/types/{credential-authority-lock-fixture.d.ts → runtime/releases/main.d.ts} +0 -0
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { type CheckoutPathSegments } from "./managed-paths";
|
|
2
|
-
export declare const PROJECT_WORKSPACE_STATE_FILE = "project-workspace-state.json";
|
|
3
|
-
export type ProjectWorkspaceDesiredProjectInput = {
|
|
4
|
-
projectId: string;
|
|
5
|
-
checkoutPathSegments: CheckoutPathSegments;
|
|
6
|
-
defaultBranch: string;
|
|
7
|
-
branches: readonly {
|
|
8
|
-
branchName: string;
|
|
9
|
-
}[];
|
|
10
|
-
};
|
|
11
|
-
export type ProjectWorkspaceDesiredProject = {
|
|
12
|
-
projectId: string;
|
|
13
|
-
checkoutPathSegments: CheckoutPathSegments;
|
|
14
|
-
defaultBranch: string;
|
|
15
|
-
branches: Array<{
|
|
16
|
-
branchName: string;
|
|
17
|
-
}>;
|
|
18
|
-
};
|
|
19
|
-
export type LocallyPendingCreatedProjectBranch = {
|
|
20
|
-
/** Durable project_branches row incarnation; absent only in legacy state. */
|
|
21
|
-
branchId?: string;
|
|
22
|
-
projectId: string;
|
|
23
|
-
branchName: string;
|
|
24
|
-
};
|
|
25
|
-
export type PreserveOnlyProjectBranch = {
|
|
26
|
-
branchId: string;
|
|
27
|
-
projectId: string;
|
|
28
|
-
branchName: string;
|
|
29
|
-
};
|
|
30
|
-
export type EnabledRepositoryTransition = {
|
|
31
|
-
projectId: string;
|
|
32
|
-
transitionId: string | null;
|
|
33
|
-
};
|
|
34
|
-
type ProjectWorkspaceDeletionBase = {
|
|
35
|
-
id: string;
|
|
36
|
-
projectId: string;
|
|
37
|
-
checkoutPathSegments: CheckoutPathSegments;
|
|
38
|
-
treePublishedHead: string | null;
|
|
39
|
-
mirrorRefsDeleted: string[];
|
|
40
|
-
};
|
|
41
|
-
export type ProjectWorkspaceBranchDeletionTombstone = ProjectWorkspaceDeletionBase & {
|
|
42
|
-
kind: "branch";
|
|
43
|
-
branchName: string;
|
|
44
|
-
};
|
|
45
|
-
export type ProjectWorkspaceProjectDeletionTombstone = ProjectWorkspaceDeletionBase & {
|
|
46
|
-
kind: "project";
|
|
47
|
-
branchNames: string[];
|
|
48
|
-
};
|
|
49
|
-
export type ProjectWorkspaceDeletionTombstone = ProjectWorkspaceBranchDeletionTombstone | ProjectWorkspaceProjectDeletionTombstone;
|
|
50
|
-
export type PendingProjectWorkspaceTreeDeletion = {
|
|
51
|
-
tombstoneId: string;
|
|
52
|
-
kind: "branch";
|
|
53
|
-
projectId: string;
|
|
54
|
-
checkoutPathSegments: CheckoutPathSegments;
|
|
55
|
-
branchName: string;
|
|
56
|
-
managedPath: string;
|
|
57
|
-
primaryBranchName: string | null;
|
|
58
|
-
} | {
|
|
59
|
-
tombstoneId: string;
|
|
60
|
-
kind: "project";
|
|
61
|
-
projectId: string;
|
|
62
|
-
checkoutPathSegments: CheckoutPathSegments;
|
|
63
|
-
branchNames: string[];
|
|
64
|
-
managedPath: string;
|
|
65
|
-
projectDeleted: boolean;
|
|
66
|
-
};
|
|
67
|
-
export type PendingProjectMirrorRefDeletion = {
|
|
68
|
-
tombstoneId: string;
|
|
69
|
-
projectId: string;
|
|
70
|
-
branchName: string;
|
|
71
|
-
checkoutPathSegments: CheckoutPathSegments;
|
|
72
|
-
managedPath: string;
|
|
73
|
-
primaryBranchName: string | null;
|
|
74
|
-
treePublishedHead: string;
|
|
75
|
-
};
|
|
76
|
-
export type ProjectWorkspaceStateView = {
|
|
77
|
-
desiredProjects: ProjectWorkspaceDesiredProject[];
|
|
78
|
-
effectiveDesiredProjects: ProjectWorkspaceDesiredProject[];
|
|
79
|
-
locallyPendingCreatedBranches: LocallyPendingCreatedProjectBranch[];
|
|
80
|
-
enabledRepositoryTransitions: EnabledRepositoryTransition[];
|
|
81
|
-
tombstones: ProjectWorkspaceDeletionTombstone[];
|
|
82
|
-
pendingTreeDeletions: PendingProjectWorkspaceTreeDeletion[];
|
|
83
|
-
pendingMirrorRefDeletions: PendingProjectMirrorRefDeletion[];
|
|
84
|
-
};
|
|
85
|
-
export declare class ProjectWorkspacePendingBranchPathChangeError extends Error {
|
|
86
|
-
readonly projectId: string;
|
|
87
|
-
readonly branchName: string;
|
|
88
|
-
readonly currentCheckoutPathSegments: CheckoutPathSegments;
|
|
89
|
-
readonly incomingCheckoutPathSegments: CheckoutPathSegments;
|
|
90
|
-
constructor(input: {
|
|
91
|
-
projectId: string;
|
|
92
|
-
branchName: string;
|
|
93
|
-
currentCheckoutPathSegments: CheckoutPathSegments;
|
|
94
|
-
incomingCheckoutPathSegments: CheckoutPathSegments;
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
export declare class ProjectWorkspaceCheckoutPathCollisionError extends Error {
|
|
98
|
-
readonly projectId: string;
|
|
99
|
-
readonly occupyingProjectId: string;
|
|
100
|
-
readonly checkoutPathSegments: CheckoutPathSegments;
|
|
101
|
-
constructor(input: {
|
|
102
|
-
projectId: string;
|
|
103
|
-
occupyingProjectId: string;
|
|
104
|
-
checkoutPathSegments: CheckoutPathSegments;
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
export type StaleOuterProjectWorkspaceBranch = {
|
|
108
|
-
kind: "branch";
|
|
109
|
-
projectId: string;
|
|
110
|
-
branchName: string;
|
|
111
|
-
projectTreePath: string | null;
|
|
112
|
-
planTreePath: string | null;
|
|
113
|
-
};
|
|
114
|
-
export type StaleOuterProjectWorkspaceProject = {
|
|
115
|
-
kind: "project";
|
|
116
|
-
projectId: string;
|
|
117
|
-
projectTreePath: string | null;
|
|
118
|
-
planTreePath: string | null;
|
|
119
|
-
branches: Array<{
|
|
120
|
-
branchName: string;
|
|
121
|
-
projectTreePath: string | null;
|
|
122
|
-
planTreePath: string | null;
|
|
123
|
-
}>;
|
|
124
|
-
};
|
|
125
|
-
export type StaleOuterProjectWorkspaceEntry = StaleOuterProjectWorkspaceBranch | StaleOuterProjectWorkspaceProject;
|
|
126
|
-
/**
|
|
127
|
-
* A fresh authoritative configuration wins over any deletion staged by an
|
|
128
|
-
* older configuration. Remove only exact project/branch targets so unrelated
|
|
129
|
-
* cleanup (including an old checkout-path tombstone) remains durable.
|
|
130
|
-
*/
|
|
131
|
-
export declare function pruneAuthoritativelyDesiredBranchDeletions<T extends LocallyPendingCreatedProjectBranch>(pendingDeletions: Map<string, T>, desiredProjects: readonly ProjectWorkspaceDesiredProjectInput[]): void;
|
|
132
|
-
/**
|
|
133
|
-
* Discover legacy outer-tree entries without trusting or walking arbitrary
|
|
134
|
-
* filesystem names. Only canonical managed project ids and encoded branch
|
|
135
|
-
* directory names are returned; symlinks, files, and non-layout entries are
|
|
136
|
-
* deliberately left for an operator.
|
|
137
|
-
*/
|
|
138
|
-
export declare function discoverStaleOuterProjectWorkspaceEntries(input: {
|
|
139
|
-
workspaceShadowRoot: string;
|
|
140
|
-
desiredProjects: readonly ProjectWorkspaceDesiredProjectInput[];
|
|
141
|
-
locallyPendingCreatedBranches?: readonly LocallyPendingCreatedProjectBranch[];
|
|
142
|
-
}): StaleOuterProjectWorkspaceEntry[];
|
|
143
|
-
/**
|
|
144
|
-
* Durable worker-local ledger for desired project mounts and ordered deletion
|
|
145
|
-
* side effects. The caller must remove each managed path before including its
|
|
146
|
-
* tombstone in an outer-tree publication. Mirror refs may be acknowledged only
|
|
147
|
-
* after that publication is durably recorded.
|
|
148
|
-
*/
|
|
149
|
-
export declare class ProjectWorkspaceStateStore {
|
|
150
|
-
readonly stateRoot: string;
|
|
151
|
-
readonly projectsRoot: string;
|
|
152
|
-
readonly statePath: string;
|
|
153
|
-
constructor(input: {
|
|
154
|
-
stateRoot: string;
|
|
155
|
-
projectsRoot: string;
|
|
156
|
-
});
|
|
157
|
-
read(): ProjectWorkspaceStateView;
|
|
158
|
-
discoverStaleOuterEntries(workspaceShadowRoot: string): StaleOuterProjectWorkspaceEntry[];
|
|
159
|
-
reconcile(input: {
|
|
160
|
-
desiredProjects: readonly ProjectWorkspaceDesiredProjectInput[];
|
|
161
|
-
locallyPendingCreatedBranches?: readonly LocallyPendingCreatedProjectBranch[];
|
|
162
|
-
preserveOnlyBranches?: readonly PreserveOnlyProjectBranch[];
|
|
163
|
-
}): Promise<ProjectWorkspaceStateView>;
|
|
164
|
-
/** Record a successful enabled reseed without letting disabled config consume it. */
|
|
165
|
-
recordEnabledRepositoryTransition(input: EnabledRepositoryTransition): Promise<ProjectWorkspaceStateView>;
|
|
166
|
-
/** Persist the create intent before invoking Git so a crash cannot orphan an untracked worktree. */
|
|
167
|
-
recordPendingCreatedBranch(input: LocallyPendingCreatedProjectBranch & {
|
|
168
|
-
branchId: string;
|
|
169
|
-
}): Promise<ProjectWorkspaceStateView>;
|
|
170
|
-
/** Roll back an intent only when Git failed before creating its branch. */
|
|
171
|
-
rollbackPendingCreatedBranch(input: LocallyPendingCreatedProjectBranch): Promise<ProjectWorkspaceStateView>;
|
|
172
|
-
/** Clear a create intent after an authoritative desired config contains it. */
|
|
173
|
-
clearPendingCreatedBranch(input: LocallyPendingCreatedProjectBranch): Promise<ProjectWorkspaceStateView>;
|
|
174
|
-
/** Persist a branch tombstone before mutating its linked worktree or local ref. */
|
|
175
|
-
beginBranchDeletion(input: LocallyPendingCreatedProjectBranch): Promise<ProjectWorkspaceStateView>;
|
|
176
|
-
recordTreePublication(input: {
|
|
177
|
-
tombstoneIds: readonly string[];
|
|
178
|
-
publishedHead: string;
|
|
179
|
-
}): Promise<ProjectWorkspaceStateView>;
|
|
180
|
-
recordMirrorRefDeletion(input: {
|
|
181
|
-
tombstoneId: string;
|
|
182
|
-
branchName: string;
|
|
183
|
-
}): Promise<ProjectWorkspaceStateView>;
|
|
184
|
-
}
|
|
185
|
-
export declare const projectWorkspaceStateTestHarness: {
|
|
186
|
-
writeEmptyStateAtDurableRootBoundary(stateRoot: string, afterStateRootFsync: () => void): Promise<void>;
|
|
187
|
-
};
|
|
188
|
-
export {};
|
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
import { type ProjectMirrorMount, type ProjectMirrorRefsTokens } from "./project-mirror-refs-token";
|
|
2
|
-
import type { WorkspaceFilesystemJobContext } from "./workspace-filesystem-job-types";
|
|
3
|
-
export declare const PROJECT_WORKTREE_SNAPSHOT_PREFIX = "r5d-project-worktrees-";
|
|
4
|
-
declare const PROJECT_WORKTREE_SNAPSHOT_MANIFEST_VERSION: 1;
|
|
5
|
-
/**
|
|
6
|
-
* Distinguishes this control thread's live snapshots from stale ones left by
|
|
7
|
-
* an earlier process that reused the PID. The control thread passes it to
|
|
8
|
-
* every snapshot job, so the executor thread never invents its own.
|
|
9
|
-
*/
|
|
10
|
-
export declare const PROJECT_WORKTREE_SNAPSHOT_OWNER_SESSION_ID: `${string}-${string}-${string}-${string}-${string}`;
|
|
11
|
-
/**
|
|
12
|
-
* `project` snapshots cover every configured branch and restore by replacing
|
|
13
|
-
* the whole project root. `branches` snapshots cover only the checkouts one
|
|
14
|
-
* reconciliation rewrites and restore those paths individually, so a rollback
|
|
15
|
-
* never touches a checkout the transaction did not.
|
|
16
|
-
*/
|
|
17
|
-
export type ProjectWorktreeSnapshotScope = "project" | "branches";
|
|
18
|
-
export type ProjectWorktreeSnapshotManifest = {
|
|
19
|
-
version: typeof PROJECT_WORKTREE_SNAPSHOT_MANIFEST_VERSION;
|
|
20
|
-
state: "building" | "prepared" | "restoring" | "consumed";
|
|
21
|
-
scope: ProjectWorktreeSnapshotScope;
|
|
22
|
-
ownerProcessId: number;
|
|
23
|
-
ownerSessionId: string;
|
|
24
|
-
projectRoot: string;
|
|
25
|
-
branches: Array<{
|
|
26
|
-
branchName: string;
|
|
27
|
-
snapshotPresent: boolean;
|
|
28
|
-
}>;
|
|
29
|
-
createdAt: string;
|
|
30
|
-
};
|
|
31
|
-
export type ProjectWorktreeSnapshot = {
|
|
32
|
-
root: string;
|
|
33
|
-
manifest: ProjectWorktreeSnapshotManifest;
|
|
34
|
-
paths: Map<string, string>;
|
|
35
|
-
};
|
|
36
|
-
export type ProjectWorktreeSnapshotProgress = {
|
|
37
|
-
operation: "snapshot" | "restore";
|
|
38
|
-
phase: "scanning" | "copying" | "moving" | "syncing" | "cleaning";
|
|
39
|
-
projectRoot: string;
|
|
40
|
-
branchName?: string;
|
|
41
|
-
completedBranches: number;
|
|
42
|
-
totalBranches: number;
|
|
43
|
-
completedBytes: number;
|
|
44
|
-
totalBytes?: number;
|
|
45
|
-
};
|
|
46
|
-
export type ProjectWorktreeBranch = {
|
|
47
|
-
branchId?: string;
|
|
48
|
-
branchName: string;
|
|
49
|
-
baseCommitHash: string;
|
|
50
|
-
sourceBranchName?: string | null;
|
|
51
|
-
};
|
|
52
|
-
export type ProjectWorktreeState = {
|
|
53
|
-
branchName: string;
|
|
54
|
-
branchPath: string;
|
|
55
|
-
head: string;
|
|
56
|
-
mirrorHead: string | null;
|
|
57
|
-
ahead: number | null;
|
|
58
|
-
behind: number | null;
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Creation failed after its branch ref may have been written, and rollback
|
|
62
|
-
* could not prove that every local artifact was removed. Callers must retain
|
|
63
|
-
* their durable creation intent so a later cleanup can recover it.
|
|
64
|
-
*/
|
|
65
|
-
export declare class ProjectBranchCreationRollbackIncompleteError extends Error {
|
|
66
|
-
readonly branchMayExist: true;
|
|
67
|
-
readonly cleanupFailures: readonly string[];
|
|
68
|
-
constructor(branchName: string, cleanupFailures: readonly string[], cause: unknown);
|
|
69
|
-
}
|
|
70
|
-
export declare function projectBranchMayExistAfterCreateFailure(error: unknown): boolean;
|
|
71
|
-
export declare function projectWorktreeConfigurationFingerprint(input: {
|
|
72
|
-
checkoutPathSegments: readonly string[];
|
|
73
|
-
projectPath: string;
|
|
74
|
-
repoHttpUrl: string | null;
|
|
75
|
-
repoAuthHeader: string | null;
|
|
76
|
-
defaultBranch: string;
|
|
77
|
-
repositoryTransitionId?: string | null;
|
|
78
|
-
executionDisabled?: boolean;
|
|
79
|
-
mirrorWritesDisabled?: boolean;
|
|
80
|
-
preserveOnlyBranches?: readonly {
|
|
81
|
-
branchId?: string;
|
|
82
|
-
branchName: string;
|
|
83
|
-
}[];
|
|
84
|
-
branches: readonly ProjectWorktreeBranch[];
|
|
85
|
-
gitIdentity: {
|
|
86
|
-
name: string;
|
|
87
|
-
email: string;
|
|
88
|
-
} | null;
|
|
89
|
-
}): string;
|
|
90
|
-
declare function gitCommandArgs(args: string[]): string[];
|
|
91
|
-
export declare function hasLinkedProjectWorktreeLayout(input: {
|
|
92
|
-
projectRoot: string;
|
|
93
|
-
primaryBranchName: string;
|
|
94
|
-
branches: readonly Pick<ProjectWorktreeBranch, "branchName">[];
|
|
95
|
-
}): boolean;
|
|
96
|
-
export declare function recoverStaleProjectWorktreeSnapshots(input: {
|
|
97
|
-
projectsRoot: string;
|
|
98
|
-
temporaryRoot?: string;
|
|
99
|
-
processAlive?: (processId: number) => boolean;
|
|
100
|
-
currentProcessId?: number;
|
|
101
|
-
currentOwnerSessionId?: string;
|
|
102
|
-
onProgress?: (progress: ProjectWorktreeSnapshotProgress) => void;
|
|
103
|
-
}): {
|
|
104
|
-
restored: string[];
|
|
105
|
-
removed: string[];
|
|
106
|
-
failed: Array<{
|
|
107
|
-
path: string;
|
|
108
|
-
error: string;
|
|
109
|
-
}>;
|
|
110
|
-
};
|
|
111
|
-
export declare function projectOriginBranchName(input: {
|
|
112
|
-
branchName: string;
|
|
113
|
-
primaryBranchName: string;
|
|
114
|
-
defaultBranch: string;
|
|
115
|
-
}): string;
|
|
116
|
-
declare function configureRepository(input: {
|
|
117
|
-
primaryPath: string;
|
|
118
|
-
originUrl: string;
|
|
119
|
-
primaryBranchName?: string;
|
|
120
|
-
defaultBranch?: string;
|
|
121
|
-
branches?: readonly Pick<ProjectWorktreeBranch, "branchName">[];
|
|
122
|
-
credentialHelper?: string | null;
|
|
123
|
-
originCredentialUsername?: string | null;
|
|
124
|
-
gitIdentity?: {
|
|
125
|
-
name: string;
|
|
126
|
-
email: string;
|
|
127
|
-
} | null;
|
|
128
|
-
}): Promise<void>;
|
|
129
|
-
export declare function ensureProjectWorktrees(input: {
|
|
130
|
-
projectRoot: string;
|
|
131
|
-
primaryBranchName: string;
|
|
132
|
-
defaultBranch?: string;
|
|
133
|
-
branches: readonly ProjectWorktreeBranch[];
|
|
134
|
-
originUrl: string;
|
|
135
|
-
mirrorUrl: string;
|
|
136
|
-
credentialHelper?: string | null;
|
|
137
|
-
originCredentialUsername?: string | null;
|
|
138
|
-
mirrorCredentialUsername?: string | null;
|
|
139
|
-
gitIdentity?: {
|
|
140
|
-
name: string;
|
|
141
|
-
email: string;
|
|
142
|
-
} | null;
|
|
143
|
-
exactMirrorBranches?: ReadonlySet<string>;
|
|
144
|
-
snapshotRoot?: string;
|
|
145
|
-
onSnapshotProgress?: (progress: ProjectWorktreeSnapshotProgress) => void;
|
|
146
|
-
}): Promise<ProjectWorktreeState[]>;
|
|
147
|
-
export declare function projectWorktreeOperationInProgress(checkoutPath: string): boolean;
|
|
148
|
-
/**
|
|
149
|
-
* How a new linked worktree's working tree starts. `carry` materializes the
|
|
150
|
-
* source checkout's Git-visible working state, uncommitted changes included;
|
|
151
|
-
* `clean` checks out the source branch's current commit and nothing else.
|
|
152
|
-
*/
|
|
153
|
-
export type ProjectWorktreeWorkingTreeMode = "carry" | "clean";
|
|
154
|
-
export declare function createLinkedProjectBranch(input: {
|
|
155
|
-
projectRoot: string;
|
|
156
|
-
sourceBranchName: string;
|
|
157
|
-
branchName: string;
|
|
158
|
-
workingTree: ProjectWorktreeWorkingTreeMode;
|
|
159
|
-
}): {
|
|
160
|
-
branchPath: string;
|
|
161
|
-
baseCommitHash: string;
|
|
162
|
-
};
|
|
163
|
-
/**
|
|
164
|
-
* A retained pending intent is ownership proof for artifacts left by an
|
|
165
|
-
* interrupted earlier attempt. Remove those artifacts idempotently before
|
|
166
|
-
* recreating; if cleanup still fails, the caller keeps the same intent and can
|
|
167
|
-
* retry again later.
|
|
168
|
-
*/
|
|
169
|
-
export declare function createOrRetryLinkedProjectBranch(input: {
|
|
170
|
-
projectRoot: string;
|
|
171
|
-
primaryBranchName: string;
|
|
172
|
-
sourceBranchName: string;
|
|
173
|
-
branchName: string;
|
|
174
|
-
workingTree: ProjectWorktreeWorkingTreeMode;
|
|
175
|
-
pendingRetry: boolean;
|
|
176
|
-
}): Promise<{
|
|
177
|
-
branchPath: string;
|
|
178
|
-
baseCommitHash: string;
|
|
179
|
-
}>;
|
|
180
|
-
export type ProjectCheckoutState = "linked" | "missing" | "not_a_worktree";
|
|
181
|
-
export type ProjectCheckoutInventory = {
|
|
182
|
-
/** Branches whose checkout is this project's primary clone or one of its linked worktrees. */
|
|
183
|
-
linkedBranchNames: string[];
|
|
184
|
-
missingCheckouts: Array<{
|
|
185
|
-
branchName: string;
|
|
186
|
-
checkoutPath: string;
|
|
187
|
-
reason: Exclude<ProjectCheckoutState, "linked">;
|
|
188
|
-
}>;
|
|
189
|
-
};
|
|
190
|
-
/**
|
|
191
|
-
* Classify one configured branch checkout without spawning git, cheap enough
|
|
192
|
-
* to run for every configured branch on every sync cycle. The primary
|
|
193
|
-
* checkout is `linked` when its `.git` is a directory; another branch is
|
|
194
|
-
* `linked` when its `.git` pointer file resolves into that primary clone's
|
|
195
|
-
* `.git/worktrees` registry and the registered directory still exists.
|
|
196
|
-
* `missing` means the checkout path is absent. Everything else (a hydrated
|
|
197
|
-
* directory that never became a checkout, a foreign clone, a pointer to a
|
|
198
|
-
* pruned registration) is `not_a_worktree`.
|
|
199
|
-
*/
|
|
200
|
-
export declare function classifyProjectCheckout(input: {
|
|
201
|
-
projectRoot: string;
|
|
202
|
-
primaryBranchName: string;
|
|
203
|
-
branchName: string;
|
|
204
|
-
}): ProjectCheckoutState;
|
|
205
|
-
/**
|
|
206
|
-
* Partition a ready project's configured branches into checkouts a sync cycle
|
|
207
|
-
* may use and checkouts it must skip. A primary clone that is not linked takes
|
|
208
|
-
* every branch with it: nothing can be observed or published through it.
|
|
209
|
-
*/
|
|
210
|
-
export declare function inventoryProjectCheckouts(input: {
|
|
211
|
-
projectRoot: string;
|
|
212
|
-
primaryBranchName: string;
|
|
213
|
-
branchNames: readonly string[];
|
|
214
|
-
}): ProjectCheckoutInventory;
|
|
215
|
-
export declare const PROJECT_REMOVED_CHECKOUTS_DIRECTORY = ".r5d-removed";
|
|
216
|
-
export declare function deleteLinkedProjectBranch(input: {
|
|
217
|
-
projectRoot: string;
|
|
218
|
-
primaryBranchName: string;
|
|
219
|
-
branchName: string;
|
|
220
|
-
}): {
|
|
221
|
-
branchName: string;
|
|
222
|
-
/** Where a path that was not this project's linked worktree was set aside instead of being deleted. */
|
|
223
|
-
movedAsidePath?: string;
|
|
224
|
-
/**
|
|
225
|
-
* Where the linked worktree's tree now waits for garbage collection. The
|
|
226
|
-
* branch is already gone from Git; the caller hands this path to the
|
|
227
|
-
* collector so the recursive removal runs outside every workspace lease.
|
|
228
|
-
*/
|
|
229
|
-
stagedForCollectionPath?: string;
|
|
230
|
-
};
|
|
231
|
-
/**
|
|
232
|
-
* Retire a whole project: one rename into the namespace garbage directory
|
|
233
|
-
* (the tree, primary Git objects included, is removed by the collector
|
|
234
|
-
* outside every lease), or nothing when the root is already gone.
|
|
235
|
-
*/
|
|
236
|
-
export declare function removeProjectWorktrees(input: {
|
|
237
|
-
projectsRoot: string;
|
|
238
|
-
projectRoot: string;
|
|
239
|
-
branchNames: readonly string[];
|
|
240
|
-
}): {
|
|
241
|
-
stagedForCollectionPath?: string;
|
|
242
|
-
};
|
|
243
|
-
export declare function deleteProjectMirrorBranch(input: {
|
|
244
|
-
gitDirectory: string;
|
|
245
|
-
branchName: string;
|
|
246
|
-
mirrorUrl: string;
|
|
247
|
-
credentialHelper?: string | null;
|
|
248
|
-
credentialUsername?: string | null;
|
|
249
|
-
}): Promise<void>;
|
|
250
|
-
export declare function pushProjectMirrorHeads(input: {
|
|
251
|
-
projectRoot: string;
|
|
252
|
-
branchNames: readonly string[];
|
|
253
|
-
mirrorUrl: string;
|
|
254
|
-
credentialHelper?: string | null;
|
|
255
|
-
credentialUsername?: string | null;
|
|
256
|
-
onlyBranches?: ReadonlySet<string>;
|
|
257
|
-
/** Exact pre-projection commits to publish after the outer tree is reachable. */
|
|
258
|
-
publicationHeads?: ReadonlyMap<string, string>;
|
|
259
|
-
/** Hidden-mirror tips observed before the corresponding outer projection. */
|
|
260
|
-
expectedMirrorHeads: ReadonlyMap<string, string | null>;
|
|
261
|
-
/** Durable branch incarnations used to scope server-authored handoff refs. */
|
|
262
|
-
branchIds: ReadonlyMap<string, string>;
|
|
263
|
-
}): Promise<Array<{
|
|
264
|
-
branchName: string;
|
|
265
|
-
head: string;
|
|
266
|
-
pushed: boolean;
|
|
267
|
-
reason?: string;
|
|
268
|
-
}>>;
|
|
269
|
-
export declare function assertProjectMirrorHeadsPushed(results: readonly {
|
|
270
|
-
branchName: string;
|
|
271
|
-
pushed: boolean;
|
|
272
|
-
reason?: string;
|
|
273
|
-
}[]): void;
|
|
274
|
-
type ProjectMirrorHeadUpdateInput = {
|
|
275
|
-
projectRoot: string;
|
|
276
|
-
primaryBranchName: string;
|
|
277
|
-
branchNames: readonly string[];
|
|
278
|
-
mirrorUrl: string;
|
|
279
|
-
credentialHelper?: string | null;
|
|
280
|
-
credentialUsername?: string | null;
|
|
281
|
-
/** Rechecked after fetch and ancestry inspection, immediately before refs or the index move. */
|
|
282
|
-
branchMutationAllowed?: (branchName: string, checkoutPath: string) => boolean;
|
|
283
|
-
};
|
|
284
|
-
export type ProjectMirrorHeadObservation = {
|
|
285
|
-
branchName: string;
|
|
286
|
-
previousHead: string;
|
|
287
|
-
mirrorHead: string | null;
|
|
288
|
-
mode: "fast_forward" | "reseed" | "server_synced";
|
|
289
|
-
serverSyncedWorkspaceHeads: string[];
|
|
290
|
-
shouldMove: boolean;
|
|
291
|
-
};
|
|
292
|
-
/**
|
|
293
|
-
* Fetch and pin the exact hidden-mirror tips that may be applied after a
|
|
294
|
-
* causally later outer-workspace fetch and hydration. Observation deliberately
|
|
295
|
-
* does not mutate a live branch or its index.
|
|
296
|
-
*
|
|
297
|
-
* With `refreshRemote: false` the network fetch is skipped and the tips come
|
|
298
|
-
* from the locally cached `refs/r5d/mirror/*` / `refs/r5d/server-synced/*`
|
|
299
|
-
* refs of an earlier fetch. That is safe in the stale direction (a newer
|
|
300
|
-
* mirror tip waits for a later cycle, exactly like a tip that lands mid-cycle
|
|
301
|
-
* today) and in the fresh direction (hidden-mirror publication is tree-first,
|
|
302
|
-
* so any locally cached tip's covering outer tree was published before the
|
|
303
|
-
* fetch that cached it, hence before this cycle's outer fetch).
|
|
304
|
-
*/
|
|
305
|
-
export declare function observeProjectMirrorHeads(input: Omit<ProjectMirrorHeadUpdateInput, "branchMutationAllowed"> & {
|
|
306
|
-
allowNonFastForward: boolean;
|
|
307
|
-
branchIds?: ReadonlyMap<string, string>;
|
|
308
|
-
refreshRemote?: boolean;
|
|
309
|
-
/**
|
|
310
|
-
* Fetch only these mounts' branch heads and handoff refs, because
|
|
311
|
-
* per-mount token gating found every other mount current. Undefined
|
|
312
|
-
* fetches the whole mirror; an empty set fetches nothing, exactly like
|
|
313
|
-
* `refreshRemote: false`.
|
|
314
|
-
*/
|
|
315
|
-
fetchOnlyBranches?: ReadonlySet<string>;
|
|
316
|
-
}): Promise<ProjectMirrorHeadObservation[]>;
|
|
317
|
-
/**
|
|
318
|
-
* Compute the tokens the locally cached mirror state covers — the project
|
|
319
|
-
* token and one token per mount — from one listing of `refs/r5d/mirror/*` and
|
|
320
|
-
* `refs/r5d/server-synced/*`, with the formula shared with the server. After a
|
|
321
|
-
* fetch these name exactly the canonical state the fetch transferred; after a
|
|
322
|
-
* successful lease push (which updates `refs/r5d/mirror/*` above) they predict
|
|
323
|
-
* the server's next advertisement unless something else also moved the
|
|
324
|
-
* canonical repository, in which case the mismatch fails open into a fetch.
|
|
325
|
-
*/
|
|
326
|
-
export declare function computeLocalProjectMirrorRefsTokens(input: {
|
|
327
|
-
projectRoot: string;
|
|
328
|
-
primaryBranchName: string;
|
|
329
|
-
mounts: readonly ProjectMirrorMount[];
|
|
330
|
-
}): Promise<ProjectMirrorRefsTokens>;
|
|
331
|
-
/** Apply only previously observed object ids; this function never refetches. */
|
|
332
|
-
export declare function applyObservedProjectMirrorHeads(input: {
|
|
333
|
-
projectRoot: string;
|
|
334
|
-
primaryBranchName: string;
|
|
335
|
-
observations: readonly ProjectMirrorHeadObservation[];
|
|
336
|
-
/** Rechecked immediately before refs or the index move. */
|
|
337
|
-
branchMutationAllowed?: (branchName: string, checkoutPath: string) => boolean;
|
|
338
|
-
/** Proves the visible outer workspace has hydrated the server commit's exact source generation. */
|
|
339
|
-
serverSyncedWorkspaceCovered?: (observation: ProjectMirrorHeadObservation) => Promise<boolean>;
|
|
340
|
-
}): Promise<Array<{
|
|
341
|
-
branchName: string;
|
|
342
|
-
previousHead: string;
|
|
343
|
-
mirrorHead: string | null;
|
|
344
|
-
moved: boolean;
|
|
345
|
-
}>>;
|
|
346
|
-
export declare function fastForwardProjectHeadsFromMirror(input: ProjectMirrorHeadUpdateInput): Promise<Array<{
|
|
347
|
-
branchName: string;
|
|
348
|
-
previousHead: string;
|
|
349
|
-
mirrorHead: string | null;
|
|
350
|
-
fastForwarded: boolean;
|
|
351
|
-
}>>;
|
|
352
|
-
export declare function reseedProjectHeadsFromMirror(input: ProjectMirrorHeadUpdateInput): Promise<Array<{
|
|
353
|
-
branchName: string;
|
|
354
|
-
previousHead: string;
|
|
355
|
-
mirrorHead: string | null;
|
|
356
|
-
reseeded: boolean;
|
|
357
|
-
}>>;
|
|
358
|
-
/** Executor job body: `snapshotBranchTrees` with progress relayed to the control thread. */
|
|
359
|
-
export declare function runProjectSnapshotCreateJob(input: {
|
|
360
|
-
projectRoot: string;
|
|
361
|
-
branches: ProjectWorktreeBranch[];
|
|
362
|
-
temporaryRoot: string;
|
|
363
|
-
scope: ProjectWorktreeSnapshotScope;
|
|
364
|
-
ownerSessionId: string;
|
|
365
|
-
}, context: WorkspaceFilesystemJobContext): ProjectWorktreeSnapshot;
|
|
366
|
-
/** Executor job body: mirror captured checkouts back over reconciled worktrees. */
|
|
367
|
-
export declare function runProjectSnapshotApplyJob(input: {
|
|
368
|
-
mirrors: Array<{
|
|
369
|
-
snapshotPath: string;
|
|
370
|
-
targetPath: string;
|
|
371
|
-
}>;
|
|
372
|
-
}): null;
|
|
373
|
-
/** Executor job body: `persistReconciledProjectAndConsumeSnapshot`. */
|
|
374
|
-
export declare function runProjectSnapshotPersistJob(input: {
|
|
375
|
-
snapshot: ProjectWorktreeSnapshot;
|
|
376
|
-
durabilityPaths: string[] | null;
|
|
377
|
-
}): null;
|
|
378
|
-
/** Executor job body: `rollbackProjectWorktreeSnapshot`. */
|
|
379
|
-
export declare function runProjectSnapshotRollbackJob(input: {
|
|
380
|
-
snapshot: ProjectWorktreeSnapshot;
|
|
381
|
-
}): null;
|
|
382
|
-
export declare const projectWorktreesTestHarness: {
|
|
383
|
-
commandArgs: typeof gitCommandArgs;
|
|
384
|
-
configureRepository: typeof configureRepository;
|
|
385
|
-
createPreparedSnapshot(input: {
|
|
386
|
-
projectRoot: string;
|
|
387
|
-
branches: readonly ProjectWorktreeBranch[];
|
|
388
|
-
temporaryRoot: string;
|
|
389
|
-
scope?: ProjectWorktreeSnapshotScope;
|
|
390
|
-
}): {
|
|
391
|
-
root: string;
|
|
392
|
-
};
|
|
393
|
-
consumeSnapshot(snapshotRoot: string): void;
|
|
394
|
-
persistProjectAndConsumeSnapshot(snapshotRoot: string, afterProjectTreeFsync?: () => void): void;
|
|
395
|
-
snapshotState(snapshotRoot: string): ProjectWorktreeSnapshotManifest["state"];
|
|
396
|
-
};
|
|
397
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface PtyOutputCoalescerOptions {
|
|
2
|
-
send: (data: string) => void;
|
|
3
|
-
flushIntervalMs?: number;
|
|
4
|
-
maxBufferBytes?: number;
|
|
5
|
-
now?: () => number;
|
|
6
|
-
schedule?: (callback: () => void, delayMs: number) => () => void;
|
|
7
|
-
}
|
|
8
|
-
export interface PtyOutputCoalescer {
|
|
9
|
-
push(data: string): void;
|
|
10
|
-
flush(): void;
|
|
11
|
-
}
|
|
12
|
-
export declare const DEFAULT_PTY_OUTPUT_FLUSH_INTERVAL_MS = 8;
|
|
13
|
-
export declare const DEFAULT_PTY_OUTPUT_MAX_BUFFER_BYTES: number;
|
|
14
|
-
/**
|
|
15
|
-
* Batches PTY output into fewer, larger relay messages. An isolated chunk
|
|
16
|
-
* (an interactive keystroke echo) is sent immediately so coalescing adds no
|
|
17
|
-
* input latency; only sustained bursts (build logs, `cat` of a large file)
|
|
18
|
-
* are buffered, bounded by the flush interval and the buffer byte cap.
|
|
19
|
-
*/
|
|
20
|
-
export declare function createPtyOutputCoalescer(options: PtyOutputCoalescerOptions): PtyOutputCoalescer;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/** Messages between the control thread and the recovery journal thread. */
|
|
2
|
-
export declare const WORKER_RECOVERY_JOURNAL_OPS: readonly ["admit", "readmitUnknownBranchDeletion", "record", "unknown", "unknownRun", "acknowledgeResult", "acknowledgeOutput", "acknowledgeTerminal", "cancelSession", "isRequestCancelled", "operations", "recoveryState", "terminals", "outputReplayBegin", "outputReplayNext", "outputReplayEnd"];
|
|
3
|
-
export type WorkerRecoveryJournalOp = (typeof WORKER_RECOVERY_JOURNAL_OPS)[number];
|
|
4
|
-
export declare function isWorkerRecoveryJournalOp(value: unknown): value is WorkerRecoveryJournalOp;
|
|
5
|
-
export type WorkerRecoveryJournalEntry = {
|
|
6
|
-
seq: number;
|
|
7
|
-
op: WorkerRecoveryJournalOp;
|
|
8
|
-
args: unknown[];
|
|
9
|
-
};
|
|
10
|
-
export type WorkerRecoveryJournalBatchRequest = {
|
|
11
|
-
type: "batch";
|
|
12
|
-
id: number;
|
|
13
|
-
entries: WorkerRecoveryJournalEntry[];
|
|
14
|
-
};
|
|
15
|
-
export type WorkerRecoveryJournalSerializedError = {
|
|
16
|
-
name: string;
|
|
17
|
-
message: string;
|
|
18
|
-
stack?: string;
|
|
19
|
-
};
|
|
20
|
-
export type WorkerRecoveryJournalThreadReply = {
|
|
21
|
-
type: "ready";
|
|
22
|
-
ledgerId: string;
|
|
23
|
-
} | {
|
|
24
|
-
type: "batch_result";
|
|
25
|
-
id: number;
|
|
26
|
-
results: Array<{
|
|
27
|
-
seq: number;
|
|
28
|
-
value: unknown;
|
|
29
|
-
}>;
|
|
30
|
-
} | {
|
|
31
|
-
type: "batch_failure";
|
|
32
|
-
id: number;
|
|
33
|
-
error: WorkerRecoveryJournalSerializedError;
|
|
34
|
-
};
|
|
35
|
-
export declare function serializeWorkerRecoveryJournalError(error: unknown): WorkerRecoveryJournalSerializedError;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { MessagePort } from "node:worker_threads";
|
|
2
|
-
/**
|
|
3
|
-
* The recovery journal thread's loop. It owns the one WorkerRecoveryStore
|
|
4
|
-
* handle of the process and applies the control thread's entries strictly in
|
|
5
|
-
* sequence, one durable commit per batch. Everything the store guarantees
|
|
6
|
-
* (acceptance before effects, offsets, terminal lengths, unknown gating,
|
|
7
|
-
* acknowledgement retention, cancel snapshots) is unchanged; only the thread
|
|
8
|
-
* running it moved. `beforeBatch` exists for the stall fixture used by tests.
|
|
9
|
-
*/
|
|
10
|
-
export declare function serveRecoveryJournal(port: MessagePort, filename: string, hooks?: {
|
|
11
|
-
beforeBatch?: () => void;
|
|
12
|
-
}): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|