@blackbelt-technology/pi-agent-dashboard 0.2.9 → 0.4.0
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/AGENTS.md +64 -8
- package/README.md +308 -101
- package/docs/architecture.md +515 -16
- package/package.json +14 -7
- package/packages/extension/package.json +11 -3
- package/packages/extension/src/__tests__/ask-user-tool.test.ts +300 -3
- package/packages/extension/src/__tests__/enrich-model-metadata.test.ts +201 -0
- package/packages/extension/src/__tests__/fork-entryid-timing.test.ts +100 -0
- package/packages/extension/src/__tests__/git-info.test.ts +67 -55
- package/packages/extension/src/__tests__/openspec-poller.test.ts +101 -96
- package/packages/extension/src/__tests__/process-scanner-kill.test.ts +61 -0
- package/packages/extension/src/__tests__/provider-register-reload.test.ts +394 -0
- package/packages/extension/src/__tests__/server-auto-start.test.ts +95 -4
- package/packages/extension/src/__tests__/server-launcher.test.ts +16 -0
- package/packages/extension/src/ask-user-tool.ts +289 -20
- package/packages/extension/src/bridge.ts +107 -6
- package/packages/extension/src/command-handler.ts +34 -39
- package/packages/extension/src/dev-build.ts +1 -1
- package/packages/extension/src/git-info.ts +9 -19
- package/packages/extension/src/pi-env.d.ts +1 -0
- package/packages/extension/src/process-scanner.ts +72 -38
- package/packages/extension/src/prompt-expander.ts +25 -4
- package/packages/extension/src/provider-register.ts +304 -16
- package/packages/extension/src/server-auto-start.ts +27 -1
- package/packages/extension/src/server-launcher.ts +71 -27
- package/packages/server/package.json +17 -2
- package/packages/server/src/__tests__/auto-attach.test.ts +10 -1
- package/packages/server/src/__tests__/auto-shutdown.test.ts +8 -2
- package/packages/server/src/__tests__/bootstrap-queue.test.ts +120 -0
- package/packages/server/src/__tests__/bootstrap-routes.test.ts +125 -0
- package/packages/server/src/__tests__/bootstrap-state.test.ts +119 -0
- package/packages/server/src/__tests__/browse-endpoint.test.ts +246 -10
- package/packages/server/src/__tests__/browser-gateway-handler-errors.test.ts +129 -0
- package/packages/server/src/__tests__/cli-parse.test.ts +11 -0
- package/packages/server/src/__tests__/concurrent-launch.test.ts +110 -0
- package/packages/server/src/__tests__/config-api.test.ts +68 -0
- package/packages/server/src/__tests__/cors.test.ts +34 -2
- package/packages/server/src/__tests__/crash-recovery.test.ts +88 -0
- package/packages/server/src/__tests__/directory-service.test.ts +234 -8
- package/packages/server/src/__tests__/editor-manager-pid-registry.test.ts +168 -0
- package/packages/server/src/__tests__/editor-manager.test.ts +33 -0
- package/packages/server/src/__tests__/editor-pid-registry.test.ts +191 -0
- package/packages/server/src/__tests__/editor-registry.test.ts +29 -15
- package/packages/server/src/__tests__/extension-register-appimage.test.ts +5 -1
- package/packages/server/src/__tests__/extension-register.test.ts +3 -1
- package/packages/server/src/__tests__/find-port-holders.test.ts +94 -0
- package/packages/server/src/__tests__/fix-pty-permissions.test.ts +59 -0
- package/packages/server/src/__tests__/force-kill-handler.test.ts +57 -8
- package/packages/server/src/__tests__/git-operations.test.ts +9 -7
- package/packages/server/src/__tests__/health-endpoint.test.ts +11 -13
- package/packages/server/src/__tests__/home-lock-escape-hatch.test.ts +60 -0
- package/packages/server/src/__tests__/home-lock-release.test.ts +85 -0
- package/packages/server/src/__tests__/home-lock.test.ts +308 -0
- package/packages/server/src/__tests__/is-pi-process.test.ts +36 -0
- package/packages/server/src/__tests__/node-guard.test.ts +85 -0
- package/packages/server/src/__tests__/openspec-tasks-parser.test.ts +178 -0
- package/packages/server/src/__tests__/openspec-tasks-routes.test.ts +180 -0
- package/packages/server/src/__tests__/package-manager-wrapper-resolve.test.ts +126 -0
- package/packages/server/src/__tests__/package-manager-wrapper.test.ts +45 -10
- package/packages/server/src/__tests__/pi-core-checker.test.ts +195 -0
- package/packages/server/src/__tests__/pi-core-routes.test.ts +184 -0
- package/packages/server/src/__tests__/pi-core-updater.test.ts +214 -0
- package/packages/server/src/__tests__/pi-version-skew.test.ts +165 -0
- package/packages/server/src/__tests__/preferences-store.test.ts +73 -4
- package/packages/server/src/__tests__/process-manager.test.ts +45 -18
- package/packages/server/src/__tests__/provider-auth-routes.test.ts +13 -3
- package/packages/server/src/__tests__/provider-probe.test.ts +287 -0
- package/packages/server/src/__tests__/provider-test-route.test.ts +149 -0
- package/packages/server/src/__tests__/recommended-routes.test.ts +389 -0
- package/packages/server/src/__tests__/restart-helper.test.ts +83 -0
- package/packages/server/src/__tests__/session-action-handler-headless-reload.test.ts +467 -0
- package/packages/server/src/__tests__/session-action-handler-reload-predicate.test.ts +73 -0
- package/packages/server/src/__tests__/session-action-handler-spawn-error.test.ts +74 -0
- package/packages/server/src/__tests__/session-file-dedup.test.ts +10 -10
- package/packages/server/src/__tests__/session-lifecycle-logging.test.ts +8 -2
- package/packages/server/src/__tests__/sleep-aware-heartbeat.test.ts +3 -1
- package/packages/server/src/__tests__/smoke-integration.test.ts +10 -10
- package/packages/server/src/__tests__/terminal-manager.test.ts +41 -1
- package/packages/server/src/__tests__/test-server-canary.test.ts +31 -0
- package/packages/server/src/__tests__/tool-routes.test.ts +277 -0
- package/packages/server/src/__tests__/trusted-networks-config.test.ts +19 -0
- package/packages/server/src/__tests__/trusted-networks-no-oauth-roundtrip.test.ts +126 -0
- package/packages/server/src/__tests__/tunnel-cleanup.test.ts +90 -0
- package/packages/server/src/__tests__/tunnel.test.ts +103 -6
- package/packages/server/src/__tests__/ws-ping-pong.test.ts +10 -2
- package/packages/server/src/__tests__/wsl-tmux-probe-cache.test.ts +44 -0
- package/packages/server/src/bootstrap-queue.ts +130 -0
- package/packages/server/src/bootstrap-state.ts +131 -0
- package/packages/server/src/browse.ts +108 -9
- package/packages/server/src/browser-gateway.ts +16 -3
- package/packages/server/src/browser-handlers/directory-handler.ts +23 -8
- package/packages/server/src/browser-handlers/session-action-handler.ts +213 -79
- package/packages/server/src/browser-handlers/session-action-helpers.ts +36 -0
- package/packages/server/src/cli.ts +256 -32
- package/packages/server/src/config-api.ts +16 -0
- package/packages/server/src/directory-service.ts +270 -39
- package/packages/server/src/editor-detection.ts +12 -9
- package/packages/server/src/editor-manager.ts +39 -5
- package/packages/server/src/editor-pid-registry.ts +199 -0
- package/packages/server/src/editor-registry.ts +22 -25
- package/packages/server/src/fix-pty-permissions.ts +44 -0
- package/packages/server/src/git-operations.ts +1 -1
- package/packages/server/src/headless-pid-registry.ts +16 -20
- package/packages/server/src/home-lock-release.ts +72 -0
- package/packages/server/src/home-lock.ts +389 -0
- package/packages/server/src/node-guard.ts +52 -0
- package/packages/server/src/npm-search-proxy.ts +71 -0
- package/packages/server/src/openspec-tasks.ts +158 -0
- package/packages/server/src/package-manager-wrapper.ts +225 -34
- package/packages/server/src/pi-core-checker.ts +290 -0
- package/packages/server/src/pi-core-updater.ts +172 -0
- package/packages/server/src/pi-gateway.ts +7 -0
- package/packages/server/src/pi-resource-scanner.ts +5 -8
- package/packages/server/src/pi-version-skew.ts +196 -0
- package/packages/server/src/preferences-store.ts +17 -3
- package/packages/server/src/process-manager.ts +403 -222
- package/packages/server/src/provider-probe.ts +234 -0
- package/packages/server/src/restart-helper.ts +130 -0
- package/packages/server/src/routes/bootstrap-routes.ts +88 -0
- package/packages/server/src/routes/file-routes.ts +30 -3
- package/packages/server/src/routes/openspec-routes.ts +107 -1
- package/packages/server/src/routes/pi-core-routes.ts +140 -0
- package/packages/server/src/routes/provider-auth-routes.ts +12 -10
- package/packages/server/src/routes/provider-routes.ts +55 -2
- package/packages/server/src/routes/recommended-routes.ts +225 -0
- package/packages/server/src/routes/system-routes.ts +30 -34
- package/packages/server/src/routes/tool-routes.ts +153 -0
- package/packages/server/src/server-pid.ts +5 -9
- package/packages/server/src/server.ts +363 -26
- package/packages/server/src/session-api.ts +77 -8
- package/packages/server/src/session-bootstrap.ts +17 -3
- package/packages/server/src/session-diff.ts +21 -21
- package/packages/server/src/terminal-manager.ts +65 -20
- package/packages/server/src/test-env-guard.ts +26 -0
- package/packages/server/src/test-support/test-server.ts +63 -0
- package/packages/server/src/tunnel.ts +172 -34
- package/packages/shared/package.json +10 -3
- package/packages/shared/src/__tests__/{tool-resolver.test.ts → binary-lookup.test.ts} +32 -12
- package/packages/shared/src/__tests__/bootstrap/README.md +133 -0
- package/packages/shared/src/__tests__/bootstrap/__snapshots__/cube.test.ts.snap +370 -0
- package/packages/shared/src/__tests__/bootstrap/assertions.ts +136 -0
- package/packages/shared/src/__tests__/bootstrap/cube.test.ts +47 -0
- package/packages/shared/src/__tests__/bootstrap/cube.ts +66 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/a-electron.test.ts.snap +83 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/b-npm-global.test.ts.snap +89 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/c-dev-monorepo.test.ts.snap +33 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/d-overrides.test.ts.snap +20 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/e-stale-partial.test.ts.snap +61 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/f-cwd-variants.test.ts.snap +33 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/g-windows-specifics.test.ts.snap +46 -0
- package/packages/shared/src/__tests__/bootstrap/families/__snapshots__/j-path-gui-minimal.test.ts.snap +12 -0
- package/packages/shared/src/__tests__/bootstrap/families/a-electron.test.ts +156 -0
- package/packages/shared/src/__tests__/bootstrap/families/b-npm-global.test.ts +157 -0
- package/packages/shared/src/__tests__/bootstrap/families/c-dev-monorepo.test.ts +102 -0
- package/packages/shared/src/__tests__/bootstrap/families/d-overrides.test.ts +76 -0
- package/packages/shared/src/__tests__/bootstrap/families/e-stale-partial.test.ts +94 -0
- package/packages/shared/src/__tests__/bootstrap/families/f-cwd-variants.test.ts +87 -0
- package/packages/shared/src/__tests__/bootstrap/families/g-windows-specifics.test.ts +143 -0
- package/packages/shared/src/__tests__/bootstrap/families/h-home-drift.test.ts +64 -0
- package/packages/shared/src/__tests__/bootstrap/families/i-malformed-settings.test.ts +77 -0
- package/packages/shared/src/__tests__/bootstrap/families/index.ts +19 -0
- package/packages/shared/src/__tests__/bootstrap/families/j-path-gui-minimal.test.ts +61 -0
- package/packages/shared/src/__tests__/bootstrap/families/k-dashboard-absent.test.ts +50 -0
- package/packages/shared/src/__tests__/bootstrap/families/l-instance-coordination.test.ts +272 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/dev-monorepo.ts +58 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/electron-layout.ts +84 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/index.ts +9 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/managed-install.ts +85 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/npm-global-layout.ts +122 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/pi-versions.ts +36 -0
- package/packages/shared/src/__tests__/bootstrap/fixtures/settings-json.ts +39 -0
- package/packages/shared/src/__tests__/bootstrap/harness.smoke.test.ts +220 -0
- package/packages/shared/src/__tests__/bootstrap/harness.ts +413 -0
- package/packages/shared/src/__tests__/bootstrap/scenarios-skipped.ts +125 -0
- package/packages/shared/src/__tests__/bootstrap/scenarios.ts +132 -0
- package/packages/shared/src/__tests__/bridge-register.test.ts +29 -6
- package/packages/shared/src/__tests__/config-openspec.test.ts +106 -0
- package/packages/shared/src/__tests__/config.test.ts +59 -3
- package/packages/shared/src/__tests__/detached-spawn.test.ts +243 -0
- package/packages/shared/src/__tests__/managed-paths.test.ts +60 -0
- package/packages/shared/src/__tests__/no-direct-child-process.test.ts +112 -0
- package/packages/shared/src/__tests__/no-direct-platform-branch.test.ts +174 -0
- package/packages/shared/src/__tests__/no-direct-process-kill.test.ts +105 -0
- package/packages/shared/src/__tests__/openspec-poller.test.ts +44 -0
- package/packages/shared/src/__tests__/platform-commands.test.ts +108 -0
- package/packages/shared/src/__tests__/platform-exec.test.ts +103 -0
- package/packages/shared/src/__tests__/platform-git.test.ts +194 -0
- package/packages/shared/src/__tests__/platform-npm.test.ts +137 -0
- package/packages/shared/src/__tests__/platform-openspec.test.ts +92 -0
- package/packages/shared/src/__tests__/platform-paths.test.ts +284 -0
- package/packages/shared/src/__tests__/platform-process-scan.test.ts +55 -0
- package/packages/shared/src/__tests__/platform-process.test.ts +160 -0
- package/packages/shared/src/__tests__/platform-runner.test.ts +173 -0
- package/packages/shared/src/__tests__/platform-shell.test.ts +74 -0
- package/packages/shared/src/__tests__/process-identify.test.ts +113 -0
- package/packages/shared/src/__tests__/recommended-extensions.test.ts +156 -0
- package/packages/shared/src/__tests__/resolve-jiti.test.ts +43 -7
- package/packages/shared/src/__tests__/semaphore.test.ts +119 -0
- package/packages/shared/src/__tests__/source-matching.test.ts +143 -0
- package/packages/shared/src/__tests__/spawn-mechanism.test.ts +131 -0
- package/packages/shared/src/__tests__/tool-registry-definitions.test.ts +239 -0
- package/packages/shared/src/__tests__/tool-registry-overrides.test.ts +137 -0
- package/packages/shared/src/__tests__/tool-registry-registry.test.ts +343 -0
- package/packages/shared/src/bootstrap-install.ts +212 -0
- package/packages/shared/src/bridge-register.ts +87 -20
- package/packages/shared/src/browser-protocol.ts +93 -1
- package/packages/shared/src/config.ts +87 -15
- package/packages/shared/src/managed-paths.ts +31 -4
- package/packages/shared/src/openspec-poller.ts +71 -49
- package/packages/shared/src/{tool-resolver.ts → platform/binary-lookup.ts} +125 -25
- package/packages/shared/src/platform/commands.ts +100 -0
- package/packages/shared/src/platform/detached-spawn.ts +305 -0
- package/packages/shared/src/platform/exec.ts +220 -0
- package/packages/shared/src/platform/git.ts +155 -0
- package/packages/shared/src/platform/index.ts +15 -0
- package/packages/shared/src/platform/npm.ts +162 -0
- package/packages/shared/src/platform/openspec.ts +91 -0
- package/packages/shared/src/platform/paths.ts +276 -0
- package/packages/shared/src/platform/process-identify.ts +126 -0
- package/packages/shared/src/platform/process-scan.ts +94 -0
- package/packages/shared/src/platform/process.ts +168 -0
- package/packages/shared/src/platform/runner.ts +369 -0
- package/packages/shared/src/platform/shell.ts +44 -0
- package/packages/shared/src/platform/spawn-mechanism.ts +124 -0
- package/packages/shared/src/platform/subprocess-adapter.ts +124 -0
- package/packages/shared/src/recommended-extensions.ts +196 -0
- package/packages/shared/src/resolve-jiti.ts +62 -3
- package/packages/shared/src/rest-api.ts +97 -0
- package/packages/shared/src/semaphore.ts +83 -0
- package/packages/shared/src/source-matching.ts +126 -0
- package/packages/shared/src/test-support/setup-home.ts +74 -0
- package/packages/shared/src/tool-registry/definitions.ts +342 -0
- package/packages/shared/src/tool-registry/index.ts +56 -0
- package/packages/shared/src/tool-registry/overrides.ts +118 -0
- package/packages/shared/src/tool-registry/registry.ts +262 -0
- package/packages/shared/src/tool-registry/strategies.ts +198 -0
- package/packages/shared/src/tool-registry/types.ts +180 -0
- package/packages/shared/src/types.ts +7 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bulk-skip manifest for cells NOT yet covered by a family-test file.
|
|
3
|
+
*
|
|
4
|
+
* This is the "fail-closed by default" scaffold. Every cell in the
|
|
5
|
+
* cube starts SKIPPED with a documented reason. As family-test files
|
|
6
|
+
* are added, they call `register(cell, tag)` and the corresponding
|
|
7
|
+
* skip entry is automatically overridden (because registration takes
|
|
8
|
+
* precedence in the sweep).
|
|
9
|
+
*
|
|
10
|
+
* New cells added to the enumeration (by extending PLATFORMS,
|
|
11
|
+
* DASH_LOCATIONS, etc. in `scenarios.ts`) will fail the cube-sweep
|
|
12
|
+
* test until a decision is made here or in a family file.
|
|
13
|
+
*
|
|
14
|
+
* Call ordering invariant: this module MUST be imported before
|
|
15
|
+
* `sweepCube()` runs. Family-test files can import-and-register after
|
|
16
|
+
* this module runs — registration wins.
|
|
17
|
+
*/
|
|
18
|
+
import { enumerateCube, skip, type ScenarioCell } from "./scenarios.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Classify why a given cell is not interesting / not reachable in
|
|
22
|
+
* practice. Returns null when the cell is plausible and should be
|
|
23
|
+
* covered by a family file — such cells get a generic placeholder
|
|
24
|
+
* skip reason here so the cube sweep passes on day 1; families
|
|
25
|
+
* replace the skip with registration as they land.
|
|
26
|
+
*/
|
|
27
|
+
function skipReasonFor(cell: ScenarioCell): string {
|
|
28
|
+
// ── Combinations that are not real install layouts ────────────────
|
|
29
|
+
|
|
30
|
+
// AppImage tmp mount is Linux-only, and only occurs when dash ===
|
|
31
|
+
// "electron" via an AppImage package.
|
|
32
|
+
if (cell.pi === "appimage-tmp" && (cell.platform !== "linux" || cell.dash !== "electron")) {
|
|
33
|
+
return "appimage-tmp is Linux + electron only";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// "dev" dash implies a workspace checkout — only meaningful on
|
|
37
|
+
// developer machines (typically mac/linux). Windows dev happens but
|
|
38
|
+
// is rare; capture later if needed.
|
|
39
|
+
if (cell.dash === "dev" && cell.platform === "win32") {
|
|
40
|
+
return "dev monorepo on Windows — rare; capture if reported";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// "home-drift" env only meaningful on Windows (Git Bash sets $HOME
|
|
44
|
+
// differently from os.homedir). On posix, $HOME and os.homedir
|
|
45
|
+
// agree.
|
|
46
|
+
if (cell.env === "home-drift" && cell.platform !== "win32") {
|
|
47
|
+
return "home-drift is a Windows-specific phenomenon";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Malformed settings.json doesn't depend on pi state — the parse
|
|
51
|
+
// failure happens regardless. One test per platform is enough.
|
|
52
|
+
if (cell.settings === "malformed" && cell.pi !== "present-valid") {
|
|
53
|
+
return "malformed settings: one pi state per platform is sufficient";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Appimage + anything other than settings=missing is not a real
|
|
57
|
+
// first-run scenario (appimage is installed fresh).
|
|
58
|
+
if (cell.pi === "appimage-tmp" && cell.settings !== "missing") {
|
|
59
|
+
return "appimage fresh-run implies missing settings.json";
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// spaces-unicode env is orthogonal to most axes — one scenario per
|
|
63
|
+
// platform proves the invariant. Skip most combinations.
|
|
64
|
+
if (cell.env === "spaces-unicode" && cell.pi !== "present-valid") {
|
|
65
|
+
return "spaces-unicode: covered once per platform via pi=present-valid";
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ── Refined skip reasons (post families B-K) ──────────────────────
|
|
69
|
+
|
|
70
|
+
// Dashboard-absent is only interesting when pi is present (K1).
|
|
71
|
+
// Other combinations — pi absent without dashboard, etc. — are
|
|
72
|
+
// pathological and not reachable by any real install mechanic.
|
|
73
|
+
if (cell.dash === "absent" && cell.pi !== "present-valid") {
|
|
74
|
+
return "dashboard-absent only meaningful when pi is present (K1)";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Lock-file and instance-coordination cells land with proposal
|
|
78
|
+
// `single-dashboard-per-home`, which introduces a new axis (lock
|
|
79
|
+
// state) not modelled in this cube. The current cells remain
|
|
80
|
+
// skipped until that proposal extends the enumeration.
|
|
81
|
+
|
|
82
|
+
// TODO(unified-bootstrap-install): add three scenarios once this
|
|
83
|
+
// change's task 13 wires the bootstrap through the home-lock:
|
|
84
|
+
// - B1-post: "npm-g-dash-only + bootstrap install ran→ pi resolves
|
|
85
|
+
// via managed + bridge auto-registered". Requires
|
|
86
|
+
// extending the cube with a `bootstrap?: "pre"|"post"`
|
|
87
|
+
// axis or a new pi state `managed-installed-fresh`.
|
|
88
|
+
// - B4: "pi-dashboard installed via npm-g, extension resolves
|
|
89
|
+
// via node_modules lookup (findBundledExtension
|
|
90
|
+
// Strategy 2)". Requires a new `pi-ext-resolution`
|
|
91
|
+
// axis.
|
|
92
|
+
// - L2: "two simultaneous bootstraps" (requires lock from
|
|
93
|
+
// single-dashboard-per-home to be wired).
|
|
94
|
+
// Reason skipped today: requires lock from single-dashboard-per-home
|
|
95
|
+
// to be wired AND the cube to grow new axes. Track in harness
|
|
96
|
+
// follow-up. See change: unified-bootstrap-install tasks 2.3, 10.2,
|
|
97
|
+
// 11.2, 13.2.
|
|
98
|
+
|
|
99
|
+
// pi=malformed means partial install; resolution failure reason
|
|
100
|
+
// is identical across settings/env axes once pi state is fixed.
|
|
101
|
+
// E2 covers linux + win32; other combinations add no signal.
|
|
102
|
+
if (
|
|
103
|
+
cell.pi === "malformed"
|
|
104
|
+
&& cell.settings !== "empty"
|
|
105
|
+
&& !(cell.platform === "linux" || cell.platform === "win32")
|
|
106
|
+
) {
|
|
107
|
+
return "malformed pi: E2 covers linux+win32 — other settings/env add no signal";
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Remaining cells are plausible combinations with no dedicated
|
|
111
|
+
// family test. Documented as deliberate skips rather than gaps.
|
|
112
|
+
return "not yet covered — add family coverage when a bug reports here";
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Apply bulk skips. Called at module load.
|
|
117
|
+
*/
|
|
118
|
+
export function applyBulkSkips(): void {
|
|
119
|
+
for (const cell of enumerateCube()) {
|
|
120
|
+
skip(cell, skipReasonFor(cell));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Apply on import so scenario consumers see the full manifest.
|
|
125
|
+
applyBulkSkips();
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scenario registry — the authoritative record of which cells are
|
|
3
|
+
* tested, which are explicitly skipped (with a reason), and which
|
|
4
|
+
* are unknown (fail-closed on CI).
|
|
5
|
+
*
|
|
6
|
+
* See openspec/changes/bootstrap-resolution-harness/design.md §5.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** The canonical axes for the scenario cube. */
|
|
10
|
+
export const PLATFORMS = ["win32", "darwin", "linux"] as const;
|
|
11
|
+
export const DASH_LOCATIONS = ["electron", "npm-g", "dev", "managed", "absent"] as const;
|
|
12
|
+
export const PI_STATES = [
|
|
13
|
+
"absent",
|
|
14
|
+
"present-no-ext",
|
|
15
|
+
"present-stale-ext",
|
|
16
|
+
"present-valid",
|
|
17
|
+
"malformed",
|
|
18
|
+
"appimage-tmp",
|
|
19
|
+
] as const;
|
|
20
|
+
export const SETTINGS_STATES = ["missing", "empty", "valid", "malformed"] as const;
|
|
21
|
+
export const ENV_STATES = ["normal", "spaces-unicode", "home-drift"] as const;
|
|
22
|
+
|
|
23
|
+
export type Platform = (typeof PLATFORMS)[number];
|
|
24
|
+
export type DashLocation = (typeof DASH_LOCATIONS)[number];
|
|
25
|
+
export type PiState = (typeof PI_STATES)[number];
|
|
26
|
+
export type SettingsState = (typeof SETTINGS_STATES)[number];
|
|
27
|
+
export type EnvState = (typeof ENV_STATES)[number];
|
|
28
|
+
|
|
29
|
+
export interface ScenarioCell {
|
|
30
|
+
platform: Platform;
|
|
31
|
+
dash: DashLocation;
|
|
32
|
+
pi: PiState;
|
|
33
|
+
settings: SettingsState;
|
|
34
|
+
env: EnvState;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function cellKey(cell: ScenarioCell): string {
|
|
38
|
+
return [cell.platform, cell.dash, cell.pi, cell.settings, cell.env].join("/");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Parse a cell-key back into its components. */
|
|
42
|
+
export function parseCellKey(key: string): ScenarioCell | null {
|
|
43
|
+
const parts = key.split("/");
|
|
44
|
+
if (parts.length !== 5) return null;
|
|
45
|
+
const [platform, dash, pi, settings, env] = parts;
|
|
46
|
+
if (!PLATFORMS.includes(platform as Platform)) return null;
|
|
47
|
+
if (!DASH_LOCATIONS.includes(dash as DashLocation)) return null;
|
|
48
|
+
if (!PI_STATES.includes(pi as PiState)) return null;
|
|
49
|
+
if (!SETTINGS_STATES.includes(settings as SettingsState)) return null;
|
|
50
|
+
if (!ENV_STATES.includes(env as EnvState)) return null;
|
|
51
|
+
return {
|
|
52
|
+
platform: platform as Platform,
|
|
53
|
+
dash: dash as DashLocation,
|
|
54
|
+
pi: pi as PiState,
|
|
55
|
+
settings: settings as SettingsState,
|
|
56
|
+
env: env as EnvState,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Cells with an active test. Entries added by each family-test file
|
|
62
|
+
* via `register(cell, describeSymbol)`.
|
|
63
|
+
*
|
|
64
|
+
* The value is a string tag identifying the test file — useful for
|
|
65
|
+
* the cube-sweep error message ("cell X already covered by Y").
|
|
66
|
+
*/
|
|
67
|
+
export const REGISTERED_SCENARIOS = new Map<string, string>();
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Cells explicitly skipped with a documented reason. New cells added
|
|
71
|
+
* to the enumeration that don't land in REGISTERED or SKIPPED will
|
|
72
|
+
* fail CI (the fail-closed invariant).
|
|
73
|
+
*
|
|
74
|
+
* Format: key → human-readable reason.
|
|
75
|
+
*/
|
|
76
|
+
export const SKIPPED_SCENARIOS = new Map<string, string>();
|
|
77
|
+
|
|
78
|
+
/** Register a tested cell. Last-registered wins (tests may re-register during dev). */
|
|
79
|
+
export function register(cell: ScenarioCell, tag: string): void {
|
|
80
|
+
REGISTERED_SCENARIOS.set(cellKey(cell), tag);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Skip a cell with a reason. Required before CI accepts the new cell. */
|
|
84
|
+
export function skip(cell: ScenarioCell, reason: string): void {
|
|
85
|
+
if (!reason || reason.trim().length === 0) {
|
|
86
|
+
throw new Error(`SKIPPED_SCENARIOS entry for ${cellKey(cell)} requires a non-empty reason`);
|
|
87
|
+
}
|
|
88
|
+
SKIPPED_SCENARIOS.set(cellKey(cell), reason);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Mass-skip helper: all cells matching a partial pattern. */
|
|
92
|
+
export function skipPattern(
|
|
93
|
+
partial: Partial<ScenarioCell>,
|
|
94
|
+
reason: string,
|
|
95
|
+
): void {
|
|
96
|
+
for (const cell of enumerateCube()) {
|
|
97
|
+
let match = true;
|
|
98
|
+
for (const k of Object.keys(partial) as (keyof ScenarioCell)[]) {
|
|
99
|
+
if (cell[k] !== partial[k]) {
|
|
100
|
+
match = false;
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (match) skip(cell, reason);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Enumerate every combination. Order is stable (useful for snapshots
|
|
110
|
+
* and for deterministic error messages).
|
|
111
|
+
*/
|
|
112
|
+
export function enumerateCube(): ScenarioCell[] {
|
|
113
|
+
const out: ScenarioCell[] = [];
|
|
114
|
+
for (const platform of PLATFORMS) {
|
|
115
|
+
for (const dash of DASH_LOCATIONS) {
|
|
116
|
+
for (const pi of PI_STATES) {
|
|
117
|
+
for (const settings of SETTINGS_STATES) {
|
|
118
|
+
for (const env of ENV_STATES) {
|
|
119
|
+
out.push({ platform, dash, pi, settings, env });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return out;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Reset state — used only by tests that want to verify the cube logic itself. */
|
|
129
|
+
export function __resetScenariosForTesting(): void {
|
|
130
|
+
REGISTERED_SCENARIOS.clear();
|
|
131
|
+
SKIPPED_SCENARIOS.clear();
|
|
132
|
+
}
|
|
@@ -46,22 +46,45 @@ describe("shared bridge-register", () => {
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
it("returns null when extension dir does not exist", () => {
|
|
49
|
-
|
|
49
|
+
// Disable Strategy 2 (node-resolver fallback) so we test Strategy 1 in isolation.
|
|
50
|
+
expect(findBundledExtension(tmpDir, { resolvePackage: () => null })).toBeNull();
|
|
50
51
|
});
|
|
51
52
|
|
|
52
53
|
it("returns null when no package.json in extension dir", () => {
|
|
53
54
|
const extDir = path.join(tmpDir, "packages", "extension");
|
|
54
55
|
fs.mkdirSync(extDir, { recursive: true });
|
|
55
56
|
// No package.json
|
|
56
|
-
expect(findBundledExtension(tmpDir)).toBeNull();
|
|
57
|
+
expect(findBundledExtension(tmpDir, { resolvePackage: () => null })).toBeNull();
|
|
57
58
|
});
|
|
58
59
|
|
|
59
60
|
it("returns null for AppImage temp mount paths", () => {
|
|
60
|
-
// We can't easily create a /tmp/.mount_ path, but we can verify
|
|
61
|
-
// the function handles it via the string check
|
|
62
61
|
const mockBase = "/tmp/.mount_PI1234/resources/server";
|
|
63
|
-
//
|
|
64
|
-
|
|
62
|
+
// Even with a resolvable node-modules extension, if that resolved path is
|
|
63
|
+
// itself under /tmp/.mount_* it must be rejected (tested separately below).
|
|
64
|
+
expect(findBundledExtension(mockBase, { resolvePackage: () => null })).toBeNull();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("Strategy 2 — falls back to require.resolve when baseDir has no packages/extension", () => {
|
|
68
|
+
// Simulate `npm i -g pi-dashboard` layout: baseDir is the server
|
|
69
|
+
// package root and contains no `packages/extension/`, but the
|
|
70
|
+
// extension is resolvable as a runtime dep via node_modules.
|
|
71
|
+
const fakeExtDir = path.join(tmpDir, "fake-node_modules", "pi-dashboard-extension");
|
|
72
|
+
fs.mkdirSync(fakeExtDir, { recursive: true });
|
|
73
|
+
fs.writeFileSync(path.join(fakeExtDir, "package.json"), '{"name":"fake"}');
|
|
74
|
+
const resolved = findBundledExtension(tmpDir, {
|
|
75
|
+
resolvePackage: () => path.join(fakeExtDir, "package.json"),
|
|
76
|
+
});
|
|
77
|
+
expect(resolved).toBe(fakeExtDir);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it("Strategy 2 — rejects AppImage-mount paths even when resolvable", () => {
|
|
81
|
+
// A /tmp/.mount_* path must be rejected regardless of which strategy
|
|
82
|
+
// surfaced it.
|
|
83
|
+
const appImageExtDir = "/tmp/.mount_PI1234/node_modules/@blackbelt-technology/pi-dashboard-extension";
|
|
84
|
+
const resolved = findBundledExtension(tmpDir, {
|
|
85
|
+
resolvePackage: () => path.join(appImageExtDir, "package.json"),
|
|
86
|
+
});
|
|
87
|
+
expect(resolved).toBeNull();
|
|
65
88
|
});
|
|
66
89
|
});
|
|
67
90
|
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import os from "node:os";
|
|
5
|
+
import { loadConfig, DEFAULT_OPENSPEC_POLL } from "../config.js";
|
|
6
|
+
|
|
7
|
+
describe("loadConfig — openspec poll block", () => {
|
|
8
|
+
let testDir: string;
|
|
9
|
+
let configFile: string;
|
|
10
|
+
let origHome: string;
|
|
11
|
+
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
testDir = path.join(os.tmpdir(), `test-config-openspec-${Date.now()}-${Math.random().toString(36).slice(2)}`);
|
|
14
|
+
fs.mkdirSync(path.join(testDir, ".pi", "dashboard"), { recursive: true });
|
|
15
|
+
configFile = path.join(testDir, ".pi", "dashboard", "config.json");
|
|
16
|
+
origHome = process.env.HOME!;
|
|
17
|
+
process.env.HOME = testDir;
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
afterEach(() => {
|
|
21
|
+
process.env.HOME = origHome;
|
|
22
|
+
if (fs.existsSync(testDir)) fs.rmSync(testDir, { recursive: true });
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("applies all defaults when openspec block is missing", () => {
|
|
26
|
+
fs.writeFileSync(configFile, JSON.stringify({ port: 8000 }));
|
|
27
|
+
const cfg = loadConfig();
|
|
28
|
+
expect(cfg.openspec).toEqual(DEFAULT_OPENSPEC_POLL);
|
|
29
|
+
expect(cfg.openspec.pollIntervalSeconds).toBe(30);
|
|
30
|
+
expect(cfg.openspec.maxConcurrentSpawns).toBe(3);
|
|
31
|
+
expect(cfg.openspec.changeDetection).toBe("mtime");
|
|
32
|
+
expect(cfg.openspec.jitterSeconds).toBe(5);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("accepts valid values", () => {
|
|
36
|
+
fs.writeFileSync(configFile, JSON.stringify({
|
|
37
|
+
openspec: { pollIntervalSeconds: 60, maxConcurrentSpawns: 5, changeDetection: "always", jitterSeconds: 10 },
|
|
38
|
+
}));
|
|
39
|
+
const cfg = loadConfig();
|
|
40
|
+
expect(cfg.openspec.pollIntervalSeconds).toBe(60);
|
|
41
|
+
expect(cfg.openspec.maxConcurrentSpawns).toBe(5);
|
|
42
|
+
expect(cfg.openspec.changeDetection).toBe("always");
|
|
43
|
+
expect(cfg.openspec.jitterSeconds).toBe(10);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("clamps pollIntervalSeconds below the minimum (5)", () => {
|
|
47
|
+
fs.writeFileSync(configFile, JSON.stringify({ openspec: { pollIntervalSeconds: 1 } }));
|
|
48
|
+
expect(loadConfig().openspec.pollIntervalSeconds).toBe(5);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("clamps pollIntervalSeconds above the maximum (3600)", () => {
|
|
52
|
+
fs.writeFileSync(configFile, JSON.stringify({ openspec: { pollIntervalSeconds: 999_999 } }));
|
|
53
|
+
expect(loadConfig().openspec.pollIntervalSeconds).toBe(3600);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("clamps maxConcurrentSpawns to [1, 16]", () => {
|
|
57
|
+
fs.writeFileSync(configFile, JSON.stringify({ openspec: { maxConcurrentSpawns: 0 } }));
|
|
58
|
+
expect(loadConfig().openspec.maxConcurrentSpawns).toBe(1);
|
|
59
|
+
|
|
60
|
+
fs.writeFileSync(configFile, JSON.stringify({ openspec: { maxConcurrentSpawns: 100 } }));
|
|
61
|
+
expect(loadConfig().openspec.maxConcurrentSpawns).toBe(16);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("clamps jitterSeconds to [0, 60]", () => {
|
|
65
|
+
fs.writeFileSync(configFile, JSON.stringify({ openspec: { jitterSeconds: -5 } }));
|
|
66
|
+
expect(loadConfig().openspec.jitterSeconds).toBe(0);
|
|
67
|
+
|
|
68
|
+
fs.writeFileSync(configFile, JSON.stringify({ openspec: { jitterSeconds: 120 } }));
|
|
69
|
+
expect(loadConfig().openspec.jitterSeconds).toBe(60);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it("falls back to 'mtime' when changeDetection is unknown", () => {
|
|
73
|
+
fs.writeFileSync(configFile, JSON.stringify({ openspec: { changeDetection: "bogus" } }));
|
|
74
|
+
expect(loadConfig().openspec.changeDetection).toBe("mtime");
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("coerces non-number values to defaults", () => {
|
|
78
|
+
fs.writeFileSync(configFile, JSON.stringify({
|
|
79
|
+
openspec: { pollIntervalSeconds: "thirty", maxConcurrentSpawns: null, jitterSeconds: undefined },
|
|
80
|
+
}));
|
|
81
|
+
const cfg = loadConfig();
|
|
82
|
+
expect(cfg.openspec.pollIntervalSeconds).toBe(30);
|
|
83
|
+
expect(cfg.openspec.maxConcurrentSpawns).toBe(3);
|
|
84
|
+
expect(cfg.openspec.jitterSeconds).toBe(5);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it("ignores unknown keys in the openspec block", () => {
|
|
88
|
+
fs.writeFileSync(configFile, JSON.stringify({
|
|
89
|
+
openspec: { pollIntervalSeconds: 45, nonsenseField: "ignored", another: 42 },
|
|
90
|
+
}));
|
|
91
|
+
const cfg = loadConfig();
|
|
92
|
+
expect(cfg.openspec.pollIntervalSeconds).toBe(45);
|
|
93
|
+
expect((cfg.openspec as any).nonsenseField).toBeUndefined();
|
|
94
|
+
expect((cfg.openspec as any).another).toBeUndefined();
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it("is stable through round-trip (load → stringify → load)", () => {
|
|
98
|
+
fs.writeFileSync(configFile, JSON.stringify({
|
|
99
|
+
openspec: { pollIntervalSeconds: 90, maxConcurrentSpawns: 4, changeDetection: "always", jitterSeconds: 12 },
|
|
100
|
+
}));
|
|
101
|
+
const first = loadConfig();
|
|
102
|
+
fs.writeFileSync(configFile, JSON.stringify(first));
|
|
103
|
+
const second = loadConfig();
|
|
104
|
+
expect(second.openspec).toEqual(first.openspec);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
@@ -27,7 +27,7 @@ describe("loadConfig", () => {
|
|
|
27
27
|
expect(config.port).toBe(8000);
|
|
28
28
|
expect(config.piPort).toBe(9999);
|
|
29
29
|
expect(config.autoStart).toBe(true);
|
|
30
|
-
expect(config.autoShutdown).toBe(
|
|
30
|
+
expect(config.autoShutdown).toBe(false);
|
|
31
31
|
expect(config.lastServer).toBeUndefined();
|
|
32
32
|
expect(config.shutdownIdleSeconds).toBe(300);
|
|
33
33
|
});
|
|
@@ -52,7 +52,7 @@ describe("loadConfig", () => {
|
|
|
52
52
|
expect(config.port).toBe(3000);
|
|
53
53
|
expect(config.piPort).toBe(9999);
|
|
54
54
|
expect(config.autoStart).toBe(true);
|
|
55
|
-
expect(config.autoShutdown).toBe(
|
|
55
|
+
expect(config.autoShutdown).toBe(false);
|
|
56
56
|
expect(config.shutdownIdleSeconds).toBe(300);
|
|
57
57
|
});
|
|
58
58
|
|
|
@@ -304,6 +304,62 @@ describe("loadConfig", () => {
|
|
|
304
304
|
const config = loadConfig();
|
|
305
305
|
expect(config.electronMode).toBe(false);
|
|
306
306
|
});
|
|
307
|
+
|
|
308
|
+
// ── fix-trusted-networks-no-oauth regression tests ──────────────────
|
|
309
|
+
// These assert that auth.bypassHosts and auth.bypassUrls are honored
|
|
310
|
+
// at load time EVEN WHEN auth.providers is empty or absent. Before the
|
|
311
|
+
// fix, parseAuthConfig returned undefined whenever providers was empty,
|
|
312
|
+
// nuking bypassHosts before the resolvedTrustedNetworks merge could
|
|
313
|
+
// read it. See openspec/changes/fix-trusted-networks-no-oauth/.
|
|
314
|
+
|
|
315
|
+
it("should honor auth.bypassHosts when providers is {} (task 1.1)", () => {
|
|
316
|
+
fs.writeFileSync(configFile, JSON.stringify({
|
|
317
|
+
auth: { providers: {}, bypassHosts: ["192.168.1.0/24"] },
|
|
318
|
+
}));
|
|
319
|
+
const config = loadConfig();
|
|
320
|
+
expect(config.auth).toBeDefined();
|
|
321
|
+
expect(config.auth!.bypassHosts).toEqual(["192.168.1.0/24"]);
|
|
322
|
+
expect(config.resolvedTrustedNetworks).toContain("192.168.1.0/24");
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
it("should honor auth.bypassHosts when no providers key at all (task 1.2)", () => {
|
|
326
|
+
fs.writeFileSync(configFile, JSON.stringify({
|
|
327
|
+
auth: { bypassHosts: ["10.0.0.0/8"] },
|
|
328
|
+
}));
|
|
329
|
+
const config = loadConfig();
|
|
330
|
+
expect(config.auth).toBeDefined();
|
|
331
|
+
expect(config.auth!.bypassHosts).toEqual(["10.0.0.0/8"]);
|
|
332
|
+
expect(config.resolvedTrustedNetworks).toContain("10.0.0.0/8");
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
it("should honor auth.bypassUrls when providers is {} (task 1.3)", () => {
|
|
336
|
+
fs.writeFileSync(configFile, JSON.stringify({
|
|
337
|
+
auth: { providers: {}, bypassUrls: ["/webhooks/"] },
|
|
338
|
+
}));
|
|
339
|
+
const config = loadConfig();
|
|
340
|
+
expect(config.auth).toBeDefined();
|
|
341
|
+
expect(config.auth!.bypassUrls).toEqual(["/webhooks/"]);
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
it("should return auth undefined when providers={} and all bypass arrays are empty (task 1.4 boundary)", () => {
|
|
345
|
+
fs.writeFileSync(configFile, JSON.stringify({
|
|
346
|
+
auth: { providers: {}, bypassHosts: [], bypassUrls: [] },
|
|
347
|
+
}));
|
|
348
|
+
const config = loadConfig();
|
|
349
|
+
// Truly empty auth → still undefined (boundary preserved)
|
|
350
|
+
expect(config.auth).toBeUndefined();
|
|
351
|
+
expect(config.resolvedTrustedNetworks).toEqual([]);
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
it("should merge top-level trustedNetworks with bypassHosts when no providers", () => {
|
|
355
|
+
fs.writeFileSync(configFile, JSON.stringify({
|
|
356
|
+
trustedNetworks: ["192.168.1.0/24"],
|
|
357
|
+
auth: { providers: {}, bypassHosts: ["10.0.0.0/8"] },
|
|
358
|
+
}));
|
|
359
|
+
const config = loadConfig();
|
|
360
|
+
expect(config.resolvedTrustedNetworks).toContain("192.168.1.0/24");
|
|
361
|
+
expect(config.resolvedTrustedNetworks).toContain("10.0.0.0/8");
|
|
362
|
+
});
|
|
307
363
|
});
|
|
308
364
|
|
|
309
365
|
describe("ensureConfig", () => {
|
|
@@ -333,7 +389,7 @@ describe("ensureConfig", () => {
|
|
|
333
389
|
expect(content.port).toBe(8000);
|
|
334
390
|
expect(content.piPort).toBe(9999);
|
|
335
391
|
expect(content.autoStart).toBe(true);
|
|
336
|
-
expect(content.autoShutdown).toBe(
|
|
392
|
+
expect(content.autoShutdown).toBe(false);
|
|
337
393
|
expect(content.shutdownIdleSeconds).toBe(300);
|
|
338
394
|
expect(content.devBuildOnReload).toBe(false);
|
|
339
395
|
expect(content.electronMode).toBeUndefined();
|