revdeck 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -1
- package/README.md +47 -16
- package/README.ru.md +49 -20
- package/SECURITY.md +1 -1
- package/dist/cli.js +417 -247
- package/dist/cli.js.map +4 -4
- package/dist/daemon.js +420 -121
- package/dist/daemon.js.map +4 -4
- package/dist/mcp.js +54 -26
- package/dist/mcp.js.map +4 -4
- package/dist/ui/assets/index-BIVPy49b.css +1 -0
- package/dist/ui/assets/index-BcvEWwhI.js +18 -0
- package/dist/ui/favicon.svg +8 -3
- package/dist/ui/icon-128.png +0 -0
- package/dist/ui/icon-32.png +0 -0
- package/dist/ui/index.html +4 -2
- package/docs/README.md +3 -0
- package/docs/architecture.md +10 -6
- package/docs/assets/brand/README.md +49 -0
- package/docs/assets/brand/icon-1024.png +0 -0
- package/docs/assets/brand/icon-128.png +0 -0
- package/docs/assets/brand/icon-256.png +0 -0
- package/docs/assets/brand/icon-32.png +0 -0
- package/docs/assets/brand/icon-512.png +0 -0
- package/docs/assets/brand/icon-64.png +0 -0
- package/docs/assets/brand/icon.svg +9 -0
- package/docs/assets/brand/logo-dark.png +0 -0
- package/docs/assets/brand/logo-dark.svg +13 -0
- package/docs/assets/brand/logo.png +0 -0
- package/docs/assets/brand/logo.svg +13 -0
- package/docs/capabilities.md +21 -10
- package/docs/configuration.md +24 -8
- package/docs/integrations.md +17 -14
- package/docs/protocol.md +34 -13
- package/docs/ru/README.md +3 -0
- package/docs/ru/architecture.md +10 -6
- package/docs/ru/capabilities.md +22 -9
- package/docs/ru/configuration.md +20 -6
- package/docs/ru/integrations.md +16 -14
- package/docs/ru/protocol.md +33 -12
- package/docs/ru/threat-model.md +6 -5
- package/docs/threat-model.md +10 -8
- package/package.json +1 -1
- package/skills/revdeck/en/Feedback.md +3 -2
- package/skills/revdeck/en/Review.md +3 -2
- package/skills/revdeck/ru/Feedback.md +3 -2
- package/skills/revdeck/ru/Review.md +2 -2
- package/dist/ui/assets/index-BH0dNFhd.css +0 -1
- package/dist/ui/assets/index-Wz1DYbiv.js +0 -14
package/dist/mcp.js
CHANGED
|
@@ -89,18 +89,11 @@ var init_errors = __esm({
|
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
// src/core/types.ts
|
|
93
|
-
var init_types = __esm({
|
|
94
|
-
"src/core/types.ts"() {
|
|
95
|
-
"use strict";
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
92
|
// src/core/exec.ts
|
|
100
93
|
import { execFile } from "node:child_process";
|
|
101
94
|
import { access, constants as constants2 } from "node:fs/promises";
|
|
102
95
|
import os2 from "node:os";
|
|
103
|
-
import
|
|
96
|
+
import path3 from "node:path";
|
|
104
97
|
function scrubEnv(extra) {
|
|
105
98
|
const env = {};
|
|
106
99
|
for (const [key, value] of Object.entries(process.env)) {
|
|
@@ -130,11 +123,11 @@ async function resolveExecutable(command) {
|
|
|
130
123
|
const cached = RESOLVED.get(command);
|
|
131
124
|
if (cached) return cached;
|
|
132
125
|
const dirs = [
|
|
133
|
-
...(process.env.PATH ?? "").split(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
126
|
+
...(process.env.PATH ?? "").split(path3.delimiter),
|
|
127
|
+
path3.join(os2.homedir(), ".local", "bin"),
|
|
128
|
+
path3.join(os2.homedir(), ".local", "share", "mise", "shims"),
|
|
129
|
+
path3.join(os2.homedir(), ".asdf", "shims"),
|
|
130
|
+
path3.join(os2.homedir(), ".npm-global", "bin"),
|
|
138
131
|
"/opt/homebrew/bin",
|
|
139
132
|
"/usr/local/bin",
|
|
140
133
|
"/usr/bin",
|
|
@@ -143,7 +136,7 @@ async function resolveExecutable(command) {
|
|
|
143
136
|
const extensions = process.platform === "win32" ? (process.env.PATHEXT ?? ".EXE;.CMD;.BAT").split(";") : [""];
|
|
144
137
|
for (const dir of [...new Set(dirs)]) {
|
|
145
138
|
for (const extension of extensions) {
|
|
146
|
-
const candidate =
|
|
139
|
+
const candidate = path3.join(dir, `${command}${extension}`);
|
|
147
140
|
try {
|
|
148
141
|
await access(candidate, constants2.X_OK);
|
|
149
142
|
RESOLVED.set(command, candidate);
|
|
@@ -205,6 +198,13 @@ var init_exec = __esm({
|
|
|
205
198
|
}
|
|
206
199
|
});
|
|
207
200
|
|
|
201
|
+
// src/core/types.ts
|
|
202
|
+
var init_types = __esm({
|
|
203
|
+
"src/core/types.ts"() {
|
|
204
|
+
"use strict";
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
|
|
208
208
|
// src/mcp/main.ts
|
|
209
209
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
210
210
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
@@ -220,7 +220,7 @@ import { fileURLToPath } from "node:url";
|
|
|
220
220
|
|
|
221
221
|
// src/core/paths.ts
|
|
222
222
|
import { constants, existsSync } from "node:fs";
|
|
223
|
-
import { lstat, mkdir, open, realpath, rename, unlink } from "node:fs/promises";
|
|
223
|
+
import { lstat, mkdir, open, realpath, rename, stat, unlink } from "node:fs/promises";
|
|
224
224
|
import path from "node:path";
|
|
225
225
|
import os from "node:os";
|
|
226
226
|
function findRepoRoot(start = process.cwd()) {
|
|
@@ -279,7 +279,7 @@ async function readTextNoFollow(file, maxBytes = 4 * 1024 * 1024) {
|
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
// src/version.ts
|
|
282
|
-
var VERSION = "0.
|
|
282
|
+
var VERSION = "0.7.0";
|
|
283
283
|
|
|
284
284
|
// src/client.ts
|
|
285
285
|
var RpcError = class extends Error {
|
|
@@ -405,16 +405,17 @@ function devcontainerHint() {
|
|
|
405
405
|
return [
|
|
406
406
|
"\u0434\u0435\u043C\u043E\u043D revdeck \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D \u043D\u0430 \u0445\u043E\u0441\u0442\u0435",
|
|
407
407
|
"\u043D\u0430 \u0445\u043E\u0441\u0442\u0435: revdeck daemon start",
|
|
408
|
-
`\u043F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435
|
|
408
|
+
`\u043F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 mount \u0441\u043E\u043A\u0435\u0442\u0430 \u0438\u0437 revdeck devcontainer --write: ${runtime} (state: ${state})`,
|
|
409
|
+
"UI-\u0442\u043E\u043A\u0435\u043D \u0432 \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440 \u043D\u0435 \u043F\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044F; \u043C\u043E\u0441\u0442 \u0434\u0430\u0451\u0442 \u0442\u043E\u043B\u044C\u043A\u043E \u0430\u0433\u0435\u043D\u0442\u0441\u043A\u0438\u0435 \u043C\u0435\u0442\u043E\u0434\u044B",
|
|
409
410
|
"gh/glab \u0434\u043E\u043B\u0436\u043D\u044B \u043E\u0441\u0442\u0430\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 \u0445\u043E\u0441\u0442\u0435: \u0432\u043D\u0443\u0442\u0440\u0438 \u043A\u043E\u043D\u0442\u0435\u0439\u043D\u0435\u0440\u0430 \u0438\u0445 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0442\u044C \u043D\u0435 \u043D\u0443\u0436\u043D\u043E"
|
|
410
411
|
].join("; ");
|
|
411
412
|
}
|
|
412
413
|
async function devcontainerHttpClient() {
|
|
413
414
|
const { info, error } = await daemonInfoRead();
|
|
414
415
|
if (!info) return { client: null, error: `${daemonInfoPath()}: ${error}` };
|
|
415
|
-
if (!info.port || !info.
|
|
416
|
+
if (!info.port || !info.agentToken) return { client: null, error: `${daemonInfoPath()}: \u043D\u0435\u0442 port/agentToken` };
|
|
416
417
|
const host = process.env.REVDECK_UI_HOST ?? "host.docker.internal";
|
|
417
|
-
return { client: new HttpClient(`http://${host}:${info.port}`, info.
|
|
418
|
+
return { client: new HttpClient(`http://${host}:${info.port}`, info.agentToken), error: "" };
|
|
418
419
|
}
|
|
419
420
|
async function ensureDaemon(options = {}) {
|
|
420
421
|
const url = process.env.REVDECK_URL;
|
|
@@ -436,11 +437,11 @@ async function ensureDaemon(options = {}) {
|
|
|
436
437
|
throw new RpcError(
|
|
437
438
|
`devcontainer HTTP: ${httpError.message}`,
|
|
438
439
|
"DEVCONTAINER",
|
|
439
|
-
"\u043F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435, \u0447\u0442\u043E \u0434\u0435\u043C\u043E\u043D \u043D\u0430 \u0445\u043E\u0441\u0442\u0435 \u0437\u0430\u043F\u0443\u0449\u0435\u043D; \
|
|
440
|
+
"\u043F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435, \u0447\u0442\u043E \u0434\u0435\u043C\u043E\u043D \u043D\u0430 \u0445\u043E\u0441\u0442\u0435 \u0437\u0430\u043F\u0443\u0449\u0435\u043D; \u0434\u043B\u044F HTTP-\u043F\u0440\u043E\u0431\u0440\u043E\u0441\u0430 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 REVDECK_URL + REVDECK_TOKEN"
|
|
440
441
|
);
|
|
441
442
|
}
|
|
442
443
|
}
|
|
443
|
-
throw new RpcError(`devcontainer: ${http.error || devcontainerHint()}`, "DEVCONTAINER", "\u043F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \
|
|
444
|
+
throw new RpcError(`devcontainer: ${http.error || devcontainerHint()}`, "DEVCONTAINER", "\u043F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 mount \u0441\u043E\u043A\u0435\u0442\u0430 /run/revdeck");
|
|
444
445
|
}
|
|
445
446
|
if (options.autoStart === false) throw error;
|
|
446
447
|
}
|
|
@@ -844,8 +845,23 @@ import { z } from "zod";
|
|
|
844
845
|
init_errors();
|
|
845
846
|
import { parse as parseYaml } from "yaml";
|
|
846
847
|
import { existsSync as existsSync3 } from "node:fs";
|
|
847
|
-
import
|
|
848
|
+
import path4 from "node:path";
|
|
848
849
|
init_locale();
|
|
850
|
+
|
|
851
|
+
// src/core/git-files.ts
|
|
852
|
+
init_exec();
|
|
853
|
+
async function gitTrackState(root, relative) {
|
|
854
|
+
try {
|
|
855
|
+
const { stdout } = await run("git", ["-C", root, "ls-files", "--error-unmatch", "--", relative], {
|
|
856
|
+
timeoutMs: 1e4
|
|
857
|
+
});
|
|
858
|
+
return stdout.trim() ? "tracked" : "unknown";
|
|
859
|
+
} catch (error) {
|
|
860
|
+
return error.code === 1 ? "untracked" : "unknown";
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
// src/core/config.ts
|
|
849
865
|
var matchSchema = z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]);
|
|
850
866
|
var customRoleSchema = z.object({
|
|
851
867
|
title: z.string().min(1).max(120),
|
|
@@ -983,9 +999,21 @@ function mergeConfigData(base, local) {
|
|
|
983
999
|
async function loadConfig(root = findRepoRoot()) {
|
|
984
1000
|
const warnings = [];
|
|
985
1001
|
const file = findConfigFile(root);
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1002
|
+
let localFile = findLocalConfigFile(root);
|
|
1003
|
+
if (localFile && existsSync3(path4.join(root, ".git"))) {
|
|
1004
|
+
const state = await gitTrackState(root, path4.relative(root, localFile));
|
|
1005
|
+
if (state !== "untracked") {
|
|
1006
|
+
warnings.push(
|
|
1007
|
+
tr(
|
|
1008
|
+
".revdeck.local.yml \u043E\u0442\u0441\u043B\u0435\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044F git: \u0444\u0430\u0439\u043B \u0438\u0437 \u0440\u0435\u043F\u043E\u0437\u0438\u0442\u043E\u0440\u0438\u044F \u0438\u0433\u043D\u043E\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044F \u043A\u0430\u043A \u043B\u0438\u0447\u043D\u044B\u0439",
|
|
1009
|
+
".revdeck.local.yml is tracked by git: a repository file is ignored as personal overrides"
|
|
1010
|
+
)
|
|
1011
|
+
);
|
|
1012
|
+
localFile = null;
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
const baseData = file ? parseYamlData(await readTextNoFollow(file), path4.relative(root, file) || file) : {};
|
|
1016
|
+
const localData = localFile ? parseYamlData(await readTextNoFollow(localFile), path4.relative(root, localFile) || localFile) : {};
|
|
989
1017
|
if (!file && !localFile) {
|
|
990
1018
|
warnings.push(tr("\u0444\u0430\u0439\u043B .revdeck.yml \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D: \u043F\u0440\u0430\u0432\u0438\u043B\u0430 \u0432\u0437\u044F\u0442\u044B \u0438\u0437 \u0430\u0432\u0442\u043E\u043E\u0431\u043D\u0430\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0445 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432", ".revdeck.yml not found: rules come from auto-discovered documents"));
|
|
991
1019
|
}
|
|
@@ -995,7 +1023,7 @@ async function loadConfig(root = findRepoRoot()) {
|
|
|
995
1023
|
const localReadOnly = isRecord(localData) && isRecord(localData.review) && localData.review.readOnly === true;
|
|
996
1024
|
config.review.readOnly = baseReadOnly || localReadOnly;
|
|
997
1025
|
if (!config.rules.sources.length && !config.rules.map.length) {
|
|
998
|
-
const found = DISCOVERED_SOURCES.filter((item) => existsSync3(
|
|
1026
|
+
const found = DISCOVERED_SOURCES.filter((item) => existsSync3(path4.join(root, item)));
|
|
999
1027
|
config.rules.sources = found;
|
|
1000
1028
|
if (!found.length) {
|
|
1001
1029
|
warnings.push(tr("\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u044B \u0441 \u043F\u0440\u0430\u0432\u0438\u043B\u0430\u043C\u0438 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B: \u0440\u0435\u0432\u044C\u044E \u0431\u0443\u0434\u0435\u0442 \u043E\u043F\u0438\u0440\u0430\u0442\u044C\u0441\u044F \u0442\u043E\u043B\u044C\u043A\u043E \u043D\u0430 \u043A\u043E\u0434 \u0438 \u0437\u0434\u0440\u0430\u0432\u044B\u0439 \u0441\u043C\u044B\u0441\u043B", "no rule documents found: the review will rely on the code only"));
|