@copilotkit/react-textarea 0.26.0-alpha.2 → 0.26.0-alpha.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 (223) hide show
  1. package/.turbo/turbo-build.log +189 -185
  2. package/CHANGELOG.md +22 -0
  3. package/dist/chunk-224UKA7C.mjs +33 -0
  4. package/dist/chunk-224UKA7C.mjs.map +1 -0
  5. package/dist/chunk-2C7O2EVM.mjs +27 -0
  6. package/dist/chunk-2C7O2EVM.mjs.map +1 -0
  7. package/dist/chunk-2QDCE7PD.mjs +29 -0
  8. package/dist/chunk-2QDCE7PD.mjs.map +1 -0
  9. package/dist/chunk-3PQ7GSFE.mjs +17 -0
  10. package/dist/chunk-3PQ7GSFE.mjs.map +1 -0
  11. package/dist/chunk-47L4PLG4.mjs +45 -0
  12. package/dist/chunk-47L4PLG4.mjs.map +1 -0
  13. package/dist/chunk-4NHVQZ67.mjs +107 -0
  14. package/dist/chunk-4NHVQZ67.mjs.map +1 -0
  15. package/dist/chunk-5FO6ISW4.mjs +3 -0
  16. package/dist/chunk-5FO6ISW4.mjs.map +1 -0
  17. package/dist/chunk-5UNJXFUO.mjs +29 -0
  18. package/dist/chunk-5UNJXFUO.mjs.map +1 -0
  19. package/dist/chunk-72P3KOHZ.mjs +91 -0
  20. package/dist/chunk-72P3KOHZ.mjs.map +1 -0
  21. package/dist/chunk-7LSRNPNI.mjs +59 -0
  22. package/dist/chunk-7LSRNPNI.mjs.map +1 -0
  23. package/dist/chunk-7SUZ6CXM.mjs +47 -0
  24. package/dist/chunk-7SUZ6CXM.mjs.map +1 -0
  25. package/dist/chunk-DE5K76I2.mjs +3 -0
  26. package/dist/chunk-DE5K76I2.mjs.map +1 -0
  27. package/dist/chunk-DRV2FOHZ.mjs +65 -0
  28. package/dist/chunk-DRV2FOHZ.mjs.map +1 -0
  29. package/dist/chunk-ECR45NSD.mjs +101 -0
  30. package/dist/chunk-ECR45NSD.mjs.map +1 -0
  31. package/dist/chunk-ELEY7HWW.mjs +202 -0
  32. package/dist/chunk-ELEY7HWW.mjs.map +1 -0
  33. package/dist/chunk-EPBVNDKE.mjs +46 -0
  34. package/dist/chunk-EPBVNDKE.mjs.map +1 -0
  35. package/dist/chunk-FJNUPSQK.mjs +72 -0
  36. package/dist/chunk-FJNUPSQK.mjs.map +1 -0
  37. package/dist/chunk-FP2EKU3L.mjs +28 -0
  38. package/dist/chunk-FP2EKU3L.mjs.map +1 -0
  39. package/dist/chunk-FRIYJQCI.mjs +99 -0
  40. package/dist/chunk-FRIYJQCI.mjs.map +1 -0
  41. package/dist/chunk-GQN2HYFJ.mjs +22 -0
  42. package/dist/chunk-GQN2HYFJ.mjs.map +1 -0
  43. package/dist/chunk-H4VKQGVU.mjs +3 -0
  44. package/dist/chunk-H4VKQGVU.mjs.map +1 -0
  45. package/dist/chunk-IU3WTXLQ.mjs +3 -0
  46. package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
  47. package/dist/chunk-JJLQVT7S.mjs +10 -0
  48. package/dist/chunk-JJLQVT7S.mjs.map +1 -0
  49. package/dist/chunk-K5LNB36H.mjs +80 -0
  50. package/dist/chunk-K5LNB36H.mjs.map +1 -0
  51. package/dist/chunk-KDVMG3XF.mjs +63 -0
  52. package/dist/chunk-KDVMG3XF.mjs.map +1 -0
  53. package/dist/chunk-KFQZHRPJ.mjs +19 -0
  54. package/dist/chunk-KFQZHRPJ.mjs.map +1 -0
  55. package/dist/chunk-KNBNKEXR.mjs +27 -0
  56. package/dist/chunk-KNBNKEXR.mjs.map +1 -0
  57. package/dist/chunk-KNQIEOFP.mjs +18 -0
  58. package/dist/chunk-KNQIEOFP.mjs.map +1 -0
  59. package/dist/chunk-L7VVZH4Q.mjs +3 -0
  60. package/dist/chunk-L7VVZH4Q.mjs.map +1 -0
  61. package/dist/chunk-LP2REBM5.mjs +217 -0
  62. package/dist/chunk-LP2REBM5.mjs.map +1 -0
  63. package/dist/chunk-M2DR4KVB.mjs +33 -0
  64. package/dist/chunk-M2DR4KVB.mjs.map +1 -0
  65. package/dist/chunk-MMVDU6DF.mjs +3 -0
  66. package/dist/chunk-MMVDU6DF.mjs.map +1 -0
  67. package/dist/chunk-MRXNTQOX.mjs +55 -0
  68. package/dist/chunk-MRXNTQOX.mjs.map +1 -0
  69. package/dist/chunk-MTDBPK5D.mjs +53 -0
  70. package/dist/chunk-MTDBPK5D.mjs.map +1 -0
  71. package/dist/chunk-NRTYAQJE.mjs +46 -0
  72. package/dist/chunk-NRTYAQJE.mjs.map +1 -0
  73. package/dist/chunk-NTLVQENP.mjs +19 -0
  74. package/dist/chunk-NTLVQENP.mjs.map +1 -0
  75. package/dist/chunk-OHO4G6DR.mjs +19 -0
  76. package/dist/chunk-OHO4G6DR.mjs.map +1 -0
  77. package/dist/chunk-P4QVFRLY.mjs +103 -0
  78. package/dist/chunk-P4QVFRLY.mjs.map +1 -0
  79. package/dist/chunk-PTZVE6NC.mjs +94 -0
  80. package/dist/chunk-PTZVE6NC.mjs.map +1 -0
  81. package/dist/chunk-QDFAIRQF.mjs +45 -0
  82. package/dist/chunk-QDFAIRQF.mjs.map +1 -0
  83. package/dist/chunk-RBR32FWA.mjs +74 -0
  84. package/dist/chunk-RBR32FWA.mjs.map +1 -0
  85. package/dist/chunk-T6MTDQZ7.mjs +45 -0
  86. package/dist/chunk-T6MTDQZ7.mjs.map +1 -0
  87. package/dist/chunk-VPEH6V7T.mjs +83 -0
  88. package/dist/chunk-VPEH6V7T.mjs.map +1 -0
  89. package/dist/chunk-WADHCMPK.mjs +3 -0
  90. package/dist/chunk-WADHCMPK.mjs.map +1 -0
  91. package/dist/chunk-WFTAAA7R.mjs +44 -0
  92. package/dist/chunk-WFTAAA7R.mjs.map +1 -0
  93. package/dist/chunk-WJHSY5T6.mjs +3 -0
  94. package/dist/chunk-WJHSY5T6.mjs.map +1 -0
  95. package/dist/chunk-WTASPE2W.mjs +105 -0
  96. package/dist/chunk-WTASPE2W.mjs.map +1 -0
  97. package/dist/chunk-XV7MLLXQ.mjs +18 -0
  98. package/dist/chunk-XV7MLLXQ.mjs.map +1 -0
  99. package/dist/chunk-Y473E2ZQ.mjs +112 -0
  100. package/dist/chunk-Y473E2ZQ.mjs.map +1 -0
  101. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +35 -1745
  102. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs.map +1 -1
  103. package/dist/components/base-copilot-textarea/render-element.mjs +3 -51
  104. package/dist/components/base-copilot-textarea/render-element.mjs.map +1 -1
  105. package/dist/components/base-copilot-textarea/render-placeholder.mjs +3 -49
  106. package/dist/components/base-copilot-textarea/render-placeholder.mjs.map +1 -1
  107. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs +4 -86
  108. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs.map +1 -1
  109. package/dist/components/base-copilot-textarea/use-add-branding-css.mjs +3 -57
  110. package/dist/components/base-copilot-textarea/use-add-branding-css.mjs.map +1 -1
  111. package/dist/components/copilot-textarea/copilot-textarea.mjs +47 -2202
  112. package/dist/components/copilot-textarea/copilot-textarea.mjs.map +1 -1
  113. package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +3 -17
  114. package/dist/components/hovering-toolbar/hovering-editor-provider.mjs.map +1 -1
  115. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +3 -137
  116. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs.map +1 -1
  117. package/dist/components/hovering-toolbar/hovering-toolbar.mjs +18 -875
  118. package/dist/components/hovering-toolbar/hovering-toolbar.mjs.map +1 -1
  119. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +12 -558
  120. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs.map +1 -1
  121. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +13 -581
  122. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs.map +1 -1
  123. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs +5 -102
  124. package/dist/components/hovering-toolbar/text-insertion-prompt-box/included-files-preview.mjs.map +1 -1
  125. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +14 -581
  126. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs.map +1 -1
  127. package/dist/components/index.mjs +48 -2203
  128. package/dist/components/index.mjs.map +1 -1
  129. package/dist/components/manual-ui/chip-with-icon.mjs +6 -5
  130. package/dist/components/manual-ui/chip-with-icon.mjs.map +1 -1
  131. package/dist/components/source-search-box/source-search-box.mjs +6 -211
  132. package/dist/components/source-search-box/source-search-box.mjs.map +1 -1
  133. package/dist/components/ui/button.mjs +4 -85
  134. package/dist/components/ui/button.mjs.map +1 -1
  135. package/dist/components/ui/card.mjs +7 -53
  136. package/dist/components/ui/card.mjs.map +1 -1
  137. package/dist/components/ui/command.mjs +5 -244
  138. package/dist/components/ui/command.mjs.map +1 -1
  139. package/dist/components/ui/dialog.mjs +4 -144
  140. package/dist/components/ui/dialog.mjs.map +1 -1
  141. package/dist/components/ui/label.mjs +4 -60
  142. package/dist/components/ui/label.mjs.map +1 -1
  143. package/dist/components/ui/separator.mjs +8 -50
  144. package/dist/components/ui/separator.mjs.map +1 -1
  145. package/dist/components/ui/textarea.mjs +7 -48
  146. package/dist/components/ui/textarea.mjs.map +1 -1
  147. package/dist/context/index.mjs +2 -0
  148. package/dist/context/index.mjs.map +1 -1
  149. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +6 -158
  150. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs.map +1 -1
  151. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs +4 -168
  152. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs.map +1 -1
  153. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs +5 -148
  154. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map +1 -1
  155. package/dist/hooks/index.mjs +2 -0
  156. package/dist/hooks/index.mjs.map +1 -1
  157. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +14 -147
  158. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs.map +1 -1
  159. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +14 -193
  160. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs.map +1 -1
  161. package/dist/hooks/misc/use-autosize-textarea.mjs +3 -15
  162. package/dist/hooks/misc/use-autosize-textarea.mjs.map +1 -1
  163. package/dist/index.mjs +50 -2206
  164. package/dist/index.mjs.map +1 -1
  165. package/dist/lib/debouncer.mjs +3 -51
  166. package/dist/lib/debouncer.mjs.map +1 -1
  167. package/dist/lib/editor-to-text.mjs +3 -43
  168. package/dist/lib/editor-to-text.mjs.map +1 -1
  169. package/dist/lib/get-text-around-cursor.mjs +3 -102
  170. package/dist/lib/get-text-around-cursor.mjs.map +1 -1
  171. package/dist/lib/retry.mjs +3 -17
  172. package/dist/lib/retry.mjs.map +1 -1
  173. package/dist/lib/slatejs-edits/add-autocompletions.mjs +3 -25
  174. package/dist/lib/slatejs-edits/add-autocompletions.mjs.map +1 -1
  175. package/dist/lib/slatejs-edits/clear-autocompletions.mjs +3 -20
  176. package/dist/lib/slatejs-edits/clear-autocompletions.mjs.map +1 -1
  177. package/dist/lib/slatejs-edits/replace-text.mjs +3 -27
  178. package/dist/lib/slatejs-edits/replace-text.mjs.map +1 -1
  179. package/dist/lib/slatejs-edits/with-partial-history.mjs +3 -106
  180. package/dist/lib/slatejs-edits/with-partial-history.mjs.map +1 -1
  181. package/dist/lib/stream-promise-flatten.mjs +3 -47
  182. package/dist/lib/stream-promise-flatten.mjs.map +1 -1
  183. package/dist/lib/utils.mjs +3 -71
  184. package/dist/lib/utils.mjs.map +1 -1
  185. package/dist/lib/utils.test.mjs +1 -0
  186. package/dist/lib/utils.test.mjs.map +1 -1
  187. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs +2 -0
  188. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs.map +1 -1
  189. package/dist/types/autosuggestions-config/autosuggestions-config.mjs +8 -265
  190. package/dist/types/autosuggestions-config/autosuggestions-config.mjs.map +1 -1
  191. package/dist/types/autosuggestions-config/editing-api-config.mjs +3 -81
  192. package/dist/types/autosuggestions-config/editing-api-config.mjs.map +1 -1
  193. package/dist/types/autosuggestions-config/index.mjs +10 -327
  194. package/dist/types/autosuggestions-config/index.mjs.map +1 -1
  195. package/dist/types/autosuggestions-config/insertions-api-config.mjs +3 -75
  196. package/dist/types/autosuggestions-config/insertions-api-config.mjs.map +1 -1
  197. package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs +3 -83
  198. package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs.map +1 -1
  199. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs +2 -0
  200. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs.map +1 -1
  201. package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.mjs +2 -0
  202. package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.mjs.map +1 -1
  203. package/dist/types/autosuggestions-config/suggestions-api-config.mjs +3 -64
  204. package/dist/types/autosuggestions-config/suggestions-api-config.mjs.map +1 -1
  205. package/dist/types/base/autosuggestion-state.mjs +2 -0
  206. package/dist/types/base/autosuggestion-state.mjs.map +1 -1
  207. package/dist/types/base/autosuggestions-bare-function.mjs +2 -0
  208. package/dist/types/base/autosuggestions-bare-function.mjs.map +1 -1
  209. package/dist/types/base/base-autosuggestions-config.mjs +3 -26
  210. package/dist/types/base/base-autosuggestions-config.mjs.map +1 -1
  211. package/dist/types/base/base-copilot-textarea-props.mjs +2 -0
  212. package/dist/types/base/base-copilot-textarea-props.mjs.map +1 -1
  213. package/dist/types/base/custom-editor.mjs +2 -0
  214. package/dist/types/base/custom-editor.mjs.map +1 -1
  215. package/dist/types/base/editor-autocomplete-state.mjs +4 -17
  216. package/dist/types/base/editor-autocomplete-state.mjs.map +1 -1
  217. package/dist/types/base/index.mjs +4 -26
  218. package/dist/types/base/index.mjs.map +1 -1
  219. package/dist/types/html-copilot-textarea-element.mjs +2 -0
  220. package/dist/types/html-copilot-textarea-element.mjs.map +1 -1
  221. package/dist/types/index.mjs +12 -328
  222. package/dist/types/index.mjs.map +1 -1
  223. package/package.json +3 -3
