skill-monster 0.0.0-stage → 0.1.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.
Files changed (88) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +155 -2
  3. package/desk-ui/app.css +73 -0
  4. package/desk-ui/app.js +182 -0
  5. package/desk-ui/fonts/bricolage-grotesque-800.woff2 +0 -0
  6. package/desk-ui/fonts/ibm-plex-mono-400.woff2 +0 -0
  7. package/desk-ui/fonts/ibm-plex-mono-600.woff2 +0 -0
  8. package/desk-ui/fonts/ibm-plex-sans-400.woff2 +0 -0
  9. package/desk-ui/fonts/silkscreen-400.woff2 +0 -0
  10. package/desk-ui/fonts.css +70 -0
  11. package/desk-ui/index.html +29 -0
  12. package/desk-ui/mascot.svg +1 -0
  13. package/dist/build.json +1 -0
  14. package/dist/cli/index.d.ts +2 -0
  15. package/dist/cli/index.js +640 -0
  16. package/dist/cli/ui.d.ts +18 -0
  17. package/dist/cli/ui.js +120 -0
  18. package/dist/core/checkup.d.ts +14 -0
  19. package/dist/core/checkup.js +69 -0
  20. package/dist/core/corrections.d.ts +54 -0
  21. package/dist/core/corrections.js +138 -0
  22. package/dist/core/digest.d.ts +36 -0
  23. package/dist/core/digest.js +91 -0
  24. package/dist/core/export.d.ts +8 -0
  25. package/dist/core/export.js +28 -0
  26. package/dist/core/external.d.ts +48 -0
  27. package/dist/core/external.js +127 -0
  28. package/dist/core/guard.d.ts +10 -0
  29. package/dist/core/guard.js +48 -0
  30. package/dist/core/mirror.d.ts +37 -0
  31. package/dist/core/mirror.js +148 -0
  32. package/dist/core/release.d.ts +69 -0
  33. package/dist/core/release.js +173 -0
  34. package/dist/core/report.d.ts +10 -0
  35. package/dist/core/report.js +65 -0
  36. package/dist/core/scrub.d.ts +20 -0
  37. package/dist/core/scrub.js +67 -0
  38. package/dist/core/sign.d.ts +25 -0
  39. package/dist/core/sign.js +86 -0
  40. package/dist/core/skill.d.ts +26 -0
  41. package/dist/core/skill.js +68 -0
  42. package/dist/core/starters.d.ts +54 -0
  43. package/dist/core/starters.js +184 -0
  44. package/dist/core/types.d.ts +187 -0
  45. package/dist/core/types.js +1 -0
  46. package/dist/core/version.d.ts +4 -0
  47. package/dist/core/version.js +17 -0
  48. package/dist/core/workspace.d.ts +23 -0
  49. package/dist/core/workspace.js +79 -0
  50. package/dist/desk/server.d.ts +10 -0
  51. package/dist/desk/server.js +140 -0
  52. package/dist/index.d.ts +11 -0
  53. package/dist/index.js +10 -0
  54. package/dist/mcp/server.d.ts +8 -0
  55. package/dist/mcp/server.js +112 -0
  56. package/dist/providers/index.d.ts +15 -0
  57. package/dist/providers/index.js +123 -0
  58. package/dist/slack/api.d.ts +6 -0
  59. package/dist/slack/api.js +18 -0
  60. package/dist/slack/app.d.ts +70 -0
  61. package/dist/slack/app.js +387 -0
  62. package/dist/slack/manifest.d.ts +50 -0
  63. package/dist/slack/manifest.js +71 -0
  64. package/dist/slack/messages.d.ts +414 -0
  65. package/dist/slack/messages.js +226 -0
  66. package/dist/slack/socket.d.ts +24 -0
  67. package/dist/slack/socket.js +84 -0
  68. package/dist/stores/airtable.d.ts +26 -0
  69. package/dist/stores/airtable.js +52 -0
  70. package/dist/stores/confluence-format.d.ts +34 -0
  71. package/dist/stores/confluence-format.js +458 -0
  72. package/dist/stores/confluence.d.ts +55 -0
  73. package/dist/stores/confluence.js +204 -0
  74. package/dist/stores/index.d.ts +30 -0
  75. package/dist/stores/index.js +53 -0
  76. package/dist/stores/notion.d.ts +43 -0
  77. package/dist/stores/notion.js +313 -0
  78. package/docs/SECURITY.md +45 -0
  79. package/docs/slack.md +78 -0
  80. package/package.json +48 -4
  81. package/starters/_core/SKILL.md +30 -0
  82. package/starters/customer-support-answers/starter.yaml +98 -0
  83. package/starters/data-warehouse-kb/starter.yaml +119 -0
  84. package/starters/engineering-house-rules/starter.yaml +106 -0
  85. package/starters/people-policies/starter.yaml +89 -0
  86. package/starters/pricing-and-packaging/starter.yaml +90 -0
  87. package/starters/product-analytics-kb/starter.yaml +109 -0
  88. package/starters/security-questionnaire-answers/starter.yaml +94 -0
