@copilotkit/react-textarea 0.19.0-alpha.9 → 0.19.0

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 (219) hide show
  1. package/.turbo/turbo-build.log +298 -298
  2. package/CHANGELOG.md +28 -0
  3. package/dist/chunk-2NURR2DX.mjs +47 -0
  4. package/dist/chunk-2NURR2DX.mjs.map +1 -0
  5. package/dist/chunk-3TK2VELX.mjs +202 -0
  6. package/dist/chunk-3TK2VELX.mjs.map +1 -0
  7. package/dist/chunk-47JRPWI3.mjs +257 -0
  8. package/dist/chunk-47JRPWI3.mjs.map +1 -0
  9. package/dist/chunk-4S5ZJH3I.mjs +18 -0
  10. package/dist/chunk-4S5ZJH3I.mjs.map +1 -0
  11. package/dist/chunk-5EJ5XOGP.mjs +22 -0
  12. package/dist/chunk-5EJ5XOGP.mjs.map +1 -0
  13. package/dist/chunk-5FO6ISW4.mjs +3 -0
  14. package/dist/chunk-5FO6ISW4.mjs.map +1 -0
  15. package/dist/chunk-66BDXIX4.mjs +76 -0
  16. package/dist/chunk-66BDXIX4.mjs.map +1 -0
  17. package/dist/chunk-7QWJ3OV7.mjs +108 -0
  18. package/dist/chunk-7QWJ3OV7.mjs.map +1 -0
  19. package/dist/chunk-BBKDE7YT.mjs +19 -0
  20. package/dist/chunk-BBKDE7YT.mjs.map +1 -0
  21. package/dist/chunk-CSGFJU3L.mjs +65 -0
  22. package/dist/chunk-CSGFJU3L.mjs.map +1 -0
  23. package/dist/chunk-DE5K76I2.mjs +3 -0
  24. package/dist/chunk-DE5K76I2.mjs.map +1 -0
  25. package/dist/chunk-F3MHL6ZY.mjs +25 -0
  26. package/dist/chunk-F3MHL6ZY.mjs.map +1 -0
  27. package/dist/chunk-FN7GDKKG.mjs +29 -0
  28. package/dist/chunk-FN7GDKKG.mjs.map +1 -0
  29. package/dist/chunk-H4VKQGVU.mjs +3 -0
  30. package/dist/chunk-H4VKQGVU.mjs.map +1 -0
  31. package/dist/chunk-HRTFMM7P.mjs +82 -0
  32. package/dist/chunk-HRTFMM7P.mjs.map +1 -0
  33. package/dist/chunk-IU3WTXLQ.mjs +3 -0
  34. package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
  35. package/dist/chunk-IXJ2HCOA.mjs +101 -0
  36. package/dist/chunk-IXJ2HCOA.mjs.map +1 -0
  37. package/dist/chunk-JAFCXEPU.mjs +10 -0
  38. package/dist/chunk-JAFCXEPU.mjs.map +1 -0
  39. package/dist/chunk-JHTAOLEW.mjs +63 -0
  40. package/dist/chunk-JHTAOLEW.mjs.map +1 -0
  41. package/dist/chunk-K2AVA67P.mjs +57 -0
  42. package/dist/chunk-K2AVA67P.mjs.map +1 -0
  43. package/dist/chunk-KCHYD3EB.mjs +107 -0
  44. package/dist/chunk-KCHYD3EB.mjs.map +1 -0
  45. package/dist/chunk-KGKLUWKW.mjs +47 -0
  46. package/dist/chunk-KGKLUWKW.mjs.map +1 -0
  47. package/dist/chunk-KIRROE2K.mjs +37 -0
  48. package/dist/chunk-KIRROE2K.mjs.map +1 -0
  49. package/dist/chunk-L6DZHWEL.mjs +76 -0
  50. package/dist/chunk-L6DZHWEL.mjs.map +1 -0
  51. package/dist/chunk-L7VVZH4Q.mjs +3 -0
  52. package/dist/chunk-L7VVZH4Q.mjs.map +1 -0
  53. package/dist/chunk-LNAIMEB2.mjs +34 -0
  54. package/dist/chunk-LNAIMEB2.mjs.map +1 -0
  55. package/dist/chunk-MMVDU6DF.mjs +3 -0
  56. package/dist/chunk-MMVDU6DF.mjs.map +1 -0
  57. package/dist/chunk-MPME5BW2.mjs +59 -0
  58. package/dist/chunk-MPME5BW2.mjs.map +1 -0
  59. package/dist/chunk-MRXNTQOX.mjs +55 -0
  60. package/dist/chunk-MRXNTQOX.mjs.map +1 -0
  61. package/dist/chunk-ND5PXTAW.mjs +17 -0
  62. package/dist/chunk-ND5PXTAW.mjs.map +1 -0
  63. package/dist/chunk-NKW5OU2S.mjs +33 -0
  64. package/dist/chunk-NKW5OU2S.mjs.map +1 -0
  65. package/dist/chunk-O5OWT5GE.mjs +114 -0
  66. package/dist/chunk-O5OWT5GE.mjs.map +1 -0
  67. package/dist/chunk-OD7ZMOVE.mjs +45 -0
  68. package/dist/chunk-OD7ZMOVE.mjs.map +1 -0
  69. package/dist/chunk-OELUUJZY.mjs +16 -0
  70. package/dist/chunk-OELUUJZY.mjs.map +1 -0
  71. package/dist/chunk-OXPXFYUG.mjs +111 -0
  72. package/dist/chunk-OXPXFYUG.mjs.map +1 -0
  73. package/dist/chunk-QNJ6MXJ2.mjs +21 -0
  74. package/dist/chunk-QNJ6MXJ2.mjs.map +1 -0
  75. package/dist/chunk-RDHPSSHJ.mjs +44 -0
  76. package/dist/chunk-RDHPSSHJ.mjs.map +1 -0
  77. package/dist/chunk-RQHOUUXQ.mjs +29 -0
  78. package/dist/chunk-RQHOUUXQ.mjs.map +1 -0
  79. package/dist/chunk-S6JUGJK2.mjs +13 -0
  80. package/dist/chunk-S6JUGJK2.mjs.map +1 -0
  81. package/dist/chunk-UHD44NC5.mjs +101 -0
  82. package/dist/chunk-UHD44NC5.mjs.map +1 -0
  83. package/dist/chunk-WADHCMPK.mjs +3 -0
  84. package/dist/chunk-WADHCMPK.mjs.map +1 -0
  85. package/dist/chunk-WJHSY5T6.mjs +3 -0
  86. package/dist/chunk-WJHSY5T6.mjs.map +1 -0
  87. package/dist/chunk-WJYQWL4I.mjs +27 -0
  88. package/dist/chunk-WJYQWL4I.mjs.map +1 -0
  89. package/dist/chunk-XA7M72ZO.mjs +106 -0
  90. package/dist/chunk-XA7M72ZO.mjs.map +1 -0
  91. package/dist/chunk-XHUMROEY.mjs +91 -0
  92. package/dist/chunk-XHUMROEY.mjs.map +1 -0
  93. package/dist/chunk-YQU7WG7T.mjs +83 -0
  94. package/dist/chunk-YQU7WG7T.mjs.map +1 -0
  95. package/dist/chunk-YTOPHPSG.mjs +45 -0
  96. package/dist/chunk-YTOPHPSG.mjs.map +1 -0
  97. package/dist/chunk-YW3REYX6.mjs +23 -0
  98. package/dist/chunk-YW3REYX6.mjs.map +1 -0
  99. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +34 -1734
  100. package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs.map +1 -1
  101. package/dist/components/base-copilot-textarea/render-element.mjs +3 -52
  102. package/dist/components/base-copilot-textarea/render-element.mjs.map +1 -1
  103. package/dist/components/base-copilot-textarea/render-placeholder.mjs +3 -46
  104. package/dist/components/base-copilot-textarea/render-placeholder.mjs.map +1 -1
  105. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs +4 -86
  106. package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs.map +1 -1
  107. package/dist/components/base-copilot-textarea/use-add-branding-css.mjs +3 -57
  108. package/dist/components/base-copilot-textarea/use-add-branding-css.mjs.map +1 -1
  109. package/dist/components/copilot-textarea/copilot-textarea.mjs +46 -2202
  110. package/dist/components/copilot-textarea/copilot-textarea.mjs.map +1 -1
  111. package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +3 -22
  112. package/dist/components/hovering-toolbar/hovering-editor-provider.mjs.map +1 -1
  113. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +3 -125
  114. package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs.map +1 -1
  115. package/dist/components/hovering-toolbar/hovering-toolbar.mjs +17 -877
  116. package/dist/components/hovering-toolbar/hovering-toolbar.mjs.map +1 -1
  117. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +11 -577
  118. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs.map +1 -1
  119. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +12 -592
  120. package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs.map +1 -1
  121. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +13 -592
  122. package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs.map +1 -1
  123. package/dist/components/index.mjs +47 -2203
  124. package/dist/components/index.mjs.map +1 -1
  125. package/dist/components/manual-ui/chip-with-icon.mjs +6 -5
  126. package/dist/components/manual-ui/chip-with-icon.mjs.map +1 -1
  127. package/dist/components/source-search-box/source-search-box.mjs +6 -209
  128. package/dist/components/source-search-box/source-search-box.mjs.map +1 -1
  129. package/dist/components/ui/button.mjs +4 -88
  130. package/dist/components/ui/button.mjs.map +1 -1
  131. package/dist/components/ui/card.mjs +7 -53
  132. package/dist/components/ui/card.mjs.map +1 -1
  133. package/dist/components/ui/command.mjs +5 -266
  134. package/dist/components/ui/command.mjs.map +1 -1
  135. package/dist/components/ui/dialog.mjs +4 -164
  136. package/dist/components/ui/dialog.mjs.map +1 -1
  137. package/dist/components/ui/label.mjs +4 -63
  138. package/dist/components/ui/label.mjs.map +1 -1
  139. package/dist/components/ui/separator.mjs +8 -50
  140. package/dist/components/ui/separator.mjs.map +1 -1
  141. package/dist/components/ui/textarea.mjs +7 -48
  142. package/dist/components/ui/textarea.mjs.map +1 -1
  143. package/dist/context/index.mjs +2 -0
  144. package/dist/context/index.mjs.map +1 -1
  145. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +6 -168
  146. package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs.map +1 -1
  147. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs +4 -168
  148. package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs.map +1 -1
  149. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs +5 -155
  150. package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map +1 -1
  151. package/dist/hooks/index.mjs +2 -0
  152. package/dist/hooks/index.mjs.map +1 -1
  153. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +14 -145
  154. package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs.map +1 -1
  155. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +14 -199
  156. package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs.map +1 -1
  157. package/dist/hooks/misc/use-autosize-textarea.mjs +3 -15
  158. package/dist/hooks/misc/use-autosize-textarea.mjs.map +1 -1
  159. package/dist/index.mjs +49 -2206
  160. package/dist/index.mjs.map +1 -1
  161. package/dist/lib/debouncer.mjs +3 -51
  162. package/dist/lib/debouncer.mjs.map +1 -1
  163. package/dist/lib/editor-to-text.mjs +3 -43
  164. package/dist/lib/editor-to-text.mjs.map +1 -1
  165. package/dist/lib/get-text-around-cursor.mjs +3 -109
  166. package/dist/lib/get-text-around-cursor.mjs.map +1 -1
  167. package/dist/lib/retry.mjs +3 -17
  168. package/dist/lib/retry.mjs.map +1 -1
  169. package/dist/lib/slatejs-edits/add-autocompletions.mjs +3 -25
  170. package/dist/lib/slatejs-edits/add-autocompletions.mjs.map +1 -1
  171. package/dist/lib/slatejs-edits/clear-autocompletions.mjs +3 -23
  172. package/dist/lib/slatejs-edits/clear-autocompletions.mjs.map +1 -1
  173. package/dist/lib/slatejs-edits/replace-text.mjs +3 -27
  174. package/dist/lib/slatejs-edits/replace-text.mjs.map +1 -1
  175. package/dist/lib/slatejs-edits/with-partial-history.mjs +3 -106
  176. package/dist/lib/slatejs-edits/with-partial-history.mjs.map +1 -1
  177. package/dist/lib/stream-promise-flatten.mjs +3 -47
  178. package/dist/lib/stream-promise-flatten.mjs.map +1 -1
  179. package/dist/lib/utils.mjs +3 -71
  180. package/dist/lib/utils.mjs.map +1 -1
  181. package/dist/lib/utils.test.mjs +1 -0
  182. package/dist/lib/utils.test.mjs.map +1 -1
  183. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs +2 -0
  184. package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs.map +1 -1
  185. package/dist/types/autosuggestions-config/autosuggestions-config.mjs +8 -254
  186. package/dist/types/autosuggestions-config/autosuggestions-config.mjs.map +1 -1
  187. package/dist/types/autosuggestions-config/editing-api-config.mjs +3 -83
  188. package/dist/types/autosuggestions-config/editing-api-config.mjs.map +1 -1
  189. package/dist/types/autosuggestions-config/index.mjs +10 -310
  190. package/dist/types/autosuggestions-config/index.mjs.map +1 -1
  191. package/dist/types/autosuggestions-config/insertions-api-config.mjs +3 -77
  192. package/dist/types/autosuggestions-config/insertions-api-config.mjs.map +1 -1
  193. package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs +3 -77
  194. package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs.map +1 -1
  195. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs +2 -0
  196. package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs.map +1 -1
  197. package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.mjs +2 -0
  198. package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.mjs.map +1 -1
  199. package/dist/types/autosuggestions-config/suggestions-api-config.mjs +3 -64
  200. package/dist/types/autosuggestions-config/suggestions-api-config.mjs.map +1 -1
  201. package/dist/types/base/autosuggestion-state.mjs +2 -0
  202. package/dist/types/base/autosuggestion-state.mjs.map +1 -1
  203. package/dist/types/base/autosuggestions-bare-function.mjs +2 -0
  204. package/dist/types/base/autosuggestions-bare-function.mjs.map +1 -1
  205. package/dist/types/base/base-autosuggestions-config.mjs +3 -12
  206. package/dist/types/base/base-autosuggestions-config.mjs.map +1 -1
  207. package/dist/types/base/base-copilot-textarea-props.mjs +2 -0
  208. package/dist/types/base/base-copilot-textarea-props.mjs.map +1 -1
  209. package/dist/types/base/custom-editor.mjs +2 -0
  210. package/dist/types/base/custom-editor.mjs.map +1 -1
  211. package/dist/types/base/editor-autocomplete-state.mjs +4 -17
  212. package/dist/types/base/editor-autocomplete-state.mjs.map +1 -1
  213. package/dist/types/base/index.mjs +4 -12
  214. package/dist/types/base/index.mjs.map +1 -1
  215. package/dist/types/html-copilot-textarea-element.mjs +2 -0
  216. package/dist/types/html-copilot-textarea-element.mjs.map +1 -1
  217. package/dist/types/index.mjs +12 -311
  218. package/dist/types/index.mjs.map +1 -1
  219. package/package.json +4 -4
