@subseam/mcp 0.4.36 → 0.4.38
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 +49 -13
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -30668,7 +30668,7 @@ var sayBody = external_exports.discriminatedUnion("ok", [
|
|
|
30668
30668
|
external_exports.object({ ok: external_exports.literal(true), canonicalHash: external_exports.string(), deferred: external_exports.tuple([external_exports.literal("bind"), external_exports.literal("capability"), external_exports.literal("strength")]) }),
|
|
30669
30669
|
external_exports.object({ ok: external_exports.literal(false), errors: compileErrors })
|
|
30670
30670
|
]);
|
|
30671
|
-
var
|
|
30671
|
+
var admittedBody = external_exports.discriminatedUnion("ok", [
|
|
30672
30672
|
external_exports.object({
|
|
30673
30673
|
ok: external_exports.literal(true),
|
|
30674
30674
|
definitionId: external_exports.string(),
|
|
@@ -30679,6 +30679,11 @@ var admitBody = external_exports.discriminatedUnion("ok", [
|
|
|
30679
30679
|
}),
|
|
30680
30680
|
external_exports.object({ ok: external_exports.literal(false), errors: compileErrors })
|
|
30681
30681
|
]);
|
|
30682
|
+
var admitJobBody = external_exports.discriminatedUnion("status", [
|
|
30683
|
+
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("running"), wait: external_exports.string().optional() }),
|
|
30684
|
+
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("failed"), error: external_exports.string() })
|
|
30685
|
+
]);
|
|
30686
|
+
var admitBody = external_exports.union([admittedBody, admitJobBody]);
|
|
30682
30687
|
var gapBody = external_exports.discriminatedUnion("kind", [
|
|
30683
30688
|
external_exports.object({ kind: external_exports.literal("recorded") }),
|
|
30684
30689
|
external_exports.object({ kind: external_exports.literal("known"), row: gapRow })
|
|
@@ -30784,11 +30789,13 @@ var input2 = external_exports.object({
|
|
|
30784
30789
|
}).optional(),
|
|
30785
30790
|
// Reads an authoring job a prior `nlIntent` call left running; takes no other arm beside it.
|
|
30786
30791
|
authorJobId: external_exports.string().min(1).optional(),
|
|
30792
|
+
// Reads an admission a prior `source` call left running; takes no other arm beside it.
|
|
30793
|
+
admitJobId: external_exports.string().min(1).optional(),
|
|
30787
30794
|
gap: external_exports.object({ construct: external_exports.string().min(1), witness: external_exports.string().min(1), issue: external_exports.number().int().positive() }).optional()
|
|
30788
30795
|
});
|
|
30789
30796
|
var defineTool = {
|
|
30790
30797
|
name: "define",
|
|
30791
|
-
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 note: your own agent decomposes it into slices by pull \u2014 the first call answers with the task to pull, then re-issue the same call unchanged \u2014 and each slice is 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 note, with the slice number appended. 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.",
|
|
30798
|
+
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 note: your own agent decomposes it into slices by pull \u2014 the first call answers with the task to pull, then re-issue the same call unchanged \u2014 and each slice is 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 note, with the slice number appended. 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. An admission of `source` answers the same way: a job id still running is read with `admitJobId`. `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.",
|
|
30792
30799
|
capability: "define",
|
|
30793
30800
|
inputSchema: input2.shape,
|
|
30794
30801
|
async handler(raw, ctx) {
|
|
@@ -30819,6 +30826,12 @@ var defineTool = {
|
|
|
30819
30826
|
}
|
|
30820
30827
|
return authorMode({ authorJobId: args2.authorJobId }, ctx);
|
|
30821
30828
|
}
|
|
30829
|
+
if (args2.admitJobId !== void 0) {
|
|
30830
|
+
if (args2.source !== void 0 || args2.nlIntent !== void 0) {
|
|
30831
|
+
return { text: "define: `admitJobId` reads an admission already submitted and takes no `source` or `nlIntent` beside it \u2014 read the job, or submit a new definition, not both." };
|
|
30832
|
+
}
|
|
30833
|
+
return admitMode({ admitJobId: args2.admitJobId }, ctx);
|
|
30834
|
+
}
|
|
30822
30835
|
const hasSource = args2.source !== void 0;
|
|
30823
30836
|
const hasIntent = args2.nlIntent !== void 0;
|
|
30824
30837
|
if (hasSource === hasIntent) {
|
|
@@ -30853,8 +30866,8 @@ var defineTool = {
|
|
|
30853
30866
|
const wire = await ctx.gateway.invoke("define-compile", payload2);
|
|
30854
30867
|
const body2 = readBody(compileBody, wire, "define", "define-compile");
|
|
30855
30868
|
if (!body2.ok) return { text: body2.text };
|
|
30856
|
-
const
|
|
30857
|
-
return { text: renderCompile(
|
|
30869
|
+
const result = body2.value;
|
|
30870
|
+
return { text: renderCompile(result) };
|
|
30858
30871
|
}
|
|
30859
30872
|
const payload = {
|
|
30860
30873
|
repo: args2.repo,
|
|
@@ -30863,13 +30876,16 @@ var defineTool = {
|
|
|
30863
30876
|
...args2.createdBy !== void 0 ? { createdBy: args2.createdBy } : {},
|
|
30864
30877
|
...args2.basis !== void 0 ? { basis: args2.basis } : {}
|
|
30865
30878
|
};
|
|
30866
|
-
|
|
30867
|
-
const admitted = readBody(admitBody, rawAdmit, "define", "define-admit");
|
|
30868
|
-
if (!admitted.ok) return { text: admitted.text };
|
|
30869
|
-
const result = admitted.value;
|
|
30870
|
-
return { text: renderAdmit(result) };
|
|
30879
|
+
return admitMode(payload, ctx);
|
|
30871
30880
|
}
|
|
30872
30881
|
};
|
|
30882
|
+
async function admitMode(payload, ctx) {
|
|
30883
|
+
const rawAdmit = await ctx.gateway.invoke("define-admit", payload);
|
|
30884
|
+
const isJob = typeof rawAdmit === "object" && rawAdmit !== null && "status" in rawAdmit;
|
|
30885
|
+
const admitted = readBody(isJob ? admitJobBody : admittedBody, rawAdmit, "define", "define-admit");
|
|
30886
|
+
if (!admitted.ok) return { text: admitted.text };
|
|
30887
|
+
return { text: renderAdmit(admitted.value) };
|
|
30888
|
+
}
|
|
30873
30889
|
async function mineMode(mine, ctx) {
|
|
30874
30890
|
if (mine.jobId !== void 0 && mine.repo !== void 0) {
|
|
30875
30891
|
return { text: "define: `mine` takes EITHER `repo` (+ optional `commit`) to submit a pass OR `jobId` to poll one \u2014 not both." };
|
|
@@ -30948,6 +30964,9 @@ function renderSay(r) {
|
|
|
30948
30964
|
return "define (dry run): cannot say it: " + first.code + " at " + first.pointer + "\n" + errorLines(r.errors);
|
|
30949
30965
|
}
|
|
30950
30966
|
function renderAdmit(r) {
|
|
30967
|
+
if ("status" in r) {
|
|
30968
|
+
return r.status === "running" ? `define: admission job ${r.jobId} is still running (the gates and the first verdict). Call define with admitJobId: "${r.jobId}" to read it.` : `define: admission job ${r.jobId} failed: ${r.error}`;
|
|
30969
|
+
}
|
|
30951
30970
|
if (r.ok) {
|
|
30952
30971
|
const standing = r.changeClass === "strengthen" ? "carries its predecessor's standing forward" : r.changeClass === "initial" ? "defaulted until approved" : "re-enters review (defaulted until approved)";
|
|
30953
30972
|
const head = `define: admitted ${r.definitionId} v${r.version} [${r.changeClass}] \u2014 ${standing}.`;
|
|
@@ -31524,6 +31543,10 @@ var conformanceBody = external_exports.object({
|
|
|
31524
31543
|
staticUnevaluable: external_exports.number()
|
|
31525
31544
|
})
|
|
31526
31545
|
});
|
|
31546
|
+
var conformanceJobBody = external_exports.union([
|
|
31547
|
+
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("running") }),
|
|
31548
|
+
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("failed"), error: external_exports.string() })
|
|
31549
|
+
]);
|
|
31527
31550
|
var generationBody = external_exports.object({
|
|
31528
31551
|
runId: external_exports.string(),
|
|
31529
31552
|
planned: external_exports.number(),
|
|
@@ -31536,7 +31559,8 @@ var generationBody = external_exports.object({
|
|
|
31536
31559
|
})
|
|
31537
31560
|
});
|
|
31538
31561
|
var input4 = external_exports.object({
|
|
31539
|
-
repo: external_exports.string().min(1),
|
|
31562
|
+
repo: external_exports.string().min(1).optional(),
|
|
31563
|
+
conformanceJobId: external_exports.string().min(1).optional(),
|
|
31540
31564
|
commit: external_exports.string().min(1).optional(),
|
|
31541
31565
|
definitionIds: external_exports.array(external_exports.string().min(1)).min(1).optional(),
|
|
31542
31566
|
baseOrdinal: external_exports.number().int().nonnegative().optional(),
|
|
@@ -31544,18 +31568,30 @@ var input4 = external_exports.object({
|
|
|
31544
31568
|
});
|
|
31545
31569
|
var evalTool = {
|
|
31546
31570
|
name: "eval",
|
|
31547
|
-
description: "Evaluate definitions against a repo's code as-built. With `definitionIds`: verdicts for those definitions, plus generated-and-executed behavioral checks (banked witnesses) where applicable. Without: the whole admitted corpus. Provide `repo` and optional `commit` (defaults to resolved tip). Returns conformant/violated/unevaluable per definition; violations carry a witness. Approved (store: ratified) MUST/MUST-NEVER violations are blocking.",
|
|
31571
|
+
description: "Evaluate definitions against a repo's code as-built. With `definitionIds`: verdicts for those definitions, plus generated-and-executed behavioral checks (banked witnesses) where applicable. Without: the whole admitted corpus. Provide `repo` and optional `commit` (defaults to resolved tip). Returns conformant/violated/unevaluable per definition; violations carry a witness. Approved (store: ratified) MUST/MUST-NEVER violations are blocking. A pass that is still evaluating answers a job id: call again with `conformanceJobId` to read it.",
|
|
31548
31572
|
capability: "define",
|
|
31549
31573
|
inputSchema: input4.shape,
|
|
31550
31574
|
async handler(raw, ctx) {
|
|
31551
31575
|
const args2 = input4.parse(raw);
|
|
31552
|
-
|
|
31576
|
+
if (args2.conformanceJobId !== void 0 && args2.repo !== void 0) {
|
|
31577
|
+
return { text: "eval: `conformanceJobId` reads a conformance pass already submitted and takes no `repo` beside it \u2014 read the job, or submit a new pass, not both." };
|
|
31578
|
+
}
|
|
31579
|
+
if (args2.conformanceJobId === void 0 && args2.repo === void 0) {
|
|
31580
|
+
return { text: "eval: needs `repo` to submit a conformance pass, or `conformanceJobId` to read one." };
|
|
31581
|
+
}
|
|
31582
|
+
const conformancePayload = args2.conformanceJobId !== void 0 ? { conformanceJobId: args2.conformanceJobId } : {
|
|
31553
31583
|
repo: args2.repo,
|
|
31554
31584
|
...args2.commit !== void 0 ? { commit: args2.commit } : {},
|
|
31555
31585
|
...args2.baseOrdinal !== void 0 ? { baseOrdinal: args2.baseOrdinal } : {},
|
|
31556
31586
|
...args2.headOrdinal !== void 0 ? { headOrdinal: args2.headOrdinal } : {}
|
|
31557
31587
|
};
|
|
31558
31588
|
const wire = await ctx.gateway.invoke("define-conformance", conformancePayload);
|
|
31589
|
+
const job = conformanceJobBody.safeParse(wire);
|
|
31590
|
+
if (job.success) {
|
|
31591
|
+
return {
|
|
31592
|
+
text: job.data.status === "running" ? `eval: conformance job ${job.data.jobId} is still evaluating. Call eval again with conformanceJobId: "${job.data.jobId}" to read it.` : `eval: conformance job ${job.data.jobId} failed: ${job.data.error}`
|
|
31593
|
+
};
|
|
31594
|
+
}
|
|
31559
31595
|
const body2 = readBody(conformanceBody, wire, "eval", "define-conformance");
|
|
31560
31596
|
if (!body2.ok) return { text: body2.text };
|
|
31561
31597
|
const report = body2.value;
|
|
@@ -48692,7 +48728,7 @@ var workReadTools = createWorkReadToolProviders({ capability: "work" });
|
|
|
48692
48728
|
var bundledProviders = [src_default2, src_default, tension_default, ...defineTools, ...decisionTools, ...captureTools, ...buildTools, secureTool, ...workTools, ...workReadTools];
|
|
48693
48729
|
|
|
48694
48730
|
// package.json
|
|
48695
|
-
var version2 = "0.4.
|
|
48731
|
+
var version2 = "0.4.38";
|
|
48696
48732
|
|
|
48697
48733
|
// src/server.ts
|
|
48698
48734
|
var SERVER_VERSION = version2;
|