@app-vitals/agent-admin 1.126.1 → 1.128.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.
@@ -2551,6 +2551,191 @@
2551
2551
  "source"
2552
2552
  ]
2553
2553
  },
2554
+ "AgentGitHubAppsWrapper": {
2555
+ "type": "object",
2556
+ "properties": {
2557
+ "apps": {
2558
+ "type": "array",
2559
+ "items": {
2560
+ "$ref": "#/components/schemas/AgentGitHubApp"
2561
+ }
2562
+ }
2563
+ },
2564
+ "required": [
2565
+ "apps"
2566
+ ]
2567
+ },
2568
+ "AgentGitHubApp": {
2569
+ "type": "object",
2570
+ "properties": {
2571
+ "id": {
2572
+ "type": "string",
2573
+ "example": "clx1234567890"
2574
+ },
2575
+ "agentId": {
2576
+ "type": "string",
2577
+ "example": "clx1234567890"
2578
+ },
2579
+ "appId": {
2580
+ "type": "string",
2581
+ "example": "12345"
2582
+ },
2583
+ "slug": {
2584
+ "type": [
2585
+ "string",
2586
+ "null"
2587
+ ],
2588
+ "example": "my-app"
2589
+ },
2590
+ "clientId": {
2591
+ "type": [
2592
+ "string",
2593
+ "null"
2594
+ ],
2595
+ "example": "Iv1.abcdef0123456789"
2596
+ },
2597
+ "installationId": {
2598
+ "type": [
2599
+ "string",
2600
+ "null"
2601
+ ],
2602
+ "example": "9876543"
2603
+ },
2604
+ "priority": {
2605
+ "type": "integer",
2606
+ "example": 0
2607
+ },
2608
+ "hasPrivateKey": {
2609
+ "type": "boolean",
2610
+ "example": true
2611
+ },
2612
+ "hasClientSecret": {
2613
+ "type": "boolean",
2614
+ "example": false
2615
+ },
2616
+ "createdAt": {
2617
+ "type": "string",
2618
+ "format": "date-time",
2619
+ "example": "2026-01-01T00:00:00.000Z"
2620
+ },
2621
+ "updatedAt": {
2622
+ "type": "string",
2623
+ "format": "date-time",
2624
+ "example": "2026-01-01T00:00:00.000Z"
2625
+ }
2626
+ },
2627
+ "required": [
2628
+ "id",
2629
+ "agentId",
2630
+ "appId",
2631
+ "slug",
2632
+ "clientId",
2633
+ "installationId",
2634
+ "priority",
2635
+ "hasPrivateKey",
2636
+ "hasClientSecret",
2637
+ "createdAt",
2638
+ "updatedAt"
2639
+ ]
2640
+ },
2641
+ "AgentGitHubAppWrapper": {
2642
+ "type": "object",
2643
+ "properties": {
2644
+ "app": {
2645
+ "$ref": "#/components/schemas/AgentGitHubApp"
2646
+ }
2647
+ },
2648
+ "required": [
2649
+ "app"
2650
+ ]
2651
+ },
2652
+ "CreateAgentGitHubAppBody": {
2653
+ "type": "object",
2654
+ "properties": {
2655
+ "appId": {
2656
+ "type": "string",
2657
+ "example": "12345"
2658
+ },
2659
+ "slug": {
2660
+ "type": [
2661
+ "string",
2662
+ "null"
2663
+ ],
2664
+ "example": "my-app"
2665
+ },
2666
+ "clientId": {
2667
+ "type": [
2668
+ "string",
2669
+ "null"
2670
+ ],
2671
+ "example": "Iv1.abcdef0123456789"
2672
+ },
2673
+ "privateKey": {
2674
+ "type": "string",
2675
+ "description": "PEM private key. Write-only: never returned."
2676
+ },
2677
+ "clientSecret": {
2678
+ "type": [
2679
+ "string",
2680
+ "null"
2681
+ ],
2682
+ "description": "OAuth client secret. Write-only: never returned."
2683
+ },
2684
+ "installationId": {
2685
+ "type": [
2686
+ "string",
2687
+ "null"
2688
+ ],
2689
+ "example": "9876543"
2690
+ },
2691
+ "priority": {
2692
+ "type": "integer",
2693
+ "description": "Lowest wins when two apps are installed on the same owner. Defaults to one past the agent's highest.",
2694
+ "example": 0
2695
+ }
2696
+ },
2697
+ "required": [
2698
+ "appId",
2699
+ "privateKey"
2700
+ ]
2701
+ },
2702
+ "UpdateAgentGitHubAppBody": {
2703
+ "type": "object",
2704
+ "properties": {
2705
+ "slug": {
2706
+ "type": [
2707
+ "string",
2708
+ "null"
2709
+ ]
2710
+ },
2711
+ "clientId": {
2712
+ "type": [
2713
+ "string",
2714
+ "null"
2715
+ ]
2716
+ },
2717
+ "privateKey": {
2718
+ "type": "string",
2719
+ "description": "Replaces the stored key. Write-only."
2720
+ },
2721
+ "clientSecret": {
2722
+ "type": [
2723
+ "string",
2724
+ "null"
2725
+ ],
2726
+ "description": "Replaces the stored secret; null clears it. Write-only."
2727
+ },
2728
+ "installationId": {
2729
+ "type": [
2730
+ "string",
2731
+ "null"
2732
+ ]
2733
+ },
2734
+ "priority": {
2735
+ "type": "integer"
2736
+ }
2737
+ }
2738
+ },
2554
2739
  "CronRunTokenStats": {
2555
2740
  "type": "object",
2556
2741
  "properties": {
@@ -3804,6 +3989,12 @@
3804
3989
  "$ref": "#/components/schemas/AgentConfigMarketplace"
3805
3990
  }
3806
3991
  },
