mtech-ai-local-runner 0.1.0 → 0.1.2

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 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.0",
206
+ displayName: runnerDisplayName(), packageVersion: "0.1.2",
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
- if (import.meta.url === `file://${process.argv[1]}`) {
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
  });
@@ -30,7 +30,7 @@ export class LaunchdService {
30
30
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
31
31
  <plist version="1.0"><dict>
32
32
  <key>Label</key><string>${LAUNCHD_LABEL}</string>
33
- <key>ProgramArguments</key><array><string>${xml(executablePath)}</string><string>run</string><string>--state-root=${xml(stateRoot)}</string></array>
33
+ <key>ProgramArguments</key><array><string>${xml(process.execPath)}</string><string>${xml(executablePath)}</string><string>run</string><string>--state-root=${xml(stateRoot)}</string></array>
34
34
  <key>RunAtLoad</key><true/><key>KeepAlive</key><true/>
35
35
  <key>ProcessType</key><string>Background</string>
36
36
  </dict></plist>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mtech-ai-local-runner",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "bin": {"mtec-ai-local-runner": "dist/src/cli.js"},