@subseam/mcp 0.4.48 → 0.4.50
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 +41 -20
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -30506,11 +30506,24 @@ function readBody(schema, body2, tool, edge) {
|
|
|
30506
30506
|
|
|
30507
30507
|
// ../define/src/tool/config.ts
|
|
30508
30508
|
init_esm_shims();
|
|
30509
|
+
|
|
30510
|
+
// ../define/src/tool/rung.ts
|
|
30511
|
+
init_esm_shims();
|
|
30512
|
+
var RUNGS = ["off", "warn", "new-code-only", "everywhere"];
|
|
30513
|
+
var readRung = external_exports.enum(["block", ...RUNGS]).transform((r) => r === "block" ? "new-code-only" : r);
|
|
30514
|
+
var RUNG_EFFECT = {
|
|
30515
|
+
off: "not evaluated at all",
|
|
30516
|
+
warn: "violations are reported, nothing is refused",
|
|
30517
|
+
"new-code-only": "a violation a change adds refuses it; violations already on the trunk do not",
|
|
30518
|
+
everywhere: "any violation on the trunk refuses a change, added by it or not"
|
|
30519
|
+
};
|
|
30520
|
+
|
|
30521
|
+
// ../define/src/tool/config.ts
|
|
30509
30522
|
var gapRow = external_exports.object({ construct: external_exports.string(), firstWitness: external_exports.string(), issue: external_exports.number(), recordedBy: external_exports.string(), recordedAt: external_exports.string() });
|
|
30510
30523
|
var input = external_exports.object({
|
|
30511
30524
|
set: external_exports.object({
|
|
30512
30525
|
definitionId: external_exports.string().min(1),
|
|
30513
|
-
disposition: external_exports.enum(
|
|
30526
|
+
disposition: external_exports.enum(RUNGS),
|
|
30514
30527
|
severity: external_exports.enum(["info", "low", "medium", "high", "critical"]).nullable().optional()
|
|
30515
30528
|
}).optional()
|
|
30516
30529
|
});
|
|
@@ -30522,17 +30535,17 @@ var configBody = external_exports.object({
|
|
|
30522
30535
|
profile: external_exports.array(external_exports.object({
|
|
30523
30536
|
definitionId: external_exports.string(),
|
|
30524
30537
|
name: external_exports.string(),
|
|
30525
|
-
disposition:
|
|
30538
|
+
disposition: readRung,
|
|
30526
30539
|
severity: external_exports.enum(["info", "low", "medium", "high", "critical"]).nullable(),
|
|
30527
30540
|
setBy: external_exports.string(),
|
|
30528
30541
|
setAt: external_exports.string()
|
|
30529
30542
|
})),
|
|
30530
|
-
defaultDisposition:
|
|
30543
|
+
defaultDisposition: readRung,
|
|
30531
30544
|
gaps: external_exports.array(gapRow)
|
|
30532
30545
|
});
|
|
30533
30546
|
var defineConfigTool = {
|
|
30534
30547
|
name: "define_config",
|
|
30535
|
-
description: "Read \u2014 or set \u2014 this tenant's DISPOSITION PROFILE: per definition,
|
|
30548
|
+
description: "Read \u2014 or set \u2014 this tenant's DISPOSITION PROFILE: per definition, which rung of the ladder it is at. Called bare it is read-only and lists the definitions somebody has configured, with who set each and when. Pass `set: { definitionId, disposition }` to configure one. The rungs, weakest first: `off` means the definition is NOT EVALUATED and the conformance run names it as skipped; `warn` reports a violation and refuses nothing; `new-code-only` (the DEFAULT for every definition nobody has configured) fails a PR that adds a violation, and violations already on the trunk do not fail it; `everywhere` fails a PR while any violation of the definition is on the trunk, added by the PR or not. Optional `severity` (info|low|medium|high|critical) rides the row for your own triage; it changes nothing about blocking. This is CONFIG, not the definition: the definition stays a pure statement of what is true, and turning it off never edits or retires it \u2014 use define_ratify `supersede` to retire one. Your name is recorded automatically.",
|
|
30536
30549
|
capability: "define",
|
|
30537
30550
|
inputSchema: input.shape,
|
|
30538
30551
|
async handler(raw, ctx) {
|
|
@@ -30555,8 +30568,7 @@ function renderConfig(r) {
|
|
|
30555
30568
|
);
|
|
30556
30569
|
for (const e of r.profile) {
|
|
30557
30570
|
const severity = e.severity === null ? "" : `, severity ${e.severity}`;
|
|
30558
|
-
|
|
30559
|
-
out2.push(` \u2022 ${e.name} (${e.definitionId}): ${e.disposition}${severity} \u2014 ${what}; set by ${e.setBy} on ${e.setAt}`);
|
|
30571
|
+
out2.push(` \u2022 ${e.name} (${e.definitionId}): ${e.disposition}${severity} \u2014 ${RUNG_EFFECT[e.disposition]}; set by ${e.setBy} on ${e.setAt}`);
|
|
30560
30572
|
}
|
|
30561
30573
|
if (r.gaps.length === 0) {
|
|
30562
30574
|
out2.push("gaps: none");
|
|
@@ -30596,7 +30608,7 @@ var definitionDraft = external_exports.object({
|
|
|
30596
30608
|
}),
|
|
30597
30609
|
gated: external_exports.string().nullable().optional(),
|
|
30598
30610
|
/** Absent from older servers. */
|
|
30599
|
-
rung: external_exports.object({ disposition:
|
|
30611
|
+
rung: external_exports.object({ disposition: readRung, means: external_exports.string() }).optional(),
|
|
30600
30612
|
conflicts: external_exports.literal("not checked")
|
|
30601
30613
|
});
|
|
30602
30614
|
var draftAt = external_exports.discriminatedUnion("state", [
|
|
@@ -30718,13 +30730,14 @@ var sliceResult = external_exports.union([
|
|
|
30718
30730
|
agreed: external_exports.boolean(),
|
|
30719
30731
|
agreeCount: external_exports.number(),
|
|
30720
30732
|
// Optional so a core that predates per-leg outcomes still parses.
|
|
30721
|
-
legs: external_exports.object({ nlVsCompiled: cloverLeg, compiledVsWitness: cloverLeg, nlVsWitness: cloverLeg }).optional()
|
|
30733
|
+
legs: external_exports.object({ nlVsCompiled: cloverLeg, compiledVsWitness: cloverLeg, nlVsWitness: cloverLeg }).optional(),
|
|
30734
|
+
ourGaps: external_exports.array(ourGap).optional()
|
|
30722
30735
|
}),
|
|
30723
30736
|
iterations: external_exports.number(),
|
|
30724
30737
|
rungs: external_exports.array(rungReport).optional(),
|
|
30725
30738
|
draft: definitionDraft.optional()
|
|
30726
30739
|
}),
|
|
30727
|
-
external_exports.object({ ok: external_exports.literal(false), bestFailingCandidate: external_exports.unknown(), errors: compileErrors,
|
|
30740
|
+
external_exports.object({ ok: external_exports.literal(false), bestFailingCandidate: external_exports.unknown(), errors: compileErrors, iterations: external_exports.number(), rungs: external_exports.array(rungReport).optional() }),
|
|
30728
30741
|
external_exports.object({ ok: external_exports.literal(false), unavailable: external_exports.string() })
|
|
30729
30742
|
]);
|
|
30730
30743
|
var noteResult = external_exports.discriminatedUnion("kind", [
|
|
@@ -30947,22 +30960,30 @@ function renderAuthorJob(r) {
|
|
|
30947
30960
|
return `define: authoring job ${r.jobId} failed: ${r.error}`;
|
|
30948
30961
|
}
|
|
30949
30962
|
}
|
|
30950
|
-
|
|
30951
|
-
|
|
30952
|
-
|
|
30953
|
-
|
|
30963
|
+
var CLOVER_LEGS = [
|
|
30964
|
+
["nlVsCompiled", "the claim vs the definition in plain words"],
|
|
30965
|
+
["compiledVsWitness", "the definition vs its mutation evidence"],
|
|
30966
|
+
["nlVsWitness", "the claim vs what the definition does on the code"]
|
|
30967
|
+
];
|
|
30968
|
+
function cloverAdvice(c) {
|
|
30969
|
+
const head = `Clover (advice): ${c.agreeCount} of 3 agree.`;
|
|
30970
|
+
if (c.legs === void 0) return head;
|
|
30971
|
+
const legs = c.legs;
|
|
30972
|
+
const lines = CLOVER_LEGS.flatMap(([leg, name]) => legs[leg].outcome === "agree" ? [] : [` \u2022 ${name} (${legs[leg].outcome}): ${legs[leg].reasoning.replace(/\s+/g, " ").trim()}`]);
|
|
30973
|
+
const gaps = c.ourGaps ?? [];
|
|
30974
|
+
const ours = gaps.length === 0 ? [] : [` Abstaining checks had no evidence because of a gap on the platform's side, not something to fix in the definition:`, ...gaps.map((g3) => ` - ${g3.leg} \u2014 ours: ${g3.kind}: ${g3.reason}`)];
|
|
30975
|
+
return [head, ...lines, ...ours].join("\n");
|
|
30954
30976
|
}
|
|
30955
30977
|
function renderSlice(r) {
|
|
30956
30978
|
if ("unavailable" in r) return `could not be authored: ${r.unavailable}`;
|
|
30957
30979
|
const rungs = r.rungs === void 0 || r.rungs.length === 0 ? "" : `
|
|
30958
30980
|
Model calls: ${rungLine(r.rungs)}`;
|
|
30959
30981
|
if (r.ok) {
|
|
30960
|
-
const head = `admitted definition ${r.definitionId} v${r.version} in ${r.iterations} iteration(s).
|
|
30982
|
+
const head = `admitted definition ${r.definitionId} v${r.version} in ${r.iterations} iteration(s).
|
|
30983
|
+
${cloverAdvice(r.clover)}`;
|
|
30961
30984
|
return (r.draft === void 0 ? head : `${head}
|
|
30962
30985
|
${renderDraft(r.draft)}`) + rungs;
|
|
30963
30986
|
}
|
|
30964
|
-
if (r.errors.some((e) => e.code === "CLOVER_ABSTAINED")) return `not admitted: it needs a person. No check disagreed; ${ourGapLines(r.ourGaps)}
|
|
30965
|
-
${errorLines(r.errors)}${rungs}`;
|
|
30966
30987
|
return `could not converge in ${r.iterations} iteration(s). Best-failing candidate's errors \u2014
|
|
30967
30988
|
${errorLines(r.errors)}${rungs}`;
|
|
30968
30989
|
}
|
|
@@ -31342,9 +31363,9 @@ var showViolation = external_exports.object({
|
|
|
31342
31363
|
lastSeenAt: external_exports.string(),
|
|
31343
31364
|
snooze: external_exports.object({ until: external_exports.string(), by: external_exports.string(), reason: external_exports.string(), lapsed: external_exports.boolean() }).nullable(),
|
|
31344
31365
|
// The tenant's policy for the definition, beside the ledger's own state. `disposition` on this
|
|
31345
|
-
// object is the LEDGER's (open/snoozed/resolved); this is warn
|
|
31366
|
+
// object is the LEDGER's (open/snoozed/resolved); this is the rung (off, warn, new-code-only, everywhere).
|
|
31346
31367
|
policy: external_exports.object({
|
|
31347
|
-
disposition:
|
|
31368
|
+
disposition: readRung,
|
|
31348
31369
|
severity: external_exports.enum(["info", "low", "medium", "high", "critical"]).nullable(),
|
|
31349
31370
|
source: external_exports.enum(["profile", "default"])
|
|
31350
31371
|
})
|
|
@@ -31467,7 +31488,7 @@ function violationLines(v) {
|
|
|
31467
31488
|
const set2 = v.policy.source === "default" ? " (default \u2014 nobody configured it)" : "";
|
|
31468
31489
|
const lines = [
|
|
31469
31490
|
` \u2022 ${v.repo}: ${v.status} [${v.disposition}] \u2014 first seen at ${v.firstSeenCommit} (${v.firstSeenAt}), last seen at ${v.lastSeenCommit} (${v.lastSeenAt})`,
|
|
31470
|
-
` policy: ${v.policy.disposition}${severity}${set2}
|
|
31491
|
+
` policy: ${v.policy.disposition}${severity}${set2} \u2014 ${RUNG_EFFECT[v.policy.disposition]}.`
|
|
31471
31492
|
];
|
|
31472
31493
|
if (v.snooze !== null) {
|
|
31473
31494
|
const lapsed = v.snooze.lapsed ? " (LAPSED \u2014 back in the gating lane)" : "";
|
|
@@ -48673,7 +48694,7 @@ var workReadTools = createWorkReadToolProviders({ capability: "work" });
|
|
|
48673
48694
|
var bundledProviders = [src_default2, src_default, tension_default, ...defineTools, ...decisionTools, ...captureTools, ...buildTools, secureTool, ...workTools, ...workReadTools];
|
|
48674
48695
|
|
|
48675
48696
|
// package.json
|
|
48676
|
-
var version2 = "0.4.
|
|
48697
|
+
var version2 = "0.4.50";
|
|
48677
48698
|
|
|
48678
48699
|
// src/server.ts
|
|
48679
48700
|
var SERVER_VERSION = version2;
|