git-coco 0.32.0 → 0.33.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/README.md CHANGED
@@ -44,6 +44,7 @@ coco -i
44
44
  - **`coco changelog`** - Create changelogs from commit history
45
45
  - **`coco recap`** - Summarize recent changes and activity
46
46
  - **`coco review`** - AI-powered code review of your changes
47
+ - **`coco log`** - Explore commit history with graph, filters, JSON output, and commit details
47
48
  - **`coco init`** - Interactive setup wizard
48
49
 
49
50
  ## Usage Examples
@@ -85,6 +86,12 @@ coco recap --yesterday
85
86
 
86
87
  # Code review before committing
87
88
  coco review
89
+
90
+ # Explore commit history
91
+ coco log --all --limit 20
92
+ coco log --author "Grace Hopper" --path src
93
+ coco log --commit HEAD
94
+ coco log --format json
88
95
  ```
89
96
 
90
97
  ## Configuration
package/dist/index.d.ts CHANGED
@@ -11,13 +11,17 @@ import { Color } from 'chalk';
11
11
  import { TiktokenModel as TiktokenModel$1 } from 'tiktoken';
12
12
 
13
13
  type LLMProvider = 'openai' | 'ollama' | 'anthropic';
14
+ type DynamicModelTask = 'summarize' | 'commit' | 'changelog' | 'review' | 'recap' | 'repair' | 'largeDiff';
15
+ type DynamicModelPreference = 'cost' | 'balanced' | 'quality';
14
16
  type OpenAIModel = TiktokenModel | 'gpt-4o-mini' | 'gpt-4o' | 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano';
15
17
  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';
16
18
  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';
17
19
  type LLMModel = OpenAIModel | OllamaModel | AnthropicModel;
20
+ type ConfiguredLLMModel = LLMModel | 'dynamic';
21
+ type DynamicModelProfile = Partial<Record<DynamicModelTask, LLMModel>>;
18
22
  type BaseLLMService = {
19
23
  provider: LLMProvider;
20
- model: LLMModel;
24
+ model: ConfiguredLLMModel;
21
25
  /**
22
26
  * The maximum number of tokens per request.
23
27
  *
@@ -63,6 +67,16 @@ type BaseLLMService = {
63
67
  * @default 3
64
68
  */
65
69
  maxParsingAttempts?: number;
70
+ /**
71
+ * Optional task-to-model overrides used when model is set to "dynamic".
72
+ */
73
+ dynamicModels?: DynamicModelProfile;
74
+ /**
75
+ * Default dynamic routing preference when model is set to "dynamic".
76
+ *
77
+ * @default 'balanced'
78
+ */
79
+ dynamicModelPreference?: DynamicModelPreference;
66
80
  };
67
81
  type Authentication = {
68
82
  type: 'None';
@@ -84,7 +98,7 @@ type OpenAIFields = Partial<OpenAIInput> & BaseLLMParams;
84
98
  type OllamaFields = Partial<OllamaInput> & BaseLLMParams;
85
99
  type OpenAILLMService = BaseLLMService & {
86
100
  provider: 'openai';
87
- model: OpenAIModel;
101
+ model: OpenAIModel | 'dynamic';
88
102
  /**
89
103
  * Custom base URL for OpenAI-compatible APIs (e.g., OpenRouter, Azure OpenAI).
90
104
  * If not specified, uses the default OpenAI API endpoint.
@@ -97,13 +111,13 @@ type OpenAILLMService = BaseLLMService & {
97
111
  };
98
112
  type OllamaLLMService = BaseLLMService & {
99
113
  provider: 'ollama';
100
- model: OllamaModel;
114
+ model: OllamaModel | 'dynamic';
101
115
  endpoint: string;
102
116
  fields?: OllamaFields;
103
117
  };
104
118
  type AnthropicLLMService = BaseLLMService & {
105
119
  provider: 'anthropic';
106
- model: AnthropicModel;
120
+ model: AnthropicModel | 'dynamic';
107
121
  fields?: {
108
122
  temperature?: number;
109
123
  maxTokens?: number;
@@ -216,7 +230,7 @@ interface ChangelogOptions extends BaseCommandOptions {
216
230
  }
217
231
  type ChangelogArgv = Arguments<ChangelogOptions>;
218
232
 
219
- declare const _default$3: {
233
+ declare const _default$4: {
220
234
  command: string;
221
235
  desc: string;
222
236
  builder: (yargs: yargs.Argv) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
@@ -233,10 +247,13 @@ interface CommitOptions extends BaseCommandOptions {
233
247
  conventional: boolean;
234
248
  includeBranchName: boolean;
235
249
  noVerify: boolean;
250
+ split?: boolean;
251
+ plan?: boolean;
252
+ apply?: boolean;
236
253
  }
237
254
  type CommitArgv = Arguments<CommitOptions>;
238
255
 
239
- declare const _default$2: {
256
+ declare const _default$3: {
240
257
  command: string;
241
258
  desc: string;
242
259
  builder: (yargs: yargs.Argv) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
@@ -246,7 +263,7 @@ declare const _default$2: {
246
263
 
247
264
  type InstallationScope = 'global' | 'project';
248
265
 
249
- declare const _default$1: {
266
+ declare const _default$2: {
250
267
  command: string;
251
268
  desc: string;
252
269
  builder: (yargs: yargs.Argv) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
@@ -272,6 +289,29 @@ declare const _default$1: {
272
289
  options: Record<string, yargs.Options>;
273
290
  };
274
291
 
292
+ type LogFormat = 'table' | 'json';
293
+ interface LogOptions extends BaseCommandOptions {
294
+ all?: boolean;
295
+ author?: string;
296
+ branch?: string;
297
+ commit?: string;
298
+ format?: LogFormat;
299
+ limit?: number;
300
+ noMerges?: boolean;
301
+ path?: string | string[];
302
+ since?: string;
303
+ until?: string;
304
+ }
305
+ type LogArgv = Arguments<LogOptions>;
306
+
307
+ declare const _default$1: {
308
+ command: string;
309
+ desc: string;
310
+ builder: (yargs: yargs.Argv) => yargs.Argv<yargs.Omit<{}, string> & yargs.InferredOptionTypes<Record<string, yargs.Options>>>;
311
+ handler: (argv: LogArgv) => Promise<void>;
312
+ options: Record<string, yargs.Options>;
313
+ };
314
+
275
315
  interface RecapOptions extends BaseCommandOptions {
276
316
  yesterday?: boolean;
277
317
  'last-week'?: boolean;
@@ -336,6 +376,20 @@ type TokenCounter = Awaited<ReturnType<typeof getTokenCounter>>;
336
376
  */
337
377
  declare const getTokenCounter: (modelName: TiktokenModel$1) => Promise<(text: string) => number>;
338
378
 
379
+ type LlmCallMetadata = {
380
+ task: string;
381
+ command?: string;
382
+ provider?: string;
383
+ model?: string;
384
+ retryAttempt?: number;
385
+ parserType?: string;
386
+ variableKeys?: string[];
387
+ promptTokens?: number;
388
+ elapsedMs?: number;
389
+ inputDocuments?: number;
390
+ inputChunks?: number;
391
+ };
392
+
339
393
  type FileChangeStatus = 'modified' | 'renamed' | 'added' | 'deleted' | 'untracked' | 'unknown';
340
394
  interface FileChange {
341
395
  summary: string;
@@ -389,6 +443,7 @@ interface BaseParserOptions {
389
443
  * @default 6
390
444
  */
391
445
  maxConcurrent?: number;
446
+ metadata?: Partial<LlmCallMetadata>;
392
447
  }
393
448
  interface BaseParserInput {
394
449
  options: BaseParserOptions;
@@ -424,5 +479,5 @@ declare namespace types_d {
424
479
  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, types_d_GetChangesResult as GetChangesResult };
425
480
  }
426
481
 
427
- export { _default$3 as changelog, _default$2 as commit, _default$1 as init, _default as recap, types_d as types };
482
+ export { _default$4 as changelog, _default$3 as commit, _default$2 as init, _default$1 as log, _default as recap, types_d as types };
428
483
  export type { Config$1 as Config };