@mushi-mushi/cli 0.40.4 → 0.40.5
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/{chunk-S5YMLTMA.js → chunk-3LHOI34N.js} +1 -1
- package/dist/{chunk-C6JKAD3Z.js → chunk-4Z5MWQS5.js} +1 -1
- package/dist/chunk-5DI4Q5BD.js +8 -0
- package/dist/{chunk-BKSEVNJH.js → chunk-KEMUVMO7.js} +2 -2
- package/dist/{chunk-2N7XJA5W.js → chunk-MNIFWCTR.js} +11 -11
- package/dist/chunk-UWPIVVCG.js +10 -0
- package/dist/{chunk-AUWZX4P3.js → chunk-ZOBSRRD3.js} +23 -9
- package/dist/{connect-NQHKFL2H.js → connect-B2ZZPVWI.js} +3 -3
- package/dist/{connect-VI2GTMQ4.js → connect-ZVMQIYBI.js} +2 -2
- package/dist/{daemon-YM34HXEA.js → daemon-FM6M7TKK.js} +5 -3
- package/dist/index.js +60 -19
- package/dist/init.js +3 -3
- package/dist/{version-F3M2GCMT.js → version-XXSOPUQR.js} +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wizard-bin.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-MEQSUWI4.js +0 -10
- package/dist/chunk-XYTPKC65.js +0 -8
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
requireUuid,
|
|
10
10
|
saveConfig,
|
|
11
11
|
savedSdkKeyFor
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4Z5MWQS5.js";
|
|
13
13
|
import {
|
|
14
14
|
MUSHI_MCP_PIN_SPEC
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UWPIVVCG.js";
|
|
16
16
|
import {
|
|
17
17
|
assertEndpoint,
|
|
18
18
|
normalizeEndpoint
|
|
@@ -32,10 +32,10 @@ import {
|
|
|
32
32
|
saveConfig,
|
|
33
33
|
savedSdkKeyFor,
|
|
34
34
|
trySaveKeyToKeychain
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-3LHOI34N.js";
|
|
36
36
|
import {
|
|
37
37
|
MUSHI_CLI_VERSION
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-5DI4Q5BD.js";
|
|
39
39
|
import {
|
|
40
40
|
FRAMEWORKS,
|
|
41
41
|
detectFramework,
|
|
@@ -334,10 +334,12 @@ function defaultProjectName(packageName, cwd) {
|
|
|
334
334
|
const parts = cwd.split(/[\\/]/).filter(Boolean);
|
|
335
335
|
return parts[parts.length - 1] || "my-app";
|
|
336
336
|
}
|
|
337
|
-
function chooseProjectNonInteractive(projects, preferredName) {
|
|
337
|
+
function chooseProjectNonInteractive(projects, preferredName, appFolder = true) {
|
|
338
338
|
const wanted = slugify(preferredName);
|
|
339
339
|
const match = projects.find((p2) => slugify(p2.name) === wanted || p2.slug !== void 0 && slugify(p2.slug) === wanted);
|
|
340
|
-
|
|
340
|
+
if (match) return { kind: "existing", id: match.id, name: match.name };
|
|
341
|
+
if (!appFolder && projects.length > 0) return { kind: "ask" };
|
|
342
|
+
return { kind: "new", name: preferredName };
|
|
341
343
|
}
|
|
342
344
|
|
|
343
345
|
// src/freshness.ts
|
|
@@ -1754,16 +1756,14 @@ async function runBrowserSignIn(options, endpoint, consoleBase, preset) {
|
|
|
1754
1756
|
}
|
|
1755
1757
|
if (!isInteractive()) {
|
|
1756
1758
|
const cwd = options.cwd ?? process.cwd();
|
|
1757
|
-
const
|
|
1758
|
-
|
|
1759
|
-
defaultProjectName(readPackageJson(cwd)?.name, cwd)
|
|
1760
|
-
);
|
|
1759
|
+
const name = defaultProjectName(readPackageJson(cwd)?.name, cwd);
|
|
1760
|
+
const choice = chooseProjectNonInteractive(projects, name);
|
|
1761
1761
|
if (choice.kind === "existing") {
|
|
1762
1762
|
p.log.info(`Using project "${choice.name}" (matches this app \u2014 pass --project-id to pick another).`);
|
|
1763
1763
|
target = { kind: "existing", projectId: choice.id };
|
|
1764
1764
|
} else {
|
|
1765
|
-
p.log.info(`Creating project "${
|
|
1766
|
-
target = { kind: "new", name
|
|
1765
|
+
p.log.info(`Creating project "${name}" (no project matches this app \u2014 pass --project-id to use an existing one).`);
|
|
1766
|
+
target = { kind: "new", name };
|
|
1767
1767
|
}
|
|
1768
1768
|
} else {
|
|
1769
1769
|
const NEW = "__new__";
|
|
@@ -2185,7 +2185,7 @@ async function maybeOfferConnect(credentials, options, _consoleBase) {
|
|
|
2185
2185
|
if (p.isCancel(answer) || !answer) return;
|
|
2186
2186
|
const endpoint = resolveCloudEndpoint(options.endpoint);
|
|
2187
2187
|
try {
|
|
2188
|
-
const { runConnect } = await import("./connect-
|
|
2188
|
+
const { runConnect } = await import("./connect-ZVMQIYBI.js");
|
|
2189
2189
|
const saved = loadConfig();
|
|
2190
2190
|
const result = await runConnect(
|
|
2191
2191
|
{
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
requireConfig,
|
|
9
9
|
requireUuid,
|
|
10
10
|
tryLoadWorkerKey
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4Z5MWQS5.js";
|
|
12
12
|
import {
|
|
13
13
|
MUSHI_CLI_VERSION
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-UWPIVVCG.js";
|
|
15
15
|
|
|
16
16
|
// src/worker/daemon.ts
|
|
17
17
|
import { existsSync as existsSync6, readFileSync as readFileSync5 } from "fs";
|
|
@@ -1483,9 +1483,9 @@ async function installDeps(wt, log) {
|
|
|
1483
1483
|
const cmd = installCommand((f) => existsSync2(join4(wt, f)));
|
|
1484
1484
|
if (!cmd) return;
|
|
1485
1485
|
log(` deps: ${cmd[0]} ${cmd[1][0]} (so the agent can run tests and the commit hooks work)`);
|
|
1486
|
-
const spawnable = windowsInstaller(cmd, process.platform, process.execPath, existsSync2);
|
|
1486
|
+
const spawnable = windowsInstaller(cmd, process.platform, process.execPath, existsSync2, (process.env["PATH"] ?? "").split(";"));
|
|
1487
1487
|
if (!spawnable) {
|
|
1488
|
-
log(` deps: no ${cmd[0]}
|
|
1488
|
+
log(` deps: no ${cmd[0]} found next to this Node or on PATH, so no install; the agent works without dependencies (install it: npm i -g ${cmd[0]})`);
|
|
1489
1489
|
return;
|
|
1490
1490
|
}
|
|
1491
1491
|
const [bin, args] = spawnable;
|
|
@@ -1498,10 +1498,16 @@ var WINDOWS_PM_SCRIPTS = {
|
|
|
1498
1498
|
pnpm: ["node_modules/pnpm/bin/pnpm.cjs", "node_modules/corepack/dist/pnpm.js"],
|
|
1499
1499
|
yarn: ["node_modules/yarn/bin/yarn.js", "node_modules/corepack/dist/yarn.js"]
|
|
1500
1500
|
};
|
|
1501
|
-
function windowsInstaller(cmd, platform, nodeExe, hasFile) {
|
|
1501
|
+
function windowsInstaller(cmd, platform, nodeExe, hasFile, pathDirs = []) {
|
|
1502
1502
|
if (platform !== "win32") return cmd;
|
|
1503
|
-
const
|
|
1504
|
-
|
|
1503
|
+
const dirs = [win32.dirname(nodeExe), ...pathDirs.map((d) => d.trim().replace(/^"|"$/g, "")).filter(Boolean)];
|
|
1504
|
+
for (const dir of dirs) {
|
|
1505
|
+
const script = (WINDOWS_PM_SCRIPTS[cmd[0]] ?? []).map((rel) => win32.join(dir, rel)).find((p) => hasFile(p));
|
|
1506
|
+
if (script) return [nodeExe, [script, ...cmd[1]]];
|
|
1507
|
+
const exe = win32.join(dir, `${cmd[0]}.exe`);
|
|
1508
|
+
if (hasFile(exe)) return [exe, cmd[1]];
|
|
1509
|
+
}
|
|
1510
|
+
return null;
|
|
1505
1511
|
}
|
|
1506
1512
|
function isMissingModuleFailure(message) {
|
|
1507
1513
|
return /ERR_MODULE_NOT_FOUND|Cannot find (package|module)/.test(message);
|
|
@@ -1613,7 +1619,7 @@ function registerWorkCommands(program) {
|
|
|
1613
1619
|
if (opts.repoDir || opts.report || opts.followups || opts.recheck) {
|
|
1614
1620
|
throw new MushiCliError("E_INVALID_INPUT", "--daemon takes its lanes and clones from the worker config, not from --repo-dir, --report or --followups.", "mushi worker install");
|
|
1615
1621
|
}
|
|
1616
|
-
const { runDaemon: runDaemon2 } = await import("./daemon-
|
|
1622
|
+
const { runDaemon: runDaemon2 } = await import("./daemon-FM6M7TKK.js");
|
|
1617
1623
|
await runDaemon2({ configPath: opts.workerConfig, ...opts.agent !== void 0 ? { agent } : {}, ...opts.anyRepo ? { anyRepo: true } : {} });
|
|
1618
1624
|
return;
|
|
1619
1625
|
}
|
|
@@ -2579,6 +2585,8 @@ function createDaemon(cfg, deps) {
|
|
|
2579
2585
|
host: { ...deps.host, takes: deps.freshEyes ? ["fresh_eyes"] : [], can: deps.cursorLogin ? ["cursor_login"] : [] },
|
|
2580
2586
|
status: {
|
|
2581
2587
|
state: hostState,
|
|
2588
|
+
// Which coding agent the lanes run, so the console names its account (not always Cursor).
|
|
2589
|
+
agent: deps.agent ?? "cursor",
|
|
2582
2590
|
agents: agents(),
|
|
2583
2591
|
...guards ? { maxAgents: guards.max_agents } : {},
|
|
2584
2592
|
...lastReadings?.memAvailableGb != null ? { memAvailableGb: lastReadings.memAvailableGb } : {},
|
|
@@ -3072,6 +3080,11 @@ function createHostReadings(o) {
|
|
|
3072
3080
|
}
|
|
3073
3081
|
};
|
|
3074
3082
|
}
|
|
3083
|
+
function stopHint(platform) {
|
|
3084
|
+
if (platform === "linux") return "Stop with Ctrl-C or systemctl --user stop mushi-worker.";
|
|
3085
|
+
if (platform === "win32") return "Stop with Ctrl-C, or end its node.exe in Task Manager; `mushi worker revoke` removes it.";
|
|
3086
|
+
return "Stop with Ctrl-C.";
|
|
3087
|
+
}
|
|
3075
3088
|
async function runDaemon(opts = {}) {
|
|
3076
3089
|
const cfg = loadWorkerConfig(opts.configPath);
|
|
3077
3090
|
const agent = opts.agent ?? cfg.agent ?? "cursor";
|
|
@@ -3161,7 +3174,7 @@ async function runDaemon(opts = {}) {
|
|
|
3161
3174
|
});
|
|
3162
3175
|
live.agents = daemon.agents;
|
|
3163
3176
|
onInterrupt((signal) => daemon.shutdown(signal));
|
|
3164
|
-
process.stdout.write(`mushi worker: ${cfg.lanes.length} lane(s) on ${platform}, agent ${agentSpec(agent).label} (${agentSpec(agent).bin}); heartbeat every ${HEARTBEAT_MS / 1e3} s.
|
|
3177
|
+
process.stdout.write(`mushi worker: ${cfg.lanes.length} lane(s) on ${platform}, agent ${agentSpec(agent).label} (${agentSpec(agent).bin}); heartbeat every ${HEARTBEAT_MS / 1e3} s. ${stopHint(process.platform)}
|
|
3165
3178
|
`);
|
|
3166
3179
|
while (!daemon.stopped) {
|
|
3167
3180
|
await daemon.tick().catch((err) => process.stdout.write(`worker: tick failed: ${err instanceof Error ? err.message : String(err)}
|
|
@@ -3208,6 +3221,7 @@ export {
|
|
|
3208
3221
|
assertWorkerKey,
|
|
3209
3222
|
cursorStateFor,
|
|
3210
3223
|
createHostReadings,
|
|
3224
|
+
stopHint,
|
|
3211
3225
|
runDaemon,
|
|
3212
3226
|
registerWorkCommands
|
|
3213
3227
|
};
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
resolveSdkEnvKey,
|
|
4
4
|
runConnect
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KEMUVMO7.js";
|
|
6
6
|
import "./chunk-CG5KPP4S.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-4Z5MWQS5.js";
|
|
8
|
+
import "./chunk-UWPIVVCG.js";
|
|
9
9
|
import "./chunk-LGGE3LH7.js";
|
|
10
10
|
export {
|
|
11
11
|
resolveSdkEnvKey,
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
saveConfig,
|
|
7
7
|
savedSdkKeyFor,
|
|
8
8
|
waitForIngestReady
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3LHOI34N.js";
|
|
10
10
|
import {
|
|
11
11
|
MUSHI_MCP_PIN_SPEC
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5DI4Q5BD.js";
|
|
13
13
|
import {
|
|
14
14
|
detectFramework,
|
|
15
15
|
envVarsToWrite,
|
|
@@ -10,10 +10,11 @@ import {
|
|
|
10
10
|
modelFor,
|
|
11
11
|
readWorkerKey,
|
|
12
12
|
runDaemon,
|
|
13
|
+
stopHint,
|
|
13
14
|
workerHostId
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-ZOBSRRD3.js";
|
|
16
|
+
import "./chunk-4Z5MWQS5.js";
|
|
17
|
+
import "./chunk-UWPIVVCG.js";
|
|
17
18
|
import "./chunk-LGGE3LH7.js";
|
|
18
19
|
export {
|
|
19
20
|
assertWorkerKey,
|
|
@@ -26,5 +27,6 @@ export {
|
|
|
26
27
|
modelFor,
|
|
27
28
|
readWorkerKey,
|
|
28
29
|
runDaemon,
|
|
30
|
+
stopHint,
|
|
29
31
|
workerHostId
|
|
30
32
|
};
|
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
sanitizeEndpoint,
|
|
29
29
|
sanitizeProjectId,
|
|
30
30
|
writeMcpServerEntry
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-KEMUVMO7.js";
|
|
32
32
|
import {
|
|
33
33
|
FRAMEWORKS,
|
|
34
34
|
FRAMEWORK_IDS,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
registerUxCommands,
|
|
60
60
|
registerWorkCommands,
|
|
61
61
|
validateWorkerConfig
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-ZOBSRRD3.js";
|
|
63
63
|
import {
|
|
64
64
|
CONFIG_PATH,
|
|
65
65
|
MushiCliError,
|
|
@@ -99,11 +99,11 @@ import {
|
|
|
99
99
|
tryLoadKeyFromKeychain,
|
|
100
100
|
trySaveKeyToKeychain,
|
|
101
101
|
trySaveWorkerKey
|
|
102
|
-
} from "./chunk-
|
|
102
|
+
} from "./chunk-4Z5MWQS5.js";
|
|
103
103
|
import {
|
|
104
104
|
MUSHI_CLI_VERSION,
|
|
105
105
|
MUSHI_MCP_PIN_SPEC
|
|
106
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-UWPIVVCG.js";
|
|
107
107
|
import {
|
|
108
108
|
CLOUD_API_ENDPOINT,
|
|
109
109
|
CLOUD_MCP_OAUTH_URL,
|
|
@@ -529,10 +529,12 @@ function defaultProjectName(packageName, cwd) {
|
|
|
529
529
|
const parts = cwd.split(/[\\/]/).filter(Boolean);
|
|
530
530
|
return parts[parts.length - 1] || "my-app";
|
|
531
531
|
}
|
|
532
|
-
function chooseProjectNonInteractive(projects, preferredName) {
|
|
532
|
+
function chooseProjectNonInteractive(projects, preferredName, appFolder = true) {
|
|
533
533
|
const wanted = slugify(preferredName);
|
|
534
534
|
const match = projects.find((p5) => slugify(p5.name) === wanted || p5.slug !== void 0 && slugify(p5.slug) === wanted);
|
|
535
|
-
|
|
535
|
+
if (match) return { kind: "existing", id: match.id, name: match.name };
|
|
536
|
+
if (!appFolder && projects.length > 0) return { kind: "ask" };
|
|
537
|
+
return { kind: "new", name: preferredName };
|
|
536
538
|
}
|
|
537
539
|
async function runLogin(opts = {}) {
|
|
538
540
|
const { CLOUD_API_ENDPOINT: CLOUD_API_ENDPOINT2, resolveCloudEndpoint: resolveCloudEndpoint2 } = await import("./endpoint-MJATXOXM.js");
|
|
@@ -629,10 +631,24 @@ error: Could not start login session: ${err instanceof Error ? err.message : Str
|
|
|
629
631
|
} else {
|
|
630
632
|
const { readPackageJson: readPackageJson2 } = await import("./detect-SOXPECZ3.js");
|
|
631
633
|
const cwd = process.cwd();
|
|
634
|
+
const pkg = readPackageJson2(cwd);
|
|
635
|
+
const { existsSync: existsSync9 } = await import("fs");
|
|
636
|
+
const { join: join15 } = await import("path");
|
|
632
637
|
const nonInteractive = chooseProjectNonInteractive(
|
|
633
638
|
projectsList,
|
|
634
|
-
defaultProjectName(
|
|
639
|
+
defaultProjectName(pkg?.name, cwd),
|
|
640
|
+
Boolean(pkg) || existsSync9(join15(cwd, ".git"))
|
|
635
641
|
);
|
|
642
|
+
if (nonInteractive.kind === "ask") {
|
|
643
|
+
process.stderr.write(
|
|
644
|
+
`
|
|
645
|
+
error: This folder is not an app (no package.json or .git), so no project was picked or created.
|
|
646
|
+
Run it again from your app's folder, or name the project:
|
|
647
|
+
` + projectsList.map((p5) => ` mushi login --project-id ${p5.id} # ${p5.name}
|
|
648
|
+
`).join("")
|
|
649
|
+
);
|
|
650
|
+
process.exit(2);
|
|
651
|
+
}
|
|
636
652
|
choice = nonInteractive.kind === "existing" ? { kind: "picked", id: nonInteractive.id, name: nonInteractive.name } : { kind: "create", name: nonInteractive.name };
|
|
637
653
|
console.log(
|
|
638
654
|
choice.kind === "picked" ? ` Using project "${choice.name}" (matches this folder \u2014 pass --project-id to pick another).` : ` Creating project "${choice.name}" (no project matches this folder \u2014 pass --project-id to use an existing one).`
|
|
@@ -1623,7 +1639,7 @@ async function checkOnboardingStatus(config, _consoleBase, cwd, doFetch = global
|
|
|
1623
1639
|
}
|
|
1624
1640
|
async function checkVersionDrift(cwd, doFetch) {
|
|
1625
1641
|
const checks = [];
|
|
1626
|
-
const { MUSHI_CLI_VERSION: MUSHI_CLI_VERSION2 } = await import("./version-
|
|
1642
|
+
const { MUSHI_CLI_VERSION: MUSHI_CLI_VERSION2 } = await import("./version-XXSOPUQR.js");
|
|
1627
1643
|
if (MUSHI_CLI_VERSION2 === "0.0.0-dev") return checks;
|
|
1628
1644
|
const parse2 = (v) => {
|
|
1629
1645
|
const m = v.replace(/^[~^]/, "").match(/^(\d+)\.(\d+)\.(\d+)/);
|
|
@@ -2211,16 +2227,14 @@ async function runBrowserSignIn(options, endpoint, consoleBase, preset) {
|
|
|
2211
2227
|
}
|
|
2212
2228
|
if (!isInteractive()) {
|
|
2213
2229
|
const cwd = options.cwd ?? process.cwd();
|
|
2214
|
-
const
|
|
2215
|
-
|
|
2216
|
-
defaultProjectName(readPackageJson(cwd)?.name, cwd)
|
|
2217
|
-
);
|
|
2230
|
+
const name = defaultProjectName(readPackageJson(cwd)?.name, cwd);
|
|
2231
|
+
const choice = chooseProjectNonInteractive(projects, name);
|
|
2218
2232
|
if (choice.kind === "existing") {
|
|
2219
2233
|
p.log.info(`Using project "${choice.name}" (matches this app \u2014 pass --project-id to pick another).`);
|
|
2220
2234
|
target = { kind: "existing", projectId: choice.id };
|
|
2221
2235
|
} else {
|
|
2222
|
-
p.log.info(`Creating project "${
|
|
2223
|
-
target = { kind: "new", name
|
|
2236
|
+
p.log.info(`Creating project "${name}" (no project matches this app \u2014 pass --project-id to use an existing one).`);
|
|
2237
|
+
target = { kind: "new", name };
|
|
2224
2238
|
}
|
|
2225
2239
|
} else {
|
|
2226
2240
|
const NEW = "__new__";
|
|
@@ -2642,7 +2656,7 @@ async function maybeOfferConnect(credentials, options, _consoleBase) {
|
|
|
2642
2656
|
if (p.isCancel(answer) || !answer) return;
|
|
2643
2657
|
const endpoint = resolveCloudEndpoint(options.endpoint);
|
|
2644
2658
|
try {
|
|
2645
|
-
const { runConnect: runConnect2 } = await import("./connect-
|
|
2659
|
+
const { runConnect: runConnect2 } = await import("./connect-B2ZZPVWI.js");
|
|
2646
2660
|
const saved = loadConfig();
|
|
2647
2661
|
const result = await runConnect2(
|
|
2648
2662
|
{
|
|
@@ -14143,7 +14157,7 @@ Verified merge. Docs: https://kensaur.us/mushi-mushi/docs/admin/verified-merge`)
|
|
|
14143
14157
|
}
|
|
14144
14158
|
|
|
14145
14159
|
// src/commands/worker.ts
|
|
14146
|
-
import { execFileSync as execFileSync4, spawnSync as spawnSync4 } from "child_process";
|
|
14160
|
+
import { execFileSync as execFileSync4, spawn as spawn2, spawnSync as spawnSync4 } from "child_process";
|
|
14147
14161
|
import { chmodSync as chmodSync2, existsSync as existsSync7, mkdirSync as mkdirSync4, readFileSync as readFileSync9, realpathSync as realpathSync2, rmSync as rmSync2, writeFileSync as writeFileSync8 } from "fs";
|
|
14148
14162
|
import { homedir, hostname } from "os";
|
|
14149
14163
|
import { dirname as dirname6, join as join13, resolve as resolve10 } from "path";
|
|
@@ -14251,9 +14265,32 @@ function windowsTaskArgs(o) {
|
|
|
14251
14265
|
const run = [o.node, o.cli, "work", "--daemon", ...o.configPath ? ["--worker-config", o.configPath] : []].map((a) => /\s/.test(a) ? `"${a}"` : a).join(" ");
|
|
14252
14266
|
return ["/Create", "/TN", WINDOWS_TASK_NAME, "/SC", "ONLOGON", "/RL", "LIMITED", "/F", "/TR", run];
|
|
14253
14267
|
}
|
|
14268
|
+
var WINDOWS_STARTUP_FILE = "Mushi worker.vbs";
|
|
14269
|
+
function windowsWorkerLogPath(home) {
|
|
14270
|
+
return join12(home, ".cache", "mushi-work", "logs", "worker.log");
|
|
14271
|
+
}
|
|
14272
|
+
function windowsStartupScript(o) {
|
|
14273
|
+
const run = [o.node, o.cli, "work", "--daemon", ...o.configPath ? ["--worker-config", o.configPath] : []].map((a) => `"${a}"`).join(" ");
|
|
14274
|
+
const line = `cmd /c "${run} >> "${o.log}" 2>&1"`;
|
|
14275
|
+
return `' Mushi local worker (mushi work --daemon), started hidden at logon.\r
|
|
14276
|
+
CreateObject("WScript.Shell").Run "${line.replace(/"/g, '""')}", 0, False\r
|
|
14277
|
+
`;
|
|
14278
|
+
}
|
|
14254
14279
|
|
|
14255
14280
|
// src/commands/worker.ts
|
|
14256
14281
|
var UNIT_PATH = join13(process.env["XDG_CONFIG_HOME"] || join13(homedir(), ".config"), "systemd", "user", SYSTEMD_UNIT_NAME);
|
|
14282
|
+
function windowsStartupPath() {
|
|
14283
|
+
return join13(process.env["APPDATA"] || join13(homedir(), "AppData", "Roaming"), "Microsoft", "Windows", "Start Menu", "Programs", "Startup", WINDOWS_STARTUP_FILE);
|
|
14284
|
+
}
|
|
14285
|
+
function installWindowsStartup(node, cli) {
|
|
14286
|
+
const log3 = windowsWorkerLogPath(homedir());
|
|
14287
|
+
const file = windowsStartupPath();
|
|
14288
|
+
mkdirSync4(dirname6(log3), { recursive: true });
|
|
14289
|
+
mkdirSync4(dirname6(file), { recursive: true });
|
|
14290
|
+
writeFileSync8(file, windowsStartupScript({ node, cli, log: log3 }));
|
|
14291
|
+
spawn2("wscript.exe", [file], { detached: true, stdio: "ignore", windowsHide: true }).unref();
|
|
14292
|
+
console.log(`The scheduled task needs administrator rights here, so the worker starts from your Startup folder instead (${file}). It is running now; its log is ${log3}.`);
|
|
14293
|
+
}
|
|
14257
14294
|
function laneDone(l) {
|
|
14258
14295
|
if (l.config.mode === "conflicts") return l.counts7d.merges ?? 0;
|
|
14259
14296
|
if (l.config.mode === "audit") return l.counts7d.filed ?? 0;
|
|
@@ -14376,7 +14413,8 @@ Service: not automated on ${platform}; run \`mushi work --daemon\` under your se
|
|
|
14376
14413
|
console.log(enable.status === 0 ? `Started ${SYSTEMD_UNIT_NAME}. Logs: journalctl --user -u ${SYSTEMD_UNIT_NAME} -f` : `Wrote ${UNIT_PATH}; start it with: systemctl --user enable --now ${SYSTEMD_UNIT_NAME}`);
|
|
14377
14414
|
} else if (service?.kind === "task") {
|
|
14378
14415
|
const r = spawnSync4("schtasks", service.args, { stdio: "inherit" });
|
|
14379
|
-
|
|
14416
|
+
if (r.status === 0) console.log(`Created the scheduled task "${WINDOWS_TASK_NAME}"; it starts at your next logon.`);
|
|
14417
|
+
else installWindowsStartup(node, cli0);
|
|
14380
14418
|
}
|
|
14381
14419
|
console.log("The console shows this worker on Pipeline \u2192 Workers within a minute of its first heartbeat.");
|
|
14382
14420
|
});
|
|
@@ -14395,7 +14433,7 @@ Service: not automated on ${platform}; run \`mushi work --daemon\` under your se
|
|
|
14395
14433
|
execFileSync4("schtasks", ["/Query", "/TN", WINDOWS_TASK_NAME], { stdio: "ignore" });
|
|
14396
14434
|
return "scheduled";
|
|
14397
14435
|
} catch {
|
|
14398
|
-
return "not installed";
|
|
14436
|
+
return existsSync7(windowsStartupPath()) ? "startup folder" : "not installed";
|
|
14399
14437
|
}
|
|
14400
14438
|
})() : "unknown";
|
|
14401
14439
|
const conf = requireConfig();
|
|
@@ -14471,7 +14509,10 @@ ${"lane".padEnd(16)} ${"app".padEnd(16)} ${"mode".padEnd(10)} ${"state".padEnd(1
|
|
|
14471
14509
|
tryDeleteWorkerKey();
|
|
14472
14510
|
if (existsSync7(WORKER_KEY_PATH)) rmSync2(WORKER_KEY_PATH);
|
|
14473
14511
|
if (process.platform === "linux") spawnSync4("systemctl", ["--user", "disable", "--now", SYSTEMD_UNIT_NAME], { stdio: "inherit" });
|
|
14474
|
-
if (process.platform === "win32")
|
|
14512
|
+
if (process.platform === "win32") {
|
|
14513
|
+
spawnSync4("schtasks", ["/Delete", "/TN", WINDOWS_TASK_NAME, "/F"], { stdio: "inherit" });
|
|
14514
|
+
if (existsSync7(windowsStartupPath())) rmSync2(windowsStartupPath());
|
|
14515
|
+
}
|
|
14475
14516
|
console.log(`Removed the key from this machine. The lanes file (${WORKER_CONFIG_PATH}) is kept; delete it if you do not need it.`);
|
|
14476
14517
|
});
|
|
14477
14518
|
}
|
package/dist/init.js
CHANGED
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
sampleBugSnippet,
|
|
14
14
|
sanitizeSecret,
|
|
15
15
|
snippetTarget
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MNIFWCTR.js";
|
|
17
17
|
import "./chunk-LFP3NPZT.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-3LHOI34N.js";
|
|
19
|
+
import "./chunk-5DI4Q5BD.js";
|
|
20
20
|
import "./chunk-AWASJDQI.js";
|
|
21
21
|
import "./chunk-2DMHQVRU.js";
|
|
22
22
|
export {
|
package/dist/version.d.ts
CHANGED
|
@@ -14,6 +14,6 @@ declare const MUSHI_CLI_VERSION: string;
|
|
|
14
14
|
* setup refreshes the pin. Synced to packages/mcp/package.json by
|
|
15
15
|
* `scripts/sync-mcp-pin.mjs` — never hand-edit the version.
|
|
16
16
|
*/
|
|
17
|
-
declare const MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.31.
|
|
17
|
+
declare const MUSHI_MCP_PIN_SPEC = "@mushi-mushi/mcp@0.31.7";
|
|
18
18
|
|
|
19
19
|
export { MUSHI_CLI_VERSION, MUSHI_MCP_PIN_SPEC };
|
package/dist/version.js
CHANGED
package/dist/wizard-bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runInit
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MNIFWCTR.js";
|
|
4
4
|
import {
|
|
5
5
|
FLAGS_HELP,
|
|
6
6
|
UNKNOWN_COMMAND_EXIT,
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
scaffoldTemplate
|
|
12
12
|
} from "./chunk-4JF7C3MY.js";
|
|
13
13
|
import "./chunk-LFP3NPZT.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-3LHOI34N.js";
|
|
15
|
+
import "./chunk-5DI4Q5BD.js";
|
|
16
16
|
import "./chunk-AWASJDQI.js";
|
|
17
17
|
import "./chunk-2DMHQVRU.js";
|
|
18
18
|
|
package/package.json
CHANGED
package/dist/chunk-MEQSUWI4.js
DELETED