#!/usr/bin/env python3 """Post one demo artifact of every kind, tagged, dated today. Posts through the real ingest API using the existing daybook_post.py helper, so seeded data goes through the same normalization as real agent output. Usage (from project root, with the dev server running): python scripts/seed_demo_artifacts.py """ import subprocess import sys import tempfile from pathlib import Path HELPER = Path(__file__).resolve().parent.parent / "skills" / "daybook-posting" / "scripts" / "daybook_post.py" PERSONA = "seed-demo" TAGS = "seed-demo,demo" def run_post(args): result = subprocess.run([sys.executable, str(HELPER), *args], capture_output=True, text=True) print(result.stdout.strip()) if result.returncode != 0: print(result.stderr.strip(), file=sys.stderr) return result.returncode def post_text(kind, title, content, extra_tag): with tempfile.NamedTemporaryFile("w", suffix=".txt", delete=False, encoding="utf-8") as tmp: tmp.write(content) content_path = tmp.name return run_post([ "--kind", kind, "--title", title, "--persona", PERSONA, "--tags", f"{TAGS},{extra_tag}", "--content-file", content_path, ]) def post_file(title, file_path, extra_tag): return run_post([ "--file", str(file_path), "--title", title, "--persona", PERSONA, "--tags", f"{TAGS},{extra_tag}", ]) def main(): exit_codes = [] exit_codes.append(post_text( "markdown", "Seed: Markdown Sample", "# Markdown Sample\n\nThis is a **seed** artifact demonstrating markdown rendering.\n\n- item one\n- item two\n", "markdown", )) exit_codes.append(post_text( "html_fragment", "Seed: HTML Fragment Sample", "
This is a seed HTML fragment artifact.
", "html-fragment", )) exit_codes.append(post_text( "html_full", "Seed: Full HTML Sample", "Seed artifact.
", "html-full", )) exit_codes.append(post_text( "deck", "Seed: Deck Sample", "Seed deck artifact.
More content.