@harness-fe/unplugin 4.0.0-next.6 → 4.0.0-next.8

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/core.js CHANGED
@@ -203,7 +203,7 @@ export const unpluginFactory = (options = {}) => {
203
203
  return html;
204
204
  const injection = `<!-- @harness-fe injected (dev only) -->
205
205
  <script>
206
- window.__HARNESS_FE__ = ${JSON.stringify({ projectId, mcpUrl, buildId: identity.getBuildId(projectRoot), parentProjectId: options.parentProjectId, displayName: identity.getDisplayName(projectRoot) })};
206
+ window.__HARNESS_FE__ = ${JSON.stringify({ projectId, mcpUrl, buildId: identity.getBuildId(projectRoot), parentProjectId: options.parentProjectId, displayName: identity.getDisplayName(projectRoot), overlay: options.overlay ?? true, consent: options.consent })};
207
207
  </script>
208
208
  <script type="module">import '${VIRTUAL_RUNTIME_ID}';</script>`;
209
209
  return html.replace(/<\/head>/i, `${injection}\n</head>`);
@@ -36,6 +36,19 @@ export interface HarnessFEOptions {
36
36
  * its own output to catch any mis-aligned attribute injection.
37
37
  */
38
38
  safeMode?: boolean;
39
+ /**
40
+ * Show the in-page "H" overlay (default: true). Set to false to hide the
41
+ * overlay in production dogfood scenarios — data capture is unaffected.
42
+ */
43
+ overlay?: boolean;
44
+ /**
45
+ * Browser consent policy. When set, takes priority over the gateway
46
+ * hello.ack consent mode.
47
+ * 'off' — no user prompt, control commands run freely (default)
48
+ * 'session' — user grants once per page-load
49
+ * 'always' — prompt before every control command
50
+ */
51
+ consent?: 'off' | 'session' | 'always';
39
52
  }
40
53
  /**
41
54
  * Context handed to the MCP client. Getters keep the values fresh as the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harness-fe/unplugin",
3
- "version": "4.0.0-next.6",
3
+ "version": "4.0.0-next.8",
4
4
  "description": "Unified build plugin for Harness-FE. Supports Vite, Rspack, esbuild, and Rollup via unplugin. Webpack users should use @harness-fe/webpack (native plugin) instead.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -52,10 +52,10 @@
52
52
  "magic-string": "^0.30.21",
53
53
  "unplugin": "^2.3.2",
54
54
  "ws": "^8.18.0",
55
- "@harness-fe/protocol": "4.0.0-next.6"
55
+ "@harness-fe/protocol": "4.0.0-next.8"
56
56
  },
57
57
  "optionalDependencies": {
58
- "@harness-fe/cli": "4.0.0-next.6"
58
+ "@harness-fe/cli": "4.0.0-next.8"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@types/babel__traverse": "^7.28.0",
package/src/core.ts CHANGED
@@ -219,7 +219,7 @@ export const unpluginFactory: UnpluginFactory<HarnessFEOptions | undefined> = (o
219
219
  if (options.disabled) return html;
220
220
  const injection = `<!-- @harness-fe injected (dev only) -->
221
221
  <script>
222
- window.__HARNESS_FE__ = ${JSON.stringify({ projectId, mcpUrl, buildId: identity.getBuildId(projectRoot), parentProjectId: options.parentProjectId, displayName: identity.getDisplayName(projectRoot) })};
222
+ window.__HARNESS_FE__ = ${JSON.stringify({ projectId, mcpUrl, buildId: identity.getBuildId(projectRoot), parentProjectId: options.parentProjectId, displayName: identity.getDisplayName(projectRoot), overlay: options.overlay ?? true, consent: options.consent })};
223
223
  </script>
224
224
  <script type="module">import '${VIRTUAL_RUNTIME_ID}';</script>`;
225
225
  return html.replace(/<\/head>/i, `${injection}\n</head>`);
@@ -39,6 +39,19 @@ export interface HarnessFEOptions {
39
39
  * its own output to catch any mis-aligned attribute injection.
40
40
  */
41
41
  safeMode?: boolean;
42
+ /**
43
+ * Show the in-page "H" overlay (default: true). Set to false to hide the
44
+ * overlay in production dogfood scenarios — data capture is unaffected.
45
+ */
46
+ overlay?: boolean;
47
+ /**
48
+ * Browser consent policy. When set, takes priority over the gateway
49
+ * hello.ack consent mode.
50
+ * 'off' — no user prompt, control commands run freely (default)
51
+ * 'session' — user grants once per page-load
52
+ * 'always' — prompt before every control command
53
+ */
54
+ consent?: 'off' | 'session' | 'always';
42
55
  }
43
56
 
44
57
  /**