@app-vitals/agent-admin 1.94.0 → 1.95.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@app-vitals/agent-admin",
3
- "version": "1.94.0",
3
+ "version": "1.95.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.94.0",
47
+ "@app-vitals/agent-lib": "1.95.0",
48
48
  "@hono/zod-openapi": "^1.0.0",
49
49
  "@prisma/adapter-pg": "^7.10.0",
50
50
  "@prisma/client": "^7.10.0",
@@ -102,6 +102,7 @@ describe("admin UI — connect-github callback auto-install (SWI-16.1)", () => {
102
102
  expect(res.status).toBe(200);
103
103
  const html = await res.text();
104
104
  expect(html).toContain("GitHub App installed!");
105
+ expect(html).toContain(`href="/admin/agents/${AGENT_ID}/setup"`);
105
106
  expect(html).not.toContain("installations/new");
106
107
  expect(installCalls).toEqual([
107
108
  {
@@ -2534,8 +2534,13 @@ export function renderGithubAppInstalledPage(
2534
2534
  alreadyStored?: boolean;
2535
2535
  /** Enterprise auto-install: App was already installed on the org (created:false). */
2536
2536
  orgAlreadyInstalled?: boolean;
2537
+ /** When set, the success path links back to the agent's setup page. */
2538
+ agentId?: string;
2537
2539
  },
2538
2540
  ): string {
2541
+ const successLink = opts.agentId
2542
+ ? `<a href="/admin/agents/${escapeHtml(opts.agentId)}/setup" class="btn btn-primary">Continue to setup →</a>`
2543
+ : `<a href="/admin/provision" class="btn btn-secondary">Back to Provisioning</a>`;
2539
2544
  const bodyHtml = opts.success
2540
2545
  ? `<div class="alert alert-success">
2541
2546
  ${
@@ -2546,7 +2551,7 @@ export function renderGithubAppInstalledPage(
2546
2551
  : "<strong>GitHub App installed!</strong> — installation ID stored."
2547
2552
  }
2548
2553
  </div>
2549
- <a href="/admin/provision" class="btn btn-secondary">Back to Provisioning</a>`
2554
+ ${successLink}`
2550
2555
  : `<div class="alert alert-error">${escapeHtml(opts.error ?? "GitHub App installation failed.")}</div>
2551
2556
  <a href="/admin/provision" class="btn btn-secondary">Try again</a>`;
2552
2557
 
@@ -4689,4 +4689,22 @@ describe("GitHub App install pages (SWI-16.1)", () => {
4689
4689
  }),
4690
4690
  ).toContain("already installed");
4691
4691
  });
4692
+
4693
+ test("installed page links to setup on success only when agentId given", () => {
4694
+ const ok = renderGithubAppInstalledPage(USER_NAME, {
4695
+ success: true,
4696
+ agentId: "a<1>",
4697
+ });
4698
+ expect(ok).toContain('href="/admin/agents/a&lt;1&gt;/setup"');
4699
+ expect(
4700
+ renderGithubAppInstalledPage(USER_NAME, { success: true }),
4701
+ ).toContain("Back to Provisioning");
4702
+ expect(
4703
+ renderGithubAppInstalledPage(USER_NAME, {
4704
+ success: false,
4705
+ error: "x",
4706
+ agentId: "a1",
4707
+ }),
4708
+ ).not.toContain("/setup");
4709
+ });
4692
4710
  });
@@ -5422,6 +5422,7 @@ describe("admin UI — GET /admin/agents/:id/connect-github/installed", () => {
5422
5422
  expect(res.status).toBe(200);
5423
5423
  const html = await res.text();
5424
5424
  expect(html).toContain("alert-success");
5425
+ expect(html).toContain(`href="/admin/agents/${AGENT_ID}/setup"`);
5425
5426
  expect(
5426
5427
  patchCalls.some(
5427
5428
  (c) =>
package/src/admin-ui.ts CHANGED
@@ -4172,6 +4172,7 @@ export function createAdminUIApp(deps: AdminUIDeps): Hono<AdminUIEnv> {
4172
4172
  renderGithubAppInstalledPage(userEmail, {
4173
4173
  success: true,
4174
4174
  orgAlreadyInstalled: !created,
4175
+ agentId,
4175
4176
  }),
4176
4177
  );
4177
4178
  }
@@ -4236,6 +4237,7 @@ export function createAdminUIApp(deps: AdminUIDeps): Hono<AdminUIEnv> {
4236
4237
  renderGithubAppInstalledPage(userEmail, {
4237
4238
  success: true,
4238
4239
  alreadyStored: result.alreadyStored,
4240
+ agentId,
4239
4241
  }),
4240
4242
  );
4241
4243
  },