@lightupai/polaris 0.0.113 → 0.0.116
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/hooks/statusline.sh +22 -2
- package/package.json +1 -1
- package/src/daemon/daemon.ts +21 -4
package/hooks/statusline.sh
CHANGED
|
@@ -57,8 +57,28 @@ if [ -f "$INSTALLED_PKG" ]; then
|
|
|
57
57
|
) &
|
|
58
58
|
fi
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
# Only notify when the registry version is strictly newer (prevents false
|
|
61
|
+
# positives when a freshly-updated client's cache still shows an older latest).
|
|
62
|
+
if [ -n "$CACHED_LATEST" ] && [ -n "$INSTALLED_VERSION" ]; then
|
|
63
|
+
_ver_gt() {
|
|
64
|
+
# Returns true (0) when $1 is semver-greater than $2
|
|
65
|
+
# Works for the "0.0.NNN" format used by polaris.
|
|
66
|
+
IFS=. read -r _a1 _a2 _a3 <<_EOF_
|
|
67
|
+
$1
|
|
68
|
+
_EOF_
|
|
69
|
+
IFS=. read -r _b1 _b2 _b3 <<_EOF_
|
|
70
|
+
$2
|
|
71
|
+
_EOF_
|
|
72
|
+
[ "${_a1:-0}" -gt "${_b1:-0}" ] && return 0
|
|
73
|
+
[ "${_a1:-0}" -lt "${_b1:-0}" ] && return 1
|
|
74
|
+
[ "${_a2:-0}" -gt "${_b2:-0}" ] && return 0
|
|
75
|
+
[ "${_a2:-0}" -lt "${_b2:-0}" ] && return 1
|
|
76
|
+
[ "${_a3:-0}" -gt "${_b3:-0}" ] && return 0
|
|
77
|
+
return 1
|
|
78
|
+
}
|
|
79
|
+
if _ver_gt "$CACHED_LATEST" "$INSTALLED_VERSION"; then
|
|
80
|
+
UPDATE_MSG=" [v${INSTALLED_VERSION}, update available]"
|
|
81
|
+
fi
|
|
62
82
|
fi
|
|
63
83
|
fi
|
|
64
84
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightupai/polaris",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.116",
|
|
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",
|
package/src/daemon/daemon.ts
CHANGED
|
@@ -707,6 +707,17 @@ export function startDaemon(port = Number(process.env.POLARIS_DAEMON_PORT ?? 432
|
|
|
707
707
|
};
|
|
708
708
|
sessions.set(body.ccSessionId, mapping);
|
|
709
709
|
|
|
710
|
+
// Evict stale alias entries that share this (project, session) pair.
|
|
711
|
+
// After a reconnect the old CC session ID still has an entry with the
|
|
712
|
+
// same pair; leaving it allows hook events from the old shell to
|
|
713
|
+
// alias-claim a future pending session or send duplicate events.
|
|
714
|
+
for (const [id, m] of sessions) {
|
|
715
|
+
if (id !== body.ccSessionId && m.project === mapping.project && m.session === mapping.session) {
|
|
716
|
+
sessions.delete(id);
|
|
717
|
+
console.error(`[daemon] Evicted stale alias ${id.slice(0, 8)} for ${mapping.project}/${mapping.session}`);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
|
|
710
721
|
// Ensure the session exists (create if not, claim driver)
|
|
711
722
|
// Retry with new name on 409 (collision with generated name)
|
|
712
723
|
let attempts = 0;
|
|
@@ -850,10 +861,16 @@ export function startDaemon(port = Number(process.env.POLARIS_DAEMON_PORT ?? 432
|
|
|
850
861
|
// ran polaris_connect. Always returns not_connected; hooks from
|
|
851
862
|
// unjoined shells are never auto-routed to an existing session.
|
|
852
863
|
let mapping = sessions.get(ccSessionId);
|
|
853
|
-
if (
|
|
854
|
-
// CC
|
|
855
|
-
//
|
|
856
|
-
// session
|
|
864
|
+
if (mapping && !mapping.project) {
|
|
865
|
+
// Known CC session ID but deliberately disconnected (project cleared
|
|
866
|
+
// by /disconnect). Hooks still fire after disconnect — do NOT
|
|
867
|
+
// alias-claim a pending session; the shell intentionally left.
|
|
868
|
+
return json({ status: "not_connected" });
|
|
869
|
+
}
|
|
870
|
+
if (!mapping) {
|
|
871
|
+
// Truly unknown CC session_id — the MCP client's UUID differs from
|
|
872
|
+
// CC's hook session_id. Match to a session with pendingMapping
|
|
873
|
+
// (most recent first) to learn the alias.
|
|
857
874
|
const pending = Array.from(sessions.values()).filter((m) => m.project && m.pendingMapping);
|
|
858
875
|
if (pending.length > 0) {
|
|
859
876
|
// Map the CC session ID to the most recently connected pending session
|