@cloop/runner 0.3.12 → 0.3.14

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.
@@ -9,192 +9,6 @@ import {
9
9
  getOrigin
10
10
  } from "./chunk-D5UZW42X.js";
11
11
 
12
- // src/run-result.ts
13
- var RESULT_INSTRUCTION = [
14
- "When you finish, end your final message with a fenced block tagged cloop-result containing JSON, for example:",
15
- "```cloop-result",
16
- '{"summary": "One or two sentences on what you did.", "outputs": [{"kind": "pr", "title": "fix: the thing", "url": "https://github.com/org/repo/pull/1"}], "checks": [{"name": "Tests", "outcome": "passed"}]}',
17
- "```",
18
- "An output kind is one of: pr or link (title, url), draft (title, body, optional to, optional url), doc (title, optional url or body), file (title, path). A check outcome is passed, failed or skipped.",
19
- "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.",
20
- "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."
21
- ].join("\n");
22
- var text = (v, max) => typeof v === "string" && v.length <= max;
23
- var optionalText = (v, max) => v === void 0 || text(v, max);
24
- var https = (v) => {
25
- try {
26
- return typeof v === "string" && new URL(v).protocol === "https:";
27
- } catch {
28
- return false;
29
- }
30
- };
31
- var PR_URL = /https:\/\/github\.com\/[\w.-]+\/[\w.-]+\/pull\/\d+/g;
32
- var prNumber = (url) => Number(url.slice(url.lastIndexOf("/") + 1));
33
- function prUrlIn(text2) {
34
- const urls = text2?.match(PR_URL) ?? [];
35
- return urls.reduce(
36
- (newest, url) => newest && prNumber(newest) >= prNumber(url) ? newest : url,
37
- null
38
- );
39
- }
40
- function resultPrUrl(finalMessage) {
41
- const result = parseRunResult(finalMessage);
42
- if (!result) return prUrlIn(finalMessage);
43
- const prs = result.outputs.flatMap((o) => o.kind === "pr" ? [o.url] : []);
44
- return prs.at(-1) ?? null;
45
- }
46
- var SUMMARY_MAX = 4e3;
47
- var DOC_BODY_MAX = 8e3;
48
- function addressOutput(url) {
49
- const pr = url.match(/\/pull\/(\d+)$/);
50
- if (pr && prUrlIn(url) === url) return { kind: "pr", title: `Pull request #${pr[1]}`, url };
51
- const { host, pathname } = new URL(url);
52
- return { kind: "link", title: `${host}${pathname === "/" ? "" : pathname}`.slice(0, 120), url };
53
- }
54
- function cleanOutput(o) {
55
- if (typeof o === "string") return https(o.trim()) ? addressOutput(o.trim()) : null;
56
- if (!o || typeof o !== "object") return null;
57
- const out = o;
58
- if (!text(out.title, 120)) return null;
59
- const title = out.title;
60
- switch (out.kind) {
61
- case "pr":
62
- case "link":
63
- return https(out.url) ? { kind: out.kind, title, url: out.url } : null;
64
- case "draft":
65
- return text(out.body, 4e3) && optionalText(out.to, 200) && (out.url === void 0 || https(out.url)) ? {
66
- kind: "draft",
67
- title,
68
- body: out.body,
69
- ...out.to !== void 0 ? { to: out.to } : {},
70
- ...out.url !== void 0 ? { url: out.url } : {}
71
- } : null;
72
- case "doc": {
73
- const body = typeof out.body === "string" && out.body.length > DOC_BODY_MAX ? `${out.body.slice(0, DOC_BODY_MAX - 1)}\u2026` : out.body;
74
- return optionalText(body, DOC_BODY_MAX) && (out.url === void 0 || https(out.url)) ? {
75
- kind: "doc",
76
- title,
77
- ...out.url !== void 0 ? { url: out.url } : {},
78
- ...body !== void 0 ? { body } : {}
79
- } : null;
80
- }
81
- case "file":
82
- return text(out.path, 400) ? { kind: "file", title, path: out.path } : null;
83
- default:
84
- return null;
85
- }
86
- }
87
- function cleanCheck(c) {
88
- if (!c || typeof c !== "object") return null;
89
- const check = c;
90
- if (!text(check.name, 80) || !["passed", "failed", "skipped"].includes(check.outcome))
91
- return null;
92
- if (!optionalText(check.detail, 200)) return null;
93
- return {
94
- name: check.name,
95
- outcome: check.outcome,
96
- ...check.detail !== void 0 ? { detail: check.detail } : {}
97
- };
98
- }
99
- function readRunResult(message) {
100
- const none = { dropped: { outputs: 0, checks: 0 } };
101
- const block = [...(message ?? "").matchAll(/```cloop-result\s*\n([\s\S]*?)```/g)].at(-1)?.[1];
102
- if (!block) return none;
103
- try {
104
- const value = JSON.parse(block);
105
- const summary = typeof value?.summary === "string" ? value.summary.trim() : "";
106
- if (!summary) return none;
107
- const list = (v) => Array.isArray(v) ? v : [];
108
- const outputs = list(value.outputs).flatMap((o) => cleanOutput(o) ?? []);
109
- const checks = list(value.checks).flatMap((c) => cleanCheck(c) ?? []);
110
- return {
111
- result: {
112
- summary: summary.length > SUMMARY_MAX ? `${summary.slice(0, SUMMARY_MAX - 1)}\u2026` : summary,
113
- outputs: outputs.slice(0, 10),
114
- checks: checks.slice(0, 10),
115
- ...value.nothing_new === true ? { nothing_new: true } : {}
116
- },
117
- dropped: {
118
- outputs: list(value.outputs).length - outputs.length,
119
- checks: list(value.checks).length - checks.length
120
- }
121
- };
122
- } catch {
123
- return none;
124
- }
125
- }
126
- function parseRunResult(message) {
127
- return readRunResult(message).result;
128
- }
129
- function droppedLine(dropped, run2) {
130
- return dropped.outputs || dropped.checks ? `result_items_dropped run=${run2} outputs=${dropped.outputs} checks=${dropped.checks}` : null;
131
- }
132
-
133
- // src/drivers/driver.ts
134
- var RUNTIME_MODES = /* @__PURE__ */ new Set([
135
- "approval-required",
136
- "auto-accept-edits",
137
- "auto",
138
- "full-access"
139
- ]);
140
- var BoxToolError = class extends Error {
141
- constructor(code) {
142
- super(code);
143
- this.code = code;
144
- this.name = "BoxToolError";
145
- }
146
- code;
147
- };
148
- var CLOOP_THREAD_PREFIX = "cloop:";
149
- function questionLine(questions) {
150
- return questions.map(
151
- (x) => x.options?.length ? `${x.question} (${x.options.map((o) => o.label).join(", ")})` : x.question
152
- ).join(" ").slice(0, 500);
153
- }
154
- function isProgressSentence(value) {
155
- return typeof value === "string" && /\S[ \t]+\S/.test(value.trim().split(/\r?\n/)[0] ?? "");
156
- }
157
- var PROGRESS_MS = 3e4;
158
- var RUN_TEXT_MAX = 4e3;
159
- function nextProgress(clock, text2, now, ms = PROGRESS_MS, force = false) {
160
- const summary = (parseRunResult(text2)?.summary ?? text2.split("```cloop-result")[0] ?? "").replace(/\s+/g, " ").trim().slice(0, RUN_TEXT_MAX);
161
- if (!isProgressSentence(summary)) return null;
162
- if (!force && now - clock.lastProgressAt < ms) return null;
163
- clock.lastProgressAt = now;
164
- return summary;
165
- }
166
- var YES_WORDS = /* @__PURE__ */ new Set([
167
- "y",
168
- "yes",
169
- "yep",
170
- "yeah",
171
- "allow",
172
- "allow it",
173
- "ok",
174
- "okay",
175
- "approve",
176
- "approved",
177
- "go ahead",
178
- "sure",
179
- "do it"
180
- ]);
181
- function isYes(reply) {
182
- return YES_WORDS.has(
183
- reply.trim().toLowerCase().replace(/[.!\s]+$/, "")
184
- );
185
- }
186
- var HARNESS_LIMIT = /usage limit|reached your [\w .-]{0,40}limit|hit your [\w .-]{0,40}limit|out of (usage )?credits/i;
187
- function limitedModel(said) {
188
- const name = /reached your ([\w .-]{1,40}?) limit/i.exec(said ?? "")?.[1];
189
- return name && !/usage|weekly|daily|session|hour|month/i.test(name) ? name : null;
190
- }
191
- var LIMIT_HOLD_MS = 60 * 6e4;
192
- function handoverPrompt(prompt, from) {
193
- return `${prompt}
194
-
195
- ${from} started this work and stopped at its usage limit. Its changes, if any, are in this checkout. Read \`git status\` and \`git log\` first, and carry on from there.`;
196
- }
197
-
198
12
  // src/environment.ts
