@copilotkit/react-textarea 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/.turbo/turbo-build.log +154 -154
  2. package/CHANGELOG.md +20 -0
  3. package/README.md +51 -0
  4. package/dist/{chunk-COQISBP2.mjs → chunk-2RGJ6YD6.mjs} +2 -2
  5. package/dist/{chunk-H3PGQHLG.mjs → chunk-2XUEWZC3.mjs} +4 -4
  6. package/dist/{chunk-WFTAAA7R.mjs → chunk-4PDYALMP.mjs} +2 -2
  7. package/dist/{chunk-4OZR65UB.mjs → chunk-5G7N3XVC.mjs} +2 -2
  8. package/dist/{chunk-TNGDQV3I.mjs → chunk-6QIA4FWK.mjs} +2 -2
  9. package/dist/{chunk-JJLQVT7S.mjs → chunk-AJ5OMEXM.mjs} +2 -2
  10. package/dist/{chunk-YFK5BFEI.mjs → chunk-D47EKHIF.mjs} +2 -2
  11. package/dist/{chunk-CVO5T3PA.mjs → chunk-EJGGLWWR.mjs} +1 -1
  12. package/dist/chunk-EJGGLWWR.mjs.map +1 -0
  13. package/dist/{chunk-YNXNMCDX.mjs → chunk-KMVGEY7Q.mjs} +2 -2
  14. package/dist/{chunk-I6DJQ7D7.mjs → chunk-MCNXIA4Q.mjs} +1 -1
  15. package/dist/chunk-MCNXIA4Q.mjs.map +1 -0
  16. package/dist/{chunk-W2NSEMKU.mjs → chunk-NZI35NYE.mjs} +11 -11
  17. package/dist/{chunk-7QFH4E7C.mjs → chunk-PNNCL732.mjs} +3 -3
  18. package/dist/{chunk-FFSICDS5.mjs → chunk-Q5KJBZUF.mjs} +3 -3
  19. package/dist/{chunk-4HBKWUCT.mjs → chunk-QQLDM3AI.mjs} +2 -2
  20. package/dist/{chunk-OGLVRSCO.mjs → chunk-UNLOFAW7.mjs} +5 -5
  21. package/dist/{chunk-PAP4ZNRG.mjs → chunk-WDV7S66U.mjs} +1 -1
  22. package/dist/chunk-WDV7S66U.mjs.map +1 -0
  23. package/dist/{chunk-GIANKZTF.mjs → chunk-WV7RRJEN.mjs} +6 -6
  24. package/dist/{chunk-WMHVBGPR.mjs → chunk-XA2TLAXU.mjs} +1 -1
  25. package/dist/chunk-XA2TLAXU.mjs.map +1 -0
  26. package/dist/{chunk-7SUZ6CXM.mjs → chunk-YLFAIYRY.mjs} +1 -7
  27. package/dist/chunk-YLFAIYRY.mjs.map +1 -0
  28. package/dist/components/base-copilot-textarea/base-copilot-textarea.js +0 -5
  29. package/dist/components/base-copilot-textarea/base-copilot-textarea.js.map +1 -1
  30. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +17 -17
  31. package/dist/components/copilot-textarea/copilot-textarea.js +0 -5
  32. package/dist/components/copilot-textarea/copilot-textarea.js.map +1 -1
  33. package/dist/components/copilot-textarea/copilot-textarea.mjs +25 -25
  34. package/dist/components/hovering-toolbar/hovering-toolbar.js +0 -5
  35. package/dist/components/hovering-toolbar/hovering-toolbar.js.map +1 -1
  36. package/dist/components/hovering-toolbar/hovering-toolbar.mjs +11 -11
  37. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js +0 -5
  38. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.js.map +1 -1
  39. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +8 -8
  40. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js +0 -5
  41. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.js.map +1 -1
  42. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +9 -9
  43. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js +0 -5
  44. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.js.map +1 -1
  45. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs +3 -3
  46. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js +0 -5
  47. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.js.map +1 -1
  48. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +9 -9
  49. package/dist/components/index.js +0 -5
  50. package/dist/components/index.js.map +1 -1
  51. package/dist/components/index.mjs +25 -25
  52. package/dist/components/source-search-box/source-search-box.js +0 -5
  53. package/dist/components/source-search-box/source-search-box.js.map +1 -1
  54. package/dist/components/source-search-box/source-search-box.mjs +4 -4
  55. package/dist/components/ui/button.js +0 -5
  56. package/dist/components/ui/button.js.map +1 -1
  57. package/dist/components/ui/button.mjs +2 -2
  58. package/dist/components/ui/command.js +0 -5
  59. package/dist/components/ui/command.js.map +1 -1
  60. package/dist/components/ui/command.mjs +3 -3
  61. package/dist/components/ui/dialog.js +0 -5
  62. package/dist/components/ui/dialog.js.map +1 -1
  63. package/dist/components/ui/dialog.mjs +2 -2
  64. package/dist/components/ui/label.js +0 -5
  65. package/dist/components/ui/label.js.map +1 -1
  66. package/dist/components/ui/label.mjs +2 -2
  67. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js +0 -5
  68. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.js.map +1 -1
  69. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +3 -3
  70. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.js.map +1 -1
  71. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +1 -1
  72. package/dist/index.js +0 -5
  73. package/dist/index.js.map +1 -1
  74. package/dist/index.mjs +31 -31
  75. package/dist/lib/utils.d.ts +1 -2
  76. package/dist/lib/utils.js +0 -7
  77. package/dist/lib/utils.js.map +1 -1
  78. package/dist/lib/utils.mjs +1 -3
  79. package/dist/types/autosuggestions-config/autosuggestions-config.js.map +1 -1
  80. package/dist/types/autosuggestions-config/autosuggestions-config.mjs +4 -4
  81. package/dist/types/autosuggestions-config/editing-api-config.js.map +1 -1
  82. package/dist/types/autosuggestions-config/editing-api-config.mjs +1 -1
  83. package/dist/types/autosuggestions-config/index.js.map +1 -1
  84. package/dist/types/autosuggestions-config/index.mjs +4 -4
  85. package/dist/types/autosuggestions-config/insertions-api-config.js.map +1 -1
  86. package/dist/types/autosuggestions-config/insertions-api-config.mjs +1 -1
  87. package/dist/types/autosuggestions-config/suggestions-api-config.js.map +1 -1
  88. package/dist/types/autosuggestions-config/suggestions-api-config.mjs +1 -1
  89. package/dist/types/base/editor-autocomplete-state.js +0 -5
  90. package/dist/types/base/editor-autocomplete-state.js.map +1 -1
  91. package/dist/types/base/editor-autocomplete-state.mjs +2 -2
  92. package/dist/types/index.js.map +1 -1
  93. package/dist/types/index.mjs +5 -5
  94. package/package.json +24 -8
  95. package/src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx +1 -1
  96. package/src/lib/utils.ts +0 -6
  97. package/src/types/autosuggestions-config/editing-api-config.tsx +0 -1
  98. package/src/types/autosuggestions-config/insertions-api-config.tsx +0 -1
  99. package/src/types/autosuggestions-config/suggestions-api-config.tsx +0 -1
  100. package/dist/chunk-7SUZ6CXM.mjs.map +0 -1
  101. package/dist/chunk-CVO5T3PA.mjs.map +0 -1
  102. package/dist/chunk-I6DJQ7D7.mjs.map +0 -1
  103. package/dist/chunk-PAP4ZNRG.mjs.map +0 -1
  104. package/dist/chunk-WMHVBGPR.mjs.map +0 -1
  105. /package/dist/{chunk-COQISBP2.mjs.map → chunk-2RGJ6YD6.mjs.map} +0 -0
  106. /package/dist/{chunk-H3PGQHLG.mjs.map → chunk-2XUEWZC3.mjs.map} +0 -0
  107. /package/dist/{chunk-WFTAAA7R.mjs.map → chunk-4PDYALMP.mjs.map} +0 -0
  108. /package/dist/{chunk-4OZR65UB.mjs.map → chunk-5G7N3XVC.mjs.map} +0 -0
  109. /package/dist/{chunk-TNGDQV3I.mjs.map → chunk-6QIA4FWK.mjs.map} +0 -0
  110. /package/dist/{chunk-JJLQVT7S.mjs.map → chunk-AJ5OMEXM.mjs.map} +0 -0
  111. /package/dist/{chunk-YFK5BFEI.mjs.map → chunk-D47EKHIF.mjs.map} +0 -0
  112. /package/dist/{chunk-YNXNMCDX.mjs.map → chunk-KMVGEY7Q.mjs.map} +0 -0
  113. /package/dist/{chunk-W2NSEMKU.mjs.map → chunk-NZI35NYE.mjs.map} +0 -0
  114. /package/dist/{chunk-7QFH4E7C.mjs.map → chunk-PNNCL732.mjs.map} +0 -0
  115. /package/dist/{chunk-FFSICDS5.mjs.map → chunk-Q5KJBZUF.mjs.map} +0 -0
  116. /package/dist/{chunk-4HBKWUCT.mjs.map → chunk-QQLDM3AI.mjs.map} +0 -0
  117. /package/dist/{chunk-OGLVRSCO.mjs.map → chunk-UNLOFAW7.mjs.map} +0 -0
  118. /package/dist/{chunk-GIANKZTF.mjs.map → chunk-WV7RRJEN.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # ui
2
2
 
3
+ ## 1.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Remove nanoid
8
+ - Updated dependencies
9
+ - @copilotkit/react-core@1.0.4
10
+ - @copilotkit/runtime-client-gql@1.0.4
11
+ - @copilotkit/shared@1.0.4
12
+
13
+ ## 1.0.3
14
+
15
+ ### Patch Changes
16
+
17
+ - Add README.md to published packages and add keywords to package.json
18
+ - Updated dependencies
19
+ - @copilotkit/react-core@1.0.3
20
+ - @copilotkit/runtime-client-gql@1.0.3
21
+ - @copilotkit/shared@1.0.3
22
+
3
23
  ## 1.0.2
4
24
 
5
25
  ### Patch Changes
package/README.md ADDED
@@ -0,0 +1,51 @@
1
+ <div align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://github.com/CopilotKit/CopilotKit/assets/746397/5890217b-524e-49c5-a89e-b8743d2acd51">
4
+ <img alt="CopilotKit Logo" src="https://github.com/CopilotKit/CopilotKit/assets/746397/bd5c9079-929b-4d55-bdc9-16d1c8181b71" width="450px" max-width="100%"/>
5
+ </picture>
6
+ </a>
7
+ </div>
8
+
9
+ <p align="center">
10
+ <a href="https://discord.gg/6dffbvGU3D">
11
+ <img src="https://dcbadge.vercel.app/api/server/6dffbvGU3D?compact=true&style=flat" alt="Discord">
12
+ </a>
13
+ <a href="https://github.com/CopilotKit/CopilotKit/actions/workflows/ci.yml">
14
+ <img src="https://github.com/CopilotKit/CopilotKit/actions/workflows/ci.yml/badge.svg" alt="GitHub CI">
15
+ </a>
16
+
17
+ <a href="https://www.npmjs.com/package/@copilotkit/react-core">
18
+ <img src="https://img.shields.io/npm/v/@copilotkit/react-core" alt="NPM">
19
+ <img src="https://img.shields.io/github/license/CopilotKit/CopilotKit" alt="MIT">
20
+
21
+ </p>
22
+
23
+ <h1 align="center">
24
+ The Open-Source Copilot Framework
25
+ </h1>
26
+
27
+ <h2 align="center">
28
+ Build, deploy, and operate fully custom AI Copilots.
29
+ </h2>
30
+
31
+ <h3 align="center">
32
+ in-app AI chatbots, AI agents, and AI Textareas.
33
+ </h3>
34
+
35
+ <p align="center">
36
+ <a href="https://discord.com/invite/6dffbvGU3D">
37
+ <img src="https://github.com/CopilotKit/CopilotKit/assets/131273140/bf8d96ea-3aeb-4c9a-9043-96a868b7ad0f" alt="Join our Discord" height="30">
38
+ </a>
39
+ &nbsp;&middot;&nbsp;
40
+ <a href="https://docs.copilotkit.ai/getting-started/quickstart-chatbot">
41
+ <img src="https://github.com/CopilotKit/CopilotKit/assets/131273140/a4a0fd04-6aee-4e02-9c3e-3f11d60b4e8b" alt="Read the Docs" height="30">
42
+ </a>
43
+ &nbsp;&middot;&nbsp;
44
+ <a href="https://cloud.copilotkit.ai">
45
+ <img src="https://github.com/CopilotKit/CopilotKit/assets/131273140/28ca62a8-cf93-4d3f-96b0-dc11bf89b734" alt="Try Copilot Cloud" height="30">
46
+ </a>
47
+ </p>
48
+
49
+ # Documentation
50
+
51
+ To get started with CopilotKit, please check out the [documentation](https://docs.copilotkit.ai).
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HoveringInsertionPromptBoxCore
3
- } from "./chunk-OGLVRSCO.mjs";
3
+ } from "./chunk-UNLOFAW7.mjs";
4
4
 
