vite-plugin-opencode-assistant 1.0.90 → 1.0.92
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/endpoints/context.mjs +5 -2
- package/lib/client.js +2079 -2060
- package/lib/endpoints/context.cjs +5 -2
- package/package.json +5 -5
|
@@ -89,18 +89,21 @@ function setupContextEndpoint(server, ctx) {
|
|
|
89
89
|
let body = "";
|
|
90
90
|
req.on("data", (chunk) => body += chunk);
|
|
91
91
|
req.on("end", () => {
|
|
92
|
-
var _a;
|
|
92
|
+
var _a, _b, _c;
|
|
93
93
|
try {
|
|
94
94
|
const data = JSON.parse(body);
|
|
95
95
|
ctx.pageContext = {
|
|
96
96
|
url: data.url || "",
|
|
97
97
|
title: data.title || "",
|
|
98
|
+
// 保留已有的 tabId/tabIndex(避免页内 widget 覆盖 Side Panel 写入的值)
|
|
99
|
+
tabId: (_a = data.tabId) != null ? _a : ctx.pageContext.tabId,
|
|
100
|
+
tabIndex: (_b = data.tabIndex) != null ? _b : ctx.pageContext.tabIndex,
|
|
98
101
|
selectedElements: data.selectedElements || []
|
|
99
102
|
};
|
|
100
103
|
log.debug("Context updated", {
|
|
101
104
|
url: ctx.pageContext.url,
|
|
102
105
|
title: ctx.pageContext.title,
|
|
103
|
-
selectedElementsCount: ((
|
|
106
|
+
selectedElementsCount: ((_c = ctx.pageContext.selectedElements) == null ? void 0 : _c.length) || 0
|
|
104
107
|
});
|
|
105
108
|
if (ctx.pageContext.selectedElements && ctx.pageContext.selectedElements.length > 0) {
|
|
106
109
|
log.debug("Selected elements details", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-opencode-assistant",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.92",
|
|
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/components": "1.0.
|
|
41
|
-
"@vite-plugin-opencode-assistant/opencode": "1.0.
|
|
42
|
-
"@vite-plugin-opencode-assistant/shared": "1.0.
|
|
40
|
+
"@vite-plugin-opencode-assistant/components": "1.0.92",
|
|
41
|
+
"@vite-plugin-opencode-assistant/opencode": "1.0.92",
|
|
42
|
+
"@vite-plugin-opencode-assistant/shared": "1.0.92"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"vite": ">=5.0.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@vite-plugin-opencode-assistant/client": "1.0.
|
|
48
|
+
"@vite-plugin-opencode-assistant/client": "1.0.92"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "pagoda-cli build && vite build -c vite.client.config.ts",
|