@scalar/agent-chat 0.2.3 → 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.
Files changed (270) hide show
  1. package/LICENSE +21 -0
  2. package/dist/App.vue.d.ts +3 -2
  3. package/dist/App.vue.d.ts.map +1 -1
  4. package/dist/App.vue.js +32 -0
  5. package/dist/App.vue2.js +4 -0
  6. package/dist/Chat.vue.d.ts.map +1 -1
  7. package/dist/Chat.vue.js +23 -0
  8. package/dist/Chat.vue2.js +4 -0
  9. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  10. package/dist/api.d.ts +50 -0
  11. package/dist/api.d.ts.map +1 -0
  12. package/dist/api.js +68 -0
  13. package/dist/components/ApprovalSection.vue.d.ts.map +1 -1
  14. package/dist/components/ApprovalSection.vue.js +7 -0
  15. package/dist/components/ApprovalSection.vue2.js +42 -0
  16. package/dist/components/AuthenticationProvided.vue.d.ts +3 -0
  17. package/dist/components/AuthenticationProvided.vue.d.ts.map +1 -0
  18. package/dist/components/AuthenticationProvided.vue.js +13 -0
  19. package/dist/components/AuthenticationRequired.vue.d.ts +3 -0
  20. package/dist/components/AuthenticationRequired.vue.d.ts.map +1 -0
  21. package/dist/components/AuthenticationRequired.vue.js +13 -0
  22. package/dist/components/AutosendPaused.vue.d.ts.map +1 -1
  23. package/dist/components/AutosendPaused.vue.js +13 -0
  24. package/dist/components/ContextItem.vue.d.ts.map +1 -1
  25. package/dist/components/ContextItem.vue.js +7 -0
  26. package/dist/components/ContextItem.vue2.js +19 -0
  27. package/dist/components/ErrorMessage.vue.d.ts +2 -1
  28. package/dist/components/ErrorMessage.vue.d.ts.map +1 -1
  29. package/dist/components/ErrorMessage.vue.js +7 -0
  30. package/dist/components/ErrorMessage.vue2.js +22 -0
  31. package/dist/components/LoadingMiniOpenAPIDoc.vue.d.ts.map +1 -1
  32. package/dist/components/LoadingMiniOpenAPIDoc.vue.js +14 -0
  33. package/dist/components/LoadingOpenAPISpecsSummary.vue.d.ts.map +1 -1
  34. package/dist/components/LoadingOpenAPISpecsSummary.vue.js +14 -0
  35. package/dist/components/Logo.vue.d.ts.map +1 -1
  36. package/dist/components/Logo.vue.js +23 -0
  37. package/dist/components/PaymentSection.vue.d.ts.map +1 -1
  38. package/dist/components/PaymentSection.vue.js +7 -0
  39. package/dist/components/PaymentSection.vue2.js +34 -0
  40. package/dist/components/RequestApproved.vue.d.ts.map +1 -1
  41. package/dist/components/RequestApproved.vue.js +13 -0
  42. package/dist/components/RequestFailed.vue.d.ts.map +1 -1
  43. package/dist/components/RequestFailed.vue.js +24 -0
  44. package/dist/components/RequestPreview.vue.d.ts +1 -1
  45. package/dist/components/RequestPreview.vue.d.ts.map +1 -1
  46. package/dist/components/RequestPreview.vue.js +7 -0
  47. package/dist/components/RequestPreview.vue2.js +123 -0
  48. package/dist/components/RequestRejected.vue.d.ts.map +1 -1
  49. package/dist/components/RequestRejected.vue.js +22 -0
  50. package/dist/components/RequestSuccess.vue.d.ts.map +1 -1
  51. package/dist/components/RequestSuccess.vue.js +13 -0
  52. package/dist/components/ResponseBody/ResponseBody.vue.d.ts +1 -1
  53. package/dist/components/ResponseBody/ResponseBody.vue.d.ts.map +1 -1
  54. package/dist/components/ResponseBody/ResponseBody.vue.js +41 -0
  55. package/dist/components/ResponseBody/ResponseBody.vue2.js +4 -0
  56. package/dist/components/ResponseBody/ResponseBodyInfo.vue.d.ts.map +1 -1
  57. package/dist/components/ResponseBody/ResponseBodyInfo.vue.js +14 -0
  58. package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts +1 -1
  59. package/dist/components/ResponseBody/ResponseBodyPreview.vue.d.ts.map +1 -1
  60. package/dist/components/ResponseBody/ResponseBodyPreview.vue.js +7 -0
  61. package/dist/components/ResponseBody/ResponseBodyPreview.vue2.js +65 -0
  62. package/dist/components/ResponseBody/ResponseBodyRaw.vue.d.ts.map +1 -1
  63. package/dist/components/ResponseBody/ResponseBodyRaw.vue.js +20 -0
  64. package/dist/components/ResponseBody/ResponseBodyRaw.vue2.js +4 -0
  65. package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts +2 -2
  66. package/dist/components/ResponseBody/ResponseBodyToggle.vue.d.ts.map +1 -1
  67. package/dist/components/ResponseBody/ResponseBodyToggle.vue.js +26 -0
  68. package/dist/components/ResponseBody/ResponseBodyToggle.vue2.js +4 -0
  69. package/dist/components/ResponseBody/helpers/media-types.js +130 -0
  70. package/dist/components/ResponseBody/helpers/process-response-body.d.ts +1 -1
  71. package/dist/components/ResponseBody/helpers/process-response-body.d.ts.map +1 -1
  72. package/dist/components/ResponseBody/helpers/process-response-body.js +33 -0
  73. package/dist/components/SearchPopover.vue.d.ts +2 -2
  74. package/dist/components/SearchPopover.vue.d.ts.map +1 -1
  75. package/dist/components/SearchPopover.vue.js +7 -0
  76. package/dist/components/SearchPopover.vue2.js +67 -0
  77. package/dist/components/Selector.vue.d.ts +24 -0
  78. package/dist/components/Selector.vue.d.ts.map +1 -0
  79. package/dist/components/Selector.vue.js +67 -0
  80. package/dist/components/Selector.vue2.js +4 -0
  81. package/dist/components/SendingRequest.vue.d.ts.map +1 -1
  82. package/dist/components/SendingRequest.vue.js +24 -0
  83. package/dist/components/ServerSelector.vue.d.ts +22 -0
  84. package/dist/components/ServerSelector.vue.d.ts.map +1 -0
  85. package/dist/components/ServerSelector.vue.js +57 -0
  86. package/dist/components/ServerSelector.vue2.js +4 -0
  87. package/dist/components/Suggestion.vue.d.ts.map +1 -1
  88. package/dist/components/TestRequestButton.vue.d.ts.map +1 -1
  89. package/dist/components/{Endpoint.vue.d.ts → UploadSection.vue.d.ts} +3 -5
  90. package/dist/components/UploadSection.vue.d.ts.map +1 -0
  91. package/dist/components/UploadSection.vue.js +7 -0
  92. package/dist/components/UploadSection.vue2.js +62 -0
  93. package/dist/entities/prompt/constants.d.ts +2 -0
  94. package/dist/entities/prompt/constants.d.ts.map +1 -0
  95. package/dist/entities/prompt/constants.js +4 -0
  96. package/dist/entities/registry/document.d.ts +21 -0
  97. package/dist/entities/registry/document.d.ts.map +1 -0
  98. package/dist/entities/registry/document.js +12 -0
  99. package/dist/entities/tools/ask-for-authentication.d.ts +7 -0
  100. package/dist/entities/tools/ask-for-authentication.d.ts.map +1 -0
  101. package/dist/entities/tools/ask-for-authentication.js +8 -0
  102. package/dist/entities/tools/constants.d.ts +2 -0
  103. package/dist/entities/tools/constants.d.ts.map +1 -0
  104. package/dist/entities/tools/constants.js +4 -0
  105. package/dist/entities/tools/execute-request.d.ts +42 -0
  106. package/dist/entities/tools/execute-request.d.ts.map +1 -0
  107. package/dist/entities/tools/execute-request.js +11 -0
  108. package/dist/entities/tools/get-mini-openapi-spec.d.ts +12 -0
  109. package/dist/entities/tools/get-mini-openapi-spec.d.ts.map +1 -0
  110. package/dist/entities/tools/get-mini-openapi-spec.js +8 -0
  111. package/dist/entities/tools/get-openapi-spec-summary.d.ts +10 -0
  112. package/dist/entities/tools/get-openapi-spec-summary.d.ts.map +1 -0
  113. package/dist/entities/tools/get-openapi-spec-summary.js +4 -0
  114. package/dist/helpers.d.ts +20 -12
  115. package/dist/helpers.d.ts.map +1 -1
  116. package/dist/helpers.js +122 -0
  117. package/dist/hooks/{useChatApprovals.d.ts → use-chat-approvals.d.ts} +1 -1
  118. package/dist/hooks/use-chat-approvals.d.ts.map +1 -0
  119. package/dist/hooks/use-chat-approvals.js +21 -0
  120. package/dist/hooks/use-chat-error.d.ts +14 -0
  121. package/dist/hooks/use-chat-error.d.ts.map +1 -0
  122. package/dist/hooks/use-chat-error.js +23 -0
  123. package/dist/hooks/use-chat-pending-client-tool-parts.d.ts +19 -0
  124. package/dist/hooks/use-chat-pending-client-tool-parts.d.ts.map +1 -0
  125. package/dist/hooks/use-chat-pending-client-tool-parts.js +12 -0
  126. package/dist/hooks/{useChatScroll.d.ts → use-chat-scroll.d.ts} +1 -1
  127. package/dist/hooks/use-chat-scroll.d.ts.map +1 -0
  128. package/dist/hooks/use-chat-scroll.js +16 -0
  129. package/dist/hooks/{useSearch.d.ts → use-search.d.ts} +11 -11
  130. package/dist/hooks/use-search.d.ts.map +1 -0
  131. package/dist/hooks/use-search.js +25 -0
  132. package/dist/hooks/use-term-and-conditions.d.ts +6 -0
  133. package/dist/hooks/use-term-and-conditions.d.ts.map +1 -0
  134. package/dist/hooks/use-term-and-conditions.js +16 -0
  135. package/dist/hooks/use-upload-tmp-document.d.ts +19 -0
  136. package/dist/hooks/use-upload-tmp-document.d.ts.map +1 -0
  137. package/dist/hooks/use-upload-tmp-document.js +64 -0
  138. package/dist/index.d.ts +2 -1
  139. package/dist/index.d.ts.map +1 -1
  140. package/dist/index.js +2 -1
  141. package/dist/package.json +34 -23
  142. package/dist/registry/add-documents-to-store.d.ts +6 -6
  143. package/dist/registry/add-documents-to-store.d.ts.map +1 -1
  144. package/dist/registry/add-documents-to-store.js +40 -0
  145. package/dist/registry/create-document-name.d.ts +2 -0
  146. package/dist/registry/create-document-name.d.ts.map +1 -0
  147. package/dist/registry/create-document-name.js +6 -0
  148. package/dist/state/state.d.ts +20 -8
  149. package/dist/state/state.d.ts.map +1 -1
  150. package/dist/state/state.js +110 -0
  151. package/dist/style.css +1 -1
  152. package/dist/types.d.ts +2 -0
  153. package/dist/types.d.ts.map +1 -0
  154. package/dist/views/Chat/Chat.vue.d.ts.map +1 -1
  155. package/dist/views/Chat/Chat.vue.js +7 -0
  156. package/dist/views/Chat/Chat.vue2.js +77 -0
  157. package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts +10 -0
  158. package/dist/views/Chat/Messages/AskForAuthentication.vue.d.ts.map +1 -0
  159. package/dist/views/Chat/Messages/AskForAuthentication.vue.js +7 -0
  160. package/dist/views/Chat/Messages/AskForAuthentication.vue2.js +93 -0
  161. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts +2 -2
  162. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.d.ts.map +1 -1
  163. package/dist/views/Chat/Messages/ExecuteRequestTool.vue.js +7 -0
  164. package/dist/views/Chat/Messages/ExecuteRequestTool.vue2.js +23 -0
  165. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts +2 -2
  166. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.d.ts.map +1 -1
  167. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue.js +7 -0
  168. package/dist/views/Chat/Messages/GetMiniOpenAPIDocTool.vue2.js +56 -0
  169. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts +2 -2
  170. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.d.ts.map +1 -1
  171. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue.js +26 -0
  172. package/dist/views/Chat/Messages/GetOpenAPISpecsSummary.vue2.js +4 -0
  173. package/dist/views/Chat/Messages/Text.vue.d.ts.map +1 -1
  174. package/dist/views/Chat/Messages/Text.vue.js +16 -0
  175. package/dist/views/Chat/Messages/Text.vue2.js +4 -0
  176. package/dist/views/Layout.vue.d.ts.map +1 -1
  177. package/dist/views/Layout.vue.js +7 -0
  178. package/dist/views/Layout.vue2.js +23 -0
  179. package/dist/views/PromptForm.vue.d.ts.map +1 -1
  180. package/dist/views/PromptForm.vue.js +7 -0
  181. package/dist/views/PromptForm.vue2.js +212 -0
  182. package/dist/views/Settings/Auth.vue.d.ts.map +1 -1
  183. package/dist/views/Settings/Auth.vue.js +67 -0
  184. package/dist/views/Settings/Auth.vue2.js +4 -0
  185. package/dist/views/Settings/DocSettings.vue.d.ts.map +1 -1
  186. package/dist/views/Settings/DocSettings.vue.js +7 -0
  187. package/dist/views/Settings/DocSettings.vue2.js +48 -0
  188. package/dist/views/Settings/Settings.vue.d.ts.map +1 -1
  189. package/dist/views/Settings/Settings.vue.js +8 -0
  190. package/dist/views/Settings/Settings.vue2.js +67 -0
  191. package/dist/views/Start.vue.d.ts.map +1 -1
  192. package/dist/views/Start.vue.js +7 -0
  193. package/dist/views/Start.vue2.js +41 -0
  194. package/package.json +52 -7
  195. package/dist/Tooltip-Cm82QgNj.js +0 -575
  196. package/dist/__vite-optional-peer-dep_stream-markdown_markstream-vue_false-sdjmOmXd.js +0 -5
  197. package/dist/__vite-optional-peer-dep_stream-monaco_markstream-vue_false-HdL4xm5U.js +0 -5
  198. package/dist/__vite-optional-peer-dep_vue-i18n_markstream-vue_false-B9Pwe5kz.js +0 -5
  199. package/dist/_basePickBy-hHD8tMGb.js +0 -151
  200. package/dist/_baseUniq-DTF1wuF6.js +0 -614
  201. package/dist/arc-Dw2RQerU.js +0 -83
  202. package/dist/architecture-U656AL7Q-B00Z9eXr.js +0 -36
  203. package/dist/architectureDiagram-VXUJARFQ-BtOffFaM.js +0 -4662
  204. package/dist/blockDiagram-VD42YOAC-BUqFMMQe.js +0 -2261
  205. package/dist/c4Diagram-YG6GDRKO-NrM1YcpG.js +0 -1579
  206. package/dist/channel-105myCGU.js +0 -5
  207. package/dist/chunk-4BX2VUAB-TAxJli7C.js +0 -8
  208. package/dist/chunk-55IACEB6-VXFJ4bz5.js +0 -8
  209. package/dist/chunk-B4BG7PRW-CZDQpfj5.js +0 -1375
  210. package/dist/chunk-DI55MBZ5-D3l7TA-E.js +0 -1370
  211. package/dist/chunk-FMBD7UC4-BMXFm8I3.js +0 -19
  212. package/dist/chunk-QN33PNHL-BOUpbpWp.js +0 -19
  213. package/dist/chunk-QZHKN3VN-C-TEEx05.js +0 -15
  214. package/dist/chunk-TZMSLE5B-BUiROKNR.js +0 -64
  215. package/dist/classDiagram-2ON5EDUG-HQET4ybK.js +0 -16
  216. package/dist/classDiagram-v2-WZHVMYZB-HQET4ybK.js +0 -16
  217. package/dist/clone-CIIO71O9.js +0 -8
  218. package/dist/components/Endpoint.vue.d.ts.map +0 -1
  219. package/dist/cose-bilkent-S5V4N54A-CMsF4n-5.js +0 -2609
  220. package/dist/cytoscape.esm-DfdJODL8.js +0 -18735
  221. package/dist/dagre-6UL2VRFP-DqzdQ6Qg.js +0 -444
  222. package/dist/defaultLocale-BEa-49Qz.js +0 -171
  223. package/dist/diagram-PSM6KHXK-1xyGntw2.js +0 -531
  224. package/dist/diagram-QEK2KX5R-DdZdlAm1.js +0 -217
  225. package/dist/diagram-S2PKOQOG-C80Eo2jp.js +0 -142
  226. package/dist/erDiagram-Q2GNP2WA-DFVRrMXT.js +0 -841
  227. package/dist/flowDiagram-NV44I4VS-D9QK_qqB.js +0 -1620
  228. package/dist/ganttDiagram-LVOFAZNH-Bo1NTkeQ.js +0 -2506
  229. package/dist/gitGraph-F6HP7TQM-C5hdgcgO.js +0 -27
  230. package/dist/gitGraphDiagram-NY62KEGX-BZqnqZh6.js +0 -699
  231. package/dist/graph-Dth4IhEK.js +0 -247
  232. package/dist/hooks/useChatApprovals.d.ts.map +0 -1
  233. package/dist/hooks/useChatOperationBlocks.d.ts +0 -3
  234. package/dist/hooks/useChatOperationBlocks.d.ts.map +0 -1
  235. package/dist/hooks/useChatScroll.d.ts.map +0 -1
  236. package/dist/hooks/useSearch.d.ts.map +0 -1
  237. package/dist/index-BOvT43H8.js +0 -111780
  238. package/dist/index2-B36B-gt0.js +0 -69
  239. package/dist/index3-CtIyYUnG.js +0 -70
  240. package/dist/index4-Dzz91Ao2.js +0 -537
  241. package/dist/index5-Bmz0gMSP.js +0 -590
  242. package/dist/index6-DMB3qTSV.js +0 -196
  243. package/dist/info-NVLQJR56-azt5obk5.js +0 -27
  244. package/dist/infoDiagram-ER5ION4S-DD4Jtctm.js +0 -24
  245. package/dist/infographic_markstream-vue_false-BfsmcXxk.js +0 -5
  246. package/dist/init-DjUOC4st.js +0 -16
  247. package/dist/journeyDiagram-XKPGCS4Q-CXL6UO0r.js +0 -834
  248. package/dist/kanban-definition-3W4ZIXB7-B57do5Wg.js +0 -719
  249. package/dist/katex-SsTUIUTC.js +0 -11688
  250. package/dist/layout-7TCY8eA2.js +0 -1332
  251. package/dist/linear-DSm5i91N.js +0 -625
  252. package/dist/mermaid-parser.core-CUQWpAMM.js +0 -12746
  253. package/dist/mermaid.core-QjuzH7xx.js +0 -14164
  254. package/dist/mhchem-XHl7cef5.js +0 -2306
  255. package/dist/mindmap-definition-VGOIOE7T-DAQyGNAM.js +0 -784
  256. package/dist/ordinal-DfAQgscy.js +0 -61
  257. package/dist/packet-BFZMPI3H-CixuxAEA.js +0 -27
  258. package/dist/pie-7BOR55EZ-D3cgnzR1.js +0 -32
  259. package/dist/pieDiagram-ADFJNKIX-BqxgYwrL.js +0 -161
  260. package/dist/quadrantDiagram-AYHSOK5B-CQ4v-9Hh.js +0 -1022
  261. package/dist/radar-NHE76QYJ-DhV0Od_M.js +0 -27
  262. package/dist/requirementDiagram-UZGBJVZJ-ncWNAgFi.js +0 -850
  263. package/dist/safeRaf-I3a3-dyJ.js +0 -10
  264. package/dist/sankeyDiagram-TZEHDZUN-yCR2_cH5.js +0 -810
  265. package/dist/sequenceDiagram-WL72ISMW-DZ7wqFyd.js +0 -2511
  266. package/dist/stateDiagram-FKZM4ZOC-Dra68Tzi.js +0 -263
  267. package/dist/stateDiagram-v2-4FDKWEC3-CARbPECD.js +0 -16
  268. package/dist/timeline-definition-IT6M3QCI-DEbG9QIM.js +0 -795
  269. package/dist/treemap-KMMF4GRG-CQbPsyWe.js +0 -81
  270. package/dist/xychartDiagram-PRI3JC2R-C94Pu8hL.js +0 -1340
