@memohai/cloud-runtime 2026.9.14-2 → 2026.9.16-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.
Files changed (2) hide show
  1. package/dist/cli.mjs +29 -19
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // @memohai/cloud-runtime 2026.9.14-2 — bundles @memohai/runtime 0.19.0 (memoh fc40be07)
2
+ // @memohai/cloud-runtime 2026.9.16-1 — bundles @memohai/runtime 0.20.0 (memoh 54c3e074)
3
3
  import { createRequire as __memohCreateRequire } from 'node:module'
4
4
  const require = __memohCreateRequire(import.meta.url)
5
5
  var __create = Object.create;
@@ -27894,9 +27894,9 @@ var require_src3 = __commonJS({
27894
27894
  });
27895
27895
 
27896
27896
  // src/build-info.ts
27897
- var cloudRuntimeVersion = true ? "2026.9.14-2" : unknownStamp;
27898
- var upstreamRuntimeVersion = true ? "0.19.0" : unknownStamp;
27899
- var upstreamRuntimeCommit = true ? "fc40be07" : unknownStamp;
27897
+ var cloudRuntimeVersion = true ? "2026.9.16-1" : unknownStamp;
27898
+ var upstreamRuntimeVersion = true ? "0.20.0" : unknownStamp;
27899
+ var upstreamRuntimeCommit = true ? "54c3e074" : unknownStamp;
27900
27900
  function versionReport() {
27901
27901
  return [
27902
27902
  `@memohai/cloud-runtime ${cloudRuntimeVersion}`,
@@ -27965,19 +27965,20 @@ applyCloudDefaults(args, process.env);
27965
27965
  // ../memoh/packages/runtime/src/cli-main.ts
27966
27966
  import { access as access5, appendFile, mkdir as mkdir4 } from "node:fs/promises";
27967
27967
  import { homedir as homedir2 } from "node:os";
27968
- import { dirname as dirname6, join as join6, resolve as resolve4 } from "node:path";
27968
+ import { dirname as dirname6, join as join7, resolve as resolve4 } from "node:path";
27969
27969
  import { fileURLToPath as fileURLToPath2 } from "node:url";
27970
27970
  import { parseArgs } from "node:util";
27971
27971
 
27972
27972
  // ../memoh/packages/runtime/src/daemon/index.ts
27973
27973
  import { access as access2, stat } from "node:fs/promises";
27974
27974
  import { constants as constants2 } from "node:fs";
27975
- import { isAbsolute as isAbsolute2, join as join3 } from "node:path";
27975
+ import { isAbsolute as isAbsolute2, join as join4 } from "node:path";
27976
27976
  import { setTimeout as sleep2 } from "node:timers/promises";
27977
27977
 
27978
27978
  // ../memoh/packages/runtime/src/daemon/launchd.ts
27979
27979
  import { access, rm as rm2 } from "node:fs/promises";
27980
27980
  import { setTimeout as sleep } from "node:timers/promises";
27981
+ import { join as join3 } from "node:path";
27981
27982
 
27982
27983
  // ../memoh/packages/runtime/src/runtime-config.ts
27983
27984
  import { lstat as lstat2 } from "node:fs/promises";
@@ -28441,7 +28442,7 @@ var launchdLabel = "ai.memoh.runtime";
28441
28442
  var bootstrapAttempts = 5;
28442
28443
  var defaultBootstrapRetryDelayMs = 300;
28443
28444
  var bootoutWaitAttempts = 50;
28444
- function renderLaunchdPlist(spec) {
28445
+ function renderLaunchdPlist(spec, launcherPath) {
28445
28446
  return `<?xml version="1.0" encoding="UTF-8"?>
28446
28447
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
28447
28448
  <plist version="1.0">
@@ -28450,8 +28451,7 @@ function renderLaunchdPlist(spec) {
28450
28451
  <string>${xmlEscape(launchdLabel)}</string>
28451
28452
  <key>ProgramArguments</key>
28452
28453
  <array>
28453
- <string>${xmlEscape(spec.nodePath)}</string>
28454
- <string>${xmlEscape(spec.entryPath)}</string>
28454
+ <string>${xmlEscape(launcherPath)}</string>
28455
28455
  <string>run</string>
28456
28456
  <string>--config</string>
28457
28457
  <string>${xmlEscape(spec.configPath)}</string>
@@ -28481,6 +28481,7 @@ function createLaunchdServiceManager(paths, runner, uid, options = {}) {
28481
28481
  const launchctl = "/bin/launchctl";
28482
28482
  const domain = `gui/${uid}`;
28483
28483
  const target = `${domain}/${launchdLabel}`;
28484
+ const launcherPath = join3(paths.serviceDir, "Memoh Runtime");
28484
28485
  const retryDelayMs = options.bootstrapRetryDelayMs ?? defaultBootstrapRetryDelayMs;
28485
28486
  const loaded = async () => (await runner(launchctl, ["print", target])).code === 0;
28486
28487
  const bootstrap = async () => {
@@ -28509,7 +28510,11 @@ function createLaunchdServiceManager(paths, runner, uid, options = {}) {
28509
28510
  backend: "launchd-user",
28510
28511
  async register(spec) {
28511
28512
  await ensureDirectory(spec.logsDir);
28512
- await writeFileAtomic(paths.launchdPlistPath, renderLaunchdPlist(spec), 384);
28513
+ const launcher = `#!/bin/sh
28514
+ exec ${shellQuote(spec.nodePath)} ${shellQuote(spec.entryPath)} "$@"
28515
+ `;
28516
+ await writeFileAtomic(launcherPath, launcher, 448);
28517
+ await writeFileAtomic(paths.launchdPlistPath, renderLaunchdPlist(spec, launcherPath), 384);
28513
28518
  await requireCommand(runner, "/usr/bin/plutil", ["-lint", paths.launchdPlistPath]);
28514
28519
  },
28515
28520
  async start() {
@@ -28536,9 +28541,14 @@ function createLaunchdServiceManager(paths, runner, uid, options = {}) {
28536
28541
  async uninstall() {
28537
28542
  await bootout();
28538
28543
  await rm2(paths.launchdPlistPath, { force: true });
28544
+ await rm2(launcherPath, { force: true });
28539
28545
  }
28540
28546
  };
28541
28547
  }
28548
+ function shellQuote(value) {
28549
+ if (value.includes("\0")) throw new Error("launchd service value contains a null byte");
28550
+ return `'${value.replaceAll("'", "'\\''")}'`;
28551
+ }
28542
28552
  function xmlEscape(value) {
28543
28553
  if (value.includes("\0")) throw new Error("launchd service value contains a null byte");
28544
28554
  return value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&apos;");
@@ -28773,7 +28783,7 @@ function createRuntimeServiceManager(options) {
28773
28783
  async function findNodeExecutable(envPath, platform2) {
28774
28784
  for (const directory of envPath?.split(platform2 === "win32" ? ";" : ":") ?? []) {
28775
28785
  if (!isAbsolute2(directory)) continue;
28776
- const path = join3(directory, platform2 === "win32" ? "node.exe" : "node");
28786
+ const path = join4(directory, platform2 === "win32" ? "node.exe" : "node");
28777
28787
  try {
28778
28788
  if (!(await stat(path)).isFile()) continue;
28779
28789
  await access2(path, platform2 === "win32" ? constants2.R_OK : constants2.X_OK);
@@ -28798,7 +28808,7 @@ async function waitForService(manager, target) {
28798
28808
 
28799
28809
  // ../memoh/packages/runtime/src/enrollment-lock.ts
28800
28810
  import { mkdir as mkdir2, rm as rm5 } from "node:fs/promises";
28801
- import { dirname as dirname3, join as join4 } from "node:path";
28811
+ import { dirname as dirname3, join as join5 } from "node:path";
28802
28812
  import { setTimeout as sleep3 } from "node:timers/promises";
28803
28813
  async function withEnrollmentLock(configPath, action, timeoutMs = 3e4) {
28804
28814
  await ensureDirectory(dirname3(configPath));
@@ -28818,7 +28828,7 @@ async function withEnrollmentLock(configPath, action, timeoutMs = 3e4) {
28818
28828
  }
28819
28829
  try {
28820
28830
  if (process.platform === "win32") await protectWindowsDirectory(lockPath);
28821
- await writeFileAtomic(join4(lockPath, "owner.json"), `${JSON.stringify({ pid: process.pid })}
28831
+ await writeFileAtomic(join5(lockPath, "owner.json"), `${JSON.stringify({ pid: process.pid })}
28822
28832
  `, 384);
28823
28833
  return await action();
28824
28834
  } finally {
@@ -29554,7 +29564,7 @@ import {
29554
29564
  stat as stat2,
29555
29565
  unlink
29556
29566
  } from "node:fs/promises";
29557
- import { basename, dirname as dirname4, join as join5, relative, sep } from "node:path";
29567
+ import { basename, dirname as dirname4, join as join6, relative, sep } from "node:path";
29558
29568
  var binaryProbeBytes = 8 * 1024;
29559
29569
  var readMaxLines = 2e3;
29560
29570
  var listMaxEntries = 200;
@@ -29613,7 +29623,7 @@ var WorkspaceFileService = class {
29613
29623
  async writeFile(request) {
29614
29624
  const requested = requiredPath(request.path);
29615
29625
  const target = await this.paths.prepareWrite(requested);
29616
- const temporary = join5(
29626
+ const temporary = join6(
29617
29627
  dirname4(target),
29618
29628
  `.${basename(target)}.tmp-${randomBytes(8).toString("hex")}`
29619
29629
  );
@@ -29742,7 +29752,7 @@ var WorkspaceFileService = class {
29742
29752
  children.sort((left, right) => compareGoFilenames(left.name, right.name));
29743
29753
  const entries = [];
29744
29754
  for (const child of children) {
29745
- const target = join5(directory, child.name);
29755
+ const target = join6(directory, child.name);
29746
29756
  try {
29747
29757
  const info = await lstat3(target);
29748
29758
  entries.push(fileEntry(child.name, info));
@@ -29762,7 +29772,7 @@ var WorkspaceFileService = class {
29762
29772
  }
29763
29773
  children.sort((left, right) => compareGoFilenames(left.name, right.name));
29764
29774
  for (const child of children) {
29765
- const target = join5(current, child.name);
29775
+ const target = join6(current, child.name);
29766
29776
  try {
29767
29777
  const info = await lstat3(target);
29768
29778
  const name = relative(directory, target).split(sep).join("/");
@@ -30338,7 +30348,7 @@ async function locateBridgeProto() {
30338
30348
  // ../memoh/packages/runtime/package.json
30339
30349
  var package_default = {
30340
30350
  name: "@memohai/runtime",
30341
- version: "0.19.0",
30351
+ version: "0.20.0",
30342
30352
  repository: {
30343
30353
  type: "git",
30344
30354
  url: "git+https://github.com/felinics/Memoh.git",
@@ -30820,7 +30830,7 @@ async function service(args2, context) {
30820
30830
  case "install": {
30821
30831
  const nodePath = await findNodeExecutable(context.env.PATH, context.platform);
30822
30832
  await access5(context.entryPath);
30823
- await access5(join6(dirname6(context.entryPath), "bridge.proto"));
30833
+ await access5(join7(dirname6(context.entryPath), "bridge.proto"));
30824
30834
  await manager.stop();
30825
30835
  await waitForService(manager, "stopped");
30826
30836
  await manager.register({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memohai/cloud-runtime",
3
- "version": "2026.9.14-2",
3
+ "version": "2026.9.16-1",
4
4
  "description": "Memoh Cloud Remote Runtime CLI — connects a local machine to Memoh Cloud",
5
5
  "repository": {
6
6
  "type": "git",