@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.js CHANGED
@@ -694,14 +694,15 @@ var init_hub = __esm({
694
694
  function fmtScore(score) {
695
695
  return score === null ? "no score" : score.toFixed(3);
696
696
  }
697
- function buildMarkdown(report, minScore) {
697
+ function buildMarkdown(report, minScore, source) {
698
698
  const lines = [];
699
699
  lines.push(
700
700
  `### World validation ${report.ok ? "passed" : "failed"} \u2014 \`${report.slug}@${report.branch}\``
701
701
  );
702
702
  lines.push("");
703
+ const commitLink = source?.repoUrl && source?.commit ? `[\`${source.commit.slice(0, 12)}\`](${source.repoUrl}/commit/${source.commit})` : null;
703
704
  lines.push(
704
- `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}.` : ".")
705
+ `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}.` : ".")
705
706
  );
706
707
  lines.push("");
707
708
  lines.push("| Model | Status | Score | Run |");
@@ -721,19 +722,29 @@ function buildMarkdown(report, minScore) {
721
722
  reward: sample.reward
722
723
  }))
723
724
  );
724
- if (taskRows.length > 0 && taskRows.length <= 40) {
725
+ if (taskRows.length > 0) {
726
+ const fold = taskRows.length > 12;
725
727
  lines.push("");
726
- lines.push("<details><summary>Per-task rewards</summary>");
727
- lines.push("");
728
- lines.push("| Task | Model | Reward |");
728
+ if (fold) {
729
+ lines.push(
730
+ `<details><summary>Per-scenario rewards (${taskRows.length})</summary>`
731
+ );
732
+ lines.push("");
733
+ } else {
734
+ lines.push(`**Scenarios (${taskRows.length})**`);
735
+ lines.push("");
736
+ }
737
+ lines.push("| Scenario | Model | Reward |");
729
738
  lines.push("| --- | --- | ---: |");
730
739
  for (const row of taskRows) {
731
740
  lines.push(
732
741
  `| ${row.task} | \`${row.model}\` | ${row.reward === null ? "no score" : row.reward.toFixed(2)} |`
733
742
  );
734
743
  }
735
- lines.push("");
736
- lines.push("</details>");
744
+ if (fold) {
745
+ lines.push("");
746
+ lines.push("</details>");
747
+ }
737
748
  }
738
749
  return lines.join("\n");
739
750
  }
@@ -847,7 +858,13 @@ async function validateWorld(dir, opts) {
847
858
  runConfig: { id: runConfig.id, name: runConfig.name },
848
859
  runs
849
860
  };
850
- return { ...base, markdown: buildMarkdown(base, minScore) };
861
+ return {
862
+ ...base,
863
+ markdown: buildMarkdown(base, minScore, {
864
+ repoUrl: provenance.repoUrl,
865
+ commit: provenance.commit
866
+ })
867
+ };
851
868
  }
852
869
  var init_validate = __esm({
853
870
  "src/worlds/validate.ts"() {