@@ -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,13 +1,4 @@
1
- // src/types/base/base-autosuggestions-config.tsx
2
- var defaultBaseAutosuggestionsConfig = {
3
- debounceTime: 250,
4
- contextCategories: ["global"],
5
- acceptAutosuggestionKey: "Tab",
6
- disableWhenEmpty: true,
7
- disabled: false,
8
- temporarilyDisableWhenMovingCursorWithoutChangingText: true
9
- };
10
- export {
11
- defaultBaseAutosuggestionsConfig
12
- };
1
+ export { defaultBaseAutosuggestionsConfig } from '../../chunk-S6JUGJK2.mjs';
2
+ import '../../chunk-MRXNTQOX.mjs';
3
+ //# sourceMappingURL=out.js.map
13
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\";\n\nexport interface BaseAutosuggestionsConfig {\n textareaPurpose: string;\n contextCategories: string[];\n debounceTime: number;\n acceptAutosuggestionKey: string;\n disableWhenEmpty: boolean;\n disabled: boolean;\n temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;\n apiConfig: BaseCopilotTextareaApiConfig;\n}\n\nexport const defaultBaseAutosuggestionsConfig: Omit<\n BaseAutosuggestionsConfig,\n \"textareaPurpose\" | \"apiConfig\"\n> = {\n debounceTime: 250,\n contextCategories: [\"global\"],\n acceptAutosuggestionKey: \"Tab\",\n disableWhenEmpty: true,\n disabled: false,\n temporarilyDisableWhenMovingCursorWithoutChangingText: true,\n};\n"],"mappings":";AAaO,IAAM,mCAGT;AAAA,EACF,cAAc;AAAA,EACd,mBAAmB,CAAC,QAAQ;AAAA,EAC5B,yBAAyB;AAAA,EACzB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,uDAAuD;AACzD;","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-JAFCXEPU.mjs';
2
+ import '../../chunk-KGKLUWKW.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>(\n input: RequestInfo,\n init?: RequestInit\n): 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 &&\n 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;AAiCO,IAAM,iBAAiB,CAAC,MAAgB,SAC7C,KAAK,WAAW,KAAK,UACrB,KAAK,MAAM,CAAC,OAAO,UAAU,UAAU,KAAK,MAAM;;;ACrC7C,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,13 +1,5 @@
1
- // src/types/base/base-autosuggestions-config.tsx
2
- var defaultBaseAutosuggestionsConfig = {
3
- debounceTime: 250,
4
- contextCategories: ["global"],
5
- acceptAutosuggestionKey: "Tab",
6
- disableWhenEmpty: true,
7
- disabled: false,
8
- temporarilyDisableWhenMovingCursorWithoutChangingText: true
9
- };
10
- export {
11
- defaultBaseAutosuggestionsConfig
12
- };
1
+ import '../../chunk-WJHSY5T6.mjs';
2
+ export { defaultBaseAutosuggestionsConfig } from '../../chunk-S6JUGJK2.mjs';
3
+ import '../../chunk-MRXNTQOX.mjs';
4
+ //# sourceMappingURL=out.js.map
13
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\";\n\nexport interface BaseAutosuggestionsConfig {\n textareaPurpose: string;\n contextCategories: string[];\n debounceTime: number;\n acceptAutosuggestionKey: string;\n disableWhenEmpty: boolean;\n disabled: boolean;\n temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;\n apiConfig: BaseCopilotTextareaApiConfig;\n}\n\nexport const defaultBaseAutosuggestionsConfig: Omit<\n BaseAutosuggestionsConfig,\n \"textareaPurpose\" | \"apiConfig\"\n> = {\n debounceTime: 250,\n contextCategories: [\"global\"],\n acceptAutosuggestionKey: \"Tab\",\n disableWhenEmpty: true,\n disabled: false,\n temporarilyDisableWhenMovingCursorWithoutChangingText: true,\n};\n"],"mappings":";AAaO,IAAM,mCAGT;AAAA,EACF,cAAc;AAAA,EACd,mBAAmB,CAAC,QAAQ;AAAA,EAC5B,yBAAyB;AAAA,EACzB,kBAAkB;AAAA,EAClB,UAAU;AAAA,EACV,uDAAuD;AACzD;","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,312 +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
- var defaultBaseAutosuggestionsConfig = {
43
- debounceTime: 250,
44
- contextCategories: ["global"],
45
- acceptAutosuggestionKey: "Tab",
46
- disableWhenEmpty: true,
47
- disabled: false,
48
- temporarilyDisableWhenMovingCursorWithoutChangingText: true
49
- };
50
-
51
- // src/types/autosuggestions-config/suggestions-api-config.tsx
52
- var defaultSuggestionsMakeSystemPrompt = (textareaPurpose, contextString) => {
53
- return `You are a versatile writing assistant.
54
-
55
- The user is writing some text.
56
- The purpose is: "${textareaPurpose}"
57
-
58
- Your job is to guess what the user will write next AS BEST YOU CAN.
59
- Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
60
-
61
- Adjust yourself to the user's style and implied intent.
62
-
63
- 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.
64
- <TextAfterCursor>
65
- <TextBeforeCursor>
66
- <YourSuggestion>
67
-
68
- If we need to add a whitespace character to the suggested text, make sure to explicitly add it in.
69
-
70
- The following external context is also provided. Use it to help you make better suggestions!!!
71
- \`\`\`
72
- ${contextString}
73
- \`\`\`
74
- `;
75
- };
76
- var defaultSuggestionsFewShotMessages = [
77
- {
78
- role: "user",
79
- name: "TextAfterCursor",
80
- content: "While I was there I also picked up some apples, oranges, and bananas."
81
- },
82
- {
83
- role: "user",
84
- content: "This morning I woke up and went straight to the grocery store."
85
- },
86
- {
87
- role: "assistant",
88
- content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
89
- },
90
- {
91
- role: "user",
92
- name: "TextAfterCursor",
93
- content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
94
- },
95
- {
96
- role: "user",
97
- name: "TextBeforeCursor",
98
- 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;`
99
- },
100
- {
101
- role: "assistant",
102
- 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"; `
103
- }
104
- ];
105
- var defaultSuggestionsApiConfig = {
106
- makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,
107
- fewShotMessages: defaultSuggestionsFewShotMessages,
108
- forwardedParams: void 0
109
- };
110
-
111
- // src/types/autosuggestions-config/insertions-api-config.tsx
112
- var defaultInsertionsMakeSystemPrompt = (textareaPurpose, contextString) => {
113
- return `You are a versatile writing assistant.
114
-
115
- The user is writing some text.
116
- The purpose is: "${textareaPurpose}"
117
-
118
- The user also provides you with a prompt for INSERTIONS into the text they are writing.
119
- Your job is to come up with an INSERTION into the text that the user would like AS BEST YOU CAN.
120
- Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
121
-
122
- Adjust yourself to the user's style and implied intent.
123
-
124
- 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.
125
- <TextAfterCursor>
126
- <TextBeforeCursor>
127
- <InsertionPrompt>
128
- <YourSuggestion>
129
-
130
- If we need to add a whitespace character to the suggested text, make sure to explicitly add it in.
131
-
132
- The following external context is also provided. Use it to help you make better suggestions!!!
133
- \`\`\`
134
- ${contextString}
135
- \`\`\`
136
- `;
137
- };
138
- var defaultInsertionsFewShotMessages = [
139
- {
140
- role: "user",
141
- name: "TextAfterCursor",
142
- content: "While I was there I also picked up some apples, oranges, and bananas."
143
- },
144
- {
145
- role: "user",
146
- name: "TextBeforeCursor",
147
- content: "This morning I woke up and went straight to the grocery store."
148
- },
149
- {
150
- role: "user",
151
- name: "InsertionPrompt",
152
- content: "I bought a big watermelon"
153
- },
154
- {
155
- role: "assistant",
156
- content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
157
- },
158
- {
159
- role: "user",
160
- name: "TextAfterCursor",
161
- content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
162
- },
163
- {
164
- role: "user",
165
- name: "TextBeforeCursor",
166
- 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;`
167
- },
168
- {
169
- role: "user",
170
- name: "InsertionPrompt",
171
- content: "add section about the optionholder's pro rata share"
172
- },
173
- {
174
- role: "assistant",
175
- 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"; `
176
- }
177
- ];
178
- var defaultInsertionsApiConfig = {
179
- makeSystemPrompt: defaultInsertionsMakeSystemPrompt,
180
- fewShotMessages: defaultInsertionsFewShotMessages,
181
- forwardedParams: void 0
182
- };
183
-
184
- // src/types/autosuggestions-config/editing-api-config.tsx
185
- var defaultEditingMakeSystemPrompt = (textareaPurpose, contextString) => {
186
- return `You are a versatile writing assistant.
187
-
188
- The user is writing some text.
189
- The purpose is: "${textareaPurpose}"
190
-
191
- The user also provides you with a prompt for EDITING some text they are writing.
192
- Your job is to come up with an EDIT of the text that the user would like to use - AS BEST YOU CAN.
193
-
194
- Adjust yourself to the user's style and implied intent.
195
-
196
- The user will provide the following information; use this to infer the best relevant EDIT:
197
- <TextBeforeCursor>
198
- <TextToEdit>
199
- <TextAfterCursor>
200
- <EditingPrompt>
201
-
202
- <YourEditSuggestion>
203
-
204
- If we need to add a whitespace character to the suggested edit text, make sure to explicitly add it in.
205
-
206
- The following external context is also provided. Use it to help you make better suggestions!!!
207
- \`\`\`
208
- ${contextString}
209
- \`\`\`
210
- `;
211
- };
212
- var defaultEditingFewShotMessages = [
213
- {
214
- role: "user",
215
- name: "TextBeforeCursor",
216
- content: "This morning I woke up and went straight to the grocery store. "
217
- },
218
- {
219
- role: "user",
220
- name: "TextToEdit",
221
- content: "While I was there I also picked up some apples, oranges, and bananas. "
222
- },
223
- {
224
- role: "user",
225
- name: "TextAfterCursor",
226
- content: "The grocery store was having a sale on fruit, so I decided to stock up."
227
- },
228
- {
229
- role: "user",
230
- name: "EditingPrompt",
231
- content: "I bought a big watermelon"
232
- },
233
- {
234
- role: "assistant",
235
- content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
236
- },
237
- {
238
- role: "user",
239
- name: "TextAfterCursor",
240
- content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
241
- },
242
- {
243
- role: "user",
244
- name: "TextBeforeCursor",
245
- 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;`
246
- },
247
- {
248
- role: "user",
249
- name: "InsertionPrompt",
250
- content: "add section about the optionholder's pro rata share"
251
- },
252
- {
253
- role: "assistant",
254
- 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"; `
255
- }
256
- ];
257
- var defaultEditingApiConfig = {
258
- makeSystemPrompt: defaultEditingMakeSystemPrompt,
259
- fewShotMessages: defaultEditingFewShotMessages,
260
- forwardedParams: void 0
261
- };
262
-
263
- // src/types/autosuggestions-config/autosuggestions-config.tsx
264
- var defaultAutosuggestionsConfig = __spreadProps(__spreadValues({}, defaultBaseAutosuggestionsConfig), {
265
- externalContextCategories: void 0,
266
- chatApiConfigs: {
267
- suggestionsApiConfig: defaultSuggestionsApiConfig,
268
- insertionApiConfig: defaultInsertionsApiConfig,
269
- editingApiConfig: defaultEditingApiConfig
270
- }
271
- });
272
-
273
- // src/types/autosuggestions-config/subtypes/chatlike-api-endpoint.tsx
274
- import {
275
- copilotApiConfigExtrapolator
276
- } from "@copilotkit/react-core";
277
- var ChatlikeApiEndpoint = class {
278
- constructor(run) {
279
- this.run = run;
280
- }
281
- static fromCopilotApiConfig(copilotApiConfig) {
282
- return new ChatlikeApiEndpoint(
283
- (abortSignal, messages, forwardedProps) => __async(this, null, function* () {
284
- const res = yield fetch(
285
- copilotApiConfigExtrapolator(copilotApiConfig).chatApiEndpoint,
286
- {
287
- method: "POST",
288
- body: JSON.stringify(__spreadProps(__spreadValues({}, forwardedProps), {
289
- messages
290
- })),
291
- signal: abortSignal
292
- }
293
- );
294
- const bodySteram = res.body;
295
- if (!bodySteram) {
296
- throw new Error("The response body is empty.");
297
- }
298
- const stringStream = bodySteram.pipeThrough(new TextDecoderStream());
299
- return stringStream;
300
- })
301
- );
302
- }
303
- static custom(run) {
304
- return new ChatlikeApiEndpoint(run);
305
- }
306
- };
307
- export {
308
- ChatlikeApiEndpoint,
309
- defaultAutosuggestionsConfig,
310
- defaultBaseAutosuggestionsConfig
311
- };
1
+ import '../chunk-DE5K76I2.mjs';
2
+ import '../chunk-5FO6ISW4.mjs';
3
+ export { ChatlikeApiEndpoint } from '../chunk-KIRROE2K.mjs';
4
+ export { defaultAutosuggestionsConfig } from '../chunk-BBKDE7YT.mjs';
5
+ import '../chunk-HRTFMM7P.mjs';
6
+ import '../chunk-66BDXIX4.mjs';
7
+ import '../chunk-JHTAOLEW.mjs';
8
+ import '../chunk-WADHCMPK.mjs';
9
+ import '../chunk-WJHSY5T6.mjs';
10
+ export { defaultBaseAutosuggestionsConfig } from '../chunk-S6JUGJK2.mjs';
11
+ import '../chunk-MRXNTQOX.mjs';
12
+ //# sourceMappingURL=out.js.map
312
13
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/types/base/base-autosuggestions-config.tsx","../../src/types/autosuggestions-config/suggestions-api-config.tsx","../../src/types/autosuggestions-config/insertions-api-config.tsx","../../src/types/autosuggestions-config/editing-api-config.tsx","../../src/types/autosuggestions-config/autosuggestions-config.tsx","../../src/types/autosuggestions-config/subtypes/chatlike-api-endpoint.tsx"],"sourcesContent":["import { BaseCopilotTextareaApiConfig } from \"./autosuggestions-bare-function\";\n\nexport interface BaseAutosuggestionsConfig {\n textareaPurpose: string;\n contextCategories: string[];\n debounceTime: number;\n acceptAutosuggestionKey: string;\n disableWhenEmpty: boolean;\n disabled: boolean;\n temporarilyDisableWhenMovingCursorWithoutChangingText: boolean;\n apiConfig: BaseCopilotTextareaApiConfig;\n}\n\nexport const defaultBaseAutosuggestionsConfig: Omit<\n BaseAutosuggestionsConfig,\n \"textareaPurpose\" | \"apiConfig\"\n> = {\n debounceTime: 250,\n contextCategories: [\"global\"],\n acceptAutosuggestionKey: \"Tab\",\n disableWhenEmpty: true,\n disabled: false,\n temporarilyDisableWhenMovingCursorWithoutChangingText: true,\n};\n","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:\n \"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","import { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\nimport { MinimalChatGPTMessage } from \"./subtypes/minimal-chat-gpt-message\";\n\nexport interface InsertionsApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: MinimalChatGPTMessage[];\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.\n \nThe user is writing some text.\nThe purpose is: \\\"${textareaPurpose}\\\"\n\nThe user also provides you with a prompt for INSERTIONS into the text they are writing. \nYour job is to come up with an INSERTION into the text that the user would like 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 the text before and after the cursor, as well as the insertion prompt. You should use this to infer the best relevant insertion.\n<TextAfterCursor>\n<TextBeforeCursor>\n<InsertionPrompt>\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 defaultInsertionsFewShotMessages: MinimalChatGPTMessage[] = [\n {\n role: \"user\",\n name: \"TextAfterCursor\",\n content:\n \"While I was there I also picked up some apples, oranges, and bananas.\",\n },\n {\n role: \"user\",\n name: \"TextBeforeCursor\",\n content: \"This morning I woke up and went straight to the grocery store.\",\n },\n {\n role: \"user\",\n name: \"InsertionPrompt\",\n content: \"I bought a big watermelon\",\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: \"user\",\n name: \"InsertionPrompt\",\n content: \"add section about the optionholder's pro rata share\",\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 defaultInsertionsApiConfig: InsertionsApiConfig = {\n makeSystemPrompt: defaultInsertionsMakeSystemPrompt,\n fewShotMessages: defaultInsertionsFewShotMessages,\n forwardedParams: undefined,\n};\n","import { MakeSystemPrompt } from \"./subtypes/make-system-prompt\";\nimport { MinimalChatGPTMessage } from \"./subtypes/minimal-chat-gpt-message\";\n\nexport interface EditingApiConfig {\n makeSystemPrompt: MakeSystemPrompt;\n fewShotMessages: MinimalChatGPTMessage[];\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.\n \nThe user is writing some text.\nThe purpose is: \\\"${textareaPurpose}\\\"\n\nThe user also provides you with a prompt for EDITING some text they are writing. \nYour job is to come up with an EDIT of the text that the user would like to use - AS BEST YOU CAN.\n\nAdjust yourself to the user's style and implied intent.\n\nThe user will provide the following information; use this to infer the best relevant EDIT:\n<TextBeforeCursor>\n<TextToEdit>\n<TextAfterCursor>\n<EditingPrompt>\n\n<YourEditSuggestion>\n\nIf we need to add a whitespace character to the suggested edit 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 defaultEditingFewShotMessages: MinimalChatGPTMessage[] = [\n {\n role: \"user\",\n name: \"TextBeforeCursor\",\n content: \"This morning I woke up and went straight to the grocery store. \",\n },\n {\n role: \"user\",\n name: \"TextToEdit\",\n content:\n \"While I was there I also picked up some apples, oranges, and bananas. \",\n },\n {\n role: \"user\",\n name: \"TextAfterCursor\",\n content:\n \"The grocery store was having a sale on fruit, so I decided to stock up.\",\n },\n {\n role: \"user\",\n name: \"EditingPrompt\",\n content: \"I bought a big watermelon\",\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: \"user\",\n name: \"InsertionPrompt\",\n content: \"add section about the optionholder's pro rata share\",\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 defaultEditingApiConfig: EditingApiConfig = {\n makeSystemPrompt: defaultEditingMakeSystemPrompt,\n fewShotMessages: defaultEditingFewShotMessages,\n forwardedParams: undefined,\n};\n","import {\n BaseAutosuggestionsConfig,\n defaultBaseAutosuggestionsConfig,\n} from \"../base\";\nimport {\n SuggestionsApiConfig,\n defaultSuggestionsApiConfig,\n} from \"./suggestions-api-config\";\nimport {\n InsertionsApiConfig,\n defaultInsertionsApiConfig,\n} from \"./insertions-api-config\";\nimport { ChatlikeApiEndpoint } from \".\";\nimport {\n EditingApiConfig,\n defaultEditingApiConfig,\n} from \"./editing-api-config\";\n\n// Like the base autosuggestions config, with 2 additional fields:\n// 1. externalContextCategories: string[] | undefined;\n// 2. instead of apiConfigs, we have chatApiConfigs: a higher-level abstraction that uses a ChatGPT-like API endpoint.\nexport interface AutosuggestionsConfig\n extends Omit<BaseAutosuggestionsConfig, \"apiConfig\"> {\n externalContextCategories: string[] | undefined;\n chatApiConfigs: {\n suggestionsApiConfig: SuggestionsApiConfig;\n insertionApiConfig: InsertionsApiConfig;\n editingApiConfig: EditingApiConfig;\n };\n}\n\nexport const defaultAutosuggestionsConfig: Omit<\n AutosuggestionsConfig,\n \"textareaPurpose\" | \"apiEndpoint\"\n> = {\n ...defaultBaseAutosuggestionsConfig,\n externalContextCategories: undefined,\n chatApiConfigs: {\n suggestionsApiConfig: defaultSuggestionsApiConfig,\n insertionApiConfig: defaultInsertionsApiConfig,\n editingApiConfig: defaultEditingApiConfig,\n },\n};\n","import {\n CopilotApiConfig,\n copilotApiConfigExtrapolator,\n} from \"@copilotkit/react-core\";\nimport { MinimalChatGPTMessage } from \"./minimal-chat-gpt-message\";\n\nexport type ChatlikeApiEndpointImpl = (\n abortSignal: AbortSignal,\n messages: MinimalChatGPTMessage[],\n forwardedProps?: { [key: string]: any }\n) => Promise<string>;\n\nexport type StreamingChatlikeApiEndpointImpl = (\n abortSignal: AbortSignal,\n messages: MinimalChatGPTMessage[],\n forwardedProps?: { [key: string]: any }\n) => Promise<ReadableStream<string>>;\n\nexport class ChatlikeApiEndpoint {\n public run: StreamingChatlikeApiEndpointImpl;\n\n constructor(run: StreamingChatlikeApiEndpointImpl) {\n this.run = run;\n }\n\n /**\n * Creates a new instance of ChatlikeApiEndpoint with the provided API endpoint.\n * @param apiEndpoint The URL of the OpenAI-compatible API endpoint.\n * @returns A new instance of ChatlikeApiEndpoint.\n */\n static fromCopilotApiConfig(\n copilotApiConfig: CopilotApiConfig\n ): ChatlikeApiEndpoint {\n return new ChatlikeApiEndpoint(\n async (\n abortSignal: AbortSignal,\n messages: MinimalChatGPTMessage[],\n forwardedProps?: { [key: string]: any }\n ) => {\n const res = await fetch(\n copilotApiConfigExtrapolator(copilotApiConfig).chatApiEndpoint,\n {\n method: \"POST\",\n body: JSON.stringify({\n ...forwardedProps,\n messages: messages,\n }),\n signal: abortSignal,\n }\n );\n\n const bodySteram: ReadableStream<Uint8Array> | null = res.body;\n if (!bodySteram) {\n throw new Error(\"The response body is empty.\");\n }\n\n // map the stream to a stream of strings\n const stringStream = bodySteram.pipeThrough(new TextDecoderStream());\n\n return stringStream;\n }\n );\n }\n\n /**\n * Creates a fully customized instance of ChatlikeApiEndpoint.\n * @param run - The implementation of the ChatlikeApiEndpointImpl interface.\n * @returns A new instance of ChatlikeApiEndpoint .\n */\n static custom(run: StreamingChatlikeApiEndpointImpl): ChatlikeApiEndpoint {\n return new ChatlikeApiEndpoint(run);\n }\n}\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.19.0-alpha.9",
7
+ "version": "0.19.0",
8
8
  "sideEffects": [
9
9
  "**/*.css"
10
10
  ],
@@ -34,8 +34,8 @@
34
34
  "tsup": "^6.1.3",
35
35
  "typescript": "^4.9.4",
36
36
  "eslint-config-custom": "0.2.0",
37
- "tsconfig": "0.4.0-alpha.4",
38
- "tailwind-config": "0.1.0"
37
+ "tailwind-config": "0.1.0",
38
+ "tsconfig": "0.4.0"
39
39
  },
40
40
  "dependencies": {
41
41
  "@emotion/css": "^11.11.2",
@@ -61,7 +61,7 @@
61
61
  "slate-history": "^0.93.0",
62
62
  "slate-react": "^0.98.1",
63
63
  "tailwind-merge": "^1.13.2",
64
- "@copilotkit/react-core": "0.8.0-alpha.6"
64
+ "@copilotkit/react-core": "0.8.0"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "tsup --treeshake",