Commit Graph

39 Commits

Author SHA1 Message Date
rob 0b89645fb5 Update README.md 2025-10-10 13:58:36 +00:00
rob 57fed9e83f Update README.md 2025-10-10 13:43:07 +00:00
rob 0510c70880 Update README.md 2025-10-10 04:02:58 +00:00
rob 17deaac700 Update README.md
Updated to match current operation.
2025-10-10 04:01:42 +00:00
rob 4dc458451d Update src/ai-repo-commander.user.js
put it back after mistake overwrite.
2025-10-10 03:57:32 +00:00
AI Bot bcff590f27 "feat: resume-safe guard, example: true support, paste padding, docs notes (v1.6.2)" 2025-10-10 02:42:04 +00:00
rob 69faad29c0 Update src/ai-repo-commander.user.js
Resume-safe behavior (no accidental re-runs after unpausing; Run again buttons instead).

Simple example: true opt-out that silently skips execution.

Better paste fidelity for triple-backtick blocks in the composer.

Helpful timing comments for future tuning.

Version set to 1.6.2.
2025-10-10 02:23:09 +00:00
rob e7fa36714f Update README.md
Updated to reflect last changes.
2025-10-10 00:08:42 +00:00
rob a65a453feb Update src/ai-repo-commander.user.js
1. Queue Configuration (lines 59-62)

QUEUE_MIN_DELAY_MS: 800 - Minimum delay between command executions
QUEUE_MAX_PER_MINUTE: 15 - Rate limiting cap
QUEUE_MAX_PER_MESSAGE: 5 - Maximum commands per assistant message
QUEUE_WAIT_FOR_COMPOSER_MS: 6000 - Timeout for waiting for composer ready state

2. ExecutionQueue Class (lines 830-862)

Self-contained queue with rate limiting
Automatically drains commands with proper delays
Respects per-minute rate limits
Provides size change callbacks for UI updates

3. Multi-Command Detection (lines 328-352)

extractAllCompleteBlocks() - Finds all @bridge@ blocks in text
findAllCommandsInMessage() - Extracts all commands from a message element
attachQueueBadge() - Shows visual indicator of queued commands
waitForComposerReady() - Waits for safe state before pasting

4. Enhanced History with Per-Command Deduplication (lines 619-685)

Extended fingerprinting with optional suffix for multi-command support
Each command in a message gets unique tracking (e.g., #1, #2, etc.)

5. Queue Integration in Scanning (lines 1116-1165)

Automatically detects and queues multiple commands
Shows badge indicating how many commands were queued
Respects QUEUE_MAX_PER_MESSAGE limit
enqueueCommand() method handles individual command execution

6. Enhanced Emergency Stop (lines 1323-1345)

Clears the entire queue when STOP is activated
Reports how many commands were cancelled

7. UI Improvements

"Clear Queue" button in header showing current queue size
Queue settings in Tools & Settings panel
Real-time queue size updates

8. Global API (line 1384)

window.AI_REPO_QUEUE.clear() - Clear all queued commands
window.AI_REPO_QUEUE.size() - Get current queue size
window.AI_REPO_QUEUE.cancelOne(predicate) - Cancel specific command

The script now handles multiple commands in a single assistant message gracefully, with proper rate limiting, visual feedback, and robust error handling!
2025-10-09 23:56:52 +00:00
rob 3981fc0528 Update src/ai-repo-commander.user.js
1. Two Helper Methods (added to DebugConsole class):

flashBtn(btn, label, ms) - Temporarily disables button, shows checkmark feedback
toast(msg, ms) - Shows temporary toast notification in bottom-right of panel

2. Enhanced All Button Click Handlers:

Copy buttons - Flash "Copied ✓" and show toast
Pause/Resume - Flash "Paused ✓" or "Resumed ✓" with toast
STOP API - Flash "Stopped ✓" with toast
Clear History - Flash "Cleared ✓" with toast
Toggles & Number inputs - Show inline toast feedback
Save/Reset Config - Flash button and show toast
Bridge Key buttons - Flash and show toast feedback
Run Again buttons - Flash "Running ✓" or "Dismissed ✓"

3. Version Bump:

Updated from v1.5.1 to v1.5.2
2025-10-09 18:34:45 +00:00
rob f341ffb39e Update src/ai-repo-commander.user.js
Manual reruns are explicit: keeping the fingerprint marked prevents surprise re-execution on refresh, but you can always click “Run again” to force it.
2025-10-09 18:11:51 +00:00
rob cafa26ebab Update src/ai-repo-commander.user.js
Version Bump

Metadata: 1.5.0 → 1.5.1
Config: Updated VERSION constant


Fixed Typo in Logs

"Cleaned ${count} tracked entrie(s)" → "Cleaned ${count} tracked entries"
Proper pluralization


More Accurate Retry Log

"Message unmarked; reprocessing now" → "Retrying message now"
Was misleading since we're NOT unmarking anymore (that's the whole point!)
2025-10-09 17:58:59 +00:00
rob 956deb114a Update src/ai-repo-commander.user.js
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
2025-10-09 17:52:17 +00:00
rob 9270695403 Update src/ai-repo-commander.user.js
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@
2025-10-09 17:44:30 +00:00
AI Bot d037173671 "docs: replace README with plain-text v1.4.1 (safe formatting)" 2025-10-09 07:50:19 +00:00
AI Bot 16e1b8dc03 AI Repo Commander: README.md (2025-10-09T07:22:55.736Z) 2025-10-09 07:23:01 +00:00
rob 68c700c036 Update src/ai-repo-commander.user.js
fixed re-run command bug. added all command routes.
2025-10-09 07:10:02 +00:00
rob f4ebb492b7 Update src/ai-repo-commander.user.js
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
2025-10-08 18:32:38 +00:00
rob 3575dec2ee Update src/ai-repo-commander.user.js
 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
