@app-vitals/agent-admin 1.134.0 → 1.135.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.134.0",
3
+ "version": "1.135.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/app-vitals/agent.git",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "@anthropic-ai/sdk": "0.137.0",
48
- "@app-vitals/agent-lib": "1.134.0",
48
+ "@app-vitals/agent-lib": "1.135.0",
49
49
  "@hono/zod-openapi": "^1.0.0",
50
50
  "@prisma/adapter-pg": "^7.10.0",
51
51
  "@prisma/client": "^7.10.0",
@@ -0,0 +1,12 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import { renderUncoveredBadge } from "./admin-ui-installation-repos-pages.ts";
3
+ import { managedByBadge } from "./admin-ui-templates-pages.ts";
4
+
5
+ describe("removed badge titles", () => {
6
+ test("uncovered badge has no title", () => {
7
+ expect(renderUncoveredBadge()).not.toContain("title=");
8
+ });
9
+ test("helm badge has no title", () => {
10
+ expect(managedByBadge({ managedBy: "helm" })).not.toContain("title=");
11
+ });
12
+ });
@@ -81,9 +81,7 @@ function page(
81
81
  describe("agent detail — identity card (GHE-2.5)", () => {
82
82
  test("card is retitled Owner & identities", () => {
83
83
  const html = page(true, false);
84
- expect(html).toContain(
85
- '<div class="card-title">Owner &amp; identities</div>',
86
- );
84
+ expect(html).toContain('<div class="card-title">Owner &amp; identities');
87
85
  expect(html).not.toContain("Owner &amp; Anthropic identity");
88
86
  });
89
87
 
@@ -51,6 +51,91 @@ export const HELP_CATALOGUE = {
51
51
  "The numeric ID of one installation of the App on an organization or account. It appears in the installation settings URL.",
52
52
  anchor: "github-installation-id",
53
53
  },
54
+ "cron-system-vs-custom": {
55
+ summary:
56
+ "System crons are created and kept in sync by the platform; they cannot be edited or deleted here. Custom crons are yours to add, edit and remove.",
57
+ anchor: "cron-system-vs-custom",
58
+ },
59
+ "cron-schedule": {
60
+ summary:
61
+ "When the cron fires, as a five-field cron expression: minute, hour, day of month, month, day of week. Example: 0 * * * * runs every hour.",
62
+ anchor: "cron-schedule",
63
+ },
64
+ "cron-precheck": {
65
+ summary:
66
+ "An optional script that runs before the prompt. Its output becomes the prompt; if it has nothing to report, the run is skipped.",
67
+ anchor: "cron-precheck",
68
+ },
69
+ "cron-target": {
70
+ summary:
71
+ "The Slack channel the cron posts its result to. Empty means the cron does not post to a channel.",
72
+ anchor: "cron-target",
73
+ },
74
+ "template-following-detached": {
75
+ summary:
76
+ "Following: template changes reach this agent. Detached: they no longer do, and your own rows are kept. Reattaching reconciles the agent against the template.",
77
+ anchor: "template-following-detached",
78
+ },
79
+ "template-row-source": {
80
+ summary:
81
+ "template: inherited from the agent template. custom: set on this agent and overrides the template. disabled: removed from this agent and not re-added by the template. from image: baked into the agent image; only an image update changes it.",
82
+ anchor: "template-row-source",
83
+ },
84
+ "agent-policy": {
85
+ summary:
86
+ "Per-agent rules for how reviews are posted, whether the agent may review its own pull requests, and how long finished work is kept.",
87
+ anchor: "agent-policy",
88
+ },
89
+ "task-store-tokens": {
90
+ summary:
91
+ "Bearer tokens the agent uses to call the task store. The kind sets what the token may do. A token is shown once when created.",
92
+ anchor: "task-store-tokens",
93
+ },
94
+ "owner-identities": {
95
+ summary:
96
+ "Read-only trace from this agent to its owner and to the identities it uses with Anthropic and GitHub. Blank means not set up.",
97
+ anchor: "owner-identities",
98
+ },
99
+ "tools-pattern": {
100
+ summary:
101
+ "A permission rule for a tool the agent may run without asking, such as Bash(git:*). The part in brackets narrows what is allowed.",
102
+ anchor: "tools-pattern",
103
+ },
104
+ plugins: {
105
+ summary:
106
+ "Plugins add commands, skills and agents. Write plugin@marketplace; a bare name is read from the shipwright marketplace.",
107
+ anchor: "plugins",
108
+ },
109
+ "marketplace-ref": {
110
+ summary:
111
+ "The branch, tag or commit of the marketplace to install from. Blank uses the repository's default branch.",
112
+ anchor: "marketplace-ref",
113
+ },
114
+ "marketplace-origin": {
115
+ summary:
116
+ "remote: added to this agent and editable here. from image: baked into the agent image; only an image update changes it. disabled: removed from this agent and not re-added by the template.",
117
+ anchor: "marketplace-origin",
118
+ },
119
+ "sync-manifest": {
120
+ summary:
121
+ "A manifest describing which GitHub installations and repositories to sync for this agent. Paste a token to run the sync.",
122
+ anchor: "sync-manifest",
123
+ },
124
+ "repo-user-push": {
125
+ summary:
126
+ "user can push / user cannot push: whether the GitHub user bound to this agent can push to the repo.",
127
+ anchor: "repo-user-push",
128
+ },
129
+ "repo-uncovered": {
130
+ summary:
131
+ "not on installation: the agent's GitHub App installation does not cover this repo. Nothing is changed automatically.",
132
+ anchor: "repo-uncovered",
133
+ },
134
+ "template-managed-by": {
135
+ summary:
136
+ "from Helm values: an item with this badge is set by admin.templateSeed in the Helm values, and edits to it are overwritten on the next admin restart. Items without the badge are not affected.",
137
+ anchor: "template-managed-by",
138
+ },
54
139
  } as const satisfies Record<string, HelpEntry>;
55
140
 
56
141
  export type HelpId = keyof typeof HELP_CATALOGUE;
@@ -10,10 +10,27 @@ import { ADMIN_DOCS_BASE_URL } from "./admin-ui-info-tip.ts";
10
10
  const ids = Object.keys(HELP_CATALOGUE);
11
11
 
12
12
  describe("help catalogue", () => {
13
- test("has the seven expected ids", () => {
13
+ test("has the expected ids", () => {
14
14
  expect(ids.sort()).toEqual(
15
15
  [
16
16
  "github-app-id",
17
+ "cron-system-vs-custom",
18
+ "cron-schedule",
19
+ "cron-precheck",
20
+ "cron-target",
21
+ "template-following-detached",
22
+ "template-row-source",
23
+ "agent-policy",
24
+ "task-store-tokens",
25
+ "owner-identities",
26
+ "tools-pattern",
27
+ "plugins",
28
+ "marketplace-ref",
29
+ "marketplace-origin",
30
+ "sync-manifest",
31
+ "repo-user-push",
32
+ "repo-uncovered",
33
+ "template-managed-by",
17
34
  "github-installation-id",
18
35
  "github-pat-vs-app",
19
36
  "patch-author-allowlist",
@@ -53,4 +70,10 @@ describe("help catalogue", () => {
53
70
  `href="${ADMIN_DOCS_BASE_URL}admin-console-glossary#runtime"`,
54
71
  );
55
72
  });
73
+
74
+ test("template-managed-by warns only about badged items", () => {
75
+ const summary = HELP_CATALOGUE["template-managed-by"].summary;
76
+ expect(summary).toContain("an item with this badge");
77
+ expect(summary).toContain("Items without the badge are not affected.");
78
+ });
56
79
  });
@@ -12,6 +12,7 @@
12
12
  */
13
13
 
14
14
  import type { components } from "@app-vitals/agent-lib/admin-types";
15
+ import { renderHelpTip } from "./admin-ui-help-catalogue.ts";
15
16
  import { escapeHtml } from "./admin-ui-styles.ts";
16
17
  import {
17
18
  type GithubAppsState,
@@ -351,7 +352,7 @@ export function renderInstallationReposBody(
351
352
  return (
352
353
  sync +
353
354
  view.orgs
354
- .map((o) => {
355
+ .map((o, orgIndex) => {
355
356
  const rows =
356
357
  o.repos.length === 0
357
358
  ? `<tr><td colspan="2" class="empty-state">No repos.</td></tr>`
@@ -361,8 +362,8 @@ export function renderInstallationReposBody(
361
362
  r.userCanPush === undefined
362
363
  ? ""
363
364
  : r.userCanPush
364
- ? '<span class="badge badge-green" title="The bound user can push">user can push</span>'
365
- : '<span class="badge badge-warning" title="The bound user cannot push">user cannot push</span>';
365
+ ? '<span class="badge badge-green">user can push</span>'
366
+ : '<span class="badge badge-warning">user cannot push</span>';
366
367
  const detail = [
367
368
  r.accessCheckedAt
368
369
  ? `checked ${escapeHtml(r.accessCheckedAt)}`
@@ -378,7 +379,7 @@ export function renderInstallationReposBody(
378
379
  return `<tr><td class="mono">${escapeHtml(r.fullName)}</td><td>${hint}${meta}</td></tr>`;
379
380
  })
380
381
  .join("");
381
- return `<div class="github-installation-org" data-org="${escapeHtml(o.org)}" style="margin-bottom:16px"><div style="font-weight:600;margin-bottom:6px">${escapeHtml(o.org)}</div>${renderInstallationSyncStatus(o, opts.timezone)}<table class="detail-table"><thead><tr><th>Repo</th><th>Bound user</th></tr></thead><tbody>${rows}</tbody></table></div>`;
382
+ return `<div class="github-installation-org" data-org="${escapeHtml(o.org)}" style="margin-bottom:16px"><div style="font-weight:600;margin-bottom:6px">${escapeHtml(o.org)}</div>${renderInstallationSyncStatus(o, opts.timezone)}<table class="detail-table"><thead><tr><th>Repo</th><th>Bound user${orgIndex === 0 ? renderHelpTip("repo-user-push", "bound user push access") : ""}</th></tr></thead><tbody>${rows}</tbody></table></div>`;
382
383
  })
383
384
  .join("")
384
385
  );
@@ -454,7 +455,7 @@ export function uncoveredRepos(
454
455
 
455
456
  /** The badge shown on an uncovered repo row of the agent's repos list. */
456
457
  export function renderUncoveredBadge(): string {
457
- return ` <span class="badge badge-warning" data-uncovered="1" title="The agent App's installation does not cover this repo. Nothing is changed automatically.">not on installation</span>`;
458
+ return ` <span class="badge badge-warning" data-uncovered="1">not on installation</span>`;
458
459
  }
459
460
 
460
461
  const repoList = (kind: string, title: string, repos: readonly string[]) =>
@@ -123,7 +123,7 @@ describe("renderInstallationReposBody", () => {
123
123
  it("lists app repos without any per-repo action", () => {
124
124
  const html = renderInstallationReposBody(view);
125
125
  expect(html).toContain("acme/&lt;x&gt;");
126
- expect(html).not.toContain("<button");
126
+ expect(html).not.toContain('<button type="submit"');
127
127
  expect(html).not.toContain("data-action=");
128
128
  });
129
129
 
@@ -241,7 +241,7 @@ describe("admin UI — GitHub sync card (IRM-3.2)", () => {
241
241
  // acme/docs has no hint: exactly two hint badges
242
242
  expect(html.match(/>user can(not)? push</g)?.length).toBe(2);
243
243
  expect(html).not.toContain("data-action=");
244
- expect(html).not.toContain("<button");
244
+ expect(html).not.toContain('<button type="submit"');
245
245
  });
246
246
 
247
247
  it("lists repos for an unbound username without hints", async () => {
@@ -1,14 +1,22 @@
1
1
  import { describe, expect, test } from "bun:test";
2
- import { HELP_CATALOGUE } from "./admin-ui-help-catalogue.ts";
3
2
  import { renderNewLocalAgentPage } from "./admin-ui-pages.ts";
4
3
 
4
+ const NEW_AGENT_HELP_IDS = [
5
+ "specialty",
6
+ "runtime",
7
+ "review-author-allowlist",
8
+ "patch-author-allowlist",
9
+ "github-pat-vs-app",
10
+ "github-app-id",
11
+ "github-installation-id",
12
+ ];
5
13
  const TYPES = [{ name: "coding", displayName: "Coding Agent" }];
6
14
  const count = (html: string, needle: string) => html.split(needle).length - 1;
7
15
 
8
16
  describe("renderNewLocalAgentPage help tooltips", () => {
9
17
  const html = renderNewLocalAgentPage("Dan", TYPES);
10
18
 
11
- for (const id of Object.keys(HELP_CATALOGUE)) {
19
+ for (const id of NEW_AGENT_HELP_IDS) {
12
20
  test(`renders help-${id} exactly once`, () => {
13
21
  expect(count(html, `id="help-${id}"`)).toBe(1);
14
22
  });
@@ -16,6 +16,8 @@ import {
16
16
  renderGithubInstallCard,
17
17
  renderGithubUsernameRow,
18
18
  } from "./admin-ui-github-identity-pages.ts";
19
+ import { renderHelpTip } from "./admin-ui-help-catalogue.ts";
20
+ import { renderInfoTip } from "./admin-ui-info-tip.ts";
19
21
  import {
20
22
  type InstallationSyncView,
21
23
  installationSnapshotComplete,
@@ -24,8 +26,6 @@ import {
24
26
  renderUncoveredBadge,
25
27
  uncoveredRepos,
26
28
  } from "./admin-ui-installation-repos-pages.ts";
27
- import { renderInfoTip } from "./admin-ui-info-tip.ts";
28
- import { renderHelpTip } from "./admin-ui-help-catalogue.ts";
29
29
  import { renderAdminPage } from "./admin-ui-layout.ts";
30
30
  import { renderSettingsLayout } from "./admin-ui-settings-layout.ts";
31
31
  import {
@@ -1266,6 +1266,20 @@ export function settingsRedirectSection(formData: FormData): AgentSection {
1266
1266
  return formData.has("restrictSlackToMembers") ? "access" : "configuration";
1267
1267
  }
1268
1268
 
1269
+ /**
1270
+ * Column help shown above a table. Tips are kept out of `<th>` because
1271
+ * `.data-table-wrapper` scrolls (overflow-x:auto), which would clip the
1272
+ * absolutely positioned popover.
1273
+ */
1274
+ function renderColumnHelp(
1275
+ cols: ReadonlyArray<{ label: string; id: string; tipLabel: string }>,
1276
+ ): string {
1277
+ const items = cols
1278
+ .map((c) => `${escapeHtml(c.label)}${renderHelpTip(c.id, c.tipLabel)}`)
1279
+ .join(" · ");
1280
+ return `<div class="table-col-help" style="font-size:12px;color:var(--vos-text-muted);margin:0 0 6px">Columns: ${items}</div>`;
1281
+ }
1282
+
1269
1283
  /** Remove every state-changing control (POST forms, repo-removal buttons). */
1270
1284
  function stripManagementControls(html: string): string {
1271
1285
  return html
@@ -1415,8 +1429,8 @@ export function renderAgentDetailPage(
1415
1429
  !tpl || (source !== "template" && source !== "custom")
1416
1430
  ? ""
1417
1431
  : source === "template"
1418
- ? ` <span class="badge badge-template" data-source="template" title="Inherited from the agent template">template</span>`
1419
- : ` <span class="badge badge-custom" data-source="custom" title="Set on this agent; overrides the template">custom</span>`;
1432
+ ? ` <span class="badge badge-template" data-source="template">template</span>`
1433
+ : ` <span class="badge badge-custom" data-source="custom">custom</span>`;
1420
1434
  const resetForm = (
1421
1435
  source: string | undefined,
1422
1436
  kind: string,
@@ -1435,7 +1449,7 @@ export function renderAgentDetailPage(
1435
1449
  : {};
1436
1450
  const templateCard = tpl
1437
1451
  ? `<div class="card" id="template">
1438
- <div class="card-title">Agent template</div>
1452
+ <div class="card-title">Agent template${renderHelpTip("template-following-detached", "template following and detached")}${renderHelpTip("template-row-source", "template row sources")}</div>
1439
1453
  ${
1440
1454
  tpl.detached
1441
1455
  ? `<p style="font-size:13px;margin-bottom:12px"><span class="badge badge-gray">Detached from template</span>
@@ -1797,7 +1811,7 @@ export function renderAgentDetailPage(
1797
1811
  <td class="mono">${m.ref ? escapeHtml(m.ref) : "default"}</td>
1798
1812
  <td>${
1799
1813
  tombstone
1800
- ? `<span class="badge badge-gray" title="Removed from this agent; the template no longer re-adds it">disabled</span>`
1814
+ ? `<span class="badge badge-gray">disabled</span>`
1801
1815
  : `<span class="badge badge-green">remote</span>`
1802
1816
  }</td>
1803
1817
  <td>${
@@ -1818,7 +1832,7 @@ export function renderAgentDetailPage(
1818
1832
  <td class="mono">${escapeHtml(name)}</td>
1819
1833
  <td class="mono" style="color:var(--vos-text-muted)">—</td>
1820
1834
  <td class="mono" style="color:var(--vos-text-muted)">—</td>
1821
- <td><span class="badge badge-gray" title="Comes from the agent image; only an image update changes it">from image</span></td>
1835
+ <td><span class="badge badge-gray">from image</span></td>
1822
1836
  <td></td>
1823
1837
  </tr>`,
1824
1838
  )
@@ -1977,7 +1991,7 @@ export function renderAgentDetailPage(
1977
1991
  : [],
1978
1992
  );
1979
1993
  const reposSection = `<div class="card">
1980
- <div class="card-title">Repos</div>
1994
+ <div class="card-title">Repos${renderHelpTip("repo-uncovered", "repos not on the installation")}</div>
1981
1995
  <form method="POST" action="/admin/agents/${escapeHtml(agent.id)}/repos/add" style="margin-bottom:16px">
1982
1996
  <div class="form-row">
1983
1997
  <div class="form-group" style="flex:1">
@@ -2143,7 +2157,7 @@ export function renderAgentDetailPage(
2143
2157
  : "";
2144
2158
 
2145
2159
  const cronJobsSection = `<div class="card">
2146
- <div class="card-title">Cron Jobs</div>
2160
+ <div class="card-title">Cron Jobs${renderHelpTip("cron-system-vs-custom", "system and custom crons")}</div>
2147
2161
 
2148
2162
  ${
2149
2163
  agent.selfHosted
@@ -2153,6 +2167,15 @@ export function renderAgentDetailPage(
2153
2167
 
2154
2168
  <div style="margin-bottom:20px">
2155
2169
  <div style="font-size:12px;font-weight:600;color:var(--vos-text-muted);text-transform:uppercase;letter-spacing:0.05em;margin-bottom:8px">System</div>
2170
+ ${renderColumnHelp([
2171
+ { label: "Schedule", id: "cron-schedule", tipLabel: "cron schedule" },
2172
+ {
2173
+ label: "Pre-check",
2174
+ id: "cron-precheck",
2175
+ tipLabel: "cron pre-check",
2176
+ },
2177
+ { label: "Target", id: "cron-target", tipLabel: "cron target" },
2178
+ ])}
2156
2179
  <div class="data-table-wrapper">
2157
2180
  <table class="data-table">
2158
2181
  <thead>
@@ -2226,6 +2249,7 @@ export function renderAgentDetailPage(
2226
2249
  <button type="submit" class="btn btn-primary">Add</button>
2227
2250
  </div>
2228
2251
  </form>
2252
+ ${renderColumnHelp([{ label: "Pattern", id: "tools-pattern", tipLabel: "tool pattern" }])}
2229
2253
  <div class="data-table-wrapper">
2230
2254
  <table class="data-table">
2231
2255
  <thead>
@@ -2244,7 +2268,7 @@ export function renderAgentDetailPage(
2244
2268
  </div>`;
2245
2269
 
2246
2270
  const tokensSection = `<div class="card">
2247
- <div class="card-title">Task Store Tokens</div>
2271
+ <div class="card-title">Task Store Tokens${renderHelpTip("task-store-tokens", "task store tokens")}</div>
2248
2272
  <form method="POST" action="/admin/agents/${escapeHtml(agent.id)}/tokens" style="margin-bottom:16px">
2249
2273
  <div class="form-row">
2250
2274
  <div class="form-group" style="flex:1">
@@ -2278,7 +2302,7 @@ export function renderAgentDetailPage(
2278
2302
  ]),
2279
2303
  ];
2280
2304
  const pluginsSection = `<div class="card">
2281
- <div class="card-title">Plugins</div>
2305
+ <div class="card-title">Plugins${renderHelpTip("plugins", "plugins")}</div>
2282
2306
  <div class="data-table-wrapper">
2283
2307
  <table class="data-table" id="plugins-table">
2284
2308
  <thead>
@@ -2304,6 +2328,14 @@ export function renderAgentDetailPage(
2304
2328
 
2305
2329
  const marketplacesSection = `<div class="card">
2306
2330
  <div class="card-title">Marketplaces</div>
2331
+ ${renderColumnHelp([
2332
+ { label: "Ref", id: "marketplace-ref", tipLabel: "marketplace ref" },
2333
+ {
2334
+ label: "Origin",
2335
+ id: "marketplace-origin",
2336
+ tipLabel: "marketplace origin",
2337
+ },
2338
+ ])}
2307
2339
  <div class="data-table-wrapper">
2308
2340
  <table class="data-table" id="marketplaces-table">
2309
2341
  <thead>
@@ -2340,7 +2372,7 @@ export function renderAgentDetailPage(
2340
2372
  ): string =>
2341
2373
  `<tr><td style="color:var(--vos-text-muted);width:200px">${label}</td><td${mono ? ' class="mono"' : ""}>${value ? escapeHtml(value) : identityPlaceholder}</td></tr>`;
2342
2374
  const identitySection = `<div class="card">
2343
- <div class="card-title">Owner &amp; identities</div>
2375
+ <div class="card-title">Owner &amp; identities${renderHelpTip("owner-identities", "owner and identities")}</div>
2344
2376
  <table class="detail-table"><tbody>
2345
2377
  ${identityRow("Owner email", agent.ownerEmail, false)}
2346
2378
  ${identityRow("Anthropic identity name", agent.anthropicIdentityName, true)}
@@ -2383,7 +2415,7 @@ export function renderAgentDetailPage(
2383
2415
  : "";
2384
2416
 
2385
2417
  const agentPolicySection = `<div class="card">
2386
- <div class="card-title">Agent Policy</div>
2418
+ <div class="card-title">Agent Policy${renderHelpTip("agent-policy", "agent policy")}</div>
2387
2419
  <form method="POST" action="/admin/agents/${escapeHtml(agent.id)}/settings">
2388
2420
  <div class="form-group" style="display:flex;align-items:center;gap:6px">
2389
2421
  <input
@@ -2515,7 +2547,7 @@ export function renderAgentDetailPage(
2515
2547
  <details>
2516
2548
  <summary class="btn btn-secondary" style="cursor:pointer;font-size:12px;list-style:none">Sync Manifest</summary>
2517
2549
  <div style="position:absolute;right:24px;margin-top:6px;background:var(--vos-surface);border:1px solid var(--vos-border);border-radius:6px;padding:12px;box-shadow:0 4px 12px rgba(0,0,0,0.08);z-index:10;min-width:320px">
2518
- <p style="font-size:12px;color:var(--vos-text-muted);margin:0 0 10px">Syncs the current manifest to the provisioned Slack app. ${slackTokenCopy(slackStored, slackMismatch).help}</p>
2550
+ <p style="font-size:12px;color:var(--vos-text-muted);margin:0 0 10px">Syncs the current manifest to the provisioned Slack app. ${slackTokenCopy(slackStored, slackMismatch).help}${renderHelpTip("sync-manifest", "Sync Manifest", "end")}</p>
2519
2551
  <form method="POST" action="/admin/agents/${escapeHtml(agent.id)}/sync-manifest" style="display:flex;flex-direction:column;gap:8px">
2520
2552
  <input
2521
2553
  name="xoxpToken"
@@ -2402,7 +2402,7 @@ describe("renderAgentDetailPage — sections", () => {
2402
2402
 
2403
2403
  test("Automation renders only the cron jobs card", () => {
2404
2404
  const html = render("automation");
2405
- expect(html).toContain('<div class="card-title">Cron Jobs</div>');
2405
+ expect(html).toContain('<div class="card-title">Cron Jobs');
2406
2406
  expect(html).toContain('action="/admin/agents/agent-123/crons"');
2407
2407
  expect(html).not.toContain('class="stat-strip"');
2408
2408
  expect(html).not.toContain("Danger Zone");
@@ -2414,9 +2414,9 @@ describe("renderAgentDetailPage — sections", () => {
2414
2414
  const html = render("configuration");
2415
2415
  const idx = [
2416
2416
  'id="env-vars"',
2417
- '<div class="card-title">Repos</div>',
2417
+ '<div class="card-title">Repos',
2418
2418
  'id="ext-config"',
2419
- '<div class="card-title">Agent Policy</div>',
2419
+ '<div class="card-title">Agent Policy',
2420
2420
  ].map((m) => html.indexOf(m));
2421
2421
  expect(idx.every((i) => i > -1)).toBe(true);
2422
2422
  expect([...idx].sort((x, y) => x - y)).toEqual(idx);
@@ -2442,7 +2442,7 @@ describe("renderAgentDetailPage — sections", () => {
2442
2442
  expect(html).not.toContain('<div class="card-title">Slack access</div>');
2443
2443
  expect(html).toContain("Task Store Tokens");
2444
2444
  expect(html).toContain('action="/admin/agents/agent-123/tokens"');
2445
- expect(html).not.toContain('<div class="card-title">Tools</div>');
2445
+ expect(html).not.toContain('<div class="card-title">Tools');
2446
2446
  expect(html).not.toContain("Cron Jobs");
2447
2447
  });
2448
2448
 
@@ -2460,8 +2460,8 @@ describe("renderAgentDetailPage — sections", () => {
2460
2460
  expect(html).toContain('action="/admin/agents/agent-123/tools"');
2461
2461
  expect(html).toContain('action="/admin/agents/agent-123/plugins"');
2462
2462
  expect(html).toContain('action="/admin/agents/agent-123/marketplaces"');
2463
- expect(html).toContain('<div class="card-title">Tools</div>');
2464
- expect(html).toContain('<div class="card-title">Plugins</div>');
2463
+ expect(html).toContain('<div class="card-title">Tools');
2464
+ expect(html).toContain('<div class="card-title">Plugins');
2465
2465
  expect(html).toContain('<div class="card-title">Marketplaces</div>');
2466
2466
  expect(html).not.toContain("Task Store Tokens");
2467
2467
  });
@@ -2524,10 +2524,16 @@ describe("renderAgentDetailPage — stat strip", () => {
2524
2524
 
2525
2525
  test("stat tiles appear in order: crons active, missing env vars, members, repos", () => {
2526
2526
  const html = render();
2527
- const cronsIndex = html.indexOf("crons active");
2528
- const envIndex = html.indexOf("missing env vars");
2529
- const membersIndex = html.indexOf("members");
2530
- const reposIndex = html.indexOf("repos");
2527
+ const cronsIndex = html.indexOf(
2528
+ '<div class="stat-tile-label">crons active</div>',
2529
+ );
2530
+ const envIndex = html.indexOf(
2531
+ '<div class="stat-tile-label">missing env vars</div>',
2532
+ );
2533
+ const membersIndex = html.indexOf(
2534
+ '<div class="stat-tile-label">members</div>',
2535
+ );
2536
+ const reposIndex = html.indexOf('<div class="stat-tile-label">repos</div>');
2531
2537
 
2532
2538
  expect(cronsIndex).toBeGreaterThan(-1);
2533
2539
  expect(envIndex).toBeGreaterThan(-1);
@@ -4528,10 +4534,10 @@ describe("renderAgentDetailPage — configuration card slots", () => {
4528
4534
  '<div class="card">cfg-one</div>',
4529
4535
  '<div class="card">cfg-two</div>',
4530
4536
  ]);
4531
- const repos = html.indexOf('<div class="card-title">Repos</div>');
4537
+ const repos = html.indexOf('<div class="card-title">Repos');
4532
4538
  const one = html.indexOf("cfg-one");
4533
4539
  const two = html.indexOf("cfg-two");
4534
- const policy = html.indexOf('<div class="card-title">Agent Policy</div>');
4540
+ const policy = html.indexOf('<div class="card-title">Agent Policy');
4535
4541
  expect(repos).toBeGreaterThan(-1);
4536
4542
  expect(repos).toBeLessThan(one);
4537
4543
  expect(one).toBeLessThan(two);
@@ -4873,8 +4879,7 @@ describe("renderAgentDetailPage — cron help tooltips", () => {
4873
4879
  { timezone: "UTC", section: "automation", cronHelp },
4874
4880
  );
4875
4881
  }
4876
- const tipCount = (html: string) =>
4877
- html.split('class="info-tip-btn"').length - 1;
4882
+ const tipCount = (html: string) => html.split('id="cron-help-').length - 1;
4878
4883
 
4879
4884
  test("a system row and a phase row each get exactly one tooltip", () => {
4880
4885
  const html = render([SYSTEM_CRON, PHASE], lookup);
@@ -4907,3 +4912,72 @@ describe("renderAgentDetailPage — cron help tooltips", () => {
4907
4912
  expect(tipCount(html)).toBe(0);
4908
4913
  });
4909
4914
  });
4915
+
4916
+ // ─── renderAgentDetailPage — help tooltips (9.3) ─────────────────────────────
4917
+
4918
+ describe("renderAgentDetailPage — help tooltips", () => {
4919
+ const renderSection = (section: (typeof AGENT_SECTIONS)[number]) =>
4920
+ renderAgentDetailSection(
4921
+ AGENT,
4922
+ {},
4923
+ [SYSTEM_CRON, CUSTOM_CRON],
4924
+ [TOOL_ENABLED],
4925
+ [TOKEN_ACTIVE],
4926
+ [PLUGIN_ENABLED],
4927
+ [],
4928
+ USER_NAME,
4929
+ true,
4930
+ { timezone: "UTC", template: { detached: false }, section },
4931
+ );
4932
+ const count = (html: string, needle: string) => html.split(needle).length - 1;
4933
+ const EXPECTED: Record<(typeof AGENT_SECTIONS)[number], string[]> = {
4934
+ general: [],
4935
+ automation: [
4936
+ "cron-system-vs-custom",
4937
+ "cron-schedule",
4938
+ "cron-precheck",
4939
+ "cron-target",
4940
+ ],
4941
+ configuration: [
4942
+ "template-following-detached",
4943
+ "template-row-source",
4944
+ "repo-uncovered",
4945
+ "agent-policy",
4946
+ ],
4947
+ access: ["owner-identities", "task-store-tokens"],
4948
+ extensions: [
4949
+ "tools-pattern",
4950
+ "plugins",
4951
+ "marketplace-ref",
4952
+ "marketplace-origin",
4953
+ ],
4954
+ };
4955
+
4956
+ for (const section of AGENT_SECTIONS) {
4957
+ for (const id of EXPECTED[section]) {
4958
+ test(`${section} renders help-${id} once`, () => {
4959
+ expect(count(renderSection(section), `id="help-${id}"`)).toBe(1);
4960
+ });
4961
+ }
4962
+ }
4963
+
4964
+ test("no help tip renders inside a scrolling table wrapper", () => {
4965
+ const html = AGENT_SECTIONS.map(renderSection).join("");
4966
+ const wrappers =
4967
+ html.match(/<div class="data-table-wrapper">[\s\S]*?<\/table>/g) ?? [];
4968
+ expect(wrappers.length).toBeGreaterThan(0);
4969
+ for (const w of wrappers) expect(w).not.toContain('id="help-');
4970
+ });
4971
+
4972
+ test("repeated badges carry no per-badge title", () => {
4973
+ const html = AGENT_SECTIONS.map(renderSection).join("");
4974
+ for (const t of [
4975
+ "Inherited from the agent template",
4976
+ "Set on this agent; overrides the template",
4977
+ "Comes from the agent image",
4978
+ "Removed from this agent; the template no longer re-adds it",
4979
+ ]) {
4980
+ expect(html).not.toContain(`title="${t}`);
4981
+ }
4982
+ });
4983
+ });
@@ -8,6 +8,7 @@
8
8
  * the stored secret.
9
9
  */
10
10
 
11
+ import { renderHelpTip } from "./admin-ui-help-catalogue.ts";
11
12
  import { renderAdminPage } from "./admin-ui-layout.ts";
12
13
  import {
13
14
  buildSettingsNav,
@@ -45,7 +46,7 @@ export function managedByBadge(
45
46
  item: Pick<TemplateItemRow, "managedBy">,
46
47
  ): string {
47
48
  return item.managedBy === "helm"
48
- ? ` <span class="badge badge-template" title="Set by admin.templateSeed in Helm values; edits are overwritten on the next admin restart">from Helm values</span>`
49
+ ? ` <span class="badge badge-template">from Helm values</span>`
49
50
  : "";
50
51
  }
51
52
 
@@ -187,7 +188,7 @@ export function renderTemplatesPage(o: TemplatesPageOpts): string {
187
188
  isOwner: true,
188
189
  body: `${error}${notice}${blocked}
189
190
  <div class="card">
190
- <p class="help-text">Default env vars, tools, plugins, crons and plugin marketplaces for new agents in a scope. Secret values are masked after saving; leave <code>***</code> to keep the stored value.</p>
191
+ <p class="help-text">Default env vars, tools, plugins, crons and plugin marketplaces for new agents in a scope. Secret values are masked after saving; leave <code>***</code> to keep the stored value.${renderHelpTip("template-managed-by", "from Helm values")}</p>
191
192
  ${scopePicker(o)}
192
193
  ${del}
193
194
  </div>
@@ -325,7 +325,7 @@ describe("/admin/settings/templates smoke", () => {
325
325
  const res = await app.request(BASE);
326
326
  expect(res.status).toBe(200);
327
327
  const html = await res.text();
328
- expect(html.match(/from Helm values/g)).toHaveLength(1);
328
+ expect(html.match(/>from Helm values</g)).toHaveLength(1);
329
329
  const seeded = html.slice(
330
330
  html.indexOf('data-key="seeded@example-plugins"'),
331
331
  html.indexOf('data-key="manual@example-plugins"'),
@@ -1894,7 +1894,7 @@ describe("admin UI — authenticated pages", () => {
1894
1894
  expect(res.status).toBe(200);
1895
1895
  const html = await res.text();
1896
1896
  // Tools card should appear for self-hosted agents
1897
- expect(html).toContain('<div class="card-title">Tools</div>');
1897
+ expect(html).toContain('<div class="card-title">Tools');
1898
1898
  // Tools should be rendered
1899
1899
  expect(html).toContain("Bash(git:*)");
1900
1900
  });
@@ -2323,9 +2323,7 @@ describe("admin UI — owner and Anthropic identity section (PAI-2.5)", () => {
2323
2323
  });
2324
2324
  expect(res.status).toBe(200);
2325
2325
  const html = await res.text();
2326
- expect(html).toContain(
2327
- '<div class="card-title">Owner &amp; identities</div>',
2328
- );
2326
+ expect(html).toContain('<div class="card-title">Owner &amp; identities');
2329
2327
  expect(html).toContain("Owner email");
2330
2328
  expect(html).toContain("jane.doe@example.com");
2331
2329
  expect(html).toContain("Anthropic identity name");
@@ -2362,7 +2360,7 @@ describe("admin UI — owner and Anthropic identity section (PAI-2.5)", () => {
2362
2360
  expect(res.status).toBe(200);
2363
2361
  const html = await res.text();
2364
2362
  const start = html.indexOf(
2365
- '<div class="card-title">Owner &amp; identities</div>',
2363
+ '<div class="card-title">Owner &amp; identities',
2366
2364
  );
2367
2365
  expect(start).toBeGreaterThan(-1);
2368
2366
  const sectionHtml = html.slice(start, html.indexOf("</table>", start));
@@ -2384,7 +2382,7 @@ describe("admin UI — agent policy fields", () => {
2384
2382
  });
2385
2383
  expect(res.status).toBe(200);
2386
2384
  const html = await res.text();
2387
- expect(html).toContain('<div class="card-title">Agent Policy</div>');
2385
+ expect(html).toContain('<div class="card-title">Agent Policy');
2388
2386
 
2389
2387
  // Booleans default true/false/true — checkboxes reflect DB column defaults.
2390
2388
  const autoPostReviewsInput = html.match(
package/src/admin-ui.ts CHANGED
@@ -151,6 +151,7 @@ import {
151
151
  scopeIncludesAgent,
152
152
  type ViewerRole,
153
153
  } from "./caller-scope.ts";
154
+ import { buildCronHelpLookup } from "./cron-help.ts";
154
155
  import {
155
156
  creatorFromScope,
156
157
  type EnsureAccountMemberResult,
@@ -210,7 +211,6 @@ import {
210
211
  SlackProvisioningService,
211
212
  } from "./slack-provisioning-service.ts";
212
213
  import type { SpecialtyDefaultsResolver } from "./specialty-defaults.ts";
213
- import { buildCronHelpLookup } from "./cron-help.ts";
214
214
  import {
215
215
  type SpecialtyTypeResolver,
216
216
  SpecialtyTypes,