@subseam/mcp 0.4.19 → 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 +45 -12
  2. 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();
@@ -28992,7 +28993,7 @@ function decodeFormContract(v) {
28992
28993
  }
28993
28994
  return { kind: "file-set" };
28994
28995
  }
28995
- if (kind === "work-grade" || kind === "work-digest" || kind === "work-answer") {
28996
+ if (kind === "work-grade" || kind === "work-digest" || kind === "work-answer" || kind === "decomposition") {
28996
28997
  const knownKeys = ["kind"];
28997
28998
  const actualKeys = Object.keys(obj);
28998
28999
  for (const key of actualKeys) {
@@ -29537,7 +29538,7 @@ ${lines.join("\n")}` };
29537
29538
  }
29538
29539
  const resumed = outcome.resumeFromBudgetCoordinate === void 0 ? "" : ` Resume from banked work at budget coordinate ${outcome.resumeFromBudgetCoordinate}.`;
29539
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}`;
29540
- 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).";
29541
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}:`;
29542
29543
  const part4 = outcome.bundle !== null ? outcome.bundle : void 0;
29543
29544
  const part5 = outcome.next === void 0 ? void 0 : `next: ${outcome.next}`;
@@ -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 authorResult = external_exports.discriminatedUnion("ok", [
30678
+ var sliceResult = external_exports.union([
30678
30679
  external_exports.object({
30679
30680
  ok: external_exports.literal(true),
30680
30681
  definitionId: external_exports.string(),
@@ -30685,12 +30686,28 @@ var authorResult = external_exports.discriminatedUnion("ok", [
30685
30686
  rungs: external_exports.array(rungReport).optional(),
30686
30687
  draft: definitionDraft.optional()
30687
30688
  }),
30688
- 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
+ })
30689
30706
  ]);
30690
30707
  var authorBody = external_exports.discriminatedUnion("status", [
30691
30708
  external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("running"), wait: external_exports.string().optional() }),
30692
30709
  external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("failed"), error: external_exports.string() }),
30693
- 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 })
30694
30711
  ]);
30695
30712
  var seedBody = external_exports.discriminatedUnion("status", [
30696
30713
  external_exports.object({ jobId: external_exports.string(), status: external_exports.literal("submitted"), deduped: external_exports.boolean() }),
@@ -30756,7 +30773,7 @@ var input2 = external_exports.object({
30756
30773
  });
30757
30774
  var defineTool = {
30758
30775
  name: "define",
30759
- 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.",
30760
30777
  capability: "define",
30761
30778
  inputSchema: input2.shape,
30762
30779
  async handler(raw, ctx) {
@@ -30873,17 +30890,33 @@ function renderAuthorJob(r) {
30873
30890
  return `define: authoring job ${r.jobId} failed: ${r.error}`;
30874
30891
  }
30875
30892
  }
30876
- function renderAuthor(r) {
30893
+ function renderSlice(r) {
30894
+ if ("unavailable" in r) return `could not be authored: ${r.unavailable}`;
30877
30895
  const rungs = r.rungs === void 0 || r.rungs.length === 0 ? "" : `
30878
- Model calls: ${rungLine(r.rungs)}`;
30896
+ Model calls: ${rungLine(r.rungs)}`;
30879
30897
  if (r.ok) {
30880
30898
  const routed = r.clover.routedToHumanQueue ? " (routed to the human decision queue)" : "";
30881
- 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.`;
30882
30900
  return (r.draft === void 0 ? head : `${head}
30883
30901
  ${renderDraft(r.draft)}`) + rungs;
30884
30902
  }
30885
- return `define: could not converge in ${r.iterations} iteration(s). Best-failing candidate's errors \u2014
30886
- ` + 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");
30887
30920
  }
30888
30921
  function renderCompile(r) {
30889
30922
  if (r.ok) {
@@ -48379,7 +48412,7 @@ var workReadTools = createWorkReadToolProviders({ capability: "work" });
48379
48412
  var bundledProviders = [src_default2, src_default, tension_default, ...defineTools, ...decisionTools, ...captureTools, ...buildTools, secureTool, ...workTools, ...workReadTools];
48380
48413
 
48381
48414
  // package.json
48382
- var version2 = "0.4.19";
48415
+ var version2 = "0.4.21";
48383
48416
 
48384
48417
  // src/server.ts
48385
48418
  var SERVER_VERSION = version2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@subseam/mcp",
3
- "version": "0.4.19",
3
+ "version": "0.4.21",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {