@scalar/agent-chat 0.5.18 → 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 (52) hide show
  1. package/dist/App.vue.d.ts +2 -1
  2. package/dist/App.vue.d.ts.map +1 -1
  3. package/dist/api.d.ts +3 -1
  4. package/dist/api.d.ts.map +1 -1
  5. package/dist/api.js +54 -53
  6. package/dist/client-tools/execute-request.d.ts +1 -0
  7. package/dist/client-tools/execute-request.d.ts.map +1 -1
  8. package/dist/client-tools/execute-request.js +33 -27
  9. package/dist/components/FreeMessagesInfoSection.vue.d.ts.map +1 -1
  10. package/dist/components/FreeMessagesInfoSection.vue.js +1 -1
  11. package/dist/components/FreeMessagesInfoSection.vue2.js +27 -25
  12. package/dist/components/PaymentSection.vue.d.ts.map +1 -1
  13. package/dist/components/PaymentSection.vue.js +1 -1
  14. package/dist/components/PaymentSection.vue2.js +16 -20
  15. package/dist/components/ServerSelector.vue.d.ts.map +1 -1
  16. package/dist/components/ServerSelector.vue.js +27 -21
  17. package/dist/components/UploadSection.vue.js +2 -2
  18. package/dist/components/UploadSection.vue2.js +13 -13
  19. package/dist/consts/urls.d.ts +8 -0
  20. package/dist/consts/urls.d.ts.map +1 -0
  21. package/dist/consts/urls.js +10 -0
  22. package/dist/helpers.d.ts +4 -10
  23. package/dist/helpers.d.ts.map +1 -1
  24. package/dist/helpers.js +34 -45
  25. package/dist/hooks/use-agent-key-documents.js +6 -6
  26. package/dist/hooks/use-chat-approvals.d.ts.map +1 -1
  27. package/dist/hooks/use-chat-approvals.js +7 -6
  28. package/dist/hooks/use-signup-link.d.ts +12 -0
  29. package/dist/hooks/use-signup-link.d.ts.map +1 -0
  30. package/dist/hooks/use-signup-link.js +12 -0
  31. package/dist/hooks/use-upload-tmp-document.d.ts +3 -0
  32. package/dist/hooks/use-upload-tmp-document.d.ts.map +1 -1
  33. package/dist/hooks/use-upload-tmp-document.js +31 -28
  34. package/dist/package.json +1 -1
  35. package/dist/state/state.d.ts +2 -1
  36. package/dist/state/state.d.ts.map +1 -1
  37. package/dist/state/state.js +134 -127
  38. package/dist/style.css +1 -1
  39. package/dist/views/Chat/Messages/AskForAuthentication.vue.js +1 -1
  40. package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +12 -12
  41. package/dist/views/PromptForm.vue.d.ts.map +1 -1
  42. package/dist/views/PromptForm.vue.js +2 -2
  43. package/dist/views/PromptForm.vue2.js +100 -93
  44. package/dist/views/Settings/DocSettings.vue.js +1 -1
  45. package/dist/views/Settings/DocSettings.vue2.js +10 -10
  46. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  47. package/dist/views/Settings/Settings.vue.js +2 -2
  48. package/dist/views/Settings/Settings.vue2.js +53 -43
  49. package/dist/views/Start.vue.d.ts.map +1 -1
  50. package/dist/views/Start.vue.js +1 -1
  51. package/dist/views/Start.vue2.js +28 -27
  52. package/package.json +8 -8
@@ -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":"AAwpBA,iBAAS,WAAW,SAEnB;AA6iBD,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-438c5215"]]);
4
+ const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e7c7c266"]]);
5
5
  export {
6
- _ as default
6
+ c as default
7
7
  };
@@ -1,45 +1,45 @@
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 l, unref as e, withModifiers as j, withDirectives as J, vModelText as O, Fragment as f, withCtx as S, createVNode as g, renderList as C, createTextVNode as P, toDisplayString as X } from "vue";
2
- import { ScalarIconButton as T, ScalarLoading as Z } from "@scalar/components";
3
- import { ScalarIconPlus as I, ScalarIconX as G, ScalarIconLockSimple as Q, ScalarIconCheck as W, ScalarIconArrowUp as Y } from "@scalar/icons";
4
- import ee from "../components/ActionsDropdown.vue.js";
5
- import te from "../components/ApprovalSection.vue.js";
6
- import oe from "../components/ErrorMessage.vue.js";
7
- import se from "../components/FreeMessagesInfoSection.vue.js";
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
+ import te from "../components/ActionsDropdown.vue.js";
5
+ import oe from "../components/ApprovalSection.vue.js";
6
+ import se from "../components/ErrorMessage.vue.js";
7
+ import le from "../components/FreeMessagesInfoSection.vue.js";
8
8
  import ne from "../components/PaymentSection.vue.js";
