@theoremjs/studio 0.0.0-stage → 0.3.2

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 (473) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +295 -2
  3. package/agreement.d.ts +14 -0
  4. package/agreement.js +80 -0
  5. package/asks.d.ts +47 -0
  6. package/asks.js +54 -0
  7. package/browser-connection.d.ts +49 -0
  8. package/browser-connection.js +215 -0
  9. package/browser-engine.d.ts +11 -0
  10. package/browser-engine.js +11 -0
  11. package/browser-execution.d.ts +6 -0
  12. package/browser-execution.js +18 -0
  13. package/browser-live.d.ts +4 -0
  14. package/browser-live.js +132 -0
  15. package/browser-transport.d.ts +33 -0
  16. package/browser-transport.js +229 -0
  17. package/browser.d.ts +4 -0
  18. package/browser.js +4 -0
  19. package/canonical.d.ts +10 -0
  20. package/canonical.js +25 -0
  21. package/compile-workspace.d.ts +28 -0
  22. package/compile-workspace.js +295 -0
  23. package/compile.d.ts +65 -0
  24. package/compile.js +1605 -0
  25. package/concierge-demo.d.ts +17 -0
  26. package/concierge-demo.js +1230 -0
  27. package/conversation-key.d.ts +5 -0
  28. package/conversation-key.js +10 -0
  29. package/decision-example-images.d.ts +30 -0
  30. package/decision-example-images.js +30 -0
  31. package/deno.json +3 -0
  32. package/draft.d.ts +407 -0
  33. package/draft.js +505 -0
  34. package/editors.d.ts +29 -0
  35. package/editors.js +51 -0
  36. package/example-embedding-files.d.ts +11 -0
  37. package/example-embedding-files.js +20 -0
  38. package/example.d.ts +36 -0
  39. package/example.js +357 -0
  40. package/guardrail-probe.d.ts +100 -0
  41. package/guardrail-probe.js +722 -0
  42. package/held-credentials.d.ts +28 -0
  43. package/held-credentials.js +87 -0
  44. package/installed.mjs +40 -0
  45. package/lent-keys.d.ts +122 -0
  46. package/lent-keys.js +47 -0
  47. package/line-diff.d.ts +15 -0
  48. package/line-diff.js +41 -0
  49. package/live-connection.d.ts +22 -0
  50. package/live-connection.js +27 -0
  51. package/live-session-bridge.d.ts +15 -0
  52. package/live-session-bridge.js +202 -0
  53. package/map-line.d.ts +19 -0
  54. package/map-line.js +42 -0
  55. package/map.d.ts +154 -0
  56. package/map.js +525 -0
  57. package/media-accept.d.ts +19 -0
  58. package/media-accept.js +65 -0
  59. package/mod.d.ts +39 -0
  60. package/mod.js +33 -0
  61. package/origins.d.ts +52 -0
  62. package/origins.js +165 -0
  63. package/package.json +85 -4
  64. package/page/assets/Banner-BISz3nXA.js +2 -0
  65. package/page/assets/BottomSheet-BwfBDtje.js +1 -0
  66. package/page/assets/Card-Lp-0P5eL.js +1 -0
  67. package/page/assets/CardWall-CBRLdDZW.js +1 -0
  68. package/page/assets/Center-nHS1JSux.js +1 -0
  69. package/page/assets/CheckboxInput-Cj5pk-KI.js +2 -0
  70. package/page/assets/CodeBlock-C7XJ4ioE.js +51 -0
  71. package/page/assets/CollapsibleGroup-N7_SOjbm.js +2 -0
  72. package/page/assets/ContextMenu-CBu9H-9H.js +2 -0
  73. package/page/assets/DateInput-BGrQ5tPC.js +1 -0
  74. package/page/assets/Dialog-DELWQo-v.js +1 -0
  75. package/page/assets/EmptyState-C8W4JKBZ.js +1 -0
  76. package/page/assets/HoverCard-D1Y1ltWQ.js +1 -0
  77. package/page/assets/Icon-JrysT8aU.js +3 -0
  78. package/page/assets/IconAlertTriangle-BqAEqqdU.js +1 -0
  79. package/page/assets/IconButton-DlOGzJIX.js +1 -0
  80. package/page/assets/IconEye-BB5aY-wQ.js +1 -0
  81. package/page/assets/IconFileText-6zOFKKrF.js +1 -0
  82. package/page/assets/IconSearch-BTx66a40.js +1 -0
  83. package/page/assets/IconShield-DDOh7Gr5.js +1 -0
  84. package/page/assets/ItemSwipeLayer-Ckn4X6h9.js +1 -0
  85. package/page/assets/PaneState-BvA2tLQg.js +1 -0
  86. package/page/assets/PaneState-eUzUkNE8.css +1 -0
  87. package/page/assets/ScrollableArea-Ckugdj1N.js +1 -0
  88. package/page/assets/Section-DJ97F7QE.js +1 -0
  89. package/page/assets/SegmentedControlItem-h-aaXzyS.js +1 -0
  90. package/page/assets/SidePanel-BL32abk8.js +1 -0
  91. package/page/assets/StackItem-CQviqAfM.js +1 -0
  92. package/page/assets/Text-bum6zWWx.js +2 -0
  93. package/page/assets/TimestampHoverCard-DQIG0RZF.js +1 -0
  94. package/page/assets/ToolResultCharts-CgshSv9Q.js +1 -0
  95. package/page/assets/Tooltip-BH9xiRMl.js +1 -0
  96. package/page/assets/TraceInspector-_yZiz05W.js +1 -0
  97. package/page/assets/TraceOverview-BPO-HIYK.js +57 -0
  98. package/page/assets/VStack-CkVMcNiK.js +1 -0
  99. package/page/assets/_virtual_studio-type-sources-ByxqQaOG.js +12936 -0
  100. package/page/assets/arrive-DvbqpeRS.js +1 -0
  101. package/page/assets/browser-engine-CYq9DQAM.js +9 -0
  102. package/page/assets/browser-transport-D-2jDYe7.js +47 -0
  103. package/page/assets/codicon-DF1abBS2.ttf +0 -0
  104. package/page/assets/compile-egress-BSxOdX4K.js +23 -0
  105. package/page/assets/container.stylex-BmOi-8DQ.js +1 -0
  106. package/page/assets/createReactComponent-CZwsv6DD.js +1 -0
  107. package/page/assets/decision-example-images-CZGr7YIT.js +1 -0
  108. package/page/assets/devWarning-DxuplmRl.js +1 -0
  109. package/page/assets/editor-DjpsE8to.css +1 -0
  110. package/page/assets/editor.api-Cd3ViPQa.js +908 -0
  111. package/page/assets/editor.worker-6GY8RhDc.js +1 -0
  112. package/page/assets/editor.worker-BmdWdrHZ.js +33 -0
  113. package/page/assets/editors-BJX_S59A.js +1 -0
  114. package/page/assets/egress-automata-B5ZGE1mT.js +1 -0
  115. package/page/assets/embedding-space-view-CfQBPDxD.js +140 -0
  116. package/page/assets/encode-files-Bc3HJyAh.js +1 -0
  117. package/page/assets/export-agent-C3yyzXH8.js +43 -0
  118. package/page/assets/figtree-latin-400-normal-BD4aNku5.woff +0 -0
  119. package/page/assets/figtree-latin-400-normal-g7Dtegnw.woff2 +0 -0
  120. package/page/assets/figtree-latin-500-normal-BWnGEVsr.woff2 +0 -0
  121. package/page/assets/figtree-latin-500-normal-B_yy1phn.woff +0 -0
  122. package/page/assets/figtree-latin-600-normal-BM_oTo4n.woff +0 -0
  123. package/page/assets/figtree-latin-600-normal-Cv_xCTDl.woff2 +0 -0
  124. package/page/assets/figtree-latin-700-normal-BCCt2T1q.woff +0 -0
  125. package/page/assets/figtree-latin-700-normal-th6qEP7c.woff2 +0 -0
  126. package/page/assets/focusOutline.stylex-BT0kfa4t.js +1 -0
  127. package/page/assets/focusableSelector-DXZeMU85.js +1 -0
  128. package/page/assets/groupStyles-C7Ter7zC.js +1 -0
  129. package/page/assets/guardrail-tester-Gut5xK4a.js +9 -0
  130. package/page/assets/host-patterns-C9RMP16Q.js +1 -0
  131. package/page/assets/index-CvvmFKgS.js +105 -0
  132. package/page/assets/index-DOaHlqBo.css +1 -0
  133. package/page/assets/isRtlElement-BG33-k_H.js +1 -0
  134. package/page/assets/labels-provider-4TIWDvsE.js +3 -0
  135. package/page/assets/lent-keys-C32ems-I.js +1 -0
  136. package/page/assets/live-ingress-lDUGPwth.js +1 -0
  137. package/page/assets/live-messages-CnkL4GWi.js +1 -0
  138. package/page/assets/mergeProps-ptS-gIMz.js +1 -0
  139. package/page/assets/padding.stylex-B76907Zf.js +1 -0
  140. package/page/assets/preload-helper-DpV6A1kQ.js +1 -0
  141. package/page/assets/reader-BOCCYaRp.js +7 -0
  142. package/page/assets/register-CDgivxvX.js +2 -0
  143. package/page/assets/rolldown-runtime-hePW80VL.js +1 -0
  144. package/page/assets/schemas-BQ9Jydzb.js +56 -0
  145. package/page/assets/shaped-data-BcarWqd5.js +16 -0
  146. package/page/assets/sharedResizeObserver-4U9Xq5Oq.js +1 -0
  147. package/page/assets/stub-DhdcU_Ew.js +471 -0
  148. package/page/assets/studio-code-pane-C_SAbcOa.js +8 -0
  149. package/page/assets/studio-console-DZwlEsvr.js +3 -0
  150. package/page/assets/studio-decision-B0FnCAXA.js +1 -0
  151. package/page/assets/studio-embedding-CmA51HVo.js +2 -0
  152. package/page/assets/studio-host-console-By7hqu2l.js +2 -0
  153. package/page/assets/studio-live-BrcVQcyV.js +1 -0
  154. package/page/assets/studio-map-B_xSia-z.js +1 -0
  155. package/page/assets/studio-map-Bb06Tw1F.css +1 -0
  156. package/page/assets/studio-monaco-CbKf90i6.css +1 -0
  157. package/page/assets/studio-monaco-xfyfezQS.js +34 -0
  158. package/page/assets/studio-ts.worker-B-EXG4Sv.js +67741 -0
  159. package/page/assets/studio-ts.worker-BXtW3z-O.js +1 -0
  160. package/page/assets/studio-type-checker-BOvxudki.js +23 -0
  161. package/page/assets/themeProps-3IqahpCr.js +1 -0
  162. package/page/assets/tokens.stylex-DkHf0P9C.js +1 -0
  163. package/page/assets/tool-schema-idaOe2nI.js +18 -0
  164. package/page/assets/trace-patterns-DnYJa0nI.js +1 -0
  165. package/page/assets/trace-record-C3zNksA_.js +1 -0
  166. package/page/assets/trace-schema-9CdEyG6Q.js +1 -0
  167. package/page/assets/tree-DqyAMsbI.js +3 -0
  168. package/page/assets/turn-client-Du3Um3Mg.js +2 -0
  169. package/page/assets/types-BhfXQCLx.js +1 -0
  170. package/page/assets/typescript-20GgZ8PJ.js +1 -0
  171. package/page/assets/use-one-call-Hcs8YBp1.js +1 -0
  172. package/page/assets/useAdaptivePresentation-BzmPCddb.js +1 -0
  173. package/page/assets/useClipboard-BgGRxRMJ.js +1 -0
  174. package/page/assets/useContainerReveal-BFy8N_QU.js +1 -0
  175. package/page/assets/useDevWarning-Z9SoixOP.js +1 -0
  176. package/page/assets/useLayerDismissal-B_G7IWpC.js +1 -0
  177. package/page/assets/useMediaQuery-BCT0NUeZ.js +1 -0
  178. package/page/assets/useScrollLock-Dyf6PHJt.js +1 -0
  179. package/page/assets/useScrollableArea-0NzdiBCq.js +1 -0
  180. package/page/assets/useTooltip-CJM_xhLB.js +1 -0
  181. package/page/assets/workspace-DZALqEDX.js +1 -0
  182. package/page/assets/zip-DTcEfps6.js +1 -0
  183. package/page/index.html +90 -0
  184. package/page.mjs +49 -0
  185. package/people.d.ts +87 -0
  186. package/people.js +110 -0
  187. package/policy.d.ts +43 -0
  188. package/policy.js +102 -0
  189. package/ports.d.mts +32 -0
  190. package/ports.mjs +85 -0
  191. package/probe-battery.d.ts +13 -0
  192. package/probe-battery.js +404 -0
  193. package/providers.d.ts +149 -0
  194. package/providers.js +306 -0
  195. package/read-source.d.ts +48 -0
  196. package/read-source.js +1301 -0
  197. package/read-steps.d.ts +23 -0
  198. package/read-steps.js +2 -0
  199. package/reader.d.ts +11 -0
  200. package/reader.js +11 -0
  201. package/registrations.d.ts +83 -0
  202. package/registrations.js +1 -0
  203. package/requirements.d.ts +22 -0
  204. package/requirements.js +38 -0
  205. package/run-payload-core.d.ts +28 -0
  206. package/run-payload-core.js +123 -0
  207. package/run-payload.d.ts +32 -0
  208. package/run-payload.js +26 -0
  209. package/runtime-scope.d.ts +84 -0
  210. package/runtime-scope.js +308 -0
  211. package/runtime.d.ts +84 -0
  212. package/runtime.js +387 -0
  213. package/section-notes.d.ts +33 -0
  214. package/section-notes.js +38 -0
  215. package/serve-page.mjs +96 -0
  216. package/server/draft-decide.d.ts +72 -0
  217. package/server/draft-decide.js +111 -0
  218. package/server/draft-embedding.d.ts +3 -0
  219. package/server/draft-embedding.js +35 -0
  220. package/server/draft-handler.d.ts +82 -0
  221. package/server/draft-handler.js +213 -0
  222. package/server/draft-probe.d.ts +14 -0
  223. package/server/draft-probe.js +61 -0
  224. package/server/draft-replies.d.ts +22 -0
  225. package/server/draft-replies.js +46 -0
  226. package/server/edited-session.d.ts +28 -0
  227. package/server/edited-session.js +83 -0
  228. package/server/edits.d.ts +38 -0
  229. package/server/edits.js +195 -0
  230. package/server/handler.d.ts +133 -0
  231. package/server/handler.js +598 -0
  232. package/server/lent-draft.d.ts +19 -0
  233. package/server/lent-draft.js +23 -0
  234. package/server/live.d.ts +15 -0
  235. package/server/live.js +96 -0
  236. package/server/open-editor.d.ts +63 -0
  237. package/server/open-editor.js +115 -0
  238. package/server/origins.d.ts +18 -0
  239. package/server/origins.js +330 -0
  240. package/server/project-source.d.ts +208 -0
  241. package/server/project-source.js +1042 -0
  242. package/server/project.d.ts +22 -0
  243. package/server/project.js +56 -0
  244. package/server/run-traces.d.ts +20 -0
  245. package/server/run-traces.js +96 -0
  246. package/server/save-new.d.ts +29 -0
  247. package/server/save-new.js +514 -0
  248. package/server/save-plan.d.ts +46 -0
  249. package/server/save-plan.js +1134 -0
  250. package/server/save-remove.d.ts +21 -0
  251. package/server/save-remove.js +528 -0
  252. package/server/save-session.d.ts +96 -0
  253. package/server/save-session.js +418 -0
  254. package/server/save-wire.d.ts +235 -0
  255. package/server/save-wire.js +8 -0
  256. package/server/save.d.ts +52 -0
  257. package/server/save.js +209 -0
  258. package/server/serve.d.ts +23 -0
  259. package/server/serve.js +413 -0
  260. package/server/test-connection.d.ts +17 -0
  261. package/server/test-connection.js +362 -0
  262. package/server/test-key.d.ts +2 -0
  263. package/server/test-key.js +83 -0
  264. package/server/watch.d.ts +28 -0
  265. package/server/watch.js +93 -0
  266. package/server/zod-edit.d.ts +74 -0
  267. package/server/zod-edit.js +558 -0
  268. package/server.d.ts +8 -0
  269. package/server.js +8 -0
  270. package/setups.mjs +170 -0
  271. package/shared-carry.d.ts +114 -0
  272. package/shared-carry.js +523 -0
  273. package/shared-settings.d.ts +34 -0
  274. package/shared-settings.js +70 -0
  275. package/source.d.ts +75 -0
  276. package/source.js +414 -0
  277. package/start.mjs +169 -0
  278. package/stream-lines.d.ts +9 -0
  279. package/stream-lines.js +27 -0
  280. package/stub.d.ts +6 -0
  281. package/stub.js +33 -0
  282. package/surface.d.ts +53 -0
  283. package/surface.js +631 -0
  284. package/system-markup.d.ts +20 -0
  285. package/system-markup.js +51 -0
  286. package/tool-schema.d.ts +23 -0
  287. package/tool-schema.js +69 -0
  288. package/tools.d.ts +16 -0
  289. package/tools.js +91 -0
  290. package/traces.d.ts +24 -0
  291. package/traces.js +29 -0
  292. package/transport.d.ts +57 -0
  293. package/transport.js +187 -0
  294. package/tree.d.ts +32 -0
  295. package/tree.js +83 -0
  296. package/types.d.ts +62 -0
  297. package/types.js +6 -0
  298. package/ui/acting-as-button.d.ts +2 -0
  299. package/ui/acting-as-button.js +16 -0
  300. package/ui/add-provider.d.ts +13 -0
  301. package/ui/add-provider.js +20 -0
  302. package/ui/boot-mark.css +53 -0
  303. package/ui/boot-mark.d.ts +19 -0
  304. package/ui/boot-mark.js +128 -0
  305. package/ui/boot-paint.d.ts +8 -0
  306. package/ui/boot-paint.js +8 -0
  307. package/ui/brand-icons.d.ts +57 -0
  308. package/ui/brand-icons.js +148 -0
  309. package/ui/built/theme.css +830 -0
  310. package/ui/built/theme.css.d.ts +9 -0
  311. package/ui/built/theorem-studio.d.ts +13 -0
  312. package/ui/built/theorem-studio.js +705 -0
  313. package/ui/built/theorem-studio.variants.d.ts +28 -0
  314. package/ui/code/monaco-contributions.d.ts +45 -0
  315. package/ui/code/studio-code.d.ts +7 -0
  316. package/ui/code/studio-code.js +253 -0
  317. package/ui/code/studio-monaco.d.ts +44 -0
  318. package/ui/code/studio-monaco.js +48 -0
  319. package/ui/code/studio-ts.worker.d.ts +1 -0
  320. package/ui/code/studio-ts.worker.js +16 -0
  321. package/ui/code/studio-type-checker.d.ts +12 -0
  322. package/ui/code/studio-type-checker.js +308 -0
  323. package/ui/code/studio-type-sources.d.ts +26 -0
  324. package/ui/confirm-write.d.ts +12 -0
  325. package/ui/confirm-write.js +45 -0
  326. package/ui/diff-block.d.ts +21 -0
  327. package/ui/diff-block.js +17 -0
  328. package/ui/figtree.css +59 -0
  329. package/ui/file-place.d.ts +4 -0
  330. package/ui/file-place.js +26 -0
  331. package/ui/guardrail-tester.d.ts +18 -0
  332. package/ui/guardrail-tester.js +248 -0
  333. package/ui/inspector-context.d.ts +119 -0
  334. package/ui/inspector-context.js +84 -0
  335. package/ui/inspector.d.ts +247 -0
  336. package/ui/inspector.js +284 -0
  337. package/ui/lib/acting-as.d.ts +25 -0
  338. package/ui/lib/acting-as.js +90 -0
  339. package/ui/lib/boot-sequence.d.ts +32 -0
  340. package/ui/lib/boot-sequence.js +57 -0
  341. package/ui/lib/export-agent.d.ts +11 -0
  342. package/ui/lib/export-agent.js +335 -0
  343. package/ui/lib/facet-icons.d.ts +20 -0
  344. package/ui/lib/facet-icons.js +21 -0
  345. package/ui/lib/panel-motion.d.ts +8 -0
  346. package/ui/lib/panel-motion.js +74 -0
  347. package/ui/lib/project-address.d.ts +14 -0
  348. package/ui/lib/project-address.js +24 -0
  349. package/ui/lib/project-starting.d.ts +13 -0
  350. package/ui/lib/project-starting.js +30 -0
  351. package/ui/lib/project-traces.d.ts +17 -0
  352. package/ui/lib/project-traces.js +54 -0
  353. package/ui/lib/read-map.d.ts +30 -0
  354. package/ui/lib/read-map.js +173 -0
  355. package/ui/lib/read-progress.d.ts +14 -0
  356. package/ui/lib/read-progress.js +12 -0
  357. package/ui/lib/refusal-lines.d.ts +3 -0
  358. package/ui/lib/refusal-lines.js +8 -0
  359. package/ui/lib/studio-activity.d.ts +5 -0
  360. package/ui/lib/studio-activity.js +17 -0
  361. package/ui/lib/studio-console.d.ts +27 -0
  362. package/ui/lib/studio-console.js +9 -0
  363. package/ui/lib/studio-conversation.d.ts +20 -0
  364. package/ui/lib/studio-conversation.js +130 -0
  365. package/ui/lib/studio-examples.d.ts +31 -0
  366. package/ui/lib/studio-examples.js +25 -0
  367. package/ui/lib/studio-labels.d.ts +6 -0
  368. package/ui/lib/studio-labels.js +13 -0
  369. package/ui/lib/studio-map-kept.d.ts +17 -0
  370. package/ui/lib/studio-map-kept.js +48 -0
  371. package/ui/lib/studio-open.d.ts +22 -0
  372. package/ui/lib/studio-open.js +54 -0
  373. package/ui/lib/studio-page.d.ts +33 -0
  374. package/ui/lib/studio-page.js +121 -0
  375. package/ui/lib/studio-prefs.d.ts +26 -0
  376. package/ui/lib/studio-prefs.js +87 -0
  377. package/ui/lib/studio-project.d.ts +106 -0
  378. package/ui/lib/studio-project.js +177 -0
  379. package/ui/lib/studio-restore.d.ts +49 -0
  380. package/ui/lib/studio-restore.js +251 -0
  381. package/ui/lib/studio-run-open.d.ts +15 -0
  382. package/ui/lib/studio-run-open.js +16 -0
  383. package/ui/lib/studio-session.d.ts +34 -0
  384. package/ui/lib/studio-session.js +17 -0
  385. package/ui/lib/studio-settings.d.ts +15 -0
  386. package/ui/lib/studio-settings.js +48 -0
  387. package/ui/lib/studio-store.d.ts +64 -0
  388. package/ui/lib/studio-store.js +391 -0
  389. package/ui/lib/studio-watch.d.ts +12 -0
  390. package/ui/lib/studio-watch.js +27 -0
  391. package/ui/lib/tab-fills.d.ts +6 -0
  392. package/ui/lib/tab-fills.js +14 -0
  393. package/ui/lib/tool-credentials.d.ts +3 -0
  394. package/ui/lib/tool-credentials.js +23 -0
  395. package/ui/lib/tool-probe.d.ts +19 -0
  396. package/ui/lib/tool-probe.js +104 -0
  397. package/ui/lib/type-icons.d.ts +35 -0
  398. package/ui/lib/type-icons.js +38 -0
  399. package/ui/lib/when-idle.d.ts +5 -0
  400. package/ui/lib/when-idle.js +14 -0
  401. package/ui/lib/zip.d.ts +5 -0
  402. package/ui/lib/zip.js +8 -0
  403. package/ui/map-token.css +11 -0
  404. package/ui/map-token.d.ts +17 -0
  405. package/ui/map-token.js +29 -0
  406. package/ui/mcp-icon.d.ts +6 -0
  407. package/ui/mcp-icon.js +8 -0
  408. package/ui/motion.css +113 -0
  409. package/ui/pan.d.ts +32 -0
  410. package/ui/pan.js +90 -0
  411. package/ui/profile-editor.d.ts +33 -0
  412. package/ui/profile-editor.js +2638 -0
  413. package/ui/provider-editor.d.ts +15 -0
  414. package/ui/provider-editor.js +92 -0
  415. package/ui/read-map.css +48 -0
  416. package/ui/read-map.d.ts +7 -0
  417. package/ui/read-map.js +163 -0
  418. package/ui/refusal-detail.d.ts +4 -0
  419. package/ui/refusal-detail.js +21 -0
  420. package/ui/shared-change.d.ts +9 -0
  421. package/ui/shared-change.js +28 -0
  422. package/ui/shell-motion.css +121 -0
  423. package/ui/shell-motion.d.ts +73 -0
  424. package/ui/shell-motion.js +194 -0
  425. package/ui/studio-code-pane.d.ts +19 -0
  426. package/ui/studio-code-pane.js +44 -0
  427. package/ui/studio-compare.d.ts +80 -0
  428. package/ui/studio-compare.js +326 -0
  429. package/ui/studio-conflicts.d.ts +17 -0
  430. package/ui/studio-conflicts.js +87 -0
  431. package/ui/studio-connection.d.ts +64 -0
  432. package/ui/studio-connection.js +286 -0
  433. package/ui/studio-decision.d.ts +6 -0
  434. package/ui/studio-decision.js +49 -0
  435. package/ui/studio-embedding.d.ts +6 -0
  436. package/ui/studio-embedding.js +30 -0
  437. package/ui/studio-host-console.d.ts +6 -0
  438. package/ui/studio-host-console.js +17 -0
  439. package/ui/studio-host.d.ts +73 -0
  440. package/ui/studio-host.js +12 -0
  441. package/ui/studio-live.d.ts +17 -0
  442. package/ui/studio-live.js +26 -0
  443. package/ui/studio-map.css +273 -0
  444. package/ui/studio-map.d.ts +17 -0
  445. package/ui/studio-map.js +397 -0
  446. package/ui/studio-nav.d.ts +24 -0
  447. package/ui/studio-nav.js +17 -0
  448. package/ui/studio-no-project.d.ts +5 -0
  449. package/ui/studio-no-project.js +9 -0
  450. package/ui/studio-run.css +76 -0
  451. package/ui/studio-run.d.ts +14 -0
  452. package/ui/studio-run.js +119 -0
  453. package/ui/studio-runner.d.ts +45 -0
  454. package/ui/studio-runner.js +187 -0
  455. package/ui/studio-save.d.ts +49 -0
  456. package/ui/studio-save.js +307 -0
  457. package/ui/studio-screen.d.ts +61 -0
  458. package/ui/studio-screen.js +2078 -0
  459. package/ui/studio-settings.d.ts +31 -0
  460. package/ui/studio-settings.js +288 -0
  461. package/ui/studio-shell.css +27 -0
  462. package/ui/studio-shell.d.ts +43 -0
  463. package/ui/studio-shell.js +87 -0
  464. package/ui/studio-theme.d.ts +7 -0
  465. package/ui/studio-theme.js +94 -0
  466. package/ui/studio.css +427 -0
  467. package/ui/theorem-mark.css +84 -0
  468. package/ui/theorem-mark.d.ts +22 -0
  469. package/ui/theorem-mark.js +21 -0
  470. package/vite.d.mts +30 -0
  471. package/vite.mjs +277 -0
  472. package/workspace.d.ts +230 -0
  473. package/workspace.js +1054 -0
