@scalar/agent-chat 0.2.5 → 0.2.7

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 (42) hide show
  1. package/dist/api.d.ts +4 -4
  2. package/dist/api.js +1 -1
  3. package/dist/components/ContextItem.vue.d.ts.map +1 -1
  4. package/dist/components/ErrorMessage.vue.js +1 -1
  5. package/dist/components/ErrorMessage.vue2.js +1 -1
  6. package/dist/components/RequestPreview.vue.d.ts.map +1 -1
  7. package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts.map +1 -1
  8. package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts.map +1 -1
  9. package/dist/components/Selector.vue.d.ts +24 -0
  10. package/dist/components/Selector.vue.d.ts.map +1 -0
  11. package/dist/components/Selector.vue.js +67 -0
  12. package/dist/components/Selector.vue2.js +4 -0
  13. package/dist/components/ServerSelector.vue.d.ts +22 -0
  14. package/dist/components/ServerSelector.vue.d.ts.map +1 -0
  15. package/dist/components/ServerSelector.vue.js +57 -0
  16. package/dist/components/ServerSelector.vue2.js +4 -0
  17. package/dist/components/UploadSection.vue.d.ts.map +1 -1
  18. package/dist/entities/error/constants.d.ts +8 -0
  19. package/dist/entities/error/constants.d.ts.map +1 -0
  20. package/dist/entities/error/constants.js +6 -0
  21. package/dist/entities/error/helpers.d.ts +3 -0
  22. package/dist/entities/error/helpers.d.ts.map +1 -0
  23. package/dist/entities/error/helpers.js +9 -0
  24. package/dist/entities/tools/execute-request.d.ts +1 -1
  25. package/dist/entities/tools/execute-request.d.ts.map +1 -1
  26. package/dist/helpers.d.ts +0 -8
  27. package/dist/helpers.d.ts.map +1 -1
  28. package/dist/helpers.js +64 -68
  29. package/dist/package.json +1 -2
  30. package/dist/registry/add-documents-to-store.d.ts.map +1 -1
  31. package/dist/registry/add-documents-to-store.js +24 -23
  32. package/dist/style.css +1 -1
  33. package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts.map +1 -1
  34. package/dist/views/Chat/Messages/AskForAuthentication.vue.js +2 -2
  35. package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +49 -45
  36. package/dist/views/PromptForm.vue.js +2 -2
  37. package/dist/views/PromptForm.vue2.js +5 -5
  38. package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
  39. package/dist/views/Settings/DocSettings.vue.js +2 -2
  40. package/dist/views/Settings/DocSettings.vue2.js +27 -22
  41. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  42. package/package.json +7 -8
@@ -1,83 +1,87 @@
1
- import { defineComponent as k, computed as a, createElementBlock as C, openBlock as r, normalizeClass as E, createElementVNode as v, createBlock as u, createCommentVNode as i, unref as s, withCtx as I, createTextVNode as N, createVNode as P } from "vue";
1
+ import { defineComponent as k, computed as a, createElementBlock as C, openBlock as u, normalizeClass as E, createElementVNode as v, createBlock as s, createCommentVNode as i, unref as l, withCtx as I, createTextVNode as N, createVNode as P } from "vue";
2
2
  import { getSelectedServer as y } from "@scalar/api-client/v2/features/operation";
3
- import { getActiveEnvironment as B } from "@scalar/api-client/v2/helpers";
4
- import { ScalarButton as T } from "@scalar/components";
5
- import { ScalarIconArrowRight as _ } from "@scalar/icons";
6
- import w from "../../../components/AuthenticationProvided.vue.js";
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 w } from "@scalar/icons";
6
+ import x from "../../../components/AuthenticationProvided.vue.js";
7
7
  import O from "../../../components/AuthenticationRequired.vue.js";
8
8
  import { ASK_FOR_AUTHENTICATION_TOOL_NAME as b } from "../../../entities/tools/ask-for-authentication.js";
