synthos 0.10.1 → 0.11.1

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.
Files changed (311) hide show
  1. package/README.md +5 -5
  2. package/default-pages/elevenlabs_effects_studio/chat-history.json +1 -0
  3. package/default-pages/elevenlabs_effects_studio/page.html +1345 -1363
  4. package/default-pages/elevenlabs_effects_studio/page.json +13 -11
  5. package/default-pages/elevenlabs_voice_studio/chat-history.json +1 -0
  6. package/default-pages/elevenlabs_voice_studio/page.html +782 -801
  7. package/default-pages/elevenlabs_voice_studio/page.json +13 -11
  8. package/default-pages/json_tools/chat-history.json +1 -0
  9. package/default-pages/json_tools/page.html +70 -90
  10. package/default-pages/json_tools/page.json +12 -10
  11. package/default-pages/my_notes/chat-history.json +1 -0
  12. package/default-pages/my_notes/page.html +115 -131
  13. package/default-pages/my_notes/page.json +14 -12
  14. package/default-pages/neon_asteroids/chat-history.json +1 -0
  15. package/default-pages/neon_asteroids/page.html +1777 -1803
  16. package/default-pages/neon_asteroids/page.json +14 -12
  17. package/default-pages/oregon_trail/chat-history.json +1 -0
  18. package/default-pages/oregon_trail/page.html +290 -307
  19. package/default-pages/oregon_trail/page.json +14 -12
  20. package/default-pages/solar_explorer/chat-history.json +1 -0
  21. package/default-pages/solar_explorer/page.html +1929 -1951
  22. package/default-pages/solar_explorer/page.json +14 -12
  23. package/default-pages/solar_tutorial/chat-history.json +1 -0
  24. package/default-pages/solar_tutorial/page.html +464 -478
  25. package/default-pages/solar_tutorial/page.json +12 -10
  26. package/default-pages/us_map/chat-history.json +1 -0
  27. package/default-pages/us_map/page.html +170 -193
  28. package/default-pages/us_map/page.json +14 -12
  29. package/default-pages/us_map/page.light.png +0 -0
  30. package/default-pages/us_map_1850/chat-history.json +1 -0
  31. package/default-pages/us_map_1850/page.html +302 -326
  32. package/default-pages/us_map_1850/page.json +14 -12
  33. package/default-pages/western_cities_1850/chat-history.json +1 -0
  34. package/default-pages/western_cities_1850/page.html +503 -527
  35. package/default-pages/western_cities_1850/page.json +14 -12
  36. package/default-themes/aurora-dawn.v3.css +15 -14
  37. package/default-themes/aurora-dusk.v3.css +26 -26
  38. package/default-themes/cosmos-dawn.v3.css +15 -14
  39. package/default-themes/cosmos-dusk.v3.css +26 -26
  40. package/default-themes/elemental-dawn.v3.css +200 -0
  41. package/default-themes/nebula-dawn.v3.css +15 -14
  42. package/default-themes/nebula-dusk.v3.css +24 -24
  43. package/default-themes/solar-flare-dawn.v3.css +15 -14
  44. package/default-themes/solar-flare-dusk.v3.css +26 -26
  45. package/dist/builders/anthropic.d.ts +26 -2
  46. package/dist/builders/anthropic.d.ts.map +1 -1
  47. package/dist/builders/anthropic.js +132 -31
  48. package/dist/builders/anthropic.js.map +1 -1
  49. package/dist/builders/claudecode.d.ts +13 -0
  50. package/dist/builders/claudecode.d.ts.map +1 -0
  51. package/dist/builders/claudecode.js +253 -0
  52. package/dist/builders/claudecode.js.map +1 -0
  53. package/dist/builders/index.d.ts +2 -1
  54. package/dist/builders/index.d.ts.map +1 -1
  55. package/dist/builders/index.js +8 -1
  56. package/dist/builders/index.js.map +1 -1
  57. package/dist/builders/openai.js +2 -1
  58. package/dist/builders/openai.js.map +1 -1
  59. package/dist/builders/types.d.ts +31 -7
  60. package/dist/builders/types.d.ts.map +1 -1
  61. package/dist/builders/types.js +60 -28
  62. package/dist/builders/types.js.map +1 -1
  63. package/dist/connectors/types.d.ts +8 -0
  64. package/dist/connectors/types.d.ts.map +1 -1
  65. package/dist/init.d.ts.map +1 -1
  66. package/dist/init.js +13 -6
  67. package/dist/init.js.map +1 -1
  68. package/dist/migrations.d.ts.map +1 -1
  69. package/dist/migrations.js +161 -14
  70. package/dist/migrations.js.map +1 -1
  71. package/dist/models/anthropic.d.ts +1 -0
  72. package/dist/models/anthropic.d.ts.map +1 -1
  73. package/dist/models/anthropic.js +129 -29
  74. package/dist/models/anthropic.js.map +1 -1
  75. package/dist/models/chainOfThought.d.ts.map +1 -1
  76. package/dist/models/chainOfThought.js +32 -19
  77. package/dist/models/chainOfThought.js.map +1 -1
  78. package/dist/models/index.d.ts +2 -2
  79. package/dist/models/index.d.ts.map +1 -1
  80. package/dist/models/index.js +2 -1
  81. package/dist/models/index.js.map +1 -1
  82. package/dist/models/providers.d.ts +1 -0
  83. package/dist/models/providers.d.ts.map +1 -1
  84. package/dist/models/providers.js +12 -4
  85. package/dist/models/providers.js.map +1 -1
  86. package/dist/models/types.d.ts +15 -1
  87. package/dist/models/types.d.ts.map +1 -1
  88. package/dist/models/types.js.map +1 -1
  89. package/dist/pages.d.ts +57 -8
  90. package/dist/pages.d.ts.map +1 -1
  91. package/dist/pages.js +258 -45
  92. package/dist/pages.js.map +1 -1
  93. package/dist/service/createCompletePrompt.d.ts.map +1 -1
  94. package/dist/service/createCompletePrompt.js +5 -0
  95. package/dist/service/createCompletePrompt.js.map +1 -1
  96. package/dist/service/mediaCache.d.ts +36 -0
  97. package/dist/service/mediaCache.d.ts.map +1 -0
  98. package/dist/service/mediaCache.js +182 -0
  99. package/dist/service/mediaCache.js.map +1 -0
  100. package/dist/service/pageValidator.d.ts +25 -0
  101. package/dist/service/pageValidator.d.ts.map +1 -0
  102. package/dist/service/pageValidator.js +315 -0
  103. package/dist/service/pageValidator.js.map +1 -0
  104. package/dist/service/server.d.ts.map +1 -1
  105. package/dist/service/server.js +4 -0
  106. package/dist/service/server.js.map +1 -1
  107. package/dist/service/sharedTableSchema.d.ts +73 -0
  108. package/dist/service/sharedTableSchema.d.ts.map +1 -0
  109. package/dist/service/sharedTableSchema.js +206 -0
  110. package/dist/service/sharedTableSchema.js.map +1 -0
  111. package/dist/service/transformPage.d.ts +49 -11
  112. package/dist/service/transformPage.d.ts.map +1 -1
  113. package/dist/service/transformPage.js +354 -241
  114. package/dist/service/transformPage.js.map +1 -1
  115. package/dist/service/useApiRoutes.d.ts.map +1 -1
  116. package/dist/service/useApiRoutes.js +285 -34
  117. package/dist/service/useApiRoutes.js.map +1 -1
  118. package/dist/service/useConnectorRoutes.d.ts.map +1 -1
  119. package/dist/service/useConnectorRoutes.js +170 -32
  120. package/dist/service/useConnectorRoutes.js.map +1 -1
  121. package/dist/service/useDataRoutes.d.ts.map +1 -1
  122. package/dist/service/useDataRoutes.js +59 -2
  123. package/dist/service/useDataRoutes.js.map +1 -1
  124. package/dist/service/useExtractRoutes.d.ts +4 -0
  125. package/dist/service/useExtractRoutes.d.ts.map +1 -0
  126. package/dist/service/useExtractRoutes.js +304 -0
  127. package/dist/service/useExtractRoutes.js.map +1 -0
  128. package/dist/service/usePageRoutes.d.ts +17 -0
  129. package/dist/service/usePageRoutes.d.ts.map +1 -1
  130. package/dist/service/usePageRoutes.js +1388 -483
  131. package/dist/service/usePageRoutes.js.map +1 -1
  132. package/dist/service/useSharedDataRoutes.d.ts.map +1 -1
  133. package/dist/service/useSharedDataRoutes.js +54 -2
  134. package/dist/service/useSharedDataRoutes.js.map +1 -1
  135. package/dist/settings.d.ts +27 -0
  136. package/dist/settings.d.ts.map +1 -1
  137. package/dist/settings.js +40 -1
  138. package/dist/settings.js.map +1 -1
  139. package/dist/themes.d.ts +0 -5
  140. package/dist/themes.d.ts.map +1 -1
  141. package/dist/themes.js +3 -95
  142. package/dist/themes.js.map +1 -1
  143. package/migration-rules/v2-to-v3.md +277 -119
  144. package/package.json +5 -1
  145. package/{default-pages/application → required-pages/_shell}/page.html +56 -42
  146. package/required-pages/_shell/page.json +14 -0
  147. package/required-pages/_starters/page.html +534 -0
  148. package/required-pages/_starters/page.json +12 -0
  149. package/required-pages/builder/page.html +353 -43
  150. package/required-pages/builder/page.json +12 -10
  151. package/required-pages/pages/page.html +697 -924
  152. package/required-pages/pages/page.json +12 -10
  153. package/required-pages/settings/page.html +1888 -1753
  154. package/required-pages/settings/page.json +12 -10
  155. package/required-pages/synthos_apis/page.html +834 -845
  156. package/required-pages/synthos_apis/page.json +12 -10
  157. package/required-pages/synthos_scripts/page.html +74 -88
  158. package/required-pages/synthos_scripts/page.json +12 -10
  159. package/scripts/append-instructions.py +90 -0
  160. package/scripts/audit-instructions.py +76 -0
  161. package/scripts/cleanup-shell-markup.mjs +112 -0
  162. package/service-connectors/buffer/connector.json +46 -0
  163. package/service-connectors/canva/connector.json +67 -0
  164. package/service-connectors/elevenlabs/connector.json +1 -1
  165. package/src/builders/anthropic.ts +150 -25
  166. package/src/builders/claudecode.ts +310 -0
  167. package/src/builders/index.ts +7 -1
  168. package/src/builders/openai.ts +2 -1
  169. package/src/builders/types.ts +93 -32
  170. package/src/connectors/types.ts +8 -0
  171. package/src/init.ts +13 -7
  172. package/src/migrations.ts +187 -16
  173. package/src/models/anthropic.ts +140 -30
  174. package/src/models/chainOfThought.ts +33 -18
  175. package/src/models/index.ts +2 -2
  176. package/src/models/providers.ts +10 -1
  177. package/src/models/types.ts +21 -1
  178. package/src/pages.ts +271 -35
  179. package/src/service/createCompletePrompt.ts +6 -0
  180. package/src/service/mediaCache.ts +206 -0
  181. package/src/service/pageValidator.ts +337 -0
  182. package/src/service/server.ts +4 -0
  183. package/src/service/sharedTableSchema.ts +236 -0
  184. package/src/service/transformPage.ts +370 -260
  185. package/src/service/useApiRoutes.ts +283 -32
  186. package/src/service/useConnectorRoutes.ts +189 -34
  187. package/src/service/useDataRoutes.ts +198 -116
  188. package/src/service/useExtractRoutes.ts +331 -0
  189. package/src/service/usePageRoutes.ts +1414 -394
  190. package/src/service/useSharedDataRoutes.ts +184 -109
  191. package/src/settings.ts +65 -0
  192. package/src/themes.ts +78 -180
  193. package/starters/blank_starter/chat-history.json +1 -0
  194. package/starters/blank_starter/page.dark.png +0 -0
  195. package/starters/blank_starter/page.html +47 -0
  196. package/starters/blank_starter/page.json +13 -0
  197. package/starters/blank_starter/page.light.png +0 -0
  198. package/starters/calculator_starter/chat-history.json +1 -0
  199. package/starters/calculator_starter/page.dark.png +0 -0
  200. package/starters/calculator_starter/page.html +232 -0
  201. package/starters/calculator_starter/page.json +13 -0
  202. package/starters/calculator_starter/page.light.png +0 -0
  203. package/starters/calendar_starter/chat-history.json +1 -0
  204. package/starters/calendar_starter/page.dark.png +0 -0
  205. package/starters/calendar_starter/page.html +495 -0
  206. package/starters/calendar_starter/page.json +13 -0
  207. package/starters/calendar_starter/page.light.png +0 -0
  208. package/starters/chat_starter/chat-history.json +1 -0
  209. package/starters/chat_starter/page.dark.png +0 -0
  210. package/starters/chat_starter/page.html +351 -0
  211. package/starters/chat_starter/page.json +13 -0
  212. package/starters/chat_starter/page.light.png +0 -0
  213. package/starters/checklist_starter/chat-history.json +1 -0
  214. package/starters/checklist_starter/page.dark.png +0 -0
  215. package/starters/checklist_starter/page.html +437 -0
  216. package/starters/checklist_starter/page.json +13 -0
  217. package/starters/checklist_starter/page.light.png +0 -0
  218. package/starters/dashboard_starter/chat-history.json +1 -0
  219. package/starters/dashboard_starter/page.dark.png +0 -0
  220. package/starters/dashboard_starter/page.html +195 -0
  221. package/starters/dashboard_starter/page.json +13 -0
  222. package/starters/dashboard_starter/page.light.png +0 -0
  223. package/starters/form_starter/chat-history.json +1 -0
  224. package/starters/form_starter/page.dark.png +0 -0
  225. package/starters/form_starter/page.html +313 -0
  226. package/starters/form_starter/page.json +13 -0
  227. package/starters/form_starter/page.light.png +0 -0
  228. package/starters/gallery_starter/chat-history.json +1 -0
  229. package/starters/gallery_starter/page.dark.png +0 -0
  230. package/starters/gallery_starter/page.html +418 -0
  231. package/starters/gallery_starter/page.json +13 -0
  232. package/starters/gallery_starter/page.light.png +0 -0
  233. package/starters/generator_starter/chat-history.json +1 -0
  234. package/starters/generator_starter/page.dark.png +0 -0
  235. package/starters/generator_starter/page.html +261 -0
  236. package/starters/generator_starter/page.json +13 -0
  237. package/starters/generator_starter/page.light.png +0 -0
  238. package/starters/index.html +538 -0
  239. package/starters/kanban_starter/chat-history.json +1 -0
  240. package/starters/kanban_starter/page.dark.png +0 -0
  241. package/starters/kanban_starter/page.html +432 -0
  242. package/starters/kanban_starter/page.json +13 -0
  243. package/starters/kanban_starter/page.light.png +0 -0
  244. package/starters/presentation_builder/chat-history.json +1 -0
  245. package/starters/presentation_builder/page.dark.png +0 -0
  246. package/starters/presentation_builder/page.html +970 -0
  247. package/starters/presentation_builder/page.json +15 -0
  248. package/starters/presentation_builder/page.light.png +0 -0
  249. package/starters/presentation_builder/presentation_voice/voice_config.json +9 -0
  250. package/starters/pulse_starter/chat-history.json +1 -0
  251. package/starters/pulse_starter/page.dark.png +0 -0
  252. package/starters/pulse_starter/page.html +698 -0
  253. package/starters/pulse_starter/page.json +13 -0
  254. package/starters/pulse_starter/page.light.png +0 -0
  255. package/starters/quiz_starter/chat-history.json +1 -0
  256. package/starters/quiz_starter/page.dark.png +0 -0
  257. package/starters/quiz_starter/page.html +292 -0
  258. package/starters/quiz_starter/page.json +13 -0
  259. package/starters/quiz_starter/page.light.png +0 -0
  260. package/starters/reference_starter/chat-history.json +1 -0
  261. package/starters/reference_starter/page.dark.png +0 -0
  262. package/starters/reference_starter/page.html +250 -0
  263. package/starters/reference_starter/page.json +13 -0
  264. package/starters/reference_starter/page.light.png +0 -0
  265. package/starters/retro_game_starter/chat-history.json +1 -0
  266. package/starters/retro_game_starter/page.dark.png +0 -0
  267. package/{default-pages → starters}/retro_game_starter/page.html +1281 -1308
  268. package/starters/retro_game_starter/page.json +15 -0
  269. package/starters/retro_game_starter/page.light.png +0 -0
  270. package/starters/roster_starter/chat-history.json +1 -0
  271. package/starters/roster_starter/page.dark.png +0 -0
  272. package/starters/roster_starter/page.html +600 -0
  273. package/starters/roster_starter/page.json +13 -0
  274. package/starters/roster_starter/page.light.png +0 -0
  275. package/starters/server.js +182 -0
  276. package/starters/start.cmd +1 -0
  277. package/starters/timeline_starter/chat-history.json +1 -0
  278. package/starters/timeline_starter/page.dark.png +0 -0
  279. package/starters/timeline_starter/page.html +446 -0
  280. package/starters/timeline_starter/page.json +13 -0
  281. package/starters/timeline_starter/page.light.png +0 -0
  282. package/starters/tutorial_starter/chat-history.json +1 -0
  283. package/starters/tutorial_starter/page.dark.png +0 -0
  284. package/starters/tutorial_starter/page.html +283 -0
  285. package/starters/tutorial_starter/page.json +13 -0
  286. package/starters/tutorial_starter/page.light.png +0 -0
  287. package/static-files/agent.v3.js +122 -0
  288. package/static-files/connector.v3.js +48 -0
  289. package/static-files/extract.v3.js +188 -0
  290. package/static-files/helpers.v3.js +50 -6
  291. package/static-files/page-bridge.js +114 -0
  292. package/static-files/page.v3.js +1292 -1290
  293. package/static-files/script.v3.js +32 -0
  294. package/static-files/server.v3.js +89 -0
  295. package/static-files/shell-bridge.v3.js +174 -0
  296. package/static-files/shell-modals.v3.js +521 -0
  297. package/static-files/{shell.css → shell.v3.css} +271 -22
  298. package/static-files/shell.v3.js +1865 -0
  299. package/static-files/storage.v3.js +176 -0
  300. package/tests/anthropic.spec.ts +42 -7
  301. package/tests/builders.spec.ts +70 -2
  302. package/tests/pageValidator.spec.ts +548 -0
  303. package/tests/profiles.spec.ts +122 -0
  304. package/tests/sharedTableSchema.spec.ts +242 -0
  305. package/tests/transformPage.spec.ts +62 -81
  306. package/default-pages/application/page.json +0 -10
  307. package/default-pages/retro_game_starter/page.json +0 -12
  308. package/default-pages/sidebar_page/page.html +0 -51
  309. package/default-pages/sidebar_page/page.json +0 -10
  310. package/default-pages/two-panel_page/page.html +0 -68
  311. package/default-pages/two-panel_page/page.json +0 -10
