feat: the brain can change the box's speaker volume
"Speak up" and "too loud" now work: the reply tool takes louder, in percentage points, and the button service nudges the speaker's softvol before it speaks that reply, so the person hears the change at once. The box keeps the level between 10% and 80% (body/mixer.py). No new port or key: the volume changes only with a reply, in a conversation someone is listening to. Generated-by: Claude Opus 5.5
This commit is contained in:
1 parent
cf503ac247
commit
5191ee9931
11 files changed
+146
-21
No files matched your search
+9
-4
@@ -21,7 +21,7 @@ import { networkInterfaces } from 'node:os';
|
||||
import process from 'node:process';
|
||||
import { createInterface } from 'node:readline';
|
||||
import { WebSocketServer } from 'ws';
|
||||
import { Asker, Channel } from './ask.js';
|
||||
import { Asker, Channel, MAX_LOUDER } from './ask.js';
|
||||
import { Gate } from './gate.js';
|
||||
import { makeGitHubPost, makeReporter } from './report.js';
|
||||
|
||||
@@ -36,10 +36,15 @@ const INSTRUCTIONS = [
|
||||
|
||||
const REPLY_TOOL = {
|
||||
name: 'reply',
|
||||
description: 'Speak your answer through the box; then it is their turn. Pass chat_id from the inbound <channel> tag. end_conversation true says goodbye and closes the conversation.',
|
||||
description: 'Speak your answer through the box; then it is their turn. Pass chat_id from the inbound <channel> tag. end_conversation true says goodbye and closes the conversation. louder changes the box\'s speaker volume, in percentage points, before it speaks this answer, so they hear the difference: 10 for "speak up", -10 for "too loud", more if they ask for a lot. The box keeps the volume within its own bounds.',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: { chat_id: { type: 'string' }, text: { type: 'string' }, end_conversation: { type: 'boolean' } },
|
||||
properties: {
|
||||
chat_id: { type: 'string' },
|
||||
text: { type: 'string' },
|
||||
end_conversation: { type: 'boolean' },
|
||||
louder: { type: 'integer', minimum: -MAX_LOUDER, maximum: MAX_LOUDER },
|
||||
},
|
||||
required: ['chat_id', 'text'],
|
||||
},
|
||||
};
|
||||
@@ -241,7 +246,7 @@ const main = async ({
|
||||
}
|
||||
}
|
||||
if (name !== 'reply') return textResult(`no tool ${name}`, true);
|
||||
const outcome = channel.reply(String(args.chat_id), String(args.text ?? ''), args.end_conversation === true);
|
||||
const outcome = channel.reply(String(args.chat_id), String(args.text ?? ''), args.end_conversation === true, args.louder);
|
||||
log(`reply ${args.chat_id}: ${outcome}: ${args.text}`);
|
||||
return textResult(outcome);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user