3992
+ "apps": {
3993
+ "type": "array",
3994
+ "items": {
3995
+ "$ref": "#/components/schemas/AgentConfigGitHubApp"
3996
+ }
3997
+ },
3807
3998
  "repos": {
3808
3999
  "type": "array",
3809
4000
  "items": {
@@ -3975,6 +4166,58 @@
3975
4166
  "ref"
3976
4167
  ]
3977
4168
  },
4169
+ "AgentConfigGitHubApp": {
4170
+ "type": "object",
4171
+ "properties": {
4172
+ "id": {
4173
+ "type": "string"
4174
+ },
4175
+ "appId": {
4176
+ "type": "string",
4177
+ "example": "12345"
4178
+ },
4179
+ "slug": {
4180
+ "type": [
4181
+ "string",
4182
+ "null"
4183
+ ]
4184
+ },
4185
+ "clientId": {
4186
+ "type": [
4187
+ "string",
4188
+ "null"
4189
+ ]
4190
+ },
4191
+ "installationId": {
4192
+ "type": [
4193
+ "string",
4194
+ "null"
4195
+ ]
4196
+ },
4197
+ "priority": {
4198
+ "type": "integer"
4199
+ },
4200
+ "privateKey": {
4201
+ "type": "string"
4202
+ },
4203
+ "clientSecret": {
4204
+ "type": [
4205
+ "string",
4206
+ "null"
4207
+ ]
4208
+ }
4209
+ },
4210
+ "required": [
4211
+ "id",
4212
+ "appId",
4213
+ "slug",
4214
+ "clientId",
4215
+ "installationId",
4216
+ "priority",
4217
+ "privateKey",
4218
+ "clientSecret"
4219
+ ]
4220
+ },
3978
4221
  "AgentConfigFeatures": {
3979
4222
  "type": "object",
3980
4223
  "properties": {
@@ -7126,6 +7369,257 @@
7126
7369
  }
7127
7370
  }
7128
7371
  },
