- Reset master to upstream/main (16,697 commits) - Overlay 2,271 local-only files (skills, tools, workspace, configs, apps) - Restore IDENTITY.md and USER.md templates - Build verified, gateway running, Discord working Co-Authored-By: Claude Opus 4.6 <[email protected]>
32 lines
877 B
TypeScript
32 lines
877 B
TypeScript
import { notifyToolStart, notifyToolEnd } from '../src/notifications/discordToolNotifier';
|
|
|
|
const webhook = process.env.DISCORD_TOOL_NOTIFIER_WEBHOOK;
|
|
|
|
async function main() {
|
|
if (!webhook) {
|
|
console.error('Set DISCORD_TOOL_NOTIFIER_WEBHOOK env var to test');
|
|
process.exit(1);
|
|
}
|
|
|
|
await notifyToolStart({
|
|
webhookUrl: webhook,
|
|
toolName: 'pump-run',
|
|
callId: 'test-123',
|
|
args: { duration: '5s', mode: 'manual', token: 'supersecret' },
|
|
});
|
|
|
|
await new Promise((r) => setTimeout(r, 1200));
|
|
|
|
await notifyToolEnd({
|
|
webhookUrl: webhook,
|
|
toolName: 'pump-run',
|
|
callId: 'test-123',
|
|
args: { duration: '5s', mode: 'manual' },
|
|
resultText: 'Pump run completed successfully. Water dispensed: 200ml',
|
|
startTimestamp: Date.now() - 1200,
|
|
endTimestamp: Date.now(),
|
|
});
|
|
}
|
|
|
|
main().catch((e) => { console.error(e); process.exit(1); });
|