@empire-builder-kit/nx 1.0.0-rc.46 → 1.0.0-rc.47
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/generators.json +11 -1
- package/package.json +3 -3
- package/src/aws-authority/stage-authority.d.ts +30 -2
- package/src/aws-authority/stage-authority.js +220 -25
- package/src/developer-agent/generator-planning.js +99 -6
- package/src/developer-agent/model.d.ts +7 -3
- package/src/developer-agent/model.js +1 -0
- package/src/developer-agent/operation-registry.d.ts +1 -0
- package/src/developer-agent/operation-registry.js +43 -2
- package/src/developer-agent/planning.js +5 -2
- package/src/developer-agent/preview-changes.js +10 -0
- package/src/developer-agent/validation.js +7 -3
- package/src/developer-agent/workspace-inspection.js +51 -4
- package/src/executors/deployment-plan/deployment-plan.js +3 -0
- package/src/executors/dev-doctor/dev-doctor.d.ts +25 -3
- package/src/executors/dev-doctor/dev-doctor.js +136 -49
- package/src/executors/dev-setup/dev-setup.d.ts +18 -1
- package/src/executors/dev-setup/dev-setup.js +320 -196
- package/src/executors/foundation-preflight/foundation-preflight.js +9 -1
- package/src/executors/foundation-remove-preflight/foundation-remove-preflight.js +2 -2
- package/src/executors/infrastructure-plan/infrastructure-plan.js +10 -3
- package/src/executors/local-deploy/local-deploy.d.ts +15 -0
- package/src/executors/local-deploy/local-deploy.js +96 -14
- package/src/executors/sst-lifecycle/logging-preflight.js +12 -1
- package/src/executors/sst-lifecycle/run-sst-command.js +51 -5
- package/src/foundation/cost-estimate.js +1 -1
- package/src/foundation/identity-domain-parent-ready.d.ts +91 -0
- package/src/foundation/identity-domain-parent-ready.js +333 -0
- package/src/foundation/identity-domain.d.ts +94 -0
- package/src/foundation/identity-domain.js +115 -0
- package/src/foundation/index.d.ts +2 -0
- package/src/foundation/index.js +7 -0
- package/src/foundation/preflight.js +17 -1
- package/src/foundation/root-site-readiness.d.ts +27 -0
- package/src/foundation/root-site-readiness.js +78 -0
- package/src/foundation/root-site.d.ts +81 -0
- package/src/foundation/root-site.js +268 -0
- package/src/generators/framework-prerequisites.d.ts +2 -0
- package/src/generators/framework-prerequisites.js +34 -0
- package/src/generators/function/function-registration.d.ts +24 -0
- package/src/generators/function/function-registration.js +66 -0
- package/src/generators/function/function.d.ts +16 -1
- package/src/generators/function/function.js +101 -18
- package/src/generators/function/schema.d.ts +1 -0
- package/src/generators/function/schema.json +6 -0
- package/src/generators/function-access/function-access.d.ts +14 -0
- package/src/generators/function-access/function-access.js +141 -0
- package/src/generators/function-access/schema.d.ts +6 -0
- package/src/generators/function-access/schema.json +25 -0
- package/src/generators/post-generation-install.d.ts +1 -1
- package/src/generators/post-generation-install.js +1 -1
- package/src/generators/preset/dependency-overrides.d.ts +1 -1
- package/src/generators/preset/dependency-overrides.js +1 -1
- package/src/generators/preset/workspace-files-adopter-skills.js +14 -0
- package/src/generators/preset/workspace-files-developer-agent.js +17 -11
- package/src/generators/preset/workspace-files-stage-authority.js +58 -1
- package/src/generators/preset/workspace-files-thin-deploy.d.ts +11 -0
- package/src/generators/preset/workspace-files-thin-deploy.js +47 -4
- package/src/generators/preset/workspace-files-thin-docs.js +33 -5
- package/src/generators/preset/workspace-files.js +207 -13
- package/src/generators/repository-policy/repository-policy.js +2 -1
- package/src/generators/repository-policy/schema.d.ts +2 -0
- package/src/generators/repository-policy/schema.json +7 -2
- package/src/generators/site/built-in-site-documentation-files.d.ts +2 -0
- package/src/generators/site/built-in-site-documentation-files.js +92 -0
- package/src/generators/site/built-in-site-files.d.ts +8 -0
- package/src/generators/site/built-in-site-files.js +40 -0
- package/src/generators/site/built-in-site-infrastructure-files.d.ts +2 -0
- package/src/generators/site/built-in-site-infrastructure-files.js +275 -0
- package/src/generators/site/built-in-site-plan.d.ts +19 -0
- package/src/generators/site/built-in-site-plan.js +65 -0
- package/src/generators/site/built-in-site-project-files.d.ts +3 -0
- package/src/generators/site/built-in-site-project-files.js +258 -0
- package/src/generators/site/built-in-site-script-files.d.ts +2 -0
- package/src/generators/site/built-in-site-script-files.js +306 -0
- package/src/generators/site/built-in-site-shared.d.ts +9 -0
- package/src/generators/site/built-in-site-shared.js +21 -0
- package/src/generators/site/built-in-site-smoke-files.d.ts +2 -0
- package/src/generators/site/built-in-site-smoke-files.js +37 -0
- package/src/generators/site/built-in-site-sst-config-files.d.ts +2 -0
- package/src/generators/site/built-in-site-sst-config-files.js +39 -0
- package/src/generators/site/built-in-site-web-files.d.ts +2 -0
- package/src/generators/site/built-in-site-web-files.js +284 -0
- package/src/generators/site/schema.d.ts +4 -0
- package/src/generators/site/schema.json +20 -0
- package/src/generators/site/site.d.ts +13 -0
- package/src/generators/site/site.js +221 -0
- package/src/generators/slice/built-in-plan-alarm-identity.d.ts +9 -0
- package/src/generators/slice/built-in-plan-alarm-identity.js +8 -1
- package/src/generators/slice/built-in-plan-api-contract-files.js +18 -0
- package/src/generators/slice/built-in-plan-async-work-files.js +18 -0
- package/src/generators/slice/built-in-plan-data-files.js +116 -11
- package/src/generators/slice/built-in-plan-foundation-files.d.ts +12 -0
- package/src/generators/slice/built-in-plan-foundation-files.js +114 -5
- package/src/generators/slice/built-in-plan-frontend-files.js +2 -271
- package/src/generators/slice/built-in-plan-frontend-header-proof.d.ts +6 -0
- package/src/generators/slice/built-in-plan-frontend-header-proof.js +282 -0
- package/src/generators/slice/built-in-plan-infrastructure-files.js +151 -237
- package/src/generators/slice/built-in-plan-key-value-cleanup.js +4 -3
- package/src/generators/slice/built-in-plan-log-group-helpers.d.ts +29 -0
- package/src/generators/slice/built-in-plan-log-group-helpers.js +130 -0
- package/src/generators/slice/built-in-plan-metadata-files.js +21 -4
- package/src/generators/slice/built-in-plan-next-build-authority.d.ts +5 -0
- package/src/generators/slice/built-in-plan-next-build-authority.js +124 -0
- package/src/generators/slice/built-in-plan-operations-files.d.ts +6 -0
- package/src/generators/slice/built-in-plan-operations-files.js +107 -219
- package/src/generators/slice/built-in-plan-performance-files.js +6 -1
- package/src/generators/slice/built-in-plan-reliability-files.js +12 -8
- package/src/generators/slice/built-in-plan-shared.d.ts +1 -1
- package/src/generators/slice/built-in-plan-shared.js +1 -1
- package/src/generators/slice/built-in-plan-sst-config.d.ts +49 -0
- package/src/generators/slice/built-in-plan-sst-config.js +160 -0
- package/src/generators/slice/built-in-plan-testing-files.js +92 -49
- package/src/generators/slice/built-in-plan-verification-files.js +15 -4
- package/src/generators/slice/built-in-plan-web-files.js +65 -0
- package/src/generators/slice/deployed-smoke-diagnostics.d.ts +35 -0
- package/src/generators/slice/deployed-smoke-diagnostics.js +189 -0
- package/src/generators/slice/deployed-smoke-readiness.d.ts +7 -0
- package/src/generators/slice/deployed-smoke-readiness.js +118 -23
- package/src/generators/slice/persistence-contract.js +2 -2
- package/src/generators/slice/pnpm-launch-script.d.ts +13 -0
- package/src/generators/slice/pnpm-launch-script.js +28 -0
- package/src/generators/slice/slice.js +27 -0
- package/src/generators/upgrade/custom-domain-notice.d.ts +19 -0
- package/src/generators/upgrade/custom-domain-notice.js +38 -0
- package/src/generators/upgrade/external-blueprint-compositions.d.ts +84 -0
- package/src/generators/upgrade/external-blueprint-compositions.js +478 -0
- package/src/generators/upgrade/framework-package-upgrade.d.ts +58 -0
- package/src/generators/upgrade/framework-package-upgrade.js +78 -0
- package/src/generators/upgrade/function-authentication-notice.d.ts +29 -0
- package/src/generators/upgrade/function-authentication-notice.js +74 -0
- package/src/generators/upgrade/schema.json +2 -2
- package/src/generators/upgrade/upgrade-plan.d.ts +52 -0
- package/src/generators/upgrade/upgrade-plan.js +406 -0
- package/src/generators/upgrade/upgrade.d.ts +1 -35
- package/src/generators/upgrade/upgrade.js +259 -593
- package/src/generators/workload/workload.js +60 -4
- package/src/git-policy/github-bootstrap.d.ts +6 -5
- package/src/git-policy/github-bootstrap.js +6 -4
- package/src/local-dev/fleet-process.d.ts +9 -2
- package/src/local-dev/fleet-process.js +27 -7
- package/src/local-dev/gateway-daemon.d.ts +1 -1
- package/src/local-dev/gateway-daemon.js +6 -4
- package/src/local-dev/portless.d.ts +5 -0
- package/src/local-dev/portless.js +5 -0
- package/src/local-dev/process-group.d.ts +10 -0
- package/src/local-dev/process-group.js +33 -0
- package/src/local-dev/tls.js +31 -2
- package/src/local-dev/trust-store.d.ts +42 -0
- package/src/local-dev/trust-store.js +87 -0
- package/src/ownership/composition.d.ts +7 -0
- package/src/ownership/composition.js +64 -56
- package/src/ownership/index.d.ts +1 -0
- package/src/ownership/index.js +1 -0
- package/src/ownership/record.d.ts +19 -0
- package/src/ownership/record.js +26 -2
- package/src/ownership/site-record.d.ts +18 -0
- package/src/ownership/site-record.js +105 -0
- package/src/repository-policy/deployment-plan.d.ts +3 -0
- package/src/repository-policy/deployment-plan.js +33 -4
- package/src/repository-policy/index.d.ts +1 -0
- package/src/repository-policy/index.js +1 -0
- package/src/repository-policy/policy.d.ts +13 -1
- package/src/repository-policy/policy.js +55 -1
- package/src/repository-policy/public-dns.d.ts +65 -0
- package/src/repository-policy/public-dns.js +168 -0
- package/src/schemas/generated-ownership-v2.json +6 -0
- package/src/schemas/repository-policy-v1.json +67 -1
- package/src/supply-chain/blueprint-trust-git.js +24 -0
- package/src/supply-chain/blueprint-verification-authority.js +21 -3
- package/src/supply-chain/generated-blueprint-trust-command.js +15 -0
- package/src/work-markers/work-markers.js +4 -1
- package/src/workspace-deployment/ownership.d.ts +15 -0
- package/src/workspace-deployment/ownership.js +19 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.windowsChainTrustCommand = windowsChainTrustCommand;
|
|
3
4
|
exports.inspectCertificateTrust = inspectCertificateTrust;
|
|
4
5
|
exports.inspectLocalDevelopment = inspectLocalDevelopment;
|
|
5
6
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const node_child_process_1 = require("node:child_process");
|
|
7
7
|
const node_crypto_1 = require("node:crypto");
|
|
8
8
|
const node_fs_1 = require("node:fs");
|
|
9
9
|
const node_os_1 = require("node:os");
|
|
@@ -14,6 +14,7 @@ const gateway_js_1 = require("../../local-dev/gateway.js");
|
|
|
14
14
|
const identity_js_1 = require("../../local-dev/identity.js");
|
|
15
15
|
const personal_stage_js_1 = require("../../local-dev/personal-stage.js");
|
|
16
16
|
const tls_js_1 = require("../../local-dev/tls.js");
|
|
17
|
+
const trust_store_js_1 = require("../../local-dev/trust-store.js");
|
|
17
18
|
const INVALID_TLS_REMEDIATION = 'Run ebk dev setup --upgrade, inspect the generated root, then explicitly run ebk dev setup --trust.';
|
|
18
19
|
function invalidTlsResult(hostname, resolver, issues, summary) {
|
|
19
20
|
return {
|
|
@@ -27,49 +28,120 @@ function invalidTlsResult(hostname, resolver, issues, summary) {
|
|
|
27
28
|
trust: 'missing',
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
+
// Builds the chain in the current user's CryptoAPI context, supplying the
|
|
32
|
+
// intermediate from its file, and requires the exact EBK root as the anchor.
|
|
33
|
+
// Paths and the expected thumbprint arrive through the environment, never by
|
|
34
|
+
// script interpolation. Hostname coverage is checked before this runs.
|
|
35
|
+
const WINDOWS_CHAIN_TRUST_SCRIPT = String.raw `
|
|
36
|
+
$ErrorActionPreference = 'Stop'
|
|
37
|
+
$leaf = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList $env:EBK_TRUST_LEAF
|
|
38
|
+
$intermediate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList $env:EBK_TRUST_INTERMEDIATE
|
|
39
|
+
$chain = New-Object System.Security.Cryptography.X509Certificates.X509Chain -ArgumentList $false
|
|
40
|
+
$chain.ChainPolicy.RevocationMode = [System.Security.Cryptography.X509Certificates.X509RevocationMode]::NoCheck
|
|
41
|
+
[void]$chain.ChainPolicy.ExtraStore.Add($intermediate)
|
|
42
|
+
[void]$chain.ChainPolicy.ApplicationPolicy.Add((New-Object System.Security.Cryptography.Oid -ArgumentList '1.3.6.1.5.5.7.3.1'))
|
|
43
|
+
$built = $chain.Build($leaf)
|
|
44
|
+
$anchor = $chain.ChainElements[$chain.ChainElements.Count - 1].Certificate.Thumbprint
|
|
45
|
+
$status = ($chain.ChainStatus | ForEach-Object { $_.Status.ToString() }) -join ','
|
|
46
|
+
if ($built -and $anchor -eq $env:EBK_TRUST_ROOT_SHA1) { 'EBK-TRUST ready' } else { "EBK-TRUST rejected $status" }
|
|
47
|
+
`;
|
|
48
|
+
// Windows PowerShell can take more than 15 seconds to load on a cold hosted
|
|
49
|
+
// session (see tls.ts); a check that cannot finish reports unknown.
|
|
50
|
+
const WINDOWS_TRUST_TIMEOUT_MS = 45_000;
|
|
51
|
+
function windowsChainTrustCommand(environment = process.env) {
|
|
52
|
+
return {
|
|
53
|
+
args: [
|
|
54
|
+
'-NoLogo',
|
|
55
|
+
'-NoProfile',
|
|
56
|
+
'-NonInteractive',
|
|
57
|
+
'-EncodedCommand',
|
|
58
|
+
Buffer.from(WINDOWS_CHAIN_TRUST_SCRIPT, 'utf16le').toString('base64'),
|
|
59
|
+
],
|
|
60
|
+
command: node_path_1.win32.join(environment.SystemRoot ?? 'C:\\Windows', 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe'),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function lastOutputLine(output) {
|
|
64
|
+
return output.trim().split(/\r?\n/u).at(-1)?.trim() ?? '';
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Effect-based system trust check for the generated chain. Certificate
|
|
68
|
+
* presence alone never reports `ready`.
|
|
69
|
+
*/
|
|
70
|
+
function inspectCertificateTrust(rootCertificatePath, intermediateCertificatePath, leafCertificatePath, hostname, inspection = {}) {
|
|
71
|
+
const targetPlatform = inspection.platform ?? (0, node_os_1.platform)();
|
|
72
|
+
const run = inspection.run ?? trust_store_js_1.runTrustCommand;
|
|
31
73
|
try {
|
|
32
|
-
if (
|
|
33
|
-
(0,
|
|
34
|
-
|
|
35
|
-
'
|
|
36
|
-
|
|
37
|
-
'-c',
|
|
38
|
-
leafCertificatePath,
|
|
39
|
-
'-c',
|
|
40
|
-
intermediateCertificatePath,
|
|
41
|
-
'-p',
|
|
42
|
-
'ssl',
|
|
43
|
-
'-n',
|
|
44
|
-
hostname,
|
|
45
|
-
], { stdio: 'pipe' });
|
|
46
|
-
return 'ready';
|
|
74
|
+
if (targetPlatform === 'darwin') {
|
|
75
|
+
const verified = run('security', (0, trust_store_js_1.macosVerifyCertArguments)(leafCertificatePath, intermediateCertificatePath, hostname));
|
|
76
|
+
if ((0, trust_store_js_1.trustCommandSucceeded)(verified))
|
|
77
|
+
return 'ready';
|
|
78
|
+
return verified.error ? 'unknown' : 'missing';
|
|
47
79
|
}
|
|
48
|
-
|
|
49
|
-
.
|
|
50
|
-
|
|
51
|
-
(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
80
|
+
if (targetPlatform === 'win32') {
|
|
81
|
+
const environment = inspection.environment ?? process.env;
|
|
82
|
+
const { args, command } = windowsChainTrustCommand(environment);
|
|
83
|
+
const verified = run(command, args, {
|
|
84
|
+
env: {
|
|
85
|
+
...environment,
|
|
86
|
+
EBK_TRUST_INTERMEDIATE: intermediateCertificatePath,
|
|
87
|
+
EBK_TRUST_LEAF: leafCertificatePath,
|
|
88
|
+
EBK_TRUST_ROOT_SHA1: (0, trust_store_js_1.certificateSha1)(rootCertificatePath),
|
|
89
|
+
},
|
|
90
|
+
timeoutMs: WINDOWS_TRUST_TIMEOUT_MS,
|
|
91
|
+
});
|
|
92
|
+
if (!(0, trust_store_js_1.trustCommandSucceeded)(verified))
|
|
93
|
+
return 'unknown';
|
|
94
|
+
const verdict = lastOutputLine(verified.stdout);
|
|
95
|
+
if (verdict === 'EBK-TRUST ready')
|
|
96
|
+
return 'ready';
|
|
97
|
+
return verdict.startsWith('EBK-TRUST rejected') ? 'missing' : 'unknown';
|
|
58
98
|
}
|
|
59
|
-
|
|
99
|
+
// Linux and other Unix desktops: the NSS database Chromium reads.
|
|
100
|
+
const database = (0, trust_store_js_1.chromiumNssDatabase)(inspection.homeDirectory ?? (0, node_os_1.homedir)(), inspection.pathExists ?? node_fs_1.existsSync);
|
|
101
|
+
if (!(inspection.pathExists ?? node_fs_1.existsSync)(database))
|
|
102
|
+
return 'missing';
|
|
103
|
+
const listed = run('certutil', [
|
|
60
104
|
'-L',
|
|
61
105
|
'-d',
|
|
62
|
-
`sql:${
|
|
106
|
+
`sql:${database}`,
|
|
63
107
|
'-n',
|
|
64
|
-
|
|
108
|
+
trust_store_js_1.EBK_LOCAL_ROOT_LABEL,
|
|
65
109
|
'-a',
|
|
66
|
-
]
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
110
|
+
]);
|
|
111
|
+
if ((0, trust_store_js_1.trustCommandMissing)(listed))
|
|
112
|
+
return 'unknown';
|
|
113
|
+
if (!(0, trust_store_js_1.trustCommandSucceeded)(listed)) {
|
|
114
|
+
return /could not find/iu.test(`${listed.stdout}\n${listed.stderr}`)
|
|
115
|
+
? 'missing'
|
|
116
|
+
: 'unknown';
|
|
117
|
+
}
|
|
118
|
+
const expected = new node_crypto_1.X509Certificate((0, node_fs_1.readFileSync)(rootCertificatePath))
|
|
119
|
+
.fingerprint256;
|
|
120
|
+
if (new node_crypto_1.X509Certificate(listed.stdout).fingerprint256 !== expected) {
|
|
121
|
+
return 'missing';
|
|
122
|
+
}
|
|
123
|
+
// The exact root must validate as a trusted TLS issuing CA (the C trust
|
|
124
|
+
// flag) in that database, not merely be stored there.
|
|
125
|
+
const verified = run('certutil', [
|
|
126
|
+
'-V',
|
|
127
|
+
'-d',
|
|
128
|
+
`sql:${database}`,
|
|
129
|
+
'-n',
|
|
130
|
+
trust_store_js_1.EBK_LOCAL_ROOT_LABEL,
|
|
131
|
+
'-u',
|
|
132
|
+
'L',
|
|
133
|
+
]);
|
|
134
|
+
const output = `${verified.stdout}\n${verified.stderr}`;
|
|
135
|
+
if ((0, trust_store_js_1.trustCommandSucceeded)(verified) &&
|
|
136
|
+
/certificate is valid/iu.test(output)) {
|
|
137
|
+
return 'ready';
|
|
138
|
+
}
|
|
139
|
+
return !verified.error && /certificate is invalid/iu.test(output)
|
|
140
|
+
? 'missing'
|
|
141
|
+
: 'unknown';
|
|
70
142
|
}
|
|
71
143
|
catch {
|
|
72
|
-
return '
|
|
144
|
+
return 'unknown';
|
|
73
145
|
}
|
|
74
146
|
}
|
|
75
147
|
function packageVersion() {
|
|
@@ -169,9 +241,12 @@ async function inspectLocalDevelopment(options, context, dependencies = {}) {
|
|
|
169
241
|
issues.push(`Supported explicit-port TLS effect probe failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
170
242
|
}
|
|
171
243
|
}
|
|
172
|
-
if (trust
|
|
244
|
+
if (trust === 'missing') {
|
|
173
245
|
issues.push('System trust is not installed. Use the generated verify-local-browser target for browser-scoped trust; human browsers may require explicit ebk dev setup --trust after reviewing the root.');
|
|
174
246
|
}
|
|
247
|
+
else if (trust === 'unknown') {
|
|
248
|
+
issues.push('System trust could not be verified: the platform trust check is unavailable or returned an unrecognized result (on Linux, install the NSS tools that provide certutil). Doctor never reports trust ready from certificate presence. Use the generated verify-local-browser target for browser-scoped trust.');
|
|
249
|
+
}
|
|
175
250
|
let state;
|
|
176
251
|
if ((0, node_fs_1.existsSync)(paths.gatewayState)) {
|
|
177
252
|
try {
|
|
@@ -181,23 +256,32 @@ async function inspectLocalDevelopment(options, context, dependencies = {}) {
|
|
|
181
256
|
issues.push(`Gateway state is invalid JSON: ${error instanceof Error ? error.message : String(error)}`);
|
|
182
257
|
}
|
|
183
258
|
}
|
|
184
|
-
|
|
259
|
+
// The machine gateway exists only for recorded portless intent; plain
|
|
260
|
+
// setup starts none, so its absence is not a degraded state.
|
|
261
|
+
let gateway = state?.portless
|
|
262
|
+
? 'missing'
|
|
263
|
+
: 'not-configured';
|
|
185
264
|
const send = dependencies.send ?? gateway_js_1.sendGatewayCommand;
|
|
186
265
|
const capability = (0, node_fs_1.readFileSync)(paths.capability, 'utf8').trim();
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
266
|
+
if (state?.portless) {
|
|
267
|
+
try {
|
|
268
|
+
const status = await send(paths.gatewaySocket, {
|
|
269
|
+
action: 'status',
|
|
270
|
+
capability,
|
|
271
|
+
});
|
|
272
|
+
if (status.protocolVersion !== contracts_js_1.GATEWAY_PROTOCOL_VERSION) {
|
|
273
|
+
issues.push(`Machine gateway protocol ${status.protocolVersion} does not match ${contracts_js_1.GATEWAY_PROTOCOL_VERSION}.`);
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
gateway = 'ready';
|
|
277
|
+
}
|
|
194
278
|
}
|
|
195
|
-
|
|
196
|
-
gateway
|
|
279
|
+
catch (error) {
|
|
280
|
+
issues.push(`Machine gateway status probe failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
197
281
|
}
|
|
198
282
|
}
|
|
199
|
-
|
|
200
|
-
issues.push(
|
|
283
|
+
else if ((0, node_fs_1.existsSync)(paths.gatewayPid)) {
|
|
284
|
+
issues.push('An earlier ebk dev setup recorded a machine gateway process that no fleet uses without --portless. Rerun ebk dev setup to stop it.');
|
|
201
285
|
}
|
|
202
286
|
let portless = state?.portless
|
|
203
287
|
? 'unreachable'
|
|
@@ -280,11 +364,14 @@ const executor = async (options, context) => {
|
|
|
280
364
|
devkit_1.logger.warn('Run dev-setup, inspect the generated root, then explicitly rerun with --trust.');
|
|
281
365
|
}
|
|
282
366
|
if (result.gateway === 'missing') {
|
|
283
|
-
devkit_1.logger.warn('
|
|
367
|
+
devkit_1.logger.warn('Portless intent is recorded but the optional machine gateway is unavailable. Rerun dev-setup --upgrade --trust --portless before testing experimental portless mode.');
|
|
284
368
|
}
|
|
285
369
|
if (result.trust === 'missing') {
|
|
286
370
|
devkit_1.logger.warn('The EBK root is not trusted in the detected user/browser trust store. Review it and run dev-setup --trust explicitly.');
|
|
287
371
|
}
|
|
372
|
+
if (result.trust === 'unknown') {
|
|
373
|
+
devkit_1.logger.warn('EBK could not run an effect-based trust check on this host, so trust is reported unknown rather than ready. Review the reported issue.');
|
|
374
|
+
}
|
|
288
375
|
if (result.connectivity === 'missing') {
|
|
289
376
|
devkit_1.logger.warn('The supported explicit-port TLS path did not complete a live trusted handshake. Review the reported effect-probe issue before starting a fleet.');
|
|
290
377
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { type PromiseExecutor } from '@nx/devkit';
|
|
2
|
+
import { sendGatewayCommand } from '../../local-dev/gateway.js';
|
|
3
|
+
import { type PrivilegedCommand } from '../../local-dev/portless.js';
|
|
4
|
+
import { type TrustCommandRunner } from '../../local-dev/trust-store.js';
|
|
2
5
|
export interface DevSetupOptions {
|
|
3
6
|
appData?: string;
|
|
4
7
|
hostSuffix?: string;
|
|
@@ -7,7 +10,21 @@ export interface DevSetupOptions {
|
|
|
7
10
|
trust?: boolean;
|
|
8
11
|
upgrade?: boolean;
|
|
9
12
|
}
|
|
10
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Host seams. Production uses the defaults; unit proofs inject them so no
|
|
15
|
+
* trust store, packet filter, privileged port or daemon is touched.
|
|
16
|
+
*/
|
|
17
|
+
export interface DevSetupDependencies {
|
|
18
|
+
applyPrivileged?: (commands: readonly PrivilegedCommand[]) => void;
|
|
19
|
+
gatewayIsRunning?: (pidPath: string) => boolean;
|
|
20
|
+
homeDirectory?: string;
|
|
21
|
+
platform?: NodeJS.Platform;
|
|
22
|
+
run?: TrustCommandRunner;
|
|
23
|
+
send?: typeof sendGatewayCommand;
|
|
24
|
+
startGateway?: (appData: string, internalPort: number) => Promise<void>;
|
|
25
|
+
stopGateway?: (pidPath: string) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare function applyDevSetup(options: DevSetupOptions, dependencies?: DevSetupDependencies): Promise<{
|
|
11
28
|
success: true;
|
|
12
29
|
}>;
|
|
13
30
|
export declare function runDevSetup(options: DevSetupOptions): Promise<{
|