vite-plugin-opencode-assistant 1.0.39 → 1.0.41

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.
@@ -115,9 +115,6 @@ const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
115
115
  if (data.task) {
116
116
  updateStatusFromTask(data.task, data.errorType, data.errorMessage);
117
117
  }
118
- if (serviceStatus.value !== "idle") {
119
- loadSessions();
120
- }
121
118
  },
122
119
  onTaskUpdate: (data) => {
123
120
  updateStatusFromTask(data.task, data.errorType, data.errorMessage);
@@ -154,9 +151,13 @@ const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
154
151
  const data = yield res.json();
155
152
  if (data.success) {
156
153
  chromeMcpFailed.value = false;
154
+ chromeMcpErrorType.value = void 0;
155
+ chromeMcpErrorMessage.value = void 0;
157
156
  serviceStatus.value = "ready";
158
157
  showNotification("Chrome DevTools MCP \u8FDE\u63A5\u6210\u529F");
159
158
  } else {
159
+ chromeMcpErrorType.value = data.errorType;
160
+ chromeMcpErrorMessage.value = data.error;
160
161
  if (data.errorType === "AI_TIMEOUT") {
161
162
  showNotification("AI \u54CD\u5E94\u8D85\u65F6\uFF0C\u8BF7\u68C0\u67E5 OpenCode AI \u6A21\u578B\u914D\u7F6E");
162
163
  } else if (data.errorType === "AI_RESPONSE_ERROR") {
@@ -206,6 +207,9 @@ const __vue_sfc__ = /* @__PURE__ */ _defineComponent({
206
207
  serverSSE.connect();
207
208
  opencodeSSE.connect();
208
209
  }
210
+ if (status === "ready" && oldStatus !== "ready") {
211
+ loadSessions();
212
+ }
209
213
  });
210
214
  onMounted(() => {
211
215
  if (serviceStatus.value === "ready") {
@@ -1 +1 @@
1
- .opencode-chrome-warmup-error-details[data-v-798041da]{margin-top:8px;padding:12px;background:var(--oc-bg-tertiary);border-radius:6px;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:12px;color:var(--oc-text-secondary);max-height:120px;overflow-y:auto;word-break:break-word}
1
+ .opencode-chrome-warmup-error-details[data-v-13778a4c]{margin-top:8px;padding:12px;background:var(--oc-bg-tertiary);border-radius:6px;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:12px;color:var(--oc-text-secondary);max-height:120px;overflow-y:auto;word-break:break-word}
@@ -189,7 +189,7 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
189
189
  ]);
190
190
  }
191
191
  __vue_sfc__.render = __vue_render__;
192
- __vue_sfc__.__scopeId = "data-v-798041da";
192
+ __vue_sfc__.__scopeId = "data-v-13778a4c";
193
193
  var ChromeWarmupError_vue_default = __vue_sfc__;
194
194
  export {
195
195
  ChromeWarmupError_vue_default as default
package/es/core/api.js CHANGED
@@ -122,7 +122,7 @@ class OpenCodeAPI {
122
122
  path: `/session?directory=${encodeURIComponent(projectDir)}`
123
123
  });
124
124
  const sessionsWithUrl = sessions.map((s) => __spreadProps(__spreadValues({}, s), {
125
- url: `http://${this.hostname}:${this.getProxyPort()}/${base64Encode(s.directory)}/session/${s.id}`
125
+ url: s.directory ? `http://${this.hostname}:${this.getProxyPort()}/${base64Encode(s.directory)}/session/${s.id}` : ""
126
126
  }));
127
127
  timer.end(`Found ${sessions.length} sessions`);
128
128
  return sessionsWithUrl;
@@ -214,7 +214,7 @@ Please install OpenCode first:
214
214
  } catch (err) {
215
215
  const nodeErr = err;
216
216
  if (nodeErr.code === "EADDRINUSE") {
217
- log.warn(`Proxy port ${this.actualProxyPort} became unavailable, trying next port...`);
217
+ log.debug(`Proxy port ${this.actualProxyPort} became unavailable, trying next port...`);
218
218
  const nextPort = yield findAvailablePort(this.actualProxyPort + 1, this.config.hostname);
219
219
  const result = yield startProxyServer(webUrl, nextPort, {
220
220
  theme: this.config.theme,
@@ -224,7 +224,7 @@ Please install OpenCode first:
224
224
  this.proxyServer = result.server;
225
225
  this.actualProxyPort = result.actualPort;
226
226
  this.onProxyPortAllocated(this.actualProxyPort);
227
- log.info(`Proxy server started on fallback port ${this.actualProxyPort}`);
227
+ log.debug(`Proxy server started on fallback port ${this.actualProxyPort}`);
228
228
  } else {
229
229
  throw err;
230
230
  }
@@ -248,12 +248,12 @@ Please install OpenCode first:
248
248
  }
249
249
  }
250
250
  this.sendTaskUpdate("creating_session");
251
+ this.isStarted = true;
251
252
  if (warmupFailed) {
252
253
  this.sendTaskUpdate("chrome_mcp_failed", {
253
254
  errorType: this.chromeMcpWarmupErrorType,
254
255
  errorMessage: this.chromeMcpWarmupErrorMessage
255
256
  });
256
- this.isStarted = true;
257
257
  } else {
258
258
  this.sendTaskUpdate("ready");
259
259
  }
@@ -41,9 +41,11 @@ function setupSseEndpoint(server, ctx) {
41
41
  }
42
42
  if (ctx.currentTask) {
43
43
  statusPayload.task = ctx.currentTask.task;
44
- if (ctx.currentTask.data) {
45
- Object.assign(statusPayload, ctx.currentTask.data);
46
- }
44
+ Object.keys(ctx.currentTask).forEach((key) => {
45
+ if (key !== "task") {
46
+ statusPayload[key] = ctx.currentTask[key];
47
+ }
48
+ });
47
49
  }
48
50
  res.write(`data: ${JSON.stringify(statusPayload)}
49
51
 
@@ -146,9 +146,6 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
146
146
  if (data.task) {
147
147
  updateStatusFromTask(data.task, data.errorType, data.errorMessage);
148
148
  }
149
- if (serviceStatus.value !== "idle") {
150
- loadSessions();
151
- }
152
149
  },
153
150
  onTaskUpdate: (data) => {
154
151
  updateStatusFromTask(data.task, data.errorType, data.errorMessage);
@@ -185,9 +182,13 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
185
182
  const data = yield res.json();
186
183
  if (data.success) {
187
184
  chromeMcpFailed.value = false;
185
+ chromeMcpErrorType.value = void 0;
186
+ chromeMcpErrorMessage.value = void 0;
188
187
  serviceStatus.value = "ready";
189
188
  showNotification("Chrome DevTools MCP \u8FDE\u63A5\u6210\u529F");
190
189
  } else {
190
+ chromeMcpErrorType.value = data.errorType;
191
+ chromeMcpErrorMessage.value = data.error;
191
192
  if (data.errorType === "AI_TIMEOUT") {
192
193
  showNotification("AI \u54CD\u5E94\u8D85\u65F6\uFF0C\u8BF7\u68C0\u67E5 OpenCode AI \u6A21\u578B\u914D\u7F6E");
193
194
  } else if (data.errorType === "AI_RESPONSE_ERROR") {
@@ -237,6 +238,9 @@ const __vue_sfc__ = /* @__PURE__ */ (0, import_vue.defineComponent)({
237
238
  serverSSE.connect();
238
239
  opencodeSSE.connect();
239
240
  }
241
+ if (status === "ready" && oldStatus !== "ready") {
242
+ loadSessions();
243
+ }
240
244
  });
241
245
  (0, import_vue2.onMounted)(() => {
242
246
  if (serviceStatus.value === "ready") {
@@ -1 +1 @@
1
- .opencode-chrome-warmup-error-details[data-v-798041da]{margin-top:8px;padding:12px;background:var(--oc-bg-tertiary);border-radius:6px;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:12px;color:var(--oc-text-secondary);max-height:120px;overflow-y:auto;word-break:break-word}
1
+ .opencode-chrome-warmup-error-details[data-v-13778a4c]{margin-top:8px;padding:12px;background:var(--oc-bg-tertiary);border-radius:6px;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:12px;color:var(--oc-text-secondary);max-height:120px;overflow-y:auto;word-break:break-word}
@@ -211,5 +211,5 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
211
211
  ]);
212
212
  }
213
213
  __vue_sfc__.render = __vue_render__;
214
- __vue_sfc__.__scopeId = "data-v-798041da";
214
+ __vue_sfc__.__scopeId = "data-v-13778a4c";
215
215
  var ChromeWarmupError_vue_default = __vue_sfc__;