package/desk-ui/app.js ADDED
@@ -0,0 +1,182 @@
1
+ // The Desk. Plain JS, no build step, talks only to the server it came from.
2
+ const $ = s => document.querySelector(s);
3
+ const esc = v => String(v ?? '').replace(/[&<>"']/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' }[c]));
4
+ const api = async (path, body) => {
5
+ const r = await fetch('/api' + path, body ? { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Skill-Monster': '1' }, body: JSON.stringify(body) } : {});
6
+ const j = await r.json();
7
+ if (!r.ok) throw Object.assign(new Error(j.error || r.statusText), j);
8
+ return j;
9
+ };
10
+ const ago = iso => { const s = (Date.now() - new Date(iso)) / 1000; return s < 3600 ? `${Math.max(1, s / 60 | 0)}m ago` : s < 86400 ? `${s / 3600 | 0}h ago` : `${s / 86400 | 0}d ago`; };
11
+ let toastT;
12
+ const toast = html => { const t = $('#toast'); t.innerHTML = html; t.hidden = false; clearTimeout(toastT); toastT = setTimeout(() => t.hidden = true, 6000); };
13
+ let state;
14
+
15
+ async function refresh() {
16
+ state = await api('/state');
17
+ $('#org').textContent = state.org;
18
+ $('#c-inbox').textContent = state.open || '';
19
+ $('#c-skills').textContent = state.skills.length || '';
20
+ $('#c-releases').textContent = state.releases || '';
21
+ const rungText = state.rung === 0 ? 'Runs on this laptop. Nothing leaves it.' : state.rung === 2 ? `Company server · signed in as ${esc(state.user)}` : `Rung ${state.rung} · in your repo`;
22
+ $('#status').innerHTML = `<b><span class="dot ok"></span>In your repo only</b>${rungText}<br>Monthly count: ${state.sharing.monthly_count ? 'on' : 'off'}.`;
23
+ }
24
+
25
+ const worksOn = (w) => Object.entries(w || {}).map(([m, r]) => !r.tested ? `<span class="tag">${esc(m)} not run</span>`
26
+ : r.failed.length ? `<span class="tag fail">${esc(m)} ${r.pass}/${r.total} · held</span>` : `<span class="tag ok">${esc(m)} ${r.pass}/${r.total}</span>`).join(' ');
27
+
28
+ // ---------- Inbox ----------
29
+ async function inbox(selId) {
30
+ const d = await api('/inbox');
31
+ const groups = d.groups;
32
+ const same = groups.filter(g => g.length > 1).reduce((n, g) => n + g.length, 0);
33
+ const open = groups.reduce((n, g) => n + g.length, 0);
34
+ const starters = state.skills.filter(s => s.starter && s.blanks);
35
+ const head = `<div class="top"><div><h1>Inbox</h1><div class="sub">${open} open correction${open === 1 ? '' : 's'}${same ? ` · ${same} look like the same problem` : ''}</div></div><span class="tag m">Curator: ${esc(state.curator)}</span></div>`
36
+ + (starters.length === 1
37
+ ? `<div class="top small u0"><span><b>Starter progress (${esc(starters[0].name)}):</b> ${starters[0].filled} of ${starters[0].sections} sections filled, ${starters[0].blanks} blanks open.</span><a href="#/skill/${esc(starters[0].name)}" class="small">Fill blanks →</a></div>`
38
+ : starters.length ? `<div class="top small u0"><span><b>Starter progress:</b> ${starters.reduce((n, s) => n + s.blanks, 0)} blanks open across ${starters.length} skills. They fill from real questions.</span><a href="#/skills" class="small">See skills →</a></div>` : '');
39
+ if (!open) {
40
+ $('#main').innerHTML = head + `<div class="empty"><img src="mascot.svg" alt=""><b>Inbox zero. The monster is full.</b><span class="small">Corrections people send from their assistant land here.</span></div>`;
41
+ return;
42
+ }
43
+ const sel = selId || groups[0][0].id;
44
+ $('#main').innerHTML = head + `<div class="split"><div class="list">${groups.map(g => {
45
+ const c = g[0];
46
+ return `<button class="row ${g.some(x => x.id === sel) ? 'sel' : ''}" data-id="${esc(c.id)}"><div class="t"><span class="mono"><b>${g.map(x => esc(x.id)).join(' + ')}</b></span>${g.length > 1 ? `<span class="tag m">${g.length} similar</span>` : '<span class="tag">Open</span>'}</div>
47
+ <div class="q">${esc(c.what_was_wrong)}</div><div class="m"><span class="mono">${esc(c.skill)} ${esc(c.version)}</span><span>${[...new Set(g.map(x => x.reporter_role))].map(esc).join(' · ')}</span><span>${ago(c.created_at)}</span></div></button>`;
48
+ }).join('')}</div><div class="detail" id="detail"></div></div>`;
49
+ document.querySelectorAll('.row').forEach(b => b.onclick = () => { location.hash = `#/inbox/${b.dataset.id}`; });
50
+ const det = await api(`/corrections/${sel}`);
51
+ const c = det.correction;
52
+ $('#detail').innerHTML = `<div class="u1"><span class="mono"><b>${esc(c.id)}</b>${det.similar.length > 1 ? ' + ' + det.similar.filter(x => x.id !== c.id).map(x => esc(x.id)).join(' + ') : ''}</span><span class="tag warn">Pending review</span></div>
53
+ <div><b>${esc(c.what_was_wrong)}</b></div><div class="small muted">Skill: <span class="mono">${esc(c.skill)} ${esc(c.version)}</span> · ${det.similar.length} scrubbed report${det.similar.length > 1 ? 's' : ''}</div>
54
+ <div class="sec"><div class="lbl">Scrubbed reports</div>${det.similar.map(x => `<div class="small"><b>${esc(x.reporter_role)}</b> · ${ago(x.created_at)}<div class="muted">Asked: "${esc(x.question)}"</div>${x.suggested_rule ? `<div class="muted">Suggests: "${esc(x.suggested_rule)}"</div>` : ''}${x.removed.length ? `<div class="dim">Removed before filing: ${x.removed.map(esc).join(', ')}</div>` : ''}</div>`).join('')}</div>
55
+ ${c.votes.length ? `<div class="sec"><div class="lbl">Advisory votes</div><div class="small">${c.votes.map(v => `${esc(v.role)}: ${v.vote > 0 ? '+1' : '−1'}`).join(' · ')} <span class="dim">· votes advise, you decide</span></div></div>` : ''}
56
+ <div class="sec u2"><a class="btn p" href="#/review/${esc(c.id)}">Review change →</a><button class="btn" id="snooze">Snooze</button><button class="btn d right" id="decl">Decline…</button></div>`;
57
+ $('#snooze').onclick = async () => { await api('/snooze', { id: c.id }); toast(`${esc(c.id)} snoozed.`); await refresh(); inbox(); };
58
+ $('#decl').onclick = async () => { const note = prompt('Why decline? The reporter sees this.'); if (!note) return; await api('/decline', { id: c.id, note }); toast(`${esc(c.id)} declined.`); await refresh(); inbox(); };
59
+ }
60
+
61
+ // ---------- Review ----------
62
+ async function review(id) {
63
+ const d = await api(`/corrections/${id}`);
64
+ const c = d.correction, ids = d.similar.map(x => x.id);
65
+ const secOpts = d.skill.sections.map(s => `<option value="${esc(s)}">${esc(s)}</option>`).join('');
66
+ $('#main').innerHTML = `<div class="top"><div><h1>Review change · ${esc(c.id)}</h1><div class="sub mono">${esc(c.skill)} ${esc(d.skill.version)} → next patch · resolves ${ids.map(esc).join(' & ')}</div></div><a class="btn" href="#/inbox/${esc(c.id)}">← Back to Inbox</a></div>
67
+ <div class="pad">
68
+ <div class="small muted"><b>What people said:</b> ${esc(c.what_was_wrong)}${c.suggested_rule ? ` · <b>Suggested:</b> ${esc(c.suggested_rule)}` : ''}</div>
69
+ <label class="f">Section to change<select id="sec">${secOpts}</select></label>
70
+ <label class="f">Current rule (copy the exact sentence to replace, or leave empty to add a new rule)<textarea id="old" placeholder="Leave empty to add the new rule at the end of the section"></textarea></label>
71
+ <label class="f">New rule<textarea id="new">${esc(c.suggested_rule)}</textarea></label>
72
+ <div class="box"><div class="diff"><div><div class="lbl">Current rule · ${esc(d.skill.version)}</div><span id="dOld"></span></div><div><div class="lbl">New rule</div><span id="dNew"></span></div></div></div>
73
+ <div class="box u9">
74
+ <div><b>Guard test</b> <span class="small muted">so this mistake can't come back. It runs on every model before release.</span></div>
75
+ <label class="f">Question<input type="text" id="tq" value="${esc(c.question)}"></label>
76
+ <label class="f">The answer must say (separate alternatives with |, required groups with ;)<input type="text" id="te" placeholder="excluded|not included"></label>
77
+ <label class="f">The answer must never say (optional, separate with ;)<input type="text" id="tx" placeholder="remain included"></label>
78
+ </div>
79
+ <div class="small">Will test on: ${state.models.map(m => `<span class="tag ${m.key_set ? '' : 'warn'}">${esc(m.name)}${m.key_set ? '' : ' · no key'}</span>`).join(' ')}</div>
80
+ <div id="err"></div>
81
+ <div class="bar"><button class="btn p" id="go">Approve and release</button><span class="small dim">Signed as ${esc(state.user)}. Receipts go to ${ids.length} reporter${ids.length > 1 ? 's' : ''}.</span></div>
82
+ <div id="result"></div>
83
+ </div>`;
84
+ const sections = d.sections;
85
+ const draw = () => {
86
+ const sec = sections[$('#sec').value] || '', o = $('#old').value.trim(), n = $('#new').value.trim();
87
+ $('#dOld').innerHTML = o ? (sec.includes(o) ? esc(sec.split(o)[0].slice(-160)) + `<del>${esc(o)}</del>` : `<span class="err">That text isn't in the section. Copy it exactly.</span>`) : `<span class="dim">(new rule added at the end)</span>`;
88
+ $('#dNew').innerHTML = o && sec.includes(o) ? esc(sec.split(o)[0].slice(-160)) + `<ins>${esc(n)}</ins>` : `<ins>${esc(n)}</ins>`;
89
+ };
90
+ ['#sec', '#old', '#new'].forEach(s => $(s).oninput = draw); draw();
91
+ $('#go').onclick = async () => {
92
+ const include = $('#te').value.split(';').map(g => g.split('|').map(s => s.trim()).filter(Boolean)).filter(g => g.length);
93
+ if (!$('#new').value.trim()) return $('#err').innerHTML = '<div class="err">Write the new rule first.</div>';
94
+ if (!include.length) return $('#err').innerHTML = '<div class="err">Add what the answer must say, so the guard test can check it.</div>';
95
+ $('#go').disabled = true; $('#go').textContent = 'Testing on every model…'; $('#err').innerHTML = '';
96
+ try {
97
+ const r = await api('/approve', { ids, section: $('#sec').value, old_text: $('#old').value.trim(), new_text: $('#new').value.trim(), test: { question: $('#tq').value, include, exclude: $('#tx').value.split(';').map(s => s.trim()).filter(Boolean) } });
98
+ $('#go').innerHTML = `✓ Released ${esc(r.record.version)}`;
99
+ $('#result').innerHTML = `<div class="box u7"><b>${esc(r.record.skill)} ${esc(r.record.version)} signed and released.</b> <span class="muted">The monster ate the old rule.</span><div class="u6">${worksOn(r.record.works_on)}</div>${r.receipts.map(x => `<div class="small muted u5">Receipt for ${esc(x.correction)}: ${esc(x.message)}</div>`).join('')}<div class="u6"><a href="#/skill/${esc(r.record.skill)}">View rollout →</a></div></div>`;
100
+ toast(`<b>${esc(r.record.version)} signed and released.</b> The monster ate the old rule.`);
101
+ refresh();
102
+ } catch (e) {
103
+ $('#go').disabled = false; $('#go').textContent = 'Approve and release';
104
+ $('#err').innerHTML = `<div class="err">${esc(e.message)}${e.findings ? '<br>' + e.findings.filter(f => f.level === 'block').map(f => esc(f.message)).join('<br>') : ''}</div>`;
105
+ }
106
+ };
107
+ }
108
+
109
+ // ---------- Skills ----------
110
+ function skills() {
111
+ $('#main').innerHTML = `<div class="top"><div><h1>Skills</h1><div class="sub">${state.skills.length} skills · store: ${esc(state.store)}</div></div></div><div class="pad"><div class="box"><table><thead><tr><th>Skill</th><th>Released</th><th>Owner</th><th>Works on</th><th>Blanks</th></tr></thead><tbody>${state.skills.map(s => `<tr><td><a href="#/skill/${esc(s.name)}"><b class="mono">${esc(s.name)}</b></a><div class="small dim">${esc(s.title)}</div></td><td class="mono">${esc(s.released ?? 'unreleased')}</td><td>${esc(s.owner)}</td><td>${worksOn(s.works_on)}</td><td>${s.blanks ?? '–'}</td></tr>`).join('') || '<tr><td colspan="5" class="dim">No skills yet. Run <span class="mono">skill-monster starters</span>, then <span class="mono">skill-monster new Run <span class="mono">skill-monster new product-analytics-kb</span>.lt;starterRun <span class="mono">skill-monster new product-analytics-kb</span>.gt;</span>.</td></tr>'}</tbody></table></div></div>`;
112
+ }
113
+
114
+ async function skill(name) {
115
+ const d = await api(`/skills/${name}`);
116
+ const rel = d.releases[0];
117
+ const aud = state.audience || {};
118
+ const total = Object.values(aud).reduce((a, b) => a + b, 0);
119
+ const live = rel ? Object.entries(rel.works_on).filter(([, w]) => w.tested && !w.failed.length).reduce((n, [m]) => n + (aud[m] || 0), 0) : 0;
120
+ $('#main').innerHTML = `<div class="top"><div><h1 class="mono u3">${esc(name)} <span class="tag m">${esc(rel?.version ?? 'unreleased')}</span></h1><div class="sub">Owner: ${esc(d.meta.owner)} · ${d.tests.length} guard tests · ${d.blanks.length} blanks</div></div><button class="btn p" id="rel">Release next version</button></div>
121
+ <div class="pad">
122
+ ${rel && total ? `<div class="box u10"><div class="lbl">Rollout · ${esc(rel.version)}</div><div class="u4">${live} of ${total} people</div><div class="small muted">People on models that fail a guard test stay on their last passing version until it passes.</div></div>` : ''}
123
+ ${rel ? `<div><div class="lbl">Works-on checks · ${esc(rel.version)}</div><div class="box"><table><thead><tr><th>Model</th><th>Status</th><th>Guard tests</th><th>People</th></tr></thead><tbody>${Object.entries(rel.works_on).map(([m, w]) => `<tr><td><b>${esc(m)}</b></td><td>${!w.tested ? '<span class="tag">Not run</span>' : w.failed.length ? '<span class="tag fail">Sick · held</span>' : '<span class="tag ok">Pass</span>'}</td><td>${w.tested ? `${w.pass} / ${w.total}${w.failed.length ? ` · fails ${w.failed.map(esc).join(', ')}` : ''}` : '–'}</td><td>${aud[m] ?? '–'}</td></tr>`).join('')}</tbody></table></div></div>` : ''}
124
+ <div id="err"></div>
125
+ ${d.blanks.length ? `<div><div class="lbl">Visible blanks</div><div class="box"><table><tbody>${d.blanks.map(b => `<tr><td class="mono">${esc(b.section)}</td><td>Not defined yet: ${esc(b.what)}</td><td class="dim">${esc(b.ask ?? '')}</td></tr>`).join('')}</tbody></table></div><div class="small dim">Fill a blank by editing the section in ${esc(state.store)}, then release.</div></div>` : ''}
126
+ <div><div class="lbl">Check-up</div>${d.checkup.map(f => `<div class="small"><span class="dot ${f.level === 'block' ? 'fail' : f.level === 'warn' ? 'warn' : 'ok'}"></span> ${esc(f.message)}</div>`).join('')}</div>
127
+ <div><div class="lbl">Guard tests</div><div class="box"><table><tbody>${d.tests.map(t => `<tr><td class="mono">${esc(t.id)}</td><td>${esc(t.question)}</td><td class="small dim">${t.added_from ? 'from ' + esc(t.added_from) : t.seeded ? 'seeded' : ''}</td></tr>`).join('')}</tbody></table></div></div>
128
+ <div><div class="lbl">Version history</div><div class="box"><table><thead><tr><th>Version</th><th>Change</th><th>Signed by</th><th>Signature</th></tr></thead><tbody>${d.releases.map(r => `<tr><td class="mono"><b>${esc(r.version)}</b></td><td>${esc(r.changelog)}</td><td>${esc(r.signed_by)} <span class="dim">${ago(r.signed_at)}</span></td><td>${r.verified.ok ? '<span class="tag ok">Valid</span>' : `<span class="tag fail">${esc(r.verified.reason)}</span>`}</td></tr>`).join('') || '<tr><td colspan="4" class="dim">Not released yet.</td></tr>'}</tbody></table></div></div>
129
+ </div>`;
130
+ $('#rel').onclick = async () => {
131
+ const version = prompt('Version to release', bump(rel?.version ?? d.meta.version, !!rel)); if (!version) return;
132
+ $('#rel').disabled = true; $('#rel').textContent = 'Testing on every model…';
133
+ try { const r = await api('/release', { skill: name, version }); toast(`<b>${esc(name)} ${esc(r.record.version)} signed and released.</b>`); await refresh(); skill(name); }
134
+ catch (e) { $('#rel').disabled = false; $('#rel').textContent = 'Release next version'; $('#err').innerHTML = `<div class="err">${esc(e.message)}${e.findings ? '<br>' + e.findings.filter(f => f.level === 'block').map(f => esc(f.message)).join('<br>') : ''}</div>`; }
135
+ };
136
+ }
137
+ const bump = (v, released) => { if (!released) return v; const [a, b, c] = v.split('.').map(Number); return `${a}.${b}.${c + 1}`; };
138
+
139
+ // ---------- Releases ----------
140
+ async function releases() {
141
+ const all = [];
142
+ for (const s of state.skills) if (s.released) { const d = await api(`/skills/${s.name}`); d.releases.forEach(r => all.push(r)); }
143
+ all.sort((a, b) => b.signed_at.localeCompare(a.signed_at));
144
+ $('#main').innerHTML = `<div class="top"><div><h1>Releases</h1><div class="sub">Every release is signed. Assistants only accept signed versions.</div></div></div><div class="pad"><div class="box"><table><thead><tr><th>Skill</th><th>Version</th><th>Change</th><th>Works on</th><th>Signed</th></tr></thead><tbody>${all.map(r => `<tr><td class="mono">${esc(r.skill)}</td><td class="mono"><b>${esc(r.version)}</b></td><td>${esc(r.changelog)}</td><td>${worksOn(r.works_on)}</td><td>${esc(r.signed_by)} <span class="dim">${ago(r.signed_at)}</span> ${r.verified.ok ? '<span class="tag ok">✓</span>' : '<span class="tag fail">!</span>'}</td></tr>`).join('') || '<tr><td colspan="5" class="dim">No releases yet.</td></tr>'}</tbody></table></div></div>`;
145
+ }
146
+
147
+ // ---------- Settings ----------
148
+ function settings() {
149
+ const payload = { releases: state.releases, receipts: null, installs: Object.values(state.audience || {}).reduce((a, b) => a + b, 0) || null, skills: state.skills.length, source: 'direct', rung: state.rung };
150
+ $('#main').innerHTML = `<div class="top"><div><h1>Settings and privacy</h1><div class="sub">Rung ${state.rung} · store: ${esc(state.store)}</div></div></div><div class="pad">
151
+ <div><div class="lbl">Data boundary</div><div class="box">
152
+ <div class="setting"><div><b>Scrub names and customer data before filing corrections</b><div class="small muted">Required on every rung. Runs before anything is written.</div></div><span class="tag">Required</span></div>
153
+ <div class="setting"><div><b>Signed releases only</b><div class="small muted">Assistants are served the newest signed release that passed its guard tests on their model.</div></div><span class="tag">Required</span></div>
154
+ <div class="setting"><div><b>Send anonymous monthly count to skillmonster.ai</b><div class="small muted">Off by default. When on, sends only the counts below once a month. No skill names, prompts or user IDs.</div></div><button class="switch" role="switch" aria-checked="${state.sharing.monthly_count}" data-k="monthly_count" aria-label="Monthly count"></button></div>
155
+ <div class="u8"><div class="small muted"><b>Exact payload if enabled:</b></div><pre class="json">${esc(JSON.stringify(payload, null, 2))}</pre></div>
156
+ </div></div>
157
+ <div><div class="lbl">Sharing</div><div class="box"><div class="setting"><div><b>Offer "set up your own" after a receipt</b><div class="small muted">One line in the reporter's assistant, once. Nothing is sent.</div></div><button class="switch" role="switch" aria-checked="${state.sharing.share_invitations}" data-k="share_invitations" aria-label="Share invitations"></button></div></div></div>
158
+ <div><div class="lbl">Models (your keys, read from environment variables)</div><div class="box"><table><tbody>${state.models.map(m => `<tr><td><b>${esc(m.name)}</b></td><td class="mono">${esc(m.provider)} · ${esc(m.model)}</td><td>${m.key_set ? '<span class="tag ok">Key set</span>' : '<span class="tag warn">No key: tests skipped</span>'}</td></tr>`).join('')}</tbody></table></div><div class="small dim">Change models in skill-monster.yaml. Keys never go in the file.</div></div>
159
+ </div>`;
160
+ document.querySelectorAll('.switch').forEach(b => b.onclick = async () => {
161
+ const v = b.getAttribute('aria-checked') !== 'true';
162
+ const r = await api('/settings', { sharing: { [b.dataset.k]: v } });
163
+ state.sharing = r.sharing; b.setAttribute('aria-checked', String(v)); refresh();
164
+ });
165
+ }
166
+
167
+ async function route() {
168
+ const [, view, arg] = (location.hash || '#/inbox').split('/');
169
+ document.querySelectorAll('nav a').forEach(a => a.classList.toggle('on', a.dataset.k === (view === 'review' ? 'inbox' : view === 'skill' ? 'skills' : view)));
170
+ try {
171
+ if (!state) await refresh();
172
+ if (view === 'review') await review(arg);
173
+ else if (view === 'skills') skills();
174
+ else if (view === 'skill') await skill(arg);
175
+ else if (view === 'releases') await releases();
176
+ else if (view === 'settings') settings();
177
+ else await inbox(arg);
178
+ } catch (e) { $('#main').innerHTML = `<div class="pad"><div class="err">${esc(e.message)}</div></div>`; }
179
+ $('#main').focus();
180
+ }
181
+ addEventListener('hashchange', route);
182
+ route();
@@ -0,0 +1,70 @@
1
+ /* Fonts are bundled (SIL Open Font License) so the Desk makes no outside requests. */
2
+ @font-face {
3
+ font-family: 'Bricolage Grotesque';
4
+ font-style: normal;
5
+ font-weight: 800;
6
+ font-stretch: 100%;
7
+ font-display: swap;
8
+ src: url(fonts/bricolage-grotesque-800.woff2) format('woff2');
9
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
10
+ }
11
+ @font-face {
12
+ font-family: 'IBM Plex Mono';
13
+ font-style: normal;
14
+ font-weight: 400;
15
+ font-display: swap;
16
+ src: url(fonts/ibm-plex-mono-400.woff2) format('woff2');
17
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
18
+ }
19
+ @font-face {
20
+ font-family: 'IBM Plex Mono';
21
+ font-style: normal;
22
+ font-weight: 600;
23
+ font-display: swap;
24
+ src: url(fonts/ibm-plex-mono-600.woff2) format('woff2');
25
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
26
+ }
27
+ @font-face {
28
+ font-family: 'IBM Plex Sans';
29
+ font-style: normal;
30
+ font-weight: 400;
31
+ font-stretch: 100%;
32
+ font-display: swap;
33
+ src: url(fonts/ibm-plex-sans-400.woff2) format('woff2');
34
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
35
+ }
36
+ @font-face {
37
+ font-family: 'IBM Plex Sans';
38
+ font-style: normal;
39
+ font-weight: 500;
40
+ font-stretch: 100%;
41
+ font-display: swap;
42
+ src: url(fonts/ibm-plex-sans-400.woff2) format('woff2');
43
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
44
+ }
45
+ @font-face {
46
+ font-family: 'IBM Plex Sans';
47
+ font-style: normal;
48
+ font-weight: 600;
49
+ font-stretch: 100%;
50
+ font-display: swap;
51
+ src: url(fonts/ibm-plex-sans-400.woff2) format('woff2');
52
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
53
+ }
54
+ @font-face {
55
+ font-family: 'IBM Plex Sans';
56
+ font-style: normal;
57
+ font-weight: 700;
58
+ font-stretch: 100%;
59
+ font-display: swap;
60
+ src: url(fonts/ibm-plex-sans-400.woff2) format('woff2');
61
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
62
+ }
63
+ @font-face {
64
+ font-family: 'Silkscreen';
65
+ font-style: normal;
66
+ font-weight: 400;
67
+ font-display: swap;
68
+ src: url(fonts/silkscreen-400.woff2) format('woff2');
69
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
70
+ }
@@ -0,0 +1,29 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <title>Skill Monster Desk</title>
7
+ <link rel="icon" href="mascot.svg">
8
+ <link rel="stylesheet" href="fonts.css">
9
+ <link rel="stylesheet" href="app.css">
10
+ </head>
11
+ <body>
12
+ <div class="shell">
13
+ <aside class="nav">
14
+ <a class="brand" href="#/inbox"><img src="mascot.svg" alt="" width="20" height="20"><span>Skill Monster</span></a>
15
+ <div class="org" id="org">…</div>
16
+ <nav id="links">
17
+ <a href="#/inbox" data-k="inbox">Inbox <span class="count" id="c-inbox"></span></a>
18
+ <a href="#/skills" data-k="skills">Skills <span class="count" id="c-skills"></span></a>
19
+ <a href="#/releases" data-k="releases">Releases <span class="count" id="c-releases"></span></a>
20
+ <a href="#/settings" data-k="settings">Settings</a>
21
+ </nav>
22
+ <div class="status" id="status"></div>
23
+ </aside>
24
+ <main id="main" tabindex="-1"><div class="loading">Loading…</div></main>
25
+ </div>
26
+ <div id="toast" class="toast" role="status" hidden></div>
27
+ <script src="app.js" type="module"></script>
28
+ </body>
29
+ </html>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12" shape-rendering="crispEdges"><path fill="#C6F432" d="M2 0h1v2H2zM3 1h1v1H3zM8 1h2v1H8zM1 2h10v8H1zM2 10h2v2H2zM8 10h2v2H8z"/><path fill="#16140F" d="M4 3h4v3H4zM2 7h8v2H2z"/><path fill="#C6F432" d="M5 4h1v1H5zM3 7h1v1H3zM5 7h2v1H5zM8 7h1v1H8z"/></svg>
@@ -0,0 +1 @@
1
+ {"commit":"c97d21d","built_at":"2026-12-03T02:06:01.068Z"}
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};