@limo-labs/deity-adapter-copilot 0.2.0 → 0.2.1
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/adapter.d.ts +31 -25
- package/package.json +1 -1
package/dist/adapter.d.ts
CHANGED
|
@@ -12,30 +12,29 @@ import type {
|
|
|
12
12
|
*/
|
|
13
13
|
export interface CopilotSDKAdapterConfig {
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* Model to use (default: 'gpt-4o')
|
|
16
|
+
* Options: 'gpt-4o', 'claude-opus-4.6', 'o1', 'o1-mini', etc.
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
model?: string;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
* Custom
|
|
22
|
-
*
|
|
21
|
+
* Custom Copilot CLI URL (optional)
|
|
22
|
+
* If not provided, SDK will auto-manage the CLI
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
cliUrl?: string;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
28
|
-
* Defaults to Claude Sonnet 4
|
|
27
|
+
* Callback for streaming response chunks (optional)
|
|
29
28
|
*/
|
|
30
|
-
|
|
29
|
+
onStreamChunk?: (chunk: string) => void;
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
|
-
*
|
|
32
|
+
* Callback for reasoning/thinking chunks (optional)
|
|
34
33
|
*/
|
|
35
|
-
|
|
34
|
+
onReasoningChunk?: (chunk: string) => void;
|
|
36
35
|
|
|
37
36
|
/**
|
|
38
|
-
* Enable debug logging (
|
|
37
|
+
* Enable debug logging (default: false)
|
|
39
38
|
*/
|
|
40
39
|
debug?: boolean;
|
|
41
40
|
}
|
|
@@ -44,10 +43,10 @@ export interface CopilotSDKAdapterConfig {
|
|
|
44
43
|
* GitHub Copilot SDK adapter for Deity framework
|
|
45
44
|
*
|
|
46
45
|
* Features:
|
|
47
|
-
* - Automatic
|
|
48
|
-
* -
|
|
49
|
-
* - Streaming support
|
|
50
|
-
* -
|
|
46
|
+
* - Automatic Copilot CLI management
|
|
47
|
+
* - Native tool calling support via Copilot SDK
|
|
48
|
+
* - Streaming support with callbacks
|
|
49
|
+
* - Disposable session pattern for stateless design
|
|
51
50
|
* - Error handling and retries
|
|
52
51
|
*
|
|
53
52
|
* @example
|
|
@@ -55,17 +54,28 @@ export interface CopilotSDKAdapterConfig {
|
|
|
55
54
|
* import { CopilotSDKAdapter } from '@limo-labs/deity-adapter-copilot';
|
|
56
55
|
*
|
|
57
56
|
* const adapter = new CopilotSDKAdapter({
|
|
58
|
-
*
|
|
59
|
-
*
|
|
57
|
+
* model: 'claude-opus-4.6',
|
|
58
|
+
* onStreamChunk: (chunk) => process.stdout.write(chunk),
|
|
60
59
|
* });
|
|
61
60
|
* ```
|
|
62
61
|
*/
|
|
63
62
|
export declare class CopilotSDKAdapter implements LLMAdapter {
|
|
64
63
|
private client;
|
|
65
|
-
private
|
|
64
|
+
private model;
|
|
65
|
+
private sessionCounter;
|
|
66
|
+
private isInitialized;
|
|
67
|
+
private onStreamChunk?;
|
|
68
|
+
private currentContext?;
|
|
69
|
+
private debugEnabled;
|
|
70
|
+
private toolCallHistory;
|
|
66
71
|
|
|
67
72
|
constructor(config?: CopilotSDKAdapterConfig);
|
|
68
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Initialize the Copilot client
|
|
76
|
+
*/
|
|
77
|
+
initialize(): Promise<void>;
|
|
78
|
+
|
|
69
79
|
/**
|
|
70
80
|
* Generate LLM response
|
|
71
81
|
*/
|
|
@@ -76,11 +86,7 @@ export declare class CopilotSDKAdapter implements LLMAdapter {
|
|
|
76
86
|
): Promise<LLMResponse>;
|
|
77
87
|
|
|
78
88
|
/**
|
|
79
|
-
*
|
|
89
|
+
* Cleanup resources and stop Copilot client
|
|
80
90
|
*/
|
|
81
|
-
|
|
82
|
-
toolName: string,
|
|
83
|
-
args: any,
|
|
84
|
-
availableTools: ToolSpec[]
|
|
85
|
-
): Promise<any>;
|
|
91
|
+
cleanup(): Promise<void>;
|
|
86
92
|
}
|