@imenam/mcp-dependabot-tracker 1.0.11 → 1.0.12
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 +3 -3
- package/dist/src/core/commands.d.ts +2 -2
- package/dist/src/core/commands.js +1 -1
- package/dist/src/core/npm-sandbox.d.ts +17 -0
- package/dist/src/core/npm-sandbox.js +89 -0
- package/dist/src/core/operations.d.ts +3 -2
- package/dist/src/core/operations.js +19 -5
- package/dist/src/core/repair.d.ts +7 -0
- package/dist/src/core/repair.js +52 -11
- package/dist/src/index.js +1 -1
- package/dist/src/npm-tools.d.ts +10 -0
- package/dist/src/npm-tools.js +136 -0
- package/gui/dist/assets/{index-CSbeloLm.js → index-D98CR3xl.js} +1 -1
- package/gui/dist/assets/{index-CPYr3dz7.css → index-DETLqB3f.css} +1 -1
- package/gui/dist/index.html +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -191,13 +191,13 @@ Quand l'analyse a créé sa tâche et que des vulnérabilités restent après `n
|
|
|
191
191
|
« Lancer les corrections » :
|
|
192
192
|
|
|
193
193
|
1. crée la branche `fix/npm-audit-…` et y commite les lockfiles modifiés par `npm audit fix` (premier commit, avec le message par défaut), s'ils ont changé ;
|
|
194
|
-
2. lance une session Claude Code dans le clone. Claude relit la tâche et ses commentaires, monte ou épingle les dépendances (`package.json`, entrées `overrides`,
|
|
194
|
+
2. lance une session Claude Code dans le clone. Claude relit la tâche et ses commentaires, monte ou épingle les dépendances (`package.json`, entrées `overrides`, puis mise à jour du lockfile), adapte le code, relance `npm audit`, installe les dépendances (`npm ci`) et lance les tests, par les outils npm du tracker ;
|
|
195
195
|
3. Claude crée une **sous-tâche « Rapport de développement »** de la tâche de l'analyse, assignée au propriétaire de l'espace et taguée du nom du dépôt : le détail de chaque changement, la prise en compte de chaque remarque, le résultat de l'audit et des tests, ce qui reste à vérifier à la main. Il rend un rapport structuré : clé de la sous-tâche, résumé, fichiers modifiés, message de commit, résultat des tests ;
|
|
196
196
|
4. le tracker vérifie la sous-tâche (rattachée à la tâche de l'analyse, assignée, taguée), commite les changements de Claude (second commit, au message proposé par Claude, avec `Co-Authored-By: Claude`), sans les `node_modules`, puis relance `npm audit`.
|
|
197
197
|
|
|
198
198
|
L'étape « Commit et push » montre alors ce que Claude a changé : résumé, fichiers, tests, vulnérabilités restantes et lien vers la sous-tâche. « Relancer avec mes remarques » refait un passage après de nouveaux commentaires : Claude repart de ses changements précédents, met à jour la même sous-tâche, et son commit remplace le précédent. La branche garde ainsi deux commits, celui de `npm audit fix` et celui de Claude. Un passage qui échoue remet le clone dans l'état du passage précédent et affiche l'erreur sous l'étape ; l'annulation de l'opération arrête Claude Code.
|
|
199
199
|
|
|
200
|
-
**Ce que Claude peut faire** — outils intégrés `Read`, `Grep`, `Glob`, `Edit
|
|
200
|
+
**Ce que Claude peut faire** — outils intégrés `Read`, `Grep`, `Glob`, `Edit` et `Write`, sans shell : ni `git`, ni push. `Edit` et `Write` refusent tout chemin hors du clone (`blockWritesOutsideWorkingDirectories`). Claude lance npm par les outils d'un second serveur MCP, `npm`, que le tracker lui fournit (`dist/src/npm-tools.js`) : `npm_install_lockfile` (`npm install --package-lock-only --ignore-scripts`, avec les paquets à ajouter ou monter), `npm_audit` (avec le périmètre de l'opération), `npm_ci`, `npm_test`, `npm_run` (un script de `package.json`), `npm_ls` et `tsc` (`npm exec --no -- tsc --noEmit`). Chaque outil lance une commande fixe dans un dossier du clone qui contient un `package.json` ; ses arguments ne sont que des noms de paquets ou de scripts. Le bac à sable de Claude Code garde en lecture seule les manifestes, les lockfiles et `node_modules` : ces commandes tournent donc hors de lui, dans un bac à sable **bubblewrap** du tracker. Seuls le système (`/usr`, `/etc`, Node.js…) y est visible, en lecture seule ; le clone et le cache npm de l'opération y sont en écriture, `/tmp` est vide, et l'environnement se réduit à `PATH`, `LANG`, `HOME`, au cache npm et à `CI=true` : ni les données du tracker, ni les autres clones, ni aucun token. Le réseau reste ouvert pour `npm ci`. Hors de Linux, ces commandes tournent directement dans le clone. Claude Code ne reçoit jamais `GITHUB_TOKEN`, et `CLAUDE_CODE_SUBPROCESS_ENV_SCRUB` retire son propre token de l'environnement des processus qu'il lance ; sous Linux, Claude Code exige alors lui aussi bubblewrap. Installez-le sur le serveur (`sudo apt-get install -y bubblewrap socat`). Avant chaque lancement, le tracker crée un bac à sable d'essai avec le compte et les restrictions du serveur ; s'il échoue, le lancement est refusé avec la raison : `bwrap` absent, restriction AppArmor des espaces de noms utilisateur (`kernel.apparmor_restrict_unprivileged_userns`, Ubuntu 24.04 et suivantes) ou durcissement du service (`RestrictNamespaces`, `PrivateUsers`, `SystemCallFilter`). Côté organizer, seuls `get_task`, `create_task`, `update_task`, `set_assignees` et `set_tags` sont autorisés. Installer les dépendances et lancer les tests exécute le code du projet et de ses paquets dans le clone : les corrections ne se lancent qu'à la demande de l'utilisateur. Les limites de tours et de durée sont celles de l'analyse.
|
|
201
201
|
|
|
202
202
|
---
|
|
203
203
|
|
|
@@ -278,4 +278,4 @@ cd gui && npm run lint # oxlint
|
|
|
278
278
|
| `gui/` | Vite + React 19 + zustand, CSS écrit à la main. |
|
|
279
279
|
| `test/` | Tests `node --test`. |
|
|
280
280
|
|
|
281
|
-
Les tests utilisent une fausse API GitHub (dépôts, alertes paginées, utilisateur, création et liste des pull requests) et des dépôts nus locaux servis par `file://` (`GITHUB_API_URL`, `GITHUB_SERVER_URL`). `test/operations.test.ts` et `test/server.test.ts` lancent un vrai `npm audit` sur un petit projet vulnérable (`test/fixtures/vulnerable` : `lodash`, corrigé par `audit fix`, et `nth-check`, corrigé seulement par `--force` ; `test/fixtures/vulnerable-dev`, le même avec `nth-check` en devDependency, pour le périmètre production) : ils ont besoin du registre npm et sont ignorés, avec la raison, s'il est injoignable. `test/server.test.ts` lance le serveur sur stdio avec sa GUI sur un port libre et parcourt les outils, les droits et la correction complète depuis l'API de la GUI. L'analyse et les corrections par Claude passent par un faux Claude Code (`test/fake-claude.ts`, qui note ses appels et répond en `stream-json`) et un faux organizer (tâches, sous-tâches, commentaires).
|
|
281
|
+
Les tests utilisent une fausse API GitHub (dépôts, alertes paginées, utilisateur, création et liste des pull requests) et des dépôts nus locaux servis par `file://` (`GITHUB_API_URL`, `GITHUB_SERVER_URL`). `test/operations.test.ts` et `test/server.test.ts` lancent un vrai `npm audit` sur un petit projet vulnérable (`test/fixtures/vulnerable` : `lodash`, corrigé par `audit fix`, et `nth-check`, corrigé seulement par `--force` ; `test/fixtures/vulnerable-dev`, le même avec `nth-check` en devDependency, pour le périmètre production) : ils ont besoin du registre npm et sont ignorés, avec la raison, s'il est injoignable. `test/server.test.ts` lance le serveur sur stdio avec sa GUI sur un port libre et parcourt les outils, les droits et la correction complète depuis l'API de la GUI. L'analyse et les corrections par Claude passent par un faux Claude Code (`test/fake-claude.ts`, qui note ses appels, appelle les outils du serveur `npm` du tracker et répond en `stream-json`) et un faux organizer (tâches, sous-tâches, commentaires).
|
|
@@ -16,13 +16,13 @@ export declare class CommandAbortedError extends Error {
|
|
|
16
16
|
/** Arrête le processus et ses enfants : sous Windows, `npm` tourne dans un `cmd.exe` qui ne transmet pas le signal. */
|
|
17
17
|
export declare function killTree(pid: number): void;
|
|
18
18
|
/**
|
|
19
|
-
* Lance `git` ou `
|
|
19
|
+
* Lance `git`, `npm` ou `bwrap` sans shell, et attend sa fin. La commande reçoit
|
|
20
20
|
* l'environnement du serveur sans GITHUB_TOKEN, plus `options.env`. Sous Windows,
|
|
21
21
|
* `npm` est un script `.cmd` que Node ne lance qu'à travers un shell : ses
|
|
22
22
|
* arguments sont alors des options fixes, jamais une valeur venue de
|
|
23
23
|
* l'utilisateur. Le code de sortie n'est pas interprété ici ; un dépassement de
|
|
24
24
|
* `timeoutMs` ou l'annulation par `signal` arrêtent la commande.
|
|
25
25
|
*/
|
|
26
|
-
export declare function runCommand(command: "git" | "npm", args: string[], options: CommandOptions): Promise<CommandResult>;
|
|
26
|
+
export declare function runCommand(command: "git" | "npm" | "bwrap", args: string[], options: CommandOptions): Promise<CommandResult>;
|
|
27
27
|
/** Dernières lignes non vides d'une sortie, pour un message d'erreur ou le journal. */
|
|
28
28
|
export declare function tail(text: string, lines?: number): string;
|
|
@@ -27,7 +27,7 @@ function inheritedEnv() {
|
|
|
27
27
|
return env;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* Lance `git` ou `
|
|
30
|
+
* Lance `git`, `npm` ou `bwrap` sans shell, et attend sa fin. La commande reçoit
|
|
31
31
|
* l'environnement du serveur sans GITHUB_TOKEN, plus `options.env`. Sous Windows,
|
|
32
32
|
* `npm` est un script `.cmd` que Node ne lance qu'à travers un shell : ses
|
|
33
33
|
* arguments sont alors des options fixes, jamais une valeur venue de
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type CommandResult } from "./commands.js";
|
|
2
|
+
export interface NpmSandbox {
|
|
3
|
+
/** Clone du dépôt, seul dossier du projet en écriture. */
|
|
4
|
+
root: string;
|
|
5
|
+
/** Cache npm de l'opération, hors du clone. */
|
|
6
|
+
cache: string;
|
|
7
|
+
}
|
|
8
|
+
/** Arguments de bubblewrap pour lancer `npm <args>` dans `cwd`, un dossier du clone. */
|
|
9
|
+
export declare function bwrapArgs(sandbox: NpmSandbox, cwd: string, args: string[]): string[];
|
|
10
|
+
/**
|
|
11
|
+
* Dossier d'un projet du clone, d'après son chemin relatif (`""` pour la
|
|
12
|
+
* racine) ; lève une erreur hors du clone, dans `node_modules` ou sans
|
|
13
|
+
* `package.json`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function projectDir(sandbox: NpmSandbox, project: string): string;
|
|
16
|
+
/** Lance `npm <args>` dans un projet du clone et rend son code de sortie et ses sorties. */
|
|
17
|
+
export declare function runSandboxedNpm(sandbox: NpmSandbox, project: string, args: string[], platform?: NodeJS.Platform): Promise<CommandResult>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { runCommand } from "./commands.js";
|
|
4
|
+
import { TrackerError } from "./errors.js";
|
|
5
|
+
/**
|
|
6
|
+
* Commandes npm lancées pour Claude pendant ses corrections, hors du bac à sable
|
|
7
|
+
* de Claude Code, qui garde en lecture seule les manifestes, les lockfiles et
|
|
8
|
+
* `node_modules`. Sous Linux, chaque commande tourne dans un bac à sable
|
|
9
|
+
* bubblewrap du tracker : système en lecture seule (`/usr`, `/etc`, Node.js…),
|
|
10
|
+
* clone et cache npm de l'opération en écriture, `/tmp` vide, aucun autre
|
|
11
|
+
* dossier du serveur visible (ni les données du tracker, ni les autres clones),
|
|
12
|
+
* environnement réduit à PATH, LANG, HOME et au cache npm. Ailleurs, la
|
|
13
|
+
* commande tourne directement dans le clone, avec le cache de l'opération.
|
|
14
|
+
*/
|
|
15
|
+
/** Dossiers système montés en lecture seule, ou recréés en lien symbolique quand ils en sont un. */
|
|
16
|
+
const SYSTEM_DIRS = ["/usr", "/bin", "/sbin", "/lib", "/lib32", "/lib64", "/etc", "/opt", "/run/systemd/resolve"];
|
|
17
|
+
/** Variables transmises à npm : chemins, langue, HOME dans `/tmp`, cache de l'opération, mode CI pour que les tests ne restent pas en veille. */
|
|
18
|
+
function npmEnv(sandbox, home) {
|
|
19
|
+
return {
|
|
20
|
+
PATH: process.env.PATH ?? "/usr/bin:/bin",
|
|
21
|
+
LANG: process.env.LANG ?? "C.UTF-8",
|
|
22
|
+
HOME: home,
|
|
23
|
+
npm_config_cache: sandbox.cache,
|
|
24
|
+
npm_config_update_notifier: "false",
|
|
25
|
+
CI: "true",
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/** Préfixe d'installation de Node.js (`<préfixe>/bin/node`), où se trouve aussi npm. */
|
|
29
|
+
function nodePrefix() {
|
|
30
|
+
return path.dirname(path.dirname(fs.realpathSync(process.execPath)));
|
|
31
|
+
}
|
|
32
|
+
/** Arguments de bubblewrap pour lancer `npm <args>` dans `cwd`, un dossier du clone. */
|
|
33
|
+
export function bwrapArgs(sandbox, cwd, args) {
|
|
34
|
+
const mounts = [];
|
|
35
|
+
for (const dir of [...SYSTEM_DIRS, nodePrefix()]) {
|
|
36
|
+
let stat;
|
|
37
|
+
try {
|
|
38
|
+
stat = fs.lstatSync(dir);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (stat.isSymbolicLink())
|
|
44
|
+
mounts.push("--symlink", fs.readlinkSync(dir), dir);
|
|
45
|
+
else
|
|
46
|
+
mounts.push("--ro-bind", dir, dir);
|
|
47
|
+
}
|
|
48
|
+
const env = Object.entries(npmEnv(sandbox, "/tmp")).flatMap(([name, value]) => ["--setenv", name, value]);
|
|
49
|
+
return [
|
|
50
|
+
"--die-with-parent",
|
|
51
|
+
"--new-session",
|
|
52
|
+
"--unshare-pid",
|
|
53
|
+
"--unshare-ipc",
|
|
54
|
+
...mounts,
|
|
55
|
+
"--dev", "/dev",
|
|
56
|
+
"--proc", "/proc",
|
|
57
|
+
"--tmpfs", "/tmp",
|
|
58
|
+
"--bind", sandbox.root, sandbox.root,
|
|
59
|
+
"--bind", sandbox.cache, sandbox.cache,
|
|
60
|
+
"--chdir", cwd,
|
|
61
|
+
"--clearenv",
|
|
62
|
+
...env,
|
|
63
|
+
"npm",
|
|
64
|
+
...args,
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Dossier d'un projet du clone, d'après son chemin relatif (`""` pour la
|
|
69
|
+
* racine) ; lève une erreur hors du clone, dans `node_modules` ou sans
|
|
70
|
+
* `package.json`.
|
|
71
|
+
*/
|
|
72
|
+
export function projectDir(sandbox, project) {
|
|
73
|
+
const dir = path.resolve(sandbox.root, project);
|
|
74
|
+
const relative = path.relative(sandbox.root, dir);
|
|
75
|
+
if (relative.startsWith("..") || path.isAbsolute(relative) || relative.split(path.sep).includes("node_modules")) {
|
|
76
|
+
throw new TrackerError(`"${project}" is not a project folder of the repository.`);
|
|
77
|
+
}
|
|
78
|
+
if (!fs.existsSync(path.join(dir, "package.json")))
|
|
79
|
+
throw new TrackerError(`"${project || "."}" has no package.json.`);
|
|
80
|
+
return dir;
|
|
81
|
+
}
|
|
82
|
+
/** Lance `npm <args>` dans un projet du clone et rend son code de sortie et ses sorties. */
|
|
83
|
+
export function runSandboxedNpm(sandbox, project, args, platform = process.platform) {
|
|
84
|
+
const cwd = projectDir(sandbox, project);
|
|
85
|
+
fs.mkdirSync(sandbox.cache, { recursive: true });
|
|
86
|
+
if (platform === "linux")
|
|
87
|
+
return runCommand("bwrap", bwrapArgs(sandbox, cwd, args), { cwd: sandbox.root, env: {} });
|
|
88
|
+
return runCommand("npm", args, { cwd, env: npmEnv(sandbox, sandbox.cache) });
|
|
89
|
+
}
|
|
@@ -46,9 +46,10 @@ export declare function decideForce(ctx: OperationContext, id: string, apply: bo
|
|
|
46
46
|
/**
|
|
47
47
|
* Lance ou passe les corrections par Claude d'une opération qui les attend ;
|
|
48
48
|
* `run` sur une opération qui attend le push après un passage relance Claude
|
|
49
|
-
* avec les remarques de l'utilisateur.
|
|
49
|
+
* avec les remarques de l'utilisateur. Un lancement est refusé tant que le
|
|
50
|
+
* bac à sable de Claude Code ne peut pas démarrer sur le serveur.
|
|
50
51
|
*/
|
|
51
|
-
export declare function decideRepair(ctx: OperationContext, id: string, run: boolean): Operation
|
|
52
|
+
export declare function decideRepair(ctx: OperationContext, id: string, run: boolean): Promise<Operation>;
|
|
52
53
|
/** Commit, push et pull request d'une opération qui attend le push. */
|
|
53
54
|
export declare function pushOperation(ctx: OperationContext, id: string, commitMessage: string): Operation;
|
|
54
55
|
/**
|
|
@@ -7,7 +7,7 @@ import { CommandAbortedError, runCommand, tail } from "./commands.js";
|
|
|
7
7
|
import { ConflictError, TrackerError } from "./errors.js";
|
|
8
8
|
import { GitHubClient } from "./github.js";
|
|
9
9
|
import { diffLockfiles, forceCandidates, parseAuditReport, parseLockfile, parseNpmJson, projectLabel, } from "./npm-audit.js";
|
|
10
|
-
import { repairVulnerabilities } from "./repair.js";
|
|
10
|
+
import { assertSandboxAvailable, repairVulnerabilities } from "./repair.js";
|
|
11
11
|
import { assertNotDeprecated, isActive } from "./store.js";
|
|
12
12
|
/** Intervalle de lecture de la demande d'annulation pendant une étape. */
|
|
13
13
|
const CANCEL_POLL_MS = 500;
|
|
@@ -160,10 +160,21 @@ class Runner {
|
|
|
160
160
|
const file = path.join(this.repoDir, project, "package-lock.json");
|
|
161
161
|
return parseLockfile(fs.readFileSync(file, "utf-8"), project);
|
|
162
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* Commit cloné : HEAD tant que le tracker n'a rien commité ; après le commit
|
|
165
|
+
* de `npm audit fix`, son parent, et sans ce commit, la base des corrections
|
|
166
|
+
* par Claude.
|
|
167
|
+
*/
|
|
168
|
+
get clonedCommit() {
|
|
169
|
+
const repair = this.operation.repair;
|
|
170
|
+
if (!repair)
|
|
171
|
+
return "HEAD";
|
|
172
|
+
return repair.auditCommit ? `${repair.auditCommit}~1` : repair.base;
|
|
173
|
+
}
|
|
163
174
|
/** Lockfile du projet tel qu'il est dans le commit cloné. */
|
|
164
175
|
async originalLock(project) {
|
|
165
176
|
const file = project === "" ? "package-lock.json" : `${project}/package-lock.json`;
|
|
166
|
-
return parseLockfile(await this.git(["show",
|
|
177
|
+
return parseLockfile(await this.git(["show", `${this.clonedCommit}:${file}`]), project);
|
|
167
178
|
}
|
|
168
179
|
}
|
|
169
180
|
// --- Étapes -------------------------------------------------------------------
|
|
@@ -488,7 +499,7 @@ function finish(runner) {
|
|
|
488
499
|
*/
|
|
489
500
|
function settleForPush(runner) {
|
|
490
501
|
const operation = runner.operation;
|
|
491
|
-
if (operation.changes.length > 0 || operation.repair?.commit) {
|
|
502
|
+
if (operation.changes.length > 0 || operation.repair?.auditCommit || operation.repair?.commit) {
|
|
492
503
|
runner.update((current) => ({ ...current, status: "waiting_push", branch: current.branch ?? branchName(new Date()) }));
|
|
493
504
|
}
|
|
494
505
|
else {
|
|
@@ -636,9 +647,12 @@ export function decideForce(ctx, id, apply) {
|
|
|
636
647
|
/**
|
|
637
648
|
* Lance ou passe les corrections par Claude d'une opération qui les attend ;
|
|
638
649
|
* `run` sur une opération qui attend le push après un passage relance Claude
|
|
639
|
-
* avec les remarques de l'utilisateur.
|
|
650
|
+
* avec les remarques de l'utilisateur. Un lancement est refusé tant que le
|
|
651
|
+
* bac à sable de Claude Code ne peut pas démarrer sur le serveur.
|
|
640
652
|
*/
|
|
641
|
-
export function decideRepair(ctx, id, run) {
|
|
653
|
+
export async function decideRepair(ctx, id, run) {
|
|
654
|
+
if (run)
|
|
655
|
+
await assertSandboxAvailable();
|
|
642
656
|
const relaunch = run && ctx.store.getOperation(id).status === "waiting_push";
|
|
643
657
|
const operation = resume(ctx, id, relaunch ? "waiting_push" : "waiting_repair", (current) => {
|
|
644
658
|
if (relaunch && !current.repair?.report)
|
|
@@ -2,6 +2,13 @@ import type { RemarksResponse } from "../../shared/schemas/api.schema.js";
|
|
|
2
2
|
import { type AnalysisTask, type AuditScope, type Operation, type RepairReport } 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
|
+
/**
|
|
6
|
+
* Vérifie, sous Linux, que bubblewrap crée un bac à sable pour le compte et
|
|
7
|
+
* avec les restrictions du serveur : le tracker s'en sert pour lancer les
|
|
8
|
+
* commandes npm de Claude, et Claude Code refuse de démarrer sans lui. Lève une erreur qui
|
|
9
|
+
* dit quoi installer ou régler ; sans effet sur les autres systèmes.
|
|
10
|
+
*/
|
|
11
|
+
export declare function assertSandboxAvailable(platform?: NodeJS.Platform, command?: string): Promise<void>;
|
|
5
12
|
export interface RepairInput {
|
|
6
13
|
repoId: string;
|
|
7
14
|
branch: string;
|
package/dist/src/core/repair.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
+
import { spawn } from "child_process";
|
|
1
2
|
import fs from "fs";
|
|
2
3
|
import path from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
3
5
|
import { z } from "zod";
|
|
4
6
|
import { RepairReportSchema, TEST_OUTCOMES } from "../../shared/schemas/model.schema.js";
|
|
5
7
|
import { ORGANIZER_SERVER, factsJson, organizerServer } from "./analysis.js";
|
|
6
8
|
import { runClaudeSession } from "./claude.js";
|
|
9
|
+
import { tail } from "./commands.js";
|
|
7
10
|
import { TrackerError } from "./errors.js";
|
|
8
11
|
import { OrganizerClient } from "./organizer.js";
|
|
9
12
|
import { organizerConnection } from "./settings.js";
|
|
10
13
|
/**
|
|
11
14
|
* Corrections par Claude des vulnérabilités que `npm audit fix` laisse dans un
|
|
12
15
|
* clone, d'après la tâche de l'analyse et les commentaires que l'utilisateur y
|
|
13
|
-
* a laissés. Claude modifie le clone (Read, Grep, Glob, Edit, Write
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
+
* a laissés. Claude modifie le clone (Read, Grep, Glob, Edit, Write), sans git
|
|
17
|
+
* ni écriture hors du clone, et lance les commandes npm (lockfile, audit,
|
|
18
|
+
* installation, tests) par les outils du serveur `npm-tools`, que le tracker
|
|
19
|
+
* exécute dans son propre bac à sable, sans aucun token. Il crée
|
|
16
20
|
* une sous-tâche « rapport de développement » de la tâche de l'analyse, ou met
|
|
17
21
|
* à jour celle d'un passage précédent, puis rend un rapport structuré. Le
|
|
18
22
|
* tracker relit la sous-tâche sur l'organizer : absente, rattachée à une autre
|
|
@@ -20,10 +24,45 @@ import { organizerConnection } from "./settings.js";
|
|
|
20
24
|
*/
|
|
21
25
|
/** Outils organizer autorisés ; tout autre appel est refusé par `dontAsk`. */
|
|
22
26
|
const ORGANIZER_TOOLS = ["get_task", "create_task", "update_task", "set_assignees", "set_tags"];
|
|
23
|
-
/**
|
|
24
|
-
const
|
|
27
|
+
/** Serveur MCP des commandes npm, dans la configuration de la session. */
|
|
28
|
+
const NPM_SERVER = "npm";
|
|
29
|
+
/** Outils du serveur `npm-tools`. */
|
|
30
|
+
const NPM_TOOLS = ["npm_install_lockfile", "npm_audit", "npm_ci", "npm_test", "npm_run", "npm_ls", "tsc"];
|
|
25
31
|
/** Réglages de la session : Edit et Write refusent tout chemin hors du clone. */
|
|
26
32
|
const SESSION_SETTINGS = { permissions: { blockWritesOutsideWorkingDirectories: true } };
|
|
33
|
+
/** Lancement du serveur `npm-tools` du tracker sur le clone et le cache npm de l'opération. */
|
|
34
|
+
function npmServer(input, cache) {
|
|
35
|
+
const entry = fileURLToPath(new URL("../npm-tools.js", import.meta.url));
|
|
36
|
+
return { command: process.execPath, args: [entry, "--root", input.cwd, "--cache", cache, "--scope", input.scope] };
|
|
37
|
+
}
|
|
38
|
+
/** Bac à sable minimal, du type de ceux où le tracker lance les commandes npm sous Linux. */
|
|
39
|
+
const BWRAP_PROBE = ["--ro-bind", "/", "/", "--dev", "/dev", "--proc", "/proc", "--unshare-user", "--unshare-pid", "--unshare-net", "true"];
|
|
40
|
+
/** Durée maximale du test de bubblewrap. */
|
|
41
|
+
const BWRAP_PROBE_TIMEOUT_MS = 10_000;
|
|
42
|
+
/**
|
|
43
|
+
* Vérifie, sous Linux, que bubblewrap crée un bac à sable pour le compte et
|
|
44
|
+
* avec les restrictions du serveur : le tracker s'en sert pour lancer les
|
|
45
|
+
* commandes npm de Claude, et Claude Code refuse de démarrer sans lui. Lève une erreur qui
|
|
46
|
+
* dit quoi installer ou régler ; sans effet sur les autres systèmes.
|
|
47
|
+
*/
|
|
48
|
+
export function assertSandboxAvailable(platform = process.platform, command = "bwrap") {
|
|
49
|
+
if (platform !== "linux")
|
|
50
|
+
return Promise.resolve();
|
|
51
|
+
return new Promise((resolve, reject) => {
|
|
52
|
+
const child = spawn(command, BWRAP_PROBE, { stdio: ["ignore", "ignore", "pipe"], timeout: BWRAP_PROBE_TIMEOUT_MS });
|
|
53
|
+
let stderr = "";
|
|
54
|
+
child.stderr.on("data", (chunk) => (stderr += String(chunk)));
|
|
55
|
+
child.on("error", (err) => reject(new TrackerError(err.code === "ENOENT"
|
|
56
|
+
? "The fixes by Claude need bubblewrap (bwrap), which isolates the npm commands of Claude on Linux, and it is not in the PATH of the MCP server. Install it on the server: sudo apt-get install -y bubblewrap socat"
|
|
57
|
+
: `The fixes by Claude need bubblewrap (bwrap), which could not be started: ${err.message}`)));
|
|
58
|
+
child.on("close", (code) => {
|
|
59
|
+
if (code === 0)
|
|
60
|
+
return resolve();
|
|
61
|
+
reject(new TrackerError(`bubblewrap (bwrap) is installed but cannot create a sandbox for the account of the MCP server${stderr.trim() ? `: ${tail(stderr, 3)}` : "."} ` +
|
|
62
|
+
"Check the AppArmor restriction on user namespaces (kernel.apparmor_restrict_unprivileged_userns on Ubuntu 24.04 and later) and the hardening of the service (RestrictNamespaces, PrivateUsers, SystemCallFilter)."));
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
27
66
|
/** Résultat demandé à Claude : le rapport et la clé de la sous-tâche. */
|
|
28
67
|
const OutputSchema = RepairReportSchema.extend({ task: z.string().min(1), commitMessage: z.string().trim().min(1) });
|
|
29
68
|
const OUTPUT_JSON_SCHEMA = {
|
|
@@ -73,9 +112,10 @@ function prompt(input, space, owner, tag) {
|
|
|
73
112
|
"",
|
|
74
113
|
"Your job:",
|
|
75
114
|
`1. Read the organizer task ${input.analysisTask} with get_task: its description is the analysis of these vulnerabilities, and its comments are the remarks of the user. Follow the remarks: they take precedence over the analysis.`,
|
|
76
|
-
|
|
77
|
-
`3. Check your work
|
|
78
|
-
" You
|
|
115
|
+
`2. Fix what can be fixed, with minimal changes: upgrade a dependency in package.json, or pin a transitive one with an \`overrides\` entry, with Edit, then update the lockfile with the ${NPM_SERVER} tool npm_install_lockfile in the folder of the package-lock.json; adapt the code to the new versions.`,
|
|
116
|
+
`3. Check your work with the ${NPM_SERVER} tools, the only way to run npm here: npm_audit${omit ? " (it runs `npm audit" + omit + "`)" : ""} in each project; npm_ci to install the dependencies, then npm_test (or npm_run with the test script of package.json) when the project has some; npm_ls and tsc when useful. Their \`project\` argument is the folder of the package.json, "" for the root.`,
|
|
117
|
+
" You have no shell. Never write outside the current directory: the tracker commits your changes, node_modules aside.",
|
|
118
|
+
" If a command fails, quote its exact error, with the path it names, in your report.",
|
|
79
119
|
`4. Report in the organizer space "${space}": ${report} Its description, in French markdown, details every change file by file and why, how each remark of the user was taken into account, the result of the audit and of the tests, and what is left to check by hand.`,
|
|
80
120
|
` Assign it to ${owner.name} with set_assignees (member id ${owner.id}), and set its tags to exactly ["${tag}"] with set_tags.`,
|
|
81
121
|
"5. Finish with the structured report: the key of the sub-task, a summary in French, every changed file with its change in a few words in French, a conventional commit message in English for your changes, and the outcome of the tests with a one-sentence detail in French.",
|
|
@@ -102,7 +142,8 @@ export async function repairVulnerabilities(input) {
|
|
|
102
142
|
const { space, owner } = await organizer.space();
|
|
103
143
|
const tag = input.repoId.split("/")[1];
|
|
104
144
|
const configFile = path.join(input.workDir, "repair-mcp.json");
|
|
105
|
-
|
|
145
|
+
const servers = { [ORGANIZER_SERVER]: organizerServer(connection), [NPM_SERVER]: npmServer(input, path.join(input.workDir, "npm-cache")) };
|
|
146
|
+
fs.writeFileSync(configFile, JSON.stringify({ mcpServers: servers }), { encoding: "utf-8", mode: 0o600 });
|
|
106
147
|
let structured;
|
|
107
148
|
try {
|
|
108
149
|
({ structured } = await runClaudeSession(input.claude, {
|
|
@@ -110,9 +151,9 @@ export async function repairVulnerabilities(input) {
|
|
|
110
151
|
prompt: prompt(input, space.name, owner, tag),
|
|
111
152
|
args: [
|
|
112
153
|
"--tools",
|
|
113
|
-
"Read,Grep,Glob,Edit,Write
|
|
154
|
+
"Read,Grep,Glob,Edit,Write",
|
|
114
155
|
"--allowedTools",
|
|
115
|
-
["Edit", "Write", ...
|
|
156
|
+
["Edit", "Write", ...NPM_TOOLS.map((tool) => `mcp__${NPM_SERVER}__${tool}`), ...ORGANIZER_TOOLS.map((tool) => `mcp__${ORGANIZER_SERVER}__${tool}`)].join(","),
|
|
116
157
|
"--settings",
|
|
117
158
|
JSON.stringify(SESSION_SETTINGS),
|
|
118
159
|
"--mcp-config",
|
package/dist/src/index.js
CHANGED
|
@@ -228,7 +228,7 @@ async function handleGuiRequest(msg) {
|
|
|
228
228
|
}
|
|
229
229
|
case "DECIDE_REPAIR": {
|
|
230
230
|
const { operationId } = parseRequest(OperationRequestSchema, msg.data);
|
|
231
|
-
return { operation: decideRepair(operations, operationId, parseRequest(RepairBodySchema, msg.data?.body).run) };
|
|
231
|
+
return { operation: await decideRepair(operations, operationId, parseRequest(RepairBodySchema, msg.data?.body).run) };
|
|
232
232
|
}
|
|
233
233
|
case "GET_REMARKS":
|
|
234
234
|
return await analysisRemarks(readSettings(dataDir), store.getOperation(parseRequest(OperationRequestSchema, msg.data).operationId));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CallToolResult } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { type AuditScope } from "../shared/schemas/model.schema.js";
|
|
3
|
+
import { type NpmSandbox } from "./core/npm-sandbox.js";
|
|
4
|
+
import { type Args } from "./tools/types.js";
|
|
5
|
+
/** Arguments npm de l'outil appelé. */
|
|
6
|
+
export declare function npmArgs(tool: string, args: Args, scope: AuditScope): string[];
|
|
7
|
+
/** Lance l'outil et décrit le résultat : commande, code de sortie, fin des sorties. */
|
|
8
|
+
export declare function callNpmTool(sandbox: NpmSandbox, scope: AuditScope, tool: string, args: Args): Promise<CallToolResult>;
|
|
9
|
+
/** Lit `--root`, `--cache` et `--scope`, puis sert les outils sur stdio. */
|
|
10
|
+
export declare function serveNpmTools(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
4
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
6
|
+
import { AUDIT_SCOPES } from "../shared/schemas/model.schema.js";
|
|
7
|
+
import { runSandboxedNpm } from "./core/npm-sandbox.js";
|
|
8
|
+
import { tail } from "./core/commands.js";
|
|
9
|
+
import { APP_VERSION } from "./version.js";
|
|
10
|
+
import { errorResult, requireString, rejectUnknownFields } from "./tools/types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Serveur MCP des commandes npm des corrections par Claude, lancé par Claude
|
|
13
|
+
* Code avec `node npm-tools.js --root <clone> --cache <cache> --scope <périmètre>` :
|
|
14
|
+
* chaque outil lance une commande npm fixe dans un projet du clone, à travers
|
|
15
|
+
* `runSandboxedNpm`, et rend son code de sortie et la fin de ses sorties.
|
|
16
|
+
*/
|
|
17
|
+
/** Lignes de sortie rendues à Claude. */
|
|
18
|
+
const OUTPUT_LINES = 150;
|
|
19
|
+
/** Taille maximale de la sortie rendue à Claude. */
|
|
20
|
+
const OUTPUT_CHARS = 20_000;
|
|
21
|
+
/** Nom de paquet, spécification de version ou nom de script : pas d'option, pas d'espace. */
|
|
22
|
+
const NAME = /^[A-Za-z0-9@/._^~<>=*:+-]+$/;
|
|
23
|
+
const PROJECT_PROPERTY = {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: 'Folder of the package.json, relative to the repository root; "" for the root.',
|
|
26
|
+
};
|
|
27
|
+
const TOOLS = [
|
|
28
|
+
{
|
|
29
|
+
name: "npm_install_lockfile",
|
|
30
|
+
description: "Run npm install --package-lock-only --ignore-scripts in a project: updates package-lock.json (and package.json for the packages given) without installing node_modules. Use it after changing package.json or its overrides.",
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: "object",
|
|
33
|
+
properties: {
|
|
34
|
+
project: PROJECT_PROPERTY,
|
|
35
|
+
packages: { type: "array", items: { type: "string" }, description: "Packages to add or upgrade, e.g. mermaid@12.0.1 (optional)." },
|
|
36
|
+
},
|
|
37
|
+
required: ["project"],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{ name: "npm_audit", description: "Run npm audit in a project, with the scope of the operation.", inputSchema: { type: "object", properties: { project: PROJECT_PROPERTY }, required: ["project"] } },
|
|
41
|
+
{ name: "npm_ci", description: "Run npm ci in a project: installs node_modules from package-lock.json, install scripts included.", inputSchema: { type: "object", properties: { project: PROJECT_PROPERTY }, required: ["project"] } },
|
|
42
|
+
{ name: "npm_test", description: "Run npm test in a project.", inputSchema: { type: "object", properties: { project: PROJECT_PROPERTY }, required: ["project"] } },
|
|
43
|
+
{
|
|
44
|
+
name: "npm_run",
|
|
45
|
+
description: "Run a script of package.json in a project (npm run <script>).",
|
|
46
|
+
inputSchema: { type: "object", properties: { project: PROJECT_PROPERTY, script: { type: "string", description: "Name of the script." } }, required: ["project", "script"] },
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "npm_ls",
|
|
50
|
+
description: "Show where a package is installed in the dependency tree of a project (npm ls <package> --all).",
|
|
51
|
+
inputSchema: { type: "object", properties: { project: PROJECT_PROPERTY, package: { type: "string", description: "Name of the package." } }, required: ["project", "package"] },
|
|
52
|
+
},
|
|
53
|
+
{ name: "tsc", description: "Type-check a project with its own TypeScript (npm exec --no -- tsc --noEmit).", inputSchema: { type: "object", properties: { project: PROJECT_PROPERTY }, required: ["project"] } },
|
|
54
|
+
];
|
|
55
|
+
/** Lit un nom de paquet ou de script ; lève une erreur s'il contient autre chose. */
|
|
56
|
+
function name(value, field) {
|
|
57
|
+
if (!NAME.test(value) || value.startsWith("-"))
|
|
58
|
+
throw new Error(`"${field}" must be a package or script name (got ${JSON.stringify(value)}).`);
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
/** Projet visé : `""` désigne la racine du clone. */
|
|
62
|
+
function project(args) {
|
|
63
|
+
const value = args?.project;
|
|
64
|
+
if (typeof value !== "string")
|
|
65
|
+
throw new Error('"project" is required: the folder of the package.json, "" for the root.');
|
|
66
|
+
return value.trim();
|
|
67
|
+
}
|
|
68
|
+
/** Arguments npm de l'outil appelé. */
|
|
69
|
+
export function npmArgs(tool, args, scope) {
|
|
70
|
+
switch (tool) {
|
|
71
|
+
case "npm_install_lockfile": {
|
|
72
|
+
rejectUnknownFields(args, ["project", "packages"]);
|
|
73
|
+
const packages = args?.packages ?? [];
|
|
74
|
+
if (!Array.isArray(packages) || packages.some((item) => typeof item !== "string"))
|
|
75
|
+
throw new Error('"packages" must be a list of package names.');
|
|
76
|
+
return ["install", "--package-lock-only", "--ignore-scripts", ...packages.map((item) => name(item.trim(), "packages"))];
|
|
77
|
+
}
|
|
78
|
+
case "npm_audit":
|
|
79
|
+
rejectUnknownFields(args, ["project"]);
|
|
80
|
+
return scope === "production" ? ["audit", "--omit=dev"] : ["audit"];
|
|
81
|
+
case "npm_ci":
|
|
82
|
+
rejectUnknownFields(args, ["project"]);
|
|
83
|
+
return ["ci"];
|
|
84
|
+
case "npm_test":
|
|
85
|
+
rejectUnknownFields(args, ["project"]);
|
|
86
|
+
return ["test"];
|
|
87
|
+
case "npm_run":
|
|
88
|
+
rejectUnknownFields(args, ["project", "script"]);
|
|
89
|
+
return ["run", name(requireString(args, "script"), "script")];
|
|
90
|
+
case "npm_ls":
|
|
91
|
+
rejectUnknownFields(args, ["project", "package"]);
|
|
92
|
+
return ["ls", name(requireString(args, "package"), "package"), "--all"];
|
|
93
|
+
case "tsc":
|
|
94
|
+
rejectUnknownFields(args, ["project"]);
|
|
95
|
+
return ["exec", "--no", "--", "tsc", "--noEmit"];
|
|
96
|
+
default:
|
|
97
|
+
throw new Error(`Unknown tool: ${tool}`);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/** Lance l'outil et décrit le résultat : commande, code de sortie, fin des sorties. */
|
|
101
|
+
export async function callNpmTool(sandbox, scope, tool, args) {
|
|
102
|
+
const npm = npmArgs(tool, args, scope);
|
|
103
|
+
const folder = project(args);
|
|
104
|
+
const result = await runSandboxedNpm(sandbox, folder, npm);
|
|
105
|
+
const output = tail(`${result.stdout}\n${result.stderr}`, OUTPUT_LINES);
|
|
106
|
+
const text = [`$ npm ${npm.join(" ")} (in ${folder || "."}, exit code ${result.code})`, output.length > OUTPUT_CHARS ? `…${output.slice(-OUTPUT_CHARS)}` : output].join("\n");
|
|
107
|
+
return { content: [{ type: "text", text }], isError: result.code !== 0 };
|
|
108
|
+
}
|
|
109
|
+
/** Lit `--root`, `--cache` et `--scope`, puis sert les outils sur stdio. */
|
|
110
|
+
export async function serveNpmTools(argv) {
|
|
111
|
+
const option = (flag) => {
|
|
112
|
+
const index = argv.indexOf(flag);
|
|
113
|
+
const value = index === -1 ? undefined : argv[index + 1];
|
|
114
|
+
if (!value)
|
|
115
|
+
throw new Error(`${flag} is required.`);
|
|
116
|
+
return value;
|
|
117
|
+
};
|
|
118
|
+
const sandbox = { root: option("--root"), cache: option("--cache") };
|
|
119
|
+
const scope = option("--scope");
|
|
120
|
+
if (!AUDIT_SCOPES.includes(scope))
|
|
121
|
+
throw new Error(`--scope must be one of ${AUDIT_SCOPES.join(", ")}.`);
|
|
122
|
+
const server = new Server({ name: "mcp-dependabot-tracker-npm", version: APP_VERSION }, { capabilities: { tools: {} } });
|
|
123
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
124
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
125
|
+
try {
|
|
126
|
+
return await callNpmTool(sandbox, scope, request.params.name, request.params.arguments);
|
|
127
|
+
}
|
|
128
|
+
catch (err) {
|
|
129
|
+
return errorResult(err?.message ?? String(err));
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
await server.connect(new StdioServerTransport());
|
|
133
|
+
}
|
|
134
|
+
if (process.argv[1] && fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url))) {
|
|
135
|
+
await serveNpmTools(process.argv.slice(2));
|
|
136
|
+
}
|
|
@@ -61,4 +61,4 @@ Error generating stack: `+e.message+`
|
|
|
61
61
|
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=O,c=!Tt.jitless,l=c&&Ae.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?ei([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function ri(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Ye(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>tt(e,r,Et())))}),t)}var ii=j(`$ZodUnion`,(e,t)=>{$n.init(e,t),A(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),A(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),A(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),A(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>ye(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>ri(t,r,e,i)):ri(o,r,e,i)}}),ai=j(`$ZodIntersection`,(e,t)=>{$n.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>si(e,t,n)):si(e,i,a)}});function oi(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(je(e)&&je(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=oi(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=oi(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function si(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=oi(t.value,n.value);if(!c.valid){if(Ye(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var ci=j(`$ZodEnum`,(e,t)=>{$n.init(e,t);let n=pe(t.entries),r=new Set(n);e._zod.values=r,A(e,`pattern`,e=>{let t=pe(e.def.entries).filter(e=>Ne.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Pe(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),li=j(`$ZodTransform`,(e,t)=>{$n.init(e,t),e._zod.optin=`optional`,Tt.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new wt(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Ct;return n.value=i,n}});function ui(e,t){return e.value=t.issues.length?void 0:t.value,e}var di=j(`$ZodOptional`,(e,t)=>{$n.init(e,t),A(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,A(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),A(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ye(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>ui(e,t)):ui(e,r)}return t.innerType._zod.run(e,n)}}),fi=j(`$ZodExactOptional`,(e,t)=>{di.init(e,t),A(e,`values`,e=>e.def.innerType._zod.values),A(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),pi=j(`$ZodNullable`,(e,t)=>{$n.init(e,t),A(e,`optin`,e=>e.def.innerType._zod.optin),A(e,`optout`,e=>e.def.innerType._zod.optout),A(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${ye(t.source)}|null)$`):void 0}),A(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),mi=j(`$ZodDefault`,(e,t)=>{$n.init(e,t),e._zod.optin=`defaulted`,A(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>hi(e,t)):hi(r,t)}});function hi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var gi=j(`$ZodPrefault`,(e,t)=>{$n.init(e,t),e._zod.optin=`defaulted`,A(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),_i=j(`$ZodNonOptional`,(e,t)=>{$n.init(e,t),A(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>vi(t,e)):vi(i,e)}});function vi(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function yi(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>tt(e,r,Et()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var bi=j(`$ZodCatch`,(e,t)=>{$n.init(e,t),A(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),A(e,`optout`,e=>e.def.innerType._zod.optout),A(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>yi(e,r,t,n)):yi(e,r,t,n)}}),xi=j(`$ZodPipe`,(e,t)=>{$n.init(e,t),A(e,`values`,e=>e.def.in._zod.values),A(e,`optin`,e=>e.def.in._zod.optin),A(e,`optout`,e=>e.def.out._zod.optout),A(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Si(e,t.in,n)):Si(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Si(e,t.out,n)):Si(r,t.out,n)}});function Si(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Ci=j(`$ZodReadonly`,(e,t)=>{$n.init(e,t),A(e,`propValues`,e=>e.def.innerType._zod.propValues),A(e,`values`,e=>e.def.innerType._zod.values),A(e,`optin`,e=>e.def.innerType?._zod?.optin),A(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(wi):wi(r)}});function wi(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Ti=j(`$ZodCustom`,(e,t)=>{Nn.init(e,t),$n.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ei(t,n,r,e));Ei(i,n,r,e)}});function Ei(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ot(e))}}var Di=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Oi=`~memo`,ki=[];function Ai(e){return typeof e==`object`&&!!e}function ji(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Mi=new WeakMap,Ni=0,Pi=1,Fi=2;function Ii(e,t,n){let r=Mi.get(e);if(r!==void 0)return r?Fi:Ni;if(t.has(e))return Fi;t.add(e);let i=Ni,a=e=>{if(i!==Fi&&e?._zod){let r=Ii(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Ni;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Pi:o.value?._zod?Ii(o.value,t,n):Ni;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Se(c);s(e?o(e,!0):Pi),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Ii(r,t,!1):Pi);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Li(e,i)}function Li(e,t){return t!==Pi&&Mi.set(e,t===Fi),t}function Ri(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var zi,Bi=[],Vi={alloc(e,t,n){let r=zi;if(!r)return n;zi=void 0;let i={value:n,issues:null};return r.set(t.value,i),Bi.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Ui(n,e.value))throw new Di;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Ii(e,new Set,!1);if(i===Ni)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Fi||r?n=!0:r=!0}let l=s.value;if(!Ai(l))return t(s,c);let u=c[Oi];u||(u={buckets:new WeakMap,backEdges:void 0},c[Oi]=u);let d;i===c?d=a:(d=Ri(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...ji(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;zi=d;let p=Bi.length,m=t(s,c);zi=void 0;let h=Bi.length>p?Bi.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?ji(e.issues):ki),e)):(h&&(h.issues=m.issues.length?ji(m.issues):ki),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Hi(){return Vi}function Ui(e,t){let n=e[Oi]?.backEdges;return n!==void 0&&Ai(t)&&n.has(t)}var Wi=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(at(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Ie(e.values[0])}`:`Invalid option: expected one of ${me(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${me(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Gi(){return{localeError:Wi()}}var Ki,qi=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ji(){return new qi}(Ki=globalThis).__zod_globalRegistry??(Ki.__zod_globalRegistry=Ji());var Yi=globalThis.__zod_globalRegistry;function Xi(e){return e.checks&&=[...e.checks],e}function Zi(e,t){return new e(Xi({type:`string`,...k(t)}))}function Qi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...k(t)})}function $i(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...k(t)})}function ea(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...k(t)})}function ta(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...k(t)})}function na(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...k(t)})}function ra(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...k(t)})}function ia(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...k(t)})}function aa(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...k(t)})}function oa(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...k(t)})}function sa(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...k(t)})}function ca(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...k(t)})}function la(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...k(t)})}function P(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...k(t)})}function F(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...k(t)})}function ua(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...k(t)})}function da(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...k(t)})}function fa(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...k(t)})}function pa(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...k(t)})}function ma(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...k(t)})}function ha(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...k(t)})}function ga(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...k(t)})}function _a(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...k(t)})}function va(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...k(t)})}function ya(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...k(t)})}function ba(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...k(t)})}function xa(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...k(t)})}function Sa(e,t){return new e(Xi({type:`number`,checks:[],...k(t)}))}function Ca(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...k(t)})}function wa(e,t){return new e({type:`boolean`,...k(t)})}function Ta(e){return new e({type:`unknown`})}function Ea(e,t){return new e({type:`never`,...k(t)})}function Da(e,t){return new In({check:`less_than`,...k(t),value:e,inclusive:!1})}function Oa(e,t){return new In({check:`less_than`,...k(t),value:e,inclusive:!0})}function ka(e,t){return new Ln({check:`greater_than`,...k(t),value:e,inclusive:!1})}function Aa(e,t){return new Ln({check:`greater_than`,...k(t),value:e,inclusive:!0})}function ja(e,t){return new Rn({check:`multiple_of`,...k(t),value:e})}function Ma(e,t){return new Bn({check:`max_length`,...k(t),maximum:e})}function Na(e,t){return new Vn({check:`min_length`,...k(t),minimum:e})}function Pa(e,t){return new Hn({check:`length_equals`,...k(t),length:e})}function Fa(e,t){return new Wn({check:`string_format`,format:`regex`,...k(t),pattern:e})}function Ia(e){return new Gn({check:`string_format`,format:`lowercase`,...k(e)})}function La(e){return new Kn({check:`string_format`,format:`uppercase`,...k(e)})}function Ra(e,t){return new qn({check:`string_format`,format:`includes`,...k(t),includes:e})}function za(e,t){return new Jn({check:`string_format`,format:`starts_with`,...k(t),prefix:e})}function Ba(e,t){return new Yn({check:`string_format`,format:`ends_with`,...k(t),suffix:e})}function Va(e){return new Xn({check:`overwrite`,tx:e})}function Ha(e){return Va(t=>t.normalize(e))}function Ua(){return Va(e=>e.trim())}function Wa(){return Va(e=>e.toLowerCase())}function Ga(){return Va(e=>e.toUpperCase())}function Ka(){return Va(e=>Oe(e))}function qa(e,t,n){return new e({type:`array`,element:t,...k(n)})}function Ja(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...k(n)})}function Ya(e,t){let n=Xa(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(ot(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(ot(r))}},e(t.value,t)),t);return n}function Xa(e,t){let n=new Nn({check:`custom`,...k(t)});return n._zod.check=e,n}function Za(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&xe(e,t,n[t]);return e}function Qa(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Yi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function $a(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function eo(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,eo(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Za(o.schema,c),t.io===`input`&&uo(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function to(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function no(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${to(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+to(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
62
62
|
|
|
63
63
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function ro(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;ro(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var io=new Set([`type`,`properties`,`required`,`additionalProperties`]),ao=[`oneOf`,`anyOf`];function oo(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function so(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!io.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??oo(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}xe(n,r,e.length===1?e[0]:so(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=oo(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function co(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of io)if(t in e)return;let n=t.filter(e=>ao.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=so(t);else{let e=n[0],i=ao.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>so([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Za(e,r))}function lo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Za(i,s),Za(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())ro(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])co(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Za(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,xe(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:po(t,`input`,e.processors),output:po(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function uo(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return uo(r.element,n);if(r.type===`set`)return uo(r.valueType,n);if(r.type===`lazy`)return uo(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return uo(r.innerType,n);if(r.type===`intersection`)return uo(r.left,n)||uo(r.right,n);if(r.type===`record`||r.type===`map`)return uo(r.keyType,n)||uo(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:uo(r.in,n)||uo(r.out,n);if(r.type===`object`){for(let e in r.shape)if(uo(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(uo(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(uo(e,n))return!0;return!!(r.rest&&uo(r.rest,n))}return!1}var fo=(e,t={})=>n=>{let r=Qa({...n,processors:t});return eo(e,r),no(r,e),lo(r,e)},po=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Qa({...i??{},target:a,io:t,processors:n});return eo(e,o),no(o,e),lo(o,e)},mo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},ho=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},go=(e,t)=>{mo(e,`minimum`,t),ho(e,`maximum`,t)},_o=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},vo=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},yo=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},bo=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},xo=(e,t)=>mo(e,`minimum`,t.minimum),So=(e,t)=>ho(e,`maximum`,t.maximum),Co=e=>(t,n)=>{bo(t,n.format);let[r,i]=e[n.format];mo(t,`minimum`,r),ho(t,`maximum`,i)},wo={greater_than:(e,t)=>mo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>ho(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>_o(e,t.value),number_format:Co(Re),bigint_format:Co(ze),min_length:xo,max_length:So,length_equals:(e,t)=>go(e,t.length),min_size:xo,max_size:So,size_equals:(e,t)=>go(e,t.size),string_format:(e,t)=>{bo(e,t.format),t.pattern&&vo(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>yo(e,t.mime)};function To(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)wo[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&mo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&mo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&ho(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&ho(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&_o(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&yo(t,i.mime);for(let e of i.patterns??[])vo(t,e);return t}var Eo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Do=new Map([[Pr,vn],[Ir,yn]]),Oo=e=>Do.get(e)??e,ko=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=To(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Eo[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(Oo);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ao=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=To(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):$a(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},jo=(e,t,n,r)=>{n.type=`boolean`},Mo=(e,t,n,r)=>{n.not={}},No=(e,t,n,r)=>{let i=e._zod.def,a=pe(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},Po=(e,t,n,r)=>{$a(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Fo=(e,t,n,r)=>{$a(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Io=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=To(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=eo(a.element,t,{...r,path:[...r.path,`items`]})};function Lo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Lo(t.out):t.type===`catch`?Lo(t.innerType):e._zod.optin}var Ro=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&$a(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)xe(i.properties,e,eo(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Lo(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=eo(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},zo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>eo(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Bo=(e,t,n,r)=>{let i=e._zod.def,a=eo(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=eo(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Vo=(e,t,n,r)=>{let i=e._zod.def,a=eo(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ho=(e,t,n,r)=>{let i=e._zod.def;eo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Uo=Symbol();function Wo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?($a(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Uo):JSON.parse(o)}var Go=(e,t,n,r)=>{let i=e._zod.def;eo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Wo(i.defaultValue,e,t,n,r);o!==Uo&&(n.default=o)},Ko=(e,t,n,r)=>{let i=e._zod.def;eo(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Wo(i.defaultValue,e,t,n,r);o!==Uo&&(n._prefault=o)},qo=(e,t,n,r)=>{let i=e._zod.def;eo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{$a(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},I=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;eo(o,t,r);let s=t.seen.get(e);s.ref=o},L=(e,t,n,r)=>{let i=e._zod.def;eo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Jo=(e,t,n,r)=>{let i=e._zod.def;eo(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Yo=new WeakSet([Object.prototype,Error.prototype]);function Xo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Zo=j(`ZodError`,(e,t)=>{Mt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Yo.has(n)||(Yo.add(n),Xo(n,`format`,e=>t=>Ft(e,t)),Xo(n,`flatten`,e=>t=>Pt(e,t)),Xo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,he,2)}),Xo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,he,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Qo=Lt(Zo),$o=Rt(Zo),es=zt(Zo),ts=Vt(Zo),ns=qt(Zo),rs=Jt(Zo),is=Yt(Zo),as=Xt(Zo),os=Zt(Zo),ss=Qt(Zo),cs=M(Zo),ls=$t(Zo);function us(){Tt.localeError||Et(Gi())}function ds(){Tt.memoizer||Et({memoizer:Hi()})}var R=j(`ZodType`,(e,t)=>(us(),$n.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Ee(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Fe(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Cc(e,t))},superRefine(e,t){return this.check(wc(e,t))},overwrite(e){return this.check(Va(e))},optional(){return ac(this)},exactOptional(){return sc(this)},nullable(){return lc(this)},nullish(){return ac(lc(this))},nonoptional(e){return hc(this,e)},array(){return Js(this)},or(e){return Zs([this,e])},and(e){return $s(this,e)},transform(e){return yc(this,rc(e))},default(e){return dc(this,e)},prefault(e){return pc(this,e)},catch(e){return _c(this,e)},pipe(e){return yc(this,e)},readonly(){return xc(this)},describe(e){let t=this.clone();return Yi.add(t,{description:e}),t},meta(...e){if(e.length===0)return Yi.get(this);let t=this.clone();return Yi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return lt(this,`~standard`,{...nr(this),jsonSchema:{input:po(this,`input`),output:po(this,`output`)}})},set"~standard"(e){ct(this,`~standard`,e)},parse:function e(t,n){return Qo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await $o(this,t,n,{callee:e})},safeParse(e,t){return es(this,e,t)},async safeParseAsync(e,t){return ts(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ct(this,`spa`,e)},validate(e,t){return Wt(this,e,t)},validateAsync(e,t){return Kt(this,e,t)},encode:function e(t,n){return ns(this,t,n,{callee:e})},decode:function e(t,n){return rs(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await is(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await as(this,t,n,{callee:e})},safeEncode(e,t){return os(this,e,t)},safeDecode(e,t){return ss(this,e,t)},async safeEncodeAsync(e,t){return cs(this,e,t)},async safeDecodeAsync(e,t){return ls(this,e,t)},toJSONSchema(e){return fo(this,{})(e)},get description(){return Yi.get(this)?.description},get _def(){return this._zod.def}}),fs=j(`_ZodString`,(e,t)=>{rr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r)},ut({format:e=>To(e).format??null,minLength:e=>To(e).minimum??null,maxLength:e=>To(e).maximum??null},{regex(...e){return this.check(Fa(...e))},includes(...e){return this.check(Ra(...e))},startsWith(...e){return this.check(za(...e))},endsWith(...e){return this.check(Ba(...e))},min(...e){return this.check(Na(...e))},max(...e){return this.check(Ma(...e))},length(...e){return this.check(Pa(...e))},nonempty(...e){return this.check(Na(1,...e))},lowercase(e){return this.check(Ia(e))},uppercase(e){return this.check(La(e))},trim(){return this.check(Ua())},normalize(...e){return this.check(Ha(...e))},toLowerCase(){return this.check(Wa())},toUpperCase(){return this.check(Ga())},slugify(){return this.check(Ka())}})),ps=j(`ZodString`,(e,t)=>{rr.init(e,t),fs.init(e,t)},{email(e){return this.check(Qi(vs,e))},url(e){return this.check(ia(xs,e))},jwt(e){return this.check(_a(Is,e))},emoji(e){return this.check(aa(Ss,e))},guid(e){return this.check($i(ys,e))},uuid(e){return this.check(ea(bs,e))},uuidv4(e){return this.check(ta(bs,e))},uuidv6(e){return this.check(na(bs,e))},uuidv7(e){return this.check(ra(bs,e))},nanoid(e){return this.check(oa(Cs,e))},cuid(e){return this.check(sa(ws,e))},cuid2(e){return this.check(ca(Ts,e))},ulid(e){return this.check(la(Es,e))},base64(e){return this.check(ma(Ns,e))},base64url(e){return this.check(ha(Ps,e))},xid(e){return this.check(P(Ds,e))},ksuid(e){return this.check(F(Os,e))},ipv4(e){return this.check(ua(ks,e))},ipv6(e){return this.check(da(As,e))},cidrv4(e){return this.check(fa(js,e))},cidrv6(e){return this.check(pa(Ms,e))},e164(e){return this.check(ga(Fs,e))},datetime(e){return this.check(va(ms,e))},date(e){return this.check(ya(hs,e))},time(e){return this.check(ba(gs,e))},duration(e){return this.check(xa(_s,e))}});function z(e){return Zi(ps,e)}var B=j(`ZodStringFormat`,(e,t)=>{N.init(e,t),fs.init(e,t)}),ms=j(`ZodISODateTime`,(e,t)=>{Sr.init(e,t),B.init(e,t)}),hs=j(`ZodISODate`,(e,t)=>{Cr.init(e,t),B.init(e,t)}),gs=j(`ZodISOTime`,(e,t)=>{wr.init(e,t),B.init(e,t)}),_s=j(`ZodISODuration`,(e,t)=>{Tr.init(e,t),B.init(e,t)}),vs=j(`ZodEmail`,(e,t)=>{or.init(e,t),B.init(e,t)}),ys=j(`ZodGUID`,(e,t)=>{ir.init(e,t),B.init(e,t)}),bs=j(`ZodUUID`,(e,t)=>{ar.init(e,t),B.init(e,t)}),xs=j(`ZodURL`,(e,t)=>{mr.init(e,t),B.init(e,t)}),Ss=j(`ZodEmoji`,(e,t)=>{hr.init(e,t),B.init(e,t)}),Cs=j(`ZodNanoID`,(e,t)=>{gr.init(e,t),B.init(e,t)}),ws=j(`ZodCUID`,(e,t)=>{_r.init(e,t),B.init(e,t)}),Ts=j(`ZodCUID2`,(e,t)=>{vr.init(e,t),B.init(e,t)}),Es=j(`ZodULID`,(e,t)=>{yr.init(e,t),B.init(e,t)}),Ds=j(`ZodXID`,(e,t)=>{br.init(e,t),B.init(e,t)}),Os=j(`ZodKSUID`,(e,t)=>{xr.init(e,t),B.init(e,t)}),ks=j(`ZodIPv4`,(e,t)=>{Er.init(e,t),B.init(e,t)}),As=j(`ZodIPv6`,(e,t)=>{kr.init(e,t),B.init(e,t)}),js=j(`ZodCIDRv4`,(e,t)=>{Ar.init(e,t),B.init(e,t)}),Ms=j(`ZodCIDRv6`,(e,t)=>{Mr.init(e,t),B.init(e,t)}),Ns=j(`ZodBase64`,(e,t)=>{Fr.init(e,t),B.init(e,t)}),Ps=j(`ZodBase64URL`,(e,t)=>{Rr.init(e,t),B.init(e,t)}),Fs=j(`ZodE164`,(e,t)=>{zr.init(e,t),B.init(e,t)}),Is=j(`ZodJWT`,(e,t)=>{Vr.init(e,t),B.init(e,t)}),Ls=j(`ZodNumber`,(e,t)=>{Hr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.isFinite=!0},ut({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=To(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=To(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=To(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>To(e).format??null},{gt(e,t){return this.check(ka(e,t))},gte(e,t){return this.check(Aa(e,t))},min(e,t){return this.check(Aa(e,t))},lt(e,t){return this.check(Da(e,t))},lte(e,t){return this.check(Oa(e,t))},max(e,t){return this.check(Oa(e,t))},int(e){return this.check(Bs(e))},safe(e){return this.check(Bs(e))},positive(e){return this.check(ka(0,e))},nonnegative(e){return this.check(Aa(0,e))},negative(e){return this.check(Da(0,e))},nonpositive(e){return this.check(Oa(0,e))},multipleOf(e,t){return this.check(ja(e,t))},step(e,t){return this.check(ja(e,t))},finite(){return this}}));function Rs(e){return Sa(Ls,e)}var zs=j(`ZodNumberFormat`,(e,t)=>{Ur.init(e,t),Ls.init(e,t)});function Bs(e){return Ca(zs,e)}var Vs=j(`ZodBoolean`,(e,t)=>{Wr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r)});function Hs(e){return wa(Vs,e)}var Us=j(`ZodUnknown`,(e,t)=>{Gr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ws(){return Ta(Us)}var Gs=j(`ZodNever`,(e,t)=>{Kr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r)});function Ks(e){return Ea(Gs,e)}var qs=j(`ZodArray`,(e,t)=>{ds(),Xr.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Na(e,t))},nonempty(e){return this.check(Na(1,e))},max(e,t){return this.check(Ma(e,t))},length(e,t){return this.check(Pa(e,t))},unwrap(){return this.element}});function Js(e,t){return qa(qs,e,t)}var Ys=j(`ZodObject`,(e,t)=>{ds(),ni.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),gt(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return tc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Ee(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Ee(this._zod.def,{catchall:Ws()}))},loose(){return this.clone(Ee(this._zod.def,{catchall:Ws()}))},strict(){return this.clone(Ee(this._zod.def,{catchall:Ks()}))},strip(){return this.clone(Ee(this._zod.def,{catchall:void 0}))},extend(e){return Ue(this,e)},safeExtend(e){return Ge(this,e)},merge(e){return Ke(this,e)},pick(e){return Be(this,e)},omit(e){return He(this,e)},partial(...e){return qe(ic,this,e[0])},exactPartial(...e){return qe(oc,this,e[0],`exactPartial`)},required(...e){return Je(mc,this,e[0])}});function V(e,t){return new Ys({type:`object`,shape:e??{},...k(t)})}var Xs=j(`ZodUnion`,(e,t)=>{ii.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.options=t.options});function Zs(e,t){return new Xs({type:`union`,options:e,...k(t)})}var Qs=j(`ZodIntersection`,(e,t)=>{ai.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r)});function $s(e,t){return new Qs({type:`intersection`,left:e,right:t})}var ec=j(`ZodEnum`,(e,t)=>{ci.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ec({...t,checks:[],...k(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ec({...t,checks:[],...k(r),entries:i})}});function tc(e,t){return new ec({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...k(t)})}var nc=j(`ZodTransform`,(e,t)=>{ds(),li.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new wt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ot(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(ot(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function rc(e){return new nc({type:`transform`,transform:e})}var ic=j(`ZodOptional`,(e,t)=>{di.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ac(e){return new ic({type:`optional`,innerType:e})}var oc=j(`ZodExactOptional`,(e,t)=>{fi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sc(e){return new oc({type:`optional`,innerType:e})}var cc=j(`ZodNullable`,(e,t)=>{pi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lc(e){return new cc({type:`nullable`,innerType:e})}var uc=j(`ZodDefault`,(e,t)=>{mi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dc(e,t){return new uc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Me(t)}})}var fc=j(`ZodPrefault`,(e,t)=>{gi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ko(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pc(e,t){return new fc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Me(t)}})}var mc=j(`ZodNonOptional`,(e,t)=>{_i.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ho(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hc(e,t){return new mc({type:`nonoptional`,innerType:e,...k(t)})}var gc=j(`ZodCatch`,(e,t)=>{bi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function _c(e,t){return new gc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:vt(t)})}var vc=j(`ZodPipe`,(e,t)=>{xi.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>I(e,t,n,r),e.in=t.in,e.out=t.out});function yc(e,t){return new vc({type:`pipe`,in:e,out:t})}var bc=j(`ZodReadonly`,(e,t)=>{Ci.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>L(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xc(e){return new bc({type:`readonly`,innerType:e})}var Sc=j(`ZodCustom`,(e,t)=>{Ti.init(e,t),R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r)});function Cc(e,t={}){return Ja(Sc,e,t)}function wc(e,t){return Ya(e,t)}var Tc=[`critical`,`high`,`medium`,`low`],Ec=[`critical`,`high`,`moderate`,`low`,`info`],Dc=[`audit`,`fix`,`force`,`push`],Oc=V({audit:Hs(),fix:Hs(),force:Hs(),push:Hs()}),kc=[`production`,`all`],Ac=`production`,jc=V({number:Rs().int(),severity:tc(Tc),ecosystem:z(),package:z(),manifestPath:z(),summary:z(),url:z(),patchedVersion:z().nullable(),createdAt:z(),scope:tc([`runtime`,`development`]).nullable()}),Mc=V({number:Rs().int(),package:z(),markedAt:z()}),Nc=V({number:Rs().int(),url:z(),branch:z(),createdAt:z()}),Pc=V({id:z(),name:z()}),Fc=V({id:z(),owner:z(),name:z(),defaultBranch:z(),branch:z(),categoryId:z().nullable(),addedAt:z(),rights:Oc,alerts:Js(jc),handledAlerts:Js(Mc),pullRequests:Js(Nc),syncedAt:z().nullable(),syncError:z().nullable(),deprecatedAt:z().nullable()});V({categories:Js(Pc),repos:Js(Fc)});var Ic=[`audit`,`fix`],Lc=[`user`,`agent`],Rc=[`running`,`waiting_force`,`waiting_repair`,`waiting_push`,`done`,`failed`,`cancelled`],zc=[`running`,`waiting_force`,`waiting_repair`,`waiting_push`],Bc=[`pending`,`running`,`done`,`skipped`,`failed`],Vc=V({project:z(),name:z(),severity:tc(Ec),fix:tc([`none`,`available`,`major`])}),Hc=V({project:z(),name:z(),from:z().nullable(),to:z(),vulnerabilities:Rs().int()}),Uc=V({project:z(),name:z(),from:z().nullable(),to:z().nullable()}),Wc=V({at:z(),text:z()}),Gc=V({summary:z(),urgent:Js(V({package:z(),reason:z()})),force:V({recommended:Hs(),reason:z()})}),Kc=V({summary:z(),changes:Js(V({file:z(),change:z()})),commitMessage:z(),tests:V({outcome:tc([`passed`,`failed`,`not_run`]),detail:z()})}),qc=V({key:z(),title:z(),url:z(),status:tc([`todo`,`doing`,`review`,`done`])}),Jc=V({startedAt:z(),endedAt:z().nullable(),turns:Rs().int(),activity:Js(z()),report:Gc.nullable(),task:qc.nullable(),error:z().nullable()}),Yc=V({runs:Rs().int(),startedAt:z(),endedAt:z().nullable(),turns:Rs().int(),activity:Js(z()),base:z(),auditCommit:z().nullable(),commit:z().nullable(),report:Kc.nullable(),task:qc.nullable(),error:z().nullable()});V({id:z(),repoId:z(),kind:tc(Ic),origin:tc(Lc),scope:tc(kc),status:tc(Rc),createdAt:z(),updatedAt:z(),pid:Rs().int(),workDir:z().nullable(),baseBranch:z(),cancelRequested:Hs(),steps:V({clone:tc(Bc),audit:tc(Bc),fix:tc(Bc),analysis:tc(Bc),force:tc(Bc),repair:tc(Bc),push:tc(Bc)}),projects:Js(z()),counts:V({initial:Rs().int().nullable(),afterFix:Rs().int().nullable(),afterForce:Rs().int().nullable(),afterRepair:Rs().int().nullable()}),found:Js(Vc),remaining:Js(Vc),forceCandidates:Js(Hc),changes:Js(Uc),commitMessage:z(),branch:z().nullable(),pullRequest:V({number:Rs().int(),url:z()}).nullable(),analysis:Jc.nullable(),repair:Yc.nullable(),error:z().nullable(),log:Js(Wc)});function Xc(e){let t=new Set(e.handledAlerts.map(e=>e.number));return e.alerts.filter(e=>!t.has(e.number))}function Zc(e){let t=new Set(e.handledAlerts.map(e=>e.number));return e.alerts.filter(e=>t.has(e.number))}function Qc(e){return e===`moderate`?`medium`:e===`info`?`low`:e}function $c(e){return Tc.find(t=>e.includes(t))??null}function el(e,t=Date.now()){let n=Math.max(0,Math.round((t-Date.parse(e))/1e3));if(n<60)return`à l'instant`;let r=Math.round(n/60);if(r<60)return`il y a ${r} min`;let i=Math.round(r/60);return i<24?`il y a ${i} h`:`il y a ${Math.round(i/24)} j`}function tl(e,t,n=`${t}s`){return`${e} ${e>1?n:t}`}var nl={critical:`Critique`,high:`Haute`,medium:`Moyenne`,low:`Faible`},rl={production:`dépendances de production`,all:`toutes les dépendances`};function il(e){return Tc.find(t=>e.some(e=>e.severity===t))??null}function al(e){let t=e.flatMap(e=>Xc(e.repo)),n=e.flatMap(e=>e.auditFindings?[e.auditFindings]:[]);return{count:t.length+n.reduce((e,t)=>e+t.count,0),worst:$c([...t.map(e=>e.severity),...n.map(e=>e.severity)])}}function ol(e){return e.reduce((e,t)=>e+t.pullRequests.length,0)}function sl(e){return e===``?``:`${e}/`}function cl(e){let t=new Date(e);return`${t.toLocaleDateString(`fr-FR`,{day:`2-digit`,month:`2-digit`})} à ${t.toLocaleTimeString(`fr-FR`,{hour:`2-digit`,minute:`2-digit`})}`}function ll(e){return new Date(e).toLocaleTimeString(`fr-FR`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}var ul=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),H=o(((e,t)=>{t.exports=ul()}))(),dl={"shield-check":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}),(0,H.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),plus:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M5 12h14`}),(0,H.jsx)(`path`,{d:`M12 5v14`})]}),"chevron-right":(0,H.jsx)(`path`,{d:`m9 18 6-6-6-6`}),"chevron-down":(0,H.jsx)(`path`,{d:`m6 9 6 6 6-6`}),check:(0,H.jsx)(`path`,{d:`M20 6 9 17l-5-5`}),"git-branch":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`}),(0,H.jsx)(`circle`,{cx:`18`,cy:`6`,r:`3`}),(0,H.jsx)(`circle`,{cx:`6`,cy:`18`,r:`3`}),(0,H.jsx)(`path`,{d:`M18 9a9 9 0 0 1-9 9`})]}),"arrow-left":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`m12 19-7-7 7-7`}),(0,H.jsx)(`path`,{d:`M19 12H5`})]}),bot:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M12 8V4H8`}),(0,H.jsx)(`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`}),(0,H.jsx)(`path`,{d:`M2 14h2`}),(0,H.jsx)(`path`,{d:`M20 14h2`}),(0,H.jsx)(`path`,{d:`M15 13v2`}),(0,H.jsx)(`path`,{d:`M9 13v2`})]}),wrench:(0,H.jsx)(`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`}),"external-link":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M15 3h6v6`}),(0,H.jsx)(`path`,{d:`M10 14 21 3`}),(0,H.jsx)(`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`})]}),"loader-circle":(0,H.jsx)(`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`}),circle:(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),"circle-check":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,H.jsx)(`path`,{d:`m9 12 2 2 4-4`})]}),"circle-alert":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,H.jsx)(`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`}),(0,H.jsx)(`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`})]}),"circle-dot":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`})]}),"circle-x":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,H.jsx)(`path`,{d:`m15 9-6 6`}),(0,H.jsx)(`path`,{d:`m9 9 6 6`})]}),"circle-minus":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,H.jsx)(`path`,{d:`M8 12h8`})]}),"message-square":(0,H.jsx)(`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`}),"rotate-cw":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`}),(0,H.jsx)(`path`,{d:`M21 3v5h-5`})]}),"square-terminal":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`m7 11 2-2-2-2`}),(0,H.jsx)(`path`,{d:`M11 13h4`}),(0,H.jsx)(`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`})]}),upload:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`}),(0,H.jsx)(`polyline`,{points:`17 8 12 3 7 8`}),(0,H.jsx)(`line`,{x1:`12`,x2:`12`,y1:`3`,y2:`15`})]}),x:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M18 6 6 18`}),(0,H.jsx)(`path`,{d:`m6 6 12 12`})]}),"trash-2":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M3 6h18`}),(0,H.jsx)(`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`}),(0,H.jsx)(`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2`}),(0,H.jsx)(`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`}),(0,H.jsx)(`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`})]}),info:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`}),(0,H.jsx)(`path`,{d:`M12 16v-4`}),(0,H.jsx)(`path`,{d:`M12 8h.01`})]}),"triangle-alert":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`}),(0,H.jsx)(`path`,{d:`M12 9v4`}),(0,H.jsx)(`path`,{d:`M12 17h.01`})]}),"git-pull-request":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`circle`,{cx:`18`,cy:`18`,r:`3`}),(0,H.jsx)(`circle`,{cx:`6`,cy:`6`,r:`3`}),(0,H.jsx)(`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`}),(0,H.jsx)(`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`})]}),layers:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`}),(0,H.jsx)(`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`}),(0,H.jsx)(`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`})]}),folder:(0,H.jsx)(`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}),ellipsis:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`1`}),(0,H.jsx)(`circle`,{cx:`19`,cy:`12`,r:`1`}),(0,H.jsx)(`circle`,{cx:`5`,cy:`12`,r:`1`})]}),"scan-search":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`}),(0,H.jsx)(`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`}),(0,H.jsx)(`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`}),(0,H.jsx)(`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`}),(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`}),(0,H.jsx)(`path`,{d:`m16 16-1.9-1.9`})]}),"refresh-cw":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`}),(0,H.jsx)(`path`,{d:`M21 3v5h-5`}),(0,H.jsx)(`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`}),(0,H.jsx)(`path`,{d:`M8 16H3v5`})]}),archive:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}),(0,H.jsx)(`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`}),(0,H.jsx)(`path`,{d:`M10 12h4`})]}),"archive-restore":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`}),(0,H.jsx)(`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`}),(0,H.jsx)(`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`}),(0,H.jsx)(`path`,{d:`m9 15 3-3 3 3`}),(0,H.jsx)(`path`,{d:`M12 12v9`})]}),pencil:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}),(0,H.jsx)(`path`,{d:`m15 5 4 4`})]}),settings:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`}),(0,H.jsx)(`circle`,{cx:`12`,cy:`12`,r:`3`})]}),sparkles:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`}),(0,H.jsx)(`path`,{d:`M20 2v4`}),(0,H.jsx)(`path`,{d:`M22 4h-4`}),(0,H.jsx)(`circle`,{cx:`4`,cy:`20`,r:`2`})]}),"list-checks":(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`path`,{d:`M13 5h8`}),(0,H.jsx)(`path`,{d:`M13 12h8`}),(0,H.jsx)(`path`,{d:`M13 19h8`}),(0,H.jsx)(`path`,{d:`m3 17 2 2 4-4`}),(0,H.jsx)(`path`,{d:`m3 7 2 2 4-4`})]}),copy:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}),(0,H.jsx)(`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`})]})};function U({name:e,size:t=16,className:n}){return(0,H.jsx)(`svg`,{className:n,width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,focusable:`false`,children:dl[e]})}var fl=[{scope:`production`,label:`Production`,detail:`devDependencies laissées de côté`},{scope:`all`,label:`Toutes les dépendances`,detail:`devDependencies comprises`}];function pl({variant:e,icon:t,label:n,disabled:r=!1,onLaunch:i}){let[a,o]=(0,_.useState)(!1),s=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(!a)return;let e=e=>{s.current?.contains(e.target)||o(!1)},t=e=>{e.key===`Escape`&&o(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[a]);function c(e){o(!1),i(e)}return(0,H.jsxs)(`span`,{className:`picker split-button`,ref:s,children:[(0,H.jsxs)(`button`,{type:`button`,className:`button button-${e} split-main`,onClick:()=>c(Ac),disabled:r,children:[(0,H.jsx)(U,{name:t}),n]}),(0,H.jsx)(`button`,{type:`button`,className:`button button-${e} split-toggle`,"aria-haspopup":`menu`,"aria-expanded":a,"aria-label":`Choisir le périmètre`,title:`Choisir le périmètre`,onClick:()=>o(!a),disabled:r,children:(0,H.jsx)(U,{name:`chevron-down`,size:12})}),a&&(0,H.jsx)(`div`,{className:`picker-menu scope-menu`,role:`menu`,children:fl.map(e=>(0,H.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`scope-option`,onClick:()=>c(e.scope),children:[(0,H.jsxs)(`span`,{className:`scope-option-text`,children:[(0,H.jsx)(`span`,{className:`scope-option-label`,children:e.label}),(0,H.jsx)(`span`,{className:`scope-option-detail`,children:e.detail})]}),e.scope===`production`&&(0,H.jsx)(U,{name:`check`,size:14,className:`picker-check`})]},e.scope))})]})}var ml=1500,hl=5e3;function gl(){let[e,t]=(0,_.useState)(hl),n=b(`audit-all`,T.getAuditAll,e),[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null),o=n.data?.auditAll??null,s=o?.running??!1;(0,_.useEffect)(()=>{if(t(s?ml:hl),!o)return;if(o.running){a.current=o.startedAt;return}if(a.current!==o.startedAt)return;a.current=null;let e=[tl(o.total-o.skipped.length-o.failed.length,`dépôt audité`,`dépôts audités`)];o.skipped.length>0&&e.push(`${o.skipped.length} laissé${o.skipped.length>1?`s`:``} de côté (opération en cours)`),o.failed.length>0&&e.push(`${o.failed.length} en échec : ${o.failed.map(e=>e.repoId).join(`, `)}`),se.getState().show(o.failed.length>0?`error`:`info`,`Audit terminé : ${e.join(`, `)}.`)},[o,s]);async function c(e){i(!0);try{let{auditAll:t}=await T.startAuditAll(e);a.current=t?.startedAt??null,n.reload()}catch(e){C(e)}finally{i(!1)}}return s&&o?(0,H.jsxs)(`button`,{type:`button`,className:`button button-secondary`,disabled:!0,children:[(0,H.jsx)(U,{name:`loader-circle`,className:`spin`}),`Audit ${o.done}/${o.total}…`]}):(0,H.jsx)(pl,{variant:`secondary`,icon:`scan-search`,label:`Auditer tout`,disabled:r,onLaunch:e=>void c(e)})}function _l(){let e=se(e=>e.notice),t=se(e=>e.dismiss);return e?(0,H.jsxs)(`div`,{className:`notice notice-${e.kind}`,role:e.kind===`error`?`alert`:`status`,children:[(0,H.jsx)(U,{name:e.kind===`error`?`triangle-alert`:`info`}),(0,H.jsx)(`span`,{className:`notice-text`,children:e.text}),(0,H.jsx)(`button`,{type:`button`,className:`notice-close`,onClick:t,"aria-label":`Fermer le message`,children:(0,H.jsx)(U,{name:`x`,size:14})})]},e.id):null}function W(){let[e,t]=(0,_.useState)(!1);async function n(){t(!0);try{await T.syncRepos()}catch(e){C(e)}finally{t(!1)}}return(0,H.jsxs)(`button`,{type:`button`,className:`button button-secondary`,onClick:()=>void n(),disabled:e,children:[(0,H.jsx)(U,{name:`refresh-cw`,className:e?`spin`:void 0}),`Synchroniser maintenant`]})}function vl(e){try{return decodeURIComponent(e)}catch{return null}}function yl(e){let t=e.replace(/^#/,``).split(`/`).filter(e=>e!==``).map(vl);if(t.length===0)return{name:`home`,categoryId:null};if(t.some(e=>e===null))return{name:`not_found`,hash:e};if(t.length===2&&t[0]===`c`)return{name:`home`,categoryId:t[1]};if(t.length===1&&t[0]===`deprecated`)return{name:`deprecated`};if(t.length===1&&t[0]===`settings`)return{name:`settings`};let[n,r,i,a,o]=t;if(n!==`r`||!r||!i)return{name:`not_found`,hash:e};let s=`${r}/${i}`;return t.length===3?{name:`repo`,repoId:s}:t.length===5&&a===`op`?{name:`operation`,repoId:s,operationId:o}:{name:`not_found`,hash:e}}function bl(e){return`${window.location.pathname}${window.location.search}${e}`}function xl(e){let[t,n]=e.split(`/`);return`#/r/${encodeURIComponent(t)}/${encodeURIComponent(n)}`}var Sl={kind:`category`,categoryId:null};function Cl(e){Sl=e}var wl={home:(e=null)=>bl(e===null?`#/`:`#/c/${encodeURIComponent(e)}`),deprecated:()=>bl(`#/deprecated`),settings:()=>bl(`#/settings`),lastHome:()=>Sl.kind===`deprecated`?wl.deprecated():wl.home(Sl.categoryId),repo:e=>bl(xl(e)),operation:(e,t)=>bl(`${xl(e)}/op/${encodeURIComponent(t)}`)};function Tl(e){window.location.assign(e)}function El(e){return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)}function Dl(){return window.location.hash}function Ol(){return yl((0,_.useSyncExternalStore)(El,Dl))}function kl({action:e}){return(0,H.jsxs)(`header`,{className:`topbar`,children:[(0,H.jsxs)(`a`,{className:`brand`,href:wl.home(),children:[(0,H.jsx)(`span`,{className:`brand-mark`,children:(0,H.jsx)(U,{name:`shield-check`})}),`Dependabot Tracker`]}),(0,H.jsx)(`div`,{className:`spacer`}),e]})}function Al(e,t,n=10){let r=t.trim().toLowerCase();if(r===``)return[];let i=[],a=[];for(let t of e){let e=t.toLowerCase();e.includes(r)&&(e.slice(e.indexOf(`/`)+1).startsWith(r)||e.startsWith(r)?i:a).push(t)}let o=(e,t)=>e.localeCompare(t);return[...i.sort(o),...a.sort(o)].slice(0,n)}function jl({severity:e,children:t,wide:n,small:r,faded:i}){return(0,H.jsx)(`span`,{className:`pill pill-${e}${n?` pill-wide`:``}${r?` pill-small`:``}${i?` pill-faded`:``}`,children:t})}var Ml=4e3;function Nl({views:e}){let{count:t,worst:n}=al(e);return n===null?null:(0,H.jsx)(jl,{severity:n,small:!0,children:t})}function Pl({views:e}){let t=ol(e.map(e=>e.repo));return t===0?null:(0,H.jsxs)(`span`,{className:`pill pill-small pill-pr`,title:`${tl(t,`pull request`)} en attente`,children:[(0,H.jsx)(U,{name:`git-pull-request`,size:10}),t]})}function Fl({initial:e,onSave:t,onCancel:n}){let[r,i]=(0,_.useState)(e),a=(0,_.useRef)(!1),o=(0,_.useRef)(null);(0,_.useEffect)(()=>{o.current?.focus(),o.current?.select()},[]);async function s(){if(!a.current){if(r.trim()===``||r.trim()===e)n();else{a.current=!0;try{await t(r.trim())}catch(e){C(e),a.current=!1,o.current?.focus()}}}}function c(e){e.key===`Enter`?(e.preventDefault(),s()):e.key===`Escape`&&(e.preventDefault(),a.current=!0,n())}return(0,H.jsxs)(`div`,{className:`side-item side-editing`,children:[(0,H.jsx)(U,{name:`folder`}),(0,H.jsx)(`input`,{ref:o,className:`side-input`,value:r,maxLength:60,onChange:e=>i(e.target.value),onKeyDown:c,onBlur:()=>void s(),"aria-label":`Nom de la catégorie`,placeholder:`Nom de la catégorie`,spellCheck:!1})]})}function Il({onRename:e,onDelete:t,onClose:n}){let[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let e=e=>{a.current?.parentElement?.contains(e.target)||n()},t=e=>{e.key===`Escape`&&n()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[n]),(0,_.useEffect)(()=>{if(!r)return;let e=setTimeout(()=>i(!1),Ml);return()=>clearTimeout(e)},[r]),(0,H.jsxs)(`div`,{className:`side-menu`,role:`menu`,ref:a,children:[(0,H.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`side-menu-item`,onClick:e,children:[(0,H.jsx)(U,{name:`pencil`,size:14}),`Renommer`]}),(0,H.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`side-menu-item is-danger`,onClick:()=>r?t():i(!0),children:[(0,H.jsx)(U,{name:`trash-2`,size:14}),r?`Confirmer`:`Supprimer`]})]})}function Ll({href:e,icon:t,label:n,views:r,active:i}){return(0,H.jsxs)(`a`,{className:`side-item${i?` is-active`:``}`,href:e,"aria-current":i?`page`:void 0,children:[(0,H.jsx)(U,{name:t}),(0,H.jsx)(`span`,{className:`side-name`,children:n}),(0,H.jsxs)(`span`,{className:`side-count`,children:[(0,H.jsx)(Pl,{views:r}),(0,H.jsx)(Nl,{views:r})]})]})}function Rl({category:e,views:t,active:n,onChanged:r}){let[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1);async function c(t){await T.renameCategory(e.id,t),s(!1),r()}async function l(){a(!1);try{await T.deleteCategory(e.id),n&&Tl(wl.home()),r()}catch(e){C(e)}}return o?(0,H.jsx)(Fl,{initial:e.name,onSave:c,onCancel:()=>s(!1)}):(0,H.jsxs)(`div`,{className:`side-row${i?` is-open`:``}`,children:[(0,H.jsx)(Ll,{href:wl.home(e.id),icon:`folder`,label:e.name,views:t,active:n}),(0,H.jsx)(`button`,{type:`button`,className:`side-more`,"aria-label":`Actions de la catégorie ${e.name}`,"aria-haspopup":`menu`,"aria-expanded":i,onClick:()=>a(!i),children:(0,H.jsx)(U,{name:`ellipsis`,size:18})}),i&&(0,H.jsx)(Il,{onRename:()=>{a(!1),s(!0)},onDelete:()=>void l(),onClose:()=>a(!1)})]})}function zl({count:e,active:t}){return(0,H.jsxs)(`a`,{className:`side-item${t?` is-active`:``}`,href:wl.deprecated(),"aria-current":t?`page`:void 0,children:[(0,H.jsx)(U,{name:`archive`}),(0,H.jsx)(`span`,{className:`side-name`,children:`Dépréciés`}),e>0&&(0,H.jsx)(`span`,{className:`pill pill-small pill-neutral`,children:e})]})}function Bl({categories:e,views:t,deprecatedCount:n,tab:r,onChanged:i}){let[a,o]=(0,_.useState)(!1),s=r.kind===`category`?r.categoryId:void 0;async function c(e){await T.createCategory(e),o(!1),i()}return(0,H.jsxs)(`nav`,{className:`sidebar`,"aria-label":`Catégories`,children:[(0,H.jsx)(Ll,{href:wl.home(),icon:`layers`,label:`Tous mes projets`,views:t,active:s===null}),(0,H.jsx)(`div`,{className:`side-divider`}),e.map(e=>(0,H.jsx)(Rl,{category:e,views:t.filter(t=>t.repo.categoryId===e.id),active:s===e.id,onChanged:i},e.id)),a?(0,H.jsx)(Fl,{initial:``,onSave:c,onCancel:()=>o(!1)}):(0,H.jsxs)(`button`,{type:`button`,className:`side-item side-new`,onClick:()=>o(!0),children:[(0,H.jsx)(U,{name:`plus`}),`Nouvelle catégorie`]}),(0,H.jsx)(`div`,{className:`side-divider`}),(0,H.jsx)(zl,{count:n,active:r.kind===`deprecated`})]})}function Vl({checked:e,onChange:t,label:n,disabled:r}){return(0,H.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,"aria-label":n,disabled:r,className:`toggle${e?` is-on`:``}`,onClick:()=>t(!e),children:(0,H.jsx)(`span`,{className:`toggle-knob`})})}var Hl=3e3,Ul=`dependabot-tracker.only-vulnerable`,Wl=`dependabot-tracker.only-pending-pr`;function Gl(e){try{return localStorage.getItem(e)===`true`}catch{return!1}}function Kl(e,t){try{localStorage.setItem(e,String(t))}catch{}}function ql(e){let[t,n]=(0,_.useState)(()=>Gl(e));return[t,t=>{n(t),Kl(e,t)}]}function Jl(e){return e.unfixable.length>0||e.auditFindings!==null||Xc(e.repo).length>0&&e.cleanAudit===null}function Yl({unfixable:e}){return e.length===0?null:(0,H.jsxs)(`span`,{className:`unfixable-note`,title:`Aucune version corrigée publiée : ${e.join(`, `)}`,children:[(0,H.jsx)(U,{name:`triangle-alert`}),tl(e.length,`sans correctif`,`sans correctif`)]})}function Xl({repo:e}){let t=e.pullRequests;if(t.length===0)return null;let n=t.length===1;return(0,H.jsxs)(`a`,{className:`pr-note`,href:n?t[0].url:t[0].url.replace(/\/pull\/\d+$/,`/pulls`),target:`_blank`,rel:`noreferrer`,title:t.map(e=>`#${e.number} — ${e.branch}`).join(`
|
|
64
|
-
`),children:[(0,H.jsx)(U,{name:`git-pull-request`,size:14}),n?`PR #${t[0].number} en attente`:`${t.length} PR en attente`]})}function Zl(e,t,n){let r=n?`dans cette catégorie`:`parmi vos projets`;return e&&t?`Aucun dépôt vulnérable avec une PR en attente ${r}.`:t?`Aucune PR en attente ${r}.`:`Aucun dépôt vulnérable ${r}.`}function Ql({view:e}){let t=e.analysisTask;return t?(0,H.jsxs)(`a`,{className:`pr-note`,href:t.url,target:`_blank`,rel:`noreferrer`,title:t.title,children:[(0,H.jsx)(U,{name:`list-checks`,size:14}),`Tâche `,t.key,(0,H.jsx)(U,{name:`external-link`,size:12})]}):null}function $l({view:e}){let{repo:t,activeOperation:n,cleanAudit:r,auditFindings:i,unfixable:a}=e;if(n){let e=n.steps.analysis===`running`,t=n.steps.repair===`running`;return(0,H.jsxs)(`span`,{className:`status status-busy`,children:[(0,H.jsx)(U,{name:`loader-circle`,className:`spin`}),e?`Analyse par Claude…`:t?`Corrections par Claude…`:n.kind===`audit`?`Audit en cours`:`Correction en cours`]})}let o=Xc(t),s=il(t.alerts);if(s&&o.length===0)return(0,H.jsxs)(`span`,{className:`status status-clean`,title:`Toutes les alertes sont marquées corrigées à la main.`,children:[(0,H.jsx)(U,{name:`circle-check`,className:`text-ok`}),`Corrigé à la main`,(0,H.jsx)(jl,{severity:s,faded:!0,children:tl(t.alerts.length,`alerte`)})]});let c=il(o);return c&&r?(0,H.jsxs)(`span`,{className:`status status-clean`,title:`Le dernier audit (${rl[r.scope]}) n'a trouvé aucune vulnérabilité : Dependabot n'a pas encore repassé.`,children:[(0,H.jsx)(U,{name:`circle-check`,className:`text-ok`}),`Audit OK le `,cl(r.at),(0,H.jsx)(jl,{severity:c,faded:!0,children:tl(o.length,`alerte`)})]}):c?(0,H.jsxs)(`span`,{className:`status status-clean`,children:[(0,H.jsx)(Yl,{unfixable:a}),(0,H.jsx)(jl,{severity:c,children:tl(o.length,`alerte`)})]}):i?(0,H.jsxs)(`span`,{className:`status status-clean`,title:`Dependabot ne signale aucune alerte, mais le dernier audit de la branche par défaut (${rl[i.scope]}) a trouvé des vulnérabilités : Dependabot n'a pas encore repassé.`,children:[(0,H.jsx)(Yl,{unfixable:a}),(0,H.jsx)(U,{name:`triangle-alert`,className:`text-warning`}),`Audit du `,cl(i.at),(0,H.jsx)(jl,{severity:i.severity,children:tl(i.count,`vulnérabilité`)})]}):t.syncError?(0,H.jsxs)(`span`,{className:`status status-error`,title:t.syncError,children:[(0,H.jsx)(U,{name:`circle-alert`}),`Synchronisation impossible`]}):t.syncedAt?(0,H.jsxs)(`span`,{className:`status status-muted`,children:[(0,H.jsx)(U,{name:`circle-check`,className:`text-ok`}),`À jour`]}):(0,H.jsx)(`span`,{className:`status status-muted`,children:`Synchronisation…`})}function eu({categories:e,initialCategory:t,onClose:n}){let[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(t),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(0),[p,m]=(0,_.useState)(!1),h=(0,_.useRef)(null),g=b(`addable-repos`,T.listAddableRepos,null),v=p?[]:Al(g.data?.repositories??[],r),y=Math.min(d,v.length-1);(0,_.useEffect)(()=>{h.current?.focus();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n]);async function ee(e){if(!(e.trim()===``||l)){u(!0),c(null);try{let t=await T.addRepo(e.trim(),a);n(),Tl(wl.repo(t.repo.id))}catch(e){c(e.message),u(!1)}}}function te(e){i(e),c(null),m(!0),h.current?.focus()}function ne(e){e.preventDefault(),y>=0?te(v[y]):ee(r)}function re(e){if(e.key===`Escape`&&v.length>0){e.stopPropagation(),m(!0);return}if(v.length===0||e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=e.key===`ArrowDown`?1:-1,n=v.length;f(e=>(Math.min(e,n-1)+t+n)%n)}return(0,H.jsx)(`div`,{className:`veil`,onMouseDown:e=>e.target===e.currentTarget&&n(),children:(0,H.jsxs)(`form`,{className:`modal`,onSubmit:ne,"aria-label":`Ajouter un dépôt`,children:[(0,H.jsx)(`h2`,{className:`modal-title`,children:`Ajouter un dépôt`}),(0,H.jsx)(`input`,{ref:h,className:`input`,value:r,onChange:e=>{i(e.target.value),c(null),f(0),m(!1)},onKeyDown:re,placeholder:`propriétaire/dépôt ou lien GitHub`,spellCheck:!1,role:`combobox`,"aria-expanded":v.length>0,"aria-controls":`repo-suggestions`,"aria-activedescendant":y>=0?`repo-suggestion-${y}`:void 0}),v.length>0&&(0,H.jsx)(`ul`,{className:`suggestions`,id:`repo-suggestions`,role:`listbox`,children:v.map((e,t)=>(0,H.jsx)(`li`,{id:`repo-suggestion-${t}`,role:`option`,"aria-selected":t===y,className:`suggestion${t===y?` is-active`:``}`,onMouseEnter:()=>f(t),onMouseDown:t=>{t.preventDefault(),te(e)},children:e},e))}),(0,H.jsxs)(`label`,{className:`select-field`,children:[(0,H.jsx)(U,{name:`folder`}),(0,H.jsxs)(`select`,{value:a??``,onChange:e=>o(e.target.value===``?null:e.target.value),"aria-label":`Catégorie`,children:[(0,H.jsx)(`option`,{value:``,children:`Sans catégorie`}),e.map(e=>(0,H.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,H.jsx)(U,{name:`chevron-down`,size:14,className:`select-chevron`})]}),s?(0,H.jsx)(`p`,{className:`field-error`,children:s}):g.error?(0,H.jsxs)(`p`,{className:`field-error`,children:[`Suggestions indisponibles : `,g.error]}):(0,H.jsx)(`p`,{className:`field-hint`,children:`L'agent pourra seulement lancer un audit. Modifiable ensuite.`}),(0,H.jsxs)(`div`,{className:`modal-actions`,children:[(0,H.jsx)(`button`,{type:`button`,className:`button button-secondary`,onClick:n,children:`Annuler`}),(0,H.jsx)(`button`,{type:`submit`,className:`button button-primary`,disabled:l||r.trim()===``,children:l?`Ajout…`:`Ajouter`})]})]})})}function tu({repoId:e,onDone:t}){let[n,r]=(0,_.useState)(!1);async function i(){r(!0);try{await T.deprecateRepo(e),t()}catch(e){C(e),r(!1)}}return(0,H.jsx)(`button`,{type:`button`,className:`row-action`,onClick:()=>void i(),disabled:n,title:`Marquer comme déprécié`,"aria-label":`Marquer ${e} comme déprécié`,children:(0,H.jsx)(U,{name:`archive`,size:14})})}function nu({repoId:e,onDone:t}){let[n,r]=(0,_.useState)(!1);async function i(){r(!0);try{await T.restoreRepo(e),t()}catch(e){C(e),r(!1)}}return(0,H.jsxs)(`button`,{type:`button`,className:`button button-secondary row-button`,onClick:()=>void i(),disabled:n,children:[(0,H.jsx)(U,{name:`archive-restore`,size:14}),n?`Rétablissement…`:`Rétablir`]})}function ru({views:e,onChanged:t}){return e.length===0?(0,H.jsx)(`div`,{className:`panel empty`,children:(0,H.jsx)(`p`,{children:`Aucun dépôt déprécié.`})}):(0,H.jsx)(`div`,{className:`panel list`,children:e.map(e=>(0,H.jsxs)(`div`,{className:`row row-linked`,children:[(0,H.jsx)(`a`,{className:`row-title row-link deprecated-title`,href:wl.repo(e.repo.id),children:e.repo.id}),(0,H.jsxs)(`span`,{className:`status status-muted`,children:[`Déprécié le `,cl(e.repo.deprecatedAt)]}),(0,H.jsx)(nu,{repoId:e.repo.id,onDone:t}),(0,H.jsx)(U,{name:`chevron-right`,className:`row-chevron`})]},e.repo.id))})}function iu({tab:e,adding:t,onCloseAdd:n,onAdd:r}){let i=b(`repos`,T.listRepos,Hl),a=b(`config`,T.getConfig,null),o=i.data?.categories??[],s=e.kind===`category`?e.categoryId:null,c=o.find(e=>e.id===s)??null,l=s!==null&&i.data!==null&&c===null,[u,d]=ql(Ul),[f,p]=ql(Wl),m=i.data?.repos??[],h=m.filter(e=>e.repo.deprecatedAt===null),g=m.filter(e=>e.repo.deprecatedAt!==null).sort((e,t)=>t.repo.deprecatedAt.localeCompare(e.repo.deprecatedAt)),v=h.filter(e=>s===null||e.repo.categoryId===s),y=v.filter(e=>(!u||Jl(e))&&(!f||e.repo.pullRequests.length>0)),ee=e.kind===`deprecated`;return(0,_.useEffect)(()=>{ee?Cl({kind:`deprecated`}):l||Cl({kind:`category`,categoryId:s})},[ee,s,l]),ee?(0,H.jsxs)(`div`,{className:`home`,children:[i.data&&(0,H.jsx)(Bl,{categories:o,views:h,deprecatedCount:g.length,tab:e,onChanged:i.reload}),(0,H.jsxs)(`div`,{className:`page`,children:[(0,H.jsx)(`div`,{className:`home-head`,children:(0,H.jsx)(`h1`,{className:`page-title`,children:`Dépréciés`})}),i.error&&!i.data&&(0,H.jsx)(`p`,{className:`banner banner-error`,children:i.error}),i.data&&(0,H.jsx)(ru,{views:g,onChanged:i.reload})]}),t&&i.data&&(0,H.jsx)(eu,{categories:o,initialCategory:null,onClose:n})]}):(0,H.jsxs)(`div`,{className:`home`,children:[i.data&&(0,H.jsx)(Bl,{categories:o,views:h,deprecatedCount:g.length,tab:e,onChanged:i.reload}),(0,H.jsxs)(`div`,{className:`page`,children:[(0,H.jsxs)(`div`,{className:`home-head`,children:[(0,H.jsx)(`h1`,{className:`page-title`,children:c?c.name:`Tous mes projets`}),(0,H.jsxs)(`div`,{className:`filters`,children:[(0,H.jsxs)(`label`,{className:`filter`,children:[`PR en attente`,(0,H.jsx)(Vl,{checked:f,onChange:p,label:`PR en attente`})]}),(0,H.jsxs)(`label`,{className:`filter`,children:[`Vulnérables seulement`,(0,H.jsx)(Vl,{checked:u,onChange:d,label:`Vulnérables seulement`})]})]})]}),a.data&&!a.data.githubConfigured&&(0,H.jsxs)(`p`,{className:`banner banner-error`,children:[(0,H.jsx)(U,{name:`triangle-alert`}),`GITHUB_TOKEN n'est pas défini : déclarez un token GitHub dans le bloc env du serveur.`]}),i.error&&!i.data&&(0,H.jsx)(`p`,{className:`banner banner-error`,children:i.error}),l&&(0,H.jsxs)(`p`,{className:`muted`,children:[`Cette catégorie n'existe plus. `,(0,H.jsx)(`a`,{className:`link`,href:wl.home(),children:`Voir tous les projets`}),`.`]}),i.data&&!l&&v.length>0&&y.length===0&&(0,H.jsx)(`div`,{className:`panel empty`,children:(0,H.jsx)(`p`,{children:Zl(u,f,s!==null)})}),i.data&&!l&&v.length===0&&(0,H.jsxs)(`div`,{className:`panel empty`,children:[(0,H.jsx)(`p`,{children:s===null?`Aucun dépôt suivi.`:`Aucun dépôt dans cette catégorie.`}),(0,H.jsxs)(`button`,{type:`button`,className:`button button-primary`,onClick:r,children:[(0,H.jsx)(U,{name:`plus`}),`Ajouter un dépôt`]})]}),y.length>0&&(0,H.jsx)(`div`,{className:`panel list`,children:y.map(e=>(0,H.jsxs)(`div`,{className:`row row-linked`,children:[(0,H.jsx)(`a`,{className:`row-title row-link`,href:wl.repo(e.repo.id),children:e.repo.id}),(0,H.jsx)(Xl,{repo:e.repo}),(0,H.jsx)(Ql,{view:e}),(0,H.jsx)($l,{view:e}),(0,H.jsx)(tu,{repoId:e.repo.id,onDone:i.reload}),(0,H.jsx)(U,{name:`chevron-right`,className:`row-chevron`})]},e.repo.id))})]}),t&&i.data&&(0,H.jsx)(eu,{categories:o,initialCategory:c?.id??null,onClose:n})]})}var G=1e3,au=1e4,ou={clone:{text:`Cloner le dépôt`,mono:!1},audit:{text:`npm audit`,mono:!0},fix:{text:`npm audit fix`,mono:!0},analysis:{text:`Analyse par Claude`,mono:!1},force:{text:`npm audit fix --force`,mono:!0},repair:{text:`Corrections par Claude`,mono:!1},push:{text:`Commit et push`,mono:!1}},su={pending:`circle`,running:`loader-circle`,done:`circle-check`,skipped:`circle-minus`,failed:`circle-x`},cu={done:`terminée`,failed:`échouée`,cancelled:`annulée`};function lu(e){return zc.includes(e.status)}function uu(e,t){if(e===null||t===null)return null;let n=e-t;return n>0?tl(n,`corrigée`):`aucune corrigée`}function du(e){return e.remaining.filter(e=>e.fix===`none`)}function fu(e){return[`force`,`fix`,`audit`].find(t=>e.steps[t]===`done`)??null}function pu(e,t){return e.status===`cancelled`||e.steps.fix!==`done`?`ignorée`:t===`force`&&e.forceCandidates.length===0?e.counts.afterFix===0?`rien à corriger`:`aucune correction possible`:t===`force`&&e.analysis?.report&&!e.analysis.report.force.recommended?`passé · déconseillé par Claude`:t===`force`?`passé`:t===`repair`&&(e.counts.afterForce??e.counts.afterFix)===0?`rien à corriger`:t===`push`&&e.changes.length===0&&!e.repair?.commit?`rien à pousser`:`ignorée`}function mu(e){let t=Math.floor((Date.now()-Date.parse(e.startedAt))/6e4);return`${t<1?`moins d'une minute`:`${t} min`} · ${tl(e.turns,`tour`)}`}function hu(e,t){if(!t.report)return null;let n=uu(e.counts.afterForce??e.counts.afterFix,e.counts.afterRepair),r=t.report.changes.length;return[n,r>0?tl(r,`fichier modifié`,`fichiers modifiés`):`aucun fichier modifié`].filter(Boolean).join(` · `)}function gu(e,t){let n=e.steps[t];if(t===`analysis`&&n===`running`&&e.analysis)return mu(e.analysis);if(t===`repair`&&n===`running`&&e.repair)return mu(e.repair);if(n===`skipped`)return pu(e,t);if(n!==`done`)return null;let{initial:r,afterFix:i,afterForce:a}=e.counts;switch(t){case`audit`:return r===null?null:tl(r,`vulnérabilité`);case`fix`:return uu(r,i);case`force`:return uu(i,a);case`repair`:return e.repair?hu(e,e.repair):null;case`analysis`:return e.analysis?.task?(0,H.jsxs)(`a`,{className:`link task-link`,href:e.analysis.task.url,target:`_blank`,rel:`noreferrer`,children:[`Tâche « `,e.analysis.task.title,` »`,(0,H.jsx)(U,{name:`external-link`,size:14})]}):null;case`push`:return e.pullRequest?(0,H.jsxs)(`a`,{className:`link`,href:e.pullRequest.url,target:`_blank`,rel:`noreferrer`,children:[`Pull request #`,e.pullRequest.number]}):null;default:return null}}function _u({operation:e}){return(0,H.jsx)(`ul`,{className:`changes mono`,children:e.changes.map(e=>(0,H.jsxs)(`li`,{children:[sl(e.project),e.name,` `,(0,H.jsxs)(`span`,{className:`muted`,children:[e.from??`ajouté`,` → `,e.to??`retiré`]})]},`${e.project}/${e.name}`))})}function vu({activity:e,hint:t}){return(0,H.jsxs)(`div`,{className:`step-body`,children:[(0,H.jsx)(`ul`,{className:`activity mono`,children:e.map((t,n)=>(0,H.jsx)(`li`,{className:n===e.length-1?`activity-last`:void 0,children:t},`${n}-${t}`))}),(0,H.jsx)(`p`,{className:`hint`,children:t})]})}function yu({report:e}){return(0,H.jsxs)(`div`,{className:`verdict`,children:[(0,H.jsxs)(`p`,{className:`verdict-title`,children:[(0,H.jsx)(U,{name:`sparkles`,size:14}),e.force.recommended?`Claude recommande le --force`:`Claude déconseille le --force`]}),(0,H.jsx)(`p`,{className:`verdict-text`,children:e.force.reason}),e.urgent.length>0&&(0,H.jsx)(`ul`,{className:`verdict-urgent`,children:e.urgent.map(e=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`mono`,children:e.package}),` — `,e.reason]},e.package))})]})}function bu({operation:e,onDone:t}){let[n,r]=(0,_.useState)(!1),i=e.forceCandidates.reduce((e,t)=>e+t.vulnerabilities,0),a=e.analysis?.report??null,o=a!==null&&!a.force.recommended;async function s(n){r(!0);try{await T.decideForce(e.id,n),t()}catch(e){C(e),r(!1)}}return(0,H.jsxs)(`div`,{className:`step-body`,children:[(0,H.jsxs)(`p`,{className:`muted`,children:[i>1?`${i} vulnérabilités nécessitent`:`Une vulnérabilité nécessite`,` une version majeure :`]}),(0,H.jsx)(`ul`,{className:`candidates mono`,children:e.forceCandidates.map(e=>(0,H.jsxs)(`li`,{children:[sl(e.project),e.name,` `,e.from??`?`,` → `,e.to]},`${e.project}/${e.name}`))}),a&&(0,H.jsx)(yu,{report:a}),(0,H.jsxs)(`div`,{className:`step-actions${o?` step-actions-reversed`:``}`,children:[(0,H.jsx)(`button`,{type:`button`,className:`button ${o?`button-secondary`:`button-primary`}`,disabled:n,onClick:()=>void s(!0),children:`Appliquer --force`}),(0,H.jsx)(`button`,{type:`button`,className:`button ${o?`button-primary`:`button-secondary`}`,disabled:n,onClick:()=>void s(!1),children:`Passer`})]})]})}function xu({operation:e,onDone:t}){let n=b(`remarks:${e.id}`,()=>T.getRemarks(e.id),au),[r,i]=(0,_.useState)(!1),a=e.analysis?.task??null,o=n.data?.remarks??[];async function s(n){i(!0);try{await T.decideRepair(e.id,n),t()}catch(e){C(e),i(!1)}}return(0,H.jsxs)(`div`,{className:`step-body`,children:[(0,H.jsx)(`p`,{className:`muted`,children:`Claude relit la tâche et vos remarques, corrige le code ou force des versions dans le clone, lance les tests, puis fait un commit.`}),(0,H.jsxs)(`div`,{className:`verdict remarks`,children:[(0,H.jsxs)(`p`,{className:`remarks-head`,children:[(0,H.jsx)(U,{name:`message-square`,size:14}),(0,H.jsx)(`span`,{className:`remarks-count`,children:n.error?`Remarques illisibles`:n.data?o.length===0?`Aucune remarque sur la tâche`:tl(o.length,`remarque sur la tâche`,`remarques sur la tâche`):`Lecture des remarques…`}),a&&(0,H.jsxs)(`a`,{className:`link task-link`,href:a.url,target:`_blank`,rel:`noreferrer`,children:[`Commenter la tâche`,(0,H.jsx)(U,{name:`external-link`,size:12})]})]}),n.error&&(0,H.jsx)(`p`,{className:`error-text remarks-note`,children:n.error}),n.data&&o.length===0&&(0,H.jsx)(`p`,{className:`remarks-note`,children:`Sans remarque, Claude suit son analyse.`}),o.length>0&&(0,H.jsx)(`ul`,{className:`remarks-list`,children:o.map((e,t)=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`p`,{className:`remarks-body`,children:e.body}),(0,H.jsxs)(`p`,{className:`remarks-meta`,children:[e.author,` · `,el(e.createdAt)]})]},`${e.createdAt}-${t}`))})]}),(0,H.jsxs)(`div`,{className:`step-actions`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`button button-primary`,disabled:r,onClick:()=>void s(!0),children:[(0,H.jsx)(U,{name:`sparkles`}),`Lancer les corrections`]}),(0,H.jsx)(`button`,{type:`button`,className:`button button-secondary`,disabled:r,onClick:()=>void s(!1),children:e.changes.length>0?`Passer au push`:`Passer`})]})]})}var Su={passed:{icon:`circle-check`,className:`text-ok`},failed:{icon:`circle-x`,className:`error-text`},not_run:{icon:`circle-minus`,className:`muted`}};function Cu({operation:e,repair:t}){let n=t.report,r=Su[n.tests.outcome],i=e.counts.afterRepair;return(0,H.jsxs)(`div`,{className:`verdict repair-summary`,children:[(0,H.jsxs)(`p`,{className:`verdict-title`,children:[(0,H.jsx)(U,{name:`sparkles`,size:14}),`Ce que Claude a changé`]}),(0,H.jsx)(`p`,{className:`verdict-text`,children:n.summary}),n.changes.length>0&&(0,H.jsx)(`ul`,{className:`repair-changes`,children:n.changes.map(e=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`mono`,children:e.file}),(0,H.jsx)(`span`,{className:`muted`,children:e.change})]},e.file))}),(0,H.jsxs)(`p`,{className:`repair-line`,children:[(0,H.jsx)(U,{name:r.icon,size:12,className:r.className}),n.tests.outcome===`not_run`?`Tests non lancés`:n.tests.outcome===`passed`?`Tests réussis`:`Tests en échec`,` — `,n.tests.detail]}),(0,H.jsxs)(`p`,{className:`repair-line`,children:[(0,H.jsx)(U,{name:i===0?`circle-check`:`circle-alert`,size:12,className:i===0?`text-ok`:`text-warning`}),`npm audit après corrections : `,i===null?`non relancé`:i===0?`aucune vulnérabilité`:tl(i,`vulnérabilité`),t.task&&(0,H.jsxs)(H.Fragment,{children:[` · `,(0,H.jsxs)(`a`,{className:`link task-link`,href:t.task.url,target:`_blank`,rel:`noreferrer`,children:[`rapport détaillé `,t.task.key,(0,H.jsx)(U,{name:`external-link`,size:12})]})]})]})]})}function wu(e){let t=+!!e.auditCommit+ +!!e.commit;return e.commit?t===1?`le commit de Claude`:`${tl(t,`commit`)}, dont celui de Claude`:tl(t,`commit`)}function Tu({operation:e,onDone:t}){let[n,r]=(0,_.useState)(e.commitMessage),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),c=e.repair?.report?e.repair:null;async function l(){s(!0);try{await T.decideRepair(e.id,!0),t()}catch(e){C(e),s(!1)}}async function u(){if(n.trim()!==``){s(!0);try{await T.push(e.id,n.trim()),t()}catch(e){C(e),s(!1)}}}return(0,H.jsxs)(`div`,{className:`step-body`,children:[c&&(0,H.jsx)(Cu,{operation:e,repair:c}),(0,H.jsx)(`input`,{className:`input mono commit-input${c?` commit-input-spaced`:``}`,value:n,onChange:e=>r(e.target.value),"aria-label":e.repair?`Titre de la pull request`:`Message de commit`,spellCheck:!1}),(0,H.jsxs)(`p`,{className:`hint`,children:[`Nouvelle branche `,e.branch,e.repair&&` · ${wu(e.repair)}`,` ·`,` `,(0,H.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>a(!i),children:i?`masquer les changements`:`voir les changements`})]}),i&&(0,H.jsx)(_u,{operation:e}),(0,H.jsxs)(`div`,{className:`step-actions`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`button button-primary`,disabled:o||n.trim()===``,onClick:()=>void u(),children:[(0,H.jsx)(U,{name:`upload`}),`Pousser et ouvrir la PR`]}),c&&(0,H.jsxs)(`button`,{type:`button`,className:`button button-secondary`,disabled:o,onClick:()=>void l(),children:[(0,H.jsx)(U,{name:`rotate-cw`}),`Relancer avec mes remarques`]})]})]})}function Eu({vulnerabilities:e}){return(0,H.jsxs)(`div`,{className:`step-body`,children:[(0,H.jsx)(`ul`,{className:`changes mono`,children:e.map(e=>(0,H.jsxs)(`li`,{children:[sl(e.project),e.name,` `,(0,H.jsx)(`span`,{className:`muted`,children:nl[Qc(e.severity)].toLowerCase()})]},`${e.project}/${e.name}`))}),(0,H.jsx)(`p`,{className:`hint`,children:`Aucune version corrigée n'est publiée sur le registre npm : la mise à jour est à faire à la main.`})]})}function Du({operation:e,step:t,onDone:n}){let[r,i]=(0,_.useState)(!1),a=e.steps[t],o=e.status===`waiting_force`&&t===`force`||e.status===`waiting_repair`&&t===`repair`||e.status===`waiting_push`&&t===`push`,s=t===`analysis`?e.analysis?.error??null:t===`repair`?e.repair?.error??null:e.error,c=(a===`failed`||t===`repair`)&&s,l=ou[t],u=o?t===`force`?`circle-alert`:`circle-dot`:su[a],d=fu(e)===t?du(e):[];return(0,H.jsxs)(`div`,{className:`step step-${a}${o?` step-current`:``}`,children:[(0,H.jsxs)(`div`,{className:`step-line`,children:[(0,H.jsx)(U,{name:u,className:`step-icon${a===`running`?` spin`:``}${o&&t===`force`?` text-warning`:``}`}),(0,H.jsx)(`span`,{className:`step-label${l.mono?` mono`:``}`,children:l.text}),(0,H.jsxs)(`span`,{className:`step-result`,children:[gu(e,t),d.length>0&&(0,H.jsxs)(H.Fragment,{children:[` · `,(0,H.jsx)(`button`,{type:`button`,className:`unfixable-toggle`,"aria-expanded":r,onClick:()=>i(!r),children:tl(d.length,`sans correctif`,`sans correctif`)})]})]})]}),r&&d.length>0&&(0,H.jsx)(Eu,{vulnerabilities:d}),t===`analysis`&&a===`running`&&e.analysis&&(0,H.jsx)(vu,{activity:e.analysis.activity,hint:`Le rapport et la tâche Organizer arrivent à la fin de l'analyse.`}),t===`repair`&&a===`running`&&e.repair&&(0,H.jsx)(vu,{activity:e.repair.activity,hint:`Le commit et le rapport arrivent à la fin des corrections.`}),t===`analysis`&&a===`done`&&e.analysis?.report&&(0,H.jsx)(`p`,{className:`step-body hint`,children:e.analysis.report.summary}),e.status===`waiting_force`&&t===`force`&&(0,H.jsx)(bu,{operation:e,onDone:n}),e.status===`waiting_repair`&&t===`repair`&&(0,H.jsx)(xu,{operation:e,onDone:n}),e.status===`waiting_push`&&t===`push`&&(0,H.jsx)(Tu,{operation:e,onDone:n},e.id),c&&(0,H.jsx)(`p`,{className:`step-body error-text pre`,children:s})]})}function Ou({repoId:e,operationId:t}){let[n,r]=(0,_.useState)(G),i=b(`operation:${t}`,()=>T.getOperation(t),n),[a,o]=(0,_.useState)(!1),s=i.data?.operation??null;if(s&&!lu(s)&&n!==null&&r(null),!s)return(0,H.jsx)(`div`,{className:`page`,children:(0,H.jsx)(`p`,{className:i.error?`error-text`:`muted`,children:i.error??`Chargement de l'opération…`})});let c=e.split(`/`)[1],l=cu[s.status],u=s.kind===`audit`?[`clone`,`audit`]:[`clone`,`audit`,`fix`,...s.analysis?[`analysis`]:[],`force`,...s.analysis?.task?[`repair`]:[],`push`];async function d(){try{await T.cancel(t),i.reload()}catch(e){C(e)}}return(0,H.jsxs)(`div`,{className:`page`,children:[(0,H.jsxs)(`div`,{className:`page-head`,children:[(0,H.jsx)(`a`,{className:`back`,href:wl.repo(e),"aria-label":`Retour au dépôt`,children:(0,H.jsx)(U,{name:`arrow-left`,size:20})}),(0,H.jsxs)(`div`,{className:`page-head-text`,children:[(0,H.jsxs)(`h1`,{className:`page-title`,children:[s.kind===`audit`?`Audit`:`Correction`,` de `,c]}),(0,H.jsxs)(`p`,{className:`subtitle`,children:[`Lancée par `,s.origin===`agent`?`l'agent`:`vous`,` · clone temporaire de `,s.baseBranch,` · `,rl[s.scope],l&&` · ${l}`]})]}),(0,H.jsxs)(`div`,{className:`page-actions`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`button button-ghost${a?` is-active`:``}`,onClick:()=>o(!a),children:[(0,H.jsx)(U,{name:`square-terminal`}),`Journal`]}),lu(s)&&(0,H.jsx)(`button`,{type:`button`,className:`button button-secondary`,onClick:()=>void d(),disabled:s.cancelRequested,children:s.cancelRequested?`Annulation…`:`Annuler`})]})]}),(0,H.jsx)(`div`,{className:`panel steps`,children:u.map(e=>(0,H.jsx)(Du,{operation:s,step:e,onDone:i.reload},e))}),s.error&&!Object.values(s.steps).includes(`failed`)&&(0,H.jsx)(`p`,{className:`banner banner-error pre`,children:s.error}),a&&(0,H.jsx)(`pre`,{className:`log mono`,children:s.log.map((e,t)=>(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`log-time`,children:ll(e.at)}),` `,e.text]},t))})]})}function ku(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>e.toLowerCase().includes(n))}function Au({repo:e,onClose:t,onChosen:n}){let r=b(`branches:${e.id}`,()=>T.listBranches(e.id),null),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(0),[c,l]=(0,_.useState)(!1),u=(0,_.useRef)(null),d=(0,_.useRef)(null),f=ku(r.data?.branches??[],i),p=Math.min(o,f.length-1);(0,_.useEffect)(()=>u.current?.focus(),[]),(0,_.useEffect)(()=>{d.current?.querySelector(`.is-active`)?.scrollIntoView({block:`nearest`})},[p]);async function m(r){if(!c){if(r===e.branch)t();else{l(!0);try{await T.setBranch(e.id,r),n(),t()}catch(e){C(e),l(!1)}}}}function h(e){if(e.key===`Escape`){e.preventDefault(),t();return}if(e.key===`Enter`){e.preventDefault(),p>=0&&m(f[p]);return}if(f.length===0||e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let n=e.key===`ArrowDown`?1:-1,r=f.length;s(e=>(Math.min(e,r-1)+n+r)%r)}return(0,H.jsxs)(`div`,{className:`picker-menu`,children:[(0,H.jsx)(`input`,{ref:u,className:`input branch-search`,value:i,onChange:e=>{a(e.target.value),s(0)},onKeyDown:h,placeholder:`Rechercher une branche`,spellCheck:!1,role:`combobox`,"aria-expanded":f.length>0,"aria-controls":`branch-options`,"aria-activedescendant":p>=0?`branch-option-${p}`:void 0}),r.error?(0,H.jsx)(`p`,{className:`picker-note error-text`,children:r.error}):r.data?f.length===0?(0,H.jsx)(`p`,{className:`picker-note`,children:`Aucune branche ne correspond.`}):(0,H.jsx)(`ul`,{className:`picker-options`,id:`branch-options`,role:`listbox`,ref:d,children:f.map((t,n)=>(0,H.jsxs)(`li`,{id:`branch-option-${n}`,role:`option`,"aria-selected":t===e.branch,className:`picker-option${n===p?` is-active`:``}`,onMouseEnter:()=>s(n),onMouseDown:e=>{e.preventDefault(),m(t)},children:[(0,H.jsx)(`span`,{className:`picker-name mono`,children:t}),t===e.defaultBranch&&(0,H.jsx)(`span`,{className:`branch-default`,children:`par défaut`}),t===e.branch&&(0,H.jsx)(U,{name:`check`,size:14,className:`picker-check`})]},t))}):(0,H.jsx)(`p`,{className:`picker-note`,children:`Chargement des branches…`})]})}function ju({repo:e,onChanged:t}){let[n,r]=(0,_.useState)(!1),i=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(!n)return;let e=e=>{i.current?.contains(e.target)||r(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n]),(0,H.jsxs)(`span`,{className:`picker`,ref:i,children:[(0,H.jsxs)(`button`,{type:`button`,className:`picker-chip`,"aria-haspopup":`listbox`,"aria-expanded":n,title:`Branche analysée par les corrections`,onClick:()=>r(!n),children:[(0,H.jsx)(U,{name:`git-branch`,size:14}),(0,H.jsx)(`span`,{className:`mono`,children:e.branch}),(0,H.jsx)(U,{name:`chevron-down`,size:12,className:`picker-chevron`})]}),n&&(0,H.jsx)(Au,{repo:e,onClose:()=>r(!1),onChosen:t})]})}function Mu({repo:e,onClose:t,onChosen:n}){let r=b(`categories`,T.listCategories,null),[i,a]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]);async function o(r){if(!i){if(r===e.categoryId)t();else{a(!0);try{await T.setCategory(e.id,r),n(),t()}catch(e){C(e),a(!1)}}}}let s=[{id:null,name:`Sans catégorie`},...r.data?.categories??[]];return(0,H.jsx)(`div`,{className:`picker-menu picker-menu-narrow`,children:r.error?(0,H.jsx)(`p`,{className:`picker-note error-text`,children:r.error}):r.data?(0,H.jsx)(`ul`,{className:`picker-options`,role:`listbox`,"aria-label":`Catégorie`,children:s.map(t=>(0,H.jsxs)(`li`,{role:`option`,"aria-selected":t.id===e.categoryId,className:`picker-option`,onMouseDown:e=>{e.preventDefault(),o(t.id)},children:[(0,H.jsx)(`span`,{className:`picker-name`,children:t.name}),t.id===e.categoryId&&(0,H.jsx)(U,{name:`check`,size:14,className:`picker-check`})]},t.id??``))}):(0,H.jsx)(`p`,{className:`picker-note`,children:`Chargement des catégories…`})})}function Nu({repo:e,categoryName:t,onChanged:n}){let[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(!r)return;let e=e=>{a.current?.contains(e.target)||i(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[r]),(0,H.jsxs)(`span`,{className:`picker`,ref:a,children:[(0,H.jsxs)(`button`,{type:`button`,className:`picker-chip`,"aria-haspopup":`listbox`,"aria-expanded":r,title:`Catégorie du dépôt`,onClick:()=>i(!r),children:[(0,H.jsx)(U,{name:`folder`,size:14}),(0,H.jsx)(`span`,{children:t??`Sans catégorie`}),(0,H.jsx)(U,{name:`chevron-down`,size:12,className:`picker-chevron`})]}),r&&(0,H.jsx)(Mu,{repo:e,onClose:()=>i(!1),onChosen:n})]})}var Pu=3e3,Fu=4e3,Iu={audit:{label:`Audit`,description:`Cloner le dépôt et lancer npm audit`},fix:{label:`Audit fix`,description:`Appliquer npm audit fix dans le clone`},force:{label:`Audit fix --force`,description:`Peut installer des versions majeures`},push:{label:`Commit et push`,description:`Pousser sur une nouvelle branche et ouvrir la PR`}};function Lu({view:e,onClose:t,onChanged:n}){let{repo:r}=e,[i,a]=(0,_.useState)(null);i&&Dc.every(e=>i[e]===r.rights[e])&&a(null);let o=i??r.rights,[s,c]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]),(0,_.useEffect)(()=>{if(!s)return;let e=setTimeout(()=>c(!1),Fu);return()=>clearTimeout(e)},[s]);async function l(e,t){let i={...o,[e]:t};a(i);try{await T.setRights(r.id,i),n()}catch(e){a(null),C(e)}}async function u(){if(!s)c(!0);else try{await T.removeRepo(r.id),Tl(wl.lastHome())}catch(e){c(!1),C(e)}}return(0,H.jsx)(`div`,{className:`veil`,onMouseDown:e=>e.target===e.currentTarget&&t(),children:(0,H.jsxs)(`aside`,{className:`drawer`,"aria-label":`Droits de l'agent`,children:[(0,H.jsxs)(`div`,{className:`drawer-head`,children:[(0,H.jsx)(`h2`,{className:`drawer-title`,children:`Droits de l'agent`}),(0,H.jsx)(`button`,{type:`button`,className:`icon-button`,onClick:t,"aria-label":`Fermer`,children:(0,H.jsx)(U,{name:`x`,size:18})})]}),(0,H.jsx)(`p`,{className:`drawer-subtitle`,children:`Ce que l'agent peut faire sur ce dépôt.`}),(0,H.jsx)(`div`,{className:`rights`,children:Dc.map(e=>(0,H.jsxs)(`div`,{className:`right`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`right-label`,children:Iu[e].label}),(0,H.jsx)(`div`,{className:`right-description`,children:Iu[e].description})]}),(0,H.jsx)(Vl,{checked:o[e],onChange:t=>void l(e,t),label:Iu[e].label})]},e))}),(0,H.jsxs)(`button`,{type:`button`,className:`danger-link`,onClick:()=>void u(),children:[(0,H.jsx)(U,{name:`trash-2`}),s?`Cliquer à nouveau pour retirer le dépôt`:`Retirer le dépôt`]})]})})}function Ru({view:e,onChanged:t}){let{repo:n,unfixable:r}=e,i=Xc(n);async function a(e){try{await T.markAlertHandled(n.id,e),t()}catch(e){C(e)}}return i.length===0?(0,H.jsx)(`div`,{className:`panel empty`,children:(0,H.jsx)(`p`,{children:n.alerts.length===0?`Aucune alerte ouverte.`:`Toutes les alertes sont corrigées à la main.`})}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`section-label`,children:tl(i.length,`alerte ouverte`,`alertes ouvertes`)}),(0,H.jsx)(`div`,{className:`panel list`,children:i.map(e=>(0,H.jsxs)(`div`,{className:`alert-line`,children:[(0,H.jsxs)(`a`,{className:`row alert-row`,href:e.url,target:`_blank`,rel:`noreferrer`,title:`Alerte #${e.number} sur GitHub`,children:[(0,H.jsx)(jl,{severity:e.severity,wide:!0,children:nl[e.severity]}),(0,H.jsx)(`span`,{className:`alert-package mono`,children:e.package}),(0,H.jsx)(`span`,{className:`alert-summary`,children:e.summary}),r.includes(e.package)&&(0,H.jsxs)(`span`,{className:`unfixable-note`,title:`Le dernier audit n'a trouvé aucune version corrigée publiée sur le registre npm.`,children:[(0,H.jsx)(U,{name:`triangle-alert`}),`sans correctif`]}),e.scope===`development`&&(0,H.jsx)(`span`,{className:`dev-tag`,title:`Dépendance de développement : un audit de production la laisse de côté.`,children:`dév.`}),(0,H.jsx)(`span`,{className:`alert-mark-space`}),(0,H.jsx)(U,{name:`external-link`,className:`row-chevron`})]}),(0,H.jsxs)(`button`,{type:`button`,className:`button button-secondary alert-mark`,onClick:()=>void a(e.number),children:[(0,H.jsx)(U,{name:`check`,size:14}),`Corrigée à la main`]})]},e.number))})]})}function zu({view:e,onChanged:t}){let{repo:n}=e,r=Zc(n);if(r.length===0)return null;async function i(e){try{await T.unmarkAlertHandled(n.id,e),t()}catch(e){C(e)}}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`section-label section-label-spaced`,children:`Corrigées à la main`}),(0,H.jsx)(`div`,{className:`panel list`,children:r.map(e=>{let t=n.handledAlerts.find(t=>t.number===e.number);return(0,H.jsxs)(`div`,{className:`row alert-row`,children:[(0,H.jsx)(jl,{severity:e.severity,wide:!0,faded:!0,children:nl[e.severity]}),(0,H.jsx)(`span`,{className:`alert-package mono`,children:e.package}),(0,H.jsxs)(`span`,{className:`alert-summary handled-note`,children:[(0,H.jsx)(U,{name:`circle-check`,className:`text-ok`}),`Corrigée à la main`,t&&` le ${cl(t.markedAt)}`]}),(0,H.jsx)(`button`,{type:`button`,className:`link restore-link`,onClick:()=>void i(e.number),children:`Rétablir`})]},e.number)})})]})}function Bu({repoId:e}){let t=b(`repo:${e}`,()=>T.getRepo(e),Pu),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(!1),o=t.data;if(!o)return(0,H.jsx)(`div`,{className:`page`,children:(0,H.jsx)(`p`,{className:t.error?`error-text`:`muted`,children:t.error??`Chargement du dépôt…`})});let{repo:s,activeOperation:c,latestOperation:l}=o;async function u(e){a(!0);try{let{operation:t}=await T.startFix(s.id,e);Tl(wl.operation(s.id,t.id))}catch(e){C(e),a(!1)}}return(0,H.jsxs)(`div`,{className:`page`,children:[(0,H.jsxs)(`div`,{className:`page-head`,children:[(0,H.jsx)(`a`,{className:`back`,href:wl.lastHome(),"aria-label":`Retour aux dépôts`,children:(0,H.jsx)(U,{name:`arrow-left`,size:20})}),(0,H.jsxs)(`div`,{className:`page-head-text`,children:[(0,H.jsx)(`h1`,{className:`page-title`,children:s.name}),(0,H.jsxs)(`div`,{className:`subtitle`,children:[s.owner,` · `,(0,H.jsx)(ju,{repo:s,onChanged:t.reload}),` ·`,` `,(0,H.jsx)(Nu,{repo:s,categoryName:o.category?.name??null,onChanged:t.reload}),` ·`,` `,s.deprecatedAt?`déprécié le ${cl(s.deprecatedAt)}`:s.syncError?(0,H.jsx)(`span`,{className:`error-text`,title:s.syncError,children:`synchronisation impossible`}):s.syncedAt?`synchronisé ${el(s.syncedAt)}`:`synchronisation…`,l&&!c&&(0,H.jsxs)(H.Fragment,{children:[` · `,(0,H.jsx)(`a`,{className:`link`,href:wl.operation(s.id,l.id),children:l.kind===`audit`?`dernier audit`:`dernière correction`})]})]})]}),(0,H.jsxs)(`div`,{className:`page-actions`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`button button-secondary`,onClick:()=>r(!0),children:[(0,H.jsx)(U,{name:`bot`}),`Agent`]}),c?(0,H.jsxs)(`button`,{type:`button`,className:`button button-primary`,onClick:()=>Tl(wl.operation(s.id,c.id)),children:[(0,H.jsx)(U,{name:`wrench`}),c.kind===`audit`?`Voir l'audit en cours`:`Reprendre la correction`]}):s.deprecatedAt?(0,H.jsxs)(`button`,{type:`button`,className:`button button-primary`,disabled:!0,title:`Dépôt déprécié : rétablissez-le depuis l’onglet « Dépréciés » pour le corriger.`,children:[(0,H.jsx)(U,{name:`wrench`}),`Corriger`]}):(0,H.jsx)(pl,{variant:`primary`,icon:`wrench`,label:`Corriger`,disabled:i,onLaunch:e=>void u(e)})]})]}),s.syncError&&(0,H.jsx)(`p`,{className:`banner banner-error`,children:s.syncError}),(0,H.jsx)(Ru,{view:o,onChanged:t.reload}),(0,H.jsx)(zu,{view:o,onChanged:t.reload}),n&&(0,H.jsx)(Lu,{view:o,onClose:()=>r(!1),onChanged:t.reload})]})}var Vu={maxTurns:{min:1,max:200},maxMinutes:{min:1,max:60}},Hu=V({auto:Hs(),maxTurns:Rs().int().min(Vu.maxTurns.min).max(Vu.maxTurns.max),maxMinutes:Rs().int().min(Vu.maxMinutes.min).max(Vu.maxMinutes.max)});V({organizer:V({url:z().nullable(),token:z().nullable(),space:z().nullable(),owner:z().nullable()}),claude:V({token:z().nullable(),savedAt:z().nullable()}),analysis:Hu}),V({organizerUrl:z().trim(),organizerToken:z().trim().min(1).optional(),claudeToken:z().trim().min(1).optional(),analysis:Hu});var Uu=`claude setup-token`;function Wu(e){return new Date(e).toLocaleDateString(`fr-FR`)}function Gu({hint:e,value:t,onChange:n,label:r,placeholder:i}){return e!==null&&t===null?(0,H.jsxs)(`div`,{className:`input token-saved`,children:[(0,H.jsxs)(`span`,{className:`mono`,children:[`•••••••••••• `,e]}),(0,H.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>n(``),children:`Remplacer`})]}):(0,H.jsx)(`input`,{className:`input mono`,type:`password`,autoComplete:`off`,spellCheck:!1,"aria-label":r,placeholder:i,value:t??``,onChange:e=>n(e.target.value)})}function Ku({view:e,onSaved:t}){let[n,r]=(0,_.useState)(e.organizer.url??``),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(e.claude.tokenHint===null?``:null),[c,l]=(0,_.useState)(e.analysis),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(!1);async function m(){let e={organizerUrl:n.trim(),analysis:c};i?.trim()&&(e.organizerToken=i.trim()),o?.trim()&&(e.claudeToken=o.trim()),d(!0);try{let n=await T.saveSettings(e);a(null),s(n.claude.tokenHint===null?``:null),t(n),se.getState().show(`info`,`Réglages enregistrés.`)}catch(e){C(e)}d(!1)}async function h(){p(!0);try{t(await T.testOrganizer()),se.getState().show(`info`,`La connexion à l'organizer fonctionne.`)}catch(e){C(e)}p(!1)}async function g(){try{await navigator.clipboard.writeText(Uu),se.getState().show(`info`,`Commande copiée.`)}catch(e){C(e)}}let v=(e,t)=>{let n=Math.round(Number(t));Number.isFinite(n)&&l({...c,[e]:Math.min(Vu[e].max,Math.max(Vu[e].min,n))})};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`page-head`,children:[(0,H.jsx)(`a`,{className:`back`,href:wl.lastHome(),"aria-label":`Retour à l'accueil`,children:(0,H.jsx)(U,{name:`arrow-left`,size:20})}),(0,H.jsxs)(`div`,{className:`page-head-text`,children:[(0,H.jsx)(`h1`,{className:`page-title`,children:`Réglages`}),(0,H.jsx)(`p`,{className:`subtitle`,children:`Analyse par Claude quand npm audit fix ne suffit pas`})]}),(0,H.jsx)(`div`,{className:`page-actions`,children:(0,H.jsx)(`button`,{type:`button`,className:`button button-primary`,disabled:u,onClick:()=>void m(),children:u?`Enregistrement…`:`Enregistrer`})})]}),(0,H.jsx)(`p`,{className:`section-label`,children:`Organizer — où l'agent crée la tâche`}),(0,H.jsxs)(`div`,{className:`panel settings-card`,children:[(0,H.jsxs)(`div`,{className:`settings-fields`,children:[(0,H.jsxs)(`label`,{className:`settings-field`,children:[(0,H.jsx)(`span`,{className:`field-label`,children:`Adresse du site`}),(0,H.jsx)(`input`,{className:`input`,value:n,placeholder:`https://organizer.example.com`,spellCheck:!1,onChange:e=>r(e.target.value)})]}),(0,H.jsxs)(`div`,{className:`settings-field settings-field-narrow`,children:[(0,H.jsx)(`span`,{className:`field-label`,children:`Token d'agent`}),(0,H.jsx)(Gu,{hint:e.organizer.tokenHint,value:i,onChange:a,label:`Token d'agent`,placeholder:`Paramètres › Agents dans l'organizer`})]})]}),(0,H.jsxs)(`div`,{className:`settings-status`,children:[e.organizer.space?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(U,{name:`circle-check`,className:`text-ok`}),(0,H.jsxs)(`span`,{children:[`Connecté à l'espace « `,e.organizer.space,` » · tâches assignées à `,e.organizer.owner]})]}):(0,H.jsx)(`span`,{className:`muted`,children:`Indiquez l'adresse du site et un token d'agent, créé dans l'organizer (Paramètres › Agents).`}),(0,H.jsx)(`span`,{className:`spacer`}),e.organizer.tokenHint!==null&&(0,H.jsx)(`button`,{type:`button`,className:`link`,disabled:f,onClick:()=>void h(),children:f?`Test…`:`Tester`})]})]}),(0,H.jsx)(`p`,{className:`section-label`,children:`Claude — abonnement utilisé pour l'analyse`}),(0,H.jsxs)(`div`,{className:`panel settings-card`,children:[(0,H.jsx)(`div`,{className:`settings-status settings-status-top`,children:e.claude.tokenHint===null?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(U,{name:`circle-alert`,className:`text-warning`}),(0,H.jsx)(`span`,{children:`Non connecté — l'analyse ne peut pas démarrer`})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(U,{name:`circle-check`,className:`text-ok`}),(0,H.jsxs)(`span`,{children:[`Connecté · token enregistré le `,Wu(e.claude.savedAt),`, valable jusqu'au `,Wu(e.claude.expiresAt)]}),(0,H.jsx)(`span`,{className:`spacer`}),o===null&&(0,H.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>s(``),children:`Remplacer`})]})}),o!==null&&(0,H.jsxs)(`ol`,{className:`claude-steps`,children:[(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`step-number`,children:`1`}),`Sur un poste avec navigateur, lancez`,(0,H.jsxs)(`button`,{type:`button`,className:`code-chip mono`,onClick:()=>void g(),title:`Copier la commande`,children:[Uu,(0,H.jsx)(U,{name:`copy`,size:14})]})]}),(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`step-number`,children:`2`}),`Autorisez l'accès dans le navigateur : le terminal affiche un token valable un an`]}),(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`step-number`,children:`3`}),`Collez-le ici`]}),(0,H.jsx)(`li`,{className:`claude-token-input`,children:(0,H.jsx)(`input`,{className:`input mono`,type:`password`,autoComplete:`off`,spellCheck:!1,"aria-label":`Token Claude`,placeholder:`sk-ant-oat01-…`,value:o,onChange:e=>s(e.target.value)})})]})]}),(0,H.jsx)(`p`,{className:`section-label`,children:`Analyse`}),(0,H.jsxs)(`div`,{className:`panel settings-card`,children:[(0,H.jsxs)(`div`,{className:`right`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`right-label`,children:`Analyser automatiquement`}),(0,H.jsx)(`div`,{className:`right-description`,children:`Dès qu'une correction se termine avec des vulnérabilités restantes`})]}),(0,H.jsx)(Vl,{checked:c.auto,onChange:e=>l({...c,auto:e}),label:`Analyser automatiquement`})]}),(0,H.jsxs)(`div`,{className:`right`,children:[(0,H.jsx)(`div`,{className:`right-label`,children:`Limites d'une analyse`}),(0,H.jsxs)(`div`,{className:`limits`,children:[(0,H.jsx)(`input`,{className:`input number-input`,type:`number`,min:Vu.maxTurns.min,max:Vu.maxTurns.max,value:c.maxTurns,"aria-label":`Tours au plus`,onChange:e=>v(`maxTurns`,e.target.value)}),(0,H.jsx)(`span`,{className:`muted`,children:`tours`}),(0,H.jsx)(`input`,{className:`input number-input`,type:`number`,min:Vu.maxMinutes.min,max:Vu.maxMinutes.max,value:c.maxMinutes,"aria-label":`Minutes au plus`,onChange:e=>v(`maxMinutes`,e.target.value)}),(0,H.jsx)(`span`,{className:`muted`,children:`min`})]})]})]})]})}function qu(){let e=b(`settings`,()=>T.getSettings(),null,{remember:!1}),[t,n]=(0,_.useState)(null),r=t??e.data;return(0,H.jsx)(`div`,{className:`page`,children:r?(0,H.jsx)(Ku,{view:r,onSaved:n}):(0,H.jsx)(`p`,{className:e.error?`error-text`:`muted`,children:e.error??`Chargement des réglages…`})})}function Ju(){let e=Ol(),[t,n]=(0,_.useState)(!1),r=(0,_.useCallback)(()=>n(!0),[]),i=(0,_.useCallback)(()=>n(!1),[]),a;if(e.name===`home`||e.name===`deprecated`){let n=e.name===`deprecated`?{kind:`deprecated`}:{kind:`category`,categoryId:e.categoryId};a=(0,H.jsx)(iu,{tab:n,adding:t,onAdd:r,onCloseAdd:i})}else a=e.name===`settings`?(0,H.jsx)(qu,{}):e.name===`repo`?(0,H.jsx)(Bu,{repoId:e.repoId},e.repoId):e.name===`operation`?(0,H.jsx)(Ou,{repoId:e.repoId,operationId:e.operationId},e.operationId):(0,H.jsx)(`div`,{className:`page`,children:(0,H.jsxs)(`p`,{className:`muted`,children:[`Adresse inconnue : `,(0,H.jsx)(`code`,{children:e.hash}),`. `,(0,H.jsx)(`a`,{className:`link`,href:wl.home(),children:`Revenir à l'accueil`}),`.`]})});let o=e.name===`home`||e.name===`deprecated`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`a`,{className:`button button-secondary button-icon`,href:wl.settings(),"aria-label":`Réglages`,title:`Réglages`,children:(0,H.jsx)(U,{name:`settings`})}),(0,H.jsx)(W,{}),(0,H.jsx)(gl,{}),(0,H.jsxs)(`button`,{type:`button`,className:`button button-primary`,onClick:r,children:[(0,H.jsx)(U,{name:`plus`}),`Ajouter un dépôt`]})]}):null;return(0,H.jsxs)(`div`,{className:`app`,children:[(0,H.jsx)(kl,{action:o}),(0,H.jsx)(`main`,{className:`main`,children:a}),(0,H.jsx)(_l,{})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(_.StrictMode,{children:(0,H.jsx)(Ju,{})}));
|
|
64
|
+
`),children:[(0,H.jsx)(U,{name:`git-pull-request`,size:14}),n?`PR #${t[0].number} en attente`:`${t.length} PR en attente`]})}function Zl(e,t,n){let r=n?`dans cette catégorie`:`parmi vos projets`;return e&&t?`Aucun dépôt vulnérable avec une PR en attente ${r}.`:t?`Aucune PR en attente ${r}.`:`Aucun dépôt vulnérable ${r}.`}function Ql({view:e}){let t=e.analysisTask;return t?(0,H.jsxs)(`a`,{className:`pr-note`,href:t.url,target:`_blank`,rel:`noreferrer`,title:t.title,children:[(0,H.jsx)(U,{name:`list-checks`,size:14}),`Tâche `,t.key,(0,H.jsx)(U,{name:`external-link`,size:12})]}):null}function $l({view:e}){let{repo:t,activeOperation:n,cleanAudit:r,auditFindings:i,unfixable:a}=e;if(n){let e=n.steps.analysis===`running`,t=n.steps.repair===`running`;return(0,H.jsxs)(`span`,{className:`status status-busy`,children:[(0,H.jsx)(U,{name:`loader-circle`,className:`spin`}),e?`Analyse par Claude…`:t?`Corrections par Claude…`:n.kind===`audit`?`Audit en cours`:`Correction en cours`]})}let o=Xc(t),s=il(t.alerts);if(s&&o.length===0)return(0,H.jsxs)(`span`,{className:`status status-clean`,title:`Toutes les alertes sont marquées corrigées à la main.`,children:[(0,H.jsx)(U,{name:`circle-check`,className:`text-ok`}),`Corrigé à la main`,(0,H.jsx)(jl,{severity:s,faded:!0,children:tl(t.alerts.length,`alerte`)})]});let c=il(o);return c&&r?(0,H.jsxs)(`span`,{className:`status status-clean`,title:`Le dernier audit (${rl[r.scope]}) n'a trouvé aucune vulnérabilité : Dependabot n'a pas encore repassé.`,children:[(0,H.jsx)(U,{name:`circle-check`,className:`text-ok`}),`Audit OK le `,cl(r.at),(0,H.jsx)(jl,{severity:c,faded:!0,children:tl(o.length,`alerte`)})]}):c?(0,H.jsxs)(`span`,{className:`status status-clean`,children:[(0,H.jsx)(Yl,{unfixable:a}),(0,H.jsx)(jl,{severity:c,children:tl(o.length,`alerte`)})]}):i?(0,H.jsxs)(`span`,{className:`status status-clean`,title:`Dependabot ne signale aucune alerte, mais le dernier audit de la branche par défaut (${rl[i.scope]}) a trouvé des vulnérabilités : Dependabot n'a pas encore repassé.`,children:[(0,H.jsx)(Yl,{unfixable:a}),(0,H.jsx)(U,{name:`triangle-alert`,className:`text-warning`}),`Audit du `,cl(i.at),(0,H.jsx)(jl,{severity:i.severity,children:tl(i.count,`vulnérabilité`)})]}):t.syncError?(0,H.jsxs)(`span`,{className:`status status-error`,title:t.syncError,children:[(0,H.jsx)(U,{name:`circle-alert`}),`Synchronisation impossible`]}):t.syncedAt?(0,H.jsxs)(`span`,{className:`status status-muted`,children:[(0,H.jsx)(U,{name:`circle-check`,className:`text-ok`}),`À jour`]}):(0,H.jsx)(`span`,{className:`status status-muted`,children:`Synchronisation…`})}function eu({categories:e,initialCategory:t,onClose:n}){let[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(t),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(0),[p,m]=(0,_.useState)(!1),h=(0,_.useRef)(null),g=b(`addable-repos`,T.listAddableRepos,null),v=p?[]:Al(g.data?.repositories??[],r),y=Math.min(d,v.length-1);(0,_.useEffect)(()=>{h.current?.focus();let e=e=>{e.key===`Escape`&&n()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[n]);async function ee(e){if(!(e.trim()===``||l)){u(!0),c(null);try{let t=await T.addRepo(e.trim(),a);n(),Tl(wl.repo(t.repo.id))}catch(e){c(e.message),u(!1)}}}function te(e){i(e),c(null),m(!0),h.current?.focus()}function ne(e){e.preventDefault(),y>=0?te(v[y]):ee(r)}function re(e){if(e.key===`Escape`&&v.length>0){e.stopPropagation(),m(!0);return}if(v.length===0||e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=e.key===`ArrowDown`?1:-1,n=v.length;f(e=>(Math.min(e,n-1)+t+n)%n)}return(0,H.jsx)(`div`,{className:`veil`,onMouseDown:e=>e.target===e.currentTarget&&n(),children:(0,H.jsxs)(`form`,{className:`modal`,onSubmit:ne,"aria-label":`Ajouter un dépôt`,children:[(0,H.jsx)(`h2`,{className:`modal-title`,children:`Ajouter un dépôt`}),(0,H.jsx)(`input`,{ref:h,className:`input`,value:r,onChange:e=>{i(e.target.value),c(null),f(0),m(!1)},onKeyDown:re,placeholder:`propriétaire/dépôt ou lien GitHub`,spellCheck:!1,role:`combobox`,"aria-expanded":v.length>0,"aria-controls":`repo-suggestions`,"aria-activedescendant":y>=0?`repo-suggestion-${y}`:void 0}),v.length>0&&(0,H.jsx)(`ul`,{className:`suggestions`,id:`repo-suggestions`,role:`listbox`,children:v.map((e,t)=>(0,H.jsx)(`li`,{id:`repo-suggestion-${t}`,role:`option`,"aria-selected":t===y,className:`suggestion${t===y?` is-active`:``}`,onMouseEnter:()=>f(t),onMouseDown:t=>{t.preventDefault(),te(e)},children:e},e))}),(0,H.jsxs)(`label`,{className:`select-field`,children:[(0,H.jsx)(U,{name:`folder`}),(0,H.jsxs)(`select`,{value:a??``,onChange:e=>o(e.target.value===``?null:e.target.value),"aria-label":`Catégorie`,children:[(0,H.jsx)(`option`,{value:``,children:`Sans catégorie`}),e.map(e=>(0,H.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,H.jsx)(U,{name:`chevron-down`,size:14,className:`select-chevron`})]}),s?(0,H.jsx)(`p`,{className:`field-error`,children:s}):g.error?(0,H.jsxs)(`p`,{className:`field-error`,children:[`Suggestions indisponibles : `,g.error]}):(0,H.jsx)(`p`,{className:`field-hint`,children:`L'agent pourra seulement lancer un audit. Modifiable ensuite.`}),(0,H.jsxs)(`div`,{className:`modal-actions`,children:[(0,H.jsx)(`button`,{type:`button`,className:`button button-secondary`,onClick:n,children:`Annuler`}),(0,H.jsx)(`button`,{type:`submit`,className:`button button-primary`,disabled:l||r.trim()===``,children:l?`Ajout…`:`Ajouter`})]})]})})}function tu({repoId:e,onDone:t}){let[n,r]=(0,_.useState)(!1);async function i(){r(!0);try{await T.deprecateRepo(e),t()}catch(e){C(e),r(!1)}}return(0,H.jsx)(`button`,{type:`button`,className:`row-action`,onClick:()=>void i(),disabled:n,title:`Marquer comme déprécié`,"aria-label":`Marquer ${e} comme déprécié`,children:(0,H.jsx)(U,{name:`archive`,size:14})})}function nu({repoId:e,onDone:t}){let[n,r]=(0,_.useState)(!1);async function i(){r(!0);try{await T.restoreRepo(e),t()}catch(e){C(e),r(!1)}}return(0,H.jsxs)(`button`,{type:`button`,className:`button button-secondary row-button`,onClick:()=>void i(),disabled:n,children:[(0,H.jsx)(U,{name:`archive-restore`,size:14}),n?`Rétablissement…`:`Rétablir`]})}function ru({views:e,onChanged:t}){return e.length===0?(0,H.jsx)(`div`,{className:`panel empty`,children:(0,H.jsx)(`p`,{children:`Aucun dépôt déprécié.`})}):(0,H.jsx)(`div`,{className:`panel list`,children:e.map(e=>(0,H.jsxs)(`div`,{className:`row row-linked`,children:[(0,H.jsx)(`a`,{className:`row-title row-link deprecated-title`,href:wl.repo(e.repo.id),children:e.repo.id}),(0,H.jsxs)(`span`,{className:`status status-muted`,children:[`Déprécié le `,cl(e.repo.deprecatedAt)]}),(0,H.jsx)(nu,{repoId:e.repo.id,onDone:t}),(0,H.jsx)(U,{name:`chevron-right`,className:`row-chevron`})]},e.repo.id))})}function iu({tab:e,adding:t,onCloseAdd:n,onAdd:r}){let i=b(`repos`,T.listRepos,Hl),a=b(`config`,T.getConfig,null),o=i.data?.categories??[],s=e.kind===`category`?e.categoryId:null,c=o.find(e=>e.id===s)??null,l=s!==null&&i.data!==null&&c===null,[u,d]=ql(Ul),[f,p]=ql(Wl),m=i.data?.repos??[],h=m.filter(e=>e.repo.deprecatedAt===null),g=m.filter(e=>e.repo.deprecatedAt!==null).sort((e,t)=>t.repo.deprecatedAt.localeCompare(e.repo.deprecatedAt)),v=h.filter(e=>s===null||e.repo.categoryId===s),y=v.filter(e=>(!u||Jl(e))&&(!f||e.repo.pullRequests.length>0)),ee=e.kind===`deprecated`;return(0,_.useEffect)(()=>{ee?Cl({kind:`deprecated`}):l||Cl({kind:`category`,categoryId:s})},[ee,s,l]),ee?(0,H.jsxs)(`div`,{className:`home`,children:[i.data&&(0,H.jsx)(Bl,{categories:o,views:h,deprecatedCount:g.length,tab:e,onChanged:i.reload}),(0,H.jsxs)(`div`,{className:`page`,children:[(0,H.jsx)(`div`,{className:`home-head`,children:(0,H.jsx)(`h1`,{className:`page-title`,children:`Dépréciés`})}),i.error&&!i.data&&(0,H.jsx)(`p`,{className:`banner banner-error`,children:i.error}),i.data&&(0,H.jsx)(ru,{views:g,onChanged:i.reload})]}),t&&i.data&&(0,H.jsx)(eu,{categories:o,initialCategory:null,onClose:n})]}):(0,H.jsxs)(`div`,{className:`home`,children:[i.data&&(0,H.jsx)(Bl,{categories:o,views:h,deprecatedCount:g.length,tab:e,onChanged:i.reload}),(0,H.jsxs)(`div`,{className:`page`,children:[(0,H.jsxs)(`div`,{className:`home-head`,children:[(0,H.jsx)(`h1`,{className:`page-title`,children:c?c.name:`Tous mes projets`}),(0,H.jsxs)(`div`,{className:`filters`,children:[(0,H.jsxs)(`label`,{className:`filter`,children:[`PR en attente`,(0,H.jsx)(Vl,{checked:f,onChange:p,label:`PR en attente`})]}),(0,H.jsxs)(`label`,{className:`filter`,children:[`Vulnérables seulement`,(0,H.jsx)(Vl,{checked:u,onChange:d,label:`Vulnérables seulement`})]})]})]}),a.data&&!a.data.githubConfigured&&(0,H.jsxs)(`p`,{className:`banner banner-error`,children:[(0,H.jsx)(U,{name:`triangle-alert`}),`GITHUB_TOKEN n'est pas défini : déclarez un token GitHub dans le bloc env du serveur.`]}),i.error&&!i.data&&(0,H.jsx)(`p`,{className:`banner banner-error`,children:i.error}),l&&(0,H.jsxs)(`p`,{className:`muted`,children:[`Cette catégorie n'existe plus. `,(0,H.jsx)(`a`,{className:`link`,href:wl.home(),children:`Voir tous les projets`}),`.`]}),i.data&&!l&&v.length>0&&y.length===0&&(0,H.jsx)(`div`,{className:`panel empty`,children:(0,H.jsx)(`p`,{children:Zl(u,f,s!==null)})}),i.data&&!l&&v.length===0&&(0,H.jsxs)(`div`,{className:`panel empty`,children:[(0,H.jsx)(`p`,{children:s===null?`Aucun dépôt suivi.`:`Aucun dépôt dans cette catégorie.`}),(0,H.jsxs)(`button`,{type:`button`,className:`button button-primary`,onClick:r,children:[(0,H.jsx)(U,{name:`plus`}),`Ajouter un dépôt`]})]}),y.length>0&&(0,H.jsx)(`div`,{className:`panel list`,children:y.map(e=>(0,H.jsxs)(`div`,{className:`row row-linked`,children:[(0,H.jsx)(`a`,{className:`row-title row-link`,href:wl.repo(e.repo.id),children:e.repo.id}),(0,H.jsx)(Xl,{repo:e.repo}),(0,H.jsx)(Ql,{view:e}),(0,H.jsx)($l,{view:e}),(0,H.jsx)(tu,{repoId:e.repo.id,onDone:i.reload}),(0,H.jsx)(U,{name:`chevron-right`,className:`row-chevron`})]},e.repo.id))})]}),t&&i.data&&(0,H.jsx)(eu,{categories:o,initialCategory:c?.id??null,onClose:n})]})}var G=1e3,au=1e4,ou={clone:{text:`Cloner le dépôt`,mono:!1},audit:{text:`npm audit`,mono:!0},fix:{text:`npm audit fix`,mono:!0},analysis:{text:`Analyse par Claude`,mono:!1},force:{text:`npm audit fix --force`,mono:!0},repair:{text:`Corrections par Claude`,mono:!1},push:{text:`Commit et push`,mono:!1}},su={pending:`circle`,running:`loader-circle`,done:`circle-check`,skipped:`circle-minus`,failed:`circle-x`},cu={done:`terminée`,failed:`échouée`,cancelled:`annulée`};function lu(e){return zc.includes(e.status)}function uu(e,t){if(e===null||t===null)return null;let n=e-t;return n>0?tl(n,`corrigée`):`aucune corrigée`}function du(e){return e.remaining.filter(e=>e.fix===`none`)}function fu(e){return[`force`,`fix`,`audit`].find(t=>e.steps[t]===`done`)??null}function pu(e,t){return e.status===`cancelled`||e.steps.fix!==`done`?`ignorée`:t===`force`&&e.forceCandidates.length===0?e.counts.afterFix===0?`rien à corriger`:`aucune correction possible`:t===`force`&&e.analysis?.report&&!e.analysis.report.force.recommended?`passé · déconseillé par Claude`:t===`force`?`passé`:t===`repair`&&(e.counts.afterForce??e.counts.afterFix)===0?`rien à corriger`:t===`push`&&e.changes.length===0&&!e.repair?.commit?`rien à pousser`:`ignorée`}function mu(e){let t=Math.floor((Date.now()-Date.parse(e.startedAt))/6e4);return`${t<1?`moins d'une minute`:`${t} min`} · ${tl(e.turns,`tour`)}`}function hu(e,t){if(!t.report)return null;let n=uu(e.counts.afterForce??e.counts.afterFix,e.counts.afterRepair),r=t.report.changes.length;return[n,r>0?tl(r,`fichier modifié`,`fichiers modifiés`):`aucun fichier modifié`].filter(Boolean).join(` · `)}function gu(e,t){let n=e.steps[t];if(t===`analysis`&&n===`running`&&e.analysis)return mu(e.analysis);if(t===`repair`&&n===`running`&&e.repair)return mu(e.repair);if(n===`skipped`)return pu(e,t);if(n!==`done`)return null;let{initial:r,afterFix:i,afterForce:a}=e.counts;switch(t){case`audit`:return r===null?null:tl(r,`vulnérabilité`);case`fix`:return uu(r,i);case`force`:return uu(i,a);case`repair`:return e.repair?(0,H.jsxs)(H.Fragment,{children:[hu(e,e.repair),e.repair.task&&(0,H.jsxs)(H.Fragment,{children:[` · `,(0,H.jsxs)(`a`,{className:`link task-link`,href:e.repair.task.url,target:`_blank`,rel:`noreferrer`,title:e.repair.task.title,children:[(0,H.jsxs)(`span`,{className:`task-link-text`,children:[`Rapport `,e.repair.task.key]}),(0,H.jsx)(U,{name:`external-link`,size:14})]})]})]}):null;case`analysis`:return e.analysis?.task?(0,H.jsxs)(`a`,{className:`link task-link`,href:e.analysis.task.url,target:`_blank`,rel:`noreferrer`,title:e.analysis.task.title,children:[(0,H.jsxs)(`span`,{className:`task-link-text`,children:[`Tâche « `,e.analysis.task.title,` »`]}),(0,H.jsx)(U,{name:`external-link`,size:14})]}):null;case`push`:return e.pullRequest?(0,H.jsxs)(`a`,{className:`link`,href:e.pullRequest.url,target:`_blank`,rel:`noreferrer`,children:[`Pull request #`,e.pullRequest.number]}):null;default:return null}}function _u({operation:e}){return(0,H.jsx)(`ul`,{className:`changes mono`,children:e.changes.map(e=>(0,H.jsxs)(`li`,{children:[sl(e.project),e.name,` `,(0,H.jsxs)(`span`,{className:`muted`,children:[e.from??`ajouté`,` → `,e.to??`retiré`]})]},`${e.project}/${e.name}`))})}function vu({activity:e,hint:t}){return(0,H.jsxs)(`div`,{className:`step-body`,children:[(0,H.jsx)(`ul`,{className:`activity mono`,children:e.map((t,n)=>(0,H.jsx)(`li`,{className:n===e.length-1?`activity-last`:void 0,children:t},`${n}-${t}`))}),(0,H.jsx)(`p`,{className:`hint`,children:t})]})}function yu({report:e}){return(0,H.jsxs)(`div`,{className:`verdict`,children:[(0,H.jsxs)(`p`,{className:`verdict-title`,children:[(0,H.jsx)(U,{name:`sparkles`,size:14}),e.force.recommended?`Claude recommande le --force`:`Claude déconseille le --force`]}),(0,H.jsx)(`p`,{className:`verdict-text`,children:e.force.reason}),e.urgent.length>0&&(0,H.jsx)(`ul`,{className:`verdict-urgent`,children:e.urgent.map(e=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`mono`,children:e.package}),` — `,e.reason]},e.package))})]})}function bu({operation:e,onDone:t}){let[n,r]=(0,_.useState)(!1),i=e.forceCandidates.reduce((e,t)=>e+t.vulnerabilities,0),a=e.analysis?.report??null,o=a!==null&&!a.force.recommended;async function s(n){r(!0);try{await T.decideForce(e.id,n),t()}catch(e){C(e),r(!1)}}return(0,H.jsxs)(`div`,{className:`step-body`,children:[(0,H.jsxs)(`p`,{className:`muted`,children:[i>1?`${i} vulnérabilités nécessitent`:`Une vulnérabilité nécessite`,` une version majeure :`]}),(0,H.jsx)(`ul`,{className:`candidates mono`,children:e.forceCandidates.map(e=>(0,H.jsxs)(`li`,{children:[sl(e.project),e.name,` `,e.from??`?`,` → `,e.to]},`${e.project}/${e.name}`))}),a&&(0,H.jsx)(yu,{report:a}),(0,H.jsxs)(`div`,{className:`step-actions${o?` step-actions-reversed`:``}`,children:[(0,H.jsx)(`button`,{type:`button`,className:`button ${o?`button-secondary`:`button-primary`}`,disabled:n,onClick:()=>void s(!0),children:`Appliquer --force`}),(0,H.jsx)(`button`,{type:`button`,className:`button ${o?`button-primary`:`button-secondary`}`,disabled:n,onClick:()=>void s(!1),children:`Passer`})]})]})}function xu({operation:e,onDone:t}){let n=b(`remarks:${e.id}`,()=>T.getRemarks(e.id),au),[r,i]=(0,_.useState)(!1),a=e.analysis?.task??null,o=n.data?.remarks??[];async function s(n){i(!0);try{await T.decideRepair(e.id,n),t()}catch(e){C(e),i(!1)}}return(0,H.jsxs)(`div`,{className:`step-body`,children:[(0,H.jsx)(`p`,{className:`muted`,children:`Claude relit la tâche et vos remarques, corrige le code ou force des versions dans le clone, lance les tests, puis fait un commit.`}),(0,H.jsxs)(`div`,{className:`verdict remarks`,children:[(0,H.jsxs)(`p`,{className:`remarks-head`,children:[(0,H.jsx)(U,{name:`message-square`,size:14}),(0,H.jsx)(`span`,{className:`remarks-count`,children:n.error?`Remarques illisibles`:n.data?o.length===0?`Aucune remarque sur la tâche`:tl(o.length,`remarque sur la tâche`,`remarques sur la tâche`):`Lecture des remarques…`}),a&&(0,H.jsxs)(`a`,{className:`link task-link`,href:a.url,target:`_blank`,rel:`noreferrer`,children:[`Commenter la tâche`,(0,H.jsx)(U,{name:`external-link`,size:12})]})]}),n.error&&(0,H.jsx)(`p`,{className:`error-text remarks-note`,children:n.error}),n.data&&o.length===0&&(0,H.jsx)(`p`,{className:`remarks-note`,children:`Sans remarque, Claude suit son analyse.`}),o.length>0&&(0,H.jsx)(`ul`,{className:`remarks-list`,children:o.map((e,t)=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`p`,{className:`remarks-body`,children:e.body}),(0,H.jsxs)(`p`,{className:`remarks-meta`,children:[e.author,` · `,el(e.createdAt)]})]},`${e.createdAt}-${t}`))})]}),(0,H.jsxs)(`div`,{className:`step-actions`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`button button-primary`,disabled:r,onClick:()=>void s(!0),children:[(0,H.jsx)(U,{name:`sparkles`}),`Lancer les corrections`]}),(0,H.jsx)(`button`,{type:`button`,className:`button button-secondary`,disabled:r,onClick:()=>void s(!1),children:e.changes.length>0?`Passer au push`:`Passer`})]})]})}var Su={passed:{icon:`circle-check`,className:`text-ok`},failed:{icon:`circle-x`,className:`error-text`},not_run:{icon:`circle-minus`,className:`muted`}};function Cu({operation:e,repair:t}){let n=t.report,r=Su[n.tests.outcome],i=e.counts.afterRepair;return(0,H.jsxs)(`div`,{className:`verdict repair-summary`,children:[(0,H.jsxs)(`p`,{className:`verdict-title`,children:[(0,H.jsx)(U,{name:`sparkles`,size:14}),`Ce que Claude a changé`]}),(0,H.jsx)(`p`,{className:`verdict-text`,children:n.summary}),n.changes.length>0&&(0,H.jsx)(`ul`,{className:`repair-changes`,children:n.changes.map(e=>(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`mono`,children:e.file}),(0,H.jsx)(`span`,{className:`muted`,children:e.change})]},e.file))}),(0,H.jsxs)(`p`,{className:`repair-line`,children:[(0,H.jsx)(U,{name:r.icon,size:12,className:r.className}),n.tests.outcome===`not_run`?`Tests non lancés`:n.tests.outcome===`passed`?`Tests réussis`:`Tests en échec`,` — `,n.tests.detail]}),(0,H.jsxs)(`p`,{className:`repair-line`,children:[(0,H.jsx)(U,{name:i===0?`circle-check`:`circle-alert`,size:12,className:i===0?`text-ok`:`text-warning`}),`npm audit après corrections : `,i===null?`non relancé`:i===0?`aucune vulnérabilité`:tl(i,`vulnérabilité`),t.task&&(0,H.jsxs)(H.Fragment,{children:[` · `,(0,H.jsxs)(`a`,{className:`link task-link`,href:t.task.url,target:`_blank`,rel:`noreferrer`,children:[`rapport détaillé `,t.task.key,(0,H.jsx)(U,{name:`external-link`,size:12})]})]})]})]})}function wu(e){let t=+!!e.auditCommit+ +!!e.commit;return e.commit?t===1?`le commit de Claude`:`${tl(t,`commit`)}, dont celui de Claude`:tl(t,`commit`)}function Tu({operation:e,onDone:t}){let[n,r]=(0,_.useState)(e.commitMessage),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(!1),c=e.repair?.report?e.repair:null;async function l(){s(!0);try{await T.decideRepair(e.id,!0),t()}catch(e){C(e),s(!1)}}async function u(){if(n.trim()!==``){s(!0);try{await T.push(e.id,n.trim()),t()}catch(e){C(e),s(!1)}}}return(0,H.jsxs)(`div`,{className:`step-body`,children:[c&&(0,H.jsx)(Cu,{operation:e,repair:c}),(0,H.jsx)(`input`,{className:`input mono commit-input${c?` commit-input-spaced`:``}`,value:n,onChange:e=>r(e.target.value),"aria-label":e.repair?`Titre de la pull request`:`Message de commit`,spellCheck:!1}),(0,H.jsxs)(`p`,{className:`hint`,children:[`Nouvelle branche `,e.branch,e.repair&&` · ${wu(e.repair)}`,` ·`,` `,(0,H.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>a(!i),children:i?`masquer les changements`:`voir les changements`})]}),i&&(0,H.jsx)(_u,{operation:e}),(0,H.jsxs)(`div`,{className:`step-actions`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`button button-primary`,disabled:o||n.trim()===``,onClick:()=>void u(),children:[(0,H.jsx)(U,{name:`upload`}),`Pousser et ouvrir la PR`]}),c&&(0,H.jsxs)(`button`,{type:`button`,className:`button button-secondary`,disabled:o,onClick:()=>void l(),children:[(0,H.jsx)(U,{name:`rotate-cw`}),`Relancer avec mes remarques`]})]})]})}function Eu({vulnerabilities:e}){return(0,H.jsxs)(`div`,{className:`step-body`,children:[(0,H.jsx)(`ul`,{className:`changes mono`,children:e.map(e=>(0,H.jsxs)(`li`,{children:[sl(e.project),e.name,` `,(0,H.jsx)(`span`,{className:`muted`,children:nl[Qc(e.severity)].toLowerCase()})]},`${e.project}/${e.name}`))}),(0,H.jsx)(`p`,{className:`hint`,children:`Aucune version corrigée n'est publiée sur le registre npm : la mise à jour est à faire à la main.`})]})}function Du({operation:e,step:t,onDone:n}){let[r,i]=(0,_.useState)(!1),a=e.steps[t],o=e.status===`waiting_force`&&t===`force`||e.status===`waiting_repair`&&t===`repair`||e.status===`waiting_push`&&t===`push`,s=t===`analysis`?e.analysis?.error??null:t===`repair`?e.repair?.error??null:e.error,c=(a===`failed`||t===`repair`)&&s,l=ou[t],u=o?t===`force`?`circle-alert`:`circle-dot`:su[a],d=fu(e)===t?du(e):[];return(0,H.jsxs)(`div`,{className:`step step-${a}${o?` step-current`:``}`,children:[(0,H.jsxs)(`div`,{className:`step-line`,children:[(0,H.jsx)(U,{name:u,className:`step-icon${a===`running`?` spin`:``}${o&&t===`force`?` text-warning`:``}`}),(0,H.jsx)(`span`,{className:`step-label${l.mono?` mono`:``}`,children:l.text}),(0,H.jsxs)(`span`,{className:`step-result`,children:[gu(e,t),d.length>0&&(0,H.jsxs)(H.Fragment,{children:[` · `,(0,H.jsx)(`button`,{type:`button`,className:`unfixable-toggle`,"aria-expanded":r,onClick:()=>i(!r),children:tl(d.length,`sans correctif`,`sans correctif`)})]})]})]}),r&&d.length>0&&(0,H.jsx)(Eu,{vulnerabilities:d}),t===`analysis`&&a===`running`&&e.analysis&&(0,H.jsx)(vu,{activity:e.analysis.activity,hint:`Le rapport et la tâche Organizer arrivent à la fin de l'analyse.`}),t===`repair`&&a===`running`&&e.repair&&(0,H.jsx)(vu,{activity:e.repair.activity,hint:`Le commit et le rapport arrivent à la fin des corrections.`}),t===`analysis`&&a===`done`&&e.analysis?.report&&(0,H.jsx)(`p`,{className:`step-body hint`,children:e.analysis.report.summary}),t===`repair`&&a===`done`&&e.status!==`waiting_push`&&e.repair?.report&&(0,H.jsx)(`p`,{className:`step-body hint`,children:e.repair.report.summary}),e.status===`waiting_force`&&t===`force`&&(0,H.jsx)(bu,{operation:e,onDone:n}),e.status===`waiting_repair`&&t===`repair`&&(0,H.jsx)(xu,{operation:e,onDone:n}),e.status===`waiting_push`&&t===`push`&&(0,H.jsx)(Tu,{operation:e,onDone:n},e.id),c&&(0,H.jsx)(`p`,{className:`step-body error-text pre`,children:s})]})}function Ou({repoId:e,operationId:t}){let[n,r]=(0,_.useState)(G),i=b(`operation:${t}`,()=>T.getOperation(t),n),[a,o]=(0,_.useState)(!1),s=i.data?.operation??null;if(s&&!lu(s)&&n!==null&&r(null),!s)return(0,H.jsx)(`div`,{className:`page`,children:(0,H.jsx)(`p`,{className:i.error?`error-text`:`muted`,children:i.error??`Chargement de l'opération…`})});let c=e.split(`/`)[1],l=cu[s.status],u=s.kind===`audit`?[`clone`,`audit`]:[`clone`,`audit`,`fix`,...s.analysis?[`analysis`]:[],`force`,...s.analysis?.task?[`repair`]:[],`push`];async function d(){try{await T.cancel(t),i.reload()}catch(e){C(e)}}return(0,H.jsxs)(`div`,{className:`page`,children:[(0,H.jsxs)(`div`,{className:`page-head`,children:[(0,H.jsx)(`a`,{className:`back`,href:wl.repo(e),"aria-label":`Retour au dépôt`,children:(0,H.jsx)(U,{name:`arrow-left`,size:20})}),(0,H.jsxs)(`div`,{className:`page-head-text`,children:[(0,H.jsxs)(`h1`,{className:`page-title`,children:[s.kind===`audit`?`Audit`:`Correction`,` de `,c]}),(0,H.jsxs)(`p`,{className:`subtitle`,children:[`Lancée par `,s.origin===`agent`?`l'agent`:`vous`,` · clone temporaire de `,s.baseBranch,` · `,rl[s.scope],l&&` · ${l}`]})]}),(0,H.jsxs)(`div`,{className:`page-actions`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`button button-ghost${a?` is-active`:``}`,onClick:()=>o(!a),children:[(0,H.jsx)(U,{name:`square-terminal`}),`Journal`]}),lu(s)&&(0,H.jsx)(`button`,{type:`button`,className:`button button-secondary`,onClick:()=>void d(),disabled:s.cancelRequested,children:s.cancelRequested?`Annulation…`:`Annuler`})]})]}),(0,H.jsx)(`div`,{className:`panel steps`,children:u.map(e=>(0,H.jsx)(Du,{operation:s,step:e,onDone:i.reload},e))}),s.error&&!Object.values(s.steps).includes(`failed`)&&(0,H.jsx)(`p`,{className:`banner banner-error pre`,children:s.error}),a&&(0,H.jsx)(`pre`,{className:`log mono`,children:s.log.map((e,t)=>(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`span`,{className:`log-time`,children:ll(e.at)}),` `,e.text]},t))})]})}function ku(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>e.toLowerCase().includes(n))}function Au({repo:e,onClose:t,onChosen:n}){let r=b(`branches:${e.id}`,()=>T.listBranches(e.id),null),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(0),[c,l]=(0,_.useState)(!1),u=(0,_.useRef)(null),d=(0,_.useRef)(null),f=ku(r.data?.branches??[],i),p=Math.min(o,f.length-1);(0,_.useEffect)(()=>u.current?.focus(),[]),(0,_.useEffect)(()=>{d.current?.querySelector(`.is-active`)?.scrollIntoView({block:`nearest`})},[p]);async function m(r){if(!c){if(r===e.branch)t();else{l(!0);try{await T.setBranch(e.id,r),n(),t()}catch(e){C(e),l(!1)}}}}function h(e){if(e.key===`Escape`){e.preventDefault(),t();return}if(e.key===`Enter`){e.preventDefault(),p>=0&&m(f[p]);return}if(f.length===0||e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let n=e.key===`ArrowDown`?1:-1,r=f.length;s(e=>(Math.min(e,r-1)+n+r)%r)}return(0,H.jsxs)(`div`,{className:`picker-menu`,children:[(0,H.jsx)(`input`,{ref:u,className:`input branch-search`,value:i,onChange:e=>{a(e.target.value),s(0)},onKeyDown:h,placeholder:`Rechercher une branche`,spellCheck:!1,role:`combobox`,"aria-expanded":f.length>0,"aria-controls":`branch-options`,"aria-activedescendant":p>=0?`branch-option-${p}`:void 0}),r.error?(0,H.jsx)(`p`,{className:`picker-note error-text`,children:r.error}):r.data?f.length===0?(0,H.jsx)(`p`,{className:`picker-note`,children:`Aucune branche ne correspond.`}):(0,H.jsx)(`ul`,{className:`picker-options`,id:`branch-options`,role:`listbox`,ref:d,children:f.map((t,n)=>(0,H.jsxs)(`li`,{id:`branch-option-${n}`,role:`option`,"aria-selected":t===e.branch,className:`picker-option${n===p?` is-active`:``}`,onMouseEnter:()=>s(n),onMouseDown:e=>{e.preventDefault(),m(t)},children:[(0,H.jsx)(`span`,{className:`picker-name mono`,children:t}),t===e.defaultBranch&&(0,H.jsx)(`span`,{className:`branch-default`,children:`par défaut`}),t===e.branch&&(0,H.jsx)(U,{name:`check`,size:14,className:`picker-check`})]},t))}):(0,H.jsx)(`p`,{className:`picker-note`,children:`Chargement des branches…`})]})}function ju({repo:e,onChanged:t}){let[n,r]=(0,_.useState)(!1),i=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(!n)return;let e=e=>{i.current?.contains(e.target)||r(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n]),(0,H.jsxs)(`span`,{className:`picker`,ref:i,children:[(0,H.jsxs)(`button`,{type:`button`,className:`picker-chip`,"aria-haspopup":`listbox`,"aria-expanded":n,title:`Branche analysée par les corrections`,onClick:()=>r(!n),children:[(0,H.jsx)(U,{name:`git-branch`,size:14}),(0,H.jsx)(`span`,{className:`mono`,children:e.branch}),(0,H.jsx)(U,{name:`chevron-down`,size:12,className:`picker-chevron`})]}),n&&(0,H.jsx)(Au,{repo:e,onClose:()=>r(!1),onChosen:t})]})}function Mu({repo:e,onClose:t,onChosen:n}){let r=b(`categories`,T.listCategories,null),[i,a]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]);async function o(r){if(!i){if(r===e.categoryId)t();else{a(!0);try{await T.setCategory(e.id,r),n(),t()}catch(e){C(e),a(!1)}}}}let s=[{id:null,name:`Sans catégorie`},...r.data?.categories??[]];return(0,H.jsx)(`div`,{className:`picker-menu picker-menu-narrow`,children:r.error?(0,H.jsx)(`p`,{className:`picker-note error-text`,children:r.error}):r.data?(0,H.jsx)(`ul`,{className:`picker-options`,role:`listbox`,"aria-label":`Catégorie`,children:s.map(t=>(0,H.jsxs)(`li`,{role:`option`,"aria-selected":t.id===e.categoryId,className:`picker-option`,onMouseDown:e=>{e.preventDefault(),o(t.id)},children:[(0,H.jsx)(`span`,{className:`picker-name`,children:t.name}),t.id===e.categoryId&&(0,H.jsx)(U,{name:`check`,size:14,className:`picker-check`})]},t.id??``))}):(0,H.jsx)(`p`,{className:`picker-note`,children:`Chargement des catégories…`})})}function Nu({repo:e,categoryName:t,onChanged:n}){let[r,i]=(0,_.useState)(!1),a=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(!r)return;let e=e=>{a.current?.contains(e.target)||i(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[r]),(0,H.jsxs)(`span`,{className:`picker`,ref:a,children:[(0,H.jsxs)(`button`,{type:`button`,className:`picker-chip`,"aria-haspopup":`listbox`,"aria-expanded":r,title:`Catégorie du dépôt`,onClick:()=>i(!r),children:[(0,H.jsx)(U,{name:`folder`,size:14}),(0,H.jsx)(`span`,{children:t??`Sans catégorie`}),(0,H.jsx)(U,{name:`chevron-down`,size:12,className:`picker-chevron`})]}),r&&(0,H.jsx)(Mu,{repo:e,onClose:()=>i(!1),onChosen:n})]})}var Pu=3e3,Fu=4e3,Iu={audit:{label:`Audit`,description:`Cloner le dépôt et lancer npm audit`},fix:{label:`Audit fix`,description:`Appliquer npm audit fix dans le clone`},force:{label:`Audit fix --force`,description:`Peut installer des versions majeures`},push:{label:`Commit et push`,description:`Pousser sur une nouvelle branche et ouvrir la PR`}};function Lu({view:e,onClose:t,onChanged:n}){let{repo:r}=e,[i,a]=(0,_.useState)(null);i&&Dc.every(e=>i[e]===r.rights[e])&&a(null);let o=i??r.rights,[s,c]=(0,_.useState)(!1);(0,_.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]),(0,_.useEffect)(()=>{if(!s)return;let e=setTimeout(()=>c(!1),Fu);return()=>clearTimeout(e)},[s]);async function l(e,t){let i={...o,[e]:t};a(i);try{await T.setRights(r.id,i),n()}catch(e){a(null),C(e)}}async function u(){if(!s)c(!0);else try{await T.removeRepo(r.id),Tl(wl.lastHome())}catch(e){c(!1),C(e)}}return(0,H.jsx)(`div`,{className:`veil`,onMouseDown:e=>e.target===e.currentTarget&&t(),children:(0,H.jsxs)(`aside`,{className:`drawer`,"aria-label":`Droits de l'agent`,children:[(0,H.jsxs)(`div`,{className:`drawer-head`,children:[(0,H.jsx)(`h2`,{className:`drawer-title`,children:`Droits de l'agent`}),(0,H.jsx)(`button`,{type:`button`,className:`icon-button`,onClick:t,"aria-label":`Fermer`,children:(0,H.jsx)(U,{name:`x`,size:18})})]}),(0,H.jsx)(`p`,{className:`drawer-subtitle`,children:`Ce que l'agent peut faire sur ce dépôt.`}),(0,H.jsx)(`div`,{className:`rights`,children:Dc.map(e=>(0,H.jsxs)(`div`,{className:`right`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`right-label`,children:Iu[e].label}),(0,H.jsx)(`div`,{className:`right-description`,children:Iu[e].description})]}),(0,H.jsx)(Vl,{checked:o[e],onChange:t=>void l(e,t),label:Iu[e].label})]},e))}),(0,H.jsxs)(`button`,{type:`button`,className:`danger-link`,onClick:()=>void u(),children:[(0,H.jsx)(U,{name:`trash-2`}),s?`Cliquer à nouveau pour retirer le dépôt`:`Retirer le dépôt`]})]})})}function Ru({view:e,onChanged:t}){let{repo:n,unfixable:r}=e,i=Xc(n);async function a(e){try{await T.markAlertHandled(n.id,e),t()}catch(e){C(e)}}return i.length===0?(0,H.jsx)(`div`,{className:`panel empty`,children:(0,H.jsx)(`p`,{children:n.alerts.length===0?`Aucune alerte ouverte.`:`Toutes les alertes sont corrigées à la main.`})}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`section-label`,children:tl(i.length,`alerte ouverte`,`alertes ouvertes`)}),(0,H.jsx)(`div`,{className:`panel list`,children:i.map(e=>(0,H.jsxs)(`div`,{className:`alert-line`,children:[(0,H.jsxs)(`a`,{className:`row alert-row`,href:e.url,target:`_blank`,rel:`noreferrer`,title:`Alerte #${e.number} sur GitHub`,children:[(0,H.jsx)(jl,{severity:e.severity,wide:!0,children:nl[e.severity]}),(0,H.jsx)(`span`,{className:`alert-package mono`,children:e.package}),(0,H.jsx)(`span`,{className:`alert-summary`,children:e.summary}),r.includes(e.package)&&(0,H.jsxs)(`span`,{className:`unfixable-note`,title:`Le dernier audit n'a trouvé aucune version corrigée publiée sur le registre npm.`,children:[(0,H.jsx)(U,{name:`triangle-alert`}),`sans correctif`]}),e.scope===`development`&&(0,H.jsx)(`span`,{className:`dev-tag`,title:`Dépendance de développement : un audit de production la laisse de côté.`,children:`dév.`}),(0,H.jsx)(`span`,{className:`alert-mark-space`}),(0,H.jsx)(U,{name:`external-link`,className:`row-chevron`})]}),(0,H.jsxs)(`button`,{type:`button`,className:`button button-secondary alert-mark`,onClick:()=>void a(e.number),children:[(0,H.jsx)(U,{name:`check`,size:14}),`Corrigée à la main`]})]},e.number))})]})}function zu({view:e,onChanged:t}){let{repo:n}=e,r=Zc(n);if(r.length===0)return null;async function i(e){try{await T.unmarkAlertHandled(n.id,e),t()}catch(e){C(e)}}return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`p`,{className:`section-label section-label-spaced`,children:`Corrigées à la main`}),(0,H.jsx)(`div`,{className:`panel list`,children:r.map(e=>{let t=n.handledAlerts.find(t=>t.number===e.number);return(0,H.jsxs)(`div`,{className:`row alert-row`,children:[(0,H.jsx)(jl,{severity:e.severity,wide:!0,faded:!0,children:nl[e.severity]}),(0,H.jsx)(`span`,{className:`alert-package mono`,children:e.package}),(0,H.jsxs)(`span`,{className:`alert-summary handled-note`,children:[(0,H.jsx)(U,{name:`circle-check`,className:`text-ok`}),`Corrigée à la main`,t&&` le ${cl(t.markedAt)}`]}),(0,H.jsx)(`button`,{type:`button`,className:`link restore-link`,onClick:()=>void i(e.number),children:`Rétablir`})]},e.number)})})]})}function Bu({repoId:e}){let t=b(`repo:${e}`,()=>T.getRepo(e),Pu),[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(!1),o=t.data;if(!o)return(0,H.jsx)(`div`,{className:`page`,children:(0,H.jsx)(`p`,{className:t.error?`error-text`:`muted`,children:t.error??`Chargement du dépôt…`})});let{repo:s,activeOperation:c,latestOperation:l}=o;async function u(e){a(!0);try{let{operation:t}=await T.startFix(s.id,e);Tl(wl.operation(s.id,t.id))}catch(e){C(e),a(!1)}}return(0,H.jsxs)(`div`,{className:`page`,children:[(0,H.jsxs)(`div`,{className:`page-head`,children:[(0,H.jsx)(`a`,{className:`back`,href:wl.lastHome(),"aria-label":`Retour aux dépôts`,children:(0,H.jsx)(U,{name:`arrow-left`,size:20})}),(0,H.jsxs)(`div`,{className:`page-head-text`,children:[(0,H.jsx)(`h1`,{className:`page-title`,children:s.name}),(0,H.jsxs)(`div`,{className:`subtitle`,children:[s.owner,` · `,(0,H.jsx)(ju,{repo:s,onChanged:t.reload}),` ·`,` `,(0,H.jsx)(Nu,{repo:s,categoryName:o.category?.name??null,onChanged:t.reload}),` ·`,` `,s.deprecatedAt?`déprécié le ${cl(s.deprecatedAt)}`:s.syncError?(0,H.jsx)(`span`,{className:`error-text`,title:s.syncError,children:`synchronisation impossible`}):s.syncedAt?`synchronisé ${el(s.syncedAt)}`:`synchronisation…`,l&&!c&&(0,H.jsxs)(H.Fragment,{children:[` · `,(0,H.jsx)(`a`,{className:`link`,href:wl.operation(s.id,l.id),children:l.kind===`audit`?`dernier audit`:`dernière correction`})]})]})]}),(0,H.jsxs)(`div`,{className:`page-actions`,children:[(0,H.jsxs)(`button`,{type:`button`,className:`button button-secondary`,onClick:()=>r(!0),children:[(0,H.jsx)(U,{name:`bot`}),`Agent`]}),c?(0,H.jsxs)(`button`,{type:`button`,className:`button button-primary`,onClick:()=>Tl(wl.operation(s.id,c.id)),children:[(0,H.jsx)(U,{name:`wrench`}),c.kind===`audit`?`Voir l'audit en cours`:`Reprendre la correction`]}):s.deprecatedAt?(0,H.jsxs)(`button`,{type:`button`,className:`button button-primary`,disabled:!0,title:`Dépôt déprécié : rétablissez-le depuis l’onglet « Dépréciés » pour le corriger.`,children:[(0,H.jsx)(U,{name:`wrench`}),`Corriger`]}):(0,H.jsx)(pl,{variant:`primary`,icon:`wrench`,label:`Corriger`,disabled:i,onLaunch:e=>void u(e)})]})]}),s.syncError&&(0,H.jsx)(`p`,{className:`banner banner-error`,children:s.syncError}),(0,H.jsx)(Ru,{view:o,onChanged:t.reload}),(0,H.jsx)(zu,{view:o,onChanged:t.reload}),n&&(0,H.jsx)(Lu,{view:o,onClose:()=>r(!1),onChanged:t.reload})]})}var Vu={maxTurns:{min:1,max:200},maxMinutes:{min:1,max:60}},Hu=V({auto:Hs(),maxTurns:Rs().int().min(Vu.maxTurns.min).max(Vu.maxTurns.max),maxMinutes:Rs().int().min(Vu.maxMinutes.min).max(Vu.maxMinutes.max)});V({organizer:V({url:z().nullable(),token:z().nullable(),space:z().nullable(),owner:z().nullable()}),claude:V({token:z().nullable(),savedAt:z().nullable()}),analysis:Hu}),V({organizerUrl:z().trim(),organizerToken:z().trim().min(1).optional(),claudeToken:z().trim().min(1).optional(),analysis:Hu});var Uu=`claude setup-token`;function Wu(e){return new Date(e).toLocaleDateString(`fr-FR`)}function Gu({hint:e,value:t,onChange:n,label:r,placeholder:i}){return e!==null&&t===null?(0,H.jsxs)(`div`,{className:`input token-saved`,children:[(0,H.jsxs)(`span`,{className:`mono`,children:[`•••••••••••• `,e]}),(0,H.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>n(``),children:`Remplacer`})]}):(0,H.jsx)(`input`,{className:`input mono`,type:`password`,autoComplete:`off`,spellCheck:!1,"aria-label":r,placeholder:i,value:t??``,onChange:e=>n(e.target.value)})}function Ku({view:e,onSaved:t}){let[n,r]=(0,_.useState)(e.organizer.url??``),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(e.claude.tokenHint===null?``:null),[c,l]=(0,_.useState)(e.analysis),[u,d]=(0,_.useState)(!1),[f,p]=(0,_.useState)(!1);async function m(){let e={organizerUrl:n.trim(),analysis:c};i?.trim()&&(e.organizerToken=i.trim()),o?.trim()&&(e.claudeToken=o.trim()),d(!0);try{let n=await T.saveSettings(e);a(null),s(n.claude.tokenHint===null?``:null),t(n),se.getState().show(`info`,`Réglages enregistrés.`)}catch(e){C(e)}d(!1)}async function h(){p(!0);try{t(await T.testOrganizer()),se.getState().show(`info`,`La connexion à l'organizer fonctionne.`)}catch(e){C(e)}p(!1)}async function g(){try{await navigator.clipboard.writeText(Uu),se.getState().show(`info`,`Commande copiée.`)}catch(e){C(e)}}let v=(e,t)=>{let n=Math.round(Number(t));Number.isFinite(n)&&l({...c,[e]:Math.min(Vu[e].max,Math.max(Vu[e].min,n))})};return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`page-head`,children:[(0,H.jsx)(`a`,{className:`back`,href:wl.lastHome(),"aria-label":`Retour à l'accueil`,children:(0,H.jsx)(U,{name:`arrow-left`,size:20})}),(0,H.jsxs)(`div`,{className:`page-head-text`,children:[(0,H.jsx)(`h1`,{className:`page-title`,children:`Réglages`}),(0,H.jsx)(`p`,{className:`subtitle`,children:`Analyse par Claude quand npm audit fix ne suffit pas`})]}),(0,H.jsx)(`div`,{className:`page-actions`,children:(0,H.jsx)(`button`,{type:`button`,className:`button button-primary`,disabled:u,onClick:()=>void m(),children:u?`Enregistrement…`:`Enregistrer`})})]}),(0,H.jsx)(`p`,{className:`section-label`,children:`Organizer — où l'agent crée la tâche`}),(0,H.jsxs)(`div`,{className:`panel settings-card`,children:[(0,H.jsxs)(`div`,{className:`settings-fields`,children:[(0,H.jsxs)(`label`,{className:`settings-field`,children:[(0,H.jsx)(`span`,{className:`field-label`,children:`Adresse du site`}),(0,H.jsx)(`input`,{className:`input`,value:n,placeholder:`https://organizer.example.com`,spellCheck:!1,onChange:e=>r(e.target.value)})]}),(0,H.jsxs)(`div`,{className:`settings-field settings-field-narrow`,children:[(0,H.jsx)(`span`,{className:`field-label`,children:`Token d'agent`}),(0,H.jsx)(Gu,{hint:e.organizer.tokenHint,value:i,onChange:a,label:`Token d'agent`,placeholder:`Paramètres › Agents dans l'organizer`})]})]}),(0,H.jsxs)(`div`,{className:`settings-status`,children:[e.organizer.space?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(U,{name:`circle-check`,className:`text-ok`}),(0,H.jsxs)(`span`,{children:[`Connecté à l'espace « `,e.organizer.space,` » · tâches assignées à `,e.organizer.owner]})]}):(0,H.jsx)(`span`,{className:`muted`,children:`Indiquez l'adresse du site et un token d'agent, créé dans l'organizer (Paramètres › Agents).`}),(0,H.jsx)(`span`,{className:`spacer`}),e.organizer.tokenHint!==null&&(0,H.jsx)(`button`,{type:`button`,className:`link`,disabled:f,onClick:()=>void h(),children:f?`Test…`:`Tester`})]})]}),(0,H.jsx)(`p`,{className:`section-label`,children:`Claude — abonnement utilisé pour l'analyse`}),(0,H.jsxs)(`div`,{className:`panel settings-card`,children:[(0,H.jsx)(`div`,{className:`settings-status settings-status-top`,children:e.claude.tokenHint===null?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(U,{name:`circle-alert`,className:`text-warning`}),(0,H.jsx)(`span`,{children:`Non connecté — l'analyse ne peut pas démarrer`})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(U,{name:`circle-check`,className:`text-ok`}),(0,H.jsxs)(`span`,{children:[`Connecté · token enregistré le `,Wu(e.claude.savedAt),`, valable jusqu'au `,Wu(e.claude.expiresAt)]}),(0,H.jsx)(`span`,{className:`spacer`}),o===null&&(0,H.jsx)(`button`,{type:`button`,className:`link`,onClick:()=>s(``),children:`Remplacer`})]})}),o!==null&&(0,H.jsxs)(`ol`,{className:`claude-steps`,children:[(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`step-number`,children:`1`}),`Sur un poste avec navigateur, lancez`,(0,H.jsxs)(`button`,{type:`button`,className:`code-chip mono`,onClick:()=>void g(),title:`Copier la commande`,children:[Uu,(0,H.jsx)(U,{name:`copy`,size:14})]})]}),(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`step-number`,children:`2`}),`Autorisez l'accès dans le navigateur : le terminal affiche un token valable un an`]}),(0,H.jsxs)(`li`,{children:[(0,H.jsx)(`span`,{className:`step-number`,children:`3`}),`Collez-le ici`]}),(0,H.jsx)(`li`,{className:`claude-token-input`,children:(0,H.jsx)(`input`,{className:`input mono`,type:`password`,autoComplete:`off`,spellCheck:!1,"aria-label":`Token Claude`,placeholder:`sk-ant-oat01-…`,value:o,onChange:e=>s(e.target.value)})})]})]}),(0,H.jsx)(`p`,{className:`section-label`,children:`Analyse`}),(0,H.jsxs)(`div`,{className:`panel settings-card`,children:[(0,H.jsxs)(`div`,{className:`right`,children:[(0,H.jsxs)(`div`,{children:[(0,H.jsx)(`div`,{className:`right-label`,children:`Analyser automatiquement`}),(0,H.jsx)(`div`,{className:`right-description`,children:`Dès qu'une correction se termine avec des vulnérabilités restantes`})]}),(0,H.jsx)(Vl,{checked:c.auto,onChange:e=>l({...c,auto:e}),label:`Analyser automatiquement`})]}),(0,H.jsxs)(`div`,{className:`right`,children:[(0,H.jsx)(`div`,{className:`right-label`,children:`Limites d'une analyse`}),(0,H.jsxs)(`div`,{className:`limits`,children:[(0,H.jsx)(`input`,{className:`input number-input`,type:`number`,min:Vu.maxTurns.min,max:Vu.maxTurns.max,value:c.maxTurns,"aria-label":`Tours au plus`,onChange:e=>v(`maxTurns`,e.target.value)}),(0,H.jsx)(`span`,{className:`muted`,children:`tours`}),(0,H.jsx)(`input`,{className:`input number-input`,type:`number`,min:Vu.maxMinutes.min,max:Vu.maxMinutes.max,value:c.maxMinutes,"aria-label":`Minutes au plus`,onChange:e=>v(`maxMinutes`,e.target.value)}),(0,H.jsx)(`span`,{className:`muted`,children:`min`})]})]})]})]})}function qu(){let e=b(`settings`,()=>T.getSettings(),null,{remember:!1}),[t,n]=(0,_.useState)(null),r=t??e.data;return(0,H.jsx)(`div`,{className:`page`,children:r?(0,H.jsx)(Ku,{view:r,onSaved:n}):(0,H.jsx)(`p`,{className:e.error?`error-text`:`muted`,children:e.error??`Chargement des réglages…`})})}function Ju(){let e=Ol(),[t,n]=(0,_.useState)(!1),r=(0,_.useCallback)(()=>n(!0),[]),i=(0,_.useCallback)(()=>n(!1),[]),a;if(e.name===`home`||e.name===`deprecated`){let n=e.name===`deprecated`?{kind:`deprecated`}:{kind:`category`,categoryId:e.categoryId};a=(0,H.jsx)(iu,{tab:n,adding:t,onAdd:r,onCloseAdd:i})}else a=e.name===`settings`?(0,H.jsx)(qu,{}):e.name===`repo`?(0,H.jsx)(Bu,{repoId:e.repoId},e.repoId):e.name===`operation`?(0,H.jsx)(Ou,{repoId:e.repoId,operationId:e.operationId},e.operationId):(0,H.jsx)(`div`,{className:`page`,children:(0,H.jsxs)(`p`,{className:`muted`,children:[`Adresse inconnue : `,(0,H.jsx)(`code`,{children:e.hash}),`. `,(0,H.jsx)(`a`,{className:`link`,href:wl.home(),children:`Revenir à l'accueil`}),`.`]})});let o=e.name===`home`||e.name===`deprecated`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(`a`,{className:`button button-secondary button-icon`,href:wl.settings(),"aria-label":`Réglages`,title:`Réglages`,children:(0,H.jsx)(U,{name:`settings`})}),(0,H.jsx)(W,{}),(0,H.jsx)(gl,{}),(0,H.jsxs)(`button`,{type:`button`,className:`button button-primary`,onClick:r,children:[(0,H.jsx)(U,{name:`plus`}),`Ajouter un dépôt`]})]}):null;return(0,H.jsxs)(`div`,{className:`app`,children:[(0,H.jsx)(kl,{action:o}),(0,H.jsx)(`main`,{className:`main`,children:a}),(0,H.jsx)(_l,{})]})}(0,v.createRoot)(document.getElementById(`root`)).render((0,H.jsx)(_.StrictMode,{children:(0,H.jsx)(Ju,{})}));
|
|
@@ -1 +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-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}
|
|
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-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 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}
|
package/gui/dist/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Dependabot Tracker</title>
|
|
7
|
-
<script type="module" crossorigin src="./assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-D98CR3xl.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DETLqB3f.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imenam/mcp-dependabot-tracker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "MCP server and web GUI that track the Dependabot alerts of GitHub repositories and fix their npm vulnerabilities in a temporary clone: npm audit, audit fix, audit fix --force, then a branch and a pull request.",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"scripts": {
|