@maind-dev/cli 0.6.1 → 0.8.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/build/index.js +251 -22
- package/build/meta.json +1 -1
- package/package.json +15 -14
package/build/index.js
CHANGED
|
@@ -1572,9 +1572,10 @@ var IGNORE_DIRS = /* @__PURE__ */ new Set([
|
|
|
1572
1572
|
".venv",
|
|
1573
1573
|
"venv"
|
|
1574
1574
|
]);
|
|
1575
|
+
var GIT_CONFIG_PIN = ["-c", "diff.renames=true", "-c", "core.quotePath=false"];
|
|
1575
1576
|
function runGit(repoRoot2, args) {
|
|
1576
1577
|
try {
|
|
1577
|
-
return execFileSync3("git", args, {
|
|
1578
|
+
return execFileSync3("git", [...GIT_CONFIG_PIN, ...args], {
|
|
1578
1579
|
cwd: repoRoot2,
|
|
1579
1580
|
encoding: "utf8",
|
|
1580
1581
|
stdio: ["ignore", "pipe", "ignore"],
|
|
@@ -1717,6 +1718,13 @@ function hashContent(content) {
|
|
|
1717
1718
|
function headCommit(repoRoot2) {
|
|
1718
1719
|
return git2(repoRoot2, ["rev-parse", "HEAD"])?.trim() ?? null;
|
|
1719
1720
|
}
|
|
1721
|
+
function resolveCommitSha(repoRoot2, ref) {
|
|
1722
|
+
return git2(repoRoot2, ["rev-parse", "--verify", `${ref}^{commit}`])?.trim() ?? null;
|
|
1723
|
+
}
|
|
1724
|
+
function isWorktreeDirty(repoRoot2) {
|
|
1725
|
+
const status2 = git2(repoRoot2, ["status", "--porcelain", "-uall"]);
|
|
1726
|
+
return status2 !== null && status2.trim().length > 0;
|
|
1727
|
+
}
|
|
1720
1728
|
|
|
1721
1729
|
// ../../packages/code-index/build/incremental/hunks.js
|
|
1722
1730
|
var MAX_DIFF_BYTES = 16 * 1024 * 1024;
|
|
@@ -1734,7 +1742,6 @@ function changedHunks(repoRoot2, opts = {}) {
|
|
|
1734
1742
|
"--unified=0",
|
|
1735
1743
|
"--no-color",
|
|
1736
1744
|
"--no-ext-diff",
|
|
1737
|
-
"--find-renames",
|
|
1738
1745
|
"--diff-filter=d",
|
|
1739
1746
|
ref
|
|
1740
1747
|
];
|
|
@@ -1862,6 +1869,152 @@ function parseUnifiedDiff(diff, files, onDegrade) {
|
|
|
1862
1869
|
commit();
|
|
1863
1870
|
}
|
|
1864
1871
|
|
|
1872
|
+
// ../../packages/code-index/build/incremental/history.js
|
|
1873
|
+
var RECORD_MARK = "";
|
|
1874
|
+
var FIELD_MARK = "\0";
|
|
1875
|
+
var OWNERSHIP_WINDOW = 200;
|
|
1876
|
+
var MAX_HISTORY_PATHS = 50;
|
|
1877
|
+
var MAX_REGRESSION_COMMITS = 100;
|
|
1878
|
+
var LOG_FORMAT = "--format=%x1e%H%x00%an%x00%ae%x00%aI%x00%s";
|
|
1879
|
+
var HOT_FILE_RECENT_COMMITS = 10;
|
|
1880
|
+
function aggregateHistoryContext(res, now = Date.now()) {
|
|
1881
|
+
if (res.history.length === 0)
|
|
1882
|
+
return void 0;
|
|
1883
|
+
const authorEmails = /* @__PURE__ */ new Set();
|
|
1884
|
+
let hotFiles = 0;
|
|
1885
|
+
let maxRecent = 0;
|
|
1886
|
+
let newestMs = 0;
|
|
1887
|
+
for (const entry of res.history) {
|
|
1888
|
+
const inWindow = entry.ownership?.commitsInWindow ?? entry.lastCommits.length;
|
|
1889
|
+
if (inWindow >= HOT_FILE_RECENT_COMMITS)
|
|
1890
|
+
hotFiles++;
|
|
1891
|
+
if (inWindow > maxRecent)
|
|
1892
|
+
maxRecent = inWindow;
|
|
1893
|
+
for (const a of entry.ownership?.topAuthors ?? []) {
|
|
1894
|
+
authorEmails.add(a.email.toLowerCase() || a.name);
|
|
1895
|
+
}
|
|
1896
|
+
const newest = entry.lastCommits[0]?.dateIso;
|
|
1897
|
+
if (newest) {
|
|
1898
|
+
const ms = Date.parse(newest);
|
|
1899
|
+
if (Number.isFinite(ms) && ms > newestMs)
|
|
1900
|
+
newestMs = ms;
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
return {
|
|
1904
|
+
window_commits: res.ownershipWindowCommits,
|
|
1905
|
+
files_scanned: res.history.length,
|
|
1906
|
+
hot_files: hotFiles,
|
|
1907
|
+
max_recent_commits: maxRecent,
|
|
1908
|
+
distinct_authors: authorEmails.size,
|
|
1909
|
+
newest_change_age_days: newestMs > 0 ? Math.max(0, Math.floor((now - newestMs) / 864e5)) : 0
|
|
1910
|
+
};
|
|
1911
|
+
}
|
|
1912
|
+
function clamp(v, def, cap) {
|
|
1913
|
+
if (v === void 0 || !Number.isFinite(v) || v <= 0)
|
|
1914
|
+
return def;
|
|
1915
|
+
return Math.min(Math.floor(v), cap);
|
|
1916
|
+
}
|
|
1917
|
+
function splitRecords(raw) {
|
|
1918
|
+
return raw.split(RECORD_MARK).filter((r) => r.trim().length > 0);
|
|
1919
|
+
}
|
|
1920
|
+
function parseHistoryRecord(record) {
|
|
1921
|
+
const [sha, authorName, authorEmail, dateIso, subject] = record.replace(/\n+$/, "").split(FIELD_MARK);
|
|
1922
|
+
if (!sha || !dateIso)
|
|
1923
|
+
return null;
|
|
1924
|
+
return {
|
|
1925
|
+
sha,
|
|
1926
|
+
authorName: authorName ?? "",
|
|
1927
|
+
authorEmail: authorEmail ?? "",
|
|
1928
|
+
dateIso,
|
|
1929
|
+
subject: subject ?? ""
|
|
1930
|
+
};
|
|
1931
|
+
}
|
|
1932
|
+
function aggregateOwnership(commits) {
|
|
1933
|
+
const byEmail = /* @__PURE__ */ new Map();
|
|
1934
|
+
for (const c of commits) {
|
|
1935
|
+
const key = c.authorEmail.toLowerCase() || c.authorName;
|
|
1936
|
+
const entry = byEmail.get(key);
|
|
1937
|
+
if (entry)
|
|
1938
|
+
entry.commits += 1;
|
|
1939
|
+
else
|
|
1940
|
+
byEmail.set(key, {
|
|
1941
|
+
name: c.authorName,
|
|
1942
|
+
email: c.authorEmail,
|
|
1943
|
+
commits: 1,
|
|
1944
|
+
lastDateIso: c.dateIso
|
|
1945
|
+
});
|
|
1946
|
+
}
|
|
1947
|
+
return [...byEmail.values()].sort((a, b) => b.commits - a.commits || a.email.localeCompare(b.email)).slice(0, 10);
|
|
1948
|
+
}
|
|
1949
|
+
function readFileHistory(repoRoot2, paths, opts = {}) {
|
|
1950
|
+
const limit = clamp(opts.limit, 20, 100);
|
|
1951
|
+
const includeOwnership = opts.includeOwnership !== false;
|
|
1952
|
+
const window = Math.max(limit, OWNERSHIP_WINDOW);
|
|
1953
|
+
const cleanPaths = paths.map((p) => p.trim()).filter((p) => p.length > 0 && !p.startsWith(":"));
|
|
1954
|
+
const scoped = cleanPaths.slice(0, MAX_HISTORY_PATHS);
|
|
1955
|
+
const history = [];
|
|
1956
|
+
for (const path of scoped) {
|
|
1957
|
+
const raw = runGit(repoRoot2, [
|
|
1958
|
+
"log",
|
|
1959
|
+
"-n",
|
|
1960
|
+
String(window),
|
|
1961
|
+
LOG_FORMAT,
|
|
1962
|
+
"--",
|
|
1963
|
+
path
|
|
1964
|
+
]);
|
|
1965
|
+
const commits = raw === null ? [] : splitRecords(raw).map(parseHistoryRecord).filter((c) => c !== null);
|
|
1966
|
+
history.push({
|
|
1967
|
+
path,
|
|
1968
|
+
lastCommits: commits.slice(0, limit),
|
|
1969
|
+
ownership: includeOwnership ? { topAuthors: aggregateOwnership(commits), commitsInWindow: commits.length } : null
|
|
1970
|
+
});
|
|
1971
|
+
}
|
|
1972
|
+
let regression = null;
|
|
1973
|
+
if (opts.since) {
|
|
1974
|
+
const sinceResolved = resolveCommitSha(repoRoot2, opts.since);
|
|
1975
|
+
const rangeArgs = sinceResolved !== null ? [`${sinceResolved}..HEAD`] : [`--since=${opts.since}`];
|
|
1976
|
+
const raw = runGit(repoRoot2, [
|
|
1977
|
+
"log",
|
|
1978
|
+
...rangeArgs,
|
|
1979
|
+
"-n",
|
|
1980
|
+
String(MAX_REGRESSION_COMMITS + 1),
|
|
1981
|
+
LOG_FORMAT,
|
|
1982
|
+
"--name-only",
|
|
1983
|
+
"--",
|
|
1984
|
+
...scoped
|
|
1985
|
+
]);
|
|
1986
|
+
const commits = [];
|
|
1987
|
+
if (raw !== null) {
|
|
1988
|
+
for (const record of splitRecords(raw)) {
|
|
1989
|
+
const lines = record.split("\n");
|
|
1990
|
+
const head = parseHistoryRecord(lines[0] ?? "");
|
|
1991
|
+
if (!head)
|
|
1992
|
+
continue;
|
|
1993
|
+
const filesTouched = lines.slice(1).filter((l) => l.trim().length > 0).length;
|
|
1994
|
+
commits.push({
|
|
1995
|
+
sha: head.sha,
|
|
1996
|
+
dateIso: head.dateIso,
|
|
1997
|
+
authorName: head.authorName,
|
|
1998
|
+
subject: head.subject,
|
|
1999
|
+
filesTouched
|
|
2000
|
+
});
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
regression = {
|
|
2004
|
+
sinceInput: opts.since,
|
|
2005
|
+
sinceResolved,
|
|
2006
|
+
commits: commits.slice(0, MAX_REGRESSION_COMMITS),
|
|
2007
|
+
truncated: commits.length > MAX_REGRESSION_COMMITS
|
|
2008
|
+
};
|
|
2009
|
+
}
|
|
2010
|
+
return {
|
|
2011
|
+
history,
|
|
2012
|
+
regression,
|
|
2013
|
+
ownershipWindowCommits: window,
|
|
2014
|
+
pathsTruncated: cleanPaths.length > MAX_HISTORY_PATHS
|
|
2015
|
+
};
|
|
2016
|
+
}
|
|
2017
|
+
|
|
1865
2018
|
// ../../packages/code-index/build/review/risk-rules.js
|
|
1866
2019
|
var RISK_RULES = [
|
|
1867
2020
|
{
|
|
@@ -2305,6 +2458,19 @@ var CodeIndexEngine = class {
|
|
|
2305
2458
|
truncated: symbols.length > limit
|
|
2306
2459
|
};
|
|
2307
2460
|
}
|
|
2461
|
+
async fileHistory(opts = {}) {
|
|
2462
|
+
let paths = opts.paths ?? [];
|
|
2463
|
+
if (paths.length === 0) {
|
|
2464
|
+
const changed = enumerateChangedPaths(this.repoRoot, {});
|
|
2465
|
+
if (changed === null) {
|
|
2466
|
+
throw new Error("fileHistory requires a git repository (history is git-based)");
|
|
2467
|
+
}
|
|
2468
|
+
paths = [...changed.keys()];
|
|
2469
|
+
} else if (headCommit(this.repoRoot) === null) {
|
|
2470
|
+
throw new Error("fileHistory requires a git repository (history is git-based)");
|
|
2471
|
+
}
|
|
2472
|
+
return readFileHistory(this.repoRoot, paths, opts);
|
|
2473
|
+
}
|
|
2308
2474
|
async reviewChanges(opts = {}) {
|
|
2309
2475
|
await this.store.init();
|
|
2310
2476
|
const rawPaths = enumerateChangedPaths(this.repoRoot, opts);
|
|
@@ -2352,7 +2518,10 @@ var CodeIndexEngine = class {
|
|
|
2352
2518
|
truncated: symbols.length > limit,
|
|
2353
2519
|
riskFlags,
|
|
2354
2520
|
hunkCoverage,
|
|
2355
|
-
baseKind: opts.since ? "ref" : "uncommitted"
|
|
2521
|
+
baseKind: opts.since ? "ref" : "uncommitted",
|
|
2522
|
+
headSha: headCommit(this.repoRoot),
|
|
2523
|
+
dirty: isWorktreeDirty(this.repoRoot),
|
|
2524
|
+
baseSha: opts.since ? resolveCommitSha(this.repoRoot, opts.since) : null
|
|
2356
2525
|
};
|
|
2357
2526
|
}
|
|
2358
2527
|
async close() {
|
|
@@ -3247,6 +3416,9 @@ import { execFileSync as execFileSync5 } from "node:child_process";
|
|
|
3247
3416
|
import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync4 } from "node:fs";
|
|
3248
3417
|
import { dirname as dirname4 } from "node:path";
|
|
3249
3418
|
|
|
3419
|
+
// ../../packages/code-index/build/index.js
|
|
3420
|
+
var CODE_INDEX_VERSION = "0.1.0";
|
|
3421
|
+
|
|
3250
3422
|
// src/review-render.ts
|
|
3251
3423
|
var COMMENT_MARKER = "<!-- maind-review -->";
|
|
3252
3424
|
var COMMENT_FINDINGS_CAP = 30;
|
|
@@ -3284,7 +3456,10 @@ function buildReviewManifest(data, verdict, meta) {
|
|
|
3284
3456
|
},
|
|
3285
3457
|
fail_on: meta.failOn
|
|
3286
3458
|
} : null,
|
|
3287
|
-
|
|
3459
|
+
run: verdict?.ok === true ? verdict.run ?? null : null,
|
|
3460
|
+
...verdict?.ok === true && verdict.run_note ? { run_note: verdict.run_note } : {},
|
|
3461
|
+
coverage_note: review?.coverage_note ?? null,
|
|
3462
|
+
regression_context: review?.regression_context ?? null
|
|
3288
3463
|
};
|
|
3289
3464
|
}
|
|
3290
3465
|
function severityBadge(f) {
|
|
@@ -3308,6 +3483,15 @@ function verdictLabel(verdict) {
|
|
|
3308
3483
|
const counts = verdict.counts ?? {};
|
|
3309
3484
|
return `**Verdict: ${(verdict.verdict ?? "?").toUpperCase()}** (block: ${counts.block ?? 0} \xB7 warn: ${counts.warn ?? 0} \xB7 note: ${counts.note ?? 0})`;
|
|
3310
3485
|
}
|
|
3486
|
+
function attestationLine(verdict) {
|
|
3487
|
+
const r = verdict.run;
|
|
3488
|
+
if (r) {
|
|
3489
|
+
const grade = r.attestation_grade ? "attestation-grade" : "recorded, not attestation-grade";
|
|
3490
|
+
return `Attestation: run \`${r.id.slice(0, 8)}\` (${grade}) \xB7 commit \`${r.commit_sha.slice(0, 12)}\` \xB7 input \`${r.input_hash.slice(0, 12)}\` \xB7 policy \`${r.policy_hash.slice(0, 12)}\``;
|
|
3491
|
+
}
|
|
3492
|
+
if (verdict.run_note) return `Attestation: none \u2014 ${verdict.run_note}`;
|
|
3493
|
+
return null;
|
|
3494
|
+
}
|
|
3311
3495
|
function baseLabel(meta) {
|
|
3312
3496
|
return meta.base ? `against \`${meta.base}\`` : "uncommitted work";
|
|
3313
3497
|
}
|
|
@@ -3330,6 +3514,11 @@ function renderReviewMarkdown(data, verdict, meta) {
|
|
|
3330
3514
|
lines.push("");
|
|
3331
3515
|
if (verdict?.ok === true && verdict.verdict) {
|
|
3332
3516
|
lines.push(verdictLabel(verdict));
|
|
3517
|
+
const attest = attestationLine(verdict);
|
|
3518
|
+
if (attest) {
|
|
3519
|
+
lines.push("");
|
|
3520
|
+
lines.push(attest);
|
|
3521
|
+
}
|
|
3333
3522
|
if (verdict.trust_note) {
|
|
3334
3523
|
lines.push("");
|
|
3335
3524
|
lines.push(`_${verdict.trust_note}_`);
|
|
@@ -3370,6 +3559,13 @@ function renderReviewMarkdown(data, verdict, meta) {
|
|
|
3370
3559
|
}
|
|
3371
3560
|
lines.push("");
|
|
3372
3561
|
}
|
|
3562
|
+
const rc = review?.regression_context;
|
|
3563
|
+
if (rc && (rc.hot_files ?? 0) > 0) {
|
|
3564
|
+
lines.push("");
|
|
3565
|
+
lines.push(
|
|
3566
|
+
`_History: ${rc.hot_files}/${rc.files_scanned ?? "?"} changed file(s) high-churn (max ${rc.max_recent_commits ?? "?"} commits in the last ${rc.window_commits ?? "?"}-commit window, ${rc.distinct_authors ?? "?"} author(s))._`
|
|
3567
|
+
);
|
|
3568
|
+
}
|
|
3373
3569
|
if (review?.coverage_note) {
|
|
3374
3570
|
lines.push("## Coverage");
|
|
3375
3571
|
lines.push("");
|
|
@@ -3392,6 +3588,8 @@ function renderReviewComment(data, verdict, meta, reportPath) {
|
|
|
3392
3588
|
lines.push("");
|
|
3393
3589
|
if (verdict?.ok === true && verdict.verdict) {
|
|
3394
3590
|
lines.push(verdictLabel(verdict));
|
|
3591
|
+
const attest = attestationLine(verdict);
|
|
3592
|
+
if (attest) lines.push(attest);
|
|
3395
3593
|
lines.push("");
|
|
3396
3594
|
}
|
|
3397
3595
|
if (findings.length === 0) {
|
|
@@ -3457,7 +3655,7 @@ function renderFailOpenComment(meta, reason) {
|
|
|
3457
3655
|
|
|
3458
3656
|
// src/review.ts
|
|
3459
3657
|
var PROJECT_KEY_RE3 = /^[a-f0-9]{64}$/;
|
|
3460
|
-
var CLI_CLIENT_VERSION = "0.
|
|
3658
|
+
var CLI_CLIENT_VERSION = "0.7.0";
|
|
3461
3659
|
var DEFAULT_COMMENT_PATH = ".maind/review-comment.md";
|
|
3462
3660
|
var SYMBOL_CAP = 64;
|
|
3463
3661
|
function parseReviewArgs(argv) {
|
|
@@ -3506,6 +3704,21 @@ function manifestPathFor(out) {
|
|
|
3506
3704
|
function verdictCrossesFailOn(verdict, failOn) {
|
|
3507
3705
|
return failOn === "block" ? verdict === "block" : verdict === "block" || verdict === "warn";
|
|
3508
3706
|
}
|
|
3707
|
+
function buildDiffStats(result) {
|
|
3708
|
+
return {
|
|
3709
|
+
changed_file_count: result.changedFiles,
|
|
3710
|
+
unindexed_file_count: result.changedFiles - result.indexedFiles,
|
|
3711
|
+
stale_file_count: result.staleFiles,
|
|
3712
|
+
truncated: result.truncated,
|
|
3713
|
+
hunk_coverage: result.hunkCoverage,
|
|
3714
|
+
base_kind: result.baseKind,
|
|
3715
|
+
// Attest-Anker (ADR-230 §3): Commit-Objekt-Hashes + dirty — kein Source.
|
|
3716
|
+
...result.headSha ? { head_sha: result.headSha } : {},
|
|
3717
|
+
dirty: result.dirty,
|
|
3718
|
+
...result.baseSha ? { base_sha: result.baseSha } : {},
|
|
3719
|
+
code_index_version: CODE_INDEX_VERSION
|
|
3720
|
+
};
|
|
3721
|
+
}
|
|
3509
3722
|
function resolveRepoRoot() {
|
|
3510
3723
|
try {
|
|
3511
3724
|
return execFileSync5("git", ["rev-parse", "--show-toplevel"], {
|
|
@@ -3568,30 +3781,27 @@ async function runReview(opts) {
|
|
|
3568
3781
|
} finally {
|
|
3569
3782
|
await engine.close().catch(() => void 0);
|
|
3570
3783
|
}
|
|
3571
|
-
const diffStats =
|
|
3572
|
-
changed_file_count: result.changedFiles,
|
|
3573
|
-
unindexed_file_count: result.changedFiles - result.indexedFiles,
|
|
3574
|
-
stale_file_count: result.staleFiles,
|
|
3575
|
-
truncated: result.truncated,
|
|
3576
|
-
hunk_coverage: result.hunkCoverage,
|
|
3577
|
-
base_kind: result.baseKind
|
|
3578
|
-
};
|
|
3784
|
+
const diffStats = buildDiffStats(result);
|
|
3579
3785
|
meta.diffStats = diffStats;
|
|
3580
3786
|
meta.symbolCount = result.symbols.length;
|
|
3581
3787
|
const summary = opts.summary?.trim() || void 0;
|
|
3582
|
-
if (result.symbols.length === 0 &&
|
|
3788
|
+
if (result.symbols.length === 0 && !summary) {
|
|
3789
|
+
const flags = result.riskFlags;
|
|
3583
3790
|
const empty = {
|
|
3584
3791
|
ok: true,
|
|
3585
3792
|
review: {
|
|
3586
3793
|
convention_findings: [],
|
|
3587
3794
|
lesson_hints: [],
|
|
3588
|
-
risk_flags:
|
|
3589
|
-
|
|
3795
|
+
risk_flags: flags,
|
|
3796
|
+
// changed_file_count counts INDEXABLE files; risk flags come from the
|
|
3797
|
+
// raw path list. Both can be non-zero independently — say which it is
|
|
3798
|
+
// instead of claiming "no changes" while a flag is showing.
|
|
3799
|
+
coverage_note: flags.length > 0 ? result.changedFiles === 0 ? "No indexable changed files \u2014 the risk flags below come from non-indexable paths (migrations, workflows, manifests, env files), which the symbol index never sees." : "Changed files found but no indexed symbols \u2014 no symbol-level review. The risk flags below come from the raw path list; pass --summary for an index-less review." : result.changedFiles === 0 ? "No changed files detected." : "Changed files found but no indexed symbols \u2014 nothing reviewable at symbol level."
|
|
3590
3800
|
}
|
|
3591
3801
|
};
|
|
3592
3802
|
writeAll(empty, null, meta, opts);
|
|
3593
3803
|
process.stderr.write(
|
|
3594
|
-
`maind review: no reviewable
|
|
3804
|
+
`maind review: no reviewable symbols (${result.changedFiles} changed file(s), ${flags.length} risk flag(s)) \u2192 ${opts.out}
|
|
3595
3805
|
`
|
|
3596
3806
|
);
|
|
3597
3807
|
return 0;
|
|
@@ -3607,6 +3817,14 @@ async function runReview(opts) {
|
|
|
3607
3817
|
mcpUrl: opts.mcpUrl ?? void 0,
|
|
3608
3818
|
projectKey
|
|
3609
3819
|
});
|
|
3820
|
+
let history;
|
|
3821
|
+
try {
|
|
3822
|
+
history = aggregateHistoryContext(
|
|
3823
|
+
await engine.fileHistory({ since: opts.base ?? void 0, limit: 1 })
|
|
3824
|
+
);
|
|
3825
|
+
} catch {
|
|
3826
|
+
history = void 0;
|
|
3827
|
+
}
|
|
3610
3828
|
const reviewArgs = {
|
|
3611
3829
|
changed_symbols: result.symbols.map((s) => ({
|
|
3612
3830
|
name: s.name,
|
|
@@ -3618,6 +3836,7 @@ async function runReview(opts) {
|
|
|
3618
3836
|
})),
|
|
3619
3837
|
risk_flags: result.riskFlags,
|
|
3620
3838
|
diff_stats: diffStats,
|
|
3839
|
+
...history ? { history } : {},
|
|
3621
3840
|
...summary ? { change_summary: summary } : {},
|
|
3622
3841
|
...projectKey ? { project_key: projectKey } : {}
|
|
3623
3842
|
};
|
|
@@ -3630,6 +3849,13 @@ async function runReview(opts) {
|
|
|
3630
3849
|
let verdict = null;
|
|
3631
3850
|
if (opts.gate) {
|
|
3632
3851
|
const findings = review.review.convention_findings ?? [];
|
|
3852
|
+
const attestArgs = !opts.noReport && result.headSha ? {
|
|
3853
|
+
commit_sha: result.headSha,
|
|
3854
|
+
...result.baseSha ? { base_sha: result.baseSha } : {},
|
|
3855
|
+
dirty: result.dirty,
|
|
3856
|
+
diff_stats: diffStats,
|
|
3857
|
+
code_index_version: CODE_INDEX_VERSION
|
|
3858
|
+
} : {};
|
|
3633
3859
|
try {
|
|
3634
3860
|
verdict = await client.callTool("review_verdict", {
|
|
3635
3861
|
findings: findings.map((f) => ({
|
|
@@ -3639,7 +3865,8 @@ async function runReview(opts) {
|
|
|
3639
3865
|
matched_changed_symbols: f.matched_changed_symbols ?? []
|
|
3640
3866
|
})),
|
|
3641
3867
|
risk_flags: review.review.risk_flags ?? [],
|
|
3642
|
-
...projectKey ? { project_key: projectKey } : {}
|
|
3868
|
+
...projectKey ? { project_key: projectKey } : {},
|
|
3869
|
+
...attestArgs
|
|
3643
3870
|
});
|
|
3644
3871
|
if (verdict.ok !== true) {
|
|
3645
3872
|
if (verdict.error === "requires_team" || verdict.error === "requires_enterprise") {
|
|
@@ -3667,7 +3894,8 @@ async function runReview(opts) {
|
|
|
3667
3894
|
}
|
|
3668
3895
|
writeAll(review, verdict, meta, opts);
|
|
3669
3896
|
const findingCount = review.review.convention_findings?.length ?? 0;
|
|
3670
|
-
const
|
|
3897
|
+
const runNote = verdict?.run ? ` \xB7 run: ${verdict.run.id.slice(0, 8)}${verdict.run.attestation_grade ? " (attestation-grade)" : ""}` : verdict?.run_note ? ` \xB7 run: none (${verdict.run_note})` : "";
|
|
3898
|
+
const verdictNote = verdict?.verdict ? ` \xB7 verdict: ${verdict.verdict}${runNote}` : "";
|
|
3671
3899
|
process.stderr.write(
|
|
3672
3900
|
`maind review: ${findingCount} finding(s), ${review.review.risk_flags?.length ?? 0} risk flag(s)${verdictNote} \u2192 ${opts.out}
|
|
3673
3901
|
`
|
|
@@ -3826,7 +4054,7 @@ async function push(sync, json) {
|
|
|
3826
4054
|
}
|
|
3827
4055
|
|
|
3828
4056
|
// src/index.ts
|
|
3829
|
-
var VERSION = "0.
|
|
4057
|
+
var VERSION = "0.7.0";
|
|
3830
4058
|
var HELP = `maind ${VERSION} \u2014 headless maind CLI for CI + git context
|
|
3831
4059
|
|
|
3832
4060
|
Usage:
|
|
@@ -3859,8 +4087,9 @@ review options (advisory by default \u2014 exits 0 unless --gate + --fail-on):
|
|
|
3859
4087
|
--gate Aggregate findings into a server-side pass|warn|block verdict (Team plan)
|
|
3860
4088
|
--fail-on block|warn With --gate: exit 1 when the verdict crosses this threshold
|
|
3861
4089
|
--strict Infra errors exit 2 instead of failing open with exit 0
|
|
3862
|
-
--no-report
|
|
3863
|
-
|
|
4090
|
+
--no-report With --gate: omit the commit anchors so the server does NOT
|
|
4091
|
+
persist a review_runs attestation record (ADR-230) \u2014 the
|
|
4092
|
+
verdict is then advisory-only, without a replayable proof
|
|
3864
4093
|
--project-key <hex> Repo project_key override (default: auto-detect from git)
|
|
3865
4094
|
--mcp-url <url> Override MCP endpoint (default $MAIND_MCP_URL or production)
|
|
3866
4095
|
|
package/build/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/auth.ts":{"bytes":3441,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/mcp-client.ts":{"bytes":8724,"imports":[],"format":"esm"},"src/render.ts":{"bytes":4525,"imports":[],"format":"esm"},"src/context.ts":{"bytes":6805,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"},{"path":"src/mcp-client.ts","kind":"import-statement","original":"./mcp-client.js"},{"path":"src/render.ts","kind":"import-statement","original":"./render.js"}],"format":"esm"},"../../packages/project-key/build/index.js":{"bytes":3446,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/git.ts":{"bytes":5748,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"../../packages/project-key/build/index.js","kind":"import-statement","original":"@maind/project-key"},{"path":"../../packages/project-key/build/index.js","kind":"import-statement","original":"@maind/project-key"}],"format":"esm"},"src/ci-report.ts":{"bytes":6631,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"},{"path":"src/git.ts","kind":"import-statement","original":"./git.js"}],"format":"esm"},"src/ci-result.ts":{"bytes":5483,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"}],"format":"esm"},"src/git-context.ts":{"bytes":9481,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"},{"path":"src/mcp-client.ts","kind":"import-statement","original":"./mcp-client.js"},{"path":"src/git.ts","kind":"import-statement","original":"./git.js"}],"format":"esm"},"../../packages/code-index/build/parse/keys.js":{"bytes":448,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/types.js":{"bytes":768,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/lang/shared.js":{"bytes":2278,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/lang/python.js":{"bytes":4535,"imports":[{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"./shared.js"}],"format":"esm"},"../../packages/code-index/build/parse/lang/typescript.js":{"bytes":5949,"imports":[{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"./shared.js"}],"format":"esm"},"../../packages/code-index/build/parse/tree-sitter/grammars.js":{"bytes":1941,"imports":[{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/parse/tree-sitter/parser.js":{"bytes":3231,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"web-tree-sitter","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"../types.js"},{"path":"../../packages/code-index/build/parse/lang/python.js","kind":"import-statement","original":"../lang/python.js"},{"path":"../../packages/code-index/build/parse/lang/typescript.js","kind":"import-statement","original":"../lang/typescript.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"../lang/shared.js"},{"path":"../../packages/code-index/build/parse/tree-sitter/grammars.js","kind":"import-statement","original":"./grammars.js"}],"format":"esm"},"../../packages/code-index/build/embed/recipe.js":{"bytes":594,"imports":[],"format":"esm"},"../../packages/code-index/build/embed/types.js":{"bytes":505,"imports":[],"format":"esm"},"../../packages/code-index/build/util/vector.js":{"bytes":707,"imports":[],"format":"esm"},"../../packages/code-index/build/graph/resolve.js":{"bytes":3928,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../parse/keys.js"}],"format":"esm"},"../../packages/code-index/build/incremental/discover.js":{"bytes":7206,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"../parse/types.js"}],"format":"esm"},"../../packages/code-index/build/incremental/hunks.js":{"bytes":5957,"imports":[{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"./discover.js"}],"format":"esm"},"../../packages/code-index/build/review/risk-rules.js":{"bytes":1958,"imports":[],"format":"esm"},"../../packages/code-index/build/review/risk-scan.js":{"bytes":1451,"imports":[{"path":"../../packages/code-index/build/review/risk-rules.js","kind":"import-statement","original":"./risk-rules.js"}],"format":"esm"},"../../packages/code-index/build/store/schema.js":{"bytes":3047,"imports":[],"format":"esm"},"../../packages/code-index/build/util/identifiers.js":{"bytes":2180,"imports":[],"format":"esm"},"../../packages/code-index/build/query/engine.js":{"bytes":18745,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/embed/recipe.js","kind":"import-statement","original":"../embed/recipe.js"},{"path":"../../packages/code-index/build/embed/types.js","kind":"import-statement","original":"../embed/types.js"},{"path":"../../packages/code-index/build/util/vector.js","kind":"import-statement","original":"../util/vector.js"},{"path":"../../packages/code-index/build/graph/resolve.js","kind":"import-statement","original":"../graph/resolve.js"},{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"../incremental/discover.js"},{"path":"../../packages/code-index/build/incremental/hunks.js","kind":"import-statement","original":"../incremental/hunks.js"},{"path":"../../packages/code-index/build/review/risk-scan.js","kind":"import-statement","original":"../review/risk-scan.js"},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"../store/schema.js"},{"path":"../../packages/code-index/build/util/identifiers.js","kind":"import-statement","original":"../util/identifiers.js"}],"format":"esm"},"../../packages/code-index/build/store/node-sqlite.js":{"bytes":11850,"imports":[{"path":"better-sqlite3","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"./schema.js"},{"path":"../../packages/code-index/build/util/identifiers.js","kind":"import-statement","original":"../util/identifiers.js"}],"format":"esm"},"../../packages/code-index/build/sync/types.js":{"bytes":1779,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/sync/client.js":{"bytes":10021,"imports":[{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"../store/schema.js"},{"path":"../../packages/code-index/build/sync/types.js","kind":"import-statement","original":"./types.js"}],"format":"esm"},"../../packages/code-index/build/node.js":{"bytes":2578,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/project-key/build/index.js","kind":"import-statement","original":"@maind/project-key"},{"path":"../../packages/code-index/build/parse/tree-sitter/parser.js","kind":"import-statement","original":"./parse/tree-sitter/parser.js"},{"path":"../../packages/code-index/build/query/engine.js","kind":"import-statement","original":"./query/engine.js"},{"path":"../../packages/code-index/build/store/node-sqlite.js","kind":"import-statement","original":"./store/node-sqlite.js"},{"path":"../../packages/code-index/build/sync/client.js","kind":"import-statement","original":"./sync/client.js"},{"path":"../../packages/code-index/build/sync/client.js","kind":"import-statement","original":"./sync/client.js"}],"format":"esm"},"../../packages/embedding/build/index.js":{"bytes":6053,"imports":[{"path":"@huggingface/transformers","kind":"dynamic-import","external":true}],"format":"esm"},"../../packages/code-index/build/embed/node.js":{"bytes":661,"imports":[{"path":"../../packages/embedding/build/index.js","kind":"import-statement","original":"@maind/embedding"},{"path":"../../packages/code-index/build/embed/recipe.js","kind":"import-statement","original":"./recipe.js"}],"format":"esm"},"../../packages/code-index/build/node-embed.js":{"bytes":660,"imports":[{"path":"../../packages/code-index/build/embed/node.js","kind":"import-statement","original":"./embed/node.js"}],"format":"esm"},"src/index-cmd.ts":{"bytes":9353,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/node.js","kind":"import-statement","original":"@maind/code-index/node"},{"path":"../../packages/code-index/build/node-embed.js","kind":"import-statement","original":"@maind/code-index/node-embed"}],"format":"esm"},"src/review-render.ts":{"bytes":12259,"imports":[],"format":"esm"},"src/review.ts":{"bytes":13775,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/node.js","kind":"import-statement","original":"@maind/code-index/node"},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"},{"path":"src/git.ts","kind":"import-statement","original":"./git.js"},{"path":"src/mcp-client.ts","kind":"import-statement","original":"./mcp-client.js"},{"path":"src/review-render.ts","kind":"import-statement","original":"./review-render.js"}],"format":"esm"},"src/sync-cmd.ts":{"bytes":5243,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/node.js","kind":"import-statement","original":"@maind/code-index/node"},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"}],"format":"esm"},"src/index.ts":{"bytes":9419,"imports":[{"path":"src/context.ts","kind":"import-statement","original":"./context.js"},{"path":"src/ci-report.ts","kind":"import-statement","original":"./ci-report.js"},{"path":"src/ci-result.ts","kind":"import-statement","original":"./ci-result.js"},{"path":"src/git-context.ts","kind":"import-statement","original":"./git-context.js"},{"path":"src/git.ts","kind":"import-statement","original":"./git.js"},{"path":"src/index-cmd.ts","kind":"import-statement","original":"./index-cmd.js"},{"path":"src/review.ts","kind":"import-statement","original":"./review.js"},{"path":"src/sync-cmd.ts","kind":"import-statement","original":"./sync-cmd.js"}],"format":"esm"}},"outputs":{"build/index.js":{"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"web-tree-sitter","kind":"import-statement","external":true},{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"better-sqlite3","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"@huggingface/transformers","kind":"dynamic-import","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true}],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/context.ts":{"bytesInOutput":4644},"src/auth.ts":{"bytesInOutput":1609},"src/mcp-client.ts":{"bytesInOutput":5955},"src/render.ts":{"bytesInOutput":2406},"src/ci-report.ts":{"bytesInOutput":4467},"src/git.ts":{"bytesInOutput":3325},"../../packages/project-key/build/index.js":{"bytesInOutput":1449},"src/ci-result.ts":{"bytesInOutput":3848},"src/git-context.ts":{"bytesInOutput":6854},"src/index-cmd.ts":{"bytesInOutput":6717},"../../packages/code-index/build/node.js":{"bytesInOutput":1159},"../../packages/code-index/build/parse/tree-sitter/parser.js":{"bytesInOutput":2043},"../../packages/code-index/build/parse/keys.js":{"bytesInOutput":169},"../../packages/code-index/build/parse/types.js":{"bytesInOutput":546},"../../packages/code-index/build/parse/lang/shared.js":{"bytesInOutput":1131},"../../packages/code-index/build/parse/lang/python.js":{"bytesInOutput":3747},"../../packages/code-index/build/parse/lang/typescript.js":{"bytesInOutput":4721},"../../packages/code-index/build/parse/tree-sitter/grammars.js":{"bytesInOutput":523},"../../packages/code-index/build/query/engine.js":{"bytesInOutput":13710},"../../packages/code-index/build/embed/recipe.js":{"bytesInOutput":229},"../../packages/code-index/build/embed/types.js":{"bytesInOutput":105},"../../packages/code-index/build/util/vector.js":{"bytesInOutput":339},"../../packages/code-index/build/graph/resolve.js":{"bytesInOutput":2486},"../../packages/code-index/build/incremental/discover.js":{"bytesInOutput":4450},"../../packages/code-index/build/incremental/hunks.js":{"bytesInOutput":3973},"../../packages/code-index/build/review/risk-rules.js":{"bytesInOutput":876},"../../packages/code-index/build/review/risk-scan.js":{"bytesInOutput":798},"../../packages/code-index/build/store/schema.js":{"bytesInOutput":2266},"../../packages/code-index/build/util/identifiers.js":{"bytesInOutput":1094},"../../packages/code-index/build/store/node-sqlite.js":{"bytesInOutput":9751},"../../packages/code-index/build/sync/types.js":{"bytesInOutput":875},"../../packages/code-index/build/sync/client.js":{"bytesInOutput":7568},"../../packages/embedding/build/index.js":{"bytesInOutput":1293},"../../packages/code-index/build/embed/node.js":{"bytesInOutput":288},"../../packages/code-index/build/node-embed.js":{"bytesInOutput":63},"src/review.ts":{"bytesInOutput":9411},"src/review-render.ts":{"bytesInOutput":6994},"src/sync-cmd.ts":{"bytesInOutput":3860},"src/index.ts":{"bytesInOutput":7668}},"bytes":135335}}}
|
|
1
|
+
{"inputs":{"src/auth.ts":{"bytes":3441,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/mcp-client.ts":{"bytes":8724,"imports":[],"format":"esm"},"src/render.ts":{"bytes":4525,"imports":[],"format":"esm"},"src/context.ts":{"bytes":6805,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"},{"path":"src/mcp-client.ts","kind":"import-statement","original":"./mcp-client.js"},{"path":"src/render.ts","kind":"import-statement","original":"./render.js"}],"format":"esm"},"../../packages/project-key/build/index.js":{"bytes":3446,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/git.ts":{"bytes":5748,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"../../packages/project-key/build/index.js","kind":"import-statement","original":"@maind/project-key"},{"path":"../../packages/project-key/build/index.js","kind":"import-statement","original":"@maind/project-key"}],"format":"esm"},"src/ci-report.ts":{"bytes":6631,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"},{"path":"src/git.ts","kind":"import-statement","original":"./git.js"}],"format":"esm"},"src/ci-result.ts":{"bytes":5483,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"}],"format":"esm"},"src/git-context.ts":{"bytes":9481,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"},{"path":"src/mcp-client.ts","kind":"import-statement","original":"./mcp-client.js"},{"path":"src/git.ts","kind":"import-statement","original":"./git.js"}],"format":"esm"},"../../packages/code-index/build/parse/keys.js":{"bytes":448,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/types.js":{"bytes":768,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/lang/shared.js":{"bytes":2278,"imports":[],"format":"esm"},"../../packages/code-index/build/parse/lang/python.js":{"bytes":4535,"imports":[{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"./shared.js"}],"format":"esm"},"../../packages/code-index/build/parse/lang/typescript.js":{"bytes":5949,"imports":[{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"./shared.js"}],"format":"esm"},"../../packages/code-index/build/parse/tree-sitter/grammars.js":{"bytes":1941,"imports":[{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/parse/tree-sitter/parser.js":{"bytes":3231,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"web-tree-sitter","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../keys.js"},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"../types.js"},{"path":"../../packages/code-index/build/parse/lang/python.js","kind":"import-statement","original":"../lang/python.js"},{"path":"../../packages/code-index/build/parse/lang/typescript.js","kind":"import-statement","original":"../lang/typescript.js"},{"path":"../../packages/code-index/build/parse/lang/shared.js","kind":"import-statement","original":"../lang/shared.js"},{"path":"../../packages/code-index/build/parse/tree-sitter/grammars.js","kind":"import-statement","original":"./grammars.js"}],"format":"esm"},"../../packages/code-index/build/embed/recipe.js":{"bytes":594,"imports":[],"format":"esm"},"../../packages/code-index/build/embed/types.js":{"bytes":505,"imports":[],"format":"esm"},"../../packages/code-index/build/util/vector.js":{"bytes":707,"imports":[],"format":"esm"},"../../packages/code-index/build/graph/resolve.js":{"bytes":3928,"imports":[{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/keys.js","kind":"import-statement","original":"../parse/keys.js"}],"format":"esm"},"../../packages/code-index/build/incremental/discover.js":{"bytes":8578,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"../parse/types.js"}],"format":"esm"},"../../packages/code-index/build/incremental/hunks.js":{"bytes":6171,"imports":[{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"./discover.js"}],"format":"esm"},"../../packages/code-index/build/incremental/history.js":{"bytes":7302,"imports":[{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"./discover.js"}],"format":"esm"},"../../packages/code-index/build/review/risk-rules.js":{"bytes":1958,"imports":[],"format":"esm"},"../../packages/code-index/build/review/risk-scan.js":{"bytes":1451,"imports":[{"path":"../../packages/code-index/build/review/risk-rules.js","kind":"import-statement","original":"./risk-rules.js"}],"format":"esm"},"../../packages/code-index/build/store/schema.js":{"bytes":3047,"imports":[],"format":"esm"},"../../packages/code-index/build/util/identifiers.js":{"bytes":2180,"imports":[],"format":"esm"},"../../packages/code-index/build/query/engine.js":{"bytes":19798,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/embed/recipe.js","kind":"import-statement","original":"../embed/recipe.js"},{"path":"../../packages/code-index/build/embed/types.js","kind":"import-statement","original":"../embed/types.js"},{"path":"../../packages/code-index/build/util/vector.js","kind":"import-statement","original":"../util/vector.js"},{"path":"../../packages/code-index/build/graph/resolve.js","kind":"import-statement","original":"../graph/resolve.js"},{"path":"../../packages/code-index/build/incremental/discover.js","kind":"import-statement","original":"../incremental/discover.js"},{"path":"../../packages/code-index/build/incremental/hunks.js","kind":"import-statement","original":"../incremental/hunks.js"},{"path":"../../packages/code-index/build/incremental/history.js","kind":"import-statement","original":"../incremental/history.js"},{"path":"../../packages/code-index/build/review/risk-scan.js","kind":"import-statement","original":"../review/risk-scan.js"},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"../store/schema.js"},{"path":"../../packages/code-index/build/util/identifiers.js","kind":"import-statement","original":"../util/identifiers.js"}],"format":"esm"},"../../packages/code-index/build/store/node-sqlite.js":{"bytes":11850,"imports":[{"path":"better-sqlite3","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"./schema.js"},{"path":"../../packages/code-index/build/util/identifiers.js","kind":"import-statement","original":"../util/identifiers.js"}],"format":"esm"},"../../packages/code-index/build/sync/types.js":{"bytes":1779,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"../../packages/code-index/build/sync/client.js":{"bytes":10021,"imports":[{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"../store/schema.js"},{"path":"../../packages/code-index/build/sync/types.js","kind":"import-statement","original":"./types.js"}],"format":"esm"},"../../packages/code-index/build/node.js":{"bytes":2578,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/project-key/build/index.js","kind":"import-statement","original":"@maind/project-key"},{"path":"../../packages/code-index/build/parse/tree-sitter/parser.js","kind":"import-statement","original":"./parse/tree-sitter/parser.js"},{"path":"../../packages/code-index/build/query/engine.js","kind":"import-statement","original":"./query/engine.js"},{"path":"../../packages/code-index/build/store/node-sqlite.js","kind":"import-statement","original":"./store/node-sqlite.js"},{"path":"../../packages/code-index/build/sync/client.js","kind":"import-statement","original":"./sync/client.js"},{"path":"../../packages/code-index/build/sync/client.js","kind":"import-statement","original":"./sync/client.js"}],"format":"esm"},"../../packages/embedding/build/index.js":{"bytes":6053,"imports":[{"path":"@huggingface/transformers","kind":"dynamic-import","external":true}],"format":"esm"},"../../packages/code-index/build/embed/node.js":{"bytes":661,"imports":[{"path":"../../packages/embedding/build/index.js","kind":"import-statement","original":"@maind/embedding"},{"path":"../../packages/code-index/build/embed/recipe.js","kind":"import-statement","original":"./recipe.js"}],"format":"esm"},"../../packages/code-index/build/node-embed.js":{"bytes":660,"imports":[{"path":"../../packages/code-index/build/embed/node.js","kind":"import-statement","original":"./embed/node.js"}],"format":"esm"},"src/index-cmd.ts":{"bytes":9353,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/node.js","kind":"import-statement","original":"@maind/code-index/node"},{"path":"../../packages/code-index/build/node-embed.js","kind":"import-statement","original":"@maind/code-index/node-embed"}],"format":"esm"},"../../packages/code-index/build/model/types.js":{"bytes":471,"imports":[],"format":"esm"},"../../packages/code-index/build/index.js":{"bytes":1359,"imports":[{"path":"../../packages/code-index/build/model/types.js","kind":"import-statement","original":"./model/types.js"},{"path":"../../packages/code-index/build/query/engine.js","kind":"import-statement","original":"./query/engine.js"},{"path":"../../packages/code-index/build/incremental/history.js","kind":"import-statement","original":"./incremental/history.js"},{"path":"../../packages/code-index/build/review/risk-rules.js","kind":"import-statement","original":"./review/risk-rules.js"},{"path":"../../packages/code-index/build/parse/types.js","kind":"import-statement","original":"./parse/types.js"},{"path":"../../packages/code-index/build/embed/types.js","kind":"import-statement","original":"./embed/types.js"},{"path":"../../packages/code-index/build/store/schema.js","kind":"import-statement","original":"./store/schema.js"}],"format":"esm"},"src/review-render.ts":{"bytes":15157,"imports":[],"format":"esm"},"src/review.ts":{"bytes":16955,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/node.js","kind":"import-statement","original":"@maind/code-index/node"},{"path":"../../packages/code-index/build/index.js","kind":"import-statement","original":"@maind/code-index"},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"},{"path":"src/git.ts","kind":"import-statement","original":"./git.js"},{"path":"src/mcp-client.ts","kind":"import-statement","original":"./mcp-client.js"},{"path":"src/review-render.ts","kind":"import-statement","original":"./review-render.js"}],"format":"esm"},"src/sync-cmd.ts":{"bytes":5243,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"../../packages/code-index/build/node.js","kind":"import-statement","original":"@maind/code-index/node"},{"path":"src/auth.ts","kind":"import-statement","original":"./auth.js"}],"format":"esm"},"src/index.ts":{"bytes":9745,"imports":[{"path":"src/context.ts","kind":"import-statement","original":"./context.js"},{"path":"src/ci-report.ts","kind":"import-statement","original":"./ci-report.js"},{"path":"src/ci-result.ts","kind":"import-statement","original":"./ci-result.js"},{"path":"src/git-context.ts","kind":"import-statement","original":"./git-context.js"},{"path":"src/git.ts","kind":"import-statement","original":"./git.js"},{"path":"src/index-cmd.ts","kind":"import-statement","original":"./index-cmd.js"},{"path":"src/review.ts","kind":"import-statement","original":"./review.js"},{"path":"src/sync-cmd.ts","kind":"import-statement","original":"./sync-cmd.js"}],"format":"esm"}},"outputs":{"build/index.js":{"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"web-tree-sitter","kind":"import-statement","external":true},{"path":"node:module","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"better-sqlite3","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"@huggingface/transformers","kind":"dynamic-import","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true}],"exports":[],"entryPoint":"src/index.ts","inputs":{"src/context.ts":{"bytesInOutput":4644},"src/auth.ts":{"bytesInOutput":1609},"src/mcp-client.ts":{"bytesInOutput":5955},"src/render.ts":{"bytesInOutput":2406},"src/ci-report.ts":{"bytesInOutput":4467},"src/git.ts":{"bytesInOutput":3325},"../../packages/project-key/build/index.js":{"bytesInOutput":1449},"src/ci-result.ts":{"bytesInOutput":3848},"src/git-context.ts":{"bytesInOutput":6854},"src/index-cmd.ts":{"bytesInOutput":6717},"../../packages/code-index/build/node.js":{"bytesInOutput":1159},"../../packages/code-index/build/parse/tree-sitter/parser.js":{"bytesInOutput":2043},"../../packages/code-index/build/parse/keys.js":{"bytesInOutput":169},"../../packages/code-index/build/parse/types.js":{"bytesInOutput":546},"../../packages/code-index/build/parse/lang/shared.js":{"bytesInOutput":1131},"../../packages/code-index/build/parse/lang/python.js":{"bytesInOutput":3747},"../../packages/code-index/build/parse/lang/typescript.js":{"bytesInOutput":4721},"../../packages/code-index/build/parse/tree-sitter/grammars.js":{"bytesInOutput":523},"../../packages/code-index/build/query/engine.js":{"bytesInOutput":14406},"../../packages/code-index/build/embed/recipe.js":{"bytesInOutput":229},"../../packages/code-index/build/embed/types.js":{"bytesInOutput":105},"../../packages/code-index/build/util/vector.js":{"bytesInOutput":339},"../../packages/code-index/build/graph/resolve.js":{"bytesInOutput":2486},"../../packages/code-index/build/incremental/discover.js":{"bytesInOutput":4855},"../../packages/code-index/build/incremental/hunks.js":{"bytesInOutput":3951},"../../packages/code-index/build/incremental/history.js":{"bytesInOutput":4531},"../../packages/code-index/build/review/risk-rules.js":{"bytesInOutput":876},"../../packages/code-index/build/review/risk-scan.js":{"bytesInOutput":798},"../../packages/code-index/build/store/schema.js":{"bytesInOutput":2266},"../../packages/code-index/build/util/identifiers.js":{"bytesInOutput":1094},"../../packages/code-index/build/store/node-sqlite.js":{"bytesInOutput":9751},"../../packages/code-index/build/sync/types.js":{"bytesInOutput":875},"../../packages/code-index/build/sync/client.js":{"bytesInOutput":7568},"../../packages/embedding/build/index.js":{"bytesInOutput":1293},"../../packages/code-index/build/embed/node.js":{"bytesInOutput":288},"../../packages/code-index/build/node-embed.js":{"bytesInOutput":63},"src/review.ts":{"bytesInOutput":11152},"../../packages/code-index/build/index.js":{"bytesInOutput":34},"src/review-render.ts":{"bytesInOutput":8227},"src/sync-cmd.ts":{"bytesInOutput":3860},"src/index.ts":{"bytesInOutput":7760}},"bytes":144149}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maind-dev/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Headless maind CLI — pull stack-relevant lessons into CI runners, report CI outcomes, and brief agents on local git state (branch, PRs, peers). No device flow; authenticates from MAIND_API_KEY.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/index.js",
|
|
@@ -11,6 +11,15 @@
|
|
|
11
11
|
"build",
|
|
12
12
|
"README.md"
|
|
13
13
|
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "pnpm --filter @maind/code-index build && node scripts/bundle.mjs",
|
|
16
|
+
"prepublishOnly": "pnpm build",
|
|
17
|
+
"start": "node build/index.js",
|
|
18
|
+
"dev": "node --import tsx src/index.ts",
|
|
19
|
+
"test": "node --import tsx --test test/**/*.test.ts",
|
|
20
|
+
"type-check": "tsc --noEmit",
|
|
21
|
+
"typecheck": "tsc --noEmit"
|
|
22
|
+
},
|
|
14
23
|
"dependencies": {
|
|
15
24
|
"@huggingface/transformers": "^3.0.0",
|
|
16
25
|
"better-sqlite3": "^12.11.1",
|
|
@@ -18,13 +27,13 @@
|
|
|
18
27
|
"web-tree-sitter": "0.24.7"
|
|
19
28
|
},
|
|
20
29
|
"devDependencies": {
|
|
30
|
+
"@maind/code-index": "workspace:*",
|
|
31
|
+
"@maind/embedding": "workspace:*",
|
|
32
|
+
"@maind/project-key": "workspace:*",
|
|
21
33
|
"@types/node": "^20.11.0",
|
|
22
34
|
"esbuild": "^0.24.0",
|
|
23
35
|
"tsx": "^4.7.0",
|
|
24
|
-
"typescript": "^5.4.0"
|
|
25
|
-
"@maind/embedding": "0.0.0",
|
|
26
|
-
"@maind/project-key": "0.0.0",
|
|
27
|
-
"@maind/code-index": "0.0.0"
|
|
36
|
+
"typescript": "^5.4.0"
|
|
28
37
|
},
|
|
29
38
|
"engines": {
|
|
30
39
|
"node": ">=20.0.0"
|
|
@@ -39,13 +48,5 @@
|
|
|
39
48
|
"license": "MIT",
|
|
40
49
|
"publishConfig": {
|
|
41
50
|
"access": "public"
|
|
42
|
-
},
|
|
43
|
-
"scripts": {
|
|
44
|
-
"build": "node scripts/bundle.mjs",
|
|
45
|
-
"start": "node build/index.js",
|
|
46
|
-
"dev": "node --import tsx src/index.ts",
|
|
47
|
-
"test": "node --import tsx --test test/**/*.test.ts",
|
|
48
|
-
"type-check": "tsc --noEmit",
|
|
49
|
-
"typecheck": "tsc --noEmit"
|
|
50
51
|
}
|
|
51
|
-
}
|
|
52
|
+
}
|