co-mono/packages/web-ui/src/tools
Mario Zechner c2793d8017 Add runtime bridge architecture and fix HTML escaping
Major refactoring to unify runtime providers across sandbox and user script contexts:

1. Runtime Bridge & Router
   - Add RuntimeMessageBridge for unified messaging abstraction
   - Rename SandboxMessageRouter → RuntimeMessageRouter
   - Router now handles both iframe and user script messages
   - Guard for non-extension environments

2. Provider Refactoring
   - ArtifactsRuntimeProvider: Add offline mode with snapshot fallback
   - AttachmentsRuntimeProvider: Remove returnDownloadableFile (moved to dedicated provider)
   - ConsoleRuntimeProvider: Add message collection, remove lifecycle logic
   - FileDownloadRuntimeProvider: New provider for file downloads

3. HTML Escaping Fix
   - Escape </script> in JSON.stringify output to prevent premature tag closure
   - Applies when injecting provider data into <script> tags
   - JavaScript engine automatically unescapes, no runtime changes needed

4. Function Renaming
   - listFiles → listAttachments
   - readTextFile → readTextAttachment
   - readBinaryFile → readBinaryAttachment
   - returnFile → returnDownloadableFile

5. Updated Exports
   - Export new RuntimeMessageBridge and RuntimeMessageRouter
   - Export FileDownloadRuntimeProvider
   - Update all cross-references

This sets the foundation for reusing providers in browser-javascript tool.
2025-10-09 17:32:45 +02:00
..
artifacts Add runtime bridge architecture and fix HTML escaping 2025-10-09 17:32:45 +02:00
renderers Refactor artifacts renderer and add Console component 2025-10-08 01:54:50 +02:00
index.ts Refactor artifacts renderer and add Console component 2025-10-08 01:54:50 +02:00
javascript-repl.ts Add artifact message persistence for session reconstruction 2025-10-09 04:07:59 +02:00
renderer-registry.ts Don't access innerHTML like that or lit kills itself. 2025-10-09 04:26:03 +02:00
types.ts Refactor artifacts renderer and add Console component 2025-10-08 01:54:50 +02:00