Files
Claude 1805fcbd13 Add JavaScript scripting: the sysop's own screens, on every terminal
A script (scripts_dir/NAME.js, run by a menu's script:NAME, and logon.js
after each login) draws the BBS's shared screens through ui (menus,
tables, forms, panels, messages, the editor, confirmations), so one
script works on text, RIP and 3270 terminals.  It acts as its caller,
with their access: msg (areas, messages, posting, mail), node (who's
online, node messages, its activity), user, bbs; and keeps JSON values
in data, for everyone or (data.user) for the caller, in the database
(script_data).

goja runs it in strict mode, with no files, network or processes.  A
watchdog stops a script that computes more than two seconds between
screens (the caller's time at a screen is not counted); the caller
hanging up ends a script whatever it catches; failures are logged and
told (to a sysop, with why).  Scripts are compiled once, again when
changed; bbs check refuses scripts that do not compile and menus naming
missing ones.

goja is pinned to its June 2026 commit (the last that builds with Go
1.24; it is changing quickly now).

scripts.sample has one-liners and a poll; both are tested, the
one-liners on a text terminal and on a 3270 (s3270).  That test found
3270 forms broken since the shared screens: the input field began
under its label's last character, whose attribute byte erased it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AFQhReUqUc7F5srk2hViqr
2026-10-12 14:52:12 +00:00
..

Sample scripts for scripts_dir: copy them there and give them menu items.

  oneliners.js   the last lines callers left, and one of yours
  poll.js        a poll: a vote each, the results as bars

A logon.js there runs after every login, before the menus.

See the wiki's Scripting page for what a script can do.