9
- import { TOOL_NAMESPACE_SLUG_DELIMITER as x } 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 M from "../../Settings/Auth.vue.js";
13
- const R = { class: "toggleButton" }, V = { class: "authContent" }, q = { class: "authContentInner" }, Y = /* @__PURE__ */ k({
9
+ import { TOOL_NAMESPACE_SLUG_DELIMITER as z } from "../../../entities/tools/constants.js";
10
+ import { createDocumentName as L } from "../../../registry/create-document-name.js";
11
+ import { useState as M } from "../../../state/state.js";
12
+ import R from "../../Settings/Auth.vue.js";
13
+ const V = { class: "toggleButton" }, q = { class: "authContent" }, F = { class: "authContentInner" }, Z = /* @__PURE__ */ k({
14
14
  __name: "AskForAuthentication",
15
15
  props: {
16
16
  messagePart: {}
17
17
  },
18
- setup(e) {
19
- const { workspaceStore: d, eventBus: p, config: h, chat: f } = L(), o = a(() => {
20
- if (!e.messagePart.value.input?.uniqueIdentifier || e.messagePart.value.state !== "input-available")
18
+ setup(t) {
19
+ const { workspaceStore: d, eventBus: p, config: h, chat: f } = M(), o = a(() => {
20
+ if (!t.messagePart.value.input?.uniqueIdentifier || t.messagePart.value.state !== "input-available")
21
21
  return;
22
- const [m, n] = e.messagePart.value.input.uniqueIdentifier.split(
23
- x
22
+ const [r, n] = t.messagePart.value.input.uniqueIdentifier.split(
23
+ z
24
24
  );
25
- if (!(!m || !n))
26
- return z(m, n);
27
- }), t = a(() => {
25
+ if (!(!r || !n))
26
+ return L(r, n);
27
+ }), e = a(() => {
28
28
  if (o.value)
29
29
  return d.workspace.documents[o.value];
30
- }), l = a(() => {
31
- if (t.value)
32
- return B(d, t.value);
33
30
  }), c = a(() => {
34
- if (t.value)
35
- return y(t.value);
31
+ if (e.value)
32
+ return B(d, e.value);
33
+ }), m = a(() => {
34
+ if (!e.value)
35
+ return;
36
+ const r = T(e.value.servers, {
37
+ documentUrl: e.value["x-scalar-original-source-url"]
38
+ });
39
+ return y(e.value, r);
36
40
  }), g = a(
37
- () => t?.value?.components?.securitySchemes ?? {}
38
- ), A = a(
39
- () => o.value && l.value && c.value
41
+ () => e?.value?.components?.securitySchemes ?? {}
42
+ ), S = a(
43
+ () => o.value && c.value && m.value
40
44
  );
41
- async function S() {
45
+ async function A() {
42
46
  await f.addToolOutput({
43
- toolCallId: e.messagePart.value.toolCallId,
47
+ toolCallId: t.messagePart.value.toolCallId,
44
48
  output: "Authentication provided.",
45
49
  tool: b,
46
50
  state: "output-available"
47
51
  }), await f.sendMessage();
48
52
  }
49
- return (m, n) => (r(), C("div", {
53
+ return (r, n) => (u(), C("div", {
50
54
  class: E(["askForAuthentication", {
51
- open: A.value
55
+ open: S.value
52
56
  }])
53
57
  }, [
54
- v("div", R, [
55
- e.messagePart.value.state === "output-available" ? (r(), u(w, { key: 0 })) : i("", !0),
56
- e.messagePart.value.state === "input-available" ? (r(), u(O, { key: 1 })) : i("", !0),
57
- e.messagePart.value.state === "input-available" ? (r(), u(s(T), {
58
+ v("div", V, [
59
+ t.messagePart.value.state === "output-available" ? (u(), s(x, { key: 0 })) : i("", !0),
60
+ t.messagePart.value.state === "input-available" ? (u(), s(O, { key: 1 })) : i("", !0),
61
+ t.messagePart.value.state === "input-available" ? (u(), s(l(_), {
58
62
  key: 2,
59
63
  class: "authorizeButton",
60
64
  size: "xs",
61
- onClick: S
65
+ onClick: A
62
66
  }, {
63
67
  default: I(() => [
64
68
  n[0] || (n[0] = N(" Authorize ", -1)),
65
- P(s(_), { weight: "bold" })
69
+ P(l(w), { weight: "bold" })
66
70
  ]),
67
71
  _: 1
68
72
  })) : i("", !0)
69
73
  ]),
70
- v("div", V, [
71
- v("div", q, [
72
- o.value && t.value && l.value && c.value ? (r(), u(M, {
74
+ v("div", q, [
75
+ v("div", F, [
76
+ o.value && e.value && c.value && m.value ? (u(), s(R, {
73
77
  key: 0,
74
- document: t.value,
75
- environment: l.value,
76
- eventBus: s(p),
78
+ document: e.value,
79
+ environment: c.value,
80
+ eventBus: l(p),
77
81
  name: o.value,
78
- options: s(h),
82
+ options: l(h),
79
83
  securitySchemes: g.value,
80
- selectedServer: c.value
84
+ selectedServer: m.value
81
85
  }, null, 8, ["document", "environment", "eventBus", "name", "options", "securitySchemes", "selectedServer"])) : i("", !0)
82
86
  ])
83
87
  ])
@@ -85,5 +89,5 @@ const R = { class: "toggleButton" }, V = { class: "authContent" }, q = { class:
85
89
  }
86
90
  });
87
91
  export {
88
- Y as default
92
+ Z as default
89
93
  };
@@ -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 a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-20596a84"]]);
4
+ const _ = /* @__PURE__ */ r(o, [["__scopeId", "data-v-58345013"]]);
5
5
  export {
6
- a as default
6
+ _ as default
7
7
  };
@@ -6,8 +6,8 @@ import G from "../components/ErrorMessage.vue.js";
6
6
  import J from "../components/PaymentSection.vue.js";
7
7
  import Q from "../components/SearchPopover.vue.js";
8
8
  import W from "../components/UploadSection.vue.js";
9
- import { MAX_PROMPT_SIZE as Y } from "../entities/prompt/constants.js";
10
- import { AgentErrorCodes as tt } from "../helpers.js";
9
+ import { AgentErrorCodes as Y } from "../entities/error/constants.js";
10
+ import { MAX_PROMPT_SIZE as tt } from "../entities/prompt/constants.js";
11
11
  import { useChatApprovals as et } from "../hooks/use-chat-approvals.js";
12
12
  import { useChatError as ot } from "../hooks/use-chat-error.js";
13
13
  import { useChatPendingClientToolParts as at } from "../hooks/use-chat-pending-client-tool-parts.js";
@@ -29,7 +29,7 @@ const lt = { class: "actionContainer" }, rt = ["disabled"], it = { class: "input
29
29
  const P = x;
30
30
  w({ focusPrompt: z });
31
31
  const l = L("agentPrompt"), e = nt(), T = g(() => e.prompt.value.trim().length > 0), I = g(
32
- () => e.prompt.value.trim().length > Y
32
+ () => e.prompt.value.trim().length > tt
33
33
  );
34
34
  y(e.prompt, () => {
35
35
  if (l?.value) {
@@ -79,7 +79,7 @@ const lt = { class: "actionContainer" }, rt = ["disabled"], it = { class: "input
79
79
  onApprove: o[0] || (o[0] = (s) => t(p)(!0)),
80
80
  onReject: o[1] || (o[1] = (s) => t(p)(!1))
81
81
  })) : c("", !0),
82
- t(v)?.code === t(tt).LIMIT_REACHED ? (n(), i(J, {
82
+ t(v)?.code === t(Y).LIMIT_REACHED ? (n(), i(J, {
83
83
  key: 3,
84
84
  onApprove: o[2] || (o[2] = (s) => t(p)(!0)),
85
85
  onReject: o[3] || (o[3] = (s) => t(p)(!1))
@@ -199,7 +199,7 @@ const lt = { class: "actionContainer" }, rt = ["disabled"], it = { class: "input
199
199
  ])
200
200
  ], 32),
201
201
  S(a("div", ht, [...o[8] || (o[8] = [
202
- N('<span data-v-20596a84>Add context from dozens of API&#39;s</span><div class="ml-auto flex items-center gap-1" data-v-20596a84><button class="addAPIContext" type="button" data-v-20596a84><img class="size-4" src="https://cdn.scalar.com/agent/stripe.png" data-v-20596a84></button><button class="addAPIContext" type="button" data-v-20596a84><img class="size-4" src="https://cdn.scalar.com/agent/notion.png" data-v-20596a84></button><button class="addAPIContext" type="button" data-v-20596a84><img class="size-4" src="https://cdn.scalar.com/agent/zoom-meetings.png" data-v-20596a84></button><button class="addAPIContext" type="button" data-v-20596a84><img class="size-4" src="https://cdn.scalar.com/agent/fathom.png" data-v-20596a84></button><button class="addAPIContext" type="button" data-v-20596a84><img class="size-4" src="https://cdn.scalar.com/agent/discord.png" data-v-20596a84></button><button class="addAPIContext" type="button" data-v-20596a84><img class="size-4" src="https://cdn.scalar.com/agent/x.png" data-v-20596a84></button></div>', 2)
202
+ N('<span data-v-58345013>Add context from dozens of API&#39;s</span><div class="ml-auto flex items-center gap-1" data-v-58345013><button class="addAPIContext" type="button" data-v-58345013><img class="size-4" src="https://cdn.scalar.com/agent/stripe.png" data-v-58345013></button><button class="addAPIContext" type="button" data-v-58345013><img class="size-4" src="https://cdn.scalar.com/agent/notion.png" data-v-58345013></button><button class="addAPIContext" type="button" data-v-58345013><img class="size-4" src="https://cdn.scalar.com/agent/zoom-meetings.png" data-v-58345013></button><button class="addAPIContext" type="button" data-v-58345013><img class="size-4" src="https://cdn.scalar.com/agent/fathom.png" data-v-58345013></button><button class="addAPIContext" type="button" data-v-58345013><img class="size-4" src="https://cdn.scalar.com/agent/discord.png" data-v-58345013></button><button class="addAPIContext" type="button" data-v-58345013><img class="size-4" src="https://cdn.scalar.com/agent/x.png" data-v-58345013></button></div>', 2)
203
203
  ])], 512), [
204
204
  [H, t(e).chat.messages.length <= 1]
205
205
  ])
@@ -1 +1 @@
1
- {"version":3,"file":"DocSettings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/DocSettings.vue"],"names":[],"mappings":"AAqEA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAMlF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,IAAI,EAAE,MAAM,CAAA;CACb,CAAC;;AA+FF,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;;AAoGF,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 e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-a9f9e87f"]]);
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d556a3a1"]]);
5
5
  export {
6
- e as default
6
+ p as default
7
7
  };
@@ -1,38 +1,43 @@
1
- import { defineComponent as l, computed as n, createElementBlock as d, openBlock as a, createElementVNode as c, createVNode as m, unref as t } from "vue";
2
- import { getSelectedServer as S } from "@scalar/api-client/v2/features/operation";
3
- import { getActiveEnvironment as f } from "@scalar/api-client/v2/helpers";
4
- import { ServerSelector as p } from "@scalar/api-reference/blocks";
5
- import { useState as B } from "../../state/state.js";
6
- import h from "./Auth.vue.js";
7
- const g = { class: "docSettings" }, C = /* @__PURE__ */ l({
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";
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";
5
+ import { useState as y } from "../../state/state.js";
6
+ import k from "./Auth.vue.js";
7
+ const p = { class: "docSettings" }, C = /* @__PURE__ */ d({
8
8
  __name: "DocSettings",
9
9
  props: {
10
10
  document: {},
11
11
  name: {}
12
12
  },
13
13
  setup(e) {
14
- const { workspaceStore: s, config: u, eventBus: o } = B(), i = n(
15
- () => f(s, e.document)
16
- ), r = n(() => S(e.document)), v = n(
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, {
18
+ documentUrl: e.document["x-scalar-original-source-url"]
19
+ });
20
+ return f(e.document, o);
21
+ }), l = t(
17
22
  () => e.document.components?.securitySchemes ?? {}
18
23
  );
19
- return (y, k) => (a(), d("div", g, [
20
- c("div", null, [
21
- m(t(p), {
22
- eventBus: t(o),
23
- selectedServer: r.value,
24
+ return (o, x) => (S(), a("div", p, [
25
+ s("div", null, [
26
+ m(h, {
27
+ eventBus: n(r),
28
+ selectedServer: c.value,
24
29
  servers: e.document.servers ?? []
25
30
  }, null, 8, ["eventBus", "selectedServer", "servers"])
26
31
  ]),
27
- c("div", null, [
28
- m(h, {
32
+ s("div", null, [
33
+ m(k, {
29
34
  document: e.document,
30
- environment: i.value,
31
- eventBus: t(o),
35
+ environment: v.value,
36
+ eventBus: n(r),
32
37
  name: e.name,
33
- options: t(u),
34
- securitySchemes: v.value,
35
- selectedServer: r.value
38
+ options: n(i),
39
+ securitySchemes: l.value,
40
+ selectedServer: c.value
36
41
  }, null, 8, ["document", "environment", "eventBus", "name", "options", "securitySchemes", "selectedServer"])
37
42
  ])
38
43
  ]));
@@ -1 +1 @@
1
- {"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/Settings.vue"],"names":[],"mappings":"AAwIA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAM3B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAC;;AA8KF,wBAMG"}
1
+ {"version":3,"file":"Settings.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Settings/Settings.vue"],"names":[],"mappings":"AAwIA,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAA;AAM3B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAC;;AA6KF,wBAMG"}
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "git+https://github.com/scalar/scalar.git",
11
11
  "directory": "packages/agent-chat"
12
12
  },
13
- "version": "0.2.5",
13
+ "version": "0.2.7",
14
14
  "engines": {
15
15
  "node": ">=20"
16
16
  },
@@ -50,16 +50,15 @@
50
50
  "vue": "^3.5.26",
51
51
  "whatwg-mimetype": "4.0.0",
52
52
  "zod": "^4.3.5",
53
- "@scalar/api-client": "2.18.4",
54
- "@scalar/components": "0.16.23",
53
+ "@scalar/components": "0.16.30",
54
+ "@scalar/helpers": "0.2.9",
55
55
  "@scalar/icons": "0.5.2",
56
- "@scalar/api-reference": "1.43.8",
57
- "@scalar/json-magic": "0.9.1",
56
+ "@scalar/api-client": "2.20.2",
58
57
  "@scalar/openapi-types": "0.5.3",
59
- "@scalar/types": "0.5.8",
60
- "@scalar/helpers": "0.2.8",
61
58
  "@scalar/themes": "0.13.26",
62
- "@scalar/workspace-store": "0.24.10"
59
+ "@scalar/json-magic": "0.9.3",
60
+ "@scalar/types": "0.5.10",
61
+ "@scalar/workspace-store": "0.26.2"
63
62
  },
64
63
  "devDependencies": {
65
64
  "@tailwindcss/vite": "^4.1.18",