@imenam/mcp-dependabot-tracker 1.0.14 → 1.0.16

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.
@@ -24,6 +24,16 @@ function shorten(text) {
24
24
  const first = text.trim().split(/\r?\n/)[0];
25
25
  return first.length > MAX_LINE ? `${first.slice(0, MAX_LINE)}…` : first;
26
26
  }
27
+ /** Taille maximale d'un message de Claude gardé dans le déroulé d'une session. */
28
+ const MAX_MESSAGE = 4000;
29
+ /** Ligne d'activité en clair d'un élément du déroulé : sa première ligne, raccourcie. */
30
+ export function activityLine(event) {
31
+ return shorten(event.text);
32
+ }
33
+ function message(text) {
34
+ const trimmed = text.trim();
35
+ return { kind: "text", text: trimmed.length > MAX_MESSAGE ? `${trimmed.slice(0, MAX_MESSAGE)}…` : trimmed };
36
+ }
27
37
  /** Appel d'outil en clair : `Read src/app.ts`, `Grep mermaid`, `Edit src/app.ts`, `$ npm test`, `organizer create_task`. */
28
38
  function describeTool(name, input, cwd) {
29
39
  const relative = (file) => (typeof file === "string" && path.isAbsolute(file) ? path.relative(cwd, file) || "." : String(file ?? ""));
@@ -74,7 +84,7 @@ class StreamReader {
74
84
  }
75
85
  catch {
76
86
  this.lastText = shorten(line);
77
- return [this.lastText];
87
+ return [message(line)];
78
88
  }
79
89
  if (event?.type === "assistant")
80
90
  return this.assistant(event.message ?? {});
@@ -85,22 +95,22 @@ class StreamReader {
85
95
  }
86
96
  return [];
87
97
  }
