@cloop/runner 0.2.3 → 0.2.5
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-G6HEXSWY.js → box-S2KILP32.js} +67 -22
- package/dist/{chunk-KKFRQ4HQ.js → chunk-2FLM3ESE.js} +223 -829
- package/dist/{chunk-F4WCO6Z4.js → chunk-4XDYJZLF.js} +1 -1
- package/dist/{chunk-TIXA2YXR.js → chunk-53M5DK6D.js} +1 -1
- package/dist/{chunk-OJ5AREUC.js → chunk-AEWIRLRS.js} +1 -1
- package/dist/{chunk-FW7MMQQV.js → chunk-BFVL3E2C.js} +1 -1
- package/dist/chunk-G6JAEE2Y.js +783 -0
- package/dist/{chunk-CDG4IEQY.js → chunk-KOOAVO2C.js} +186 -30
- package/dist/{chunk-4LFQXBWP.js → chunk-VK6GV757.js} +1 -0
- package/dist/{connect-B5RZDVIW.js → connect-FXO5ETUM.js} +15 -4
- package/dist/{disconnect-MFHVNESG.js → disconnect-EDQ7KXTR.js} +10 -7
- package/dist/{hook-activity-O2NNKTOE.js → hook-activity-R7OPEYBX.js} +2 -2
- package/dist/{hook-session-start-MT67MMDM.js → hook-session-start-GEBGA63R.js} +1 -1
- package/dist/index.js +35 -12
- package/dist/{login-L6J5HPTR.js → login-3HHGBYJ7.js} +2 -2
- package/dist/{mcp-server-Z6MG3AAS.js → mcp-server-FOICWAYA.js} +3 -3
- package/dist/{runner-D6Z5S3VC.js → runner-R7XTMUHH.js} +3 -3
- package/dist/runs-N6RLOEQG.js +265 -0
- package/dist/{statusline-5HLPYTYU.js → statusline-4HJMU355.js} +2 -2
- package/package.json +1 -1
|
@@ -1,19 +1,141 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
stripControl
|
|
4
|
+
} from "./chunk-VK6GV757.js";
|
|
2
5
|
import {
|
|
3
6
|
BoxToolError,
|
|
4
7
|
RESULT_INSTRUCTION,
|
|
5
8
|
orderThreads,
|
|
6
9
|
parseRunResult
|
|
7
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-G6JAEE2Y.js";
|
|
8
11
|
import {
|
|
9
12
|
CONFIG_DIR
|
|
10
13
|
} from "./chunk-3DIGCVL4.js";
|
|
11
14
|
|
|
15
|
+
// src/run-log.ts
|
|
16
|
+
import {
|
|
17
|
+
appendFileSync,
|
|
18
|
+
chmodSync,
|
|
19
|
+
mkdirSync,
|
|
20
|
+
readdirSync,
|
|
21
|
+
renameSync,
|
|
22
|
+
statSync,
|
|
23
|
+
unlinkSync
|
|
24
|
+
} from "fs";
|
|
25
|
+
import { dirname, join } from "path";
|
|
26
|
+
var RUN_LOG_LINE_MAX = 500;
|
|
27
|
+
var RUN_LOG_MAX_BYTES = 5 * 1024 * 1024;
|
|
28
|
+
var RUN_LOG_KEEP_MS = 14 * 24 * 36e5;
|
|
29
|
+
var SAFE_ID = /^[\w-]{1,100}$/;
|
|
30
|
+
function runLogDir(runsFile) {
|
|
31
|
+
return join(dirname(runsFile), "runs");
|
|
32
|
+
}
|
|
33
|
+
function runLogPath(dir, workId) {
|
|
34
|
+
return SAFE_ID.test(workId) ? join(dir, `${workId}.log`) : null;
|
|
35
|
+
}
|
|
36
|
+
var SECRETS = [
|
|
37
|
+
[/-----BEGIN [A-Z ]*PRIVATE KEY-----.*/g, "[redacted private key]"],
|
|
38
|
+
[/\b(Bearer|Basic)\s+[A-Za-z0-9._~+/=-]{8,}/gi, "$1 [redacted]"],
|
|
39
|
+
[/(:\/\/)[^\s/@:]+:[^\s/@]+@/g, "$1[redacted]@"],
|
|
40
|
+
[
|
|
41
|
+
/([?&](?:access_token|token|key|api_key|apikey|secret|sig|signature|code|password)=)[^&\s"']+/gi,
|
|
42
|
+
"$1[redacted]"
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
/(\b(?:[\w-]*(?:token|secret|passw(?:or)?d|pwd|api[_-]?key|apikey|credential|private[_-]?key)[\w-]*|authorization|auth)["']?\s*[=:]\s*["']?)(?!Bearer\b|Basic\b|\[redacted)[^\s"',;}]{4,}/gi,
|
|
46
|
+
"$1[redacted]"
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
/(--?[\w-]*(?:token|secret|password|api-key|apikey)[\w-]*[ =])["']?[^\s"']{4,}["']?/gi,
|
|
50
|
+
"$1[redacted]"
|
|
51
|
+
],
|
|
52
|
+
[/\b(?:sk|pk|rk)-[A-Za-z0-9_-]{16,}/g, "[redacted]"],
|
|
53
|
+
[/\b(?:gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})/g, "[redacted]"],
|
|
54
|
+
[/\bxox[abprs]-[A-Za-z0-9-]{10,}/g, "[redacted]"],
|
|
55
|
+
[/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g, "[redacted]"],
|
|
56
|
+
[/\bAIza[0-9A-Za-z_-]{30,}/g, "[redacted]"],
|
|
57
|
+
[/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{4,}/g, "[redacted]"]
|
|
58
|
+
];
|
|
59
|
+
var OPAQUE = /[A-Za-z0-9_+=-]{32,}/g;
|
|
60
|
+
function redactSecrets(text) {
|
|
61
|
+
let out = text;
|
|
62
|
+
for (const [pattern, replacement] of SECRETS) out = out.replace(pattern, replacement);
|
|
63
|
+
return out.replace(
|
|
64
|
+
OPAQUE,
|
|
65
|
+
(run2) => /^[0-9a-f-]+$/i.test(run2) || !/\d/.test(run2) || !/[A-Za-z]/.test(run2) ? run2 : "[redacted]"
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
function logText(text) {
|
|
69
|
+
const flat = redactSecrets(stripControl(text).replace(/\s+/g, " ").trim());
|
|
70
|
+
return flat.length > RUN_LOG_LINE_MAX ? `${flat.slice(0, RUN_LOG_LINE_MAX - 1)}\u2026` : flat;
|
|
71
|
+
}
|
|
72
|
+
function logLineFor(item) {
|
|
73
|
+
switch (item.type) {
|
|
74
|
+
case "text":
|
|
75
|
+
return item.text;
|
|
76
|
+
case "tool": {
|
|
77
|
+
const input = item.detail ?? item.summary ?? item.target;
|
|
78
|
+
return `> ${item.name}${input ? `: ${input}` : ""}`;
|
|
79
|
+
}
|
|
80
|
+
case "ask":
|
|
81
|
+
return `? ${item.summary}`;
|
|
82
|
+
case "result":
|
|
83
|
+
return item.ok ? `= Result: ${item.text ?? "done"}` : `= Error: ${item.text ?? "no text"}`;
|
|
84
|
+
default:
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function appendRunLog(dir, workId, text, { now = Date.now(), maxBytes = RUN_LOG_MAX_BYTES } = {}) {
|
|
89
|
+
const path = runLogPath(dir, workId);
|
|
90
|
+
if (!path) return;
|
|
91
|
+
const line = `${stamp(now)} ${logText(text)}
|
|
92
|
+
`;
|
|
93
|
+
mkdirSync(dir, { recursive: true, mode: 448 });
|
|
94
|
+
const size = sizeOf(path);
|
|
95
|
+
if (size > 0 && size + Buffer.byteLength(line) > maxBytes) renameSync(path, `${path}.1`);
|
|
96
|
+
appendFileSync(path, line, { mode: 384 });
|
|
97
|
+
}
|
|
98
|
+
function pruneRunLogs(dir, now = Date.now(), keepMs = RUN_LOG_KEEP_MS) {
|
|
99
|
+
mkdirSync(dir, { recursive: true, mode: 448 });
|
|
100
|
+
chmodSync(dir, 448);
|
|
101
|
+
let removed = 0;
|
|
102
|
+
for (const name of readdirSync(dir)) {
|
|
103
|
+
if (!/\.log(\.1)?$/.test(name)) continue;
|
|
104
|
+
const path = join(dir, name);
|
|
105
|
+
try {
|
|
106
|
+
if (statSync(path).mtimeMs < now - keepMs) {
|
|
107
|
+
unlinkSync(path);
|
|
108
|
+
removed++;
|
|
109
|
+
}
|
|
110
|
+
} catch {
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return removed;
|
|
114
|
+
}
|
|
115
|
+
function sizeOf(path) {
|
|
116
|
+
try {
|
|
117
|
+
return statSync(path).size;
|
|
118
|
+
} catch {
|
|
119
|
+
return 0;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
var STOPPED_SUMMARY = "The run was stopped.";
|
|
123
|
+
function endNote(end) {
|
|
124
|
+
return `= ${end.kind === "settled" ? "Done" : "Ended"}: ${end.summary ?? end.kind}`;
|
|
125
|
+
}
|
|
126
|
+
function isEndLogLine(line) {
|
|
127
|
+
return /^\S+ = (Done|Ended): /.test(line);
|
|
128
|
+
}
|
|
129
|
+
function stamp(now) {
|
|
130
|
+
const d = new Date(now);
|
|
131
|
+
return [d.getHours(), d.getMinutes(), d.getSeconds()].map((n) => String(n).padStart(2, "0")).join(":");
|
|
132
|
+
}
|
|
133
|
+
|
|
12
134
|
// src/drivers/local.ts
|
|
13
135
|
import { execFile, execFileSync, spawn } from "child_process";
|
|
14
|
-
import { chmodSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "fs";
|
|
136
|
+
import { chmodSync as chmodSync2, mkdirSync as mkdirSync2, readFileSync, renameSync as renameSync2, writeFileSync } from "fs";
|
|
15
137
|
import { homedir, hostname } from "os";
|
|
16
|
-
import { basename, dirname, join } from "path";
|
|
138
|
+
import { basename, dirname as dirname2, join as join2 } from "path";
|
|
17
139
|
import { createInterface } from "readline";
|
|
18
140
|
var CONTINUE_PROMPT = "Continue the work from where you stopped. If it is already done, say so in one sentence.";
|
|
19
141
|
var PR_URL = /https:\/\/github\.com\/[\w.-]+\/[\w.-]+\/pull\/\d+/g;
|
|
@@ -39,7 +161,7 @@ function failedEnd(harness, run2) {
|
|
|
39
161
|
return { summary: `${lead}${quoted}"`, ...error };
|
|
40
162
|
}
|
|
41
163
|
function localRunsFilePath() {
|
|
42
|
-
return process.env.CLOOP_LOCAL_RUNS_FILE ??
|
|
164
|
+
return process.env.CLOOP_LOCAL_RUNS_FILE ?? join2(homedir(), CONFIG_DIR, "local-runs.json");
|
|
43
165
|
}
|
|
44
166
|
function pickRepo(repos, repository) {
|
|
45
167
|
if (!repository) {
|
|
@@ -106,6 +228,13 @@ var LocalDriver = class {
|
|
|
106
228
|
this.name = deps.dialect.name;
|
|
107
229
|
this.capabilities = deps.dialect.capabilities;
|
|
108
230
|
this.runs = new Map(this.load().map((r) => [r.work_id, r]));
|
|
231
|
+
this.logDir = deps.logDir ?? runLogDir(this.file);
|
|
232
|
+
try {
|
|
233
|
+
const removed = pruneRunLogs(this.logDir, this.now());
|
|
234
|
+
if (removed) this.log(`run logs removed=${removed} older than 14 days`);
|
|
235
|
+
} catch (err) {
|
|
236
|
+
this.log(`run log prune failed: ${err.code ?? "unknown"}`);
|
|
237
|
+
}
|
|
109
238
|
}
|
|
110
239
|
deps;
|
|
111
240
|
name;
|
|
@@ -115,6 +244,8 @@ var LocalDriver = class {
|
|
|
115
244
|
listeners = /* @__PURE__ */ new Map();
|
|
116
245
|
recovering = /* @__PURE__ */ new Set();
|
|
117
246
|
stopping = false;
|
|
247
|
+
logDir;
|
|
248
|
+
logFailed = false;
|
|
118
249
|
get repo() {
|
|
119
250
|
return this.deps.repo ?? gitProbe;
|
|
120
251
|
}
|
|
@@ -124,6 +255,16 @@ var LocalDriver = class {
|
|
|
124
255
|
log(line) {
|
|
125
256
|
this.deps.log?.(line);
|
|
126
257
|
}
|
|
258
|
+
/** One line in the run's own log, for `cloop watch`. A full disk must not stop the run. */
|
|
259
|
+
note(r, text) {
|
|
260
|
+
try {
|
|
261
|
+
appendRunLog(this.logDir, r.work_id, text, { now: this.now() });
|
|
262
|
+
} catch (err) {
|
|
263
|
+
if (this.logFailed) return;
|
|
264
|
+
this.logFailed = true;
|
|
265
|
+
this.log(`run log write failed: ${err.code ?? "unknown"}`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
127
268
|
now() {
|
|
128
269
|
return this.deps.now?.() ?? Date.now();
|
|
129
270
|
}
|
|
@@ -174,7 +315,8 @@ var LocalDriver = class {
|
|
|
174
315
|
status: this.statusOf(r),
|
|
175
316
|
settled: Boolean(r.end),
|
|
176
317
|
pr_url: r.end?.pr_url ?? null,
|
|
177
|
-
last_assistant_text: r.end?.summary ?? r.last_text ?? null
|
|
318
|
+
last_assistant_text: r.end?.summary ?? r.last_text ?? null,
|
|
319
|
+
resume: this.deps.dialect.name === "claude-code" && r.session_id ? { cwd: r.repo, session_id: r.session_id } : null
|
|
178
320
|
};
|
|
179
321
|
}
|
|
180
322
|
async launch(a) {
|
|
@@ -239,6 +381,7 @@ var LocalDriver = class {
|
|
|
239
381
|
if (!line2) throw new BoxToolError("cannot_steer");
|
|
240
382
|
live.asks = live.asks.slice(1);
|
|
241
383
|
this.write(live, line2);
|
|
384
|
+
this.note(r, `< You answered: ${a.text}`);
|
|
242
385
|
this.remember(r, a.command_id, "answer");
|
|
243
386
|
this.log(`answer work=${r.work_id}`);
|
|
244
387
|
this.askNext(r, live);
|
|
@@ -266,6 +409,7 @@ ${a.text}` : a.text;
|
|
|
266
409
|
if (!line) throw new BoxToolError("cannot_steer");
|
|
267
410
|
live.outstanding++;
|
|
268
411
|
this.write(live, line);
|
|
412
|
+
this.note(r, `< You: ${a.text}`);
|
|
269
413
|
const delivered = a.mode === "queue" ? "queue" : "steer";
|
|
270
414
|
this.remember(r, a.command_id, delivered);
|
|
271
415
|
this.log(`${delivered} work=${r.work_id}`);
|
|
@@ -283,11 +427,12 @@ ${a.text}` : a.text;
|
|
|
283
427
|
} catch {
|
|
284
428
|
}
|
|
285
429
|
}
|
|
286
|
-
await this.end(r, { kind: "failed", summary:
|
|
430
|
+
await this.end(r, { kind: "failed", summary: STOPPED_SUMMARY });
|
|
287
431
|
return { ok: true, was_running: orphan };
|
|
288
432
|
}
|
|
289
433
|
live.interrupted = true;
|
|
290
434
|
live.child.kill("SIGINT");
|
|
435
|
+
this.note(r, "= Stop requested.");
|
|
291
436
|
const timer = setTimeout(() => {
|
|
292
437
|
if (live.child.exitCode === null && live.child.signalCode === null)
|
|
293
438
|
live.child.kill("SIGTERM");
|
|
@@ -372,6 +517,7 @@ ${a.text}` : a.text;
|
|
|
372
517
|
r.pid = child.pid ?? null;
|
|
373
518
|
this.save();
|
|
374
519
|
this.log(`spawn work=${r.work_id} pid=${r.pid ?? "none"} ${resume ? "resume" : "new"}`);
|
|
520
|
+
this.note(r, resume ? "= Resumed." : `= Started "${r.title}" in ${r.repo}`);
|
|
375
521
|
child.stdin?.on("error", () => {
|
|
376
522
|
});
|
|
377
523
|
child.stdin?.write(dialect.opening(r, `${prompt}
|
|
@@ -391,6 +537,8 @@ ${RESULT_INSTRUCTION}`));
|
|
|
391
537
|
child.on("close", (code, signal) => void this.onExit(r, live, code, signal));
|
|
392
538
|
}
|
|
393
539
|
onItem(r, live, item) {
|
|
540
|
+
const logged = logLineFor(item);
|
|
541
|
+
if (logged) this.note(r, logged);
|
|
394
542
|
switch (item.type) {
|
|
395
543
|
case "session":
|
|
396
544
|
if (r.session_id !== item.id) {
|
|
@@ -403,14 +551,11 @@ ${RESULT_INSTRUCTION}`));
|
|
|
403
551
|
this.progress(r, live, item.text, false);
|
|
404
552
|
return;
|
|
405
553
|
case "tool": {
|
|
554
|
+
const line = item.summary ?? (item.target ? `${item.name} ${item.target}` : item.name);
|
|
555
|
+
if (!isProgressSentence(line)) return;
|
|
406
556
|
const changed = item.name !== live.lastTool;
|
|
407
557
|
live.lastTool = item.name;
|
|
408
|
-
this.progress(
|
|
409
|
-
r,
|
|
410
|
-
live,
|
|
411
|
-
item.summary ?? (item.target ? `${item.name} ${item.target}` : item.name),
|
|
412
|
-
changed
|
|
413
|
-
);
|
|
558
|
+
this.progress(r, live, line, changed);
|
|
414
559
|
return;
|
|
415
560
|
}
|
|
416
561
|
case "ask":
|
|
@@ -432,13 +577,12 @@ ${RESULT_INSTRUCTION}`));
|
|
|
432
577
|
}
|
|
433
578
|
}
|
|
434
579
|
progress(r, live, line, force) {
|
|
580
|
+
const summary = (parseRunResult(line)?.summary ?? line.split("```cloop-result")[0] ?? "").replace(/\s+/g, " ").trim().slice(0, 200);
|
|
581
|
+
if (!isProgressSentence(summary)) return;
|
|
435
582
|
const now = this.now();
|
|
436
583
|
if (!force && now - live.lastProgressAt < (this.deps.progressMs ?? 3e4)) return;
|
|
437
584
|
live.lastProgressAt = now;
|
|
438
|
-
this.emit(r.work_id, {
|
|
439
|
-
kind: "progress",
|
|
440
|
-
summary: (parseRunResult(line)?.summary ?? line.split("```cloop-result")[0] ?? "").replace(/\s+/g, " ").trim().slice(0, 200)
|
|
441
|
-
});
|
|
585
|
+
this.emit(r.work_id, { kind: "progress", summary });
|
|
442
586
|
}
|
|
443
587
|
async onExit(r, live, code, signal) {
|
|
444
588
|
if (this.lives.get(r.work_id) === live) this.lives.delete(r.work_id);
|
|
@@ -448,7 +592,7 @@ ${RESULT_INSTRUCTION}`));
|
|
|
448
592
|
`exit work=${r.work_id} ${exit} result=${live.result ? live.result.ok ? "ok" : "error" : "none"}`
|
|
449
593
|
);
|
|
450
594
|
if (live.interrupted) {
|
|
451
|
-
await this.end(r, { kind: "failed", summary:
|
|
595
|
+
await this.end(r, { kind: "failed", summary: STOPPED_SUMMARY });
|
|
452
596
|
return;
|
|
453
597
|
}
|
|
454
598
|
if (live.next) {
|
|
@@ -528,6 +672,7 @@ ${RESULT_INSTRUCTION}`));
|
|
|
528
672
|
r.end = { ...end, at: new Date(this.now()).toISOString() };
|
|
529
673
|
r.pid = null;
|
|
530
674
|
this.save();
|
|
675
|
+
this.note(r, endNote(end));
|
|
531
676
|
this.emit(r.work_id, end);
|
|
532
677
|
}
|
|
533
678
|
emit(id, event) {
|
|
@@ -554,27 +699,38 @@ ${RESULT_INSTRUCTION}`));
|
|
|
554
699
|
return r.end.kind === "settled" ? "completed" : "failed";
|
|
555
700
|
}
|
|
556
701
|
load() {
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
const cutoff = this.now() - KEEP_MS;
|
|
560
|
-
return Array.isArray(raw) ? raw.filter(
|
|
561
|
-
(r) => typeof r?.work_id === "string" && typeof r?.repo === "string" && !(r.end && Date.parse(r.end.at) < cutoff)
|
|
562
|
-
) : [];
|
|
563
|
-
} catch {
|
|
564
|
-
return [];
|
|
565
|
-
}
|
|
702
|
+
const cutoff = this.now() - KEEP_MS;
|
|
703
|
+
return readRunRecords(this.file).filter((r) => !(r.end && Date.parse(r.end.at) < cutoff));
|
|
566
704
|
}
|
|
567
705
|
save() {
|
|
568
|
-
|
|
706
|
+
mkdirSync2(dirname2(this.file), { recursive: true, mode: 448 });
|
|
569
707
|
const tmp = `${this.file}.tmp`;
|
|
570
708
|
writeFileSync(tmp, `${JSON.stringify([...this.runs.values()], null, 2)}
|
|
571
709
|
`, { mode: 384 });
|
|
572
|
-
|
|
573
|
-
|
|
710
|
+
chmodSync2(tmp, 384);
|
|
711
|
+
renameSync2(tmp, this.file);
|
|
574
712
|
}
|
|
575
713
|
};
|
|
714
|
+
function readRunRecords(file = localRunsFilePath()) {
|
|
715
|
+
try {
|
|
716
|
+
const raw = JSON.parse(readFileSync(file, "utf-8"));
|
|
717
|
+
return Array.isArray(raw) ? raw.filter(
|
|
718
|
+
(r) => typeof r?.work_id === "string" && typeof r?.repo === "string"
|
|
719
|
+
) : [];
|
|
720
|
+
} catch {
|
|
721
|
+
return [];
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
function isProgressSentence(value) {
|
|
725
|
+
return typeof value === "string" && /\S[ \t]+\S/.test(value.trim().split(/\r?\n/)[0] ?? "");
|
|
726
|
+
}
|
|
576
727
|
|
|
577
728
|
export {
|
|
729
|
+
runLogDir,
|
|
730
|
+
runLogPath,
|
|
731
|
+
STOPPED_SUMMARY,
|
|
732
|
+
isEndLogLine,
|
|
578
733
|
localRunsFilePath,
|
|
579
|
-
LocalDriver
|
|
734
|
+
LocalDriver,
|
|
735
|
+
readRunRecords
|
|
580
736
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
DEFAULT_T3_URL,
|
|
4
|
+
T3PairError,
|
|
5
|
+
askHidden,
|
|
4
6
|
askOrClosed,
|
|
5
7
|
askRepos,
|
|
6
8
|
awaitDaemon,
|
|
@@ -17,27 +19,33 @@ import {
|
|
|
17
19
|
isWorkstation,
|
|
18
20
|
mintSession,
|
|
19
21
|
notACheckoutLine,
|
|
22
|
+
pairPrompt,
|
|
23
|
+
pairT3,
|
|
20
24
|
parsePicks,
|
|
21
25
|
programFor,
|
|
22
26
|
rerunCommand,
|
|
23
27
|
resolveRepos,
|
|
24
28
|
revokeReplaced,
|
|
25
29
|
runSteps,
|
|
30
|
+
sessionFromLink,
|
|
26
31
|
systemdAssignment,
|
|
27
32
|
systemdWord,
|
|
28
33
|
tilde,
|
|
29
34
|
unitEnv,
|
|
30
35
|
unitFor
|
|
31
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-2FLM3ESE.js";
|
|
37
|
+
import "./chunk-G6JAEE2Y.js";
|
|
32
38
|
import "./chunk-JX6VG5FE.js";
|
|
33
39
|
import "./chunk-R3CLO2FB.js";
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-53M5DK6D.js";
|
|
41
|
+
import "./chunk-4XDYJZLF.js";
|
|
36
42
|
import "./chunk-AG6SI6I2.js";
|
|
37
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-BFVL3E2C.js";
|
|
38
44
|
import "./chunk-3DIGCVL4.js";
|
|
39
45
|
export {
|
|
40
46
|
DEFAULT_T3_URL,
|
|
47
|
+
T3PairError,
|
|
48
|
+
askHidden,
|
|
41
49
|
askOrClosed,
|
|
42
50
|
askRepos,
|
|
43
51
|
awaitDaemon,
|
|
@@ -54,12 +62,15 @@ export {
|
|
|
54
62
|
isWorkstation,
|
|
55
63
|
mintSession,
|
|
56
64
|
notACheckoutLine,
|
|
65
|
+
pairPrompt,
|
|
66
|
+
pairT3,
|
|
57
67
|
parsePicks,
|
|
58
68
|
programFor,
|
|
59
69
|
rerunCommand,
|
|
60
70
|
resolveRepos,
|
|
61
71
|
revokeReplaced,
|
|
62
72
|
runSteps,
|
|
73
|
+
sessionFromLink,
|
|
63
74
|
systemdAssignment,
|
|
64
75
|
systemdWord,
|
|
65
76
|
tilde,
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
localRunsFilePath
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KOOAVO2C.js";
|
|
5
|
+
import "./chunk-VK6GV757.js";
|
|
5
6
|
import {
|
|
6
|
-
boxPath,
|
|
7
7
|
installedService,
|
|
8
|
-
readRunnerConfig,
|
|
9
8
|
revokeOwnDevice,
|
|
10
9
|
runSteps,
|
|
11
10
|
runnerStatePath,
|
|
12
11
|
threadsFilePath,
|
|
13
12
|
tokenGone
|
|
14
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2FLM3ESE.js";
|
|
14
|
+
import {
|
|
15
|
+
boxPath,
|
|
16
|
+
readRunnerConfig
|
|
17
|
+
} from "./chunk-G6JAEE2Y.js";
|
|
15
18
|
import "./chunk-JX6VG5FE.js";
|
|
16
19
|
import "./chunk-R3CLO2FB.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-53M5DK6D.js";
|
|
21
|
+
import "./chunk-4XDYJZLF.js";
|
|
19
22
|
import "./chunk-AG6SI6I2.js";
|
|
20
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-BFVL3E2C.js";
|
|
21
24
|
import {
|
|
22
25
|
getOrigin
|
|
23
26
|
} 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-BFVL3E2C.js";
|
|
5
5
|
import {
|
|
6
6
|
applyEnvironmentFlag
|
|
7
7
|
} from "./chunk-3DIGCVL4.js";
|
|
@@ -22,13 +22,21 @@ 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
|
|
28
32
|
cloop disconnect [--yes] Stop being a Cloop runner: revoke this computer on
|
|
29
33
|
Cloop, remove its service and runner files
|
|
30
34
|
cloop box connect cloop connect with T3 Code forced
|
|
31
35
|
cloop box run Answer the Cloop Agent's runner calls (daemon)
|
|
36
|
+
cloop runs List this machine's runs: open ones, and the last 24 hours
|
|
37
|
+
cloop watch [id] Follow a run as it works. No id: the newest open run.
|
|
38
|
+
Stop it from Threads.
|
|
39
|
+
cloop resume <id> Open a finished run in Claude Code, in its repository
|
|
32
40
|
cloop runner register --webhook <url> --label <name> [--reactivate] [--rotate-secret]
|
|
33
41
|
Register a cloud runner endpoint
|
|
34
42
|
cloop runner verify --label <name>
|
|
@@ -43,7 +51,7 @@ async function main() {
|
|
|
43
51
|
switch (command) {
|
|
44
52
|
case "login":
|
|
45
53
|
case "auth": {
|
|
46
|
-
const { loginCommand } = await import("./login-
|
|
54
|
+
const { loginCommand } = await import("./login-3HHGBYJ7.js");
|
|
47
55
|
await loginCommand(argv);
|
|
48
56
|
break;
|
|
49
57
|
}
|
|
@@ -53,32 +61,47 @@ async function main() {
|
|
|
53
61
|
break;
|
|
54
62
|
}
|
|
55
63
|
case "serve": {
|
|
56
|
-
const { startMcpServer } = await import("./mcp-server-
|
|
64
|
+
const { startMcpServer } = await import("./mcp-server-FOICWAYA.js");
|
|
57
65
|
await startMcpServer();
|
|
58
66
|
break;
|
|
59
67
|
}
|
|
60
68
|
case "statusline": {
|
|
61
|
-
const { statuslineCommand } = await import("./statusline-
|
|
69
|
+
const { statuslineCommand } = await import("./statusline-4HJMU355.js");
|
|
62
70
|
statuslineCommand();
|
|
63
71
|
break;
|
|
64
72
|
}
|
|
65
73
|
case "connect": {
|
|
66
|
-
const { connectCommand } = await import("./connect-
|
|
74
|
+
const { connectCommand } = await import("./connect-FXO5ETUM.js");
|
|
67
75
|
await connectCommand(argv.slice(1));
|
|
68
76
|
break;
|
|
69
77
|
}
|
|
70
78
|
case "disconnect": {
|
|
71
|
-
const { disconnectCommand } = await import("./disconnect-
|
|
79
|
+
const { disconnectCommand } = await import("./disconnect-EDQ7KXTR.js");
|
|
72
80
|
await disconnectCommand(argv.slice(1));
|
|
73
81
|
break;
|
|
74
82
|
}
|
|
75
83
|
case "box": {
|
|
76
|
-
const { boxCommand } = await import("./box-
|
|
84
|
+
const { boxCommand } = await import("./box-S2KILP32.js");
|
|
77
85
|
await boxCommand(argv.slice(1));
|
|
78
86
|
break;
|
|
79
87
|
}
|
|
88
|
+
case "runs": {
|
|
89
|
+
const { runsCommand } = await import("./runs-N6RLOEQG.js");
|
|
90
|
+
process.exitCode = runsCommand();
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
case "watch": {
|
|
94
|
+
const { watchCommand } = await import("./runs-N6RLOEQG.js");
|
|
95
|
+
process.exitCode = await watchCommand(argv.slice(1));
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
case "resume": {
|
|
99
|
+
const { resumeCommand } = await import("./runs-N6RLOEQG.js");
|
|
100
|
+
process.exitCode = await resumeCommand(argv.slice(1));
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
80
103
|
case "runner": {
|
|
81
|
-
const { runnerCommand } = await import("./runner-
|
|
104
|
+
const { runnerCommand } = await import("./runner-R7XTMUHH.js");
|
|
82
105
|
await runnerCommand(argv.slice(1));
|
|
83
106
|
break;
|
|
84
107
|
}
|
|
@@ -87,10 +110,10 @@ async function main() {
|
|
|
87
110
|
const { runnerPermissionHook } = await import("./read-permissions-SPOKGVLO.js");
|
|
88
111
|
await runnerPermissionHook();
|
|
89
112
|
} else if (argv[1] === "session-start") {
|
|
90
|
-
const { hookSessionStart } = await import("./hook-session-start-
|
|
113
|
+
const { hookSessionStart } = await import("./hook-session-start-GEBGA63R.js");
|
|
91
114
|
await hookSessionStart();
|
|
92
115
|
} else if (argv[1] === "activity") {
|
|
93
|
-
const { hookActivity } = await import("./hook-activity-
|
|
116
|
+
const { hookActivity } = await import("./hook-activity-R7OPEYBX.js");
|
|
94
117
|
await hookActivity();
|
|
95
118
|
} else {
|
|
96
119
|
console.error(`Unknown hook: ${argv[1] ?? "(none)"}`);
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
deviceLogin,
|
|
4
4
|
loginCommand,
|
|
5
5
|
refusalSentence
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4XDYJZLF.js";
|
|
7
7
|
import "./chunk-AG6SI6I2.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-BFVL3E2C.js";
|
|
9
9
|
import "./chunk-3DIGCVL4.js";
|
|
10
10
|
export {
|
|
11
11
|
deviceLogin,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
readSessionState,
|
|
8
8
|
toolPhrase,
|
|
9
9
|
writeSessionState
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AEWIRLRS.js";
|
|
11
11
|
import {
|
|
12
12
|
appendInbox,
|
|
13
13
|
drainInbox,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
sanitizeLabel,
|
|
20
20
|
sanitizeUntrusted
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-VK6GV757.js";
|
|
22
22
|
import {
|
|
23
23
|
HeartbeatClient,
|
|
24
24
|
detectPlatform,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
} from "./chunk-AG6SI6I2.js";
|
|
34
34
|
import {
|
|
35
35
|
VERSION
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-BFVL3E2C.js";
|
|
37
37
|
import {
|
|
38
38
|
getMeshUrl,
|
|
39
39
|
getToken
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
connectWebhook,
|
|
4
4
|
runnerCommand
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-53M5DK6D.js";
|
|
6
|
+
import "./chunk-4XDYJZLF.js";
|
|
7
7
|
import "./chunk-AG6SI6I2.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-BFVL3E2C.js";
|
|
9
9
|
import "./chunk-3DIGCVL4.js";
|
|
10
10
|
export {
|
|
11
11
|
connectWebhook,
|