trajectories-sh 1.2.0 → 1.2.1

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
@@ -81,7 +81,7 @@ program.command("upload <directory>").description("Upload a trajectory job direc
81
81
  Pushing ${directory} \u2192 ${chalk.cyan(slug)}
82
82
  `));
83
83
  try {
84
- const { uploadJob } = await import("./upload-SELQA4FS.js");
84
+ const { uploadJob } = await import("./upload-WWZGW4NZ.js");
85
85
  const result = await uploadJob(directory, {
86
86
  slug,
87
87
  name: opts.name,
@@ -59,12 +59,14 @@ async function uploadJob(dir, opts) {
59
59
  throw new Error(`Finalize failed: ${await finalResp.text()}`);
60
60
  }
61
61
  const result = await finalResp.json();
62
+ const apiUrl = getApiUrl();
63
+ const siteUrl = apiUrl.includes("localhost") ? "http://localhost:3000" : apiUrl.replace("api.", "").replace(/\/$/, "");
62
64
  return {
63
65
  jobId,
64
66
  slug: result.slug,
65
67
  nTrials: result.n_trials,
66
68
  meanReward: result.mean_reward,
67
- viewerUrl: `${getApiUrl()}${result.viewer_url}`
69
+ viewerUrl: `${siteUrl}/trajectories/${jobId}`
68
70
  };
69
71
  }
70
72
  async function uploadDirect(jobId, files) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trajectories-sh",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "CLI for uploading trajectory jobs to trajectories.sh",
5
5
  "type": "module",
6
6
  "bin": {