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 +2 -1
- package/es/core/api.mjs +5 -4
- package/es/index.mjs +2 -1
- package/lib/client.js +272 -267
- 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/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.74",
|
|
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/shared": "1.0.
|
|
40
|
+
"@vite-plugin-opencode-assistant/opencode": "1.0.74",
|
|
41
|
+
"@vite-plugin-opencode-assistant/components": "1.0.74",
|
|
42
|
+
"@vite-plugin-opencode-assistant/shared": "1.0.74"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"vite": ">=4.0.0"
|