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