199
13
  import { homedir } from "os";
200
14
  import { join } from "path";
@@ -517,6 +331,197 @@ function whichAll(bin) {
517
331
  // src/drivers/t3.ts
518
332
  import { execFile, execFileSync as execFileSync3 } from "child_process";
519
333
  import { randomUUID } from "crypto";
334
+
335
+ // src/run-result.ts
336
+ var RESULT_INSTRUCTION = [
337
+ "When you finish, end your final message with a fenced block tagged cloop-result containing JSON, for example:",
338
+ "```cloop-result",
339
+ '{"summary": "One or two sentences on what you did.", "outputs": [{"kind": "pr", "title": "fix: the thing", "url": "https://github.com/org/repo/pull/1"}], "checks": [{"name": "Tests", "outcome": "passed"}]}',
340
+ "```",
341
+ "An output kind is one of: pr or link (title, url), draft (title, body, optional to, optional url), doc (title, optional url or body), file (title, path). A check outcome is passed, failed or skipped.",
342
+ "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.",
343
+ "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."
344
+ ].join("\n");
345
+ var text = (v, max) => typeof v === "string" && v.length <= max;
346
+ var optionalText = (v, max) => v === void 0 || text(v, max);
347
+ var https = (v) => {
348
+ try {
349
+ return typeof v === "string" && new URL(v).protocol === "https:";
350
+ } catch {
351
+ return false;
352
+ }
353
+ };
354
+ var PR_URL = /https:\/\/github\.com\/[\w.-]+\/[\w.-]+\/pull\/\d+/g;
355
+ var prNumber = (url) => Number(url.slice(url.lastIndexOf("/") + 1));
356
+ function prUrlIn(text2) {
357
+ const urls = text2?.match(PR_URL) ?? [];
358
+ return urls.reduce(
359
+ (newest, url) => newest && prNumber(newest) >= prNumber(url) ? newest : url,
360
+ null
361
+ );
362
+ }
363
+ function resultPrUrl(finalMessage) {
364
+ const result = parseRunResult(finalMessage);
365
+ if (!result) return prUrlIn(finalMessage);
366
+ const prs = result.outputs.flatMap((o) => o.kind === "pr" ? [o.url] : []);
367
+ return prs.at(-1) ?? null;
368
+ }
369
+ var SUMMARY_MAX = 4e3;
370
+ var DOC_BODY_MAX = 8e3;
371
+ function addressOutput(url) {
372
+ const pr = url.match(/\/pull\/(\d+)$/);
373
+ if (pr && prUrlIn(url) === url) return { kind: "pr", title: `Pull request #${pr[1]}`, url };
374
+ const { host, pathname } = new URL(url);
375
+ return { kind: "link", title: `${host}${pathname === "/" ? "" : pathname}`.slice(0, 120), url };
376
+ }
377
+ function cleanOutput(o) {
378
+ if (typeof o === "string") return https(o.trim()) ? addressOutput(o.trim()) : null;
379
+ if (!o || typeof o !== "object") return null;
380
+ const out = o;
381
+ if (!text(out.title, 120)) return null;
382
+ const title = out.title;
383
+ switch (out.kind) {
384
+ case "pr":
385
+ case "link":
386
+ return https(out.url) ? { kind: out.kind, title, url: out.url } : null;
387
+ case "draft":
388
+ return text(out.body, 4e3) && optionalText(out.to, 200) && (out.url === void 0 || https(out.url)) ? {
389
+ kind: "draft",
390
+ title,
391
+ body: out.body,
392
+ ...out.to !== void 0 ? { to: out.to } : {},
393
+ ...out.url !== void 0 ? { url: out.url } : {}
394
+ } : null;
395
+ case "doc": {
396
+ const body = typeof out.body === "string" && out.body.length > DOC_BODY_MAX ? `${out.body.slice(0, DOC_BODY_MAX - 1)}\u2026` : out.body;
397
+ return optionalText(body, DOC_BODY_MAX) && (out.url === void 0 || https(out.url)) ? {
398
+ kind: "doc",
399
+ title,
400
+ ...out.url !== void 0 ? { url: out.url } : {},
401
+ ...body !== void 0 ? { body } : {}
402
+ } : null;
403
+ }
404
+ case "file":
405
+ return text(out.path, 400) ? { kind: "file", title, path: out.path } : null;
406
+ default:
407
+ return null;
408
+ }
409
+ }
410
+ function cleanCheck(c) {
411
+ if (!c || typeof c !== "object") return null;
412
+ const check = c;
413
+ if (!text(check.name, 80) || !["passed", "failed", "skipped"].includes(check.outcome))
414
+ return null;
415
+ if (!optionalText(check.detail, 200)) return null;
416
+ return {
417
+ name: check.name,
418
+ outcome: check.outcome,
419
+ ...check.detail !== void 0 ? { detail: check.detail } : {}
420
+ };
421
+ }
422
+ function readRunResult(message) {
423
+ const none = { dropped: { outputs: 0, checks: 0 } };
424
+ const block = [...(message ?? "").matchAll(/```cloop-result\s*\n([\s\S]*?)```/g)].at(-1)?.[1];
425
+ if (!block) return none;
426
+ try {
427
+ const value = JSON.parse(block);
428
+ const summary = typeof value?.summary === "string" ? value.summary.trim() : "";
429
+ if (!summary) return none;
430
+ const list = (v) => Array.isArray(v) ? v : [];
431
+ const outputs = list(value.outputs).flatMap((o) => cleanOutput(o) ?? []);
432
+ const checks = list(value.checks).flatMap((c) => cleanCheck(c) ?? []);
433
+ return {
434
+ result: {
435
+ summary: summary.length > SUMMARY_MAX ? `${summary.slice(0, SUMMARY_MAX - 1)}\u2026` : summary,
436
+ outputs: outputs.slice(0, 10),
437
+ checks: checks.slice(0, 10),
438
+ ...value.nothing_new === true ? { nothing_new: true } : {}
439
+ },
440
+ dropped: {
441
+ outputs: list(value.outputs).length - outputs.length,
442
+ checks: list(value.checks).length - checks.length
443
+ }
444
+ };
445
+ } catch {
446
+ return none;
447
+ }
448
+ }
449
+ function parseRunResult(message) {
450
+ return readRunResult(message).result;
451
+ }
452
+ function droppedLine(dropped, run2) {
453
+ return dropped.outputs || dropped.checks ? `result_items_dropped run=${run2} outputs=${dropped.outputs} checks=${dropped.checks}` : null;
454
+ }
455
+
456
+ // src/drivers/driver.ts
457
+ var RUNTIME_MODES = /* @__PURE__ */ new Set([
458
+ "approval-required",
459
+ "auto-accept-edits",
460
+ "auto",
461
+ "full-access"
462
+ ]);
463
+ var BoxToolError = class extends Error {
464
+ constructor(code) {
465
+ super(code);
466
+ this.code = code;
467
+ this.name = "BoxToolError";
468
+ }
469
+ code;
470
+ };
471
+ var CLOOP_THREAD_PREFIX = "cloop:";
472
+ function questionLine(questions) {
473
+ return questions.map(
474
+ (x) => x.options?.length ? `${x.question} (${x.options.map((o) => o.label).join(", ")})` : x.question
475
+ ).join(" ").slice(0, 500);
476
+ }
477
+ function isProgressSentence(value) {
478
+ return typeof value === "string" && /\S[ \t]+\S/.test(value.trim().split(/\r?\n/)[0] ?? "");
479
+ }
480
+ var PROGRESS_MS = 3e4;
481
+ var RUN_TEXT_MAX = 4e3;
482
+ function nextProgress(clock, text2, now, ms = PROGRESS_MS, force = false) {
483
+ const summary = (parseRunResult(text2)?.summary ?? text2.split("```cloop-result")[0] ?? "").replace(/\s+/g, " ").trim().slice(0, RUN_TEXT_MAX);
484
+ if (!isProgressSentence(summary)) return null;
485
+ if (!force && now - clock.lastProgressAt < ms) return null;
486
+ clock.lastProgressAt = now;
487
+ return summary;
488
+ }
489
+ var YES_WORDS = /* @__PURE__ */ new Set([
490
+ "y",
491
+ "yes",
492
+ "yep",
493
+ "yeah",
494
+ "allow",
495
+ "allow it",
496
+ "ok",
497
+ "okay",
498
+ "approve",
499
+ "approved",
500
+ "go ahead",
501
+ "sure",
502
+ "do it"
503
+ ]);
504
+ function isYes(reply) {
505
+ return YES_WORDS.has(
506
+ reply.trim().toLowerCase().replace(/[.!\s]+$/, "")
507
+ );
508
+ }
509
+ var HARNESS_LIMIT = /usage limit|reached your [\w .-]{0,40}limit|hit your [\w .-]{0,40}limit|out of (usage )?credits/i;
510
+ function limitedModel(said) {
511
+ const name = /reached your ([\w .-]{1,40}?) limit/i.exec(said ?? "")?.[1];
512
+ return name && !/usage|weekly|daily|session|hour|month/i.test(name) ? name : null;
513
+ }
514
+ function refusedModel(said) {
515
+ return /The '([^']+)' model is not supported/i.exec(said ?? "")?.[1] ?? null;
516
+ }
517
+ var LIMIT_HOLD_MS = 60 * 6e4;
518
+ function handoverPrompt(prompt, from) {
519
+ return `${prompt}
520
+
521
+ ${from} started this work and stopped at its usage limit. Its changes, if any, are in this checkout. Read \`git status\` and \`git log\` first, and carry on from there.`;
522
+ }
523
+
524
+ // src/drivers/t3.ts
520
525
  function isUnsettled(t) {
521
526
  return !t.settledAt && !t.archivedAt && !isChild(t);
522
527
  }
