lightman-agent 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/bin/cms-agent.js +6 -6
  2. package/package.json +22 -22
package/bin/cms-agent.js CHANGED
@@ -8,7 +8,7 @@ import { spawnSync } from 'child_process';
8
8
  import { createInterface } from 'readline/promises';
9
9
  import { stdin as input, stdout as output, cwd, platform, exit } from 'process';
10
10
 
11
- const DEFAULT_SERVER = 'http://192.168.1.181:3401';
11
+ const DEFAULT_SERVER = 'http://192.168.1.100:3401';
12
12
  const INSTALL_CONFIG_PATH = 'C:\\Program Files\\Lightman\\Agent\\agent.config.json';
13
13
 
14
14
  function printUsage() {
@@ -22,7 +22,7 @@ Commands:
22
22
 
23
23
  Options:
24
24
  --slug <value> Device slug (example: C-AV01)
25
- --server <url> Server URL (example: http://192.168.1.181:3401)
25
+ --server <url> Server URL (example: http://192.168.1.100:3401)
26
26
  --timezone <tz> Timezone override (default: Asia/Kolkata)
27
27
  --no-restart Skip reboot after successful install/update
28
28
  -h, --help Show help
@@ -143,8 +143,8 @@ function installUsingPowerShell({ scriptPath, slug, server, timezone, noRestart
143
143
  runOrFail('powershell.exe', args);
144
144
 
145
145
  if (!noRestart) {
146
- console.log('Installation completed. Rebooting in 10 seconds...');
147
- runOrFail('shutdown.exe', ['/r', '/t', '10', '/c', 'CMS Agent installation complete']);
146
+ console.log('Installation completed. Rebooting now...');
147
+ runOrFail('shutdown.exe', ['/r', '/t', '0', '/c', 'CMS Agent installation complete']);
148
148
  }
149
149
  }
150
150
 
@@ -159,7 +159,7 @@ async function runInstall(opts) {
159
159
  const localConfig = safeReadJson(resolve(cwd(), 'agent.config.json')) || {};
160
160
  const installedConfig = safeReadJson(INSTALL_CONFIG_PATH) || {};
161
161
  const defaultSlug = opts.slug || localConfig.deviceSlug || installedConfig.deviceSlug || '';
162
- const server = opts.server || localConfig.serverUrl || installedConfig.serverUrl || DEFAULT_SERVER;
162
+ const server = opts.server || DEFAULT_SERVER;
163
163
  const timezone = opts.timezone || localConfig?.powerSchedule?.timezone || installedConfig?.powerSchedule?.timezone || 'Asia/Kolkata';
164
164
  const noRestart = Boolean(opts.noRestart);
165
165
 
@@ -191,7 +191,7 @@ async function runUpdate(opts) {
191
191
 
192
192
  const installedConfig = safeReadJson(INSTALL_CONFIG_PATH) || {};
193
193
  const slug = opts.slug || installedConfig.deviceSlug;
194
- const server = opts.server || installedConfig.serverUrl || DEFAULT_SERVER;
194
+ const server = opts.server || DEFAULT_SERVER;
195
195
  const timezone = opts.timezone || installedConfig?.powerSchedule?.timezone || 'Asia/Kolkata';
196
196
  const noRestart = Boolean(opts.noRestart);
197
197
  const scriptPath = resolveInstallScript();
package/package.json CHANGED
@@ -1,30 +1,30 @@
1
1
  {
2
2
  "name": "lightman-agent",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "LIGHTMAN Agent - System-level daemon for museum display machines",
5
5
  "private": false,
6
6
  "type": "module",
7
- "bin": {
8
- "cms-agent": "bin/cms-agent.js",
9
- "lightman-agent": "bin/cms-agent.js"
10
- },
11
- "files": [
12
- "bin/",
13
- "nssm/",
14
- "public/",
15
- "scripts/",
16
- "src/index.ts",
17
- "src/commands/",
18
- "src/lib/",
19
- "src/services/",
20
- "agent.config.template.json",
21
- "package-lock.json",
22
- "tsconfig.json"
23
- ],
24
- "publishConfig": {
25
- "access": "public"
26
- },
27
- "scripts": {
7
+ "bin": {
8
+ "cms-agent": "bin/cms-agent.js",
9
+ "lightman-agent": "bin/cms-agent.js"
10
+ },
11
+ "files": [
12
+ "bin/",
13
+ "nssm/",
14
+ "public/",
15
+ "scripts/",
16
+ "src/index.ts",
17
+ "src/commands/",
18
+ "src/lib/",
19
+ "src/services/",
20
+ "agent.config.template.json",
21
+ "package-lock.json",
22
+ "tsconfig.json"
23
+ ],
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "scripts": {
28
28
  "dev": "tsx watch src/index.ts",
29
29
  "cms-agent": "node ./bin/cms-agent.js",
30
30
  "sync-display": "node -e \"const{cpSync,rmSync,mkdirSync}=require('fs');rmSync('public',{recursive:true,force:true});mkdirSync('public',{recursive:true});cpSync('../display/dist','public',{recursive:true});console.log('Display synced to agent/public/')\"",