@scalar/agent-chat 0.3.1 → 0.3.3

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 (65) hide show
  1. package/dist/App.vue.d.ts +4 -5
  2. package/dist/App.vue.d.ts.map +1 -1
  3. package/dist/App.vue.js +16 -14
  4. package/dist/Chat.vue.d.ts.map +1 -1
  5. package/dist/Chat.vue.js +43 -16
  6. package/dist/api.d.ts +53 -2
  7. package/dist/api.d.ts.map +1 -1
  8. package/dist/api.js +67 -37
  9. package/dist/components/ApprovalSection.vue.d.ts.map +1 -1
  10. package/dist/components/ApprovalSection.vue.js +1 -1
  11. package/dist/components/ApprovalSection.vue2.js +19 -28
  12. package/dist/components/AuthenticationProvided.vue.js +8 -8
  13. package/dist/components/PaymentSection.vue.d.ts +1 -7
  14. package/dist/components/PaymentSection.vue.d.ts.map +1 -1
  15. package/dist/components/PaymentSection.vue.js +2 -2
  16. package/dist/components/PaymentSection.vue2.js +21 -21
  17. package/dist/components/ResponseBody/helpers/media-types.d.ts +0 -4
  18. package/dist/components/ResponseBody/helpers/media-types.d.ts.map +1 -1
  19. package/dist/components/ResponseBody/helpers/media-types.js +0 -1
  20. package/dist/entities/index.d.ts +1 -0
  21. package/dist/entities/index.d.ts.map +1 -1
  22. package/dist/entities/index.js +17 -15
  23. package/dist/entities/registry/document.d.ts +3 -1
  24. package/dist/entities/registry/document.d.ts.map +1 -1
  25. package/dist/helpers.d.ts +8 -67
  26. package/dist/helpers.d.ts.map +1 -1
  27. package/dist/helpers.js +67 -57
  28. package/dist/hooks/use-agent-key-documents.d.ts +2 -0
  29. package/dist/hooks/use-agent-key-documents.d.ts.map +1 -0
  30. package/dist/hooks/use-agent-key-documents.js +16 -0
  31. package/dist/hooks/use-curated-documents.d.ts +2 -0
  32. package/dist/hooks/use-curated-documents.d.ts.map +1 -0
  33. package/dist/hooks/use-curated-documents.js +12 -0
  34. package/dist/hooks/use-search.d.ts +4 -8
  35. package/dist/hooks/use-search.d.ts.map +1 -1
  36. package/dist/hooks/use-search.js +14 -18
  37. package/dist/hooks/use-term-and-conditions.d.ts +0 -1
  38. package/dist/hooks/use-term-and-conditions.d.ts.map +1 -1
  39. package/dist/hooks/use-term-and-conditions.js +0 -1
  40. package/dist/hooks/use-upload-tmp-document.d.ts +6 -2
  41. package/dist/hooks/use-upload-tmp-document.d.ts.map +1 -1
  42. package/dist/hooks/use-upload-tmp-document.js +45 -23
  43. package/dist/package.json +1 -1
  44. package/dist/registry/add-documents-to-store.d.ts +6 -5
  45. package/dist/registry/add-documents-to-store.d.ts.map +1 -1
  46. package/dist/registry/add-documents-to-store.js +16 -20
  47. package/dist/state/state.d.ts +16 -7
  48. package/dist/state/state.d.ts.map +1 -1
  49. package/dist/state/state.js +92 -78
  50. package/dist/style.css +1 -1
  51. package/dist/views/Chat/Chat.vue.js +2 -2
  52. package/dist/views/Chat/Messages/AskForAuthentication.vue.js +1 -1
  53. package/dist/views/PromptForm.vue.d.ts.map +1 -1
  54. package/dist/views/PromptForm.vue.js +2 -2
  55. package/dist/views/PromptForm.vue2.js +118 -104
  56. package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
  57. package/dist/views/Settings/DocSettings.vue.js +2 -2
  58. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  59. package/dist/views/Settings/Settings.vue.js +2 -2
  60. package/dist/views/Settings/Settings.vue2.js +33 -31
  61. package/package.json +8 -8
  62. package/dist/components/Suggestion.vue.d.ts +0 -10
  63. package/dist/components/Suggestion.vue.d.ts.map +0 -1
  64. package/dist/components/TestRequestButton.vue.d.ts +0 -8
  65. package/dist/components/TestRequestButton.vue.d.ts.map +0 -1
package/dist/App.vue.d.ts CHANGED
@@ -1,15 +1,14 @@
1
- import type { WorkspaceStore } from '@scalar/workspace-store/client';
2
- import { type WorkspaceEventBus } from '@scalar/workspace-store/events';
3
1
  import { type RegistryDocument } from './state/state.js';
