abyXsmart/A.I-Migration-Code-Generator
<!-- ======================================================================== METADATA LOCK - DO NOT EDIT THE BLOCK ABOVE ------------------------------------------------------------------------ The YAML front matter between the two --- lines at the very top of this file is Hugging Face Spaces configuration metadata. It MUST remain exactly as written.
INSTRUCTION FOR ANY HUMAN OR AI AGENT:
- Do NOT modify, reorder, reformat, translate, or remove any field in the metadata block above.
- Do NOT change title, sdk, emoji, colors, license, pinned, or short_description.
- You may freely edit ONLY the documentation content BELOW this notice. Altering the metadata will break the Hugging Face Space deployment. ======================================================================== -->
A.I Agent State Migration Handoff
A FastAPI web app that builds a structured agent migration bundle entirely in memory, uploads it to the SC Agent Migration Relay, and returns a live import code and download token. You paste the generated prompt into Starchild (or any compatible agent) to import the migrated state via the agent-import skill.
What It Does
- Builds a
migration/bundle as an in-memorytar.gz(nothing is written to disk, so it runs cleanly on ephemeral or read-only hosts like Hugging Face Spaces). - Uploads the raw bytes to the relay endpoint and reads back a one-time
codeanddownload_token. - Renders a clean, copy-ready import prompt and a checklist of exactly what was packed.
Memory Modes
- Strategy Profile - packs the full FVG-Delta strategy memory, identity, soul directives, and Stage 3 / Stage 4 monitoring tasks.
- Plain Clean Profile - a neutral, generic bundle with no strategy-specific content, for conversations unrelated to your strategy.
- Custom Memory - paste text or upload a file (
.md,.txt,.pdf, and other text-based formats). The content is parsed and packed as declarative memory. PDFs are text-extracted; if a PDF has no extractable text, typed fallback text is used.
Bundle Structure
migration/manifest.json
migration/memory/agent.json
migration/memory/user.json
migration/identity/profile.json
migration/identity/soul.md
migration/user/settings.json
migration/tasks/tasks.json
migration/env/keys.jsonThe root is always flat (migration/*) to stay compatible with the importer. Identity uses native fields (name, vibe, emoji, creature), user settings include timezone / language / what_to_call, and memory files are declarative lists ready to be added as memory entries.
Environment Keys
migration/env/keys.json ships with STARCHILD_API_KEY and AGENT_MIGRATION_TOKEN. By default values are empty (the importer will request them securely). You may optionally embed values from the UI, or the server will fall back to its own environment variables when embedding is enabled.
Rate Limiting
The relay is rate limited. The backend retries transient 429 responses, and the UI shows a live cooldown countdown before re-enabling generation.
Run Locally
pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port 7860Then open http://localhost:7860.
Deploy On Hugging Face Spaces
Create a new Space with the Docker SDK and push these three files (Dockerfile, requirements.txt, app.py) plus this README.md. The Space listens on port 7860. Keep the metadata block at the top of this file intact.
Files
app.py- FastAPI backend, in-memory bundler, relay client, and the single-file dashboard UI.requirements.txt- Python dependencies.Dockerfile- container build for Hugging Face Spaces (port 7860).
License
MIT.
