notify even when peon muted
This commit is contained in:
@@ -308,9 +308,24 @@ function pickSound(categoryConfig: CategoryConfig, category: Category): Sound |
|
||||
|
||||
// ============ SOUND PLAYBACK ============
|
||||
function play(category: Category): void {
|
||||
if (config.muted) return;
|
||||
if (!config.enabledCategories[category]) return;
|
||||
|
||||
const notificationMessages: Record<Category, { title: string; message: string } | null> = {
|
||||
"session.start": null,
|
||||
"task.acknowledge": null,
|
||||
"task.complete": { title: "Pi", message: "Task complete" },
|
||||
"task.error": { title: "Pi", message: "Task failed" },
|
||||
"input.required": { title: "Pi", message: "Input required" },
|
||||
"resource.limit": { title: "Pi", message: "Rate limited" },
|
||||
};
|
||||
|
||||
const notification = notificationMessages[category];
|
||||
if (notification) {
|
||||
sendNotification(notification.title, notification.message);
|
||||
}
|
||||
|
||||
if (config.muted) return;
|
||||
|
||||
const now = Date.now();
|
||||
if (now - lastPlayed < DEBOUNCE_MS) {
|
||||
return;
|
||||
@@ -345,20 +360,6 @@ function play(category: Category): void {
|
||||
}
|
||||
|
||||
playSound(soundPath, config.volume);
|
||||
|
||||
const notificationMessages: Record<Category, { title: string; message: string } | null> = {
|
||||
"session.start": null,
|
||||
"task.acknowledge": null,
|
||||
"task.complete": { title: "Pi", message: "Task complete" },
|
||||
"task.error": { title: "Pi", message: "Task failed" },
|
||||
"input.required": { title: "Pi", message: "Input required" },
|
||||
"resource.limit": { title: "Pi", message: "Rate limited" },
|
||||
};
|
||||
|
||||
const notification = notificationMessages[category];
|
||||
if (notification) {
|
||||
sendNotification(notification.title, notification.message);
|
||||
}
|
||||
}
|
||||
|
||||
// ============ COMMANDS ============
|
||||
@@ -814,7 +815,7 @@ async function showTestMenu(ctx: ExtensionCommandContext) {
|
||||
|
||||
const INTERACTIVE_TOOLS = new Set(["question", "questionnaire"]);
|
||||
|
||||
export default function (pi: ExtensionAPI) {
|
||||
export default function(pi: ExtensionAPI) {
|
||||
registerCommands(pi);
|
||||
|
||||
pi.on("session_start", async (_event, ctx) => {
|
||||
|
||||
Reference in New Issue
Block a user