page-agent-sdk 2.41.1 → 2.43.0
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/README.md +4 -4
- package/README.zh-CN.md +4 -4
- package/dist/page-agent-sdk.headless.js +1028 -809
- package/dist/page-agent-sdk.iife.js +185 -137
- package/dist/page-agent-sdk.js +567 -349
- package/dist/page-agent-sdk.umd.cjs +83 -35
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/types/headless.d.ts +29 -0
- package/types/index.d.ts +29 -0
package/dist/page-agent-sdk.js
CHANGED
|
@@ -6838,6 +6838,7 @@ async function Ef(e, t, n, r, i, a) {
|
|
|
6838
6838
|
...t.middleware ?? []
|
|
6839
6839
|
],
|
|
6840
6840
|
maxToolRounds: t.maxToolRounds ?? gf,
|
|
6841
|
+
maxVerifyAttempts: t.maxVerifyAttempts ?? 0,
|
|
6841
6842
|
onLog: i,
|
|
6842
6843
|
debug: t.debug
|
|
6843
6844
|
});
|
|
@@ -6970,6 +6971,7 @@ function kf(e, t) {
|
|
|
6970
6971
|
...e.allowedTools?.length ? { allowedTools: e.allowedTools } : {},
|
|
6971
6972
|
...e.middleware?.length ? { middleware: e.middleware } : {},
|
|
6972
6973
|
...e.summarization === void 0 ? {} : { summarization: e.summarization },
|
|
6974
|
+
...e.maxVerifyAttempts === void 0 ? {} : { maxVerifyAttempts: e.maxVerifyAttempts },
|
|
6973
6975
|
...t.getFocuses ? { getFocuses: t.getFocuses } : {},
|
|
6974
6976
|
...t.getSchema ? { getSchema: t.getSchema } : {},
|
|
6975
6977
|
...t.tracker ? { tracker: t.tracker } : {},
|
|
@@ -12747,7 +12749,7 @@ var dg = { class: "chat-header" }, fg = { class: "header-left" }, pg = { class:
|
|
|
12747
12749
|
let n = e.__vccOpts || e;
|
|
12748
12750
|
for (let [e, r] of t) n[e] = r;
|
|
12749
12751
|
return n;
|
|
12750
|
-
}, wg = /*#__PURE__*/ Cg(Sg, [["__scopeId", "data-v-
|
|
12752
|
+
}, wg = /*#__PURE__*/ Cg(Sg, [["__scopeId", "data-v-9e29849d"]]), Tg = {
|
|
12751
12753
|
key: 0,
|
|
12752
12754
|
class: "focus-bar"
|
|
12753
12755
|
}, Eg = { class: "focus-bar-text" }, Dg = {
|
|
@@ -22109,12 +22111,9 @@ app.mount('#app');
|
|
|
22109
22111
|
}, null, 8, ["code", "lang"])) : Q("", !0)]))], 64));
|
|
22110
22112
|
}
|
|
22111
22113
|
}), ex = {
|
|
22112
|
-
key: 1,
|
|
22113
|
-
class: "typing-text"
|
|
22114
|
-
}, tx = {
|
|
22115
22114
|
key: 0,
|
|
22116
22115
|
class: "stream-cursor"
|
|
22117
|
-
},
|
|
22116
|
+
}, tx = /*#__PURE__*/ Cg(/* @__PURE__ */ Mi({
|
|
22118
22117
|
__name: "MessageBubble",
|
|
22119
22118
|
props: {
|
|
22120
22119
|
content: {},
|
|
@@ -22124,43 +22123,39 @@ app.mount('#app');
|
|
|
22124
22123
|
showCursor: { type: Boolean }
|
|
22125
22124
|
},
|
|
22126
22125
|
setup(e) {
|
|
22127
|
-
return (t, n) => (Y(), X(J, null, [Z("div", { class: H(["message-bubble", [e.role, { typing: e.isPendingAssistant }]]) }, [e.isPendingAssistant ? (Y(), X(J, { key: 0 }, [e.showTyping
|
|
22128
|
-
n[0] ||= Z("span", { class: "dot" }, null, -1),
|
|
22129
|
-
n[1] ||= Z("span", { class: "dot" }, null, -1),
|
|
22130
|
-
n[2] ||= Z("span", { class: "dot" }, null, -1)
|
|
22131
|
-
], 64)) : (Y(), X("span", ex, "思考中…"))], 64)) : (Y(), X(J, { key: 1 }, [e.role === "assistant" ? (Y(), ns($b, {
|
|
22126
|
+
return (t, n) => (Y(), X(J, null, [Z("div", { class: H(["message-bubble", [e.role, { typing: e.isPendingAssistant }]]) }, [e.isPendingAssistant ? (Y(), X(J, { key: 0 }, [Z("span", { class: H(["typing-dot", { pulse: e.showTyping }]) }, null, 2), n[0] ||= Z("span", { class: "typing-text" }, "思考中...", -1)], 64)) : (Y(), X(J, { key: 1 }, [e.role === "assistant" ? (Y(), ns($b, {
|
|
22132
22127
|
key: 0,
|
|
22133
22128
|
content: e.content
|
|
22134
|
-
}, null, 8, ["content"])) : (Y(), X(J, { key: 1 }, [ms(U(e.content), 1)], 64))], 64))], 2), e.showCursor ? (Y(), X("span",
|
|
22129
|
+
}, null, 8, ["content"])) : (Y(), X(J, { key: 1 }, [ms(U(e.content), 1)], 64))], 64))], 2), e.showCursor ? (Y(), X("span", ex)) : Q("", !0)], 64));
|
|
22135
22130
|
}
|
|
22136
|
-
}), [["__scopeId", "data-v-
|
|
22131
|
+
}), [["__scopeId", "data-v-c38029d9"]]), nx = { class: "message-time" }, rx = /*#__PURE__*/ Cg(/* @__PURE__ */ Mi({
|
|
22137
22132
|
__name: "MessageTime",
|
|
22138
22133
|
props: { time: {} },
|
|
22139
22134
|
setup(e) {
|
|
22140
|
-
return (t, n) => (Y(), X("div",
|
|
22135
|
+
return (t, n) => (Y(), X("div", nx, U(e.time), 1));
|
|
22141
22136
|
}
|
|
22142
|
-
}), [["__scopeId", "data-v-4a976e4a"]]),
|
|
22137
|
+
}), [["__scopeId", "data-v-4a976e4a"]]), ix = { class: "msg-actions" }, ax = ["title"], ox = /*#__PURE__*/ Cg(/* @__PURE__ */ Mi({
|
|
22143
22138
|
__name: "MessageActions",
|
|
22144
22139
|
props: { copied: { type: Boolean } },
|
|
22145
22140
|
emits: ["copy", "regenerate"],
|
|
22146
22141
|
setup(e) {
|
|
22147
|
-
return (t, n) => (Y(), X("div",
|
|
22142
|
+
return (t, n) => (Y(), X("div", ix, [Z("button", {
|
|
22148
22143
|
class: "msg-action-btn",
|
|
22149
22144
|
title: e.copied ? "已复制" : "复制",
|
|
22150
22145
|
onClick: n[0] ||= (e) => t.$emit("copy")
|
|
22151
|
-
}, U(e.copied ? "✓ 已复制" : "📋 复制"), 9,
|
|
22146
|
+
}, U(e.copied ? "✓ 已复制" : "📋 复制"), 9, ax), Z("button", {
|
|
22152
22147
|
class: "msg-action-btn",
|
|
22153
22148
|
title: "重新生成",
|
|
22154
22149
|
onClick: n[1] ||= (e) => t.$emit("regenerate")
|
|
22155
22150
|
}, "🔄 重新生成")]));
|
|
22156
22151
|
}
|
|
22157
|
-
}), [["__scopeId", "data-v-33638c4b"]]),
|
|
22152
|
+
}), [["__scopeId", "data-v-33638c4b"]]), sx = ["data-msg-idx"], cx = {
|
|
22158
22153
|
key: 0,
|
|
22159
22154
|
class: "message-avatar"
|
|
22160
|
-
},
|
|
22155
|
+
}, lx = { class: "message-content" }, ux = {
|
|
22161
22156
|
key: 2,
|
|
22162
22157
|
class: "msg-focuses"
|
|
22163
|
-
},
|
|
22158
|
+
}, dx = ["title", "onClick"], fx = ["onClick"], px = /*#__PURE__*/ Cg(/* @__PURE__ */ Mi({
|
|
22164
22159
|
__name: "MessageRow",
|
|
22165
22160
|
props: {
|
|
22166
22161
|
message: {},
|
|
@@ -22184,7 +22179,7 @@ app.mount('#app');
|
|
|
22184
22179
|
return (t, c) => (Y(), X("div", {
|
|
22185
22180
|
class: H(["message-row", e.message.role]),
|
|
22186
22181
|
"data-msg-idx": e.index
|
|
22187
|
-
}, [e.showAvatar ? (Y(), X("div",
|
|
22182
|
+
}, [e.showAvatar ? (Y(), X("div", cx, U(e.message.role === "user" ? "👤" : "🤖"), 1)) : Q("", !0), Z("div", lx, [
|
|
22188
22183
|
r.value ? (Y(), ns(Ng, {
|
|
22189
22184
|
key: 0,
|
|
22190
22185
|
text: i.value,
|
|
@@ -22195,7 +22190,7 @@ app.mount('#app');
|
|
|
22195
22190
|
key: 1,
|
|
22196
22191
|
steps: a.value
|
|
22197
22192
|
}, null, 8, ["steps"])) : Q("", !0),
|
|
22198
|
-
e.message.role === "user" && e.message.focuses?.length ? (Y(), X("div",
|
|
22193
|
+
e.message.role === "user" && e.message.focuses?.length ? (Y(), X("div", ux, [(Y(!0), X(J, null, ia(e.message.focuses, (e) => (Y(), X("span", {
|
|
22199
22194
|
key: e.path,
|
|
22200
22195
|
class: "msg-focus-chip",
|
|
22201
22196
|
title: `回看 ${e.path}`,
|
|
@@ -22204,8 +22199,8 @@ app.mount('#app');
|
|
|
22204
22199
|
type: "button",
|
|
22205
22200
|
class: "msg-focus-chip-x",
|
|
22206
22201
|
onClick: gl((t) => K(n).removeFocus(e.path), ["stop"])
|
|
22207
|
-
}, "✕", 8,
|
|
22208
|
-
ls(
|
|
22202
|
+
}, "✕", 8, fx)], 8, dx))), 128))])) : Q("", !0),
|
|
22203
|
+
ls(tx, {
|
|
22209
22204
|
content: e.message.content,
|
|
22210
22205
|
role: e.message.role,
|
|
22211
22206
|
"is-pending-assistant": e.isPendingAssistant,
|
|
@@ -22218,28 +22213,28 @@ app.mount('#app');
|
|
|
22218
22213
|
"show-typing",
|
|
22219
22214
|
"show-cursor"
|
|
22220
22215
|
]),
|
|
22221
|
-
ls(
|
|
22222
|
-
o.value ? (Y(), ns(
|
|
22216
|
+
ls(rx, { time: e.time }, null, 8, ["time"]),
|
|
22217
|
+
o.value ? (Y(), ns(ox, {
|
|
22223
22218
|
key: 3,
|
|
22224
22219
|
copied: e.copied,
|
|
22225
22220
|
onCopy: c[1] ||= (e) => t.$emit("copy"),
|
|
22226
22221
|
onRegenerate: c[2] ||= (e) => t.$emit("regenerate")
|
|
22227
22222
|
}, null, 8, ["copied"])) : Q("", !0)
|
|
22228
|
-
])], 10,
|
|
22223
|
+
])], 10, sx));
|
|
22229
22224
|
}
|
|
22230
|
-
}), [["__scopeId", "data-v-
|
|
22225
|
+
}), [["__scopeId", "data-v-77afcc15"]]), mx = {
|
|
22231
22226
|
key: 0,
|
|
22232
22227
|
class: "empty-state"
|
|
22233
|
-
},
|
|
22228
|
+
}, hx = {
|
|
22234
22229
|
key: 1,
|
|
22235
22230
|
class: "message-row assistant"
|
|
22236
|
-
},
|
|
22231
|
+
}, gx = {
|
|
22237
22232
|
key: 0,
|
|
22238
22233
|
class: "message-avatar"
|
|
22239
|
-
},
|
|
22234
|
+
}, _x = { class: "message-content" }, vx = {
|
|
22240
22235
|
key: 2,
|
|
22241
22236
|
class: "error-bar"
|
|
22242
|
-
},
|
|
22237
|
+
}, yx = { class: "error-text" }, bx = /*#__PURE__*/ Cg(/* @__PURE__ */ Mi({
|
|
22243
22238
|
__name: "MessageList",
|
|
22244
22239
|
props: {
|
|
22245
22240
|
showAvatar: { type: Boolean },
|
|
@@ -22254,8 +22249,8 @@ app.mount('#app');
|
|
|
22254
22249
|
onScroll: y[2] ||= (...e) => K(f) && K(f)(...e),
|
|
22255
22250
|
onWheel: y[3] ||= (...e) => K(p) && K(p)(...e)
|
|
22256
22251
|
}, [
|
|
22257
|
-
g.value ? Q("", !0) : (Y(), X("div",
|
|
22258
|
-
(Y(!0), X(J, null, ia(K(u).messages, (t, c) => (Y(), ns(
|
|
22252
|
+
g.value ? Q("", !0) : (Y(), X("div", mx, [...y[4] ||= [Z("div", { class: "empty-icon" }, "💬", -1), Z("p", null, "有什么可以帮你的?", -1)]])),
|
|
22253
|
+
(Y(!0), X(J, null, ia(K(u).messages, (t, c) => (Y(), ns(px, {
|
|
22259
22254
|
key: c,
|
|
22260
22255
|
message: t,
|
|
22261
22256
|
index: c,
|
|
@@ -22285,15 +22280,15 @@ app.mount('#app');
|
|
|
22285
22280
|
"onCopy",
|
|
22286
22281
|
"onRegenerate"
|
|
22287
22282
|
]))), 128)),
|
|
22288
|
-
K(u).loading && !v.value ? (Y(), X("div",
|
|
22283
|
+
K(u).loading && !v.value ? (Y(), X("div", hx, [e.showAvatar ? (Y(), X("div", gx, "🤖")) : Q("", !0), Z("div", _x, [ls(tx, {
|
|
22289
22284
|
content: "",
|
|
22290
22285
|
role: "assistant",
|
|
22291
22286
|
"is-pending-assistant": !0,
|
|
22292
22287
|
"show-typing": e.showTyping,
|
|
22293
22288
|
"show-cursor": !1
|
|
22294
22289
|
}, null, 8, ["show-typing"])])])) : Q("", !0),
|
|
22295
|
-
K(u).error ? (Y(), X("div",
|
|
22296
|
-
Z("span",
|
|
22290
|
+
K(u).error ? (Y(), X("div", vx, [
|
|
22291
|
+
Z("span", yx, U(K(u).error), 1),
|
|
22297
22292
|
_.value ? (Y(), X("button", {
|
|
22298
22293
|
key: 0,
|
|
22299
22294
|
class: "retry-btn",
|
|
@@ -22308,54 +22303,54 @@ app.mount('#app');
|
|
|
22308
22303
|
])) : Q("", !0)
|
|
22309
22304
|
], 544));
|
|
22310
22305
|
}
|
|
22311
|
-
}), [["__scopeId", "data-v-fe599f6d"]]),
|
|
22306
|
+
}), [["__scopeId", "data-v-fe599f6d"]]), xx = {
|
|
22312
22307
|
key: 0,
|
|
22313
22308
|
class: "queued-bar"
|
|
22314
|
-
},
|
|
22309
|
+
}, Sx = { class: "queued-head" }, Cx = { class: "queued-count" }, wx = { class: "queued-idx" }, Tx = { class: "queued-text" }, Ex = ["onClick"], Dx = ["onClick"], Ox = /*#__PURE__*/ Cg(/* @__PURE__ */ Mi({
|
|
22315
22310
|
__name: "QueuedBar",
|
|
22316
22311
|
setup(e) {
|
|
22317
22312
|
let { chat: t, editQueued: n } = ug(), { queuedTasks: r, removeQueuedTask: i } = t;
|
|
22318
|
-
return (e, t) => K(r).length ? (Y(), X("div",
|
|
22313
|
+
return (e, t) => K(r).length ? (Y(), X("div", xx, [Z("div", Sx, [
|
|
22319
22314
|
t[0] ||= Z("span", { class: "queued-icon" }, "📋", -1),
|
|
22320
22315
|
t[1] ||= Z("span", { class: "queued-title" }, "排队中 · 生成完后自动执行", -1),
|
|
22321
|
-
Z("span",
|
|
22316
|
+
Z("span", Cx, U(K(r).length), 1)
|
|
22322
22317
|
]), (Y(!0), X(J, null, ia(K(r), (e, t) => (Y(), X("div", {
|
|
22323
22318
|
key: t,
|
|
22324
22319
|
class: "queued-item"
|
|
22325
22320
|
}, [
|
|
22326
|
-
Z("span",
|
|
22327
|
-
Z("span",
|
|
22321
|
+
Z("span", wx, U(t + 1), 1),
|
|
22322
|
+
Z("span", Tx, U(e), 1),
|
|
22328
22323
|
Z("button", {
|
|
22329
22324
|
class: "queued-act",
|
|
22330
22325
|
title: "修改(填回输入框编辑)",
|
|
22331
22326
|
onClick: (e) => K(n)(t)
|
|
22332
|
-
}, "✏️", 8,
|
|
22327
|
+
}, "✏️", 8, Ex),
|
|
22333
22328
|
Z("button", {
|
|
22334
22329
|
class: "queued-act queued-del",
|
|
22335
22330
|
title: "撤销该任务",
|
|
22336
22331
|
onClick: (e) => K(i)(t)
|
|
22337
|
-
}, "✕", 8,
|
|
22332
|
+
}, "✕", 8, Dx)
|
|
22338
22333
|
]))), 128))])) : Q("", !0);
|
|
22339
22334
|
}
|
|
22340
|
-
}), [["__scopeId", "data-v-f32730a9"]]),
|
|
22335
|
+
}), [["__scopeId", "data-v-f32730a9"]]), kx = {
|
|
22341
22336
|
key: 0,
|
|
22342
22337
|
class: "approval-bar"
|
|
22343
|
-
},
|
|
22338
|
+
}, Ax = {
|
|
22344
22339
|
key: 0,
|
|
22345
22340
|
class: "approval-question"
|
|
22346
|
-
},
|
|
22341
|
+
}, jx = {
|
|
22347
22342
|
key: 1,
|
|
22348
22343
|
class: "approval-context"
|
|
22349
|
-
},
|
|
22344
|
+
}, Mx = {
|
|
22350
22345
|
key: 2,
|
|
22351
22346
|
class: "approval-recommend"
|
|
22352
|
-
},
|
|
22347
|
+
}, Nx = {
|
|
22353
22348
|
key: 3,
|
|
22354
22349
|
class: "approval-options"
|
|
22355
|
-
},
|
|
22350
|
+
}, Px = ["onClick"], Fx = { class: "approval-actions" }, Ix = { class: "approval-head" }, Lx = { class: "approval-title" }, Rx = {
|
|
22356
22351
|
key: 0,
|
|
22357
22352
|
class: "approval-args"
|
|
22358
|
-
},
|
|
22353
|
+
}, zx = { class: "approval-actions" }, Bx = /*#__PURE__*/ Cg(/* @__PURE__ */ Mi({
|
|
22359
22354
|
__name: "ApprovalBar",
|
|
22360
22355
|
setup(e) {
|
|
22361
22356
|
let { pendingApproval: t, resolveApproval: n } = ug().chat, r = /* @__PURE__ */ bn(!1);
|
|
@@ -22375,17 +22370,17 @@ app.mount('#app');
|
|
|
22375
22370
|
return String(e);
|
|
22376
22371
|
}
|
|
22377
22372
|
});
|
|
22378
|
-
return (e, s) => K(t) ? (Y(), X("div",
|
|
22373
|
+
return (e, s) => K(t) ? (Y(), X("div", kx, [i.value ? (Y(), X(J, { key: 0 }, [
|
|
22379
22374
|
s[5] ||= Z("div", { class: "approval-head" }, [Z("span", { class: "approval-icon" }, "❓"), Z("span", { class: "approval-title" }, "AI 需要你确认")], -1),
|
|
22380
|
-
K(t).args?.question ? (Y(), X("div",
|
|
22381
|
-
K(t).args?.context ? (Y(), X("div",
|
|
22382
|
-
K(t).args?.recommendation ? (Y(), X("div",
|
|
22383
|
-
a.value.length ? (Y(), X("div",
|
|
22375
|
+
K(t).args?.question ? (Y(), X("div", Ax, U(K(t).args.question), 1)) : Q("", !0),
|
|
22376
|
+
K(t).args?.context ? (Y(), X("div", jx, U(K(t).args.context), 1)) : Q("", !0),
|
|
22377
|
+
K(t).args?.recommendation ? (Y(), X("div", Mx, "💡 推荐:" + U(K(t).args.recommendation), 1)) : Q("", !0),
|
|
22378
|
+
a.value.length ? (Y(), X("div", Nx, [(Y(!0), X(J, null, ia(a.value, (e) => (Y(), X("button", {
|
|
22384
22379
|
key: e,
|
|
22385
22380
|
class: "approval-opt",
|
|
22386
22381
|
onClick: (t) => K(n)(e)
|
|
22387
|
-
}, U(e), 9,
|
|
22388
|
-
Z("div",
|
|
22382
|
+
}, U(e), 9, Px))), 128))])) : Q("", !0),
|
|
22383
|
+
Z("div", Fx, [Z("button", {
|
|
22389
22384
|
class: "approval-deny",
|
|
22390
22385
|
onClick: s[0] ||= (e) => K(n)(!1)
|
|
22391
22386
|
}, "拒绝"), a.value.length ? Q("", !0) : (Y(), X("button", {
|
|
@@ -22394,17 +22389,17 @@ app.mount('#app');
|
|
|
22394
22389
|
onClick: s[1] ||= (e) => K(n)(!0)
|
|
22395
22390
|
}, "允许"))])
|
|
22396
22391
|
], 64)) : (Y(), X(J, { key: 1 }, [
|
|
22397
|
-
Z("div",
|
|
22392
|
+
Z("div", Ix, [
|
|
22398
22393
|
s[7] ||= Z("span", { class: "approval-icon" }, "✋", -1),
|
|
22399
|
-
Z("span",
|
|
22394
|
+
Z("span", Lx, [s[6] ||= ms("需确认工具调用:", -1), Z("code", null, U(K(t).toolName), 1)]),
|
|
22400
22395
|
o.value ? (Y(), X("button", {
|
|
22401
22396
|
key: 0,
|
|
22402
22397
|
class: "approval-toggle",
|
|
22403
22398
|
onClick: s[2] ||= (e) => r.value = !r.value
|
|
22404
22399
|
}, U(r.value ? "收起参数" : "查看参数") + U(r.value ? " ▴" : " ▾"), 1)) : Q("", !0)
|
|
22405
22400
|
]),
|
|
22406
|
-
o.value && r.value ? (Y(), X("pre",
|
|
22407
|
-
Z("div",
|
|
22401
|
+
o.value && r.value ? (Y(), X("pre", Rx, U(o.value), 1)) : Q("", !0),
|
|
22402
|
+
Z("div", zx, [Z("button", {
|
|
22408
22403
|
class: "approval-deny",
|
|
22409
22404
|
onClick: s[3] ||= (e) => K(n)(!1)
|
|
22410
22405
|
}, "拒绝"), Z("button", {
|
|
@@ -22413,13 +22408,13 @@ app.mount('#app');
|
|
|
22413
22408
|
}, "允许")])
|
|
22414
22409
|
], 64))])) : Q("", !0);
|
|
22415
22410
|
}
|
|
22416
|
-
}), [["__scopeId", "data-v-296a936f"]]),
|
|
22411
|
+
}), [["__scopeId", "data-v-296a936f"]]), Vx = {
|
|
22417
22412
|
key: 0,
|
|
22418
22413
|
class: "conflict-bar"
|
|
22419
|
-
},
|
|
22414
|
+
}, Hx = { class: "conflict-head" }, Ux = { class: "conflict-title" }, Wx = { class: "conflict-detail" }, Gx = {
|
|
22420
22415
|
key: 0,
|
|
22421
22416
|
class: "conflict-diff"
|
|
22422
|
-
},
|
|
22417
|
+
}, Kx = { class: "conflict-diff-col" }, qx = { class: "conflict-diff-pre" }, Jx = { class: "conflict-diff-col" }, Yx = { class: "conflict-diff-pre" }, Xx = { class: "conflict-actions" }, Zx = /*#__PURE__*/ Cg(/* @__PURE__ */ Mi({
|
|
22423
22418
|
__name: "ConflictBar",
|
|
22424
22419
|
props: {
|
|
22425
22420
|
pendingConflict: {},
|
|
@@ -22449,19 +22444,19 @@ app.mount('#app');
|
|
|
22449
22444
|
return String(e);
|
|
22450
22445
|
}
|
|
22451
22446
|
});
|
|
22452
|
-
return (t, a) => e.pendingConflict ? (Y(), X("div",
|
|
22453
|
-
Z("div",
|
|
22447
|
+
return (t, a) => e.pendingConflict ? (Y(), X("div", Vx, [
|
|
22448
|
+
Z("div", Hx, [a[6] ||= Z("span", { class: "conflict-icon" }, "⚠️", -1), Z("span", Ux, [
|
|
22454
22449
|
a[4] ||= ms("写入冲突:", -1),
|
|
22455
22450
|
Z("code", null, U(e.pendingConflict.path), 1),
|
|
22456
22451
|
a[5] ||= ms(" 已被外部修改", -1)
|
|
22457
22452
|
])]),
|
|
22458
|
-
Z("div",
|
|
22453
|
+
Z("div", Wx, " AI 基于「读取时的旧值」准备" + U(e.pendingConflict.op === "delete" ? "删除" : "写入") + ",但该属性在你读取之后被外部代码/其他 agent/手动改过。 ", 1),
|
|
22459
22454
|
Z("button", {
|
|
22460
22455
|
class: "conflict-toggle",
|
|
22461
22456
|
onClick: a[0] ||= (e) => n.value = !n.value
|
|
22462
22457
|
}, U(n.value ? "收起对比" : "查看值对比") + U(n.value ? " ▴" : " ▾"), 1),
|
|
22463
|
-
n.value ? (Y(), X("div",
|
|
22464
|
-
Z("div",
|
|
22458
|
+
n.value ? (Y(), X("div", Gx, [Z("div", Kx, [a[7] ||= Z("div", { class: "conflict-diff-label" }, "AI 想写的值", -1), Z("pre", qx, U(r.value || "(delete 操作无值)"), 1)]), Z("div", Jx, [a[8] ||= Z("div", { class: "conflict-diff-label" }, "外部改后的当前值", -1), Z("pre", Yx, U(i.value), 1)])])) : Q("", !0),
|
|
22459
|
+
Z("div", Xx, [
|
|
22465
22460
|
Z("button", {
|
|
22466
22461
|
class: "conflict-keep",
|
|
22467
22462
|
onClick: a[1] ||= (t) => e.onResolve?.("keep_external"),
|
|
@@ -22480,16 +22475,16 @@ app.mount('#app');
|
|
|
22480
22475
|
])
|
|
22481
22476
|
])) : Q("", !0);
|
|
22482
22477
|
}
|
|
22483
|
-
}), [["__scopeId", "data-v-195e5b23"]]),
|
|
22478
|
+
}), [["__scopeId", "data-v-195e5b23"]]), Qx = { class: "chat-footer" }, $x = { class: "chat-input-wrap" }, eS = {
|
|
22484
22479
|
key: 0,
|
|
22485
22480
|
class: "focus-chips"
|
|
22486
|
-
},
|
|
22481
|
+
}, tS = ["title", "onClick"], nS = { class: "focus-chip-path" }, rS = ["onClick"], iS = ["placeholder", "rows"], aS = { class: "input-actions" }, oS = ["disabled", "title"], sS = {
|
|
22487
22482
|
key: 0,
|
|
22488
22483
|
width: "16",
|
|
22489
22484
|
height: "16",
|
|
22490
22485
|
viewBox: "0 0 24 24",
|
|
22491
22486
|
fill: "currentColor"
|
|
22492
|
-
},
|
|
22487
|
+
}, cS = {
|
|
22493
22488
|
key: 1,
|
|
22494
22489
|
width: "18",
|
|
22495
22490
|
height: "18",
|
|
@@ -22497,7 +22492,7 @@ app.mount('#app');
|
|
|
22497
22492
|
fill: "none",
|
|
22498
22493
|
stroke: "currentColor",
|
|
22499
22494
|
"stroke-width": "2"
|
|
22500
|
-
},
|
|
22495
|
+
}, lS = /*#__PURE__*/ Cg(/* @__PURE__ */ Mi({
|
|
22501
22496
|
__name: "ChatInput",
|
|
22502
22497
|
props: {
|
|
22503
22498
|
placeholder: {},
|
|
@@ -22505,242 +22500,243 @@ app.mount('#app');
|
|
|
22505
22500
|
},
|
|
22506
22501
|
setup(e) {
|
|
22507
22502
|
let t = ug(), { inputText: n, send: r, keydown: i, canUndo: a, undo: o, focuses: s, removeFocus: c, focusChipClick: l } = t, { state: u, stop: d } = t.chat;
|
|
22508
|
-
return (t, f) => (Y(), X("div",
|
|
22503
|
+
return (t, f) => (Y(), X("div", Qx, [K(a) ? (Y(), X("button", {
|
|
22509
22504
|
key: 0,
|
|
22510
22505
|
class: "undo-foot-btn",
|
|
22511
22506
|
title: "回退到上次正常状态(还原对话历史 + 页面属性 + 工作区)",
|
|
22512
22507
|
onClick: f[0] ||= (...e) => K(o) && K(o)(...e)
|
|
22513
|
-
}, "↩ 回退")) : Q("", !0), Z("div",
|
|
22514
|
-
K(s).length ? (Y(), X("div",
|
|
22508
|
+
}, "↩ 回退")) : Q("", !0), Z("div", $x, [
|
|
22509
|
+
K(s).length ? (Y(), X("div", eS, [(Y(!0), X(J, null, ia(K(s), (e) => (Y(), X("span", {
|
|
22515
22510
|
key: e.path,
|
|
22516
22511
|
class: "focus-chip",
|
|
22517
22512
|
title: `精修中:${e.path}(点击回看 · ✕ 移除)`,
|
|
22518
22513
|
onClick: (t) => K(l)(e)
|
|
22519
22514
|
}, [
|
|
22520
22515
|
f[4] ||= Z("span", { class: "focus-chip-icon" }, "🎯", -1),
|
|
22521
|
-
Z("code",
|
|
22516
|
+
Z("code", nS, U(e.path), 1),
|
|
22522
22517
|
Z("button", {
|
|
22523
22518
|
type: "button",
|
|
22524
22519
|
class: "focus-chip-x",
|
|
22525
22520
|
"data-test": "focus-clear",
|
|
22526
22521
|
title: "移除此焦点",
|
|
22527
22522
|
onClick: gl((t) => K(c)(e.path), ["stop"])
|
|
22528
|
-
}, "✕", 8,
|
|
22529
|
-
], 8,
|
|
22523
|
+
}, "✕", 8, rS)
|
|
22524
|
+
], 8, tS))), 128))])) : Q("", !0),
|
|
22530
22525
|
qr(Z("textarea", {
|
|
22531
22526
|
"onUpdate:modelValue": f[1] ||= (e) => /* @__PURE__ */ yn(n) ? n.value = e : null,
|
|
22532
22527
|
class: H(["chat-input", { "has-focus-chip": K(s).length > 0 }]),
|
|
22533
22528
|
placeholder: e.placeholder,
|
|
22534
22529
|
rows: e.inputRows,
|
|
22535
22530
|
onKeydown: f[2] ||= (...e) => K(i) && K(i)(...e)
|
|
22536
|
-
}, null, 42,
|
|
22537
|
-
Z("div",
|
|
22531
|
+
}, null, 42, iS), [[pl, K(n)]]),
|
|
22532
|
+
Z("div", aS, [f[7] ||= Z("span", { class: "send-hint" }, "Enter 发送 · Shift+Enter 换行", -1), Z("button", {
|
|
22538
22533
|
class: H(["send-btn", { "stop-btn": K(u).loading }]),
|
|
22539
22534
|
disabled: !K(u).loading && !K(n).trim(),
|
|
22540
22535
|
title: K(u).loading ? "停止生成" : "发送",
|
|
22541
22536
|
onClick: f[3] ||= (e) => K(u).loading ? K(d)() : K(r)()
|
|
22542
|
-
}, [K(u).loading ? (Y(), X("svg",
|
|
22537
|
+
}, [K(u).loading ? (Y(), X("svg", sS, [...f[5] ||= [Z("rect", {
|
|
22543
22538
|
x: "6",
|
|
22544
22539
|
y: "6",
|
|
22545
22540
|
width: "12",
|
|
22546
22541
|
height: "12",
|
|
22547
22542
|
rx: "2"
|
|
22548
|
-
}, null, -1)]])) : (Y(), X("svg",
|
|
22543
|
+
}, null, -1)]])) : (Y(), X("svg", cS, [...f[6] ||= [Z("line", {
|
|
22549
22544
|
x1: "22",
|
|
22550
22545
|
y1: "2",
|
|
22551
22546
|
x2: "11",
|
|
22552
22547
|
y2: "13"
|
|
22553
|
-
}, null, -1), Z("polygon", { points: "22 2 15 22 11 13 2 9 22 2" }, null, -1)]]))], 10,
|
|
22548
|
+
}, null, -1), Z("polygon", { points: "22 2 15 22 11 13 2 9 22 2" }, null, -1)]]))], 10, oS)])
|
|
22554
22549
|
])]));
|
|
22555
22550
|
}
|
|
22556
|
-
}), [["__scopeId", "data-v-
|
|
22551
|
+
}), [["__scopeId", "data-v-a9087737"]]), uS = {
|
|
22557
22552
|
key: 0,
|
|
22558
22553
|
class: "debug-drawer"
|
|
22559
|
-
},
|
|
22554
|
+
}, dS = { class: "drawer-header" }, fS = { class: "tab-group" }, pS = { class: "header-actions" }, mS = {
|
|
22560
22555
|
key: 0,
|
|
22561
22556
|
class: "drawer-filters"
|
|
22562
|
-
},
|
|
22557
|
+
}, hS = ["onClick"], gS = { class: "chip-count" }, _S = { class: "chip-count" }, vS = { class: "drawer-body" }, yS = {
|
|
22563
22558
|
key: 0,
|
|
22564
22559
|
class: "trace-panel"
|
|
22565
|
-
},
|
|
22560
|
+
}, bS = {
|
|
22566
22561
|
key: 0,
|
|
22567
22562
|
class: "trace-empty"
|
|
22568
|
-
},
|
|
22563
|
+
}, xS = { class: "trace-metrics" }, SS = { class: "metric-card" }, CS = { class: "metric-card" }, wS = { class: "metric-card" }, TS = { class: "metric-card" }, ES = {
|
|
22569
22564
|
key: 0,
|
|
22570
22565
|
class: "metric-card"
|
|
22571
|
-
},
|
|
22566
|
+
}, DS = {
|
|
22572
22567
|
key: 1,
|
|
22573
22568
|
class: "metric-card"
|
|
22574
|
-
},
|
|
22569
|
+
}, OS = { class: "trace-spans" }, kS = { class: "span-ico" }, AS = { class: "span-name" }, jS = {
|
|
22575
22570
|
key: 0,
|
|
22576
22571
|
class: "span-dur"
|
|
22577
|
-
},
|
|
22572
|
+
}, MS = {
|
|
22578
22573
|
key: 1,
|
|
22579
22574
|
class: "span-status"
|
|
22580
|
-
},
|
|
22575
|
+
}, NS = {
|
|
22581
22576
|
key: 1,
|
|
22582
22577
|
class: "context-panel"
|
|
22583
|
-
},
|
|
22578
|
+
}, PS = {
|
|
22584
22579
|
key: 0,
|
|
22585
22580
|
class: "trace-empty"
|
|
22586
|
-
},
|
|
22581
|
+
}, FS = { class: "ctx-overview" }, IS = { class: "ctx-occupancy" }, LS = ["title"], RS = { class: "ctx-pct" }, zS = { class: "ctx-kv-row" }, BS = { class: "ctx-kv" }, VS = {
|
|
22587
22582
|
key: 0,
|
|
22588
22583
|
class: "ctx-kv"
|
|
22589
|
-
},
|
|
22584
|
+
}, HS = {
|
|
22590
22585
|
key: 1,
|
|
22591
22586
|
class: "ctx-kv"
|
|
22592
|
-
},
|
|
22587
|
+
}, US = ["title"], WS = { class: "ctx-cat-bar" }, GS = { class: "ctx-cat-tokens" }, KS = {
|
|
22593
22588
|
key: 0,
|
|
22594
22589
|
class: "ctx-compression"
|
|
22595
|
-
},
|
|
22590
|
+
}, qS = { class: "ctx-kv-row" }, JS = { class: "ctx-kv" }, YS = { class: "ctx-kv" }, XS = { class: "ctx-kv" }, ZS = {
|
|
22596
22591
|
key: 0,
|
|
22597
22592
|
class: "ctx-kv"
|
|
22598
|
-
},
|
|
22593
|
+
}, QS = {
|
|
22599
22594
|
key: 2,
|
|
22600
22595
|
class: "subagent-panel"
|
|
22601
|
-
},
|
|
22596
|
+
}, $S = {
|
|
22602
22597
|
key: 0,
|
|
22603
22598
|
class: "trace-empty"
|
|
22604
|
-
},
|
|
22599
|
+
}, eC = {
|
|
22605
22600
|
key: 0,
|
|
22606
22601
|
class: "sub-section"
|
|
22607
|
-
},
|
|
22602
|
+
}, tC = { class: "sub-section-title" }, nC = { class: "sub-head" }, rC = { class: "sub-label" }, iC = { class: "sub-steps-badge" }, aC = { class: "sub-task" }, oC = {
|
|
22608
22603
|
key: 1,
|
|
22609
22604
|
class: "sub-section"
|
|
22610
|
-
},
|
|
22605
|
+
}, sC = { class: "sub-section-title" }, cC = { class: "sub-head" }, lC = { class: "sub-label" }, uC = {
|
|
22611
22606
|
key: 0,
|
|
22612
22607
|
class: "sub-dur"
|
|
22613
|
-
},
|
|
22608
|
+
}, dC = ["onClick"], fC = { class: "sub-task" }, pC = {
|
|
22614
22609
|
key: 0,
|
|
22615
22610
|
class: "sub-result"
|
|
22616
|
-
},
|
|
22611
|
+
}, mC = {
|
|
22617
22612
|
key: 1,
|
|
22618
22613
|
class: "sub-steps-list"
|
|
22619
|
-
},
|
|
22614
|
+
}, hC = { class: "sub-step-kind" }, gC = { class: "sub-step-name" }, _C = { class: "sub-step-ts" }, vC = {
|
|
22620
22615
|
key: 0,
|
|
22621
22616
|
class: "empty"
|
|
22622
|
-
},
|
|
22617
|
+
}, yC = { class: "log-head" }, bC = {
|
|
22623
22618
|
key: 0,
|
|
22624
22619
|
class: "log-source"
|
|
22625
|
-
},
|
|
22620
|
+
}, xC = { class: "log-time" }, SC = { class: "log-body" }, CC = { class: "kv-grid" }, wC = { class: "kv" }, TC = { class: "v" }, EC = { class: "kv" }, DC = { class: "v" }, OC = { class: "kv" }, kC = { class: "v" }, AC = { class: "kv" }, jC = { class: "v" }, MC = { class: "section-label" }, NC = { class: "chip-row" }, PC = { class: "msg-list" }, FC = { class: "msg-text" }, IC = { class: "badge-row" }, LC = { class: "badge" }, RC = {
|
|
22626
22621
|
key: 0,
|
|
22627
22622
|
class: "badge muted"
|
|
22628
|
-
},
|
|
22623
|
+
}, zC = { class: "badge muted" }, BC = {
|
|
22629
22624
|
key: 1,
|
|
22630
22625
|
class: "badge muted"
|
|
22631
|
-
},
|
|
22626
|
+
}, VC = ["onClick"], HC = {
|
|
22632
22627
|
key: 0,
|
|
22633
22628
|
class: "msg-list"
|
|
22634
|
-
},
|
|
22629
|
+
}, UC = { class: "msg-detail" }, WC = {
|
|
22635
22630
|
key: 0,
|
|
22636
22631
|
class: "msg-text"
|
|
22637
|
-
},
|
|
22632
|
+
}, GC = { class: "tc-inline-name" }, KC = { class: "tc-inline-args" }, qC = {
|
|
22638
22633
|
key: 1,
|
|
22639
22634
|
class: "tc-id"
|
|
22640
|
-
},
|
|
22635
|
+
}, JC = {
|
|
22641
22636
|
key: 1,
|
|
22642
22637
|
class: "log-raw"
|
|
22643
|
-
},
|
|
22638
|
+
}, YC = { class: "badge-row" }, XC = { class: "badge" }, ZC = {
|
|
22644
22639
|
key: 0,
|
|
22645
22640
|
class: "badge warn"
|
|
22646
|
-
},
|
|
22641
|
+
}, QC = {
|
|
22647
22642
|
key: 0,
|
|
22648
22643
|
class: "resp-content"
|
|
22649
|
-
},
|
|
22644
|
+
}, $C = {
|
|
22650
22645
|
key: 1,
|
|
22651
22646
|
class: "tc-list"
|
|
22652
|
-
},
|
|
22647
|
+
}, ew = { class: "tc-name" }, tw = { class: "tc-args" }, nw = {
|
|
22653
22648
|
key: 2,
|
|
22654
22649
|
class: "usage-row"
|
|
22655
|
-
},
|
|
22650
|
+
}, rw = { class: "usage" }, iw = { class: "usage" }, aw = { class: "usage" }, ow = {
|
|
22656
22651
|
key: 3,
|
|
22657
22652
|
class: "tc-card inline"
|
|
22658
|
-
},
|
|
22653
|
+
}, sw = { class: "tc-name" }, cw = { class: "tc-args" }, lw = {
|
|
22659
22654
|
key: 4,
|
|
22660
22655
|
class: "tc-card inline"
|
|
22661
|
-
},
|
|
22656
|
+
}, uw = { class: "tc-name" }, dw = { class: "tc-args" }, fw = {
|
|
22662
22657
|
key: 5,
|
|
22663
22658
|
class: "err-box"
|
|
22664
|
-
},
|
|
22659
|
+
}, pw = { class: "log-footer" }, mw = ["onClick"], hw = ["onClick"], gw = {
|
|
22665
22660
|
key: 0,
|
|
22666
22661
|
class: "log-raw"
|
|
22667
|
-
},
|
|
22662
|
+
}, _w = {
|
|
22668
22663
|
key: 0,
|
|
22669
22664
|
class: "empty"
|
|
22670
|
-
},
|
|
22665
|
+
}, vw = {
|
|
22671
22666
|
key: 1,
|
|
22672
22667
|
class: "flow-section"
|
|
22673
|
-
},
|
|
22668
|
+
}, yw = { class: "flow-ico" }, bw = { class: "flow-label" }, xw = { class: "flow-detail" }, Sw = { class: "flow-time" }, Cw = { class: "flow-round-head" }, ww = { class: "flow-round-body" }, Tw = { class: "flow-ico" }, Ew = { class: "flow-label" }, Dw = { class: "flow-detail" }, Ow = { class: "flow-time" }, kw = {
|
|
22674
22669
|
key: 5,
|
|
22675
22670
|
class: "info-body"
|
|
22676
|
-
},
|
|
22671
|
+
}, Aw = {
|
|
22677
22672
|
key: 0,
|
|
22678
22673
|
class: "empty"
|
|
22679
|
-
},
|
|
22674
|
+
}, jw = { class: "info-section" }, Mw = { class: "kv-grid" }, Nw = { class: "kv" }, Pw = { class: "v" }, Fw = { class: "kv" }, Iw = { class: "v" }, Lw = { class: "kv" }, Rw = { class: "v" }, zw = { class: "kv" }, Bw = { class: "v" }, Vw = {
|
|
22680
22675
|
class: "kv",
|
|
22681
22676
|
style: { "margin-top": "6px" }
|
|
22682
|
-
},
|
|
22677
|
+
}, Hw = {
|
|
22683
22678
|
class: "v",
|
|
22684
22679
|
style: { "font-size": "11px" }
|
|
22685
|
-
},
|
|
22680
|
+
}, Uw = { class: "info-section" }, Ww = { class: "info-title" }, Gw = { class: "info-name" }, Kw = { class: "info-desc" }, qw = {
|
|
22686
22681
|
key: 0,
|
|
22687
22682
|
class: "info-section"
|
|
22688
|
-
},
|
|
22683
|
+
}, Jw = { class: "info-title" }, Yw = ["onClick"], Xw = { class: "info-desc" }, Zw = {
|
|
22689
22684
|
key: 0,
|
|
22690
22685
|
class: "skill-content"
|
|
22691
|
-
},
|
|
22686
|
+
}, Qw = {
|
|
22692
22687
|
key: 0,
|
|
22693
22688
|
class: "skill-loading"
|
|
22694
|
-
},
|
|
22689
|
+
}, $w = {
|
|
22695
22690
|
key: 1,
|
|
22696
22691
|
class: "skill-error"
|
|
22697
|
-
},
|
|
22692
|
+
}, eT = {
|
|
22698
22693
|
key: 2,
|
|
22699
22694
|
class: "skill-pre"
|
|
22700
|
-
},
|
|
22695
|
+
}, tT = {
|
|
22701
22696
|
key: 1,
|
|
22702
22697
|
class: "info-section"
|
|
22703
|
-
},
|
|
22698
|
+
}, nT = { class: "info-item" }, rT = { class: "info-name" }, iT = { class: "info-desc" }, aT = { class: "info-section" }, oT = { class: "kv-grid" }, sT = { class: "kv" }, cT = { class: "v" }, lT = { class: "kv" }, uT = { class: "v" }, dT = { class: "kv" }, fT = { class: "v" }, pT = { class: "kv" }, mT = {
|
|
22704
22699
|
class: "v",
|
|
22705
22700
|
style: { "font-size": "11px" }
|
|
22706
|
-
},
|
|
22701
|
+
}, hT = {
|
|
22707
22702
|
key: 2,
|
|
22708
22703
|
class: "info-section"
|
|
22709
|
-
},
|
|
22704
|
+
}, gT = { class: "info-title" }, _T = { class: "info-name" }, vT = { class: "src-tag mcp" }, yT = { class: "info-desc" }, bT = {
|
|
22710
22705
|
key: 3,
|
|
22711
22706
|
class: "info-section"
|
|
22712
|
-
},
|
|
22707
|
+
}, xT = { class: "kv-grid" }, ST = { class: "kv" }, CT = { class: "v" }, wT = { class: "kv" }, TT = { class: "v" }, ET = { class: "kv" }, DT = { class: "v" }, OT = {
|
|
22713
22708
|
key: 0,
|
|
22714
22709
|
class: "kv"
|
|
22715
|
-
},
|
|
22710
|
+
}, kT = {
|
|
22716
22711
|
class: "v",
|
|
22717
22712
|
style: { "font-size": "11px" }
|
|
22718
|
-
},
|
|
22713
|
+
}, AT = {
|
|
22719
22714
|
key: 4,
|
|
22720
22715
|
class: "info-section"
|
|
22721
|
-
},
|
|
22716
|
+
}, jT = { class: "info-title" }, MT = {
|
|
22722
22717
|
key: 5,
|
|
22723
22718
|
class: "info-section"
|
|
22724
|
-
},
|
|
22719
|
+
}, NT = { class: "info-pre" }, PT = {
|
|
22725
22720
|
key: 6,
|
|
22726
22721
|
class: "info-section"
|
|
22727
|
-
},
|
|
22722
|
+
}, FT = { class: "info-kv" }, IT = { class: "kv" }, LT = { class: "v" }, RT = { class: "kv" }, zT = { class: "v" }, BT = { class: "kv" }, VT = { class: "v" }, HT = { class: "kv" }, UT = { class: "v" }, WT = { class: "kv" }, GT = {
|
|
22728
22723
|
class: "v",
|
|
22729
22724
|
style: { "font-size": "11px" }
|
|
22730
|
-
},
|
|
22725
|
+
}, KT = {
|
|
22731
22726
|
key: 0,
|
|
22732
22727
|
class: "kv"
|
|
22733
|
-
},
|
|
22728
|
+
}, qT = {
|
|
22734
22729
|
class: "v",
|
|
22735
22730
|
style: { "font-size": "11px" }
|
|
22736
|
-
},
|
|
22731
|
+
}, JT = /*#__PURE__*/ Cg(/* @__PURE__ */ Mi({
|
|
22737
22732
|
__name: "DebugDrawer",
|
|
22738
22733
|
props: {
|
|
22739
22734
|
logs: { default: () => [] },
|
|
22740
22735
|
visible: { type: Boolean },
|
|
22741
22736
|
getInfo: {},
|
|
22742
22737
|
infoTick: {},
|
|
22743
|
-
getSkillContent: {}
|
|
22738
|
+
getSkillContent: {},
|
|
22739
|
+
csTheme: {}
|
|
22744
22740
|
},
|
|
22745
22741
|
emits: ["update:visible", "clear"],
|
|
22746
22742
|
setup(e, { emit: t }) {
|
|
@@ -22977,8 +22973,8 @@ app.mount('#app');
|
|
|
22977
22973
|
}
|
|
22978
22974
|
}
|
|
22979
22975
|
return (t, n) => (Y(), ns(mi, { to: "body" }, [ls(pc, { name: "drawer" }, {
|
|
22980
|
-
default: Gr(() => [e.visible ? (Y(), X("div",
|
|
22981
|
-
Z("div",
|
|
22976
|
+
default: Gr(() => [e.visible ? (Y(), X("div", uS, [Z("div", { class: H(["drawer-panel", { "cs-theme-dark": e.csTheme === "dark" }]) }, [
|
|
22977
|
+
Z("div", dS, [Z("div", fS, [
|
|
22982
22978
|
Z("button", {
|
|
22983
22979
|
class: H(["tab-btn", { active: y.value === "logs" }]),
|
|
22984
22980
|
onClick: n[0] ||= (e) => w("logs")
|
|
@@ -23007,7 +23003,7 @@ app.mount('#app');
|
|
|
23007
23003
|
class: H(["tab-btn", { active: y.value === "info" }]),
|
|
23008
23004
|
onClick: n[5] ||= (e) => w("info")
|
|
23009
23005
|
}, "🧬 Agent 信息", 2)) : Q("", !0)
|
|
23010
|
-
]), Z("div",
|
|
23006
|
+
]), Z("div", pS, [y.value === "logs" ? (Y(), X("button", {
|
|
23011
23007
|
key: 0,
|
|
23012
23008
|
class: "hd-btn",
|
|
23013
23009
|
title: "清空日志",
|
|
@@ -23017,38 +23013,38 @@ app.mount('#app');
|
|
|
23017
23013
|
title: "关闭",
|
|
23018
23014
|
onClick: _
|
|
23019
23015
|
}, "✕")])]),
|
|
23020
|
-
y.value === "logs" ? (Y(), X("div",
|
|
23016
|
+
y.value === "logs" ? (Y(), X("div", mS, [(Y(), X(J, null, ia(s, (e, t) => Z("button", {
|
|
23021
23017
|
key: t,
|
|
23022
23018
|
class: H(["filter-chip", { active: i.value === t }]),
|
|
23023
23019
|
style: Te({ "--chip-color": e.color }),
|
|
23024
23020
|
onClick: (e) => i.value = t
|
|
23025
|
-
}, [ms(U(e.icon) + " " + U(e.label) + " ", 1), Z("span",
|
|
23021
|
+
}, [ms(U(e.icon) + " " + U(e.label) + " ", 1), Z("span", gS, U(u.value[t] || 0), 1)], 14, hS)), 64)), Z("button", {
|
|
23026
23022
|
class: H(["filter-chip all", { active: i.value === "all" }]),
|
|
23027
23023
|
onClick: n[6] ||= (e) => i.value = "all"
|
|
23028
|
-
}, [n[7] ||= ms(" 全部 ", -1), Z("span",
|
|
23029
|
-
Z("div",
|
|
23030
|
-
y.value === "trace" ? (Y(), X("div",
|
|
23031
|
-
Z("div",
|
|
23032
|
-
Z("div",
|
|
23033
|
-
Z("div",
|
|
23034
|
-
Z("div",
|
|
23035
|
-
j.value.compressions ? (Y(), X("div",
|
|
23036
|
-
j.value.totalTokens ? (Y(), X("div",
|
|
23037
|
-
]), Z("div",
|
|
23024
|
+
}, [n[7] ||= ms(" 全部 ", -1), Z("span", _S, U(u.value.all || 0), 1)], 2)])) : Q("", !0),
|
|
23025
|
+
Z("div", vS, [
|
|
23026
|
+
y.value === "trace" ? (Y(), X("div", yS, [j.value ? (Y(), X(J, { key: 1 }, [Z("div", xS, [
|
|
23027
|
+
Z("div", SS, [n[9] ||= Z("span", null, "轮次", -1), Z("b", null, U(j.value.rounds), 1)]),
|
|
23028
|
+
Z("div", CS, [n[10] ||= Z("span", null, "总耗时", -1), Z("b", null, U(j.value.totalDurationMs) + "ms", 1)]),
|
|
23029
|
+
Z("div", wS, [n[11] ||= Z("span", null, "平均/轮", -1), Z("b", null, U(j.value.avgRoundMs) + "ms", 1)]),
|
|
23030
|
+
Z("div", TS, [n[12] ||= Z("span", null, "工具", -1), Z("b", null, U(j.value.toolCalls) + "(✅" + U(Math.round(j.value.toolSuccessRate * 100)) + "%)", 1)]),
|
|
23031
|
+
j.value.compressions ? (Y(), X("div", ES, [n[13] ||= Z("span", null, "压缩", -1), Z("b", null, U(j.value.compressions), 1)])) : Q("", !0),
|
|
23032
|
+
j.value.totalTokens ? (Y(), X("div", DS, [n[14] ||= Z("span", null, "Token", -1), Z("b", null, U(j.value.totalTokens.total), 1)])) : Q("", !0)
|
|
23033
|
+
]), Z("div", OS, [(Y(!0), X(J, null, ia(A.value, (e) => (Y(), X("div", {
|
|
23038
23034
|
key: e.id,
|
|
23039
23035
|
class: H(["trace-span", [e.type, e.status]])
|
|
23040
23036
|
}, [
|
|
23041
|
-
Z("span",
|
|
23042
|
-
Z("span",
|
|
23043
|
-
e.durationMs ? (Y(), X("span",
|
|
23044
|
-
e.status === "error" ? (Y(), X("span",
|
|
23045
|
-
], 2))), 128))])], 64)) : (Y(), X("div",
|
|
23037
|
+
Z("span", kS, U(ne(e.type)), 1),
|
|
23038
|
+
Z("span", AS, U(e.name), 1),
|
|
23039
|
+
e.durationMs ? (Y(), X("span", jS, U(e.durationMs) + "ms", 1)) : Q("", !0),
|
|
23040
|
+
e.status === "error" ? (Y(), X("span", MS, "❌")) : Q("", !0)
|
|
23041
|
+
], 2))), 128))])], 64)) : (Y(), X("div", bS, [...n[8] ||= [
|
|
23046
23042
|
ms("未开启 tracing(", -1),
|
|
23047
23043
|
Z("code", null, "capabilities.tracing:true", -1),
|
|
23048
23044
|
ms(")或暂无 trace。跑一轮 agent 后刷新。", -1)
|
|
23049
23045
|
]]))])) : Q("", !0),
|
|
23050
|
-
y.value === "context" ? (Y(), X("div",
|
|
23051
|
-
Z("div",
|
|
23046
|
+
y.value === "context" ? (Y(), X("div", NS, [M.value ? (Y(), X(J, { key: 1 }, [
|
|
23047
|
+
Z("div", FS, [Z("div", IS, [Z("div", {
|
|
23052
23048
|
class: "ctx-bar-track",
|
|
23053
23049
|
title: `占用 ${Math.round(M.value.occupancy * 100)}%`
|
|
23054
23050
|
}, [Z("div", {
|
|
@@ -23059,10 +23055,10 @@ app.mount('#app');
|
|
|
23059
23055
|
class: "ctx-threshold-mark",
|
|
23060
23056
|
style: Te({ left: Math.min(M.value.thresholdRatio * 100, 100) + "%" }),
|
|
23061
23057
|
title: "压缩阈值"
|
|
23062
|
-
}, null, 4)) : Q("", !0)], 8,
|
|
23063
|
-
Z("span",
|
|
23064
|
-
M.value.contextWindow ? (Y(), X("span",
|
|
23065
|
-
M.value.thresholdRatio > 0 ? (Y(), X("span",
|
|
23058
|
+
}, null, 4)) : Q("", !0)], 8, LS), Z("span", RS, U(Math.round(M.value.occupancy * 100)) + "%", 1)]), Z("div", zS, [
|
|
23059
|
+
Z("span", BS, "估算 " + U(M.value.totalTokens) + " token", 1),
|
|
23060
|
+
M.value.contextWindow ? (Y(), X("span", VS, "窗口 " + U(M.value.contextWindow), 1)) : Q("", !0),
|
|
23061
|
+
M.value.thresholdRatio > 0 ? (Y(), X("span", HS, "阈值 " + U(Math.round(M.value.thresholdRatio * 100)) + "%", 1)) : Q("", !0)
|
|
23066
23062
|
])]),
|
|
23067
23063
|
n[16] ||= Z("div", { class: "ctx-section-title" }, "分类构成(近似)", -1),
|
|
23068
23064
|
(Y(!0), X(J, null, ia(M.value.categories, (e) => (Y(), X("div", {
|
|
@@ -23072,243 +23068,243 @@ app.mount('#app');
|
|
|
23072
23068
|
Z("span", {
|
|
23073
23069
|
class: "ctx-cat-label",
|
|
23074
23070
|
title: e.label
|
|
23075
|
-
}, U(e.label), 9,
|
|
23076
|
-
Z("div",
|
|
23071
|
+
}, U(e.label), 9, US),
|
|
23072
|
+
Z("div", WS, [Z("div", {
|
|
23077
23073
|
class: "ctx-cat-fill",
|
|
23078
23074
|
style: Te({ width: Math.max(Math.round(e.pct * 100), 2) + "%" })
|
|
23079
23075
|
}, null, 4)]),
|
|
23080
|
-
Z("span",
|
|
23076
|
+
Z("span", GS, [ms(U(e.tokens) + " ", 1), Z("i", null, "(" + U(Math.round(e.pct * 100)) + "%)", 1)])
|
|
23081
23077
|
]))), 128)),
|
|
23082
|
-
M.value.compression ? (Y(), X("div",
|
|
23083
|
-
Z("span",
|
|
23084
|
-
Z("span",
|
|
23085
|
-
Z("span",
|
|
23086
|
-
M.value.compression.decision ? (Y(), X("span",
|
|
23078
|
+
M.value.compression ? (Y(), X("div", KS, [n[15] ||= Z("div", { class: "ctx-section-title" }, "最近压缩", -1), Z("div", qS, [
|
|
23079
|
+
Z("span", JS, "摘要 " + U(M.value.compression.roundsSummarized) + "/" + U(M.value.compression.roundsTotal) + " 轮", 1),
|
|
23080
|
+
Z("span", YS, "召回 " + U(M.value.compression.roundsRecalled), 1),
|
|
23081
|
+
Z("span", XS, U(M.value.compression.strategy), 1),
|
|
23082
|
+
M.value.compression.decision ? (Y(), X("span", ZS, "🤖 agent 决策:" + U(re(M.value.compression.decision)), 1)) : Q("", !0)
|
|
23087
23083
|
])])) : Q("", !0)
|
|
23088
|
-
], 64)) : (Y(), X("div",
|
|
23089
|
-
y.value === "subagent" ? (Y(), X("div",
|
|
23084
|
+
], 64)) : (Y(), X("div", PS, "未开启 contextInspector(默认开)或暂无快照。跑一轮 agent 后切回刷新。"))])) : Q("", !0),
|
|
23085
|
+
y.value === "subagent" ? (Y(), X("div", QS, [!P.value.length && !ee.value.length ? (Y(), X("div", $S, [...n[17] ||= [
|
|
23090
23086
|
ms(" 尚未委派子 agent。主 agent 调用 ", -1),
|
|
23091
23087
|
Z("code", null, "use_<id>", -1),
|
|
23092
23088
|
ms(" 或 ", -1),
|
|
23093
23089
|
Z("code", null, "spawn_agent", -1),
|
|
23094
23090
|
ms(" 后,这里展示运行状态与委派历史。 ", -1)
|
|
23095
|
-
]])) : (Y(), X(J, { key: 1 }, [P.value.length ? (Y(), X("div",
|
|
23091
|
+
]])) : (Y(), X(J, { key: 1 }, [P.value.length ? (Y(), X("div", eC, [Z("div", tC, "▶ 运行中 (" + U(P.value.length) + ")", 1), (Y(!0), X(J, null, ia(P.value, (e, t) => (Y(), X("div", {
|
|
23096
23092
|
key: "a" + t,
|
|
23097
23093
|
class: H(["sub-card", e.status])
|
|
23098
|
-
}, [Z("div",
|
|
23094
|
+
}, [Z("div", nC, [
|
|
23099
23095
|
Z("span", {
|
|
23100
23096
|
class: "sub-status",
|
|
23101
23097
|
style: Te({ background: F[e.status] && F[e.status].color || "#9ca3af" })
|
|
23102
23098
|
}, U(F[e.status] && F[e.status].label || e.status), 5),
|
|
23103
|
-
Z("span",
|
|
23104
|
-
Z("span",
|
|
23105
|
-
]), Z("div",
|
|
23099
|
+
Z("span", rC, U(e.label), 1),
|
|
23100
|
+
Z("span", iC, U(e.steps.length) + " 步", 1)
|
|
23101
|
+
]), Z("div", aC, U(k(e.task, 80)), 1)], 2))), 128))])) : Q("", !0), ee.value.length ? (Y(), X("div", oC, [Z("div", sC, "🕐 历史 (" + U(ee.value.length) + ")", 1), (Y(!0), X(J, null, ia(ee.value, (e, t) => (Y(), X("div", {
|
|
23106
23102
|
key: "h" + t,
|
|
23107
23103
|
class: H(["sub-card", e.status])
|
|
23108
23104
|
}, [
|
|
23109
|
-
Z("div",
|
|
23105
|
+
Z("div", cC, [
|
|
23110
23106
|
Z("span", {
|
|
23111
23107
|
class: "sub-status",
|
|
23112
23108
|
style: Te({ background: F[e.status] && F[e.status].color || "#9ca3af" })
|
|
23113
23109
|
}, U(F[e.status] && F[e.status].label || e.status), 5),
|
|
23114
|
-
Z("span",
|
|
23115
|
-
e.durationMs == null ? Q("", !0) : (Y(), X("span",
|
|
23110
|
+
Z("span", lC, U(e.label), 1),
|
|
23111
|
+
e.durationMs == null ? Q("", !0) : (Y(), X("span", uC, U(e.durationMs) + "ms", 1)),
|
|
23116
23112
|
e.steps.length ? (Y(), X("button", {
|
|
23117
23113
|
key: 1,
|
|
23118
23114
|
class: "sub-toggle",
|
|
23119
23115
|
onClick: (e) => te(t)
|
|
23120
|
-
}, U(I.value.has(t) ? "收起" : "步骤"), 9,
|
|
23116
|
+
}, U(I.value.has(t) ? "收起" : "步骤"), 9, dC)) : Q("", !0)
|
|
23121
23117
|
]),
|
|
23122
|
-
Z("div",
|
|
23123
|
-
e.resultPreview ? (Y(), X("div",
|
|
23124
|
-
I.value.has(t) && e.steps.length ? (Y(), X("div",
|
|
23118
|
+
Z("div", fC, U(k(e.task, 80)), 1),
|
|
23119
|
+
e.resultPreview ? (Y(), X("div", pC, U(e.resultPreview), 1)) : Q("", !0),
|
|
23120
|
+
I.value.has(t) && e.steps.length ? (Y(), X("div", mC, [(Y(!0), X(J, null, ia(e.steps, (e, t) => (Y(), X("div", {
|
|
23125
23121
|
key: t,
|
|
23126
23122
|
class: "sub-step"
|
|
23127
23123
|
}, [
|
|
23128
|
-
Z("span",
|
|
23129
|
-
Z("span",
|
|
23130
|
-
Z("span",
|
|
23124
|
+
Z("span", hC, U(e.kind === "tool_call" ? "🔧" : "✅"), 1),
|
|
23125
|
+
Z("span", gC, U(e.name), 1),
|
|
23126
|
+
Z("span", _C, U(d(e.ts)), 1)
|
|
23131
23127
|
]))), 128))])) : Q("", !0)
|
|
23132
23128
|
], 2))), 128))])) : Q("", !0)], 64))])) : Q("", !0),
|
|
23133
|
-
y.value === "logs" ? (Y(), X(J, { key: 3 }, [l.value.length === 0 ? (Y(), X("div",
|
|
23129
|
+
y.value === "logs" ? (Y(), X(J, { key: 3 }, [l.value.length === 0 ? (Y(), X("div", vC, " 暂无日志,发送消息后这里会显示 Agent 的完整上下文、工具调用等信息 ")) : Q("", !0), (Y(!0), X(J, null, ia(l.value, (e, t) => (Y(), X("div", {
|
|
23134
23130
|
key: t,
|
|
23135
23131
|
class: "log-item"
|
|
23136
23132
|
}, [
|
|
23137
|
-
Z("div",
|
|
23133
|
+
Z("div", yC, [
|
|
23138
23134
|
Z("span", {
|
|
23139
23135
|
class: "log-type",
|
|
23140
23136
|
style: Te({ background: s[e.type].color })
|
|
23141
23137
|
}, U(s[e.type].icon) + " " + U(s[e.type].label), 5),
|
|
23142
|
-
e.source ? (Y(), X("span",
|
|
23143
|
-
Z("span",
|
|
23138
|
+
e.source ? (Y(), X("span", bC, "↳ " + U(e.source), 1)) : Q("", !0),
|
|
23139
|
+
Z("span", xC, U(d(e.timestamp)), 1)
|
|
23144
23140
|
]),
|
|
23145
|
-
Z("div",
|
|
23146
|
-
Z("div",
|
|
23147
|
-
Z("div",
|
|
23148
|
-
Z("div",
|
|
23149
|
-
Z("div",
|
|
23150
|
-
Z("div",
|
|
23141
|
+
Z("div", SC, [e.type === "context" ? (Y(), X(J, { key: 0 }, [
|
|
23142
|
+
Z("div", CC, [
|
|
23143
|
+
Z("div", wC, [n[18] ||= Z("span", { class: "k" }, "模型", -1), Z("span", TC, U(e.data.model), 1)]),
|
|
23144
|
+
Z("div", EC, [n[19] ||= Z("span", { class: "k" }, "温度", -1), Z("span", DC, U(e.data.temperature), 1)]),
|
|
23145
|
+
Z("div", OC, [n[20] ||= Z("span", { class: "k" }, "MaxTokens", -1), Z("span", kC, U(e.data.maxTokens), 1)]),
|
|
23146
|
+
Z("div", AC, [n[21] ||= Z("span", { class: "k" }, "消息数", -1), Z("span", jC, U(e.data.totalMessages), 1)])
|
|
23151
23147
|
]),
|
|
23152
|
-
Z("div",
|
|
23153
|
-
Z("div",
|
|
23148
|
+
Z("div", MC, "工具 (" + U(e.data.tools?.length || 0) + ")", 1),
|
|
23149
|
+
Z("div", NC, [(Y(!0), X(J, null, ia(e.data.tools, (e) => (Y(), X("span", {
|
|
23154
23150
|
key: e,
|
|
23155
23151
|
class: "tool-chip"
|
|
23156
23152
|
}, U(e), 1))), 128))]),
|
|
23157
23153
|
n[22] ||= Z("div", { class: "section-label" }, "上下文消息", -1),
|
|
23158
|
-
Z("div",
|
|
23154
|
+
Z("div", PC, [(Y(!0), X(J, null, ia(e.data.messages, (e, t) => (Y(), X("div", {
|
|
23159
23155
|
key: t,
|
|
23160
23156
|
class: "msg-row"
|
|
23161
23157
|
}, [Z("span", {
|
|
23162
23158
|
class: "msg-role",
|
|
23163
23159
|
style: Te({ background: g(e.type).color })
|
|
23164
|
-
}, U(g(e.type).label), 5), Z("span",
|
|
23165
|
-
], 64)) : e.type === "llm_request" ? (Y(), X(J, { key: 1 }, [Z("div",
|
|
23166
|
-
Z("span",
|
|
23167
|
-
e.data.model ? (Y(), X("span",
|
|
23168
|
-
Z("span",
|
|
23169
|
-
e.data.tools?.length ? (Y(), X("span",
|
|
23160
|
+
}, U(g(e.type).label), 5), Z("span", FC, U(e.content), 1)]))), 128))])
|
|
23161
|
+
], 64)) : e.type === "llm_request" ? (Y(), X(J, { key: 1 }, [Z("div", IC, [
|
|
23162
|
+
Z("span", LC, "第 " + U(e.data.round) + " 轮", 1),
|
|
23163
|
+
e.data.model ? (Y(), X("span", RC, U(e.data.model), 1)) : Q("", !0),
|
|
23164
|
+
Z("span", zC, U((e.data.messages || []).length) + " 条消息", 1),
|
|
23165
|
+
e.data.tools?.length ? (Y(), X("span", BC, U(e.data.tools.length) + " 工具", 1)) : Q("", !0),
|
|
23170
23166
|
Z("button", {
|
|
23171
23167
|
class: "view-toggle",
|
|
23172
23168
|
onClick: (e) => p(t)
|
|
23173
|
-
}, U(o.value.has(t) ? "🗂 卡片视图" : "📋 请求体"), 9,
|
|
23174
|
-
]), o.value.has(t) ? (Y(), X("pre",
|
|
23169
|
+
}, U(o.value.has(t) ? "🗂 卡片视图" : "📋 请求体"), 9, VC)
|
|
23170
|
+
]), o.value.has(t) ? (Y(), X("pre", JC, [Z("code", null, U(m(e.data.messages)), 1)])) : (Y(), X("div", HC, [(Y(!0), X(J, null, ia(e.data.messages, (e, t) => (Y(), X("div", {
|
|
23175
23171
|
key: t,
|
|
23176
23172
|
class: "msg-row"
|
|
23177
23173
|
}, [Z("span", {
|
|
23178
23174
|
class: "msg-role",
|
|
23179
23175
|
style: Te({ background: g(e.role).color })
|
|
23180
|
-
}, U(g(e.role).label), 5), Z("div",
|
|
23181
|
-
e.content ? (Y(), X("span",
|
|
23176
|
+
}, U(g(e.role).label), 5), Z("div", UC, [
|
|
23177
|
+
e.content ? (Y(), X("span", WC, U(e.content), 1)) : Q("", !0),
|
|
23182
23178
|
(Y(!0), X(J, null, ia(e.tool_calls || [], (e, t) => (Y(), X("div", {
|
|
23183
23179
|
key: t,
|
|
23184
23180
|
class: "tc-inline"
|
|
23185
|
-
}, [Z("span",
|
|
23186
|
-
e.tool_call_id ? (Y(), X("span",
|
|
23181
|
+
}, [Z("span", GC, "🔧 " + U(e.function?.name || e.name), 1), Z("code", KC, U(e.function?.arguments ?? e.args), 1)]))), 128)),
|
|
23182
|
+
e.tool_call_id ? (Y(), X("span", qC, "↳ tool_call_id: " + U(e.tool_call_id), 1)) : Q("", !0)
|
|
23187
23183
|
])]))), 128))]))], 64)) : e.type === "llm_response" ? (Y(), X(J, { key: 2 }, [
|
|
23188
|
-
Z("div",
|
|
23189
|
-
e.data.content ? (Y(), X("div",
|
|
23190
|
-
e.data.toolCalls?.length ? (Y(), X("div",
|
|
23184
|
+
Z("div", YC, [Z("span", XC, "第 " + U(e.data.round) + " 轮", 1), e.data.toolCalls?.length ? (Y(), X("span", ZC, "🔧 " + U(e.data.toolCalls.length) + " 个工具调用", 1)) : Q("", !0)]),
|
|
23185
|
+
e.data.content ? (Y(), X("div", QC, U(e.data.content), 1)) : Q("", !0),
|
|
23186
|
+
e.data.toolCalls?.length ? (Y(), X("div", $C, [(Y(!0), X(J, null, ia(e.data.toolCalls, (e, t) => (Y(), X("div", {
|
|
23191
23187
|
key: t,
|
|
23192
23188
|
class: "tc-card"
|
|
23193
|
-
}, [Z("div",
|
|
23194
|
-
e.data.usage ? (Y(), X("div",
|
|
23195
|
-
Z("span",
|
|
23196
|
-
Z("span",
|
|
23197
|
-
Z("span",
|
|
23189
|
+
}, [Z("div", ew, "🔧 " + U(e.name), 1), Z("pre", tw, U(m(e.args)), 1)]))), 128))])) : Q("", !0),
|
|
23190
|
+
e.data.usage ? (Y(), X("div", nw, [
|
|
23191
|
+
Z("span", rw, "prompt: " + U(e.data.usage.prompt_tokens ?? "-"), 1),
|
|
23192
|
+
Z("span", iw, "completion: " + U(e.data.usage.completion_tokens ?? "-"), 1),
|
|
23193
|
+
Z("span", aw, "total: " + U(e.data.usage.total_tokens ?? "-"), 1)
|
|
23198
23194
|
])) : Q("", !0)
|
|
23199
|
-
], 64)) : e.type === "tool_call" ? (Y(), X("div",
|
|
23200
|
-
Z("div",
|
|
23195
|
+
], 64)) : e.type === "tool_call" ? (Y(), X("div", ow, [Z("div", sw, "🔧 " + U(e.data.name), 1), Z("pre", cw, U(m(e.data.args)), 1)])) : e.type === "tool_result" ? (Y(), X("div", lw, [Z("div", uw, "✅ " + U(e.data.name) + " 结果", 1), Z("pre", dw, U(e.data.result), 1)])) : e.type === "error" ? (Y(), X("div", fw, U(e.data.tool ? `[${e.data.tool}] ` : "") + U(e.data.error), 1)) : Q("", !0)]),
|
|
23196
|
+
Z("div", pw, [Z("button", {
|
|
23201
23197
|
class: "raw-toggle",
|
|
23202
23198
|
onClick: (e) => f(t)
|
|
23203
|
-
}, U(a.value.has(t) ? "收起原始 JSON" : "查看原始 JSON"), 9,
|
|
23199
|
+
}, U(a.value.has(t) ? "收起原始 JSON" : "查看原始 JSON"), 9, mw), Z("button", {
|
|
23204
23200
|
class: "raw-toggle",
|
|
23205
23201
|
onClick: (t) => K(sg)(m(e.data))
|
|
23206
|
-
}, "复制", 8,
|
|
23207
|
-
a.value.has(t) ? (Y(), X("pre",
|
|
23202
|
+
}, "复制", 8, hw)]),
|
|
23203
|
+
a.value.has(t) ? (Y(), X("pre", gw, [Z("code", null, U(m(e.data)), 1)])) : Q("", !0)
|
|
23208
23204
|
]))), 128))], 64)) : y.value === "flow" ? (Y(), X(J, { key: 4 }, [
|
|
23209
|
-
c.value.length ? Q("", !0) : (Y(), X("div",
|
|
23210
|
-
O.value.pre.length ? (Y(), X("div",
|
|
23205
|
+
c.value.length ? Q("", !0) : (Y(), X("div", _w, "暂无日志,发送消息后这里按轮次展示执行流程")),
|
|
23206
|
+
O.value.pre.length ? (Y(), X("div", vw, [n[23] ||= Z("div", { class: "flow-section-title" }, "⚙️ 准备 / 其他", -1), (Y(!0), X(J, null, ia(O.value.pre, (e, t) => (Y(), X("div", {
|
|
23211
23207
|
key: "p" + t,
|
|
23212
23208
|
class: H(["flow-node", e.type])
|
|
23213
23209
|
}, [
|
|
23214
|
-
Z("span",
|
|
23215
|
-
Z("span",
|
|
23216
|
-
Z("span",
|
|
23217
|
-
Z("span",
|
|
23210
|
+
Z("span", yw, U(s[e.type]?.icon), 1),
|
|
23211
|
+
Z("span", bw, U(s[e.type]?.label), 1),
|
|
23212
|
+
Z("span", xw, U(L(e)), 1),
|
|
23213
|
+
Z("span", Sw, U(d(e.timestamp)), 1)
|
|
23218
23214
|
], 2))), 128))])) : Q("", !0),
|
|
23219
23215
|
(Y(!0), X(J, null, ia(O.value.rounds, (e) => (Y(), X("div", {
|
|
23220
23216
|
key: e.round,
|
|
23221
23217
|
class: "flow-round"
|
|
23222
|
-
}, [Z("div",
|
|
23218
|
+
}, [Z("div", Cw, "🔁 第 " + U(e.round) + " 轮", 1), Z("div", ww, [(Y(!0), X(J, null, ia(e.items, (e, t) => (Y(), X("div", {
|
|
23223
23219
|
key: t,
|
|
23224
23220
|
class: H(["flow-node", e.type])
|
|
23225
23221
|
}, [
|
|
23226
|
-
Z("span",
|
|
23227
|
-
Z("span",
|
|
23228
|
-
Z("span",
|
|
23229
|
-
Z("span",
|
|
23222
|
+
Z("span", Tw, U(s[e.type]?.icon), 1),
|
|
23223
|
+
Z("span", Ew, U(s[e.type]?.label), 1),
|
|
23224
|
+
Z("span", Dw, U(L(e)), 1),
|
|
23225
|
+
Z("span", Ow, U(d(e.timestamp)), 1)
|
|
23230
23226
|
], 2))), 128))])]))), 128))
|
|
23231
|
-
], 64)) : (Y(), X("div",
|
|
23232
|
-
Z("div",
|
|
23227
|
+
], 64)) : (Y(), X("div", kw, [b.value ? (Y(), X(J, { key: 1 }, [
|
|
23228
|
+
Z("div", jw, [
|
|
23233
23229
|
n[29] ||= Z("div", { class: "info-title" }, "基本信息", -1),
|
|
23234
|
-
Z("div",
|
|
23235
|
-
Z("div",
|
|
23236
|
-
Z("div",
|
|
23237
|
-
Z("div",
|
|
23238
|
-
Z("div",
|
|
23230
|
+
Z("div", Mw, [
|
|
23231
|
+
Z("div", Nw, [n[24] ||= Z("span", { class: "k" }, "ID", -1), Z("span", Pw, U(b.value.id), 1)]),
|
|
23232
|
+
Z("div", Fw, [n[25] ||= Z("span", { class: "k" }, "模型", -1), Z("span", Iw, U(b.value.model || "-"), 1)]),
|
|
23233
|
+
Z("div", Lw, [n[26] ||= Z("span", { class: "k" }, "工具数", -1), Z("span", Rw, U(b.value.tools.length), 1)]),
|
|
23234
|
+
Z("div", zw, [n[27] ||= Z("span", { class: "k" }, "中间件", -1), Z("span", Bw, U(b.value.middleware.length), 1)])
|
|
23239
23235
|
]),
|
|
23240
|
-
Z("div",
|
|
23236
|
+
Z("div", Vw, [n[28] ||= Z("span", { class: "k" }, "中间件栈", -1), Z("span", Hw, U(b.value.middleware.join(" → ") || "-"), 1)])
|
|
23241
23237
|
]),
|
|
23242
|
-
Z("div",
|
|
23238
|
+
Z("div", Uw, [Z("div", Ww, "🔧 工具 (" + U(b.value.tools.length) + ")", 1), (Y(!0), X(J, null, ia(b.value.tools, (e) => (Y(), X("div", {
|
|
23243
23239
|
key: e.name,
|
|
23244
23240
|
class: "info-item"
|
|
23245
|
-
}, [Z("div",
|
|
23241
|
+
}, [Z("div", Gw, [ms(U(e.name), 1), e.source ? (Y(), X("span", {
|
|
23246
23242
|
key: 0,
|
|
23247
23243
|
class: H(["src-tag", D(e.source)])
|
|
23248
|
-
}, U(e.source), 3)) : Q("", !0)]), Z("div",
|
|
23249
|
-
b.value.skills.length ? (Y(), X("div",
|
|
23244
|
+
}, U(e.source), 3)) : Q("", !0)]), Z("div", Kw, U(e.description), 1)]))), 128))]),
|
|
23245
|
+
b.value.skills.length ? (Y(), X("div", qw, [Z("div", Jw, [ms("📘 技能 (" + U(b.value.skills.length) + ")", 1), n[30] ||= Z("span", { class: "info-hint" }, "点击展开查看全文", -1)]), (Y(!0), X(J, null, ia(b.value.skills, (e) => (Y(), X("div", {
|
|
23250
23246
|
key: e.name,
|
|
23251
23247
|
class: "info-item"
|
|
23252
23248
|
}, [
|
|
23253
23249
|
Z("div", {
|
|
23254
23250
|
class: "info-name skill-toggle",
|
|
23255
23251
|
onClick: (t) => S(e.name)
|
|
23256
|
-
}, [Z("span", { class: H(["skill-arrow", { open: !!x.value[e.name] }]) }, "▶", 2), ms(" " + U(e.name), 1)], 8,
|
|
23257
|
-
Z("div",
|
|
23258
|
-
x.value[e.name] ? (Y(), X("div",
|
|
23252
|
+
}, [Z("span", { class: H(["skill-arrow", { open: !!x.value[e.name] }]) }, "▶", 2), ms(" " + U(e.name), 1)], 8, Yw),
|
|
23253
|
+
Z("div", Xw, U(e.description), 1),
|
|
23254
|
+
x.value[e.name] ? (Y(), X("div", Zw, [x.value[e.name].loading ? (Y(), X("div", Qw, "加载中…")) : x.value[e.name].error ? (Y(), X("div", $w, U(x.value[e.name].error), 1)) : x.value[e.name].content ? (Y(), X("pre", eT, U(x.value[e.name].content), 1)) : Q("", !0)])) : Q("", !0)
|
|
23259
23255
|
]))), 128))])) : Q("", !0),
|
|
23260
|
-
b.value.data ? (Y(), X("div",
|
|
23261
|
-
Z("div",
|
|
23262
|
-
Z("div",
|
|
23263
|
-
Z("div",
|
|
23264
|
-
Z("div",
|
|
23265
|
-
Z("div",
|
|
23256
|
+
b.value.data ? (Y(), X("div", tT, [n[31] ||= Z("div", { class: "info-title" }, "📊 可操作数据", -1), Z("div", nT, [Z("div", rT, U(b.value.data.description || "主数据对象"), 1), Z("div", iT, "schema: " + U(b.value.data.schema ? "已声明" : "未声明"), 1)])])) : Q("", !0),
|
|
23257
|
+
Z("div", aT, [n[36] ||= Z("div", { class: "info-title" }, "🧬 子 Agent", -1), Z("div", oT, [
|
|
23258
|
+
Z("div", sT, [n[32] ||= Z("span", { class: "k" }, "启用", -1), Z("span", cT, U(b.value.subagent.enabled ? "是" : "否"), 1)]),
|
|
23259
|
+
Z("div", lT, [n[33] ||= Z("span", { class: "k" }, "最大递归", -1), Z("span", uT, U(b.value.subagent.maxDepth), 1)]),
|
|
23260
|
+
Z("div", dT, [n[34] ||= Z("span", { class: "k" }, "并行上限", -1), Z("span", fT, U(b.value.subagent.maxParallel), 1)]),
|
|
23261
|
+
Z("div", pT, [n[35] ||= Z("span", { class: "k" }, "额外工具", -1), Z("span", mT, U(b.value.subagent.allowedTools.length ? b.value.subagent.allowedTools.join(", ") : "默认只读"), 1)])
|
|
23266
23262
|
])]),
|
|
23267
|
-
b.value.mcp?.servers?.length ? (Y(), X("div",
|
|
23263
|
+
b.value.mcp?.servers?.length ? (Y(), X("div", hT, [Z("div", gT, "🔌 MCP (" + U(b.value.mcp.servers.length) + ")", 1), (Y(!0), X(J, null, ia(b.value.mcp.servers, (e) => (Y(), X("div", {
|
|
23268
23264
|
key: e.name,
|
|
23269
23265
|
class: "info-item"
|
|
23270
|
-
}, [Z("div",
|
|
23271
|
-
b.value.verify ? (Y(), X("div",
|
|
23272
|
-
Z("div",
|
|
23273
|
-
Z("div",
|
|
23274
|
-
Z("div",
|
|
23275
|
-
b.value.verify.adversarial ? (Y(), X("div",
|
|
23266
|
+
}, [Z("div", _T, [ms(U(e.name) + " ", 1), Z("span", vT, U(e.toolCount) + " 工具", 1)]), Z("div", yT, U(e.url), 1)]))), 128))])) : Q("", !0),
|
|
23267
|
+
b.value.verify ? (Y(), X("div", bT, [n[41] ||= Z("div", { class: "info-title" }, "✅ Verify 自检", -1), Z("div", xT, [
|
|
23268
|
+
Z("div", ST, [n[37] ||= Z("span", { class: "k" }, "启用", -1), Z("span", CT, U(b.value.verify.enabled ? "是" : "否"), 1)]),
|
|
23269
|
+
Z("div", wT, [n[38] ||= Z("span", { class: "k" }, "自纠上限", -1), Z("span", TT, U(b.value.verify.maxAttempts), 1)]),
|
|
23270
|
+
Z("div", ET, [n[39] ||= Z("span", { class: "k" }, "对抗验证", -1), Z("span", DT, U(b.value.verify.adversarial ? "开启" : "关闭"), 1)]),
|
|
23271
|
+
b.value.verify.adversarial ? (Y(), X("div", OT, [n[40] ||= Z("span", { class: "k" }, "对抗模型", -1), Z("span", kT, U(b.value.model || "-") + "(同主)", 1)])) : Q("", !0)
|
|
23276
23272
|
])])) : Q("", !0),
|
|
23277
|
-
b.value.todos.length ? (Y(), X("div",
|
|
23273
|
+
b.value.todos.length ? (Y(), X("div", AT, [Z("div", jT, "📋 任务清单 (" + U(b.value.todos.length) + ")", 1), (Y(!0), X(J, null, ia(b.value.todos, (e, t) => (Y(), X("div", {
|
|
23278
23274
|
key: t,
|
|
23279
23275
|
class: "info-todo"
|
|
23280
23276
|
}, [Z("span", {
|
|
23281
23277
|
class: "todo-tag",
|
|
23282
23278
|
style: Te({ background: T[e.status] && T[e.status].color || "#9ca3af" })
|
|
23283
23279
|
}, U(E(e.status)), 5), Z("span", null, U(e.content), 1)]))), 128))])) : Q("", !0),
|
|
23284
|
-
b.value.memory ? (Y(), X("div",
|
|
23285
|
-
b.value.lastCompression ? (Y(), X("div",
|
|
23286
|
-
Z("div",
|
|
23287
|
-
Z("div",
|
|
23288
|
-
Z("div",
|
|
23289
|
-
Z("div",
|
|
23290
|
-
Z("div",
|
|
23291
|
-
b.value.lastCompression.decision ? (Y(), X("div",
|
|
23280
|
+
b.value.memory ? (Y(), X("div", MT, [n[42] ||= Z("div", { class: "info-title" }, "📝 持久指令 (memory)", -1), Z("pre", NT, U(b.value.memory), 1)])) : Q("", !0),
|
|
23281
|
+
b.value.lastCompression ? (Y(), X("div", PT, [n[49] ||= Z("div", { class: "info-title" }, "🗜️ 上轮压缩", -1), Z("div", FT, [
|
|
23282
|
+
Z("div", IT, [n[43] ||= Z("span", { class: "k" }, "触发", -1), Z("span", LT, U(b.value.lastCompression.triggered ? "✓" : "✗(未达阈值)"), 1)]),
|
|
23283
|
+
Z("div", RT, [n[44] ||= Z("span", { class: "k" }, "摘要轮次", -1), Z("span", zT, U(b.value.lastCompression.roundsSummarized) + " / " + U(b.value.lastCompression.roundsTotal), 1)]),
|
|
23284
|
+
Z("div", BT, [n[45] ||= Z("span", { class: "k" }, "召回", -1), Z("span", VT, U(b.value.lastCompression.roundsRecalled) + " 条", 1)]),
|
|
23285
|
+
Z("div", HT, [n[46] ||= Z("span", { class: "k" }, "消息数", -1), Z("span", UT, U(b.value.lastCompression.originalMessages) + " → " + U(b.value.lastCompression.compressedMessages), 1)]),
|
|
23286
|
+
Z("div", WT, [n[47] ||= Z("span", { class: "k" }, "策略", -1), Z("span", GT, U(b.value.lastCompression.strategy), 1)]),
|
|
23287
|
+
b.value.lastCompression.decision ? (Y(), X("div", KT, [n[48] ||= Z("span", { class: "k" }, "压缩决策", -1), Z("span", qT, "🤖 " + U(re(b.value.lastCompression.decision)), 1)])) : Q("", !0)
|
|
23292
23288
|
])])) : Q("", !0)
|
|
23293
|
-
], 64)) : (Y(), X("div",
|
|
23289
|
+
], 64)) : (Y(), X("div", Aw, "暂无信息"))]))
|
|
23294
23290
|
])
|
|
23295
|
-
]), Z("div", {
|
|
23291
|
+
], 2), Z("div", {
|
|
23296
23292
|
class: "drawer-mask",
|
|
23297
23293
|
onClick: _
|
|
23298
23294
|
})])) : Q("", !0)]),
|
|
23299
23295
|
_: 1
|
|
23300
23296
|
})]));
|
|
23301
23297
|
}
|
|
23302
|
-
}), [["__scopeId", "data-v-
|
|
23298
|
+
}), [["__scopeId", "data-v-bb8e2650"]]), YT = { class: "skill-panel" }, XT = { class: "skill-header" }, ZT = { class: "skill-section" }, QT = { class: "section-title" }, $T = { class: "field" }, eE = ["disabled"], tE = { class: "field" }, nE = { class: "field field-textarea" }, rE = {
|
|
23303
23299
|
key: 0,
|
|
23304
23300
|
class: "skill-error"
|
|
23305
|
-
},
|
|
23301
|
+
}, iE = { class: "skill-section" }, aE = { class: "section-title" }, oE = {
|
|
23306
23302
|
key: 0,
|
|
23307
23303
|
class: "empty-hint"
|
|
23308
|
-
},
|
|
23304
|
+
}, sE = {
|
|
23309
23305
|
key: 1,
|
|
23310
23306
|
class: "skill-list"
|
|
23311
|
-
},
|
|
23307
|
+
}, cE = { class: "skill-actions" }, lE = ["onClick"], uE = ["onClick"], dE = /*#__PURE__*/ Cg(/* @__PURE__ */ Mi({
|
|
23312
23308
|
__name: "SkillPanel",
|
|
23313
23309
|
props: {
|
|
23314
23310
|
visible: { type: Boolean },
|
|
@@ -23362,54 +23358,54 @@ app.mount('#app');
|
|
|
23362
23358
|
key: 0,
|
|
23363
23359
|
class: "skill-mask",
|
|
23364
23360
|
onClick: n[4] ||= gl((e) => r("close"), ["self"])
|
|
23365
|
-
}, [Z("div",
|
|
23366
|
-
Z("div",
|
|
23361
|
+
}, [Z("div", YT, [
|
|
23362
|
+
Z("div", XT, [n[5] ||= Z("span", { class: "skill-title" }, "🧩 Skill 管理", -1), Z("button", {
|
|
23367
23363
|
class: "skill-close",
|
|
23368
23364
|
title: "关闭",
|
|
23369
23365
|
onClick: n[0] ||= (e) => r("close")
|
|
23370
23366
|
}, "✕")]),
|
|
23371
|
-
Z("div",
|
|
23372
|
-
Z("div",
|
|
23367
|
+
Z("div", ZT, [
|
|
23368
|
+
Z("div", QT, [ms(U(u.value ? `编辑 Skill: ${u.value}` : "创建新 Skill") + " ", 1), u.value ? (Y(), X("button", {
|
|
23373
23369
|
key: 0,
|
|
23374
23370
|
class: "btn btn-ghost btn-cancel",
|
|
23375
23371
|
title: "取消编辑,回到新建",
|
|
23376
23372
|
onClick: h
|
|
23377
23373
|
}, "取消编辑")) : Q("", !0)]),
|
|
23378
|
-
Z("label",
|
|
23374
|
+
Z("label", $T, [n[6] ||= Z("span", { class: "field-label" }, "名称", -1), qr(Z("input", {
|
|
23379
23375
|
"onUpdate:modelValue": n[1] ||= (e) => i.value = e,
|
|
23380
23376
|
disabled: !!u.value,
|
|
23381
23377
|
placeholder: "如:my-writer",
|
|
23382
23378
|
class: "field-input"
|
|
23383
|
-
}, null, 8,
|
|
23384
|
-
Z("label",
|
|
23379
|
+
}, null, 8, eE), [[pl, i.value]])]),
|
|
23380
|
+
Z("label", tE, [n[7] ||= Z("span", { class: "field-label" }, "描述", -1), qr(Z("input", {
|
|
23385
23381
|
"onUpdate:modelValue": n[2] ||= (e) => a.value = e,
|
|
23386
23382
|
placeholder: "一句话说明用途与触发时机",
|
|
23387
23383
|
class: "field-input"
|
|
23388
23384
|
}, null, 512), [[pl, a.value]])]),
|
|
23389
|
-
Z("label",
|
|
23385
|
+
Z("label", nE, [n[8] ||= Z("span", { class: "field-label" }, "内容", -1), qr(Z("textarea", {
|
|
23390
23386
|
"onUpdate:modelValue": n[3] ||= (e) => o.value = e,
|
|
23391
23387
|
placeholder: "skill 全文指令(支持 Markdown)",
|
|
23392
23388
|
rows: "6",
|
|
23393
23389
|
class: "field-input"
|
|
23394
23390
|
}, null, 512), [[pl, o.value]])]),
|
|
23395
|
-
s.value ? (Y(), X("div",
|
|
23391
|
+
s.value ? (Y(), X("div", rE, U(s.value), 1)) : Q("", !0),
|
|
23396
23392
|
Z("button", {
|
|
23397
23393
|
class: "btn btn-primary",
|
|
23398
23394
|
onClick: f
|
|
23399
23395
|
}, U(u.value ? "保存修改" : "添加 Skill"), 1)
|
|
23400
23396
|
]),
|
|
23401
|
-
Z("div",
|
|
23397
|
+
Z("div", iE, [Z("div", aE, "已创建 Skill(" + U(c.value.length) + ")", 1), c.value.length ? (Y(), X("ul", sE, [(Y(!0), X(J, null, ia(c.value, (e) => (Y(), X("li", {
|
|
23402
23398
|
key: e,
|
|
23403
23399
|
class: "skill-item"
|
|
23404
|
-
}, [Z("span", { class: H(["skill-name", { active: u.value === e }]) }, U(e), 3), Z("span",
|
|
23400
|
+
}, [Z("span", { class: H(["skill-name", { active: u.value === e }]) }, U(e), 3), Z("span", cE, [Z("button", {
|
|
23405
23401
|
class: "btn btn-ghost btn-edit",
|
|
23406
23402
|
title: "加载到表单编辑",
|
|
23407
23403
|
onClick: (t) => m(e)
|
|
23408
|
-
}, "编辑", 8,
|
|
23404
|
+
}, "编辑", 8, lE), Z("button", {
|
|
23409
23405
|
class: "btn btn-ghost btn-del",
|
|
23410
23406
|
title: "删除该用户 skill",
|
|
23411
23407
|
onClick: (t) => p(e)
|
|
23412
|
-
}, "删除", 8,
|
|
23408
|
+
}, "删除", 8, uE)])]))), 128))])) : (Y(), X("div", oE, "暂无用户创建的 skill"))]),
|
|
23413
23409
|
n[9] ||= Z("div", { class: "skill-hint" }, [
|
|
23414
23410
|
ms(" 💡 创建/编辑的 skill 会自动加入 agent(下轮 system prompt 索引可见),agent 经 "),
|
|
23415
23411
|
Z("code", null, "load_skill(name)"),
|
|
@@ -23421,7 +23417,7 @@ app.mount('#app');
|
|
|
23421
23417
|
_: 1
|
|
23422
23418
|
})]));
|
|
23423
23419
|
}
|
|
23424
|
-
}), [["__scopeId", "data-v-c6a22ea5"]]),
|
|
23420
|
+
}), [["__scopeId", "data-v-c6a22ea5"]]), fE = /*#__PURE__*/ Cg(/* @__PURE__ */ Mi({
|
|
23425
23421
|
__name: "ChatDialog",
|
|
23426
23422
|
props: {
|
|
23427
23423
|
fetchResponse: {},
|
|
@@ -23468,7 +23464,8 @@ app.mount('#app');
|
|
|
23468
23464
|
onAddFocus: {},
|
|
23469
23465
|
onRemoveFocus: {},
|
|
23470
23466
|
onFocusChipClick: {},
|
|
23471
|
-
sections: {}
|
|
23467
|
+
sections: {},
|
|
23468
|
+
csTheme: {}
|
|
23472
23469
|
},
|
|
23473
23470
|
emits: ["close"],
|
|
23474
23471
|
setup(e, { emit: t }) {
|
|
@@ -23506,7 +23503,8 @@ app.mount('#app');
|
|
|
23506
23503
|
})) : Q("", !0), Z("div", {
|
|
23507
23504
|
class: H(["chat-dialog", {
|
|
23508
23505
|
collapsed: !K(a) && !e.drawer,
|
|
23509
|
-
drawer: e.drawer
|
|
23506
|
+
drawer: e.drawer,
|
|
23507
|
+
"cs-theme-dark": e.csTheme === "dark"
|
|
23510
23508
|
}]),
|
|
23511
23509
|
style: Te(d.value ? {
|
|
23512
23510
|
width: d.value,
|
|
@@ -23556,7 +23554,7 @@ app.mount('#app');
|
|
|
23556
23554
|
key: 2,
|
|
23557
23555
|
name: "cs-slide"
|
|
23558
23556
|
}, {
|
|
23559
|
-
default: Gr(() => [aa(t.$slots, "body", { chat: K(i) }, () => [qr(ls(
|
|
23557
|
+
default: Gr(() => [aa(t.$slots, "body", { chat: K(i) }, () => [qr(ls(bx, {
|
|
23560
23558
|
"show-avatar": e.showAvatar,
|
|
23561
23559
|
"show-typing": e.showTyping
|
|
23562
23560
|
}, null, 8, ["show-avatar", "show-typing"]), [[jc, K(a)]])], !0)]),
|
|
@@ -23565,15 +23563,15 @@ app.mount('#app');
|
|
|
23565
23563
|
l("queued") ? aa(t.$slots, "queued", {
|
|
23566
23564
|
key: 3,
|
|
23567
23565
|
chat: K(i)
|
|
23568
|
-
}, () => [ls(
|
|
23566
|
+
}, () => [ls(Ox)], !0) : Q("", !0),
|
|
23569
23567
|
l("approval") ? aa(t.$slots, "approval", {
|
|
23570
23568
|
key: 4,
|
|
23571
23569
|
chat: K(i)
|
|
23572
|
-
}, () => [ls(
|
|
23570
|
+
}, () => [ls(Bx)], !0) : Q("", !0),
|
|
23573
23571
|
l("conflict") ? aa(t.$slots, "conflict", {
|
|
23574
23572
|
key: 5,
|
|
23575
23573
|
chat: K(i)
|
|
23576
|
-
}, () => [ls(
|
|
23574
|
+
}, () => [ls(Zx, {
|
|
23577
23575
|
"pending-conflict": e.pendingConflict,
|
|
23578
23576
|
"on-resolve": e.onResolveConflict
|
|
23579
23577
|
}, null, 8, ["pending-conflict", "on-resolve"])], !0) : Q("", !0),
|
|
@@ -23581,7 +23579,7 @@ app.mount('#app');
|
|
|
23581
23579
|
key: 6,
|
|
23582
23580
|
name: "cs-slide"
|
|
23583
23581
|
}, {
|
|
23584
|
-
default: Gr(() => [aa(t.$slots, "footer", { chat: K(i) }, () => [ls(
|
|
23582
|
+
default: Gr(() => [aa(t.$slots, "footer", { chat: K(i) }, () => [ls(lS, {
|
|
23585
23583
|
placeholder: e.placeholder,
|
|
23586
23584
|
"input-rows": e.inputRows
|
|
23587
23585
|
}, null, 8, ["placeholder", "input-rows"])], !0)]),
|
|
@@ -23590,24 +23588,26 @@ app.mount('#app');
|
|
|
23590
23588
|
l("debug") ? aa(t.$slots, "debug", {
|
|
23591
23589
|
key: 7,
|
|
23592
23590
|
chat: K(i)
|
|
23593
|
-
}, () => [ls(
|
|
23591
|
+
}, () => [ls(JT, {
|
|
23594
23592
|
visible: K(o),
|
|
23595
23593
|
"onUpdate:visible": n[2] ||= (e) => /* @__PURE__ */ yn(o) ? o.value = e : null,
|
|
23596
23594
|
logs: e.debugLogs,
|
|
23597
23595
|
"get-info": e.getInfo,
|
|
23598
23596
|
"info-tick": e.infoTick,
|
|
23599
|
-
"get-skill-content": e.getSkillContent
|
|
23597
|
+
"get-skill-content": e.getSkillContent,
|
|
23598
|
+
"cs-theme": e.csTheme
|
|
23600
23599
|
}, null, 8, [
|
|
23601
23600
|
"visible",
|
|
23602
23601
|
"logs",
|
|
23603
23602
|
"get-info",
|
|
23604
23603
|
"info-tick",
|
|
23605
|
-
"get-skill-content"
|
|
23604
|
+
"get-skill-content",
|
|
23605
|
+
"cs-theme"
|
|
23606
23606
|
])], !0) : Q("", !0),
|
|
23607
23607
|
l("skill") ? aa(t.$slots, "skill", {
|
|
23608
23608
|
key: 8,
|
|
23609
23609
|
chat: K(i)
|
|
23610
|
-
}, () => [ls(
|
|
23610
|
+
}, () => [ls(dE, {
|
|
23611
23611
|
visible: K(s),
|
|
23612
23612
|
"on-add-skill": e.onAddSkill,
|
|
23613
23613
|
"on-remove-skill": e.onRemoveSkill,
|
|
@@ -23624,13 +23624,13 @@ app.mount('#app');
|
|
|
23624
23624
|
])], !0) : Q("", !0)
|
|
23625
23625
|
], 6)], 64));
|
|
23626
23626
|
}
|
|
23627
|
-
}), [["__scopeId", "data-v-
|
|
23627
|
+
}), [["__scopeId", "data-v-e0eb0bbe"]]);
|
|
23628
23628
|
//#endregion
|
|
23629
23629
|
//#region src/core/sdk/mountChatDialog.ts
|
|
23630
|
-
function
|
|
23630
|
+
function pE(e) {
|
|
23631
23631
|
let { core: t, dialogCfg: n } = e, r = null, i = e.el, a = t.agent.debugLogs;
|
|
23632
23632
|
return r = Sl(/* @__PURE__ */ Mi({ setup() {
|
|
23633
|
-
return () => Xs(
|
|
23633
|
+
return () => Xs(fE, {
|
|
23634
23634
|
fetchStream: e.streaming ? t.stream : void 0,
|
|
23635
23635
|
fetchResponse: e.streaming ? void 0 : (e, n) => {
|
|
23636
23636
|
if (n) {
|
|
@@ -23671,6 +23671,7 @@ function hE(e) {
|
|
|
23671
23671
|
getUserSkillNames: t.skillsController ? () => t.listUserSkills() : void 0,
|
|
23672
23672
|
onGetSkill: t.skillsController ? (e) => t.getUserSkill(e) : void 0,
|
|
23673
23673
|
drawer: n.drawer === !0,
|
|
23674
|
+
csTheme: n.theme === "dark" ? "dark" : "light",
|
|
23674
23675
|
drawerWidth: n.drawerWidth,
|
|
23675
23676
|
drawerHidden: n.drawerHidden === !0,
|
|
23676
23677
|
inputRows: n.inputRows,
|
|
@@ -23728,12 +23729,12 @@ function hE(e) {
|
|
|
23728
23729
|
}
|
|
23729
23730
|
//#endregion
|
|
23730
23731
|
//#region src/core/sdk/ragSubagent.ts
|
|
23731
|
-
var
|
|
23732
|
+
var mE = "你是知识检索专家。可用工具:search_docs(语义检索)/ load_doc(按 source 加载)/ vfs_grep+vfs_read(搜预注入文档)/ fetch_document(公网 URL)。\n\n工作方式:\n1. 分析任务,拆出需查证的要点(如:需要哪些组件、各自的 props 约束、UI 规范要求);\n2. 多源检索:先 vfs_grep 搜预注入文档(快、静态)→ 不够用 search_docs 语义检索 → 需特定文档用 load_doc → 公网用 fetch_document;\n3. 检索结果不足时换关键词、扩大 topK、或换源重试;\n4. 综合成结构化、可执行结论(不堆原文,提炼成可直接用于决策/配置的信息);\n5. 标注关键信息来源(文档名/段落),便于溯源;检索不到明确说「未检索到」,不编造。\n\n你是只读检索角色,不要尝试修改任何数据。", hE = "# 知识检索策略(RAG)\n\n## 多源决策树\n- vfs_grep / vfs_read:搜集成方预注入 vfs 的文档(组件文档 / UI 规范)—— 快、静态,先查\n- search_docs:语义检索(retriever 向量库)—— 模糊匹配,关键词不确定 / 语义相似时用\n- load_doc:按 source 精确加载(已知文档 id / URL / key)—— 精确取特定文档\n- fetch_document:公网 URL —— 查公开资料\n\n## 综合规范\n- 多源交叉验证(关键结论优先 ≥2 源印证,或单一权威源)\n- 标注来源(文档名 / URL / 段落),便于溯源\n- 结构化、可执行结论(组件清单 + 各自 props 约束 + 适用场景),不堆原文\n- 未检索到明确说「未检索到」,不编造;建议替代方案(改关键词 / 建议写代码组件等)\n\n## 何时用何源\n- 静态文档(组件库文档 / UI 规范):vfs_grep\n- 语义相似(「瀑布流组件」「倒计时」「拼团」):search_docs\n- 已知文档 id / URL:load_doc\n- 公开 URL(设计规范网站 / 第三方文档):fetch_document", gE = {
|
|
23732
23733
|
name: "rag-search",
|
|
23733
23734
|
description: "多源知识检索策略:vfs 预注入文档 → 语义检索 → 指定文档加载 → 公网;综合结构化结论 + 溯源",
|
|
23734
|
-
getContent: () =>
|
|
23735
|
+
getContent: () => hE
|
|
23735
23736
|
};
|
|
23736
|
-
function
|
|
23737
|
+
function _E(e, n, i) {
|
|
23737
23738
|
return r(async ({ query: e, topK: t }) => {
|
|
23738
23739
|
try {
|
|
23739
23740
|
let r = await n(e, { topK: t ?? i });
|
|
@@ -23750,7 +23751,7 @@ function yE(e, n, i) {
|
|
|
23750
23751
|
})
|
|
23751
23752
|
});
|
|
23752
23753
|
}
|
|
23753
|
-
function
|
|
23754
|
+
function vE(e, n) {
|
|
23754
23755
|
return r(async ({ source: e }) => {
|
|
23755
23756
|
try {
|
|
23756
23757
|
let t = await n(e), r = Array.isArray(t) ? t : [t];
|
|
@@ -23764,11 +23765,11 @@ function bE(e, n) {
|
|
|
23764
23765
|
schema: t.object({ source: t.string().describe("文档标识(id/URL/key)") })
|
|
23765
23766
|
});
|
|
23766
23767
|
}
|
|
23767
|
-
function
|
|
23768
|
+
function yE(e) {
|
|
23768
23769
|
let { retriever: t, loader: n, useVfs: r = !0, id: i = "rag", description: a, topK: o = 5, searchToolName: s = "search_docs", loadToolName: c = "load_doc", maxToolRounds: l = 8, summarization: u, skills: d, extraTools: f } = e;
|
|
23769
23770
|
if (!t && !n && r === !1) throw Error("[page-agent-sdk][createRagSubagent] 至少配一种知识源:retriever / loader / useVfs(true)");
|
|
23770
23771
|
let p = [];
|
|
23771
|
-
t && p.push(
|
|
23772
|
+
t && p.push(_E(s, t, o)), n && p.push(vE(c, n)), f && p.push(...f);
|
|
23772
23773
|
let m = r ? [
|
|
23773
23774
|
"vfs_grep",
|
|
23774
23775
|
"vfs_read",
|
|
@@ -23777,45 +23778,261 @@ function xE(e) {
|
|
|
23777
23778
|
return {
|
|
23778
23779
|
id: i,
|
|
23779
23780
|
description: a ?? "检索知识库(组件文档/UI 规范/业务规则),返回有依据的结构化结论。需要查阅文档才能回答或决定如何配置时委派",
|
|
23780
|
-
systemPrompt:
|
|
23781
|
+
systemPrompt: mE,
|
|
23781
23782
|
tools: p.length ? p : void 0,
|
|
23782
23783
|
allowedTools: m,
|
|
23783
|
-
skills: d ?? [
|
|
23784
|
+
skills: d ?? [gE],
|
|
23784
23785
|
maxToolRounds: l,
|
|
23785
23786
|
...u === void 0 ? {} : { summarization: u }
|
|
23786
23787
|
};
|
|
23787
23788
|
}
|
|
23788
23789
|
//#endregion
|
|
23790
|
+
//#region src/core/tools/htmlValidate.ts
|
|
23791
|
+
var bE = /* @__PURE__ */ new Set([
|
|
23792
|
+
"area",
|
|
23793
|
+
"base",
|
|
23794
|
+
"br",
|
|
23795
|
+
"col",
|
|
23796
|
+
"embed",
|
|
23797
|
+
"hr",
|
|
23798
|
+
"img",
|
|
23799
|
+
"input",
|
|
23800
|
+
"link",
|
|
23801
|
+
"meta",
|
|
23802
|
+
"param",
|
|
23803
|
+
"source",
|
|
23804
|
+
"track",
|
|
23805
|
+
"wbr"
|
|
23806
|
+
]), xE = /* @__PURE__ */ new Set(["script", "style"]), SE = /* @__PURE__ */ new Set([
|
|
23807
|
+
"html",
|
|
23808
|
+
"head",
|
|
23809
|
+
"body"
|
|
23810
|
+
]);
|
|
23811
|
+
function CE(e, t = {}) {
|
|
23812
|
+
let n = t.sfc === !0, r = [], i = e.length;
|
|
23813
|
+
if (!e.trim()) return r;
|
|
23814
|
+
let a = [0];
|
|
23815
|
+
for (let t = 0; t < i; t++) e[t] === "\n" && a.push(t + 1);
|
|
23816
|
+
let o = (e) => {
|
|
23817
|
+
let t = 0, n = a.length - 1;
|
|
23818
|
+
for (; t < n;) {
|
|
23819
|
+
let r = t + n + 1 >> 1;
|
|
23820
|
+
a[r] <= e ? t = r : n = r - 1;
|
|
23821
|
+
}
|
|
23822
|
+
return t + 1;
|
|
23823
|
+
}, s = [], c = 0;
|
|
23824
|
+
for (; c < i;) {
|
|
23825
|
+
let t = e.indexOf("<", c);
|
|
23826
|
+
if (t < 0) break;
|
|
23827
|
+
if (e.startsWith("<!--", t)) {
|
|
23828
|
+
let n = e.indexOf("-->", t + 4);
|
|
23829
|
+
if (n < 0) {
|
|
23830
|
+
r.push({
|
|
23831
|
+
line: o(t),
|
|
23832
|
+
code: "UNCLOSED_COMMENT",
|
|
23833
|
+
message: "注释 <!-- 未闭合(缺 -->)"
|
|
23834
|
+
});
|
|
23835
|
+
break;
|
|
23836
|
+
}
|
|
23837
|
+
c = n + 3;
|
|
23838
|
+
continue;
|
|
23839
|
+
}
|
|
23840
|
+
if (e[t + 1] === "!") {
|
|
23841
|
+
let n = e.indexOf(">", t), a = e.slice(t, n < 0 ? i : n + 1);
|
|
23842
|
+
/^<!doctype/i.test(a) && r.push({
|
|
23843
|
+
line: o(t),
|
|
23844
|
+
code: "DOCTYPE_IN_FRAGMENT",
|
|
23845
|
+
message: "<!DOCTYPE> 不应出现(渲染产物经 v-html 注入,只输出内容片段)"
|
|
23846
|
+
}), c = n < 0 ? i : n + 1;
|
|
23847
|
+
continue;
|
|
23848
|
+
}
|
|
23849
|
+
let a = e[t + 1] === "/", l = a ? t + 2 : t + 1, u = e[l] ?? "";
|
|
23850
|
+
if (!/[a-zA-Z]/.test(u)) {
|
|
23851
|
+
c = t + 1;
|
|
23852
|
+
continue;
|
|
23853
|
+
}
|
|
23854
|
+
let d = l, f = "";
|
|
23855
|
+
for (; d < i;) {
|
|
23856
|
+
let t = e[d];
|
|
23857
|
+
if (f) t === f && (f = "");
|
|
23858
|
+
else if (t === "\"" || t === "'") f = t;
|
|
23859
|
+
else if (t === ">") break;
|
|
23860
|
+
d++;
|
|
23861
|
+
}
|
|
23862
|
+
if (d >= i) {
|
|
23863
|
+
r.push({
|
|
23864
|
+
line: o(t),
|
|
23865
|
+
code: "UNCLOSED_TAG",
|
|
23866
|
+
message: `标签 ${e.slice(t, Math.min(t + 20, i))} 未写完(缺 >)`
|
|
23867
|
+
});
|
|
23868
|
+
break;
|
|
23869
|
+
}
|
|
23870
|
+
let p = e.slice(l, d), m = (p.match(/^[a-zA-Z][a-zA-Z0-9-]*/) ?? [""])[0].toLowerCase(), h = !a && /\/\s*$/.test(p);
|
|
23871
|
+
if (c = d + 1, m) {
|
|
23872
|
+
if (a) {
|
|
23873
|
+
let e = s.length - 1;
|
|
23874
|
+
if (e >= 0 && s[e].name === m) s.pop();
|
|
23875
|
+
else {
|
|
23876
|
+
let e = s.findIndex((e) => e.name === m);
|
|
23877
|
+
if (e >= 0) {
|
|
23878
|
+
let t = s.splice(e);
|
|
23879
|
+
for (let e of t.slice(1)) r.push({
|
|
23880
|
+
line: o(e.idx),
|
|
23881
|
+
code: "UNCLOSED_TAG",
|
|
23882
|
+
message: `<${e.name}> 未闭合(先遇到 </${m}>)`
|
|
23883
|
+
});
|
|
23884
|
+
} else r.push({
|
|
23885
|
+
line: o(t),
|
|
23886
|
+
code: "STRAY_CLOSE_TAG",
|
|
23887
|
+
message: `</${m}> 无匹配的开标签`
|
|
23888
|
+
});
|
|
23889
|
+
}
|
|
23890
|
+
continue;
|
|
23891
|
+
}
|
|
23892
|
+
if (SE.has(m) && r.push({
|
|
23893
|
+
line: o(t),
|
|
23894
|
+
code: "DOC_TAG_IN_FRAGMENT",
|
|
23895
|
+
message: `<${m}> 不应出现(v-html 注入场景只输出内容片段,不要 html/head/body 外围)`
|
|
23896
|
+
}), !(bE.has(m) || h)) {
|
|
23897
|
+
if (xE.has(m)) {
|
|
23898
|
+
m === "script" && !n && r.push({
|
|
23899
|
+
line: o(t),
|
|
23900
|
+
code: "SCRIPT_IN_FRAGMENT",
|
|
23901
|
+
message: "<script> 禁用(v-html 注入不执行脚本,且有安全风险)"
|
|
23902
|
+
});
|
|
23903
|
+
let i = RegExp(`</${m}\\s*>`, "i").exec(e.slice(c));
|
|
23904
|
+
if (!i) {
|
|
23905
|
+
r.push({
|
|
23906
|
+
line: o(t),
|
|
23907
|
+
code: "UNCLOSED_TAG",
|
|
23908
|
+
message: `<${m}> 未闭合(缺 </${m}>)`
|
|
23909
|
+
});
|
|
23910
|
+
break;
|
|
23911
|
+
}
|
|
23912
|
+
c += i.index + i[0].length;
|
|
23913
|
+
continue;
|
|
23914
|
+
}
|
|
23915
|
+
s.push({
|
|
23916
|
+
name: m,
|
|
23917
|
+
idx: t
|
|
23918
|
+
});
|
|
23919
|
+
}
|
|
23920
|
+
}
|
|
23921
|
+
}
|
|
23922
|
+
for (let e of s) r.push({
|
|
23923
|
+
line: o(e.idx),
|
|
23924
|
+
code: "UNCLOSED_TAG",
|
|
23925
|
+
message: `<${e.name}> 未闭合`
|
|
23926
|
+
});
|
|
23927
|
+
return r;
|
|
23928
|
+
}
|
|
23929
|
+
//#endregion
|
|
23789
23930
|
//#region src/core/sdk/htmlSubagent.ts
|
|
23790
|
-
function
|
|
23791
|
-
|
|
23931
|
+
function wE(e, t) {
|
|
23932
|
+
let n = t === "html" ? "html" : "vue";
|
|
23933
|
+
return `你是纯代码组件生成专家。可用工具:vfs_write / vfs_edit / vfs_rm(写/改/删代码到 vfs ${e}) / vfs_grep + vfs_read(读 vfs) / validate_code(代码格式自检) / write + set(写 data 引用,writablePaths 限定) / read / write_todos + update_todo(规划)。
|
|
23792
23934
|
|
|
23793
23935
|
代码存储约定(重要):
|
|
23794
|
-
- 代码正文写 vfs:${e}<name
|
|
23795
|
-
- data 存引用:write({ patch:{ op:'set', jsonPath:'components.N', value:{ type:'custom', codeRef:'vfs://${e}<name
|
|
23796
|
-
- 改代码:先 vfs_edit
|
|
23936
|
+
- 代码正文写 vfs:${e}<name>.${n}(如 ${e}hero.${n})
|
|
23937
|
+
- data 存引用:write({ patch:{ op:'set', jsonPath:'components.N', value:{ type:'custom', codeRef:'vfs://${e}<name>.${n}', name, props } } })
|
|
23938
|
+
- 改代码:先 vfs_edit 局部改 vfs 文件(工具返回替换结果;data 的 codeRef 引用不变,无需改 data)
|
|
23939
|
+
|
|
23940
|
+
代码形态规则:
|
|
23941
|
+
${t === "html" ? `- 输出纯 HTML 片段(.${n}):结构 + 内联 <style>(class 加统一前缀防样式冲突);交互交给宿主(不写 JS)
|
|
23942
|
+
- 单根元素包裹(如 <section class="...">…</section>),语义化标签` : `- 输出 Vue SFC(.${n}):<template> + <script setup>(组合式),defineProps 接外部数据
|
|
23943
|
+
- 只渲染 UI,不做副作用(不发请求 / 不读写 storage)`}
|
|
23944
|
+
|
|
23945
|
+
输出契约(必须):
|
|
23946
|
+
- 渲染产物经 v-html 等方式注入宿主页面:不要 <!DOCTYPE>,不要 <html>/<head>/<body> 外围标签,只输出内容片段本身
|
|
23947
|
+
- 非 SFC 块不要 <script>(注入场景不执行脚本,且有安全风险);不引入外部脚本 / CDN
|
|
23797
23948
|
|
|
23798
23949
|
工作方式:
|
|
23799
23950
|
1. 中等任务(多组件 / 大段代码)先 write_todos 拆解:读现有结构 → 规划各组件 → 逐个生成 → read 确认;
|
|
23800
|
-
2.
|
|
23951
|
+
2. 遵循已加载 skill 的规范(安全底线 / 可访问性 / 组件库引用);
|
|
23801
23952
|
3. 小段代码 vfs_write 整体写;大段用 vfs_edit 增量拼(避免单次输出超限);
|
|
23802
|
-
4.
|
|
23953
|
+
4. 生成/修改完成后必须调 validate_code 自检(标签闭合 + 片段契约),报错用 vfs_edit 修正后复查,直到通过;
|
|
23954
|
+
5. 最后 read(vfs 文件 + data 引用)确认结构正确;只写 writablePaths 内 data + ${e} 下 vfs。`;
|
|
23803
23955
|
}
|
|
23804
|
-
var
|
|
23956
|
+
var TE = "# 纯代码组件生成规范\n\n## 代码存储约定(重要)\n- 代码正文写 vfs:html/<name>.vue(如 html/hero.vue)\n- data 存引用:{ type:'custom', codeRef:'vfs://html/<name>.vue', name, props }\n- 改代码:vfs_edit 局部改 vfs 文件(data 的 codeRef 引用不变)\n\n## 何时写代码组件\n- 组件库无对应类型(高度定制交互 / 一次性特效 / 特殊布局)→ 写 custom 代码组件\n- 组件库已有(按钮 / 卡片 / 列表)→ 用现有组件配置,不重造\n\n## Vue SFC 规范\n- Vue 3 <template> + <script setup>(组合式)\n- props 用 defineProps;事件用 defineEmits\n- 只渲染 UI,不做副作用(不发请求 / 不读写 storage)\n\n## 输出契约(必须)\n- 渲染产物经 v-html 等方式注入宿主:<template> 内不要 <!DOCTYPE> / <html> / <head> / <body> 外围标签,只输出内容片段\n- <template> 内不写 <script>;不引入外部脚本 / CDN\n- 每次生成/修改后调 validate_code 自检,报错修正直到通过\n\n## props 定义\n- 代码组件 defineProps 接受外部 data 传入(集成方渲染时按 data 的 props 字段传)\n\n## 组件库引用\n- 代码内可 import 组件库组件(如 <Button>);所用依赖以集成方渲染层已注入为准,不重复造\n\n## 安全底线(必须)\n- 禁 eval / new Function / Function 构造器\n- 禁访问 window 敏感属性(document.cookie / apiKey / token)\n- 不引入外部脚本 / CDN\n\n## 可访问性 + 语义化\n- 语义化标签(button / nav / section);图片 alt;交互可键盘聚焦\n- 颜色对比达标;不只用颜色传达信息", EE = "# HTML 片段生成规范\n\n## 代码存储约定(重要)\n- 代码正文写 vfs:html/<name>.html(如 html/landing.html)\n- data 存引用:{ type:'custom', codeRef:'vfs://html/<name>.html', name, props }\n- 改代码:vfs_edit 局部改 vfs 文件(data 的 codeRef 引用不变)\n\n## 输出契约(必须)\n- 输出经 v-html 注入宿主的 HTML 片段:不要 <!DOCTYPE>,不要 <html> / <head> / <body> 外围标签\n- 单根元素包裹(如 <section class=\"hero\">…</section>)\n- 不写 <script>(v-html 注入不执行脚本);交互交宿主页面已有机制\n- 样式用片段内 <style>,class 统一加前缀防冲突(如 .pg-hero-…)\n- 不引入外部脚本 / CDN / 外链样式\n\n## 标签闭合(必须)\n- 非自闭合标签必须成对闭合(<img> / <br> / <input> 等 void 元素除外)\n- 每次生成/修改后调 validate_code 自检,报错用 vfs_edit 修正直到通过\n\n## 何时写代码组件\n- 组件库无对应类型(高度定制布局 / 一次性专题页 / 特殊视觉效果)→ 写 HTML 片段\n- 组件库已有(按钮 / 卡片 / 列表)→ 用现有组件配置,不重造\n\n## 安全底线(必须)\n- 禁 eval / new Function / Function 构造器\n- 禁访问 window 敏感属性(document.cookie / apiKey / token)\n- 不引入外部脚本 / CDN\n\n## 可访问性 + 语义化\n- 语义化标签(button / nav / section);图片 alt;交互可键盘聚焦\n- 颜色对比达标;不只用颜色传达信息", DE = {
|
|
23805
23957
|
name: "html-builder",
|
|
23806
|
-
description: "纯代码组件(custom Vue SFC)生成规范:代码存 vfs+data 引用 / SFC 规范 /
|
|
23807
|
-
getContent: () =>
|
|
23958
|
+
description: "纯代码组件(custom Vue SFC)生成规范:代码存 vfs+data 引用 / SFC 规范 / 输出契约 / props / 组件库引用 / 可访问性",
|
|
23959
|
+
getContent: () => TE
|
|
23960
|
+
}, OE = {
|
|
23961
|
+
name: "html-fragment",
|
|
23962
|
+
description: "纯 HTML 片段(v-html 注入)生成规范:无外围标签 / 单根元素 / 标签闭合 / validate_code 自检 / 安全底线 / 可访问性",
|
|
23963
|
+
getContent: () => EE
|
|
23808
23964
|
};
|
|
23809
|
-
function
|
|
23810
|
-
let
|
|
23965
|
+
function kE(e = {}) {
|
|
23966
|
+
let t = e.vfsPrefix ?? "html/";
|
|
23967
|
+
return ({ state: e }) => {
|
|
23968
|
+
let n = e.files;
|
|
23969
|
+
if (!n) return { ok: !0 };
|
|
23970
|
+
let r = [];
|
|
23971
|
+
for (let [e, i] of Object.entries(n)) {
|
|
23972
|
+
if (!e.startsWith(t)) continue;
|
|
23973
|
+
let n = CE(i.content, { sfc: e.endsWith(".vue") });
|
|
23974
|
+
for (let t of n) r.push(`${e} 第 ${t.line} 行:${t.message}(${t.code})`);
|
|
23975
|
+
}
|
|
23976
|
+
return r.length ? {
|
|
23977
|
+
ok: !1,
|
|
23978
|
+
feedback: `HTML 格式校验未通过(共 ${r.length} 处):\n- ${r.join("\n- ")}\n请用 vfs_edit 逐项修正,改完调 validate_code 复查,全部通过后再返回。`
|
|
23979
|
+
} : { ok: !0 };
|
|
23980
|
+
};
|
|
23981
|
+
}
|
|
23982
|
+
function AE(e) {
|
|
23983
|
+
let n;
|
|
23984
|
+
return {
|
|
23985
|
+
name: "html-validate-tools",
|
|
23986
|
+
beforeAgent: (e) => {
|
|
23987
|
+
n = e.files;
|
|
23988
|
+
},
|
|
23989
|
+
tools: [r(async ({ path: t, content: r }) => {
|
|
23990
|
+
let i = [];
|
|
23991
|
+
if (r !== void 0) i.push({
|
|
23992
|
+
path: t ?? "(传入内容)",
|
|
23993
|
+
content: r
|
|
23994
|
+
});
|
|
23995
|
+
else if (t) {
|
|
23996
|
+
let r = t.replace(/^\/+/, ""), a = n?.[r];
|
|
23997
|
+
if (!a) return `未找到 vfs 文件 "${t}"。先 vfs_ls 查看;代码须写在 ${e} 下。`;
|
|
23998
|
+
i.push({
|
|
23999
|
+
path: r,
|
|
24000
|
+
content: a.content
|
|
24001
|
+
});
|
|
24002
|
+
} else {
|
|
24003
|
+
if (n) for (let [t, r] of Object.entries(n)) t.startsWith(e) && i.push({
|
|
24004
|
+
path: t,
|
|
24005
|
+
content: r.content
|
|
24006
|
+
});
|
|
24007
|
+
if (!i.length) return `${e} 下暂无代码文件,无需校验。`;
|
|
24008
|
+
}
|
|
24009
|
+
let a = [];
|
|
24010
|
+
for (let e of i) {
|
|
24011
|
+
let t = CE(e.content, { sfc: e.path.endsWith(".vue") });
|
|
24012
|
+
t.length && a.push(`${e.path}:\n${t.map((e) => ` 第 ${e.line} 行 ${e.message}(${e.code})`).join("\n")}`);
|
|
24013
|
+
}
|
|
24014
|
+
return a.length ? `❌ 格式校验未通过:\n${a.join("\n")}\n请用 vfs_edit 修正后重新调用 validate_code 复查。` : `✅ 格式校验通过(${i.map((e) => e.path).join(", ")}:标签闭合、片段契约)。`;
|
|
24015
|
+
}, {
|
|
24016
|
+
name: "validate_code",
|
|
24017
|
+
description: "校验 HTML/Vue SFC 代码格式(标签闭合 + v-html 片段契约:无 html/head/body/DOCTYPE 外围、片段无 script)。生成/修改代码后必调;报错修正后复查直到通过。",
|
|
24018
|
+
schema: t.object({
|
|
24019
|
+
path: t.string().optional().describe("vfs 代码文件路径(如 html/hero.vue);省略则校验代码前缀下全部文件"),
|
|
24020
|
+
content: t.string().optional().describe("直接校验的代码内容(优先于 path)")
|
|
24021
|
+
})
|
|
24022
|
+
})]
|
|
24023
|
+
};
|
|
24024
|
+
}
|
|
24025
|
+
var jE = 2;
|
|
24026
|
+
function ME(e) {
|
|
24027
|
+
let { writablePaths: t, codeVfsPrefix: n = "html/", id: r = "html", description: i, planning: a = !0, summarization: o = !0, maxToolRounds: s = 12, temperature: c = .4, skills: l, extraTools: u, codeKind: d = "sfc", formatCheck: f = !0 } = e;
|
|
23811
24028
|
if (!t?.length) throw Error("[page-agent-sdk][createHtmlSubagent] writablePaths 必填(代码组件 data 区,如 [\"components\"])");
|
|
23812
|
-
let
|
|
23813
|
-
a &&
|
|
23814
|
-
let
|
|
24029
|
+
let p = [];
|
|
24030
|
+
a && p.push(Vu()), f && (p.push(AE(n)), p.push(jf({ check: kE({ vfsPrefix: n }) })));
|
|
24031
|
+
let m = u ?? [];
|
|
23815
24032
|
return {
|
|
23816
24033
|
id: r,
|
|
23817
|
-
description: i ?? "生成/修改纯代码组件(custom
|
|
23818
|
-
systemPrompt:
|
|
24034
|
+
description: i ?? "生成/修改纯代码组件(custom 代码)。代码写 vfs,data 存引用;能规划(write_todos)+ 执行。需写代码组件或灵活定制时委派",
|
|
24035
|
+
systemPrompt: wE(n, d),
|
|
23819
24036
|
writablePaths: t,
|
|
23820
24037
|
allowedTools: [
|
|
23821
24038
|
"vfs_write",
|
|
@@ -23824,18 +24041,19 @@ function TE(e) {
|
|
|
23824
24041
|
"vfs_grep",
|
|
23825
24042
|
"vfs_read"
|
|
23826
24043
|
],
|
|
23827
|
-
middleware:
|
|
24044
|
+
middleware: p.length ? p : void 0,
|
|
23828
24045
|
summarization: o === !1 ? void 0 : o,
|
|
24046
|
+
maxVerifyAttempts: f ? jE : void 0,
|
|
23829
24047
|
temperature: c,
|
|
23830
|
-
skills: l ?? [
|
|
24048
|
+
skills: l ?? (d === "html" ? [OE] : [DE]),
|
|
23831
24049
|
maxToolRounds: s,
|
|
23832
|
-
tools:
|
|
24050
|
+
tools: m.length ? m : void 0
|
|
23833
24051
|
};
|
|
23834
24052
|
}
|
|
23835
24053
|
//#endregion
|
|
23836
24054
|
//#region src/core/index.ts
|
|
23837
|
-
function
|
|
23838
|
-
return ag(e,
|
|
24055
|
+
function NE(e) {
|
|
24056
|
+
return ag(e, pE);
|
|
23839
24057
|
}
|
|
23840
24058
|
//#endregion
|
|
23841
|
-
export {
|
|
24059
|
+
export { Bx as ApprovalBar, Jp as CAPABILITIES, Zp as CONTEXT_PRESETS, fE as ChatDialog, wg as ChatHeader, lS as ChatInput, Zb as CodePreview, cp as CompressDecisionSchema, Zx as ConflictBar, np as DEFAULT_SYSTEM_PROMPT, JT as DebugDrawer, Ag as FocusBar, Ab as HLJS_BLOCK_MAX_CHARS, bE as HTML_VOID_TAGS, Nd as HUMAN_CONFIRM_TOOL_NAME, Bl as MIN_CONTEXT_WINDOW, $b as MessageContent, bx as MessageList, px as MessageRow, Ox as QueuedBar, ef as STOP_WORDS, dE as SkillPanel, nm as UNSAFE_KEYS, Fh as actionsToInspectInfo, Ph as actionsToTools, Nl as agentError, Xf as analyzeContext, hm as applyPatchToClone, gm as applyPatchToLive, Ml as asAgentError, rp as buildDataPrompt, ip as buildSystemPrompt, cg as chatContextKey, mh as commitSetToBind, tp as connectMcp, x as constructLlmFromConfig, b as constructOpenLlmSync, sg as copyText, bu as createAgent, Md as createApprovalMiddleware, lg as createChatContext, NE as createChatSdk, Ud as createCheckpointManager, Wd as createCheckpointMiddleware, bp as createConflictManager, Zf as createContextInspectorMiddleware, gh as createDataOps, kE as createHtmlFormatCheck, ME as createHtmlSubagent, Id as createHumanConfirmMiddleware, Fd as createHumanConfirmTool, Vp as createMemoryBackend, Td as createMemoryMiddleware, y as createProxyLlm, yE as createRagSubagent, ld as createSandboxRunner, Xp as createSdkEvents, Qh as createSerialRunner, Gp as createSessionStore, Jh as createSkillStore, Df as createSubagentMiddleware, df as createSubagentTracker, Af as createSubagentsMiddleware, Hh as createUsageHintsMiddleware, jf as createVerifyMiddleware, Cm as createVfs, Up as createWebStorageBackend, Lf as createWriteBackCheck, cm as deepClone, Rh as defineDataToolset, dd as defineSkill, ap as defineTool, sm as deleteByPath, lp as deriveTitle, Mu as describeSchemaNode, uu as detectGarbledToolCall, ym as diffObjects, Sh as domToStructure, wh as domTools, Lh as domToolsStatic, nf as estimateMessageTokens, rf as estimateRoundTokens, Hl as estimateTokens, C as extractReasoningDelta, Zu as extractSchemaHint, Qf as extractText, S as extractTextDelta, w as extractUsage, vh as fetchDocTools, Ih as fetchTools, ph as filterByToolMode, Nu as formatConstraints, Ol as formatZodIssues, am as getByPath, Ch as getDomTool, Dh as getEnvSummary, wu as getSchemaAtPath, xu as getSchemaTopKeys, Gl as getTraceMetrics, mm as hashValue, af as indexSummarize, Ah as inspectEnvTool, jh as inspectTools, up as isChatModel, tu as isContextLengthError, Su as isPathAllowed, Np as isQuotaError, rm as isUnsafePath, Hm as jpEval, Al as jsonParseError, dm as limitDepth, Ib as markedToHtml, lm as maybeParseValue, T as normalizeUsage, Wl as offloadPassThroughChars, Ul as offloadThresholdChars, Ku as presets, Eu as projectBySchema, Tu as projectBySchemaDeep, um as projectFields, of as recallRounds, Lb as renderMarkdownHtml, Pu as renderSchemaHint, Fu as renderSchemaOverview, Lu as renderSchemaShallow, Yp as resolveCapabilities, $p as resolveContextOptions, qp as resolveDialogConfig, yp as resolveLlm, Vl as resolveModelCaps, Kp as resolveStorage, vm as restoreInPlace, _m as restoreLive, jl as routeError, ud as runHostScript, Km as runSandboxedScript, im as safeMerge, Eh as safeSerialize, fm as safeStringify, Wm as searchJson, zh as selectBuiltinTools, om as setByPath, sf as shouldTriggerCompression, qu as systemPromptHelpers, tf as tokenize, $ as toolError, Cu as unwrapSchema, og as useChat, ug as useChatContext, CE as validateHtmlFormat, e as z, kl as zodError };
|