@subseam/mcp 0.4.60 → 0.4.62
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/dist/main.js +27 -300
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -12090,6 +12090,9 @@ init_esm_shims();
|
|
|
12090
12090
|
// ../execution-contract/src/unit/build-report.ts
|
|
12091
12091
|
init_esm_shims();
|
|
12092
12092
|
|
|
12093
|
+
// ../execution-contract/src/unit/service-report.ts
|
|
12094
|
+
init_esm_shims();
|
|
12095
|
+
|
|
12093
12096
|
// ../execution-contract/src/dispatchable-packages.ts
|
|
12094
12097
|
init_esm_shims();
|
|
12095
12098
|
|
|
@@ -12821,7 +12824,7 @@ init_esm_shims();
|
|
|
12821
12824
|
|
|
12822
12825
|
// ../channel-sdk/src/capability-type.ts
|
|
12823
12826
|
init_esm_shims();
|
|
12824
|
-
var CAPABILITY_TYPES = ["
|
|
12827
|
+
var CAPABILITY_TYPES = ["build", "capture", "decision", "define", "execute", "search", "verify", "work", "write"];
|
|
12825
12828
|
|
|
12826
12829
|
// ../channel-sdk/src/validate.ts
|
|
12827
12830
|
function assertToolProvider(value, source) {
|
|
@@ -16932,26 +16935,6 @@ function parseRemoteSlug(url2) {
|
|
|
16932
16935
|
if (segments.length < 2) return null;
|
|
16933
16936
|
return `${segments[segments.length - 2]}/${segments[segments.length - 1]}`;
|
|
16934
16937
|
}
|
|
16935
|
-
async function requireRepo(env, readOrigin2) {
|
|
16936
|
-
const envRepo = env["SUBSEAM_REPO"];
|
|
16937
|
-
if (envRepo !== void 0 && envRepo !== "") {
|
|
16938
|
-
return envRepo;
|
|
16939
|
-
}
|
|
16940
|
-
let seen;
|
|
16941
|
-
try {
|
|
16942
|
-
seen = await readOrigin2();
|
|
16943
|
-
} catch (err) {
|
|
16944
|
-
throw new Error(`SUBSEAM_REPO unset; git remote origin = unreadable (${err instanceof Error ? err.message : String(err)}) did not parse as owner/name`);
|
|
16945
|
-
}
|
|
16946
|
-
if (seen === null) {
|
|
16947
|
-
throw new Error(`SUBSEAM_REPO unset; git remote origin = none did not parse as owner/name`);
|
|
16948
|
-
}
|
|
16949
|
-
const slug = parseRemoteSlug(seen);
|
|
16950
|
-
if (slug !== null) {
|
|
16951
|
-
return slug;
|
|
16952
|
-
}
|
|
16953
|
-
throw new Error(`SUBSEAM_REPO unset; git remote origin = ${seen} did not parse as owner/name`);
|
|
16954
|
-
}
|
|
16955
16938
|
|
|
16956
16939
|
// src/account.ts
|
|
16957
16940
|
init_esm_shims();
|
|
@@ -18514,158 +18497,24 @@ function mountProviders(server, providers, ctx) {
|
|
|
18514
18497
|
// src/registry.ts
|
|
18515
18498
|
init_esm_shims();
|
|
18516
18499
|
|
|
18517
|
-
// ../analyze-tool/src/index.ts
|
|
18518
|
-
init_esm_shims();
|
|
18519
|
-
|
|
18520
|
-
// ../analyze-tool/src/run.ts
|
|
18521
|
-
init_esm_shims();
|
|
18522
|
-
|
|
18523
|
-
// ../analyze-tool/src/proposed-commit.ts
|
|
18524
|
-
init_esm_shims();
|
|
18525
|
-
import { execFile as execFile4 } from "child_process";
|
|
18526
|
-
import { promisify as promisify4 } from "util";
|
|
18527
|
-
import { mkdtemp, readFile as readFile4, rm as rm3 } from "fs/promises";
|
|
18528
|
-
import { tmpdir as tmpdir3 } from "os";
|
|
18529
|
-
import { join as join8 } from "path";
|
|
18530
|
-
var execFileP = promisify4(execFile4);
|
|
18531
|
-
var PROPOSED_REF = "refs/subseam/proposed";
|
|
18532
|
-
async function git(cwd, args, env) {
|
|
18533
|
-
const options = env === void 0 ? { cwd } : { cwd, env: { ...process.env, ...env } };
|
|
18534
|
-
const { stdout } = await execFileP("git", args, options);
|
|
18535
|
-
return stdout.trim();
|
|
18536
|
-
}
|
|
18537
|
-
async function buildProposedCommit(cwd, scope, file2) {
|
|
18538
|
-
const scratch = await mkdtemp(join8(tmpdir3(), "subseam-mcp-"));
|
|
18539
|
-
try {
|
|
18540
|
-
const tree = scope === "index" ? await git(cwd, ["write-tree"]) : file2 !== void 0 ? await treeOfWorktreeFile(cwd, scratch, file2) : await treeOfWorktreeAll(cwd, scratch);
|
|
18541
|
-
const commit = await git(cwd, ["commit-tree", tree, "-p", "HEAD", "-m", "subseam-proposed"]);
|
|
18542
|
-
await git(cwd, ["update-ref", PROPOSED_REF, commit]);
|
|
18543
|
-
const bundlePath = join8(scratch, "proposed.bundle");
|
|
18544
|
-
try {
|
|
18545
|
-
await git(cwd, ["bundle", "create", bundlePath, PROPOSED_REF, "--not", "HEAD"]);
|
|
18546
|
-
} finally {
|
|
18547
|
-
await git(cwd, ["update-ref", "-d", PROPOSED_REF]).catch(() => {
|
|
18548
|
-
});
|
|
18549
|
-
}
|
|
18550
|
-
return { bundle: (await readFile4(bundlePath)).toString("base64"), commit };
|
|
18551
|
-
} finally {
|
|
18552
|
-
await rm3(scratch, { recursive: true, force: true });
|
|
18553
|
-
}
|
|
18554
|
-
}
|
|
18555
|
-
async function treeOfWorktreeFile(cwd, scratch, file2) {
|
|
18556
|
-
const env = { GIT_INDEX_FILE: join8(scratch, "index") };
|
|
18557
|
-
await git(cwd, ["read-tree", "HEAD"], env);
|
|
18558
|
-
await git(cwd, ["add", "--", file2], env);
|
|
18559
|
-
return git(cwd, ["write-tree"], env);
|
|
18560
|
-
}
|
|
18561
|
-
async function treeOfWorktreeAll(cwd, scratch) {
|
|
18562
|
-
const env = { GIT_INDEX_FILE: join8(scratch, "index") };
|
|
18563
|
-
await git(cwd, ["read-tree", "HEAD"], env);
|
|
18564
|
-
await git(cwd, ["add", "-A"], env);
|
|
18565
|
-
return git(cwd, ["write-tree"], env);
|
|
18566
|
-
}
|
|
18567
|
-
|
|
18568
|
-
// ../analyze-tool/src/run.ts
|
|
18569
|
-
function targetOf(input12) {
|
|
18570
|
-
if (input12.symbol !== void 0) return { path: input12.path, symbol: input12.symbol };
|
|
18571
|
-
if (input12.line !== void 0) return { path: input12.path, line: input12.line };
|
|
18572
|
-
throw new Error("Provide either `symbol` or `line` to address the seam to analyze.");
|
|
18573
|
-
}
|
|
18574
|
-
async function buildTip(cwd, input12) {
|
|
18575
|
-
switch (input12.mode) {
|
|
18576
|
-
case "head":
|
|
18577
|
-
return { mode: "head" };
|
|
18578
|
-
case "commit":
|
|
18579
|
-
if (input12.commit === void 0 || input12.commit === "") {
|
|
18580
|
-
throw new Error("Mode `commit` needs a `commit` sha to analyze.");
|
|
18581
|
-
}
|
|
18582
|
-
return { mode: "commit", commit: input12.commit };
|
|
18583
|
-
case "staged":
|
|
18584
|
-
return { mode: "staged", proposed: await buildProposedCommit(cwd, "index", input12.path) };
|
|
18585
|
-
case "working":
|
|
18586
|
-
return { mode: "working", proposed: await buildProposedCommit(cwd, "worktree", input12.path) };
|
|
18587
|
-
}
|
|
18588
|
-
}
|
|
18589
|
-
async function runAnalyze(repo2, ctx, input12) {
|
|
18590
|
-
const target = targetOf(input12);
|
|
18591
|
-
const tip = await buildTip(ctx.cwd, input12);
|
|
18592
|
-
const request = { repo: repo2, target, tip };
|
|
18593
|
-
const { histories } = await ctx.gateway.invoke("analyze", request);
|
|
18594
|
-
return histories;
|
|
18595
|
-
}
|
|
18596
|
-
|
|
18597
|
-
// ../analyze-tool/src/format.ts
|
|
18598
|
-
init_esm_shims();
|
|
18599
|
-
function formatHistories(histories) {
|
|
18600
|
-
if (histories.length === 0) {
|
|
18601
|
-
return "No seam resolves at that location \u2014 nothing alive sits there.";
|
|
18602
|
-
}
|
|
18603
|
-
return histories.map(formatOne).join("\n\n");
|
|
18604
|
-
}
|
|
18605
|
-
function formatOne(h) {
|
|
18606
|
-
const lines = [`${h.label} \u2014 ${h.target.path}:${h.target.startLine} (${h.timeline.length} point${h.timeline.length === 1 ? "" : "s"})`];
|
|
18607
|
-
for (const c of h.timeline) {
|
|
18608
|
-
const marker = c.isTip ? "\u25B6 TIP " : " ";
|
|
18609
|
-
lines.push(` ${marker}${c.commit.slice(0, 8)} ${c.verdict.padEnd(10)} ${c.presentation.headline}`);
|
|
18610
|
-
if (c.presentation.detail !== void 0) {
|
|
18611
|
-
lines.push(` ${c.presentation.detail}`);
|
|
18612
|
-
}
|
|
18613
|
-
}
|
|
18614
|
-
return lines.join("\n");
|
|
18615
|
-
}
|
|
18616
|
-
|
|
18617
|
-
// ../analyze-tool/src/read-origin.ts
|
|
18618
|
-
init_esm_shims();
|
|
18619
|
-
import { execFile as execFile5 } from "child_process";
|
|
18620
|
-
import { promisify as promisify5 } from "util";
|
|
18621
|
-
var execFileP2 = promisify5(execFile5);
|
|
18622
|
-
async function readOrigin(root) {
|
|
18623
|
-
try {
|
|
18624
|
-
const { stdout } = await execFileP2("git", ["-C", root, "remote", "get-url", "origin"]);
|
|
18625
|
-
return stdout.trim();
|
|
18626
|
-
} catch {
|
|
18627
|
-
return null;
|
|
18628
|
-
}
|
|
18629
|
-
}
|
|
18630
|
-
|
|
18631
|
-
// ../analyze-tool/src/index.ts
|
|
18632
|
-
var DESCRIPTION = "Deterministic behavioral history of the seam(s) at a code location, optionally extended through your uncommitted change as the focal tip. You know what you MEANT; this tells you what your change DID behaviorally. Call it after an edit, before declaring done, or when reasoning about an area \u2014 then reconcile it against your intent.";
|
|
18633
|
-
var analyzeTool = {
|
|
18634
|
-
name: "analyze",
|
|
18635
|
-
capability: "analyze",
|
|
18636
|
-
description: DESCRIPTION,
|
|
18637
|
-
inputSchema: {
|
|
18638
|
-
path: external_exports.string().describe("Repo-relative file path you are working in."),
|
|
18639
|
-
symbol: external_exports.string().optional().describe("Symbol name at that path (a function name). Address by this OR line."),
|
|
18640
|
-
line: external_exports.number().int().positive().optional().describe("1-based line at that path. Address by this OR symbol."),
|
|
18641
|
-
mode: external_exports.enum(["head", "working", "staged", "commit"]).default("working").describe("Tip source: head = committed history; working = your unsaved edit; staged = git index; commit = a real commit."),
|
|
18642
|
-
commit: external_exports.string().optional().describe("Commit sha \u2014 required when mode is `commit`.")
|
|
18643
|
-
},
|
|
18644
|
-
async handler(input12, ctx) {
|
|
18645
|
-
const histories = await runAnalyze(await requireRepo(process.env, () => readOrigin(ctx.cwd)), ctx, input12);
|
|
18646
|
-
return { text: formatHistories(histories) };
|
|
18647
|
-
}
|
|
18648
|
-
};
|
|
18649
|
-
var src_default = analyzeTool;
|
|
18650
|
-
|
|
18651
18500
|
// ../explore-tool/src/index.ts
|
|
18652
18501
|
init_esm_shims();
|
|
18653
18502
|
|
|
18654
18503
|
// ../explore-tool/src/enumerate.ts
|
|
18655
18504
|
init_esm_shims();
|
|
18656
|
-
import { execFile as
|
|
18657
|
-
import { promisify as
|
|
18505
|
+
import { execFile as execFile4 } from "child_process";
|
|
18506
|
+
import { promisify as promisify4 } from "util";
|
|
18658
18507
|
import { readdir as readdir3, realpath as realpath2 } from "fs/promises";
|
|
18659
|
-
import { basename as basename3, dirname as dirname4, join as
|
|
18508
|
+
import { basename as basename3, dirname as dirname4, join as join8 } from "path";
|
|
18660
18509
|
|
|
18661
18510
|
// ../explore-tool/src/remote-slug.ts
|
|
18662
18511
|
init_esm_shims();
|
|
18663
18512
|
|
|
18664
18513
|
// ../explore-tool/src/enumerate.ts
|
|
18665
|
-
var
|
|
18514
|
+
var execFileP = promisify4(execFile4);
|
|
18666
18515
|
async function originSlug(root) {
|
|
18667
18516
|
try {
|
|
18668
|
-
const { stdout } = await
|
|
18517
|
+
const { stdout } = await execFileP("git", ["-C", root, "remote", "get-url", "origin"]);
|
|
18669
18518
|
return parseRemoteSlug(stdout);
|
|
18670
18519
|
} catch {
|
|
18671
18520
|
return null;
|
|
@@ -18673,7 +18522,7 @@ async function originSlug(root) {
|
|
|
18673
18522
|
}
|
|
18674
18523
|
async function gitToplevel(dir) {
|
|
18675
18524
|
try {
|
|
18676
|
-
const { stdout } = await
|
|
18525
|
+
const { stdout } = await execFileP("git", ["-C", dir, "rev-parse", "--show-toplevel"]);
|
|
18677
18526
|
return await realpath2(stdout.trim());
|
|
18678
18527
|
} catch {
|
|
18679
18528
|
return null;
|
|
@@ -18687,7 +18536,7 @@ async function discoverRepos(cwd) {
|
|
|
18687
18536
|
const repos = [];
|
|
18688
18537
|
for (const entry of entries) {
|
|
18689
18538
|
if (!entry.isDirectory()) continue;
|
|
18690
|
-
const childPath =
|
|
18539
|
+
const childPath = join8(namespaceRoot, entry.name);
|
|
18691
18540
|
const child = await realpath2(childPath).catch(() => null);
|
|
18692
18541
|
if (child === null) continue;
|
|
18693
18542
|
const toplevel = await gitToplevel(child);
|
|
@@ -18735,7 +18584,7 @@ function preferenceSorted(name, group) {
|
|
|
18735
18584
|
|
|
18736
18585
|
// ../explore-tool/src/rg.ts
|
|
18737
18586
|
init_esm_shims();
|
|
18738
|
-
import { execFile as
|
|
18587
|
+
import { execFile as execFile5, execFileSync } from "child_process";
|
|
18739
18588
|
var TREE_EXCLUDES = ["--glob", "!node_modules", "--glob", "!dist", "--glob", "!.git"];
|
|
18740
18589
|
var DTS_EXCLUDE = ["--glob", "!*.d.ts"];
|
|
18741
18590
|
var LOCKFILE_EXCLUDES = [
|
|
@@ -18771,7 +18620,7 @@ function isRgAvailable() {
|
|
|
18771
18620
|
}
|
|
18772
18621
|
function rgText(args) {
|
|
18773
18622
|
return new Promise((resolve4) => {
|
|
18774
|
-
|
|
18623
|
+
execFile5("rg", args, { maxBuffer: 8 * 1024 * 1024 }, (_err, stdout) => {
|
|
18775
18624
|
resolve4(stdout);
|
|
18776
18625
|
});
|
|
18777
18626
|
});
|
|
@@ -18833,11 +18682,11 @@ function rgParse(output) {
|
|
|
18833
18682
|
|
|
18834
18683
|
// ../explore-tool/src/stamp.ts
|
|
18835
18684
|
init_esm_shims();
|
|
18836
|
-
import { execFile as
|
|
18837
|
-
import { promisify as
|
|
18838
|
-
var
|
|
18839
|
-
async function
|
|
18840
|
-
const { stdout } = await
|
|
18685
|
+
import { execFile as execFile6 } from "child_process";
|
|
18686
|
+
import { promisify as promisify5 } from "util";
|
|
18687
|
+
var execFileP2 = promisify5(execFile6);
|
|
18688
|
+
async function git(root, args) {
|
|
18689
|
+
const { stdout } = await execFileP2("git", ["-C", root, ...args]);
|
|
18841
18690
|
return stdout.trim();
|
|
18842
18691
|
}
|
|
18843
18692
|
async function stampRepo(root) {
|
|
@@ -18845,9 +18694,9 @@ async function stampRepo(root) {
|
|
|
18845
18694
|
let sha = "unknown";
|
|
18846
18695
|
const modified = /* @__PURE__ */ new Set();
|
|
18847
18696
|
try {
|
|
18848
|
-
branch = await
|
|
18849
|
-
sha = await
|
|
18850
|
-
const status = await
|
|
18697
|
+
branch = await git(root, ["rev-parse", "--abbrev-ref", "HEAD"]);
|
|
18698
|
+
sha = await git(root, ["rev-parse", "--short", "HEAD"]);
|
|
18699
|
+
const status = await git(root, ["status", "--porcelain"]);
|
|
18851
18700
|
for (const line of status.split("\n")) {
|
|
18852
18701
|
const path6 = line.slice(3).trim();
|
|
18853
18702
|
if (path6 !== "") modified.add(path6);
|
|
@@ -19121,7 +18970,7 @@ function groupBy(items, key) {
|
|
|
19121
18970
|
}
|
|
19122
18971
|
|
|
19123
18972
|
// ../explore-tool/src/index.ts
|
|
19124
|
-
var
|
|
18973
|
+
var DESCRIPTION = "Search code across every repo your org owns, ranked and enriched by the subseam code graph. Ripgrep finds the text in your live trees; the seam-concept graph reorders the hits by what matters (call-degree, churn) and annotates each with its concept, kind, behavioral history, and seam verdict. Hits in repos the graph has not acquired still come back as plain text \u2014 augmentation is additive.";
|
|
19125
18974
|
async function runSearch(pattern, verbose, ctx) {
|
|
19126
18975
|
if (!isRgAvailable()) {
|
|
19127
18976
|
throw new Error(
|
|
@@ -19157,7 +19006,7 @@ async function runSearch(pattern, verbose, ctx) {
|
|
|
19157
19006
|
var searchTool = {
|
|
19158
19007
|
name: "search",
|
|
19159
19008
|
capability: "search",
|
|
19160
|
-
description:
|
|
19009
|
+
description: DESCRIPTION,
|
|
19161
19010
|
inputSchema: {
|
|
19162
19011
|
pattern: external_exports.string().describe("The text/regex pattern to search for (ripgrep syntax, case-insensitive)."),
|
|
19163
19012
|
verbose: external_exports.boolean().optional().describe(
|
|
@@ -19169,69 +19018,7 @@ var searchTool = {
|
|
|
19169
19018
|
return { text: await runSearch(pattern, verbose ?? false, ctx) };
|
|
19170
19019
|
}
|
|
19171
19020
|
};
|
|
19172
|
-
var
|
|
19173
|
-
|
|
19174
|
-
// ../analyze-tool/src/tension.ts
|
|
19175
|
-
init_esm_shims();
|
|
19176
|
-
|
|
19177
|
-
// ../analyze-tool/src/tension-format.ts
|
|
19178
|
-
init_esm_shims();
|
|
19179
|
-
function formatTension(a) {
|
|
19180
|
-
if (a.seams.length === 0) {
|
|
19181
|
-
return `No seams disturbed at ${a.commit.slice(0, 8)} \u2014 nothing to review.`;
|
|
19182
|
-
}
|
|
19183
|
-
const head = `Tension @ ${a.commit.slice(0, 8)} \u2014 ${a.verdict.toUpperCase()} (${a.seams.length} seam${a.seams.length === 1 ? "" : "s"})`;
|
|
19184
|
-
return [head, ...a.seams.map(formatSeam)].join("\n\n");
|
|
19185
|
-
}
|
|
19186
|
-
function formatFinding(f) {
|
|
19187
|
-
const mark = f.severity === "warn" ? "\u26A0" : "\u2139";
|
|
19188
|
-
const detail = f.presentation.detail !== void 0 ? `
|
|
19189
|
-
${f.presentation.detail}` : "";
|
|
19190
|
-
return ` ${mark} [${f.detector}] ${f.presentation.headline}${detail}`;
|
|
19191
|
-
}
|
|
19192
|
-
function formatSeam(s) {
|
|
19193
|
-
const lines = [` ${s.label} \u2014 ${s.target.path}:${s.target.startLine}`];
|
|
19194
|
-
for (const st of s.stitches) {
|
|
19195
|
-
for (const f of st.findings) lines.push(formatFinding(f));
|
|
19196
|
-
}
|
|
19197
|
-
for (const f of s.findings) lines.push(formatFinding(f));
|
|
19198
|
-
if (lines.length === 1) lines.push(" (no findings \u2014 clean)");
|
|
19199
|
-
return lines.join("\n");
|
|
19200
|
-
}
|
|
19201
|
-
|
|
19202
|
-
// ../analyze-tool/src/tension.ts
|
|
19203
|
-
var DESCRIPTION3 = "Deterministic behavioral review of a commit: the seams it disturbed, and what the WAY it changed them across history looks like \u2014 reintroduced behavior, broken invariants, scar tissue, thrashing, forgotten co-movers. A clean verdict (no findings) is a real answer. Call it on a commit to review before you trust it; the findings are deterministic ground-truth you reconcile against intent.";
|
|
19204
|
-
async function buildCommit(cwd, input12) {
|
|
19205
|
-
switch (input12.mode) {
|
|
19206
|
-
case "head":
|
|
19207
|
-
return { mode: "head" };
|
|
19208
|
-
case "commit":
|
|
19209
|
-
if (input12.commit === void 0 || input12.commit === "") throw new Error("Mode `commit` needs a `commit` sha to review.");
|
|
19210
|
-
return { mode: "commit", commit: input12.commit };
|
|
19211
|
-
case "staged":
|
|
19212
|
-
return { mode: "staged", proposed: await buildProposedCommit(cwd, "index") };
|
|
19213
|
-
case "working":
|
|
19214
|
-
return { mode: "working", proposed: await buildProposedCommit(cwd, "worktree") };
|
|
19215
|
-
}
|
|
19216
|
-
}
|
|
19217
|
-
var tensionTool = {
|
|
19218
|
-
name: "tension",
|
|
19219
|
-
capability: "tension",
|
|
19220
|
-
description: DESCRIPTION3,
|
|
19221
|
-
inputSchema: {
|
|
19222
|
-
mode: external_exports.enum(["head", "working", "staged", "commit"]).default("working").describe("What to review: working = your uncommitted change; staged = the index; head = the latest acquired commit; commit = a real sha."),
|
|
19223
|
-
commit: external_exports.string().optional().describe("Commit sha \u2014 required when mode is `commit`.")
|
|
19224
|
-
},
|
|
19225
|
-
async handler(input12, ctx) {
|
|
19226
|
-
const request = {
|
|
19227
|
-
repo: await requireRepo(process.env, () => readOrigin(ctx.cwd)),
|
|
19228
|
-
commit: await buildCommit(ctx.cwd, input12)
|
|
19229
|
-
};
|
|
19230
|
-
const analysis = await ctx.gateway.invoke("tension", request);
|
|
19231
|
-
return { text: formatTension(analysis) };
|
|
19232
|
-
}
|
|
19233
|
-
};
|
|
19234
|
-
var tension_default = tensionTool;
|
|
19021
|
+
var src_default = searchTool;
|
|
19235
19022
|
|
|
19236
19023
|
// ../define/src/index.ts
|
|
19237
19024
|
init_esm_shims();
|
|
@@ -35813,7 +35600,7 @@ var ContributionSeveritySchema = external_exports2.enum(["danger", "warn", "noti
|
|
|
35813
35600
|
// ../contracts-api/src/v1/contribution.ts
|
|
35814
35601
|
init_esm_shims();
|
|
35815
35602
|
var ContributionSchema = contractObject({
|
|
35816
|
-
/** The owning capability (a CapabilityType value, e.g. '
|
|
35603
|
+
/** The owning capability (a CapabilityType value, e.g. 'verify'). */
|
|
35817
35604
|
capability: external_exports2.string(),
|
|
35818
35605
|
/** The density this contribution was produced for. */
|
|
35819
35606
|
density: DensitySchema,
|
|
@@ -37112,73 +36899,13 @@ var buildTools = [
|
|
|
37112
36899
|
configTool
|
|
37113
36900
|
];
|
|
37114
36901
|
|
|
37115
|
-
// ../secure/src/index.ts
|
|
37116
|
-
init_esm_shims();
|
|
37117
|
-
|
|
37118
|
-
// ../secure/src/tool/secure-tool.ts
|
|
37119
|
-
init_esm_shims();
|
|
37120
|
-
|
|
37121
|
-
// ../secure/src/tool/format.ts
|
|
37122
|
-
init_esm_shims();
|
|
37123
|
-
function formatFindings(result) {
|
|
37124
|
-
const escapes = formatEscapes(result);
|
|
37125
|
-
const at = result.resolvedCommit === void 0 ? "" : `
|
|
37126
|
-
at commit ${result.resolvedCommit}`;
|
|
37127
|
-
if (result.status === "pending") {
|
|
37128
|
-
const reason = result.gated?.reason ?? "analysis not available";
|
|
37129
|
-
return `secure: PENDING \u2014 ${reason}${at}${escapes}`;
|
|
37130
|
-
}
|
|
37131
|
-
if (result.findings.length === 0) {
|
|
37132
|
-
return `secure: analyzed \u2014 no taint paths on the seams this change touched.${at}${escapes}`;
|
|
37133
|
-
}
|
|
37134
|
-
const lines = result.findings.map(
|
|
37135
|
-
(f) => ` [${f.sinkClass}] ${f.source.label} \u2192 ${f.sink.label}
|
|
37136
|
-
from ${f.source.location.path}:${f.source.location.symbol}
|
|
37137
|
-
to ${f.sink.location.path}:${f.sink.location.symbol}
|
|
37138
|
-
id ${f.id}`
|
|
37139
|
-
);
|
|
37140
|
-
return `secure: ${result.findings.length} taint finding(s) on the seams this change touched:
|
|
37141
|
-
${lines.join("\n")}${at}${escapes}`;
|
|
37142
|
-
}
|
|
37143
|
-
function formatEscapes(result) {
|
|
37144
|
-
if (result.escapes.length === 0) return "";
|
|
37145
|
-
return `
|
|
37146
|
-
${result.escapes.length} unresolved crossing(s) \u2014 a taint path may exist through these that is NOT listed above:
|
|
37147
|
-
` + result.escapes.map((e) => ` ${e.at} (${e.reason}; could reach ${e.classes.join(", ") || "any sink class"})`).join("\n");
|
|
37148
|
-
}
|
|
37149
|
-
|
|
37150
|
-
// ../secure/src/tool/secure-tool.ts
|
|
37151
|
-
var DESCRIPTION4 = "Deterministic taint / reachability over the named repo's code graph on the subseam platform \u2014 not a local scan: can untrusted input reach a sensitive operation (SQL, command, eval, path, template) on this change, and was it sanitized on the way? Differential \u2014 it reports source\u2192sink paths only on the seams your change touches, anchored to concept identity so a finding survives a refactor. Call it after an edit that moves data toward a sink, before declaring done.";
|
|
37152
|
-
var secureTool = {
|
|
37153
|
-
name: "taint",
|
|
37154
|
-
capability: "secure",
|
|
37155
|
-
description: DESCRIPTION4,
|
|
37156
|
-
inputSchema: {
|
|
37157
|
-
repo: external_exports.string().min(1).describe("The repo name this analysis targets in the subseam graph (the name the checkout maps to)."),
|
|
37158
|
-
mode: external_exports.enum(["head", "working", "staged", "commit"]).default("head").describe("Tip source: head = the latest committed tip (default); commit = a specific sha. Uncommitted modes (working, staged) cannot be addressed yet and answer pending."),
|
|
37159
|
-
commit: external_exports.string().optional().describe("Commit sha \u2014 required when mode is `commit`.")
|
|
37160
|
-
},
|
|
37161
|
-
async handler(input12, ctx) {
|
|
37162
|
-
const asked = input12;
|
|
37163
|
-
if (asked.mode === "commit" && (asked.commit === void 0 || asked.commit === "")) {
|
|
37164
|
-
throw new Error("Mode `commit` needs a `commit` sha to analyze.");
|
|
37165
|
-
}
|
|
37166
|
-
const result = await ctx.gateway.invoke("secure", {
|
|
37167
|
-
repo: asked.repo,
|
|
37168
|
-
mode: asked.mode,
|
|
37169
|
-
...asked.commit !== void 0 ? { commit: asked.commit } : {}
|
|
37170
|
-
});
|
|
37171
|
-
return { text: formatFindings(result) };
|
|
37172
|
-
}
|
|
37173
|
-
};
|
|
37174
|
-
|
|
37175
36902
|
// src/registry.ts
|
|
37176
36903
|
var workTools = createPullToolProviders({ capability: "work" });
|
|
37177
36904
|
var workReadTools = createWorkReadToolProviders({ capability: "work" });
|
|
37178
|
-
var bundledProviders = [
|
|
36905
|
+
var bundledProviders = [src_default, ...defineTools, ...decisionTools, ...captureTools, ...buildTools, ...workTools, ...workReadTools];
|
|
37179
36906
|
|
|
37180
36907
|
// package.json
|
|
37181
|
-
var version2 = "0.4.
|
|
36908
|
+
var version2 = "0.4.62";
|
|
37182
36909
|
|
|
37183
36910
|
// src/server.ts
|
|
37184
36911
|
var SERVER_VERSION = version2;
|