@subseam/mcp 0.4.17 → 0.4.19
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 +38 -9
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -30592,6 +30592,8 @@ var definitionDraft = external_exports.object({
|
|
|
30592
30592
|
notEvaluated: external_exports.string().nullable().optional()
|
|
30593
30593
|
}),
|
|
30594
30594
|
gated: external_exports.string().nullable().optional(),
|
|
30595
|
+
/** Absent from older servers. */
|
|
30596
|
+
rung: external_exports.object({ disposition: external_exports.enum(["block", "warn", "off"]), means: external_exports.string() }).optional(),
|
|
30595
30597
|
conflicts: external_exports.literal("not checked")
|
|
30596
30598
|
});
|
|
30597
30599
|
function notComputedLines(uncomputed) {
|
|
@@ -30626,8 +30628,9 @@ function renderDraft(d) {
|
|
|
30626
30628
|
const tip = d.atTip.failures.length > 0 ? `${tipAt}: ${d.atTip.failures.length} failing: ` + shown.join("; ") + (more > 0 ? `; \u2026 and ${more} more` : "") : notEvaluated !== null ? `${tipAt}: not evaluated (${notEvaluated})` : `${tipAt}: holds`;
|
|
30627
30629
|
const tipRest = d.atTip.failures.length > 0 && notEvaluated !== null ? [`${tipAt}, the rest was not evaluated (${notEvaluated})`] : [];
|
|
30628
30630
|
const open7 = notComputedLines(d.atTip.uncomputed);
|
|
30629
|
-
|
|
30630
|
-
return [` ${d.statement}`,
|
|
30631
|
+
const rung = d.rung === void 0 ? [] : [` on approval, in force at ${d.rung.means}`];
|
|
30632
|
+
if (typeof d.gated === "string") return [` ${d.statement}`, ` gated: ${d.gated} This definition is not evaluated.`, ...rung, ` conflicts: ${d.conflicts}`].join("\n");
|
|
30633
|
+
return [` ${d.statement}`, ...exampleLines(d.examples), ` history: ${history}`, ...floor, tip, ...tipRest, ...open7, ...rung, ` conflicts: ${d.conflicts}`].join("\n");
|
|
30631
30634
|
}
|
|
30632
30635
|
|
|
30633
30636
|
// ../define/src/tool/define.ts
|
|
@@ -30671,7 +30674,7 @@ var rungReport = external_exports.object({
|
|
|
30671
30674
|
calls: external_exports.number(),
|
|
30672
30675
|
outcome: external_exports.enum(["admitted", "exhausted"])
|
|
30673
30676
|
});
|
|
30674
|
-
var
|
|
30677
|
+
var authorResult = external_exports.discriminatedUnion("ok", [
|
|
30675
30678
|
external_exports.object({
|
|
30676
30679
|
ok: external_exports.literal(true),
|
|
30677
30680
|
definitionId: external_exports.string(),
|
|
@@ -30684,6 +30687,11 @@ var authorBody = external_exports.discriminatedUnion("ok", [
|
|
|
30684
30687
|
}),
|
|
30685
30688
|
external_exports.object({ ok: external_exports.literal(false), bestFailingCandidate: external_exports.unknown(), errors: compileErrors, iterations: external_exports.number(), rungs: external_exports.array(rungReport).optional() })
|
|
30686
30689
|
]);
|
|
30690
|
+
var authorBody = external_exports.discriminatedUnion("status", [
|
|
30691
|
+
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("running"), wait: external_exports.string().optional() }),
|
|
30692
|
+
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("failed"), error: external_exports.string() }),
|
|
30693
|
+
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("completed"), result: authorResult })
|
|
30694
|
+
]);
|
|
30687
30695
|
var seedBody = external_exports.discriminatedUnion("status", [
|
|
30688
30696
|
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("submitted"), deduped: external_exports.boolean() }),
|
|
30689
30697
|
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("running") }),
|
|
@@ -30742,11 +30750,13 @@ var input2 = external_exports.object({
|
|
|
30742
30750
|
commit: external_exports.string().min(1).optional(),
|
|
30743
30751
|
jobId: external_exports.string().min(1).optional()
|
|
30744
30752
|
}).optional(),
|
|
30753
|
+
// Reads an authoring job a prior `nlIntent` call left running; takes no other arm beside it.
|
|
30754
|
+
authorJobId: external_exports.string().min(1).optional(),
|
|
30745
30755
|
gap: external_exports.object({ construct: external_exports.string().min(1), witness: external_exports.string().min(1), issue: external_exports.number().int().positive() }).optional()
|
|
30746
30756
|
});
|
|
30747
30757
|
var defineTool = {
|
|
30748
30758
|
name: "define",
|
|
30749
|
-
description: "Write a definition into this tenant's governing corpus. Pass exactly one of `source` (the SDL definition object \u2014 deterministic, no LLM) or `nlIntent` (a natural-language intent, authored through the CEGIS loop), plus `repo` (org-qualified) and optional `commit` (defaults to resolved tip). Pass `basis` on either arm: free text citing what the definition stood on \u2014 the source doc plus its section (there is no fixed vocabulary), or `capture-note:<id>` for a captured note, which also marks that note formalized. It is required in effect with `source`; an admission that cites nothing is refused. With `nlIntent` it defaults to the intent sentence. `dry_run: true` with `source` validates against the live graph and admits NOTHING, returning per-gate errors with repair hints. `dry_run: true` with `source` and no `repo` answers only whether the language can say it (bind, capability and strength are deferred until a repo is named). `mine: {repo}` submits a whole-repo candidate mining pass instead (async \u2014 poll with `mine: {jobId}`). New versions land defaulted until approved. `gap: { construct, witness, issue }` records a construct the language cannot say yet (witness is the file:line that needed it) and admits nothing.",
|
|
30759
|
+
description: "Write a definition into this tenant's governing corpus. Pass exactly one of `source` (the SDL definition object \u2014 deterministic, no LLM) or `nlIntent` (a natural-language intent, authored through the CEGIS loop), plus `repo` (org-qualified) and optional `commit` (defaults to resolved tip). Pass `basis` on either arm: free text citing what the definition stood on \u2014 the source doc plus its section (there is no fixed vocabulary), or `capture-note:<id>` for a captured note, which also marks that note formalized. It is required in effect with `source`; an admission that cites nothing is refused. With `nlIntent` it defaults to the intent sentence. Authoring answers within about 45 s; if it is still queued or iterating it returns a job id: call `define` again with `authorJobId` to read it. `dry_run: true` with `source` validates against the live graph and admits NOTHING, returning per-gate errors with repair hints. `dry_run: true` with `source` and no `repo` answers only whether the language can say it (bind, capability and strength are deferred until a repo is named). `mine: {repo}` submits a whole-repo candidate mining pass instead (async \u2014 poll with `mine: {jobId}`). New versions land defaulted until approved. `gap: { construct, witness, issue }` records a construct the language cannot say yet (witness is the file:line that needed it) and admits nothing.",
|
|
30750
30760
|
capability: "define",
|
|
30751
30761
|
inputSchema: input2.shape,
|
|
30752
30762
|
async handler(raw, ctx) {
|
|
@@ -30771,6 +30781,12 @@ var defineTool = {
|
|
|
30771
30781
|
}
|
|
30772
30782
|
return mineMode(args2.mine, ctx);
|
|
30773
30783
|
}
|
|
30784
|
+
if (args2.authorJobId !== void 0) {
|
|
30785
|
+
if (args2.source !== void 0 || args2.nlIntent !== void 0) {
|
|
30786
|
+
return { text: "define: `authorJobId` reads an authoring job already submitted and takes no `source` or `nlIntent` beside it \u2014 read the job, or submit a new intent, not both." };
|
|
30787
|
+
}
|
|
30788
|
+
return authorMode({ authorJobId: args2.authorJobId }, ctx);
|
|
30789
|
+
}
|
|
30774
30790
|
const hasSource = args2.source !== void 0;
|
|
30775
30791
|
const hasIntent = args2.nlIntent !== void 0;
|
|
30776
30792
|
if (hasSource === hasIntent) {
|
|
@@ -30798,10 +30814,7 @@ var defineTool = {
|
|
|
30798
30814
|
...args2.createdBy !== void 0 ? { createdBy: args2.createdBy } : {},
|
|
30799
30815
|
...args2.basis !== void 0 ? { basis: args2.basis } : {}
|
|
30800
30816
|
};
|
|
30801
|
-
|
|
30802
|
-
const body2 = readBody(authorBody, wire, "define", "define-author");
|
|
30803
|
-
if (!body2.ok) return { text: body2.text };
|
|
30804
|
-
return { text: renderAuthor(body2.value) };
|
|
30817
|
+
return authorMode(payload2, ctx);
|
|
30805
30818
|
}
|
|
30806
30819
|
if (args2.dry_run === true) {
|
|
30807
30820
|
const payload2 = { repo: args2.repo, source: args2.source, ...args2.commit !== void 0 ? { commit: args2.commit } : {} };
|
|
@@ -30838,12 +30851,28 @@ async function mineMode(mine, ctx) {
|
|
|
30838
30851
|
if (!body2.ok) return { text: body2.text };
|
|
30839
30852
|
return { text: renderSeed(body2.value) };
|
|
30840
30853
|
}
|
|
30854
|
+
async function authorMode(payload, ctx) {
|
|
30855
|
+
const wire = await ctx.gateway.invoke("define-author", payload);
|
|
30856
|
+
const body2 = readBody(authorBody, wire, "define", "define-author");
|
|
30857
|
+
if (!body2.ok) return { text: body2.text };
|
|
30858
|
+
return { text: renderAuthorJob(body2.value) };
|
|
30859
|
+
}
|
|
30841
30860
|
function errorLines(errors) {
|
|
30842
30861
|
return errors.map((e) => ` \u2022 [${e.stage}] ${e.pointer}: ${e.message}${e.repair ? ` (fix: ${e.repair.hint}${e.repair.candidates && e.repair.candidates.length > 0 ? `: ${e.repair.candidates.join(", ")}` : ""})` : ""}`).join("\n");
|
|
30843
30862
|
}
|
|
30844
30863
|
function rungLine(rungs) {
|
|
30845
30864
|
return rungs.map((g3) => `${g3.rung} (${g3.model}): ${g3.calls} call${g3.calls === 1 ? "" : "s"}, ${g3.outcome}`).join(" \u2192 ");
|
|
30846
30865
|
}
|
|
30866
|
+
function renderAuthorJob(r) {
|
|
30867
|
+
switch (r.status) {
|
|
30868
|
+
case "completed":
|
|
30869
|
+
return renderAuthor(r.result);
|
|
30870
|
+
case "running":
|
|
30871
|
+
return `define: authoring job ${r.jobId} is still running (queued behind the shared model line or iterating). Call define with authorJobId: "${r.jobId}" to read it.`;
|
|
30872
|
+
case "failed":
|
|
30873
|
+
return `define: authoring job ${r.jobId} failed: ${r.error}`;
|
|
30874
|
+
}
|
|
30875
|
+
}
|
|
30847
30876
|
function renderAuthor(r) {
|
|
30848
30877
|
const rungs = r.rungs === void 0 || r.rungs.length === 0 ? "" : `
|
|
30849
30878
|
Model calls: ${rungLine(r.rungs)}`;
|
|
@@ -48350,7 +48379,7 @@ var workReadTools = createWorkReadToolProviders({ capability: "work" });
|
|
|
48350
48379
|
var bundledProviders = [src_default2, src_default, tension_default, ...defineTools, ...decisionTools, ...captureTools, ...buildTools, secureTool, ...workTools, ...workReadTools];
|
|
48351
48380
|
|
|
48352
48381
|
// package.json
|
|
48353
|
-
var version2 = "0.4.
|
|
48382
|
+
var version2 = "0.4.19";
|
|
48354
48383
|
|
|
48355
48384
|
// src/server.ts
|
|
48356
48385
|
var SERVER_VERSION = version2;
|