@cloop/runner 0.3.68 → 0.3.71
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-YFGM56QY.js → box-N5NOCXH3.js} +194 -522
- package/dist/{chunk-7LPSTDZE.js → chunk-4JTIWZHB.js} +1 -1
- package/dist/{chunk-TCNIRZLU.js → chunk-CLOYOD2X.js} +10 -6
- package/dist/{chunk-6LYMSWSB.js → chunk-DN6TQALA.js} +265 -1961
- package/dist/{chunk-HWNRORIZ.js → chunk-EE7PMIGC.js} +1 -1
- package/dist/chunk-EEG5JOZ7.js +939 -0
- package/dist/chunk-GAEZIKCK.js +626 -0
- package/dist/chunk-HIBAH65V.js +1178 -0
- package/dist/chunk-JDGGRIS3.js +43 -0
- package/dist/{chunk-7ZL3Z3IO.js → chunk-JI5FWLDU.js} +6 -6
- package/dist/chunk-JJWSPBM4.js +40 -0
- package/dist/{chunk-L7D3ANPW.js → chunk-KUGUMEYC.js} +4 -2
- package/dist/{chunk-BVPS6DCH.js → chunk-MUFILIJS.js} +574 -1673
- package/dist/chunk-PQURJJOD.js +459 -0
- package/dist/{chunk-34VZ5LZI.js → chunk-UX4D6FY7.js} +3 -83
- package/dist/chunk-VB4V65JR.js +85 -0
- package/dist/{connect-D2SXLADA.js → connect-5D5CIC4V.js} +11 -47
- package/dist/disconnect-CQXE6ZNH.js +163 -0
- package/dist/existing-runner-4QQYKV7I.js +15 -0
- package/dist/index.js +14 -14
- package/dist/{login-VNDFCJD4.js → login-KHJQD25C.js} +3 -2
- package/dist/{mcp-server-XPHCDBFR.js → mcp-server-4D476KMH.js} +10 -10
- package/dist/{runner-A3HFZ727.js → runner-6GIMXVD5.js} +4 -3
- package/dist/{runs-DOFU45TW.js → runs-TWUGWGNU.js} +4 -2
- package/dist/{statusline-VA2DSWVT.js → statusline-3TZ26LKY.js} +1 -1
- package/dist/{takeover-U2EHJ5GW.js → takeover-5QSP6YAG.js} +6 -4
- package/dist/{use-7D5GQFGB.js → use-HY5BO4BW.js} +20 -13
- package/package.json +1 -1
- package/dist/disconnect-7SJKPYIN.js +0 -30
- package/dist/existing-runner-XT3HLIPM.js +0 -20
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
legacyStagingRunner,
|
|
4
|
+
runnerOrigin
|
|
5
|
+
} from "./chunk-PQURJJOD.js";
|
|
6
|
+
import {
|
|
7
|
+
ENVIRONMENTS,
|
|
8
|
+
boxPath,
|
|
9
|
+
environmentOf,
|
|
10
|
+
runnerEnvironment
|
|
11
|
+
} from "./chunk-GAEZIKCK.js";
|
|
12
|
+
import {
|
|
13
|
+
pinRunnerEnvironment
|
|
14
|
+
} from "./chunk-D5UZW42X.js";
|
|
15
|
+
|
|
16
|
+
// src/existing-runner.ts
|
|
17
|
+
import { existsSync } from "fs";
|
|
18
|
+
var ALL = Object.keys(ENVIRONMENTS);
|
|
19
|
+
function runnersOnThisComputer() {
|
|
20
|
+
if (legacyStagingRunner()) return ["staging"];
|
|
21
|
+
return ALL.filter((env) => existsSync(boxPath(env)));
|
|
22
|
+
}
|
|
23
|
+
function existingRunnerEnvironment() {
|
|
24
|
+
const named = process.env.CLOOP_ORIGIN;
|
|
25
|
+
if (named) return environmentOf(named);
|
|
26
|
+
const found = runnersOnThisComputer();
|
|
27
|
+
return found.length === 1 && found[0] ? found[0] : "production";
|
|
28
|
+
}
|
|
29
|
+
var BOTH_RUNNERS_LINE = "This computer is a production machine and a staging machine. This acts on the production machine. Add --staging for the staging machine.";
|
|
30
|
+
function pinExistingRunner() {
|
|
31
|
+
const named = Boolean(process.env.CLOOP_ORIGIN);
|
|
32
|
+
const environment = existingRunnerEnvironment();
|
|
33
|
+
pinRunnerEnvironment(runnerOrigin(environment) ?? ENVIRONMENTS[environment].origin);
|
|
34
|
+
return {
|
|
35
|
+
environment: runnerEnvironment(),
|
|
36
|
+
note: !named && runnersOnThisComputer().length === ALL.length ? BOTH_RUNNERS_LINE : null
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
existingRunnerEnvironment,
|
|
42
|
+
pinExistingRunner
|
|
43
|
+
};
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
findRun,
|
|
4
4
|
ownHarness
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
lockThreadsFile,
|
|
8
|
-
threadsFilePath
|
|
9
|
-
} from "./chunk-7LPSTDZE.js";
|
|
5
|
+
} from "./chunk-CLOYOD2X.js";
|
|
10
6
|
import {
|
|
11
7
|
localRunsFilePath,
|
|
12
8
|
readRunRecords,
|
|
13
9
|
runHarness,
|
|
14
10
|
takeoverSummary
|
|
15
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HIBAH65V.js";
|
|
12
|
+
import {
|
|
13
|
+
lockThreadsFile,
|
|
14
|
+
threadsFilePath
|
|
15
|
+
} from "./chunk-4JTIWZHB.js";
|
|
16
16
|
import {
|
|
17
17
|
sanitizeLabel
|
|
18
18
|
} from "./chunk-VK6GV757.js";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/device-revoke.ts
|
|
4
|
+
function tokenGone(revoke) {
|
|
5
|
+
return revoke === "revoked" || revoke === "already_revoked" || revoke === "no_device";
|
|
6
|
+
}
|
|
7
|
+
async function revokeOwnDevice(origin, deviceToken, fetchFn = fetch) {
|
|
8
|
+
if (!deviceToken) return "no_device";
|
|
9
|
+
try {
|
|
10
|
+
const res = await fetchFn(`${origin}/api/agent/mesh/device-revoke`, {
|
|
11
|
+
method: "POST",
|
|
12
|
+
headers: { authorization: `Bearer ${deviceToken}` },
|
|
13
|
+
signal: AbortSignal.timeout(1e4)
|
|
14
|
+
});
|
|
15
|
+
const body = await res.json().catch(() => null);
|
|
16
|
+
if (res.ok && body?.outcome === "revoked") return "revoked";
|
|
17
|
+
if (res.ok && body?.outcome === "already_revoked") return "already_revoked";
|
|
18
|
+
if (res.status === 401 && body?.error === "unknown_device") return "unknown_device";
|
|
19
|
+
return "failed";
|
|
20
|
+
} catch {
|
|
21
|
+
return "failed";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// src/harness-home.ts
|
|
26
|
+
import { homedir } from "os";
|
|
27
|
+
import { join } from "path";
|
|
28
|
+
function claudeHome() {
|
|
29
|
+
return process.env.CLAUDE_CONFIG_DIR || join(homedir(), ".claude");
|
|
30
|
+
}
|
|
31
|
+
function codexHome() {
|
|
32
|
+
return process.env.CODEX_HOME || join(homedir(), ".codex");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
tokenGone,
|
|
37
|
+
revokeOwnDevice,
|
|
38
|
+
claudeHome,
|
|
39
|
+
codexHome
|
|
40
|
+
};
|