@scalar/agent-chat 0.5.17 → 0.7.0

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 (53) hide show
  1. package/dist/App.vue.d.ts +4 -1
  2. package/dist/App.vue.d.ts.map +1 -1
  3. package/dist/App.vue.js +13 -11
  4. package/dist/api.d.ts +3 -1
  5. package/dist/api.d.ts.map +1 -1
  6. package/dist/api.js +54 -53
  7. package/dist/client-tools/execute-request.d.ts +1 -0
  8. package/dist/client-tools/execute-request.d.ts.map +1 -1
  9. package/dist/client-tools/execute-request.js +33 -27
  10. package/dist/components/FreeMessagesInfoSection.vue.d.ts.map +1 -1
  11. package/dist/components/FreeMessagesInfoSection.vue.js +1 -1
  12. package/dist/components/FreeMessagesInfoSection.vue2.js +27 -25
  13. package/dist/components/PaymentSection.vue.d.ts.map +1 -1
  14. package/dist/components/PaymentSection.vue.js +1 -1
  15. package/dist/components/PaymentSection.vue2.js +16 -20
  16. package/dist/components/ServerSelector.vue.d.ts.map +1 -1
  17. package/dist/components/ServerSelector.vue.js +27 -21
  18. package/dist/components/UploadSection.vue.js +2 -2
  19. package/dist/components/UploadSection.vue2.js +13 -13
  20. package/dist/consts/urls.d.ts +8 -0
  21. package/dist/consts/urls.d.ts.map +1 -0
  22. package/dist/consts/urls.js +10 -0
  23. package/dist/helpers.d.ts +4 -10
  24. package/dist/helpers.d.ts.map +1 -1
  25. package/dist/helpers.js +34 -45
  26. package/dist/hooks/use-agent-key-documents.js +6 -6
  27. package/dist/hooks/use-chat-approvals.d.ts.map +1 -1
  28. package/dist/hooks/use-chat-approvals.js +7 -6
  29. package/dist/hooks/use-signup-link.d.ts +12 -0
  30. package/dist/hooks/use-signup-link.d.ts.map +1 -0
  31. package/dist/hooks/use-signup-link.js +12 -0
  32. package/dist/hooks/use-upload-tmp-document.d.ts +3 -0
  33. package/dist/hooks/use-upload-tmp-document.d.ts.map +1 -1
  34. package/dist/hooks/use-upload-tmp-document.js +31 -28
  35. package/dist/package.json +1 -1
  36. package/dist/state/state.d.ts +5 -2
  37. package/dist/state/state.d.ts.map +1 -1
  38. package/dist/state/state.js +140 -131
  39. package/dist/style.css +1 -1
  40. package/dist/views/Chat/Messages/AskForAuthentication.vue.js +1 -1
  41. package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +12 -12
  42. package/dist/views/PromptForm.vue.d.ts.map +1 -1
  43. package/dist/views/PromptForm.vue.js +2 -2
  44. package/dist/views/PromptForm.vue2.js +132 -122
  45. package/dist/views/Settings/DocSettings.vue.js +1 -1
  46. package/dist/views/Settings/DocSettings.vue2.js +10 -10
  47. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  48. package/dist/views/Settings/Settings.vue.js +2 -2
  49. package/dist/views/Settings/Settings.vue2.js +53 -43
  50. package/dist/views/Start.vue.d.ts.map +1 -1
  51. package/dist/views/Start.vue.js +1 -1
  52. package/dist/views/Start.vue2.js +28 -27
  53. package/package.json +7 -7
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as S, computed as n, createElementBlock as k, openBlock as u, normalizeClass as C, createElementVNode as d, createBlock as l, createCommentVNode as s, unref as i, withCtx as E, createTextVNode as I, createVNode as N } from "vue";
2
2
  import { getSelectedServer as P } from "@scalar/api-client/v2/features/operation";
3
- import { getActiveEnvironment as B, getServers as T } from "@scalar/api-client/v2/helpers";
4
- import { ScalarButton as _ } from "@scalar/components";
5
- import { ScalarIconArrowRight as x } from "@scalar/icons";
3
+ import { getActiveEnvironment as B, getServers as x } from "@scalar/api-client/v2/helpers";
4
+ import { ScalarButton as T } from "@scalar/components";
5
+ import { ScalarIconArrowRight as _ } from "@scalar/icons";
6
6
  import O from "../../../components/AuthenticationProvided.vue.js";
