riftri 0.4.1 → 0.5.1
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 +1 -1
- package/bin/riftri.js +20 -5
- package/lib/client.d.ts +2 -0
- package/lib/client.js +5 -0
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -163,7 +163,7 @@ $ sudo riftri overlayfs install-helper
|
|
|
163
163
|
|
|
164
164
|
**Riftri fails closed.** When a checkout cannot be reproduced exactly — custom
|
|
165
165
|
filters, a repository's own sparse-checkout profile, submodules, external
|
|
166
|
-
attributes,
|
|
166
|
+
attributes, or non-canonical [Git LFS](docs/git-lfs.md) setups
|
|
167
167
|
— it stops before changing anything rather than silently falling back to a full
|
|
168
168
|
copy. Sparse worktrees are supported when you ask for them explicitly, with
|
|
169
169
|
[`--sparse-dir` cone selection](docs/sparse-checkout.md). See
|
package/bin/riftri.js
CHANGED
|
@@ -18,11 +18,6 @@ try {
|
|
|
18
18
|
fail(error instanceof Error ? error.message : String(error));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const child = spawn(binary, process.argv.slice(2), {
|
|
22
|
-
stdio: "inherit",
|
|
23
|
-
windowsHide: false,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
21
|
// Mirror the termination contract of native `riftri exec` (docs/cli.md) while
|
|
27
22
|
// the native process runs. The launcher survives SIGINT (Ctrl-C) and SIGQUIT
|
|
28
23
|
// (Ctrl-\): a terminal delivers both to the whole foreground process group,
|
|
@@ -37,10 +32,21 @@ const child = spawn(binary, process.argv.slice(2), {
|
|
|
37
32
|
const ignoredSignals = ["SIGINT", "SIGQUIT"];
|
|
38
33
|
const forwardedSignals = ["SIGTERM", "SIGHUP"];
|
|
39
34
|
const ignoreSignal = () => {};
|
|
35
|
+
let child;
|
|
36
|
+
const pendingForwardedSignals = [];
|
|
40
37
|
const forwardSignal = (signal) => {
|
|
38
|
+
if (child === undefined) {
|
|
39
|
+
pendingForwardedSignals.push(signal);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
41
42
|
child.kill(signal);
|
|
42
43
|
};
|
|
43
44
|
|
|
45
|
+
// Arm the policy before starting the child. A fast child can write to the
|
|
46
|
+
// inherited terminal before `spawn` returns in the launcher process; callers
|
|
47
|
+
// commonly treat that output as readiness and may immediately signal the
|
|
48
|
+
// foreground process group. Installing these handlers after `spawn` left a
|
|
49
|
+
// window where that SIGINT still had its default, fatal disposition.
|
|
44
50
|
if (process.platform !== "win32") {
|
|
45
51
|
for (const signal of ignoredSignals) {
|
|
46
52
|
process.on(signal, ignoreSignal);
|
|
@@ -50,6 +56,15 @@ if (process.platform !== "win32") {
|
|
|
50
56
|
}
|
|
51
57
|
}
|
|
52
58
|
|
|
59
|
+
child = spawn(binary, process.argv.slice(2), {
|
|
60
|
+
stdio: "inherit",
|
|
61
|
+
windowsHide: false,
|
|
62
|
+
});
|
|
63
|
+
for (const signal of pendingForwardedSignals) {
|
|
64
|
+
child.kill(signal);
|
|
65
|
+
}
|
|
66
|
+
pendingForwardedSignals.length = 0;
|
|
67
|
+
|
|
53
68
|
// The handlers deliberately stay installed until the process exits. Removing
|
|
54
69
|
// the last listener for a signal restores its default disposition, so a SIGINT
|
|
55
70
|
// still in flight — the common case, since the terminal sent it to the whole
|
package/lib/client.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export class RiftriError extends Error {
|
|
|
36
36
|
readonly isUsageError: boolean;
|
|
37
37
|
/** A live process holds the lock; waiting and retrying is correct. */
|
|
38
38
|
readonly isBusy: boolean;
|
|
39
|
+
/** Free space on the affected volume before following recovery guidance. */
|
|
40
|
+
readonly isStorageFull: boolean;
|
|
39
41
|
/** Run `receipt.nextCommand` before continuing. */
|
|
40
42
|
readonly needsRepair: boolean;
|
|
41
43
|
}
|
package/lib/client.js
CHANGED
|
@@ -62,6 +62,11 @@ class RiftriError extends Error {
|
|
|
62
62
|
return this.receipt?.code === "worktree-busy";
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/** The affected volume needs free space before recovery can proceed. */
|
|
66
|
+
get isStorageFull() {
|
|
67
|
+
return this.receipt?.code === "storage-full";
|
|
68
|
+
}
|
|
69
|
+
|
|
65
70
|
/** Run `nextCommand` (usually `riftri repair`) before continuing. */
|
|
66
71
|
get needsRepair() {
|
|
67
72
|
return this.receipt?.recovery === "required";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "riftri",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Experimental lightweight Git workspaces for parallel development",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Assistant UI contributors",
|
|
@@ -18,14 +18,14 @@
|
|
|
18
18
|
"node": ">=18.18"
|
|
19
19
|
},
|
|
20
20
|
"optionalDependencies": {
|
|
21
|
-
"riftri-darwin-arm64": "0.
|
|
22
|
-
"riftri-darwin-x64": "0.
|
|
23
|
-
"riftri-linux-arm64-gnu": "0.
|
|
24
|
-
"riftri-linux-arm64-musl": "0.
|
|
25
|
-
"riftri-linux-x64-gnu": "0.
|
|
26
|
-
"riftri-linux-x64-musl": "0.
|
|
27
|
-
"riftri-win32-arm64": "0.
|
|
28
|
-
"riftri-win32-x64": "0.
|
|
21
|
+
"riftri-darwin-arm64": "0.5.1",
|
|
22
|
+
"riftri-darwin-x64": "0.5.1",
|
|
23
|
+
"riftri-linux-arm64-gnu": "0.5.1",
|
|
24
|
+
"riftri-linux-arm64-musl": "0.5.1",
|
|
25
|
+
"riftri-linux-x64-gnu": "0.5.1",
|
|
26
|
+
"riftri-linux-x64-musl": "0.5.1",
|
|
27
|
+
"riftri-win32-arm64": "0.5.1",
|
|
28
|
+
"riftri-win32-x64": "0.5.1"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|