@scalar/agent-chat 0.4.3 → 0.4.4
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/components/ApprovalSection.vue.d.ts.map +1 -1
- package/dist/components/ApprovalSection.vue.js +1 -1
- package/dist/components/ErrorMessage.vue.d.ts.map +1 -1
- package/dist/components/ErrorMessage.vue.js +2 -2
- package/dist/components/ErrorMessage.vue2.js +9 -12
- package/dist/components/PaymentSection.vue.d.ts.map +1 -1
- package/dist/components/PaymentSection.vue.js +2 -2
- package/dist/components/PaymentSection.vue2.js +13 -13
- package/dist/components/UploadSection.vue.d.ts.map +1 -1
- package/dist/components/UploadSection.vue.js +2 -2
- package/dist/components/UploadSection.vue2.js +37 -31
- package/dist/hooks/use-upload-tmp-document.d.ts +1 -1
- package/dist/hooks/use-upload-tmp-document.js +21 -21
- package/dist/package.json +1 -1
- package/dist/style.css +1 -1
- package/dist/views/Chat/Chat.vue.js +1 -1
- package/dist/views/PromptForm.vue.d.ts.map +1 -1
- package/dist/views/PromptForm.vue.js +2 -2
- package/dist/views/PromptForm.vue2.js +173 -174
- package/dist/views/Settings/DocSettings.vue.js +2 -2
- package/dist/views/Settings/DocSettings.vue2.js +7 -7
- package/dist/views/Start.vue.d.ts.map +1 -1
- package/dist/views/Start.vue.js +2 -2
- package/package.json +8 -8
- package/dist/components/FreeMessagesInfoSection.vue.d.ts +0 -3
- package/dist/components/FreeMessagesInfoSection.vue.d.ts.map +0 -1
- package/dist/components/FreeMessagesInfoSection.vue.js +0 -7
- package/dist/components/FreeMessagesInfoSection.vue2.js +0 -49
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovalSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApprovalSection.vue"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"ApprovalSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApprovalSection.vue"],"names":[],"mappings":";;;;;;;AAqMA,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ApprovalSection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1cb4fa51"]]);
|
|
5
5
|
export {
|
|
6
6
|
c as default
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorMessage.vue.d.ts","sourceRoot":"","sources":["../../src/components/ErrorMessage.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorMessage.vue.d.ts","sourceRoot":"","sources":["../../src/components/ErrorMessage.vue"],"names":[],"mappings":"AAqCA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAEvD,KAAK,WAAW,GAAG;IAAE,KAAK,EAAE,SAAS,CAAA;CAAE,CAAC;;AAoDxC,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./ErrorMessage.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-0e26328c"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
import { defineComponent as o, createElementBlock as t, createCommentVNode as c, openBlock as n, createVNode as s, createTextVNode as a, unref as m, toDisplayString as
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent as o, createElementBlock as t, createCommentVNode as c, openBlock as n, createVNode as s, createTextVNode as a, unref as m, toDisplayString as i } from "vue";
|
|
2
|
+
import { ScalarIconXCircle as d } from "@scalar/icons";
|
|
3
3
|
import { AgentErrorCodes as l } from "../entities/error/constants.js";
|
|
4
|
-
const
|
|
4
|
+
const _ = {
|
|
5
5
|
key: 0,
|
|
6
|
-
class: "error
|
|
7
|
-
},
|
|
6
|
+
class: "error"
|
|
7
|
+
}, D = /* @__PURE__ */ o({
|
|
8
8
|
__name: "ErrorMessage",
|
|
9
9
|
props: {
|
|
10
10
|
error: {}
|
|
11
11
|
},
|
|
12
12
|
setup(e) {
|
|
13
13
|
const r = [l.LIMIT_REACHED];
|
|
14
|
-
return (
|
|
15
|
-
s(m(
|
|
16
|
-
|
|
17
|
-
weight: "bold"
|
|
18
|
-
}),
|
|
19
|
-
a(" " + d(e.error.message), 1)
|
|
14
|
+
return (p, E) => r.includes(e.error.code) ? c("", !0) : (n(), t("div", _, [
|
|
15
|
+
s(m(d)),
|
|
16
|
+
a(" " + i(e.error.message), 1)
|
|
20
17
|
]));
|
|
21
18
|
}
|
|
22
19
|
});
|
|
23
20
|
export {
|
|
24
|
-
|
|
21
|
+
D as default
|
|
25
22
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/PaymentSection.vue"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"PaymentSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/PaymentSection.vue"],"names":[],"mappings":";AAqUA,wBAKG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./PaymentSection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-bbcefd08"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as o, createElementBlock as
|
|
2
|
-
import { ScalarIconInfo as
|
|
3
|
-
import { useState as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as o, createElementBlock as c, openBlock as p, createElementVNode as t, createVNode as i, createTextVNode as r, unref as b, createStaticVNode as f } from "vue";
|
|
2
|
+
import { ScalarIconInfo as l } from "@scalar/icons";
|
|
3
|
+
import { useState as v } from "../state/state.js";
|
|
4
|
+
const m = { class: "paymentSection" }, u = { class: "approvalText flex items-center gap-1.5" }, x = /* @__PURE__ */ o({
|
|
5
5
|
__name: "PaymentSection",
|
|
6
|
-
setup(
|
|
7
|
-
const { dashboardUrl:
|
|
6
|
+
setup(y) {
|
|
7
|
+
const { dashboardUrl: a, mode: n, uploadedTmpDocumentUrl: d } = v();
|
|
8
8
|
function s() {
|
|
9
|
-
n === "full" && window.location.replace(
|
|
10
|
-
d.value ? `${
|
|
9
|
+
n === "full" && window.location.replace(a), n === "preview" && window.location.replace(
|
|
10
|
+
d.value ? `${a}/register?flow=oss-agent&docUrl=${d.value}` : a
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
|
-
return (
|
|
14
|
-
t("strong",
|
|
15
|
-
|
|
13
|
+
return (I, e) => (p(), c("div", m, [
|
|
14
|
+
t("strong", u, [
|
|
15
|
+
i(b(l), {
|
|
16
16
|
class: "text-blue size-4",
|
|
17
17
|
weight: "bold"
|
|
18
18
|
}),
|
|
19
|
-
|
|
19
|
+
e[0] || (e[0] = r(" You've used up all your free messages, upgrade for $24/mo. ", -1))
|
|
20
20
|
]),
|
|
21
21
|
t("div", { class: "paymentContainer" }, [
|
|
22
22
|
t("button", {
|
|
@@ -24,7 +24,7 @@ const u = { class: "paymentSection" }, y = { class: "approvalText flex items-cen
|
|
|
24
24
|
type: "button",
|
|
25
25
|
onClick: s
|
|
26
26
|
}, " Upgrade "),
|
|
27
|
-
|
|
27
|
+
e[1] || (e[1] = f('<div class="paymentInfo" data-v-bbcefd08><h3 data-v-bbcefd08>$24 <span data-v-bbcefd08>/ month</span></h3><div class="paymentInfoSection" data-v-bbcefd08><div class="paymentInfoItem" data-v-bbcefd08><span data-v-bbcefd08>Members in your workspace</span><span data-v-bbcefd08>1</span></div><div class="paymentInfoItem" data-v-bbcefd08><span data-v-bbcefd08>x $24 / month / member</span><span data-v-bbcefd08>$24.00</span></div></div><div class="paymentInfoSection" data-v-bbcefd08><div class="paymentInfoItem" data-v-bbcefd08><span data-v-bbcefd08>Messages</span><span data-v-bbcefd08>1000</span></div><div class="paymentInfoItem" data-v-bbcefd08><span data-v-bbcefd08>Additional Messages</span><span data-v-bbcefd08>+ $0.15 Message</span></div></div></div>', 1))
|
|
28
28
|
])
|
|
29
29
|
]));
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/UploadSection.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UploadSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/UploadSection.vue"],"names":[],"mappings":"AA0GA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAA;AAE7E,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,sBAAsB,CAAA;CACpC,CAAC;;AAiJF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./UploadSection.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-4df8af00"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
r as default
|
|
7
7
|
};
|
|
@@ -1,56 +1,62 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useLoadingState as
|
|
1
|
+
import { defineComponent as c, createElementBlock as a, openBlock as n, normalizeClass as u, createCommentVNode as r, createVNode as l, createTextVNode as s, unref as o, toDisplayString as p } from "vue";
|
|
2
|
+
import { useLoadingState as g, ScalarLoading as i } from "@scalar/components";
|
|
3
3
|
import { ScalarIconCheck as m, ScalarIconXCircle as S } from "@scalar/icons";
|
|
4
|
-
const
|
|
4
|
+
const f = {
|
|
5
5
|
key: 0,
|
|
6
|
-
class: "flex items-center gap-1.5"
|
|
7
|
-
},
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "uploadText"
|
|
10
|
-
}, f = {
|
|
11
|
-
key: 1,
|
|
12
|
-
class: "uploadText"
|
|
13
|
-
}, k = {
|
|
6
|
+
class: "uploadText flex items-center gap-1.5"
|
|
7
|
+
}, x = {
|
|
14
8
|
key: 1,
|
|
15
9
|
class: "uploadText flex items-center gap-1.5"
|
|
16
|
-
},
|
|
10
|
+
}, y = {
|
|
17
11
|
key: 2,
|
|
18
12
|
class: "uploadText flex items-center gap-1.5"
|
|
19
|
-
},
|
|
13
|
+
}, k = {
|
|
14
|
+
key: 3,
|
|
15
|
+
class: "uploadText flex items-center gap-1.5"
|
|
16
|
+
}, N = /* @__PURE__ */ c({
|
|
20
17
|
__name: "UploadSection",
|
|
21
18
|
props: {
|
|
22
19
|
uploadState: {}
|
|
23
20
|
},
|
|
24
21
|
setup(e) {
|
|
25
|
-
const
|
|
26
|
-
return (C,
|
|
27
|
-
class:
|
|
22
|
+
const d = g();
|
|
23
|
+
return (C, t) => (n(), a("div", {
|
|
24
|
+
class: u(["uploadSection", {
|
|
28
25
|
error: e.uploadState.type === "error",
|
|
29
26
|
done: e.uploadState.type === "done"
|
|
30
27
|
}])
|
|
31
28
|
}, [
|
|
32
|
-
e.uploadState.type === "uploading"
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
e.uploadState.type === "uploading" ? (n(), a("strong", f, [
|
|
30
|
+
l(o(i), {
|
|
31
|
+
loader: {
|
|
32
|
+
...o(d),
|
|
33
|
+
isLoading: !0
|
|
34
|
+
},
|
|
35
|
+
size: "lg"
|
|
36
|
+
}, null, 8, ["loader"]),
|
|
37
|
+
t[0] || (t[0] = s(" Uploading document... ", -1))
|
|
38
|
+
])) : r("", !0),
|
|
39
|
+
e.uploadState.type === "processing" ? (n(), a("strong", x, [
|
|
40
|
+
l(o(i), {
|
|
35
41
|
loader: {
|
|
36
|
-
...
|
|
42
|
+
...o(d),
|
|
37
43
|
isLoading: !0
|
|
38
44
|
},
|
|
39
45
|
size: "lg"
|
|
40
46
|
}, null, 8, ["loader"]),
|
|
41
|
-
|
|
42
|
-
])) :
|
|
43
|
-
e.uploadState.type === "done" ? (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
])) :
|
|
47
|
-
e.uploadState.type === "error" ? (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
])) :
|
|
47
|
+
t[1] || (t[1] = s(" Processing document... ", -1))
|
|
48
|
+
])) : r("", !0),
|
|
49
|
+
e.uploadState.type === "done" ? (n(), a("strong", y, [
|
|
50
|
+
l(o(m), { class: "icon" }),
|
|
51
|
+
t[2] || (t[2] = s(" Document processed ", -1))
|
|
52
|
+
])) : r("", !0),
|
|
53
|
+
e.uploadState.type === "error" ? (n(), a("strong", k, [
|
|
54
|
+
l(o(S), { class: "icon" }),
|
|
55
|
+
s(" " + p(e.uploadState.error), 1)
|
|
56
|
+
])) : r("", !0)
|
|
51
57
|
], 2));
|
|
52
58
|
}
|
|
53
59
|
});
|
|
54
60
|
export {
|
|
55
|
-
|
|
61
|
+
N as default
|
|
56
62
|
};
|
|
@@ -13,7 +13,7 @@ export declare function getTmpDocFromLocalStorage(): {
|
|
|
13
13
|
slug: string;
|
|
14
14
|
} | undefined;
|
|
15
15
|
export declare function useUploadTmpDocument(): {
|
|
16
|
-
uploadTempDocument: (document: string
|
|
16
|
+
uploadTempDocument: (document: string) => Promise<{
|
|
17
17
|
url: string;
|
|
18
18
|
namespace: string;
|
|
19
19
|
slug: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as m } from "vue";
|
|
2
2
|
import { z as o } from "zod/mini";
|
|
3
|
-
import { useState as
|
|
3
|
+
import { useState as d } from "../state/state.js";
|
|
4
4
|
const u = "scalar-tmp-doc";
|
|
5
|
-
function
|
|
5
|
+
function g({ namespace: t, slug: e }) {
|
|
6
6
|
localStorage.setItem(u, JSON.stringify({ namespace: t, slug: e }));
|
|
7
7
|
}
|
|
8
|
-
function
|
|
8
|
+
function v() {
|
|
9
9
|
const t = localStorage.getItem(u);
|
|
10
10
|
if (t)
|
|
11
11
|
return o.object({
|
|
@@ -13,31 +13,31 @@ function h() {
|
|
|
13
13
|
slug: o.string()
|
|
14
14
|
}).parse(JSON.parse(t));
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const t =
|
|
18
|
-
function c(
|
|
19
|
-
const a = `${t.baseUrl}${
|
|
16
|
+
function h() {
|
|
17
|
+
const t = d(), e = m();
|
|
18
|
+
function c(s) {
|
|
19
|
+
const a = `${t.baseUrl}${s}`;
|
|
20
20
|
if (a.startsWith("/")) return a;
|
|
21
|
-
const
|
|
22
|
-
return new URL(`https://proxy.scalar.com/?${
|
|
21
|
+
const n = new URLSearchParams({ scalar_url: a.toString() });
|
|
22
|
+
return new URL(`https://proxy.scalar.com/?${n}`);
|
|
23
23
|
}
|
|
24
|
-
async function l(
|
|
24
|
+
async function l(s) {
|
|
25
25
|
try {
|
|
26
26
|
e.value = { type: "uploading" };
|
|
27
|
-
const
|
|
27
|
+
const a = await fetch(c("/core/share/upload/apis"), {
|
|
28
28
|
method: "POST",
|
|
29
29
|
headers: { "Content-Type": "application/json" },
|
|
30
|
-
body: JSON.stringify({ document:
|
|
30
|
+
body: JSON.stringify({ document: s })
|
|
31
31
|
});
|
|
32
|
-
if (!
|
|
32
|
+
if (!a.ok) {
|
|
33
33
|
e.value = {
|
|
34
34
|
type: "error",
|
|
35
35
|
error: "Failed to upload document."
|
|
36
36
|
};
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
|
-
const
|
|
40
|
-
if (!
|
|
39
|
+
const n = await a.json(), { success: p, data: r } = o.object({ url: o.string(), namespace: o.string(), slug: o.string() }).safeParse(n);
|
|
40
|
+
if (!p) {
|
|
41
41
|
e.value = {
|
|
42
42
|
type: "error",
|
|
43
43
|
error: "Failed to process document."
|
|
@@ -47,20 +47,20 @@ function T() {
|
|
|
47
47
|
e.value = {
|
|
48
48
|
type: "processing"
|
|
49
49
|
};
|
|
50
|
-
const
|
|
50
|
+
const i = await fetch(
|
|
51
51
|
c(`/vector/registry/embeddings/${r.namespace}/${r.slug}`),
|
|
52
52
|
{
|
|
53
53
|
method: "GET"
|
|
54
54
|
}
|
|
55
55
|
);
|
|
56
|
-
if (
|
|
56
|
+
if (g({
|
|
57
57
|
namespace: r.namespace,
|
|
58
58
|
slug: r.slug
|
|
59
59
|
}), await t.addDocument({
|
|
60
60
|
namespace: r.namespace,
|
|
61
61
|
slug: r.slug,
|
|
62
62
|
removable: !1
|
|
63
|
-
}), !
|
|
63
|
+
}), !i.ok) {
|
|
64
64
|
e.value = {
|
|
65
65
|
type: "error",
|
|
66
66
|
error: "Failed to embed document."
|
|
@@ -81,6 +81,6 @@ function T() {
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
v as getTmpDocFromLocalStorage,
|
|
85
|
+
h as useUploadTmpDocument
|
|
86
86
|
};
|