🎭 Teia Integration for Aesthetic Computer#
⚠️ For LLMs/AI Agents: Do NOT edit files in the
/outputdirectory. These are auto-generated build artifacts that get overwritten. Always modify source files and rebuild using the pack script.
This directory contains tools for packaging aesthetic.computer pieces as Teia Interactive OBJKTs for minting on the Tezos blockchain.
Quick Start#
Building a Piece for Teia#
-
Navigate to the teia directory:
cd /workspaces/aesthetic-computer/teia -
Pack any AC piece for OBJKT deployment:
./pack-for-teia.sh PIECE_NAMEExample:
./pack-for-teia.sh starfield -
Your package will be created at:
- Directory:
output/PIECE_NAME/ - Zip file:
output/PIECE_NAME.zip
- Directory:
-
Deploy to Teia:
- Go to teia.art/mint
- Upload the
.zipfile - Preview and test your interactive OBJKT
- Set metadata and mint!
How the Packing Process Works#
The pack-for-teia.sh script creates a fully self-contained package:
- Loads the piece from
system/public/aesthetic.computer/disks/PIECE_NAME.mjs - Bundles AC system (boot.mjs, bios.mjs, all required libraries)
- Applies OBJKT compatibility patches:
- Enables PACK mode for sandboxed iframe environment
- Disables authentication and session features
- Patches URL resolution for bundled assets
- Removes verbose console logging
- Packages dependencies (fonts, external libraries, etc.)
- Creates deployment-ready ZIP with HTML entry point
Package Structure#
Each built package contains:
PIECE_NAME/
├── index.html # Entry point with OBJKT configuration
├── cover.svg # Auto-generated cover image
└── aesthetic.computer/ # Complete AC system bundle
├── boot.mjs # TEIA-patched boot loader
├── bios.mjs # TEIA-patched system core
├── style.css # Enhanced styling for nogap mode
├── disks/ # Piece files and dependencies
├── lib/ # All AC libraries (disk.mjs, etc.)
├── dep/ # External dependencies
└── type/ # Font assets and glyph files
OBJKT Environment Features#
Automatic Configuration#
- TEIA Mode: Automatically detected and enabled
- Sandboxed Environment: Safe execution with limited network access
- Clean Console: Minimal logging for professional presentation
- Responsive Layout: Adapts to different iframe sizes
Available Parameters#
Teia provides these URL parameters to your piece:
viewer- Tezos address of current viewercreator- Tezos address of OBJKT creatorobjkt- Whether this is an OBJKT context
Access Parameters in Your Piece#
// These are automatically available as globals
const viewer = window.acOBJKT_VIEWER; // tz1abc...
const creator = window.acOBJKT_CREATOR; // tz1def...
Development Tips#
Console Output#
The build process creates clean console output showing only:
Aesthetic Computer
TEIA
Local Testing#
After building, test locally:
# Server automatically starts on port 8001 after build
# Open http://localhost:8001 with OBJKT simulation parameters
File Organization#
- Source files: Always edit files in
system/public/aesthetic.computer/ - Build script: Modify
ac-pack.mjsfor packing logic changes - Generated files: Never edit
output/directory contents directly
Troubleshooting#
Common Issues#
- 403/404 errors: Usually URL resolution problems - check path construction in patches
- Piece not loading: Verify piece exists in
disks/directory - Console spam: Check that logging patches are applied correctly
Debugging#
- Review generated HTML in
output/PIECE_NAME/index.html - Check browser console for error messages
- Test with OBJKT URL parameters:
?viewer=tz1abc&creator=tz1def
Ready to mint your interactive art on Tezos! 🎨⛓️ ├── bios.mjs # Core system ├── style.css # Styles ├── lib/ # Library modules └── systems/ # System modules
## Supported Pieces
Most aesthetic.computer pieces should work in Teia with minimal to no modifications. However, some limitations apply:
### ✅ Fully Supported
- Drawing and painting tools (paint, brush, spray)
- Generative art (starfield, sparkle, noise)
- Interactive games and experiences
- Audio/visual pieces
### ⚠️ Limited Support
- Network-dependent pieces (may need fallbacks)
- Authentication-required pieces
- WebRTC/real-time multiplayer features
### ❌ Not Supported
- Server-side functionality
- External API dependencies
- File system access
## Development Workflow
1. **Create/Test Piece**: Develop in aesthetic.computer environment
2. **Pack for Teia**: Use packing tools to create Teia-compatible version
3. **Local Testing**: Test the packaged version locally
4. **Upload to Teia**: Deploy as Interactive OBJKT
5. **Monitor Performance**: Check piece behavior in Teia environment
## Testing
Test packaged pieces locally:
```bash
# After packing
cd tokens/piece-name
python -m http.server 8000
# Visit http://localhost:8000
Test with Teia parameters:
http://localhost:8000?viewer=tz1abc...&creator=tz1def...
Examples#
See the /examples directory for sample pieces that have been successfully deployed to Teia.
Troubleshooting#
Common Issues#
- Piece doesn't load: Check browser console for JavaScript errors
- Missing assets: Ensure all dependencies are bundled
- Performance issues: Large pieces may need optimization for Teia
- Audio problems: Web Audio API restrictions in iframes
Debug Mode#
Enable debug logging:
window.acTEIA_DEBUG = true;
Resources#
Contributing#
To improve Teia integration:
- Test pieces in Teia environment
- Document compatibility issues
- Submit fixes for sandboxing problems
- Add examples of successful deployments
License#
Same as aesthetic.computer project.