@vite-plugin-opencode-assistant/opencode 1.0.22 → 1.0.23

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.
@@ -1,12 +1,12 @@
1
- const P = "[vite-plugin-opencode]";
2
- var E = Object.defineProperty, b = Object.defineProperties, w = Object.getOwnPropertyDescriptors, y = Object.getOwnPropertySymbols, C = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable, _ = (r, e, t) => e in r ? E(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, c = (r, e) => {
3
- for (var t in e || (e = {}))
4
- C.call(e, t) && _(r, t, e[t]);
5
- if (y)
6
- for (var t of y(e))
7
- S.call(e, t) && _(r, t, e[t]);
8
- return r;
9
- }, p = (r, e) => b(r, w(e)), O = (r, e, t) => _(r, typeof e != "symbol" ? e + "" : e, t);
1
+ const _ = "[vite-plugin-opencode]";
2
+ var b = Object.defineProperty, w = Object.defineProperties, E = Object.getOwnPropertyDescriptors, P = Object.getOwnPropertySymbols, C = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable, y = (e, t, r) => t in e ? b(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, u = (e, t) => {
3
+ for (var r in t || (t = {}))
4
+ C.call(t, r) && y(e, r, t[r]);
5
+ if (P)
6
+ for (var r of P(t))
7
+ S.call(t, r) && y(e, r, t[r]);
8
+ return e;
9
+ }, p = (e, t) => w(e, E(t)), O = (e, t, r) => y(e, typeof t != "symbol" ? t + "" : t, r);
10
10
  const s = {
11
11
  reset: "\x1B[0m",
12
12
  dim: "\x1B[2m",
@@ -22,140 +22,163 @@ const s = {
22
22
  2: s.yellow,
23
23
  3: s.red,
24
24
  4: s.reset
25
- }, L = {
25
+ }, x = {
26
26
  0: "DEBUG",
27
27
  1: "INFO",
28
28
  2: "WARN",
29
29
  3: "ERROR",
30
30
  4: "NONE"
31
31
  };
32
- let N = {
32
+ let L = {
33
33
  level: 1
34
34
  /* INFO */
35
35
  };
36
- function x() {
37
- const r = /* @__PURE__ */ new Date(), e = String(r.getHours()).padStart(2, "0"), t = String(r.getMinutes()).padStart(2, "0"), n = String(r.getSeconds()).padStart(2, "0"), o = String(r.getMilliseconds()).padStart(3, "0");
38
- return `${e}:${t}:${n}.${o}`;
36
+ function N() {
37
+ const e = /* @__PURE__ */ new Date(), t = String(e.getHours()).padStart(2, "0"), r = String(e.getMinutes()).padStart(2, "0"), n = String(e.getSeconds()).padStart(2, "0"), o = String(e.getMilliseconds()).padStart(3, "0");
38
+ return `${t}:${r}:${n}.${o}`;
39
39
  }
40
- function R(r = 3) {
41
- const e = new Error().stack;
42
- if (!e) return "";
43
- const n = e.split(`
44
- `)[r];
40
+ function R(e = 3) {
41
+ const t = new Error().stack;
42
+ if (!t) return "";
43
+ const n = t.split(`
44
+ `)[e];
45
45
  if (!n) return "";
46
46
  const o = n.match(/at\s+(?:(.+?)\s+\()?(.+?):(\d+):(\d+)\)?/);
47
47
  if (!o) return "";
48
- const [, a, m, l] = o;
49
- return `${m.split("/").pop() || m}:${l} ${a || "<anonymous>"}`;
48
+ const [, i, m, l] = o;
49
+ return `${m.split("/").pop() || m}:${l} ${i || "<anonymous>"}`;
50
50
  }
51
- function u(r, e = 0) {
52
- if (e > 3) return "...";
53
- if (r === null) return "null";
54
- if (r === void 0) return "undefined";
55
- if (typeof r == "string") return e > 0 ? `"${r}"` : r;
56
- if (typeof r == "number" || typeof r == "boolean") return String(r);
57
- if (r instanceof Error)
58
- return `${r.name}: ${r.message}${r.stack ? `
59
- ${r.stack}` : ""}`;
60
- if (Array.isArray(r))
61
- return r.length === 0 ? "[]" : r.length > 5 ? `[${r.slice(0, 3).map((o) => u(o, e + 1)).join(", ")}, ... ${r.length - 3} more items]` : `[${r.map((n) => u(n, e + 1)).join(", ")}]`;
62
- if (typeof r == "object") {
63
- const t = Object.entries(r);
64
- return t.length === 0 ? "{}" : t.length > 5 ? `{${t.slice(0, 3).map(([a, m]) => `${a}: ${u(m, e + 1)}`).join(", ")}, ... ${t.length - 3} more keys}` : `{${t.map(([o, a]) => `${o}: ${u(a, e + 1)}`).join(", ")}}`;
51
+ function f(e, t = 0) {
52
+ if (t > 3) return "...";
53
+ if (e === null) return "null";
54
+ if (e === void 0) return "undefined";
55
+ if (typeof e == "string") return t > 0 ? `"${e}"` : e;
56
+ if (typeof e == "number" || typeof e == "boolean") return String(e);
57
+ if (e instanceof Error)
58
+ return `${e.name}: ${e.message}${e.stack ? `
59
+ ${e.stack}` : ""}`;
60
+ if (Array.isArray(e))
61
+ return e.length === 0 ? "[]" : e.length > 5 ? `[${e.slice(0, 3).map((o) => f(o, t + 1)).join(", ")}, ... ${e.length - 3} more items]` : `[${e.map((n) => f(n, t + 1)).join(", ")}]`;
62
+ if (typeof e == "object") {
63
+ const r = Object.entries(e);
64
+ return r.length === 0 ? "{}" : r.length > 5 ? `{${r.slice(0, 3).map(([i, m]) => `${i}: ${f(m, t + 1)}`).join(", ")}, ... ${r.length - 3} more keys}` : `{${r.map(([o, i]) => `${o}: ${f(i, t + 1)}`).join(", ")}}`;
65
65
  }
66
- return String(r);
66
+ return String(e);
67
67
  }
68
- function T(r) {
69
- if (!r || Object.keys(r).length === 0) return "";
70
- const e = [];
71
- r.module && e.push(`[${r.module}]`), r.operation && e.push(`(${r.operation})`), r.traceId && e.push(`trace:${r.traceId}`), r.duration !== void 0 && e.push(`${r.duration}ms`);
72
- const t = Object.keys(r).filter(
68
+ function T(e) {
69
+ if (!e || Object.keys(e).length === 0) return "";
70
+ const t = [];
71
+ e.module && t.push(`[${e.module}]`), e.operation && t.push(`(${e.operation})`), e.traceId && t.push(`trace:${e.traceId}`), e.duration !== void 0 && t.push(`${e.duration}ms`);
72
+ const r = Object.keys(e).filter(
73
73
  (n) => !["module", "operation", "traceId", "duration", "error"].includes(n)
74
74
  );
75
- if (t.length > 0) {
75
+ if (r.length > 0) {
76
76
  const n = {};
77
- t.forEach((o) => n[o] = r[o]), e.push(u(n));
77
+ r.forEach((o) => n[o] = e[o]), t.push(f(n));
78
78
  }
79
- return e.join(" ");
79
+ return t.join(" ");
80
80
  }
81
- function $(r, e, t, ...n) {
82
- if (r < N.level) return;
81
+ function h(e, t, r, ...n) {
82
+ if (e < L.level) return;
83
83
  const o = [];
84
- o.push(`${s.dim}[${process.pid}]${s.reset}`), o.push(`${s.dim}${x()}${s.reset}`);
85
- const a = j[r], m = L[r].padEnd(5);
86
- o.push(`${a}${m}${s.reset}`), o.push(`${s.bright}${P}${s.reset}`);
87
- const l = T(t);
88
- if (l && o.push(`${s.magenta}${l}${s.reset}`), o.push(e), r >= 2) {
89
- const i = R(4);
90
- i && o.push(`${s.dim}(${i})${s.reset}`);
84
+ o.push(`${s.dim}[${process.pid}]${s.reset}`), o.push(`${s.dim}${N()}${s.reset}`);
85
+ const i = j[e], m = x[e].padEnd(5);
86
+ o.push(`${i}${m}${s.reset}`), o.push(`${s.bright}${_}${s.reset}`);
87
+ const l = T(r);
88
+ if (l && o.push(`${s.magenta}${l}${s.reset}`), o.push(t), e >= 2) {
89
+ const a = R(4);
90
+ a && o.push(`${s.dim}(${a})${s.reset}`);
91
91
  }
92
- const h = n.map((i) => u(i)).join(" ");
93
- if (h && o.push(h), t != null && t.error) {
94
- const i = t.error;
95
- i instanceof Error ? o.push(`${s.red}Error: ${i.message}${s.reset}`) : o.push(`${s.red}Error: ${u(i)}${s.reset}`);
92
+ const $ = n.map((a) => f(a)).join(" ");
93
+ if ($ && o.push($), r != null && r.error) {
94
+ const a = r.error;
95
+ a instanceof Error ? o.push(`${s.red}Error: ${a.message}${s.reset}`) : o.push(`${s.red}Error: ${f(a)}${s.reset}`);
96
96
  }
97
97
  const d = o.join(" ");
98
- r >= 3 ? console.error(d) : r === 2 ? console.warn(d) : console.log(d);
98
+ e >= 3 ? console.error(d) : e === 2 ? console.warn(d) : console.log(d);
99
99
  }
100
- const f = {
101
- debug(r, e, ...t) {
102
- $(0, r, e, ...t);
100
+ const g = {
101
+ debug(e, t, ...r) {
102
+ h(0, e, t, ...r);
103
103
  },
104
- info(r, e, ...t) {
105
- $(1, r, e, ...t);
104
+ info(e, t, ...r) {
105
+ h(1, e, t, ...r);
106
106
  },
107
- warn(r, e, ...t) {
108
- $(2, r, e, ...t);
107
+ warn(e, t, ...r) {
108
+ h(2, e, t, ...r);
109
109
  },
110
- error(r, e, ...t) {
111
- $(3, r, e, ...t);
110
+ error(e, t, ...r) {
111
+ h(3, e, t, ...r);
112
112
  },
113
- group(r, e) {
113
+ group(e, t) {
114
114
  },
115
115
  groupEnd() {
116
116
  }
117
117
  };
118
118
  class I {
119
- constructor(e, t) {
120
- O(this, "startTime"), O(this, "context"), O(this, "operation"), this.operation = e, this.context = t || {}, this.startTime = performance.now(), f.debug(`⏱️ Starting: ${e}`, this.context);
119
+ constructor(t, r) {
120
+ O(this, "startTime"), O(this, "context"), O(this, "operation"), this.operation = t, this.context = r || {}, this.startTime = performance.now(), g.debug(`⏱️ Starting: ${t}`, this.context);
121
121
  }
122
- end(e) {
123
- const t = Math.round(performance.now() - this.startTime), n = e || `✓ Completed: ${this.operation}`;
124
- return f.debug(n, p(c({}, this.context), { duration: t })), t;
122
+ end(t) {
123
+ const r = Math.round(performance.now() - this.startTime), n = t || `✓ Completed: ${this.operation}`;
124
+ return g.debug(n, p(u({}, this.context), { duration: r })), r;
125
125
  }
126
- checkpoint(e) {
127
- const t = Math.round(performance.now() - this.startTime);
128
- return f.debug(` ↳ ${e}`, p(c({}, this.context), { duration: t })), t;
126
+ checkpoint(t) {
127
+ const r = Math.round(performance.now() - this.startTime);
128
+ return g.debug(` ↳ ${t}`, p(u({}, this.context), { duration: r })), r;
129
129
  }
130
130
  }
131
- function B(r) {
131
+ function B(e) {
132
132
  return {
133
- debug(e, t, ...n) {
134
- f.debug(e, p(c({}, t), { module: r }), ...n);
133
+ debug(t, r, ...n) {
134
+ g.debug(t, p(u({}, r), { module: e }), ...n);
135
135
  },
136
- info(e, t, ...n) {
137
- f.info(e, p(c({}, t), { module: r }), ...n);
136
+ info(t, r, ...n) {
137
+ g.info(t, p(u({}, r), { module: e }), ...n);
138
138
  },
139
- warn(e, t, ...n) {
140
- f.warn(e, p(c({}, t), { module: r }), ...n);
139
+ warn(t, r, ...n) {
140
+ g.warn(t, p(u({}, r), { module: e }), ...n);
141
141
  },
142
- error(e, t, ...n) {
143
- f.error(e, p(c({}, t), { module: r }), ...n);
142
+ error(t, r, ...n) {
143
+ g.error(t, p(u({}, r), { module: e }), ...n);
144
144
  },
145
- timer(e, t) {
146
- return new I(e, p(c({}, t), { module: r }));
145
+ timer(t, r) {
146
+ return new I(t, p(u({}, r), { module: e }));
147
147
  }
148
148
  };
149
149
  }
150
- const g = B("OpenCodePluginPageContext"), D = async () => {
151
- g.info("PageContextPlugin loading...");
152
- const r = process.env.OPENCODE_CONTEXT_API_URL;
153
- return g.debug("Context API URL:", { contextApiUrl: r }), r ? (g.info("Plugin initialized successfully"), {
154
- "experimental.chat.system.transform": async (e, t) => {
155
- g.debug("System transform hook called");
156
- const n = `
157
- 你是一个专业的前端开发助手,运行在 **OpenCode** 平台中,并通过 **vite-plugin-opencode-assistant** 插件集成到用户的 Vite 开发环境。
150
+ const c = B("OpenCodePluginPageContext");
151
+ async function D(e) {
152
+ try {
153
+ const t = await fetch(e, {
154
+ method: "GET",
155
+ headers: { "Content-Type": "application/json" }
156
+ });
157
+ return t.ok ? await t.json() : (c.debug("Failed to fetch page context", { status: t.status }), null);
158
+ } catch (t) {
159
+ return c.debug("Error fetching page context", { error: t }), null;
160
+ }
161
+ }
162
+ const A = async () => {
163
+ c.info("PageContextPlugin loading...");
164
+ const e = process.env.OPENCODE_CONTEXT_API_URL;
165
+ return c.debug("Context API URL:", { contextApiUrl: e }), e ? (c.info("Plugin initialized successfully"), {
166
+ "experimental.chat.system.transform": async (t, r) => {
167
+ c.debug("System transform hook called");
168
+ const n = await D(e);
169
+ c.debug("Page context fetched", { pageContext: n });
170
+ let o = "";
171
+ n && (o = `
172
+ ## 用户当前浏览的页面
158
173
 
174
+ **这里的上下文为最高优先级,任何情况下都不能被覆盖**
175
+
176
+ - **页面 URL**: ${n.url || "未知"}
177
+ - **页面标题**: ${n.title || "未知"}
178
+ `);
179
+ const i = `
180
+ 你是一个专业的前端开发助手,运行在 **OpenCode** 平台中,并通过 **vite-plugin-opencode-assistant** 插件集成到用户的 Vite 开发环境。
181
+ ${o}
159
182
  ## 你的工作环境
160
183
 
161
184
  ### 架构说明
@@ -176,29 +199,41 @@ const g = B("OpenCodePluginPageContext"), D = async () => {
176
199
  └─────────────────────────────────────────────────────────────┘
177
200
  \`\`\`
178
201
 
179
- 请遵循以下规则:
202
+ ## 工作流程
203
+
204
+ 请严格按以下顺序处理用户请求:
205
+
206
+ ### 1. 定位节点位置(强制)
207
+
208
+ 当用户选中了页面节点时,**在处理用户请求之前**,你必须先找到这些节点在当前项目上下文中的位置:
209
+
210
+ - 利用提供的文件路径、CSS 选择器、元素文本等信息
211
+ - 通过文件搜索、DOM 分析等方式定位到具体代码位置
212
+ - 明确知道节点在哪里被定义/使用后,再处理用户请求
213
+
214
+ ### 2. 理解上下文
215
+
216
+ 将页面 URL、标题和选中节点信息作为用户请求的背景,帮助理解用户的真实意图。
180
217
 
181
- 1. **前置要求:定位节点位置**(强制)
182
- 当用户选中了页面节点时,**在处理用户请求之前**,你必须先找到这些节点在当前项目上下文中的位置。
183
- - 利用提供的文件路径、CSS 选择器、元素文本等信息
184
- - 通过文件搜索、DOM 分析等方式定位到具体代码位置
185
- - 明确知道节点在哪里被定义/使用后,再处理用户请求
218
+ ### 3. 直接行动
186
219
 
187
- 2. 如有需要,使用 Chrome DevTools Mcp 来获取用户当前正在浏览的页面 URL,而不是直接从上下文中提取。
220
+ 在明确节点位置后,针对用户的实际请求给出清晰、可执行的方案。
188
221
 
189
- 2. **理解上下文**:将页面 URL、标题和选中节点信息作为用户请求的背景,帮助理解用户的真实意图。
222
+ ## 工具使用指南
190
223
 
191
- 3. **直接行动**:在明确节点位置后,针对用户的实际请求给出清晰、可执行的方案。
224
+ ### Chrome DevTools Mcp
192
225
 
193
- ### Chrome DevTools Mcp 最佳实践
226
+ 1. **确保操作正确页面(强制)**
227
+ 在使用 Chrome DevTools Mcp 执行任何与用户正在浏览的页面相关的任务之前,必须先确认当前操作的页面就是用户正在浏览的页面。如果不确定,应先获取当前页面 URL 并与上下文中的页面 URL 进行比对。
194
228
 
195
- 1. **快照获取** 在没有获取到需要的节点信息时,使用 verbose 模式来获取更详细的节点信息。
229
+ 2. **快照获取**
230
+ 在没有获取到需要的节点信息时,使用 verbose 参数来获取更详细的节点信息。如果设置了 verbose 参数还是没有获取到节点信息,再尝试考虑其他方案。
196
231
  `.trim();
197
- t.system.push(n);
232
+ r.system.push(i);
198
233
  }
199
- }) : (g.warn("OPENCODE_CONTEXT_API_URL is not set, page context plugin will not work"), {});
234
+ }) : (c.warn("OPENCODE_CONTEXT_API_URL is not set, page context plugin will not work"), {});
200
235
  };
201
236
  export {
202
- D as PageContextPlugin,
203
- D as default
237
+ A as PageContextPlugin,
238
+ A as default
204
239
  };
@@ -43,6 +43,24 @@ __export(page_context_exports, {
43
43
  module.exports = __toCommonJS(page_context_exports);
44
44
  var import_shared = require("@vite-plugin-opencode-assistant/shared");
45
45
  const log = (0, import_shared.createLogger)("OpenCodePluginPageContext");
46
+ function fetchPageContext(contextApiUrl) {
47
+ return __async(this, null, function* () {
48
+ try {
49
+ const response = yield fetch(contextApiUrl, {
50
+ method: "GET",
51
+ headers: { "Content-Type": "application/json" }
52
+ });
53
+ if (!response.ok) {
54
+ log.debug("Failed to fetch page context", { status: response.status });
55
+ return null;
56
+ }
57
+ return yield response.json();
58
+ } catch (error) {
59
+ log.debug("Error fetching page context", { error });
60
+ return null;
61
+ }
62
+ });
63
+ }
46
64
  const PageContextPlugin = () => __async(null, null, function* () {
47
65
  log.info("PageContextPlugin loading...");
48
66
  const contextApiUrl = process.env.OPENCODE_CONTEXT_API_URL;
@@ -55,9 +73,22 @@ const PageContextPlugin = () => __async(null, null, function* () {
55
73
  return {
56
74
  "experimental.chat.system.transform": (_input, output) => __async(null, null, function* () {
57
75
  log.debug("System transform hook called");
76
+ const pageContext = yield fetchPageContext(contextApiUrl);
77
+ log.debug("Page context fetched", { pageContext });
78
+ let currentPageSection = "";
79
+ if (pageContext) {
80
+ currentPageSection = `
81
+ ## \u7528\u6237\u5F53\u524D\u6D4F\u89C8\u7684\u9875\u9762
82
+
83
+ **\u8FD9\u91CC\u7684\u4E0A\u4E0B\u6587\u4E3A\u6700\u9AD8\u4F18\u5148\u7EA7\uFF0C\u4EFB\u4F55\u60C5\u51B5\u4E0B\u90FD\u4E0D\u80FD\u88AB\u8986\u76D6**
84
+
85
+ - **\u9875\u9762 URL**: ${pageContext.url || "\u672A\u77E5"}
86
+ - **\u9875\u9762\u6807\u9898**: ${pageContext.title || "\u672A\u77E5"}
87
+ `;
88
+ }
58
89
  const systemPrompt = `
59
90
  \u4F60\u662F\u4E00\u4E2A\u4E13\u4E1A\u7684\u524D\u7AEF\u5F00\u53D1\u52A9\u624B\uFF0C\u8FD0\u884C\u5728 **OpenCode** \u5E73\u53F0\u4E2D\uFF0C\u5E76\u901A\u8FC7 **vite-plugin-opencode-assistant** \u63D2\u4EF6\u96C6\u6210\u5230\u7528\u6237\u7684 Vite \u5F00\u53D1\u73AF\u5883\u3002
60
-
91
+ ${currentPageSection}
61
92
  ## \u4F60\u7684\u5DE5\u4F5C\u73AF\u5883
62
93
 
63
94
  ### \u67B6\u6784\u8BF4\u660E
@@ -78,23 +109,35 @@ const PageContextPlugin = () => __async(null, null, function* () {
78
109
  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
79
110
  \`\`\`
80
111
 
81
- \u8BF7\u9075\u5FAA\u4EE5\u4E0B\u89C4\u5219\uFF1A
112
+ ## \u5DE5\u4F5C\u6D41\u7A0B
113
+
114
+ \u8BF7\u4E25\u683C\u6309\u4EE5\u4E0B\u987A\u5E8F\u5904\u7406\u7528\u6237\u8BF7\u6C42\uFF1A
115
+
116
+ ### 1. \u5B9A\u4F4D\u8282\u70B9\u4F4D\u7F6E\uFF08\u5F3A\u5236\uFF09
117
+
118
+ \u5F53\u7528\u6237\u9009\u4E2D\u4E86\u9875\u9762\u8282\u70B9\u65F6\uFF0C**\u5728\u5904\u7406\u7528\u6237\u8BF7\u6C42\u4E4B\u524D**\uFF0C\u4F60\u5FC5\u987B\u5148\u627E\u5230\u8FD9\u4E9B\u8282\u70B9\u5728\u5F53\u524D\u9879\u76EE\u4E0A\u4E0B\u6587\u4E2D\u7684\u4F4D\u7F6E\uFF1A
119
+
120
+ - \u5229\u7528\u63D0\u4F9B\u7684\u6587\u4EF6\u8DEF\u5F84\u3001CSS \u9009\u62E9\u5668\u3001\u5143\u7D20\u6587\u672C\u7B49\u4FE1\u606F
121
+ - \u901A\u8FC7\u6587\u4EF6\u641C\u7D22\u3001DOM \u5206\u6790\u7B49\u65B9\u5F0F\u5B9A\u4F4D\u5230\u5177\u4F53\u4EE3\u7801\u4F4D\u7F6E
122
+ - \u660E\u786E\u77E5\u9053\u8282\u70B9\u5728\u54EA\u91CC\u88AB\u5B9A\u4E49/\u4F7F\u7528\u540E\uFF0C\u518D\u5904\u7406\u7528\u6237\u8BF7\u6C42
123
+
124
+ ### 2. \u7406\u89E3\u4E0A\u4E0B\u6587
125
+
126
+ \u5C06\u9875\u9762 URL\u3001\u6807\u9898\u548C\u9009\u4E2D\u8282\u70B9\u4FE1\u606F\u4F5C\u4E3A\u7528\u6237\u8BF7\u6C42\u7684\u80CC\u666F\uFF0C\u5E2E\u52A9\u7406\u89E3\u7528\u6237\u7684\u771F\u5B9E\u610F\u56FE\u3002
82
127
 
83
- 1. **\u524D\u7F6E\u8981\u6C42\uFF1A\u5B9A\u4F4D\u8282\u70B9\u4F4D\u7F6E**\uFF08\u5F3A\u5236\uFF09
84
- \u5F53\u7528\u6237\u9009\u4E2D\u4E86\u9875\u9762\u8282\u70B9\u65F6\uFF0C**\u5728\u5904\u7406\u7528\u6237\u8BF7\u6C42\u4E4B\u524D**\uFF0C\u4F60\u5FC5\u987B\u5148\u627E\u5230\u8FD9\u4E9B\u8282\u70B9\u5728\u5F53\u524D\u9879\u76EE\u4E0A\u4E0B\u6587\u4E2D\u7684\u4F4D\u7F6E\u3002
85
- - \u5229\u7528\u63D0\u4F9B\u7684\u6587\u4EF6\u8DEF\u5F84\u3001CSS \u9009\u62E9\u5668\u3001\u5143\u7D20\u6587\u672C\u7B49\u4FE1\u606F
86
- - \u901A\u8FC7\u6587\u4EF6\u641C\u7D22\u3001DOM \u5206\u6790\u7B49\u65B9\u5F0F\u5B9A\u4F4D\u5230\u5177\u4F53\u4EE3\u7801\u4F4D\u7F6E
87
- - \u660E\u786E\u77E5\u9053\u8282\u70B9\u5728\u54EA\u91CC\u88AB\u5B9A\u4E49/\u4F7F\u7528\u540E\uFF0C\u518D\u5904\u7406\u7528\u6237\u8BF7\u6C42
128
+ ### 3. \u76F4\u63A5\u884C\u52A8
88
129
 
89
- 2. \u5982\u6709\u9700\u8981\uFF0C\u4F7F\u7528 Chrome DevTools Mcp \u6765\u83B7\u53D6\u7528\u6237\u5F53\u524D\u6B63\u5728\u6D4F\u89C8\u7684\u9875\u9762 URL\uFF0C\u800C\u4E0D\u662F\u76F4\u63A5\u4ECE\u4E0A\u4E0B\u6587\u4E2D\u63D0\u53D6\u3002
130
+ \u5728\u660E\u786E\u8282\u70B9\u4F4D\u7F6E\u540E\uFF0C\u9488\u5BF9\u7528\u6237\u7684\u5B9E\u9645\u8BF7\u6C42\u7ED9\u51FA\u6E05\u6670\u3001\u53EF\u6267\u884C\u7684\u65B9\u6848\u3002
90
131
 
91
- 2. **\u7406\u89E3\u4E0A\u4E0B\u6587**\uFF1A\u5C06\u9875\u9762 URL\u3001\u6807\u9898\u548C\u9009\u4E2D\u8282\u70B9\u4FE1\u606F\u4F5C\u4E3A\u7528\u6237\u8BF7\u6C42\u7684\u80CC\u666F\uFF0C\u5E2E\u52A9\u7406\u89E3\u7528\u6237\u7684\u771F\u5B9E\u610F\u56FE\u3002
132
+ ## \u5DE5\u5177\u4F7F\u7528\u6307\u5357
92
133
 
93
- 3. **\u76F4\u63A5\u884C\u52A8**\uFF1A\u5728\u660E\u786E\u8282\u70B9\u4F4D\u7F6E\u540E\uFF0C\u9488\u5BF9\u7528\u6237\u7684\u5B9E\u9645\u8BF7\u6C42\u7ED9\u51FA\u6E05\u6670\u3001\u53EF\u6267\u884C\u7684\u65B9\u6848\u3002
134
+ ### Chrome DevTools Mcp
94
135
 
95
- ### Chrome DevTools Mcp \u6700\u4F73\u5B9E\u8DF5
136
+ 1. **\u786E\u4FDD\u64CD\u4F5C\u6B63\u786E\u9875\u9762\uFF08\u5F3A\u5236\uFF09**
137
+ \u5728\u4F7F\u7528 Chrome DevTools Mcp \u6267\u884C\u4EFB\u4F55\u4E0E\u7528\u6237\u6B63\u5728\u6D4F\u89C8\u7684\u9875\u9762\u76F8\u5173\u7684\u4EFB\u52A1\u4E4B\u524D\uFF0C\u5FC5\u987B\u5148\u786E\u8BA4\u5F53\u524D\u64CD\u4F5C\u7684\u9875\u9762\u5C31\u662F\u7528\u6237\u6B63\u5728\u6D4F\u89C8\u7684\u9875\u9762\u3002\u5982\u679C\u4E0D\u786E\u5B9A\uFF0C\u5E94\u5148\u83B7\u53D6\u5F53\u524D\u9875\u9762 URL \u5E76\u4E0E\u4E0A\u4E0B\u6587\u4E2D\u7684\u9875\u9762 URL \u8FDB\u884C\u6BD4\u5BF9\u3002
96
138
 
97
- 1. **\u5FEB\u7167\u83B7\u53D6** \u5728\u6CA1\u6709\u83B7\u53D6\u5230\u9700\u8981\u7684\u8282\u70B9\u4FE1\u606F\u65F6\uFF0C\u4F7F\u7528 verbose \u6A21\u5F0F\u6765\u83B7\u53D6\u66F4\u8BE6\u7EC6\u7684\u8282\u70B9\u4FE1\u606F\u3002
139
+ 2. **\u5FEB\u7167\u83B7\u53D6**
140
+ \u5728\u6CA1\u6709\u83B7\u53D6\u5230\u9700\u8981\u7684\u8282\u70B9\u4FE1\u606F\u65F6\uFF0C\u4F7F\u7528 verbose \u53C2\u6570\u6765\u83B7\u53D6\u66F4\u8BE6\u7EC6\u7684\u8282\u70B9\u4FE1\u606F\u3002\u5982\u679C\u8BBE\u7F6E\u4E86 verbose \u53C2\u6570\u8FD8\u662F\u6CA1\u6709\u83B7\u53D6\u5230\u8282\u70B9\u4FE1\u606F\uFF0C\u518D\u5C1D\u8BD5\u8003\u8651\u5176\u4ED6\u65B9\u6848\u3002
98
141
  `.trim();
99
142
  output.system.push(systemPrompt);
100
143
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vite-plugin-opencode-assistant/opencode",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "type": "module",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "execa": "^9.6.1",
25
- "@vite-plugin-opencode-assistant/shared": "1.0.22"
25
+ "@vite-plugin-opencode-assistant/shared": "1.0.23"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@opencode-ai/plugin": "^1.3.15",