@sma1lboy/kobe 0.8.84 → 0.8.85
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 +5 -2
- package/dist/cli/index.js +386 -398
- package/dist/cli/kobe.js +957 -0
- package/dist/cli/pty-host-node.mjs +19 -9
- package/dist/cli/rove.js +957 -0
- package/package.json +5 -3
|
@@ -193,6 +193,16 @@ function requireString(payload, key) {
|
|
|
193
193
|
import { createHash } from "node:crypto";
|
|
194
194
|
import { homedir, tmpdir } from "node:os";
|
|
195
195
|
import { join } from "node:path";
|
|
196
|
+
|
|
197
|
+
// ../kobe-daemon/src/compat-env.ts
|
|
198
|
+
var ROVE_ENV_PREFIX = "ROVE_";
|
|
199
|
+
var LEGACY_KOBE_ENV_PREFIX = "KOBE_";
|
|
200
|
+
var COMPAT_STATE_DIR_BASENAME = ".kobe";
|
|
201
|
+
function readRoveEnv(suffix, env = process.env) {
|
|
202
|
+
return env[`${ROVE_ENV_PREFIX}${suffix}`] ?? env[`${LEGACY_KOBE_ENV_PREFIX}${suffix}`];
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// ../kobe-daemon/src/daemon/paths.ts
|
|
196
206
|
var SOCKET_PATH_SAFETY_LIMIT = 100;
|
|
197
207
|
function shortHomeTag(homeDir) {
|
|
198
208
|
return createHash("sha1").update(homeDir).digest("hex").slice(0, 8);
|
|
@@ -214,30 +224,30 @@ function windowsPipePath(homeDir, role) {
|
|
|
214
224
|
return `\\\\.\\pipe\\kobe-${shortHomeTag(homeDir)}-${role}`;
|
|
215
225
|
}
|
|
216
226
|
function defaultPtyHostSocketPath(homeDir, platform = process.platform) {
|
|
217
|
-
const override =
|
|
227
|
+
const override = readRoveEnv("PTY_SOCKET_PATH");
|
|
218
228
|
if (override && override.length > 0)
|
|
219
229
|
return override;
|
|
220
|
-
const explicit = homeDir ??
|
|
230
|
+
const explicit = homeDir ?? readRoveEnv("HOME_DIR");
|
|
221
231
|
if (platform === "win32")
|
|
222
232
|
return windowsPipePath(explicit || homedir(), "pty");
|
|
223
233
|
if (explicit && explicit.length > 0) {
|
|
224
|
-
return fitSocketPath(join(explicit,
|
|
234
|
+
return fitSocketPath(join(explicit, COMPAT_STATE_DIR_BASENAME, "pty.sock"), explicit, "pty");
|
|
225
235
|
}
|
|
226
236
|
const runtimeDir = process.env.XDG_RUNTIME_DIR;
|
|
227
237
|
if (runtimeDir && runtimeDir.length > 0) {
|
|
228
238
|
return fitSocketPath(join(runtimeDir, "kobe-pty.sock"), runtimeDir, "pty");
|
|
229
239
|
}
|
|
230
240
|
const home = homedir();
|
|
231
|
-
return fitSocketPath(join(home,
|
|
241
|
+
return fitSocketPath(join(home, COMPAT_STATE_DIR_BASENAME, "pty.sock"), home, "pty");
|
|
232
242
|
}
|
|
233
|
-
function defaultPtyHostPidPath(homeDir =
|
|
234
|
-
const override =
|
|
243
|
+
function defaultPtyHostPidPath(homeDir = readRoveEnv("HOME_DIR") ?? homedir()) {
|
|
244
|
+
const override = readRoveEnv("PTY_PID_PATH");
|
|
235
245
|
if (override && override.length > 0)
|
|
236
246
|
return override;
|
|
237
|
-
return join(homeDir,
|
|
247
|
+
return join(homeDir, COMPAT_STATE_DIR_BASENAME, "pty.pid");
|
|
238
248
|
}
|
|
239
|
-
function defaultPtyExitsPath(homeDir =
|
|
240
|
-
return join(homeDir,
|
|
249
|
+
function defaultPtyExitsPath(homeDir = readRoveEnv("HOME_DIR") ?? homedir()) {
|
|
250
|
+
return join(homeDir, COMPAT_STATE_DIR_BASENAME, "pty-exits.json");
|
|
241
251
|
}
|
|
242
252
|
// ../kobe-plugin-sdk/src/contract.ts
|
|
243
253
|
var DAEMON_CHANNELS = [
|