vite-plugin-opencode-assistant 1.0.80 → 1.0.83

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.
@@ -29,7 +29,9 @@ function setupStartEndpoint(server, ctx) {
29
29
  res.end(JSON.stringify({
30
30
  success: true,
31
31
  proxyPort: ctx.actualProxyPort,
32
- webPort: ctx.actualWebPort
32
+ webPort: ctx.actualWebPort,
33
+ projectRoot: server.config.root,
34
+ serviceInstanceId: ctx.serviceInstanceId
33
35
  }));
34
36
  reqCtx.end(200);
35
37
  }));
@@ -12,6 +12,7 @@ export interface EndpointContext {
12
12
  } | null;
13
13
  get actualProxyPort(): number;
14
14
  get actualWebPort(): number;
15
+ get serviceInstanceId(): string;
15
16
  getSessions: () => Promise<SessionInfo[]>;
16
17
  createSession: () => Promise<SessionInfo>;
17
18
  deleteSession: (id: string) => Promise<void>;
package/es/index.mjs CHANGED
@@ -34,6 +34,7 @@ var __async = (__this, __arguments, generator) => {
34
34
  step((generator = generator.apply(__this, __arguments)).next());
35
35
  });
36
36
  };
37
+ import crypto from "crypto";
37
38
  import Inspector from "unplugin-vue-inspector/vite";
38
39
  import {
39
40
  CONTEXT_API_PATH,
@@ -69,6 +70,7 @@ function createOpenCodePlugin(options = {}) {
69
70
  let actualWebPort = config.webPort;
70
71
  let actualProxyPort = (_a = config.proxyPort) != null ? _a : DEFAULT_PROXY_PORT;
71
72
  let pageContext = { url: "", title: "" };
73
+ const serviceInstanceId = crypto.randomUUID();
72
74
  const sseClients = /* @__PURE__ */ new Set();
73
75
  const api = new OpenCodeAPI(
74
76
  config.hostname,
@@ -125,6 +127,9 @@ function createOpenCodePlugin(options = {}) {
125
127
  get actualWebPort() {
126
128
  return actualWebPort;
127
129
  },
130
+ get serviceInstanceId() {
131
+ return serviceInstanceId;
132
+ },
128
133
  getSessions: () => api.getSessions(service.workspaceRoot),
129
134
  createSession: () => api.createSession(service.workspaceRoot),
130
135
  deleteSession: (id) => api.deleteSession(id),