Update README.md

This commit is contained in:
rob 2025-10-07 06:00:56 +00:00
parent c74c8cc2a5
commit 36951c5b16
1 changed files with 31 additions and 31 deletions

View File

@ -20,17 +20,17 @@ Highlights
Quick Start
Install Tampermonkey (or Violentmonkey) in your browser.
Install Tampermonkey or Violentmonkey in your browser.
Add the userscript: src/ai-repo-commander.user.js (or paste into a new script).
Add the userscript: src/ai-repo-commander.user.js (create a new script and paste the file contents).
(Optional) Open the script and review CONFIG defaults.
(Optional) Open the script and review the CONFIG defaults.
In chat, ask the AI to return a code-fenced YAML command (fenced with ``` and containing ^%$bridge).
In chat, ask the AI to return a code-fenced YAML command (```yaml … ```) that begins with ^%$bridge.
On first run with API enabled, youll be prompted for your bridge key (kept in memory for the session).
On first API call, youll be prompted for your bridge key (stored in memory for this session).
By default:
Defaults:
ASSISTANT_ONLY: true — only assistant messages are processed.
@ -59,12 +59,12 @@ path: src/index.js
Supported Actions & Required Fields
action required fields notes
get_file action, repo, path Pastes content into the chat input (or copies to clipboard if paste is blocked)
list_files action, repo, path Lists files under a path
create_repo action, repo Creates a repo (backend must support it)
create_file action, repo, path, content Auto-adds a commit_message if omitted
update_file action, repo, path, content Auto-adds a commit_message if omitted
delete_file action, repo, path Deletes a file
get_file action, repo, path Pastes content into the chat input (or copies to clipboard if paste is blocked).
list_files action, repo, path Lists files under a path.
create_repo action, repo Creates a repo (backend must support it).
create_file action, repo, path, content Auto-adds a commit_message if omitted.
update_file action, repo, path, content Auto-adds a commit_message if omitted.
delete_file action, repo, path Deletes a file.
Optional fields: owner (defaults to rob), url (bridge URL), branch, ref, commit_message.
@ -84,15 +84,6 @@ const CONFIG = {
CLEANUP_INTERVAL_MS: 60000
};
Runtime helpers
Emergency stop: AI_REPO_STOP()
Clear persistent history: AI_REPO_CLEAR_HISTORY()
Inspect at runtime: window.AI_REPO_COMMANDER (monitor, config, test, history)
How It Works
Detect new assistant messages.
@ -101,21 +92,21 @@ Require a code-fenced block containing ^%$bridge.
Extract & parse YAML; validate required fields and formats.
Debounce for 5s (prevents partial/streaming execution).
Debounce for 5 seconds (prevents partial/streaming execution).
Execute against your bridge (with retries & timeouts) or mock if disabled.
Feedback replaces the command with a status banner.
Feedback: show a status banner (Processing / Success / Error).
Persist a hash of the executed block for 30 days (prevents re-runs).
Persist a hash of the executed block for 30 days (prevents re-runs on reload).
Status Messages
[action: Processing…] making the API request
[action: Processing…] making the API request
[action: Success] operation completed (message from bridge shown when available)
[action: Success] — operation completed (bridge message shown when available)
[action: Error] network/timeout/validation error (details included)
[action: Error] network/timeout/validation error (details included)
Troubleshooting
@ -131,16 +122,24 @@ If the AI streamed and then edited the block, the script waits for the final ver
get_file didnt paste
Some editors block synthetic paste. We fall back to copying to the clipboard and notify you to paste manually.
Some editors block synthetic paste. The script falls back to copying to the clipboard and notifies you to paste manually.
Re-running on purpose
Edit any part of the code-block (whitespace included) or clear history: AI_REPO_CLEAR_HISTORY().
Edit any part of the code block (whitespace included) or clear history: AI_REPO_CLEAR_HISTORY().
Emergency stop
Call AI_REPO_STOP() (sets ENABLE_API=false, halts observers).
Runtime Helpers
Emergency stop: AI_REPO_STOP()
Clear persistent history: AI_REPO_CLEAR_HISTORY()
Inspect at runtime: window.AI_REPO_COMMANDER (monitor, config, test, history)
Security Model
Local use: Bridge key is kept in memory for the session (prompted on first API call).
@ -150,7 +149,6 @@ Command validation: required fields, path traversal guards, action whitelist.
Safe defaults: assistant-only, code-block-only, persistent dedupe.
Changelog
v1.2.1
Execute only inside code blocks
@ -161,4 +159,6 @@ Streaming-safe debounce & re-parse
Robust get_file paste with clipboard fallback
Safer assistant detection; initial delayed scan to catch first render
Safer assistant detection; initial delayed scan to catch first render
© Your Name. Licensed as you prefer.