claudeboard 2.16.0 → 3.1.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.
@@ -0,0 +1,20 @@
1
+ # Project Context & Brand Guidelines
2
+
3
+ ## Design Tokens
4
+ - Primary color: #e3c69a
5
+ - Background: #000000 / #1a1a1a
6
+ - Font: Poppins
7
+ - Border radius: 1rem
8
+
9
+ ## Visual Reference
10
+ - Reference site: https://example.com
11
+ - Style: dark, premium, minimal
12
+
13
+ ## Tech Stack
14
+ - Framework: vanilla HTML/CSS/JS
15
+ - No external dependencies
16
+
17
+ ## Important Notes
18
+ - Always maintain existing code style
19
+ - Mobile-first responsive
20
+ - Preserve all existing sections when editing
@@ -0,0 +1,65 @@
1
+ // src/notifier.js
2
+ const https = require('https');
3
+ const { getConfig } = require('./store');
4
+
5
+ const TIMEOUT_MS = 5000;
6
+
7
+ function isValidHttpsUrl(urlStr) {
8
+ try {
9
+ const u = new URL(urlStr);
10
+ return u.protocol === 'https:';
11
+ } catch {
12
+ return false;
13
+ }
14
+ }
15
+
16
+ async function notify(event, data = {}) {
17
+ const config = getConfig();
18
+ const webhookUrl = config.webhook;
19
+ if (!webhookUrl) return;
20
+
21
+ if (!isValidHttpsUrl(webhookUrl)) {
22
+ console.warn('[notifier] Webhook URL must be https:// — skipping');
23
+ return;
24
+ }
25
+
26
+ const payload = JSON.stringify({
27
+ event,
28
+ taskTitle: data.taskTitle || null,
29
+ status: data.status || null,
30
+ timestamp: new Date().toISOString(),
31
+ });
32
+
33
+ try {
34
+ const url = new URL(webhookUrl);
35
+ const options = {
36
+ hostname: url.hostname,
37
+ port: url.port || 443,
38
+ path: url.pathname + url.search,
39
+ method: 'POST',
40
+ headers: {
41
+ 'Content-Type': 'application/json',
42
+ 'Content-Length': Buffer.byteLength(payload),
43
+ },
44
+ };
45
+
46
+ await new Promise((resolve, reject) => {
47
+ const req = https.request(options, (res) => {
48
+ res.resume();
49
+ res.on('end', resolve);
50
+ });
51
+
52
+ req.setTimeout(TIMEOUT_MS, () => {
53
+ req.destroy(new Error('Webhook request timed out'));
54
+ });
55
+
56
+ req.on('error', reject);
57
+ req.write(payload);
58
+ req.end();
59
+ });
60
+ } catch (err) {
61
+ console.warn('[notifier] Webhook error:', err.message);
62
+ }
63
+ }
64
+
65
+ module.exports = { notify };