@cloop/runner 0.3.36 → 0.3.38
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-DQQQYGY6.js → box-TQJJ6EJK.js} +25 -10
- package/dist/{chunk-OJH72SCM.js → chunk-3WRLILTX.js} +5 -5
- package/dist/{chunk-LFLFQOPL.js → chunk-43OQXKIP.js} +1 -1
- package/dist/{chunk-NC2CYUVJ.js → chunk-HYYLDJ5K.js} +3 -3
- package/dist/{chunk-NKUPQAVX.js → chunk-OIZI3FXO.js} +1 -1
- package/dist/{chunk-XVJP7XW3.js → chunk-PF6QW6CK.js} +1 -1
- package/dist/{chunk-6SRF3XGA.js → chunk-TQ2SCOKH.js} +184 -183
- package/dist/{chunk-C5WAMQVJ.js → chunk-WWG6T3HW.js} +1 -1
- package/dist/{chunk-WZHNYHUT.js → chunk-Z3KDTCS6.js} +1 -1
- package/dist/{connect-ZON4PSFH.js → connect-CBWHDE5Y.js} +6 -6
- package/dist/{disconnect-F3DWFZXH.js → disconnect-POJACA2Q.js} +6 -6
- package/dist/{existing-runner-RZIY4UG5.js → existing-runner-XOCSW4F4.js} +6 -6
- package/dist/index.js +14 -14
- package/dist/{login-NWMS6K6R.js → login-JRAQBWSB.js} +2 -2
- package/dist/{mcp-server-4ZA4F7WY.js → mcp-server-N7WRPR77.js} +1 -1
- package/dist/{runner-3DXSNEHV.js → runner-KFEUMXMY.js} +3 -3
- package/dist/{runs-6N57MCYW.js → runs-5YIEWOJM.js} +2 -2
- package/dist/{statusline-YDVFTXO7.js → statusline-JYOI3SWJ.js} +1 -1
- package/dist/{takeover-MQIZPP6U.js → takeover-S3PBIUN5.js} +4 -4
- package/dist/{use-IP43IFMT.js → use-BLFMGGRV.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-HYYLDJ5K.js";
|
|
5
|
+
import "./chunk-PF6QW6CK.js";
|
|
6
6
|
import {
|
|
7
7
|
CAPTURE_TICK_MS,
|
|
8
8
|
DEFAULT_FALLBACK_MODEL,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
systemServices,
|
|
39
39
|
unitFor,
|
|
40
40
|
which
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-3WRLILTX.js";
|
|
42
42
|
import {
|
|
43
43
|
MeshSocket,
|
|
44
44
|
WAKE_TICK_MS,
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
runnerStatePath,
|
|
56
56
|
threadsFilePath,
|
|
57
57
|
writeRunnerState
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-OIZI3FXO.js";
|
|
59
59
|
import {
|
|
60
60
|
BackgroundReading,
|
|
61
61
|
BoxToolError,
|
|
@@ -100,20 +100,20 @@ import {
|
|
|
100
100
|
utcWindow,
|
|
101
101
|
windowsPowerShellEnv,
|
|
102
102
|
writeBoxConfig
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-TQ2SCOKH.js";
|
|
104
104
|
import "./chunk-VK6GV757.js";
|
|
105
105
|
import {
|
|
106
106
|
olderThan
|
|
107
107
|
} from "./chunk-365HFCQQ.js";
|
|
108
108
|
import "./chunk-PKIEWBR7.js";
|
|
109
|
-
import "./chunk-
|
|
110
|
-
import "./chunk-
|
|
109
|
+
import "./chunk-WWG6T3HW.js";
|
|
110
|
+
import "./chunk-43OQXKIP.js";
|
|
111
111
|
import {
|
|
112
112
|
getMachine
|
|
113
113
|
} from "./chunk-SBYSVZ7J.js";
|
|
114
114
|
import {
|
|
115
115
|
VERSION
|
|
116
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-Z3KDTCS6.js";
|
|
117
117
|
import {
|
|
118
118
|
getMeshUrl,
|
|
119
119
|
getOrigin,
|
|
@@ -789,9 +789,11 @@ var CloudroomDriver = class {
|
|
|
789
789
|
async status() {
|
|
790
790
|
const [harnesses, sessions] = await Promise.all([this.core.capabilities(), this.sessions()]);
|
|
791
791
|
const running = sessions.filter(busy);
|
|
792
|
+
const reports = await this.reports(harnesses);
|
|
793
|
+
const usage = this.deps.usage;
|
|
792
794
|
return {
|
|
793
795
|
box: { label: this.deps.label ?? "Cloop Box", driver: this.name },
|
|
794
|
-
harnesses:
|
|
796
|
+
harnesses: usage ? usage.withQuota(reports) : reports,
|
|
795
797
|
clients: null,
|
|
796
798
|
projects: [],
|
|
797
799
|
threads: {
|
|
@@ -799,7 +801,8 @@ var CloudroomDriver = class {
|
|
|
799
801
|
running: running.length,
|
|
800
802
|
settled: sessions.length - running.length,
|
|
801
803
|
cloop: running.filter((s) => s.session_id.startsWith(CLOOP_SESSION_PREFIX)).length
|
|
802
|
-
}
|
|
804
|
+
},
|
|
805
|
+
...usage ? { token_usage: usage.tokenUsage() } : {}
|
|
803
806
|
};
|
|
804
807
|
}
|
|
805
808
|
async reports(harnesses) {
|
|
@@ -1636,6 +1639,13 @@ var LocalUsage = class {
|
|
|
1636
1639
|
}
|
|
1637
1640
|
return reading.get();
|
|
1638
1641
|
}
|
|
1642
|
+
/** Each report with its quota. A signed-out harness has no account to ask. */
|
|
1643
|
+
withQuota(harnesses) {
|
|
1644
|
+
return harnesses.map((h) => ({
|
|
1645
|
+
...h,
|
|
1646
|
+
quota: h.signedIn ? this.quota(h.id) : { status: "not_reported" }
|
|
1647
|
+
}));
|
|
1648
|
+
}
|
|
1639
1649
|
/** Token counts from the last log scan, rescanned at most every TOKEN_TTL_MS. */
|
|
1640
1650
|
tokenUsage() {
|
|
1641
1651
|
return this.tokens.get();
|
|
@@ -2547,6 +2557,11 @@ async function run2() {
|
|
|
2547
2557
|
core: new CoreClient(hosted.coreUrl, hosted.coreToken),
|
|
2548
2558
|
harness: hosted.harness,
|
|
2549
2559
|
label: hosted.label,
|
|
2560
|
+
// The box's harnesses sign in as the agent this daemon runs as, so its probes read the owner's account.
|
|
2561
|
+
usage: new LocalUsage({
|
|
2562
|
+
probes: { "claude-code": () => probeClaudeQuota(), codex: () => probeCodexQuota() },
|
|
2563
|
+
log: log2
|
|
2564
|
+
}),
|
|
2550
2565
|
log: log2
|
|
2551
2566
|
}) : local && (name === "claude-code" || name === "codex") ? await localDriver(local, name) : new T3Driver({
|
|
2552
2567
|
client: () => t3.client,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
readRunnerState,
|
|
10
10
|
runnerStatePath,
|
|
11
11
|
threadsFilePath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OIZI3FXO.js";
|
|
13
13
|
import {
|
|
14
14
|
BoxToolError,
|
|
15
15
|
CLOOP_THREAD_PREFIX,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
windowsExecutable,
|
|
49
49
|
windowsPowerShellEnv,
|
|
50
50
|
writeBoxConfig
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-TQ2SCOKH.js";
|
|
52
52
|
import {
|
|
53
53
|
CLAUDE_FLOOR,
|
|
54
54
|
CODEX_FLOOR,
|
|
@@ -62,14 +62,14 @@ import {
|
|
|
62
62
|
} from "./chunk-PKIEWBR7.js";
|
|
63
63
|
import {
|
|
64
64
|
connectWebhook
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-WWG6T3HW.js";
|
|
66
66
|
import {
|
|
67
67
|
ConnectFailure,
|
|
68
68
|
connectReport,
|
|
69
69
|
deviceLogin,
|
|
70
70
|
newAttempt,
|
|
71
71
|
sendConnectReport
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-43OQXKIP.js";
|
|
73
73
|
import {
|
|
74
74
|
defaultDeviceName,
|
|
75
75
|
getMachine,
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
} from "./chunk-SBYSVZ7J.js";
|
|
78
78
|
import {
|
|
79
79
|
VERSION
|
|
80
|
-
} from "./chunk-
|
|
80
|
+
} from "./chunk-Z3KDTCS6.js";
|
|
81
81
|
import {
|
|
82
82
|
STAGING_ORIGIN,
|
|
83
83
|
getOrigin,
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
findRun,
|
|
4
4
|
ownHarness
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PF6QW6CK.js";
|
|
6
6
|
import {
|
|
7
7
|
lockThreadsFile,
|
|
8
8
|
threadsFilePath
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OIZI3FXO.js";
|
|
10
10
|
import {
|
|
11
11
|
localRunsFilePath,
|
|
12
12
|
readRunRecords,
|
|
13
13
|
runHarness,
|
|
14
14
|
takeoverSummary
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-TQ2SCOKH.js";
|
|
16
16
|
import {
|
|
17
17
|
sanitizeLabel
|
|
18
18
|
} from "./chunk-VK6GV757.js";
|
|
@@ -117,147 +117,25 @@ function writeBoxConfig(cfg) {
|
|
|
117
117
|
renameSync(temp, path);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
// src/run-log.ts
|
|
121
|
-
import {
|
|
122
|
-
appendFileSync,
|
|
123
|
-
chmodSync as chmodSync2,
|
|
124
|
-
mkdirSync as mkdirSync2,
|
|
125
|
-
readdirSync,
|
|
126
|
-
renameSync as renameSync2,
|
|
127
|
-
statSync,
|
|
128
|
-
unlinkSync
|
|
129
|
-
} from "fs";
|
|
130
|
-
import { dirname as dirname2, join as join3 } from "path";
|
|
131
|
-
var RUN_LOG_LINE_MAX = 500;
|
|
132
|
-
var RUN_LOG_MAX_BYTES = 5 * 1024 * 1024;
|
|
133
|
-
var RUN_LOG_KEEP_MS = 14 * 24 * 36e5;
|
|
134
|
-
var SAFE_ID = /^[\w-]{1,100}$/;
|
|
135
|
-
function runLogDir(runsFile) {
|
|
136
|
-
return join3(dirname2(runsFile), "runs");
|
|
137
|
-
}
|
|
138
|
-
function runLogPath(dir, workId) {
|
|
139
|
-
return SAFE_ID.test(workId) ? join3(dir, `${workId}.log`) : null;
|
|
140
|
-
}
|
|
141
|
-
var SECRETS = [
|
|
142
|
-
// The whole block, to its END line or the end of the text: a cut-off paste still hides its body.
|
|
143
|
-
[/-----BEGIN ([A-Z0-9 ]+)-----[\s\S]*?(?:-----END \1-----|$)/g, "[redacted key block]"],
|
|
144
|
-
[/\b(Bearer|Basic)\s+[A-Za-z0-9._~+/=-]{8,}/gi, "$1 [redacted]"],
|
|
145
|
-
[/(:\/\/)[^\s/@:]+:[^\s/@]+@/g, "$1[redacted]@"],
|
|
146
|
-
[
|
|
147
|
-
/([?&](?:access_token|token|key|api_key|apikey|secret|sig|signature|code|password)=)[^&\s"']+/gi,
|
|
148
|
-
"$1[redacted]"
|
|
149
|
-
],
|
|
150
|
-
[
|
|
151
|
-
/(\b(?:[\w-]*(?:token|secret|passw(?:or)?d|pwd|api[_-]?key|apikey|credential|private[_-]?key)[\w-]*|authorization|auth)["']?\s*[=:]\s*["']?)(?!Bearer\b|Basic\b|\[redacted)[^\s"',;}]{4,}/gi,
|
|
152
|
-
"$1[redacted]"
|
|
153
|
-
],
|
|
154
|
-
[
|
|
155
|
-
/(--?[\w-]*(?:token|secret|password|api-key|apikey)[\w-]*[ =])["']?[^\s"']{4,}["']?/gi,
|
|
156
|
-
"$1[redacted]"
|
|
157
|
-
],
|
|
158
|
-
[/\b(?:sk|pk|rk)[-_][A-Za-z0-9_-]{16,}/g, "[redacted]"],
|
|
159
|
-
[/\b(?:gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})/g, "[redacted]"],
|
|
160
|
-
[/\bxox[abprs]-[A-Za-z0-9-]{10,}/g, "[redacted]"],
|
|
161
|
-
[/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g, "[redacted]"],
|
|
162
|
-
[/\bAIza[0-9A-Za-z_-]{30,}/g, "[redacted]"],
|
|
163
|
-
[/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{4,}/g, "[redacted]"]
|
|
164
|
-
];
|
|
165
|
-
var OPAQUE = /[A-Za-z0-9_+=-]{32,}/g;
|
|
166
|
-
function redactSecrets(text3) {
|
|
167
|
-
let out = text3;
|
|
168
|
-
for (const [pattern, replacement] of SECRETS) out = out.replace(pattern, replacement);
|
|
169
|
-
return out.replace(
|
|
170
|
-
OPAQUE,
|
|
171
|
-
(run2) => /^[0-9a-f-]+$/i.test(run2) || !/\d/.test(run2) || !/[A-Za-z]/.test(run2) ? run2 : "[redacted]"
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
function logText(text3) {
|
|
175
|
-
const flat = redactSecrets(stripControl(text3).replace(/\s+/g, " ").trim());
|
|
176
|
-
return flat.length > RUN_LOG_LINE_MAX ? `${flat.slice(0, RUN_LOG_LINE_MAX - 1)}\u2026` : flat;
|
|
177
|
-
}
|
|
178
|
-
function logLineFor(item) {
|
|
179
|
-
switch (item.type) {
|
|
180
|
-
case "text":
|
|
181
|
-
return item.text;
|
|
182
|
-
case "tool": {
|
|
183
|
-
const input = item.detail ?? item.summary ?? item.target;
|
|
184
|
-
return `> ${item.name}${input ? `: ${input}` : ""}`;
|
|
185
|
-
}
|
|
186
|
-
case "ask":
|
|
187
|
-
return `? ${item.summary}`;
|
|
188
|
-
case "session":
|
|
189
|
-
return item.notReady ? `! Not connected at start: ${item.notReady.join(", ")}` : null;
|
|
190
|
-
case "result":
|
|
191
|
-
return item.ok ? `= Result: ${item.text ?? "done"}` : `= Error: ${item.text ?? "no text"}`;
|
|
192
|
-
default:
|
|
193
|
-
return null;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
function appendRunLog(dir, workId, text3, { now = Date.now(), maxBytes = RUN_LOG_MAX_BYTES } = {}) {
|
|
197
|
-
const path = runLogPath(dir, workId);
|
|
198
|
-
if (!path) return;
|
|
199
|
-
const line = `${stamp(now)} ${logText(text3)}
|
|
200
|
-
`;
|
|
201
|
-
mkdirSync2(dir, { recursive: true, mode: 448 });
|
|
202
|
-
const size = sizeOf(path);
|
|
203
|
-
if (size > 0 && size + Buffer.byteLength(line) > maxBytes) renameSync2(path, `${path}.1`);
|
|
204
|
-
appendFileSync(path, line, { mode: 384 });
|
|
205
|
-
}
|
|
206
|
-
function pruneRunLogs(dir, now = Date.now(), keepMs = RUN_LOG_KEEP_MS) {
|
|
207
|
-
mkdirSync2(dir, { recursive: true, mode: 448 });
|
|
208
|
-
chmodSync2(dir, 448);
|
|
209
|
-
let removed = 0;
|
|
210
|
-
for (const name of readdirSync(dir)) {
|
|
211
|
-
if (!/\.log(\.1)?$/.test(name)) continue;
|
|
212
|
-
const path = join3(dir, name);
|
|
213
|
-
try {
|
|
214
|
-
if (statSync(path).mtimeMs < now - keepMs) {
|
|
215
|
-
unlinkSync(path);
|
|
216
|
-
removed++;
|
|
217
|
-
}
|
|
218
|
-
} catch {
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
return removed;
|
|
222
|
-
}
|
|
223
|
-
function sizeOf(path) {
|
|
224
|
-
try {
|
|
225
|
-
return statSync(path).size;
|
|
226
|
-
} catch {
|
|
227
|
-
return 0;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
var STOPPED_SUMMARY = "The run was stopped.";
|
|
231
|
-
function endNote(end) {
|
|
232
|
-
return `= ${end.kind === "settled" ? "Done" : "Ended"}: ${end.summary ?? end.kind}`;
|
|
233
|
-
}
|
|
234
|
-
function isEndLogLine(line) {
|
|
235
|
-
return /^\S+ = (Done|Ended): /.test(line);
|
|
236
|
-
}
|
|
237
|
-
function stamp(now) {
|
|
238
|
-
const d = new Date(now);
|
|
239
|
-
return [d.getHours(), d.getMinutes(), d.getSeconds()].map((n) => String(n).padStart(2, "0")).join(":");
|
|
240
|
-
}
|
|
241
|
-
|
|
242
120
|
// src/outside-sessions.ts
|
|
243
121
|
import { createReadStream } from "fs";
|
|
244
122
|
import { readFile, readdir, stat } from "fs/promises";
|
|
245
123
|
import { homedir as homedir2 } from "os";
|
|
246
|
-
import { dirname as
|
|
124
|
+
import { dirname as dirname2, join as join3 } from "path";
|
|
247
125
|
import { createInterface } from "readline";
|
|
248
126
|
var seen = /* @__PURE__ */ new Map();
|
|
249
127
|
var UUID = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;
|
|
250
|
-
async function listOutsideSessions(root =
|
|
128
|
+
async function listOutsideSessions(root = join3(homedir2(), ".claude", "projects"), own = /* @__PURE__ */ new Set(), now = Date.now()) {
|
|
251
129
|
const files = [];
|
|
252
130
|
for (const project of await readdir(root, { withFileTypes: true }).catch(() => [])) {
|
|
253
131
|
if (!project.isDirectory()) continue;
|
|
254
|
-
for (const entry of await readdir(
|
|
132
|
+
for (const entry of await readdir(join3(root, project.name), { withFileTypes: true }).catch(
|
|
255
133
|
() => []
|
|
256
134
|
)) {
|
|
257
135
|
if (!entry.isFile() || !entry.name.endsWith(".jsonl")) continue;
|
|
258
136
|
const id = entry.name.slice(0, -6);
|
|
259
137
|
if (!UUID.test(id) || own.has(id)) continue;
|
|
260
|
-
const path =
|
|
138
|
+
const path = join3(root, project.name, entry.name);
|
|
261
139
|
const info = await stat(path).catch(() => null);
|
|
262
140
|
if (info && info.mtimeMs >= now - 7 * 864e5)
|
|
263
141
|
files.push({ id, project: project.name.slice(0, 200), file: path, mtime: info.mtimeMs });
|
|
@@ -313,14 +191,14 @@ async function claudeMeta(file, mtime) {
|
|
|
313
191
|
return meta;
|
|
314
192
|
}
|
|
315
193
|
function sessionRoots(home = homedir2()) {
|
|
316
|
-
return { claude:
|
|
194
|
+
return { claude: join3(home, ".claude", "projects"), codex: join3(home, ".codex", "sessions") };
|
|
317
195
|
}
|
|
318
196
|
async function findSession(id, roots, harnesses) {
|
|
319
197
|
if (!UUID.test(id)) return null;
|
|
320
198
|
if (harnesses.includes("claude-code")) {
|
|
321
199
|
for (const project of await readdir(roots.claude, { withFileTypes: true }).catch(() => [])) {
|
|
322
200
|
if (!project.isDirectory()) continue;
|
|
323
|
-
const file =
|
|
201
|
+
const file = join3(roots.claude, project.name, `${id}.jsonl`);
|
|
324
202
|
const info = await stat(file).catch(() => null);
|
|
325
203
|
if (!info?.isFile()) continue;
|
|
326
204
|
const meta = await claudeMeta(file, info.mtimeMs);
|
|
@@ -374,13 +252,13 @@ async function codexFiles(root, since = 0) {
|
|
|
374
252
|
const out = [];
|
|
375
253
|
const names = async (dir) => (await readdir(dir, { withFileTypes: true }).catch(() => [])).filter((d) => d.isDirectory() && /^\d+$/.test(d.name)).map((d) => d.name).sort().reverse();
|
|
376
254
|
for (const year of await names(root))
|
|
377
|
-
for (const month of await names(
|
|
378
|
-
for (const day of await names(
|
|
379
|
-
const dir =
|
|
255
|
+
for (const month of await names(join3(root, year)))
|
|
256
|
+
for (const day of await names(join3(root, year, month))) {
|
|
257
|
+
const dir = join3(root, year, month, day);
|
|
380
258
|
for (const entry of await readdir(dir, { withFileTypes: true }).catch(() => [])) {
|
|
381
259
|
const id = entry.isFile() ? ROLLOUT.exec(entry.name)?.[1] : void 0;
|
|
382
260
|
if (!id) continue;
|
|
383
|
-
const file =
|
|
261
|
+
const file = join3(dir, entry.name);
|
|
384
262
|
const info = await stat(file).catch(() => null);
|
|
385
263
|
if (info && info.mtimeMs >= since) out.push({ id, file, mtime: info.mtimeMs });
|
|
386
264
|
}
|
|
@@ -420,7 +298,7 @@ async function codexMeta(file, mtime) {
|
|
|
420
298
|
}
|
|
421
299
|
async function codexTitles(root) {
|
|
422
300
|
const titles = /* @__PURE__ */ new Map();
|
|
423
|
-
const text3 = await readFile(
|
|
301
|
+
const text3 = await readFile(join3(dirname2(root), "session_index.jsonl"), "utf8").catch(() => "");
|
|
424
302
|
for (const line of text3.split("\n")) {
|
|
425
303
|
try {
|
|
426
304
|
const record = JSON.parse(line);
|
|
@@ -432,6 +310,128 @@ async function codexTitles(root) {
|
|
|
432
310
|
return titles;
|
|
433
311
|
}
|
|
434
312
|
|
|
313
|
+
// src/run-log.ts
|
|
314
|
+
import {
|
|
315
|
+
appendFileSync,
|
|
316
|
+
chmodSync as chmodSync2,
|
|
317
|
+
mkdirSync as mkdirSync2,
|
|
318
|
+
readdirSync,
|
|
319
|
+
renameSync as renameSync2,
|
|
320
|
+
statSync,
|
|
321
|
+
unlinkSync
|
|
322
|
+
} from "fs";
|
|
323
|
+
import { dirname as dirname3, join as join4 } from "path";
|
|
324
|
+
var RUN_LOG_LINE_MAX = 500;
|
|
325
|
+
var RUN_LOG_MAX_BYTES = 5 * 1024 * 1024;
|
|
326
|
+
var RUN_LOG_KEEP_MS = 14 * 24 * 36e5;
|
|
327
|
+
var SAFE_ID = /^[\w-]{1,100}$/;
|
|
328
|
+
function runLogDir(runsFile) {
|
|
329
|
+
return join4(dirname3(runsFile), "runs");
|
|
330
|
+
}
|
|
331
|
+
function runLogPath(dir, workId) {
|
|
332
|
+
return SAFE_ID.test(workId) ? join4(dir, `${workId}.log`) : null;
|
|
333
|
+
}
|
|
334
|
+
var SECRETS = [
|
|
335
|
+
// The whole block, to its END line or the end of the text: a cut-off paste still hides its body.
|
|
336
|
+
[/-----BEGIN ([A-Z0-9 ]+)-----[\s\S]*?(?:-----END \1-----|$)/g, "[redacted key block]"],
|
|
337
|
+
[/\b(Bearer|Basic)\s+[A-Za-z0-9._~+/=-]{8,}/gi, "$1 [redacted]"],
|
|
338
|
+
[/(:\/\/)[^\s/@:]+:[^\s/@]+@/g, "$1[redacted]@"],
|
|
339
|
+
[
|
|
340
|
+
/([?&](?:access_token|token|key|api_key|apikey|secret|sig|signature|code|password)=)[^&\s"']+/gi,
|
|
341
|
+
"$1[redacted]"
|
|
342
|
+
],
|
|
343
|
+
[
|
|
344
|
+
/(\b(?:[\w-]*(?:token|secret|passw(?:or)?d|pwd|api[_-]?key|apikey|credential|private[_-]?key)[\w-]*|authorization|auth)["']?\s*[=:]\s*["']?)(?!Bearer\b|Basic\b|\[redacted)[^\s"',;}]{4,}/gi,
|
|
345
|
+
"$1[redacted]"
|
|
346
|
+
],
|
|
347
|
+
[
|
|
348
|
+
/(--?[\w-]*(?:token|secret|password|api-key|apikey)[\w-]*[ =])["']?[^\s"']{4,}["']?/gi,
|
|
349
|
+
"$1[redacted]"
|
|
350
|
+
],
|
|
351
|
+
[/\b(?:sk|pk|rk)[-_][A-Za-z0-9_-]{16,}/g, "[redacted]"],
|
|
352
|
+
[/\b(?:gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})/g, "[redacted]"],
|
|
353
|
+
[/\bxox[abprs]-[A-Za-z0-9-]{10,}/g, "[redacted]"],
|
|
354
|
+
[/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g, "[redacted]"],
|
|
355
|
+
[/\bAIza[0-9A-Za-z_-]{30,}/g, "[redacted]"],
|
|
356
|
+
[/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{4,}/g, "[redacted]"]
|
|
357
|
+
];
|
|
358
|
+
var OPAQUE = /[A-Za-z0-9_+=-]{32,}/g;
|
|
359
|
+
function redactSecrets(text3) {
|
|
360
|
+
let out = text3;
|
|
361
|
+
for (const [pattern, replacement] of SECRETS) out = out.replace(pattern, replacement);
|
|
362
|
+
return out.replace(
|
|
363
|
+
OPAQUE,
|
|
364
|
+
(run2) => /^[0-9a-f-]+$/i.test(run2) || !/\d/.test(run2) || !/[A-Za-z]/.test(run2) ? run2 : "[redacted]"
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
function logText(text3) {
|
|
368
|
+
const flat = redactSecrets(stripControl(text3).replace(/\s+/g, " ").trim());
|
|
369
|
+
return flat.length > RUN_LOG_LINE_MAX ? `${flat.slice(0, RUN_LOG_LINE_MAX - 1)}\u2026` : flat;
|
|
370
|
+
}
|
|
371
|
+
function logLineFor(item) {
|
|
372
|
+
switch (item.type) {
|
|
373
|
+
case "text":
|
|
374
|
+
return item.text;
|
|
375
|
+
case "tool": {
|
|
376
|
+
const input = item.detail ?? item.summary ?? item.target;
|
|
377
|
+
return `> ${item.name}${input ? `: ${input}` : ""}`;
|
|
378
|
+
}
|
|
379
|
+
case "ask":
|
|
380
|
+
return `? ${item.summary}`;
|
|
381
|
+
case "session":
|
|
382
|
+
return item.notReady ? `! Not connected at start: ${item.notReady.join(", ")}` : null;
|
|
383
|
+
case "result":
|
|
384
|
+
return item.ok ? `= Result: ${item.text ?? "done"}` : `= Error: ${item.text ?? "no text"}`;
|
|
385
|
+
default:
|
|
386
|
+
return null;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
function appendRunLog(dir, workId, text3, { now = Date.now(), maxBytes = RUN_LOG_MAX_BYTES } = {}) {
|
|
390
|
+
const path = runLogPath(dir, workId);
|
|
391
|
+
if (!path) return;
|
|
392
|
+
const line = `${stamp(now)} ${logText(text3)}
|
|
393
|
+
`;
|
|
394
|
+
mkdirSync2(dir, { recursive: true, mode: 448 });
|
|
395
|
+
const size = sizeOf(path);
|
|
396
|
+
if (size > 0 && size + Buffer.byteLength(line) > maxBytes) renameSync2(path, `${path}.1`);
|
|
397
|
+
appendFileSync(path, line, { mode: 384 });
|
|
398
|
+
}
|
|
399
|
+
function pruneRunLogs(dir, now = Date.now(), keepMs = RUN_LOG_KEEP_MS) {
|
|
400
|
+
mkdirSync2(dir, { recursive: true, mode: 448 });
|
|
401
|
+
chmodSync2(dir, 448);
|
|
402
|
+
let removed = 0;
|
|
403
|
+
for (const name of readdirSync(dir)) {
|
|
404
|
+
if (!/\.log(\.1)?$/.test(name)) continue;
|
|
405
|
+
const path = join4(dir, name);
|
|
406
|
+
try {
|
|
407
|
+
if (statSync(path).mtimeMs < now - keepMs) {
|
|
408
|
+
unlinkSync(path);
|
|
409
|
+
removed++;
|
|
410
|
+
}
|
|
411
|
+
} catch {
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return removed;
|
|
415
|
+
}
|
|
416
|
+
function sizeOf(path) {
|
|
417
|
+
try {
|
|
418
|
+
return statSync(path).size;
|
|
419
|
+
} catch {
|
|
420
|
+
return 0;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
var STOPPED_SUMMARY = "The run was stopped.";
|
|
424
|
+
function endNote(end) {
|
|
425
|
+
return `= ${end.kind === "settled" ? "Done" : "Ended"}: ${end.summary ?? end.kind}`;
|
|
426
|
+
}
|
|
427
|
+
function isEndLogLine(line) {
|
|
428
|
+
return /^\S+ = (Done|Ended): /.test(line);
|
|
429
|
+
}
|
|
430
|
+
function stamp(now) {
|
|
431
|
+
const d = new Date(now);
|
|
432
|
+
return [d.getHours(), d.getMinutes(), d.getSeconds()].map((n) => String(n).padStart(2, "0")).join(":");
|
|
433
|
+
}
|
|
434
|
+
|
|
435
435
|
// src/spawn-command.ts
|
|
436
436
|
import { execFileSync } from "child_process";
|
|
437
437
|
function commandFor(bin, args, platform = process.platform, comspec = process.env.ComSpec) {
|
|
@@ -768,6 +768,23 @@ import { randomUUID } from "crypto";
|
|
|
768
768
|
import { existsSync as existsSync2 } from "fs";
|
|
769
769
|
import { join as join7 } from "path";
|
|
770
770
|
|
|
771
|
+
// ../clo0p-app/contracts/work-spec.ts
|
|
772
|
+
var IMAGE_TYPES = {
|
|
773
|
+
"image/jpeg": "jpg",
|
|
774
|
+
"image/png": "png",
|
|
775
|
+
"image/webp": "webp",
|
|
776
|
+
"image/gif": "gif"
|
|
777
|
+
};
|
|
778
|
+
function isImageType(type) {
|
|
779
|
+
return Object.hasOwn(IMAGE_TYPES, type);
|
|
780
|
+
}
|
|
781
|
+
var IMAGE_MAX_BYTES = 10 * 1024 * 1024;
|
|
782
|
+
var ATTACHMENTS_MAX = 8;
|
|
783
|
+
function repoName(repository) {
|
|
784
|
+
const name = repository?.trim().toLowerCase().split("/").filter(Boolean).at(-1);
|
|
785
|
+
return name || null;
|
|
786
|
+
}
|
|
787
|
+
|
|
771
788
|
// ../clo0p-app/contracts/run-result.ts
|
|
772
789
|
var WIZARD_STEPS_MAX = 6;
|
|
773
790
|
var WIZARD_FOR = "steps only the user can do by hand: a sign-in, an app permission, a key from a dashboard, or a change in a dashboard or console you cannot make yourself";
|
|
@@ -910,23 +927,6 @@ function droppedLine(dropped, run2) {
|
|
|
910
927
|
return dropped.outputs || dropped.checks ? `result_items_dropped run=${run2} outputs=${dropped.outputs} checks=${dropped.checks}` : null;
|
|
911
928
|
}
|
|
912
929
|
|
|
913
|
-
// ../clo0p-app/contracts/work-spec.ts
|
|
914
|
-
var IMAGE_TYPES = {
|
|
915
|
-
"image/jpeg": "jpg",
|
|
916
|
-
"image/png": "png",
|
|
917
|
-
"image/webp": "webp",
|
|
918
|
-
"image/gif": "gif"
|
|
919
|
-
};
|
|
920
|
-
function isImageType(type) {
|
|
921
|
-
return Object.hasOwn(IMAGE_TYPES, type);
|
|
922
|
-
}
|
|
923
|
-
var IMAGE_MAX_BYTES = 10 * 1024 * 1024;
|
|
924
|
-
var ATTACHMENTS_MAX = 8;
|
|
925
|
-
function repoName(repository) {
|
|
926
|
-
const name = repository?.trim().toLowerCase().split("/").filter(Boolean).at(-1);
|
|
927
|
-
return name || null;
|
|
928
|
-
}
|
|
929
|
-
|
|
930
930
|
// src/drivers/attachments.ts
|
|
931
931
|
import { mkdir, writeFile } from "fs/promises";
|
|
932
932
|
import { join as join6 } from "path";
|
|
@@ -1017,6 +1017,9 @@ var RUNTIME_MODES = /* @__PURE__ */ new Set([
|
|
|
1017
1017
|
"auto",
|
|
1018
1018
|
"full-access"
|
|
1019
1019
|
]);
|
|
1020
|
+
function cloneLine(repository) {
|
|
1021
|
+
return `This Task names the repository ${repository}, and this machine has no project for it. Clone it outside this folder, or find it on this machine, and work in it.`;
|
|
1022
|
+
}
|
|
1020
1023
|
var BoxToolError = class extends Error {
|
|
1021
1024
|
constructor(code) {
|
|
1022
1025
|
super(code);
|
|
@@ -1559,18 +1562,15 @@ function projectNames(p) {
|
|
|
1559
1562
|
function isRepository(p) {
|
|
1560
1563
|
return Boolean(p.repositoryIdentity) || existsSync2(join7(p.workspaceRoot, ".git"));
|
|
1561
1564
|
}
|
|
1565
|
+
function holdsRepository(p, repository) {
|
|
1566
|
+
return projectNames(p).some((name) => repoName(name) === repoName(repository));
|
|
1567
|
+
}
|
|
1562
1568
|
function pickProject(projects, repository) {
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
throw new BoxToolError("no_project");
|
|
1569
|
-
}
|
|
1570
|
-
const want = repoName(repository);
|
|
1571
|
-
const found = projects.find((p) => projectNames(p).some((name) => repoName(name) === want));
|
|
1572
|
-
if (!found) throw new BoxToolError("no_project");
|
|
1573
|
-
return found;
|
|
1569
|
+
const named = repository ? projects.find((p) => holdsRepository(p, repository)) : void 0;
|
|
1570
|
+
const repos = projects.filter(isRepository);
|
|
1571
|
+
const picked = named ?? (repos.length > 0 ? repos : projects)[0];
|
|
1572
|
+
if (!picked) throw new BoxToolError("no_project");
|
|
1573
|
+
return picked;
|
|
1574
1574
|
}
|
|
1575
1575
|
var SHELL_HEADERS = { "x-t3-orchestration-protocol": "2" };
|
|
1576
1576
|
function boxCapabilities(scope) {
|
|
@@ -1821,6 +1821,11 @@ var T3Driver = class {
|
|
|
1821
1821
|
]);
|
|
1822
1822
|
this.providers = cfg.providers;
|
|
1823
1823
|
const project = pickProject(shell.projects ?? [], a.repository);
|
|
1824
|
+
const missing = a.repository && !holdsRepository(project, a.repository) ? a.repository : null;
|
|
1825
|
+
if (missing)
|
|
1826
|
+
this.log(
|
|
1827
|
+
`launch work=${a.work_id} has no ${missing}; starts in ${project.title} to clone it`
|
|
1828
|
+
);
|
|
1824
1829
|
const runtimeMode = a.runtime_mode ?? cfg.settings?.defaultRuntimeMode;
|
|
1825
1830
|
if (!runtimeMode || !RUNTIME_MODES.has(runtimeMode))
|
|
1826
1831
|
throw new BoxToolError("runtime_mode_unknown");
|
|
@@ -1861,7 +1866,7 @@ var T3Driver = class {
|
|
|
1861
1866
|
...photos2.attachments.length ? { threadId: a.work_id } : {},
|
|
1862
1867
|
initialMessage: {
|
|
1863
1868
|
...photos2.attachments.length ? { messageId: a.work_id } : {},
|
|
1864
|
-
text: [a.prompt, photos2.line, RESULT_INSTRUCTION].filter(Boolean).join("\n\n"),
|
|
1869
|
+
text: [a.prompt, missing && cloneLine(missing), photos2.line, RESULT_INSTRUCTION].filter(Boolean).join("\n\n"),
|
|
1865
1870
|
attachments: photos2.attachments
|
|
1866
1871
|
}
|
|
1867
1872
|
}
|
|
@@ -2541,17 +2546,14 @@ function failedEnd(harness, run2) {
|
|
|
2541
2546
|
function localRunsFilePath(env) {
|
|
2542
2547
|
return runnerPath(env, process.env.CLOOP_LOCAL_RUNS_FILE, (dir) => join8(dir, "local-runs.json"));
|
|
2543
2548
|
}
|
|
2544
|
-
function
|
|
2545
|
-
if (!repository) {
|
|
2546
|
-
if (repos.length === 1 && repos[0]) return repos[0];
|
|
2547
|
-
throw new BoxToolError("no_project");
|
|
2548
|
-
}
|
|
2549
|
+
function holdsRepository2(r, repository) {
|
|
2549
2550
|
const want = repoName(repository);
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2551
|
+
return repoName(r.label) === want || repoName(basename(r.path)) === want;
|
|
2552
|
+
}
|
|
2553
|
+
function pickRepo(repos, repository) {
|
|
2554
|
+
const picked = repository && repos.find((r) => holdsRepository2(r, repository)) || repos[0];
|
|
2555
|
+
if (!picked) throw new BoxToolError("no_project");
|
|
2556
|
+
return picked;
|
|
2555
2557
|
}
|
|
2556
2558
|
function run(cmd, args, cwd) {
|
|
2557
2559
|
return new Promise(
|
|
@@ -2678,11 +2680,7 @@ var LocalDriver = class {
|
|
|
2678
2680
|
const usage = this.deps.usage;
|
|
2679
2681
|
return {
|
|
2680
2682
|
box: { label: this.deps.label ?? hostname(), driver: this.name },
|
|
2681
|
-
harnesses: usage ?
|
|
2682
|
-
...h,
|
|
2683
|
-
// A signed-out harness has no account to ask.
|
|
2684
|
-
quota: h.signedIn ? usage.quota(h.id) : { status: "not_reported" }
|
|
2685
|
-
})) : harnesses,
|
|
2683
|
+
harnesses: usage ? usage.withQuota(harnesses) : harnesses,
|
|
2686
2684
|
harnesses_checked_at: checkedAt,
|
|
2687
2685
|
...probing ? { probing: true } : {},
|
|
2688
2686
|
clients: null,
|
|
@@ -2817,7 +2815,12 @@ var LocalDriver = class {
|
|
|
2817
2815
|
if (a.harness && !own.aliases.includes(a.harness))
|
|
2818
2816
|
throw new BoxToolError("harness_unavailable");
|
|
2819
2817
|
const repo = pickRepo(this.deps.repos, a.repository);
|
|
2820
|
-
|
|
2818
|
+
const missing = a.repository && !holdsRepository2(repo, a.repository) ? a.repository : null;
|
|
2819
|
+
if (missing)
|
|
2820
|
+
this.log(
|
|
2821
|
+
`launch work=${a.work_id} has no ${missing}; starts in ${basename(repo.path)} to clone it`
|
|
2822
|
+
);
|
|
2823
|
+
else this.refuseBusy(repo.path);
|
|
2821
2824
|
const { dialect, moved } = await this.route(a);
|
|
2822
2825
|
const head = await this.repo.head(repo.path);
|
|
2823
2826
|
const photos2 = await this.photos(a);
|
|
@@ -2830,15 +2833,13 @@ var LocalDriver = class {
|
|
|
2830
2833
|
takeover: true,
|
|
2831
2834
|
harness: this.dialectOf(concurrent).name
|
|
2832
2835
|
};
|
|
2833
|
-
this.refuseBusy(repo.path);
|
|
2836
|
+
if (!missing) this.refuseBusy(repo.path);
|
|
2834
2837
|
const record = {
|
|
2835
2838
|
work_id: a.work_id,
|
|
2836
2839
|
session_id: dialect.name === "claude-code" ? a.work_id : null,
|
|
2837
2840
|
repo: repo.path,
|
|
2838
2841
|
title: a.title,
|
|
2839
|
-
prompt:
|
|
2840
|
-
|
|
2841
|
-
${photos2.line}` : a.prompt,
|
|
2842
|
+
prompt: [a.prompt, missing && cloneLine(missing), photos2.line].filter(Boolean).join("\n\n"),
|
|
2842
2843
|
...photos2.paths.length ? { images: photos2.paths } : {},
|
|
2843
2844
|
...a.model && !moved ? { model: a.model } : {},
|
|
2844
2845
|
...a.runtime_mode ? { runtime_mode: a.runtime_mode } : {},
|
|
@@ -3428,12 +3429,12 @@ export {
|
|
|
3428
3429
|
readRunnerConfig,
|
|
3429
3430
|
writeBoxConfig,
|
|
3430
3431
|
IMAGE_TYPES,
|
|
3432
|
+
listOutsideSessions,
|
|
3431
3433
|
runLogDir,
|
|
3432
3434
|
runLogPath,
|
|
3433
3435
|
redactSecrets,
|
|
3434
3436
|
STOPPED_SUMMARY,
|
|
3435
3437
|
isEndLogLine,
|
|
3436
|
-
listOutsideSessions,
|
|
3437
3438
|
commandFor,
|
|
3438
3439
|
quoteWindowsArg,
|
|
3439
3440
|
windowsExecutable,
|
|
@@ -53,17 +53,17 @@ import {
|
|
|
53
53
|
which,
|
|
54
54
|
workFolder,
|
|
55
55
|
workFolderLine
|
|
56
|
-
} from "./chunk-
|
|
56
|
+
} from "./chunk-3WRLILTX.js";
|
|
57
57
|
import "./chunk-KDTPUD2Y.js";
|
|
58
|
-
import "./chunk-
|
|
59
|
-
import "./chunk-
|
|
58
|
+
import "./chunk-OIZI3FXO.js";
|
|
59
|
+
import "./chunk-TQ2SCOKH.js";
|
|
60
60
|
import "./chunk-VK6GV757.js";
|
|
61
61
|
import "./chunk-365HFCQQ.js";
|
|
62
62
|
import "./chunk-PKIEWBR7.js";
|
|
63
|
-
import "./chunk-
|
|
64
|
-
import "./chunk-
|
|
63
|
+
import "./chunk-WWG6T3HW.js";
|
|
64
|
+
import "./chunk-43OQXKIP.js";
|
|
65
65
|
import "./chunk-SBYSVZ7J.js";
|
|
66
|
-
import "./chunk-
|
|
66
|
+
import "./chunk-Z3KDTCS6.js";
|
|
67
67
|
import "./chunk-D5UZW42X.js";
|
|
68
68
|
export {
|
|
69
69
|
DEFAULT_T3_URL,
|
|
@@ -7,17 +7,17 @@ import {
|
|
|
7
7
|
runnerOrigin,
|
|
8
8
|
stopService,
|
|
9
9
|
unitOrigin
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3WRLILTX.js";
|
|
11
11
|
import "./chunk-KDTPUD2Y.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-OIZI3FXO.js";
|
|
13
|
+
import "./chunk-TQ2SCOKH.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-WWG6T3HW.js";
|
|
18
|
+
import "./chunk-43OQXKIP.js";
|
|
19
19
|
import "./chunk-SBYSVZ7J.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-Z3KDTCS6.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-3WRLILTX.js";
|
|
6
6
|
import "./chunk-KDTPUD2Y.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-OIZI3FXO.js";
|
|
8
|
+
import "./chunk-TQ2SCOKH.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-WWG6T3HW.js";
|
|
13
|
+
import "./chunk-43OQXKIP.js";
|
|
14
14
|
import "./chunk-SBYSVZ7J.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-Z3KDTCS6.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-Z3KDTCS6.js";
|
|
8
8
|
import {
|
|
9
9
|
applyEnvironmentFlag
|
|
10
10
|
} from "./chunk-D5UZW42X.js";
|
|
@@ -68,7 +68,7 @@ Add --staging to any command to use Cloop staging instead of production.
|
|
|
68
68
|
A production machine and a staging machine can run side by side on one computer.
|
|
69
69
|
`;
|
|
70
70
|
async function pinExistingRunner() {
|
|
71
|
-
const { pinExistingRunner: pin } = await import("./existing-runner-
|
|
71
|
+
const { pinExistingRunner: pin } = await import("./existing-runner-XOCSW4F4.js");
|
|
72
72
|
const { note } = pin();
|
|
73
73
|
if (note) console.error(note);
|
|
74
74
|
}
|
|
@@ -76,7 +76,7 @@ async function main() {
|
|
|
76
76
|
switch (command) {
|
|
77
77
|
case "login":
|
|
78
78
|
case "auth": {
|
|
79
|
-
const { loginCommand } = await import("./login-
|
|
79
|
+
const { loginCommand } = await import("./login-JRAQBWSB.js");
|
|
80
80
|
await loginCommand(argv);
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
@@ -86,61 +86,61 @@ async function main() {
|
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
88
|
case "serve": {
|
|
89
|
-
const { startMcpServer } = await import("./mcp-server-
|
|
89
|
+
const { startMcpServer } = await import("./mcp-server-N7WRPR77.js");
|
|
90
90
|
await startMcpServer();
|
|
91
91
|
break;
|
|
92
92
|
}
|
|
93
93
|
case "statusline": {
|
|
94
|
-
const { statuslineCommand } = await import("./statusline-
|
|
94
|
+
const { statuslineCommand } = await import("./statusline-JYOI3SWJ.js");
|
|
95
95
|
statuslineCommand();
|
|
96
96
|
break;
|
|
97
97
|
}
|
|
98
98
|
case "connect": {
|
|
99
|
-
const { connectCommand } = await import("./connect-
|
|
99
|
+
const { connectCommand } = await import("./connect-CBWHDE5Y.js");
|
|
100
100
|
await connectCommand(argv.slice(1));
|
|
101
101
|
break;
|
|
102
102
|
}
|
|
103
103
|
case "use": {
|
|
104
|
-
const { useCommand } = await import("./use-
|
|
104
|
+
const { useCommand } = await import("./use-BLFMGGRV.js");
|
|
105
105
|
process.exitCode = await useCommand(argv.slice(1));
|
|
106
106
|
break;
|
|
107
107
|
}
|
|
108
108
|
case "disconnect": {
|
|
109
|
-
const { disconnectCommand } = await import("./disconnect-
|
|
109
|
+
const { disconnectCommand } = await import("./disconnect-POJACA2Q.js");
|
|
110
110
|
await disconnectCommand(argv.slice(1));
|
|
111
111
|
break;
|
|
112
112
|
}
|
|
113
113
|
case "box": {
|
|
114
|
-
const { boxCommand } = await import("./box-
|
|
114
|
+
const { boxCommand } = await import("./box-TQJJ6EJK.js");
|
|
115
115
|
await boxCommand(argv.slice(1));
|
|
116
116
|
break;
|
|
117
117
|
}
|
|
118
118
|
case "runs": {
|
|
119
119
|
await pinExistingRunner();
|
|
120
|
-
const { runsCommand } = await import("./runs-
|
|
120
|
+
const { runsCommand } = await import("./runs-5YIEWOJM.js");
|
|
121
121
|
process.exitCode = runsCommand();
|
|
122
122
|
break;
|
|
123
123
|
}
|
|
124
124
|
case "watch": {
|
|
125
125
|
await pinExistingRunner();
|
|
126
|
-
const { watchCommand } = await import("./runs-
|
|
126
|
+
const { watchCommand } = await import("./runs-5YIEWOJM.js");
|
|
127
127
|
process.exitCode = await watchCommand(argv.slice(1));
|
|
128
128
|
break;
|
|
129
129
|
}
|
|
130
130
|
case "takeover": {
|
|
131
131
|
await pinExistingRunner();
|
|
132
|
-
const { takeoverCommand } = await import("./takeover-
|
|
132
|
+
const { takeoverCommand } = await import("./takeover-S3PBIUN5.js");
|
|
133
133
|
process.exitCode = await takeoverCommand(argv.slice(1));
|
|
134
134
|
break;
|
|
135
135
|
}
|
|
136
136
|
case "resume": {
|
|
137
137
|
await pinExistingRunner();
|
|
138
|
-
const { resumeCommand } = await import("./runs-
|
|
138
|
+
const { resumeCommand } = await import("./runs-5YIEWOJM.js");
|
|
139
139
|
process.exitCode = await resumeCommand(argv.slice(1));
|
|
140
140
|
break;
|
|
141
141
|
}
|
|
142
142
|
case "runner": {
|
|
143
|
-
const { runnerCommand } = await import("./runner-
|
|
143
|
+
const { runnerCommand } = await import("./runner-KFEUMXMY.js");
|
|
144
144
|
await runnerCommand(argv.slice(1));
|
|
145
145
|
break;
|
|
146
146
|
}
|
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
deviceLogin,
|
|
4
4
|
loginCommand,
|
|
5
5
|
refusalSentence
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-43OQXKIP.js";
|
|
7
7
|
import "./chunk-SBYSVZ7J.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-Z3KDTCS6.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-WWG6T3HW.js";
|
|
6
|
+
import "./chunk-43OQXKIP.js";
|
|
7
7
|
import "./chunk-SBYSVZ7J.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-Z3KDTCS6.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-PF6QW6CK.js";
|
|
13
|
+
import "./chunk-TQ2SCOKH.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-HYYLDJ5K.js";
|
|
13
|
+
import "./chunk-PF6QW6CK.js";
|
|
14
|
+
import "./chunk-OIZI3FXO.js";
|
|
15
|
+
import "./chunk-TQ2SCOKH.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-3WRLILTX.js";
|
|
7
7
|
import "./chunk-KDTPUD2Y.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-OIZI3FXO.js";
|
|
9
9
|
import {
|
|
10
10
|
isLocal,
|
|
11
11
|
readRunnerConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-TQ2SCOKH.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-WWG6T3HW.js";
|
|
17
|
+
import "./chunk-43OQXKIP.js";
|
|
18
18
|
import "./chunk-SBYSVZ7J.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-Z3KDTCS6.js";
|
|
20
20
|
import "./chunk-D5UZW42X.js";
|
|
21
21
|
|
|
22
22
|
// src/commands/use.ts
|
package/package.json
CHANGED