orchestrating 0.1.16 → 0.1.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.
Files changed (2) hide show
  1. package/bin/orch +12 -2
  2. package/package.json +1 -1
package/bin/orch CHANGED
@@ -928,8 +928,18 @@ async function connectWs() {
928
928
  if (msg.type === "error") {
929
929
  process.stderr.write(`${RED}Server error: ${msg.error}${RESET}\n`);
930
930
  if (/unauthorized|auth|token/i.test(msg.error || "")) {
931
- process.stderr.write(`${RED}Run 'orch login' to authenticate.${RESET}\n`);
932
- authFailed = true;
931
+ // Try to refresh token before giving up
932
+ refreshAuthToken().then((refreshed) => {
933
+ if (refreshed) {
934
+ authToken = refreshed;
935
+ process.stderr.write(`${DIM}[orch] Token refreshed, reconnecting…${RESET}\n`);
936
+ authFailed = false;
937
+ connectWs();
938
+ } else {
939
+ process.stderr.write(`${RED}Run 'orch login' to authenticate.${RESET}\n`);
940
+ authFailed = true;
941
+ }
942
+ });
933
943
  }
934
944
  return;
935
945
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orchestrating",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "Stream terminal sessions to the orchestrat.ing dashboard",
5
5
  "type": "module",
6
6
  "bin": {