5
5
  // src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.tsx
6
6
  import { jsx } from "react/jsx-runtime";
@@ -28,4 +28,4 @@ var HoveringInsertionPromptBox = (props) => {
28
28
  export {
29
29
  HoveringInsertionPromptBox
30
30
  };
31
- //# sourceMappingURL=chunk-COQISBP2.mjs.map
31
+ //# sourceMappingURL=chunk-2RGJ6YD6.mjs.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  defaultEditingApiConfig
3
- } from "./chunk-CVO5T3PA.mjs";
3
+ } from "./chunk-EJGGLWWR.mjs";
4
4
  import {
5
5
  defaultInsertionsApiConfig
6
- } from "./chunk-I6DJQ7D7.mjs";
6
+ } from "./chunk-MCNXIA4Q.mjs";
7
7
  import {
8
8
  defaultSuggestionsApiConfig
9
- } from "./chunk-WMHVBGPR.mjs";
9
+ } from "./chunk-XA2TLAXU.mjs";
10
10
  import {
11
11
  defaultBaseAutosuggestionsConfig
12
12
  } from "./chunk-OJXLHIYQ.mjs";
@@ -29,4 +29,4 @@ var defaultAutosuggestionsConfig = __spreadProps(__spreadValues({}, defaultBaseA
29
29
  export {
30
30
  defaultAutosuggestionsConfig
31
31
  };
32
- //# sourceMappingURL=chunk-H3PGQHLG.mjs.map
32
+ //# sourceMappingURL=chunk-2XUEWZC3.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  cn
3
- } from "./chunk-7SUZ6CXM.mjs";
3
+ } from "./chunk-YLFAIYRY.mjs";
4
4
  import {
5
5
  __objRest,
6
6
  __spreadValues
@@ -49,4 +49,4 @@ export {
49
49
  buttonVariants,
50
50
  Button
51
51
  };
52
- //# sourceMappingURL=chunk-WFTAAA7R.mjs.map
52
+ //# sourceMappingURL=chunk-4PDYALMP.mjs.map
@@ -6,7 +6,7 @@ import {
6
6
  CommandItem,
7
7
  CommandList,
8
8
  CommandSeparator
9
- } from "./chunk-FFSICDS5.mjs";
9
+ } from "./chunk-Q5KJBZUF.mjs";
10
10
 