@@ -0,0 +1,4 @@
1
+ const _ = "get-openapi-specs-summary";
2
+ export {
3
+ _ as GET_OPENAPI_SPECS_SUMMARY_TOOL_NAME
4
+ };
package/dist/helpers.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import type { ToolUIPart, UIDataTypes, UIMessagePart } from 'ai';
2
1
  import type { MergedSecuritySchemes } from '@scalar/api-client/v2/blocks/scalar-auth-selector-block';
3
2
  import type { OpenAPIV3_1 } from '@scalar/openapi-types';
4
3
  import type { AuthenticationConfiguration } from '@scalar/types/api-reference';
@@ -7,7 +6,8 @@ import type { WorkspaceDocument } from '@scalar/workspace-store/schemas';
7
6
  import type { XScalarSelectedSecurity } from '@scalar/workspace-store/schemas/extensions/security/x-scalar-selected-security';
8
7
  import type { OpenApiDocument, OperationObject, ParameterObject, PathItemObject, SecurityRequirementObject, SecuritySchemeObject, ServerObject } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
9
8
  import { type SecuritySchemes } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document';
10
- import type { Tools } from './state/state';
9
+ import type { ToolUIPart, UIDataTypes, UIMessagePart } from 'ai';
10
+ import type { Tools } from './state/state.js';
11
11
  /** Combine pathItem and operation parameters into a single, dereferenced parameter array */
