@cloop/runner 0.2.4 → 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-ZUDKJY2F.js → box-S2KILP32.js} +51 -19
- package/dist/{chunk-VEVDJ3H3.js → chunk-2FLM3ESE.js} +136 -26
- package/dist/{chunk-ZDUKQWKA.js → chunk-4XDYJZLF.js} +1 -1
- package/dist/{chunk-KHYA7GEH.js → chunk-53M5DK6D.js} +1 -1
- package/dist/{chunk-PBOQMFNN.js → chunk-BFVL3E2C.js} +1 -1
- package/dist/{chunk-M6U2YVEB.js → chunk-G6JAEE2Y.js} +1 -0
- package/dist/{chunk-5J4I7DAE.js → chunk-KOOAVO2C.js} +1 -1
- package/dist/{connect-WXL6JWJN.js → connect-FXO5ETUM.js} +15 -5
- package/dist/{disconnect-ZAVMFITZ.js → disconnect-EDQ7KXTR.js} +6 -6
- package/dist/index.js +17 -13
- package/dist/{login-MXIM6VMA.js → login-3HHGBYJ7.js} +2 -2
- package/dist/{mcp-server-ADCSP4SY.js → mcp-server-FOICWAYA.js} +1 -1
- package/dist/{runner-OVRZFJIY.js → runner-R7XTMUHH.js} +3 -3
- package/dist/{runs-ZTLNHRRJ.js → runs-N6RLOEQG.js} +2 -2
- package/dist/{statusline-ESZZVOBJ.js → statusline-4HJMU355.js} +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
LocalDriver
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KOOAVO2C.js";
|
|
5
5
|
import {
|
|
6
6
|
MeshSocket,
|
|
7
7
|
defaultSocketFactory
|
|
@@ -22,21 +22,21 @@ import {
|
|
|
22
22
|
runBoxTool,
|
|
23
23
|
threadsFilePath,
|
|
24
24
|
writeRunnerState
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-2FLM3ESE.js";
|
|
26
26
|
import {
|
|
27
27
|
T3Driver,
|
|
28
28
|
isLocal,
|
|
29
29
|
readRunnerConfig,
|
|
30
30
|
writeBoxConfig
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-G6JAEE2Y.js";
|
|
32
32
|
import {
|
|
33
33
|
getMachine
|
|
34
34
|
} from "./chunk-JX6VG5FE.js";
|
|
35
35
|
import "./chunk-R3CLO2FB.js";
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-53M5DK6D.js";
|
|
37
|
+
import "./chunk-4XDYJZLF.js";
|
|
38
38
|
import "./chunk-AG6SI6I2.js";
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-BFVL3E2C.js";
|
|
40
40
|
import {
|
|
41
41
|
getMeshUrl,
|
|
42
42
|
getToken,
|
|
@@ -110,6 +110,7 @@ async function listOutsideSessions(root = join(homedir(), ".claude", "projects")
|
|
|
110
110
|
var BEAT_MS = 6e4;
|
|
111
111
|
var RESEND_MS = 5 * 6e4;
|
|
112
112
|
var REPAIR_BEFORE_MS = 2 * 24 * 36e5;
|
|
113
|
+
var EXPIRING_BEFORE_MS = 3 * 24 * 36e5;
|
|
113
114
|
var out = (line) => console.log(line);
|
|
114
115
|
var red = (s) => `\x1B[31m${s}\x1B[0m`;
|
|
115
116
|
var log = (line) => console.error(`[workstation:daemon] ${line}`);
|
|
@@ -123,6 +124,29 @@ async function awaitNewDeviceToken(current, read, { tries = 3, delayMs = 2e3 } =
|
|
|
123
124
|
}
|
|
124
125
|
return null;
|
|
125
126
|
}
|
|
127
|
+
function t3Presence(cfg, renewalFailed, now = Date.now()) {
|
|
128
|
+
const left = Date.parse(cfg.expiresAt) - now;
|
|
129
|
+
if (Number.isNaN(left)) return null;
|
|
130
|
+
const state = left <= 0 ? "expired" : renewalFailed ? "renewal_failed" : left < EXPIRING_BEFORE_MS ? "expiring" : "ok";
|
|
131
|
+
return { expiresAt: cfg.expiresAt, renewable: Boolean(cfg.t3Bin), state };
|
|
132
|
+
}
|
|
133
|
+
function boxPresence(beat) {
|
|
134
|
+
return {
|
|
135
|
+
session_key: beat.sessionKey,
|
|
136
|
+
name: beat.driver === "t3" ? "Cloop box" : "Cloop runner",
|
|
137
|
+
kind: "workstation",
|
|
138
|
+
capabilities: [...beat.capabilities],
|
|
139
|
+
platform: "workstation",
|
|
140
|
+
machine: beat.machine,
|
|
141
|
+
surface: {
|
|
142
|
+
driver: beat.driver,
|
|
143
|
+
outsideThreads: beat.outsideThreads,
|
|
144
|
+
...beat.t3 ? { t3: beat.t3 } : {}
|
|
145
|
+
},
|
|
146
|
+
status: beat.running > 0 ? "active" : "idle",
|
|
147
|
+
event: beat.running > 0 ? `${beat.running} running` : ""
|
|
148
|
+
};
|
|
149
|
+
}
|
|
126
150
|
async function machineHarnesses(cfg) {
|
|
127
151
|
const [claude, codex] = await Promise.all([
|
|
128
152
|
probeClaude(cfg.driver === "claude-code" ? cfg.bin : void 0),
|
|
@@ -167,7 +191,10 @@ async function run() {
|
|
|
167
191
|
);
|
|
168
192
|
process.exit(1);
|
|
169
193
|
}
|
|
170
|
-
const t3 = {
|
|
194
|
+
const t3 = {
|
|
195
|
+
client: isLocal(cfg) ? null : new T3Client(cfg.t3Url, cfg.token),
|
|
196
|
+
renewalFailed: false
|
|
197
|
+
};
|
|
171
198
|
const machine = getMachine();
|
|
172
199
|
const sessionKey = `box:${machine}`;
|
|
173
200
|
const factory = await defaultSocketFactory();
|
|
@@ -234,6 +261,7 @@ async function run() {
|
|
|
234
261
|
token = fresh;
|
|
235
262
|
cfg = next;
|
|
236
263
|
if (!isLocal(next)) t3.client = new T3Client(next.t3Url, next.token);
|
|
264
|
+
t3.renewalFailed = false;
|
|
237
265
|
socket.restart(fresh);
|
|
238
266
|
return;
|
|
239
267
|
}
|
|
@@ -261,8 +289,10 @@ async function run() {
|
|
|
261
289
|
cfg = renewed;
|
|
262
290
|
writeBoxConfig(renewed);
|
|
263
291
|
t3.client = new T3Client(renewed.t3Url, renewed.token);
|
|
292
|
+
t3.renewalFailed = false;
|
|
264
293
|
log(`T3 session renewed until ${renewed.expiresAt}`);
|
|
265
294
|
} catch (err) {
|
|
295
|
+
t3.renewalFailed = true;
|
|
266
296
|
log(`T3 session renewal failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
267
297
|
}
|
|
268
298
|
};
|
|
@@ -292,17 +322,17 @@ async function run() {
|
|
|
292
322
|
} catch (err) {
|
|
293
323
|
log(`${driver.name} unreachable: ${err instanceof Error ? err.message : String(err)}`);
|
|
294
324
|
}
|
|
295
|
-
socket.sendPresence(
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
325
|
+
socket.sendPresence(
|
|
326
|
+
boxPresence({
|
|
327
|
+
sessionKey,
|
|
328
|
+
driver: driver.name,
|
|
329
|
+
capabilities: driver.capabilities,
|
|
330
|
+
machine,
|
|
331
|
+
outsideThreads,
|
|
332
|
+
running,
|
|
333
|
+
t3: cfg && !isLocal(cfg) ? t3Presence(cfg, t3.renewalFailed) : null
|
|
334
|
+
})
|
|
335
|
+
);
|
|
306
336
|
};
|
|
307
337
|
void beat();
|
|
308
338
|
setInterval(() => void beat(), BEAT_MS);
|
|
@@ -338,6 +368,8 @@ export {
|
|
|
338
368
|
REFUSED_LINE,
|
|
339
369
|
awaitNewDeviceToken,
|
|
340
370
|
boxCommand,
|
|
371
|
+
boxPresence,
|
|
341
372
|
recordConnected,
|
|
342
|
-
run
|
|
373
|
+
run,
|
|
374
|
+
t3Presence
|
|
343
375
|
};
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
t3BaseDirArgs,
|
|
14
14
|
t3Candidates,
|
|
15
15
|
writeBoxConfig
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-G6JAEE2Y.js";
|
|
17
17
|
import {
|
|
18
18
|
getMachine,
|
|
19
19
|
shortMachineName
|
|
@@ -24,17 +24,17 @@ import {
|
|
|
24
24
|
} from "./chunk-R3CLO2FB.js";
|
|
25
25
|
import {
|
|
26
26
|
connectWebhook
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-53M5DK6D.js";
|
|
28
28
|
import {
|
|
29
29
|
ConnectFailure,
|
|
30
30
|
connectReport,
|
|
31
31
|
deviceLogin,
|
|
32
32
|
newAttempt,
|
|
33
33
|
sendConnectReport
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-4XDYJZLF.js";
|
|
35
35
|
import {
|
|
36
36
|
VERSION
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-BFVL3E2C.js";
|
|
38
38
|
import {
|
|
39
39
|
CONFIG_DIR,
|
|
40
40
|
STAGING_ORIGIN,
|
|
@@ -48,6 +48,7 @@ import { existsSync, mkdirSync as mkdirSync2, readdirSync, rmSync, writeFileSync
|
|
|
48
48
|
import { homedir as homedir2 } from "os";
|
|
49
49
|
import { basename as basename3, dirname as dirname2, join as join2, resolve as resolve2 } from "path";
|
|
50
50
|
import { createInterface } from "readline/promises";
|
|
51
|
+
import { Writable } from "stream";
|
|
51
52
|
|
|
52
53
|
// src/t3.ts
|
|
53
54
|
var T3_SCOPE = "orchestration:read orchestration:operate";
|
|
@@ -68,7 +69,7 @@ async function exchangePairing(t3Url, credential, label, fetchFn = fetch) {
|
|
|
68
69
|
client_device_type: "bot"
|
|
69
70
|
});
|
|
70
71
|
const res = await fetchFn(`${t3Url}/oauth/token`, { method: "POST", body: form });
|
|
71
|
-
if (!res.ok) throw new
|
|
72
|
+
if (!res.ok) throw new T3HttpError("token exchange", res.status);
|
|
72
73
|
const token = await res.json();
|
|
73
74
|
if (!sameScopes(token.scope, T3_SCOPE))
|
|
74
75
|
throw new Error(`T3 granted scope "${token.scope}", wanted "${T3_SCOPE}"`);
|
|
@@ -938,6 +939,30 @@ function codexDialect(bin = "codex") {
|
|
|
938
939
|
};
|
|
939
940
|
}
|
|
940
941
|
|
|
942
|
+
// src/t3-pair-link.ts
|
|
943
|
+
var CODE = /^[A-Za-z0-9_-]{8,256}$/;
|
|
944
|
+
function tokenOf(url) {
|
|
945
|
+
const hash = new URLSearchParams(url.hash.replace(/^#/, "")).get("token")?.trim();
|
|
946
|
+
if (hash) return hash;
|
|
947
|
+
return url.searchParams.get("token")?.trim() || null;
|
|
948
|
+
}
|
|
949
|
+
function pairingCredential(input) {
|
|
950
|
+
const text = input.trim().replace(/^["'<]+|["'>]+$/g, "");
|
|
951
|
+
if (!text) return null;
|
|
952
|
+
if (/^[a-z][a-z\d+.-]*:\/\//i.test(text)) {
|
|
953
|
+
let url;
|
|
954
|
+
try {
|
|
955
|
+
url = new URL(text);
|
|
956
|
+
} catch {
|
|
957
|
+
return null;
|
|
958
|
+
}
|
|
959
|
+
if (!["http:", "https:", "ws:", "wss:"].includes(url.protocol)) return null;
|
|
960
|
+
const token = tokenOf(url);
|
|
961
|
+
return token && CODE.test(token) ? token : null;
|
|
962
|
+
}
|
|
963
|
+
return CODE.test(text) ? text : null;
|
|
964
|
+
}
|
|
965
|
+
|
|
941
966
|
// src/commands/connect.ts
|
|
942
967
|
var DEFAULT_T3_URL = "http://127.0.0.1:3773";
|
|
943
968
|
var CLEAN_ENV = { HOME: process.env.HOME, USER: process.env.USER, PATH: process.env.PATH };
|
|
@@ -959,29 +984,20 @@ function which(bin) {
|
|
|
959
984
|
return null;
|
|
960
985
|
}
|
|
961
986
|
}
|
|
962
|
-
|
|
963
|
-
|
|
987
|
+
var T3PairError = class extends Error {
|
|
988
|
+
name = "T3PairError";
|
|
989
|
+
};
|
|
990
|
+
async function workstationEnvironment(t3Url, fetchFn) {
|
|
991
|
+
const env = await readEnvironment(t3Url, fetchFn);
|
|
964
992
|
const protocol = env.orchestrationProtocolVersion ?? 1;
|
|
965
993
|
if (protocol < MIN_PROTOCOL) {
|
|
966
994
|
throw new Error(
|
|
967
995
|
`T3 ${env.serverVersion} speaks orchestration protocol ${protocol}; a workstation needs ${MIN_PROTOCOL} (the V2 nightly or later).`
|
|
968
996
|
);
|
|
969
997
|
}
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
const pairing = JSON.parse(
|
|
974
|
-
runT3(t3Bin, [
|
|
975
|
-
"auth",
|
|
976
|
-
"pairing",
|
|
977
|
-
"create",
|
|
978
|
-
...t3BaseDirArgs(sources.env),
|
|
979
|
-
"--ttl",
|
|
980
|
-
"5m",
|
|
981
|
-
"--json"
|
|
982
|
-
])
|
|
983
|
-
);
|
|
984
|
-
const token = await exchangePairing(t3Url, pairing.credential, "cloop box", opts.fetchFn);
|
|
998
|
+
return env;
|
|
999
|
+
}
|
|
1000
|
+
function boxSession(t3Url, t3Bin, env, token) {
|
|
985
1001
|
return {
|
|
986
1002
|
t3Url,
|
|
987
1003
|
t3Bin,
|
|
@@ -992,6 +1008,75 @@ async function mintSession(t3Url, opts = {}) {
|
|
|
992
1008
|
label: env.label
|
|
993
1009
|
};
|
|
994
1010
|
}
|
|
1011
|
+
async function mintSession(t3Url, opts = {}) {
|
|
1012
|
+
const env = await workstationEnvironment(t3Url, opts.fetchFn);
|
|
1013
|
+
const sources = opts.sources ?? defaultT3BinSources(homedir2(), opts.stored);
|
|
1014
|
+
try {
|
|
1015
|
+
const t3Bin = opts.bin ?? pickT3Bin(t3Candidates(env.serverVersion, sources), env.serverVersion);
|
|
1016
|
+
if (!t3Bin) throw new Error("no t3 binary found; pass --t3-bin or set T3_BIN");
|
|
1017
|
+
const pairing = JSON.parse(
|
|
1018
|
+
runT3(t3Bin, [
|
|
1019
|
+
"auth",
|
|
1020
|
+
"pairing",
|
|
1021
|
+
"create",
|
|
1022
|
+
...t3BaseDirArgs(sources.env),
|
|
1023
|
+
"--ttl",
|
|
1024
|
+
"5m",
|
|
1025
|
+
"--json"
|
|
1026
|
+
])
|
|
1027
|
+
);
|
|
1028
|
+
const token = await exchangePairing(t3Url, pairing.credential, "cloop box", opts.fetchFn);
|
|
1029
|
+
return boxSession(t3Url, t3Bin, env, token);
|
|
1030
|
+
} catch (err) {
|
|
1031
|
+
throw new T3PairError(err instanceof Error ? err.message : String(err));
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
async function sessionFromLink(t3Url, link, fetchFn) {
|
|
1035
|
+
const credential = pairingCredential(link);
|
|
1036
|
+
if (!credential) throw new Error("that is not a T3 pairing link or code");
|
|
1037
|
+
const env = await workstationEnvironment(t3Url, fetchFn);
|
|
1038
|
+
let token;
|
|
1039
|
+
try {
|
|
1040
|
+
token = await exchangePairing(t3Url, credential, "cloop box", fetchFn);
|
|
1041
|
+
} catch (err) {
|
|
1042
|
+
const status = err instanceof T3HttpError ? err.status : null;
|
|
1043
|
+
if (status === 401)
|
|
1044
|
+
throw new Error(
|
|
1045
|
+
"T3 refused the pairing link; a link works once and lasts 5 minutes, so create a new one"
|
|
1046
|
+
);
|
|
1047
|
+
if (status === 400)
|
|
1048
|
+
throw new Error("T3 refused the pairing link; create one with the Standard permission");
|
|
1049
|
+
throw err;
|
|
1050
|
+
}
|
|
1051
|
+
return boxSession(t3Url, "", env, token);
|
|
1052
|
+
}
|
|
1053
|
+
function pairPrompt(fallback) {
|
|
1054
|
+
return `T3 Code is running, but this computer cannot pair with it automatically. In T3 Code, open Settings, then Connections, then Create pairing link. Copy the link and paste it here (or press Enter to ${fallback ? `use ${fallback} instead` : "stop"}): `;
|
|
1055
|
+
}
|
|
1056
|
+
async function pairT3(steps) {
|
|
1057
|
+
if (steps.link !== void 0) return { session: await steps.fromLink(steps.link), byLink: true };
|
|
1058
|
+
try {
|
|
1059
|
+
return { session: await steps.mint(), byLink: false };
|
|
1060
|
+
} catch (err) {
|
|
1061
|
+
if (!(err instanceof T3PairError) || !steps.ask) throw err;
|
|
1062
|
+
const answer = (await steps.ask(pairPrompt(steps.fallback)).catch(() => "")).trim();
|
|
1063
|
+
if (!answer) throw new Error(`${err.message}; no pairing link given`);
|
|
1064
|
+
return { session: await steps.fromLink(answer), byLink: true };
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
function askHidden(question, input = process.stdin, output = process.stdout) {
|
|
1068
|
+
const muted = new Writable({ write: (_chunk, _encoding, done) => done() });
|
|
1069
|
+
const prompt = createInterface({ input, output: muted, terminal: true });
|
|
1070
|
+
output.write(`${question}
|
|
1071
|
+
${dim("(The link stays hidden while you paste it.)")} `);
|
|
1072
|
+
return askOrClosed(
|
|
1073
|
+
prompt,
|
|
1074
|
+
() => new Error("closed")
|
|
1075
|
+
)("").finally(() => {
|
|
1076
|
+
prompt.close();
|
|
1077
|
+
output.write("\n");
|
|
1078
|
+
});
|
|
1079
|
+
}
|
|
995
1080
|
async function connectBox(steps) {
|
|
996
1081
|
const environment = await steps.readEnvironment();
|
|
997
1082
|
const session = await steps.mintSession();
|
|
@@ -1063,7 +1148,7 @@ async function revokeReplaced(previous, kind, revoke, say) {
|
|
|
1063
1148
|
);
|
|
1064
1149
|
}
|
|
1065
1150
|
function fallbackLine(reason, driver) {
|
|
1066
|
-
return `T3 Code is running but would not pair (${reason}). Connecting ${HARNESS_NAME[driver]} instead. To use T3: cloop connect --
|
|
1151
|
+
return `T3 Code is running but would not pair (${reason}). Connecting ${HARNESS_NAME[driver]} instead. To use T3, create a pairing link in T3 Code (Settings, Connections) and run: cloop connect --t3-pair <link>`;
|
|
1067
1152
|
}
|
|
1068
1153
|
async function connectChosen(driver, attempt, run) {
|
|
1069
1154
|
attempt.driver = driver;
|
|
@@ -1435,10 +1520,17 @@ async function installService(kind, argv, attempt) {
|
|
|
1435
1520
|
}
|
|
1436
1521
|
out(` Service: ${unit.path}, started and connected. Logs: ${dim(unit.logs)}`);
|
|
1437
1522
|
}
|
|
1438
|
-
async function connectT3(argv, attempt) {
|
|
1523
|
+
async function connectT3(argv, attempt, fallback) {
|
|
1439
1524
|
const previous = readRunnerConfig();
|
|
1440
1525
|
const t3Url = (flag(argv, "--t3-url") ?? DEFAULT_T3_URL).replace(/\/+$/, "");
|
|
1441
1526
|
const t3Bin = flag(argv, "--t3-bin");
|
|
1527
|
+
const link = flag(argv, "--t3-pair");
|
|
1528
|
+
if (argv.includes("--t3-pair") && !link)
|
|
1529
|
+
throw new ConnectFailure(
|
|
1530
|
+
"bad_flag",
|
|
1531
|
+
"--t3-pair takes the pairing link from T3 Code (Settings, Connections)."
|
|
1532
|
+
);
|
|
1533
|
+
let byLink = false;
|
|
1442
1534
|
const cfg = await connectBox({
|
|
1443
1535
|
readEnvironment: async () => {
|
|
1444
1536
|
const environment = await readEnvironment(t3Url);
|
|
@@ -1450,7 +1542,15 @@ async function connectT3(argv, attempt) {
|
|
|
1450
1542
|
mintSession: async () => {
|
|
1451
1543
|
attempt.step = "t3_pair";
|
|
1452
1544
|
try {
|
|
1453
|
-
|
|
1545
|
+
const paired = await pairT3({
|
|
1546
|
+
...link ? { link } : {},
|
|
1547
|
+
mint: () => mintSession(t3Url, t3Bin ? { bin: t3Bin } : {}),
|
|
1548
|
+
fromLink: (pasted) => sessionFromLink(t3Url, pasted),
|
|
1549
|
+
ask: process.stdin.isTTY && process.stdout.isTTY ? (q) => askHidden(q) : null,
|
|
1550
|
+
fallback
|
|
1551
|
+
});
|
|
1552
|
+
byLink = paired.byLink;
|
|
1553
|
+
return paired.session;
|
|
1454
1554
|
} catch (err) {
|
|
1455
1555
|
throw new ConnectFailure(
|
|
1456
1556
|
"t3_pair_failed",
|
|
@@ -1482,6 +1582,10 @@ async function connectT3(argv, attempt) {
|
|
|
1482
1582
|
out(
|
|
1483
1583
|
`${bold("Cloop runner")} T3 ${cfg.label} paired with scope ${cfg.scope}, until ${cfg.expiresAt.slice(0, 10)}.`
|
|
1484
1584
|
);
|
|
1585
|
+
if (byLink)
|
|
1586
|
+
out(
|
|
1587
|
+
` Paired with a link from T3 Code. This session cannot renew itself: before ${cfg.expiresAt.slice(0, 10)}, run cloop connect again with a new link.`
|
|
1588
|
+
);
|
|
1485
1589
|
const driver = new T3Driver({
|
|
1486
1590
|
client: () => new T3Client(cfg.t3Url, cfg.token),
|
|
1487
1591
|
t3Bin: cfg.t3Bin
|
|
@@ -1584,8 +1688,9 @@ async function connect(argv, attempt) {
|
|
|
1584
1688
|
const workstation = isWorkstation(readRunnerConfig(), boxServiceInstalled());
|
|
1585
1689
|
const choice = chooseDriver(found, forced, workstation);
|
|
1586
1690
|
if (!choice.ok) throw new ConnectFailure(choice.code, choice.line);
|
|
1691
|
+
const local = fallbackDriver(found, forced, workstation);
|
|
1587
1692
|
await connectChosen(choice.driver, attempt, {
|
|
1588
|
-
t3: () => connectT3(argv, attempt),
|
|
1693
|
+
t3: () => connectT3(argv, attempt, local ? HARNESS_NAME[local] : null),
|
|
1589
1694
|
local: (driver) => connectLocal(driver, found, argv, attempt),
|
|
1590
1695
|
fallback: () => fallbackDriver(found, forced, workstation),
|
|
1591
1696
|
say: (line2) => out(`${bold("Cloop runner")} ${line2}`)
|
|
@@ -1626,7 +1731,12 @@ export {
|
|
|
1626
1731
|
probeCodex,
|
|
1627
1732
|
codexDialect,
|
|
1628
1733
|
DEFAULT_T3_URL,
|
|
1734
|
+
T3PairError,
|
|
1629
1735
|
mintSession,
|
|
1736
|
+
sessionFromLink,
|
|
1737
|
+
pairPrompt,
|
|
1738
|
+
pairT3,
|
|
1739
|
+
askHidden,
|
|
1630
1740
|
connectBox,
|
|
1631
1741
|
chooseDriver,
|
|
1632
1742
|
fallbackDriver,
|
|
@@ -49,6 +49,7 @@ function t3Candidates(serverVersion, sources) {
|
|
|
49
49
|
const ordered = [
|
|
50
50
|
sources.env.T3_BIN,
|
|
51
51
|
join(sources.home, ".t3", "runtime", "versions", serverVersion, "t3"),
|
|
52
|
+
join(sources.env.T3CODE_HOME || join(sources.home, ".t3"), "bin", "t3"),
|
|
52
53
|
...sources.appDirs.flatMap(bundleBinaries),
|
|
53
54
|
...sources.onPath(),
|
|
54
55
|
sources.stored
|
|
@@ -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,28 +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-
|
|
32
|
-
import "./chunk-
|
|
36
|
+
} from "./chunk-2FLM3ESE.js";
|
|
37
|
+
import "./chunk-G6JAEE2Y.js";
|
|
33
38
|
import "./chunk-JX6VG5FE.js";
|
|
34
39
|
import "./chunk-R3CLO2FB.js";
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-53M5DK6D.js";
|
|
41
|
+
import "./chunk-4XDYJZLF.js";
|
|
37
42
|
import "./chunk-AG6SI6I2.js";
|
|
38
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-BFVL3E2C.js";
|
|
39
44
|
import "./chunk-3DIGCVL4.js";
|
|
40
45
|
export {
|
|
41
46
|
DEFAULT_T3_URL,
|
|
47
|
+
T3PairError,
|
|
48
|
+
askHidden,
|
|
42
49
|
askOrClosed,
|
|
43
50
|
askRepos,
|
|
44
51
|
awaitDaemon,
|
|
@@ -55,12 +62,15 @@ export {
|
|
|
55
62
|
isWorkstation,
|
|
56
63
|
mintSession,
|
|
57
64
|
notACheckoutLine,
|
|
65
|
+
pairPrompt,
|
|
66
|
+
pairT3,
|
|
58
67
|
parsePicks,
|
|
59
68
|
programFor,
|
|
60
69
|
rerunCommand,
|
|
61
70
|
resolveRepos,
|
|
62
71
|
revokeReplaced,
|
|
63
72
|
runSteps,
|
|
73
|
+
sessionFromLink,
|
|
64
74
|
systemdAssignment,
|
|
65
75
|
systemdWord,
|
|
66
76
|
tilde,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
localRunsFilePath
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-KOOAVO2C.js";
|
|
5
5
|
import "./chunk-VK6GV757.js";
|
|
6
6
|
import {
|
|
7
7
|
installedService,
|
|
@@ -10,17 +10,17 @@ import {
|
|
|
10
10
|
runnerStatePath,
|
|
11
11
|
threadsFilePath,
|
|
12
12
|
tokenGone
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2FLM3ESE.js";
|
|
14
14
|
import {
|
|
15
15
|
boxPath,
|
|
16
16
|
readRunnerConfig
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-G6JAEE2Y.js";
|
|
18
18
|
import "./chunk-JX6VG5FE.js";
|
|
19
19
|
import "./chunk-R3CLO2FB.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-53M5DK6D.js";
|
|
21
|
+
import "./chunk-4XDYJZLF.js";
|
|
22
22
|
import "./chunk-AG6SI6I2.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-BFVL3E2C.js";
|
|
24
24
|
import {
|
|
25
25
|
getOrigin
|
|
26
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,9 +22,13 @@ 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
|
|
@@ -47,7 +51,7 @@ async function main() {
|
|
|
47
51
|
switch (command) {
|
|
48
52
|
case "login":
|
|
49
53
|
case "auth": {
|
|
50
|
-
const { loginCommand } = await import("./login-
|
|
54
|
+
const { loginCommand } = await import("./login-3HHGBYJ7.js");
|
|
51
55
|
await loginCommand(argv);
|
|
52
56
|
break;
|
|
53
57
|
}
|
|
@@ -57,47 +61,47 @@ async function main() {
|
|
|
57
61
|
break;
|
|
58
62
|
}
|
|
59
63
|
case "serve": {
|
|
60
|
-
const { startMcpServer } = await import("./mcp-server-
|
|
64
|
+
const { startMcpServer } = await import("./mcp-server-FOICWAYA.js");
|
|
61
65
|
await startMcpServer();
|
|
62
66
|
break;
|
|
63
67
|
}
|
|
64
68
|
case "statusline": {
|
|
65
|
-
const { statuslineCommand } = await import("./statusline-
|
|
69
|
+
const { statuslineCommand } = await import("./statusline-4HJMU355.js");
|
|
66
70
|
statuslineCommand();
|
|
67
71
|
break;
|
|
68
72
|
}
|
|
69
73
|
case "connect": {
|
|
70
|
-
const { connectCommand } = await import("./connect-
|
|
74
|
+
const { connectCommand } = await import("./connect-FXO5ETUM.js");
|
|
71
75
|
await connectCommand(argv.slice(1));
|
|
72
76
|
break;
|
|
73
77
|
}
|
|
74
78
|
case "disconnect": {
|
|
75
|
-
const { disconnectCommand } = await import("./disconnect-
|
|
79
|
+
const { disconnectCommand } = await import("./disconnect-EDQ7KXTR.js");
|
|
76
80
|
await disconnectCommand(argv.slice(1));
|
|
77
81
|
break;
|
|
78
82
|
}
|
|
79
83
|
case "box": {
|
|
80
|
-
const { boxCommand } = await import("./box-
|
|
84
|
+
const { boxCommand } = await import("./box-S2KILP32.js");
|
|
81
85
|
await boxCommand(argv.slice(1));
|
|
82
86
|
break;
|
|
83
87
|
}
|
|
84
88
|
case "runs": {
|
|
85
|
-
const { runsCommand } = await import("./runs-
|
|
89
|
+
const { runsCommand } = await import("./runs-N6RLOEQG.js");
|
|
86
90
|
process.exitCode = runsCommand();
|
|
87
91
|
break;
|
|
88
92
|
}
|
|
89
93
|
case "watch": {
|
|
90
|
-
const { watchCommand } = await import("./runs-
|
|
94
|
+
const { watchCommand } = await import("./runs-N6RLOEQG.js");
|
|
91
95
|
process.exitCode = await watchCommand(argv.slice(1));
|
|
92
96
|
break;
|
|
93
97
|
}
|
|
94
98
|
case "resume": {
|
|
95
|
-
const { resumeCommand } = await import("./runs-
|
|
99
|
+
const { resumeCommand } = await import("./runs-N6RLOEQG.js");
|
|
96
100
|
process.exitCode = await resumeCommand(argv.slice(1));
|
|
97
101
|
break;
|
|
98
102
|
}
|
|
99
103
|
case "runner": {
|
|
100
|
-
const { runnerCommand } = await import("./runner-
|
|
104
|
+
const { runnerCommand } = await import("./runner-R7XTMUHH.js");
|
|
101
105
|
await runnerCommand(argv.slice(1));
|
|
102
106
|
break;
|
|
103
107
|
}
|
|
@@ -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,
|
|
@@ -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,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
readRunRecords,
|
|
7
7
|
runLogDir,
|
|
8
8
|
runLogPath
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KOOAVO2C.js";
|
|
10
10
|
import {
|
|
11
11
|
sanitizeLabel,
|
|
12
12
|
stripControl
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
isLocal,
|
|
16
16
|
readRunnerConfig
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-G6JAEE2Y.js";
|
|
18
18
|
import "./chunk-3DIGCVL4.js";
|
|
19
19
|
|
|
20
20
|
// src/commands/runs.ts
|
package/package.json
CHANGED