git-coco 0.18.0 → 0.18.2

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
@@ -11,10 +11,14 @@ import { Color } from 'chalk';
11
11
  import { TiktokenModel as TiktokenModel$1 } from 'tiktoken';
12
12
 
13
13
  type LLMProvider = 'openai' | 'ollama' | 'anthropic';
14
+ type OpenAIModel = TiktokenModel | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano';
14
15
  type AnthropicModel = 'claude-sonnet-4-0' | 'claude-3-7-sonnet-latest' | 'claude-3-5-haiku-latest' | 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307';
15
16
  type OllamaModel = 'deepseek-r1:1.5b' | 'deepseek-r1:8b' | 'deepseek-r1:32b' | 'codegemma:2b' | 'codegemma:7b-code' | 'codegemma' | 'codellama:13b' | 'codellama:34b' | 'codellama:70b' | 'codellama:7b' | 'codellama:instruct' | 'codellama:latest' | 'codellama' | 'gemma:2b' | 'gemma:7b' | 'gemma:latest' | 'gemma' | 'llama2:13b' | 'llama2:70b' | 'llama2:chat' | 'llama2:latest' | 'llama2:text' | 'llama2' | 'llama3:70b-text' | 'llama3:70b' | 'llama3:latest' | 'llama3:text' | 'llama3.1:70b' | 'llama3.1:8b' | 'llama3.1:latest' | 'llama3.2' | 'llama3.2:latest' | 'llama3.2:1b' | 'llama3.2:3b' | 'llama3' | 'llava-llama3:latest' | 'dolphin-llama3:latest' | 'dolphin-llama3:8b' | 'dolphin-llama3:70b' | 'mistral:7b' | 'mistral:latest' | 'mistral:text' | 'mistral' | 'phi3:14b' | 'phi3:3.8b' | 'phi3:instruct' | 'phi3:medium-128k' | 'phi3:medium-4k' | 'phi3:medium' | 'phi3' | 'qwen2:0.5b' | 'qwen2:1.5b' | 'qwen2:72b-text' | 'qwen2:72b' | 'qwen2' | 'qwen2.5-coder:latest' | 'qwen2.5-coder:0.5b' | 'qwen2.5-coder:1.5b' | 'qwen2.5-coder:3b' | 'qwen2.5-coder:7b' | 'qwen2.5-coder:14b' | 'qwen2.5-coder:32b';
