fixes
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
Make sure to update this file every time.
|
||||
# Manual Slop
|
||||
|
||||
**manual_slop** is a local GUI tool for manually curating and sending context to AI APIs. It aggregates files, screenshots, and discussion history into a structured markdown file and sends it to a chosen AI provider with a user-written message. The AI can also execute PowerShell scripts within the project directory, with user confirmation required before each execution.
|
||||
## Baseline
|
||||
|
||||
Make sure to update this file every time.
|
||||
DO NOT EVER make a shell script unless told to. DO NOT EVER make a readme or a file describing your changes unless your are told to. If you have commands I should be entering into the command line or if you have something to explain to me, please just use code blocks or normal text output. DO NOT DO ANYTHING OTHER THAN WHAT YOU WERE TOLD TODO. DO NOT EVER, EVER DO ANYTHING OTHER THAN WHAT YOU WERE TOLD TO DO. IF YOU WANT TO DO OTHER THINGS, SIMPLY SUGGEST THEM, AND THEN I WILL REVIEW YOUR CHANGES, AND MAKE THE DECISION ON HOW TO PROCEED. WHEN WRITING SCRIPTS USE A 120-160 character limit per line. I don't want to see scrunched code.
|
||||
|
||||
## Summary
|
||||
|
||||
Is a local GUI tool for manually curating and sending context to AI APIs. It aggregates files, screenshots, and discussion history into a structured markdown file and sends it to a chosen AI provider with a user-written message. The AI can also execute PowerShell scripts within the project directory, with user confirmation required before each execution.
|
||||
|
||||
**Stack:**
|
||||
- `dearpygui` - GUI with docking/floating/resizable panels
|
||||
|
||||
22
ai_client.py
22
ai_client.py
@@ -429,19 +429,16 @@ def _repair_anthropic_history(history: list[dict]):
|
||||
if last.get("role") != "assistant":
|
||||
return
|
||||
content = last.get("content", [])
|
||||
# Find tool_use blocks (content may be a list of dicts or SDK objects)
|
||||
tool_use_ids = []
|
||||
for block in content:
|
||||
if isinstance(block, dict):
|
||||
if block.get("type") == "tool_use":
|
||||
tool_use_ids.append(block["id"])
|
||||
else:
|
||||
# SDK object
|
||||
if getattr(block, "type", None) == "tool_use":
|
||||
tool_use_ids.append(block.id)
|
||||
if not tool_use_ids:
|
||||
return
|
||||
# Append a synthetic tool_result for each dangling tool_use
|
||||
history.append({
|
||||
"role": "user",
|
||||
"content": [
|
||||
@@ -454,6 +451,7 @@ def _repair_anthropic_history(history: list[dict]):
|
||||
],
|
||||
})
|
||||
|
||||
|
||||
def _send_anthropic(md_content: str, user_message: str, base_dir: str) -> str:
|
||||
try:
|
||||
_ensure_anthropic_client()
|
||||
@@ -545,25 +543,9 @@ def _send_anthropic(md_content: str, user_message: str, base_dir: str) -> str:
|
||||
"tool_use_id": block.id,
|
||||
"content": output,
|
||||
})
|
||||
elif block.type == "tool_use":
|
||||
# Unknown tool - return an error result so history stays valid
|
||||
tool_results.append({
|
||||
"type": "tool_result",
|
||||
"tool_use_id": block.id,
|
||||
"content": f"ERROR: unknown tool '{block.name}'",
|
||||
})
|
||||
|
||||
# Always append tool_results when stop_reason was tool_use,
|
||||
# even if the list is somehow empty (shouldn't happen, but be safe)
|
||||
if not tool_results:
|
||||
# Synthesise a result for every tool_use block to keep history valid
|
||||
for block in response.content:
|
||||
if block.type == "tool_use":
|
||||
tool_results.append({
|
||||
"type": "tool_result",
|
||||
"tool_use_id": block.id,
|
||||
"content": "ERROR: tool could not be executed.",
|
||||
})
|
||||
break
|
||||
|
||||
_anthropic_history.append({
|
||||
"role": "user",
|
||||
|
||||
19
config.toml
19
config.toml
@@ -22,23 +22,10 @@ paths = [
|
||||
|
||||
[screenshots]
|
||||
base_dir = "C:/Users/Ed/scoop/apps/sharex/current/ShareX/Screenshots/2026-02"
|
||||
paths = [
|
||||
"C:/Users/Ed/scoop/apps/sharex/current/ShareX/Screenshots/2026-02/2026-02-21_19-40-16.png",
|
||||
]
|
||||
paths = []
|
||||
|
||||
[discussion]
|
||||
history = [
|
||||
"User:\nLets add multiple project support. currently this project would be the \"manual_slop\" project. \nI need to make a separate \"manual_slop.toml\" for this and offload things that would be within a per project to it.\nI also want to have several discussion histories that I can label. \nThis would allow me to stash and continue separate effort's histories..\nIt would be important if these discussions saved the last git commit they were on. (I'll need a buton to manually update it).\nAnd timestamps on each discussion entry to give an idea of the duration involved and \nhow the project has evolved since the discussion stream's effort was last done.\nBasically preserve context so ai can use that as valuable information in its working memory.\n\nTo load a project I'll need to hoist it into the config by providing the path.\nMaybe allow multiple project tomls to be specified path wise in the array.",
|
||||
"AI:\nAnnotated by user:\nNo response from AI, taking sceenshot of scripts run... and directory's state",
|
||||
"User:\nHey it seems like you were not done want to continue?",
|
||||
"AI:\nDid work, No response from AI (this is an annotated entry by the user), made project_manager.py, adding it to md context.",
|
||||
"User:\ncontinue. You made a file but no changes have been made yet to gui.py. Still in progress to add all the multiple project support wishlist from user message earlier.",
|
||||
"AI:\nNo response yet again maybe the response box is broken (User annotated)",
|
||||
"User:\ncontinue. Sending multiple project wishlist more concise here:\n- Adding multiple project support. \n- Currently this project would be the \"manual_slop\" project. \n- Make a separate \"manual_slop.toml\" for this and offload things that would be within a per project to it.\n- Want to have several discussion histories that I can label. \n- This would allow me to stash and continue separate effort's histories..\n- It would be important if these discussions saved the last git commit they were on. (I'll need a buton to manually update it).\n- And timestamps on each discussion entry to give an idea of the duration involved and indicate if the project has evolved since the discussion stream's effort was last done.\n - Basically preserve context so ai can use that as valuable information in its working memory.\n- To load a project I'll need to hoist it into the config by providing the path.\n- Maybe allow multiple project tomls to be specified path wise in the array.",
|
||||
"AI:\nGood. I have a complete picture. Here's the plan:\n\n**What we need to do:**\n\n1. **Create `manual_slop.toml`** — the per-project file, migrated from `config.toml`, with the new project structure (`project_manager.default_project` shape)\n2. **Update `config.toml`** — strip out project-specific sections, add `[projects]` array pointing to `manual_slop.toml`, keep `[ai]` and `[theme]` here as \"global\" app config\n3. **Rewrite `gui.py`** with a Python patch script that adds:\n - Project loading/switching panel (load from path, list of loaded projects, active project indicator)\n - Discussion switcher (list discussions by label, new/rename/delete discussion)\n - Git commit display + \"Update Commit\" button per discussion\n - Timestamps on entries (wired to `project_manager.entry_to_str/str_to_entry`)\n - All save/flush operations target the active project `.toml` via `project_manager.save_project()`\n - `App` state restructured: `self.proj` (active project dict), `self.proj_path`, `self.active_disc_name`\n\nI'll use a Python patch script to avoid PowerShell escaping issues. Let me write it:",
|
||||
"User:\nYep, write that file! No need to backup they've been done multiple times!",
|
||||
"AI:\nWriting the new `gui.py` via a Python script to avoid PowerShell escaping issues. This is a full rewrite with multi-project support.",
|
||||
]
|
||||
history = []
|
||||
roles = [
|
||||
"User",
|
||||
"AI",
|
||||
@@ -54,4 +41,4 @@ model = "claude-sonnet-4-6"
|
||||
palette = "10x Dark"
|
||||
font_path = "C:/Users/Ed/AppData/Local/uv/cache/archive-v0/WSthkYsQ82b_ywV6DkiaJ/pygame_gui/data/FiraCode-Regular.ttf"
|
||||
font_size = 18.0
|
||||
scale = 1.0
|
||||
scale = 1.1
|
||||
|
||||
Reference in New Issue
Block a user