monacopilot 0.8.12 → 0.8.14
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/dist/index.d.mts +25 -6
- package/dist/index.d.ts +25 -6
- package/dist/index.js +37 -3
- package/dist/index.mjs +38 -4
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -10,10 +10,25 @@ declare const _default: readonly ["react", "angular", "vue.js", "express", "djan
|
|
|
10
10
|
type EndpointType = string;
|
|
11
11
|
type FrameworkType = (typeof _default)[number];
|
|
12
12
|
type CompletionSpeedType = 'little-faster' | 'normal';
|
|
13
|
+
type ExternalContextType = Array<{
|
|
14
|
+
/**
|
|
15
|
+
* The relative path from the current editing file to an external file.
|
|
16
|
+
*
|
|
17
|
+
* Examples:
|
|
18
|
+
* - To include a file `utils.js` in the same directory, set as `./utils.js`.
|
|
19
|
+
* - To include a file `utils.js` in the parent directory, set as `../utils.js`.
|
|
20
|
+
* - To include a file `utils.js` in the child directory, set as `./child/utils.js`.
|
|
21
|
+
*/
|
|
22
|
+
path: string;
|
|
23
|
+
/**
|
|
24
|
+
* The content of the external file as a string.
|
|
25
|
+
*/
|
|
26
|
+
content: string;
|
|
27
|
+
}>;
|
|
13
28
|
/**
|
|
14
29
|
* Themes available for the Rich Monaco Editor.
|
|
15
30
|
*/
|
|
16
|
-
type ThemeType = '
|
|
31
|
+
type ThemeType = 'codesandbox-dark' | 'github-dark-dimmed' | 'github-dark' | 'github-light' | 'monokai';
|
|
17
32
|
interface EditorProps extends EditorProps$1 {
|
|
18
33
|
/**
|
|
19
34
|
* The API endpoint where you started the completion service.
|
|
@@ -37,9 +52,14 @@ interface EditorProps extends EditorProps$1 {
|
|
|
37
52
|
* @default 'normal'
|
|
38
53
|
*/
|
|
39
54
|
completionSpeed?: CompletionSpeedType;
|
|
55
|
+
/**
|
|
56
|
+
* Helps to give more relevant completions based on the full context.
|
|
57
|
+
* You can include things like the contents/codes of other files in the same workspace.
|
|
58
|
+
*/
|
|
59
|
+
externalContext?: ExternalContextType;
|
|
40
60
|
}
|
|
41
61
|
|
|
42
|
-
type CompletionModelType = '
|
|
62
|
+
type CompletionModelType = 'llama';
|
|
43
63
|
type GroqCompletion = ChatCompletion & {
|
|
44
64
|
error?: string;
|
|
45
65
|
};
|
|
@@ -56,12 +76,11 @@ interface CompletionMetadata {
|
|
|
56
76
|
lineNumber: number;
|
|
57
77
|
columnNumber: number;
|
|
58
78
|
};
|
|
79
|
+
externalContext: ExternalContextType | undefined;
|
|
59
80
|
codeAfterCursor: string;
|
|
60
81
|
codeBeforeCursor: string;
|
|
61
82
|
editorState: {
|
|
62
|
-
completionMode: '
|
|
63
|
-
codeLengthBeforeCursor: number;
|
|
64
|
-
totalCodeLength: number;
|
|
83
|
+
completionMode: 'fill-in' | 'line-continuation' | 'continuation';
|
|
65
84
|
};
|
|
66
85
|
}
|
|
67
86
|
|
|
@@ -88,6 +107,6 @@ declare class Copilot {
|
|
|
88
107
|
}>;
|
|
89
108
|
}
|
|
90
109
|
|
|
91
|
-
declare const Editor: ({ endpoint, framework, theme, completionSpeed, ...props }: EditorProps) => React.JSX.Element;
|
|
110
|
+
declare const Editor: ({ endpoint, framework, theme, completionSpeed, externalContext, ...props }: EditorProps) => React.JSX.Element;
|
|
92
111
|
|
|
93
112
|
export { Copilot, Editor, type EditorProps, type EndpointType, type FrameworkType, type ThemeType as Theme };
|
package/dist/index.d.ts
CHANGED
|
@@ -10,10 +10,25 @@ declare const _default: readonly ["react", "angular", "vue.js", "express", "djan
|
|
|
10
10
|
type EndpointType = string;
|
|
11
11
|
type FrameworkType = (typeof _default)[number];
|
|
12
12
|
type CompletionSpeedType = 'little-faster' | 'normal';
|
|
13
|
+
type ExternalContextType = Array<{
|
|
14
|
+
/**
|
|
15
|
+
* The relative path from the current editing file to an external file.
|
|
16
|
+
*
|
|
17
|
+
* Examples:
|
|
18
|
+
* - To include a file `utils.js` in the same directory, set as `./utils.js`.
|
|
19
|
+
* - To include a file `utils.js` in the parent directory, set as `../utils.js`.
|
|
20
|
+
* - To include a file `utils.js` in the child directory, set as `./child/utils.js`.
|
|
21
|
+
*/
|
|
22
|
+
path: string;
|
|
23
|
+
/**
|
|
24
|
+
* The content of the external file as a string.
|
|
25
|
+
*/
|
|
26
|
+
content: string;
|
|
27
|
+
}>;
|
|
13
28
|
/**
|
|
14
29
|
* Themes available for the Rich Monaco Editor.
|
|
15
30
|
*/
|
|
16
|
-
type ThemeType = '
|
|
31
|
+
type ThemeType = 'codesandbox-dark' | 'github-dark-dimmed' | 'github-dark' | 'github-light' | 'monokai';
|
|
17
32
|
interface EditorProps extends EditorProps$1 {
|
|
18
33
|
/**
|
|
19
34
|
* The API endpoint where you started the completion service.
|
|
@@ -37,9 +52,14 @@ interface EditorProps extends EditorProps$1 {
|
|
|
37
52
|
* @default 'normal'
|
|
38
53
|
*/
|
|
39
54
|
completionSpeed?: CompletionSpeedType;
|
|
55
|
+
/**
|
|
56
|
+
* Helps to give more relevant completions based on the full context.
|
|
57
|
+
* You can include things like the contents/codes of other files in the same workspace.
|
|
58
|
+
*/
|
|
59
|
+
externalContext?: ExternalContextType;
|
|
40
60
|
}
|
|
41
61
|
|
|
42
|
-
type CompletionModelType = '
|
|
62
|
+
type CompletionModelType = 'llama';
|
|
43
63
|
type GroqCompletion = ChatCompletion & {
|
|
44
64
|
error?: string;
|
|
45
65
|
};
|
|
@@ -56,12 +76,11 @@ interface CompletionMetadata {
|
|
|
56
76
|
lineNumber: number;
|
|
57
77
|
columnNumber: number;
|
|
58
78
|
};
|
|
79
|
+
externalContext: ExternalContextType | undefined;
|
|
59
80
|
codeAfterCursor: string;
|
|
60
81
|
codeBeforeCursor: string;
|
|
61
82
|
editorState: {
|
|
62
|
-
completionMode: '
|
|
63
|
-
codeLengthBeforeCursor: number;
|
|
64
|
-
totalCodeLength: number;
|
|
83
|
+
completionMode: 'fill-in' | 'line-continuation' | 'continuation';
|
|
65
84
|
};
|
|
66
85
|
}
|
|
67
86
|
|
|
@@ -88,6 +107,6 @@ declare class Copilot {
|
|
|
88
107
|
}>;
|
|
89
108
|
}
|
|
90
109
|
|
|
91
|
-
declare const Editor: ({ endpoint, framework, theme, completionSpeed, ...props }: EditorProps) => React.JSX.Element;
|
|
110
|
+
declare const Editor: ({ endpoint, framework, theme, completionSpeed, externalContext, ...props }: EditorProps) => React.JSX.Element;
|
|
92
111
|
|
|
93
112
|
export { Copilot, Editor, type EditorProps, type EndpointType, type FrameworkType, type ThemeType as Theme };
|