9
- import le from "../components/SearchPopover.vue.js";
10
- import ae from "../components/UploadSection.vue.js";
11
- import { AgentErrorCodes as x } from "../entities/error/constants.js";
12
- import { MAX_PROMPT_SIZE as re } from "../entities/prompt/constants.js";
13
- import { useRequestApprovals as ie } from "../hooks/use-chat-approvals.js";
14
- import { useChatError as ue } from "../hooks/use-chat-error.js";
15
- import { useChatPendingClientToolParts as ce } from "../hooks/use-chat-pending-client-tool-parts.js";
16
- import { useUploadTmpDocument as de } from "../hooks/use-upload-tmp-document.js";
17
- import { useState as pe } from "../state/state.js";
18
- const me = { class: "actionContainer" }, ge = ["disabled"], ve = { class: "inputActionsContainer" }, fe = { class: "inputActionsLeft" }, he = {
9
+ import ae from "../components/SearchPopover.vue.js";
10
+ import re from "../components/UploadSection.vue.js";
11
+ import { AgentErrorCodes as D } from "../entities/error/constants.js";
12
+ import { MAX_PROMPT_SIZE as ie } from "../entities/prompt/constants.js";
13
+ import { useRequestApprovals as ue } from "../hooks/use-chat-approvals.js";
14
+ import { useChatError as ce } from "../hooks/use-chat-error.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
+ import { useState as me } from "../state/state.js";
18
+ const ge = { class: "actionContainer" }, ve = ["disabled"], fe = { class: "inputActionsContainer" }, he = { class: "inputActionsLeft" }, ye = {
19
19
  class: "addAPIButton",
20
20
  type: "button"
21
- }, ye = {
21
+ }, Ae = {
22
22
  class: "addAPIButton",
23
23
  type: "button"
24
- }, Ae = ["src"], be = ["onClick"], ke = { class: "inputActionsRight" }, _e = { class: "sendCheckboxContinue" }, we = {
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
- }, Se = {
27
+ }, Ce = {
28
28
  class: "termsAgree",
29
29
  for: "agentTermsAgree"
30
- }, Ce = {
30
+ }, Te = {
31
31
  key: 5,
32
32
  class: "addMoreContext"
33
- }, Pe = { class: "ml-auto flex items-center gap-1" }, Te = ["onClick"], Ie = ["alt", "src"], Oe = /* @__PURE__ */ q({
33
+ }, Pe = { class: "ml-auto flex items-center gap-1" }, Ie = ["onClick"], De = ["alt", "src"], Xe = /* @__PURE__ */ q({
34
34
  __name: "PromptForm",
35
35
  emits: ["submit", "uploadApi"],
36
- setup(xe, { expose: D, emit: L }) {
36
+ setup(xe, { expose: x, emit: L }) {
37
37
  const E = L;
38
- D({ focusPrompt: z });
39
- const c = K("agentPrompt"), t = pe(), M = d(() => t.prompt.value.trim().length > 0), R = d(
40
- () => t.prompt.value.trim().length > re
38
+ x({ focusPrompt: z });
39
+ const c = K("agentPrompt"), t = me(), M = d(() => t.prompt.value.trim().length > 0), R = d(
40
+ () => t.prompt.value.trim().length > ie
41
41
  ), B = d(
42
- () => t.chat.messages.length > 1 && !t.getAgentKey?.() && m?.value?.code !== x.LIMIT_REACHED
42
+ () => t.chat.messages.length > 1 && !t.getAgentKey?.() && g?.value?.code !== D.LIMIT_REACHED
43
43
  );
44
44
  w(t.prompt, () => {
45
45
  if (c?.value) {
@@ -51,7 +51,7 @@ const me = { class: "actionContainer" }, ge = ["disabled"], ve = { class: "input
51
51
  }
52
52
  });
53
53
  function U(i) {
54
- t.loading.value || i.key === "Enter" && !i.shiftKey && (i.preventDefault(), k(), window.scrollTo(0, document.body.scrollHeight));
54
+ t.loading.value || i.key === "Enter" && !i.shiftKey && (i.preventDefault(), _(), window.scrollTo(0, document.body.scrollHeight));
55
55
  }
56
56
  function z() {
57
57
  c.value?.focus();
@@ -62,76 +62,76 @@ const me = { class: "actionContainer" }, ge = ["disabled"], ve = { class: "input
62
62
  (i === "ready" || i === "error") && c.value?.focus();
63
63
  }
64
64
  );
65
- const { approvalRequiredParts: h, respondToRequestApprovals: y } = ie(), { pendingClientToolParts: $ } = ce(), p = de();
65
+ const { approvalRequiredParts: y, respondToRequestApprovals: A } = ue(), { pendingClientToolParts: $ } = de(), m = pe();
66
66
  function V() {
67
- t.terms.accept(), t.mode === "preview" && t.getActiveDocumentJson && p.uploadTempDocument(t.getActiveDocumentJson(), !0);
67
+ t.terms.accept(), t.mode === "preview" && t.getActiveDocumentJson && m.uploadTempDocument(t.getActiveDocumentJson(), !0);
68
68
  }
69
- const A = d(
69
+ const b = d(
70
70
  () => Object.values(t.pendingDocuments).some(Boolean)
71
- ), b = d(() => {
72
- const i = R.value, n = !M.value, s = h.value.length > 0, v = $.value.length > 0, _ = t.mode === "preview", F = _ && !t.terms.accepted.value, H = _ && !!p.uploadState.value, N = A.value;
73
- return i || n || s || v || F || H || N;
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;
74
74
  });
75
- function k() {
76
- b.value || E("submit");
75
+ function _() {
76
+ k.value || E("submit");
77
77
  }
78
- const m = ue();
79
- return (i, n) => (o(), r("div", me, [
80
- e(p).uploadState.value || A.value ? (o(), u(ae, {
78
+ const g = ce();
79
+ return (i, l) => (o(), r("div", ge, [
80
+ e(m).uploadState.value || b.value ? (o(), u(re, {
81
81
  key: 0,
82
- uploadState: e(p).uploadState.value ?? { type: "loading" }
82
+ uploadState: e(m).uploadState.value ?? { type: "loading" }
83
83
  }, null, 8, ["uploadState"])) : a("", !0),
84
- e(m) ? (o(), u(oe, {
84
+ e(g) ? (o(), u(se, {
85
85
  key: 1,
86
- error: e(m)
86
+ error: e(g)
87
87
  }, null, 8, ["error"])) : a("", !0),
88
- e(h).length ? (o(), u(te, {
88
+ e(y).length ? (o(), u(oe, {
89
89
  key: 2,
90
- onApprove: n[0] || (n[0] = (s) => e(y)(!0)),
91
- onReject: n[1] || (n[1] = (s) => e(y)(!1))
90
+ onApprove: l[0] || (l[0] = (s) => e(A)(!0)),
91
+ onReject: l[1] || (l[1] = (s) => e(A)(!1))
92
92
  })) : a("", !0),
93
- e(m)?.code === e(x).LIMIT_REACHED ? (o(), u(ne, { key: 3 })) : a("", !0),
94
- B.value ? (o(), u(se, { key: 4 })) : a("", !0),
95
- l("form", {
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", {
96
96
  class: "promptForm",
97
- onSubmit: j(k, ["prevent"])
97
+ onSubmit: j(_, ["prevent"])
98
98
  }, [
99
- n[6] || (n[6] = l("label", {
99
+ l[6] || (l[6] = n("label", {
100
100
  class: "agentLabel",
101
101
  for: "agentTextarea"
102
102
  }, " Type a Request To get Started ", -1)),
103
- J(l("textarea", {
103
+ J(n("textarea", {
104
104
  id: "agentTextarea",
105
105
  ref: "agentPrompt",
106
- "onUpdate:modelValue": n[2] || (n[2] = (s) => e(t).prompt.value = s),
106
+ "onUpdate:modelValue": l[2] || (l[2] = (s) => e(t).prompt.value = s),
107
107
  class: "prompt custom-scroll",
108
108
  disabled: e(t).loading.value,
109
109
  name: "prompt",
110
- placeholder: "Ask me anything...",
110
+ placeholder: "Ask me anything",
111
111
  onKeydown: U
112
- }, null, 40, ge), [
112
+ }, null, 40, ve), [
113
113
  [O, e(t).prompt.value]
114
114
  ]),
115
- l("div", ve, [
116
- l("div", fe, [
115
+ n("div", fe, [
116
+ n("div", he, [
117
117
  e(t).hideAddApi ? a("", !0) : (o(), r(f, { key: 0 }, [
118
- e(t).isLoggedIn?.value ? (o(), u(ee, {
118
+ e(t).isLoggedIn?.value ? (o(), u(te, {
119
119
  key: 1,
120
- onUploadApi: n[3] || (n[3] = (s) => i.$emit("uploadApi"))
120
+ onUploadApi: l[3] || (l[3] = (s) => i.$emit("uploadApi"))
121
121
  }, {
122
- default: S(() => [
123
- l("button", ye, [
124
- g(e(I), {
122
+ default: h(() => [
123
+ n("button", Ae, [
124
+ p(e(I), {
125
125
  class: "size-4",
126
126
  weight: "bold"
127
127
  })
128
128
  ])
129
129
  ]),
130
130
  _: 1
131
- })) : (o(), u(le, { key: 0 }, {
132
- default: S(() => [
133
- l("button", he, [
134
- g(e(I), {
131
+ })) : (o(), u(ae, { key: 0 }, {
132
+ default: h(() => [
133
+ n("button", ye, [
134
+ p(e(I), {
135
135
  class: "size-4",
136
136
  weight: "bold"
137
137
  })
@@ -148,48 +148,55 @@ const me = { class: "actionContainer" }, ge = ["disabled"], ve = { class: "input
148
148
  key: 0,
149
149
  class: "apiPillLogo",
150
150
  src: s.logoUrl
151
- }, null, 8, Ae)) : a("", !0),
152
- P(" " + X(s.title) + " ", 1),
151
+ }, null, 8, be)) : a("", !0),
152
+ T(" " + X(s.title) + " ", 1),
153
153
  s.removable ? (o(), r("button", {
154
154
  key: 1,
155
155
  class: "apiPillRemove",
156
156
  type: "button",
157
157
  onClick: (v) => e(t).removeDocument(s)
158
158
  }, [
159
- g(e(G), {
159
+ p(e(Q), {
160
160
  class: "size-4",
161
161
  weight: "bold"
162
162
  })
163
- ], 8, be)) : a("", !0)
163
+ ], 8, ke)) : a("", !0)
164
164
  ]))), 128))
165
165
  ]),
166
- l("div", ke, [
167
- e(t).loading.value ? a("", !0) : (o(), u(e(T), {
166
+ n("div", _e, [
167
+ e(t).loading.value ? a("", !0) : (o(), u(e(Z), {
168
168
  key: 0,
169
- class: "settingsButton h-7 w-7 p-1.5",
170
- icon: e(Q),
171
- label: "Scalar",
172
- size: "md",
173
- weight: "bold",
174
- onClick: n[4] || (n[4] = (s) => e(t).settingsModal.show())
175
- }, null, 8, ["icon"])),
176
- l("div", _e, [
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, [
177
184
  !e(t).terms.accepted.value && e(t).mode === "preview" ? (o(), r("div", we, [
178
- l("input", {
185
+ n("input", {
179
186
  id: "agentTermsAgree",
180
187
  class: "sr-only",
181
188
  type: "checkbox",
182
189
  onChange: V
183
190
  }, null, 32),
184
- l("label", Se, [
185
- g(e(W), {
191
+ n("label", Ce, [
192
+ p(e(Y), {
186
193
  class: "termsAgreeIcon",
187
194
  weight: "bold"
188
195
  }),
189
- n[5] || (n[5] = P(" Agree to Terms & Conditions ", -1))
196
+ l[5] || (l[5] = T(" Agree to Terms & Conditions ", -1))
190
197
  ])
191
198
  ])) : a("", !0),
192
- e(t).loading.value ? (o(), u(e(Z), {
199
+ e(t).loading.value ? (o(), u(e(G), {
193
200
  key: 2,
194
201
  class: "loader h-7 w-7",
195
202
  loader: {
@@ -207,11 +214,11 @@ const me = { class: "actionContainer" }, ge = ["disabled"], ve = { class: "input
207
214
  }
208
215
  },
209
216
  size: "2xl"
210
- }, null, 8, ["loader"])) : (o(), u(e(T), {
217
+ }, null, 8, ["loader"])) : (o(), u(e(P), {
211
218
  key: 1,
212
219
  class: "sendButton h-7 w-7 p-1.5",
213
- disabled: b.value,
214
- icon: e(Y),
220
+ disabled: k.value,
221
+ icon: e(ee),
215
222
  label: "Scalar",
216
223
  size: "md",
217
224
  type: "submit",
@@ -221,9 +228,9 @@ const me = { class: "actionContainer" }, ge = ["disabled"], ve = { class: "input
221
228
  ])
222
229
  ])
223
230
  ], 32),
224
- e(t).chat.messages.length <= 1 && !e(t).hideAddApi ? (o(), r("div", Ce, [
225
- n[7] || (n[7] = l("span", null, "Add context from dozens of API's", -1)),
226
- l("div", Pe, [
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, [
227
234
  (o(!0), r(f, null, C(e(t).curatedDocuments.value, (s) => (o(), r("button", {
228
235
  key: s.id,
229
236
  class: "addAPIContext",
@@ -235,13 +242,13 @@ const me = { class: "actionContainer" }, ge = ["disabled"], ve = { class: "input
235
242
  alt: s.title,
236
243
  class: "size-4",
237
244
  src: s.logoUrl
238
- }, null, 8, Ie)) : a("", !0)
239
- ], 8, Te))), 128))
245
+ }, null, 8, De)) : a("", !0)
246
+ ], 8, Ie))), 128))
240
247
  ])
241
248
  ])) : a("", !0)
242
249
  ]));
243
250
  }
244
251
  });
245
252
  export {
246
- Oe as default
253
+ Xe as default
247
254
  };
@@ -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
  };
@@ -1,63 +1,73 @@
1
- import { defineComponent as k, createBlock as i, openBlock as t, unref as e, withCtx as g, createElementVNode as r, createVNode as d, createElementBlock as n, Fragment as y, renderList as f, createCommentVNode as v, normalizeClass as x, createTextVNode as S, toDisplayString as _, isRef as C } from "vue";
2
- import { ScalarModal as w, ScalarColorModeToggle as D, ScalarTextInput as h } from "@scalar/components";
3
- import { ScalarIconCaretDown as N, ScalarIconCaretRight as U } from "@scalar/icons";
4
- import { useState as V } from "../../state/state.js";
5
- import b from "./DocSettings.vue.js";
6
- const I = { class: "settingsHeading" }, T = { class: "documentList" }, B = ["onClick"], L = { key: 0 }, M = {
1
+ import { defineComponent as k, createBlock as c, openBlock as r, unref as e, withCtx as S, createElementVNode as o, createVNode as d, createElementBlock as a, Fragment as _, renderList as h, createCommentVNode as y, normalizeClass as C, createTextVNode as m, toDisplayString as v, isRef as R } from "vue";
2
+ import { ScalarModal as x, ScalarColorModeToggle as U, ScalarTextInput as w } from "@scalar/components";
3
+ import { ScalarIconCaretDown as D, ScalarIconCaretRight as b } from "@scalar/icons";
4
+ import { URLS as p } from "../../consts/urls.js";
5
+ import { useState as O } from "../../state/state.js";
6
+ import L from "./DocSettings.vue.js";
7
+ const V = { class: "settingsHeading" }, N = { class: "documentList" }, P = ["onClick"], T = { key: 0 }, A = {
7
8
  key: 1,
8
9
  class: "noDocuments"
9
- }, R = { class: "proxyUrlContainer" }, F = /* @__PURE__ */ k({
10
+ }, E = { class: "proxyUrlContainer" }, I = ["href"], z = /* @__PURE__ */ k({
10
11
  __name: "Settings",
11
12
  props: {
12
13
  modalState: {}
13
14
  },
14
- setup(u) {
15
- const { workspaceStore: o, proxyUrl: c } = V();
16
- function p(m) {
17
- o.update("x-scalar-active-document", m);
15
+ setup(f) {
16
+ const { workspaceStore: s, proxyUrlRaw: i } = O();
17
+ function g(u) {
18
+ s.update("x-scalar-active-document", u);
18
19
  }
19
- return (m, s) => (t(), i(e(w), {
20
+ return (u, t) => (r(), c(e(x), {
20
21
  class: "settingsModal",
21
- state: u.modalState
22
+ state: f.modalState
22
23
  }, {
23
- default: g(() => [
24
- r("div", I, [
25
- s[1] || (s[1] = r("h1", null, "Settings", -1)),
26
- d(e(D), { class: "colorToggle ml-auto" })
24
+ default: S(() => [
25
+ o("div", V, [
26
+ t[1] || (t[1] = o("h1", null, "Settings", -1)),
27
+ d(e(U), { class: "colorToggle ml-auto" })
27
28
  ]),
28
- r("div", T, [
29
- Object.entries(e(o).workspace.documents).length ? (t(!0), n(y, { key: 0 }, f(Object.entries(
30
- e(o).workspace.documents
31
- ), ([a, l]) => (t(), n("div", {
32
- key: a,
29
+ o("div", N, [
30
+ Object.entries(e(s).workspace.documents).length ? (r(!0), a(_, { key: 0 }, h(Object.entries(
31
+ e(s).workspace.documents
32
+ ), ([l, n]) => (r(), a("div", {
33
+ key: l,
33
34
  class: "document"
34
35
  }, [
35
- r("button", {
36
- class: x(["documentName", {
37
- documentNameActive: e(o).workspace.activeDocument === l
36
+ o("button", {
37
+ class: C(["documentName", {
38
+ documentNameActive: e(s).workspace.activeDocument === n
38
39
  }]),
39
40
  type: "button",
40
- onClick: (j) => p(a)
41
+ onClick: (B) => g(l)
41
42
  }, [
42
- S(" @" + _(a) + " ", 1),
43
- e(o).workspace.activeDocument === l ? (t(), i(e(N), { key: 0 })) : (t(), i(e(U), { key: 1 }))
44
- ], 10, B),
45
- e(o).workspace.activeDocument === l ? (t(), n("div", L, [
46
- d(b, {
47
- document: l,
48
- name: a
43
+ m(" @" + v(l) + " ", 1),
44
+ e(s).workspace.activeDocument === n ? (r(), c(e(D), { key: 0 })) : (r(), c(e(b), { key: 1 }))
45
+ ], 10, P),
46
+ e(s).workspace.activeDocument === n ? (r(), a("div", T, [
47
+ d(L, {
48
+ document: n,
49
+ name: l
49
50
  }, null, 8, ["document", "name"])
50
- ])) : v("", !0)
51
- ]))), 128)) : (t(), n("div", M, " No APIs selected. Use + to add context. "))
51
+ ])) : y("", !0)
52
+ ]))), 128)) : (r(), a("div", A, " There's no API definition loaded. Use the + button to load APIs. "))
52
53
  ]),
53
- r("div", R, [
54
- s[2] || (s[2] = r("label", { for: "proxyUrl" }, "Proxy URL", -1)),
55
- d(e(h), {
54
+ o("div", E, [
55
+ t[3] || (t[3] = o("label", { for: "proxyUrl" }, "CORS Proxy", -1)),
56
+ o("p", null, [
57
+ t[2] || (t[2] = m(" All requests will be sent through the specified proxy URL to help avoid CORS (Cross-Origin Resource Sharing) issues. ", -1)),
58
+ o("a", {
59
+ class: "underline",
60
+ href: e(p).PROXY_SOURCE_CODE,
61
+ target: "_blank"
62
+ }, " Read more ", 8, I)
63
+ ]),
64
+ d(e(w), {
56
65
  id: "proxyUrl",
57
- modelValue: e(c),
58
- "onUpdate:modelValue": s[0] || (s[0] = (a) => C(c) ? c.value = a : null),
59
- placeholder: "https://proxy.scalar.com"
60
- }, null, 8, ["modelValue"])
66
+ modelValue: e(i),
67
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => R(i) ? i.value = l : null),
68
+ label: "Proxy URL",
69
+ placeholder: e(p).DEFAULT_PROXY_URL
70
+ }, null, 8, ["modelValue", "placeholder"])
61
71
  ])
62
72
  ]),
63
73
  _: 1
@@ -65,5 +75,5 @@ const I = { class: "settingsHeading" }, T = { class: "documentList" }, B = ["onC
65
75
  }
66
76
  });
67
77
  export {
68
- F as default
78
+ z as default
69
79
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Start.vue.d.ts","sourceRoot":"","sources":["../../src/views/Start.vue"],"names":[],"mappings":"AA2MA,QAAA,MAAM,YAAY;;;;;;iFAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"Start.vue.d.ts","sourceRoot":"","sources":["../../src/views/Start.vue"],"names":[],"mappings":"AAqMA,QAAA,MAAM,YAAY;;;;;;iFAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -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 m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-1fbb0eb5"]]);
4
+ const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-56f7e8dd"]]);
5
5
  export {
6
6
  m as default
7
7
  };