@@ -0,0 +1,15 @@
1
+ import { type StudioIssue, type StudioProvider, type StudioWorkspace } from '../mod.ts';
2
+ /**
3
+ * The editor for one provider: its adapter, what it connects with, as its adapter takes it, the
4
+ * key slots its models read, and what its models take. Its id is what code and models name it by,
5
+ * so only a provider the files do not hold yet takes a new one, through `onRename`, and an adapter
6
+ * the project made itself stays its code's. `onChange` is left out where the
7
+ * providers are the studio's own: every row then shows its value and takes no edit.
8
+ */
9
+ export declare function ProviderEditor({ workspace, provider, issues, onChange, onRename, }: {
10
+ workspace: StudioWorkspace;
11
+ provider: StudioProvider;
12
+ issues: readonly StudioIssue[];
13
+ onChange?: (next: StudioProvider) => void;
14
+ onRename?: (id: string) => void;
15
+ }): import("react").JSX.Element;
@@ -0,0 +1,92 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Section } from '@astryxdesign/core/Section';
3
+ import { StackItem } from '@astryxdesign/core/Stack';
4
+ import { Text } from '@astryxdesign/core/Text';
5
+ import { TextInput } from '@astryxdesign/core/TextInput';
6
+ import { VStack } from '@astryxdesign/core/VStack';
7
+ import { useState } from 'react';
8
+ import { connectionFields, kernelDefinitions, providerUse, takesKey, } from "../mod.js";
9
+ import { ChoiceRow, InspectorRow, InspectorSection, SetInCode, TextRow } from "./inspector.js";
10
+ import { NodeIssues } from "./inspector-context.js";
11
+ import { IssueBanners, SlotRow } from "./profile-editor.js";
12
+ /** A connection setting's name as a row labels it: `baseURL` is Base URL. */
13
+ function settingLabel(name) {
14
+ const words = name.replace(/([a-z])([A-Z])/g, '$1 $2').replace(/\bUrl\b/g, 'URL');
15
+ const [first = '', ...rest] = words.split(' ');
16
+ const lower = rest.map((word) => (word === 'URL' ? word : word.toLowerCase()));
17
+ return [first.charAt(0).toUpperCase() + first.slice(1), ...lower].join(' ');
18
+ }
19
+ /** How many models run on the provider, and across how many agents. */
20
+ function usedBy(workspace, id) {
21
+ const { models, agents } = providerUse(workspace, id);
22
+ if (models === 0)
23
+ return 'No model runs on it.';
24
+ const plural = (count, word) => `${String(count)} ${word}${count === 1 ? '' : 's'}`;
25
+ return `${plural(models, 'model')} in ${plural(agents, 'agent')} ${models === 1 ? 'runs' : 'run'} on it.`;
26
+ }
27
+ /** `provider` with the text setting `name` of `field` set, or left out once it is blank. */
28
+ function withText(provider, field, value) {
29
+ const { [field]: _was, ...rest } = provider;
30
+ return value ? { ...rest, [field]: value } : rest;
31
+ }
32
+ function withConnection(provider, name, value) {
33
+ const { [name]: _was, ...rest } = provider.connection ?? {};
34
+ return { ...provider, connection: value ? { ...rest, [name]: value } : rest };
35
+ }
36
+ /**
37
+ * `provider` registered from the kernel definition `definition`, keeping what it connects with
38
+ * that the definition also takes.
39
+ */
40
+ function withDefinition(provider, definition) {
41
+ const takes = new Set(connectionFields(definition)?.map((field) => field.name));
42
+ const kept = Object.entries(provider.connection ?? {}).filter(([name]) => takes.has(name));
43
+ return { ...provider, definition, connection: Object.fromEntries(kept) };
44
+ }
45
+ /**
46
+ * A new provider's id, renamed as it is left or on Enter, so its page stays open while it is typed.
47
+ * A blank or taken id says why and goes back to the one it has.
48
+ */
49
+ function ProviderIdRow({ id, taken, onRename, }) {
50
+ const [typed, setTyped] = useState(id);
51
+ const name = typed.trim();
52
+ const problem = !name
53
+ ? 'A provider needs an id.'
54
+ : name !== id && taken.includes(name)
55
+ ? `A provider named '${name}' is already here.`
56
+ : undefined;
57
+ const commit = () => {
58
+ if (problem)
59
+ setTyped(id);
60
+ else if (name !== id)
61
+ onRename(name);
62
+ };
63
+ return (_jsx(InspectorRow, { label: "Id", path: "id", isRequired: true, hasIssue: problem !== undefined, hasNote: problem !== undefined, children: _jsx(StackItem, { size: "fill", children: _jsx(TextInput, { label: "Id", isLabelHidden: true, size: "sm", value: typed, status: problem ? { type: 'error', message: problem } : undefined, onChange: setTyped, onEnter: commit, onBlur: commit }) }) }));
64
+ }
65
+ /**
66
+ * The editor for one provider: its adapter, what it connects with, as its adapter takes it, the
67
+ * key slots its models read, and what its models take. Its id is what code and models name it by,
68
+ * so only a provider the files do not hold yet takes a new one, through `onRename`, and an adapter
69
+ * the project made itself stays its code's. `onChange` is left out where the
70
+ * providers are the studio's own: every row then shows its value and takes no edit.
71
+ */
72
+ export function ProviderEditor({ workspace, provider, issues, onChange, onRename, }) {
73
+ const held = connectionFields(provider.definition);
74
+ const set = onChange ?? (() => undefined);
75
+ // A setting its definition does not take still gets a row, so its issue shows and it can be cleared.
76
+ const extra = Object.keys(provider.connection ?? {})
77
+ .filter((name) => !held?.some((field) => field.name === name))
78
+ .map((name) => ({ name, required: false, url: false }));
79
+ // The studio's own show only what they are set with: a blank row would say more than the studio knows.
80
+ const fields = held && [...held, ...extra].filter((field) => onChange || provider.connection?.[field.name]);
81
+ // A definition that signs in with no key reads no slot; one set anyway still shows, so its issue can be cleared.
82
+ const slots = ['keySlot', 'fallbackKeySlot'].filter((slot) => provider[slot] || (onChange && takesKey(provider.definition)));
83
+ const rows = (_jsxs(_Fragment, { children: [fields === undefined ? (_jsx(InspectorSection, { title: "Connection", note: "Its definition is the project's own, so what it connects with is the definition's to say.", children: null })) : (fields.length > 0 && (_jsx(InspectorSection, { title: "Connection", children: fields.map((field) => (_jsx(TextRow, { label: settingLabel(field.name), path: `connection.${field.name}`, field: `connection.${field.name}`, isRequired: field.required, value: provider.connection?.[field.name] ?? '', placeholder: field.url ? 'https://' : undefined, onChange: (value) => {
84
+ set(withConnection(provider, field.name, value.trim()));
85
+ } }, field.name))) }))), slots.length > 0 && (_jsx(InspectorSection, { title: "Keys", note: "The slots its models read their key from, unless a model names its own.", children: slots.map((slot) => (_jsx(SlotRow, { label: slot === 'keySlot' ? 'Key slot' : 'Fallback slot', path: slot, field: slot, value: provider[slot] ?? '', onChange: (next) => {
86
+ set(withText(provider, slot, next));
87
+ } }, slot))) }))] }));
88
+ return (_jsx(NodeIssues, { value: issues, children: _jsxs(VStack, { children: [_jsx(IssueBanners, { issues: issues }), _jsxs(InspectorSection, { title: "Provider", note: usedBy(workspace, provider.id), children: [onRename ? (_jsx(ProviderIdRow, { id: provider.id, taken: workspace.providers.map((each) => each.id), onRename: onRename })) : (_jsx(InspectorRow, { label: "Id", path: "id", children: _jsx(Text, { children: provider.id }) })), onChange && held ? (_jsx(ChoiceRow, { label: "Definition", path: "definition", field: "definition", isRequired: true, value: provider.definition, options: kernelDefinitions(), onChange: (next) => {
89
+ if (next && next !== provider.definition)
90
+ onChange(withDefinition(provider, next));
91
+ } })) : (_jsx(InspectorRow, { label: "Definition", path: "definition", children: _jsx(Text, { children: provider.definition }) }))] }), onChange ? (rows) : (_jsxs(_Fragment, { children: [_jsx(Section, { variant: "transparent", padding: 3, children: _jsx(Text, { type: "supporting", color: "secondary", children: "The studio's own provider: the studio decides what it connects with. A project's providers are changed here." }) }), _jsx(SetInCode, { children: rows })] }))] }) }));
92
+ }
@@ -0,0 +1,48 @@
1
+ /* The loader's map of a project being read. It fills the loader's panel. */
2
+ .read-map {
3
+ position: absolute;
4
+ inset: 0;
5
+ overflow: hidden;
6
+ }
7
+
8
+ .read-map-lines {
9
+ position: absolute;
10
+ inset: 0 auto auto 0;
11
+ pointer-events: none;
12
+ }
13
+
14
+ /* The line draws in from the node it leaves. */
15
+ .read-map-line {
16
+ stroke-dasharray: 1;
17
+ stroke-dashoffset: 1;
18
+ animation: read-map-line-in var(--duration-medium, 240ms) var(--ease-standard, ease-out) forwards;
19
+ }
20
+
21
+ .read-map-dot {
22
+ fill: var(--color-text-secondary);
23
+ animation: read-map-in var(--duration-fast, 120ms) var(--ease-standard, ease-out) both;
24
+ }
25
+
26
+ .read-map-node {
27
+ animation: read-map-in var(--duration-medium, 240ms) var(--ease-standard, ease-out) both;
28
+ }
29
+
30
+ .read-map-foot {
31
+ position: absolute;
32
+ inset: auto var(--spacing-4) var(--spacing-4) var(--spacing-4);
33
+ display: flex;
34
+ gap: 16px;
35
+ justify-content: space-between;
36
+ }
37
+
38
+ @keyframes read-map-line-in {
39
+ to {
40
+ stroke-dashoffset: 0;
41
+ }
42
+ }
43
+
44
+ @keyframes read-map-in {
45
+ from {
46
+ opacity: 0;
47
+ }
48
+ }
@@ -0,0 +1,7 @@
1
+ import type { Reading } from './lib/read-progress.ts';
2
+ export interface ReadMapProps {
3
+ reading: Reading;
4
+ /** Called once every step is drawn and the project has arrived. */
5
+ onDrawn: () => void;
6
+ }
7
+ export declare function ReadMap({ reading, onDrawn }: ReadMapProps): import("react").JSX.Element;
package/ui/read-map.js ADDED
@@ -0,0 +1,163 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text } from '@astryxdesign/core/Text';
3
+ import { IconFileCode, IconFileSmile, IconFolder } from '@tabler/icons-react';
4
+ import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
5
+ import { mapCurve } from "../map-line.js";
6
+ import { readMap } from "./lib/read-map.js";
7
+ import { profileTypeIcon, toolTypeIcon } from "./lib/type-icons.js";
8
+ import { MapToken, useTokenWidths } from "./map-token.js";
9
+ import './read-map.css';
10
+ /** The slowest the map draws: one step in this long. */
11
+ const STEP_MS = 70;
12
+ /** While steps still arrive, the map stays about this far behind them. */
13
+ const LAG_MS = 500;
14
+ /** Once the project has arrived, the rest is drawn within this long. */
15
+ const CATCH_UP_MS = 900;
16
+ /** The map shows for at least this long, so a quick read can still be seen. */
17
+ const SHOWN_MS = 2000;
18
+ /** The panel's own padding, step 4. */
19
+ const PAD = 16;
20
+ const ROW = 30;
21
+ /** Room kept for the last column's tokens and for the line of words under the map. */
22
+ const LAST_COL = 190;
23
+ const FOOT = 44;
24
+ const GAP = 8;
25
+ const DOTS = 8;
26
+ const LABEL = 30;
27
+ const NODE_ICON = {
28
+ entry: IconFileCode,
29
+ folder: IconFolder,
30
+ profile: IconFileSmile,
31
+ tool: undefined,
32
+ more: undefined,
33
+ };
34
+ /** An agent or a tool has its type's icon, the one the tree gives it. */
35
+ function nodeIcon({ kind, type }) {
36
+ if (kind === 'profile')
37
+ return profileTypeIcon(type) ?? NODE_ICON.profile;
38
+ if (kind === 'tool')
39
+ return toolTypeIcon(type ?? '');
40
+ return NODE_ICON[kind];
41
+ }
42
+ function isFile(step) {
43
+ return 'file' in step && !('found' in step);
44
+ }
45
+ /** A long name keeps its end, which is what tells two paths apart. */
46
+ function short(label) {
47
+ return label.length > LABEL ? `…${label.slice(1 - LABEL)}` : label;
48
+ }
49
+ /** How far the map has drawn: the steps drawn, of the steps it is laid out from. */
50
+ function useDrawn(reading, onDrawn) {
51
+ const [drawn, setDrawn] = useState({ steps: 0, known: 0 });
52
+ const told = useRef(onDrawn);
53
+ told.current = onDrawn;
54
+ useEffect(() => {
55
+ let frame = 0;
56
+ const start = performance.now();
57
+ let at = start;
58
+ let cursor = 0;
59
+ let pace;
60
+ const tick = (now) => {
61
+ const known = reading.steps().length;
62
+ const left = known - cursor;
63
+ if (reading.done())
64
+ pace ??= Math.max(1 / STEP_MS, left / Math.max(CATCH_UP_MS, SHOWN_MS - (now - start)));
65
+ const rate = pace ?? Math.max(1 / STEP_MS, left / LAG_MS);
66
+ cursor = Math.min(known, cursor + (now - at) * rate);
67
+ at = now;
68
+ const steps = Math.floor(cursor);
69
+ setDrawn((last) => (last.steps === steps && last.known === known ? last : { steps, known }));
70
+ if (reading.done() && cursor >= known && now - start >= SHOWN_MS) {
71
+ told.current();
72
+ return;
73
+ }
74
+ frame = requestAnimationFrame(tick);
75
+ };
76
+ frame = requestAnimationFrame(tick);
77
+ return () => cancelAnimationFrame(frame);
78
+ }, [reading]);
79
+ return drawn;
80
+ }
81
+ function useSize() {
82
+ const ref = useRef(null);
83
+ const [size, setSize] = useState();
84
+ useLayoutEffect(() => {
85
+ const root = ref.current;
86
+ if (!root)
87
+ return;
88
+ const measure = () => setSize({ width: root.clientWidth, height: root.clientHeight });
89
+ measure();
90
+ const watch = new ResizeObserver(measure);
91
+ watch.observe(root);
92
+ return () => watch.disconnect();
93
+ }, []);
94
+ return { ref, size };
95
+ }
96
+ /** What the line of words under the map says of the step being drawn. */
97
+ function saying(steps, drawn) {
98
+ const last = steps[Math.max(0, drawn - 1)];
99
+ if (!last)
100
+ return 'Reading your project';
101
+ if ('again' in last)
102
+ return 'Your files changed. Loading the project again.';
103
+ if (isFile(last))
104
+ return `Reading ${last.file}`;
105
+ return drawn < steps.length ? 'Finding agents and tools' : 'Opening';
106
+ }
107
+ function counted(count, one) {
108
+ return count ? `${String(count)} ${one}${count === 1 ? '' : 's'}` : undefined;
109
+ }
110
+ /** What has been drawn so far, counted. */
111
+ function tally(steps, drawn) {
112
+ const seen = steps.slice(0, drawn);
113
+ const found = (kind) => seen.filter((step) => 'found' in step && step.found === kind).length;
114
+ return [
115
+ counted(seen.filter(isFile).length, 'file'),
116
+ counted(found('profile'), 'agent'),
117
+ counted(found('tool'), 'tool'),
118
+ ]
119
+ .filter((part) => part !== undefined)
120
+ .join(' · ');
121
+ }
122
+ /** The line from a node's right edge to the next node's left, and the dots along it. */
123
+ function lineTo(from, fromWidth, to, dots) {
124
+ const curve = mapCurve({ x: from.x + fromWidth + GAP, y: from.y }, { x: to.x - GAP, y: to.y });
125
+ return {
126
+ d: curve.d,
127
+ dots: Array.from({ length: dots }, (_, index) => curve.at((index + 1) / (dots + 1))),
128
+ };
129
+ }
130
+ export function ReadMap({ reading, onDrawn }) {
131
+ const drawn = useDrawn(reading, onDrawn);
132
+ const { ref, size } = useSize();
133
+ const steps = reading.steps();
134
+ const rows = size ? Math.floor((size.height - PAD * 2 - FOOT) / ROW) : 0;
135
+ // Laid out from every step said so far, not only the ones drawn: drawing a node moves nothing.
136
+ // A folder first said later does move the rows, and the tokens and lines move together.
137
+ // biome-ignore lint/correctness/useExhaustiveDependencies: `steps` is one list that grows; its length is what changes.
138
+ const map = useMemo(() => readMap(steps.slice(0, drawn.known), rows), [drawn.known, rows]);
139
+ const placed = useMemo(() => {
140
+ if (!size)
141
+ return [];
142
+ const stride = map.cols > 1 ? (size.width - PAD * 2 - LAST_COL) / (map.cols - 1) : 0;
143
+ return map.nodes
144
+ .filter((node) => node.first < drawn.steps)
145
+ .map((node) => ({
146
+ node,
147
+ x: PAD + node.col * Math.max(stride, 0),
148
+ y: size.height / 2 + (node.row - (map.rows - 1) / 2) * ROW,
149
+ }));
150
+ }, [map, size, drawn.steps]);
151
+ const widths = useTokenWidths(ref, placed);
152
+ const byId = new Map(placed.map((each) => [each.node.id, each]));
153
+ return (_jsxs("div", { ref: ref, className: "read-map", "aria-hidden": "true", children: [_jsx("svg", { className: "read-map-lines", "aria-hidden": "true", width: size?.width ?? 0, height: size?.height ?? 0, children: placed.map((to) => {
154
+ const from = to.node.parent === undefined ? undefined : byId.get(to.node.parent);
155
+ const width = from && widths[from.node.id];
156
+ if (!from || width === undefined)
157
+ return null;
158
+ const read = to.node.own.filter((step) => step < drawn.steps).length;
159
+ const dots = Math.ceil((Math.min(DOTS, to.node.own.length) * read) / Math.max(1, to.node.own.length));
160
+ const line = lineTo(from, width, to, Math.min(DOTS, to.node.own.length));
161
+ return (_jsxs("g", { children: [_jsx("path", { className: "map-line read-map-line", d: line.d, pathLength: 1 }), line.dots.slice(0, dots).map(({ x, y }, index) => (_jsx("circle", { className: "read-map-dot", cx: x, cy: y, r: 2.5 }, index)))] }, to.node.id));
162
+ }) }), placed.map(({ node, x, y }) => (_jsx(MapToken, { className: "read-map-node", id: node.id, label: short(node.label), icon: nodeIcon(node), x: x, y: y }, node.id))), _jsxs("div", { className: "read-map-foot", children: [_jsx(Text, { type: "supporting", color: "secondary", maxLines: 1, children: saying(steps, drawn.steps) }), _jsx(Text, { type: "supporting", color: "secondary", maxLines: 1, children: tally(steps, drawn.steps) })] })] }));
163
+ }
@@ -0,0 +1,4 @@
1
+ import type { SaveRefusal } from '../server/save-wire.ts';
2
+ export declare function RefusalDetail({ refusal }: {
3
+ refusal: SaveRefusal;
4
+ }): import("react").JSX.Element | null;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Why the studio could not run or save the builder's edits, past the headline: the agents and
4
+ * tools that did not load as edited, or what the project said when it stopped.
5
+ */
6
+ import { ScrollableArea } from '@astryxdesign/core/ScrollableArea';
7
+ import { Text } from '@astryxdesign/core/Text';
8
+ import { VStack } from '@astryxdesign/core/VStack';
9
+ import { refusalLines } from "./lib/refusal-lines.js";
10
+ /** More lines than this scroll, so a long report does not push the way out off the pane. */
11
+ const LINES_SHOWN = 12;
12
+ const SCROLL_HEIGHT = 240;
13
+ export function RefusalDetail({ refusal }) {
14
+ const lines = refusalLines(refusal);
15
+ if (lines.length === 0)
16
+ return null;
17
+ const said = (_jsx(VStack, { gap: 1, children: lines.map((line, index) => (_jsx(Text, { type: "supporting", color: "secondary", wordBreak: "break-word", children: line }, index))) }));
18
+ if (lines.length <= LINES_SHOWN)
19
+ return said;
20
+ return (_jsx(ScrollableArea, { label: "Details", height: SCROLL_HEIGHT, children: said }));
21
+ }
@@ -0,0 +1,9 @@
1
+ import type { StudioStore } from './lib/studio-store.ts';
2
+ /**
3
+ * The stop before a change to a value the project's files write once, or a change to a tool
4
+ * other profiles allow: who else it changes and what other code reads it, and Cancel or Change for all. Closing the dialog is
5
+ * Cancel, and no profile has the change.
6
+ */
7
+ export declare function SharedChange({ store }: {
8
+ store: StudioStore;
9
+ }): import("react").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from '@astryxdesign/core/Button';
3
+ import { CheckboxInput } from '@astryxdesign/core/CheckboxInput';
4
+ import { Dialog, DialogHeader } from '@astryxdesign/core/Dialog';
5
+ import { HStack } from '@astryxdesign/core/HStack';
6
+ import { Layout, LayoutContent, LayoutFooter } from '@astryxdesign/core/Layout';
7
+ import { useState, useSyncExternalStore } from 'react';
8
+ import { reachesOthers, sharedAsk } from "../mod.js";
9
+ import { askLine } from "./file-place.js";
10
+ const DIALOG_WIDTH = 520;
11
+ /**
12
+ * The stop before a change to a value the project's files write once, or a change to a tool
13
+ * other profiles allow: who else it changes and what other code reads it, and Cancel or Change for all. Closing the dialog is
14
+ * Cancel, and no profile has the change.
15
+ */
16
+ export function SharedChange({ store }) {
17
+ const reach = useSyncExternalStore(store.subscribe, store.getPending, store.getPending);
18
+ const [quiet, setQuiet] = useState(false);
19
+ const ask = reach && sharedAsk(reach, store.getWorkspace());
20
+ return (_jsx(Dialog, { isOpen: reach !== undefined, purpose: "form", width: DIALOG_WIDTH, onOpenChange: (isOpen) => {
21
+ if (!isOpen)
22
+ store.cancelShared();
23
+ }, children: ask && (_jsx(Layout, { header: _jsx(DialogHeader, { title: ask.title, subtitle: askLine(ask) }), content: _jsx(LayoutContent, { children: _jsx(CheckboxInput, { label: "Don't ask again this session", value: quiet, onChange: setQuiet }) }), footer: _jsx(LayoutFooter, { children: _jsxs(HStack, { gap: 2, justify: "end", children: [_jsx(Button, { label: "Cancel", variant: "ghost", onClick: () => {
24
+ store.cancelShared();
25
+ } }), _jsx(Button, { label: reachesOthers(reach) ? 'Change for all' : 'Change', variant: "primary", onClick: () => {
26
+ store.confirmShared(quiet);
27
+ } })] }) }) })) }));
28
+ }
@@ -0,0 +1,121 @@
1
+ /* One shell. While the mark draws it is the whole viewport; then that same panel moves to the shape
2
+ of the page. The scrollport size never changes — only the clip does. */
3
+ @media (width >= 768px) {
4
+ html[data-boot-pending] .astryx-app-shell,
5
+ html[data-shell-move] .astryx-app-shell {
6
+ position: relative;
7
+ height: 100dvh;
8
+ }
9
+
10
+ html[data-boot-pending] .astryx-app-shell .astryx-app-shell-sidenav,
11
+ html[data-shell-move] .astryx-app-shell .astryx-app-shell-sidenav {
12
+ position: absolute;
13
+ inset-block: 0;
14
+ inset-inline-start: 0;
15
+ z-index: 0;
16
+ width: var(--spacing-12);
17
+ transition: none;
18
+ }
19
+
20
+ html[data-boot-pending] .astryx-app-shell [role="main"],
21
+ html[data-shell-move] .astryx-app-shell [role="main"] {
22
+ position: relative;
23
+ z-index: 1;
24
+ width: 100%;
25
+ height: 100%;
26
+ max-width: none;
27
+ margin: 0;
28
+ border-radius: 0;
29
+ }
30
+
31
+ /* While the mark draws on the boot screen, the panel is the full viewport. No rail, no inset. */
32
+ html[data-boot-pending] .astryx-app-shell [role="main"] {
33
+ clip-path: none;
34
+ background: var(--color-background-surface);
35
+ transition: none;
36
+ }
37
+
38
+ /* A moving shell is one full-bleed box whose clip is the shape. open is the viewport, regular is
39
+ the panel beside the rail, frame is the same panel cut to the width of the page's own surface. */
40
+ html[data-shell-move] .astryx-app-shell [role="main"] {
41
+ background: var(--color-background-surface);
42
+ transition: clip-path 640ms cubic-bezier(0.45, 0.02, 0.15, 1);
43
+ }
44
+
45
+ html[data-shell-clip="open"] .astryx-app-shell [role="main"] {
46
+ clip-path: inset(0 round 0);
47
+ }
48
+
49
+ html[data-shell-clip="regular"] .astryx-app-shell [role="main"] {
50
+ clip-path: inset(
51
+ var(--spacing-4) var(--spacing-4) var(--spacing-4) var(--spacing-12) round var(--radius-page)
52
+ );
53
+ }
54
+
55
+ html[data-shell-clip="frame"] .astryx-app-shell [role="main"] {
56
+ clip-path: inset(
57
+ var(--spacing-4) calc(100% - var(--spacing-12) - var(--shell-frame-width, 0px))
58
+ var(--spacing-4) var(--spacing-12) round var(--radius-page)
59
+ );
60
+ }
61
+
62
+ /* The page stays out while the shell moves. It comes in once the shell has settled. */
63
+ html[data-shell-move] #astryx-app-shell-main > :not([data-boot]):not(.nav-mark) {
64
+ visibility: hidden;
65
+ }
66
+ }
67
+
68
+ html {
69
+ --shell-hold-ms: 140ms; /* keep in step with HOLD_MS in shell-motion.ts */
70
+ --shell-fade: shell-content-in 280ms cubic-bezier(0.45, 0.02, 0.15, 1);
71
+ }
72
+
73
+ @keyframes shell-content-in {
74
+ from {
75
+ opacity: 0;
76
+ }
77
+ }
78
+
79
+ /* A page that is about to leave fades out first, then the shell moves. */
80
+ html[data-shell-hold]
81
+ #astryx-app-shell-main
82
+ > :not([data-boot]):not(.nav-mark):not(:has([data-shell-frame])),
83
+ html[data-shell-hold] .shell-fade {
84
+ opacity: 0;
85
+ visibility: hidden;
86
+ transition:
87
+ opacity var(--shell-hold-ms) ease,
88
+ visibility 0s linear var(--shell-hold-ms);
89
+ }
90
+
91
+ html[data-shell-in] #astryx-app-shell-main > :not([data-boot]) {
92
+ animation: var(--shell-fade);
93
+ }
94
+
95
+ /* A framed page's surface is already in place, because the panel contracted to it. It holds still.
96
+ What is on it, and the page's other parts, name themselves with .shell-fade and fade in. */
97
+ html[data-shell-in] #astryx-app-shell-main > :has([data-shell-frame]) {
98
+ animation: none;
99
+ }
100
+
101
+ html[data-shell-in] .shell-fade {
102
+ animation: var(--shell-fade);
103
+ }
104
+
105
+ @media (prefers-reduced-motion: reduce) {
106
+ html[data-shell-hold] #astryx-app-shell-main > :not([data-boot]),
107
+ html[data-shell-hold] .shell-fade {
108
+ transition: none;
109
+ }
110
+
111
+ html[data-shell-in] #astryx-app-shell-main > :not([data-boot]),
112
+ html[data-shell-in] .shell-fade {
113
+ animation: none;
114
+ }
115
+ }
116
+
117
+ /* The contracted shape is a clip on a viewport-tall box. The frame that drops
118
+ the clip must already be the resting panel, not that tall box easing shut. */
119
+ html[data-shell-in] #astryx-app-shell-main:not(#\#):not(#\#):not(#\#):not(#\#) {
120
+ transition: none;
121
+ }
@@ -0,0 +1,73 @@
1
+ /**
2
+ * The shell is one surface. It starts as the whole viewport, where the mark draws, and moves to
3
+ * the shape of the page it opens. The website and the studio on its own both move it with this.
4
+ */
5
+ export declare function bootHasPlayed(): boolean;
6
+ /** Fired when the mark gives way, before the shell moves, so the cover attribute can drop. */
7
+ export declare const SHELL_REVEAL = "theorem-shell-reveal";
8
+ /** Fired when the shell has settled and scroll may own it again. */
9
+ export declare const SHELL_INTRO_DONE = "theorem-shell-intro-done";
10
+ /**
11
+ * The shapes the shell rests in:
12
+ * - open: the whole viewport.
13
+ * - regular: the panel beside the rail.
14
+ * - frame: the panel's start edge, as wide as the page's own surface. The studio's editor.
15
+ */
16
+ export type ShellShape = {
17
+ kind: 'open';
18
+ } | {
19
+ kind: 'regular';
20
+ } | {
21
+ kind: 'frame';
22
+ width: number;
23
+ };
24
+ export type ShellKind = ShellShape['kind'];
25
+ export declare const OPEN_SHAPE: ShellShape;
26
+ export declare const REGULAR_SHAPE: ShellShape;
27
+ /** How long content takes to fade out. Keep in step with `--shell-hold-ms` in shell-motion.css. */
28
+ export declare const HOLD_MS = 140;
29
+ /**
30
+ * The shape of a page whose shell is a surface inside the page area, measured from the page on
31
+ * screen. That surface carries `data-shell-frame`; a page without one rests in the regular shape.
32
+ */
33
+ export declare function frameShape(): ShellShape;
34
+ export declare function captureShape(shape: ShellShape): void;
35
+ export declare function hasCapturedShape(): boolean;
36
+ export declare function peekShape(): ShellShape;
37
+ /** The shape the shell is leaving, and the claim on it: the next route change starts afresh. */
38
+ export declare function takeShape(): ShellShape;
39
+ export declare function prefersReducedMotion(): boolean;
40
+ export declare function sleep(ms: number): Promise<void>;
41
+ /** The host names when something of its own holds the shell still. */
42
+ export declare function pinShellWhile(check: () => boolean): void;
43
+ /** Whether the shell can move. A narrow screen, reduced motion, and a host's pin cannot. */
44
+ export declare function shellCanMove(): boolean;
45
+ /** The mark is still up, or the shell is on its way: scroll must not move the shell yet. */
46
+ export declare function shellIntroOwnsPull(): boolean;
47
+ /** The page's content fades out and stays out until the shell settles. */
48
+ export declare function holdShell(): void;
49
+ /**
50
+ * Put the shell into move mode at the shape it is in. A route that mounts under it then finds the
51
+ * shell already drawn as a clip and cannot snap it to its own shape.
52
+ */
53
+ export declare function enterShell(from: ShellShape): void;
54
+ /**
55
+ * Move the shell from one shape to another, content hidden. If it is already moving, it carries on
56
+ * from the shape it is in. Resolves true when it arrives, false when a newer move overtook it. It
57
+ * stays in its last shape until `settleShell`, so a page that is still loading can wait on it.
58
+ */
59
+ export declare function moveShell(from: ShellShape, to: ShellShape): Promise<boolean>;
60
+ /** The shell rests. The page's content comes in at the size it will keep. */
61
+ export declare function settleShell(to: ShellShape): void;
62
+ /**
63
+ * The mark has finished but the page is still loading. The shell pulls in to the regular panel and
64
+ * waits there, page hidden, for what the loader shows on it. `revealShell` then takes it to rest.
65
+ * A shell that cannot move stays full-bleed.
66
+ */
67
+ export declare function pullShellIn(): Promise<boolean>;
68
+ /**
69
+ * The loader has finished. The page stays hidden while the shell moves to the shape of the page it
70
+ * opens, then comes in. It moves from the full-bleed shell, or from the regular panel when
71
+ * `pullShellIn` took it there. A page that rests open stays open.
72
+ */
73
+ export declare function revealShell(to: ShellShape): void;