@imenam/mcp-dependabot-tracker 1.0.9 → 1.0.11
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/README.md +69 -18
- package/dist/shared/alerts.d.ts +6 -1
- package/dist/shared/alerts.js +7 -0
- package/dist/shared/schemas/api.schema.d.ts +45 -10
- package/dist/shared/schemas/api.schema.js +5 -1
- package/dist/shared/schemas/ipc.schema.d.ts +1 -1
- package/dist/shared/schemas/ipc.schema.js +5 -0
- package/dist/shared/schemas/model.schema.d.ts +259 -7
- package/dist/shared/schemas/model.schema.js +95 -8
- package/dist/shared/schemas/settings.schema.d.ts +78 -0
- package/dist/shared/schemas/settings.schema.js +42 -0
- package/dist/src/core/analysis.d.ts +54 -0
- package/dist/src/core/analysis.js +180 -0
- package/dist/src/core/audit-all.d.ts +6 -6
- package/dist/src/core/audit-all.js +6 -6
- package/dist/src/core/claude.d.ts +45 -0
- package/dist/src/core/claude.js +200 -0
- package/dist/src/core/commands.d.ts +2 -0
- package/dist/src/core/commands.js +1 -1
- package/dist/src/core/github.js +2 -1
- package/dist/src/core/operations.d.ts +27 -12
- package/dist/src/core/operations.js +282 -42
- package/dist/src/core/organizer.d.ts +57 -0
- package/dist/src/core/organizer.js +110 -0
- package/dist/src/core/repair.d.ts +31 -0
- package/dist/src/core/repair.js +150 -0
- package/dist/src/core/repos.d.ts +14 -9
- package/dist/src/core/repos.js +45 -20
- package/dist/src/core/settings.d.ts +21 -0
- package/dist/src/core/settings.js +108 -0
- package/dist/src/core/store.d.ts +2 -0
- package/dist/src/core/store.js +20 -6
- package/dist/src/gui-worker.js +29 -3
- package/dist/src/index.js +47 -9
- package/dist/src/tools/format.js +20 -8
- package/dist/src/tools/tools.js +8 -6
- package/dist/src/tools/types.d.ts +2 -0
- package/dist/src/tools/types.js +9 -0
- package/gui/dist/assets/index-CPYr3dz7.css +1 -0
- package/gui/dist/assets/index-CSbeloLm.js +64 -0
- package/gui/dist/index.html +2 -2
- package/package.json +2 -1
- package/gui/dist/assets/index-BdMhGHUf.css +0 -1
- package/gui/dist/assets/index-CIIsKFR9.js +0 -64
package/dist/src/gui-worker.js
CHANGED
|
@@ -6,7 +6,8 @@ import path from "path";
|
|
|
6
6
|
import fs from "fs";
|
|
7
7
|
import { fileURLToPath } from "url";
|
|
8
8
|
import { IPCMessageSchema } from "../shared/schemas/ipc.schema.js";
|
|
9
|
-
import { AddRepoBodySchema, CategoryBodySchema, ForceBodySchema, PushBodySchema, SetBranchBodySchema, SetCategoryBodySchema, SetRightsBodySchema } from "../shared/schemas/api.schema.js";
|
|
9
|
+
import { AddRepoBodySchema, CategoryBodySchema, ForceBodySchema, PushBodySchema, RepairBodySchema, ScopeBodySchema, SetBranchBodySchema, SetCategoryBodySchema, SetRightsBodySchema } from "../shared/schemas/api.schema.js";
|
|
10
|
+
import { SaveSettingsBodySchema } from "../shared/schemas/settings.schema.js";
|
|
10
11
|
import { resolveLogDir } from "./core/log-dir.js";
|
|
11
12
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
12
13
|
function findProjectRoot(startDir) {
|
|
@@ -197,7 +198,12 @@ app.post("/api/repos", async (c) => {
|
|
|
197
198
|
});
|
|
198
199
|
app.post("/api/sync", (c) => forward(c, "SYNC_REPOS"));
|
|
199
200
|
app.get("/api/audit-all", (c) => forward(c, "GET_AUDIT_ALL"));
|
|
200
|
-
app.post("/api/audit-all", (c) =>
|
|
201
|
+
app.post("/api/audit-all", async (c) => {
|
|
202
|
+
const read = await readBody(c, ScopeBodySchema);
|
|
203
|
+
if ("response" in read)
|
|
204
|
+
return read.response;
|
|
205
|
+
return forward(c, "START_AUDIT_ALL", { body: read.body });
|
|
206
|
+
});
|
|
201
207
|
app.get("/api/github/repos", (c) => forward(c, "LIST_ADDABLE_REPOS"));
|
|
202
208
|
app.get("/api/repos/:owner/:name", (c) => forward(c, "GET_REPO", { repoId: repoId(c) }));
|
|
203
209
|
app.delete("/api/repos/:owner/:name", (c) => forward(c, "REMOVE_REPO", { repoId: repoId(c) }));
|
|
@@ -238,7 +244,12 @@ app.put("/api/categories/:id", async (c) => {
|
|
|
238
244
|
return forward(c, "RENAME_CATEGORY", { categoryId: c.req.param("id"), body: read.body });
|
|
239
245
|
});
|
|
240
246
|
app.delete("/api/categories/:id", (c) => forward(c, "DELETE_CATEGORY", { categoryId: c.req.param("id") }));
|
|
241
|
-
app.post("/api/repos/:owner/:name/operations", (c) =>
|
|
247
|
+
app.post("/api/repos/:owner/:name/operations", async (c) => {
|
|
248
|
+
const read = await readBody(c, ScopeBodySchema);
|
|
249
|
+
if ("response" in read)
|
|
250
|
+
return read.response;
|
|
251
|
+
return forward(c, "START_FIX", { repoId: repoId(c), body: read.body });
|
|
252
|
+
});
|
|
242
253
|
app.get("/api/operations/:id", (c) => forward(c, "GET_OPERATION", { operationId: c.req.param("id") }));
|
|
243
254
|
app.post("/api/operations/:id/force", async (c) => {
|
|
244
255
|
const read = await readBody(c, ForceBodySchema);
|
|
@@ -246,6 +257,13 @@ app.post("/api/operations/:id/force", async (c) => {
|
|
|
246
257
|
return read.response;
|
|
247
258
|
return forward(c, "DECIDE_FORCE", { operationId: c.req.param("id"), body: read.body });
|
|
248
259
|
});
|
|
260
|
+
app.post("/api/operations/:id/repair", async (c) => {
|
|
261
|
+
const read = await readBody(c, RepairBodySchema);
|
|
262
|
+
if ("response" in read)
|
|
263
|
+
return read.response;
|
|
264
|
+
return forward(c, "DECIDE_REPAIR", { operationId: c.req.param("id"), body: read.body });
|
|
265
|
+
});
|
|
266
|
+
app.get("/api/operations/:id/remarks", (c) => forward(c, "GET_REMARKS", { operationId: c.req.param("id") }));
|
|
249
267
|
app.post("/api/operations/:id/push", async (c) => {
|
|
250
268
|
const read = await readBody(c, PushBodySchema);
|
|
251
269
|
if ("response" in read)
|
|
@@ -253,6 +271,14 @@ app.post("/api/operations/:id/push", async (c) => {
|
|
|
253
271
|
return forward(c, "PUSH_OPERATION", { operationId: c.req.param("id"), body: read.body });
|
|
254
272
|
});
|
|
255
273
|
app.post("/api/operations/:id/cancel", (c) => forward(c, "CANCEL_OPERATION", { operationId: c.req.param("id") }));
|
|
274
|
+
app.get("/api/settings", (c) => forward(c, "GET_SETTINGS"));
|
|
275
|
+
app.put("/api/settings", async (c) => {
|
|
276
|
+
const read = await readBody(c, SaveSettingsBodySchema);
|
|
277
|
+
if ("response" in read)
|
|
278
|
+
return read.response;
|
|
279
|
+
return forward(c, "SAVE_SETTINGS", { body: read.body });
|
|
280
|
+
});
|
|
281
|
+
app.post("/api/settings/organizer/test", (c) => forward(c, "TEST_ORGANIZER"));
|
|
256
282
|
/** Route d'API inconnue : 404 explicite plutôt que la page de la SPA. */
|
|
257
283
|
app.all("/api/*", (c) => c.json({ error: `Unknown API route: ${c.req.method} ${c.req.path}` }, 404));
|
|
258
284
|
// Fichiers statiques de la SPA
|
package/dist/src/index.js
CHANGED
|
@@ -13,11 +13,18 @@ import { resolveLogDir } from "./core/log-dir.js";
|
|
|
13
13
|
import { githubConfigured, readGitHubConfig } from "./core/config.js";
|
|
14
14
|
import { ConflictError, NotFoundError, TrackerError } from "./core/errors.js";
|
|
15
15
|
import { Store } from "./core/store.js";
|
|
16
|
-
import { cancelOperation, decideForce, pushOperation, runDefaultBranchAudit, startUserFix } from "./core/operations.js";
|
|
16
|
+
import { cancelOperation, decideForce, decideRepair, pushOperation, runDefaultBranchAudit, startUserFix } from "./core/operations.js";
|
|
17
17
|
import { AuditAll } from "./core/audit-all.js";
|
|
18
|
+
import { refreshAnalysisTask } from "./core/analysis.js";
|
|
19
|
+
import { analysisRemarks } from "./core/repair.js";
|
|
20
|
+
import { checkClaudeToken, packagedClaudeCommand } from "./core/claude.js";
|
|
21
|
+
import { OrganizerClient } from "./core/organizer.js";
|
|
22
|
+
import { readSettings, saveSettings, settingsView, testOrganizer } from "./core/settings.js";
|
|
23
|
+
import { SaveSettingsBodySchema } from "../shared/schemas/settings.schema.js";
|
|
24
|
+
import { AUDIT_SCOPES } from "../shared/schemas/model.schema.js";
|
|
18
25
|
import { SYNC_INTERVAL_MS, activeRepos, addRepository, deprecateRepository, listAddableRepositories, restoreRepository, listRepoBranches, listRepoViews, markAlertHandled, setBranch, setCategory, repoView, setRights, staleRepos, syncAllRepositories, syncRepository, unmarkAlertHandled } from "./core/repos.js";
|
|
19
26
|
import { GUI_REQUEST_TYPES, IPCMessageSchema } from "../shared/schemas/ipc.schema.js";
|
|
20
|
-
import { AddRepoBodySchema, AlertRequestSchema, CategoryBodySchema, CategoryRequestSchema, ForceBodySchema, OperationRequestSchema, PushBodySchema, RepoRequestSchema, SetBranchBodySchema, SetCategoryBodySchema, SetRightsBodySchema, } from "../shared/schemas/api.schema.js";
|
|
27
|
+
import { AddRepoBodySchema, AlertRequestSchema, CategoryBodySchema, CategoryRequestSchema, ForceBodySchema, OperationRequestSchema, PushBodySchema, RepairBodySchema, RepoRequestSchema, ScopeBodySchema, SetBranchBodySchema, SetCategoryBodySchema, SetRightsBodySchema, } from "../shared/schemas/api.schema.js";
|
|
21
28
|
import { errorResult, textResult } from "./tools/types.js";
|
|
22
29
|
import { fixVulnerabilities, getAlerts, listRepositories, runAudit } from "./tools/tools.js";
|
|
23
30
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -66,14 +73,22 @@ catch (err) {
|
|
|
66
73
|
}
|
|
67
74
|
const dataDir = resolveDataDir();
|
|
68
75
|
const store = new Store(dataDir);
|
|
76
|
+
/** Claude Code du paquet, configuré dans `<données>/claude`. */
|
|
77
|
+
const claude = { command: packagedClaudeCommand(), home: path.join(dataDir, "claude") };
|
|
78
|
+
const settingsChecks = {
|
|
79
|
+
organizer: (connection) => new OrganizerClient(connection).space(),
|
|
80
|
+
claudeToken: (token) => checkClaudeToken(claude, token),
|
|
81
|
+
};
|
|
69
82
|
const operations = {
|
|
70
83
|
store,
|
|
71
84
|
githubConfig: readGitHubConfig,
|
|
72
85
|
cloneDir: resolveCloneDir,
|
|
73
86
|
logError: (message) => logger.error(message),
|
|
87
|
+
settings: () => readSettings(dataDir),
|
|
88
|
+
claude,
|
|
74
89
|
};
|
|
75
90
|
/** Série « Auditer tout » de la GUI servie par ce processus. */
|
|
76
|
-
const auditAll = new AuditAll((repoId) => runDefaultBranchAudit(operations, repoId), (message) => logger.error(message));
|
|
91
|
+
const auditAll = new AuditAll((repoId, scope) => runDefaultBranchAudit(operations, repoId, scope), (message) => logger.error(message));
|
|
77
92
|
/** Présentation du serveur transmise au client MCP : concepts, déroulé et règles. */
|
|
78
93
|
const INSTRUCTIONS = `mcp-dependabot-tracker follows the Dependabot alerts of GitHub repositories and fixes their npm vulnerabilities. The user tracks repositories and decides what you may do on each of them in a web GUI; you act only through these tools, never with git or npm yourself.
|
|
79
94
|
|
|
@@ -81,13 +96,14 @@ Concepts:
|
|
|
81
96
|
- A **tracked repository** is a GitHub repository the user added in the GUI. Its open Dependabot alerts, and the pull requests the tracker opened that are not merged or closed yet, are read from GitHub and refreshed every 10 minutes.
|
|
82
97
|
- A **deprecated repository** is one the user set aside in the GUI: it is neither synced nor audited, list_repositories leaves it out, and every tool refuses it until the user restores it.
|
|
83
98
|
- **Rights**: for each repository, the user allows you to run npm audit (audit), npm audit fix (fix), npm audit fix --force (force) and to push the fixes (push). A tool refuses an action you are not allowed to do; only the user can change the rights.
|
|
99
|
+
- The **scope** of an audit is chosen at each launch: production (the default) runs npm audit and npm audit fix with --omit=dev, so the devDependencies are left out; all covers every dependency. Each Dependabot alert says whether its dependency is a runtime or a development one.
|
|
84
100
|
- The **analysed branch** of a repository is chosen by the user in the GUI (the default branch unless changed). Dependabot alerts always describe the default branch; npm audit describes the analysed branch.
|
|
85
101
|
- An **operation** runs in a temporary clone of the analysed branch, deleted at the end: npm audit in every directory that holds a package-lock.json, then npm audit fix with --package-lock-only and --ignore-scripts (lockfiles only, no install, no scripts), optionally --force, then a commit on a new branch fix/npm-audit-<date>-<time> and a pull request to the analysed branch.
|
|
86
102
|
|
|
87
103
|
Workflow:
|
|
88
104
|
1. list_repositories to see the tracked repositories, their open alerts and your rights.
|
|
89
105
|
2. get_alerts for the detail of the alerts of one repository.
|
|
90
|
-
3. run_audit to see what npm audit reports, or fix_vulnerabilities to fix: without push, nothing leaves the temporary clone and the result shows what the fixes would change; with push, the fixes are pushed and the pull request is opened.
|
|
106
|
+
3. run_audit to see what npm audit reports, or fix_vulnerabilities to fix, on the production dependencies unless the user asks for all of them: without push, nothing leaves the temporary clone and the result shows what the fixes would change; with push, the fixes are pushed and the pull request is opened.
|
|
91
107
|
|
|
92
108
|
Rules:
|
|
93
109
|
- An operation runs until it ends; one operation at a time per repository.
|
|
@@ -144,7 +160,7 @@ async function handleGuiRequest(msg) {
|
|
|
144
160
|
case "START_AUDIT_ALL":
|
|
145
161
|
readGitHubConfig();
|
|
146
162
|
store.failOrphanedOperations();
|
|
147
|
-
return { auditAll: auditAll.start(activeRepos(store).map((repo) => repo.id)) };
|
|
163
|
+
return { auditAll: auditAll.start(activeRepos(store).map((repo) => repo.id), parseRequest(ScopeBodySchema, msg.data?.body).scope) };
|
|
148
164
|
case "LIST_ADDABLE_REPOS":
|
|
149
165
|
return { repositories: await listAddableRepositories(store, readGitHubConfig()) };
|
|
150
166
|
case "GET_REPO": {
|
|
@@ -201,7 +217,7 @@ async function handleGuiRequest(msg) {
|
|
|
201
217
|
store.deleteCategory(parseRequest(CategoryRequestSchema, msg.data).categoryId);
|
|
202
218
|
return { deleted: true };
|
|
203
219
|
case "START_FIX":
|
|
204
|
-
return { operation: startUserFix(operations, parseRequest(RepoRequestSchema, msg.data).repoId) };
|
|
220
|
+
return { operation: startUserFix(operations, parseRequest(RepoRequestSchema, msg.data).repoId, parseRequest(ScopeBodySchema, msg.data?.body).scope) };
|
|
205
221
|
case "GET_OPERATION": {
|
|
206
222
|
store.failOrphanedOperations();
|
|
207
223
|
return { operation: store.getOperation(parseRequest(OperationRequestSchema, msg.data).operationId) };
|
|
@@ -210,12 +226,24 @@ async function handleGuiRequest(msg) {
|
|
|
210
226
|
const { operationId } = parseRequest(OperationRequestSchema, msg.data);
|
|
211
227
|
return { operation: decideForce(operations, operationId, parseRequest(ForceBodySchema, msg.data?.body).apply) };
|
|
212
228
|
}
|
|
229
|
+
case "DECIDE_REPAIR": {
|
|
230
|
+
const { operationId } = parseRequest(OperationRequestSchema, msg.data);
|
|
231
|
+
return { operation: decideRepair(operations, operationId, parseRequest(RepairBodySchema, msg.data?.body).run) };
|
|
232
|
+
}
|
|
233
|
+
case "GET_REMARKS":
|
|
234
|
+
return await analysisRemarks(readSettings(dataDir), store.getOperation(parseRequest(OperationRequestSchema, msg.data).operationId));
|
|
213
235
|
case "PUSH_OPERATION": {
|
|
214
236
|
const { operationId } = parseRequest(OperationRequestSchema, msg.data);
|
|
215
237
|
return { operation: pushOperation(operations, operationId, parseRequest(PushBodySchema, msg.data?.body).commitMessage) };
|
|
216
238
|
}
|
|
217
239
|
case "CANCEL_OPERATION":
|
|
218
240
|
return { operation: cancelOperation(operations, parseRequest(OperationRequestSchema, msg.data).operationId) };
|
|
241
|
+
case "GET_SETTINGS":
|
|
242
|
+
return settingsView(readSettings(dataDir));
|
|
243
|
+
case "SAVE_SETTINGS":
|
|
244
|
+
return saveSettings(dataDir, parseRequest(SaveSettingsBodySchema, msg.data?.body), settingsChecks);
|
|
245
|
+
case "TEST_ORGANIZER":
|
|
246
|
+
return testOrganizer(dataDir, settingsChecks);
|
|
219
247
|
default:
|
|
220
248
|
throw new Error(`GUI request ${msg.type} has no handler.`);
|
|
221
249
|
}
|
|
@@ -292,7 +320,10 @@ async function reconnectGui(args) {
|
|
|
292
320
|
// --- Synchronisation des alertes ---------------------------------------------------
|
|
293
321
|
const SYNC_CHECK_MS = 60_000;
|
|
294
322
|
let syncing = false;
|
|
295
|
-
/**
|
|
323
|
+
/**
|
|
324
|
+
* Relit les alertes des dépôts dont la dernière lecture date de plus de 10
|
|
325
|
+
* minutes, et le statut de la tâche organizer de leur dernière analyse.
|
|
326
|
+
*/
|
|
296
327
|
async function syncStaleRepos() {
|
|
297
328
|
if (syncing || !githubConfigured())
|
|
298
329
|
return;
|
|
@@ -303,6 +334,7 @@ async function syncStaleRepos() {
|
|
|
303
334
|
const synced = await syncRepository(store, config, repo.id);
|
|
304
335
|
if (synced.syncError)
|
|
305
336
|
logger.warn(`Dependabot alerts of ${repo.id} not synced: ${synced.syncError}`);
|
|
337
|
+
await refreshAnalysisTask(store, readSettings(dataDir), repo.id).catch((err) => logger.warn(`Organizer task of ${repo.id} not refreshed: ${err?.message ?? err}`));
|
|
306
338
|
}
|
|
307
339
|
}
|
|
308
340
|
catch (err) {
|
|
@@ -314,6 +346,11 @@ async function syncStaleRepos() {
|
|
|
314
346
|
}
|
|
315
347
|
// --- Outils -------------------------------------------------------------------
|
|
316
348
|
const REPOSITORY_DOC = "Tracked repository, as owner/name (see list_repositories).";
|
|
349
|
+
const SCOPE_PROPERTY = {
|
|
350
|
+
type: "string",
|
|
351
|
+
enum: [...AUDIT_SCOPES],
|
|
352
|
+
description: "production (default): npm audit and its fixes run with --omit=dev and leave the devDependencies out. all: every dependency, devDependencies included.",
|
|
353
|
+
};
|
|
317
354
|
const TOOLS = [
|
|
318
355
|
{
|
|
319
356
|
name: "list_repositories",
|
|
@@ -325,7 +362,7 @@ const TOOLS = [
|
|
|
325
362
|
},
|
|
326
363
|
{
|
|
327
364
|
name: "get_alerts",
|
|
328
|
-
description: "Read the open Dependabot alerts of a tracked repository from GitHub now, and list them from the most to the least severe: number, severity, package, ecosystem, manifest, summary, patched version and link.",
|
|
365
|
+
description: "Read the open Dependabot alerts of a tracked repository from GitHub now, and list them from the most to the least severe: number, severity, package, ecosystem, manifest, whether the dependency is a runtime or a development one, summary, patched version and link.",
|
|
329
366
|
inputSchema: {
|
|
330
367
|
type: "object",
|
|
331
368
|
properties: { repository: { type: "string", description: REPOSITORY_DOC } },
|
|
@@ -337,7 +374,7 @@ const TOOLS = [
|
|
|
337
374
|
description: "Run npm audit on a temporary clone of the analysed branch, in every directory that holds a package-lock.json, and report the vulnerabilities with the fix npm proposes (none, within the declared ranges, or a major upgrade that needs --force). Needs the audit right. Nothing is changed; the clone is deleted.",
|
|
338
375
|
inputSchema: {
|
|
339
376
|
type: "object",
|
|
340
|
-
properties: { repository: { type: "string", description: REPOSITORY_DOC } },
|
|
377
|
+
properties: { repository: { type: "string", description: REPOSITORY_DOC }, scope: SCOPE_PROPERTY },
|
|
341
378
|
required: ["repository"],
|
|
342
379
|
},
|
|
343
380
|
},
|
|
@@ -349,6 +386,7 @@ const TOOLS = [
|
|
|
349
386
|
type: "object",
|
|
350
387
|
properties: {
|
|
351
388
|
repository: { type: "string", description: REPOSITORY_DOC },
|
|
389
|
+
scope: SCOPE_PROPERTY,
|
|
352
390
|
force: {
|
|
353
391
|
type: "boolean",
|
|
354
392
|
description: "Also run npm audit fix --force when vulnerabilities remain that only a major upgrade fixes (default false). Breaking changes possible: only when the user asked for it.",
|
package/dist/src/tools/format.js
CHANGED
|
@@ -8,7 +8,14 @@ export function rightsLabel(repo) {
|
|
|
8
8
|
const allowed = RIGHTS.filter((right) => repo.rights[right]);
|
|
9
9
|
return allowed.length === 0 ? "none" : allowed.join(", ");
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
11
|
+
/** Périmètre d'un audit, en clair. */
|
|
12
|
+
function scopeLabel(scope) {
|
|
13
|
+
return scope === "production" ? "production dependencies" : "all dependencies";
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Alertes restantes par gravité, dont celles qui portent sur une dépendance de
|
|
17
|
+
* développement, et le nombre de celles que l'utilisateur a corrigées à la main.
|
|
18
|
+
*/
|
|
12
19
|
function alertsLabel(repo) {
|
|
13
20
|
const pending = pendingAlerts(repo);
|
|
14
21
|
const handled = repo.alerts.length - pending.length;
|
|
@@ -17,7 +24,9 @@ function alertsLabel(repo) {
|
|
|
17
24
|
return `none${handledNote}`;
|
|
18
25
|
const counts = countBySeverity(pending);
|
|
19
26
|
const detail = ALERT_SEVERITIES.filter((severity) => counts[severity] > 0).map((severity) => `${severity} ${counts[severity]}`);
|
|
20
|
-
|
|
27
|
+
const development = pending.filter((alert) => alert.scope === "development").length;
|
|
28
|
+
const developmentNote = development > 0 ? `; ${development} on development dependencies` : "";
|
|
29
|
+
return `${pending.length} (${detail.join(", ")}${developmentNote})${handledNote}`;
|
|
21
30
|
}
|
|
22
31
|
/** Description d'un dépôt pour l'agent ; `category` est la catégorie où l'utilisateur l'a rangé. */
|
|
23
32
|
export function describeRepo(view, category) {
|
|
@@ -34,12 +43,14 @@ export function describeRepo(view, category) {
|
|
|
34
43
|
}
|
|
35
44
|
if (view.unfixable.length > 0)
|
|
36
45
|
lines.push(` Last npm audit found no published fix for: ${view.unfixable.join(", ")}`);
|
|
37
|
-
if (view.
|
|
38
|
-
|
|
46
|
+
if (view.cleanAudit) {
|
|
47
|
+
const { at, scope } = view.cleanAudit;
|
|
48
|
+
const alerts = scope === "production" ? "the Dependabot alerts on production dependencies" : "these Dependabot alerts";
|
|
49
|
+
lines.push(` npm audit of ${at} (${scopeLabel(scope)}) found no vulnerability on the default branch: ${alerts} are probably not refreshed yet.`);
|
|
39
50
|
}
|
|
40
51
|
if (view.auditFindings) {
|
|
41
|
-
const { at, count, severity } = view.auditFindings;
|
|
42
|
-
lines.push(` npm audit of ${at} found ${count} vulnerabilit${count === 1 ? "y" : "ies"} (worst: ${severity}) on the default branch although Dependabot reports none: Dependabot has probably not caught up yet.`);
|
|
52
|
+
const { at, scope, count, severity } = view.auditFindings;
|
|
53
|
+
lines.push(` npm audit of ${at} (${scopeLabel(scope)}) found ${count} vulnerabilit${count === 1 ? "y" : "ies"} (worst: ${severity}) on the default branch although Dependabot reports none there: Dependabot has probably not caught up yet.`);
|
|
43
54
|
}
|
|
44
55
|
lines.push(` Agent rights: ${rightsLabel(repo)}`);
|
|
45
56
|
if (activeOperation)
|
|
@@ -52,7 +63,8 @@ export function describeAlerts(repo) {
|
|
|
52
63
|
const patched = alert.patchedVersion ? ` — patched in ${alert.patchedVersion}` : " — no patched version";
|
|
53
64
|
const mark = repo.handledAlerts.find((candidate) => candidate.number === alert.number);
|
|
54
65
|
const handled = mark ? ` — fixed by hand by the user on ${mark.markedAt}` : "";
|
|
55
|
-
|
|
66
|
+
const scope = alert.scope ? `, ${alert.scope} dependency` : "";
|
|
67
|
+
return `- #${alert.number} ${alert.severity} ${alert.package} (${alert.ecosystem}, ${alert.manifestPath}${scope}): ${alert.summary}${patched}${handled} — ${alert.url}`;
|
|
56
68
|
});
|
|
57
69
|
return [header, ...lines].join("\n");
|
|
58
70
|
}
|
|
@@ -65,7 +77,7 @@ function list(items, render) {
|
|
|
65
77
|
/** Compte rendu d'une opération pour l'agent : étapes, vulnérabilités, paquets modifiés, PR, erreur. */
|
|
66
78
|
export function describeOperation(operation) {
|
|
67
79
|
const title = operation.kind === "audit" ? "npm audit" : "npm audit fix";
|
|
68
|
-
const lines = [`${title} on ${operation.repoId} (operation ${operation.id}): ${operation.status}.`];
|
|
80
|
+
const lines = [`${title} on ${operation.repoId}, ${scopeLabel(operation.scope)} (operation ${operation.id}): ${operation.status}.`];
|
|
69
81
|
if (operation.projects.length > 0) {
|
|
70
82
|
lines.push(`- npm projects: ${operation.projects.map((project) => projectLabel(project) || "./").join(", ")}`);
|
|
71
83
|
}
|
package/dist/src/tools/tools.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { DEFAULT_COMMIT_MESSAGE } from "../../shared/schemas/model.schema.js";
|
|
1
|
+
import { AUDIT_SCOPES, DEFAULT_AUDIT_SCOPE, DEFAULT_COMMIT_MESSAGE } from "../../shared/schemas/model.schema.js";
|
|
2
2
|
import { TrackerError } from "../core/errors.js";
|
|
3
3
|
import { runAgentOperation } from "../core/operations.js";
|
|
4
4
|
import { listRepoViews, repoView, syncRepository } from "../core/repos.js";
|
|
5
5
|
import { describeAlerts, describeOperation, describeRepo } from "./format.js";
|
|
6
|
-
import { errorResult, optionalBoolean, optionalString, rejectUnknownFields, requireString, textResult } from "./types.js";
|
|
6
|
+
import { errorResult, optionalBoolean, optionalEnum, optionalString, rejectUnknownFields, requireString, textResult } from "./types.js";
|
|
7
7
|
const RIGHT_LABELS = {
|
|
8
8
|
audit: "run npm audit",
|
|
9
9
|
fix: "run npm audit fix",
|
|
@@ -51,14 +51,16 @@ function operationResult(operation) {
|
|
|
51
51
|
return { result: operation.status === "done" ? textResult(text) : errorResult(text), operation };
|
|
52
52
|
}
|
|
53
53
|
export async function runAudit(ctx, args) {
|
|
54
|
-
rejectUnknownFields(args, ["repository"]);
|
|
54
|
+
rejectUnknownFields(args, ["repository", "scope"]);
|
|
55
55
|
const repo = ctx.store.getRepo(requireString(args, "repository"));
|
|
56
|
+
const scope = optionalEnum(args, "scope", AUDIT_SCOPES, DEFAULT_AUDIT_SCOPE);
|
|
56
57
|
assertAllowed(repo, "audit");
|
|
57
|
-
return operationResult(await runAgentOperation(ctx, repo.id, "audit", { force: false, push: false, commitMessage: DEFAULT_COMMIT_MESSAGE }));
|
|
58
|
+
return operationResult(await runAgentOperation(ctx, repo.id, "audit", { scope, force: false, push: false, commitMessage: DEFAULT_COMMIT_MESSAGE }));
|
|
58
59
|
}
|
|
59
60
|
export async function fixVulnerabilities(ctx, args) {
|
|
60
|
-
rejectUnknownFields(args, ["repository", "force", "push", "commit_message"]);
|
|
61
|
+
rejectUnknownFields(args, ["repository", "scope", "force", "push", "commit_message"]);
|
|
61
62
|
const repo = ctx.store.getRepo(requireString(args, "repository"));
|
|
63
|
+
const scope = optionalEnum(args, "scope", AUDIT_SCOPES, DEFAULT_AUDIT_SCOPE);
|
|
62
64
|
const force = optionalBoolean(args, "force", false);
|
|
63
65
|
const push = optionalBoolean(args, "push", false);
|
|
64
66
|
const commitMessage = optionalString(args, "commit_message") ?? DEFAULT_COMMIT_MESSAGE;
|
|
@@ -67,5 +69,5 @@ export async function fixVulnerabilities(ctx, args) {
|
|
|
67
69
|
assertAllowed(repo, "force");
|
|
68
70
|
if (push)
|
|
69
71
|
assertAllowed(repo, "push");
|
|
70
|
-
return operationResult(await runAgentOperation(ctx, repo.id, "fix", { force, push, commitMessage }));
|
|
72
|
+
return operationResult(await runAgentOperation(ctx, repo.id, "fix", { scope, force, push, commitMessage }));
|
|
71
73
|
}
|
|
@@ -17,5 +17,7 @@ export declare function requireString(args: Args, field: string): string;
|
|
|
17
17
|
export declare function optionalString(args: Args, field: string): string | undefined;
|
|
18
18
|
/** Lit un booléen facultatif ; `fallback` s'il est absent. */
|
|
19
19
|
export declare function optionalBoolean(args: Args, field: string, fallback: boolean): boolean;
|
|
20
|
+
/** Lit un argument facultatif parmi `values` ; `fallback` s'il est absent. */
|
|
21
|
+
export declare function optionalEnum<T extends string>(args: Args, field: string, values: readonly T[], fallback: T): T;
|
|
20
22
|
/** Lève une erreur si `args` contient des champs hors de `allowed` : une faute de frappe ne passe pas inaperçue. */
|
|
21
23
|
export declare function rejectUnknownFields(args: Args, allowed: readonly string[]): void;
|
package/dist/src/tools/types.js
CHANGED
|
@@ -27,6 +27,15 @@ export function optionalBoolean(args, field, fallback) {
|
|
|
27
27
|
throw new Error(`"${field}" must be a boolean (got ${JSON.stringify(value)}).`);
|
|
28
28
|
return value;
|
|
29
29
|
}
|
|
30
|
+
/** Lit un argument facultatif parmi `values` ; `fallback` s'il est absent. */
|
|
31
|
+
export function optionalEnum(args, field, values, fallback) {
|
|
32
|
+
const value = args?.[field];
|
|
33
|
+
if (value === undefined)
|
|
34
|
+
return fallback;
|
|
35
|
+
if (!values.includes(value))
|
|
36
|
+
throw new Error(`"${field}" must be one of ${values.join(", ")} (got ${JSON.stringify(value)}).`);
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
30
39
|
/** Lève une erreur si `args` contient des champs hors de `allowed` : une faute de frappe ne passe pas inaperçue. */
|
|
31
40
|
export function rejectUnknownFields(args, allowed) {
|
|
32
41
|
if (!args)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-cyrillic-wght-normal-DqGufNeO.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-greek-ext-wght-normal-DlzME5K_.woff2)format("woff2-variations");unicode-range:U+1F??}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-greek-wght-normal-CkhJZR-_.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-vietnamese-wght-normal-CBcvBZtf.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-latin-ext-wght-normal-DO1Apj_S.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Inter Variable;font-style:normal;font-display:swap;font-weight:100 900;src:url(./inter-latin-wght-normal-Dx4kXJAl.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(data:font/woff2;base64,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)format("woff2-variations");unicode-range:U+460-52F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(./jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2)format("woff2-variations");unicode-range:U+301,U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(./jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2)format("woff2-variations");unicode-range:U+370-377,U+37A-37F,U+384-38A,U+38C,U+38E-3A1,U+3A3-3FF}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(./jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2)format("woff2-variations");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+300-301,U+303-304,U+308-309,U+323,U+329,U+1EA0-1EF9,U+20AB}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(./jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2)format("woff2-variations");unicode-range:U+100-2BA,U+2BD-2C5,U+2C7-2CC,U+2CE-2D7,U+2DD-2FF,U+304,U+308,U+329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:JetBrains Mono Variable;font-style:normal;font-display:swap;font-weight:100 800;src:url(./jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2)format("woff2-variations");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+304,U+308,U+329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}:root{--bg:#0c0e14;--panel:#0f1118;--surface:#13161f;--surface-raised:#151923;--surface-current:#171b2b;--border:#20242f;--border-strong:#2a2f3d;--divider:#1c2029;--text:#eceef3;--text-strong:#dfe2ea;--text-soft:#c9cedb;--muted:#9aa1b1;--faint:#646b7b;--idle:#3a4050;--accent:#5b6cf5;--accent-hover:#6878ff;--accent-soft:#8b97ff;--brand-bg:#1f2540;--ok:#3fb950;--danger:#f0625a;--warning:#e3a33b;--info:#6aa5ff;--critical-bg:#2a1517;--high-bg:#2a2010;--medium-bg:#142033;--low-bg:#1a1d26;--font-sans:"Inter Variable", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;--font-mono:"JetBrains Mono Variable", "JetBrains Mono", ui-monospace, Consolas, monospace;--topbar-height:60px;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;font-family:var(--font-sans);color:var(--text);-webkit-font-smoothing:antialiased;font-size:14px}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg)}a{color:inherit;text-decoration:none}button{font:inherit;color:inherit;cursor:pointer;background:0 0;border:none;padding:0}button:disabled{cursor:default}h1,h2,p,ul{margin:0}.mono,code,pre{font-family:var(--font-mono);font-variant-ligatures:none}code{color:var(--accent-soft);font-size:12px}.spacer{flex:1}.muted{color:var(--muted)}.error-text{color:var(--danger)}.text-ok{color:var(--ok)}.text-warning{color:var(--warning)}.pre{white-space:pre-wrap;word-break:break-word}.link{color:var(--accent-soft)}.link:hover{color:var(--accent-hover);text-decoration:underline}.spin{animation:1s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.app{flex-direction:column;height:100%;display:flex}.topbar{height:var(--topbar-height);background:var(--panel);border-bottom:1px solid var(--border);flex-shrink:0;align-items:center;gap:12px;padding:0 32px;display:flex}.brand{color:var(--text);align-items:center;gap:12px;font-size:14px;font-weight:500;display:flex}.brand-mark{background:var(--brand-bg);width:28px;height:28px;color:var(--accent-soft);border-radius:7px;justify-content:center;align-items:center;display:inline-flex}.main{flex:1;overflow:auto}.page{width:880px;max-width:calc(100% - 32px);margin:0 auto;padding:32px 0 64px}.page-title{color:var(--text);margin-bottom:18px;font-size:22px;font-weight:600}.page-head{align-items:flex-start;gap:12px;margin-bottom:30px;display:flex}.page-head .page-title{margin-bottom:8px}.page-head-text{flex:1;min-width:0}.back{color:var(--muted);margin-top:5px;display:inline-flex}.back:hover{color:var(--text)}.subtitle{color:var(--faint);font-size:12px}.page-actions{align-items:center;gap:12px;display:flex}.section-label{color:var(--muted);margin-bottom:12px;font-size:13px}.picker{vertical-align:middle;display:inline-block;position:relative}.picker-chip{background:var(--surface);border:1px solid var(--border-strong);height:26px;color:var(--text-strong);border-radius:6px;align-items:center;gap:6px;padding:0 8px;font-size:12px;display:inline-flex}.picker-chip svg:first-child{color:var(--muted)}.picker-chip:hover,.picker-chip[aria-expanded=true]{border-color:var(--idle)}.picker-chevron{color:var(--faint)}.picker-menu{z-index:30;background:var(--surface-raised);border:1px solid var(--border-strong);border-radius:10px;width:280px;padding:8px 6px 6px;position:absolute;top:calc(100% + 6px);left:0;box-shadow:0 12px 32px #00000073}.branch-search.input{background:var(--panel);width:calc(100% - 4px);height:32px;margin:0 2px 6px;font-size:12px}.picker-options{max-height:272px;padding:0;list-style:none;overflow:auto}.picker-option{height:34px;color:var(--text-soft);cursor:pointer;border-radius:6px;align-items:center;gap:8px;padding:0 14px;font-size:12px;display:flex}.picker-option.is-active{background:var(--brand-bg);color:var(--text)}.picker-name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.branch-default{color:var(--faint);font-size:11px}.picker-check{color:var(--accent-soft);flex-shrink:0}.picker-note{color:var(--faint);padding:8px 14px;font-size:12px}.split-button{display:inline-flex}.split-main.button{border-top-right-radius:0;border-bottom-right-radius:0}.split-toggle.button{border-top-left-radius:0;border-bottom-left-radius:0;padding:0 10px}.split-toggle.button-primary{border-left:1px solid #ffffff59}.split-toggle.button-secondary{border-left:none}.scope-menu{padding:6px;left:auto;right:0}.scope-option{text-align:left;border-radius:6px;align-items:center;gap:8px;width:100%;padding:8px 14px;display:flex}.scope-option:hover,.scope-option:focus-visible{background:var(--brand-bg)}.scope-option-text{flex-direction:column;flex:1;gap:3px;display:flex}.scope-option-label{color:var(--text);font-size:13px}.scope-option-detail{color:var(--faint);font-size:11px}.dev-tag{background:var(--surface);border:1px solid var(--border-strong);color:var(--muted);border-radius:11px;flex-shrink:0;padding:3px 12px;font-size:11px}.button{white-space:nowrap;border-radius:8px;justify-content:center;align-items:center;gap:8px;height:36px;padding:0 16px;font-size:13px;display:inline-flex}.button-primary{background:var(--accent);color:#fff;font-weight:600}.button-primary:hover:not(:disabled){background:var(--accent-hover)}.button-secondary{background:var(--surface);border:1px solid var(--border-strong);color:var(--text-soft)}.button-secondary:hover:not(:disabled){border-color:var(--idle);color:var(--text)}.button-ghost{color:var(--muted);padding:0 8px}.button-ghost:hover,.button-ghost.is-active{color:var(--text)}.button:disabled{opacity:.55}.icon-button{color:var(--muted);display:inline-flex}.icon-button:hover{color:var(--text)}.danger-link{color:var(--danger);align-items:center;gap:8px;font-size:13px;display:inline-flex}.panel{background:var(--surface);border:1px solid var(--border);border-radius:10px;overflow:hidden}.empty{color:var(--muted);flex-direction:column;align-items:center;gap:16px;padding:40px 20px;display:flex}.row{border-top:1px solid var(--divider);align-items:center;gap:20px;min-height:56px;padding:0 20px;display:flex}.row:first-child{border-top:none}.row:hover{background:var(--surface-raised)}.row-title{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.row-linked{position:relative}.row-link:after{content:"";position:absolute;inset:0}.pr-note{z-index:1;color:var(--accent-soft);white-space:nowrap;flex-shrink:0;align-items:center;gap:6px;font-size:12px;display:inline-flex;position:relative}.pr-note:hover{color:var(--accent-hover);text-decoration:underline}.row-chevron{color:var(--faint);flex-shrink:0}.row-action{z-index:1;width:28px;height:28px;color:var(--faint);border:1px solid #0000;border-radius:6px;flex-shrink:0;justify-content:center;align-items:center;margin-right:-8px;display:inline-flex;position:relative}.row:hover .row-action{background:var(--surface);border-color:var(--border-strong);color:var(--text-soft)}.row .row-action:hover{border-color:var(--idle);color:var(--text)}.row-button.button{z-index:1;flex-shrink:0;height:32px;padding:0 12px;font-size:13px;position:relative}.deprecated-title{color:var(--muted)}.status{white-space:nowrap;align-items:center;gap:6px;font-size:13px;display:inline-flex}.status-busy{color:var(--accent-soft)}.status-error{color:var(--danger)}.status-muted{color:var(--faint)}.status-clean{color:var(--muted);gap:0;font-size:12px}.status-clean svg{margin-right:6px}.status-clean .pill{margin-left:20px}.unfixable-note{color:var(--warning);white-space:nowrap;flex-shrink:0;align-items:center;gap:6px;font-size:12px;display:inline-flex}.alert-line{border-top:1px solid var(--divider);position:relative}.alert-line:first-child,.alert-line .row{border-top:none}.alert-mark-space{flex-shrink:0;width:164px}.alert-mark.button{height:32px;font-size:12px;display:none;position:absolute;top:12px;right:56px}.alert-line:hover .alert-mark{display:inline-flex}.alert-line:hover .row{background:var(--surface-raised)}.handled-note{align-items:center;gap:6px;font-size:12px;display:flex}.handled-note svg{flex-shrink:0}.restore-link{font-size:12px}.section-label-spaced{margin-top:28px}.pill{white-space:nowrap;border-radius:12px;flex-shrink:0;justify-content:center;align-items:center;height:24px;padding:0 12px;font-size:12px;display:inline-flex}.pill-faded{opacity:.45}.pill-wide{width:76px;padding:0}.pill-critical{background:var(--critical-bg);color:var(--danger)}.pill-high{background:var(--high-bg);color:var(--warning)}.pill-medium{background:var(--medium-bg);color:var(--info)}.pill-low{background:var(--low-bg);color:var(--muted)}.alert-package{text-overflow:ellipsis;white-space:nowrap;flex-shrink:0;width:150px;font-size:13px;overflow:hidden}.alert-summary{min-width:0;color:var(--muted);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;overflow:hidden}.banner{border-radius:10px;align-items:flex-start;gap:10px;margin-bottom:18px;padding:12px 14px;font-size:13px;line-height:1.5;display:flex}.banner svg{flex-shrink:0;margin-top:2px}.banner-error{background:var(--critical-bg);color:var(--text-soft);border:1px solid #5a2629}.steps{margin-bottom:18px}.step{border-top:1px solid var(--divider)}.step:first-child{border-top:none}.step-current{background:var(--surface-current)}.step-line{align-items:center;gap:16px;min-height:48px;padding:0 20px;display:flex}.step-icon{flex-shrink:0}.step-done .step-icon{color:var(--ok)}.step-running .step-icon{color:var(--accent-soft)}.step-failed .step-icon{color:var(--danger)}.step-pending .step-icon,.step-skipped .step-icon{color:var(--idle)}.step-current .step-icon{color:var(--accent-soft)}.step-current .step-icon.text-warning{color:var(--warning)}.step-label{color:var(--text-soft);flex:1}.step-pending .step-label,.step-skipped .step-label{color:var(--faint)}.step-current .step-label{color:var(--text);font-weight:500}.step-result{color:var(--faint);font-size:13px}.unfixable-toggle{color:var(--warning);font-size:13px}.unfixable-toggle:hover{text-decoration:underline}.step-body{padding:0 20px 18px 52px;font-size:13px}.step-actions{gap:12px;margin-top:16px;display:flex}.candidates{color:var(--warning);margin-top:8px;padding:0;font-size:13px;line-height:1.7;list-style:none}.hint{color:var(--faint);margin-top:10px;font-size:12px}.hint .link{font-size:12px}.changes{background:var(--panel);border:1px solid var(--border);border-radius:8px;max-height:240px;margin-top:10px;padding:10px 14px;font-size:12px;line-height:1.7;list-style:none;overflow:auto}.log{background:var(--panel);border:1px solid var(--border);max-height:360px;color:var(--text-soft);white-space:pre-wrap;word-break:break-word;border-radius:10px;margin:0;padding:14px 16px;font-size:12px;line-height:1.6;overflow:auto}.log-time{color:var(--faint)}.input{background:var(--surface);border:1px solid var(--border-strong);width:100%;height:40px;color:var(--text-strong);font:inherit;border-radius:8px;outline:none;padding:0 12px;font-size:13px}.input.mono{font-family:var(--font-mono)}.step-body .input{background:var(--panel);height:36px}.step-body .commit-input{width:600px;max-width:100%}.input:focus{border-color:var(--accent)}.suggestions{background:var(--surface);border:1px solid var(--border-strong);border-radius:8px;margin-top:8px;padding:4px;list-style:none}.suggestion{height:36px;color:var(--text-soft);cursor:pointer;text-overflow:ellipsis;white-space:nowrap;border-radius:6px;align-items:center;padding:0 12px;font-size:13px;display:flex;overflow:hidden}.suggestion.is-active{background:var(--brand-bg);color:var(--text)}.field-hint,.field-error{color:var(--faint);margin-top:12px;font-size:12px}.field-error{color:var(--danger)}.veil{z-index:40;background:#05060a99;position:fixed;inset:0}.modal{background:var(--panel);border:1px solid var(--border-strong);border-radius:12px;width:480px;max-width:calc(100% - 32px);padding:24px;position:absolute;top:110px;left:50%;transform:translate(-50%)}.modal-title{margin-bottom:18px;font-size:16px;font-weight:600}.modal-actions{justify-content:flex-end;gap:12px;margin-top:24px;display:flex}.drawer{background:var(--panel);border-left:1px solid var(--border);flex-direction:column;width:420px;max-width:100%;padding:24px;display:flex;position:absolute;top:0;bottom:0;right:0}.drawer-head{justify-content:space-between;align-items:center;display:flex}.drawer-title{font-size:16px;font-weight:600}.drawer-subtitle{color:var(--faint);margin-top:6px;font-size:12px}.rights{flex:1;margin-top:28px}.right{border-bottom:1px solid var(--divider);justify-content:space-between;align-items:center;gap:16px;padding:12px 0;display:flex}.right:last-child{border-bottom:none}.right-label{font-size:14px}.right-description{color:var(--faint);margin-top:4px;font-size:12px}.toggle{background:var(--border-strong);border-radius:10px;flex-shrink:0;width:36px;height:20px;transition:background .15s;position:relative}.toggle-knob{background:var(--muted);border-radius:50%;width:16px;height:16px;transition:left .15s;position:absolute;top:2px;left:2px}.toggle.is-on{background:var(--accent)}.toggle.is-on .toggle-knob{background:#fff;left:18px}.notice{z-index:50;background:var(--surface-raised);border:1px solid var(--border-strong);max-width:460px;color:var(--text-soft);border-radius:10px;align-items:flex-start;gap:10px;padding:12px 14px;font-size:12.5px;line-height:1.5;display:flex;position:fixed;bottom:24px;right:24px;box-shadow:0 12px 32px #00000073}.notice svg{flex-shrink:0;margin-top:2px}.notice-info svg:first-child{color:var(--accent-soft)}.notice-error{border-color:#5a2629}.notice-error svg:first-child{color:var(--danger)}.notice-text{flex:1}.notice-close{color:var(--faint)}.notice-close:hover{color:var(--text)}@media (width<=700px){.topbar{padding:0 16px}.page-head{flex-wrap:wrap}.alert-package{width:110px}.alert-summary{display:none}}.home{min-height:100%;display:flex}.home .page{min-width:0}.home-head{justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px;display:flex}.home-head .page-title{margin-bottom:0}.filters{align-items:center;gap:24px;display:flex}.filter{color:var(--muted);cursor:pointer;align-items:center;gap:12px;font-size:13px;display:inline-flex}.sidebar{width:264px;min-height:calc(100vh - var(--topbar-height));background:var(--panel);border-right:1px solid var(--border);flex-direction:column;flex-shrink:0;align-self:flex-start;gap:4px;padding:24px 12px;display:flex;position:sticky;top:0}.side-row{position:relative}.side-item{width:100%;height:34px;color:var(--text-soft);text-align:left;border-radius:6px;align-items:center;gap:10px;padding:0 12px;font-size:13px;display:flex}.side-item svg{color:var(--muted);flex-shrink:0}.side-item:hover{background:var(--surface-raised)}.side-item.is-active{background:var(--brand-bg);color:var(--text)}.side-item.is-active svg{color:var(--accent-soft)}.side-name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.side-count{gap:6px;display:inline-flex}.side-more{width:26px;height:26px;color:var(--text-soft);border-radius:6px;justify-content:center;align-items:center;display:none;position:absolute;top:4px;right:8px}.side-more:hover{background:var(--border-strong)}.side-row:hover .side-more,.side-row.is-open .side-more{display:inline-flex}.side-row:hover .side-count,.side-row.is-open .side-count{visibility:hidden}.side-menu{z-index:30;background:var(--surface-raised);border:1px solid var(--border-strong);border-radius:10px;width:160px;padding:4px;position:absolute;top:0;left:calc(100% + 4px);box-shadow:0 12px 32px #00000073}.side-menu-item{width:100%;height:34px;color:var(--text-soft);border-radius:6px;align-items:center;gap:10px;padding:0 12px;font-size:13px;display:flex}.side-menu-item:hover{background:var(--border)}.side-menu-item.is-danger{color:var(--danger)}.side-divider{background:var(--divider);height:1px;margin:8px 12px}.side-new{color:var(--faint);margin-top:8px}.side-new svg{color:var(--faint)}.side-editing{background:var(--surface);box-shadow:inset 0 0 0 1px var(--accent)}.side-editing:hover{background:var(--surface)}.side-input{min-width:0;font:inherit;color:var(--text);background:0 0;border:none;outline:none;flex:1}.pill-small{border-radius:10px;min-width:32px;height:20px;padding:0 8px;font-size:11px}.pill-pr{background:var(--brand-bg);min-width:28px;color:var(--accent-soft);gap:3px;padding:0 6px}.side-item .pill-pr svg{color:inherit}.side-item.is-active .pill-pr{background:#2a3160}.pill-neutral{background:var(--surface-raised);min-width:28px;color:var(--muted);padding:0 6px}.side-item.is-active .pill-neutral{color:var(--accent-soft);background:#2a3160}.picker-menu-narrow{width:220px;padding:6px}.picker-menu-narrow .picker-option:hover{background:var(--brand-bg);color:var(--text)}.select-field{align-items:center;margin-top:12px;display:flex;position:relative}.select-field>svg:first-child{color:var(--muted);pointer-events:none;position:absolute;left:12px}.select-field select{appearance:none;background:var(--surface);border:1px solid var(--border-strong);width:100%;height:40px;color:var(--text-strong);font:inherit;cursor:pointer;border-radius:8px;outline:none;padding:0 36px 0 38px;font-size:13px}.select-field select:focus{border-color:var(--accent)}.select-chevron{color:var(--faint);pointer-events:none;position:absolute;right:12px}.button-icon{width:36px;padding:0}.settings-card{margin-bottom:28px;padding:0 20px}.settings-fields{border-bottom:1px solid var(--divider);grid-template-columns:minmax(0,1fr) 344px;gap:16px;padding:18px 0 20px;display:grid}.settings-field{flex-direction:column;gap:8px;display:flex}.field-label{color:var(--muted);font-size:12px}.token-saved{color:var(--text-soft);justify-content:space-between;align-items:center;display:flex}.token-saved .link{font-size:12px}.settings-status{min-height:44px;color:var(--text-soft);align-items:center;gap:10px;font-size:13px;display:flex}.settings-status-top{min-height:52px;color:var(--text);font-size:14px}.claude-steps{border-top:1px solid var(--divider);color:var(--text-soft);flex-direction:column;gap:14px;margin:0;padding:18px 0 20px;font-size:13px;list-style:none;display:flex}.claude-steps li{align-items:center;gap:12px;display:flex}.step-number{background:var(--divider);border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:22px;height:22px;font-size:11px;display:inline-flex}.code-chip{background:var(--bg);border:1px solid var(--border-strong);height:28px;color:var(--text);border-radius:6px;align-items:center;gap:10px;padding:0 10px 0 12px;font-size:12px;display:inline-flex}.code-chip svg{color:var(--muted)}.code-chip:hover svg{color:var(--text)}.claude-token-input{padding-left:34px}.claude-token-input .input{max-width:520px}.limits{align-items:center;gap:8px;display:flex}.number-input.input{text-align:center;width:56px;height:32px;padding:0 6px}.limits .muted+.number-input{margin-left:8px}@media (width<=720px){.settings-fields{grid-template-columns:minmax(0,1fr)}}.activity{color:var(--faint);margin:0;padding:0;font-size:12px;line-height:1.8;list-style:none}.activity-last{color:var(--muted)}.task-link{align-items:center;gap:8px;display:inline-flex}.verdict{background:var(--surface);border:1px solid var(--border-strong);border-radius:8px;margin-top:14px;padding:13px 16px}.verdict-title{color:var(--text);align-items:center;gap:8px;font-weight:500;display:flex}.verdict-title svg{color:var(--accent-soft)}.verdict-text,.verdict-urgent{color:var(--muted);margin:8px 0 0 22px;line-height:1.6}.verdict-urgent{padding:0;list-style:none}.remarks-head{color:var(--muted);align-items:center;gap:8px;font-size:12px;display:flex}.remarks-count{flex:1}.remarks-head .link{font-size:12px}.remarks-note{color:var(--faint);margin:8px 0 0 22px;font-size:12px}.remarks-list{max-height:260px;margin:4px 0 0 22px;padding:0;list-style:none;overflow:auto}.remarks-list li{margin-top:10px}.remarks-body{color:var(--text-strong);white-space:pre-wrap;word-break:break-word;line-height:1.5}.remarks-meta{color:var(--faint);margin-top:2px;font-size:11px}.repair-summary{margin-top:0}.repair-changes{grid-template-columns:max-content minmax(0,1fr);column-gap:24px;margin:10px 0 0 22px;padding:0;font-size:12px;line-height:1.8;list-style:none;display:grid}.repair-changes li{display:contents}.repair-changes .mono{color:var(--text-soft);flex-shrink:0}.repair-line{color:var(--muted);align-items:center;gap:6px;margin:6px 0 0 22px;font-size:12px;display:flex}.repair-line .link{font-size:12px}.commit-input-spaced{margin-top:16px}.step-actions-reversed{flex-direction:row-reverse;justify-content:flex-end}
|