11
11
  // src/components/source-search-box/source-search-box.tsx
12
12
  import { useState } from "react";
@@ -80,4 +80,4 @@ export {
80
80
  SourceSearchBox,
81
81
  Logo
82
82
  };
83
- //# sourceMappingURL=chunk-4OZR65UB.mjs.map
83
+ //# sourceMappingURL=chunk-5G7N3XVC.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  HoveringInsertionPromptBox
3
- } from "./chunk-COQISBP2.mjs";
3
+ } from "./chunk-2RGJ6YD6.mjs";
4
4
  import {
5
5
  useHoveringEditorContext
6
6
  } from "./chunk-LYB4B6MK.mjs";
@@ -120,4 +120,4 @@ function editorState(editor, selection) {
120
120
  export {
121
121
  HoveringToolbar
122
122
  };
123
- //# sourceMappingURL=chunk-TNGDQV3I.mjs.map
123
+ //# sourceMappingURL=chunk-6QIA4FWK.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  arraysAreEqual
3
- } from "./chunk-7SUZ6CXM.mjs";
3
+ } from "./chunk-YLFAIYRY.mjs";
4
4
 
5
5
  // src/types/base/editor-autocomplete-state.ts
6
6
  function areEqual_autocompleteState(prev, next) {
@@ -10,4 +10,4 @@ function areEqual_autocompleteState(prev, next) {
10
10
  export {
11
11
  areEqual_autocompleteState
12
12
  };
13
- //# sourceMappingURL=chunk-JJLQVT7S.mjs.map
13
+ //# sourceMappingURL=chunk-AJ5OMEXM.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  cn
3
- } from "./chunk-7SUZ6CXM.mjs";
3
+ } from "./chunk-YLFAIYRY.mjs";
4
4
  import {
5
5
  __objRest,
6
6
  __spreadValues
@@ -23,4 +23,4 @@ Label.displayName = LabelPrimitive.Root.displayName;
23
23
  export {
24
24
  Label
25
25
  };
26
- //# sourceMappingURL=chunk-YFK5BFEI.mjs.map
26
+ //# sourceMappingURL=chunk-D47EKHIF.mjs.map
@@ -79,4 +79,4 @@ export {
79
79
  defaultEditingFewShotMessages,
80
80
  defaultEditingApiConfig
81
81
  };
82
- //# sourceMappingURL=chunk-CVO5T3PA.mjs.map
82
+ //# sourceMappingURL=chunk-EJGGLWWR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/autosuggestions-config/editing-api-config.tsx"],"sourcesContent":["import { Message, Role, TextMessage } from \"@copilotkit/runtime-client-gql\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\n\nexport interface EditingApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: Message[];\n forwardedParams: { [key: string]: any } | undefined;\n}\n\nexport const defaultEditingMakeSystemPrompt: MakeSystemPrompt = (\n textareaPurpose,\n contextString,\n) => {\n return `You are a versatile writing assistant helping the user edit a portion of their text.\n \nThe user is writing some text.\nThe purpose is: \\\"${textareaPurpose}\\\"\n\nThe following external context is also provided. Use it when relevant.\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\n\nThe user has provided you with a PROMPT for EDITING a PORTION of the text. \nYour job is to come up with a new EDITED version OF THE SEGMENT IN QUESTION - AS BEST YOU CAN.\nOnly rewrite the portion of the text that the user has marked as \"TextToEdit\"!!!\n\nAdjust yourself to the user's style and implied intent.\n\nThe conversation will be structured as follows:\n<TextBeforeCursor>\n<TextToEdit>\n<TextAfterCursor>\n<EditingPrompt>\n\n<YourEditSuggestion>\n`;\n};\n\nexport const defaultEditingFewShotMessages: Message[] = [\n new TextMessage({\n role: Role.User,\n content:\n \"<TextBeforeCursor>This morning I woke up and went straight to the grocery store. </TextBeforeCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<TextToEdit>While I was there I picked up some apples, oranges, and bananas. </TextToEdit>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>The grocery store was having a sale on fruit, so I decided to stock up.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content: \"<EditingPrompt>I also bought a big watermelon</EditingPrompt>\",\n }),\n new TextMessage({\n role: Role.Assistant,\n content:\n \"While I was there I picked up some apples, oranges, and bananas, and a big watermelon.\",\n }),\n\n new TextMessage({\n role: Role.User,\n content:\n \"<TextBeforeCursor>Yesterday, I spent the afternoon working on my new project.</TextBeforeCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content: \"<TextToEdit>It's quite challenging and requires a lot of focus.</TextToEdit>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>I'm really excited about the potential outcomes of this project.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<EditingPrompt>emphasize the complexity and my enthusiasm for the project</EditingPrompt>\",\n }),\n new TextMessage({\n role: Role.Assistant,\n content:\n \"It's a highly complex task that demands intense concentration, but I'm incredibly enthusiastic about the promising prospects of this project.\",\n }),\n];\n\nexport const defaultEditingApiConfig: EditingApiConfig = {\n makeSystemPrompt: defaultEditingMakeSystemPrompt,\n fewShotMessages: defaultEditingFewShotMessages,\n forwardedParams: undefined,\n};\n"],"mappings":";AAAA,SAAkB,MAAM,mBAAmB;AASpC,IAAM,iCAAmD,CAC9D,iBACA,kBACG;AACH,SAAO;AAAA;AAAA;AAAA,mBAGW;AAAA;AAAA;AAAA;AAAA,EAIlB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBF;AAEO,IAAM,gCAA2C;AAAA,EACtD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SAAS;AAAA,EACX,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EAED,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SAAS;AAAA,EACX,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AACH;AAEO,IAAM,0BAA4C;AAAA,EACvD,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Label
3
- } from "./chunk-YFK5BFEI.mjs";
3
+ } from "./chunk-D47EKHIF.mjs";
4
4
 
