@copilotkit/react-textarea 0.19.0-alpha.4 → 0.19.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +174 -178
- package/CHANGELOG.md +20 -0
- package/dist/chunk-2NURR2DX.mjs +47 -0
- package/dist/chunk-2NURR2DX.mjs.map +1 -0
- package/dist/chunk-4S5ZJH3I.mjs +18 -0
- package/dist/chunk-4S5ZJH3I.mjs.map +1 -0
- package/dist/chunk-55EGOC5T.mjs +87 -0
- package/dist/chunk-55EGOC5T.mjs.map +1 -0
- package/dist/chunk-5ARCOTW3.mjs +34 -0
- package/dist/chunk-5ARCOTW3.mjs.map +1 -0
- package/dist/chunk-5EJ5XOGP.mjs +22 -0
- package/dist/chunk-5EJ5XOGP.mjs.map +1 -0
- package/dist/chunk-5FO6ISW4.mjs +3 -0
- package/dist/chunk-5FO6ISW4.mjs.map +1 -0
- package/dist/chunk-6XP7KEMW.mjs +20 -0
- package/dist/chunk-6XP7KEMW.mjs.map +1 -0
- package/dist/chunk-A2RRLD23.mjs +69 -0
- package/dist/chunk-A2RRLD23.mjs.map +1 -0
- package/dist/chunk-CSGFJU3L.mjs +65 -0
- package/dist/chunk-CSGFJU3L.mjs.map +1 -0
- package/dist/chunk-D7SEV5PR.mjs +12 -0
- package/dist/chunk-D7SEV5PR.mjs.map +1 -0
- package/dist/chunk-DE5K76I2.mjs +3 -0
- package/dist/chunk-DE5K76I2.mjs.map +1 -0
- package/dist/chunk-F3MHL6ZY.mjs +25 -0
- package/dist/chunk-F3MHL6ZY.mjs.map +1 -0
- package/dist/chunk-FBDXI5QA.mjs +501 -0
- package/dist/chunk-FBDXI5QA.mjs.map +1 -0
- package/dist/chunk-FN7GDKKG.mjs +29 -0
- package/dist/chunk-FN7GDKKG.mjs.map +1 -0
- package/dist/chunk-H4VKQGVU.mjs +3 -0
- package/dist/chunk-H4VKQGVU.mjs.map +1 -0
- package/dist/chunk-HAFHLU4N.mjs +55 -0
- package/dist/chunk-HAFHLU4N.mjs.map +1 -0
- package/dist/chunk-IU3WTXLQ.mjs +3 -0
- package/dist/chunk-IU3WTXLQ.mjs.map +1 -0
- package/dist/chunk-IWTOQKC5.mjs +201 -0
- package/dist/chunk-IWTOQKC5.mjs.map +1 -0
- package/dist/chunk-IXJ2HCOA.mjs +101 -0
- package/dist/chunk-IXJ2HCOA.mjs.map +1 -0
- package/dist/chunk-JAFCXEPU.mjs +10 -0
- package/dist/chunk-JAFCXEPU.mjs.map +1 -0
- package/dist/chunk-KCHYD3EB.mjs +107 -0
- package/dist/chunk-KCHYD3EB.mjs.map +1 -0
- package/dist/chunk-KGKLUWKW.mjs +47 -0
- package/dist/chunk-KGKLUWKW.mjs.map +1 -0
- package/dist/chunk-L7VVZH4Q.mjs +3 -0
- package/dist/chunk-L7VVZH4Q.mjs.map +1 -0
- package/dist/chunk-LNAIMEB2.mjs +34 -0
- package/dist/chunk-LNAIMEB2.mjs.map +1 -0
- package/dist/chunk-MMVDU6DF.mjs +3 -0
- package/dist/chunk-MMVDU6DF.mjs.map +1 -0
- package/dist/chunk-MPME5BW2.mjs +59 -0
- package/dist/chunk-MPME5BW2.mjs.map +1 -0
- package/dist/chunk-MRXNTQOX.mjs +55 -0
- package/dist/chunk-MRXNTQOX.mjs.map +1 -0
- package/dist/chunk-N4JMCC7P.mjs +44 -0
- package/dist/chunk-N4JMCC7P.mjs.map +1 -0
- package/dist/chunk-ND5PXTAW.mjs +17 -0
- package/dist/chunk-ND5PXTAW.mjs.map +1 -0
- package/dist/chunk-NKW5OU2S.mjs +33 -0
- package/dist/chunk-NKW5OU2S.mjs.map +1 -0
- package/dist/chunk-O5OWT5GE.mjs +114 -0
- package/dist/chunk-O5OWT5GE.mjs.map +1 -0
- package/dist/chunk-OD7ZMOVE.mjs +45 -0
- package/dist/chunk-OD7ZMOVE.mjs.map +1 -0
- package/dist/chunk-OELUUJZY.mjs +16 -0
- package/dist/chunk-OELUUJZY.mjs.map +1 -0
- package/dist/chunk-QL2GYGG5.mjs +19 -0
- package/dist/chunk-QL2GYGG5.mjs.map +1 -0
- package/dist/chunk-RQHOUUXQ.mjs +29 -0
- package/dist/chunk-RQHOUUXQ.mjs.map +1 -0
- package/dist/chunk-UHD44NC5.mjs +101 -0
- package/dist/chunk-UHD44NC5.mjs.map +1 -0
- package/dist/chunk-VBIJPE3H.mjs +108 -0
- package/dist/chunk-VBIJPE3H.mjs.map +1 -0
- package/dist/chunk-WADHCMPK.mjs +3 -0
- package/dist/chunk-WADHCMPK.mjs.map +1 -0
- package/dist/chunk-WJHSY5T6.mjs +3 -0
- package/dist/chunk-WJHSY5T6.mjs.map +1 -0
- package/dist/chunk-WJYQWL4I.mjs +27 -0
- package/dist/chunk-WJYQWL4I.mjs.map +1 -0
- package/dist/chunk-XA7M72ZO.mjs +106 -0
- package/dist/chunk-XA7M72ZO.mjs.map +1 -0
- package/dist/chunk-XDT7BF3V.mjs +81 -0
- package/dist/chunk-XDT7BF3V.mjs.map +1 -0
- package/dist/chunk-XHUMROEY.mjs +91 -0
- package/dist/chunk-XHUMROEY.mjs.map +1 -0
- package/dist/chunk-YQU7WG7T.mjs +83 -0
- package/dist/chunk-YQU7WG7T.mjs.map +1 -0
- package/dist/chunk-YSZ7DO3X.mjs +107 -0
- package/dist/chunk-YSZ7DO3X.mjs.map +1 -0
- package/dist/chunk-YTOPHPSG.mjs +45 -0
- package/dist/chunk-YTOPHPSG.mjs.map +1 -0
- package/dist/chunk-YW3REYX6.mjs +23 -0
- package/dist/chunk-YW3REYX6.mjs.map +1 -0
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs +33 -1870
- package/dist/components/base-copilot-textarea/base-copilot-textarea.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/render-element.mjs +3 -52
- package/dist/components/base-copilot-textarea/render-element.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/render-placeholder.mjs +3 -46
- package/dist/components/base-copilot-textarea/render-placeholder.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs +4 -86
- package/dist/components/base-copilot-textarea/track-cursor-moved-since-last-text-change.mjs.map +1 -1
- package/dist/components/base-copilot-textarea/use-add-branding-css.mjs +3 -57
- package/dist/components/base-copilot-textarea/use-add-branding-css.mjs.map +1 -1
- package/dist/components/copilot-textarea/copilot-textarea.mjs +43 -2339
- package/dist/components/copilot-textarea/copilot-textarea.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs +3 -22
- package/dist/components/hovering-toolbar/hovering-editor-provider.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs +3 -125
- package/dist/components/hovering-toolbar/hovering-toolbar-components.mjs.map +1 -1
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs +16 -1015
- package/dist/components/hovering-toolbar/hovering-toolbar.mjs.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs +10 -721
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.mjs.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs +11 -734
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box.mjs.map +1 -1
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs +12 -734
- package/dist/components/hovering-toolbar/text-insertion-prompt-box/index.mjs.map +1 -1
- package/dist/components/index.mjs +44 -2340
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/manual-ui/chip-with-icon.mjs +6 -5
- package/dist/components/manual-ui/chip-with-icon.mjs.map +1 -1
- package/dist/components/source-search-box/source-search-box.mjs +10 -323
- package/dist/components/source-search-box/source-search-box.mjs.map +1 -1
- package/dist/components/ui/button.mjs +4 -88
- package/dist/components/ui/button.mjs.map +1 -1
- package/dist/components/ui/card.mjs +7 -53
- package/dist/components/ui/card.mjs.map +1 -1
- package/dist/components/ui/command.mjs +5 -266
- package/dist/components/ui/command.mjs.map +1 -1
- package/dist/components/ui/dialog.mjs +4 -164
- package/dist/components/ui/dialog.mjs.map +1 -1
- package/dist/components/ui/label.mjs +4 -63
- package/dist/components/ui/label.mjs.map +1 -1
- package/dist/components/ui/separator.mjs +8 -50
- package/dist/components/ui/separator.mjs.map +1 -1
- package/dist/components/ui/textarea.mjs +7 -48
- package/dist/components/ui/textarea.mjs.map +1 -1
- package/dist/context/index.mjs +2 -0
- package/dist/context/index.mjs.map +1 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs +6 -168
- package/dist/hooks/base-copilot-textarea-implementation/use-autosuggestions.mjs.map +1 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs +4 -168
- package/dist/hooks/base-copilot-textarea-implementation/use-copilot-textarea-editor.mjs.map +1 -1
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs +5 -155
- package/dist/hooks/base-copilot-textarea-implementation/use-populate-copilot-textarea-ref.mjs.map +1 -1
- package/dist/hooks/index.mjs +2 -0
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs +4 -90
- package/dist/hooks/make-autosuggestions-function/use-make-standard-autosuggestions-function.mjs.map +1 -1
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs +4 -143
- package/dist/hooks/make-autosuggestions-function/use-make-standard-insertion-function.mjs.map +1 -1
- package/dist/hooks/misc/use-autosize-textarea.mjs +3 -15
- package/dist/hooks/misc/use-autosize-textarea.mjs.map +1 -1
- package/dist/index.css +3 -0
- package/dist/index.css.map +1 -1
- package/dist/index.mjs +48 -2343
- package/dist/index.mjs.map +1 -1
- package/dist/lib/debouncer.mjs +3 -51
- package/dist/lib/debouncer.mjs.map +1 -1
- package/dist/lib/editor-to-text.mjs +3 -43
- package/dist/lib/editor-to-text.mjs.map +1 -1
- package/dist/lib/get-text-around-cursor.mjs +3 -109
- package/dist/lib/get-text-around-cursor.mjs.map +1 -1
- package/dist/lib/retry.mjs +3 -17
- package/dist/lib/retry.mjs.map +1 -1
- package/dist/lib/slatejs-edits/add-autocompletions.mjs +3 -25
- package/dist/lib/slatejs-edits/add-autocompletions.mjs.map +1 -1
- package/dist/lib/slatejs-edits/clear-autocompletions.mjs +3 -23
- package/dist/lib/slatejs-edits/clear-autocompletions.mjs.map +1 -1
- package/dist/lib/slatejs-edits/replace-text.mjs +3 -27
- package/dist/lib/slatejs-edits/replace-text.mjs.map +1 -1
- package/dist/lib/slatejs-edits/with-partial-history.mjs +3 -106
- package/dist/lib/slatejs-edits/with-partial-history.mjs.map +1 -1
- package/dist/lib/stream-promise-flatten.mjs +3 -47
- package/dist/lib/stream-promise-flatten.mjs.map +1 -1
- package/dist/lib/utils.mjs +3 -71
- package/dist/lib/utils.mjs.map +1 -1
- package/dist/lib/utils.test.mjs +1 -0
- package/dist/lib/utils.test.mjs.map +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs +2 -0
- package/dist/types/autosuggestions-config/autosuggestions-config-user-specified.mjs.map +1 -1
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs +9 -312
- package/dist/types/autosuggestions-config/autosuggestions-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/editing-api-config.mjs +4 -155
- package/dist/types/autosuggestions-config/editing-api-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/index.mjs +10 -313
- package/dist/types/autosuggestions-config/index.mjs.map +1 -1
- package/dist/types/autosuggestions-config/insertions-api-config.mjs +4 -149
- package/dist/types/autosuggestions-config/insertions-api-config.mjs.map +1 -1
- package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs +3 -71
- package/dist/types/autosuggestions-config/subtypes/chatlike-api-endpoint.mjs.map +1 -1
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs +2 -0
- package/dist/types/autosuggestions-config/subtypes/make-system-prompt.mjs.map +1 -1
- package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.mjs +2 -0
- package/dist/types/autosuggestions-config/subtypes/minimal-chat-gpt-message.mjs.map +1 -1
- package/dist/types/autosuggestions-config/suggestions-api-config.mjs +4 -137
- package/dist/types/autosuggestions-config/suggestions-api-config.mjs.map +1 -1
- package/dist/types/base/autosuggestion-state.mjs +2 -0
- package/dist/types/base/autosuggestion-state.mjs.map +1 -1
- package/dist/types/base/autosuggestions-bare-function.mjs +2 -0
- package/dist/types/base/autosuggestions-bare-function.mjs.map +1 -1
- package/dist/types/base/base-autosuggestions-config.mjs +3 -11
- package/dist/types/base/base-autosuggestions-config.mjs.map +1 -1
- package/dist/types/base/base-copilot-textarea-props.mjs +2 -0
- package/dist/types/base/base-copilot-textarea-props.mjs.map +1 -1
- package/dist/types/base/custom-editor.mjs +2 -0
- package/dist/types/base/custom-editor.mjs.map +1 -1
- package/dist/types/base/editor-autocomplete-state.mjs +4 -17
- package/dist/types/base/editor-autocomplete-state.mjs.map +1 -1
- package/dist/types/base/index.mjs +4 -11
- package/dist/types/base/index.mjs.map +1 -1
- package/dist/types/html-copilot-textarea-element.mjs +2 -0
- package/dist/types/html-copilot-textarea-element.mjs.map +1 -1
- package/dist/types/index.mjs +12 -314
- package/dist/types/index.mjs.map +1 -1
- package/package.json +6 -5
- package/src/components/hovering-toolbar/text-insertion-prompt-box/hovering-insertion-prompt-box-core.tsx +40 -1
|
@@ -1,138 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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/autosuggestions-config/subtypes/chatlike-api-endpoint.tsx
|
|
42
|
-
var ChatlikeApiEndpoint = class {
|
|
43
|
-
constructor(run) {
|
|
44
|
-
this.run = run;
|
|
45
|
-
}
|
|
46
|
-
static standardOpenAIEndpoint(apiEndpoint) {
|
|
47
|
-
return new ChatlikeApiEndpoint(
|
|
48
|
-
(abortSignal, messages, forwardedProps) => __async(this, null, function* () {
|
|
49
|
-
const res = yield fetch(apiEndpoint, {
|
|
50
|
-
method: "POST",
|
|
51
|
-
body: JSON.stringify(__spreadProps(__spreadValues({}, forwardedProps), {
|
|
52
|
-
messages
|
|
53
|
-
})),
|
|
54
|
-
signal: abortSignal
|
|
55
|
-
});
|
|
56
|
-
const bodySteram = res.body;
|
|
57
|
-
if (!bodySteram) {
|
|
58
|
-
throw new Error("The response body is empty.");
|
|
59
|
-
}
|
|
60
|
-
const stringStream = bodySteram.pipeThrough(new TextDecoderStream());
|
|
61
|
-
return stringStream;
|
|
62
|
-
})
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
static custom(run) {
|
|
66
|
-
return new ChatlikeApiEndpoint(run);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
// src/types/autosuggestions-config/suggestions-api-config.tsx
|
|
71
|
-
var defaultSuggestionsMakeSystemPrompt = (textareaPurpose, contextString) => {
|
|
72
|
-
return `You are a versatile writing assistant.
|
|
73
|
-
|
|
74
|
-
The user is writing some text.
|
|
75
|
-
The purpose is: "${textareaPurpose}"
|
|
76
|
-
|
|
77
|
-
Your job is to guess what the user will write next AS BEST YOU CAN.
|
|
78
|
-
Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
|
|
79
|
-
|
|
80
|
-
Adjust yourself to the user's style and implied intent.
|
|
81
|
-
|
|
82
|
-
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.
|
|
83
|
-
<TextAfterCursor>
|
|
84
|
-
<TextBeforeCursor>
|
|
85
|
-
<YourSuggestion>
|
|
86
|
-
|
|
87
|
-
If we need to add a whitespace character to the suggested text, make sure to explicitly add it in.
|
|
88
|
-
|
|
89
|
-
The following external context is also provided. Use it to help you make better suggestions!!!
|
|
90
|
-
\`\`\`
|
|
91
|
-
${contextString}
|
|
92
|
-
\`\`\`
|
|
93
|
-
`;
|
|
94
|
-
};
|
|
95
|
-
var defaultSuggestionsFewShotMessages = [
|
|
96
|
-
{
|
|
97
|
-
role: "user",
|
|
98
|
-
name: "TextAfterCursor",
|
|
99
|
-
content: "While I was there I also picked up some apples, oranges, and bananas."
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
role: "user",
|
|
103
|
-
name: "TextBeforeCursor",
|
|
104
|
-
content: "This morning I woke up and went straight to the grocery store."
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
role: "assistant",
|
|
108
|
-
content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
role: "user",
|
|
112
|
-
name: "TextAfterCursor",
|
|
113
|
-
content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
role: "user",
|
|
117
|
-
name: "TextBeforeCursor",
|
|
118
|
-
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;`
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
role: "assistant",
|
|
122
|
-
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"; `
|
|
123
|
-
}
|
|
124
|
-
];
|
|
125
|
-
var defaultSuggestionsApiConfig = {
|
|
126
|
-
apiEndpoint: ChatlikeApiEndpoint.standardOpenAIEndpoint(
|
|
127
|
-
"/api/copilotkit_chatlike"
|
|
128
|
-
),
|
|
129
|
-
makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,
|
|
130
|
-
fewShotMessages: defaultSuggestionsFewShotMessages,
|
|
131
|
-
forwardedParams: void 0
|
|
132
|
-
};
|
|
133
|
-
export {
|
|
134
|
-
defaultSuggestionsApiConfig,
|
|
135
|
-
defaultSuggestionsFewShotMessages,
|
|
136
|
-
defaultSuggestionsMakeSystemPrompt
|
|
137
|
-
};
|
|
1
|
+
export { defaultSuggestionsApiConfig, defaultSuggestionsFewShotMessages, defaultSuggestionsMakeSystemPrompt } from '../../chunk-A2RRLD23.mjs';
|
|
2
|
+
import '../../chunk-5ARCOTW3.mjs';
|
|
3
|
+
import '../../chunk-MRXNTQOX.mjs';
|
|
4
|
+
//# sourceMappingURL=out.js.map
|
|
138
5
|
//# sourceMappingURL=suggestions-api-config.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
acceptAutosuggestionKey: "Tab",
|
|
5
|
-
disableWhenEmpty: true,
|
|
6
|
-
disabled: false,
|
|
7
|
-
temporarilyDisableWhenMovingCursorWithoutChangingText: true
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
defaultBaseAutosuggestionsConfig
|
|
11
|
-
};
|
|
1
|
+
export { defaultBaseAutosuggestionsConfig } from '../../chunk-D7SEV5PR.mjs';
|
|
2
|
+
import '../../chunk-MRXNTQOX.mjs';
|
|
3
|
+
//# sourceMappingURL=out.js.map
|
|
12
4
|
//# sourceMappingURL=base-autosuggestions-config.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
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":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
disableWhenEmpty: true,
|
|
6
|
-
disabled: false,
|
|
7
|
-
temporarilyDisableWhenMovingCursorWithoutChangingText: true
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
defaultBaseAutosuggestionsConfig
|
|
11
|
-
};
|
|
1
|
+
import '../../chunk-WJHSY5T6.mjs';
|
|
2
|
+
export { defaultBaseAutosuggestionsConfig } from '../../chunk-D7SEV5PR.mjs';
|
|
3
|
+
import '../../chunk-MRXNTQOX.mjs';
|
|
4
|
+
//# sourceMappingURL=out.js.map
|
|
12
5
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,315 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
acceptAutosuggestionKey: "Tab",
|
|
45
|
-
disableWhenEmpty: true,
|
|
46
|
-
disabled: false,
|
|
47
|
-
temporarilyDisableWhenMovingCursorWithoutChangingText: true
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
// src/types/autosuggestions-config/subtypes/chatlike-api-endpoint.tsx
|
|
51
|
-
var ChatlikeApiEndpoint = class {
|
|
52
|
-
constructor(run) {
|
|
53
|
-
this.run = run;
|
|
54
|
-
}
|
|
55
|
-
static standardOpenAIEndpoint(apiEndpoint) {
|
|
56
|
-
return new ChatlikeApiEndpoint(
|
|
57
|
-
(abortSignal, messages, forwardedProps) => __async(this, null, function* () {
|
|
58
|
-
const res = yield fetch(apiEndpoint, {
|
|
59
|
-
method: "POST",
|
|
60
|
-
body: JSON.stringify(__spreadProps(__spreadValues({}, forwardedProps), {
|
|
61
|
-
messages
|
|
62
|
-
})),
|
|
63
|
-
signal: abortSignal
|
|
64
|
-
});
|
|
65
|
-
const bodySteram = res.body;
|
|
66
|
-
if (!bodySteram) {
|
|
67
|
-
throw new Error("The response body is empty.");
|
|
68
|
-
}
|
|
69
|
-
const stringStream = bodySteram.pipeThrough(new TextDecoderStream());
|
|
70
|
-
return stringStream;
|
|
71
|
-
})
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
static custom(run) {
|
|
75
|
-
return new ChatlikeApiEndpoint(run);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
// src/types/autosuggestions-config/suggestions-api-config.tsx
|
|
80
|
-
var defaultSuggestionsMakeSystemPrompt = (textareaPurpose, contextString) => {
|
|
81
|
-
return `You are a versatile writing assistant.
|
|
82
|
-
|
|
83
|
-
The user is writing some text.
|
|
84
|
-
The purpose is: "${textareaPurpose}"
|
|
85
|
-
|
|
86
|
-
Your job is to guess what the user will write next AS BEST YOU CAN.
|
|
87
|
-
Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
|
|
88
|
-
|
|
89
|
-
Adjust yourself to the user's style and implied intent.
|
|
90
|
-
|
|
91
|
-
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.
|
|
92
|
-
<TextAfterCursor>
|
|
93
|
-
<TextBeforeCursor>
|
|
94
|
-
<YourSuggestion>
|
|
95
|
-
|
|
96
|
-
If we need to add a whitespace character to the suggested text, make sure to explicitly add it in.
|
|
97
|
-
|
|
98
|
-
The following external context is also provided. Use it to help you make better suggestions!!!
|
|
99
|
-
\`\`\`
|
|
100
|
-
${contextString}
|
|
101
|
-
\`\`\`
|
|
102
|
-
`;
|
|
103
|
-
};
|
|
104
|
-
var defaultSuggestionsFewShotMessages = [
|
|
105
|
-
{
|
|
106
|
-
role: "user",
|
|
107
|
-
name: "TextAfterCursor",
|
|
108
|
-
content: "While I was there I also picked up some apples, oranges, and bananas."
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
role: "user",
|
|
112
|
-
name: "TextBeforeCursor",
|
|
113
|
-
content: "This morning I woke up and went straight to the grocery store."
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
role: "assistant",
|
|
117
|
-
content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
role: "user",
|
|
121
|
-
name: "TextAfterCursor",
|
|
122
|
-
content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
role: "user",
|
|
126
|
-
name: "TextBeforeCursor",
|
|
127
|
-
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;`
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
role: "assistant",
|
|
131
|
-
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"; `
|
|
132
|
-
}
|
|
133
|
-
];
|
|
134
|
-
var defaultSuggestionsApiConfig = {
|
|
135
|
-
apiEndpoint: ChatlikeApiEndpoint.standardOpenAIEndpoint(
|
|
136
|
-
"/api/copilotkit_chatlike"
|
|
137
|
-
),
|
|
138
|
-
makeSystemPrompt: defaultSuggestionsMakeSystemPrompt,
|
|
139
|
-
fewShotMessages: defaultSuggestionsFewShotMessages,
|
|
140
|
-
forwardedParams: void 0
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
// src/types/autosuggestions-config/insertions-api-config.tsx
|
|
144
|
-
var defaultInsertionsMakeSystemPrompt = (textareaPurpose, contextString) => {
|
|
145
|
-
return `You are a versatile writing assistant.
|
|
146
|
-
|
|
147
|
-
The user is writing some text.
|
|
148
|
-
The purpose is: "${textareaPurpose}"
|
|
149
|
-
|
|
150
|
-
The user also provides you with a prompt for INSERTIONS into the text they are writing.
|
|
151
|
-
Your job is to come up with an INSERTION into the text that the user would like AS BEST YOU CAN.
|
|
152
|
-
Only guess a SHORT distance ahead. Usually 1 sentence, or at most 1 paragraph.
|
|
153
|
-
|
|
154
|
-
Adjust yourself to the user's style and implied intent.
|
|
155
|
-
|
|
156
|
-
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.
|
|
157
|
-
<TextAfterCursor>
|
|
158
|
-
<TextBeforeCursor>
|
|
159
|
-
<InsertionPrompt>
|
|
160
|
-
<YourSuggestion>
|
|
161
|
-
|
|
162
|
-
If we need to add a whitespace character to the suggested text, make sure to explicitly add it in.
|
|
163
|
-
|
|
164
|
-
The following external context is also provided. Use it to help you make better suggestions!!!
|
|
165
|
-
\`\`\`
|
|
166
|
-
${contextString}
|
|
167
|
-
\`\`\`
|
|
168
|
-
`;
|
|
169
|
-
};
|
|
170
|
-
var defaultInsertionsFewShotMessages = [
|
|
171
|
-
{
|
|
172
|
-
role: "user",
|
|
173
|
-
name: "TextAfterCursor",
|
|
174
|
-
content: "While I was there I also picked up some apples, oranges, and bananas."
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
role: "user",
|
|
178
|
-
name: "TextBeforeCursor",
|
|
179
|
-
content: "This morning I woke up and went straight to the grocery store."
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
role: "user",
|
|
183
|
-
name: "InsertionPrompt",
|
|
184
|
-
content: "I bought a big watermelon"
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
role: "assistant",
|
|
188
|
-
content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
role: "user",
|
|
192
|
-
name: "TextAfterCursor",
|
|
193
|
-
content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
role: "user",
|
|
197
|
-
name: "TextBeforeCursor",
|
|
198
|
-
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;`
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
role: "user",
|
|
202
|
-
name: "InsertionPrompt",
|
|
203
|
-
content: "add section about the optionholder's pro rata share"
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
role: "assistant",
|
|
207
|
-
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"; `
|
|
208
|
-
}
|
|
209
|
-
];
|
|
210
|
-
var defaultInsertionsApiConfig = {
|
|
211
|
-
apiEndpoint: ChatlikeApiEndpoint.standardOpenAIEndpoint(
|
|
212
|
-
"/api/copilotkit_chatlike"
|
|
213
|
-
),
|
|
214
|
-
makeSystemPrompt: defaultInsertionsMakeSystemPrompt,
|
|
215
|
-
fewShotMessages: defaultInsertionsFewShotMessages,
|
|
216
|
-
forwardedParams: void 0
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
// src/types/autosuggestions-config/editing-api-config.tsx
|
|
220
|
-
var defaultEditingMakeSystemPrompt = (textareaPurpose, contextString) => {
|
|
221
|
-
return `You are a versatile writing assistant.
|
|
222
|
-
|
|
223
|
-
The user is writing some text.
|
|
224
|
-
The purpose is: "${textareaPurpose}"
|
|
225
|
-
|
|
226
|
-
The user also provides you with a prompt for EDITING some text they are writing.
|
|
227
|
-
Your job is to come up with an EDIT of the text that the user would like to use - AS BEST YOU CAN.
|
|
228
|
-
|
|
229
|
-
Adjust yourself to the user's style and implied intent.
|
|
230
|
-
|
|
231
|
-
The user will provide the following information; use this to infer the best relevant EDIT:
|
|
232
|
-
<TextBeforeCursor>
|
|
233
|
-
<TextToEdit>
|
|
234
|
-
<TextAfterCursor>
|
|
235
|
-
<EditingPrompt>
|
|
236
|
-
|
|
237
|
-
<YourEditSuggestion>
|
|
238
|
-
|
|
239
|
-
If we need to add a whitespace character to the suggested edit text, make sure to explicitly add it in.
|
|
240
|
-
|
|
241
|
-
The following external context is also provided. Use it to help you make better suggestions!!!
|
|
242
|
-
\`\`\`
|
|
243
|
-
${contextString}
|
|
244
|
-
\`\`\`
|
|
245
|
-
`;
|
|
246
|
-
};
|
|
247
|
-
var defaultEditingFewShotMessages = [
|
|
248
|
-
{
|
|
249
|
-
role: "user",
|
|
250
|
-
name: "TextBeforeCursor",
|
|
251
|
-
content: "This morning I woke up and went straight to the grocery store. "
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
role: "user",
|
|
255
|
-
name: "TextToEdit",
|
|
256
|
-
content: "While I was there I also picked up some apples, oranges, and bananas. "
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
role: "user",
|
|
260
|
-
name: "TextAfterCursor",
|
|
261
|
-
content: "The grocery store was having a sale on fruit, so I decided to stock up."
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
role: "user",
|
|
265
|
-
name: "EditingPrompt",
|
|
266
|
-
content: "I bought a big watermelon"
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
role: "assistant",
|
|
270
|
-
content: " When I arrived I went straight to the produce section and picked out a big watermelon. "
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
role: "user",
|
|
274
|
-
name: "TextAfterCursor",
|
|
275
|
-
content: "and (iii) to the appointment of the Equityholders' Representative pursuant to Section 10.7 of the Merger Agreement and to the provisions thereof."
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
role: "user",
|
|
279
|
-
name: "TextBeforeCursor",
|
|
280
|
-
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;`
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
role: "user",
|
|
284
|
-
name: "InsertionPrompt",
|
|
285
|
-
content: "add section about the optionholder's pro rata share"
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
role: "assistant",
|
|
289
|
-
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"; `
|
|
290
|
-
}
|
|
291
|
-
];
|
|
292
|
-
var defaultEditingApiConfig = {
|
|
293
|
-
apiEndpoint: ChatlikeApiEndpoint.standardOpenAIEndpoint(
|
|
294
|
-
"/api/copilotkit_chatlike"
|
|
295
|
-
),
|
|
296
|
-
makeSystemPrompt: defaultEditingMakeSystemPrompt,
|
|
297
|
-
fewShotMessages: defaultEditingFewShotMessages,
|
|
298
|
-
forwardedParams: void 0
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
// src/types/autosuggestions-config/autosuggestions-config.tsx
|
|
302
|
-
var defaultAutosuggestionsConfig = __spreadProps(__spreadValues({}, defaultBaseAutosuggestionsConfig), {
|
|
303
|
-
externalContextCategories: void 0,
|
|
304
|
-
chatApiConfigs: {
|
|
305
|
-
suggestionsApiConfig: defaultSuggestionsApiConfig,
|
|
306
|
-
insertionApiConfig: defaultInsertionsApiConfig,
|
|
307
|
-
editingApiConfig: defaultEditingApiConfig
|
|
308
|
-
}
|
|
309
|
-
});
|
|
310
|
-
export {
|
|
311
|
-
ChatlikeApiEndpoint,
|
|
312
|
-
defaultAutosuggestionsConfig,
|
|
313
|
-
defaultBaseAutosuggestionsConfig
|
|
314
|
-
};
|
|
1
|
+
import '../chunk-DE5K76I2.mjs';
|
|
2
|
+
import '../chunk-WADHCMPK.mjs';
|
|
3
|
+
import '../chunk-5FO6ISW4.mjs';
|
|
4
|
+
export { defaultAutosuggestionsConfig } from '../chunk-QL2GYGG5.mjs';
|
|
5
|
+
import '../chunk-55EGOC5T.mjs';
|
|
6
|
+
import '../chunk-XDT7BF3V.mjs';
|
|
7
|
+
import '../chunk-A2RRLD23.mjs';
|
|
8
|
+
export { ChatlikeApiEndpoint } from '../chunk-5ARCOTW3.mjs';
|
|
9
|
+
import '../chunk-WJHSY5T6.mjs';
|
|
10
|
+
export { defaultBaseAutosuggestionsConfig } from '../chunk-D7SEV5PR.mjs';
|
|
11
|
+
import '../chunk-MRXNTQOX.mjs';
|
|
12
|
+
//# sourceMappingURL=out.js.map
|
|
315
13
|
//# sourceMappingURL=index.mjs.map
|