Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion agents/s01_agent_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms01 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s01 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
9 changes: 8 additions & 1 deletion agents/s02_tool_use.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
import subprocess
from pathlib import Path

try:
import readline
readline.parse_and_bind('set bind-tty-special-chars off')
except ImportError:
pass

from anthropic import Anthropic
from dotenv import load_dotenv

Expand Down Expand Up @@ -136,7 +142,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms02 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s02 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
9 changes: 8 additions & 1 deletion agents/s03_todo_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
import subprocess
from pathlib import Path

try:
import readline
readline.parse_and_bind('set bind-tty-special-chars off')
except ImportError:
pass

from anthropic import Anthropic
from dotenv import load_dotenv

Expand Down Expand Up @@ -196,7 +202,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms03 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s03 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
9 changes: 8 additions & 1 deletion agents/s04_subagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
import subprocess
from pathlib import Path

try:
import readline
readline.parse_and_bind('set bind-tty-special-chars off')
except ImportError:
pass

from anthropic import Anthropic
from dotenv import load_dotenv

Expand Down Expand Up @@ -172,7 +178,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms04 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s04 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
9 changes: 8 additions & 1 deletion agents/s05_skill_loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
import yaml
from pathlib import Path

try:
import readline
readline.parse_and_bind('set bind-tty-special-chars off')
except ImportError:
pass

from anthropic import Anthropic
from dotenv import load_dotenv

Expand Down Expand Up @@ -212,7 +218,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms05 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s05 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
9 changes: 8 additions & 1 deletion agents/s06_context_compact.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
import time
from pathlib import Path

try:
import readline
readline.parse_and_bind('set bind-tty-special-chars off')
except ImportError:
pass

from anthropic import Anthropic
from dotenv import load_dotenv

Expand Down Expand Up @@ -247,7 +253,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms06 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s06 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
9 changes: 8 additions & 1 deletion agents/s07_task_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
import subprocess
from pathlib import Path

try:
import readline
readline.parse_and_bind('set bind-tty-special-chars off')
except ImportError:
pass

from anthropic import Anthropic
from dotenv import load_dotenv

Expand Down Expand Up @@ -228,7 +234,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms07 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s07 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
9 changes: 8 additions & 1 deletion agents/s08_background_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@
import uuid
from pathlib import Path

try:
import readline
readline.parse_and_bind('set bind-tty-special-chars off')
except ImportError:
pass

from anthropic import Anthropic
from dotenv import load_dotenv

Expand Down Expand Up @@ -246,7 +252,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms08 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s08 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
9 changes: 8 additions & 1 deletion agents/s09_agent_teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
import time
from pathlib import Path

try:
import readline
readline.parse_and_bind('set bind-tty-special-chars off')
except ImportError:
pass

from anthropic import Anthropic
from dotenv import load_dotenv

Expand Down Expand Up @@ -383,7 +389,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms09 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s09 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
9 changes: 8 additions & 1 deletion agents/s10_team_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
import uuid
from pathlib import Path

try:
import readline
readline.parse_and_bind('set bind-tty-special-chars off')
except ImportError:
pass

from anthropic import Anthropic
from dotenv import load_dotenv

Expand Down Expand Up @@ -464,7 +470,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms10 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s10 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
9 changes: 8 additions & 1 deletion agents/s11_autonomous_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
import uuid
from pathlib import Path

try:
import readline
readline.parse_and_bind('set bind-tty-special-chars off')
except ImportError:
pass

from anthropic import Anthropic
from dotenv import load_dotenv

Expand Down Expand Up @@ -556,7 +562,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms11 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s11 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
9 changes: 8 additions & 1 deletion agents/s12_worktree_task_isolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
import time
from pathlib import Path

try:
import readline
readline.parse_and_bind('set bind-tty-special-chars off')
except ImportError:
pass

from anthropic import Anthropic
from dotenv import load_dotenv

Expand Down Expand Up @@ -767,7 +773,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms12 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s12 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
9 changes: 8 additions & 1 deletion agents/s_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
from pathlib import Path
from queue import Queue

try:
import readline
readline.parse_and_bind('set bind-tty-special-chars off')
except ImportError:
pass

from anthropic import Anthropic
from dotenv import load_dotenv

Expand Down Expand Up @@ -743,7 +749,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms_full >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s_full >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
3 changes: 2 additions & 1 deletion s01_agent_loop/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms01 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s01 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
3 changes: 2 additions & 1 deletion s02_tool_use/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms02 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s02 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
3 changes: 2 additions & 1 deletion s03_permission/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms03 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s03 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
3 changes: 2 additions & 1 deletion s04_hooks/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms04 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s04 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
3 changes: 2 additions & 1 deletion s05_todo_write/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms05 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s05 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
3 changes: 2 additions & 1 deletion s06_subagent/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms06 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s06 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
3 changes: 2 additions & 1 deletion s07_skill_loading/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms07 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s07 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
3 changes: 2 additions & 1 deletion s08_context_compact/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,8 @@ def agent_loop(messages: list, active_request: str):
history = []
while True:
try:
query = input("\033[36ms08 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s08 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
3 changes: 2 additions & 1 deletion s09_memory/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms09 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s09 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
3 changes: 2 additions & 1 deletion s10_task_system/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms10 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s10 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
3 changes: 2 additions & 1 deletion s11_background_tasks/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ def agent_loop(messages: list):
history = []
while True:
try:
query = input("\033[36ms11 >> \033[0m")
# \001/\002 tell Readline the ANSI escapes have zero display width.
query = input("\001\033[36m\002s11 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):
Expand Down
Loading