@imenam/mcp-dependabot-tracker 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -18
- package/dist/shared/alerts.d.ts +6 -1
- package/dist/shared/alerts.js +7 -0
- package/dist/shared/schemas/api.schema.d.ts +45 -10
- package/dist/shared/schemas/api.schema.js +5 -1
- package/dist/shared/schemas/ipc.schema.d.ts +1 -1
- package/dist/shared/schemas/ipc.schema.js +5 -0
- package/dist/shared/schemas/model.schema.d.ts +259 -7
- package/dist/shared/schemas/model.schema.js +95 -8
- package/dist/shared/schemas/settings.schema.d.ts +78 -0
- package/dist/shared/schemas/settings.schema.js +42 -0
- package/dist/src/core/analysis.d.ts +54 -0
- package/dist/src/core/analysis.js +180 -0
- package/dist/src/core/audit-all.d.ts +6 -6
- package/dist/src/core/audit-all.js +6 -6
- package/dist/src/core/claude.d.ts +45 -0
- package/dist/src/core/claude.js +200 -0
- package/dist/src/core/commands.d.ts +2 -0
- package/dist/src/core/commands.js +1 -1
- package/dist/src/core/github.js +2 -1
- package/dist/src/core/operations.d.ts +27 -12
- package/dist/src/core/operations.js +282 -42
- package/dist/src/core/organizer.d.ts +57 -0
- package/dist/src/core/organizer.js +110 -0
- package/dist/src/core/repair.d.ts +31 -0
- package/dist/src/core/repair.js +150 -0
- package/dist/src/core/repos.d.ts +14 -9
- package/dist/src/core/repos.js +45 -20
- package/dist/src/core/settings.d.ts +21 -0
- package/dist/src/core/settings.js +108 -0
- package/dist/src/core/store.d.ts +2 -0
- package/dist/src/core/store.js +20 -6
- package/dist/src/gui-worker.js +29 -3
- package/dist/src/index.js +47 -9
- package/dist/src/tools/format.js +20 -8
- package/dist/src/tools/tools.js +8 -6
- package/dist/src/tools/types.d.ts +2 -0
- package/dist/src/tools/types.js +9 -0
- package/gui/dist/assets/index-CPYr3dz7.css +1 -0
- package/gui/dist/assets/index-CSbeloLm.js +64 -0
- package/gui/dist/index.html +2 -2
- package/package.json +2 -1
- package/gui/dist/assets/index-BdMhGHUf.css +0 -1
- package/gui/dist/assets/index-CIIsKFR9.js +0 -64
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { TASK_STATUSES } from "../../shared/schemas/model.schema.js";
|
|
2
|
+
import { TrackerError } from "./errors.js";
|
|
3
|
+
/**
|
|
4
|
+
* Client de l'API agent d'un site organizer (`<url>/api/agent/…`), avec un
|
|
5
|
+
* token d'agent : il couvre un espace, avec les droits de son créateur. Chaque
|
|
6
|
+
* réponse réussie est une enveloppe `{ text, data }` ; une erreur porte `{ error }`.
|
|
7
|
+
*/
|
|
8
|
+
const REQUEST_TIMEOUT_MS = 30_000;
|
|
9
|
+
const LOCAL_HOSTS = new Set(["localhost", "127.0.0.1", "[::1]"]);
|
|
10
|
+
/**
|
|
11
|
+
* Adresse du site, validée : absolue, en https sauf pour un site de cette
|
|
12
|
+
* machine (le token passerait en clair), sans identifiants, requête ni fragment.
|
|
13
|
+
*/
|
|
14
|
+
export function organizerUrl(raw) {
|
|
15
|
+
let url;
|
|
16
|
+
try {
|
|
17
|
+
url = new URL(raw.trim());
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
throw new TrackerError(`The organizer address is not an absolute URL (${raw}): expected e.g. https://organizer.example.com.`);
|
|
21
|
+
}
|
|
22
|
+
if (url.protocol !== "https:" && url.protocol !== "http:")
|
|
23
|
+
throw new TrackerError(`The organizer address must use http or https (${raw}).`);
|
|
24
|
+
if (url.protocol === "http:" && !LOCAL_HOSTS.has(url.hostname)) {
|
|
25
|
+
throw new TrackerError(`The organizer address must use https (${raw}): over http the token would travel in clear text. http is only accepted for a site on this machine.`);
|
|
26
|
+
}
|
|
27
|
+
if (url.search || url.hash || url.username || url.password) {
|
|
28
|
+
throw new TrackerError(`The organizer address must not contain credentials, a query or a fragment (${raw}).`);
|
|
29
|
+
}
|
|
30
|
+
return url.href.replace(/\/+$/, "");
|
|
31
|
+
}
|
|
32
|
+
export class OrganizerClient {
|
|
33
|
+
connection;
|
|
34
|
+
constructor(connection) {
|
|
35
|
+
this.connection = connection;
|
|
36
|
+
}
|
|
37
|
+
/** Adresse de la page d'une tâche sur le site. */
|
|
38
|
+
taskUrl(taskId) {
|
|
39
|
+
return `${this.connection.url}/#/task/${encodeURIComponent(taskId)}`;
|
|
40
|
+
}
|
|
41
|
+
/** Espace du token et son propriétaire. */
|
|
42
|
+
async space() {
|
|
43
|
+
const data = await this.get("context");
|
|
44
|
+
const owner = Array.isArray(data?.members) ? data.members.find((member) => member?.role === "owner") : undefined;
|
|
45
|
+
if (typeof data?.space?.id !== "string" || typeof data?.space?.name !== "string" || typeof owner?.id !== "string") {
|
|
46
|
+
throw new TrackerError(`The organizer at ${this.connection.url} sent an unexpected context: check that it is up to date.`);
|
|
47
|
+
}
|
|
48
|
+
return { space: { id: data.space.id, name: data.space.name }, owner: { id: owner.id, name: String(owner.name), email: String(owner.email) } };
|
|
49
|
+
}
|
|
50
|
+
/** Tâche de l'espace, par sa clé (ex. `ORG-42`) ou son identifiant. */
|
|
51
|
+
async task(ref) {
|
|
52
|
+
return this.parseTask((await this.get(`tasks/${encodeURIComponent(ref)}`))?.task, ref);
|
|
53
|
+
}
|
|
54
|
+
/** Tâche de l'espace et ses commentaires récents, du plus ancien au plus récent. */
|
|
55
|
+
async taskWithComments(ref) {
|
|
56
|
+
const data = await this.get(`tasks/${encodeURIComponent(ref)}`);
|
|
57
|
+
const comments = data?.comments;
|
|
58
|
+
if (!Array.isArray(comments) || !comments.every((comment) => typeof comment?.authorName === "string" && typeof comment.body === "string" && typeof comment.createdAt === "string")) {
|
|
59
|
+
throw new TrackerError(`The organizer at ${this.connection.url} sent an unexpected answer for the comments of task ${ref}: check that it is up to date.`);
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
task: this.parseTask(data.task, ref),
|
|
63
|
+
comments: comments.map((comment) => ({ author: comment.authorName, body: comment.body, createdAt: comment.createdAt })),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
parseTask(task, ref) {
|
|
67
|
+
if (typeof task?.id !== "string" ||
|
|
68
|
+
typeof task.key !== "string" ||
|
|
69
|
+
typeof task.title !== "string" ||
|
|
70
|
+
!TASK_STATUSES.includes(task.status) ||
|
|
71
|
+
(task.parentKey !== null && typeof task.parentKey !== "string") ||
|
|
72
|
+
!Array.isArray(task.assigneeIds) ||
|
|
73
|
+
!Array.isArray(task.tags)) {
|
|
74
|
+
throw new TrackerError(`The organizer at ${this.connection.url} sent an unexpected answer for task ${ref}: check that it is up to date.`);
|
|
75
|
+
}
|
|
76
|
+
return { id: task.id, key: task.key, title: task.title, status: task.status, parentKey: task.parentKey, assigneeIds: task.assigneeIds, tags: task.tags };
|
|
77
|
+
}
|
|
78
|
+
/** Données d'une lecture de l'API agent. Une redirection n'est jamais suivie : le token ne part que vers l'adresse réglée. */
|
|
79
|
+
async get(path) {
|
|
80
|
+
let response;
|
|
81
|
+
try {
|
|
82
|
+
response = await fetch(`${this.connection.url}/api/agent/${path}`, {
|
|
83
|
+
headers: { authorization: `Bearer ${this.connection.token}`, accept: "application/json" },
|
|
84
|
+
redirect: "manual",
|
|
85
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
throw new TrackerError(`Cannot reach the organizer at ${this.connection.url} (${err?.cause?.message ?? err?.message ?? err}).`);
|
|
90
|
+
}
|
|
91
|
+
if (response.status >= 300 && response.status < 400) {
|
|
92
|
+
throw new TrackerError(`The organizer at ${this.connection.url} answered with a redirect (HTTP ${response.status}): use the final https address of the site.`);
|
|
93
|
+
}
|
|
94
|
+
let payload = null;
|
|
95
|
+
try {
|
|
96
|
+
payload = await response.json();
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
payload = null;
|
|
100
|
+
}
|
|
101
|
+
if (!response.ok) {
|
|
102
|
+
const reason = typeof payload?.error === "string" ? payload.error : `HTTP ${response.status}`;
|
|
103
|
+
throw new TrackerError(`The organizer at ${this.connection.url} refused the request: ${reason}`);
|
|
104
|
+
}
|
|
105
|
+
if (payload === null || typeof payload !== "object" || !("data" in payload)) {
|
|
106
|
+
throw new TrackerError(`The organizer at ${this.connection.url} sent an unexpected answer: check the address of the site.`);
|
|
107
|
+
}
|
|
108
|
+
return payload.data;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { RemarksResponse } from "../../shared/schemas/api.schema.js";
|
|
2
|
+
import { type AnalysisTask, type AuditScope, type Operation, type RepairReport } from "../../shared/schemas/model.schema.js";
|
|
3
|
+
import type { Settings } from "../../shared/schemas/settings.schema.js";
|
|
4
|
+
import { type ClaudeRuntime } from "./claude.js";
|
|
5
|
+
export interface RepairInput {
|
|
6
|
+
repoId: string;
|
|
7
|
+
branch: string;
|
|
8
|
+
scope: AuditScope;
|
|
9
|
+
/** Clone du dépôt : dossier de travail de Claude. */
|
|
10
|
+
cwd: string;
|
|
11
|
+
/** Dossier de l'opération, hors du clone : configuration MCP de la session. */
|
|
12
|
+
workDir: string;
|
|
13
|
+
/** Vulnérabilités restantes, d'après `npm audit --json`. */
|
|
14
|
+
facts: unknown[];
|
|
15
|
+
forceApplied: boolean;
|
|
16
|
+
/** Clé de la tâche de l'analyse, dont les commentaires portent les remarques de l'utilisateur. */
|
|
17
|
+
analysisTask: string;
|
|
18
|
+
/** Clé de la sous-tâche d'un passage précédent, dont le clone contient encore les corrections. */
|
|
19
|
+
reportTask: string | null;
|
|
20
|
+
settings: Settings;
|
|
21
|
+
claude: ClaudeRuntime;
|
|
22
|
+
signal: AbortSignal;
|
|
23
|
+
onLine: (line: string, turns: number) => void;
|
|
24
|
+
}
|
|
25
|
+
/** Tâche de l'analyse d'une opération et ses commentaires : les remarques que Claude prendra en compte. */
|
|
26
|
+
export declare function analysisRemarks(settings: Settings, operation: Operation): Promise<RemarksResponse>;
|
|
27
|
+
/** Lance les corrections, puis vérifie sur l'organizer la sous-tâche que Claude dit avoir créée ou mise à jour. */
|
|
28
|
+
export declare function repairVulnerabilities(input: RepairInput): Promise<{
|
|
29
|
+
report: RepairReport;
|
|
30
|
+
task: AnalysisTask;
|
|
31
|
+
}>;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { RepairReportSchema, TEST_OUTCOMES } from "../../shared/schemas/model.schema.js";
|
|
5
|
+
import { ORGANIZER_SERVER, factsJson, organizerServer } from "./analysis.js";
|
|
6
|
+
import { runClaudeSession } from "./claude.js";
|
|
7
|
+
import { TrackerError } from "./errors.js";
|
|
8
|
+
import { OrganizerClient } from "./organizer.js";
|
|
9
|
+
import { organizerConnection } from "./settings.js";
|
|
10
|
+
/**
|
|
11
|
+
* Corrections par Claude des vulnérabilités que `npm audit fix` laisse dans un
|
|
12
|
+
* 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 et
|
|
14
|
+
* quelques commandes npm : installation, audit, tests), sans git ni écriture
|
|
15
|
+
* hors du clone ; les commandes qu'il lance ne reçoivent pas son token. Il crée
|
|
16
|
+
* une sous-tâche « rapport de développement » de la tâche de l'analyse, ou met
|
|
17
|
+
* à jour celle d'un passage précédent, puis rend un rapport structuré. Le
|
|
18
|
+
* tracker relit la sous-tâche sur l'organizer : absente, rattachée à une autre
|
|
19
|
+
* tâche, mal assignée ou mal taguée, elle fait échouer les corrections.
|
|
20
|
+
*/
|
|
21
|
+
/** Outils organizer autorisés ; tout autre appel est refusé par `dontAsk`. */
|
|
22
|
+
const ORGANIZER_TOOLS = ["get_task", "create_task", "update_task", "set_assignees", "set_tags"];
|
|
23
|
+
/** Commandes que Claude peut lancer dans le clone, chacune avec ou sans arguments. */
|
|
24
|
+
const ALLOWED_COMMANDS = ["npm install", "npm ci", "npm audit", "npm test", "npm run", "npm ls", "npx tsc"];
|
|
25
|
+
/** Réglages de la session : Edit et Write refusent tout chemin hors du clone. */
|
|
26
|
+
const SESSION_SETTINGS = { permissions: { blockWritesOutsideWorkingDirectories: true } };
|
|
27
|
+
/** Résultat demandé à Claude : le rapport et la clé de la sous-tâche. */
|
|
28
|
+
const OutputSchema = RepairReportSchema.extend({ task: z.string().min(1), commitMessage: z.string().trim().min(1) });
|
|
29
|
+
const OUTPUT_JSON_SCHEMA = {
|
|
30
|
+
type: "object",
|
|
31
|
+
additionalProperties: false,
|
|
32
|
+
required: ["task", "summary", "changes", "commitMessage", "tests"],
|
|
33
|
+
properties: {
|
|
34
|
+
task: { type: "string", description: "Key of the development report sub-task, e.g. ORG-43." },
|
|
35
|
+
summary: { type: "string", description: "One or two sentences, in French." },
|
|
36
|
+
changes: {
|
|
37
|
+
type: "array",
|
|
38
|
+
description: "Every file you changed; empty when none.",
|
|
39
|
+
items: {
|
|
40
|
+
type: "object",
|
|
41
|
+
additionalProperties: false,
|
|
42
|
+
required: ["file", "change"],
|
|
43
|
+
properties: { file: { type: "string", description: "Path relative to the repository root." }, change: { type: "string", description: "A few words, in French." } },
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
commitMessage: { type: "string", description: "Conventional commit message in English, first line under 72 characters." },
|
|
47
|
+
tests: {
|
|
48
|
+
type: "object",
|
|
49
|
+
additionalProperties: false,
|
|
50
|
+
required: ["outcome", "detail"],
|
|
51
|
+
properties: { outcome: { type: "string", enum: [...TEST_OUTCOMES] }, detail: { type: "string", description: "One sentence, in French." } },
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
function prompt(input, space, owner, tag) {
|
|
56
|
+
const fixes = input.forceApplied ? "`npm audit fix` and `npm audit fix --force`" : "`npm audit fix`";
|
|
57
|
+
const omit = input.scope === "production" ? " --omit=dev" : "";
|
|
58
|
+
const report = input.reportTask
|
|
59
|
+
? `update the description of your previous report, task ${input.reportTask}, with update_task (keep it a sub-task of ${input.analysisTask}); do not create a new one.`
|
|
60
|
+
: `create one sub-task of ${input.analysisTask} with create_task (parent "${input.analysisTask}"), without request_id, titled in French "Rapport de développement — " followed by what you changed.`;
|
|
61
|
+
return [
|
|
62
|
+
`You fix the npm vulnerabilities that ${fixes} left in the GitHub repository ${input.repoId} (branch ${input.branch}).`,
|
|
63
|
+
input.scope === "production"
|
|
64
|
+
? "The audit covers the production dependencies only (`--omit=dev`): the vulnerabilities of the devDependencies are out of scope."
|
|
65
|
+
: "The audit covers all the dependencies, devDependencies included.",
|
|
66
|
+
`The current directory is a clone of that branch where ${fixes} already updated the lockfiles.`,
|
|
67
|
+
...(input.reportTask ? [`It also holds the changes of your previous pass, described in task ${input.reportTask}: build on them, and change or revert them where the remarks of the user ask for it.`] : []),
|
|
68
|
+
"",
|
|
69
|
+
"Remaining vulnerabilities, from `npm audit --json` (`project` is the folder of the package-lock.json):",
|
|
70
|
+
"```json",
|
|
71
|
+
factsJson(input.facts),
|
|
72
|
+
"```",
|
|
73
|
+
"",
|
|
74
|
+
"Your job:",
|
|
75
|
+
`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
|
+
"2. Fix what can be fixed, with minimal changes: upgrade a dependency in package.json, or pin a transitive one with an `overrides` entry, then run `npm install --package-lock-only --ignore-scripts` in the folder of its package-lock.json; adapt the code to the new versions.",
|
|
77
|
+
`3. Check your work: run \`npm audit${omit}\` in each project; install the dependencies with \`npm ci\` and run the tests (\`npm test\`, or the test script of package.json) when the project has some.`,
|
|
78
|
+
" You can only run npm install, npm ci, npm audit, npm test, npm run, npm ls and npx tsc. Never run git, and never write outside the current directory: the tracker commits your changes, node_modules aside.",
|
|
79
|
+
`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
|
+
` Assign it to ${owner.name} with set_assignees (member id ${owner.id}), and set its tags to exactly ["${tag}"] with set_tags.`,
|
|
81
|
+
"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.",
|
|
82
|
+
].join("\n");
|
|
83
|
+
}
|
|
84
|
+
/** Tâche de l'analyse d'une opération et ses commentaires : les remarques que Claude prendra en compte. */
|
|
85
|
+
export async function analysisRemarks(settings, operation) {
|
|
86
|
+
const connection = organizerConnection(settings);
|
|
87
|
+
const task = operation.analysis?.task;
|
|
88
|
+
if (!connection)
|
|
89
|
+
throw new TrackerError("The organizer connection is not set: set it in the settings.");
|
|
90
|
+
if (!task)
|
|
91
|
+
throw new TrackerError(`Operation ${operation.id} has no organizer task from an analysis.`);
|
|
92
|
+
const { comments } = await new OrganizerClient(connection).taskWithComments(task.key);
|
|
93
|
+
return { task, remarks: comments };
|
|
94
|
+
}
|
|
95
|
+
/** Lance les corrections, puis vérifie sur l'organizer la sous-tâche que Claude dit avoir créée ou mise à jour. */
|
|
96
|
+
export async function repairVulnerabilities(input) {
|
|
97
|
+
const connection = organizerConnection(input.settings);
|
|
98
|
+
const token = input.settings.claude.token;
|
|
99
|
+
if (!connection || !token)
|
|
100
|
+
throw new TrackerError("The fixes by Claude need the organizer connection and the Claude token: set them in the settings.");
|
|
101
|
+
const organizer = new OrganizerClient(connection);
|
|
102
|
+
const { space, owner } = await organizer.space();
|
|
103
|
+
const tag = input.repoId.split("/")[1];
|
|
104
|
+
const configFile = path.join(input.workDir, "repair-mcp.json");
|
|
105
|
+
fs.writeFileSync(configFile, JSON.stringify({ mcpServers: { [ORGANIZER_SERVER]: organizerServer(connection) } }), { encoding: "utf-8", mode: 0o600 });
|
|
106
|
+
let structured;
|
|
107
|
+
try {
|
|
108
|
+
({ structured } = await runClaudeSession(input.claude, {
|
|
109
|
+
cwd: input.cwd,
|
|
110
|
+
prompt: prompt(input, space.name, owner, tag),
|
|
111
|
+
args: [
|
|
112
|
+
"--tools",
|
|
113
|
+
"Read,Grep,Glob,Edit,Write,Bash",
|
|
114
|
+
"--allowedTools",
|
|
115
|
+
["Edit", "Write", ...ALLOWED_COMMANDS.map((command) => `Bash(${command} *)`), ...ORGANIZER_TOOLS.map((tool) => `mcp__${ORGANIZER_SERVER}__${tool}`)].join(","),
|
|
116
|
+
"--settings",
|
|
117
|
+
JSON.stringify(SESSION_SETTINGS),
|
|
118
|
+
"--mcp-config",
|
|
119
|
+
configFile,
|
|
120
|
+
"--strict-mcp-config",
|
|
121
|
+
"--json-schema",
|
|
122
|
+
JSON.stringify(OUTPUT_JSON_SCHEMA),
|
|
123
|
+
],
|
|
124
|
+
env: { CLAUDE_CODE_SUBPROCESS_ENV_SCRUB: "1" },
|
|
125
|
+
token,
|
|
126
|
+
maxTurns: input.settings.analysis.maxTurns,
|
|
127
|
+
maxMinutes: input.settings.analysis.maxMinutes,
|
|
128
|
+
signal: input.signal,
|
|
129
|
+
onLine: input.onLine,
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
132
|
+
finally {
|
|
133
|
+
fs.rmSync(configFile, { force: true });
|
|
134
|
+
}
|
|
135
|
+
const output = OutputSchema.safeParse(structured);
|
|
136
|
+
if (!output.success)
|
|
137
|
+
throw new TrackerError("Claude Code ended without the structured report of its fixes.");
|
|
138
|
+
const task = await organizer.task(output.data.task);
|
|
139
|
+
if (task.parentKey?.toLowerCase() !== input.analysisTask.toLowerCase()) {
|
|
140
|
+
throw new TrackerError(`Task ${task.key} is not a sub-task of ${input.analysisTask}.`);
|
|
141
|
+
}
|
|
142
|
+
if (!task.tags.some((candidate) => candidate.toLowerCase() === tag.toLowerCase())) {
|
|
143
|
+
throw new TrackerError(`Task ${task.key} was created without the tag "${tag}".`);
|
|
144
|
+
}
|
|
145
|
+
if (!task.assigneeIds.includes(owner.id)) {
|
|
146
|
+
throw new TrackerError(`Task ${task.key} was created without being assigned to ${owner.name}.`);
|
|
147
|
+
}
|
|
148
|
+
const { task: _key, ...report } = output.data;
|
|
149
|
+
return { report, task: { key: task.key, title: task.title, url: organizer.taskUrl(task.id), status: task.status } };
|
|
150
|
+
}
|
package/dist/src/core/repos.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Alert, type AlertSeverity, type HandledAlert, type Operation, type PullRequest, type Repo, type Rights } from "../../shared/schemas/model.schema.js";
|
|
2
|
-
import type { AuditFindings, RepoView } from "../../shared/schemas/api.schema.js";
|
|
1
|
+
import { type Alert, type AlertSeverity, type AnalysisTask, type HandledAlert, type Operation, type PullRequest, type Repo, type Rights } from "../../shared/schemas/model.schema.js";
|
|
2
|
+
import type { AuditFindings, CleanAudit, RepoView } from "../../shared/schemas/api.schema.js";
|
|
3
3
|
import type { GitHubConfig } from "./config.js";
|
|
4
4
|
import { type OpenPullRequest } from "./github.js";
|
|
5
5
|
import { type Store } from "./store.js";
|
|
@@ -20,16 +20,18 @@ export declare function sortRepos<T extends {
|
|
|
20
20
|
auditFindings?: AuditFindings | null;
|
|
21
21
|
}>(views: T[]): T[];
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* par défaut, la seule que Dependabot analyse, et dater d'après
|
|
26
|
-
* alertes. Null sinon. `operations` va de la plus récente à la
|
|
23
|
+
* Dernier audit, quand il n'a trouvé aucune vulnérabilité alors que Dependabot
|
|
24
|
+
* signale encore des alertes dans son périmètre : l'audit doit porter sur la
|
|
25
|
+
* branche par défaut, la seule que Dependabot analyse, et dater d'après
|
|
26
|
+
* chacune de ces alertes. Null sinon. `operations` va de la plus récente à la
|
|
27
|
+
* plus ancienne.
|
|
27
28
|
*/
|
|
28
|
-
export declare function
|
|
29
|
+
export declare function cleanAudit(repo: Repo, operations: Operation[]): CleanAudit | null;
|
|
29
30
|
/**
|
|
30
31
|
* Vulnérabilités trouvées par le dernier audit de la branche par défaut, la
|
|
31
|
-
* seule que Dependabot analyse, quand Dependabot ne signale aucune alerte
|
|
32
|
-
* Null sinon. `operations` va de la plus récente à
|
|
32
|
+
* seule que Dependabot analyse, quand Dependabot ne signale aucune alerte dans
|
|
33
|
+
* le périmètre de cet audit. Null sinon. `operations` va de la plus récente à
|
|
34
|
+
* la plus ancienne.
|
|
33
35
|
*/
|
|
34
36
|
export declare function auditFindings(repo: Repo, operations: Operation[]): AuditFindings | null;
|
|
35
37
|
/**
|
|
@@ -51,6 +53,9 @@ export declare function pruneHandledAlerts(handled: HandledAlert[], alerts: Aler
|
|
|
51
53
|
*/
|
|
52
54
|
export declare function trackerPullRequests(repoId: string, pulls: OpenPullRequest[]): PullRequest[];
|
|
53
55
|
export declare function repoView(store: Store, repo: Repo): RepoView;
|
|
56
|
+
/** Tâche organizer de la dernière analyse, tant qu'elle n'est pas terminée. `operations` va de la plus récente à la plus ancienne. */
|
|
57
|
+
export declare function openAnalysisTask(operations: Operation[]): AnalysisTask | null;
|
|
58
|
+
/** Vues de tous les dépôts suivis ; les dépôts, les catégories et les opérations sont lus une seule fois. */
|
|
54
59
|
export declare function listRepoViews(store: Store): RepoView[];
|
|
55
60
|
/**
|
|
56
61
|
* Relit les alertes Dependabot ouvertes du dépôt et ses pull requests ouvertes
|
package/dist/src/core/repos.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { fromNpmSeverity, pendingAlerts, worstOf } from "../../shared/alerts.js";
|
|
1
|
+
import { alertsInScope, fromNpmSeverity, pendingAlerts, worstOf } from "../../shared/alerts.js";
|
|
2
2
|
import { ALERT_SEVERITIES, DEFAULT_RIGHTS } from "../../shared/schemas/model.schema.js";
|
|
3
|
+
import { latestAnalysed } from "./analysis.js";
|
|
3
4
|
import { ConflictError, NotFoundError } from "./errors.js";
|
|
4
5
|
import { GitHubClient } from "./github.js";
|
|
5
6
|
import { isTrackerBranch } from "./operations.js";
|
|
@@ -43,33 +44,36 @@ export function sortRepos(views) {
|
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* par défaut, la seule que Dependabot analyse, et dater d'après
|
|
49
|
-
* alertes. Null sinon. `operations` va de la plus récente à la
|
|
47
|
+
* Dernier audit, quand il n'a trouvé aucune vulnérabilité alors que Dependabot
|
|
48
|
+
* signale encore des alertes dans son périmètre : l'audit doit porter sur la
|
|
49
|
+
* branche par défaut, la seule que Dependabot analyse, et dater d'après
|
|
50
|
+
* chacune de ces alertes. Null sinon. `operations` va de la plus récente à la
|
|
51
|
+
* plus ancienne.
|
|
50
52
|
*/
|
|
51
|
-
export function
|
|
52
|
-
if (repo.alerts.length === 0)
|
|
53
|
-
return null;
|
|
53
|
+
export function cleanAudit(repo, operations) {
|
|
54
54
|
const audited = operations.find((operation) => operation.steps.audit === "done");
|
|
55
55
|
if (!audited || audited.counts.initial !== 0 || audited.baseBranch !== repo.defaultBranch)
|
|
56
56
|
return null;
|
|
57
|
+
const alerts = alertsInScope(repo.alerts, audited.scope);
|
|
58
|
+
if (alerts.length === 0)
|
|
59
|
+
return null;
|
|
57
60
|
const auditedAt = Date.parse(audited.createdAt);
|
|
58
|
-
return
|
|
61
|
+
return alerts.every((alert) => Date.parse(alert.createdAt) <= auditedAt) ? { at: audited.createdAt, scope: audited.scope } : null;
|
|
59
62
|
}
|
|
60
63
|
/**
|
|
61
64
|
* Vulnérabilités trouvées par le dernier audit de la branche par défaut, la
|
|
62
|
-
* seule que Dependabot analyse, quand Dependabot ne signale aucune alerte
|
|
63
|
-
* Null sinon. `operations` va de la plus récente à
|
|
65
|
+
* seule que Dependabot analyse, quand Dependabot ne signale aucune alerte dans
|
|
66
|
+
* le périmètre de cet audit. Null sinon. `operations` va de la plus récente à
|
|
67
|
+
* la plus ancienne.
|
|
64
68
|
*/
|
|
65
69
|
export function auditFindings(repo, operations) {
|
|
66
|
-
if (repo.alerts.length > 0)
|
|
67
|
-
return null;
|
|
68
70
|
const audited = operations.find((operation) => operation.steps.audit === "done" && operation.baseBranch === repo.defaultBranch);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
if (!audited || alertsInScope(repo.alerts, audited.scope).length > 0)
|
|
72
|
+
return null;
|
|
73
|
+
const severity = worstOf(audited.found.map((vulnerability) => fromNpmSeverity(vulnerability.severity)));
|
|
74
|
+
if (severity === null)
|
|
71
75
|
return null;
|
|
72
|
-
return { at: audited.createdAt, count: audited.found.length, severity };
|
|
76
|
+
return { at: audited.createdAt, scope: audited.scope, count: audited.found.length, severity };
|
|
73
77
|
}
|
|
74
78
|
/**
|
|
75
79
|
* Paquets pour lesquels le dernier audit n'a trouvé aucune version corrigée,
|
|
@@ -105,20 +109,41 @@ export function trackerPullRequests(repoId, pulls) {
|
|
|
105
109
|
.map(({ number, url, branch, createdAt }) => ({ number, url, branch, createdAt }));
|
|
106
110
|
}
|
|
107
111
|
export function repoView(store, repo) {
|
|
108
|
-
|
|
112
|
+
return buildRepoView(repo, store.listOperations(repo.id), repo.categoryId === null ? null : store.getCategory(repo.categoryId));
|
|
113
|
+
}
|
|
114
|
+
/** Vue d'un dépôt à partir de ses opérations, de la plus récente à la plus ancienne, et de sa catégorie. */
|
|
115
|
+
function buildRepoView(repo, operations, category) {
|
|
109
116
|
return {
|
|
110
117
|
repo: { ...repo, alerts: sortAlerts(repo.alerts) },
|
|
111
|
-
category
|
|
118
|
+
category,
|
|
112
119
|
activeOperation: operations.find(isActive) ?? null,
|
|
113
120
|
latestOperation: operations[0] ?? null,
|
|
114
|
-
|
|
121
|
+
cleanAudit: cleanAudit(repo, operations),
|
|
115
122
|
auditFindings: auditFindings(repo, operations),
|
|
116
123
|
unfixable: unfixablePackages(repo, operations),
|
|
124
|
+
analysisTask: openAnalysisTask(operations),
|
|
117
125
|
};
|
|
118
126
|
}
|
|
127
|
+
/** Tâche organizer de la dernière analyse, tant qu'elle n'est pas terminée. `operations` va de la plus récente à la plus ancienne. */
|
|
128
|
+
export function openAnalysisTask(operations) {
|
|
129
|
+
const task = latestAnalysed(operations)?.analysis?.task ?? null;
|
|
130
|
+
return task && task.status !== "done" ? task : null;
|
|
131
|
+
}
|
|
132
|
+
/** Vues de tous les dépôts suivis ; les dépôts, les catégories et les opérations sont lus une seule fois. */
|
|
119
133
|
export function listRepoViews(store) {
|
|
120
134
|
store.failOrphanedOperations();
|
|
121
|
-
|
|
135
|
+
const categories = new Map(store.listCategories().map((category) => [category.id, category]));
|
|
136
|
+
const operationsByRepo = new Map();
|
|
137
|
+
for (const operation of store.listAllOperations()) {
|
|
138
|
+
const key = operation.repoId.toLowerCase();
|
|
139
|
+
operationsByRepo.set(key, [...(operationsByRepo.get(key) ?? []), operation]);
|
|
140
|
+
}
|
|
141
|
+
return sortRepos(store.listRepos().map((repo) => {
|
|
142
|
+
const category = repo.categoryId === null ? null : categories.get(repo.categoryId);
|
|
143
|
+
if (category === undefined)
|
|
144
|
+
throw new NotFoundError(`Category "${repo.categoryId}" does not exist.`);
|
|
145
|
+
return buildRepoView(repo, operationsByRepo.get(repo.id.toLowerCase()) ?? [], category);
|
|
146
|
+
}));
|
|
122
147
|
}
|
|
123
148
|
/**
|
|
124
149
|
* Relit les alertes Dependabot ouvertes du dépôt et ses pull requests ouvertes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type SaveSettingsBody, type Settings, type SettingsView } from "../../shared/schemas/settings.schema.js";
|
|
2
|
+
import { type OrganizerConnection, type OrganizerSpace } from "./organizer.js";
|
|
3
|
+
/** Vérifications faites à l'enregistrement : remplacées dans les tests. */
|
|
4
|
+
export interface SettingsChecks {
|
|
5
|
+
organizer: (connection: OrganizerConnection) => Promise<OrganizerSpace>;
|
|
6
|
+
claudeToken: (token: string) => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare function readSettings(dataDir: string): Settings;
|
|
9
|
+
/** Connexion à l'organizer, null tant que l'adresse ou le token manque. */
|
|
10
|
+
export declare function organizerConnection(settings: Settings): OrganizerConnection | null;
|
|
11
|
+
/** Vrai quand l'organizer (connexion testée) et Claude sont configurés. */
|
|
12
|
+
export declare function analysisReady(settings: Settings): boolean;
|
|
13
|
+
export declare function settingsView(settings: Settings): SettingsView;
|
|
14
|
+
/**
|
|
15
|
+
* Enregistre les réglages de la GUI. Une connexion à l'organizer modifiée est
|
|
16
|
+
* testée, un nouveau token Claude vérifié : un échec refuse tout
|
|
17
|
+
* l'enregistrement. L'analyse automatique exige l'organizer et Claude.
|
|
18
|
+
*/
|
|
19
|
+
export declare function saveSettings(dataDir: string, body: SaveSettingsBody, checks: SettingsChecks): Promise<SettingsView>;
|
|
20
|
+
/** Teste la connexion enregistrée à l'organizer et relève son espace et son propriétaire. */
|
|
21
|
+
export declare function testOrganizer(dataDir: string, checks: SettingsChecks): Promise<SettingsView>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import crypto from "crypto";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { DEFAULT_SETTINGS, SettingsSchema } from "../../shared/schemas/settings.schema.js";
|
|
5
|
+
import { TrackerError } from "./errors.js";
|
|
6
|
+
import { organizerUrl } from "./organizer.js";
|
|
7
|
+
/**
|
|
8
|
+
* Réglages de l'analyse par Claude, dans `<données>/settings.json`, lisible par
|
|
9
|
+
* le seul compte du serveur : ils portent le token de l'organizer et celui de
|
|
10
|
+
* Claude, que la GUI ne reçoit jamais en entier.
|
|
11
|
+
*/
|
|
12
|
+
/** Durée de validité d'un token créé par `claude setup-token`. */
|
|
13
|
+
const CLAUDE_TOKEN_VALIDITY_MS = 365 * 24 * 3600_000;
|
|
14
|
+
function settingsPath(dataDir) {
|
|
15
|
+
return path.join(dataDir, "settings.json");
|
|
16
|
+
}
|
|
17
|
+
export function readSettings(dataDir) {
|
|
18
|
+
const file = settingsPath(dataDir);
|
|
19
|
+
let raw;
|
|
20
|
+
try {
|
|
21
|
+
raw = fs.readFileSync(file, "utf-8");
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
if (err.code === "ENOENT")
|
|
25
|
+
return DEFAULT_SETTINGS;
|
|
26
|
+
throw err;
|
|
27
|
+
}
|
|
28
|
+
const parsed = SettingsSchema.safeParse(JSON.parse(raw));
|
|
29
|
+
if (!parsed.success)
|
|
30
|
+
throw new TrackerError(`${file} is invalid: ${parsed.error.message}`);
|
|
31
|
+
return parsed.data;
|
|
32
|
+
}
|
|
33
|
+
function writeSettings(dataDir, settings) {
|
|
34
|
+
const file = settingsPath(dataDir);
|
|
35
|
+
const tmp = `${file}.${process.pid}.${crypto.randomBytes(4).toString("hex")}.tmp`;
|
|
36
|
+
try {
|
|
37
|
+
fs.writeFileSync(tmp, JSON.stringify(SettingsSchema.parse(settings), null, 2), { encoding: "utf-8", mode: 0o600 });
|
|
38
|
+
fs.renameSync(tmp, file);
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
fs.rmSync(tmp, { force: true });
|
|
42
|
+
throw err;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/** Connexion à l'organizer, null tant que l'adresse ou le token manque. */
|
|
46
|
+
export function organizerConnection(settings) {
|
|
47
|
+
const { url, token } = settings.organizer;
|
|
48
|
+
return url && token ? { url, token } : null;
|
|
49
|
+
}
|
|
50
|
+
/** Vrai quand l'organizer (connexion testée) et Claude sont configurés. */
|
|
51
|
+
export function analysisReady(settings) {
|
|
52
|
+
return organizerConnection(settings) !== null && settings.organizer.space !== null && settings.claude.token !== null;
|
|
53
|
+
}
|
|
54
|
+
function tokenHint(token) {
|
|
55
|
+
return token === null ? null : token.slice(-4);
|
|
56
|
+
}
|
|
57
|
+
export function settingsView(settings) {
|
|
58
|
+
const { savedAt } = settings.claude;
|
|
59
|
+
return {
|
|
60
|
+
organizer: { url: settings.organizer.url, tokenHint: tokenHint(settings.organizer.token), space: settings.organizer.space, owner: settings.organizer.owner },
|
|
61
|
+
claude: {
|
|
62
|
+
tokenHint: tokenHint(settings.claude.token),
|
|
63
|
+
savedAt,
|
|
64
|
+
expiresAt: savedAt === null ? null : new Date(Date.parse(savedAt) + CLAUDE_TOKEN_VALIDITY_MS).toISOString(),
|
|
65
|
+
},
|
|
66
|
+
analysis: settings.analysis,
|
|
67
|
+
ready: analysisReady(settings),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/** Espace et propriétaire relevés par un test de la connexion, ou rien sans connexion. */
|
|
71
|
+
async function checkedOrganizer(organizer, checks) {
|
|
72
|
+
if (!organizer.url || !organizer.token)
|
|
73
|
+
return { ...organizer, space: null, owner: null };
|
|
74
|
+
const found = await checks.organizer({ url: organizer.url, token: organizer.token });
|
|
75
|
+
return { ...organizer, space: found.space.name, owner: found.owner.name };
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Enregistre les réglages de la GUI. Une connexion à l'organizer modifiée est
|
|
79
|
+
* testée, un nouveau token Claude vérifié : un échec refuse tout
|
|
80
|
+
* l'enregistrement. L'analyse automatique exige l'organizer et Claude.
|
|
81
|
+
*/
|
|
82
|
+
export async function saveSettings(dataDir, body, checks) {
|
|
83
|
+
const current = readSettings(dataDir);
|
|
84
|
+
const url = body.organizerUrl === "" ? null : organizerUrl(body.organizerUrl);
|
|
85
|
+
const token = body.organizerToken ?? current.organizer.token;
|
|
86
|
+
const organizerChanged = url !== current.organizer.url || token !== current.organizer.token;
|
|
87
|
+
const organizer = organizerChanged ? await checkedOrganizer({ ...current.organizer, url, token }, checks) : current.organizer;
|
|
88
|
+
let claude = current.claude;
|
|
89
|
+
if (body.claudeToken !== undefined) {
|
|
90
|
+
await checks.claudeToken(body.claudeToken);
|
|
91
|
+
claude = { token: body.claudeToken, savedAt: new Date().toISOString() };
|
|
92
|
+
}
|
|
93
|
+
const next = { organizer, claude, analysis: body.analysis };
|
|
94
|
+
if (next.analysis.auto && !analysisReady(next)) {
|
|
95
|
+
throw new TrackerError("The automatic analysis needs the organizer connection and the Claude token.");
|
|
96
|
+
}
|
|
97
|
+
writeSettings(dataDir, next);
|
|
98
|
+
return settingsView(next);
|
|
99
|
+
}
|
|
100
|
+
/** Teste la connexion enregistrée à l'organizer et relève son espace et son propriétaire. */
|
|
101
|
+
export async function testOrganizer(dataDir, checks) {
|
|
102
|
+
const current = readSettings(dataDir);
|
|
103
|
+
if (!organizerConnection(current))
|
|
104
|
+
throw new TrackerError("Set the organizer address and token first.");
|
|
105
|
+
const next = { ...current, organizer: await checkedOrganizer(current.organizer, checks) };
|
|
106
|
+
writeSettings(dataDir, next);
|
|
107
|
+
return settingsView(next);
|
|
108
|
+
}
|
package/dist/src/core/store.d.ts
CHANGED
|
@@ -40,6 +40,8 @@ export declare class Store {
|
|
|
40
40
|
deleteCategory(categoryId: string): void;
|
|
41
41
|
private operationPath;
|
|
42
42
|
private readOperationFile;
|
|
43
|
+
/** Opérations de tous les dépôts, de la plus récente à la plus ancienne. */
|
|
44
|
+
listAllOperations(): Operation[];
|
|
43
45
|
private readAllOperations;
|
|
44
46
|
private readOperationsOf;
|
|
45
47
|
getOperation(id: string): Operation;
|
package/dist/src/core/store.js
CHANGED
|
@@ -42,8 +42,8 @@ export function processAlive(pid) {
|
|
|
42
42
|
* corrigée à la main n'en a aucune, un dépôt sans pull request en attente n'en
|
|
43
43
|
* a aucune jusqu'à sa lecture suivante, un dépôt sans date de dépréciation
|
|
44
44
|
* n'est pas déprécié. Une alerte sans date
|
|
45
|
-
* d'émission prend celle de la lecture qui l'a rapportée
|
|
46
|
-
* la remplace par
|
|
45
|
+
* d'émission prend celle de la lecture qui l'a rapportée, une alerte sans
|
|
46
|
+
* portée n'en a aucune ; la lecture suivante les remplace par les vraies.
|
|
47
47
|
*/
|
|
48
48
|
function normalizeReposFile(file) {
|
|
49
49
|
if (!Array.isArray(file?.repos))
|
|
@@ -59,7 +59,7 @@ function normalizeReposFile(file) {
|
|
|
59
59
|
pullRequests: repo?.pullRequests ?? [],
|
|
60
60
|
deprecatedAt: repo?.deprecatedAt ?? null,
|
|
61
61
|
alerts: Array.isArray(repo?.alerts)
|
|
62
|
-
? repo.alerts.map((alert) => ({ ...alert, createdAt: alert?.createdAt ?? repo.syncedAt ?? repo.addedAt }))
|
|
62
|
+
? repo.alerts.map((alert) => ({ ...alert, createdAt: alert?.createdAt ?? repo.syncedAt ?? repo.addedAt, scope: alert?.scope ?? null }))
|
|
63
63
|
: repo?.alerts,
|
|
64
64
|
})),
|
|
65
65
|
};
|
|
@@ -67,12 +67,22 @@ function normalizeReposFile(file) {
|
|
|
67
67
|
/**
|
|
68
68
|
* Complète une opération écrite par une version antérieure : sans `found`, les
|
|
69
69
|
* vulnérabilités du premier audit sont `remaining` tant qu'aucune correction
|
|
70
|
-
* n'a suivi, et inconnues sinon
|
|
70
|
+
* n'a suivi, et inconnues sinon ; sans étape d'analyse ou de corrections par
|
|
71
|
+
* Claude, l'étape est passée ; sans périmètre, l'audit a couvert toutes les
|
|
72
|
+
* dépendances.
|
|
71
73
|
*/
|
|
72
74
|
function normalizeOperation(operation) {
|
|
73
|
-
if (operation === null || typeof operation !== "object"
|
|
75
|
+
if (operation === null || typeof operation !== "object")
|
|
74
76
|
return operation;
|
|
75
|
-
return {
|
|
77
|
+
return {
|
|
78
|
+
...operation,
|
|
79
|
+
found: operation.found ?? (operation.counts?.afterFix === null ? operation.remaining : []),
|
|
80
|
+
steps: operation.steps && typeof operation.steps === "object" ? { analysis: "skipped", repair: "skipped", ...operation.steps } : operation.steps,
|
|
81
|
+
counts: operation.counts && typeof operation.counts === "object" ? { afterRepair: null, ...operation.counts } : operation.counts,
|
|
82
|
+
analysis: operation.analysis ?? null,
|
|
83
|
+
repair: operation.repair ?? null,
|
|
84
|
+
scope: operation.scope ?? "all",
|
|
85
|
+
};
|
|
76
86
|
}
|
|
77
87
|
function sameName(a, b) {
|
|
78
88
|
return a.trim().toLowerCase() === b.trim().toLowerCase();
|
|
@@ -290,6 +300,10 @@ export class Store {
|
|
|
290
300
|
throw new TrackerError(`${file} is invalid: ${parsed.error.message}`);
|
|
291
301
|
return parsed.data;
|
|
292
302
|
}
|
|
303
|
+
/** Opérations de tous les dépôts, de la plus récente à la plus ancienne. */
|
|
304
|
+
listAllOperations() {
|
|
305
|
+
return this.readAllOperations();
|
|
306
|
+
}
|
|
293
307
|
readAllOperations() {
|
|
294
308
|
const operations = [];
|
|
295
309
|
for (const entry of fs.readdirSync(this.operationsDir)) {
|