git-coco 0.8.5 → 0.10.0

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 CHANGED
@@ -1,111 +1,39 @@
1
- /// <reference types="yargs" />
2
- import { TiktokenModel, OpenAIInput } from 'langchain/dist/types/openai-types';
3
- import { OllamaInput } from 'langchain/dist/util/ollama';
4
- import { BaseLLMParams } from 'langchain/llms/base';
5
1
  import * as yargs from 'yargs';
6
- import * as langchain_llms_openai from 'langchain/llms/openai';
7
- import { OpenAI } from 'langchain/llms/openai';
8
- import { Ollama } from 'langchain/llms/ollama';
2
+ import * as _langchain_openai from '@langchain/openai';
3
+ import { TiktokenModel, OpenAIInput, ChatOpenAI } from '@langchain/openai';
4
+ import { ChatOllama } from '@langchain/ollama';
5
+ import { OllamaInput } from '@langchain/community/llms/ollama';
6
+ import { BaseLLMParams } from '@langchain/core/language_models/llms';
9
7
  import { SimpleGit } from 'simple-git';
10
8
  import { Color } from 'chalk';
11
9
  import { TiktokenModel as TiktokenModel$1 } from 'tiktoken';
12
10
 
13
- type LLMProvider = 'openai' | 'ollama';
14
- 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';
15
- type LLMModel = TiktokenModel | OllamaModel;
16
- interface BaseLLMService {
17
- provider: LLMProvider;
18
- model: LLMModel;
19
- /**
20
- * The maximum number of tokens per request.
21
- *
22
- * @default 1024
23
- */
24
- tokenLimit?: number;
25
- /**
26
- * The temperature value controls the randomness of the generated output.
27
- * Higher values (e.g., 0.8) make the output more random, while lower values (e.g., 0.2) make it more deterministic.
28
- *
29
- * @default 0.4
30
- */
31
- temperature?: number;
32
- /**
33
- * The maximum number of requests to make concurrently.
34
- *
35
- * @default 6
36
- */
37
- maxConcurrent?: number;
38
- authentication: Authentication;
39
- requestOptions?: {
40
- timeout?: number;
41
- maxRetries?: number;
42
- };
43
- fields?: OpenAIFields | OllamaFields;
44
- }
45
- type Authentication = {
46
- type: 'None';
47
- credentials: undefined;
48
- } | {
49
- type: 'OAuth';
50
- credentials: {
51
- clientId?: string;
52
- clientSecret?: string;
53
- token?: string;
54
- };
55
- } | {
56
- type: 'APIKey';
57
- credentials: {
58
- apiKey: string;
59
- };
60
- };
61
- type OpenAIFields = Partial<OpenAIInput> & BaseLLMParams;
62
- type OllamaFields = Partial<OllamaInput> & BaseLLMParams;
63
- interface OpenAILLMService extends BaseLLMService {
64
- provider: 'openai';
65
- model: TiktokenModel;
66
- fields?: OpenAIFields;
67
- }
68
- interface OllamaLLMService extends BaseLLMService {
69
- provider: 'ollama';
70
- model: OllamaModel;
71
- endpoint: string;
72
- fields?: OllamaFields;
73
- }
74
- type LLMService = OpenAILLMService | OllamaLLMService;
75
- type LLMServiceAlias = 'openai' | 'ollama';
76
-
77
11
  declare const _default$2: {
78
12
  command: string;
79
13
  desc: string;
80
- builder: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
14
+ builder: (yargs: yargs.Argv) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
81
15
  handler: (argv: {
82
16
  [x: string]: unknown;
17
+ interactive: boolean;
83
18
  prompt: string;
84
19
  commit: boolean;
85
20
  summarizePrompt: string;
86
21
  openInEditor: boolean;
87
22
  ignoredFiles: string[];
88
23
  ignoredExtensions: string[];
89
- service: LLMServiceAlias;
90
- openAIApiKey: string;
91
- tokenLimit: number;
92
- interactive: boolean;
93
24
  help: boolean;
94
25
  verbose: boolean;
95
26
  _: (string | number)[];
96
27
  $0: string;
97
28
  } | Promise<{
98
29
  [x: string]: unknown;
30
+ interactive: boolean;
99
31
  prompt: string;
100
32
  commit: boolean;
101
33
  summarizePrompt: string;
102
34
  openInEditor: boolean;
103
35
  ignoredFiles: string[];
104
36
  ignoredExtensions: string[];
105
- service: LLMServiceAlias;
106
- openAIApiKey: string;
107
- tokenLimit: number;
108
- interactive: boolean;
109
37
  help: boolean;
110
38
  verbose: boolean;
111
39
  _: (string | number)[];
@@ -117,7 +45,7 @@ declare const _default$2: {
117
45
  declare const _default$1: {
118
46
  command: string;
119
47
  desc: string;
120
- builder: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
48
+ builder: (yargs: yargs.Argv) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
121
49
  handler: (argv: {
122
50
  [x: string]: unknown;
123
51
  range: string;
@@ -127,9 +55,6 @@ declare const _default$1: {
127
55
  openInEditor: boolean;
128
56
  ignoredFiles: string[];
129
57
  ignoredExtensions: string[];
130
- service: LLMServiceAlias;
131
- openAIApiKey: string;
132
- tokenLimit: number;
133
58
  interactive: boolean;
134
59
  help: boolean;
135
60
  verbose: boolean;
@@ -144,9 +69,6 @@ declare const _default$1: {
144
69
  openInEditor: boolean;
145
70
  ignoredFiles: string[];
146
71
  ignoredExtensions: string[];
147
- service: LLMServiceAlias;
148
- openAIApiKey: string;
149
- tokenLimit: number;
150
72
  interactive: boolean;
151
73
  help: boolean;
152
74
  verbose: boolean;
@@ -156,31 +78,70 @@ declare const _default$1: {
156
78
  options: Record<string, yargs.Options>;
157
79
  };
158
80
 
159
- declare const _default: {
160
- command: string;
161
- desc: string;
162
- builder: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
163
- handler: (argv: {
164
- [x: string]: unknown;
165
- level?: "global" | "project" | undefined;
166
- interactive: boolean;
167
- help: boolean;
168
- verbose: boolean;
169
- _: (string | number)[];
170
- $0: string;
171
- } | Promise<{
172
- [x: string]: unknown;
173
- level?: "global" | "project" | undefined;
174
- interactive: boolean;
175
- help: boolean;
176
- verbose: boolean;
177
- _: (string | number)[];
178
- $0: string;
179
- }>) => Promise<void>;
180
- options: Record<string, yargs.Options>;
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
+ };
181
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;
141
+ };
142
+ type LLMService = OpenAILLMService | OllamaLLMService;
182
143
 
183
- interface BaseConfig {
144
+ type BaseConfig = {
184
145
  /**
185
146
  * The output destination for the generated result.
186
147
  * - 'stdout': Prints the result to the standard output. This is the default behavior.
@@ -231,22 +192,11 @@ interface BaseConfig {
231
192
  * @default 'main'
232
193
  */
233
194
  defaultBranch: string;
234
- }
235
- interface OpenAIAliasConfig extends BaseConfig {
236
- service: 'openai';
237
- model?: OpenAILLMService['model'];
238
- openAIApiKey: string;
239
- }
240
- interface OllamaAliasConfig extends BaseConfig {
241
- service: 'ollama';
242
- model?: OllamaLLMService['model'];
243
- endpoint: string;
244
- }
245
- type ConfigWithServiceAlias = (OpenAIAliasConfig | OllamaAliasConfig) & Partial<BaseCommandOptions>;
195
+ };
246
196
  type ConfigWithServiceObject = BaseConfig & Partial<BaseCommandOptions> & {
247
197
  service: LLMService;
248
198
  };
249
- type Config$1 = ConfigWithServiceAlias | ConfigWithServiceObject;
199
+ type Config$1 = ConfigWithServiceObject;
250
200
 
251
201
  interface BaseArgvOptions {
252
202
  [x: string]: unknown;
@@ -255,11 +205,34 @@ interface BaseArgvOptions {
255
205
  verbose: boolean;
256
206
  }
257
207
  interface BaseCommandOptions extends BaseArgvOptions {
258
- service: LLMServiceAlias;
259
- openAIApiKey: string;
260
- tokenLimit: number;
261
208
  }
262
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
+
263
236
  /**
264
237
  * Get LLM Model Based on Configuration
265
238
  *
@@ -267,7 +240,7 @@ interface BaseCommandOptions extends BaseArgvOptions {
267
240
  * @param configuration
268
241
  * @returns LLM Model
269
242
  */
270
- declare function getLlm(provider: 'openai' | 'ollama', model: TiktokenModel | OllamaModel, config: Config$1): Ollama | OpenAI<langchain_llms_openai.OpenAICallOptions>;
243
+ declare function getLlm(provider: LLMProvider, model: LLMModel, config: Config$1): ChatOllama | ChatOpenAI<_langchain_openai.ChatOpenAICallOptions>;
271
244
 
272
245
  interface LoggerOptions {
273
246
  color?: typeof Color;