@senad-d/branchme 0.3.15 → 0.3.17

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/src/constants.ts CHANGED
@@ -2,6 +2,19 @@ export const EXTENSION_DISPLAY_NAME = "BranchMe";
2
2
  export const BRANCHME_COMMAND_NAME = "branchme";
3
3
 
4
4
  export const BRANCH_STATUS_TOOL_NAME = "branch_status";
5
+ export const GIT_DIFF_TOOL_NAME = "git_diff";
6
+ export const GIT_STATUS_TOOL_NAME = "git_status";
7
+ export const GIT_LOG_TOOL_NAME = "git_log";
8
+ export const GIT_SHOW_TOOL_NAME = "git_show";
9
+ export const GIT_CONFLICTS_TOOL_NAME = "git_conflicts";
10
+ export const LIST_REMOTES_TOOL_NAME = "list_remotes";
11
+ export const ADD_REMOTE_TOOL_NAME = "add_remote";
12
+ export const SET_UPSTREAM_TOOL_NAME = "set_upstream";
13
+ export const STAGE_CHANGES_TOOL_NAME = "stage_changes";
14
+ export const UNSTAGE_CHANGES_TOOL_NAME = "unstage_changes";
15
+ export const COMMIT_CHANGES_TOOL_NAME = "commit_changes";
16
+ export const RESTORE_PATHS_TOOL_NAME = "restore_paths";
17
+ export const REVERT_CHANGES_TOOL_NAME = "revert_changes";
5
18
  export const LIST_BRANCHES_TOOL_NAME = "list_branches";
6
19
  export const TRACK_BRANCH_TOOL_NAME = "track_branch";
7
20
  export const UPDATE_FROM_BASE_TOOL_NAME = "update_from_base";
@@ -16,6 +29,9 @@ export const REBASE_BRANCH_TOOL_NAME = "rebase_branch";
16
29
  export const PUSH_BRANCH_TOOL_NAME = "push_branch";
17
30
  export const PULL_REQUEST_TOOL_NAME = "pull_request";
18
31
  export const PULL_REQUEST_STATUS_TOOL_NAME = "pull_request_status";
32
+ export const PULL_REQUEST_CHECKS_TOOL_NAME = "pull_request_checks";
33
+ export const EDIT_PULL_REQUEST_TOOL_NAME = "edit_pull_request";
34
+ export const MERGE_PULL_REQUEST_TOOL_NAME = "merge_pull_request";
19
35
  export const PULL_REQUEST_FEEDBACK_TOOL_NAME = "pull_request_feedback";
20
36
  export const REPLY_PULL_REQUEST_FEEDBACK_TOOL_NAME = "reply_pull_request_feedback";
21
37
  export const PULL_REQUEST_FILES_TOOL_NAME = "pull_request_files";
@@ -30,6 +46,19 @@ export const PULL_REQUEST_AUTOFILL_ENV_NAME = "BRANCHME_PR_AUTOFILL";
30
46
 
