git-coco 0.5.0 → 0.6.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 +263 -2
- package/dist/index.esm.mjs +427 -52
- package/dist/index.js +428 -51
- package/package.json +12 -5
- package/dist/commands/changelog/handler.d.ts +0 -3
- package/dist/commands/changelog/index.d.ts +0 -10
- package/dist/commands/changelog/options.d.ts +0 -16
- package/dist/commands/commit/handler.d.ts +0 -3
- package/dist/commands/commit/index.d.ts +0 -10
- package/dist/commands/commit/options.d.ts +0 -15
- package/dist/commands/types.d.ts +0 -14
- package/dist/index.esm.mjs.map +0 -1
- package/dist/lib/config/loadConfig.d.ts +0 -25
- package/dist/lib/config/services/env.d.ts +0 -8
- package/dist/lib/config/services/git.d.ts +0 -8
- package/dist/lib/config/services/ignore.d.ts +0 -15
- package/dist/lib/config/services/project.d.ts +0 -8
- package/dist/lib/config/services/xdg.d.ts +0 -8
- package/dist/lib/config/types.d.ts +0 -83
- package/dist/lib/langchain/chains/summarize.d.ts +0 -11
- package/dist/lib/langchain/executeChain.d.ts +0 -6
- package/dist/lib/langchain/prompts/changelog.d.ts +0 -3
- package/dist/lib/langchain/prompts/commitDefault.d.ts +0 -3
- package/dist/lib/langchain/prompts/summarize.d.ts +0 -3
- package/dist/lib/langchain/utils.d.ts +0 -48
- package/dist/lib/parsers/default/index.d.ts +0 -2
- package/dist/lib/parsers/default/utils/collectDiffs.d.ts +0 -8
- package/dist/lib/parsers/default/utils/createDiffTree.d.ts +0 -13
- package/dist/lib/parsers/default/utils/summarizeDiffs.d.ts +0 -26
- package/dist/lib/parsers/noResult.d.ts +0 -8
- package/dist/lib/simple-git/createCommit.d.ts +0 -2
- package/dist/lib/simple-git/getChanges.d.ts +0 -15
- package/dist/lib/simple-git/getChangesByCommit.d.ts +0 -13
- package/dist/lib/simple-git/getCommitLogCurrentBranch.d.ts +0 -9
- package/dist/lib/simple-git/getCommitLogRange.d.ts +0 -7
- package/dist/lib/simple-git/getCurrentBranchName.d.ts +0 -5
- package/dist/lib/simple-git/getDiff.d.ts +0 -7
- package/dist/lib/simple-git/getDiffFromCommmit.d.ts +0 -10
- package/dist/lib/simple-git/getRepo.d.ts +0 -2
- package/dist/lib/simple-git/getStatus.d.ts +0 -3
- package/dist/lib/simple-git/getSummaryText.d.ts +0 -3
- package/dist/lib/simple-git/helpers.d.ts +0 -6
- package/dist/lib/types.d.ts +0 -47
- package/dist/lib/ui/editPrompt.d.ts +0 -2
- package/dist/lib/ui/editResult.d.ts +0 -2
- package/dist/lib/ui/generateAndReviewLoop.d.ts +0 -16
- package/dist/lib/ui/getUserReviewDecision.d.ts +0 -2
- package/dist/lib/ui/handleResult.d.ts +0 -5
- package/dist/lib/ui/helpers.d.ts +0 -3
- package/dist/lib/ui/logResult.d.ts +0 -1
- package/dist/lib/ui/logSuccess.d.ts +0 -1
- package/dist/lib/utils/getPathFromFilePath.d.ts +0 -6
- package/dist/lib/utils/getTokenizer.d.ts +0 -9
- package/dist/lib/utils/logger.d.ts +0 -23
- package/dist/lib/utils/removeUndefined.d.ts +0 -9
- package/dist/stats.html +0 -5305
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Config } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Default Config
|
|
4
|
-
*
|
|
5
|
-
* @type {Config}
|
|
6
|
-
*/
|
|
7
|
-
export declare const DEFAULT_CONFIG: Config;
|
|
8
|
-
/**
|
|
9
|
-
* Load application config
|
|
10
|
-
*
|
|
11
|
-
* Merge config from multiple sources.
|
|
12
|
-
*
|
|
13
|
-
* \* Order of precedence:
|
|
14
|
-
* \* 1. Command line flags
|
|
15
|
-
* \* 2. Environment variables
|
|
16
|
-
* \* 3. Project config
|
|
17
|
-
* \* 4. Git config
|
|
18
|
-
* \* 5. XDG config
|
|
19
|
-
* \* 6. .gitignore
|
|
20
|
-
* \* 7. .ignore
|
|
21
|
-
* \* 8. Default config
|
|
22
|
-
*
|
|
23
|
-
* @returns {Config} application config
|
|
24
|
-
**/
|
|
25
|
-
export declare function loadConfig(argv?: {}): Config;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Config } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* Load .gitignore in project root
|
|
4
|
-
*
|
|
5
|
-
* @param {Config} config
|
|
6
|
-
* @returns
|
|
7
|
-
*/
|
|
8
|
-
export declare function loadGitignore(config: Config): Config;
|
|
9
|
-
/**
|
|
10
|
-
* Load .ignore in project root
|
|
11
|
-
*
|
|
12
|
-
* @param {Config} config
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
export declare function loadIgnore(config: Config): Config;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
export interface Config {
|
|
2
|
-
/**
|
|
3
|
-
* The LLM model to use for generating results.
|
|
4
|
-
*
|
|
5
|
-
* @default 'openai/gpt-4'
|
|
6
|
-
*
|
|
7
|
-
* @example 'openai/gpt-4'
|
|
8
|
-
* @example 'openai/gpt-3.5-turbo'
|
|
9
|
-
* @example 'huggingface/bigscience/bloom'
|
|
10
|
-
**/
|
|
11
|
-
model: string;
|
|
12
|
-
/**
|
|
13
|
-
* The OpenAI API key.
|
|
14
|
-
*/
|
|
15
|
-
openAIApiKey?: string;
|
|
16
|
-
/**
|
|
17
|
-
* The HuggingFace Hub API key.
|
|
18
|
-
*/
|
|
19
|
-
huggingFaceHubApiKey?: string;
|
|
20
|
-
/**
|
|
21
|
-
* The maximum number of tokens per request.
|
|
22
|
-
*
|
|
23
|
-
* @default 1024
|
|
24
|
-
*/
|
|
25
|
-
tokenLimit?: number;
|
|
26
|
-
/**
|
|
27
|
-
* The prompt text used for generating results.
|
|
28
|
-
*/
|
|
29
|
-
prompt?: string;
|
|
30
|
-
/**
|
|
31
|
-
* The temperature value controls the randomness of the generated output.
|
|
32
|
-
* Higher values (e.g., 0.8) make the output more random, while lower values (e.g., 0.2) make it more deterministic.
|
|
33
|
-
*
|
|
34
|
-
* @default 0.4
|
|
35
|
-
*/
|
|
36
|
-
temperature?: number;
|
|
37
|
-
/**
|
|
38
|
-
* The output destination for the generated result.
|
|
39
|
-
* - 'stdout': Prints the result to the standard output. This is the default behavior.
|
|
40
|
-
* - 'interactive': Provides an interactive prompt for editing the result & committing the changes.
|
|
41
|
-
*
|
|
42
|
-
* @default 'stdout'
|
|
43
|
-
*/
|
|
44
|
-
mode?: 'stdout' | 'interactive';
|
|
45
|
-
/**
|
|
46
|
-
* Enable verbose logging.
|
|
47
|
-
*
|
|
48
|
-
* @default false
|
|
49
|
-
*/
|
|
50
|
-
verbose?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Open the commit message in an editor for editing before proceeding.
|
|
53
|
-
*
|
|
54
|
-
* @default false
|
|
55
|
-
*/
|
|
56
|
-
openInEditor?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* The prompt text used specifically for generating summaries of large files.
|
|
59
|
-
*/
|
|
60
|
-
summarizePrompt?: string;
|
|
61
|
-
/**
|
|
62
|
-
* An array of file paths or patterns to be ignored during processing.
|
|
63
|
-
*
|
|
64
|
-
* Note: This is a list of patterns interpreted by the `minimatch` library.
|
|
65
|
-
* @see https://github.com/isaacs/minimatch
|
|
66
|
-
*
|
|
67
|
-
* @example ['package-lock.json', 'node_modules']
|
|
68
|
-
* @default ['package-lock.json', contents of .gitignore, contents of .ignore]
|
|
69
|
-
*/
|
|
70
|
-
ignoredFiles?: string[];
|
|
71
|
-
/**
|
|
72
|
-
* An array of file extensions to be ignored during processing.
|
|
73
|
-
*
|
|
74
|
-
* @default ['.map', '.lock']
|
|
75
|
-
*/
|
|
76
|
-
ignoredExtensions?: string[];
|
|
77
|
-
/**
|
|
78
|
-
* Default git branch for the repository.
|
|
79
|
-
*
|
|
80
|
-
* @default 'main'
|
|
81
|
-
*/
|
|
82
|
-
defaultBranch?: string;
|
|
83
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MapReduceDocumentsChain, RefineDocumentsChain, StuffDocumentsChain } from 'langchain/chains';
|
|
2
|
-
import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter';
|
|
3
|
-
import { DocumentInput } from 'langchain/document';
|
|
4
|
-
export type SummarizeContext = {
|
|
5
|
-
textSplitter: RecursiveCharacterTextSplitter;
|
|
6
|
-
chain: StuffDocumentsChain | MapReduceDocumentsChain | RefineDocumentsChain;
|
|
7
|
-
options?: {
|
|
8
|
-
returnIntermediateSteps?: boolean;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export declare function summarize(documents: DocumentInput[], { chain, textSplitter, options }: SummarizeContext): Promise<string>;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { HuggingFaceInference } from 'langchain/llms/hf';
|
|
2
|
-
import { PromptTemplate } from 'langchain/prompts';
|
|
3
|
-
import { SummarizationChainParams } from 'langchain/chains';
|
|
4
|
-
import { BaseLLMParams } from 'langchain/llms/base';
|
|
5
|
-
import { AzureOpenAIInput, OpenAIInput, OpenAI } from 'langchain/llms/openai';
|
|
6
|
-
import { RecursiveCharacterTextSplitter, RecursiveCharacterTextSplitterParams } from 'langchain/text_splitter';
|
|
7
|
-
import { BaseCommandOptions } from '../../commands/types';
|
|
8
|
-
/**
|
|
9
|
-
* Get LLM Model Based on Configuration
|
|
10
|
-
* @param fields
|
|
11
|
-
* @param configuration
|
|
12
|
-
* @returns LLM Model
|
|
13
|
-
*/
|
|
14
|
-
export declare function getModel(name: string, key: string, fields?: (Partial<OpenAIInput> & Partial<AzureOpenAIInput> & BaseLLMParams) | undefined): OpenAI | HuggingFaceInference;
|
|
15
|
-
/**
|
|
16
|
-
* Retrieve appropriate API key based on selected model
|
|
17
|
-
* @param name
|
|
18
|
-
* @param options
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
export declare function getApiKeyForModel(name: string, options: BaseCommandOptions): string;
|
|
22
|
-
/**
|
|
23
|
-
* Get Recursive Character Text Splitter
|
|
24
|
-
* @param options
|
|
25
|
-
* @returns
|
|
26
|
-
*/
|
|
27
|
-
export declare function getTextSplitter(options?: Partial<RecursiveCharacterTextSplitterParams>): RecursiveCharacterTextSplitter;
|
|
28
|
-
/**
|
|
29
|
-
* Get Summarization Chain
|
|
30
|
-
* @param model
|
|
31
|
-
* @param options
|
|
32
|
-
* @returns
|
|
33
|
-
*/
|
|
34
|
-
export declare function getChain(model: ReturnType<typeof getModel>, options?: SummarizationChainParams): import("langchain/chains").StuffDocumentsChain | import("langchain/chains").MapReduceDocumentsChain | import("langchain/chains").RefineDocumentsChain;
|
|
35
|
-
type CreatePromptInput = {
|
|
36
|
-
template?: string;
|
|
37
|
-
variables: string[];
|
|
38
|
-
fallback?: PromptTemplate;
|
|
39
|
-
};
|
|
40
|
-
export declare function getPrompt({ template, variables, fallback }: CreatePromptInput): PromptTemplate<any, any>;
|
|
41
|
-
/**
|
|
42
|
-
* Verify template string contains all required input variables
|
|
43
|
-
* @param text template string
|
|
44
|
-
* @param inputVariables template variables
|
|
45
|
-
* @returns boolean or error message
|
|
46
|
-
*/
|
|
47
|
-
export declare function validatePromptTemplate(text: string, inputVariables: string[]): string | true;
|
|
48
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import GPT3Tokenizer from 'gpt3-tokenizer';
|
|
2
|
-
import { DiffNode, FileChange } from '../../../types';
|
|
3
|
-
import { Logger } from '../../../utils/logger';
|
|
4
|
-
import { DiffTreeNode } from './createDiffTree';
|
|
5
|
-
/**
|
|
6
|
-
* Asynchronously collect diffs for a given node and its children.
|
|
7
|
-
*/
|
|
8
|
-
export declare function collectDiffs(node: DiffTreeNode, getFileDiff: (change: FileChange) => Promise<string>, tokenizer: GPT3Tokenizer, logger: Logger): Promise<DiffNode>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FileChange } from '../../../types';
|
|
2
|
-
export declare class DiffTreeNode {
|
|
3
|
-
path: string[];
|
|
4
|
-
files: FileChange[];
|
|
5
|
-
children: Map<string, DiffTreeNode>;
|
|
6
|
-
constructor(path?: string[]);
|
|
7
|
-
addFile(file: FileChange): void;
|
|
8
|
-
addChild(part: string, node: DiffTreeNode): void;
|
|
9
|
-
getChild(part: string): DiffTreeNode | undefined;
|
|
10
|
-
getPath(): string;
|
|
11
|
-
print(indentation?: number): string;
|
|
12
|
-
}
|
|
13
|
-
export declare const createDiffTree: (changes: FileChange[]) => DiffTreeNode;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import GPT3Tokenizer from 'gpt3-tokenizer';
|
|
2
|
-
import { DirectoryDiff, DiffNode } from '../../../types';
|
|
3
|
-
import { Logger } from '../../../utils/logger';
|
|
4
|
-
import { SummarizeContext } from '../../../langchain/chains/summarize';
|
|
5
|
-
/**
|
|
6
|
-
* Create groups from a given node info.
|
|
7
|
-
* @param {DiffNode} node - The node info to start grouping.
|
|
8
|
-
* @returns {DirectoryDiff[]} The groups created.
|
|
9
|
-
*/
|
|
10
|
-
export declare function createDirectoryDiffs(node: DiffNode): DirectoryDiff[];
|
|
11
|
-
type SummarizeDirectoryDiffOptions = {
|
|
12
|
-
tokenizer: GPT3Tokenizer;
|
|
13
|
-
} & SummarizeContext;
|
|
14
|
-
/**
|
|
15
|
-
* Summarize a directory diff asynchronously.
|
|
16
|
-
*/
|
|
17
|
-
export declare function summarizeDirectoryDiff(directory: DirectoryDiff, { chain, textSplitter, tokenizer }: SummarizeDirectoryDiffOptions): Promise<DirectoryDiff>;
|
|
18
|
-
declare const defaultOutputCallback: (group: DirectoryDiff) => string;
|
|
19
|
-
type SummarizeDiffsOptions = {
|
|
20
|
-
tokenizer: GPT3Tokenizer;
|
|
21
|
-
logger: Logger;
|
|
22
|
-
maxTokens: number;
|
|
23
|
-
handleOutput?: typeof defaultOutputCallback;
|
|
24
|
-
} & SummarizeContext;
|
|
25
|
-
export declare function summarizeDiffs(rootDiffNode: DiffNode, { tokenizer, logger, maxTokens, textSplitter, chain, handleOutput, }: SummarizeDiffsOptions): Promise<string>;
|
|
26
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { SimpleGit } from 'simple-git';
|
|
2
|
-
import { FileChange } from '../types';
|
|
3
|
-
export type GetChangesInput = {
|
|
4
|
-
git: SimpleGit;
|
|
5
|
-
options?: {
|
|
6
|
-
ignoredFiles?: string[];
|
|
7
|
-
ignoredExtensions?: string[];
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export type GetChangesResult = {
|
|
11
|
-
staged: FileChange[];
|
|
12
|
-
unstaged?: FileChange[];
|
|
13
|
-
untracked?: FileChange[];
|
|
14
|
-
};
|
|
15
|
-
export declare function getChanges({ git, options }: GetChangesInput): Promise<GetChangesResult>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SimpleGit } from 'simple-git';
|
|
2
|
-
import { FileChange } from '../types';
|
|
3
|
-
import { Logger } from '../utils/logger';
|
|
4
|
-
export type GetChangeByCommitInput = {
|
|
5
|
-
commit: string;
|
|
6
|
-
options: {
|
|
7
|
-
git: SimpleGit;
|
|
8
|
-
logger?: Logger;
|
|
9
|
-
ignoredFiles?: string[];
|
|
10
|
-
ignoredExtensions?: string[];
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export declare function getChangesByCommit({ commit, options: { git, ignoredFiles, ignoredExtensions, }, }: GetChangeByCommitInput): Promise<FileChange[]>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SimpleGit } from 'simple-git';
|
|
2
|
-
import { Logger } from '../utils/logger';
|
|
3
|
-
export type GetCommitLogCurrentBranch = {
|
|
4
|
-
git: SimpleGit;
|
|
5
|
-
logger?: Logger;
|
|
6
|
-
comparisonBranch?: string;
|
|
7
|
-
comparisonRemote?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare function getCommitLogCurrentBranch({ git, logger, comparisonBranch, comparisonRemote, }: GetCommitLogCurrentBranch): Promise<string[]>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SimpleGit } from 'simple-git';
|
|
2
|
-
type GetCommitLogRangeOptions = {
|
|
3
|
-
git: SimpleGit;
|
|
4
|
-
noMerges?: boolean;
|
|
5
|
-
};
|
|
6
|
-
export declare function getCommitLogRange(from: string, to: string, { noMerges, git }: GetCommitLogRangeOptions): Promise<string[]>;
|
|
7
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SimpleGit } from 'simple-git';
|
|
2
|
-
import { FileChange } from '../types';
|
|
3
|
-
import { Logger } from '../utils/logger';
|
|
4
|
-
export declare function getDiff(nodeFile: FileChange, commit: string, { git, logger, }: {
|
|
5
|
-
git: SimpleGit;
|
|
6
|
-
logger: Logger;
|
|
7
|
-
}): Promise<string>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SimpleGit } from 'simple-git';
|
|
2
|
-
/**
|
|
3
|
-
* Fetches the diff for the given commit ID.
|
|
4
|
-
*
|
|
5
|
-
* @param commitId The commit ID for which the diff is to be retrieved.
|
|
6
|
-
* @returns A promise that resolves to the diff of the commit.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getDiffForCommit(commitId: string, { git, }: {
|
|
9
|
-
git: SimpleGit;
|
|
10
|
-
}): Promise<string>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { FileChangeStatus } from '../types';
|
|
2
|
-
import { DiffResultBinaryFile, DiffResultTextFile, FileStatusResult } from 'simple-git';
|
|
3
|
-
export declare function getStatus(file: FileStatusResult | DiffResultTextFile | DiffResultBinaryFile, location?: 'index' | 'working_dir'): FileChangeStatus;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { DiffResultBinaryFile, DiffResultTextFile, FileStatusResult } from 'simple-git';
|
|
2
|
-
import { FileChange } from '../types';
|
|
3
|
-
export declare function getSummaryText(file: FileStatusResult | DiffResultTextFile | DiffResultBinaryFile, change: Partial<FileChange>): string;
|
package/dist/lib/types.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { getModel } from './langchain/utils';
|
|
2
|
-
import { SimpleGit } from 'simple-git';
|
|
3
|
-
import { Logger } from './utils/logger';
|
|
4
|
-
import { getTokenizer } from './utils/getTokenizer';
|
|
5
|
-
export type FileChangeStatus = 'modified' | 'renamed' | 'added' | 'deleted' | 'untracked' | 'unknown';
|
|
6
|
-
export interface FileChange {
|
|
7
|
-
summary: string;
|
|
8
|
-
filePath: string;
|
|
9
|
-
oldFilePath?: string;
|
|
10
|
-
status: FileChangeStatus;
|
|
11
|
-
}
|
|
12
|
-
export interface FileDiff {
|
|
13
|
-
file: string;
|
|
14
|
-
diff: string;
|
|
15
|
-
summary: string;
|
|
16
|
-
tokenCount: number;
|
|
17
|
-
}
|
|
18
|
-
export interface DiffNode {
|
|
19
|
-
path: string;
|
|
20
|
-
diffs: FileDiff[];
|
|
21
|
-
children: DiffNode[];
|
|
22
|
-
}
|
|
23
|
-
export interface DirectoryDiff {
|
|
24
|
-
path: string;
|
|
25
|
-
diffs: FileDiff[];
|
|
26
|
-
summary?: string;
|
|
27
|
-
tokenCount: number;
|
|
28
|
-
}
|
|
29
|
-
export interface BaseParserOptions {
|
|
30
|
-
tokenizer: ReturnType<typeof getTokenizer>;
|
|
31
|
-
model: ReturnType<typeof getModel>;
|
|
32
|
-
git: SimpleGit;
|
|
33
|
-
logger: Logger;
|
|
34
|
-
}
|
|
35
|
-
export interface BaseParserInput {
|
|
36
|
-
options: BaseParserOptions;
|
|
37
|
-
}
|
|
38
|
-
export interface FileChangeParserInput extends BaseParserInput {
|
|
39
|
-
changes: FileChange[];
|
|
40
|
-
commit: '--staged' | string;
|
|
41
|
-
}
|
|
42
|
-
export interface CommitLogParserInput extends BaseParserInput {
|
|
43
|
-
range: {
|
|
44
|
-
from: string;
|
|
45
|
-
to: string;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Logger } from '../utils/logger';
|
|
2
|
-
export type GenerateReviewLoopOptions = {
|
|
3
|
-
interactive: boolean;
|
|
4
|
-
logger: Logger;
|
|
5
|
-
prompt?: string;
|
|
6
|
-
openInEditor?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export type GenerateReviewLoopInput<T> = {
|
|
9
|
-
label: string;
|
|
10
|
-
factory: () => Promise<T[]>;
|
|
11
|
-
parser: (changes: T[], commit: string, options: GenerateReviewLoopOptions) => Promise<string>;
|
|
12
|
-
noResult: (options: GenerateReviewLoopOptions) => Promise<void>;
|
|
13
|
-
agent: (context: string, options: GenerateReviewLoopOptions) => Promise<string>;
|
|
14
|
-
options: GenerateReviewLoopOptions;
|
|
15
|
-
};
|
|
16
|
-
export declare function generateAndReviewLoop<T>({ label, factory, parser, noResult, agent, options, }: GenerateReviewLoopInput<T>): Promise<string>;
|
package/dist/lib/ui/helpers.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function logResult(result: string): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const logSuccess: () => void;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import GPT3NodeTokenizer from "gpt3-tokenizer";
|
|
2
|
-
/**
|
|
3
|
-
* Wrapper around GPT3NodeTokenizer to handle default export.
|
|
4
|
-
*
|
|
5
|
-
* @see https://github.com/botisan-ai/gpt3-tokenizer/issues/18
|
|
6
|
-
*
|
|
7
|
-
* @returns {GPT3NodeTokenizer} The GPT3NodeTokenizer instance.
|
|
8
|
-
*/
|
|
9
|
-
export declare const getTokenizer: () => GPT3NodeTokenizer;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type Color } from 'chalk';
|
|
2
|
-
export interface LoggerOptions {
|
|
3
|
-
color?: typeof Color;
|
|
4
|
-
}
|
|
5
|
-
export interface SpinnerOptions {
|
|
6
|
-
mode?: undefined | 'stop' | 'succeed' | 'warn' | 'fail';
|
|
7
|
-
color?: typeof Color;
|
|
8
|
-
}
|
|
9
|
-
export interface Config {
|
|
10
|
-
verbose?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare class Logger {
|
|
13
|
-
private config;
|
|
14
|
-
private timerStart;
|
|
15
|
-
private spinner;
|
|
16
|
-
constructor(config: Config);
|
|
17
|
-
log(message: string, options?: LoggerOptions): Logger;
|
|
18
|
-
verbose(message: string, options?: LoggerOptions): Logger;
|
|
19
|
-
startTimer(): Logger;
|
|
20
|
-
stopTimer(message?: string, options?: LoggerOptions): Logger;
|
|
21
|
-
startSpinner(message: string, options?: Omit<SpinnerOptions, 'mode'>): Logger;
|
|
22
|
-
stopSpinner(message?: string | undefined, options?: SpinnerOptions): Logger;
|
|
23
|
-
}
|