| 1 | namespace AgentForge.Contracts; |
| 2 | |
| 3 | |
| 4 | |
| 5 | public sealed record CreateRepoRequest( |
| 6 | |
| 7 | string Name, |
| 8 | |
| 9 | string? Description = null, |
| 10 | |
| 11 | string? DriveMode = null, |
| 12 | |
| 13 | string? Group = null, |
| 14 | |
| 15 | string? Org = null, |
| 16 | |
| 17 | string? Visibility = null); |
| 18 | |
| 19 | |
| 20 | |
| 21 | public sealed record UpdateRepoCatalogRequest( |
| 22 | |
| 23 | string? Group = null, |
| 24 | |
| 25 | string? Org = null); |
| 26 | |
| 27 | |
| 28 | |
| 29 | public sealed record CreateApiTokenRequest(string Name, string? Scopes = null); |
| 30 | |
| 31 | |
| 32 | |
| 33 | public sealed record ApiTokenResponse( |
| 34 | |
| 35 | string Id, |
| 36 | |
| 37 | string Name, |
| 38 | |
| 39 | string Token, |
| 40 | |
| 41 | string Scopes, |
| 42 | |
| 43 | DateTimeOffset CreatedAt); |
| 44 | |
| 45 | |
| 46 | |
| 47 | public sealed record GitPushRequest( |
| 48 | |
| 49 | string Repo, |
| 50 | |
| 51 | string Branch, |
| 52 | |
| 53 | string Commit, |
| 54 | |
| 55 | string? Ref = null, |
| 56 | |
| 57 | CommitProvenanceRequest? Provenance = null); |
| 58 | |
| 59 | |
| 60 | |
| 61 | public sealed record CommitProvenanceRequest( |
| 62 | |
| 63 | string Actor, |
| 64 | |
| 65 | string Branch, |
| 66 | |
| 67 | IReadOnlyList<int>? IssueNumbers = null, |
| 68 | |
| 69 | int? MrNumber = null, |
| 70 | |
| 71 | string? RunId = null, |
| 72 | |
| 73 | IReadOnlyList<CodeAnchor>? Anchors = null, |
| 74 | |
| 75 | string? LogicalLineId = null); |
| 76 | |
| 77 | |
| 78 | |
| 79 | public sealed record RecordCommitProvenanceRequest( |
| 80 | |
| 81 | string Sha, |
| 82 | |
| 83 | CommitProvenanceRequest Provenance); |
| 84 | |
| 85 | |
| 86 | |
| 87 | public sealed record CommitProvenanceResponse( |
| 88 | |
| 89 | string Actor, |
| 90 | |
| 91 | string Repo, |
| 92 | |
| 93 | string Branch, |
| 94 | |
| 95 | string Sha, |
| 96 | |
| 97 | IReadOnlyList<int> IssueNumbers, |
| 98 | |
| 99 | int? MrNumber, |
| 100 | |
| 101 | string? RunId, |
| 102 | |
| 103 | IReadOnlyList<CodeAnchor> Anchors, |
| 104 | |
| 105 | string? LogicalLineId, |
| 106 | |
| 107 | string? DriveMode, |
| 108 | |
| 109 | DateTimeOffset RecordedAt); |
| 110 | |
| 111 | |
| 112 | |
| 113 | public sealed record MergeRequestDiffResponse( |
| 114 | |
| 115 | string SourceBranch, |
| 116 | |
| 117 | string TargetBranch, |
| 118 | |
| 119 | DiffStatsResponse Stats, |
| 120 | |
| 121 | IReadOnlyList<DiffFileResponse> Files); |
| 122 | |
| 123 | |
| 124 | |
| 125 | public sealed record DiffStatsResponse( |
| 126 | |
| 127 | int ChangedFiles, |
| 128 | |
| 129 | int Additions, |
| 130 | |
| 131 | int Deletions); |
| 132 | |
| 133 | |
| 134 | |
| 135 | public sealed record DiffFileResponse( |
| 136 | |
| 137 | string Path, |
| 138 | |
| 139 | string? OldPath, |
| 140 | |
| 141 | string Status, |
| 142 | |
| 143 | int Additions, |
| 144 | |
| 145 | int Deletions, |
| 146 | |
| 147 | string? Patch); |
| 148 | |
| 149 | |
| 150 | |
| 151 | public sealed record MergeRequestActionRequest(string? Comment = null); |
| 152 | |
| 153 | |
| 154 | |
| 155 | public sealed record CreateIssueRequest( |
| 156 | |
| 157 | string Title, |
| 158 | |
| 159 | string? Body = null, |
| 160 | |
| 161 | IReadOnlyList<CodeAnchor>? Anchors = null, |
| 162 | |
| 163 | IReadOnlyList<string>? AnchorBrackets = null, |
| 164 | |
| 165 | string? Author = null); |
| 166 | |
| 167 | |
| 168 | |
| 169 | public sealed record UpdateIssueRequest( |
| 170 | |
| 171 | string? Title = null, |
| 172 | |
| 173 | string? Body = null, |
| 174 | |
| 175 | string? Status = null); |
| 176 | |
| 177 | |
| 178 | |
| 179 | public sealed record AddIssueCommentRequest(string Body, string? Author = null); |
| 180 | |
| 181 | |
| 182 | |
| 183 | public sealed record AddMergeRequestCommentRequest(string Body, string? Author = null); |
| 184 | |
| 185 | |
| 186 | |
| 187 | public sealed record HandoffMergeRequestRequest(string TargetRepo); |
| 188 | |
| 189 | |
| 190 | |
| 191 | public sealed record LinkIssueAnchorsRequest( |
| 192 | |
| 193 | IReadOnlyList<CodeAnchor>? Anchors = null, |
| 194 | |
| 195 | IReadOnlyList<string>? AnchorBrackets = null); |
| 196 | |
| 197 | |
| 198 | |
| 199 | public sealed record CreateMergeRequestRequest( |
| 200 | |
| 201 | string Title, |
| 202 | |
| 203 | string SourceBranch, |
| 204 | |
| 205 | string? TargetBranch = null, |
| 206 | |
| 207 | IReadOnlyList<CodeAnchor>? Anchors = null, |
| 208 | |
| 209 | string? Author = null); |
| 210 | |
| 211 | |
| 212 | |
| 213 | public sealed record CiCallbackRequest( |
| 214 | |
| 215 | string Repo, |
| 216 | |
| 217 | string Status, |
| 218 | |
| 219 | int? Mr = null, |
| 220 | |
| 221 | string? Commit = null, |
| 222 | |
| 223 | string? Url = null); |
| 224 | |
| 225 | |
| 226 | |
| 227 | public sealed record RepoResponse( |
| 228 | |
| 229 | string Id, |
| 230 | |
| 231 | string Name, |
| 232 | |
| 233 | string Description, |
| 234 | |
| 235 | string DriveMode, |
| 236 | |
| 237 | string CloneUrl, |
| 238 | |
| 239 | DateTimeOffset CreatedAt, |
| 240 | |
| 241 | string? Group = null, |
| 242 | |
| 243 | string? Org = null, |
| 244 | |
| 245 | string Visibility = "private"); |
| 246 | |
| 247 | |
| 248 | |
| 249 | public sealed record IssueResponse( |
| 250 | |
| 251 | int Number, |
| 252 | |
| 253 | string Title, |
| 254 | |
| 255 | string Body, |
| 256 | |
| 257 | string Status, |
| 258 | |
| 259 | DateTimeOffset CreatedAt, |
| 260 | |
| 261 | string IssueUrl, |
| 262 | |
| 263 | IReadOnlyList<CodeAnchor> Anchors, |
| 264 | |
| 265 | IReadOnlyList<string> AnchorBrackets, |
| 266 | |
| 267 | string ForgeBracket, |
| 268 | |
| 269 | string? CreatedBy = null, |
| 270 | |
| 271 | string? ForgeLensUrl = null); |
| 272 | |
| 273 | |
| 274 | |
| 275 | public sealed record IssueDetailResponse( |
| 276 | |
| 277 | int Number, |
| 278 | |
| 279 | string Title, |
| 280 | |
| 281 | string Body, |
| 282 | |
| 283 | string Status, |
| 284 | |
| 285 | DateTimeOffset CreatedAt, |
| 286 | |
| 287 | string IssueUrl, |
| 288 | |
| 289 | IReadOnlyList<CodeAnchor> Anchors, |
| 290 | |
| 291 | IReadOnlyList<IssueCommentResponse> Comments, |
| 292 | |
| 293 | IReadOnlyList<string> AnchorBrackets, |
| 294 | |
| 295 | string ForgeBracket, |
| 296 | |
| 297 | string? CreatedBy = null, |
| 298 | |
| 299 | string? ForgeLensUrl = null); |
| 300 | |
| 301 | |
| 302 | |
| 303 | public sealed record IssueCommentResponse( |
| 304 | |
| 305 | string Id, |
| 306 | |
| 307 | string Body, |
| 308 | |
| 309 | string Author, |
| 310 | |
| 311 | DateTimeOffset CreatedAt); |
| 312 | |
| 313 | |
| 314 | |
| 315 | public sealed record MergeRequestResponse( |
| 316 | |
| 317 | int Number, |
| 318 | |
| 319 | string Title, |
| 320 | |
| 321 | string SourceBranch, |
| 322 | |
| 323 | string TargetBranch, |
| 324 | |
| 325 | string Status, |
| 326 | |
| 327 | DateTimeOffset CreatedAt, |
| 328 | |
| 329 | string MrUrl, |
| 330 | |
| 331 | IReadOnlyList<CodeAnchor> Anchors, |
| 332 | |
| 333 | IReadOnlyList<string> AnchorBrackets, |
| 334 | |
| 335 | string ForgeBracket, |
| 336 | |
| 337 | string? CreatedBy = null); |
| 338 | |
| 339 | |
| 340 | |
| 341 | public sealed record MergeRequestDetailResponse( |
| 342 | |
| 343 | int Number, |
| 344 | |
| 345 | string Title, |
| 346 | |
| 347 | string SourceBranch, |
| 348 | |
| 349 | string TargetBranch, |
| 350 | |
| 351 | string Status, |
| 352 | |
| 353 | DateTimeOffset CreatedAt, |
| 354 | |
| 355 | string MrUrl, |
| 356 | |
| 357 | IReadOnlyList<CodeAnchor> Anchors, |
| 358 | |
| 359 | IReadOnlyList<string> AnchorBrackets, |
| 360 | |
| 361 | string ForgeBracket, |
| 362 | |
| 363 | string? CreatedBy, |
| 364 | |
| 365 | IReadOnlyList<IssueCommentResponse> Comments); |
| 366 | |
| 367 | |
| 368 | |
| 369 | public sealed record CiStatusResponse( |
| 370 | |
| 371 | string Status, |
| 372 | |
| 373 | string? Commit, |
| 374 | |
| 375 | string? Url, |
| 376 | |
| 377 | DateTimeOffset? UpdatedAt); |
| 378 | |
| 379 | |
| 380 | |
| 381 | public sealed record ForgeLensIssueItem( |
| 382 | |
| 383 | int Number, |
| 384 | |
| 385 | string Title, |
| 386 | |
| 387 | string Status, |
| 388 | |
| 389 | string IssueUrl, |
| 390 | |
| 391 | IReadOnlyList<CodeAnchor> Anchors); |
| 392 | |
| 393 | |
| 394 | |
| 395 | public sealed record ForgeLensMergeRequestItem( |
| 396 | |
| 397 | int Number, |
| 398 | |
| 399 | string Title, |
| 400 | |
| 401 | string Status, |
| 402 | |
| 403 | string MrUrl, |
| 404 | |
| 405 | IReadOnlyList<CodeAnchor> Anchors); |
| 406 | |
| 407 | |
| 408 | |
| 409 | public sealed record ForgeLensResponse( |
| 410 | |
| 411 | string Repo, |
| 412 | |
| 413 | string? File, |
| 414 | |
| 415 | IReadOnlyList<ForgeLensIssueItem> Issues, |
| 416 | |
| 417 | IReadOnlyList<ForgeLensMergeRequestItem> MergeRequests); |
| 418 | |
| 419 | |
| 420 | |
| 421 | public sealed record RepoListResponse(int Total, IReadOnlyList<RepoResponse> Repos); |
| 422 | |
| 423 | |
| 424 | |
| 425 | public sealed record IssueListResponse(int Total, IReadOnlyList<IssueResponse> Issues); |
| 426 | |
| 427 | |
| 428 | |
| 429 | public sealed record MergeRequestListResponse(int Total, IReadOnlyList<MergeRequestResponse> MergeRequests); |
| 430 | |
| 431 | |
| 432 | |
| 433 | public sealed record CreateRepoGroupRequest( |
| 434 | |
| 435 | string Slug, |
| 436 | |
| 437 | string? DisplayName = null, |
| 438 | |
| 439 | string? Description = null, |
| 440 | |
| 441 | string? Org = null, |
| 442 | |
| 443 | string? DefaultVisibility = null, |
| 444 | |
| 445 | string? Parent = null); |
| 446 | |
| 447 | |
| 448 | |
| 449 | public sealed record RepoGroupResponse( |
| 450 | |
| 451 | string Slug, |
| 452 | |
| 453 | string DisplayName, |
| 454 | |
| 455 | string Description, |
| 456 | |
| 457 | int RepoCount, |
| 458 | |
| 459 | DateTimeOffset CreatedAt, |
| 460 | |
| 461 | string? Org = null, |
| 462 | |
| 463 | string? DefaultVisibility = null, |
| 464 | |
| 465 | string? Path = null, |
| 466 | |
| 467 | string? Parent = null); |
| 468 | |
| 469 | |
| 470 | |
| 471 | public sealed record RepoGroupListResponse(int Total, IReadOnlyList<RepoGroupResponse> Groups); |
| 472 | |
| 473 | |
| 474 | |
| 475 | public sealed record CreateOrgRequest( |
| 476 | |
| 477 | string Slug, |
| 478 | |
| 479 | string? DisplayName = null, |
| 480 | |
| 481 | string? Description = null, |
| 482 | |
| 483 | string? DefaultVisibility = null); |
| 484 | |
| 485 | |
| 486 | |
| 487 | public sealed record OrgResponse( |
| 488 | |
| 489 | string Slug, |
| 490 | |
| 491 | string DisplayName, |
| 492 | |
| 493 | string Description, |
| 494 | |
| 495 | string DefaultVisibility, |
| 496 | |
| 497 | int RepoCount, |
| 498 | |
| 499 | int GroupCount, |
| 500 | |
| 501 | DateTimeOffset CreatedAt); |
| 502 | |
| 503 | |
| 504 | |
| 505 | public sealed record OrgListResponse(int Total, IReadOnlyList<OrgResponse> Orgs); |
| 506 | |
| 507 | |
| 508 | |
| 509 | public sealed record AddOrgMemberRequest( |
| 510 | |
| 511 | string Provider, |
| 512 | |
| 513 | string Login, |
| 514 | |
| 515 | string? Role = null); |
| 516 | |
| 517 | |
| 518 | |
| 519 | public sealed record AddInstanceAdminRequest( |
| 520 | |
| 521 | string Provider, |
| 522 | |
| 523 | string Login); |
| 524 | |
| 525 | |
| 526 | |
| 527 | public sealed record InstanceAdminResponse( |
| 528 | |
| 529 | string Login, |
| 530 | |
| 531 | string DisplayName, |
| 532 | |
| 533 | DateTimeOffset CreatedAt); |
| 534 | |
| 535 | |
| 536 | |
| 537 | public sealed record InstanceAdminListResponse(int Total, IReadOnlyList<InstanceAdminResponse> Admins); |
| 538 | |
| 539 | |
| 540 | |
| 541 | public sealed record OrgMemberResponse( |
| 542 | |
| 543 | string Login, |
| 544 | |
| 545 | string DisplayName, |
| 546 | |
| 547 | string Role, |
| 548 | |
| 549 | DateTimeOffset CreatedAt); |
| 550 | |
| 551 | |
| 552 | |
| 553 | public sealed record OrgMemberListResponse(int Total, IReadOnlyList<OrgMemberResponse> Members); |
| 554 | |
| 555 | |
| 556 | |
| 557 | public sealed record UpdateOrgMemberRequest(string? Role = null); |
| 558 | |
| 559 | |
| 560 | |
| 561 | public sealed record ImportGitHubOrgRequest( |
| 562 | |
| 563 | string? ForgeOrg = null, |
| 564 | |
| 565 | string? ExternalOrg = null, |
| 566 | |
| 567 | string? CatalogConfig = null, |
| 568 | |
| 569 | string? VisibilityPolicy = null, |
| 570 | |
| 571 | bool DryRun = false, |
| 572 | |
| 573 | bool SkipMirror = false, |
| 574 | |
| 575 | bool UpdateExisting = false, |
| 576 | |
| 577 | bool IncludeArchived = false); |
| 578 | |
| 579 | |
| 580 | |
| 581 | public sealed record ImportGitHubOrgItemResult( |
| 582 | |
| 583 | string GitHubName, |
| 584 | |
| 585 | string ForgeName, |
| 586 | |
| 587 | string CatalogPath, |
| 588 | |
| 589 | string Visibility, |
| 590 | |
| 591 | string Action, |
| 592 | |
| 593 | string? Detail = null); |
| 594 | |
| 595 | |
| 596 | |
| 597 | public sealed record ImportGitHubOrgResponse( |
| 598 | |
| 599 | string ForgeOrg, |
| 600 | |
| 601 | string ExternalOrg, |
| 602 | |
| 603 | int Total, |
| 604 | |
| 605 | int Imported, |
| 606 | |
| 607 | int Skipped, |
| 608 | |
| 609 | int Failed, |
| 610 | |
| 611 | IReadOnlyList<ImportGitHubOrgItemResult> Items); |
| 612 | |
| 613 | |
| 614 | |
| 615 | public sealed record ImportGitHubUserRequest( |
| 616 | |
| 617 | string? GitHubLogin = null, |
| 618 | |
| 619 | string? CatalogConfig = null, |
| 620 | |
| 621 | string? VisibilityPolicy = null, |
| 622 | |
| 623 | bool DryRun = false, |
| 624 | |
| 625 | bool SkipMirror = false, |
| 626 | |
| 627 | bool UpdateExisting = false, |
| 628 | |
| 629 | bool IncludeArchived = false); |
| 630 | |
| 631 | |
| 632 | |
| 633 | public sealed record ImportGitHubSingleRequest( |
| 634 | |
| 635 | string CloneUrl, |
| 636 | |
| 637 | string? ForgeOrg = null, |
| 638 | |
| 639 | string? RepoName = null, |
| 640 | |
| 641 | string? CatalogPath = null, |
| 642 | |
| 643 | string? VisibilityPolicy = null, |
| 644 | |
| 645 | bool DryRun = false, |
| 646 | |
| 647 | bool SkipMirror = false, |
| 648 | |
| 649 | bool UpdateExisting = false); |
| 650 | |
| 651 | |
| 652 | |
| 653 | public sealed record ImportGitHubOrgMembersRequest( |
| 654 | |
| 655 | string? ExternalOrg = null, |
| 656 | |
| 657 | bool DryRun = false, |
| 658 | |
| 659 | string? DefaultRole = null); |
| 660 | |
| 661 | |