@treeseed/cli 0.8.15 → 0.8.17

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.
@@ -20,9 +20,21 @@ function localWebApprovalUrlFromApiUrl(value, profileId) {
20
20
  }
21
21
  return value;
22
22
  }
23
+ function centralWebApprovalUrlFromApiUrl(value, profileId) {
24
+ if (profileId !== "central") {
25
+ return value;
26
+ }
27
+ const explicit = process.env.TREESEED_CENTRAL_MARKET_WEB_URL?.trim();
28
+ const fallback = explicit || "https://treeseed.ai";
29
+ const url = new URL(value);
30
+ if (url.protocol === "http:" && (url.hostname === "127.0.0.1" || url.hostname === "localhost")) {
31
+ return new URL(`${url.pathname}${url.search}${url.hash}`, fallback.replace(/\/+$/u, "")).toString();
32
+ }
33
+ return value;
34
+ }
23
35
  function approvalUrlForDisplay(value, profileId) {
24
36
  try {
25
- return localWebApprovalUrlFromApiUrl(value, profileId);
37
+ return centralWebApprovalUrlFromApiUrl(localWebApprovalUrlFromApiUrl(value, profileId), profileId);
26
38
  } catch {
27
39
  return value;
28
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treeseed/cli",
3
- "version": "0.8.15",
3
+ "version": "0.8.17",
4
4
  "description": "Operator-facing Treeseed CLI package.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -45,7 +45,7 @@
45
45
  "release:publish": "node ./scripts/run-ts.mjs ./scripts/publish-package.ts"
46
46
  },
47
47
  "dependencies": {
48
- "@treeseed/sdk": "0.8.15",
48
+ "@treeseed/sdk": "0.8.17",
49
49
  "ink": "^7.0.0",
50
50
  "react": "^19.2.5"
51
51
  },