@dalmasonto/taskflow-mcp 1.0.20 → 1.0.21
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/dist/sse.js +6 -7
- package/package.json +1 -1
package/dist/sse.js
CHANGED
|
@@ -666,17 +666,16 @@ export async function startSSEServer() {
|
|
|
666
666
|
// Relay command polling + state pushing (if relay is configured)
|
|
667
667
|
if (RELAY_URL && RELAY_PUSH_TOKEN) {
|
|
668
668
|
console.log(`[relay] command polling started → ${RELAY_URL}`);
|
|
669
|
-
// Push state
|
|
669
|
+
// Push lightweight sync state — only what the remote app needs
|
|
670
|
+
// SSE events handle real-time updates after this initial load
|
|
670
671
|
const pushState = () => {
|
|
671
672
|
try {
|
|
672
673
|
const db = getDb();
|
|
673
674
|
const state = {
|
|
674
|
-
tasks: db.prepare('SELECT * FROM tasks').all(),
|
|
675
|
-
projects: db.prepare('SELECT * FROM projects').all(),
|
|
676
|
-
sessions: db.prepare('SELECT * FROM sessions').all(),
|
|
677
|
-
activityLogs: db.prepare('SELECT * FROM activity_logs ORDER BY id DESC LIMIT 100').all(),
|
|
678
|
-
agentMessages: db.prepare('SELECT * FROM agent_messages ORDER BY id DESC LIMIT 200').all(),
|
|
679
675
|
agentRegistry: db.prepare('SELECT * FROM agent_registry').all(),
|
|
676
|
+
agentMessages: db.prepare('SELECT * FROM agent_messages ORDER BY id DESC LIMIT 100').all(),
|
|
677
|
+
notifications: db.prepare('SELECT * FROM notifications ORDER BY id DESC LIMIT 50').all(),
|
|
678
|
+
projects: db.prepare('SELECT * FROM projects').all(),
|
|
680
679
|
};
|
|
681
680
|
fetch(`${RELAY_URL}/push/state`, {
|
|
682
681
|
method: 'POST',
|
|
@@ -687,7 +686,7 @@ export async function startSSEServer() {
|
|
|
687
686
|
catch { /* ignore */ }
|
|
688
687
|
};
|
|
689
688
|
pushState();
|
|
690
|
-
setInterval(pushState,
|
|
689
|
+
setInterval(pushState, 60_000);
|
|
691
690
|
// Poll for commands every 2s
|
|
692
691
|
setInterval(async () => {
|
|
693
692
|
try {
|