@scalar/agent-chat 0.4.7 → 0.5.2
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 +56 -1
- package/dist/App.vue.d.ts.map +1 -1
- package/dist/App.vue.js +25 -20
- package/dist/Chat.vue.d.ts +5 -1
- package/dist/Chat.vue.d.ts.map +1 -1
- package/dist/Chat.vue.js +26 -22
- package/dist/client-tools/execute-request.d.ts +72 -0
- package/dist/client-tools/execute-request.d.ts.map +1 -0
- package/dist/client-tools/execute-request.js +92 -0
- package/dist/components/ActionsDropdown.vue.d.ts +17 -0
- package/dist/components/ActionsDropdown.vue.d.ts.map +1 -0
- package/dist/components/ActionsDropdown.vue.js +7 -0
- package/dist/components/ActionsDropdown.vue2.js +50 -0
- package/dist/components/FreeMessagesInfoSection.vue.d.ts.map +1 -1
- package/dist/components/FreeMessagesInfoSection.vue.js +2 -2
- package/dist/components/FreeMessagesInfoSection.vue2.js +19 -19
- package/dist/components/RequestPreview.vue.d.ts +3 -3
- package/dist/components/RequestPreview.vue.d.ts.map +1 -1
- package/dist/components/RequestPreview.vue.js +2 -2
- package/dist/components/RequestPreview.vue2.js +31 -31
- package/dist/entities/index.d.ts +1 -1
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +16 -16
- package/dist/entities/registry/document.d.ts +1 -0
- package/dist/entities/registry/document.d.ts.map +1 -1
- package/dist/entities/tools/execute-request.d.ts +27 -34
- package/dist/entities/tools/execute-request.d.ts.map +1 -1
- package/dist/entities/tools/execute-request.js +5 -4
- package/dist/helpers.d.ts +36 -275
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js +44 -86
- package/dist/hooks/use-chat-approvals.d.ts +17 -10
- package/dist/hooks/use-chat-approvals.d.ts.map +1 -1
- package/dist/hooks/use-chat-approvals.js +28 -15
- package/dist/hooks/use-search.d.ts +2 -0
- package/dist/hooks/use-search.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/package.json +2 -1
- package/dist/plugins/persistance.d.ts +16 -0
- package/dist/plugins/persistance.d.ts.map +1 -0
- package/dist/plugins/persistance.js +23 -0
- package/dist/state/state.d.ts +16 -5
- package/dist/state/state.d.ts.map +1 -1
- package/dist/state/state.js +148 -101
- package/dist/style.css +1 -1
- package/dist/views/Catalog/Catalog.vue.d.ts +7 -0
- package/dist/views/Catalog/Catalog.vue.d.ts.map +1 -0
- package/dist/views/Catalog/Catalog.vue.js +8 -0
- package/dist/views/Catalog/Catalog.vue2.js +70 -0
- package/dist/views/Chat/Chat.vue.d.ts +2 -0
- package/dist/views/Chat/Chat.vue.d.ts.map +1 -1
- package/dist/views/Chat/Chat.vue.js +1 -1
- package/dist/views/Chat/Chat.vue2.js +36 -35
- 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 +50 -52
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +2 -2
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +1 -1
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +2 -2
- package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +8 -7
- package/dist/views/Layout.vue.d.ts +2 -0
- package/dist/views/Layout.vue.d.ts.map +1 -1
- package/dist/views/Layout.vue.js +2 -2
- package/dist/views/Layout.vue2.js +16 -14
- package/dist/views/PromptForm.vue.d.ts +2 -0
- package/dist/views/PromptForm.vue.d.ts.map +1 -1
- package/dist/views/PromptForm.vue.js +1 -1
- package/dist/views/PromptForm.vue2.js +112 -99
- package/dist/views/Settings/Auth.vue.d.ts +2 -2
- package/dist/views/Settings/Auth.vue.d.ts.map +1 -1
- package/dist/views/Settings/Auth.vue.js +32 -32
- package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
- package/dist/views/Settings/DocSettings.vue.js +1 -1
- package/dist/views/Settings/DocSettings.vue2.js +22 -21
- package/dist/views/Start.vue.d.ts +2 -0
- package/dist/views/Start.vue.d.ts.map +1 -1
- package/dist/views/Start.vue.js +2 -2
- package/dist/views/Start.vue2.js +22 -21
- package/package.json +9 -8
|
@@ -1,40 +1,44 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIconButton as
|
|
3
|
-
import { ScalarIconPlus as
|
|
4
|
-
import Y from "../components/
|
|
5
|
-
import ee from "../components/
|
|
6
|
-
import te from "../components/
|
|
7
|
-
import oe from "../components/
|
|
8
|
-
import se from "../components/
|
|
9
|
-
import le from "../components/
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
1
|
+
import { defineComponent as N, useTemplateRef as q, computed as m, watch as k, createElementBlock as u, openBlock as s, createBlock as r, createCommentVNode as i, createElementVNode as n, withDirectives as _, unref as e, withModifiers as K, vModelText as J, withCtx as w, createVNode as g, Fragment as S, renderList as C, createTextVNode as T, toDisplayString as X, vShow as j } from "vue";
|
|
2
|
+
import { ScalarIconButton as P, ScalarLoading as O } from "@scalar/components";
|
|
3
|
+
import { ScalarIconPlus as I, ScalarIconX as Z, ScalarIconLockSimple as G, ScalarIconCheck as Q, ScalarIconArrowUp as W } from "@scalar/icons";
|
|
4
|
+
import Y from "../components/ActionsDropdown.vue.js";
|
|
5
|
+
import ee from "../components/ApprovalSection.vue.js";
|
|
6
|
+
import te from "../components/ErrorMessage.vue.js";
|
|
7
|
+
import oe from "../components/FreeMessagesInfoSection.vue.js";
|
|
8
|
+
import se from "../components/PaymentSection.vue.js";
|
|
9
|
+
import le from "../components/SearchPopover.vue.js";
|
|
10
|
+
import ne from "../components/UploadSection.vue.js";
|
|
11
|
+
import { AgentErrorCodes as x } from "../entities/error/constants.js";
|
|
12
|
+
import { MAX_PROMPT_SIZE as ae } from "../entities/prompt/constants.js";
|
|
13
|
+
import { useRequestApprovals as re } from "../hooks/use-chat-approvals.js";
|
|
14
|
+
import { useChatError as ie } from "../hooks/use-chat-error.js";
|
|
15
|
+
import { useChatPendingClientToolParts as ue } from "../hooks/use-chat-pending-client-tool-parts.js";
|
|
16
|
+
import { useUploadTmpDocument as ce } from "../hooks/use-upload-tmp-document.js";
|
|
17
|
+
import { useState as pe } from "../state/state.js";
|
|
18
|
+
const de = { class: "actionContainer" }, me = ["disabled"], ge = { class: "inputActionsContainer" }, ve = { class: "inputActionsLeft" }, fe = {
|
|
18
19
|
class: "addAPIButton",
|
|
19
20
|
type: "button"
|
|
20
|
-
},
|
|
21
|
+
}, he = {
|
|
22
|
+
class: "addAPIButton",
|
|
23
|
+
type: "button"
|
|
24
|
+
}, ye = ["src"], be = ["onClick"], Ae = { class: "inputActionsRight" }, ke = { class: "sendCheckboxContinue" }, _e = {
|
|
21
25
|
key: 0,
|
|
22
26
|
class: "relative flex items-center gap-1.5"
|
|
23
|
-
},
|
|
27
|
+
}, we = {
|
|
24
28
|
class: "termsAgree",
|
|
25
29
|
for: "agentTermsAgree"
|
|
26
|
-
},
|
|
30
|
+
}, Se = { class: "addMoreContext" }, Ce = { class: "ml-auto flex items-center gap-1" }, Te = ["onClick"], Pe = ["alt", "src"], Xe = /* @__PURE__ */ N({
|
|
27
31
|
__name: "PromptForm",
|
|
28
|
-
emits: ["submit"],
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
const c =
|
|
33
|
-
() => t.prompt.value.trim().length >
|
|
34
|
-
),
|
|
35
|
-
() => t.chat.messages.length > 1 && !t.getAgentKey?.() && d?.value?.code !==
|
|
32
|
+
emits: ["submit", "uploadApi"],
|
|
33
|
+
setup(Ie, { expose: D, emit: E }) {
|
|
34
|
+
const L = E;
|
|
35
|
+
D({ focusPrompt: B });
|
|
36
|
+
const c = q("agentPrompt"), t = pe(), M = m(() => t.prompt.value.trim().length > 0), R = m(
|
|
37
|
+
() => t.prompt.value.trim().length > ae
|
|
38
|
+
), U = m(
|
|
39
|
+
() => t.chat.messages.length > 1 && !t.getAgentKey?.() && d?.value?.code !== x.LIMIT_REACHED
|
|
36
40
|
);
|
|
37
|
-
|
|
41
|
+
k(t.prompt, () => {
|
|
38
42
|
if (c?.value) {
|
|
39
43
|
if (!t.prompt.value.length) {
|
|
40
44
|
c.value.style.height = "0px";
|
|
@@ -43,133 +47,142 @@ const pe = { class: "actionContainer" }, me = ["disabled"], de = { class: "input
|
|
|
43
47
|
c.value.style.height = "auto", c.value.style.height = c.value.scrollHeight + "px";
|
|
44
48
|
}
|
|
45
49
|
});
|
|
46
|
-
function
|
|
50
|
+
function z(a) {
|
|
47
51
|
t.loading.value || a.key === "Enter" && !a.shiftKey && (a.preventDefault(), b(), window.scrollTo(0, document.body.scrollHeight));
|
|
48
52
|
}
|
|
49
|
-
function
|
|
53
|
+
function B() {
|
|
50
54
|
c.value?.focus();
|
|
51
55
|
}
|
|
52
|
-
|
|
56
|
+
k(
|
|
53
57
|
() => t.chat.status,
|
|
54
58
|
(a) => {
|
|
55
59
|
(a === "ready" || a === "error") && c.value?.focus();
|
|
56
60
|
}
|
|
57
61
|
);
|
|
58
|
-
const {
|
|
59
|
-
function
|
|
60
|
-
t.terms.accept(), t.mode === "preview" && t.getActiveDocumentJson &&
|
|
62
|
+
const { approvalRequiredParts: f, respondToRequestApprovals: h } = re(), { pendingClientToolParts: $ } = ue(), p = ce();
|
|
63
|
+
function V() {
|
|
64
|
+
t.terms.accept(), t.mode === "preview" && t.getActiveDocumentJson && p.uploadTempDocument(t.getActiveDocumentJson(), !0);
|
|
61
65
|
}
|
|
62
|
-
const y =
|
|
63
|
-
const a =
|
|
64
|
-
return a ||
|
|
66
|
+
const y = m(() => {
|
|
67
|
+
const a = R.value, l = !M.value, o = f.value.length > 0, v = $.value.length > 0, A = t.mode === "preview", F = A && !t.terms.accepted.value, H = A && !!p.uploadState.value;
|
|
68
|
+
return a || l || o || v || F || H;
|
|
65
69
|
});
|
|
66
70
|
function b() {
|
|
67
|
-
y.value ||
|
|
71
|
+
y.value || L("submit");
|
|
68
72
|
}
|
|
69
|
-
const d =
|
|
70
|
-
return (a,
|
|
71
|
-
e(
|
|
73
|
+
const d = ie();
|
|
74
|
+
return (a, l) => (s(), u("div", de, [
|
|
75
|
+
e(p).uploadState.value || e(t).pendingDocuments.value.length ? (s(), r(ne, {
|
|
72
76
|
key: 0,
|
|
73
|
-
uploadState: e(
|
|
74
|
-
}, null, 8, ["uploadState"])) :
|
|
75
|
-
e(d) ? (
|
|
77
|
+
uploadState: e(p).uploadState.value ?? { type: "processing" }
|
|
78
|
+
}, null, 8, ["uploadState"])) : i("", !0),
|
|
79
|
+
e(d) ? (s(), r(te, {
|
|
76
80
|
key: 1,
|
|
77
81
|
error: e(d)
|
|
78
|
-
}, null, 8, ["error"])) :
|
|
79
|
-
e(
|
|
82
|
+
}, null, 8, ["error"])) : i("", !0),
|
|
83
|
+
e(f).length ? (s(), r(ee, {
|
|
80
84
|
key: 2,
|
|
81
|
-
onApprove:
|
|
82
|
-
onReject:
|
|
83
|
-
})) :
|
|
84
|
-
e(d)?.code === e(
|
|
85
|
-
|
|
86
|
-
onApprove: s[2] || (s[2] = (o) => e(p)(!0)),
|
|
87
|
-
onReject: s[3] || (s[3] = (o) => e(p)(!1))
|
|
88
|
-
})) : r("", !0),
|
|
89
|
-
L.value ? (l(), u(te, { key: 4 })) : r("", !0),
|
|
85
|
+
onApprove: l[0] || (l[0] = (o) => e(h)(!0)),
|
|
86
|
+
onReject: l[1] || (l[1] = (o) => e(h)(!1))
|
|
87
|
+
})) : i("", !0),
|
|
88
|
+
e(d)?.code === e(x).LIMIT_REACHED ? (s(), r(se, { key: 3 })) : i("", !0),
|
|
89
|
+
U.value ? (s(), r(oe, { key: 4 })) : i("", !0),
|
|
90
90
|
n("form", {
|
|
91
91
|
class: "promptForm",
|
|
92
|
-
onSubmit:
|
|
92
|
+
onSubmit: K(b, ["prevent"])
|
|
93
93
|
}, [
|
|
94
|
-
|
|
94
|
+
l[6] || (l[6] = n("label", {
|
|
95
95
|
class: "agentLabel",
|
|
96
96
|
for: "agentTextarea"
|
|
97
97
|
}, " Type a Request To get Started ", -1)),
|
|
98
|
-
|
|
98
|
+
_(n("textarea", {
|
|
99
99
|
id: "agentTextarea",
|
|
100
100
|
ref: "agentPrompt",
|
|
101
|
-
"onUpdate:modelValue":
|
|
101
|
+
"onUpdate:modelValue": l[2] || (l[2] = (o) => e(t).prompt.value = o),
|
|
102
102
|
class: "prompt custom-scroll",
|
|
103
103
|
disabled: e(t).loading.value,
|
|
104
104
|
name: "prompt",
|
|
105
105
|
placeholder: "Ask me anything...",
|
|
106
|
-
onKeydown:
|
|
106
|
+
onKeydown: z
|
|
107
107
|
}, null, 40, me), [
|
|
108
|
-
[
|
|
108
|
+
[J, e(t).prompt.value]
|
|
109
109
|
]),
|
|
110
|
-
n("div",
|
|
111
|
-
n("div",
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
110
|
+
n("div", ge, [
|
|
111
|
+
n("div", ve, [
|
|
112
|
+
e(t).isLoggedIn?.value ? (s(), r(Y, {
|
|
113
|
+
key: 1,
|
|
114
|
+
onUploadApi: l[3] || (l[3] = (o) => a.$emit("uploadApi"))
|
|
115
|
+
}, {
|
|
116
|
+
default: w(() => [
|
|
117
|
+
n("button", he, [
|
|
118
|
+
g(e(I), {
|
|
119
|
+
class: "size-4",
|
|
120
|
+
weight: "bold"
|
|
121
|
+
})
|
|
122
|
+
])
|
|
123
|
+
]),
|
|
124
|
+
_: 1
|
|
125
|
+
})) : (s(), r(le, { key: 0 }, {
|
|
126
|
+
default: w(() => [
|
|
127
|
+
n("button", fe, [
|
|
128
|
+
g(e(I), {
|
|
116
129
|
class: "size-4",
|
|
117
130
|
weight: "bold"
|
|
118
131
|
})
|
|
119
132
|
])
|
|
120
133
|
]),
|
|
121
134
|
_: 1
|
|
122
|
-
}),
|
|
123
|
-
(
|
|
135
|
+
})),
|
|
136
|
+
(s(!0), u(S, null, C(e(t).registryDocuments.value, (o) => (s(), u("div", {
|
|
124
137
|
key: o.id,
|
|
125
138
|
class: "apiPill"
|
|
126
139
|
}, [
|
|
127
|
-
o.logoUrl ? (
|
|
140
|
+
o.logoUrl ? (s(), u("img", {
|
|
128
141
|
key: 0,
|
|
129
142
|
class: "apiPillLogo",
|
|
130
143
|
src: o.logoUrl
|
|
131
|
-
}, null, 8,
|
|
132
|
-
T(" " +
|
|
133
|
-
o.removable ? (
|
|
144
|
+
}, null, 8, ye)) : i("", !0),
|
|
145
|
+
T(" " + X(o.title) + " ", 1),
|
|
146
|
+
o.removable ? (s(), u("button", {
|
|
134
147
|
key: 1,
|
|
135
148
|
class: "apiPillRemove",
|
|
136
149
|
type: "button",
|
|
137
|
-
onClick: (
|
|
150
|
+
onClick: (v) => e(t).removeDocument(o)
|
|
138
151
|
}, [
|
|
139
|
-
|
|
152
|
+
g(e(Z), {
|
|
140
153
|
class: "size-4",
|
|
141
154
|
weight: "bold"
|
|
142
155
|
})
|
|
143
|
-
], 8,
|
|
156
|
+
], 8, be)) : i("", !0)
|
|
144
157
|
]))), 128))
|
|
145
158
|
]),
|
|
146
|
-
n("div",
|
|
147
|
-
e(t).loading.value ?
|
|
159
|
+
n("div", Ae, [
|
|
160
|
+
e(t).loading.value ? i("", !0) : (s(), r(e(P), {
|
|
148
161
|
key: 0,
|
|
149
162
|
class: "settingsButton h-7 w-7 p-1.5",
|
|
150
163
|
icon: e(G),
|
|
151
164
|
label: "Scalar",
|
|
152
165
|
size: "md",
|
|
153
166
|
weight: "bold",
|
|
154
|
-
onClick:
|
|
167
|
+
onClick: l[4] || (l[4] = (o) => e(t).settingsModal.show())
|
|
155
168
|
}, null, 8, ["icon"])),
|
|
156
|
-
n("div",
|
|
157
|
-
!e(t).terms.accepted.value && e(t).mode === "preview" ? (
|
|
169
|
+
n("div", ke, [
|
|
170
|
+
!e(t).terms.accepted.value && e(t).mode === "preview" ? (s(), u("div", _e, [
|
|
158
171
|
n("input", {
|
|
159
172
|
id: "agentTermsAgree",
|
|
160
173
|
class: "sr-only",
|
|
161
174
|
type: "checkbox",
|
|
162
|
-
onChange:
|
|
175
|
+
onChange: V
|
|
163
176
|
}, null, 32),
|
|
164
|
-
n("label",
|
|
165
|
-
|
|
177
|
+
n("label", we, [
|
|
178
|
+
g(e(Q), {
|
|
166
179
|
class: "termsAgreeIcon",
|
|
167
180
|
weight: "bold"
|
|
168
181
|
}),
|
|
169
|
-
|
|
182
|
+
l[5] || (l[5] = T(" Agree to Terms & Conditions ", -1))
|
|
170
183
|
])
|
|
171
|
-
])) :
|
|
172
|
-
e(t).loading.value ? (
|
|
184
|
+
])) : i("", !0),
|
|
185
|
+
e(t).loading.value ? (s(), r(e(O), {
|
|
173
186
|
key: 2,
|
|
174
187
|
class: "loader h-7 w-7",
|
|
175
188
|
loader: {
|
|
@@ -187,7 +200,7 @@ const pe = { class: "actionContainer" }, me = ["disabled"], de = { class: "input
|
|
|
187
200
|
}
|
|
188
201
|
},
|
|
189
202
|
size: "2xl"
|
|
190
|
-
}, null, 8, ["loader"])) : (
|
|
203
|
+
}, null, 8, ["loader"])) : (s(), r(e(P), {
|
|
191
204
|
key: 1,
|
|
192
205
|
class: "sendButton h-7 w-7 p-1.5",
|
|
193
206
|
disabled: y.value,
|
|
@@ -201,29 +214,29 @@ const pe = { class: "actionContainer" }, me = ["disabled"], de = { class: "input
|
|
|
201
214
|
])
|
|
202
215
|
])
|
|
203
216
|
], 32),
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
n("div",
|
|
207
|
-
(
|
|
217
|
+
_(n("div", Se, [
|
|
218
|
+
l[7] || (l[7] = n("span", null, "Add context from dozens of API's", -1)),
|
|
219
|
+
n("div", Ce, [
|
|
220
|
+
(s(!0), u(S, null, C(e(t).curatedDocuments.value, (o) => (s(), u("button", {
|
|
208
221
|
key: o.id,
|
|
209
222
|
class: "addAPIContext",
|
|
210
223
|
type: "button",
|
|
211
|
-
onClick: (
|
|
224
|
+
onClick: (v) => e(t).addDocument(o)
|
|
212
225
|
}, [
|
|
213
|
-
o.logoUrl ? (
|
|
226
|
+
o.logoUrl ? (s(), u("img", {
|
|
214
227
|
key: 0,
|
|
215
228
|
alt: o.title,
|
|
216
229
|
class: "size-4",
|
|
217
230
|
src: o.logoUrl
|
|
218
|
-
}, null, 8,
|
|
219
|
-
], 8,
|
|
231
|
+
}, null, 8, Pe)) : i("", !0)
|
|
232
|
+
], 8, Te))), 128))
|
|
220
233
|
])
|
|
221
234
|
], 512), [
|
|
222
|
-
[
|
|
235
|
+
[j, e(t).chat.messages.length <= 1]
|
|
223
236
|
])
|
|
224
237
|
]));
|
|
225
238
|
}
|
|
226
239
|
});
|
|
227
240
|
export {
|
|
228
|
-
|
|
241
|
+
Xe as default
|
|
229
242
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type MergedSecuritySchemes } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block';
|
|
2
1
|
import type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference';
|
|
2
|
+
import type { AuthStore } from '@scalar/workspace-store/entities/auth';
|
|
3
3
|
import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
|
|
4
4
|
import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
|
|
5
5
|
import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
|
|
@@ -7,9 +7,9 @@ import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspac
|
|
|
7
7
|
type __VLS_Props = {
|
|
8
8
|
options: Pick<ApiReferenceConfigurationRaw, 'authentication' | 'persistAuth' | 'proxyUrl'>;
|
|
9
9
|
name: string;
|
|
10
|
+
authStore: AuthStore;
|
|
10
11
|
document: WorkspaceDocument | undefined;
|
|
11
12
|
eventBus: WorkspaceEventBus;
|
|
12
|
-
securitySchemes: MergedSecuritySchemes;
|
|
13
13
|
selectedServer: ServerObject | null;
|
|
14
14
|
environment: XScalarEnvironment;
|
|
15
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Auth.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/Auth.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Auth.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/Auth.vue"],"names":[],"mappings":"AA2GA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAMlF,KAAK,WAAW,GAAG;IACf,OAAO,EAAE,IAAI,CACX,4BAA4B,EAC5B,gBAAgB,GAAG,aAAa,GAAG,UAAU,CAC9C,CAAA;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,SAAS,CAAA;IACpB,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAA;IACvC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;AAyHJ,wBAMG"}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { defineComponent as a, computed as
|
|
2
|
-
import {
|
|
3
|
-
import { getSecurityRequirements as
|
|
4
|
-
import { useFocusWithin as
|
|
5
|
-
import {
|
|
6
|
-
import { useState as B } from "../../state/state.js";
|
|
1
|
+
import { defineComponent as a, computed as t, shallowRef as l, watch as S, createElementBlock as d, openBlock as o, createBlock as h, createCommentVNode as y, unref as v } from "vue";
|
|
2
|
+
import { mergeSecurity as f, AuthSelector as R } from "@scalar/api-client/v2/blocks/scalar-auth-selector-block";
|
|
3
|
+
import { getSecurityRequirements as g, getSelectedSecurity as k } from "@scalar/api-client/v2/features/operation";
|
|
4
|
+
import { useFocusWithin as x } from "@vueuse/core";
|
|
5
|
+
import { useState as A } from "../../state/state.js";
|
|
7
6
|
const N = /* @__PURE__ */ a({
|
|
8
7
|
__name: "Auth",
|
|
9
8
|
props: {
|
|
10
9
|
options: {},
|
|
11
10
|
name: {},
|
|
11
|
+
authStore: {},
|
|
12
12
|
document: {},
|
|
13
13
|
eventBus: {},
|
|
14
|
-
securitySchemes: {},
|
|
15
14
|
selectedServer: {},
|
|
16
15
|
environment: {}
|
|
17
16
|
},
|
|
18
17
|
setup(e) {
|
|
19
|
-
const { workspaceStore:
|
|
20
|
-
() =>
|
|
21
|
-
),
|
|
22
|
-
() =>
|
|
23
|
-
e.
|
|
18
|
+
const { workspaceStore: i } = A(), c = t(
|
|
19
|
+
() => g(e.document?.security)
|
|
20
|
+
), s = t(
|
|
21
|
+
() => k(
|
|
22
|
+
e.authStore.getAuthSelectedSchemas({
|
|
23
|
+
type: "document",
|
|
24
|
+
documentName: e.name
|
|
25
|
+
}),
|
|
24
26
|
void 0,
|
|
25
|
-
|
|
27
|
+
c.value
|
|
28
|
+
)
|
|
29
|
+
), u = l(), { focused: m } = x(u), n = t(
|
|
30
|
+
() => f(
|
|
31
|
+
e.document?.components?.securitySchemes ?? {},
|
|
32
|
+
e.options.authentication?.securitySchemes,
|
|
33
|
+
e.authStore,
|
|
34
|
+
e.name
|
|
26
35
|
)
|
|
27
36
|
);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const t = k();
|
|
32
|
-
t.setSchemas(e.name, e.securitySchemes), c.value && t.setSelectedSchemes(e.name, {
|
|
33
|
-
"x-scalar-selected-security": c.value
|
|
34
|
-
}), A({ documentName: e.name, workspaceStore: r });
|
|
35
|
-
},
|
|
36
|
-
{ deep: !0 }
|
|
37
|
-
);
|
|
38
|
-
const u = l(), { focused: o } = R(u);
|
|
39
|
-
return i(o, (t) => {
|
|
40
|
-
t && r.update("x-scalar-active-document", e.name);
|
|
41
|
-
}), (t, g) => (m(), y("div", {
|
|
37
|
+
return S(m, (r) => {
|
|
38
|
+
r && i.update("x-scalar-active-document", e.name);
|
|
39
|
+
}), (r, B) => (o(), d("div", {
|
|
42
40
|
ref_key: "focusRef",
|
|
43
41
|
ref: u,
|
|
44
42
|
tabindex: "0"
|
|
45
43
|
}, [
|
|
46
|
-
Object.keys(
|
|
44
|
+
Object.keys(n.value).length ? (o(), h(v(R), {
|
|
47
45
|
key: 0,
|
|
46
|
+
authStore: e.authStore,
|
|
47
|
+
documentSlug: e.name,
|
|
48
48
|
environment: e.environment,
|
|
49
49
|
eventBus: e.eventBus,
|
|
50
50
|
isReadOnly: "",
|
|
@@ -53,12 +53,12 @@ const N = /* @__PURE__ */ a({
|
|
|
53
53
|
meta: { type: "document" },
|
|
54
54
|
persistAuth: e.options.persistAuth,
|
|
55
55
|
proxyUrl: e.options.proxyUrl ?? "",
|
|
56
|
-
securityRequirements:
|
|
57
|
-
securitySchemes:
|
|
58
|
-
selectedSecurity:
|
|
56
|
+
securityRequirements: c.value,
|
|
57
|
+
securitySchemes: n.value,
|
|
58
|
+
selectedSecurity: s.value,
|
|
59
59
|
server: e.selectedServer,
|
|
60
60
|
title: "Authentication"
|
|
61
|
-
}, null, 8, ["environment", "eventBus", "persistAuth", "proxyUrl", "securityRequirements", "securitySchemes", "selectedSecurity", "server"])) :
|
|
61
|
+
}, null, 8, ["authStore", "documentSlug", "environment", "eventBus", "persistAuth", "proxyUrl", "securityRequirements", "securitySchemes", "selectedSecurity", "server"])) : y("", !0)
|
|
62
62
|
], 512));
|
|
63
63
|
}
|
|
64
64
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocSettings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/DocSettings.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DocSettings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/DocSettings.vue"],"names":[],"mappings":"AA0EA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAOlF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;CACb,CAAC;;AAuGF,wBAMG"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./DocSettings.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-2dfa823a"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as a, computed as n, createElementBlock as d, openBlock as S, createElementVNode as m, createVNode as u, unref as t } from "vue";
|
|
2
2
|
import { getSelectedServer as f } from "@scalar/api-client/v2/features/operation";
|
|
3
|
-
import { getActiveEnvironment as
|
|
4
|
-
import
|
|
3
|
+
import { getActiveEnvironment as h, getServers as g } from "@scalar/api-client/v2/helpers";
|
|
4
|
+
import B from "../../components/ServerSelector.vue.js";
|
|
5
5
|
import { useState as y } from "../../state/state.js";
|
|
6
6
|
import k from "./Auth.vue.js";
|
|
7
|
-
const p = { class: "docSettings" }, C = /* @__PURE__ */
|
|
7
|
+
const p = { class: "docSettings" }, C = /* @__PURE__ */ a({
|
|
8
8
|
__name: "DocSettings",
|
|
9
9
|
props: {
|
|
10
10
|
document: {},
|
|
11
11
|
name: {}
|
|
12
12
|
},
|
|
13
13
|
setup(e) {
|
|
14
|
-
const { workspaceStore:
|
|
15
|
-
() =>
|
|
16
|
-
),
|
|
17
|
-
const
|
|
14
|
+
const { workspaceStore: r, config: i, eventBus: c } = y(), v = n(
|
|
15
|
+
() => h(r, e.document)
|
|
16
|
+
), o = n(() => {
|
|
17
|
+
const s = g(e.document.servers, {
|
|
18
18
|
documentUrl: e.document["x-scalar-original-source-url"]
|
|
19
19
|
});
|
|
20
|
-
return f(e.document,
|
|
21
|
-
}), l =
|
|
20
|
+
return f(e.document, s);
|
|
21
|
+
}), l = n(
|
|
22
22
|
() => e.document.components?.securitySchemes ?? {}
|
|
23
23
|
);
|
|
24
|
-
return (
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
return (s, x) => (S(), d("div", p, [
|
|
25
|
+
m("div", null, [
|
|
26
|
+
u(k, {
|
|
27
|
+
authStore: t(r).auth,
|
|
27
28
|
document: e.document,
|
|
28
29
|
environment: v.value,
|
|
29
|
-
eventBus:
|
|
30
|
+
eventBus: t(c),
|
|
30
31
|
name: e.name,
|
|
31
|
-
options:
|
|
32
|
+
options: t(i),
|
|
32
33
|
securitySchemes: l.value,
|
|
33
|
-
selectedServer:
|
|
34
|
-
}, null, 8, ["document", "environment", "eventBus", "name", "options", "securitySchemes", "selectedServer"])
|
|
34
|
+
selectedServer: o.value
|
|
35
|
+
}, null, 8, ["authStore", "document", "environment", "eventBus", "name", "options", "securitySchemes", "selectedServer"])
|
|
35
36
|
]),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
eventBus:
|
|
39
|
-
selectedServer:
|
|
37
|
+
m("div", null, [
|
|
38
|
+
u(B, {
|
|
39
|
+
eventBus: t(c),
|
|
40
|
+
selectedServer: o.value,
|
|
40
41
|
servers: e.document.servers ?? []
|
|
41
42
|
}, null, 8, ["eventBus", "selectedServer", "servers"])
|
|
42
43
|
])
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
2
2
|
submit: () => any;
|
|
3
|
+
uploadApi: () => any;
|
|
3
4
|
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
4
5
|
onSubmit?: (() => any) | undefined;
|
|
6
|
+
onUploadApi?: (() => any) | undefined;
|
|
5
7
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
8
|
export default _default;
|
|
7
9
|
//# sourceMappingURL=Start.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Start.vue.d.ts","sourceRoot":"","sources":["../../src/views/Start.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Start.vue.d.ts","sourceRoot":"","sources":["../../src/views/Start.vue"],"names":[],"mappings":";;;;;;;AA+MA,wBAMG"}
|
package/dist/views/Start.vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./Start.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-1fbb0eb5"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
package/dist/views/Start.vue2.js
CHANGED
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as d, createElementBlock as r, openBlock as s, createVNode as n, createElementVNode as t, createTextVNode as o, unref as u, Fragment as i } from "vue";
|
|
2
|
+
import g from "../components/Logo.vue.js";
|
|
3
|
+
import { useState as y } from "../state/state.js";
|
|
4
|
+
import f from "./PromptForm.vue.js";
|
|
5
|
+
const c = { class: "startContainer" }, k = { class: "disclaimerText" }, F = /* @__PURE__ */ d({
|
|
6
6
|
__name: "Start",
|
|
7
|
-
emits: ["submit"],
|
|
8
|
-
setup(
|
|
9
|
-
const
|
|
10
|
-
return (S, e) => (s(), r("div",
|
|
11
|
-
|
|
12
|
-
e[
|
|
13
|
-
|
|
7
|
+
emits: ["submit", "uploadApi"],
|
|
8
|
+
setup(v, { emit: l }) {
|
|
9
|
+
const a = l, { mode: m } = y();
|
|
10
|
+
return (S, e) => (s(), r("div", c, [
|
|
11
|
+
n(g, { class: "agentLogo" }),
|
|
12
|
+
e[6] || (e[6] = t("h1", { class: "heading" }, "How can I help you today?", -1)),
|
|
13
|
+
n(f, {
|
|
14
14
|
ref: "promptFormField",
|
|
15
|
-
onSubmit: e[0] || (e[0] = (
|
|
15
|
+
onSubmit: e[0] || (e[0] = (p) => a("submit")),
|
|
16
|
+
onUploadApi: e[1] || (e[1] = (p) => a("uploadApi"))
|
|
16
17
|
}, null, 512),
|
|
17
|
-
t("p",
|
|
18
|
-
|
|
18
|
+
t("p", k, [
|
|
19
|
+
u(m) === "preview" ? (s(), r(i, { key: 0 }, [
|
|
19
20
|
o(" By messaging Agent Scalar your OpenAPI Document will be Temporarily uploaded to Scalar's Servers. You must agree to our ")
|
|
20
|
-
], 64)) : (s(), r(
|
|
21
|
+
], 64)) : (s(), r(i, { key: 1 }, [
|
|
21
22
|
o(" By messaging Agent Scalar you agree to our ")
|
|
22
23
|
], 64)),
|
|
23
|
-
e[
|
|
24
|
+
e[2] || (e[2] = t("a", {
|
|
24
25
|
class: "disclaimerLink",
|
|
25
26
|
href: "https://scalar.com/legal/terms-and-conditions",
|
|
26
27
|
target: "_blank"
|
|
27
28
|
}, "Terms ", -1)),
|
|
28
|
-
e[
|
|
29
|
-
e[
|
|
29
|
+
e[3] || (e[3] = o(" and ", -1)),
|
|
30
|
+
e[4] || (e[4] = t("a", {
|
|
30
31
|
class: "disclaimerLink",
|
|
31
32
|
href: "https://scalar.com/legal/privacy-policy",
|
|
32
33
|
target: "_blank"
|
|
33
34
|
}, " Privacy Policy", -1)),
|
|
34
|
-
e[
|
|
35
|
+
e[5] || (e[5] = o(". ", -1))
|
|
35
36
|
])
|
|
36
37
|
]));
|
|
37
38
|
}
|
|
38
39
|
});
|
|
39
40
|
export {
|
|
40
|
-
|
|
41
|
+
F as default
|
|
41
42
|
};
|