@cloop/runner 0.3.59 → 0.3.62
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-AJGVOLMF.js → box-3CZIKC6H.js} +190 -39
- package/dist/{chunk-BI2Y5ZCL.js → chunk-5RB7XKPB.js} +2 -1
- package/dist/{chunk-HBBEFTXE.js → chunk-7YTPL6VG.js} +1 -1
- package/dist/{chunk-WE3NUVJI.js → chunk-ADT3PMYQ.js} +1 -1
- package/dist/{chunk-7GRP7ZX4.js → chunk-CUSQXHR6.js} +1 -1
- package/dist/{chunk-EHXAIGHI.js → chunk-DTAMCVUY.js} +18 -8
- package/dist/{chunk-GRYTOE6F.js → chunk-IRXCIO7U.js} +3 -3
- package/dist/{chunk-5MZDMAY2.js → chunk-J247WS7A.js} +11 -3
- package/dist/{chunk-CJKE7ELD.js → chunk-LFSIT2WB.js} +1 -1
- package/dist/{chunk-BIECV55V.js → chunk-NOKR7P5V.js} +1 -1
- package/dist/{connect-3566SIPL.js → connect-ERGLJSZO.js} +9 -7
- package/dist/{disconnect-VTPVRXXC.js → disconnect-7JNCCZOP.js} +7 -7
- package/dist/{existing-runner-USM27GSJ.js → existing-runner-2KYDHSFA.js} +7 -7
- package/dist/index.js +14 -14
- package/dist/{login-SUVMQUIZ.js → login-ID3ZTPSR.js} +2 -2
- package/dist/{mcp-server-HPSCTFVB.js → mcp-server-4CJUB63Q.js} +2 -2
- package/dist/{runner-F3HVBTUZ.js → runner-GL4F3GUD.js} +3 -3
- package/dist/{runs-IU47AXGO.js → runs-WMZTZXJ6.js} +2 -2
- package/dist/{statusline-ACJ6FK6M.js → statusline-JXETQIKS.js} +1 -1
- package/dist/{takeover-WNMI3ITX.js → takeover-CSFKISDC.js} +4 -4
- package/dist/{use-PMAT5XOG.js → use-LRGHLUC3.js} +7 -7
- 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-IRXCIO7U.js";
|
|
5
|
+
import "./chunk-ADT3PMYQ.js";
|
|
6
6
|
import {
|
|
7
7
|
CAPTURE_TICK_MS,
|
|
8
8
|
DEFAULT_FALLBACK_MODEL,
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
connectCommand,
|
|
24
24
|
findNpx,
|
|
25
25
|
installedService,
|
|
26
|
+
isRelease,
|
|
26
27
|
legacyStagingRunner,
|
|
27
28
|
mintSession,
|
|
28
29
|
moveLegacyStagingRunner,
|
|
@@ -39,7 +40,7 @@ import {
|
|
|
39
40
|
systemServices,
|
|
40
41
|
unitFor,
|
|
41
42
|
which
|
|
42
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-DTAMCVUY.js";
|
|
43
44
|
import {
|
|
44
45
|
MeshSocket,
|
|
45
46
|
WAKE_TICK_MS,
|
|
@@ -47,7 +48,7 @@ import {
|
|
|
47
48
|
defaultSocketFactory,
|
|
48
49
|
runnerLog,
|
|
49
50
|
wakeWatch
|
|
50
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-5RB7XKPB.js";
|
|
51
52
|
import {
|
|
52
53
|
BoxWatch,
|
|
53
54
|
hostedThreadsFilePath,
|
|
@@ -57,12 +58,13 @@ import {
|
|
|
57
58
|
runnerStatePath,
|
|
58
59
|
threadsFilePath,
|
|
59
60
|
writeRunnerState
|
|
60
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-CUSQXHR6.js";
|
|
61
62
|
import {
|
|
62
63
|
BackgroundReading,
|
|
63
64
|
BoxToolError,
|
|
64
65
|
HARNESS_LIMIT,
|
|
65
66
|
HARNESS_STALE_MS,
|
|
67
|
+
IDLE_SETTLE_MS,
|
|
66
68
|
LocalDriver,
|
|
67
69
|
MACHINE_RESULT_INSTRUCTION,
|
|
68
70
|
RUN_TEXT_MAX,
|
|
@@ -80,6 +82,7 @@ import {
|
|
|
80
82
|
fetchImages,
|
|
81
83
|
finalWords,
|
|
82
84
|
hasResultBlock,
|
|
85
|
+
holdsForNextTurn,
|
|
83
86
|
isHosted,
|
|
84
87
|
isLocal,
|
|
85
88
|
isT3,
|
|
@@ -107,20 +110,20 @@ import {
|
|
|
107
110
|
utcWindow,
|
|
108
111
|
windowsPowerShellEnv,
|
|
109
112
|
writeBoxConfig
|
|
110
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-J247WS7A.js";
|
|
111
114
|
import "./chunk-VK6GV757.js";
|
|
112
115
|
import {
|
|
113
116
|
olderThan
|
|
114
117
|
} from "./chunk-365HFCQQ.js";
|
|
115
118
|
import "./chunk-PKIEWBR7.js";
|
|
116
|
-
import "./chunk-
|
|
117
|
-
import "./chunk-
|
|
119
|
+
import "./chunk-7YTPL6VG.js";
|
|
120
|
+
import "./chunk-NOKR7P5V.js";
|
|
118
121
|
import {
|
|
119
122
|
getMachine
|
|
120
123
|
} from "./chunk-SBYSVZ7J.js";
|
|
121
124
|
import {
|
|
122
125
|
VERSION
|
|
123
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-LFSIT2WB.js";
|
|
124
127
|
import {
|
|
125
128
|
getMeshUrl,
|
|
126
129
|
getOrigin,
|
|
@@ -171,7 +174,8 @@ function parseRecord(raw) {
|
|
|
171
174
|
switch (r.kind) {
|
|
172
175
|
case "receipt": {
|
|
173
176
|
const receipt = parseReceipt(data);
|
|
174
|
-
|
|
177
|
+
const at = num(r.timestamp_ms);
|
|
178
|
+
return receipt ? { sequence, kind: "receipt", receipt, ...at === null ? {} : { at } } : { sequence, kind: "other" };
|
|
175
179
|
}
|
|
176
180
|
case "state": {
|
|
177
181
|
const state = str(data.state);
|
|
@@ -359,7 +363,7 @@ function sseRecord(block) {
|
|
|
359
363
|
|
|
360
364
|
// src/drivers/cloudroom.ts
|
|
361
365
|
import { createHash } from "crypto";
|
|
362
|
-
import { chmodSync, mkdirSync as mkdirSync2, readFileSync, renameSync as renameSync2, writeFileSync } from "fs";
|
|
366
|
+
import { chmodSync, mkdirSync as mkdirSync2, readFileSync, renameSync as renameSync2, rmSync as rmSync2, writeFileSync } from "fs";
|
|
363
367
|
import { basename, dirname, join as join2 } from "path";
|
|
364
368
|
|
|
365
369
|
// src/drivers/cloudroom-repos.ts
|
|
@@ -606,7 +610,8 @@ var NEW_FOLD = {
|
|
|
606
610
|
after: 0,
|
|
607
611
|
spoken: null,
|
|
608
612
|
lastProgressAt: 0,
|
|
609
|
-
ended: false
|
|
613
|
+
ended: false,
|
|
614
|
+
rest: null
|
|
610
615
|
};
|
|
611
616
|
var PENDING = /* @__PURE__ */ new Set(["accepted", "delivered", "running"]);
|
|
612
617
|
var DEAD = /* @__PURE__ */ new Set(["closed", "failed", "process_lost"]);
|
|
@@ -633,11 +638,11 @@ function apply(fold, r) {
|
|
|
633
638
|
case "receipt": {
|
|
634
639
|
const { command, state, error, request_id, target } = r.receipt;
|
|
635
640
|
if (command === "start") fold.start = { state, error };
|
|
636
|
-
else if (command === "prompt") {
|
|
637
|
-
|
|
641
|
+
else if (command === "prompt" || command === "auto") {
|
|
642
|
+
let turn = fold.turns.find((t) => t.id === request_id);
|
|
638
643
|
if (turn) Object.assign(turn, { state, error });
|
|
639
|
-
else
|
|
640
|
-
|
|
644
|
+
else {
|
|
645
|
+
turn = {
|
|
641
646
|
id: request_id,
|
|
642
647
|
state,
|
|
643
648
|
error,
|
|
@@ -645,7 +650,10 @@ function apply(fold, r) {
|
|
|
645
650
|
limited: false,
|
|
646
651
|
item: null,
|
|
647
652
|
text: ""
|
|
648
|
-
}
|
|
653
|
+
};
|
|
654
|
+
fold.turns.push(turn);
|
|
655
|
+
}
|
|
656
|
+
if (!PENDING.has(state) && r.at !== void 0) turn.endedAt = r.at;
|
|
649
657
|
} else if (command === "cancel" && (state === "accepted" || state === "completed")) {
|
|
650
658
|
const turn = fold.turns.find((t) => t.id === target);
|
|
651
659
|
if (turn) turn.cancelled = true;
|
|
@@ -699,7 +707,23 @@ function failedRun(harness, state, said, limited) {
|
|
|
699
707
|
});
|
|
700
708
|
return { kind: "failed", summary, ...error };
|
|
701
709
|
}
|
|
702
|
-
function
|
|
710
|
+
function resultOf(turn) {
|
|
711
|
+
return readRunResult(resultText(turn.text.trim(), turn.block)).result;
|
|
712
|
+
}
|
|
713
|
+
function holds(turn) {
|
|
714
|
+
return holdsForNextTurn({
|
|
715
|
+
completed: turn.state === "completed",
|
|
716
|
+
limited: turn.limited,
|
|
717
|
+
result: resultOf(turn)
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
function restingTurn(fold) {
|
|
721
|
+
const turns = fold.turns.filter((t) => !t.cancelled);
|
|
722
|
+
if (turns.some((t) => PENDING.has(t.state))) return void 0;
|
|
723
|
+
const last = turns.at(-1);
|
|
724
|
+
return last && holds(last) ? last : void 0;
|
|
725
|
+
}
|
|
726
|
+
function runEnd(fold, harness, now, idleMs = IDLE_SETTLE_MS) {
|
|
703
727
|
const turns = fold.turns.filter((t) => !t.cancelled);
|
|
704
728
|
if (turns.some((t) => PENDING.has(t.state)))
|
|
705
729
|
return fold.session && DEAD.has(fold.session) ? failedRun(harness, fold.session, null, false) : null;
|
|
@@ -711,9 +735,13 @@ function runEnd(fold, harness) {
|
|
|
711
735
|
return failedRun(harness, fold.start.state, fold.start.error, false);
|
|
712
736
|
return null;
|
|
713
737
|
}
|
|
738
|
+
if (holds(last)) {
|
|
739
|
+
const since = fold.rest?.turn === last.id ? fold.rest.at : now;
|
|
740
|
+
if (now - since < idleMs) return null;
|
|
741
|
+
}
|
|
714
742
|
if (last.state === "completed" && !last.limited) {
|
|
715
743
|
const text = last.text.trim();
|
|
716
|
-
const result =
|
|
744
|
+
const result = resultOf(last);
|
|
717
745
|
const pr = resultPrUrl(text);
|
|
718
746
|
const summary = finalWords(text).slice(0, RUN_TEXT_MAX);
|
|
719
747
|
return {
|
|
@@ -735,11 +763,22 @@ function foldRecords(fold, records, opts) {
|
|
|
735
763
|
said = apply(next, r) ?? said;
|
|
736
764
|
}
|
|
737
765
|
if (next.ended) return { state: next, events: [] };
|
|
738
|
-
const
|
|
766
|
+
const resting = restingTurn(next);
|
|
767
|
+
const rests = resting !== void 0 && next.rest?.turn !== resting.id;
|
|
768
|
+
if (!resting) next.rest = null;
|
|
769
|
+
else if (rests) next.rest = { turn: resting.id, at: resting.endedAt ?? opts.now };
|
|
770
|
+
const end = runEnd(next, opts.harness, opts.now, opts.idleMs);
|
|
739
771
|
if (end) {
|
|
740
772
|
next.ended = true;
|
|
741
773
|
return { state: next, events: [end] };
|
|
742
774
|
}
|
|
775
|
+
if (resting && rests) {
|
|
776
|
+
next.spoken = resting.text;
|
|
777
|
+
const clock2 = { lastProgressAt: next.lastProgressAt };
|
|
778
|
+
const summary2 = nextProgress(clock2, resting.text, opts.now, opts.progressMs, true);
|
|
779
|
+
next.lastProgressAt = clock2.lastProgressAt;
|
|
780
|
+
return { state: next, events: summary2 ? [{ kind: "progress", summary: summary2 }] : [] };
|
|
781
|
+
}
|
|
743
782
|
if (!said || said.cancelled || !PENDING.has(said.state) || said.text === next.spoken)
|
|
744
783
|
return { state: next, events: [] };
|
|
745
784
|
next.spoken = said.text;
|
|
@@ -781,6 +820,7 @@ function unpreparedEnd(harness, err) {
|
|
|
781
820
|
);
|
|
782
821
|
return { kind: "failed", summary };
|
|
783
822
|
}
|
|
823
|
+
var REST_LEASE_MARGIN_MS = 2 * 6e4;
|
|
784
824
|
var sleep = (ms) => new Promise((resolve) => {
|
|
785
825
|
const timer = setTimeout(resolve, ms);
|
|
786
826
|
timer.unref?.();
|
|
@@ -897,6 +937,8 @@ var CloudroomDriver = class {
|
|
|
897
937
|
kept;
|
|
898
938
|
/** Runs looking for the next model, by thread. */
|
|
899
939
|
moving = /* @__PURE__ */ new Set();
|
|
940
|
+
/** Runs that wait after a turn without a result, by thread: ends the run on a Stop. */
|
|
941
|
+
resting = /* @__PURE__ */ new Map();
|
|
900
942
|
/** The account's models, best first, while CATALOG_MS lasts. */
|
|
901
943
|
catalog = null;
|
|
902
944
|
/** The run's last move off a refused model, if it moved. */
|
|
@@ -976,6 +1018,45 @@ var CloudroomDriver = class {
|
|
|
976
1018
|
now() {
|
|
977
1019
|
return this.deps.now?.() ?? Date.now();
|
|
978
1020
|
}
|
|
1021
|
+
get idleMs() {
|
|
1022
|
+
return this.deps.idleMs ?? IDLE_SETTLE_MS;
|
|
1023
|
+
}
|
|
1024
|
+
/** A hold's step, to the mesh (runner-log HoldCode), by the run's work id. */
|
|
1025
|
+
holdLog(code, thread, ms) {
|
|
1026
|
+
const work = thread.startsWith(CLOOP_SESSION_PREFIX) ? thread.slice(CLOOP_SESSION_PREFIX.length) : null;
|
|
1027
|
+
this.deps.holdLog?.(code, work, ms);
|
|
1028
|
+
}
|
|
1029
|
+
/** Named after the thread, not the process: a restarted daemon writes or removes the same lease. */
|
|
1030
|
+
leaseFile(thread) {
|
|
1031
|
+
if (!this.deps.awakeDir) return null;
|
|
1032
|
+
const name = createHash("sha256").update(thread).digest("hex").slice(0, 12);
|
|
1033
|
+
return join2(this.deps.awakeDir, `cloop-hold-${name}.json`);
|
|
1034
|
+
}
|
|
1035
|
+
/** On a Cloop Box, a lease (cloop-box AwakeLease) keeps the box up until a held run is due to settle. */
|
|
1036
|
+
lease(thread, until) {
|
|
1037
|
+
const file = this.leaseFile(thread);
|
|
1038
|
+
if (!file || !this.deps.awakeDir) return;
|
|
1039
|
+
try {
|
|
1040
|
+
mkdirSync2(this.deps.awakeDir, { recursive: true });
|
|
1041
|
+
writeFileSync(file, JSON.stringify({ label: "held run", until }));
|
|
1042
|
+
} catch (err) {
|
|
1043
|
+
this.log(
|
|
1044
|
+
`awake lease not written thread=${thread} reason=${err instanceof Error ? err.message : "error"}`
|
|
1045
|
+
);
|
|
1046
|
+
this.holdLog("hold_unleased", thread);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
unlease(thread) {
|
|
1050
|
+
const file = this.leaseFile(thread);
|
|
1051
|
+
if (!file) return;
|
|
1052
|
+
try {
|
|
1053
|
+
rmSync2(file, { force: true });
|
|
1054
|
+
} catch (err) {
|
|
1055
|
+
this.log(
|
|
1056
|
+
`awake lease not removed thread=${thread} reason=${err instanceof Error ? err.message : "error"}`
|
|
1057
|
+
);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
979
1060
|
log(line) {
|
|
980
1061
|
this.deps.log?.(line);
|
|
981
1062
|
}
|
|
@@ -1059,7 +1140,7 @@ var CloudroomDriver = class {
|
|
|
1059
1140
|
const id = this.carrier(thread);
|
|
1060
1141
|
const session = await this.session(id);
|
|
1061
1142
|
const fold = await this.history(id);
|
|
1062
|
-
const found = runEnd(fold, this.harness);
|
|
1143
|
+
const found = runEnd(fold, this.harness, this.now(), this.idleMs);
|
|
1063
1144
|
const switched = found?.error === "interrupted" ? null : this.movedOf(thread)?.switched;
|
|
1064
1145
|
const end = found && switched ? opened(found, switched) : found;
|
|
1065
1146
|
const last = fold.turns.filter((t) => !t.cancelled).at(-1);
|
|
@@ -1243,7 +1324,8 @@ var CloudroomDriver = class {
|
|
|
1243
1324
|
if (s.receipts[steer]) return { delivered: "steer" };
|
|
1244
1325
|
if (s.receipts[queue]) return { delivered: "queue" };
|
|
1245
1326
|
const running = busy(s);
|
|
1246
|
-
if (!running && !a.resume
|
|
1327
|
+
if (!running && !a.resume && !this.resting.has(a.thread_id))
|
|
1328
|
+
throw new BoxToolError("already_finished");
|
|
1247
1329
|
const deliver = async () => {
|
|
1248
1330
|
if (a.mode === "steer" && s.steer && s.current_request) {
|
|
1249
1331
|
try {
|
|
@@ -1333,7 +1415,9 @@ ${line}` : line;
|
|
|
1333
1415
|
this.log(`interrupt thread=${id} while moving model`);
|
|
1334
1416
|
return { ok: true, was_running: true };
|
|
1335
1417
|
}
|
|
1336
|
-
|
|
1418
|
+
const stopped = await this.stopRun(this.carrier(id), commandId);
|
|
1419
|
+
if (!stopped.was_running && this.resting.get(id)?.()) return { ok: true, was_running: true };
|
|
1420
|
+
return stopped;
|
|
1337
1421
|
}
|
|
1338
1422
|
async stopRun(id, commandId) {
|
|
1339
1423
|
const s = await this.session(id);
|
|
@@ -1399,6 +1483,11 @@ ${line}` : line;
|
|
|
1399
1483
|
* while a child works or a turn waits, and looks again every
|
|
1400
1484
|
* CHILDREN_WAIT_MS in case a child ends without a reply.
|
|
1401
1485
|
*
|
|
1486
|
+
* A turn that completes without a result block holds the run open (the
|
|
1487
|
+
* fold's `rest`): a new turn carries it on, a Stop ends it, and a timer
|
|
1488
|
+
* ticks the fold when idleMs of nothing has passed, so the run settles
|
|
1489
|
+
* with its last words although no record came.
|
|
1490
|
+
*
|
|
1402
1491
|
* A run the account refused its model moves to a new session (moveModel)
|
|
1403
1492
|
* and the watch follows that one under the same thread, from the run's
|
|
1404
1493
|
* kept facts after a restart too.
|
|
@@ -1416,9 +1505,19 @@ ${line}` : line;
|
|
|
1416
1505
|
let stopped = false;
|
|
1417
1506
|
let live = null;
|
|
1418
1507
|
let waits = 0;
|
|
1508
|
+
let ticking = null;
|
|
1509
|
+
let leased = false;
|
|
1510
|
+
const quiet = () => {
|
|
1511
|
+
if (ticking) clearTimeout(ticking.timer);
|
|
1512
|
+
ticking = null;
|
|
1513
|
+
this.resting.delete(id);
|
|
1514
|
+
if (leased) this.unlease(id);
|
|
1515
|
+
leased = false;
|
|
1516
|
+
};
|
|
1419
1517
|
const stop = () => {
|
|
1420
1518
|
stopped = true;
|
|
1421
1519
|
live?.abort();
|
|
1520
|
+
quiet();
|
|
1422
1521
|
};
|
|
1423
1522
|
const end = async (event) => {
|
|
1424
1523
|
const refused = event.kind === "failed" && !event.error ? refusedModel(event.summary) : null;
|
|
@@ -1443,25 +1542,62 @@ ${line}` : line;
|
|
|
1443
1542
|
const wait = ++waits;
|
|
1444
1543
|
await sleep(CHILDREN_WAIT_MS);
|
|
1445
1544
|
if (stopped || fold.ended || wait !== waits) return;
|
|
1446
|
-
const again = runEnd(fold, this.harness);
|
|
1545
|
+
const again = runEnd(fold, this.harness, this.now(), this.idleMs);
|
|
1447
1546
|
if (!again) return;
|
|
1448
1547
|
fold = { ...fold, ended: true };
|
|
1449
1548
|
return end(again);
|
|
1450
1549
|
}
|
|
1451
1550
|
if (stopped) return;
|
|
1551
|
+
if (event.kind === "settled" && restingTurn(fold)) this.holdLog("hold_expired", id);
|
|
1452
1552
|
stop();
|
|
1453
1553
|
const told = await this.tidy(session, event);
|
|
1454
1554
|
const switched = told.error === "interrupted" ? null : this.movedOf(id)?.switched;
|
|
1455
1555
|
onEvent(switched ? opened(told, switched) : told);
|
|
1456
1556
|
};
|
|
1457
|
-
const
|
|
1458
|
-
|
|
1557
|
+
const tick = () => {
|
|
1558
|
+
const rest = fold.ended ? null : fold.rest;
|
|
1559
|
+
if (ticking && ticking.turn === rest?.turn) return;
|
|
1560
|
+
if (ticking && fold.turns.at(-1)?.id !== ticking.turn) {
|
|
1561
|
+
this.log(`new turn thread=${id}; the run goes on`);
|
|
1562
|
+
this.holdLog("hold_carried", id);
|
|
1563
|
+
}
|
|
1564
|
+
quiet();
|
|
1565
|
+
if (!rest) return;
|
|
1566
|
+
const due = rest.at + this.idleMs;
|
|
1567
|
+
const wait = Math.max(0, due - this.now());
|
|
1568
|
+
const timer = setTimeout(() => {
|
|
1569
|
+
ticking = null;
|
|
1570
|
+
take(session, [], Math.max(due, this.now()));
|
|
1571
|
+
}, wait);
|
|
1572
|
+
timer.unref?.();
|
|
1573
|
+
ticking = { turn: rest.turn, timer };
|
|
1574
|
+
this.lease(id, due + REST_LEASE_MARGIN_MS);
|
|
1575
|
+
leased = true;
|
|
1576
|
+
this.resting.set(id, () => {
|
|
1577
|
+
if (stopped || fold.ended) return false;
|
|
1578
|
+
fold = { ...fold, ended: true };
|
|
1579
|
+
quiet();
|
|
1580
|
+
this.log(`stopped a held run thread=${id}`);
|
|
1581
|
+
void end({ kind: "failed", summary: STOPPED_SUMMARY, error: "interrupted" });
|
|
1582
|
+
return true;
|
|
1583
|
+
});
|
|
1584
|
+
this.log(
|
|
1585
|
+
`turn ended without a result thread=${id} turn=${rest.turn}; settling in ${Math.round(wait / 6e4)} min unless a new turn starts`
|
|
1586
|
+
);
|
|
1587
|
+
this.holdLog("run_held", id, wait);
|
|
1588
|
+
if (fold.turns.find((t) => t.id === rest.turn)?.endedAt === void 0)
|
|
1589
|
+
this.holdLog("hold_untimed", id);
|
|
1590
|
+
};
|
|
1591
|
+
const take = (from, records, now = this.now()) => {
|
|
1592
|
+
if (stopped || from !== session) return;
|
|
1459
1593
|
const next = foldRecords(fold, records, {
|
|
1460
1594
|
harness: this.harness,
|
|
1461
|
-
now
|
|
1462
|
-
progressMs: this.deps.progressMs
|
|
1595
|
+
now,
|
|
1596
|
+
progressMs: this.deps.progressMs,
|
|
1597
|
+
idleMs: this.idleMs
|
|
1463
1598
|
});
|
|
1464
1599
|
fold = next.state;
|
|
1600
|
+
tick();
|
|
1465
1601
|
for (const event of next.events) {
|
|
1466
1602
|
if (stopped) return;
|
|
1467
1603
|
if (event.kind === "settled" || event.kind === "failed") {
|
|
@@ -1675,7 +1811,11 @@ ${line}` : line;
|
|
|
1675
1811
|
if (page.length < EVENTS_PAGE) break;
|
|
1676
1812
|
after = page.at(-1)?.sequence ?? after;
|
|
1677
1813
|
}
|
|
1678
|
-
return foldRecords(NEW_FOLD, records, {
|
|
1814
|
+
return foldRecords(NEW_FOLD, records, {
|
|
1815
|
+
harness: this.harness,
|
|
1816
|
+
now: this.now(),
|
|
1817
|
+
idleMs: this.idleMs
|
|
1818
|
+
}).state;
|
|
1679
1819
|
}
|
|
1680
1820
|
};
|
|
1681
1821
|
|
|
@@ -2124,7 +2264,7 @@ import {
|
|
|
2124
2264
|
readFileSync as readFileSync2,
|
|
2125
2265
|
readdirSync,
|
|
2126
2266
|
realpathSync,
|
|
2127
|
-
rmSync as
|
|
2267
|
+
rmSync as rmSync3,
|
|
2128
2268
|
symlinkSync
|
|
2129
2269
|
} from "fs";
|
|
2130
2270
|
import { homedir, tmpdir as tmpdir2 } from "os";
|
|
@@ -2225,7 +2365,7 @@ async function packSkills(home = homedir(), capBytes = SKILLS_CAP_BYTES, tarBin
|
|
|
2225
2365
|
});
|
|
2226
2366
|
});
|
|
2227
2367
|
});
|
|
2228
|
-
|
|
2368
|
+
rmSync3(dir, { recursive: true, force: true });
|
|
2229
2369
|
return packed;
|
|
2230
2370
|
}
|
|
2231
2371
|
var RESERVED_MCP = /* @__PURE__ */ new Set(["cloop", "playwright"]);
|
|
@@ -2512,7 +2652,7 @@ import {
|
|
|
2512
2652
|
openSync,
|
|
2513
2653
|
readFileSync as readFileSync3,
|
|
2514
2654
|
renameSync as renameSync3,
|
|
2515
|
-
rmSync as
|
|
2655
|
+
rmSync as rmSync4,
|
|
2516
2656
|
writeFileSync as writeFileSync2
|
|
2517
2657
|
} from "fs";
|
|
2518
2658
|
import { homedir as homedir2 } from "os";
|
|
@@ -2533,8 +2673,9 @@ function updateDecision(input) {
|
|
|
2533
2673
|
if (!input.latest) return stay("no_latest");
|
|
2534
2674
|
if (!olderThan(input.current, input.latest)) return stay("current");
|
|
2535
2675
|
if (input.latest === input.failed) return stay("failed_before");
|
|
2536
|
-
if (input.
|
|
2537
|
-
|
|
2676
|
+
if (!input.release) return stay("not_a_release");
|
|
2677
|
+
if (input.unitText === null) return stay("no_service");
|
|
2678
|
+
if (!namesVersion(input.unitText, input.current)) return stay("not_our_service");
|
|
2538
2679
|
if (!input.canDetach) return stay("no_detach");
|
|
2539
2680
|
if (input.running > 0 || input.inFlight > 0) return stay("busy");
|
|
2540
2681
|
return { kind: "hand_over", to: input.latest };
|
|
@@ -2661,6 +2802,7 @@ function selfUpdate(kind, platform = process.platform, onFailed = () => {
|
|
|
2661
2802
|
state.error = error;
|
|
2662
2803
|
onFailed(error, version);
|
|
2663
2804
|
};
|
|
2805
|
+
const release = isRelease(process.argv[1] ?? "");
|
|
2664
2806
|
const canDetach = platform === "darwin" || platform === "win32" || platform === "linux" && which("systemd-run") !== null;
|
|
2665
2807
|
const check = async () => {
|
|
2666
2808
|
state.checked_at = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -2728,15 +2870,20 @@ function selfUpdate(kind, platform = process.platform, onFailed = () => {
|
|
|
2728
2870
|
running,
|
|
2729
2871
|
inFlight,
|
|
2730
2872
|
failed: readFailed(),
|
|
2731
|
-
canDetach
|
|
2873
|
+
canDetach,
|
|
2874
|
+
release
|
|
2732
2875
|
});
|
|
2733
2876
|
if (decision.kind === "hand_over") {
|
|
2734
2877
|
lastWhy = null;
|
|
2735
2878
|
handOver(decision.to);
|
|
2736
2879
|
return;
|
|
2737
2880
|
}
|
|
2738
|
-
|
|
2739
|
-
lastWhy
|
|
2881
|
+
const why = `${decision.why}:${latest}`;
|
|
2882
|
+
if (why !== lastWhy && latest) {
|
|
2883
|
+
log(`staying on ${VERSION}: ${decision.why}`);
|
|
2884
|
+
if (decision.why === "not_our_service") fail("not_our_service", latest);
|
|
2885
|
+
}
|
|
2886
|
+
lastWhy = why;
|
|
2740
2887
|
}
|
|
2741
2888
|
};
|
|
2742
2889
|
}
|
|
@@ -2793,7 +2940,7 @@ async function adopt(from, kind, { services: given, script = process.argv[1] ??
|
|
|
2793
2940
|
if (legacy) {
|
|
2794
2941
|
const added = installedService({ ...where, environment });
|
|
2795
2942
|
if (!await stopService(added, run3)) throw new Error(`${added.path} did not stop`);
|
|
2796
|
-
|
|
2943
|
+
rmSync4(added.path, { force: true });
|
|
2797
2944
|
moveRunnerFiles(runnerDir(environment), runnerDir(was));
|
|
2798
2945
|
}
|
|
2799
2946
|
recordFailed(VERSION, was);
|
|
@@ -2946,8 +3093,12 @@ async function run2() {
|
|
|
2946
3093
|
// Beside the daemon's threads: the model a Task named, a run's move off a refused one, refusals and the last list.
|
|
2947
3094
|
runModels: fileRunModels(hostedRunModelsPath(hosted.harness)),
|
|
2948
3095
|
log: log2,
|
|
3096
|
+
// A held run's lease keeps the box awake until the hold is due to settle.
|
|
3097
|
+
awakeDir: join6(homedir3(), ".cloop", "awake"),
|
|
2949
3098
|
// 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 }))
|
|
3099
|
+
followUpLost: ({ work, n, error }) => socket.send(runnerLog("followup_lost", { work, n, tool: "thread.send", error })),
|
|
3100
|
+
// Watches start after the socket too: a held run's steps, for the hold monitor.
|
|
3101
|
+
holdLog: (code, work, ms) => socket.send(runnerLog(code, { work, ms }))
|
|
2951
3102
|
}) : local && (name === "claude-code" || name === "codex") ? await localDriver(local, name) : new T3Driver({
|
|
2952
3103
|
client: () => t3.client,
|
|
2953
3104
|
t3Bin: isT3(cfg) ? cfg.t3Bin : null,
|
|
@@ -34,7 +34,8 @@ var RUNNER_ERRORS = [
|
|
|
34
34
|
"registry_unreachable",
|
|
35
35
|
"fetch_failed",
|
|
36
36
|
"npx_missing",
|
|
37
|
-
"handover_failed"
|
|
37
|
+
"handover_failed",
|
|
38
|
+
"not_our_service"
|
|
38
39
|
];
|
|
39
40
|
var HARNESS_IDS = ["claude-code", "codex", "claudeAgent", "opencode"];
|
|
40
41
|
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
freshness,
|
|
5
5
|
outcomeLine,
|
|
6
6
|
runnerLog
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5RB7XKPB.js";
|
|
8
8
|
import {
|
|
9
9
|
readRunnerState,
|
|
10
10
|
runnerStatePath,
|
|
11
11
|
threadsFilePath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CUSQXHR6.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-J247WS7A.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-7YTPL6VG.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-NOKR7P5V.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-LFSIT2WB.js";
|
|
83
83
|
import {
|
|
84
84
|
STAGING_ORIGIN,
|
|
85
85
|
getOrigin,
|
|
@@ -94,6 +94,7 @@ import {
|
|
|
94
94
|
existsSync as existsSync6,
|
|
95
95
|
mkdirSync as mkdirSync3,
|
|
96
96
|
readdirSync as readdirSync4,
|
|
97
|
+
realpathSync as realpathSync2,
|
|
97
98
|
rmSync as rmSync3,
|
|
98
99
|
statSync as statSync2,
|
|
99
100
|
writeFileSync as writeFileSync2
|
|
@@ -2700,11 +2701,19 @@ var endDaemonStep = (environment) => ({
|
|
|
2700
2701
|
mayFail: true
|
|
2701
2702
|
});
|
|
2702
2703
|
function programFor(script, node, npx, version) {
|
|
2703
|
-
if (
|
|
2704
|
+
if (!isRelease(script)) return [node, script, "box", "run"];
|
|
2704
2705
|
if (!npx)
|
|
2705
|
-
return "npx is not on PATH, so the service cannot run Cloop. Install
|
|
2706
|
+
return "npx is not on PATH, so the service cannot run Cloop. Install Node.js with npm, which ships npx, and run `cloop connect` again.";
|
|
2706
2707
|
return [npx, "-y", `@cloop/runner@${version}`, "box", "run"];
|
|
2707
2708
|
}
|
|
2709
|
+
function isRelease(script) {
|
|
2710
|
+
const published = (path) => /[\\/](_npx|node_modules)[\\/]/.test(path);
|
|
2711
|
+
try {
|
|
2712
|
+
return published(realpathSync2(script));
|
|
2713
|
+
} catch {
|
|
2714
|
+
return published(script);
|
|
2715
|
+
}
|
|
2716
|
+
}
|
|
2708
2717
|
function findNpx() {
|
|
2709
2718
|
const name = process.platform === "win32" ? "npx.cmd" : "npx";
|
|
2710
2719
|
const beside = join8(dirname3(process.execPath), name);
|
|
@@ -3650,6 +3659,7 @@ export {
|
|
|
3650
3659
|
registerTaskScript,
|
|
3651
3660
|
endDaemonScript,
|
|
3652
3661
|
programFor,
|
|
3662
|
+
isRelease,
|
|
3653
3663
|
findNpx,
|
|
3654
3664
|
FIRST_CONNECT_MS,
|
|
3655
3665
|
awaitDaemon,
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
findRun,
|
|
4
4
|
ownHarness
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ADT3PMYQ.js";
|
|
6
6
|
import {
|
|
7
7
|
lockThreadsFile,
|
|
8
8
|
threadsFilePath
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CUSQXHR6.js";
|
|
10
10
|
import {
|
|
11
11
|
localRunsFilePath,
|
|
12
12
|
readRunRecords,
|
|
13
13
|
runHarness,
|
|
14
14
|
takeoverSummary
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-J247WS7A.js";
|
|
16
16
|
import {
|
|
17
17
|
sanitizeLabel
|
|
18
18
|
} from "./chunk-VK6GV757.js";
|
|
@@ -96,7 +96,7 @@ var RESULT_INSTRUCTION = [
|
|
|
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
|
+
'Your answer shows in the chat as GitHub Markdown, so most answers need no page: write the whole answer above the cloop-result block, and keep the summary to your conclusion or what you did. Make a doc output only when the answer is a document the owner will keep or share, such as a report, a plan or research longer than about 400 words, with its own headings. Then the summary is your conclusion in one or two sentences, such as "I recommend X, because Y.", the doc holds the method and caveats, and it does not repeat the summary. Title a doc for what it says, never "Full answer" or "Summary".'
|
|
100
100
|
].join("\n");
|
|
101
101
|
var MACHINE_RESULT_INSTRUCTION = [
|
|
102
102
|
RESULT_INSTRUCTION,
|
|
@@ -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();
|
|
@@ -3666,6 +3672,8 @@ export {
|
|
|
3666
3672
|
BoxToolError,
|
|
3667
3673
|
CLOOP_THREAD_PREFIX,
|
|
3668
3674
|
questionLine,
|
|
3675
|
+
IDLE_SETTLE_MS,
|
|
3676
|
+
holdsForNextTurn,
|
|
3669
3677
|
RUN_TEXT_MAX,
|
|
3670
3678
|
finalWords,
|
|
3671
3679
|
nextProgress,
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
findNpx,
|
|
27
27
|
harnessesFound,
|
|
28
28
|
installedService,
|
|
29
|
+
isRelease,
|
|
29
30
|
isWorkstation,
|
|
30
31
|
mcpHarnesses,
|
|
31
32
|
mintSession,
|
|
@@ -54,17 +55,17 @@ import {
|
|
|
54
55
|
which,
|
|
55
56
|
workFolder,
|
|
56
57
|
workFolderLine
|
|
57
|
-
} from "./chunk-
|
|
58
|
-
import "./chunk-
|
|
59
|
-
import "./chunk-
|
|
60
|
-
import "./chunk-
|
|
58
|
+
} from "./chunk-DTAMCVUY.js";
|
|
59
|
+
import "./chunk-5RB7XKPB.js";
|
|
60
|
+
import "./chunk-CUSQXHR6.js";
|
|
61
|
+
import "./chunk-J247WS7A.js";
|
|
61
62
|
import "./chunk-VK6GV757.js";
|
|
62
63
|
import "./chunk-365HFCQQ.js";
|
|
63
64
|
import "./chunk-PKIEWBR7.js";
|
|
64
|
-
import "./chunk-
|
|
65
|
-
import "./chunk-
|
|
65
|
+
import "./chunk-7YTPL6VG.js";
|
|
66
|
+
import "./chunk-NOKR7P5V.js";
|
|
66
67
|
import "./chunk-SBYSVZ7J.js";
|
|
67
|
-
import "./chunk-
|
|
68
|
+
import "./chunk-LFSIT2WB.js";
|
|
68
69
|
import "./chunk-D5UZW42X.js";
|
|
69
70
|
export {
|
|
70
71
|
DEFAULT_T3_URL,
|
|
@@ -93,6 +94,7 @@ export {
|
|
|
93
94
|
findNpx,
|
|
94
95
|
harnessesFound,
|
|
95
96
|
installedService,
|
|
97
|
+
isRelease,
|
|
96
98
|
isWorkstation,
|
|
97
99
|
mcpHarnesses,
|
|
98
100
|
mintSession,
|
|
@@ -7,17 +7,17 @@ import {
|
|
|
7
7
|
runnerOrigin,
|
|
8
8
|
stopService,
|
|
9
9
|
unitOrigin
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-DTAMCVUY.js";
|
|
11
|
+
import "./chunk-5RB7XKPB.js";
|
|
12
|
+
import "./chunk-CUSQXHR6.js";
|
|
13
|
+
import "./chunk-J247WS7A.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-7YTPL6VG.js";
|
|
18
|
+
import "./chunk-NOKR7P5V.js";
|
|
19
19
|
import "./chunk-SBYSVZ7J.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-LFSIT2WB.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-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-DTAMCVUY.js";
|
|
6
|
+
import "./chunk-5RB7XKPB.js";
|
|
7
|
+
import "./chunk-CUSQXHR6.js";
|
|
8
|
+
import "./chunk-J247WS7A.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-7YTPL6VG.js";
|
|
13
|
+
import "./chunk-NOKR7P5V.js";
|
|
14
14
|
import "./chunk-SBYSVZ7J.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-LFSIT2WB.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-LFSIT2WB.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-2KYDHSFA.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-ID3ZTPSR.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-4CJUB63Q.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-JXETQIKS.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-ERGLJSZO.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-LRGHLUC3.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-7JNCCZOP.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-3CZIKC6H.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-WMZTZXJ6.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-WMZTZXJ6.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-CSFKISDC.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-WMZTZXJ6.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-GL4F3GUD.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-NOKR7P5V.js";
|
|
7
7
|
import "./chunk-SBYSVZ7J.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-LFSIT2WB.js";
|
|
9
9
|
import "./chunk-D5UZW42X.js";
|
|
10
10
|
export {
|
|
11
11
|
deviceLogin,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
MeshSocket,
|
|
16
16
|
defaultSocketFactory
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-5RB7XKPB.js";
|
|
18
18
|
import {
|
|
19
19
|
sanitizeLabel,
|
|
20
20
|
sanitizeUntrusted
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
} from "./chunk-SBYSVZ7J.js";
|
|
32
32
|
import {
|
|
33
33
|
VERSION
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-LFSIT2WB.js";
|
|
35
35
|
import {
|
|
36
36
|
getMeshUrl,
|
|
37
37
|
getToken
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
connectWebhook,
|
|
4
4
|
runnerCommand
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-7YTPL6VG.js";
|
|
6
|
+
import "./chunk-NOKR7P5V.js";
|
|
7
7
|
import "./chunk-SBYSVZ7J.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-LFSIT2WB.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-ADT3PMYQ.js";
|
|
13
|
+
import "./chunk-J247WS7A.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-IRXCIO7U.js";
|
|
13
|
+
import "./chunk-ADT3PMYQ.js";
|
|
14
|
+
import "./chunk-CUSQXHR6.js";
|
|
15
|
+
import "./chunk-J247WS7A.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-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-DTAMCVUY.js";
|
|
7
|
+
import "./chunk-5RB7XKPB.js";
|
|
8
|
+
import "./chunk-CUSQXHR6.js";
|
|
9
9
|
import {
|
|
10
10
|
isLocal,
|
|
11
11
|
readRunnerConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-J247WS7A.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-7YTPL6VG.js";
|
|
17
|
+
import "./chunk-NOKR7P5V.js";
|
|
18
18
|
import "./chunk-SBYSVZ7J.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-LFSIT2WB.js";
|
|
20
20
|
import "./chunk-D5UZW42X.js";
|
|
21
21
|
|
|
22
22
|
// src/commands/use.ts
|
package/package.json
CHANGED