@scalar/agent-chat 0.2.5 → 0.2.7
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 +4 -4
- package/dist/api.js +1 -1
- package/dist/components/ContextItem.vue.d.ts.map +1 -1
- package/dist/components/ErrorMessage.vue.js +1 -1
- package/dist/components/ErrorMessage.vue2.js +1 -1
- package/dist/components/RequestPreview.vue.d.ts.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts.map +1 -1
- package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts.map +1 -1
- package/dist/components/Selector.vue.d.ts +24 -0
- package/dist/components/Selector.vue.d.ts.map +1 -0
- package/dist/components/Selector.vue.js +67 -0
- package/dist/components/Selector.vue2.js +4 -0
- package/dist/components/ServerSelector.vue.d.ts +22 -0
- package/dist/components/ServerSelector.vue.d.ts.map +1 -0
- package/dist/components/ServerSelector.vue.js +57 -0
- package/dist/components/ServerSelector.vue2.js +4 -0
- package/dist/components/UploadSection.vue.d.ts.map +1 -1
- package/dist/entities/error/constants.d.ts +8 -0
- package/dist/entities/error/constants.d.ts.map +1 -0
- package/dist/entities/error/constants.js +6 -0
- package/dist/entities/error/helpers.d.ts +3 -0
- package/dist/entities/error/helpers.d.ts.map +1 -0
- package/dist/entities/error/helpers.js +9 -0
- package/dist/entities/tools/execute-request.d.ts +1 -1
- package/dist/entities/tools/execute-request.d.ts.map +1 -1
- package/dist/helpers.d.ts +0 -8
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +64 -68
- package/dist/package.json +1 -2
- package/dist/registry/add-documents-to-store.d.ts.map +1 -1
- package/dist/registry/add-documents-to-store.js +24 -23
- package/dist/style.css +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/AskForAuthentication.vue.js +2 -2
- package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +49 -45
- package/dist/views/PromptForm.vue.js +2 -2
- package/dist/views/PromptForm.vue2.js +5 -5
- package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
- package/dist/views/Settings/DocSettings.vue.js +2 -2
- package/dist/views/Settings/DocSettings.vue2.js +27 -22
- package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
- package/package.json +7 -8
package/dist/api.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ export declare function api({ baseUrl, getAccessToken }: {
|
|
|
5
5
|
}): {
|
|
6
6
|
search: (query: string) => Promise<{
|
|
7
7
|
success: false;
|
|
8
|
-
error: import("./
|
|
8
|
+
error: import("./entities/error/constants.js").AgentChatError<"FAILED_TO_FETCH", unknown>;
|
|
9
9
|
} | import("neverpanic").Result<never, null> | {
|
|
10
10
|
success: false;
|
|
11
|
-
error: import("./
|
|
11
|
+
error: import("./entities/error/constants.js").AgentChatError<string, string>;
|
|
12
12
|
data?: undefined;
|
|
13
13
|
} | {
|
|
14
14
|
success: true;
|
|
@@ -29,10 +29,10 @@ export declare function api({ baseUrl, getAccessToken }: {
|
|
|
29
29
|
slug: string;
|
|
30
30
|
}) => Promise<{
|
|
31
31
|
success: false;
|
|
32
|
-
error: import("./
|
|
32
|
+
error: import("./entities/error/constants.js").AgentChatError<"FAILED_TO_FETCH", unknown>;
|
|
33
33
|
} | import("neverpanic").Result<never, null> | {
|
|
34
34
|
success: false;
|
|
35
|
-
error: import("./
|
|
35
|
+
error: import("./entities/error/constants.js").AgentChatError<string, string>;
|
|
36
36
|
data?: undefined;
|
|
37
37
|
} | {
|
|
38
38
|
success: true;
|
package/dist/api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as o } from "neverpanic";
|
|
2
2
|
import a from "zod";
|
|
3
|
+
import { createError as r } from "./entities/error/helpers.js";
|
|
3
4
|
import { registryApiMetadata as p } from "./entities/registry/document.js";
|
|
4
|
-
import { createError as r } from "./helpers.js";
|
|
5
5
|
function _({ baseUrl: d, getAccessToken: h }) {
|
|
6
6
|
const n = o.safeFn(
|
|
7
7
|
async ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextItem.vue.d.ts","sourceRoot":"","sources":["../../src/components/ContextItem.vue"],"names":[],"mappings":"AAoEA,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextItem.vue.d.ts","sourceRoot":"","sources":["../../src/components/ContextItem.vue"],"names":[],"mappings":"AAoEA,KAAK,WAAW,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AA4BxC,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AAmB/C,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -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 a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-0e26328c"]]);
|
|
5
5
|
export {
|
|
6
6
|
a as default
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
2
|
import { ScalarIconXCircle as d } from "@scalar/icons";
|
|
3
|
-
import { AgentErrorCodes as l } from "../
|
|
3
|
+
import { AgentErrorCodes as l } from "../entities/error/constants.js";
|
|
4
4
|
const _ = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "error"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestPreview.vue.d.ts","sourceRoot":"","sources":["../../src/components/RequestPreview.vue"],"names":[],"mappings":"AAuQA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,IAAI,CAAA;AAarC,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AAEzC,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAA;IACxE,QAAQ,CAAC,EAAE,wBAAwB,CAAA;IACnC,KAAK,EACD,kBAAkB,GAClB,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,UAAU,GACV,UAAU,CAAA;CACf,CAAC;;
|
|
1
|
+
{"version":3,"file":"RequestPreview.vue.d.ts","sourceRoot":"","sources":["../../src/components/RequestPreview.vue"],"names":[],"mappings":"AAuQA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,IAAI,CAAA;AAarC,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AAEzC,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC,CAAA;IACxE,QAAQ,CAAC,EAAE,wBAAwB,CAAA;IACnC,KAAK,EACD,kBAAkB,GAClB,gBAAgB,GAChB,kBAAkB,GAClB,eAAe,GACf,UAAU,GACV,UAAU,CAAA;CACf,CAAC;;AAiWF,wBAMG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseBodyPreview.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ResponseBody/ResponseBodyPreview.vue"],"names":[],"mappings":"AA8EA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,+CAA+C,CAAA;AAGjF,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,YAAY,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5B,CAAC;;
|
|
1
|
+
{"version":3,"file":"ResponseBodyPreview.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ResponseBody/ResponseBodyPreview.vue"],"names":[],"mappings":"AA8EA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,+CAA+C,CAAA;AAGjF,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,YAAY,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC5B,CAAC;;AA4IF,wBAMG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResponseBodyToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ResponseBody/ResponseBodyToggle.vue"],"names":[],"mappings":"AA8BA,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,SAAS,GAAG,KAAK,CAAA;CAC/B,CAAC;;;;;;
|
|
1
|
+
{"version":3,"file":"ResponseBodyToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ResponseBody/ResponseBodyToggle.vue"],"names":[],"mappings":"AA8BA,KAAK,WAAW,GAAG;IACjB,UAAU,CAAC,EAAE,SAAS,GAAG,KAAK,CAAA;CAC/B,CAAC;;;;;;AAsEF,wBAOG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** The selected server URL */
|
|
4
|
+
selectedServer: ServerObject | null;
|
|
5
|
+
/** Available servers */
|
|
6
|
+
servers: ServerObject[];
|
|
7
|
+
/** The id of the target to use for the popover (e.g. address bar) */
|
|
8
|
+
target: string;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {
|
|
11
|
+
servers: ServerObject[];
|
|
12
|
+
serverUrlWithoutTrailingSlash: import("vue").ComputedRef<string>;
|
|
13
|
+
serverOptions: import("vue").ComputedRef<{
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}[]>;
|
|
17
|
+
selectedServer: ServerObject | null;
|
|
18
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
19
|
+
"update:modelValue": (value: string) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
export default _default;
|
|
24
|
+
//# sourceMappingURL=Selector.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Selector.vue.d.ts","sourceRoot":"","sources":["../../src/components/Selector.vue"],"names":[],"mappings":"AA6EA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAGhG,KAAK,WAAW,GAAG;IACjB,8BAA8B;IAC9B,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,wBAAwB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAA;CACf,CAAC;;;;;;;;;;;;;;AA6LF,wBAQG"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { defineComponent as g, computed as s, createBlock as S, createElementBlock as w, openBlock as u, unref as n, withCtx as i, createVNode as d, createElementVNode as a, toDisplayString as c } from "vue";
|
|
2
|
+
import { ScalarListbox as b, ScalarButton as h } from "@scalar/components";
|
|
3
|
+
import { ScalarIconCaretDown as y } from "@scalar/icons";
|
|
4
|
+
const V = { class: "overflow-x-auto" }, k = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "text-c-1 flex h-auto w-full items-center gap-0.75 rounded-b-lg px-3 py-1.5 text-base leading-[20px] whitespace-nowrap"
|
|
7
|
+
}, B = { class: "overflow-x-auto" }, E = /* @__PURE__ */ g({
|
|
8
|
+
__name: "Selector",
|
|
9
|
+
props: {
|
|
10
|
+
selectedServer: {},
|
|
11
|
+
servers: {},
|
|
12
|
+
target: {}
|
|
13
|
+
},
|
|
14
|
+
emits: ["update:modelValue"],
|
|
15
|
+
setup(e, { expose: p, emit: m }) {
|
|
16
|
+
const v = m, o = s(
|
|
17
|
+
() => e.servers.map((r) => ({
|
|
18
|
+
id: r.url,
|
|
19
|
+
label: r.url
|
|
20
|
+
}))
|
|
21
|
+
), l = s(
|
|
22
|
+
() => e.selectedServer?.url?.replace(/\/$/, "") || ""
|
|
23
|
+
), f = s(
|
|
24
|
+
() => o.value.find((r) => r.id === e.selectedServer?.url)
|
|
25
|
+
);
|
|
26
|
+
return p({
|
|
27
|
+
servers: e.servers,
|
|
28
|
+
serverUrlWithoutTrailingSlash: l,
|
|
29
|
+
serverOptions: o,
|
|
30
|
+
selectedServer: e.selectedServer
|
|
31
|
+
}), (r, t) => o.value.length > 1 ? (u(), S(n(b), {
|
|
32
|
+
key: 0,
|
|
33
|
+
ref: "elem",
|
|
34
|
+
class: "group",
|
|
35
|
+
modelValue: f.value,
|
|
36
|
+
options: o.value,
|
|
37
|
+
placement: "bottom-start",
|
|
38
|
+
resize: "",
|
|
39
|
+
target: e.target,
|
|
40
|
+
"onUpdate:modelValue": t[0] || (t[0] = (x) => v("update:modelValue", x.id))
|
|
41
|
+
}, {
|
|
42
|
+
default: i(() => [
|
|
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-lg px-3 py-1.5 text-base font-normal whitespace-nowrap -outline-offset-1",
|
|
45
|
+
variant: "ghost"
|
|
46
|
+
}, {
|
|
47
|
+
default: i(() => [
|
|
48
|
+
t[1] || (t[1] = a("span", { class: "sr-only" }, "Server:", -1)),
|
|
49
|
+
a("span", V, c(l.value || "Select a server"), 1),
|
|
50
|
+
d(n(y), {
|
|
51
|
+
class: "text-c-2 ui-open:rotate-180 mt-0.25 size-3 transition-transform duration-100",
|
|
52
|
+
weight: "bold"
|
|
53
|
+
})
|
|
54
|
+
]),
|
|
55
|
+
_: 1
|
|
56
|
+
})
|
|
57
|
+
]),
|
|
58
|
+
_: 1
|
|
59
|
+
}, 8, ["modelValue", "options", "target"])) : (u(), w("div", k, [
|
|
60
|
+
t[2] || (t[2] = a("span", { class: "sr-only" }, "Server:", -1)),
|
|
61
|
+
a("span", B, c(l.value), 1)
|
|
62
|
+
]));
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
export {
|
|
66
|
+
E as default
|
|
67
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
2
|
+
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
3
|
+
type SelectorProps = {
|
|
4
|
+
/** The event bus to use for emitting events */
|
|
5
|
+
eventBus: WorkspaceEventBus;
|
|
6
|
+
/** The selected server */
|
|
7
|
+
selectedServer: ServerObject | null;
|
|
8
|
+
/** Available servers */
|
|
9
|
+
servers: ServerObject[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* ServerSelector
|
|
13
|
+
*
|
|
14
|
+
* Core component for rendering a server selector block.
|
|
15
|
+
* Handles server selection and emits a 'server:update:selected' event when the selected server changes.
|
|
16
|
+
*
|
|
17
|
+
* @event server:update:selected - Emitted when the selected server changes
|
|
18
|
+
* @event server:update:variables - Emitted when a server variable changes
|
|
19
|
+
*/
|
|
20
|
+
declare const _default: import("vue").DefineComponent<SelectorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SelectorProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
export default _default;
|
|
22
|
+
//# sourceMappingURL=ServerSelector.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerSelector.vue.d.ts","sourceRoot":"","sources":["../../src/components/ServerSelector.vue"],"names":[],"mappings":"AA4FA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAMhG,KAAK,aAAa,GAAG;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,2BAA2B;IAC3B,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,wBAAwB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB,CAAA;AAED;;;;;;;;GAQG;;AACH,wBAsJC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineComponent as m, useId as b, createElementBlock as S, openBlock as d, Fragment as f, createElementVNode as n, createVNode as g, createBlock as c, createCommentVNode as o, normalizeClass as x, unref as l } from "vue";
|
|
2
|
+
import { ServerVariablesForm as k } from "@scalar/api-client/components/Server";
|
|
3
|
+
import { ScalarMarkdown as B } from "@scalar/components";
|
|
4
|
+
import V from "./Selector.vue.js";
|
|
5
|
+
const y = ["id"], C = {}, I = /* @__PURE__ */ m({
|
|
6
|
+
...C,
|
|
7
|
+
__name: "ServerSelector",
|
|
8
|
+
props: {
|
|
9
|
+
eventBus: {},
|
|
10
|
+
selectedServer: {},
|
|
11
|
+
servers: {}
|
|
12
|
+
},
|
|
13
|
+
setup(e) {
|
|
14
|
+
const s = b(), v = (r) => {
|
|
15
|
+
e.eventBus.emit("server:update:selected", {
|
|
16
|
+
url: e.selectedServer?.url === r ? "" : r
|
|
17
|
+
});
|
|
18
|
+
}, i = (r, t) => {
|
|
19
|
+
const a = e.servers.findIndex((u) => u.url === e.selectedServer?.url);
|
|
20
|
+
a !== -1 && e.eventBus.emit("server:update:variables", {
|
|
21
|
+
index: a,
|
|
22
|
+
key: r,
|
|
23
|
+
value: t
|
|
24
|
+
});
|
|
25
|
+
};
|
|
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-lg border border-b-0 px-3 py-2.5 font-medium" }, " Server ", -1)),
|
|
28
|
+
n("div", {
|
|
29
|
+
id: l(s),
|
|
30
|
+
class: x(["border", {
|
|
31
|
+
"rounded-b-lg": !e.selectedServer?.description && !e.selectedServer?.variables
|
|
32
|
+
}])
|
|
33
|
+
}, [
|
|
34
|
+
e.servers.length ? (d(), c(V, {
|
|
35
|
+
key: 0,
|
|
36
|
+
selectedServer: e.selectedServer,
|
|
37
|
+
servers: e.servers,
|
|
38
|
+
target: l(s),
|
|
39
|
+
"onUpdate:modelValue": v
|
|
40
|
+
}, null, 8, ["selectedServer", "servers", "target"])) : o("", !0)
|
|
41
|
+
], 10, y),
|
|
42
|
+
g(l(k), {
|
|
43
|
+
layout: "reference",
|
|
44
|
+
variables: e.selectedServer?.variables,
|
|
45
|
+
"onUpdate:variable": i
|
|
46
|
+
}, null, 8, ["variables"]),
|
|
47
|
+
e.selectedServer?.description ? (d(), c(l(B), {
|
|
48
|
+
key: 0,
|
|
49
|
+
class: "text-c-3 rounded-b-lg border border-t-0 px-3 py-1.5",
|
|
50
|
+
value: e.selectedServer.description
|
|
51
|
+
}, null, 8, ["value"])) : o("", !0)
|
|
52
|
+
], 64));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
export {
|
|
56
|
+
I as default
|
|
57
|
+
};
|
|
@@ -1 +1 @@
|
|
|
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;;
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/entities/error/constants.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO,IAAI;IACnE,IAAI,EAAE,CAAC,CAAA;IACP,MAAM,EAAE,CAAC,CAAA;CACV,CAAA;AAED,eAAO,MAAM,eAAe;;CAElB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/entities/error/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,wBAAgB,WAAW,CAAC,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAK/F"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type { AgentChatError } from '../../
|
|
3
|
+
import type { AgentChatError } from '../../entities/error/constants.js';
|
|
4
4
|
export declare const EXECUTE_REQUEST_TOOL_NAME: "execute-request";
|
|
5
5
|
export declare const executeRequestToolInputSchema: z.ZodObject<{
|
|
6
6
|
method: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-request.d.ts","sourceRoot":"","sources":["../../../src/entities/tools/execute-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"execute-request.d.ts","sourceRoot":"","sources":["../../../src/entities/tools/execute-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAEhE,eAAO,MAAM,yBAAyB,EAAG,iBAA0B,CAAA;AAEnE,eAAO,MAAM,6BAA6B;;;;;iBAKxC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAEnF,MAAM,MAAM,wBAAwB,GAAG,cAAc,GAAG;IACtD,iBAAiB,EACb;QACE,OAAO,EAAE,KAAK,CAAA;QACd,KAAK,EAAE,cAAc,CACnB,+BAA+B,EAC/B;YACE,aAAa,EAAE,OAAO,CAAA;SACvB,CACF,CAAA;KACF,GACD;QACE,OAAO,EAAE,KAAK,CAAA;QACd,KAAK,EAAE,cAAc,CACnB,gBAAgB,EAChB;YACE,MAAM,EAAE,MAAM,CAAA;YACd,GAAG,EAAE,MAAM,CAAA;YACX,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;YAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;SAChC,CACF,CAAA;QACD,IAAI,CAAC,EAAE,SAAS,CAAA;KACjB,GACD;QACE,OAAO,EAAE,IAAI,CAAA;QACb,IAAI,EAAE;YACJ,MAAM,EAAE,MAAM,CAAA;YACd,YAAY,EAAE,MAAM,CAAA;YACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;SAChC,CAAA;QACD,KAAK,CAAC,EAAE,SAAS,CAAA;KAClB,GACD;QACE,OAAO,EAAE,KAAK,CAAA;QACd,KAAK,EAAE,cAAc,CACnB,iBAAiB,EACjB;YACE,aAAa,EAAE,OAAO,CAAA;SACvB,CACF,CAAA;KACF,CAAA;CACN,CAAA"}
|
package/dist/helpers.d.ts
CHANGED
|
@@ -415,12 +415,4 @@ export declare const restoreAuthSecretsFromStorage: ({ documentName, workspaceSt
|
|
|
415
415
|
workspaceStore: WorkspaceStore;
|
|
416
416
|
}) => void;
|
|
417
417
|
export declare function safeParseJson(value: string): any;
|
|
418
|
-
export type AgentChatError<T extends string = string, D = unknown> = {
|
|
419
|
-
code: T;
|
|
420
|
-
detail: D;
|
|
421
|
-
};
|
|
422
|
-
export declare const AgentErrorCodes: {
|
|
423
|
-
readonly LIMIT_REACHED: "LIMIT_REACHED";
|
|
424
|
-
};
|
|
425
|
-
export declare function createError<const T extends string, D>(code: T, detail: D): AgentChatError<T, D>;
|
|
426
418
|
//# sourceMappingURL=helpers.d.ts.map
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAA;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAA;AAMpG,OAAO,KAAK,EAAE,WAAW,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AM,6BAA6B,GAAI,mCAG3C;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,cAAc,CAAA;CAC/B,KAAG,IAuCH,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,OAM1C"}
|
package/dist/helpers.js
CHANGED
|
@@ -1,115 +1,111 @@
|
|
|
1
|
-
import { getSelectedServer as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { getSelectedServer as O } from "@scalar/api-client/v2/features/operation";
|
|
2
|
+
import { getServers as E } from "@scalar/api-client/v2/helpers";
|
|
3
|
+
import { isObject as l } from "@scalar/helpers/object/is-object";
|
|
4
|
+
import { REFERENCE_LS_KEYS as d, safeLocalStorage as b } from "@scalar/helpers/object/local-storage";
|
|
5
|
+
import { getResolvedRef as u } from "@scalar/workspace-store/helpers/get-resolved-ref";
|
|
5
6
|
import { coerceValue as f } from "@scalar/workspace-store/schemas/typebox-coerce";
|
|
6
|
-
import { XScalarSelectedSecuritySchema as
|
|
7
|
-
function
|
|
8
|
-
return Object.values(
|
|
7
|
+
import { XScalarSelectedSecuritySchema as v, SecuritySchemesSchema as j } from "@scalar/workspace-store/schemas/v3.1/strict/openapi-document";
|
|
8
|
+
function R(t) {
|
|
9
|
+
return Object.values(t.paths ?? {}).flatMap((c) => Object.values(c ?? {}));
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
return
|
|
13
|
-
const o =
|
|
14
|
-
return o && r.push(
|
|
11
|
+
function x(t) {
|
|
12
|
+
const s = (t["x-scalar-selected-security"]?.selectedSchemes ?? []).flatMap((r) => Object.keys(r)), e = t.components?.securitySchemes;
|
|
13
|
+
return e ? s.reduce((r, n) => {
|
|
14
|
+
const o = e[n];
|
|
15
|
+
return o && r.push(u(o)), r;
|
|
15
16
|
}, []) : [];
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function w(t) {
|
|
18
19
|
return Object.fromEntries(
|
|
19
|
-
Object.entries(
|
|
20
|
-
s,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
Object.entries(t.workspace.documents).map(([c, s]) => {
|
|
21
|
+
const e = E(s.servers, {
|
|
22
|
+
documentUrl: s?.["x-scalar-original-source-url"]
|
|
23
|
+
});
|
|
24
|
+
return [
|
|
25
|
+
c,
|
|
26
|
+
{
|
|
27
|
+
activeServer: O(s, e),
|
|
28
|
+
securitySchemes: x(s)
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
})
|
|
26
32
|
);
|
|
27
33
|
}
|
|
28
|
-
const a =
|
|
29
|
-
const
|
|
34
|
+
const a = b(), y = () => {
|
|
35
|
+
const t = d.AUTH_SCHEMES, c = d.SELECTED_AUTH_SCHEMES, s = (e, r) => `${r}-${((o) => o === "schemas" ? t : c)(e)}`;
|
|
30
36
|
return {
|
|
31
37
|
/**
|
|
32
38
|
* Retrieves and coerces the authentication schemes stored in local storage.
|
|
33
39
|
*/
|
|
34
|
-
getSchemas: (
|
|
35
|
-
const r = JSON.parse(a.getItem(
|
|
36
|
-
return f(
|
|
40
|
+
getSchemas: (e) => {
|
|
41
|
+
const r = JSON.parse(a.getItem(s("schemas", e)) ?? "{}");
|
|
42
|
+
return f(j, r);
|
|
37
43
|
},
|
|
38
44
|
/**
|
|
39
45
|
* Stores the authentication schemes in local storage.
|
|
40
46
|
* @param value The SecuritySchemes object to stringify and store.
|
|
41
47
|
*/
|
|
42
|
-
setSchemas: (
|
|
43
|
-
a.setItem(
|
|
48
|
+
setSchemas: (e, r) => {
|
|
49
|
+
a.setItem(s("schemas", e), JSON.stringify(r));
|
|
44
50
|
},
|
|
45
51
|
/**
|
|
46
52
|
* Retrieves and coerces the selected authentication schemes stored in local storage.
|
|
47
53
|
*/
|
|
48
|
-
getSelectedSchemes: (
|
|
49
|
-
const r = JSON.parse(a.getItem(
|
|
50
|
-
return f(
|
|
54
|
+
getSelectedSchemes: (e) => {
|
|
55
|
+
const r = JSON.parse(a.getItem(s("selectedSchemes", e)) ?? "{}");
|
|
56
|
+
return f(v, r);
|
|
51
57
|
},
|
|
52
58
|
/**
|
|
53
59
|
* Stores the user's selected authentication schemes in local storage.
|
|
54
60
|
* @param value The XScalarSelectedSecurity object to stringify and store.
|
|
55
61
|
*/
|
|
56
|
-
setSelectedSchemes: (
|
|
57
|
-
a.setItem(
|
|
62
|
+
setSelectedSchemes: (e, r) => {
|
|
63
|
+
a.setItem(s("selectedSchemes", e), JSON.stringify(r));
|
|
58
64
|
}
|
|
59
65
|
};
|
|
60
|
-
}, p = (
|
|
61
|
-
if (!(!
|
|
62
|
-
for (const [
|
|
63
|
-
if (typeof
|
|
64
|
-
|
|
66
|
+
}, p = (t, c) => {
|
|
67
|
+
if (!(!l(t) || !l(c)))
|
|
68
|
+
for (const [s, e] of Object.entries(c)) {
|
|
69
|
+
if (typeof e != "object") {
|
|
70
|
+
t[s] = e;
|
|
65
71
|
continue;
|
|
66
72
|
}
|
|
67
|
-
p(
|
|
73
|
+
p(u(t[s]), e);
|
|
68
74
|
}
|
|
69
|
-
},
|
|
70
|
-
documentName:
|
|
71
|
-
workspaceStore:
|
|
75
|
+
}, I = (t, c) => Object.keys(t).every((s) => c.has(s)), k = (t, c) => t >= c ? c - 1 : t, D = ({
|
|
76
|
+
documentName: t,
|
|
77
|
+
workspaceStore: c
|
|
72
78
|
}) => {
|
|
73
|
-
const
|
|
74
|
-
if (!
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
const s = y().getSchemas(t), e = c.workspace.documents[t];
|
|
80
|
+
if (!e)
|
|
81
|
+
return;
|
|
82
|
+
const n = y().getSelectedSchemes(t), o = new Set(Object.keys(e.components?.securitySchemes ?? {})), m = n["x-scalar-selected-security"]?.selectedSchemes?.filter((S) => I(S, o));
|
|
83
|
+
if (!e["x-scalar-selected-security"] && m && m.length > 0) {
|
|
84
|
+
const S = n["x-scalar-selected-security"]?.selectedIndex, i = k(S ?? 0, m.length);
|
|
85
|
+
e["x-scalar-selected-security"] = {
|
|
79
86
|
selectedIndex: i,
|
|
80
87
|
selectedSchemes: m
|
|
81
88
|
};
|
|
82
89
|
}
|
|
83
|
-
const g =
|
|
84
|
-
for (const [S, i] of Object.entries(
|
|
85
|
-
const
|
|
86
|
-
|
|
90
|
+
const g = e.components?.securitySchemes ?? {};
|
|
91
|
+
for (const [S, i] of Object.entries(s)) {
|
|
92
|
+
const h = u(g[S]);
|
|
93
|
+
l(h) && p(h, i);
|
|
87
94
|
}
|
|
88
95
|
};
|
|
89
|
-
function
|
|
96
|
+
function F(t) {
|
|
90
97
|
try {
|
|
91
|
-
return JSON.parse(
|
|
98
|
+
return JSON.parse(t);
|
|
92
99
|
} catch {
|
|
93
100
|
return;
|
|
94
101
|
}
|
|
95
102
|
}
|
|
96
|
-
const L = {
|
|
97
|
-
LIMIT_REACHED: "LIMIT_REACHED"
|
|
98
|
-
};
|
|
99
|
-
function N(e, s) {
|
|
100
|
-
return {
|
|
101
|
-
code: e,
|
|
102
|
-
detail: s
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
103
|
export {
|
|
106
|
-
L as AgentErrorCodes,
|
|
107
104
|
y as authStorage,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
j as getSecurityFromDocument,
|
|
105
|
+
w as createDocumentSettings,
|
|
106
|
+
R as getOperations,
|
|
107
|
+
x as getSecurityFromDocument,
|
|
112
108
|
p as mergeSecrets,
|
|
113
109
|
D as restoreAuthSecretsFromStorage,
|
|
114
|
-
|
|
110
|
+
F as safeParseJson
|
|
115
111
|
};
|
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.2.
|
|
13
|
+
"version": "0.2.7",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=20"
|
|
16
16
|
},
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
"@ai-sdk/vue": "catalog:*",
|
|
53
53
|
"@modelcontextprotocol/sdk": "catalog:*",
|
|
54
54
|
"@scalar/api-client": "workspace:*",
|
|
55
|
-
"@scalar/api-reference": "workspace:*",
|
|
56
55
|
"@scalar/components": "workspace:*",
|
|
57
56
|
"@scalar/helpers": "workspace:*",
|
|
58
57
|
"@scalar/icons": "workspace:*",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-documents-to-store.d.ts","sourceRoot":"","sources":["../../src/registry/add-documents-to-store.ts"],"names":[],"mappings":"
|
|
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;AACpE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAG9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAI/D,wBAAsB,YAAY,CAAC,EACjC,SAAS,EACT,IAAI,EACJ,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,MAAM,EACN,cAAc,GACf,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,iBAAiB,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC,CAAA;IACrC,cAAc,EAAE,cAAc,CAAA;IAC9B,MAAM,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAA;IAC1C,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,MAAM,MAAM,CAAA;CAC7B;;;;;;;eAqCA"}
|