@rehpic/vcli 0.1.0-beta.88.1 → 0.1.0-beta.90.1
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/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2319,6 +2319,7 @@ var HEARTBEAT_INTERVAL_MS = 3e4;
|
|
|
2319
2319
|
var COMMAND_POLL_INTERVAL_MS = 5e3;
|
|
2320
2320
|
var LIVE_ACTIVITY_SYNC_INTERVAL_MS = 5e3;
|
|
2321
2321
|
var PROCESS_DISCOVERY_INTERVAL_MS = 6e4;
|
|
2322
|
+
var TERMINAL_SNAPSHOT_REFRESH_INTERVAL_MS = 18e4;
|
|
2322
2323
|
function loadBridgeConfig() {
|
|
2323
2324
|
if (!existsSync3(BRIDGE_CONFIG_FILE)) return null;
|
|
2324
2325
|
try {
|
|
@@ -2340,6 +2341,7 @@ var BridgeService = class {
|
|
|
2340
2341
|
constructor(config) {
|
|
2341
2342
|
this.timers = [];
|
|
2342
2343
|
this.terminalPeer = null;
|
|
2344
|
+
this.deviceLiveActivities = [];
|
|
2343
2345
|
this.config = config;
|
|
2344
2346
|
this.client = new ConvexHttpClient2(config.convexUrl);
|
|
2345
2347
|
}
|
|
@@ -2438,6 +2440,7 @@ var BridgeService = class {
|
|
|
2438
2440
|
deviceSecret: this.config.deviceSecret
|
|
2439
2441
|
}
|
|
2440
2442
|
);
|
|
2443
|
+
this.deviceLiveActivities = activities;
|
|
2441
2444
|
writeLiveActivitiesCache(activities);
|
|
2442
2445
|
for (const activity of activities) {
|
|
2443
2446
|
if (activity.workSessionId && activity.tmuxSessionName) {
|
|
@@ -2584,6 +2587,7 @@ var BridgeService = class {
|
|
|
2584
2587
|
await this.heartbeat();
|
|
2585
2588
|
await this.reportProcesses();
|
|
2586
2589
|
await this.refreshLiveActivities();
|
|
2590
|
+
await this.syncWorkSessionTerminals(this.deviceLiveActivities);
|
|
2587
2591
|
console.log(`[${ts2()}] Service running. Ctrl+C to stop.
|
|
2588
2592
|
`);
|
|
2589
2593
|
this.timers.push(
|
|
@@ -2614,6 +2618,16 @@ var BridgeService = class {
|
|
|
2614
2618
|
);
|
|
2615
2619
|
}, PROCESS_DISCOVERY_INTERVAL_MS)
|
|
2616
2620
|
);
|
|
2621
|
+
this.timers.push(
|
|
2622
|
+
setInterval(() => {
|
|
2623
|
+
this.syncWorkSessionTerminals(this.deviceLiveActivities).catch(
|
|
2624
|
+
(e) => console.error(
|
|
2625
|
+
`[${ts2()}] Terminal snapshot refresh error:`,
|
|
2626
|
+
e.message
|
|
2627
|
+
)
|
|
2628
|
+
);
|
|
2629
|
+
}, TERMINAL_SNAPSHOT_REFRESH_INTERVAL_MS)
|
|
2630
|
+
);
|
|
2617
2631
|
const shutdown = () => {
|
|
2618
2632
|
console.log(`
|
|
2619
2633
|
[${ts2()}] Shutting down...`);
|