@subseam/mcp 0.4.18 → 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 +33 -7
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -30674,7 +30674,7 @@ var rungReport = external_exports.object({
|
|
|
30674
30674
|
calls: external_exports.number(),
|
|
30675
30675
|
outcome: external_exports.enum(["admitted", "exhausted"])
|
|
30676
30676
|
});
|
|
30677
|
-
var
|
|
30677
|
+
var authorResult = external_exports.discriminatedUnion("ok", [
|
|
30678
30678
|
external_exports.object({
|
|
30679
30679
|
ok: external_exports.literal(true),
|
|
30680
30680
|
definitionId: external_exports.string(),
|
|
@@ -30687,6 +30687,11 @@ var authorBody = external_exports.discriminatedUnion("ok", [
|
|
|
30687
30687
|
}),
|
|
30688
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() })
|
|
30689
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
|
+
]);
|
|
30690
30695
|
var seedBody = external_exports.discriminatedUnion("status", [
|
|
30691
30696
|
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("submitted"), deduped: external_exports.boolean() }),
|
|
30692
30697
|
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("running") }),
|
|
@@ -30745,11 +30750,13 @@ var input2 = external_exports.object({
|
|
|
30745
30750
|
commit: external_exports.string().min(1).optional(),
|
|
30746
30751
|
jobId: external_exports.string().min(1).optional()
|
|
30747
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(),
|
|
30748
30755
|
gap: external_exports.object({ construct: external_exports.string().min(1), witness: external_exports.string().min(1), issue: external_exports.number().int().positive() }).optional()
|
|
30749
30756
|
});
|
|
30750
30757
|
var defineTool = {
|
|
30751
30758
|
name: "define",
|
|
30752
|
-
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.",
|
|
30753
30760
|
capability: "define",
|
|
30754
30761
|
inputSchema: input2.shape,
|
|
30755
30762
|
async handler(raw, ctx) {
|
|
@@ -30774,6 +30781,12 @@ var defineTool = {
|
|
|
30774
30781
|
}
|
|
30775
30782
|
return mineMode(args2.mine, ctx);
|
|
30776
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
|
+
}
|
|
30777
30790
|
const hasSource = args2.source !== void 0;
|
|
30778
30791
|
const hasIntent = args2.nlIntent !== void 0;
|
|
30779
30792
|
if (hasSource === hasIntent) {
|
|
@@ -30801,10 +30814,7 @@ var defineTool = {
|
|
|
30801
30814
|
...args2.createdBy !== void 0 ? { createdBy: args2.createdBy } : {},
|
|
30802
30815
|
...args2.basis !== void 0 ? { basis: args2.basis } : {}
|
|
30803
30816
|
};
|
|
30804
|
-
|
|
30805
|
-
const body2 = readBody(authorBody, wire, "define", "define-author");
|
|
30806
|
-
if (!body2.ok) return { text: body2.text };
|
|
30807
|
-
return { text: renderAuthor(body2.value) };
|
|
30817
|
+
return authorMode(payload2, ctx);
|
|
30808
30818
|
}
|
|
30809
30819
|
if (args2.dry_run === true) {
|
|
30810
30820
|
const payload2 = { repo: args2.repo, source: args2.source, ...args2.commit !== void 0 ? { commit: args2.commit } : {} };
|
|
@@ -30841,12 +30851,28 @@ async function mineMode(mine, ctx) {
|
|
|
30841
30851
|
if (!body2.ok) return { text: body2.text };
|
|
30842
30852
|
return { text: renderSeed(body2.value) };
|
|
30843
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
|
+
}
|
|
30844
30860
|
function errorLines(errors) {
|
|
30845
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");
|
|
30846
30862
|
}
|
|
30847
30863
|
function rungLine(rungs) {
|
|
30848
30864
|
return rungs.map((g3) => `${g3.rung} (${g3.model}): ${g3.calls} call${g3.calls === 1 ? "" : "s"}, ${g3.outcome}`).join(" \u2192 ");
|
|
30849
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
|
+
}
|
|
30850
30876
|
function renderAuthor(r) {
|
|
30851
30877
|
const rungs = r.rungs === void 0 || r.rungs.length === 0 ? "" : `
|
|
30852
30878
|
Model calls: ${rungLine(r.rungs)}`;
|
|
@@ -48353,7 +48379,7 @@ var workReadTools = createWorkReadToolProviders({ capability: "work" });
|
|
|
48353
48379
|
var bundledProviders = [src_default2, src_default, tension_default, ...defineTools, ...decisionTools, ...captureTools, ...buildTools, secureTool, ...workTools, ...workReadTools];
|
|
48354
48380
|
|
|
48355
48381
|
// package.json
|
|
48356
|
-
var version2 = "0.4.
|
|
48382
|
+
var version2 = "0.4.19";
|
|
48357
48383
|
|
|
48358
48384
|
// src/server.ts
|
|
48359
48385
|
var SERVER_VERSION = version2;
|