16
- type LLMModel = TiktokenModel | OllamaModel | AnthropicModel;
17
+ type LLMModel = OpenAIModel | OllamaModel | AnthropicModel;
17
18
  type BaseLLMService = {
19
+ /**
20
+ * @additionalProperties true
21
+ */
18
22
  provider: LLMProvider;
19
23
  model: LLMModel;
20
24
  /**
@@ -68,7 +72,7 @@ type OpenAIFields = Partial<OpenAIInput> & BaseLLMParams;
68
72
  type OllamaFields = Partial<OllamaInput> & BaseLLMParams;
69
73
  type OpenAILLMService = BaseLLMService & {
70
74
  provider: 'openai';
71
- model: TiktokenModel;
75
+ model: OpenAIModel;
72
76
  fields?: OpenAIFields;
73
77
  };
74
78
  type OllamaLLMService = BaseLLMService & {
@@ -46,7 +46,7 @@ import * as readline from 'readline';
46
46
  /**
47
47
  * Current build version from package.json
48
48
  */
49
- const BUILD_VERSION = "0.18.0";
49
+ const BUILD_VERSION = "0.18.2";
50
50
 
51
51
  const isInteractive = (config) => {
52
52
  return config?.mode === 'interactive' || !!config?.interactive;
@@ -345,7 +345,7 @@ function getDefaultServiceApiKey(config) {
345
345
  }
346
346
  const DEFAULT_OPENAI_LLM_SERVICE = {
347
347
  provider: 'openai',
348
- model: 'gpt-4o',
348
+ model: 'gpt-4o-mini',
349
349
  tokenLimit: 2024,
350
350
  temperature: 0.32,
351
351
  authentication: {
@@ -619,28 +619,37 @@ function loadGitConfig(config) {
619
619
  let service = config.service;
620
620
  if (gitConfigParsed.coco) {
621
621
  service = {
622
- provider: gitConfigParsed.coco?.['service.provider'],
623
- model: gitConfigParsed.coco?.['service.model'],
622
+ provider: gitConfigParsed.coco?.serviceProvider,
623
+ model: gitConfigParsed.coco?.serviceModel,
624
624
  authentication: {
625
625
  type: 'APIKey',
626
626
  credentials: {
627
- apiKey: gitConfigParsed.coco?.['service.apiKey'],
627
+ apiKey: gitConfigParsed.coco?.serviceApiKey,
628
628
  },
629
629
  },
630
630
  requestOptions: {
631
- timeout: Number(gitConfigParsed.coco?.['service.requestOptions.timeout']),
632
- maxRetries: Number(gitConfigParsed.coco?.['service.requestOptions.maxRetries']),
631
+ timeout: Number(gitConfigParsed.coco?.serviceRequestOptionsTimeout),
632
+ maxRetries: Number(gitConfigParsed.coco?.serviceRequestOptionsMaxRetries),
633
633
  },
634
- endpoint: gitConfigParsed.coco?.['service.endpoint'],
635
- fields: gitConfigParsed.coco?.['service.fields']
636
- ? JSON.parse(gitConfigParsed.coco?.['service.fields'])
634
+ endpoint: gitConfigParsed.coco?.serviceEndpoint,
635
+ fields: gitConfigParsed.coco?.serviceFields
636
+ ? JSON.parse(gitConfigParsed.coco?.serviceFields)
637
637
  : undefined,
638
638
  };
639
639
  }
640
640
  config = {
641
641
  ...config,
642
- ...gitConfigParsed.coco,
643
642
  service: service,
643
+ prompt: gitConfigParsed.coco?.prompt || config.prompt,
644
+ mode: gitConfigParsed.coco?.mode || config.mode,
645
+ summarizePrompt: gitConfigParsed.coco?.summarizePrompt || config.summarizePrompt,
646
+ ignoredFiles: gitConfigParsed.coco?.ignoredFiles || config.ignoredFiles,
647
+ ignoredExtensions: gitConfigParsed.coco?.ignoredExtensions || config.ignoredExtensions,
648
+ defaultBranch: gitConfigParsed.coco?.defaultBranch || config.defaultBranch,
649
+ verbose: gitConfigParsed.coco?.verbose || config.verbose,
650
+ conventionalCommits: gitConfigParsed.coco?.conventionalCommits || config.conventionalCommits,
651
+ openInEditor: gitConfigParsed.coco?.openInEditor || config.openInEditor,
652
+ includeBranchName: gitConfigParsed.coco?.includeBranchName || config.includeBranchName,
644
653
  };
645
654
  }
646
655
  return removeUndefined(config);
@@ -662,25 +671,25 @@ const appendToGitConfig = async (filePath, config) => {
662
671
  const value = config[key];
663
672
  if (key === 'service') {
664
673
  const service = value;
665
- contentLines.push(`\tservice.provider = ${service.provider}`);
666
- contentLines.push(`\tservice.model = ${service.model}`);
674
+ contentLines.push(` serviceProvider = ${service.provider}`);
675
+ contentLines.push(` serviceModel = ${service.model}`);
667
676
  if (service.authentication.type === 'APIKey') {
668
- contentLines.push(`\tservice.apiKey = ${service.authentication.credentials.apiKey}`);
677
+ contentLines.push(` serviceApiKey = ${service.authentication.credentials.apiKey}`);
669
678
  }
670
679
  if (service.requestOptions?.timeout) {
671
- contentLines.push(`\tservice.requestOptions.timeout = ${service.requestOptions.timeout}`);
680
+ contentLines.push(` serviceRequestOptionsTimeout = ${service.requestOptions.timeout}`);
672
681
  }
673
682
  if (service.requestOptions?.maxRetries) {
674
- contentLines.push(`\tservice.requestOptions.maxRetries = ${service.requestOptions.maxRetries}`);
683
+ contentLines.push(` serviceRequestOptionsMaxRetries = ${service.requestOptions.maxRetries}`);
675
684
  }
676
685
  if (service.provider === 'ollama') {
677
686
  const ollamaService = service;
678
687
  if (ollamaService.endpoint) {
679
- contentLines.push(` service.endpoint = ${ollamaService.endpoint}`);
688
+ contentLines.push(` serviceEndpoint = ${ollamaService.endpoint}`);
680
689
  }
681
690
  }
682
691
  if (service.fields) {
683
- contentLines.push(`\tservice.fields = ${JSON.stringify(service.fields)}`);
692
+ contentLines.push(` serviceFields = ${JSON.stringify(service.fields)}`);
684
693
  }
685
694
  }
686
695
  else if (typeof value === 'string' && value.includes('\n')) {
@@ -1135,65 +1144,7 @@ const schema$1 = {
1135
1144
  "LLMModel": {
1136
1145
  "anyOf": [
1137
1146
  {
1138
- "type": "string",
1139
- "enum": [
1140
- "davinci-002",
1141
- "babbage-002",
1142
- "text-davinci-003",
1143
- "text-davinci-002",
1144
- "text-davinci-001",
1145
- "text-curie-001",
1146
- "text-babbage-001",
1147
- "text-ada-001",
1148
- "davinci",
1149
- "curie",
1150
- "babbage",
1151
- "ada",
1152
- "code-davinci-002",
1153
- "code-davinci-001",
1154
- "code-cushman-002",
1155
- "code-cushman-001",
1156
- "davinci-codex",
1157
- "cushman-codex",
1158
- "text-davinci-edit-001",
1159
- "code-davinci-edit-001",
1160
- "text-embedding-ada-002",
1161
- "text-similarity-davinci-001",
1162
- "text-similarity-curie-001",
1163
- "text-similarity-babbage-001",
1164
- "text-similarity-ada-001",
1165
- "text-search-davinci-doc-001",
1166
- "text-search-curie-doc-001",
1167
- "text-search-babbage-doc-001",
1168
- "text-search-ada-doc-001",
1169
- "code-search-babbage-code-001",
1170
- "code-search-ada-code-001",
1171
- "gpt2",
1172
- "gpt-3.5-turbo",
1173
- "gpt-35-turbo",
1174
- "gpt-3.5-turbo-0301",
1175
- "gpt-3.5-turbo-0613",
1176
- "gpt-3.5-turbo-1106",
1177
- "gpt-3.5-turbo-0125",
1178
- "gpt-3.5-turbo-16k",
1179
- "gpt-3.5-turbo-16k-0613",
1180
- "gpt-3.5-turbo-instruct",
1181
- "gpt-3.5-turbo-instruct-0914",
1182
- "gpt-4",
1183
- "gpt-4-0314",
1184
- "gpt-4-0613",
1185
- "gpt-4-32k",
1186
- "gpt-4-32k-0314",
1187
- "gpt-4-32k-0613",
1188
- "gpt-4-turbo",
1189
- "gpt-4-turbo-2024-04-09",
1190
- "gpt-4-turbo-preview",
1191
- "gpt-4-1106-preview",
1192
- "gpt-4-0125-preview",
1193
- "gpt-4-vision-preview",
1194
- "gpt-4o",
1195
- "gpt-4o-2024-05-13"
1196
- ]
1147
+ "$ref": "#/definitions/OpenAIModel"
1197
1148
  },
1198
1149
  {
1199
1150
  "$ref": "#/definitions/OllamaModel"
@@ -1203,6 +1154,71 @@ const schema$1 = {
1203
1154
  }
1204
1155
  ]
1205
1156
  },
1157
+ "OpenAIModel": {
1158
+ "type": "string",
1159
+ "enum": [
1160
+ "davinci-002",
1161
+ "babbage-002",
1162
+ "text-davinci-003",
1163
+ "text-davinci-002",
1164
+ "text-davinci-001",
1165
+ "text-curie-001",
1166
+ "text-babbage-001",
1167
+ "text-ada-001",
1168
+ "davinci",
1169
+ "curie",
1170
+ "babbage",
1171
+ "ada",
1172
+ "code-davinci-002",
1173
+ "code-davinci-001",
1174
+ "code-cushman-002",
1175
+ "code-cushman-001",
1176
+ "davinci-codex",
1177
+ "cushman-codex",
1178
+ "text-davinci-edit-001",
1179
+ "code-davinci-edit-001",
1180
+ "text-embedding-ada-002",
1181
+ "text-similarity-davinci-001",
1182
+ "text-similarity-curie-001",
1183
+ "text-similarity-babbage-001",
1184
+ "text-similarity-ada-001",
1185
+ "text-search-davinci-doc-001",
1186
+ "text-search-curie-doc-001",
1187
+ "text-search-babbage-doc-001",
1188
+ "text-search-ada-doc-001",
1189
+ "code-search-babbage-code-001",
1190
+ "code-search-ada-code-001",
1191
+ "gpt2",
1192
+ "gpt-3.5-turbo",
1193
+ "gpt-35-turbo",
1194
+ "gpt-3.5-turbo-0301",
1195
+ "gpt-3.5-turbo-0613",
1196
+ "gpt-3.5-turbo-1106",
1197
+ "gpt-3.5-turbo-0125",
1198
+ "gpt-3.5-turbo-16k",
1199
+ "gpt-3.5-turbo-16k-0613",
1200
+ "gpt-3.5-turbo-instruct",
1201
+ "gpt-3.5-turbo-instruct-0914",
1202
+ "gpt-4",
1203
+ "gpt-4-0314",
1204
+ "gpt-4-0613",
1205
+ "gpt-4-32k",
1206
+ "gpt-4-32k-0314",
1207
+ "gpt-4-32k-0613",
1208
+ "gpt-4-turbo",
1209
+ "gpt-4-turbo-2024-04-09",
1210
+ "gpt-4-turbo-preview",
1211
+ "gpt-4-1106-preview",
1212
+ "gpt-4-0125-preview",
1213
+ "gpt-4-vision-preview",
1214
+ "gpt-4o",
1215
+ "gpt-4o-2024-05-13",
1216
+ "gpt-4o-mini",
1217
+ "gpt-4.1",
1218
+ "gpt-4.1-mini",
1219
+ "gpt-4.1-nano"
1220
+ ]
1221
+ },
1206
1222
  "OllamaModel": {
1207
1223
  "type": "string",
1208
1224
  "enum": [
@@ -6119,7 +6135,6 @@ function getPrompt({ template, variables, fallback }) {
6119
6135
  * @throws LangChainExecutionError if the chain execution fails or returns empty results
6120
6136
  */
6121
6137
  const executeChain = async ({ llm, prompt, variables, parser }) => {
6122
- // Validate all required parameters
6123
6138
  validateRequired(llm, 'llm', 'executeChain');
6124
6139
  validateRequired(prompt, 'prompt', 'executeChain');
6125
6140
  validateRequired(variables, 'variables', 'executeChain');
@@ -7478,7 +7493,6 @@ class OutputFixingParser extends BaseOutputParser {
7478
7493
  * @throws LangChainExecutionError if parser creation fails
7479
7494
  */
7480
7495
  function createSchemaParser(schema, llm, options = {}) {
7481
- // Validate required parameters
7482
7496
  validateRequired(schema, 'schema', 'createSchemaParser');
7483
7497
  validateRequired(llm, 'llm', 'createSchemaParser');
7484
7498
  validateRequired(options, 'options', 'createSchemaParser');
@@ -7538,7 +7552,6 @@ You must return ONLY valid JSON that matches the schema exactly. Do not include
7538
7552
  async function executeChainWithSchema(schema, llm, prompt, variables, options = {}) {
7539
7553
  const { retryOptions = { maxAttempts: 3 }, fallbackParser, onFallback, ...parserOptions } = options;
7540
7554
  const parser = createSchemaParser(schema, llm, parserOptions);
7541
- // Define the operation to retry
7542
7555
  const operation = async () => {
7543
7556
  const result = await executeChain({
7544
7557
  llm,
@@ -7549,16 +7562,13 @@ async function executeChainWithSchema(schema, llm, prompt, variables, options =
7549
7562
  return result;
7550
7563
  };
7551
7564
  try {
7552
- // Use the general retry utility
7553
7565
  return await withRetry(operation, retryOptions);
7554
7566
  }
7555
7567
  catch (error) {
7556
- // If all retries failed and we have a fallback parser, use it
7557
7568
  if (fallbackParser) {
7558
7569
  if (onFallback) {
7559
7570
  onFallback();
7560
7571
  }
7561
- // Generate without structured parsing as fallback
7562
7572
  const fallbackResult = await executeChain({
7563
7573
  llm,
7564
7574
  prompt,
@@ -11263,11 +11273,22 @@ async function getProjectConfigFilePath(configFileName) {
11263
11273
  }
11264
11274
 
11265
11275
  const OPEN_AI_MODELS = [
11276
+ 'gpt-4.5',
11266
11277
  'gpt-4o',
11278
+ 'gpt-4o-mini',
11279
+ 'gpt-4.1',
11280
+ 'gpt-4.1',
11281
+ 'gpt-4.1-mini',
11282
+ 'gpt-4.1-nano',
11267
11283
  'gpt-4-32k',
11268
11284
  'gpt-4-turbo',
11269
11285
  'gpt-4',
11270
11286
  'gpt-3.5-turbo',
11287
+ 'o1',
11288
+ 'o1-mini',
11289
+ '03-mini',
11290
+ '03',
11291
+ 'o4-mini',
11271
11292
  ];
11272
11293
  const ANTHROPIC_MODELS = [
11273
11294
  'claude-sonnet-4-0',
package/dist/index.js CHANGED
@@ -68,7 +68,7 @@ var readline__namespace = /*#__PURE__*/_interopNamespaceDefault(readline$1);
68
68
  /**
69
69
  * Current build version from package.json
70
70
  */
71
- const BUILD_VERSION = "0.18.0";
71
+ const BUILD_VERSION = "0.18.2";
72
72
 
73
73
  const isInteractive = (config) => {
74
74
  return config?.mode === 'interactive' || !!config?.interactive;
@@ -367,7 +367,7 @@ function getDefaultServiceApiKey(config) {
367
367
  }
368
368
  const DEFAULT_OPENAI_LLM_SERVICE = {
369
369
  provider: 'openai',
370
- model: 'gpt-4o',
370
+ model: 'gpt-4o-mini',
371
371
  tokenLimit: 2024,
372
372
  temperature: 0.32,
373
373
  authentication: {
@@ -641,28 +641,37 @@ function loadGitConfig(config) {
641
641
  let service = config.service;
642
642
  if (gitConfigParsed.coco) {
643
643
  service = {
644
- provider: gitConfigParsed.coco?.['service.provider'],
645
- model: gitConfigParsed.coco?.['service.model'],
644
+ provider: gitConfigParsed.coco?.serviceProvider,
645
+ model: gitConfigParsed.coco?.serviceModel,
646
646
  authentication: {
647
647
  type: 'APIKey',
648
648
  credentials: {
649
- apiKey: gitConfigParsed.coco?.['service.apiKey'],
649
+ apiKey: gitConfigParsed.coco?.serviceApiKey,
650
650
  },
651
651
  },
652
652
  requestOptions: {
653
- timeout: Number(gitConfigParsed.coco?.['service.requestOptions.timeout']),
654
- maxRetries: Number(gitConfigParsed.coco?.['service.requestOptions.maxRetries']),
653
+ timeout: Number(gitConfigParsed.coco?.serviceRequestOptionsTimeout),
654
+ maxRetries: Number(gitConfigParsed.coco?.serviceRequestOptionsMaxRetries),
655
655
  },
656
- endpoint: gitConfigParsed.coco?.['service.endpoint'],
657
- fields: gitConfigParsed.coco?.['service.fields']
658
- ? JSON.parse(gitConfigParsed.coco?.['service.fields'])
656
+ endpoint: gitConfigParsed.coco?.serviceEndpoint,
657
+ fields: gitConfigParsed.coco?.serviceFields
658
+ ? JSON.parse(gitConfigParsed.coco?.serviceFields)
659
659
  : undefined,
660
660
  };
661
661
  }
662
662
  config = {
663
663
  ...config,
664
- ...gitConfigParsed.coco,
665
664
  service: service,
665
+ prompt: gitConfigParsed.coco?.prompt || config.prompt,
666
+ mode: gitConfigParsed.coco?.mode || config.mode,
667
+ summarizePrompt: gitConfigParsed.coco?.summarizePrompt || config.summarizePrompt,
668
+ ignoredFiles: gitConfigParsed.coco?.ignoredFiles || config.ignoredFiles,
669
+ ignoredExtensions: gitConfigParsed.coco?.ignoredExtensions || config.ignoredExtensions,
670
+ defaultBranch: gitConfigParsed.coco?.defaultBranch || config.defaultBranch,
671
+ verbose: gitConfigParsed.coco?.verbose || config.verbose,
672
+ conventionalCommits: gitConfigParsed.coco?.conventionalCommits || config.conventionalCommits,
673
+ openInEditor: gitConfigParsed.coco?.openInEditor || config.openInEditor,
674
+ includeBranchName: gitConfigParsed.coco?.includeBranchName || config.includeBranchName,
666
675
  };
667
676
  }
668
677
  return removeUndefined(config);
@@ -684,25 +693,25 @@ const appendToGitConfig = async (filePath, config) => {
684
693
  const value = config[key];
685
694
  if (key === 'service') {
686
695
  const service = value;
687
- contentLines.push(`\tservice.provider = ${service.provider}`);
688
- contentLines.push(`\tservice.model = ${service.model}`);
696
+ contentLines.push(` serviceProvider = ${service.provider}`);
697
+ contentLines.push(` serviceModel = ${service.model}`);
689
698
  if (service.authentication.type === 'APIKey') {
690
- contentLines.push(`\tservice.apiKey = ${service.authentication.credentials.apiKey}`);
699
+ contentLines.push(` serviceApiKey = ${service.authentication.credentials.apiKey}`);
691
700
  }
692
701
  if (service.requestOptions?.timeout) {
693
- contentLines.push(`\tservice.requestOptions.timeout = ${service.requestOptions.timeout}`);
702
+ contentLines.push(` serviceRequestOptionsTimeout = ${service.requestOptions.timeout}`);
694
703
  }
695
704
  if (service.requestOptions?.maxRetries) {
696
- contentLines.push(`\tservice.requestOptions.maxRetries = ${service.requestOptions.maxRetries}`);
705
+ contentLines.push(` serviceRequestOptionsMaxRetries = ${service.requestOptions.maxRetries}`);
697
706
  }
698
707
  if (service.provider === 'ollama') {
699
708
  const ollamaService = service;
700
709
  if (ollamaService.endpoint) {
701
- contentLines.push(` service.endpoint = ${ollamaService.endpoint}`);
710
+ contentLines.push(` serviceEndpoint = ${ollamaService.endpoint}`);
702
711
  }
703
712
  }
704
713
  if (service.fields) {
705
- contentLines.push(`\tservice.fields = ${JSON.stringify(service.fields)}`);
714
+ contentLines.push(` serviceFields = ${JSON.stringify(service.fields)}`);
706
715
  }
707
716
  }
708
717
  else if (typeof value === 'string' && value.includes('\n')) {
@@ -1157,65 +1166,7 @@ const schema$1 = {
1157
1166
  "LLMModel": {
1158
1167
  "anyOf": [
1159
1168
  {
1160
- "type": "string",
1161
- "enum": [
1162
- "davinci-002",
1163
- "babbage-002",
1164
- "text-davinci-003",
1165
- "text-davinci-002",
1166
- "text-davinci-001",
1167
- "text-curie-001",
1168
- "text-babbage-001",
1169
- "text-ada-001",
1170
- "davinci",
1171
- "curie",
1172
- "babbage",
1173
- "ada",
1174
- "code-davinci-002",
1175
- "code-davinci-001",
1176
- "code-cushman-002",
1177
- "code-cushman-001",
1178
- "davinci-codex",
1179
- "cushman-codex",
1180
- "text-davinci-edit-001",
1181
- "code-davinci-edit-001",
1182
- "text-embedding-ada-002",
1183
- "text-similarity-davinci-001",
1184
- "text-similarity-curie-001",
1185
- "text-similarity-babbage-001",
1186
- "text-similarity-ada-001",
1187
- "text-search-davinci-doc-001",
1188
- "text-search-curie-doc-001",
1189
- "text-search-babbage-doc-001",
1190
- "text-search-ada-doc-001",
1191
- "code-search-babbage-code-001",
1192
- "code-search-ada-code-001",
1193
- "gpt2",
1194
- "gpt-3.5-turbo",
1195
- "gpt-35-turbo",
1196
- "gpt-3.5-turbo-0301",
1197
- "gpt-3.5-turbo-0613",
1198
- "gpt-3.5-turbo-1106",
1199
- "gpt-3.5-turbo-0125",
1200
- "gpt-3.5-turbo-16k",
1201
- "gpt-3.5-turbo-16k-0613",
1202
- "gpt-3.5-turbo-instruct",
1203
- "gpt-3.5-turbo-instruct-0914",
1204
- "gpt-4",
1205
- "gpt-4-0314",
1206
- "gpt-4-0613",
1207
- "gpt-4-32k",
1208
- "gpt-4-32k-0314",
1209
- "gpt-4-32k-0613",
1210
- "gpt-4-turbo",
1211
- "gpt-4-turbo-2024-04-09",
1212
- "gpt-4-turbo-preview",
1213
- "gpt-4-1106-preview",
1214
- "gpt-4-0125-preview",
1215
- "gpt-4-vision-preview",
1216
- "gpt-4o",
1217
- "gpt-4o-2024-05-13"
1218
- ]
1169
+ "$ref": "#/definitions/OpenAIModel"
1219
1170
  },
1220
1171
  {
1221
1172
  "$ref": "#/definitions/OllamaModel"
@@ -1225,6 +1176,71 @@ const schema$1 = {
1225
1176
  }
1226
1177
  ]
1227
1178
  },
1179
+ "OpenAIModel": {
1180
+ "type": "string",
1181
+ "enum": [
1182
+ "davinci-002",
1183
+ "babbage-002",
1184
+ "text-davinci-003",
1185
+ "text-davinci-002",
1186
+ "text-davinci-001",
1187
+ "text-curie-001",
1188
+ "text-babbage-001",
1189
+ "text-ada-001",
1190
+ "davinci",
1191
+ "curie",
1192
+ "babbage",
1193
+ "ada",
1194
+ "code-davinci-002",
1195
+ "code-davinci-001",
1196
+ "code-cushman-002",
1197
+ "code-cushman-001",
1198
+ "davinci-codex",
1199
+ "cushman-codex",
1200
+ "text-davinci-edit-001",
1201
+ "code-davinci-edit-001",
1202
+ "text-embedding-ada-002",
1203
+ "text-similarity-davinci-001",
1204
+ "text-similarity-curie-001",
1205
+ "text-similarity-babbage-001",
1206
+ "text-similarity-ada-001",
1207
+ "text-search-davinci-doc-001",
1208
+ "text-search-curie-doc-001",
1209
+ "text-search-babbage-doc-001",
1210
+ "text-search-ada-doc-001",
1211
+ "code-search-babbage-code-001",
1212
+ "code-search-ada-code-001",
1213
+ "gpt2",
1214
+ "gpt-3.5-turbo",
1215
+ "gpt-35-turbo",
1216
+ "gpt-3.5-turbo-0301",
1217
+ "gpt-3.5-turbo-0613",
1218
+ "gpt-3.5-turbo-1106",
1219
+ "gpt-3.5-turbo-0125",
1220
+ "gpt-3.5-turbo-16k",
1221
+ "gpt-3.5-turbo-16k-0613",
1222
+ "gpt-3.5-turbo-instruct",
1223
+ "gpt-3.5-turbo-instruct-0914",
1224
+ "gpt-4",
1225
+ "gpt-4-0314",
1226
+ "gpt-4-0613",
1227
+ "gpt-4-32k",
1228
+ "gpt-4-32k-0314",
1229
+ "gpt-4-32k-0613",
1230
+ "gpt-4-turbo",
1231
+ "gpt-4-turbo-2024-04-09",
1232
+ "gpt-4-turbo-preview",
1233
+ "gpt-4-1106-preview",
1234
+ "gpt-4-0125-preview",
1235
+ "gpt-4-vision-preview",
1236
+ "gpt-4o",
1237
+ "gpt-4o-2024-05-13",
1238
+ "gpt-4o-mini",
1239
+ "gpt-4.1",
1240
+ "gpt-4.1-mini",
1241
+ "gpt-4.1-nano"
1242
+ ]
1243
+ },
1228
1244
  "OllamaModel": {
1229
1245
  "type": "string",
1230
1246
  "enum": [
@@ -6141,7 +6157,6 @@ function getPrompt({ template, variables, fallback }) {
6141
6157
  * @throws LangChainExecutionError if the chain execution fails or returns empty results
6142
6158
  */
6143
6159
  const executeChain = async ({ llm, prompt, variables, parser }) => {
6144
- // Validate all required parameters
6145
6160
  validateRequired(llm, 'llm', 'executeChain');
6146
6161
  validateRequired(prompt, 'prompt', 'executeChain');
6147
6162
  validateRequired(variables, 'variables', 'executeChain');
@@ -7500,7 +7515,6 @@ class OutputFixingParser extends output_parsers.BaseOutputParser {
7500
7515
  * @throws LangChainExecutionError if parser creation fails
7501
7516
  */
7502
7517
  function createSchemaParser(schema, llm, options = {}) {
7503
- // Validate required parameters
7504
7518
  validateRequired(schema, 'schema', 'createSchemaParser');
7505
7519
  validateRequired(llm, 'llm', 'createSchemaParser');
7506
7520
  validateRequired(options, 'options', 'createSchemaParser');
@@ -7560,7 +7574,6 @@ You must return ONLY valid JSON that matches the schema exactly. Do not include
7560
7574
  async function executeChainWithSchema(schema, llm, prompt, variables, options = {}) {
7561
7575
  const { retryOptions = { maxAttempts: 3 }, fallbackParser, onFallback, ...parserOptions } = options;
7562
7576
  const parser = createSchemaParser(schema, llm, parserOptions);
7563
- // Define the operation to retry
7564
7577
  const operation = async () => {
7565
7578
  const result = await executeChain({
7566
7579
  llm,
@@ -7571,16 +7584,13 @@ async function executeChainWithSchema(schema, llm, prompt, variables, options =
7571
7584
  return result;
7572
7585
  };
7573
7586
  try {
7574
- // Use the general retry utility
7575
7587
  return await withRetry(operation, retryOptions);
7576
7588
  }
7577
7589
  catch (error) {
7578
- // If all retries failed and we have a fallback parser, use it
7579
7590
  if (fallbackParser) {
7580
7591
  if (onFallback) {
7581
7592
  onFallback();
7582
7593
  }
7583
- // Generate without structured parsing as fallback
7584
7594
  const fallbackResult = await executeChain({
7585
7595
  llm,
7586
7596
  prompt,
@@ -11285,11 +11295,22 @@ async function getProjectConfigFilePath(configFileName) {
11285
11295
  }
11286
11296
 
11287
11297
  const OPEN_AI_MODELS = [
11298
+ 'gpt-4.5',
11288
11299
  'gpt-4o',
11300
+ 'gpt-4o-mini',
11301
+ 'gpt-4.1',
11302
+ 'gpt-4.1',
11303
+ 'gpt-4.1-mini',
11304
+ 'gpt-4.1-nano',
11289
11305
  'gpt-4-32k',
11290
11306
  'gpt-4-turbo',
11291
11307
  'gpt-4',
11292
11308
  'gpt-3.5-turbo',
11309
+ 'o1',
11310
+ 'o1-mini',
11311
+ '03-mini',
11312
+ '03',
11313
+ 'o4-mini',
11293
11314
  ];
11294
11315
  const ANTHROPIC_MODELS = [
11295
11316
  'claude-sonnet-4-0',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "git-coco",
3
- "version": "0.18.0",
3
+ "version": "0.18.2",
4
4
  "description": "zero-effort git commits with coco.",
5
5
  "author": "gfargo <ghfargo@gmail.com>",
6
6
  "license": "MIT",
@@ -105,7 +105,7 @@
105
105
  "performance-now": "2.1.0",
106
106
  "pretty-ms": "7.0.1",
107
107
  "simple-git": "3.27.0",
108
- "tiktoken": "^1.0.17",
108
+ "tiktoken": "^1.0.21",
109
109
  "yargs": "17.7.2"
110
110
  },
111
111
  "resolutions": {