12
12
  export declare const combineParams: (pathParams?: PathItemObject["parameters"], operationParams?: OperationObject["parameters"]) => ParameterObject[];
13
13
  /**
@@ -80,7 +80,7 @@ export declare const authStorage: () => {
80
80
  'x-scalar-secret-token': string;
81
81
  } & {
82
82
  type: "apiKey";
83
- in: "header" | "query" | "cookie";
83
+ in: "cookie" | "query" | "header";
84
84
  name: string;
85
85
  }) | ({
86
86
  description?: string | undefined;
@@ -125,7 +125,7 @@ export declare const authStorage: () => {
125
125
  } & {
126
126
  'x-scalar-secret-client-secret': string;
127
127
  } & {
128
- 'x-scalar-credentials-location'?: "body" | "header" | undefined;
128
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
129
129
  }) | undefined;
130
130
  implicit?: ({
131
131
  refreshUrl: string;
@@ -175,7 +175,7 @@ export declare const authStorage: () => {
175
175
  } & {
176
176
  'x-scalar-secret-client-secret': string;
177
177
  } & {
178
- 'x-scalar-credentials-location'?: "body" | "header" | undefined;
178
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
179
179
  }) | undefined;
180
180
  authorizationCode?: ({
181
181
  refreshUrl: string;
@@ -206,7 +206,7 @@ export declare const authStorage: () => {
206
206
  } & {
207
207
  'x-usePkce': "SHA-256" | "plain" | "no";
208
208
  } & {
209
- 'x-scalar-credentials-location'?: "body" | "header" | undefined;
209
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
210
210
  }) | undefined;
211
211
  };
212
212
  } & {
@@ -217,11 +217,11 @@ export declare const authStorage: () => {
217
217
  type: "openIdConnect";
218
218
  openIdConnectUrl: string;
219
219
  }) | ({
220
- summary?: string | undefined;
221
220
  description?: string | undefined;
221
+ summary?: string | undefined;
222
222
  $ref: string;
223
223
  } & {
224
- $status?: "error" | "loading" | undefined;
224
+ $status?: "loading" | "error" | undefined;
225
225
  $global?: boolean | undefined;
226
226
  } & {
227
227
  '$ref-value': ({
@@ -230,7 +230,7 @@ export declare const authStorage: () => {
230
230
  'x-scalar-secret-token': string;
231
231
  } & {
232
232
  type: "apiKey";
233
- in: "header" | "query" | "cookie";
233
+ in: "cookie" | "query" | "header";
234
234
  name: string;
235
235
  }) | ({
236
236
  description?: string | undefined;
@@ -275,7 +275,7 @@ export declare const authStorage: () => {
275
275
  } & {
276
276
  'x-scalar-secret-client-secret': string;
277
277
  } & {
278
- 'x-scalar-credentials-location'?: "body" | "header" | undefined;
278
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
279
279
  }) | undefined;
280
280
  implicit?: ({
281
281
  refreshUrl: string;
@@ -325,7 +325,7 @@ export declare const authStorage: () => {
325
325
  } & {
326
326
  'x-scalar-secret-client-secret': string;
327
327
  } & {
328
- 'x-scalar-credentials-location'?: "body" | "header" | undefined;
328
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
329
329
  }) | undefined;
330
330
  authorizationCode?: ({
331
331
  refreshUrl: string;
@@ -356,7 +356,7 @@ export declare const authStorage: () => {
356
356
  } & {
357
357
  'x-usePkce': "SHA-256" | "plain" | "no";
358
358
  } & {
359
- 'x-scalar-credentials-location'?: "body" | "header" | undefined;
359
+ 'x-scalar-credentials-location'?: "header" | "body" | undefined;
360
360
  }) | undefined;
361
361
  };
362
362
  } & {
@@ -415,4 +415,12 @@ export declare const restoreAuthSecretsFromStorage: ({ documentName, workspaceSt
415
415
  workspaceStore: WorkspaceStore;
416
416
  }) => void;
417
417
  export declare function safeParseJson(value: string): any;
418
+ export type AgentChatError<T extends string = string, D = unknown> = {
419
+ code: T;
420
+ detail: D;
421
+ };
422
+ export declare const AgentErrorCodes: {
423
+ readonly LIMIT_REACHED: "LIMIT_REACHED";
424
+ };
425
+ export declare function createError<const T extends string, D>(code: T, detail: D): AgentChatError<T, D>;
418
426
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AAGhE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAA;AAWpG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAA;AAGpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gFAAgF,CAAA;AAE7H,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,eAAe,EACf,cAAc,EACd,yBAAyB,EACzB,oBAAoB,EACpB,YAAY,EACb,MAAM,8DAA8D,CAAA;AACrE,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,8DAA8D,CAAA;AAErE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAE1C,4FAA4F;AAC5F,eAAO,MAAM,aAAa,GACxB,aAAY,cAAc,CAAC,YAAY,CAAM,EAC7C,kBAAiB,eAAe,CAAC,YAAY,CAAM,KAClD,eAAe,EAgBjB,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,GAAG,gBAAgB,EAAE,CAAC,YAAY,EAAE,GAAG,YAAY,GAAG,SAAS,GAAG,IAAI,CAAC,EAAE,GACxE,YAAY,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 @@
1
+ import { getSelectedServer as E } from "@scalar/api-client/v2/features/operation";
2
+ import { getServers as O } from "@scalar/api-client/v2/helpers";
3
+ import { isObject as l } from "@scalar/helpers/object/is-object";
4
+ import { REFERENCE_LS_KEYS as d, safeLocalStorage as I } from "@scalar/helpers/object/local-storage";
5
+ import { getResolvedRef as u } from "@scalar/workspace-store/helpers/get-resolved-ref";
6
+ import { coerceValue as f } from "@scalar/workspace-store/schemas/typebox-coerce";
7
+ import { XScalarSelectedSecuritySchema as b, SecuritySchemesSchema as v } from "@scalar/workspace-store/schemas/v3.1/strict/openapi-document";
8
+ function D(e) {
9
+ return Object.values(e.paths ?? {}).flatMap((s) => Object.values(s ?? {}));
10
+ }
11
+ function j(e) {
12
+ const c = (e["x-scalar-selected-security"]?.selectedSchemes ?? []).flatMap((r) => Object.keys(r)), t = e.components?.securitySchemes;
13
+ return t ? c.reduce((r, n) => {
14
+ const o = t[n];
15
+ return o && r.push(u(o)), r;
16
+ }, []) : [];
17
+ }
18
+ function T(e) {
19
+ return Object.fromEntries(
20
+ Object.entries(e.workspace.documents).map(([s, c]) => {
21
+ const t = O(c.servers, {
22
+ documentUrl: c?.["x-scalar-original-source-url"]
23
+ });
24
+ return [
25
+ s,
26
+ {
27
+ activeServer: E(c, t),
28
+ securitySchemes: j(c)
29
+ }
30
+ ];
31
+ })
32
+ );
33
+ }
34
+ const m = I(), y = () => {
35
+ const e = d.AUTH_SCHEMES, s = d.SELECTED_AUTH_SCHEMES, c = (t, r) => `${r}-${((o) => o === "schemas" ? e : s)(t)}`;
36
+ return {
37
+ /**
38
+ * Retrieves and coerces the authentication schemes stored in local storage.
39
+ */
40
+ getSchemas: (t) => {
41
+ const r = JSON.parse(m.getItem(c("schemas", t)) ?? "{}");
42
+ return f(v, r);
43
+ },
44
+ /**
45
+ * Stores the authentication schemes in local storage.
46
+ * @param value The SecuritySchemes object to stringify and store.
47
+ */
48
+ setSchemas: (t, r) => {
49
+ m.setItem(c("schemas", t), JSON.stringify(r));
50
+ },
51
+ /**
52
+ * Retrieves and coerces the selected authentication schemes stored in local storage.
53
+ */
54
+ getSelectedSchemes: (t) => {
55
+ const r = JSON.parse(m.getItem(c("selectedSchemes", t)) ?? "{}");
56
+ return f(b, r);
57
+ },
58
+ /**
59
+ * Stores the user's selected authentication schemes in local storage.
60
+ * @param value The XScalarSelectedSecurity object to stringify and store.
61
+ */
62
+ setSelectedSchemes: (t, r) => {
63
+ m.setItem(c("selectedSchemes", t), JSON.stringify(r));
64
+ }
65
+ };
66
+ }, p = (e, s) => {
67
+ if (!(!l(e) || !l(s)))
68
+ for (const [c, t] of Object.entries(s)) {
69
+ if (typeof t != "object") {
70
+ e[c] = t;
71
+ continue;
72
+ }
73
+ p(u(e[c]), t);
74
+ }
75
+ }, x = (e, s) => Object.keys(e).every((c) => s.has(c)), A = (e, s) => e >= s ? s - 1 : e, L = ({
76
+ documentName: e,
77
+ workspaceStore: s
78
+ }) => {
79
+ const c = y().getSchemas(e), t = s.workspace.documents[e];
80
+ if (!t)
81
+ return;
82
+ const n = y().getSelectedSchemes(e), o = new Set(Object.keys(t.components?.securitySchemes ?? {})), a = n["x-scalar-selected-security"]?.selectedSchemes?.filter((S) => x(S, o));
83
+ if (!t["x-scalar-selected-security"] && a && a.length > 0) {
84
+ const S = n["x-scalar-selected-security"]?.selectedIndex, i = A(S ?? 0, a.length);
85
+ t["x-scalar-selected-security"] = {
86
+ selectedIndex: i,
87
+ selectedSchemes: a
88
+ };
89
+ }
90
+ const g = t.components?.securitySchemes ?? {};
91
+ for (const [S, i] of Object.entries(c)) {
92
+ const h = u(g[S]);
93
+ l(h) && p(h, i);
94
+ }
95
+ };
96
+ function N(e) {
97
+ try {
98
+ return JSON.parse(e);
99
+ } catch {
100
+ return;
101
+ }
102
+ }
103
+ const w = {
104
+ LIMIT_REACHED: "LIMIT_REACHED"
105
+ };
106
+ function F(e, s) {
107
+ return {
108
+ code: e,
109
+ detail: s
110
+ };
111
+ }
112
+ export {
113
+ w as AgentErrorCodes,
114
+ y as authStorage,
115
+ T as createDocumentSettings,
116
+ F as createError,
117
+ D as getOperations,
118
+ j as getSecurityFromDocument,
119
+ p as mergeSecrets,
120
+ L as restoreAuthSecretsFromStorage,
121
+ N as safeParseJson
122
+ };
@@ -21,4 +21,4 @@ export declare function useChatApprovals(): {
21
21
  })[]>;