@@ -1,65 +1,4 @@
1
- // src/types/autosuggestions-config/suggestions-api-config.tsx
2
- var defaultSuggestionsMakeSystemPrompt = (textareaPurpose, contextString) => {
3
- return `You are a versatile writing assistant.
4
-
5
- The user is writing some text.
6
- The purpose is: "${textareaPurpose}"
7
-
8
- Your job is to guess what the user will write next AS BEST YOU CAN.
9
- Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
10
-
11
- Adjust yourself to the user's style and implied intent.
12
-
13
- The 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.
14
- <TextAfterCursor>
15
- <TextBeforeCursor>
16
- <YourSuggestion>
17
-
18
- If we need to add a whitespace character to the suggested text, make sure to explicitly add it in.
19
-
20
- The following external context is also provided. Use it to help you make better suggestions!!!
21
- \`\`\`
22
- ${contextString}
23
- \`\`\`
24
- `;
25
- };
26
- var defaultSuggestionsFewShotMessages = [
27
- {
28
- role: "user",
29
- name: "TextAfterCursor",
30
- content: "While I was there I also picked up some apples, oranges, and bananas."
31
- },
32
- {
33
- role: "user",
34
- content: "This morning I woke up and went straight to the grocery store."
35
- },
36
- {
37
- role: "assistant",
38
- content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
39
- },
40
- {
41
- role: "user",
42
- name: "TextAfterCursor",
43
- content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
44
- },
45
- {
46
- role: "user",
47
- name: "TextBeforeCursor",
48
- content: `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;`
49
- },
50
- {
51
- role: "assistant",
52
- content: ` (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"; `
53
- }
54
- ];
55
- var defaultSuggestionsApiConfig = {
56
- makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,
57
- fewShotMessages: defaultSuggestionsFewShotMessages,
58
- forwardedParams: void 0
59
- };
60
- export {
61
- defaultSuggestionsApiConfig,
62
- defaultSuggestionsFewShotMessages,
63
- defaultSuggestionsMakeSystemPrompt
64
- };
1
+ export { defaultSuggestionsApiConfig, defaultSuggestionsFewShotMessages, defaultSuggestionsMakeSystemPrompt } from '../../chunk-KDVMG3XF.mjs';
2
+ import '../../chunk-MRXNTQOX.mjs';
3
+ //# sourceMappingURL=out.js.map
65
4
  //# sourceMappingURL=suggestions-api-config.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/types/autosuggestions-config/suggestions-api-config.tsx"],"sourcesContent":["import { MinimalChatGPTMessage } from \"./subtypes/minimal-chat-gpt-message\";\nimport { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\n\nexport interface SuggestionsApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: MinimalChatGPTMessage[];\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: MinimalChatGPTMessage[] = [\n {\n role: \"user\",\n name: \"TextAfterCursor\",\n content: \"While I was there I also picked up some apples, oranges, and bananas.\",\n },\n {\n role: \"user\",\n content: \"This morning I woke up and went straight to the grocery store.\",\n },\n {\n role: \"assistant\",\n content:\n \" When I arrived I went straight to the produce section and picked out a big watermelon. \",\n },\n {\n role: \"user\",\n name: \"TextAfterCursor\",\n content:\n \"and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof.\",\n },\n {\n role: \"user\",\n name: \"TextBeforeCursor\",\n content:\n '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;',\n },\n {\n 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":";AASO,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,oCAA6D;AAAA,EACxE;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,SACE;AAAA,EACJ;AACF;AAEO,IAAM,8BAAoD;AAAA,EAC/D,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,iBAAiB;AACnB;","names":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1 +1,3 @@
