synthos 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/default-pages/elevenlabs_effects_studio/chat-history.json +1 -0
- package/default-pages/elevenlabs_effects_studio/page.html +1345 -1363
- package/default-pages/elevenlabs_effects_studio/page.json +13 -11
- package/default-pages/elevenlabs_voice_studio/chat-history.json +1 -0
- package/default-pages/elevenlabs_voice_studio/page.html +782 -801
- package/default-pages/elevenlabs_voice_studio/page.json +13 -11
- package/default-pages/json_tools/chat-history.json +1 -0
- package/default-pages/json_tools/page.html +70 -90
- package/default-pages/json_tools/page.json +12 -10
- package/default-pages/my_notes/chat-history.json +1 -0
- package/default-pages/my_notes/page.html +115 -131
- package/default-pages/my_notes/page.json +14 -12
- package/default-pages/neon_asteroids/chat-history.json +1 -0
- package/default-pages/neon_asteroids/page.html +1777 -1803
- package/default-pages/neon_asteroids/page.json +14 -12
- package/default-pages/oregon_trail/chat-history.json +1 -0
- package/default-pages/oregon_trail/page.html +290 -307
- package/default-pages/oregon_trail/page.json +14 -12
- package/default-pages/solar_explorer/chat-history.json +1 -0
- package/default-pages/solar_explorer/page.html +1929 -1951
- package/default-pages/solar_explorer/page.json +14 -12
- package/default-pages/solar_tutorial/chat-history.json +1 -0
- package/default-pages/solar_tutorial/page.html +464 -478
- package/default-pages/solar_tutorial/page.json +12 -10
- package/default-pages/us_map/chat-history.json +1 -0
- package/default-pages/us_map/page.html +170 -193
- package/default-pages/us_map/page.json +14 -12
- package/default-pages/us_map/page.light.png +0 -0
- package/default-pages/us_map_1850/chat-history.json +1 -0
- package/default-pages/us_map_1850/page.html +302 -326
- package/default-pages/us_map_1850/page.json +14 -12
- package/default-pages/western_cities_1850/chat-history.json +1 -0
- package/default-pages/western_cities_1850/page.html +503 -527
- package/default-pages/western_cities_1850/page.json +14 -12
- package/default-themes/aurora-dawn.v3.css +15 -14
- package/default-themes/aurora-dusk.v3.css +26 -26
- package/default-themes/cosmos-dawn.v3.css +15 -14
- package/default-themes/cosmos-dusk.v3.css +26 -26
- package/default-themes/elemental-dawn.v3.css +200 -0
- package/default-themes/nebula-dawn.v3.css +15 -14
- package/default-themes/nebula-dusk.v3.css +24 -24
- package/default-themes/solar-flare-dawn.v3.css +15 -14
- package/default-themes/solar-flare-dusk.v3.css +26 -26
- package/dist/builders/anthropic.d.ts +26 -2
- package/dist/builders/anthropic.d.ts.map +1 -1
- package/dist/builders/anthropic.js +132 -31
- package/dist/builders/anthropic.js.map +1 -1
- package/dist/builders/claudecode.d.ts +13 -0
- package/dist/builders/claudecode.d.ts.map +1 -0
- package/dist/builders/claudecode.js +253 -0
- package/dist/builders/claudecode.js.map +1 -0
- package/dist/builders/index.d.ts +2 -1
- package/dist/builders/index.d.ts.map +1 -1
- package/dist/builders/index.js +8 -1
- package/dist/builders/index.js.map +1 -1
- package/dist/builders/openai.js +2 -1
- package/dist/builders/openai.js.map +1 -1
- package/dist/builders/types.d.ts +31 -7
- package/dist/builders/types.d.ts.map +1 -1
- package/dist/builders/types.js +60 -28
- package/dist/builders/types.js.map +1 -1
- package/dist/connectors/types.d.ts +8 -0
- package/dist/connectors/types.d.ts.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +13 -6
- package/dist/init.js.map +1 -1
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +161 -14
- package/dist/migrations.js.map +1 -1
- package/dist/models/anthropic.d.ts +1 -0
- package/dist/models/anthropic.d.ts.map +1 -1
- package/dist/models/anthropic.js +129 -29
- package/dist/models/anthropic.js.map +1 -1
- package/dist/models/chainOfThought.d.ts.map +1 -1
- package/dist/models/chainOfThought.js +32 -19
- package/dist/models/chainOfThought.js.map +1 -1
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +2 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/providers.d.ts +1 -0
- package/dist/models/providers.d.ts.map +1 -1
- package/dist/models/providers.js +12 -4
- package/dist/models/providers.js.map +1 -1
- package/dist/models/types.d.ts +15 -1
- package/dist/models/types.d.ts.map +1 -1
- package/dist/models/types.js.map +1 -1
- package/dist/pages.d.ts +57 -8
- package/dist/pages.d.ts.map +1 -1
- package/dist/pages.js +258 -45
- package/dist/pages.js.map +1 -1
- package/dist/service/createCompletePrompt.d.ts.map +1 -1
- package/dist/service/createCompletePrompt.js +5 -0
- package/dist/service/createCompletePrompt.js.map +1 -1
- package/dist/service/mediaCache.d.ts +36 -0
- package/dist/service/mediaCache.d.ts.map +1 -0
- package/dist/service/mediaCache.js +182 -0
- package/dist/service/mediaCache.js.map +1 -0
- package/dist/service/pageValidator.d.ts +25 -0
- package/dist/service/pageValidator.d.ts.map +1 -0
- package/dist/service/pageValidator.js +315 -0
- package/dist/service/pageValidator.js.map +1 -0
- package/dist/service/server.d.ts.map +1 -1
- package/dist/service/server.js +4 -0
- package/dist/service/server.js.map +1 -1
- package/dist/service/sharedTableSchema.d.ts +73 -0
- package/dist/service/sharedTableSchema.d.ts.map +1 -0
- package/dist/service/sharedTableSchema.js +206 -0
- package/dist/service/sharedTableSchema.js.map +1 -0
- package/dist/service/transformPage.d.ts +49 -11
- package/dist/service/transformPage.d.ts.map +1 -1
- package/dist/service/transformPage.js +354 -241
- package/dist/service/transformPage.js.map +1 -1
- package/dist/service/useApiRoutes.d.ts.map +1 -1
- package/dist/service/useApiRoutes.js +288 -34
- package/dist/service/useApiRoutes.js.map +1 -1
- package/dist/service/useConnectorRoutes.d.ts.map +1 -1
- package/dist/service/useConnectorRoutes.js +170 -32
- package/dist/service/useConnectorRoutes.js.map +1 -1
- package/dist/service/useDataRoutes.d.ts.map +1 -1
- package/dist/service/useDataRoutes.js +59 -2
- package/dist/service/useDataRoutes.js.map +1 -1
- package/dist/service/useExtractRoutes.d.ts +4 -0
- package/dist/service/useExtractRoutes.d.ts.map +1 -0
- package/dist/service/useExtractRoutes.js +304 -0
- package/dist/service/useExtractRoutes.js.map +1 -0
- package/dist/service/usePageRoutes.d.ts +17 -0
- package/dist/service/usePageRoutes.d.ts.map +1 -1
- package/dist/service/usePageRoutes.js +1385 -483
- package/dist/service/usePageRoutes.js.map +1 -1
- package/dist/service/useSharedDataRoutes.d.ts.map +1 -1
- package/dist/service/useSharedDataRoutes.js +54 -2
- package/dist/service/useSharedDataRoutes.js.map +1 -1
- package/dist/settings.d.ts +27 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +40 -1
- package/dist/settings.js.map +1 -1
- package/dist/themes.d.ts +0 -5
- package/dist/themes.d.ts.map +1 -1
- package/dist/themes.js +3 -95
- package/dist/themes.js.map +1 -1
- package/migration-rules/v2-to-v3.md +277 -119
- package/package.json +5 -1
- package/{default-pages/application → required-pages/_shell}/page.html +56 -42
- package/required-pages/_shell/page.json +14 -0
- package/required-pages/_starters/page.html +534 -0
- package/required-pages/_starters/page.json +12 -0
- package/required-pages/builder/page.html +353 -43
- package/required-pages/builder/page.json +12 -10
- package/required-pages/pages/page.html +697 -924
- package/required-pages/pages/page.json +12 -10
- package/required-pages/settings/page.html +1879 -1753
- package/required-pages/settings/page.json +12 -10
- package/required-pages/synthos_apis/page.html +834 -845
- package/required-pages/synthos_apis/page.json +12 -10
- package/required-pages/synthos_scripts/page.html +74 -88
- package/required-pages/synthos_scripts/page.json +12 -10
- package/scripts/append-instructions.py +90 -0
- package/scripts/audit-instructions.py +76 -0
- package/scripts/cleanup-shell-markup.mjs +112 -0
- package/service-connectors/buffer/connector.json +46 -0
- package/service-connectors/canva/connector.json +67 -0
- package/service-connectors/elevenlabs/connector.json +1 -1
- package/src/builders/anthropic.ts +155 -30
- package/src/builders/claudecode.ts +310 -0
- package/src/builders/index.ts +7 -1
- package/src/builders/openai.ts +2 -1
- package/src/builders/types.ts +93 -32
- package/src/connectors/types.ts +8 -0
- package/src/init.ts +13 -7
- package/src/migrations.ts +187 -16
- package/src/models/anthropic.ts +140 -30
- package/src/models/chainOfThought.ts +33 -18
- package/src/models/index.ts +2 -2
- package/src/models/providers.ts +12 -3
- package/src/models/types.ts +21 -1
- package/src/pages.ts +271 -35
- package/src/service/createCompletePrompt.ts +6 -0
- package/src/service/mediaCache.ts +206 -0
- package/src/service/pageValidator.ts +337 -0
- package/src/service/server.ts +4 -0
- package/src/service/sharedTableSchema.ts +236 -0
- package/src/service/transformPage.ts +370 -260
- package/src/service/useApiRoutes.ts +282 -32
- package/src/service/useConnectorRoutes.ts +189 -34
- package/src/service/useDataRoutes.ts +198 -116
- package/src/service/useExtractRoutes.ts +331 -0
- package/src/service/usePageRoutes.ts +1411 -394
- package/src/service/useSharedDataRoutes.ts +184 -109
- package/src/settings.ts +65 -0
- package/src/themes.ts +78 -180
- package/starters/blank_starter/chat-history.json +1 -0
- package/starters/blank_starter/page.dark.png +0 -0
- package/starters/blank_starter/page.html +47 -0
- package/starters/blank_starter/page.json +13 -0
- package/starters/blank_starter/page.light.png +0 -0
- package/starters/calculator_starter/chat-history.json +1 -0
- package/starters/calculator_starter/page.dark.png +0 -0
- package/starters/calculator_starter/page.html +232 -0
- package/starters/calculator_starter/page.json +13 -0
- package/starters/calculator_starter/page.light.png +0 -0
- package/starters/calendar_starter/chat-history.json +1 -0
- package/starters/calendar_starter/page.dark.png +0 -0
- package/starters/calendar_starter/page.html +495 -0
- package/starters/calendar_starter/page.json +13 -0
- package/starters/calendar_starter/page.light.png +0 -0
- package/starters/chat_starter/chat-history.json +1 -0
- package/starters/chat_starter/page.dark.png +0 -0
- package/starters/chat_starter/page.html +351 -0
- package/starters/chat_starter/page.json +13 -0
- package/starters/chat_starter/page.light.png +0 -0
- package/starters/checklist_starter/chat-history.json +1 -0
- package/starters/checklist_starter/page.dark.png +0 -0
- package/starters/checklist_starter/page.html +437 -0
- package/starters/checklist_starter/page.json +13 -0
- package/starters/checklist_starter/page.light.png +0 -0
- package/starters/dashboard_starter/chat-history.json +1 -0
- package/starters/dashboard_starter/page.dark.png +0 -0
- package/starters/dashboard_starter/page.html +195 -0
- package/starters/dashboard_starter/page.json +13 -0
- package/starters/dashboard_starter/page.light.png +0 -0
- package/starters/form_starter/chat-history.json +1 -0
- package/starters/form_starter/page.dark.png +0 -0
- package/starters/form_starter/page.html +313 -0
- package/starters/form_starter/page.json +13 -0
- package/starters/form_starter/page.light.png +0 -0
- package/starters/gallery_starter/chat-history.json +1 -0
- package/starters/gallery_starter/page.dark.png +0 -0
- package/starters/gallery_starter/page.html +418 -0
- package/starters/gallery_starter/page.json +13 -0
- package/starters/gallery_starter/page.light.png +0 -0
- package/starters/generator_starter/chat-history.json +1 -0
- package/starters/generator_starter/page.dark.png +0 -0
- package/starters/generator_starter/page.html +261 -0
- package/starters/generator_starter/page.json +13 -0
- package/starters/generator_starter/page.light.png +0 -0
- package/starters/index.html +538 -0
- package/starters/kanban_starter/chat-history.json +1 -0
- package/starters/kanban_starter/page.dark.png +0 -0
- package/starters/kanban_starter/page.html +432 -0
- package/starters/kanban_starter/page.json +13 -0
- package/starters/kanban_starter/page.light.png +0 -0
- package/starters/presentation_builder/chat-history.json +1 -0
- package/starters/presentation_builder/page.dark.png +0 -0
- package/starters/presentation_builder/page.html +970 -0
- package/starters/presentation_builder/page.json +15 -0
- package/starters/presentation_builder/page.light.png +0 -0
- package/starters/presentation_builder/presentation_voice/voice_config.json +9 -0
- package/starters/pulse_starter/chat-history.json +1 -0
- package/starters/pulse_starter/page.dark.png +0 -0
- package/starters/pulse_starter/page.html +698 -0
- package/starters/pulse_starter/page.json +13 -0
- package/starters/pulse_starter/page.light.png +0 -0
- package/starters/quiz_starter/chat-history.json +1 -0
- package/starters/quiz_starter/page.dark.png +0 -0
- package/starters/quiz_starter/page.html +292 -0
- package/starters/quiz_starter/page.json +13 -0
- package/starters/quiz_starter/page.light.png +0 -0
- package/starters/reference_starter/chat-history.json +1 -0
- package/starters/reference_starter/page.dark.png +0 -0
- package/starters/reference_starter/page.html +250 -0
- package/starters/reference_starter/page.json +13 -0
- package/starters/reference_starter/page.light.png +0 -0
- package/starters/retro_game_starter/chat-history.json +1 -0
- package/starters/retro_game_starter/page.dark.png +0 -0
- package/{default-pages → starters}/retro_game_starter/page.html +1281 -1308
- package/starters/retro_game_starter/page.json +15 -0
- package/starters/retro_game_starter/page.light.png +0 -0
- package/starters/roster_starter/chat-history.json +1 -0
- package/starters/roster_starter/page.dark.png +0 -0
- package/starters/roster_starter/page.html +600 -0
- package/starters/roster_starter/page.json +13 -0
- package/starters/roster_starter/page.light.png +0 -0
- package/starters/server.js +182 -0
- package/starters/start.cmd +1 -0
- package/starters/timeline_starter/chat-history.json +1 -0
- package/starters/timeline_starter/page.dark.png +0 -0
- package/starters/timeline_starter/page.html +446 -0
- package/starters/timeline_starter/page.json +13 -0
- package/starters/timeline_starter/page.light.png +0 -0
- package/starters/tutorial_starter/chat-history.json +1 -0
- package/starters/tutorial_starter/page.dark.png +0 -0
- package/starters/tutorial_starter/page.html +283 -0
- package/starters/tutorial_starter/page.json +13 -0
- package/starters/tutorial_starter/page.light.png +0 -0
- package/static-files/agent.v3.js +122 -0
- package/static-files/connector.v3.js +48 -0
- package/static-files/extract.v3.js +188 -0
- package/static-files/helpers.v3.js +50 -6
- package/static-files/page-bridge.js +114 -0
- package/static-files/page.v3.js +1292 -1290
- package/static-files/script.v3.js +32 -0
- package/static-files/server.v3.js +89 -0
- package/static-files/shell-bridge.v3.js +174 -0
- package/static-files/shell-modals.v3.js +521 -0
- package/static-files/{shell.css → shell.v3.css} +271 -22
- package/static-files/shell.v3.js +1865 -0
- package/static-files/storage.v3.js +176 -0
- package/tests/anthropic.spec.ts +42 -7
- package/tests/builders.spec.ts +72 -4
- package/tests/pageValidator.spec.ts +548 -0
- package/tests/profiles.spec.ts +122 -0
- package/tests/providers.spec.ts +1 -1
- package/tests/sharedTableSchema.spec.ts +242 -0
- package/tests/transformPage.spec.ts +62 -81
- package/default-pages/application/page.json +0 -10
- package/default-pages/retro_game_starter/page.json +0 -12
- package/default-pages/sidebar_page/page.html +0 -51
- package/default-pages/sidebar_page/page.json +0 -10
- package/default-pages/two-panel_page/page.html +0 -68
- package/default-pages/two-panel_page/page.json +0 -10
package/dist/themes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":"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"}
|
|
@@ -100,50 +100,94 @@ All CSS rules targeting component selectors. The full list from v2 themes that a
|
|
|
100
100
|
|
|
101
101
|
---
|
|
102
102
|
|
|
103
|
-
## 2. Shell Chrome
|
|
103
|
+
## 2. Shell Chrome Removal (iframe Viewer Panel)
|
|
104
104
|
|
|
105
|
-
###
|
|
105
|
+
### Overview
|
|
106
|
+
|
|
107
|
+
In the iframe viewer panel architecture, **shell chrome is no longer part of page HTML**. The shell (toolbar, chat panel, loading overlay) lives in a parent frame (`required-pages/_shell/page.html`), and page content renders inside an `<iframe>`. Pages are pure content — they should not contain any shell markup.
|
|
108
|
+
|
|
109
|
+
### What to remove from page HTML
|
|
110
|
+
|
|
111
|
+
All of the following elements are now provided by the parent shell frame and must be removed from page HTML templates. The v2→v3 migration in `src/migrations.ts` strips every selector listed here via the `V2_SHELL_SELECTORS` table — keep that array in sync with this list.
|
|
112
|
+
|
|
113
|
+
| Selector | What it is in v2 | Who provides it in v3 |
|
|
114
|
+
|---|---|---|
|
|
115
|
+
| `.shell-toolbar` | Toolbar div (builderToggle, pagesBtn, saveBtn, settingsBtn) | Parent shell frame |
|
|
116
|
+
| `.chat-panel` | Header, `#chatMessages`, `#chatForm` with `#chatInput`, `.link-group`, inline chat history, `#defaultGreeting`, `#firstRunGreeting` | Parent shell frame |
|
|
117
|
+
| `.chat-toggle` | Collapsed-chat toggle button | Parent shell frame (if kept) |
|
|
118
|
+
| `#loadingOverlay` | Spinner overlay inside `.viewer-panel` | Parent shell frame (blueprint overlay) |
|
|
119
|
+
| `<script id="idle-animation">` | v2 inline script declaring top-level `hideIdleAnimation`/`showIdleAnimation` | Parent shell frame (no-op stubs injected at serve time) |
|
|
120
|
+
| `<script id="first-run-check">` | v2 inline script that toggles `#defaultGreeting`/`#firstRunGreeting` via `?firstRun=true` | Parent shell frame (greeting flow) |
|
|
121
|
+
| `<script id="page-helpers">` | Legacy `/api/page-helpers.js?v=2` tag | Server re-injects the cache-busted v3 URL at serve time |
|
|
122
|
+
| `<script id="page-script">` | Legacy `/api/page-script.js?v=2` tag | Server re-injects the cache-busted v3 URL at serve time |
|
|
123
|
+
| `<script id="synthos-error-capture">` | Error-capture bootstrap | Server injects when needed |
|
|
106
124
|
|
|
107
|
-
|
|
125
|
+
The `first-run-check` script in particular MUST be stripped — it references `#defaultGreeting` and `#firstRunGreeting`, both of which live inside `.chat-panel`. Leaving it behind after the panel is removed produces spurious `missing-element` validator warnings.
|
|
126
|
+
|
|
127
|
+
### Before (v2/early v3)
|
|
108
128
|
|
|
109
129
|
```html
|
|
110
|
-
|
|
111
|
-
<
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
130
|
+
<body>
|
|
131
|
+
<div class="shell-toolbar" data-locked="true">
|
|
132
|
+
<!-- toolbar buttons -->
|
|
133
|
+
</div>
|
|
134
|
+
<div class="chat-panel" data-locked="true">
|
|
135
|
+
<div class="chat-header" data-locked="true">...</div>
|
|
136
|
+
<div class="chat-messages" id="chatMessages" data-locked="true">...</div>
|
|
137
|
+
<form action="/" method="POST" id="chatForm" data-locked="true">
|
|
138
|
+
<textarea class="chat-input" id="chatInput" ...></textarea>
|
|
139
|
+
</form>
|
|
140
|
+
</div>
|
|
141
|
+
<div class="viewer-panel" id="viewerPanel">
|
|
142
|
+
<!-- page content -->
|
|
143
|
+
<div id="loadingOverlay" class="loading-overlay"><div class="spinner"></div></div>
|
|
144
|
+
</div>
|
|
145
|
+
<script id="page-helpers" src="/api/page-helpers.js?v=3" data-locked="true"></script>
|
|
146
|
+
<script id="page-script" src="/api/page-script.js?v=3" data-locked="true"></script>
|
|
147
|
+
</body>
|
|
115
148
|
```
|
|
116
149
|
|
|
117
|
-
|
|
150
|
+
### After (iframe-ready)
|
|
118
151
|
|
|
119
152
|
```html
|
|
120
|
-
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
</
|
|
153
|
+
<body>
|
|
154
|
+
<div class="viewer-panel" id="viewerPanel">
|
|
155
|
+
<!-- page content only -->
|
|
156
|
+
</div>
|
|
157
|
+
<div id="instructions" style="display: none;" data-locked="true"></div>
|
|
158
|
+
<div id="thoughts" style="display: none;" data-locked="true"></div>
|
|
159
|
+
</body>
|
|
124
160
|
```
|
|
125
161
|
|
|
126
|
-
###
|
|
162
|
+
### Runtime safety net
|
|
127
163
|
|
|
128
|
-
|
|
164
|
+
The server's `stripShellMarkup()` function removes shell elements at serve time even if they're still present in the HTML source. It also injects hidden stub elements (`chatForm`, `chatInput`, `chatMessages`, `loadingOverlay`) so legacy inline scripts that reference these IDs don't crash with null-reference errors.
|
|
129
165
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
166
|
+
In addition, `stripShellMarkup()` removes the v2-legacy `<script id="idle-animation">` block and injects no-op `window.hideIdleAnimation` / `window.showIdleAnimation` globals. The v2 block declares those functions as top-level statements, which the server's `wrapInlineScriptsInIIFE` transform traps inside an IIFE — leaving cross-script call sites (e.g. `hideIdleAnimation()` in `#qb-app`) hitting `ReferenceError` and aborting the rest of the page boot. The stubs keep those call sites no-op-safe without having to rewrite each migrated page.
|
|
167
|
+
|
|
168
|
+
However, source templates should be cleaned proactively — the runtime stripping is a fallback, not a substitute for clean templates.
|
|
169
|
+
|
|
170
|
+
### Automated cleanup
|
|
134
171
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
172
|
+
Run the cleanup script to strip shell markup from all page templates:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
node scripts/cleanup-shell-markup.mjs # modify files
|
|
176
|
+
node scripts/cleanup-shell-markup.mjs --dry-run # preview only
|
|
138
177
|
```
|
|
139
178
|
|
|
140
|
-
|
|
179
|
+
This script processes all `page.html` files under `default-pages/` and `.synthos/pages/`, removing the 5 element types listed above.
|
|
180
|
+
|
|
181
|
+
### Migration rules for the LLM
|
|
141
182
|
|
|
142
|
-
When
|
|
183
|
+
When creating or migrating pages:
|
|
143
184
|
|
|
144
|
-
1. **
|
|
145
|
-
2. **
|
|
146
|
-
3. **
|
|
185
|
+
1. **Do NOT include** shell toolbar, chat panel, loading overlay, or page-helpers/page-script tags in page HTML
|
|
186
|
+
2. **Do NOT include** chatForm submit handlers or chatInput event listeners — the shell handles all chat interaction
|
|
187
|
+
3. **The `<body>` should start with** the `.viewer-panel` div containing only page content
|
|
188
|
+
4. **Keep** `#instructions` and `#thoughts` divs (used for LLM context, not shell chrome)
|
|
189
|
+
5. **Keep** page-specific inline scripts and styles — only remove shell-related code
|
|
190
|
+
6. **If a page script references** `chatInput` or `chatForm` (e.g., tutorial link handlers), the runtime stubs prevent crashes, but ideally migrate these to use `window.__synthOSNavigateTo()` or `parent.postMessage()` via the page bridge
|
|
147
191
|
|
|
148
192
|
---
|
|
149
193
|
|
|
@@ -151,11 +195,11 @@ When migrating a v2 page's shell chrome to v3:
|
|
|
151
195
|
|
|
152
196
|
### Overview
|
|
153
197
|
|
|
154
|
-
v2 pages
|
|
198
|
+
v2 pages reference legacy CSS tokens (`var(--bg-primary)`, `var(--accent-primary)`, `var(--text-primary)`, etc.) that v2 themes used to supply as hardcoded colors. In v3, themes only define FluentLM semantic tokens (`--bodyBackground`, `--themePrimary`, `--bodyText`, etc.). When migrating a v2 page, we inject a `<style id="v2-compat">` block that **aliases** each legacy v2 token onto the closest v3 semantic token — so the page inherits whatever v3 theme is active instead of being frozen on the old nebula-dusk palette.
|
|
155
199
|
|
|
156
200
|
### What the framework handles (NOT inlined)
|
|
157
201
|
|
|
158
|
-
The shell chrome CSS (chat panel, modals, toggle, brainstorm, attachments, etc.)
|
|
202
|
+
The shell chrome CSS (chat panel, modals, toggle, brainstorm, attachments, etc.) is provided by the parent shell frame's stylesheet plus FluentLM. Pages do NOT need to carry these rules:
|
|
159
203
|
|
|
160
204
|
- `.chat-panel`, `.chat-header`, `.chat-messages`, `.chat-message`, `.chat-message p`, `.chat-message p strong`, `.chat-message p code`
|
|
161
205
|
- `.link-group`, `.link-group a`
|
|
@@ -170,124 +214,140 @@ The shell chrome CSS (chat panel, modals, toggle, brainstorm, attachments, etc.)
|
|
|
170
214
|
- `.attach-btn`, `.attach-menu`, `.attach-menu-item`, `.attachment-pill*`
|
|
171
215
|
- `.screenshot-overlay`, `.screenshot-rect`
|
|
172
216
|
|
|
173
|
-
|
|
217
|
+
The shell also injects the iframe viewport height chain (`html,body,.viewer-panel{height:100%;margin:0}`), so the compat block does NOT carry global resets or layout rules.
|
|
218
|
+
|
|
219
|
+
### The v2 → v3 token mapping
|
|
220
|
+
|
|
221
|
+
Each v2 token is aliased to a v3 **semantic** token (not a palette token). Semantic tokens are already defined per-theme and resolve correctly under light, dark, and high-contrast themes, so the mapping is theme-agnostic.
|
|
222
|
+
|
|
223
|
+
#### Color tokens
|
|
224
|
+
|
|
225
|
+
Backgrounds must alias to **semantic** role tokens (`--bodyBackground`, `--bodyStandoutBackground`, `--bodyBackgroundHovered`), not palette tokens (`--neutralPrimaryAlt`, `--neutralDark`, etc.). Palette tokens encode a FIXED color value and stay dark even under light themes — so a v2 page that used `--bg-secondary` / `--bg-tertiary` for component backgrounds renders as hard-coded black blobs under nebula-dawn, aurora-dawn, high-contrast-light, etc. if aliased to palette. Semantic tokens flip correctly across light/dark variants.
|
|
226
|
+
|
|
227
|
+
| v2 token | → v3 binding | Fallback | Role |
|
|
228
|
+
|---|---|---|---|
|
|
229
|
+
| `--bg-primary` | `var(--bodyBackground, #ffffff)` | `#ffffff` | Main surface background (white in dawn, dark in dusk) |
|
|
230
|
+
| `--bg-secondary` | `var(--defaultStateBackground, #faf9f8)` | `#faf9f8` | Component surface (near-white in dawn, darker in dusk) |
|
|
231
|
+
| `--bg-tertiary` | `var(--bodyBackgroundHovered, #f3f2f1)` | `#f3f2f1` | Third distinct surface (light gray in dawn, mid-dark in dusk) |
|
|
232
|
+
| `--accent-primary` | `var(--themePrimary, #0078d4)` | `#0078d4` | Active theme's primary brand color |
|
|
233
|
+
| `--accent-secondary` | `var(--themeDarkAlt, #106ebe)` | `#106ebe` | Darker brand variant |
|
|
234
|
+
| `--accent-tertiary` | `var(--themeSecondary, #2b88d8)` | `#2b88d8` | Lighter brand variant |
|
|
235
|
+
| `--accent-glow` | `rgba(0,0,0,0.3)` | — | Subtle shadow; theme-neutral |
|
|
236
|
+
| `--text-primary` | `var(--bodyText, #333333)` | `#333333` | Primary text color |
|
|
237
|
+
| `--text-secondary` | `var(--bodySubtext, #605e5c)` | `#605e5c` | Secondary / subtitle text |
|
|
238
|
+
| `--border-color` | `var(--bodyDivider, #edebe9)` | `#edebe9` | Borders, dividers, outlines |
|
|
174
239
|
|
|
175
|
-
|
|
240
|
+
**Why `--defaultStateBackground` for `--bg-secondary`:** That's the v3 token v3-authored pages use for component surfaces (cards, panels, tiles). It's defined in every shipped theme (dawn: `--neutralLighterAlt`, dusk: `--neutralDark`) and flips correctly. `--bodyStandoutBackground` resolves to the same values but `--defaultStateBackground` is the role-correct semantic choice.
|
|
176
241
|
|
|
177
|
-
|
|
178
|
-
2. **Viewer panel** styles — layout, background, decorative pseudo-element
|
|
179
|
-
3. **Global resets** — `*` box-sizing, `body` font/color/layout
|
|
180
|
-
4. **Scrollbar theming** — custom scrollbar appearance
|
|
242
|
+
**Why hex fallbacks:** If any v3 token doesn't resolve (theme CSS fails to load, token spelling mismatch, browser quirks in iframe context), the outer `var()` falls back to the hex. Without the fallback the whole declaration becomes `initial` and the property reverts to its CSS default (transparent for background, `canvasText` for color) — which can surface as black component backgrounds under some OS/browser combos. The light-mode fallbacks are safe under dusk because the outer `--bodyBackground` etc. DO resolve (to dark values) and the fallback never fires.
|
|
181
243
|
|
|
182
|
-
####
|
|
244
|
+
#### Layout constants (kept as literals)
|
|
245
|
+
|
|
246
|
+
These values are layout geometry, not theme color — they stay fixed across themes:
|
|
247
|
+
|
|
248
|
+
| v2 token | Value |
|
|
249
|
+
|---|---|
|
|
250
|
+
| `--header-min-height` | `58px` |
|
|
251
|
+
| `--header-padding-vertical` | `14px` |
|
|
252
|
+
| `--header-padding-horizontal` | `20px` |
|
|
253
|
+
| `--header-line-height` | `1.25` |
|
|
254
|
+
|
|
255
|
+
#### The full compat block
|
|
183
256
|
|
|
184
257
|
```html
|
|
185
258
|
<style id="v2-compat">
|
|
186
|
-
/* --- v2
|
|
259
|
+
/* --- v2 → v3 token aliases ---
|
|
260
|
+
Each legacy v2 var resolves to a v3 SEMANTIC token (role-based) so the page
|
|
261
|
+
re-themes automatically between light and dark variants. Do NOT use palette
|
|
262
|
+
tokens (--neutralDark, --neutralPrimaryAlt, etc.) here — those encode a
|
|
263
|
+
FIXED color value and stay dark under light themes, producing hard-coded
|
|
264
|
+
black backgrounds on v2 pages.
|
|
265
|
+
|
|
266
|
+
Component-surface tokens use --defaultStateBackground / --defaultHoverBackground
|
|
267
|
+
(the v3 tokens v3 pages use for card/panel surfaces) instead of the
|
|
268
|
+
body*Background tokens. Every alias has a hex fallback so the compat block
|
|
269
|
+
still produces sensible light defaults even if the theme CSS fails to load
|
|
270
|
+
or a token isn't defined (otherwise the chain resolves to `initial` and
|
|
271
|
+
backgrounds go transparent). Header geometry stays literal because it's
|
|
272
|
+
layout, not color. */
|
|
187
273
|
:root {
|
|
188
|
-
--bg-primary: #
|
|
189
|
-
--bg-secondary: #
|
|
190
|
-
--bg-tertiary: #
|
|
191
|
-
|
|
192
|
-
--accent-
|
|
193
|
-
--accent-
|
|
194
|
-
--accent-
|
|
195
|
-
--
|
|
196
|
-
|
|
197
|
-
--
|
|
274
|
+
--bg-primary: var(--bodyBackground, #ffffff);
|
|
275
|
+
--bg-secondary: var(--defaultStateBackground, #faf9f8);
|
|
276
|
+
--bg-tertiary: var(--bodyBackgroundHovered, #f3f2f1);
|
|
277
|
+
|
|
278
|
+
--accent-primary: var(--themePrimary, #0078d4);
|
|
279
|
+
--accent-secondary: var(--themeDarkAlt, #106ebe);
|
|
280
|
+
--accent-tertiary: var(--themeSecondary, #2b88d8);
|
|
281
|
+
--accent-glow: rgba(0,0,0,0.3);
|
|
282
|
+
|
|
283
|
+
--text-primary: var(--bodyText, #333333);
|
|
284
|
+
--text-secondary: var(--bodySubtext, #605e5c);
|
|
285
|
+
|
|
286
|
+
--border-color: var(--bodyDivider, #edebe9);
|
|
287
|
+
|
|
198
288
|
--header-min-height: 58px;
|
|
199
289
|
--header-padding-vertical: 14px;
|
|
200
290
|
--header-padding-horizontal: 20px;
|
|
201
291
|
--header-line-height: 1.25;
|
|
202
292
|
}
|
|
293
|
+
</style>
|
|
294
|
+
```
|
|
203
295
|
|
|
204
|
-
|
|
205
|
-
* {
|
|
206
|
-
margin: 0;
|
|
207
|
-
padding: 0;
|
|
208
|
-
box-sizing: border-box;
|
|
209
|
-
}
|
|
296
|
+
### Legacy color mapping (hardcoded RGB / hex → theme tokens)
|
|
210
297
|
|
|
211
|
-
|
|
212
|
-
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
213
|
-
background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
|
|
214
|
-
color: var(--text-primary);
|
|
215
|
-
height: 100vh;
|
|
216
|
-
display: flex;
|
|
217
|
-
}
|
|
298
|
+
v2 pages were hand-matched to the v2 nebula-dusk palette and are full of literal `rgba(102,126,234,0.15)`, `#dc3545`, etc. Under a v3 light theme those colors stand out as dark purple-blue/red blobs because they never existed as variables — they were baked directly into the CSS. The migration therefore also rewrites these specific numeric triples (and their hex equivalents) in the full HTML output (covers `<style>` blocks, inline `style=""` attrs, and color strings inside JS template literals).
|
|
218
299
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
300
|
+
| v2 hardcoded color | Source in v2 | → v3 binding |
|
|
301
|
+
|---|---|---|
|
|
302
|
+
| `rgba(102,126,234,*)` / `#667eea` | `--accent-primary` (purple-blue) | `var(--themePrimary)` |
|
|
303
|
+
| `rgba(118,75,162,*)` / `#764ba2` | `--accent-secondary` | `var(--themeDarkAlt)` |
|
|
304
|
+
| `rgba(138,43,226,*)` / `#8a2be2` | `--accent-glow` (blueviolet) | `var(--themeDarker)` |
|
|
305
|
+
| `rgba(75,0,130,*)` / `#4b0082` | indigo inset-shadow | `var(--themeDarker)` |
|
|
306
|
+
| `rgba(240,147,251,*)` / `#f093fb` | magenta accent | `var(--themeSecondary)` |
|
|
307
|
+
| `rgba(183,148,246,*)` / `#b794f6` | light purple | `var(--themeTertiary)` |
|
|
308
|
+
| `rgba(26,26,46,*)` / `#1a1a2e` | `--bg-primary` | `var(--bodyBackground)` |
|
|
309
|
+
| `rgba(22,33,62,*)` / `#16213e` | `--bg-secondary` | `var(--bodyStandoutBackground)` |
|
|
310
|
+
| `rgba(15,15,35,*)` / `#0f0f23` | `--bg-tertiary` | `var(--bodyBackgroundHovered)` |
|
|
311
|
+
| `rgba(220,53,69,*)` / `#dc3545` | Bootstrap danger red | `var(--red)` |
|
|
312
|
+
| `rgba(40,167,69,*)` / `#28a745` | Bootstrap success green | `var(--green)` |
|
|
313
|
+
| `rgba(255,193,7,*)` / `#ffc107` | Bootstrap warning yellow | `var(--yellow)` |
|
|
314
|
+
| `rgba(0,0,0,*)` | Black shadows | *(unchanged — theme-neutral)* |
|
|
233
315
|
|
|
234
|
-
|
|
235
|
-
content: '';
|
|
236
|
-
position: absolute;
|
|
237
|
-
top: -50%;
|
|
238
|
-
left: -50%;
|
|
239
|
-
width: 200%;
|
|
240
|
-
height: 200%;
|
|
241
|
-
background: radial-gradient(ellipse at center, rgba(138,43,226,0.05) 0%, transparent 70%);
|
|
242
|
-
animation: nebula-pulse 8s ease-in-out infinite;
|
|
243
|
-
pointer-events: none;
|
|
244
|
-
}
|
|
316
|
+
**How alpha is preserved:** `rgba(R,G,B,A)` is rewritten to `color-mix(in srgb, var(--token) A*100%, transparent)`, which is widely supported in modern browsers (since 2023). Solid `rgb(R,G,B)` / `rgba(R,G,B,1)` / bare hex collapse to `var(--token)` directly.
|
|
245
317
|
|
|
246
|
-
|
|
247
|
-
0%,100% { opacity: 0.5; transform: scale(1); }
|
|
248
|
-
50% { opacity: 1; transform: scale(1.1); }
|
|
249
|
-
}
|
|
318
|
+
**Hex boundary safety:** hex replacements are guarded by `(?<![0-9a-fA-F])` / `(?![0-9a-fA-F])` lookarounds, so `#667eea` inside an 8-digit `#667eeaff` is not split.
|
|
250
319
|
|
|
251
|
-
.
|
|
252
|
-
padding: 0;
|
|
253
|
-
}
|
|
320
|
+
**Result:** the same migrated page now renders with the active theme's primary color where there used to be baked purple-blue, and with the shared red/green/yellow tokens for danger/success/warning instead of Bootstrap's literals. Switching between nebula-dawn, aurora-dusk, high-contrast-light, etc. re-themes the page automatically.
|
|
254
321
|
|
|
255
|
-
|
|
256
|
-
::-webkit-scrollbar { width: 10px; height: 10px; }
|
|
257
|
-
::-webkit-scrollbar-track { background: rgba(15,15,35,0.6); border-radius: 10px; }
|
|
258
|
-
::-webkit-scrollbar-thumb {
|
|
259
|
-
background: linear-gradient(180deg, var(--accent-primary) 0%, var(--accent-secondary) 50%, var(--accent-tertiary) 100%);
|
|
260
|
-
border-radius: 10px;
|
|
261
|
-
border: 2px solid rgba(15,15,35,0.6);
|
|
262
|
-
box-shadow: 0 0 10px var(--accent-glow);
|
|
263
|
-
}
|
|
264
|
-
::-webkit-scrollbar-thumb:hover {
|
|
265
|
-
background: linear-gradient(180deg, var(--accent-tertiary) 0%, var(--accent-secondary) 50%, var(--accent-primary) 100%);
|
|
266
|
-
box-shadow: 0 0 15px rgba(240,147,251,0.5);
|
|
267
|
-
}
|
|
268
|
-
::-webkit-scrollbar-corner { background: rgba(15,15,35,0.6); }
|
|
269
|
-
* { scrollbar-width: thin; scrollbar-color: var(--accent-secondary) rgba(15,15,35,0.6); }
|
|
270
|
-
</style>
|
|
271
|
-
```
|
|
322
|
+
### Migration rules (runtime)
|
|
272
323
|
|
|
273
|
-
|
|
324
|
+
The v2→v3 migration is applied automatically by `migrateV2toV3` in `src/migrations.ts`. It:
|
|
274
325
|
|
|
275
|
-
|
|
326
|
+
1. **Injects the `<style id="v2-compat">` block** into `<head>` as the first child. Idempotent — skipped if a block with `id="v2-compat"` is already present. Runs AFTER `postProcessV2` (which strips `:root` rules from style blocks), not before — otherwise the block's aliases get shredded silently.
|
|
276
327
|
|
|
277
|
-
|
|
328
|
+
2. **Remaps hardcoded v2-palette RGB/hex colors** throughout the HTML per the table above. Runs LAST so the compat block (which uses a theme-neutral `rgba(0,0,0,0.3)` for `--accent-glow`) is in the output but untouched by the remap (the rule table intentionally excludes `0,0,0`).
|
|
278
329
|
|
|
279
|
-
|
|
330
|
+
3. **Does NOT modify** existing page structure, classes, or non-color inline styles inside `.viewer-panel`. The page's own CSS keeps working — its `var(--bg-primary)` / `var(--accent-primary)` / etc. now resolve through the aliases to whatever the active v3 theme provides, and literal colors get remapped to shared tokens.
|
|
280
331
|
|
|
281
|
-
|
|
332
|
+
4. **Does NOT convert** v2 class names to FluentLM `flm-*` classes. That's a separate opt-in redesign (see §4), not part of version migration.
|
|
282
333
|
|
|
283
|
-
|
|
334
|
+
5. **Does NOT remove** any existing `<style>` blocks the page already has. The compat block supplements them, it doesn't replace.
|
|
284
335
|
|
|
285
|
-
###
|
|
336
|
+
### What migrated pages look like under different v3 themes
|
|
286
337
|
|
|
287
|
-
|
|
338
|
+
Because the compat block aliases to semantic tokens AND the legacy color remap routes literals through shared tokens, the same migrated page renders differently under each theme:
|
|
288
339
|
|
|
289
|
-
-
|
|
290
|
-
-
|
|
340
|
+
- **nebula-dusk** — purple primary, dark neutrals
|
|
341
|
+
- **nebula-dawn** — purple primary, light neutrals *(previously looked broken — now themes correctly)*
|
|
342
|
+
- **aurora-dawn** — aurora accent, light neutrals
|
|
343
|
+
- **cosmos-dusk** — cosmos primary, dark neutrals
|
|
344
|
+
- **high-contrast-light / dark** — high-contrast palette
|
|
345
|
+
|
|
346
|
+
### Known limitations
|
|
347
|
+
|
|
348
|
+
- **Non-palette hex colors** (e.g. `#fafafa`, `#cccccc`, or any hex not in the rule table) are left as-is. If a page uses an unusual color, add it to the rule table in `src/migrations.ts`.
|
|
349
|
+
- **Color-named literals** (`purple`, `red`, `black`) are not remapped. These are rare in v2 pages but, if present, would need a separate named-color rule.
|
|
350
|
+
- **Gradients** that combine remapped colors work correctly (each stop is rewritten independently), but the aesthetic may shift — a `linear-gradient(purple → indigo)` that was two v2 accent colors now becomes a gradient between `themePrimary` and `themeDarker`, which reads correctly under any theme but may not match the original nebula-dusk glow exactly.
|
|
291
351
|
|
|
292
352
|
---
|
|
293
353
|
|
|
@@ -479,3 +539,101 @@ Games that use `<canvas>` typically size to the viewer panel via JavaScript (`vi
|
|
|
479
539
|
- Custom fonts (e.g. Google Fonts `<link>` tags) — keep as-is
|
|
480
540
|
- CDN library imports (e.g. html2canvas) — keep as-is
|
|
481
541
|
- Inline `style=` attributes on game elements (e.g. `style="display: none;"` on overlays) — preserve exactly
|
|
542
|
+
|
|
543
|
+
---
|
|
544
|
+
|
|
545
|
+
## 7. Chat History Migration (iframe Viewer Panel)
|
|
546
|
+
|
|
547
|
+
### Overview
|
|
548
|
+
|
|
549
|
+
In the iframe viewer panel architecture, chat history is stored as a separate JSON file (`chat-history.json`) alongside each page, instead of being embedded as `<div class="chat-message">` elements inside the page HTML. This decouples chat state from page content and enables the shell/content iframe split.
|
|
550
|
+
|
|
551
|
+
### What changed
|
|
552
|
+
|
|
553
|
+
| Before | After |
|
|
554
|
+
|--------|-------|
|
|
555
|
+
| Chat messages embedded in `#chatMessages` div inside page HTML | Chat messages stored in `<pagesFolder>/pages/<name>/chat-history.json` |
|
|
556
|
+
| Server extracts history by scraping `.chat-message` elements with cheerio | Server reads `chat-history.json` directly |
|
|
557
|
+
| `appendChatReply()` / `appendChatError()` inject HTML into page | Shell.js displays messages in the parent frame |
|
|
558
|
+
| `newBuild` detected by counting `.chat-message` elements | `newBuild` detected by `history.length === 0` |
|
|
559
|
+
|
|
560
|
+
### File format
|
|
561
|
+
|
|
562
|
+
`chat-history.json` is a JSON array of `ChatMessage` objects:
|
|
563
|
+
|
|
564
|
+
```json
|
|
565
|
+
[
|
|
566
|
+
{ "role": "user", "content": "Make the header blue" },
|
|
567
|
+
{ "role": "assistant", "content": "I've updated the header background to blue." }
|
|
568
|
+
]
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
An empty array `[]` means no chat history (new or freshly saved page).
|
|
572
|
+
|
|
573
|
+
### Migration steps for existing pages
|
|
574
|
+
|
|
575
|
+
1. **Check for embedded chat messages** — look for `#chatMessages .chat-message` elements in `page.html`
|
|
576
|
+
|
|
577
|
+
2. **Extract messages** — for each `.chat-message` div:
|
|
578
|
+
- Parse the role from `<strong>User:</strong>` or `<strong>SynthOS:</strong>` prefix
|
|
579
|
+
- Strip HTML tags to get plain text content
|
|
580
|
+
- Map to `{ role: 'user' | 'assistant', content: string }`
|
|
581
|
+
|
|
582
|
+
3. **Write `chat-history.json`** — save the extracted array to `<pageFolder>/chat-history.json`
|
|
583
|
+
- If no chat messages are found, write `[]`
|
|
584
|
+
- If the page only has the default welcome message (`Welcome! How can I help you?`), write `[]` (the welcome is handled by shell.js)
|
|
585
|
+
|
|
586
|
+
4. **Strip chat markup from page HTML** (optional) — remove `#chatMessages` content and `.chat-panel` div from the page HTML. The iframe viewer panel strips shell markup automatically via `stripShellMarkup()`, so this step is cosmetic cleanup.
|
|
587
|
+
|
|
588
|
+
### Legacy fallback
|
|
589
|
+
|
|
590
|
+
The GET handler in `usePageRoutes.ts` has a legacy fallback: if `chat-history.json` doesn't exist, it extracts messages from the page HTML using `extractChatMessages()`. This ensures pre-migration pages still work. Once all pages are migrated, this fallback can be removed.
|
|
591
|
+
|
|
592
|
+
### What to create for new pages
|
|
593
|
+
|
|
594
|
+
New pages (both default templates and user-created) should ship with an empty `chat-history.json`:
|
|
595
|
+
|
|
596
|
+
```json
|
|
597
|
+
[]
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
This prevents the legacy fallback from running and establishes the page as using the new format from the start.
|
|
601
|
+
|
|
602
|
+
### Pages that don't need migration
|
|
603
|
+
|
|
604
|
+
- **Required pages** (`required-pages/`) — system pages like `builder`, `settings`, `pages` are loaded fresh each time and don't accumulate chat history
|
|
605
|
+
- **Pages with no chat markup** — if the page HTML has no `#chatMessages` div or no `.chat-message` elements, just create an empty `chat-history.json`
|
|
606
|
+
- **Pages already migrated** — if `chat-history.json` already exists, skip
|
|
607
|
+
|
|
608
|
+
### Lifecycle
|
|
609
|
+
|
|
610
|
+
| Event | Chat history behavior |
|
|
611
|
+
|-------|----------------------|
|
|
612
|
+
| **New page created** | `chat-history.json` created with `[]` |
|
|
613
|
+
| **User sends message** | User + assistant messages appended to array |
|
|
614
|
+
| **Page saved** | `chat-history.json` cleared (reset to `[]`) |
|
|
615
|
+
| **Page undo** | Last user + assistant pair popped from array |
|
|
616
|
+
| **Page copied** | `chat-history.json` is NOT copied (new page starts fresh) |
|
|
617
|
+
| **Page deleted** | `chat-history.json` deleted with the page folder |
|
|
618
|
+
|
|
619
|
+
---
|
|
620
|
+
|
|
621
|
+
## 8. Migration Greeting
|
|
622
|
+
|
|
623
|
+
### Overview
|
|
624
|
+
|
|
625
|
+
Pages upgraded by `POST /api/pages/:name/upgrade` (the UI "migrate to v3" action) get an auto-assigned `greeting` on `page.json` so the shell's first assistant message after migration tells the user what happened and invites them to report breakage.
|
|
626
|
+
|
|
627
|
+
### Behavior
|
|
628
|
+
|
|
629
|
+
- Any migration from `pageVersion < 3` to the current `PAGE_VERSION` assigns a generic greeting onto the page metadata **only if** the page does not already carry a user-authored greeting (`metadata.greeting` is empty/whitespace).
|
|
630
|
+
- The greeting is stored on `page.json` as the `greeting` field. The shell renders it as the first assistant message via `injectShellInit` (see `src/service/usePageRoutes.ts`).
|
|
631
|
+
- The actual greeting text lives in `MIGRATED_PAGE_GREETING` in `src/service/useApiRoutes.ts`. Keep updates colocated there — the migration-rules doc does not repeat the copy.
|
|
632
|
+
|
|
633
|
+
### Why not inline it into the HTML?
|
|
634
|
+
|
|
635
|
+
The v3 chat-history architecture (§7) keeps greeting text out of page HTML entirely — it lives on `page.json` and is rendered by the shell, not embedded as a `<div class="chat-message">` in the page body. Adding it to HTML during migration would immediately be stripped by `stripShellMarkup()` at serve time.
|
|
636
|
+
|
|
637
|
+
### Overriding the greeting later
|
|
638
|
+
|
|
639
|
+
Users can change the greeting through the page definition editor. Whatever they save into `metadata.greeting` replaces the auto-assigned text permanently.
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "synthos",
|
|
3
3
|
"author": "Steven Ickman",
|
|
4
4
|
"description": "The Hyper-Personalized App Builder That Turns Everyone into a Programmer.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.11.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"synthos",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@a2a-js/sdk": "^0.3.10",
|
|
23
23
|
"@anthropic-ai/sdk": "^0.75.0",
|
|
24
|
+
"acorn": "^8.16.0",
|
|
24
25
|
"adm-zip": "^0.5.16",
|
|
25
26
|
"cheerio": "^1.2.0",
|
|
26
27
|
"express": "^4.19.2",
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
"typescript": "^4.2.3"
|
|
46
47
|
},
|
|
47
48
|
"scripts": {
|
|
49
|
+
"prebuild": "rimraf dist tsconfig.tsbuildinfo",
|
|
48
50
|
"build": "tsc -b",
|
|
49
51
|
"clean": "rimraf dist tsconfig.tsbuildinfo node_modules",
|
|
50
52
|
"start": "node ./bin/synthos.js start",
|
|
@@ -60,8 +62,10 @@
|
|
|
60
62
|
"default-themes",
|
|
61
63
|
"static-files",
|
|
62
64
|
"required-pages",
|
|
65
|
+
"starters",
|
|
63
66
|
"service-connectors",
|
|
64
67
|
"migration-rules",
|
|
68
|
+
"scripts",
|
|
65
69
|
"tests"
|
|
66
70
|
]
|
|
67
71
|
}
|