@scalar/agent-chat 0.9.9 → 0.9.11

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 (131) hide show
  1. package/dist/App.vue.d.ts +6 -6
  2. package/dist/api.d.ts +8 -8
  3. package/dist/client-tools/execute-request.d.ts +7 -7
  4. package/dist/components/ErrorMessage.vue.d.ts +1 -1
  5. package/dist/components/RequestPreview.vue.d.ts +1 -1
  6. package/dist/components/ResponseBody/ResponseBody.vue.d.ts +1 -1
  7. package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts +1 -1
  8. package/dist/components/UploadSection.vue.d.ts +1 -1
  9. package/dist/entities/error/helpers.d.ts +1 -1
  10. package/dist/entities/index.d.ts +9 -9
  11. package/dist/entities/index.js +2 -23
  12. package/dist/entities/tools/execute-request.d.ts +1 -1
  13. package/dist/entities-NWeuOkBB.js +28 -0
  14. package/dist/entities-NWeuOkBB.js.map +1 -0
  15. package/dist/hooks/use-chat-approvals.d.ts +1 -1
  16. package/dist/hooks/use-search.d.ts +1 -1
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.js +2064 -3
  19. package/dist/index.js.map +1 -0
  20. package/dist/package.json +3 -5
  21. package/dist/registry/add-documents-to-store.d.ts +5 -5
  22. package/dist/state/state.d.ts +7 -7
  23. package/dist/style.css +2 -1
  24. package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts +2 -2
  25. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +2 -2
  26. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts +2 -2
  27. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts +2 -2
  28. package/package.json +15 -17
  29. package/dist/App.vue.js +0 -43
  30. package/dist/App.vue2.js +0 -4
  31. package/dist/Chat.vue.js +0 -55
  32. package/dist/Chat.vue2.js +0 -4
  33. package/dist/_virtual/_plugin-vue_export-helper.js +0 -9
  34. package/dist/api.js +0 -99
  35. package/dist/client-tools/execute-request.js +0 -98
  36. package/dist/components/ActionsDropdown.vue.js +0 -7
  37. package/dist/components/ActionsDropdown.vue2.js +0 -50
  38. package/dist/components/ApprovalSection.vue.js +0 -7
  39. package/dist/components/ApprovalSection.vue2.js +0 -33
  40. package/dist/components/AuthenticationProvided.vue.js +0 -13
  41. package/dist/components/AuthenticationRequired.vue.js +0 -13
  42. package/dist/components/AutosendPaused.vue.js +0 -13
  43. package/dist/components/BuildingRequest.vue.js +0 -24
  44. package/dist/components/ContextItem.vue.js +0 -7
  45. package/dist/components/ContextItem.vue2.js +0 -19
  46. package/dist/components/ErrorMessage.vue.js +0 -7
  47. package/dist/components/ErrorMessage.vue2.js +0 -25
  48. package/dist/components/FreeMessagesInfoSection.vue.js +0 -7
  49. package/dist/components/FreeMessagesInfoSection.vue2.js +0 -51
  50. package/dist/components/LoadingMiniOpenAPIDoc.vue.js +0 -14
  51. package/dist/components/LoadingOpenAPISpecsSummary.vue.js +0 -14
  52. package/dist/components/Logo.vue.js +0 -23
  53. package/dist/components/PaymentSection.vue.js +0 -7
  54. package/dist/components/PaymentSection.vue2.js +0 -30
  55. package/dist/components/RequestApproved.vue.js +0 -13
  56. package/dist/components/RequestFailed.vue.js +0 -24
  57. package/dist/components/RequestPreview.vue.js +0 -7
  58. package/dist/components/RequestPreview.vue2.js +0 -129
  59. package/dist/components/RequestRejected.vue.js +0 -22
  60. package/dist/components/RequestSuccess.vue.js +0 -13
  61. package/dist/components/ResponseBody/ResponseBody.vue.js +0 -41
  62. package/dist/components/ResponseBody/ResponseBody.vue2.js +0 -4
  63. package/dist/components/ResponseBody/ResponseBodyInfo.vue.js +0 -14
  64. package/dist/components/ResponseBody/ResponseBodyPreview.vue.js +0 -7
  65. package/dist/components/ResponseBody/ResponseBodyPreview.vue2.js +0 -65
  66. package/dist/components/ResponseBody/ResponseBodyRaw.vue.js +0 -20
  67. package/dist/components/ResponseBody/ResponseBodyRaw.vue2.js +0 -4
  68. package/dist/components/ResponseBody/ResponseBodyToggle.vue.js +0 -26
  69. package/dist/components/ResponseBody/ResponseBodyToggle.vue2.js +0 -4
  70. package/dist/components/ResponseBody/helpers/media-types.js +0 -129
  71. package/dist/components/ResponseBody/helpers/process-response-body.js +0 -33
  72. package/dist/components/SearchPopover.vue.js +0 -7
  73. package/dist/components/SearchPopover.vue2.js +0 -67
  74. package/dist/components/Selector.vue.js +0 -67
  75. package/dist/components/Selector.vue2.js +0 -4
  76. package/dist/components/SendingRequest.vue.js +0 -24
  77. package/dist/components/ServerSelector.vue.js +0 -63
  78. package/dist/components/ServerSelector.vue2.js +0 -4
  79. package/dist/components/UploadSection.vue.js +0 -7
  80. package/dist/components/UploadSection.vue2.js +0 -61
  81. package/dist/consts/urls.js +0 -10
  82. package/dist/entities/error/constants.js +0 -6
  83. package/dist/entities/error/helpers.js +0 -9
  84. package/dist/entities/prompt/constants.js +0 -4
  85. package/dist/entities/registry/document.js +0 -12
  86. package/dist/entities/tools/ask-for-authentication.js +0 -8
  87. package/dist/entities/tools/constants.js +0 -4
  88. package/dist/entities/tools/execute-request.js +0 -12
  89. package/dist/entities/tools/get-mini-openapi-spec.js +0 -8
  90. package/dist/entities/tools/get-openapi-spec-summary.js +0 -4
  91. package/dist/helpers.js +0 -67
  92. package/dist/hooks/use-agent-key-documents.js +0 -21
  93. package/dist/hooks/use-chat-approvals.js +0 -35
  94. package/dist/hooks/use-chat-error.js +0 -23
  95. package/dist/hooks/use-chat-pending-client-tool-parts.js +0 -12
  96. package/dist/hooks/use-chat-scroll.js +0 -16
  97. package/dist/hooks/use-curated-documents.js +0 -12
  98. package/dist/hooks/use-search.js +0 -21
  99. package/dist/hooks/use-signup-link.js +0 -12
  100. package/dist/hooks/use-term-and-conditions.js +0 -15
  101. package/dist/hooks/use-upload-tmp-document.js +0 -94
  102. package/dist/plugins/persistance.js +0 -23
  103. package/dist/registry/add-documents-to-store.js +0 -44
  104. package/dist/registry/create-document-name.js +0 -6
  105. package/dist/state/state.js +0 -200
  106. package/dist/views/Catalog/Catalog.vue.js +0 -8
  107. package/dist/views/Catalog/Catalog.vue2.js +0 -70
  108. package/dist/views/Chat/Chat.vue.js +0 -7
  109. package/dist/views/Chat/Chat.vue2.js +0 -78
  110. package/dist/views/Chat/Messages/AskForAuthentication.vue.js +0 -7
  111. package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +0 -91
  112. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +0 -7
  113. package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +0 -24
  114. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js +0 -7
  115. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js +0 -56
  116. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js +0 -26
  117. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue2.js +0 -4
  118. package/dist/views/Chat/Messages/Text.vue.js +0 -16
  119. package/dist/views/Chat/Messages/Text.vue2.js +0 -4
  120. package/dist/views/Layout.vue.js +0 -7
  121. package/dist/views/Layout.vue2.js +0 -25
  122. package/dist/views/PromptForm.vue.js +0 -7
  123. package/dist/views/PromptForm.vue2.js +0 -254
  124. package/dist/views/Settings/Auth.vue.js +0 -67
  125. package/dist/views/Settings/Auth.vue2.js +0 -4
  126. package/dist/views/Settings/DocSettings.vue.js +0 -7
  127. package/dist/views/Settings/DocSettings.vue2.js +0 -49
  128. package/dist/views/Settings/Settings.vue.js +0 -8
  129. package/dist/views/Settings/Settings.vue2.js +0 -79
  130. package/dist/views/Start.vue.js +0 -7
  131. package/dist/views/Start.vue2.js +0 -43
