@app-vitals/agent-admin 1.28.0 → 1.30.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.
@@ -6900,3 +6900,281 @@ describe("admin API — GET /agents/:id/github-access (GHE-2.4)", () => {
6900
6900
  );
6901
6901
  });
6902
6902
  });
6903
+
6904
+ // ─── GHE-3.4: POST /agents/:id/github-reconcile/{plan,apply} ─────────────────
6905
+
6906
+ describe("admin API — GitHub reconcile routes (GHE-3.4)", () => {
6907
+ const OPS = "ghr-ops-token";
6908
+ const READER = "ghr-read-token";
6909
+ const AGENT_KEY = "ghr-agent-token";
6910
+ const DIFF = {
6911
+ installationAdds: ["acme/api"],
6912
+ installationRemoves: [],
6913
+ configAdds: ["acme/api"],
6914
+ configRemoves: ["acme/old"],
6915
+ };
6916
+ const PLAN = {
6917
+ skipped: false,
6918
+ diff: DIFF,
6919
+ skippedOrgs: [],
6920
+ rejectedAdds: [],
6921
+ warnings: ["heads up"],
6922
+ empty: false,
6923
+ planHash: "hash-1",
6924
+ };
6925
+ const SKIPPED_PLAN = {
6926
+ ...PLAN,
6927
+ skipped: true,
6928
+ skipReason: "agent has no bound GitHub username",
6929
+ diff: {
6930
+ installationAdds: [],
6931
+ installationRemoves: [],
6932
+ configAdds: [],
6933
+ configRemoves: [],
6934
+ },
6935
+ warnings: [],
6936
+ empty: true,
6937
+ planHash: "hash-skip",
6938
+ };
6939
+ type Reconcile = NonNullable<AdminDeps["githubReconcile"]>;
6940
+
6941
+ function setup(reconcile?: Partial<Reconcile>) {
6942
+ const base = makeMockDeps();
6943
+ const calls: { fn: string; args: unknown[] }[] = [];
6944
+ const port: Reconcile = {
6945
+ planWithOpenWork: async (...args) => {
6946
+ calls.push({ fn: "plan", args });
6947
+ return {
6948
+ plan: PLAN,
6949
+ openWork: [{ id: "T-1", repo: "acme/old", title: "fix it" }],
6950
+ };
6951
+ },
6952
+ apply: async (input) => {
6953
+ calls.push({ fn: "apply", args: [input] });
6954
+ return {
6955
+ status: "applied",
6956
+ plan: PLAN,
6957
+ auditId: "audit-1",
6958
+ warnings: [],
6959
+ };
6960
+ },
6961
+ ...reconcile,
6962
+ };
6963
+ const deps: AdminDeps = {
6964
+ ...base,
6965
+ adminApiKeys: parseAdminApiKeys(
6966
+ `root:${ADMIN_API_KEY}:*,operator:${OPS}:platform.ops,reader:${READER}:platform.read`,
6967
+ ),
6968
+ agentTokenService: {
6969
+ ...base.agentTokenService,
6970
+ validate: async (t: string) =>
6971
+ t === AGENT_KEY ? { agentId: AGENT_ID } : null,
6972
+ },
6973
+ githubReconcile: reconcile === undefined ? undefined : port,
6974
+ };
6975
+ return { app: createAdminApp(deps), calls, port };
6976
+ }
6977
+ const withPort = () => setup({});
6978
+
6979
+ const post = (
6980
+ app: ReturnType<typeof createAdminApp>,
6981
+ action: "plan" | "apply",
6982
+ headers: Record<string, string>,
6983
+ body: unknown = {},
6984
+ id = AGENT_ID,
6985
+ ) =>
6986
+ app.request(`/agents/${id}/github-reconcile/${action}`, {
6987
+ method: "POST",
6988
+ headers: { "Content-Type": "application/json", ...headers },
6989
+ body: JSON.stringify(body),
6990
+ });
6991
+ const asAdmin = { Authorization: `Bearer ${ADMIN_API_KEY}` };
6992
+
6993
+ it("403 for a session member, ops key, read key and agent key", async () => {
6994
+ const { app, calls } = withPort();
6995
+ const memberApp = createAdminApp({
6996
+ ...makeMockDeps(),
6997
+ callerScopeResolver: async () => ({
6998
+ kind: "scoped",
6999
+ accountId: "acct-a",
7000
+ agentIds: [AGENT_ID],
7001
+ }),
7002
+ });
7003
+ const cookie = await sign(
7004
+ {
7005
+ isAdmin: false,
7006
+ userId: "user-acct",
7007
+ email: "owner@acct-a.example.com",
7008
+ iat: Math.floor(Date.now() / 1000),
7009
+ exp: Math.floor(Date.now() / 1000) + 3600,
7010
+ },
7011
+ SESSION_SECRET,
7012
+ "HS256",
7013
+ );
7014
+ for (const action of ["plan", "apply"] as const) {
7015
+ const res = await post(
7016
+ memberApp,
7017
+ action,
7018
+ { Cookie: `admin_session=${cookie}` },
7019
+ { planHash: "x" },
7020
+ );
7021
+ expect(res.status).toBe(403);
7022
+ for (const key of [OPS, READER, AGENT_KEY]) {
7023
+ const r = await post(
7024
+ app,
7025
+ action,
7026
+ { Authorization: `Bearer ${key}` },
7027
+ { planHash: "x" },
7028
+ );
7029
+ expect(r.status).toBe(403);
7030
+ }
7031
+ }
7032
+ expect(calls).toEqual([]);
7033
+ });
7034
+
7035
+ it("plan returns the diff, warnings, hash and affected open work", async () => {
7036
+ const { app, calls } = withPort();
7037
+ const res = await post(app, "plan", asAdmin, { addRepos: ["acme/api"] });
7038
+ expect(res.status).toBe(200);
7039
+ const body = (await res.json()) as Record<string, unknown>;
7040
+ expect(body).toMatchObject({
7041
+ status: "planned",
7042
+ planHash: "hash-1",
7043
+ warnings: ["heads up"],
7044
+ diff: DIFF,
7045
+ empty: false,
7046
+ affectedOpenWork: [{ id: "T-1", repo: "acme/old", title: "fix it" }],
7047
+ });
7048
+ expect(calls).toEqual([{ fn: "plan", args: [AGENT_ID, ["acme/api"]] }]);
7049
+ });
7050
+
7051
+ it("plan with no body works", async () => {
7052
+ const { app } = withPort();
7053
+ const res = await app.request(`/agents/${AGENT_ID}/github-reconcile/plan`, {
7054
+ method: "POST",
7055
+ headers: asAdmin,
7056
+ });
7057
+ expect(res.status).toBe(200);
7058
+ });
7059
+
7060
+ it("plan on a skipped state is 200 with status skipped and a reason", async () => {
7061
+ const { app } = setup({
7062
+ planWithOpenWork: async () => ({ plan: SKIPPED_PLAN, openWork: [] }),
7063
+ });
7064
+ const res = await post(app, "plan", asAdmin);
7065
+ expect(res.status).toBe(200);
7066
+ expect(await res.json()).toMatchObject({
7067
+ status: "skipped",
7068
+ reason: "agent has no bound GitHub username",
7069
+ });
7070
+ });
7071
+
7072
+ it("with no reconcile port wired, plan and apply are skipped, not errors", async () => {
7073
+ const { app } = setup();
7074
+ for (const action of ["plan", "apply"] as const) {
7075
+ const res = await post(app, action, asAdmin, { planHash: "x" });
7076
+ expect(res.status).toBe(200);
7077
+ const body = (await res.json()) as { status: string; reason: string };
7078
+ expect(body.status).toBe("skipped");
7079
+ expect(body.reason).toContain("not configured");
7080
+ }
7081
+ });
7082
+
7083
+ it("404 for an unknown agent", async () => {
7084
+ const { app } = setup({
7085
+ planWithOpenWork: async () => {
7086
+ throw new Error("agent no-such-agent not found");
7087
+ },
7088
+ apply: async () => ({ status: "agent_not_found" }),
7089
+ });
7090
+ expect((await post(app, "plan", asAdmin, {}, "no-such-agent")).status).toBe(
7091
+ 404,
7092
+ );
7093
+ expect(
7094
+ (await post(app, "apply", asAdmin, { planHash: "x" }, "no-such-agent"))
7095
+ .status,
7096
+ ).toBe(404);
7097
+ });
7098
+
7099
+ it("apply returns the audit id and result and passes the caller", async () => {
7100
+ const { app, calls } = withPort();
7101
+ const res = await post(app, "apply", asAdmin, {
7102
+ planHash: "hash-1",
7103
+ addRepos: ["acme/api"],
7104
+ confirmRemovals: true,
7105
+ });
7106
+ expect(res.status).toBe(200);
7107
+ expect(await res.json()).toMatchObject({
7108
+ status: "applied",
7109
+ auditId: "audit-1",
7110
+ planHash: "hash-1",
7111
+ diff: DIFF,
7112
+ warnings: [],
7113
+ });
7114
+ const input = calls[0]?.args[0] as Record<string, unknown>;
7115
+ expect(input).toMatchObject({
7116
+ agentId: AGENT_ID,
7117
+ planHash: "hash-1",
7118
+ namedAdds: ["acme/api"],
7119
+ confirmRemovals: true,
7120
+ });
7121
+ expect(typeof input.caller).toBe("string");
7122
+ });
7123
+
7124
+ it("apply on a skipped or noop plan is 200 with that status", async () => {
7125
+ const skipped = setup({
7126
+ apply: async () => ({ status: "skipped", plan: SKIPPED_PLAN }),
7127
+ });
7128
+ const r1 = await post(skipped.app, "apply", asAdmin, { planHash: "x" });
7129
+ expect(r1.status).toBe(200);
7130
+ expect(await r1.json()).toMatchObject({
7131
+ status: "skipped",
7132
+ reason: "agent has no bound GitHub username",
7133
+ });
7134
+ const noop = setup({
7135
+ apply: async () => ({ status: "noop", plan: { ...PLAN, empty: true } }),
7136
+ });
7137
+ const r2 = await post(noop.app, "apply", asAdmin, { planHash: "x" });
7138
+ expect(r2.status).toBe(200);
7139
+ expect(((await r2.json()) as { status: string }).status).toBe("noop");
7140
+ });
7141
+
7142
+ it("apply 409 on a stale plan hash, 422 over the removal cap", async () => {
7143
+ const stale = setup({
7144
+ apply: async () => ({ status: "stale_plan", plan: PLAN }),
7145
+ });
7146
+ expect(
7147
+ (await post(stale.app, "apply", asAdmin, { planHash: "old" })).status,
7148
+ ).toBe(409);
7149
+ const cap = setup({
7150
+ apply: async () => ({ status: "removal_cap", plan: PLAN, removals: 11 }),
7151
+ });
7152
+ const res = await post(cap.app, "apply", asAdmin, { planHash: "hash-1" });
7153
+ expect(res.status).toBe(422);
7154
+ expect(((await res.json()) as { error: string }).error).toContain(
7155
+ "confirmRemovals",
7156
+ );
7157
+ });
7158
+
7159
+ it("apply failure is reported with the audit id", async () => {
7160
+ const { app } = setup({
7161
+ apply: async () => ({
7162
+ status: "failed",
7163
+ plan: PLAN,
7164
+ auditId: "audit-2",
7165
+ error: "boom",
7166
+ }),
7167
+ });
7168
+ const res = await post(app, "apply", asAdmin, { planHash: "hash-1" });
7169
+ expect(res.status).toBe(200);
7170
+ expect(await res.json()).toMatchObject({
7171
+ status: "failed",
7172
+ auditId: "audit-2",
7173
+ });
7174
+ });
7175
+
7176
+ it("400 when apply has no planHash", async () => {
7177
+ const { app } = withPort();
7178
+ expect((await post(app, "apply", asAdmin, {})).status).toBe(400);
7179
+ });
7180
+ });
package/src/agents-api.ts CHANGED
@@ -164,6 +164,7 @@ import {
164
164
  UpsertAgentMarketplaceBodySchema,
165
165
  UpsertChatTokenDailyBodySchema,
166
166
  } from "./openapi-schemas.ts";