88
- assistant(message) {
89
- if (typeof message.id === "string" && !this.messages.has(message.id)) {
90
- this.messages.add(message.id);
98
+ assistant(content) {
99
+ if (typeof content.id === "string" && !this.messages.has(content.id)) {
100
+ this.messages.add(content.id);
91
101
  this.turns += 1;
92
102
  }
93
- const lines = [];
94
- for (const block of Array.isArray(message.content) ? message.content : []) {
103
+ const events = [];
104
+ for (const block of Array.isArray(content.content) ? content.content : []) {
95
105
  if (block?.type === "text" && typeof block.text === "string" && block.text.trim()) {
96
106
  this.lastText = shorten(block.text);
97
- lines.push(this.lastText);
107
+ events.push(message(block.text));
98
108
  }
99
109
  else if (block?.type === "tool_use" && typeof block.name === "string") {
100
- lines.push(describeTool(block.name, block.input, this.cwd));
110
+ events.push({ kind: "tool", text: describeTool(block.name, block.input, this.cwd) });
101
111
  }
102
112
  }
103
- return lines;
113
+ return events;
104
114
  }
105
115
  }
106
116
  /**
@@ -149,9 +159,9 @@ export function runClaudeSession(runtime, options) {
149
159
  stop();
150
160
  }, options.maxMinutes * 60_000);
151
161
  options.signal?.addEventListener("abort", stop);
152
- const emit = (lines) => {
153
- for (const line of lines)
154
- options.onLine?.(line, reader.turns);
162
+ const emit = (events) => {
163
+ for (const event of events)
164
+ options.onEvent?.(event, reader.turns);
155
165
  };
156
166
  const finish = (fn) => {
157
167
  if (settled)
@@ -1,6 +1,6 @@
1
1
  import { type AuditScope, type Operation, type OperationKind } from "../../shared/schemas/model.schema.js";
2
2
  import type { Settings } from "../../shared/schemas/settings.schema.js";
3
- import type { ClaudeRuntime } from "./claude.js";
3
+ import { type ClaudeRuntime } from "./claude.js";
4
4
  import type { GitHubConfig } from "./config.js";
5
5
  import { type Store } from "./store.js";
6
6
  /** Accès aux données et à GitHub pour exécuter les opérations. */
@@ -3,11 +3,12 @@ import fs from "fs";
3
3
  import path from "path";
4
4
  import { DEFAULT_COMMIT_MESSAGE, } from "../../shared/schemas/model.schema.js";
5
5
  import { analyseVulnerabilities, auditFacts } from "./analysis.js";
6
+ import { activityLine } from "./claude.js";
6
7
  import { CommandAbortedError, runCommand, tail } from "./commands.js";
7
8
  import { ConflictError, TrackerError } from "./errors.js";
8
9
  import { GitHubClient } from "./github.js";
9
10
  import { diffLockfiles, forceCandidates, parseAuditReport, parseLockfile, parseNpmJson, projectLabel, } from "./npm-audit.js";
10
- import { assertSandboxAvailable, repairVulnerabilities } from "./repair.js";
11
+ import { analysisRemarks, assertSandboxAvailable, repairVulnerabilities } from "./repair.js";
11
12
  import { assertNotDeprecated, isActive } from "./store.js";
12
13
  /** Intervalle de lecture de la demande d'annulation pendant une étape. */
13
14
  const CANCEL_POLL_MS = 500;
@@ -19,6 +20,34 @@ const CLONE_DIR = "repo";
19
20
  const MAX_PR_CHANGES = 60;
20
21
  /** Dernières actions de Claude gardées dans l'opération pendant l'analyse et les corrections. */
21
22
  const ANALYSIS_ACTIVITY = 3;
23
+ /** Éléments du déroulé gardés par session de Claude, les plus récents. */
24
+ const SESSION_EVENTS = 500;
25
+ function newSession(kind, run, tasks) {
26
+ return {
27
+ kind,
28
+ run,
29
+ startedAt: now(),
30
+ endedAt: null,
31
+ turns: 0,
32
+ outcome: "running",
33
+ error: null,
34
+ remarks: [],
35
+ tasks,
36
+ events: [],
37
+ analysisReport: null,
38
+ repairReport: null,
39
+ commit: null,
40
+ remaining: null,
41
+ };
42
+ }
43
+ /** Sessions de l'opération, la dernière transformée par `fn`. */
44
+ function withLastSession(operation, fn) {
45
+ return operation.sessions.map((session, index) => (index === operation.sessions.length - 1 ? fn(session) : session));
46
+ }
47
+ /** Termine la dernière session : réussie, échouée avec sa raison, ou annulée. */
48
+ function endSession(runner, outcome, changes = {}) {
49
+ runner.update((operation) => ({ ...operation, sessions: withLastSession(operation, (session) => ({ ...session, ...changes, outcome, endedAt: now() })) }));
50
+ }
22
51
  /** Fichiers suivis par les commits du tracker : tout le clone, sauf les node_modules qu'installe Claude. */
23
52
  const STAGED_PATHS = ["--", ".", ":(exclude,glob)**/node_modules/**"];
24
53
  /** Co-auteur du commit des corrections par Claude. */
@@ -91,6 +120,7 @@ function newOperation(repo, kind, origin, scope) {
91
120
  pullRequest: null,
92
121
  analysis: null,
93
122
  repair: null,
123
+ sessions: [],
94
124
  error: null,
95
125
  log: [],
96
126
  };
@@ -271,6 +301,7 @@ async function analysisStep(runner, ctx) {
271
301
  runner.update((operation) => ({
272
302
  ...operation,
273
303
  analysis: { startedAt: now(), endedAt: null, turns: 0, activity: [], report: null, task: null, error: null },
304
+ sessions: [...operation.sessions, newSession("analysis", 1, [])],
274
305
  }));
275
306
  const analysed = (fn) => runner.update((operation) => ({ ...operation, analysis: operation.analysis && fn(operation.analysis) }));
276
307
  try {
@@ -286,21 +317,30 @@ async function analysisStep(runner, ctx) {
286
317
  settings,
287
318
  claude: ctx.claude,
288
319
  signal: runner.signal,
289
- onLine: (line, turns) => {
320
+ onEvent: (event, turns) => {
321
+ const line = activityLine(event);
290
322
  runner.log(`claude: ${line}`);
291
- analysed((analysis) => ({ ...analysis, turns, activity: [...analysis.activity, line].slice(-ANALYSIS_ACTIVITY) }));
323
+ runner.update((current) => ({
324
+ ...current,
325
+ analysis: current.analysis && { ...current.analysis, turns, activity: [...current.analysis.activity, line].slice(-ANALYSIS_ACTIVITY) },
326
+ sessions: withLastSession(current, (session) => ({ ...session, turns, events: [...session.events, event].slice(-SESSION_EVENTS) })),
327
+ }));
292
328
  },
293
329
  });
294
330
  runner.log(`Organizer task ${task.key}: ${task.url}`);
295
331
  analysed((analysis) => ({ ...analysis, endedAt: now(), report, task }));
332
+ endSession(runner, "done", { tasks: [{ task, role: "created" }], analysisReport: report });
296
333
  runner.setStep("analysis", "done");
297
334
  }
298
335
  catch (err) {
299
- if (err instanceof CommandAbortedError || runner.signal.aborted)
336
+ if (err instanceof CommandAbortedError || runner.signal.aborted) {
337
+ endSession(runner, "cancelled");
300
338
  throw err;
339
+ }
301
340
  const message = err?.message ?? String(err);
302
341
  runner.log(`Analysis failed: ${message}`);
303
342
  analysed((analysis) => ({ ...analysis, endedAt: now(), error: message }));
343
+ endSession(runner, "failed", { error: message });
304
344
  runner.setStep("analysis", "failed");
305
345
  }
306
346
  }
@@ -377,13 +417,19 @@ async function repairStep(runner, ctx) {
377
417
  task: previous?.task ?? null,
378
418
  error: null,
379
419
  };
380
- runner.update((operation) => ({ ...operation, repair }));
420
+ const analysisTask = runner.operation.analysis?.task ?? null;
421
+ runner.update((operation) => ({
422
+ ...operation,
423
+ repair,
424
+ sessions: [...operation.sessions, newSession("repair", repair.runs, analysisTask ? [{ task: analysisTask, role: "read" }] : [])],
425
+ }));
381
426
  const repaired = (fn) => runner.update((operation) => ({ ...operation, repair: operation.repair && fn(operation.repair) }));
382
427
  try {
383
- const operation = runner.operation;
384
- const analysisTask = operation.analysis?.task;
385
428
  if (!analysisTask)
386
429
  throw new TrackerError("The fixes by Claude need the organizer task of the analysis.");
430
+ const { remarks } = await analysisRemarks(ctx.settings(), runner.operation);
431
+ runner.update((current) => ({ ...current, sessions: withLastSession(current, (session) => ({ ...session, remarks })) }));
432
+ const operation = runner.operation;
387
433
  const { report, task } = await repairVulnerabilities({
388
434
  repoId: operation.repoId,
389
435
  branch: operation.baseBranch,
@@ -397,9 +443,14 @@ async function repairStep(runner, ctx) {
397
443
  settings: ctx.settings(),
398
444
  claude: ctx.claude,
399
445
  signal: runner.signal,
400
- onLine: (line, turns) => {
446
+ onEvent: (event, turns) => {
447
+ const line = activityLine(event);
401
448
  runner.log(`claude: ${line}`);
402
- repaired((current) => ({ ...current, turns, activity: [...current.activity, line].slice(-ANALYSIS_ACTIVITY) }));
449
+ runner.update((current) => ({
450
+ ...current,
451
+ repair: current.repair && { ...current.repair, turns, activity: [...current.repair.activity, line].slice(-ANALYSIS_ACTIVITY) },
452
+ sessions: withLastSession(current, (session) => ({ ...session, turns, events: [...session.events, event].slice(-SESSION_EVENTS) })),
453
+ }));
403
454
  },
404
455
  });
405
456
  const commit = await commitRepair(runner, base, report.commitMessage);
@@ -407,16 +458,25 @@ async function repairStep(runner, ctx) {
407
458
  await auditAll(runner, "afterRepair");
408
459
  await refreshChanges(runner);
409
460
  repaired((current) => ({ ...current, endedAt: now(), commit, report, task }));
461
+ endSession(runner, "done", {
462
+ tasks: [{ task: analysisTask, role: "read" }, { task, role: previous?.task ? "updated" : "created" }],
463
+ repairReport: report,
464
+ commit,
465
+ remaining: runner.operation.counts.afterRepair,
466
+ });
410
467
  runner.setStep("repair", "done");
411
468
  }
412
469
  catch (err) {
413
- if (err instanceof CommandAbortedError || runner.signal.aborted)
470
+ if (err instanceof CommandAbortedError || runner.signal.aborted) {
471
+ endSession(runner, "cancelled");
414
472
  throw err;
473
+ }
415
474
  const message = err?.message ?? String(err);
416
475
  runner.log(`Fixes by Claude failed: ${message}`);
417
476
  await runner.git(["reset", "--hard", "HEAD"]);
418
477
  await runner.git(["clean", "-fd", "-e", "node_modules"]);
419
478
  repaired((current) => ({ ...current, endedAt: now(), error: message }));
479
+ endSession(runner, "failed", { error: message });
420
480
  runner.setStep("repair", previous?.report ? "done" : "failed");
421
481
  }
422
482
  }
@@ -1,5 +1,5 @@
1
1
  import type { RemarksResponse } from "../../shared/schemas/api.schema.js";
2
- import { type AnalysisTask, type AuditScope, type Operation, type RepairReport } from "../../shared/schemas/model.schema.js";
2
+ import { type AnalysisTask, type AuditScope, type Operation, type RepairReport, type SessionEvent } from "../../shared/schemas/model.schema.js";
3
3
  import type { Settings } from "../../shared/schemas/settings.schema.js";
4
4
  import { type ClaudeRuntime } from "./claude.js";
5
5
  /**
@@ -27,7 +27,7 @@ export interface RepairInput {
27
27
  settings: Settings;
28
28
  claude: ClaudeRuntime;
29
29
  signal: AbortSignal;
30
- onLine: (line: string, turns: number) => void;
30
+ onEvent: (event: SessionEvent, turns: number) => void;
31
31
  }
32
32
  /** Tâche de l'analyse d'une opération et ses commentaires : les remarques que Claude prendra en compte. */
33
33
  export declare function analysisRemarks(settings: Settings, operation: Operation): Promise<RemarksResponse>;
@@ -167,7 +167,7 @@ export async function repairVulnerabilities(input) {
167
167
  maxTurns: input.settings.analysis.maxTurns,
168
168
  maxMinutes: input.settings.analysis.maxMinutes,
169
169
  signal: input.signal,
170
- onLine: input.onLine,
170
+ onEvent: input.onEvent,
171
171
  }));
172
172
  }
173
173
  finally {
@@ -1,5 +1,5 @@
1
1
  import { type Alert, type AlertSeverity, type AnalysisTask, type HandledAlert, type Operation, type PullRequest, type Repo, type Rights } from "../../shared/schemas/model.schema.js";
2
- import type { AuditFindings, CleanAudit, RepoView } from "../../shared/schemas/api.schema.js";
2
+ import type { AuditFindings, AuditTarget, CleanAudit, OperationSummary, RepoView } from "../../shared/schemas/api.schema.js";
3
3
  import type { GitHubConfig } from "./config.js";
4
4
  import { type OpenPullRequest } from "./github.js";
5
5
  import { type Store } from "./store.js";
@@ -52,6 +52,8 @@ export declare function pruneHandledAlerts(handled: HandledAlert[], alerts: Aler
52
52
  * lui-même, pas à une fourche. Par numéro croissant.
53
53
  */
54
54
  export declare function trackerPullRequests(repoId: string, pulls: OpenPullRequest[]): PullRequest[];
55
+ /** Ligne de l'historique d'une opération. */
56
+ export declare function operationSummary(operation: Operation): OperationSummary;
55
57
  export declare function repoView(store: Store, repo: Repo): RepoView;
56
58
  /** Tâche organizer de la dernière analyse, tant qu'elle n'est pas terminée. `operations` va de la plus récente à la plus ancienne. */
57
59
  export declare function openAnalysisTask(operations: Operation[]): AnalysisTask | null;
@@ -67,8 +69,18 @@ export declare function syncRepository(store: Store, config: GitHubConfig, repoI
67
69
  export declare function activeRepos(store: Store): Repo[];
68
70
  /** Relit tout de suite, en parallèle, les alertes et les pull requests de chaque dépôt suivi non déprécié. */
69
71
  export declare function syncAllRepositories(store: Store, config: GitHubConfig): Promise<void>;
70
- /** Marque le dépôt déprécié ; sans effet s'il l'est déjà, refusé pendant une opération en cours. */
72
+ /** Marque le dépôt déprécié et le retire de la file d'attente ; sans effet s'il l'est déjà, refusé pendant une opération en cours. */
71
73
  export declare function deprecateRepository(store: Store, repoId: string): Repo;
74
+ /** Met le dépôt dans la file d'attente ; sans effet s'il y est déjà, refusé pour un dépôt déprécié. */
75
+ export declare function queueRepository(store: Store, repoId: string): Repo;
76
+ /** Met dans la file d'attente les dépôts non dépréciés de la catégorie qui n'y sont pas encore ; une catégorie inconnue est refusée. */
77
+ export declare function queueCategory(store: Store, categoryId: string): void;
78
+ /** Retire le dépôt de la file d'attente ; sans effet s'il n'y est pas. */
79
+ export declare function unqueueRepository(store: Store, repoId: string): Repo;
80
+ /** Dépôts non dépréciés visés par « Auditer tout » ; une catégorie inconnue est refusée. */
81
+ export declare function auditTargetRepos(store: Store, target: AuditTarget): Repo[];
82
+ /** Dépôts de la file d'attente qui ne sont pas dépréciés, dans l'ordre de leur entrée dans la file. */
83
+ export declare function queuedRepos(store: Store): Repo[];
72
84
  /** Retire la marque « déprécié », puis relit aussitôt les alertes du dépôt ; il retrouve sa catégorie. */
73
85
  export declare function restoreRepository(store: Store, config: GitHubConfig, repoId: string): Promise<Repo>;
74
86
  /** Suit un nouveau dépôt, rangé dans `categoryId`, avec l'audit pour seul droit de l'agent, puis lit ses alertes. */
@@ -108,6 +108,25 @@ export function trackerPullRequests(repoId, pulls) {
108
108
  .sort((a, b) => a.number - b.number)
109
109
  .map(({ number, url, branch, createdAt }) => ({ number, url, branch, createdAt }));
110
110
  }
111
+ /** Ligne de l'historique d'une opération. */
112
+ export function operationSummary(operation) {
113
+ const { initial, afterFix, afterForce, afterRepair } = operation.counts;
114
+ return {
115
+ id: operation.id,
116
+ kind: operation.kind,
117
+ origin: operation.origin,
118
+ scope: operation.scope,
119
+ status: operation.status,
120
+ baseBranch: operation.baseBranch,
121
+ createdAt: operation.createdAt,
122
+ before: initial,
123
+ after: afterRepair ?? afterForce ?? afterFix ?? (operation.kind === "audit" ? initial : null),
124
+ analysed: operation.analysis !== null,
125
+ claudeRuns: operation.repair?.runs ?? 0,
126
+ pullRequest: operation.pullRequest,
127
+ error: operation.error,
128
+ };
129
+ }
111
130
  export function repoView(store, repo) {
112
131
  return buildRepoView(repo, store.listOperations(repo.id), repo.categoryId === null ? null : store.getCategory(repo.categoryId));
113
132
  }
@@ -178,12 +197,44 @@ export function activeRepos(store) {
178
197
  export async function syncAllRepositories(store, config) {
179
198
  await Promise.all(activeRepos(store).map((repo) => syncRepository(store, config, repo.id)));
180
199
  }
181
- /** Marque le dépôt déprécié ; sans effet s'il l'est déjà, refusé pendant une opération en cours. */
200
+ /** Marque le dépôt déprécié et le retire de la file d'attente ; sans effet s'il l'est déjà, refusé pendant une opération en cours. */
182
201
  export function deprecateRepository(store, repoId) {
183
202
  const repo = store.getRepo(repoId);
184
203
  if (store.activeOperation(repo.id))
185
204
  throw new ConflictError(`An operation is in progress on ${repo.id}: wait for it to finish or cancel it before deprecating the repository.`);
186
- return store.updateRepo(repo.id, (current) => (current.deprecatedAt === null ? { ...current, deprecatedAt: new Date().toISOString() } : current));
205
+ return store.updateRepo(repo.id, (current) => (current.deprecatedAt === null ? { ...current, deprecatedAt: new Date().toISOString(), queuedAt: null } : current));
206
+ }
207
+ /** Met le dépôt dans la file d'attente ; sans effet s'il y est déjà, refusé pour un dépôt déprécié. */
208
+ export function queueRepository(store, repoId) {
209
+ assertNotDeprecated(store.getRepo(repoId));
210
+ return store.updateRepo(repoId, (current) => (current.queuedAt === null ? { ...current, queuedAt: new Date().toISOString() } : current));
211
+ }
212
+ /** Met dans la file d'attente les dépôts non dépréciés de la catégorie qui n'y sont pas encore ; une catégorie inconnue est refusée. */
213
+ export function queueCategory(store, categoryId) {
214
+ store.getCategory(categoryId);
215
+ for (const repo of activeRepos(store)) {
216
+ if (repo.categoryId === categoryId && repo.queuedAt === null)
217
+ queueRepository(store, repo.id);
218
+ }
219
+ }
220
+ /** Retire le dépôt de la file d'attente ; sans effet s'il n'y est pas. */
221
+ export function unqueueRepository(store, repoId) {
222
+ return store.updateRepo(repoId, (current) => ({ ...current, queuedAt: null }));
223
+ }
224
+ /** Dépôts non dépréciés visés par « Auditer tout » ; une catégorie inconnue est refusée. */
225
+ export function auditTargetRepos(store, target) {
226
+ if (target.kind === "queue")
227
+ return queuedRepos(store);
228
+ if (target.kind === "all")
229
+ return activeRepos(store);
230
+ store.getCategory(target.categoryId);
231
+ return activeRepos(store).filter((repo) => repo.categoryId === target.categoryId);
232
+ }
233
+ /** Dépôts de la file d'attente qui ne sont pas dépréciés, dans l'ordre de leur entrée dans la file. */
234
+ export function queuedRepos(store) {
235
+ return activeRepos(store)
236
+ .filter((repo) => repo.queuedAt !== null)
237
+ .sort((a, b) => a.queuedAt.localeCompare(b.queuedAt));
187
238
  }
188
239
  /** Retire la marque « déprécié », puis relit aussitôt les alertes du dépôt ; il retrouve sa catégorie. */
189
240
  export async function restoreRepository(store, config, repoId) {
@@ -213,6 +264,7 @@ export async function addRepository(store, config, input, categoryId) {
213
264
  syncedAt: null,
214
265
  syncError: null,
215
266
  deprecatedAt: null,
267
+ queuedAt: null,
216
268
  });
217
269
  return syncRepository(store, config, remote.fullName);
218
270
  }
@@ -41,7 +41,7 @@ export function processAlive(pid) {
41
41
  * dans aucune, un fichier sans catégories n'en a aucune, un dépôt sans alerte
42
42
  * corrigée à la main n'en a aucune, un dépôt sans pull request en attente n'en
43
43
  * a aucune jusqu'à sa lecture suivante, un dépôt sans date de dépréciation
44
- * n'est pas déprécié. Une alerte sans date
44
+ * n'est pas déprécié, un dépôt sans date d'entrée dans la file n'y est pas. Une alerte sans date
45
45
  * d'émission prend celle de la lecture qui l'a rapportée, une alerte sans
46
46
  * portée n'en a aucune ; la lecture suivante les remplace par les vraies.
47
47
  */
@@ -58,6 +58,7 @@ function normalizeReposFile(file) {
58
58
  handledAlerts: repo?.handledAlerts ?? [],
59
59
  pullRequests: repo?.pullRequests ?? [],
60
60
  deprecatedAt: repo?.deprecatedAt ?? null,
61
+ queuedAt: repo?.queuedAt ?? null,
61
62
  alerts: Array.isArray(repo?.alerts)
62
63
  ? repo.alerts.map((alert) => ({ ...alert, createdAt: alert?.createdAt ?? repo.syncedAt ?? repo.addedAt, scope: alert?.scope ?? null }))
63
64
  : repo?.alerts,
@@ -81,6 +82,7 @@ function normalizeOperation(operation) {
81
82
  counts: operation.counts && typeof operation.counts === "object" ? { afterRepair: null, ...operation.counts } : operation.counts,
82
83
  analysis: operation.analysis ?? null,
83
84
  repair: operation.repair ?? null,
85
+ sessions: operation.sessions ?? [],
84
86
  scope: operation.scope ?? "all",
85
87
  };
86
88
  }
@@ -6,7 +6,7 @@ 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, RepairBodySchema, ScopeBodySchema, SetBranchBodySchema, SetCategoryBodySchema, SetRightsBodySchema } from "../shared/schemas/api.schema.js";
9
+ import { AddRepoBodySchema, AuditAllBodySchema, CategoryBodySchema, ForceBodySchema, PushBodySchema, RepairBodySchema, ScopeBodySchema, SetBranchBodySchema, SetCategoryBodySchema, SetRightsBodySchema } from "../shared/schemas/api.schema.js";
10
10
  import { SaveSettingsBodySchema } from "../shared/schemas/settings.schema.js";
11
11
  import { resolveLogDir } from "./core/log-dir.js";
12
12
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -199,7 +199,7 @@ app.post("/api/repos", async (c) => {
199
199
  app.post("/api/sync", (c) => forward(c, "SYNC_REPOS"));
200
200
  app.get("/api/audit-all", (c) => forward(c, "GET_AUDIT_ALL"));
201
201
  app.post("/api/audit-all", async (c) => {
202
- const read = await readBody(c, ScopeBodySchema);
202
+ const read = await readBody(c, AuditAllBodySchema);
203
203
  if ("response" in read)
204
204
  return read.response;
205
205
  return forward(c, "START_AUDIT_ALL", { body: read.body });
@@ -209,6 +209,8 @@ app.get("/api/repos/:owner/:name", (c) => forward(c, "GET_REPO", { repoId: repoI
209
209
  app.delete("/api/repos/:owner/:name", (c) => forward(c, "REMOVE_REPO", { repoId: repoId(c) }));
210
210
  app.put("/api/repos/:owner/:name/deprecated", (c) => forward(c, "DEPRECATE_REPO", { repoId: repoId(c) }));
211
211
  app.delete("/api/repos/:owner/:name/deprecated", (c) => forward(c, "RESTORE_REPO", { repoId: repoId(c) }));
212
+ app.put("/api/repos/:owner/:name/queued", (c) => forward(c, "QUEUE_REPO", { repoId: repoId(c) }));
213
+ app.delete("/api/repos/:owner/:name/queued", (c) => forward(c, "UNQUEUE_REPO", { repoId: repoId(c) }));
212
214
  app.put("/api/repos/:owner/:name/rights", async (c) => {
213
215
  const read = await readBody(c, SetRightsBodySchema);
214
216
  if ("response" in read)
@@ -244,12 +246,14 @@ app.put("/api/categories/:id", async (c) => {
244
246
  return forward(c, "RENAME_CATEGORY", { categoryId: c.req.param("id"), body: read.body });
245
247
  });
246
248
  app.delete("/api/categories/:id", (c) => forward(c, "DELETE_CATEGORY", { categoryId: c.req.param("id") }));
249
+ app.put("/api/categories/:id/queued", (c) => forward(c, "QUEUE_CATEGORY", { categoryId: c.req.param("id") }));
247
250
  app.post("/api/repos/:owner/:name/operations", async (c) => {
248
251
  const read = await readBody(c, ScopeBodySchema);
249
252
  if ("response" in read)
250
253
  return read.response;
251
254
  return forward(c, "START_FIX", { repoId: repoId(c), body: read.body });
252
255
  });
256
+ app.get("/api/repos/:owner/:name/operations", (c) => forward(c, "LIST_OPERATIONS", { repoId: repoId(c) }));
253
257
  app.get("/api/operations/:id", (c) => forward(c, "GET_OPERATION", { operationId: c.req.param("id") }));
254
258
  app.post("/api/operations/:id/force", async (c) => {
255
259
  const read = await readBody(c, ForceBodySchema);
package/dist/src/index.js CHANGED
@@ -22,9 +22,9 @@ import { OrganizerClient } from "./core/organizer.js";
22
22
  import { readSettings, saveSettings, settingsView, testOrganizer } from "./core/settings.js";
23
23
  import { SaveSettingsBodySchema } from "../shared/schemas/settings.schema.js";
24
24
  import { AUDIT_SCOPES } from "../shared/schemas/model.schema.js";
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";
25
+ import { SYNC_INTERVAL_MS, addRepository, auditTargetRepos, queueCategory, queueRepository, unqueueRepository, operationSummary, deprecateRepository, listAddableRepositories, restoreRepository, listRepoBranches, listRepoViews, markAlertHandled, setBranch, setCategory, repoView, setRights, staleRepos, syncAllRepositories, syncRepository, unmarkAlertHandled } from "./core/repos.js";
26
26
  import { GUI_REQUEST_TYPES, IPCMessageSchema } from "../shared/schemas/ipc.schema.js";
27
- import { AddRepoBodySchema, AlertRequestSchema, CategoryBodySchema, CategoryRequestSchema, ForceBodySchema, OperationRequestSchema, PushBodySchema, RepairBodySchema, RepoRequestSchema, ScopeBodySchema, SetBranchBodySchema, SetCategoryBodySchema, SetRightsBodySchema, } from "../shared/schemas/api.schema.js";
27
+ import { AddRepoBodySchema, AlertRequestSchema, CategoryBodySchema, CategoryRequestSchema, ForceBodySchema, OperationRequestSchema, PushBodySchema, RepairBodySchema, RepoRequestSchema, AuditAllBodySchema, ScopeBodySchema, SetBranchBodySchema, SetCategoryBodySchema, SetRightsBodySchema, } from "../shared/schemas/api.schema.js";
28
28
  import { errorResult, textResult } from "./tools/types.js";
29
29
  import { fixVulnerabilities, getAlerts, listRepositories, runAudit } from "./tools/tools.js";
30
30
  const __filename = fileURLToPath(import.meta.url);
@@ -157,10 +157,12 @@ async function handleGuiRequest(msg) {
157
157
  return { repos: listRepoViews(store), categories: store.listCategories() };
158
158
  case "GET_AUDIT_ALL":
159
159
  return { auditAll: auditAll.status() };
160
- case "START_AUDIT_ALL":
160
+ case "START_AUDIT_ALL": {
161
161
  readGitHubConfig();
162
162
  store.failOrphanedOperations();
163
- return { auditAll: auditAll.start(activeRepos(store).map((repo) => repo.id), parseRequest(ScopeBodySchema, msg.data?.body).scope) };
163
+ const { scope, target } = parseRequest(AuditAllBodySchema, msg.data?.body);
164
+ return { auditAll: auditAll.start(auditTargetRepos(store, target).map((repo) => repo.id), scope, target) };
165
+ }
164
166
  case "LIST_ADDABLE_REPOS":
165
167
  return { repositories: await listAddableRepositories(store, readGitHubConfig()) };
166
168
  case "GET_REPO": {
@@ -176,6 +178,10 @@ async function handleGuiRequest(msg) {
176
178
  return { removed: true };
177
179
  case "DEPRECATE_REPO":
178
180
  return repoView(store, deprecateRepository(store, parseRequest(RepoRequestSchema, msg.data).repoId));
181
+ case "QUEUE_REPO":
182
+ return repoView(store, queueRepository(store, parseRequest(RepoRequestSchema, msg.data).repoId));
183
+ case "UNQUEUE_REPO":
184
+ return repoView(store, unqueueRepository(store, parseRequest(RepoRequestSchema, msg.data).repoId));
179
185
  case "RESTORE_REPO":
180
186
  return repoView(store, await restoreRepository(store, readGitHubConfig(), parseRequest(RepoRequestSchema, msg.data).repoId));
181
187
  case "SET_RIGHTS": {
@@ -213,11 +219,19 @@ async function handleGuiRequest(msg) {
213
219
  const { categoryId } = parseRequest(CategoryRequestSchema, msg.data);
214
220
  return store.renameCategory(categoryId, parseRequest(CategoryBodySchema, msg.data?.body).name);
215
221
  }
222
+ case "QUEUE_CATEGORY":
223
+ queueCategory(store, parseRequest(CategoryRequestSchema, msg.data).categoryId);
224
+ return { repos: listRepoViews(store), categories: store.listCategories() };
216
225
  case "DELETE_CATEGORY":
217
226
  store.deleteCategory(parseRequest(CategoryRequestSchema, msg.data).categoryId);
218
227
  return { deleted: true };
219
228
  case "START_FIX":
220
229
  return { operation: startUserFix(operations, parseRequest(RepoRequestSchema, msg.data).repoId, parseRequest(ScopeBodySchema, msg.data?.body).scope) };
230
+ case "LIST_OPERATIONS": {
231
+ store.failOrphanedOperations();
232
+ const repo = store.getRepo(parseRequest(RepoRequestSchema, msg.data).repoId);
233
+ return { operations: store.listOperations(repo.id).map(operationSummary) };
234
+ }
221
235
  case "GET_OPERATION": {
222
236
  store.failOrphanedOperations();
223
237
  return { operation: store.getOperation(parseRequest(OperationRequestSchema, msg.data).operationId) };
@@ -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,d09GMgABAAAAAAfsABQAAAAAEAwAAAeCAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGhwbHhwoP0hWQVJbBmA/U1RBVIFiJyYAdC9qEQgKhGSEAAsgADCGCAE2AiQDOgQgBYlMB4EUDAcbLQ4onoexrSC/2ZyLAa8p8VHB8/x3Vue+V0hVJalMJg2nx/TCrQXxBeqLjQG7FyM1WEa/X1tEXN7cFz9EJEMmMUz3RihWSSKeQCbcIou0izz/C8v+fq3VfajEa9gDD11CImXS7qL/RJFVzC1qiB6KmKeD6TZdQ6IRGv78dL6uSVVCfgni5mzu7kcgQBgAEAQTQRCoL++STTYybkJxNfQxAAIAGu8OdEB9teW2jh4BpgDqFjAeSEByW3zFP0CBBgNMsMCGEDjgggdhiEAUAeIIED7ABTDUEnkIE9Q9ahFgKttcVhApo4ACB4qobHaccgDfEjFO6aaWUhjMLt2SyIvHKoDqoA4CSUwEIYQCEjhAO9R1G6keDeDZGjNo+AhxOjCEGTr1WeIF3kYBiLAOKvkJSMiKX0VdAyQt3SDJClCkxJCHkCzfqyVTriJZLcolS32JZHUekq2TYNkYtCtjYHMQXSxGjXDz2t/yLWXzDzxz+o3zFwDEaN23F+13pyMdQAEaSKAR9vcGq4A4MTSKCElGW+M7UcY7xqkggITb28ZJhlqc9q2twYKTt0NjixBgYvO9BIihEBLYuOFXQzfIQ7dXGUEEEgFDooBfAzqiQbpJrhiWSuKJCRFKYbHCyJKI2G5GiZbNAvgAu5pc3vwx4G+g3aDkhklABiSz0BICXrYghtYhx/cdJ+44rY2oZ0aMNRFz3VZjb6W33F3gzltqtOCV8tTHSpOeXuItfvr5lCdfzFpqtEitvqdcdGGFd28ZqqC0tPbeChGXgrIlnhSWu/eUso4uKWFLugyDzQJhflY4659+WjQ++6x72WUMv9G8mw6QJl7BVxX5fe/kpUsOvnZwee9uQ0cGXYd0o89XB2748sDSnt8d2VphdOTTgceDVvOds0v9P/s7HPq15aGun/6Vllb56f1dl0t1LejqrNkpdRZsG8TOnM5vkBG5oiVyVGnS8LHps5cfNWJs6qKPfaNSxiQNBUm3cKNWROr0GSur7Za31k1vieq7LH11VF+jXdRIasRKflc7jkobm1Z9te1IyZA0pDkhLR98+H37Zf1c/8at+dB7x+7GfVyTfJMPiYztsnl59Y5l4j+0n1RXlpHnF3Tq7HecmNF/CJodEMAikruxiyJaGLvHOdAfoA+oDvpjBm2b91cHGRZMU9n25xEU0A8fgEEAdKI3Q1iDtc034sug5YVMkE2jsE+BIkwSoQ3gxXMqz9tELp48bd0cFKOKS7xYjEuXBnZP5ia7DyiO/X/YI+PQSbt2uSdqAkWL9nQbV1XB94/+uPfdZz8dnXYFBYrcTl2SIR/ybxJNJPz/Gupb0JaZeens2ekC7EKr8t+Ls/P5VJPYJdHKyqfg2nqU6bhlidzcddQV/7MmecTzJ5VPcKXkNKSEogHjYFx6QZ7rQ+FSe8njaiNuOnXS8H2ScQ619c2mC3VTtauL0rRbXd/CkSOP37FY9Zkjz8+GibYUMOEWF+RdrFS8Ecv1SHOpPUPZGEIpjPvFyU5cXKjd6OXqorTqy9GwRd++HVufPGnVsW+aO3vggKZ18jR9sXaTC1PWTEsVUaK0FkNySbTQDqlm2PfDjZcu4aalnSLKjnOoYQ0nUlqqXcGpPu/4VgV/xU2pAqW4BW3qzhQ8/hFKhV2qE3+BKAtDqBXjfgnVdH4y0wg5tbVNRenNdTWOrenWLcupQdmsbq5b+18piTe/xRdp1xbILxNPJGInm2z6hoB21Lal0i+ePTtd7B45+3XhFJ329evskXm7qurUVREotqSluSo/L29d3qDhI4YOQqWhI4YNvBNfsMHeXKemXrxQfKeuPOGRVayA3JtkJKEgbPp+dXUDluddutRYLFoXGXWX6N3WFaGLbQtRSitVYNacTNSdy7AaG/HSaUEANcBoGXNdcZvZsOqQ1icBDv21/gzAoYPHH/WDW0qNR3QTYKEAEHig6o13NXbND06CQPlRtYjGNnSktRc09k1mAMDvAlDKfQjgy6fssInlfzmNAjKkDxoxHOBLdVRAIVt9j4qo+hA1w9T1aNBNTUOTTNUHLbqokE+UAfJXCIGw/IxCSL5GRUJeR40rL/UxTm4Q08H6MbCs70ObuNyIIXrINHQYInF06UUlevTjbQzTh5upiDMzMMogUtEnjPs/Y7jAHCJeB0GBHh04tC6FiB6ZFB1oArUSIoFoqhzCeAN6lHwm0T4C3VVPWvjpSMXReuWesMEcoqrmgtNBGd2noWeV0hNAz9rFeShNJxHGsPa3HXeKTk8b55hahySYHaYKKFFLpCfN8rsoaJn01CR04Gkc+5k7KVTCmClX8Q10HCrUEkVlSX+XO33oQR9609tJ516H497WSobWs5Up6TLaS10/dessIskgJSLiDlWvHVUywpkQ7hdPZqGyiEF0uVQerVcPamT1A3eKXdyI1vG9OoflrSXihZ1qqGE3nhmAgiIbRCQgPLEPtOM3UQwTLYaYYomNlpA44opnjV6jkD6id80OOrzf6BzmMD6eEa1zKyeYG1fzfEf16V6jw9XYOaar1/b2kP/IYX8oR2mcFvv2GtBV3JXgd437AQAA)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-queued{background:var(--brand-bg);color:var(--accent-soft);border:1px solid #2a3160}.button-queued:hover:not(:disabled){border-color:var(--accent)}.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-action-queue{margin-right:0}.row .row-action-queue.is-on{background:var(--brand-bg);color:var(--accent-soft);border-color:#0000}.row .row-action-queue.is-on:hover{border-color:#2a3160}.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 0 auto}.step-pending .step-label,.step-skipped .step-label{color:var(--faint)}.step-current .step-label{color:var(--text);font-weight:500}.step-result{min-width:0;color:var(--faint);white-space:pre;align-items:center;font-size:13px;display:flex}.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;min-width:0;display:inline-flex}.task-link-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.task-link svg{flex-shrink:0}.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}.text-accent{color:var(--accent-soft)}.tabs{border-bottom:1px solid var(--divider);gap:32px;margin-bottom:24px;display:flex}.tab{color:var(--muted);border-bottom:2px solid #0000;align-items:center;gap:10px;margin-bottom:-1px;padding:0 0 12px;display:inline-flex}.tab:hover{color:var(--text-soft)}.tab.is-active{color:var(--text);border-bottom-color:var(--accent)}.tab-count{color:var(--faint);font-size:12px}.tab-count-alert{background:var(--critical-bg);min-width:22px;color:var(--danger);text-align:center;border-radius:10px;padding:1px 7px}.history-row{gap:16px;min-height:60px}.history-icon{flex-shrink:0}.history-title{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.history-meta{color:var(--faint);white-space:nowrap;text-overflow:ellipsis;font-size:12px;overflow:hidden}.history-date{width:110px;color:var(--text-soft);flex-shrink:0}.history-counts{text-overflow:ellipsis;white-space:nowrap;flex-shrink:0;width:150px;font-weight:400;overflow:hidden}.history-claude{width:150px;color:var(--accent-soft);white-space:nowrap;flex-shrink:0;align-items:center;gap:6px;display:inline-flex}.history-claude svg{flex-shrink:0}.history-outcome{text-align:right;width:110px;color:var(--muted);white-space:nowrap;flex-shrink:0;font-size:12px}.history-outcome .pr-note{justify-content:flex-end}.history-note{margin-top:14px}@media (width<=900px){.history-claude,.history-date{display:none}}.pager{border:1px solid var(--border-strong);border-radius:8px;align-items:center;height:36px;display:inline-flex}.pager-arrow{width:32px;height:100%;color:var(--muted);justify-content:center;align-items:center;display:inline-flex}.pager-arrow:hover{color:var(--text)}.pager-arrow.is-disabled{color:var(--idle);pointer-events:none}.pager-position{color:var(--muted);font-size:12px}.sessions{grid-template-columns:220px minmax(0,1fr);align-items:start;gap:20px;display:grid}.session-list{flex-direction:column;gap:10px;display:flex}.session-card{background:var(--surface);border:1px solid var(--border);text-align:left;border-radius:8px;flex-direction:column;gap:6px;padding:12px 14px;display:flex}.session-card:hover{background:var(--surface-raised)}.session-card.is-active{background:var(--surface-current);border-color:var(--accent)}.session-card-title{color:var(--text);align-items:center;gap:8px;display:flex}.session-card-meta{color:var(--faint);margin-left:22px;font-size:11px}.session-detail{padding:22px 24px}.session-title{margin-bottom:6px;font-size:15px;font-weight:500}.session-section{margin-top:22px}.session-section-title{color:var(--muted);margin-bottom:8px;font-size:12px}.session-tasks{margin:0;padding:0;list-style:none}.session-tasks li{align-items:center;gap:12px;min-height:24px;display:flex}.session-task-title{color:var(--text-soft);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.session-task-role{color:var(--faint);white-space:nowrap;flex:1;font-size:12px}.icon-link{color:var(--faint);display:inline-flex}.icon-link:hover{color:var(--text)}.session-remarks{border-left:2px solid var(--border-strong);color:var(--text-soft);margin:0;padding:0 0 0 14px;line-height:1.7;list-style:none}.session-events{flex-direction:column;gap:4px;display:flex}.session-message{color:var(--text-soft);white-space:pre-wrap;word-break:break-word;margin:6px 0 2px;line-height:1.6}.session-tool{color:var(--faint);text-overflow:ellipsis;white-space:nowrap;margin:0 0 0 12px;font-size:12px;overflow:hidden}.session-text{color:var(--text-soft);line-height:1.6}.session-line{color:var(--muted);align-items:center;gap:6px;margin-top:8px;font-size:12px;display:flex}.session-detail .repair-changes{margin-left:0}@media (width<=900px){.sessions{grid-template-columns:minmax(0,1fr)}}