@app-vitals/agent-admin 1.133.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/openapi.platform.json +35 -2
- package/package.json +2 -2
- package/src/admin-ui-agent-detail-help.unit.test.ts +12 -0
- package/src/admin-ui-github-identity-pages.unit.test.ts +1 -3
- package/src/admin-ui-help-catalogue.ts +85 -0
- package/src/admin-ui-help-catalogue.unit.test.ts +24 -1
- package/src/admin-ui-installation-repos-pages.ts +6 -5
- package/src/admin-ui-installation-repos-pages.unit.test.ts +1 -1
- package/src/admin-ui-installation-repos.smoke.test.ts +1 -1
- package/src/admin-ui-new-agent-help.unit.test.ts +10 -2
- package/src/admin-ui-pages.ts +46 -14
- package/src/admin-ui-pages.unit.test.ts +88 -14
- package/src/admin-ui-templates-pages.ts +3 -2
- package/src/admin-ui-templates.smoke.test.ts +1 -1
- package/src/admin-ui.smoke.test.ts +4 -6
- package/src/admin-ui.ts +1 -1
- package/src/agent-github-installations.integration.test.ts +20 -0
- package/src/agents-api.smoke.test.ts +33 -0
- package/src/fixtures/github-enterprise-cassette.json +89 -0
- package/src/github-enterprise-api-apps.unit.test.ts +82 -0
- package/src/github-enterprise-api.integration.test.ts +135 -0
- package/src/github-enterprise-api.smoke.test.ts +200 -0
- package/src/github-enterprise-api.ts +118 -15
- package/src/openapi-schemas.ts +30 -2
package/openapi.platform.json
CHANGED
|
@@ -3377,8 +3377,23 @@
|
|
|
3377
3377
|
"type": "string",
|
|
3378
3378
|
"minLength": 1,
|
|
3379
3379
|
"maxLength": 50,
|
|
3380
|
+
"description": "Installation state, e.g. \"ok\", \"broken\", or \"shadowed\" (a higher-priority app owns the same owner).",
|
|
3380
3381
|
"example": "active"
|
|
3381
3382
|
},
|
|
3383
|
+
"appId": {
|
|
3384
|
+
"type": "string",
|
|
3385
|
+
"minLength": 1,
|
|
3386
|
+
"maxLength": 100,
|
|
3387
|
+
"description": "GitHub App id this installation belongs to. Omitted by older agents, which are treated as the single legacy app.",
|
|
3388
|
+
"example": "123456"
|
|
3389
|
+
},
|
|
3390
|
+
"slug": {
|
|
3391
|
+
"type": "string",
|
|
3392
|
+
"minLength": 1,
|
|
3393
|
+
"maxLength": 200,
|
|
3394
|
+
"description": "GitHub App slug, when the agent knows it.",
|
|
3395
|
+
"example": "my-agent-app"
|
|
3396
|
+
},
|
|
3382
3397
|
"lastError": {
|
|
3383
3398
|
"type": [
|
|
3384
3399
|
"string",
|
|
@@ -4536,6 +4551,12 @@
|
|
|
4536
4551
|
"minLength": 1,
|
|
4537
4552
|
"example": "agent-id"
|
|
4538
4553
|
},
|
|
4554
|
+
"appId": {
|
|
4555
|
+
"type": "string",
|
|
4556
|
+
"minLength": 1,
|
|
4557
|
+
"example": "12345",
|
|
4558
|
+
"description": "Which of the agent's GitHub Apps to install: the App's numeric id (or its AgentGitHubApp row id). Required when the agent has more than one App; defaults to the only App otherwise."
|
|
4559
|
+
},
|
|
4539
4560
|
"repositorySelection": {
|
|
4540
4561
|
"type": "string",
|
|
4541
4562
|
"enum": [
|
|
@@ -9097,7 +9118,7 @@
|
|
|
9097
9118
|
"github-enterprise"
|
|
9098
9119
|
],
|
|
9099
9120
|
"summary": "Install an agent's App on an organization",
|
|
9100
|
-
"description": "Admin-only. Uses the
|
|
9121
|
+
"description": "Admin-only. The App is chosen with `appId` (required, 422, when the agent has more than one App; 404 when the agent has no such App). Uses the App's stored client id when set; otherwise resolves the stored GH_APP_SLUG and looks the App up through the public GET /apps/{slug} to get its client id. Installs it on the org with the installer App. 422 for an agent with neither a stored client id nor a slug, and for a private App (not visible to the public lookup) with no stored client id; 409 when the installer App is not configured.",
|
|
9101
9122
|
"parameters": [
|
|
9102
9123
|
{
|
|
9103
9124
|
"schema": {
|
|
@@ -9248,7 +9269,7 @@
|
|
|
9248
9269
|
"github-enterprise"
|
|
9249
9270
|
],
|
|
9250
9271
|
"summary": "Uninstall an agent's App from an organization",
|
|
9251
|
-
"description": "Admin-only. Finds the
|
|
9272
|
+
"description": "Admin-only. Finds the named App's installation on the org (`appId` is required when the agent has several Apps; the agent's other Apps' installations are untouched; matched by client id, slug or app id) and deletes it with the installer App, removes that org's repos from the agent's repos, blocks the agent's open tasks and PRs on them (both skipped when another App of the agent is still installed on the org) through the open-work port (a port failure is a warning) and writes one audit row (uninstall:org). `preview=true` lists the repos and open work that would be affected and changes nothing. 404 when the App is not installed on the org; 422 when more than 10 repos would be removed without `confirmRemovals=true`; 502 (with a failed audit row) when GitHub refuses.",
|
|
9252
9273
|
"parameters": [
|
|
9253
9274
|
{
|
|
9254
9275
|
"schema": {
|
|
@@ -9281,6 +9302,18 @@
|
|
|
9281
9302
|
"name": "agentId",
|
|
9282
9303
|
"in": "query"
|
|
9283
9304
|
},
|
|
9305
|
+
{
|
|
9306
|
+
"schema": {
|
|
9307
|
+
"type": "string",
|
|
9308
|
+
"minLength": 1,
|
|
9309
|
+
"example": "12345",
|
|
9310
|
+
"description": "Which of the agent's GitHub Apps to uninstall: the App's numeric id (or its AgentGitHubApp row id). Required when the agent has more than one App; defaults to the only App otherwise."
|
|
9311
|
+
},
|
|
9312
|
+
"required": false,
|
|
9313
|
+
"description": "Which of the agent's GitHub Apps to uninstall: the App's numeric id (or its AgentGitHubApp row id). Required when the agent has more than one App; defaults to the only App otherwise.",
|
|
9314
|
+
"name": "appId",
|
|
9315
|
+
"in": "query"
|
|
9316
|
+
},
|
|
9284
9317
|
{
|
|
9285
9318
|
"schema": {
|
|
9286
9319
|
"type": "string",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@app-vitals/agent-admin",
|
|
3
|
-
"version": "1.
|
|
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.
|
|
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 & identities</div>',
|
|
86
|
-
);
|
|
84
|
+
expect(html).toContain('<div class="card-title">Owner & identities');
|
|
87
85
|
expect(html).not.toContain("Owner & 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
|
|
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"
|
|
365
|
-
: '<span class="badge badge-warning"
|
|
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"
|
|
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/<x>");
|
|
126
|
-
expect(html).not.toContain(
|
|
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(
|
|
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
|
|
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
|
});
|
package/src/admin-ui-pages.ts
CHANGED
|
@@ -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"
|
|
1419
|
-
: ` <span class="badge badge-custom" data-source="custom"
|
|
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"
|
|
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"
|
|
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 & identities</div>
|
|
2375
|
+
<div class="card-title">Owner & 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"
|