mirror of
https://github.com/obra/superpowers.git
synced 2026-04-21 08:59:04 +08:00
feat: add sendToClaude helper and wait-for-event tool
- Add sendToClaude() function to browser helper that shows confirmation - Add wait-for-event.sh script for watching server output (tail -f | grep -m 1) - Enables clean event-driven loop: background bash waits for event, completion triggers Claude's turn
This commit is contained in:
@@ -87,10 +87,28 @@
|
||||
}, 500); // 500ms debounce
|
||||
});
|
||||
|
||||
// Send to Claude - triggers server to exit and return all events
|
||||
function sendToClaude(feedback) {
|
||||
send({
|
||||
type: 'send-to-claude',
|
||||
feedback: feedback || null
|
||||
});
|
||||
// Show confirmation to user
|
||||
document.body.innerHTML = `
|
||||
<div style="display: flex; align-items: center; justify-content: center; height: 100vh; font-family: system-ui, sans-serif;">
|
||||
<div style="text-align: center; color: #666;">
|
||||
<h2 style="color: #333;">✓ Sent to Claude</h2>
|
||||
<p>Return to the terminal to see Claude's response.</p>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
// Expose for explicit use if needed
|
||||
window.brainstorm = {
|
||||
send: send,
|
||||
choice: (value, metadata = {}) => send({ type: 'choice', value, ...metadata })
|
||||
choice: (value, metadata = {}) => send({ type: 'choice', value, ...metadata }),
|
||||
sendToClaude: sendToClaude
|
||||
};
|
||||
|
||||
connect();
|
||||
|
||||
Reference in New Issue
Block a user