5
5
  // src/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.tsx
6
6
  import Chip from "@mui/material/Chip/Chip.js";
@@ -48,4 +48,4 @@ export {
48
48
  IncludedFilesPreview,
49
49
  FileChipPreview
50
50
  };
51
- //# sourceMappingURL=chunk-YNXNMCDX.mjs.map
51
+ //# sourceMappingURL=chunk-KMVGEY7Q.mjs.map
@@ -72,4 +72,4 @@ export {
72
72
  defaultInsertionsFewShotMessages,
73
73
  defaultInsertionsApiConfig
74
74
  };
75
- //# sourceMappingURL=chunk-I6DJQ7D7.mjs.map
75
+ //# sourceMappingURL=chunk-MCNXIA4Q.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/autosuggestions-config/insertions-api-config.tsx"],"sourcesContent":["import { Message, Role, TextMessage } from \"@copilotkit/runtime-client-gql\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\n\nexport interface InsertionsApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: Message[];\n forwardedParams: { [key: string]: any } | undefined;\n}\n\nexport const defaultInsertionsMakeSystemPrompt: MakeSystemPrompt = (\n textareaPurpose,\n contextString,\n) => {\n return `You are a versatile writing assistant helping the user insert new text into their existing work.\n \nThe user is writing some text.\nThe purpose is: \\\"${textareaPurpose}\\\"\n\nThe following external context is also provided. Use it to inform your suggestions when relevant!!!\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\n\nThe user will provide you with a prompt for an INSERTION into the text they are writing. \nYour job is to come up with an INSERTION into the text that the user would like to use, AS BEST YOU CAN.\nOnly insert a SHORT segment. Usually 1 sentence, or at most 1 paragraph.\n\nAdjust yourself to the user's style and implied intent.\n\n\nThe user will provide the text before and after the cursor, as well as the INSERTION prompt. You should use this to infer the best relevant insertion.\nThe conversation will be structured as follows:\n<TextAfterCursor>\n<TextBeforeCursor>\n<InsertionPrompt>\n\n<YourInsertionSuggestion>\n`;\n};\n\nexport const defaultInsertionsFewShotMessages: Message[] = [\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>While I was there I also picked up some apples, oranges, and bananas.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<TextBeforeCursor>This morning I woke up and went straight to the grocery store.</TextBeforeCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content: \"<InsertionPrompt>I bought a big watermelon</InsertionPrompt>\",\n }),\n new TextMessage({\n role: Role.Assistant,\n content:\n \"When I arrived I went straight to the produce section and picked out a big watermelon.\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n '<TextBeforeCursor>The Optionholder, in the Optionholder\\'s capacity as a holder of vested Options, hereby irrevocably and unconditionally agrees: (i) that the Optionholder shall be deemed an \"Equityholder\" under the Merger Agreement and shall be entitled to the rights and benefits, and subject to the obligations, of an \"Equityholder\" thereunder;</TextBeforeCursor>',\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<InsertionPrompt>add section about the optionholder's pro rata share</InsertionPrompt>\",\n }),\n new TextMessage({\n role: Role.Assistant,\n content:\n ' (ii) that, for purposes of this Agreement and the Merger Agreement, the applicable percentage set forth opposite the name of the Optionholder in the Distribution Waterfall shall be such the Optionholder\\'s \"Pro Rata Share\"; ',\n }),\n];\n\nexport const defaultInsertionsApiConfig: InsertionsApiConfig = {\n makeSystemPrompt: defaultInsertionsMakeSystemPrompt,\n fewShotMessages: defaultInsertionsFewShotMessages,\n forwardedParams: undefined,\n};\n"],"mappings":";AAAA,SAAkB,MAAM,mBAAmB;AASpC,IAAM,oCAAsD,CACjE,iBACA,kBACG;AACH,SAAO;AAAA;AAAA;AAAA,mBAGW;AAAA;AAAA;AAAA;AAAA,EAIlB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkBF;AAEO,IAAM,mCAA8C;AAAA,EACzD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SAAS;AAAA,EACX,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AACH;AAEO,IAAM,6BAAkD;AAAA,EAC7D,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB;","names":[]}
@@ -1,12 +1,12 @@
1
- import {
2
- clearAutocompletionsFromEditor
3
- } from "./chunk-GQN2HYFJ.mjs";
4
1
  import {
5
2
  addAutocompletionsToEditor
6
3
  } from "./chunk-2C7O2EVM.mjs";
