@cloop/runner 0.3.58 → 0.3.61
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-ATCVDTJL.js → box-OPKO2EY6.js} +176 -33
- package/dist/{chunk-ZPTAWYEW.js → chunk-CBUSTVCH.js} +3 -3
- package/dist/{chunk-TDZ3P5KT.js → chunk-IUBEQ342.js} +1 -1
- package/dist/{chunk-QO4HCPPB.js → chunk-LZ4NZTA2.js} +1 -1
- package/dist/{chunk-FE2CVSWX.js → chunk-OWYY764F.js} +1 -1
- package/dist/{chunk-XAKDSXMW.js → chunk-PMH5WSQK.js} +55 -13
- package/dist/{chunk-XCY5UCB7.js → chunk-PTOPXY65.js} +1 -1
- package/dist/{chunk-MWIILCSZ.js → chunk-QLZYSUGR.js} +5 -5
- package/dist/{chunk-TZDLUM3E.js → chunk-TUGKGUV3.js} +1 -1
- package/dist/{connect-6S3QLFXR.js → connect-QWFKIR2A.js} +6 -6
- package/dist/{disconnect-GICPEOSK.js → disconnect-DYPSIUVQ.js} +6 -6
- package/dist/{existing-runner-Y3SISSPG.js → existing-runner-FNLWQGFZ.js} +6 -6
- package/dist/index.js +14 -14
- package/dist/{login-GEWUZVTU.js → login-64IZF4QT.js} +2 -2
- package/dist/{mcp-server-F7DJULUK.js → mcp-server-X4MIHXI4.js} +1 -1
- package/dist/{runner-UHVWNHA7.js → runner-RHKB5LKX.js} +3 -3
- package/dist/{runs-JBC376NJ.js → runs-62FX5IQ6.js} +2 -2
- package/dist/{statusline-HAM6WKIK.js → statusline-FKJDEYAA.js} +1 -1
- package/dist/{takeover-WY7FPVJ6.js → takeover-FUQV257E.js} +4 -4
- package/dist/{use-4RUJG2YI.js → use-RASS2OSW.js} +6 -6
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
serveTakeovers
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-CBUSTVCH.js";
|
|
5
|
+
import "./chunk-OWYY764F.js";
|
|
6
6
|
import {
|
|
7
7
|
CAPTURE_TICK_MS,
|
|
8
8
|
DEFAULT_FALLBACK_MODEL,
|
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
systemServices,
|
|
40
40
|
unitFor,
|
|
41
41
|
which
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-QLZYSUGR.js";
|
|
43
43
|
import {
|
|
44
44
|
MeshSocket,
|
|
45
45
|
WAKE_TICK_MS,
|
|
@@ -57,12 +57,13 @@ import {
|
|
|
57
57
|
runnerStatePath,
|
|
58
58
|
threadsFilePath,
|
|
59
59
|
writeRunnerState
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-TUGKGUV3.js";
|
|
61
61
|
import {
|
|
62
62
|
BackgroundReading,
|
|
63
63
|
BoxToolError,
|
|
64
64
|
HARNESS_LIMIT,
|
|
65
65
|
HARNESS_STALE_MS,
|
|
66
|
+
IDLE_SETTLE_MS,
|
|
66
67
|
LocalDriver,
|
|
67
68
|
MACHINE_RESULT_INSTRUCTION,
|
|
68
69
|
RUN_TEXT_MAX,
|
|
@@ -80,6 +81,7 @@ import {
|
|
|
80
81
|
fetchImages,
|
|
81
82
|
finalWords,
|
|
82
83
|
hasResultBlock,
|
|
84
|
+
holdsForNextTurn,
|
|
83
85
|
isHosted,
|
|
84
86
|
isLocal,
|
|
85
87
|
isT3,
|
|
@@ -107,20 +109,20 @@ import {
|
|
|
107
109
|
utcWindow,
|
|
108
110
|
windowsPowerShellEnv,
|
|
109
111
|
writeBoxConfig
|
|
110
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-PMH5WSQK.js";
|
|
111
113
|
import "./chunk-VK6GV757.js";
|
|
112
114
|
import {
|
|
113
115
|
olderThan
|
|
114
116
|
} from "./chunk-365HFCQQ.js";
|
|
115
117
|
import "./chunk-PKIEWBR7.js";
|
|
116
|
-
import "./chunk-
|
|
117
|
-
import "./chunk-
|
|
118
|
+
import "./chunk-IUBEQ342.js";
|
|
119
|
+
import "./chunk-LZ4NZTA2.js";
|
|
118
120
|
import {
|
|
119
121
|
getMachine
|
|
120
122
|
} from "./chunk-SBYSVZ7J.js";
|
|
121
123
|
import {
|
|
122
124
|
VERSION
|
|
123
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-PTOPXY65.js";
|
|
124
126
|
import {
|
|
125
127
|
getMeshUrl,
|
|
126
128
|
getOrigin,
|
|
@@ -171,7 +173,8 @@ function parseRecord(raw) {
|
|
|
171
173
|
switch (r.kind) {
|
|
172
174
|
case "receipt": {
|
|
173
175
|
const receipt = parseReceipt(data);
|
|
174
|
-
|
|
176
|
+
const at = num(r.timestamp_ms);
|
|
177
|
+
return receipt ? { sequence, kind: "receipt", receipt, ...at === null ? {} : { at } } : { sequence, kind: "other" };
|
|
175
178
|
}
|
|
176
179
|
case "state": {
|
|
177
180
|
const state = str(data.state);
|
|
@@ -359,7 +362,7 @@ function sseRecord(block) {
|
|
|
359
362
|
|
|
360
363
|
// src/drivers/cloudroom.ts
|
|
361
364
|
import { createHash } from "crypto";
|
|
362
|
-
import { chmodSync, mkdirSync as mkdirSync2, readFileSync, renameSync as renameSync2, writeFileSync } from "fs";
|
|
365
|
+
import { chmodSync, mkdirSync as mkdirSync2, readFileSync, renameSync as renameSync2, rmSync as rmSync2, writeFileSync } from "fs";
|
|
363
366
|
import { basename, dirname, join as join2 } from "path";
|
|
364
367
|
|
|
365
368
|
// src/drivers/cloudroom-repos.ts
|
|
@@ -606,7 +609,8 @@ var NEW_FOLD = {
|
|
|
606
609
|
after: 0,
|
|
607
610
|
spoken: null,
|
|
608
611
|
lastProgressAt: 0,
|
|
609
|
-
ended: false
|
|
612
|
+
ended: false,
|
|
613
|
+
rest: null
|
|
610
614
|
};
|
|
611
615
|
var PENDING = /* @__PURE__ */ new Set(["accepted", "delivered", "running"]);
|
|
612
616
|
var DEAD = /* @__PURE__ */ new Set(["closed", "failed", "process_lost"]);
|
|
@@ -633,11 +637,11 @@ function apply(fold, r) {
|
|
|
633
637
|
case "receipt": {
|
|
634
638
|
const { command, state, error, request_id, target } = r.receipt;
|
|
635
639
|
if (command === "start") fold.start = { state, error };
|
|
636
|
-
else if (command === "prompt") {
|
|
637
|
-
|
|
640
|
+
else if (command === "prompt" || command === "auto") {
|
|
641
|
+
let turn = fold.turns.find((t) => t.id === request_id);
|
|
638
642
|
if (turn) Object.assign(turn, { state, error });
|
|
639
|
-
else
|
|
640
|
-
|
|
643
|
+
else {
|
|
644
|
+
turn = {
|
|
641
645
|
id: request_id,
|
|
642
646
|
state,
|
|
643
647
|
error,
|
|
@@ -645,7 +649,10 @@ function apply(fold, r) {
|
|
|
645
649
|
limited: false,
|
|
646
650
|
item: null,
|
|
647
651
|
text: ""
|
|
648
|
-
}
|
|
652
|
+
};
|
|
653
|
+
fold.turns.push(turn);
|
|
654
|
+
}
|
|
655
|
+
if (!PENDING.has(state) && r.at !== void 0) turn.endedAt = r.at;
|
|
649
656
|
} else if (command === "cancel" && (state === "accepted" || state === "completed")) {
|
|
650
657
|
const turn = fold.turns.find((t) => t.id === target);
|
|
651
658
|
if (turn) turn.cancelled = true;
|
|
@@ -699,7 +706,23 @@ function failedRun(harness, state, said, limited) {
|
|
|
699
706
|
});
|
|
700
707
|
return { kind: "failed", summary, ...error };
|
|
701
708
|
}
|
|
702
|
-
function
|
|
709
|
+
function resultOf(turn) {
|
|
710
|
+
return readRunResult(resultText(turn.text.trim(), turn.block)).result;
|
|
711
|
+
}
|
|
712
|
+
function holds(turn) {
|
|
713
|
+
return holdsForNextTurn({
|
|
714
|
+
completed: turn.state === "completed",
|
|
715
|
+
limited: turn.limited,
|
|
716
|
+
result: resultOf(turn)
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
function restingTurn(fold) {
|
|
720
|
+
const turns = fold.turns.filter((t) => !t.cancelled);
|
|
721
|
+
if (turns.some((t) => PENDING.has(t.state))) return void 0;
|
|
722
|
+
const last = turns.at(-1);
|
|
723
|
+
return last && holds(last) ? last : void 0;
|
|
724
|
+
}
|
|
725
|
+
function runEnd(fold, harness, now, idleMs = IDLE_SETTLE_MS) {
|
|
703
726
|
const turns = fold.turns.filter((t) => !t.cancelled);
|
|
704
727
|
if (turns.some((t) => PENDING.has(t.state)))
|
|
705
728
|
return fold.session && DEAD.has(fold.session) ? failedRun(harness, fold.session, null, false) : null;
|
|
@@ -711,9 +734,13 @@ function runEnd(fold, harness) {
|
|
|
711
734
|
return failedRun(harness, fold.start.state, fold.start.error, false);
|
|
712
735
|
return null;
|
|
713
736
|
}
|
|
737
|
+
if (holds(last)) {
|
|
738
|
+
const since = fold.rest?.turn === last.id ? fold.rest.at : now;
|
|
739
|
+
if (now - since < idleMs) return null;
|
|
740
|
+
}
|
|
714
741
|
if (last.state === "completed" && !last.limited) {
|
|
715
742
|
const text = last.text.trim();
|
|
716
|
-
const result =
|
|
743
|
+
const result = resultOf(last);
|
|
717
744
|
const pr = resultPrUrl(text);
|
|
718
745
|
const summary = finalWords(text).slice(0, RUN_TEXT_MAX);
|
|
719
746
|
return {
|
|
@@ -735,11 +762,22 @@ function foldRecords(fold, records, opts) {
|
|
|
735
762
|
said = apply(next, r) ?? said;
|
|
736
763
|
}
|
|
737
764
|
if (next.ended) return { state: next, events: [] };
|
|
738
|
-
const
|
|
765
|
+
const resting = restingTurn(next);
|
|
766
|
+
const rests = resting !== void 0 && next.rest?.turn !== resting.id;
|
|
767
|
+
if (!resting) next.rest = null;
|
|
768
|
+
else if (rests) next.rest = { turn: resting.id, at: resting.endedAt ?? opts.now };
|
|
769
|
+
const end = runEnd(next, opts.harness, opts.now, opts.idleMs);
|
|
739
770
|
if (end) {
|
|
740
771
|
next.ended = true;
|
|
741
772
|
return { state: next, events: [end] };
|
|
742
773
|
}
|
|
774
|
+
if (resting && rests) {
|
|
775
|
+
next.spoken = resting.text;
|
|
776
|
+
const clock2 = { lastProgressAt: next.lastProgressAt };
|
|
777
|
+
const summary2 = nextProgress(clock2, resting.text, opts.now, opts.progressMs, true);
|
|
778
|
+
next.lastProgressAt = clock2.lastProgressAt;
|
|
779
|
+
return { state: next, events: summary2 ? [{ kind: "progress", summary: summary2 }] : [] };
|
|
780
|
+
}
|
|
743
781
|
if (!said || said.cancelled || !PENDING.has(said.state) || said.text === next.spoken)
|
|
744
782
|
return { state: next, events: [] };
|
|
745
783
|
next.spoken = said.text;
|
|
@@ -781,6 +819,7 @@ function unpreparedEnd(harness, err) {
|
|
|
781
819
|
);
|
|
782
820
|
return { kind: "failed", summary };
|
|
783
821
|
}
|
|
822
|
+
var REST_LEASE_MARGIN_MS = 2 * 6e4;
|
|
784
823
|
var sleep = (ms) => new Promise((resolve) => {
|
|
785
824
|
const timer = setTimeout(resolve, ms);
|
|
786
825
|
timer.unref?.();
|
|
@@ -897,6 +936,8 @@ var CloudroomDriver = class {
|
|
|
897
936
|
kept;
|
|
898
937
|
/** Runs looking for the next model, by thread. */
|
|
899
938
|
moving = /* @__PURE__ */ new Set();
|
|
939
|
+
/** Runs that wait after a turn without a result, by thread: ends the run on a Stop. */
|
|
940
|
+
resting = /* @__PURE__ */ new Map();
|
|
900
941
|
/** The account's models, best first, while CATALOG_MS lasts. */
|
|
901
942
|
catalog = null;
|
|
902
943
|
/** The run's last move off a refused model, if it moved. */
|
|
@@ -976,6 +1017,45 @@ var CloudroomDriver = class {
|
|
|
976
1017
|
now() {
|
|
977
1018
|
return this.deps.now?.() ?? Date.now();
|
|
978
1019
|
}
|
|
1020
|
+
get idleMs() {
|
|
1021
|
+
return this.deps.idleMs ?? IDLE_SETTLE_MS;
|
|
1022
|
+
}
|
|
1023
|
+
/** A hold's step, to the mesh (runner-log HoldCode), by the run's work id. */
|
|
1024
|
+
holdLog(code, thread, ms) {
|
|
1025
|
+
const work = thread.startsWith(CLOOP_SESSION_PREFIX) ? thread.slice(CLOOP_SESSION_PREFIX.length) : null;
|
|
1026
|
+
this.deps.holdLog?.(code, work, ms);
|
|
1027
|
+
}
|
|
1028
|
+
/** Named after the thread, not the process: a restarted daemon writes or removes the same lease. */
|
|
1029
|
+
leaseFile(thread) {
|
|
1030
|
+
if (!this.deps.awakeDir) return null;
|
|
1031
|
+
const name = createHash("sha256").update(thread).digest("hex").slice(0, 12);
|
|
1032
|
+
return join2(this.deps.awakeDir, `cloop-hold-${name}.json`);
|
|
1033
|
+
}
|
|
1034
|
+
/** On a Cloop Box, a lease (cloop-box AwakeLease) keeps the box up until a held run is due to settle. */
|
|
1035
|
+
lease(thread, until) {
|
|
1036
|
+
const file = this.leaseFile(thread);
|
|
1037
|
+
if (!file || !this.deps.awakeDir) return;
|
|
1038
|
+
try {
|
|
1039
|
+
mkdirSync2(this.deps.awakeDir, { recursive: true });
|
|
1040
|
+
writeFileSync(file, JSON.stringify({ label: "held run", until }));
|
|
1041
|
+
} catch (err) {
|
|
1042
|
+
this.log(
|
|
1043
|
+
`awake lease not written thread=${thread} reason=${err instanceof Error ? err.message : "error"}`
|
|
1044
|
+
);
|
|
1045
|
+
this.holdLog("hold_unleased", thread);
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
unlease(thread) {
|
|
1049
|
+
const file = this.leaseFile(thread);
|
|
1050
|
+
if (!file) return;
|
|
1051
|
+
try {
|
|
1052
|
+
rmSync2(file, { force: true });
|
|
1053
|
+
} catch (err) {
|
|
1054
|
+
this.log(
|
|
1055
|
+
`awake lease not removed thread=${thread} reason=${err instanceof Error ? err.message : "error"}`
|
|
1056
|
+
);
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
979
1059
|
log(line) {
|
|
980
1060
|
this.deps.log?.(line);
|
|
981
1061
|
}
|
|
@@ -1059,7 +1139,7 @@ var CloudroomDriver = class {
|
|
|
1059
1139
|
const id = this.carrier(thread);
|
|
1060
1140
|
const session = await this.session(id);
|
|
1061
1141
|
const fold = await this.history(id);
|
|
1062
|
-
const found = runEnd(fold, this.harness);
|
|
1142
|
+
const found = runEnd(fold, this.harness, this.now(), this.idleMs);
|
|
1063
1143
|
const switched = found?.error === "interrupted" ? null : this.movedOf(thread)?.switched;
|
|
1064
1144
|
const end = found && switched ? opened(found, switched) : found;
|
|
1065
1145
|
const last = fold.turns.filter((t) => !t.cancelled).at(-1);
|
|
@@ -1243,7 +1323,8 @@ var CloudroomDriver = class {
|
|
|
1243
1323
|
if (s.receipts[steer]) return { delivered: "steer" };
|
|
1244
1324
|
if (s.receipts[queue]) return { delivered: "queue" };
|
|
1245
1325
|
const running = busy(s);
|
|
1246
|
-
if (!running && !a.resume
|
|
1326
|
+
if (!running && !a.resume && !this.resting.has(a.thread_id))
|
|
1327
|
+
throw new BoxToolError("already_finished");
|
|
1247
1328
|
const deliver = async () => {
|
|
1248
1329
|
if (a.mode === "steer" && s.steer && s.current_request) {
|
|
1249
1330
|
try {
|
|
@@ -1333,7 +1414,9 @@ ${line}` : line;
|
|
|
1333
1414
|
this.log(`interrupt thread=${id} while moving model`);
|
|
1334
1415
|
return { ok: true, was_running: true };
|
|
1335
1416
|
}
|
|
1336
|
-
|
|
1417
|
+
const stopped = await this.stopRun(this.carrier(id), commandId);
|
|
1418
|
+
if (!stopped.was_running && this.resting.get(id)?.()) return { ok: true, was_running: true };
|
|
1419
|
+
return stopped;
|
|
1337
1420
|
}
|
|
1338
1421
|
async stopRun(id, commandId) {
|
|
1339
1422
|
const s = await this.session(id);
|
|
@@ -1399,6 +1482,11 @@ ${line}` : line;
|
|
|
1399
1482
|
* while a child works or a turn waits, and looks again every
|
|
1400
1483
|
* CHILDREN_WAIT_MS in case a child ends without a reply.
|
|
1401
1484
|
*
|
|
1485
|
+
* A turn that completes without a result block holds the run open (the
|
|
1486
|
+
* fold's `rest`): a new turn carries it on, a Stop ends it, and a timer
|
|
1487
|
+
* ticks the fold when idleMs of nothing has passed, so the run settles
|
|
1488
|
+
* with its last words although no record came.
|
|
1489
|
+
*
|
|
1402
1490
|
* A run the account refused its model moves to a new session (moveModel)
|
|
1403
1491
|
* and the watch follows that one under the same thread, from the run's
|
|
1404
1492
|
* kept facts after a restart too.
|
|
@@ -1416,9 +1504,19 @@ ${line}` : line;
|
|
|
1416
1504
|
let stopped = false;
|
|
1417
1505
|
let live = null;
|
|
1418
1506
|
let waits = 0;
|
|
1507
|
+
let ticking = null;
|
|
1508
|
+
let leased = false;
|
|
1509
|
+
const quiet = () => {
|
|
1510
|
+
if (ticking) clearTimeout(ticking.timer);
|
|
1511
|
+
ticking = null;
|
|
1512
|
+
this.resting.delete(id);
|
|
1513
|
+
if (leased) this.unlease(id);
|
|
1514
|
+
leased = false;
|
|
1515
|
+
};
|
|
1419
1516
|
const stop = () => {
|
|
1420
1517
|
stopped = true;
|
|
1421
1518
|
live?.abort();
|
|
1519
|
+
quiet();
|
|
1422
1520
|
};
|
|
1423
1521
|
const end = async (event) => {
|
|
1424
1522
|
const refused = event.kind === "failed" && !event.error ? refusedModel(event.summary) : null;
|
|
@@ -1443,25 +1541,62 @@ ${line}` : line;
|
|
|
1443
1541
|
const wait = ++waits;
|
|
1444
1542
|
await sleep(CHILDREN_WAIT_MS);
|
|
1445
1543
|
if (stopped || fold.ended || wait !== waits) return;
|
|
1446
|
-
const again = runEnd(fold, this.harness);
|
|
1544
|
+
const again = runEnd(fold, this.harness, this.now(), this.idleMs);
|
|
1447
1545
|
if (!again) return;
|
|
1448
1546
|
fold = { ...fold, ended: true };
|
|
1449
1547
|
return end(again);
|
|
1450
1548
|
}
|
|
1451
1549
|
if (stopped) return;
|
|
1550
|
+
if (event.kind === "settled" && restingTurn(fold)) this.holdLog("hold_expired", id);
|
|
1452
1551
|
stop();
|
|
1453
1552
|
const told = await this.tidy(session, event);
|
|
1454
1553
|
const switched = told.error === "interrupted" ? null : this.movedOf(id)?.switched;
|
|
1455
1554
|
onEvent(switched ? opened(told, switched) : told);
|
|
1456
1555
|
};
|
|
1457
|
-
const
|
|
1458
|
-
|
|
1556
|
+
const tick = () => {
|
|
1557
|
+
const rest = fold.ended ? null : fold.rest;
|
|
1558
|
+
if (ticking && ticking.turn === rest?.turn) return;
|
|
1559
|
+
if (ticking && fold.turns.at(-1)?.id !== ticking.turn) {
|
|
1560
|
+
this.log(`new turn thread=${id}; the run goes on`);
|
|
1561
|
+
this.holdLog("hold_carried", id);
|
|
1562
|
+
}
|
|
1563
|
+
quiet();
|
|
1564
|
+
if (!rest) return;
|
|
1565
|
+
const due = rest.at + this.idleMs;
|
|
1566
|
+
const wait = Math.max(0, due - this.now());
|
|
1567
|
+
const timer = setTimeout(() => {
|
|
1568
|
+
ticking = null;
|
|
1569
|
+
take(session, [], Math.max(due, this.now()));
|
|
1570
|
+
}, wait);
|
|
1571
|
+
timer.unref?.();
|
|
1572
|
+
ticking = { turn: rest.turn, timer };
|
|
1573
|
+
this.lease(id, due + REST_LEASE_MARGIN_MS);
|
|
1574
|
+
leased = true;
|
|
1575
|
+
this.resting.set(id, () => {
|
|
1576
|
+
if (stopped || fold.ended) return false;
|
|
1577
|
+
fold = { ...fold, ended: true };
|
|
1578
|
+
quiet();
|
|
1579
|
+
this.log(`stopped a held run thread=${id}`);
|
|
1580
|
+
void end({ kind: "failed", summary: STOPPED_SUMMARY, error: "interrupted" });
|
|
1581
|
+
return true;
|
|
1582
|
+
});
|
|
1583
|
+
this.log(
|
|
1584
|
+
`turn ended without a result thread=${id} turn=${rest.turn}; settling in ${Math.round(wait / 6e4)} min unless a new turn starts`
|
|
1585
|
+
);
|
|
1586
|
+
this.holdLog("run_held", id, wait);
|
|
1587
|
+
if (fold.turns.find((t) => t.id === rest.turn)?.endedAt === void 0)
|
|
1588
|
+
this.holdLog("hold_untimed", id);
|
|
1589
|
+
};
|
|
1590
|
+
const take = (from, records, now = this.now()) => {
|
|
1591
|
+
if (stopped || from !== session) return;
|
|
1459
1592
|
const next = foldRecords(fold, records, {
|
|
1460
1593
|
harness: this.harness,
|
|
1461
|
-
now
|
|
1462
|
-
progressMs: this.deps.progressMs
|
|
1594
|
+
now,
|
|
1595
|
+
progressMs: this.deps.progressMs,
|
|
1596
|
+
idleMs: this.idleMs
|
|
1463
1597
|
});
|
|
1464
1598
|
fold = next.state;
|
|
1599
|
+
tick();
|
|
1465
1600
|
for (const event of next.events) {
|
|
1466
1601
|
if (stopped) return;
|
|
1467
1602
|
if (event.kind === "settled" || event.kind === "failed") {
|
|
@@ -1675,7 +1810,11 @@ ${line}` : line;
|
|
|
1675
1810
|
if (page.length < EVENTS_PAGE) break;
|
|
1676
1811
|
after = page.at(-1)?.sequence ?? after;
|
|
1677
1812
|
}
|
|
1678
|
-
return foldRecords(NEW_FOLD, records, {
|
|
1813
|
+
return foldRecords(NEW_FOLD, records, {
|
|
1814
|
+
harness: this.harness,
|
|
1815
|
+
now: this.now(),
|
|
1816
|
+
idleMs: this.idleMs
|
|
1817
|
+
}).state;
|
|
1679
1818
|
}
|
|
1680
1819
|
};
|
|
1681
1820
|
|
|
@@ -2124,7 +2263,7 @@ import {
|
|
|
2124
2263
|
readFileSync as readFileSync2,
|
|
2125
2264
|
readdirSync,
|
|
2126
2265
|
realpathSync,
|
|
2127
|
-
rmSync as
|
|
2266
|
+
rmSync as rmSync3,
|
|
2128
2267
|
symlinkSync
|
|
2129
2268
|
} from "fs";
|
|
2130
2269
|
import { homedir, tmpdir as tmpdir2 } from "os";
|
|
@@ -2225,7 +2364,7 @@ async function packSkills(home = homedir(), capBytes = SKILLS_CAP_BYTES, tarBin
|
|
|
2225
2364
|
});
|
|
2226
2365
|
});
|
|
2227
2366
|
});
|
|
2228
|
-
|
|
2367
|
+
rmSync3(dir, { recursive: true, force: true });
|
|
2229
2368
|
return packed;
|
|
2230
2369
|
}
|
|
2231
2370
|
var RESERVED_MCP = /* @__PURE__ */ new Set(["cloop", "playwright"]);
|
|
@@ -2512,7 +2651,7 @@ import {
|
|
|
2512
2651
|
openSync,
|
|
2513
2652
|
readFileSync as readFileSync3,
|
|
2514
2653
|
renameSync as renameSync3,
|
|
2515
|
-
rmSync as
|
|
2654
|
+
rmSync as rmSync4,
|
|
2516
2655
|
writeFileSync as writeFileSync2
|
|
2517
2656
|
} from "fs";
|
|
2518
2657
|
import { homedir as homedir2 } from "os";
|
|
@@ -2793,7 +2932,7 @@ async function adopt(from, kind, { services: given, script = process.argv[1] ??
|
|
|
2793
2932
|
if (legacy) {
|
|
2794
2933
|
const added = installedService({ ...where, environment });
|
|
2795
2934
|
if (!await stopService(added, run3)) throw new Error(`${added.path} did not stop`);
|
|
2796
|
-
|
|
2935
|
+
rmSync4(added.path, { force: true });
|
|
2797
2936
|
moveRunnerFiles(runnerDir(environment), runnerDir(was));
|
|
2798
2937
|
}
|
|
2799
2938
|
recordFailed(VERSION, was);
|
|
@@ -2946,8 +3085,12 @@ async function run2() {
|
|
|
2946
3085
|
// Beside the daemon's threads: the model a Task named, a run's move off a refused one, refusals and the last list.
|
|
2947
3086
|
runModels: fileRunModels(hostedRunModelsPath(hosted.harness)),
|
|
2948
3087
|
log: log2,
|
|
3088
|
+
// A held run's lease keeps the box awake until the hold is due to settle.
|
|
3089
|
+
awakeDir: join6(homedir3(), ".cloop", "awake"),
|
|
2949
3090
|
// Called only once calls arrive, so the socket below exists by then.
|
|
2950
|
-
followUpLost: ({ work, n, error }) => socket.send(runnerLog("followup_lost", { work, n, tool: "thread.send", error }))
|
|
3091
|
+
followUpLost: ({ work, n, error }) => socket.send(runnerLog("followup_lost", { work, n, tool: "thread.send", error })),
|
|
3092
|
+
// Watches start after the socket too: a held run's steps, for the hold monitor.
|
|
3093
|
+
holdLog: (code, work, ms) => socket.send(runnerLog(code, { work, ms }))
|
|
2951
3094
|
}) : local && (name === "claude-code" || name === "codex") ? await localDriver(local, name) : new T3Driver({
|
|
2952
3095
|
client: () => t3.client,
|
|
2953
3096
|
t3Bin: isT3(cfg) ? cfg.t3Bin : null,
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
findRun,
|
|
4
4
|
ownHarness
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OWYY764F.js";
|
|
6
6
|
import {
|
|
7
7
|
lockThreadsFile,
|
|
8
8
|
threadsFilePath
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TUGKGUV3.js";
|
|
10
10
|
import {
|
|
11
11
|
localRunsFilePath,
|
|
12
12
|
readRunRecords,
|
|
13
13
|
runHarness,
|
|
14
14
|
takeoverSummary
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-PMH5WSQK.js";
|
|
16
16
|
import {
|
|
17
17
|
sanitizeLabel
|
|
18
18
|
} from "./chunk-VK6GV757.js";
|
|
@@ -90,18 +90,18 @@ function runMediaPattern(folder) {
|
|
|
90
90
|
var RESULT_INSTRUCTION = [
|
|
91
91
|
"When you finish, end your final message with a fenced block tagged cloop-result containing JSON, for example:",
|
|
92
92
|
"```cloop-result",
|
|
93
|
-
'{"summary": "
|
|
93
|
+
'{"summary": "Your conclusion or what you did, in one or two sentences.", "outputs": [{"kind": "pr", "title": "fix: the thing", "url": "https://github.com/org/repo/pull/1"}], "checks": [{"name": "Tests", "outcome": "passed"}]}',
|
|
94
94
|
"```",
|
|
95
95
|
"An output kind is one of: pr or link (title, url), draft (title, body, optional to, optional url), doc (title, optional url or body), wizard (title, steps). A check outcome is passed, failed or skipped.",
|
|
96
96
|
"A draft's body is the message itself, as the recipient will read it; if you saved it somewhere (a Gmail draft), put that link in url, never in body. A doc's body is the whole page in GitHub Markdown: headings, lists, bold and tables all show; a table suits one row per item. Give every product, page or source you mention as a full https link.",
|
|
97
97
|
`A wizard is for ${WIZARD_FOR}. When the work needs such a step, return a wizard for it, not only words. A wizard has 1 to ${WIZARD_STEPS_MAX} steps in order, each {"title", "body" in Markdown, optional https "url"}. Never ask the user to paste a password, key or other secret anywhere. The user sees a wizard as a walkthrough: in your own words, call it a walkthrough, never a wizard.`,
|
|
98
98
|
"List as outputs only what this run made. A PR or page you only read, checked or cited goes in the summary, never in outputs.",
|
|
99
|
-
|
|
99
|
+
'When the ask is to find, compare, summarise or research something, the summary is your conclusion in one or two sentences, such as "I recommend X, because Y." Put the whole answer, with your method and caveats, in a doc output with a body, so the owner has one page to read. The page does not repeat the summary.'
|
|
100
100
|
].join("\n");
|
|
101
101
|
var MACHINE_RESULT_INSTRUCTION = [
|
|
102
102
|
RESULT_INSTRUCTION,
|
|
103
103
|
`To show the owner a picture, such as a screenshot of a UI change or a result a picture explains better than words, save it as a PNG, JPEG or WebP file outside the repository (for example in /tmp) and list it as an output: {"kind": "image", "title": "The new sign-in page", "path": "/tmp/sign-in.png"}, with the file's absolute path. Cloop uploads the file and shows it on the run. At most ${RUN_IMAGES_MAX} images, each under ${RUN_IMAGE_MAX_BYTES / (1024 * 1024)} MB. On a Cloop Box, take a picture of a website with the cloop \`browser\` tool: action screenshot shows you the page, and with a title Cloop also attaches the picture to this run and shows it to the owner. You need not list it in your outputs. Use the Playwright browser tool only for a page on localhost, and list its file by path.`,
|
|
104
|
-
`To hand the owner a file
|
|
104
|
+
`To hand the owner a file Cloop cannot show, such as a spreadsheet, a deck, a Word document, a PDF or a CSV, list it as an output: {"kind": "file", "title": "Converge model", "path": "/abs/path/Converge_Model.xlsx"}, with the file's absolute path. Cloop uploads it and the owner downloads it from the Task. Never give the owner a path on this machine as the deliverable: they cannot open it. A file is one of ${fileTypes()}, named with its type's extension. At most ${RUN_FILES_MAX} files, each under ${RUN_FILE_MAX_BYTES / (1024 * 1024)} MB. A page you write (a report, notes, research) is a doc output with the whole text in its body, never a Markdown file: Cloop shows the page and the owner can download it there.`,
|
|
105
105
|
`To let the owner open a web app or page you are running on this machine, such as a dev server, leave the server running after your turn ends: start it in the background, detached from your shell (for example \`nohup npm run dev -- --port 5173 > /tmp/dev.log 2>&1 &\`), and check it answers on its port. Then list it as an output: {"kind": "preview", "title": "The new sign-in page", "port": 5173, "path": "/sign-in"}, with the port it listens on and an optional path to open first. Cloop gives the owner a private link to it for ${PREVIEW_HOURS} hours while this machine is on, or ${BOX_PREVIEW_HOURS} hours on a Cloop Box, where a live preview keeps the box awake: say how long when you give the link. At most ${RUN_PREVIEWS_MAX} previews a run.`,
|
|
106
106
|
`When you started something that keeps running after this turn (a build, a deploy, a long job) or you wait on something outside, do not wait in the turn: add "check_back": {"in_minutes": 120, "why": "Read the training log and report the score."} to the block. Cloop sends you a message in this conversation then, with your why, and you carry on from there. Give ${CHECK_BACK_MIN_MINUTES} to ${CHECK_BACK_MAX_MINUTES} minutes. Leave it out when the work is done.`
|
|
107
107
|
].join("\n");
|
|
@@ -291,6 +291,10 @@ function isProgressSentence(value) {
|
|
|
291
291
|
return typeof value === "string" && /\S[ \t]+\S/.test(value.trim().split(/\r?\n/)[0] ?? "");
|
|
292
292
|
}
|
|
293
293
|
var PROGRESS_MS = 3e4;
|
|
294
|
+
var IDLE_SETTLE_MS = 20 * 6e4;
|
|
295
|
+
function holdsForNextTurn(turn) {
|
|
296
|
+
return turn.completed && !turn.limited && !turn.result;
|
|
297
|
+
}
|
|
294
298
|
var RUN_TEXT_MAX = 4e3;
|
|
295
299
|
function finalWords(text3) {
|
|
296
300
|
return text3.replace(/\r\n?/g, "\n").replace(/[ \t]+$/gm, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
@@ -1544,7 +1548,6 @@ var STATUS_TTL_MS = 3e4;
|
|
|
1544
1548
|
var REPOS_TTL_MS = 10 * 6e4;
|
|
1545
1549
|
var TERMINAL_RUN = /* @__PURE__ */ new Set(["completed", "interrupted", "failed", "cancelled", "rolled_back"]);
|
|
1546
1550
|
var STOPPED_IN_T3 = "You stopped this in T3.";
|
|
1547
|
-
var IDLE_SETTLE_MS = 20 * 6e4;
|
|
1548
1551
|
var APPROVAL_WORDS = {
|
|
1549
1552
|
command: "run a command",
|
|
1550
1553
|
"file-read": "read a file",
|
|
@@ -1637,6 +1640,9 @@ function outcomeOf(p) {
|
|
|
1637
1640
|
...dropped.outputs || dropped.checks ? { dropped } : {}
|
|
1638
1641
|
};
|
|
1639
1642
|
}
|
|
1643
|
+
function holdsAfter(outcome) {
|
|
1644
|
+
return holdsForNextTurn({ completed: outcome.kind === "settled", result: outcome.result });
|
|
1645
|
+
}
|
|
1640
1646
|
function permissionOf(runtimeMode) {
|
|
1641
1647
|
return runtimeMode === "full-access" ? "full" : "ask";
|
|
1642
1648
|
}
|
|
@@ -2355,7 +2361,7 @@ var T3Driver = class {
|
|
|
2355
2361
|
return;
|
|
2356
2362
|
}
|
|
2357
2363
|
const turn = latestRun(p.runs ?? []);
|
|
2358
|
-
if (turn && outcome
|
|
2364
|
+
if (turn && holdsAfter(outcome) && !p.thread.settledAt && turn.id !== waited) {
|
|
2359
2365
|
finishing = false;
|
|
2360
2366
|
if (idle?.runId === turn.id) return;
|
|
2361
2367
|
wake();
|
|
@@ -2680,7 +2686,7 @@ ${MACHINE_RESULT_INSTRUCTION}`
|
|
|
2680
2686
|
|
|
2681
2687
|
// src/drivers/local.ts
|
|
2682
2688
|
import { execFile as execFile3, execFileSync as execFileSync4, spawn } from "child_process";
|
|
2683
|
-
import { chmodSync as chmodSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync2, renameSync as renameSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
2689
|
+
import { chmodSync as chmodSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync2, readdirSync as readdirSync3, renameSync as renameSync3, rmSync, writeFileSync as writeFileSync2 } from "fs";
|
|
2684
2690
|
import { hostname } from "os";
|
|
2685
2691
|
import { basename, dirname as dirname4, join as join8 } from "path";
|
|
2686
2692
|
import { createInterface as createInterface2 } from "readline";
|
|
@@ -2769,6 +2775,27 @@ function holdsRepository2(r, repository) {
|
|
|
2769
2775
|
const want = repoName(repository);
|
|
2770
2776
|
return repoName(r.label) === want || repoName(basename(r.path)) === want;
|
|
2771
2777
|
}
|
|
2778
|
+
function apartLine(busy) {
|
|
2779
|
+
return `Another run is working in ${busy.label} (${busy.path}), so this run has a folder of its own. If this work needs that project's code, do not edit ${busy.path}: make a git worktree of it in this folder and work there. If you open a pull request, put its URL in your result.`;
|
|
2780
|
+
}
|
|
2781
|
+
function pruneApartFolders(dir, kept, repos) {
|
|
2782
|
+
let names;
|
|
2783
|
+
try {
|
|
2784
|
+
names = readdirSync3(dir);
|
|
2785
|
+
} catch {
|
|
2786
|
+
return 0;
|
|
2787
|
+
}
|
|
2788
|
+
const gone = names.filter((name) => !kept.has(name));
|
|
2789
|
+
for (const name of gone) rmSync(join8(dir, name), { recursive: true, force: true });
|
|
2790
|
+
if (gone.length)
|
|
2791
|
+
for (const repo of repos) {
|
|
2792
|
+
try {
|
|
2793
|
+
execFileSync4("git", ["worktree", "prune"], { cwd: repo.path, stdio: "ignore", timeout: 1e4 });
|
|
2794
|
+
} catch {
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
return gone.length;
|
|
2798
|
+
}
|
|
2772
2799
|
function pickRepo(repos, repository) {
|
|
2773
2800
|
const picked = repository && repos.find((r) => holdsRepository2(r, repository)) || repos[0];
|
|
2774
2801
|
if (!picked) throw new BoxToolError("no_project");
|
|
@@ -2851,6 +2878,12 @@ var LocalDriver = class {
|
|
|
2851
2878
|
} catch (err) {
|
|
2852
2879
|
this.log(`run log prune failed: ${err.code ?? "unknown"}`);
|
|
2853
2880
|
}
|
|
2881
|
+
try {
|
|
2882
|
+
const removed = pruneApartFolders(join8(dirname4(this.file), "work"), new Set(this.runs.keys()), deps.repos);
|
|
2883
|
+
if (removed) this.log(`run folders removed=${removed} of runs no longer kept`);
|
|
2884
|
+
} catch (err) {
|
|
2885
|
+
this.log(`run folder prune failed: ${err.code ?? "unknown"}`);
|
|
2886
|
+
}
|
|
2854
2887
|
}
|
|
2855
2888
|
deps;
|
|
2856
2889
|
name;
|
|
@@ -3042,7 +3075,7 @@ var LocalDriver = class {
|
|
|
3042
3075
|
this.log(
|
|
3043
3076
|
`launch work=${a.work_id} has no ${missing}; starts in ${basename(repo.path)} to clone it`
|
|
3044
3077
|
);
|
|
3045
|
-
else this.refuseBusy(repo.path);
|
|
3078
|
+
else if (a.repository) this.refuseBusy(repo.path);
|
|
3046
3079
|
const { dialect, moved } = await this.route(a);
|
|
3047
3080
|
const head = await this.repo.head(repo.path);
|
|
3048
3081
|
const photos2 = await this.photos(a);
|
|
@@ -3055,13 +3088,18 @@ var LocalDriver = class {
|
|
|
3055
3088
|
takeover: true,
|
|
3056
3089
|
harness: this.dialectOf(concurrent).name
|
|
3057
3090
|
};
|
|
3058
|
-
if (!missing) this.refuseBusy(repo.path);
|
|
3091
|
+
if (!missing && a.repository) this.refuseBusy(repo.path);
|
|
3092
|
+
const apart = !missing && !a.repository && this.busy(repo.path) ? join8(dirname4(this.file), "work", a.work_id) : null;
|
|
3093
|
+
if (apart) {
|
|
3094
|
+
mkdirSync3(apart, { recursive: true, mode: 448 });
|
|
3095
|
+
this.log(`launch work=${a.work_id} ${basename(repo.path)} is busy; starts in its own folder`);
|
|
3096
|
+
}
|
|
3059
3097
|
const record = {
|
|
3060
3098
|
work_id: a.work_id,
|
|
3061
3099
|
session_id: dialect.name === "claude-code" ? a.work_id : null,
|
|
3062
|
-
repo: repo.path,
|
|
3100
|
+
repo: apart ?? repo.path,
|
|
3063
3101
|
title: a.title,
|
|
3064
|
-
prompt: [a.prompt, missing && cloneLine(missing), photos2.line].filter(Boolean).join("\n\n"),
|
|
3102
|
+
prompt: [a.prompt, missing && cloneLine(missing), apart && apartLine(repo), photos2.line].filter(Boolean).join("\n\n"),
|
|
3065
3103
|
...photos2.paths.length ? { images: photos2.paths } : {},
|
|
3066
3104
|
...a.model && !moved ? { model: a.model } : {},
|
|
3067
3105
|
...a.runtime_mode ? { runtime_mode: a.runtime_mode } : {},
|
|
@@ -3070,7 +3108,7 @@ var LocalDriver = class {
|
|
|
3070
3108
|
...moved ? { harness: dialect.name, moved, switched: switchedLine(moved, own.name, dialect.name) } : {},
|
|
3071
3109
|
pid: null,
|
|
3072
3110
|
started_at: new Date(this.now()).toISOString(),
|
|
3073
|
-
head_at_launch: head
|
|
3111
|
+
head_at_launch: apart ? null : head
|
|
3074
3112
|
};
|
|
3075
3113
|
this.runs.set(a.work_id, record);
|
|
3076
3114
|
if (moved)
|
|
@@ -3273,8 +3311,10 @@ ${a.text}` : a.text;
|
|
|
3273
3311
|
}
|
|
3274
3312
|
/** One checkout, one run: two harnesses editing the same files at once would undo each other. */
|
|
3275
3313
|
refuseBusy(repo) {
|
|
3276
|
-
if (
|
|
3277
|
-
|
|
3314
|
+
if (this.busy(repo)) throw new BoxToolError("repo_busy");
|
|
3315
|
+
}
|
|
3316
|
+
busy(repo) {
|
|
3317
|
+
return [...this.runs.values()].some((r) => r.repo === repo && !r.end);
|
|
3278
3318
|
}
|
|
3279
3319
|
/** One question at a time, oldest first, so a yes answers the prompt the owner read. */
|
|
3280
3320
|
askNext(r, live) {
|
|
@@ -3632,6 +3672,8 @@ export {
|
|
|
3632
3672
|
BoxToolError,
|
|
3633
3673
|
CLOOP_THREAD_PREFIX,
|
|
3634
3674
|
questionLine,
|
|
3675
|
+
IDLE_SETTLE_MS,
|
|
3676
|
+
holdsForNextTurn,
|
|
3635
3677
|
RUN_TEXT_MAX,
|
|
3636
3678
|
finalWords,
|
|
3637
3679
|
nextProgress,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
readRunnerState,
|
|
10
10
|
runnerStatePath,
|
|
11
11
|
threadsFilePath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TUGKGUV3.js";
|
|
13
13
|
import {
|
|
14
14
|
BoxToolError,
|
|
15
15
|
CLOOP_THREAD_PREFIX,
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
windowsExecutable,
|
|
51
51
|
windowsPowerShellEnv,
|
|
52
52
|
writeBoxConfig
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-PMH5WSQK.js";
|
|
54
54
|
import {
|
|
55
55
|
CLAUDE_FLOOR,
|
|
56
56
|
CODEX_FLOOR,
|
|
@@ -64,14 +64,14 @@ import {
|
|
|
64
64
|
} from "./chunk-PKIEWBR7.js";
|
|
65
65
|
import {
|
|
66
66
|
connectWebhook
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-IUBEQ342.js";
|
|
68
68
|
import {
|
|
69
69
|
ConnectFailure,
|
|
70
70
|
connectReport,
|
|
71
71
|
deviceLogin,
|
|
72
72
|
newAttempt,
|
|
73
73
|
sendConnectReport
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-LZ4NZTA2.js";
|
|
75
75
|
import {
|
|
76
76
|
defaultDeviceName,
|
|
77
77
|
getMachine,
|
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
} from "./chunk-SBYSVZ7J.js";
|
|
80
80
|
import {
|
|
81
81
|
VERSION
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-PTOPXY65.js";
|
|
83
83
|
import {
|
|
84
84
|
STAGING_ORIGIN,
|
|
85
85
|
getOrigin,
|
|
@@ -54,17 +54,17 @@ import {
|
|
|
54
54
|
which,
|
|
55
55
|
workFolder,
|
|
56
56
|
workFolderLine
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-QLZYSUGR.js";
|
|
58
58
|
import "./chunk-BI2Y5ZCL.js";
|
|
59
|
-
import "./chunk-
|
|
60
|
-
import "./chunk-
|
|
59
|
+
import "./chunk-TUGKGUV3.js";
|
|
60
|
+
import "./chunk-PMH5WSQK.js";
|
|
61
61
|
import "./chunk-VK6GV757.js";
|
|
62
62
|
import "./chunk-365HFCQQ.js";
|
|
63
63
|
import "./chunk-PKIEWBR7.js";
|
|
64
|
-
import "./chunk-
|
|
65
|
-
import "./chunk-
|
|
64
|
+
import "./chunk-IUBEQ342.js";
|
|
65
|
+
import "./chunk-LZ4NZTA2.js";
|
|
66
66
|
import "./chunk-SBYSVZ7J.js";
|
|
67
|
-
import "./chunk-
|
|
67
|
+
import "./chunk-PTOPXY65.js";
|
|
68
68
|
import "./chunk-D5UZW42X.js";
|
|
69
69
|
export {
|
|
70
70
|
DEFAULT_T3_URL,
|
|
@@ -7,17 +7,17 @@ import {
|
|
|
7
7
|
runnerOrigin,
|
|
8
8
|
stopService,
|
|
9
9
|
unitOrigin
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QLZYSUGR.js";
|
|
11
11
|
import "./chunk-BI2Y5ZCL.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-TUGKGUV3.js";
|
|
13
|
+
import "./chunk-PMH5WSQK.js";
|
|
14
14
|
import "./chunk-VK6GV757.js";
|
|
15
15
|
import "./chunk-365HFCQQ.js";
|
|
16
16
|
import "./chunk-PKIEWBR7.js";
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-IUBEQ342.js";
|
|
18
|
+
import "./chunk-LZ4NZTA2.js";
|
|
19
19
|
import "./chunk-SBYSVZ7J.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-PTOPXY65.js";
|
|
21
21
|
import "./chunk-D5UZW42X.js";
|
|
22
22
|
export {
|
|
23
23
|
disconnect,
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
existingRunnerEnvironment,
|
|
4
4
|
pinExistingRunner
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QLZYSUGR.js";
|
|
6
6
|
import "./chunk-BI2Y5ZCL.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-TUGKGUV3.js";
|
|
8
|
+
import "./chunk-PMH5WSQK.js";
|
|
9
9
|
import "./chunk-VK6GV757.js";
|
|
10
10
|
import "./chunk-365HFCQQ.js";
|
|
11
11
|
import "./chunk-PKIEWBR7.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-IUBEQ342.js";
|
|
13
|
+
import "./chunk-LZ4NZTA2.js";
|
|
14
14
|
import "./chunk-SBYSVZ7J.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-PTOPXY65.js";
|
|
16
16
|
import "./chunk-D5UZW42X.js";
|
|
17
17
|
export {
|
|
18
18
|
existingRunnerEnvironment,
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-365HFCQQ.js";
|
|
5
5
|
import {
|
|
6
6
|
VERSION
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PTOPXY65.js";
|
|
8
8
|
import {
|
|
9
9
|
applyEnvironmentFlag
|
|
10
10
|
} from "./chunk-D5UZW42X.js";
|
|
@@ -69,7 +69,7 @@ Add --staging to any command to use Cloop staging instead of production.
|
|
|
69
69
|
A production machine and a staging machine can run side by side on one computer.
|
|
70
70
|
`;
|
|
71
71
|
async function pinExistingRunner() {
|
|
72
|
-
const { pinExistingRunner: pin } = await import("./existing-runner-
|
|
72
|
+
const { pinExistingRunner: pin } = await import("./existing-runner-FNLWQGFZ.js");
|
|
73
73
|
const { note } = pin();
|
|
74
74
|
if (note) console.error(note);
|
|
75
75
|
}
|
|
@@ -77,7 +77,7 @@ async function main() {
|
|
|
77
77
|
switch (command) {
|
|
78
78
|
case "login":
|
|
79
79
|
case "auth": {
|
|
80
|
-
const { loginCommand } = await import("./login-
|
|
80
|
+
const { loginCommand } = await import("./login-64IZF4QT.js");
|
|
81
81
|
await loginCommand(argv);
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
@@ -87,61 +87,61 @@ async function main() {
|
|
|
87
87
|
break;
|
|
88
88
|
}
|
|
89
89
|
case "serve": {
|
|
90
|
-
const { startMcpServer } = await import("./mcp-server-
|
|
90
|
+
const { startMcpServer } = await import("./mcp-server-X4MIHXI4.js");
|
|
91
91
|
await startMcpServer();
|
|
92
92
|
break;
|
|
93
93
|
}
|
|
94
94
|
case "statusline": {
|
|
95
|
-
const { statuslineCommand } = await import("./statusline-
|
|
95
|
+
const { statuslineCommand } = await import("./statusline-FKJDEYAA.js");
|
|
96
96
|
statuslineCommand();
|
|
97
97
|
break;
|
|
98
98
|
}
|
|
99
99
|
case "connect": {
|
|
100
|
-
const { connectCommand } = await import("./connect-
|
|
100
|
+
const { connectCommand } = await import("./connect-QWFKIR2A.js");
|
|
101
101
|
await connectCommand(argv.slice(1));
|
|
102
102
|
break;
|
|
103
103
|
}
|
|
104
104
|
case "use": {
|
|
105
|
-
const { useCommand } = await import("./use-
|
|
105
|
+
const { useCommand } = await import("./use-RASS2OSW.js");
|
|
106
106
|
process.exitCode = await useCommand(argv.slice(1));
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
109
|
case "disconnect": {
|
|
110
|
-
const { disconnectCommand } = await import("./disconnect-
|
|
110
|
+
const { disconnectCommand } = await import("./disconnect-DYPSIUVQ.js");
|
|
111
111
|
await disconnectCommand(argv.slice(1));
|
|
112
112
|
break;
|
|
113
113
|
}
|
|
114
114
|
case "box": {
|
|
115
|
-
const { boxCommand } = await import("./box-
|
|
115
|
+
const { boxCommand } = await import("./box-OPKO2EY6.js");
|
|
116
116
|
await boxCommand(argv.slice(1));
|
|
117
117
|
break;
|
|
118
118
|
}
|
|
119
119
|
case "runs": {
|
|
120
120
|
await pinExistingRunner();
|
|
121
|
-
const { runsCommand } = await import("./runs-
|
|
121
|
+
const { runsCommand } = await import("./runs-62FX5IQ6.js");
|
|
122
122
|
process.exitCode = runsCommand();
|
|
123
123
|
break;
|
|
124
124
|
}
|
|
125
125
|
case "watch": {
|
|
126
126
|
await pinExistingRunner();
|
|
127
|
-
const { watchCommand } = await import("./runs-
|
|
127
|
+
const { watchCommand } = await import("./runs-62FX5IQ6.js");
|
|
128
128
|
process.exitCode = await watchCommand(argv.slice(1));
|
|
129
129
|
break;
|
|
130
130
|
}
|
|
131
131
|
case "takeover": {
|
|
132
132
|
await pinExistingRunner();
|
|
133
|
-
const { takeoverCommand } = await import("./takeover-
|
|
133
|
+
const { takeoverCommand } = await import("./takeover-FUQV257E.js");
|
|
134
134
|
process.exitCode = await takeoverCommand(argv.slice(1));
|
|
135
135
|
break;
|
|
136
136
|
}
|
|
137
137
|
case "resume": {
|
|
138
138
|
await pinExistingRunner();
|
|
139
|
-
const { resumeCommand } = await import("./runs-
|
|
139
|
+
const { resumeCommand } = await import("./runs-62FX5IQ6.js");
|
|
140
140
|
process.exitCode = await resumeCommand(argv.slice(1));
|
|
141
141
|
break;
|
|
142
142
|
}
|
|
143
143
|
case "runner": {
|
|
144
|
-
const { runnerCommand } = await import("./runner-
|
|
144
|
+
const { runnerCommand } = await import("./runner-RHKB5LKX.js");
|
|
145
145
|
await runnerCommand(argv.slice(1));
|
|
146
146
|
break;
|
|
147
147
|
}
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
deviceLogin,
|
|
4
4
|
loginCommand,
|
|
5
5
|
refusalSentence
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LZ4NZTA2.js";
|
|
7
7
|
import "./chunk-SBYSVZ7J.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-PTOPXY65.js";
|
|
9
9
|
import "./chunk-D5UZW42X.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-IUBEQ342.js";
|
|
6
|
+
import "./chunk-LZ4NZTA2.js";
|
|
7
7
|
import "./chunk-SBYSVZ7J.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-PTOPXY65.js";
|
|
9
9
|
import "./chunk-D5UZW42X.js";
|
|
10
10
|
export {
|
|
11
11
|
connectWebhook,
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
runsCommand,
|
|
10
10
|
sessionFolder,
|
|
11
11
|
watchCommand
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-OWYY764F.js";
|
|
13
|
+
import "./chunk-PMH5WSQK.js";
|
|
14
14
|
import "./chunk-VK6GV757.js";
|
|
15
15
|
import "./chunk-D5UZW42X.js";
|
|
16
16
|
export {
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
takeoverDir,
|
|
10
10
|
writeTakeoverReply,
|
|
11
11
|
writeTakeoverRequest
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-CBUSTVCH.js";
|
|
13
|
+
import "./chunk-OWYY764F.js";
|
|
14
|
+
import "./chunk-TUGKGUV3.js";
|
|
15
|
+
import "./chunk-PMH5WSQK.js";
|
|
16
16
|
import "./chunk-VK6GV757.js";
|
|
17
17
|
import "./chunk-SBYSVZ7J.js";
|
|
18
18
|
import "./chunk-D5UZW42X.js";
|
|
@@ -3,20 +3,20 @@ import {
|
|
|
3
3
|
DRIVER_NAME,
|
|
4
4
|
pinExistingRunner,
|
|
5
5
|
runConnect
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QLZYSUGR.js";
|
|
7
7
|
import "./chunk-BI2Y5ZCL.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-TUGKGUV3.js";
|
|
9
9
|
import {
|
|
10
10
|
isLocal,
|
|
11
11
|
readRunnerConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PMH5WSQK.js";
|
|
13
13
|
import "./chunk-VK6GV757.js";
|
|
14
14
|
import "./chunk-365HFCQQ.js";
|
|
15
15
|
import "./chunk-PKIEWBR7.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-IUBEQ342.js";
|
|
17
|
+
import "./chunk-LZ4NZTA2.js";
|
|
18
18
|
import "./chunk-SBYSVZ7J.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-PTOPXY65.js";
|
|
20
20
|
import "./chunk-D5UZW42X.js";
|
|
21
21
|
|
|
22
22
|
// src/commands/use.ts
|
package/package.json
CHANGED