@kvman/kvcoder 0.1.11 → 0.1.12
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 +45 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/calls/call-name.d.ts.map +1 -1
- package/dist/calls/call-name.js +10 -1
- package/dist/calls/call-name.js.map +1 -1
- package/dist/calls/run-tool.d.ts.map +1 -1
- package/dist/calls/run-tool.js +2 -0
- package/dist/calls/run-tool.js.map +1 -1
- package/dist/connector-call.d.ts +2 -2
- package/dist/connector-call.d.ts.map +1 -1
- package/dist/connector-call.js +5 -3
- package/dist/connector-call.js.map +1 -1
- package/dist/connectors/artifact.d.ts +1 -0
- package/dist/connectors/artifact.d.ts.map +1 -1
- package/dist/connectors/background.d.ts.map +1 -1
- package/dist/connectors/background.js +8 -4
- package/dist/connectors/background.js.map +1 -1
- package/dist/connectors/builtin-connectors.d.ts +38 -0
- package/dist/connectors/builtin-connectors.d.ts.map +1 -1
- package/dist/connectors/builtin-connectors.js +4 -1
- package/dist/connectors/builtin-connectors.js.map +1 -1
- package/dist/connectors/delegate.d.ts.map +1 -1
- package/dist/connectors/delegate.js +3 -0
- package/dist/connectors/delegate.js.map +1 -1
- package/dist/connectors/execution-map.d.ts +1 -1
- package/dist/connectors/execution-map.d.ts.map +1 -1
- package/dist/connectors/execution-map.js +1 -1
- package/dist/connectors/execution-map.js.map +1 -1
- package/dist/connectors/fs.d.ts +29 -1
- package/dist/connectors/fs.d.ts.map +1 -1
- package/dist/connectors/fs.js +46 -9
- package/dist/connectors/fs.js.map +1 -1
- package/dist/connectors/payload-fields.d.ts +3 -0
- package/dist/connectors/payload-fields.d.ts.map +1 -1
- package/dist/connectors/payload-fields.js +8 -2
- package/dist/connectors/payload-fields.js.map +1 -1
- package/dist/connectors/web.d.ts +16 -0
- package/dist/connectors/web.d.ts.map +1 -0
- package/dist/connectors/web.js +22 -0
- package/dist/connectors/web.js.map +1 -0
- package/dist/delegate/permission.d.ts +6 -0
- package/dist/delegate/permission.d.ts.map +1 -1
- package/dist/files/change-diff.d.ts +17 -0
- package/dist/files/change-diff.d.ts.map +1 -0
- package/dist/files/change-diff.js +59 -0
- package/dist/files/change-diff.js.map +1 -0
- package/dist/files/edit-places.d.ts +11 -0
- package/dist/files/edit-places.d.ts.map +1 -0
- package/dist/files/edit-places.js +105 -0
- package/dist/files/edit-places.js.map +1 -0
- package/dist/files/edit-text.d.ts +1 -0
- package/dist/files/edit-text.d.ts.map +1 -1
- package/dist/files/edit-text.js +22 -10
- package/dist/files/edit-text.js.map +1 -1
- package/dist/files/file-change.d.ts.map +1 -1
- package/dist/files/file-change.js +12 -0
- package/dist/files/file-change.js.map +1 -1
- package/dist/files/find-paths.d.ts +9 -0
- package/dist/files/find-paths.d.ts.map +1 -0
- package/dist/files/find-paths.js +38 -0
- package/dist/files/find-paths.js.map +1 -0
- package/dist/files/read-file.d.ts +3 -1
- package/dist/files/read-file.d.ts.map +1 -1
- package/dist/files/read-file.js +7 -6
- package/dist/files/read-file.js.map +1 -1
- package/dist/files/read-files.d.ts +11 -0
- package/dist/files/read-files.d.ts.map +1 -0
- package/dist/files/read-files.js +35 -0
- package/dist/files/read-files.js.map +1 -0
- package/dist/files/read-text.d.ts +63 -0
- package/dist/files/read-text.d.ts.map +1 -0
- package/dist/files/read-text.js +67 -0
- package/dist/files/read-text.js.map +1 -0
- package/dist/files/register-changes.d.ts +3 -0
- package/dist/files/register-changes.d.ts.map +1 -0
- package/dist/files/register-changes.js +78 -0
- package/dist/files/register-changes.js.map +1 -0
- package/dist/files/search-text.d.ts +10 -1
- package/dist/files/search-text.d.ts.map +1 -1
- package/dist/files/search-text.js +32 -57
- package/dist/files/search-text.js.map +1 -1
- package/dist/files/workspace-files.d.ts +5 -0
- package/dist/files/workspace-files.d.ts.map +1 -0
- package/dist/files/workspace-files.js +66 -0
- package/dist/files/workspace-files.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/prompt/build-prompt.d.ts +4 -0
- package/dist/prompt/build-prompt.d.ts.map +1 -1
- package/dist/prompt/build-prompt.js +6 -2
- package/dist/prompt/build-prompt.js.map +1 -1
- package/dist/prompt/person-preferences.d.ts +5 -0
- package/dist/prompt/person-preferences.d.ts.map +1 -0
- package/dist/prompt/person-preferences.js +14 -0
- package/dist/prompt/person-preferences.js.map +1 -0
- package/dist/prompt/session-grants.d.ts +4 -0
- package/dist/prompt/session-grants.d.ts.map +1 -1
- package/dist/prompt/session-grants.js +3 -2
- package/dist/prompt/session-grants.js.map +1 -1
- package/dist/prompt/session-prompt.d.ts.map +1 -1
- package/dist/prompt/session-prompt.js +15 -6
- package/dist/prompt/session-prompt.js.map +1 -1
- package/dist/prompt/working-method.d.ts +2 -2
- package/dist/prompt/working-method.d.ts.map +1 -1
- package/dist/prompt/working-method.js +49 -43
- package/dist/prompt/working-method.js.map +1 -1
- package/dist/register-settings.d.ts +23 -0
- package/dist/register-settings.d.ts.map +1 -1
- package/dist/register-settings.js +13 -0
- package/dist/register-settings.js.map +1 -1
- package/dist/schemas/approval-rule.d.ts +9 -0
- package/dist/schemas/approval-rule.d.ts.map +1 -0
- package/dist/schemas/approval-rule.js +7 -0
- package/dist/schemas/approval-rule.js.map +1 -0
- package/dist/schemas/check.d.ts +7 -0
- package/dist/schemas/check.d.ts.map +1 -0
- package/dist/schemas/check.js +9 -0
- package/dist/schemas/check.js.map +1 -0
- package/dist/schemas/records.d.ts +10 -0
- package/dist/schemas/records.d.ts.map +1 -1
- package/dist/schemas/records.js +8 -0
- 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 -1
- package/dist/sessions/new-session.js.map +1 -1
- package/dist/sessions/register-fork-export.d.ts.map +1 -1
- package/dist/sessions/register-fork-export.js +3 -2
- package/dist/sessions/register-fork-export.js.map +1 -1
- package/dist/sessions/register-sessions.d.ts.map +1 -1
- package/dist/sessions/register-sessions.js +17 -9
- package/dist/sessions/register-sessions.js.map +1 -1
- package/dist/sessions/session-view.d.ts +8 -1
- package/dist/sessions/session-view.d.ts.map +1 -1
- package/dist/sessions/session-view.js +6 -1
- package/dist/sessions/session-view.js.map +1 -1
- package/dist/sessions/waiting-on.d.ts +7 -0
- package/dist/sessions/waiting-on.d.ts.map +1 -0
- package/dist/sessions/waiting-on.js +20 -0
- package/dist/sessions/waiting-on.js.map +1 -0
- package/dist/store/collections.d.ts +18 -0
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +3 -1
- package/dist/store/collections.js.map +1 -1
- package/dist/turns/answer-extras.d.ts +21 -0
- package/dist/turns/answer-extras.d.ts.map +1 -0
- package/dist/turns/answer-extras.js +43 -0
- package/dist/turns/answer-extras.js.map +1 -0
- package/dist/turns/answer-fingerprint.d.ts +6 -2
- package/dist/turns/answer-fingerprint.d.ts.map +1 -1
- package/dist/turns/answer-fingerprint.js +9 -3
- package/dist/turns/answer-fingerprint.js.map +1 -1
- package/dist/turns/apply-answer.d.ts +2 -1
- package/dist/turns/apply-answer.d.ts.map +1 -1
- package/dist/turns/apply-answer.js +10 -4
- package/dist/turns/apply-answer.js.map +1 -1
- package/dist/turns/approval-rules.d.ts +13 -0
- package/dist/turns/approval-rules.d.ts.map +1 -0
- package/dist/turns/approval-rules.js +65 -0
- package/dist/turns/approval-rules.js.map +1 -0
- package/dist/turns/check-after-edits.d.ts +8 -0
- package/dist/turns/check-after-edits.d.ts.map +1 -0
- package/dist/turns/check-after-edits.js +23 -0
- package/dist/turns/check-after-edits.js.map +1 -0
- package/dist/turns/clear-results.d.ts +15 -0
- package/dist/turns/clear-results.d.ts.map +1 -0
- package/dist/turns/clear-results.js +58 -0
- package/dist/turns/clear-results.js.map +1 -0
- package/dist/turns/cleared-results.d.ts +17 -0
- package/dist/turns/cleared-results.d.ts.map +1 -0
- package/dist/turns/cleared-results.js +46 -0
- package/dist/turns/cleared-results.js.map +1 -0
- package/dist/turns/compaction.js +6 -6
- package/dist/turns/compaction.js.map +1 -1
- package/dist/turns/file-results.d.ts +15 -0
- package/dist/turns/file-results.d.ts.map +1 -0
- package/dist/turns/file-results.js +39 -0
- package/dist/turns/file-results.js.map +1 -0
- package/dist/turns/lost-reply.js +2 -2
- package/dist/turns/lost-reply.js.map +1 -1
- package/dist/turns/model-context.d.ts +2 -0
- package/dist/turns/model-context.d.ts.map +1 -1
- package/dist/turns/model-context.js +28 -5
- package/dist/turns/model-context.js.map +1 -1
- package/dist/turns/read-again.d.ts +11 -5
- package/dist/turns/read-again.d.ts.map +1 -1
- package/dist/turns/read-again.js +39 -10
- package/dist/turns/read-again.js.map +1 -1
- package/dist/turns/register-turns.d.ts.map +1 -1
- package/dist/turns/register-turns.js +12 -4
- package/dist/turns/register-turns.js.map +1 -1
- package/dist/turns/run-calls.d.ts +4 -0
- package/dist/turns/run-calls.d.ts.map +1 -1
- package/dist/turns/run-calls.js +35 -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 -4
- package/dist/turns/run-command.js.map +1 -1
- package/dist/turns/step.d.ts.map +1 -1
- package/dist/turns/step.js +43 -8
- package/dist/turns/step.js.map +1 -1
- package/dist/ui/register-ui.js +2 -2
- package/dist/ui/register-ui.js.map +1 -1
- package/dist/web/components/approval.css +1 -1
- package/dist/web/components/approval.js +122 -89
- package/dist/web/components/call.css +1 -1
- package/dist/web/components/call.js +400 -302
- package/dist/web/components/connectors.css +1 -1
- package/dist/web/components/connectors.js +440 -427
- package/dist/web/components/conversation.css +1 -1
- package/dist/web/components/conversation.js +2509 -1500
- package/dist/web/components/mcp-sign-in.css +1 -1
- package/dist/web/components/model.css +1 -1
- package/dist/web/components/model.js +138 -126
- package/dist/web/components/preferences.css +2 -0
- package/dist/web/components/preferences.js +151 -0
- package/dist/web/components/question.css +1 -1
- package/dist/web/components/sessions.css +1 -1
- package/dist/web/components/sessions.js +44 -21
- package/dist/web-fetch/fetch-page.d.ts +28 -0
- package/dist/web-fetch/fetch-page.d.ts.map +1 -0
- package/dist/web-fetch/fetch-page.js +108 -0
- package/dist/web-fetch/fetch-page.js.map +1 -0
- package/dist/web-fetch/private-address.d.ts +3 -0
- package/dist/web-fetch/private-address.d.ts.map +1 -0
- package/dist/web-fetch/private-address.js +69 -0
- package/dist/web-fetch/private-address.js.map +1 -0
- package/dist/web-fetch/web-hosts.d.ts +7 -0
- package/dist/web-fetch/web-hosts.d.ts.map +1 -0
- package/dist/web-fetch/web-hosts.js +19 -0
- package/dist/web-fetch/web-hosts.js.map +1 -0
- package/docs/connectors.md +2 -2
- package/locales/ar.json +66 -1
- package/locales/en.json +66 -1
- package/package.json +17 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, h as l, inject as u, mergeModels as d, mergeProps as f, nextTick as p, onBeforeUnmount as m, onMounted as h, onUnmounted as g, openBlock as _, reactive as v, ref as y, renderList as b, renderSlot as x,
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, h as l, inject as u, mergeModels as d, mergeProps as f, nextTick as p, onBeforeUnmount as m, onMounted as h, onUnmounted as g, openBlock as _, reactive as v, ref as y, renderList as b, renderSlot as x, resolveDynamicComponent as S, shallowRef as C, toDisplayString as w, unref as T, useModel as E, useTemplateRef as D, vModelCheckbox as O, vModelRadio as k, vModelSelect as A, vModelText as j, watch as M, withCtx as N, withDirectives as P, withKeys as F, withModifiers as I } from "vue";
|
|
2
2
|
//#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/shared/src/build/defaultAttributes.mjs
|
|
3
|
-
var
|
|
3
|
+
var L = {
|
|
4
4
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5
5
|
width: 24,
|
|
6
6
|
height: 24,
|
|
@@ -10,25 +10,25 @@ var I = {
|
|
|
10
10
|
"stroke-width": 2,
|
|
11
11
|
"stroke-linecap": "round",
|
|
12
12
|
"stroke-linejoin": "round"
|
|
13
|
-
},
|
|
13
|
+
}, R = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim();
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/shared/src/build/buildLucideIconNode.mjs
|
|
16
|
-
function
|
|
16
|
+
function z(e) {
|
|
17
17
|
return e != null;
|
|
18
18
|
}
|
|
19
19
|
function ee(e, t = {}) {
|
|
20
|
-
let n = t.attributeNames ?? {}, r = (e) => n[e] ?? e, i = e.size ?? e.width ??
|
|
20
|
+
let n = t.attributeNames ?? {}, r = (e) => n[e] ?? e, i = e.size ?? e.width ?? L.width, a = e.size ?? e.height ?? L.height, o = e.aliases?.filter((e) => typeof e == "string" && e.trim() !== "").map((e) => `lucide-${e}`) ?? [], s = [...e.name ? [`lucide-${e.name}`] : [], ...o], c = t.className?.split(" ").filter(Boolean) ?? [], l = t.includeDefaultClasses === !1 ? R(...c) : R("lucide", ...s, ...c), u = t.absoluteStrokeWidth ? Number(t.strokeWidth ?? L["stroke-width"]) * Number(e.size ?? e.width ?? L.width) / Number(t.size ?? t.width ?? L.width) : t.strokeWidth ?? L["stroke-width"];
|
|
21
21
|
return [
|
|
22
22
|
"svg",
|
|
23
23
|
{
|
|
24
|
-
...Object.entries(
|
|
24
|
+
...Object.entries(L).reduce((e, [t, n]) => (e[r(t)] = n, e), {}),
|
|
25
25
|
..."color" in t && t.color && { [r("stroke")]: t.color },
|
|
26
|
-
..."size" in t &&
|
|
26
|
+
..."size" in t && z(t.size) && {
|
|
27
27
|
[r("width")]: t.size,
|
|
28
28
|
[r("height")]: t.size
|
|
29
29
|
},
|
|
30
|
-
..."width" in t &&
|
|
31
|
-
..."height" in t &&
|
|
30
|
+
..."width" in t && z(t.width) && { [r("width")]: t.width },
|
|
31
|
+
..."height" in t && z(t.height) && { [r("height")]: t.height },
|
|
32
32
|
[r("stroke-width")]: u,
|
|
33
33
|
...l && { [r("class")]: l },
|
|
34
34
|
[r("viewBox")]: `0 0 ${i} ${a}`,
|
|
@@ -50,10 +50,10 @@ function ee(e, t = {}) {
|
|
|
50
50
|
}
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/shared/src/utils/hasA11yProp.mjs
|
|
53
|
-
var
|
|
53
|
+
var B = (e) => {
|
|
54
54
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
55
55
|
return !1;
|
|
56
|
-
},
|
|
56
|
+
}, V = (e) => e === "", te = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), ne = /* @__PURE__ */ Symbol("lucide-icons");
|
|
57
57
|
function re() {
|
|
58
58
|
return u(ne, {});
|
|
59
59
|
}
|
|
@@ -65,7 +65,7 @@ var ie = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
|
|
|
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 = "" } = re(), C =
|
|
68
|
+
let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: S = "" } = re(), C = V(i) || V(a) || i === !0 || a === !0 || b === !0, w = V(o) || V(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,
|
|
@@ -75,14 +75,14 @@ var ie = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
|
|
|
75
75
|
absoluteStrokeWidth: C,
|
|
76
76
|
nonScalingStroke: w,
|
|
77
77
|
className: S,
|
|
78
|
-
hasA11yProp: T != null && T.length > 0 ||
|
|
78
|
+
hasA11yProp: T != null && T.length > 0 || B(h),
|
|
79
79
|
attributes: h
|
|
80
80
|
});
|
|
81
81
|
return l("svg", E, [...D.map(([e, t]) => l(e, t)), ...T ?? []]);
|
|
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 H(e, t = []) {
|
|
86
86
|
let n = typeof e == "string" ? {
|
|
87
87
|
name: e,
|
|
88
88
|
node: t
|
|
@@ -92,21 +92,21 @@ function V(e, t = []) {
|
|
|
92
92
|
icon: n
|
|
93
93
|
}, t.default ? { default: t.default } : void 0);
|
|
94
94
|
}
|
|
95
|
-
var ae =
|
|
95
|
+
var ae = H({
|
|
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
|
-
}), oe =
|
|
102
|
+
}), oe = H({
|
|
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
|
+
}), U = H({
|
|
110
110
|
name: "pencil",
|
|
111
111
|
size: 24,
|
|
112
112
|
node: [["path", {
|
|
@@ -116,7 +116,7 @@ var ae = V({
|
|
|
116
116
|
d: "m15 5 4 4",
|
|
117
117
|
key: "1mk7zo"
|
|
118
118
|
}]]
|
|
119
|
-
}),
|
|
119
|
+
}), W = H({
|
|
120
120
|
name: "plus",
|
|
121
121
|
size: 24,
|
|
122
122
|
node: [["path", {
|
|
@@ -126,7 +126,7 @@ var ae = V({
|
|
|
126
126
|
d: "M12 5v14",
|
|
127
127
|
key: "s699le"
|
|
128
128
|
}]]
|
|
129
|
-
}), se =
|
|
129
|
+
}), se = H({
|
|
130
130
|
name: "search",
|
|
131
131
|
size: 24,
|
|
132
132
|
node: [["path", {
|
|
@@ -138,7 +138,7 @@ var ae = V({
|
|
|
138
138
|
r: "8",
|
|
139
139
|
key: "4ej97u"
|
|
140
140
|
}]]
|
|
141
|
-
}),
|
|
141
|
+
}), G = H({
|
|
142
142
|
name: "settings",
|
|
143
143
|
size: 24,
|
|
144
144
|
node: [["path", {
|
|
@@ -150,7 +150,7 @@ var ae = V({
|
|
|
150
150
|
r: "3",
|
|
151
151
|
key: "1v7zrd"
|
|
152
152
|
}]]
|
|
153
|
-
}), ce =
|
|
153
|
+
}), ce = H({
|
|
154
154
|
name: "trash",
|
|
155
155
|
size: 24,
|
|
156
156
|
node: [
|
|
@@ -176,7 +176,7 @@ var ae = V({
|
|
|
176
176
|
}]
|
|
177
177
|
],
|
|
178
178
|
aliases: ["trash-2"]
|
|
179
|
-
}), le =
|
|
179
|
+
}), le = H({
|
|
180
180
|
name: "x",
|
|
181
181
|
size: 24,
|
|
182
182
|
node: [["path", {
|
|
@@ -189,7 +189,7 @@ var ae = V({
|
|
|
189
189
|
});
|
|
190
190
|
//#endregion
|
|
191
191
|
//#region web/src/kvman.ts
|
|
192
|
-
function
|
|
192
|
+
function K() {
|
|
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;
|
|
@@ -212,7 +212,7 @@ function fe(e) {
|
|
|
212
212
|
function pe(e) {
|
|
213
213
|
return Object.fromEntries(Object.entries(ue(e)).map(([e, t]) => [e, typeof t == "string" ? t : JSON.stringify(t)]));
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function q(e, t) {
|
|
216
216
|
let n = fe(t);
|
|
217
217
|
e.toast(n === void 0 ? "kvcoder.ui.failed" : de(n.code), n?.params ?? {}, "error");
|
|
218
218
|
}
|
|
@@ -229,7 +229,7 @@ var me = ["aria-label"], he = { class: "kvc-dialog-head" }, ge = { class: "kvc-c
|
|
|
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 = K(), c = D("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());
|
|
@@ -237,25 +237,25 @@ var me = ["aria-label"], he = { class: "kvc-dialog-head" }, ge = { class: "kvc-c
|
|
|
237
237
|
return h(() => c.value?.focus()), (e, t) => (_(), i("div", {
|
|
238
238
|
class: "kvc-dialog-backdrop",
|
|
239
239
|
"data-test": "connector-dialog-backdrop",
|
|
240
|
-
onClick: t[2] ||=
|
|
240
|
+
onClick: t[2] ||= I((e) => r("close"), ["self"])
|
|
241
241
|
}, [a("div", {
|
|
242
242
|
ref_key: "dialog",
|
|
243
243
|
ref: c,
|
|
244
244
|
class: "kvc-dialog",
|
|
245
245
|
role: "dialog",
|
|
246
246
|
"aria-modal": "true",
|
|
247
|
-
"aria-label":
|
|
247
|
+
"aria-label": T(o).t("kvcoder.config.connectors.configure", { name: n.name }),
|
|
248
248
|
tabindex: "-1",
|
|
249
249
|
"data-test": "connector-dialog",
|
|
250
|
-
onKeydown: [t[1] ||=
|
|
251
|
-
}, [a("div", he, [a("span", ge, [a("span", _e,
|
|
250
|
+
onKeydown: [t[1] ||= F(I((e) => r("close"), ["stop"]), ["esc"]), F(u, ["tab"])]
|
|
251
|
+
}, [a("div", he, [a("span", ge, [a("span", _e, w(n.name), 1), a("span", ve, w(T(o).t(`kvcoder.config.dialog.scope.${T(o).scope.value}`, { name: T(o).workspace.value.name })), 1)]), a("button", {
|
|
252
252
|
type: "button",
|
|
253
253
|
class: "kvc-button kvc-ghost kvc-icon-button",
|
|
254
|
-
"aria-label":
|
|
255
|
-
title:
|
|
254
|
+
"aria-label": T(o).t("kvcoder.config.dialog.close"),
|
|
255
|
+
title: T(o).t("kvcoder.config.dialog.close"),
|
|
256
256
|
"data-test": "connector-dialog-close",
|
|
257
257
|
onClick: t[0] ||= (e) => r("close")
|
|
258
|
-
}, [s(
|
|
258
|
+
}, [s(T(le), {
|
|
259
259
|
size: 18,
|
|
260
260
|
"aria-hidden": "true"
|
|
261
261
|
})], 8, ye)]), x(e.$slots, "default")], 40, me)]));
|
|
@@ -263,8 +263,8 @@ var me = ["aria-label"], he = { class: "kvc-dialog-head" }, ge = { class: "kvc-c
|
|
|
263
263
|
});
|
|
264
264
|
//#endregion
|
|
265
265
|
//#region web/src/use-setting.ts
|
|
266
|
-
function
|
|
267
|
-
let r =
|
|
266
|
+
function J(e, n) {
|
|
267
|
+
let r = C(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";
|
|
270
270
|
}, s = async (t) => {
|
|
@@ -272,12 +272,12 @@ function q(e, n) {
|
|
|
272
272
|
try {
|
|
273
273
|
return await t(), await o(), !0;
|
|
274
274
|
} catch (t) {
|
|
275
|
-
return
|
|
275
|
+
return q(e, t), !1;
|
|
276
276
|
} finally {
|
|
277
277
|
a.value = !1;
|
|
278
278
|
}
|
|
279
279
|
};
|
|
280
|
-
return h(o),
|
|
280
|
+
return h(o), M(() => [e.scope.value, e.workspace.value.id], o), {
|
|
281
281
|
value: r,
|
|
282
282
|
saving: a,
|
|
283
283
|
locked: t(() => e.scope.value === "global" && i.value === "workspace"),
|
|
@@ -295,7 +295,7 @@ function q(e, n) {
|
|
|
295
295
|
}
|
|
296
296
|
//#endregion
|
|
297
297
|
//#region src/thinking-levels.ts
|
|
298
|
-
var
|
|
298
|
+
var Y = [
|
|
299
299
|
"off",
|
|
300
300
|
"minimal",
|
|
301
301
|
"low",
|
|
@@ -306,8 +306,8 @@ var J = [
|
|
|
306
306
|
];
|
|
307
307
|
function xe(e, t) {
|
|
308
308
|
if (e.includes(t)) return t;
|
|
309
|
-
let n =
|
|
310
|
-
return
|
|
309
|
+
let n = Y.indexOf(t);
|
|
310
|
+
return Y.slice(n + 1).find((t) => e.includes(t)) ?? Y.slice(0, n).findLast((t) => e.includes(t)) ?? t;
|
|
311
311
|
}
|
|
312
312
|
//#endregion
|
|
313
313
|
//#region web/src/model-groups.ts
|
|
@@ -339,7 +339,7 @@ function Ce(e, t) {
|
|
|
339
339
|
};
|
|
340
340
|
}
|
|
341
341
|
function we(e, t) {
|
|
342
|
-
return e.flatMap((e) => e.models).find((e) => e.id === t)?.thinkingLevels ??
|
|
342
|
+
return e.flatMap((e) => e.models).find((e) => e.id === t)?.thinkingLevels ?? Y;
|
|
343
343
|
}
|
|
344
344
|
//#endregion
|
|
345
345
|
//#region web/src/worker-entry.ts
|
|
@@ -368,9 +368,9 @@ var Te = [
|
|
|
368
368
|
"opencode",
|
|
369
369
|
"pi",
|
|
370
370
|
"claude"
|
|
371
|
-
], ke = (e) => Array.isArray(e) && e.every((e) => typeof e == "string"), Ae = (e) => e === null || typeof e == "string",
|
|
371
|
+
], ke = (e) => Array.isArray(e) && e.every((e) => typeof e == "string"), Ae = (e) => e === null || typeof e == "string", X = (e, t) => e.some((e) => e === t), Z = (e, ...t) => t.every((t) => t in e);
|
|
372
372
|
function je(e) {
|
|
373
|
-
return typeof e != "object" || !e || !
|
|
373
|
+
return typeof e != "object" || !e || !Z(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" ? Z(e, "connectors", "model", "thinking") && (e.connectors === null || ke(e.connectors)) && Ae(e.model) && (e.thinking === null || X(Y, e.thinking)) : !Z(e, "approval", "timeoutMs", "model") || !X(["ask", "auto"], e.approval) || typeof e.timeoutMs != "number" || !Ae(e.model) ? !1 : e.kind === "opencode" ? Z(e, "agent", "autoApprove") && Ae(e.agent) && typeof e.autoApprove == "boolean" : e.kind === "pi" ? Z(e, "thinking", "tools") && (e.thinking === null || X(Te, e.thinking)) && (e.tools === null || ke(e.tools)) : e.kind === "claude" && Z(e, "effort", "permissionMode") && (e.effort === null || X(Ee, e.effort)) && X(De, e.permissionMode);
|
|
374
374
|
}
|
|
375
375
|
var Me = (e) => Array.isArray(e) ? e.filter(je) : [], Ne = {
|
|
376
376
|
name: "",
|
|
@@ -434,7 +434,7 @@ function Pe(e) {
|
|
|
434
434
|
permissionMode: e.permissionMode
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
|
-
var
|
|
437
|
+
var Q = (e) => e === "" ? null : e;
|
|
438
438
|
function Fe(e, t) {
|
|
439
439
|
let n = {
|
|
440
440
|
name: e.name.trim(),
|
|
@@ -450,31 +450,31 @@ function Fe(e, t) {
|
|
|
450
450
|
readOnly: e.readOnly,
|
|
451
451
|
connectors: r,
|
|
452
452
|
model: e.model,
|
|
453
|
-
thinking:
|
|
453
|
+
thinking: Q(e.thinking)
|
|
454
454
|
};
|
|
455
455
|
}
|
|
456
456
|
let r = {
|
|
457
457
|
...n,
|
|
458
458
|
approval: e.approval,
|
|
459
459
|
timeoutMs: Number(e.minutes) * 6e4,
|
|
460
|
-
model:
|
|
460
|
+
model: Q(e.programModel.trim())
|
|
461
461
|
};
|
|
462
462
|
if (e.kind === "opencode") return {
|
|
463
463
|
...r,
|
|
464
464
|
kind: "opencode",
|
|
465
|
-
agent:
|
|
465
|
+
agent: Q(e.agent.trim()),
|
|
466
466
|
autoApprove: e.autoApprove
|
|
467
467
|
};
|
|
468
468
|
let i = e.tools.split("\n").map((e) => e.trim()).filter((e) => e !== "");
|
|
469
469
|
return e.kind === "pi" ? {
|
|
470
470
|
...r,
|
|
471
471
|
kind: "pi",
|
|
472
|
-
thinking:
|
|
472
|
+
thinking: Q(e.piThinking),
|
|
473
473
|
tools: i.length === 0 ? null : i
|
|
474
474
|
} : {
|
|
475
475
|
...r,
|
|
476
476
|
kind: "claude",
|
|
477
|
-
effort:
|
|
477
|
+
effort: Q(e.effort),
|
|
478
478
|
permissionMode: e.permissionMode
|
|
479
479
|
};
|
|
480
480
|
}
|
|
@@ -490,7 +490,7 @@ function Ve(e, t) {
|
|
|
490
490
|
//#endregion
|
|
491
491
|
//#region web/src/use-workers.ts
|
|
492
492
|
function He(e) {
|
|
493
|
-
let n =
|
|
493
|
+
let n = J(e, "kvcoder.delegate.workers"), r = t(() => Me(n.value.value)), i = y({});
|
|
494
494
|
async function a(t) {
|
|
495
495
|
i.value = {
|
|
496
496
|
...i.value,
|
|
@@ -500,14 +500,14 @@ function He(e) {
|
|
|
500
500
|
try {
|
|
501
501
|
n = (await e.exec("kvcoder.delegate.worker.check", { name: t })).status;
|
|
502
502
|
} catch (t) {
|
|
503
|
-
|
|
503
|
+
q(e, t), n = "notFound";
|
|
504
504
|
}
|
|
505
505
|
i.value = {
|
|
506
506
|
...i.value,
|
|
507
507
|
[t]: n
|
|
508
508
|
};
|
|
509
509
|
}
|
|
510
|
-
return
|
|
510
|
+
return M(r, (e) => {
|
|
511
511
|
for (let t of e) t.kind !== "subagent" && !(t.name in i.value) && a(t.name);
|
|
512
512
|
}), {
|
|
513
513
|
workers: r,
|
|
@@ -537,7 +537,8 @@ function He(e) {
|
|
|
537
537
|
var Ue = { class: "kvc-picker" }, We = [
|
|
538
538
|
"aria-expanded",
|
|
539
539
|
"aria-label",
|
|
540
|
-
"disabled"
|
|
540
|
+
"disabled",
|
|
541
|
+
"title"
|
|
541
542
|
], Ge = { class: "kvc-picker-label" }, Ke = ["onKeydown"], qe = { class: "kvc-search" }, Je = [
|
|
542
543
|
"placeholder",
|
|
543
544
|
"aria-label",
|
|
@@ -566,52 +567,53 @@ var Ue = { class: "kvc-picker" }, We = [
|
|
|
566
567
|
current: {},
|
|
567
568
|
empty: {},
|
|
568
569
|
none: {},
|
|
569
|
-
disabled: { type: Boolean }
|
|
570
|
+
disabled: { type: Boolean },
|
|
571
|
+
icon: {}
|
|
570
572
|
},
|
|
571
573
|
emits: ["pick", "none"],
|
|
572
574
|
setup(o, { emit: c }) {
|
|
573
|
-
let l = o, u = c, d =
|
|
574
|
-
let t =
|
|
575
|
-
return t < 0 ? -1 : t +
|
|
575
|
+
let l = o, u = c, d = K(), f = y(!1), h = y(""), g = y(0), v = D("trigger"), x = D("search"), C = D("panel"), E = t(() => Ce(l.groups, h.value)), O = t(() => E.value.groups.flatMap((e) => e.models)), k = t(() => l.groups.flatMap((e) => e.models).find((e) => e.id === l.current)?.name ?? l.current ?? l.empty ?? ""), A = t(() => l.none !== void 0 && h.value.trim() === ""), N = t(() => +!!A.value), L = t(() => O.value.length + N.value), R = (e) => {
|
|
576
|
+
let t = O.value.findIndex((t) => t.id === e);
|
|
577
|
+
return t < 0 ? -1 : t + N.value;
|
|
576
578
|
};
|
|
577
|
-
function
|
|
579
|
+
function z() {
|
|
578
580
|
f.value = !1, v.value?.focus();
|
|
579
581
|
}
|
|
580
582
|
async function ee() {
|
|
581
|
-
h.value = "", g.value = Math.max(
|
|
583
|
+
h.value = "", g.value = Math.max(R(l.current ?? ""), 0), B = 0, f.value = !0, await p(), te(), x.value?.focus(), re();
|
|
582
584
|
}
|
|
583
|
-
let
|
|
585
|
+
let B = 0, V = 0;
|
|
584
586
|
function te() {
|
|
585
|
-
let e =
|
|
587
|
+
let e = C.value, t = v.value?.closest(".kvc-conversation")?.getBoundingClientRect();
|
|
586
588
|
if (e === null || t === void 0) return;
|
|
587
|
-
let n = e.getBoundingClientRect(), r = t.left + rt - (n.left -
|
|
588
|
-
a !==
|
|
589
|
+
let n = e.getBoundingClientRect(), r = t.left + rt - (n.left - B), i = t.right - rt - (n.right - B), a = r > 0 ? r : i < 0 ? i : 0;
|
|
590
|
+
a !== B && (B = a, e.style.translate = `${a}px 0`);
|
|
589
591
|
}
|
|
590
592
|
function ne() {
|
|
591
|
-
te(),
|
|
593
|
+
te(), V = requestAnimationFrame(ne);
|
|
592
594
|
}
|
|
593
595
|
function re() {
|
|
594
|
-
|
|
596
|
+
C.value?.querySelector("[data-active=\"true\"]")?.scrollIntoView?.({ block: "nearest" });
|
|
595
597
|
}
|
|
596
598
|
async function ie(e) {
|
|
597
|
-
|
|
598
|
-
}
|
|
599
|
-
function V(e) {
|
|
600
|
-
e !== void 0 && (u("pick", e), R());
|
|
599
|
+
L.value !== 0 && (g.value = (g.value + e + L.value) % L.value, await p(), re());
|
|
601
600
|
}
|
|
602
|
-
function H() {
|
|
603
|
-
u("
|
|
601
|
+
function H(e) {
|
|
602
|
+
e !== void 0 && (u("pick", e), z());
|
|
604
603
|
}
|
|
605
604
|
function U() {
|
|
606
|
-
|
|
605
|
+
u("none"), z();
|
|
607
606
|
}
|
|
608
|
-
function W(
|
|
607
|
+
function W() {
|
|
608
|
+
A.value && g.value === 0 ? U() : H(O.value[g.value - N.value]?.id);
|
|
609
|
+
}
|
|
610
|
+
function G(e) {
|
|
609
611
|
e.target instanceof Node && !v.value?.parentElement?.contains(e.target) && (f.value = !1);
|
|
610
612
|
}
|
|
611
|
-
return
|
|
612
|
-
e ? (document.addEventListener("pointerdown",
|
|
613
|
+
return M(h, () => g.value = 0), M(f, (e) => {
|
|
614
|
+
e ? (document.addEventListener("pointerdown", G), V = requestAnimationFrame(ne)) : (document.removeEventListener("pointerdown", G), cancelAnimationFrame(V));
|
|
613
615
|
}), m(() => {
|
|
614
|
-
document.removeEventListener("pointerdown",
|
|
616
|
+
document.removeEventListener("pointerdown", G), cancelAnimationFrame(V);
|
|
615
617
|
}), (t, o) => (_(), i("div", Ue, [a("button", {
|
|
616
618
|
ref_key: "trigger",
|
|
617
619
|
ref: v,
|
|
@@ -619,25 +621,35 @@ var Ue = { class: "kvc-picker" }, We = [
|
|
|
619
621
|
class: "kvc-button",
|
|
620
622
|
"aria-haspopup": "listbox",
|
|
621
623
|
"aria-expanded": f.value,
|
|
622
|
-
"aria-label": `${
|
|
624
|
+
"aria-label": `${T(d).t("kvcoder.ui.model")}: ${k.value}`,
|
|
623
625
|
disabled: l.disabled,
|
|
626
|
+
title: k.value,
|
|
624
627
|
"data-test": "model-picker",
|
|
625
|
-
onClick: o[0] ||= (e) => f.value ?
|
|
626
|
-
}, [
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
628
|
+
onClick: o[0] ||= (e) => f.value ? z() : ee()
|
|
629
|
+
}, [
|
|
630
|
+
l.icon ? (_(), n(S(l.icon), {
|
|
631
|
+
key: 0,
|
|
632
|
+
size: 16,
|
|
633
|
+
class: "kvc-picker-icon",
|
|
634
|
+
"aria-hidden": "true"
|
|
635
|
+
})) : r("v-if", !0),
|
|
636
|
+
a("span", Ge, w(k.value), 1),
|
|
637
|
+
s(T(oe), {
|
|
638
|
+
size: 16,
|
|
639
|
+
"aria-hidden": "true"
|
|
640
|
+
})
|
|
641
|
+
], 8, We), f.value ? (_(), i("div", {
|
|
630
642
|
key: 0,
|
|
631
643
|
ref_key: "panel",
|
|
632
|
-
ref:
|
|
644
|
+
ref: C,
|
|
633
645
|
class: "kvc-popover",
|
|
634
646
|
"data-test": "model-popover",
|
|
635
|
-
onKeydown:
|
|
647
|
+
onKeydown: F(I(z, ["stop"]), ["esc"])
|
|
636
648
|
}, [
|
|
637
|
-
a("label", qe, [s(
|
|
649
|
+
a("label", qe, [s(T(se), {
|
|
638
650
|
size: 16,
|
|
639
651
|
"aria-hidden": "true"
|
|
640
|
-
}),
|
|
652
|
+
}), P(a("input", {
|
|
641
653
|
ref_key: "search",
|
|
642
654
|
ref: x,
|
|
643
655
|
"onUpdate:modelValue": o[1] ||= (e) => h.value = e,
|
|
@@ -645,54 +657,54 @@ var Ue = { class: "kvc-picker" }, We = [
|
|
|
645
657
|
role: "combobox",
|
|
646
658
|
"aria-expanded": "true",
|
|
647
659
|
"aria-controls": "kvc-models",
|
|
648
|
-
placeholder:
|
|
649
|
-
"aria-label":
|
|
660
|
+
placeholder: T(d).t("kvcoder.ui.searchModels"),
|
|
661
|
+
"aria-label": T(d).t("kvcoder.ui.searchModels"),
|
|
650
662
|
"data-test": "model-search",
|
|
651
663
|
onKeydown: [
|
|
652
|
-
o[2] ||=
|
|
653
|
-
o[3] ||=
|
|
654
|
-
|
|
664
|
+
o[2] ||= F(I((e) => ie(1), ["prevent"]), ["down"]),
|
|
665
|
+
o[3] ||= F(I((e) => ie(-1), ["prevent"]), ["up"]),
|
|
666
|
+
F(I(W, ["prevent"]), ["enter"])
|
|
655
667
|
]
|
|
656
|
-
}, null, 40, Je), [[
|
|
668
|
+
}, null, 40, Je), [[j, h.value]])]),
|
|
657
669
|
a("div", {
|
|
658
670
|
id: "kvc-models",
|
|
659
671
|
class: "kvc-options",
|
|
660
672
|
role: "listbox",
|
|
661
|
-
"aria-label":
|
|
673
|
+
"aria-label": T(d).t("kvcoder.ui.model")
|
|
662
674
|
}, [
|
|
663
|
-
|
|
675
|
+
A.value ? (_(), i("div", {
|
|
664
676
|
key: 0,
|
|
665
677
|
class: "kvc-model",
|
|
666
678
|
role: "option",
|
|
667
679
|
"aria-selected": l.current === null,
|
|
668
680
|
"data-active": g.value === 0,
|
|
669
681
|
"data-test": "model-none-entry",
|
|
670
|
-
onClick:
|
|
682
|
+
onClick: U,
|
|
671
683
|
onMousemove: o[4] ||= (e) => g.value = 0
|
|
672
|
-
}, [a("span", Ze,
|
|
684
|
+
}, [a("span", Ze, w(l.none), 1), l.current === null ? (_(), n(T(ae), {
|
|
673
685
|
key: 0,
|
|
674
686
|
size: 16,
|
|
675
687
|
"aria-hidden": "true"
|
|
676
688
|
})) : r("v-if", !0)], 40, Xe)) : r("v-if", !0),
|
|
677
|
-
(_(!0), i(e, null, b(
|
|
689
|
+
(_(!0), i(e, null, b(E.value.groups, (t) => (_(), i(e, { key: t.provider }, [a("div", Qe, w(t.title), 1), (_(!0), i(e, null, b(t.models, (e) => (_(), i("div", {
|
|
678
690
|
key: e.id,
|
|
679
691
|
class: "kvc-model",
|
|
680
692
|
role: "option",
|
|
681
693
|
"aria-selected": e.id === l.current,
|
|
682
|
-
"data-active":
|
|
694
|
+
"data-active": R(e.id) === g.value,
|
|
683
695
|
"data-test": `model-${e.id}`,
|
|
684
|
-
onClick: (t) =>
|
|
685
|
-
onMousemove: (t) => g.value =
|
|
686
|
-
}, [a("span", et,
|
|
696
|
+
onClick: (t) => H(e.id),
|
|
697
|
+
onMousemove: (t) => g.value = R(e.id)
|
|
698
|
+
}, [a("span", et, w(e.name), 1), e.id === l.current ? (_(), n(T(ae), {
|
|
687
699
|
key: 0,
|
|
688
700
|
size: 16,
|
|
689
701
|
"aria-hidden": "true"
|
|
690
702
|
})) : r("v-if", !0)], 40, $e))), 128))], 64))), 128)),
|
|
691
|
-
|
|
703
|
+
E.value.shown === 0 ? (_(), i("p", tt, w(T(d).t("kvcoder.ui.noModels")), 1)) : r("v-if", !0)
|
|
692
704
|
], 8, Ye),
|
|
693
|
-
a("p", nt,
|
|
694
|
-
shown:
|
|
695
|
-
total:
|
|
705
|
+
a("p", nt, w(T(d).t("kvcoder.ui.modelsCount", {
|
|
706
|
+
shown: E.value.shown,
|
|
707
|
+
total: E.value.total
|
|
696
708
|
})), 1)
|
|
697
709
|
], 40, Ke)) : r("v-if", !0)]));
|
|
698
710
|
}
|
|
@@ -704,14 +716,15 @@ var Ue = { class: "kvc-picker" }, We = [
|
|
|
704
716
|
"background",
|
|
705
717
|
"ask",
|
|
706
718
|
"delegate",
|
|
707
|
-
"mcp"
|
|
719
|
+
"mcp",
|
|
720
|
+
"web"
|
|
708
721
|
], ot = [
|
|
709
722
|
"shell",
|
|
710
723
|
"delegate",
|
|
711
724
|
"mcp"
|
|
712
725
|
], st = (e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : [];
|
|
713
726
|
function ct(e) {
|
|
714
|
-
let n = y([]), r =
|
|
727
|
+
let n = y([]), r = J(e, "kvcoder.connectors.disabled"), i = t(() => st(r.value.value)), a = async () => {
|
|
715
728
|
n.value = await e.exec("kvcoder.connector.list", {});
|
|
716
729
|
}, o = t(() => [...at.map((t) => ({
|
|
717
730
|
name: t,
|
|
@@ -724,7 +737,7 @@ function ct(e) {
|
|
|
724
737
|
on: !i.value.includes(e.name),
|
|
725
738
|
configurable: ot.includes(e.name)
|
|
726
739
|
})));
|
|
727
|
-
return h(a),
|
|
740
|
+
return h(a), M(() => e.workspace.value.id, a), {
|
|
728
741
|
items: o,
|
|
729
742
|
locked: r.locked,
|
|
730
743
|
changed: r.changed,
|
|
@@ -762,25 +775,25 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
762
775
|
}),
|
|
763
776
|
emits: ["update:draft"],
|
|
764
777
|
setup(t) {
|
|
765
|
-
let n =
|
|
778
|
+
let n = E(t, "draft"), r = t, s = K(), c = (e) => s.t(`kvcoder.config.workers.form.${e}`);
|
|
766
779
|
return (t, l) => (_(), i(e, null, [
|
|
767
780
|
a("fieldset", lt, [
|
|
768
|
-
a("legend", ut,
|
|
781
|
+
a("legend", ut, w(c("approval")), 1),
|
|
769
782
|
(_(), i(e, null, b(["ask", "auto"], (e) => a("label", {
|
|
770
783
|
key: e,
|
|
771
784
|
class: "kvc-form-radio"
|
|
772
|
-
}, [
|
|
785
|
+
}, [P(a("input", {
|
|
773
786
|
"onUpdate:modelValue": l[0] ||= (e) => n.value.approval = e,
|
|
774
787
|
type: "radio",
|
|
775
788
|
name: "kvc-worker-approval",
|
|
776
789
|
value: e,
|
|
777
790
|
"data-test": `worker-approval-${e}`
|
|
778
|
-
}, null, 8, dt), [[
|
|
779
|
-
r.approvalProblem === void 0 ? (_(), i("span", pt,
|
|
791
|
+
}, null, 8, dt), [[k, n.value.approval]]), o(" " + w(c(`approval.${e}`)), 1)])), 64)),
|
|
792
|
+
r.approvalProblem === void 0 ? (_(), i("span", pt, w(c("approvalHint")), 1)) : (_(), i("span", ft, w(T(s).t(r.approvalProblem)), 1))
|
|
780
793
|
]),
|
|
781
794
|
a("label", mt, [
|
|
782
|
-
a("span", ht,
|
|
783
|
-
|
|
795
|
+
a("span", ht, w(c("minutes")), 1),
|
|
796
|
+
P(a("input", {
|
|
784
797
|
"onUpdate:modelValue": l[1] ||= (e) => n.value.minutes = e,
|
|
785
798
|
type: "text",
|
|
786
799
|
inputmode: "numeric",
|
|
@@ -789,12 +802,12 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
789
802
|
autocomplete: "off",
|
|
790
803
|
"aria-invalid": r.minutesProblem !== void 0,
|
|
791
804
|
"data-test": "worker-minutes"
|
|
792
|
-
}, null, 8, gt), [[
|
|
793
|
-
r.minutesProblem === void 0 ? (_(), i("span", vt,
|
|
805
|
+
}, null, 8, gt), [[j, n.value.minutes]]),
|
|
806
|
+
r.minutesProblem === void 0 ? (_(), i("span", vt, w(c("minutesHint")), 1)) : (_(), i("span", _t, w(T(s).t(r.minutesProblem)), 1))
|
|
794
807
|
]),
|
|
795
808
|
a("label", yt, [
|
|
796
|
-
a("span", bt,
|
|
797
|
-
|
|
809
|
+
a("span", bt, w(c("model")), 1),
|
|
810
|
+
P(a("input", {
|
|
798
811
|
"onUpdate:modelValue": l[2] ||= (e) => n.value.programModel = e,
|
|
799
812
|
type: "text",
|
|
800
813
|
dir: "ltr",
|
|
@@ -802,12 +815,12 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
802
815
|
spellcheck: "false",
|
|
803
816
|
autocomplete: "off",
|
|
804
817
|
"data-test": "worker-program-model"
|
|
805
|
-
}, null, 512), [[
|
|
806
|
-
a("span", xt,
|
|
818
|
+
}, null, 512), [[j, n.value.programModel]]),
|
|
819
|
+
a("span", xt, w(c("programDefault")), 1)
|
|
807
820
|
]),
|
|
808
821
|
n.value.kind === "opencode" ? (_(), i(e, { key: 0 }, [a("label", St, [
|
|
809
|
-
a("span", Ct,
|
|
810
|
-
|
|
822
|
+
a("span", Ct, w(c("agent")), 1),
|
|
823
|
+
P(a("input", {
|
|
811
824
|
"onUpdate:modelValue": l[3] ||= (e) => n.value.agent = e,
|
|
812
825
|
type: "text",
|
|
813
826
|
dir: "ltr",
|
|
@@ -815,48 +828,48 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
815
828
|
spellcheck: "false",
|
|
816
829
|
autocomplete: "off",
|
|
817
830
|
"data-test": "worker-agent"
|
|
818
|
-
}, null, 512), [[
|
|
819
|
-
a("span", wt,
|
|
820
|
-
]), a("label", Tt, [
|
|
831
|
+
}, null, 512), [[j, n.value.agent]]),
|
|
832
|
+
a("span", wt, w(c("programDefault")), 1)
|
|
833
|
+
]), a("label", Tt, [P(a("input", {
|
|
821
834
|
"onUpdate:modelValue": l[4] ||= (e) => n.value.autoApprove = e,
|
|
822
835
|
type: "checkbox",
|
|
823
836
|
"data-test": "worker-auto-approve"
|
|
824
|
-
}, null, 512), [[
|
|
837
|
+
}, null, 512), [[O, n.value.autoApprove]]), o(" " + w(c("autoApprove")), 1)])], 64)) : n.value.kind === "pi" ? (_(), i(e, { key: 1 }, [a("label", Et, [a("span", Dt, w(c("thinking")), 1), P(a("select", {
|
|
825
838
|
"onUpdate:modelValue": l[5] ||= (e) => n.value.piThinking = e,
|
|
826
839
|
class: "kvc-button",
|
|
827
840
|
"data-test": "worker-pi-thinking"
|
|
828
|
-
}, [a("option", Ot,
|
|
841
|
+
}, [a("option", Ot, w(c("programDefault")), 1), (_(!0), i(e, null, b(T(Te), (e) => (_(), i("option", {
|
|
829
842
|
key: e,
|
|
830
843
|
value: e
|
|
831
|
-
},
|
|
832
|
-
a("span", jt,
|
|
833
|
-
|
|
844
|
+
}, w(e), 9, kt))), 128))], 512), [[A, n.value.piThinking]])]), a("label", At, [
|
|
845
|
+
a("span", jt, w(c("tools")), 1),
|
|
846
|
+
P(a("textarea", {
|
|
834
847
|
"onUpdate:modelValue": l[6] ||= (e) => n.value.tools = e,
|
|
835
848
|
dir: "ltr",
|
|
836
849
|
rows: "3",
|
|
837
850
|
class: "kvc-field kvc-mono",
|
|
838
851
|
spellcheck: "false",
|
|
839
852
|
"data-test": "worker-tools"
|
|
840
|
-
}, null, 512), [[
|
|
841
|
-
a("span", Mt,
|
|
842
|
-
])], 64)) : (_(), i(e, { key: 2 }, [a("label", Nt, [a("span", Pt,
|
|
853
|
+
}, null, 512), [[j, n.value.tools]]),
|
|
854
|
+
a("span", Mt, w(c("toolsHint")), 1)
|
|
855
|
+
])], 64)) : (_(), i(e, { key: 2 }, [a("label", Nt, [a("span", Pt, w(c("effort")), 1), P(a("select", {
|
|
843
856
|
"onUpdate:modelValue": l[7] ||= (e) => n.value.effort = e,
|
|
844
857
|
class: "kvc-button",
|
|
845
858
|
"data-test": "worker-effort"
|
|
846
|
-
}, [a("option", Ft,
|
|
859
|
+
}, [a("option", Ft, w(c("programDefault")), 1), (_(!0), i(e, null, b(T(Ee), (e) => (_(), i("option", {
|
|
847
860
|
key: e,
|
|
848
861
|
value: e
|
|
849
|
-
},
|
|
850
|
-
a("span", Rt,
|
|
851
|
-
|
|
862
|
+
}, w(e), 9, It))), 128))], 512), [[A, n.value.effort]])]), a("label", Lt, [
|
|
863
|
+
a("span", Rt, w(c("permissionMode")), 1),
|
|
864
|
+
P(a("select", {
|
|
852
865
|
"onUpdate:modelValue": l[8] ||= (e) => n.value.permissionMode = e,
|
|
853
866
|
class: "kvc-button",
|
|
854
867
|
"data-test": "worker-permission-mode"
|
|
855
|
-
}, [(_(!0), i(e, null, b(
|
|
868
|
+
}, [(_(!0), i(e, null, b(T(De), (e) => (_(), i("option", {
|
|
856
869
|
key: e,
|
|
857
870
|
value: e
|
|
858
|
-
},
|
|
859
|
-
a("span", Bt,
|
|
871
|
+
}, w(e), 9, zt))), 128))], 512), [[A, n.value.permissionMode]]),
|
|
872
|
+
a("span", Bt, w(c("permissionModeHint")), 1)
|
|
860
873
|
])], 64))
|
|
861
874
|
], 64));
|
|
862
875
|
}
|
|
@@ -911,13 +924,13 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
911
924
|
},
|
|
912
925
|
emits: ["save", "cancel"],
|
|
913
926
|
setup(c, { emit: l }) {
|
|
914
|
-
let u = c, d = l, f =
|
|
927
|
+
let u = c, d = l, f = K(), p = v(Pe(u.entry)), m = y({}), g = y([]), x = y([]), S = y([]), C = (e) => f.t(`kvcoder.config.workers.form.${e}`), E = u.entry !== void 0, D = [
|
|
915
928
|
"delegate",
|
|
916
929
|
"ask",
|
|
917
930
|
"execution-map"
|
|
918
|
-
],
|
|
919
|
-
function
|
|
920
|
-
p.model = e, p.thinking !== "" && (p.thinking = xe(
|
|
931
|
+
], k = t(() => [...at.filter((e) => !D.includes(e)), ...S.value]), M = t(() => Se(g.value, x.value, p.model)), N = t(() => we(M.value, p.model));
|
|
932
|
+
function F(e) {
|
|
933
|
+
p.model = e, p.thinking !== "" && (p.thinking = xe(N.value, p.thinking));
|
|
921
934
|
}
|
|
922
935
|
h(async () => {
|
|
923
936
|
try {
|
|
@@ -928,7 +941,7 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
928
941
|
]);
|
|
929
942
|
g.value = e, x.value = t, S.value = n.map((e) => e.name);
|
|
930
943
|
} catch (e) {
|
|
931
|
-
|
|
944
|
+
q(f, e);
|
|
932
945
|
}
|
|
933
946
|
});
|
|
934
947
|
function L(e, t) {
|
|
@@ -936,18 +949,18 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
936
949
|
p.connectors = n ? [...p.connectors, e] : p.connectors.filter((t) => t !== e);
|
|
937
950
|
}
|
|
938
951
|
function R() {
|
|
939
|
-
m.value = Ve(p, u.taken), !(Object.keys(m.value).length > 0) && d("save", Fe(p,
|
|
952
|
+
m.value = Ve(p, u.taken), !(Object.keys(m.value).length > 0) && d("save", Fe(p, k.value));
|
|
940
953
|
}
|
|
941
954
|
return (t, c) => (_(), i("form", {
|
|
942
955
|
class: "kvc-form",
|
|
943
956
|
novalidate: "",
|
|
944
957
|
"data-test": "worker-form",
|
|
945
|
-
onSubmit:
|
|
958
|
+
onSubmit: I(R, ["prevent"])
|
|
946
959
|
}, [
|
|
947
|
-
a("span", Ht,
|
|
960
|
+
a("span", Ht, w(E ? T(f).t("kvcoder.config.workers.form.titleEdit", { name: p.name }) : C("titleNew")), 1),
|
|
948
961
|
a("label", Ut, [
|
|
949
|
-
a("span", Wt, C(
|
|
950
|
-
|
|
962
|
+
a("span", Wt, w(C("name")), 1),
|
|
963
|
+
P(a("input", {
|
|
951
964
|
"onUpdate:modelValue": c[0] ||= (e) => p.name = e,
|
|
952
965
|
type: "text",
|
|
953
966
|
dir: "ltr",
|
|
@@ -957,12 +970,12 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
957
970
|
autocomplete: "off",
|
|
958
971
|
"aria-invalid": m.value.name !== void 0,
|
|
959
972
|
"data-test": "worker-name"
|
|
960
|
-
}, null, 8, Gt), [[
|
|
961
|
-
m.value.name === void 0 ? (_(), i("span", qt, C(
|
|
973
|
+
}, null, 8, Gt), [[j, p.name]]),
|
|
974
|
+
m.value.name === void 0 ? (_(), i("span", qt, w(C("nameHint")), 1)) : (_(), i("span", Kt, w(T(f).t(m.value.name)), 1))
|
|
962
975
|
]),
|
|
963
976
|
a("label", Jt, [
|
|
964
|
-
a("span", Yt, C(
|
|
965
|
-
|
|
977
|
+
a("span", Yt, w(C("description")), 1),
|
|
978
|
+
P(a("input", {
|
|
966
979
|
"onUpdate:modelValue": c[1] ||= (e) => p.description = e,
|
|
967
980
|
type: "text",
|
|
968
981
|
dir: "auto",
|
|
@@ -970,57 +983,57 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
970
983
|
autocomplete: "off",
|
|
971
984
|
"aria-invalid": m.value.description !== void 0,
|
|
972
985
|
"data-test": "worker-description"
|
|
973
|
-
}, null, 8, Xt), [[
|
|
974
|
-
m.value.description === void 0 ? (_(), i("span", Qt, C(
|
|
986
|
+
}, null, 8, Xt), [[j, p.description]]),
|
|
987
|
+
m.value.description === void 0 ? (_(), i("span", Qt, w(C("descriptionHint")), 1)) : (_(), i("span", Zt, w(T(f).t(m.value.description)), 1))
|
|
975
988
|
]),
|
|
976
989
|
a("label", $t, [
|
|
977
|
-
a("span", en, C(
|
|
978
|
-
|
|
990
|
+
a("span", en, w(C("kind")), 1),
|
|
991
|
+
P(a("select", {
|
|
979
992
|
"onUpdate:modelValue": c[2] ||= (e) => p.kind = e,
|
|
980
993
|
class: "kvc-button",
|
|
981
994
|
disabled: E,
|
|
982
995
|
"data-test": "worker-kind-select"
|
|
983
|
-
}, [(_(!0), i(e, null, b(
|
|
996
|
+
}, [(_(!0), i(e, null, b(T(Oe), (e) => (_(), i("option", {
|
|
984
997
|
key: e,
|
|
985
998
|
value: e
|
|
986
|
-
},
|
|
987
|
-
a("span", nn, C(
|
|
999
|
+
}, w(T(f).t(`kvcoder.config.workers.kind.${e}`)), 9, tn))), 128))], 512), [[A, p.kind]]),
|
|
1000
|
+
a("span", nn, w(C("kindHint")), 1)
|
|
988
1001
|
]),
|
|
989
1002
|
a("label", rn, [
|
|
990
|
-
a("span", an, C(
|
|
991
|
-
|
|
1003
|
+
a("span", an, w(C("instructions")), 1),
|
|
1004
|
+
P(a("textarea", {
|
|
992
1005
|
"onUpdate:modelValue": c[3] ||= (e) => p.instructions = e,
|
|
993
1006
|
dir: "auto",
|
|
994
1007
|
rows: "8",
|
|
995
1008
|
class: "kvc-field",
|
|
996
1009
|
"aria-invalid": m.value.instructions !== void 0,
|
|
997
1010
|
"data-test": "worker-instructions"
|
|
998
|
-
}, null, 8, on), [[
|
|
999
|
-
m.value.instructions === void 0 ? (_(), i("span", cn, C(
|
|
1011
|
+
}, null, 8, on), [[j, p.instructions]]),
|
|
1012
|
+
m.value.instructions === void 0 ? (_(), i("span", cn, w(C("instructionsHint")), 1)) : (_(), i("span", sn, w(T(f).t(m.value.instructions)), 1))
|
|
1000
1013
|
]),
|
|
1001
1014
|
p.kind === "subagent" ? (_(), i(e, { key: 1 }, [
|
|
1002
|
-
a("label", ln, [a("span", un, [
|
|
1015
|
+
a("label", ln, [a("span", un, [P(a("input", {
|
|
1003
1016
|
"onUpdate:modelValue": c[4] ||= (e) => p.readOnly = e,
|
|
1004
1017
|
type: "checkbox",
|
|
1005
1018
|
"data-test": "worker-read-only"
|
|
1006
|
-
}, null, 512), [[
|
|
1019
|
+
}, null, 512), [[O, p.readOnly]]), o(w(C("readOnly")), 1)]), a("span", dn, w(C("readOnlyHint")), 1)]),
|
|
1007
1020
|
a("fieldset", fn, [
|
|
1008
|
-
a("legend", pn, C(
|
|
1021
|
+
a("legend", pn, w(C("connectors")), 1),
|
|
1009
1022
|
a("label", mn, [a("input", {
|
|
1010
1023
|
type: "radio",
|
|
1011
1024
|
name: "kvc-worker-connectors",
|
|
1012
1025
|
checked: p.all,
|
|
1013
1026
|
"data-test": "worker-connectors-all",
|
|
1014
1027
|
onChange: c[5] ||= (e) => p.all = !0
|
|
1015
|
-
}, null, 40, hn), o(" " + C(
|
|
1028
|
+
}, null, 40, hn), o(" " + w(C("connectors.all")), 1)]),
|
|
1016
1029
|
a("label", gn, [a("input", {
|
|
1017
1030
|
type: "radio",
|
|
1018
1031
|
name: "kvc-worker-connectors",
|
|
1019
1032
|
checked: !p.all,
|
|
1020
1033
|
"data-test": "worker-connectors-some",
|
|
1021
1034
|
onChange: c[6] ||= (e) => p.all = !1
|
|
1022
|
-
}, null, 40, _n), o(" " + C(
|
|
1023
|
-
p.all ? r("v-if", !0) : (_(!0), i(e, { key: 0 }, b(
|
|
1035
|
+
}, null, 40, _n), o(" " + w(C("connectors.some")), 1)]),
|
|
1036
|
+
p.all ? r("v-if", !0) : (_(!0), i(e, { key: 0 }, b(k.value, (e) => (_(), i("label", {
|
|
1024
1037
|
key: e,
|
|
1025
1038
|
class: "kvc-form-radio kvc-mono"
|
|
1026
1039
|
}, [a("input", {
|
|
@@ -1028,15 +1041,15 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
1028
1041
|
checked: p.connectors.includes(e),
|
|
1029
1042
|
"data-test": `worker-connector-${e}`,
|
|
1030
1043
|
onChange: (t) => L(e, t)
|
|
1031
|
-
}, null, 40, vn), o(" " +
|
|
1032
|
-
m.value.connectors === void 0 ? (_(), i("span", bn, C(
|
|
1044
|
+
}, null, 40, vn), o(" " + w(e), 1)]))), 128)),
|
|
1045
|
+
m.value.connectors === void 0 ? (_(), i("span", bn, w(C("connectorsHint")), 1)) : (_(), i("span", yn, w(T(f).t(m.value.connectors)), 1))
|
|
1033
1046
|
]),
|
|
1034
|
-
a("div", xn, [a("span", Sn, C(
|
|
1047
|
+
a("div", xn, [a("span", Sn, w(C("model")), 1), s(it, {
|
|
1035
1048
|
groups: M.value,
|
|
1036
1049
|
current: p.model,
|
|
1037
|
-
empty:
|
|
1038
|
-
none:
|
|
1039
|
-
onPick:
|
|
1050
|
+
empty: C("sameModel"),
|
|
1051
|
+
none: C("sameModel"),
|
|
1052
|
+
onPick: F,
|
|
1040
1053
|
onNone: c[7] ||= (e) => p.model = null
|
|
1041
1054
|
}, null, 8, [
|
|
1042
1055
|
"groups",
|
|
@@ -1044,14 +1057,14 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
1044
1057
|
"empty",
|
|
1045
1058
|
"none"
|
|
1046
1059
|
])]),
|
|
1047
|
-
a("label", Cn, [a("span", wn, C(
|
|
1060
|
+
a("label", Cn, [a("span", wn, w(C("thinking")), 1), P(a("select", {
|
|
1048
1061
|
"onUpdate:modelValue": c[8] ||= (e) => p.thinking = e,
|
|
1049
1062
|
class: "kvc-button",
|
|
1050
1063
|
"data-test": "worker-thinking"
|
|
1051
|
-
}, [a("option", Tn, C(
|
|
1064
|
+
}, [a("option", Tn, w(C("sameThinking")), 1), (_(!0), i(e, null, b(N.value, (e) => (_(), i("option", {
|
|
1052
1065
|
key: e,
|
|
1053
1066
|
value: e
|
|
1054
|
-
},
|
|
1067
|
+
}, w(T(f).t(`kvcoder.ui.thinkingLevels.${e}`)), 9, En))), 128))], 512), [[A, p.thinking]])])
|
|
1055
1068
|
], 64)) : (_(), n(Vt, {
|
|
1056
1069
|
key: 0,
|
|
1057
1070
|
draft: p,
|
|
@@ -1068,12 +1081,12 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
1068
1081
|
disabled: u.working,
|
|
1069
1082
|
"data-test": "worker-cancel",
|
|
1070
1083
|
onClick: c[9] ||= (e) => d("cancel")
|
|
1071
|
-
},
|
|
1084
|
+
}, w(T(f).t("kvcoder.config.workers.cancel")), 9, On), a("button", {
|
|
1072
1085
|
type: "submit",
|
|
1073
1086
|
class: "kvc-button kvc-primary",
|
|
1074
1087
|
disabled: u.working,
|
|
1075
1088
|
"data-test": "worker-save"
|
|
1076
|
-
}, C(
|
|
1089
|
+
}, w(C("save")), 9, kn)])
|
|
1077
1090
|
], 32));
|
|
1078
1091
|
}
|
|
1079
1092
|
}), jn = {
|
|
@@ -1137,37 +1150,37 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
1137
1150
|
], er = { class: "kvc-actions" }, tr = ["disabled"], nr = /* @__PURE__ */ c({
|
|
1138
1151
|
__name: "DelegateWorkers",
|
|
1139
1152
|
setup(t) {
|
|
1140
|
-
let c =
|
|
1153
|
+
let c = K(), { workers: l, states: u, locked: d, changed: p, working: m, save: h, remove: g, toggle: v, reset: x, check: S } = He(c), C = 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 });
|
|
1141
1154
|
async function k(e) {
|
|
1142
|
-
await h(e) && (
|
|
1155
|
+
await h(e) && (C.value = void 0, c.toast("kvcoder.config.workers.saved", { name: e.name }, "success"));
|
|
1143
1156
|
}
|
|
1144
1157
|
async function A(e) {
|
|
1145
1158
|
await g(e) && c.toast("kvcoder.config.workers.removed", { name: e }, "success"), E.value = void 0;
|
|
1146
1159
|
}
|
|
1147
|
-
return (t, h) =>
|
|
1148
|
-
a("p", Mn,
|
|
1149
|
-
|
|
1160
|
+
return (t, h) => C.value === void 0 ? (_(), i("div", jn, [
|
|
1161
|
+
a("p", Mn, w(T(c).t("kvcoder.config.workers.intro")), 1),
|
|
1162
|
+
T(d) ? (_(), i("p", Nn, w(T(c).t("kvcoder.config.connectors.ownValue", { name: T(c).workspace.value.name })), 1)) : T(p) ? (_(), i("div", Pn, [a("span", Fn, w(D("kvcoder.config.connectors.changed")), 1), a("button", {
|
|
1150
1163
|
type: "button",
|
|
1151
1164
|
class: "kvc-text-button",
|
|
1152
|
-
disabled:
|
|
1165
|
+
disabled: T(m),
|
|
1153
1166
|
"data-test": "workers-reset",
|
|
1154
|
-
onClick: h[1] ||= (...e) =>
|
|
1155
|
-
},
|
|
1156
|
-
|
|
1157
|
-
(_(!0), i(e, null, b(
|
|
1167
|
+
onClick: h[1] ||= (...e) => T(x) && T(x)(...e)
|
|
1168
|
+
}, w(D("kvcoder.config.connectors.reset")), 9, In)])) : r("v-if", !0),
|
|
1169
|
+
T(l).length === 0 ? (_(), i("p", Ln, w(T(c).t("kvcoder.config.workers.empty")), 1)) : r("v-if", !0),
|
|
1170
|
+
(_(!0), i(e, null, b(T(l), (e) => (_(), i("div", {
|
|
1158
1171
|
key: e.name,
|
|
1159
1172
|
class: "kvc-connector",
|
|
1160
1173
|
"data-test": `worker-${e.name}`
|
|
1161
1174
|
}, [a("span", zn, [
|
|
1162
|
-
a("span", Bn,
|
|
1163
|
-
a("span", Vn,
|
|
1164
|
-
a("span", null, [a("span", Hn,
|
|
1165
|
-
|
|
1175
|
+
a("span", Bn, w(e.name), 1),
|
|
1176
|
+
a("span", Vn, w(e.description), 1),
|
|
1177
|
+
a("span", null, [a("span", Hn, w(T(c).t(`kvcoder.config.workers.kind.${e.kind}`)), 1)]),
|
|
1178
|
+
T(u)[e.name] === "checking" ? (_(), i("span", Un, w(T(c).t("kvcoder.config.workers.checking")), 1)) : T(u)[e.name] === "notFound" ? (_(), i("span", Wn, [o(w(T(c).t("kvcoder.config.workers.notFound", { program: e.kind })) + " ", 1), a("button", {
|
|
1166
1179
|
type: "button",
|
|
1167
1180
|
class: "kvc-text-button",
|
|
1168
1181
|
"data-test": "worker-check",
|
|
1169
|
-
onClick: (t) =>
|
|
1170
|
-
},
|
|
1182
|
+
onClick: (t) => T(S)(e.name)
|
|
1183
|
+
}, w(T(c).t("kvcoder.config.workers.recheck")), 9, Gn)])) : r("v-if", !0)
|
|
1171
1184
|
]), E.value === e.name ? (_(), i("span", {
|
|
1172
1185
|
key: 0,
|
|
1173
1186
|
class: "kvc-connector-actions",
|
|
@@ -1175,43 +1188,43 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
1175
1188
|
"aria-label": O("removeConfirm", e.name),
|
|
1176
1189
|
"data-test": "worker-remove-confirm"
|
|
1177
1190
|
}, [
|
|
1178
|
-
a("span", qn,
|
|
1191
|
+
a("span", qn, w(O("removeConfirm", e.name)), 1),
|
|
1179
1192
|
a("button", {
|
|
1180
1193
|
type: "button",
|
|
1181
1194
|
class: "kvc-button",
|
|
1182
|
-
disabled:
|
|
1195
|
+
disabled: T(m),
|
|
1183
1196
|
"data-test": "worker-remove-cancel",
|
|
1184
1197
|
onClick: h[2] ||= (e) => E.value = void 0
|
|
1185
|
-
},
|
|
1198
|
+
}, w(T(c).t("kvcoder.config.workers.cancel")), 9, Jn),
|
|
1186
1199
|
a("button", {
|
|
1187
1200
|
type: "button",
|
|
1188
1201
|
class: "kvc-button kvc-danger",
|
|
1189
|
-
disabled:
|
|
1202
|
+
disabled: T(m),
|
|
1190
1203
|
"data-test": "worker-remove-yes",
|
|
1191
1204
|
onClick: (t) => A(e.name)
|
|
1192
|
-
},
|
|
1205
|
+
}, w(T(c).t("kvcoder.config.workers.removeYes")), 9, Yn)
|
|
1193
1206
|
], 8, Kn)) : (_(), i("span", Xn, [
|
|
1194
1207
|
a("button", {
|
|
1195
1208
|
type: "button",
|
|
1196
1209
|
class: "kvc-button kvc-ghost kvc-icon-button",
|
|
1197
|
-
disabled:
|
|
1210
|
+
disabled: T(d) || T(m),
|
|
1198
1211
|
"aria-label": O("edit", e.name),
|
|
1199
1212
|
title: O("edit", e.name),
|
|
1200
1213
|
"data-test": "worker-edit",
|
|
1201
|
-
onClick: (t) =>
|
|
1202
|
-
}, [s(
|
|
1214
|
+
onClick: (t) => C.value = { entry: e }
|
|
1215
|
+
}, [s(T(U), {
|
|
1203
1216
|
size: 16,
|
|
1204
1217
|
"aria-hidden": "true"
|
|
1205
1218
|
})], 8, Zn),
|
|
1206
1219
|
a("button", {
|
|
1207
1220
|
type: "button",
|
|
1208
1221
|
class: "kvc-button kvc-ghost kvc-icon-button",
|
|
1209
|
-
disabled:
|
|
1222
|
+
disabled: T(d) || T(m),
|
|
1210
1223
|
"aria-label": O("remove", e.name),
|
|
1211
1224
|
title: O("remove", e.name),
|
|
1212
1225
|
"data-test": "worker-remove",
|
|
1213
1226
|
onClick: (t) => E.value = e.name
|
|
1214
|
-
}, [s(
|
|
1227
|
+
}, [s(T(ce), {
|
|
1215
1228
|
size: 16,
|
|
1216
1229
|
"aria-hidden": "true"
|
|
1217
1230
|
})], 8, Qn),
|
|
@@ -1221,9 +1234,9 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
1221
1234
|
class: "kvc-switch",
|
|
1222
1235
|
"aria-checked": e.enabled,
|
|
1223
1236
|
"aria-label": O("use", e.name),
|
|
1224
|
-
disabled:
|
|
1237
|
+
disabled: T(d) || T(m),
|
|
1225
1238
|
"data-test": "worker-switch",
|
|
1226
|
-
onClick: (t) =>
|
|
1239
|
+
onClick: (t) => T(v)(e.name)
|
|
1227
1240
|
}, [...h[4] ||= [a("span", {
|
|
1228
1241
|
class: "kvc-switch-knob",
|
|
1229
1242
|
"aria-hidden": "true"
|
|
@@ -1232,26 +1245,26 @@ var lt = { class: "kvc-form-choice" }, ut = { class: "kvc-form-label" }, dt = ["
|
|
|
1232
1245
|
a("div", er, [a("button", {
|
|
1233
1246
|
type: "button",
|
|
1234
1247
|
class: "kvc-button kvc-primary",
|
|
1235
|
-
disabled:
|
|
1248
|
+
disabled: T(d) || T(m),
|
|
1236
1249
|
"data-test": "worker-add",
|
|
1237
|
-
onClick: h[3] ||= (e) =>
|
|
1238
|
-
}, [s(
|
|
1250
|
+
onClick: h[3] ||= (e) => C.value = {}
|
|
1251
|
+
}, [s(T(W), {
|
|
1239
1252
|
size: 16,
|
|
1240
1253
|
"aria-hidden": "true"
|
|
1241
|
-
}), o(
|
|
1242
|
-
])) : (_(), n(An, f({ key: 0 },
|
|
1243
|
-
taken:
|
|
1244
|
-
working:
|
|
1254
|
+
}), o(w(T(c).t("kvcoder.config.workers.add")), 1)], 8, tr)])
|
|
1255
|
+
])) : (_(), n(An, f({ key: 0 }, C.value.entry === void 0 ? {} : { entry: C.value.entry }, {
|
|
1256
|
+
taken: T(l).filter((e) => e.name !== C.value?.entry?.name).map((e) => e.name),
|
|
1257
|
+
working: T(m),
|
|
1245
1258
|
onSave: k,
|
|
1246
|
-
onCancel: h[0] ||= (e) =>
|
|
1259
|
+
onCancel: h[0] ||= (e) => C.value = void 0
|
|
1247
1260
|
}), null, 16, ["taken", "working"]));
|
|
1248
1261
|
}
|
|
1249
|
-
}),
|
|
1250
|
-
function
|
|
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 &&
|
|
1262
|
+
}), rr = "@kvman/kvcoder", ir = (e) => Array.isArray(e) && e.every((e) => typeof e == "string");
|
|
1263
|
+
function ar(e) {
|
|
1264
|
+
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 && ir(e.args) && "env" in e && ir(e.env) : "url" in e && typeof e.url == "string" && "headers" in e && ir(e.headers);
|
|
1252
1265
|
}
|
|
1253
|
-
var
|
|
1254
|
-
function
|
|
1266
|
+
var or = (e) => Array.isArray(e) ? e.filter(ar) : [], sr = (e, t, n) => `mcp.${e}.${t}.${n}`, $ = (e) => `mcp.${e}.`, cr = (e) => e.kind === "command" ? "env" : "header";
|
|
1267
|
+
function lr(e, t) {
|
|
1255
1268
|
if (e === void 0) return {
|
|
1256
1269
|
name: "",
|
|
1257
1270
|
description: "",
|
|
@@ -1264,7 +1277,7 @@ function cr(e, t) {
|
|
|
1264
1277
|
let [n, r] = "command" in e ? ["env", e.env] : ["header", e.headers], i = r.map((r) => ({
|
|
1265
1278
|
name: r,
|
|
1266
1279
|
value: "",
|
|
1267
|
-
set: t.includes(
|
|
1280
|
+
set: t.includes(sr(e.name, n, r)),
|
|
1268
1281
|
replacing: !1
|
|
1269
1282
|
}));
|
|
1270
1283
|
return "command" in e ? {
|
|
@@ -1285,7 +1298,7 @@ function cr(e, t) {
|
|
|
1285
1298
|
values: i
|
|
1286
1299
|
};
|
|
1287
1300
|
}
|
|
1288
|
-
function
|
|
1301
|
+
function ur(e) {
|
|
1289
1302
|
let t = {
|
|
1290
1303
|
name: e.name.trim(),
|
|
1291
1304
|
description: e.description.trim()
|
|
@@ -1301,25 +1314,25 @@ function lr(e) {
|
|
|
1301
1314
|
env: n
|
|
1302
1315
|
};
|
|
1303
1316
|
}
|
|
1304
|
-
var
|
|
1317
|
+
var dr = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/, fr = {
|
|
1305
1318
|
env: /^[A-Za-z_][A-Za-z0-9_]*$/,
|
|
1306
1319
|
header: /^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/
|
|
1307
|
-
},
|
|
1308
|
-
function
|
|
1309
|
-
let t =
|
|
1310
|
-
return n.some((e) => !
|
|
1320
|
+
}, pr = (e) => URL.canParse(e) && ["http:", "https:"].includes(new URL(e).protocol);
|
|
1321
|
+
function mr(e) {
|
|
1322
|
+
let t = cr(e), n = e.values.map((e) => e.name.trim());
|
|
1323
|
+
return n.some((e) => !fr[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";
|
|
1311
1324
|
}
|
|
1312
|
-
function
|
|
1325
|
+
function hr(e, t) {
|
|
1313
1326
|
let n = e.name.trim(), r = {};
|
|
1314
|
-
n === "" ? r.name = "kvcoder.config.mcp.invalid.nameEmpty" :
|
|
1315
|
-
let i =
|
|
1327
|
+
n === "" ? r.name = "kvcoder.config.mcp.invalid.nameEmpty" : dr.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" && !pr(e.url.trim()) && (r.url = "kvcoder.config.mcp.invalid.url");
|
|
1328
|
+
let i = mr(e);
|
|
1316
1329
|
return i !== void 0 && (r.values = i), r;
|
|
1317
1330
|
}
|
|
1318
|
-
function
|
|
1331
|
+
function gr(e, t) {
|
|
1319
1332
|
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;
|
|
1320
1333
|
}
|
|
1321
|
-
function
|
|
1322
|
-
let r = e.name.trim(), i =
|
|
1334
|
+
function _r(e, t, n) {
|
|
1335
|
+
let r = e.name.trim(), i = cr(e), a = new Set(e.values.map((e) => sr(r, i, e.name.trim()))), o = Object.fromEntries(e.values.filter((e) => !e.set || e.replacing).map((e) => [sr(r, i, e.name.trim()), e.value])), s = t === void 0 ? [] : n.filter((e) => e.startsWith(`${$(r)}env.`) || e.startsWith(`${$(r)}header.`)), c = gr(e, t) ? n.filter((e) => e.startsWith(`${$(r)}oauth.`)) : [];
|
|
1323
1336
|
return {
|
|
1324
1337
|
set: o,
|
|
1325
1338
|
remove: [...s.filter((e) => !a.has(e)), ...c]
|
|
@@ -1327,75 +1340,75 @@ function gr(e, t, n) {
|
|
|
1327
1340
|
}
|
|
1328
1341
|
//#endregion
|
|
1329
1342
|
//#region web/src/McpServerForm.vue?vue&type=script&setup=true&lang.ts
|
|
1330
|
-
var
|
|
1343
|
+
var vr = {
|
|
1331
1344
|
class: "kvc-setting-title",
|
|
1332
1345
|
"data-test": "mcp-form-title"
|
|
1333
|
-
},
|
|
1346
|
+
}, yr = { class: "kvc-form-field" }, br = { class: "kvc-form-label" }, xr = ["aria-invalid"], Sr = {
|
|
1334
1347
|
key: 0,
|
|
1335
1348
|
class: "kvc-form-error",
|
|
1336
1349
|
role: "alert",
|
|
1337
1350
|
"data-test": "mcp-name-error"
|
|
1338
|
-
},
|
|
1351
|
+
}, Cr = {
|
|
1339
1352
|
key: 1,
|
|
1340
1353
|
class: "kvc-muted"
|
|
1341
|
-
},
|
|
1354
|
+
}, wr = { class: "kvc-form-field" }, Tr = { class: "kvc-form-label" }, Er = ["aria-invalid"], Dr = {
|
|
1342
1355
|
key: 0,
|
|
1343
1356
|
class: "kvc-form-error",
|
|
1344
1357
|
role: "alert",
|
|
1345
1358
|
"data-test": "mcp-description-error"
|
|
1346
|
-
},
|
|
1359
|
+
}, Or = {
|
|
1347
1360
|
key: 1,
|
|
1348
1361
|
class: "kvc-muted"
|
|
1349
|
-
},
|
|
1362
|
+
}, kr = { class: "kvc-form-choice" }, Ar = { class: "kvc-form-label" }, jr = [
|
|
1350
1363
|
"value",
|
|
1351
1364
|
"checked",
|
|
1352
1365
|
"data-test",
|
|
1353
1366
|
"onChange"
|
|
1354
|
-
],
|
|
1367
|
+
], Mr = { class: "kvc-form-field" }, Nr = { class: "kvc-form-label" }, Pr = ["aria-invalid"], Fr = {
|
|
1355
1368
|
key: 0,
|
|
1356
1369
|
class: "kvc-form-error",
|
|
1357
1370
|
role: "alert",
|
|
1358
1371
|
"data-test": "mcp-command-error"
|
|
1359
|
-
},
|
|
1372
|
+
}, Ir = {
|
|
1360
1373
|
key: 1,
|
|
1361
1374
|
class: "kvc-muted"
|
|
1362
|
-
},
|
|
1375
|
+
}, Lr = { class: "kvc-form-field" }, Rr = { class: "kvc-form-label" }, zr = { class: "kvc-muted" }, Br = {
|
|
1363
1376
|
key: 1,
|
|
1364
1377
|
class: "kvc-form-field"
|
|
1365
|
-
},
|
|
1378
|
+
}, Vr = { class: "kvc-form-label" }, Hr = ["aria-invalid"], Ur = {
|
|
1366
1379
|
key: 0,
|
|
1367
1380
|
class: "kvc-form-error",
|
|
1368
1381
|
role: "alert",
|
|
1369
1382
|
"data-test": "mcp-url-error"
|
|
1370
|
-
},
|
|
1383
|
+
}, Wr = {
|
|
1371
1384
|
class: "kvc-form-field",
|
|
1372
1385
|
"data-test": "mcp-values"
|
|
1373
|
-
},
|
|
1386
|
+
}, Gr = { class: "kvc-form-label" }, Kr = { class: "kvc-muted" }, qr = {
|
|
1374
1387
|
key: 0,
|
|
1375
1388
|
class: "kvc-muted",
|
|
1376
1389
|
role: "status",
|
|
1377
1390
|
"data-test": "mcp-moved"
|
|
1378
|
-
},
|
|
1391
|
+
}, Jr = [
|
|
1379
1392
|
"onUpdate:modelValue",
|
|
1380
1393
|
"disabled",
|
|
1381
1394
|
"placeholder",
|
|
1382
1395
|
"aria-label"
|
|
1383
|
-
],
|
|
1396
|
+
], Yr = {
|
|
1384
1397
|
key: 0,
|
|
1385
1398
|
class: "kvc-form-set"
|
|
1386
|
-
},
|
|
1399
|
+
}, Xr = {
|
|
1387
1400
|
class: "kvc-chip",
|
|
1388
1401
|
"data-test": "mcp-value-set"
|
|
1389
|
-
},
|
|
1402
|
+
}, Zr = ["onClick"], Qr = [
|
|
1390
1403
|
"onUpdate:modelValue",
|
|
1391
1404
|
"placeholder",
|
|
1392
1405
|
"aria-label"
|
|
1393
|
-
],
|
|
1406
|
+
], $r = ["aria-label", "onClick"], ei = {
|
|
1394
1407
|
key: 1,
|
|
1395
1408
|
class: "kvc-form-error",
|
|
1396
1409
|
role: "alert",
|
|
1397
1410
|
"data-test": "mcp-values-error"
|
|
1398
|
-
},
|
|
1411
|
+
}, ti = { class: "kvc-actions" }, ni = ["disabled"], ri = ["disabled"], ii = /* @__PURE__ */ c({
|
|
1399
1412
|
__name: "McpServerForm",
|
|
1400
1413
|
props: {
|
|
1401
1414
|
entry: {},
|
|
@@ -1405,27 +1418,27 @@ var _r = {
|
|
|
1405
1418
|
},
|
|
1406
1419
|
emits: ["save", "cancel"],
|
|
1407
1420
|
setup(n, { emit: c }) {
|
|
1408
|
-
let l = n, u = c, d =
|
|
1409
|
-
|
|
1421
|
+
let l = n, u = c, d = K(), f = v(lr(l.entry, l.secrets)), p = y({}), m = t(() => cr(f)), h = (e) => d.t(`kvcoder.config.mcp.form.${e}`), g = t(() => gr(f, l.entry));
|
|
1422
|
+
M(g, (e) => {
|
|
1410
1423
|
if (e) for (let e of f.values) e.set && (e.replacing = !0);
|
|
1411
1424
|
});
|
|
1412
1425
|
let x = l.entry !== void 0;
|
|
1413
1426
|
function S() {
|
|
1414
|
-
p.value =
|
|
1427
|
+
p.value = hr(f, l.taken), !(Object.keys(p.value).length > 0) && u("save", ur(f), _r(f, l.entry, l.secrets));
|
|
1415
1428
|
}
|
|
1416
|
-
function
|
|
1429
|
+
function C(e) {
|
|
1417
1430
|
f.kind !== e && (f.kind = e, f.values = []);
|
|
1418
1431
|
}
|
|
1419
1432
|
return (t, n) => (_(), i("form", {
|
|
1420
1433
|
class: "kvc-form",
|
|
1421
1434
|
novalidate: "",
|
|
1422
1435
|
"data-test": "mcp-form",
|
|
1423
|
-
onSubmit:
|
|
1436
|
+
onSubmit: I(S, ["prevent"])
|
|
1424
1437
|
}, [
|
|
1425
|
-
a("span",
|
|
1426
|
-
a("label",
|
|
1427
|
-
a("span",
|
|
1428
|
-
|
|
1438
|
+
a("span", vr, w(x ? T(d).t("kvcoder.config.mcp.form.titleEdit", { name: f.name }) : h("titleNew")), 1),
|
|
1439
|
+
a("label", yr, [
|
|
1440
|
+
a("span", br, w(h("name")), 1),
|
|
1441
|
+
P(a("input", {
|
|
1429
1442
|
"onUpdate:modelValue": n[0] ||= (e) => f.name = e,
|
|
1430
1443
|
type: "text",
|
|
1431
1444
|
dir: "ltr",
|
|
@@ -1435,12 +1448,12 @@ var _r = {
|
|
|
1435
1448
|
autocomplete: "off",
|
|
1436
1449
|
"aria-invalid": p.value.name !== void 0,
|
|
1437
1450
|
"data-test": "mcp-name"
|
|
1438
|
-
}, null, 8,
|
|
1439
|
-
p.value.name === void 0 ? (_(), i("span",
|
|
1451
|
+
}, null, 8, xr), [[j, f.name]]),
|
|
1452
|
+
p.value.name === void 0 ? (_(), i("span", Cr, w(h("nameHint")), 1)) : (_(), i("span", Sr, w(T(d).t(p.value.name)), 1))
|
|
1440
1453
|
]),
|
|
1441
|
-
a("label",
|
|
1442
|
-
a("span",
|
|
1443
|
-
|
|
1454
|
+
a("label", wr, [
|
|
1455
|
+
a("span", Tr, w(h("description")), 1),
|
|
1456
|
+
P(a("input", {
|
|
1444
1457
|
"onUpdate:modelValue": n[1] ||= (e) => f.description = e,
|
|
1445
1458
|
type: "text",
|
|
1446
1459
|
dir: "auto",
|
|
@@ -1448,10 +1461,10 @@ var _r = {
|
|
|
1448
1461
|
autocomplete: "off",
|
|
1449
1462
|
"aria-invalid": p.value.description !== void 0,
|
|
1450
1463
|
"data-test": "mcp-description"
|
|
1451
|
-
}, null, 8,
|
|
1452
|
-
p.value.description === void 0 ? (_(), i("span",
|
|
1464
|
+
}, null, 8, Er), [[j, f.description]]),
|
|
1465
|
+
p.value.description === void 0 ? (_(), i("span", Or, w(h("descriptionHint")), 1)) : (_(), i("span", Dr, w(T(d).t(p.value.description)), 1))
|
|
1453
1466
|
]),
|
|
1454
|
-
a("fieldset",
|
|
1467
|
+
a("fieldset", kr, [a("legend", Ar, w(h("kind")), 1), (_(), i(e, null, b(["command", "url"], (e) => a("label", {
|
|
1455
1468
|
key: e,
|
|
1456
1469
|
class: "kvc-form-radio"
|
|
1457
1470
|
}, [a("input", {
|
|
@@ -1460,11 +1473,11 @@ var _r = {
|
|
|
1460
1473
|
value: e,
|
|
1461
1474
|
checked: f.kind === e,
|
|
1462
1475
|
"data-test": `mcp-kind-${e}`,
|
|
1463
|
-
onChange: (t) =>
|
|
1464
|
-
}, null, 40,
|
|
1465
|
-
f.kind === "command" ? (_(), i(e, { key: 0 }, [a("label",
|
|
1466
|
-
a("span",
|
|
1467
|
-
|
|
1476
|
+
onChange: (t) => C(e)
|
|
1477
|
+
}, null, 40, jr), o(" " + w(h(`kind.${e}`)), 1)])), 64))]),
|
|
1478
|
+
f.kind === "command" ? (_(), i(e, { key: 0 }, [a("label", Mr, [
|
|
1479
|
+
a("span", Nr, w(h("command")), 1),
|
|
1480
|
+
P(a("input", {
|
|
1468
1481
|
"onUpdate:modelValue": n[2] ||= (e) => f.command = e,
|
|
1469
1482
|
type: "text",
|
|
1470
1483
|
dir: "ltr",
|
|
@@ -1473,22 +1486,22 @@ var _r = {
|
|
|
1473
1486
|
autocomplete: "off",
|
|
1474
1487
|
"aria-invalid": p.value.command !== void 0,
|
|
1475
1488
|
"data-test": "mcp-command"
|
|
1476
|
-
}, null, 8,
|
|
1477
|
-
p.value.command === void 0 ? (_(), i("span",
|
|
1478
|
-
]), a("label",
|
|
1479
|
-
a("span",
|
|
1480
|
-
|
|
1489
|
+
}, null, 8, Pr), [[j, f.command]]),
|
|
1490
|
+
p.value.command === void 0 ? (_(), i("span", Ir, w(h("commandHint")), 1)) : (_(), i("span", Fr, w(T(d).t(p.value.command)), 1))
|
|
1491
|
+
]), a("label", Lr, [
|
|
1492
|
+
a("span", Rr, w(h("args")), 1),
|
|
1493
|
+
P(a("textarea", {
|
|
1481
1494
|
"onUpdate:modelValue": n[3] ||= (e) => f.args = e,
|
|
1482
1495
|
dir: "ltr",
|
|
1483
1496
|
rows: "3",
|
|
1484
1497
|
class: "kvc-field kvc-mono",
|
|
1485
1498
|
spellcheck: "false",
|
|
1486
1499
|
"data-test": "mcp-args"
|
|
1487
|
-
}, null, 512), [[
|
|
1488
|
-
a("span",
|
|
1489
|
-
])], 64)) : (_(), i("label",
|
|
1490
|
-
a("span",
|
|
1491
|
-
|
|
1500
|
+
}, null, 512), [[j, f.args]]),
|
|
1501
|
+
a("span", zr, w(h("argsHint")), 1)
|
|
1502
|
+
])], 64)) : (_(), i("label", Br, [
|
|
1503
|
+
a("span", Vr, w(h("url")), 1),
|
|
1504
|
+
P(a("input", {
|
|
1492
1505
|
"onUpdate:modelValue": n[4] ||= (e) => f.url = e,
|
|
1493
1506
|
type: "url",
|
|
1494
1507
|
dir: "ltr",
|
|
@@ -1498,19 +1511,19 @@ var _r = {
|
|
|
1498
1511
|
placeholder: "https://",
|
|
1499
1512
|
"aria-invalid": p.value.url !== void 0,
|
|
1500
1513
|
"data-test": "mcp-url"
|
|
1501
|
-
}, null, 8,
|
|
1502
|
-
p.value.url === void 0 ? r("v-if", !0) : (_(), i("span",
|
|
1514
|
+
}, null, 8, Hr), [[j, f.url]]),
|
|
1515
|
+
p.value.url === void 0 ? r("v-if", !0) : (_(), i("span", Ur, w(T(d).t(p.value.url)), 1))
|
|
1503
1516
|
])),
|
|
1504
|
-
a("div",
|
|
1505
|
-
a("span",
|
|
1506
|
-
a("span",
|
|
1507
|
-
g.value ? (_(), i("span",
|
|
1517
|
+
a("div", Wr, [
|
|
1518
|
+
a("span", Gr, w(h(m.value)), 1),
|
|
1519
|
+
a("span", Kr, w(h("secretsHint")), 1),
|
|
1520
|
+
g.value ? (_(), i("span", qr, w(h("moved")), 1)) : r("v-if", !0),
|
|
1508
1521
|
(_(!0), i(e, null, b(f.values, (e, t) => (_(), i("div", {
|
|
1509
1522
|
key: t,
|
|
1510
1523
|
class: "kvc-form-value",
|
|
1511
1524
|
"data-test": "mcp-value"
|
|
1512
1525
|
}, [
|
|
1513
|
-
|
|
1526
|
+
P(a("input", {
|
|
1514
1527
|
"onUpdate:modelValue": (t) => e.name = t,
|
|
1515
1528
|
type: "text",
|
|
1516
1529
|
dir: "ltr",
|
|
@@ -1521,34 +1534,34 @@ var _r = {
|
|
|
1521
1534
|
spellcheck: "false",
|
|
1522
1535
|
autocomplete: "off",
|
|
1523
1536
|
"data-test": "mcp-value-name"
|
|
1524
|
-
}, null, 8,
|
|
1525
|
-
e.set && !e.replacing ? (_(), i("span",
|
|
1537
|
+
}, null, 8, Jr), [[j, e.name]]),
|
|
1538
|
+
e.set && !e.replacing ? (_(), i("span", Yr, [a("span", Xr, w(h("set")), 1), a("button", {
|
|
1526
1539
|
type: "button",
|
|
1527
1540
|
class: "kvc-text-button",
|
|
1528
1541
|
"data-test": "mcp-value-replace",
|
|
1529
1542
|
onClick: (t) => e.replacing = !0
|
|
1530
|
-
},
|
|
1543
|
+
}, w(h("replace")), 9, Zr)])) : P((_(), i("input", {
|
|
1531
1544
|
key: 1,
|
|
1532
1545
|
"onUpdate:modelValue": (t) => e.value = t,
|
|
1533
1546
|
type: "password",
|
|
1534
1547
|
autocomplete: "off",
|
|
1535
1548
|
class: "kvc-field",
|
|
1536
1549
|
placeholder: h("value"),
|
|
1537
|
-
"aria-label":
|
|
1550
|
+
"aria-label": T(d).t("kvcoder.config.mcp.form.valueOf", { name: e.name }),
|
|
1538
1551
|
"data-test": "mcp-value-secret"
|
|
1539
|
-
}, null, 8,
|
|
1552
|
+
}, null, 8, Qr)), [[j, e.value]]),
|
|
1540
1553
|
a("button", {
|
|
1541
1554
|
type: "button",
|
|
1542
1555
|
class: "kvc-button kvc-ghost kvc-icon-button",
|
|
1543
|
-
"aria-label":
|
|
1556
|
+
"aria-label": T(d).t("kvcoder.config.mcp.form.removeValue", { name: e.name }),
|
|
1544
1557
|
"data-test": "mcp-value-remove",
|
|
1545
1558
|
onClick: (e) => f.values.splice(t, 1)
|
|
1546
|
-
}, [s(
|
|
1559
|
+
}, [s(T(le), {
|
|
1547
1560
|
size: 16,
|
|
1548
1561
|
"aria-hidden": "true"
|
|
1549
|
-
})], 8,
|
|
1562
|
+
})], 8, $r)
|
|
1550
1563
|
]))), 128)),
|
|
1551
|
-
p.value.values === void 0 ? r("v-if", !0) : (_(), i("span",
|
|
1564
|
+
p.value.values === void 0 ? r("v-if", !0) : (_(), i("span", ei, w(T(d).t(p.value.values)), 1)),
|
|
1552
1565
|
a("button", {
|
|
1553
1566
|
type: "button",
|
|
1554
1567
|
class: "kvc-text-button kvc-form-add",
|
|
@@ -1559,31 +1572,31 @@ var _r = {
|
|
|
1559
1572
|
set: !1,
|
|
1560
1573
|
replacing: !1
|
|
1561
1574
|
})
|
|
1562
|
-
}, [s(
|
|
1575
|
+
}, [s(T(W), {
|
|
1563
1576
|
size: 14,
|
|
1564
1577
|
"aria-hidden": "true"
|
|
1565
|
-
}), o(
|
|
1578
|
+
}), o(w(h(`add.${m.value}`)), 1)])
|
|
1566
1579
|
]),
|
|
1567
|
-
a("div",
|
|
1580
|
+
a("div", ti, [a("button", {
|
|
1568
1581
|
type: "button",
|
|
1569
1582
|
class: "kvc-button",
|
|
1570
1583
|
disabled: l.working,
|
|
1571
1584
|
"data-test": "mcp-cancel",
|
|
1572
1585
|
onClick: n[6] ||= (e) => u("cancel")
|
|
1573
|
-
},
|
|
1586
|
+
}, w(T(d).t("kvcoder.config.mcp.cancel")), 9, ni), a("button", {
|
|
1574
1587
|
type: "submit",
|
|
1575
1588
|
class: "kvc-button kvc-primary",
|
|
1576
1589
|
disabled: l.working,
|
|
1577
1590
|
"data-test": "mcp-save"
|
|
1578
|
-
},
|
|
1591
|
+
}, w(h("save")), 9, ri)])
|
|
1579
1592
|
], 32));
|
|
1580
1593
|
}
|
|
1581
1594
|
});
|
|
1582
1595
|
//#endregion
|
|
1583
1596
|
//#region web/src/use-mcp-servers.ts
|
|
1584
|
-
function
|
|
1585
|
-
let n =
|
|
1586
|
-
a.value = (await e.exec("kernel.secrets.list", {})).filter((e) => e.extension ===
|
|
1597
|
+
function ai(e) {
|
|
1598
|
+
let n = J(e, "kvcoder.mcp.servers"), r = t(() => or(n.value.value)), i = y({}), a = y([]), o = y(!1), s = /* @__PURE__ */ new Set(), c = async () => {
|
|
1599
|
+
a.value = (await e.exec("kernel.secrets.list", {})).filter((e) => e.extension === rr).map((e) => e.name);
|
|
1587
1600
|
};
|
|
1588
1601
|
async function l(t) {
|
|
1589
1602
|
i.value = {
|
|
@@ -1617,14 +1630,14 @@ function ii(e) {
|
|
|
1617
1630
|
try {
|
|
1618
1631
|
return await t();
|
|
1619
1632
|
} catch (t) {
|
|
1620
|
-
return
|
|
1633
|
+
return q(e, t), !1;
|
|
1621
1634
|
} finally {
|
|
1622
1635
|
o.value = !1;
|
|
1623
1636
|
}
|
|
1624
1637
|
}
|
|
1625
1638
|
let f = async (t) => {
|
|
1626
1639
|
for (let n of t) await e.exec("kernel.secrets.delete", {
|
|
1627
|
-
extension:
|
|
1640
|
+
extension: rr,
|
|
1628
1641
|
name: n
|
|
1629
1642
|
});
|
|
1630
1643
|
}, p = (t, i) => d(async () => {
|
|
@@ -1637,7 +1650,7 @@ function ii(e) {
|
|
|
1637
1650
|
try {
|
|
1638
1651
|
if (!await n.set(u)) return !1;
|
|
1639
1652
|
for (let [t, n] of Object.entries(i.set)) await e.exec("kernel.secrets.set", {
|
|
1640
|
-
extension:
|
|
1653
|
+
extension: rr,
|
|
1641
1654
|
name: t,
|
|
1642
1655
|
value: n
|
|
1643
1656
|
});
|
|
@@ -1669,12 +1682,12 @@ function ii(e) {
|
|
|
1669
1682
|
try {
|
|
1670
1683
|
await c();
|
|
1671
1684
|
} catch (t) {
|
|
1672
|
-
|
|
1685
|
+
q(e, t);
|
|
1673
1686
|
}
|
|
1674
|
-
}),
|
|
1687
|
+
}), M(r, (e, t) => {
|
|
1675
1688
|
let n = new Set((t ?? []).map((e) => e.name));
|
|
1676
1689
|
for (let t of e) !s.has(t.name) && (!n.has(t.name) || !(t.name in i.value)) && l(t.name);
|
|
1677
|
-
}), g(() => window.removeEventListener("focus", b)),
|
|
1690
|
+
}), g(() => window.removeEventListener("focus", b)), M(() => e.workspace.value.id, u), {
|
|
1678
1691
|
servers: r,
|
|
1679
1692
|
states: i,
|
|
1680
1693
|
secrets: a,
|
|
@@ -1692,53 +1705,53 @@ function ii(e) {
|
|
|
1692
1705
|
}
|
|
1693
1706
|
//#endregion
|
|
1694
1707
|
//#region web/src/McpServers.vue?vue&type=script&setup=true&lang.ts
|
|
1695
|
-
var
|
|
1708
|
+
var oi = {
|
|
1696
1709
|
key: 1,
|
|
1697
1710
|
class: "kvc-dialog-rows",
|
|
1698
1711
|
"data-test": "mcp-servers"
|
|
1699
|
-
},
|
|
1712
|
+
}, si = { class: "kvc-muted" }, ci = {
|
|
1700
1713
|
key: 0,
|
|
1701
1714
|
class: "kvc-muted",
|
|
1702
1715
|
"data-test": "mcp-own-value"
|
|
1703
|
-
},
|
|
1716
|
+
}, li = {
|
|
1704
1717
|
key: 1,
|
|
1705
1718
|
class: "kvc-connectors-state"
|
|
1706
|
-
},
|
|
1719
|
+
}, ui = {
|
|
1707
1720
|
class: "kvc-chip",
|
|
1708
1721
|
"data-test": "mcp-changed"
|
|
1709
|
-
},
|
|
1722
|
+
}, di = ["disabled"], fi = {
|
|
1710
1723
|
key: 2,
|
|
1711
1724
|
class: "kvc-muted",
|
|
1712
1725
|
"data-test": "mcp-empty"
|
|
1713
|
-
},
|
|
1726
|
+
}, pi = ["data-test"], mi = { class: "kvc-connector-text" }, hi = {
|
|
1714
1727
|
class: "kvc-mono kvc-connector-name",
|
|
1715
1728
|
"data-test": "mcp-server-name"
|
|
1716
|
-
},
|
|
1729
|
+
}, gi = {
|
|
1717
1730
|
class: "kvc-muted",
|
|
1718
1731
|
dir: "auto",
|
|
1719
1732
|
"data-test": "mcp-server-description"
|
|
1720
|
-
},
|
|
1733
|
+
}, _i = ["data-status"], vi = ["onClick"], yi = ["disabled", "onClick"], bi = ["disabled", "onClick"], xi = {
|
|
1721
1734
|
key: 1,
|
|
1722
1735
|
class: "kvc-muted kvc-server-reason",
|
|
1723
1736
|
dir: "auto",
|
|
1724
1737
|
"data-test": "mcp-server-reason"
|
|
1725
|
-
},
|
|
1738
|
+
}, Si = ["aria-label"], Ci = { class: "kvc-muted" }, wi = ["disabled"], Ti = ["disabled", "onClick"], Ei = {
|
|
1726
1739
|
key: 1,
|
|
1727
1740
|
class: "kvc-connector-actions"
|
|
1728
|
-
},
|
|
1741
|
+
}, Di = [
|
|
1729
1742
|
"disabled",
|
|
1730
1743
|
"aria-label",
|
|
1731
1744
|
"title",
|
|
1732
1745
|
"onClick"
|
|
1733
|
-
],
|
|
1746
|
+
], Oi = [
|
|
1734
1747
|
"disabled",
|
|
1735
1748
|
"aria-label",
|
|
1736
1749
|
"title",
|
|
1737
1750
|
"onClick"
|
|
1738
|
-
],
|
|
1751
|
+
], ki = { class: "kvc-actions" }, Ai = ["disabled"], ji = /* @__PURE__ */ c({
|
|
1739
1752
|
__name: "McpServers",
|
|
1740
1753
|
setup(t) {
|
|
1741
|
-
let c =
|
|
1754
|
+
let c = K(), { servers: l, states: u, secrets: d, locked: p, changed: m, working: h, save: g, remove: v, reset: x, check: S, signIn: C, signOut: E, signedIn: D } = ai(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" };
|
|
1742
1755
|
function M(e) {
|
|
1743
1756
|
return e.status === "ready" ? c.t("kvcoder.config.mcp.ready", { count: e.tools }) : c.t(`kvcoder.config.mcp.${e.status}`);
|
|
1744
1757
|
}
|
|
@@ -1747,119 +1760,119 @@ var ai = {
|
|
|
1747
1760
|
await g(e, t) && (O.value = void 0, c.toast("kvcoder.config.mcp.saved", { name: e.name }, "success"));
|
|
1748
1761
|
}
|
|
1749
1762
|
async function F(e) {
|
|
1750
|
-
await
|
|
1763
|
+
await C(e) === "blocked" && c.toast("kvcoder.config.mcp.signIn.blocked", {}, "warning");
|
|
1751
1764
|
}
|
|
1752
1765
|
async function I(e) {
|
|
1753
1766
|
await v(e) && c.toast("kvcoder.config.mcp.removed", { name: e }, "success"), k.value = void 0;
|
|
1754
1767
|
}
|
|
1755
|
-
return (t, u) => O.value === void 0 ? (_(), i("div",
|
|
1756
|
-
a("p",
|
|
1757
|
-
|
|
1768
|
+
return (t, u) => O.value === void 0 ? (_(), i("div", oi, [
|
|
1769
|
+
a("p", si, w(T(c).t("kvcoder.config.mcp.intro")), 1),
|
|
1770
|
+
T(p) ? (_(), i("p", ci, w(T(c).t("kvcoder.config.connectors.ownValue", { name: T(c).workspace.value.name })), 1)) : T(m) ? (_(), i("div", li, [a("span", ui, w(A("kvcoder.config.connectors.changed")), 1), a("button", {
|
|
1758
1771
|
type: "button",
|
|
1759
1772
|
class: "kvc-text-button",
|
|
1760
|
-
disabled:
|
|
1773
|
+
disabled: T(h),
|
|
1761
1774
|
"data-test": "mcp-reset",
|
|
1762
|
-
onClick: u[1] ||= (...e) =>
|
|
1763
|
-
},
|
|
1764
|
-
|
|
1765
|
-
(_(!0), i(e, null, b(
|
|
1775
|
+
onClick: u[1] ||= (...e) => T(x) && T(x)(...e)
|
|
1776
|
+
}, w(A("kvcoder.config.connectors.reset")), 9, di)])) : r("v-if", !0),
|
|
1777
|
+
T(l).length === 0 ? (_(), i("p", fi, w(T(c).t("kvcoder.config.mcp.empty")), 1)) : r("v-if", !0),
|
|
1778
|
+
(_(!0), i(e, null, b(T(l), (e) => (_(), i("div", {
|
|
1766
1779
|
key: e.name,
|
|
1767
1780
|
class: "kvc-connector kvc-server",
|
|
1768
1781
|
"data-test": `mcp-server-${e.name}`
|
|
1769
|
-
}, [a("span",
|
|
1770
|
-
a("span",
|
|
1771
|
-
a("span",
|
|
1782
|
+
}, [a("span", mi, [
|
|
1783
|
+
a("span", hi, w(e.name), 1),
|
|
1784
|
+
a("span", gi, w(e.description), 1),
|
|
1772
1785
|
a("span", {
|
|
1773
1786
|
class: "kvc-server-state",
|
|
1774
1787
|
"data-status": j(e.name).status,
|
|
1775
1788
|
role: "status",
|
|
1776
1789
|
"data-test": "mcp-server-state"
|
|
1777
1790
|
}, [
|
|
1778
|
-
o(
|
|
1791
|
+
o(w(M(j(e.name))) + " ", 1),
|
|
1779
1792
|
j(e.name).status === "checking" ? r("v-if", !0) : (_(), i("button", {
|
|
1780
1793
|
key: 0,
|
|
1781
1794
|
type: "button",
|
|
1782
1795
|
class: "kvc-text-button",
|
|
1783
1796
|
"data-test": "mcp-server-check",
|
|
1784
|
-
onClick: (t) =>
|
|
1785
|
-
},
|
|
1786
|
-
"url" in e &&
|
|
1797
|
+
onClick: (t) => T(S)(e.name)
|
|
1798
|
+
}, w(T(c).t("kvcoder.config.mcp.recheck")), 9, vi)),
|
|
1799
|
+
"url" in e && T(D)(e.name) ? (_(), i("button", {
|
|
1787
1800
|
key: 1,
|
|
1788
1801
|
type: "button",
|
|
1789
1802
|
class: "kvc-text-button",
|
|
1790
|
-
disabled:
|
|
1803
|
+
disabled: T(h),
|
|
1791
1804
|
"data-test": "mcp-server-sign-out",
|
|
1792
|
-
onClick: (t) =>
|
|
1793
|
-
},
|
|
1794
|
-
], 8,
|
|
1805
|
+
onClick: (t) => T(E)(e.name)
|
|
1806
|
+
}, w(T(c).t("kvcoder.config.mcp.signOut")), 9, yi)) : r("v-if", !0)
|
|
1807
|
+
], 8, _i),
|
|
1795
1808
|
"url" in e && j(e.name).status === "signInNeeded" ? (_(), i("button", {
|
|
1796
1809
|
key: 0,
|
|
1797
1810
|
type: "button",
|
|
1798
1811
|
class: "kvc-button kvc-primary kvc-server-sign-in",
|
|
1799
|
-
disabled:
|
|
1812
|
+
disabled: T(h),
|
|
1800
1813
|
"data-test": "mcp-server-sign-in",
|
|
1801
1814
|
onClick: (t) => F(e.name)
|
|
1802
|
-
},
|
|
1803
|
-
N(j(e.name)) === void 0 ? r("v-if", !0) : (_(), i("span",
|
|
1815
|
+
}, w(T(c).t("kvcoder.config.mcp.signIn")), 9, bi)) : r("v-if", !0),
|
|
1816
|
+
N(j(e.name)) === void 0 ? r("v-if", !0) : (_(), i("span", xi, w(N(j(e.name))), 1))
|
|
1804
1817
|
]), k.value === e.name ? (_(), i("span", {
|
|
1805
1818
|
key: 0,
|
|
1806
1819
|
class: "kvc-connector-actions",
|
|
1807
1820
|
role: "alertdialog",
|
|
1808
|
-
"aria-label":
|
|
1821
|
+
"aria-label": T(c).t("kvcoder.config.mcp.removeConfirm", { name: e.name }),
|
|
1809
1822
|
"data-test": "mcp-remove-confirm"
|
|
1810
1823
|
}, [
|
|
1811
|
-
a("span",
|
|
1824
|
+
a("span", Ci, w(T(c).t("kvcoder.config.mcp.removeConfirm", { name: e.name })), 1),
|
|
1812
1825
|
a("button", {
|
|
1813
1826
|
type: "button",
|
|
1814
1827
|
class: "kvc-button",
|
|
1815
|
-
disabled:
|
|
1828
|
+
disabled: T(h),
|
|
1816
1829
|
"data-test": "mcp-remove-cancel",
|
|
1817
1830
|
onClick: u[2] ||= (e) => k.value = void 0
|
|
1818
|
-
},
|
|
1831
|
+
}, w(T(c).t("kvcoder.config.mcp.cancel")), 9, wi),
|
|
1819
1832
|
a("button", {
|
|
1820
1833
|
type: "button",
|
|
1821
1834
|
class: "kvc-button kvc-danger",
|
|
1822
|
-
disabled:
|
|
1835
|
+
disabled: T(h),
|
|
1823
1836
|
"data-test": "mcp-remove-yes",
|
|
1824
1837
|
onClick: (t) => I(e.name)
|
|
1825
|
-
},
|
|
1826
|
-
], 8,
|
|
1838
|
+
}, w(T(c).t("kvcoder.config.mcp.removeYes")), 9, Ti)
|
|
1839
|
+
], 8, Si)) : (_(), i("span", Ei, [a("button", {
|
|
1827
1840
|
type: "button",
|
|
1828
1841
|
class: "kvc-button kvc-ghost kvc-icon-button",
|
|
1829
|
-
disabled:
|
|
1830
|
-
"aria-label":
|
|
1831
|
-
title:
|
|
1842
|
+
disabled: T(p) || T(h),
|
|
1843
|
+
"aria-label": T(c).t("kvcoder.config.mcp.edit", { name: e.name }),
|
|
1844
|
+
title: T(c).t("kvcoder.config.mcp.edit", { name: e.name }),
|
|
1832
1845
|
"data-test": "mcp-server-edit",
|
|
1833
1846
|
onClick: (t) => O.value = { entry: e }
|
|
1834
|
-
}, [s(
|
|
1847
|
+
}, [s(T(U), {
|
|
1835
1848
|
size: 16,
|
|
1836
1849
|
"aria-hidden": "true"
|
|
1837
|
-
})], 8,
|
|
1850
|
+
})], 8, Di), a("button", {
|
|
1838
1851
|
type: "button",
|
|
1839
1852
|
class: "kvc-button kvc-ghost kvc-icon-button",
|
|
1840
|
-
disabled:
|
|
1841
|
-
"aria-label":
|
|
1842
|
-
title:
|
|
1853
|
+
disabled: T(p) || T(h),
|
|
1854
|
+
"aria-label": T(c).t("kvcoder.config.mcp.remove", { name: e.name }),
|
|
1855
|
+
title: T(c).t("kvcoder.config.mcp.remove", { name: e.name }),
|
|
1843
1856
|
"data-test": "mcp-server-remove",
|
|
1844
1857
|
onClick: (t) => k.value = e.name
|
|
1845
|
-
}, [s(
|
|
1858
|
+
}, [s(T(ce), {
|
|
1846
1859
|
size: 16,
|
|
1847
1860
|
"aria-hidden": "true"
|
|
1848
|
-
})], 8,
|
|
1849
|
-
a("div",
|
|
1861
|
+
})], 8, Oi)]))], 8, pi))), 128)),
|
|
1862
|
+
a("div", ki, [a("button", {
|
|
1850
1863
|
type: "button",
|
|
1851
1864
|
class: "kvc-button kvc-primary",
|
|
1852
|
-
disabled:
|
|
1865
|
+
disabled: T(p) || T(h),
|
|
1853
1866
|
"data-test": "mcp-add",
|
|
1854
1867
|
onClick: u[3] ||= (e) => O.value = {}
|
|
1855
|
-
}, [s(
|
|
1868
|
+
}, [s(T(W), {
|
|
1856
1869
|
size: 16,
|
|
1857
1870
|
"aria-hidden": "true"
|
|
1858
|
-
}), o(
|
|
1859
|
-
])) : (_(), n(
|
|
1860
|
-
taken:
|
|
1861
|
-
secrets:
|
|
1862
|
-
working:
|
|
1871
|
+
}), o(w(T(c).t("kvcoder.config.mcp.add")), 1)], 8, Ai)])
|
|
1872
|
+
])) : (_(), n(ii, f({ key: 0 }, O.value.entry === void 0 ? {} : { entry: O.value.entry }, {
|
|
1873
|
+
taken: T(l).filter((e) => e.name !== O.value?.entry?.name).map((e) => e.name),
|
|
1874
|
+
secrets: T(d),
|
|
1875
|
+
working: T(h),
|
|
1863
1876
|
onSave: P,
|
|
1864
1877
|
onCancel: u[0] ||= (e) => O.value = void 0
|
|
1865
1878
|
}), null, 16, [
|
|
@@ -1868,10 +1881,10 @@ var ai = {
|
|
|
1868
1881
|
"working"
|
|
1869
1882
|
]));
|
|
1870
1883
|
}
|
|
1871
|
-
}),
|
|
1884
|
+
}), Mi = ["data-test"], Ni = { class: "kvc-setting-text" }, Pi = ["data-test"], Fi = { class: "kvc-muted" }, Ii = { class: "kvc-setting-control" }, Li = ["data-test"], Ri = {
|
|
1872
1885
|
key: 1,
|
|
1873
1886
|
class: "kvc-connectors-state"
|
|
1874
|
-
},
|
|
1887
|
+
}, zi = ["data-test"], Bi = ["data-test"], Vi = ["disabled", "data-test"], Hi = /* @__PURE__ */ c({
|
|
1875
1888
|
__name: "SettingFrame",
|
|
1876
1889
|
props: {
|
|
1877
1890
|
settingKey: {},
|
|
@@ -1880,58 +1893,58 @@ var ai = {
|
|
|
1880
1893
|
saved: { type: Boolean }
|
|
1881
1894
|
},
|
|
1882
1895
|
setup(t) {
|
|
1883
|
-
let n = t, o =
|
|
1896
|
+
let n = t, o = K(), s = (e) => o.t(`${e}.${o.scope.value}`, { name: o.workspace.value.name });
|
|
1884
1897
|
return (t, c) => (_(), i("div", {
|
|
1885
1898
|
class: "kvc-setting",
|
|
1886
1899
|
"data-test": n.name
|
|
1887
|
-
}, [a("span",
|
|
1900
|
+
}, [a("span", Ni, [a("span", {
|
|
1888
1901
|
class: "kvc-setting-title",
|
|
1889
1902
|
"data-test": `${n.name}-title`
|
|
1890
|
-
},
|
|
1903
|
+
}, w(T(o).t(`${n.settingKey}.title`)), 9, Pi), a("span", Fi, w(T(o).t(`${n.settingKey}.description`)), 1)]), a("span", Ii, [x(t.$slots, "default", { disabled: n.setting.locked.value || n.setting.saving.value }), n.setting.locked.value ? (_(), i("span", {
|
|
1891
1904
|
key: 0,
|
|
1892
1905
|
class: "kvc-muted",
|
|
1893
1906
|
"data-test": `${n.name}-own-value`
|
|
1894
|
-
},
|
|
1907
|
+
}, w(T(o).t("kvcoder.config.setting.ownValue", { name: T(o).workspace.value.name })), 9, Li)) : n.setting.changed.value || n.saved ? (_(), i("span", Ri, [n.saved ? (_(), i("span", {
|
|
1895
1908
|
key: 0,
|
|
1896
1909
|
class: "kvc-muted",
|
|
1897
1910
|
role: "status",
|
|
1898
1911
|
"data-test": `${n.name}-saved`
|
|
1899
|
-
},
|
|
1912
|
+
}, w(T(o).t("kvcoder.config.setting.saved")), 9, zi)) : r("v-if", !0), n.setting.changed.value ? (_(), i(e, { key: 1 }, [a("span", {
|
|
1900
1913
|
class: "kvc-chip",
|
|
1901
1914
|
"data-test": `${n.name}-changed`
|
|
1902
|
-
},
|
|
1915
|
+
}, w(s("kvcoder.config.setting.changed")), 9, Bi), a("button", {
|
|
1903
1916
|
type: "button",
|
|
1904
1917
|
class: "kvc-text-button",
|
|
1905
1918
|
disabled: n.setting.saving.value,
|
|
1906
1919
|
"data-test": `${n.name}-reset`,
|
|
1907
1920
|
onClick: c[0] ||= (...e) => n.setting.reset && n.setting.reset(...e)
|
|
1908
|
-
},
|
|
1921
|
+
}, w(s("kvcoder.config.setting.reset")), 9, Vi)], 64)) : r("v-if", !0)])) : r("v-if", !0)])], 8, Mi));
|
|
1909
1922
|
}
|
|
1910
|
-
}),
|
|
1923
|
+
}), Ui = {
|
|
1911
1924
|
class: "kvc-dialog-rows",
|
|
1912
1925
|
"data-test": "shell-settings"
|
|
1913
|
-
},
|
|
1926
|
+
}, Wi = [
|
|
1914
1927
|
"disabled",
|
|
1915
1928
|
"placeholder",
|
|
1916
1929
|
"aria-label"
|
|
1917
|
-
],
|
|
1930
|
+
], Gi = /* @__PURE__ */ c({
|
|
1918
1931
|
__name: "ShellSettings",
|
|
1919
1932
|
setup(e) {
|
|
1920
|
-
let n =
|
|
1921
|
-
|
|
1933
|
+
let n = K(), r = J(n, "kvcoder.shell.path"), o = y(!1), c = D("field"), l = t(() => typeof r.value.value == "string" ? r.value.value : ""), u = y("");
|
|
1934
|
+
M(l, (e) => u.value = e, { immediate: !0 });
|
|
1922
1935
|
async function d() {
|
|
1923
1936
|
let e = u.value.trim();
|
|
1924
1937
|
if (e === l.value) return void (u.value = e);
|
|
1925
1938
|
let t = document.activeElement === c.value;
|
|
1926
1939
|
o.value = await r.set(e === "" ? null : e), u.value = l.value, t && (await p(), c.value?.focus());
|
|
1927
1940
|
}
|
|
1928
|
-
return (e, t) => (_(), i("div",
|
|
1941
|
+
return (e, t) => (_(), i("div", Ui, [s(Hi, {
|
|
1929
1942
|
"setting-key": "kvcoder.shell.path",
|
|
1930
1943
|
name: "shell-path",
|
|
1931
|
-
setting:
|
|
1944
|
+
setting: T(r),
|
|
1932
1945
|
saved: o.value
|
|
1933
1946
|
}, {
|
|
1934
|
-
default:
|
|
1947
|
+
default: N(({ disabled: e }) => [P(a("input", {
|
|
1935
1948
|
ref_key: "field",
|
|
1936
1949
|
ref: c,
|
|
1937
1950
|
"onUpdate:modelValue": t[0] ||= (e) => u.value = e,
|
|
@@ -1939,50 +1952,50 @@ var ai = {
|
|
|
1939
1952
|
dir: "ltr",
|
|
1940
1953
|
class: "kvc-field kvc-mono",
|
|
1941
1954
|
disabled: e,
|
|
1942
|
-
placeholder:
|
|
1943
|
-
"aria-label":
|
|
1955
|
+
placeholder: T(n).t("kvcoder.config.shell.pathFound"),
|
|
1956
|
+
"aria-label": T(n).t("kvcoder.shell.path.title"),
|
|
1944
1957
|
spellcheck: "false",
|
|
1945
1958
|
autocomplete: "off",
|
|
1946
1959
|
"data-test": "shell-path-control",
|
|
1947
|
-
onKeydown:
|
|
1960
|
+
onKeydown: F(d, ["enter"]),
|
|
1948
1961
|
onBlur: d
|
|
1949
|
-
}, null, 40,
|
|
1962
|
+
}, null, 40, Wi), [[j, u.value]])]),
|
|
1950
1963
|
_: 1
|
|
1951
1964
|
}, 8, ["setting", "saved"])]));
|
|
1952
1965
|
}
|
|
1953
|
-
}),
|
|
1966
|
+
}), Ki = {
|
|
1954
1967
|
class: "kvc-connectors",
|
|
1955
1968
|
"data-test": "connectors"
|
|
1956
|
-
},
|
|
1969
|
+
}, qi = {
|
|
1957
1970
|
key: 0,
|
|
1958
1971
|
class: "kvc-muted",
|
|
1959
1972
|
"data-test": "connectors-own-value"
|
|
1960
|
-
},
|
|
1973
|
+
}, Ji = {
|
|
1961
1974
|
key: 1,
|
|
1962
1975
|
class: "kvc-connectors-state"
|
|
1963
|
-
},
|
|
1976
|
+
}, Yi = {
|
|
1964
1977
|
class: "kvc-chip",
|
|
1965
1978
|
"data-test": "connectors-changed"
|
|
1966
|
-
},
|
|
1979
|
+
}, Xi = ["disabled"], Zi = ["data-test"], Qi = { class: "kvc-connector-text" }, $i = {
|
|
1967
1980
|
class: "kvc-mono kvc-connector-name",
|
|
1968
1981
|
"data-test": "connector-name"
|
|
1969
|
-
},
|
|
1982
|
+
}, ea = {
|
|
1970
1983
|
class: "kvc-muted",
|
|
1971
1984
|
dir: "auto",
|
|
1972
1985
|
"data-test": "connector-description"
|
|
1973
|
-
},
|
|
1986
|
+
}, ta = { class: "kvc-connector-actions" }, na = [
|
|
1974
1987
|
"aria-label",
|
|
1975
1988
|
"title",
|
|
1976
1989
|
"onClick"
|
|
1977
|
-
],
|
|
1990
|
+
], ra = [
|
|
1978
1991
|
"aria-checked",
|
|
1979
1992
|
"aria-label",
|
|
1980
1993
|
"disabled",
|
|
1981
1994
|
"onClick"
|
|
1982
|
-
],
|
|
1995
|
+
], ia = /* @__PURE__ */ c({
|
|
1983
1996
|
__name: "ConnectorsList",
|
|
1984
1997
|
setup(t) {
|
|
1985
|
-
let o =
|
|
1998
|
+
let o = K(), { items: c, locked: l, changed: u, saving: d, toggle: f, reset: m } = ct(o), h = y(), g = /* @__PURE__ */ new Map();
|
|
1986
1999
|
function v(e, t) {
|
|
1987
2000
|
t instanceof HTMLElement ? g.set(e, t) : g.delete(e);
|
|
1988
2001
|
}
|
|
@@ -1991,60 +2004,60 @@ var ai = {
|
|
|
1991
2004
|
h.value = void 0, await p(), e !== void 0 && g.get(e)?.focus();
|
|
1992
2005
|
}
|
|
1993
2006
|
let S = (e) => o.t(`${e}.${o.scope.value}`, { name: o.workspace.value.name });
|
|
1994
|
-
return (t, p) => (_(), i("div",
|
|
1995
|
-
|
|
2007
|
+
return (t, p) => (_(), i("div", Ki, [
|
|
2008
|
+
T(l) ? (_(), i("p", qi, w(T(o).t("kvcoder.config.connectors.ownValue", { name: T(o).workspace.value.name })), 1)) : T(u) ? (_(), i("div", Ji, [a("span", Yi, w(S("kvcoder.config.connectors.changed")), 1), a("button", {
|
|
1996
2009
|
type: "button",
|
|
1997
2010
|
class: "kvc-text-button",
|
|
1998
|
-
disabled:
|
|
2011
|
+
disabled: T(d),
|
|
1999
2012
|
"data-test": "connectors-reset",
|
|
2000
|
-
onClick: p[0] ||= (...e) =>
|
|
2001
|
-
},
|
|
2002
|
-
(_(!0), i(e, null, b(
|
|
2013
|
+
onClick: p[0] ||= (...e) => T(m) && T(m)(...e)
|
|
2014
|
+
}, w(S("kvcoder.config.connectors.reset")), 9, Xi)])) : r("v-if", !0),
|
|
2015
|
+
(_(!0), i(e, null, b(T(c), (e) => (_(), i("div", {
|
|
2003
2016
|
key: e.name,
|
|
2004
2017
|
class: "kvc-connector",
|
|
2005
2018
|
"data-test": `connector-${e.name}`
|
|
2006
|
-
}, [a("span",
|
|
2019
|
+
}, [a("span", Qi, [a("span", $i, w(e.name), 1), a("span", ea, w(e.description), 1)]), a("span", ta, [e.configurable ? (_(), i("button", {
|
|
2007
2020
|
key: 0,
|
|
2008
2021
|
ref_for: !0,
|
|
2009
2022
|
ref: (t) => v(e.name, t),
|
|
2010
2023
|
type: "button",
|
|
2011
2024
|
class: "kvc-button kvc-ghost kvc-icon-button",
|
|
2012
2025
|
"aria-haspopup": "dialog",
|
|
2013
|
-
"aria-label":
|
|
2014
|
-
title:
|
|
2026
|
+
"aria-label": T(o).t("kvcoder.config.connectors.configure", { name: e.name }),
|
|
2027
|
+
title: T(o).t("kvcoder.config.connectors.configure", { name: e.name }),
|
|
2015
2028
|
"data-test": "connector-configure",
|
|
2016
2029
|
onClick: (t) => h.value = e.name
|
|
2017
|
-
}, [s(
|
|
2030
|
+
}, [s(T(G), {
|
|
2018
2031
|
size: 18,
|
|
2019
2032
|
"aria-hidden": "true"
|
|
2020
|
-
})], 8,
|
|
2033
|
+
})], 8, na)) : r("v-if", !0), a("button", {
|
|
2021
2034
|
type: "button",
|
|
2022
2035
|
role: "switch",
|
|
2023
2036
|
class: "kvc-switch",
|
|
2024
2037
|
"aria-checked": e.on,
|
|
2025
|
-
"aria-label":
|
|
2026
|
-
disabled:
|
|
2038
|
+
"aria-label": T(o).t("kvcoder.config.connectors.use", { name: e.name }),
|
|
2039
|
+
disabled: T(l) || T(d),
|
|
2027
2040
|
"data-test": "connector-switch",
|
|
2028
|
-
onClick: (t) =>
|
|
2041
|
+
onClick: (t) => T(f)(e.name)
|
|
2029
2042
|
}, [...p[1] ||= [a("span", {
|
|
2030
2043
|
class: "kvc-switch-knob",
|
|
2031
2044
|
"aria-hidden": "true"
|
|
2032
|
-
}, null, -1)]], 8,
|
|
2045
|
+
}, null, -1)]], 8, ra)])], 8, Zi))), 128)),
|
|
2033
2046
|
h.value === void 0 ? r("v-if", !0) : (_(), n(be, {
|
|
2034
2047
|
key: 2,
|
|
2035
2048
|
name: h.value,
|
|
2036
2049
|
onClose: x
|
|
2037
2050
|
}, {
|
|
2038
|
-
default:
|
|
2051
|
+
default: N(() => [h.value === "shell" ? (_(), n(Gi, { key: 0 })) : h.value === "delegate" ? (_(), n(nr, { key: 1 })) : h.value === "mcp" ? (_(), n(ji, { key: 2 })) : r("v-if", !0)]),
|
|
2039
2052
|
_: 1
|
|
2040
2053
|
}, 8, ["name"]))
|
|
2041
2054
|
]));
|
|
2042
2055
|
}
|
|
2043
|
-
}),
|
|
2056
|
+
}), aa = /* @__PURE__ */ c({
|
|
2044
2057
|
__name: "connectors",
|
|
2045
2058
|
setup(e) {
|
|
2046
|
-
return (e, t) => (_(), n(
|
|
2059
|
+
return (e, t) => (_(), n(ia));
|
|
2047
2060
|
}
|
|
2048
2061
|
});
|
|
2049
2062
|
//#endregion
|
|
2050
|
-
export {
|
|
2063
|
+
export { aa as default };
|