Files
matrix/hookshot/devdesk.js
T
jaredandClaude Opus 5.5 f2db3b1b3e
Lint / Shell (shellcheck) (push) Successful in 12s
Lint / JS (eslint) (push) Successful in 9s
Lint / No secrets in webhook configs (push) Successful in 4s
Lint / Landing page is rendered (matrix (push) Successful in 5s
Lint / Python (ruff) (push) Successful in 5s
Lint / Python deps (pip-audit) (push) Successful in 42s
Lint / Secret scan (gitleaks) (push) Successful in 6s
hookshot: DevDesk "Claude needs you" webhook (devdesk#28)
devdesk-notify-matrix on CT 126 posts here when a Claude session waits for
input and no browser tab or SSH client is attached. Deploying this transform
creates the Devdesk hook in Spam and Stuff.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 23:30:31 -04:00

20 lines
942 B
JavaScript

// DevDesk "Claude needs you" (devdesk#28)
// Receives: { session, message, url, host, text } from devdesk-notify-matrix on
// CT 126 when a Claude session waits for input and no browser tab or SSH client
// is attached to it.
var session = String(data.session || 'a session');
var message = String(data.message || 'Claude is waiting for your input');
var url = data.url ? String(data.url) : '';
function esc(t) {
return t.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
}
// m.text, not m.notice: notices are muted by default push rules, and this one
// exists to reach your phone.
result = {
version: 'v2',
plain: '🔔 Claude needs you in ' + session + ': ' + message + (url ? ' — ' + url : ''),
html: '🔔 <b>Claude needs you</b> in <code>' + esc(session) + '</code>: ' + esc(message)
+ (url ? ' — <a href="' + esc(url) + '">open in DevDesk</a>' : ''),
msgtype: 'm.text',
};