mtech-ai-local-runner 0.1.0 → 0.1.1
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/src/cli.js +14 -3
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { mkdirSync, writeFileSync, chmodSync, unlinkSync } from "node:fs";
|
|
2
|
+
import { mkdirSync, writeFileSync, chmodSync, unlinkSync, realpathSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
4
5
|
import { loadConfig, redact, isAuthConfig, isExecutionConfig, isServiceConfig } from "./config.js";
|
|
5
6
|
import { McpGatewayClient } from "./gateway-client.js";
|
|
6
7
|
import { Runner } from "./runner.js";
|
|
@@ -202,7 +203,7 @@ export async function main(argv, env, io = {}) {
|
|
|
202
203
|
const authenticated = await runFile(binary, ["auth", "status"], { encoding: "utf8" }).then(() => true).catch(() => false);
|
|
203
204
|
const registered = await gateway.registerLocalRunner({
|
|
204
205
|
deviceFingerprint: createHash("sha256").update(`${process.getuid?.() ?? 0}|${runnerDisplayName()}|${config.gatewayMcpUrl}`).digest("hex"),
|
|
205
|
-
displayName: runnerDisplayName(), packageVersion: "0.1.
|
|
206
|
+
displayName: runnerDisplayName(), packageVersion: "0.1.1",
|
|
206
207
|
capabilities: [{ adapter: "claude_code_cli", version: "1", capabilities: ["repository_read", "repository_edit", "shell_test", "git_diff"], authenticated }],
|
|
207
208
|
});
|
|
208
209
|
await localStore.save({ schemaVersion: 1, gatewayMcpUrl: config.gatewayMcpUrl, runnerId: registered.runner.id, workspaceRoot: config.workspaceRoot, concurrency: 1 });
|
|
@@ -381,7 +382,17 @@ export async function main(argv, env, io = {}) {
|
|
|
381
382
|
}
|
|
382
383
|
}
|
|
383
384
|
}
|
|
384
|
-
|
|
385
|
+
export function isDirectCliInvocation(moduleUrl, argvPath) {
|
|
386
|
+
if (!argvPath)
|
|
387
|
+
return false;
|
|
388
|
+
try {
|
|
389
|
+
return realpathSync(fileURLToPath(moduleUrl)) === realpathSync(argvPath);
|
|
390
|
+
}
|
|
391
|
+
catch {
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
if (isDirectCliInvocation(import.meta.url, process.argv[1])) {
|
|
385
396
|
main(process.argv.slice(2), process.env).then((code) => {
|
|
386
397
|
process.exitCode = code;
|
|
387
398
|
});
|