@scalar/agent-chat 0.3.3 → 0.3.4

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 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAGpE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gFAAgF,CAAA;AAE7H,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACrB,MAAM,8DAA8D,CAAA;AACrE,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,8DAA8D,CAAA;AAErE,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,GACwB,eAAe,EAAE,CACxG;AAyBD,sDAAsD;AACtD,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,cAAc;;;;;EAgBpE;AAKD;;;;GAIG;AACH,eAAO,MAAM,WAAW;IAYpB;;OAEG;uBACgB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIzB;;;OAGG;uBACgB,MAAM,SAAS,eAAe;IAGjD;;OAEG;+BACwB,MAAM;;;;;;IAIjC;;;OAGG;+BACwB,MAAM,SAAS,uBAAuB;CAIpE,CAAA;AAgDD;;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;;;OAGG;uBACgB,MAAM,SAAS,eAAe;IAGjD;;OAEG;+BACwB,MAAM;;;;;;IAIjC;;;OAGG;+BACwB,MAAM,SAAS,uBAAuB;CAIpE,CAAA;AAgDD;;;;;;;;GAQG;AACH,eAAO,MAAM,6BAA6B,GAAI,mCAG3C;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,cAAc,CAAA;CAC/B,KAAG,IAuCH,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,OAM1C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,UAmB7C"}
package/dist/helpers.js CHANGED
@@ -4,7 +4,7 @@ import { isObject as l } from "@scalar/helpers/object/is-object";
4
4
  import { REFERENCE_LS_KEYS as d, safeLocalStorage as v } from "@scalar/helpers/object/local-storage";
5
5
  import { getResolvedRef as h } from "@scalar/workspace-store/helpers/get-resolved-ref";
6
6
  import { coerceValue as y } from "@scalar/workspace-store/schemas/typebox-coerce";
7
- import { XScalarSelectedSecuritySchema as b, SecuritySchemesSchema as E } from "@scalar/workspace-store/schemas/v3.1/strict/openapi-document";
7
+ import { XScalarSelectedSecuritySchema as E, SecuritySchemesSchema as b } from "@scalar/workspace-store/schemas/v3.1/strict/openapi-document";
8
8
  function P(e) {
9
9
  return Object.values(e.paths ?? {}).flatMap((c) => Object.values(c ?? {}));
10
10
  }
@@ -39,7 +39,7 @@ const m = v(), f = () => {
39
39
  */
40
40
  getSchemas: (t) => {
41
41
  const r = JSON.parse(m.getItem(s("schemas", t)) ?? "{}");
42
- return y(E, r);
42
+ return y(b, r);
43
43
  },
44
44
  /**
45
45
  * Stores the authentication schemes in local storage.
@@ -53,7 +53,7 @@ const m = v(), f = () => {
53
53
  */
54
54
  getSelectedSchemes: (t) => {
55
55
  const r = JSON.parse(m.getItem(s("selectedSchemes", t)) ?? "{}");
56
- return y(b, r);
56
+ return y(E, r);
57
57
  },
58
58
  /**
59
59
  * Stores the user's selected authentication schemes in local storage.
@@ -72,16 +72,16 @@ const m = v(), f = () => {
72
72
  }
73
73
  p(h(e[s]), t);
74
74
  }
75
- }, U = (e, c) => Object.keys(e).every((s) => c.has(s)), I = (e, c) => e >= c ? c - 1 : e, H = ({
75
+ }, I = (e, c) => Object.keys(e).every((s) => c.has(s)), U = (e, c) => e >= c ? c - 1 : e, H = ({
76
76
  documentName: e,
77
77
  workspaceStore: c
78
78
  }) => {
79
79
  const s = f().getSchemas(e), t = c.workspace.documents[e];
80
80
  if (!t)
81
81
  return;
82
- const n = f().getSelectedSchemes(e), o = new Set(Object.keys(t.components?.securitySchemes ?? {})), S = n["x-scalar-selected-security"]?.selectedSchemes?.filter((a) => U(a, o));
82
+ const n = f().getSelectedSchemes(e), o = new Set(Object.keys(t.components?.securitySchemes ?? {})), S = n["x-scalar-selected-security"]?.selectedSchemes?.filter((a) => I(a, o));
83
83
  if (!t["x-scalar-selected-security"] && S && S.length > 0) {
84
- const a = n["x-scalar-selected-security"]?.selectedIndex, i = I(a ?? 0, S.length);
84
+ const a = n["x-scalar-selected-security"]?.selectedIndex, i = U(a ?? 0, S.length);
85
85
  t["x-scalar-selected-security"] = {
86
86
  selectedIndex: i,
87
87
  selectedSchemes: S
@@ -102,11 +102,10 @@ function M(e) {
102
102
  }
103
103
  function N(e) {
104
104
  try {
105
- const c = new URL(e);
106
- if (c.host === "localhost")
105
+ if (e.startsWith("/") || e.startsWith("http://localhost"))
107
106
  return e;
108
- const s = new URLSearchParams({ scalar_url: c.toString() });
109
- return new URL(`https://proxy.scalar.com/?${s}`).toString();
107
+ const c = new URLSearchParams({ scalar_url: e });
108
+ return new URL(`https://proxy.scalar.com/?${c}`).toString();
110
109
  } catch {
111
110
  return console.error(`Invalid URL provided: ${e}`), e;
112
111
  }
package/dist/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.3.3",
13
+ "version": "0.3.4",
14
14
  "engines": {
15
15
  "node": ">=20"
16
16
  },
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.3.3",
13
+ "version": "0.3.4",
14
14
  "engines": {
15
15
  "node": ">=20"
16
16
  },
@@ -49,15 +49,15 @@
49
49
  "vue": "^3.5.26",
50
50
  "whatwg-mimetype": "4.0.0",
51
51
  "zod": "^4.3.5",
52
- "@scalar/json-magic": "0.9.4",
53
- "@scalar/components": "0.16.32",
54
- "@scalar/helpers": "0.2.9",
55
52
  "@scalar/api-client": "2.21.1",
53
+ "@scalar/components": "0.16.32",
56
54
  "@scalar/icons": "0.5.2",
57
- "@scalar/themes": "0.13.26",
55
+ "@scalar/helpers": "0.2.9",
58
56
  "@scalar/openapi-types": "0.5.3",
57
+ "@scalar/themes": "0.13.26",
59
58
  "@scalar/types": "0.5.10",
60
- "@scalar/workspace-store": "0.27.1"
59
+ "@scalar/workspace-store": "0.27.1",
60
+ "@scalar/json-magic": "0.9.4"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@modelcontextprotocol/sdk": "1.25.2",