@harness-fe/runtime 4.0.0-next.0 → 4.0.0-next.4

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/dist/index.js CHANGED
@@ -7,8 +7,7 @@
7
7
  import { installOverlay } from './overlay.js';
8
8
  import { RuntimeClient, readInjectedConfig } from './client.js';
9
9
  import { registerOverlayPlugin, drainPluginQueue, } from './pluginRegistry.js';
10
- // Informational; keep in sync with package.json on release.
11
- const VERSION = '3.3.0';
10
+ import { VERSION } from './version.js';
12
11
  const w = window;
13
12
  if (typeof window !== 'undefined' && !w.__harness_fe_started__) {
14
13
  w.__harness_fe_started__ = true;
package/dist/overlay.js CHANGED
@@ -16,6 +16,7 @@
16
16
  import { EVENT_NAME, } from '@harness-fe/protocol';
17
17
  import { snapdom } from '@zumer/snapdom';
18
18
  import { deriveDashboardUrl } from './dashboardUrl.js';
19
+ import { VERSION } from './version.js';
19
20
  import { getCaptureStore } from './capture.js';
20
21
  import { collectPageLoadSnapshot } from './snapshot.js';
21
22
  import { getOverlayPlugins, subscribeOverlayPlugins, } from './pluginRegistry.js';
@@ -411,11 +412,13 @@ export function installOverlay(client) {
411
412
  // ─── Info card rendering ─────────────────────────────────────────────
412
413
  const renderInfo = () => {
413
414
  const proj = infoCard.querySelector('[data-role=project]');
415
+ const version = infoCard.querySelector('[data-role=version]');
414
416
  const build = infoCard.querySelector('[data-role=build]');
415
417
  const session = infoCard.querySelector('[data-role=session]');
416
418
  const tab = infoCard.querySelector('[data-role=tab]');
417
419
  const url = infoCard.querySelector('[data-role=url]');
418
420
  proj.textContent = client.displayName ?? client.projectId;
421
+ version.textContent = `v${VERSION}`;
419
422
  build.textContent = client.buildId ? abbr(client.buildId) : '—';
420
423
  build.title = client.buildId ?? 'No buildId — set HarnessScript buildId prop in prod';
421
424
  session.textContent = abbr(client.sessionId);
@@ -1969,6 +1972,7 @@ function buildInfoCard() {
1969
1972
  <button class="close-btn" data-role="close" title="Close (Esc)" type="button">×</button>
1970
1973
  </div>
1971
1974
  <div class="rows">
1975
+ <div class="row"><span class="key">version</span><span class="pill" data-role="version" title="harness runtime version"></span></div>
1972
1976
  <div class="row"><span class="key">build</span><span class="pill" data-role="build" title="Click to copy"></span></div>
1973
1977
  <div class="row"><span class="key">session</span><span class="pill" data-role="session" title="Click to copy"></span></div>
1974
1978
  <div class="row"><span class="key">tab</span><span class="pill" data-role="tab" title="Click to copy"></span></div>
@@ -0,0 +1 @@
1
+ export declare const VERSION = "4.0.0-next.4";
@@ -0,0 +1,3 @@
1
+ // AUTO-GENERATED by scripts/gen-version.mjs — do not edit by hand.
2
+ // Sourced from package.json at build time so the runtime reports its real version.
3
+ export const VERSION = '4.0.0-next.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harness-fe/runtime",
3
- "version": "4.0.0-next.0",
3
+ "version": "4.0.0-next.4",
4
4
  "description": "Browser-side SDK injected into the dev page. Connects to the MCP server via WebSocket and executes commands.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "@zumer/snapdom": "^2.12.0",
32
32
  "rrweb": "2.0.0-alpha.4",
33
- "@harness-fe/protocol": "4.0.0-next.0",
33
+ "@harness-fe/protocol": "4.0.0-next.4",
34
34
  "@harness-fe/sandbox": "^3.2.0"
35
35
  },
36
36
  "devDependencies": {
@@ -42,9 +42,9 @@
42
42
  "access": "public"
43
43
  },
44
44
  "scripts": {
45
- "build": "tsc",
46
- "dev": "tsc --watch --preserveWatchOutput",
47
- "watch": "tsc --watch --preserveWatchOutput",
45
+ "build": "node scripts/gen-version.mjs && tsc",
46
+ "dev": "node scripts/gen-version.mjs && tsc --watch --preserveWatchOutput",
47
+ "watch": "node scripts/gen-version.mjs && tsc --watch --preserveWatchOutput",
48
48
  "typecheck": "tsc --noEmit",
49
49
  "test": "vitest run"
50
50
  }
package/src/index.ts CHANGED
@@ -12,9 +12,7 @@ import {
12
12
  drainPluginQueue,
13
13
  type OverlayPlugin,
14
14
  } from './pluginRegistry.js';
15
-
16
- // Informational; keep in sync with package.json on release.
17
- const VERSION = '3.3.0';
15
+ import { VERSION } from './version.js';
18
16
 
19
17
  const w = window as unknown as {
20
18
  __harness_fe_started__?: boolean;
@@ -58,6 +58,8 @@ describe('installOverlay', () => {
58
58
  const card = root.querySelector('.info-card') as HTMLElement;
59
59
  expect(card.style.display).toBe('flex');
60
60
  expect(root.querySelector('[data-role=project]')!.textContent).toBe('Demo App');
61
+ // Runtime version surfaced in the card (real value from version.ts).
62
+ expect(root.querySelector('[data-role=version]')!.textContent).toMatch(/^v\d/);
61
63
  // Abbreviated to 8 chars
62
64
  expect(root.querySelector('[data-role=build]')!.textContent).toBe('build-12');
63
65
  expect(root.querySelector('[data-role=session]')!.textContent).toBe('sess-123');
package/src/overlay.ts CHANGED
@@ -24,6 +24,7 @@ import {
24
24
  } from '@harness-fe/protocol';
25
25
  import { snapdom } from '@zumer/snapdom';
26
26
  import { deriveDashboardUrl } from './dashboardUrl.js';
27
+ import { VERSION } from './version.js';
27
28
  import { getCaptureStore } from './capture.js';
28
29
  import { collectPageLoadSnapshot } from './snapshot.js';
29
30
  import {
@@ -482,11 +483,13 @@ export function installOverlay(client: OverlayClient): void {
482
483
  // ─── Info card rendering ─────────────────────────────────────────────
483
484
  const renderInfo = () => {
484
485
  const proj = infoCard.querySelector<HTMLElement>('[data-role=project]')!;
486
+ const version = infoCard.querySelector<HTMLElement>('[data-role=version]')!;
485
487
  const build = infoCard.querySelector<HTMLElement>('[data-role=build]')!;
486
488
  const session = infoCard.querySelector<HTMLElement>('[data-role=session]')!;
487
489
  const tab = infoCard.querySelector<HTMLElement>('[data-role=tab]')!;
488
490
  const url = infoCard.querySelector<HTMLElement>('[data-role=url]')!;
489
491
  proj.textContent = client.displayName ?? client.projectId;
492
+ version.textContent = `v${VERSION}`;
490
493
  build.textContent = client.buildId ? abbr(client.buildId) : '—';
491
494
  build.title = client.buildId ?? 'No buildId — set HarnessScript buildId prop in prod';
492
495
  session.textContent = abbr(client.sessionId);
@@ -2113,6 +2116,7 @@ function buildInfoCard(): HTMLDivElement {
2113
2116
  <button class="close-btn" data-role="close" title="Close (Esc)" type="button">×</button>
2114
2117
  </div>
2115
2118
  <div class="rows">
2119
+ <div class="row"><span class="key">version</span><span class="pill" data-role="version" title="harness runtime version"></span></div>
2116
2120
  <div class="row"><span class="key">build</span><span class="pill" data-role="build" title="Click to copy"></span></div>
2117
2121
  <div class="row"><span class="key">session</span><span class="pill" data-role="session" title="Click to copy"></span></div>
2118
2122
  <div class="row"><span class="key">tab</span><span class="pill" data-role="tab" title="Click to copy"></span></div>
@@ -24,11 +24,11 @@ vi.mock('rrweb', () => ({
24
24
  import { mkdtempSync, rmSync } from 'node:fs';
25
25
  import { tmpdir } from 'node:os';
26
26
  import { join } from 'node:path';
27
- import { Bridge } from '../../mcp-server/src/bridge.js';
28
- import { JsonlStore } from '../../mcp-server/src/store/index.js';
27
+ import { Bridge } from '../../daemon/src/bridge.js';
28
+ import { JsonlStore } from '../../daemon/src/store/index.js';
29
29
  import { RuntimeClient } from './client.js';
30
30
  import { getCaptureStore } from './capture.js';
31
- import type { StoreEvent } from '../../mcp-server/src/store/index.js';
31
+ import type { StoreEvent } from '../../daemon/src/store/index.js';
32
32
  import type { NetworkEntry, StorageEntry, WsEntry } from '@harness-fe/protocol';
33
33
 
34
34
  interface Env {
package/src/version.ts ADDED
@@ -0,0 +1,3 @@
1
+ // AUTO-GENERATED by scripts/gen-version.mjs — do not edit by hand.
2
+ // Sourced from package.json at build time so the runtime reports its real version.
3
+ export const VERSION = '4.0.0-next.4';