gac 3.8.1__py3-none-any.whl → 3.10.10__py3-none-any.whl

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.
Files changed (76) hide show
  1. gac/__init__.py +4 -6
  2. gac/__version__.py +1 -1
  3. gac/ai_utils.py +18 -49
  4. gac/cli.py +14 -10
  5. gac/commit_executor.py +59 -0
  6. gac/config.py +28 -3
  7. gac/config_cli.py +19 -7
  8. gac/constants/__init__.py +34 -0
  9. gac/constants/commit.py +63 -0
  10. gac/constants/defaults.py +40 -0
  11. gac/constants/file_patterns.py +110 -0
  12. gac/constants/languages.py +119 -0
  13. gac/diff_cli.py +0 -22
  14. gac/errors.py +8 -2
  15. gac/git.py +6 -6
  16. gac/git_state_validator.py +193 -0
  17. gac/grouped_commit_workflow.py +458 -0
  18. gac/init_cli.py +2 -1
  19. gac/interactive_mode.py +179 -0
  20. gac/language_cli.py +0 -1
  21. gac/main.py +222 -959
  22. gac/model_cli.py +2 -1
  23. gac/model_identifier.py +70 -0
  24. gac/oauth/claude_code.py +2 -2
  25. gac/oauth/qwen_oauth.py +4 -0
  26. gac/oauth/token_store.py +2 -2
  27. gac/oauth_retry.py +161 -0
  28. gac/postprocess.py +155 -0
  29. gac/prompt.py +20 -490
  30. gac/prompt_builder.py +88 -0
  31. gac/providers/README.md +437 -0
  32. gac/providers/__init__.py +70 -81
  33. gac/providers/anthropic.py +12 -56
  34. gac/providers/azure_openai.py +48 -92
  35. gac/providers/base.py +329 -0
  36. gac/providers/cerebras.py +10 -43
  37. gac/providers/chutes.py +16 -72
  38. gac/providers/claude_code.py +64 -97
  39. gac/providers/custom_anthropic.py +51 -85
  40. gac/providers/custom_openai.py +29 -87
  41. gac/providers/deepseek.py +10 -43
  42. gac/providers/error_handler.py +139 -0
  43. gac/providers/fireworks.py +10 -43
  44. gac/providers/gemini.py +66 -73
  45. gac/providers/groq.py +10 -62
  46. gac/providers/kimi_coding.py +19 -59
  47. gac/providers/lmstudio.py +62 -52
  48. gac/providers/minimax.py +10 -43
  49. gac/providers/mistral.py +10 -43
  50. gac/providers/moonshot.py +10 -43
  51. gac/providers/ollama.py +54 -41
  52. gac/providers/openai.py +30 -46
  53. gac/providers/openrouter.py +15 -62
  54. gac/providers/protocol.py +71 -0
  55. gac/providers/qwen.py +55 -67
  56. gac/providers/registry.py +58 -0
  57. gac/providers/replicate.py +137 -91
  58. gac/providers/streamlake.py +26 -56
  59. gac/providers/synthetic.py +35 -47
  60. gac/providers/together.py +10 -43
  61. gac/providers/zai.py +21 -59
  62. gac/py.typed +0 -0
  63. gac/security.py +1 -1
  64. gac/templates/__init__.py +1 -0
  65. gac/templates/question_generation.txt +60 -0
  66. gac/templates/system_prompt.txt +224 -0
  67. gac/templates/user_prompt.txt +28 -0
  68. gac/utils.py +6 -5
  69. gac/workflow_context.py +162 -0
  70. {gac-3.8.1.dist-info → gac-3.10.10.dist-info}/METADATA +1 -1
  71. gac-3.10.10.dist-info/RECORD +79 -0
  72. gac/constants.py +0 -328
  73. gac-3.8.1.dist-info/RECORD +0 -56
  74. {gac-3.8.1.dist-info → gac-3.10.10.dist-info}/WHEEL +0 -0
  75. {gac-3.8.1.dist-info → gac-3.10.10.dist-info}/entry_points.txt +0 -0
  76. {gac-3.8.1.dist-info → gac-3.10.10.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,162 @@
1
+ """Workflow context objects to reduce parameter explosion.
2
+
3
+ These dataclasses bundle related parameters that are passed through
4
+ the commit workflow, making function signatures cleaner and more maintainable.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ from dataclasses import dataclass
10
+ from typing import TYPE_CHECKING
11
+
12
+ if TYPE_CHECKING:
13
+ from gac.commit_executor import CommitExecutor
14
+ from gac.git_state_validator import GitState
15
+ from gac.interactive_mode import InteractiveMode
16
+ from gac.prompt_builder import PromptBundle
17
+
18
+
19
+ @dataclass(frozen=True)
20
+ class CLIOptions:
21
+ """Options passed from CLI to main workflow.
22
+
23
+ Bundles all command-line arguments to reduce parameter explosion in main().
24
+ """
25
+
26
+ # Git workflow options
27
+ stage_all: bool = False
28
+ push: bool = False
29
+ no_verify: bool = False
30
+ hook_timeout: int = 120
31
+
32
+ # Workflow mode
33
+ group: bool = False
34
+ interactive: bool = False
35
+ require_confirmation: bool = True
36
+ dry_run: bool = False
37
+
38
+ # AI/Model config
39
+ model: str | None = None
40
+
41
+ # Prompt/output format config
42
+ hint: str = ""
43
+ one_liner: bool = False
44
+ infer_scope: bool = False
45
+ verbose: bool = False
46
+ language: str | None = None
47
+
48
+ # Output config
49
+ quiet: bool = False
50
+ message_only: bool = False
51
+ show_prompt: bool = False
52
+
53
+ # Security
54
+ skip_secret_scan: bool = False
55
+
56
+
57
+ @dataclass(frozen=True)
58
+ class GenerationConfig:
59
+ """Configuration for AI message generation.
60
+
61
+ These settings control how the AI model generates commit messages.
62
+ """
63
+
64
+ model: str
65
+ temperature: float
66
+ max_output_tokens: int
67
+ max_retries: int
68
+
69
+
70
+ @dataclass(frozen=True)
71
+ class WorkflowFlags:
72
+ """Boolean flags controlling workflow behavior.
73
+
74
+ These flags determine how the commit workflow executes.
75
+ """
76
+
77
+ require_confirmation: bool
78
+ quiet: bool
79
+ no_verify: bool
80
+ dry_run: bool
81
+ message_only: bool
82
+ push: bool
83
+ show_prompt: bool
84
+ interactive: bool
85
+ hook_timeout: int = 120
86
+
87
+
88
+ @dataclass
89
+ class WorkflowState:
90
+ """Runtime state for a commit workflow.
91
+
92
+ Contains the prompts, git state, and executor instances needed
93
+ to execute the workflow. This is mutable as conversation messages
94
+ may be updated during interactive flows.
95
+ """
96
+
97
+ prompts: PromptBundle
98
+ git_state: GitState
99
+ hint: str
100
+ commit_executor: CommitExecutor
101
+ interactive_mode: InteractiveMode
102
+
103
+
104
+ @dataclass(frozen=True)
105
+ class WorkflowContext:
106
+ """Complete context for executing a commit workflow.
107
+
108
+ Bundles all configuration, flags, and state needed to execute
109
+ a single or grouped commit workflow.
110
+ """
111
+
112
+ config: GenerationConfig
113
+ flags: WorkflowFlags
114
+ state: WorkflowState
115
+
116
+ @property
117
+ def model(self) -> str:
118
+ return self.config.model
119
+
120
+ @property
121
+ def temperature(self) -> float:
122
+ return self.config.temperature
123
+
124
+ @property
125
+ def max_output_tokens(self) -> int:
126
+ return self.config.max_output_tokens
127
+
128
+ @property
129
+ def max_retries(self) -> int:
130
+ return self.config.max_retries
131
+
132
+ @property
133
+ def quiet(self) -> bool:
134
+ return self.flags.quiet
135
+
136
+ @property
137
+ def dry_run(self) -> bool:
138
+ return self.flags.dry_run
139
+
140
+ @property
141
+ def message_only(self) -> bool:
142
+ return self.flags.message_only
143
+
144
+ @property
145
+ def interactive(self) -> bool:
146
+ return self.flags.interactive
147
+
148
+ @property
149
+ def system_prompt(self) -> str:
150
+ return self.state.prompts.system_prompt
151
+
152
+ @property
153
+ def user_prompt(self) -> str:
154
+ return self.state.prompts.user_prompt
155
+
156
+ @property
157
+ def hint(self) -> str:
158
+ return self.state.hint
159
+
160
+ @property
161
+ def git_state(self) -> GitState:
162
+ return self.state.git_state
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gac
3
- Version: 3.8.1
3
+ Version: 3.10.10
4
4
  Summary: LLM-powered Git commit message generator with multi-provider support
5
5
  Project-URL: Homepage, https://github.com/cellwebb/gac
6
6
  Project-URL: Documentation, https://github.com/cellwebb/gac#readme
@@ -0,0 +1,79 @@
1
+ gac/__init__.py,sha256=8MQ-da47gfj3k-K3zC8dVdW-F9R7DzxADILJyPPsvbo,311
2
+ gac/__version__.py,sha256=5bYvim4LGM_rUaBfwXdOz2SItoM3knux0OvqtnhBQdo,68
3
+ gac/ai.py,sha256=HnXmRFmUJin5k755iBqSLgKYssjShjKXz9SwICEpMag,3835
4
+ gac/ai_utils.py,sha256=jrfY_whmRdpUEyTSr_uxUuCfy_wpA4EIKhHE8jZ73sY,9872
5
+ gac/auth_cli.py,sha256=D1UcpOdyLqnKNJQTBq2lHCHBaxFZsRbM4Krvg-1-NfA,6822
6
+ gac/cli.py,sha256=aW7-EC3PhngvR11fVasPgu66aGgom16xc9PoRwG8fo4,8040
7
+ gac/commit_executor.py,sha256=0hhRQFuCpgsCRnP9AGq1V1JIVOAhZrqqRiSDZmoHkCk,2286
8
+ gac/config.py,sha256=qaQ7-udCA0Gb-S8aKEGM40ywVWQyMPtTpnBPq3BTkhg,5208
9
+ gac/config_cli.py,sha256=6tUoi-Xcexv5i2Y6p-wobrYlzeH2DNxlHMkyhFnFBYk,2994
10
+ gac/diff_cli.py,sha256=roBnoPcMn58rMGA475lqXlC2iYERC-13K0CKJH2nSV8,5147
11
+ gac/errors.py,sha256=pBq1nvHwv89KLvOGgap15IWmYTki2lghkkqyHpyVTzA,8035
12
+ gac/git.py,sha256=KuajV-4XywQ1uox_eB-CuoQ85xH_iJxsu3LcOVxLN7Y,13185
13
+ gac/git_state_validator.py,sha256=R_-Ee6umDDSqVnY_EXBO8uFvlpUWRGqRqHHgGO59p6g,7070
14
+ gac/grouped_commit_workflow.py,sha256=efjF_F2Vg8GF13asEhOGVgsa8U03ze6mcYqaq_meTNg,19278
15
+ gac/init_cli.py,sha256=99ga1qrFz9E-cpLLhI1c8FmvVa4BgXZMQK1cv13LM5M,2303
16
+ gac/interactive_mode.py,sha256=EwcqY39O-VKaRwmzT3IffQs8qLcq0dMeB4r5vBYVrnM,6397
17
+ gac/language_cli.py,sha256=3p4W3ezYjaJ2J5XvO1OOG0j-U_Ozla2-K2HMC-TURaQ,12906
18
+ gac/main.py,sha256=275I3vFLSZ4rEgte5DT_9UhdElWpe7tj0VQs93_dAu4,12142
19
+ gac/model_cli.py,sha256=dBJKW3uwkkc3OR57tOQbngk-k_Auau6C0RXE6HG4XAE,18346
20
+ gac/model_identifier.py,sha256=WKVxa31FI8ESRVmWvOLEviL6-t3ji7OGkOq6Dg48ZnM,2315
21
+ gac/oauth_retry.py,sha256=IFlz1KhBCwLWNSbluDBgw-07sEbFdwFvn-pO_kH4Eg8,5070
22
+ gac/postprocess.py,sha256=4cHWbu1PSWEW-1ct0X5i5So_NosxrXk_qC9vEBV7Z7c,4909
23
+ gac/preprocess.py,sha256=hk2p2X4-xVDvuy-T1VMzMa9k5fTUbhlWDyw89DCf81Q,15379
24
+ gac/prompt.py,sha256=Vkh2LSEUkl19z8UMSn8o7bl3uRBdIeDmVKyk9t4f-jI,16627
25
+ gac/prompt_builder.py,sha256=9VEIFGgYQUnnbRh9zrVjDmMGDr9v4Ij2V5NuEtI0cSw,3088
26
+ gac/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
+ gac/security.py,sha256=RYE3cik9c_zrqQYd0xIju8YUqZ1VPa2cVbktChuSyRg,9931
28
+ gac/utils.py,sha256=evJ0lSKLVjqKWoxvLfV4mBTBHTqaWlQzh591jdhTXcc,12689
29
+ gac/workflow_context.py,sha256=Vq1X2pXMkxgTeQSbkhARqBjwxA5THXlZ3OLrv49LXzo,3752
30
+ gac/workflow_utils.py,sha256=rGN7PqTqeUFLn260gm3hKyzF1PDVVuEsV1i2QHu2EO4,8118
31
+ gac/constants/__init__.py,sha256=un6JAvDggBoX95QD7G6xARQqe7nbtOoTuyA-xcobySE,1094
32
+ gac/constants/commit.py,sha256=z-ssDs1erhMgtq1VFDs9nIXb-8C17X-IdhwaqX5Ydok,1478
33
+ gac/constants/defaults.py,sha256=-VHk3XgV1H0lhHYXusw0CIP4rGvDqF6WmygSNTfV5ds,1301
34
+ gac/constants/file_patterns.py,sha256=eA-BHKYeM3mt_sNMmTVvk2nx1hZGTggtSnqiqiAA5Eg,3960
35
+ gac/constants/languages.py,sha256=UIqJ42WfzPQu_-flNf6YHBBI5MwNOlVeSN8cygJDiBA,3466
36
+ gac/oauth/__init__.py,sha256=wwfeIMGgpIAb8-ptLcSDyK_sM72HI1bkULyJm7BwVs8,614
37
+ gac/oauth/claude_code.py,sha256=KJEc-318aOKuyhQKjRYk8oyNqazhvnBU-rvM9CFNYKg,14092
38
+ gac/oauth/qwen_oauth.py,sha256=W-JCZYtCrhoDJUuGATLWrfxTs8fevd9Cj-x0RAriV5w,11151
39
+ gac/oauth/token_store.py,sha256=HW2sWKwkgyCuGCF5OwHaslH82s77hpFUcKCNQpWCD-8,2517
40
+ gac/providers/README.md,sha256=Vcep039sEqngYhxe18wM0rYpl_VccrRRrTqd9o8g3h4,12106
41
+ gac/providers/__init__.py,sha256=saJF1G2aHmOHzT7sWqXvoYy6c7gWbTB_AEYht7NeQkw,3111
42
+ gac/providers/anthropic.py,sha256=DgONlbKVHH8W4AlqPP-T4AmAxWADMMlqPAfi8GfhH7Q,535
43
+ gac/providers/azure_openai.py,sha256=t2D_r-OxzEy7Av2sRFFs5E_Zclsgk1o40UFuybtti08,2247
44
+ gac/providers/base.py,sha256=w42ILqRPuSJm5-NUmoYB4aY30apweNF4x-X6-Kkr3Jw,11138
45
+ gac/providers/cerebras.py,sha256=jz84u-ALqrYzCz13-FGBzPAhKdWJQ-Qw0KpuX1fuX7s,503
46
+ gac/providers/chutes.py,sha256=nLZBLL-E6qa6YePD_fvbXcI4nOA6L87lx7_292HPkDk,850
47
+ gac/providers/claude_code.py,sha256=-RY3v5xIdfS1UMkl7ZrGtHF678KXZ3eI-AeVusz3RC0,2926
48
+ gac/providers/custom_anthropic.py,sha256=jzZ4ep0BS14isDdmRJ7tqlArzUnJ4CIWEptuWG8X3yI,4360
49
+ gac/providers/custom_openai.py,sha256=11NOpTDG_k29bxnuACW7iXOhf-XKrTt1gxp9J1GBoy0,1578
50
+ gac/providers/deepseek.py,sha256=Zn1npn0DxgAQVHpTxhUn8XZPBBQNj9ajmJcX_Q6Xk28,498
51
+ gac/providers/error_handler.py,sha256=PcddgcgABLfK_pmODLkpwWSn4-aiptzTPn1D5DA9HqA,5640
52
+ gac/providers/fireworks.py,sha256=8ESmRldJDL3aOBMM68jTHvfyznjHOQKcOhhkTxGFwQo,516
53
+ gac/providers/gemini.py,sha256=ke8rshxGkcB9yVWN9qHmvTpDtFAGYaigpghxZt8q8Dw,3438
54
+ gac/providers/groq.py,sha256=rwqBHrM4SfZHVwXHpp9GPDYJozjSzjxj1Lc1WETY_NY,481
55
+ gac/providers/kimi_coding.py,sha256=TTB13J3s2Gp3dvr3SXafjdl2plF4uix2-bHB_DqQZSQ,1038
56
+ gac/providers/lmstudio.py,sha256=egGswgSgyJL4fBYz_L_zAgPsS9xj2dS8D5udzx_ihew,3054
57
+ gac/providers/minimax.py,sha256=rviAMgTdjQ5iSAXgmJKEf-kGrH5Wb-HFAydSjRkzq7Y,493
58
+ gac/providers/mistral.py,sha256=wp9j-uRWQT6oijGOBJumljuZQEUcF8aRhlw_TiVy2KY,491
59
+ gac/providers/moonshot.py,sha256=Q1HtSkRZFCJsVvrDETdojZgVBdB_A1gX5OZqIOHFnq0,496
60
+ gac/providers/ollama.py,sha256=O91Rmn-eptzTHKsbaiZAG3CpUYj2nGvsD6w54YcfLMw,2569
61
+ gac/providers/openai.py,sha256=giQSTxyNHvTxtBODENPTIc7ObdNtV5lu1uf7a3gkgSI,1216
62
+ gac/providers/openrouter.py,sha256=ShpF7ew6n2_7BSr9mqLHf1rG_V_ykrIjmaplbY4jZsk,779
63
+ gac/providers/protocol.py,sha256=QY474-0I8qOkMBxg4l_IoDgrT475OjdRv8pT4ckeAwA,1771
64
+ gac/providers/qwen.py,sha256=7Krb5c44A0yC0hI9JswGcEl--llhrjWypE6nDCdgX2Q,2398
65
+ gac/providers/registry.py,sha256=50BDPZcvbuqPwY98OTDCOIJjnhXHBBrWWCATKGT353s,1991
66
+ gac/providers/replicate.py,sha256=ISYe85kWX0RbHxmYWo3InZDOZsL3jZXUzq7YiEa_QKE,6402
67
+ gac/providers/streamlake.py,sha256=c2QWIvTGlxOHU5HkdS0bPdKLJIfGgHo2GAMfEQJA1dc,1117
68
+ gac/providers/synthetic.py,sha256=WBHQ6glxkndjPgvBoyG0oj24e-yun4aU6UqDtjll0E4,1535
69
+ gac/providers/together.py,sha256=ethi_6WhR6DTe3idZQXpXAeJOdEg_EefP5erAHDtS_A,501
70
+ gac/providers/zai.py,sha256=HSvpxE5uM4kE5zrs3pWHuer7LusRgWCDfYiN1R9sHSw,1010
71
+ gac/templates/__init__.py,sha256=lwaKKSWb21MUxEtYzUOJ3dHsfMgxZ_W60uR9aC6yMrs,50
72
+ gac/templates/question_generation.txt,sha256=nX-eOeW_hqofGXNJVLPxWMxNVxxV_21l25fqnAOJH9o,2868
73
+ gac/templates/system_prompt.txt,sha256=0eMkBTZVjxJDjutVpb5Sxif5QOhAtXWSSF3tNizI0S4,11076
74
+ gac/templates/user_prompt.txt,sha256=QF3bkOnAA5bKcqYnPEi1fHeHS41FWWQLLPRk0Q8YRqw,864
75
+ gac-3.10.10.dist-info/METADATA,sha256=4yUk_r17dJsWriEIxdICfpesJlF3CuC3DUZ9pZUe6Pk,11440
76
+ gac-3.10.10.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
77
+ gac-3.10.10.dist-info/entry_points.txt,sha256=tdjN-XMmcWfL92swuRAjT62bFLOAwk9bTMRLGP5Z4aI,36
78
+ gac-3.10.10.dist-info/licenses/LICENSE,sha256=vOab37NouL1PNs5BswnPayrMCqaN2sqLfMQfqPDrpZg,1103
79
+ gac-3.10.10.dist-info/RECORD,,
gac/constants.py DELETED
@@ -1,328 +0,0 @@
1
- """Constants for the Git Auto Commit (gac) project."""
2
-
3
- import os
4
- from enum import Enum
5
-
6
-
7
- class FileStatus(Enum):
8
- """File status for Git operations."""
9
-
10
- MODIFIED = "M"
11
- ADDED = "A"
12
- DELETED = "D"
13
- RENAMED = "R"
14
- COPIED = "C"
15
- UNTRACKED = "?"
16
-
17
-
18
- class EnvDefaults:
19
- """Default values for environment variables."""
20
-
21
- MAX_RETRIES: int = 3
22
- TEMPERATURE: float = 1
23
- MAX_OUTPUT_TOKENS: int = 4096 # includes reasoning tokens
24
- WARNING_LIMIT_TOKENS: int = 32768
25
- ALWAYS_INCLUDE_SCOPE: bool = False
26
- SKIP_SECRET_SCAN: bool = False
27
- VERBOSE: bool = False
28
- NO_TIKTOKEN: bool = False
29
- NO_VERIFY_SSL: bool = False # Skip SSL certificate verification (for corporate proxies)
30
- HOOK_TIMEOUT: int = 120 # Timeout for pre-commit and lefthook hooks in seconds
31
-
32
-
33
- class ProviderDefaults:
34
- """Default values for provider configurations."""
35
-
36
- HTTP_TIMEOUT: int = 120 # seconds - timeout for HTTP requests to LLM providers
37
-
38
-
39
- class Logging:
40
- """Logging configuration constants."""
41
-
42
- DEFAULT_LEVEL: str = "WARNING"
43
- LEVELS: list[str] = ["DEBUG", "INFO", "WARNING", "ERROR"]
44
-
45
-
46
- class Utility:
47
- """General utility constants."""
48
-
49
- DEFAULT_ENCODING: str = "cl100k_base" # llm encoding
50
- DEFAULT_DIFF_TOKEN_LIMIT: int = 15000 # Maximum tokens for diff processing
51
- MAX_WORKERS: int = os.cpu_count() or 4 # Maximum number of parallel workers
52
- MAX_DISPLAYED_SECRET_LENGTH: int = 50 # Maximum length for displaying secrets
53
-
54
-
55
- class FilePatterns:
56
- """Patterns for identifying special file types."""
57
-
58
- # Regex patterns to detect binary file changes in git diffs (e.g., images or other non-text files)
59
- BINARY: list[str] = [
60
- r"Binary files .* differ",
61
- r"GIT binary patch",
62
- ]
63
-
64
- # Regex patterns to detect minified files in git diffs (e.g., JavaScript or CSS files)
65
- MINIFIED_EXTENSIONS: list[str] = [
66
- ".min.js",
67
- ".min.css",
68
- ".bundle.js",
69
- ".bundle.css",
70
- ".compressed.js",
71
- ".compressed.css",
72
- ".opt.js",
73
- ".opt.css",
74
- ]
75
-
76
- # Regex patterns to detect build directories in git diffs (e.g., dist, build, vendor, etc.)
77
- BUILD_DIRECTORIES: list[str] = [
78
- "/dist/",
79
- "/build/",
80
- "/vendor/",
81
- "/node_modules/",
82
- "/assets/vendor/",
83
- "/public/build/",
84
- "/static/dist/",
85
- ]
86
-
87
-
88
- class FileTypeImportance:
89
- """Importance multipliers for different file types."""
90
-
91
- EXTENSIONS: dict[str, float] = {
92
- # Programming languages
93
- ".py": 5.0, # Python
94
- ".js": 4.5, # JavaScript
95
- ".ts": 4.5, # TypeScript
96
- ".jsx": 4.8, # React JS
97
- ".tsx": 4.8, # React TS
98
- ".go": 4.5, # Go
99
- ".rs": 4.5, # Rust
100
- ".java": 4.2, # Java
101
- ".c": 4.2, # C
102
- ".h": 4.2, # C/C++ header
103
- ".cpp": 4.2, # C++
104
- ".rb": 4.2, # Ruby
105
- ".php": 4.0, # PHP
106
- ".scala": 4.0, # Scala
107
- ".swift": 4.0, # Swift
108
- ".kt": 4.0, # Kotlin
109
- # Configuration
110
- ".json": 3.5, # JSON config
111
- ".yaml": 3.8, # YAML config
112
- ".yml": 3.8, # YAML config
113
- ".toml": 3.8, # TOML config
114
- ".ini": 3.5, # INI config
115
- ".env": 3.5, # Environment variables
116
- # Documentation
117
- ".md": 2.5, # Markdown (reduced to prioritize code changes)
118
- ".rst": 2.5, # reStructuredText (reduced to prioritize code changes)
119
- # Web
120
- ".html": 3.5, # HTML
121
- ".css": 3.5, # CSS
122
- ".scss": 3.5, # SCSS
123
- ".svg": 2.5, # SVG graphics
124
- # Build & CI
125
- "Dockerfile": 4.0, # Docker
126
- ".github/workflows": 4.0, # GitHub Actions
127
- "CMakeLists.txt": 3.8, # CMake
128
- "Makefile": 3.8, # Make
129
- "package.json": 4.2, # NPM package
130
- "pyproject.toml": 4.2, # Python project
131
- "requirements.txt": 4.0, # Python requirements
132
- }
133
-
134
-
135
- class CodePatternImportance:
136
- """Importance multipliers for different code patterns."""
137
-
138
- # Regex patterns to detect code structure changes in git diffs (e.g., class, function, import)
139
- # Note: The patterns are prefixed with "+" to match only added and modified lines
140
- PATTERNS: dict[str, float] = {
141
- # Structure changes
142
- r"\+\s*(class|interface|enum)\s+\w+": 1.8, # Class/interface/enum definitions
143
- r"\+\s*(def|function|func)\s+\w+\s*\(": 1.5, # Function definitions
144
- r"\+\s*(import|from .* import)": 1.3, # Imports
145
- r"\+\s*(public|private|protected)\s+\w+": 1.2, # Access modifiers
146
- # Configuration changes
147
- r"\+\s*\"(dependencies|devDependencies)\"": 1.4, # Package dependencies
148
- r"\+\s*version[\"\s:=]+[0-9.]+": 1.3, # Version changes
149
- # Logic changes
150
- r"\+\s*(if|else|elif|switch|case|for|while)[\s(]": 1.2, # Control structures
151
- r"\+\s*(try|catch|except|finally)[\s:]": 1.2, # Exception handling
152
- r"\+\s*return\s+": 1.1, # Return statements
153
- r"\+\s*await\s+": 1.1, # Async/await
154
- # Comments & docs
155
- r"\+\s*(//|#|/\*|\*\*)\s*TODO": 1.2, # TODOs
156
- r"\+\s*(//|#|/\*|\*\*)\s*FIX": 1.3, # FIXes
157
- r"\+\s*(\"\"\"|\'\'\')": 1.1, # Docstrings
158
- # Test code
159
- r"\+\s*(test|describe|it|should)\s*\(": 1.1, # Test definitions
160
- r"\+\s*(assert|expect)": 1.0, # Assertions
161
- }
162
-
163
-
164
- class Languages:
165
- """Language code mappings and utilities."""
166
-
167
- # Language code to full name mapping
168
- # Supports ISO 639-1 codes and common variants
169
- CODE_MAP: dict[str, str] = {
170
- # English
171
- "en": "English",
172
- # Chinese
173
- "zh": "Simplified Chinese",
174
- "zh-cn": "Simplified Chinese",
175
- "zh-hans": "Simplified Chinese",
176
- "zh-tw": "Traditional Chinese",
177
- "zh-hant": "Traditional Chinese",
178
- # Japanese
179
- "ja": "Japanese",
180
- # Korean
181
- "ko": "Korean",
182
- # Spanish
183
- "es": "Spanish",
184
- # Portuguese
185
- "pt": "Portuguese",
186
- # French
187
- "fr": "French",
188
- # German
189
- "de": "German",
190
- # Russian
191
- "ru": "Russian",
192
- # Hindi
193
- "hi": "Hindi",
194
- # Italian
195
- "it": "Italian",
196
- # Polish
197
- "pl": "Polish",
198
- # Turkish
199
- "tr": "Turkish",
200
- # Dutch
201
- "nl": "Dutch",
202
- # Vietnamese
203
- "vi": "Vietnamese",
204
- # Thai
205
- "th": "Thai",
206
- # Indonesian
207
- "id": "Indonesian",
208
- # Swedish
209
- "sv": "Swedish",
210
- # Arabic
211
- "ar": "Arabic",
212
- # Hebrew
213
- "he": "Hebrew",
214
- # Greek
215
- "el": "Greek",
216
- # Danish
217
- "da": "Danish",
218
- # Norwegian
219
- "no": "Norwegian",
220
- "nb": "Norwegian",
221
- "nn": "Norwegian",
222
- # Finnish
223
- "fi": "Finnish",
224
- }
225
-
226
- # List of languages with display names and English names for CLI selection
227
- # Format: (display_name, english_name)
228
- LANGUAGES: list[tuple[str, str]] = [
229
- ("English", "English"),
230
- ("简体中文", "Simplified Chinese"),
231
- ("繁體中文", "Traditional Chinese"),
232
- ("日本語", "Japanese"),
233
- ("한국어", "Korean"),
234
- ("Español", "Spanish"),
235
- ("Português", "Portuguese"),
236
- ("Français", "French"),
237
- ("Deutsch", "German"),
238
- ("Русский", "Russian"),
239
- ("हिन्दी", "Hindi"),
240
- ("Italiano", "Italian"),
241
- ("Polski", "Polish"),
242
- ("Türkçe", "Turkish"),
243
- ("Nederlands", "Dutch"),
244
- ("Tiếng Việt", "Vietnamese"),
245
- ("ไทย", "Thai"),
246
- ("Bahasa Indonesia", "Indonesian"),
247
- ("Svenska", "Swedish"),
248
- ("العربية", "Arabic"),
249
- ("עברית", "Hebrew"),
250
- ("Ελληνικά", "Greek"),
251
- ("Dansk", "Danish"),
252
- ("Norsk", "Norwegian"),
253
- ("Suomi", "Finnish"),
254
- ("Custom", "Custom"),
255
- ]
256
-
257
- @staticmethod
258
- def resolve_code(language: str) -> str:
259
- """Resolve a language code to its full name.
260
-
261
- Args:
262
- language: Language name or code (e.g., 'Spanish', 'es', 'zh-CN')
263
-
264
- Returns:
265
- Full language name (e.g., 'Spanish', 'Simplified Chinese')
266
-
267
- If the input is already a full language name, it's returned as-is.
268
- If it's a recognized code, it's converted to the full name.
269
- Otherwise, the input is returned unchanged (for custom languages).
270
- """
271
- # Normalize the code to lowercase for lookup
272
- code_lower = language.lower().strip()
273
-
274
- # Check if it's a recognized code
275
- if code_lower in Languages.CODE_MAP:
276
- return Languages.CODE_MAP[code_lower]
277
-
278
- # Return as-is (could be a full name or custom language)
279
- return language
280
-
281
-
282
- class CommitMessageConstants:
283
- """Constants for commit message generation and cleaning."""
284
-
285
- # Conventional commit type prefixes
286
- CONVENTIONAL_PREFIXES: list[str] = [
287
- "feat",
288
- "fix",
289
- "docs",
290
- "style",
291
- "refactor",
292
- "perf",
293
- "test",
294
- "build",
295
- "ci",
296
- "chore",
297
- ]
298
-
299
- # XML tags that may leak from prompt templates into AI responses
300
- XML_TAGS_TO_REMOVE: list[str] = [
301
- "<git-status>",
302
- "</git-status>",
303
- "<git_status>",
304
- "</git_status>",
305
- "<git-diff>",
306
- "</git-diff>",
307
- "<git_diff>",
308
- "</git_diff>",
309
- "<repository_context>",
310
- "</repository_context>",
311
- "<instructions>",
312
- "</instructions>",
313
- "<format>",
314
- "</format>",
315
- "<conventions>",
316
- "</conventions>",
317
- ]
318
-
319
- # Indicators that mark the start of the actual commit message in AI responses
320
- COMMIT_INDICATORS: list[str] = [
321
- "# Your commit message:",
322
- "Your commit message:",
323
- "The commit message is:",
324
- "Here's the commit message:",
325
- "Commit message:",
326
- "Final commit message:",
327
- "# Commit Message",
328
- ]
@@ -1,56 +0,0 @@
1
- gac/__init__.py,sha256=z9yGInqtycFIT3g1ca24r-A3699hKVaRqGUI79wsmMc,415
2
- gac/__version__.py,sha256=KrwCaC6wbdQ2R2fD_kzJyUu5mtDSBRAe_FPDHQiGA4I,66
3
- gac/ai.py,sha256=HnXmRFmUJin5k755iBqSLgKYssjShjKXz9SwICEpMag,3835
4
- gac/ai_utils.py,sha256=FHN-cbU6_ofICqJOdw1TmN2z1lcW1KqVC8xXFF38HwA,11081
5
- gac/auth_cli.py,sha256=D1UcpOdyLqnKNJQTBq2lHCHBaxFZsRbM4Krvg-1-NfA,6822
6
- gac/cli.py,sha256=MgzcRwBrgq10uczRpWh3rIVTvBGCBdvldZloqEwWQRQ,7940
7
- gac/config.py,sha256=dycwZfB7i0XyNA8qySyxH1UpV0Dkw_FsCluB9SqUcZQ,4667
8
- gac/config_cli.py,sha256=o8UEEoWwZJ7xmDUbNPZEnbdANd1nLb4HMpmqMbcbbaY,2376
9
- gac/constants.py,sha256=ckzm2yM2-DA_98TRpetX5mzQ28TqJPGtm0cEZnRj_A8,9958
10
- gac/diff_cli.py,sha256=wnVQ9OFGnM0d2Pj9WVjWbo0jxqIuRHVAwmb8wU9Pa3E,5676
11
- gac/errors.py,sha256=ysDIVRCd0YQVTOW3Q6YzdolxCdtkoQCAFf3_jrqbjUY,7916
12
- gac/git.py,sha256=_NRkOyb6u8SiPrG-t-7GspjdSp7yptmNj1gT8VexmcY,12913
13
- gac/init_cli.py,sha256=UbldjcEjypHHpAn49tMddzaFQtwwAjlf8ZBQVPoz9YQ,2299
14
- gac/language_cli.py,sha256=NHg8Q2cAjt4-VOaIYdU5FL_ISvSyu5rbgs232CqfhzM,12929
15
- gac/main.py,sha256=W9OafYQ5_QP87RWZTBEvdEu-aCf8MPRhF5XnnZ28lCo,44193
16
- gac/model_cli.py,sha256=p5bkPxJrXd7vyN2vPP91I-TPyqRdvO3X1P-nw_95BAI,18342
17
- gac/preprocess.py,sha256=hk2p2X4-xVDvuy-T1VMzMa9k5fTUbhlWDyw89DCf81Q,15379
18
- gac/prompt.py,sha256=3pLc6Sfe6VVc3WBNg-Y7yaHcfhwn4aEi01Ro32CZqtQ,36262
19
- gac/security.py,sha256=QT91mBEo2Y7la-aXvKuF2zhWuoOSXb6PWKLJ93kSy2k,9926
20
- gac/utils.py,sha256=CiUSiGasX2myqjMaZPgrM_WZlCFhFogvdxhNTc3kn4w,12637
21
- gac/workflow_utils.py,sha256=rGN7PqTqeUFLn260gm3hKyzF1PDVVuEsV1i2QHu2EO4,8118
22
- gac/oauth/__init__.py,sha256=wwfeIMGgpIAb8-ptLcSDyK_sM72HI1bkULyJm7BwVs8,614
23
- gac/oauth/claude_code.py,sha256=UqHrB2VbJsKeB2dq2T7qcScUPxCE1PaYCD5S3VwsLfU,14101
24
- gac/oauth/qwen_oauth.py,sha256=Gs2L7VM8FopAE9-wzWyC64MNPmsBu8GrDI2vncqE0GI,10995
25
- gac/oauth/token_store.py,sha256=d-MfgB3_hfqmn90hR73ajqNRgrPnoQLJN_Bra00Bfsw,2523
26
- gac/providers/__init__.py,sha256=xUtR2-MZRrRVC0A51M6BsiN2cdth52BZVIEbDkH6Wdc,2969
27
- gac/providers/anthropic.py,sha256=lqOmnHbHde6pifOogclPL9Wvb-4YPIB9wQDvI346dC0,2374
28
- gac/providers/azure_openai.py,sha256=paH6LJL_mA-812QutfMbKmoPpenQMirolhQ7x70vtiE,4072
29
- gac/providers/cerebras.py,sha256=WsqT5pTE-j7psOshddyIBAGdXD3Twxqtdym-gaM_-vQ,1984
30
- gac/providers/chutes.py,sha256=xBoOcawwCKjqVk26W-yYfgewn-sCbBEet36U9PSYyNw,2955
31
- gac/providers/claude_code.py,sha256=RwxOT7ARgRlUazPgU4mfzYpSW6P12NxttK-WfJJc6pw,4411
32
- gac/providers/custom_anthropic.py,sha256=XdHv_OXeIi2SkIUCYeEV_q3InOvrYOHBZJ0P-rTJohM,5682
33
- gac/providers/custom_openai.py,sha256=ImwWBcda5Gr51gPtBdUL2ApLHx3eEHV8e-9SfYxMaao,4095
34
- gac/providers/deepseek.py,sha256=r3V5jPm0zPba8XIcZwswM1wXw8V6JWe5JVogmA6XsY8,1979
35
- gac/providers/fireworks.py,sha256=v2qPfE3cSRQOIPrSiWRcD0aS-p-Cu82IdHXXOk9kIrQ,2032
36
- gac/providers/gemini.py,sha256=GN6AsUbaidrM6blVD65TAE2hmACbOQBbIIW849jM0hI,3680
37
- gac/providers/groq.py,sha256=r780wFe40niJ1ObxbYEU3SbR0Nsewrfxwmk51MFWTsk,2959
38
- gac/providers/kimi_coding.py,sha256=PaCuqtBB3PWDYb36-tMfQUJpoLoqoMti5bMRhRYvVoU,2880
39
- gac/providers/lmstudio.py,sha256=NTHig1naUm01R2GriGVAxozoPJulQZT2AK_kRlWEzSU,2561
40
- gac/providers/minimax.py,sha256=-_mS5FajMLgXcz-K6-dhIo6Obk5ML4sMLduEQsvmGSs,1964
41
- gac/providers/mistral.py,sha256=pUJ0mDbxK8WXH5AUJ8d2g5eoyI2FBkdnqbv4ijpP4Vw,1964
42
- gac/providers/moonshot.py,sha256=UEEfgNhd2I3cDw2IwlC19u0ufLEM4AWgp0WW0PS2wmE,2004
43
- gac/providers/ollama.py,sha256=OFKDnzFyzG7_OGPDgiK367-7FKuXmr84LFU9kL1iJjI,2427
44
- gac/providers/openai.py,sha256=nsiOXljNfB_eeaRu09OIwHZpGuhF5WoXWCx99Hz7Kdo,1962
45
- gac/providers/openrouter.py,sha256=tFmC9KfLcNAEFiiBxEuX5pzgVuXa6cdtUKmnKLtadpk,2544
46
- gac/providers/qwen.py,sha256=xw0N2Tx0_FVFi_RPFxZgPcGlvexhpHSp7XVh7ej2Za4,2983
47
- gac/providers/replicate.py,sha256=ScSz-Bzin77VG3XZowc-mIHA2Nj9B2NTeMPHmFZOFdY,4212
48
- gac/providers/streamlake.py,sha256=_YAcEqmn6YFUzIN1NjKavGaqF5j1DyyrB5MlwB6omgY,2387
49
- gac/providers/synthetic.py,sha256=U7XGtReX7extGOp_qvVrAcFcq4hdfcdAF2y7oURevBc,2201
50
- gac/providers/together.py,sha256=Bg1cb4DCSjgdZoa2RDyt9hC9NYTcXZJ_b5MZ4vWlFp8,2009
51
- gac/providers/zai.py,sha256=RC_wWOrs1OtPlkOVsBqQ0BqYF7DSymqHq6gZznhCEbk,3088
52
- gac-3.8.1.dist-info/METADATA,sha256=A22DCTy3KBqB2BNifXjpFszAnov2TuRo0WgKF4uRpQg,11438
53
- gac-3.8.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
54
- gac-3.8.1.dist-info/entry_points.txt,sha256=tdjN-XMmcWfL92swuRAjT62bFLOAwk9bTMRLGP5Z4aI,36
55
- gac-3.8.1.dist-info/licenses/LICENSE,sha256=vOab37NouL1PNs5BswnPayrMCqaN2sqLfMQfqPDrpZg,1103
56
- gac-3.8.1.dist-info/RECORD,,
File without changes