vite-plugin-opencode-assistant 1.1.0 → 1.1.1

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.mjs CHANGED
@@ -40,8 +40,6 @@ var __async = (__this, __arguments, generator) => {
40
40
  };
41
41
  import http from "http";
42
42
  import {
43
- PerformanceTimer,
44
- createLogger,
45
43
  DEFAULT_RETRIES,
46
44
  RETRY_DELAY,
47
45
  ChromeMcpWarmupErrorType,
@@ -51,6 +49,7 @@ import {
51
49
  base64Encode,
52
50
  extractTextFromResponse
53
51
  } from "@vite-plugin-opencode-assistant/shared";
52
+ import { PerformanceTimer, createLogger } from "@vite-plugin-opencode-assistant/shared/node";
54
53
  import { checkChromeDevToolsAvailable } from "@vite-plugin-opencode-assistant/shared/node";
55
54
  const log = createLogger("API");
56
55
  class OpenCodeAPI {
@@ -21,7 +21,7 @@ import { execa } from "execa";
21
21
  import fs from "fs";
22
22
  import { createRequire } from "module";
23
23
  import path from "path";
24
- import { createLogger, getProcessLogBuffer } from "@vite-plugin-opencode-assistant/shared";
24
+ import { createLogger, getProcessLogBuffer } from "@vite-plugin-opencode-assistant/shared/node";
25
25
  const require2 = createRequire(path.join(process.cwd(), "package.json"));
26
26
  const packageDir = resolvePackageDir();
27
27
  const log = createLogger("OpenCodeWeb");
@@ -507,7 +507,7 @@ function generateBridgeScript(options) {
507
507
  function insertFilePart(element) {
508
508
  const promptInput = document.querySelector('[data-component="prompt-input"]');
509
509
  if (!promptInput) {
510
- console.warn('[OpenCode Bridge] Prompt input not found');
510
+ log.warn('Prompt input not found');
511
511
  return;
512
512
  }
513
513
 
@@ -39,10 +39,10 @@ import { prepareOpenCodeRuntime, startOpenCodeWeb } from "./opencode-web.mjs";
39
39
  import {
40
40
  DEFAULT_PROXY_PORT,
41
41
  SERVER_START_TIMEOUT,
42
- createLogger,
43
42
  ChromeMcpWarmupError,
44
43
  ChromeMcpWarmupErrorType
45
44
  } from "@vite-plugin-opencode-assistant/shared";
45
+ import { createLogger } from "@vite-plugin-opencode-assistant/shared/node";
46
46
  import {
47
47
  checkOpenCodeInstalled,
48
48
  findAvailablePort,
@@ -19,7 +19,7 @@ var __async = (__this, __arguments, generator) => {
19
19
  });
20
20
  };
21
21
  import { CONTEXT_API_PATH } from "@vite-plugin-opencode-assistant/shared";
22
- import { RequestContext, createLogger } from "@vite-plugin-opencode-assistant/shared";
22
+ import { RequestContext, createLogger } from "@vite-plugin-opencode-assistant/shared/node";
23
23
  const log = createLogger("Endpoints:Context");
24
24
  function setupContextEndpoint(server, ctx) {
25
25
  server.middlewares.use(CONTEXT_API_PATH, (req, res) => __async(null, null, function* () {
@@ -18,12 +18,12 @@ var __async = (__this, __arguments, generator) => {
18
18
  step((generator = generator.apply(__this, __arguments)).next());
19
19
  });
20
20
  };
21
- import { getProcessLogBuffer } from "@vite-plugin-opencode-assistant/shared";
21
+ import { getProcessLogBuffer } from "@vite-plugin-opencode-assistant/shared/node";
22
22
  import {
23
23
  RequestContext,
24
- createLogger,
25
- LOGS_API_PATH
26
- } from "@vite-plugin-opencode-assistant/shared";
24
+ createLogger
25
+ } from "@vite-plugin-opencode-assistant/shared/node";
26
+ import { LOGS_API_PATH } from "@vite-plugin-opencode-assistant/shared";
27
27
  const log = createLogger("Endpoints:Logs");
28
28
  function setupLogsEndpoint(server) {
29
29
  server.middlewares.use(LOGS_API_PATH, (req, res) => __async(null, null, function* () {
@@ -19,7 +19,7 @@ var __async = (__this, __arguments, generator) => {
19
19
  });
20
20
  };
21
21
  import { SESSIONS_API_PATH } from "@vite-plugin-opencode-assistant/shared";
22
- import { RequestContext, createLogger } from "@vite-plugin-opencode-assistant/shared";
22
+ import { RequestContext, createLogger } from "@vite-plugin-opencode-assistant/shared/node";
23
23
  const log = createLogger("Endpoints:Sessions");
24
24
  function setupSessionsEndpoint(server, ctx) {
25
25
  server.middlewares.use(SESSIONS_API_PATH, (req, res) => __async(null, null, function* () {
@@ -19,7 +19,7 @@ var __async = (__this, __arguments, generator) => {
19
19
  });
20
20
  };
21
21
  import { SSE_EVENTS_PATH } from "@vite-plugin-opencode-assistant/shared";
22
- import { RequestContext, createLogger } from "@vite-plugin-opencode-assistant/shared";
22
+ import { RequestContext, createLogger } from "@vite-plugin-opencode-assistant/shared/node";
23
23
  const log = createLogger("Endpoints:SSE");
24
24
  function setupSseEndpoint(server, ctx) {
25
25
  server.middlewares.use(SSE_EVENTS_PATH, (req, res) => __async(null, null, function* () {
@@ -19,7 +19,7 @@ var __async = (__this, __arguments, generator) => {
19
19
  });
20
20
  };
21
21
  import { START_API_PATH } from "@vite-plugin-opencode-assistant/shared";
22
- import { RequestContext } from "@vite-plugin-opencode-assistant/shared";
22
+ import { RequestContext } from "@vite-plugin-opencode-assistant/shared/node";
23
23
  function setupStartEndpoint(server, ctx) {
24
24
  server.middlewares.use(START_API_PATH, (_req, res) => __async(null, null, function* () {
25
25
  const reqCtx = new RequestContext("GET", START_API_PATH);
@@ -20,7 +20,8 @@ var __async = (__this, __arguments, generator) => {
20
20
  });
21
21
  };
22
22
  var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it);
23
- import { createLogger, WARMUP_API_PATH } from "@vite-plugin-opencode-assistant/shared";
23
+ import { createLogger } from "@vite-plugin-opencode-assistant/shared/node";
24
+ import { WARMUP_API_PATH } from "@vite-plugin-opencode-assistant/shared";
24
25
  const log = createLogger("Endpoints:Warmup");
25
26
  function setupWarmupEndpoint(server, ctx) {
26
27
  server.middlewares.use(WARMUP_API_PATH, (req, res) => __async(null, null, function* () {
@@ -20,7 +20,7 @@ var __async = (__this, __arguments, generator) => {
20
20
  };
21
21
  import fs from "fs";
22
22
  import { WIDGET_SCRIPT_PATH, WIDGET_STYLE_PATH } from "@vite-plugin-opencode-assistant/shared";
23
- import { RequestContext } from "@vite-plugin-opencode-assistant/shared";
23
+ import { RequestContext } from "@vite-plugin-opencode-assistant/shared/node";
24
24
  function setupWidgetEndpoints(server, ctx) {
25
25
  server.middlewares.use(WIDGET_SCRIPT_PATH, (_req, res) => __async(null, null, function* () {
26
26
  const reqCtx = new RequestContext("GET", WIDGET_SCRIPT_PATH);
package/es/index.mjs CHANGED
@@ -40,10 +40,9 @@ import {
40
40
  CONTEXT_API_PATH,
41
41
  DEFAULT_CONFIG,
42
42
  DEFAULT_PROXY_PORT,
43
- createLogger,
44
- setVerbose,
45
- initProcessLogCapture
43
+ setVerbose
46
44
  } from "@vite-plugin-opencode-assistant/shared";
45
+ import { createLogger, initProcessLogCapture } from "@vite-plugin-opencode-assistant/shared/node";
47
46
  import { setupMiddlewares, LOGS_API_PATH } from "./endpoints/index.mjs";
48
47
  import { injectWidget } from "./core/injector.mjs";
49
48
  import { OpenCodeAPI } from "./core/api.mjs";
@@ -24,7 +24,7 @@ import http from "http";
24
24
  import net from "net";
25
25
  import path from "path";
26
26
  import { MAX_PORT_TRIES, SERVER_CHECK_INTERVAL } from "@vite-plugin-opencode-assistant/shared";
27
- import { PerformanceTimer, createLogger } from "@vite-plugin-opencode-assistant/shared";
27
+ import { PerformanceTimer, createLogger } from "@vite-plugin-opencode-assistant/shared/node";
28
28
  const log = createLogger("Utils");
29
29
  function waitForServer(url, timeout = 1e4, process2) {
30
30
  const timer = new PerformanceTimer("waitForServer", { url, timeout });