@app-vitals/agent-admin 1.27.0 → 1.29.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/e2e/plugins-section.e2e.ts +168 -0
- package/e2e/test-server.ts +42 -10
- package/openapi.platform.json +390 -0
- package/package.json +2 -2
- package/src/admin-dev-login.smoke.test.ts +1 -0
- package/src/admin-local-agent.smoke.test.ts +1 -0
- package/src/admin-ui-pages.ts +17 -2
- package/src/admin-ui-pages.unit.test.ts +74 -1
- package/src/admin-ui.fixtures.ts +1 -0
- package/src/admin-ui.smoke.test.ts +146 -0
- package/src/admin-ui.ts +75 -1
- package/src/agents-api.smoke.test.ts +278 -0
- package/src/agents-api.ts +270 -0
- package/src/chat.smoke.test.ts +1 -0
- package/src/github-reconcile-routes.integration.test.ts +202 -0
- package/src/pwa-https-gating.smoke.test.ts +3 -0
- package/src/pwa-routes.smoke.test.ts +3 -0
- package/src/reconcile-apply-service.ts +30 -0
- package/src/reconcile-apply-service.unit.test.ts +42 -0
- package/src/server.smoke.test.ts +5 -1
- package/src/slack-provisioning.integration.test.ts +3 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* admin/e2e/plugins-section.e2e.ts
|
|
3
|
+
* Admin UI — Plugins card add/remove on the agent page (PUI-1.2)
|
|
4
|
+
*
|
|
5
|
+
* Covers: seeded row listed, add by spec (explicit and bare), malformed spec
|
|
6
|
+
* error, and remove.
|
|
7
|
+
*
|
|
8
|
+
* Spawns admin/e2e/test-server.ts on its own port; the server's plugin
|
|
9
|
+
* rows are in memory, so tests run serially against one server.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { type ChildProcess, spawn } from "node:child_process";
|
|
13
|
+
import { dirname, resolve } from "node:path";
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
15
|
+
import { type BrowserContext, type Page, expect, test } from "@playwright/test";
|
|
16
|
+
import { sign } from "hono/jwt";
|
|
17
|
+
|
|
18
|
+
const PORT = 3497;
|
|
19
|
+
const BASE_URL = `http://localhost:${PORT}`;
|
|
20
|
+
const SESSION_SECRET = "e2e-admin-test-secret-32chars!!!";
|
|
21
|
+
const AGENT_ID = "agent-e2e-1";
|
|
22
|
+
|
|
23
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
24
|
+
|
|
25
|
+
test.describe.configure({ mode: "serial" });
|
|
26
|
+
|
|
27
|
+
let serverProcess: ChildProcess | null = null;
|
|
28
|
+
|
|
29
|
+
async function waitForServer(url: string, maxWaitMs: number): Promise<void> {
|
|
30
|
+
const start = Date.now();
|
|
31
|
+
while (Date.now() - start < maxWaitMs) {
|
|
32
|
+
try {
|
|
33
|
+
const res = await fetch(url);
|
|
34
|
+
if (res.status < 500) return;
|
|
35
|
+
} catch {
|
|
36
|
+
// Not ready yet
|
|
37
|
+
}
|
|
38
|
+
await new Promise((r) => setTimeout(r, 300));
|
|
39
|
+
}
|
|
40
|
+
throw new Error(`Server at ${url} did not start within ${maxWaitMs}ms`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
test.beforeAll(async () => {
|
|
44
|
+
serverProcess = spawn("bun", ["run", resolve(__dirname, "test-server.ts")], {
|
|
45
|
+
env: {
|
|
46
|
+
...process.env,
|
|
47
|
+
ADMIN_E2E_PORT: String(PORT),
|
|
48
|
+
ADMIN_E2E_SESSION_SECRET: SESSION_SECRET,
|
|
49
|
+
},
|
|
50
|
+
stdio: "pipe",
|
|
51
|
+
cwd: resolve(__dirname, "../.."),
|
|
52
|
+
});
|
|
53
|
+
serverProcess.stderr?.on("data", (d: Buffer) => {
|
|
54
|
+
if (d.toString().trim())
|
|
55
|
+
console.error("[admin-e2e-plugins-server]", d.toString().trim());
|
|
56
|
+
});
|
|
57
|
+
await waitForServer(`${BASE_URL}/health`, 15_000);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test.afterAll(() => {
|
|
61
|
+
serverProcess?.kill("SIGTERM");
|
|
62
|
+
serverProcess = null;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const table = (page: Page) => page.locator("#plugins-table");
|
|
66
|
+
|
|
67
|
+
async function loadAgentPage(page: Page, context: BrowserContext) {
|
|
68
|
+
const nowSec = Math.floor(Date.now() / 1000);
|
|
69
|
+
const token = await sign(
|
|
70
|
+
{
|
|
71
|
+
userId: "google-sub-e2e",
|
|
72
|
+
email: "admin@example.com",
|
|
73
|
+
isAdmin: true,
|
|
74
|
+
iat: nowSec,
|
|
75
|
+
exp: nowSec + 3600,
|
|
76
|
+
},
|
|
77
|
+
SESSION_SECRET,
|
|
78
|
+
"HS256",
|
|
79
|
+
);
|
|
80
|
+
await context.addCookies([
|
|
81
|
+
{
|
|
82
|
+
name: "admin_session",
|
|
83
|
+
value: token,
|
|
84
|
+
domain: "localhost",
|
|
85
|
+
path: "/",
|
|
86
|
+
httpOnly: true,
|
|
87
|
+
sameSite: "Lax",
|
|
88
|
+
},
|
|
89
|
+
]);
|
|
90
|
+
await page.goto(`${BASE_URL}/admin/agents/${AGENT_ID}`);
|
|
91
|
+
await openGroup(page);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// The section lives in the "Plugins & Tools" accordion group, collapsed on
|
|
95
|
+
// every page load (including the redirect after each add/remove).
|
|
96
|
+
async function openGroup(page: Page) {
|
|
97
|
+
// Set `open` rather than clicking the summary, so a still-old (already
|
|
98
|
+
// open) page can't be toggled shut; the table locator retries across the
|
|
99
|
+
// navigation.
|
|
100
|
+
await expect(async () => {
|
|
101
|
+
await page
|
|
102
|
+
.locator("details", { has: page.locator("#plugins-table") })
|
|
103
|
+
.evaluate((el) => {
|
|
104
|
+
(el as HTMLDetailsElement).open = true;
|
|
105
|
+
});
|
|
106
|
+
await expect(table(page)).toBeVisible({ timeout: 1000 });
|
|
107
|
+
}).toPass();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
test("lists the seeded plugin", async ({ page, context }) => {
|
|
111
|
+
await loadAgentPage(page, context);
|
|
112
|
+
await expect(
|
|
113
|
+
table(page).locator("tbody tr", { hasText: "seeded-plugin@seeded-remote" }),
|
|
114
|
+
).toHaveCount(1);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
test("adds a plugin by spec and then removes it", async ({ page, context }) => {
|
|
118
|
+
await loadAgentPage(page, context);
|
|
119
|
+
const form = page.locator("#add-plugin-form");
|
|
120
|
+
await form.locator('input[name="spec"]').fill("added@seeded-remote");
|
|
121
|
+
await form.getByRole("button", { name: "Add plugin" }).click();
|
|
122
|
+
await page.waitForURL(`${BASE_URL}/admin/agents/${AGENT_ID}`);
|
|
123
|
+
await openGroup(page);
|
|
124
|
+
|
|
125
|
+
const added = table(page).locator("tbody tr", {
|
|
126
|
+
hasText: "added@seeded-remote",
|
|
127
|
+
});
|
|
128
|
+
await expect(added).toHaveCount(1);
|
|
129
|
+
|
|
130
|
+
await added.getByRole("button", { name: "Remove" }).click();
|
|
131
|
+
await page.waitForURL(`${BASE_URL}/admin/agents/${AGENT_ID}`);
|
|
132
|
+
await openGroup(page);
|
|
133
|
+
await expect(
|
|
134
|
+
table(page).locator("tbody tr", { hasText: "added@seeded-remote" }),
|
|
135
|
+
).toHaveCount(0);
|
|
136
|
+
await expect(
|
|
137
|
+
table(page).locator("tbody tr", { hasText: "seeded-plugin" }),
|
|
138
|
+
).toHaveCount(1);
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
test("a bare name defaults to the shipwright marketplace", async ({
|
|
142
|
+
page,
|
|
143
|
+
context,
|
|
144
|
+
}) => {
|
|
145
|
+
await loadAgentPage(page, context);
|
|
146
|
+
const form = page.locator("#add-plugin-form");
|
|
147
|
+
await form.locator('input[name="spec"]').fill("barename");
|
|
148
|
+
await form.getByRole("button", { name: "Add plugin" }).click();
|
|
149
|
+
await page.waitForURL(`${BASE_URL}/admin/agents/${AGENT_ID}`);
|
|
150
|
+
await openGroup(page);
|
|
151
|
+
await expect(
|
|
152
|
+
table(page).locator("tbody tr", { hasText: "barename@shipwright" }),
|
|
153
|
+
).toHaveCount(1);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
test("a malformed spec redirects with an error and adds nothing", async ({
|
|
157
|
+
page,
|
|
158
|
+
context,
|
|
159
|
+
}) => {
|
|
160
|
+
await loadAgentPage(page, context);
|
|
161
|
+
const before = await table(page).locator("tbody tr").count();
|
|
162
|
+
const form = page.locator("#add-plugin-form");
|
|
163
|
+
await form.locator('input[name="spec"]').fill("a@b@c");
|
|
164
|
+
await form.getByRole("button", { name: "Add plugin" }).click();
|
|
165
|
+
await page.waitForURL(/\?error=/);
|
|
166
|
+
await openGroup(page);
|
|
167
|
+
await expect(table(page).locator("tbody tr")).toHaveCount(before);
|
|
168
|
+
});
|
package/e2e/test-server.ts
CHANGED
|
@@ -107,6 +107,28 @@ const marketplaceRows: Array<{
|
|
|
107
107
|
},
|
|
108
108
|
];
|
|
109
109
|
|
|
110
|
+
// In-memory AgentPlugin rows (PUI-1.2), mutated by the add/remove routes so
|
|
111
|
+
// plugins-section.e2e.ts sees real round trips (one server process per spec file).
|
|
112
|
+
const pluginRows: Array<{
|
|
113
|
+
id: string;
|
|
114
|
+
agentId: string;
|
|
115
|
+
name: string;
|
|
116
|
+
version: string | null;
|
|
117
|
+
enabled: boolean;
|
|
118
|
+
createdAt: Date;
|
|
119
|
+
updatedAt: Date;
|
|
120
|
+
}> = [
|
|
121
|
+
{
|
|
122
|
+
id: "pl-e2e-1",
|
|
123
|
+
agentId: ADMIN_E2E_AGENT.id,
|
|
124
|
+
name: "seeded-plugin@seeded-remote",
|
|
125
|
+
version: null,
|
|
126
|
+
enabled: true,
|
|
127
|
+
createdAt: new Date("2024-01-01"),
|
|
128
|
+
updatedAt: new Date("2024-01-01"),
|
|
129
|
+
},
|
|
130
|
+
];
|
|
131
|
+
|
|
110
132
|
// ─── Chat fixtures (CFB-1.3 — chat thread page e2e) ──────────────────────────
|
|
111
133
|
|
|
112
134
|
const MOCK_CHAT_THREAD: ChatThread = {
|
|
@@ -318,16 +340,26 @@ function buildMockDeps(chatClient: ChatClient | undefined): AdminUIDeps {
|
|
|
318
340
|
revoke: async () => MOCK_TOKEN,
|
|
319
341
|
},
|
|
320
342
|
agentPluginService: {
|
|
321
|
-
list: async () => [],
|
|
322
|
-
add: async (agentId: string, name: string) =>
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
343
|
+
list: async () => [...pluginRows],
|
|
344
|
+
add: async (agentId: string, name: string) => {
|
|
345
|
+
const existing = pluginRows.find((p) => p.name === name);
|
|
346
|
+
if (existing) return existing;
|
|
347
|
+
const row = {
|
|
348
|
+
id: `pl-e2e-${pluginRows.length + 1}-${name}`,
|
|
349
|
+
agentId,
|
|
350
|
+
name,
|
|
351
|
+
version: null,
|
|
352
|
+
enabled: true,
|
|
353
|
+
createdAt: new Date("2024-01-01"),
|
|
354
|
+
updatedAt: new Date("2024-01-01"),
|
|
355
|
+
};
|
|
356
|
+
pluginRows.push(row);
|
|
357
|
+
return row;
|
|
358
|
+
},
|
|
359
|
+
remove: async (_agentId: string, pluginId: string) => {
|
|
360
|
+
const i = pluginRows.findIndex((p) => p.id === pluginId);
|
|
361
|
+
if (i >= 0) pluginRows.splice(i, 1);
|
|
362
|
+
},
|
|
331
363
|
},
|
|
332
364
|
agentMarketplaceService: {
|
|
333
365
|
list: async () => [...marketplaceRows],
|
package/openapi.platform.json
CHANGED
|
@@ -3260,6 +3260,238 @@
|
|
|
3260
3260
|
"status"
|
|
3261
3261
|
]
|
|
3262
3262
|
},
|
|
3263
|
+
"GithubReconcilePlanResult": {
|
|
3264
|
+
"type": "object",
|
|
3265
|
+
"properties": {
|
|
3266
|
+
"status": {
|
|
3267
|
+
"type": "string",
|
|
3268
|
+
"enum": [
|
|
3269
|
+
"planned",
|
|
3270
|
+
"skipped"
|
|
3271
|
+
],
|
|
3272
|
+
"description": "`skipped` (not an error) when no GitHub username is bound or the Apps are not configured; `reason` says why."
|
|
3273
|
+
},
|
|
3274
|
+
"reason": {
|
|
3275
|
+
"type": "string"
|
|
3276
|
+
},
|
|
3277
|
+
"planHash": {
|
|
3278
|
+
"type": "string"
|
|
3279
|
+
},
|
|
3280
|
+
"empty": {
|
|
3281
|
+
"type": "boolean"
|
|
3282
|
+
},
|
|
3283
|
+
"diff": {
|
|
3284
|
+
"type": "object",
|
|
3285
|
+
"properties": {
|
|
3286
|
+
"installationAdds": {
|
|
3287
|
+
"type": "array",
|
|
3288
|
+
"items": {
|
|
3289
|
+
"type": "string"
|
|
3290
|
+
}
|
|
3291
|
+
},
|
|
3292
|
+
"installationRemoves": {
|
|
3293
|
+
"type": "array",
|
|
3294
|
+
"items": {
|
|
3295
|
+
"type": "string"
|
|
3296
|
+
}
|
|
3297
|
+
},
|
|
3298
|
+
"configAdds": {
|
|
3299
|
+
"type": "array",
|
|
3300
|
+
"items": {
|
|
3301
|
+
"type": "string"
|
|
3302
|
+
}
|
|
3303
|
+
},
|
|
3304
|
+
"configRemoves": {
|
|
3305
|
+
"type": "array",
|
|
3306
|
+
"items": {
|
|
3307
|
+
"type": "string"
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3310
|
+
},
|
|
3311
|
+
"required": [
|
|
3312
|
+
"installationAdds",
|
|
3313
|
+
"installationRemoves",
|
|
3314
|
+
"configAdds",
|
|
3315
|
+
"configRemoves"
|
|
3316
|
+
]
|
|
3317
|
+
},
|
|
3318
|
+
"skippedOrgs": {
|
|
3319
|
+
"type": "array",
|
|
3320
|
+
"items": {
|
|
3321
|
+
"type": "object",
|
|
3322
|
+
"properties": {
|
|
3323
|
+
"org": {
|
|
3324
|
+
"type": "string"
|
|
3325
|
+
},
|
|
3326
|
+
"reason": {
|
|
3327
|
+
"type": "string"
|
|
3328
|
+
}
|
|
3329
|
+
},
|
|
3330
|
+
"required": [
|
|
3331
|
+
"org",
|
|
3332
|
+
"reason"
|
|
3333
|
+
]
|
|
3334
|
+
}
|
|
3335
|
+
},
|
|
3336
|
+
"rejectedAdds": {
|
|
3337
|
+
"type": "array",
|
|
3338
|
+
"items": {
|
|
3339
|
+
"type": "object",
|
|
3340
|
+
"properties": {
|
|
3341
|
+
"repo": {
|
|
3342
|
+
"type": "string"
|
|
3343
|
+
},
|
|
3344
|
+
"reason": {
|
|
3345
|
+
"type": "string"
|
|
3346
|
+
}
|
|
3347
|
+
},
|
|
3348
|
+
"required": [
|
|
3349
|
+
"repo",
|
|
3350
|
+
"reason"
|
|
3351
|
+
]
|
|
3352
|
+
}
|
|
3353
|
+
},
|
|
3354
|
+
"warnings": {
|
|
3355
|
+
"type": "array",
|
|
3356
|
+
"items": {
|
|
3357
|
+
"type": "string"
|
|
3358
|
+
}
|
|
3359
|
+
},
|
|
3360
|
+
"affectedOpenWork": {
|
|
3361
|
+
"type": "array",
|
|
3362
|
+
"items": {
|
|
3363
|
+
"type": "object",
|
|
3364
|
+
"properties": {
|
|
3365
|
+
"id": {
|
|
3366
|
+
"type": "string"
|
|
3367
|
+
},
|
|
3368
|
+
"repo": {
|
|
3369
|
+
"type": "string"
|
|
3370
|
+
},
|
|
3371
|
+
"title": {
|
|
3372
|
+
"type": "string"
|
|
3373
|
+
}
|
|
3374
|
+
},
|
|
3375
|
+
"required": [
|
|
3376
|
+
"id",
|
|
3377
|
+
"repo"
|
|
3378
|
+
]
|
|
3379
|
+
},
|
|
3380
|
+
"description": "Open work the removals would block; empty when no open-work port is wired."
|
|
3381
|
+
}
|
|
3382
|
+
},
|
|
3383
|
+
"required": [
|
|
3384
|
+
"status"
|
|
3385
|
+
]
|
|
3386
|
+
},
|
|
3387
|
+
"GithubReconcilePlanBody": {
|
|
3388
|
+
"type": "object",
|
|
3389
|
+
"properties": {
|
|
3390
|
+
"addRepos": {
|
|
3391
|
+
"type": "array",
|
|
3392
|
+
"items": {
|
|
3393
|
+
"type": "string",
|
|
3394
|
+
"pattern": "^[^/\\s]+\\/[^/\\s]+$"
|
|
3395
|
+
},
|
|
3396
|
+
"description": "Repos (owner/repo) to explicitly add to the agent's config and installation."
|
|
3397
|
+
}
|
|
3398
|
+
}
|
|
3399
|
+
},
|
|
3400
|
+
"GithubReconcileApplyResult": {
|
|
3401
|
+
"type": "object",
|
|
3402
|
+
"properties": {
|
|
3403
|
+
"status": {
|
|
3404
|
+
"type": "string",
|
|
3405
|
+
"enum": [
|
|
3406
|
+
"applied",
|
|
3407
|
+
"failed",
|
|
3408
|
+
"noop",
|
|
3409
|
+
"skipped"
|
|
3410
|
+
]
|
|
3411
|
+
},
|
|
3412
|
+
"reason": {
|
|
3413
|
+
"type": "string"
|
|
3414
|
+
},
|
|
3415
|
+
"auditId": {
|
|
3416
|
+
"type": "string"
|
|
3417
|
+
},
|
|
3418
|
+
"planHash": {
|
|
3419
|
+
"type": "string"
|
|
3420
|
+
},
|
|
3421
|
+
"diff": {
|
|
3422
|
+
"type": "object",
|
|
3423
|
+
"properties": {
|
|
3424
|
+
"installationAdds": {
|
|
3425
|
+
"type": "array",
|
|
3426
|
+
"items": {
|
|
3427
|
+
"type": "string"
|
|
3428
|
+
}
|
|
3429
|
+
},
|
|
3430
|
+
"installationRemoves": {
|
|
3431
|
+
"type": "array",
|
|
3432
|
+
"items": {
|
|
3433
|
+
"type": "string"
|
|
3434
|
+
}
|
|
3435
|
+
},
|
|
3436
|
+
"configAdds": {
|
|
3437
|
+
"type": "array",
|
|
3438
|
+
"items": {
|
|
3439
|
+
"type": "string"
|
|
3440
|
+
}
|
|
3441
|
+
},
|
|
3442
|
+
"configRemoves": {
|
|
3443
|
+
"type": "array",
|
|
3444
|
+
"items": {
|
|
3445
|
+
"type": "string"
|
|
3446
|
+
}
|
|
3447
|
+
}
|
|
3448
|
+
},
|
|
3449
|
+
"required": [
|
|
3450
|
+
"installationAdds",
|
|
3451
|
+
"installationRemoves",
|
|
3452
|
+
"configAdds",
|
|
3453
|
+
"configRemoves"
|
|
3454
|
+
]
|
|
3455
|
+
},
|
|
3456
|
+
"warnings": {
|
|
3457
|
+
"type": "array",
|
|
3458
|
+
"items": {
|
|
3459
|
+
"type": "string"
|
|
3460
|
+
}
|
|
3461
|
+
},
|
|
3462
|
+
"error": {
|
|
3463
|
+
"type": "string"
|
|
3464
|
+
}
|
|
3465
|
+
},
|
|
3466
|
+
"required": [
|
|
3467
|
+
"status"
|
|
3468
|
+
]
|
|
3469
|
+
},
|
|
3470
|
+
"GithubReconcileApplyBody": {
|
|
3471
|
+
"type": "object",
|
|
3472
|
+
"properties": {
|
|
3473
|
+
"planHash": {
|
|
3474
|
+
"type": "string",
|
|
3475
|
+
"minLength": 1,
|
|
3476
|
+
"description": "planHash of the plan the admin reviewed."
|
|
3477
|
+
},
|
|
3478
|
+
"addRepos": {
|
|
3479
|
+
"type": "array",
|
|
3480
|
+
"items": {
|
|
3481
|
+
"type": "string",
|
|
3482
|
+
"pattern": "^[^/\\s]+\\/[^/\\s]+$"
|
|
3483
|
+
},
|
|
3484
|
+
"description": "Must match the addRepos used when the plan was made."
|
|
3485
|
+
},
|
|
3486
|
+
"confirmRemovals": {
|
|
3487
|
+
"type": "boolean",
|
|
3488
|
+
"description": "Required when the plan removes more than 10 repos."
|
|
3489
|
+
}
|
|
3490
|
+
},
|
|
3491
|
+
"required": [
|
|
3492
|
+
"planHash"
|
|
3493
|
+
]
|
|
3494
|
+
},
|
|
3263
3495
|
"AgentConfigResponse": {
|
|
3264
3496
|
"type": "object",
|
|
3265
3497
|
"properties": {
|
|
@@ -6893,6 +7125,164 @@
|
|
|
6893
7125
|
}
|
|
6894
7126
|
}
|
|
6895
7127
|
},
|
|
7128
|
+
"/agents/{id}/github-reconcile/plan": {
|
|
7129
|
+
"post": {
|
|
7130
|
+
"summary": "Plan a GitHub repo reconcile for the agent",
|
|
7131
|
+
"description": "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.",
|
|
7132
|
+
"parameters": [
|
|
7133
|
+
{
|
|
7134
|
+
"schema": {
|
|
7135
|
+
"type": "string",
|
|
7136
|
+
"example": "clx1234567890"
|
|
7137
|
+
},
|
|
7138
|
+
"required": true,
|
|
7139
|
+
"name": "id",
|
|
7140
|
+
"in": "path"
|
|
7141
|
+
}
|
|
7142
|
+
],
|
|
7143
|
+
"requestBody": {
|
|
7144
|
+
"required": false,
|
|
7145
|
+
"content": {
|
|
7146
|
+
"application/json": {
|
|
7147
|
+
"schema": {
|
|
7148
|
+
"$ref": "#/components/schemas/GithubReconcilePlanBody"
|
|
7149
|
+
}
|
|
7150
|
+
}
|
|
7151
|
+
}
|
|
7152
|
+
},
|
|
7153
|
+
"responses": {
|
|
7154
|
+
"200": {
|
|
7155
|
+
"description": "Reconcile plan",
|
|
7156
|
+
"content": {
|
|
7157
|
+
"application/json": {
|
|
7158
|
+
"schema": {
|
|
7159
|
+
"$ref": "#/components/schemas/GithubReconcilePlanResult"
|
|
7160
|
+
}
|
|
7161
|
+
}
|
|
7162
|
+
}
|
|
7163
|
+
},
|
|
7164
|
+
"401": {
|
|
7165
|
+
"description": "Unauthorized",
|
|
7166
|
+
"content": {
|
|
7167
|
+
"application/json": {
|
|
7168
|
+
"schema": {
|
|
7169
|
+
"$ref": "#/components/schemas/Error"
|
|
7170
|
+
}
|
|
7171
|
+
}
|
|
7172
|
+
}
|
|
7173
|
+
},
|
|
7174
|
+
"403": {
|
|
7175
|
+
"description": "Platform admin required",
|
|
7176
|
+
"content": {
|
|
7177
|
+
"application/json": {
|
|
7178
|
+
"schema": {
|
|
7179
|
+
"$ref": "#/components/schemas/Error"
|
|
7180
|
+
}
|
|
7181
|
+
}
|
|
7182
|
+
}
|
|
7183
|
+
},
|
|
7184
|
+
"404": {
|
|
7185
|
+
"description": "Agent not found",
|
|
7186
|
+
"content": {
|
|
7187
|
+
"application/json": {
|
|
7188
|
+
"schema": {
|
|
7189
|
+
"$ref": "#/components/schemas/Error"
|
|
7190
|
+
}
|
|
7191
|
+
}
|
|
7192
|
+
}
|
|
7193
|
+
}
|
|
7194
|
+
}
|
|
7195
|
+
}
|
|
7196
|
+
},
|
|
7197
|
+
"/agents/{id}/github-reconcile/apply": {
|
|
7198
|
+
"post": {
|
|
7199
|
+
"summary": "Apply a reviewed GitHub repo reconcile plan",
|
|
7200
|
+
"description": "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.",
|
|
7201
|
+
"parameters": [
|
|
7202
|
+
{
|
|
7203
|
+
"schema": {
|
|
7204
|
+
"type": "string",
|
|
7205
|
+
"example": "clx1234567890"
|
|
7206
|
+
},
|
|
7207
|
+
"required": true,
|
|
7208
|
+
"name": "id",
|
|
7209
|
+
"in": "path"
|
|
7210
|
+
}
|
|
7211
|
+
],
|
|
7212
|
+
"requestBody": {
|
|
7213
|
+
"required": true,
|
|
7214
|
+
"content": {
|
|
7215
|
+
"application/json": {
|
|
7216
|
+
"schema": {
|
|
7217
|
+
"$ref": "#/components/schemas/GithubReconcileApplyBody"
|
|
7218
|
+
}
|
|
7219
|
+
}
|
|
7220
|
+
}
|
|
7221
|
+
},
|
|
7222
|
+
"responses": {
|
|
7223
|
+
"200": {
|
|
7224
|
+
"description": "Apply result",
|
|
7225
|
+
"content": {
|
|
7226
|
+
"application/json": {
|
|
7227
|
+
"schema": {
|
|
7228
|
+
"$ref": "#/components/schemas/GithubReconcileApplyResult"
|
|
7229
|
+
}
|
|
7230
|
+
}
|
|
7231
|
+
}
|
|
7232
|
+
},
|
|
7233
|
+
"401": {
|
|
7234
|
+
"description": "Unauthorized",
|
|
7235
|
+
"content": {
|
|
7236
|
+
"application/json": {
|
|
7237
|
+
"schema": {
|
|
7238
|
+
"$ref": "#/components/schemas/Error"
|
|
7239
|
+
}
|
|
7240
|
+
}
|
|
7241
|
+
}
|
|
7242
|
+
},
|
|
7243
|
+
"403": {
|
|
7244
|
+
"description": "Platform admin required",
|
|
7245
|
+
"content": {
|
|
7246
|
+
"application/json": {
|
|
7247
|
+
"schema": {
|
|
7248
|
+
"$ref": "#/components/schemas/Error"
|
|
7249
|
+
}
|
|
7250
|
+
}
|
|
7251
|
+
}
|
|
7252
|
+
},
|
|
7253
|
+
"404": {
|
|
7254
|
+
"description": "Agent not found",
|
|
7255
|
+
"content": {
|
|
7256
|
+
"application/json": {
|
|
7257
|
+
"schema": {
|
|
7258
|
+
"$ref": "#/components/schemas/Error"
|
|
7259
|
+
}
|
|
7260
|
+
}
|
|
7261
|
+
}
|
|
7262
|
+
},
|
|
7263
|
+
"409": {
|
|
7264
|
+
"description": "Plan hash is stale; re-plan",
|
|
7265
|
+
"content": {
|
|
7266
|
+
"application/json": {
|
|
7267
|
+
"schema": {
|
|
7268
|
+
"$ref": "#/components/schemas/Error"
|
|
7269
|
+
}
|
|
7270
|
+
}
|
|
7271
|
+
}
|
|
7272
|
+
},
|
|
7273
|
+
"422": {
|
|
7274
|
+
"description": "Removal cap needs confirmRemovals",
|
|
7275
|
+
"content": {
|
|
7276
|
+
"application/json": {
|
|
7277
|
+
"schema": {
|
|
7278
|
+
"$ref": "#/components/schemas/Error"
|
|
7279
|
+
}
|
|
7280
|
+
}
|
|
7281
|
+
}
|
|
7282
|
+
}
|
|
7283
|
+
}
|
|
7284
|
+
}
|
|
7285
|
+
},
|
|
6896
7286
|
"/agents/{id}/config": {
|
|
6897
7287
|
"get": {
|
|
6898
7288
|
"tags": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@app-vitals/agent-admin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.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.29.0",
|
|
46
46
|
"@hono/zod-openapi": "^1.0.0",
|
|
47
47
|
"@prisma/adapter-pg": "^7.10.0",
|
|
48
48
|
"@prisma/client": "^7.10.0",
|