thinknagent 0.1.2 → 0.1.3

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/lib/agent.js CHANGED
@@ -64,6 +64,10 @@ class Agent {
64
64
  this.logs = new LogWatcher({ connection: this.conn, logPaths: logs });
65
65
  this.logs.start();
66
66
  });
67
+ // ← YE ADD KARO
68
+ this.conn.socket.on('agent:send_metrics_now', () => {
69
+ this.metrics.pollNow();
70
+ });
67
71
 
68
72
  // Graceful shutdown
69
73
  process.on('SIGTERM', () => this._shutdown('SIGTERM'));
@@ -92,6 +96,7 @@ class Agent {
92
96
  nodeVersion: process.version,
93
97
  });
94
98
  }
99
+
95
100
 
96
101
  _onDisconnect(reason) {
97
102
  this.shell.killAll();
package/lib/metrics.js CHANGED
@@ -22,6 +22,9 @@ class MetricsPoller {
22
22
  if (this._timer) clearInterval(this._timer);
23
23
  console.log('[metrics] Poller stopped');
24
24
  }
25
+ pollNow() {
26
+ return this._poll();
27
+ }
25
28
 
26
29
  async _poll() {
27
30
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thinknagent",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "ThinkNCollab server agent — metrics, logs, alerts, shell bridge",
5
5
  "main": "lib/agent.js",
6
6
  "bin": {