@kvman/kvcoder 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +45 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/calls/call-name.d.ts.map +1 -1
- package/dist/calls/call-name.js +10 -1
- package/dist/calls/call-name.js.map +1 -1
- package/dist/calls/run-tool.d.ts.map +1 -1
- package/dist/calls/run-tool.js +2 -0
- package/dist/calls/run-tool.js.map +1 -1
- package/dist/connector-call.d.ts +2 -2
- package/dist/connector-call.d.ts.map +1 -1
- package/dist/connector-call.js +5 -3
- package/dist/connector-call.js.map +1 -1
- package/dist/connectors/artifact.d.ts +1 -0
- package/dist/connectors/artifact.d.ts.map +1 -1
- package/dist/connectors/background.d.ts.map +1 -1
- package/dist/connectors/background.js +8 -4
- package/dist/connectors/background.js.map +1 -1
- package/dist/connectors/builtin-connectors.d.ts +38 -0
- package/dist/connectors/builtin-connectors.d.ts.map +1 -1
- package/dist/connectors/builtin-connectors.js +4 -1
- package/dist/connectors/builtin-connectors.js.map +1 -1
- package/dist/connectors/delegate.d.ts.map +1 -1
- package/dist/connectors/delegate.js +3 -0
- package/dist/connectors/delegate.js.map +1 -1
- package/dist/connectors/execution-map.d.ts +1 -1
- package/dist/connectors/execution-map.d.ts.map +1 -1
- package/dist/connectors/execution-map.js +1 -1
- package/dist/connectors/execution-map.js.map +1 -1
- package/dist/connectors/fs.d.ts +29 -1
- package/dist/connectors/fs.d.ts.map +1 -1
- package/dist/connectors/fs.js +46 -9
- package/dist/connectors/fs.js.map +1 -1
- package/dist/connectors/payload-fields.d.ts +3 -0
- package/dist/connectors/payload-fields.d.ts.map +1 -1
- package/dist/connectors/payload-fields.js +8 -2
- package/dist/connectors/payload-fields.js.map +1 -1
- package/dist/connectors/web.d.ts +16 -0
- package/dist/connectors/web.d.ts.map +1 -0
- package/dist/connectors/web.js +22 -0
- package/dist/connectors/web.js.map +1 -0
- package/dist/delegate/permission.d.ts +6 -0
- package/dist/delegate/permission.d.ts.map +1 -1
- package/dist/files/change-diff.d.ts +17 -0
- package/dist/files/change-diff.d.ts.map +1 -0
- package/dist/files/change-diff.js +59 -0
- package/dist/files/change-diff.js.map +1 -0
- package/dist/files/edit-places.d.ts +11 -0
- package/dist/files/edit-places.d.ts.map +1 -0
- package/dist/files/edit-places.js +105 -0
- package/dist/files/edit-places.js.map +1 -0
- package/dist/files/edit-text.d.ts +1 -0
- package/dist/files/edit-text.d.ts.map +1 -1
- package/dist/files/edit-text.js +22 -10
- package/dist/files/edit-text.js.map +1 -1
- package/dist/files/file-change.d.ts.map +1 -1
- package/dist/files/file-change.js +12 -0
- package/dist/files/file-change.js.map +1 -1
- package/dist/files/find-paths.d.ts +9 -0
- package/dist/files/find-paths.d.ts.map +1 -0
- package/dist/files/find-paths.js +38 -0
- package/dist/files/find-paths.js.map +1 -0
- package/dist/files/read-file.d.ts +3 -1
- package/dist/files/read-file.d.ts.map +1 -1
- package/dist/files/read-file.js +7 -6
- package/dist/files/read-file.js.map +1 -1
- package/dist/files/read-files.d.ts +11 -0
- package/dist/files/read-files.d.ts.map +1 -0
- package/dist/files/read-files.js +35 -0
- package/dist/files/read-files.js.map +1 -0
- package/dist/files/read-text.d.ts +63 -0
- package/dist/files/read-text.d.ts.map +1 -0
- package/dist/files/read-text.js +67 -0
- package/dist/files/read-text.js.map +1 -0
- package/dist/files/register-changes.d.ts +3 -0
- package/dist/files/register-changes.d.ts.map +1 -0
- package/dist/files/register-changes.js +78 -0
- package/dist/files/register-changes.js.map +1 -0
- package/dist/files/search-text.d.ts +10 -1
- package/dist/files/search-text.d.ts.map +1 -1
- package/dist/files/search-text.js +32 -57
- package/dist/files/search-text.js.map +1 -1
- package/dist/files/workspace-files.d.ts +5 -0
- package/dist/files/workspace-files.d.ts.map +1 -0
- package/dist/files/workspace-files.js +66 -0
- package/dist/files/workspace-files.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/prompt/build-prompt.d.ts +4 -0
- package/dist/prompt/build-prompt.d.ts.map +1 -1
- package/dist/prompt/build-prompt.js +6 -2
- package/dist/prompt/build-prompt.js.map +1 -1
- package/dist/prompt/person-preferences.d.ts +5 -0
- package/dist/prompt/person-preferences.d.ts.map +1 -0
- package/dist/prompt/person-preferences.js +14 -0
- package/dist/prompt/person-preferences.js.map +1 -0
- package/dist/prompt/session-grants.d.ts +4 -0
- package/dist/prompt/session-grants.d.ts.map +1 -1
- package/dist/prompt/session-grants.js +3 -2
- package/dist/prompt/session-grants.js.map +1 -1
- package/dist/prompt/session-prompt.d.ts.map +1 -1
- package/dist/prompt/session-prompt.js +15 -6
- package/dist/prompt/session-prompt.js.map +1 -1
- package/dist/prompt/working-method.d.ts +2 -2
- package/dist/prompt/working-method.d.ts.map +1 -1
- package/dist/prompt/working-method.js +49 -43
- package/dist/prompt/working-method.js.map +1 -1
- package/dist/register-settings.d.ts +23 -0
- package/dist/register-settings.d.ts.map +1 -1
- package/dist/register-settings.js +13 -0
- package/dist/register-settings.js.map +1 -1
- package/dist/schemas/approval-rule.d.ts +9 -0
- package/dist/schemas/approval-rule.d.ts.map +1 -0
- package/dist/schemas/approval-rule.js +7 -0
- package/dist/schemas/approval-rule.js.map +1 -0
- package/dist/schemas/check.d.ts +7 -0
- package/dist/schemas/check.d.ts.map +1 -0
- package/dist/schemas/check.js +9 -0
- package/dist/schemas/check.js.map +1 -0
- package/dist/schemas/records.d.ts +10 -0
- package/dist/schemas/records.d.ts.map +1 -1
- package/dist/schemas/records.js +8 -0
- package/dist/schemas/records.js.map +1 -1
- package/dist/sessions/new-session.d.ts.map +1 -1
- package/dist/sessions/new-session.js +4 -1
- package/dist/sessions/new-session.js.map +1 -1
- package/dist/sessions/register-fork-export.d.ts.map +1 -1
- package/dist/sessions/register-fork-export.js +3 -2
- package/dist/sessions/register-fork-export.js.map +1 -1
- package/dist/sessions/register-sessions.d.ts.map +1 -1
- package/dist/sessions/register-sessions.js +17 -9
- package/dist/sessions/register-sessions.js.map +1 -1
- package/dist/sessions/session-view.d.ts +8 -1
- package/dist/sessions/session-view.d.ts.map +1 -1
- package/dist/sessions/session-view.js +6 -1
- package/dist/sessions/session-view.js.map +1 -1
- package/dist/sessions/waiting-on.d.ts +7 -0
- package/dist/sessions/waiting-on.d.ts.map +1 -0
- package/dist/sessions/waiting-on.js +20 -0
- package/dist/sessions/waiting-on.js.map +1 -0
- package/dist/store/collections.d.ts +18 -0
- package/dist/store/collections.d.ts.map +1 -1
- package/dist/store/collections.js +3 -1
- package/dist/store/collections.js.map +1 -1
- package/dist/turns/answer-extras.d.ts +21 -0
- package/dist/turns/answer-extras.d.ts.map +1 -0
- package/dist/turns/answer-extras.js +43 -0
- package/dist/turns/answer-extras.js.map +1 -0
- package/dist/turns/answer-fingerprint.d.ts +6 -2
- package/dist/turns/answer-fingerprint.d.ts.map +1 -1
- package/dist/turns/answer-fingerprint.js +9 -3
- package/dist/turns/answer-fingerprint.js.map +1 -1
- package/dist/turns/apply-answer.d.ts +2 -1
- package/dist/turns/apply-answer.d.ts.map +1 -1
- package/dist/turns/apply-answer.js +10 -4
- package/dist/turns/apply-answer.js.map +1 -1
- package/dist/turns/approval-rules.d.ts +13 -0
- package/dist/turns/approval-rules.d.ts.map +1 -0
- package/dist/turns/approval-rules.js +65 -0
- package/dist/turns/approval-rules.js.map +1 -0
- package/dist/turns/check-after-edits.d.ts +8 -0
- package/dist/turns/check-after-edits.d.ts.map +1 -0
- package/dist/turns/check-after-edits.js +23 -0
- package/dist/turns/check-after-edits.js.map +1 -0
- package/dist/turns/clear-results.d.ts +15 -0
- package/dist/turns/clear-results.d.ts.map +1 -0
- package/dist/turns/clear-results.js +58 -0
- package/dist/turns/clear-results.js.map +1 -0
- package/dist/turns/cleared-results.d.ts +17 -0
- package/dist/turns/cleared-results.d.ts.map +1 -0
- package/dist/turns/cleared-results.js +46 -0
- package/dist/turns/cleared-results.js.map +1 -0
- package/dist/turns/compaction.js +6 -6
- package/dist/turns/compaction.js.map +1 -1
- package/dist/turns/file-results.d.ts +15 -0
- package/dist/turns/file-results.d.ts.map +1 -0
- package/dist/turns/file-results.js +39 -0
- package/dist/turns/file-results.js.map +1 -0
- package/dist/turns/lost-reply.js +2 -2
- package/dist/turns/lost-reply.js.map +1 -1
- package/dist/turns/model-context.d.ts +2 -0
- package/dist/turns/model-context.d.ts.map +1 -1
- package/dist/turns/model-context.js +28 -5
- package/dist/turns/model-context.js.map +1 -1
- package/dist/turns/read-again.d.ts +11 -5
- package/dist/turns/read-again.d.ts.map +1 -1
- package/dist/turns/read-again.js +39 -10
- package/dist/turns/read-again.js.map +1 -1
- package/dist/turns/register-turns.d.ts.map +1 -1
- package/dist/turns/register-turns.js +12 -4
- package/dist/turns/register-turns.js.map +1 -1
- package/dist/turns/run-calls.d.ts +4 -0
- package/dist/turns/run-calls.d.ts.map +1 -1
- package/dist/turns/run-calls.js +35 -5
- package/dist/turns/run-calls.js.map +1 -1
- package/dist/turns/run-command.d.ts.map +1 -1
- package/dist/turns/run-command.js +4 -4
- package/dist/turns/run-command.js.map +1 -1
- package/dist/turns/step.d.ts.map +1 -1
- package/dist/turns/step.js +43 -8
- package/dist/turns/step.js.map +1 -1
- package/dist/ui/register-ui.js +2 -2
- package/dist/ui/register-ui.js.map +1 -1
- package/dist/web/components/approval.css +1 -1
- package/dist/web/components/approval.js +122 -89
- package/dist/web/components/call.css +1 -1
- package/dist/web/components/call.js +400 -302
- package/dist/web/components/connectors.css +1 -1
- package/dist/web/components/connectors.js +440 -427
- package/dist/web/components/conversation.css +1 -1
- package/dist/web/components/conversation.js +2509 -1500
- package/dist/web/components/mcp-sign-in.css +1 -1
- package/dist/web/components/model.css +1 -1
- package/dist/web/components/model.js +138 -126
- package/dist/web/components/preferences.css +2 -0
- package/dist/web/components/preferences.js +151 -0
- package/dist/web/components/question.css +1 -1
- package/dist/web/components/sessions.css +1 -1
- package/dist/web/components/sessions.js +44 -21
- package/dist/web-fetch/fetch-page.d.ts +28 -0
- package/dist/web-fetch/fetch-page.d.ts.map +1 -0
- package/dist/web-fetch/fetch-page.js +108 -0
- package/dist/web-fetch/fetch-page.js.map +1 -0
- package/dist/web-fetch/private-address.d.ts +3 -0
- package/dist/web-fetch/private-address.d.ts.map +1 -0
- package/dist/web-fetch/private-address.js +69 -0
- package/dist/web-fetch/private-address.js.map +1 -0
- package/dist/web-fetch/web-hosts.d.ts +7 -0
- package/dist/web-fetch/web-hosts.d.ts.map +1 -0
- package/dist/web-fetch/web-hosts.js +19 -0
- package/dist/web-fetch/web-hosts.js.map +1 -0
- package/docs/connectors.md +2 -2
- package/locales/ar.json +66 -1
- package/locales/en.json +66 -1
- package/package.json +17 -3
|
@@ -53,60 +53,60 @@ function S(e, t = {}) {
|
|
|
53
53
|
var C = (e) => {
|
|
54
54
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
55
55
|
return !1;
|
|
56
|
-
}, w = (e) => e === "", T = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(),
|
|
57
|
-
function
|
|
58
|
-
return u(
|
|
56
|
+
}, w = (e) => e === "", T = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), E = /* @__PURE__ */ Symbol("lucide-icons");
|
|
57
|
+
function D() {
|
|
58
|
+
return u(E, {});
|
|
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
|
|
62
|
+
var O = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
|
|
63
63
|
name: e && T(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:
|
|
68
|
+
let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: b = !1, nonScalingStroke: x = !1, class: E = "" } = D(), O = w(i) || w(a) || i === !0 || a === !0 || b === !0, k = w(o) || w(s) || o === !0 || s === !0 || x === !0;
|
|
69
69
|
delete h.class;
|
|
70
|
-
let
|
|
70
|
+
let A = g.default?.(), [, ee, j = []] = S(r, {
|
|
71
71
|
color: m ?? v,
|
|
72
72
|
width: f ?? d ?? _,
|
|
73
73
|
height: p ?? d ?? _,
|
|
74
74
|
strokeWidth: c ?? u ?? y,
|
|
75
|
-
absoluteStrokeWidth:
|
|
76
|
-
nonScalingStroke:
|
|
77
|
-
className:
|
|
78
|
-
hasA11yProp:
|
|
75
|
+
absoluteStrokeWidth: O,
|
|
76
|
+
nonScalingStroke: k,
|
|
77
|
+
className: E,
|
|
78
|
+
hasA11yProp: A != null && A.length > 0 || C(h),
|
|
79
79
|
attributes: h
|
|
80
80
|
});
|
|
81
|
-
return l("svg",
|
|
81
|
+
return l("svg", ee, [...j.map(([e, t]) => l(e, t)), ...A ?? []]);
|
|
82
82
|
};
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region ../../node_modules/.pnpm/@lucide+vue@1.49.0_vue@3.5.43_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/createLucideIcon.mjs
|
|
85
|
-
function
|
|
85
|
+
function k(e, t = []) {
|
|
86
86
|
let n = typeof e == "string" ? {
|
|
87
87
|
name: e,
|
|
88
88
|
node: t
|
|
89
89
|
} : e;
|
|
90
|
-
return (e, { slots: t }) => l(
|
|
90
|
+
return (e, { slots: t }) => l(O, {
|
|
91
91
|
...e,
|
|
92
92
|
icon: n
|
|
93
93
|
}, t.default ? { default: t.default } : void 0);
|
|
94
94
|
}
|
|
95
|
-
var
|
|
95
|
+
var A = k({
|
|
96
96
|
name: "chevron-down",
|
|
97
97
|
size: 24,
|
|
98
98
|
node: [["path", {
|
|
99
99
|
d: "m6 9 6 6 6-6",
|
|
100
100
|
key: "qrunsl"
|
|
101
101
|
}]]
|
|
102
|
-
}),
|
|
102
|
+
}), ee = k({
|
|
103
103
|
name: "chevron-right",
|
|
104
104
|
size: 24,
|
|
105
105
|
node: [["path", {
|
|
106
106
|
d: "m9 18 6-6-6-6",
|
|
107
107
|
key: "mthhwq"
|
|
108
108
|
}]]
|
|
109
|
-
}),
|
|
109
|
+
}), j = k({
|
|
110
110
|
name: "file",
|
|
111
111
|
size: 24,
|
|
112
112
|
node: [["path", {
|
|
@@ -116,92 +116,148 @@ var D = E({
|
|
|
116
116
|
d: "M14 2v5a1 1 0 0 0 1 1h5",
|
|
117
117
|
key: "wfsgrz"
|
|
118
118
|
}]]
|
|
119
|
-
}),
|
|
119
|
+
}), te = k({
|
|
120
120
|
name: "folder",
|
|
121
121
|
size: 24,
|
|
122
122
|
node: [["path", {
|
|
123
123
|
d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
|
|
124
124
|
key: "1kt360"
|
|
125
125
|
}]]
|
|
126
|
-
}),
|
|
127
|
-
function
|
|
126
|
+
}), ne = 160, re = /^error ([A-Za-z0-9_/-]+): ?(.*)/;
|
|
127
|
+
function ie(e) {
|
|
128
128
|
let t = (e.split("\n", 1)[0] ?? "").trim();
|
|
129
|
-
return t.length >
|
|
129
|
+
return t.length > ne ? `${t.slice(0, ne)}…` : t;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function ae(e) {
|
|
132
132
|
if (e.startsWith("denied by the user")) return { kind: "denied" };
|
|
133
|
-
let t =
|
|
133
|
+
let t = re.exec(e);
|
|
134
134
|
return t?.[1] === "VALIDATION_FAILED" ? { kind: "invalid" } : t === null ? /\[exit code \d+\]\s*$/.test(e) ? { kind: "command" } : {
|
|
135
135
|
kind: "error",
|
|
136
|
-
message:
|
|
136
|
+
message: ie(e)
|
|
137
137
|
} : {
|
|
138
138
|
kind: "error",
|
|
139
|
-
message:
|
|
139
|
+
message: ie(t[2] ?? "")
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
//#endregion
|
|
143
|
+
//#region web/src/durations.ts
|
|
144
|
+
function M(e, t) {
|
|
145
|
+
if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
|
|
146
|
+
if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
|
|
147
|
+
let n = Math.round(t / 1e3);
|
|
148
|
+
return n < 60 ? e("kvcoder.ui.seconds", { count: n }) : n < 3600 ? e("kvcoder.ui.minutesSeconds", {
|
|
149
|
+
minutes: Math.floor(n / 60),
|
|
150
|
+
seconds: n % 60
|
|
151
|
+
}) : oe(e, n);
|
|
152
|
+
}
|
|
153
|
+
function oe(e, t) {
|
|
154
|
+
let n = Math.floor(t / 60);
|
|
155
|
+
return e("kvcoder.ui.hoursMinutes", {
|
|
156
|
+
hours: Math.floor(n / 60),
|
|
157
|
+
minutes: n % 60
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
143
161
|
//#region web/src/kvman.ts
|
|
144
|
-
function
|
|
162
|
+
function N() {
|
|
145
163
|
let e = u("kvman");
|
|
146
164
|
if (e === void 0) throw Error("kvcoder components run inside kvwebui, which provides kvman.");
|
|
147
165
|
return e;
|
|
148
166
|
}
|
|
149
|
-
function
|
|
167
|
+
function P(e) {
|
|
150
168
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {};
|
|
151
169
|
}
|
|
152
170
|
//#endregion
|
|
153
171
|
//#region web/src/call-results.ts
|
|
154
|
-
function
|
|
155
|
-
let { replacements: t, firstChangedLine: n } =
|
|
172
|
+
function se(e) {
|
|
173
|
+
let { replacements: t, firstChangedLine: n } = P(e);
|
|
156
174
|
return typeof t == "number" && typeof n == "number" ? {
|
|
157
175
|
replacements: t,
|
|
158
176
|
firstChangedLine: n
|
|
159
177
|
} : void 0;
|
|
160
178
|
}
|
|
161
|
-
function
|
|
162
|
-
let { fromLine: t, content: n } =
|
|
179
|
+
function ce(e) {
|
|
180
|
+
let { fromLine: t, content: n } = P(e);
|
|
163
181
|
return typeof t == "number" && typeof n == "string" ? {
|
|
164
182
|
fromLine: t,
|
|
165
183
|
content: n
|
|
166
184
|
} : void 0;
|
|
167
185
|
}
|
|
186
|
+
function le(e) {
|
|
187
|
+
let { path: t, error: n, notRead: r, unchanged: i } = P(e);
|
|
188
|
+
if (typeof t != "string") return [];
|
|
189
|
+
let a = ce(e);
|
|
190
|
+
if (a !== void 0) return [{
|
|
191
|
+
path: t,
|
|
192
|
+
read: a
|
|
193
|
+
}];
|
|
194
|
+
let { message: o } = P(n);
|
|
195
|
+
return typeof o == "string" ? [{
|
|
196
|
+
path: t,
|
|
197
|
+
error: o
|
|
198
|
+
}] : r === !0 ? [{
|
|
199
|
+
path: t,
|
|
200
|
+
state: "notRead"
|
|
201
|
+
}] : i === !0 ? [{
|
|
202
|
+
path: t,
|
|
203
|
+
state: "unchanged"
|
|
204
|
+
}] : [];
|
|
205
|
+
}
|
|
168
206
|
function ue(e) {
|
|
169
|
-
let
|
|
207
|
+
let t = P(e).files;
|
|
208
|
+
return Array.isArray(t) ? t.flatMap(le) : void 0;
|
|
209
|
+
}
|
|
210
|
+
function de(e) {
|
|
211
|
+
let { name: t, kind: n, bytes: r } = P(e);
|
|
170
212
|
return typeof t == "string" && (n === "file" || n === "folder") && typeof r == "number" ? [{
|
|
171
213
|
name: t,
|
|
172
214
|
kind: n,
|
|
173
215
|
bytes: r
|
|
174
216
|
}] : [];
|
|
175
217
|
}
|
|
176
|
-
function de(e) {
|
|
177
|
-
let t = j(e).entries;
|
|
178
|
-
return Array.isArray(t) ? t.flatMap(ue) : void 0;
|
|
179
|
-
}
|
|
180
218
|
function fe(e) {
|
|
181
|
-
let
|
|
182
|
-
return
|
|
219
|
+
let t = P(e).entries;
|
|
220
|
+
return Array.isArray(t) ? t.flatMap(de) : void 0;
|
|
221
|
+
}
|
|
222
|
+
function pe(e) {
|
|
223
|
+
let t = P(e).paths;
|
|
224
|
+
return Array.isArray(t) ? t.filter((e) => typeof e == "string") : void 0;
|
|
225
|
+
}
|
|
226
|
+
function me(e) {
|
|
227
|
+
let { path: t, matches: n, count: r } = P(e);
|
|
228
|
+
if (typeof t != "string") return [];
|
|
229
|
+
if (typeof r == "number") return [{
|
|
183
230
|
path: t,
|
|
184
|
-
matches:
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
231
|
+
matches: [],
|
|
232
|
+
count: r
|
|
233
|
+
}];
|
|
234
|
+
if (!Array.isArray(n)) return [];
|
|
235
|
+
let i = n.flatMap((e) => {
|
|
236
|
+
let { line: t, text: n, context: r } = P(e);
|
|
237
|
+
return typeof t == "number" && typeof n == "string" ? [{
|
|
238
|
+
line: t,
|
|
239
|
+
text: n,
|
|
240
|
+
context: r === !0
|
|
241
|
+
}] : [];
|
|
242
|
+
});
|
|
243
|
+
return [{
|
|
244
|
+
path: t,
|
|
245
|
+
matches: i,
|
|
246
|
+
count: i.filter((e) => !e.context).length
|
|
191
247
|
}];
|
|
192
248
|
}
|
|
193
|
-
var
|
|
249
|
+
var he = [
|
|
194
250
|
"running",
|
|
195
251
|
"succeeded",
|
|
196
252
|
"failed",
|
|
197
253
|
"cancelled",
|
|
198
254
|
"interrupted"
|
|
199
255
|
];
|
|
200
|
-
function
|
|
201
|
-
return
|
|
256
|
+
function F(e, t) {
|
|
257
|
+
return he.some((e) => e === t) ? e(`kvcoder.ui.jobs.status.${t}`) : t;
|
|
202
258
|
}
|
|
203
|
-
function
|
|
204
|
-
let { kind: t, call: n, status: r, startedAt: i, endedAt: a, exitCode: o, output: s, problem: c } =
|
|
259
|
+
function I(e) {
|
|
260
|
+
let { kind: t, call: n, status: r, startedAt: i, endedAt: a, exitCode: o, output: s, problem: c } = P(e);
|
|
205
261
|
if (typeof n != "string" || typeof r != "string") return;
|
|
206
262
|
let l = typeof i == "string" && typeof a == "string" ? Date.parse(a) - Date.parse(i) : NaN;
|
|
207
263
|
return {
|
|
@@ -214,36 +270,36 @@ function N(e) {
|
|
|
214
270
|
...c === void 0 ? {} : { problem: c }
|
|
215
271
|
};
|
|
216
272
|
}
|
|
217
|
-
function
|
|
218
|
-
let t =
|
|
219
|
-
return Array.isArray(t) ? t.flatMap(
|
|
273
|
+
function L(e) {
|
|
274
|
+
let t = P(e).files;
|
|
275
|
+
return Array.isArray(t) ? t.flatMap(me) : void 0;
|
|
220
276
|
}
|
|
221
277
|
//#endregion
|
|
222
278
|
//#region web/src/edit-diff.ts
|
|
223
|
-
var
|
|
224
|
-
function
|
|
279
|
+
var R = 3;
|
|
280
|
+
function z(e) {
|
|
225
281
|
if (e === "") return [];
|
|
226
282
|
let t = e.split("\n");
|
|
227
283
|
return e.endsWith("\n") ? t.slice(0, -1) : t;
|
|
228
284
|
}
|
|
229
|
-
function
|
|
285
|
+
function ge(e, t) {
|
|
230
286
|
let n = 0;
|
|
231
287
|
for (; n < e.length && n < t.length && e[n] === t[n];) n += 1;
|
|
232
288
|
return n;
|
|
233
289
|
}
|
|
234
|
-
function
|
|
235
|
-
let n =
|
|
290
|
+
function _e(e, t) {
|
|
291
|
+
let n = z(e), r = z(t), i = ge(n, r), a = ge(n.slice(i).reverse(), r.slice(i).reverse()), o = (e, t) => t.map((t) => ({
|
|
236
292
|
kind: e,
|
|
237
293
|
text: t
|
|
238
294
|
}));
|
|
239
295
|
return [
|
|
240
|
-
...o("context", n.slice(Math.max(i -
|
|
296
|
+
...o("context", n.slice(Math.max(i - R, 0), i)),
|
|
241
297
|
...o("removed", n.slice(i, n.length - a)),
|
|
242
298
|
...o("added", r.slice(i, r.length - a)),
|
|
243
|
-
...o("context", n.slice(n.length - a, n.length - a +
|
|
299
|
+
...o("context", n.slice(n.length - a, n.length - a + R))
|
|
244
300
|
];
|
|
245
301
|
}
|
|
246
|
-
function
|
|
302
|
+
function ve(e) {
|
|
247
303
|
return {
|
|
248
304
|
added: e.filter((e) => e.kind === "added").length,
|
|
249
305
|
removed: e.filter((e) => e.kind === "removed").length
|
|
@@ -251,23 +307,23 @@ function he(e) {
|
|
|
251
307
|
}
|
|
252
308
|
//#endregion
|
|
253
309
|
//#region web/src/mcp-steps.ts
|
|
254
|
-
function
|
|
310
|
+
function ye(e) {
|
|
255
311
|
let t = e.steps;
|
|
256
312
|
return Array.isArray(t) ? t.map((e, t) => {
|
|
257
|
-
let { tool: n, arguments: r } =
|
|
313
|
+
let { tool: n, arguments: r } = P(e), i = `${t + 1}.`;
|
|
258
314
|
return typeof n != "string" || n.trim() === "" ? {
|
|
259
315
|
label: i,
|
|
260
|
-
arguments:
|
|
316
|
+
arguments: P(r)
|
|
261
317
|
} : {
|
|
262
318
|
label: `${i} ${n}`,
|
|
263
319
|
tool: n,
|
|
264
|
-
arguments:
|
|
320
|
+
arguments: P(r)
|
|
265
321
|
};
|
|
266
322
|
}) : [];
|
|
267
323
|
}
|
|
268
324
|
//#endregion
|
|
269
325
|
//#region web/src/call-summary.ts
|
|
270
|
-
function
|
|
326
|
+
function be(e) {
|
|
271
327
|
if (e !== void 0 && /^\s*[[{]/.test(e)) try {
|
|
272
328
|
return JSON.parse(e);
|
|
273
329
|
} catch (e) {
|
|
@@ -275,129 +331,142 @@ function ge(e) {
|
|
|
275
331
|
throw e;
|
|
276
332
|
}
|
|
277
333
|
}
|
|
278
|
-
var
|
|
279
|
-
function
|
|
280
|
-
return t <
|
|
334
|
+
var B = 1024;
|
|
335
|
+
function xe(e, t) {
|
|
336
|
+
return t < B ? e("kvcoder.ui.call.bytes", { count: t }) : t < B * B ? e("kvcoder.ui.call.kilobytes", { count: (t / B).toFixed(1) }) : e("kvcoder.ui.call.megabytes", { count: (t / (B * B)).toFixed(1) });
|
|
281
337
|
}
|
|
282
338
|
var V = (e) => typeof e == "string" && e !== "" ? e : void 0;
|
|
283
|
-
function
|
|
339
|
+
function Se(e) {
|
|
284
340
|
let t = e.edits;
|
|
285
341
|
return Array.isArray(t) ? t.flatMap((e) => {
|
|
286
|
-
let { oldText: t, newText: n } =
|
|
342
|
+
let { oldText: t, newText: n } = P(e);
|
|
287
343
|
return typeof t == "string" && typeof n == "string" ? [{
|
|
288
344
|
oldText: t,
|
|
289
345
|
newText: n
|
|
290
346
|
}] : [];
|
|
291
347
|
}) : [];
|
|
292
348
|
}
|
|
293
|
-
function
|
|
294
|
-
let t =
|
|
349
|
+
function Ce(e) {
|
|
350
|
+
let t = Se(e).map((e) => ve(_e(e.oldText, e.newText)));
|
|
295
351
|
return `+${t.reduce((e, t) => e + t.added, 0)} −${t.reduce((e, t) => e + t.removed, 0)}`;
|
|
296
352
|
}
|
|
297
|
-
function
|
|
298
|
-
if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size:
|
|
353
|
+
function we(e, t) {
|
|
354
|
+
if (typeof t.bytes == "number" && typeof t.created == "boolean") return e(t.created ? "kvcoder.ui.call.created" : "kvcoder.ui.call.replaced", { size: xe(e, t.bytes) });
|
|
299
355
|
}
|
|
300
|
-
function
|
|
356
|
+
function Te(e, t) {
|
|
301
357
|
let { fromLine: n, totalLines: r, content: i } = t;
|
|
302
358
|
if (typeof n != "number" || typeof r != "number" || typeof i != "string") return;
|
|
303
|
-
let a =
|
|
359
|
+
let a = z(i).length;
|
|
304
360
|
return a === 0 ? void 0 : e("kvcoder.ui.call.lines", {
|
|
305
361
|
from: n,
|
|
306
362
|
to: n + a - 1,
|
|
307
363
|
total: r
|
|
308
364
|
});
|
|
309
365
|
}
|
|
310
|
-
function
|
|
366
|
+
function Ee(e, t) {
|
|
311
367
|
let n = t.entries;
|
|
312
368
|
if (Array.isArray(n)) return e(t.truncated === !0 ? "kvcoder.ui.call.entriesFirst" : "kvcoder.ui.call.entries", { count: n.length });
|
|
313
369
|
}
|
|
314
|
-
function
|
|
315
|
-
let n = t.
|
|
316
|
-
if (
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
370
|
+
function De(e, t) {
|
|
371
|
+
let n = t.paths;
|
|
372
|
+
if (Array.isArray(n)) return e(t.truncated === !0 ? "kvcoder.ui.call.filesFirst" : "kvcoder.ui.call.files", { count: n.length });
|
|
373
|
+
}
|
|
374
|
+
function Oe(e, t) {
|
|
375
|
+
let n = L(t);
|
|
376
|
+
if (n === void 0) return;
|
|
377
|
+
let r = n.reduce((e, t) => e + t.count, 0);
|
|
321
378
|
return e(t.truncated === !0 ? "kvcoder.ui.call.matchesFirst" : "kvcoder.ui.call.matches", {
|
|
322
379
|
matches: r,
|
|
323
380
|
files: n.length
|
|
324
381
|
});
|
|
325
382
|
}
|
|
326
|
-
var
|
|
327
|
-
function
|
|
383
|
+
var H = (e, t, n) => Array.isArray(n) ? e(t, { count: n.length }) : void 0;
|
|
384
|
+
function U(e, t, n) {
|
|
328
385
|
return {
|
|
329
386
|
...e === void 0 ? {} : { words: e },
|
|
330
387
|
...t === void 0 ? {} : { subject: t },
|
|
331
388
|
...n === void 0 ? {} : { outcome: n }
|
|
332
389
|
};
|
|
333
390
|
}
|
|
334
|
-
function
|
|
335
|
-
let
|
|
336
|
-
if (t
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
391
|
+
function ke(e) {
|
|
392
|
+
let t = e.files;
|
|
393
|
+
if (!Array.isArray(t)) return;
|
|
394
|
+
let n = t.flatMap((e) => {
|
|
395
|
+
let { path: t } = P(e);
|
|
396
|
+
return typeof t == "string" ? [t] : [];
|
|
397
|
+
});
|
|
398
|
+
return n.length === 0 ? void 0 : n.join(", ");
|
|
399
|
+
}
|
|
400
|
+
function Ae(e, t, n, r) {
|
|
401
|
+
let i = r === void 0 ? void 0 : P(r), a = V(n.path);
|
|
402
|
+
if (t === "edit") return U(e("kvcoder.ui.call.edit"), a, i === void 0 ? void 0 : Ce(n));
|
|
403
|
+
if (t === "write") return U(e("kvcoder.ui.call.write"), a, i === void 0 ? void 0 : we(e, i));
|
|
404
|
+
if (t === "read") return U(e("kvcoder.ui.call.read"), a, i === void 0 ? void 0 : Te(e, i));
|
|
405
|
+
if (t === "read-files") return U(e("kvcoder.ui.call.read"), ke(n), i === void 0 ? void 0 : H(e, "kvcoder.ui.call.files", i.files));
|
|
406
|
+
if (t === "list") return U(e("kvcoder.ui.call.list"), a ?? ".", i === void 0 ? void 0 : Ee(e, i));
|
|
407
|
+
if (t === "find") return U(e("kvcoder.ui.call.find"), V(n.pattern), i === void 0 ? void 0 : De(e, i));
|
|
408
|
+
if (t === "search") return U(e("kvcoder.ui.call.search"), V(n.pattern), i === void 0 ? void 0 : Oe(e, i));
|
|
341
409
|
}
|
|
342
|
-
function
|
|
410
|
+
function je(e, t, n, r) {
|
|
343
411
|
let i = V(n.server), a = [i, V(n.tool)].filter((e) => e !== void 0).join(" · ");
|
|
344
|
-
if (t === "call") return
|
|
345
|
-
if (t === "run") return
|
|
346
|
-
if (t === "tools") return
|
|
412
|
+
if (t === "call") return U(void 0, a === "" ? void 0 : a);
|
|
413
|
+
if (t === "run") return U(void 0, [i, ye(n).flatMap((e) => e.tool === void 0 ? [] : [e.tool]).join(", ")].filter((e) => e !== void 0 && e !== "").join(" · "));
|
|
414
|
+
if (t === "tools") return U(e("kvcoder.ui.call.tools"), a === "" ? void 0 : a, H(e, "kvcoder.ui.call.toolCount", P(r).tools));
|
|
347
415
|
}
|
|
348
|
-
function
|
|
349
|
-
if (t === "list") return
|
|
416
|
+
function Me(e, t, n, r) {
|
|
417
|
+
if (t === "list") return U(e("kvcoder.ui.call.backgroundRuns"), void 0, H(e, "kvcoder.ui.call.runCount", r));
|
|
350
418
|
if (t === "output" || t === "wait") {
|
|
351
|
-
let i =
|
|
352
|
-
return
|
|
419
|
+
let i = I(r);
|
|
420
|
+
return U(e(`kvcoder.ui.call.${t}`), V(n.id), i === void 0 ? void 0 : F(e, i.status));
|
|
353
421
|
}
|
|
354
|
-
if (t === "stop") return
|
|
422
|
+
if (t === "stop") return U(e("kvcoder.ui.call.stop"), V(n.id));
|
|
355
423
|
}
|
|
356
|
-
function
|
|
357
|
-
let i = V(
|
|
358
|
-
return t === "set" ?
|
|
424
|
+
function Ne(e, t, n, r) {
|
|
425
|
+
let i = V(P(r).progress), a = n.steps, o = Array.isArray(a) ? a.flatMap((e) => V(P(e).id) === void 0 ? [] : [String(P(e).id)]).join(", ") : void 0;
|
|
426
|
+
return t === "set" ? U(e("kvcoder.ui.call.mapSet"), V(n.goal), i) : t === "detail" ? U(e("kvcoder.ui.call.mapDetail"), V(n.id), i) : t === "update" ? U(e("kvcoder.ui.call.mapUpdate"), o === "" ? void 0 : o, i) : t === "note" ? U(e("kvcoder.ui.call.mapNote"), V(n.text)) : t === "get" ? U(e("kvcoder.ui.call.mapGet"), void 0, i) : void 0;
|
|
359
427
|
}
|
|
360
|
-
function
|
|
428
|
+
function Pe(e, t, n) {
|
|
361
429
|
let { connector: r, command: i } = t, a = t.fields ?? {};
|
|
362
430
|
if (r !== void 0 && i !== void 0) {
|
|
363
431
|
if (t.line !== void 0) return { subject: `$ ${t.line}` };
|
|
364
|
-
if (i === "help") return
|
|
365
|
-
if (r === "fs") return
|
|
366
|
-
if (r === "mcp") return
|
|
367
|
-
if (r === "background") return
|
|
368
|
-
if (r === "execution-map") return
|
|
369
|
-
if (r === "delegate" && i === "run") return
|
|
370
|
-
if (r === "artifact" && i === "get") return
|
|
371
|
-
if (r === "
|
|
432
|
+
if (i === "help") return U(e("kvcoder.ui.call.help"), [r, V(a.command)].filter((e) => e !== void 0).join(" "));
|
|
433
|
+
if (r === "fs") return Ae(e, i, a, n);
|
|
434
|
+
if (r === "mcp") return je(e, i, a, n);
|
|
435
|
+
if (r === "background") return Me(e, i, a, n);
|
|
436
|
+
if (r === "execution-map") return Ne(e, i, a, n);
|
|
437
|
+
if (r === "delegate" && i === "run") return U(e("kvcoder.ui.call.delegate"), [V(a.worker), V(a.title)].filter((e) => e !== void 0).join(" · "));
|
|
438
|
+
if (r === "artifact" && i === "get") return U(e("kvcoder.ui.call.readArtifact"), V(a.id));
|
|
439
|
+
if (r === "web" && i === "fetch") return U(e("kvcoder.ui.call.fetch"), V(a.url));
|
|
440
|
+
if (r === "artifact" && (i === "write" || i === "edit")) return U(e(`kvcoder.ui.call.${i}Artifact`), V(a.id));
|
|
372
441
|
}
|
|
373
442
|
}
|
|
374
443
|
//#endregion
|
|
375
444
|
//#region web/src/call-view.ts
|
|
376
|
-
var
|
|
445
|
+
var Fe = 200, Ie = [
|
|
377
446
|
"text",
|
|
378
447
|
"choice",
|
|
379
448
|
"confirm"
|
|
380
449
|
];
|
|
381
|
-
function
|
|
450
|
+
function Le(e) {
|
|
382
451
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
|
|
383
452
|
}
|
|
384
|
-
var
|
|
385
|
-
function
|
|
386
|
-
let n =
|
|
387
|
-
return
|
|
453
|
+
var W = (e) => typeof e == "string" && e.trim() !== "" ? e : void 0;
|
|
454
|
+
function Re(e, t) {
|
|
455
|
+
let n = W(t.args);
|
|
456
|
+
return W(t.line) ?? (n === void 0 ? e : `${e} ${n}`);
|
|
388
457
|
}
|
|
389
|
-
function
|
|
390
|
-
let t =
|
|
458
|
+
function ze(e) {
|
|
459
|
+
let t = W(e.title) ?? W(e.description), n = W(e.command);
|
|
391
460
|
return {
|
|
392
461
|
...t === void 0 ? {} : { description: t },
|
|
393
462
|
...n === void 0 ? {} : { line: n },
|
|
394
463
|
...e.mode === "async" ? { background: !0 } : {}
|
|
395
464
|
};
|
|
396
465
|
}
|
|
397
|
-
function
|
|
398
|
-
let t =
|
|
399
|
-
if (t === void 0) return
|
|
400
|
-
let r =
|
|
466
|
+
function Be(e) {
|
|
467
|
+
let t = W(e.connector), n = W(e.command);
|
|
468
|
+
if (t === void 0) return ze(e);
|
|
469
|
+
let r = W(e.description), i = Le(typeof e.payload == "string" ? void 0 : e.payload) ?? {}, a = t === "ask" ? Ie.find((e) => e === n) : void 0;
|
|
401
470
|
return {
|
|
402
471
|
...r === void 0 ? {} : { description: r },
|
|
403
472
|
connector: t,
|
|
@@ -405,7 +474,7 @@ function Pe(e) {
|
|
|
405
474
|
command: n,
|
|
406
475
|
label: `${t} · ${n}`
|
|
407
476
|
},
|
|
408
|
-
...n === "exec" ? { line:
|
|
477
|
+
...n === "exec" ? { line: Re(t, i) } : {},
|
|
409
478
|
fields: i,
|
|
410
479
|
...i.risky === !0 ? { risky: !0 } : {},
|
|
411
480
|
...i.background === !0 ? { background: !0 } : {},
|
|
@@ -415,60 +484,62 @@ function Pe(e) {
|
|
|
415
484
|
} }
|
|
416
485
|
};
|
|
417
486
|
}
|
|
418
|
-
var
|
|
487
|
+
var Ve = [
|
|
419
488
|
"edit",
|
|
420
489
|
"write",
|
|
421
490
|
"read",
|
|
491
|
+
"read-files",
|
|
422
492
|
"list",
|
|
493
|
+
"find",
|
|
423
494
|
"search"
|
|
424
495
|
];
|
|
425
|
-
function
|
|
426
|
-
return e.line === void 0 ? e.connector === "fs" ?
|
|
496
|
+
function G(e) {
|
|
497
|
+
return e.line === void 0 ? e.connector === "fs" ? Ve.find((t) => t === e.command) ?? "fields" : e.connector === "mcp" && e.command === "call" ? "mcp-call" : e.connector === "mcp" && e.command === "run" ? "mcp-run" : e.connector === "background" && (e.command === "output" || e.command === "wait") ? "run-output" : e.connector === "delegate" && e.command === "run" ? "delegate" : "fields" : "line";
|
|
427
498
|
}
|
|
428
|
-
function
|
|
499
|
+
function K(e) {
|
|
429
500
|
let t = e.replace(/\s+/g, " ");
|
|
430
|
-
return t.length >
|
|
501
|
+
return t.length > Fe ? `${t.slice(0, Fe)}…` : t;
|
|
431
502
|
}
|
|
432
503
|
//#endregion
|
|
433
504
|
//#region web/src/field-rows.ts
|
|
434
|
-
var
|
|
435
|
-
function
|
|
505
|
+
var He = "—", Ue = (e) => e === null || typeof e == "string" || typeof e == "number" || typeof e == "boolean", We = (e) => e === null ? He : String(e);
|
|
506
|
+
function Ge(e) {
|
|
436
507
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : void 0;
|
|
437
508
|
}
|
|
438
|
-
function
|
|
439
|
-
let t =
|
|
509
|
+
function Ke(e) {
|
|
510
|
+
let t = Ge(e);
|
|
440
511
|
if (t === void 0) return;
|
|
441
512
|
let n = {};
|
|
442
513
|
for (let [e, r] of Object.entries(t)) {
|
|
443
|
-
if (!
|
|
514
|
+
if (!Ue(r)) return;
|
|
444
515
|
n[e] = r;
|
|
445
516
|
}
|
|
446
517
|
return n;
|
|
447
518
|
}
|
|
448
|
-
function
|
|
519
|
+
function qe(e) {
|
|
449
520
|
let t = [...new Set(e.flatMap((e) => Object.keys(e)))];
|
|
450
521
|
return {
|
|
451
522
|
kind: "table",
|
|
452
523
|
columns: t,
|
|
453
|
-
rows: e.map((e) => t.map((t) => t in e ?
|
|
524
|
+
rows: e.map((e) => t.map((t) => t in e ? We(e[t] ?? null) : ""))
|
|
454
525
|
};
|
|
455
526
|
}
|
|
456
|
-
function
|
|
527
|
+
function Je(e) {
|
|
457
528
|
if (e.length === 0) return { kind: "empty" };
|
|
458
|
-
if (e.every(
|
|
529
|
+
if (e.every(Ue)) return {
|
|
459
530
|
kind: "items",
|
|
460
|
-
items: e.map(
|
|
531
|
+
items: e.map(We)
|
|
461
532
|
};
|
|
462
|
-
let t = e.map(
|
|
463
|
-
return t.length === e.length ?
|
|
533
|
+
let t = e.map(Ke).filter((e) => e !== void 0);
|
|
534
|
+
return t.length === e.length ? qe(t) : {
|
|
464
535
|
kind: "rows",
|
|
465
536
|
rows: e.map((e, t) => ({
|
|
466
537
|
name: String(t + 1),
|
|
467
|
-
value:
|
|
538
|
+
value: q(e)
|
|
468
539
|
}))
|
|
469
540
|
};
|
|
470
541
|
}
|
|
471
|
-
function
|
|
542
|
+
function q(e) {
|
|
472
543
|
if (typeof e == "string") return e.includes("\n") ? {
|
|
473
544
|
kind: "block",
|
|
474
545
|
text: e
|
|
@@ -480,27 +551,27 @@ function K(e) {
|
|
|
480
551
|
kind: "text",
|
|
481
552
|
text: String(e)
|
|
482
553
|
};
|
|
483
|
-
if (Array.isArray(e)) return
|
|
484
|
-
let t =
|
|
554
|
+
if (Array.isArray(e)) return Je(e);
|
|
555
|
+
let t = Ge(e);
|
|
485
556
|
return t === void 0 || Object.keys(t).length === 0 ? { kind: "empty" } : {
|
|
486
557
|
kind: "rows",
|
|
487
|
-
rows:
|
|
558
|
+
rows: Ye(t)
|
|
488
559
|
};
|
|
489
560
|
}
|
|
490
|
-
function
|
|
561
|
+
function Ye(e) {
|
|
491
562
|
return Object.entries(e).map(([e, t]) => ({
|
|
492
563
|
name: e,
|
|
493
|
-
value:
|
|
564
|
+
value: q(t)
|
|
494
565
|
}));
|
|
495
566
|
}
|
|
496
|
-
function
|
|
567
|
+
function J(e, t) {
|
|
497
568
|
return t || e.length <= 12 ? e : e.slice(0, 12);
|
|
498
569
|
}
|
|
499
|
-
var
|
|
570
|
+
var Xe = (e) => z(e).map((e) => ({ text: e })), Y = (e, t) => z(e).map((e, n) => ({
|
|
500
571
|
text: e,
|
|
501
572
|
number: t + n
|
|
502
573
|
}));
|
|
503
|
-
function
|
|
574
|
+
function Ze(e, t) {
|
|
504
575
|
return t || e.length <= 17 ? e : [
|
|
505
576
|
...e.slice(0, 12),
|
|
506
577
|
"⋯",
|
|
@@ -509,7 +580,7 @@ function Ke(e, t) {
|
|
|
509
580
|
}
|
|
510
581
|
//#endregion
|
|
511
582
|
//#region web/src/FoldButton.vue?vue&type=script&setup=true&lang.ts
|
|
512
|
-
var
|
|
583
|
+
var Qe = ["aria-expanded"], X = /* @__PURE__ */ c({
|
|
513
584
|
__name: "FoldButton",
|
|
514
585
|
props: {
|
|
515
586
|
count: {},
|
|
@@ -518,7 +589,7 @@ var qe = ["aria-expanded"], J = /* @__PURE__ */ c({
|
|
|
518
589
|
},
|
|
519
590
|
emits: ["toggle"],
|
|
520
591
|
setup(e, { emit: t }) {
|
|
521
|
-
let n = e, a = t, o =
|
|
592
|
+
let n = e, a = t, o = N();
|
|
522
593
|
return (e, t) => n.count > (n.over ?? v(12)) ? (f(), i("button", {
|
|
523
594
|
key: 0,
|
|
524
595
|
type: "button",
|
|
@@ -526,13 +597,13 @@ var qe = ["aria-expanded"], J = /* @__PURE__ */ c({
|
|
|
526
597
|
"aria-expanded": n.open,
|
|
527
598
|
"data-test": "show-all",
|
|
528
599
|
onClick: t[0] ||= (e) => a("toggle")
|
|
529
|
-
}, _(n.open ? v(o).t("kvcoder.ui.call.showFewer") : v(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9,
|
|
600
|
+
}, _(n.open ? v(o).t("kvcoder.ui.call.showFewer") : v(o).t("kvcoder.ui.call.showAll", { count: n.count })), 9, Qe)) : r("v-if", !0);
|
|
530
601
|
}
|
|
531
|
-
}),
|
|
532
|
-
function
|
|
602
|
+
}), $e = /http:\/\/(?:127\.0\.0\.1|localhost):\d+[^\s"'`<>()[\]{}]*/g, et = /[.,;:!?]+$/;
|
|
603
|
+
function tt(e) {
|
|
533
604
|
let t = [], n = 0;
|
|
534
|
-
for (let r of e.matchAll(
|
|
535
|
-
let i = r[0].replace(
|
|
605
|
+
for (let r of e.matchAll($e)) {
|
|
606
|
+
let i = r[0].replace(et, "");
|
|
536
607
|
r.index > n && t.push({
|
|
537
608
|
kind: "text",
|
|
538
609
|
text: e.slice(n, r.index)
|
|
@@ -548,134 +619,134 @@ function Xe(e) {
|
|
|
548
619
|
}
|
|
549
620
|
//#endregion
|
|
550
621
|
//#region web/src/LinkedText.vue?vue&type=script&setup=true&lang.ts
|
|
551
|
-
var
|
|
622
|
+
var nt = ["href"], Z = /* @__PURE__ */ c({
|
|
552
623
|
__name: "LinkedText",
|
|
553
624
|
props: { text: {} },
|
|
554
625
|
setup(n) {
|
|
555
|
-
let r = n, a = t(() =>
|
|
626
|
+
let r = n, a = t(() => tt(r.text));
|
|
556
627
|
return (t, n) => (f(!0), i(e, null, m(a.value, (t, n) => (f(), i(e, { key: n }, [t.kind === "link" ? (f(), i("a", {
|
|
557
628
|
key: 0,
|
|
558
629
|
href: t.href,
|
|
559
630
|
target: "_blank",
|
|
560
631
|
rel: "noopener noreferrer",
|
|
561
632
|
class: "kvc-link"
|
|
562
|
-
}, _(t.href), 9,
|
|
633
|
+
}, _(t.href), 9, nt)) : (f(), i(e, { key: 1 }, [o(_(t.text), 1)], 64))], 64))), 128));
|
|
563
634
|
}
|
|
564
|
-
}),
|
|
635
|
+
}), rt = { class: "kvc-code-lines" }, it = ["dir", "data-kind"], at = {
|
|
565
636
|
key: 0,
|
|
566
637
|
class: "kvc-line-number",
|
|
567
638
|
"data-test": "call-line-number"
|
|
568
|
-
},
|
|
639
|
+
}, ot = {
|
|
569
640
|
key: 1,
|
|
570
641
|
class: "kvc-line-mark",
|
|
571
642
|
"aria-hidden": "true"
|
|
572
|
-
},
|
|
643
|
+
}, st = {
|
|
573
644
|
class: "kvc-line-text",
|
|
574
645
|
dir: "auto",
|
|
575
646
|
"data-test": "call-line-text"
|
|
576
|
-
},
|
|
647
|
+
}, Q = /* @__PURE__ */ c({
|
|
577
648
|
__name: "FoldedLines",
|
|
578
649
|
props: { lines: {} },
|
|
579
650
|
setup(n) {
|
|
580
|
-
let o = n, c = p(!1), l = t(() =>
|
|
651
|
+
let o = n, c = p(!1), l = t(() => J(o.lines, c.value)), u = t(() => o.lines.some((e) => e.number !== void 0)), d = t(() => o.lines.some((e) => e.kind !== void 0)), h = {
|
|
581
652
|
context: " ",
|
|
582
653
|
removed: "−",
|
|
583
654
|
added: "+"
|
|
584
655
|
};
|
|
585
|
-
return (t, n) => (f(), i("div",
|
|
656
|
+
return (t, n) => (f(), i("div", rt, [(f(!0), i(e, null, m(l.value, (e, t) => (f(), i("div", {
|
|
586
657
|
key: t,
|
|
587
658
|
class: "kvc-code-line",
|
|
588
659
|
dir: u.value || d.value ? "ltr" : void 0,
|
|
589
660
|
"data-kind": e.kind,
|
|
590
661
|
"data-test": "call-line-row"
|
|
591
662
|
}, [
|
|
592
|
-
u.value ? (f(), i("span",
|
|
593
|
-
d.value ? (f(), i("span",
|
|
594
|
-
a("span",
|
|
595
|
-
], 8,
|
|
663
|
+
u.value ? (f(), i("span", at, _(e.number), 1)) : r("v-if", !0),
|
|
664
|
+
d.value ? (f(), i("span", ot, _(h[e.kind ?? "context"]), 1)) : r("v-if", !0),
|
|
665
|
+
a("span", st, [s(Z, { text: e.text }, null, 8, ["text"])])
|
|
666
|
+
], 8, it))), 128)), s(X, {
|
|
596
667
|
count: o.lines.length,
|
|
597
668
|
open: c.value,
|
|
598
669
|
onToggle: n[0] ||= (e) => c.value = !c.value
|
|
599
670
|
}, null, 8, ["count", "open"])]));
|
|
600
671
|
}
|
|
601
|
-
}),
|
|
672
|
+
}), ct = {
|
|
602
673
|
key: 0,
|
|
603
674
|
dir: "auto",
|
|
604
675
|
"data-test": "field-text"
|
|
605
|
-
},
|
|
676
|
+
}, lt = {
|
|
606
677
|
key: 1,
|
|
607
678
|
class: "kvc-muted",
|
|
608
679
|
"data-test": "field-empty"
|
|
609
|
-
},
|
|
680
|
+
}, ut = {
|
|
610
681
|
key: 3,
|
|
611
682
|
class: "kvc-field-table"
|
|
612
|
-
},
|
|
683
|
+
}, dt = { "data-test": "field-table" }, ft = {
|
|
613
684
|
key: 4,
|
|
614
685
|
class: "kvc-field-items",
|
|
615
686
|
"data-test": "field-items"
|
|
616
|
-
},
|
|
687
|
+
}, pt = {
|
|
617
688
|
key: 5,
|
|
618
689
|
class: "kvc-fields",
|
|
619
690
|
"data-test": "call-fields"
|
|
620
|
-
},
|
|
691
|
+
}, mt = ["data-name"], ht = {
|
|
621
692
|
class: "kvc-muted",
|
|
622
693
|
dir: "ltr"
|
|
623
|
-
},
|
|
694
|
+
}, gt = { "data-test": "field-value" }, $ = /* @__PURE__ */ c({
|
|
624
695
|
__name: "FieldsView",
|
|
625
696
|
props: { value: {} },
|
|
626
697
|
setup(r) {
|
|
627
|
-
let o = r, c = p(!1), l = t(() => o.value.kind === "table" ?
|
|
698
|
+
let o = r, c = p(!1), l = t(() => o.value.kind === "table" ? J(o.value.rows, c.value) : []), u = t(() => o.value.kind === "items" ? J(o.value.items, c.value) : []);
|
|
628
699
|
return (t, r) => {
|
|
629
700
|
let d = h("FieldsView", !0);
|
|
630
|
-
return o.value.kind === "text" ? (f(), i("span",
|
|
701
|
+
return o.value.kind === "text" ? (f(), i("span", ct, [s(Z, { text: o.value.text }, null, 8, ["text"])])) : o.value.kind === "empty" ? (f(), i("span", lt, "—")) : o.value.kind === "block" ? (f(), n(Q, {
|
|
631
702
|
key: 2,
|
|
632
703
|
class: "kvc-field-block",
|
|
633
|
-
lines: v(
|
|
704
|
+
lines: v(Xe)(o.value.text),
|
|
634
705
|
"data-test": "field-block"
|
|
635
|
-
}, null, 8, ["lines"])) : o.value.kind === "table" ? (f(), i("div",
|
|
706
|
+
}, null, 8, ["lines"])) : o.value.kind === "table" ? (f(), i("div", ut, [a("table", dt, [a("thead", null, [a("tr", null, [(f(!0), i(e, null, m(o.value.columns, (e) => (f(), i("th", {
|
|
636
707
|
key: e,
|
|
637
708
|
scope: "col",
|
|
638
709
|
dir: "ltr"
|
|
639
710
|
}, _(e), 1))), 128))])]), a("tbody", null, [(f(!0), i(e, null, m(l.value, (t, n) => (f(), i("tr", { key: n }, [(f(!0), i(e, null, m(t, (e, t) => (f(), i("td", {
|
|
640
711
|
key: t,
|
|
641
712
|
dir: "auto"
|
|
642
|
-
}, [s(
|
|
713
|
+
}, [s(Z, { text: e }, null, 8, ["text"])]))), 128))]))), 128))])]), s(X, {
|
|
643
714
|
count: o.value.rows.length,
|
|
644
715
|
open: c.value,
|
|
645
716
|
onToggle: r[0] ||= (e) => c.value = !c.value
|
|
646
|
-
}, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (f(), i("div",
|
|
717
|
+
}, null, 8, ["count", "open"])])) : o.value.kind === "items" ? (f(), i("div", ft, [(f(!0), i(e, null, m(u.value, (e, t) => (f(), i("div", {
|
|
647
718
|
key: t,
|
|
648
719
|
dir: "auto"
|
|
649
|
-
}, [s(
|
|
720
|
+
}, [s(Z, { text: e }, null, 8, ["text"])]))), 128)), s(X, {
|
|
650
721
|
count: o.value.items.length,
|
|
651
722
|
open: c.value,
|
|
652
723
|
onToggle: r[1] ||= (e) => c.value = !c.value
|
|
653
|
-
}, null, 8, ["count", "open"])])) : (f(), i("dl",
|
|
724
|
+
}, null, 8, ["count", "open"])])) : (f(), i("dl", pt, [(f(!0), i(e, null, m(o.value.rows, (e) => (f(), i("div", {
|
|
654
725
|
key: e.name,
|
|
655
726
|
class: "kvc-field-row",
|
|
656
727
|
"data-name": e.name,
|
|
657
728
|
"data-test": "field-row"
|
|
658
|
-
}, [a("dt",
|
|
729
|
+
}, [a("dt", ht, _(e.name), 1), a("dd", gt, [s(d, { value: e.value }, null, 8, ["value"])])], 8, mt))), 128))]));
|
|
659
730
|
};
|
|
660
731
|
}
|
|
661
|
-
}),
|
|
732
|
+
}), _t = ["aria-label"], vt = ["aria-label"], yt = {
|
|
662
733
|
class: "kvc-mono",
|
|
663
734
|
dir: "ltr",
|
|
664
735
|
"data-test": "call-step-tool"
|
|
665
|
-
},
|
|
736
|
+
}, bt = { class: "kvc-step-arguments" }, xt = ["aria-label"], St = /* @__PURE__ */ c({
|
|
666
737
|
__name: "CallRequest",
|
|
667
738
|
props: { view: {} },
|
|
668
739
|
setup(o) {
|
|
669
|
-
let c = o, l =
|
|
670
|
-
return (t, o) => u.value === "edit" ? (f(!0), i(e, { key: 0 }, m(p.value, (e, t) => (f(), n(
|
|
740
|
+
let c = o, l = N(), u = t(() => G(c.view)), d = t(() => c.view.fields ?? {}), p = t(() => Se(d.value).map((e) => _e(e.oldText, e.newText))), h = t(() => typeof d.value.content == "string" ? d.value.content : ""), g = t(() => typeof d.value.task == "string" ? d.value.task : ""), y = t(() => u.value === "mcp-run" ? ye(d.value) : []), b = t(() => u.value === "mcp-call" ? P(d.value.arguments) : u.value === "fields" ? d.value : {});
|
|
741
|
+
return (t, o) => u.value === "edit" ? (f(!0), i(e, { key: 0 }, m(p.value, (e, t) => (f(), n(Q, {
|
|
671
742
|
key: t,
|
|
672
743
|
class: "kvc-block",
|
|
673
744
|
lines: e,
|
|
674
745
|
"data-test": "call-diff"
|
|
675
|
-
}, null, 8, ["lines"]))), 128)) : u.value === "write" ? (f(), n(
|
|
746
|
+
}, null, 8, ["lines"]))), 128)) : u.value === "write" ? (f(), n(Q, {
|
|
676
747
|
key: 1,
|
|
677
748
|
class: "kvc-block",
|
|
678
|
-
lines: v(
|
|
749
|
+
lines: v(Y)(h.value, 1),
|
|
679
750
|
"data-test": "call-content"
|
|
680
751
|
}, null, 8, ["lines"])) : u.value === "line" ? (f(), i("pre", {
|
|
681
752
|
key: 2,
|
|
@@ -683,7 +754,7 @@ var Ze = ["href"], Y = /* @__PURE__ */ c({
|
|
|
683
754
|
dir: "ltr",
|
|
684
755
|
"aria-label": v(l).t("kvcoder.ui.command"),
|
|
685
756
|
"data-test": "call-payload"
|
|
686
|
-
}, "$ " + _(c.view.line), 9,
|
|
757
|
+
}, "$ " + _(c.view.line), 9, _t)) : y.value.length > 0 ? (f(), i("ol", {
|
|
687
758
|
key: 3,
|
|
688
759
|
class: "kvc-block kvc-steps",
|
|
689
760
|
"aria-label": v(l).t("kvcoder.ui.call.payload"),
|
|
@@ -691,10 +762,10 @@ var Ze = ["href"], Y = /* @__PURE__ */ c({
|
|
|
691
762
|
}, [(f(!0), i(e, null, m(y.value, (e, t) => (f(), i("li", {
|
|
692
763
|
key: t,
|
|
693
764
|
"data-test": "call-step"
|
|
694
|
-
}, [a("span",
|
|
765
|
+
}, [a("span", yt, _(e.label), 1), a("div", bt, [s($, { value: v(q)(e.arguments) }, null, 8, ["value"])])]))), 128))], 8, vt)) : u.value === "delegate" ? (f(), n(Q, {
|
|
695
766
|
key: 4,
|
|
696
767
|
class: "kvc-block kvc-prose-lines",
|
|
697
|
-
lines: v(
|
|
768
|
+
lines: v(Xe)(g.value),
|
|
698
769
|
"aria-label": v(l).t("kvcoder.ui.call.task"),
|
|
699
770
|
"data-test": "call-task"
|
|
700
771
|
}, null, 8, ["lines", "aria-label"])) : Object.keys(b.value).length > 0 ? (f(), i("div", {
|
|
@@ -702,19 +773,19 @@ var Ze = ["href"], Y = /* @__PURE__ */ c({
|
|
|
702
773
|
class: "kvc-block",
|
|
703
774
|
"aria-label": v(l).t("kvcoder.ui.call.payload"),
|
|
704
775
|
"data-test": "call-payload-fields"
|
|
705
|
-
}, [s(
|
|
776
|
+
}, [s($, { value: v(q)(b.value) }, null, 8, ["value"])], 8, xt)) : r("v-if", !0);
|
|
706
777
|
}
|
|
707
|
-
}),
|
|
778
|
+
}), Ct = { class: "kvc-output-block" }, wt = ["aria-label"], Tt = /* @__PURE__ */ c({
|
|
708
779
|
__name: "FoldedOutput",
|
|
709
780
|
props: { output: {} },
|
|
710
781
|
setup(e) {
|
|
711
|
-
let n = e, r =
|
|
712
|
-
return (e, t) => (f(), i("div",
|
|
782
|
+
let n = e, r = N(), o = p(!1), c = t(() => n.output.split("\n")), l = t(() => Ze(c.value, o.value).join("\n"));
|
|
783
|
+
return (e, t) => (f(), i("div", Ct, [a("pre", {
|
|
713
784
|
class: "kvc-output",
|
|
714
785
|
dir: "auto",
|
|
715
786
|
"aria-label": v(r).t("kvcoder.ui.output"),
|
|
716
787
|
"data-test": "call-output"
|
|
717
|
-
}, [s(
|
|
788
|
+
}, [s(Z, { text: l.value }, null, 8, ["text"])], 8, wt), s(X, {
|
|
718
789
|
count: c.value.length,
|
|
719
790
|
open: o.value,
|
|
720
791
|
over: v(12) + v(5),
|
|
@@ -725,97 +796,103 @@ var Ze = ["href"], Y = /* @__PURE__ */ c({
|
|
|
725
796
|
"over"
|
|
726
797
|
])]));
|
|
727
798
|
}
|
|
728
|
-
})
|
|
729
|
-
//#endregion
|
|
730
|
-
//#region web/src/durations.ts
|
|
731
|
-
function $(e, t) {
|
|
732
|
-
if (t < 1e3) return e("kvcoder.ui.milliseconds", { count: Math.round(t) });
|
|
733
|
-
if (t < 1e4) return e("kvcoder.ui.seconds", { count: (t / 1e3).toFixed(1) });
|
|
734
|
-
let n = Math.round(t / 1e3);
|
|
735
|
-
return n < 60 ? e("kvcoder.ui.seconds", { count: n }) : e("kvcoder.ui.minutesSeconds", {
|
|
736
|
-
minutes: Math.floor(n / 60),
|
|
737
|
-
seconds: n % 60
|
|
738
|
-
});
|
|
739
|
-
}
|
|
740
|
-
//#endregion
|
|
741
|
-
//#region web/src/RunOutput.vue?vue&type=script&setup=true&lang.ts
|
|
742
|
-
var bt = {
|
|
799
|
+
}), Et = {
|
|
743
800
|
class: "kvc-block kvc-run-row",
|
|
744
801
|
"data-test": "run-row"
|
|
745
|
-
},
|
|
802
|
+
}, Dt = {
|
|
746
803
|
class: "kvc-run-call",
|
|
747
804
|
dir: "auto",
|
|
748
805
|
"data-test": "run-call"
|
|
749
|
-
},
|
|
806
|
+
}, Ot = {
|
|
750
807
|
class: "kvc-chip",
|
|
751
808
|
"data-test": "run-status"
|
|
752
|
-
},
|
|
809
|
+
}, kt = {
|
|
753
810
|
key: 0,
|
|
754
811
|
class: "kvc-muted",
|
|
755
812
|
"data-test": "run-time"
|
|
756
|
-
},
|
|
813
|
+
}, At = ["aria-label"], jt = ["aria-label"], Mt = ["aria-label"], Nt = ["aria-label"], Pt = /* @__PURE__ */ c({
|
|
757
814
|
__name: "RunOutput",
|
|
758
815
|
props: { run: {} },
|
|
759
816
|
setup(c) {
|
|
760
|
-
let l = c, u =
|
|
817
|
+
let l = c, u = N(), d = (e) => typeof e == "string" ? e : void 0, p = t(() => d(l.run.output)), m = t(() => d(l.run.problem)), h = t(() => ({
|
|
761
818
|
type: "markdown",
|
|
762
819
|
text: "kvcoder.markdown",
|
|
763
820
|
params: { text: p.value ?? "" }
|
|
764
821
|
}));
|
|
765
822
|
return (t, c) => (f(), i(e, null, [
|
|
766
|
-
a("div",
|
|
767
|
-
a("span",
|
|
768
|
-
a("span",
|
|
769
|
-
l.run.ranMs === void 0 ? r("v-if", !0) : (f(), i("span",
|
|
823
|
+
a("div", Et, [
|
|
824
|
+
a("span", Dt, _(l.run.call), 1),
|
|
825
|
+
a("span", Ot, [o(_(v(F)(v(u).t, l.run.status)), 1), l.run.exitCode === void 0 ? r("v-if", !0) : (f(), i(e, { key: 0 }, [o(" · " + _(v(u).t("kvcoder.ui.exitCode", { code: l.run.exitCode })), 1)], 64))]),
|
|
826
|
+
l.run.ranMs === void 0 ? r("v-if", !0) : (f(), i("span", kt, _(v(M)(v(u).t, l.run.ranMs)), 1))
|
|
770
827
|
]),
|
|
771
828
|
m.value === void 0 ? l.run.problem === void 0 ? r("v-if", !0) : (f(), i("div", {
|
|
772
829
|
key: 1,
|
|
773
830
|
class: "kvc-block kvc-error",
|
|
774
831
|
"aria-label": v(u).t("kvcoder.ui.call.error"),
|
|
775
832
|
"data-test": "run-problem"
|
|
776
|
-
}, [s(
|
|
833
|
+
}, [s($, { value: v(q)(l.run.problem) }, null, 8, ["value"])], 8, jt)) : (f(), i("pre", {
|
|
777
834
|
key: 0,
|
|
778
835
|
class: "kvc-block kvc-error",
|
|
779
836
|
dir: "auto",
|
|
780
837
|
"aria-label": v(u).t("kvcoder.ui.call.error"),
|
|
781
838
|
"data-test": "run-problem"
|
|
782
|
-
}, [s(
|
|
839
|
+
}, [s(Z, { text: m.value }, null, 8, ["text"])], 8, At)),
|
|
783
840
|
p.value === void 0 && l.run.output !== void 0 ? (f(), i("div", {
|
|
784
841
|
key: 2,
|
|
785
842
|
class: "kvc-block",
|
|
786
843
|
"aria-label": v(u).t("kvcoder.ui.output"),
|
|
787
844
|
"data-test": "call-result-fields"
|
|
788
|
-
}, [s(
|
|
845
|
+
}, [s($, { value: v(q)(l.run.output) }, null, 8, ["value"])], 8, Mt)) : l.run.answer && p.value ? (f(), i("div", {
|
|
789
846
|
key: 3,
|
|
790
847
|
class: "kvc-block",
|
|
791
848
|
"aria-label": v(u).t("kvcoder.ui.call.answer"),
|
|
792
849
|
"data-test": "call-answer"
|
|
793
|
-
}, [(f(), n(g(v(u).View), { view: h.value }, null, 8, ["view"]))], 8,
|
|
850
|
+
}, [(f(), n(g(v(u).View), { view: h.value }, null, 8, ["view"]))], 8, Nt)) : p.value ? (f(), n(Tt, {
|
|
794
851
|
key: 4,
|
|
795
852
|
output: p.value
|
|
796
853
|
}, null, 8, ["output"])) : r("v-if", !0)
|
|
797
854
|
], 64));
|
|
798
855
|
}
|
|
799
|
-
}),
|
|
856
|
+
}), Ft = {
|
|
800
857
|
key: 0,
|
|
801
858
|
class: "kvc-muted kvc-call-parts",
|
|
802
859
|
"data-test": "call-replacements"
|
|
803
|
-
},
|
|
860
|
+
}, It = {
|
|
804
861
|
key: 2,
|
|
805
862
|
class: "kvc-block kvc-entries",
|
|
806
863
|
"data-test": "call-entries"
|
|
807
|
-
},
|
|
864
|
+
}, Lt = ["data-kind"], Rt = {
|
|
808
865
|
class: "kvc-mono",
|
|
809
866
|
dir: "auto",
|
|
810
867
|
"data-test": "call-entry-name"
|
|
811
|
-
},
|
|
868
|
+
}, zt = {
|
|
812
869
|
key: 0,
|
|
813
870
|
class: "kvc-muted",
|
|
814
871
|
"data-test": "call-entry-size"
|
|
815
|
-
},
|
|
872
|
+
}, Bt = {
|
|
873
|
+
key: 3,
|
|
874
|
+
class: "kvc-block kvc-entries",
|
|
875
|
+
"data-test": "call-paths"
|
|
876
|
+
}, Vt = {
|
|
877
|
+
class: "kvc-mono",
|
|
878
|
+
dir: "auto"
|
|
879
|
+
}, Ht = {
|
|
880
|
+
class: "kvc-mono kvc-file-path",
|
|
881
|
+
"data-test": "call-file-path"
|
|
882
|
+
}, Ut = {
|
|
883
|
+
key: 1,
|
|
884
|
+
class: "kvc-muted kvc-call-parts",
|
|
885
|
+
"data-test": "call-file-count"
|
|
886
|
+
}, Wt = {
|
|
816
887
|
class: "kvc-mono kvc-file-path",
|
|
888
|
+
dir: "auto",
|
|
817
889
|
"data-test": "call-file-path"
|
|
818
|
-
},
|
|
890
|
+
}, Gt = {
|
|
891
|
+
key: 1,
|
|
892
|
+
class: "kvc-muted kvc-call-parts",
|
|
893
|
+
dir: "auto",
|
|
894
|
+
"data-test": "call-read-file-note"
|
|
895
|
+
}, Kt = ["aria-label"], qt = ["aria-label"], Jt = /* @__PURE__ */ c({
|
|
819
896
|
__name: "CallResult",
|
|
820
897
|
props: {
|
|
821
898
|
view: {},
|
|
@@ -823,78 +900,99 @@ var bt = {
|
|
|
823
900
|
result: {}
|
|
824
901
|
},
|
|
825
902
|
setup(o) {
|
|
826
|
-
let c = o, l =
|
|
903
|
+
let c = o, l = N(), u = t(() => G(c.view)), d = t(() => u.value === "edit" ? se(c.result) : void 0), h = t(() => u.value === "read" ? ce(c.result) : void 0), y = t(() => u.value === "read-files" ? ue(c.result) : void 0), b = (e) => e.error ?? l.t(e.state === "notRead" ? "kvcoder.ui.call.fileNotRead" : "kvcoder.ui.call.fileUnchanged"), x = t(() => u.value === "list" ? fe(c.result) : void 0), S = t(() => u.value === "search" ? L(c.result) : void 0), C = t(() => u.value === "find" ? pe(c.result) : void 0), w = p(!1), T = t(() => J(C.value ?? [], w.value)), E = t(() => u.value === "run-output" ? I(c.result) : void 0), D = p(!1), O = t(() => J(x.value ?? [], D.value)), k = t(() => ({
|
|
827
904
|
type: "markdown",
|
|
828
905
|
text: "kvcoder.markdown",
|
|
829
906
|
params: { text: c.output }
|
|
830
|
-
})),
|
|
831
|
-
return (t, o) => d.value === void 0 ? h.value === void 0 ?
|
|
832
|
-
key:
|
|
907
|
+
})), A = t(() => u.value !== "line" && typeof c.result == "object" && c.result !== null);
|
|
908
|
+
return (t, o) => d.value === void 0 ? h.value === void 0 ? x.value === void 0 ? C.value === void 0 ? S.value === void 0 ? y.value === void 0 ? u.value === "write" && A.value ? (f(), i(e, { key: 6 }, [], 64)) : E.value === void 0 ? u.value === "delegate" && c.output !== "" ? (f(), i("div", {
|
|
909
|
+
key: 8,
|
|
833
910
|
class: "kvc-block",
|
|
834
911
|
"aria-label": v(l).t("kvcoder.ui.call.answer"),
|
|
835
912
|
"data-test": "call-answer"
|
|
836
|
-
}, [(f(), n(g(v(l).View), { view:
|
|
837
|
-
key:
|
|
913
|
+
}, [(f(), n(g(v(l).View), { view: k.value }, null, 8, ["view"]))], 8, Kt)) : A.value ? (f(), i("div", {
|
|
914
|
+
key: 9,
|
|
838
915
|
class: "kvc-block",
|
|
839
916
|
"aria-label": v(l).t("kvcoder.ui.output"),
|
|
840
917
|
"data-test": "call-result-fields"
|
|
841
|
-
}, [s(
|
|
842
|
-
key:
|
|
918
|
+
}, [s($, { value: v(q)(c.result) }, null, 8, ["value"])], 8, qt)) : c.output === "" ? r("v-if", !0) : (f(), n(Tt, {
|
|
919
|
+
key: 10,
|
|
843
920
|
output: c.output
|
|
844
|
-
}, null, 8, ["output"])) : (f(), n(
|
|
845
|
-
key:
|
|
846
|
-
run:
|
|
847
|
-
}, null, 8, ["run"])) : (f(!0), i(e, { key:
|
|
921
|
+
}, null, 8, ["output"])) : (f(), n(Pt, {
|
|
922
|
+
key: 7,
|
|
923
|
+
run: E.value
|
|
924
|
+
}, null, 8, ["run"])) : (f(!0), i(e, { key: 5 }, m(y.value, (e, t) => (f(), i("div", {
|
|
925
|
+
key: `${t}:${e.path}`,
|
|
926
|
+
class: "kvc-block",
|
|
927
|
+
"data-test": "call-read-file"
|
|
928
|
+
}, [a("div", Wt, _(e.path), 1), e.read === void 0 ? (f(), i("p", Gt, _(b(e)), 1)) : (f(), n(Q, {
|
|
929
|
+
key: 0,
|
|
930
|
+
lines: v(Y)(e.read.content, e.read.fromLine)
|
|
931
|
+
}, null, 8, ["lines"]))]))), 128)) : (f(!0), i(e, { key: 4 }, m(S.value, (e) => (f(), i("div", {
|
|
848
932
|
key: e.path,
|
|
849
933
|
class: "kvc-block",
|
|
850
934
|
"data-test": "call-file"
|
|
851
|
-
}, [a("div",
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
935
|
+
}, [a("div", Ht, _(e.path), 1), e.matches.length > 0 ? (f(), n(Q, {
|
|
936
|
+
key: 0,
|
|
937
|
+
lines: e.matches.map((e) => ({
|
|
938
|
+
text: e.text,
|
|
939
|
+
number: e.line
|
|
940
|
+
}))
|
|
941
|
+
}, null, 8, ["lines"])) : (f(), i("p", Ut, _(v(l).t("kvcoder.ui.call.matchCount", { count: e.count })), 1))]))), 128)) : (f(), i("div", Bt, [(f(!0), i(e, null, m(T.value, (e) => (f(), i("div", {
|
|
942
|
+
key: e,
|
|
943
|
+
class: "kvc-entry",
|
|
944
|
+
"data-test": "call-path"
|
|
945
|
+
}, [s(v(j), {
|
|
946
|
+
size: 14,
|
|
947
|
+
"aria-hidden": "true"
|
|
948
|
+
}), a("span", Vt, _(e), 1)]))), 128)), s(X, {
|
|
949
|
+
count: C.value.length,
|
|
950
|
+
open: w.value,
|
|
951
|
+
onToggle: o[1] ||= (e) => w.value = !w.value
|
|
952
|
+
}, null, 8, ["count", "open"])])) : (f(), i("div", It, [(f(!0), i(e, null, m(O.value, (e) => (f(), i("div", {
|
|
855
953
|
key: e.name,
|
|
856
954
|
class: "kvc-entry",
|
|
857
955
|
"data-kind": e.kind,
|
|
858
956
|
"data-test": "call-entry"
|
|
859
957
|
}, [
|
|
860
|
-
(f(), n(g(e.kind === "folder" ? v(
|
|
958
|
+
(f(), n(g(e.kind === "folder" ? v(te) : v(j)), {
|
|
861
959
|
size: 14,
|
|
862
960
|
"aria-hidden": "true"
|
|
863
961
|
})),
|
|
864
|
-
a("span",
|
|
865
|
-
e.kind === "file" ? (f(), i("span",
|
|
866
|
-
], 8,
|
|
867
|
-
count:
|
|
868
|
-
open:
|
|
869
|
-
onToggle: o[0] ||= (e) =>
|
|
870
|
-
}, null, 8, ["count", "open"])])) : (f(), n(
|
|
962
|
+
a("span", Rt, _(e.name), 1),
|
|
963
|
+
e.kind === "file" ? (f(), i("span", zt, _(v(xe)(v(l).t, e.bytes)), 1)) : r("v-if", !0)
|
|
964
|
+
], 8, Lt))), 128)), s(X, {
|
|
965
|
+
count: x.value.length,
|
|
966
|
+
open: D.value,
|
|
967
|
+
onToggle: o[0] ||= (e) => D.value = !D.value
|
|
968
|
+
}, null, 8, ["count", "open"])])) : (f(), n(Q, {
|
|
871
969
|
key: 1,
|
|
872
970
|
class: "kvc-block",
|
|
873
|
-
lines: v(
|
|
971
|
+
lines: v(Y)(h.value.content, h.value.fromLine),
|
|
874
972
|
"data-test": "call-content"
|
|
875
|
-
}, null, 8, ["lines"])) : (f(), i("p",
|
|
973
|
+
}, null, 8, ["lines"])) : (f(), i("p", Ft, _(v(l).t("kvcoder.ui.call.replacements", {
|
|
876
974
|
count: d.value.replacements,
|
|
877
975
|
line: d.value.firstChangedLine
|
|
878
976
|
})), 1));
|
|
879
977
|
}
|
|
880
|
-
}),
|
|
978
|
+
}), Yt = {
|
|
881
979
|
key: 0,
|
|
882
980
|
class: "kvc-summary",
|
|
883
981
|
"data-test": "call-summary"
|
|
884
|
-
},
|
|
982
|
+
}, Xt = {
|
|
885
983
|
key: 0,
|
|
886
984
|
"data-test": "call-words"
|
|
887
|
-
},
|
|
985
|
+
}, Zt = {
|
|
888
986
|
key: 1,
|
|
889
987
|
class: "kvc-mono",
|
|
890
988
|
"data-test": "call-subject"
|
|
891
|
-
},
|
|
989
|
+
}, Qt = ["dir"], $t = {
|
|
892
990
|
key: 1,
|
|
893
991
|
class: "kvc-muted",
|
|
894
992
|
dir: "ltr",
|
|
895
993
|
style: { "align-self": "flex-start" },
|
|
896
994
|
"data-test": "call-label"
|
|
897
|
-
},
|
|
995
|
+
}, en = /* @__PURE__ */ c({
|
|
898
996
|
__name: "CallSummaryLine",
|
|
899
997
|
props: {
|
|
900
998
|
view: {},
|
|
@@ -902,50 +1000,50 @@ var bt = {
|
|
|
902
1000
|
whole: { type: Boolean }
|
|
903
1001
|
},
|
|
904
1002
|
setup(e) {
|
|
905
|
-
let n = e, a =
|
|
906
|
-
return (e, t) => o.value === void 0 ? n.view.label ? (f(), i("span",
|
|
907
|
-
o.value.words ? (f(), i("span",
|
|
908
|
-
c.value ? (f(), i("span",
|
|
1003
|
+
let n = e, a = N(), o = t(() => Pe(a.t, n.view, n.result)), s = t(() => /\p{L}/u.test(o.value?.outcome ?? "") ? void 0 : "ltr"), c = t(() => o.value?.subject === void 0 || n.whole === !0 ? o.value?.subject : K(o.value.subject));
|
|
1004
|
+
return (e, t) => o.value === void 0 ? n.view.label ? (f(), i("span", $t, _(n.view.label), 1)) : r("v-if", !0) : (f(), i("span", Yt, [
|
|
1005
|
+
o.value.words ? (f(), i("span", Xt, _(o.value.words), 1)) : r("v-if", !0),
|
|
1006
|
+
c.value ? (f(), i("span", Zt, _(c.value), 1)) : r("v-if", !0),
|
|
909
1007
|
o.value.outcome ? (f(), i("span", {
|
|
910
1008
|
key: 2,
|
|
911
1009
|
class: "kvc-muted",
|
|
912
1010
|
dir: s.value,
|
|
913
1011
|
"data-test": "call-outcome"
|
|
914
|
-
}, _(o.value.outcome), 9,
|
|
1012
|
+
}, _(o.value.outcome), 9, Qt)) : r("v-if", !0)
|
|
915
1013
|
]));
|
|
916
1014
|
}
|
|
917
|
-
}),
|
|
1015
|
+
}), tn = ["aria-expanded", "disabled"], nn = ["aria-label"], rn = { class: "kvc-lines" }, an = {
|
|
918
1016
|
key: 0,
|
|
919
1017
|
style: { "font-weight": "600" },
|
|
920
1018
|
"data-test": "call-description"
|
|
921
|
-
},
|
|
1019
|
+
}, on = {
|
|
922
1020
|
key: 1,
|
|
923
1021
|
class: "kvc-oneline",
|
|
924
1022
|
"data-test": "call-line"
|
|
925
|
-
},
|
|
1023
|
+
}, sn = { class: "kvc-mono" }, cn = {
|
|
926
1024
|
key: 2,
|
|
927
1025
|
class: "kvc-chip kvc-warn",
|
|
928
1026
|
"data-test": "call-risky"
|
|
929
|
-
},
|
|
1027
|
+
}, ln = {
|
|
930
1028
|
key: 3,
|
|
931
1029
|
class: "kvc-chip",
|
|
932
1030
|
"data-test": "call-background"
|
|
933
|
-
},
|
|
1031
|
+
}, un = {
|
|
934
1032
|
key: 4,
|
|
935
1033
|
class: "kvc-chip",
|
|
936
1034
|
"data-test": "call-not-run"
|
|
937
|
-
},
|
|
1035
|
+
}, dn = {
|
|
938
1036
|
key: 5,
|
|
939
1037
|
class: "kvc-chip kvc-danger",
|
|
940
1038
|
"data-test": "call-failed"
|
|
941
|
-
},
|
|
1039
|
+
}, fn = {
|
|
942
1040
|
class: "kvc-muted",
|
|
943
1041
|
"data-test": "call-time"
|
|
944
|
-
},
|
|
1042
|
+
}, pn = {
|
|
945
1043
|
key: 0,
|
|
946
1044
|
class: "kvc-muted kvc-call-parts",
|
|
947
1045
|
"data-test": "call-parts"
|
|
948
|
-
},
|
|
1046
|
+
}, mn = ["aria-expanded"], hn = ["aria-label"], gn = /* @__PURE__ */ c({
|
|
949
1047
|
__name: "CallCard",
|
|
950
1048
|
props: {
|
|
951
1049
|
view: {},
|
|
@@ -955,14 +1053,14 @@ var bt = {
|
|
|
955
1053
|
running: { type: Boolean }
|
|
956
1054
|
},
|
|
957
1055
|
setup(o) {
|
|
958
|
-
let c = o, l =
|
|
1056
|
+
let c = o, l = N(), u = t(() => G(c.view)), m = p(!1), h = p(!1), y = t(() => c.failed === !0 && c.output !== void 0 ? ae(c.output) : void 0), b = t(() => y.value?.kind === "invalid"), x = t(() => {
|
|
959
1057
|
let e = y.value;
|
|
960
1058
|
return e === void 0 ? "" : e.kind === "error" ? e.message : l.t(`kvcoder.ui.failure.${e.kind}`);
|
|
961
|
-
}), S = t(() => c.failed === !0 ? void 0 :
|
|
1059
|
+
}), S = t(() => c.failed === !0 ? void 0 : be(c.output)), C = t(() => c.failed === !0 && u.value !== "line"), w = t(() => c.durationMs === void 0 ? "" : M(l.t, (c.view.writtenMs ?? 0) + c.durationMs)), T = t(() => {
|
|
962
1060
|
if (c.durationMs === void 0) return "";
|
|
963
|
-
let e =
|
|
1061
|
+
let e = M(l.t, c.durationMs);
|
|
964
1062
|
return c.view.writtenMs === void 0 ? l.t("kvcoder.ui.callRan", { ran: e }) : l.t("kvcoder.ui.callParts", {
|
|
965
|
-
written:
|
|
1063
|
+
written: M(l.t, c.view.writtenMs),
|
|
966
1064
|
ran: e
|
|
967
1065
|
});
|
|
968
1066
|
});
|
|
@@ -984,14 +1082,14 @@ var bt = {
|
|
|
984
1082
|
key: 0,
|
|
985
1083
|
class: "kvc-spin",
|
|
986
1084
|
"aria-label": v(l).t("kvcoder.ui.running")
|
|
987
|
-
}, null, 8,
|
|
1085
|
+
}, null, 8, nn)) : (f(), n(g(m.value ? v(A) : v(ee)), {
|
|
988
1086
|
key: 1,
|
|
989
1087
|
size: 16,
|
|
990
1088
|
"aria-hidden": "true"
|
|
991
1089
|
})),
|
|
992
|
-
a("span",
|
|
993
|
-
c.view.description ? (f(), i("span",
|
|
994
|
-
s(
|
|
1090
|
+
a("span", rn, [
|
|
1091
|
+
c.view.description ? (f(), i("span", an, _(c.view.description), 1)) : c.view.connector === void 0 && c.view.line ? (f(), i("span", on, [a("span", sn, _(v(K)(c.view.line)), 1)])) : r("v-if", !0),
|
|
1092
|
+
s(en, {
|
|
995
1093
|
view: c.view,
|
|
996
1094
|
result: S.value
|
|
997
1095
|
}, null, 8, ["view", "result"]),
|
|
@@ -1002,22 +1100,22 @@ var bt = {
|
|
|
1002
1100
|
"data-test": "call-reason"
|
|
1003
1101
|
}, _(x.value), 3))
|
|
1004
1102
|
]),
|
|
1005
|
-
c.view.risky ? (f(), i("span",
|
|
1006
|
-
c.view.background ? (f(), i("span",
|
|
1007
|
-
b.value ? (f(), i("span",
|
|
1008
|
-
a("span",
|
|
1009
|
-
], 8,
|
|
1103
|
+
c.view.risky ? (f(), i("span", cn, _(v(l).t("kvcoder.ui.call.risky")), 1)) : r("v-if", !0),
|
|
1104
|
+
c.view.background ? (f(), i("span", ln, _(v(l).t("kvcoder.ui.jobs.background")), 1)) : r("v-if", !0),
|
|
1105
|
+
b.value ? (f(), i("span", un, _(v(l).t("kvcoder.ui.callNotRun")), 1)) : c.failed ? (f(), i("span", dn, _(v(l).t("kvcoder.ui.callFailed")), 1)) : r("v-if", !0),
|
|
1106
|
+
a("span", fn, _(w.value), 1)
|
|
1107
|
+
], 8, tn), m.value && c.output !== void 0 ? (f(), i(e, { key: 0 }, [T.value === "" ? r("v-if", !0) : (f(), i("p", pn, _(T.value), 1)), C.value ? (f(), i(e, { key: 1 }, [a("button", {
|
|
1010
1108
|
type: "button",
|
|
1011
1109
|
class: "kvc-text-button kvc-fold",
|
|
1012
1110
|
"aria-expanded": h.value,
|
|
1013
1111
|
"data-test": "call-details",
|
|
1014
1112
|
onClick: o[1] ||= (e) => h.value = !h.value
|
|
1015
|
-
}, _(v(l).t(h.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9,
|
|
1113
|
+
}, _(v(l).t(h.value ? "kvcoder.ui.call.hideDetails" : "kvcoder.ui.call.showDetails")), 9, mn), h.value ? (f(), i(e, { key: 0 }, [a("pre", {
|
|
1016
1114
|
class: "kvc-block kvc-error",
|
|
1017
1115
|
dir: "auto",
|
|
1018
1116
|
"aria-label": v(l).t("kvcoder.ui.call.error"),
|
|
1019
1117
|
"data-test": "call-error"
|
|
1020
|
-
}, [s(
|
|
1118
|
+
}, [s(Z, { text: c.output }, null, 8, ["text"])], 8, hn), s(St, { view: c.view }, null, 8, ["view"])], 64)) : r("v-if", !0)], 64)) : (f(), i(e, { key: 2 }, [s(St, { view: c.view }, null, 8, ["view"]), s(Jt, {
|
|
1021
1119
|
view: c.view,
|
|
1022
1120
|
output: c.output,
|
|
1023
1121
|
result: S.value
|
|
@@ -1027,7 +1125,7 @@ var bt = {
|
|
|
1027
1125
|
"result"
|
|
1028
1126
|
])], 64))], 64)) : r("v-if", !0)], 2));
|
|
1029
1127
|
}
|
|
1030
|
-
}),
|
|
1128
|
+
}), _n = /* @__PURE__ */ c({
|
|
1031
1129
|
__name: "call",
|
|
1032
1130
|
props: {
|
|
1033
1131
|
description: {},
|
|
@@ -1043,13 +1141,13 @@ var bt = {
|
|
|
1043
1141
|
let r = e, i = t(() => r.connector === void 0 ? {
|
|
1044
1142
|
...r.description === void 0 ? {} : { description: r.description },
|
|
1045
1143
|
...r.line === void 0 ? {} : { line: r.line }
|
|
1046
|
-
} :
|
|
1144
|
+
} : Be({
|
|
1047
1145
|
description: r.description,
|
|
1048
1146
|
connector: r.connector,
|
|
1049
1147
|
command: r.command,
|
|
1050
1148
|
payload: r.payload ?? {}
|
|
1051
1149
|
}));
|
|
1052
|
-
return (e, t) => (f(), n(
|
|
1150
|
+
return (e, t) => (f(), n(gn, {
|
|
1053
1151
|
view: i.value,
|
|
1054
1152
|
failed: r.failed,
|
|
1055
1153
|
"duration-ms": r.durationMs,
|
|
@@ -1063,4 +1161,4 @@ var bt = {
|
|
|
1063
1161
|
}
|
|
1064
1162
|
});
|
|
1065
1163
|
//#endregion
|
|
1066
|
-
export {
|
|
1164
|
+
export { _n as default };
|