ProdCom is a sandboxed Mac App Store app whose HTTP API lives inside it, behind the UserDefaults switch applicationAPIEnabled — absent means off, and a running ProdCom does not notice the switch changing; it reads it at launch. So when the tile says "unreachable" on a booth where ProdCom runs on the same Mac, there are two causes and two fixes: ProdCom is not running (open it), or it is running with the API off (set the switch, quit it, open it again). The module's server now does both, behind two Admin switches, both on: "Start ProdCom when it is offline" and "Restart ProdCom to turn its API on". On a connection-level failure (never an HTTP answer) the supervisor runs up to three attempts five seconds apart: not running → open -g -b; running with the switch off → write it, read it back, ask ProdCom to quit (Apple Event, SIGTERM after 5 s), open it again — at most once per outage; running with the switch on → keep probing, and only blame the port if that is still true on the third look, because a quitting ProdCom still shows in pgrep. A successful run nudges the module to reconnect at once. It gives up with a tile message until ProdCom answers again, and does nothing at all for a ProdCom on another machine or off macOS. The launcher gains the Apple Events entitlement and usage string so the polite quit can be granted; if it is denied, SIGTERM does the job. Verified live on the dev Mac against ProdCom 2.3.4: not running + switch absent → opened, switch written, restarted, Live after two attempts; an operator's Cmd-Q → reopened. 71 fake-driven tests (node --test), the OS layer included through an injectable execFile. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
64 lines
1.9 KiB
JSON
64 lines
1.9 KiB
JSON
{
|
||
"id": "prodcom-transcript",
|
||
"name": "ProdCom",
|
||
"version": "1.5.0",
|
||
"proddash": ">=1.4.0",
|
||
"description": "Live ProdCom transcript; typed text to a ProdCom channel through the Send Message module",
|
||
"permissions": [
|
||
{
|
||
"kind": "local-network",
|
||
"reason": "Reaching the ProdCom API on this network"
|
||
}
|
||
],
|
||
"provides": [
|
||
"messaging"
|
||
],
|
||
"client": "client.js",
|
||
"server": "server.js",
|
||
"style": "style.css",
|
||
"minSize": {
|
||
"w": 3,
|
||
"h": 2
|
||
},
|
||
"defaultSize": {
|
||
"w": 4,
|
||
"h": 4
|
||
},
|
||
"configSchema": {
|
||
"prodcom": {
|
||
"type": "endpoint",
|
||
"label": "ProdCom server",
|
||
"default": {
|
||
"host": "",
|
||
"port": 24480
|
||
},
|
||
"help": "The ProdCom server at THIS location — every campus has its own. Blank until you set it, so a new install never reads another campus’s comms. The Send Message module sends typed text to these channels through this connection."
|
||
},
|
||
"apiKey": {
|
||
"type": "password",
|
||
"label": "API key (only if PSK auth is enabled in ProdCom)",
|
||
"default": ""
|
||
},
|
||
"autoStart": {
|
||
"type": "switch",
|
||
"label": "Start ProdCom when it is offline",
|
||
"default": true,
|
||
"help": "Only when ProdCom runs on this machine (the server above is 127.0.0.1 or this Mac’s own address). If ProdCom is not running, ProdDash opens it — up to three tries, five seconds apart. macOS only."
|
||
},
|
||
"apiRestart": {
|
||
"type": "switch",
|
||
"label": "Restart ProdCom to turn its API on",
|
||
"default": true,
|
||
"showWhen": "autoStart",
|
||
"help": "When ProdCom is running but its Application API is switched off, ProdDash turns the API on and restarts ProdCom to apply it (about ten seconds without intercom). Off: the API is turned on for ProdCom’s next start and the tile says to restart it."
|
||
}
|
||
},
|
||
"instanceSchema": {
|
||
"showAvatars": {
|
||
"type": "boolean",
|
||
"label": "Channel icons",
|
||
"default": true
|
||
}
|
||
}
|
||
}
|