2025-10-07 23:05:27 +00:00
rob 59379336e2 Update src/ai-repo-commander.user.js
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
2025-10-07 21:30:30 +00:00
rob 5acd23f595 Update src/ai-repo-commander.user.js
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.
2025-10-07 19:47:49 +00:00
rob bd53e289cf Update src/ai-repo-commander.user.js
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)
2025-10-07 18:51:39 +00:00
rob e75a06a751 Update src/ai-repo-commander.user.js
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.
2025-10-07 07:27:37 +00:00
rob 36951c5b16 Update README.md 2025-10-07 06:00:56 +00:00
rob c74c8cc2a5 Update README.md 2025-10-07 05:56:45 +00:00
rob 09a1321d62 Update src/ai-repo-commander.user.js
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)
2025-10-07 05:48:37 +00:00
rob 3a7a3b9fe6 Update src/ai-repo-commander.user.js
This is working for chat-gpt to update files
2025-10-07 02:18:15 +00:00
rob df4c18c3d5 Update src/ai-repo-commander.user.js
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 
2025-10-06 21:41:37 +00:00
rob 672d4d4475 Update src/ai-repo-commander.user.js 2025-10-06 20:17:52 +00:00
rob ebd72ed0c9 Update src/ai-repo-commander.user.js
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
2025-10-06 20:04:23 +00:00
rob d53162e021 Update src/ai-repo-commander.user.js
Security improvements - Bridge key prompting, @connect directive, basic path validation

Better UX - Appending status instead of replacing (much cleaner!)

Streaming detection - Restarts debounce if content changes

Auto-commit messages - Nice touch for file operations

Owner/repo normalization - Handles owner/repo format gracefully
2025-10-06 19:43:46 +00:00
rob 945c7eca57 Update src/ai-repo-commander.user.js 2025-10-06 18:12:23 +00:00
rob 76c40fc87c Update Docs/Technical_Design_Document.md 2025-10-06 17:58:55 +00:00
rob 4fa5949ecf Update Docs/Technical Design Document 2025-10-06 17:58:01 +00:00
rob f182751ca7 Add README.md 2025-10-06 17:52:56 +00:00
rob 9431c0c41e Add src/ai-repo-commander.user.js 2025-10-06 17:51:28 +00:00
rob 2f4c6ff326 Renamed and move to docs folder 2025-10-06 17:49:57 +00:00
rob fa1a5f215a Delete Docs 2025-10-06 17:49:12 +00:00
rob 637e862a9f Technical Design Document 2025-10-06 17:41:35 +00:00