4
2
  import { type ChatMode } from './types';
5
3
  type __VLS_Props = {
6
- eventBus: WorkspaceEventBus;
7
- workspaceStore: WorkspaceStore;
8
4
  registryDocuments: RegistryDocument[];
9
5
  registryUrl: string;
6
+ dashboardUrl: string;
10
7
  baseUrl: string;
11
8
  mode?: ChatMode;
12
- getAccessToken: () => string;
9
+ getAccessToken?: () => string;
10
+ getAgentKey?: () => string;
11
+ getActiveDocumentJson?: () => string;
13
12
  };
14
13
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
14
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../src/App.vue"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAIvE,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,cAAc,EAAE,cAAc,CAAA;IAC9B,iBAAiB,EAAE,gBAAgB,EAAE,CAAA;IACrC,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,cAAc,EAAE,MAAM,MAAM,CAAA;CAC7B,CAAC;;AA+DF,wBAMG"}
1
+ {"version":3,"file":"App.vue.d.ts","sourceRoot":"","sources":["../src/App.vue"],"names":[],"mappings":"AAoDA,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,KAAK,WAAW,GAAG;IACjB,iBAAiB,EAAE,gBAAgB,EAAE,CAAA;IACrC,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,cAAc,CAAC,EAAE,MAAM,MAAM,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,MAAM,CAAA;IAC1B,qBAAqB,CAAC,EAAE,MAAM,MAAM,CAAA;CACrC,CAAC;;AAiEF,wBAMG"}
package/dist/App.vue.js CHANGED
@@ -1,32 +1,34 @@
1
- import { defineComponent as t, provide as r, createBlock as o, openBlock as s } from "vue";
1
+ import { defineComponent as t, provide as n, createBlock as r, openBlock as o } from "vue";
2
2
  import c from "./Chat.vue.js";