@@ -1 +1 @@
1
- {"version":3,"file":"themes.js","sourceRoot":"","sources":["../src/themes.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,mCAAsG;AAGzF,QAAA,aAAa,GAAG,CAAC,CAAC;AAO/B,SAAS,gBAAgB,CAAC,MAAqB;IAC3C,OAAO,cAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAAC,QAAgB;IAC/C,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IACjD,MAAM,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AM,CAAC,IAAI,YAAY,EAAE;QAC1B,MAAM,MAAM,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC;QACrC,IAAI,MAAM;YAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;KACtC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AACpC,CAAC;AARD,gCAQC"}
@@ -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 Changes
103
+ ## 2. Shell Chrome Removal (iframe Viewer Panel)
104
104
 
105
- ### Chat input
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
- v2 used a single-line `<input>` with a separate submit button:
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
- <!-- v2 -->
111
- <form action="/" method="POST" id="chatForm" data-locked="true">
112
- <input type="text" class="chat-input" id="chatInput" name="message" placeholder="Type a message..." data-locked="true">
113
- <button type="submit" class="chat-submit" data-locked="true">Send</button>
114
- </form>
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
- v3 replaces this with a multi-line `<textarea>`. The Send button is removed — submission is handled by the v3 page script (Enter to send, Shift+Enter for newline):
150
+ ### After (iframe-ready)
118
151
 
119
152
  ```html
120
- <!-- v3 -->
121
- <form action="/" method="POST" id="chatForm" data-locked="true">
122
- <textarea class="chat-input" id="chatInput" name="message" rows="2" placeholder="Type a message..." data-locked="true"></textarea>
123
- </form>
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
- ### Static script versions
162
+ ### Runtime safety net
127
163
 
128
- v3 pages reference the v3 static files. Update both script tags at the bottom of every page:
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
- ```html
131
- <!-- v2 -->
132
- <script id="page-helpers" src="/api/page-helpers.js?v=2" data-locked="true"></script>
133
- <script id="page-script" src="/api/page-script.js?v=2" data-locked="true"></script>
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
- <!-- v3 -->
136
- <script id="page-helpers" src="/api/page-helpers.js?v=3" data-locked="true"></script>
137
- <script id="page-script" src="/api/page-script.js?v=3" data-locked="true"></script>
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
- ### Migration rules for the LLM (shell chrome)
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 migrating a v2 page's shell chrome to v3:
183
+ When creating or migrating pages:
143
184
 
144
- 1. **Replace the chat input** swap the `<input type="text">` + `<button>Send</button>` pair with a single `<textarea rows="2">` as shown above.
145
- 2. **Update script versions** change `?v=2` to `?v=3` on both `page-helpers.js` and `page-script.js`.
146
- 3. **Do NOT touch** page-specific `<input>` elements inside `.viewer-panel` the chat input change only applies to the shell's `#chatForm`.
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 rely on the v2 theme CSS for **all** styling shell chrome, viewer layout, and page content. In v3, the theme CSS only provides FluentLM palette tokens. When migrating a v2 page to run under a v3 theme, we must **inline** the v2 styles that the page content depends on so it keeps its look.
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.) will be provided by a framework-level shell stylesheet. Pages do NOT need to carry these rules:
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
- ### What must be inlined into each migrated page
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
- The following `<style>` block should be injected into the `<head>` of every migrated v2 page. It provides:
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
- 1. **v2 CSS custom properties** so `var(--bg-primary)` etc. still resolve
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
- #### Inline style block (nebula-dusk)
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 CSS Custom Properties (nebula-dusk) --- */
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: #1a1a2e;
189
- --bg-secondary: #16213e;
190
- --bg-tertiary: #0f0f23;
191
- --accent-primary: #667eea;
192
- --accent-secondary: #764ba2;
193
- --accent-tertiary: #f093fb;
194
- --accent-glow: rgba(138,43,226,0.3);
195
- --text-primary: #e0e0e0;
196
- --text-secondary: #b794f6;
197
- --border-color: rgba(138,43,226,0.3);
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
- /* --- Global Reset --- */
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
- body {
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
- /* --- Viewer Panel --- */
220
- .viewer-panel {
221
- flex: 1;
222
- min-width: 0;
223
- padding: 20px 20px 20px 44px;
224
- background: linear-gradient(135deg, rgba(22,33,62,0.9) 0%, rgba(15,15,35,0.95) 100%);
225
- display: flex;
226
- flex-direction: column;
227
- justify-content: center;
228
- align-items: center;
229
- box-shadow: inset 0 0 60px rgba(75,0,130,0.15);
230
- position: relative;
231
- overflow: hidden;
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
- .viewer-panel::before {
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
- @keyframes nebula-pulse {
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
- .viewer-panel.full-viewer {
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
- /* --- Scrollbar --- */
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
- ### Migration rules for the LLM
324
+ The v2→v3 migration is applied automatically by `migrateV2toV3` in `src/migrations.ts`. It:
274
325
 
275
- When migrating a v2 page to v3:
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
- 1. **Inject the `<style id="v2-compat">` block** into `<head>` as the first child (before any other styles or scripts). This preserves the v2 look while running under a v3 theme.
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
- 2. **Do NOT modify** existing page content, classes, or inline styles inside `.viewer-panel`. The v2-compat block ensures all `var()` references continue to resolve.
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
- 3. **Do NOT convert** v2 class names to FluentLM `flm-*` classes. That's a separate opt-in redesign, not part of version migration.
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
- 4. **Do NOT remove** any existing `<style>` blocks the page already has. The v2-compat block supplements, it doesn't replace.
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
- ### Per-theme compat blocks
336
+ ### What migrated pages look like under different v3 themes
286
337
 
287
- Each v2 theme needs its own compat block because the CSS variable values and hardcoded colors differ. The block above is for **nebula-dusk**. When migrating:
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
- - Use the compat block matching the theme the page was originally built under
290
- - If the original theme is unknown, default to **nebula-dusk** (the system default)
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.10.1",
5
+ "version": "0.11.1",
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
  }