@subseam/mcp 0.4.36 → 0.4.37
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 +29 -10
- 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}.`;
|
|
@@ -48692,7 +48711,7 @@ var workReadTools = createWorkReadToolProviders({ capability: "work" });
|
|
|
48692
48711
|
var bundledProviders = [src_default2, src_default, tension_default, ...defineTools, ...decisionTools, ...captureTools, ...buildTools, secureTool, ...workTools, ...workReadTools];
|
|
48693
48712
|
|
|
48694
48713
|
// package.json
|
|
48695
|
-
var version2 = "0.4.
|
|
48714
|
+
var version2 = "0.4.37";
|
|
48696
48715
|
|
|
48697
48716
|
// src/server.ts
|
|
48698
48717
|
var SERVER_VERSION = version2;
|