git-ai-commit-agent 2.0.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 +223 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +151 -0
- package/dist/index.js.map +1 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
# š¤ Git AI Commit Agent
|
|
2
|
+
|
|
3
|
+
CLI tool that automatically generates professional Git commit messages using Language Models (LLM) like OpenAI GPT or AWS Bedrock.
|
|
4
|
+
|
|
5
|
+
## ⨠What it does
|
|
6
|
+
|
|
7
|
+
This tool analyzes staged changes in your Git repository (`git diff --staged`) and generates **3 different** professional commit message options following industry standards (imperative mood in English).
|
|
8
|
+
|
|
9
|
+
**Workflow:**
|
|
10
|
+
1. Stage your changes with `git add`
|
|
11
|
+
2. Run `git-ai-commit-agent`
|
|
12
|
+
3. Get **3 AI-generated commit message options**
|
|
13
|
+
4. Choose your preferred message
|
|
14
|
+
5. Use the selected message to make your commit
|
|
15
|
+
|
|
16
|
+
## š¦ Installation
|
|
17
|
+
|
|
18
|
+
### š Global installation (recommended)
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install -g git-ai-commit-agent
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### š Local installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install git-ai-commit-agent
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### š ļø Development setup
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Clone this repository
|
|
34
|
+
git clone <repository-url>
|
|
35
|
+
cd git-ai-commit-agent
|
|
36
|
+
npm install
|
|
37
|
+
|
|
38
|
+
# Run directly (development mode)
|
|
39
|
+
npm run dev
|
|
40
|
+
|
|
41
|
+
# Build the project
|
|
42
|
+
npm run build
|
|
43
|
+
|
|
44
|
+
# Run compiled version
|
|
45
|
+
node ./dist/index.js
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## āļø Configuration
|
|
49
|
+
|
|
50
|
+
The tool is configured entirely through environment variables. No configuration file is needed.
|
|
51
|
+
|
|
52
|
+
### š§ Environment Variables
|
|
53
|
+
|
|
54
|
+
| Variable | Required | Description |
|
|
55
|
+
|----------|-----------|-------------|
|
|
56
|
+
| `GIT_AI_COMMIT_PROVIDER` | No | Provider: `direct` or `bedrock` (default: `direct`) |
|
|
57
|
+
| `GIT_AI_COMMIT_MODEL` | No | Model to use (default: `gpt-4o-mini`) |
|
|
58
|
+
| `LLM_API_KEY` | Yes (if provider=direct) | API key for the LLM service |
|
|
59
|
+
| `LLM_ENDPOINT` | Yes (if provider=direct) | API endpoint URL |
|
|
60
|
+
| `AWS_ACCESS_KEY_ID` | No (if provider=bedrock) | AWS Access Key ID. Can also be read from `~/.aws/credentials` |
|
|
61
|
+
| `AWS_SECRET_ACCESS_KEY` | No (if provider=bedrock) | AWS Secret Access Key. Can also be read from `~/.aws/credentials` |
|
|
62
|
+
| `AWS_SESSION_TOKEN` | No (if provider=bedrock) | AWS session token (for temporary credentials). Can also be read from `~/.aws/credentials` |
|
|
63
|
+
| `AWS_REGION` | No (if provider=bedrock) | AWS region (e.g., eu-west-1). Can also be read from `~/.aws/config` |
|
|
64
|
+
|
|
65
|
+
**For provider=direct:**
|
|
66
|
+
```bash
|
|
67
|
+
export GIT_AI_COMMIT_PROVIDER=direct
|
|
68
|
+
export GIT_AI_COMMIT_MODEL=gpt-4o-mini
|
|
69
|
+
export LLM_ENDPOINT=https://api.openai.com/v1/chat/completions
|
|
70
|
+
export LLM_API_KEY=sk-your-api-key-here
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**For provider=bedrock:**
|
|
74
|
+
```bash
|
|
75
|
+
export GIT_AI_COMMIT_PROVIDER=bedrock
|
|
76
|
+
export GIT_AI_COMMIT_MODEL=anthropic.claude-3-haiku-20240307-v1:0
|
|
77
|
+
export AWS_ACCESS_KEY_ID=your-access-key
|
|
78
|
+
export AWS_SECRET_ACCESS_KEY=your-secret-key
|
|
79
|
+
export AWS_SESSION_TOKEN=your-session-token
|
|
80
|
+
export AWS_REGION=eu-west-1
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
> **Note:** Ensure your AWS user has permissions to invoke models in Bedrock (`bedrock:InvokeModel`).
|
|
84
|
+
|
|
85
|
+
## š Usage
|
|
86
|
+
|
|
87
|
+
### š Basic workflow
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# 1. Stage your changes
|
|
91
|
+
git add file.txt
|
|
92
|
+
|
|
93
|
+
# 2. Generate commit message options
|
|
94
|
+
git-ai-commit-agent
|
|
95
|
+
|
|
96
|
+
# 3. The program will print 3 commit message options:
|
|
97
|
+
#
|
|
98
|
+
# š¤ Suggested commit messages:
|
|
99
|
+
#
|
|
100
|
+
# 1. Add user authentication to login endpoint
|
|
101
|
+
# 2. Implement JWT-based auth for user login
|
|
102
|
+
# 3. Secure login endpoint with user credentials validation
|
|
103
|
+
#
|
|
104
|
+
# Use: git commit -m "<message>"
|
|
105
|
+
|
|
106
|
+
# 4. Use your preferred message to commit
|
|
107
|
+
git commit -m "Add user authentication to login endpoint"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## š” Examples
|
|
111
|
+
|
|
112
|
+
### š¤ With OpenAI
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# Configuration (environment variables)
|
|
116
|
+
export GIT_AI_COMMIT_PROVIDER=direct
|
|
117
|
+
export GIT_AI_COMMIT_MODEL=gpt-4o-mini
|
|
118
|
+
export LLM_ENDPOINT=https://api.openai.com/v1/chat/completions
|
|
119
|
+
export LLM_API_KEY=sk-...
|
|
120
|
+
|
|
121
|
+
# Usage
|
|
122
|
+
git add .
|
|
123
|
+
git-ai-commit-agent
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### āļø With AWS Bedrock (Claude)
|
|
127
|
+
|
|
128
|
+
**Option 1: Using environment variables**
|
|
129
|
+
```bash
|
|
130
|
+
# Configuration (environment variables)
|
|
131
|
+
export GIT_AI_COMMIT_PROVIDER=bedrock
|
|
132
|
+
export GIT_AI_COMMIT_MODEL=anthropic.claude-3-haiku-20240307-v1:0
|
|
133
|
+
export AWS_ACCESS_KEY_ID=...
|
|
134
|
+
export AWS_SECRET_ACCESS_KEY=...
|
|
135
|
+
export AWS_SESSION_TOKEN=...
|
|
136
|
+
export AWS_REGION=eu-west-1
|
|
137
|
+
|
|
138
|
+
# Usage
|
|
139
|
+
git add .
|
|
140
|
+
git-ai-commit-agent
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Option 2: Using AWS credentials file (simpler if you already use AWS CLI)**
|
|
144
|
+
```bash
|
|
145
|
+
# Make sure you have ~/.aws/credentials configured:
|
|
146
|
+
# [default]
|
|
147
|
+
# aws_access_key_id = your-access-key
|
|
148
|
+
# aws_secret_access_key = your-secret-key
|
|
149
|
+
# aws_session_token = your-session-token # optional
|
|
150
|
+
|
|
151
|
+
# And ~/.aws/config:
|
|
152
|
+
# [default]
|
|
153
|
+
# region = eu-west-1
|
|
154
|
+
|
|
155
|
+
# Then just set the provider and model:
|
|
156
|
+
export GIT_AI_COMMIT_PROVIDER=bedrock
|
|
157
|
+
export GIT_AI_COMMIT_MODEL=anthropic.claude-3-haiku-20240307-v1:0
|
|
158
|
+
|
|
159
|
+
# Usage
|
|
160
|
+
git add .
|
|
161
|
+
git-ai-commit-agent
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### ā” With Groq (fast and affordable)
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Configuration (environment variables)
|
|
168
|
+
export GIT_AI_COMMIT_PROVIDER=direct
|
|
169
|
+
export GIT_AI_COMMIT_MODEL=llama-3.1-8b-instant
|
|
170
|
+
export LLM_ENDPOINT=https://api.groq.com/openai/v1/chat/completions
|
|
171
|
+
export LLM_API_KEY=gsk_...
|
|
172
|
+
|
|
173
|
+
# Usage
|
|
174
|
+
git add .
|
|
175
|
+
git-ai-commit-agent
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## š Troubleshooting
|
|
179
|
+
|
|
180
|
+
### Error: "Failed to read git diff. Are you in a git repo?"
|
|
181
|
+
|
|
182
|
+
Make sure you're in a directory that is a Git repository.
|
|
183
|
+
|
|
184
|
+
### Error: "No staged changes found."
|
|
185
|
+
|
|
186
|
+
There are no staged changes. Run `git add <files>` first.
|
|
187
|
+
|
|
188
|
+
### AWS authentication error
|
|
189
|
+
|
|
190
|
+
Check that:
|
|
191
|
+
1. Your AWS credentials are correct
|
|
192
|
+
2. You have permissions to invoke models in Bedrock
|
|
193
|
+
3. The specified model is available in your region
|
|
194
|
+
|
|
195
|
+
### Error 413 (Payload Too Large)
|
|
196
|
+
|
|
197
|
+
Error 413 occurs when the git diff is too large (more than 8000 characters). The program automatically truncates the diff and shows a warning. If you need to analyze larger changes, consider:
|
|
198
|
+
- Making smaller and more frequent commits
|
|
199
|
+
- Splitting changes into several logical commits using `git add -p`
|
|
200
|
+
|
|
201
|
+
## š Project Structure
|
|
202
|
+
|
|
203
|
+
```
|
|
204
|
+
git-ai-commit-agent/
|
|
205
|
+
āāā src/
|
|
206
|
+
ā āāā index.ts # TypeScript source code
|
|
207
|
+
āāā dist/ # Compiled JavaScript (generated)
|
|
208
|
+
ā āāā index.js # Main compiled code
|
|
209
|
+
ā āāā index.d.ts # TypeScript declarations
|
|
210
|
+
ā āāā *.js.map # Source maps
|
|
211
|
+
āāā package.json # Dependencies and npm configuration
|
|
212
|
+
āāā tsconfig.json # TypeScript configuration
|
|
213
|
+
āāā .npmignore # Files to exclude from npm package
|
|
214
|
+
āāā README.md # This file
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## š License
|
|
218
|
+
|
|
219
|
+
MIT
|
|
220
|
+
|
|
221
|
+
## š¤ Contributing
|
|
222
|
+
|
|
223
|
+
Contributions are welcome. Please open an issue or pull request.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// index.ts
|
|
2
|
+
// Simple Git AI Commit Message Agent (TypeScript)
|
|
3
|
+
// Reads git diff, sends to LLM (AWS Bedrock or direct API), outputs ONLY commit message
|
|
4
|
+
import { execSync } from 'child_process';
|
|
5
|
+
// ---------------- CONFIG ----------------
|
|
6
|
+
function getConfig() {
|
|
7
|
+
return {
|
|
8
|
+
provider: process.env.GIT_AI_COMMIT_PROVIDER,
|
|
9
|
+
model: process.env.GIT_AI_COMMIT_MODEL ?? undefined
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function validateConfig(config) {
|
|
13
|
+
const missing = [];
|
|
14
|
+
if (!config.model) {
|
|
15
|
+
missing.push('GIT_AI_COMMIT_MODEL');
|
|
16
|
+
}
|
|
17
|
+
if (config.provider === 'bedrock') {
|
|
18
|
+
// AWS credentials and region can be provided via:
|
|
19
|
+
// 1. Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)
|
|
20
|
+
// 2. AWS credentials file (~/.aws/credentials) and config file (~/.aws/config)
|
|
21
|
+
// The AWS SDK automatically reads from these files if env vars are not set
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
if (!process.env.LLM_ENDPOINT) {
|
|
25
|
+
missing.push('LLM_ENDPOINT');
|
|
26
|
+
}
|
|
27
|
+
if (!process.env.LLM_API_KEY) {
|
|
28
|
+
missing.push('LLM_API_KEY');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (missing.length > 0) {
|
|
32
|
+
console.error(`Missing required environment variables: ${missing.join(', ')}`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// ---------------- GIT ----------------
|
|
37
|
+
function getGitDiff() {
|
|
38
|
+
try {
|
|
39
|
+
return execSync('git diff --staged', { encoding: 'utf8' });
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
throw new Error('Failed to read git diff. Are you in a git repo?');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// ---------------- PROMPT ----------------
|
|
46
|
+
const MAX_DIFF_CHARS = 8000; // LĆmite para evitar error 413
|
|
47
|
+
function buildPrompt(diff) {
|
|
48
|
+
let truncatedDiff = diff;
|
|
49
|
+
if (diff.length > MAX_DIFF_CHARS) {
|
|
50
|
+
truncatedDiff = diff.substring(0, MAX_DIFF_CHARS) + '\n... [diff truncado por exceder tamaƱo mƔximo]';
|
|
51
|
+
console.warn(`ā ļø El diff de git excede el lĆmite de ${MAX_DIFF_CHARS} caracteres. Se ha truncado para evitar el error 413.`);
|
|
52
|
+
}
|
|
53
|
+
return `You are a senior software engineer.
|
|
54
|
+
Generate 3 different concise, professional Git commit messages in English following industry standards (imperative mood).
|
|
55
|
+
Each message should describe the changes from a different perspective or level of detail.
|
|
56
|
+
|
|
57
|
+
Use conventional commit prefixes when appropriate:
|
|
58
|
+
- feat: for new features or functionality
|
|
59
|
+
- chore: for maintenance tasks, dependencies, or tooling changes
|
|
60
|
+
- doc: for documentation changes
|
|
61
|
+
- refactor: for code refactoring without behavior changes
|
|
62
|
+
|
|
63
|
+
Git diff:
|
|
64
|
+
${truncatedDiff}
|
|
65
|
+
|
|
66
|
+
Return exactly 3 commit messages, one per line, numbered 1-3.
|
|
67
|
+
Format:
|
|
68
|
+
1. First commit message option
|
|
69
|
+
2. Second commit message option
|
|
70
|
+
3. Third commit message option`;
|
|
71
|
+
}
|
|
72
|
+
// ---------------- LLM PROVIDERS ----------------
|
|
73
|
+
async function callDirectAPI(config, prompt) {
|
|
74
|
+
const res = await fetch(process.env.LLM_ENDPOINT, {
|
|
75
|
+
method: 'POST',
|
|
76
|
+
headers: {
|
|
77
|
+
'Authorization': `Bearer ${process.env.LLM_API_KEY}`,
|
|
78
|
+
'Content-Type': 'application/json'
|
|
79
|
+
},
|
|
80
|
+
body: JSON.stringify({
|
|
81
|
+
model: config.model,
|
|
82
|
+
messages: [{ role: 'user', content: prompt }]
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
if (!res.ok) {
|
|
86
|
+
throw new Error(`HTTP error! status: ${res.status}`);
|
|
87
|
+
}
|
|
88
|
+
const data = await res.json();
|
|
89
|
+
return data.choices[0]?.message.content.trim() || '';
|
|
90
|
+
}
|
|
91
|
+
async function callBedrock(config, prompt) {
|
|
92
|
+
const { BedrockRuntimeClient, InvokeModelCommand } = await import('@aws-sdk/client-bedrock-runtime');
|
|
93
|
+
const clientConfig = process.env.AWS_REGION ? { region: process.env.AWS_REGION } : {};
|
|
94
|
+
const client = new BedrockRuntimeClient(clientConfig);
|
|
95
|
+
const command = new InvokeModelCommand({
|
|
96
|
+
modelId: config.model,
|
|
97
|
+
contentType: 'application/json',
|
|
98
|
+
accept: 'application/json',
|
|
99
|
+
body: JSON.stringify({
|
|
100
|
+
messages: [{ role: 'user', content: prompt }]
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
const response = await client.send(command);
|
|
104
|
+
const body = JSON.parse(Buffer.from(response.body).toString());
|
|
105
|
+
return body.content[0]?.text.trim() || '';
|
|
106
|
+
}
|
|
107
|
+
// ---------------- MAIN ----------------
|
|
108
|
+
async function run() {
|
|
109
|
+
const config = getConfig();
|
|
110
|
+
validateConfig(config);
|
|
111
|
+
const diff = getGitDiff();
|
|
112
|
+
if (!diff.trim()) {
|
|
113
|
+
console.error('No staged changes found.');
|
|
114
|
+
process.exit(1);
|
|
115
|
+
}
|
|
116
|
+
const prompt = buildPrompt(diff);
|
|
117
|
+
let response;
|
|
118
|
+
if (config.provider === 'bedrock') {
|
|
119
|
+
response = await callBedrock(config, prompt);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
response = await callDirectAPI(config, prompt);
|
|
123
|
+
}
|
|
124
|
+
// Parse and display the 3 commit message options
|
|
125
|
+
const lines = response.split('\n').filter(line => line.trim());
|
|
126
|
+
const options = [];
|
|
127
|
+
for (const line of lines) {
|
|
128
|
+
// Match lines starting with number and dot (e.g., "1. " or "2. ")
|
|
129
|
+
const match = line.match(/^\d+\.\s*(.+)$/);
|
|
130
|
+
if (match && match[1] && options.length < 3) {
|
|
131
|
+
options.push(match[1].trim());
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (options.length === 0) {
|
|
135
|
+
// Fallback: if parsing fails, show raw response
|
|
136
|
+
console.log(response);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
console.log('\nš¤ Suggested commit messages:\n');
|
|
140
|
+
options.forEach((option, index) => {
|
|
141
|
+
console.log(`${index + 1}. ${option}`);
|
|
142
|
+
});
|
|
143
|
+
console.log('\nUse: git commit -m "<message>"');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
// ---------------- EXECUTION ----------------
|
|
147
|
+
run().catch(error => {
|
|
148
|
+
console.error('Error:', error.message);
|
|
149
|
+
process.exit(1);
|
|
150
|
+
});
|
|
151
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,kDAAkD;AAClD,wFAAwF;AAExF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAsBzC,2CAA2C;AAC3C,SAAS,SAAS;IAChB,OAAO;QACL,QAAQ,EAAG,OAAO,CAAC,GAAG,CAAC,sBAA2D;QAClF,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,SAAS;KACpD,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,MAAc;IACpC,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO,CAAC,IAAI,CAAC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ai-commit-agent",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "CLI tool for generating Git commit messages using AI (OpenAI, AWS Bedrock, Groq, etc)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=20.0.0"
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"git-ai-commit-agent": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist/",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
19
|
+
"start": "tsx src/index.ts",
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"dev": "tsx src/index.ts",
|
|
22
|
+
"prepublishOnly": "npm run build"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"git",
|
|
26
|
+
"commit",
|
|
27
|
+
"ai",
|
|
28
|
+
"llm",
|
|
29
|
+
"openai",
|
|
30
|
+
"bedrock",
|
|
31
|
+
"groq",
|
|
32
|
+
"cli",
|
|
33
|
+
"typescript"
|
|
34
|
+
],
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git+https://github.com/cbsumastre/git-ai-commit-agent.git"
|
|
38
|
+
},
|
|
39
|
+
"bugs": {
|
|
40
|
+
"url": "https://github.com/cbsumastre/git-ai-commit-agent/issues"
|
|
41
|
+
},
|
|
42
|
+
"homepage": "https://github.com/cbsumastre/git-ai-commit-agent#readme",
|
|
43
|
+
"author": "cbsumastre",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@aws-sdk/client-bedrock-runtime": "^3.981.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^20.19.32",
|
|
50
|
+
"tsx": "^4.21.0",
|
|
51
|
+
"typescript": "^5.9.3"
|
|
52
|
+
}
|
|
53
|
+
}
|