agentroam 0.2.0-preview.27 → 0.2.0-preview.29

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.
@@ -49,7 +49,7 @@ export class MacLaunchAgent {
49
49
  await chmod(paths.plistPath, 0o600);
50
50
  await writePrivateJson(paths.configPath, config);
51
51
  await Promise.all([removeIfExists(paths.statePath), removeIfExists(paths.urlPath)]);
52
- await this.runRequired("launchctl", ["bootstrap", this.domainTarget, paths.plistPath]);
52
+ await this.bootstrap(paths.plistPath);
53
53
  }
54
54
  finally {
55
55
  await Promise.all([removeIfExists(jsonPath), removeIfExists(plistTempPath)]);
@@ -65,7 +65,7 @@ export class MacLaunchAgent {
65
65
  if (status.loaded)
66
66
  await this.runRequired("launchctl", ["kickstart", this.serviceTarget]);
67
67
  else
68
- await this.runRequired("launchctl", ["bootstrap", this.domainTarget, status.definition]);
68
+ await this.bootstrap(status.definition);
69
69
  const paths = resolveServicePaths(this.homeDir, status.config?.dataDir);
70
70
  return this.waitForReady(paths, status.state?.pid);
71
71
  }
@@ -126,7 +126,7 @@ export class MacLaunchAgent {
126
126
  if (status.loaded)
127
127
  await this.runRequired("launchctl", ["kickstart", "-k", this.serviceTarget]);
128
128
  else
129
- await this.runRequired("launchctl", ["bootstrap", this.domainTarget, status.definition]);
129
+ await this.bootstrap(status.definition);
130
130
  const paths = resolveServicePaths(this.homeDir, status.config?.dataDir);
131
131
  return this.waitForReady(paths, status.state?.pid);
132
132
  }
@@ -162,6 +162,10 @@ export class MacLaunchAgent {
162
162
  running: result.code === 0 && /\bstate\s*=\s*running\b/.test(result.stdout),
163
163
  };
164
164
  }
165
+ async bootstrap(definition) {
166
+ await this.runRequired("launchctl", ["enable", this.serviceTarget]);
167
+ await this.runRequired("launchctl", ["bootstrap", this.domainTarget, definition]);
168
+ }
165
169
  async runRequired(command, args) {
166
170
  const result = await this.runner(command, args);
167
171
  if (result.code !== 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentroam",
3
- "version": "0.2.0-preview.27",
3
+ "version": "0.2.0-preview.29",
4
4
  "description": "Zero-install mobile remote terminal and file console",
5
5
  "type": "module",
6
6
  "bin": {
@@ -26,12 +26,12 @@
26
26
  "undici": "^6.25.0"
27
27
  },
28
28
  "optionalDependencies": {
29
- "agentroam-runtime-darwin-arm64": "0.2.0-preview.27",
30
- "agentroam-runtime-win32-x64": "0.2.0-preview.27",
31
- "agentroam-cloudflared-darwin-arm64": "0.2.0-preview.27",
32
- "agentroam-cloudflared-win32-x64": "0.2.0-preview.27",
33
- "agentroam-tui-darwin-arm64": "0.2.0-preview.27",
34
- "@caoqu/agentroam-tui-win32-x64": "0.2.0-preview.27"
29
+ "agentroam-runtime-darwin-arm64": "0.2.0-preview.29",
30
+ "agentroam-runtime-win32-x64": "0.2.0-preview.29",
31
+ "agentroam-cloudflared-darwin-arm64": "0.2.0-preview.29",
32
+ "agentroam-cloudflared-win32-x64": "0.2.0-preview.29",
33
+ "agentroam-tui-darwin-arm64": "0.2.0-preview.29",
34
+ "@caoqu/agentroam-tui-win32-x64": "0.2.0-preview.29"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "^22.0.0",