@subseam/mcp 0.4.20 → 0.4.21

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 +44 -12
  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) {
@@ -48380,7 +48412,7 @@ var workReadTools = createWorkReadToolProviders({ capability: "work" });
48380
48412
  var bundledProviders = [src_default2, src_default, tension_default, ...defineTools, ...decisionTools, ...captureTools, ...buildTools, secureTool, ...workTools, ...workReadTools];
48381
48413
 
48382
48414
  // package.json
48383
- var version2 = "0.4.20";
48415
+ var version2 = "0.4.21";
48384
48416
 
48385
48417
  // src/server.ts
48386
48418
  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.21",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {