@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.
Files changed (80) hide show
  1. package/dist/App.vue.d.ts +56 -1
  2. package/dist/App.vue.d.ts.map +1 -1
  3. package/dist/App.vue.js +25 -20
  4. package/dist/Chat.vue.d.ts +5 -1
  5. package/dist/Chat.vue.d.ts.map +1 -1
  6. package/dist/Chat.vue.js +26 -22
  7. package/dist/client-tools/execute-request.d.ts +72 -0
  8. package/dist/client-tools/execute-request.d.ts.map +1 -0
  9. package/dist/client-tools/execute-request.js +92 -0
  10. package/dist/components/ActionsDropdown.vue.d.ts +17 -0
  11. package/dist/components/ActionsDropdown.vue.d.ts.map +1 -0
  12. package/dist/components/ActionsDropdown.vue.js +7 -0
  13. package/dist/components/ActionsDropdown.vue2.js +50 -0
  14. package/dist/components/FreeMessagesInfoSection.vue.d.ts.map +1 -1
  15. package/dist/components/FreeMessagesInfoSection.vue.js +2 -2
  16. package/dist/components/FreeMessagesInfoSection.vue2.js +19 -19
  17. package/dist/components/RequestPreview.vue.d.ts +3 -3
  18. package/dist/components/RequestPreview.vue.d.ts.map +1 -1
  19. package/dist/components/RequestPreview.vue.js +2 -2
  20. package/dist/components/RequestPreview.vue2.js +31 -31
  21. package/dist/entities/index.d.ts +1 -1
  22. package/dist/entities/index.d.ts.map +1 -1
  23. package/dist/entities/index.js +16 -16
  24. package/dist/entities/registry/document.d.ts +1 -0
  25. package/dist/entities/registry/document.d.ts.map +1 -1
  26. package/dist/entities/tools/execute-request.d.ts +27 -34
  27. package/dist/entities/tools/execute-request.d.ts.map +1 -1
  28. package/dist/entities/tools/execute-request.js +5 -4
  29. package/dist/helpers.d.ts +36 -275
  30. package/dist/helpers.d.ts.map +1 -1
  31. package/dist/helpers.js +44 -86
  32. package/dist/hooks/use-chat-approvals.d.ts +17 -10
  33. package/dist/hooks/use-chat-approvals.d.ts.map +1 -1
  34. package/dist/hooks/use-chat-approvals.js +28 -15
  35. package/dist/hooks/use-search.d.ts +2 -0
  36. package/dist/hooks/use-search.d.ts.map +1 -1
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/package.json +2 -1
  40. package/dist/plugins/persistance.d.ts +16 -0
  41. package/dist/plugins/persistance.d.ts.map +1 -0
  42. package/dist/plugins/persistance.js +23 -0
  43. package/dist/state/state.d.ts +16 -5
  44. package/dist/state/state.d.ts.map +1 -1
  45. package/dist/state/state.js +148 -101
  46. package/dist/style.css +1 -1
  47. package/dist/views/Catalog/Catalog.vue.d.ts +7 -0
  48. package/dist/views/Catalog/Catalog.vue.d.ts.map +1 -0
  49. package/dist/views/Catalog/Catalog.vue.js +8 -0
  50. package/dist/views/Catalog/Catalog.vue2.js +70 -0
  51. package/dist/views/Chat/Chat.vue.d.ts +2 -0
  52. package/dist/views/Chat/Chat.vue.d.ts.map +1 -1
  53. package/dist/views/Chat/Chat.vue.js +1 -1
  54. package/dist/views/Chat/Chat.vue2.js +36 -35
  55. package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts.map +1 -1
  56. package/dist/views/Chat/Messages/AskForAuthentication.vue.js +2 -2
  57. package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +50 -52
  58. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +2 -2
  59. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +1 -1
  60. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +2 -2
  61. package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +8 -7
  62. package/dist/views/Layout.vue.d.ts +2 -0
  63. package/dist/views/Layout.vue.d.ts.map +1 -1
  64. package/dist/views/Layout.vue.js +2 -2
  65. package/dist/views/Layout.vue2.js +16 -14
  66. package/dist/views/PromptForm.vue.d.ts +2 -0
  67. package/dist/views/PromptForm.vue.d.ts.map +1 -1
  68. package/dist/views/PromptForm.vue.js +1 -1
  69. package/dist/views/PromptForm.vue2.js +112 -99
  70. package/dist/views/Settings/Auth.vue.d.ts +2 -2
  71. package/dist/views/Settings/Auth.vue.d.ts.map +1 -1
  72. package/dist/views/Settings/Auth.vue.js +32 -32
  73. package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
  74. package/dist/views/Settings/DocSettings.vue.js +1 -1
  75. package/dist/views/Settings/DocSettings.vue2.js +22 -21
  76. package/dist/views/Start.vue.d.ts +2 -0
  77. package/dist/views/Start.vue.d.ts.map +1 -1
  78. package/dist/views/Start.vue.js +2 -2
  79. package/dist/views/Start.vue2.js +22 -21
  80. package/package.json +9 -8
@@ -1,40 +1,44 @@
1
- import { defineComponent as F, useTemplateRef as H, computed as g, watch as A, createElementBlock as i, openBlock as l, createBlock as u, createCommentVNode as r, createElementVNode as n, withDirectives as C, unref as e, withModifiers as N, vModelText as K, createVNode as v, withCtx as j, Fragment as S, renderList as w, createTextVNode as T, toDisplayString as q, vShow as J } from "vue";
2
- import { ScalarIconButton as _, ScalarLoading as X } from "@scalar/components";
3
- import { ScalarIconPlus as O, ScalarIconX as Z, ScalarIconLockSimple as G, ScalarIconCheck as Q, ScalarIconArrowUp as W } from "@scalar/icons";
4
- import Y from "../components/ApprovalSection.vue.js";
5
- import ee from "../components/ErrorMessage.vue.js";
6
- import te from "../components/FreeMessagesInfoSection.vue.js";
7
- import oe from "../components/PaymentSection.vue.js";
8
- import se from "../components/SearchPopover.vue.js";
9
- import le from "../components/UploadSection.vue.js";
10
- import { AgentErrorCodes as P } from "../entities/error/constants.js";
11
- import { MAX_PROMPT_SIZE as ne } from "../entities/prompt/constants.js";
12
- import { useChatApprovals as re } from "../hooks/use-chat-approvals.js";
13
- import { useChatError as ae } from "../hooks/use-chat-error.js";
14
- import { useChatPendingClientToolParts as ie } from "../hooks/use-chat-pending-client-tool-parts.js";
15
- import { useUploadTmpDocument as ue } from "../hooks/use-upload-tmp-document.js";
16
- import { useState as ce } from "../state/state.js";
17
- const pe = { class: "actionContainer" }, me = ["disabled"], de = { class: "inputActionsContainer" }, ge = { class: "inputActionsLeft" }, ve = {
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
- }, fe = ["src"], he = ["onClick"], ye = { class: "inputActionsRight" }, be = { class: "sendCheckboxContinue" }, ke = {
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
- }, Ae = {
27
+ }, we = {
24
28
  class: "termsAgree",
25
29
  for: "agentTermsAgree"
26
- }, Ce = { class: "addMoreContext" }, Se = { class: "ml-auto flex items-center gap-1" }, we = ["onClick"], Te = ["alt", "src"], Ke = /* @__PURE__ */ F({
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(_e, { expose: x, emit: I }) {
30
- const D = I;
31
- x({ focusPrompt: U });
32
- const c = H("agentPrompt"), t = ce(), E = g(() => t.prompt.value.trim().length > 0), M = g(
33
- () => t.prompt.value.trim().length > ne
34
- ), L = g(
35
- () => t.chat.messages.length > 1 && !t.getAgentKey?.() && d?.value?.code !== P.LIMIT_REACHED
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
- A(t.prompt, () => {
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 R(a) {
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 U() {
53
+ function B() {
50
54
  c.value?.focus();
51
55
  }
52
- A(
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 { respondToToolCalls: p, approvalRequestedParts: h } = re(), { pendingClientToolParts: z } = ie(), m = ue();
59
- function B() {
60
- t.terms.accept(), t.mode === "preview" && t.getActiveDocumentJson && m.uploadTempDocument(t.getActiveDocumentJson(), !0);
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 = g(() => {
63
- const a = M.value, s = !E.value, o = h.value.length > 0, f = z.value.length > 0, k = t.mode === "preview", $ = k && !t.terms.accepted.value, V = k && !!m.uploadState.value;
64
- return a || s || o || f || $ || V;
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 || D("submit");
71
+ y.value || L("submit");
68
72
  }
69
- const d = ae();
70
- return (a, s) => (l(), i("div", pe, [
71
- e(m).uploadState.value ? (l(), u(le, {
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(m).uploadState.value
74
- }, null, 8, ["uploadState"])) : r("", !0),
75
- e(d) ? (l(), u(ee, {
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"])) : r("", !0),
79
- e(h).length ? (l(), u(Y, {
82
+ }, null, 8, ["error"])) : i("", !0),
83
+ e(f).length ? (s(), r(ee, {
80
84
  key: 2,
81
- onApprove: s[0] || (s[0] = (o) => e(p)(!0)),
82
- onReject: s[1] || (s[1] = (o) => e(p)(!1))
83
- })) : r("", !0),
84
- e(d)?.code === e(P).LIMIT_REACHED ? (l(), u(oe, {
85
- key: 3,
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: N(b, ["prevent"])
92
+ onSubmit: K(b, ["prevent"])
93
93
  }, [
94
- s[7] || (s[7] = n("label", {
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
- C(n("textarea", {
98
+ _(n("textarea", {
99
99
  id: "agentTextarea",
100
100
  ref: "agentPrompt",
101
- "onUpdate:modelValue": s[4] || (s[4] = (o) => e(t).prompt.value = o),
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: R
106
+ onKeydown: z
107
107
  }, null, 40, me), [
108
- [K, e(t).prompt.value]
108
+ [J, e(t).prompt.value]
109
109
  ]),
110
- n("div", de, [
111
- n("div", ge, [
112
- v(se, null, {
113
- default: j(() => [
114
- n("button", ve, [
115
- v(e(O), {
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
- (l(!0), i(S, null, w(e(t).registryDocuments.value, (o) => (l(), i("div", {
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 ? (l(), i("img", {
140
+ o.logoUrl ? (s(), u("img", {
128
141
  key: 0,
129
142
  class: "apiPillLogo",
130
143
  src: o.logoUrl
131
- }, null, 8, fe)) : r("", !0),
132
- T(" " + q(o.title) + " ", 1),
133
- o.removable ? (l(), i("button", {
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: (f) => e(t).removeDocument(o)
150
+ onClick: (v) => e(t).removeDocument(o)
138
151
  }, [
139
- v(e(Z), {
152
+ g(e(Z), {
140
153
  class: "size-4",
141
154
  weight: "bold"
142
155
  })
143
- ], 8, he)) : r("", !0)
156
+ ], 8, be)) : i("", !0)
144
157
  ]))), 128))
145
158
  ]),
146
- n("div", ye, [
147
- e(t).loading.value ? r("", !0) : (l(), u(e(_), {
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: s[5] || (s[5] = (o) => e(t).settingsModal.show())
167
+ onClick: l[4] || (l[4] = (o) => e(t).settingsModal.show())
155
168
  }, null, 8, ["icon"])),
156
- n("div", be, [
157
- !e(t).terms.accepted.value && e(t).mode === "preview" ? (l(), i("div", ke, [
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: B
175
+ onChange: V
163
176
  }, null, 32),
164
- n("label", Ae, [
165
- v(e(Q), {
177
+ n("label", we, [
178
+ g(e(Q), {
166
179
  class: "termsAgreeIcon",
167
180
  weight: "bold"
168
181
  }),
169
- s[6] || (s[6] = T(" Agree to Terms & Conditions ", -1))
182
+ l[5] || (l[5] = T(" Agree to Terms & Conditions ", -1))
170
183
  ])
171
- ])) : r("", !0),
172
- e(t).loading.value ? (l(), u(e(X), {
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"])) : (l(), u(e(_), {
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
- C(n("div", Ce, [
205
- s[8] || (s[8] = n("span", null, "Add context from dozens of API's", -1)),
206
- n("div", Se, [
207
- (l(!0), i(S, null, w(e(t).curatedDocuments.value, (o) => (l(), i("button", {
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: (f) => e(t).addDocument(o)
224
+ onClick: (v) => e(t).addDocument(o)
212
225
  }, [
213
- o.logoUrl ? (l(), i("img", {
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, Te)) : r("", !0)
219
- ], 8, we))), 128))
231
+ }, null, 8, Pe)) : i("", !0)
232
+ ], 8, Te))), 128))
220
233
  ])
221
234
  ], 512), [
222
- [J, e(t).chat.messages.length <= 1]
235
+ [j, e(t).chat.messages.length <= 1]
223
236
  ])
224
237
  ]));
225
238
  }
226
239
  });
227
240
  export {
228
- Ke as default
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":"AAoGA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,yDAAyD,CAAA;AAKhE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,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;AAOlF,KAAK,WAAW,GAAG;IACf,OAAO,EAAE,IAAI,CACX,4BAA4B,EAC5B,gBAAgB,GAAG,aAAa,GAAG,UAAU,CAC9C,CAAA;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAA;IACvC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,eAAe,EAAE,qBAAqB,CAAA;IACtC,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;AAuHJ,wBAMG"}
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 n, watch as i, shallowRef as l, createElementBlock as y, openBlock as m, createBlock as d, createCommentVNode as S, unref as h } from "vue";
2
- import { AuthSelector as f } from "@scalar/api-client/v2/blocks/scalar-auth-selector-block";
3
- import { getSecurityRequirements as v, getSelectedSecurity as x } from "@scalar/api-client/v2/features/operation";
4
- import { useFocusWithin as R } from "@vueuse/core";
5
- import { authStorage as k, restoreAuthSecretsFromStorage as A } from "../../helpers.js";
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: r } = B(), s = n(
20
- () => v(e.document?.security)
21
- ), c = n(
22
- () => x(
23
- e.document?.["x-scalar-selected-security"],
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
- s.value
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
- i(
29
- [() => c, () => e.securitySchemes],
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(e.securitySchemes).length ? (m(), d(h(f), {
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: s.value,
57
- securitySchemes: e.securitySchemes,
58
- selectedSecurity: c.value,
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"])) : S("", !0)
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":"AAyEA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAOlF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;CACb,CAAC;;AAoGF,wBAMG"}
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-e2db54a7"]]);
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 d, computed as t, createElementBlock as a, openBlock as S, createElementVNode as s, createVNode as m, unref as n } from "vue";
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 g, getServers as B } from "@scalar/api-client/v2/helpers";
4
- import h from "../../components/ServerSelector.vue.js";
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__ */ d({
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: u, config: i, eventBus: r } = y(), v = t(
15
- () => g(u, e.document)
16
- ), c = t(() => {
17
- const o = B(e.document.servers, {
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, o);
21
- }), l = t(
20
+ return f(e.document, s);
21
+ }), l = n(
22
22
  () => e.document.components?.securitySchemes ?? {}
23
23
  );
24
- return (o, x) => (S(), a("div", p, [
25
- s("div", null, [
26
- m(k, {
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: n(r),
30
+ eventBus: t(c),
30
31
  name: e.name,
31
- options: n(i),
32
+ options: t(i),
32
33
  securitySchemes: l.value,
33
- selectedServer: c.value
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
- s("div", null, [
37
- m(h, {
38
- eventBus: n(r),
39
- selectedServer: c.value,
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":";;;;;AAsMA,wBAMG"}
1
+ {"version":3,"file":"Start.vue.d.ts","sourceRoot":"","sources":["../../src/views/Start.vue"],"names":[],"mappings":";;;;;;;AA+MA,wBAMG"}
@@ -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 p = /* @__PURE__ */ o(t, [["__scopeId", "data-v-2030a05b"]]);
4
+ const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-1fbb0eb5"]]);
5
5
  export {
6
- p as default
6
+ m as default
7
7
  };
@@ -1,41 +1,42 @@
1
- import { defineComponent as p, createElementBlock as r, openBlock as s, createVNode as a, createElementVNode as t, createTextVNode as o, unref as d, Fragment as n } from "vue";
2
- import u from "../components/Logo.vue.js";
3
- import { useState as g } from "../state/state.js";
4
- import c from "./PromptForm.vue.js";
5
- const y = { class: "startContainer" }, f = { class: "disclaimerText" }, L = /* @__PURE__ */ p({
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(k, { emit: i }) {
9
- const m = i, { mode: l } = g();
10
- return (S, e) => (s(), r("div", y, [
11
- a(u, { class: "agentLogo" }),
12
- e[5] || (e[5] = t("h1", { class: "heading" }, "How can I help you today?", -1)),
13
- a(c, {
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] = (b) => m("submit"))
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", f, [
18
- d(l) === "preview" ? (s(), r(n, { key: 0 }, [
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(n, { key: 1 }, [
21
+ ], 64)) : (s(), r(i, { key: 1 }, [
21
22
  o(" By messaging Agent Scalar you agree to our ")
22
23
  ], 64)),
23
- e[1] || (e[1] = t("a", {
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[2] || (e[2] = o(" and ", -1)),
29
- e[3] || (e[3] = t("a", {
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[4] || (e[4] = o(". ", -1))
35
+ e[5] || (e[5] = o(". ", -1))
35
36
  ])
36
37
  ]));
37
38
  }
38
39
  });
39
40
  export {
40
- L as default
41
+ F as default
41
42
  };