@hover-dev/core 0.17.0 → 0.19.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.
Files changed (109) hide show
  1. package/dist/engine.d.ts +16 -39
  2. package/dist/engine.d.ts.map +1 -1
  3. package/dist/engine.js +18 -67
  4. package/dist/specs/pageObjectManifest.d.ts.map +1 -1
  5. package/dist/specs/pageObjectManifest.js +11 -10
  6. package/dist/specs/replayGrounded.d.ts.map +1 -1
  7. package/dist/specs/writeApiSpec.d.ts +36 -0
  8. package/dist/specs/writeApiSpec.d.ts.map +1 -0
  9. package/dist/specs/writeApiSpec.js +94 -0
  10. package/package.json +5 -22
  11. package/dist/agents/argv.d.ts +0 -11
  12. package/dist/agents/argv.d.ts.map +0 -1
  13. package/dist/agents/argv.js +0 -23
  14. package/dist/agents/claude.d.ts +0 -3
  15. package/dist/agents/claude.d.ts.map +0 -1
  16. package/dist/agents/claude.js +0 -220
  17. package/dist/agents/codex.d.ts +0 -19
  18. package/dist/agents/codex.d.ts.map +0 -1
  19. package/dist/agents/codex.js +0 -231
  20. package/dist/agents/detect.d.ts +0 -46
  21. package/dist/agents/detect.d.ts.map +0 -1
  22. package/dist/agents/detect.js +0 -80
  23. package/dist/agents/gemini.d.ts +0 -17
  24. package/dist/agents/gemini.d.ts.map +0 -1
  25. package/dist/agents/gemini.js +0 -186
  26. package/dist/agents/index.d.ts +0 -6
  27. package/dist/agents/index.d.ts.map +0 -1
  28. package/dist/agents/index.js +0 -5
  29. package/dist/agents/invoke.d.ts +0 -12
  30. package/dist/agents/invoke.d.ts.map +0 -1
  31. package/dist/agents/invoke.js +0 -93
  32. package/dist/agents/qwen.d.ts +0 -17
  33. package/dist/agents/qwen.d.ts.map +0 -1
  34. package/dist/agents/qwen.js +0 -172
  35. package/dist/agents/registry.d.ts +0 -19
  36. package/dist/agents/registry.d.ts.map +0 -1
  37. package/dist/agents/registry.js +0 -30
  38. package/dist/agents/shared.d.ts +0 -28
  39. package/dist/agents/shared.d.ts.map +0 -1
  40. package/dist/agents/shared.js +0 -35
  41. package/dist/agents/types.d.ts +0 -194
  42. package/dist/agents/types.d.ts.map +0 -1
  43. package/dist/agents/types.js +0 -23
  44. package/dist/index.d.ts +0 -3
  45. package/dist/index.d.ts.map +0 -1
  46. package/dist/index.js +0 -2
  47. package/dist/mcp/actuateServer.d.ts +0 -3
  48. package/dist/mcp/actuateServer.d.ts.map +0 -1
  49. package/dist/mcp/actuateServer.js +0 -594
  50. package/dist/mcp/sourceFence.d.ts +0 -23
  51. package/dist/mcp/sourceFence.d.ts.map +0 -1
  52. package/dist/mcp/sourceFence.js +0 -79
  53. package/dist/mcp/sourceServer.d.ts +0 -3
  54. package/dist/mcp/sourceServer.d.ts.map +0 -1
  55. package/dist/mcp/sourceServer.js +0 -191
  56. package/dist/modes.d.ts +0 -39
  57. package/dist/modes.d.ts.map +0 -1
  58. package/dist/modes.js +0 -34
  59. package/dist/playwright/cdpStatus.d.ts +0 -14
  60. package/dist/playwright/cdpStatus.d.ts.map +0 -1
  61. package/dist/playwright/cdpStatus.js +0 -52
  62. package/dist/playwright/preflight.d.ts +0 -31
  63. package/dist/playwright/preflight.d.ts.map +0 -1
  64. package/dist/playwright/preflight.js +0 -82
  65. package/dist/playwright/preflightCache.d.ts +0 -27
  66. package/dist/playwright/preflightCache.d.ts.map +0 -1
  67. package/dist/playwright/preflightCache.js +0 -21
  68. package/dist/playwright/resolveMcpConfig.d.ts +0 -61
  69. package/dist/playwright/resolveMcpConfig.d.ts.map +0 -1
  70. package/dist/playwright/resolveMcpConfig.js +0 -84
  71. package/dist/plugin-api.d.ts +0 -237
  72. package/dist/plugin-api.d.ts.map +0 -1
  73. package/dist/plugin-api.js +0 -52
  74. package/dist/qa/classify.d.ts +0 -38
  75. package/dist/qa/classify.d.ts.map +0 -1
  76. package/dist/qa/classify.js +0 -138
  77. package/dist/runSession.d.ts +0 -53
  78. package/dist/runSession.d.ts.map +0 -1
  79. package/dist/runSession.js +0 -96
  80. package/dist/service/cdpHandlers.d.ts +0 -24
  81. package/dist/service/cdpHandlers.d.ts.map +0 -1
  82. package/dist/service/cdpHandlers.js +0 -50
  83. package/dist/service/cdpHint.d.ts +0 -41
  84. package/dist/service/cdpHint.d.ts.map +0 -1
  85. package/dist/service/cdpHint.js +0 -158
  86. package/dist/service/conventions.d.ts +0 -8
  87. package/dist/service/conventions.d.ts.map +0 -1
  88. package/dist/service/conventions.js +0 -42
  89. package/dist/service/relayHandlers.d.ts +0 -28
  90. package/dist/service/relayHandlers.d.ts.map +0 -1
  91. package/dist/service/relayHandlers.js +0 -105
  92. package/dist/service/saveHandlers.d.ts +0 -50
  93. package/dist/service/saveHandlers.d.ts.map +0 -1
  94. package/dist/service/saveHandlers.js +0 -77
  95. package/dist/service/types.d.ts +0 -158
  96. package/dist/service/types.d.ts.map +0 -1
  97. package/dist/service/types.js +0 -26
  98. package/dist/service.d.ts +0 -54
  99. package/dist/service.d.ts.map +0 -1
  100. package/dist/service.js +0 -1772
  101. package/dist/specs/businessMap.d.ts +0 -29
  102. package/dist/specs/businessMap.d.ts.map +0 -1
  103. package/dist/specs/businessMap.js +0 -95
  104. package/dist/specs/extractPageObjects.d.ts +0 -18
  105. package/dist/specs/extractPageObjects.d.ts.map +0 -1
  106. package/dist/specs/extractPageObjects.js +0 -98
  107. package/dist/specs/optimizeSpecWithAgent.d.ts +0 -9
  108. package/dist/specs/optimizeSpecWithAgent.d.ts.map +0 -1
  109. package/dist/specs/optimizeSpecWithAgent.js +0 -39