7
7
  import b from "../../../components/AuthenticationRequired.vue.js";
8
8
  import { ASK_FOR_AUTHENTICATION_TOOL_NAME as w } from "../../../entities/tools/ask-for-authentication.js";
@@ -19,11 +19,11 @@ const V = { class: "toggleButton" }, q = { class: "authContent" }, F = { class:
19
19
  const { workspaceStore: c, eventBus: f, config: p, chat: h } = L(), a = n(() => {
20
20
  if (!t.messagePart.value.input?.uniqueIdentifier || t.messagePart.value.state !== "input-available")
21
21
  return;
22
- const [o, r] = t.messagePart.value.input.uniqueIdentifier.split(
22
+ const [r, o] = t.messagePart.value.input.uniqueIdentifier.split(
23
23
  y
24
24
  );
25
- if (!(!o || !r))
26
- return z(o, r);
25
+ if (!(!r || !o))
26
+ return z(r, o);
27
27
  }), e = n(() => {
28
28
  if (a.value)
29
29
  return c.workspace.documents[a.value];
@@ -33,10 +33,10 @@ const V = { class: "toggleButton" }, q = { class: "authContent" }, F = { class:
33
33
  }), v = n(() => {
34
34
  if (!e.value)
35
35
  return;
36
- const o = T(e.value.servers, {
36
+ const r = x(e.value.servers, {
37
37
  documentUrl: e.value["x-scalar-original-source-url"]
38
38
  });
39
- return P(e.value, o);
39
+ return P(r, e.value["x-scalar-selected-server"]);
40
40
  }), g = n(
41
41
  () => a.value && m.value && v.value
42
42
  );
@@ -48,7 +48,7 @@ const V = { class: "toggleButton" }, q = { class: "authContent" }, F = { class:
48
48
  state: "output-available"
49
49
  });
50
50
  }
51
- return (o, r) => (u(), k("div", {
51
+ return (r, o) => (u(), k("div", {
52
52
  class: C(["askForAuthentication", {
53
53
  open: g.value
54
54
  }])
@@ -56,15 +56,15 @@ const V = { class: "toggleButton" }, q = { class: "authContent" }, F = { class:
56
56
  d("div", V, [
57
57
  t.messagePart.value.state === "output-available" ? (u(), l(O, { key: 0 })) : s("", !0),
58
58
  t.messagePart.value.state === "input-available" ? (u(), l(b, { key: 1 })) : s("", !0),
59
- t.messagePart.value.state === "input-available" ? (u(), l(i(_), {
59
+ t.messagePart.value.state === "input-available" ? (u(), l(i(T), {
60
60
  key: 2,
61
61
  class: "authorizeButton",
62
62
  size: "xs",
63
63
  onClick: A
64
64
  }, {
65
65
  default: E(() => [
66
- r[0] || (r[0] = I(" Authorize ", -1)),
67
- N(i(x), { weight: "bold" })
66
+ o[0] || (o[0] = I(" Authorize ", -1)),
67
+ N(i(_), { weight: "bold" })
68
68
  ]),
69
69
  _: 1
70
70
  })) : s("", !0)
@@ -1 +1 @@
1
- {"version":3,"file":"PromptForm.vue.d.ts","sourceRoot":"","sources":["../../src/views/PromptForm.vue"],"names":[],"mappings":"AAspBA,iBAAS,WAAW,SAEnB;AAwiBD,QAAA,MAAM,YAAY;;;;;;;;iFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"PromptForm.vue.d.ts","sourceRoot":"","sources":["../../src/views/PromptForm.vue"],"names":[],"mappings":"AAmqBA,iBAAS,WAAW,SAEnB;AA4jBD,QAAA,MAAM,YAAY;;;;;;;;iFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -1,7 +1,7 @@
1
1
  import o from "./PromptForm.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../_virtual/_plugin-vue_export-helper.js";
4
- const _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-3899441c"]]);
4
+ const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e7c7c266"]]);
5
5
  export {
6
- _ as default
6
+ c as default
7
7
  };
@@ -1,44 +1,47 @@
1
- import { defineComponent as K, useTemplateRef as j, computed as p, watch as _, createElementBlock as u, openBlock as s, createBlock as r, createCommentVNode as i, createElementVNode as l, withDirectives as w, unref as e, withModifiers as J, vModelText as O, withCtx as S, createVNode as g, Fragment as C, renderList as P, createTextVNode as T, toDisplayString as X, vShow as Z } from "vue";
2
- import { ScalarIconButton as I, ScalarLoading as G } from "@scalar/components";
3
- import { ScalarIconPlus as x, ScalarIconX as Q, ScalarIconLockSimple as W, ScalarIconCheck as Y, ScalarIconArrowUp as ee } from "@scalar/icons";
1
+ import { defineComponent as q, useTemplateRef as K, computed as d, watch as w, createElementBlock as r, openBlock as o, createBlock as u, createCommentVNode as a, createElementVNode as n, unref as e, withModifiers as j, withDirectives as J, vModelText as O, Fragment as f, withCtx as h, createVNode as p, renderList as C, createTextVNode as T, toDisplayString as X } from "vue";
2
+ import { ScalarTooltip as Z, ScalarIconButton as P, ScalarLoading as G } from "@scalar/components";
3
+ import { ScalarIconPlus as I, ScalarIconX as Q, ScalarIconLockSimple as W, ScalarIconCheck as Y, ScalarIconArrowUp as ee } from "@scalar/icons";
4
4
  import te from "../components/ActionsDropdown.vue.js";
5
5
  import oe from "../components/ApprovalSection.vue.js";
6
6
  import se from "../components/ErrorMessage.vue.js";
7
- import ne from "../components/FreeMessagesInfoSection.vue.js";
8
- import le from "../components/PaymentSection.vue.js";
7
+ import le from "../components/FreeMessagesInfoSection.vue.js";
8
+ import ne from "../components/PaymentSection.vue.js";
9
9
  import ae from "../components/SearchPopover.vue.js";
10
10
  import re from "../components/UploadSection.vue.js";
11
11
  import { AgentErrorCodes as D } from "../entities/error/constants.js";
12
12
  import { MAX_PROMPT_SIZE as ie } from "../entities/prompt/constants.js";
13
13
  import { useRequestApprovals as ue } from "../hooks/use-chat-approvals.js";
14
14
  import { useChatError as ce } from "../hooks/use-chat-error.js";
15
- import { useChatPendingClientToolParts as pe } from "../hooks/use-chat-pending-client-tool-parts.js";
16
- import { useUploadTmpDocument as de } from "../hooks/use-upload-tmp-document.js";
15
+ import { useChatPendingClientToolParts as de } from "../hooks/use-chat-pending-client-tool-parts.js";
16
+ import { useUploadTmpDocument as pe } from "../hooks/use-upload-tmp-document.js";
17
17
  import { useState as me } from "../state/state.js";
18
18
  const ge = { class: "actionContainer" }, ve = ["disabled"], fe = { class: "inputActionsContainer" }, he = { class: "inputActionsLeft" }, ye = {
19
19
  class: "addAPIButton",
20
20
  type: "button"
21
- }, be = {
21
+ }, Ae = {
22
22
  class: "addAPIButton",
23
23
  type: "button"
24
- }, Ae = ["src"], ke = ["onClick"], _e = { class: "inputActionsRight" }, we = { class: "sendCheckboxContinue" }, Se = {
24
+ }, be = ["src"], ke = ["onClick"], _e = { class: "inputActionsRight" }, Se = { class: "sendCheckboxContinue" }, we = {
25
25
  key: 0,
26
26
  class: "relative flex items-center gap-1.5"
27
27
  }, Ce = {
28
28
  class: "termsAgree",
29
29
  for: "agentTermsAgree"
30
- }, Pe = { class: "addMoreContext" }, Te = { class: "ml-auto flex items-center gap-1" }, Ie = ["onClick"], xe = ["alt", "src"], Xe = /* @__PURE__ */ K({
30
+ }, Te = {
31
+ key: 5,
32
+ class: "addMoreContext"
33
+ }, Pe = { class: "ml-auto flex items-center gap-1" }, Ie = ["onClick"], De = ["alt", "src"], Xe = /* @__PURE__ */ q({
31
34
  __name: "PromptForm",
32
35
  emits: ["submit", "uploadApi"],
33
- setup(De, { expose: L, emit: E }) {
34
- const M = E;
35
- L({ focusPrompt: $ });
36
- const c = j("agentPrompt"), t = me(), R = p(() => t.prompt.value.trim().length > 0), B = p(
36
+ setup(xe, { expose: x, emit: L }) {
37
+ const E = L;
38
+ x({ focusPrompt: z });
39
+ const c = K("agentPrompt"), t = me(), M = d(() => t.prompt.value.trim().length > 0), R = d(
37
40
  () => t.prompt.value.trim().length > ie
38
- ), U = p(
39
- () => t.chat.messages.length > 1 && !t.getAgentKey?.() && m?.value?.code !== D.LIMIT_REACHED
41
+ ), B = d(
42
+ () => t.chat.messages.length > 1 && !t.getAgentKey?.() && g?.value?.code !== D.LIMIT_REACHED
40
43
  );
41
- _(t.prompt, () => {
44
+ w(t.prompt, () => {
42
45
  if (c?.value) {
43
46
  if (!t.prompt.value.length) {
44
47
  c.value.style.height = "0px";
@@ -47,144 +50,153 @@ const ge = { class: "actionContainer" }, ve = ["disabled"], fe = { class: "input
47
50
  c.value.style.height = "auto", c.value.style.height = c.value.scrollHeight + "px";
48
51
  }
49
52
  });
50
- function z(a) {
51
- t.loading.value || a.key === "Enter" && !a.shiftKey && (a.preventDefault(), A(), window.scrollTo(0, document.body.scrollHeight));
53
+ function U(i) {
54
+ t.loading.value || i.key === "Enter" && !i.shiftKey && (i.preventDefault(), _(), window.scrollTo(0, document.body.scrollHeight));
52
55
  }
53
- function $() {
56
+ function z() {
54
57
  c.value?.focus();
55
58
  }
56
- _(
59
+ w(
57
60
  () => t.chat.status,
58
- (a) => {
59
- (a === "ready" || a === "error") && c.value?.focus();
61
+ (i) => {
62
+ (i === "ready" || i === "error") && c.value?.focus();
60
63
  }
61
64
  );
62
- const { approvalRequiredParts: f, respondToRequestApprovals: h } = ue(), { pendingClientToolParts: V } = pe(), d = de();
63
- function F() {
64
- t.terms.accept(), t.mode === "preview" && t.getActiveDocumentJson && d.uploadTempDocument(t.getActiveDocumentJson(), !0);
65
+ const { approvalRequiredParts: y, respondToRequestApprovals: A } = ue(), { pendingClientToolParts: $ } = de(), m = pe();
66
+ function V() {
67
+ t.terms.accept(), t.mode === "preview" && t.getActiveDocumentJson && m.uploadTempDocument(t.getActiveDocumentJson(), !0);
65
68
  }
66
- const y = p(
69
+ const b = d(
67
70
  () => Object.values(t.pendingDocuments).some(Boolean)
68
- ), b = p(() => {
69
- const a = B.value, n = !R.value, o = f.value.length > 0, v = V.value.length > 0, k = t.mode === "preview", H = k && !t.terms.accepted.value, N = k && !!d.uploadState.value, q = y.value;
70
- return a || n || o || v || H || N || q;
71
+ ), k = d(() => {
72
+ const i = R.value, l = !M.value, s = y.value.length > 0, v = $.value.length > 0, S = t.mode === "preview", F = S && !t.terms.accepted.value, H = S && !!m.uploadState.value, N = b.value;
73
+ return i || l || s || v || F || H || N;
71
74
  });
72
- function A() {
73
- b.value || M("submit");
75
+ function _() {
76
+ k.value || E("submit");
74
77
  }
75
- const m = ce();
76
- return (a, n) => (s(), u("div", ge, [
77
- e(d).uploadState.value || y.value ? (s(), r(re, {
78
+ const g = ce();
79
+ return (i, l) => (o(), r("div", ge, [
80
+ e(m).uploadState.value || b.value ? (o(), u(re, {
78
81
  key: 0,
79
- uploadState: e(d).uploadState.value ?? { type: "loading" }
80
- }, null, 8, ["uploadState"])) : i("", !0),
81
- e(m) ? (s(), r(se, {
82
+ uploadState: e(m).uploadState.value ?? { type: "loading" }
83
+ }, null, 8, ["uploadState"])) : a("", !0),
84
+ e(g) ? (o(), u(se, {
82
85
  key: 1,
83
- error: e(m)
84
- }, null, 8, ["error"])) : i("", !0),
85
- e(f).length ? (s(), r(oe, {
86
+ error: e(g)
87
+ }, null, 8, ["error"])) : a("", !0),
88
+ e(y).length ? (o(), u(oe, {
86
89
  key: 2,
87
- onApprove: n[0] || (n[0] = (o) => e(h)(!0)),
88
- onReject: n[1] || (n[1] = (o) => e(h)(!1))
89
- })) : i("", !0),
90
- e(m)?.code === e(D).LIMIT_REACHED ? (s(), r(le, { key: 3 })) : i("", !0),
91
- U.value ? (s(), r(ne, { key: 4 })) : i("", !0),
92
- l("form", {
90
+ onApprove: l[0] || (l[0] = (s) => e(A)(!0)),
91
+ onReject: l[1] || (l[1] = (s) => e(A)(!1))
92
+ })) : a("", !0),
93
+ e(g)?.code === e(D).LIMIT_REACHED ? (o(), u(ne, { key: 3 })) : a("", !0),
94
+ B.value ? (o(), u(le, { key: 4 })) : a("", !0),
95
+ n("form", {
93
96
  class: "promptForm",
94
- onSubmit: J(A, ["prevent"])
97
+ onSubmit: j(_, ["prevent"])
95
98
  }, [
96
- n[6] || (n[6] = l("label", {
99
+ l[6] || (l[6] = n("label", {
97
100
  class: "agentLabel",
98
101
  for: "agentTextarea"
99
102
  }, " Type a Request To get Started ", -1)),
100
- w(l("textarea", {
103
+ J(n("textarea", {
101
104
  id: "agentTextarea",
102
105
  ref: "agentPrompt",
103
- "onUpdate:modelValue": n[2] || (n[2] = (o) => e(t).prompt.value = o),
106
+ "onUpdate:modelValue": l[2] || (l[2] = (s) => e(t).prompt.value = s),
104
107
  class: "prompt custom-scroll",
105
108
  disabled: e(t).loading.value,
106
109
  name: "prompt",
107
- placeholder: "Ask me anything...",
108
- onKeydown: z
110
+ placeholder: "Ask me anything",
111
+ onKeydown: U
109
112
  }, null, 40, ve), [
110
113
  [O, e(t).prompt.value]
111
114
  ]),
112
- l("div", fe, [
113
- l("div", he, [
114
- e(t).isLoggedIn?.value ? (s(), r(te, {
115
- key: 1,
116
- onUploadApi: n[3] || (n[3] = (o) => a.$emit("uploadApi"))
117
- }, {
118
- default: S(() => [
119
- l("button", be, [
120
- g(e(x), {
121
- class: "size-4",
122
- weight: "bold"
123
- })
124
- ])
125
- ]),
126
- _: 1
127
- })) : (s(), r(ae, { key: 0 }, {
128
- default: S(() => [
129
- l("button", ye, [
130
- g(e(x), {
131
- class: "size-4",
132
- weight: "bold"
133
- })
134
- ])
135
- ]),
136
- _: 1
137
- })),
138
- (s(!0), u(C, null, P(e(t).registryDocuments.value, (o) => (s(), u("div", {
139
- key: o.id,
115
+ n("div", fe, [
116
+ n("div", he, [
117
+ e(t).hideAddApi ? a("", !0) : (o(), r(f, { key: 0 }, [
118
+ e(t).isLoggedIn?.value ? (o(), u(te, {
119
+ key: 1,
120
+ onUploadApi: l[3] || (l[3] = (s) => i.$emit("uploadApi"))
121
+ }, {
122
+ default: h(() => [
123
+ n("button", Ae, [
124
+ p(e(I), {
125
+ class: "size-4",
126
+ weight: "bold"
127
+ })
128
+ ])
129
+ ]),
130
+ _: 1
131
+ })) : (o(), u(ae, { key: 0 }, {
132
+ default: h(() => [
133
+ n("button", ye, [
134
+ p(e(I), {
135
+ class: "size-4",
136
+ weight: "bold"
137
+ })
138
+ ])
139
+ ]),
140
+ _: 1
141
+ }))
142
+ ], 64)),
143
+ (o(!0), r(f, null, C(e(t).registryDocuments.value, (s) => (o(), r("div", {
144
+ key: s.id,
140
145
  class: "apiPill"
141
146
  }, [
142
- o.logoUrl ? (s(), u("img", {
147
+ s.logoUrl ? (o(), r("img", {
143
148
  key: 0,
144
149
  class: "apiPillLogo",
145
- src: o.logoUrl
146
- }, null, 8, Ae)) : i("", !0),
147
- T(" " + X(o.title) + " ", 1),
148
- o.removable ? (s(), u("button", {
150
+ src: s.logoUrl
151
+ }, null, 8, be)) : a("", !0),
152
+ T(" " + X(s.title) + " ", 1),
153
+ s.removable ? (o(), r("button", {
149
154
  key: 1,
150
155
  class: "apiPillRemove",
151
156
  type: "button",
152
- onClick: (v) => e(t).removeDocument(o)
157
+ onClick: (v) => e(t).removeDocument(s)
153
158
  }, [
154
- g(e(Q), {
159
+ p(e(Q), {
155
160
  class: "size-4",
156
161
  weight: "bold"
157
162
  })
158
- ], 8, ke)) : i("", !0)
163
+ ], 8, ke)) : a("", !0)
159
164
  ]))), 128))
160
165
  ]),
161
- l("div", _e, [
162
- e(t).loading.value ? i("", !0) : (s(), r(e(I), {
166
+ n("div", _e, [
167
+ e(t).loading.value ? a("", !0) : (o(), u(e(Z), {
163
168
  key: 0,
164
- class: "settingsButton h-7 w-7 p-1.5",
165
- icon: e(W),
166
- label: "Scalar",
167
- size: "md",
168
- weight: "bold",
169
- onClick: n[4] || (n[4] = (o) => e(t).settingsModal.show())
170
- }, null, 8, ["icon"])),
171
- l("div", we, [
172
- !e(t).terms.accepted.value && e(t).mode === "preview" ? (s(), u("div", Se, [
173
- l("input", {
169
+ content: "Settings"
170
+ }, {
171
+ default: h(() => [
172
+ p(e(P), {
173
+ class: "settingsButton h-7 w-7 p-1.5",
174
+ icon: e(W),
175
+ label: "Scalar",
176
+ size: "md",
177
+ weight: "bold",
178
+ onClick: l[4] || (l[4] = (s) => e(t).settingsModal.show())
179
+ }, null, 8, ["icon"])
180
+ ]),
181
+ _: 1
182
+ })),
183
+ n("div", Se, [
184
+ !e(t).terms.accepted.value && e(t).mode === "preview" ? (o(), r("div", we, [
185
+ n("input", {
174
186
  id: "agentTermsAgree",
175
187
  class: "sr-only",
176
188
  type: "checkbox",
177
- onChange: F
189
+ onChange: V
178
190
  }, null, 32),
179
- l("label", Ce, [
180
- g(e(Y), {
191
+ n("label", Ce, [
192
+ p(e(Y), {
181
193
  class: "termsAgreeIcon",
182
194
  weight: "bold"
183
195
  }),
184
- n[5] || (n[5] = T(" Agree to Terms & Conditions ", -1))
196
+ l[5] || (l[5] = T(" Agree to Terms & Conditions ", -1))
185
197
  ])
186
- ])) : i("", !0),
187
- e(t).loading.value ? (s(), r(e(G), {
198
+ ])) : a("", !0),
199
+ e(t).loading.value ? (o(), u(e(G), {
188
200
  key: 2,
189
201
  class: "loader h-7 w-7",
190
202
  loader: {
@@ -202,10 +214,10 @@ const ge = { class: "actionContainer" }, ve = ["disabled"], fe = { class: "input
202
214
  }
203
215
  },
204
216
  size: "2xl"
205
- }, null, 8, ["loader"])) : (s(), r(e(I), {
217
+ }, null, 8, ["loader"])) : (o(), u(e(P), {
206
218
  key: 1,
207
219
  class: "sendButton h-7 w-7 p-1.5",
208
- disabled: b.value,
220
+ disabled: k.value,
209
221
  icon: e(ee),
210
222
  label: "Scalar",
211
223
  size: "md",
@@ -216,26 +228,24 @@ const ge = { class: "actionContainer" }, ve = ["disabled"], fe = { class: "input
216
228
  ])
217
229
  ])
218
230
  ], 32),
219
- w(l("div", Pe, [
220
- n[7] || (n[7] = l("span", null, "Add context from dozens of API's", -1)),
221
- l("div", Te, [
222
- (s(!0), u(C, null, P(e(t).curatedDocuments.value, (o) => (s(), u("button", {
223
- key: o.id,
231
+ e(t).chat.messages.length <= 1 && !e(t).hideAddApi ? (o(), r("div", Te, [
232
+ l[7] || (l[7] = n("span", null, "Load additional APIs", -1)),
233
+ n("div", Pe, [
234
+ (o(!0), r(f, null, C(e(t).curatedDocuments.value, (s) => (o(), r("button", {
235
+ key: s.id,
224
236
  class: "addAPIContext",
225
237
  type: "button",
226
- onClick: (v) => e(t).addDocument(o)
238
+ onClick: (v) => e(t).addDocument(s)
227
239
  }, [
228
- o.logoUrl ? (s(), u("img", {
240
+ s.logoUrl ? (o(), r("img", {
229
241
  key: 0,
230
- alt: o.title,
242
+ alt: s.title,
231
243
  class: "size-4",
232
- src: o.logoUrl
233
- }, null, 8, xe)) : i("", !0)
244
+ src: s.logoUrl
245
+ }, null, 8, De)) : a("", !0)
234
246
  ], 8, Ie))), 128))
235
247
  ])
236
- ], 512), [
237
- [Z, e(t).chat.messages.length <= 1]
238
- ])
248
+ ])) : a("", !0)
239
249
  ]));
240
250
  }
241
251
  });
@@ -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-2dfa823a"]]);
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-31f052ad"]]);
5
5
  export {
6
6
  m as default
7
7
  };
@@ -2,35 +2,35 @@ import { defineComponent as a, computed as n, createElementBlock as d, openBlock
2
2
  import { getSelectedServer as f } from "@scalar/api-client/v2/features/operation";
3
3
  import { getActiveEnvironment as h, getServers as g } from "@scalar/api-client/v2/helpers";
4
4
  import B from "../../components/ServerSelector.vue.js";
5
- import { useState as y } from "../../state/state.js";
6
- import k from "./Auth.vue.js";
7
- const p = { class: "docSettings" }, C = /* @__PURE__ */ a({
5
+ import { useState as x } from "../../state/state.js";
6
+ import y from "./Auth.vue.js";
7
+ const k = { 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: r, config: i, eventBus: c } = y(), v = n(
14
+ const { workspaceStore: r, config: i, eventBus: c } = x(), l = n(
15
15
  () => h(r, e.document)
16
16
  ), o = n(() => {
17
17
  const s = g(e.document.servers, {
18
18
  documentUrl: e.document["x-scalar-original-source-url"]
19
19
  });
20
- return f(e.document, s);
21
- }), l = n(
20
+ return f(s, e.document["x-scalar-selected-server"]);
21
+ }), v = n(
22
22
  () => e.document.components?.securitySchemes ?? {}
23
23
  );
24
- return (s, x) => (S(), d("div", p, [
24
+ return (s, p) => (S(), d("div", k, [
25
25
  m("div", null, [
26
- u(k, {
26
+ u(y, {
27
27
  authStore: t(r).auth,
28
28
  document: e.document,
29
- environment: v.value,
29
+ environment: l.value,
30
30
  eventBus: t(c),
31
31
  name: e.name,
32
32
  options: t(i),
33
- securitySchemes: l.value,
33
+ securitySchemes: v.value,
34
34
  selectedServer: o.value
35
35
  }, null, 8, ["authStore", "document", "environment", "eventBus", "name", "options", "securitySchemes", "selectedServer"])
36
36
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/Settings.vue"],"names":[],"mappings":"AAsJA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAM3B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAC;AAmLF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/Settings.vue"],"names":[],"mappings":"AAkKA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAO3B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAC;AA8LF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -2,7 +2,7 @@ import t from "./Settings.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import o from "../../_virtual/_plugin-vue_export-helper.js";
5
- const s = /* @__PURE__ */ o(t, [["__scopeId", "data-v-745651bc"]]);
5
+ const e = /* @__PURE__ */ o(t, [["__scopeId", "data-v-5e4bca68"]]);
6
6
  export {
7
- s as default
7
+ e as default
8
8
  };