@@ -1424,6 +1429,8 @@ var SHARED_BRANCHES = /* @__PURE__ */ new Set(["staging", "main", "master", "HEA
1424
1429
  var COMMANDS_KEPT = 50;
1425
1430
  var SUMMARY_MAX2 = 200;
1426
1431
  var HARNESS_NAMES = { "claude-code": "Claude Code", codex: "Codex" };
1432
+ var harnessName = (name) => HARNESS_NAMES[name] ?? name;
1433
+ var movedLine = (from, to) => `${harnessName(from)} was at its usage limit, so ${harnessName(to)} did this run.`;
1427
1434
  function failedEnd(harness, run2) {
1428
1435
  const said = run2.result?.text?.trim() || run2.lastText;
1429
1436
  const limited = HARNESS_LIMIT.test(run2.result?.text ?? "");
@@ -1972,6 +1979,7 @@ ${RESULT_INSTRUCTION}`));
1972
1979
  exit,
1973
1980
  ...r.switched ? { switched: r.switched } : {}
1974
1981
  });
1982
+ if (await this.otherModel(r, live.result?.text)) return;
1975
1983
  if (end.error) this.log(`limit work=${r.work_id} error=${end.error}`);
1976
1984
  if (end.error === "harness_limit") {
1977
1985
  if (this.fallBack(r, live.result?.text)) return;
@@ -2007,6 +2015,45 @@ ${RESULT_INSTRUCTION}`));
2007
2015
  this.spawnRun(r, CONTINUE_PROMPT, true);
2008
2016
  return true;
2009
2017
  }
