vite-plugin-opencode-assistant 1.1.0 → 1.1.2
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 +1 -2
- package/es/core/opencode-web.mjs +1 -1
- package/es/core/proxy-server.mjs +6 -1
- package/es/core/service.mjs +1 -1
- package/es/endpoints/context.mjs +1 -1
- package/es/endpoints/logs.mjs +4 -4
- package/es/endpoints/sessions.mjs +1 -1
- package/es/endpoints/sse.mjs +1 -1
- package/es/endpoints/start.mjs +1 -1
- package/es/endpoints/warmup.mjs +2 -1
- package/es/endpoints/widget.mjs +1 -1
- package/es/index.mjs +2 -3
- package/es/utils/system.mjs +1 -1
- package/lib/client.js +2781 -2642
- package/lib/core/api.cjs +4 -3
- package/lib/core/opencode-web.cjs +4 -4
- package/lib/core/proxy-server.cjs +6 -1
- package/lib/core/service.cjs +2 -1
- package/lib/endpoints/context.cjs +3 -3
- package/lib/endpoints/logs.cjs +6 -5
- package/lib/endpoints/sessions.cjs +3 -3
- package/lib/endpoints/sse.cjs +3 -3
- package/lib/endpoints/start.cjs +2 -2
- package/lib/endpoints/warmup.cjs +2 -1
- package/lib/endpoints/widget.cjs +3 -3
- package/lib/index.cjs +3 -2
- package/lib/utils/system.cjs +3 -3
- package/package.json +5 -5
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 {
|
package/es/core/opencode-web.mjs
CHANGED
|
@@ -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");
|
package/es/core/proxy-server.mjs
CHANGED
|
@@ -283,6 +283,11 @@ function generateBridgeScript(options) {
|
|
|
283
283
|
display: none !important;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
+
/* \u9690\u85CF\u4F1A\u8BDD\u9762\u677F\u6807\u9898\u53F3\u4FA7\u6309\u94AE\u533A */
|
|
287
|
+
.opencode-review-panel-overlay [data-ref="session-panel"] [data-session-title] .shrink-0 {
|
|
288
|
+
display: none !important;
|
|
289
|
+
}
|
|
290
|
+
|
|
286
291
|
/* \u9690\u85CF\u6D6E\u52A8\u4F1A\u8BDD\uFF08\u7528 visibility+opacity \u907F\u514D\u5207\u6362\u95EA\u70C1\uFF09 */
|
|
287
292
|
.opencode-review-panel-overlay.hide-chat [data-ref="session-panel"] {
|
|
288
293
|
visibility: hidden !important;
|
|
@@ -507,7 +512,7 @@ function generateBridgeScript(options) {
|
|
|
507
512
|
function insertFilePart(element) {
|
|
508
513
|
const promptInput = document.querySelector('[data-component="prompt-input"]');
|
|
509
514
|
if (!promptInput) {
|
|
510
|
-
|
|
515
|
+
log.warn('Prompt input not found');
|
|
511
516
|
return;
|
|
512
517
|
}
|
|
513
518
|
|
package/es/core/service.mjs
CHANGED
|
@@ -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,
|
package/es/endpoints/context.mjs
CHANGED
|
@@ -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* () {
|
package/es/endpoints/logs.mjs
CHANGED
|
@@ -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
|
-
|
|
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* () {
|
package/es/endpoints/sse.mjs
CHANGED
|
@@ -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* () {
|
package/es/endpoints/start.mjs
CHANGED
|
@@ -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);
|
package/es/endpoints/warmup.mjs
CHANGED
|
@@ -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
|
|
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* () {
|
package/es/endpoints/widget.mjs
CHANGED
|
@@ -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
|
-
|
|
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";
|
package/es/utils/system.mjs
CHANGED
|
@@ -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 });
|