git-coco 0.6.2 → 0.7.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 +125 -86
- package/dist/index.esm.mjs +1036 -893
- package/dist/index.js +1035 -892
- package/package.json +2 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,123 @@
|
|
|
1
1
|
/// <reference types="yargs" />
|
|
2
2
|
import * as yargs from 'yargs';
|
|
3
|
-
import { Argv } from 'yargs';
|
|
4
3
|
import { HuggingFaceInference } from 'langchain/llms/hf';
|
|
5
4
|
import { BaseLLMParams } from 'langchain/llms/base';
|
|
6
5
|
import { OpenAIInput, AzureOpenAIInput, OpenAI } from 'langchain/llms/openai';
|
|
6
|
+
import { TiktokenModel } from 'langchain/dist/types/openai-types';
|
|
7
7
|
import { SimpleGit } from 'simple-git';
|
|
8
8
|
import { Color } from 'chalk';
|
|
9
|
-
import GPT3NodeTokenizer from 'gpt3-tokenizer';
|
|
10
9
|
|
|
10
|
+
declare const _default$2: {
|
|
11
|
+
command: string;
|
|
12
|
+
desc: string;
|
|
13
|
+
builder: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
|
|
14
|
+
handler: (argv: {
|
|
15
|
+
[x: string]: unknown;
|
|
16
|
+
prompt: string;
|
|
17
|
+
commit: boolean;
|
|
18
|
+
summarizePrompt: string;
|
|
19
|
+
openInEditor: boolean;
|
|
20
|
+
ignoredFiles: string[];
|
|
21
|
+
ignoredExtensions: string[];
|
|
22
|
+
service: "openai/text-davinci-003" | "openai/text-davinci-002" | "openai/text-davinci-001" | "openai/text-curie-001" | "openai/text-babbage-001" | "openai/text-ada-001" | "openai/davinci" | "openai/curie" | "openai/babbage" | "openai/ada" | "openai/code-davinci-002" | "openai/code-davinci-001" | "openai/code-cushman-002" | "openai/code-cushman-001" | "openai/davinci-codex" | "openai/cushman-codex" | "openai/text-davinci-edit-001" | "openai/code-davinci-edit-001" | "openai/text-embedding-ada-002" | "openai/text-similarity-davinci-001" | "openai/text-similarity-curie-001" | "openai/text-similarity-babbage-001" | "openai/text-similarity-ada-001" | "openai/text-search-davinci-doc-001" | "openai/text-search-curie-doc-001" | "openai/text-search-babbage-doc-001" | "openai/text-search-ada-doc-001" | "openai/code-search-babbage-code-001" | "openai/code-search-ada-code-001" | "openai/gpt2" | "openai/gpt-3.5-turbo" | "openai/gpt-3.5-turbo-0301" | "openai/gpt-3.5-turbo-0613" | "openai/gpt-3.5-turbo-16k" | "openai/gpt-3.5-turbo-16k-0613" | "openai/gpt-4" | "openai/gpt-4-0314" | "openai/gpt-4-0613" | "openai/gpt-4-32k" | "openai/gpt-4-32k-0314" | "openai/gpt-4-32k-0613" | "huggingface/text-davinci-003" | "huggingface/text-davinci-002" | "huggingface/text-davinci-001" | "huggingface/text-curie-001" | "huggingface/text-babbage-001" | "huggingface/text-ada-001" | "huggingface/davinci" | "huggingface/curie" | "huggingface/babbage" | "huggingface/ada" | "huggingface/code-davinci-002" | "huggingface/code-davinci-001" | "huggingface/code-cushman-002" | "huggingface/code-cushman-001" | "huggingface/davinci-codex" | "huggingface/cushman-codex" | "huggingface/text-davinci-edit-001" | "huggingface/code-davinci-edit-001" | "huggingface/text-embedding-ada-002" | "huggingface/text-similarity-davinci-001" | "huggingface/text-similarity-curie-001" | "huggingface/text-similarity-babbage-001" | "huggingface/text-similarity-ada-001" | "huggingface/text-search-davinci-doc-001" | "huggingface/text-search-curie-doc-001" | "huggingface/text-search-babbage-doc-001" | "huggingface/text-search-ada-doc-001" | "huggingface/code-search-babbage-code-001" | "huggingface/code-search-ada-code-001" | "huggingface/gpt2" | "huggingface/gpt-3.5-turbo" | "huggingface/gpt-3.5-turbo-0301" | "huggingface/gpt-3.5-turbo-0613" | "huggingface/gpt-3.5-turbo-16k" | "huggingface/gpt-3.5-turbo-16k-0613" | "huggingface/gpt-4" | "huggingface/gpt-4-0314" | "huggingface/gpt-4-0613" | "huggingface/gpt-4-32k" | "huggingface/gpt-4-32k-0314" | "huggingface/gpt-4-32k-0613";
|
|
23
|
+
openAIApiKey: string | undefined;
|
|
24
|
+
huggingFaceHubApiKey: string | undefined;
|
|
25
|
+
tokenLimit: number | undefined;
|
|
26
|
+
interactive: boolean;
|
|
27
|
+
help: boolean;
|
|
28
|
+
verbose: boolean;
|
|
29
|
+
_: (string | number)[];
|
|
30
|
+
$0: string;
|
|
31
|
+
} | Promise<{
|
|
32
|
+
[x: string]: unknown;
|
|
33
|
+
prompt: string;
|
|
34
|
+
commit: boolean;
|
|
35
|
+
summarizePrompt: string;
|
|
36
|
+
openInEditor: boolean;
|
|
37
|
+
ignoredFiles: string[];
|
|
38
|
+
ignoredExtensions: string[];
|
|
39
|
+
service: "openai/text-davinci-003" | "openai/text-davinci-002" | "openai/text-davinci-001" | "openai/text-curie-001" | "openai/text-babbage-001" | "openai/text-ada-001" | "openai/davinci" | "openai/curie" | "openai/babbage" | "openai/ada" | "openai/code-davinci-002" | "openai/code-davinci-001" | "openai/code-cushman-002" | "openai/code-cushman-001" | "openai/davinci-codex" | "openai/cushman-codex" | "openai/text-davinci-edit-001" | "openai/code-davinci-edit-001" | "openai/text-embedding-ada-002" | "openai/text-similarity-davinci-001" | "openai/text-similarity-curie-001" | "openai/text-similarity-babbage-001" | "openai/text-similarity-ada-001" | "openai/text-search-davinci-doc-001" | "openai/text-search-curie-doc-001" | "openai/text-search-babbage-doc-001" | "openai/text-search-ada-doc-001" | "openai/code-search-babbage-code-001" | "openai/code-search-ada-code-001" | "openai/gpt2" | "openai/gpt-3.5-turbo" | "openai/gpt-3.5-turbo-0301" | "openai/gpt-3.5-turbo-0613" | "openai/gpt-3.5-turbo-16k" | "openai/gpt-3.5-turbo-16k-0613" | "openai/gpt-4" | "openai/gpt-4-0314" | "openai/gpt-4-0613" | "openai/gpt-4-32k" | "openai/gpt-4-32k-0314" | "openai/gpt-4-32k-0613" | "huggingface/text-davinci-003" | "huggingface/text-davinci-002" | "huggingface/text-davinci-001" | "huggingface/text-curie-001" | "huggingface/text-babbage-001" | "huggingface/text-ada-001" | "huggingface/davinci" | "huggingface/curie" | "huggingface/babbage" | "huggingface/ada" | "huggingface/code-davinci-002" | "huggingface/code-davinci-001" | "huggingface/code-cushman-002" | "huggingface/code-cushman-001" | "huggingface/davinci-codex" | "huggingface/cushman-codex" | "huggingface/text-davinci-edit-001" | "huggingface/code-davinci-edit-001" | "huggingface/text-embedding-ada-002" | "huggingface/text-similarity-davinci-001" | "huggingface/text-similarity-curie-001" | "huggingface/text-similarity-babbage-001" | "huggingface/text-similarity-ada-001" | "huggingface/text-search-davinci-doc-001" | "huggingface/text-search-curie-doc-001" | "huggingface/text-search-babbage-doc-001" | "huggingface/text-search-ada-doc-001" | "huggingface/code-search-babbage-code-001" | "huggingface/code-search-ada-code-001" | "huggingface/gpt2" | "huggingface/gpt-3.5-turbo" | "huggingface/gpt-3.5-turbo-0301" | "huggingface/gpt-3.5-turbo-0613" | "huggingface/gpt-3.5-turbo-16k" | "huggingface/gpt-3.5-turbo-16k-0613" | "huggingface/gpt-4" | "huggingface/gpt-4-0314" | "huggingface/gpt-4-0613" | "huggingface/gpt-4-32k" | "huggingface/gpt-4-32k-0314" | "huggingface/gpt-4-32k-0613";
|
|
40
|
+
openAIApiKey: string | undefined;
|
|
41
|
+
huggingFaceHubApiKey: string | undefined;
|
|
42
|
+
tokenLimit: number | undefined;
|
|
43
|
+
interactive: boolean;
|
|
44
|
+
help: boolean;
|
|
45
|
+
verbose: boolean;
|
|
46
|
+
_: (string | number)[];
|
|
47
|
+
$0: string;
|
|
48
|
+
}>) => Promise<void>;
|
|
49
|
+
options: Record<string, yargs.Options>;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
declare const _default$1: {
|
|
53
|
+
command: string;
|
|
54
|
+
desc: string;
|
|
55
|
+
builder: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
|
|
56
|
+
handler: (argv: {
|
|
57
|
+
[x: string]: unknown;
|
|
58
|
+
range: string;
|
|
59
|
+
prompt: string;
|
|
60
|
+
commit: boolean;
|
|
61
|
+
summarizePrompt: string;
|
|
62
|
+
openInEditor: boolean;
|
|
63
|
+
ignoredFiles: string[];
|
|
64
|
+
ignoredExtensions: string[];
|
|
65
|
+
service: "openai/text-davinci-003" | "openai/text-davinci-002" | "openai/text-davinci-001" | "openai/text-curie-001" | "openai/text-babbage-001" | "openai/text-ada-001" | "openai/davinci" | "openai/curie" | "openai/babbage" | "openai/ada" | "openai/code-davinci-002" | "openai/code-davinci-001" | "openai/code-cushman-002" | "openai/code-cushman-001" | "openai/davinci-codex" | "openai/cushman-codex" | "openai/text-davinci-edit-001" | "openai/code-davinci-edit-001" | "openai/text-embedding-ada-002" | "openai/text-similarity-davinci-001" | "openai/text-similarity-curie-001" | "openai/text-similarity-babbage-001" | "openai/text-similarity-ada-001" | "openai/text-search-davinci-doc-001" | "openai/text-search-curie-doc-001" | "openai/text-search-babbage-doc-001" | "openai/text-search-ada-doc-001" | "openai/code-search-babbage-code-001" | "openai/code-search-ada-code-001" | "openai/gpt2" | "openai/gpt-3.5-turbo" | "openai/gpt-3.5-turbo-0301" | "openai/gpt-3.5-turbo-0613" | "openai/gpt-3.5-turbo-16k" | "openai/gpt-3.5-turbo-16k-0613" | "openai/gpt-4" | "openai/gpt-4-0314" | "openai/gpt-4-0613" | "openai/gpt-4-32k" | "openai/gpt-4-32k-0314" | "openai/gpt-4-32k-0613" | "huggingface/text-davinci-003" | "huggingface/text-davinci-002" | "huggingface/text-davinci-001" | "huggingface/text-curie-001" | "huggingface/text-babbage-001" | "huggingface/text-ada-001" | "huggingface/davinci" | "huggingface/curie" | "huggingface/babbage" | "huggingface/ada" | "huggingface/code-davinci-002" | "huggingface/code-davinci-001" | "huggingface/code-cushman-002" | "huggingface/code-cushman-001" | "huggingface/davinci-codex" | "huggingface/cushman-codex" | "huggingface/text-davinci-edit-001" | "huggingface/code-davinci-edit-001" | "huggingface/text-embedding-ada-002" | "huggingface/text-similarity-davinci-001" | "huggingface/text-similarity-curie-001" | "huggingface/text-similarity-babbage-001" | "huggingface/text-similarity-ada-001" | "huggingface/text-search-davinci-doc-001" | "huggingface/text-search-curie-doc-001" | "huggingface/text-search-babbage-doc-001" | "huggingface/text-search-ada-doc-001" | "huggingface/code-search-babbage-code-001" | "huggingface/code-search-ada-code-001" | "huggingface/gpt2" | "huggingface/gpt-3.5-turbo" | "huggingface/gpt-3.5-turbo-0301" | "huggingface/gpt-3.5-turbo-0613" | "huggingface/gpt-3.5-turbo-16k" | "huggingface/gpt-3.5-turbo-16k-0613" | "huggingface/gpt-4" | "huggingface/gpt-4-0314" | "huggingface/gpt-4-0613" | "huggingface/gpt-4-32k" | "huggingface/gpt-4-32k-0314" | "huggingface/gpt-4-32k-0613";
|
|
66
|
+
openAIApiKey: string | undefined;
|
|
67
|
+
huggingFaceHubApiKey: string | undefined;
|
|
68
|
+
tokenLimit: number | undefined;
|
|
69
|
+
interactive: boolean;
|
|
70
|
+
help: boolean;
|
|
71
|
+
verbose: boolean;
|
|
72
|
+
_: (string | number)[];
|
|
73
|
+
$0: string;
|
|
74
|
+
} | Promise<{
|
|
75
|
+
[x: string]: unknown;
|
|
76
|
+
range: string;
|
|
77
|
+
prompt: string;
|
|
78
|
+
commit: boolean;
|
|
79
|
+
summarizePrompt: string;
|
|
80
|
+
openInEditor: boolean;
|
|
81
|
+
ignoredFiles: string[];
|
|
82
|
+
ignoredExtensions: string[];
|
|
83
|
+
service: "openai/text-davinci-003" | "openai/text-davinci-002" | "openai/text-davinci-001" | "openai/text-curie-001" | "openai/text-babbage-001" | "openai/text-ada-001" | "openai/davinci" | "openai/curie" | "openai/babbage" | "openai/ada" | "openai/code-davinci-002" | "openai/code-davinci-001" | "openai/code-cushman-002" | "openai/code-cushman-001" | "openai/davinci-codex" | "openai/cushman-codex" | "openai/text-davinci-edit-001" | "openai/code-davinci-edit-001" | "openai/text-embedding-ada-002" | "openai/text-similarity-davinci-001" | "openai/text-similarity-curie-001" | "openai/text-similarity-babbage-001" | "openai/text-similarity-ada-001" | "openai/text-search-davinci-doc-001" | "openai/text-search-curie-doc-001" | "openai/text-search-babbage-doc-001" | "openai/text-search-ada-doc-001" | "openai/code-search-babbage-code-001" | "openai/code-search-ada-code-001" | "openai/gpt2" | "openai/gpt-3.5-turbo" | "openai/gpt-3.5-turbo-0301" | "openai/gpt-3.5-turbo-0613" | "openai/gpt-3.5-turbo-16k" | "openai/gpt-3.5-turbo-16k-0613" | "openai/gpt-4" | "openai/gpt-4-0314" | "openai/gpt-4-0613" | "openai/gpt-4-32k" | "openai/gpt-4-32k-0314" | "openai/gpt-4-32k-0613" | "huggingface/text-davinci-003" | "huggingface/text-davinci-002" | "huggingface/text-davinci-001" | "huggingface/text-curie-001" | "huggingface/text-babbage-001" | "huggingface/text-ada-001" | "huggingface/davinci" | "huggingface/curie" | "huggingface/babbage" | "huggingface/ada" | "huggingface/code-davinci-002" | "huggingface/code-davinci-001" | "huggingface/code-cushman-002" | "huggingface/code-cushman-001" | "huggingface/davinci-codex" | "huggingface/cushman-codex" | "huggingface/text-davinci-edit-001" | "huggingface/code-davinci-edit-001" | "huggingface/text-embedding-ada-002" | "huggingface/text-similarity-davinci-001" | "huggingface/text-similarity-curie-001" | "huggingface/text-similarity-babbage-001" | "huggingface/text-similarity-ada-001" | "huggingface/text-search-davinci-doc-001" | "huggingface/text-search-curie-doc-001" | "huggingface/text-search-babbage-doc-001" | "huggingface/text-search-ada-doc-001" | "huggingface/code-search-babbage-code-001" | "huggingface/code-search-ada-code-001" | "huggingface/gpt2" | "huggingface/gpt-3.5-turbo" | "huggingface/gpt-3.5-turbo-0301" | "huggingface/gpt-3.5-turbo-0613" | "huggingface/gpt-3.5-turbo-16k" | "huggingface/gpt-3.5-turbo-16k-0613" | "huggingface/gpt-4" | "huggingface/gpt-4-0314" | "huggingface/gpt-4-0613" | "huggingface/gpt-4-32k" | "huggingface/gpt-4-32k-0314" | "huggingface/gpt-4-32k-0613";
|
|
84
|
+
openAIApiKey: string | undefined;
|
|
85
|
+
huggingFaceHubApiKey: string | undefined;
|
|
86
|
+
tokenLimit: number | undefined;
|
|
87
|
+
interactive: boolean;
|
|
88
|
+
help: boolean;
|
|
89
|
+
verbose: boolean;
|
|
90
|
+
_: (string | number)[];
|
|
91
|
+
$0: string;
|
|
92
|
+
}>) => Promise<void>;
|
|
93
|
+
options: Record<string, yargs.Options>;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
declare const _default: {
|
|
97
|
+
command: string;
|
|
98
|
+
desc: string;
|
|
99
|
+
builder: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
|
|
100
|
+
handler: (argv: {
|
|
101
|
+
[x: string]: unknown;
|
|
102
|
+
interactive: boolean;
|
|
103
|
+
help: boolean;
|
|
104
|
+
verbose: boolean;
|
|
105
|
+
_: (string | number)[];
|
|
106
|
+
$0: string;
|
|
107
|
+
} | Promise<{
|
|
108
|
+
[x: string]: unknown;
|
|
109
|
+
interactive: boolean;
|
|
110
|
+
help: boolean;
|
|
111
|
+
verbose: boolean;
|
|
112
|
+
_: (string | number)[];
|
|
113
|
+
$0: string;
|
|
114
|
+
}>) => Promise<void>;
|
|
115
|
+
options: Record<string, yargs.Options>;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
type ServiceProvider = "openai" | "huggingface";
|
|
119
|
+
type ServiceModel = TiktokenModel;
|
|
120
|
+
type Service = `${ServiceProvider}/${ServiceModel}`;
|
|
11
121
|
interface Config$1 {
|
|
12
122
|
/**
|
|
13
123
|
* The LLM model to use for generating results.
|
|
@@ -18,7 +128,7 @@ interface Config$1 {
|
|
|
18
128
|
* @example 'openai/gpt-3.5-turbo'
|
|
19
129
|
* @example 'huggingface/bigscience/bloom'
|
|
20
130
|
**/
|
|
21
|
-
|
|
131
|
+
service: Service;
|
|
22
132
|
/**
|
|
23
133
|
* The OpenAI API key.
|
|
24
134
|
*/
|
|
@@ -92,84 +202,13 @@ interface Config$1 {
|
|
|
92
202
|
defaultBranch?: string;
|
|
93
203
|
}
|
|
94
204
|
|
|
95
|
-
interface BaseArgvOptions {
|
|
96
|
-
interactive: boolean;
|
|
97
|
-
help: boolean;
|
|
98
|
-
verbose: boolean;
|
|
99
|
-
}
|
|
100
|
-
interface BaseCommandOptions extends BaseArgvOptions {
|
|
101
|
-
[x: string]: unknown;
|
|
102
|
-
model: string;
|
|
103
|
-
openAIApiKey: string;
|
|
104
|
-
huggingFaceHubApiKey: string;
|
|
105
|
-
tokenLimit: number;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
interface CommitOptions$1 extends BaseCommandOptions {
|
|
109
|
-
prompt: string;
|
|
110
|
-
commit: boolean;
|
|
111
|
-
summarizePrompt: string;
|
|
112
|
-
openInEditor: boolean;
|
|
113
|
-
ignoredFiles: string[];
|
|
114
|
-
ignoredExtensions: string[];
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
declare function handler$2(argv: Argv<CommitOptions$1>['argv']): Promise<void>;
|
|
118
|
-
|
|
119
|
-
declare const _default$2: {
|
|
120
|
-
command: string;
|
|
121
|
-
desc: string;
|
|
122
|
-
builder: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
|
|
123
|
-
handler: typeof handler$2;
|
|
124
|
-
options: Record<string, yargs.Options>;
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
interface ChangelogOptions extends BaseCommandOptions {
|
|
128
|
-
range: string;
|
|
129
|
-
prompt: string;
|
|
130
|
-
commit: boolean;
|
|
131
|
-
summarizePrompt: string;
|
|
132
|
-
openInEditor: boolean;
|
|
133
|
-
ignoredFiles: string[];
|
|
134
|
-
ignoredExtensions: string[];
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
declare function handler$1(argv: Argv<ChangelogOptions>['argv']): Promise<void>;
|
|
138
|
-
|
|
139
|
-
declare const _default$1: {
|
|
140
|
-
command: string;
|
|
141
|
-
desc: string;
|
|
142
|
-
builder: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
|
|
143
|
-
handler: typeof handler$1;
|
|
144
|
-
options: Record<string, yargs.Options>;
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
interface CommitOptions extends BaseCommandOptions {
|
|
148
|
-
prompt: string;
|
|
149
|
-
commit: boolean;
|
|
150
|
-
summarizePrompt: string;
|
|
151
|
-
openInEditor: boolean;
|
|
152
|
-
ignoredFiles: string[];
|
|
153
|
-
ignoredExtensions: string[];
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
declare function handler(argv: Argv<CommitOptions>['argv']): Promise<void>;
|
|
157
|
-
|
|
158
|
-
declare const _default: {
|
|
159
|
-
command: string;
|
|
160
|
-
desc: string;
|
|
161
|
-
builder: (yargs: yargs.Argv<{}>) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
|
|
162
|
-
handler: typeof handler;
|
|
163
|
-
options: Record<string, yargs.Options>;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
205
|
/**
|
|
167
206
|
* Get LLM Model Based on Configuration
|
|
168
207
|
* @param fields
|
|
169
208
|
* @param configuration
|
|
170
209
|
* @returns LLM Model
|
|
171
210
|
*/
|
|
172
|
-
declare function
|
|
211
|
+
declare function getLlm(service: Config$1['service'], key: string, fields?: (Partial<OpenAIInput> & Partial<AzureOpenAIInput> & BaseLLMParams) | undefined): OpenAI | HuggingFaceInference;
|
|
173
212
|
|
|
174
213
|
interface LoggerOptions {
|
|
175
214
|
color?: typeof Color;
|
|
@@ -194,14 +233,8 @@ declare class Logger {
|
|
|
194
233
|
stopSpinner(message?: string | undefined, options?: SpinnerOptions): Logger;
|
|
195
234
|
}
|
|
196
235
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
*
|
|
200
|
-
* @see https://github.com/botisan-ai/gpt3-tokenizer/issues/18
|
|
201
|
-
*
|
|
202
|
-
* @returns {GPT3NodeTokenizer} The GPT3NodeTokenizer instance.
|
|
203
|
-
*/
|
|
204
|
-
declare const getTokenizer: () => GPT3NodeTokenizer;
|
|
236
|
+
type TokenCounter = Awaited<ReturnType<typeof getTokenCounter>>;
|
|
237
|
+
declare const getTokenCounter: (modelName: ServiceModel) => Promise<(text: string) => number>;
|
|
205
238
|
|
|
206
239
|
type FileChangeStatus = 'modified' | 'renamed' | 'added' | 'deleted' | 'untracked' | 'unknown';
|
|
207
240
|
interface FileChange {
|
|
@@ -228,8 +261,8 @@ interface DirectoryDiff {
|
|
|
228
261
|
tokenCount: number;
|
|
229
262
|
}
|
|
230
263
|
interface BaseParserOptions {
|
|
231
|
-
tokenizer:
|
|
232
|
-
|
|
264
|
+
tokenizer: TokenCounter;
|
|
265
|
+
llm: ReturnType<typeof getLlm>;
|
|
233
266
|
git: SimpleGit;
|
|
234
267
|
logger: Logger;
|
|
235
268
|
}
|
|
@@ -246,10 +279,16 @@ interface CommitLogParserInput extends BaseParserInput {
|
|
|
246
279
|
to: string;
|
|
247
280
|
};
|
|
248
281
|
}
|
|
282
|
+
type CommandHandler<T> = (argv: T, logger: Logger) => Promise<void>;
|
|
283
|
+
type ConfirmMessageCallback = (path: string) => string;
|
|
284
|
+
type ConfirmMessage = string | ConfirmMessageCallback;
|
|
249
285
|
|
|
250
286
|
type types_d_BaseParserInput = BaseParserInput;
|
|
251
287
|
type types_d_BaseParserOptions = BaseParserOptions;
|
|
288
|
+
type types_d_CommandHandler<T> = CommandHandler<T>;
|
|
252
289
|
type types_d_CommitLogParserInput = CommitLogParserInput;
|
|
290
|
+
type types_d_ConfirmMessage = ConfirmMessage;
|
|
291
|
+
type types_d_ConfirmMessageCallback = ConfirmMessageCallback;
|
|
253
292
|
type types_d_DiffNode = DiffNode;
|
|
254
293
|
type types_d_DirectoryDiff = DirectoryDiff;
|
|
255
294
|
type types_d_FileChange = FileChange;
|
|
@@ -257,7 +296,7 @@ type types_d_FileChangeParserInput = FileChangeParserInput;
|
|
|
257
296
|
type types_d_FileChangeStatus = FileChangeStatus;
|
|
258
297
|
type types_d_FileDiff = FileDiff;
|
|
259
298
|
declare namespace types_d {
|
|
260
|
-
export type { types_d_BaseParserInput as BaseParserInput, types_d_BaseParserOptions as BaseParserOptions, types_d_CommitLogParserInput as CommitLogParserInput, types_d_DiffNode as DiffNode, types_d_DirectoryDiff as DirectoryDiff, types_d_FileChange as FileChange, types_d_FileChangeParserInput as FileChangeParserInput, types_d_FileChangeStatus as FileChangeStatus, types_d_FileDiff as FileDiff };
|
|
299
|
+
export type { types_d_BaseParserInput as BaseParserInput, types_d_BaseParserOptions as BaseParserOptions, types_d_CommandHandler as CommandHandler, types_d_CommitLogParserInput as CommitLogParserInput, types_d_ConfirmMessage as ConfirmMessage, types_d_ConfirmMessageCallback as ConfirmMessageCallback, types_d_DiffNode as DiffNode, types_d_DirectoryDiff as DirectoryDiff, types_d_FileChange as FileChange, types_d_FileChangeParserInput as FileChangeParserInput, types_d_FileChangeStatus as FileChangeStatus, types_d_FileDiff as FileDiff };
|
|
261
300
|
}
|
|
262
301
|
|
|
263
302
|
export { type Config$1 as Config, _default$1 as changelog, _default$2 as commit, _default as init, types_d as types };
|