vite-plugin-aipanel 1.2.12 → 1.2.13

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/lib/index.cjs CHANGED
@@ -99,6 +99,9 @@ function aipanelPlugin(options = {}) {
99
99
  plugins.push(createAIPanelPlugin(options));
100
100
  return plugins;
101
101
  }
102
+ function normalizeViteHost(host, fallback) {
103
+ return typeof host === "string" && host && host !== "0.0.0.0" && host !== "::" && host !== "::1" ? host : fallback;
104
+ }
102
105
  function createAIPanelPlugin(options = {}) {
103
106
  const config = (0, import_core.resolvePluginConfig)(options);
104
107
  (0, import_core.setVerbose)(config.verbose);
@@ -108,6 +111,7 @@ function createAIPanelPlugin(options = {}) {
108
111
  let actualProxyPort = config.proxyPort ?? import_core.DEFAULT_PROXY_PORT;
109
112
  let projectRoot = "";
110
113
  let vueDevtoolsApiUrl = "";
114
+ let viteServerHost = "localhost";
111
115
  const pageContext = { url: "", title: "" };
112
116
  const DEFAULT_TAB = "default";
113
117
  const pageContexts = /* @__PURE__ */ new Map([[DEFAULT_TAB, pageContext]]);
@@ -156,6 +160,7 @@ function createAIPanelPlugin(options = {}) {
156
160
  async configureServer(server) {
157
161
  const timer = log.timer("configureServer");
158
162
  projectRoot = server.config.root;
163
+ viteServerHost = normalizeViteHost(server.config.server.host, config.hostname);
159
164
  let viteOrigin = "";
160
165
  (0, import_endpoints.setupMiddlewares)(
161
166
  server,
@@ -371,6 +376,7 @@ ${SILENT_CONTEXT_SCRIPT}</body>`),
371
376
  hotkey: config.hotkey,
372
377
  proxyPort: actualProxyPort,
373
378
  proxyHost: config.hostname,
379
+ viteHost: viteServerHost,
374
380
  displayMode: config.displayMode === "extension" ? "extension-selector" : config.displayMode,
375
381
  splitMode: config.splitMode,
376
382
  serviceInstanceId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-aipanel",
3
- "version": "1.2.12",
3
+ "version": "1.2.13",
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",
@@ -42,12 +42,12 @@
42
42
  "execa": "^9.6.1",
43
43
  "typescript-language-server": "^5.3.0",
44
44
  "unplugin-vue-inspector": "^3.0.0",
45
- "@aipanel/core": "1.2.12",
46
- "@aipanel/provider-opencode": "1.2.12"
45
+ "@aipanel/core": "1.2.13",
46
+ "@aipanel/provider-opencode": "1.2.13"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "vite": ">=5.0.0",
50
- "@aipanel/provider-deepseek": "1.2.12"
50
+ "@aipanel/provider-deepseek": "1.2.13"
51
51
  },
52
52
  "peerDependenciesMeta": {
53
53
  "@aipanel/provider-deepseek": {
@@ -57,7 +57,7 @@
57
57
  "devDependencies": {
58
58
  "@types/picomatch": "^4.0.0",
59
59
  "sharp": "^0.34.5",
60
- "@aipanel/client": "1.2.12"
60
+ "@aipanel/client": "1.2.13"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "node scripts/sync-official-meta.mjs && pagoda-cli build && vite build -c vite.client.config.ts",