@ricsam/r5d-worker 0.0.55 → 0.0.56

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.
@@ -0,0 +1,19 @@
1
+ type WorkspaceCommandTarget = {
2
+ type: "project";
3
+ } | {
4
+ type: "workspace";
5
+ rootProfile: "visible_projects" | "canonical_sync";
6
+ };
7
+ type WorkspaceCommandMutationCoordinator = {
8
+ runMutation<T>(operation: () => Promise<T> | T): Promise<T>;
9
+ acquireMutation(): Promise<() => void>;
10
+ };
11
+ /**
12
+ * Commands in visible checkouts behave like independent Git clients and may
13
+ * overlap periodic synchronization. Canonical remediation commands mutate the
14
+ * sync checkout itself, so they must remain serialized with synchronization.
15
+ */
16
+ export declare function shouldSerializeWorkspaceCommand(target: WorkspaceCommandTarget): boolean;
17
+ export declare function runWorkspaceCommand<T>(target: WorkspaceCommandTarget, coordinator: WorkspaceCommandMutationCoordinator, operation: () => Promise<T> | T): Promise<T>;
18
+ export declare function acquireWorkspaceCommandMutation(target: WorkspaceCommandTarget, coordinator: WorkspaceCommandMutationCoordinator): Promise<(() => void) | undefined>;
19
+ export {};
@@ -4,7 +4,9 @@ export type WorkspaceMutationLease = () => void;
4
4
  *
5
5
  * Ordinary worktree activity may overlap other ordinary activity, but a sync
6
6
  * gets exclusive access. Once a sync is queued, later mutations wait behind it
7
- * so a busy shell cannot starve canonical publication indefinitely.
7
+ * so a queued sync cannot be starved by later short mutations. Long-running
8
+ * visible-checkout commands do not enter this gate; canonical remediation
9
+ * commands do because they operate on the sync checkout itself.
8
10
  */
9
11
  export declare class WorkspaceMutationGate {
10
12
  private activeMutations;
@@ -93,13 +93,24 @@ type GitlinkEntry = {
93
93
  filePath: string;
94
94
  objectId: string;
95
95
  };
96
+ type VisibleHydrationEntry = {
97
+ kind: "blob";
98
+ mode: "100644" | "100755" | "120000";
99
+ objectId: string;
100
+ } | {
101
+ kind: "gitlink";
102
+ objectId: string;
103
+ };
104
+ type VisibleHydrationPreimage = Map<string, VisibleHydrationEntry>;
105
+ type VisibleHydrationPreimages = Map<string, VisibleHydrationPreimage | null>;
96
106
  type GitlinkProjection = {
97
107
  entries: GitlinkEntry[];
98
108
  opaqueRoots: string[];
109
+ visiblePreimages?: VisibleHydrationPreimages;
99
110
  };
100
111
  export declare function assertCanonicalCheckoutIndexMatchesWorktree(checkoutPath: string): void;
101
112
  export declare function mirrorVisibleWorkspaceToShadow(input: WorkspaceSyncInput, excludedCheckouts?: ReadonlySet<string>): GitlinkProjection;
102
- export declare function mirrorShadowWorkspaceToVisible(input: WorkspaceSyncInput, opaqueWorkspaceRoots?: readonly string[]): void;
113
+ export declare function mirrorShadowWorkspaceToVisible(input: WorkspaceSyncInput, opaqueWorkspaceRoots?: readonly string[], hydrationPreimages?: VisibleHydrationPreimages): void;
103
114
  export declare function assertWorkspaceQuarantineRef(quarantineRef: string): void;
104
115
  export declare function synchronizeWorkspace(rawInput: WorkspaceSyncInput): Promise<WorkspaceSyncResult>;
105
116
  export declare function calculateWorkspaceDiffFingerprint(rawInput: WorkspaceSyncInput): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricsam/r5d-worker",
3
- "version": "0.0.55",
3
+ "version": "0.0.56",
4
4
  "type": "module",
5
5
  "main": "./dist/cjs/main.cjs",
6
6
  "module": "./dist/mjs/main.mjs",