@subseam/mcp 0.4.37 → 0.4.39

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.
Files changed (2) hide show
  1. package/dist/main.js +47 -11
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -30660,10 +30660,15 @@ var compileError = external_exports.object({
30660
30660
  repair: external_exports.object({ hint: external_exports.string(), candidates: external_exports.array(external_exports.string()).optional() }).optional()
30661
30661
  });
30662
30662
  var compileErrors = external_exports.array(compileError);
30663
- var compileBody = external_exports.discriminatedUnion("ok", [
30663
+ var compiledBody = external_exports.discriminatedUnion("ok", [
30664
30664
  external_exports.object({ ok: external_exports.literal(true), boundAtCommit: external_exports.string(), draft: definitionDraft.optional() }),
30665
30665
  external_exports.object({ ok: external_exports.literal(false), errors: compileErrors })
30666
30666
  ]);
30667
+ var compileJobBody = external_exports.discriminatedUnion("status", [
30668
+ external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("running"), wait: external_exports.string().optional() }),
30669
+ external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("failed"), error: external_exports.string() })
30670
+ ]);
30671
+ var compileBody = external_exports.union([compiledBody, compileJobBody]);
30667
30672
  var sayBody = external_exports.discriminatedUnion("ok", [
30668
30673
  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
30674
  external_exports.object({ ok: external_exports.literal(false), errors: compileErrors })
@@ -30791,11 +30796,13 @@ var input2 = external_exports.object({
30791
30796
  authorJobId: external_exports.string().min(1).optional(),
30792
30797
  // Reads an admission a prior `source` call left running; takes no other arm beside it.
30793
30798
  admitJobId: external_exports.string().min(1).optional(),
30799
+ // Reads a dry-run compile a prior `source` + `dry_run` call left running; takes no other arm beside it.
30800
+ compileJobId: external_exports.string().min(1).optional(),
30794
30801
  gap: external_exports.object({ construct: external_exports.string().min(1), witness: external_exports.string().min(1), issue: external_exports.number().int().positive() }).optional()
30795
30802
  });
30796
30803
  var defineTool = {
30797
30804
  name: "define",
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.",
30805
+ 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`, and a `dry_run` still running with `compileJobId`. `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.",
30799
30806
  capability: "define",
30800
30807
  inputSchema: input2.shape,
30801
30808
  async handler(raw, ctx) {
@@ -30832,6 +30839,12 @@ var defineTool = {
30832
30839
  }
30833
30840
  return admitMode({ admitJobId: args2.admitJobId }, ctx);
30834
30841
  }
30842
+ if (args2.compileJobId !== void 0) {
30843
+ if (args2.source !== void 0 || args2.nlIntent !== void 0) {
30844
+ return { text: "define: `compileJobId` reads a dry run already submitted and takes no `source` or `nlIntent` beside it \u2014 read the job, or submit a new dry run, not both." };
30845
+ }
30846
+ return compileMode({ compileJobId: args2.compileJobId }, ctx);
30847
+ }
30835
30848
  const hasSource = args2.source !== void 0;
30836
30849
  const hasIntent = args2.nlIntent !== void 0;
30837
30850
  if (hasSource === hasIntent) {
@@ -30863,11 +30876,7 @@ var defineTool = {
30863
30876
  }
30864
30877
  if (args2.dry_run === true) {
30865
30878
  const payload2 = { repo: args2.repo, source: args2.source, ...args2.commit !== void 0 ? { commit: args2.commit } : {} };
30866
- const wire = await ctx.gateway.invoke("define-compile", payload2);
30867
- const body2 = readBody(compileBody, wire, "define", "define-compile");
30868
- if (!body2.ok) return { text: body2.text };
30869
- const result = body2.value;
30870
- return { text: renderCompile(result) };
30879
+ return compileMode(payload2, ctx);
30871
30880
  }
30872
30881
  const payload = {
30873
30882
  repo: args2.repo,
@@ -30879,6 +30888,13 @@ var defineTool = {
30879
30888
  return admitMode(payload, ctx);
30880
30889
  }
30881
30890
  };
30891
+ async function compileMode(payload, ctx) {
30892
+ const wire = await ctx.gateway.invoke("define-compile", payload);
30893
+ const isJob = typeof wire === "object" && wire !== null && "status" in wire;
30894
+ const body2 = readBody(isJob ? compileJobBody : compiledBody, wire, "define", "define-compile");
30895
+ if (!body2.ok) return { text: body2.text };
30896
+ return { text: renderCompile(body2.value) };
30897
+ }
30882
30898
  async function admitMode(payload, ctx) {
30883
30899
  const rawAdmit = await ctx.gateway.invoke("define-admit", payload);
30884
30900
  const isJob = typeof rawAdmit === "object" && rawAdmit !== null && "status" in rawAdmit;
@@ -30950,6 +30966,9 @@ ${r.dispatch.resumption}`;
30950
30966
  return lines.join("\n");
30951
30967
  }
30952
30968
  function renderCompile(r) {
30969
+ if ("status" in r) {
30970
+ return r.status === "running" ? `define (dry run): compile job ${r.jobId} is still running (the gates). Call define with compileJobId: "${r.jobId}" to read it.` : `define (dry run): compile job ${r.jobId} failed: ${r.error}`;
30971
+ }
30953
30972
  if (r.ok) {
30954
30973
  const head = "define (dry run): compiles clean, bound at " + r.boundAtCommit + ". Nothing was admitted \u2014 call again without `dry_run` to admit it.";
30955
30974
  return r.draft === void 0 ? head : `${head}
@@ -31543,6 +31562,10 @@ var conformanceBody = external_exports.object({
31543
31562
  staticUnevaluable: external_exports.number()
31544
31563
  })
31545
31564
  });
31565
+ var conformanceJobBody = external_exports.union([
31566
+ external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("running") }),
31567
+ external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("failed"), error: external_exports.string() })
31568
+ ]);
31546
31569
  var generationBody = external_exports.object({
31547
31570
  runId: external_exports.string(),
31548
31571
  planned: external_exports.number(),
@@ -31555,7 +31578,8 @@ var generationBody = external_exports.object({
31555
31578
  })
31556
31579
  });
