@cloop/runner 0.3.41 → 0.3.42
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-G664ZM6O.js → box-XOSIY7JI.js} +9 -9
- package/dist/{chunk-NPTLMG3V.js → chunk-3N4X2TK2.js} +1 -1
- package/dist/{chunk-ILLDES3M.js → chunk-7B53CL3W.js} +1 -1
- package/dist/{chunk-KDTPUD2Y.js → chunk-CVVYCLZ6.js} +1 -0
- package/dist/{chunk-3XQ44U27.js → chunk-JW5GATBV.js} +8 -6
- package/dist/{chunk-SDVTQCW7.js → chunk-NP5VVHLS.js} +96 -29
- package/dist/{chunk-LGKSLIU2.js → chunk-OXFFDL26.js} +1 -1
- package/dist/{chunk-WIAWWXGP.js → chunk-PN5CQQVG.js} +1 -1
- package/dist/{chunk-4MMTNAPM.js → chunk-QOYGTYFE.js} +1 -1
- package/dist/{chunk-LMW4JHRH.js → chunk-TSUDGSA2.js} +3 -3
- package/dist/{connect-SFAOSHIO.js → connect-KKFAIJHV.js} +7 -7
- package/dist/{disconnect-ERRRZY25.js → disconnect-OPKIFMX7.js} +7 -7
- package/dist/{existing-runner-HI4DFKSW.js → existing-runner-UAE25B5U.js} +7 -7
- package/dist/index.js +14 -14
- package/dist/{login-UURPRX5F.js → login-WOGARHMU.js} +2 -2
- package/dist/{mcp-server-MTDAMQ7C.js → mcp-server-L3OA2STT.js} +2 -2
- package/dist/{runner-GMHC5FE7.js → runner-ZX2BKPD3.js} +3 -3
- package/dist/{runs-XR4MYK4X.js → runs-HAZFMJMF.js} +2 -2
- package/dist/{statusline-BV2IXFDB.js → statusline-GI5O33B7.js} +1 -1
- package/dist/{takeover-H5YOSKV5.js → takeover-3XXBFT26.js} +4 -4
- package/dist/{use-6OHXWE5L.js → use-QO6CKD74.js} +7 -7
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
serveTakeovers
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-TSUDGSA2.js";
|
|
5
|
+
import "./chunk-3N4X2TK2.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-JW5GATBV.js";
|
|
42
42
|
import {
|
|
43
43
|
MeshSocket,
|
|
44
44
|
WAKE_TICK_MS,
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
defaultSocketFactory,
|
|
47
47
|
runnerLog,
|
|
48
48
|
wakeWatch
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-CVVYCLZ6.js";
|
|
50
50
|
import {
|
|
51
51
|
BoxWatch,
|
|
52
52
|
hostedThreadsFilePath,
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
runnerStatePath,
|
|
57
57
|
threadsFilePath,
|
|
58
58
|
writeRunnerState
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-PN5CQQVG.js";
|
|
60
60
|
import {
|
|
61
61
|
BackgroundReading,
|
|
62
62
|
BoxToolError,
|
|
@@ -101,20 +101,20 @@ import {
|
|
|
101
101
|
utcWindow,
|
|
102
102
|
windowsPowerShellEnv,
|
|
103
103
|
writeBoxConfig
|
|
104
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-NP5VVHLS.js";
|
|
105
105
|
import "./chunk-VK6GV757.js";
|
|
106
106
|
import {
|
|
107
107
|
olderThan
|
|
108
108
|
} from "./chunk-365HFCQQ.js";
|
|
109
109
|
import "./chunk-PKIEWBR7.js";
|
|
110
|
-
import "./chunk-
|
|
111
|
-
import "./chunk-
|
|
110
|
+
import "./chunk-OXFFDL26.js";
|
|
111
|
+
import "./chunk-QOYGTYFE.js";
|
|
112
112
|
import {
|
|
113
113
|
getMachine
|
|
114
114
|
} from "./chunk-SBYSVZ7J.js";
|
|
115
115
|
import {
|
|
116
116
|
VERSION
|
|
117
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-7B53CL3W.js";
|
|
118
118
|
import {
|
|
119
119
|
getMeshUrl,
|
|
120
120
|
getOrigin,
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
freshness,
|
|
5
5
|
outcomeLine,
|
|
6
6
|
runnerLog
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CVVYCLZ6.js";
|
|
8
8
|
import {
|
|
9
9
|
readRunnerState,
|
|
10
10
|
runnerStatePath,
|
|
11
11
|
threadsFilePath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PN5CQQVG.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-NP5VVHLS.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-OXFFDL26.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-QOYGTYFE.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-7B53CL3W.js";
|
|
81
81
|
import {
|
|
82
82
|
STAGING_ORIGIN,
|
|
83
83
|
getOrigin,
|
|
@@ -344,6 +344,8 @@ var BOX_TOOLS = {
|
|
|
344
344
|
return result;
|
|
345
345
|
},
|
|
346
346
|
"thread.interrupt": ({ driver }, args) => driver.interrupt(parseThreadId(args), parseCommandId(args)),
|
|
347
|
+
// The app calls it once a run is Done with nothing to review. A driver with no thread list says so.
|
|
348
|
+
"thread.settle": async ({ driver }, args) => driver.settle ? driver.settle(parseThreadId(args), parseCommandId(args)) : { settled: false, refused: "unsupported" },
|
|
347
349
|
// Codes, ids, versions and counts only (runner-log.ts), so ops can read it without the owner.
|
|
348
350
|
diag: async ({ diag }) => diag ? diag() : null,
|
|
349
351
|
// Packs the skills before it answers, so an empty or oversized set is refused now; the upload runs on.
|
|
@@ -820,7 +820,7 @@ var RESULT_INSTRUCTION = [
|
|
|
820
820
|
"```cloop-result",
|
|
821
821
|
'{"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"}]}',
|
|
822
822
|
"```",
|
|
823
|
-
"An output kind is one of: pr or link (title, url), draft (title, body, optional to, optional url), doc (title, optional url or body),
|
|
823
|
+
"An output kind is one of: pr or link (title, url), draft (title, body, optional to, optional url), doc (title, optional url or body), wizard (title, steps). A check outcome is passed, failed or skipped.",
|
|
824
824
|
"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.",
|
|
825
825
|
`A wizard is for ${WIZARD_FOR}. When the work needs such a step, return a wizard for it, not only words. A wizard has 1 to ${WIZARD_STEPS_MAX} steps in order, each {"title", "body" in Markdown, optional https "url"}. Never ask the user to paste a password, key or other secret anywhere. The user sees a wizard as a walkthrough: in your own words, call it a walkthrough, never a wizard.`,
|
|
826
826
|
"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.",
|
|
@@ -884,8 +884,6 @@ function readOutput(o) {
|
|
|
884
884
|
...body !== void 0 ? { body } : {}
|
|
885
885
|
};
|
|
886
886
|
}
|
|
887
|
-
case "file":
|
|
888
|
-
return text(out.path, 400) ? { kind: "file", title, path: out.path } : null;
|
|
889
887
|
case "image":
|
|
890
888
|
if (!text(out.path, 400)) return null;
|
|
891
889
|
return {
|
|
@@ -1568,13 +1566,14 @@ function providerName(instanceId, cfg) {
|
|
|
1568
1566
|
if (displayName) return displayName;
|
|
1569
1567
|
return instanceId && PROVIDER_NAMES[instanceId] || instanceId || "The harness";
|
|
1570
1568
|
}
|
|
1571
|
-
function readyProvider(cfg, driver) {
|
|
1569
|
+
function readyProvider(cfg, driver, skip = () => false) {
|
|
1572
1570
|
const candidates = [...cfg.providers].sort(
|
|
1573
1571
|
(a, b) => Number(b.instanceId === driver) - Number(a.instanceId === driver)
|
|
1574
1572
|
);
|
|
1575
1573
|
for (const p of candidates) {
|
|
1576
1574
|
if ((p.driver ?? p.instanceId) !== driver || !p.enabled || !p.installed) continue;
|
|
1577
1575
|
if (p.auth && p.auth.status !== "authenticated") continue;
|
|
1576
|
+
if (skip(p)) continue;
|
|
1578
1577
|
const model = p.models?.find((m) => m.isDefault)?.slug ?? p.models?.[0]?.slug;
|
|
1579
1578
|
if (model) return { instanceId: p.instanceId, model };
|
|
1580
1579
|
}
|
|
@@ -1596,9 +1595,43 @@ function signedOutWords(p, run2) {
|
|
|
1596
1595
|
const signedOut = failure.code === "unauthorized" || /^Claude could not authenticate\b/.test(message) || HARNESS_SIGNED_OUT.test(message);
|
|
1597
1596
|
return signedOut ? words ?? (message || null) : null;
|
|
1598
1597
|
}
|
|
1599
|
-
function
|
|
1600
|
-
const
|
|
1601
|
-
if (
|
|
1598
|
+
function planSpentUntil(p, now) {
|
|
1599
|
+
const quota = quotaFromT3(p.usageLimits);
|
|
1600
|
+
if (quota.status !== "ok") return 0;
|
|
1601
|
+
let until = 0;
|
|
1602
|
+
for (const w of quota.windows) {
|
|
1603
|
+
const reset = w.resetsAt ? Date.parse(w.resetsAt) : Number.NaN;
|
|
1604
|
+
if (w.usedPercent >= 100 && !w.label.includes("\xB7") && reset > now)
|
|
1605
|
+
until = Math.max(until, reset);
|
|
1606
|
+
}
|
|
1607
|
+
return until;
|
|
1608
|
+
}
|
|
1609
|
+
var PLAN_AUTH = /* @__PURE__ */ new Set(["CLAUDE_CODE_OAUTH_TOKEN"]);
|
|
1610
|
+
var BUILT_IN = /* @__PURE__ */ new Set([CLAUDE_PROVIDER, CODEX_PROVIDER]);
|
|
1611
|
+
function overridesAuth(cfg, instanceId) {
|
|
1612
|
+
const entry = cfg.settings?.providerInstances?.[instanceId];
|
|
1613
|
+
if (!entry) return !BUILT_IN.has(instanceId);
|
|
1614
|
+
const env = entry.environment ?? [];
|
|
1615
|
+
return env.some(
|
|
1616
|
+
(e) => !PLAN_AUTH.has(e.name) && /KEY|TOKEN|SECRET|BEDROCK|VERTEX|FOUNDRY|AZURE|BASE_URL|PROVIDER/i.test(e.name)
|
|
1617
|
+
);
|
|
1618
|
+
}
|
|
1619
|
+
function limitMove(cfg, from, a) {
|
|
1620
|
+
const p = cfg.providers.find((x) => x.instanceId === from);
|
|
1621
|
+
const own = p?.driver ?? p?.instanceId ?? from;
|
|
1622
|
+
const other = otherDriver(cfg, from);
|
|
1623
|
+
const skip = (x) => a.tried.has(x.instanceId) || a.spent(x) || overridesAuth(cfg, x.instanceId);
|
|
1624
|
+
for (const driver of [own, other]) {
|
|
1625
|
+
if (!driver || driver === CODEX_PROVIDER && a.permission !== "full") continue;
|
|
1626
|
+
const to = readyProvider(cfg, driver, skip);
|
|
1627
|
+
if (to) return to;
|
|
1628
|
+
}
|
|
1629
|
+
return null;
|
|
1630
|
+
}
|
|
1631
|
+
function launchMove(cfg, own, permission, spent) {
|
|
1632
|
+
const ownProvider = cfg.providers.find((p) => p.instanceId === own && p.enabled);
|
|
1633
|
+
const free = ownProvider && spent(ownProvider) ? limitMove(cfg, own, { tried: /* @__PURE__ */ new Set([own]), permission, spent }) : null;
|
|
1634
|
+
if (free) return { to: free, reason: "limit" };
|
|
1602
1635
|
const auth = cfg.providers.find((p) => p.instanceId === own && p.enabled)?.auth;
|
|
1603
1636
|
if (!auth || auth.status === "authenticated") return null;
|
|
1604
1637
|
const driver = otherDriver(cfg, own);
|
|
@@ -1707,8 +1740,8 @@ var T3Driver = class {
|
|
|
1707
1740
|
launched = /* @__PURE__ */ new Map();
|
|
1708
1741
|
/** The box's providers as last read, so a run's end names a custom provider by its driver. */
|
|
1709
1742
|
providers = [];
|
|
1710
|
-
/** Until
|
|
1711
|
-
limitedUntil =
|
|
1743
|
+
/** Until when each instance is held at its usage limit, by the runs that stopped there. */
|
|
1744
|
+
limitedUntil = /* @__PURE__ */ new Map();
|
|
1712
1745
|
get capabilities() {
|
|
1713
1746
|
return boxCapabilities(this.deps.scope?.());
|
|
1714
1747
|
}
|
|
@@ -1892,9 +1925,8 @@ var T3Driver = class {
|
|
|
1892
1925
|
throw new BoxToolError("runtime_mode_unknown");
|
|
1893
1926
|
const permission = permissionOf(runtimeMode);
|
|
1894
1927
|
const named = Boolean(a.harness || a.model);
|
|
1895
|
-
const held = !named && permission === "full" && this.now() < this.limitedUntil;
|
|
1896
1928
|
const own = cfg.settings?.defaultModelSelection?.instanceId ?? CLAUDE_PROVIDER;
|
|
1897
|
-
const move = named ? null : launchMove(cfg, own, permission,
|
|
1929
|
+
const move = named ? null : launchMove(cfg, own, permission, this.spent);
|
|
1898
1930
|
const fallback = move?.to ?? cfg.settings?.defaultModelSelection;
|
|
1899
1931
|
const harness = a.harness ?? fallback?.instanceId ?? "claudeAgent";
|
|
1900
1932
|
const provider = cfg.providers.find((p) => p.instanceId === harness && p.enabled);
|
|
@@ -1936,8 +1968,8 @@ var T3Driver = class {
|
|
|
1936
1968
|
this.launched.set(launched.threadId, {
|
|
1937
1969
|
named,
|
|
1938
1970
|
permission,
|
|
1971
|
+
tried: /* @__PURE__ */ new Set([modelSelection.instanceId, ...move ? [own] : []]),
|
|
1939
1972
|
...move ? {
|
|
1940
|
-
movedFrom: "",
|
|
1941
1973
|
switched: movedLine(
|
|
1942
1974
|
move.reason,
|
|
1943
1975
|
providerName(own, cfg),
|
|
@@ -2080,6 +2112,25 @@ var T3Driver = class {
|
|
|
2080
2112
|
}
|
|
2081
2113
|
return { ok: true, was_running: true };
|
|
2082
2114
|
}
|
|
2115
|
+
/**
|
|
2116
|
+
* T3's Settle, for a thread this runner started (`cloop:` title) whose
|
|
2117
|
+
* latest run completed and that waits on nothing. Routine runs left a
|
|
2118
|
+
* "cloop: ..." thread on the owner's list after every run (3 Nov 2026).
|
|
2119
|
+
* A thread a person started or adopted keeps its own title and stays.
|
|
2120
|
+
*/
|
|
2121
|
+
async settle(threadId, commandId) {
|
|
2122
|
+
const p = await this.readProjection(threadId);
|
|
2123
|
+
if (!(p.thread.title ?? "").startsWith(CLOOP_THREAD_PREFIX))
|
|
2124
|
+
return { settled: false, refused: "not_cloop" };
|
|
2125
|
+
if (p.thread.settledAt) return { settled: true, already: true };
|
|
2126
|
+
if (latestRun(p.runs ?? [])?.status !== "completed")
|
|
2127
|
+
return { settled: false, refused: "not_finished" };
|
|
2128
|
+
if ((p.runtimeRequests ?? []).some((r) => r.status === "pending"))
|
|
2129
|
+
return { settled: false, refused: "waiting" };
|
|
2130
|
+
await this.dispatch({ type: "thread.settle", commandId, threadId });
|
|
2131
|
+
this.log(`settled thread=${threadId}`);
|
|
2132
|
+
return { settled: true, already: false };
|
|
2133
|
+
}
|
|
2083
2134
|
async readThread(id) {
|
|
2084
2135
|
const projection = await this.readProjection(id);
|
|
2085
2136
|
const { status, settled, pr_url, last_assistant_text } = outcomeOf(projection);
|
|
@@ -2268,7 +2319,7 @@ var T3Driver = class {
|
|
|
2268
2319
|
const said = outcome.last_assistant_text?.replace(/\s+/g, " ").trim();
|
|
2269
2320
|
const limited = outcome.status === "failed" && HARNESS_LIMIT.test(said ?? "");
|
|
2270
2321
|
const signedOut = !limited && turn ? signedOutWords(p, turn) : null;
|
|
2271
|
-
const quoted = (words) => `${opening}${providerName(turn?.providerInstanceId)} said: "${words}"`.slice(
|
|
2322
|
+
const quoted = (words) => `${opening}${providerName(turn?.providerInstanceId, { providers: this.providers })} said: "${words}"`.slice(
|
|
2272
2323
|
0,
|
|
2273
2324
|
RUN_TEXT_MAX
|
|
2274
2325
|
);
|
|
@@ -2374,14 +2425,16 @@ var T3Driver = class {
|
|
|
2374
2425
|
};
|
|
2375
2426
|
}
|
|
2376
2427
|
/**
|
|
2377
|
-
*
|
|
2378
|
-
*
|
|
2379
|
-
*
|
|
2428
|
+
* A run that failed at a usage limit carries on in the same thread on the
|
|
2429
|
+
* next instance with usage (`limitMove`): another Claude subscription, then
|
|
2430
|
+
* Codex. A run whose harness could not sign in carries on with the other
|
|
2431
|
+
* harness, Claude Code or Codex, either way. Each thread moves to an
|
|
2432
|
+
* instance once at most, so the chain ends when every option is out. T3
|
|
2380
2433
|
* switches the thread's provider and hands it the thread so far; the
|
|
2381
|
-
* worktree, with any edits, stays. A limit that names no model holds
|
|
2382
|
-
*
|
|
2383
|
-
*
|
|
2384
|
-
*
|
|
2434
|
+
* worktree, with any edits, stays. A limit that names no model holds that
|
|
2435
|
+
* instance, so launches skip it for LIMIT_HOLD_MS; a sign-in failure holds
|
|
2436
|
+
* nothing. A thread whose Task named its harness or model stays, and so
|
|
2437
|
+
* does one without full access that would move to Codex, because Codex
|
|
2385
2438
|
* asks nothing. So does a thread this daemon did not launch: a restart
|
|
2386
2439
|
* forgets what the Task named. Returns the progress line of the move.
|
|
2387
2440
|
*/
|
|
@@ -2391,12 +2444,11 @@ var T3Driver = class {
|
|
|
2391
2444
|
const reason = HARNESS_LIMIT.test(said) ? "limit" : signedOutWords(p, turn) ? "signed_out" : null;
|
|
2392
2445
|
if (!reason) return null;
|
|
2393
2446
|
const from = turn.providerInstanceId;
|
|
2394
|
-
if (reason === "limit")
|
|
2395
|
-
|
|
2396
|
-
if (!limitedModel(said)) this.limitedUntil = this.now() + LIMIT_HOLD_MS;
|
|
2397
|
-
}
|
|
2447
|
+
if (reason === "limit" && from && !limitedModel(said))
|
|
2448
|
+
this.limitedUntil.set(from, this.now() + LIMIT_HOLD_MS);
|
|
2398
2449
|
const entry = this.launched.get(threadId);
|
|
2399
|
-
if (!entry || entry.named
|
|
2450
|
+
if (!entry || entry.named) return null;
|
|
2451
|
+
if (from) entry.tried.add(from);
|
|
2400
2452
|
try {
|
|
2401
2453
|
return await this.dispatchHandover(threadId, turn, entry, reason);
|
|
2402
2454
|
} catch (err) {
|
|
@@ -2409,13 +2461,16 @@ var T3Driver = class {
|
|
|
2409
2461
|
async dispatchHandover(threadId, turn, entry, reason) {
|
|
2410
2462
|
const cfg = await this.t3.rpc("server.getConfig", {});
|
|
2411
2463
|
this.providers = cfg.providers;
|
|
2412
|
-
const
|
|
2413
|
-
if (!driver || driver === CODEX_PROVIDER && entry.permission !== "full") return null;
|
|
2414
|
-
const to = readyProvider(cfg, driver);
|
|
2464
|
+
const from = turn.providerInstanceId ?? CLAUDE_PROVIDER;
|
|
2415
2465
|
const name = providerName(turn.providerInstanceId, cfg);
|
|
2466
|
+
const to = reason === "limit" ? limitMove(cfg, from, {
|
|
2467
|
+
tried: entry.tried,
|
|
2468
|
+
permission: entry.permission,
|
|
2469
|
+
spent: this.spent
|
|
2470
|
+
}) : this.signedOutMove(cfg, from, entry);
|
|
2416
2471
|
if (!to) {
|
|
2417
2472
|
this.log(
|
|
2418
|
-
`${reason} thread=${threadId}:
|
|
2473
|
+
`${reason} thread=${threadId}: no other instance on this box is on, signed in and free; the run fails`
|
|
2419
2474
|
);
|
|
2420
2475
|
return null;
|
|
2421
2476
|
}
|
|
@@ -2437,6 +2492,7 @@ ${MACHINE_RESULT_INSTRUCTION}`
|
|
|
2437
2492
|
creationSource: "mcp"
|
|
2438
2493
|
});
|
|
2439
2494
|
const toName = providerName(to.instanceId, cfg);
|
|
2495
|
+
entry.tried.add(to.instanceId);
|
|
2440
2496
|
entry.movedFrom = turn.id;
|
|
2441
2497
|
entry.switched = movedLine(reason, name, toName, "was");
|
|
2442
2498
|
this.log(
|
|
@@ -2447,6 +2503,17 @@ ${MACHINE_RESULT_INSTRUCTION}`
|
|
|
2447
2503
|
now() {
|
|
2448
2504
|
return this.deps.now?.() ?? Date.now();
|
|
2449
2505
|
}
|
|
2506
|
+
/** An instance at its usage limit now: a run stopped there within the hold, or T3 reads its plan as spent. */
|
|
2507
|
+
spent = (p) => {
|
|
2508
|
+
const now = this.now();
|
|
2509
|
+
return (this.limitedUntil.get(p.instanceId) ?? 0) > now || planSpentUntil(p, now) > now;
|
|
2510
|
+
};
|
|
2511
|
+
/** The other harness a signed-out run moves to, never one it already ran on. */
|
|
2512
|
+
signedOutMove(cfg, from, entry) {
|
|
2513
|
+
const driver = otherDriver(cfg, from);
|
|
2514
|
+
if (!driver || driver === CODEX_PROVIDER && entry.permission !== "full") return null;
|
|
2515
|
+
return readyProvider(cfg, driver, (p) => entry.tried.has(p.instanceId));
|
|
2516
|
+
}
|
|
2450
2517
|
readProjection(threadId) {
|
|
2451
2518
|
return this.t3.rpc("orchestration.getThreadProjection", { threadId });
|
|
2452
2519
|
}
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
findRun,
|
|
4
4
|
ownHarness
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3N4X2TK2.js";
|
|
6
6
|
import {
|
|
7
7
|
lockThreadsFile,
|
|
8
8
|
threadsFilePath
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PN5CQQVG.js";
|
|
10
10
|
import {
|
|
11
11
|
localRunsFilePath,
|
|
12
12
|
readRunRecords,
|
|
13
13
|
runHarness,
|
|
14
14
|
takeoverSummary
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NP5VVHLS.js";
|
|
16
16
|
import {
|
|
17
17
|
sanitizeLabel
|
|
18
18
|
} from "./chunk-VK6GV757.js";
|
|
@@ -53,17 +53,17 @@ import {
|
|
|
53
53
|
which,
|
|
54
54
|
workFolder,
|
|
55
55
|
workFolderLine
|
|
56
|
-
} from "./chunk-
|
|
57
|
-
import "./chunk-
|
|
58
|
-
import "./chunk-
|
|
59
|
-
import "./chunk-
|
|
56
|
+
} from "./chunk-JW5GATBV.js";
|
|
57
|
+
import "./chunk-CVVYCLZ6.js";
|
|
58
|
+
import "./chunk-PN5CQQVG.js";
|
|
59
|
+
import "./chunk-NP5VVHLS.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-OXFFDL26.js";
|
|
64
|
+
import "./chunk-QOYGTYFE.js";
|
|
65
65
|
import "./chunk-SBYSVZ7J.js";
|
|
66
|
-
import "./chunk-
|
|
66
|
+
import "./chunk-7B53CL3W.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-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-JW5GATBV.js";
|
|
11
|
+
import "./chunk-CVVYCLZ6.js";
|
|
12
|
+
import "./chunk-PN5CQQVG.js";
|
|
13
|
+
import "./chunk-NP5VVHLS.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-OXFFDL26.js";
|
|
18
|
+
import "./chunk-QOYGTYFE.js";
|
|
19
19
|
import "./chunk-SBYSVZ7J.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-7B53CL3W.js";
|
|
21
21
|
import "./chunk-D5UZW42X.js";
|
|
22
22
|
export {
|
|
23
23
|
disconnect,
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
existingRunnerEnvironment,
|
|
4
4
|
pinExistingRunner
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-JW5GATBV.js";
|
|
6
|
+
import "./chunk-CVVYCLZ6.js";
|
|
7
|
+
import "./chunk-PN5CQQVG.js";
|
|
8
|
+
import "./chunk-NP5VVHLS.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-OXFFDL26.js";
|
|
13
|
+
import "./chunk-QOYGTYFE.js";
|
|
14
14
|
import "./chunk-SBYSVZ7J.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-7B53CL3W.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-7B53CL3W.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-UAE25B5U.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-WOGARHMU.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-L3OA2STT.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-GI5O33B7.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-KKFAIJHV.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-QO6CKD74.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-OPKIFMX7.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-XOSIY7JI.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-HAZFMJMF.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-HAZFMJMF.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-3XXBFT26.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-HAZFMJMF.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-ZX2BKPD3.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-QOYGTYFE.js";
|
|
7
7
|
import "./chunk-SBYSVZ7J.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-7B53CL3W.js";
|
|
9
9
|
import "./chunk-D5UZW42X.js";
|
|
10
10
|
export {
|
|
11
11
|
deviceLogin,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
MeshSocket,
|
|
16
16
|
defaultSocketFactory
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-CVVYCLZ6.js";
|
|
18
18
|
import {
|
|
19
19
|
sanitizeLabel,
|
|
20
20
|
sanitizeUntrusted
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
} from "./chunk-SBYSVZ7J.js";
|
|
32
32
|
import {
|
|
33
33
|
VERSION
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-7B53CL3W.js";
|
|
35
35
|
import {
|
|
36
36
|
getMeshUrl,
|
|
37
37
|
getToken
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
connectWebhook,
|
|
4
4
|
runnerCommand
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-OXFFDL26.js";
|
|
6
|
+
import "./chunk-QOYGTYFE.js";
|
|
7
7
|
import "./chunk-SBYSVZ7J.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-7B53CL3W.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-3N4X2TK2.js";
|
|
13
|
+
import "./chunk-NP5VVHLS.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-TSUDGSA2.js";
|
|
13
|
+
import "./chunk-3N4X2TK2.js";
|
|
14
|
+
import "./chunk-PN5CQQVG.js";
|
|
15
|
+
import "./chunk-NP5VVHLS.js";
|
|
16
16
|
import "./chunk-VK6GV757.js";
|
|
17
17
|
import "./chunk-SBYSVZ7J.js";
|
|
18
18
|
import "./chunk-D5UZW42X.js";
|
|
@@ -3,20 +3,20 @@ import {
|
|
|
3
3
|
DRIVER_NAME,
|
|
4
4
|
pinExistingRunner,
|
|
5
5
|
runConnect
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-JW5GATBV.js";
|
|
7
|
+
import "./chunk-CVVYCLZ6.js";
|
|
8
|
+
import "./chunk-PN5CQQVG.js";
|
|
9
9
|
import {
|
|
10
10
|
isLocal,
|
|
11
11
|
readRunnerConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NP5VVHLS.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-OXFFDL26.js";
|
|
17
|
+
import "./chunk-QOYGTYFE.js";
|
|
18
18
|
import "./chunk-SBYSVZ7J.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-7B53CL3W.js";
|
|
20
20
|
import "./chunk-D5UZW42X.js";
|
|
21
21
|
|
|
22
22
|
// src/commands/use.ts
|
package/package.json
CHANGED