22
22
  respondToToolCalls: (approved: boolean) => Promise<void>;
23
23
  };
24
- //# sourceMappingURL=useChatApprovals.d.ts.map
24
+ //# sourceMappingURL=use-chat-approvals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-chat-approvals.d.ts","sourceRoot":"","sources":["../../src/hooks/use-chat-approvals.ts"],"names":[],"mappings":"AAWA,wBAAgB,gBAAgB;;;;;;;;;;;;;;;oBAuB648C,CAAC;kBAAuB,CAAC;;;eA7B/48C,oBAAoB;;mCAgB7B,OAAO;EAYpD"}
@@ -0,0 +1,21 @@
1
+ import { computed as l } from "vue";
2
+ import { useState as n } from "../state/state.js";
3
+ function e(t) {
4
+ return t.type.startsWith("tool") && t.state === "approval-requested";
5
+ }
6
+ function c() {
7
+ const t = n(), a = l(() => t.chat.messages.filter((o) => o.parts.some(e)).flatMap((o) => o.parts).filter(e));
8
+ async function s(o) {
9
+ const r = a.value.map(
10
+ (p) => t.chat.addToolApprovalResponse({
11
+ id: p.approval.id,
12
+ approved: o
13
+ })
14
+ );
15
+ await Promise.all(r);
16
+ }
17
+ return { approvalRequestedParts: a, respondToToolCalls: s };
18
+ }
19
+ export {
20
+ c as useChatApprovals
21
+ };
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod/mini';
2
+ declare const chatErrorSchema: z.ZodMiniObject<{
3
+ message: z.ZodMiniString<string>;
4
+ code: z.ZodMiniString<string>;
5
+ status: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
6
+ }, z.core.$strip>;
7
+ export type ChatError = z.infer<typeof chatErrorSchema>;
8
+ export declare function useChatError(): import("vue").ComputedRef<{
9
+ message: string;
10
+ code: string;
11
+ status?: number | undefined;
12
+ } | undefined>;
13
+ export {};
14
+ //# sourceMappingURL=use-chat-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-chat-error.d.ts","sourceRoot":"","sources":["../../src/hooks/use-chat-error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAA;AAK5B,QAAA,MAAM,eAAe;;;;iBAInB,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAEvD,wBAAgB,YAAY;;;;eAiB3B"}
@@ -0,0 +1,23 @@
1
+ import { computed as t } from "vue";
2
+ import { z as r } from "zod/mini";
3
+ import { safeParseJson as a } from "../helpers.js";
4
+ import { useState as n } from "../state/state.js";
5
+ const m = r.object({
6
+ message: r.string(),
7
+ code: r.string(),
8
+ status: r.optional(r.number())
9
+ });
10
+ function p() {
11
+ const { chat: e } = n();
12
+ return t(() => {
13
+ if (!e.error) return;
14
+ const o = a(e.error.message), s = m.safeParse(o);
15
+ return !o || !s.success ? {
16
+ message: e.error.message,
17
+ code: "UNKNOWN_ERROR"
18
+ } : s.data;
19
+ });
20
+ }
21
+ export {
22
+ p as useChatError
23
+ };
@@ -0,0 +1,19 @@
1
+ export declare function useChatPendingClientToolParts(): {
2
+ pendingClientToolParts: import("vue").ComputedRef<({
3
+ type: `tool-${string}`;
4
+ } & {
5
+ toolCallId: string;
6
+ title?: string;
7
+ providerExecuted?: boolean;
8
+ } & {
9
+ state: "input-available";
10
+ input: unknown;
11
+ output?: never;
12
+ errorText?: never;
13
+ callProviderMetadata?: import("ai").ProviderMetadata;
14
+ approval?: never;
15
+ } & {
16
+ state: "input-available";
17
+ })[]>;
18
+ };
19
+ //# sourceMappingURL=use-chat-pending-client-tool-parts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-chat-pending-client-tool-parts.d.ts","sourceRoot":"","sources":["../../src/hooks/use-chat-pending-client-tool-parts.ts"],"names":[],"mappings":"AAWA,wBAAgB,6BAA6B;;;;;;;;;;;;;;;eANM,iBAAiB;;EAiBnE"}
@@ -0,0 +1,12 @@
1
+ import { computed as o } from "vue";
2
+ import { useState as r } from "../state/state.js";
3
+ function n(t) {
4
+ return t.type.startsWith("tool") && t.state === "input-available";
5
+ }
6
+ function l() {
7
+ const t = r();
8
+ return { pendingClientToolParts: o(() => t.chat.messages.filter((e) => e.parts.some(n)).flatMap((e) => e.parts).filter(n)) };
9
+ }
10
+ export {
11
+ l as useChatPendingClientToolParts
12
+ };
@@ -1,2 +1,2 @@
1
1
  export declare function useChatScroll(): void;