4
+ import {
5
+ clearAutocompletionsFromEditor
6
+ } from "./chunk-GQN2HYFJ.mjs";
7
7
  import {
8
8
  useAutosuggestions
9
- } from "./chunk-7QFH4E7C.mjs";
9
+ } from "./chunk-PNNCL732.mjs";
10
10
  import {
11
11
  useCopilotTextareaEditor
12
12
  } from "./chunk-DRV2FOHZ.mjs";
@@ -24,15 +24,14 @@ import {
24
24
  } from "./chunk-7LSRNPNI.mjs";
25
25
  import {
26
26
  HoveringToolbar
27
- } from "./chunk-TNGDQV3I.mjs";
27
+ } from "./chunk-6QIA4FWK.mjs";
28
28
  import {
29
29
  HoveringEditorProvider,
30
30
  useHoveringEditorContext
31
31
  } from "./chunk-LYB4B6MK.mjs";
32
32
  import {
33
- getFullEditorTextWithNewlines,
34
- getTextAroundCollapsedCursor
35
- } from "./chunk-ECR45NSD.mjs";
33
+ defaultBaseAutosuggestionsConfig
34
+ } from "./chunk-OJXLHIYQ.mjs";
36
35
  import {
37
36
  makeRenderElementFunction
38
37
  } from "./chunk-224UKA7C.mjs";
@@ -40,8 +39,9 @@ import {
40
39
  makeRenderPlaceholderFunction
41
40
  } from "./chunk-XW3ICO4S.mjs";
42
41
  import {
43
- defaultBaseAutosuggestionsConfig
44
- } from "./chunk-OJXLHIYQ.mjs";
42
+ getFullEditorTextWithNewlines,
43
+ getTextAroundCollapsedCursor
44
+ } from "./chunk-ECR45NSD.mjs";
45
45
  import {
46
46
  __objRest,
47
47
  __spreadProps,
@@ -261,4 +261,4 @@ function makeSemiFakeReactTextAreaEvent(currentText) {
261
261
  export {
262
262
  BaseCopilotTextarea
263
263
  };
264
- //# sourceMappingURL=chunk-W2NSEMKU.mjs.map
264
+ //# sourceMappingURL=chunk-NZI35NYE.mjs.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  areEqual_autocompleteState
3
- } from "./chunk-JJLQVT7S.mjs";
3
+ } from "./chunk-AJ5OMEXM.mjs";
4
4
  import {
5
5
  nullableCompatibleEqualityCheck
6
- } from "./chunk-7SUZ6CXM.mjs";
6
+ } from "./chunk-YLFAIYRY.mjs";
7
7
  import {
8
8
  Debouncer
9
9
  } from "./chunk-DFTV4TST.mjs";
@@ -100,4 +100,4 @@ function useAutosuggestions(debounceTime, shouldAcceptAutosuggestionOnKeyPress,
100
100
  export {
101
101
  useAutosuggestions
102
102
  };
103
- //# sourceMappingURL=chunk-7QFH4E7C.mjs.map
103
+ //# sourceMappingURL=chunk-PNNCL732.mjs.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Dialog,
3
3
  DialogContent
4
- } from "./chunk-4HBKWUCT.mjs";
4
+ } from "./chunk-QQLDM3AI.mjs";
5
5
  import {
6
6
  cn
7
- } from "./chunk-7SUZ6CXM.mjs";
7
+ } from "./chunk-YLFAIYRY.mjs";
8
8
  import {
9
9
  __objRest,
10
10
  __spreadProps,
@@ -121,4 +121,4 @@ export {
121
121
  CommandItem,
122
122
  CommandShortcut
123
123
  };
124
- //# sourceMappingURL=chunk-FFSICDS5.mjs.map
124
+ //# sourceMappingURL=chunk-Q5KJBZUF.mjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  cn
3
- } from "./chunk-7SUZ6CXM.mjs";
3
+ } from "./chunk-YLFAIYRY.mjs";
4
4
  import {
5
5
  __objRest,
6
6
  __spreadProps,
@@ -105,4 +105,4 @@ export {
105
105
  DialogTitle,
106
106
  DialogDescription
107
107
  };
108
- //# sourceMappingURL=chunk-4HBKWUCT.mjs.map
108
+ //# sourceMappingURL=chunk-QQLDM3AI.mjs.map
@@ -1,21 +1,21 @@
1
1
  import {
2
2
  IncludedFilesPreview
3
- } from "./chunk-YNXNMCDX.mjs";
3
+ } from "./chunk-KMVGEY7Q.mjs";
4
4
  import {
5
5
  use_autosize_textarea_default
6
6
  } from "./chunk-3PQ7GSFE.mjs";
7
7
  import {
8
8
  Button
9
- } from "./chunk-WFTAAA7R.mjs";
9
+ } from "./chunk-4PDYALMP.mjs";
10
10
  import {
11
11
  Label
12
- } from "./chunk-YFK5BFEI.mjs";
12
+ } from "./chunk-D47EKHIF.mjs";
13
13
  import {
14
14
  useHoveringEditorContext
15
15
  } from "./chunk-LYB4B6MK.mjs";
16
16
  import {
17
17
  SourceSearchBox
18
- } from "./chunk-4OZR65UB.mjs";
18
+ } from "./chunk-5G7N3XVC.mjs";
19
19
  import {
20
20
  streamPromiseFlatten
21
21
  } from "./chunk-2QDCE7PD.mjs";
@@ -222,4 +222,4 @@ var HoveringInsertionPromptBoxCore = ({
222
222
  export {
223
223
  HoveringInsertionPromptBoxCore
224
224
  };
225
- //# sourceMappingURL=chunk-OGLVRSCO.mjs.map
225
+ //# sourceMappingURL=chunk-UNLOFAW7.mjs.map
@@ -173,4 +173,4 @@ function useMakeStandardInsertionOrEditingFunction(textareaPurpose, contextCateg
173
173
  export {
174
174
  useMakeStandardInsertionOrEditingFunction
175
175
  };
176
- //# sourceMappingURL=chunk-PAP4ZNRG.mjs.map
176
+ //# sourceMappingURL=chunk-WDV7S66U.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/hooks/make-autosuggestions-function/use-make-standard-insertion-function.tsx"],"sourcesContent":["import { COPILOT_CLOUD_PUBLIC_API_KEY_HEADER } from \"@copilotkit/shared\";\nimport { CopilotContext } from \"@copilotkit/react-core\";\nimport { useCallback, useContext } from \"react\";\nimport {\n CopilotRuntimeClient,\n Message,\n Role,\n TextMessage,\n convertGqlOutputToMessages,\n convertMessagesToGqlInput,\n CopilotRequestType,\n} from \"@copilotkit/runtime-client-gql\";\nimport { retry } from \"../../lib/retry\";\nimport {\n EditingEditorState,\n Generator_InsertionOrEditingSuggestion,\n} from \"../../types/base/autosuggestions-bare-function\";\nimport { InsertionsApiConfig } from \"../../types/autosuggestions-config/insertions-api-config\";\nimport { EditingApiConfig } from \"../../types/autosuggestions-config/editing-api-config\";\nimport { DocumentPointer } from \"@copilotkit/react-core\";\nimport { randomId } from \"@copilotkit/shared\";\n\n/**\n * Returns a memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.\n * The function takes in the text before and after the cursor, and an abort signal.\n * It sends a POST request to the API endpoint with the messages array containing the system message, few shot messages, and user messages.\n * The function returns the suggestion from the API response.\n *\n * @param textareaPurpose - The purpose of the textarea. This is included in the system message.\n * @param apiEndpoint - The API endpoint to send the autosuggestion request to.\n * @param makeSystemMessage - A function that takes in a context string and returns a system message to include in the autosuggestion request.\n * @param fewShotMessages - An array of few shot messages to include in the autosuggestion request.\n * @param contextCategories - The categories of context strings we want to include. By default, we include the (default) \"global\" context category.\n * @returns A memoized function that sends a request to the specified API endpoint to get an autosuggestion for the user's input.\n */\nexport function useMakeStandardInsertionOrEditingFunction(\n textareaPurpose: string,\n contextCategories: string[],\n insertionApiConfig: InsertionsApiConfig,\n editingApiConfig: EditingApiConfig,\n): Generator_InsertionOrEditingSuggestion {\n const { getContextString, copilotApiConfig } = useContext(CopilotContext);\n const headers = {\n ...(copilotApiConfig.publicApiKey\n ? { [COPILOT_CLOUD_PUBLIC_API_KEY_HEADER]: copilotApiConfig.publicApiKey }\n : {}),\n };\n\n const runtimeClient = new CopilotRuntimeClient({\n url: copilotApiConfig.chatApiEndpoint,\n publicApiKey: copilotApiConfig.publicApiKey,\n headers,\n });\n\n async function runtimeClientResponseToStringStream(\n responsePromise: ReturnType<typeof runtimeClient.generateCopilotResponse>,\n ) {\n const messagesStream = await CopilotRuntimeClient.asStream(responsePromise);\n\n return new ReadableStream({\n async start(controller) {\n const reader = messagesStream.getReader();\n let sentContent = \"\";\n\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n\n const messages = convertGqlOutputToMessages(value.generateCopilotResponse.messages);\n\n let newContent = \"\";\n\n for (const message of messages) {\n if (message instanceof TextMessage) {\n newContent += message.content;\n }\n }\n if (newContent) {\n const contentToSend = newContent.slice(sentContent.length);\n controller.enqueue(contentToSend);\n sentContent += contentToSend;\n }\n }\n controller.close();\n },\n });\n }\n\n const insertionFunction = useCallback(\n async (\n editorState: EditingEditorState,\n insertionPrompt: string,\n documents: DocumentPointer[],\n abortSignal: AbortSignal,\n ) => {\n const res = await retry(async () => {\n const messages: Message[] = [\n new TextMessage({\n role: Role.System,\n content: insertionApiConfig.makeSystemPrompt(\n textareaPurpose,\n getContextString(documents, contextCategories),\n ),\n }),\n ...insertionApiConfig.fewShotMessages,\n new TextMessage({\n role: Role.User,\n content: `<TextAfterCursor>${editorState.textAfterCursor}</TextAfterCursor>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<TextBeforeCursor>${editorState.textBeforeCursor}</TextBeforeCursor>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<InsertionPrompt>${insertionPrompt}</InsertionPrompt>`,\n }),\n ];\n\n return runtimeClientResponseToStringStream(\n runtimeClient.generateCopilotResponse({\n data: {\n frontend: {\n actions: [],\n },\n messages: convertMessagesToGqlInput(messages),\n metadata: {\n requestType: CopilotRequestType.TextareaCompletion,\n },\n },\n properties: copilotApiConfig.properties,\n signal: abortSignal,\n }),\n );\n });\n\n return res;\n },\n [insertionApiConfig, getContextString, contextCategories, textareaPurpose],\n );\n\n const editingFunction = useCallback(\n async (\n editorState: EditingEditorState,\n editingPrompt: string,\n documents: DocumentPointer[],\n abortSignal: AbortSignal,\n ) => {\n const res = await retry(async () => {\n const messages: Message[] = [\n new TextMessage({\n role: Role.System,\n content: editingApiConfig.makeSystemPrompt(\n textareaPurpose,\n getContextString(documents, contextCategories),\n ),\n }),\n ...editingApiConfig.fewShotMessages,\n new TextMessage({\n role: Role.User,\n content: `<TextBeforeCursor>${editorState.textBeforeCursor}</TextBeforeCursor>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<TextToEdit>${editorState.selectedText}</TextToEdit>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<TextAfterCursor>${editorState.textAfterCursor}</TextAfterCursor>`,\n }),\n new TextMessage({\n role: Role.User,\n content: `<EditingPrompt>${editingPrompt}</EditingPrompt>`,\n }),\n ];\n\n const runtimeClient = new CopilotRuntimeClient({\n url: copilotApiConfig.chatApiEndpoint,\n publicApiKey: copilotApiConfig.publicApiKey,\n headers,\n });\n\n return runtimeClientResponseToStringStream(\n runtimeClient.generateCopilotResponse({\n data: {\n frontend: {\n actions: [],\n },\n messages: convertMessagesToGqlInput(messages),\n metadata: {\n requestType: CopilotRequestType.TextareaCompletion,\n },\n },\n properties: copilotApiConfig.properties,\n signal: abortSignal,\n }),\n );\n });\n\n return res;\n },\n [editingApiConfig, getContextString, contextCategories, textareaPurpose],\n );\n\n const insertionOrEditingFunction = useCallback(\n async (\n editorState: EditingEditorState,\n insertionPrompt: string,\n documents: DocumentPointer[],\n abortSignal: AbortSignal,\n ) => {\n if (editorState.selectedText === \"\") {\n return await insertionFunction(editorState, insertionPrompt, documents, abortSignal);\n } else {\n return await editingFunction(editorState, insertionPrompt, documents, abortSignal);\n }\n },\n [insertionFunction, editingFunction],\n );\n\n return insertionOrEditingFunction;\n}\n"],"mappings":"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","names":["runtimeClient"]}
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  useMakeStandardInsertionOrEditingFunction
3
- } from "./chunk-PAP4ZNRG.mjs";
3
+ } from "./chunk-WDV7S66U.mjs";
4
4
  import {
5
5
  useMakeStandardAutosuggestionFunction
6
6
  } from "./chunk-TTOZXUEA.mjs";
7
- import {
8
- BaseCopilotTextarea
9
- } from "./chunk-W2NSEMKU.mjs";
10
7
  import {
11
8
  defaultAutosuggestionsConfig
12
- } from "./chunk-H3PGQHLG.mjs";
9
+ } from "./chunk-2XUEWZC3.mjs";
10
+ import {
11
+ BaseCopilotTextarea
12
+ } from "./chunk-NZI35NYE.mjs";
13
13
  import {
14
14
  __objRest,
15
15
  __spreadProps,
@@ -57,4 +57,4 @@ var CopilotTextarea = React.forwardRef(
57
57
  export {
58
58
  CopilotTextarea
59
59
  };
60
- //# sourceMappingURL=chunk-GIANKZTF.mjs.map
60
+ //# sourceMappingURL=chunk-WV7RRJEN.mjs.map
@@ -61,4 +61,4 @@ export {
61
61
  defaultSuggestionsFewShotMessages,
62
62
  defaultSuggestionsApiConfig
63
63
  };
64
- //# sourceMappingURL=chunk-WMHVBGPR.mjs.map
64
+ //# sourceMappingURL=chunk-XA2TLAXU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/autosuggestions-config/suggestions-api-config.tsx"],"sourcesContent":["import { Message, Role, TextMessage } from \"@copilotkit/runtime-client-gql\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\n\nexport interface SuggestionsApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: Message[];\n forwardedParams: { [key: string]: any } | undefined;\n}\n\nexport const defaultSuggestionsMakeSystemPrompt: MakeSystemPrompt = (\n textareaPurpose,\n contextString,\n) => {\n return `You are a versatile writing assistant.\n \nThe user is writing some text.\nThe purpose is: \\\"${textareaPurpose}\\\"\n\nYour job is to guess what the user will write next AS BEST YOU CAN.\nOnly guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.\n\nAdjust yourself to the user's style and implied intent.\n\nThe user will provide both the text before and after the cursor. You should use this to infer what the user is likely to write next.\n<TextAfterCursor>\n<TextBeforeCursor>\n<YourSuggestion>\n\nIf we need to add a whitespace character to the suggested text, make sure to explicitly add it in.\n\nThe following external context is also provided. Use it to help you make better suggestions!!!\n\\`\\`\\`\n${contextString}\n\\`\\`\\`\n`;\n};\n\nexport const defaultSuggestionsFewShotMessages: Message[] = [\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>While I was there I also picked up some apples, oranges, and bananas.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content: \"This morning I woke up and went straight to the grocery store.\",\n }),\n new TextMessage({\n role: Role.Assistant,\n content:\n \" When I arrived I went straight to the produce section and picked out a big watermelon. \",\n }),\n new TextMessage({\n role: Role.User,\n content:\n \"<TextAfterCursor>and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof.</TextAfterCursor>\",\n }),\n new TextMessage({\n role: Role.User,\n content:\n '<TextBeforeCursor>The Optionholder, in the Optionholder\\'s capacity as a holder of vested Options, hereby irrevocably and unconditionally agrees: (i) that the Optionholder shall be deemed an \"Equityholder\" under the Merger Agreement and shall be entitled to the rights and benefits, and subject to the obligations, of an \"Equityholder\" thereunder;</TextBeforeCursor>',\n }),\n new TextMessage({\n role: Role.Assistant,\n content:\n ' (ii) that, for purposes of this Agreement and the Merger Agreement, the applicable percentage set forth opposite the name of the Optionholder in the Distribution Waterfall shall be such the Optionholder\\'s \"Pro Rata Share\"; ',\n }),\n];\n\nexport const defaultSuggestionsApiConfig: SuggestionsApiConfig = {\n makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,\n fewShotMessages: defaultSuggestionsFewShotMessages,\n forwardedParams: undefined,\n};\n"],"mappings":";AAAA,SAAkB,MAAM,mBAAmB;AASpC,IAAM,qCAAuD,CAClE,iBACA,kBACG;AACH,SAAO;AAAA;AAAA;AAAA,mBAGW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBlB;AAAA;AAAA;AAGF;AAEO,IAAM,oCAA+C;AAAA,EAC1D,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SAAS;AAAA,EACX,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AAAA,EACD,IAAI,YAAY;AAAA,IACd,MAAM,KAAK;AAAA,IACX,SACE;AAAA,EACJ,CAAC;AACH;AAEO,IAAM,8BAAoD;AAAA,EAC/D,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB;","names":[]}
@@ -4,15 +4,10 @@ import {
4
4
 
5
5
  // src/lib/utils.ts
6
6
  import { clsx } from "clsx";
7
- import { customAlphabet } from "nanoid";
8
7
  import { twMerge } from "tailwind-merge";
9
8
  function cn(...inputs) {
10
9
  return twMerge(clsx(inputs));
11
10
  }
12
- var nanoid = customAlphabet(
13
- "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
14
- 7
15
- );
16
11
  function fetcher(input, init) {
17
12
  return __async(this, null, function* () {
18
13
  const res = yield fetch(input, init);
@@ -47,10 +42,9 @@ function nullableCompatibleEqualityCheck(naiveEqualityCheck, a, b) {
47
42
 
48
43
  export {
49
44
  cn,
50
- nanoid,
51
45
  fetcher,
52
46
  formatDate,
53
47
  arraysAreEqual,
54
48
  nullableCompatibleEqualityCheck
55
49
  };
56
- //# sourceMappingURL=chunk-7SUZ6CXM.mjs.map
50
+ //# sourceMappingURL=chunk-YLFAIYRY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/utils.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport async function fetcher<JSON = any>(input: RequestInfo, init?: RequestInit): Promise<JSON> {\n const res = await fetch(input, init);\n\n if (!res.ok) {\n const json = await res.json();\n if (json.error) {\n const error = new Error(json.error) as Error & {\n status: number;\n };\n error.status = res.status;\n throw error;\n } else {\n throw new Error(\"An unexpected error occurred\");\n }\n }\n\n return res.json();\n}\n\nexport function formatDate(input: string | number | Date): string {\n const date = new Date(input);\n return date.toLocaleDateString(\"en-US\", {\n month: \"long\",\n day: \"numeric\",\n year: \"numeric\",\n });\n}\n\nexport const arraysAreEqual = (arr1: number[], arr2: number[]): boolean =>\n arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);\n\nexport function nullableCompatibleEqualityCheck<T>(\n naiveEqualityCheck: (a: T, b: T) => boolean,\n a: T | null | undefined,\n b: T | null | undefined,\n): boolean {\n if (a === null || a === undefined || b === null || b === undefined) {\n return a === b;\n }\n\n return naiveEqualityCheck(a, b);\n}\n"],"mappings":";;;;;AAAA,SAAS,YAA6B;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;AAEA,SAAsB,QAAoB,OAAoB,MAAmC;AAAA;AAC/F,UAAM,MAAM,MAAM,MAAM,OAAO,IAAI;AAEnC,QAAI,CAAC,IAAI,IAAI;AACX,YAAM,OAAO,MAAM,IAAI,KAAK;AAC5B,UAAI,KAAK,OAAO;AACd,cAAM,QAAQ,IAAI,MAAM,KAAK,KAAK;AAGlC,cAAM,SAAS,IAAI;AACnB,cAAM;AAAA,MACR,OAAO;AACL,cAAM,IAAI,MAAM,8BAA8B;AAAA,MAChD;AAAA,IACF;AAEA,WAAO,IAAI,KAAK;AAAA,EAClB;AAAA;AAEO,SAAS,WAAW,OAAuC;AAChE,QAAM,OAAO,IAAI,KAAK,KAAK;AAC3B,SAAO,KAAK,mBAAmB,SAAS;AAAA,IACtC,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,EACR,CAAC;AACH;AAEO,IAAM,iBAAiB,CAAC,MAAgB,SAC7C,KAAK,WAAW,KAAK,UAAU,KAAK,MAAM,CAAC,OAAO,UAAU,UAAU,KAAK,KAAK,CAAC;AAE5E,SAAS,gCACd,oBACA,GACA,GACS;AACT,MAAI,MAAM,QAAQ,MAAM,UAAa,MAAM,QAAQ,MAAM,QAAW;AAClE,WAAO,MAAM;AAAA,EACf;AAEA,SAAO,mBAAmB,GAAG,CAAC;AAChC;","names":[]}
@@ -120,15 +120,10 @@ var Debouncer = class {
120
120
 
121
121
  // src/lib/utils.ts
122
122
  var import_clsx = require("clsx");
123
- var import_nanoid = require("nanoid");
124
123
  var import_tailwind_merge = require("tailwind-merge");
125
124
  function cn(...inputs) {
126
125
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
127
126
  }
128
- var nanoid = (0, import_nanoid.customAlphabet)(
129
- "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
130
- 7
131
- );
132
127
  var arraysAreEqual = (arr1, arr2) => arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);
133
128
  function nullableCompatibleEqualityCheck(naiveEqualityCheck, a, b) {
134
129
  if (a === null || a === void 0 || b === null || b === void 0) {