@withgateway/sdk 0.1.19 → 0.1.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/cli.mjs CHANGED
@@ -681,14 +681,15 @@ var init_hub = __esm({
681
681
  function fmtScore(score) {
682
682
  return score === null ? "no score" : score.toFixed(3);
683
683
  }
684
- function buildMarkdown(report, minScore) {
684
+ function buildMarkdown(report, minScore, source) {
685
685
  const lines = [];
686
686
  lines.push(
687
687
  `### World validation ${report.ok ? "passed" : "failed"} \u2014 \`${report.slug}@${report.branch}\``
688
688
  );
689
689
  lines.push("");
690
+ const commitLink = source?.repoUrl && source?.commit ? `[\`${source.commit.slice(0, 12)}\`](${source.repoUrl}/commit/${source.commit})` : null;
690
691
  lines.push(
691
- `Ran the pull request's own world source (version \`${report.contentHash.slice(0, 12)}\`) through run config **${report.runConfig.name}**` + (minScore !== null ? `, gating at score \u2265 ${minScore}.` : ".")
692
+ `Ran the pull request's own world source` + (commitLink ? ` (${commitLink} on \`${report.branch}\`` : ` (`) + `${commitLink ? ", " : ""}pinned as \`${report.contentHash.slice(0, 12)}\`) through run config **${report.runConfig.name}**` + (minScore !== null ? `, gating at score \u2265 ${minScore}.` : ".")
692
693
  );
693
694
  lines.push("");
694
695
  lines.push("| Model | Status | Score | Run |");
@@ -708,19 +709,29 @@ function buildMarkdown(report, minScore) {
708
709
  reward: sample.reward
709
710
  }))
710
711
  );
711
- if (taskRows.length > 0 && taskRows.length <= 40) {
712
+ if (taskRows.length > 0) {
713
+ const fold = taskRows.length > 12;
712
714
  lines.push("");
713
- lines.push("<details><summary>Per-task rewards</summary>");
714
- lines.push("");
715
- lines.push("| Task | Model | Reward |");
715
+ if (fold) {
716
+ lines.push(
717
+ `<details><summary>Per-scenario rewards (${taskRows.length})</summary>`
718
+ );
719
+ lines.push("");
720
+ } else {
721
+ lines.push(`**Scenarios (${taskRows.length})**`);
722
+ lines.push("");
723
+ }
724
+ lines.push("| Scenario | Model | Reward |");
716
725
  lines.push("| --- | --- | ---: |");
717
726
  for (const row of taskRows) {
718
727
  lines.push(
719
728
  `| ${row.task} | \`${row.model}\` | ${row.reward === null ? "no score" : row.reward.toFixed(2)} |`
720
729
  );
721
730
  }
722
- lines.push("");
723
- lines.push("</details>");
731
+ if (fold) {
732
+ lines.push("");
733
+ lines.push("</details>");
734
+ }
724
735
  }
725
736
  return lines.join("\n");
726
737
  }
@@ -834,7 +845,13 @@ async function validateWorld(dir, opts) {
834
845
  runConfig: { id: runConfig.id, name: runConfig.name },
835
846
  runs
836
847
  };
837
- return { ...base, markdown: buildMarkdown(base, minScore) };
848
+ return {
849
+ ...base,
850
+ markdown: buildMarkdown(base, minScore, {
851
+ repoUrl: provenance.repoUrl,
852
+ commit: provenance.commit
853
+ })
854
+ };
838
855
  }
839
856
  var init_validate = __esm({
840
857
  "src/worlds/validate.ts"() {