1
+
2
+ //# sourceMappingURL=out.js.map
1
3
  //# sourceMappingURL=autosuggestion-state.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1 +1,3 @@
1
+
2
+ //# sourceMappingURL=out.js.map
1
3
  //# sourceMappingURL=autosuggestions-bare-function.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,27 +1,4 @@
1
- // src/types/base/base-autosuggestions-config.tsx
2
- import { defaultCopilotContextCategories } from "@copilotkit/react-core";
3
- var defaultShouldToggleHoveringEditorOnKeyPress = (event) => {
4
- if (event.key === "k" && event.metaKey) {
5
- return true;
6
- }
7
- return false;
8
- };
9
- var defaultShouldAcceptAutosuggestionOnKeyPress = (event) => {
10
- if (event.key === "Tab") {
11
- return true;
12
- }
13
- return false;
14
- };
15
- var defaultBaseAutosuggestionsConfig = {
16
- debounceTime: 250,
17
- contextCategories: defaultCopilotContextCategories,
18
- disableWhenEmpty: true,
19
- disabled: false,
20
- temporarilyDisableWhenMovingCursorWithoutChangingText: true,
21
- shouldToggleHoveringEditorOnKeyPress: defaultShouldToggleHoveringEditorOnKeyPress,
22
- shouldAcceptAutosuggestionOnKeyPress: defaultShouldAcceptAutosuggestionOnKeyPress
23
- };
24
- export {
25
- defaultBaseAutosuggestionsConfig
26
- };
1
+ export { defaultBaseAutosuggestionsConfig } from '../../chunk-FP2EKU3L.mjs';
2
+ import '../../chunk-MRXNTQOX.mjs';
3
+ //# sourceMappingURL=out.js.map
27
4
  //# sourceMappingURL=base-autosuggestions-config.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/types/base/base-autosuggestions-config.tsx"],"sourcesContent":["import { BaseCopilotTextareaApiConfig } from \"./autosuggestions-bare-function\";\nimport { defaultCopilotContextCategories } from \"@copilotkit/react-core\";\n\n/**\n * @interface BaseAutosuggestionsConfig\n *\n * @property {string} textareaPurpose - The purpose of the textarea. This is used to guide the autosuggestions.\n *\n * @property {string[]} contextCategories - The categories of context to consider when providing autosuggestions.\n *\n * @property {number} debounceTime - The amount of time (in milliseconds) to wait before triggering autosuggestions after the user has stopped typing.\n *\n * @property {BaseCopilotTextareaApiConfig} apiConfig - The configuration for the API that provides the autosuggestions.\n *\n * @property {boolean} disableWhenEmpty - Whether to disable autosuggestions when the textarea is empty.\n *\n * @property {boolean} disabled - Whether to disable autosuggestions entirely.\n *\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable autosuggestions when the user moves the cursor without changing the text.\n *\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the current autosuggestion based on a key press event. By default, the Tab key is used to accept the autosuggestion. Example code:\n *\n * ```typescript\n * const defaultShouldAcceptAutosuggestionOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if tab, accept the autosuggestion\n * if (event.key === \"Tab\") {\n * return true;\n * }\n * return false;\n * }\n * ```\n *\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event. By default, the Command + K key combination is used to toggle the hovering editor. Example code:\n *\n * ```typescript\n * const defaultShouldToggleHoveringEditorOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if command-k, toggle the hovering editor\n * if (event.key === \"k\" && event.metaKey) {\n * return true;\n * }\n * return false;\n * }\n * ```\n */\nexport interface BaseAutosuggestionsConfig {\n textareaPurpose: string;\n contextCategories: string[];\n debounceTime: number;\n apiConfig: BaseCopilotTextareaApiConfig;\n\n disableWhenEmpty: boolean;\n disabled: boolean;\n temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;\n shouldAcceptAutosuggestionOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;\n shouldToggleHoveringEditorOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;\n}\n\n// by default, command-k toggles the hovering editor\nconst defaultShouldToggleHoveringEditorOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n) => {\n // if command-k, toggle the hovering editor\n if (event.key === \"k\" && event.metaKey) {\n return true;\n }\n return false;\n};\n\nconst defaultShouldAcceptAutosuggestionOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n) => {\n // if tab, accept the autosuggestion\n if (event.key === \"Tab\") {\n return true;\n }\n return false;\n};\n\n/**\n * Default configuration for the BaseAutosuggestions.\n *\n * @property {number} debounceTime - The amount of time to wait before triggering the autosuggestions API call.\n * @property {string[]} contextCategories - The categories to use for context when making the autosuggestions API call.\n * @property {boolean} disableWhenEmpty - Whether to disable the autosuggestions when the textarea is empty.\n * @property {boolean} disabled - Whether to disable the autosuggestions feature entirely.\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable the autosuggestions when the cursor is moved without changing the text.\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event.\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the autosuggestion based on a key press event.\n */\n\nexport const defaultBaseAutosuggestionsConfig: Omit<\n BaseAutosuggestionsConfig,\n \"textareaPurpose\" | \"apiConfig\"\n> = {\n debounceTime: 250,\n contextCategories: defaultCopilotContextCategories,\n disableWhenEmpty: true,\n disabled: false,\n temporarilyDisableWhenMovingCursorWithoutChangingText: true,\n shouldToggleHoveringEditorOnKeyPress: defaultShouldToggleHoveringEditorOnKeyPress,\n shouldAcceptAutosuggestionOnKeyPress: defaultShouldAcceptAutosuggestionOnKeyPress,\n};\n"],"mappings":";AACA,SAAS,uCAAuC;AAyDhD,IAAM,8CAA8C,CAClD,UACG;AAEH,MAAI,MAAM,QAAQ,OAAO,MAAM,SAAS;AACtC,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,IAAM,8CAA8C,CAClD,UACG;AAEH,MAAI,MAAM,QAAQ,OAAO;AACvB,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAcO,IAAM,mCAGT;AAAA,EACF,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,uDAAuD;AAAA,EACvD,sCAAsC;AAAA,EACtC,sCAAsC;AACxC;","names":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1 +1,3 @@
1
+
2
+ //# sourceMappingURL=out.js.map
1
3
  //# sourceMappingURL=base-copilot-textarea-props.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1 +1,3 @@
1
+
2
+ //# sourceMappingURL=out.js.map
1
3
  //# sourceMappingURL=custom-editor.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,18 +1,5 @@
1
- // src/lib/utils.ts
2
- import { clsx } from "clsx";
3
- import { customAlphabet } from "nanoid";
4
- import { twMerge } from "tailwind-merge";
5
- var nanoid = customAlphabet(
6
- "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
7
- 7
8
- );
9
- var arraysAreEqual = (arr1, arr2) => arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);
10
-
11
- // src/types/base/editor-autocomplete-state.ts
12
- function areEqual_autocompleteState(prev, next) {
13
- return prev.cursorPoint.offset === next.cursorPoint.offset && arraysAreEqual(prev.cursorPoint.path, next.cursorPoint.path) && prev.textBeforeCursor === next.textBeforeCursor && prev.textAfterCursor === next.textAfterCursor;
14
- }
15
- export {
16
- areEqual_autocompleteState
17
- };
1
+ export { areEqual_autocompleteState } from '../../chunk-JJLQVT7S.mjs';
2
+ import '../../chunk-7SUZ6CXM.mjs';
3
+ import '../../chunk-MRXNTQOX.mjs';
4
+ //# sourceMappingURL=out.js.map
18
5
  //# sourceMappingURL=editor-autocomplete-state.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/utils.ts","../../../src/types/base/editor-autocomplete-state.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { customAlphabet } from \"nanoid\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const nanoid = customAlphabet(\n \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\",\n 7,\n); // 7-character random string\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","import { BasePoint } from \"slate\";\nimport { arraysAreEqual } from \"../../lib/utils\";\n\nexport interface EditorAutocompleteState {\n cursorPoint: BasePoint;\n textBeforeCursor: string;\n textAfterCursor: string;\n}\n\nexport function areEqual_autocompleteState(\n prev: EditorAutocompleteState,\n next: EditorAutocompleteState,\n) {\n return (\n prev.cursorPoint.offset === next.cursorPoint.offset &&\n arraysAreEqual(prev.cursorPoint.path, next.cursorPoint.path) &&\n prev.textBeforeCursor === next.textBeforeCursor &&\n prev.textAfterCursor === next.textAfterCursor\n );\n}\n"],"mappings":";AAAA,SAAS,YAA6B;AACtC,SAAS,sBAAsB;AAC/B,SAAS,eAAe;AAMjB,IAAM,SAAS;AAAA,EACpB;AAAA,EACA;AACF;AA8BO,IAAM,iBAAiB,CAAC,MAAgB,SAC7C,KAAK,WAAW,KAAK,UAAU,KAAK,MAAM,CAAC,OAAO,UAAU,UAAU,KAAK,KAAK,CAAC;;;ACjC5E,SAAS,2BACd,MACA,MACA;AACA,SACE,KAAK,YAAY,WAAW,KAAK,YAAY,UAC7C,eAAe,KAAK,YAAY,MAAM,KAAK,YAAY,IAAI,KAC3D,KAAK,qBAAqB,KAAK,oBAC/B,KAAK,oBAAoB,KAAK;AAElC;","names":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,27 +1,5 @@
1
- // src/types/base/base-autosuggestions-config.tsx
2
- import { defaultCopilotContextCategories } from "@copilotkit/react-core";
3
- var defaultShouldToggleHoveringEditorOnKeyPress = (event) => {
4
- if (event.key === "k" && event.metaKey) {
5
- return true;
6
- }
7
- return false;
8
- };
9
- var defaultShouldAcceptAutosuggestionOnKeyPress = (event) => {
10
- if (event.key === "Tab") {
11
- return true;
12
- }
13
- return false;
14
- };
15
- var defaultBaseAutosuggestionsConfig = {
16
- debounceTime: 250,
17
- contextCategories: defaultCopilotContextCategories,
18
- disableWhenEmpty: true,
19
- disabled: false,
20
- temporarilyDisableWhenMovingCursorWithoutChangingText: true,
21
- shouldToggleHoveringEditorOnKeyPress: defaultShouldToggleHoveringEditorOnKeyPress,
22
- shouldAcceptAutosuggestionOnKeyPress: defaultShouldAcceptAutosuggestionOnKeyPress
23
- };
24
- export {
25
- defaultBaseAutosuggestionsConfig
26
- };
1
+ import '../../chunk-WJHSY5T6.mjs';
2
+ export { defaultBaseAutosuggestionsConfig } from '../../chunk-FP2EKU3L.mjs';
3
+ import '../../chunk-MRXNTQOX.mjs';
4
+ //# sourceMappingURL=out.js.map
27
5
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/types/base/base-autosuggestions-config.tsx"],"sourcesContent":["import { BaseCopilotTextareaApiConfig } from \"./autosuggestions-bare-function\";\nimport { defaultCopilotContextCategories } from \"@copilotkit/react-core\";\n\n/**\n * @interface BaseAutosuggestionsConfig\n *\n * @property {string} textareaPurpose - The purpose of the textarea. This is used to guide the autosuggestions.\n *\n * @property {string[]} contextCategories - The categories of context to consider when providing autosuggestions.\n *\n * @property {number} debounceTime - The amount of time (in milliseconds) to wait before triggering autosuggestions after the user has stopped typing.\n *\n * @property {BaseCopilotTextareaApiConfig} apiConfig - The configuration for the API that provides the autosuggestions.\n *\n * @property {boolean} disableWhenEmpty - Whether to disable autosuggestions when the textarea is empty.\n *\n * @property {boolean} disabled - Whether to disable autosuggestions entirely.\n *\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable autosuggestions when the user moves the cursor without changing the text.\n *\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the current autosuggestion based on a key press event. By default, the Tab key is used to accept the autosuggestion. Example code:\n *\n * ```typescript\n * const defaultShouldAcceptAutosuggestionOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if tab, accept the autosuggestion\n * if (event.key === \"Tab\") {\n * return true;\n * }\n * return false;\n * }\n * ```\n *\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event. By default, the Command + K key combination is used to toggle the hovering editor. Example code:\n *\n * ```typescript\n * const defaultShouldToggleHoveringEditorOnKeyPress = (event: React.KeyboardEvent<HTMLDivElement>) => {\n * // if command-k, toggle the hovering editor\n * if (event.key === \"k\" && event.metaKey) {\n * return true;\n * }\n * return false;\n * }\n * ```\n */\nexport interface BaseAutosuggestionsConfig {\n textareaPurpose: string;\n contextCategories: string[];\n debounceTime: number;\n apiConfig: BaseCopilotTextareaApiConfig;\n\n disableWhenEmpty: boolean;\n disabled: boolean;\n temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;\n shouldAcceptAutosuggestionOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;\n shouldToggleHoveringEditorOnKeyPress: (event: React.KeyboardEvent<HTMLDivElement>) => boolean;\n}\n\n// by default, command-k toggles the hovering editor\nconst defaultShouldToggleHoveringEditorOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n) => {\n // if command-k, toggle the hovering editor\n if (event.key === \"k\" && event.metaKey) {\n return true;\n }\n return false;\n};\n\nconst defaultShouldAcceptAutosuggestionOnKeyPress = (\n event: React.KeyboardEvent<HTMLDivElement>,\n) => {\n // if tab, accept the autosuggestion\n if (event.key === \"Tab\") {\n return true;\n }\n return false;\n};\n\n/**\n * Default configuration for the BaseAutosuggestions.\n *\n * @property {number} debounceTime - The amount of time to wait before triggering the autosuggestions API call.\n * @property {string[]} contextCategories - The categories to use for context when making the autosuggestions API call.\n * @property {boolean} disableWhenEmpty - Whether to disable the autosuggestions when the textarea is empty.\n * @property {boolean} disabled - Whether to disable the autosuggestions feature entirely.\n * @property {boolean} temporarilyDisableWhenMovingCursorWithoutChangingText - Whether to temporarily disable the autosuggestions when the cursor is moved without changing the text.\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldToggleHoveringEditorOnKeyPress - A function that determines whether to toggle the hovering editor based on a key press event.\n * @property {(event: React.KeyboardEvent<HTMLDivElement>) => boolean} shouldAcceptAutosuggestionOnKeyPress - A function that determines whether to accept the autosuggestion based on a key press event.\n */\n\nexport const defaultBaseAutosuggestionsConfig: Omit<\n BaseAutosuggestionsConfig,\n \"textareaPurpose\" | \"apiConfig\"\n> = {\n debounceTime: 250,\n contextCategories: defaultCopilotContextCategories,\n disableWhenEmpty: true,\n disabled: false,\n temporarilyDisableWhenMovingCursorWithoutChangingText: true,\n shouldToggleHoveringEditorOnKeyPress: defaultShouldToggleHoveringEditorOnKeyPress,\n shouldAcceptAutosuggestionOnKeyPress: defaultShouldAcceptAutosuggestionOnKeyPress,\n};\n"],"mappings":";AACA,SAAS,uCAAuC;AAyDhD,IAAM,8CAA8C,CAClD,UACG;AAEH,MAAI,MAAM,QAAQ,OAAO,MAAM,SAAS;AACtC,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,IAAM,8CAA8C,CAClD,UACG;AAEH,MAAI,MAAM,QAAQ,OAAO;AACvB,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAcO,IAAM,mCAGT;AAAA,EACF,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,uDAAuD;AAAA,EACvD,sCAAsC;AAAA,EACtC,sCAAsC;AACxC;","names":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1 +1,3 @@
1
+ import '../chunk-WADHCMPK.mjs';
2
+ //# sourceMappingURL=out.js.map
1
3
  //# sourceMappingURL=html-copilot-textarea-element.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,329 +1,13 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __async = (__this, __arguments, generator) => {
