monacopilot 0.8.2 → 0.8.3
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 +20 -2
- package/dist/index.d.ts +20 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +3 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChatCompletion } from 'groq-sdk/resources/chat/completions';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { Theme, EditorProps as EditorProps$1 } from '@monaco-editor/react';
|
|
4
3
|
export * from '@monaco-editor/react';
|
|
4
|
+
import React from 'react';
|
|
5
5
|
|
|
6
6
|
type EditorBuiltInTheme = Theme;
|
|
7
7
|
|
|
@@ -40,6 +40,24 @@ type GroqCompletion = ChatCompletion & {
|
|
|
40
40
|
interface CompletionConstructorParams {
|
|
41
41
|
model: CompletionModelType | undefined;
|
|
42
42
|
}
|
|
43
|
+
interface CompletionRequestParams {
|
|
44
|
+
completionMetadata: CompletionMetadata;
|
|
45
|
+
}
|
|
46
|
+
interface CompletionMetadata {
|
|
47
|
+
language: string;
|
|
48
|
+
framework: FrameworkType | undefined;
|
|
49
|
+
cursorPosition: {
|
|
50
|
+
line: number;
|
|
51
|
+
column: number;
|
|
52
|
+
};
|
|
53
|
+
codeAfterCursor: string;
|
|
54
|
+
codeBeforeCursor: string;
|
|
55
|
+
editorState: {
|
|
56
|
+
completionMode: 'fill-in' | 'extend';
|
|
57
|
+
codeLengthBeforeCursor: number;
|
|
58
|
+
totalCodeLength: number;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
43
61
|
|
|
44
62
|
/**
|
|
45
63
|
* Initializes with configuration options
|
|
@@ -59,7 +77,7 @@ interface CompletionConstructorParams {
|
|
|
59
77
|
declare class Completion {
|
|
60
78
|
private apiKey;
|
|
61
79
|
constructor(apiKey: string, options?: CompletionConstructorParams);
|
|
62
|
-
run(
|
|
80
|
+
run(data: CompletionRequestParams): Promise<GroqCompletion | {
|
|
63
81
|
error: string;
|
|
64
82
|
}>;
|
|
65
83
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChatCompletion } from 'groq-sdk/resources/chat/completions';
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { Theme, EditorProps as EditorProps$1 } from '@monaco-editor/react';
|
|
4
3
|
export * from '@monaco-editor/react';
|
|
4
|
+
import React from 'react';
|
|
5
5
|
|
|
6
6
|
type EditorBuiltInTheme = Theme;
|
|
7
7
|
|
|
@@ -40,6 +40,24 @@ type GroqCompletion = ChatCompletion & {
|
|
|
40
40
|
interface CompletionConstructorParams {
|
|
41
41
|
model: CompletionModelType | undefined;
|
|
42
42
|
}
|
|
43
|
+
interface CompletionRequestParams {
|
|
44
|
+
completionMetadata: CompletionMetadata;
|
|
45
|
+
}
|
|
46
|
+
interface CompletionMetadata {
|
|
47
|
+
language: string;
|
|
48
|
+
framework: FrameworkType | undefined;
|
|
49
|
+
cursorPosition: {
|
|
50
|
+
line: number;
|
|
51
|
+
column: number;
|
|
52
|
+
};
|
|
53
|
+
codeAfterCursor: string;
|
|
54
|
+
codeBeforeCursor: string;
|
|
55
|
+
editorState: {
|
|
56
|
+
completionMode: 'fill-in' | 'extend';
|
|
57
|
+
codeLengthBeforeCursor: number;
|
|
58
|
+
totalCodeLength: number;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
43
61
|
|
|
44
62
|
/**
|
|
45
63
|
* Initializes with configuration options
|
|
@@ -59,7 +77,7 @@ interface CompletionConstructorParams {
|
|
|
59
77
|
declare class Completion {
|
|
60
78
|
private apiKey;
|
|
61
79
|
constructor(apiKey: string, options?: CompletionConstructorParams);
|
|
62
|
-
run(
|
|
80
|
+
run(data: CompletionRequestParams): Promise<GroqCompletion | {
|
|
63
81
|
error: string;
|
|
64
82
|
}>;
|
|
65
83
|
}
|