@app-vitals/agent-admin 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.
- package/openapi.platform.json +498 -1
- package/package.json +2 -2
- package/src/admin-boot.ts +14 -4
- package/src/agents-api.smoke.test.ts +546 -3
- package/src/agents-api.ts +312 -3
- package/src/github-reconcile-routes.integration.test.ts +6 -2
- package/src/github-reconcile-wiring.ts +45 -18
- package/src/github-reconcile-wiring.unit.test.ts +45 -21
- package/src/installation-repos-service.ts +237 -0
- package/src/installation-repos-service.unit.test.ts +270 -0
- package/src/reconcile-apply-service.integration.test.ts +11 -3
- package/src/reconcile-apply-service.ts +88 -22
- package/src/reconcile-apply-service.unit.test.ts +70 -24
- package/src/repo-removal-open-work.ts +59 -0
- package/src/repo-removal-open-work.unit.test.ts +81 -0
package/openapi.platform.json
CHANGED
|
@@ -3492,6 +3492,94 @@
|
|
|
3492
3492
|
"planHash"
|
|
3493
3493
|
]
|
|
3494
3494
|
},
|
|
3495
|
+
"GithubInstallationReposList": {
|
|
3496
|
+
"type": "object",
|
|
3497
|
+
"properties": {
|
|
3498
|
+
"appId": {
|
|
3499
|
+
"type": "integer"
|
|
3500
|
+
},
|
|
3501
|
+
"orgs": {
|
|
3502
|
+
"type": "array",
|
|
3503
|
+
"items": {
|
|
3504
|
+
"type": "object",
|
|
3505
|
+
"properties": {
|
|
3506
|
+
"org": {
|
|
3507
|
+
"type": "string"
|
|
3508
|
+
},
|
|
3509
|
+
"repos": {
|
|
3510
|
+
"type": "array",
|
|
3511
|
+
"items": {
|
|
3512
|
+
"type": "object",
|
|
3513
|
+
"properties": {
|
|
3514
|
+
"fullName": {
|
|
3515
|
+
"type": "string"
|
|
3516
|
+
},
|
|
3517
|
+
"userCanPush": {
|
|
3518
|
+
"type": "boolean",
|
|
3519
|
+
"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."
|
|
3520
|
+
}
|
|
3521
|
+
},
|
|
3522
|
+
"required": [
|
|
3523
|
+
"fullName"
|
|
3524
|
+
]
|
|
3525
|
+
}
|
|
3526
|
+
}
|
|
3527
|
+
},
|
|
3528
|
+
"required": [
|
|
3529
|
+
"org",
|
|
3530
|
+
"repos"
|
|
3531
|
+
]
|
|
3532
|
+
}
|
|
3533
|
+
}
|
|
3534
|
+
},
|
|
3535
|
+
"required": [
|
|
3536
|
+
"appId",
|
|
3537
|
+
"orgs"
|
|
3538
|
+
]
|
|
3539
|
+
},
|
|
3540
|
+
"GithubInstallationReposChange": {
|
|
3541
|
+
"type": "object",
|
|
3542
|
+
"properties": {
|
|
3543
|
+
"status": {
|
|
3544
|
+
"type": "string",
|
|
3545
|
+
"enum": [
|
|
3546
|
+
"applied"
|
|
3547
|
+
]
|
|
3548
|
+
},
|
|
3549
|
+
"auditId": {
|
|
3550
|
+
"type": "string"
|
|
3551
|
+
},
|
|
3552
|
+
"repos": {
|
|
3553
|
+
"type": "array",
|
|
3554
|
+
"items": {
|
|
3555
|
+
"type": "string"
|
|
3556
|
+
}
|
|
3557
|
+
}
|
|
3558
|
+
},
|
|
3559
|
+
"required": [
|
|
3560
|
+
"status",
|
|
3561
|
+
"auditId",
|
|
3562
|
+
"repos"
|
|
3563
|
+
]
|
|
3564
|
+
},
|
|
3565
|
+
"GithubInstallationReposBody": {
|
|
3566
|
+
"type": "object",
|
|
3567
|
+
"properties": {
|
|
3568
|
+
"repos": {
|
|
3569
|
+
"type": "array",
|
|
3570
|
+
"items": {
|
|
3571
|
+
"type": "string",
|
|
3572
|
+
"pattern": "^[^/\\s]+\\/[^/\\s]+$"
|
|
3573
|
+
},
|
|
3574
|
+
"minItems": 1,
|
|
3575
|
+
"maxItems": 100,
|
|
3576
|
+
"description": "Repos (owner/repo) to change on the agent App's installation."
|
|
3577
|
+
}
|
|
3578
|
+
},
|
|
3579
|
+
"required": [
|
|
3580
|
+
"repos"
|
|
3581
|
+
]
|
|
3582
|
+
},
|
|
3495
3583
|
"AgentConfigResponse": {
|
|
3496
3584
|
"type": "object",
|
|
3497
3585
|
"properties": {
|
|
@@ -4459,7 +4547,7 @@
|
|
|
4459
4547
|
"/agents/{id}/repos/{owner}/{name}": {
|
|
4460
4548
|
"delete": {
|
|
4461
4549
|
"summary": "Remove a repo from an agent",
|
|
4462
|
-
"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.",
|
|
4550
|
+
"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.",
|
|
4463
4551
|
"parameters": [
|
|
4464
4552
|
{
|
|
4465
4553
|
"schema": {
|
|
@@ -4523,6 +4611,110 @@
|
|
|
4523
4611
|
}
|
|
4524
4612
|
}
|
|
4525
4613
|
},
|
|
4614
|
+
"/agents/{id}/repos/{owner}/{name}/removal-preview": {
|
|
4615
|
+
"get": {
|
|
4616
|
+
"summary": "Preview the open work blocked by removing a repo from an agent",
|
|
4617
|
+
"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.",
|
|
4618
|
+
"parameters": [
|
|
4619
|
+
{
|
|
4620
|
+
"schema": {
|
|
4621
|
+
"type": "string",
|
|
4622
|
+
"example": "clx1234567890"
|
|
4623
|
+
},
|
|
4624
|
+
"required": true,
|
|
4625
|
+
"name": "id",
|
|
4626
|
+
"in": "path"
|
|
4627
|
+
},
|
|
4628
|
+
{
|
|
4629
|
+
"schema": {
|
|
4630
|
+
"type": "string",
|
|
4631
|
+
"example": "my-org"
|
|
4632
|
+
},
|
|
4633
|
+
"required": true,
|
|
4634
|
+
"name": "owner",
|
|
4635
|
+
"in": "path"
|
|
4636
|
+
},
|
|
4637
|
+
{
|
|
4638
|
+
"schema": {
|
|
4639
|
+
"type": "string",
|
|
4640
|
+
"example": "my-repo"
|
|
4641
|
+
},
|
|
4642
|
+
"required": true,
|
|
4643
|
+
"name": "name",
|
|
4644
|
+
"in": "path"
|
|
4645
|
+
}
|
|
4646
|
+
],
|
|
4647
|
+
"responses": {
|
|
4648
|
+
"200": {
|
|
4649
|
+
"description": "Open work that would be blocked",
|
|
4650
|
+
"content": {
|
|
4651
|
+
"application/json": {
|
|
4652
|
+
"schema": {
|
|
4653
|
+
"type": "object",
|
|
4654
|
+
"properties": {
|
|
4655
|
+
"repo": {
|
|
4656
|
+
"type": "string"
|
|
4657
|
+
},
|
|
4658
|
+
"openWork": {
|
|
4659
|
+
"type": "array",
|
|
4660
|
+
"items": {
|
|
4661
|
+
"type": "object",
|
|
4662
|
+
"properties": {
|
|
4663
|
+
"id": {
|
|
4664
|
+
"type": "string"
|
|
4665
|
+
},
|
|
4666
|
+
"repo": {
|
|
4667
|
+
"type": "string"
|
|
4668
|
+
},
|
|
4669
|
+
"title": {
|
|
4670
|
+
"type": "string"
|
|
4671
|
+
}
|
|
4672
|
+
},
|
|
4673
|
+
"required": [
|
|
4674
|
+
"id",
|
|
4675
|
+
"repo"
|
|
4676
|
+
]
|
|
4677
|
+
}
|
|
4678
|
+
},
|
|
4679
|
+
"warnings": {
|
|
4680
|
+
"type": "array",
|
|
4681
|
+
"items": {
|
|
4682
|
+
"type": "string"
|
|
4683
|
+
}
|
|
4684
|
+
}
|
|
4685
|
+
},
|
|
4686
|
+
"required": [
|
|
4687
|
+
"repo",
|
|
4688
|
+
"openWork",
|
|
4689
|
+
"warnings"
|
|
4690
|
+
]
|
|
4691
|
+
}
|
|
4692
|
+
}
|
|
4693
|
+
}
|
|
4694
|
+
},
|
|
4695
|
+
"403": {
|
|
4696
|
+
"description": "Forbidden",
|
|
4697
|
+
"content": {
|
|
4698
|
+
"application/json": {
|
|
4699
|
+
"schema": {
|
|
4700
|
+
"$ref": "#/components/schemas/Error"
|
|
4701
|
+
}
|
|
4702
|
+
}
|
|
4703
|
+
}
|
|
4704
|
+
},
|
|
4705
|
+
"404": {
|
|
4706
|
+
"description": "Agent or repo not found",
|
|
4707
|
+
"content": {
|
|
4708
|
+
"application/json": {
|
|
4709
|
+
"schema": {
|
|
4710
|
+
"$ref": "#/components/schemas/Error"
|
|
4711
|
+
}
|
|
4712
|
+
}
|
|
4713
|
+
}
|
|
4714
|
+
}
|
|
4715
|
+
}
|
|
4716
|
+
}
|
|
4717
|
+
},
|
|
4526
4718
|
"/agents": {
|
|
4527
4719
|
"get": {
|
|
4528
4720
|
"summary": "List all agents",
|
|
@@ -7283,6 +7475,311 @@
|
|
|
7283
7475
|
}
|
|
7284
7476
|
}
|
|
7285
7477
|
},
|
|
7478
|
+
"/agents/{id}/github-installation/repos": {
|
|
7479
|
+
"get": {
|
|
7480
|
+
"summary": "List the repos on the agent App's installation",
|
|
7481
|
+
"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.",
|
|
7482
|
+
"parameters": [
|
|
7483
|
+
{
|
|
7484
|
+
"schema": {
|
|
7485
|
+
"type": "string",
|
|
7486
|
+
"example": "clx1234567890"
|
|
7487
|
+
},
|
|
7488
|
+
"required": true,
|
|
7489
|
+
"name": "id",
|
|
7490
|
+
"in": "path"
|
|
7491
|
+
}
|
|
7492
|
+
],
|
|
7493
|
+
"responses": {
|
|
7494
|
+
"200": {
|
|
7495
|
+
"description": "Installation repos",
|
|
7496
|
+
"content": {
|
|
7497
|
+
"application/json": {
|
|
7498
|
+
"schema": {
|
|
7499
|
+
"$ref": "#/components/schemas/GithubInstallationReposList"
|
|
7500
|
+
}
|
|
7501
|
+
}
|
|
7502
|
+
}
|
|
7503
|
+
},
|
|
7504
|
+
"401": {
|
|
7505
|
+
"description": "Unauthorized",
|
|
7506
|
+
"content": {
|
|
7507
|
+
"application/json": {
|
|
7508
|
+
"schema": {
|
|
7509
|
+
"$ref": "#/components/schemas/Error"
|
|
7510
|
+
}
|
|
7511
|
+
}
|
|
7512
|
+
}
|
|
7513
|
+
},
|
|
7514
|
+
"403": {
|
|
7515
|
+
"description": "Platform admin required",
|
|
7516
|
+
"content": {
|
|
7517
|
+
"application/json": {
|
|
7518
|
+
"schema": {
|
|
7519
|
+
"$ref": "#/components/schemas/Error"
|
|
7520
|
+
}
|
|
7521
|
+
}
|
|
7522
|
+
}
|
|
7523
|
+
},
|
|
7524
|
+
"404": {
|
|
7525
|
+
"description": "Agent not found",
|
|
7526
|
+
"content": {
|
|
7527
|
+
"application/json": {
|
|
7528
|
+
"schema": {
|
|
7529
|
+
"$ref": "#/components/schemas/Error"
|
|
7530
|
+
}
|
|
7531
|
+
}
|
|
7532
|
+
}
|
|
7533
|
+
},
|
|
7534
|
+
"422": {
|
|
7535
|
+
"description": "Agent has no GH_APP_ID (its own GitHub App is not set up)",
|
|
7536
|
+
"content": {
|
|
7537
|
+
"application/json": {
|
|
7538
|
+
"schema": {
|
|
7539
|
+
"$ref": "#/components/schemas/Error"
|
|
7540
|
+
}
|
|
7541
|
+
}
|
|
7542
|
+
}
|
|
7543
|
+
},
|
|
7544
|
+
"502": {
|
|
7545
|
+
"description": "GitHub unavailable or refused",
|
|
7546
|
+
"content": {
|
|
7547
|
+
"application/json": {
|
|
7548
|
+
"schema": {
|
|
7549
|
+
"$ref": "#/components/schemas/Error"
|
|
7550
|
+
}
|
|
7551
|
+
}
|
|
7552
|
+
}
|
|
7553
|
+
},
|
|
7554
|
+
"503": {
|
|
7555
|
+
"description": "GitHub Apps are not configured",
|
|
7556
|
+
"content": {
|
|
7557
|
+
"application/json": {
|
|
7558
|
+
"schema": {
|
|
7559
|
+
"$ref": "#/components/schemas/Error"
|
|
7560
|
+
}
|
|
7561
|
+
}
|
|
7562
|
+
}
|
|
7563
|
+
}
|
|
7564
|
+
}
|
|
7565
|
+
},
|
|
7566
|
+
"post": {
|
|
7567
|
+
"summary": "Add repos to the agent App's installation",
|
|
7568
|
+
"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).",
|
|
7569
|
+
"parameters": [
|
|
7570
|
+
{
|
|
7571
|
+
"schema": {
|
|
7572
|
+
"type": "string",
|
|
7573
|
+
"example": "clx1234567890"
|
|
7574
|
+
},
|
|
7575
|
+
"required": true,
|
|
7576
|
+
"name": "id",
|
|
7577
|
+
"in": "path"
|
|
7578
|
+
}
|
|
7579
|
+
],
|
|
7580
|
+
"requestBody": {
|
|
7581
|
+
"required": true,
|
|
7582
|
+
"content": {
|
|
7583
|
+
"application/json": {
|
|
7584
|
+
"schema": {
|
|
7585
|
+
"$ref": "#/components/schemas/GithubInstallationReposBody"
|
|
7586
|
+
}
|
|
7587
|
+
}
|
|
7588
|
+
}
|
|
7589
|
+
},
|
|
7590
|
+
"responses": {
|
|
7591
|
+
"200": {
|
|
7592
|
+
"description": "Repos added",
|
|
7593
|
+
"content": {
|
|
7594
|
+
"application/json": {
|
|
7595
|
+
"schema": {
|
|
7596
|
+
"$ref": "#/components/schemas/GithubInstallationReposChange"
|
|
7597
|
+
}
|
|
7598
|
+
}
|
|
7599
|
+
}
|
|
7600
|
+
},
|
|
7601
|
+
"401": {
|
|
7602
|
+
"description": "Unauthorized",
|
|
7603
|
+
"content": {
|
|
7604
|
+
"application/json": {
|
|
7605
|
+
"schema": {
|
|
7606
|
+
"$ref": "#/components/schemas/Error"
|
|
7607
|
+
}
|
|
7608
|
+
}
|
|
7609
|
+
}
|
|
7610
|
+
},
|
|
7611
|
+
"403": {
|
|
7612
|
+
"description": "Platform admin required",
|
|
7613
|
+
"content": {
|
|
7614
|
+
"application/json": {
|
|
7615
|
+
"schema": {
|
|
7616
|
+
"$ref": "#/components/schemas/Error"
|
|
7617
|
+
}
|
|
7618
|
+
}
|
|
7619
|
+
}
|
|
7620
|
+
},
|
|
7621
|
+
"404": {
|
|
7622
|
+
"description": "Agent not found",
|
|
7623
|
+
"content": {
|
|
7624
|
+
"application/json": {
|
|
7625
|
+
"schema": {
|
|
7626
|
+
"$ref": "#/components/schemas/Error"
|
|
7627
|
+
}
|
|
7628
|
+
}
|
|
7629
|
+
}
|
|
7630
|
+
},
|
|
7631
|
+
"409": {
|
|
7632
|
+
"description": "Agent App not installed on the org",
|
|
7633
|
+
"content": {
|
|
7634
|
+
"application/json": {
|
|
7635
|
+
"schema": {
|
|
7636
|
+
"$ref": "#/components/schemas/Error"
|
|
7637
|
+
}
|
|
7638
|
+
}
|
|
7639
|
+
}
|
|
7640
|
+
},
|
|
7641
|
+
"422": {
|
|
7642
|
+
"description": "Agent has no GH_APP_ID (its own GitHub App is not set up)",
|
|
7643
|
+
"content": {
|
|
7644
|
+
"application/json": {
|
|
7645
|
+
"schema": {
|
|
7646
|
+
"$ref": "#/components/schemas/Error"
|
|
7647
|
+
}
|
|
7648
|
+
}
|
|
7649
|
+
}
|
|
7650
|
+
},
|
|
7651
|
+
"502": {
|
|
7652
|
+
"description": "GitHub unavailable or refused",
|
|
7653
|
+
"content": {
|
|
7654
|
+
"application/json": {
|
|
7655
|
+
"schema": {
|
|
7656
|
+
"$ref": "#/components/schemas/Error"
|
|
7657
|
+
}
|
|
7658
|
+
}
|
|
7659
|
+
}
|
|
7660
|
+
},
|
|
7661
|
+
"503": {
|
|
7662
|
+
"description": "GitHub Apps are not configured",
|
|
7663
|
+
"content": {
|
|
7664
|
+
"application/json": {
|
|
7665
|
+
"schema": {
|
|
7666
|
+
"$ref": "#/components/schemas/Error"
|
|
7667
|
+
}
|
|
7668
|
+
}
|
|
7669
|
+
}
|
|
7670
|
+
}
|
|
7671
|
+
}
|
|
7672
|
+
}
|
|
7673
|
+
},
|
|
7674
|
+
"/agents/{id}/github-installation/repos/remove": {
|
|
7675
|
+
"post": {
|
|
7676
|
+
"summary": "Remove repos from the agent App's installation",
|
|
7677
|
+
"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.",
|
|
7678
|
+
"parameters": [
|
|
7679
|
+
{
|
|
7680
|
+
"schema": {
|
|
7681
|
+
"type": "string",
|
|
7682
|
+
"example": "clx1234567890"
|
|
7683
|
+
},
|
|
7684
|
+
"required": true,
|
|
7685
|
+
"name": "id",
|
|
7686
|
+
"in": "path"
|
|
7687
|
+
}
|
|
7688
|
+
],
|
|
7689
|
+
"requestBody": {
|
|
7690
|
+
"required": true,
|
|
7691
|
+
"content": {
|
|
7692
|
+
"application/json": {
|
|
7693
|
+
"schema": {
|
|
7694
|
+
"$ref": "#/components/schemas/GithubInstallationReposBody"
|
|
7695
|
+
}
|
|
7696
|
+
}
|
|
7697
|
+
}
|
|
7698
|
+
},
|
|
7699
|
+
"responses": {
|
|
7700
|
+
"200": {
|
|
7701
|
+
"description": "Repos removed",
|
|
7702
|
+
"content": {
|
|
7703
|
+
"application/json": {
|
|
7704
|
+
"schema": {
|
|
7705
|
+
"$ref": "#/components/schemas/GithubInstallationReposChange"
|
|
7706
|
+
}
|
|
7707
|
+
}
|
|
7708
|
+
}
|
|
7709
|
+
},
|
|
7710
|
+
"401": {
|
|
7711
|
+
"description": "Unauthorized",
|
|
7712
|
+
"content": {
|
|
7713
|
+
"application/json": {
|
|
7714
|
+
"schema": {
|
|
7715
|
+
"$ref": "#/components/schemas/Error"
|
|
7716
|
+
}
|
|
7717
|
+
}
|
|
7718
|
+
}
|
|
7719
|
+
},
|
|
7720
|
+
"403": {
|
|
7721
|
+
"description": "Platform admin required",
|
|
7722
|
+
"content": {
|
|
7723
|
+
"application/json": {
|
|
7724
|
+
"schema": {
|
|
7725
|
+
"$ref": "#/components/schemas/Error"
|
|
7726
|
+
}
|
|
7727
|
+
}
|
|
7728
|
+
}
|
|
7729
|
+
},
|
|
7730
|
+
"404": {
|
|
7731
|
+
"description": "Agent not found",
|
|
7732
|
+
"content": {
|
|
7733
|
+
"application/json": {
|
|
7734
|
+
"schema": {
|
|
7735
|
+
"$ref": "#/components/schemas/Error"
|
|
7736
|
+
}
|
|
7737
|
+
}
|
|
7738
|
+
}
|
|
7739
|
+
},
|
|
7740
|
+
"409": {
|
|
7741
|
+
"description": "Agent App not installed on the org",
|
|
7742
|
+
"content": {
|
|
7743
|
+
"application/json": {
|
|
7744
|
+
"schema": {
|
|
7745
|
+
"$ref": "#/components/schemas/Error"
|
|
7746
|
+
}
|
|
7747
|
+
}
|
|
7748
|
+
}
|
|
7749
|
+
},
|
|
7750
|
+
"422": {
|
|
7751
|
+
"description": "Agent has no GH_APP_ID (its own GitHub App is not set up)",
|
|
7752
|
+
"content": {
|
|
7753
|
+
"application/json": {
|
|
7754
|
+
"schema": {
|
|
7755
|
+
"$ref": "#/components/schemas/Error"
|
|
7756
|
+
}
|
|
7757
|
+
}
|
|
7758
|
+
}
|
|
7759
|
+
},
|
|
7760
|
+
"502": {
|
|
7761
|
+
"description": "GitHub unavailable or refused",
|
|
7762
|
+
"content": {
|
|
7763
|
+
"application/json": {
|
|
7764
|
+
"schema": {
|
|
7765
|
+
"$ref": "#/components/schemas/Error"
|
|
7766
|
+
}
|
|
7767
|
+
}
|
|
7768
|
+
}
|
|
7769
|
+
},
|
|
7770
|
+
"503": {
|
|
7771
|
+
"description": "GitHub Apps are not configured",
|
|
7772
|
+
"content": {
|
|
7773
|
+
"application/json": {
|
|
7774
|
+
"schema": {
|
|
7775
|
+
"$ref": "#/components/schemas/Error"
|
|
7776
|
+
}
|
|
7777
|
+
}
|
|
7778
|
+
}
|
|
7779
|
+
}
|
|
7780
|
+
}
|
|
7781
|
+
}
|
|
7782
|
+
},
|
|
7286
7783
|
"/agents/{id}/config": {
|
|
7287
7784
|
"get": {
|
|
7288
7785
|
"tags": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@app-vitals/agent-admin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.33.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/app-vitals/agent.git",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@anthropic-ai/sdk": "0.135.0",
|
|
45
|
-
"@app-vitals/agent-lib": "1.
|
|
45
|
+
"@app-vitals/agent-lib": "1.33.0",
|
|
46
46
|
"@hono/zod-openapi": "^1.0.0",
|
|
47
47
|
"@prisma/adapter-pg": "^7.10.0",
|
|
48
48
|
"@prisma/client": "^7.10.0",
|
package/src/admin-boot.ts
CHANGED
|
@@ -106,8 +106,8 @@ import {
|
|
|
106
106
|
} from "./github-enterprise-api.ts";
|
|
107
107
|
import { GitHubEnterpriseAppService } from "./github-enterprise-apps.ts";
|
|
108
108
|
import {
|
|
109
|
+
createGithubInstallationRepos,
|
|
109
110
|
createGithubReconcile,
|
|
110
|
-
parseAgentAppId,
|
|
111
111
|
} from "./github-reconcile-wiring.ts";
|
|
112
112
|
import { HttpGoogleAuthClient } from "./google-auth-client.ts";
|
|
113
113
|
import { HttpChatClient } from "./http-chat-client.ts";
|
|
@@ -474,17 +474,27 @@ export async function startAdmin(
|
|
|
474
474
|
appService: githubEnterpriseAppService,
|
|
475
475
|
});
|
|
476
476
|
// GHE-3.9: the reconcile routes' service, with the extension's optional
|
|
477
|
-
// open-work port.
|
|
477
|
+
// open-work port. Each agent's App id is read from its own stored GH_APP_ID.
|
|
478
478
|
const githubReconcile = createGithubReconcile({
|
|
479
479
|
prisma,
|
|
480
480
|
appService: githubEnterpriseAppService,
|
|
481
481
|
access: githubAccessPreview,
|
|
482
|
-
|
|
482
|
+
agentEnv: agentEnvService,
|
|
483
483
|
openWork: resolvedExtensions.openWork,
|
|
484
484
|
});
|
|
485
|
+
const githubInstallationRepos = createGithubInstallationRepos({
|
|
486
|
+
prisma,
|
|
487
|
+
appService: githubEnterpriseAppService,
|
|
488
|
+
access: githubAccessPreview,
|
|
489
|
+
agentEnv: agentEnvService,
|
|
490
|
+
});
|
|
485
491
|
const adminApiApp = createAdminApp({
|
|
486
492
|
githubAccessPreview,
|
|
487
|
-
|
|
493
|
+
githubReconcile,
|
|
494
|
+
...(resolvedExtensions.openWork
|
|
495
|
+
? { openWork: resolvedExtensions.openWork }
|
|
496
|
+
: {}),
|
|
497
|
+
githubInstallationRepos,
|
|
488
498
|
agentService,
|
|
489
499
|
agentEnvService,
|
|
490
500
|
agentCronJobService,
|