@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.
- package/es/plugins/page-context.js +82 -70
- package/lib/plugins/page-context.js +35 -19
- package/package.json +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const T = "[vite-plugin-opencode]";
|
|
2
|
-
var S = Object.defineProperty, N = Object.defineProperties, L = Object.getOwnPropertyDescriptors,
|
|
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) &&
|
|
5
|
-
if (
|
|
6
|
-
for (var r of
|
|
7
|
-
|
|
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
|
-
},
|
|
10
|
-
const
|
|
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
|
|
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
|
|
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
|
|
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) =>
|
|
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}: ${
|
|
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
|
|
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(
|
|
77
|
+
r.forEach((i) => o[i] = e[i]), t.push($(o));
|
|
78
78
|
}
|
|
79
79
|
return t.join(" ");
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function P(e, t, r, ...o) {
|
|
82
82
|
if (e < x.level) return;
|
|
83
83
|
const i = [];
|
|
84
|
-
i.push(`${
|
|
85
|
-
const p =
|
|
86
|
-
i.push(`${p}${n}${
|
|
87
|
-
const a =
|
|
88
|
-
if (a && i.push(`${
|
|
89
|
-
const
|
|
90
|
-
|
|
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((
|
|
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
|
|
97
|
+
const h = {
|
|
98
98
|
debug(e, t, ...r) {
|
|
99
|
-
|
|
99
|
+
P(0, e, t, ...r);
|
|
100
100
|
},
|
|
101
101
|
info(e, t, ...r) {
|
|
102
|
-
|
|
102
|
+
P(1, e, t, ...r);
|
|
103
103
|
},
|
|
104
104
|
warn(e, t, ...r) {
|
|
105
|
-
|
|
105
|
+
P(2, e, t, ...r);
|
|
106
106
|
},
|
|
107
107
|
error(e, t, ...r) {
|
|
108
|
-
|
|
108
|
+
P(3, e, t, ...r);
|
|
109
109
|
},
|
|
110
110
|
group(e, t) {
|
|
111
111
|
},
|
|
112
112
|
groupEnd() {
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
-
class
|
|
115
|
+
class D {
|
|
116
116
|
constructor(t, r) {
|
|
117
|
-
|
|
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
|
|
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
|
|
125
|
+
return h.debug(` ↳ ${t}`, m(g({}, this.context), { duration: r })), r;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function k(e) {
|
|
129
129
|
return {
|
|
130
130
|
debug(t, r, ...o) {
|
|
131
|
-
|
|
131
|
+
h.debug(t, m(g({}, r), { module: e }), ...o);
|
|
132
132
|
},
|
|
133
133
|
info(t, r, ...o) {
|
|
134
|
-
|
|
134
|
+
h.info(t, m(g({}, r), { module: e }), ...o);
|
|
135
135
|
},
|
|
136
136
|
warn(t, r, ...o) {
|
|
137
|
-
|
|
137
|
+
h.warn(t, m(g({}, r), { module: e }), ...o);
|
|
138
138
|
},
|
|
139
139
|
error(t, r, ...o) {
|
|
140
|
-
|
|
140
|
+
h.error(t, m(g({}, r), { module: e }), ...o);
|
|
141
141
|
},
|
|
142
142
|
timer(t, r) {
|
|
143
|
-
return new
|
|
143
|
+
return new D(t, m(g({}, r), { module: e }));
|
|
144
144
|
}
|
|
145
145
|
};
|
|
146
146
|
}
|
|
147
|
-
const C = 1e4, F = "__OPENCODE_CONTEXT__", l =
|
|
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
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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
|
-
|
|
210
|
+
s.push(`- **节点文本**:
|
|
204
211
|
\`\`\`text
|
|
205
|
-
${
|
|
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((
|
|
223
|
-
s += i(
|
|
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
|
-
│ │ │ 用户在这里与你对话 │
|
|
258
|
+
│ │ │ 用户在这里与你对话 │ │ │
|
|
251
259
|
│ │ └─────────────────────────────┘ │ │
|
|
252
260
|
│ └───────────────────────────────────────────────────────┘ │
|
|
253
261
|
└─────────────────────────────────────────────────────────────┘
|
|
@@ -280,28 +288,32 @@ ${c}${$}
|
|
|
280
288
|
|
|
281
289
|
请遵循以下规则:
|
|
282
290
|
|
|
283
|
-
1.
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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
|
|
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: !!((
|
|
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((
|
|
311
|
+
const f = [...a.messages].reverse().find((E) => E.info.role === "user");
|
|
300
312
|
if (!f) return;
|
|
301
|
-
const
|
|
302
|
-
if (!
|
|
303
|
-
const
|
|
304
|
-
|
|
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
|
-
|
|
113
|
-
if (
|
|
114
|
-
|
|
115
|
-
if (element.
|
|
116
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
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
|
|
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. **\
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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.
|
|
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.
|
|
25
|
+
"@vite-plugin-opencode-assistant/shared": "1.0.13"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@opencode-ai/plugin": "^1.3.15",
|