@cloop/runner 0.2.4 → 0.2.6
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/{box-ZUDKJY2F.js → box-Q5AA4S2T.js} +62 -22
- package/dist/{chunk-ZDUKQWKA.js → chunk-2SZUL2B6.js} +1 -1
- package/dist/{chunk-KHYA7GEH.js → chunk-52VJGOLJ.js} +1 -1
- package/dist/{chunk-5J4I7DAE.js → chunk-E3V2PRVS.js} +39 -11
- package/dist/{chunk-PBOQMFNN.js → chunk-GTE4QSTR.js} +1 -1
- package/dist/{chunk-M6U2YVEB.js → chunk-H7ZCXBNW.js} +86 -5
- package/dist/chunk-MWWA2VH7.js +224 -0
- package/dist/{chunk-VEVDJ3H3.js → chunk-SXV4JF5H.js} +258 -294
- package/dist/{runs-ZTLNHRRJ.js → chunk-UEV7ARIT.js} +17 -11
- package/dist/chunk-V4IYJUCC.js +250 -0
- package/dist/{connect-WXL6JWJN.js → connect-FG5VDH5N.js} +26 -5
- package/dist/{disconnect-ZAVMFITZ.js → disconnect-ZV32O475.js} +10 -8
- package/dist/index.js +31 -13
- package/dist/{login-MXIM6VMA.js → login-ZKPZEFCV.js} +2 -2
- package/dist/{mcp-server-ADCSP4SY.js → mcp-server-TINABFRL.js} +1 -1
- package/dist/{runner-OVRZFJIY.js → runner-VY3HK7L4.js} +3 -3
- package/dist/runs-QLO2XZVZ.js +25 -0
- package/dist/{statusline-ESZZVOBJ.js → statusline-BWUUERD5.js} +1 -1
- package/dist/takeover-TKQ5V4KV.js +31 -0
- package/dist/use-ALFEOPLY.js +51 -0
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
readRunRecords,
|
|
7
7
|
runLogDir,
|
|
8
8
|
runLogPath
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-E3V2PRVS.js";
|
|
10
10
|
import {
|
|
11
11
|
sanitizeLabel,
|
|
12
12
|
stripControl
|
|
@@ -14,8 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
isLocal,
|
|
16
16
|
readRunnerConfig
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-3DIGCVL4.js";
|
|
17
|
+
} from "./chunk-H7ZCXBNW.js";
|
|
19
18
|
|
|
20
19
|
// src/commands/runs.ts
|
|
21
20
|
import { spawnSync } from "child_process";
|
|
@@ -46,7 +45,7 @@ function resolved(deps) {
|
|
|
46
45
|
function runState(r) {
|
|
47
46
|
if (!r.end) return "running";
|
|
48
47
|
if (r.end.kind === "settled") return "done";
|
|
49
|
-
return r.end.summary === STOPPED_SUMMARY ? "stopped" : "failed";
|
|
48
|
+
return r.end.summary === STOPPED_SUMMARY || r.end.error === "taken_over" ? "stopped" : "failed";
|
|
50
49
|
}
|
|
51
50
|
function recentRuns(records, now) {
|
|
52
51
|
const since = now - RECENT_MS;
|
|
@@ -111,7 +110,9 @@ function runsCommand(deps = {}) {
|
|
|
111
110
|
if (last) out(` ${sanitizeLabel(last, 100)}`);
|
|
112
111
|
}
|
|
113
112
|
out("");
|
|
114
|
-
out(
|
|
113
|
+
out(
|
|
114
|
+
"Follow one with: cloop watch <id>. Carry one on here with: cloop takeover <id>. Open a finished one with: cloop resume <id>"
|
|
115
|
+
);
|
|
115
116
|
return 0;
|
|
116
117
|
}
|
|
117
118
|
function endLine(r) {
|
|
@@ -133,7 +134,9 @@ async function watchCommand(args, deps = {}) {
|
|
|
133
134
|
const path = runLogPath(logDir, run.work_id);
|
|
134
135
|
out(`Watching "${sanitizeLabel(run.title, 120)}"`);
|
|
135
136
|
out(`Repository: ${sanitizeLabel(run.repo, 300)}`);
|
|
136
|
-
out(
|
|
137
|
+
out(
|
|
138
|
+
`Stop it from Threads, or carry it on here with: cloop takeover ${run.work_id.slice(0, SHORT)}`
|
|
139
|
+
);
|
|
137
140
|
out("");
|
|
138
141
|
const print = (line) => {
|
|
139
142
|
if (!isEndLogLine(line)) out(stripControl(line));
|
|
@@ -230,7 +233,9 @@ async function resumeCommand(args, deps = {}) {
|
|
|
230
233
|
if ("run" in found) {
|
|
231
234
|
const r = found.run;
|
|
232
235
|
if (!r.end) {
|
|
233
|
-
err(
|
|
236
|
+
err(
|
|
237
|
+
`It is still running. Follow it with: cloop watch ${r.work_id.slice(0, SHORT)}, or carry it on here with: cloop takeover ${r.work_id.slice(0, SHORT)}`
|
|
238
|
+
);
|
|
234
239
|
return 1;
|
|
235
240
|
}
|
|
236
241
|
if (!existsSync(r.repo)) {
|
|
@@ -253,13 +258,14 @@ async function resumeCommand(args, deps = {}) {
|
|
|
253
258
|
err(found.error);
|
|
254
259
|
return 1;
|
|
255
260
|
}
|
|
261
|
+
|
|
256
262
|
export {
|
|
263
|
+
runState,
|
|
264
|
+
recentRuns,
|
|
257
265
|
findRun,
|
|
258
266
|
lastLines,
|
|
259
|
-
recentRuns,
|
|
260
|
-
resumeCommand,
|
|
261
|
-
runState,
|
|
262
267
|
runsCommand,
|
|
268
|
+
watchCommand,
|
|
263
269
|
sessionFolder,
|
|
264
|
-
|
|
270
|
+
resumeCommand
|
|
265
271
|
};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
findRun
|
|
4
|
+
} from "./chunk-UEV7ARIT.js";
|
|
5
|
+
import {
|
|
6
|
+
localRunsFilePath,
|
|
7
|
+
readRunRecords,
|
|
8
|
+
takeoverSummary
|
|
9
|
+
} from "./chunk-E3V2PRVS.js";
|
|
10
|
+
import {
|
|
11
|
+
sanitizeLabel
|
|
12
|
+
} from "./chunk-VK6GV757.js";
|
|
13
|
+
import {
|
|
14
|
+
lockThreadsFile,
|
|
15
|
+
threadsFilePath
|
|
16
|
+
} from "./chunk-MWWA2VH7.js";
|
|
17
|
+
import {
|
|
18
|
+
isLocal,
|
|
19
|
+
readRunnerConfig
|
|
20
|
+
} from "./chunk-H7ZCXBNW.js";
|
|
21
|
+
import {
|
|
22
|
+
shortMachineName
|
|
23
|
+
} from "./chunk-JX6VG5FE.js";
|
|
24
|
+
|
|
25
|
+
// src/commands/takeover.ts
|
|
26
|
+
import { spawnSync } from "child_process";
|
|
27
|
+
import {
|
|
28
|
+
chmodSync,
|
|
29
|
+
existsSync,
|
|
30
|
+
mkdirSync,
|
|
31
|
+
readFileSync,
|
|
32
|
+
readdirSync,
|
|
33
|
+
renameSync,
|
|
34
|
+
unlinkSync,
|
|
35
|
+
writeFileSync
|
|
36
|
+
} from "fs";
|
|
37
|
+
import { dirname, join } from "path";
|
|
38
|
+
var SAFE_ID = /^[\w-]{1,100}$/;
|
|
39
|
+
var SHORT = 8;
|
|
40
|
+
function takeoverDir(runsFile = localRunsFilePath()) {
|
|
41
|
+
return join(dirname(runsFile), "takeover");
|
|
42
|
+
}
|
|
43
|
+
function writeTakeoverRequest(dir, request) {
|
|
44
|
+
if (!SAFE_ID.test(request.work_id)) return;
|
|
45
|
+
mkdirSync(dir, { recursive: true, mode: 448 });
|
|
46
|
+
const path = join(dir, `${request.work_id}.json`);
|
|
47
|
+
const temp = `${path}.${process.pid}.tmp`;
|
|
48
|
+
writeFileSync(temp, `${JSON.stringify(request)}
|
|
49
|
+
`, { mode: 384 });
|
|
50
|
+
renameSync(temp, path);
|
|
51
|
+
}
|
|
52
|
+
function replyPath(dir, workId) {
|
|
53
|
+
return SAFE_ID.test(workId) ? join(dir, `${workId}.reply`) : null;
|
|
54
|
+
}
|
|
55
|
+
function writeTakeoverReply(dir, workId, error) {
|
|
56
|
+
const path = replyPath(dir, workId);
|
|
57
|
+
if (!path) return;
|
|
58
|
+
mkdirSync(dir, { recursive: true, mode: 448 });
|
|
59
|
+
writeFileSync(path, `${JSON.stringify({ error: error.slice(0, 200) })}
|
|
60
|
+
`, { mode: 384 });
|
|
61
|
+
}
|
|
62
|
+
function takeTakeoverReply(dir, workId) {
|
|
63
|
+
const path = replyPath(dir, workId);
|
|
64
|
+
if (!path) return null;
|
|
65
|
+
let raw;
|
|
66
|
+
try {
|
|
67
|
+
raw = readFileSync(path, "utf-8");
|
|
68
|
+
} catch {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
unlinkSync(path);
|
|
73
|
+
} catch {
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
const error = JSON.parse(raw).error;
|
|
77
|
+
return typeof error === "string" && error ? sanitizeLabel(error, 200) : "unknown";
|
|
78
|
+
} catch {
|
|
79
|
+
return "unknown";
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function takeTakeoverRequests(dir) {
|
|
83
|
+
let names;
|
|
84
|
+
try {
|
|
85
|
+
names = readdirSync(dir).filter((name) => name.endsWith(".json"));
|
|
86
|
+
} catch {
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
const requests = [];
|
|
90
|
+
for (const name of names) {
|
|
91
|
+
const path = join(dir, name);
|
|
92
|
+
try {
|
|
93
|
+
const raw = JSON.parse(readFileSync(path, "utf-8"));
|
|
94
|
+
if (typeof raw.work_id === "string" && SAFE_ID.test(raw.work_id))
|
|
95
|
+
requests.push({
|
|
96
|
+
work_id: raw.work_id,
|
|
97
|
+
machine: sanitizeLabel(String(raw.machine ?? "this machine"), 60),
|
|
98
|
+
at: String(raw.at ?? "")
|
|
99
|
+
});
|
|
100
|
+
} catch {
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
unlinkSync(path);
|
|
104
|
+
} catch {
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return requests;
|
|
108
|
+
}
|
|
109
|
+
function serveTakeovers(driver, log, { dir = takeoverDir(), everyMs = 1e3 } = {}) {
|
|
110
|
+
const tick = () => {
|
|
111
|
+
for (const request of takeTakeoverRequests(dir)) {
|
|
112
|
+
driver.takeOver(request.work_id, request.machine).then(
|
|
113
|
+
(r) => log(`takeover work=${request.work_id} was_running=${r.was_running}`),
|
|
114
|
+
(err) => {
|
|
115
|
+
const error = err instanceof Error ? err.message : String(err);
|
|
116
|
+
log(`takeover work=${request.work_id} refused: ${error}`);
|
|
117
|
+
writeTakeoverReply(dir, request.work_id, error);
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
tick();
|
|
123
|
+
const timer = setInterval(tick, everyMs);
|
|
124
|
+
timer.unref();
|
|
125
|
+
return () => clearInterval(timer);
|
|
126
|
+
}
|
|
127
|
+
function endInFile(file, workId, machine, now) {
|
|
128
|
+
const records = readRunRecords(file);
|
|
129
|
+
const run = records.find((r) => r.work_id === workId);
|
|
130
|
+
if (!run || run.end) return false;
|
|
131
|
+
run.end = {
|
|
132
|
+
kind: "failed",
|
|
133
|
+
summary: takeoverSummary(machine),
|
|
134
|
+
error: "taken_over",
|
|
135
|
+
at: new Date(now).toISOString()
|
|
136
|
+
};
|
|
137
|
+
run.pid = null;
|
|
138
|
+
const temp = `${file}.tmp`;
|
|
139
|
+
writeFileSync(temp, `${JSON.stringify(records, null, 2)}
|
|
140
|
+
`, { mode: 384 });
|
|
141
|
+
chmodSync(temp, 384);
|
|
142
|
+
renameSync(temp, file);
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
function processAlive(pid) {
|
|
146
|
+
try {
|
|
147
|
+
process.kill(pid, 0);
|
|
148
|
+
return true;
|
|
149
|
+
} catch (err) {
|
|
150
|
+
return err.code === "EPERM";
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
var sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
154
|
+
async function takeoverCommand(args, deps = {}) {
|
|
155
|
+
const file = deps.file ?? localRunsFilePath();
|
|
156
|
+
const dir = deps.dir ?? takeoverDir(file);
|
|
157
|
+
const out = deps.out ?? ((line) => console.log(line));
|
|
158
|
+
const err = deps.err ?? ((line) => console.error(line));
|
|
159
|
+
const log = deps.log ?? ((line) => console.error(line));
|
|
160
|
+
const now = deps.now ?? Date.now;
|
|
161
|
+
const started = now();
|
|
162
|
+
const found = findRun(readRunRecords(file), args[0]);
|
|
163
|
+
if ("error" in found) {
|
|
164
|
+
err(found.error);
|
|
165
|
+
return 1;
|
|
166
|
+
}
|
|
167
|
+
const run = found.run;
|
|
168
|
+
const short = run.work_id.slice(0, SHORT);
|
|
169
|
+
if (run.end) {
|
|
170
|
+
err(`This run has ended. Open it with: cloop resume ${short}`);
|
|
171
|
+
return 1;
|
|
172
|
+
}
|
|
173
|
+
const cfg = deps.harness ? null : readRunnerConfig();
|
|
174
|
+
const local = cfg && isLocal(cfg) ? cfg : null;
|
|
175
|
+
const harness = deps.harness ?? local?.driver ?? "claude-code";
|
|
176
|
+
const bin = deps.bin ?? local?.bin ?? (harness === "codex" ? "codex" : "claude");
|
|
177
|
+
const session = run.session_id ?? (harness === "claude-code" ? run.work_id : null);
|
|
178
|
+
if (!session) {
|
|
179
|
+
err("This run has no session yet. Try again in a few seconds.");
|
|
180
|
+
return 1;
|
|
181
|
+
}
|
|
182
|
+
if (!existsSync(run.repo)) {
|
|
183
|
+
err(`The repository ${run.repo} is not on this machine any more.`);
|
|
184
|
+
return 1;
|
|
185
|
+
}
|
|
186
|
+
const machine = deps.machine ?? shortMachineName();
|
|
187
|
+
const fail = (line, reason) => {
|
|
188
|
+
err(line);
|
|
189
|
+
log(`[runner:takeover] work=${run.work_id} outcome=failed reason=${reason}`);
|
|
190
|
+
return 1;
|
|
191
|
+
};
|
|
192
|
+
const lock = (deps.lock ?? (() => lockThreadsFile(threadsFilePath())))();
|
|
193
|
+
let via;
|
|
194
|
+
if (lock.ok) {
|
|
195
|
+
try {
|
|
196
|
+
if (run.pid !== null && (deps.alive ?? processAlive)(run.pid))
|
|
197
|
+
return fail(
|
|
198
|
+
`The runner is not running, but the run's process (pid ${run.pid}) is. Start the runner, or stop the process, then run this again.`,
|
|
199
|
+
"orphan"
|
|
200
|
+
);
|
|
201
|
+
endInFile(file, run.work_id, machine, now());
|
|
202
|
+
} finally {
|
|
203
|
+
lock.release();
|
|
204
|
+
}
|
|
205
|
+
via = "file";
|
|
206
|
+
} else {
|
|
207
|
+
out(`Stopping "${sanitizeLabel(run.title, 120)}" on this machine\u2026`);
|
|
208
|
+
takeTakeoverReply(dir, run.work_id);
|
|
209
|
+
writeTakeoverRequest(dir, {
|
|
210
|
+
work_id: run.work_id,
|
|
211
|
+
machine,
|
|
212
|
+
at: new Date(now()).toISOString()
|
|
213
|
+
});
|
|
214
|
+
const deadline = Date.now() + (deps.waitMs ?? 3e4);
|
|
215
|
+
for (; ; ) {
|
|
216
|
+
const current = readRunRecords(file).find((r) => r.work_id === run.work_id);
|
|
217
|
+
if (current?.end) break;
|
|
218
|
+
const refused = takeTakeoverReply(dir, run.work_id);
|
|
219
|
+
if (refused)
|
|
220
|
+
return fail(
|
|
221
|
+
`The runner could not stop the run (${refused}). Stop it from Threads, then run: cloop resume ${short}`,
|
|
222
|
+
`refused:${refused}`
|
|
223
|
+
);
|
|
224
|
+
if (Date.now() > deadline)
|
|
225
|
+
return fail(
|
|
226
|
+
`The runner did not stop the run. Stop it from Threads, then run: cloop resume ${short}`,
|
|
227
|
+
"daemon_silent"
|
|
228
|
+
);
|
|
229
|
+
await sleep(deps.pollMs ?? 250);
|
|
230
|
+
}
|
|
231
|
+
via = "daemon";
|
|
232
|
+
}
|
|
233
|
+
log(`[runner:takeover] work=${run.work_id} via=${via} ms=${now() - started} outcome=ok`);
|
|
234
|
+
out(`You took this over on ${machine}. Cloop shows the run as stopped.`);
|
|
235
|
+
out(`Opening "${sanitizeLabel(run.title, 120)}" in ${run.repo}`);
|
|
236
|
+
const spawn = deps.spawn ?? ((b, a, cwd) => spawnSync(b, a, { cwd, stdio: "inherit" }).status ?? 1);
|
|
237
|
+
return spawn(bin, harness === "codex" ? ["resume", session] : ["--resume", session], run.repo);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export {
|
|
241
|
+
takeoverDir,
|
|
242
|
+
writeTakeoverRequest,
|
|
243
|
+
replyPath,
|
|
244
|
+
writeTakeoverReply,
|
|
245
|
+
takeTakeoverReply,
|
|
246
|
+
takeTakeoverRequests,
|
|
247
|
+
serveTakeovers,
|
|
248
|
+
endInFile,
|
|
249
|
+
takeoverCommand
|
|
250
|
+
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
DEFAULT_T3_URL,
|
|
4
|
+
DRIVER_NAME,
|
|
5
|
+
T3PairError,
|
|
6
|
+
askHidden,
|
|
4
7
|
askOrClosed,
|
|
5
8
|
askRepos,
|
|
6
9
|
awaitDaemon,
|
|
@@ -9,6 +12,7 @@ import {
|
|
|
9
12
|
connectChosen,
|
|
10
13
|
connectCommand,
|
|
11
14
|
detect,
|
|
15
|
+
ensureLinger,
|
|
12
16
|
fallbackDriver,
|
|
13
17
|
fallbackLine,
|
|
14
18
|
findCheckouts,
|
|
@@ -17,28 +21,38 @@ import {
|
|
|
17
21
|
isWorkstation,
|
|
18
22
|
mintSession,
|
|
19
23
|
notACheckoutLine,
|
|
24
|
+
pairPrompt,
|
|
25
|
+
pairT3,
|
|
20
26
|
parsePicks,
|
|
21
27
|
programFor,
|
|
28
|
+
rememberedDriver,
|
|
22
29
|
rerunCommand,
|
|
23
30
|
resolveRepos,
|
|
24
31
|
revokeReplaced,
|
|
32
|
+
runConnect,
|
|
25
33
|
runSteps,
|
|
34
|
+
sessionFromLink,
|
|
35
|
+
systemServices,
|
|
26
36
|
systemdAssignment,
|
|
27
37
|
systemdWord,
|
|
28
38
|
tilde,
|
|
29
39
|
unitEnv,
|
|
30
40
|
unitFor
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-
|
|
41
|
+
} from "./chunk-SXV4JF5H.js";
|
|
42
|
+
import "./chunk-MWWA2VH7.js";
|
|
43
|
+
import "./chunk-H7ZCXBNW.js";
|
|
33
44
|
import "./chunk-JX6VG5FE.js";
|
|
34
45
|
import "./chunk-R3CLO2FB.js";
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-52VJGOLJ.js";
|
|
47
|
+
import "./chunk-2SZUL2B6.js";
|
|
37
48
|
import "./chunk-AG6SI6I2.js";
|
|
38
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-GTE4QSTR.js";
|
|
39
50
|
import "./chunk-3DIGCVL4.js";
|
|
40
51
|
export {
|
|
41
52
|
DEFAULT_T3_URL,
|
|
53
|
+
DRIVER_NAME,
|
|
54
|
+
T3PairError,
|
|
55
|
+
askHidden,
|
|
42
56
|
askOrClosed,
|
|
43
57
|
askRepos,
|
|
44
58
|
awaitDaemon,
|
|
@@ -47,6 +61,7 @@ export {
|
|
|
47
61
|
connectChosen,
|
|
48
62
|
connectCommand,
|
|
49
63
|
detect,
|
|
64
|
+
ensureLinger,
|
|
50
65
|
fallbackDriver,
|
|
51
66
|
fallbackLine,
|
|
52
67
|
findCheckouts,
|
|
@@ -55,12 +70,18 @@ export {
|
|
|
55
70
|
isWorkstation,
|
|
56
71
|
mintSession,
|
|
57
72
|
notACheckoutLine,
|
|
73
|
+
pairPrompt,
|
|
74
|
+
pairT3,
|
|
58
75
|
parsePicks,
|
|
59
76
|
programFor,
|
|
77
|
+
rememberedDriver,
|
|
60
78
|
rerunCommand,
|
|
61
79
|
resolveRepos,
|
|
62
80
|
revokeReplaced,
|
|
81
|
+
runConnect,
|
|
63
82
|
runSteps,
|
|
83
|
+
sessionFromLink,
|
|
84
|
+
systemServices,
|
|
64
85
|
systemdAssignment,
|
|
65
86
|
systemdWord,
|
|
66
87
|
tilde,
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
localRunsFilePath
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-E3V2PRVS.js";
|
|
5
5
|
import "./chunk-VK6GV757.js";
|
|
6
6
|
import {
|
|
7
7
|
installedService,
|
|
8
8
|
revokeOwnDevice,
|
|
9
9
|
runSteps,
|
|
10
|
-
runnerStatePath,
|
|
11
|
-
threadsFilePath,
|
|
12
10
|
tokenGone
|
|
13
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SXV4JF5H.js";
|
|
12
|
+
import {
|
|
13
|
+
runnerStatePath,
|
|
14
|
+
threadsFilePath
|
|
15
|
+
} from "./chunk-MWWA2VH7.js";
|
|
14
16
|
import {
|
|
15
17
|
boxPath,
|
|
16
18
|
readRunnerConfig
|
|
17
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-H7ZCXBNW.js";
|
|
18
20
|
import "./chunk-JX6VG5FE.js";
|
|
19
21
|
import "./chunk-R3CLO2FB.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-52VJGOLJ.js";
|
|
23
|
+
import "./chunk-2SZUL2B6.js";
|
|
22
24
|
import "./chunk-AG6SI6I2.js";
|
|
23
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-GTE4QSTR.js";
|
|
24
26
|
import {
|
|
25
27
|
getOrigin
|
|
26
28
|
} from "./chunk-3DIGCVL4.js";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
VERSION
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GTE4QSTR.js";
|
|
5
5
|
import {
|
|
6
6
|
applyEnvironmentFlag
|
|
7
7
|
} from "./chunk-3DIGCVL4.js";
|
|
@@ -22,9 +22,15 @@ Usage:
|
|
|
22
22
|
cloop hook session-start Claude Code SessionStart hook (reads JSON on stdin)
|
|
23
23
|
cloop hook activity Lifecycle hook: records what this session is doing
|
|
24
24
|
cloop connect [--repo <path>]... [--driver t3|claude-code|codex] [--fallback-model <list>]
|
|
25
|
-
[--no-service] [--no-start] [--ask-everything]
|
|
25
|
+
[--no-service] [--no-start] [--ask-everything] [--t3-pair <link>]
|
|
26
26
|
Make this machine a Cloop runner: T3 Code, else
|
|
27
|
-
Claude Code or Codex in the repos you name
|
|
27
|
+
Claude Code or Codex in the repos you name.
|
|
28
|
+
When T3 Code will not pair by itself, paste a
|
|
29
|
+
link from T3 Code (Settings, Connections,
|
|
30
|
+
Create pairing link) at the question, or pass
|
|
31
|
+
it with --t3-pair
|
|
32
|
+
cloop use t3|claude-code|codex Run Cloop work here with that harness. It reconnects
|
|
33
|
+
this machine, swaps its service, and keeps the choice
|
|
28
34
|
cloop disconnect [--yes] Stop being a Cloop runner: revoke this computer on
|
|
29
35
|
Cloop, remove its service and runner files
|
|
30
36
|
cloop box connect cloop connect with T3 Code forced
|
|
@@ -32,6 +38,8 @@ Usage:
|
|
|
32
38
|
cloop runs List this machine's runs: open ones, and the last 24 hours
|
|
33
39
|
cloop watch [id] Follow a run as it works. No id: the newest open run.
|
|
34
40
|
Stop it from Threads.
|
|
41
|
+
cloop takeover [id] Stop a running Claude Code or Codex run and carry it on
|
|
42
|
+
in this terminal. No id: the newest open run.
|
|
35
43
|
cloop resume <id> Open a finished run in Claude Code, in its repository
|
|
36
44
|
cloop runner register --webhook <url> --label <name> [--reactivate] [--rotate-secret]
|
|
37
45
|
Register a cloud runner endpoint
|
|
@@ -47,7 +55,7 @@ async function main() {
|
|
|
47
55
|
switch (command) {
|
|
48
56
|
case "login":
|
|
49
57
|
case "auth": {
|
|
50
|
-
const { loginCommand } = await import("./login-
|
|
58
|
+
const { loginCommand } = await import("./login-ZKPZEFCV.js");
|
|
51
59
|
await loginCommand(argv);
|
|
52
60
|
break;
|
|
53
61
|
}
|
|
@@ -57,47 +65,57 @@ async function main() {
|
|
|
57
65
|
break;
|
|
58
66
|
}
|
|
59
67
|
case "serve": {
|
|
60
|
-
const { startMcpServer } = await import("./mcp-server-
|
|
68
|
+
const { startMcpServer } = await import("./mcp-server-TINABFRL.js");
|
|
61
69
|
await startMcpServer();
|
|
62
70
|
break;
|
|
63
71
|
}
|
|
64
72
|
case "statusline": {
|
|
65
|
-
const { statuslineCommand } = await import("./statusline-
|
|
73
|
+
const { statuslineCommand } = await import("./statusline-BWUUERD5.js");
|
|
66
74
|
statuslineCommand();
|
|
67
75
|
break;
|
|
68
76
|
}
|
|
69
77
|
case "connect": {
|
|
70
|
-
const { connectCommand } = await import("./connect-
|
|
78
|
+
const { connectCommand } = await import("./connect-FG5VDH5N.js");
|
|
71
79
|
await connectCommand(argv.slice(1));
|
|
72
80
|
break;
|
|
73
81
|
}
|
|
82
|
+
case "use": {
|
|
83
|
+
const { useCommand } = await import("./use-ALFEOPLY.js");
|
|
84
|
+
process.exitCode = await useCommand(argv.slice(1));
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
74
87
|
case "disconnect": {
|
|
75
|
-
const { disconnectCommand } = await import("./disconnect-
|
|
88
|
+
const { disconnectCommand } = await import("./disconnect-ZV32O475.js");
|
|
76
89
|
await disconnectCommand(argv.slice(1));
|
|
77
90
|
break;
|
|
78
91
|
}
|
|
79
92
|
case "box": {
|
|
80
|
-
const { boxCommand } = await import("./box-
|
|
93
|
+
const { boxCommand } = await import("./box-Q5AA4S2T.js");
|
|
81
94
|
await boxCommand(argv.slice(1));
|
|
82
95
|
break;
|
|
83
96
|
}
|
|
84
97
|
case "runs": {
|
|
85
|
-
const { runsCommand } = await import("./runs-
|
|
98
|
+
const { runsCommand } = await import("./runs-QLO2XZVZ.js");
|
|
86
99
|
process.exitCode = runsCommand();
|
|
87
100
|
break;
|
|
88
101
|
}
|
|
89
102
|
case "watch": {
|
|
90
|
-
const { watchCommand } = await import("./runs-
|
|
103
|
+
const { watchCommand } = await import("./runs-QLO2XZVZ.js");
|
|
91
104
|
process.exitCode = await watchCommand(argv.slice(1));
|
|
92
105
|
break;
|
|
93
106
|
}
|
|
107
|
+
case "takeover": {
|
|
108
|
+
const { takeoverCommand } = await import("./takeover-TKQ5V4KV.js");
|
|
109
|
+
process.exitCode = await takeoverCommand(argv.slice(1));
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
94
112
|
case "resume": {
|
|
95
|
-
const { resumeCommand } = await import("./runs-
|
|
113
|
+
const { resumeCommand } = await import("./runs-QLO2XZVZ.js");
|
|
96
114
|
process.exitCode = await resumeCommand(argv.slice(1));
|
|
97
115
|
break;
|
|
98
116
|
}
|
|
99
117
|
case "runner": {
|
|
100
|
-
const { runnerCommand } = await import("./runner-
|
|
118
|
+
const { runnerCommand } = await import("./runner-VY3HK7L4.js");
|
|
101
119
|
await runnerCommand(argv.slice(1));
|
|
102
120
|
break;
|
|
103
121
|
}
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
deviceLogin,
|
|
4
4
|
loginCommand,
|
|
5
5
|
refusalSentence
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2SZUL2B6.js";
|
|
7
7
|
import "./chunk-AG6SI6I2.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-GTE4QSTR.js";
|
|
9
9
|
import "./chunk-3DIGCVL4.js";
|
|
10
10
|
export {
|
|
11
11
|
deviceLogin,
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
connectWebhook,
|
|
4
4
|
runnerCommand
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-52VJGOLJ.js";
|
|
6
|
+
import "./chunk-2SZUL2B6.js";
|
|
7
7
|
import "./chunk-AG6SI6I2.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-GTE4QSTR.js";
|
|
9
9
|
import "./chunk-3DIGCVL4.js";
|
|
10
10
|
export {
|
|
11
11
|
connectWebhook,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
findRun,
|
|
4
|
+
lastLines,
|
|
5
|
+
recentRuns,
|
|
6
|
+
resumeCommand,
|
|
7
|
+
runState,
|
|
8
|
+
runsCommand,
|
|
9
|
+
sessionFolder,
|
|
10
|
+
watchCommand
|
|
11
|
+
} from "./chunk-UEV7ARIT.js";
|
|
12
|
+
import "./chunk-E3V2PRVS.js";
|
|
13
|
+
import "./chunk-VK6GV757.js";
|
|
14
|
+
import "./chunk-H7ZCXBNW.js";
|
|
15
|
+
import "./chunk-3DIGCVL4.js";
|
|
16
|
+
export {
|
|
17
|
+
findRun,
|
|
18
|
+
lastLines,
|
|
19
|
+
recentRuns,
|
|
20
|
+
resumeCommand,
|
|
21
|
+
runState,
|
|
22
|
+
runsCommand,
|
|
23
|
+
sessionFolder,
|
|
24
|
+
watchCommand
|
|
25
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
endInFile,
|
|
4
|
+
replyPath,
|
|
5
|
+
serveTakeovers,
|
|
6
|
+
takeTakeoverReply,
|
|
7
|
+
takeTakeoverRequests,
|
|
8
|
+
takeoverCommand,
|
|
9
|
+
takeoverDir,
|
|
10
|
+
writeTakeoverReply,
|
|
11
|
+
writeTakeoverRequest
|
|
12
|
+
} from "./chunk-V4IYJUCC.js";
|
|
13
|
+
import "./chunk-UEV7ARIT.js";
|
|
14
|
+
import "./chunk-E3V2PRVS.js";
|
|
15
|
+
import "./chunk-VK6GV757.js";
|
|
16
|
+
import "./chunk-MWWA2VH7.js";
|
|
17
|
+
import "./chunk-H7ZCXBNW.js";
|
|
18
|
+
import "./chunk-JX6VG5FE.js";
|
|
19
|
+
import "./chunk-AG6SI6I2.js";
|
|
20
|
+
import "./chunk-3DIGCVL4.js";
|
|
21
|
+
export {
|
|
22
|
+
endInFile,
|
|
23
|
+
replyPath,
|
|
24
|
+
serveTakeovers,
|
|
25
|
+
takeTakeoverReply,
|
|
26
|
+
takeTakeoverRequests,
|
|
27
|
+
takeoverCommand,
|
|
28
|
+
takeoverDir,
|
|
29
|
+
writeTakeoverReply,
|
|
30
|
+
writeTakeoverRequest
|
|
31
|
+
};
|