@app-vitals/agent-lib 1.32.0 → 1.34.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/admin-types.ts +304 -1
- package/package.json +1 -1
package/admin-types.ts
CHANGED
|
@@ -438,7 +438,7 @@ export interface paths {
|
|
|
438
438
|
post?: never;
|
|
439
439
|
/**
|
|
440
440
|
* Remove a repo from an agent
|
|
441
|
-
* @description Admin, the agent's own key, or platform.ops. Removes one `owner/name` repo from the agent's `repos`, preserving the order of the rest. 404 when the agent does not have that repo. Returns the full updated agent.
|
|
441
|
+
* @description Admin, the agent's own key, or platform.ops. Removes one `owner/name` repo from the agent's `repos`, preserving the order of the rest. The agent's open work on the repo is blocked through the optional open-work port (a failure there is a warning; the removal still succeeds), whoever the caller is; re-adding the repo never unblocks it. 404 when the agent does not have that repo. Returns the full updated agent.
|
|
442
442
|
*/
|
|
443
443
|
delete: {
|
|
444
444
|
parameters: {
|
|
@@ -487,6 +487,75 @@ export interface paths {
|
|
|
487
487
|
patch?: never;
|
|
488
488
|
trace?: never;
|
|
489
489
|
};
|
|
490
|
+
"/agents/{id}/repos/{owner}/{name}/removal-preview": {
|
|
491
|
+
parameters: {
|
|
492
|
+
query?: never;
|
|
493
|
+
header?: never;
|
|
494
|
+
path?: never;
|
|
495
|
+
cookie?: never;
|
|
496
|
+
};
|
|
497
|
+
/**
|
|
498
|
+
* Preview the open work blocked by removing a repo from an agent
|
|
499
|
+
* @description Admin or session member. Read-only: lists the agent's open tasks and PRs that removing `owner/name` from its repos would block (via the optional open-work port); nothing is changed. `openWork` is empty when no port is wired; a port failure is reported in `warnings`. 404 when the agent does not have that repo.
|
|
500
|
+
*/
|
|
501
|
+
get: {
|
|
502
|
+
parameters: {
|
|
503
|
+
query?: never;
|
|
504
|
+
header?: never;
|
|
505
|
+
path: {
|
|
506
|
+
id: string;
|
|
507
|
+
owner: string;
|
|
508
|
+
name: string;
|
|
509
|
+
};
|
|
510
|
+
cookie?: never;
|
|
511
|
+
};
|
|
512
|
+
requestBody?: never;
|
|
513
|
+
responses: {
|
|
514
|
+
/** @description Open work that would be blocked */
|
|
515
|
+
200: {
|
|
516
|
+
headers: {
|
|
517
|
+
[name: string]: unknown;
|
|
518
|
+
};
|
|
519
|
+
content: {
|
|
520
|
+
"application/json": {
|
|
521
|
+
repo: string;
|
|
522
|
+
openWork: {
|
|
523
|
+
id: string;
|
|
524
|
+
repo: string;
|
|
525
|
+
title?: string;
|
|
526
|
+
}[];
|
|
527
|
+
warnings: string[];
|
|
528
|
+
};
|
|
529
|
+
};
|
|
530
|
+
};
|
|
531
|
+
/** @description Forbidden */
|
|
532
|
+
403: {
|
|
533
|
+
headers: {
|
|
534
|
+
[name: string]: unknown;
|
|
535
|
+
};
|
|
536
|
+
content: {
|
|
537
|
+
"application/json": components["schemas"]["Error"];
|
|
538
|
+
};
|
|
539
|
+
};
|
|
540
|
+
/** @description Agent or repo not found */
|
|
541
|
+
404: {
|
|
542
|
+
headers: {
|
|
543
|
+
[name: string]: unknown;
|
|
544
|
+
};
|
|
545
|
+
content: {
|
|
546
|
+
"application/json": components["schemas"]["Error"];
|
|
547
|
+
};
|
|
548
|
+
};
|
|
549
|
+
};
|
|
550
|
+
};
|
|
551
|
+
put?: never;
|
|
552
|
+
post?: never;
|
|
553
|
+
delete?: never;
|
|
554
|
+
options?: never;
|
|
555
|
+
head?: never;
|
|
556
|
+
patch?: never;
|
|
557
|
+
trace?: never;
|
|
558
|
+
};
|
|
490
559
|
"/agents": {
|
|
491
560
|
parameters: {
|
|
492
561
|
query?: never;
|
|
@@ -3475,6 +3544,191 @@ export interface paths {
|
|
|
3475
3544
|
patch?: never;
|
|
3476
3545
|
trace?: never;
|
|
3477
3546
|
};
|
|
3547
|
+
"/agents/{id}/github-lost-access/preview": {
|
|
3548
|
+
parameters: {
|
|
3549
|
+
query?: never;
|
|
3550
|
+
header?: never;
|
|
3551
|
+
path?: never;
|
|
3552
|
+
cookie?: never;
|
|
3553
|
+
};
|
|
3554
|
+
/**
|
|
3555
|
+
* Preview removing the repos the bound user can no longer push to
|
|
3556
|
+
* @description Platform-admin only (session members, ops keys and agent keys get 403). Read-only: nothing is changed or audited. Lists the repos on the agent App's installation or in the agent's repos that the bound githubUsername can no longer push to, and the agent's open tasks and PRs on them (via the optional open-work port; a port failure is a warning). Orgs whose access listing is missing, partial or failed, or whose lookup App is installed on selected repositories only, are skipped and reported. 200 with `status: skipped` when the user is unbound, not found or unverified, the agent has no GH_APP_ID, or the Apps are not configured.
|
|
3557
|
+
*/
|
|
3558
|
+
get: {
|
|
3559
|
+
parameters: {
|
|
3560
|
+
query?: never;
|
|
3561
|
+
header?: never;
|
|
3562
|
+
path: {
|
|
3563
|
+
id: string;
|
|
3564
|
+
};
|
|
3565
|
+
cookie?: never;
|
|
3566
|
+
};
|
|
3567
|
+
requestBody?: never;
|
|
3568
|
+
responses: {
|
|
3569
|
+
/** @description Lost-access removal preview */
|
|
3570
|
+
200: {
|
|
3571
|
+
headers: {
|
|
3572
|
+
[name: string]: unknown;
|
|
3573
|
+
};
|
|
3574
|
+
content: {
|
|
3575
|
+
"application/json": components["schemas"]["GithubLostAccessPreview"];
|
|
3576
|
+
};
|
|
3577
|
+
};
|
|
3578
|
+
/** @description Unauthorized */
|
|
3579
|
+
401: {
|
|
3580
|
+
headers: {
|
|
3581
|
+
[name: string]: unknown;
|
|
3582
|
+
};
|
|
3583
|
+
content: {
|
|
3584
|
+
"application/json": components["schemas"]["Error"];
|
|
3585
|
+
};
|
|
3586
|
+
};
|
|
3587
|
+
/** @description Platform admin required */
|
|
3588
|
+
403: {
|
|
3589
|
+
headers: {
|
|
3590
|
+
[name: string]: unknown;
|
|
3591
|
+
};
|
|
3592
|
+
content: {
|
|
3593
|
+
"application/json": components["schemas"]["Error"];
|
|
3594
|
+
};
|
|
3595
|
+
};
|
|
3596
|
+
/** @description Agent not found */
|
|
3597
|
+
404: {
|
|
3598
|
+
headers: {
|
|
3599
|
+
[name: string]: unknown;
|
|
3600
|
+
};
|
|
3601
|
+
content: {
|
|
3602
|
+
"application/json": components["schemas"]["Error"];
|
|
3603
|
+
};
|
|
3604
|
+
};
|
|
3605
|
+
/** @description GitHub unavailable or refused */
|
|
3606
|
+
502: {
|
|
3607
|
+
headers: {
|
|
3608
|
+
[name: string]: unknown;
|
|
3609
|
+
};
|
|
3610
|
+
content: {
|
|
3611
|
+
"application/json": components["schemas"]["Error"];
|
|
3612
|
+
};
|
|
3613
|
+
};
|
|
3614
|
+
/** @description GitHub Apps are not configured */
|
|
3615
|
+
503: {
|
|
3616
|
+
headers: {
|
|
3617
|
+
[name: string]: unknown;
|
|
3618
|
+
};
|
|
3619
|
+
content: {
|
|
3620
|
+
"application/json": components["schemas"]["Error"];
|
|
3621
|
+
};
|
|
3622
|
+
};
|
|
3623
|
+
};
|
|
3624
|
+
};
|
|
3625
|
+
put?: never;
|
|
3626
|
+
post?: never;
|
|
3627
|
+
delete?: never;
|
|
3628
|
+
options?: never;
|
|
3629
|
+
head?: never;
|
|
3630
|
+
patch?: never;
|
|
3631
|
+
trace?: never;
|
|
3632
|
+
};
|
|
3633
|
+
"/agents/{id}/github-lost-access/remove": {
|
|
3634
|
+
parameters: {
|
|
3635
|
+
query?: never;
|
|
3636
|
+
header?: never;
|
|
3637
|
+
path?: never;
|
|
3638
|
+
cookie?: never;
|
|
3639
|
+
};
|
|
3640
|
+
get?: never;
|
|
3641
|
+
put?: never;
|
|
3642
|
+
/**
|
|
3643
|
+
* Remove the confirmed repos the bound user can no longer push to
|
|
3644
|
+
* @description Platform-admin only. Never adds repos. Takes the repos the admin confirmed from the preview, re-checks each against the bound user's current access, and removes only those still without push access: first from the agent App's installation, then from the agent's repos; then writes one audit entry (GitHubReconcileAudit, planHash `lost-access:remove`) and blocks the agent's open work on the removed repos through the optional open-work port (a failure there is a warning). Named repos left alone are reported in `notRemoved`. Same skip rules as the preview: a skipped call (200 `status: skipped`) changes and audits nothing; `noop` when nothing named still lacks access. 422 when more than 10 repos would be removed without `confirmRemovals: true`. 502 when GitHub refuses (a failed audit entry records only what landed).
|
|
3645
|
+
*/
|
|
3646
|
+
post: {
|
|
3647
|
+
parameters: {
|
|
3648
|
+
query?: never;
|
|
3649
|
+
header?: never;
|
|
3650
|
+
path: {
|
|
3651
|
+
id: string;
|
|
3652
|
+
};
|
|
3653
|
+
cookie?: never;
|
|
3654
|
+
};
|
|
3655
|
+
requestBody: {
|
|
3656
|
+
content: {
|
|
3657
|
+
"application/json": components["schemas"]["GithubLostAccessRemoveBody"];
|
|
3658
|
+
};
|
|
3659
|
+
};
|
|
3660
|
+
responses: {
|
|
3661
|
+
/** @description Removal result */
|
|
3662
|
+
200: {
|
|
3663
|
+
headers: {
|
|
3664
|
+
[name: string]: unknown;
|
|
3665
|
+
};
|
|
3666
|
+
content: {
|
|
3667
|
+
"application/json": components["schemas"]["GithubLostAccessRemoveResult"];
|
|
3668
|
+
};
|
|
3669
|
+
};
|
|
3670
|
+
/** @description Unauthorized */
|
|
3671
|
+
401: {
|
|
3672
|
+
headers: {
|
|
3673
|
+
[name: string]: unknown;
|
|
3674
|
+
};
|
|
3675
|
+
content: {
|
|
3676
|
+
"application/json": components["schemas"]["Error"];
|
|
3677
|
+
};
|
|
3678
|
+
};
|
|
3679
|
+
/** @description Platform admin required */
|
|
3680
|
+
403: {
|
|
3681
|
+
headers: {
|
|
3682
|
+
[name: string]: unknown;
|
|
3683
|
+
};
|
|
3684
|
+
content: {
|
|
3685
|
+
"application/json": components["schemas"]["Error"];
|
|
3686
|
+
};
|
|
3687
|
+
};
|
|
3688
|
+
/** @description Agent not found */
|
|
3689
|
+
404: {
|
|
3690
|
+
headers: {
|
|
3691
|
+
[name: string]: unknown;
|
|
3692
|
+
};
|
|
3693
|
+
content: {
|
|
3694
|
+
"application/json": components["schemas"]["Error"];
|
|
3695
|
+
};
|
|
3696
|
+
};
|
|
3697
|
+
/** @description Removal cap needs confirmRemovals */
|
|
3698
|
+
422: {
|
|
3699
|
+
headers: {
|
|
3700
|
+
[name: string]: unknown;
|
|
3701
|
+
};
|
|
3702
|
+
content: {
|
|
3703
|
+
"application/json": components["schemas"]["Error"];
|
|
3704
|
+
};
|
|
3705
|
+
};
|
|
3706
|
+
/** @description GitHub unavailable or refused */
|
|
3707
|
+
502: {
|
|
3708
|
+
headers: {
|
|
3709
|
+
[name: string]: unknown;
|
|
3710
|
+
};
|
|
3711
|
+
content: {
|
|
3712
|
+
"application/json": components["schemas"]["Error"];
|
|
3713
|
+
};
|
|
3714
|
+
};
|
|
3715
|
+
/** @description GitHub Apps are not configured */
|
|
3716
|
+
503: {
|
|
3717
|
+
headers: {
|
|
3718
|
+
[name: string]: unknown;
|
|
3719
|
+
};
|
|
3720
|
+
content: {
|
|
3721
|
+
"application/json": components["schemas"]["Error"];
|
|
3722
|
+
};
|
|
3723
|
+
};
|
|
3724
|
+
};
|
|
3725
|
+
};
|
|
3726
|
+
delete?: never;
|
|
3727
|
+
options?: never;
|
|
3728
|
+
head?: never;
|
|
3729
|
+
patch?: never;
|
|
3730
|
+
trace?: never;
|
|
3731
|
+
};
|
|
3478
3732
|
"/agents/{id}/config": {
|
|
3479
3733
|
parameters: {
|
|
3480
3734
|
query?: never;
|
|
@@ -5319,6 +5573,55 @@ export interface components {
|
|
|
5319
5573
|
/** @description Repos (owner/repo) to change on the agent App's installation. */
|
|
5320
5574
|
repos: string[];
|
|
5321
5575
|
};
|
|
5576
|
+
GithubLostAccessPreview: {
|
|
5577
|
+
/**
|
|
5578
|
+
* @description `skipped` (not an error) when no GitHub username is bound, the user is not found or unverified, the agent has no GH_APP_ID, or the Apps are not configured; `reason` says why.
|
|
5579
|
+
* @enum {string}
|
|
5580
|
+
*/
|
|
5581
|
+
status: "previewed" | "skipped";
|
|
5582
|
+
reason?: string;
|
|
5583
|
+
/** @description Every repo the bound user can no longer push to that would be removed from the installation or the agent's repos. */
|
|
5584
|
+
repos?: string[];
|
|
5585
|
+
installationRemoves?: string[];
|
|
5586
|
+
configRemoves?: string[];
|
|
5587
|
+
/** @description Orgs whose access listing is missing, partial or failed, or whose lookup App is installed on selected repositories only; nothing there is removed. */
|
|
5588
|
+
skippedOrgs?: {
|
|
5589
|
+
org: string;
|
|
5590
|
+
reason: string;
|
|
5591
|
+
}[];
|
|
5592
|
+
/** @description The agent's open tasks and PRs on those repos that removing them would block; empty when no open-work port is wired. */
|
|
5593
|
+
openWork?: {
|
|
5594
|
+
id: string;
|
|
5595
|
+
repo: string;
|
|
5596
|
+
title?: string;
|
|
5597
|
+
}[];
|
|
5598
|
+
warnings?: string[];
|
|
5599
|
+
};
|
|
5600
|
+
GithubLostAccessRemoveResult: {
|
|
5601
|
+
/** @enum {string} */
|
|
5602
|
+
status: "applied" | "noop" | "skipped";
|
|
5603
|
+
reason?: string;
|
|
5604
|
+
auditId?: string;
|
|
5605
|
+
repos?: string[];
|
|
5606
|
+
installationRemoves?: string[];
|
|
5607
|
+
configRemoves?: string[];
|
|
5608
|
+
/** @description Named repos left alone: the user can still push, the org was skipped, or the repo is on neither the installation nor the agent. */
|
|
5609
|
+
notRemoved?: {
|
|
5610
|
+
repo: string;
|
|
5611
|
+
reason: string;
|
|
5612
|
+
}[];
|
|
5613
|
+
skippedOrgs?: {
|
|
5614
|
+
org: string;
|
|
5615
|
+
reason: string;
|
|
5616
|
+
}[];
|
|
5617
|
+
warnings?: string[];
|
|
5618
|
+
};
|
|
5619
|
+
GithubLostAccessRemoveBody: {
|
|
5620
|
+
/** @description The repos (owner/repo) the admin confirmed from the preview. Each is re-checked; only those the user still cannot push to are removed. */
|
|
5621
|
+
repos: string[];
|
|
5622
|
+
/** @description Required when more than 10 repos would be removed. */
|
|
5623
|
+
confirmRemovals?: boolean;
|
|
5624
|
+
};
|
|
5322
5625
|
AgentConfigResponse: {
|
|
5323
5626
|
/**
|
|
5324
5627
|
* @example {
|