@@ -1,200 +0,0 @@
1
- import { Chat as k } from "@ai-sdk/vue";
2
- import { useModal as q } from "@scalar/components";
3
- import { redirectToProxy as M } from "@scalar/helpers/url/redirect-to-proxy";
4
- import { apiReferenceConfigurationSchema as z } from "@scalar/types/api-reference";
5
- import { useToasts as H } from "@scalar/use-toasts";
6
- import { createWorkspaceStore as Q } from "@scalar/workspace-store/client";
7
- import { createWorkspaceEventBus as J } from "@scalar/workspace-store/events";
8
- import { DefaultChatTransport as V, lastAssistantMessageIsCompleteWithToolCalls as Z } from "ai";
9
- import { n as K } from "neverpanic";
10
- import { ref as h, reactive as tt, computed as $, watch as C, inject as ot } from "vue";
11
- import { createApi as et, createAuthorizationHeaders as rt } from "../api.js";
12
- import { executeRequestTool as nt } from "../client-tools/execute-request.js";
13
- import { URLS as N } from "../consts/urls.js";
14
- import { EXECUTE_CLIENT_SIDE_REQUEST_TOOL_NAME as at } from "../entities/tools/execute-request.js";
15
- import { createDocumentSettings as x } from "../helpers.js";
16
- import { useTermsAndConditions as ct } from "../hooks/use-term-and-conditions.js";
17
- import { removeTmpDocFromLocalStorage as st } from "../hooks/use-upload-tmp-document.js";
18
- import { persistencePlugin as it } from "../plugins/persistance.js";
19
- import { loadDocument as I } from "../registry/add-documents-to-store.js";
20
- import { createDocumentName as mt } from "../registry/create-document-name.js";
21
- import { createError as ut } from "../entities/error/helpers.js";
22
- const ft = /* @__PURE__ */ Symbol("STATE_SYMBOL"), { toast: y } = H();
23
- function dt({
24
- registryDocuments: s,
25
- workspaceStore: i,
26
- baseUrl: v,
27
- proxyUrl: a,
28
- getAccessToken: T,
29
- getAgentKey: E
30
- }) {
31
- const m = new k({
32
- sendAutomaticallyWhen: Z,
33
- transport: new V({
34
- api: M(a.value, `${v}/vector/openapi/chat`),
35
- headers: () => rt({ getAccessToken: T, getAgentKey: E }),
36
- body: () => ({
37
- registryDocuments: s.value,
38
- documentSettings: x(i)
39
- })
40
- }),
41
- async onToolCall({ toolCall: r }) {
42
- r.dynamic || r.toolName === at && r.input.method.toLowerCase() === "get" && await nt({
43
- documentSettings: x(i),
44
- input: r.input,
45
- toolCallId: r.toolCallId,
46
- chat: m,
47
- proxyUrl: a.value
48
- });
49
- }
50
- });
51
- return m;
52
- }
53
- function It({
54
- initialRegistryDocuments: s,
55
- registryUrl: i,
56
- dashboardUrl: v,
57
- baseUrl: a,
58
- mode: T,
59
- isLoggedIn: E,
60
- getAccessToken: m,
61
- getAgentKey: r,
62
- getActiveDocumentJson: O,
63
- prefilledMessageRef: w,
64
- hideAddApi: G
65
- }) {
66
- const D = h(w?.value ?? ""), n = h([]), f = tt({}), B = h([]), U = h(N.DEFAULT_PROXY_URL), d = $(() => U.value?.trim() || N.DEFAULT_PROXY_URL), F = h(), g = ct(), P = J(), p = Q({
67
- plugins: [
68
- it({
69
- persistAuth: !0
70
- })
71
- ]
72
- }), S = $(
73
- () => z.parse({
74
- proxyUrl: d.value,
75
- persistAuth: !0
76
- })
77
- ), c = dt({
78
- registryDocuments: n,
79
- workspaceStore: p,
80
- baseUrl: a,
81
- proxyUrl: d,
82
- getAccessToken: m,
83
- getAgentKey: r
84
- }), _ = et({
85
- baseUrl: a,
86
- proxyUrl: d,
87
- getAccessToken: m,
88
- getAgentKey: r
89
- }), W = $(
90
- () => c.status === "submitted" || c.status === "streaming" && !c.lastMessage?.parts.some((t) => t.type === "text")
91
- );
92
- C(
93
- () => c.status,
94
- () => {
95
- c.status === "streaming" && (D.value = "");
96
- }
97
- ), w && C(w, async (t) => {
98
- t && (D.value = t, g.accepted.value && await c.sendMessage({ text: D.value }));
99
- });
100
- const Y = q();
101
- async function L({
102
- namespace: t,
103
- slug: o,
104
- removable: u = !0,
105
- tmp: b = !1
106
- }) {
107
- if (n.value.find((R) => R.namespace === t && R.slug === o))
108
- return;
109
- const l = `@${t}/${o}`;
110
- f[l] = !0;
111
- const e = await I({
112
- namespace: t,
113
- slug: o,
114
- workspaceStore: p,
115
- registryUrl: i,
116
- registryDocuments: n,
117
- config: S.value,
118
- api: _,
119
- removable: u
120
- });
121
- if (f[l] = !1, !e.success)
122
- throw b ? (st(), e.error) : (console.warn("[AGENT]: Unable to load document", e.error), y(`Unable to load the document @${t}/${o}`, "warn"), e.error);
123
- }
124
- async function X({
125
- namespace: t,
126
- slug: o,
127
- removable: u = !0
128
- }) {
129
- if (n.value.find((e) => e.namespace === t && e.slug === o))
130
- return;
131
- const A = `@${t}/${o}`;
132
- f[A] = !0;
133
- const l = await K.fromUnsafe(
134
- () => fetch(M(d.value, `${a}/vector/registry/embeddings/${t}/${o}`), {
135
- method: "GET"
136
- }),
137
- (e) => ut("FAILED_TO_GET_EMBEDDING_STATUS", e)
138
- );
139
- if (l.success && l.data.ok) {
140
- const e = await I({
141
- namespace: t,
142
- slug: o,
143
- workspaceStore: p,
144
- registryUrl: i,
145
- registryDocuments: n,
146
- config: S.value,
147
- api: _,
148
- removable: u
149
- });
150
- e.success || (console.warn("[AGENT]: Unable to load document", e.error), y(`Unable to load the document @${t}/${o}`, "warn"));
151
- } else
152
- console.warn("[AGENT]: Document could not be embedded"), y(`Unable to embed the document @${t}/${o}`, "warn");
153
- f[A] = !1;
154
- }
155
- function j({ namespace: t, slug: o }) {
156
- n.value = n.value.filter(
157
- (u) => !(u.namespace === t && u.slug === o)
158
- ), p.deleteDocument(mt(t, o));
159
- }
160
- return s.forEach(({ namespace: t, slug: o }) => L({ namespace: t, slug: o, removable: !1 })), {
161
- prompt: D,
162
- chat: c,
163
- workspaceStore: p,
164
- eventBus: P,
165
- loading: W,
166
- settingsModal: Y,
167
- config: S,
168
- registryUrl: i,
169
- dashboardUrl: v,
170
- baseUrl: a,
171
- registryDocuments: n,
172
- pendingDocuments: f,
173
- proxyUrl: d,
174
- proxyUrlRaw: U,
175
- mode: T,
176
- terms: g,
177
- isLoggedIn: E,
178
- addDocument: L,
179
- addDocumentAsync: X,
180
- removeDocument: j,
181
- getAccessToken: m,
182
- getAgentKey: r,
183
- api: _,
184
- uploadedTmpDocumentUrl: F,
185
- curatedDocuments: B,
186
- getActiveDocumentJson: O,
187
- hideAddApi: G
188
- };
189
- }
190
- function Mt() {
191
- const s = ot(ft);
192
- if (!s)
193
- throw new Error("No state provided.");
194
- return s;
195
- }
196
- export {
197
- ft as STATE_SYMBOL,
198
- It as createState,
199
- Mt as useState
200
- };
@@ -1,8 +0,0 @@
1
- import o from "./Catalog.vue2.js";
2
- /* empty css */
3
- /* empty css */
4
- import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-bc24f891"]]);
6
- export {
7
- f as default
8
- };
@@ -1,70 +0,0 @@
1
- import { defineComponent as p, computed as _, createBlock as m, openBlock as s, unref as a, withCtx as g, createVNode as h, createElementBlock as c, createCommentVNode as f, Fragment as v, renderList as k, createElementVNode as l, toDisplayString as r } from "vue";
2
- import { ScalarModal as y, ScalarSearchInput as S, ScalarIcon as V } from "@scalar/components";
3
- import { useSearch as C } from "../../hooks/use-search.js";
4
- import { useState as b } from "../../state/state.js";
5
- const x = {
6
- key: 0,
7
- class: "catalog custom-scroll"
8
- }, B = ["onClick"], D = { class: "left" }, I = ["src"], N = { class: "right" }, U = { class: "item-top" }, q = { class: "version" }, E = { class: "description" }, L = /* @__PURE__ */ p({
9
- __name: "Catalog",
10
- props: {
11
- modal: {}
12
- },
13
- setup(u) {
14
- const n = C(), d = b(), i = _(
15
- () => n.results.value.filter((t) => !d.registryDocuments.value.some(
16
- (o) => o.namespace === t.namespace && o.slug === t.slug
17
- )).map((t) => ({
18
- ...t,
19
- label: t.title,
20
- id: t.id
21
- }))
22
- );
23
- return (t, o) => (s(), m(a(y), {
24
- class: "catalogModal",
25
- state: u.modal
26
- }, {
27
- default: g(() => [
28
- h(a(S), {
29
- autofocus: "",
30
- class: "searchInput",
31
- modelValue: a(n).query.value,
32
- "onUpdate:modelValue": o[0] || (o[0] = (e) => a(n).query.value = e ?? "")
33
- }, null, 8, ["modelValue"]),
34
- i.value.length ? (s(), c("div", x, [
35
- (s(!0), c(v, null, k(i.value, (e) => (s(), c("button", {
36
- key: e.id,
37
- class: "item",
38
- type: "button",
39
- onClick: () => {
40
- a(d).addDocument(e), u.modal.hide();
41
- }
42
- }, [
43
- l("div", D, [
44
- e.logoUrl ? (s(), c("img", {
45
- key: 0,
46
- class: "logo",
47
- src: e.logoUrl
48
- }, null, 8, I)) : (s(), m(a(V), {
49
- key: 1,
50
- class: "logo",
51
- logo: "Openapi"
52
- }))
53
- ]),
54
- l("div", N, [
55
- l("div", U, [
56
- l("span", null, r(e.title), 1),
57
- l("span", q, "v" + r(e.currentVersion), 1)
58
- ]),
59
- l("span", E, " @" + r(e.namespace) + "/" + r(e.slug), 1)
60
- ])
61
- ], 8, B))), 128))
62
- ])) : f("", !0)
63
- ]),
64
- _: 1
65
- }, 8, ["state"]));
66
- }
67
- });
68
- export {
69
- L as default
70
- };
@@ -1,7 +0,0 @@
1
- import o from "./Chat.vue2.js";
2
- /* empty css */
3
- import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-db4ff6c9"]]);
5
- export {
6
- m as default
7
- };
@@ -1,78 +0,0 @@
1
- import { defineComponent as y, createElementBlock as o, openBlock as t, Fragment as i, createElementVNode as _, renderList as p, unref as n, createCommentVNode as s, toDisplayString as P, createBlock as u, toRef as a, reactive as d, createVNode as A } from "vue";
2
- import { ASK_FOR_AUTHENTICATION_TOOL_NAME as k } from "../../entities/tools/ask-for-authentication.js";
3
- import { EXECUTE_CLIENT_SIDE_REQUEST_TOOL_NAME as T } from "../../entities/tools/execute-request.js";
4
- import { GET_MINI_OPENAPI_SPEC_TOOL_NAME as N } from "../../entities/tools/get-mini-openapi-spec.js";
5
- import { GET_OPENAPI_SPECS_SUMMARY_TOOL_NAME as O } from "../../entities/tools/get-openapi-spec-summary.js";
6
- import { useState as g } from "../../state/state.js";
7
- import S from "./Messages/AskForAuthentication.vue.js";
8
- import C from "./Messages/ExecuteRequestTool.vue.js";
9
- import I from "./Messages/GetMiniOpenAPIDocTool.vue.js";
10
- import M from "./Messages/GetOpenAPISpecsSummary.vue.js";
11
- import v from "./Messages/Text.vue.js";
12
- import $ from "../PromptForm.vue.js";
13
- const h = { class: "chat" }, x = { key: 0 }, L = { class: "formContainer" }, Y = /* @__PURE__ */ y({
14
- __name: "Chat",
15
- emits: ["submit", "uploadApi"],
16
- setup(R, { emit: f }) {
17
- const E = f, c = g();
18
- return (U, m) => (t(), o(i, null, [
19
- _("div", h, [
20
- (t(!0), o(i, null, p(n(c).chat.messages, (r) => (t(), o(i, {
21
- key: r.id
22
- }, [
23
- r.role === "user" ? (t(!0), o(i, { key: 0 }, p(r.parts, (e, l) => (t(), o("div", {
24
- key: `${r.id}-${l}`,
25
- class: "userMessage"
26
- }, [
27
- e.type === "text" ? (t(), o("p", x, P(e.text), 1)) : s("", !0)
28
- ]))), 128)) : s("", !0),
29
- r.role === "assistant" ? (t(!0), o(i, { key: 1 }, p(r.parts, (e, l) => (t(), o("div", {
30
- key: `${r.id}-${l}`
31
- }, [
32
- e.type === "text" ? (t(), u(v, {
33
- key: 0,
34
- messagePart: a(e)
35
- }, null, 8, ["messagePart"])) : s("", !0),
36
- e.type.endsWith(n(T)) ? (t(), u(C, {
37
- key: 1,
38
- messagePart: a(
39
- e
40
- )
41
- }, null, 8, ["messagePart"])) : s("", !0),
42
- e.type.endsWith(n(N)) ? (t(), u(I, {
43
- key: 2,
44
- message: d(r),
45
- messagePart: a(
46
- e
47
- )
48
- }, null, 8, ["message", "messagePart"])) : s("", !0),
49
- e.type.endsWith(n(O)) ? (t(), u(M, {
50
- key: 3,
51
- message: d(r),
52
- messagePart: a(
53
- e
54
- )
55
- }, null, 8, ["message", "messagePart"])) : s("", !0),
56
- e.type.endsWith(n(k)) ? (t(), u(S, {
57
- key: 4,
58
- message: d(r),
59
- messagePart: a(
60
- e
61
- )
62
- }, null, 8, ["message", "messagePart"])) : s("", !0)
63
- ]))), 128)) : s("", !0)
64
- ], 64))), 128)),
65
- m[2] || (m[2] = _("div", { class: "spacer" }, null, -1))
66
- ]),
67
- _("div", L, [
68
- A($, {
69
- onSubmit: m[0] || (m[0] = (r) => E("submit")),
70
- onUploadApi: m[1] || (m[1] = (r) => E("uploadApi"))
71
- })
72
- ])
73
- ], 64));
74
- }
75
- });
76
- export {
77
- Y as default
78
- };
@@ -1,7 +0,0 @@
1
- import o from "./AskForAuthentication.vue2.js";
2
- /* empty css */
3
- import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const i = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8af07610"]]);
5
- export {
6
- i as default
7
- };
@@ -1,91 +0,0 @@
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
- import { getSelectedServer as P } from "@scalar/api-client/v2/features/operation";
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
- import O from "../../../components/AuthenticationProvided.vue.js";
7
- import b from "../../../components/AuthenticationRequired.vue.js";
8
- import { ASK_FOR_AUTHENTICATION_TOOL_NAME as w } from "../../../entities/tools/ask-for-authentication.js";
9
- import { TOOL_NAMESPACE_SLUG_DELIMITER as y } from "../../../entities/tools/constants.js";
10
- import { createDocumentName as z } from "../../../registry/create-document-name.js";
11
- import { useState as L } from "../../../state/state.js";
12
- import R from "../../Settings/Auth.vue.js";
13
- const V = { class: "toggleButton" }, q = { class: "authContent" }, F = { class: "authContentInner" }, Y = /* @__PURE__ */ S({
14
- __name: "AskForAuthentication",
15
- props: {
16
- messagePart: {}
17
- },
18
- setup(t) {
19
- const { workspaceStore: c, eventBus: f, config: p, chat: h } = L(), a = n(() => {
20
- if (!t.messagePart.value.input?.uniqueIdentifier || t.messagePart.value.state !== "input-available")
21
- return;
22
- const [r, o] = t.messagePart.value.input.uniqueIdentifier.split(
23
- y
24
- );
25
- if (!(!r || !o))
26
- return z(r, o);
27
- }), e = n(() => {
28
- if (a.value)
29
- return c.workspace.documents[a.value];
30
- }), m = n(() => {
31
- if (e.value)
32
- return B(c, e.value);
33
- }), v = n(() => {
34
- if (!e.value)
35
- return;
36
- const r = x(e.value.servers, {
37
- documentUrl: e.value["x-scalar-original-source-url"]
38
- });
39
- return P(r, e.value["x-scalar-selected-server"]);
40
- }), g = n(
41
- () => a.value && m.value && v.value
42
- );
43
- async function A() {
44
- await h.addToolOutput({
45
- toolCallId: t.messagePart.value.toolCallId,
46
- output: "Authentication provided.",
47
- tool: w,
48
- state: "output-available"
49
- });
50
- }
51
- return (r, o) => (u(), k("div", {
52
- class: C(["askForAuthentication", {
53
- open: g.value
54
- }])
55
- }, [
56
- d("div", V, [
57
- t.messagePart.value.state === "output-available" ? (u(), l(O, { key: 0 })) : s("", !0),
58
- t.messagePart.value.state === "input-available" ? (u(), l(b, { key: 1 })) : s("", !0),
59
- t.messagePart.value.state === "input-available" ? (u(), l(i(T), {
60
- key: 2,
61
- class: "authorizeButton",
62
- size: "xs",
63
- onClick: A
64
- }, {
65
- default: E(() => [
66
- o[0] || (o[0] = I(" Authorize ", -1)),
67
- N(i(_), { weight: "bold" })
68
- ]),
69
- _: 1
70
- })) : s("", !0)
71
- ]),
72
- d("div", q, [
73
- d("div", F, [
74
- a.value && e.value && m.value && v.value ? (u(), l(R, {
75
- key: 0,
76
- authStore: i(c).auth,
77
- document: e.value,
78
- environment: m.value,
79
- eventBus: i(f),
80
- name: a.value,
81
- options: i(p),
82
- selectedServer: v.value
83
- }, null, 8, ["authStore", "document", "environment", "eventBus", "name", "options", "selectedServer"])) : s("", !0)
84
- ])
85
- ])
86
- ], 2));
87
- }
88
- });
89
- export {
90
- Y as default
91
- };
@@ -1,7 +0,0 @@
1
- import o from "./ExecuteRequestTool.vue2.js";
2
- /* empty css */
3
- import t from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3e825a81"]]);
5
- export {
6
- m as default
7
- };
@@ -1,24 +0,0 @@
1
- import { defineComponent as u, computed as r, createElementBlock as o, openBlock as a, createBlock as n, createCommentVNode as l } from "vue";
2
- import m from "../../../components/RequestPreview.vue.js";
3
- import { requestPartRequiresApproval as i } from "../../../hooks/use-chat-approvals.js";
4
- import { useState as c } from "../../../state/state.js";
5
- const v = { class: "executeRequestTool" }, R = /* @__PURE__ */ u({
6
- __name: "ExecuteRequestTool",
7
- props: {
8
- messagePart: {}
9
- },
10
- setup(e) {
11
- const s = c(), t = r(() => e.messagePart.value.state === "input-streaming" ? "buildingRequest" : e.messagePart.value.state === "approval-responded" && s.chat.status === "submitted" ? "sendingRequest" : i(e.messagePart.value) ? "requiresApproval" : e.messagePart.value.state === "output-available" ? e.messagePart.value.output.success ? "requestSucceeded" : "requestFailed" : e.messagePart.value.state === "output-error" ? "rejected" : null);
12
- return (d, q) => (a(), o("div", v, [
13
- t.value ? (a(), n(m, {
14
- key: 0,
15
- request: e.messagePart.value.input,
16
- response: e.messagePart.value.output,
17
- state: t.value
18
- }, null, 8, ["request", "response", "state"])) : l("", !0)
19
- ]));
20
- }
21
- });
22
- export {
23
- R as default
24
- };
@@ -1,7 +0,0 @@
1
- import o from "./GetMiniOpenAPIDocTool.vue2.js";
2
- /* empty css */
3
- import e from "../../../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ e(o, [["__scopeId", "data-v-ecee6203"]]);
5
- export {
6
- c as default
7
- };
@@ -1,56 +0,0 @@
1
- import { defineComponent as c, ref as d, watch as g, computed as f, createElementBlock as n, openBlock as o, Fragment as l, createCommentVNode as i, unref as p, createVNode as v, renderList as C, createBlock as P, withCtx as h, createTextVNode as x, toDisplayString as I } from "vue";
2
- import k from "../../../components/ContextItem.vue.js";
3
- import y from "../../../components/LoadingMiniOpenAPIDoc.vue.js";
4
- import { getOperations as B } from "../../../helpers.js";
5
- import { useState as O } from "../../../state/state.js";
6
- const D = { key: 0 }, N = {
7
- key: 1,
8
- class: "operations"
9
- }, L = /* @__PURE__ */ c({
10
- __name: "GetMiniOpenAPIDocTool",
11
- props: {
12
- messagePart: {},
13
- message: {}
14
- },
15
- setup(e) {
16
- const r = d(!1);
17
- g(
18
- () => e.message,
19
- () => {
20
- const a = e.message.parts, s = a.findIndex(
21
- (t) => "toolCallId" in t && t.toolCallId === e.messagePart.value.toolCallId
22
- );
23
- r.value = !!a[s + 1];
24
- }
25
- );
26
- const u = f(() => {
27
- if (!e.messagePart.value.output?.structuredContent)
28
- return;
29
- const a = e.messagePart.value.output?.structuredContent?.info?.title;
30
- return B(
31
- e.messagePart.value.output?.structuredContent
32
- ).map(
33
- (t) => `${a ? `${a} - ` : ""}${t.summary ?? ""}`
34
- ).filter(Boolean);
35
- }), m = O();
36
- return (a, s) => (o(), n(l, null, [
37
- e.messagePart.value.state === "input-available" && p(m).chat.status === "streaming" ? (o(), n("div", D, [
38
- v(y)
39
- ])) : i("", !0),
40
- u.value ? (o(), n("div", N, [
41
- (o(!0), n(l, null, C(u.value, (t) => (o(), P(k, {
42
- key: t,
43
- loading: !r.value
44
- }, {
45
- default: h(() => [
46
- x(I(t), 1)
47
- ]),
48
- _: 2
49
- }, 1032, ["loading"]))), 128))
50
- ])) : i("", !0)
51
- ], 64));
52
- }
53
- });
54
- export {
55
- L as default
56
- };
@@ -1,26 +0,0 @@
1
- import { defineComponent as n, ref as m, watch as l, createElementBlock as r, createCommentVNode as c, openBlock as d, createVNode as i } from "vue";
2
- import u from "../../../components/LoadingOpenAPISpecsSummary.vue.js";
3
- const p = { key: 0 }, I = /* @__PURE__ */ n({
4
- __name: "GetOpenAPISpecsSummary",
5
- props: {
6
- messagePart: {},
7
- message: {}
8
- },
9
- setup(e) {
10
- const t = m(!1);
11
- return l(
12
- () => e.message,
13
- () => {
14
- const a = e.message.parts, o = a.findIndex(
15
- (s) => "toolCallId" in s && s.toolCallId === e.messagePart.value.toolCallId
16
- );
17
- t.value = !!a[o + 1];
18
- }
19
- ), (a, o) => t.value ? c("", !0) : (d(), r("div", p, [
20
- i(u)
21
- ]));
22
- }
23
- });
24
- export {
25
- I as default
26
- };
@@ -1,4 +0,0 @@
1
- import f from "./GetOpenAPISpecsSummary.vue.js";
2
- export {
3
- f as default
4
- };
@@ -1,16 +0,0 @@
1
- import { defineComponent as a, createBlock as r, openBlock as t, unref as o } from "vue";
2
- import { ScalarMarkdown as n } from "@scalar/components";
3
- const u = /* @__PURE__ */ a({
4
- __name: "Text",
5
- props: {
6
- messagePart: {}
7
- },
8
- setup(e) {
9
- return (c, l) => (t(), r(o(n), {
10
- value: e.messagePart.value.text
11
- }, null, 8, ["value"]));
12
- }
13
- });
14
- export {
15
- u as default
16
- };
@@ -1,4 +0,0 @@
1
- import f from "./Text.vue.js";
2
- export {
3
- f as default
4
- };
@@ -1,7 +0,0 @@
1
- import o from "./Layout.vue2.js";
2
- /* empty css */
3
- import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-f1eee0af"]]);
5
- export {
6
- r as default
7
- };
@@ -1,25 +0,0 @@
1
- import { defineComponent as r, createElementBlock as u, openBlock as n, createBlock as i, unref as m } from "vue";
2
- import { useState as a } from "../state/state.js";
3
- import l from "./Chat/Chat.vue.js";
4
- import d from "./Start.vue.js";
5
- const f = { class: "wrapper" }, $ = /* @__PURE__ */ r({
6
- __name: "Layout",
7
- emits: ["submit", "uploadApi"],
8
- setup(b, { emit: p }) {
9
- const e = p, { chat: o } = a();
10
- return (k, t) => (n(), u("div", f, [
11
- m(o).messages.length && (m(o).messages.length > 1 || m(o).status !== "submitted") ? (n(), i(l, {
12
- key: 0,
13
- onSubmit: t[0] || (t[0] = (s) => e("submit")),
14
- onUploadApi: t[1] || (t[1] = (s) => e("uploadApi"))
15
- })) : (n(), i(d, {
16
- key: 1,
17
- onSubmit: t[2] || (t[2] = (s) => e("submit")),
18
- onUploadApi: t[3] || (t[3] = (s) => e("uploadApi"))
19
- }))
20
- ]));
21
- }
22
- });
23
- export {
24
- $ as default
25
- };
@@ -1,7 +0,0 @@
1
- import o from "./PromptForm.vue2.js";
2
- /* empty css */
3
- import r from "../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e7c7c266"]]);
5
- export {
6
- c as default
7
- };