@cloop/runner 0.3.68 → 0.3.69
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-UOJ6ET2B.js} +156 -511
- package/dist/{chunk-7LPSTDZE.js → chunk-4JTIWZHB.js} +1 -1
- package/dist/{chunk-BVPS6DCH.js → chunk-57E5WOOP.js} +574 -1673
- 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-DTUNRKBC.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-7ZL3Z3IO.js → chunk-JI5FWLDU.js} +6 -6
- package/dist/chunk-JJWSPBM4.js +40 -0
- package/dist/{chunk-L7D3ANPW.js → chunk-KIYCULVE.js} +4 -2
- package/dist/{chunk-34VZ5LZI.js → chunk-SJAGZNFF.js} +3 -83
- package/dist/chunk-TPKYD3JF.js +43 -0
- package/dist/chunk-WCKW2Z2G.js +459 -0
- package/dist/chunk-ZHQSGJCE.js +85 -0
- package/dist/{connect-D2SXLADA.js → connect-HVOAYXWM.js} +11 -47
- package/dist/disconnect-DQ6WSDR7.js +163 -0
- package/dist/existing-runner-BSSRQFFP.js +15 -0
- package/dist/index.js +14 -14
- package/dist/{login-VNDFCJD4.js → login-4HWP4PF4.js} +3 -2
- package/dist/{mcp-server-XPHCDBFR.js → mcp-server-DTJVCFRG.js} +10 -10
- package/dist/{runner-A3HFZ727.js → runner-4XWS2RJL.js} +4 -3
- package/dist/{runs-DOFU45TW.js → runs-TWUGWGNU.js} +4 -2
- package/dist/{statusline-VA2DSWVT.js → statusline-C2FH3YQ4.js} +1 -1
- package/dist/{takeover-U2EHJ5GW.js → takeover-5QSP6YAG.js} +6 -4
- package/dist/{use-7D5GQFGB.js → use-U3E55XBK.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,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
VERSION
|
|
4
|
+
} from "./chunk-DTUNRKBC.js";
|
|
5
|
+
|
|
6
|
+
// src/connect-report.ts
|
|
7
|
+
import { randomUUID } from "crypto";
|
|
8
|
+
var ConnectFailure = class extends Error {
|
|
9
|
+
constructor(code, message, shown = false) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.code = code;
|
|
12
|
+
this.shown = shown;
|
|
13
|
+
this.name = "ConnectFailure";
|
|
14
|
+
}
|
|
15
|
+
code;
|
|
16
|
+
shown;
|
|
17
|
+
};
|
|
18
|
+
function newAttempt(now = Date.now()) {
|
|
19
|
+
return {
|
|
20
|
+
id: randomUUID(),
|
|
21
|
+
startedAt: now,
|
|
22
|
+
step: "detect",
|
|
23
|
+
harnesses: [],
|
|
24
|
+
driver: null,
|
|
25
|
+
fellBack: false,
|
|
26
|
+
workFolder: false,
|
|
27
|
+
codexInstall: null,
|
|
28
|
+
codexInstallReason: null,
|
|
29
|
+
claudeInstall: null,
|
|
30
|
+
mcpRegistered: [],
|
|
31
|
+
mcpSignedIn: [],
|
|
32
|
+
deviceToken: null,
|
|
33
|
+
deviceLogin: null,
|
|
34
|
+
relink: null
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function shortMachineLabel(machine) {
|
|
38
|
+
return machine.split(".")[0]?.replace(/[^A-Za-z0-9-]/g, "-").slice(0, 63) || "unknown";
|
|
39
|
+
}
|
|
40
|
+
function connectReport(attempt, error, machine, now = Date.now()) {
|
|
41
|
+
return {
|
|
42
|
+
attempt_id: attempt.id,
|
|
43
|
+
cli_version: VERSION,
|
|
44
|
+
os: process.platform,
|
|
45
|
+
arch: process.arch,
|
|
46
|
+
node_version: process.version,
|
|
47
|
+
machine: shortMachineLabel(machine),
|
|
48
|
+
harnesses: attempt.harnesses,
|
|
49
|
+
driver: attempt.driver,
|
|
50
|
+
fell_back: attempt.fellBack,
|
|
51
|
+
work_folder: attempt.workFolder,
|
|
52
|
+
codex_install: attempt.codexInstall,
|
|
53
|
+
codex_install_reason: attempt.codexInstallReason,
|
|
54
|
+
claude_install: attempt.claudeInstall,
|
|
55
|
+
mcp_registered: attempt.mcpRegistered,
|
|
56
|
+
mcp_signed_in: attempt.mcpSignedIn,
|
|
57
|
+
device_login: attempt.deviceLogin,
|
|
58
|
+
relink: attempt.relink,
|
|
59
|
+
step: attempt.step,
|
|
60
|
+
outcome: error ? "failed" : "ok",
|
|
61
|
+
error_code: error,
|
|
62
|
+
seconds: Math.round((now - attempt.startedAt) / 1e3)
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
async function sendConnectReport(origin, report, deviceToken, fetchFn = fetch) {
|
|
66
|
+
try {
|
|
67
|
+
await fetchFn(`${origin}/api/agent/mesh/connect-report`, {
|
|
68
|
+
method: "POST",
|
|
69
|
+
headers: {
|
|
70
|
+
"content-type": "application/json",
|
|
71
|
+
...deviceToken ? { authorization: `Bearer ${deviceToken}` } : {}
|
|
72
|
+
},
|
|
73
|
+
body: JSON.stringify(report),
|
|
74
|
+
signal: AbortSignal.timeout(3e3)
|
|
75
|
+
});
|
|
76
|
+
} catch {
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
ConnectFailure,
|
|
82
|
+
newAttempt,
|
|
83
|
+
connectReport,
|
|
84
|
+
sendConnectReport
|
|
85
|
+
};
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
DEFAULT_T3_URL,
|
|
4
|
-
DRIVER_NAME,
|
|
5
|
-
FIRST_CONNECT_MS,
|
|
6
4
|
T3PairError,
|
|
7
5
|
WINGET_UPDATE,
|
|
8
6
|
askHidden,
|
|
9
7
|
askOrClosed,
|
|
10
8
|
askRepos,
|
|
11
9
|
asksForFolders,
|
|
12
|
-
awaitDaemon,
|
|
13
10
|
chooseDriver,
|
|
14
11
|
claudeAtFloor,
|
|
15
|
-
cmdValue,
|
|
16
|
-
cmdWord,
|
|
17
12
|
connectBox,
|
|
18
13
|
connectChosen,
|
|
19
14
|
connectCommand,
|
|
20
15
|
detect,
|
|
21
|
-
endDaemonScript,
|
|
22
16
|
ensureLinger,
|
|
23
17
|
fallbackDriver,
|
|
24
18
|
fallbackLine,
|
|
25
19
|
findCheckouts,
|
|
26
|
-
findNpx,
|
|
27
20
|
harnessesFound,
|
|
28
|
-
installedService,
|
|
29
|
-
isRelease,
|
|
30
21
|
isWorkstation,
|
|
31
22
|
mcpHarnesses,
|
|
32
23
|
mintSession,
|
|
@@ -34,69 +25,53 @@ import {
|
|
|
34
25
|
pairT3,
|
|
35
26
|
parsePicks,
|
|
36
27
|
prepareAgents,
|
|
37
|
-
programFor,
|
|
38
|
-
psQuote,
|
|
39
|
-
registerTaskScript,
|
|
40
28
|
relinkLine,
|
|
41
29
|
rememberedDriver,
|
|
42
30
|
rerunCommand,
|
|
43
31
|
resolveRepos,
|
|
44
32
|
revokeReplaced,
|
|
45
33
|
runConnect,
|
|
46
|
-
runSteps,
|
|
47
|
-
serviceEnv,
|
|
48
34
|
sessionFromLink,
|
|
49
35
|
storedDevice,
|
|
50
|
-
systemServices,
|
|
51
|
-
systemdAssignment,
|
|
52
|
-
systemdWord,
|
|
53
36
|
tilde,
|
|
54
|
-
unitEnv,
|
|
55
|
-
unitFor,
|
|
56
37
|
updateClaude,
|
|
57
|
-
which,
|
|
58
38
|
workFolder,
|
|
59
39
|
workFolderLine
|
|
60
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-57E5WOOP.js";
|
|
41
|
+
import "./chunk-JJWSPBM4.js";
|
|
42
|
+
import "./chunk-DN6TQALA.js";
|
|
43
|
+
import "./chunk-365HFCQQ.js";
|
|
44
|
+
import "./chunk-WCKW2Z2G.js";
|
|
45
|
+
import "./chunk-4JTIWZHB.js";
|
|
46
|
+
import "./chunk-GAEZIKCK.js";
|
|
61
47
|
import "./chunk-AZQGERT7.js";
|
|
62
|
-
import "./chunk-7LPSTDZE.js";
|
|
63
|
-
import "./chunk-6LYMSWSB.js";
|
|
64
48
|
import "./chunk-VK6GV757.js";
|
|
65
|
-
import "./chunk-365HFCQQ.js";
|
|
66
49
|
import "./chunk-PKIEWBR7.js";
|
|
67
|
-
import "./chunk-
|
|
68
|
-
import "./chunk-
|
|
50
|
+
import "./chunk-KIYCULVE.js";
|
|
51
|
+
import "./chunk-SJAGZNFF.js";
|
|
52
|
+
import "./chunk-ZHQSGJCE.js";
|
|
69
53
|
import "./chunk-SBYSVZ7J.js";
|
|
70
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-DTUNRKBC.js";
|
|
71
55
|
import "./chunk-D5UZW42X.js";
|
|
72
56
|
export {
|
|
73
57
|
DEFAULT_T3_URL,
|
|
74
|
-
DRIVER_NAME,
|
|
75
|
-
FIRST_CONNECT_MS,
|
|
76
58
|
T3PairError,
|
|
77
59
|
WINGET_UPDATE,
|
|
78
60
|
askHidden,
|
|
79
61
|
askOrClosed,
|
|
80
62
|
askRepos,
|
|
81
63
|
asksForFolders,
|
|
82
|
-
awaitDaemon,
|
|
83
64
|
chooseDriver,
|
|
84
65
|
claudeAtFloor,
|
|
85
|
-
cmdValue,
|
|
86
|
-
cmdWord,
|
|
87
66
|
connectBox,
|
|
88
67
|
connectChosen,
|
|
89
68
|
connectCommand,
|
|
90
69
|
detect,
|
|
91
|
-
endDaemonScript,
|
|
92
70
|
ensureLinger,
|
|
93
71
|
fallbackDriver,
|
|
94
72
|
fallbackLine,
|
|
95
73
|
findCheckouts,
|
|
96
|
-
findNpx,
|
|
97
74
|
harnessesFound,
|
|
98
|
-
installedService,
|
|
99
|
-
isRelease,
|
|
100
75
|
isWorkstation,
|
|
101
76
|
mcpHarnesses,
|
|
102
77
|
mintSession,
|
|
@@ -104,27 +79,16 @@ export {
|
|
|
104
79
|
pairT3,
|
|
105
80
|
parsePicks,
|
|
106
81
|
prepareAgents,
|
|
107
|
-
programFor,
|
|
108
|
-
psQuote,
|
|
109
|
-
registerTaskScript,
|
|
110
82
|
relinkLine,
|
|
111
83
|
rememberedDriver,
|
|
112
84
|
rerunCommand,
|
|
113
85
|
resolveRepos,
|
|
114
86
|
revokeReplaced,
|
|
115
87
|
runConnect,
|
|
116
|
-
runSteps,
|
|
117
|
-
serviceEnv,
|
|
118
88
|
sessionFromLink,
|
|
119
89
|
storedDevice,
|
|
120
|
-
systemServices,
|
|
121
|
-
systemdAssignment,
|
|
122
|
-
systemdWord,
|
|
123
90
|
tilde,
|
|
124
|
-
unitEnv,
|
|
125
|
-
unitFor,
|
|
126
91
|
updateClaude,
|
|
127
|
-
which,
|
|
128
92
|
workFolder,
|
|
129
93
|
workFolderLine
|
|
130
94
|
};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
captureCursorPath
|
|
4
|
+
} from "./chunk-EEG5JOZ7.js";
|
|
5
|
+
import {
|
|
6
|
+
revokeOwnDevice,
|
|
7
|
+
tokenGone
|
|
8
|
+
} from "./chunk-JJWSPBM4.js";
|
|
9
|
+
import {
|
|
10
|
+
localRunsFilePath
|
|
11
|
+
} from "./chunk-HIBAH65V.js";
|
|
12
|
+
import "./chunk-DN6TQALA.js";
|
|
13
|
+
import {
|
|
14
|
+
pinExistingRunner
|
|
15
|
+
} from "./chunk-TPKYD3JF.js";
|
|
16
|
+
import {
|
|
17
|
+
installedServices,
|
|
18
|
+
legacyStagingRunner,
|
|
19
|
+
servicesOrigin,
|
|
20
|
+
stopService
|
|
21
|
+
} from "./chunk-WCKW2Z2G.js";
|
|
22
|
+
import {
|
|
23
|
+
runnerStatePath,
|
|
24
|
+
threadsFilePath
|
|
25
|
+
} from "./chunk-4JTIWZHB.js";
|
|
26
|
+
import {
|
|
27
|
+
ENVIRONMENTS,
|
|
28
|
+
boxPath,
|
|
29
|
+
cloopCommand,
|
|
30
|
+
environmentOf,
|
|
31
|
+
readRunnerConfig,
|
|
32
|
+
windowsPowerShellEnv
|
|
33
|
+
} from "./chunk-GAEZIKCK.js";
|
|
34
|
+
import "./chunk-VK6GV757.js";
|
|
35
|
+
import "./chunk-ZHQSGJCE.js";
|
|
36
|
+
import "./chunk-DTUNRKBC.js";
|
|
37
|
+
import {
|
|
38
|
+
getOrigin
|
|
39
|
+
} from "./chunk-D5UZW42X.js";
|
|
40
|
+
|
|
41
|
+
// src/commands/disconnect.ts
|
|
42
|
+
import { execFileSync } from "child_process";
|
|
43
|
+
import { existsSync, readFileSync, rmSync } from "fs";
|
|
44
|
+
import { homedir } from "os";
|
|
45
|
+
import { basename } from "path";
|
|
46
|
+
function doneLine(env) {
|
|
47
|
+
return `This computer is no longer a ${env} Cloop machine. To connect it again: ${["npx -y @cloop/runner@latest connect", ENVIRONMENTS[env].flag].filter(Boolean).join(" ")}`;
|
|
48
|
+
}
|
|
49
|
+
function disconnectPlan(opts) {
|
|
50
|
+
const exists = opts.exists ?? existsSync;
|
|
51
|
+
const read = opts.read ?? ((path) => readFileSync(path, "utf-8"));
|
|
52
|
+
const installed = installedServices(opts, exists);
|
|
53
|
+
const services = installed.map(({ service }) => service);
|
|
54
|
+
return {
|
|
55
|
+
origin: opts.boxOrigin ?? servicesOrigin(services, read) ?? opts.fallbackOrigin,
|
|
56
|
+
deviceToken: opts.deviceToken,
|
|
57
|
+
services,
|
|
58
|
+
box: exists(opts.box) ? opts.box : null,
|
|
59
|
+
files: opts.files.filter((file) => exists(file)),
|
|
60
|
+
isBox: opts.platform !== "darwin" && opts.platform !== "win32" && installed.some(({ kind }) => kind === "workstation")
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function revokeLine(revoke, origin, box) {
|
|
64
|
+
const env = environmentOf(origin);
|
|
65
|
+
const keep = box ? ` Kept ${box}, which holds the device token, so you can try again.` : "";
|
|
66
|
+
switch (revoke) {
|
|
67
|
+
case "revoked":
|
|
68
|
+
return [`Revoked this computer on Cloop (${origin}).`];
|
|
69
|
+
case "already_revoked":
|
|
70
|
+
return [`Cloop (${origin}) had already revoked this computer.`];
|
|
71
|
+
case "no_device":
|
|
72
|
+
return ["No machine device on this computer to revoke."];
|
|
73
|
+
case "unknown_device":
|
|
74
|
+
return [
|
|
75
|
+
`Cloop at ${origin} never issued this computer's device token, so it belongs to the other environment.${keep}`,
|
|
76
|
+
"Run `cloop disconnect --staging` for a staging machine, or `cloop disconnect` for production."
|
|
77
|
+
];
|
|
78
|
+
case "failed":
|
|
79
|
+
return [
|
|
80
|
+
`Could not revoke this computer at ${origin}: Cloop did not answer as expected.${keep}`,
|
|
81
|
+
`Run \`${cloopCommand(env, "disconnect")}\` again when Cloop answers, or press Disconnect on its card on the Threads page and then delete that file.`
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async function disconnect(plan, opts) {
|
|
86
|
+
const { say } = opts;
|
|
87
|
+
const env = environmentOf(plan.origin);
|
|
88
|
+
const run = opts.run ?? ((command) => void execFileSync(command[0], command.slice(1), {
|
|
89
|
+
stdio: "ignore",
|
|
90
|
+
timeout: 15e3,
|
|
91
|
+
...command[0] === "powershell" ? { env: windowsPowerShellEnv() } : {}
|
|
92
|
+
}));
|
|
93
|
+
if (plan.isBox && !opts.yes) {
|
|
94
|
+
const unit = plan.services.map((s) => basename(s.path)).find((n) => n.startsWith("cloop-box"));
|
|
95
|
+
say(`This computer runs ${unit}, the ${env} Cloop box with T3 Code. Disconnect would:`);
|
|
96
|
+
for (const s of plan.services) say(` stop and remove ${s.path}`);
|
|
97
|
+
if (plan.deviceToken) say(` revoke its machine device on Cloop (${plan.origin})`);
|
|
98
|
+
for (const f of [...plan.box ? [plan.box] : [], ...plan.files]) say(` delete ${f}`);
|
|
99
|
+
say(`Run \`${cloopCommand(env, "disconnect --yes")}\` to do this.`);
|
|
100
|
+
return 1;
|
|
101
|
+
}
|
|
102
|
+
for (const service of plan.services) {
|
|
103
|
+
if (!await stopService(service, run, opts.stopWaitMs)) {
|
|
104
|
+
say(
|
|
105
|
+
`Could not stop the service in ${service.path}. Nothing was removed. Stop it with \`${service.steps.map((s) => s.command.join(" ")).join(" && ")}\`, then run \`${cloopCommand(env, "disconnect")}\` again.`
|
|
106
|
+
);
|
|
107
|
+
return 1;
|
|
108
|
+
}
|
|
109
|
+
say(`Stopped the service in ${service.path}`);
|
|
110
|
+
}
|
|
111
|
+
const revoked = await opts.revoke(plan.origin, plan.deviceToken);
|
|
112
|
+
const gone = tokenGone(revoked);
|
|
113
|
+
for (const service of plan.services) {
|
|
114
|
+
rmSync(service.path, { force: true });
|
|
115
|
+
say(`Removed ${service.path}`);
|
|
116
|
+
}
|
|
117
|
+
for (const file of [...gone && plan.box ? [plan.box] : [], ...plan.files]) {
|
|
118
|
+
rmSync(file, { force: true });
|
|
119
|
+
say(`Deleted ${file}`);
|
|
120
|
+
}
|
|
121
|
+
for (const line of revokeLine(revoked, plan.origin, plan.box)) say(line);
|
|
122
|
+
if (!gone) return 1;
|
|
123
|
+
say(doneLine(env));
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
function thisComputer(env, fallbackOrigin) {
|
|
127
|
+
const cfg = readRunnerConfig(env);
|
|
128
|
+
return {
|
|
129
|
+
platform: process.platform,
|
|
130
|
+
environment: env,
|
|
131
|
+
home: homedir(),
|
|
132
|
+
uid: process.getuid?.() ?? 0,
|
|
133
|
+
...process.env.CLOOP_UNIT_DIR ? { dir: process.env.CLOOP_UNIT_DIR } : {},
|
|
134
|
+
box: boxPath(env),
|
|
135
|
+
deviceToken: cfg?.deviceToken ?? null,
|
|
136
|
+
...cfg?.origin ? { boxOrigin: cfg.origin } : {},
|
|
137
|
+
fallbackOrigin,
|
|
138
|
+
files: [
|
|
139
|
+
localRunsFilePath(env),
|
|
140
|
+
runnerStatePath(env),
|
|
141
|
+
threadsFilePath(env),
|
|
142
|
+
captureCursorPath(threadsFilePath(env))
|
|
143
|
+
]
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
async function disconnectCommand(argv) {
|
|
147
|
+
const { environment, note } = pinExistingRunner();
|
|
148
|
+
if (note) console.log(note);
|
|
149
|
+
const plan = disconnectPlan(
|
|
150
|
+
thisComputer(legacyStagingRunner() ? "production" : environment, getOrigin())
|
|
151
|
+
);
|
|
152
|
+
process.exitCode = await disconnect(plan, {
|
|
153
|
+
yes: argv.includes("--yes"),
|
|
154
|
+
revoke: (origin, token) => revokeOwnDevice(origin, token),
|
|
155
|
+
say: (line) => console.log(line)
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
export {
|
|
159
|
+
disconnect,
|
|
160
|
+
disconnectCommand,
|
|
161
|
+
disconnectPlan,
|
|
162
|
+
doneLine
|
|
163
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
existingRunnerEnvironment,
|
|
4
|
+
pinExistingRunner
|
|
5
|
+
} from "./chunk-TPKYD3JF.js";
|
|
6
|
+
import "./chunk-WCKW2Z2G.js";
|
|
7
|
+
import "./chunk-4JTIWZHB.js";
|
|
8
|
+
import "./chunk-GAEZIKCK.js";
|
|
9
|
+
import "./chunk-ZHQSGJCE.js";
|
|
10
|
+
import "./chunk-DTUNRKBC.js";
|
|
11
|
+
import "./chunk-D5UZW42X.js";
|
|
12
|
+
export {
|
|
13
|
+
existingRunnerEnvironment,
|
|
14
|
+
pinExistingRunner
|
|
15
|
+
};
|
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-DTUNRKBC.js";
|
|
8
8
|
import {
|
|
9
9
|
applyEnvironmentFlag
|
|
10
10
|
} from "./chunk-D5UZW42X.js";
|
|
@@ -72,7 +72,7 @@ Add --staging to any command to use Cloop staging instead of production.
|
|
|
72
72
|
A production machine and a staging machine can run side by side on one computer.
|
|
73
73
|
`;
|
|
74
74
|
async function pinExistingRunner() {
|
|
75
|
-
const { pinExistingRunner: pin } = await import("./existing-runner-
|
|
75
|
+
const { pinExistingRunner: pin } = await import("./existing-runner-BSSRQFFP.js");
|
|
76
76
|
const { note } = pin();
|
|
77
77
|
if (note) console.error(note);
|
|
78
78
|
}
|
|
@@ -80,7 +80,7 @@ async function main() {
|
|
|
80
80
|
switch (command) {
|
|
81
81
|
case "login":
|
|
82
82
|
case "auth": {
|
|
83
|
-
const { loginCommand } = await import("./login-
|
|
83
|
+
const { loginCommand } = await import("./login-4HWP4PF4.js");
|
|
84
84
|
await loginCommand(argv);
|
|
85
85
|
break;
|
|
86
86
|
}
|
|
@@ -90,61 +90,61 @@ async function main() {
|
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
92
|
case "serve": {
|
|
93
|
-
const { startMcpServer } = await import("./mcp-server-
|
|
93
|
+
const { startMcpServer } = await import("./mcp-server-DTJVCFRG.js");
|
|
94
94
|
await startMcpServer();
|
|
95
95
|
break;
|
|
96
96
|
}
|
|
97
97
|
case "statusline": {
|
|
98
|
-
const { statuslineCommand } = await import("./statusline-
|
|
98
|
+
const { statuslineCommand } = await import("./statusline-C2FH3YQ4.js");
|
|
99
99
|
statuslineCommand();
|
|
100
100
|
break;
|
|
101
101
|
}
|
|
102
102
|
case "connect": {
|
|
103
|
-
const { connectCommand } = await import("./connect-
|
|
103
|
+
const { connectCommand } = await import("./connect-HVOAYXWM.js");
|
|
104
104
|
await connectCommand(argv.slice(1));
|
|
105
105
|
break;
|
|
106
106
|
}
|
|
107
107
|
case "use": {
|
|
108
|
-
const { useCommand } = await import("./use-
|
|
108
|
+
const { useCommand } = await import("./use-U3E55XBK.js");
|
|
109
109
|
process.exitCode = await useCommand(argv.slice(1));
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
112
112
|
case "disconnect": {
|
|
113
|
-
const { disconnectCommand } = await import("./disconnect-
|
|
113
|
+
const { disconnectCommand } = await import("./disconnect-DQ6WSDR7.js");
|
|
114
114
|
await disconnectCommand(argv.slice(1));
|
|
115
115
|
break;
|
|
116
116
|
}
|
|
117
117
|
case "box": {
|
|
118
|
-
const { boxCommand } = await import("./box-
|
|
118
|
+
const { boxCommand } = await import("./box-UOJ6ET2B.js");
|
|
119
119
|
await boxCommand(argv.slice(1));
|
|
120
120
|
break;
|
|
121
121
|
}
|
|
122
122
|
case "runs": {
|
|
123
123
|
await pinExistingRunner();
|
|
124
|
-
const { runsCommand } = await import("./runs-
|
|
124
|
+
const { runsCommand } = await import("./runs-TWUGWGNU.js");
|
|
125
125
|
process.exitCode = runsCommand();
|
|
126
126
|
break;
|
|
127
127
|
}
|
|
128
128
|
case "watch": {
|
|
129
129
|
await pinExistingRunner();
|
|
130
|
-
const { watchCommand } = await import("./runs-
|
|
130
|
+
const { watchCommand } = await import("./runs-TWUGWGNU.js");
|
|
131
131
|
process.exitCode = await watchCommand(argv.slice(1));
|
|
132
132
|
break;
|
|
133
133
|
}
|
|
134
134
|
case "takeover": {
|
|
135
135
|
await pinExistingRunner();
|
|
136
|
-
const { takeoverCommand } = await import("./takeover-
|
|
136
|
+
const { takeoverCommand } = await import("./takeover-5QSP6YAG.js");
|
|
137
137
|
process.exitCode = await takeoverCommand(argv.slice(1));
|
|
138
138
|
break;
|
|
139
139
|
}
|
|
140
140
|
case "resume": {
|
|
141
141
|
await pinExistingRunner();
|
|
142
|
-
const { resumeCommand } = await import("./runs-
|
|
142
|
+
const { resumeCommand } = await import("./runs-TWUGWGNU.js");
|
|
143
143
|
process.exitCode = await resumeCommand(argv.slice(1));
|
|
144
144
|
break;
|
|
145
145
|
}
|
|
146
146
|
case "runner": {
|
|
147
|
-
const { runnerCommand } = await import("./runner-
|
|
147
|
+
const { runnerCommand } = await import("./runner-4XWS2RJL.js");
|
|
148
148
|
await runnerCommand(argv.slice(1));
|
|
149
149
|
break;
|
|
150
150
|
}
|
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
deviceLogin,
|
|
4
4
|
loginCommand,
|
|
5
5
|
refusalSentence
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SJAGZNFF.js";
|
|
7
|
+
import "./chunk-ZHQSGJCE.js";
|
|
7
8
|
import "./chunk-SBYSVZ7J.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-DTUNRKBC.js";
|
|
9
10
|
import "./chunk-D5UZW42X.js";
|
|
10
11
|
export {
|
|
11
12
|
deviceLogin,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
syncInboxPending,
|
|
7
|
-
writeState
|
|
8
|
-
} from "./chunk-6QXNXJ7C.js";
|
|
3
|
+
MeshSocket,
|
|
4
|
+
defaultSocketFactory
|
|
5
|
+
} from "./chunk-AZQGERT7.js";
|
|
9
6
|
import {
|
|
10
7
|
readSessionState,
|
|
11
8
|
toolPhrase,
|
|
12
9
|
writeSessionState
|
|
13
10
|
} from "./chunk-EVIVOEJY.js";
|
|
14
11
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
appendInbox,
|
|
13
|
+
drainInbox,
|
|
14
|
+
readInbox,
|
|
15
|
+
syncInboxPending,
|
|
16
|
+
writeState
|
|
17
|
+
} from "./chunk-6QXNXJ7C.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-DTUNRKBC.js";
|
|
35
35
|
import {
|
|
36
36
|
getMeshUrl,
|
|
37
37
|
getToken
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
connectWebhook,
|
|
4
4
|
runnerCommand
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-KIYCULVE.js";
|
|
6
|
+
import "./chunk-SJAGZNFF.js";
|
|
7
|
+
import "./chunk-ZHQSGJCE.js";
|
|
7
8
|
import "./chunk-SBYSVZ7J.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-DTUNRKBC.js";
|
|
9
10
|
import "./chunk-D5UZW42X.js";
|
|
10
11
|
export {
|
|
11
12
|
connectWebhook,
|
|
@@ -9,8 +9,10 @@ import {
|
|
|
9
9
|
runsCommand,
|
|
10
10
|
sessionFolder,
|
|
11
11
|
watchCommand
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-CLOYOD2X.js";
|
|
13
|
+
import "./chunk-HIBAH65V.js";
|
|
14
|
+
import "./chunk-DN6TQALA.js";
|
|
15
|
+
import "./chunk-GAEZIKCK.js";
|
|
14
16
|
import "./chunk-VK6GV757.js";
|
|
15
17
|
import "./chunk-D5UZW42X.js";
|
|
16
18
|
export {
|
|
@@ -9,10 +9,12 @@ 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-JI5FWLDU.js";
|
|
13
|
+
import "./chunk-CLOYOD2X.js";
|
|
14
|
+
import "./chunk-HIBAH65V.js";
|
|
15
|
+
import "./chunk-DN6TQALA.js";
|
|
16
|
+
import "./chunk-4JTIWZHB.js";
|
|
17
|
+
import "./chunk-GAEZIKCK.js";
|
|
16
18
|
import "./chunk-VK6GV757.js";
|
|
17
19
|
import "./chunk-SBYSVZ7J.js";
|
|
18
20
|
import "./chunk-D5UZW42X.js";
|
|
@@ -1,32 +1,39 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
pinExistingRunner,
|
|
3
|
+
AGENTS,
|
|
5
4
|
runConnect
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-57E5WOOP.js";
|
|
6
|
+
import "./chunk-JJWSPBM4.js";
|
|
7
|
+
import "./chunk-DN6TQALA.js";
|
|
8
|
+
import "./chunk-365HFCQQ.js";
|
|
9
|
+
import {
|
|
10
|
+
pinExistingRunner
|
|
11
|
+
} from "./chunk-TPKYD3JF.js";
|
|
12
|
+
import "./chunk-WCKW2Z2G.js";
|
|
13
|
+
import "./chunk-4JTIWZHB.js";
|
|
9
14
|
import {
|
|
10
15
|
isLocal,
|
|
16
|
+
isLocalDriver,
|
|
11
17
|
readRunnerConfig
|
|
12
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GAEZIKCK.js";
|
|
19
|
+
import "./chunk-AZQGERT7.js";
|
|
13
20
|
import "./chunk-VK6GV757.js";
|
|
14
|
-
import "./chunk-365HFCQQ.js";
|
|
15
21
|
import "./chunk-PKIEWBR7.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-KIYCULVE.js";
|
|
23
|
+
import "./chunk-SJAGZNFF.js";
|
|
24
|
+
import "./chunk-ZHQSGJCE.js";
|
|
18
25
|
import "./chunk-SBYSVZ7J.js";
|
|
19
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-DTUNRKBC.js";
|
|
20
27
|
import "./chunk-D5UZW42X.js";
|
|
21
28
|
|
|
22
29
|
// src/commands/use.ts
|
|
23
|
-
var DRIVERS =
|
|
30
|
+
var DRIVERS = Object.keys(AGENTS);
|
|
24
31
|
function machineNoun(platform) {
|
|
25
32
|
return platform === "darwin" ? "This Mac" : "This machine";
|
|
26
33
|
}
|
|
27
34
|
function useArgs(driver, rest) {
|
|
28
35
|
const previous = readRunnerConfig();
|
|
29
|
-
const repos = driver
|
|
36
|
+
const repos = isLocalDriver(driver) && !rest.includes("--repo") && previous && isLocal(previous) ? previous.repos.flatMap((r) => ["--repo", r.path]) : [];
|
|
30
37
|
return ["--driver", driver, ...repos, ...rest];
|
|
31
38
|
}
|
|
32
39
|
async function useCommand(argv, deps = {}) {
|
|
@@ -45,7 +52,7 @@ async function useCommand(argv, deps = {}) {
|
|
|
45
52
|
log(`[runner:use] from=${from} to=${driver} outcome=${error ? `failed error=${error}` : "ok"}`);
|
|
46
53
|
if (error) return 1;
|
|
47
54
|
out(
|
|
48
|
-
`${machineNoun(deps.platform ?? process.platform)}'s ${environment} machine now runs Cloop work in ${
|
|
55
|
+
`${machineNoun(deps.platform ?? process.platform)}'s ${environment} machine now runs Cloop work in ${AGENTS[driver].name}.`
|
|
49
56
|
);
|
|
50
57
|
return 0;
|
|
51
58
|
}
|
package/package.json
CHANGED