neoagent 2.3.1-beta.84 → 2.3.1-beta.86

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.
@@ -19,8 +19,8 @@ function getEffectiveDefaults() {
19
19
  }
20
20
 
21
21
  const BASE_FALLBACK_SETTINGS = Object.freeze({
22
- runtime_profile: 'trusted-host',
23
- runtime_backend: 'host',
22
+ runtime_profile: 'secure-vm',
23
+ runtime_backend: 'vm',
24
24
  browser_backend: 'vm',
25
25
  android_backend: 'host',
26
26
  mcp_backend: 'host-remote',
@@ -36,15 +36,10 @@ function normalizeChoice(value, allowed, fallback) {
36
36
  function deriveDefaultsForProfile(profile) {
37
37
  switch (profile) {
38
38
  case 'secure-vm':
39
- return {
40
- runtime_backend: 'vm',
41
- browser_backend: 'vm',
42
- android_backend: 'vm',
43
- };
44
39
  case 'trusted-host':
45
40
  default:
46
41
  return {
47
- runtime_backend: 'host',
42
+ runtime_backend: 'vm',
48
43
  browser_backend: 'vm',
49
44
  android_backend: 'host',
50
45
  };
@@ -56,14 +51,14 @@ function normalizeRuntimeSettings(raw = {}) {
56
51
  const defaults = getEffectiveDefaults();
57
52
  const profile = normalizeChoice(raw.runtime_profile, ['secure-vm', 'trusted-host'], defaults.runtime_profile);
58
53
  const derived = deriveDefaultsForProfile(profile);
59
- const runtimeBackend = normalizeChoice(raw.runtime_backend, ['host', 'vm'], derived.runtime_backend);
54
+ const runtimeBackend = normalizeChoice(raw.runtime_backend, ['vm'], derived.runtime_backend);
60
55
  const browserBackend = normalizeChoice(raw.browser_backend, ['vm', 'extension'], derived.browser_backend);
61
56
  const androidBackend = normalizeChoice(raw.android_backend, ['host', 'vm'], derived.android_backend);
62
57
  return {
63
- runtime_profile: profile,
64
- runtime_backend: policy.allowHostRuntime ? runtimeBackend : (runtimeBackend === 'host' ? 'vm' : runtimeBackend),
58
+ runtime_profile: profile === 'trusted-host' ? 'secure-vm' : profile,
59
+ runtime_backend: runtimeBackend,
65
60
  browser_backend: browserBackend === 'extension' ? 'extension' : 'vm',
66
- android_backend: policy.allowHostRuntime ? androidBackend : (androidBackend === 'host' ? 'vm' : androidBackend),
61
+ android_backend: androidBackend === 'vm' ? 'host' : androidBackend,
67
62
  mcp_backend: 'host-remote',
68
63
  };
69
64
  }
@@ -107,8 +102,8 @@ function validateRuntimeSettings(raw = {}) {
107
102
  if (settings.browser_backend !== 'vm' && settings.browser_backend !== 'extension') {
108
103
  issues.push('This deployment requires the VM browser backend or a paired browser extension backend.');
109
104
  }
110
- if (settings.android_backend !== 'vm') {
111
- issues.push('This deployment requires the VM Android backend.');
105
+ if (settings.android_backend !== 'host') {
106
+ issues.push('This deployment requires the host Android backend.');
112
107
  }
113
108
  }
114
109
 
@@ -2,49 +2,23 @@
2
2
 
3
3
  const { getDeploymentPolicy } = require('../../utils/deployment');
4
4
 
5
- function validateGuestToken(token) {
6
- const value = String(token || '').trim();
7
- if (!value) {
8
- return { valid: false, reason: 'NEOAGENT_VM_GUEST_TOKEN is missing.' };
9
- }
10
- if (value.length < 32) {
11
- return { valid: false, reason: 'NEOAGENT_VM_GUEST_TOKEN must be at least 32 characters long.' };
12
- }
13
- if (/^(change|replace|set|your|example|sample|placeholder|token|secret)[-_a-z0-9]*$/i.test(value)) {
14
- return { valid: false, reason: 'NEOAGENT_VM_GUEST_TOKEN looks like a placeholder value.' };
15
- }
16
- if (/change-this-guest-token-before-prod/i.test(value)) {
17
- return { valid: false, reason: 'NEOAGENT_VM_GUEST_TOKEN is using the insecure example placeholder.' };
18
- }
19
- if (/^(.)\1+$/.test(value)) {
20
- return { valid: false, reason: 'NEOAGENT_VM_GUEST_TOKEN must not be a repeated single character.' };
21
- }
22
- return { valid: true, reason: null };
23
- }
24
-
25
5
  function getRuntimeValidation(runtimeManager) {
26
6
  const policy = getDeploymentPolicy();
27
7
  const nodeEnvIsProd = String(process.env.NODE_ENV || '').trim().toLowerCase() === 'prod';
28
- const vmReadiness = runtimeManager?.vmBackend?.vmManager?.getReadiness?.() || null;
29
- const guestToken = String(runtimeManager?.vmBackend?.token || process.env.NEOAGENT_VM_GUEST_TOKEN || '').trim();
30
- const guestTokenValidation = validateGuestToken(guestToken);
8
+ const browserVmReadiness = runtimeManager?.browserBackend?.vmManager?.getReadiness?.() || null;
9
+ const vmReadiness = browserVmReadiness || null;
31
10
  const issues = [];
32
11
 
33
12
  if (policy.profile === 'prod' || nodeEnvIsProd) {
34
- if (!vmReadiness?.ready) {
35
- if (!vmReadiness) {
36
- issues.push('prod profile requires a working local VM runtime.');
37
- } else {
38
- if (!vmReadiness.qemuAvailable) {
39
- issues.push(`prod profile requires QEMU (${vmReadiness.qemuBinary}) to be installed.`);
40
- }
41
- if (!vmReadiness.baseImageExists && !vmReadiness.downloadConfigured) {
42
- issues.push('prod profile requires a VM base image or a downloadable base image URL.');
43
- }
13
+ if (!browserVmReadiness) {
14
+ issues.push('prod profile requires a working local VM runtime for browser/CLI.');
15
+ } else if (!browserVmReadiness.ready) {
16
+ if (!browserVmReadiness.qemuAvailable) {
17
+ issues.push(`prod profile requires QEMU (${browserVmReadiness.qemuBinary}) to be installed for browser/CLI.`);
18
+ }
19
+ if (!browserVmReadiness.baseImageExists && !browserVmReadiness.downloadConfigured) {
20
+ issues.push('prod profile requires a VM base image or a downloadable base image URL for browser/CLI.');
44
21
  }
45
- }
46
- if (!guestTokenValidation.valid) {
47
- issues.push(`prod profile requires a secure NEOAGENT_VM_GUEST_TOKEN. ${guestTokenValidation.reason}`);
48
22
  }
49
23
  }
50
24
 
@@ -52,7 +26,7 @@ function getRuntimeValidation(runtimeManager) {
52
26
  ready: issues.length === 0,
53
27
  issues,
54
28
  vm: vmReadiness,
55
- guestTokenConfigured: guestTokenValidation.valid,
29
+ guestTokenConfigured: true,
56
30
  policy,
57
31
  };
58
32
  }
@@ -68,5 +42,4 @@ function assertRuntimeValidation(runtimeManager) {
68
42
  module.exports = {
69
43
  assertRuntimeValidation,
70
44
  getRuntimeValidation,
71
- validateGuestToken,
72
45
  };
@@ -65,13 +65,13 @@ function getDeploymentPolicy(env = process.env) {
65
65
  allowSelfUpdate: mode !== DEPLOYMENT_MODE_MANAGED,
66
66
  registrationOpen: isProdProfile,
67
67
  runtimeDefaults: {
68
- runtime_profile: isProdProfile ? 'secure-vm' : 'trusted-host',
69
- runtime_backend: isProdProfile ? 'vm' : 'host',
68
+ runtime_profile: 'secure-vm',
69
+ runtime_backend: 'vm',
70
70
  browser_backend: 'vm',
71
- android_backend: isProdProfile ? 'vm' : 'host',
71
+ android_backend: 'host',
72
72
  mcp_backend: 'host-remote',
73
73
  },
74
- allowHostRuntime: !isProdProfile,
74
+ allowHostRuntime: false,
75
75
  };
76
76
  }
77
77
 
@@ -1,16 +0,0 @@
1
- {
2
- "name": "neoagent-guest-agent",
3
- "private": true,
4
- "version": "1.0.0",
5
- "description": "Minimal guest runtime for NeoAgent VM browser, CLI, and Android services (uses puppeteer-core with playwright-chromium browser binaries)",
6
- "engines": {
7
- "node": ">=20"
8
- },
9
- "dependencies": {
10
- "express": "^4.21.2",
11
- "node-pty": "^1.0.0",
12
- "playwright-chromium": "^1.59.1",
13
- "proper-lockfile": "^4.1.2",
14
- "puppeteer-core": "^24.40.0"
15
- }
16
- }