7372
+ "/agents/{id}/github-apps": {
7373
+ "get": {
7374
+ "summary": "List GitHub Apps",
7375
+ "description": "Returns the agent's GitHub Apps in priority order (lowest wins). Private keys and client secrets are write-only: only `hasPrivateKey` / `hasClientSecret` flags are returned.",
7376
+ "parameters": [
7377
+ {
7378
+ "schema": {
7379
+ "type": "string",
7380
+ "example": "clx1234567890"
7381
+ },
7382
+ "required": true,
7383
+ "name": "id",
7384
+ "in": "path"
7385
+ }
7386
+ ],
7387
+ "responses": {
7388
+ "200": {
7389
+ "description": "List of GitHub Apps",
7390
+ "content": {
7391
+ "application/json": {
7392
+ "schema": {
7393
+ "$ref": "#/components/schemas/AgentGitHubAppsWrapper"
7394
+ }
7395
+ }
7396
+ }
7397
+ },
7398
+ "503": {
7399
+ "description": "GitHub Apps not configured",
7400
+ "content": {
7401
+ "application/json": {
7402
+ "schema": {
7403
+ "$ref": "#/components/schemas/Error"
7404
+ }
7405
+ }
7406
+ }
7407
+ }
7408
+ }
7409
+ },
7410
+ "post": {
7411
+ "summary": "Add a GitHub App",
7412
+ "description": "Adds a GitHub App to the agent. The private key and client secret are encrypted and never returned. 409 when the agent already has this `appId`; 422 on an invalid field.",
7413
+ "parameters": [
7414
+ {
7415
+ "schema": {
7416
+ "type": "string",
7417
+ "example": "clx1234567890"
7418
+ },
7419
+ "required": true,
7420
+ "name": "id",
7421
+ "in": "path"
7422
+ }
7423
+ ],
7424
+ "requestBody": {
7425
+ "content": {
7426
+ "application/json": {
7427
+ "schema": {
7428
+ "$ref": "#/components/schemas/CreateAgentGitHubAppBody"
7429
+ }
7430
+ }
7431
+ }
7432
+ },
7433
+ "responses": {
7434
+ "201": {
7435
+ "description": "GitHub App added",
7436
+ "content": {
7437
+ "application/json": {
7438
+ "schema": {
7439
+ "$ref": "#/components/schemas/AgentGitHubAppWrapper"
7440
+ }
7441
+ }
7442
+ }
7443
+ },
7444
+ "400": {
7445
+ "description": "Bad request",
7446
+ "content": {
7447
+ "application/json": {
7448
+ "schema": {
7449
+ "$ref": "#/components/schemas/Error"
7450
+ }
7451
+ }
7452
+ }
7453
+ },
7454
+ "409": {
7455
+ "description": "App already added",
7456
+ "content": {
7457
+ "application/json": {
7458
+ "schema": {
7459
+ "$ref": "#/components/schemas/Error"
7460
+ }
7461
+ }
7462
+ }
7463
+ },
7464
+ "422": {
7465
+ "description": "Invalid field",
7466
+ "content": {
7467
+ "application/json": {
7468
+ "schema": {
7469
+ "$ref": "#/components/schemas/Error"
7470
+ }
7471
+ }
7472
+ }
7473
+ },
7474
+ "503": {
7475
+ "description": "GitHub Apps not configured",
7476
+ "content": {
7477
+ "application/json": {
7478
+ "schema": {
7479
+ "$ref": "#/components/schemas/Error"
7480
+ }
7481
+ }
7482
+ }
7483
+ }
7484
+ }
7485
+ }
7486
+ },
7487
+ "/agents/{id}/github-apps/{appRowId}": {
7488
+ "patch": {
7489
+ "summary": "Update a GitHub App",
7490
+ "description": "Partial update: omitted fields are unchanged, null clears a nullable field. `privateKey` / `clientSecret` replace the stored secret and are never returned.",
7491
+ "parameters": [
7492
+ {
7493
+ "schema": {
7494
+ "type": "string",
7495
+ "example": "clx1234567890"
7496
+ },
7497
+ "required": true,
7498
+ "name": "id",
7499
+ "in": "path"
7500
+ },
7501
+ {
7502
+ "schema": {
7503
+ "type": "string",
7504
+ "example": "clx0987654321"
7505
+ },
7506
+ "required": true,
7507
+ "name": "appRowId",
7508
+ "in": "path"
7509
+ }
7510
+ ],
7511
+ "requestBody": {
7512
+ "content": {
7513
+ "application/json": {
7514
+ "schema": {
7515
+ "$ref": "#/components/schemas/UpdateAgentGitHubAppBody"
7516
+ }
7517
+ }
7518
+ }
7519
+ },
7520
+ "responses": {
7521
+ "200": {
7522
+ "description": "GitHub App updated",
7523
+ "content": {
7524
+ "application/json": {
7525
+ "schema": {
7526
+ "$ref": "#/components/schemas/AgentGitHubAppWrapper"
7527
+ }
7528
+ }
7529
+ }
7530
+ },
7531
+ "400": {
7532
+ "description": "Bad request",
7533
+ "content": {
7534
+ "application/json": {
7535
+ "schema": {
7536
+ "$ref": "#/components/schemas/Error"
7537
+ }
7538
+ }
7539
+ }
7540
+ },
7541
+ "404": {
7542
+ "description": "GitHub App not found",
7543
+ "content": {
7544
+ "application/json": {
7545
+ "schema": {
7546
+ "$ref": "#/components/schemas/Error"
7547
+ }
7548
+ }
7549
+ }
7550
+ },
7551
+ "422": {
7552
+ "description": "Invalid field",
7553
+ "content": {
7554
+ "application/json": {
7555
+ "schema": {
7556
+ "$ref": "#/components/schemas/Error"
7557
+ }
7558
+ }
7559
+ }
7560
+ },
7561
+ "503": {
7562
+ "description": "GitHub Apps not configured",
7563
+ "content": {
7564
+ "application/json": {
7565
+ "schema": {
7566
+ "$ref": "#/components/schemas/Error"
7567
+ }
7568
+ }
7569
+ }
7570
+ }
7571
+ }
7572
+ },
7573
+ "delete": {
7574
+ "summary": "Remove a GitHub App",
7575
+ "description": "Removes the app row by id. 404 when the id does not exist or belongs to a different agent.",
7576
+ "parameters": [
7577
+ {
7578
+ "schema": {
7579
+ "type": "string",
7580
+ "example": "clx1234567890"
7581
+ },
7582
+ "required": true,
7583
+ "name": "id",
7584
+ "in": "path"
7585
+ },
7586
+ {
7587
+ "schema": {
7588
+ "type": "string",
7589
+ "example": "clx0987654321"
7590
+ },
7591
+ "required": true,
7592
+ "name": "appRowId",
7593
+ "in": "path"
7594
+ }
7595
+ ],
7596
+ "responses": {
7597
+ "204": {
7598
+ "description": "GitHub App removed"
7599
+ },
7600
+ "404": {
7601
+ "description": "GitHub App not found",
7602
+ "content": {
7603
+ "application/json": {
7604
+ "schema": {
7605
+ "$ref": "#/components/schemas/Error"
7606
+ }
7607
+ }
7608
+ }
7609
+ },
7610
+ "503": {
7611
+ "description": "GitHub Apps not configured",
7612
+ "content": {
7613
+ "application/json": {
7614
+ "schema": {
7615
+ "$ref": "#/components/schemas/Error"
7616
+ }
7617
+ }
7618
+ }
7619
+ }
7620
+ }
7621
+ }
7622
+ },
7129
7623
  "/agents/all/cron-runs/stats": {
7130
7624
  "get": {
7131
7625
  "summary": "Get aggregated cron-run token stats",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@app-vitals/agent-admin",
3
- "version": "1.126.1",
3
+ "version": "1.128.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/app-vitals/agent.git",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@anthropic-ai/sdk": "0.137.0",
47
- "@app-vitals/agent-lib": "1.126.1",
47
+ "@app-vitals/agent-lib": "1.128.0",
48
48
  "@hono/zod-openapi": "^1.0.0",
49
49
  "@prisma/adapter-pg": "^7.10.0",
50
50
  "@prisma/client": "^7.10.0",