@kvman/kvcoder 0.1.10 → 0.1.11
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/dist/api.d.ts +3 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/calls/call-name.d.ts +8 -0
- package/dist/calls/call-name.d.ts.map +1 -0
- package/dist/calls/call-name.js +38 -0
- package/dist/calls/call-name.js.map +1 -0
- package/dist/calls/line-run.d.ts +1 -4
- package/dist/calls/line-run.d.ts.map +1 -1
- package/dist/calls/line-run.js +2 -2
- package/dist/calls/line-run.js.map +1 -1
- package/dist/calls/run-tool.d.ts +1 -6
- package/dist/calls/run-tool.d.ts.map +1 -1
- package/dist/calls/run-tool.js +3 -6
- package/dist/calls/run-tool.js.map +1 -1
- package/dist/connector-call.d.ts +1 -1
- package/dist/connector-call.d.ts.map +1 -1
- package/dist/connectors/artifact.d.ts +1 -1
- package/dist/connectors/artifact.d.ts.map +1 -1
- package/dist/connectors/artifact.js +1 -1
- package/dist/connectors/artifact.js.map +1 -1
- package/dist/connectors/background.d.ts.map +1 -1
- package/dist/connectors/background.js +9 -3
- package/dist/connectors/background.js.map +1 -1
- package/dist/connectors/binary.js +2 -2
- package/dist/connectors/binary.js.map +1 -1
- package/dist/connectors/builtin-connectors.d.ts +24 -2
- package/dist/connectors/builtin-connectors.d.ts.map +1 -1
- package/dist/connectors/connector-command.d.ts +0 -1
- package/dist/connectors/connector-command.d.ts.map +1 -1
- package/dist/connectors/connector-command.js +1 -1
- package/dist/connectors/connector-command.js.map +1 -1
- package/dist/connectors/delegate.d.ts +17 -0
- package/dist/connectors/delegate.d.ts.map +1 -1
- package/dist/connectors/delegate.js +28 -6
- package/dist/connectors/delegate.js.map +1 -1
- package/dist/connectors/execution-map.d.ts +14 -3
- package/dist/connectors/execution-map.d.ts.map +1 -1
- package/dist/connectors/execution-map.js +43 -12
- package/dist/connectors/execution-map.js.map +1 -1
- package/dist/connectors/shell.js +1 -1
- package/dist/connectors/shell.js.map +1 -1
- package/dist/delegate/approved-run.js +2 -2
- package/dist/delegate/approved-run.js.map +1 -1
- package/dist/delegate/continue-helper.d.ts +18 -0
- package/dist/delegate/continue-helper.d.ts.map +1 -0
- package/dist/delegate/continue-helper.js +64 -0
- package/dist/delegate/continue-helper.js.map +1 -0
- package/dist/delegate/permission.d.ts +5 -5
- package/dist/delegate/runs.d.ts +9 -11
- package/dist/delegate/runs.d.ts.map +1 -1
- package/dist/delegate/runs.js +13 -9
- package/dist/delegate/runs.js.map +1 -1
- package/dist/delegate/workers.d.ts +6 -0
- package/dist/delegate/workers.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/jobs/helper-progress.d.ts +11 -0
- package/dist/jobs/helper-progress.d.ts.map +1 -0
- package/dist/jobs/helper-progress.js +38 -0
- package/dist/jobs/helper-progress.js.map +1 -0
- package/dist/jobs/job-rows.d.ts +3 -1
- package/dist/jobs/job-rows.d.ts.map +1 -1
- package/dist/jobs/job-rows.js +46 -22
- package/dist/jobs/job-rows.js.map +1 -1
- package/dist/jobs/process-report.d.ts +1 -1
- package/dist/jobs/process-report.d.ts.map +1 -1
- package/dist/jobs/process-report.js +11 -6
- package/dist/jobs/process-report.js.map +1 -1
- package/dist/jobs/process-run.d.ts +2 -5
- package/dist/jobs/process-run.d.ts.map +1 -1
- package/dist/jobs/process-run.js +6 -5
- package/dist/jobs/process-run.js.map +1 -1
- package/dist/jobs/register-jobs.js +3 -3
- package/dist/jobs/register-jobs.js.map +1 -1
- package/dist/maps/map-rules.d.ts +4 -2
- package/dist/maps/map-rules.d.ts.map +1 -1
- package/dist/maps/map-rules.js +7 -4
- package/dist/maps/map-rules.js.map +1 -1
- package/dist/maps/map-schema.d.ts +4 -4
- package/dist/maps/map-schema.d.ts.map +1 -1
- package/dist/maps/map-schema.js +10 -3
- package/dist/maps/map-schema.js.map +1 -1
- package/dist/prompt/build-prompt.js +2 -2
- package/dist/prompt/build-prompt.js.map +1 -1
- package/dist/prompt/session-grants.d.ts +3 -3
- package/dist/prompt/working-method.js +12 -12
- package/dist/prompt/working-method.js.map +1 -1
- package/dist/register-settings.d.ts +4 -0
- package/dist/register-settings.d.ts.map +1 -1
- package/dist/schemas/records.d.ts +10 -6
- package/dist/schemas/records.d.ts.map +1 -1
- package/dist/schemas/records.js +7 -4
- package/dist/schemas/records.js.map +1 -1
- package/dist/sessions/new-session.d.ts.map +1 -1
- package/dist/sessions/new-session.js +4 -2
- package/dist/sessions/new-session.js.map +1 -1
- package/dist/sessions/register-sessions.d.ts.map +1 -1
- package/dist/sessions/register-sessions.js +5 -2
- package/dist/sessions/register-sessions.js.map +1 -1
- package/dist/sessions/session-view.d.ts +2 -0
- package/dist/sessions/session-view.d.ts.map +1 -1
- package/dist/store/collections.d.ts +8 -8
- package/dist/thinking-levels.d.ts +6 -0
- package/dist/thinking-levels.d.ts.map +1 -0
- package/dist/thinking-levels.js +13 -0
- package/dist/thinking-levels.js.map +1 -0
- package/dist/turns/cache-retention.d.ts +6 -0
- package/dist/turns/cache-retention.d.ts.map +1 -0
- package/dist/turns/cache-retention.js +7 -0
- package/dist/turns/cache-retention.js.map +1 -0
- package/dist/turns/call-results.d.ts +6 -0
- package/dist/turns/call-results.d.ts.map +1 -0
- package/dist/turns/call-results.js +21 -0
- package/dist/turns/call-results.js.map +1 -0
- package/dist/turns/child-result.d.ts.map +1 -1
- package/dist/turns/child-result.js +4 -2
- package/dist/turns/child-result.js.map +1 -1
- package/dist/turns/compaction.d.ts.map +1 -1
- package/dist/turns/compaction.js +2 -1
- package/dist/turns/compaction.js.map +1 -1
- package/dist/turns/end-turn-state.d.ts.map +1 -1
- package/dist/turns/end-turn-state.js +2 -0
- package/dist/turns/end-turn-state.js.map +1 -1
- package/dist/turns/ended-calls.d.ts +6 -0
- package/dist/turns/ended-calls.d.ts.map +1 -0
- package/dist/turns/ended-calls.js +43 -0
- package/dist/turns/ended-calls.js.map +1 -0
- package/dist/turns/model-context.d.ts.map +1 -1
- package/dist/turns/model-context.js +16 -1
- package/dist/turns/model-context.js.map +1 -1
- package/dist/turns/model-info.d.ts +4 -0
- package/dist/turns/model-info.d.ts.map +1 -1
- package/dist/turns/model-info.js +7 -1
- package/dist/turns/model-info.js.map +1 -1
- package/dist/turns/model-retry.d.ts.map +1 -1
- package/dist/turns/model-retry.js +5 -4
- package/dist/turns/model-retry.js.map +1 -1
- package/dist/turns/run-calls.d.ts.map +1 -1
- package/dist/turns/run-calls.js +21 -5
- package/dist/turns/run-calls.js.map +1 -1
- package/dist/turns/run-command.d.ts.map +1 -1
- package/dist/turns/run-command.js +4 -6
- package/dist/turns/run-command.js.map +1 -1
- package/dist/turns/sent-size.d.ts +6 -2
- package/dist/turns/sent-size.d.ts.map +1 -1
- package/dist/turns/sent-size.js +8 -4
- package/dist/turns/sent-size.js.map +1 -1
- package/dist/turns/settle-calls.d.ts +1 -7
- package/dist/turns/settle-calls.d.ts.map +1 -1
- package/dist/turns/settle-calls.js +2 -19
- package/dist/turns/settle-calls.js.map +1 -1
- package/dist/turns/step.d.ts.map +1 -1
- package/dist/turns/step.js +29 -6
- package/dist/turns/step.js.map +1 -1
- package/dist/web/components/approval.css +1 -1
- package/dist/web/components/call.css +1 -1
- package/dist/web/components/call.js +210 -183
- package/dist/web/components/connectors.css +1 -1
- package/dist/web/components/connectors.js +431 -412
- package/dist/web/components/conversation.css +1 -1
- package/dist/web/components/conversation.js +1000 -893
- package/dist/web/components/mcp-sign-in.css +1 -1
- package/dist/web/components/model.css +1 -1
- package/dist/web/components/model.js +2 -1
- package/dist/web/components/question.css +1 -1
- package/dist/web/components/sessions.css +1 -1
- package/docs/connectors.md +4 -5
- package/locales/ar.json +15 -4
- package/locales/en.json +15 -4
- package/package.json +137 -5
|
@@ -53,19 +53,19 @@ function ee(e, t = {}) {
|
|
|
53
53
|
var z = (e) => {
|
|
54
54
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
55
55
|
return !1;
|
|
56
|
-
}, B = (e) => e === "",
|
|
57
|
-
function
|
|
58
|
-
return u(
|
|
56
|
+
}, B = (e) => e === "", te = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ne = /* @__PURE__ */ Symbol("lucide-icons");
|
|
57
|
+
function re() {
|
|
58
|
+
return u(ne, {});
|
|
59
59
|
}
|
|
60
60
|
//#endregion
|
|
61
61
|
//#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/Icon.mjs
|
|
62
|
-
var
|
|
63
|
-
name: e &&
|
|
62
|
+
var ie = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
|
|
63
|
+
name: e && te(e),
|
|
64
64
|
node: t ?? n ?? [],
|
|
65
65
|
size: 24,
|
|
66
66
|
aliases: []
|
|
67
67
|
}, absoluteStrokeWidth: i, "absolute-stroke-width": a, nonScalingStroke: o, "non-scaling-stroke": s, strokeWidth: c, "stroke-width": u, size: d, width: f = d, height: p = d, color: m, ...h }, { slots: g }) => {
|
|
68
|
-
let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: S = "" } =
|
|
68
|
+
let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: S = "" } = re(), C = B(i) || B(a) || i === !0 || a === !0 || b === !0, w = B(o) || B(s) || o === !0 || s === !0 || x === !0;
|
|
69
69
|
delete h.class;
|
|
70
70
|
let T = g.default?.(), [, E, D = []] = ee(r, {
|
|
71
71
|
color: m ?? v,
|
|
@@ -82,31 +82,31 @@ var re = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
|
|
|
82
82
|
};
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/createLucideIcon.mjs
|
|
85
|
-
function
|
|
85
|
+
function V(e, t = []) {
|
|
86
86
|
let n = typeof e == "string" ? {
|
|
87
87
|
name: e,
|
|
88
88
|
node: t
|
|
89
89
|
} : e;
|
|
90
|
-
return (e, { slots: t }) => l(
|
|
90
|
+
return (e, { slots: t }) => l(ie, {
|
|
91
91
|
...e,
|
|
92
92
|
icon: n
|
|
93
93
|
}, t.default ? { default: t.default } : void 0);
|
|
94
94
|
}
|
|
95
|
-
var
|
|
95
|
+
var ae = V({
|
|
96
96
|
name: "check",
|
|
97
97
|
size: 24,
|
|
98
98
|
node: [["path", {
|
|
99
99
|
d: "M20 6 9 17l-5-5",
|
|
100
100
|
key: "1gmf2c"
|
|
101
101
|
}]]
|
|
102
|
-
}),
|
|
102
|
+
}), oe = V({
|
|
103
103
|
name: "chevron-down",
|
|
104
104
|
size: 24,
|
|
105
105
|
node: [["path", {
|
|
106
106
|
d: "m6 9 6 6 6-6",
|
|
107
107
|
key: "qrunsl"
|
|
108
108
|
}]]
|
|
109
|
-
}),
|
|
109
|
+
}), H = V({
|
|
110
110
|
name: "pencil",
|
|
111
111
|
size: 24,
|
|
112
112
|
node: [["path", {
|
|
@@ -116,7 +116,7 @@ var ie = H({
|
|
|
116
116
|
d: "m15 5 4 4",
|
|
117
117
|
key: "1mk7zo"
|
|
118
118
|
}]]
|
|
119
|
-
}),
|
|
119
|
+
}), U = V({
|
|
120
120
|
name: "plus",
|
|
121
121
|
size: 24,
|
|
122
122
|
node: [["path", {
|
|
@@ -126,7 +126,7 @@ var ie = H({
|
|
|
126
126
|
d: "M12 5v14",
|
|
127
127
|
key: "s699le"
|
|
128
128
|
}]]
|
|
129
|
-
}),
|
|
129
|
+
}), se = V({
|
|
130
130
|
name: "search",
|
|
131
131
|
size: 24,
|
|
132
132
|
node: [["path", {
|
|
@@ -138,7 +138,7 @@ var ie = H({
|
|
|
138
138
|
r: "8",
|
|
139
139
|
key: "4ej97u"
|
|
140
140
|
}]]
|
|
141
|
-
}),
|
|
141
|
+
}), W = V({
|
|
142
142
|
name: "settings",
|
|
143
143
|
size: 24,
|
|
144
144
|
node: [["path", {
|
|
@@ -150,7 +150,7 @@ var ie = H({
|
|
|
150
150
|
r: "3",
|
|
151
151
|
key: "1v7zrd"
|
|
152
152
|
}]]
|
|
153
|
-
}),
|
|
153
|
+
}), ce = V({
|
|
154
154
|
name: "trash",
|
|
155
155
|
size: 24,
|
|
156
156
|
node: [
|
|
@@ -176,7 +176,7 @@ var ie = H({
|
|
|
176
176
|
}]
|
|
177
177
|
],
|
|
178
178
|
aliases: ["trash-2"]
|
|
179
|
-
}),
|
|
179
|
+
}), le = V({
|
|
180
180
|
name: "x",
|
|
181
181
|
size: 24,
|
|
182
182
|
node: [["path", {
|
|
@@ -189,47 +189,47 @@ var ie = H({
|
|
|
189
189
|
});
|
|
190
190
|
//#endregion
|
|
191
191
|
//#region web/src/kvman.ts
|
|
192
|
-
function
|
|
192
|
+
function G() {
|
|
193
193
|
let e = u("kvman");
|
|
194
194
|
if (e === void 0) throw Error("kvcoder components run inside kvwebui, which provides kvman.");
|
|
195
195
|
return e;
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function ue(e) {
|
|
198
198
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {};
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function de(e) {
|
|
201
201
|
let t = e.indexOf("/");
|
|
202
202
|
return t < 0 ? `kernel.errors.${e}` : `${e.slice(0, t)}.errors.${e.slice(t + 1)}`;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function fe(e) {
|
|
205
205
|
if (!(e instanceof Error) || !("problem" in e)) return;
|
|
206
206
|
let t = e.problem;
|
|
207
207
|
if (typeof t == "object" && t && "code" in t && typeof t.code == "string") return {
|
|
208
208
|
code: t.code,
|
|
209
|
-
params:
|
|
209
|
+
params: pe("params" in t ? t.params : void 0)
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
return Object.fromEntries(Object.entries(
|
|
212
|
+
function pe(e) {
|
|
213
|
+
return Object.fromEntries(Object.entries(ue(e)).map(([e, t]) => [e, typeof t == "string" ? t : JSON.stringify(t)]));
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
let n =
|
|
217
|
-
e.toast(n === void 0 ? "kvcoder.ui.failed" :
|
|
215
|
+
function K(e, t) {
|
|
216
|
+
let n = fe(t);
|
|
217
|
+
e.toast(n === void 0 ? "kvcoder.ui.failed" : de(n.code), n?.params ?? {}, "error");
|
|
218
218
|
}
|
|
219
219
|
//#endregion
|
|
220
220
|
//#region web/src/ConnectorDialog.vue?vue&type=script&setup=true&lang.ts
|
|
221
|
-
var
|
|
221
|
+
var me = ["aria-label"], he = { class: "kvc-dialog-head" }, ge = { class: "kvc-connector-text" }, _e = {
|
|
222
222
|
class: "kvc-mono kvc-dialog-title",
|
|
223
223
|
"data-test": "connector-dialog-title"
|
|
224
|
-
},
|
|
224
|
+
}, ve = {
|
|
225
225
|
class: "kvc-muted",
|
|
226
226
|
"data-test": "connector-dialog-scope"
|
|
227
|
-
},
|
|
227
|
+
}, ye = ["aria-label", "title"], be = /* @__PURE__ */ c({
|
|
228
228
|
__name: "ConnectorDialog",
|
|
229
229
|
props: { name: {} },
|
|
230
230
|
emits: ["close"],
|
|
231
231
|
setup(e, { emit: t }) {
|
|
232
|
-
let n = e, r = t, o =
|
|
232
|
+
let n = e, r = t, o = G(), c = E("dialog"), l = () => [...c.value?.querySelectorAll("button:not(:disabled), select:not(:disabled), input:not(:disabled), textarea:not(:disabled), a[href]") ?? []];
|
|
233
233
|
function u(e) {
|
|
234
234
|
let t = l(), n = e.shiftKey ? t[0] : t.at(-1);
|
|
235
235
|
(document.activeElement === n || document.activeElement === c.value) && (e.preventDefault(), (e.shiftKey ? t.at(-1) : t[0])?.focus());
|
|
@@ -248,22 +248,22 @@ var pe = ["aria-label"], me = { class: "kvc-dialog-head" }, he = { class: "kvc-c
|
|
|
248
248
|
tabindex: "-1",
|
|
249
249
|
"data-test": "connector-dialog",
|
|
250
250
|
onKeydown: [t[1] ||= P(F((e) => r("close"), ["stop"]), ["esc"]), P(u, ["tab"])]
|
|
251
|
-
}, [a("div",
|
|
251
|
+
}, [a("div", he, [a("span", ge, [a("span", _e, C(n.name), 1), a("span", ve, C(w(o).t(`kvcoder.config.dialog.scope.${w(o).scope.value}`, { name: w(o).workspace.value.name })), 1)]), a("button", {
|
|
252
252
|
type: "button",
|
|
253
253
|
class: "kvc-button kvc-ghost kvc-icon-button",
|
|
254
254
|
"aria-label": w(o).t("kvcoder.config.dialog.close"),
|
|
255
255
|
title: w(o).t("kvcoder.config.dialog.close"),
|
|
256
256
|
"data-test": "connector-dialog-close",
|
|
257
257
|
onClick: t[0] ||= (e) => r("close")
|
|
258
|
-
}, [s(w(
|
|
258
|
+
}, [s(w(le), {
|
|
259
259
|
size: 18,
|
|
260
260
|
"aria-hidden": "true"
|
|
261
|
-
})], 8,
|
|
261
|
+
})], 8, ye)]), x(e.$slots, "default")], 40, me)]));
|
|
262
262
|
}
|
|
263
263
|
});
|
|
264
264
|
//#endregion
|
|
265
265
|
//#region web/src/use-setting.ts
|
|
266
|
-
function
|
|
266
|
+
function q(e, n) {
|
|
267
267
|
let r = S(null), i = y("default"), a = y(!1), o = async () => {
|
|
268
268
|
let t = (await e.exec("kernel.settings.list", {})).find((e) => e.key === n);
|
|
269
269
|
r.value = t?.value ?? null, i.value = t?.source ?? "default";
|
|
@@ -272,7 +272,7 @@ function J(e, n) {
|
|
|
272
272
|
try {
|
|
273
273
|
return await t(), await o(), !0;
|
|
274
274
|
} catch (t) {
|
|
275
|
-
return
|
|
275
|
+
return K(e, t), !1;
|
|
276
276
|
} finally {
|
|
277
277
|
a.value = !1;
|
|
278
278
|
}
|
|
@@ -294,8 +294,24 @@ function J(e, n) {
|
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
296
|
//#endregion
|
|
297
|
+
//#region src/thinking-levels.ts
|
|
298
|
+
var J = [
|
|
299
|
+
"off",
|
|
300
|
+
"minimal",
|
|
301
|
+
"low",
|
|
302
|
+
"medium",
|
|
303
|
+
"high",
|
|
304
|
+
"xhigh",
|
|
305
|
+
"max"
|
|
306
|
+
];
|
|
307
|
+
function xe(e, t) {
|
|
308
|
+
if (e.includes(t)) return t;
|
|
309
|
+
let n = J.indexOf(t);
|
|
310
|
+
return J.slice(n + 1).find((t) => e.includes(t)) ?? J.slice(0, n).findLast((t) => e.includes(t)) ?? t;
|
|
311
|
+
}
|
|
312
|
+
//#endregion
|
|
297
313
|
//#region web/src/model-groups.ts
|
|
298
|
-
function
|
|
314
|
+
function Se(e, t, n) {
|
|
299
315
|
let r = new Map(e.map((e) => [e.id, e.title])), i = new Set(e.filter((e) => e.status !== "needsKey").map((e) => e.id)), a = t.filter((e) => i.has(e.provider) || e.id === n), o = /* @__PURE__ */ new Map();
|
|
300
316
|
for (let e of a) {
|
|
301
317
|
let t = o.get(e.provider) ?? {
|
|
@@ -305,12 +321,13 @@ function be(e, t, n) {
|
|
|
305
321
|
};
|
|
306
322
|
t.models.push({
|
|
307
323
|
id: e.id,
|
|
308
|
-
name: e.name
|
|
324
|
+
name: e.name,
|
|
325
|
+
thinkingLevels: e.thinkingLevels
|
|
309
326
|
}), o.set(e.provider, t);
|
|
310
327
|
}
|
|
311
328
|
return [...o.values()].sort((e, t) => e.title.localeCompare(t.title));
|
|
312
329
|
}
|
|
313
|
-
function
|
|
330
|
+
function Ce(e, t) {
|
|
314
331
|
let n = t.toLowerCase().split(/\s+/).filter((e) => e !== ""), r = (e) => n.every((t) => `${e.name} ${e.id}`.toLowerCase().includes(t)), i = e.map((e) => ({
|
|
315
332
|
...e,
|
|
316
333
|
models: e.models.filter(r)
|
|
@@ -321,13 +338,12 @@ function xe(e, t) {
|
|
|
321
338
|
total: e.reduce((e, t) => e + t.models.length, 0)
|
|
322
339
|
};
|
|
323
340
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
], Ce = [
|
|
341
|
+
function we(e, t) {
|
|
342
|
+
return e.flatMap((e) => e.models).find((e) => e.id === t)?.thinkingLevels ?? J;
|
|
343
|
+
}
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region web/src/worker-entry.ts
|
|
346
|
+
var Te = [
|
|
331
347
|
"off",
|
|
332
348
|
"minimal",
|
|
333
349
|
"low",
|
|
@@ -335,28 +351,28 @@ var Se = [
|
|
|
335
351
|
"high",
|
|
336
352
|
"xhigh",
|
|
337
353
|
"max"
|
|
338
|
-
],
|
|
354
|
+
], Ee = [
|
|
339
355
|
"low",
|
|
340
356
|
"medium",
|
|
341
357
|
"high",
|
|
342
358
|
"xhigh",
|
|
343
359
|
"max"
|
|
344
|
-
],
|
|
360
|
+
], De = [
|
|
345
361
|
"acceptEdits",
|
|
346
362
|
"auto",
|
|
347
363
|
"bypassPermissions",
|
|
348
364
|
"dontAsk",
|
|
349
365
|
"plan"
|
|
350
|
-
],
|
|
366
|
+
], Oe = [
|
|
351
367
|
"subagent",
|
|
352
368
|
"opencode",
|
|
353
369
|
"pi",
|
|
354
370
|
"claude"
|
|
355
|
-
],
|
|
356
|
-
function
|
|
357
|
-
return typeof e != "object" || !e || !
|
|
371
|
+
], ke = (e) => Array.isArray(e) && e.every((e) => typeof e == "string"), Ae = (e) => e === null || typeof e == "string", Y = (e, t) => e.some((e) => e === t), X = (e, ...t) => t.every((t) => t in e);
|
|
372
|
+
function je(e) {
|
|
373
|
+
return typeof e != "object" || !e || !X(e, "name", "description", "enabled", "kind", "instructions") || typeof e.name != "string" || typeof e.description != "string" || typeof e.enabled != "boolean" || typeof e.instructions != "string" ? !1 : e.kind === "subagent" ? X(e, "connectors", "model", "thinking") && (e.connectors === null || ke(e.connectors)) && Ae(e.model) && (e.thinking === null || Y(J, e.thinking)) : !X(e, "approval", "timeoutMs", "model") || !Y(["ask", "auto"], e.approval) || typeof e.timeoutMs != "number" || !Ae(e.model) ? !1 : e.kind === "opencode" ? X(e, "agent", "autoApprove") && Ae(e.agent) && typeof e.autoApprove == "boolean" : e.kind === "pi" ? X(e, "thinking", "tools") && (e.thinking === null || Y(Te, e.thinking)) && (e.tools === null || ke(e.tools)) : e.kind === "claude" && X(e, "effort", "permissionMode") && (e.effort === null || Y(Ee, e.effort)) && Y(De, e.permissionMode);
|
|
358
374
|
}
|
|
359
|
-
var
|
|
375
|
+
var Me = (e) => Array.isArray(e) ? e.filter(je) : [], Ne = {
|
|
360
376
|
name: "",
|
|
361
377
|
description: "",
|
|
362
378
|
enabled: !0,
|
|
@@ -377,10 +393,10 @@ var ke = (e) => Array.isArray(e) ? e.filter(Oe) : [], Ae = {
|
|
|
377
393
|
effort: "",
|
|
378
394
|
permissionMode: "acceptEdits"
|
|
379
395
|
};
|
|
380
|
-
function
|
|
381
|
-
if (e === void 0) return { ...
|
|
396
|
+
function Pe(e) {
|
|
397
|
+
if (e === void 0) return { ...Ne };
|
|
382
398
|
let t = {
|
|
383
|
-
...
|
|
399
|
+
...Ne,
|
|
384
400
|
name: e.name,
|
|
385
401
|
description: e.description,
|
|
386
402
|
enabled: e.enabled,
|
|
@@ -418,8 +434,8 @@ function je(e) {
|
|
|
418
434
|
permissionMode: e.permissionMode
|
|
419
435
|
};
|
|
420
436
|
}
|
|
421
|
-
var
|
|
422
|
-
function
|
|
437
|
+
var Z = (e) => e === "" ? null : e;
|
|
438
|
+
function Fe(e, t) {
|
|
423
439
|
let n = {
|
|
424
440
|
name: e.name.trim(),
|
|
425
441
|
description: e.description.trim(),
|
|
@@ -434,47 +450,47 @@ function Me(e, t) {
|
|
|
434
450
|
readOnly: e.readOnly,
|
|
435
451
|
connectors: r,
|
|
436
452
|
model: e.model,
|
|
437
|
-
thinking:
|
|
453
|
+
thinking: Z(e.thinking)
|
|
438
454
|
};
|
|
439
455
|
}
|
|
440
456
|
let r = {
|
|
441
457
|
...n,
|
|
442
458
|
approval: e.approval,
|
|
443
459
|
timeoutMs: Number(e.minutes) * 6e4,
|
|
444
|
-
model:
|
|
460
|
+
model: Z(e.programModel.trim())
|
|
445
461
|
};
|
|
446
462
|
if (e.kind === "opencode") return {
|
|
447
463
|
...r,
|
|
448
464
|
kind: "opencode",
|
|
449
|
-
agent:
|
|
465
|
+
agent: Z(e.agent.trim()),
|
|
450
466
|
autoApprove: e.autoApprove
|
|
451
467
|
};
|
|
452
468
|
let i = e.tools.split("\n").map((e) => e.trim()).filter((e) => e !== "");
|
|
453
469
|
return e.kind === "pi" ? {
|
|
454
470
|
...r,
|
|
455
471
|
kind: "pi",
|
|
456
|
-
thinking:
|
|
472
|
+
thinking: Z(e.piThinking),
|
|
457
473
|
tools: i.length === 0 ? null : i
|
|
458
474
|
} : {
|
|
459
475
|
...r,
|
|
460
476
|
kind: "claude",
|
|
461
|
-
effort:
|
|
477
|
+
effort: Z(e.effort),
|
|
462
478
|
permissionMode: e.permissionMode
|
|
463
479
|
};
|
|
464
480
|
}
|
|
465
|
-
var
|
|
481
|
+
var Ie = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/, Le = 16384, Re = /^(?:[1-9]|[1-9]\d|1[01]\d|120)$/, ze = [
|
|
466
482
|
"bypassPermissions",
|
|
467
483
|
"auto",
|
|
468
484
|
"dontAsk"
|
|
469
|
-
],
|
|
470
|
-
function
|
|
485
|
+
], Be = (e) => e.approval === "auto" && (e.kind === "opencode" && e.autoApprove || e.kind === "claude" && ze.includes(e.permissionMode));
|
|
486
|
+
function Ve(e, t) {
|
|
471
487
|
let n = e.name.trim(), r = {};
|
|
472
|
-
return n === "" ? r.name = "kvcoder.config.workers.invalid.nameEmpty" :
|
|
488
|
+
return n === "" ? r.name = "kvcoder.config.workers.invalid.nameEmpty" : Ie.test(n) ? t.includes(n) && (r.name = "kvcoder.config.workers.invalid.nameTaken") : r.name = "kvcoder.config.workers.invalid.nameShape", e.description.trim() === "" && (r.description = "kvcoder.config.workers.invalid.descriptionEmpty"), new TextEncoder().encode(e.instructions).length > Le && (r.instructions = "kvcoder.config.workers.invalid.instructionsLong"), e.kind === "subagent" && !e.all && e.connectors.length === 0 && (r.connectors = "kvcoder.config.workers.invalid.connectorsEmpty"), e.kind !== "subagent" && !Re.test(e.minutes.trim()) && (r.minutes = "kvcoder.config.workers.invalid.minutes"), Be(e) && (r.approval = "kvcoder.config.workers.invalid.unattended"), r;
|
|
473
489
|
}
|
|
474
490
|
//#endregion
|
|
475
491
|
//#region web/src/use-workers.ts
|
|
476
|
-
function
|
|
477
|
-
let n =
|
|
492
|
+
function He(e) {
|
|
493
|
+
let n = q(e, "kvcoder.delegate.workers"), r = t(() => Me(n.value.value)), i = y({});
|
|
478
494
|
async function a(t) {
|
|
479
495
|
i.value = {
|
|
480
496
|
...i.value,
|
|
@@ -484,7 +500,7 @@ function ze(e) {
|
|
|
484
500
|
try {
|
|
485
501
|
n = (await e.exec("kvcoder.delegate.worker.check", { name: t })).status;
|
|
486
502
|
} catch (t) {
|
|
487
|
-
|
|
503
|
+
K(e, t), n = "notFound";
|
|
488
504
|
}
|
|
489
505
|
i.value = {
|
|
490
506
|
...i.value,
|
|
@@ -518,32 +534,32 @@ function ze(e) {
|
|
|
518
534
|
}
|
|
519
535
|
//#endregion
|
|
520
536
|
//#region web/src/ModelPicker.vue?vue&type=script&setup=true&lang.ts
|
|
521
|
-
var
|
|
537
|
+
var Ue = { class: "kvc-picker" }, We = [
|
|
522
538
|
"aria-expanded",
|
|
523
539
|
"aria-label",
|
|
524
540
|
"disabled"
|
|
525
|
-
],
|
|
541
|
+
], Ge = { class: "kvc-picker-label" }, Ke = ["onKeydown"], qe = { class: "kvc-search" }, Je = [
|
|
526
542
|
"placeholder",
|
|
527
543
|
"aria-label",
|
|
528
544
|
"onKeydown"
|
|
529
|
-
],
|
|
545
|
+
], Ye = ["aria-label"], Xe = ["aria-selected", "data-active"], Ze = { class: "kvc-model-name" }, Qe = {
|
|
530
546
|
class: "kvc-group",
|
|
531
547
|
role: "presentation",
|
|
532
548
|
"data-test": "model-group"
|
|
533
|
-
},
|
|
549
|
+
}, $e = [
|
|
534
550
|
"aria-selected",
|
|
535
551
|
"data-active",
|
|
536
552
|
"data-test",
|
|
537
553
|
"onClick",
|
|
538
554
|
"onMousemove"
|
|
539
|
-
],
|
|
555
|
+
], et = { class: "kvc-model-name" }, tt = {
|
|
540
556
|
key: 1,
|
|
541
557
|
class: "kvc-muted kvc-none",
|
|
542
558
|
"data-test": "model-none"
|
|
543
|
-
},
|
|
559
|
+
}, nt = {
|
|
544
560
|
class: "kvc-muted kvc-count",
|
|
545
561
|
"data-test": "model-count"
|
|
546
|
-
},
|
|
562
|
+
}, rt = 24, it = /* @__PURE__ */ c({
|
|
547
563
|
__name: "ModelPicker",
|
|
548
564
|
props: {
|
|
549
565
|
groups: {},
|
|
@@ -554,7 +570,7 @@ var Be = { class: "kvc-picker" }, Ve = [
|
|
|
554
570
|
},
|
|
555
571
|
emits: ["pick", "none"],
|
|
556
572
|
setup(o, { emit: c }) {
|
|
557
|
-
let l = o, u = c, d =
|
|
573
|
+
let l = o, u = c, d = G(), f = y(!1), h = y(""), g = y(0), v = E("trigger"), x = E("search"), S = E("panel"), T = t(() => Ce(l.groups, h.value)), D = t(() => T.value.groups.flatMap((e) => e.models)), O = t(() => l.groups.flatMap((e) => e.models).find((e) => e.id === l.current)?.name ?? l.current ?? l.empty ?? ""), k = t(() => l.none !== void 0 && h.value.trim() === ""), M = t(() => +!!k.value), I = t(() => D.value.length + M.value), L = (e) => {
|
|
558
574
|
let t = D.value.findIndex((t) => t.id === e);
|
|
559
575
|
return t < 0 ? -1 : t + M.value;
|
|
560
576
|
};
|
|
@@ -562,41 +578,41 @@ var Be = { class: "kvc-picker" }, Ve = [
|
|
|
562
578
|
f.value = !1, v.value?.focus();
|
|
563
579
|
}
|
|
564
580
|
async function ee() {
|
|
565
|
-
h.value = "", g.value = Math.max(L(l.current ?? ""), 0), z = 0, f.value = !0, await p(),
|
|
581
|
+
h.value = "", g.value = Math.max(L(l.current ?? ""), 0), z = 0, f.value = !0, await p(), te(), x.value?.focus(), re();
|
|
566
582
|
}
|
|
567
583
|
let z = 0, B = 0;
|
|
568
|
-
function
|
|
584
|
+
function te() {
|
|
569
585
|
let e = S.value, t = v.value?.closest(".kvc-conversation")?.getBoundingClientRect();
|
|
570
586
|
if (e === null || t === void 0) return;
|
|
571
|
-
let n = e.getBoundingClientRect(), r = t.left +
|
|
587
|
+
let n = e.getBoundingClientRect(), r = t.left + rt - (n.left - z), i = t.right - rt - (n.right - z), a = r > 0 ? r : i < 0 ? i : 0;
|
|
572
588
|
a !== z && (z = a, e.style.translate = `${a}px 0`);
|
|
573
589
|
}
|
|
574
|
-
function te() {
|
|
575
|
-
V(), B = requestAnimationFrame(te);
|
|
576
|
-
}
|
|
577
590
|
function ne() {
|
|
591
|
+
te(), B = requestAnimationFrame(ne);
|
|
592
|
+
}
|
|
593
|
+
function re() {
|
|
578
594
|
S.value?.querySelector("[data-active=\"true\"]")?.scrollIntoView?.({ block: "nearest" });
|
|
579
595
|
}
|
|
580
|
-
async function
|
|
581
|
-
I.value !== 0 && (g.value = (g.value + e + I.value) % I.value, await p(),
|
|
596
|
+
async function ie(e) {
|
|
597
|
+
I.value !== 0 && (g.value = (g.value + e + I.value) % I.value, await p(), re());
|
|
582
598
|
}
|
|
583
|
-
function
|
|
599
|
+
function V(e) {
|
|
584
600
|
e !== void 0 && (u("pick", e), R());
|
|
585
601
|
}
|
|
586
|
-
function
|
|
602
|
+
function H() {
|
|
587
603
|
u("none"), R();
|
|
588
604
|
}
|
|
589
|
-
function
|
|
590
|
-
k.value && g.value === 0 ?
|
|
605
|
+
function U() {
|
|
606
|
+
k.value && g.value === 0 ? H() : V(D.value[g.value - M.value]?.id);
|
|
591
607
|
}
|
|
592
|
-
function
|
|
608
|
+
function W(e) {
|
|
593
609
|
e.target instanceof Node && !v.value?.parentElement?.contains(e.target) && (f.value = !1);
|
|
594
610
|
}
|
|
595
611
|
return j(h, () => g.value = 0), j(f, (e) => {
|
|
596
|
-
e ? (document.addEventListener("pointerdown",
|
|
612
|
+
e ? (document.addEventListener("pointerdown", W), B = requestAnimationFrame(ne)) : (document.removeEventListener("pointerdown", W), cancelAnimationFrame(B));
|
|
597
613
|
}), m(() => {
|
|
598
|
-
document.removeEventListener("pointerdown",
|
|
599
|
-
}), (t, o) => (_(), i("div",
|
|
614
|
+
document.removeEventListener("pointerdown", W), cancelAnimationFrame(B);
|
|
615
|
+
}), (t, o) => (_(), i("div", Ue, [a("button", {
|
|
600
616
|
ref_key: "trigger",
|
|
601
617
|
ref: v,
|
|
602
618
|
type: "button",
|
|
@@ -607,10 +623,10 @@ var Be = { class: "kvc-picker" }, Ve = [
|
|
|
607
623
|
disabled: l.disabled,
|
|
608
624
|
"data-test": "model-picker",
|
|
609
625
|
onClick: o[0] ||= (e) => f.value ? R() : ee()
|
|
610
|
-
}, [a("span",
|
|
626
|
+
}, [a("span", Ge, C(O.value), 1), s(w(oe), {
|
|
611
627
|
size: 16,
|
|
612
628
|
"aria-hidden": "true"
|
|
613
|
-
})], 8,
|
|
629
|
+
})], 8, We), f.value ? (_(), i("div", {
|
|
614
630
|
key: 0,
|
|
615
631
|
ref_key: "panel",
|
|
616
632
|
ref: S,
|
|
@@ -618,7 +634,7 @@ var Be = { class: "kvc-picker" }, Ve = [
|
|
|
618
634
|
"data-test": "model-popover",
|
|
619
635
|
onKeydown: P(F(R, ["stop"]), ["esc"])
|
|
620
636
|
}, [
|
|
621
|
-
a("label",
|
|
637
|
+
a("label", qe, [s(w(se), {
|
|
622
638
|
size: 16,
|
|
623
639
|
"aria-hidden": "true"
|
|
624
640
|
}), N(a("input", {
|
|
@@ -633,11 +649,11 @@ var Be = { class: "kvc-picker" }, Ve = [
|
|
|
633
649
|
"aria-label": w(d).t("kvcoder.ui.searchModels"),
|
|
634
650
|
"data-test": "model-search",
|
|
635
651
|
onKeydown: [
|
|
636
|
-
o[2] ||= P(F((e) =>
|
|
637
|
-
o[3] ||= P(F((e) =>
|
|
638
|
-
P(F(
|
|
652
|
+
o[2] ||= P(F((e) => ie(1), ["prevent"]), ["down"]),
|
|
653
|
+
o[3] ||= P(F((e) => ie(-1), ["prevent"]), ["up"]),
|
|
654
|
+
P(F(U, ["prevent"]), ["enter"])
|
|
639
655
|
]
|
|
640
|
-
}, null, 40,
|
|
656
|
+
}, null, 40, Je), [[A, h.value]])]),
|
|
641
657
|
a("div", {
|
|
642
658
|
id: "kvc-models",
|
|
643
659
|
class: "kvc-options",
|
|
@@ -651,36 +667,36 @@ var Be = { class: "kvc-picker" }, Ve = [
|
|
|
651
667
|
"aria-selected": l.current === null,
|
|
652
668
|
"data-active": g.value === 0,
|
|
653
669
|
"data-test": "model-none-entry",
|
|
654
|
-
onClick:
|
|
670
|
+
onClick: H,
|
|
655
671
|
onMousemove: o[4] ||= (e) => g.value = 0
|
|
656
|
-
}, [a("span",
|
|
672
|
+
}, [a("span", Ze, C(l.none), 1), l.current === null ? (_(), n(w(ae), {
|
|
657
673
|
key: 0,
|
|
658
674
|
size: 16,
|
|
659
675
|
"aria-hidden": "true"
|
|
660
|
-
})) : r("v-if", !0)], 40,
|
|
661
|
-
(_(!0), i(e, null, b(T.value.groups, (t) => (_(), i(e, { key: t.provider }, [a("div",
|
|
676
|
+
})) : r("v-if", !0)], 40, Xe)) : r("v-if", !0),
|
|
677
|
+
(_(!0), i(e, null, b(T.value.groups, (t) => (_(), i(e, { key: t.provider }, [a("div", Qe, C(t.title), 1), (_(!0), i(e, null, b(t.models, (e) => (_(), i("div", {
|
|
662
678
|
key: e.id,
|
|
663
679
|
class: "kvc-model",
|
|
664
680
|
role: "option",
|
|
665
681
|
"aria-selected": e.id === l.current,
|
|
666
682
|
"data-active": L(e.id) === g.value,
|
|
667
683
|
"data-test": `model-${e.id}`,
|
|
668
|
-
onClick: (t) =>
|
|
684
|
+
onClick: (t) => V(e.id),
|
|
669
685
|
onMousemove: (t) => g.value = L(e.id)
|
|
670
|
-
}, [a("span",
|
|
686
|
+
}, [a("span", et, C(e.name), 1), e.id === l.current ? (_(), n(w(ae), {
|
|
671
687
|
key: 0,
|
|
672
688
|
size: 16,
|
|
673
689
|
"aria-hidden": "true"
|
|
674
|
-
})) : r("v-if", !0)], 40,
|
|
675
|
-
T.value.shown === 0 ? (_(), i("p",
|
|
676
|
-
], 8,
|
|
677
|
-
a("p",
|
|
690
|
+
})) : r("v-if", !0)], 40, $e))), 128))], 64))), 128)),
|
|
691
|
+
T.value.shown === 0 ? (_(), i("p", tt, C(w(d).t("kvcoder.ui.noModels")), 1)) : r("v-if", !0)
|
|
692
|
+
], 8, Ye),
|
|
693
|
+
a("p", nt, C(w(d).t("kvcoder.ui.modelsCount", {
|
|
678
694
|
shown: T.value.shown,
|
|
679
695
|
total: T.value.total
|
|
680
696
|
})), 1)
|
|
681
|
-
], 40,
|
|
697
|
+
], 40, Ke)) : r("v-if", !0)]));
|
|
682
698
|
}
|
|
683
|
-
}),
|
|
699
|
+
}), at = [
|
|
684
700
|
"shell",
|
|
685
701
|
"fs",
|
|
686
702
|
"artifact",
|
|
@@ -689,15 +705,15 @@ var Be = { class: "kvc-picker" }, Ve = [
|
|
|
689
705
|
"ask",
|
|
690
706
|
"delegate",
|
|
691
707
|
"mcp"
|
|
692
|
-
],
|
|
708
|
+
], ot = [
|
|
693
709
|
"shell",
|
|
694
710
|
"delegate",
|
|
695
711
|
"mcp"
|
|
696
|
-
],
|
|
697
|
-
function
|
|
698
|
-
let n = y([]), r =
|
|
712
|
+
], st = (e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : [];
|
|
713
|
+
function ct(e) {
|
|
714
|
+
let n = y([]), r = q(e, "kvcoder.connectors.disabled"), i = t(() => st(r.value.value)), a = async () => {
|
|
699
715
|
n.value = await e.exec("kvcoder.connector.list", {});
|
|
700
|
-
}, o = t(() => [...
|
|
716
|
+
}, o = t(() => [...at.map((t) => ({
|
|
701
717
|
name: t,
|
|
702
718
|
description: e.t(`kvcoder.config.connector.${t}`)
|
|
703
719
|
})), ...n.value.map((e) => ({
|
|
@@ -706,7 +722,7 @@ function at(e) {
|
|
|
706
722
|
}))].map((e) => ({
|
|
707
723
|
...e,
|
|
708
724
|
on: !i.value.includes(e.name),
|
|
709
|
-
configurable:
|
|
725
|
+
configurable: ot.includes(e.name)
|
|
710
726
|
})));
|
|
711
727
|
return h(a), j(() => e.workspace.value.id, a), {
|
|
712
728
|
items: o,
|
|
@@ -719,23 +735,23 @@ function at(e) {
|
|
|
719
735
|
}
|
|
720
736
|
//#endregion
|
|
721
737
|
//#region web/src/WorkerProgramFields.vue?vue&type=script&setup=true&lang.ts
|
|
722
|
-
var
|
|
738
|
+
var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["value", "data-test"], ft = {
|
|
723
739
|
key: 0,
|
|
724
740
|
class: "kvc-form-error",
|
|
725
741
|
role: "alert",
|
|
726
742
|
"data-test": "worker-approval-error"
|
|
727
|
-
},
|
|
743
|
+
}, pt = {
|
|
728
744
|
key: 1,
|
|
729
745
|
class: "kvc-muted"
|
|
730
|
-
},
|
|
746
|
+
}, mt = { class: "kvc-form-field" }, ht = { class: "kvc-form-label" }, gt = ["aria-invalid"], _t = {
|
|
731
747
|
key: 0,
|
|
732
748
|
class: "kvc-form-error",
|
|
733
749
|
role: "alert",
|
|
734
750
|
"data-test": "worker-minutes-error"
|
|
735
|
-
},
|
|
751
|
+
}, vt = {
|
|
736
752
|
key: 1,
|
|
737
753
|
class: "kvc-muted"
|
|
738
|
-
},
|
|
754
|
+
}, yt = { class: "kvc-form-field" }, bt = { class: "kvc-form-label" }, xt = { class: "kvc-muted" }, St = { class: "kvc-form-field" }, Ct = { class: "kvc-form-label" }, wt = { class: "kvc-muted" }, Tt = { class: "kvc-form-radio" }, Et = { class: "kvc-form-field" }, Dt = { class: "kvc-form-label" }, Ot = { value: "" }, kt = ["value"], At = { class: "kvc-form-field" }, jt = { class: "kvc-form-label" }, Mt = { class: "kvc-muted" }, Nt = { class: "kvc-form-field" }, Pt = { class: "kvc-form-label" }, Ft = { value: "" }, It = ["value"], Lt = { class: "kvc-form-field" }, Rt = { class: "kvc-form-label" }, zt = ["value"], Bt = { class: "kvc-muted" }, Vt = /* @__PURE__ */ c({
|
|
739
755
|
__name: "WorkerProgramFields",
|
|
740
756
|
props: /*@__PURE__*/ d({
|
|
741
757
|
minutesProblem: {},
|
|
@@ -746,10 +762,10 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
746
762
|
}),
|
|
747
763
|
emits: ["update:draft"],
|
|
748
764
|
setup(t) {
|
|
749
|
-
let n = T(t, "draft"), r = t, s =
|
|
765
|
+
let n = T(t, "draft"), r = t, s = G(), c = (e) => s.t(`kvcoder.config.workers.form.${e}`);
|
|
750
766
|
return (t, l) => (_(), i(e, null, [
|
|
751
|
-
a("fieldset",
|
|
752
|
-
a("legend",
|
|
767
|
+
a("fieldset", lt, [
|
|
768
|
+
a("legend", ut, C(c("approval")), 1),
|
|
753
769
|
(_(), i(e, null, b(["ask", "auto"], (e) => a("label", {
|
|
754
770
|
key: e,
|
|
755
771
|
class: "kvc-form-radio"
|
|
@@ -759,11 +775,11 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
759
775
|
name: "kvc-worker-approval",
|
|
760
776
|
value: e,
|
|
761
777
|
"data-test": `worker-approval-${e}`
|
|
762
|
-
}, null, 8,
|
|
763
|
-
r.approvalProblem === void 0 ? (_(), i("span",
|
|
778
|
+
}, null, 8, dt), [[O, n.value.approval]]), o(" " + C(c(`approval.${e}`)), 1)])), 64)),
|
|
779
|
+
r.approvalProblem === void 0 ? (_(), i("span", pt, C(c("approvalHint")), 1)) : (_(), i("span", ft, C(w(s).t(r.approvalProblem)), 1))
|
|
764
780
|
]),
|
|
765
|
-
a("label",
|
|
766
|
-
a("span",
|
|
781
|
+
a("label", mt, [
|
|
782
|
+
a("span", ht, C(c("minutes")), 1),
|
|
767
783
|
N(a("input", {
|
|
768
784
|
"onUpdate:modelValue": l[1] ||= (e) => n.value.minutes = e,
|
|
769
785
|
type: "text",
|
|
@@ -773,11 +789,11 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
773
789
|
autocomplete: "off",
|
|
774
790
|
"aria-invalid": r.minutesProblem !== void 0,
|
|
775
791
|
"data-test": "worker-minutes"
|
|
776
|
-
}, null, 8,
|
|
777
|
-
r.minutesProblem === void 0 ? (_(), i("span",
|
|
792
|
+
}, null, 8, gt), [[A, n.value.minutes]]),
|
|
793
|
+
r.minutesProblem === void 0 ? (_(), i("span", vt, C(c("minutesHint")), 1)) : (_(), i("span", _t, C(w(s).t(r.minutesProblem)), 1))
|
|
778
794
|
]),
|
|
779
|
-
a("label",
|
|
780
|
-
a("span",
|
|
795
|
+
a("label", yt, [
|
|
796
|
+
a("span", bt, C(c("model")), 1),
|
|
781
797
|
N(a("input", {
|
|
782
798
|
"onUpdate:modelValue": l[2] ||= (e) => n.value.programModel = e,
|
|
783
799
|
type: "text",
|
|
@@ -787,10 +803,10 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
787
803
|
autocomplete: "off",
|
|
788
804
|
"data-test": "worker-program-model"
|
|
789
805
|
}, null, 512), [[A, n.value.programModel]]),
|
|
790
|
-
a("span",
|
|
806
|
+
a("span", xt, C(c("programDefault")), 1)
|
|
791
807
|
]),
|
|
792
|
-
n.value.kind === "opencode" ? (_(), i(e, { key: 0 }, [a("label",
|
|
793
|
-
a("span",
|
|
808
|
+
n.value.kind === "opencode" ? (_(), i(e, { key: 0 }, [a("label", St, [
|
|
809
|
+
a("span", Ct, C(c("agent")), 1),
|
|
794
810
|
N(a("input", {
|
|
795
811
|
"onUpdate:modelValue": l[3] ||= (e) => n.value.agent = e,
|
|
796
812
|
type: "text",
|
|
@@ -800,20 +816,20 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
800
816
|
autocomplete: "off",
|
|
801
817
|
"data-test": "worker-agent"
|
|
802
818
|
}, null, 512), [[A, n.value.agent]]),
|
|
803
|
-
a("span",
|
|
804
|
-
]), a("label",
|
|
819
|
+
a("span", wt, C(c("programDefault")), 1)
|
|
820
|
+
]), a("label", Tt, [N(a("input", {
|
|
805
821
|
"onUpdate:modelValue": l[4] ||= (e) => n.value.autoApprove = e,
|
|
806
822
|
type: "checkbox",
|
|
807
823
|
"data-test": "worker-auto-approve"
|
|
808
|
-
}, null, 512), [[D, n.value.autoApprove]]), o(" " + C(c("autoApprove")), 1)])], 64)) : n.value.kind === "pi" ? (_(), i(e, { key: 1 }, [a("label",
|
|
824
|
+
}, null, 512), [[D, n.value.autoApprove]]), o(" " + C(c("autoApprove")), 1)])], 64)) : n.value.kind === "pi" ? (_(), i(e, { key: 1 }, [a("label", Et, [a("span", Dt, C(c("thinking")), 1), N(a("select", {
|
|
809
825
|
"onUpdate:modelValue": l[5] ||= (e) => n.value.piThinking = e,
|
|
810
826
|
class: "kvc-button",
|
|
811
827
|
"data-test": "worker-pi-thinking"
|
|
812
|
-
}, [a("option",
|
|
828
|
+
}, [a("option", Ot, C(c("programDefault")), 1), (_(!0), i(e, null, b(w(Te), (e) => (_(), i("option", {
|
|
813
829
|
key: e,
|
|
814
830
|
value: e
|
|
815
|
-
}, C(e), 9,
|
|
816
|
-
a("span",
|
|
831
|
+
}, C(e), 9, kt))), 128))], 512), [[k, n.value.piThinking]])]), a("label", At, [
|
|
832
|
+
a("span", jt, C(c("tools")), 1),
|
|
817
833
|
N(a("textarea", {
|
|
818
834
|
"onUpdate:modelValue": l[6] ||= (e) => n.value.tools = e,
|
|
819
835
|
dir: "ltr",
|
|
@@ -822,71 +838,71 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
822
838
|
spellcheck: "false",
|
|
823
839
|
"data-test": "worker-tools"
|
|
824
840
|
}, null, 512), [[A, n.value.tools]]),
|
|
825
|
-
a("span",
|
|
826
|
-
])], 64)) : (_(), i(e, { key: 2 }, [a("label",
|
|
841
|
+
a("span", Mt, C(c("toolsHint")), 1)
|
|
842
|
+
])], 64)) : (_(), i(e, { key: 2 }, [a("label", Nt, [a("span", Pt, C(c("effort")), 1), N(a("select", {
|
|
827
843
|
"onUpdate:modelValue": l[7] ||= (e) => n.value.effort = e,
|
|
828
844
|
class: "kvc-button",
|
|
829
845
|
"data-test": "worker-effort"
|
|
830
|
-
}, [a("option",
|
|
846
|
+
}, [a("option", Ft, C(c("programDefault")), 1), (_(!0), i(e, null, b(w(Ee), (e) => (_(), i("option", {
|
|
831
847
|
key: e,
|
|
832
848
|
value: e
|
|
833
|
-
}, C(e), 9,
|
|
834
|
-
a("span",
|
|
849
|
+
}, C(e), 9, It))), 128))], 512), [[k, n.value.effort]])]), a("label", Lt, [
|
|
850
|
+
a("span", Rt, C(c("permissionMode")), 1),
|
|
835
851
|
N(a("select", {
|
|
836
852
|
"onUpdate:modelValue": l[8] ||= (e) => n.value.permissionMode = e,
|
|
837
853
|
class: "kvc-button",
|
|
838
854
|
"data-test": "worker-permission-mode"
|
|
839
|
-
}, [(_(!0), i(e, null, b(w(
|
|
855
|
+
}, [(_(!0), i(e, null, b(w(De), (e) => (_(), i("option", {
|
|
840
856
|
key: e,
|
|
841
857
|
value: e
|
|
842
|
-
}, C(e), 9,
|
|
843
|
-
a("span",
|
|
858
|
+
}, C(e), 9, zt))), 128))], 512), [[k, n.value.permissionMode]]),
|
|
859
|
+
a("span", Bt, C(c("permissionModeHint")), 1)
|
|
844
860
|
])], 64))
|
|
845
861
|
], 64));
|
|
846
862
|
}
|
|
847
|
-
}),
|
|
863
|
+
}), Ht = {
|
|
848
864
|
class: "kvc-setting-title",
|
|
849
865
|
"data-test": "worker-form-title"
|
|
850
|
-
},
|
|
866
|
+
}, Ut = { class: "kvc-form-field" }, Wt = { class: "kvc-form-label" }, Gt = ["aria-invalid"], Kt = {
|
|
851
867
|
key: 0,
|
|
852
868
|
class: "kvc-form-error",
|
|
853
869
|
role: "alert",
|
|
854
870
|
"data-test": "worker-name-error"
|
|
855
|
-
},
|
|
871
|
+
}, qt = {
|
|
856
872
|
key: 1,
|
|
857
873
|
class: "kvc-muted"
|
|
858
|
-
},
|
|
874
|
+
}, Jt = { class: "kvc-form-field" }, Yt = { class: "kvc-form-label" }, Xt = ["aria-invalid"], Zt = {
|
|
859
875
|
key: 0,
|
|
860
876
|
class: "kvc-form-error",
|
|
861
877
|
role: "alert",
|
|
862
878
|
"data-test": "worker-description-error"
|
|
863
|
-
},
|
|
879
|
+
}, Qt = {
|
|
864
880
|
key: 1,
|
|
865
881
|
class: "kvc-muted"
|
|
866
|
-
},
|
|
882
|
+
}, $t = { class: "kvc-form-field" }, en = { class: "kvc-form-label" }, tn = ["value"], nn = { class: "kvc-muted" }, rn = { class: "kvc-form-field" }, an = { class: "kvc-form-label" }, on = ["aria-invalid"], sn = {
|
|
867
883
|
key: 0,
|
|
868
884
|
class: "kvc-form-error",
|
|
869
885
|
role: "alert",
|
|
870
886
|
"data-test": "worker-instructions-error"
|
|
871
|
-
},
|
|
887
|
+
}, cn = {
|
|
872
888
|
key: 1,
|
|
873
889
|
class: "kvc-muted"
|
|
874
|
-
},
|
|
890
|
+
}, ln = { class: "kvc-form-field" }, un = { class: "kvc-form-radio" }, dn = { class: "kvc-muted" }, fn = { class: "kvc-form-choice" }, pn = { class: "kvc-form-label" }, mn = { class: "kvc-form-radio" }, hn = ["checked"], gn = { class: "kvc-form-radio" }, _n = ["checked"], vn = [
|
|
875
891
|
"checked",
|
|
876
892
|
"data-test",
|
|
877
893
|
"onChange"
|
|
878
|
-
],
|
|
894
|
+
], yn = {
|
|
879
895
|
key: 1,
|
|
880
896
|
class: "kvc-form-error",
|
|
881
897
|
role: "alert",
|
|
882
898
|
"data-test": "worker-connectors-error"
|
|
883
|
-
},
|
|
899
|
+
}, bn = {
|
|
884
900
|
key: 2,
|
|
885
901
|
class: "kvc-muted"
|
|
886
|
-
},
|
|
902
|
+
}, xn = {
|
|
887
903
|
class: "kvc-form-field",
|
|
888
904
|
"data-test": "worker-model"
|
|
889
|
-
},
|
|
905
|
+
}, Sn = { class: "kvc-form-label" }, Cn = { class: "kvc-form-field" }, wn = { class: "kvc-form-label" }, Tn = { value: "" }, En = ["value"], Dn = { class: "kvc-actions" }, On = ["disabled"], kn = ["disabled"], An = /* @__PURE__ */ c({
|
|
890
906
|
__name: "WorkerForm",
|
|
891
907
|
props: {
|
|
892
908
|
entry: {},
|
|
@@ -895,11 +911,14 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
895
911
|
},
|
|
896
912
|
emits: ["save", "cancel"],
|
|
897
913
|
setup(c, { emit: l }) {
|
|
898
|
-
let u = c, d = l, f =
|
|
914
|
+
let u = c, d = l, f = G(), p = v(Pe(u.entry)), m = y({}), g = y([]), x = y([]), S = y([]), T = (e) => f.t(`kvcoder.config.workers.form.${e}`), E = u.entry !== void 0, O = [
|
|
899
915
|
"delegate",
|
|
900
916
|
"ask",
|
|
901
917
|
"execution-map"
|
|
902
|
-
], j = t(() => [...
|
|
918
|
+
], j = t(() => [...at.filter((e) => !O.includes(e)), ...S.value]), M = t(() => Se(g.value, x.value, p.model)), P = t(() => we(M.value, p.model));
|
|
919
|
+
function I(e) {
|
|
920
|
+
p.model = e, p.thinking !== "" && (p.thinking = xe(P.value, p.thinking));
|
|
921
|
+
}
|
|
903
922
|
h(async () => {
|
|
904
923
|
try {
|
|
905
924
|
let [e, t, n] = await Promise.all([
|
|
@@ -909,25 +928,25 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
909
928
|
]);
|
|
910
929
|
g.value = e, x.value = t, S.value = n.map((e) => e.name);
|
|
911
930
|
} catch (e) {
|
|
912
|
-
|
|
931
|
+
K(f, e);
|
|
913
932
|
}
|
|
914
933
|
});
|
|
915
|
-
function
|
|
934
|
+
function L(e, t) {
|
|
916
935
|
let n = t.target instanceof HTMLInputElement && t.target.checked;
|
|
917
936
|
p.connectors = n ? [...p.connectors, e] : p.connectors.filter((t) => t !== e);
|
|
918
937
|
}
|
|
919
|
-
function
|
|
920
|
-
m.value =
|
|
938
|
+
function R() {
|
|
939
|
+
m.value = Ve(p, u.taken), !(Object.keys(m.value).length > 0) && d("save", Fe(p, j.value));
|
|
921
940
|
}
|
|
922
941
|
return (t, c) => (_(), i("form", {
|
|
923
942
|
class: "kvc-form",
|
|
924
943
|
novalidate: "",
|
|
925
944
|
"data-test": "worker-form",
|
|
926
|
-
onSubmit: F(
|
|
945
|
+
onSubmit: F(R, ["prevent"])
|
|
927
946
|
}, [
|
|
928
|
-
a("span",
|
|
929
|
-
a("label",
|
|
930
|
-
a("span",
|
|
947
|
+
a("span", Ht, C(E ? w(f).t("kvcoder.config.workers.form.titleEdit", { name: p.name }) : T("titleNew")), 1),
|
|
948
|
+
a("label", Ut, [
|
|
949
|
+
a("span", Wt, C(T("name")), 1),
|
|
931
950
|
N(a("input", {
|
|
932
951
|
"onUpdate:modelValue": c[0] ||= (e) => p.name = e,
|
|
933
952
|
type: "text",
|
|
@@ -938,11 +957,11 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
938
957
|
autocomplete: "off",
|
|
939
958
|
"aria-invalid": m.value.name !== void 0,
|
|
940
959
|
"data-test": "worker-name"
|
|
941
|
-
}, null, 8,
|
|
942
|
-
m.value.name === void 0 ? (_(), i("span",
|
|
960
|
+
}, null, 8, Gt), [[A, p.name]]),
|
|
961
|
+
m.value.name === void 0 ? (_(), i("span", qt, C(T("nameHint")), 1)) : (_(), i("span", Kt, C(w(f).t(m.value.name)), 1))
|
|
943
962
|
]),
|
|
944
|
-
a("label",
|
|
945
|
-
a("span",
|
|
963
|
+
a("label", Jt, [
|
|
964
|
+
a("span", Yt, C(T("description")), 1),
|
|
946
965
|
N(a("input", {
|
|
947
966
|
"onUpdate:modelValue": c[1] ||= (e) => p.description = e,
|
|
948
967
|
type: "text",
|
|
@@ -951,24 +970,24 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
951
970
|
autocomplete: "off",
|
|
952
971
|
"aria-invalid": m.value.description !== void 0,
|
|
953
972
|
"data-test": "worker-description"
|
|
954
|
-
}, null, 8,
|
|
955
|
-
m.value.description === void 0 ? (_(), i("span",
|
|
973
|
+
}, null, 8, Xt), [[A, p.description]]),
|
|
974
|
+
m.value.description === void 0 ? (_(), i("span", Qt, C(T("descriptionHint")), 1)) : (_(), i("span", Zt, C(w(f).t(m.value.description)), 1))
|
|
956
975
|
]),
|
|
957
|
-
a("label",
|
|
958
|
-
a("span",
|
|
976
|
+
a("label", $t, [
|
|
977
|
+
a("span", en, C(T("kind")), 1),
|
|
959
978
|
N(a("select", {
|
|
960
979
|
"onUpdate:modelValue": c[2] ||= (e) => p.kind = e,
|
|
961
980
|
class: "kvc-button",
|
|
962
981
|
disabled: E,
|
|
963
982
|
"data-test": "worker-kind-select"
|
|
964
|
-
}, [(_(!0), i(e, null, b(w(
|
|
983
|
+
}, [(_(!0), i(e, null, b(w(Oe), (e) => (_(), i("option", {
|
|
965
984
|
key: e,
|
|
966
985
|
value: e
|
|
967
|
-
}, C(w(f).t(`kvcoder.config.workers.kind.${e}`)), 9,
|
|
968
|
-
a("span",
|
|
986
|
+
}, C(w(f).t(`kvcoder.config.workers.kind.${e}`)), 9, tn))), 128))], 512), [[k, p.kind]]),
|
|
987
|
+
a("span", nn, C(T("kindHint")), 1)
|
|
969
988
|
]),
|
|
970
|
-
a("label",
|
|
971
|
-
a("span",
|
|
989
|
+
a("label", rn, [
|
|
990
|
+
a("span", an, C(T("instructions")), 1),
|
|
972
991
|
N(a("textarea", {
|
|
973
992
|
"onUpdate:modelValue": c[3] ||= (e) => p.instructions = e,
|
|
974
993
|
dir: "auto",
|
|
@@ -976,31 +995,31 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
976
995
|
class: "kvc-field",
|
|
977
996
|
"aria-invalid": m.value.instructions !== void 0,
|
|
978
997
|
"data-test": "worker-instructions"
|
|
979
|
-
}, null, 8,
|
|
980
|
-
m.value.instructions === void 0 ? (_(), i("span",
|
|
998
|
+
}, null, 8, on), [[A, p.instructions]]),
|
|
999
|
+
m.value.instructions === void 0 ? (_(), i("span", cn, C(T("instructionsHint")), 1)) : (_(), i("span", sn, C(w(f).t(m.value.instructions)), 1))
|
|
981
1000
|
]),
|
|
982
1001
|
p.kind === "subagent" ? (_(), i(e, { key: 1 }, [
|
|
983
|
-
a("label",
|
|
1002
|
+
a("label", ln, [a("span", un, [N(a("input", {
|
|
984
1003
|
"onUpdate:modelValue": c[4] ||= (e) => p.readOnly = e,
|
|
985
1004
|
type: "checkbox",
|
|
986
1005
|
"data-test": "worker-read-only"
|
|
987
|
-
}, null, 512), [[D, p.readOnly]]), o(C(T("readOnly")), 1)]), a("span",
|
|
988
|
-
a("fieldset",
|
|
989
|
-
a("legend",
|
|
990
|
-
a("label",
|
|
1006
|
+
}, null, 512), [[D, p.readOnly]]), o(C(T("readOnly")), 1)]), a("span", dn, C(T("readOnlyHint")), 1)]),
|
|
1007
|
+
a("fieldset", fn, [
|
|
1008
|
+
a("legend", pn, C(T("connectors")), 1),
|
|
1009
|
+
a("label", mn, [a("input", {
|
|
991
1010
|
type: "radio",
|
|
992
1011
|
name: "kvc-worker-connectors",
|
|
993
1012
|
checked: p.all,
|
|
994
1013
|
"data-test": "worker-connectors-all",
|
|
995
1014
|
onChange: c[5] ||= (e) => p.all = !0
|
|
996
|
-
}, null, 40,
|
|
997
|
-
a("label",
|
|
1015
|
+
}, null, 40, hn), o(" " + C(T("connectors.all")), 1)]),
|
|
1016
|
+
a("label", gn, [a("input", {
|
|
998
1017
|
type: "radio",
|
|
999
1018
|
name: "kvc-worker-connectors",
|
|
1000
1019
|
checked: !p.all,
|
|
1001
1020
|
"data-test": "worker-connectors-some",
|
|
1002
1021
|
onChange: c[6] ||= (e) => p.all = !1
|
|
1003
|
-
}, null, 40,
|
|
1022
|
+
}, null, 40, _n), o(" " + C(T("connectors.some")), 1)]),
|
|
1004
1023
|
p.all ? r("v-if", !0) : (_(!0), i(e, { key: 0 }, b(j.value, (e) => (_(), i("label", {
|
|
1005
1024
|
key: e,
|
|
1006
1025
|
class: "kvc-form-radio kvc-mono"
|
|
@@ -1008,32 +1027,32 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
1008
1027
|
type: "checkbox",
|
|
1009
1028
|
checked: p.connectors.includes(e),
|
|
1010
1029
|
"data-test": `worker-connector-${e}`,
|
|
1011
|
-
onChange: (t) =>
|
|
1012
|
-
}, null, 40,
|
|
1013
|
-
m.value.connectors === void 0 ? (_(), i("span",
|
|
1030
|
+
onChange: (t) => L(e, t)
|
|
1031
|
+
}, null, 40, vn), o(" " + C(e), 1)]))), 128)),
|
|
1032
|
+
m.value.connectors === void 0 ? (_(), i("span", bn, C(T("connectorsHint")), 1)) : (_(), i("span", yn, C(w(f).t(m.value.connectors)), 1))
|
|
1014
1033
|
]),
|
|
1015
|
-
a("div",
|
|
1034
|
+
a("div", xn, [a("span", Sn, C(T("model")), 1), s(it, {
|
|
1016
1035
|
groups: M.value,
|
|
1017
1036
|
current: p.model,
|
|
1018
1037
|
empty: T("sameModel"),
|
|
1019
1038
|
none: T("sameModel"),
|
|
1020
|
-
onPick:
|
|
1021
|
-
onNone: c[
|
|
1039
|
+
onPick: I,
|
|
1040
|
+
onNone: c[7] ||= (e) => p.model = null
|
|
1022
1041
|
}, null, 8, [
|
|
1023
1042
|
"groups",
|
|
1024
1043
|
"current",
|
|
1025
1044
|
"empty",
|
|
1026
1045
|
"none"
|
|
1027
1046
|
])]),
|
|
1028
|
-
a("label",
|
|
1029
|
-
"onUpdate:modelValue": c[
|
|
1047
|
+
a("label", Cn, [a("span", wn, C(T("thinking")), 1), N(a("select", {
|
|
1048
|
+
"onUpdate:modelValue": c[8] ||= (e) => p.thinking = e,
|
|
1030
1049
|
class: "kvc-button",
|
|
1031
1050
|
"data-test": "worker-thinking"
|
|
1032
|
-
}, [a("option",
|
|
1051
|
+
}, [a("option", Tn, C(T("sameThinking")), 1), (_(!0), i(e, null, b(P.value, (e) => (_(), i("option", {
|
|
1033
1052
|
key: e,
|
|
1034
1053
|
value: e
|
|
1035
|
-
}, C(w(f).t(`kvcoder.ui.thinkingLevels.${e}`)), 9,
|
|
1036
|
-
], 64)) : (_(), n(
|
|
1054
|
+
}, C(w(f).t(`kvcoder.ui.thinkingLevels.${e}`)), 9, En))), 128))], 512), [[k, p.thinking]])])
|
|
1055
|
+
], 64)) : (_(), n(Vt, {
|
|
1037
1056
|
key: 0,
|
|
1038
1057
|
draft: p,
|
|
1039
1058
|
"minutes-problem": m.value.minutes,
|
|
@@ -1043,112 +1062,112 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
1043
1062
|
"minutes-problem",
|
|
1044
1063
|
"approval-problem"
|
|
1045
1064
|
])),
|
|
1046
|
-
a("div",
|
|
1065
|
+
a("div", Dn, [a("button", {
|
|
1047
1066
|
type: "button",
|
|
1048
1067
|
class: "kvc-button",
|
|
1049
1068
|
disabled: u.working,
|
|
1050
1069
|
"data-test": "worker-cancel",
|
|
1051
|
-
onClick: c[
|
|
1052
|
-
}, C(w(f).t("kvcoder.config.workers.cancel")), 9,
|
|
1070
|
+
onClick: c[9] ||= (e) => d("cancel")
|
|
1071
|
+
}, C(w(f).t("kvcoder.config.workers.cancel")), 9, On), a("button", {
|
|
1053
1072
|
type: "submit",
|
|
1054
1073
|
class: "kvc-button kvc-primary",
|
|
1055
1074
|
disabled: u.working,
|
|
1056
1075
|
"data-test": "worker-save"
|
|
1057
|
-
}, C(T("save")), 9,
|
|
1076
|
+
}, C(T("save")), 9, kn)])
|
|
1058
1077
|
], 32));
|
|
1059
1078
|
}
|
|
1060
|
-
}),
|
|
1079
|
+
}), jn = {
|
|
1061
1080
|
key: 1,
|
|
1062
1081
|
class: "kvc-dialog-rows",
|
|
1063
1082
|
"data-test": "workers"
|
|
1064
|
-
},
|
|
1083
|
+
}, Mn = { class: "kvc-muted" }, Nn = {
|
|
1065
1084
|
key: 0,
|
|
1066
1085
|
class: "kvc-muted",
|
|
1067
1086
|
"data-test": "workers-own-value"
|
|
1068
|
-
},
|
|
1087
|
+
}, Pn = {
|
|
1069
1088
|
key: 1,
|
|
1070
1089
|
class: "kvc-connectors-state"
|
|
1071
|
-
},
|
|
1090
|
+
}, Fn = {
|
|
1072
1091
|
class: "kvc-chip",
|
|
1073
1092
|
"data-test": "workers-changed"
|
|
1074
|
-
},
|
|
1093
|
+
}, In = ["disabled"], Ln = {
|
|
1075
1094
|
key: 2,
|
|
1076
1095
|
class: "kvc-muted",
|
|
1077
1096
|
"data-test": "workers-empty"
|
|
1078
|
-
},
|
|
1097
|
+
}, Rn = ["data-test"], zn = { class: "kvc-connector-text" }, Bn = {
|
|
1079
1098
|
class: "kvc-mono kvc-connector-name",
|
|
1080
1099
|
"data-test": "worker-name"
|
|
1081
|
-
},
|
|
1100
|
+
}, Vn = {
|
|
1082
1101
|
class: "kvc-muted",
|
|
1083
1102
|
dir: "auto",
|
|
1084
1103
|
"data-test": "worker-description"
|
|
1085
|
-
},
|
|
1104
|
+
}, Hn = {
|
|
1086
1105
|
class: "kvc-chip",
|
|
1087
1106
|
"data-test": "worker-kind"
|
|
1088
|
-
},
|
|
1107
|
+
}, Un = {
|
|
1089
1108
|
key: 0,
|
|
1090
1109
|
class: "kvc-server-state",
|
|
1091
1110
|
"data-status": "checking",
|
|
1092
1111
|
role: "status",
|
|
1093
1112
|
"data-test": "worker-state"
|
|
1094
|
-
},
|
|
1113
|
+
}, Wn = {
|
|
1095
1114
|
key: 1,
|
|
1096
1115
|
class: "kvc-server-state",
|
|
1097
1116
|
"data-status": "failed",
|
|
1098
1117
|
role: "status",
|
|
1099
1118
|
"data-test": "worker-state"
|
|
1100
|
-
},
|
|
1119
|
+
}, Gn = ["onClick"], Kn = ["aria-label"], qn = { class: "kvc-muted" }, Jn = ["disabled"], Yn = ["disabled", "onClick"], Xn = {
|
|
1101
1120
|
key: 1,
|
|
1102
1121
|
class: "kvc-connector-actions"
|
|
1103
|
-
},
|
|
1122
|
+
}, Zn = [
|
|
1104
1123
|
"disabled",
|
|
1105
1124
|
"aria-label",
|
|
1106
1125
|
"title",
|
|
1107
1126
|
"onClick"
|
|
1108
|
-
],
|
|
1127
|
+
], Qn = [
|
|
1109
1128
|
"disabled",
|
|
1110
1129
|
"aria-label",
|
|
1111
1130
|
"title",
|
|
1112
1131
|
"onClick"
|
|
1113
|
-
],
|
|
1132
|
+
], $n = [
|
|
1114
1133
|
"aria-checked",
|
|
1115
1134
|
"aria-label",
|
|
1116
1135
|
"disabled",
|
|
1117
1136
|
"onClick"
|
|
1118
|
-
],
|
|
1137
|
+
], er = { class: "kvc-actions" }, tr = ["disabled"], nr = /* @__PURE__ */ c({
|
|
1119
1138
|
__name: "DelegateWorkers",
|
|
1120
1139
|
setup(t) {
|
|
1121
|
-
let c =
|
|
1140
|
+
let c = G(), { workers: l, states: u, locked: d, changed: p, working: m, save: h, remove: g, toggle: v, reset: x, check: S } = He(c), T = y(), E = y(), D = (e) => c.t(`${e}.${c.scope.value}`, { name: c.workspace.value.name }), O = (e, t) => c.t(`kvcoder.config.workers.${e}`, { name: t });
|
|
1122
1141
|
async function k(e) {
|
|
1123
1142
|
await h(e) && (T.value = void 0, c.toast("kvcoder.config.workers.saved", { name: e.name }, "success"));
|
|
1124
1143
|
}
|
|
1125
1144
|
async function A(e) {
|
|
1126
1145
|
await g(e) && c.toast("kvcoder.config.workers.removed", { name: e }, "success"), E.value = void 0;
|
|
1127
1146
|
}
|
|
1128
|
-
return (t, h) => T.value === void 0 ? (_(), i("div",
|
|
1129
|
-
a("p",
|
|
1130
|
-
w(d) ? (_(), i("p",
|
|
1147
|
+
return (t, h) => T.value === void 0 ? (_(), i("div", jn, [
|
|
1148
|
+
a("p", Mn, C(w(c).t("kvcoder.config.workers.intro")), 1),
|
|
1149
|
+
w(d) ? (_(), i("p", Nn, C(w(c).t("kvcoder.config.connectors.ownValue", { name: w(c).workspace.value.name })), 1)) : w(p) ? (_(), i("div", Pn, [a("span", Fn, C(D("kvcoder.config.connectors.changed")), 1), a("button", {
|
|
1131
1150
|
type: "button",
|
|
1132
1151
|
class: "kvc-text-button",
|
|
1133
1152
|
disabled: w(m),
|
|
1134
1153
|
"data-test": "workers-reset",
|
|
1135
1154
|
onClick: h[1] ||= (...e) => w(x) && w(x)(...e)
|
|
1136
|
-
}, C(D("kvcoder.config.connectors.reset")), 9,
|
|
1137
|
-
w(l).length === 0 ? (_(), i("p",
|
|
1155
|
+
}, C(D("kvcoder.config.connectors.reset")), 9, In)])) : r("v-if", !0),
|
|
1156
|
+
w(l).length === 0 ? (_(), i("p", Ln, C(w(c).t("kvcoder.config.workers.empty")), 1)) : r("v-if", !0),
|
|
1138
1157
|
(_(!0), i(e, null, b(w(l), (e) => (_(), i("div", {
|
|
1139
1158
|
key: e.name,
|
|
1140
1159
|
class: "kvc-connector",
|
|
1141
1160
|
"data-test": `worker-${e.name}`
|
|
1142
|
-
}, [a("span",
|
|
1143
|
-
a("span",
|
|
1144
|
-
a("span",
|
|
1145
|
-
a("span", null, [a("span",
|
|
1146
|
-
w(u)[e.name] === "checking" ? (_(), i("span",
|
|
1161
|
+
}, [a("span", zn, [
|
|
1162
|
+
a("span", Bn, C(e.name), 1),
|
|
1163
|
+
a("span", Vn, C(e.description), 1),
|
|
1164
|
+
a("span", null, [a("span", Hn, C(w(c).t(`kvcoder.config.workers.kind.${e.kind}`)), 1)]),
|
|
1165
|
+
w(u)[e.name] === "checking" ? (_(), i("span", Un, C(w(c).t("kvcoder.config.workers.checking")), 1)) : w(u)[e.name] === "notFound" ? (_(), i("span", Wn, [o(C(w(c).t("kvcoder.config.workers.notFound", { program: e.kind })) + " ", 1), a("button", {
|
|
1147
1166
|
type: "button",
|
|
1148
1167
|
class: "kvc-text-button",
|
|
1149
1168
|
"data-test": "worker-check",
|
|
1150
1169
|
onClick: (t) => w(S)(e.name)
|
|
1151
|
-
}, C(w(c).t("kvcoder.config.workers.recheck")), 9,
|
|
1170
|
+
}, C(w(c).t("kvcoder.config.workers.recheck")), 9, Gn)])) : r("v-if", !0)
|
|
1152
1171
|
]), E.value === e.name ? (_(), i("span", {
|
|
1153
1172
|
key: 0,
|
|
1154
1173
|
class: "kvc-connector-actions",
|
|
@@ -1156,22 +1175,22 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
1156
1175
|
"aria-label": O("removeConfirm", e.name),
|
|
1157
1176
|
"data-test": "worker-remove-confirm"
|
|
1158
1177
|
}, [
|
|
1159
|
-
a("span",
|
|
1178
|
+
a("span", qn, C(O("removeConfirm", e.name)), 1),
|
|
1160
1179
|
a("button", {
|
|
1161
1180
|
type: "button",
|
|
1162
1181
|
class: "kvc-button",
|
|
1163
1182
|
disabled: w(m),
|
|
1164
1183
|
"data-test": "worker-remove-cancel",
|
|
1165
1184
|
onClick: h[2] ||= (e) => E.value = void 0
|
|
1166
|
-
}, C(w(c).t("kvcoder.config.workers.cancel")), 9,
|
|
1185
|
+
}, C(w(c).t("kvcoder.config.workers.cancel")), 9, Jn),
|
|
1167
1186
|
a("button", {
|
|
1168
1187
|
type: "button",
|
|
1169
1188
|
class: "kvc-button kvc-danger",
|
|
1170
1189
|
disabled: w(m),
|
|
1171
1190
|
"data-test": "worker-remove-yes",
|
|
1172
1191
|
onClick: (t) => A(e.name)
|
|
1173
|
-
}, C(w(c).t("kvcoder.config.workers.removeYes")), 9,
|
|
1174
|
-
], 8,
|
|
1192
|
+
}, C(w(c).t("kvcoder.config.workers.removeYes")), 9, Yn)
|
|
1193
|
+
], 8, Kn)) : (_(), i("span", Xn, [
|
|
1175
1194
|
a("button", {
|
|
1176
1195
|
type: "button",
|
|
1177
1196
|
class: "kvc-button kvc-ghost kvc-icon-button",
|
|
@@ -1180,10 +1199,10 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
1180
1199
|
title: O("edit", e.name),
|
|
1181
1200
|
"data-test": "worker-edit",
|
|
1182
1201
|
onClick: (t) => T.value = { entry: e }
|
|
1183
|
-
}, [s(w(
|
|
1202
|
+
}, [s(w(H), {
|
|
1184
1203
|
size: 16,
|
|
1185
1204
|
"aria-hidden": "true"
|
|
1186
|
-
})], 8,
|
|
1205
|
+
})], 8, Zn),
|
|
1187
1206
|
a("button", {
|
|
1188
1207
|
type: "button",
|
|
1189
1208
|
class: "kvc-button kvc-ghost kvc-icon-button",
|
|
@@ -1192,10 +1211,10 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
1192
1211
|
title: O("remove", e.name),
|
|
1193
1212
|
"data-test": "worker-remove",
|
|
1194
1213
|
onClick: (t) => E.value = e.name
|
|
1195
|
-
}, [s(w(
|
|
1214
|
+
}, [s(w(ce), {
|
|
1196
1215
|
size: 16,
|
|
1197
1216
|
"aria-hidden": "true"
|
|
1198
|
-
})], 8,
|
|
1217
|
+
})], 8, Qn),
|
|
1199
1218
|
a("button", {
|
|
1200
1219
|
type: "button",
|
|
1201
1220
|
role: "switch",
|
|
@@ -1208,31 +1227,31 @@ var ot = { class: "kvc-form-choice" }, st = { class: "kvc-form-label" }, ct = ["
|
|
|
1208
1227
|
}, [...h[4] ||= [a("span", {
|
|
1209
1228
|
class: "kvc-switch-knob",
|
|
1210
1229
|
"aria-hidden": "true"
|
|
1211
|
-
}, null, -1)]], 8,
|
|
1212
|
-
]))], 8,
|
|
1213
|
-
a("div",
|
|
1230
|
+
}, null, -1)]], 8, $n)
|
|
1231
|
+
]))], 8, Rn))), 128)),
|
|
1232
|
+
a("div", er, [a("button", {
|
|
1214
1233
|
type: "button",
|
|
1215
1234
|
class: "kvc-button kvc-primary",
|
|
1216
1235
|
disabled: w(d) || w(m),
|
|
1217
1236
|
"data-test": "worker-add",
|
|
1218
1237
|
onClick: h[3] ||= (e) => T.value = {}
|
|
1219
|
-
}, [s(w(
|
|
1238
|
+
}, [s(w(U), {
|
|
1220
1239
|
size: 16,
|
|
1221
1240
|
"aria-hidden": "true"
|
|
1222
|
-
}), o(C(w(c).t("kvcoder.config.workers.add")), 1)], 8,
|
|
1223
|
-
])) : (_(), n(
|
|
1241
|
+
}), o(C(w(c).t("kvcoder.config.workers.add")), 1)], 8, tr)])
|
|
1242
|
+
])) : (_(), n(An, f({ key: 0 }, T.value.entry === void 0 ? {} : { entry: T.value.entry }, {
|
|
1224
1243
|
taken: w(l).filter((e) => e.name !== T.value?.entry?.name).map((e) => e.name),
|
|
1225
1244
|
working: w(m),
|
|
1226
1245
|
onSave: k,
|
|
1227
1246
|
onCancel: h[0] ||= (e) => T.value = void 0
|
|
1228
1247
|
}), null, 16, ["taken", "working"]));
|
|
1229
1248
|
}
|
|
1230
|
-
}),
|
|
1231
|
-
function
|
|
1232
|
-
return typeof e != "object" || !e || !("name" in e) || !("description" in e) || typeof e.name != "string" || typeof e.description != "string" ? !1 : "command" in e ? typeof e.command == "string" && "args" in e &&
|
|
1249
|
+
}), Q = "@kvman/kvcoder", rr = (e) => Array.isArray(e) && e.every((e) => typeof e == "string");
|
|
1250
|
+
function ir(e) {
|
|
1251
|
+
return typeof e != "object" || !e || !("name" in e) || !("description" in e) || typeof e.name != "string" || typeof e.description != "string" ? !1 : "command" in e ? typeof e.command == "string" && "args" in e && rr(e.args) && "env" in e && rr(e.env) : "url" in e && typeof e.url == "string" && "headers" in e && rr(e.headers);
|
|
1233
1252
|
}
|
|
1234
|
-
var
|
|
1235
|
-
function
|
|
1253
|
+
var ar = (e) => Array.isArray(e) ? e.filter(ir) : [], or = (e, t, n) => `mcp.${e}.${t}.${n}`, $ = (e) => `mcp.${e}.`, sr = (e) => e.kind === "command" ? "env" : "header";
|
|
1254
|
+
function cr(e, t) {
|
|
1236
1255
|
if (e === void 0) return {
|
|
1237
1256
|
name: "",
|
|
1238
1257
|
description: "",
|
|
@@ -1245,7 +1264,7 @@ function or(e, t) {
|
|
|
1245
1264
|
let [n, r] = "command" in e ? ["env", e.env] : ["header", e.headers], i = r.map((r) => ({
|
|
1246
1265
|
name: r,
|
|
1247
1266
|
value: "",
|
|
1248
|
-
set: t.includes(
|
|
1267
|
+
set: t.includes(or(e.name, n, r)),
|
|
1249
1268
|
replacing: !1
|
|
1250
1269
|
}));
|
|
1251
1270
|
return "command" in e ? {
|
|
@@ -1266,7 +1285,7 @@ function or(e, t) {
|
|
|
1266
1285
|
values: i
|
|
1267
1286
|
};
|
|
1268
1287
|
}
|
|
1269
|
-
function
|
|
1288
|
+
function lr(e) {
|
|
1270
1289
|
let t = {
|
|
1271
1290
|
name: e.name.trim(),
|
|
1272
1291
|
description: e.description.trim()
|
|
@@ -1282,25 +1301,25 @@ function sr(e) {
|
|
|
1282
1301
|
env: n
|
|
1283
1302
|
};
|
|
1284
1303
|
}
|
|
1285
|
-
var
|
|
1304
|
+
var ur = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/, dr = {
|
|
1286
1305
|
env: /^[A-Za-z_][A-Za-z0-9_]*$/,
|
|
1287
1306
|
header: /^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/
|
|
1288
|
-
},
|
|
1289
|
-
function
|
|
1290
|
-
let t =
|
|
1291
|
-
return n.some((e) => !
|
|
1307
|
+
}, fr = (e) => URL.canParse(e) && ["http:", "https:"].includes(new URL(e).protocol);
|
|
1308
|
+
function pr(e) {
|
|
1309
|
+
let t = sr(e), n = e.values.map((e) => e.name.trim());
|
|
1310
|
+
return n.some((e) => !dr[t].test(e)) ? `kvcoder.config.mcp.invalid.valueName.${t}` : new Set(n).size === n.length ? e.values.some((e) => (!e.set || e.replacing) && e.value === "") ? "kvcoder.config.mcp.invalid.valueEmpty" : void 0 : "kvcoder.config.mcp.invalid.valueRepeated";
|
|
1292
1311
|
}
|
|
1293
|
-
function
|
|
1312
|
+
function mr(e, t) {
|
|
1294
1313
|
let n = e.name.trim(), r = {};
|
|
1295
|
-
n === "" ? r.name = "kvcoder.config.mcp.invalid.nameEmpty" :
|
|
1296
|
-
let i =
|
|
1314
|
+
n === "" ? r.name = "kvcoder.config.mcp.invalid.nameEmpty" : ur.test(n) ? t.includes(n) && (r.name = "kvcoder.config.mcp.invalid.nameTaken") : r.name = "kvcoder.config.mcp.invalid.nameShape", e.description.trim() === "" && (r.description = "kvcoder.config.mcp.invalid.descriptionEmpty"), e.kind === "command" && e.command.trim() === "" && (r.command = "kvcoder.config.mcp.invalid.commandEmpty"), e.kind === "url" && !fr(e.url.trim()) && (r.url = "kvcoder.config.mcp.invalid.url");
|
|
1315
|
+
let i = pr(e);
|
|
1297
1316
|
return i !== void 0 && (r.values = i), r;
|
|
1298
1317
|
}
|
|
1299
|
-
function
|
|
1318
|
+
function hr(e, t) {
|
|
1300
1319
|
return t === void 0 ? !1 : "command" in t ? e.kind !== "command" || e.command.trim() !== t.command || e.args.split("\n").map((e) => e.trim()).filter((e) => e !== "").join("\n") !== t.args.join("\n") : e.kind !== "url" || e.url.trim() !== t.url;
|
|
1301
1320
|
}
|
|
1302
|
-
function
|
|
1303
|
-
let r = e.name.trim(), i =
|
|
1321
|
+
function gr(e, t, n) {
|
|
1322
|
+
let r = e.name.trim(), i = sr(e), a = new Set(e.values.map((e) => or(r, i, e.name.trim()))), o = Object.fromEntries(e.values.filter((e) => !e.set || e.replacing).map((e) => [or(r, i, e.name.trim()), e.value])), s = t === void 0 ? [] : n.filter((e) => e.startsWith(`${$(r)}env.`) || e.startsWith(`${$(r)}header.`)), c = hr(e, t) ? n.filter((e) => e.startsWith(`${$(r)}oauth.`)) : [];
|
|
1304
1323
|
return {
|
|
1305
1324
|
set: o,
|
|
1306
1325
|
remove: [...s.filter((e) => !a.has(e)), ...c]
|
|
@@ -1308,75 +1327,75 @@ function mr(e, t, n) {
|
|
|
1308
1327
|
}
|
|
1309
1328
|
//#endregion
|
|
1310
1329
|
//#region web/src/McpServerForm.vue?vue&type=script&setup=true&lang.ts
|
|
1311
|
-
var
|
|
1330
|
+
var _r = {
|
|
1312
1331
|
class: "kvc-setting-title",
|
|
1313
1332
|
"data-test": "mcp-form-title"
|
|
1314
|
-
},
|
|
1333
|
+
}, vr = { class: "kvc-form-field" }, yr = { class: "kvc-form-label" }, br = ["aria-invalid"], xr = {
|
|
1315
1334
|
key: 0,
|
|
1316
1335
|
class: "kvc-form-error",
|
|
1317
1336
|
role: "alert",
|
|
1318
1337
|
"data-test": "mcp-name-error"
|
|
1319
|
-
},
|
|
1338
|
+
}, Sr = {
|
|
1320
1339
|
key: 1,
|
|
1321
1340
|
class: "kvc-muted"
|
|
1322
|
-
},
|
|
1341
|
+
}, Cr = { class: "kvc-form-field" }, wr = { class: "kvc-form-label" }, Tr = ["aria-invalid"], Er = {
|
|
1323
1342
|
key: 0,
|
|
1324
1343
|
class: "kvc-form-error",
|
|
1325
1344
|
role: "alert",
|
|
1326
1345
|
"data-test": "mcp-description-error"
|
|
1327
|
-
},
|
|
1346
|
+
}, Dr = {
|
|
1328
1347
|
key: 1,
|
|
1329
1348
|
class: "kvc-muted"
|
|
1330
|
-
},
|
|
1349
|
+
}, Or = { class: "kvc-form-choice" }, kr = { class: "kvc-form-label" }, Ar = [
|
|
1331
1350
|
"value",
|
|
1332
1351
|
"checked",
|
|
1333
1352
|
"data-test",
|
|
1334
1353
|
"onChange"
|
|
1335
|
-
],
|
|
1354
|
+
], jr = { class: "kvc-form-field" }, Mr = { class: "kvc-form-label" }, Nr = ["aria-invalid"], Pr = {
|
|
1336
1355
|
key: 0,
|
|
1337
1356
|
class: "kvc-form-error",
|
|
1338
1357
|
role: "alert",
|
|
1339
1358
|
"data-test": "mcp-command-error"
|
|
1340
|
-
},
|
|
1359
|
+
}, Fr = {
|
|
1341
1360
|
key: 1,
|
|
1342
1361
|
class: "kvc-muted"
|
|
1343
|
-
},
|
|
1362
|
+
}, Ir = { class: "kvc-form-field" }, Lr = { class: "kvc-form-label" }, Rr = { class: "kvc-muted" }, zr = {
|
|
1344
1363
|
key: 1,
|
|
1345
1364
|
class: "kvc-form-field"
|
|
1346
|
-
},
|
|
1365
|
+
}, Br = { class: "kvc-form-label" }, Vr = ["aria-invalid"], Hr = {
|
|
1347
1366
|
key: 0,
|
|
1348
1367
|
class: "kvc-form-error",
|
|
1349
1368
|
role: "alert",
|
|
1350
1369
|
"data-test": "mcp-url-error"
|
|
1351
|
-
},
|
|
1370
|
+
}, Ur = {
|
|
1352
1371
|
class: "kvc-form-field",
|
|
1353
1372
|
"data-test": "mcp-values"
|
|
1354
|
-
},
|
|
1373
|
+
}, Wr = { class: "kvc-form-label" }, Gr = { class: "kvc-muted" }, Kr = {
|
|
1355
1374
|
key: 0,
|
|
1356
1375
|
class: "kvc-muted",
|
|
1357
1376
|
role: "status",
|
|
1358
1377
|
"data-test": "mcp-moved"
|
|
1359
|
-
},
|
|
1378
|
+
}, qr = [
|
|
1360
1379
|
"onUpdate:modelValue",
|
|
1361
1380
|
"disabled",
|
|
1362
1381
|
"placeholder",
|
|
1363
1382
|
"aria-label"
|
|
1364
|
-
],
|
|
1383
|
+
], Jr = {
|
|
1365
1384
|
key: 0,
|
|
1366
1385
|
class: "kvc-form-set"
|
|
1367
|
-
},
|
|
1386
|
+
}, Yr = {
|
|
1368
1387
|
class: "kvc-chip",
|
|
1369
1388
|
"data-test": "mcp-value-set"
|
|
1370
|
-
},
|
|
1389
|
+
}, Xr = ["onClick"], Zr = [
|
|
1371
1390
|
"onUpdate:modelValue",
|
|
1372
1391
|
"placeholder",
|
|
1373
1392
|
"aria-label"
|
|
1374
|
-
],
|
|
1393
|
+
], Qr = ["aria-label", "onClick"], $r = {
|
|
1375
1394
|
key: 1,
|
|
1376
1395
|
class: "kvc-form-error",
|
|
1377
1396
|
role: "alert",
|
|
1378
1397
|
"data-test": "mcp-values-error"
|
|
1379
|
-
},
|
|
1398
|
+
}, ei = { class: "kvc-actions" }, ti = ["disabled"], ni = ["disabled"], ri = /* @__PURE__ */ c({
|
|
1380
1399
|
__name: "McpServerForm",
|
|
1381
1400
|
props: {
|
|
1382
1401
|
entry: {},
|
|
@@ -1386,13 +1405,13 @@ var hr = {
|
|
|
1386
1405
|
},
|
|
1387
1406
|
emits: ["save", "cancel"],
|
|
1388
1407
|
setup(n, { emit: c }) {
|
|
1389
|
-
let l = n, u = c, d =
|
|
1408
|
+
let l = n, u = c, d = G(), f = v(cr(l.entry, l.secrets)), p = y({}), m = t(() => sr(f)), h = (e) => d.t(`kvcoder.config.mcp.form.${e}`), g = t(() => hr(f, l.entry));
|
|
1390
1409
|
j(g, (e) => {
|
|
1391
1410
|
if (e) for (let e of f.values) e.set && (e.replacing = !0);
|
|
1392
1411
|
});
|
|
1393
1412
|
let x = l.entry !== void 0;
|
|
1394
1413
|
function S() {
|
|
1395
|
-
p.value =
|
|
1414
|
+
p.value = mr(f, l.taken), !(Object.keys(p.value).length > 0) && u("save", lr(f), gr(f, l.entry, l.secrets));
|
|
1396
1415
|
}
|
|
1397
1416
|
function T(e) {
|
|
1398
1417
|
f.kind !== e && (f.kind = e, f.values = []);
|
|
@@ -1403,9 +1422,9 @@ var hr = {
|
|
|
1403
1422
|
"data-test": "mcp-form",
|
|
1404
1423
|
onSubmit: F(S, ["prevent"])
|
|
1405
1424
|
}, [
|
|
1406
|
-
a("span",
|
|
1407
|
-
a("label",
|
|
1408
|
-
a("span",
|
|
1425
|
+
a("span", _r, C(x ? w(d).t("kvcoder.config.mcp.form.titleEdit", { name: f.name }) : h("titleNew")), 1),
|
|
1426
|
+
a("label", vr, [
|
|
1427
|
+
a("span", yr, C(h("name")), 1),
|
|
1409
1428
|
N(a("input", {
|
|
1410
1429
|
"onUpdate:modelValue": n[0] ||= (e) => f.name = e,
|
|
1411
1430
|
type: "text",
|
|
@@ -1416,11 +1435,11 @@ var hr = {
|
|
|
1416
1435
|
autocomplete: "off",
|
|
1417
1436
|
"aria-invalid": p.value.name !== void 0,
|
|
1418
1437
|
"data-test": "mcp-name"
|
|
1419
|
-
}, null, 8,
|
|
1420
|
-
p.value.name === void 0 ? (_(), i("span",
|
|
1438
|
+
}, null, 8, br), [[A, f.name]]),
|
|
1439
|
+
p.value.name === void 0 ? (_(), i("span", Sr, C(h("nameHint")), 1)) : (_(), i("span", xr, C(w(d).t(p.value.name)), 1))
|
|
1421
1440
|
]),
|
|
1422
|
-
a("label",
|
|
1423
|
-
a("span",
|
|
1441
|
+
a("label", Cr, [
|
|
1442
|
+
a("span", wr, C(h("description")), 1),
|
|
1424
1443
|
N(a("input", {
|
|
1425
1444
|
"onUpdate:modelValue": n[1] ||= (e) => f.description = e,
|
|
1426
1445
|
type: "text",
|
|
@@ -1429,10 +1448,10 @@ var hr = {
|
|
|
1429
1448
|
autocomplete: "off",
|
|
1430
1449
|
"aria-invalid": p.value.description !== void 0,
|
|
1431
1450
|
"data-test": "mcp-description"
|
|
1432
|
-
}, null, 8,
|
|
1433
|
-
p.value.description === void 0 ? (_(), i("span",
|
|
1451
|
+
}, null, 8, Tr), [[A, f.description]]),
|
|
1452
|
+
p.value.description === void 0 ? (_(), i("span", Dr, C(h("descriptionHint")), 1)) : (_(), i("span", Er, C(w(d).t(p.value.description)), 1))
|
|
1434
1453
|
]),
|
|
1435
|
-
a("fieldset",
|
|
1454
|
+
a("fieldset", Or, [a("legend", kr, C(h("kind")), 1), (_(), i(e, null, b(["command", "url"], (e) => a("label", {
|
|
1436
1455
|
key: e,
|
|
1437
1456
|
class: "kvc-form-radio"
|
|
1438
1457
|
}, [a("input", {
|
|
@@ -1442,9 +1461,9 @@ var hr = {
|
|
|
1442
1461
|
checked: f.kind === e,
|
|
1443
1462
|
"data-test": `mcp-kind-${e}`,
|
|
1444
1463
|
onChange: (t) => T(e)
|
|
1445
|
-
}, null, 40,
|
|
1446
|
-
f.kind === "command" ? (_(), i(e, { key: 0 }, [a("label",
|
|
1447
|
-
a("span",
|
|
1464
|
+
}, null, 40, Ar), o(" " + C(h(`kind.${e}`)), 1)])), 64))]),
|
|
1465
|
+
f.kind === "command" ? (_(), i(e, { key: 0 }, [a("label", jr, [
|
|
1466
|
+
a("span", Mr, C(h("command")), 1),
|
|
1448
1467
|
N(a("input", {
|
|
1449
1468
|
"onUpdate:modelValue": n[2] ||= (e) => f.command = e,
|
|
1450
1469
|
type: "text",
|
|
@@ -1454,10 +1473,10 @@ var hr = {
|
|
|
1454
1473
|
autocomplete: "off",
|
|
1455
1474
|
"aria-invalid": p.value.command !== void 0,
|
|
1456
1475
|
"data-test": "mcp-command"
|
|
1457
|
-
}, null, 8,
|
|
1458
|
-
p.value.command === void 0 ? (_(), i("span",
|
|
1459
|
-
]), a("label",
|
|
1460
|
-
a("span",
|
|
1476
|
+
}, null, 8, Nr), [[A, f.command]]),
|
|
1477
|
+
p.value.command === void 0 ? (_(), i("span", Fr, C(h("commandHint")), 1)) : (_(), i("span", Pr, C(w(d).t(p.value.command)), 1))
|
|
1478
|
+
]), a("label", Ir, [
|
|
1479
|
+
a("span", Lr, C(h("args")), 1),
|
|
1461
1480
|
N(a("textarea", {
|
|
1462
1481
|
"onUpdate:modelValue": n[3] ||= (e) => f.args = e,
|
|
1463
1482
|
dir: "ltr",
|
|
@@ -1466,9 +1485,9 @@ var hr = {
|
|
|
1466
1485
|
spellcheck: "false",
|
|
1467
1486
|
"data-test": "mcp-args"
|
|
1468
1487
|
}, null, 512), [[A, f.args]]),
|
|
1469
|
-
a("span",
|
|
1470
|
-
])], 64)) : (_(), i("label",
|
|
1471
|
-
a("span",
|
|
1488
|
+
a("span", Rr, C(h("argsHint")), 1)
|
|
1489
|
+
])], 64)) : (_(), i("label", zr, [
|
|
1490
|
+
a("span", Br, C(h("url")), 1),
|
|
1472
1491
|
N(a("input", {
|
|
1473
1492
|
"onUpdate:modelValue": n[4] ||= (e) => f.url = e,
|
|
1474
1493
|
type: "url",
|
|
@@ -1479,13 +1498,13 @@ var hr = {
|
|
|
1479
1498
|
placeholder: "https://",
|
|
1480
1499
|
"aria-invalid": p.value.url !== void 0,
|
|
1481
1500
|
"data-test": "mcp-url"
|
|
1482
|
-
}, null, 8,
|
|
1483
|
-
p.value.url === void 0 ? r("v-if", !0) : (_(), i("span",
|
|
1501
|
+
}, null, 8, Vr), [[A, f.url]]),
|
|
1502
|
+
p.value.url === void 0 ? r("v-if", !0) : (_(), i("span", Hr, C(w(d).t(p.value.url)), 1))
|
|
1484
1503
|
])),
|
|
1485
|
-
a("div",
|
|
1486
|
-
a("span",
|
|
1487
|
-
a("span",
|
|
1488
|
-
g.value ? (_(), i("span",
|
|
1504
|
+
a("div", Ur, [
|
|
1505
|
+
a("span", Wr, C(h(m.value)), 1),
|
|
1506
|
+
a("span", Gr, C(h("secretsHint")), 1),
|
|
1507
|
+
g.value ? (_(), i("span", Kr, C(h("moved")), 1)) : r("v-if", !0),
|
|
1489
1508
|
(_(!0), i(e, null, b(f.values, (e, t) => (_(), i("div", {
|
|
1490
1509
|
key: t,
|
|
1491
1510
|
class: "kvc-form-value",
|
|
@@ -1502,13 +1521,13 @@ var hr = {
|
|
|
1502
1521
|
spellcheck: "false",
|
|
1503
1522
|
autocomplete: "off",
|
|
1504
1523
|
"data-test": "mcp-value-name"
|
|
1505
|
-
}, null, 8,
|
|
1506
|
-
e.set && !e.replacing ? (_(), i("span",
|
|
1524
|
+
}, null, 8, qr), [[A, e.name]]),
|
|
1525
|
+
e.set && !e.replacing ? (_(), i("span", Jr, [a("span", Yr, C(h("set")), 1), a("button", {
|
|
1507
1526
|
type: "button",
|
|
1508
1527
|
class: "kvc-text-button",
|
|
1509
1528
|
"data-test": "mcp-value-replace",
|
|
1510
1529
|
onClick: (t) => e.replacing = !0
|
|
1511
|
-
}, C(h("replace")), 9,
|
|
1530
|
+
}, C(h("replace")), 9, Xr)])) : N((_(), i("input", {
|
|
1512
1531
|
key: 1,
|
|
1513
1532
|
"onUpdate:modelValue": (t) => e.value = t,
|
|
1514
1533
|
type: "password",
|
|
@@ -1517,19 +1536,19 @@ var hr = {
|
|
|
1517
1536
|
placeholder: h("value"),
|
|
1518
1537
|
"aria-label": w(d).t("kvcoder.config.mcp.form.valueOf", { name: e.name }),
|
|
1519
1538
|
"data-test": "mcp-value-secret"
|
|
1520
|
-
}, null, 8,
|
|
1539
|
+
}, null, 8, Zr)), [[A, e.value]]),
|
|
1521
1540
|
a("button", {
|
|
1522
1541
|
type: "button",
|
|
1523
1542
|
class: "kvc-button kvc-ghost kvc-icon-button",
|
|
1524
1543
|
"aria-label": w(d).t("kvcoder.config.mcp.form.removeValue", { name: e.name }),
|
|
1525
1544
|
"data-test": "mcp-value-remove",
|
|
1526
1545
|
onClick: (e) => f.values.splice(t, 1)
|
|
1527
|
-
}, [s(w(
|
|
1546
|
+
}, [s(w(le), {
|
|
1528
1547
|
size: 16,
|
|
1529
1548
|
"aria-hidden": "true"
|
|
1530
|
-
})], 8,
|
|
1549
|
+
})], 8, Qr)
|
|
1531
1550
|
]))), 128)),
|
|
1532
|
-
p.value.values === void 0 ? r("v-if", !0) : (_(), i("span",
|
|
1551
|
+
p.value.values === void 0 ? r("v-if", !0) : (_(), i("span", $r, C(w(d).t(p.value.values)), 1)),
|
|
1533
1552
|
a("button", {
|
|
1534
1553
|
type: "button",
|
|
1535
1554
|
class: "kvc-text-button kvc-form-add",
|
|
@@ -1540,31 +1559,31 @@ var hr = {
|
|
|
1540
1559
|
set: !1,
|
|
1541
1560
|
replacing: !1
|
|
1542
1561
|
})
|
|
1543
|
-
}, [s(w(
|
|
1562
|
+
}, [s(w(U), {
|
|
1544
1563
|
size: 14,
|
|
1545
1564
|
"aria-hidden": "true"
|
|
1546
1565
|
}), o(C(h(`add.${m.value}`)), 1)])
|
|
1547
1566
|
]),
|
|
1548
|
-
a("div",
|
|
1567
|
+
a("div", ei, [a("button", {
|
|
1549
1568
|
type: "button",
|
|
1550
1569
|
class: "kvc-button",
|
|
1551
1570
|
disabled: l.working,
|
|
1552
1571
|
"data-test": "mcp-cancel",
|
|
1553
1572
|
onClick: n[6] ||= (e) => u("cancel")
|
|
1554
|
-
}, C(w(d).t("kvcoder.config.mcp.cancel")), 9,
|
|
1573
|
+
}, C(w(d).t("kvcoder.config.mcp.cancel")), 9, ti), a("button", {
|
|
1555
1574
|
type: "submit",
|
|
1556
1575
|
class: "kvc-button kvc-primary",
|
|
1557
1576
|
disabled: l.working,
|
|
1558
1577
|
"data-test": "mcp-save"
|
|
1559
|
-
}, C(h("save")), 9,
|
|
1578
|
+
}, C(h("save")), 9, ni)])
|
|
1560
1579
|
], 32));
|
|
1561
1580
|
}
|
|
1562
1581
|
});
|
|
1563
1582
|
//#endregion
|
|
1564
1583
|
//#region web/src/use-mcp-servers.ts
|
|
1565
|
-
function
|
|
1566
|
-
let n =
|
|
1567
|
-
a.value = (await e.exec("kernel.secrets.list", {})).filter((e) => e.extension ===
|
|
1584
|
+
function ii(e) {
|
|
1585
|
+
let n = q(e, "kvcoder.mcp.servers"), r = t(() => ar(n.value.value)), i = y({}), a = y([]), o = y(!1), s = /* @__PURE__ */ new Set(), c = async () => {
|
|
1586
|
+
a.value = (await e.exec("kernel.secrets.list", {})).filter((e) => e.extension === Q).map((e) => e.name);
|
|
1568
1587
|
};
|
|
1569
1588
|
async function l(t) {
|
|
1570
1589
|
i.value = {
|
|
@@ -1578,13 +1597,13 @@ function ni(e) {
|
|
|
1578
1597
|
status: "failed",
|
|
1579
1598
|
problem: {
|
|
1580
1599
|
code: r.problem.code,
|
|
1581
|
-
params:
|
|
1600
|
+
params: pe(r.problem.params)
|
|
1582
1601
|
}
|
|
1583
1602
|
} : r;
|
|
1584
1603
|
} catch (e) {
|
|
1585
1604
|
n = {
|
|
1586
1605
|
status: "failed",
|
|
1587
|
-
problem:
|
|
1606
|
+
problem: fe(e)
|
|
1588
1607
|
};
|
|
1589
1608
|
}
|
|
1590
1609
|
i.value = {
|
|
@@ -1598,14 +1617,14 @@ function ni(e) {
|
|
|
1598
1617
|
try {
|
|
1599
1618
|
return await t();
|
|
1600
1619
|
} catch (t) {
|
|
1601
|
-
return
|
|
1620
|
+
return K(e, t), !1;
|
|
1602
1621
|
} finally {
|
|
1603
1622
|
o.value = !1;
|
|
1604
1623
|
}
|
|
1605
1624
|
}
|
|
1606
1625
|
let f = async (t) => {
|
|
1607
1626
|
for (let n of t) await e.exec("kernel.secrets.delete", {
|
|
1608
|
-
extension:
|
|
1627
|
+
extension: Q,
|
|
1609
1628
|
name: n
|
|
1610
1629
|
});
|
|
1611
1630
|
}, p = (t, i) => d(async () => {
|
|
@@ -1618,7 +1637,7 @@ function ni(e) {
|
|
|
1618
1637
|
try {
|
|
1619
1638
|
if (!await n.set(u)) return !1;
|
|
1620
1639
|
for (let [t, n] of Object.entries(i.set)) await e.exec("kernel.secrets.set", {
|
|
1621
|
-
extension:
|
|
1640
|
+
extension: Q,
|
|
1622
1641
|
name: t,
|
|
1623
1642
|
value: n
|
|
1624
1643
|
});
|
|
@@ -1650,7 +1669,7 @@ function ni(e) {
|
|
|
1650
1669
|
try {
|
|
1651
1670
|
await c();
|
|
1652
1671
|
} catch (t) {
|
|
1653
|
-
|
|
1672
|
+
K(e, t);
|
|
1654
1673
|
}
|
|
1655
1674
|
}), j(r, (e, t) => {
|
|
1656
1675
|
let n = new Set((t ?? []).map((e) => e.name));
|
|
@@ -1673,57 +1692,57 @@ function ni(e) {
|
|
|
1673
1692
|
}
|
|
1674
1693
|
//#endregion
|
|
1675
1694
|
//#region web/src/McpServers.vue?vue&type=script&setup=true&lang.ts
|
|
1676
|
-
var
|
|
1695
|
+
var ai = {
|
|
1677
1696
|
key: 1,
|
|
1678
1697
|
class: "kvc-dialog-rows",
|
|
1679
1698
|
"data-test": "mcp-servers"
|
|
1680
|
-
},
|
|
1699
|
+
}, oi = { class: "kvc-muted" }, si = {
|
|
1681
1700
|
key: 0,
|
|
1682
1701
|
class: "kvc-muted",
|
|
1683
1702
|
"data-test": "mcp-own-value"
|
|
1684
|
-
},
|
|
1703
|
+
}, ci = {
|
|
1685
1704
|
key: 1,
|
|
1686
1705
|
class: "kvc-connectors-state"
|
|
1687
|
-
},
|
|
1706
|
+
}, li = {
|
|
1688
1707
|
class: "kvc-chip",
|
|
1689
1708
|
"data-test": "mcp-changed"
|
|
1690
|
-
},
|
|
1709
|
+
}, ui = ["disabled"], di = {
|
|
1691
1710
|
key: 2,
|
|
1692
1711
|
class: "kvc-muted",
|
|
1693
1712
|
"data-test": "mcp-empty"
|
|
1694
|
-
},
|
|
1713
|
+
}, fi = ["data-test"], pi = { class: "kvc-connector-text" }, mi = {
|
|
1695
1714
|
class: "kvc-mono kvc-connector-name",
|
|
1696
1715
|
"data-test": "mcp-server-name"
|
|
1697
|
-
},
|
|
1716
|
+
}, hi = {
|
|
1698
1717
|
class: "kvc-muted",
|
|
1699
1718
|
dir: "auto",
|
|
1700
1719
|
"data-test": "mcp-server-description"
|
|
1701
|
-
},
|
|
1720
|
+
}, gi = ["data-status"], _i = ["onClick"], vi = ["disabled", "onClick"], yi = ["disabled", "onClick"], bi = {
|
|
1702
1721
|
key: 1,
|
|
1703
1722
|
class: "kvc-muted kvc-server-reason",
|
|
1704
1723
|
dir: "auto",
|
|
1705
1724
|
"data-test": "mcp-server-reason"
|
|
1706
|
-
},
|
|
1725
|
+
}, xi = ["aria-label"], Si = { class: "kvc-muted" }, Ci = ["disabled"], wi = ["disabled", "onClick"], Ti = {
|
|
1707
1726
|
key: 1,
|
|
1708
1727
|
class: "kvc-connector-actions"
|
|
1709
|
-
},
|
|
1728
|
+
}, Ei = [
|
|
1710
1729
|
"disabled",
|
|
1711
1730
|
"aria-label",
|
|
1712
1731
|
"title",
|
|
1713
1732
|
"onClick"
|
|
1714
|
-
],
|
|
1733
|
+
], Di = [
|
|
1715
1734
|
"disabled",
|
|
1716
1735
|
"aria-label",
|
|
1717
1736
|
"title",
|
|
1718
1737
|
"onClick"
|
|
1719
|
-
],
|
|
1738
|
+
], Oi = { class: "kvc-actions" }, ki = ["disabled"], Ai = /* @__PURE__ */ c({
|
|
1720
1739
|
__name: "McpServers",
|
|
1721
1740
|
setup(t) {
|
|
1722
|
-
let c =
|
|
1741
|
+
let c = G(), { servers: l, states: u, secrets: d, locked: p, changed: m, working: h, save: g, remove: v, reset: x, check: S, signIn: T, signOut: E, signedIn: D } = ii(c), O = y(), k = y(), A = (e) => c.t(`${e}.${c.scope.value}`, { name: c.workspace.value.name }), j = (e) => u.value[e] ?? { status: "checking" };
|
|
1723
1742
|
function M(e) {
|
|
1724
1743
|
return e.status === "ready" ? c.t("kvcoder.config.mcp.ready", { count: e.tools }) : c.t(`kvcoder.config.mcp.${e.status}`);
|
|
1725
1744
|
}
|
|
1726
|
-
let N = (e) => e.status === "failed" && e.problem !== void 0 ? c.t(
|
|
1745
|
+
let N = (e) => e.status === "failed" && e.problem !== void 0 ? c.t(de(e.problem.code), e.problem.params) : void 0;
|
|
1727
1746
|
async function P(e, t) {
|
|
1728
1747
|
await g(e, t) && (O.value = void 0, c.toast("kvcoder.config.mcp.saved", { name: e.name }, "success"));
|
|
1729
1748
|
}
|
|
@@ -1733,23 +1752,23 @@ var ri = {
|
|
|
1733
1752
|
async function I(e) {
|
|
1734
1753
|
await v(e) && c.toast("kvcoder.config.mcp.removed", { name: e }, "success"), k.value = void 0;
|
|
1735
1754
|
}
|
|
1736
|
-
return (t, u) => O.value === void 0 ? (_(), i("div",
|
|
1737
|
-
a("p",
|
|
1738
|
-
w(p) ? (_(), i("p",
|
|
1755
|
+
return (t, u) => O.value === void 0 ? (_(), i("div", ai, [
|
|
1756
|
+
a("p", oi, C(w(c).t("kvcoder.config.mcp.intro")), 1),
|
|
1757
|
+
w(p) ? (_(), i("p", si, C(w(c).t("kvcoder.config.connectors.ownValue", { name: w(c).workspace.value.name })), 1)) : w(m) ? (_(), i("div", ci, [a("span", li, C(A("kvcoder.config.connectors.changed")), 1), a("button", {
|
|
1739
1758
|
type: "button",
|
|
1740
1759
|
class: "kvc-text-button",
|
|
1741
1760
|
disabled: w(h),
|
|
1742
1761
|
"data-test": "mcp-reset",
|
|
1743
1762
|
onClick: u[1] ||= (...e) => w(x) && w(x)(...e)
|
|
1744
|
-
}, C(A("kvcoder.config.connectors.reset")), 9,
|
|
1745
|
-
w(l).length === 0 ? (_(), i("p",
|
|
1763
|
+
}, C(A("kvcoder.config.connectors.reset")), 9, ui)])) : r("v-if", !0),
|
|
1764
|
+
w(l).length === 0 ? (_(), i("p", di, C(w(c).t("kvcoder.config.mcp.empty")), 1)) : r("v-if", !0),
|
|
1746
1765
|
(_(!0), i(e, null, b(w(l), (e) => (_(), i("div", {
|
|
1747
1766
|
key: e.name,
|
|
1748
1767
|
class: "kvc-connector kvc-server",
|
|
1749
1768
|
"data-test": `mcp-server-${e.name}`
|
|
1750
|
-
}, [a("span",
|
|
1751
|
-
a("span",
|
|
1752
|
-
a("span",
|
|
1769
|
+
}, [a("span", pi, [
|
|
1770
|
+
a("span", mi, C(e.name), 1),
|
|
1771
|
+
a("span", hi, C(e.description), 1),
|
|
1753
1772
|
a("span", {
|
|
1754
1773
|
class: "kvc-server-state",
|
|
1755
1774
|
"data-status": j(e.name).status,
|
|
@@ -1763,7 +1782,7 @@ var ri = {
|
|
|
1763
1782
|
class: "kvc-text-button",
|
|
1764
1783
|
"data-test": "mcp-server-check",
|
|
1765
1784
|
onClick: (t) => w(S)(e.name)
|
|
1766
|
-
}, C(w(c).t("kvcoder.config.mcp.recheck")), 9,
|
|
1785
|
+
}, C(w(c).t("kvcoder.config.mcp.recheck")), 9, _i)),
|
|
1767
1786
|
"url" in e && w(D)(e.name) ? (_(), i("button", {
|
|
1768
1787
|
key: 1,
|
|
1769
1788
|
type: "button",
|
|
@@ -1771,8 +1790,8 @@ var ri = {
|
|
|
1771
1790
|
disabled: w(h),
|
|
1772
1791
|
"data-test": "mcp-server-sign-out",
|
|
1773
1792
|
onClick: (t) => w(E)(e.name)
|
|
1774
|
-
}, C(w(c).t("kvcoder.config.mcp.signOut")), 9,
|
|
1775
|
-
], 8,
|
|
1793
|
+
}, C(w(c).t("kvcoder.config.mcp.signOut")), 9, vi)) : r("v-if", !0)
|
|
1794
|
+
], 8, gi),
|
|
1776
1795
|
"url" in e && j(e.name).status === "signInNeeded" ? (_(), i("button", {
|
|
1777
1796
|
key: 0,
|
|
1778
1797
|
type: "button",
|
|
@@ -1780,8 +1799,8 @@ var ri = {
|
|
|
1780
1799
|
disabled: w(h),
|
|
1781
1800
|
"data-test": "mcp-server-sign-in",
|
|
1782
1801
|
onClick: (t) => F(e.name)
|
|
1783
|
-
}, C(w(c).t("kvcoder.config.mcp.signIn")), 9,
|
|
1784
|
-
N(j(e.name)) === void 0 ? r("v-if", !0) : (_(), i("span",
|
|
1802
|
+
}, C(w(c).t("kvcoder.config.mcp.signIn")), 9, yi)) : r("v-if", !0),
|
|
1803
|
+
N(j(e.name)) === void 0 ? r("v-if", !0) : (_(), i("span", bi, C(N(j(e.name))), 1))
|
|
1785
1804
|
]), k.value === e.name ? (_(), i("span", {
|
|
1786
1805
|
key: 0,
|
|
1787
1806
|
class: "kvc-connector-actions",
|
|
@@ -1789,22 +1808,22 @@ var ri = {
|
|
|
1789
1808
|
"aria-label": w(c).t("kvcoder.config.mcp.removeConfirm", { name: e.name }),
|
|
1790
1809
|
"data-test": "mcp-remove-confirm"
|
|
1791
1810
|
}, [
|
|
1792
|
-
a("span",
|
|
1811
|
+
a("span", Si, C(w(c).t("kvcoder.config.mcp.removeConfirm", { name: e.name })), 1),
|
|
1793
1812
|
a("button", {
|
|
1794
1813
|
type: "button",
|
|
1795
1814
|
class: "kvc-button",
|
|
1796
1815
|
disabled: w(h),
|
|
1797
1816
|
"data-test": "mcp-remove-cancel",
|
|
1798
1817
|
onClick: u[2] ||= (e) => k.value = void 0
|
|
1799
|
-
}, C(w(c).t("kvcoder.config.mcp.cancel")), 9,
|
|
1818
|
+
}, C(w(c).t("kvcoder.config.mcp.cancel")), 9, Ci),
|
|
1800
1819
|
a("button", {
|
|
1801
1820
|
type: "button",
|
|
1802
1821
|
class: "kvc-button kvc-danger",
|
|
1803
1822
|
disabled: w(h),
|
|
1804
1823
|
"data-test": "mcp-remove-yes",
|
|
1805
1824
|
onClick: (t) => I(e.name)
|
|
1806
|
-
}, C(w(c).t("kvcoder.config.mcp.removeYes")), 9,
|
|
1807
|
-
], 8,
|
|
1825
|
+
}, C(w(c).t("kvcoder.config.mcp.removeYes")), 9, wi)
|
|
1826
|
+
], 8, xi)) : (_(), i("span", Ti, [a("button", {
|
|
1808
1827
|
type: "button",
|
|
1809
1828
|
class: "kvc-button kvc-ghost kvc-icon-button",
|
|
1810
1829
|
disabled: w(p) || w(h),
|
|
@@ -1812,10 +1831,10 @@ var ri = {
|
|
|
1812
1831
|
title: w(c).t("kvcoder.config.mcp.edit", { name: e.name }),
|
|
1813
1832
|
"data-test": "mcp-server-edit",
|
|
1814
1833
|
onClick: (t) => O.value = { entry: e }
|
|
1815
|
-
}, [s(w(
|
|
1834
|
+
}, [s(w(H), {
|
|
1816
1835
|
size: 16,
|
|
1817
1836
|
"aria-hidden": "true"
|
|
1818
|
-
})], 8,
|
|
1837
|
+
})], 8, Ei), a("button", {
|
|
1819
1838
|
type: "button",
|
|
1820
1839
|
class: "kvc-button kvc-ghost kvc-icon-button",
|
|
1821
1840
|
disabled: w(p) || w(h),
|
|
@@ -1823,21 +1842,21 @@ var ri = {
|
|
|
1823
1842
|
title: w(c).t("kvcoder.config.mcp.remove", { name: e.name }),
|
|
1824
1843
|
"data-test": "mcp-server-remove",
|
|
1825
1844
|
onClick: (t) => k.value = e.name
|
|
1826
|
-
}, [s(w(
|
|
1845
|
+
}, [s(w(ce), {
|
|
1827
1846
|
size: 16,
|
|
1828
1847
|
"aria-hidden": "true"
|
|
1829
|
-
})], 8,
|
|
1830
|
-
a("div",
|
|
1848
|
+
})], 8, Di)]))], 8, fi))), 128)),
|
|
1849
|
+
a("div", Oi, [a("button", {
|
|
1831
1850
|
type: "button",
|
|
1832
1851
|
class: "kvc-button kvc-primary",
|
|
1833
1852
|
disabled: w(p) || w(h),
|
|
1834
1853
|
"data-test": "mcp-add",
|
|
1835
1854
|
onClick: u[3] ||= (e) => O.value = {}
|
|
1836
|
-
}, [s(w(
|
|
1855
|
+
}, [s(w(U), {
|
|
1837
1856
|
size: 16,
|
|
1838
1857
|
"aria-hidden": "true"
|
|
1839
|
-
}), o(C(w(c).t("kvcoder.config.mcp.add")), 1)], 8,
|
|
1840
|
-
])) : (_(), n(
|
|
1858
|
+
}), o(C(w(c).t("kvcoder.config.mcp.add")), 1)], 8, ki)])
|
|
1859
|
+
])) : (_(), n(ri, f({ key: 0 }, O.value.entry === void 0 ? {} : { entry: O.value.entry }, {
|
|
1841
1860
|
taken: w(l).filter((e) => e.name !== O.value?.entry?.name).map((e) => e.name),
|
|
1842
1861
|
secrets: w(d),
|
|
1843
1862
|
working: w(h),
|
|
@@ -1849,10 +1868,10 @@ var ri = {
|
|
|
1849
1868
|
"working"
|
|
1850
1869
|
]));
|
|
1851
1870
|
}
|
|
1852
|
-
}),
|
|
1871
|
+
}), ji = ["data-test"], Mi = { class: "kvc-setting-text" }, Ni = ["data-test"], Pi = { class: "kvc-muted" }, Fi = { class: "kvc-setting-control" }, Ii = ["data-test"], Li = {
|
|
1853
1872
|
key: 1,
|
|
1854
1873
|
class: "kvc-connectors-state"
|
|
1855
|
-
},
|
|
1874
|
+
}, Ri = ["data-test"], zi = ["data-test"], Bi = ["disabled", "data-test"], Vi = /* @__PURE__ */ c({
|
|
1856
1875
|
__name: "SettingFrame",
|
|
1857
1876
|
props: {
|
|
1858
1877
|
settingKey: {},
|
|
@@ -1861,44 +1880,44 @@ var ri = {
|
|
|
1861
1880
|
saved: { type: Boolean }
|
|
1862
1881
|
},
|
|
1863
1882
|
setup(t) {
|
|
1864
|
-
let n = t, o =
|
|
1883
|
+
let n = t, o = G(), s = (e) => o.t(`${e}.${o.scope.value}`, { name: o.workspace.value.name });
|
|
1865
1884
|
return (t, c) => (_(), i("div", {
|
|
1866
1885
|
class: "kvc-setting",
|
|
1867
1886
|
"data-test": n.name
|
|
1868
|
-
}, [a("span",
|
|
1887
|
+
}, [a("span", Mi, [a("span", {
|
|
1869
1888
|
class: "kvc-setting-title",
|
|
1870
1889
|
"data-test": `${n.name}-title`
|
|
1871
|
-
}, C(w(o).t(`${n.settingKey}.title`)), 9,
|
|
1890
|
+
}, C(w(o).t(`${n.settingKey}.title`)), 9, Ni), a("span", Pi, C(w(o).t(`${n.settingKey}.description`)), 1)]), a("span", Fi, [x(t.$slots, "default", { disabled: n.setting.locked.value || n.setting.saving.value }), n.setting.locked.value ? (_(), i("span", {
|
|
1872
1891
|
key: 0,
|
|
1873
1892
|
class: "kvc-muted",
|
|
1874
1893
|
"data-test": `${n.name}-own-value`
|
|
1875
|
-
}, C(w(o).t("kvcoder.config.setting.ownValue", { name: w(o).workspace.value.name })), 9,
|
|
1894
|
+
}, C(w(o).t("kvcoder.config.setting.ownValue", { name: w(o).workspace.value.name })), 9, Ii)) : n.setting.changed.value || n.saved ? (_(), i("span", Li, [n.saved ? (_(), i("span", {
|
|
1876
1895
|
key: 0,
|
|
1877
1896
|
class: "kvc-muted",
|
|
1878
1897
|
role: "status",
|
|
1879
1898
|
"data-test": `${n.name}-saved`
|
|
1880
|
-
}, C(w(o).t("kvcoder.config.setting.saved")), 9,
|
|
1899
|
+
}, C(w(o).t("kvcoder.config.setting.saved")), 9, Ri)) : r("v-if", !0), n.setting.changed.value ? (_(), i(e, { key: 1 }, [a("span", {
|
|
1881
1900
|
class: "kvc-chip",
|
|
1882
1901
|
"data-test": `${n.name}-changed`
|
|
1883
|
-
}, C(s("kvcoder.config.setting.changed")), 9,
|
|
1902
|
+
}, C(s("kvcoder.config.setting.changed")), 9, zi), a("button", {
|
|
1884
1903
|
type: "button",
|
|
1885
1904
|
class: "kvc-text-button",
|
|
1886
1905
|
disabled: n.setting.saving.value,
|
|
1887
1906
|
"data-test": `${n.name}-reset`,
|
|
1888
1907
|
onClick: c[0] ||= (...e) => n.setting.reset && n.setting.reset(...e)
|
|
1889
|
-
}, C(s("kvcoder.config.setting.reset")), 9,
|
|
1908
|
+
}, C(s("kvcoder.config.setting.reset")), 9, Bi)], 64)) : r("v-if", !0)])) : r("v-if", !0)])], 8, ji));
|
|
1890
1909
|
}
|
|
1891
|
-
}),
|
|
1910
|
+
}), Hi = {
|
|
1892
1911
|
class: "kvc-dialog-rows",
|
|
1893
1912
|
"data-test": "shell-settings"
|
|
1894
|
-
},
|
|
1913
|
+
}, Ui = [
|
|
1895
1914
|
"disabled",
|
|
1896
1915
|
"placeholder",
|
|
1897
1916
|
"aria-label"
|
|
1898
|
-
],
|
|
1917
|
+
], Wi = /* @__PURE__ */ c({
|
|
1899
1918
|
__name: "ShellSettings",
|
|
1900
1919
|
setup(e) {
|
|
1901
|
-
let n =
|
|
1920
|
+
let n = G(), r = q(n, "kvcoder.shell.path"), o = y(!1), c = E("field"), l = t(() => typeof r.value.value == "string" ? r.value.value : ""), u = y("");
|
|
1902
1921
|
j(l, (e) => u.value = e, { immediate: !0 });
|
|
1903
1922
|
async function d() {
|
|
1904
1923
|
let e = u.value.trim();
|
|
@@ -1906,7 +1925,7 @@ var ri = {
|
|
|
1906
1925
|
let t = document.activeElement === c.value;
|
|
1907
1926
|
o.value = await r.set(e === "" ? null : e), u.value = l.value, t && (await p(), c.value?.focus());
|
|
1908
1927
|
}
|
|
1909
|
-
return (e, t) => (_(), i("div",
|
|
1928
|
+
return (e, t) => (_(), i("div", Hi, [s(Vi, {
|
|
1910
1929
|
"setting-key": "kvcoder.shell.path",
|
|
1911
1930
|
name: "shell-path",
|
|
1912
1931
|
setting: w(r),
|
|
@@ -1927,43 +1946,43 @@ var ri = {
|
|
|
1927
1946
|
"data-test": "shell-path-control",
|
|
1928
1947
|
onKeydown: P(d, ["enter"]),
|
|
1929
1948
|
onBlur: d
|
|
1930
|
-
}, null, 40,
|
|
1949
|
+
}, null, 40, Ui), [[A, u.value]])]),
|
|
1931
1950
|
_: 1
|
|
1932
1951
|
}, 8, ["setting", "saved"])]));
|
|
1933
1952
|
}
|
|
1934
|
-
}),
|
|
1953
|
+
}), Gi = {
|
|
1935
1954
|
class: "kvc-connectors",
|
|
1936
1955
|
"data-test": "connectors"
|
|
1937
|
-
},
|
|
1956
|
+
}, Ki = {
|
|
1938
1957
|
key: 0,
|
|
1939
1958
|
class: "kvc-muted",
|
|
1940
1959
|
"data-test": "connectors-own-value"
|
|
1941
|
-
},
|
|
1960
|
+
}, qi = {
|
|
1942
1961
|
key: 1,
|
|
1943
1962
|
class: "kvc-connectors-state"
|
|
1944
|
-
},
|
|
1963
|
+
}, Ji = {
|
|
1945
1964
|
class: "kvc-chip",
|
|
1946
1965
|
"data-test": "connectors-changed"
|
|
1947
|
-
},
|
|
1966
|
+
}, Yi = ["disabled"], Xi = ["data-test"], Zi = { class: "kvc-connector-text" }, Qi = {
|
|
1948
1967
|
class: "kvc-mono kvc-connector-name",
|
|
1949
1968
|
"data-test": "connector-name"
|
|
1950
|
-
},
|
|
1969
|
+
}, $i = {
|
|
1951
1970
|
class: "kvc-muted",
|
|
1952
1971
|
dir: "auto",
|
|
1953
1972
|
"data-test": "connector-description"
|
|
1954
|
-
},
|
|
1973
|
+
}, ea = { class: "kvc-connector-actions" }, ta = [
|
|
1955
1974
|
"aria-label",
|
|
1956
1975
|
"title",
|
|
1957
1976
|
"onClick"
|
|
1958
|
-
],
|
|
1977
|
+
], na = [
|
|
1959
1978
|
"aria-checked",
|
|
1960
1979
|
"aria-label",
|
|
1961
1980
|
"disabled",
|
|
1962
1981
|
"onClick"
|
|
1963
|
-
],
|
|
1982
|
+
], ra = /* @__PURE__ */ c({
|
|
1964
1983
|
__name: "ConnectorsList",
|
|
1965
1984
|
setup(t) {
|
|
1966
|
-
let o =
|
|
1985
|
+
let o = G(), { items: c, locked: l, changed: u, saving: d, toggle: f, reset: m } = ct(o), h = y(), g = /* @__PURE__ */ new Map();
|
|
1967
1986
|
function v(e, t) {
|
|
1968
1987
|
t instanceof HTMLElement ? g.set(e, t) : g.delete(e);
|
|
1969
1988
|
}
|
|
@@ -1972,19 +1991,19 @@ var ri = {
|
|
|
1972
1991
|
h.value = void 0, await p(), e !== void 0 && g.get(e)?.focus();
|
|
1973
1992
|
}
|
|
1974
1993
|
let S = (e) => o.t(`${e}.${o.scope.value}`, { name: o.workspace.value.name });
|
|
1975
|
-
return (t, p) => (_(), i("div",
|
|
1976
|
-
w(l) ? (_(), i("p",
|
|
1994
|
+
return (t, p) => (_(), i("div", Gi, [
|
|
1995
|
+
w(l) ? (_(), i("p", Ki, C(w(o).t("kvcoder.config.connectors.ownValue", { name: w(o).workspace.value.name })), 1)) : w(u) ? (_(), i("div", qi, [a("span", Ji, C(S("kvcoder.config.connectors.changed")), 1), a("button", {
|
|
1977
1996
|
type: "button",
|
|
1978
1997
|
class: "kvc-text-button",
|
|
1979
1998
|
disabled: w(d),
|
|
1980
1999
|
"data-test": "connectors-reset",
|
|
1981
2000
|
onClick: p[0] ||= (...e) => w(m) && w(m)(...e)
|
|
1982
|
-
}, C(S("kvcoder.config.connectors.reset")), 9,
|
|
2001
|
+
}, C(S("kvcoder.config.connectors.reset")), 9, Yi)])) : r("v-if", !0),
|
|
1983
2002
|
(_(!0), i(e, null, b(w(c), (e) => (_(), i("div", {
|
|
1984
2003
|
key: e.name,
|
|
1985
2004
|
class: "kvc-connector",
|
|
1986
2005
|
"data-test": `connector-${e.name}`
|
|
1987
|
-
}, [a("span",
|
|
2006
|
+
}, [a("span", Zi, [a("span", Qi, C(e.name), 1), a("span", $i, C(e.description), 1)]), a("span", ea, [e.configurable ? (_(), i("button", {
|
|
1988
2007
|
key: 0,
|
|
1989
2008
|
ref_for: !0,
|
|
1990
2009
|
ref: (t) => v(e.name, t),
|
|
@@ -1995,10 +2014,10 @@ var ri = {
|
|
|
1995
2014
|
title: w(o).t("kvcoder.config.connectors.configure", { name: e.name }),
|
|
1996
2015
|
"data-test": "connector-configure",
|
|
1997
2016
|
onClick: (t) => h.value = e.name
|
|
1998
|
-
}, [s(w(
|
|
2017
|
+
}, [s(w(W), {
|
|
1999
2018
|
size: 18,
|
|
2000
2019
|
"aria-hidden": "true"
|
|
2001
|
-
})], 8,
|
|
2020
|
+
})], 8, ta)) : r("v-if", !0), a("button", {
|
|
2002
2021
|
type: "button",
|
|
2003
2022
|
role: "switch",
|
|
2004
2023
|
class: "kvc-switch",
|
|
@@ -2010,22 +2029,22 @@ var ri = {
|
|
|
2010
2029
|
}, [...p[1] ||= [a("span", {
|
|
2011
2030
|
class: "kvc-switch-knob",
|
|
2012
2031
|
"aria-hidden": "true"
|
|
2013
|
-
}, null, -1)]], 8,
|
|
2014
|
-
h.value === void 0 ? r("v-if", !0) : (_(), n(
|
|
2032
|
+
}, null, -1)]], 8, na)])], 8, Xi))), 128)),
|
|
2033
|
+
h.value === void 0 ? r("v-if", !0) : (_(), n(be, {
|
|
2015
2034
|
key: 2,
|
|
2016
2035
|
name: h.value,
|
|
2017
2036
|
onClose: x
|
|
2018
2037
|
}, {
|
|
2019
|
-
default: M(() => [h.value === "shell" ? (_(), n(
|
|
2038
|
+
default: M(() => [h.value === "shell" ? (_(), n(Wi, { key: 0 })) : h.value === "delegate" ? (_(), n(nr, { key: 1 })) : h.value === "mcp" ? (_(), n(Ai, { key: 2 })) : r("v-if", !0)]),
|
|
2020
2039
|
_: 1
|
|
2021
2040
|
}, 8, ["name"]))
|
|
2022
2041
|
]));
|
|
2023
2042
|
}
|
|
2024
|
-
}),
|
|
2043
|
+
}), ia = /* @__PURE__ */ c({
|
|
2025
2044
|
__name: "connectors",
|
|
2026
2045
|
setup(e) {
|
|
2027
|
-
return (e, t) => (_(), n(
|
|
2046
|
+
return (e, t) => (_(), n(ra));
|
|
2028
2047
|
}
|
|
2029
2048
|
});
|
|
2030
2049
|
//#endregion
|
|
2031
|
-
export {
|
|
2050
|
+
export { ia as default };
|