31
47
  export const BRANCHME_TOOL_NAMES = [
32
48
  BRANCH_STATUS_TOOL_NAME,
49
+ GIT_DIFF_TOOL_NAME,
50
+ GIT_STATUS_TOOL_NAME,
51
+ GIT_LOG_TOOL_NAME,
52
+ GIT_SHOW_TOOL_NAME,
53
+ GIT_CONFLICTS_TOOL_NAME,
54
+ LIST_REMOTES_TOOL_NAME,
55
+ ADD_REMOTE_TOOL_NAME,
56
+ SET_UPSTREAM_TOOL_NAME,
57
+ STAGE_CHANGES_TOOL_NAME,
58
+ UNSTAGE_CHANGES_TOOL_NAME,
59
+ COMMIT_CHANGES_TOOL_NAME,
60
+ RESTORE_PATHS_TOOL_NAME,
61
+ REVERT_CHANGES_TOOL_NAME,
33
62
  LIST_BRANCHES_TOOL_NAME,
34
63
  TRACK_BRANCH_TOOL_NAME,
35
64
  UPDATE_FROM_BASE_TOOL_NAME,
@@ -47,6 +76,9 @@ export const BRANCHME_TOOL_NAMES = [
47
76
  PUSH_BRANCH_TOOL_NAME,
48
77
  PULL_REQUEST_TOOL_NAME,
49
78
  PULL_REQUEST_STATUS_TOOL_NAME,
79
+ PULL_REQUEST_CHECKS_TOOL_NAME,
80
+ EDIT_PULL_REQUEST_TOOL_NAME,
81
+ MERGE_PULL_REQUEST_TOOL_NAME,
50
82
  PULL_REQUEST_FEEDBACK_TOOL_NAME,
51
83
  REPLY_PULL_REQUEST_FEEDBACK_TOOL_NAME,
52
84
  PULL_REQUEST_FILES_TOOL_NAME,
@@ -77,6 +109,17 @@ export const GIT_CONTEXT_VALUE_LIMIT_CHARS = 512;
77
109
  export const GIT_CONTEXT_SUMMARY_LIMIT_CHARS = 4_000;
78
110
  export const PULL_REQUEST_AUTOFILL_COMMIT_LIMIT = 20;
79
111
  export const PULL_REQUEST_AUTOFILL_SUBJECT_LIMIT_CHARS = 256;
112
+ export const GIT_DIFF_OUTPUT_LIMIT_BYTES = 32 * 1024;
113
+ export const GIT_DIFF_OUTPUT_LIMIT_LINES = 1_000;
114
+ export const GIT_DIFF_PATH_LIMIT = 25;
115
+ export const GIT_STATUS_PAGE_LIMIT = 50;
116
+ export const GIT_STATUS_PAGE_BYTES = 24 * 1024;
117
+ export const GIT_STATUS_RAW_LIMIT_BYTES = 4 * 1024 * 1024;
118
+ export const GIT_STATUS_FILE_LIMIT_BYTES = 8 * 1024 * 1024;
119
+ export const GIT_STATUS_CURSOR_LIMIT_CHARS = 100;
120
+ export const GIT_DIFF_CONTEXT_LIMIT = 20;
121
+ export const GIT_DIFF_CONTEXT_DEFAULT_LINES = 3;
122
+ export const GIT_DIFF_PATH_PREVIEW_LIMIT_CHARS = 128;
80
123
  export const GIT_BRANCH_RAW_OUTPUT_LIMIT_BYTES = 128 * 1024;
81
124
  export const GIT_BRANCH_ENTRY_LIMIT = 200;
82
125
  export const GIT_BRANCH_PATTERN_LIMIT = 25;
@@ -109,3 +152,98 @@ export const PULL_REQUEST_REPLY_BODY_LIMIT_CHARS = 4_000;
109
152
  export const PULL_REQUEST_LABEL_LIMIT = 5;
110
153
  export const GITHUB_GRAPHQL_TIMEOUT_MS = 15_000;
111
154
  export const GITHUB_JOB_LOG_TIMEOUT_MS = 30_000;
155
+
156
+ export const DEFAULT_DIFF_FILE_LIMIT = 24;
157
+ export const DEFAULT_DIFF_MAX_LINES = 360;
158
+ export const DEFAULT_DIFF_MAX_BYTES = 28_000;
159
+ export const DEFAULT_PROJECT_CONTEXT_FILE_LIMIT = 10;
160
+ export const DEFAULT_PROJECT_FILE_MAX_LINES = 80;
161
+ export const DEFAULT_PROJECT_FILE_MAX_BYTES = 8_000;
162
+ export const DEFAULT_PROMPT_MAX_BYTES = 48_000;
163
+ export const COMPACT_PROMPT_MAX_BYTES = 28_000;
164
+ export const LARGE_PROMPT_MAX_BYTES = 56_000;
165
+ export const DEFAULT_PROMPT_MAX_LINES = 1_200;
166
+ export const COMPACT_PROMPT_MAX_LINES = 900;
167
+ export const LARGE_PROMPT_MAX_LINES = 1_500;
168
+ export const DEFAULT_STEERING_PROMPT_MAX_LINES = 80;
169
+ export const DEFAULT_STEERING_PROMPT_MAX_BYTES = 4_000;
170
+ export const DEFAULT_DRAFT_MAX_TOKENS = 1_024;
171
+ export const DEFAULT_DRAFT_RETRY_MAX_TOKENS = 1_536;
172
+ export const DRAFT_REPAIR_MAX_TOKENS = 1_024;
173
+ export const DRAFT_RETRY_MAX_ATTEMPTS = 1;
174
+
175
+ export const COMMIT_PROMPT_SECTION_BUDGETS = {
176
+ compact: {
177
+ steeringPrompt: { maxBytes: 1_500, maxLines: 30 },
178
+ repositorySummary: { maxBytes: 1_500, maxLines: 40 },
179
+ changedFiles: { maxBytes: 3_000, maxLines: 90 },
180
+ diffStats: { maxBytes: 2_000, maxLines: 70 },
181
+ changedFileSnippets: { maxBytes: 4_500, maxLines: 150 },
182
+ diffExcerpts: { maxBytes: 5_500, maxLines: 190 },
183
+ omittedContext: { maxBytes: 1_500, maxLines: 50 },
184
+ projectMetadata: { maxBytes: 1_500, maxLines: 60 },
185
+ },
186
+ default: {
187
+ steeringPrompt: { maxBytes: 2_500, maxLines: 50 },
188
+ repositorySummary: { maxBytes: 2_000, maxLines: 50 },
189
+ changedFiles: { maxBytes: 5_000, maxLines: 150 },
190
+ diffStats: { maxBytes: 3_500, maxLines: 110 },
191
+ changedFileSnippets: { maxBytes: 9_000, maxLines: 280 },
192
+ diffExcerpts: { maxBytes: 12_000, maxLines: 380 },
193
+ omittedContext: { maxBytes: 2_500, maxLines: 80 },
194
+ projectMetadata: { maxBytes: 3_000, maxLines: 100 },
195
+ },
196
+ large: {
197
+ steeringPrompt: { maxBytes: 3_000, maxLines: 60 },
198
+ repositorySummary: { maxBytes: 2_500, maxLines: 60 },
199
+ changedFiles: { maxBytes: 6_000, maxLines: 180 },
200
+ diffStats: { maxBytes: 4_000, maxLines: 130 },
201
+ changedFileSnippets: { maxBytes: 12_000, maxLines: 360 },
202
+ diffExcerpts: { maxBytes: 16_000, maxLines: 480 },
203
+ omittedContext: { maxBytes: 3_000, maxLines: 100 },
204
+ projectMetadata: { maxBytes: 4_000, maxLines: 130 },
205
+ },
206
+ } as const;
207
+
208
+ export const CONVENTIONAL_COMMIT_TYPES = [
209
+ "feat",
210
+ "fix",
211
+ "refactor",
212
+ "docs",
213
+ "test",
214
+ "chore",
215
+ "build",
216
+ "ci",
217
+ "perf",
218
+ "style",
219
+ "revert",
220
+ ] as const;
221
+
222
+ export const CONVENTIONAL_COMMIT_TYPE_DESCRIPTIONS = {
223
+ feat: "new feature",
224
+ fix: "bug fix",
225
+ refactor: "code change without behavior change",
226
+ docs: "documentation only",
227
+ test: "tests only",
228
+ chore: "maintenance",
229
+ build: "build system or dependency changes",
230
+ ci: "CI/CD changes",
231
+ perf: "performance improvement",
232
+ style: "formatting only",
233
+ revert: "revert a previous commit",
234
+ } as const satisfies Record<(typeof CONVENTIONAL_COMMIT_TYPES)[number], string>;
235
+
236
+ export const PROJECT_METADATA_CANDIDATES = [
237
+ "package.json",
238
+ "README.md",
239
+ "CHANGELOG.md",
240
+ "pyproject.toml",
241
+ "Cargo.toml",
242
+ "go.mod",
243
+ "pom.xml",
244
+ "build.gradle",
245
+ "deno.json",
246
+ "tsconfig.json",
247
+ "AGENTS.md",
248
+ "CLAUDE.md",
249
+ ] as const;