2018
+ /**
2019
+ * A model the account cannot use refuses the run before it does any work,
2020
+ * as ChatGPT Free does for a model `config.toml` pins. The run starts again
2021
+ * on the next model the account lists, best first, until one takes it or
2022
+ * the list runs out. It does not when the Task named its model.
2023
+ */
2024
+ async otherModel(r, said) {
2025
+ const refused = refusedModel(said);
2026
+ const dialect = this.dialectOf(r);
2027
+ if (!refused || !dialect.models || !r.prompt || r.model && !r.refused) return false;
2028
+ const tried = [...r.refused ?? [], refused];
2029
+ this.recovering.add(r.work_id);
2030
+ let listed;
2031
+ try {
2032
+ listed = await dialect.models().catch(() => []);
2033
+ } finally {
2034
+ this.recovering.delete(r.work_id);
2035
+ }
2036
+ const next = listed.find((m) => !tried.includes(m));
2037
+ if (!next)
2038
+ this.log(`model work=${r.work_id} refused=${refused} next=none catalog=${listed.length}`);
2039
+ if (!next || this.stopping || r.end) return false;
2040
+ const moved = r.harness ? movedLine(this.deps.dialect.name, r.harness) : null;
2041
+ r.refused = tried;
2042
+ r.model = next;
2043
+ r.session_id = null;
2044
+ r.switched = [
2045
+ moved,
2046
+ `${harnessName(dialect.name)} cannot use ${tried[0]} on this account, so this ran on ${next}.`
2047
+ ].filter(Boolean).join(" ");
2048
+ this.save();
2049
+ this.log(`model work=${r.work_id} refused=${refused} next=${next}`);
2050
+ this.spawnRun(
2051
+ r,
2052
+ r.harness ? handoverPrompt(r.prompt, harnessName(this.deps.dialect.name)) : r.prompt,
2053
+ false
2054
+ );
2055
+ return true;
2056
+ }
2010
2057
  /**
2011
2058
  * Once per run: a run its own harness cannot carry on starts again on the
2012
2059
  * fallback harness, in the same checkout, so the edits so far carry over.
@@ -2028,12 +2075,12 @@ ${RESULT_INSTRUCTION}`));
2028
2075
  } finally {
2029
2076
  this.recovering.delete(r.work_id);
2030
2077
  }
2031
- const from = HARNESS_NAMES[this.deps.dialect.name] ?? this.deps.dialect.name;
2032
- const name = HARNESS_NAMES[to.name] ?? to.name;
2078
+ const from = harnessName(this.deps.dialect.name);
2079
+ const name = harnessName(to.name);
2033
2080
  r.harness = to.name;
2034
2081
  r.session_id = null;
2035
2082
  r.model = void 0;
2036
- r.switched = `${from} was at its usage limit, so ${name} did this run.`;
2083
+ r.switched = movedLine(this.deps.dialect.name, to.name);
2037
2084
  this.save();
2038
2085
  this.log(`fallback work=${r.work_id} harness=${to.name}`);
2039
2086
  this.emit(r.work_id, {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  RUN_TEXT_MAX,
4
4
  runnerPath
5
- } from "./chunk-GNNGDCKP.js";
5
+ } from "./chunk-B2ZI2UWS.js";
6
6
 
7
7
  // src/box-watch.ts
8
8
  import { randomUUID } from "crypto";
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-ES5BRAKJ.js";
6
6
  import {
7
7
  VERSION
8
- } from "./chunk-6IQ3ABBS.js";
8
+ } from "./chunk-6OF7Y676.js";
9
9
  import {
10
10
  getOrigin,
11
11
  readCredentials,
@@ -37,6 +37,8 @@ function newAttempt(now = Date.now()) {
37
37
  driver: null,
38
38
  fellBack: false,
39
39
  workFolder: false,
40
+ codexInstall: null,
41
+ claudeInstall: null,
40
42
  deviceToken: null
41
43
  };
42
44
  }
@@ -55,6 +57,8 @@ function connectReport(attempt, error, machine, now = Date.now()) {
55
57
  driver: attempt.driver,
56
58
  fell_back: attempt.fellBack,
57
59
  work_folder: attempt.workFolder,
60
+ codex_install: attempt.codexInstall,
61
+ claude_install: attempt.claudeInstall,
58
62
  step: attempt.step,
59
63
  outcome: error ? "failed" : "ok",
60
64
  error_code: error,
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  ConnectFailure,
4
4
  deviceLogin
5
- } from "./chunk-7SELZL6Z.js";
5
+ } from "./chunk-EPMOUT5Y.js";
6
6
  import {
7
7
  ApiError,
8
8
  ReauthError,
@@ -8,7 +8,7 @@ import {
8
8
  readRunnerConfig,
9
9
  runLogDir,
10
10
  runLogPath
11
- } from "./chunk-GNNGDCKP.js";
11
+ } from "./chunk-B2ZI2UWS.js";
12
12
  import {
13
13
  sanitizeLabel,
14
14
  stripControl
@@ -3,6 +3,7 @@
3
3
  // src/floors.ts
4
4
  var NODE_FLOOR = 20;
5
5
  var CLAUDE_FLOOR = "2.1.281";
6
+ var CODEX_FLOOR = "0.160.1";
6
7
  function olderThan(version, floor) {
7
8
  const parts = (v) => v.replace(/^v/, "").split(/[.+-]/).slice(0, 3).map(Number);
8
9
  const have = parts(version);
@@ -22,10 +23,15 @@ function nodeTooOld(version = process.versions.node) {
22
23
  function claudeTooOld(version) {
23
24
  return `Claude Code ${version} is older than ${CLAUDE_FLOOR}, the version Cloop runs on.`;
24
25
  }
26
+ function codexTooOld(version) {
27
+ return `Codex ${version} is older than ${CODEX_FLOOR}, the version Cloop runs on.`;
28
+ }
25
29
 
26
30
  export {
27
31
  CLAUDE_FLOOR,
32
+ CODEX_FLOOR,
28
33
  olderThan,
29
34
  nodeTooOld,
30
- claudeTooOld
35
+ claudeTooOld,
36
+ codexTooOld
31
37
  };
@@ -29,6 +29,7 @@ import {
29
29
  pairPrompt,
30
30
  pairT3,
31
31
  parsePicks,
32
+ prepareAgents,
32
33
  programFor,
33
34
  registerTaskScript,
34
35
  rememberedDriver,
@@ -49,17 +50,17 @@ import {
49
50
  which,
50
51
  workFolder,
51
52
  workFolderLine
52
- } from "./chunk-JUQALHVZ.js";
53
- import "./chunk-WRSJZ5WD.js";
54
- import "./chunk-GNNGDCKP.js";
53
+ } from "./chunk-5CE6AYV3.js";
54
+ import "./chunk-BGXIAFPO.js";
55
+ import "./chunk-B2ZI2UWS.js";
55
56
  import "./chunk-NTXQLEMQ.js";
56
57
  import "./chunk-VK6GV757.js";
57
- import "./chunk-UBXT5IDU.js";
58
+ import "./chunk-YEO27QQP.js";
58
59
  import "./chunk-R3CLO2FB.js";
59
- import "./chunk-UZYPDPGL.js";
60
- import "./chunk-7SELZL6Z.js";
60
+ import "./chunk-I726UEFM.js";
61
+ import "./chunk-EPMOUT5Y.js";
61
62
  import "./chunk-ES5BRAKJ.js";
62
- import "./chunk-6IQ3ABBS.js";
63
+ import "./chunk-6OF7Y676.js";
63
64
  import "./chunk-D5UZW42X.js";
64
65
  export {
65
66
  DEFAULT_T3_URL,
@@ -91,6 +92,7 @@ export {
91
92
  pairPrompt,
92
93
  pairT3,
93
94
  parsePicks,
95
+ prepareAgents,
94
96
  programFor,
95
97
  registerTaskScript,
96
98
  rememberedDriver,
@@ -7,17 +7,17 @@ import {
7
7
  runnerOrigin,
8
8
  stopService,
9
9
  unitOrigin
10
- } from "./chunk-JUQALHVZ.js";
11
- import "./chunk-WRSJZ5WD.js";
12
- import "./chunk-GNNGDCKP.js";
10
+ } from "./chunk-5CE6AYV3.js";
11
+ import "./chunk-BGXIAFPO.js";
12
+ import "./chunk-B2ZI2UWS.js";
13
13
  import "./chunk-NTXQLEMQ.js";
14
14
  import "./chunk-VK6GV757.js";
15
- import "./chunk-UBXT5IDU.js";
15
+ import "./chunk-YEO27QQP.js";
16
16
  import "./chunk-R3CLO2FB.js";
17
- import "./chunk-UZYPDPGL.js";
18
- import "./chunk-7SELZL6Z.js";
17
+ import "./chunk-I726UEFM.js";
18
+ import "./chunk-EPMOUT5Y.js";
19
19
  import "./chunk-ES5BRAKJ.js";
20
- import "./chunk-6IQ3ABBS.js";
20
+ import "./chunk-6OF7Y676.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-JUQALHVZ.js";
6
- import "./chunk-WRSJZ5WD.js";
7
- import "./chunk-GNNGDCKP.js";
5
+ } from "./chunk-5CE6AYV3.js";
6
+ import "./chunk-BGXIAFPO.js";
7
+ import "./chunk-B2ZI2UWS.js";
8
8
  import "./chunk-NTXQLEMQ.js";
9
9
  import "./chunk-VK6GV757.js";
10
- import "./chunk-UBXT5IDU.js";
10
+ import "./chunk-YEO27QQP.js";
11
11
  import "./chunk-R3CLO2FB.js";
12
- import "./chunk-UZYPDPGL.js";
13
- import "./chunk-7SELZL6Z.js";
12
+ import "./chunk-I726UEFM.js";
13
+ import "./chunk-EPMOUT5Y.js";
14
14
  import "./chunk-ES5BRAKJ.js";
15
- import "./chunk-6IQ3ABBS.js";
15
+ import "./chunk-6OF7Y676.js";
16
16
  import "./chunk-D5UZW42X.js";
17
17
  export {
18
18
  existingRunnerEnvironment,