vite-plugin-opencode-assistant 1.0.80 → 1.0.81

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.
@@ -51,7 +51,9 @@ function setupStartEndpoint(server, ctx) {
51
51
  res.end(JSON.stringify({
52
52
  success: true,
53
53
  proxyPort: ctx.actualProxyPort,
54
- webPort: ctx.actualWebPort
54
+ webPort: ctx.actualWebPort,
55
+ projectRoot: server.config.root,
56
+ serviceInstanceId: ctx.serviceInstanceId
55
57
  }));
56
58
  reqCtx.end(200);
57
59
  }));
@@ -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/lib/index.cjs CHANGED
@@ -64,6 +64,7 @@ __export(lib_exports, {
64
64
  default: () => opencodePlugin
65
65
  });
66
66
  module.exports = __toCommonJS(lib_exports);
67
+ var import_crypto = __toESM(require("crypto"));
67
68
  var import_vite = __toESM(require("unplugin-vue-inspector/vite"));
68
69
  var import_shared = require("@vite-plugin-opencode-assistant/shared");
69
70
  var import_endpoints = require("./endpoints/index.cjs");
@@ -92,6 +93,7 @@ function createOpenCodePlugin(options = {}) {
92
93
  let actualWebPort = config.webPort;
93
94
  let actualProxyPort = (_a = config.proxyPort) != null ? _a : import_shared.DEFAULT_PROXY_PORT;
94
95
  let pageContext = { url: "", title: "" };
96
+ const serviceInstanceId = import_crypto.default.randomUUID();
95
97
  const sseClients = /* @__PURE__ */ new Set();
96
98
  const api = new import_api.OpenCodeAPI(
97
99
  config.hostname,
@@ -148,6 +150,9 @@ function createOpenCodePlugin(options = {}) {
148
150
  get actualWebPort() {
149
151
  return actualWebPort;
150
152
  },
153
+ get serviceInstanceId() {
154
+ return serviceInstanceId;
155
+ },
151
156
  getSessions: () => api.getSessions(service.workspaceRoot),
152
157
  createSession: () => api.createSession(service.workspaceRoot),
153
158
  deleteSession: (id) => api.deleteSession(id),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-opencode-assistant",
3
- "version": "1.0.80",
3
+ "version": "1.0.81",
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,15 +37,15 @@
37
37
  "dependencies": {
38
38
  "unplugin-vue-inspector": "^3.0.0",
39
39
  "execa": "^9.6.1",
40
- "@vite-plugin-opencode-assistant/opencode": "1.0.80",
41
- "@vite-plugin-opencode-assistant/shared": "1.0.80",
42
- "@vite-plugin-opencode-assistant/components": "1.0.80"
40
+ "@vite-plugin-opencode-assistant/components": "1.0.81",
41
+ "@vite-plugin-opencode-assistant/opencode": "1.0.81",
42
+ "@vite-plugin-opencode-assistant/shared": "1.0.81"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "vite": ">=5.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@vite-plugin-opencode-assistant/client": "1.0.80"
48
+ "@vite-plugin-opencode-assistant/client": "1.0.81"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "pagoda-cli build && vite build -c vite.client.config.ts",