@scalar/agent-chat 0.1.2

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 (157) hide show
  1. package/dist/App.vue.d.ts +10 -0
  2. package/dist/App.vue.d.ts.map +1 -0
  3. package/dist/App.vue.js +23 -0
  4. package/dist/App.vue.js.map +1 -0
  5. package/dist/App.vue2.js +5 -0
  6. package/dist/App.vue2.js.map +1 -0
  7. package/dist/Chat.vue.d.ts +3 -0
  8. package/dist/Chat.vue.d.ts.map +1 -0
  9. package/dist/Chat.vue.js +55 -0
  10. package/dist/Chat.vue.js.map +1 -0
  11. package/dist/Chat.vue2.js +5 -0
  12. package/dist/Chat.vue2.js.map +1 -0
  13. package/dist/_virtual/_plugin-vue_export-helper.js +11 -0
  14. package/dist/_virtual/_plugin-vue_export-helper.js.map +1 -0
  15. package/dist/components/ContextItem.vue.d.ts +16 -0
  16. package/dist/components/ContextItem.vue.d.ts.map +1 -0
  17. package/dist/components/ContextItem.vue.js +8 -0
  18. package/dist/components/ContextItem.vue.js.map +1 -0
  19. package/dist/components/ContextItem.vue2.js +22 -0
  20. package/dist/components/ContextItem.vue2.js.map +1 -0
  21. package/dist/components/Endpoint.vue.d.ts +9 -0
  22. package/dist/components/Endpoint.vue.d.ts.map +1 -0
  23. package/dist/components/Endpoint.vue.js +8 -0
  24. package/dist/components/Endpoint.vue.js.map +1 -0
  25. package/dist/components/Endpoint.vue2.js +98 -0
  26. package/dist/components/Endpoint.vue2.js.map +1 -0
  27. package/dist/components/LoadingMiniOpenAPIDoc.vue.d.ts +3 -0
  28. package/dist/components/LoadingMiniOpenAPIDoc.vue.d.ts.map +1 -0
  29. package/dist/components/LoadingMiniOpenAPIDoc.vue.js +32 -0
  30. package/dist/components/LoadingMiniOpenAPIDoc.vue.js.map +1 -0
  31. package/dist/components/Logo.vue.d.ts +3 -0
  32. package/dist/components/Logo.vue.d.ts.map +1 -0
  33. package/dist/components/Logo.vue.js +25 -0
  34. package/dist/components/Logo.vue.js.map +1 -0
  35. package/dist/components/SendingRequest.vue.d.ts +3 -0
  36. package/dist/components/SendingRequest.vue.d.ts.map +1 -0
  37. package/dist/components/SendingRequest.vue.js +26 -0
  38. package/dist/components/SendingRequest.vue.js.map +1 -0
  39. package/dist/components/Suggestion.vue.d.ts +10 -0
  40. package/dist/components/Suggestion.vue.d.ts.map +1 -0
  41. package/dist/components/Suggestion.vue.js +8 -0
  42. package/dist/components/Suggestion.vue.js.map +1 -0
  43. package/dist/components/Suggestion.vue2.js +28 -0
  44. package/dist/components/Suggestion.vue2.js.map +1 -0
  45. package/dist/components/TestRequestButton.vue.d.ts +8 -0
  46. package/dist/components/TestRequestButton.vue.d.ts.map +1 -0
  47. package/dist/components/TestRequestButton.vue.js +8 -0
  48. package/dist/components/TestRequestButton.vue.js.map +1 -0
  49. package/dist/components/TestRequestButton.vue2.js +37 -0
  50. package/dist/components/TestRequestButton.vue2.js.map +1 -0
  51. package/dist/helpers.d.ts +39 -0
  52. package/dist/helpers.d.ts.map +1 -0
  53. package/dist/helpers.js +111 -0
  54. package/dist/helpers.js.map +1 -0
  55. package/dist/hooks/useActiveServer.d.ts +2 -0
  56. package/dist/hooks/useActiveServer.d.ts.map +1 -0
  57. package/dist/hooks/useActiveServer.js +20 -0
  58. package/dist/hooks/useActiveServer.js.map +1 -0
  59. package/dist/hooks/useChatOperationBlocks.d.ts +3 -0
  60. package/dist/hooks/useChatOperationBlocks.d.ts.map +1 -0
  61. package/dist/hooks/useChatOperationBlocks.js +29 -0
  62. package/dist/hooks/useChatOperationBlocks.js.map +1 -0
  63. package/dist/hooks/useChatScroll.d.ts +2 -0
  64. package/dist/hooks/useChatScroll.d.ts.map +1 -0
  65. package/dist/hooks/useChatScroll.js +22 -0
  66. package/dist/hooks/useChatScroll.js.map +1 -0
  67. package/dist/hooks/useSecuritySchemes.d.ts +2 -0
  68. package/dist/hooks/useSecuritySchemes.d.ts.map +1 -0
  69. package/dist/hooks/useSecuritySchemes.js +29 -0
  70. package/dist/hooks/useSecuritySchemes.js.map +1 -0
  71. package/dist/index.d.ts +2 -0
  72. package/dist/index.d.ts.map +1 -0
  73. package/dist/index.js +5 -0
  74. package/dist/index.js.map +1 -0
  75. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/api.js +11 -0
  76. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/api.js.map +1 -0
  77. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/core.js +58 -0
  78. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/core.js.map +1 -0
  79. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/errors.js +25 -0
  80. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/errors.js.map +1 -0
  81. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/parse.js +64 -0
  82. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/parse.js.map +1 -0
  83. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/regexes.js +8 -0
  84. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/regexes.js.map +1 -0
  85. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/schemas.js +181 -0
  86. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/schemas.js.map +1 -0
  87. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/util.js +61 -0
  88. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/util.js.map +1 -0
  89. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/versions.js +9 -0
  90. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/core/versions.js.map +1 -0
  91. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/mini/schemas.js +60 -0
  92. package/dist/node_modules/.pnpm/zod@4.1.11/node_modules/zod/v4/mini/schemas.js.map +1 -0
  93. package/dist/package.json +63 -0
  94. package/dist/registry/get-document.d.ts +4 -0
  95. package/dist/registry/get-document.d.ts.map +1 -0
  96. package/dist/registry/get-document.js +23 -0
  97. package/dist/registry/get-document.js.map +1 -0
  98. package/dist/state/state.d.ts +47 -0
  99. package/dist/state/state.d.ts.map +1 -0
  100. package/dist/state/state.js +107 -0
  101. package/dist/state/state.js.map +1 -0
  102. package/dist/style.css +12261 -0
  103. package/dist/views/Auth.vue.d.ts +17 -0
  104. package/dist/views/Auth.vue.d.ts.map +1 -0
  105. package/dist/views/Auth.vue.js +71 -0
  106. package/dist/views/Auth.vue.js.map +1 -0
  107. package/dist/views/Auth.vue2.js +5 -0
  108. package/dist/views/Auth.vue2.js.map +1 -0
  109. package/dist/views/Chat/Chat.vue.d.ts +7 -0
  110. package/dist/views/Chat/Chat.vue.d.ts.map +1 -0
  111. package/dist/views/Chat/Chat.vue.js +8 -0
  112. package/dist/views/Chat/Chat.vue.js.map +1 -0
  113. package/dist/views/Chat/Chat.vue2.js +72 -0
  114. package/dist/views/Chat/Chat.vue2.js.map +1 -0
  115. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +10 -0
  116. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +1 -0
  117. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +8 -0
  118. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js.map +1 -0
  119. package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +62 -0
  120. package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js.map +1 -0
  121. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts +11 -0
  122. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts.map +1 -0
  123. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js +8 -0
  124. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js.map +1 -0
  125. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js +66 -0
  126. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js.map +1 -0
  127. package/dist/views/Chat/Messages/Text.vue.d.ts +8 -0
  128. package/dist/views/Chat/Messages/Text.vue.d.ts.map +1 -0
  129. package/dist/views/Chat/Messages/Text.vue.js +21 -0
  130. package/dist/views/Chat/Messages/Text.vue.js.map +1 -0
  131. package/dist/views/Chat/Messages/Text.vue2.js +5 -0
  132. package/dist/views/Chat/Messages/Text.vue2.js.map +1 -0
  133. package/dist/views/Layout.vue.d.ts +7 -0
  134. package/dist/views/Layout.vue.d.ts.map +1 -0
  135. package/dist/views/Layout.vue.js +8 -0
  136. package/dist/views/Layout.vue.js.map +1 -0
  137. package/dist/views/Layout.vue2.js +32 -0
  138. package/dist/views/Layout.vue2.js.map +1 -0
  139. package/dist/views/PromptForm.vue.d.ts +10 -0
  140. package/dist/views/PromptForm.vue.d.ts.map +1 -0
  141. package/dist/views/PromptForm.vue.js +8 -0
  142. package/dist/views/PromptForm.vue.js.map +1 -0
  143. package/dist/views/PromptForm.vue2.js +125 -0
  144. package/dist/views/PromptForm.vue2.js.map +1 -0
  145. package/dist/views/Settings.vue.d.ts +7 -0
  146. package/dist/views/Settings.vue.d.ts.map +1 -0
  147. package/dist/views/Settings.vue.js +9 -0
  148. package/dist/views/Settings.vue.js.map +1 -0
  149. package/dist/views/Settings.vue2.js +81 -0
  150. package/dist/views/Settings.vue2.js.map +1 -0
  151. package/dist/views/Start.vue.d.ts +7 -0
  152. package/dist/views/Start.vue.d.ts.map +1 -0
  153. package/dist/views/Start.vue.js +8 -0
  154. package/dist/views/Start.vue.js.map +1 -0
  155. package/dist/views/Start.vue2.js +57 -0
  156. package/dist/views/Start.vue2.js.map +1 -0
  157. package/package.json +63 -0
