Commit Graph

60 Commits

Author SHA1 Message Date
rob aac79a689f included more features 2025-10-15 20:42:31 -03:00
rob 52559be1c5 Updated requirements 2025-10-15 20:13:49 -03:00
rob 205c2561fe initial skeleton 2025-10-15 20:09:08 -03:00
rob c6ddfea560 remove deleted file 2025-10-15 19:42:43 -03:00
rob ca94e03289 fixed all warnings and the docs 2025-10-15 19:09:01 -03:00
rob 6d6d8a094a fixed all warnings and the docs 2025-10-15 15:56:21 -03:00
rob 7a441aee48 fixed all warnings and the docs 2025-10-15 11:20:01 -03:00
rob e2e970b9d9 fixed all warnings and the docs 2025-10-15 07:48:05 -03:00
rob 7512ceda65 fixed all warnings and the docs 2025-10-15 07:47:54 -03:00
rob b446771480 fixed all warnings and the docs 2025-10-14 15:14:28 -03:00
rob 0da540b575 fixed all warnings 2025-10-14 14:53:18 -03:00
rob d6f48cdeac Merge pull request 'Update src/ai-repo-commander.user.js' (#1) from changes into main
Reviewed-on: https://gitea.brrd.tech/rob/AI-Repo-Commander/pulls/1
2025-10-14 02:43:24 +00:00
rob 3b6c6d8bb9 Update src/ai-repo-commander.user.js
Added a bunch of new debug code. 
Fixed bug - new commands were getting debouncing errors.
2025-10-14 00:13:27 +00:00
rob 306482a281 Update src/ai-repo-commander.user.js
Double-execution / wrong “Run again” target:
You now fingerprint per message and per sub-command (markElement(el, idx+1)) and render per-command “Run again [#n]” buttons. That removes the old single-block ambiguity and prevents re-exec on reloads.

Cold-start / resume spam:
On resume you call markExistingHitsAsProcessed() which marks visible commands and injects Run-again buttons instead of auto-executing. That stops surprise replays after page refresh or unpause.

Streaming “half blocks” firing too early:
waitForStableCompleteBlock() + the required @end@ terminator and the settle window (SETTLE_CHECK_MS/SETTLE_POLL_MS) means you only act on a fully streamed, stable block.

Multi-command messages:
extractAllCompleteBlocks() + queueing each hit with unique render keys/labels gives correct detection, dedupe, status lines, and retries per block.

YAML | blocks cutting off at new keys:
The parser now ends a | block on any unindented key:—fixing prior cases where multi-line fields (content/body) swallowed following keys or vice-versa.

Composer/paste flakiness across models:
You added a robust paste stack (ClipboardEvent → ProseMirror HTML → execCommand → textarea/value → contentEditable → GM_setClipboard fallback) and waitForComposerReady() with send-button checks. That should address “pasted but empty” and “submit didn’t fire”.

Long response pastes breaking fences / hitting limits:
ResponseBuffer consolidates outputs, and splitRespectingCodeFence() keeps single fenced blobs intact across chunks while honoring MAX_PASTE_CHARS.

History that didn’t survive reloads / wrong thread:
Conversation-scoped persistent dedupe (ConvHistory with TTL) plus a stronger fingerprint (command hash + previous-context hash + DOM hint + ordinal) prevents cross-thread collisions and stale replays.

Emergency stop + rate limiting:
Queue rate-cap + STOP handler will keep you safe from API storms and let you halt mid-flight cleanly.
2025-10-11 02:49:14 +00:00
rob dd0427b598 Update src/ai-repo-commander.user.js 2025-10-10 18:41:50 +00:00
rob 9ddf1f891f Update README.md 2025-10-10 15:16:27 +00:00
rob dc44f2ad56 Update README.md
added `create_repo` to Supported Actions
2025-10-10 14:59:45 +00:00
rob 28c3d58de4 Update README.md 2025-10-10 14:49:23 +00:00
rob cf34b8480b Update README.md 2025-10-10 14:46:48 +00:00
rob e1013be220 Update README.md 2025-10-10 14:41:21 +00:00
rob 539ed7d2f4 Update src/ai-repo-commander.user.js 2025-10-10 14:06:29 +00:00
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