@scalar/agent-chat 0.5.9 → 0.5.14
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/App.vue.d.ts +1 -4
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/components/Selector.vue.js +1 -1
- package/dist/components/ServerSelector.vue.js +11 -11
- package/dist/components/UploadSection.vue.d.ts.map +1 -1
- package/dist/components/UploadSection.vue.js +2 -2
- package/dist/components/UploadSection.vue2.js +27 -22
- package/dist/helpers.d.ts +119 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/hooks/use-agent-key-documents.d.ts.map +1 -1
- package/dist/hooks/use-agent-key-documents.js +13 -8
- package/dist/hooks/use-upload-tmp-document.d.ts +2 -0
- package/dist/hooks/use-upload-tmp-document.d.ts.map +1 -1
- package/dist/package.json +2 -1
- package/dist/registry/add-documents-to-store.d.ts +22 -9
- package/dist/registry/add-documents-to-store.d.ts.map +1 -1
- package/dist/registry/add-documents-to-store.js +39 -31
- package/dist/state/state.d.ts +1 -4
- package/dist/state/state.d.ts.map +1 -1
- package/dist/state/state.js +149 -134
- package/dist/style.css +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 +98 -96
- package/package.json +9 -8
package/dist/App.vue.d.ts
CHANGED
|
@@ -27,10 +27,7 @@ declare const state: {
|
|
|
27
27
|
baseUrl: string;
|
|
28
28
|
isLoggedIn?: Ref<boolean>;
|
|
29
29
|
registryDocuments: Ref<import("./entities/index.js").ApiMetadata[]>;
|
|
30
|
-
pendingDocuments:
|
|
31
|
-
namespace: string;
|
|
32
|
-
slug: string;
|
|
33
|
-
}[]>;
|
|
30
|
+
pendingDocuments: Record<string, boolean>;
|
|
34
31
|
mode: ChatMode;
|
|
35
32
|
terms: {
|
|
36
33
|
accepted: Ref<boolean>;
|
package/dist/App.vue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../src/App.vue"],"names":[],"mappings":"AAmEA,OAAO,EAAW,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAGvC,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,gBAAgB,EAAE,CAAA;IACrC,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,cAAc,CAAC,EAAE,MAAM,MAAM,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,MAAM,CAAA;IAC1B,qBAAqB,CAAC,EAAE,MAAM,MAAM,CAAA;IACpC,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACzB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC/B,CAAC;AAoBF,QAAA,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../src/App.vue"],"names":[],"mappings":"AAmEA,OAAO,EAAW,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAGvC,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,gBAAgB,EAAE,CAAA;IACrC,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,cAAc,CAAC,EAAE,MAAM,MAAM,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,MAAM,CAAA;IAC1B,qBAAqB,CAAC,EAAE,MAAM,MAAM,CAAA;IACpC,UAAU,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACzB,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CAC/B,CAAC;AAoBF,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;iBA8BkB,CAAC;;;;;iBAGH,CAAA;;;;;;;;;;;;CAtBzB,CAAA;AAIF,MAAM,MAAM,WAAW,GAAG;IACxB,gBAAgB,EAAE,OAAO,KAAK,CAAC,gBAAgB,CAAA;CAChD,CAAA;AA8CD,QAAA,MAAM,YAAY;;;;kFAIhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -41,7 +41,7 @@ const V = { class: "overflow-x-auto" }, k = {
|
|
|
41
41
|
}, {
|
|
42
42
|
default: i(() => [
|
|
43
43
|
d(n(h), {
|
|
44
|
-
class: "bg-b-1 text-c-1 h-auto w-full justify-start gap-1.5 overflow-x-auto rounded-t-none rounded-b-
|
|
44
|
+
class: "bg-b-1 text-c-1 h-auto w-full justify-start gap-1.5 overflow-x-auto rounded-t-none rounded-b-xl px-3 py-1.5 text-base font-normal whitespace-nowrap -outline-offset-1",
|
|
45
45
|
variant: "ghost"
|
|
46
46
|
}, {
|
|
47
47
|
default: i(() => [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as m, useId as b, createElementBlock as S, openBlock as d, Fragment as f, createElementVNode as n, createVNode as
|
|
2
|
-
import { ServerVariablesForm as
|
|
3
|
-
import { ScalarMarkdown as
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as m, useId as b, createElementBlock as S, openBlock as d, Fragment as f, createElementVNode as n, createVNode as x, createBlock as c, createCommentVNode as o, normalizeClass as k, unref as l } from "vue";
|
|
2
|
+
import { ServerVariablesForm as B } from "@scalar/api-client/components/Server";
|
|
3
|
+
import { ScalarMarkdown as V } from "@scalar/components";
|
|
4
|
+
import g from "./Selector.vue.js";
|
|
5
5
|
const y = ["id"], C = {}, I = /* @__PURE__ */ m({
|
|
6
6
|
...C,
|
|
7
7
|
__name: "ServerSelector",
|
|
@@ -24,14 +24,14 @@ const y = ["id"], C = {}, I = /* @__PURE__ */ m({
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
return (r, t) => (d(), S(f, null, [
|
|
27
|
-
t[0] || (t[0] = n("label", { class: "bg-b-2 flex h-8 items-center rounded-t-
|
|
27
|
+
t[0] || (t[0] = n("label", { class: "bg-b-2 flex h-8 items-center rounded-t-xl border border-b-0 px-3 py-2.5 font-medium" }, " Server ", -1)),
|
|
28
28
|
n("div", {
|
|
29
29
|
id: l(s),
|
|
30
|
-
class:
|
|
31
|
-
"rounded-b-
|
|
30
|
+
class: k(["border", {
|
|
31
|
+
"rounded-b-xl": !e.selectedServer?.description && !e.selectedServer?.variables
|
|
32
32
|
}])
|
|
33
33
|
}, [
|
|
34
|
-
e.servers.length ? (d(), c(
|
|
34
|
+
e.servers.length ? (d(), c(g, {
|
|
35
35
|
key: 0,
|
|
36
36
|
selectedServer: e.selectedServer,
|
|
37
37
|
servers: e.servers,
|
|
@@ -39,14 +39,14 @@ const y = ["id"], C = {}, I = /* @__PURE__ */ m({
|
|
|
39
39
|
"onUpdate:modelValue": v
|
|
40
40
|
}, null, 8, ["selectedServer", "servers", "target"])) : o("", !0)
|
|
41
41
|
], 10, y),
|
|
42
|
-
|
|
42
|
+
x(l(B), {
|
|
43
43
|
layout: "reference",
|
|
44
44
|
variables: e.selectedServer?.variables,
|
|
45
45
|
"onUpdate:variable": i
|
|
46
46
|
}, null, 8, ["variables"]),
|
|
47
|
-
e.selectedServer?.description ? (d(), c(l(
|
|
47
|
+
e.selectedServer?.description ? (d(), c(l(V), {
|
|
48
48
|
key: 0,
|
|
49
|
-
class: "text-c-3 rounded-b-
|
|
49
|
+
class: "text-c-3 rounded-b-xl border border-t-0 px-3 py-1.5",
|
|
50
50
|
value: e.selectedServer.description
|
|
51
51
|
}, null, 8, ["value"])) : o("", !0)
|
|
52
52
|
], 64));
|
|
@@ -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":"AAwHA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAA;AAE7E,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,sBAAsB,CAAA;CACpC,CAAC;AA+IF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -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 f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f9d3a579"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
f as default
|
|
7
7
|
};
|
|
@@ -1,36 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useLoadingState as
|
|
3
|
-
import { ScalarIconCheck as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as i, computed as u, createElementBlock as t, openBlock as o, normalizeClass as p, createCommentVNode as n, createVNode as s, unref as a, createTextVNode as d, toDisplayString as g } from "vue";
|
|
2
|
+
import { useLoadingState as m, ScalarLoading as S } from "@scalar/components";
|
|
3
|
+
import { ScalarIconCheck as x, ScalarIconXCircle as y } from "@scalar/icons";
|
|
4
|
+
const f = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "flex items-center gap-1.5"
|
|
7
|
-
},
|
|
7
|
+
}, k = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "uploadText"
|
|
10
|
-
},
|
|
10
|
+
}, h = {
|
|
11
11
|
key: 1,
|
|
12
12
|
class: "uploadText"
|
|
13
|
-
},
|
|
13
|
+
}, T = {
|
|
14
|
+
key: 2,
|
|
15
|
+
class: "uploadText"
|
|
16
|
+
}, C = {
|
|
14
17
|
key: 1,
|
|
15
18
|
class: "uploadText flex items-center gap-1.5"
|
|
16
|
-
},
|
|
19
|
+
}, L = {
|
|
17
20
|
key: 2,
|
|
18
21
|
class: "uploadText flex items-center gap-1.5"
|
|
19
|
-
},
|
|
22
|
+
}, B = /* @__PURE__ */ i({
|
|
20
23
|
__name: "UploadSection",
|
|
21
24
|
props: {
|
|
22
25
|
uploadState: {}
|
|
23
26
|
},
|
|
24
27
|
setup(e) {
|
|
25
|
-
const c =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
const c = m(), r = u(
|
|
29
|
+
() => ["uploading", "processing", "loading"].includes(e.uploadState.type)
|
|
30
|
+
);
|
|
31
|
+
return (v, l) => (o(), t("div", {
|
|
32
|
+
class: p(["uploadSection", {
|
|
28
33
|
error: e.uploadState.type === "error",
|
|
29
34
|
done: e.uploadState.type === "done"
|
|
30
35
|
}])
|
|
31
36
|
}, [
|
|
32
|
-
|
|
33
|
-
s(a(
|
|
37
|
+
r.value ? (o(), t("div", f, [
|
|
38
|
+
s(a(S), {
|
|
34
39
|
class: "text-blue",
|
|
35
40
|
loader: {
|
|
36
41
|
...a(c),
|
|
@@ -38,19 +43,19 @@ const x = {
|
|
|
38
43
|
},
|
|
39
44
|
size: "lg"
|
|
40
45
|
}, null, 8, ["loader"]),
|
|
41
|
-
e.uploadState.type === "processing" ? (o(), t("strong",
|
|
46
|
+
e.uploadState.type === "loading" ? (o(), t("strong", k, " Loading document... ")) : e.uploadState.type === "processing" ? (o(), t("strong", h, " Processing document... ")) : (o(), t("strong", T, " Uploading document... "))
|
|
42
47
|
])) : n("", !0),
|
|
43
|
-
e.uploadState.type === "done" ? (o(), t("strong",
|
|
44
|
-
s(a(
|
|
45
|
-
l[0] || (l[0] =
|
|
48
|
+
e.uploadState.type === "done" ? (o(), t("strong", C, [
|
|
49
|
+
s(a(x), { class: "icon text-green" }),
|
|
50
|
+
l[0] || (l[0] = d(" Document processed ", -1))
|
|
46
51
|
])) : n("", !0),
|
|
47
|
-
e.uploadState.type === "error" ? (o(), t("strong",
|
|
48
|
-
s(a(
|
|
49
|
-
|
|
52
|
+
e.uploadState.type === "error" ? (o(), t("strong", L, [
|
|
53
|
+
s(a(y), { class: "icon text-red" }),
|
|
54
|
+
d(" " + g(e.uploadState.error), 1)
|
|
50
55
|
])) : n("", !0)
|
|
51
56
|
], 2));
|
|
52
57
|
}
|
|
53
58
|
});
|
|
54
59
|
export {
|
|
55
|
-
|
|
60
|
+
B as default
|
|
56
61
|
};
|
package/dist/helpers.d.ts
CHANGED
|
@@ -74,7 +74,125 @@ export declare const authStorage: () => {
|
|
|
74
74
|
} & {
|
|
75
75
|
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
76
76
|
}) | undefined;
|
|
77
|
-
})
|
|
77
|
+
}) | {
|
|
78
|
+
password?: ({
|
|
79
|
+
refreshUrl: string;
|
|
80
|
+
scopes: {
|
|
81
|
+
[x: string]: string;
|
|
82
|
+
};
|
|
83
|
+
} & {
|
|
84
|
+
'x-scalar-security-query'?: {
|
|
85
|
+
[x: string]: string;
|
|
86
|
+
} | undefined;
|
|
87
|
+
} & {
|
|
88
|
+
'x-scalar-security-body'?: {
|
|
89
|
+
[x: string]: string;
|
|
90
|
+
} | undefined;
|
|
91
|
+
} & {
|
|
92
|
+
'x-tokenName'?: string | undefined;
|
|
93
|
+
} & {
|
|
94
|
+
tokenUrl: string;
|
|
95
|
+
} & {
|
|
96
|
+
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
97
|
+
} & {
|
|
98
|
+
'x-scalar-secret-client-id': string;
|
|
99
|
+
} & {
|
|
100
|
+
'x-scalar-secret-token': string;
|
|
101
|
+
} & {
|
|
102
|
+
'x-scalar-secret-username': string;
|
|
103
|
+
'x-scalar-secret-password': string;
|
|
104
|
+
} & {
|
|
105
|
+
'x-scalar-secret-client-secret': string;
|
|
106
|
+
} & {
|
|
107
|
+
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
108
|
+
}) | undefined;
|
|
109
|
+
implicit?: ({
|
|
110
|
+
refreshUrl: string;
|
|
111
|
+
scopes: {
|
|
112
|
+
[x: string]: string;
|
|
113
|
+
};
|
|
114
|
+
} & {
|
|
115
|
+
'x-scalar-security-query'?: {
|
|
116
|
+
[x: string]: string;
|
|
117
|
+
} | undefined;
|
|
118
|
+
} & {
|
|
119
|
+
'x-scalar-security-body'?: {
|
|
120
|
+
[x: string]: string;
|
|
121
|
+
} | undefined;
|
|
122
|
+
} & {
|
|
123
|
+
'x-tokenName'?: string | undefined;
|
|
124
|
+
} & {
|
|
125
|
+
authorizationUrl: string;
|
|
126
|
+
} & {
|
|
127
|
+
'x-scalar-secret-client-id': string;
|
|
128
|
+
} & {
|
|
129
|
+
'x-scalar-secret-token': string;
|
|
130
|
+
} & {
|
|
131
|
+
'x-scalar-secret-redirect-uri': string;
|
|
132
|
+
}) | undefined;
|
|
133
|
+
clientCredentials?: ({
|
|
134
|
+
refreshUrl: string;
|
|
135
|
+
scopes: {
|
|
136
|
+
[x: string]: string;
|
|
137
|
+
};
|
|
138
|
+
} & {
|
|
139
|
+
'x-scalar-security-query'?: {
|
|
140
|
+
[x: string]: string;
|
|
141
|
+
} | undefined;
|
|
142
|
+
} & {
|
|
143
|
+
'x-scalar-security-body'?: {
|
|
144
|
+
[x: string]: string;
|
|
145
|
+
} | undefined;
|
|
146
|
+
} & {
|
|
147
|
+
'x-tokenName'?: string | undefined;
|
|
148
|
+
} & {
|
|
149
|
+
tokenUrl: string;
|
|
150
|
+
} & {
|
|
151
|
+
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
152
|
+
} & {
|
|
153
|
+
'x-scalar-secret-client-id': string;
|
|
154
|
+
} & {
|
|
155
|
+
'x-scalar-secret-token': string;
|
|
156
|
+
} & {
|
|
157
|
+
'x-scalar-secret-client-secret': string;
|
|
158
|
+
} & {
|
|
159
|
+
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
160
|
+
}) | undefined;
|
|
161
|
+
authorizationCode?: ({
|
|
162
|
+
refreshUrl: string;
|
|
163
|
+
scopes: {
|
|
164
|
+
[x: string]: string;
|
|
165
|
+
};
|
|
166
|
+
} & {
|
|
167
|
+
'x-scalar-security-query'?: {
|
|
168
|
+
[x: string]: string;
|
|
169
|
+
} | undefined;
|
|
170
|
+
} & {
|
|
171
|
+
'x-scalar-security-body'?: {
|
|
172
|
+
[x: string]: string;
|
|
173
|
+
} | undefined;
|
|
174
|
+
} & {
|
|
175
|
+
'x-tokenName'?: string | undefined;
|
|
176
|
+
} & {
|
|
177
|
+
authorizationUrl: string;
|
|
178
|
+
tokenUrl: string;
|
|
179
|
+
} & {
|
|
180
|
+
'x-usePkce': "SHA-256" | "plain" | "no";
|
|
181
|
+
} & {
|
|
182
|
+
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
183
|
+
} & {
|
|
184
|
+
'x-scalar-secret-client-id': string;
|
|
185
|
+
} & {
|
|
186
|
+
'x-scalar-secret-token': string;
|
|
187
|
+
} & {
|
|
188
|
+
'x-scalar-secret-client-secret': string;
|
|
189
|
+
} & {
|
|
190
|
+
'x-scalar-secret-redirect-uri': string;
|
|
191
|
+
} & {
|
|
192
|
+
'x-scalar-credentials-location'?: "header" | "body" | undefined;
|
|
193
|
+
}) | undefined;
|
|
194
|
+
type: "openIdConnect";
|
|
195
|
+
};
|
|
78
196
|
};
|
|
79
197
|
selected: {
|
|
80
198
|
document?: {
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;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AAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,GAAI,mCAG3C;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,cAAc,CAAA;CAC/B,KAAG,IAIH,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,OAM1C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,UAmB7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-agent-key-documents.d.ts","sourceRoot":"","sources":["../../src/hooks/use-agent-key-documents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-agent-key-documents.d.ts","sourceRoot":"","sources":["../../src/hooks/use-agent-key-documents.ts"],"names":[],"mappings":"AAKA,wBAAgB,oBAAoB,SAoBnC"}
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { useToasts as a } from "@scalar/use-toasts";
|
|
2
|
+
import { onMounted as m } from "vue";
|
|
3
|
+
import { useState as f } from "../state/state.js";
|
|
4
|
+
function l() {
|
|
5
|
+
const { api: t, addDocument: o, mode: s, getAgentKey: r } = f(), { toast: n } = a();
|
|
6
|
+
m(async () => {
|
|
7
|
+
if (s !== "full" || !r)
|
|
7
8
|
return;
|
|
8
9
|
const e = await t.getKeyDocuments();
|
|
9
|
-
e.success
|
|
10
|
+
if (!e.success) {
|
|
11
|
+
n("Unable to fetch registry documents for the provided key", "error");
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
e.data.documents.forEach(
|
|
10
15
|
({ namespace: u, slug: c }) => o({ namespace: u, slug: c, removable: !1 })
|
|
11
16
|
);
|
|
12
17
|
});
|
|
13
18
|
}
|
|
14
19
|
export {
|
|
15
|
-
|
|
20
|
+
l as useAgentKeyDocuments
|
|
16
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-upload-tmp-document.d.ts","sourceRoot":"","sources":["../../src/hooks/use-upload-tmp-document.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,sBAAsB,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAQpB,wBAAgB,yBAAyB;;;cAYxC;AAED,wBAAgB,oBAAoB;mCAeU,MAAM;;;;;;EA4EnD"}
|
|
1
|
+
{"version":3,"file":"use-upload-tmp-document.d.ts","sourceRoot":"","sources":["../../src/hooks/use-upload-tmp-document.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,sBAAsB,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAQpB,wBAAgB,yBAAyB;;;cAYxC;AAED,wBAAgB,oBAAoB;mCAeU,MAAM;;;;;;EA4EnD"}
|
package/dist/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"url": "git+https://github.com/scalar/scalar.git",
|
|
11
11
|
"directory": "packages/agent-chat"
|
|
12
12
|
},
|
|
13
|
-
"version": "0.5.
|
|
13
|
+
"version": "0.5.14",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=20"
|
|
16
16
|
},
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"@scalar/openapi-types": "workspace:*",
|
|
59
59
|
"@scalar/themes": "workspace:*",
|
|
60
60
|
"@scalar/types": "workspace:*",
|
|
61
|
+
"@scalar/use-toasts": "workspace:*",
|
|
61
62
|
"@scalar/workspace-store": "workspace:*",
|
|
62
63
|
"@vueuse/core": "catalog:*",
|
|
63
64
|
"ai": "catalog:*",
|
|
@@ -3,7 +3,7 @@ import type { WorkspaceStore } from '@scalar/workspace-store/client';
|
|
|
3
3
|
import type { Ref } from 'vue';
|
|
4
4
|
import type { Api } from '../api.js';
|
|
5
5
|
import type { ApiMetadata } from '../entities/registry/document.js';
|
|
6
|
-
export declare
|
|
6
|
+
export declare const loadDocument: (args_0: {
|
|
7
7
|
namespace: string;
|
|
8
8
|
slug: string;
|
|
9
9
|
workspaceStore: WorkspaceStore;
|
|
@@ -12,12 +12,25 @@ export declare function loadDocument({ namespace, slug, workspaceStore, registry
|
|
|
12
12
|
config: Partial<ApiReferenceConfiguration>;
|
|
13
13
|
api: Api;
|
|
14
14
|
removable?: boolean;
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
}) => Promise<{
|
|
16
|
+
success: false;
|
|
17
|
+
error: null;
|
|
18
|
+
} | {
|
|
19
|
+
success: false;
|
|
20
|
+
error: import("../entities/index.js").AgentChatError<"FAILED_TO_FETCH", unknown>;
|
|
21
|
+
} | {
|
|
22
|
+
success: false;
|
|
23
|
+
error: import("../entities/index.js").AgentChatError<string, string>;
|
|
24
|
+
data?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
success: true;
|
|
27
|
+
data: {
|
|
28
|
+
id: string;
|
|
29
|
+
title: string;
|
|
30
|
+
namespace: string;
|
|
31
|
+
currentVersion: string;
|
|
32
|
+
logoUrl: string | null;
|
|
33
|
+
slug: string;
|
|
34
|
+
};
|
|
35
|
+
}> | import("neverpanic").Result<never, import("../entities/index.js").AgentChatError<"UNABLE_TO_LOAD_DOCUMENT", unknown>>;
|
|
23
36
|
//# sourceMappingURL=add-documents-to-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-documents-to-store.d.ts","sourceRoot":"","sources":["../../src/registry/add-documents-to-store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"add-documents-to-store.d.ts","sourceRoot":"","sources":["../../src/registry/add-documents-to-store.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAI/D,eAAO,MAAM,YAAY;eAWV,MAAM;UACX,MAAM;oBACI,cAAc;uBACX,GAAG,CAAC,WAAW,EAAE,CAAC;iBACxB,MAAM;YACX,OAAO,CAAC,yBAAyB,CAAC;SACrC,GAAG;gBACI,OAAO;;;;;;;;;;;;;;;;;;;;;gHAwCtB,CAAA"}
|
|
@@ -1,36 +1,44 @@
|
|
|
1
1
|
import { bundle as f } from "@scalar/json-magic/bundle";
|
|
2
2
|
import { fetchUrls as l } from "@scalar/json-magic/bundle/plugins/browser";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
registryDocuments: r,
|
|
10
|
-
registryUrl: m,
|
|
11
|
-
config: u,
|
|
12
|
-
api: c,
|
|
13
|
-
removable: i
|
|
14
|
-
}) {
|
|
15
|
-
const a = await c.getDocument({
|
|
3
|
+
import { n as p } from "neverpanic";
|
|
4
|
+
import { restoreAuthSecretsFromStorage as D } from "../helpers.js";
|
|
5
|
+
import { createDocumentName as h } from "./create-document-name.js";
|
|
6
|
+
import { createError as N } from "../entities/error/helpers.js";
|
|
7
|
+
const _ = p.safeFn(
|
|
8
|
+
async ({
|
|
16
9
|
namespace: t,
|
|
17
|
-
slug:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
10
|
+
slug: r,
|
|
11
|
+
workspaceStore: o,
|
|
12
|
+
registryDocuments: m,
|
|
13
|
+
registryUrl: n,
|
|
14
|
+
config: c,
|
|
15
|
+
api: u,
|
|
16
|
+
removable: s
|
|
17
|
+
}) => {
|
|
18
|
+
const e = await u.getDocument({
|
|
19
|
+
namespace: t,
|
|
20
|
+
slug: r
|
|
21
|
+
});
|
|
22
|
+
if (!e.success)
|
|
23
|
+
return e;
|
|
24
|
+
m.value.push({ ...e.data, removable: s });
|
|
25
|
+
const i = new URL(`/@${t}/apis/${r}/latest`, n), d = await f(i.toString(), {
|
|
26
|
+
plugins: [l()],
|
|
27
|
+
treeShake: !1
|
|
28
|
+
}), a = h(t, r);
|
|
29
|
+
return await o.addDocument(
|
|
30
|
+
{
|
|
31
|
+
name: a,
|
|
32
|
+
document: d
|
|
33
|
+
},
|
|
34
|
+
c
|
|
35
|
+
), o.update("x-scalar-active-document", a), D({ documentName: a, workspaceStore: o }), {
|
|
36
|
+
success: !0,
|
|
37
|
+
data: e.data
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
(t) => N("UNABLE_TO_LOAD_DOCUMENT", t)
|
|
41
|
+
);
|
|
34
42
|
export {
|
|
35
|
-
|
|
43
|
+
_ as loadDocument
|
|
36
44
|
};
|
package/dist/state/state.d.ts
CHANGED
|
@@ -49,10 +49,7 @@ type State = {
|
|
|
49
49
|
baseUrl: string;
|
|
50
50
|
isLoggedIn?: Ref<boolean>;
|
|
51
51
|
registryDocuments: Ref<ApiMetadata[]>;
|
|
52
|
-
pendingDocuments:
|
|
53
|
-
namespace: string;
|
|
54
|
-
slug: string;
|
|
55
|
-
}[]>;
|
|
52
|
+
pendingDocuments: Record<string, boolean>;
|
|
56
53
|
mode: ChatMode;
|
|
57
54
|
terms: {
|
|
58
55
|
accepted: Ref<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/state/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,KAAK,4BAA4B,EAAmC,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/state/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,KAAK,UAAU,EAAY,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,KAAK,4BAA4B,EAAmC,MAAM,6BAA6B,CAAA;AAEhH,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,gCAAgC,CAAA;AAC1F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAEvE,OAAO,EAAwB,KAAK,WAAW,EAAE,KAAK,SAAS,EAA+C,MAAM,IAAI,CAAA;AAExH,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,GAAG,EAA0C,MAAM,KAAK,CAAA;AAE3G,OAAO,EAAE,KAAK,GAAG,EAAyC,MAAM,OAAO,CAAA;AAGvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC/D,OAAO,KAAK,EACV,gCAAgC,EAChC,yBAAyB,EAC1B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