Monorepo for Aesthetic.Computer
aesthetic.computer
1# 🎭 Teia Integration for Aesthetic Computer
2
3> **⚠️ For LLMs/AI Agents:** Do NOT edit files in the `/output` directory. These are auto-generated build artifacts that get overwritten. Always modify source files and rebuild using the pack script.
4
5This directory contains tools for packaging aesthetic.computer pieces as Teia Interactive OBJKTs for minting on the Tezos blockchain.
6
7## Quick Start
8
9### Building a Piece for Teia
10
111. **Navigate to the teia directory:**
12 ```bash
13 cd /workspaces/aesthetic-computer/teia
14 ```
15
162. **Pack any AC piece for OBJKT deployment:**
17 ```bash
18 ./pack-for-teia.sh PIECE_NAME
19 ```
20
21 Example:
22 ```bash
23 ./pack-for-teia.sh starfield
24 ```
25
263. **Your package will be created at:**
27 - **Directory:** `output/PIECE_NAME/`
28 - **Zip file:** `output/PIECE_NAME.zip`
29
304. **Deploy to Teia:**
31 - Go to [teia.art/mint](https://teia.art/mint)
32 - Upload the `.zip` file
33 - Preview and test your interactive OBJKT
34 - Set metadata and mint!
35
36## How the Packing Process Works
37
38The `pack-for-teia.sh` script creates a fully self-contained package:
39
401. **Loads the piece** from `system/public/aesthetic.computer/disks/PIECE_NAME.mjs`
412. **Bundles AC system** (boot.mjs, bios.mjs, all required libraries)
423. **Applies OBJKT compatibility patches**:
43 - Enables PACK mode for sandboxed iframe environment
44 - Disables authentication and session features
45 - Patches URL resolution for bundled assets
46 - Removes verbose console logging
474. **Packages dependencies** (fonts, external libraries, etc.)
485. **Creates deployment-ready ZIP** with HTML entry point
49
50## Package Structure
51
52Each built package contains:
53```
54PIECE_NAME/
55├── index.html # Entry point with OBJKT configuration
56├── cover.svg # Auto-generated cover image
57└── aesthetic.computer/ # Complete AC system bundle
58 ├── boot.mjs # TEIA-patched boot loader
59 ├── bios.mjs # TEIA-patched system core
60 ├── style.css # Enhanced styling for nogap mode
61 ├── disks/ # Piece files and dependencies
62 ├── lib/ # All AC libraries (disk.mjs, etc.)
63 ├── dep/ # External dependencies
64 └── type/ # Font assets and glyph files
65```
66
67## OBJKT Environment Features
68
69### Automatic Configuration
70- **TEIA Mode:** Automatically detected and enabled
71- **Sandboxed Environment:** Safe execution with limited network access
72- **Clean Console:** Minimal logging for professional presentation
73- **Responsive Layout:** Adapts to different iframe sizes
74
75### Available Parameters
76Teia provides these URL parameters to your piece:
77- `viewer` - Tezos address of current viewer
78- `creator` - Tezos address of OBJKT creator
79- `objkt` - Whether this is an OBJKT context
80
81### Access Parameters in Your Piece
82```javascript
83// These are automatically available as globals
84const viewer = window.acOBJKT_VIEWER; // tz1abc...
85const creator = window.acOBJKT_CREATOR; // tz1def...
86```
87
88## Development Tips
89
90### Console Output
91The build process creates clean console output showing only:
92```
93Aesthetic Computer
94TEIA
95```
96
97### Local Testing
98After building, test locally:
99```bash
100# Server automatically starts on port 8001 after build
101# Open http://localhost:8001 with OBJKT simulation parameters
102```
103
104### File Organization
105- **Source files:** Always edit files in `system/public/aesthetic.computer/`
106- **Build script:** Modify `ac-pack.mjs` for packing logic changes
107- **Generated files:** Never edit `output/` directory contents directly
108
109## Troubleshooting
110
111### Common Issues
112- **403/404 errors:** Usually URL resolution problems - check path construction in patches
113- **Piece not loading:** Verify piece exists in `disks/` directory
114- **Console spam:** Check that logging patches are applied correctly
115
116### Debugging
117- Review generated HTML in `output/PIECE_NAME/index.html`
118- Check browser console for error messages
119- Test with OBJKT URL parameters: `?viewer=tz1abc&creator=tz1def`
120
121---
122
123**Ready to mint your interactive art on Tezos!** 🎨⛓️
124 ├── bios.mjs # Core system
125 ├── style.css # Styles
126 ├── lib/ # Library modules
127 └── systems/ # System modules
128```
129
130## Supported Pieces
131
132Most aesthetic.computer pieces should work in Teia with minimal to no modifications. However, some limitations apply:
133
134### ✅ Fully Supported
135- Drawing and painting tools (paint, brush, spray)
136- Generative art (starfield, sparkle, noise)
137- Interactive games and experiences
138- Audio/visual pieces
139
140### ⚠️ Limited Support
141- Network-dependent pieces (may need fallbacks)
142- Authentication-required pieces
143- WebRTC/real-time multiplayer features
144
145### ❌ Not Supported
146- Server-side functionality
147- External API dependencies
148- File system access
149
150## Development Workflow
151
1521. **Create/Test Piece**: Develop in aesthetic.computer environment
1532. **Pack for Teia**: Use packing tools to create Teia-compatible version
1543. **Local Testing**: Test the packaged version locally
1554. **Upload to Teia**: Deploy as Interactive OBJKT
1565. **Monitor Performance**: Check piece behavior in Teia environment
157
158## Testing
159
160Test packaged pieces locally:
161```bash
162# After packing
163cd tokens/piece-name
164python -m http.server 8000
165# Visit http://localhost:8000
166```
167
168Test with Teia parameters:
169```
170http://localhost:8000?viewer=tz1abc...&creator=tz1def...
171```
172
173## Examples
174
175See the `/examples` directory for sample pieces that have been successfully deployed to Teia.
176
177## Troubleshooting
178
179### Common Issues
180
1811. **Piece doesn't load**: Check browser console for JavaScript errors
1822. **Missing assets**: Ensure all dependencies are bundled
1833. **Performance issues**: Large pieces may need optimization for Teia
1844. **Audio problems**: Web Audio API restrictions in iframes
185
186### Debug Mode
187
188Enable debug logging:
189```javascript
190window.acTEIA_DEBUG = true;
191```
192
193## Resources
194
195- [Teia Documentation](https://github.com/teia-community/teia-docs)
196- [Interactive OBJKTs Guide](https://github.com/teia-community/teia-docs/wiki/Interactive-OBJKTs)
197- [Aesthetic Computer Documentation](../README.md)
198
199## Contributing
200
201To improve Teia integration:
202
2031. Test pieces in Teia environment
2042. Document compatibility issues
2053. Submit fixes for sandboxing problems
2064. Add examples of successful deployments
207
208## License
209
210Same as aesthetic.computer project.