@akshar5/cohall 0.12.11 → 0.12.13
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/CHANGELOG.md +31 -0
- package/README.md +15 -5
- package/bin/{chunk-8w5szr2v.js → chunk-1w61mtsq.js} +2 -2
- package/bin/{chunk-pen1bdmd.js → chunk-2y4g3v66.js} +106 -25
- package/bin/chunk-2y4g3v66.js.map +13 -0
- package/bin/{chunk-808wdkdd.js → chunk-61fzgtwp.js} +1 -1
- package/bin/{chunk-ydpe597h.js → chunk-8zk47d0f.js} +29 -12
- package/bin/chunk-8zk47d0f.js.map +11 -0
- package/bin/{chunk-mwgjve0a.js → chunk-ccfjcqrz.js} +16 -14
- package/bin/chunk-ccfjcqrz.js.map +11 -0
- package/bin/{chunk-t26anmqq.js → chunk-f9qd4ajk.js} +16 -12
- package/bin/chunk-f9qd4ajk.js.map +10 -0
- package/bin/{chunk-cdpcpqte.js → chunk-fg90k4rs.js} +23 -9
- package/bin/chunk-fg90k4rs.js.map +15 -0
- package/bin/{chunk-gwqa0ajn.js → chunk-m5ecnn3k.js} +2 -2
- package/bin/{chunk-gwqa0ajn.js.map → chunk-m5ecnn3k.js.map} +1 -1
- package/bin/{chunk-8662zgwj.js → chunk-mnz2sma9.js} +1 -1
- package/bin/{chunk-1frv7xwq.js → chunk-q6dqsm9t.js} +15 -6
- package/bin/chunk-q6dqsm9t.js.map +10 -0
- package/bin/{chunk-swqxs7nr.js → chunk-zwf5dpj9.js} +63 -11
- package/bin/chunk-zwf5dpj9.js.map +14 -0
- package/bin/cohall.js +7 -7
- package/docs/install.md +2 -2
- package/docs/integrations.md +34 -9
- package/docs/services.md +25 -6
- package/package.json +1 -1
- package/bin/chunk-1frv7xwq.js.map +0 -10
- package/bin/chunk-cdpcpqte.js.map +0 -15
- package/bin/chunk-mwgjve0a.js.map +0 -11
- package/bin/chunk-pen1bdmd.js.map +0 -13
- package/bin/chunk-swqxs7nr.js.map +0 -14
- package/bin/chunk-t26anmqq.js.map +0 -10
- package/bin/chunk-ydpe597h.js.map +0 -11
- /package/bin/{chunk-8w5szr2v.js.map → chunk-1w61mtsq.js.map} +0 -0
- /package/bin/{chunk-808wdkdd.js.map → chunk-61fzgtwp.js.map} +0 -0
- /package/bin/{chunk-8662zgwj.js.map → chunk-mnz2sma9.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.12.13](https://github.com/AksharP5/cohall/compare/v0.12.12...v0.12.13) (2026-11-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **cli:** keep following traces through relay restarts ([#279](https://github.com/AksharP5/cohall/issues/279)) ([2c2b48c](https://github.com/AksharP5/cohall/commit/2c2b48c36aab293101c8750388c04488e4d8e644))
|
|
9
|
+
* **device:** stop overdue work promptly after the device wakes from sleep ([#286](https://github.com/AksharP5/cohall/issues/286)) ([018a506](https://github.com/AksharP5/cohall/commit/018a506a222981c0b7ca4ea1a09819b6f57726b2))
|
|
10
|
+
* **mcp:** keep OpenCode waiting for delegated work past 60 seconds ([#296](https://github.com/AksharP5/cohall/issues/296)) ([e014f31](https://github.com/AksharP5/cohall/commit/e014f31f4290b5008a7f1fad1a030bd5f5847741))
|
|
11
|
+
* **mcp:** let Codex wait for delegated work past 5 minutes ([#298](https://github.com/AksharP5/cohall/issues/298)) ([c6dfc72](https://github.com/AksharP5/cohall/commit/c6dfc72236e31107254ae0ad93d12157ccbb9caf))
|
|
12
|
+
* **providers:** keep thread follow-ups working after the provider loses its session ([#292](https://github.com/AksharP5/cohall/issues/292)) ([2f78cc4](https://github.com/AksharP5/cohall/commit/2f78cc485c798d89b690713bb8e422b02b573b64))
|
|
13
|
+
* **providers:** run OpenCode in the task workspace when the worker was started from a terminal ([#294](https://github.com/AksharP5/cohall/issues/294)) ([b0f1655](https://github.com/AksharP5/cohall/commit/b0f1655e41cef99355ee49a3024f4d4e3c028e7d))
|
|
14
|
+
* **providers:** stop OpenCode follow-ups from hanging when the workspace changes ([#300](https://github.com/AksharP5/cohall/issues/300)) ([e725951](https://github.com/AksharP5/cohall/commit/e725951a009fbd4b07f61f9febef310f02eecb30))
|
|
15
|
+
* **relay:** keep delegated child tasks within their parent's deadline ([#277](https://github.com/AksharP5/cohall/issues/277)) ([8f14865](https://github.com/AksharP5/cohall/commit/8f14865195eedae69f46d9052f6e1829c44f44be))
|
|
16
|
+
* **relay:** keep relay backups to the three documented files ([#281](https://github.com/AksharP5/cohall/issues/281)) ([b4396a1](https://github.com/AksharP5/cohall/commit/b4396a1e059423a96bc26383583706283ef82149))
|
|
17
|
+
* **relay:** reject untargeted follow-ups while the thread's device is offline ([#290](https://github.com/AksharP5/cohall/issues/290)) ([79a3514](https://github.com/AksharP5/cohall/commit/79a35143bffe16b2a12e43f3269c84e6b43c4377))
|
|
18
|
+
* **relay:** route untargeted work to idle devices before busy ones ([#283](https://github.com/AksharP5/cohall/issues/283)) ([422799d](https://github.com/AksharP5/cohall/commit/422799dd7d52c08118f6449f7f75d3b3e361c04b))
|
|
19
|
+
* **relay:** stop delegated child tasks when their parent is cancelled ([#288](https://github.com/AksharP5/cohall/issues/288)) ([06a3b1a](https://github.com/AksharP5/cohall/commit/06a3b1af07a9499ec2bb842f929bb32183a629fc))
|
|
20
|
+
|
|
21
|
+
## [0.12.12](https://github.com/AksharP5/cohall/compare/v0.12.11...v0.12.12) (2026-11-10)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **client:** show why the relay could not be reached ([#269](https://github.com/AksharP5/cohall/issues/269)) ([9fec7e3](https://github.com/AksharP5/cohall/commit/9fec7e35e18b2720ed28002d8920741b2c8aaa62))
|
|
27
|
+
* **device:** log why the relay rejects the worker connection ([#267](https://github.com/AksharP5/cohall/issues/267)) ([5b9f224](https://github.com/AksharP5/cohall/commit/5b9f2249d95bb640958cc95d51cbd261706788dc))
|
|
28
|
+
* **mcp:** let Codex pass delegated task IDs to Cohall MCP ([#271](https://github.com/AksharP5/cohall/issues/271)) ([cf1d77a](https://github.com/AksharP5/cohall/commit/cf1d77a82722fe60ceb37534ab5566e49a397414))
|
|
29
|
+
* **providers:** read Claude Code results when verbose output is on ([#275](https://github.com/AksharP5/cohall/issues/275)) ([7b5092b](https://github.com/AksharP5/cohall/commit/7b5092b44037c50fdd8fd2e9b02191acfca7841f))
|
|
30
|
+
* **providers:** stop OpenCode shell commands when a task is cancelled ([#273](https://github.com/AksharP5/cohall/issues/273)) ([0b915c1](https://github.com/AksharP5/cohall/commit/0b915c1a10dd1696d6f85c2a1907e5c5699f92b4))
|
|
31
|
+
* **relay:** keep untargeted thread follow-ups on the thread's device ([#262](https://github.com/AksharP5/cohall/issues/262)) ([0a86ec3](https://github.com/AksharP5/cohall/commit/0a86ec3b5602536b2f2e9c5822f52ada09627f6c))
|
|
32
|
+
* **setup:** keep the worker credential when repairing client access ([#265](https://github.com/AksharP5/cohall/issues/265)) ([8673caf](https://github.com/AksharP5/cohall/commit/8673caf2df9efcb4ace3df3eba4ed75d2e5d04a6))
|
|
33
|
+
|
|
3
34
|
## [0.12.11](https://github.com/AksharP5/cohall/compare/v0.12.10...v0.12.11) (2026-11-10)
|
|
4
35
|
|
|
5
36
|
|
package/README.md
CHANGED
|
@@ -310,13 +310,23 @@ worker before using deadlines. Named Grok Bots do not support them.
|
|
|
310
310
|
See [task deadlines](docs/integrations.md#task-deadlines) for details.
|
|
311
311
|
|
|
312
312
|
Reuse the returned `thread_id` for follow-ups so the target resumes its provider
|
|
313
|
-
session.
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
313
|
+
session. Without `--target`, a follow-up prefers that device. If it is offline,
|
|
314
|
+
Cohall rejects the follow-up instead of starting over on another device; pass
|
|
315
|
+
`--target` to queue it for that device or to start a new session on another.
|
|
316
|
+
Queued follow-ups pick up the preceding turn's session when they start,
|
|
317
|
+
including after a worker restart. If the provider no longer has that session,
|
|
318
|
+
for example after its history was cleared, the turn starts a new session and
|
|
319
|
+
its result says that earlier turns were not available. OpenCode resumes a
|
|
320
|
+
session only in the directory where it started, so an OpenCode follow-up in a
|
|
321
|
+
different workspace, or one whose session is no longer among that project's 100
|
|
322
|
+
most recently updated, also starts a new session.
|
|
323
|
+
|
|
324
|
+
Delegated child tasks inherit their parent's thread. Coding children also inherit
|
|
325
|
+
the parent's deadline unless they set an earlier one. Cohall routes them away
|
|
317
326
|
from unfinished ancestors using the same worker slot, and rejects an explicit
|
|
318
327
|
target that would make them wait on an ancestor. A Bot can still delegate to
|
|
319
|
-
Codex or a different Bot on its own computer.
|
|
328
|
+
Codex or a different Bot on its own computer. Cancelling a task also cancels its
|
|
329
|
+
unfinished child tasks; a running Bot child finishes its current turn.
|
|
320
330
|
|
|
321
331
|
## Talk to your Grok Bots
|
|
322
332
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readMcpHostDiagnostics
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-61fzgtwp.js";
|
|
4
4
|
import"./chunk-p493vm5f.js";
|
|
5
5
|
import {
|
|
6
6
|
configurationPath
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import"./chunk-04a27ybz.js";
|
|
9
9
|
import {
|
|
10
10
|
version
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-m5ecnn3k.js";
|
|
12
12
|
|
|
13
13
|
// apps/device/src/mcp-diagnostics.ts
|
|
14
14
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import { Effect, Schema } from "effect";
|
|
19
19
|
import { execa } from "execa";
|
|
20
20
|
import { accessSync, constants, statSync } from "node:fs";
|
|
21
|
-
import { chmod, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
21
|
+
import { chmod, mkdtemp, realpath, rm, writeFile } from "node:fs/promises";
|
|
22
22
|
import { homedir, platform, tmpdir } from "node:os";
|
|
23
23
|
import { delimiter, extname, isAbsolute, join, resolve } from "node:path";
|
|
24
24
|
import { execFile } from "node:child_process";
|
|
@@ -42,6 +42,8 @@ var executables = {
|
|
|
42
42
|
var providerEnvironment = () => ({
|
|
43
43
|
...Object.fromEntries(Object.entries(process.env).filter(([name]) => {
|
|
44
44
|
const key = platform() === "win32" ? name.toUpperCase() : name;
|
|
45
|
+
if (key === "PWD")
|
|
46
|
+
return false;
|
|
45
47
|
return !key.startsWith("COHALL_") || key === "COHALL_CONFIG";
|
|
46
48
|
})),
|
|
47
49
|
...process.env.COHALL_CONFIG === undefined ? {} : { COHALL_CONFIG: resolve(process.env.COHALL_CONFIG) },
|
|
@@ -166,6 +168,8 @@ var claudeCommand = (options) => [
|
|
|
166
168
|
"-p",
|
|
167
169
|
"--output-format",
|
|
168
170
|
"json",
|
|
171
|
+
"--settings",
|
|
172
|
+
JSON.stringify({ verbose: false }),
|
|
169
173
|
...options.filesDirectory === undefined ? [] : ["--add-dir", options.filesDirectory],
|
|
170
174
|
...options.model === undefined ? [] : ["--model", options.model],
|
|
171
175
|
...options.sessionId === undefined ? [] : ["--resume", options.sessionId]
|
|
@@ -448,9 +452,9 @@ var processExists = (pid) => {
|
|
|
448
452
|
throw cause;
|
|
449
453
|
}
|
|
450
454
|
};
|
|
451
|
-
var
|
|
455
|
+
var waitForProcessGroups = async (groups, timeoutMs) => {
|
|
452
456
|
const deadline = Date.now() + timeoutMs;
|
|
453
|
-
while (processExists
|
|
457
|
+
while (groups.some(processExists)) {
|
|
454
458
|
if (Date.now() >= deadline) {
|
|
455
459
|
return false;
|
|
456
460
|
}
|
|
@@ -458,6 +462,40 @@ var waitForProcessGroup = async (pid, timeoutMs) => {
|
|
|
458
462
|
}
|
|
459
463
|
return true;
|
|
460
464
|
};
|
|
465
|
+
var processGroups = (pid) => new Promise((resolve2) => {
|
|
466
|
+
execFile("/bin/ps", ["-A", "-o", "pid=,ppid=,pgid="], (error, stdout) => {
|
|
467
|
+
const children = new Map;
|
|
468
|
+
for (const line of error === null ? stdout.split(`
|
|
469
|
+
`) : []) {
|
|
470
|
+
const [child, parent, pgid] = line.trim().split(/\s+/).map(Number);
|
|
471
|
+
if (child === undefined || parent === undefined || pgid === undefined)
|
|
472
|
+
continue;
|
|
473
|
+
children.set(parent, [...children.get(parent) ?? [], { pid: child, pgid }]);
|
|
474
|
+
}
|
|
475
|
+
const groups = new Set([pid]);
|
|
476
|
+
const pending = [pid];
|
|
477
|
+
for (let parent = pending.pop();parent !== undefined; parent = pending.pop()) {
|
|
478
|
+
for (const child of children.get(parent) ?? []) {
|
|
479
|
+
if (child.pgid > 1)
|
|
480
|
+
groups.add(child.pgid);
|
|
481
|
+
pending.push(child.pid);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
resolve2([...groups]);
|
|
485
|
+
});
|
|
486
|
+
});
|
|
487
|
+
var signalGroups = (groups, signal) => {
|
|
488
|
+
for (const group of groups) {
|
|
489
|
+
try {
|
|
490
|
+
process.kill(-group, signal);
|
|
491
|
+
} catch (cause) {
|
|
492
|
+
if (typeof cause === "object" && cause !== null && "code" in cause && cause.code === "ESRCH") {
|
|
493
|
+
continue;
|
|
494
|
+
}
|
|
495
|
+
throw cause;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
};
|
|
461
499
|
var terminateWindowsTree = (pid) => new Promise((resolve2) => {
|
|
462
500
|
const systemRoot = process.env.SystemRoot ?? "C:\\Windows";
|
|
463
501
|
execFile(join(systemRoot, "System32", "taskkill.exe"), ["/PID", String(pid), "/T", "/F"], { windowsHide: true }, () => resolve2());
|
|
@@ -467,22 +505,16 @@ var terminateProcessTree = async (pid) => {
|
|
|
467
505
|
await terminateWindowsTree(pid);
|
|
468
506
|
return;
|
|
469
507
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
if (typeof cause === "object" && cause !== null && "code" in cause && cause.code === "ESRCH") {
|
|
474
|
-
return;
|
|
475
|
-
}
|
|
476
|
-
throw cause;
|
|
477
|
-
}
|
|
478
|
-
if (await waitForProcessGroup(pid, 5000)) {
|
|
508
|
+
const groups = await processGroups(pid);
|
|
509
|
+
signalGroups(groups, "SIGTERM");
|
|
510
|
+
if (await waitForProcessGroups(groups, 5000)) {
|
|
479
511
|
return;
|
|
480
512
|
}
|
|
481
|
-
|
|
482
|
-
await
|
|
513
|
+
signalGroups(groups, "SIGKILL");
|
|
514
|
+
await waitForProcessGroups(groups, 1000);
|
|
483
515
|
};
|
|
484
516
|
var settlePromise = (promise) => promise.then((value) => ({ _tag: "Success", value }), (error) => ({ _tag: "Failure", error }));
|
|
485
|
-
var
|
|
517
|
+
var runOnce = (options) => Effect.callback((resume, signal) => {
|
|
486
518
|
const running = (async () => {
|
|
487
519
|
const executable = findExecutable(executables[options.provider]);
|
|
488
520
|
if (executable === undefined) {
|
|
@@ -612,6 +644,55 @@ var run = (options) => Effect.callback((resume, signal) => {
|
|
|
612
644
|
return;
|
|
613
645
|
}));
|
|
614
646
|
});
|
|
647
|
+
var missingSession = {
|
|
648
|
+
codex: (message, sessionId) => message.includes(`no rollout found for thread id ${sessionId}`),
|
|
649
|
+
"claude-code": (message, sessionId) => message.includes(`No conversation found with session ID: ${sessionId}`),
|
|
650
|
+
opencode: (message) => message.trimEnd().endsWith("Session not found")
|
|
651
|
+
};
|
|
652
|
+
var openCodeSessionIn = (cwd, sessionId) => Effect.tryPromise({
|
|
653
|
+
try: async (signal) => {
|
|
654
|
+
const executable = findExecutable(executables.opencode);
|
|
655
|
+
if (executable === undefined)
|
|
656
|
+
return true;
|
|
657
|
+
const [directory, { stdout }] = await Promise.all([
|
|
658
|
+
realpath(cwd),
|
|
659
|
+
execa(executable, ["session", "list", "--format", "json"], {
|
|
660
|
+
cwd,
|
|
661
|
+
env: providerEnvironment(),
|
|
662
|
+
extendEnv: false,
|
|
663
|
+
stdin: "ignore",
|
|
664
|
+
cancelSignal: signal
|
|
665
|
+
})
|
|
666
|
+
]);
|
|
667
|
+
const sessions = JSON.parse(stdout || "[]");
|
|
668
|
+
return Array.isArray(sessions) && sessions.some((session) => record(session)?.id === sessionId && record(session)?.directory === directory);
|
|
669
|
+
},
|
|
670
|
+
catch: (cause) => new ProviderRunError({
|
|
671
|
+
provider: "opencode",
|
|
672
|
+
message: (cause instanceof Error ? cause.message : String(cause)).slice(0, 16384)
|
|
673
|
+
})
|
|
674
|
+
});
|
|
675
|
+
var run = (options) => {
|
|
676
|
+
const { sessionId, ...fresh } = options;
|
|
677
|
+
if (sessionId === undefined)
|
|
678
|
+
return runOnce(options);
|
|
679
|
+
const startOver = runOnce({
|
|
680
|
+
...fresh,
|
|
681
|
+
prompt: `Earlier turns of this thread are no longer available on this device. If this task depends on them, say so or request input instead of guessing.
|
|
682
|
+
|
|
683
|
+
${options.prompt}`
|
|
684
|
+
}).pipe(Effect.map((turn) => {
|
|
685
|
+
const notice = `
|
|
686
|
+
|
|
687
|
+
[Started a new ${executables[options.provider]} session: this thread's previous session is not available for this workspace on this device, so this turn did not see earlier turns.]`;
|
|
688
|
+
return {
|
|
689
|
+
...turn,
|
|
690
|
+
result: `${turn.result.slice(0, maxResultBytes - notice.length)}${notice}`
|
|
691
|
+
};
|
|
692
|
+
}));
|
|
693
|
+
const resumable = options.provider === "opencode" ? openCodeSessionIn(options.cwd, sessionId) : Effect.succeed(true);
|
|
694
|
+
return resumable.pipe(Effect.flatMap((resume) => resume ? runOnce(options).pipe(Effect.catchIf((error) => error._tag === "CohallProvider.RunError" && missingSession[options.provider](error.message, sessionId), () => startOver)) : startOver));
|
|
695
|
+
};
|
|
615
696
|
|
|
616
697
|
// apps/device/src/bot-replies.ts
|
|
617
698
|
import { Schema as Schema2 } from "effect";
|
|
@@ -1120,7 +1201,7 @@ import {
|
|
|
1120
1201
|
mkdir as mkdir2,
|
|
1121
1202
|
readFile,
|
|
1122
1203
|
readdir,
|
|
1123
|
-
realpath,
|
|
1204
|
+
realpath as realpath2,
|
|
1124
1205
|
rename,
|
|
1125
1206
|
rm as rm2,
|
|
1126
1207
|
stat,
|
|
@@ -1227,7 +1308,7 @@ var packageInstallation = (canonicalEntrypoint, entrypoint = canonicalEntrypoint
|
|
|
1227
1308
|
return { manager: "npm", prefix, entrypoint };
|
|
1228
1309
|
};
|
|
1229
1310
|
var resolvePackageInstallation = async (entrypoint, options = {}) => {
|
|
1230
|
-
const canonicalEntrypoint = await
|
|
1311
|
+
const canonicalEntrypoint = await realpath2(entrypoint);
|
|
1231
1312
|
const runtimePlatform = options.platform ?? process.platform;
|
|
1232
1313
|
const installation = packageInstallation(canonicalEntrypoint, resolve2(entrypoint), runtimePlatform);
|
|
1233
1314
|
if (installation.manager !== "pnpm") {
|
|
@@ -1235,10 +1316,10 @@ var resolvePackageInstallation = async (entrypoint, options = {}) => {
|
|
|
1235
1316
|
if (installation.manager === "npm" && prefix !== undefined) {
|
|
1236
1317
|
const packageEntry2 = join3(prefix, ...runtimePlatform === "win32" ? [] : ["lib"], "node_modules", packageName, "bin", "cohall.js");
|
|
1237
1318
|
const command = join3(prefix, ...runtimePlatform === "win32" ? [] : ["bin"], "cohall");
|
|
1238
|
-
const globalCommand = runtimePlatform === "win32" ? await readFile(`${command}.cmd`, "utf8").then((shim) => /"%dp0%\\node_modules\\@akshar5\\cohall\\bin\\cohall\.js"\s+%\*/i.test(shim)).catch(() => false) : await
|
|
1319
|
+
const globalCommand = runtimePlatform === "win32" ? await readFile(`${command}.cmd`, "utf8").then((shim) => /"%dp0%\\node_modules\\@akshar5\\cohall\\bin\\cohall\.js"\s+%\*/i.test(shim)).catch(() => false) : await realpath2(command).catch(() => {
|
|
1239
1320
|
return;
|
|
1240
1321
|
}) === canonicalEntrypoint;
|
|
1241
|
-
if (globalCommand && await
|
|
1322
|
+
if (globalCommand && await realpath2(packageEntry2).catch(() => {
|
|
1242
1323
|
return;
|
|
1243
1324
|
}) === canonicalEntrypoint)
|
|
1244
1325
|
return {
|
|
@@ -1254,7 +1335,7 @@ var resolvePackageInstallation = async (entrypoint, options = {}) => {
|
|
|
1254
1335
|
if (bun !== undefined) {
|
|
1255
1336
|
const result2 = await (options.runner ?? defaultRunner).run(bun, ["pm", "ls", "--global"], 1e4);
|
|
1256
1337
|
const root2 = result2.stdout.split(/\r?\n/, 1)[0]?.match(/^(.*?) node_modules \(\d+(?: installed)?\)$/)?.[1];
|
|
1257
|
-
if (result2.exitCode === 0 && root2 !== undefined && isAbsolute2(root2) && await
|
|
1338
|
+
if (result2.exitCode === 0 && root2 !== undefined && isAbsolute2(root2) && await realpath2(join3(root2, "node_modules", packageName, "bin", "cohall.js")).catch(() => {
|
|
1258
1339
|
return;
|
|
1259
1340
|
}) === canonicalEntrypoint)
|
|
1260
1341
|
return {
|
|
@@ -1293,7 +1374,7 @@ var resolvePackageInstallation = async (entrypoint, options = {}) => {
|
|
|
1293
1374
|
...entries.filter((entry) => entry.isSymbolicLink()).map((entry) => packageEntry(join3(globalRoot, entry.name)))
|
|
1294
1375
|
];
|
|
1295
1376
|
for (const candidate of candidates) {
|
|
1296
|
-
if (await
|
|
1377
|
+
if (await realpath2(candidate).catch(() => {
|
|
1297
1378
|
return;
|
|
1298
1379
|
}) === canonicalEntrypoint)
|
|
1299
1380
|
return {
|
|
@@ -1380,7 +1461,7 @@ var isTrustedGroupWritablePath = (options) => {
|
|
|
1380
1461
|
return options.platform === "darwin" && options.uid !== undefined && options.ownerUid === options.uid && options.ownerGid === macosAdminGroup && macosHomebrewRoots.some((root) => containsPath(root, options.canonical) && containsPath(root, options.path));
|
|
1381
1462
|
};
|
|
1382
1463
|
var validateExecutable = async (candidate, preserveSymlink = false) => {
|
|
1383
|
-
const canonical = await
|
|
1464
|
+
const canonical = await realpath2(candidate);
|
|
1384
1465
|
if (operatingSystem() === "win32") {
|
|
1385
1466
|
return preserveSymlink ? resolve2(candidate) : canonical;
|
|
1386
1467
|
}
|
|
@@ -1634,7 +1715,7 @@ ${result.stderr}`);
|
|
|
1634
1715
|
if (serviceEntrypoint === undefined) {
|
|
1635
1716
|
throw new Error(`Could not determine the executable used by active ${service.label}${service.manager === "scheduled-task" ? ". Reinstall the task with cohall service install." : ""}`);
|
|
1636
1717
|
}
|
|
1637
|
-
const canonicalServiceEntrypoint = await
|
|
1718
|
+
const canonicalServiceEntrypoint = await realpath2(serviceEntrypoint).catch((cause) => {
|
|
1638
1719
|
throw new Error(`Could not resolve the executable used by active ${service.label}: ${cause instanceof Error ? cause.message : String(cause)}`);
|
|
1639
1720
|
});
|
|
1640
1721
|
if (canonicalServiceEntrypoint === installation.canonicalEntrypoint) {
|
|
@@ -1662,7 +1743,7 @@ var writeReceipt = async (path, value) => {
|
|
|
1662
1743
|
await rename(temporary, path);
|
|
1663
1744
|
};
|
|
1664
1745
|
var installedVersion = async (entrypoint) => {
|
|
1665
|
-
const canonicalEntrypoint = await
|
|
1746
|
+
const canonicalEntrypoint = await realpath2(entrypoint);
|
|
1666
1747
|
const metadata = JSON.parse(await readFile(join3(dirname2(dirname2(canonicalEntrypoint)), "package.json"), "utf8"));
|
|
1667
1748
|
if (typeof metadata !== "object" || metadata === null || !("name" in metadata) || metadata.name !== packageName || !("version" in metadata) || typeof metadata.version !== "string") {
|
|
1668
1749
|
throw new Error(`Could not verify the installed ${packageName} version`);
|
|
@@ -1901,4 +1982,4 @@ var upgrade = async (options) => {
|
|
|
1901
1982
|
|
|
1902
1983
|
export { ProviderRunError, findExecutable, availableProviders, run, writeBotReply, cleanupBotReply, discoverGrokBots, runGrokBot, normalizeUpgradeTarget, deviceVersionWarning, resolvePackageInstallation, pnpmServiceDirectories, trustedExecutable, serviceCandidates, upgrade };
|
|
1903
1984
|
|
|
1904
|
-
//# debugId=
|
|
1985
|
+
//# debugId=892C5F97C04C682464756E2164756E21
|