vite-plugin-opencode-assistant 1.0.72 → 1.0.73
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 +2 -1
- package/es/core/api.mjs +5 -4
- package/es/index.mjs +2 -1
- package/lib/core/api.cjs +5 -4
- package/lib/core/api.d.ts +2 -1
- package/lib/index.cjs +2 -1
- package/package.json +4 -4
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
|
-
|
|
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
|
-
|
|
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:
|
|
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
package/lib/core/api.cjs
CHANGED
|
@@ -72,11 +72,12 @@ var import_http = __toESM(require("http"));
|
|
|
72
72
|
var import_shared = require("@vite-plugin-opencode-assistant/shared");
|
|
73
73
|
const log = (0, import_shared.createLogger)("API");
|
|
74
74
|
class OpenCodeAPI {
|
|
75
|
-
constructor(hostname, getPort, getProxyPort, warmupChromeMcpConfig = false) {
|
|
75
|
+
constructor(hostname, getPort, getProxyPort, warmupChromeMcpConfig = false, chromeDevtoolsPort = import_shared.CHROME_DEVTOOLS_PORT) {
|
|
76
76
|
__publicField(this, "hostname", hostname);
|
|
77
77
|
__publicField(this, "getPort", getPort);
|
|
78
78
|
__publicField(this, "getProxyPort", getProxyPort);
|
|
79
79
|
__publicField(this, "warmupChromeMcpConfig", warmupChromeMcpConfig);
|
|
80
|
+
__publicField(this, "chromeDevtoolsPort", chromeDevtoolsPort);
|
|
80
81
|
}
|
|
81
82
|
createHttpRequest(options, body, timeout) {
|
|
82
83
|
const timer = new import_shared.PerformanceTimer("HTTP Request", {
|
|
@@ -303,15 +304,15 @@ class OpenCodeAPI {
|
|
|
303
304
|
return __async(this, null, function* () {
|
|
304
305
|
const timer = log.timer(`${operation}WarmupChromeMcp`, { viteOrigin, operation });
|
|
305
306
|
let warmupSessionId = null;
|
|
306
|
-
const chromeAvailable = yield (0, import_shared.checkChromeDevToolsAvailable)();
|
|
307
|
+
const chromeAvailable = yield (0, import_shared.checkChromeDevToolsAvailable)(this.chromeDevtoolsPort);
|
|
307
308
|
if (!chromeAvailable) {
|
|
308
309
|
const error = new import_shared.ChromeMcpWarmupError(
|
|
309
310
|
import_shared.ChromeMcpWarmupErrorType.CHROME_NOT_CONNECTED,
|
|
310
311
|
"Chrome DevTools Protocol is not available",
|
|
311
|
-
|
|
312
|
+
`Chrome remote debugging is not enabled or not running on port ${this.chromeDevtoolsPort}. Please enable Chrome remote debugging first.`
|
|
312
313
|
);
|
|
313
314
|
log.warn(`Chrome DevTools not available for ${operation}`, {
|
|
314
|
-
port:
|
|
315
|
+
port: this.chromeDevtoolsPort,
|
|
315
316
|
hint: "Enable Chrome remote debugging at chrome://inspect/#remote-debugging"
|
|
316
317
|
});
|
|
317
318
|
timer.end(`Chrome DevTools not available for ${operation}`);
|
package/lib/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
|
-
|
|
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/lib/index.cjs
CHANGED
|
@@ -97,7 +97,8 @@ function createOpenCodePlugin(options = {}) {
|
|
|
97
97
|
config.hostname,
|
|
98
98
|
() => actualWebPort,
|
|
99
99
|
() => actualProxyPort,
|
|
100
|
-
config.warmupChromeMcp
|
|
100
|
+
config.warmupChromeMcp,
|
|
101
|
+
config.chromeDevtoolsPort
|
|
101
102
|
);
|
|
102
103
|
const service = new import_service.OpenCodeService(
|
|
103
104
|
config,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-opencode-assistant",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.73",
|
|
4
4
|
"description": "Embed OpenCode Web UI in your Vite dev server for real-time code modification and preview",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.cjs",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"unplugin-vue-inspector": "^2.4.0",
|
|
39
39
|
"execa": "^9.6.1",
|
|
40
|
-
"@vite-plugin-opencode-assistant/
|
|
41
|
-
"@vite-plugin-opencode-assistant/
|
|
42
|
-
"@vite-plugin-opencode-assistant/
|
|
40
|
+
"@vite-plugin-opencode-assistant/shared": "1.0.73",
|
|
41
|
+
"@vite-plugin-opencode-assistant/components": "1.0.73",
|
|
42
|
+
"@vite-plugin-opencode-assistant/opencode": "1.0.73"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"vite": ">=4.0.0"
|