Add initial web editor app, CLI scripts, and test scaffolding.

This introduces the FastAPI editor implementation and related project setup so the app can be run and validated locally.

Made-with: Cursor
This commit is contained in:
2026-04-11 02:14:26 +12:00
parent fb5f55cda7
commit f9bf119af6
33 changed files with 4846 additions and 0 deletions

38
code/demo_prompt_args.py Normal file
View File

@@ -0,0 +1,38 @@
from pathlib import Path
import sys
def main() -> int:
workspace_root = Path(__file__).resolve().parents[1]
prompts_root = workspace_root / "prompts"
if len(sys.argv) < 2:
print("Usage: demo_prompt_args.py <prompt-folder>")
print("Example: demo_prompt_args.py test")
return 1
prompt_folder = sys.argv[1].strip().strip("/")
if not prompt_folder:
print("Error: prompt folder arg is empty.")
return 1
target_dir = prompts_root / prompt_folder
if not target_dir.exists() or not target_dir.is_dir():
print(f"Error: prompts folder not found: {target_dir}")
return 1
txt_files = sorted(target_dir.glob("*.txt"))
if not txt_files:
print(f"No .txt files found in prompts/{prompt_folder}")
return 0
print(f"Reading {len(txt_files)} prompt file(s) from prompts/{prompt_folder}")
for txt_file in txt_files:
print(f"\n--- {txt_file.name} ---")
print(txt_file.read_text(encoding="utf-8"))
return 0
if __name__ == "__main__":
raise SystemExit(main())

7
code/main.py Normal file
View File

@@ -0,0 +1,7 @@
from time import sleep
i = 0
while True:
print(f"Hello {i}")
i += 1
sleep(1)

3
code/test.py Normal file
View File

@@ -0,0 +1,3 @@
from printer import printer
printer("hello")