@app-vitals/agent-admin 1.12.1 → 1.14.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.json +787 -0
- package/openapi.platform.json +787 -0
- package/package.json +2 -2
- package/src/admin-boot.ts +21 -1
- package/src/admin-spec.ts +19 -0
- package/src/fixtures/github-enterprise-cassette.json +675 -0
- package/src/github-app-api.ts +111 -0
- package/src/github-app-jwt.ts +44 -0
- package/src/github-app-jwt.unit.test.ts +95 -0
- package/src/github-enterprise-api.integration.test.ts +264 -0
- package/src/github-enterprise-api.smoke.test.ts +595 -0
- package/src/github-enterprise-api.ts +750 -0
- package/src/github-enterprise-client.integration.test.ts +318 -0
- package/src/github-enterprise-client.ts +384 -0
- package/src/github-enterprise-client.unit.test.ts +97 -0
- package/src/github-enterprise-isolation.unit.test.ts +84 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@app-vitals/agent-admin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.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.14.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
|
@@ -99,6 +99,8 @@ import { CronRunNowService } from "./cron-run-now.ts";
|
|
|
99
99
|
import { parseCronRunNowConfig } from "./cron-run-now-config.ts";
|
|
100
100
|
import { CronRunTranscriptService } from "./cron-run-transcripts.ts";
|
|
101
101
|
import { isDevAuthAllowed } from "./dev-auth-guard.ts";
|
|
102
|
+
import { createGithubEnterpriseApp } from "./github-enterprise-api.ts";
|
|
103
|
+
import { GitHubEnterpriseAppService } from "./github-enterprise-apps.ts";
|
|
102
104
|
import { HttpGithubAppProvisioningClient } from "./github-app-provisioning-client.ts";
|
|
103
105
|
import { HttpGoogleAuthClient } from "./google-auth-client.ts";
|
|
104
106
|
import { HttpChatClient } from "./http-chat-client.ts";
|
|
@@ -113,7 +115,7 @@ import { parseSelfServeConfig } from "./self-serve-config.ts";
|
|
|
113
115
|
import { HttpSlackProvisioningClient } from "./slack-provisioning-client.ts";
|
|
114
116
|
import { SpecialtyTypes } from "./specialty-types.ts";
|
|
115
117
|
import { runStartupPolicyReconcile } from "./startup-policy-reconcile.ts";
|
|
116
|
-
import { makeTokenCrypto } from "./token-crypto.ts";
|
|
118
|
+
import { makeStrictTokenCrypto, makeTokenCrypto } from "./token-crypto.ts";
|
|
117
119
|
import { parseTranscriptConfig } from "./transcript-config.ts";
|
|
118
120
|
import {
|
|
119
121
|
resolveTrialExpirySweepIntervalMs,
|
|
@@ -530,6 +532,24 @@ export async function startAdmin(
|
|
|
530
532
|
}),
|
|
531
533
|
);
|
|
532
534
|
|
|
535
|
+
// 3b'. GitHub Enterprise Apps API — /github-enterprise/* — admin-only,
|
|
536
|
+
// optional (GHE-1.3). With no rows configured it reports unconfigured
|
|
537
|
+
// and does nothing else. Strict crypto: no plain-text key storage.
|
|
538
|
+
root.route(
|
|
539
|
+
"/",
|
|
540
|
+
createGithubEnterpriseApp({
|
|
541
|
+
appService: new GitHubEnterpriseAppService(
|
|
542
|
+
prisma,
|
|
543
|
+
makeStrictTokenCrypto(),
|
|
544
|
+
),
|
|
545
|
+
agentService,
|
|
546
|
+
agentEnvService,
|
|
547
|
+
sessionSecret,
|
|
548
|
+
adminApiKeys,
|
|
549
|
+
agentTokenService,
|
|
550
|
+
}),
|
|
551
|
+
);
|
|
552
|
+
|
|
533
553
|
// 3c. Extension API routes — after every platform API, before the admin UI
|
|
534
554
|
// (same no-shadowing rule as the admin CRUD API above).
|
|
535
555
|
mountRouteContributions(root, resolvedExtensions.apiRoutes);
|
package/src/admin-spec.ts
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
parseAdminApiKeys,
|
|
25
25
|
} from "./agents-api.ts";
|
|
26
26
|
import { createAgentRuntimeApp } from "./api.ts";
|
|
27
|
+
import { createGithubEnterpriseApp } from "./github-enterprise-api.ts";
|
|
27
28
|
|
|
28
29
|
/** The admin OpenAPI document shape the spec builders and generators share. */
|
|
29
30
|
export interface AdminOpenApiDocument {
|
|
@@ -172,6 +173,23 @@ export function buildPlatformAdminSpec(): AdminOpenApiDocument {
|
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
175
|
|
|
176
|
+
// GHE-1.3: the /github-enterprise routes live in their own app (mounted at
|
|
177
|
+
// the root in admin-boot.ts); fold their paths and schemas in.
|
|
178
|
+
const gheSpec = createGithubEnterpriseApp({
|
|
179
|
+
appService: {} as never,
|
|
180
|
+
agentService: {} as never,
|
|
181
|
+
agentEnvService: {} as never,
|
|
182
|
+
sessionSecret: SESSION_SECRET,
|
|
183
|
+
adminApiKeys,
|
|
184
|
+
agentTokenService: { validate: async () => null },
|
|
185
|
+
}).getOpenAPI31Document({
|
|
186
|
+
openapi: "3.1.0",
|
|
187
|
+
info: { title: "github-enterprise (internal)", version: "0.1.0" },
|
|
188
|
+
});
|
|
189
|
+
for (const [path, def] of Object.entries(gheSpec.paths ?? {})) {
|
|
190
|
+
mergedPaths[path] = def as Record<string, unknown>;
|
|
191
|
+
}
|
|
192
|
+
|
|
175
193
|
return {
|
|
176
194
|
...adminSpec,
|
|
177
195
|
paths: mergedPaths,
|
|
@@ -180,6 +198,7 @@ export function buildPlatformAdminSpec(): AdminOpenApiDocument {
|
|
|
180
198
|
schemas: {
|
|
181
199
|
...(adminSpec.components?.schemas ?? {}),
|
|
182
200
|
...(runtimeSpec.components?.schemas ?? {}),
|
|
201
|
+
...(gheSpec.components?.schemas ?? {}),
|
|
183
202
|
},
|
|
184
203
|
},
|
|
185
204
|
};
|