@vite-plugin-opencode-assistant/opencode 1.0.12 → 1.0.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.
@@ -1,13 +1,13 @@
1
1
  const T = "[vite-plugin-opencode]";
2
- var S = Object.defineProperty, N = Object.defineProperties, L = Object.getOwnPropertyDescriptors, b = Object.getOwnPropertySymbols, j = Object.prototype.hasOwnProperty, R = Object.prototype.propertyIsEnumerable, y = (e, t, r) => t in e ? S(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, m = (e, t) => {
2
+ var S = Object.defineProperty, N = Object.defineProperties, L = Object.getOwnPropertyDescriptors, w = Object.getOwnPropertySymbols, j = Object.prototype.hasOwnProperty, M = Object.prototype.propertyIsEnumerable, b = (e, t, r) => t in e ? S(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, g = (e, t) => {
3
3
  for (var r in t || (t = {}))
4
- j.call(t, r) && y(e, r, t[r]);
5
- if (b)
6
- for (var r of b(t))
7
- R.call(t, r) && y(e, r, t[r]);
4
+ j.call(t, r) && b(e, r, t[r]);
5
+ if (w)
6
+ for (var r of w(t))
7
+ M.call(t, r) && b(e, r, t[r]);
8
8
  return e;
9
- }, g = (e, t) => N(e, L(t)), O = (e, t, r) => y(e, typeof t != "symbol" ? t + "" : t, r);
10
- const u = {
9
+ }, m = (e, t) => N(e, L(t)), y = (e, t, r) => b(e, typeof t != "symbol" ? t + "" : t, r);
10
+ const c = {
11
11
  reset: "\x1B[0m",
12
12
  dim: "\x1B[2m",
13
13
  bright: "\x1B[1m",
@@ -16,13 +16,13 @@ const u = {
16
16
  yellow: "\x1B[33m",
17
17
  magenta: "\x1B[35m",
18
18
  cyan: "\x1B[36m"
19
+ }, R = {
20
+ 0: c.cyan,
21
+ 1: c.green,
22
+ 2: c.yellow,
23
+ 3: c.red,
24
+ 4: c.reset
19
25
  }, A = {
20
- 0: u.cyan,
21
- 1: u.green,
22
- 2: u.yellow,
23
- 3: u.red,
24
- 4: u.reset
25
- }, I = {
26
26
  0: "DEBUG",
27
27
  1: "INFO",
28
28
  2: "WARN",
@@ -33,11 +33,11 @@ let x = {
33
33
  level: 1,
34
34
  showTrace: !1
35
35
  };
36
- function U() {
36
+ function I() {
37
37
  const e = /* @__PURE__ */ new Date(), t = String(e.getHours()).padStart(2, "0"), r = String(e.getMinutes()).padStart(2, "0"), o = String(e.getSeconds()).padStart(2, "0"), i = String(e.getMilliseconds()).padStart(3, "0");
38
38
  return `${t}:${r}:${o}.${i}`;
39
39
  }
40
- function B(e = 3) {
40
+ function U(e = 3) {
41
41
  const t = new Error().stack;
42
42
  if (!t) return "";
43
43
  const o = t.split(`
@@ -48,7 +48,7 @@ function B(e = 3) {
48
48
  const [, p, n, a] = i;
49
49
  return `${n.split("/").pop() || n}:${a} ${p || "<anonymous>"}`;
50
50
  }
51
- function h(e, t = 0) {
51
+ function $(e, t = 0) {
52
52
  if (t > 3) return "...";
53
53
  if (e === null) return "null";
54
54
  if (e === void 0) return "undefined";
@@ -58,14 +58,14 @@ function h(e, t = 0) {
58
58
  return `${e.name}: ${e.message}${e.stack ? `
59
59
  ${e.stack}` : ""}`;
60
60
  if (Array.isArray(e))
61
- return e.length === 0 ? "[]" : e.length > 5 ? `[${e.slice(0, 3).map((i) => h(i, t + 1)).join(", ")}, ... ${e.length - 3} more items]` : `[${e.map((o) => h(o, t + 1)).join(", ")}]`;
61
+ return e.length === 0 ? "[]" : e.length > 5 ? `[${e.slice(0, 3).map((i) => $(i, t + 1)).join(", ")}, ... ${e.length - 3} more items]` : `[${e.map((o) => $(o, t + 1)).join(", ")}]`;
62
62
  if (typeof e == "object") {
63
63
  const r = Object.entries(e);
64
- return r.length === 0 ? "{}" : r.length > 5 ? `{${r.slice(0, 3).map(([p, n]) => `${p}: ${h(n, t + 1)}`).join(", ")}, ... ${r.length - 3} more keys}` : `{${r.map(([i, p]) => `${i}: ${h(p, t + 1)}`).join(", ")}}`;
64
+ return r.length === 0 ? "{}" : r.length > 5 ? `{${r.slice(0, 3).map(([p, n]) => `${p}: ${$(n, t + 1)}`).join(", ")}, ... ${r.length - 3} more keys}` : `{${r.map(([i, p]) => `${i}: ${$(p, t + 1)}`).join(", ")}}`;
65
65
  }
66
66
  return String(e);
67
67
  }
68
- function M(e) {
68
+ function B(e) {
69
69
  if (!e || Object.keys(e).length === 0) return "";
70
70
  const t = [];
71
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`);
@@ -74,77 +74,77 @@ function M(e) {
74
74
  );
75
75
  if (r.length > 0) {
76
76
  const o = {};
77
- r.forEach((i) => o[i] = e[i]), t.push(h(o));
77
+ r.forEach((i) => o[i] = e[i]), t.push($(o));
78
78
  }
79
79
  return t.join(" ");
80
80
  }
81
- function E(e, t, r, ...o) {
81
+ function P(e, t, r, ...o) {
82
82
  if (e < x.level) return;
83
83
  const i = [];
84
- i.push(`${u.dim}[${process.pid}]${u.reset}`), i.push(`${u.dim}${U()}${u.reset}`);
85
- const p = A[e], n = I[e].padEnd(5);
86
- i.push(`${p}${n}${u.reset}`), i.push(`${u.bright}${T}${u.reset}`);
87
- const a = M(r);
88
- if (a && i.push(`${u.magenta}${a}${u.reset}`), i.push(t), e >= 2) {
89
- const c = B(4);
90
- c && i.push(`${u.dim}(${c})${u.reset}`);
84
+ i.push(`${c.dim}[${process.pid}]${c.reset}`), i.push(`${c.dim}${I()}${c.reset}`);
85
+ const p = R[e], n = A[e].padEnd(5);
86
+ i.push(`${p}${n}${c.reset}`), i.push(`${c.bright}${T}${c.reset}`);
87
+ const a = B(r);
88
+ if (a && i.push(`${c.magenta}${a}${c.reset}`), i.push(t), e >= 2) {
89
+ const u = U(4);
90
+ u && i.push(`${c.dim}(${u})${c.reset}`);
91
91
  }
92
- const s = o.map((c) => h(c)).join(" ");
92
+ const s = o.map((u) => $(u)).join(" ");
93
93
  s && i.push(s);
94
94
  const f = i.join(" ");
95
95
  e >= 3 ? console.error(f) : e === 2 ? console.warn(f) : console.log(f), r != null && r.error && e >= 3 && x.showTrace;
96
96
  }
97
- const d = {
97
+ const h = {
98
98
  debug(e, t, ...r) {
99
- E(0, e, t, ...r);
99
+ P(0, e, t, ...r);
100
100
  },
101
101
  info(e, t, ...r) {
102
- E(1, e, t, ...r);
102
+ P(1, e, t, ...r);
103
103
  },
104
104
  warn(e, t, ...r) {
105
- E(2, e, t, ...r);
105
+ P(2, e, t, ...r);
106
106
  },
107
107
  error(e, t, ...r) {
108
- E(3, e, t, ...r);
108
+ P(3, e, t, ...r);
109
109
  },
110
110
  group(e, t) {
111
111
  },
112
112
  groupEnd() {
113
113
  }
114
114
  };
115
- class k {
115
+ class D {
116
116
  constructor(t, r) {
117
- O(this, "startTime"), O(this, "context"), O(this, "operation"), this.operation = t, this.context = r || {}, this.startTime = performance.now(), d.debug(`⏱️ Starting: ${t}`, this.context);
117
+ y(this, "startTime"), y(this, "context"), y(this, "operation"), this.operation = t, this.context = r || {}, this.startTime = performance.now(), h.debug(`⏱️ Starting: ${t}`, this.context);
118
118
  }
119
119
  end(t) {
120
120
  const r = Math.round(performance.now() - this.startTime), o = t || `✓ Completed: ${this.operation}`;
121
- return d.debug(o, g(m({}, this.context), { duration: r })), r;
121
+ return h.debug(o, m(g({}, this.context), { duration: r })), r;
122
122
  }
123
123
  checkpoint(t) {
124
124
  const r = Math.round(performance.now() - this.startTime);
125
- return d.debug(` ↳ ${t}`, g(m({}, this.context), { duration: r })), r;
125
+ return h.debug(` ↳ ${t}`, m(g({}, this.context), { duration: r })), r;
126
126
  }
127
127
  }
128
- function D(e) {
128
+ function k(e) {
129
129
  return {
130
130
  debug(t, r, ...o) {
131
- d.debug(t, g(m({}, r), { module: e }), ...o);
131
+ h.debug(t, m(g({}, r), { module: e }), ...o);
132
132
  },
133
133
  info(t, r, ...o) {
134
- d.info(t, g(m({}, r), { module: e }), ...o);
134
+ h.info(t, m(g({}, r), { module: e }), ...o);
135
135
  },
136
136
  warn(t, r, ...o) {
137
- d.warn(t, g(m({}, r), { module: e }), ...o);
137
+ h.warn(t, m(g({}, r), { module: e }), ...o);
138
138
  },
139
139
  error(t, r, ...o) {
140
- d.error(t, g(m({}, r), { module: e }), ...o);
140
+ h.error(t, m(g({}, r), { module: e }), ...o);
141
141
  },
142
142
  timer(t, r) {
143
- return new k(t, g(m({}, r), { module: e }));
143
+ return new D(t, m(g({}, r), { module: e }));
144
144
  }
145
145
  };
146
146
  }
147
- const C = 1e4, F = "__OPENCODE_CONTEXT__", l = D("OpenCodePluginPageContext"), V = async () => {
147
+ const C = 1e4, F = "__OPENCODE_CONTEXT__", l = k("OpenCodePluginPageContext"), V = async () => {
148
148
  l.info("PageContextPlugin loading...");
149
149
  const e = process.env.OPENCODE_CONTEXT_API_URL;
150
150
  if (l.debug("Context API URL:", { contextApiUrl: e }), !e)
@@ -191,20 +191,28 @@ const C = 1e4, F = "__OPENCODE_CONTEXT__", l = D("OpenCodePluginPageContext"), V
191
191
  }
192
192
  }
193
193
  function i(n, a) {
194
- var f;
194
+ var f, u;
195
195
  const s = [];
196
- if (s.push(`### 选中节点 ${a + 1}`), n.filePath) {
197
- let c = n.filePath;
198
- n.line && (c += `:${n.line}`, n.column && (c += `:${n.column}`)), s.push(`- **文件位置**: \`${c}\``);
199
- }
200
- if ((f = n.innerText) != null && f.trim()) {
201
- const c = n.innerText.trim().substring(0, C), $ = n.innerText.length > C ? `
196
+ if (s.push(`### 选中节点 ${a + 1}`), n.filePath)
197
+ if (n.filePath.includes("node_modules")) {
198
+ if (s.push(`- **元素描述**: \`${n.description}\``), (f = n.innerText) != null && f.trim()) {
199
+ const d = n.innerText.trim().substring(0, 100);
200
+ s.push(`- **节点文本**: \`${d}${n.innerText.length > 100 ? "..." : ""}\``);
201
+ }
202
+ s.push(
203
+ `- **分析建议**: 请使用 Chrome DevTools MCP 获取当前页面快照,结合 CSS 选择器 \`${n.description}\` 来获取更多的页面上下文`
204
+ );
205
+ } else {
206
+ let d = n.filePath;
207
+ if (n.line && (d += `:${n.line}`, n.column && (d += `:${n.column}`)), s.push(`- **文件位置**: \`${d}\``), (u = n.innerText) != null && u.trim()) {
208
+ const O = n.innerText.trim().substring(0, C), E = n.innerText.length > C ? `
202
209
  ... (已省略部分内容)` : "";
203
- s.push(`- **节点文本**:
210
+ s.push(`- **节点文本**:
204
211
  \`\`\`text
205
- ${c}${$}
212
+ ${O}${E}
206
213
  \`\`\``);
207
- }
214
+ }
215
+ }
208
216
  return s.join(`
209
217
  `) + `
210
218
  `;
@@ -219,8 +227,8 @@ ${c}${$}
219
227
 
220
228
  `, (f = n.selectedElements) != null && f.length && (s += `用户选中了以下节点:
221
229
 
222
- `, n.selectedElements.forEach((c, $) => {
223
- s += i(c, $) + `
230
+ `, n.selectedElements.forEach((u, _) => {
231
+ s += i(u, _) + `
224
232
  `;
225
233
  })), s += `---
226
234
  **用户的请求**:
@@ -247,7 +255,7 @@ ${c}${$}
247
255
  │ │ │ │
248
256
  │ │ ┌─────────────────────────────┐ │ │
249
257
  │ │ │ OpenCode iframe (你的界面) │ ← 浮动聊天窗口 │ │
250
- │ │ │ 用户在这里与你对话 │ (Ctrl+K 打开) │ │
258
+ │ │ │ 用户在这里与你对话 │ │ │
251
259
  │ │ └─────────────────────────────┘ │ │
252
260
  │ └───────────────────────────────────────────────────────┘ │
253
261
  └─────────────────────────────────────────────────────────────┘
@@ -280,28 +288,32 @@ ${c}${$}
280
288
 
281
289
  请遵循以下规则:
282
290
 
283
- 1. **理解上下文**:将页面 URL、标题和选中节点信息作为用户请求的背景,帮助理解用户的真实意图。
284
- 2. **利用文件路径**:\`文件位置\` 中的路径对应项目源码文件,格式为 \`文件路径:行号:列号\`。你可以直接读取、分析或修改这些文件。
285
- 3. **精准定位**:结合 \`节点文本\` 和 \`文件位置\`,快速定位用户关注的具体代码位置,提供针对性的建议。
286
- 4. **直接行动**:针对用户的实际请求,直接给出清晰、可执行的方案。如果需要修改代码,主动提出修改方案并询问是否需要你直接修改。
287
- 5. **善用工具**:充分利用你的能力(读取文件、修改代码、运行命令、浏览器调试)来帮助用户解决问题。
291
+ 1. **前置要求:定位节点位置**(强制)
292
+ 当用户选中了页面节点时,**在处理用户请求之前**,你必须先找到这些节点在当前项目上下文中的位置。
293
+ - 利用提供的文件路径、CSS 选择器、元素文本等信息
294
+ - 通过文件搜索、DOM 分析等方式定位到具体代码位置
295
+ - 明确知道节点在哪里被定义/使用后,再处理用户请求
296
+
297
+ 2. **理解上下文**:将页面 URL、标题和选中节点信息作为用户请求的背景,帮助理解用户的真实意图。
298
+
299
+ 3. **直接行动**:在明确节点位置后,针对用户的实际请求给出清晰、可执行的方案。
288
300
  `.trim();
289
301
  a.system.push(s);
290
302
  },
291
303
  "experimental.chat.messages.transform": async (n, a) => {
292
- var P, w;
304
+ var d, O;
293
305
  l.debug("Message transform hook called");
294
306
  const s = await r();
295
307
  if (l.debug("Context data", {
296
308
  hasUrl: !!(s != null && s.url),
297
- hasElements: !!((P = s == null ? void 0 : s.selectedElements) != null && P.length)
309
+ hasElements: !!((d = s == null ? void 0 : s.selectedElements) != null && d.length)
298
310
  }), !(s != null && s.url)) return;
299
- const f = [...a.messages].reverse().find((_) => _.info.role === "user");
311
+ const f = [...a.messages].reverse().find((E) => E.info.role === "user");
300
312
  if (!f) return;
301
- const c = f.parts.find((_) => _.type === "text");
302
- if (!c || !("text" in c) || c.text.includes(F)) return;
303
- const $ = p(s);
304
- c.text = $ + c.text, (w = s.selectedElements) != null && w.length && (l.debug("Selected elements found, clearing..."), await o());
313
+ const u = f.parts.find((E) => E.type === "text");
314
+ if (!u || !("text" in u) || u.text.includes(F)) return;
315
+ const _ = p(s);
316
+ u.text = _ + u.text, (O = s.selectedElements) != null && O.length && (l.debug("Selected elements found, clearing..."), await o());
305
317
  }
306
318
  };
307
319
  };
@@ -105,26 +105,38 @@ const PageContextPlugin = () => __async(null, null, function* () {
105
105
  });
106
106
  }
107
107
  function formatSelectedElement(element, index) {
108
- var _a;
108
+ var _a, _b;
109
109
  const parts = [];
110
110
  parts.push(`### \u9009\u4E2D\u8282\u70B9 ${index + 1}`);
111
111
  if (element.filePath) {
112
- let location = element.filePath;
113
- if (element.line) {
114
- location += `:${element.line}`;
115
- if (element.column) {
116
- location += `:${element.column}`;
112
+ const isNodeModule = element.filePath.includes("node_modules");
113
+ if (isNodeModule) {
114
+ parts.push(`- **\u5143\u7D20\u63CF\u8FF0**: \`${element.description}\``);
115
+ if ((_a = element.innerText) == null ? void 0 : _a.trim()) {
116
+ const text = element.innerText.trim().substring(0, 100);
117
+ parts.push(`- **\u8282\u70B9\u6587\u672C**: \`${text}${element.innerText.length > 100 ? "..." : ""}\``);
117
118
  }
118
- }
119
- parts.push(`- **\u6587\u4EF6\u4F4D\u7F6E**: \`${location}\``);
120
- }
121
- if ((_a = element.innerText) == null ? void 0 : _a.trim()) {
122
- const text = element.innerText.trim().substring(0, MAX_TEXT_LENGTH);
123
- const suffix = element.innerText.length > MAX_TEXT_LENGTH ? "\n... (\u5DF2\u7701\u7565\u90E8\u5206\u5185\u5BB9)" : "";
124
- parts.push(`- **\u8282\u70B9\u6587\u672C**:
119
+ parts.push(
120
+ `- **\u5206\u6790\u5EFA\u8BAE**: \u8BF7\u4F7F\u7528 Chrome DevTools MCP \u83B7\u53D6\u5F53\u524D\u9875\u9762\u5FEB\u7167\uFF0C\u7ED3\u5408 CSS \u9009\u62E9\u5668 \`${element.description}\` \u6765\u83B7\u53D6\u66F4\u591A\u7684\u9875\u9762\u4E0A\u4E0B\u6587`
121
+ );
122
+ } else {
123
+ let location = element.filePath;
124
+ if (element.line) {
125
+ location += `:${element.line}`;
126
+ if (element.column) {
127
+ location += `:${element.column}`;
128
+ }
129
+ }
130
+ parts.push(`- **\u6587\u4EF6\u4F4D\u7F6E**: \`${location}\``);
131
+ if ((_b = element.innerText) == null ? void 0 : _b.trim()) {
132
+ const text = element.innerText.trim().substring(0, MAX_TEXT_LENGTH);
133
+ const suffix = element.innerText.length > MAX_TEXT_LENGTH ? "\n... (\u5DF2\u7701\u7565\u90E8\u5206\u5185\u5BB9)" : "";
134
+ parts.push(`- **\u8282\u70B9\u6587\u672C**:
125
135
  \`\`\`text
126
136
  ${text}${suffix}
127
137
  \`\`\``);
138
+ }
139
+ }
128
140
  }
129
141
  return parts.join("\n") + "\n";
130
142
  }
@@ -171,7 +183,7 @@ ${text}${suffix}
171
183
  \u2502 \u2502 \u2502 \u2502
172
184
  \u2502 \u2502 \u250C\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\u2510 \u2502 \u2502
173
185
  \u2502 \u2502 \u2502 OpenCode iframe (\u4F60\u7684\u754C\u9762) \u2502 \u2190 \u6D6E\u52A8\u804A\u5929\u7A97\u53E3 \u2502 \u2502
174
- \u2502 \u2502 \u2502 \u7528\u6237\u5728\u8FD9\u91CC\u4E0E\u4F60\u5BF9\u8BDD \u2502 (Ctrl+K \u6253\u5F00) \u2502 \u2502
186
+ \u2502 \u2502 \u2502 \u7528\u6237\u5728\u8FD9\u91CC\u4E0E\u4F60\u5BF9\u8BDD \u2502 \u2502 \u2502
175
187
  \u2502 \u2502 \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\u2518 \u2502 \u2502
176
188
  \u2502 \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\u2518 \u2502
177
189
  \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
@@ -204,11 +216,15 @@ ${text}${suffix}
204
216
 
205
217
  \u8BF7\u9075\u5FAA\u4EE5\u4E0B\u89C4\u5219\uFF1A
206
218
 
207
- 1. **\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
208
- 2. **\u5229\u7528\u6587\u4EF6\u8DEF\u5F84**\uFF1A\`\u6587\u4EF6\u4F4D\u7F6E\` \u4E2D\u7684\u8DEF\u5F84\u5BF9\u5E94\u9879\u76EE\u6E90\u7801\u6587\u4EF6\uFF0C\u683C\u5F0F\u4E3A \`\u6587\u4EF6\u8DEF\u5F84:\u884C\u53F7:\u5217\u53F7\`\u3002\u4F60\u53EF\u4EE5\u76F4\u63A5\u8BFB\u53D6\u3001\u5206\u6790\u6216\u4FEE\u6539\u8FD9\u4E9B\u6587\u4EF6\u3002
209
- 3. **\u7CBE\u51C6\u5B9A\u4F4D**\uFF1A\u7ED3\u5408 \`\u8282\u70B9\u6587\u672C\` \u548C \`\u6587\u4EF6\u4F4D\u7F6E\`\uFF0C\u5FEB\u901F\u5B9A\u4F4D\u7528\u6237\u5173\u6CE8\u7684\u5177\u4F53\u4EE3\u7801\u4F4D\u7F6E\uFF0C\u63D0\u4F9B\u9488\u5BF9\u6027\u7684\u5EFA\u8BAE\u3002
210
- 4. **\u76F4\u63A5\u884C\u52A8**\uFF1A\u9488\u5BF9\u7528\u6237\u7684\u5B9E\u9645\u8BF7\u6C42\uFF0C\u76F4\u63A5\u7ED9\u51FA\u6E05\u6670\u3001\u53EF\u6267\u884C\u7684\u65B9\u6848\u3002\u5982\u679C\u9700\u8981\u4FEE\u6539\u4EE3\u7801\uFF0C\u4E3B\u52A8\u63D0\u51FA\u4FEE\u6539\u65B9\u6848\u5E76\u8BE2\u95EE\u662F\u5426\u9700\u8981\u4F60\u76F4\u63A5\u4FEE\u6539\u3002
211
- 5. **\u5584\u7528\u5DE5\u5177**\uFF1A\u5145\u5206\u5229\u7528\u4F60\u7684\u80FD\u529B\uFF08\u8BFB\u53D6\u6587\u4EF6\u3001\u4FEE\u6539\u4EE3\u7801\u3001\u8FD0\u884C\u547D\u4EE4\u3001\u6D4F\u89C8\u5668\u8C03\u8BD5\uFF09\u6765\u5E2E\u52A9\u7528\u6237\u89E3\u51B3\u95EE\u9898\u3002
219
+ 1. **\u524D\u7F6E\u8981\u6C42\uFF1A\u5B9A\u4F4D\u8282\u70B9\u4F4D\u7F6E**\uFF08\u5F3A\u5236\uFF09
220
+ \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
221
+ - \u5229\u7528\u63D0\u4F9B\u7684\u6587\u4EF6\u8DEF\u5F84\u3001CSS \u9009\u62E9\u5668\u3001\u5143\u7D20\u6587\u672C\u7B49\u4FE1\u606F
222
+ - \u901A\u8FC7\u6587\u4EF6\u641C\u7D22\u3001DOM \u5206\u6790\u7B49\u65B9\u5F0F\u5B9A\u4F4D\u5230\u5177\u4F53\u4EE3\u7801\u4F4D\u7F6E
223
+ - \u660E\u786E\u77E5\u9053\u8282\u70B9\u5728\u54EA\u91CC\u88AB\u5B9A\u4E49/\u4F7F\u7528\u540E\uFF0C\u518D\u5904\u7406\u7528\u6237\u8BF7\u6C42
224
+
225
+ 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
226
+
227
+ 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
212
228
  `.trim();
213
229
  output.system.push(systemPrompt);
214
230
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vite-plugin-opencode-assistant/opencode",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
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.12"
25
+ "@vite-plugin-opencode-assistant/shared": "1.0.13"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@opencode-ai/plugin": "^1.3.15",