terminalhire 0.10.7 → 0.10.8

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.
@@ -13090,6 +13090,8 @@ async function run18() {
13090
13090
  } catch {
13091
13091
  }
13092
13092
  let incomingPending = { count: 0 };
13093
+ let sessionStale = false;
13094
+ const sessionExpired = (res) => res.status === 401;
13093
13095
  const sessionCookie = readWebSessionFile();
13094
13096
  if (sessionCookie && !isInboundNudgeMuted()) try {
13095
13097
  const res = await fetch(`${API_URL6}/api/intro/list`, {
@@ -13102,6 +13104,8 @@ async function run18() {
13102
13104
  const intros = Array.isArray(body?.intros) ? body.intros : [];
13103
13105
  const incoming = intros.filter((it) => it && it.role === "incoming" && it.status === "pending");
13104
13106
  incomingPending = { count: incoming.length };
13107
+ } else if (sessionExpired(res)) {
13108
+ sessionStale = true;
13105
13109
  }
13106
13110
  } catch {
13107
13111
  }
@@ -13120,6 +13124,8 @@ async function run18() {
13120
13124
  0
13121
13125
  );
13122
13126
  unreadChat = { count: total };
13127
+ } else if (sessionExpired(res)) {
13128
+ sessionStale = true;
13123
13129
  }
13124
13130
  } catch {
13125
13131
  }
@@ -13131,7 +13137,8 @@ async function run18() {
13131
13137
  topMatches,
13132
13138
  topPeers,
13133
13139
  incomingPending,
13134
- unreadChat
13140
+ unreadChat,
13141
+ sessionStale
13135
13142
  };
13136
13143
  writeFileSync17(INDEX_CACHE_FILE5, JSON.stringify(cacheEntry), "utf8");
13137
13144
  try {
@@ -13195,7 +13202,7 @@ var init_jpi_refresh = __esm({
13195
13202
  __dirname4 = fileURLToPath5(new URL(".", import.meta.url));
13196
13203
  TERMINALHIRE_DIR14 = join23(homedir21(), ".terminalhire");
13197
13204
  INDEX_CACHE_FILE5 = join23(TERMINALHIRE_DIR14, "index-cache.json");
13198
- API_URL6 = process.env["TERMINALHIRE_API_URL"] ?? process.env["JPI_API_URL"] ?? "https://terminalhire.com";
13205
+ API_URL6 = process.env["TERMINALHIRE_API_URL"] ?? process.env["JPI_API_URL"] ?? "https://www.terminalhire.com";
13199
13206
  }
13200
13207
  });
13201
13208
 
@@ -6980,7 +6980,7 @@ var GH_SESSION_COOKIE = "__jpi_gh_session";
6980
6980
  var __dirname2 = fileURLToPath3(new URL(".", import.meta.url));
6981
6981
  var TERMINALHIRE_DIR4 = join9(homedir7(), ".terminalhire");
6982
6982
  var INDEX_CACHE_FILE2 = join9(TERMINALHIRE_DIR4, "index-cache.json");
