@kvman/kvcoder 0.1.0 → 0.1.1
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/web/components/call.js +142 -238
- package/dist/web/components/connectors.js +1174 -1549
- package/dist/web/components/conversation.js +1853 -2698
- package/dist/web/components/mcp-sign-in.js +86 -120
- package/dist/web/components/model.js +226 -331
- package/dist/web/components/question.js +129 -185
- package/dist/web/components/sessions.js +90 -138
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, h as c, inject as l, onUnmounted as u, openBlock as d, renderList as f, shallowRef as p, toDisplayString as m,
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, h as c, inject as l, onUnmounted as u, openBlock as d, renderList as f, shallowRef as p, toDisplayString as m, unref as h, watch as g } 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 _ = {
|
|
4
4
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5
5
|
width: 24,
|
|
6
6
|
height: 24,
|
|
@@ -10,25 +10,25 @@ var g = {
|
|
|
10
10
|
"stroke-width": 2,
|
|
11
11
|
"stroke-linecap": "round",
|
|
12
12
|
"stroke-linejoin": "round"
|
|
13
|
-
},
|
|
13
|
+
}, v = (...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 y(e) {
|
|
17
17
|
return e != null;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let n = t.attributeNames ?? {}, r = (e) => n[e] ?? e, i = e.size ?? e.width ??
|
|
19
|
+
function b(e, t = {}) {
|
|
20
|
+
let n = t.attributeNames ?? {}, r = (e) => n[e] ?? e, i = e.size ?? e.width ?? _.width, a = e.size ?? e.height ?? _.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 ? v(...c) : v("lucide", ...s, ...c), u = t.absoluteStrokeWidth ? Number(t.strokeWidth ?? _["stroke-width"]) * Number(e.size ?? e.width ?? _.width) / Number(t.size ?? t.width ?? _.width) : t.strokeWidth ?? _["stroke-width"];
|
|
21
21
|
return [
|
|
22
22
|
"svg",
|
|
23
23
|
{
|
|
24
|
-
...Object.entries(
|
|
24
|
+
...Object.entries(_).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 && y(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 && y(t.width) && { [r("width")]: t.width },
|
|
31
|
+
..."height" in t && y(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,49 +50,49 @@ function y(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 x = (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 l(
|
|
56
|
+
}, S = (e) => e === "", C = (e) => e?.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), w = /* @__PURE__ */ Symbol("lucide-icons");
|
|
57
|
+
function T() {
|
|
58
|
+
return l(w, {});
|
|
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 E = ({ name: e, iconNode: t, "icon-node": n, icon: r = {
|
|
63
|
+
name: e && C(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: l, "stroke-width": u, size: d, width: f = d, height: p = d, color: m, ...h }, { slots: g }) => {
|
|
68
|
-
let { size: _, color: v, strokeWidth:
|
|
68
|
+
let { size: _, color: v, strokeWidth: y = 2, absoluteStrokeWidth: w = !1, nonScalingStroke: E = !1, class: D = "" } = T(), O = S(i) || S(a) || i === !0 || a === !0 || w === !0, k = S(o) || S(s) || o === !0 || s === !0 || E === !0;
|
|
69
69
|
delete h.class;
|
|
70
|
-
let A = g.default?.(), [, j, M = []] =
|
|
70
|
+
let A = g.default?.(), [, j, M = []] = b(r, {
|
|
71
71
|
color: m ?? v,
|
|
72
72
|
width: f ?? d ?? _,
|
|
73
73
|
height: p ?? d ?? _,
|
|
74
|
-
strokeWidth: l ?? u ??
|
|
74
|
+
strokeWidth: l ?? u ?? y,
|
|
75
75
|
absoluteStrokeWidth: O,
|
|
76
76
|
nonScalingStroke: k,
|
|
77
77
|
className: D,
|
|
78
|
-
hasA11yProp: A != null && A.length > 0 ||
|
|
78
|
+
hasA11yProp: A != null && A.length > 0 || x(h),
|
|
79
79
|
attributes: h
|
|
80
80
|
});
|
|
81
81
|
return c("svg", j, [...M.map(([e, t]) => c(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 D(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 }) => c(
|
|
90
|
+
return (e, { slots: t }) => c(E, {
|
|
91
91
|
...e,
|
|
92
92
|
icon: n
|
|
93
93
|
}, t.default ? { default: t.default } : void 0);
|
|
94
94
|
}
|
|
95
|
-
var
|
|
95
|
+
var O = D({
|
|
96
96
|
name: "plus",
|
|
97
97
|
size: 24,
|
|
98
98
|
node: [["path", {
|
|
@@ -105,160 +105,112 @@ var D = E({
|
|
|
105
105
|
});
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region web/src/kvman.ts
|
|
108
|
-
function
|
|
108
|
+
function k() {
|
|
109
109
|
let e = l("kvman");
|
|
110
110
|
if (e === void 0) throw Error("kvcoder components run inside kvwebui, which provides kvman.");
|
|
111
111
|
return e;
|
|
112
112
|
}
|
|
113
|
-
var
|
|
114
|
-
function
|
|
113
|
+
var A = () => document.documentElement.lang === "" ? void 0 : document.documentElement.lang;
|
|
114
|
+
function j(e) {
|
|
115
115
|
return typeof e == "object" && e && !Array.isArray(e) ? Object.fromEntries(Object.entries(e)) : {};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function M(e, t) {
|
|
118
118
|
return t === "" ? e("kvcoder.ui.newChat") : t;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function N(e) {
|
|
121
121
|
let t = e.indexOf("/");
|
|
122
122
|
return t < 0 ? `kernel.errors.${e}` : `${e.slice(0, t)}.errors.${e.slice(t + 1)}`;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function P(e) {
|
|
125
125
|
if (!(e instanceof Error) || !("problem" in e)) return;
|
|
126
126
|
let t = e.problem;
|
|
127
127
|
if (typeof t == "object" && t && "code" in t && typeof t.code == "string") return {
|
|
128
128
|
code: t.code,
|
|
129
|
-
params:
|
|
129
|
+
params: F("params" in t ? t.params : void 0)
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
return Object.fromEntries(Object.entries(
|
|
132
|
+
function F(e) {
|
|
133
|
+
return Object.fromEntries(Object.entries(j(e)).map(([e, t]) => [e, typeof t == "string" ? t : JSON.stringify(t)]));
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
let n =
|
|
137
|
-
e.toast(n === void 0 ? "kvcoder.ui.failed" :
|
|
135
|
+
function I(e, t) {
|
|
136
|
+
let n = P(t);
|
|
137
|
+
e.toast(n === void 0 ? "kvcoder.ui.failed" : N(n.code), n?.params ?? {}, "error");
|
|
138
138
|
}
|
|
139
139
|
//#endregion
|
|
140
140
|
//#region web/src/SessionList.vue?vue&type=script&setup=true&lang.ts
|
|
141
|
-
var
|
|
141
|
+
var L = ["aria-label"], R = { class: "kvc-group" }, z = [
|
|
142
|
+
"aria-current",
|
|
143
|
+
"data-test",
|
|
144
|
+
"onClick"
|
|
145
|
+
], B = ["aria-label"], V = {
|
|
146
|
+
key: 1,
|
|
147
|
+
class: "kvc-chip kvc-warn",
|
|
148
|
+
"data-test": "needs-you"
|
|
149
|
+
}, H = {
|
|
150
|
+
key: 2,
|
|
151
|
+
class: "kvc-muted"
|
|
152
|
+
}, U = /* @__PURE__ */ s({
|
|
142
153
|
__name: "SessionList",
|
|
143
|
-
props: { sessionId: {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
setup(e, { expose: n }) {
|
|
148
|
-
n();
|
|
149
|
-
let r = e, i = O(), a = p([]);
|
|
150
|
-
async function o() {
|
|
154
|
+
props: { sessionId: {} },
|
|
155
|
+
setup(n) {
|
|
156
|
+
let s = n, c = k(), l = p([]);
|
|
157
|
+
async function _() {
|
|
151
158
|
try {
|
|
152
|
-
|
|
159
|
+
l.value = await c.exec("kvcoder.session.list", { limit: 200 });
|
|
153
160
|
} catch (e) {
|
|
154
|
-
|
|
161
|
+
I(c, e);
|
|
155
162
|
}
|
|
156
163
|
}
|
|
157
|
-
let
|
|
158
|
-
let e =
|
|
164
|
+
let v = () => new Date((/* @__PURE__ */ new Date()).toDateString()).getTime(), y = t(() => {
|
|
165
|
+
let e = v();
|
|
159
166
|
return [{
|
|
160
167
|
key: "today",
|
|
161
|
-
items:
|
|
168
|
+
items: l.value.filter((t) => Date.parse(t.updatedAt) >= e)
|
|
162
169
|
}, {
|
|
163
170
|
key: "earlier",
|
|
164
|
-
items:
|
|
171
|
+
items: l.value.filter((t) => Date.parse(t.updatedAt) < e)
|
|
165
172
|
}].filter((e) => e.items.length > 0);
|
|
166
|
-
}),
|
|
173
|
+
}), b = (e) => {
|
|
167
174
|
let t = new Date(e.updatedAt);
|
|
168
|
-
return t.getTime() >=
|
|
175
|
+
return t.getTime() >= v() ? t.toLocaleTimeString(A(), {
|
|
169
176
|
hour: "2-digit",
|
|
170
177
|
minute: "2-digit"
|
|
171
|
-
}) : t.toLocaleDateString(
|
|
178
|
+
}) : t.toLocaleDateString(A(), {
|
|
172
179
|
month: "short",
|
|
173
180
|
day: "numeric"
|
|
174
181
|
});
|
|
175
|
-
},
|
|
176
|
-
u(() => clearInterval(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
182
|
+
}, x = setInterval(() => void _(), 5e3);
|
|
183
|
+
return u(() => clearInterval(x)), g([() => s.sessionId, () => c.workspace.value.id], () => void _(), { immediate: !0 }), (t, n) => (d(), r("nav", {
|
|
184
|
+
class: "kvc-sessions",
|
|
185
|
+
"aria-label": h(c).t("kvcoder.ui.chats"),
|
|
186
|
+
"data-test": "sessions"
|
|
187
|
+
}, [i("button", {
|
|
188
|
+
type: "button",
|
|
189
|
+
class: "kvc-button kvc-primary",
|
|
190
|
+
style: { "margin-block-end": "6px" },
|
|
191
|
+
"data-test": "new-chat",
|
|
192
|
+
onClick: n[0] ||= (e) => h(c).navigate("kvcoder.chat")
|
|
193
|
+
}, [o(h(O), { size: 16 }), a(m(h(c).t("kvcoder.ui.newChat")), 1)]), (d(!0), r(e, null, f(y.value, (t) => (d(), r(e, { key: t.key }, [i("span", R, m(h(c).t(`kvcoder.ui.${t.key}`)), 1), (d(!0), r(e, null, f(t.items, (e) => (d(), r("button", {
|
|
194
|
+
key: e.id,
|
|
195
|
+
type: "button",
|
|
196
|
+
class: "kvc-session",
|
|
197
|
+
"aria-current": e.id === s.sessionId ? "page" : void 0,
|
|
198
|
+
"data-test": `session-${e.id}`,
|
|
199
|
+
onClick: (t) => h(c).navigate("kvcoder.session", { sessionId: e.id })
|
|
200
|
+
}, [i("span", null, m(h(M)(h(c).t, e.title)), 1), e.status === "running" ? (d(), r("span", {
|
|
201
|
+
key: 0,
|
|
202
|
+
class: "kvc-spin",
|
|
203
|
+
"aria-label": h(c).t("kvcoder.ui.status.running"),
|
|
204
|
+
"data-test": "running"
|
|
205
|
+
}, null, 8, B)) : e.status === "waiting" ? (d(), r("span", V, m(h(c).t("kvcoder.ui.needsYou")), 1)) : (d(), r("span", H, m(b(e)), 1))], 8, z))), 128))], 64))), 128))], 8, L));
|
|
197
206
|
}
|
|
198
|
-
}),
|
|
199
|
-
let n = e.__vccOpts || e;
|
|
200
|
-
for (let [e, r] of t) n[e] = r;
|
|
201
|
-
return n;
|
|
202
|
-
}, R = ["aria-label"], z = { class: "kvc-group" }, B = [
|
|
203
|
-
"aria-current",
|
|
204
|
-
"data-test",
|
|
205
|
-
"onClick"
|
|
206
|
-
], V = ["aria-label"], H = {
|
|
207
|
-
key: 1,
|
|
208
|
-
class: "kvc-chip kvc-warn",
|
|
209
|
-
"data-test": "needs-you"
|
|
210
|
-
}, U = {
|
|
211
|
-
key: 2,
|
|
212
|
-
class: "kvc-muted"
|
|
213
|
-
};
|
|
214
|
-
function W(t, n, s, c, l, u) {
|
|
215
|
-
return d(), r("nav", {
|
|
216
|
-
class: "kvc-sessions",
|
|
217
|
-
"aria-label": c.kvman.t("kvcoder.ui.chats"),
|
|
218
|
-
"data-test": "sessions"
|
|
219
|
-
}, [i("button", {
|
|
220
|
-
type: "button",
|
|
221
|
-
class: "kvc-button kvc-primary",
|
|
222
|
-
style: { "margin-block-end": "6px" },
|
|
223
|
-
"data-test": "new-chat",
|
|
224
|
-
onClick: n[0] ||= (e) => c.kvman.navigate("kvcoder.chat")
|
|
225
|
-
}, [o(c.Plus, { size: 16 }), a(m(c.kvman.t("kvcoder.ui.newChat")), 1)]), (d(!0), r(e, null, f(c.groups, (t) => (d(), r(e, { key: t.key }, [i("span", z, m(c.kvman.t(`kvcoder.ui.${t.key}`)), 1), (d(!0), r(e, null, f(t.items, (e) => (d(), r("button", {
|
|
226
|
-
key: e.id,
|
|
227
|
-
type: "button",
|
|
228
|
-
class: "kvc-session",
|
|
229
|
-
"aria-current": e.id === c.props.sessionId ? "page" : void 0,
|
|
230
|
-
"data-test": `session-${e.id}`,
|
|
231
|
-
onClick: (t) => c.kvman.navigate("kvcoder.session", { sessionId: e.id })
|
|
232
|
-
}, [i("span", null, m(c.titleText(c.kvman.t, e.title)), 1), e.status === "running" ? (d(), r("span", {
|
|
233
|
-
key: 0,
|
|
234
|
-
class: "kvc-spin",
|
|
235
|
-
"aria-label": c.kvman.t("kvcoder.ui.status.running"),
|
|
236
|
-
"data-test": "running"
|
|
237
|
-
}, null, 8, V)) : e.status === "waiting" ? (d(), r("span", H, m(c.kvman.t("kvcoder.ui.needsYou")), 1)) : (d(), r("span", U, m(c.when(e)), 1))], 8, B))), 128))], 64))), 128))], 8, R);
|
|
238
|
-
}
|
|
239
|
-
var G = /*#__PURE__*/ L(I, [["render", W], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/src/SessionList.vue"]]), K = /*@__PURE__*/ s({
|
|
207
|
+
}), W = /* @__PURE__ */ s({
|
|
240
208
|
__name: "sessions",
|
|
241
|
-
props: { sessionId: {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
setup(e, { expose: t }) {
|
|
246
|
-
t();
|
|
247
|
-
let n = {
|
|
248
|
-
props: e,
|
|
249
|
-
SessionList: G
|
|
250
|
-
};
|
|
251
|
-
return Object.defineProperty(n, "__isScriptSetup", {
|
|
252
|
-
enumerable: !1,
|
|
253
|
-
value: !0
|
|
254
|
-
}), n;
|
|
209
|
+
props: { sessionId: {} },
|
|
210
|
+
setup(e) {
|
|
211
|
+
let t = e;
|
|
212
|
+
return (e, r) => (d(), n(U, { "session-id": t.sessionId }, null, 8, ["session-id"]));
|
|
255
213
|
}
|
|
256
214
|
});
|
|
257
215
|
//#endregion
|
|
258
|
-
|
|
259
|
-
function q(e, t, r, i, a, o) {
|
|
260
|
-
return d(), n(i.SessionList, { "session-id": i.props.sessionId }, null, 8, ["session-id"]);
|
|
261
|
-
}
|
|
262
|
-
var J = /*#__PURE__*/ L(K, [["render", q], ["__file", "/home/runner/work/kvman/kvman/extensions/kvcoder/web/components/sessions.vue"]]);
|
|
263
|
-
//#endregion
|
|
264
|
-
export { J as default };
|
|
216
|
+
export { W as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kvman/kvcoder",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "kvcoder: the app-building harness, with one run tool over connectors, sections, and its conversation UI.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@kvman/sdk": "^0.1.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@kvman/kvai": "0.1.
|
|
39
|
+
"@kvman/kvai": "0.1.1",
|
|
40
40
|
"@lucide/vue": "1.49.0",
|
|
41
41
|
"@modelcontextprotocol/sdk": "1.32.1",
|
|
42
42
|
"cross-spawn": "7.0.6",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@kvman/kvwebui": "0.1.0",
|
|
47
47
|
"@kvman/sdk": "0.1.0",
|
|
48
|
-
"@kvman/testkit": "0.1.
|
|
48
|
+
"@kvman/testkit": "0.1.1",
|
|
49
49
|
"@types/cross-spawn": "6.0.6",
|
|
50
50
|
"@vitejs/plugin-vue": "6.0.9",
|
|
51
51
|
"@vue/test-utils": "2.5.1",
|