21
- return new Promise((resolve, reject) => {
22
- var fulfilled = (value) => {
23
- try {
24
- step(generator.next(value));
25
- } catch (e) {
26
- reject(e);
27
- }
28
- };
29
- var rejected = (value) => {
30
- try {
31
- step(generator.throw(value));
32
- } catch (e) {
33
- reject(e);
34
- }
35
- };
36
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
- step((generator = generator.apply(__this, __arguments)).next());
38
- });
39
- };
40
-
41
- // src/types/base/base-autosuggestions-config.tsx
42
- import { defaultCopilotContextCategories } from "@copilotkit/react-core";
43
- var defaultShouldToggleHoveringEditorOnKeyPress = (event) => {
44
- if (event.key === "k" && event.metaKey) {
45
- return true;
46
- }
47
- return false;
48
- };
49
- var defaultShouldAcceptAutosuggestionOnKeyPress = (event) => {
50
- if (event.key === "Tab") {
51
- return true;
52
- }
53
- return false;
54
- };
55
- var defaultBaseAutosuggestionsConfig = {
56
- debounceTime: 250,
57
- contextCategories: defaultCopilotContextCategories,
58
- disableWhenEmpty: true,
59
- disabled: false,
60
- temporarilyDisableWhenMovingCursorWithoutChangingText: true,
61
- shouldToggleHoveringEditorOnKeyPress: defaultShouldToggleHoveringEditorOnKeyPress,
62
- shouldAcceptAutosuggestionOnKeyPress: defaultShouldAcceptAutosuggestionOnKeyPress
63
- };
64
-
65
- // src/types/autosuggestions-config/suggestions-api-config.tsx
66
- var defaultSuggestionsMakeSystemPrompt = (textareaPurpose, contextString) => {
67
- return `You are a versatile writing assistant.
68
-
69
- The user is writing some text.
70
- The purpose is: "${textareaPurpose}"
71
-
72
- Your job is to guess what the user will write next AS BEST YOU CAN.
73
- Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
74
-
75
- Adjust yourself to the user's style and implied intent.
76
-
77
- The 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.
78
- <TextAfterCursor>
79
- <TextBeforeCursor>
80
- <YourSuggestion>
81
-
82
- If we need to add a whitespace character to the suggested text, make sure to explicitly add it in.
83
-
84
- The following external context is also provided. Use it to help you make better suggestions!!!
85
- \`\`\`
86
- ${contextString}
87
- \`\`\`
88
- `;
89
- };
90
- var defaultSuggestionsFewShotMessages = [
91
- {
92
- role: "user",
93
- name: "TextAfterCursor",
94
- content: "While I was there I also picked up some apples, oranges, and bananas."
95
- },
96
- {
97
- role: "user",
98
- content: "This morning I woke up and went straight to the grocery store."
99
- },
100
- {
101
- role: "assistant",
102
- content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
103
- },
104
- {
105
- role: "user",
106
- name: "TextAfterCursor",
107
- content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
108
- },
109
- {
110
- role: "user",
111
- name: "TextBeforeCursor",
112
- content: `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;`
113
- },
114
- {
115
- role: "assistant",
116
- content: ` (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"; `
117
- }
118
- ];
119
- var defaultSuggestionsApiConfig = {
120
- makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,
121
- fewShotMessages: defaultSuggestionsFewShotMessages,
122
- forwardedParams: void 0
123
- };
124
-
125
- // src/types/autosuggestions-config/insertions-api-config.tsx
126
- var defaultInsertionsMakeSystemPrompt = (textareaPurpose, contextString) => {
127
- return `You are a versatile writing assistant.
128
-
129
- The user is writing some text.
130
- The purpose is: "${textareaPurpose}"
131
-
132
- The following external context is also provided. Use it to help you make better suggestions!!!
133
- \`\`\`
134
- ${contextString}
135
- \`\`\`
136
-
137
- The user also provides you with a prompt for INSERTIONS into the text they are writing.
138
- Your job is to come up with an INSERTION into the text that the user would like AS BEST YOU CAN.
139
- Only insert a SHORT segment. Usually 1 sentence, or at most 1 paragraph.
140
-
141
- Adjust yourself to the user's style and implied intent.
142
-
143
- The 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.
144
- <TextAfterCursor>
145
- <TextBeforeCursor>
146
- <InsertionPrompt>
147
- <YourSuggestion>
148
- `;
149
- };
150
- var defaultInsertionsFewShotMessages = [
151
- {
152
- role: "user",
153
- name: "TextAfterCursor",
154
- content: "While I was there I also picked up some apples, oranges, and bananas."
155
- },
156
- {
157
- role: "user",
158
- name: "TextBeforeCursor",
159
- content: "This morning I woke up and went straight to the grocery store."
160
- },
161
- {
162
- role: "user",
163
- name: "InsertionPrompt",
164
- content: "I bought a big watermelon"
165
- },
166
- {
167
- role: "assistant",
168
- content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
169
- },
170
- {
171
- role: "user",
172
- name: "TextAfterCursor",
173
- content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
174
- },
175
- {
176
- role: "user",
177
- name: "TextBeforeCursor",
178
- content: `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;`
179
- },
180
- {
181
- role: "user",
182
- name: "InsertionPrompt",
183
- content: "add section about the optionholder's pro rata share"
184
- },
185
- {
186
- role: "assistant",
187
- content: ` (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"; `
188
- }
189
- ];
190
- var defaultInsertionsApiConfig = {
191
- makeSystemPrompt: defaultInsertionsMakeSystemPrompt,
192
- fewShotMessages: defaultInsertionsFewShotMessages,
193
- forwardedParams: void 0
194
- };
195
-
196
- // src/types/autosuggestions-config/editing-api-config.tsx
197
- var defaultEditingMakeSystemPrompt = (textareaPurpose, contextString) => {
198
- return `You are a versatile writing assistant.
199
-
200
- The user is writing some text.
201
- The purpose is: "${textareaPurpose}"
202
-
203
- The following external context is also provided. Use it to help you make better suggestions!!!
204
- \`\`\`
205
- ${contextString}
206
- \`\`\`
207
-
208
- The user also provides you with a prompt for EDITING some text they are writing.
209
- Your job is to come up with an EDIT of the text that the user would like to use - AS BEST YOU CAN.
210
-
211
- Adjust yourself to the user's style and implied intent.
212
-
213
- The user will provide the following information; use this to infer the best relevant EDIT:
214
- <TextBeforeCursor>
215
- <TextToEdit>
216
- <TextAfterCursor>
217
- <EditingPrompt>
218
-
219
- <YourEditSuggestion>
220
- `;
221
- };
222
- var defaultEditingFewShotMessages = [
223
- {
224
- role: "user",
225
- name: "TextBeforeCursor",
226
- content: "This morning I woke up and went straight to the grocery store. "
227
- },
228
- {
229
- role: "user",
230
- name: "TextToEdit",
231
- content: "While I was there I also picked up some apples, oranges, and bananas. "
232
- },
233
- {
234
- role: "user",
235
- name: "TextAfterCursor",
236
- content: "The grocery store was having a sale on fruit, so I decided to stock up."
237
- },
238
- {
239
- role: "user",
240
- name: "EditingPrompt",
241
- content: "I bought a big watermelon"
242
- },
243
- {
244
- role: "assistant",
245
- content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
246
- },
247
- {
248
- role: "user",
249
- name: "TextAfterCursor",
250
- content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
251
- },
252
- {
253
- role: "user",
254
- name: "TextBeforeCursor",
255
- content: `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;`
256
- },
257
- {
258
- role: "user",
259
- name: "InsertionPrompt",
260
- content: "add section about the optionholder's pro rata share"
261
- },
262
- {
263
- role: "assistant",
264
- content: ` (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"; `
265
- }
266
- ];
267
- var defaultEditingApiConfig = {
268
- makeSystemPrompt: defaultEditingMakeSystemPrompt,
269
- fewShotMessages: defaultEditingFewShotMessages,
270
- forwardedParams: void 0
271
- };
272
-
273
- // src/types/autosuggestions-config/autosuggestions-config.tsx
274
- import { defaultCopilotContextCategories as defaultCopilotContextCategories2 } from "@copilotkit/react-core";
275
- var defaultAutosuggestionsConfig = __spreadProps(__spreadValues({}, defaultBaseAutosuggestionsConfig), {
276
- contextCategories: defaultCopilotContextCategories2,
277
- chatApiConfigs: {
278
- suggestionsApiConfig: defaultSuggestionsApiConfig,
279
- insertionApiConfig: defaultInsertionsApiConfig,
280
- editingApiConfig: defaultEditingApiConfig
281
- }
282
- });
283
-
284
- // src/types/autosuggestions-config/subtypes/chatlike-api-endpoint.tsx
285
- import { copilotApiConfigExtrapolator } from "@copilotkit/react-core";
286
- var ChatlikeApiEndpoint = class {
287
- constructor(run) {
288
- this.run = run;
289
- }
290
- /**
291
- * Creates a new instance of ChatlikeApiEndpoint with the provided API endpoint.
292
- * @param apiEndpoint The URL of the OpenAI-compatible API endpoint.
293
- * @returns A new instance of ChatlikeApiEndpoint.
294
- */
295
- static fromCopilotApiConfig(copilotApiConfig) {
296
- return new ChatlikeApiEndpoint(
297
- (abortSignal, messages, forwardedProps) => __async(this, null, function* () {
298
- const res = yield fetch(copilotApiConfigExtrapolator(copilotApiConfig).chatApiEndpoint, {
299
- method: "POST",
300
- headers: __spreadValues({}, copilotApiConfig.headers),
301
- body: JSON.stringify(__spreadProps(__spreadValues(__spreadValues({}, forwardedProps), copilotApiConfig.body), {
302
- messages
303
- })),
304
- signal: abortSignal
305
- });
306
- const bodySteram = res.body;
307
- if (!bodySteram) {
308
- throw new Error("The response body is empty.");
309
- }
310
- const stringStream = bodySteram.pipeThrough(new TextDecoderStream());
311
- return stringStream;
312
- })
313
- );
314
- }
315
- /**
316
- * Creates a fully customized instance of ChatlikeApiEndpoint.
317
- * @param run - The implementation of the ChatlikeApiEndpointImpl interface.
318
- * @returns A new instance of ChatlikeApiEndpoint .
319
- */
320
- static custom(run) {
321
- return new ChatlikeApiEndpoint(run);
322
- }
323
- };
324
- export {
325
- ChatlikeApiEndpoint,
326
- defaultAutosuggestionsConfig,
327
- defaultBaseAutosuggestionsConfig
328
- };
1
+ import '../chunk-DE5K76I2.mjs';
2
+ import '../chunk-5FO6ISW4.mjs';
3
+ export { ChatlikeApiEndpoint } from '../chunk-QDFAIRQF.mjs';
4
+ export { defaultAutosuggestionsConfig } from '../chunk-NTLVQENP.mjs';
5
+ import '../chunk-K5LNB36H.mjs';
6
+ import '../chunk-RBR32FWA.mjs';
7
+ import '../chunk-KDVMG3XF.mjs';
8
+ import '../chunk-WJHSY5T6.mjs';
9
+ export { defaultBaseAutosuggestionsConfig } from '../chunk-FP2EKU3L.mjs';
10
+ import '../chunk-WADHCMPK.mjs';
11
+ import '../chunk-MRXNTQOX.mjs';
12
+ //# sourceMappingURL=out.js.map
329
13
  //# sourceMappingURL=index.mjs.map