31557
31580
  var input4 = external_exports.object({
31558
- repo: external_exports.string().min(1),
31581
+ repo: external_exports.string().min(1).optional(),
31582
+ conformanceJobId: external_exports.string().min(1).optional(),
31559
31583
  commit: external_exports.string().min(1).optional(),
31560
31584
  definitionIds: external_exports.array(external_exports.string().min(1)).min(1).optional(),
31561
31585
  baseOrdinal: external_exports.number().int().nonnegative().optional(),
@@ -31563,18 +31587,30 @@ var input4 = external_exports.object({
31563
31587
  });
31564
31588
  var evalTool = {
31565
31589
  name: "eval",
31566
- 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.",
31590
+ 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.",
31567
31591
  capability: "define",
31568
31592
  inputSchema: input4.shape,
31569
31593
  async handler(raw, ctx) {
31570
31594
  const args2 = input4.parse(raw);
31571
- const conformancePayload = {
31595
+ if (args2.conformanceJobId !== void 0 && args2.repo !== void 0) {
31596
+ 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." };
31597
+ }
31598
+ if (args2.conformanceJobId === void 0 && args2.repo === void 0) {
31599
+ return { text: "eval: needs `repo` to submit a conformance pass, or `conformanceJobId` to read one." };
31600
+ }
31601
+ const conformancePayload = args2.conformanceJobId !== void 0 ? { conformanceJobId: args2.conformanceJobId } : {
31572
31602
  repo: args2.repo,
31573
31603
  ...args2.commit !== void 0 ? { commit: args2.commit } : {},
31574
31604
  ...args2.baseOrdinal !== void 0 ? { baseOrdinal: args2.baseOrdinal } : {},
31575
31605
  ...args2.headOrdinal !== void 0 ? { headOrdinal: args2.headOrdinal } : {}
31576
31606
  };
31577
31607
  const wire = await ctx.gateway.invoke("define-conformance", conformancePayload);
31608
+ const job = conformanceJobBody.safeParse(wire);
31609
+ if (job.success) {
31610
+ return {
31611
+ 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}`
31612
+ };
31613
+ }
31578
31614
  const body2 = readBody(conformanceBody, wire, "eval", "define-conformance");
31579
31615
  if (!body2.ok) return { text: body2.text };
31580
31616
  const report = body2.value;
@@ -48711,7 +48747,7 @@ var workReadTools = createWorkReadToolProviders({ capability: "work" });
48711
48747
  var bundledProviders = [src_default2, src_default, tension_default, ...defineTools, ...decisionTools, ...captureTools, ...buildTools, secureTool, ...workTools, ...workReadTools];
48712
48748
 
48713
48749
  // package.json
48714
- var version2 = "0.4.37";
48750
+ var version2 = "0.4.39";
48715
48751
 
48716
48752
  // src/server.ts
48717
48753
  var SERVER_VERSION = version2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subseam/mcp",
3
- "version": "0.4.37",
3
+ "version": "0.4.39",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {