@lightupai/polaris 0.0.110 → 0.0.113

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.
@@ -41,7 +41,7 @@ if [ -f "$INSTALLED_PKG" ]; then
41
41
  NOW=$(date +%s 2>/dev/null || echo "0")
42
42
  CACHE_AGE=$(( NOW - CACHE_TS )) 2>/dev/null || CACHE_AGE=9999
43
43
  STALE=false
44
- [ "$CACHE_AGE" -gt 3600 ] 2>/dev/null && STALE=true
44
+ [ "$CACHE_AGE" -gt 300 ] 2>/dev/null && STALE=true
45
45
  else
46
46
  STALE=true
47
47
  fi
@@ -72,11 +72,26 @@ if [ "$CONNECTED" = "true" ]; then
72
72
  if [ -n "$ACCOUNT" ]; then
73
73
  ACCOUNT_TAG="[${ACCOUNT}] "
74
74
  fi
75
- if [ -n "$SLACK" ]; then
76
- echo "polaris: ${ACCOUNT_TAG}${PROJECT}/${SESSION} (${USER}) #${SLACK}${UPDATE_MSG}"
77
- else
78
- echo "polaris: ${ACCOUNT_TAG}${PROJECT}/${SESSION} (${USER})${UPDATE_MSG}"
75
+
76
+ # Liveness indicator: seconds since last delivered event
77
+ RECENCY=""
78
+ LAST_AGE=$(echo "$STATUS" | jq -r '.lastEventAge // ""' 2>/dev/null || echo "")
79
+ if [ -n "$LAST_AGE" ] && [ "$LAST_AGE" != "null" ]; then
80
+ if [ "$LAST_AGE" -lt 60 ] 2>/dev/null; then
81
+ RECENCY=" · just now"
82
+ elif [ "$LAST_AGE" -lt 3600 ] 2>/dev/null; then
83
+ RECENCY=" · $(( LAST_AGE / 60 ))m ago"
84
+ else
85
+ RECENCY=" · $(( LAST_AGE / 3600 ))h ago"
86
+ fi
87
+ fi
88
+
89
+ # Show Slack channel only when it differs from the project name (adds info, avoids duplication)
90
+ SLACK_TAG=""
91
+ if [ -n "$SLACK" ] && [ "$SLACK" != "$PROJECT" ]; then
92
+ SLACK_TAG=" → #${SLACK}"
79
93
  fi
94
+ echo "polaris: ${ACCOUNT_TAG}#${PROJECT}/${SESSION} (${USER})${SLACK_TAG}${RECENCY}${UPDATE_MSG}"
80
95
  else
81
96
  echo "polaris: not connected${UPDATE_MSG}"
82
97
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightupai/polaris",
3
- "version": "0.0.110",
3
+ "version": "0.0.113",
4
4
  "description": "Record and stream Claude Code sessions to Slack. Like Gong for AI coding — capture every prompt, response, and tool call. Multiplayer collaboration across AI coding agents.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -1042,6 +1042,13 @@ export function startDaemon(port = Number(process.env.POLARIS_DAEMON_PORT ?? 432
1042
1042
  }
1043
1043
  }
1044
1044
  }
1045
+ // Include seconds since last delivered event so the status line can show
1046
+ // a liveness indicator (e.g. "· 2m ago") without a second request.
1047
+ let lastEventAge: number | null = null;
1048
+ const cp = await readCheckpoint(ccSessionId);
1049
+ if (cp && cp.project === mapping.project && cp.session === mapping.session) {
1050
+ lastEventAge = Math.floor((Date.now() - new Date(cp.lastEventTimestamp).getTime()) / 1000);
1051
+ }
1045
1052
  return json({
1046
1053
  connected: true,
1047
1054
  project: mapping.project,
@@ -1049,6 +1056,7 @@ export function startDaemon(port = Number(process.env.POLARIS_DAEMON_PORT ?? 432
1049
1056
  user: mapping.user,
1050
1057
  slackChannel,
1051
1058
  account: emailFromToken(await getTokenForProfile(mapping.profile)),
1059
+ lastEventAge,
1052
1060
  });
1053
1061
  }
1054
1062