@app-vitals/agent-lib 1.31.0 → 1.33.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.
Files changed (2) hide show
  1. package/admin-types.ts +386 -1
  2. 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;
@@ -3180,6 +3249,301 @@ export interface paths {
3180
3249
  patch?: never;
3181
3250
  trace?: never;
3182
3251
  };
3252
+ "/agents/{id}/github-installation/repos": {
3253
+ parameters: {
3254
+ query?: never;
3255
+ header?: never;
3256
+ path?: never;
3257
+ cookie?: never;
3258
+ };
3259
+ /**
3260
+ * List the repos on the agent App's installation
3261
+ * @description Platform-admin only (session members, ops keys and agent keys get 403). Per org the agent's own GitHub App (its GH_APP_ID) is installed on, lists the installation's repos. When the agent has a bound githubUsername, each repo carries `userCanPush` from the access lookup only when that org's lookup result is complete; otherwise the field is omitted (never false). 404 for an unknown agent; 422 when the agent has no GH_APP_ID.
3262
+ */
3263
+ get: {
3264
+ parameters: {
3265
+ query?: never;
3266
+ header?: never;
3267
+ path: {
3268
+ id: string;
3269
+ };
3270
+ cookie?: never;
3271
+ };
3272
+ requestBody?: never;
3273
+ responses: {
3274
+ /** @description Installation repos */
3275
+ 200: {
3276
+ headers: {
3277
+ [name: string]: unknown;
3278
+ };
3279
+ content: {
3280
+ "application/json": components["schemas"]["GithubInstallationReposList"];
3281
+ };
3282
+ };
3283
+ /** @description Unauthorized */
3284
+ 401: {
3285
+ headers: {
3286
+ [name: string]: unknown;
3287
+ };
3288
+ content: {
3289
+ "application/json": components["schemas"]["Error"];
3290
+ };
3291
+ };
3292
+ /** @description Platform admin required */
3293
+ 403: {
3294
+ headers: {
3295
+ [name: string]: unknown;
3296
+ };
3297
+ content: {
3298
+ "application/json": components["schemas"]["Error"];
3299
+ };
3300
+ };
3301
+ /** @description Agent not found */
3302
+ 404: {
3303
+ headers: {
3304
+ [name: string]: unknown;
3305
+ };
3306
+ content: {
3307
+ "application/json": components["schemas"]["Error"];
3308
+ };
3309
+ };
3310
+ /** @description Agent has no GH_APP_ID (its own GitHub App is not set up) */
3311
+ 422: {
3312
+ headers: {
3313
+ [name: string]: unknown;
3314
+ };
3315
+ content: {
3316
+ "application/json": components["schemas"]["Error"];
3317
+ };
3318
+ };
3319
+ /** @description GitHub unavailable or refused */
3320
+ 502: {
3321
+ headers: {
3322
+ [name: string]: unknown;
3323
+ };
3324
+ content: {
3325
+ "application/json": components["schemas"]["Error"];
3326
+ };
3327
+ };
3328
+ /** @description GitHub Apps are not configured */
3329
+ 503: {
3330
+ headers: {
3331
+ [name: string]: unknown;
3332
+ };
3333
+ content: {
3334
+ "application/json": components["schemas"]["Error"];
3335
+ };
3336
+ };
3337
+ };
3338
+ };
3339
+ put?: never;
3340
+ /**
3341
+ * Add repos to the agent App's installation
3342
+ * @description Platform-admin only. Grants the agent's own GitHub App installation access to the named repos, with no plan step; the agent's configured repos are not changed. Writes one audit entry (GitHubReconcileAudit, planHash `direct:add`) recording the caller and repos. 404 unknown agent; 422 no GH_APP_ID; 409 when the App is not installed on a repo's org (nothing is changed or audited); 502 when GitHub refuses (a failed audit entry is written).
3343
+ */
3344
+ post: {
3345
+ parameters: {
3346
+ query?: never;
3347
+ header?: never;
3348
+ path: {
3349
+ id: string;
3350
+ };
3351
+ cookie?: never;
3352
+ };
3353
+ requestBody: {
3354
+ content: {
3355
+ "application/json": components["schemas"]["GithubInstallationReposBody"];
3356
+ };
3357
+ };
3358
+ responses: {
3359
+ /** @description Repos added */
3360
+ 200: {
3361
+ headers: {
3362
+ [name: string]: unknown;
3363
+ };
3364
+ content: {
3365
+ "application/json": components["schemas"]["GithubInstallationReposChange"];
3366
+ };
3367
+ };
3368
+ /** @description Unauthorized */
3369
+ 401: {
3370
+ headers: {
3371
+ [name: string]: unknown;
3372
+ };
3373
+ content: {
3374
+ "application/json": components["schemas"]["Error"];
3375
+ };
3376
+ };
3377
+ /** @description Platform admin required */
3378
+ 403: {
3379
+ headers: {
3380
+ [name: string]: unknown;
3381
+ };
3382
+ content: {
3383
+ "application/json": components["schemas"]["Error"];
3384
+ };
3385
+ };
3386
+ /** @description Agent not found */
3387
+ 404: {
3388
+ headers: {
3389
+ [name: string]: unknown;
3390
+ };
3391
+ content: {
3392
+ "application/json": components["schemas"]["Error"];
3393
+ };
3394
+ };
3395
+ /** @description Agent App not installed on the org */
3396
+ 409: {
3397
+ headers: {
3398
+ [name: string]: unknown;
3399
+ };
3400
+ content: {
3401
+ "application/json": components["schemas"]["Error"];
3402
+ };
3403
+ };
3404
+ /** @description Agent has no GH_APP_ID (its own GitHub App is not set up) */
3405
+ 422: {
3406
+ headers: {
3407
+ [name: string]: unknown;
3408
+ };
3409
+ content: {
3410
+ "application/json": components["schemas"]["Error"];
3411
+ };
3412
+ };
3413
+ /** @description GitHub unavailable or refused */
3414
+ 502: {
3415
+ headers: {
3416
+ [name: string]: unknown;
3417
+ };
3418
+ content: {
3419
+ "application/json": components["schemas"]["Error"];
3420
+ };
3421
+ };
3422
+ /** @description GitHub Apps are not configured */
3423
+ 503: {
3424
+ headers: {
3425
+ [name: string]: unknown;
3426
+ };
3427
+ content: {
3428
+ "application/json": components["schemas"]["Error"];
3429
+ };
3430
+ };
3431
+ };
3432
+ };
3433
+ delete?: never;
3434
+ options?: never;
3435
+ head?: never;
3436
+ patch?: never;
3437
+ trace?: never;
3438
+ };
3439
+ "/agents/{id}/github-installation/repos/remove": {
3440
+ parameters: {
3441
+ query?: never;
3442
+ header?: never;
3443
+ path?: never;
3444
+ cookie?: never;
3445
+ };
3446
+ get?: never;
3447
+ put?: never;
3448
+ /**
3449
+ * Remove repos from the agent App's installation
3450
+ * @description Platform-admin only. Revokes the agent's own GitHub App installation access to the named repos, with no plan step; the agent's configured repos are not changed. Writes one audit entry (GitHubReconcileAudit, planHash `direct:remove`) recording the caller and repos. Same errors as the add route.
3451
+ */
3452
+ post: {
3453
+ parameters: {
3454
+ query?: never;
3455
+ header?: never;
3456
+ path: {
3457
+ id: string;
3458
+ };
3459
+ cookie?: never;
3460
+ };
3461
+ requestBody: {
3462
+ content: {
3463
+ "application/json": components["schemas"]["GithubInstallationReposBody"];
3464
+ };
3465
+ };
3466
+ responses: {
3467
+ /** @description Repos removed */
3468
+ 200: {
3469
+ headers: {
3470
+ [name: string]: unknown;
3471
+ };
3472
+ content: {
3473
+ "application/json": components["schemas"]["GithubInstallationReposChange"];
3474
+ };
3475
+ };
3476
+ /** @description Unauthorized */
3477
+ 401: {
3478
+ headers: {
3479
+ [name: string]: unknown;
3480
+ };
3481
+ content: {
3482
+ "application/json": components["schemas"]["Error"];
3483
+ };
3484
+ };
3485
+ /** @description Platform admin required */
3486
+ 403: {
3487
+ headers: {
3488
+ [name: string]: unknown;
3489
+ };
3490
+ content: {
3491
+ "application/json": components["schemas"]["Error"];
3492
+ };
3493
+ };
3494
+ /** @description Agent not found */
3495
+ 404: {
3496
+ headers: {
3497
+ [name: string]: unknown;
3498
+ };
3499
+ content: {
3500
+ "application/json": components["schemas"]["Error"];
3501
+ };
3502
+ };
3503
+ /** @description Agent App not installed on the org */
3504
+ 409: {
3505
+ headers: {
3506
+ [name: string]: unknown;
3507
+ };
3508
+ content: {
3509
+ "application/json": components["schemas"]["Error"];
3510
+ };
3511
+ };
3512
+ /** @description Agent has no GH_APP_ID (its own GitHub App is not set up) */
3513
+ 422: {
3514
+ headers: {
3515
+ [name: string]: unknown;
3516
+ };
3517
+ content: {
3518
+ "application/json": components["schemas"]["Error"];
3519
+ };
3520
+ };
3521
+ /** @description GitHub unavailable or refused */
3522
+ 502: {
3523
+ headers: {
3524
+ [name: string]: unknown;
3525
+ };
3526
+ content: {
3527
+ "application/json": components["schemas"]["Error"];
3528
+ };
3529
+ };
3530
+ /** @description GitHub Apps are not configured */
3531
+ 503: {
3532
+ headers: {
3533
+ [name: string]: unknown;
3534
+ };
3535
+ content: {
3536
+ "application/json": components["schemas"]["Error"];
3537
+ };
3538
+ };
3539
+ };
3540
+ };
3541
+ delete?: never;
3542
+ options?: never;
3543
+ head?: never;
3544
+ patch?: never;
3545
+ trace?: never;
3546
+ };
3183
3547
  "/agents/{id}/config": {
3184
3548
  parameters: {
3185
3549
  query?: never;
@@ -5003,6 +5367,27 @@ export interface components {
5003
5367
  /** @description Required when the plan removes more than 10 repos. */
5004
5368
  confirmRemovals?: boolean;
5005
5369
  };
5370
+ GithubInstallationReposList: {
5371
+ appId: number;
5372
+ orgs: {
5373
+ org: string;
5374
+ repos: {
5375
+ fullName: string;
5376
+ /** @description Whether the agent's bound GitHub user can push. Omitted when no username is bound or the org's access lookup is incomplete; never reported as false for unknown. */
5377
+ userCanPush?: boolean;
5378
+ }[];
5379
+ }[];
5380
+ };
5381
+ GithubInstallationReposChange: {
5382
+ /** @enum {string} */
5383
+ status: "applied";
5384
+ auditId: string;
5385
+ repos: string[];
5386
+ };
5387
+ GithubInstallationReposBody: {
5388
+ /** @description Repos (owner/repo) to change on the agent App's installation. */
5389
+ repos: string[];
5390
+ };
5006
5391
  AgentConfigResponse: {
5007
5392
  /**
5008
5393
  * @example {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@app-vitals/agent-lib",
3
- "version": "1.31.0",
3
+ "version": "1.33.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/app-vitals/agent.git",