1. Fixed Outdated Regex (2 locations)
Before: /No complete \^%\$bridge/ (looking for old delimiter)
After: /No complete @bridge@/ (looking for new delimiter)
Impact: Parse errors now properly show "Run again" UI instead of silently failing
2. Removed History Unmarking (2 locations)
Removed: this.history.unmarkElement(el) from both cold start and already-processed branches
Why: Keeps commands marked in history to prevent auto-replay on reload
Behavior: "Run again" button executes immediately but doesn't remove the persistent marker
New Command Delimiters
^%$bridge → @bridge@ (easier to type/remember)
--- → @end@ (won't conflict with markdown horizontal rules!)
Updated All Regex Patterns
Command detection
Block extraction
Completion checking
Fingerprinting
Updated Test Commands
All examples now use @bridge@ / @end@
Added example showing --- working inside content blocks
New Command Format:
yaml@bridge@
action: update_file
repo: test-repo
path: docs/README.md
content: |
# My Markdown
This has a horizontal rule:
---
No problem! The @end@ terminator is distinctive.
body: Optional description
@end@
changed command history aproach.
More resilient - Handles edge cases in long conversations and streaming responses
Better cleanup - Won't leak memory from stuck operations
Cancellable operations - Can be stopped mid-flight without errors
Better debugging - Magic numbers replaced with named config values
Improved UX - Error states now offer recovery options
✅ Increase API timeout from 30s to 60s
✅ Prevent scanning when paused
Recommended (nice to have):
3. ✅ Make API timeout configurable
4. ✅ Optimize timing values based on your successful test
No more premature detection - Commands won't be processed until the full --- terminator appears
No more history pollution - Incomplete commands won't get marked as "already executed"
Better streaming resilience - Waits for the command to stabilize before processing
Configurable timing - You can adjust settle times in the Tools panel
No auto-unmarking on any failure — failed commands stay marked (no surprise retries).
Manual retry helpers:
AI_REPO_RETRY_COMMAND_TEXT(text) — unmarks by raw command text.
AI_REPO_RETRY_MESSAGE(messageId) — unmarks and immediately reprocesses that message (handy in practice).
Everything else from the debug/UX hardening remains intact.
Debug threshold clarified & correct
logLoop() logs at a visible level (INFO by default)
Cleanup summary logs at INFO
Console output is suppressed unless DEBUG_LEVEL ≥ 3 (verbose/trace)
Clipboard copy has a safe fallback
Pause button shows a clear visual state
Panel mount is resilient if document.body isn’t ready
Emergency STOP also clears the cleanup interval
Initial scan explicitly skipped when PROCESS_EXISTING: false
Plus the earlier low-risk hardening (require action:; pre-mark history)
handleSuccess() now handles list_files by extracting a files array from typical n8n payloads and pasting a neat text code block. If it can’t find a files array, it pastes the raw JSON so you can see what came back.
Added auto-submit after paste (AUTO_SUBMIT: true). It:
tries clicking a visible Send button (button[data-testid="send-button"] or aria-label*="Send"),
falls back to synthesizing Enter key events.
Added APPEND_TRAILING_NEWLINE: true (helps some editors pick up a final input change reliably).
Removed the unused scanExistingMessages() and updated a comment in the parser to match actual behavior.
Production Ready Features:
Safety & Reliability:
✅ Persistent command history prevents re-execution
✅ Code-block restriction enables safe discussion
✅ Debouncing handles AI streaming
✅ Multiple paste strategies with fallbacks
✅ Emergency stop system
User Experience:
✅ Clear status messages with color coding
✅ Smart platform detection
✅ Clipboard fallback when paste fails
✅ Global history reset function
Developer Experience:
✅ Comprehensive logging
✅ Test commands available
✅ Configurable behavior
✅ Easy debugging tools
📈 The Evolution is Complete:
You've successfully addressed all the core issues we identified:
✅ No more re-execution on reload (persistent storage)
✅ Safe command discussion (code-block only execution)
✅ Assistant messages work perfectly (your core use case)
✅ Robust paste functionality (multiple fallback strategies)
✅ Platform compatibility (smart detection per site)
Core Functionality Preserved:
SKIP_AI_MESSAGES: false by default ✅
AI can execute commands it generates ✅
Your main use case works perfectly ✅
Safety Features Available:
Optional AI message filtering (SKIP_AI_MESSAGES: true) ✅
Code block detection (always on) ✅
Content deduplication ✅
Memory cleanup ✅
Technical Improvements:
Delay consistency (1000ms everywhere) ✅
Commit message included in mock response ✅
1. Fixed YAML Parsing Edge Cases
Multi-line content with colons now works correctly
Uses TOP_LEVEL_KEYS to only stop collection on known keys
Much more robust for real-world content
2. Better Command Block Extraction
More tolerant --- matching (allows trailing spaces)
Won't break on content that happens to contain ---
3. Cleaner Owner/Repo Handling
Moved normalization to parser (side-effect free validation)
More predictable behavior
4. Improved Error Messaging
Clear retry attempt counts: "failed after 2 attempts; max 3"
Better user feedback
5. Robust JSON Parsing
Handles malformed API responses gracefully
Won't crash on non-JSON responses
6. Better Message ID Generation
Added timestamp and random salt to prevent collisions
Uses data attributes to persist IDs
7. User Experience
Bridge key warning on initialization
Cleaner separation of concerns