3
- import { STATE_SYMBOL as n, createState as a } from "./state/state.js";
4
- const g = /* @__PURE__ */ t({
3
+ import { STATE_SYMBOL as s, createState as i } from "./state/state.js";
4
+ const d = /* @__PURE__ */ t({
5
5
  __name: "App",
6
6
  props: {
7
- eventBus: {},
8
- workspaceStore: {},
9
7
  registryDocuments: {},
10
8
  registryUrl: {},
9
+ dashboardUrl: {},
11
10
  baseUrl: {},
12
11
  mode: { default: "full" },
13
- getAccessToken: { type: Function }
12
+ getAccessToken: { type: Function },
13
+ getAgentKey: { type: Function },
14
+ getActiveDocumentJson: { type: Function }
14
15
  },
15
16
  setup(e) {
16
- return r(
17
- n,
18
- a({
19
- eventBus: e.eventBus,
20
- workspaceStore: e.workspaceStore,
17
+ return n(
18
+ s,
19
+ i({
20
+ getActiveDocumentJson: e.getActiveDocumentJson,
21
21
  initialRegistryDocuments: e.registryDocuments,
22
22
  registryUrl: e.registryUrl,
23
23
  baseUrl: e.baseUrl,
24
24
  mode: e.mode,
25
- getAccessToken: e.getAccessToken
25
+ getAccessToken: e.getAccessToken,
26
+ getAgentKey: e.getAgentKey,
27
+ dashboardUrl: e.dashboardUrl
26
28
  })
27
- ), (i, m) => (s(), o(c));
29
+ ), (a, m) => (o(), r(c));
28
30
  }
29
31
  });
30
32
  export {
31
- g as default
33
+ d as default
32
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.vue.d.ts","sourceRoot":"","sources":["../src/Chat.vue"],"names":[],"mappings":";AA6FA,wBAKG"}
1
+ {"version":3,"file":"Chat.vue.d.ts","sourceRoot":"","sources":["../src/Chat.vue"],"names":[],"mappings":";AA+LA,wBAKG"}
package/dist/Chat.vue.js CHANGED
@@ -1,23 +1,50 @@
1
- import { defineComponent as n, createElementBlock as m, openBlock as s, Fragment as c, createVNode as t, unref as l } from "vue";
2
- import { createWorkspaceEventBus as u } from "@scalar/workspace-store/events";
3
- import { useChatScroll as p } from "./hooks/use-chat-scroll.js";
4
- import { useState as i } from "./state/state.js";
5
- import f from "./views/Layout.vue.js";
6
- import d from "./views/Settings/Settings.vue.js";
7
- const v = /* @__PURE__ */ n({
1
+ import { defineComponent as f, useTemplateRef as d, ref as g, onMounted as _, onBeforeUnmount as v, createElementBlock as S, openBlock as M, Fragment as h, createElementVNode as C, createVNode as n, unref as D } from "vue";
2
+ import { createApiClientModal as w } from "@scalar/api-client/v2/features/modal";
3
+ import { useAgentKeyDocuments as y } from "./hooks/use-agent-key-documents.js";
4
+ import { useChatScroll as B } from "./hooks/use-chat-scroll.js";
5
+ import { useCuratedDocuments as b } from "./hooks/use-curated-documents.js";
6
+ import { getTmpDocFromLocalStorage as k } from "./hooks/use-upload-tmp-document.js";
7
+ import { useState as x } from "./state/state.js";
8
+ import A from "./views/Layout.vue.js";
9
+ import E from "./views/Settings/Settings.vue.js";
10
+ const F = { ref: "clientModal" }, H = /* @__PURE__ */ f({
8
11
  __name: "Chat",
9
- setup(_) {
10
- const { chat: e, prompt: o, settingsModal: a } = i();
11
- u({ debug: !1 }), p();
12
- async function r() {
13
- await e.sendMessage({ text: o.value });
12
+ setup(L) {
13
+ const {
14
+ chat: a,
15
+ prompt: r,
16
+ settingsModal: m,
17
+ eventBus: l,
18
+ workspaceStore: u,
19
+ config: c,
20
+ mode: s,
21
+ addDocument: i
22
+ } = x(), t = d("clientModal"), o = g(null);
23
+ _(async () => {
24
+ const e = k();
25
+ s === "preview" && e && await i({
26
+ namespace: e.namespace,
27
+ slug: e.slug,
28
+ removable: !1
29
+ }), t.value && (o.value = w({
30
+ el: t.value,
31
+ options: c,
32
+ eventBus: l,
33
+ workspaceStore: u
34
+ }));
35
+ }), v(() => {
36
+ o.value?.app.unmount();
37
+ }), B(), y(), b();
38
+ async function p() {
39
+ await a.sendMessage({ text: r.value });
14
40
  }
15
- return (S, g) => (s(), m(c, null, [
16
- t(f, { onSubmit: r }),
17
- t(d, { modalState: l(a) }, null, 8, ["modalState"])
41
+ return (e, N) => (M(), S(h, null, [
42
+ C("div", F, null, 512),
43
+ n(A, { onSubmit: p }),
44
+ n(E, { modalState: D(m) }, null, 8, ["modalState"])
18
45
  ], 64));
19
46
  }
20
47
  });
21
48
  export {
22
- v as default
49
+ H as default
23
50
  };
package/dist/api.d.ts CHANGED
@@ -1,7 +1,15 @@
1
+ export declare function createAuthorizationHeaders({ getAccessToken, getAgentKey, }: {
2
+ getAccessToken?: () => string;
3
+ getAgentKey?: () => string;
4
+ }): {
5
+ 'x-scalar-agent-key'?: string | undefined;
6
+ Authorization?: string | undefined;
7
+ };
1
8
  /** Minimal set of API requests needed for agent chat */
2
- export declare function api({ baseUrl, getAccessToken }: {
9
+ export declare function createApi({ baseUrl, getAccessToken, getAgentKey, }: {
3
10
  baseUrl: string;
4
- getAccessToken: () => string;
11
+ getAccessToken?: () => string;
12
+ getAgentKey?: () => string;
5
13
  }): {
6
14
  search: (query: string) => Promise<{
7
15
  success: false;
@@ -46,5 +54,48 @@ export declare function api({ baseUrl, getAccessToken }: {
46
54
  };
47
55
  error?: undefined;
48
56
  }>;
57
+ getKeyDocuments: () => Promise<{
58
+ success: false;
59
+ error: import("./entities/index.js").AgentChatError<"FAILED_TO_FETCH", unknown>;
60
+ } | import("neverpanic").Result<never, null> | {
61
+ success: false;
62
+ error: import("./entities/index.js").AgentChatError<string, string>;
63
+ data?: undefined;
64
+ } | {
65
+ success: true;
66
+ data: {
67
+ documents: {
68
+ id: string;
69
+ title: string;
70
+ namespace: string;
71
+ currentVersion: string;
72
+ logoUrl: string | null;
73
+ slug: string;
74
+ }[];
75
+ };
76
+ error?: undefined;
77
+ }>;
78
+ getCuratedDocuments: () => Promise<{
79
+ success: false;
80
+ error: import("./entities/index.js").AgentChatError<"FAILED_TO_FETCH", unknown>;
81
+ } | import("neverpanic").Result<never, null> | {
82
+ success: false;
83
+ error: import("./entities/index.js").AgentChatError<string, string>;
84
+ data?: undefined;
85
+ } | {
86
+ success: true;
87
+ data: {
88
+ results: {
89
+ id: string;
90
+ title: string;
91
+ namespace: string;
92
+ currentVersion: string;
93
+ logoUrl: string | null;
94
+ slug: string;
95
+ }[];
96
+ };
97
+ error?: undefined;
98
+ }>;
49
99
  };
100
+ export type Api = ReturnType<typeof createApi>;
50
101
  //# sourceMappingURL=api.d.ts.map
package/dist/api.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAMA,wDAAwD;AACxD,wBAAgB,GAAG,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,MAAM,CAAA;CAAE;oBA0EnE,MAAM;;;;;;;;;;;;;;;;;;;;;0BASA;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;EAUvE"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAOA,wBAAgB,0BAA0B,CAAC,EACzC,cAAc,EACd,WAAW,GACZ,EAAE;IACD,cAAc,CAAC,EAAE,MAAM,MAAM,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,MAAM,CAAA;CAC3B;;;EAYA;AAED,wDAAwD;AACxD,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,cAAc,EACd,WAAW,GACZ,EAAE;IACD,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,CAAC,EAAE,MAAM,MAAM,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,MAAM,CAAA;CAC3B;oBA0E8B,MAAM;;;;;;;;;;;;;;;;;;;;;0BASA;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BvE;AAED,MAAM,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA"}
package/dist/api.js CHANGED
@@ -1,68 +1,98 @@
1
- import { n as o } from "neverpanic";
2
- import a from "zod";
3
- import { createError as r } from "./entities/error/helpers.js";
4
- import { registryApiMetadata as p } from "./entities/registry/document.js";
5
- function _({ baseUrl: d, getAccessToken: h }) {
6
- const n = o.safeFn(
1
+ import { n as f } from "neverpanic";
2
+ import t from "zod";
3
+ import { createError as a } from "./entities/error/helpers.js";
4
+ import { registryApiMetadata as n } from "./entities/registry/document.js";
5
+ import { makeScalarProxyUrl as D } from "./helpers.js";
6
+ function E({
7
+ getAccessToken: u,
8
+ getAgentKey: i
9
+ }) {
10
+ const c = u?.(), e = i?.();
11
+ return {
12
+ ...c && {
13
+ Authorization: `Bearer ${c}`
14
+ },
15
+ ...e && {
16
+ "x-scalar-agent-key": e
17
+ }
18
+ };
19
+ }
20
+ function $({
21
+ baseUrl: u,
22
+ getAccessToken: i,
23
+ getAgentKey: c
24
+ }) {
25
+ const e = f.safeFn(
7
26
  async ({
8
27
  path: s,
9
28
  method: g = "get",
10
- query: u,
11
- body: i,
12
- responseSchema: l
29
+ query: p,
30
+ body: d,
31
+ responseSchema: h
13
32
  }) => {
14
- const f = h(), t = await o.fromUnsafe(
15
- async () => fetch(`${d}${s}${u ? `?${new URLSearchParams(u)}` : ""}`, {
33
+ const l = `${u}${s}${p ? `?${new URLSearchParams(p)}` : ""}`, o = await f.fromUnsafe(
34
+ async () => fetch(D(l), {
16
35
  method: g,
17
- ...i && { body: JSON.stringify(i) },
36
+ ...d && { body: JSON.stringify(d) },
18
37
  headers: {
19
- ...f && { Authorization: `Bearer ${f}` }
38
+ ...E({ getAccessToken: i, getAgentKey: c })
20
39
  }
21
40
  }),
22
- (e) => r("FAILED_TO_FETCH", e)
41
+ (r) => a("FAILED_TO_FETCH", r)
23
42
  );
24
- if (!t.success)
25
- return t;
26
- const c = await o.fromUnsafe(
27
- async () => t.data.json(),
28
- (e) => r("FAILED_TO_FETCH_DATA", e)
43
+ if (!o.success)
44
+ return o;
45
+ const m = await f.fromUnsafe(
46
+ async () => o.data.json(),
47
+ (r) => a("FAILED_TO_FETCH_DATA", r)
29
48
  );
30
- if (!c.success)
49
+ if (!m.success)
31
50
  return {
32
51
  success: !1,
33
- error: r("UNKNOWN_ERROR", "Unknown error occurred. Please contact support.")
52
+ error: a("UNKNOWN_ERROR", "Unknown error occurred. Please contact support.")
34
53
  };
35
- if (!t.data.ok) {
36
- const e = a.object({ message: a.string(), code: a.string() }).safeParse(c.data);
37
- return e.success ? {
54
+ if (!o.data.ok) {
55
+ const r = t.object({ message: t.string(), code: t.string() }).safeParse(m.data);
56
+ return r.success ? {
38
57
  success: !1,
39
- error: r(e.data.code, e.data.message)
58
+ error: a(r.data.code, r.data.message)
40
59
  } : {
41
60
  success: !1,
42
- error: r("UNKNOWN_ERROR", "Unknown error occurred. Please contact support.")
61
+ error: a("UNKNOWN_ERROR", "Unknown error occurred. Please contact support.")
43
62
  };
44
63
  }
45
- const m = l.safeParse(c.data);
46
- return m.success ? { success: !0, data: m.data } : {
64
+ const y = h.safeParse(m.data);
65
+ return y.success ? { success: !0, data: y.data } : {
47
66
  success: !1,
48
- error: r("INVALID_RESPONSE", "Invalid response. Please contact support")
67
+ error: a("INVALID_RESPONSE", "Invalid response. Please contact support")
49
68
  };
50
69
  }
51
70
  );
52
71
  return {
53
- search: async (s) => n({
54
- path: "/registry/search",
72
+ search: async (s) => e({
73
+ path: "/vector/registry/search",
55
74
  query: { query: s },
56
- responseSchema: a.object({
57
- results: p.array()
75
+ responseSchema: t.object({
76
+ results: n.array()
58
77
  })
59
78
  }),
60
- getDocument: async (s) => n({
61
- path: `/registry/document/${s.namespace}/${s.slug}`,
62
- responseSchema: p
79
+ getDocument: async (s) => e({
80
+ path: `/vector/registry/document/${s.namespace}/${s.slug}`,
81
+ responseSchema: n
82
+ }),
83
+ getKeyDocuments: async () => e({
84
+ path: "/vector/registry/documents",
85
+ responseSchema: t.object({ documents: n.array() })
86
+ }),
87
+ getCuratedDocuments: async () => e({
88
+ path: "/vector/registry/curated",
89
+ responseSchema: t.object({
90
+ results: n.array()
91
+ })
63
92
  })
64
93
  };
65
94
  }
66
95
  export {
67
- _ as api
96
+ $ as createApi,
97
+ E as createAuthorizationHeaders
68
98
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ApprovalSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApprovalSection.vue"],"names":[],"mappings":";;;;;;;AA+NA,wBAMG"}
1
+ {"version":3,"file":"ApprovalSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApprovalSection.vue"],"names":[],"mappings":";;;;;;;AAqMA,wBAMG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ApprovalSection.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-c74f778a"]]);
4
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-1cb4fa51"]]);
5
5
  export {
6
6
  c as default
7
7
  };
@@ -1,42 +1,33 @@
1
- import { defineComponent as m, createElementBlock as c, openBlock as u, createElementVNode as s, createVNode as t, createTextVNode as o, unref as r, withCtx as p } from "vue";
2
- import { ScalarButton as a } from "@scalar/components";
3
- import { ScalarIconInfo as d } from "@scalar/icons";
4
- const v = { class: "approvalSection" }, f = { class: "approvalText flex items-center gap-1.5" }, x = { class: "approveContainer" }, S = /* @__PURE__ */ m({
1
+ import { defineComponent as s, createElementBlock as p, openBlock as a, createElementVNode as t, createVNode as i, createTextVNode as c, unref as l } from "vue";
2
+ import { ScalarIconInfo as u } from "@scalar/icons";
3
+ const m = { class: "approvalSection" }, v = { class: "approvalText flex items-center gap-1.5" }, d = { class: "approveContainer" }, B = /* @__PURE__ */ s({
5
4
  __name: "ApprovalSection",
6
5
  emits: ["approve", "reject"],
7
- setup(B, { emit: i }) {
8
- const n = i;
9
- return (_, e) => (u(), c("div", v, [
10
- s("strong", f, [
11
- t(r(d), {
6
+ setup(f, { emit: n }) {
7
+ const o = n;
8
+ return (_, e) => (a(), p("div", m, [
9
+ t("strong", v, [
10
+ i(l(u), {
12
11
  class: "text-blue size-4",
13
12
  weight: "bold"
14
13
  }),
15
- e[2] || (e[2] = o(" One or more requests require approval. ", -1))
14
+ e[2] || (e[2] = c(" One or more requests require approval. ", -1))
16
15
  ]),
17
- s("div", x, [
18
- t(r(a), {
16
+ t("div", d, [
17
+ t("button", {
18
+ type: "button",
19
19
  class: "actionButton rejectButton",
20
- onClick: e[0] || (e[0] = (l) => n("reject"))
21
- }, {
22
- default: p(() => [...e[3] || (e[3] = [
23
- o(" Reject", -1)
24
- ])]),
25
- _: 1
26
- }),
27
- t(r(a), {
20
+ onClick: e[0] || (e[0] = (r) => o("reject"))
21
+ }, " Reject "),
22
+ t("button", {
23
+ type: "button",
28
24
  class: "actionButton approveButton",
29
- onClick: e[1] || (e[1] = (l) => n("approve"))
30
- }, {
31
- default: p(() => [...e[4] || (e[4] = [
32
- o(" Approve", -1)
33
- ])]),
34
- _: 1
35
- })
25
+ onClick: e[1] || (e[1] = (r) => o("approve"))
26
+ }, " Approve ")
36
27
  ])
37
28
  ]));
38
29
  }
39
30
  });
40
31
  export {
41
- S as default
32
+ B as default
42
33
  };
@@ -1,13 +1,13 @@
1
- import { createElementBlock as e, openBlock as c, createStaticVNode as r } from "vue";
1
+ import { createElementBlock as e, openBlock as d, createStaticVNode as c } from "vue";
2
2
  /* empty css */
3
- import a from "../_virtual/_plugin-vue_export-helper.js";
4
- const i = {}, o = { class: "authenticationProvided" };
5
- function d(h, t) {
6
- return c(), e("div", o, [...t[0] || (t[0] = [
7
- r('<svg fill="none" height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" data-v-3e23c6c8><rect height="14.25" rx="7.125" width="14.25" x="0.875" y="0.875" data-v-3e23c6c8></rect><rect height="14.25" rx="7.125" stroke="var(--scalar-color-green)" stroke-width="1.75" width="14.25" x="0.875" y="0.875" data-v-3e23c6c8></rect><g clip-path="url(#clip0_74_840)" data-v-3e23c6c8><path d="M11.6037 6.841L7.59117 10.8535C7.49742 10.9472 7.37029 10.9998 7.23774 10.9998C7.10519 10.9998 6.97806 10.9472 6.8843 10.8535L4.64617 8.6035C4.55257 8.50975 4.5 8.38269 4.5 8.25022C4.5 8.11774 4.55257 7.99068 4.64617 7.89694L5.27117 7.27194C5.36488 7.17862 5.49174 7.12623 5.62399 7.12623C5.75623 7.12623 5.88309 7.17862 5.9768 7.27194L7.25024 8.50694L10.274 5.52037C10.3677 5.42696 10.4946 5.37451 10.627 5.37451C10.7593 5.37451 10.8862 5.42696 10.9799 5.52037L11.6034 6.131C11.6502 6.17746 11.6875 6.23274 11.7129 6.29366C11.7383 6.35458 11.7514 6.41993 11.7514 6.48593C11.7514 6.55194 11.7384 6.6173 11.713 6.67824C11.6877 6.73918 11.6505 6.7945 11.6037 6.841Z" fill="var(--scalar-color-green)" data-v-3e23c6c8></path></g><defs data-v-3e23c6c8><clipPath id="clip0_74_840" data-v-3e23c6c8><rect height="8" rx="4" width="8" x="4" y="4" data-v-3e23c6c8></rect></clipPath></defs></svg> Authorized ', 2)
3
+ import r from "../_virtual/_plugin-vue_export-helper.js";
4
+ const i = {}, a = { class: "authenticationProvided" };
5
+ function o(h, t) {
6
+ return d(), e("div", a, [...t[0] || (t[0] = [
7
+ c('<svg fill="none" height="16" viewBox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg" data-v-e3416cd5><rect height="14.25" rx="7.125" width="14.25" x="0.875" y="0.875" data-v-e3416cd5></rect><rect height="14.25" rx="7.125" stroke="currentColor" stroke-width="1.75" width="14.25" x="0.875" y="0.875" data-v-e3416cd5></rect><g clip-path="url(#clip0_74_840)" data-v-e3416cd5><path d="M11.6037 6.841L7.59117 10.8535C7.49742 10.9472 7.37029 10.9998 7.23774 10.9998C7.10519 10.9998 6.97806 10.9472 6.8843 10.8535L4.64617 8.6035C4.55257 8.50975 4.5 8.38269 4.5 8.25022C4.5 8.11774 4.55257 7.99068 4.64617 7.89694L5.27117 7.27194C5.36488 7.17862 5.49174 7.12623 5.62399 7.12623C5.75623 7.12623 5.88309 7.17862 5.9768 7.27194L7.25024 8.50694L10.274 5.52037C10.3677 5.42696 10.4946 5.37451 10.627 5.37451C10.7593 5.37451 10.8862 5.42696 10.9799 5.52037L11.6034 6.131C11.6502 6.17746 11.6875 6.23274 11.7129 6.29366C11.7383 6.35458 11.7514 6.41993 11.7514 6.48593C11.7514 6.55194 11.7384 6.6173 11.713 6.67824C11.6877 6.73918 11.6505 6.7945 11.6037 6.841Z" fill="currentColor" data-v-e3416cd5></path></g><defs data-v-e3416cd5><clipPath id="clip0_74_840" data-v-e3416cd5><rect height="8" rx="4" width="8" x="4" y="4" data-v-e3416cd5></rect></clipPath></defs></svg> Authorized ', 2)
8
8
  ])]);
9
9
  }
10
- const v = /* @__PURE__ */ a(i, [["render", d], ["__scopeId", "data-v-3e23c6c8"]]);
10
+ const p = /* @__PURE__ */ r(i, [["render", o], ["__scopeId", "data-v-e3416cd5"]]);
11
11
  export {
12
- v as default
12
+ p as default
13
13
  };
@@ -1,9 +1,3 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
2
- approve: () => any;
3
- reject: () => any;
4
- }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
5
- onApprove?: (() => any) | undefined;
6
- onReject?: (() => any) | undefined;
7
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
8
2
  export default _default;
9
3
  //# sourceMappingURL=PaymentSection.vue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaymentSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/PaymentSection.vue"],"names":[],"mappings":";;;;;;;AA6TA,wBAMG"}
1
+ {"version":3,"file":"PaymentSection.vue.d.ts","sourceRoot":"","sources":["../../src/components/PaymentSection.vue"],"names":[],"mappings":";AAqUA,wBAKG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./PaymentSection.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../_virtual/_plugin-vue_export-helper.js";
4
- const r = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3a3f43fc"]]);
4
+ const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-bbcefd08"]]);
5
5
  export {
6
- r as default
6
+ a as default
7
7
  };
@@ -1,34 +1,34 @@
1
- import { defineComponent as d, createElementBlock as p, openBlock as c, createElementVNode as t, createVNode as e, createTextVNode as s, unref as n, createStaticVNode as i, withCtx as v } from "vue";
2
- import { ScalarButton as r } from "@scalar/components";
3
- import { ScalarIconInfo as m } from "@scalar/icons";
4
- const l = { class: "paymentSection" }, u = { class: "approvalText flex items-center gap-1.5" }, I = { class: "paymentContainer" }, B = /* @__PURE__ */ d({
1
+ import { defineComponent as o, createElementBlock as c, openBlock as p, createElementVNode as t, createVNode as i, createTextVNode as r, unref as b, createStaticVNode as f } from "vue";
2
+ import { ScalarIconInfo as l } from "@scalar/icons";
3
+ import { useState as v } from "../state/state.js";
4
+ const m = { class: "paymentSection" }, u = { class: "approvalText flex items-center gap-1.5" }, x = /* @__PURE__ */ o({
5
5
  __name: "PaymentSection",
6
- emits: ["approve", "reject"],
7
- setup(y, { emit: o }) {
8
- const f = o;
9
- return (g, a) => (c(), p("div", l, [
6
+ setup(y) {
7
+ const { dashboardUrl: a, mode: n, uploadedTmpDocumentUrl: d } = v();
8
+ function s() {
9
+ n === "full" && window.location.replace(a), n === "preview" && window.location.replace(
10
+ d.value ? `${a}/register?flow=oss-agent&docUrl=${d.value}` : a
11
+ );
12
+ }
13
+ return (I, e) => (p(), c("div", m, [
10
14
  t("strong", u, [
11
- e(n(m), {
15
+ i(b(l), {
12
16
  class: "text-blue size-4",
13
17
  weight: "bold"
14
18
  }),
15
- a[1] || (a[1] = s(" You've used up all your free messages, upgrade for $24/mo. ", -1))
19
+ e[0] || (e[0] = r(" You've used up all your free messages, upgrade for $24/mo. ", -1))
16
20
  ]),
17
- t("div", I, [
18
- e(n(r), {
21
+ t("div", { class: "paymentContainer" }, [
22
+ t("button", {
19
23
  class: "actionButton approveButton",
20
- onClick: a[0] || (a[0] = (x) => f("approve"))
21
- }, {
22
- default: v(() => [...a[2] || (a[2] = [
23
- s(" Upgrade", -1)
24
- ])]),
25
- _: 1
26
- }),
27
- a[3] || (a[3] = i('<div class="paymentInfo" data-v-3a3f43fc><h3 data-v-3a3f43fc>$24 <span data-v-3a3f43fc>/ month</span></h3><div class="paymentInfoSection" data-v-3a3f43fc><div class="paymentInfoItem" data-v-3a3f43fc><span data-v-3a3f43fc>Members in your workspace</span><span data-v-3a3f43fc>1</span></div><div class="paymentInfoItem" data-v-3a3f43fc><span data-v-3a3f43fc>x $24 / month / member</span><span data-v-3a3f43fc>$24.00</span></div></div><div class="paymentInfoSection" data-v-3a3f43fc><div class="paymentInfoItem" data-v-3a3f43fc><span data-v-3a3f43fc>Messages</span><span data-v-3a3f43fc>1000</span></div><div class="paymentInfoItem" data-v-3a3f43fc><span data-v-3a3f43fc>Additional Messages</span><span data-v-3a3f43fc>+ $0.15 Message</span></div></div></div>', 1))
24
+ type: "button",
25
+ onClick: s
26
+ }, " Upgrade "),
27
+ e[1] || (e[1] = f('<div class="paymentInfo" data-v-bbcefd08><h3 data-v-bbcefd08>$24 <span data-v-bbcefd08>/ month</span></h3><div class="paymentInfoSection" data-v-bbcefd08><div class="paymentInfoItem" data-v-bbcefd08><span data-v-bbcefd08>Members in your workspace</span><span data-v-bbcefd08>1</span></div><div class="paymentInfoItem" data-v-bbcefd08><span data-v-bbcefd08>x $24 / month / member</span><span data-v-bbcefd08>$24.00</span></div></div><div class="paymentInfoSection" data-v-bbcefd08><div class="paymentInfoItem" data-v-bbcefd08><span data-v-bbcefd08>Messages</span><span data-v-bbcefd08>1000</span></div><div class="paymentInfoItem" data-v-bbcefd08><span data-v-bbcefd08>Additional Messages</span><span data-v-bbcefd08>+ $0.15 Message</span></div></div></div>', 1))
28
28
  ])
29
29
  ]));
30
30
  }
31
31
  });
32
32
  export {
33
- B as default
33
+ x as default
34
34
  };
@@ -6,10 +6,6 @@ export type MediaConfig = {
6
6
  language?: string;
7
7
  extension: string;
8
8
  };
9
- /** Media Types (MIME Types) that can be displayed as raw text */
10
- export declare const textMediaTypes: string[];
11
9
  /** Get the config for a media type */
12
10
  export declare function getMediaTypeConfig(type: string): MediaConfig | undefined;
13
- /** Check if a media type that can be displayed as raw text */
14
- export declare function isTextMediaType(type: string): boolean;
15
11
  //# sourceMappingURL=media-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"media-types.d.ts","sourceRoot":"","sources":["../../../../src/components/ResponseBody/helpers/media-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAEjE,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAuHD,iEAAiE;AACjE,eAAO,MAAM,cAAc,EAAE,MAAM,EAEX,CAAA;AAExB,sCAAsC;AACtC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAgBxE;AAED,8DAA8D;AAC9D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD"}
1
+ {"version":3,"file":"media-types.d.ts","sourceRoot":"","sources":["../../../../src/components/ResponseBody/helpers/media-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;AAEjE,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAuHD,sCAAsC;AACtC,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAgBxE"}
@@ -113,7 +113,6 @@ const i = {
113
113
  "video/webm": { extension: ".webm", preview: "video" },
114
114
  "video/x-msvideo": { extension: ".avi" }
115
115
  };
116
- Object.entries(i).filter(([, e]) => e?.raw).map(([e]) => e);
117
116
  function t(e) {
118
117
  const n = i[e];
119
118
  if (n)
@@ -1,5 +1,6 @@
1
1
  export { type AgentChatError, AgentErrorCodes, } from './error/constants.js';
2
2
  export { createError } from './error/helpers.js';
3
+ export { MAX_PROMPT_SIZE } from './prompt/constants.js';
3
4
  export { type ApiMetadata, type DocumentSettings, type RegistryDocument, registryApiMetadata, } from './registry/document.js';
4
5
  export { ASK_FOR_AUTHENTICATION_TOOL_NAME, type AskForAuthenticationInput, askForAuthenticationInputSchema, } from './tools/ask-for-authentication.js';
5
6
  export { TOOL_NAMESPACE_SLUG_DELIMITER } from './tools/constants.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,eAAe,GAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,mBAAmB,GACpB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,gCAAgC,EAChC,KAAK,yBAAyB,EAC9B,+BAA+B,GAChC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,EACL,yBAAyB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,6BAA6B,GAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,+BAA+B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,gCAAgC,GACjC,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,mCAAmC,EACnC,KAAK,gCAAgC,GACtC,MAAM,kCAAkC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,eAAe,GAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,mBAAmB,GACpB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,gCAAgC,EAChC,KAAK,yBAAyB,EAC9B,+BAA+B,GAChC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,EACL,yBAAyB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,6BAA6B,GAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,+BAA+B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,gCAAgC,GACjC,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACL,mCAAmC,EACnC,KAAK,gCAAgC,GACtC,MAAM,kCAAkC,CAAA"}