windsor-bot 0.1.16 → 0.2.0
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/README.md +17 -190
- package/dist/ai.js +10 -91
- package/dist/bot.js +152 -151
- package/dist/index.js +1 -5
- package/dist/server.js +24 -8
- package/dist/web/app.bundle.js +5 -5
- package/dist/web/app.js +5 -5
- package/package.json +2 -3
package/dist/web/app.js
CHANGED
|
@@ -52,7 +52,7 @@ function CheckField({ label, checked, onChange }) {
|
|
|
52
52
|
}
|
|
53
53
|
function BehaviorConfig({ config, onChange }) {
|
|
54
54
|
const t = config.type;
|
|
55
|
-
return (_jsxs("div", { style: { paddingTop: '12px' }, children: [(t === 'immediate-print' || t === 'accumulating-list' || t === '
|
|
55
|
+
return (_jsxs("div", { style: { paddingTop: '12px' }, children: [(t === 'immediate-print' || t === 'accumulating-list' || t === 'reusable-list') && (_jsxs(_Fragment, { children: [_jsx(Field, { label: "Header", value: config.header ?? '', onChange: v => { const c = { ...config }; if (v) {
|
|
56
56
|
c.header = v;
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
@@ -62,7 +62,7 @@ function BehaviorConfig({ config, onChange }) {
|
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
64
|
delete c.footer;
|
|
65
|
-
} onChange(c); }, placeholder: "Optional footer text" }), _jsx(CheckField, { label: "Include metadata footer", checked: config.includeMetadata ?? false, onChange: v => onChange({ ...config, includeMetadata: v }) })] })),
|
|
65
|
+
} onChange(c); }, placeholder: "Optional footer text" }), _jsx(CheckField, { label: "Include metadata footer", checked: config.includeMetadata ?? false, onChange: v => onChange({ ...config, includeMetadata: v }) })] })), t === 'immediate-print' && (_jsx(CheckField, { label: "Include AI-generated icon (requires OpenAI key)", checked: config.includeIcon ?? false, onChange: v => onChange({ ...config, includeIcon: v }) })), t === 'accumulating-list' && (_jsx(CheckField, { label: "Include checklist boxes", checked: config.includeChecklist ?? false, onChange: v => onChange({ ...config, includeChecklist: v }) }))] }));
|
|
66
66
|
}
|
|
67
67
|
function ChannelRow({ mapping, onDelete, onUpdate }) {
|
|
68
68
|
const [expanded, setExpanded] = useState(false);
|
|
@@ -132,8 +132,8 @@ function ChannelBehaviors({ refreshKey }) {
|
|
|
132
132
|
? { type: 'immediate-print', includeIcon: false, includeMetadata: false }
|
|
133
133
|
: addBehavior === 'accumulating-list'
|
|
134
134
|
? { type: 'accumulating-list', includeChecklist: false, includeMetadata: false }
|
|
135
|
-
: addBehavior === '
|
|
136
|
-
? { type: '
|
|
135
|
+
: addBehavior === 'reusable-list'
|
|
136
|
+
? { type: 'reusable-list', includeMetadata: false }
|
|
137
137
|
: { type: 'on-demand' };
|
|
138
138
|
await jsonPost('/api/channels', { channelId: dc.id, channelName: dc.name, config: defaultConfig });
|
|
139
139
|
setAddChannelId('');
|
|
@@ -156,7 +156,7 @@ function ChannelBehaviors({ refreshKey }) {
|
|
|
156
156
|
setErr(e instanceof Error ? e.message : String(e));
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
return (_jsxs("section", { style: S.box, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '12px', marginBottom: '12px' }, children: [_jsx("h2", { style: { marginTop: 0, marginBottom: 0 }, children: "Channel Behaviors" }), _jsx("button", { style: { ...S.btn, marginRight: 0 }, onClick: () => void refreshFromDiscord(), children: "Refresh Channels" })] }), err && _jsx("p", { style: S.err, children: err }), _jsxs("table", { style: { width: '100%', borderCollapse: 'collapse', marginBottom: '16px' }, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { style: S.th, children: "Channel" }), _jsx("th", { style: S.th, children: "Behavior" }), _jsx("th", { style: { ...S.th, textAlign: 'right' }, children: "Actions" })] }) }), data?.channels.map(m => (_jsx(ChannelRow, { mapping: m, onDelete: () => void deleteChannel(m.channelId), onUpdate: c => void updateChannel(m.channelId, c) }, m.channelId))), (!data || data.channels.length === 0) && (_jsx("tbody", { children: _jsx("tr", { children: _jsx("td", { colSpan: 3, style: { ...S.td, color: '#b4bdc8' }, children: "No channel mappings yet." }) }) }))] }), _jsxs("div", { style: S.grid3, children: [_jsxs("label", { style: S.label, children: [_jsx("span", { style: S.labelText, children: "Channel" }), _jsxs("select", { style: S.select, value: addChannelId, onChange: e => setAddChannelId(e.currentTarget.value), children: [_jsx("option", { value: "", children: "Select channel\u2026" }), data?.unmapped.map(c => _jsxs("option", { value: c.id, children: ["#", c.name] }, c.id))] })] }), _jsxs("label", { style: S.label, children: [_jsx("span", { style: S.labelText, children: "Behavior" }), _jsxs("select", { style: S.select, value: addBehavior, onChange: e => setAddBehavior(e.currentTarget.value), children: [_jsx("option", { value: "immediate-print", children: "\uD83D\uDDA8\uFE0F Immediate Print" }), _jsx("option", { value: "accumulating-list", children: "\uD83D\uDED2 Accumulating List" }), _jsx("option", { value: "
|
|
159
|
+
return (_jsxs("section", { style: S.box, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '12px', marginBottom: '12px' }, children: [_jsx("h2", { style: { marginTop: 0, marginBottom: 0 }, children: "Channel Behaviors" }), _jsx("button", { style: { ...S.btn, marginRight: 0 }, onClick: () => void refreshFromDiscord(), children: "Refresh Channels" })] }), err && _jsx("p", { style: S.err, children: err }), _jsxs("table", { style: { width: '100%', borderCollapse: 'collapse', marginBottom: '16px' }, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { style: S.th, children: "Channel" }), _jsx("th", { style: S.th, children: "Behavior" }), _jsx("th", { style: { ...S.th, textAlign: 'right' }, children: "Actions" })] }) }), data?.channels.map(m => (_jsx(ChannelRow, { mapping: m, onDelete: () => void deleteChannel(m.channelId), onUpdate: c => void updateChannel(m.channelId, c) }, m.channelId))), (!data || data.channels.length === 0) && (_jsx("tbody", { children: _jsx("tr", { children: _jsx("td", { colSpan: 3, style: { ...S.td, color: '#b4bdc8' }, children: "No channel mappings yet." }) }) }))] }), _jsxs("div", { style: S.grid3, children: [_jsxs("label", { style: S.label, children: [_jsx("span", { style: S.labelText, children: "Channel" }), _jsxs("select", { style: S.select, value: addChannelId, onChange: e => setAddChannelId(e.currentTarget.value), children: [_jsx("option", { value: "", children: "Select channel\u2026" }), data?.unmapped.map(c => _jsxs("option", { value: c.id, children: ["#", c.name] }, c.id))] })] }), _jsxs("label", { style: S.label, children: [_jsx("span", { style: S.labelText, children: "Behavior" }), _jsxs("select", { style: S.select, value: addBehavior, onChange: e => setAddBehavior(e.currentTarget.value), children: [_jsx("option", { value: "immediate-print", children: "\uD83D\uDDA8\uFE0F Immediate Print" }), _jsx("option", { value: "accumulating-list", children: "\uD83D\uDED2 Accumulating List" }), _jsx("option", { value: "reusable-list", children: "\uD83D\uDD01 Reusable List" }), _jsx("option", { value: "on-demand", children: "\uD83D\uDCAC On-Demand" })] })] }), _jsx("button", { style: S.btn, onClick: () => void addMapping(), disabled: !addChannelId, children: "Add" })] })] }));
|
|
160
160
|
}
|
|
161
161
|
function PrintModeSection() {
|
|
162
162
|
const [printConfig, setPrintConfig] = useState(null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "windsor-bot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Self-hosted Discord bot automation for household list and todo printing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
"pdfkit": "^0.19.1",
|
|
48
48
|
"preact": "^10.29.7",
|
|
49
49
|
"qrcode": "^1.5.4",
|
|
50
|
-
"serialport": "^13.0.0"
|
|
51
|
-
"zod": "^4.4.3"
|
|
50
|
+
"serialport": "^13.0.0"
|
|
52
51
|
}
|
|
53
52
|
}
|