@openlatch/client 0.6.1 → 0.6.3
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/lib/postinstall.js +2 -0
- package/lib/resolve-binary.js +30 -3
- package/package.json +6 -6
package/lib/postinstall.js
CHANGED
|
@@ -68,6 +68,8 @@ function downloadBinaries() {
|
|
|
68
68
|
fs.mkdirSync(binDir, { recursive: true });
|
|
69
69
|
|
|
70
70
|
const binaries = ["openlatch", "openlatch-hook"];
|
|
71
|
+
// The Cline runtime launcher (Cline I-5, D-06) ships on Windows only.
|
|
72
|
+
if (os.platform() === "win32") binaries.push("openlatch-cline-runtime");
|
|
71
73
|
|
|
72
74
|
for (const binaryName of binaries) {
|
|
73
75
|
const assetName = `${binaryName}-${rustTarget}${ext}`;
|
package/lib/resolve-binary.js
CHANGED
|
@@ -45,6 +45,15 @@ function resolveCandidate(baseName) {
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
// The Cline runtime launcher (Cline I-5, D-06) ships in the win32 package only. `openlatch`
|
|
49
|
+
// copies it into <ol_dir>/bin from its OWN directory, so it must travel beside the pair
|
|
50
|
+
// wherever this file moves the pair. Absent from an older package, it is simply not copied.
|
|
51
|
+
const LAUNCHER = "openlatch-cline-runtime";
|
|
52
|
+
|
|
53
|
+
function launcherName() {
|
|
54
|
+
return os.platform() === "win32" ? `${LAUNCHER}.exe` : null;
|
|
55
|
+
}
|
|
56
|
+
|
|
48
57
|
function openlatchDir() {
|
|
49
58
|
return process.env.OPENLATCH_DIR || path.join(os.homedir(), ".openlatch");
|
|
50
59
|
}
|
|
@@ -104,6 +113,10 @@ function preservePreGuardEvaluator(state) {
|
|
|
104
113
|
fs.copyFileSync(runningHook, path.join(root, `openlatch-hook${ext}`));
|
|
105
114
|
fs.chmodSync(path.join(root, `openlatch${ext}`), 0o755);
|
|
106
115
|
fs.chmodSync(path.join(root, `openlatch-hook${ext}`), 0o755);
|
|
116
|
+
const launcher = launcherName();
|
|
117
|
+
if (launcher && fs.existsSync(path.join(runningDir, launcher))) {
|
|
118
|
+
fs.copyFileSync(path.join(runningDir, launcher), path.join(root, launcher));
|
|
119
|
+
}
|
|
107
120
|
const preserved = { ...state, current: root, previous: null };
|
|
108
121
|
writeState(preserved);
|
|
109
122
|
return preserved;
|
|
@@ -122,10 +135,15 @@ function replacePairAtRecordedPaths(executable, hook, state) {
|
|
|
122
135
|
}
|
|
123
136
|
return;
|
|
124
137
|
}
|
|
125
|
-
|
|
138
|
+
const pairs = [
|
|
126
139
|
[`openlatch${ext}`, executable],
|
|
127
140
|
[`openlatch-hook${ext}`, hook],
|
|
128
|
-
]
|
|
141
|
+
];
|
|
142
|
+
const launcher = launcherName();
|
|
143
|
+
if (launcher && fs.existsSync(path.join(state.current, launcher))) {
|
|
144
|
+
pairs.push([launcher, path.join(path.dirname(executable), launcher)]);
|
|
145
|
+
}
|
|
146
|
+
for (const [sourceName, destination] of pairs) {
|
|
129
147
|
const source = path.join(state.current, sourceName);
|
|
130
148
|
const temporary = `${destination}.reader-restore`;
|
|
131
149
|
fs.copyFileSync(source, temporary);
|
|
@@ -159,13 +177,22 @@ function activateCandidate() {
|
|
|
159
177
|
const ext = os.platform() === "win32" ? ".exe" : "";
|
|
160
178
|
const stagedExe = path.join(root, `openlatch${ext}`);
|
|
161
179
|
const stagedHook = path.join(root, `openlatch-hook${ext}`);
|
|
180
|
+
const launcher = launcherName() ? resolveCandidate(LAUNCHER) : null;
|
|
181
|
+
const hasLauncher = Boolean(launcher && fs.existsSync(launcher));
|
|
182
|
+
const stagedLauncher = hasLauncher ? path.join(root, launcherName()) : null;
|
|
162
183
|
const existing = readState();
|
|
163
|
-
if (
|
|
184
|
+
if (
|
|
185
|
+
existing.current === root &&
|
|
186
|
+
fs.existsSync(stagedExe) &&
|
|
187
|
+
fs.existsSync(stagedHook) &&
|
|
188
|
+
(!hasLauncher || fs.existsSync(stagedLauncher))
|
|
189
|
+
) {
|
|
164
190
|
return existing;
|
|
165
191
|
}
|
|
166
192
|
fs.mkdirSync(root, { recursive: true });
|
|
167
193
|
fs.copyFileSync(executable, stagedExe);
|
|
168
194
|
fs.copyFileSync(hook, stagedHook);
|
|
195
|
+
if (hasLauncher) fs.copyFileSync(launcher, stagedLauncher);
|
|
169
196
|
if (os.platform() !== "win32") {
|
|
170
197
|
fs.chmodSync(stagedExe, 0o755);
|
|
171
198
|
fs.chmodSync(stagedHook, 0o755);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openlatch/client",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "OpenLatch runtime enforcement node — the capture-and-enforce adapter that evaluates every covered action against a coding agent's Autonomy Zone before it runs",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"postinstall": "node lib/postinstall.js"
|
|
21
21
|
},
|
|
22
22
|
"optionalDependencies": {
|
|
23
|
-
"@openlatch/client-darwin-arm64": "0.6.
|
|
24
|
-
"@openlatch/client-darwin-x64": "0.6.
|
|
25
|
-
"@openlatch/client-linux-x64": "0.6.
|
|
26
|
-
"@openlatch/client-linux-arm64": "0.6.
|
|
27
|
-
"@openlatch/client-win32-x64": "0.6.
|
|
23
|
+
"@openlatch/client-darwin-arm64": "0.6.3",
|
|
24
|
+
"@openlatch/client-darwin-x64": "0.6.3",
|
|
25
|
+
"@openlatch/client-linux-x64": "0.6.3",
|
|
26
|
+
"@openlatch/client-linux-arm64": "0.6.3",
|
|
27
|
+
"@openlatch/client-win32-x64": "0.6.3"
|
|
28
28
|
}
|
|
29
29
|
}
|