feat(hub): grant split menu, radio redesign and answerable decision rows
The Grant bar becomes one split control: Select, or Grant N with a menu for Deny, Grant all green, the picked list, Clear and Direct mode; picked items turn pale green. The radio drops its filter flyout and gains three-state bells per row, a test per row including Speak, Auto or Morse on a second click, mute on the sender avatar and the agent profile, Cancel MAYDAY beside Send only while one is active, a Send menu with a test message and hold-to-record push-to-talk. Decision rows read as questions with their options; the signed answer is Decision <id> plus Answer: <answer>, and the card names its recipient. Security: the passkey-signed answer carries no agent-written text, the inbox lists answerable rows only when their id fullmatches the TASK rule of the installed rasci.py (skill_scripts.task_pattern), and rasci.py, operator.py and hotfix.py check task slugs with fullmatch, so a trailing newline no longer passes. Accepted MEDUSA findings after kvb-think-criticize: page-inbox.js:116 EXA006 (by design after the fix), page-inbox.js:125 EXA010, operator.py:173, 618 and 633 RP001, FT-TRIGGER-005 and RLHF-POISON-002, operator.py:639 MEX-SCAN-346, operator.py:968 MM-SCAN-058, operator.py:974 ACP-SCAN-028 (false positives). 🎯 Fix: 85 % 💥 Break: 10 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 77 🚦 Gate: ⛔ fix 85 % < 90, break 10 % > 5 Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ff9bbc19c2
commit
d695bb2b58
42 files changed
+1158
-340
No files matched your search
@@ -7,6 +7,7 @@ const RadioSet = (() => {
|
||||
const FRAME = {bytes: 140, prefix: 8, key: 64};
|
||||
const TONES = ["mayday", "review", "direct", "radio"];
|
||||
const CLASSES = ["post", "call", "newsletter", "broadcast", "mayday", "pan-pan", "security"];
|
||||
const SPOKEN = {mayday: ["mayday", "pan-pan", "security"], review: [], direct: ["post", "call"], radio: ["newsletter", "broadcast"]};
|
||||
const TO_ALL = new Set(["newsletter", "broadcast", "mayday", "pan-pan", "security"]);
|
||||
const TABS = ["sent", "received", "all"];
|
||||
const CHIPS = ["class", "from", "to", "agent"];
|
||||
@@ -78,6 +79,37 @@ const RadioSet = (() => {
|
||||
return row.class === "mayday" || (set.classes.includes(row.class) && !set.muted.includes(row.source));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} set the radio set.
|
||||
* @param {string} tone one of TONES.
|
||||
* @returns {string} the bell of that row: off while its tone is off, speak while every class it speaks is read aloud, else tone.
|
||||
*/
|
||||
function bell(set, tone) {
|
||||
if (!set.sounds[tone].on) {
|
||||
return "off";
|
||||
}
|
||||
return SPOKEN[tone].length && SPOKEN[tone].every((name) => set.classes.includes(name)) ? "speak" : "tone";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} set the radio set.
|
||||
* @param {string} tone one of TONES.
|
||||
* @returns {object} the change of sounds and classes that moves the row's bell on: off to tone to speak to off, a row that speaks no class skips speak.
|
||||
*/
|
||||
function ring(set, tone) {
|
||||
const now = bell(set, tone);
|
||||
const next = now === "off" ? "tone" : now === "tone" && SPOKEN[tone].length ? "speak" : "off";
|
||||
const rest = set.classes.filter((name) => !SPOKEN[tone].includes(name));
|
||||
return {
|
||||
sounds: {...set.sounds, [tone]: {...set.sounds[tone], on: next !== "off"}},
|
||||
classes: next === "speak" ? [...rest, ...SPOKEN[tone]] : rest,
|
||||
};
|
||||
}
|
||||
|
||||
function muting(set, key) {
|
||||
return {muted: set.muted.includes(key) ? set.muted.filter((name) => name !== key) : [...set.muted, key]};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {object} row a radio row of the state with class, called, speaker, pitch and text.
|
||||
* @returns {object} the whole row keyed in Morse as kind "morse", sign, joined, text and pitch: the class prosign, or the called stations of a call, then DE with the sender's clear name and the full text without the hub's message mark, in the sender's pitch.
|
||||
@@ -272,7 +304,7 @@ const RadioSet = (() => {
|
||||
return {...entry, chips: Object.fromEntries(CHIPS.map((name) => [name, ""])), q: ""};
|
||||
}
|
||||
|
||||
return {KEY, MODES, FALLBACKS, KEYED, FRAME, TONES, CLASSES, TABS, CHIPS, DEFAULTS, GATE, PROSIGNS, valid, picked, frames, standIn, plan, burst, gateLabel, toAll, ledgerOf, logRows, counts, choices, cleared};
|
||||
return {KEY, MODES, FALLBACKS, KEYED, FRAME, TONES, CLASSES, SPOKEN, TABS, CHIPS, DEFAULTS, GATE, PROSIGNS, valid, picked, bell, ring, muting, frames, standIn, plan, burst, gateLabel, toAll, ledgerOf, logRows, counts, choices, cleared};
|
||||
})();
|
||||
if (typeof module === "object" && module.exports) {
|
||||
module.exports = RadioSet;
|
||||
|
||||
Reference in new issue
Block a user