git-coco 0.9.0 → 0.10.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/index.d.ts +97 -121
- package/dist/index.esm.mjs +5137 -18575
- package/dist/index.js +5155 -18593
- package/package.json +9 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,108 +1,39 @@
|
|
|
1
|
+
import * as yargs from 'yargs';
|
|
1
2
|
import * as _langchain_openai from '@langchain/openai';
|
|
2
|
-
import { TiktokenModel, OpenAIInput,
|
|
3
|
-
import {
|
|
3
|
+
import { TiktokenModel, OpenAIInput, ChatOpenAI } from '@langchain/openai';
|
|
4
|
+
import { ChatOllama } from '@langchain/ollama';
|
|
5
|
+
import { OllamaInput } from '@langchain/community/llms/ollama';
|
|
4
6
|
import { BaseLLMParams } from '@langchain/core/language_models/llms';
|
|
5
|
-
import * as yargs from 'yargs';
|
|
6
7
|
import { SimpleGit } from 'simple-git';
|
|
7
8
|
import { Color } from 'chalk';
|
|
8
9
|
import { TiktokenModel as TiktokenModel$1 } from 'tiktoken';
|
|
9
10
|
|
|
10
|
-
type LLMProvider = 'openai' | 'ollama';
|
|
11
|
-
type OllamaModel = 'neural-chat' | 'aya:8b' | 'aya:35b' | 'mistral' | 'llama2' | 'codellama' | 'codellama:7b' | 'codellama:13b' | 'codellama:34b' | 'codellama:70b' | 'llama2-uncensored' | 'llama2:13b' | 'llama2:70b' | 'llama3' | 'llama3:latest' | 'llama3:text' | 'llama3:70b' | 'llama3:70b-text' | 'orca2' | 'orca2:13b' | 'orca-mini' | 'orca-mini:latest' | 'orca-mini:13b' | 'orca-mini:70b' | 'phi3' | 'phi3:mini' | 'phi3:medium' | 'phi3:medium-128k' | 'qwen2' | 'qwen2:72b' | 'qwen2:72b-text' | 'qwen2:1.5b' | 'qwen2:0.5b' | 'gemma' | 'gemma:7b`' | 'gemma:2b' | 'codegemma' | 'codegemma:7b-code' | 'codegemma:2b';
|
|
12
|
-
type LLMModel = TiktokenModel | OllamaModel;
|
|
13
|
-
interface BaseLLMService {
|
|
14
|
-
provider: LLMProvider;
|
|
15
|
-
model: LLMModel;
|
|
16
|
-
/**
|
|
17
|
-
* The maximum number of tokens per request.
|
|
18
|
-
*
|
|
19
|
-
* @default 1024
|
|
20
|
-
*/
|
|
21
|
-
tokenLimit?: number;
|
|
22
|
-
/**
|
|
23
|
-
* The temperature value controls the randomness of the generated output.
|
|
24
|
-
* Higher values (e.g., 0.8) make the output more random, while lower values (e.g., 0.2) make it more deterministic.
|
|
25
|
-
*
|
|
26
|
-
* @default 0.4
|
|
27
|
-
*/
|
|
28
|
-
temperature?: number;
|
|
29
|
-
/**
|
|
30
|
-
* The maximum number of requests to make concurrently.
|
|
31
|
-
*
|
|
32
|
-
* @default 6
|
|
33
|
-
*/
|
|
34
|
-
maxConcurrent?: number;
|
|
35
|
-
authentication: Authentication;
|
|
36
|
-
requestOptions?: {
|
|
37
|
-
timeout?: number;
|
|
38
|
-
maxRetries?: number;
|
|
39
|
-
};
|
|
40
|
-
fields?: OpenAIFields | OllamaFields;
|
|
41
|
-
}
|
|
42
|
-
type Authentication = {
|
|
43
|
-
type: 'None';
|
|
44
|
-
credentials: undefined;
|
|
45
|
-
} | {
|
|
46
|
-
type: 'OAuth';
|
|
47
|
-
credentials: {
|
|
48
|
-
clientId?: string;
|
|
49
|
-
clientSecret?: string;
|
|
50
|
-
token?: string;
|
|
51
|
-
};
|
|
52
|
-
} | {
|
|
53
|
-
type: 'APIKey';
|
|
54
|
-
credentials: {
|
|
55
|
-
apiKey: string;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
type OpenAIFields = Partial<OpenAIInput> & BaseLLMParams;
|
|
59
|
-
type OllamaFields = Partial<OllamaInput> & BaseLLMParams;
|
|
60
|
-
interface OpenAILLMService extends BaseLLMService {
|
|
61
|
-
provider: 'openai';
|
|
62
|
-
model: TiktokenModel;
|
|
63
|
-
fields?: OpenAIFields;
|
|
64
|
-
}
|
|
65
|
-
interface OllamaLLMService extends BaseLLMService {
|
|
66
|
-
provider: 'ollama';
|
|
67
|
-
model: OllamaModel;
|
|
68
|
-
endpoint: string;
|
|
69
|
-
fields?: OllamaFields;
|
|
70
|
-
}
|
|
71
|
-
type LLMService = OpenAILLMService | OllamaLLMService;
|
|
72
|
-
type LLMServiceAlias = 'openai' | 'ollama';
|
|
73
|
-
|
|
74
11
|
declare const _default$2: {
|
|
75
12
|
command: string;
|
|
76
13
|
desc: string;
|
|
77
14
|
builder: (yargs: yargs.Argv) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
|
|
78
15
|
handler: (argv: {
|
|
79
16
|
[x: string]: unknown;
|
|
17
|
+
interactive: boolean;
|
|
80
18
|
prompt: string;
|
|
81
19
|
commit: boolean;
|
|
82
20
|
summarizePrompt: string;
|
|
83
21
|
openInEditor: boolean;
|
|
84
22
|
ignoredFiles: string[];
|
|
85
23
|
ignoredExtensions: string[];
|
|
86
|
-
service: LLMServiceAlias;
|
|
87
|
-
openAIApiKey: string;
|
|
88
|
-
tokenLimit: number;
|
|
89
|
-
interactive: boolean;
|
|
90
24
|
help: boolean;
|
|
91
25
|
verbose: boolean;
|
|
92
26
|
_: (string | number)[];
|
|
93
27
|
$0: string;
|
|
94
28
|
} | Promise<{
|
|
95
29
|
[x: string]: unknown;
|
|
30
|
+
interactive: boolean;
|
|
96
31
|
prompt: string;
|
|
97
32
|
commit: boolean;
|
|
98
33
|
summarizePrompt: string;
|
|
99
34
|
openInEditor: boolean;
|
|
100
35
|
ignoredFiles: string[];
|
|
101
36
|
ignoredExtensions: string[];
|
|
102
|
-
service: LLMServiceAlias;
|
|
103
|
-
openAIApiKey: string;
|
|
104
|
-
tokenLimit: number;
|
|
105
|
-
interactive: boolean;
|
|
106
37
|
help: boolean;
|
|
107
38
|
verbose: boolean;
|
|
108
39
|
_: (string | number)[];
|
|
@@ -124,9 +55,6 @@ declare const _default$1: {
|
|
|
124
55
|
openInEditor: boolean;
|
|
125
56
|
ignoredFiles: string[];
|
|
126
57
|
ignoredExtensions: string[];
|
|
127
|
-
service: LLMServiceAlias;
|
|
128
|
-
openAIApiKey: string;
|
|
129
|
-
tokenLimit: number;
|
|
130
58
|
interactive: boolean;
|
|
131
59
|
help: boolean;
|
|
132
60
|
verbose: boolean;
|
|
@@ -141,9 +69,6 @@ declare const _default$1: {
|
|
|
141
69
|
openInEditor: boolean;
|
|
142
70
|
ignoredFiles: string[];
|
|
143
71
|
ignoredExtensions: string[];
|
|
144
|
-
service: LLMServiceAlias;
|
|
145
|
-
openAIApiKey: string;
|
|
146
|
-
tokenLimit: number;
|
|
147
72
|
interactive: boolean;
|
|
148
73
|
help: boolean;
|
|
149
74
|
verbose: boolean;
|
|
@@ -153,31 +78,70 @@ declare const _default$1: {
|
|
|
153
78
|
options: Record<string, yargs.Options>;
|
|
154
79
|
};
|
|
155
80
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
81
|
+
type LLMProvider = 'openai' | 'ollama';
|
|
82
|
+
type OllamaModel = 'neural-chat' | 'aya:8b' | 'aya:35b' | 'mistral' | 'llama2' | 'codellama' | 'codellama:7b' | 'codellama:13b' | 'codellama:34b' | 'codellama:70b' | 'llama2-uncensored' | 'llama2:13b' | 'llama2:70b' | 'llama3' | 'llama3:latest' | 'llama3:text' | 'llama3:70b' | 'llama3:70b-text' | 'orca2' | 'orca2:13b' | 'orca-mini' | 'orca-mini:latest' | 'orca-mini:13b' | 'orca-mini:70b' | 'phi3' | 'phi3:mini' | 'phi3:medium' | 'phi3:medium-128k' | 'qwen2' | 'qwen2:72b' | 'qwen2:72b-text' | 'qwen2:1.5b' | 'qwen2:0.5b' | 'gemma' | 'gemma:7b`' | 'gemma:2b' | 'codegemma' | 'codegemma:7b-code' | 'codegemma:2b';
|
|
83
|
+
type LLMModel = TiktokenModel | OllamaModel;
|
|
84
|
+
type BaseLLMService = {
|
|
85
|
+
provider: LLMProvider;
|
|
86
|
+
model: LLMModel;
|
|
87
|
+
/**
|
|
88
|
+
* The maximum number of tokens per request.
|
|
89
|
+
*
|
|
90
|
+
* @default 1024
|
|
91
|
+
*/
|
|
92
|
+
tokenLimit?: number;
|
|
93
|
+
/**
|
|
94
|
+
* The temperature value controls the randomness of the generated output.
|
|
95
|
+
* Higher values (e.g., 0.8) make the output more random, while lower values (e.g., 0.2) make it more deterministic.
|
|
96
|
+
*
|
|
97
|
+
* @default 0.4
|
|
98
|
+
*/
|
|
99
|
+
temperature?: number;
|
|
100
|
+
/**
|
|
101
|
+
* The maximum number of requests to make concurrently.
|
|
102
|
+
*
|
|
103
|
+
* @default 6
|
|
104
|
+
*/
|
|
105
|
+
maxConcurrent?: number;
|
|
106
|
+
authentication: Authentication;
|
|
107
|
+
requestOptions?: {
|
|
108
|
+
timeout?: number;
|
|
109
|
+
maxRetries?: number;
|
|
110
|
+
};
|
|
111
|
+
fields?: OpenAIFields | OllamaFields;
|
|
112
|
+
};
|
|
113
|
+
type Authentication = {
|
|
114
|
+
type: 'None';
|
|
115
|
+
credentials: undefined;
|
|
116
|
+
} | {
|
|
117
|
+
type: 'OAuth';
|
|
118
|
+
credentials: {
|
|
119
|
+
clientId?: string;
|
|
120
|
+
clientSecret?: string;
|
|
121
|
+
token?: string;
|
|
122
|
+
};
|
|
123
|
+
} | {
|
|
124
|
+
type: 'APIKey';
|
|
125
|
+
credentials: {
|
|
126
|
+
apiKey: string;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
type OpenAIFields = Partial<OpenAIInput> & BaseLLMParams;
|
|
130
|
+
type OllamaFields = Partial<OllamaInput> & BaseLLMParams;
|
|
131
|
+
type OpenAILLMService = BaseLLMService & {
|
|
132
|
+
provider: 'openai';
|
|
133
|
+
model: TiktokenModel;
|
|
134
|
+
fields?: OpenAIFields;
|
|
135
|
+
};
|
|
136
|
+
type OllamaLLMService = BaseLLMService & {
|
|
137
|
+
provider: 'ollama';
|
|
138
|
+
model: OllamaModel;
|
|
139
|
+
endpoint: string;
|
|
140
|
+
fields?: OllamaFields;
|
|
178
141
|
};
|
|
142
|
+
type LLMService = OpenAILLMService | OllamaLLMService;
|
|
179
143
|
|
|
180
|
-
|
|
144
|
+
type BaseConfig = {
|
|
181
145
|
/**
|
|
182
146
|
* The output destination for the generated result.
|
|
183
147
|
* - 'stdout': Prints the result to the standard output. This is the default behavior.
|
|
@@ -228,22 +192,11 @@ interface BaseConfig {
|
|
|
228
192
|
* @default 'main'
|
|
229
193
|
*/
|
|
230
194
|
defaultBranch: string;
|
|
231
|
-
}
|
|
232
|
-
interface OpenAIAliasConfig extends BaseConfig {
|
|
233
|
-
service: 'openai';
|
|
234
|
-
model?: OpenAILLMService['model'];
|
|
235
|
-
openAIApiKey: string;
|
|
236
|
-
}
|
|
237
|
-
interface OllamaAliasConfig extends BaseConfig {
|
|
238
|
-
service: 'ollama';
|
|
239
|
-
model?: OllamaLLMService['model'];
|
|
240
|
-
endpoint: string;
|
|
241
|
-
}
|
|
242
|
-
type ConfigWithServiceAlias = (OpenAIAliasConfig | OllamaAliasConfig) & Partial<BaseCommandOptions>;
|
|
195
|
+
};
|
|
243
196
|
type ConfigWithServiceObject = BaseConfig & Partial<BaseCommandOptions> & {
|
|
244
197
|
service: LLMService;
|
|
245
198
|
};
|
|
246
|
-
type Config$1 =
|
|
199
|
+
type Config$1 = ConfigWithServiceObject;
|
|
247
200
|
|
|
248
201
|
interface BaseArgvOptions {
|
|
249
202
|
[x: string]: unknown;
|
|
@@ -252,11 +205,34 @@ interface BaseArgvOptions {
|
|
|
252
205
|
verbose: boolean;
|
|
253
206
|
}
|
|
254
207
|
interface BaseCommandOptions extends BaseArgvOptions {
|
|
255
|
-
service: LLMServiceAlias;
|
|
256
|
-
openAIApiKey: string;
|
|
257
|
-
tokenLimit: number;
|
|
258
208
|
}
|
|
259
209
|
|
|
210
|
+
type InstallationScope = 'global' | 'project';
|
|
211
|
+
|
|
212
|
+
declare const _default: {
|
|
213
|
+
command: string;
|
|
214
|
+
desc: string;
|
|
215
|
+
builder: (yargs: yargs.Argv) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
|
|
216
|
+
handler: (argv: {
|
|
217
|
+
[x: string]: unknown;
|
|
218
|
+
scope?: InstallationScope | undefined;
|
|
219
|
+
interactive: boolean;
|
|
220
|
+
help: boolean;
|
|
221
|
+
verbose: boolean;
|
|
222
|
+
_: (string | number)[];
|
|
223
|
+
$0: string;
|
|
224
|
+
} | Promise<{
|
|
225
|
+
[x: string]: unknown;
|
|
226
|
+
scope?: InstallationScope | undefined;
|
|
227
|
+
interactive: boolean;
|
|
228
|
+
help: boolean;
|
|
229
|
+
verbose: boolean;
|
|
230
|
+
_: (string | number)[];
|
|
231
|
+
$0: string;
|
|
232
|
+
}>) => Promise<void>;
|
|
233
|
+
options: Record<string, yargs.Options>;
|
|
234
|
+
};
|
|
235
|
+
|
|
260
236
|
/**
|
|
261
237
|
* Get LLM Model Based on Configuration
|
|
262
238
|
*
|
|
@@ -264,7 +240,7 @@ interface BaseCommandOptions extends BaseArgvOptions {
|
|
|
264
240
|
* @param configuration
|
|
265
241
|
* @returns LLM Model
|
|
266
242
|
*/
|
|
267
|
-
declare function getLlm(provider:
|
|
243
|
+
declare function getLlm(provider: LLMProvider, model: LLMModel, config: Config$1): ChatOllama | ChatOpenAI<_langchain_openai.ChatOpenAICallOptions>;
|
|
268
244
|
|
|
269
245
|
interface LoggerOptions {
|
|
270
246
|
color?: typeof Color;
|