6983
- var API_URL2 = process.env["TERMINALHIRE_API_URL"] ?? process.env["JPI_API_URL"] ?? "https://terminalhire.com";
6983
+ var API_URL2 = process.env["TERMINALHIRE_API_URL"] ?? process.env["JPI_API_URL"] ?? "https://www.terminalhire.com";
6984
6984
  async function run() {
6985
6985
  try {
6986
6986
  let index;
@@ -7079,6 +7079,8 @@ async function run() {
7079
7079
  } catch {
7080
7080
  }
7081
7081
  let incomingPending = { count: 0 };
7082
+ let sessionStale = false;
7083
+ const sessionExpired = (res) => res.status === 401;
7082
7084
  const sessionCookie = readWebSessionFile();
7083
7085
  if (sessionCookie && !isInboundNudgeMuted()) try {
7084
7086
  const res = await fetch(`${API_URL2}/api/intro/list`, {
@@ -7091,6 +7093,8 @@ async function run() {
7091
7093
  const intros = Array.isArray(body?.intros) ? body.intros : [];
7092
7094
  const incoming = intros.filter((it) => it && it.role === "incoming" && it.status === "pending");
7093
7095
  incomingPending = { count: incoming.length };
7096
+ } else if (sessionExpired(res)) {
7097
+ sessionStale = true;
7094
7098
  }
7095
7099
  } catch {
7096
7100
  }
@@ -7109,6 +7113,8 @@ async function run() {
7109
7113
  0
7110
7114
  );
7111
7115
  unreadChat = { count: total };
7116
+ } else if (sessionExpired(res)) {
7117
+ sessionStale = true;
7112
7118
  }
7113
7119
  } catch {
7114
7120
  }
@@ -7120,7 +7126,8 @@ async function run() {
7120
7126
  topMatches,
7121
7127
  topPeers,
7122
7128
  incomingPending,
7123
- unreadChat
7129
+ unreadChat,
7130
+ sessionStale
7124
7131
  };
7125
7132
  writeFileSync6(INDEX_CACHE_FILE2, JSON.stringify(cacheEntry), "utf8");
7126
7133
  try {
package/dist/bin/jpi.js CHANGED
@@ -105,6 +105,16 @@ function getCachedUnreadChatCount() {
105
105
  return 0;
106
106
  }
107
107
  }
108
+ function getCachedSessionStale() {
109
+ try {
110
+ const raw = readFileSync(INDEX_CACHE_FILE, "utf8");
111
+ const entry = JSON.parse(raw);
112
+ if (Date.now() - entry.ts > INDEX_CACHE_TTL_MS) return false;
113
+ return entry.sessionStale === true;
114
+ } catch {
115
+ return false;
116
+ }
117
+ }
108
118
  function getNudgeMode() {
109
119
  const envVal = process.env["TERMINALHIRE_NUDGE"];
110
120
  if (envVal) {
@@ -178,9 +188,10 @@ try {
178
188
  const matchCount = getCachedMatchCount();
179
189
  const incomingCount = getCachedIncomingCount();
180
190
  const unreadChatCount = getCachedUnreadChatCount();
191
+ const sessionStale = getCachedSessionStale() && incomingCount === 0 && unreadChatCount === 0;
181
192
  const haveRoles = matchCount !== null && matchCount > 0;
182
- if (!haveRoles && incomingCount === 0 && unreadChatCount === 0) process.exit(0);
183
- const hasConnectionSignal = incomingCount > 0 || unreadChatCount > 0;
193
+ if (!haveRoles && incomingCount === 0 && unreadChatCount === 0 && !sessionStale) process.exit(0);
194
+ const hasConnectionSignal = incomingCount > 0 || unreadChatCount > 0 || sessionStale;
184
195
  const nudgeMode = getNudgeMode();
185
196
  if (!hasConnectionSignal && !shouldNudge(nudgeMode, sessionId)) process.exit(0);
186
197
  let line;
@@ -189,11 +200,14 @@ try {
189
200
  line = `\u2726 ${matchCount} ${plural} match your current work \u2014 run: terminalhire jobs`;
190
201
  if (incomingCount > 0) line += ` \xB7 \u2709 ${incomingCount} waiting to connect`;
191
202
  if (unreadChatCount > 0) line += ` \xB7 \u{1F4AC} ${unreadChatCount} unread`;
203
+ if (sessionStale) line += ` \xB7 \u26A0 session expired \u2014 run: terminalhire link`;
192
204
  } else if (incomingCount > 0) {
193
205
  line = `\u2709 ${incomingCount} waiting to connect \u2014 run: terminalhire intro --list`;
194
206
  if (unreadChatCount > 0) line += ` \xB7 \u{1F4AC} ${unreadChatCount} unread`;
195
- } else {
207
+ } else if (unreadChatCount > 0) {
196
208
  line = `\u{1F4AC} ${unreadChatCount} unread \u2014 run: terminalhire chat`;
209
+ } else {
210
+ line = `\u26A0 terminalhire session expired \u2014 run: terminalhire link to restore your connection signals`;
197
211
  }
198
212
  process.stdout.write(line + "\n");
199
213
  if (haveRoles && nudgeMode === "session") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "terminalhire",
3
- "version": "0.10.7",
3
+ "version": "0.10.8",
4
4
  "description": "Local-first job matching for developers — ambient job matches in the Claude Code spinner. Matching runs on your machine; your profile never leaves it.",
5
5
  "repository": {
6
6
  "type": "git",