@subseam/mcp 0.4.20 → 0.4.22

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 +66 -31
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -28993,7 +28993,7 @@ function decodeFormContract(v) {
28993
28993
  }
28994
28994
  return { kind: "file-set" };
28995
28995
  }
28996
- if (kind === "work-grade" || kind === "work-digest" || kind === "work-answer") {
28996
+ if (kind === "work-grade" || kind === "work-digest" || kind === "work-answer" || kind === "decomposition") {
28997
28997
  const knownKeys = ["kind"];
28998
28998
  const actualKeys = Object.keys(obj);
28999
28999
  for (const key of actualKeys) {
@@ -29538,7 +29538,7 @@ ${lines.join("\n")}` };
29538
29538
  }
29539
29539
  const resumed = outcome.resumeFromBudgetCoordinate === void 0 ? "" : ` Resume from banked work at budget coordinate ${outcome.resumeFromBudgetCoordinate}.`;
29540
29540
  const part1 = `Claimed ${outcome.taskId} (${outcome.taskClass}, form ${outcome.oracleBinding}). You have ${outcome.attemptsLeft} of ${outcome.attemptBudget} attempt(s) left. Lease ${outcome.leaseId}; tasks_submit needs only the task id and your reply.${resumed}`;
29541
- const part2 = outcome.form === null ? "Reply form: none declared; the reply is accepted unvalidated." : outcome.form.kind === "first-token" ? `Reply form: the first token must be one of ${outcome.form.tokens.join(" | ")}.` : "Reply form: a file-set (JSON array of path/content entries).";
29541
+ const part2 = outcome.form === null ? "Reply form: none declared; the reply is accepted unvalidated." : outcome.form.kind === "first-token" ? `Reply form: the first token must be one of ${outcome.form.tokens.join(" | ")}.` : outcome.form.kind === "decomposition" ? 'Reply form: a JSON object {"slices": [{"statement": "..."}], "leftover": [{"shard": "...", "why": "..."}]}.' : "Reply form: a file-set (JSON array of path/content entries).";
29542
29542
  const part3 = outcome.bundle === null ? `No bundle body is retained under ${outcome.bundleDigest}; this task cannot be worked from its bundle.` : `Bundle ${outcome.bundleDigest}:`;
29543
29543
  const part4 = outcome.bundle !== null ? outcome.bundle : void 0;
29544
29544
  const part5 = outcome.next === void 0 ? void 0 : `next: ${outcome.next}`;
@@ -30675,7 +30675,7 @@ var rungReport = external_exports.object({
30675
30675
  calls: external_exports.number(),
30676
30676
  outcome: external_exports.enum(["admitted", "exhausted"])
30677
30677
  });
30678
- var authorResult = external_exports.discriminatedUnion("ok", [
30678
+ var sliceResult = external_exports.union([
30679
30679
  external_exports.object({
30680
30680
  ok: external_exports.literal(true),
30681
30681
  definitionId: external_exports.string(),
@@ -30686,12 +30686,28 @@ var authorResult = external_exports.discriminatedUnion("ok", [
30686
30686
  rungs: external_exports.array(rungReport).optional(),
30687
30687
  draft: definitionDraft.optional()
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
+ external_exports.object({ ok: external_exports.literal(false), bestFailingCandidate: external_exports.unknown(), errors: compileErrors, iterations: external_exports.number(), rungs: external_exports.array(rungReport).optional() }),
30690
+ external_exports.object({ ok: external_exports.literal(false), unavailable: external_exports.string() })
30691
+ ]);
30692
+ var noteResult = external_exports.discriminatedUnion("kind", [
30693
+ external_exports.object({
30694
+ kind: external_exports.literal("awaiting-tasks"),
30695
+ dispatch: external_exports.object({
30696
+ blocking: external_exports.array(external_exports.object({ taskId: external_exports.string() })),
30697
+ pullScope: external_exports.string(),
30698
+ resumption: external_exports.string()
30699
+ })
30700
+ }),
30701
+ external_exports.object({
30702
+ kind: external_exports.literal("sliced"),
30703
+ slices: external_exports.array(external_exports.object({ index: external_exports.number(), statement: external_exports.string(), result: sliceResult })),
30704
+ leftover: external_exports.array(external_exports.object({ shard: external_exports.string(), why: external_exports.string() }))
30705
+ })
30690
30706
  ]);
30691
30707
  var authorBody = external_exports.discriminatedUnion("status", [
30692
30708
  external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("running"), wait: external_exports.string().optional() }),
30693
30709
  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 })
30710
+ external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("completed"), result: noteResult })
30695
30711
  ]);
30696
30712
  var seedBody = external_exports.discriminatedUnion("status", [
30697
30713
  external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("submitted"), deduped: external_exports.boolean() }),
@@ -30757,7 +30773,7 @@ var input2 = external_exports.object({
30757
30773
  });
30758
30774
  var defineTool = {
30759
30775
  name: "define",
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.",
30776
+ 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.",
30761
30777
  capability: "define",
30762
30778
  inputSchema: input2.shape,
30763
30779
  async handler(raw, ctx) {
@@ -30874,17 +30890,33 @@ function renderAuthorJob(r) {
30874
30890
  return `define: authoring job ${r.jobId} failed: ${r.error}`;
30875
30891
  }
30876
30892
  }
30877
- function renderAuthor(r) {
30893
+ function renderSlice(r) {
30894
+ if ("unavailable" in r) return `could not be authored: ${r.unavailable}`;
30878
30895
  const rungs = r.rungs === void 0 || r.rungs.length === 0 ? "" : `
30879
- Model calls: ${rungLine(r.rungs)}`;
30896
+ Model calls: ${rungLine(r.rungs)}`;
30880
30897
  if (r.ok) {
30881
30898
  const routed = r.clover.routedToHumanQueue ? " (routed to the human decision queue)" : "";
30882
- const head = `define: admitted definition ${r.definitionId} v${r.version} in ${r.iterations} iteration(s). Clover: ${r.clover.agreeCount} agreeing${r.clover.agreed ? "" : " \u2014 no consensus"}${routed}. It is defaulted until approved.`;
30899
+ const head = `admitted definition ${r.definitionId} v${r.version} in ${r.iterations} iteration(s). Clover: ${r.clover.agreeCount} agreeing${r.clover.agreed ? "" : " \u2014 no consensus"}${routed}. It is defaulted until approved.`;
30883
30900
  return (r.draft === void 0 ? head : `${head}
30884
30901
  ${renderDraft(r.draft)}`) + rungs;
30885
30902
  }
30886
- return `define: could not converge in ${r.iterations} iteration(s). Best-failing candidate's errors \u2014
30887
- ` + errorLines(r.errors) + rungs;
30903
+ return `could not converge in ${r.iterations} iteration(s). Best-failing candidate's errors \u2014
30904
+ ${errorLines(r.errors)}${rungs}`;
30905
+ }
30906
+ function renderAuthor(r) {
30907
+ if (r.kind === "awaiting-tasks") {
30908
+ const ids = r.dispatch.blocking.map((b) => b.taskId).join(", ");
30909
+ return `define: not done yet \u2014 your note is first decomposed into slices by your own agent (task ${ids}).
30910
+ ${r.dispatch.resumption}`;
30911
+ }
30912
+ const lines = [`define: your note stated ${r.slices.length} slice(s).`];
30913
+ for (const slice of r.slices) lines.push(`Slice ${slice.index} \u2014 ${slice.statement}
30914
+ ${renderSlice(slice.result)}`);
30915
+ if (r.leftover.length > 0) {
30916
+ lines.push("Left over (not authored):");
30917
+ for (const l of r.leftover) lines.push(` \u2022 ${l.shard} \u2014 ${l.why}`);
30918
+ }
30919
+ return lines.join("\n");
30888
30920
  }
30889
30921
  function renderCompile(r) {
30890
30922
  if (r.ok) {
@@ -31964,39 +31996,42 @@ var defineProposalReadTool = {
31964
31996
  // ../define/src/tool/proposal-check.ts
31965
31997
  init_esm_shims();
31966
31998
  var input9 = external_exports.object({
31967
- taskId: external_exports.string().uuid(),
31999
+ // Reads a check a prior call left measuring; takes no candidate beside it.
32000
+ checkId: external_exports.string().min(1).optional(),
32001
+ taskId: external_exports.string().uuid().optional(),
31968
32002
  files: external_exports.array(external_exports.object({ path: external_exports.string().min(1), content: external_exports.string().nullable() })).min(1).optional(),
31969
32003
  sha: external_exports.string().regex(/^[0-9a-f]{40}$/).optional(),
31970
32004
  gitDir: external_exports.string().startsWith("/").optional()
31971
32005
  });
31972
32006
  var site2 = external_exports.object({ definitionName: external_exports.string(), path: external_exports.string(), line: external_exports.number(), cause: external_exports.string() });
31973
32007
  var siteLine2 = (d) => ` ${d.definitionName} at ${d.path}:${d.line} \u2014 ${d.cause}`;
32008
+ var answer2 = external_exports.union([
32009
+ external_exports.object({
32010
+ ok: external_exports.literal(true),
32011
+ delta: external_exports.object({
32012
+ accepted: external_exports.boolean(),
32013
+ closed: external_exports.array(site2),
32014
+ regressions: external_exports.array(site2),
32015
+ newlyUncomputed: external_exports.array(external_exports.object({ definitionName: external_exports.string(), path: external_exports.string(), reason: external_exports.string() })),
32016
+ notComputed: external_exports.string().nullable()
32017
+ }),
32018
+ atCandidate: external_exports.array(site2)
32019
+ }),
32020
+ external_exports.object({ ok: external_exports.literal(false), status: external_exports.literal("pending"), checkId: external_exports.string(), wait: external_exports.string() })
32021
+ ]);
31974
32022
  var defineProposalCheckTool = {
31975
32023
  name: "define_proposal_check",
31976
- description: "Before submitting a fill for a PR-check proposal, ask what the check would say about your candidate: pass `files`, the same file-set you would submit with tasks_submit ({path, content} each; content null deletes the file). Answers the divergences still standing at the candidate, the ones it closes and the ones it opens. Records nothing.",
32024
+ description: "Before submitting a fill for a PR-check proposal, ask what the check would say about your candidate: pass `files`, the same file-set you would submit with tasks_submit ({path, content} each; content null deletes the file). Answers the divergences still standing at the candidate, the ones it closes and the ones it opens. Measuring can take minutes: then it answers a checkId, and you call it again with only `checkId` to read the result. Records nothing.",
31977
32025
  capability: "decision",
31978
32026
  inputSchema: input9.shape,
31979
32027
  async handler(raw, ctx) {
31980
32028
  const args2 = input9.parse(raw);
31981
- const candidate = args2.files !== void 0 ? { taskId: args2.taskId, files: args2.files } : args2.sha !== void 0 && args2.gitDir !== void 0 ? { taskId: args2.taskId, sha: args2.sha, gitDir: args2.gitDir } : null;
31982
- if (candidate === null) return { text: "define_proposal_check: pass `files`, the file-set you would submit as the fill." };
32029
+ const candidate = args2.checkId !== void 0 ? { checkId: args2.checkId } : args2.taskId === void 0 ? null : args2.files !== void 0 ? { taskId: args2.taskId, files: args2.files } : args2.sha !== void 0 && args2.gitDir !== void 0 ? { taskId: args2.taskId, sha: args2.sha, gitDir: args2.gitDir } : null;
32030
+ if (candidate === null) return { text: "define_proposal_check: pass `taskId` and `files`, the file-set you would submit as the fill, or `checkId` to read a check already asked." };
31983
32031
  const wire = await ctx.gateway.invoke("decision-proposal-check", candidate);
31984
- const body2 = readBody(
31985
- external_exports.object({
31986
- delta: external_exports.object({
31987
- accepted: external_exports.boolean(),
31988
- closed: external_exports.array(site2),
31989
- regressions: external_exports.array(site2),
31990
- newlyUncomputed: external_exports.array(external_exports.object({ definitionName: external_exports.string(), path: external_exports.string(), reason: external_exports.string() })),
31991
- notComputed: external_exports.string().nullable()
31992
- }),
31993
- atCandidate: external_exports.array(site2)
31994
- }),
31995
- wire,
31996
- "define_proposal_check",
31997
- "decision-proposal-check"
31998
- );
32032
+ const body2 = readBody(answer2, wire, "define_proposal_check", "decision-proposal-check");
31999
32033
  if (!body2.ok) return { text: body2.text };
32034
+ if (!body2.value.ok) return { text: `define_proposal_check: still measuring (checkId ${body2.value.checkId}) \u2014 ${body2.value.wait}.` };
32000
32035
  const { delta, atCandidate } = body2.value;
32001
32036
  if (delta.notComputed !== null) return { text: `define_proposal_check: not computed \u2014 ${delta.notComputed}. This is not a pass.` };
32002
32037
  return {
@@ -48380,7 +48415,7 @@ var workReadTools = createWorkReadToolProviders({ capability: "work" });
48380
48415
  var bundledProviders = [src_default2, src_default, tension_default, ...defineTools, ...decisionTools, ...captureTools, ...buildTools, secureTool, ...workTools, ...workReadTools];
48381
48416
 
48382
48417
  // package.json
48383
- var version2 = "0.4.20";
48418
+ var version2 = "0.4.22";
48384
48419
 
48385
48420
  // src/server.ts
48386
48421
  var SERVER_VERSION = version2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subseam/mcp",
3
- "version": "0.4.20",
3
+ "version": "0.4.22",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {