thinknagent 0.1.0 → 0.1.2

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.
@@ -21,6 +21,7 @@ program
21
21
  .description('Register this server with ThinkNCollab')
22
22
  .requiredOption('--server <url>', 'ThinkNCollab server URL (e.g. https://thinkncollab.com)')
23
23
  .requiredOption('--name <name>', 'Display name for this server on the DevOps Wall')
24
+ .option('--room <roomId>', 'Room ID to connect to')
24
25
  .option('--gpu', 'Enable GPU metrics (requires nvidia-smi)')
25
26
  .option('--logs <paths>', 'Comma-separated log file paths to stream')
26
27
  .action(async (opts) => {
@@ -38,6 +39,7 @@ program
38
39
  name: opts.name,
39
40
  gpu: !!opts.gpu,
40
41
  logs: opts.logs ? opts.logs.split(',').map(s => s.trim()) : [],
42
+ roomId: opts.room,
41
43
  alerts: [
42
44
  // sensible defaults — Owner can edit in browser
43
45
  { id: 'cpu-high', metric: 'cpu.usage', op: 'gt', value: 85, for: 60, severity: 'warning' },
package/lib/connect.js CHANGED
@@ -28,20 +28,21 @@ class Connection {
28
28
  }
29
29
 
30
30
  connect() {
31
- const cfg = store.read();
32
-
33
- this.socket = io(`${this.serverUrl}${NAMESPACE}`, {
34
- reconnection: true,
35
- reconnectionDelay: RECONNECT_DELAY,
36
- reconnectionAttempts: Infinity,
37
- auth: {
38
- agentId: cfg.agentId,
39
- agentToken: cfg.agentToken || null, // null = first time / pending
40
- name: cfg.name,
41
- hostname: require('os').hostname(),
42
- version: require('../package.json').version,
43
- }
44
- });
31
+ const cfg = store.read();
32
+
33
+ this.socket = io(`${this.serverUrl}${NAMESPACE}`, {
34
+ reconnection: true,
35
+ reconnectionDelay: RECONNECT_DELAY,
36
+ reconnectionAttempts: Infinity,
37
+ auth: {
38
+ agentId: cfg.agentId,
39
+ agentToken: cfg.agentToken || null,
40
+ name: cfg.name,
41
+ hostname: require('os').hostname(),
42
+ version: require('../package.json').version,
43
+ roomId: cfg.roomId || null, // ← yeh add karo
44
+ }
45
+ });
45
46
 
46
47
  this._bind();
47
48
  return this.socket;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thinknagent",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "ThinkNCollab server agent — metrics, logs, alerts, shell bridge",
5
5
  "main": "lib/agent.js",
6
6
  "bin": {