alita-sdk 0.3.151__py3-none-any.whl → 0.3.152__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.
- alita_sdk/tools/github/github_client.py +462 -6
- alita_sdk/tools/github/schemas.py +15 -1
- {alita_sdk-0.3.151.dist-info → alita_sdk-0.3.152.dist-info}/METADATA +2 -1
- {alita_sdk-0.3.151.dist-info → alita_sdk-0.3.152.dist-info}/RECORD +7 -7
- {alita_sdk-0.3.151.dist-info → alita_sdk-0.3.152.dist-info}/WHEEL +0 -0
- {alita_sdk-0.3.151.dist-info → alita_sdk-0.3.152.dist-info}/licenses/LICENSE +0 -0
- {alita_sdk-0.3.151.dist-info → alita_sdk-0.3.152.dist-info}/top_level.txt +0 -0
@@ -3,7 +3,7 @@ import re
|
|
3
3
|
import fnmatch
|
4
4
|
import tiktoken
|
5
5
|
from datetime import datetime
|
6
|
-
from typing import Any, Dict, List, Optional
|
6
|
+
from typing import Any, Dict, List, Optional, Tuple
|
7
7
|
|
8
8
|
from pydantic import BaseModel, Field, model_validator
|
9
9
|
|
@@ -36,6 +36,8 @@ from .schemas import (
|
|
36
36
|
UpdateIssue,
|
37
37
|
LoaderSchema,
|
38
38
|
GetCommits,
|
39
|
+
GetCommitChanges,
|
40
|
+
ApplyGitPatch,
|
39
41
|
TriggerWorkflow,
|
40
42
|
GetWorkflowStatus,
|
41
43
|
GetWorkflowLogs,
|
@@ -277,6 +279,7 @@ class GitHubClient(BaseModel):
|
|
277
279
|
until: Optional[str] = None,
|
278
280
|
author: Optional[str] = None,
|
279
281
|
repo_name: Optional[str] = None,
|
282
|
+
max_count: Optional[int] = 30,
|
280
283
|
) -> str:
|
281
284
|
"""
|
282
285
|
Retrieves a list of commits from the repository.
|
@@ -288,6 +291,7 @@ class GitHubClient(BaseModel):
|
|
288
291
|
until (Optional[str]): Only commits before this date (ISO format) will be returned.
|
289
292
|
author (Optional[str]): The author of the commits.
|
290
293
|
repo_name (Optional[str]): Name of the repository in format 'owner/repo'.
|
294
|
+
max_count (Optional[int]): Maximum number of commits to return (default: 30).
|
291
295
|
|
292
296
|
Returns:
|
293
297
|
str: A list of commit data or an error message.
|
@@ -309,16 +313,20 @@ class GitHubClient(BaseModel):
|
|
309
313
|
commits = repo.get_commits(**params)
|
310
314
|
|
311
315
|
# Convert the commits to a list of dictionaries for easier processing
|
312
|
-
|
313
|
-
|
316
|
+
# Limit the number of commits based on max_count
|
317
|
+
commit_list = []
|
318
|
+
count = 0
|
319
|
+
for commit in commits:
|
320
|
+
if count >= max_count:
|
321
|
+
break
|
322
|
+
commit_list.append({
|
314
323
|
"sha": commit.sha,
|
315
324
|
"author": commit.commit.author.name,
|
316
325
|
"date": commit.commit.author.date.isoformat(),
|
317
326
|
"message": commit.commit.message,
|
318
327
|
"url": commit.html_url,
|
319
|
-
}
|
320
|
-
|
321
|
-
]
|
328
|
+
})
|
329
|
+
count += 1
|
322
330
|
|
323
331
|
return commit_list
|
324
332
|
|
@@ -326,6 +334,440 @@ class GitHubClient(BaseModel):
|
|
326
334
|
# Return error as JSON instead of plain text
|
327
335
|
return {"error": str(e), "message": f"Unable to retrieve commits due to error: {str(e)}"}
|
328
336
|
|
337
|
+
def get_commit_changes(self, sha: str, repo_name: Optional[str] = None) -> str:
|
338
|
+
"""
|
339
|
+
Retrieves the files changed in a specific commit.
|
340
|
+
|
341
|
+
Parameters:
|
342
|
+
sha (str): The commit SHA to get changed files for.
|
343
|
+
repo_name (Optional[str]): Name of the repository in format 'owner/repo'.
|
344
|
+
|
345
|
+
Returns:
|
346
|
+
str: A list of changed files with their status and changes or an error message.
|
347
|
+
"""
|
348
|
+
try:
|
349
|
+
# Get the repository
|
350
|
+
repo = self.github_api.get_repo(repo_name) if repo_name else self.github_repo_instance
|
351
|
+
|
352
|
+
# Get the specific commit
|
353
|
+
commit = repo.get_commit(sha)
|
354
|
+
|
355
|
+
# Extract changed files information
|
356
|
+
changed_files = []
|
357
|
+
for file in commit.files:
|
358
|
+
file_info = {
|
359
|
+
"filename": file.filename,
|
360
|
+
"status": file.status, # added, modified, removed, renamed
|
361
|
+
"additions": file.additions,
|
362
|
+
"deletions": file.deletions,
|
363
|
+
"changes": file.changes,
|
364
|
+
"patch": file.patch if hasattr(file, 'patch') and file.patch else None,
|
365
|
+
"blob_url": file.blob_url if hasattr(file, 'blob_url') else None,
|
366
|
+
"raw_url": file.raw_url if hasattr(file, 'raw_url') else None
|
367
|
+
}
|
368
|
+
|
369
|
+
# Add previous filename for renamed files
|
370
|
+
if file.status == "renamed" and hasattr(file, 'previous_filename'):
|
371
|
+
file_info["previous_filename"] = file.previous_filename
|
372
|
+
|
373
|
+
changed_files.append(file_info)
|
374
|
+
|
375
|
+
result = {
|
376
|
+
"commit_sha": commit.sha,
|
377
|
+
"commit_message": commit.commit.message,
|
378
|
+
"author": commit.commit.author.name,
|
379
|
+
"date": commit.commit.author.date.isoformat(),
|
380
|
+
"total_files_changed": len(changed_files),
|
381
|
+
"total_additions": sum(f["additions"] for f in changed_files),
|
382
|
+
"total_deletions": sum(f["deletions"] for f in changed_files),
|
383
|
+
"files": changed_files
|
384
|
+
}
|
385
|
+
|
386
|
+
return result
|
387
|
+
|
388
|
+
except Exception as e:
|
389
|
+
# Return error as JSON instead of plain text
|
390
|
+
return {"error": str(e), "message": f"Unable to retrieve commit changes due to error: {str(e)}"}
|
391
|
+
|
392
|
+
def apply_git_patch(self, patch_content: str, commit_message: Optional[str] = "Apply git patch", repo_name: Optional[str] = None) -> str:
|
393
|
+
"""
|
394
|
+
Applies a git patch to the repository by parsing the unified diff format and updating files accordingly.
|
395
|
+
|
396
|
+
Parameters:
|
397
|
+
patch_content (str): The git patch content in unified diff format
|
398
|
+
commit_message (Optional[str]): Commit message for the patch application
|
399
|
+
repo_name (Optional[str]): Name of the repository in format 'owner/repo'
|
400
|
+
|
401
|
+
Returns:
|
402
|
+
str: A summary of applied changes or error message
|
403
|
+
"""
|
404
|
+
import re
|
405
|
+
|
406
|
+
try:
|
407
|
+
repo = self.github_api.get_repo(repo_name) if repo_name else self.github_repo_instance
|
408
|
+
branch = self.active_branch
|
409
|
+
|
410
|
+
if branch == self.github_base_branch:
|
411
|
+
return {
|
412
|
+
"error": "Cannot apply patch",
|
413
|
+
"message": f"You're attempting to commit directly to the {self.github_base_branch} branch, which is protected. Please create a new branch and try again."
|
414
|
+
}
|
415
|
+
|
416
|
+
# Parse the patch content to extract file changes
|
417
|
+
changes = self._parse_git_patch(patch_content)
|
418
|
+
|
419
|
+
if not changes:
|
420
|
+
return {
|
421
|
+
"error": "No valid changes found",
|
422
|
+
"message": "The patch content does not contain any valid file changes."
|
423
|
+
}
|
424
|
+
|
425
|
+
applied_changes = []
|
426
|
+
failed_changes = []
|
427
|
+
|
428
|
+
for change in changes:
|
429
|
+
try:
|
430
|
+
if change['operation'] == 'create':
|
431
|
+
# Create new file
|
432
|
+
repo.create_file(
|
433
|
+
path=change['file_path'],
|
434
|
+
message=f"{commit_message} - Create {change['file_path']}",
|
435
|
+
content=change['new_content'],
|
436
|
+
branch=branch
|
437
|
+
)
|
438
|
+
applied_changes.append(f"Created: {change['file_path']}")
|
439
|
+
|
440
|
+
elif change['operation'] == 'delete':
|
441
|
+
# Delete file
|
442
|
+
try:
|
443
|
+
file = repo.get_contents(change['file_path'], ref=branch)
|
444
|
+
repo.delete_file(
|
445
|
+
path=change['file_path'],
|
446
|
+
message=f"{commit_message} - Delete {change['file_path']}",
|
447
|
+
sha=file.sha,
|
448
|
+
branch=branch
|
449
|
+
)
|
450
|
+
applied_changes.append(f"Deleted: {change['file_path']}")
|
451
|
+
except Exception:
|
452
|
+
failed_changes.append(f"Failed to delete {change['file_path']} - file not found")
|
453
|
+
|
454
|
+
elif change['operation'] == 'modify':
|
455
|
+
# Modify existing file
|
456
|
+
try:
|
457
|
+
file = repo.get_contents(change['file_path'], ref=branch)
|
458
|
+
current_content = file.decoded_content.decode("utf-8")
|
459
|
+
|
460
|
+
# Apply the patch changes
|
461
|
+
new_content = self._apply_patch_to_content(current_content, change['hunks'])
|
462
|
+
|
463
|
+
if new_content != current_content:
|
464
|
+
repo.update_file(
|
465
|
+
path=change['file_path'],
|
466
|
+
message=f"{commit_message} - Update {change['file_path']}",
|
467
|
+
content=new_content,
|
468
|
+
sha=file.sha,
|
469
|
+
branch=branch
|
470
|
+
)
|
471
|
+
applied_changes.append(f"Modified: {change['file_path']}")
|
472
|
+
else:
|
473
|
+
failed_changes.append(f"No changes applied to {change['file_path']} - patch may not match current content")
|
474
|
+
except Exception as e:
|
475
|
+
failed_changes.append(f"Failed to modify {change['file_path']}: {str(e)}")
|
476
|
+
|
477
|
+
elif change['operation'] == 'rename':
|
478
|
+
# Handle file rename (delete old, create new)
|
479
|
+
try:
|
480
|
+
# Delete old file
|
481
|
+
old_file = repo.get_contents(change['old_file_path'], ref=branch)
|
482
|
+
old_content = old_file.decoded_content.decode("utf-8")
|
483
|
+
|
484
|
+
# Apply changes to content if there are any
|
485
|
+
if change.get('hunks'):
|
486
|
+
new_content = self._apply_patch_to_content(old_content, change['hunks'])
|
487
|
+
else:
|
488
|
+
new_content = old_content
|
489
|
+
|
490
|
+
# Create new file
|
491
|
+
repo.create_file(
|
492
|
+
path=change['file_path'],
|
493
|
+
message=f"{commit_message} - Rename {change['old_file_path']} to {change['file_path']}",
|
494
|
+
content=new_content,
|
495
|
+
branch=branch
|
496
|
+
)
|
497
|
+
|
498
|
+
# Delete old file
|
499
|
+
repo.delete_file(
|
500
|
+
path=change['old_file_path'],
|
501
|
+
message=f"{commit_message} - Remove old file {change['old_file_path']}",
|
502
|
+
sha=old_file.sha,
|
503
|
+
branch=branch
|
504
|
+
)
|
505
|
+
|
506
|
+
applied_changes.append(f"Renamed: {change['old_file_path']} → {change['file_path']}")
|
507
|
+
except Exception as e:
|
508
|
+
failed_changes.append(f"Failed to rename {change.get('old_file_path', 'unknown')} to {change['file_path']}: {str(e)}")
|
509
|
+
|
510
|
+
except Exception as e:
|
511
|
+
failed_changes.append(f"Failed to process {change.get('file_path', 'unknown file')}: {str(e)}")
|
512
|
+
|
513
|
+
# Return summary
|
514
|
+
result = {
|
515
|
+
"success": len(applied_changes) > 0,
|
516
|
+
"applied_changes": applied_changes,
|
517
|
+
"failed_changes": failed_changes,
|
518
|
+
"total_changes": len(changes),
|
519
|
+
"successful_changes": len(applied_changes),
|
520
|
+
"failed_count": len(failed_changes)
|
521
|
+
}
|
522
|
+
|
523
|
+
if failed_changes:
|
524
|
+
result["message"] = f"Patch partially applied. {len(applied_changes)} successful, {len(failed_changes)} failed."
|
525
|
+
else:
|
526
|
+
result["message"] = f"Patch successfully applied. {len(applied_changes)} changes made."
|
527
|
+
|
528
|
+
return result
|
529
|
+
|
530
|
+
except Exception as e:
|
531
|
+
return {
|
532
|
+
"error": str(e),
|
533
|
+
"message": f"Unable to apply git patch due to error: {str(e)}"
|
534
|
+
}
|
535
|
+
|
536
|
+
def _parse_git_patch(self, patch_content: str) -> List[Dict]:
|
537
|
+
"""
|
538
|
+
Parse git patch content in unified diff format and extract file changes.
|
539
|
+
|
540
|
+
Parameters:
|
541
|
+
patch_content (str): The patch content to parse
|
542
|
+
|
543
|
+
Returns:
|
544
|
+
List[Dict]: List of change dictionaries
|
545
|
+
"""
|
546
|
+
import re
|
547
|
+
|
548
|
+
changes = []
|
549
|
+
lines = patch_content.strip().split('\n')
|
550
|
+
i = 0
|
551
|
+
|
552
|
+
while i < len(lines):
|
553
|
+
line = lines[i]
|
554
|
+
|
555
|
+
# Look for diff --git lines
|
556
|
+
if line.startswith('diff --git'):
|
557
|
+
change = self._parse_file_change(lines, i)
|
558
|
+
if change:
|
559
|
+
changes.append(change)
|
560
|
+
i = change.get('next_index', i + 1)
|
561
|
+
else:
|
562
|
+
i += 1
|
563
|
+
else:
|
564
|
+
i += 1
|
565
|
+
|
566
|
+
return changes
|
567
|
+
|
568
|
+
def _parse_file_change(self, lines: List[str], start_index: int) -> Optional[Dict]:
|
569
|
+
"""
|
570
|
+
Parse a single file change from patch lines.
|
571
|
+
|
572
|
+
Parameters:
|
573
|
+
lines (List[str]): All patch lines
|
574
|
+
start_index (int): Starting index for this file change
|
575
|
+
|
576
|
+
Returns:
|
577
|
+
Optional[Dict]: Parsed file change or None if invalid
|
578
|
+
"""
|
579
|
+
import re
|
580
|
+
|
581
|
+
if start_index >= len(lines):
|
582
|
+
return None
|
583
|
+
|
584
|
+
diff_line = lines[start_index]
|
585
|
+
|
586
|
+
# Extract file paths from diff line
|
587
|
+
match = re.match(r'diff --git a/(.+) b/(.+)', diff_line)
|
588
|
+
if not match:
|
589
|
+
return None
|
590
|
+
|
591
|
+
old_path = match.group(1)
|
592
|
+
new_path = match.group(2)
|
593
|
+
|
594
|
+
change = {
|
595
|
+
'old_file_path': old_path,
|
596
|
+
'file_path': new_path,
|
597
|
+
'hunks': [],
|
598
|
+
'next_index': start_index + 1
|
599
|
+
}
|
600
|
+
|
601
|
+
i = start_index + 1
|
602
|
+
|
603
|
+
# Process header lines (index, ---, +++, etc.)
|
604
|
+
while i < len(lines):
|
605
|
+
line = lines[i]
|
606
|
+
|
607
|
+
if line.startswith('new file mode'):
|
608
|
+
change['operation'] = 'create'
|
609
|
+
elif line.startswith('deleted file mode'):
|
610
|
+
change['operation'] = 'delete'
|
611
|
+
elif line.startswith('rename from'):
|
612
|
+
change['operation'] = 'rename'
|
613
|
+
elif line.startswith('index '):
|
614
|
+
pass # Skip index lines
|
615
|
+
elif line.startswith('--- '):
|
616
|
+
pass # Skip old file reference
|
617
|
+
elif line.startswith('+++ '):
|
618
|
+
pass # Skip new file reference
|
619
|
+
elif line.startswith('@@'):
|
620
|
+
# Found a hunk, parse it
|
621
|
+
hunk, next_i = self._parse_hunk(lines, i)
|
622
|
+
if hunk:
|
623
|
+
change['hunks'].append(hunk)
|
624
|
+
i = next_i
|
625
|
+
continue
|
626
|
+
elif line.startswith('diff --git') or line.startswith('Binary files'):
|
627
|
+
# Start of next file or binary file
|
628
|
+
break
|
629
|
+
elif line.strip() == '':
|
630
|
+
pass # Skip empty lines
|
631
|
+
else:
|
632
|
+
# Unknown line, continue
|
633
|
+
pass
|
634
|
+
|
635
|
+
i += 1
|
636
|
+
|
637
|
+
# Determine operation if not set
|
638
|
+
if 'operation' not in change:
|
639
|
+
if old_path == new_path:
|
640
|
+
change['operation'] = 'modify'
|
641
|
+
else:
|
642
|
+
change['operation'] = 'rename'
|
643
|
+
|
644
|
+
change['next_index'] = i
|
645
|
+
|
646
|
+
# For new files, extract content from hunks
|
647
|
+
if change['operation'] == 'create' and change['hunks']:
|
648
|
+
content_lines = []
|
649
|
+
for hunk in change['hunks']:
|
650
|
+
for line in hunk['lines']:
|
651
|
+
if line.startswith('+') and not line.startswith('+++'):
|
652
|
+
content_lines.append(line[1:]) # Remove + prefix
|
653
|
+
change['new_content'] = '\n'.join(content_lines)
|
654
|
+
|
655
|
+
return change
|
656
|
+
|
657
|
+
def _parse_hunk(self, lines: List[str], start_index: int) -> Tuple[Optional[Dict], int]:
|
658
|
+
"""
|
659
|
+
Parse a single hunk from patch lines.
|
660
|
+
|
661
|
+
Parameters:
|
662
|
+
lines (List[str]): All patch lines
|
663
|
+
start_index (int): Starting index for this hunk
|
664
|
+
|
665
|
+
Returns:
|
666
|
+
Tuple[Optional[Dict], int]: Parsed hunk and next index
|
667
|
+
"""
|
668
|
+
import re
|
669
|
+
|
670
|
+
if start_index >= len(lines):
|
671
|
+
return None, start_index + 1
|
672
|
+
|
673
|
+
hunk_header = lines[start_index]
|
674
|
+
|
675
|
+
# Parse hunk header: @@ -old_start,old_count +new_start,new_count @@
|
676
|
+
match = re.match(r'@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@', hunk_header)
|
677
|
+
if not match:
|
678
|
+
return None, start_index + 1
|
679
|
+
|
680
|
+
old_start = int(match.group(1))
|
681
|
+
old_count = int(match.group(2)) if match.group(2) else 1
|
682
|
+
new_start = int(match.group(3))
|
683
|
+
new_count = int(match.group(4)) if match.group(4) else 1
|
684
|
+
|
685
|
+
hunk = {
|
686
|
+
'old_start': old_start,
|
687
|
+
'old_count': old_count,
|
688
|
+
'new_start': new_start,
|
689
|
+
'new_count': new_count,
|
690
|
+
'lines': []
|
691
|
+
}
|
692
|
+
|
693
|
+
i = start_index + 1
|
694
|
+
|
695
|
+
# Collect hunk lines
|
696
|
+
while i < len(lines):
|
697
|
+
line = lines[i]
|
698
|
+
|
699
|
+
if line.startswith('@@') or line.startswith('diff --git') or line.startswith('Binary files'):
|
700
|
+
# Start of next hunk or file
|
701
|
+
break
|
702
|
+
elif line.startswith(' ') or line.startswith('+') or line.startswith('-'):
|
703
|
+
# Context, addition, or deletion line
|
704
|
+
hunk['lines'].append(line)
|
705
|
+
elif line.strip() == '':
|
706
|
+
# Empty line in hunk
|
707
|
+
hunk['lines'].append(line)
|
708
|
+
else:
|
709
|
+
# Unknown line, stop parsing this hunk
|
710
|
+
break
|
711
|
+
|
712
|
+
i += 1
|
713
|
+
|
714
|
+
return hunk, i
|
715
|
+
|
716
|
+
def _apply_patch_to_content(self, original_content: str, hunks: List[Dict]) -> str:
|
717
|
+
"""
|
718
|
+
Apply patch hunks to original content.
|
719
|
+
|
720
|
+
Parameters:
|
721
|
+
original_content (str): Original file content
|
722
|
+
hunks (List[Dict]): List of patch hunks
|
723
|
+
|
724
|
+
Returns:
|
725
|
+
str: Modified content
|
726
|
+
"""
|
727
|
+
if not hunks:
|
728
|
+
return original_content
|
729
|
+
|
730
|
+
lines = original_content.split('\n')
|
731
|
+
result_lines = []
|
732
|
+
|
733
|
+
# Sort hunks by line number
|
734
|
+
sorted_hunks = sorted(hunks, key=lambda h: h['old_start'])
|
735
|
+
|
736
|
+
current_line = 0
|
737
|
+
|
738
|
+
for hunk in sorted_hunks:
|
739
|
+
# Add lines before this hunk
|
740
|
+
while current_line < hunk['old_start'] - 1:
|
741
|
+
if current_line < len(lines):
|
742
|
+
result_lines.append(lines[current_line])
|
743
|
+
current_line += 1
|
744
|
+
|
745
|
+
# Apply hunk changes
|
746
|
+
old_line_in_hunk = 0
|
747
|
+
|
748
|
+
for patch_line in hunk['lines']:
|
749
|
+
if patch_line.startswith(' '):
|
750
|
+
# Context line - should match original
|
751
|
+
context_line = patch_line[1:]
|
752
|
+
if current_line < len(lines):
|
753
|
+
result_lines.append(lines[current_line])
|
754
|
+
current_line += 1
|
755
|
+
old_line_in_hunk += 1
|
756
|
+
elif patch_line.startswith('-'):
|
757
|
+
# Deletion - skip original line
|
758
|
+
current_line += 1
|
759
|
+
old_line_in_hunk += 1
|
760
|
+
elif patch_line.startswith('+'):
|
761
|
+
# Addition - add new line
|
762
|
+
result_lines.append(patch_line[1:])
|
763
|
+
|
764
|
+
# Add remaining lines
|
765
|
+
while current_line < len(lines):
|
766
|
+
result_lines.append(lines[current_line])
|
767
|
+
current_line += 1
|
768
|
+
|
769
|
+
return '\n'.join(result_lines)
|
770
|
+
|
329
771
|
def get_pull_request(self, pr_number: str, repo_name: Optional[str] = None) -> str:
|
330
772
|
"""
|
331
773
|
Fetches information about a specific pull request.
|
@@ -1453,6 +1895,20 @@ class GitHubClient(BaseModel):
|
|
1453
1895
|
"description": self.get_commits.__doc__,
|
1454
1896
|
"args_schema": GetCommits,
|
1455
1897
|
},
|
1898
|
+
{
|
1899
|
+
"ref": self.get_commit_changes,
|
1900
|
+
"name": "get_commit_changes",
|
1901
|
+
"mode": "get_commit_changes",
|
1902
|
+
"description": self.get_commit_changes.__doc__,
|
1903
|
+
"args_schema": GetCommitChanges,
|
1904
|
+
},
|
1905
|
+
{
|
1906
|
+
"ref": self.apply_git_patch,
|
1907
|
+
"name": "apply_git_patch",
|
1908
|
+
"mode": "apply_git_patch",
|
1909
|
+
"description": self.apply_git_patch.__doc__,
|
1910
|
+
"args_schema": ApplyGitPatch,
|
1911
|
+
},
|
1456
1912
|
{
|
1457
1913
|
"ref": self.trigger_workflow,
|
1458
1914
|
"name": "trigger_workflow",
|
@@ -149,7 +149,21 @@ GetCommits = create_model(
|
|
149
149
|
path=(Optional[str], Field(description="The file path to filter commits by", default=None)),
|
150
150
|
since=(Optional[str], Field(description="Only commits after this date will be returned (ISO format)", default=None)),
|
151
151
|
until=(Optional[str], Field(description="Only commits before this date will be returned (ISO format)", default=None)),
|
152
|
-
author=(Optional[str], Field(description="The author of the commits", default=None))
|
152
|
+
author=(Optional[str], Field(description="The author of the commits", default=None)),
|
153
|
+
max_count=(Optional[int], Field(description="Maximum number of commits to return (default: 30)", default=30))
|
154
|
+
)
|
155
|
+
|
156
|
+
GetCommitChanges = create_model(
|
157
|
+
"GetCommitChanges",
|
158
|
+
sha=(str, Field(description="The commit SHA to get changed files for")),
|
159
|
+
repo_name=(Optional[str], Field(default=None, description="Name of the repository (e.g., 'owner/repo'). If None, uses the default repository."))
|
160
|
+
)
|
161
|
+
|
162
|
+
ApplyGitPatch = create_model(
|
163
|
+
"ApplyGitPatch",
|
164
|
+
patch_content=(str, Field(description="The git patch content in unified diff format")),
|
165
|
+
commit_message=(Optional[str], Field(description="Commit message for the patch application", default="Apply git patch")),
|
166
|
+
repo_name=(Optional[str], Field(default=None, description="Name of the repository (e.g., 'owner/repo'). If None, uses the default repository."))
|
153
167
|
)
|
154
168
|
|
155
169
|
TriggerWorkflow = create_model(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: alita_sdk
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.152
|
4
4
|
Summary: SDK for building langchain agents using resources from Alita
|
5
5
|
Author-email: Artem Rozumenko <artyom.rozumenko@gmail.com>, Mikalai Biazruchka <mikalai_biazruchka@epam.com>, Roman Mitusov <roman_mitusov@epam.com>, Ivan Krakhmaliuk <lifedjik@gmail.com>
|
6
6
|
License-Expression: Apache-2.0
|
@@ -36,6 +36,7 @@ Requires-Dist: langgraph~=0.2.53; extra == "runtime"
|
|
36
36
|
Requires-Dist: langchain_chroma~=0.2.2; extra == "runtime"
|
37
37
|
Requires-Dist: langchain-unstructured~=0.1.6; extra == "runtime"
|
38
38
|
Requires-Dist: langchain-postgres~=0.0.13; extra == "runtime"
|
39
|
+
Requires-Dist: langmem==0.0.27; extra == "runtime"
|
39
40
|
Requires-Dist: keybert==0.8.3; extra == "runtime"
|
40
41
|
Requires-Dist: charset_normalizer==3.3.2; extra == "runtime"
|
41
42
|
Requires-Dist: unstructured[local-inference]==0.16.23; extra == "runtime"
|
@@ -222,9 +222,9 @@ alita_sdk/tools/figma/__init__.py,sha256=rtEebf9zj1zUD0bpkN-SupaYpjmHFM01gY8XZNE
|
|
222
222
|
alita_sdk/tools/figma/api_wrapper.py,sha256=G96pEp_qUOouwkM5xMqRg-Ywfx_kEey8NV8iO7YLodE,17190
|
223
223
|
alita_sdk/tools/github/__init__.py,sha256=s-ejtyNXjQ3Wo-QhLMJkOSab-qY5ZJC6V_df0GuS3ro,6337
|
224
224
|
alita_sdk/tools/github/api_wrapper.py,sha256=-98miPAF_JQMIEDT3g8KS6QJ7bHMUSlj4s38zXyFJ2M,8281
|
225
|
-
alita_sdk/tools/github/github_client.py,sha256=
|
225
|
+
alita_sdk/tools/github/github_client.py,sha256=bzVXim8U-QH6RzlkAzIUiTrhD4MDi3Xs4pKxVdghvhc,79465
|
226
226
|
alita_sdk/tools/github/graphql_client_wrapper.py,sha256=d3AGjzLGH_hdQV2V8HeAX92dJ4dlnE5OXqUlCO_PBr0,71539
|
227
|
-
alita_sdk/tools/github/schemas.py,sha256=
|
227
|
+
alita_sdk/tools/github/schemas.py,sha256=6BAzeGaXkyS-rde2gJDi3xqic161de1PBh-CrlOgK_4,12826
|
228
228
|
alita_sdk/tools/github/tool.py,sha256=Jnnv5lenV5ds8AAdyo2m8hSzyJ117HZBjzHC6T1ck-M,1037
|
229
229
|
alita_sdk/tools/github/tool_prompts.py,sha256=y6ZW_FpUCE87Uop3WuQAZVRnzxO5t7xjBOI5bCqiluw,30194
|
230
230
|
alita_sdk/tools/gitlab/__init__.py,sha256=_nbp3tJviTZxfewyV3Hp9-TK1vCxTmqlxhpwv0f_x4Y,3602
|
@@ -316,8 +316,8 @@ alita_sdk/tools/zephyr_enterprise/api_wrapper.py,sha256=Ir3zHljhbZQJRJJQOBzS_GL5
|
|
316
316
|
alita_sdk/tools/zephyr_enterprise/zephyr_enterprise.py,sha256=hV9LIrYfJT6oYp-ZfQR0YHflqBFPsUw2Oc55HwK0H48,6809
|
317
317
|
alita_sdk/tools/zephyr_scale/__init__.py,sha256=2NTcdrfkx4GSegqyXhsPLsEpc4FlACuDy85b0fk6cAo,4572
|
318
318
|
alita_sdk/tools/zephyr_scale/api_wrapper.py,sha256=UHVQUVqcBc3SZvDfO78HSuBzwAsRw2cCDQa-xMOzndE,68663
|
319
|
-
alita_sdk-0.3.
|
320
|
-
alita_sdk-0.3.
|
321
|
-
alita_sdk-0.3.
|
322
|
-
alita_sdk-0.3.
|
323
|
-
alita_sdk-0.3.
|
319
|
+
alita_sdk-0.3.152.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
320
|
+
alita_sdk-0.3.152.dist-info/METADATA,sha256=N57N-leEOD5Y6R5M1dIJAdWbwWV45N8S0dHUSmGSJYM,18718
|
321
|
+
alita_sdk-0.3.152.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
322
|
+
alita_sdk-0.3.152.dist-info/top_level.txt,sha256=0vJYy5p_jK6AwVb1aqXr7Kgqgk3WDtQ6t5C-XI9zkmg,10
|
323
|
+
alita_sdk-0.3.152.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|