167
+ import type { ReconcileApplyService } from "./reconcile-apply-service.ts";
167
168
  import type { SelfServeConfig } from "./self-serve-config.ts";
168
169
  import type { SpecialtyDefaultsResolver } from "./specialty-defaults.ts";
169
170
  import type { SpecialtyTypeResolver } from "./specialty-types.ts";
@@ -261,6 +262,12 @@ export interface AdminDeps {
261
262
  * means the enterprise Apps are not wired, reported as `unconfigured`.
262
263
  */
263
264
  githubAccessPreview?: GithubAccessPreviewFn;
265
+ /**
266
+ * GHE-3.4: backs POST /agents/:id/github-reconcile/{plan,apply}. Optional
267
+ * (additive); absent means the enterprise Apps are not wired, reported as
268
+ * `skipped`.
269
+ */
270
+ githubReconcile?: Pick<ReconcileApplyService, "planWithOpenWork" | "apply">;
264
271
  /**
265
272
  * Retained solely as a pass-through to deleteAgentFully() (DELETE /agents/:id),
266
273
  * which has its own internal prisma.agent/prisma.agentEnv access — out of
@@ -591,6 +598,87 @@ const GithubAccessPreviewSchema = z
591
598
  })
592
599
  .openapi("GithubAccessPreview");
593
600
 
601
+ const GITHUB_RECONCILE_UNCONFIGURED = "GitHub Apps are not configured";
602
+
603
+ const RepoFullNameSchema = z
604
+ .string()
605
+ .regex(/^[^/\s]+\/[^/\s]+$/, "must be owner/repo");
606
+
607
+ const GithubReconcilePlanBodySchema = z
608
+ .object({
609
+ addRepos: z.array(RepoFullNameSchema).optional().openapi({
610
+ description:
611
+ "Repos (owner/repo) to explicitly add to the agent's config and installation.",
612
+ }),
613
+ })
614
+ .openapi("GithubReconcilePlanBody");
615
+
616
+ const GithubReconcileApplyBodySchema = z
617
+ .object({
618
+ planHash: z.string().min(1).openapi({
619
+ description: "planHash of the plan the admin reviewed.",
620
+ }),
621
+ addRepos: z.array(RepoFullNameSchema).optional().openapi({
622
+ description: "Must match the addRepos used when the plan was made.",
623
+ }),
624
+ confirmRemovals: z.boolean().optional().openapi({
625
+ description: "Required when the plan removes more than 10 repos.",
626
+ }),
627
+ })
628
+ .openapi("GithubReconcileApplyBody");
629
+
630
+ const GithubReconcileDiffSchema = z.object({
631
+ installationAdds: z.array(z.string()),
632
+ installationRemoves: z.array(z.string()),
633
+ configAdds: z.array(z.string()),
634
+ configRemoves: z.array(z.string()),
635
+ });
636
+
637
+ const GithubReconcilePlanResultSchema = z
638
+ .object({
639
+ status: z.enum(["planned", "skipped"]).openapi({
640
+ description:
641
+ "`skipped` (not an error) when no GitHub username is bound or the Apps are not configured; `reason` says why.",
642
+ }),
643
+ reason: z.string().optional(),
644
+ planHash: z.string().optional(),
645
+ empty: z.boolean().optional(),
646
+ diff: GithubReconcileDiffSchema.optional(),
647
+ skippedOrgs: z
648
+ .array(z.object({ org: z.string(), reason: z.string() }))
649
+ .optional(),
650
+ rejectedAdds: z
651
+ .array(z.object({ repo: z.string(), reason: z.string() }))
652
+ .optional(),
653
+ warnings: z.array(z.string()).optional(),
654
+ affectedOpenWork: z
655
+ .array(
656
+ z.object({
657
+ id: z.string(),
658
+ repo: z.string(),
659
+ title: z.string().optional(),
660
+ }),
661
+ )
662
+ .optional()
663
+ .openapi({
664
+ description:
665
+ "Open work the removals would block; empty when no open-work port is wired.",
666
+ }),
667
+ })
668
+ .openapi("GithubReconcilePlanResult");
669
+
670
+ const GithubReconcileApplyResultSchema = z
671
+ .object({
672
+ status: z.enum(["applied", "failed", "noop", "skipped"]),
673
+ reason: z.string().optional(),
674
+ auditId: z.string().optional(),
675
+ planHash: z.string().optional(),
676
+ diff: GithubReconcileDiffSchema.optional(),
677
+ warnings: z.array(z.string()).optional(),
678
+ error: z.string().optional(),
679
+ })
680
+ .openapi("GithubReconcileApplyResult");
681
+
594
682
  // ─── Route definitions ──────────────────────────────────────────────────────────
595
683
 
596
684
  const reconcileAgentsRoute = createRoute({
@@ -1484,6 +1572,64 @@ const getGithubAccessRoute = createRoute({
1484
1572
  },
1485
1573
  });
1486
1574
 
1575
+ const githubReconcilePlanRoute = createRoute({
1576
+ method: "post",
1577
+ path: "/agents/{id}/github-reconcile/plan",
1578
+ summary: "Plan a GitHub repo reconcile for the agent",
1579
+ description:
1580
+ "Platform-admin only (session members, ops keys and agent keys get 403). Read-only: nothing is persisted or changed. Returns the diff, warnings, `planHash` and the open work the removals would affect. 200 with `status: skipped` and a `reason` when no githubUsername is bound or the enterprise Apps are not configured. 404 for an unknown agent.",
1581
+ request: {
1582
+ params: AgentIdParamSchema,
1583
+ body: {
1584
+ required: false,
1585
+ content: {
1586
+ "application/json": { schema: GithubReconcilePlanBodySchema },
1587
+ },
1588
+ },
1589
+ },
1590
+ responses: {
1591
+ 200: {
1592
+ description: "Reconcile plan",
1593
+ content: {
1594
+ "application/json": { schema: GithubReconcilePlanResultSchema },
1595
+ },
1596
+ },
1597
+ 401: { description: "Unauthorized", ...jsonError },
1598
+ 403: { description: "Platform admin required", ...jsonError },
1599
+ 404: { description: "Agent not found", ...jsonError },
1600
+ },
1601
+ });
1602
+
1603
+ const githubReconcileApplyRoute = createRoute({
1604
+ method: "post",
1605
+ path: "/agents/{id}/github-reconcile/apply",
1606
+ summary: "Apply a reviewed GitHub repo reconcile plan",
1607
+ description:
1608
+ "Platform-admin only (session members, ops keys and agent keys get 403). Re-plans server-side and applies only when the fresh plan still matches `planHash` (409 otherwise). More than 10 removals need `confirmRemovals: true` (422 otherwise). Returns the audit id and result. 200 with `status: skipped` (unbound user or unconfigured Apps) or `status: noop` (nothing to change) is not an error. Open work on removed repos is blocked through the optional open-work port; a failure there is a warning.",
1609
+ request: {
1610
+ params: AgentIdParamSchema,
1611
+ body: {
1612
+ required: true,
1613
+ content: {
1614
+ "application/json": { schema: GithubReconcileApplyBodySchema },
1615
+ },
1616
+ },
1617
+ },
1618
+ responses: {
1619
+ 200: {
1620
+ description: "Apply result",
1621
+ content: {
1622
+ "application/json": { schema: GithubReconcileApplyResultSchema },
1623
+ },
1624
+ },
1625
+ 401: { description: "Unauthorized", ...jsonError },
1626
+ 403: { description: "Platform admin required", ...jsonError },
1627
+ 404: { description: "Agent not found", ...jsonError },
1628
+ 409: { description: "Plan hash is stale; re-plan", ...jsonError },
1629
+ 422: { description: "Removal cap needs confirmRemovals", ...jsonError },
1630
+ },
1631
+ });
1632
+
1487
1633
  /** `from`/`to` ISO datetime bounds shared by the cron-run report routes. */
1488
1634
  export const cronRunStatsQuerySchema = z
1489
1635
  .object({
@@ -2937,6 +3083,130 @@ export function createAdminApp(deps: AdminDeps): OpenAPIHono<AdminAuthEnv> {
2937
3083
  return c.json(preview, 200);
2938
3084
  });
2939
3085
 
3086
+ // POST /agents/:id/github-reconcile/{plan,apply} — GHE-3.4. Platform admin
3087
+ // only. Responses carry repo names and ids, never tokens; logs carry ids only.
3088
+ app.openapi(githubReconcilePlanRoute, async (c) => {
3089
+ if (c.get("isAdmin") !== true) {
3090
+ throw new ForbiddenError(
3091
+ "Admin access required to plan a GitHub reconcile",
3092
+ );
3093
+ }
3094
+ const { id: agentId } = c.req.valid("param");
3095
+ const body = c.req.valid("json");
3096
+ const reconcile = deps.githubReconcile;
3097
+ if (!reconcile) {
3098
+ return c.json(
3099
+ { status: "skipped" as const, reason: GITHUB_RECONCILE_UNCONFIGURED },
3100
+ 200,
3101
+ );
3102
+ }
3103
+ let result: Awaited<ReturnType<typeof reconcile.planWithOpenWork>>;
3104
+ try {
3105
+ result = await reconcile.planWithOpenWork(agentId, body?.addRepos);
3106
+ } catch (err) {
3107
+ if (
3108
+ err instanceof Error &&
3109
+ err.message === `agent ${agentId} not found`
3110
+ ) {
3111
+ throw new NotFoundError(`agent ${agentId} not found`);
3112
+ }
3113
+ throw err;
3114
+ }
3115
+ const { plan, openWork } = result;
3116
+ if (plan.skipped) {
3117
+ return c.json(
3118
+ {
3119
+ status: "skipped" as const,
3120
+ reason: plan.skipReason ?? "reconcile skipped",
3121
+ },
3122
+ 200,
3123
+ );
3124
+ }
3125
+ return c.json(
3126
+ {
3127
+ status: "planned" as const,
3128
+ planHash: plan.planHash,
3129
+ empty: plan.empty,
3130
+ diff: plan.diff,
3131
+ skippedOrgs: plan.skippedOrgs,
3132
+ rejectedAdds: plan.rejectedAdds,
3133
+ warnings: plan.warnings,
3134
+ affectedOpenWork: openWork,
3135
+ },
3136
+ 200,
3137
+ );
3138
+ });
3139
+
3140
+ app.openapi(githubReconcileApplyRoute, async (c) => {
3141
+ if (c.get("isAdmin") !== true) {
3142
+ throw new ForbiddenError(
3143
+ "Admin access required to apply a GitHub reconcile",
3144
+ );
3145
+ }
3146
+ const { id: agentId } = c.req.valid("param");
3147
+ const body = c.req.valid("json");
3148
+ const reconcile = deps.githubReconcile;
3149
+ if (!reconcile) {
3150
+ return c.json(
3151
+ { status: "skipped" as const, reason: GITHUB_RECONCILE_UNCONFIGURED },
3152
+ 200,
3153
+ );
3154
+ }
3155
+ const caller = c.get("caller")?.name ?? "anonymous";
3156
+ const result = await reconcile.apply({
3157
+ agentId,
3158
+ caller,
3159
+ planHash: body.planHash,
3160
+ namedAdds: body.addRepos,
3161
+ confirmRemovals: body.confirmRemovals,
3162
+ });
3163
+ switch (result.status) {
3164
+ case "agent_not_found":
3165
+ throw new NotFoundError(`agent ${agentId} not found`);
3166
+ case "stale_plan":
3167
+ throw new ConflictError(
3168
+ "the plan changed since it was reviewed; re-run plan and review it again",
3169
+ );
3170
+ case "removal_cap":
3171
+ throw new UnprocessableEntityError(
3172
+ `plan removes ${result.removals} repos; resend with confirmRemovals: true to apply`,
3173
+ );
3174
+ case "skipped":
3175
+ return c.json(
3176
+ {
3177
+ status: "skipped" as const,
3178
+ reason: result.plan.skipReason ?? "reconcile skipped",
3179
+ },
3180
+ 200,
3181
+ );
3182
+ case "noop":
3183
+ return c.json(
3184
+ {
3185
+ status: "noop" as const,
3186
+ planHash: result.plan.planHash,
3187
+ diff: result.plan.diff,
3188
+ },
3189
+ 200,
3190
+ );
3191
+ case "applied":
3192
+ case "failed":
3193
+ console.log(
3194
+ `[agents-api] github reconcile ${result.status}: agent=${agentId} audit=${result.auditId} caller=${caller}`,
3195
+ );
3196
+ return c.json(
3197
+ {
3198
+ status: result.status,
3199
+ auditId: result.auditId,
3200
+ planHash: result.plan.planHash,
3201
+ diff: result.plan.diff,
3202
+ warnings: result.status === "applied" ? result.warnings : [],
3203
+ ...(result.status === "failed" ? { error: result.error } : {}),
3204
+ },
3205
+ 200,
3206
+ );
3207
+ }
3208
+ });
3209
+
2940
3210
  // GET /agents/:id/github-installations — latest snapshot, 404 if none yet
2941
3211
  app.openapi(getGitHubInstallationsRoute, async (c) => {
2942
3212
  const { id: agentId } = c.req.valid("param");
@@ -335,6 +335,7 @@ function makeBaseDeps(overrides?: Partial<AdminUIDeps>): AdminUIDeps {
335
335
  add: async () => {
336
336
  throw new Error("not implemented");
337
337
  },
338
+ remove: async () => {},
338
339
  },
339
340
  agentMemberService: {
340
341
  listByEmail: async () => [],