2
- //# sourceMappingURL=useChatScroll.d.ts.map
2
+ //# sourceMappingURL=use-chat-scroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-chat-scroll.d.ts","sourceRoot":"","sources":["../../src/hooks/use-chat-scroll.ts"],"names":[],"mappings":"AAKA,wBAAgB,aAAa,SAgB5B"}
@@ -0,0 +1,16 @@
1
+ import { watch as r, nextTick as s } from "vue";
2
+ import { useState as n } from "../state/state.js";
3
+ function u() {
4
+ const e = n();
5
+ function o(a) {
6
+ const t = a?.parts.at(-1);
7
+ if (t && t.type === "text")
8
+ return t.text;
9
+ }
10
+ r([() => e.chat.status, () => o(e.chat.lastMessage)], async () => {
11
+ await s(), window.scrollTo(0, document.body.scrollHeight);
12
+ });
13
+ }
14
+ export {
15
+ u as useChatScroll
16
+ };
@@ -1,26 +1,26 @@
1
- export declare function useSearch(baseUrl: string): {
1
+ export declare function useSearch(): {
2
2
  query: import("vue").WritableComputedRef<string, string>;
3
3
  results: import("vue").Ref<{
4
- namespace: string;
5
- slug: string;
6
4
  id: string;
7
5
  title: string;
8
- logoUrl: string | null;
9
- currentVersion: string;
10
- }[], {
11
6
  namespace: string;
7
+ currentVersion: string;
8
+ logoUrl: string | null;
12
9
  slug: string;
10
+ }[], {
13
11
  id: string;
14
12
  title: string;
15
- logoUrl: string | null;
16
- currentVersion: string;
17
- }[] | {
18
13
  namespace: string;
14
+ currentVersion: string;
15
+ logoUrl: string | null;
19
16
  slug: string;
17
+ }[] | {
20
18
  id: string;
21
19
  title: string;
22
- logoUrl: string | null;
20
+ namespace: string;
23
21
  currentVersion: string;
22
+ logoUrl: string | null;
23
+ slug: string;
24
24
  }[]>;
25
25
  };
26
- //# sourceMappingURL=useSearch.d.ts.map
26
+ //# sourceMappingURL=use-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-search.d.ts","sourceRoot":"","sources":["../../src/hooks/use-search.ts"],"names":[],"mappings":"AAOA,wBAAgB,SAAS;;;;;;;;;;;;;;;;;;;;;;;;EAoCxB"}
@@ -0,0 +1,25 @@
1
+ import { useDebounceFn as m } from "@vueuse/core";
2
+ import { ref as c, computed as f } from "vue";
3
+ import { api as i } from "../api.js";
4
+ import { useState as p } from "../state/state.js";
5
+ function d() {
6
+ const { baseUrl: u, getAccessToken: n } = p(), s = c(""), r = m(async (e) => {
7
+ const o = await i({
8
+ baseUrl: u,
9
+ getAccessToken: n
10
+ }).search(e);
11
+ o.success && (t.value = o.data.results);
12
+ }, 200), a = f({
13
+ get: () => s.value,
14
+ set: (e) => {
15
+ r(e), s.value = e;
16
+ }
17
+ }), t = c([]);
18
+ return r(""), {
19
+ query: a,
20
+ results: t
21
+ };
22
+ }
23
+ export {
24
+ d as useSearch
25
+ };
@@ -0,0 +1,6 @@
1
+ export declare const TERMS_AND_CONDITIONS_LS_KEY = "scalar/agent-terms-accepted";
2
+ export declare function useTermsAndConditions(): {
3
+ accepted: import("vue").Ref<boolean, boolean>;
4
+ accept: () => void;
5
+ };
6
+ //# sourceMappingURL=use-term-and-conditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-term-and-conditions.d.ts","sourceRoot":"","sources":["../../src/hooks/use-term-and-conditions.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B,gCAAgC,CAAA;AAExE,wBAAgB,qBAAqB;;;EAapC"}
@@ -0,0 +1,16 @@
1
+ import { ref as r, onMounted as a } from "vue";
2
+ const t = "scalar/agent-terms-accepted";
3
+ function n() {
4
+ const e = r(!1);
5
+ a(() => {
6
+ e.value = localStorage.getItem(t) === "true";
7
+ });
8
+ function o() {
9
+ e.value = !0, localStorage.setItem(t, "true");
10
+ }
11
+ return { accepted: e, accept: o };
12
+ }
13
+ export {
14
+ t as TERMS_AND_CONDITIONS_LS_KEY,
15
+ n as useTermsAndConditions
16
+ };
@@ -0,0 +1,19 @@
1
+ import type { WorkspaceDocument } from '@scalar/workspace-store/schemas';
2
+ export type UploadTmpDocumentState = {
3
+ type: 'error';
4
+ error: unknown;
5
+ } | {
6
+ type: 'uploading';
7
+ } | {
8
+ type: 'processing';
9
+ } | {
10
+ type: 'done';
11
+ };
12
+ export declare function useUploadTmpDocument(): {
13
+ uploadTempDocument: (document: WorkspaceDocument) => Promise<{
14
+ namespace: string;
15
+ slug: string;
16
+ } | undefined>;
17
+ uploadState: import("vue").Ref<UploadTmpDocumentState | undefined, UploadTmpDocumentState | undefined>;
18
+ };
19
+ //# sourceMappingURL=use-upload-tmp-document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-upload-tmp-document.d.ts","sourceRoot":"","sources":["../../src/hooks/use-upload-tmp-document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAMxE,MAAM,MAAM,sBAAsB,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpB,wBAAgB,oBAAoB;mCAeU,iBAAiB;;;;;EAgE9D"}
@@ -0,0 +1,64 @@
1
+ import { ref as p } from "vue";
2
+ import { z as n } from "zod/mini";
3
+ import { useState as d } from "../state/state.js";
4
+ function g() {
5
+ const u = d(), e = p();
6
+ function s(r) {
7
+ const t = `${u.baseUrl}${r}`;
8
+ if (t.startsWith("/")) return t;
9
+ const o = new URLSearchParams({ scalar_url: t.toString() });
10
+ return new URL(`https://proxy.scalar.com/?${o}`);
11
+ }
12
+ async function c(r) {
13
+ try {
14
+ e.value = { type: "uploading" };
15
+ const t = await fetch(s("/core/share/upload/apis"), {
16
+ method: "POST",
17
+ headers: { "Content-Type": "application/json" },
18
+ body: JSON.stringify({ document: JSON.stringify(r) })
19
+ });
20
+ if (!t.ok) {
21
+ e.value = {
22
+ type: "error",
23
+ error: "Failed to upload document."
24
+ };
25
+ return;
26
+ }
27
+ const o = await t.json(), { success: i, data: a } = n.object({ namespace: n.string(), slug: n.string() }).safeParse(o);
28
+ if (!i) {
29
+ e.value = {
30
+ type: "error",
31
+ error: "Failed to process document."
32
+ };
33
+ return;
34
+ }
35
+ if (e.value = {
36
+ type: "processing"
37
+ }, !(await fetch(
38
+ s(`/vector/registry/embeddings/${a.namespace}/${a.slug}`),
39
+ {
40
+ method: "GET"
41
+ }
42
+ )).ok) {
43
+ e.value = {
44
+ type: "error",
45
+ error: "Failed to embed document."
46
+ };
47
+ return;
48
+ }
49
+ return e.value = { type: "done" }, setTimeout(() => {
50
+ e.value = void 0;
51
+ }, 2e3), a;
52
+ } catch {
53
+ e.value = { type: "error", error: "Failed to upload document." };
54
+ return;
55
+ }
56
+ }
57
+ return {
58
+ uploadTempDocument: c,
59
+ uploadState: e
60
+ };
61
+ }
62
+ export {
63
+ g as useUploadTmpDocument
64
+ };
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export { default as Chat } from './App.vue';
1
+ import './style.css';
2
+ export { default as Chat } from './App.vue.js';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,WAAW,CAAA"}
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import { _ as r } from "./index-BOvT43H8.js";
1
+ /* empty css */
2
+ import { default as r } from "./App.vue.js";
2
3
  export {
3
4
  r as Chat
4
5
  };