@app-vitals/agent-lib 1.31.0 → 1.32.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 +316 -0
  2. package/package.json +1 -1
package/admin-types.ts CHANGED
@@ -3180,6 +3180,301 @@ export interface paths {
3180
3180
  patch?: never;
3181
3181
  trace?: never;
3182
3182
  };
3183
+ "/agents/{id}/github-installation/repos": {
3184
+ parameters: {
3185
+ query?: never;
3186
+ header?: never;
3187
+ path?: never;
3188
+ cookie?: never;
3189
+ };
3190
+ /**
3191
+ * List the repos on the agent App's installation
3192
+ * @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.
3193
+ */
3194
+ get: {
3195
+ parameters: {
3196
+ query?: never;
3197
+ header?: never;
3198
+ path: {
3199
+ id: string;
3200
+ };
3201
+ cookie?: never;
3202
+ };
3203
+ requestBody?: never;
3204
+ responses: {
3205
+ /** @description Installation repos */
3206
+ 200: {
3207
+ headers: {
3208
+ [name: string]: unknown;
3209
+ };
3210
+ content: {
3211
+ "application/json": components["schemas"]["GithubInstallationReposList"];
3212
+ };
3213
+ };
3214
+ /** @description Unauthorized */
3215
+ 401: {
3216
+ headers: {
3217
+ [name: string]: unknown;
3218
+ };
3219
+ content: {
3220
+ "application/json": components["schemas"]["Error"];
3221
+ };
3222
+ };
3223
+ /** @description Platform admin required */
3224
+ 403: {
3225
+ headers: {
3226
+ [name: string]: unknown;
3227
+ };
3228
+ content: {
3229
+ "application/json": components["schemas"]["Error"];
3230
+ };
3231
+ };
3232
+ /** @description Agent not found */
3233
+ 404: {
3234
+ headers: {
3235
+ [name: string]: unknown;
3236
+ };
3237
+ content: {
3238
+ "application/json": components["schemas"]["Error"];
3239
+ };
3240
+ };
3241
+ /** @description Agent has no GH_APP_ID (its own GitHub App is not set up) */
3242
+ 422: {
3243
+ headers: {
3244
+ [name: string]: unknown;
3245
+ };
3246
+ content: {
3247
+ "application/json": components["schemas"]["Error"];
3248
+ };
3249
+ };
3250
+ /** @description GitHub unavailable or refused */
3251
+ 502: {
3252
+ headers: {
3253
+ [name: string]: unknown;
3254
+ };
3255
+ content: {
3256
+ "application/json": components["schemas"]["Error"];
3257
+ };
3258
+ };
3259
+ /** @description GitHub Apps are not configured */
3260
+ 503: {
3261
+ headers: {
3262
+ [name: string]: unknown;
3263
+ };
3264
+ content: {
3265
+ "application/json": components["schemas"]["Error"];
3266
+ };
3267
+ };
3268
+ };
3269
+ };
3270
+ put?: never;
3271
+ /**
3272
+ * Add repos to the agent App's installation
3273
+ * @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).
3274
+ */
3275
+ post: {
3276
+ parameters: {
3277
+ query?: never;
3278
+ header?: never;
3279
+ path: {
3280
+ id: string;
3281
+ };
3282
+ cookie?: never;
3283
+ };
3284
+ requestBody: {
3285
+ content: {
3286
+ "application/json": components["schemas"]["GithubInstallationReposBody"];
3287
+ };
3288
+ };
3289
+ responses: {
3290
+ /** @description Repos added */
3291
+ 200: {
3292
+ headers: {
3293
+ [name: string]: unknown;
3294
+ };
3295
+ content: {
3296
+ "application/json": components["schemas"]["GithubInstallationReposChange"];
3297
+ };
3298
+ };
3299
+ /** @description Unauthorized */
3300
+ 401: {
3301
+ headers: {
3302
+ [name: string]: unknown;
3303
+ };
3304
+ content: {
3305
+ "application/json": components["schemas"]["Error"];
3306
+ };
3307
+ };
3308
+ /** @description Platform admin required */
3309
+ 403: {
3310
+ headers: {
3311
+ [name: string]: unknown;
3312
+ };
3313
+ content: {
3314
+ "application/json": components["schemas"]["Error"];
3315
+ };
3316
+ };
3317
+ /** @description Agent not found */
3318
+ 404: {
3319
+ headers: {
3320
+ [name: string]: unknown;
3321
+ };
3322
+ content: {
3323
+ "application/json": components["schemas"]["Error"];
3324
+ };
3325
+ };
3326
+ /** @description Agent App not installed on the org */
3327
+ 409: {
3328
+ headers: {
3329
+ [name: string]: unknown;
3330
+ };
3331
+ content: {
3332
+ "application/json": components["schemas"]["Error"];
3333
+ };
3334
+ };
3335
+ /** @description Agent has no GH_APP_ID (its own GitHub App is not set up) */
3336
+ 422: {
3337
+ headers: {
3338
+ [name: string]: unknown;
3339
+ };
3340
+ content: {
3341
+ "application/json": components["schemas"]["Error"];
3342
+ };
3343
+ };
3344
+ /** @description GitHub unavailable or refused */
3345
+ 502: {
3346
+ headers: {
3347
+ [name: string]: unknown;
3348
+ };
3349
+ content: {
3350
+ "application/json": components["schemas"]["Error"];
3351
+ };
3352
+ };
3353
+ /** @description GitHub Apps are not configured */
3354
+ 503: {
3355
+ headers: {
3356
+ [name: string]: unknown;
3357
+ };
3358
+ content: {
3359
+ "application/json": components["schemas"]["Error"];
3360
+ };
3361
+ };
3362
+ };
3363
+ };
3364
+ delete?: never;
3365
+ options?: never;
3366
+ head?: never;
3367
+ patch?: never;
3368
+ trace?: never;
3369
+ };
3370
+ "/agents/{id}/github-installation/repos/remove": {
3371
+ parameters: {
3372
+ query?: never;
3373
+ header?: never;
3374
+ path?: never;
3375
+ cookie?: never;
3376
+ };
3377
+ get?: never;
3378
+ put?: never;
3379
+ /**
3380
+ * Remove repos from the agent App's installation
3381
+ * @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.
3382
+ */
3383
+ post: {
3384
+ parameters: {
3385
+ query?: never;
3386
+ header?: never;
3387
+ path: {
3388
+ id: string;
3389
+ };
3390
+ cookie?: never;
3391
+ };
3392
+ requestBody: {
3393
+ content: {
3394
+ "application/json": components["schemas"]["GithubInstallationReposBody"];
3395
+ };
3396
+ };
3397
+ responses: {
3398
+ /** @description Repos removed */
3399
+ 200: {
3400
+ headers: {
3401
+ [name: string]: unknown;
3402
+ };
3403
+ content: {
3404
+ "application/json": components["schemas"]["GithubInstallationReposChange"];
3405
+ };
3406
+ };
3407
+ /** @description Unauthorized */
3408
+ 401: {
3409
+ headers: {
3410
+ [name: string]: unknown;
3411
+ };
3412
+ content: {
3413
+ "application/json": components["schemas"]["Error"];
3414
+ };
3415
+ };
3416
+ /** @description Platform admin required */
3417
+ 403: {
3418
+ headers: {
3419
+ [name: string]: unknown;
3420
+ };
3421
+ content: {
3422
+ "application/json": components["schemas"]["Error"];
3423
+ };
3424
+ };
3425
+ /** @description Agent not found */
3426
+ 404: {
3427
+ headers: {
3428
+ [name: string]: unknown;
3429
+ };
3430
+ content: {
3431
+ "application/json": components["schemas"]["Error"];
3432
+ };
3433
+ };
3434
+ /** @description Agent App not installed on the org */
3435
+ 409: {
3436
+ headers: {
3437
+ [name: string]: unknown;
3438
+ };
3439
+ content: {
3440
+ "application/json": components["schemas"]["Error"];
3441
+ };
3442
+ };
3443
+ /** @description Agent has no GH_APP_ID (its own GitHub App is not set up) */
3444
+ 422: {
3445
+ headers: {
3446
+ [name: string]: unknown;
3447
+ };
3448
+ content: {
3449
+ "application/json": components["schemas"]["Error"];
3450
+ };
3451
+ };
3452
+ /** @description GitHub unavailable or refused */
3453
+ 502: {
3454
+ headers: {
3455
+ [name: string]: unknown;
3456
+ };
3457
+ content: {
3458
+ "application/json": components["schemas"]["Error"];
3459
+ };
3460
+ };
3461
+ /** @description GitHub Apps are not configured */
3462
+ 503: {
3463
+ headers: {
3464
+ [name: string]: unknown;
3465
+ };
3466
+ content: {
3467
+ "application/json": components["schemas"]["Error"];
3468
+ };
3469
+ };
3470
+ };
3471
+ };
3472
+ delete?: never;
3473
+ options?: never;
3474
+ head?: never;
3475
+ patch?: never;
3476
+ trace?: never;
3477
+ };
3183
3478
  "/agents/{id}/config": {
3184
3479
  parameters: {
3185
3480
  query?: never;
@@ -5003,6 +5298,27 @@ export interface components {
5003
5298
  /** @description Required when the plan removes more than 10 repos. */
5004
5299
  confirmRemovals?: boolean;
5005
5300
  };
5301
+ GithubInstallationReposList: {
5302
+ appId: number;
5303
+ orgs: {
5304
+ org: string;
5305
+ repos: {
5306
+ fullName: string;
5307
+ /** @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. */
5308
+ userCanPush?: boolean;
5309
+ }[];
5310
+ }[];
5311
+ };
5312
+ GithubInstallationReposChange: {
5313
+ /** @enum {string} */
5314
+ status: "applied";
5315
+ auditId: string;
5316
+ repos: string[];
5317
+ };
5318
+ GithubInstallationReposBody: {
5319
+ /** @description Repos (owner/repo) to change on the agent App's installation. */
5320
+ repos: string[];
5321
+ };
5006
5322
  AgentConfigResponse: {
5007
5323
  /**
5008
5324
  * @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.32.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/app-vitals/agent.git",