@@ -0,0 +1,17 @@
1
+ import { type MergedSecuritySchemes } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block';
2
+ import type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference';
3
+ import type { WorkspaceEventBus } from '@scalar/workspace-store/events';
4
+ import type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments';
5
+ import type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
6
+ import type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace';
7
+ type __VLS_Props = {
8
+ options: Pick<ApiReferenceConfigurationRaw, 'authentication' | 'persistAuth' | 'proxyUrl'>;
9
+ document: WorkspaceDocument | undefined;
10
+ eventBus: WorkspaceEventBus;
11
+ securitySchemes: MergedSecuritySchemes;
12
+ selectedServer: ServerObject | null;
13
+ environment: XScalarEnvironment;
14
+ };
15
+ 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>;
16
+ export default _default;
17
+ //# sourceMappingURL=Auth.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Auth.vue.d.ts","sourceRoot":"","sources":["../../src/views/Auth.vue"],"names":[],"mappings":"AA6FA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,yDAAyD,CAAA;AAKhE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2EAA2E,CAAA;AACnH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8DAA8D,CAAA;AAChG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAIlF,KAAK,WAAW,GAAG;IACf,OAAO,EAAE,IAAI,CACX,4BAA4B,EAC5B,gBAAgB,GAAG,aAAa,GAAG,UAAU,CAC9C,CAAA;IACD,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAA;IACvC,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,eAAe,EAAE,qBAAqB,CAAA;IACtC,cAAc,EAAE,YAAY,GAAG,IAAI,CAAA;IACnC,WAAW,EAAE,kBAAkB,CAAA;CAChC,CAAC;;AAiHJ,wBAEG"}
@@ -0,0 +1,71 @@
1
+ import { defineComponent, computed, watch, createBlock, createCommentVNode, openBlock, unref } from "vue";
2
+ import { AuthSelector } from "@scalar/api-client/v2/blocks/scalar-auth-selector-block";
3
+ import { getSecurityRequirements, getSelectedSecurity } from "@scalar/api-client/v2/features/operation";
4
+ import { getDefaultSecurity } from "../helpers.js";
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ __name: "Auth",
7
+ props: {
8
+ options: {},
9
+ document: {},
10
+ eventBus: {},
11
+ securitySchemes: {},
12
+ selectedServer: {},
13
+ environment: {}
14
+ },
15
+ setup(__props) {
16
+ const securityRequirements = computed(
17
+ () => getSecurityRequirements(__props.document?.security)
18
+ );
19
+ const selectedSecurity = computed(
20
+ () => getSelectedSecurity(
21
+ __props.document?.["x-scalar-selected-security"],
22
+ void 0,
23
+ securityRequirements.value
24
+ )
25
+ );
26
+ watch(
27
+ () => __props.document?.["x-scalar-selected-security"],
28
+ (documentSelectedSecurity) => {
29
+ if (typeof documentSelectedSecurity !== "undefined") {
30
+ return;
31
+ }
32
+ const defaultSecurity = getDefaultSecurity(
33
+ securityRequirements.value,
34
+ __props.options.authentication?.preferredSecurityScheme,
35
+ __props.securitySchemes
36
+ );
37
+ if (!defaultSecurity) {
38
+ return;
39
+ }
40
+ __props.eventBus.emit("auth:update:selected-security-schemes", {
41
+ selectedRequirements: [defaultSecurity],
42
+ newSchemes: [],
43
+ meta: { type: "document" }
44
+ });
45
+ },
46
+ { immediate: true }
47
+ );
48
+ return (_ctx, _cache) => {
49
+ return Object.keys(_ctx.securitySchemes).length ? (openBlock(), createBlock(unref(AuthSelector), {
50
+ key: 0,
51
+ environment: _ctx.environment,
52
+ eventBus: _ctx.eventBus,
53
+ isReadOnly: "",
54
+ isStatic: "",
55
+ layout: "reference",
56
+ meta: { type: "document" },
57
+ persistAuth: _ctx.options.persistAuth,
58
+ proxyUrl: _ctx.options.proxyUrl ?? "",
59
+ securityRequirements: securityRequirements.value,
60
+ securitySchemes: _ctx.securitySchemes,
61
+ selectedSecurity: selectedSecurity.value,
62
+ server: _ctx.selectedServer,
63
+ title: "Authentication"
64
+ }, null, 8, ["environment", "eventBus", "persistAuth", "proxyUrl", "securityRequirements", "securitySchemes", "selectedSecurity", "server"])) : createCommentVNode("", true);
65
+ };
66
+ }
67
+ });
68
+ export {
69
+ _sfc_main as default
70
+ };
71
+ //# sourceMappingURL=Auth.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Auth.vue.js","sources":["../../src/views/Auth.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, watch } from 'vue'\n\nimport {\n AuthSelector,\n type MergedSecuritySchemes,\n} from '@scalar/api-client/v2/blocks/scalar-auth-selector-block'\nimport {\n getSecurityRequirements,\n getSelectedSecurity,\n} from '@scalar/api-client/v2/features/operation'\nimport type { ApiReferenceConfigurationRaw } from '@scalar/types/api-reference'\nimport type { WorkspaceEventBus } from '@scalar/workspace-store/events'\nimport type { XScalarEnvironment } from '@scalar/workspace-store/schemas/extensions/document/x-scalar-environments'\nimport type { ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'\nimport type { WorkspaceDocument } from '@scalar/workspace-store/schemas/workspace'\n\nimport { getDefaultSecurity } from '@/helpers'\n\nconst { document, environment, eventBus, options, securitySchemes } =\n defineProps<{\n options: Pick<\n ApiReferenceConfigurationRaw,\n 'authentication' | 'persistAuth' | 'proxyUrl'\n >\n document: WorkspaceDocument | undefined\n eventBus: WorkspaceEventBus\n securitySchemes: MergedSecuritySchemes\n selectedServer: ServerObject | null\n environment: XScalarEnvironment\n }>()\n\n/** Compute what the security requirements should be for the document */\nconst securityRequirements = computed(() =>\n getSecurityRequirements(document?.security),\n)\n\n/** The selected security keys for the document */\nconst selectedSecurity = computed(() =>\n getSelectedSecurity(\n document?.['x-scalar-selected-security'],\n undefined,\n securityRequirements.value,\n ),\n)\n\n// We set the initial security on the document to the default if it doesn't exist\nwatch(\n () => document?.['x-scalar-selected-security'],\n (documentSelectedSecurity) => {\n if (typeof documentSelectedSecurity !== 'undefined') {\n return\n }\n\n const defaultSecurity = getDefaultSecurity(\n securityRequirements.value,\n options.authentication?.preferredSecurityScheme,\n securitySchemes,\n )\n if (!defaultSecurity) {\n return\n }\n\n eventBus.emit('auth:update:selected-security-schemes', {\n selectedRequirements: [defaultSecurity],\n newSchemes: [],\n meta: { type: 'document' },\n })\n },\n { immediate: true },\n)\n</script>\n<template>\n <AuthSelector\n v-if=\"Object.keys(securitySchemes).length\"\n :environment\n :eventBus\n isReadOnly\n isStatic\n layout=\"reference\"\n :meta=\"{ type: 'document' }\"\n :persistAuth=\"options.persistAuth\"\n :proxyUrl=\"options.proxyUrl ?? ''\"\n :securityRequirements\n :securitySchemes\n :selectedSecurity\n :server=\"selectedServer\"\n title=\"Authentication\" />\n</template>\n"],"names":["securitySchemes","_createBlock","_unref","environment","eventBus","options","selectedServer"],"mappings":";;;;;;;;;;;;;;;AAiCA,UAAM,uBAAuB;AAAA,MAAS,MACpC,wBAAwB,kBAAU,QAAQ;AAAA,IAAA;AAI5C,UAAM,mBAAmB;AAAA,MAAS,MAChC;AAAA,QACE,QAAA,WAAW,4BAA4B;AAAA,QACvC;AAAA,QACA,qBAAqB;AAAA,MAAA;AAAA,IACvB;AAIF;AAAA,MACE,MAAM,QAAA,WAAW,4BAA4B;AAAA,MAC7C,CAAC,6BAA6B;AAC5B,YAAI,OAAO,6BAA6B,aAAa;AACnD;AAAA,QACF;AAEA,cAAM,kBAAkB;AAAA,UACtB,qBAAqB;AAAA,UACrB,QAAA,QAAQ,gBAAgB;AAAA,UACxB,QAAA;AAAA,QAAA;AAEF,YAAI,CAAC,iBAAiB;AACpB;AAAA,QACF;AAEA,gBAAA,SAAS,KAAK,yCAAyC;AAAA,UACrD,sBAAsB,CAAC,eAAe;AAAA,UACtC,YAAY,CAAA;AAAA,UACZ,MAAM,EAAE,MAAM,WAAA;AAAA,QAAW,CAC1B;AAAA,MACH;AAAA,MACA,EAAE,WAAW,KAAA;AAAA,IAAK;;AAKV,aAAA,OAAO,KAAKA,KAAAA,eAAe,EAAE,uBADrCC,YAc2BC,MAAA,YAAA,GAAA;AAAA;QAZxB,aAAAC,KAAAA;AAAAA,QACA,UAAAC,KAAAA;AAAAA,QACD,YAAA;AAAA,QACA,UAAA;AAAA,QACA,QAAO;AAAA,QACN,MAAM,EAAA,MAAA,WAAA;AAAA,QACN,aAAaC,KAAAA,QAAQ;AAAA,QACrB,UAAUA,KAAAA,QAAQ,YAAQ;AAAA,QAC1B,sBAAA,qBAAA;AAAA,QACA,iBAAAL,KAAAA;AAAAA,QACA,kBAAA,iBAAA;AAAA,QACA,QAAQM,KAAAA;AAAAA,QACT,OAAM;AAAA,MAAA;;;;"}
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./Auth.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
5
+ //# sourceMappingURL=Auth.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Auth.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,7 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
2
+ submit: () => any;
3
+ }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
4
+ onSubmit?: (() => any) | undefined;
5
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ export default _default;
7
+ //# sourceMappingURL=Chat.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chat.vue.d.ts","sourceRoot":"","sources":["../../../src/views/Chat/Chat.vue"],"names":[],"mappings":";;;;;AA2QA,wBAEG"}
@@ -0,0 +1,8 @@
1
+ import _sfc_main from "./Chat.vue2.js";
2
+ /* empty css */
3
+ import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const Chat = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f1f3a3f7"]]);
5
+ export {
6
+ Chat as default
7
+ };
8
+ //# sourceMappingURL=Chat.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chat.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,72 @@
1
+ import { defineComponent, createElementBlock, openBlock, Fragment, createElementVNode, renderList, unref, createCommentVNode, toDisplayString, createBlock, toRef, reactive, createVNode } from "vue";
2
+ import { setCustomComponents } from "markstream-vue";
3
+ import { EXECUTE_REQUEST_TOOL_NAME, GET_MINI_OPENAPI_SPEC_TOOL_NAME } from "@scalar-org/entities/agent/tools";
4
+ import Endpoint from "../../components/Endpoint.vue.js";
5
+ import { useState } from "../../state/state.js";
6
+ import ExecuteRequestTool from "./Messages/ExecuteRequestTool.vue.js";
7
+ import GetMiniOpenAPIDocTool from "./Messages/GetMiniOpenAPIDocTool.vue.js";
8
+ import _sfc_main$1 from "./Messages/Text.vue.js";
9
+ import PromptForm from "../PromptForm.vue.js";
10
+ const _hoisted_1 = { class: "chat" };
11
+ const _hoisted_2 = { key: 0 };
12
+ const _hoisted_3 = { class: "formContainer" };
13
+ const _sfc_main = /* @__PURE__ */ defineComponent({
14
+ __name: "Chat",
15
+ emits: ["submit"],
16
+ setup(__props, { emit: __emit }) {
17
+ const emit = __emit;
18
+ const state = useState();
19
+ setCustomComponents({
20
+ operation: Endpoint
21
+ });
22
+ return (_ctx, _cache) => {
23
+ return openBlock(), createElementBlock(Fragment, null, [
24
+ createElementVNode("div", _hoisted_1, [
25
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(state).chat.messages, (message) => {
26
+ return openBlock(), createElementBlock(Fragment, {
27
+ key: message.id
28
+ }, [
29
+ message.role === "user" ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(message.parts, (part, index) => {
30
+ return openBlock(), createElementBlock("div", {
31
+ key: `${message.id}-${index}`,
32
+ class: "userMessage"
33
+ }, [
34
+ part.type === "text" ? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString(part.text), 1)) : createCommentVNode("", true)
35
+ ]);
36
+ }), 128)) : createCommentVNode("", true),
37
+ message.role === "assistant" ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(message.parts, (part, index) => {
38
+ return openBlock(), createElementBlock("div", {
39
+ key: `${message.id}-${index}`
40
+ }, [
41
+ part.type === "text" ? (openBlock(), createBlock(_sfc_main$1, {
42
+ key: 0,
43
+ messagePart: toRef(part)
44
+ }, null, 8, ["messagePart"])) : createCommentVNode("", true),
45
+ part.type === `tool-${unref(EXECUTE_REQUEST_TOOL_NAME)}` ? (openBlock(), createBlock(ExecuteRequestTool, {
46
+ key: 1,
47
+ messagePart: toRef(part)
48
+ }, null, 8, ["messagePart"])) : createCommentVNode("", true),
49
+ part.type === `tool-${unref(GET_MINI_OPENAPI_SPEC_TOOL_NAME)}` ? (openBlock(), createBlock(GetMiniOpenAPIDocTool, {
50
+ key: 2,
51
+ message: reactive(message),
52
+ messagePart: toRef(part)
53
+ }, null, 8, ["message", "messagePart"])) : createCommentVNode("", true)
54
+ ]);
55
+ }), 128)) : createCommentVNode("", true)
56
+ ], 64);
57
+ }), 128)),
58
+ _cache[1] || (_cache[1] = createElementVNode("div", { class: "spacer" }, null, -1))
59
+ ]),
60
+ createElementVNode("div", _hoisted_3, [
61
+ createVNode(PromptForm, {
62
+ onSubmit: _cache[0] || (_cache[0] = ($event) => emit("submit"))
63
+ })
64
+ ])
65
+ ], 64);
66
+ };
67
+ }
68
+ });
69
+ export {
70
+ _sfc_main as default
71
+ };
72
+ //# sourceMappingURL=Chat.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chat.vue2.js","sources":["../../../src/views/Chat/Chat.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { setCustomComponents } from 'markstream-vue'\nimport { reactive, toRef } from 'vue'\n\nimport {\n EXECUTE_REQUEST_TOOL_NAME,\n GET_MINI_OPENAPI_SPEC_TOOL_NAME,\n} from '@scalar-org/entities/agent/tools'\n\nimport Endpoint from '@/components/Endpoint.vue'\nimport { useState } from '@/state/state'\nimport ExecuteRequestTool from '@/views/Chat/Messages/ExecuteRequestTool.vue'\nimport GetMiniOpenAPIDocTool from '@/views/Chat/Messages/GetMiniOpenAPIDocTool.vue'\nimport Text from '@/views/Chat/Messages/Text.vue'\nimport PromptForm from '@/views/PromptForm.vue'\n\nconst emit = defineEmits<{\n (e: 'submit'): void\n}>()\n\nconst state = useState()\n\nsetCustomComponents({\n operation: Endpoint,\n})\n</script>\n\n<template>\n <div class=\"chat\">\n <template\n v-for=\"message in state.chat.messages\"\n :key=\"message.id\">\n <template v-if=\"message.role === 'user'\">\n <div\n v-for=\"(part, index) in message.parts\"\n :key=\"`${message.id}-${index}`\"\n class=\"userMessage\">\n <p v-if=\"part.type === 'text'\">{{ part.text }}</p>\n </div>\n </template>\n <template v-if=\"message.role === 'assistant'\">\n <div\n v-for=\"(part, index) in message.parts\"\n :key=\"`${message.id}-${index}`\">\n <Text\n v-if=\"part.type === 'text'\"\n :messagePart=\"toRef(part)\" />\n <ExecuteRequestTool\n v-if=\"part.type === (`tool-${EXECUTE_REQUEST_TOOL_NAME}` as const)\"\n :messagePart=\"toRef(part)\" />\n <GetMiniOpenAPIDocTool\n v-if=\"\n part.type === (`tool-${GET_MINI_OPENAPI_SPEC_TOOL_NAME}` as const)\n \"\n :message=\"reactive(message)\"\n :messagePart=\"toRef(part)\" />\n </div>\n </template>\n </template>\n <div class=\"spacer\"></div>\n </div>\n <div class=\"formContainer\">\n <PromptForm @submit=\"emit('submit')\" />\n </div>\n</template>\n\n<style scoped>\n.chat {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 10px;\n width: 100%;\n max-width: 800px;\n margin: 0 30px;\n}\n\n.userMessage {\n background: var(--scalar-background-3);\n padding: 10px 18px;\n border-radius: 25px;\n margin-left: auto;\n}\n\n.spacer {\n min-height: 180px;\n width: 100%;\n}\n\n.formContainer {\n position: fixed;\n bottom: 20px;\n width: 100%;\n max-width: 800px;\n z-index: 1;\n padding: 0 15px;\n}\n</style>\n"],"names":["_createElementVNode","_openBlock","_createElementBlock","_Fragment","_unref","_toDisplayString","_createBlock","Text","_createVNode"],"mappings":";;;;;;;;;;;;;;;;AAgBA,UAAM,OAAO;AAIb,UAAM,QAAQ,SAAA;AAEd,wBAAoB;AAAA,MAClB,WAAW;AAAA,IAAA,CACZ;;;QAICA,mBAgCM,OAhCN,YAgCM;AAAA,WA/BJC,UAAA,IAAA,GAAAC,mBA6BWC,2BA5BSC,MAAA,KAAA,EAAM,KAAK,WAAtB,YAAO;;cACR,KAAA,QAAQ;AAAA,YAAA;cACE,QAAQ,SAAI,UAC1BH,UAAA,IAAA,GAAAC,mBAKMC,iCAJoB,QAAQ,OAAK,CAA7B,MAAM,UAAK;oCADrBD,mBAKM,OAAA;AAAA,kBAHH,KAAG,GAAK,QAAQ,EAAE,IAAI,KAAK;AAAA,kBAC5B,OAAM;AAAA,gBAAA;kBACG,KAAK,SAAI,uBAAlBA,mBAAkD,KAAA,YAAAG,gBAAhB,KAAK,IAAI,GAAA,CAAA;;;cAG/B,QAAQ,SAAI,eAC1BJ,UAAA,IAAA,GAAAC,mBAeMC,iCAdoB,QAAQ,OAAK,CAA7B,MAAM,UAAK;oCADrBD,mBAeM,OAAA;AAAA,kBAbH,KAAG,GAAK,QAAQ,EAAE,IAAI,KAAK;AAAA,gBAAA;kBAEpB,KAAK,SAAI,uBADjBI,YAE+BC,aAAA;AAAA;oBAA5B,aAAa,MAAM,IAAI;AAAA,kBAAA;kBAElB,KAAK,SAAI,QAAcH,MAAA,yBAAA,CAAyB,mBADxDE,YAE+B,oBAAA;AAAA;oBAA5B,aAAa,MAAM,IAAI;AAAA,kBAAA;kBAEH,KAAK,SAAI,QAAcF,MAAA,+BAAA,CAA+B,mBAD7EE,YAK+B,uBAAA;AAAA;oBAD5B,SAAS,SAAS,OAAO;AAAA,oBACzB,aAAa,MAAM,IAAI;AAAA,kBAAA;;;;;oCAIhCN,mBAA0B,OAAA,EAArB,OAAM,YAAQ,MAAA,EAAA;AAAA,QAAA;QAErBA,mBAEM,OAFN,YAEM;AAAA,UADJQ,YAAuC,YAAA;AAAA,YAA1B,gDAAQ,KAAI,QAAA;AAAA,UAAA;;;;;;"}
@@ -0,0 +1,10 @@
1
+ import { type ToolUIPart } from 'ai';
2
+ import { type Ref } from 'vue';
3
+ import { type EXECUTE_REQUEST_TOOL_NAME } from '@scalar-org/entities/agent/tools';
4
+ import { type Tools } from '../../../state/state.js';
5
+ type __VLS_Props = {
6
+ messagePart: Ref<ToolUIPart<Pick<Tools, typeof EXECUTE_REQUEST_TOOL_NAME>>>;
7
+ };
8
+ 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>;
9
+ export default _default;
10
+ //# sourceMappingURL=ExecuteRequestTool.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecuteRequestTool.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Chat/Messages/ExecuteRequestTool.vue"],"names":[],"mappings":"AA2EA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,IAAI,CAAA;AACpC,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAG9B,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,kCAAkC,CAAA;AAGjF,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,eAAe,CAAA;AAEpD,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAA;CAC5E,CAAC;;AAsIF,wBAEG"}
@@ -0,0 +1,8 @@
1
+ import _sfc_main from "./ExecuteRequestTool.vue2.js";
2
+ /* empty css */
3
+ import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const ExecuteRequestTool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-9b181e19"]]);
5
+ export {
6
+ ExecuteRequestTool as default
7
+ };
8
+ //# sourceMappingURL=ExecuteRequestTool.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecuteRequestTool.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,62 @@
1
+ import { defineComponent, createElementBlock, openBlock, createCommentVNode, unref, createVNode, withCtx, createTextVNode } from "vue";
2
+ import { ScalarButton, ScalarCodeBlock } from "@scalar/components";
3
+ import SendingRequest from "../../../components/SendingRequest.vue.js";
4
+ import { useState } from "../../../state/state.js";
5
+ const _hoisted_1 = { class: "executeRequestTool" };
6
+ const _hoisted_2 = { key: 0 };
7
+ const _hoisted_3 = { key: 1 };
8
+ const _hoisted_4 = {
9
+ key: 2,
10
+ class: "tool"
11
+ };
12
+ const _hoisted_5 = {
13
+ key: 3,
14
+ class: "tool"
15
+ };
16
+ const _sfc_main = /* @__PURE__ */ defineComponent({
17
+ __name: "ExecuteRequestTool",
18
+ props: {
19
+ messagePart: {}
20
+ },
21
+ setup(__props) {
22
+ const state = useState();
23
+ return (_ctx, _cache) => {
24
+ return openBlock(), createElementBlock("div", _hoisted_1, [
25
+ _ctx.messagePart.value.state === "input-available" && unref(state).chat.status === "streaming" || _ctx.messagePart.value.state === "approval-responded" && unref(state).chat.status === "submitted" ? (openBlock(), createElementBlock("div", _hoisted_2, [
26
+ createVNode(SendingRequest)
27
+ ])) : createCommentVNode("", true),
28
+ _ctx.messagePart.value.state === "approval-requested" ? (openBlock(), createElementBlock("div", _hoisted_3, [
29
+ createVNode(unref(ScalarButton), {
30
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(state).chat.addToolApprovalResponse({
31
+ id: _ctx.messagePart.value.approval.id,
32
+ approved: true
33
+ }))
34
+ }, {
35
+ default: withCtx(() => [..._cache[1] || (_cache[1] = [
36
+ createTextVNode(" Click To Approve ", -1)
37
+ ])]),
38
+ _: 1
39
+ })
40
+ ])) : createCommentVNode("", true),
41
+ _ctx.messagePart.value.input ? (openBlock(), createElementBlock("div", _hoisted_4, [
42
+ createVNode(unref(ScalarCodeBlock), {
43
+ content: _ctx.messagePart.value.input,
44
+ lang: "json",
45
+ lineNumbers: ""
46
+ }, null, 8, ["content"])
47
+ ])) : createCommentVNode("", true),
48
+ _ctx.messagePart.value.output ? (openBlock(), createElementBlock("div", _hoisted_5, [
49
+ createVNode(unref(ScalarCodeBlock), {
50
+ content: _ctx.messagePart.value.output,
51
+ lang: "json",
52
+ lineNumbers: ""
53
+ }, null, 8, ["content"])
54
+ ])) : createCommentVNode("", true)
55
+ ]);
56
+ };
57
+ }
58
+ });
59
+ export {
60
+ _sfc_main as default
61
+ };
62
+ //# sourceMappingURL=ExecuteRequestTool.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecuteRequestTool.vue2.js","sources":["../../../../src/views/Chat/Messages/ExecuteRequestTool.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { type ToolUIPart } from 'ai'\nimport { type Ref } from 'vue'\n\nimport { ScalarButton, ScalarCodeBlock } from '@scalar/components'\nimport { type EXECUTE_REQUEST_TOOL_NAME } from '@scalar-org/entities/agent/tools'\n\nimport SendingRequest from '@/components/SendingRequest.vue'\nimport { type Tools, useState } from '@/state/state'\n\nconst { messagePart } = defineProps<{\n messagePart: Ref<ToolUIPart<Pick<Tools, typeof EXECUTE_REQUEST_TOOL_NAME>>>\n}>()\n\nconst state = useState()\n</script>\n\n<template>\n <div class=\"executeRequestTool\">\n <div\n v-if=\"\n (messagePart.value.state === 'input-available' &&\n state.chat.status === 'streaming') ||\n (messagePart.value.state === 'approval-responded' &&\n state.chat.status === 'submitted')\n \">\n <SendingRequest />\n </div>\n <div v-if=\"messagePart.value.state === 'approval-requested'\">\n <ScalarButton\n @click=\"\n state.chat.addToolApprovalResponse({\n id: messagePart.value.approval.id,\n approved: true,\n })\n \">\n Click To Approve\n </ScalarButton>\n </div>\n <div\n v-if=\"messagePart.value.input\"\n class=\"tool\">\n <ScalarCodeBlock\n :content=\"messagePart.value.input\"\n lang=\"json\"\n lineNumbers />\n </div>\n <div\n v-if=\"messagePart.value.output\"\n class=\"tool\">\n <ScalarCodeBlock\n :content=\"messagePart.value.output\"\n lang=\"json\"\n lineNumbers />\n </div>\n </div>\n</template>\n\n<style scoped>\n.executeRequestTool {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin-top: 20px;\n}\n\n.tool {\n border: var(--scalar-border-width) solid var(--scalar-border-color);\n padding: 15px;\n border-radius: 15px;\n margin-bottom: 20px;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","messagePart","_unref","_createVNode"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAcA,UAAM,QAAQ,SAAA;;AAIZ,aAAAA,UAAA,GAAAC,mBAqCM,OArCN,YAqCM;AAAA,QAnCcC,KAAAA,YAAY,MAAM,UAAK,qBAAoCC,MAAA,KAAA,EAAM,KAAK,WAAM,eAA8BD,KAAAA,YAAY,MAAM,UAAK,wBAAuCC,MAAA,KAAA,EAAM,KAAK,WAAM,4BAD3MF,mBAQM,OAAA,YAAA;AAAA,UADJG,YAAkB,cAAA;AAAA,QAAA;QAETF,KAAAA,YAAY,MAAM,UAAK,qCAAlCD,mBAUM,OAAA,YAAA;AAAA,UATJG,YAQeD,MAAA,YAAA,GAAA;AAAA,YAPZ,SAAK,OAAA,CAAA,MAAA,OAAA,CAAA,IAAA,CAAA,WAAaA,MAAA,KAAA,EAAM,KAAK,wBAAuB;AAAA,cAAmBD,IAAAA,KAAAA,YAAY,MAAM,SAAS;AAAA;;;6BAKjG,MAEJ,CAAA,GAAA,OAAA,CAAA,MAAA,OAAA,CAAA,IAAA;AAAA,8BAFI,sBAEJ,EAAA;AAAA,YAAA;;;;QAGMA,KAAAA,YAAY,MAAM,SAD1BF,aAAAC,mBAOM,OAPN,YAOM;AAAA,UAJJG,YAGgBD,MAAA,eAAA,GAAA;AAAA,YAFb,SAASD,KAAAA,YAAY,MAAM;AAAA,YAC5B,MAAK;AAAA,YACL,aAAA;AAAA,UAAA;;QAGIA,KAAAA,YAAY,MAAM,UAD1BF,aAAAC,mBAOM,OAPN,YAOM;AAAA,UAJJG,YAGgBD,MAAA,eAAA,GAAA;AAAA,YAFb,SAASD,KAAAA,YAAY,MAAM;AAAA,YAC5B,MAAK;AAAA,YACL,aAAA;AAAA,UAAA;;;;;;"}
@@ -0,0 +1,11 @@
1
+ import { type ToolUIPart, type UIMessage } from 'ai';
2
+ import { type Reactive, type Ref } from 'vue';
3
+ import { type GET_MINI_OPENAPI_SPEC_TOOL_NAME } from '@scalar-org/entities/agent/tools';
4
+ import { type Tools } from '../../../state/state.js';
5
+ type __VLS_Props = {
6
+ messagePart: Ref<ToolUIPart<Pick<Tools, typeof GET_MINI_OPENAPI_SPEC_TOOL_NAME>>>;
7
+ message: Reactive<UIMessage>;
8
+ };
9
+ 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>;
10
+ export default _default;
11
+ //# sourceMappingURL=GetMiniOpenAPIDocTool.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetMiniOpenAPIDocTool.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Chat/Messages/GetMiniOpenAPIDocTool.vue"],"names":[],"mappings":"AAoFA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,IAAI,CAAA;AACpD,OAAO,EAAY,KAAK,QAAQ,EAAE,KAAK,GAAG,EAAc,MAAM,KAAK,CAAA;AAEnE,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,kCAAkC,CAAA;AAKvF,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,eAAe,CAAA;AAEpD,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,GAAG,CACd,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,+BAA+B,CAAC,CAAC,CAChE,CAAA;IACD,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAA;CAC7B,CAAC;;AAkHF,wBAEG"}
@@ -0,0 +1,8 @@
1
+ import _sfc_main from "./GetMiniOpenAPIDocTool.vue2.js";
2
+ /* empty css */
3
+ import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.js";
4
+ const GetMiniOpenAPIDocTool = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ee54c474"]]);
5
+ export {
6
+ GetMiniOpenAPIDocTool as default
7
+ };
8
+ //# sourceMappingURL=GetMiniOpenAPIDocTool.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetMiniOpenAPIDocTool.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,66 @@
1
+ import { defineComponent, ref, watch, computed, createElementBlock, openBlock, Fragment, createCommentVNode, unref, createVNode, renderList, createBlock, withCtx, createTextVNode, toDisplayString } from "vue";
2
+ import ContextItem from "../../../components/ContextItem.vue.js";
3
+ import LoadingMiniOpenAPIDoc from "../../../components/LoadingMiniOpenAPIDoc.vue.js";
4
+ import { getOperations } from "../../../helpers.js";
5
+ import { useState } from "../../../state/state.js";
6
+ const _hoisted_1 = { key: 0 };
7
+ const _hoisted_2 = {
8
+ key: 1,
9
+ class: "operations"
10
+ };
11
+ const _sfc_main = /* @__PURE__ */ defineComponent({
12
+ __name: "GetMiniOpenAPIDocTool",
13
+ props: {
14
+ messagePart: {},
15
+ message: {}
16
+ },
17
+ setup(__props) {
18
+ const messageFinished = ref(false);
19
+ watch(
20
+ () => __props.message,
21
+ () => {
22
+ const parts = __props.message.parts;
23
+ const index = parts.findIndex(
24
+ (part) => "toolCallId" in part && part.toolCallId === __props.messagePart.value.toolCallId
25
+ );
26
+ const nextPart = parts[index + 1];
27
+ messageFinished.value = nextPart?.type === "step-start";
28
+ }
29
+ );
30
+ const operations = computed(() => {
31
+ if (!__props.messagePart.value.output?.structuredContent) return;
32
+ const title = __props.messagePart.value.output?.structuredContent?.info?.title;
33
+ const documentOperations = getOperations(
34
+ __props.messagePart.value.output?.structuredContent
35
+ );
36
+ return documentOperations.map(
37
+ (operation) => `${title ? `${title} - ` : ""}${operation.summary ?? ""}`
38
+ ).filter(Boolean);
39
+ });
40
+ const state = useState();
41
+ return (_ctx, _cache) => {
42
+ return openBlock(), createElementBlock(Fragment, null, [
43
+ _ctx.messagePart.value.state === "input-available" && unref(state).chat.status === "streaming" ? (openBlock(), createElementBlock("div", _hoisted_1, [
44
+ createVNode(LoadingMiniOpenAPIDoc)
45
+ ])) : createCommentVNode("", true),
46
+ operations.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
47
+ (openBlock(true), createElementBlock(Fragment, null, renderList(operations.value, (operation) => {
48
+ return openBlock(), createBlock(ContextItem, {
49
+ key: operation,
50
+ loading: !messageFinished.value
51
+ }, {
52
+ default: withCtx(() => [
53
+ createTextVNode(toDisplayString(operation), 1)
54
+ ]),
55
+ _: 2
56
+ }, 1032, ["loading"]);
57
+ }), 128))
58
+ ])) : createCommentVNode("", true)
59
+ ], 64);
60
+ };
61
+ }
62
+ });
63
+ export {
64
+ _sfc_main as default
65
+ };
66
+ //# sourceMappingURL=GetMiniOpenAPIDocTool.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GetMiniOpenAPIDocTool.vue2.js","sources":["../../../../src/views/Chat/Messages/GetMiniOpenAPIDocTool.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { type ToolUIPart, type UIMessage } from 'ai'\nimport { computed, type Reactive, type Ref, ref, watch } from 'vue'\n\nimport { type GET_MINI_OPENAPI_SPEC_TOOL_NAME } from '@scalar-org/entities/agent/tools'\n\nimport ContextItem from '@/components/ContextItem.vue'\nimport LoadingMiniOpenAPIDoc from '@/components/LoadingMiniOpenAPIDoc.vue'\nimport { getOperations } from '@/helpers'\nimport { type Tools, useState } from '@/state/state'\n\nconst { messagePart, message } = defineProps<{\n messagePart: Ref<\n ToolUIPart<Pick<Tools, typeof GET_MINI_OPENAPI_SPEC_TOOL_NAME>>\n >\n message: Reactive<UIMessage>\n}>()\n\nconst messageFinished = ref(false)\n\nwatch(\n () => message,\n () => {\n const parts = message.parts\n\n const index = parts.findIndex(\n (part) =>\n 'toolCallId' in part &&\n part.toolCallId === messagePart.value.toolCallId,\n )\n\n const nextPart = parts[index + 1]\n messageFinished.value = nextPart?.type === 'step-start'\n },\n)\n\nconst operations = computed(() => {\n if (!messagePart.value.output?.structuredContent) return\n\n const title = messagePart.value.output?.structuredContent?.info?.title\n\n const documentOperations = getOperations(\n messagePart.value.output?.structuredContent,\n )\n\n return documentOperations\n .map(\n (operation) => `${title ? `${title} - ` : ''}${operation.summary ?? ''}`,\n )\n .filter(Boolean)\n})\n\nconst state = useState()\n</script>\n\n<template>\n <div\n v-if=\"\n messagePart.value.state === 'input-available' &&\n state.chat.status === 'streaming'\n \">\n <LoadingMiniOpenAPIDoc />\n </div>\n <div\n v-if=\"operations\"\n class=\"operations\">\n <ContextItem\n v-for=\"operation of operations\"\n :key=\"operation\"\n :loading=\"!messageFinished\"\n >{{ operation }}</ContextItem\n >\n </div>\n</template>\n\n<style scoped>\n.operations {\n display: flex;\n gap: 5px;\n align-items: center;\n}\n</style>\n"],"names":["messagePart","_unref","_createElementBlock","_createVNode","_openBlock","_Fragment","_renderList","_createBlock"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,UAAM,kBAAkB,IAAI,KAAK;AAEjC;AAAA,MACE,MAAM,QAAA;AAAA,MACN,MAAM;AACJ,cAAM,QAAQ,gBAAQ;AAEtB,cAAM,QAAQ,MAAM;AAAA,UAClB,CAAC,SACC,gBAAgB,QAChB,KAAK,eAAe,QAAA,YAAY,MAAM;AAAA,QAAA;AAG1C,cAAM,WAAW,MAAM,QAAQ,CAAC;AAChC,wBAAgB,QAAQ,UAAU,SAAS;AAAA,MAC7C;AAAA,IAAA;AAGF,UAAM,aAAa,SAAS,MAAM;AAChC,UAAI,CAAC,QAAA,YAAY,MAAM,QAAQ,kBAAmB;AAElD,YAAM,QAAQ,QAAA,YAAY,MAAM,QAAQ,mBAAmB,MAAM;AAEjE,YAAM,qBAAqB;AAAA,QACzB,QAAA,YAAY,MAAM,QAAQ;AAAA,MAAA;AAG5B,aAAO,mBACJ;AAAA,QACC,CAAC,cAAc,GAAG,QAAQ,GAAG,KAAK,QAAQ,EAAE,GAAG,UAAU,WAAW,EAAE;AAAA,MAAA,EAEvE,OAAO,OAAO;AAAA,IACnB,CAAC;AAED,UAAM,QAAQ,SAAA;;;QAKGA,KAAAA,YAAY,MAAM,UAAK,qBAAgCC,MAAA,KAAA,EAAM,KAAK,WAAM,4BADvFC,mBAMM,OAAA,YAAA;AAAA,UADJC,YAAyB,qBAAA;AAAA,QAAA;QAGnB,WAAA,SADRC,UAAA,GAAAF,mBASM,OATN,YASM;AAAA,4BANJA,mBAKCG,UAAA,MAAAC,WAJqB,WAAA,OAAU,CAAvB,cAAS;gCADlBC,YAKC,aAAA;AAAA,cAHE,KAAK;AAAA,cACL,UAAU,gBAAA;AAAA,YAAA;+BACV,MAAe;AAAA,gDAAZ,SAAS,GAAA,CAAA;AAAA,cAAA;;;;;;;;;"}
@@ -0,0 +1,8 @@
1
+ import { type TextUIPart } from 'ai';
2
+ import { type Ref } from 'vue';
3
+ type __VLS_Props = {
4
+ messagePart: Ref<TextUIPart>;
5
+ };
6
+ 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>;
7
+ export default _default;
8
+ //# sourceMappingURL=Text.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.vue.d.ts","sourceRoot":"","sources":["../../../../src/views/Chat/Messages/Text.vue"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,IAAI,CAAA;AAEpC,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,GAAG,CAAC,UAAU,CAAC,CAAA;CAC7B,CAAC;;AA+CF,wBAEG"}
@@ -0,0 +1,21 @@
1
+ import { defineComponent, createBlock, openBlock, unref } from "vue";
2
+ import { MarkdownRender } from "markstream-vue";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "Text",
5
+ props: {
6
+ messagePart: {}
7
+ },
8
+ setup(__props) {
9
+ return (_ctx, _cache) => {
10
+ return openBlock(), createBlock(unref(MarkdownRender), {
11
+ class: "markdown",
12
+ content: _ctx.messagePart.value.text,
13
+ customHtmlTags: ["operation"]
14
+ }, null, 8, ["content"]);
15
+ };
16
+ }
17
+ });
18
+ export {
19
+ _sfc_main as default
20
+ };
21
+ //# sourceMappingURL=Text.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.vue.js","sources":["../../../../src/views/Chat/Messages/Text.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { type TextUIPart } from 'ai'\nimport { MarkdownRender } from 'markstream-vue'\nimport { type Ref } from 'vue'\n\nconst { messagePart } = defineProps<{\n messagePart: Ref<TextUIPart>\n}>()\n</script>\n\n<template>\n <MarkdownRender\n class=\"markdown\"\n :content=\"messagePart.value.text\"\n :customHtmlTags=\"['operation']\" />\n</template>\n"],"names":["_createBlock","_unref","messagePart"],"mappings":";;;;;;;;;0BAWEA,YAGoCC,MAAA,cAAA,GAAA;AAAA,QAFlC,OAAM;AAAA,QACL,SAASC,KAAAA,YAAY,MAAM;AAAA,QAC3B,gBAAgB,CAAA,WAAA;AAAA,MAAA;;;;"}
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./Text.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
5
+ //# sourceMappingURL=Text.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.vue2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,7 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
2
+ submit: () => any;
3
+ }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
4
+ onSubmit?: (() => any) | undefined;
5
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ export default _default;
7
+ //# sourceMappingURL=Layout.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Layout.vue.d.ts","sourceRoot":"","sources":["../../src/views/Layout.vue"],"names":[],"mappings":";;;;;AAoJA,wBAEG"}
@@ -0,0 +1,8 @@
1
+ import _sfc_main from "./Layout.vue2.js";
2
+ /* empty css */
3
+ import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
+ const Layout = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6af81051"]]);
5
+ export {
6
+ Layout as default
7
+ };
8
+ //# sourceMappingURL=Layout.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Layout.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,32 @@
1
+ import { defineComponent, createElementBlock, openBlock, createBlock, unref } from "vue";
2
+ import { useActiveServer } from "../hooks/useActiveServer.js";
3
+ import { useSecuritySchemes } from "../hooks/useSecuritySchemes.js";
4
+ import { useState } from "../state/state.js";
5
+ import Chat from "./Chat/Chat.vue.js";
6
+ import Start from "./Start.vue.js";
7
+ const _hoisted_1 = { class: "wrapper" };
8
+ const _sfc_main = /* @__PURE__ */ defineComponent({
9
+ __name: "Layout",
10
+ emits: ["submit"],
11
+ setup(__props, { emit: __emit }) {
12
+ const emit = __emit;
13
+ const { chat } = useState();
14
+ useSecuritySchemes();
15
+ useActiveServer();
16
+ return (_ctx, _cache) => {
17
+ return openBlock(), createElementBlock("div", _hoisted_1, [
18
+ unref(chat).messages.length && (unref(chat).messages.length > 1 || unref(chat).status !== "submitted") ? (openBlock(), createBlock(Chat, {
19
+ key: 0,
20
+ onSubmit: _cache[0] || (_cache[0] = ($event) => emit("submit"))
21
+ })) : (openBlock(), createBlock(Start, {
22
+ key: 1,
23
+ onSubmit: _cache[1] || (_cache[1] = ($event) => emit("submit"))
24
+ }))
25
+ ]);
26
+ };
27
+ }
28
+ });
29
+ export {
30
+ _sfc_main as default
31
+ };
32
+ //# sourceMappingURL=Layout.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Layout.vue2.js","sources":["../../src/views/Layout.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useActiveServer } from '@/hooks/useActiveServer'\nimport { useSecuritySchemes } from '@/hooks/useSecuritySchemes'\nimport { useState } from '@/state/state'\nimport Chat from '@/views/Chat/Chat.vue'\nimport Start from '@/views/Start.vue'\n\nconst emit = defineEmits<{\n (e: 'submit'): void\n}>()\n\nconst { chat } = useState()\n\nuseSecuritySchemes()\nuseActiveServer()\n</script>\n\n<template>\n <div class=\"wrapper\">\n <Chat\n v-if=\"\n chat.messages.length &&\n (chat.messages.length > 1 || chat.status !== 'submitted')\n \"\n @submit=\"emit('submit')\" />\n <Start\n v-else\n @submit=\"emit('submit')\" />\n </div>\n</template>\n\n<style scoped>\n.wrapper {\n display: flex;\n flex-direction: column;\n align-items: center;\n height: 100%;\n width: 100%;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_unref","_createBlock"],"mappings":";;;;;;;;;;;AAOA,UAAM,OAAO;AAIb,UAAM,EAAE,KAAA,IAAS,SAAA;AAEjB,uBAAA;AACA,oBAAA;;AAIE,aAAAA,UAAA,GAAAC,mBAUM,OAVN,YAUM;AAAA,QARaC,MAAA,IAAA,EAAK,SAAS,WAAmBA,MAAA,IAAA,EAAK,SAAS,SAAM,KAAQA,MAAA,IAAA,EAAK,WAAM,6BADzFC,YAK6B,MAAA;AAAA;UAA1B,gDAAQ,KAAI,QAAA;AAAA,QAAA,oBACfA,YAE6B,OAAA;AAAA;UAA1B,gDAAQ,KAAI,QAAA;AAAA,QAAA;;;;;"}
@@ -0,0 +1,10 @@
1
+ declare function focusPrompt(): void;
2
+ declare const _default: import("vue").DefineComponent<{}, {
3
+ focusPrompt: typeof focusPrompt;
4
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
5
+ submit: () => any;
6
+ }, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
7
+ onSubmit?: (() => any) | undefined;
8
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
9
+ export default _default;
10
+ //# sourceMappingURL=PromptForm.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PromptForm.vue.d.ts","sourceRoot":"","sources":["../../src/views/PromptForm.vue"],"names":[],"mappings":"AAkTA,iBAAS,WAAW,SAEnB;;;;;;;;AA6MD,wBAGG"}
@@ -0,0 +1,8 @@
1
+ import _sfc_main from "./PromptForm.vue2.js";
2
+ /* empty css */
3
+ import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
+ const PromptForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1170b22b"]]);
5
+ export {
6
+ PromptForm as default
7
+ };
8
+ //# sourceMappingURL=PromptForm.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PromptForm.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}