@cloop/runner 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{box-ZUDKJY2F.js → box-Q5AA4S2T.js} +62 -22
- package/dist/{chunk-ZDUKQWKA.js → chunk-2SZUL2B6.js} +1 -1
- package/dist/{chunk-KHYA7GEH.js → chunk-52VJGOLJ.js} +1 -1
- package/dist/{chunk-5J4I7DAE.js → chunk-E3V2PRVS.js} +39 -11
- package/dist/{chunk-PBOQMFNN.js → chunk-GTE4QSTR.js} +1 -1
- package/dist/{chunk-M6U2YVEB.js → chunk-H7ZCXBNW.js} +86 -5
- package/dist/chunk-MWWA2VH7.js +224 -0
- package/dist/{chunk-VEVDJ3H3.js → chunk-SXV4JF5H.js} +258 -294
- package/dist/{runs-ZTLNHRRJ.js → chunk-UEV7ARIT.js} +17 -11
- package/dist/chunk-V4IYJUCC.js +250 -0
- package/dist/{connect-WXL6JWJN.js → connect-FG5VDH5N.js} +26 -5
- package/dist/{disconnect-ZAVMFITZ.js → disconnect-ZV32O475.js} +10 -8
- package/dist/index.js +31 -13
- package/dist/{login-MXIM6VMA.js → login-ZKPZEFCV.js} +2 -2
- package/dist/{mcp-server-ADCSP4SY.js → mcp-server-TINABFRL.js} +1 -1
- package/dist/{runner-OVRZFJIY.js → runner-VY3HK7L4.js} +3 -3
- package/dist/runs-QLO2XZVZ.js +25 -0
- package/dist/{statusline-ESZZVOBJ.js → statusline-BWUUERD5.js} +1 -1
- package/dist/takeover-TKQ5V4KV.js +31 -0
- package/dist/use-ALFEOPLY.js +51 -0
- package/package.json +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
DRIVER_NAME,
|
|
4
|
+
runConnect
|
|
5
|
+
} from "./chunk-SXV4JF5H.js";
|
|
6
|
+
import "./chunk-MWWA2VH7.js";
|
|
7
|
+
import {
|
|
8
|
+
isLocal,
|
|
9
|
+
readRunnerConfig
|
|
10
|
+
} from "./chunk-H7ZCXBNW.js";
|
|
11
|
+
import "./chunk-JX6VG5FE.js";
|
|
12
|
+
import "./chunk-R3CLO2FB.js";
|
|
13
|
+
import "./chunk-52VJGOLJ.js";
|
|
14
|
+
import "./chunk-2SZUL2B6.js";
|
|
15
|
+
import "./chunk-AG6SI6I2.js";
|
|
16
|
+
import "./chunk-GTE4QSTR.js";
|
|
17
|
+
import "./chunk-3DIGCVL4.js";
|
|
18
|
+
|
|
19
|
+
// src/commands/use.ts
|
|
20
|
+
var DRIVERS = ["t3", "claude-code", "codex"];
|
|
21
|
+
function machineNoun(platform) {
|
|
22
|
+
return platform === "darwin" ? "This Mac" : "This machine";
|
|
23
|
+
}
|
|
24
|
+
function useArgs(driver, rest) {
|
|
25
|
+
const previous = readRunnerConfig();
|
|
26
|
+
const repos = driver !== "t3" && !rest.includes("--repo") && previous && isLocal(previous) ? previous.repos.flatMap((r) => ["--repo", r.path]) : [];
|
|
27
|
+
return ["--driver", driver, ...repos, ...rest];
|
|
28
|
+
}
|
|
29
|
+
async function useCommand(argv, deps = {}) {
|
|
30
|
+
const out = deps.out ?? ((line) => console.log(line));
|
|
31
|
+
const log = deps.log ?? ((line) => console.error(line));
|
|
32
|
+
const driver = argv[0];
|
|
33
|
+
if (!driver || !DRIVERS.includes(driver)) {
|
|
34
|
+
out("Usage: cloop use t3|claude-code|codex");
|
|
35
|
+
return 1;
|
|
36
|
+
}
|
|
37
|
+
const before = readRunnerConfig();
|
|
38
|
+
const from = before ? before.driver ?? "t3" : "none";
|
|
39
|
+
const error = await (deps.connect ?? runConnect)(useArgs(driver, argv.slice(1)), deps);
|
|
40
|
+
log(`[runner:use] from=${from} to=${driver} outcome=${error ? `failed error=${error}` : "ok"}`);
|
|
41
|
+
if (error) return 1;
|
|
42
|
+
out(
|
|
43
|
+
`${machineNoun(deps.platform ?? process.platform)} now runs Cloop work in ${DRIVER_NAME[driver]}.`
|
|
44
|
+
);
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
machineNoun,
|
|
49
|
+
useArgs,
|
|
50
|
+
useCommand
|
|
51
|
+
};
|
package/package.json
CHANGED