@subseam/mcp 0.4.18 → 0.4.20
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 +34 -7
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -28695,6 +28695,7 @@ init_sdk();
|
|
|
28695
28695
|
|
|
28696
28696
|
// ../inference/src/providers/openai-compatible.ts
|
|
28697
28697
|
init_esm_shims();
|
|
28698
|
+
import { randomUUID as randomUUID6 } from "crypto";
|
|
28698
28699
|
|
|
28699
28700
|
// ../inference/src/metering/usage-ledger.ts
|
|
28700
28701
|
init_esm_shims();
|
|
@@ -30674,7 +30675,7 @@ var rungReport = external_exports.object({
|
|
|
30674
30675
|
calls: external_exports.number(),
|
|
30675
30676
|
outcome: external_exports.enum(["admitted", "exhausted"])
|
|
30676
30677
|
});
|
|
30677
|
-
var
|
|
30678
|
+
var authorResult = external_exports.discriminatedUnion("ok", [
|
|
30678
30679
|
external_exports.object({
|
|
30679
30680
|
ok: external_exports.literal(true),
|
|
30680
30681
|
definitionId: external_exports.string(),
|
|
@@ -30687,6 +30688,11 @@ var authorBody = external_exports.discriminatedUnion("ok", [
|
|
|
30687
30688
|
}),
|
|
30688
30689
|
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
30690
|
]);
|
|
30691
|
+
var authorBody = external_exports.discriminatedUnion("status", [
|
|
30692
|
+
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("running"), wait: external_exports.string().optional() }),
|
|
30693
|
+
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("failed"), error: external_exports.string() }),
|
|
30694
|
+
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("completed"), result: authorResult })
|
|
30695
|
+
]);
|
|
30690
30696
|
var seedBody = external_exports.discriminatedUnion("status", [
|
|
30691
30697
|
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("submitted"), deduped: external_exports.boolean() }),
|
|
30692
30698
|
external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("running") }),
|
|
@@ -30745,11 +30751,13 @@ var input2 = external_exports.object({
|
|
|
30745
30751
|
commit: external_exports.string().min(1).optional(),
|
|
30746
30752
|
jobId: external_exports.string().min(1).optional()
|
|
30747
30753
|
}).optional(),
|
|
30754
|
+
// Reads an authoring job a prior `nlIntent` call left running; takes no other arm beside it.
|
|
30755
|
+
authorJobId: external_exports.string().min(1).optional(),
|
|
30748
30756
|
gap: external_exports.object({ construct: external_exports.string().min(1), witness: external_exports.string().min(1), issue: external_exports.number().int().positive() }).optional()
|
|
30749
30757
|
});
|
|
30750
30758
|
var defineTool = {
|
|
30751
30759
|
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.",
|
|
30760
|
+
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
30761
|
capability: "define",
|
|
30754
30762
|
inputSchema: input2.shape,
|
|
30755
30763
|
async handler(raw, ctx) {
|
|
@@ -30774,6 +30782,12 @@ var defineTool = {
|
|
|
30774
30782
|
}
|
|
30775
30783
|
return mineMode(args2.mine, ctx);
|
|
30776
30784
|
}
|
|
30785
|
+
if (args2.authorJobId !== void 0) {
|
|
30786
|
+
if (args2.source !== void 0 || args2.nlIntent !== void 0) {
|
|
30787
|
+
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." };
|
|
30788
|
+
}
|
|
30789
|
+
return authorMode({ authorJobId: args2.authorJobId }, ctx);
|
|
30790
|
+
}
|
|
30777
30791
|
const hasSource = args2.source !== void 0;
|
|
30778
30792
|
const hasIntent = args2.nlIntent !== void 0;
|
|
30779
30793
|
if (hasSource === hasIntent) {
|
|
@@ -30801,10 +30815,7 @@ var defineTool = {
|
|
|
30801
30815
|
...args2.createdBy !== void 0 ? { createdBy: args2.createdBy } : {},
|
|
30802
30816
|
...args2.basis !== void 0 ? { basis: args2.basis } : {}
|
|
30803
30817
|
};
|
|
30804
|
-
|
|
30805
|
-
const body2 = readBody(authorBody, wire, "define", "define-author");
|
|
30806
|
-
if (!body2.ok) return { text: body2.text };
|
|
30807
|
-
return { text: renderAuthor(body2.value) };
|
|
30818
|
+
return authorMode(payload2, ctx);
|
|
30808
30819
|
}
|
|
30809
30820
|
if (args2.dry_run === true) {
|
|
30810
30821
|
const payload2 = { repo: args2.repo, source: args2.source, ...args2.commit !== void 0 ? { commit: args2.commit } : {} };
|
|
@@ -30841,12 +30852,28 @@ async function mineMode(mine, ctx) {
|
|
|
30841
30852
|
if (!body2.ok) return { text: body2.text };
|
|
30842
30853
|
return { text: renderSeed(body2.value) };
|
|
30843
30854
|
}
|
|
30855
|
+
async function authorMode(payload, ctx) {
|
|
30856
|
+
const wire = await ctx.gateway.invoke("define-author", payload);
|
|
30857
|
+
const body2 = readBody(authorBody, wire, "define", "define-author");
|
|
30858
|
+
if (!body2.ok) return { text: body2.text };
|
|
30859
|
+
return { text: renderAuthorJob(body2.value) };
|
|
30860
|
+
}
|
|
30844
30861
|
function errorLines(errors) {
|
|
30845
30862
|
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
30863
|
}
|
|
30847
30864
|
function rungLine(rungs) {
|
|
30848
30865
|
return rungs.map((g3) => `${g3.rung} (${g3.model}): ${g3.calls} call${g3.calls === 1 ? "" : "s"}, ${g3.outcome}`).join(" \u2192 ");
|
|
30849
30866
|
}
|
|
30867
|
+
function renderAuthorJob(r) {
|
|
30868
|
+
switch (r.status) {
|
|
30869
|
+
case "completed":
|
|
30870
|
+
return renderAuthor(r.result);
|
|
30871
|
+
case "running":
|
|
30872
|
+
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.`;
|
|
30873
|
+
case "failed":
|
|
30874
|
+
return `define: authoring job ${r.jobId} failed: ${r.error}`;
|
|
30875
|
+
}
|
|
30876
|
+
}
|
|
30850
30877
|
function renderAuthor(r) {
|
|
30851
30878
|
const rungs = r.rungs === void 0 || r.rungs.length === 0 ? "" : `
|
|
30852
30879
|
Model calls: ${rungLine(r.rungs)}`;
|
|
@@ -48353,7 +48380,7 @@ var workReadTools = createWorkReadToolProviders({ capability: "work" });
|
|
|
48353
48380
|
var bundledProviders = [src_default2, src_default, tension_default, ...defineTools, ...decisionTools, ...captureTools, ...buildTools, secureTool, ...workTools, ...workReadTools];
|
|
48354
48381
|
|
|
48355
48382
|
// package.json
|
|
48356
|
-
var version2 = "0.4.
|
|
48383
|
+
var version2 = "0.4.20";
|
|
48357
48384
|
|
|
48358
48385
|
// src/server.ts
|
|
48359
48386
|
var SERVER_VERSION = version2;
|