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