git-coco 0.2.1 → 0.3.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.
@@ -5,10 +5,35 @@ import { BaseLLMParams } from 'langchain/llms/base';
5
5
  import { AzureOpenAIInput, OpenAIInput, OpenAI } from 'langchain/llms/openai';
6
6
  import { RecursiveCharacterTextSplitter, RecursiveCharacterTextSplitterParams } from 'langchain/text_splitter';
7
7
  import { ConfigurationParameters } from 'openai';
8
- export declare function getModel(fields?: (Partial<OpenAIInput> & Partial<AzureOpenAIInput> & BaseLLMParams & {
8
+ import { BaseCommandOptions } from '../../types';
9
+ /**
10
+ * Get LLM Model Based on Configuration
11
+ * @param fields
12
+ * @param configuration
13
+ * @returns LLM Model
14
+ */
15
+ export declare function getModel(name: string, key: string, fields?: (Partial<OpenAIInput> & Partial<AzureOpenAIInput> & BaseLLMParams & {
9
16
  configuration?: ConfigurationParameters | undefined;
10
17
  }) | undefined, configuration?: ConfigurationParameters | undefined): OpenAI | HuggingFaceInference;
18
+ /**
19
+ * Retrieve appropriate API key based on selected model
20
+ * @param name
21
+ * @param options
22
+ * @returns
23
+ */
24
+ export declare function getModelAPIKey(name: string, options: BaseCommandOptions): string;
25
+ /**
26
+ * Get Recursive Character Text Splitter
27
+ * @param options
28
+ * @returns
29
+ */
11
30
  export declare function getTextSplitter(options?: Partial<RecursiveCharacterTextSplitterParams>): RecursiveCharacterTextSplitter;
31
+ /**
32
+ * Get Summarization Chain
33
+ * @param model
34
+ * @param options
35
+ * @returns
36
+ */
12
37
  export declare function getChain(model: ReturnType<typeof getModel>, options?: SummarizationChainParams): import("langchain/chains").StuffDocumentsChain | import("langchain/chains").MapReduceDocumentsChain | import("langchain/chains").RefineDocumentsChain;
13
38
  type CreatePromptInput = {
14
39
  template?: string;
@@ -16,5 +41,11 @@ type CreatePromptInput = {
16
41
  fallback?: PromptTemplate;
17
42
  };
18
43
  export declare function getPrompt({ template, variables, fallback }: CreatePromptInput): PromptTemplate;
44
+ /**
45
+ * Verify template string contains all required input variables
46
+ * @param text template string
47
+ * @param inputVariables template variables
48
+ * @returns boolean or error message
49
+ */
19
50
  export declare function validatePromptTemplate(text: string, inputVariables: string[]): string | true;
20
51
  export {};
@@ -5,4 +5,4 @@ import { DiffTreeNode } from './createDiffTree';
5
5
  /**
6
6
  * Asynchronously collect diffs for a given node and its children.
7
7
  */
8
- export declare function collectDiffs(node: DiffTreeNode, getFileDiff: (change: FileChange) => Promise<string>, tokenizer: GPT3Tokenizer, logger?: Logger): Promise<DiffNode>;
8
+ export declare function collectDiffs(node: DiffTreeNode, getFileDiff: (change: FileChange) => Promise<string>, tokenizer: GPT3Tokenizer, logger: Logger): Promise<DiffNode>;
@@ -1,5 +1,6 @@
1
1
  import GPT3Tokenizer from 'gpt3-tokenizer';
2
2
  import { DirectoryDiff, DiffNode } from '../../../types';
3
+ import { Logger } from '../../../utils/logger';
3
4
  import { SummarizeContext } from '../../../langchain/chains/summarize';
4
5
  /**
5
6
  * Create groups from a given node info.
@@ -17,8 +18,9 @@ export declare function summarizeDirectoryDiff(directory: DirectoryDiff, { chain
17
18
  declare const defaultOutputCallback: (group: DirectoryDiff) => string;
18
19
  type SummarizeDiffsOptions = {
19
20
  tokenizer: GPT3Tokenizer;
21
+ logger: Logger;
20
22
  maxTokens: number;
21
23
  handleOutput?: typeof defaultOutputCallback;
22
24
  } & SummarizeContext;
23
- export declare function summarizeDiffs(rootDiffNode: DiffNode, { tokenizer, maxTokens, textSplitter, chain, handleOutput, }: SummarizeDiffsOptions): Promise<string>;
25
+ export declare function summarizeDiffs(rootDiffNode: DiffNode, { tokenizer, logger, maxTokens, textSplitter, chain, handleOutput, }: SummarizeDiffsOptions): Promise<string>;
24
26
  export {};
@@ -3,4 +3,4 @@ import { SimpleGit } from 'simple-git';
3
3
  export declare const noResult: ({ git, logger }: {
4
4
  git: SimpleGit;
5
5
  logger: Logger;
6
- }) => Promise<never>;
6
+ }) => Promise<void>;
@@ -1,6 +1,7 @@
1
1
  import GPT3Tokenizer from 'gpt3-tokenizer';
2
2
  import { getModel } from './langchain/utils';
3
3
  import { SimpleGit } from 'simple-git';
4
+ import { Logger } from './utils/logger';
4
5
  export type FileChangeStatus = 'modified' | 'renamed' | 'added' | 'deleted' | 'untracked' | 'unknown';
5
6
  export interface FileChange {
6
7
  summary: string;
@@ -30,5 +31,6 @@ export interface BaseParser {
30
31
  tokenizer: GPT3Tokenizer;
31
32
  model: ReturnType<typeof getModel>;
32
33
  git: SimpleGit;
34
+ logger: Logger;
33
35
  }): Promise<string>;
34
36
  }
package/dist/stats.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <meta charset="UTF-8" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <meta http-equiv="X-UA-Compatible" content="ie=edge" />
8
- <title>Commit-Copilot Rollup Visualizer</title>
8
+ <title>git-coco rollup visualizer</title>
9
9
  <style>
10
10
  :root {
11
11
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
@@ -5285,7 +5285,7 @@ var drawChart = (function (exports) {
5285
5285
  </script>
5286
5286
  <script>
5287
5287
  /*<!--*/
5288
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"name":"lib","children":[{"name":"utils","children":[{"uid":"7909-80","name":"removeUndefined.ts"},{"uid":"7909-102","name":"logger.ts"},{"uid":"7909-104","name":"getPathFromFilePath.ts"},{"uid":"7909-122","name":"getTokenizer.ts"}]},{"name":"config","children":[{"name":"services","children":[{"uid":"7909-82","name":"env.ts"},{"uid":"7909-84","name":"git.ts"},{"uid":"7909-86","name":"ignore.ts"},{"uid":"7909-88","name":"project.ts"},{"uid":"7909-90","name":"xdg.ts"},{"uid":"7909-92","name":"yargs.ts"}]},{"uid":"7909-98","name":"default.ts"},{"uid":"7909-100","name":"index.ts"}]},{"name":"langchain","children":[{"name":"prompts","children":[{"uid":"7909-94","name":"commitDefault.ts"},{"uid":"7909-96","name":"summarize.ts"}]},{"name":"chains","children":[{"uid":"7909-106","name":"summarize.ts"},{"uid":"7909-124","name":"llm.ts"}]},{"uid":"7909-114","name":"utils.ts"}]},{"name":"parsers","children":[{"name":"default","children":[{"name":"utils","children":[{"uid":"7909-108","name":"summarizeDiffs.ts"},{"uid":"7909-110","name":"createDiffTree.ts"},{"uid":"7909-112","name":"collectDiffs.ts"}]},{"uid":"7909-118","name":"index.ts"}]},{"uid":"7909-132","name":"noResult.ts"}]},{"name":"simple-git","children":[{"uid":"7909-116","name":"getDiff.ts"},{"uid":"7909-126","name":"getStatus.ts"},{"uid":"7909-128","name":"getSummaryText.ts"},{"uid":"7909-130","name":"getChanges.ts"},{"uid":"7909-134","name":"createCommit.ts"}]},{"uid":"7909-120","name":"ui.ts"}]},{"uid":"7909-136","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"7909-80":{"renderedLength":258,"gzipLength":0,"brotliLength":141,"metaUid":"7909-79"},"7909-82":{"renderedLength":858,"gzipLength":0,"brotliLength":282,"metaUid":"7909-81"},"7909-84":{"renderedLength":1183,"gzipLength":0,"brotliLength":354,"metaUid":"7909-83"},"7909-86":{"renderedLength":927,"gzipLength":0,"brotliLength":271,"metaUid":"7909-85"},"7909-88":{"renderedLength":367,"gzipLength":0,"brotliLength":172,"metaUid":"7909-87"},"7909-90":{"renderedLength":539,"gzipLength":0,"brotliLength":260,"metaUid":"7909-89"},"7909-92":{"renderedLength":1588,"gzipLength":0,"brotliLength":524,"metaUid":"7909-91"},"7909-94":{"renderedLength":752,"gzipLength":0,"brotliLength":329,"metaUid":"7909-93"},"7909-96":{"renderedLength":369,"gzipLength":0,"brotliLength":200,"metaUid":"7909-95"},"7909-98":{"renderedLength":347,"gzipLength":0,"brotliLength":210,"metaUid":"7909-97"},"7909-100":{"renderedLength":719,"gzipLength":0,"brotliLength":256,"metaUid":"7909-99"},"7909-102":{"renderedLength":1634,"gzipLength":0,"brotliLength":400,"metaUid":"7909-101"},"7909-104":{"renderedLength":256,"gzipLength":0,"brotliLength":151,"metaUid":"7909-103"},"7909-106":{"renderedLength":442,"gzipLength":0,"brotliLength":201,"metaUid":"7909-105"},"7909-108":{"renderedLength":3948,"gzipLength":0,"brotliLength":1183,"metaUid":"7909-107"},"7909-110":{"renderedLength":1262,"gzipLength":0,"brotliLength":380,"metaUid":"7909-109"},"7909-112":{"renderedLength":1199,"gzipLength":0,"brotliLength":428,"metaUid":"7909-111"},"7909-114":{"renderedLength":1374,"gzipLength":0,"brotliLength":559,"metaUid":"7909-113"},"7909-116":{"renderedLength":1586,"gzipLength":0,"brotliLength":527,"metaUid":"7909-115"},"7909-118":{"renderedLength":1143,"gzipLength":0,"brotliLength":468,"metaUid":"7909-117"},"7909-120":{"renderedLength":290,"gzipLength":0,"brotliLength":177,"metaUid":"7909-119"},"7909-122":{"renderedLength":573,"gzipLength":0,"brotliLength":239,"metaUid":"7909-121"},"7909-124":{"renderedLength":238,"gzipLength":0,"brotliLength":141,"metaUid":"7909-123"},"7909-126":{"renderedLength":602,"gzipLength":0,"brotliLength":177,"metaUid":"7909-125"},"7909-128":{"renderedLength":239,"gzipLength":0,"brotliLength":140,"metaUid":"7909-127"},"7909-130":{"renderedLength":2504,"gzipLength":0,"brotliLength":529,"metaUid":"7909-129"},"7909-132":{"renderedLength":1088,"gzipLength":0,"brotliLength":343,"metaUid":"7909-131"},"7909-134":{"renderedLength":87,"gzipLength":0,"brotliLength":71,"metaUid":"7909-133"},"7909-136":{"renderedLength":5706,"gzipLength":0,"brotliLength":1318,"metaUid":"7909-135"}},"nodeMetas":{"7909-79":{"id":"/src/lib/utils/removeUndefined.ts","moduleParts":{"index.js":"7909-80"},"imported":[],"importedBy":[{"uid":"7909-81"}]},"7909-81":{"id":"/src/lib/config/services/env.ts","moduleParts":{"index.js":"7909-82"},"imported":[{"uid":"7909-79"}],"importedBy":[{"uid":"7909-99"}]},"7909-83":{"id":"/src/lib/config/services/git.ts","moduleParts":{"index.js":"7909-84"},"imported":[{"uid":"7909-152"},{"uid":"7909-153"},{"uid":"7909-150"},{"uid":"7909-154"}],"importedBy":[{"uid":"7909-99"}]},"7909-85":{"id":"/src/lib/config/services/ignore.ts","moduleParts":{"index.js":"7909-86"},"imported":[{"uid":"7909-152"}],"importedBy":[{"uid":"7909-99"}]},"7909-87":{"id":"/src/lib/config/services/project.ts","moduleParts":{"index.js":"7909-88"},"imported":[{"uid":"7909-152"}],"importedBy":[{"uid":"7909-99"}]},"7909-89":{"id":"/src/lib/config/services/xdg.ts","moduleParts":{"index.js":"7909-90"},"imported":[{"uid":"7909-152"},{"uid":"7909-150"},{"uid":"7909-153"}],"importedBy":[{"uid":"7909-99"}]},"7909-91":{"id":"/src/lib/config/services/yargs.ts","moduleParts":{"index.js":"7909-92"},"imported":[{"uid":"7909-140"},{"uid":"7909-141"}],"importedBy":[{"uid":"7909-135"},{"uid":"7909-99"}]},"7909-93":{"id":"/src/lib/langchain/prompts/commitDefault.ts","moduleParts":{"index.js":"7909-94"},"imported":[{"uid":"7909-146"}],"importedBy":[{"uid":"7909-135"},{"uid":"7909-97"}]},"7909-95":{"id":"/src/lib/langchain/prompts/summarize.ts","moduleParts":{"index.js":"7909-96"},"imported":[{"uid":"7909-146"}],"importedBy":[{"uid":"7909-117"},{"uid":"7909-97"}]},"7909-97":{"id":"/src/lib/config/default.ts","moduleParts":{"index.js":"7909-98"},"imported":[{"uid":"7909-93"},{"uid":"7909-95"}],"importedBy":[{"uid":"7909-99"}]},"7909-99":{"id":"/src/lib/config/index.ts","moduleParts":{"index.js":"7909-100"},"imported":[{"uid":"7909-81"},{"uid":"7909-83"},{"uid":"7909-85"},{"uid":"7909-87"},{"uid":"7909-89"},{"uid":"7909-91"},{"uid":"7909-97"}],"importedBy":[{"uid":"7909-135"},{"uid":"7909-117"},{"uid":"7909-129"},{"uid":"7909-107"},{"uid":"7909-111"}]},"7909-101":{"id":"/src/lib/utils/logger.ts","moduleParts":{"index.js":"7909-102"},"imported":[{"uid":"7909-139"},{"uid":"7909-143"},{"uid":"7909-144"},{"uid":"7909-145"}],"importedBy":[{"uid":"7909-135"},{"uid":"7909-117"},{"uid":"7909-107"},{"uid":"7909-111"}]},"7909-103":{"id":"/src/lib/utils/getPathFromFilePath.ts","moduleParts":{"index.js":"7909-104"},"imported":[],"importedBy":[{"uid":"7909-107"}]},"7909-105":{"id":"/src/lib/langchain/chains/summarize.ts","moduleParts":{"index.js":"7909-106"},"imported":[{"uid":"7909-157"}],"importedBy":[{"uid":"7909-107"}]},"7909-107":{"id":"/src/lib/parsers/default/utils/summarizeDiffs.ts","moduleParts":{"index.js":"7909-108"},"imported":[{"uid":"7909-155"},{"uid":"7909-101"},{"uid":"7909-99"},{"uid":"7909-103"},{"uid":"7909-105"}],"importedBy":[{"uid":"7909-117"}]},"7909-109":{"id":"/src/lib/parsers/default/utils/createDiffTree.ts","moduleParts":{"index.js":"7909-110"},"imported":[],"importedBy":[{"uid":"7909-117"}]},"7909-111":{"id":"/src/lib/parsers/default/utils/collectDiffs.ts","moduleParts":{"index.js":"7909-112"},"imported":[{"uid":"7909-99"},{"uid":"7909-101"}],"importedBy":[{"uid":"7909-117"}]},"7909-113":{"id":"/src/lib/langchain/utils.ts","moduleParts":{"index.js":"7909-114"},"imported":[{"uid":"7909-146"},{"uid":"7909-147"},{"uid":"7909-148"},{"uid":"7909-149"}],"importedBy":[{"uid":"7909-135"},{"uid":"7909-117"}]},"7909-115":{"id":"/src/lib/simple-git/getDiff.ts","moduleParts":{"index.js":"7909-116"},"imported":[{"uid":"7909-156"}],"importedBy":[{"uid":"7909-117"}]},"7909-117":{"id":"/src/lib/parsers/default/index.ts","moduleParts":{"index.js":"7909-118"},"imported":[{"uid":"7909-99"},{"uid":"7909-107"},{"uid":"7909-101"},{"uid":"7909-109"},{"uid":"7909-111"},{"uid":"7909-113"},{"uid":"7909-95"},{"uid":"7909-115"}],"importedBy":[{"uid":"7909-135"}]},"7909-119":{"id":"/src/lib/ui.ts","moduleParts":{"index.js":"7909-120"},"imported":[{"uid":"7909-139"}],"importedBy":[{"uid":"7909-135"}]},"7909-121":{"id":"/src/lib/utils/getTokenizer.ts","moduleParts":{"index.js":"7909-122"},"imported":[{"uid":"7909-142"}],"importedBy":[{"uid":"7909-135"}]},"7909-123":{"id":"/src/lib/langchain/chains/llm.ts","moduleParts":{"index.js":"7909-124"},"imported":[{"uid":"7909-147"}],"importedBy":[{"uid":"7909-135"}]},"7909-125":{"id":"/src/lib/simple-git/getStatus.ts","moduleParts":{"index.js":"7909-126"},"imported":[],"importedBy":[{"uid":"7909-129"},{"uid":"7909-127"}]},"7909-127":{"id":"/src/lib/simple-git/getSummaryText.ts","moduleParts":{"index.js":"7909-128"},"imported":[{"uid":"7909-125"}],"importedBy":[{"uid":"7909-129"}]},"7909-129":{"id":"/src/lib/simple-git/getChanges.ts","moduleParts":{"index.js":"7909-130"},"imported":[{"uid":"7909-150"},{"uid":"7909-151"},{"uid":"7909-99"},{"uid":"7909-125"},{"uid":"7909-127"}],"importedBy":[{"uid":"7909-135"},{"uid":"7909-131"}]},"7909-131":{"id":"/src/lib/parsers/noResult.ts","moduleParts":{"index.js":"7909-132"},"imported":[{"uid":"7909-129"}],"importedBy":[{"uid":"7909-135"}]},"7909-133":{"id":"/src/lib/simple-git/createCommit.ts","moduleParts":{"index.js":"7909-134"},"imported":[],"importedBy":[{"uid":"7909-135"}]},"7909-135":{"id":"/src/index.ts","moduleParts":{"index.js":"7909-136"},"imported":[{"uid":"7909-137"},{"uid":"7909-99"},{"uid":"7909-117"},{"uid":"7909-119"},{"uid":"7909-91"},{"uid":"7909-121"},{"uid":"7909-101"},{"uid":"7909-93"},{"uid":"7909-113"},{"uid":"7909-123"},{"uid":"7909-131"},{"uid":"7909-129"},{"uid":"7909-133"},{"uid":"7909-138"}],"importedBy":[],"isEntry":true},"7909-137":{"id":"@inquirer/prompts","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-135"}],"isExternal":true},"7909-138":{"id":"simple-git","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-135"}],"isExternal":true},"7909-139":{"id":"chalk","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-119"},{"uid":"7909-101"}],"isExternal":true},"7909-140":{"id":"yargs","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-91"}],"isExternal":true},"7909-141":{"id":"yargs/helpers","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-91"}],"isExternal":true},"7909-142":{"id":"gpt3-tokenizer","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-121"}],"isExternal":true},"7909-143":{"id":"ora","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-101"}],"isExternal":true},"7909-144":{"id":"performance-now","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-101"}],"isExternal":true},"7909-145":{"id":"pretty-ms","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-101"}],"isExternal":true},"7909-146":{"id":"langchain/prompts","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-93"},{"uid":"7909-113"},{"uid":"7909-95"}],"isExternal":true},"7909-147":{"id":"langchain/chains","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-113"},{"uid":"7909-123"}],"isExternal":true},"7909-148":{"id":"langchain/llms/openai","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-113"}],"isExternal":true},"7909-149":{"id":"langchain/text_splitter","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-113"}],"isExternal":true},"7909-150":{"id":"path","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-129"},{"uid":"7909-83"},{"uid":"7909-89"}],"isExternal":true},"7909-151":{"id":"minimatch","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-129"}],"isExternal":true},"7909-152":{"id":"fs","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-83"},{"uid":"7909-85"},{"uid":"7909-87"},{"uid":"7909-89"}],"isExternal":true},"7909-153":{"id":"os","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-83"},{"uid":"7909-89"}],"isExternal":true},"7909-154":{"id":"ini","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-83"}],"isExternal":true},"7909-155":{"id":"p-queue","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-107"}],"isExternal":true},"7909-156":{"id":"diff","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-115"}],"isExternal":true},"7909-157":{"id":"langchain/document","moduleParts":{},"imported":[],"importedBy":[{"uid":"7909-105"}],"isExternal":true}},"env":{"rollup":"3.26.1"},"options":{"gzip":false,"brotli":true,"sourcemap":false}};
5288
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"name":"lib","children":[{"name":"utils","children":[{"uid":"6d95-78","name":"removeUndefined.ts"},{"uid":"6d95-96","name":"getPathFromFilePath.ts"},{"uid":"6d95-114","name":"getTokenizer.ts"},{"uid":"6d95-116","name":"logger.ts"}]},{"name":"config","children":[{"name":"services","children":[{"uid":"6d95-80","name":"env.ts"},{"uid":"6d95-82","name":"git.ts"},{"uid":"6d95-84","name":"ignore.ts"},{"uid":"6d95-86","name":"project.ts"},{"uid":"6d95-88","name":"xdg.ts"}]},{"uid":"6d95-94","name":"loadConfig.ts"}]},{"name":"langchain","children":[{"name":"prompts","children":[{"uid":"6d95-90","name":"commitDefault.ts"},{"uid":"6d95-92","name":"summarize.ts"}]},{"name":"chains","children":[{"uid":"6d95-98","name":"summarize.ts"},{"uid":"6d95-118","name":"llm.ts"}]},{"uid":"6d95-106","name":"utils.ts"}]},{"name":"parsers","children":[{"name":"default","children":[{"name":"utils","children":[{"uid":"6d95-100","name":"summarizeDiffs.ts"},{"uid":"6d95-102","name":"createDiffTree.ts"},{"uid":"6d95-104","name":"collectDiffs.ts"}]},{"uid":"6d95-110","name":"index.ts"}]},{"uid":"6d95-126","name":"noResult.ts"}]},{"name":"simple-git","children":[{"uid":"6d95-108","name":"getDiff.ts"},{"uid":"6d95-120","name":"getStatus.ts"},{"uid":"6d95-122","name":"getSummaryText.ts"},{"uid":"6d95-124","name":"getChanges.ts"},{"uid":"6d95-128","name":"createCommit.ts"}]},{"uid":"6d95-112","name":"ui.ts"}]},{"name":"commands/commit.ts","uid":"6d95-130"},{"uid":"6d95-132","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"6d95-78":{"renderedLength":258,"gzipLength":0,"brotliLength":141,"metaUid":"6d95-77"},"6d95-80":{"renderedLength":990,"gzipLength":0,"brotliLength":352,"metaUid":"6d95-79"},"6d95-82":{"renderedLength":1356,"gzipLength":0,"brotliLength":377,"metaUid":"6d95-81"},"6d95-84":{"renderedLength":927,"gzipLength":0,"brotliLength":271,"metaUid":"6d95-83"},"6d95-86":{"renderedLength":367,"gzipLength":0,"brotliLength":172,"metaUid":"6d95-85"},"6d95-88":{"renderedLength":539,"gzipLength":0,"brotliLength":260,"metaUid":"6d95-87"},"6d95-90":{"renderedLength":752,"gzipLength":0,"brotliLength":329,"metaUid":"6d95-89"},"6d95-92":{"renderedLength":369,"gzipLength":0,"brotliLength":200,"metaUid":"6d95-91"},"6d95-94":{"renderedLength":1037,"gzipLength":0,"brotliLength":412,"metaUid":"6d95-93"},"6d95-96":{"renderedLength":256,"gzipLength":0,"brotliLength":151,"metaUid":"6d95-95"},"6d95-98":{"renderedLength":442,"gzipLength":0,"brotliLength":201,"metaUid":"6d95-97"},"6d95-100":{"renderedLength":3917,"gzipLength":0,"brotliLength":1170,"metaUid":"6d95-99"},"6d95-102":{"renderedLength":1262,"gzipLength":0,"brotliLength":380,"metaUid":"6d95-101"},"6d95-104":{"renderedLength":1186,"gzipLength":0,"brotliLength":414,"metaUid":"6d95-103"},"6d95-106":{"renderedLength":2472,"gzipLength":0,"brotliLength":712,"metaUid":"6d95-105"},"6d95-108":{"renderedLength":1586,"gzipLength":0,"brotliLength":527,"metaUid":"6d95-107"},"6d95-110":{"renderedLength":1127,"gzipLength":0,"brotliLength":460,"metaUid":"6d95-109"},"6d95-112":{"renderedLength":290,"gzipLength":0,"brotliLength":177,"metaUid":"6d95-111"},"6d95-114":{"renderedLength":573,"gzipLength":0,"brotliLength":239,"metaUid":"6d95-113"},"6d95-116":{"renderedLength":1634,"gzipLength":0,"brotliLength":400,"metaUid":"6d95-115"},"6d95-118":{"renderedLength":678,"gzipLength":0,"brotliLength":281,"metaUid":"6d95-117"},"6d95-120":{"renderedLength":602,"gzipLength":0,"brotliLength":177,"metaUid":"6d95-119"},"6d95-122":{"renderedLength":239,"gzipLength":0,"brotliLength":140,"metaUid":"6d95-121"},"6d95-124":{"renderedLength":2533,"gzipLength":0,"brotliLength":541,"metaUid":"6d95-123"},"6d95-126":{"renderedLength":1265,"gzipLength":0,"brotliLength":413,"metaUid":"6d95-125"},"6d95-128":{"renderedLength":87,"gzipLength":0,"brotliLength":71,"metaUid":"6d95-127"},"6d95-130":{"renderedLength":7121,"gzipLength":0,"brotliLength":1606,"metaUid":"6d95-129"},"6d95-132":{"renderedLength":275,"gzipLength":0,"brotliLength":168,"metaUid":"6d95-131"}},"nodeMetas":{"6d95-77":{"id":"/src/lib/utils/removeUndefined.ts","moduleParts":{"index.js":"6d95-78"},"imported":[],"importedBy":[{"uid":"6d95-79"}]},"6d95-79":{"id":"/src/lib/config/services/env.ts","moduleParts":{"index.js":"6d95-80"},"imported":[{"uid":"6d95-77"}],"importedBy":[{"uid":"6d95-93"}]},"6d95-81":{"id":"/src/lib/config/services/git.ts","moduleParts":{"index.js":"6d95-82"},"imported":[{"uid":"6d95-148"},{"uid":"6d95-149"},{"uid":"6d95-146"},{"uid":"6d95-150"}],"importedBy":[{"uid":"6d95-93"}]},"6d95-83":{"id":"/src/lib/config/services/ignore.ts","moduleParts":{"index.js":"6d95-84"},"imported":[{"uid":"6d95-148"}],"importedBy":[{"uid":"6d95-93"}]},"6d95-85":{"id":"/src/lib/config/services/project.ts","moduleParts":{"index.js":"6d95-86"},"imported":[{"uid":"6d95-148"}],"importedBy":[{"uid":"6d95-93"}]},"6d95-87":{"id":"/src/lib/config/services/xdg.ts","moduleParts":{"index.js":"6d95-88"},"imported":[{"uid":"6d95-148"},{"uid":"6d95-146"},{"uid":"6d95-149"}],"importedBy":[{"uid":"6d95-93"}]},"6d95-89":{"id":"/src/lib/langchain/prompts/commitDefault.ts","moduleParts":{"index.js":"6d95-90"},"imported":[{"uid":"6d95-141"}],"importedBy":[{"uid":"6d95-129"},{"uid":"6d95-93"}]},"6d95-91":{"id":"/src/lib/langchain/prompts/summarize.ts","moduleParts":{"index.js":"6d95-92"},"imported":[{"uid":"6d95-141"}],"importedBy":[{"uid":"6d95-93"},{"uid":"6d95-109"}]},"6d95-93":{"id":"/src/lib/config/loadConfig.ts","moduleParts":{"index.js":"6d95-94"},"imported":[{"uid":"6d95-79"},{"uid":"6d95-81"},{"uid":"6d95-83"},{"uid":"6d95-85"},{"uid":"6d95-87"},{"uid":"6d95-89"},{"uid":"6d95-91"}],"importedBy":[{"uid":"6d95-129"},{"uid":"6d95-123"}]},"6d95-95":{"id":"/src/lib/utils/getPathFromFilePath.ts","moduleParts":{"index.js":"6d95-96"},"imported":[],"importedBy":[{"uid":"6d95-99"}]},"6d95-97":{"id":"/src/lib/langchain/chains/summarize.ts","moduleParts":{"index.js":"6d95-98"},"imported":[{"uid":"6d95-153"}],"importedBy":[{"uid":"6d95-99"}]},"6d95-99":{"id":"/src/lib/parsers/default/utils/summarizeDiffs.ts","moduleParts":{"index.js":"6d95-100"},"imported":[{"uid":"6d95-151"},{"uid":"6d95-95"},{"uid":"6d95-97"}],"importedBy":[{"uid":"6d95-109"}]},"6d95-101":{"id":"/src/lib/parsers/default/utils/createDiffTree.ts","moduleParts":{"index.js":"6d95-102"},"imported":[],"importedBy":[{"uid":"6d95-109"}]},"6d95-103":{"id":"/src/lib/parsers/default/utils/collectDiffs.ts","moduleParts":{"index.js":"6d95-104"},"imported":[],"importedBy":[{"uid":"6d95-109"}]},"6d95-105":{"id":"/src/lib/langchain/utils.ts","moduleParts":{"index.js":"6d95-106"},"imported":[{"uid":"6d95-142"},{"uid":"6d95-141"},{"uid":"6d95-143"},{"uid":"6d95-144"},{"uid":"6d95-145"}],"importedBy":[{"uid":"6d95-129"},{"uid":"6d95-109"}]},"6d95-107":{"id":"/src/lib/simple-git/getDiff.ts","moduleParts":{"index.js":"6d95-108"},"imported":[{"uid":"6d95-152"}],"importedBy":[{"uid":"6d95-109"}]},"6d95-109":{"id":"/src/lib/parsers/default/index.ts","moduleParts":{"index.js":"6d95-110"},"imported":[{"uid":"6d95-99"},{"uid":"6d95-101"},{"uid":"6d95-103"},{"uid":"6d95-105"},{"uid":"6d95-91"},{"uid":"6d95-107"}],"importedBy":[{"uid":"6d95-129"}]},"6d95-111":{"id":"/src/lib/ui.ts","moduleParts":{"index.js":"6d95-112"},"imported":[{"uid":"6d95-136"}],"importedBy":[{"uid":"6d95-129"}]},"6d95-113":{"id":"/src/lib/utils/getTokenizer.ts","moduleParts":{"index.js":"6d95-114"},"imported":[{"uid":"6d95-137"}],"importedBy":[{"uid":"6d95-129"}]},"6d95-115":{"id":"/src/lib/utils/logger.ts","moduleParts":{"index.js":"6d95-116"},"imported":[{"uid":"6d95-136"},{"uid":"6d95-138"},{"uid":"6d95-139"},{"uid":"6d95-140"}],"importedBy":[{"uid":"6d95-129"}]},"6d95-117":{"id":"/src/lib/langchain/chains/llm.ts","moduleParts":{"index.js":"6d95-118"},"imported":[{"uid":"6d95-143"}],"importedBy":[{"uid":"6d95-129"}]},"6d95-119":{"id":"/src/lib/simple-git/getStatus.ts","moduleParts":{"index.js":"6d95-120"},"imported":[],"importedBy":[{"uid":"6d95-123"},{"uid":"6d95-121"}]},"6d95-121":{"id":"/src/lib/simple-git/getSummaryText.ts","moduleParts":{"index.js":"6d95-122"},"imported":[{"uid":"6d95-119"}],"importedBy":[{"uid":"6d95-123"}]},"6d95-123":{"id":"/src/lib/simple-git/getChanges.ts","moduleParts":{"index.js":"6d95-124"},"imported":[{"uid":"6d95-146"},{"uid":"6d95-147"},{"uid":"6d95-119"},{"uid":"6d95-121"},{"uid":"6d95-93"}],"importedBy":[{"uid":"6d95-129"},{"uid":"6d95-125"}]},"6d95-125":{"id":"/src/lib/parsers/noResult.ts","moduleParts":{"index.js":"6d95-126"},"imported":[{"uid":"6d95-123"}],"importedBy":[{"uid":"6d95-129"}]},"6d95-127":{"id":"/src/lib/simple-git/createCommit.ts","moduleParts":{"index.js":"6d95-128"},"imported":[],"importedBy":[{"uid":"6d95-129"}]},"6d95-129":{"id":"/src/commands/commit.ts","moduleParts":{"index.js":"6d95-130"},"imported":[{"uid":"6d95-134"},{"uid":"6d95-135"},{"uid":"6d95-93"},{"uid":"6d95-109"},{"uid":"6d95-111"},{"uid":"6d95-113"},{"uid":"6d95-115"},{"uid":"6d95-89"},{"uid":"6d95-105"},{"uid":"6d95-117"},{"uid":"6d95-125"},{"uid":"6d95-123"},{"uid":"6d95-127"}],"importedBy":[{"uid":"6d95-131"}]},"6d95-131":{"id":"/src/index.ts","moduleParts":{"index.js":"6d95-132"},"imported":[{"uid":"6d95-133"},{"uid":"6d95-129"}],"importedBy":[],"isEntry":true},"6d95-133":{"id":"yargs","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-131"}],"isExternal":true},"6d95-134":{"id":"@inquirer/prompts","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-129"}],"isExternal":true},"6d95-135":{"id":"simple-git","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-129"}],"isExternal":true},"6d95-136":{"id":"chalk","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-111"},{"uid":"6d95-115"}],"isExternal":true},"6d95-137":{"id":"gpt3-tokenizer","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-113"}],"isExternal":true},"6d95-138":{"id":"ora","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-115"}],"isExternal":true},"6d95-139":{"id":"performance-now","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-115"}],"isExternal":true},"6d95-140":{"id":"pretty-ms","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-115"}],"isExternal":true},"6d95-141":{"id":"langchain/prompts","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-89"},{"uid":"6d95-105"},{"uid":"6d95-91"}],"isExternal":true},"6d95-142":{"id":"langchain/llms/hf","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-105"}],"isExternal":true},"6d95-143":{"id":"langchain/chains","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-105"},{"uid":"6d95-117"}],"isExternal":true},"6d95-144":{"id":"langchain/llms/openai","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-105"}],"isExternal":true},"6d95-145":{"id":"langchain/text_splitter","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-105"}],"isExternal":true},"6d95-146":{"id":"path","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-123"},{"uid":"6d95-81"},{"uid":"6d95-87"}],"isExternal":true},"6d95-147":{"id":"minimatch","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-123"}],"isExternal":true},"6d95-148":{"id":"fs","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-81"},{"uid":"6d95-83"},{"uid":"6d95-85"},{"uid":"6d95-87"}],"isExternal":true},"6d95-149":{"id":"os","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-81"},{"uid":"6d95-87"}],"isExternal":true},"6d95-150":{"id":"ini","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-81"}],"isExternal":true},"6d95-151":{"id":"p-queue","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-99"}],"isExternal":true},"6d95-152":{"id":"diff","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-107"}],"isExternal":true},"6d95-153":{"id":"langchain/document","moduleParts":{},"imported":[],"importedBy":[{"uid":"6d95-97"}],"isExternal":true}},"env":{"rollup":"3.26.2"},"options":{"gzip":false,"brotli":true,"sourcemap":false}};
5289
5289
 
5290
5290
  const run = () => {
5291
5291
  const width = window.innerWidth;
package/dist/types.d.ts CHANGED
@@ -1,2 +1,10 @@
1
1
  import { Config } from './lib/config/types';
2
+ export interface BaseCommandOptions {
3
+ [x: string]: unknown;
4
+ help: boolean;
5
+ verbose: boolean;
6
+ model: string;
7
+ openAIApiKey: string;
8
+ huggingFaceHubApiKey: string;
9
+ }
2
10
  export { Config };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "git-coco",
3
- "version": "0.2.1",
4
- "description": "zero-effort git commits with commit copilot, or coco for short.",
3
+ "version": "0.3.1",
4
+ "description": "zero-effort git commits with coco.",
5
5
  "author": "gfargo <ghfargo@gmail.com>",
6
6
  "license": "MIT",
7
7
  "main": "dist/index.js",
@@ -55,7 +55,7 @@
55
55
  "eslint-formatter-pretty": "^5.0.0",
56
56
  "jest": "^29.5.0",
57
57
  "jest-mock": "^29.5.0",
58
- "release-it": "^15.11.0",
58
+ "release-it": "^16.1.0",
59
59
  "rimraf": "^5.0.1",
60
60
  "rollup": "^3.26.1",
61
61
  "rollup-plugin-banner2": "^1.2.2",
@@ -77,7 +77,7 @@
77
77
  "diff": "^5.1.0",
78
78
  "gpt3-tokenizer": "^1.1.5",
79
79
  "ini": "^4.1.1",
80
- "langchain": "^0.0.105",
80
+ "langchain": "^0.0.106",
81
81
  "minimatch": "^9.0.3",
82
82
  "openai": "3.3.0",
83
83
  "ora": "5.4.1",
@@ -1,7 +0,0 @@
1
- import { Config } from './types';
2
- /**
3
- * Default Config
4
- *
5
- * @type {Config}
6
- */
7
- export declare const DEFAULT_CONFIG: Config;
@@ -1,25 +0,0 @@
1
- import yargs from 'yargs';
2
- import { Config } from '../types';
3
- /**
4
- * Command line options via yargs
5
- */
6
- export declare const options: Record<string, yargs.Options>;
7
- /**
8
- * Load command line flags via yargs
9
- *
10
- * @returns {Partial<Config>} Updated config
11
- */
12
- export declare const loadArgv: () => {
13
- [x: string]: unknown;
14
- _: (string | number)[];
15
- $0: string;
16
- };
17
- /**
18
- * Load command line flags
19
- *
20
- * Note: Arugments are parsed using yargs.
21
- *
22
- * @param {Config} config
23
- * @returns {Config} Updated config
24
- **/
25
- export declare function loadCmdLineFlags(config: Config): Config;
@@ -1 +0,0 @@
1
- export declare function getTruncatedFilePath(filePath: string, maxLength?: number): string;
@@ -1,3 +0,0 @@
1
- /// <reference types="node" />
2
- import * as fs from 'fs';
3
- export declare const readFile: typeof fs.readFile.__promisify__;