@evomap/evolver-webui 2.0.0-beta.4 → 2.0.0-beta.6

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/server.js +3 -10
  2. package/package.json +2 -2
package/dist/server.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { createServer } from 'node:http';
2
2
  import { randomBytes, timingSafeEqual } from 'node:crypto';
3
- import { events as ev, assetstore, mailbox as mb, ops } from '@evomap/evolver-core';
3
+ import { events as ev, assetstore, mailbox as mb, ops, util } from '@evomap/evolver-core';
4
4
  import { CONSOLE_HTML } from './console.js';
5
5
  import { EventSnapshotCache, fileEventSnapshotSource } from './eventSnapshot.js';
6
6
  import { listLineageAssets, loadAssetLineage } from './assetLineage.js';
@@ -8,13 +8,6 @@ import { eventListRelations } from './observabilityRelations.js';
8
8
  import { redactDiagnosticText, sanitizeDiagnosticValue } from './diagnosticSanitize.js';
9
9
  const LOOPBACK = new Set(['127.0.0.1', '::1', '::ffff:127.0.0.1']);
10
10
  const DASHBOARD_COOKIE = 'evolver_dashboard';
11
- const BROWSER_BLOCKED_PORTS = new Set([
12
- 1, 7, 9, 11, 13, 15, 17, 19, 20, 21, 22, 23, 25, 37, 42, 43, 53, 69, 77, 79, 87, 95,
13
- 101, 102, 103, 104, 109, 110, 111, 113, 115, 117, 119, 123, 135, 137, 139, 143, 161, 179,
14
- 389, 427, 465, 512, 513, 514, 515, 526, 530, 531, 532, 540, 548, 554, 556, 563, 587, 601,
15
- 636, 989, 990, 993, 995, 1719, 1720, 1723, 2049, 3659, 4045, 5060, 5061, 6000, 6566,
16
- 6665, 6666, 6667, 6668, 6669, 6697, 10080,
17
- ]);
18
11
  /** The empty value summary (zero entries) — the shape /api/value returns when no provider is wired, so the card
19
12
  * always gets a valid ValueSummary to render. Derived from core's aggregator to stay shape-identical. */
20
13
  const EMPTY_VALUE_SUMMARY = ops.valueSummary([]);
@@ -117,11 +110,11 @@ export class WebUIServer {
117
110
  this.server = createServer((req, res) => { void this.handle(req, res); });
118
111
  }
119
112
  async listen(port = 0) {
120
- if (port !== 0 && BROWSER_BLOCKED_PORTS.has(port))
113
+ if (port !== 0 && util.isFetchForbiddenPort(port))
121
114
  throw new Error('webui_port_blocked');
122
115
  for (let attempt = 0; attempt < 5; attempt += 1) {
123
116
  const assigned = await this.listenOnce(port);
124
- if (port !== 0 || !BROWSER_BLOCKED_PORTS.has(assigned))
117
+ if (port !== 0 || !util.isFetchForbiddenPort(assigned))
125
118
  return assigned;
126
119
  await this.close();
127
120
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evomap/evolver-webui",
3
- "version": "2.0.0-beta.4",
3
+ "version": "2.0.0-beta.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "保活/可视化 WebUI",
@@ -13,7 +13,7 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "@evomap/evolver-core": "2.0.0-beta.4"
16
+ "@evomap/evolver-core": "2.0.0-beta.6"
17
17
  },
18
18
  "repository": {
19
19
  "type": "git",