@@ -1,50 +0,0 @@
1
- /**
2
- * Save-artifact WebSocket handlers (spec / Jira CSV).
3
- *
4
- * Both save-* messages share the same shape: validate `name + steps`, call a
5
- * per-kind writer, fork on Exists-error vs. success. The differences (which
6
- * writer, which message names, which fields to pluck) are captured in the
7
- * `SaveArtifactConfig` descriptor table below. (Save-as-Skill was retired; the
8
- * generic `onSaved` hook it used is kept for any future artifact that needs a
9
- * post-write tail.)
10
- */
11
- import type { WebSocket } from 'ws';
12
- import { type SkillStep } from '../specs/specStep.js';
13
- import { writeSpec, type SpecAssertion } from '../specs/writeSpec.js';
14
- import { type ClientMessage } from './types.js';
15
- interface SaveArtifactConfig<TWriteResult extends {
16
- slug: string;
17
- path: string;
18
- }> {
19
- /** Used in error messages. Mirrors the WS `type` the client sent. */
20
- requestName: string;
21
- /** Emitted on success. */
22
- savedType: string;
23
- /** Emitted when the writer threw an Exists-error. */
24
- existsType: string;
25
- /** Optional — fires after a successful write (e.g. to push a refreshed list
26
- * to the widget). Currently unused; kept generic for future artifacts. */
27
- onSaved?: (ws: WebSocket, devRoot: string) => Promise<void>;
28
- /** Class used in `err instanceof …` to detect "already exists" errors. */
29
- ExistsError: new (...args: never[]) => {
30
- slug: string;
31
- path: string;
32
- } & Error;
33
- /** Pluck the payload fields this artifact needs and call its writer. */
34
- write: (args: {
35
- devRoot: string;
36
- name: string;
37
- description: string;
38
- steps: SkillStep[];
39
- assertions: SpecAssertion[];
40
- payload: NonNullable<ClientMessage['payload']>;
41
- overwrite: boolean;
42
- }) => Promise<TWriteResult>;
43
- }
44
- export declare function handleSaveArtifact<TWriteResult extends {
45
- slug: string;
46
- path: string;
47
- }>(ws: WebSocket, msg: ClientMessage, devRoot: string, cfg: SaveArtifactConfig<TWriteResult>): Promise<void>;
48
- export declare const SPEC_CONFIG: SaveArtifactConfig<Awaited<ReturnType<typeof writeSpec>>>;
49
- export {};
50
- //# sourceMappingURL=saveHandlers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"saveHandlers.d.ts","sourceRoot":"","sources":["../../src/service/saveHandlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAmB,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACvF,OAAO,EAAQ,K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AAC,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,CAOjF,CAAC"}
@@ -1,77 +0,0 @@
1
- /**
2
- * Save-artifact WebSocket handlers (spec / Jira CSV).
3
- *
4
- * Both save-* messages share the same shape: validate `name + steps`, call a
5
- * per-kind writer, fork on Exists-error vs. success. The differences (which
6
- * writer, which message names, which fields to pluck) are captured in the
7
- * `SaveArtifactConfig` descriptor table below. (Save-as-Skill was retired; the
8
- * generic `onSaved` hook it used is kept for any future artifact that needs a
9
- * post-write tail.)
10
- */
11
- import { writeSpec, SpecExistsError } from '../specs/writeSpec.js';
12
- import { send } from './types.js';
13
- export async function handleSaveArtifact(ws, msg, devRoot, cfg) {
14
- const name = msg.payload?.name;
15
- const description = msg.payload?.description ?? '';
16
- const steps = msg.payload?.steps;
17
- const assertions = msg.payload?.assertions ?? [];
18
- const overwrite = msg.payload?.overwrite === true;
19
- if (typeof name !== 'string' || !name.trim()) {
20
- send(ws, { type: 'error', payload: { message: `${cfg.requestName}: name is required` } });
21
- return;
22
- }
23
- if (!Array.isArray(steps) || steps.length === 0) {
24
- send(ws, { type: 'error', payload: { message: `${cfg.requestName}: no steps to save` } });
25
- return;
26
- }
27
- let result;
28
- try {
29
- result = await cfg.write({
30
- devRoot, name, description, steps, assertions,
31
- payload: msg.payload, overwrite,
32
- });
33
- }
34
- catch (err) {
35
- if (err instanceof cfg.ExistsError) {
36
- send(ws, { type: cfg.existsType, payload: { slug: err.slug, existingPath: err.path } });
37
- return;
38
- }
39
- const message = err instanceof Error ? err.message : String(err);
40
- send(ws, { type: 'error', payload: { message: `${cfg.requestName} failed: ${message}` } });
41
- return;
42
- }
43
- // When the run was split into several feature files, report all their slugs
44
- // so the widget can confirm "Saved 3 specs: login, checkout, …".
45
- const files = result.files;
46
- // Auth-as-fixture (debt 3): a login was detected but a user playwright.config
47
- // exists — forward the proposed config edit so the extension can offer it for
48
- // approval (Stage 4b). Absent on a normal save.
49
- const authFixtureOffer = result.authFixtureOffer;
50
- send(ws, {
51
- type: cfg.savedType,
52
- payload: {
53
- name: result.slug,
54
- path: result.path,
55
- ...(files && files.length > 1 ? { files: files.map((f) => f.slug) } : {}),
56
- ...(authFixtureOffer ? { authFixtureOffer } : {}),
57
- },
58
- });
59
- // The artifact is already on disk; an onSaved failure (e.g. a follow-up
60
- // list re-scan) shouldn't surface as if the save itself failed — log on.
61
- if (cfg.onSaved) {
62
- try {
63
- await cfg.onSaved(ws, devRoot);
64
- }
65
- catch (err) {
66
- const message = err instanceof Error ? err.message : String(err);
67
- console.warn(`[hover] ${cfg.requestName} onSaved failed: ${message}`);
68
- }
69
- }
70
- }
71
- export const SPEC_CONFIG = {
72
- requestName: 'save-spec',
73
- savedType: 'spec-saved',
74
- existsType: 'spec-exists',
75
- ExistsError: SpecExistsError,
76
- write: ({ devRoot, name, description, steps, assertions, payload, overwrite }) => writeSpec({ devRoot, name, description, steps, assertions, overwrite, redactions: payload.redactions, resetRecipe: payload.resetRecipe, authFixture: payload.authFixture }),
77
- };
@@ -1,158 +0,0 @@
1
- /**
2
- * Shared types for the service/ handler modules.
3
- *
4
- * `ClientMessage` describes the wire-protocol envelope every message from
5
- * the widget arrives in. Lives here (not in service.ts) so individual
6
- * handlers can type their `msg` argument without circular imports.
7
- *
8
- * `send` is the one-liner used by every handler to emit a typed message
9
- * back to the widget. Centralised so the JSON.stringify happens in exactly
10
- * one place.
11
- */
12
- import { WebSocket } from 'ws';
13
- import type { SkillStep } from '../specs/specStep.js';
14
- import type { SpecAssertion } from '../specs/writeSpec.js';
15
- export interface ClientMessage {
16
- type: string;
17
- payload?: {
18
- text?: string;
19
- sessionId?: string;
20
- /** The chat conversation a run belongs to — groups its run folders under
21
- * `.hover/runs/<conversationId>/`. */
22
- conversationId?: string;
23
- name?: string;
24
- description?: string;
25
- steps?: SkillStep[];
26
- assertions?: SpecAssertion[];
27
- overwrite?: boolean;
28
- /** save-spec only — credentials to parameterize into process.env.<envVar>
29
- * references so secrets never land in the spec / sidecar. */
30
- redactions?: {
31
- value: string;
32
- envVar: string;
33
- }[];
34
- /** save-spec only — the active env's recon-discovered reset recipe (debt-2).
35
- * A tier-1 recipe makes the spec generate + call a resetState() beforeEach. */
36
- resetRecipe?: {
37
- tier: number;
38
- storageKeys?: string[];
39
- hook?: string;
40
- };
41
- /** save-spec only — auth-as-fixture (debt 3). The user approved Hover editing
42
- * their existing playwright.config; engage the fixture (lift login into
43
- * auth.setup.ts) and apply the setup-project edit. Absent on a normal save. */
44
- authFixture?: boolean;
45
- /** command only — test accounts the prompt referenced via @label. Injected
46
- * into the agent's system prompt (ephemeral, not the saved transcript) so
47
- * it can log in; the recorded fill values get redacted on save. */
48
- accounts?: {
49
- label: string;
50
- username?: string;
51
- password?: string;
52
- role?: string;
53
- }[];
54
- /** command only — ask the agent to run state-reset recon this run (debt-2
55
- * reproducible-state-isolation). Off unless the extension sets it (e.g. the
56
- * active env has no reset recipe yet); recon clears client state, so it must
57
- * be opt-in, never on a plain Flow recording. */
58
- reconReset?: boolean;
59
- /** check-cdp / launch-chrome / focus-debug — the widget's
60
- * window.location.href so service can compare origins or navigate the
61
- * newly-launched debug Chrome to the same URL. */
62
- pageUrl?: string;
63
- /** switch-agent only — id of the agent to switch the service to. */
64
- agentId?: string;
65
- /** set-model only — the model id to use for subsequent runs (e.g. opus). */
66
- model?: string;
67
- /** optimize-spec only — override model for the F7 refinement pass (the
68
- * `hover.optimizeModel` setting). Empty → the agent's cheap default. */
69
- optimizeModel?: string;
70
- /** heal-spec only — the failing spec's source, so the engine can build the
71
- * heal prompt without guessing the spec's path. */
72
- specSource?: string;
73
- /** set-effort only — reasoning-effort level for subsequent runs (empty
74
- * string clears it → agent/model default). */
75
- effort?: string;
76
- /** set-local-endpoint only — base URL of the user's self-hosted
77
- * OpenAI-compatible endpoint for the Local LLM agent. */
78
- baseUrl?: string;
79
- /** set-byok only — bring-your-own-key model config (protocol + key + base
80
- * URL + model injected into the protocol's matching CLI), or null to clear
81
- * and fall back to the local-CLI agent's own auth. */
82
- config?: {
83
- protocol: string;
84
- baseUrl: string;
85
- model: string;
86
- maxTokens: number;
87
- apiKey: string;
88
- } | null;
89
- /** set-mode only — id of the plugin-contributed mode to activate,
90
- * or null to return to normal (unmoded) operation. */
91
- modeId?: string | null;
92
- /** optimize-spec / promote-optimized / discard-optimized — the spec slug. */
93
- slug?: string;
94
- /** launch-chrome only — launch the debug Chrome headless (silent mode). */
95
- headless?: boolean;
96
- /** launch-chrome only — close any existing debug Chrome first, then
97
- * relaunch (so a headless↔visible switch / "reopen browser" takes effect). */
98
- force?: boolean;
99
- /** reveal-source only — a `data-hover-source` value (`<rel-path>:<line>:<col>`)
100
- * an in-page client (widget) captured from a clicked element. The service
101
- * relays it to every OTHER connected client; the VSCode extension listens
102
- * for it and jumps the editor to that location (F2 page→editor transport). */
103
- source?: string;
104
- /** command only — the editor's source-read grant for this run:
105
- * 'always' (skip the gate), 'ask' (gate each read), 'deny' (no source MCP).
106
- * Default 'ask' when absent. */
107
- sourceAccess?: 'always' | 'ask' | 'deny';
108
- /** command only — run the agent in an isolated cwd so it loads none of the
109
- * user's CLAUDE.md / Claude Code auto-memory (Memory = "isolated"). */
110
- isolateContext?: boolean;
111
- /** command only — the active environment, recorded in the session ledger. */
112
- env?: {
113
- id?: string;
114
- name?: string;
115
- };
116
- /** source-approval-request (from the source MCP) / -response (from the
117
- * editor): a correlation id, the requested repo-relative path + kind, and
118
- * the user's allow/deny decision. */
119
- approvalId?: string;
120
- sourcePath?: string;
121
- sourceKind?: string;
122
- allow?: boolean;
123
- /** ask-user-request (from the control MCP) / -response (from the editor):
124
- * a correlation id, the question + offered choices, and the user's answer. */
125
- askId?: string;
126
- question?: string;
127
- options?: {
128
- label: string;
129
- description?: string;
130
- }[];
131
- allowFreeText?: boolean;
132
- value?: string;
133
- cancelled?: boolean;
134
- /** record-fact (from the control MCP, QA/API modes only): a business RULE
135
- * the agent learned/confirmed, to persist into `.hover/memory/` so it isn't
136
- * re-asked next run. RULES only — never secrets/PII (the tool + directive
137
- * enforce this; the engine also ignores it outside QA/API). */
138
- fact?: {
139
- title: string;
140
- rule: string;
141
- type?: string;
142
- };
143
- };
144
- }
145
- export declare function send(ws: WebSocket, message: {
146
- type: string;
147
- payload?: unknown;
148
- }): void;
149
- /** Send a message only if the socket is still open. Use this from delayed
150
- * callbacks (promise `.then`, timers) where the client may have disconnected
151
- * between scheduling and firing — calling `ws.send` on a closed socket
152
- * is a silent no-op for some states and throws for others, so a single
153
- * guarded helper makes the intent obvious and prevents surprises. */
154
- export declare function sendIfOpen(ws: WebSocket, message: {
155
- type: string;
156
- payload?: unknown;
157
- }): boolean;
158
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/service/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB;+CACuC;QACvC,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;QACpB,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;QAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB;sEAC8D;QAC9D,UAAU,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QACjD;wFACgF;QAChF,WAAW,CAAC,EAAE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"}
@@ -1,26 +0,0 @@
1
- /**
2
- * Shared types for the service/ handler modules.
3
- *
4
- * `ClientMessage` describes the wire-protocol envelope every message from
5
- * the widget arrives in. Lives here (not in service.ts) so individual
6
- * handlers can type their `msg` argument without circular imports.
7
- *
8
- * `send` is the one-liner used by every handler to emit a typed message
9
- * back to the widget. Centralised so the JSON.stringify happens in exactly
10
- * one place.
11
- */
12
- import { WebSocket } from 'ws';
13
- export function send(ws, message) {
14
- ws.send(JSON.stringify(message));
15
- }
16
- /** Send a message only if the socket is still open. Use this from delayed
17
- * callbacks (promise `.then`, timers) where the client may have disconnected
18
- * between scheduling and firing — calling `ws.send` on a closed socket
19
- * is a silent no-op for some states and throws for others, so a single
20
- * guarded helper makes the intent obvious and prevents surprises. */
21
- export function sendIfOpen(ws, message) {
22
- if (ws.readyState !== WebSocket.OPEN)
23
- return false;
24
- ws.send(JSON.stringify(message));
25
- return true;
26
- }
package/dist/service.d.ts DELETED
@@ -1,54 +0,0 @@
1
- import { type HoverPluginManifest } from './plugin-api.js';
2
- export interface ServiceOptions {
3
- port: number;
4
- agentId?: string;
5
- model?: string;
6
- /** Initial reasoning-effort level (set-effort overrides at runtime). */
7
- effort?: string;
8
- maxBudgetUsd?: number;
9
- mcpConfig?: string;
10
- /** CDP URL to preflight before each command (default http://localhost:9222). */
11
- cdpUrl?: string;
12
- /** Isolated Chrome user-data-dir for this service's debug Chrome (default
13
- * `<tmpdir>/hover-chrome`). Set per-service so several engine hosts (one per
14
- * chat session) each drive their OWN Chrome profile — distinct logins, no
15
- * profile-lock contention. Paired with a distinct `cdpUrl` port. */
16
- userDataDir?: string;
17
- /** Working directory for the spawned agent. Also the root under which saved
18
- * specs (`__vibe_tests__/`), sidecars + seeds (`.hover/`) live. Defaults to
19
- * process.cwd(); in Vite plugin context, set to `server.config.root` so the
20
- * agent runs against the project (and Claude Code reads its CLAUDE.md). */
21
- devRoot?: string;
22
- /** Plugins contributed by the bundler-plugin wrapper. Each manifest can
23
- * add a widget mode, MCP servers, Chrome flags, and lifecycle hooks.
24
- * Empty array (default) means "no plugins, behaviour identical to
25
- * pre-plugin Hover" — important for the long tail of users who never
26
- * install one. */
27
- plugins?: HoverPluginManifest[];
28
- /** When true, the service launches the single debug Chrome itself at
29
- * startup — AFTER firing plugin `hover:service:start` hooks, so a plugin
30
- * that set a resident proxy (e.g. security's MITM) has its flags baked
31
- * into that one Chrome. Previously each bundler shim called
32
- * launchDebugChrome() directly, which bypassed the service and so couldn't
33
- * see the proxy; moving it here is what enables the single-Chrome model.
34
- * Default false (shims pass it through from their own option). */
35
- autoLaunchChrome?: boolean;
36
- /** Opt-in: give the agent READ-ONLY, fenced access to the project's source
37
- * via a `read_source` / `list_source` MCP server (in addition to Playwright
38
- * MCP), in every mode. Lets it author against real selectors/routes and do
39
- * white-box security/pentest. Fenced to devRoot, secrets/keys/.git/build
40
- * excluded, no write/exec. Default false — the agent stays browser-only. */
41
- codeContext?: boolean;
42
- /** The dev-server URL the auto-launched Chrome should open. Each shim knows
43
- * its own framework's dev URL and passes it here. Defaults to the cdp host
44
- * if unset, but shims should always provide it. */
45
- devUrl?: string;
46
- }
47
- export interface ServiceHandle {
48
- /** The port the WebSocketServer actually bound to. May differ from
49
- * the requested port if it was taken (we auto-bump up to 10 times). */
50
- port: number;
51
- close(): Promise<void>;
52
- }
53
- export declare function startService(opts: ServiceOptions): Promise<ServiceHandle>;
54
- //# sourceMappingURL=service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAqFA,OAAO,EAEL,KAAK,mBAAmB,EAEzB,MAAM,iBAAiB,CAAC;AAqCzB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;yEAGqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;gFAG4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;uBAImB;IACnB,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAChC;;;;;;uEAMmE;IACnE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;iFAI6E;IAC7E,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;wDAEoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B;4EACwE;IACxE,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAkFD,wBAAsB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAglD/E"}