@lightupai/polaris 0.0.23 → 0.0.25
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/README.md +1 -0
- package/package.json +1 -1
- package/src/daemon/daemon.ts +9 -8
package/README.md
CHANGED
|
@@ -119,6 +119,7 @@ tests/ Test suite (bun test)
|
|
|
119
119
|
- [ ] Reconciliation and recovery — `polaris recover` command that diffs the daemon JSONL log against the DB, backfills missing events, and posts an abridged recovery summary to Slack as a thread reply at the correct timeline position
|
|
120
120
|
- [ ] CD pipeline for Hetzner — auto-deploy to production on merge to master (SSH + docker compose up), similar to the npm publish job
|
|
121
121
|
- [ ] Auto-update local skill/hooks — locally installed skill and hook files go stale when the repo changes. `polaris install` fixes it but there's no staleness detection or auto-update mechanism
|
|
122
|
+
- [ ] Slack channel name collision — if a channel name was previously deleted, Slack reserves it. Bridge should handle `name_taken` by trying a prefix/suffix (e.g., `p-project-name`)
|
|
122
123
|
|
|
123
124
|
## Development
|
|
124
125
|
|
package/package.json
CHANGED
package/src/daemon/daemon.ts
CHANGED
|
@@ -346,18 +346,19 @@ export function startDaemon(port = Number(process.env.POLARIS_DAEMON_PORT ?? 432
|
|
|
346
346
|
let mapping = sessions.get(ccSessionId);
|
|
347
347
|
if (!mapping || !mapping.project) {
|
|
348
348
|
// CC session_id doesn't match any registered MCP client.
|
|
349
|
-
//
|
|
350
|
-
//
|
|
349
|
+
// The MCP server uses a different UUID than CC's session_id.
|
|
350
|
+
// Try to find the MCP session that this CC session belongs to.
|
|
351
|
+
// Heuristic: if only one connected session exists, route to it.
|
|
352
|
+
// Otherwise, drop the event — the user needs to /polaris join first.
|
|
351
353
|
const connectedSessions = Array.from(sessions.values()).filter((m) => m.project);
|
|
352
354
|
if (connectedSessions.length === 1) {
|
|
353
|
-
// Only one active session — route to it and remember the mapping
|
|
354
355
|
mapping = connectedSessions[0];
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
// Multiple sessions — can't determine which one. Discard.
|
|
358
|
-
return json({ status: "ambiguous" });
|
|
356
|
+
// Remember this mapping for future events from this CC session
|
|
357
|
+
sessions.set(ccSessionId, { ...mapping, ccSessionId });
|
|
359
358
|
} else {
|
|
360
|
-
|
|
359
|
+
// Multiple or zero sessions — can't determine which one.
|
|
360
|
+
// Drop silently; events will flow once /polaris join maps the session.
|
|
361
|
+
return json({ status: connectedSessions.length > 0 ? "ambiguous" : "not_connected" });
|
|
361
362
|
}
|
|
362
363
|
}
|
|
363
364
|
|