@ricsam/r5d-worker 0.0.36 → 0.0.37
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/cjs/main.cjs +225 -520
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/workspace-sync.cjs +652 -0
- package/dist/mjs/main.mjs +230 -518
- package/dist/mjs/package.json +1 -1
- package/dist/mjs/workspace-sync.mjs +607 -0
- package/dist/types/main.d.ts +0 -50
- package/dist/types/workspace-sync.d.ts +73 -0
- package/package.json +1 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare const WORKSPACE_BRANCH = "main";
|
|
2
|
+
export declare const MAX_WORKSPACE_SYNC_DIFF_BYTES: number;
|
|
3
|
+
export declare const WORKSPACE_PERIODIC_SCAN_INTERVAL_MS = 5000;
|
|
4
|
+
export type WorkspaceProjectManifestEntry = {
|
|
5
|
+
projectId: string;
|
|
6
|
+
repoSlug: string;
|
|
7
|
+
projectPath: string;
|
|
8
|
+
repoHttpUrl: string | null;
|
|
9
|
+
repoAuthHeader: string | null;
|
|
10
|
+
defaultBranch: string;
|
|
11
|
+
branches: string[];
|
|
12
|
+
};
|
|
13
|
+
export type WorkspaceSyncTrigger = {
|
|
14
|
+
type: "connect" | "inbound_head" | "write" | "edit" | "plan_write" | "task_status" | "shell_inline" | "process_terminal" | "process_cancel" | "periodic" | "manual" | "remediation" | "remediation_confirm" | "remediation_reset";
|
|
15
|
+
sessionId?: string;
|
|
16
|
+
processRunId?: string;
|
|
17
|
+
toolCallId?: string;
|
|
18
|
+
projectId?: string;
|
|
19
|
+
branchName?: string;
|
|
20
|
+
detail?: string;
|
|
21
|
+
};
|
|
22
|
+
export type WorkspaceSyncOutcome = "no_change" | "published" | "updated" | "conflict_reset" | "large_diff_blocked" | "reset" | "failed";
|
|
23
|
+
export type WorkspaceSyncResult = {
|
|
24
|
+
type: "workspace_sync";
|
|
25
|
+
attemptId: string;
|
|
26
|
+
workerLabel: string;
|
|
27
|
+
trigger: WorkspaceSyncTrigger;
|
|
28
|
+
outcome: WorkspaceSyncOutcome;
|
|
29
|
+
startingHead: string | null;
|
|
30
|
+
candidateHead?: string;
|
|
31
|
+
publishedHead?: string;
|
|
32
|
+
rebaseCount: number;
|
|
33
|
+
diffSizeBytes: number;
|
|
34
|
+
gitStatus: string;
|
|
35
|
+
affectedProjects: string[];
|
|
36
|
+
affectedPaths: string[];
|
|
37
|
+
discardedPaths: string[];
|
|
38
|
+
localChangesDiscarded: boolean;
|
|
39
|
+
error?: string;
|
|
40
|
+
};
|
|
41
|
+
export type WorkspaceSyncInput = {
|
|
42
|
+
attemptId?: string;
|
|
43
|
+
workerLabel: string;
|
|
44
|
+
remoteUrl: string;
|
|
45
|
+
authHeader?: string;
|
|
46
|
+
projectsRoot: string;
|
|
47
|
+
plansRoot: string;
|
|
48
|
+
shadowRoot: string;
|
|
49
|
+
projects: WorkspaceProjectManifestEntry[];
|
|
50
|
+
trigger: WorkspaceSyncTrigger;
|
|
51
|
+
confirmedLargeDiff?: boolean;
|
|
52
|
+
confirmationReason?: string;
|
|
53
|
+
resetToCanonical?: boolean;
|
|
54
|
+
skipVisibleMirror?: boolean;
|
|
55
|
+
newVisibleCheckouts?: Array<{
|
|
56
|
+
projectId: string;
|
|
57
|
+
branchName: string;
|
|
58
|
+
}>;
|
|
59
|
+
};
|
|
60
|
+
export declare function encodeWorkspaceBranch(branchName: string): string;
|
|
61
|
+
export declare function workspaceProjectBranchRelativePath(projectId: string, branchName: string): string;
|
|
62
|
+
export declare function workspacePlansRelativePath(projectId: string, branchName: string): string;
|
|
63
|
+
export declare function visibleProjectBranchPath(projectsRoot: string, manifest: WorkspaceProjectManifestEntry, branchName: string): string;
|
|
64
|
+
export declare function mirrorVisibleWorkspaceToShadow(input: WorkspaceSyncInput, excludedCheckouts?: ReadonlySet<string>): void;
|
|
65
|
+
export declare function mirrorShadowWorkspaceToVisible(input: WorkspaceSyncInput): void;
|
|
66
|
+
export declare function synchronizeWorkspace(rawInput: WorkspaceSyncInput): Promise<WorkspaceSyncResult>;
|
|
67
|
+
export declare function calculateWorkspaceDiffFingerprint(input: WorkspaceSyncInput): string;
|
|
68
|
+
export declare class WorkspaceSyncSingleFlight {
|
|
69
|
+
private queue;
|
|
70
|
+
run(input: WorkspaceSyncInput): Promise<WorkspaceSyncResult>;
|
|
71
|
+
fingerprint(input: WorkspaceSyncInput): Promise<string>;
|
|
72
|
+
afterCurrent(): Promise<void>;
|
|
73
|
+
}
|