@scalar/agent-chat 0.2.5 → 0.2.6

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.
@@ -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 +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.6",
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/api-client": "2.20.2",
54
+ "@scalar/components": "0.16.30",
55
+ "@scalar/json-magic": "0.9.3",
56
+ "@scalar/helpers": "0.2.9",
55
57
  "@scalar/icons": "0.5.2",
56
- "@scalar/api-reference": "1.43.8",
57
- "@scalar/json-magic": "0.9.1",
58
58
  "@scalar/openapi-types": "0.5.3",
59
- "@scalar/types": "0.5.8",
60
- "@scalar/helpers": "0.2.8",
61
59
  "@scalar/themes": "0.13.26",
62
- "@scalar/workspace-store": "0.24.10"
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",