vite-plugin-opencode-assistant 1.0.72 → 1.0.74

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/es/core/api.d.ts CHANGED
@@ -5,7 +5,8 @@ export declare class OpenCodeAPI {
5
5
  private getPort;
6
6
  private getProxyPort;
7
7
  private warmupChromeMcpConfig;
8
- constructor(hostname: string, getPort: () => number, getProxyPort: () => number, warmupChromeMcpConfig?: boolean);
8
+ private chromeDevtoolsPort;
9
+ constructor(hostname: string, getPort: () => number, getProxyPort: () => number, warmupChromeMcpConfig?: boolean, chromeDevtoolsPort?: number);
9
10
  private createHttpRequest;
10
11
  getSessions(projectDir: string, retries?: number): Promise<SessionInfo[]>;
11
12
  createSession(projectDir: string, retries?: number, title?: string): Promise<SessionInfo>;
package/es/core/api.mjs CHANGED
@@ -54,11 +54,12 @@ import {
54
54
  } from "@vite-plugin-opencode-assistant/shared";
55
55
  const log = createLogger("API");
56
56
  class OpenCodeAPI {
57
- constructor(hostname, getPort, getProxyPort, warmupChromeMcpConfig = false) {
57
+ constructor(hostname, getPort, getProxyPort, warmupChromeMcpConfig = false, chromeDevtoolsPort = CHROME_DEVTOOLS_PORT) {
58
58
  __publicField(this, "hostname", hostname);
59
59
  __publicField(this, "getPort", getPort);
60
60
  __publicField(this, "getProxyPort", getProxyPort);
61
61
  __publicField(this, "warmupChromeMcpConfig", warmupChromeMcpConfig);
62
+ __publicField(this, "chromeDevtoolsPort", chromeDevtoolsPort);
62
63
  }
63
64
  createHttpRequest(options, body, timeout) {
64
65
  const timer = new PerformanceTimer("HTTP Request", {
@@ -285,15 +286,15 @@ class OpenCodeAPI {
285
286
  return __async(this, null, function* () {
286
287
  const timer = log.timer(`${operation}WarmupChromeMcp`, { viteOrigin, operation });
287
288
  let warmupSessionId = null;
288
- const chromeAvailable = yield checkChromeDevToolsAvailable();
289
+ const chromeAvailable = yield checkChromeDevToolsAvailable(this.chromeDevtoolsPort);
289
290
  if (!chromeAvailable) {
290
291
  const error = new ChromeMcpWarmupError(
291
292
  ChromeMcpWarmupErrorType.CHROME_NOT_CONNECTED,
292
293
  "Chrome DevTools Protocol is not available",
293
- "Chrome remote debugging is not enabled or not running on port 9222. Please enable Chrome remote debugging first."
294
+ `Chrome remote debugging is not enabled or not running on port ${this.chromeDevtoolsPort}. Please enable Chrome remote debugging first.`
294
295
  );
295
296
  log.warn(`Chrome DevTools not available for ${operation}`, {
296
- port: CHROME_DEVTOOLS_PORT,
297
+ port: this.chromeDevtoolsPort,
297
298
  hint: "Enable Chrome remote debugging at chrome://inspect/#remote-debugging"
298
299
  });
299
300
  timer.end(`Chrome DevTools not available for ${operation}`);
package/es/index.mjs CHANGED
@@ -74,7 +74,8 @@ function createOpenCodePlugin(options = {}) {
74
74
  config.hostname,
75
75
  () => actualWebPort,
76
76
  () => actualProxyPort,
77
- config.warmupChromeMcp
77
+ config.warmupChromeMcp,
78
+ config.chromeDevtoolsPort
78
79
  );
79
80
  const service = new OpenCodeService(
80
81
  config,