conductor-remote 1.24.0 → 1.24.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.html CHANGED
@@ -13,7 +13,7 @@
13
13
  <title>Conductor Remote</title>
14
14
  <!-- Runs before the module bundle so it can catch a stale shell that fails to boot. -->
15
15
  <script src="/self-heal.js"></script>
16
- <script type="module" crossorigin src="/assets/index-CKMPOrHs.js"></script>
16
+ <script type="module" crossorigin src="/assets/index-CwPulZNp.js"></script>
17
17
  <link rel="stylesheet" crossorigin href="/assets/index-D6B0k-tm.css">
18
18
  <link rel="manifest" href="/manifest.webmanifest"></head>
19
19
  <body>
package/dist/sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()}).then(()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(n,r)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(i[o])return;let l={};const t=e=>s(e,o),c={module:{uri:o},exports:l,require:t};i[o]=Promise.all(n.map(e=>c[e]||t(e))).then(e=>(r(...e),l))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.clientsClaim(),e.precacheAndRoute([{url:"self-heal.js",revision:"49bd63adb25a09341f8d2610e8bd3c76"},{url:"index.html",revision:"73af7d827d5e4e46f01875f350c4cd1d"},{url:"assets/workbox-window.prod.es5-BBnX5xw4.js",revision:null},{url:"assets/index-D6B0k-tm.css",revision:null},{url:"assets/index-CKMPOrHs.js",revision:null},{url:"apple-touch-icon.png",revision:"2b9301416b880d45d4bb655f2600d1f2"},{url:"icon-192.png",revision:"c5e01ac58768627e18ee7b8b6a9239ef"},{url:"icon-512.png",revision:"a40638c55e310312457a621c9a0002c8"},{url:"icon-maskable-512.png",revision:"a40638c55e310312457a621c9a0002c8"},{url:"icon.svg",revision:"c1aee186821798733dd477e69a0ef243"},{url:"manifest.webmanifest",revision:"cf88fbc5755108a7fe0616fa160a8a15"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"),{denylist:[/^\/api\//]}))});
1
+ if(!self.define){let e,i={};const s=(s,n)=>(s=new URL(s+".js",n).href,i[s]||new Promise(i=>{if("document"in self){const e=document.createElement("script");e.src=s,e.onload=i,document.head.appendChild(e)}else e=s,importScripts(s),i()}).then(()=>{let e=i[s];if(!e)throw new Error(`Module ${s} didn’t register its module`);return e}));self.define=(n,r)=>{const o=e||("document"in self?document.currentScript.src:"")||location.href;if(i[o])return;let l={};const t=e=>s(e,o),c={module:{uri:o},exports:l,require:t};i[o]=Promise.all(n.map(e=>c[e]||t(e))).then(e=>(r(...e),l))}}define(["./workbox-9c191d2f"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.clientsClaim(),e.precacheAndRoute([{url:"self-heal.js",revision:"49bd63adb25a09341f8d2610e8bd3c76"},{url:"index.html",revision:"10a936223613b13295ae03573d7c550a"},{url:"assets/workbox-window.prod.es5-BBnX5xw4.js",revision:null},{url:"assets/index-D6B0k-tm.css",revision:null},{url:"assets/index-CwPulZNp.js",revision:null},{url:"apple-touch-icon.png",revision:"2b9301416b880d45d4bb655f2600d1f2"},{url:"icon-192.png",revision:"c5e01ac58768627e18ee7b8b6a9239ef"},{url:"icon-512.png",revision:"a40638c55e310312457a621c9a0002c8"},{url:"icon-maskable-512.png",revision:"a40638c55e310312457a621c9a0002c8"},{url:"icon.svg",revision:"c1aee186821798733dd477e69a0ef243"},{url:"manifest.webmanifest",revision:"cf88fbc5755108a7fe0616fa160a8a15"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/index.html"),{denylist:[/^\/api\//]}))});
@@ -37,15 +37,24 @@ function main() {
37
37
  }
38
38
  const arg = process.argv[2];
39
39
  const seconds = parseDuration(arg);
40
- // Do everything as a single root shell: set the keep-awake, then either sleep for
41
- // the duration or idle forever, and ALWAYS restore on exit via the trap. One sudo
42
- // prompt covers set + restore, and the trap fires even on Ctrl-C / kill. Mirror the
43
- // proven battery setup — disablesleep + standby + Power Nap off — so the system
44
- // stays genuinely awake (not just idle-awake) with the lid shut.
40
+ // Do everything as a single root shell: capture the CURRENT power settings, flip them
41
+ // to keep the Mac awake, and ALWAYS restore *those captured values* on exit via the
42
+ // trap — never assume defaults, or we'd clobber a value you (or a config profile) had
43
+ // deliberately set. One sudo prompt covers the whole window; the trap fires even on
44
+ // Ctrl-C / kill. `disablesleep` is global (reported as `SleepDisabled` by `pmset -g`);
45
+ // `standby`/`powernap` are per-source, so read them from the Battery Power block.
45
46
  const sleepStep = seconds !== null ? `sleep ${seconds}` : 'while :; do sleep 86400; done';
46
- const set = 'pmset -a disablesleep 1 standby 0 powernap 0';
47
- const restore = 'pmset -a disablesleep 0 standby 1 powernap 1';
48
- const script = `${set} && trap '${restore}' EXIT INT TERM && ${sleepStep}`;
47
+ const battValue = (key) => `pmset -g custom | awk '/^Battery Power:/{b=1;next} /^AC Power:/{b=0} b&&$1=="${key}"{print $2;exit}'`;
48
+ const script = [
49
+ `sb=$(${battValue('standby')})`,
50
+ `pn=$(${battValue('powernap')})`,
51
+ "ds=$(pmset -g | awk '/SleepDisabled/{print $2;exit}')",
52
+ // Arm the restore-to-captured before changing anything, so even a failed set reverts.
53
+ `trap "pmset -b standby \${sb:-1} powernap \${pn:-1}; pmset -a disablesleep \${ds:-0}" EXIT INT TERM`,
54
+ 'pmset -b standby 0 powernap 0',
55
+ 'pmset -a disablesleep 1',
56
+ sleepStep
57
+ ].join('\n');
49
58
  console.info('conductor-remote nosleep — keeping this Mac awake (incl. lid-closed system sleep).');
50
59
  console.info(seconds !== null ? `Duration: ${arg} — Ctrl-C to stop early.` : 'Runs until you press Ctrl-C.');
51
60
  // Be honest: this handles sleep only. It does NOT enable sending with the lid shut
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-remote",
3
- "version": "1.24.0",
3
+ "version": "1.24.1",
4
4
  "type": "module",
5
5
  "packageManager": "yarn@4.15.0",
6
6
  "description": "Phone control panel for local Conductor agents. Reads ride SQLite + git; prompts ride Conductor's own dispatch path.",