@alecsibilia/ui-kit 0.0.0-stage → 0.1.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +201 -0
  3. package/README.md +233 -2
  4. package/bin/ui-kit.js +12 -0
  5. package/dist/alchemy/app.d.ts +34 -0
  6. package/dist/alchemy/app.js +88 -0
  7. package/dist/alchemy/index.d.ts +11 -0
  8. package/dist/alchemy/index.js +11 -0
  9. package/dist/alchemy/live-rooms.d.ts +21 -0
  10. package/dist/alchemy/live-rooms.js +31 -0
  11. package/dist/alchemy/migrations.d.ts +28 -0
  12. package/dist/alchemy/migrations.js +56 -0
  13. package/dist/alchemy/stage.d.ts +20 -0
  14. package/dist/alchemy/stage.js +20 -0
  15. package/dist/alchemy/wrangler-config.d.ts +76 -0
  16. package/dist/alchemy/wrangler-config.js +82 -0
  17. package/dist/build/app-modules.d.ts +11 -0
  18. package/dist/build/app-modules.js +40 -0
  19. package/dist/build/check.d.ts +4 -0
  20. package/dist/build/check.js +170 -0
  21. package/dist/build/cli.d.ts +1 -0
  22. package/dist/build/cli.js +79 -0
  23. package/dist/build/feature.d.ts +8 -0
  24. package/dist/build/feature.js +24 -0
  25. package/dist/build/index.d.ts +13 -0
  26. package/dist/build/index.js +13 -0
  27. package/dist/build/measure-cpu.d.ts +2 -0
  28. package/dist/build/measure-cpu.js +196 -0
  29. package/dist/build/prerender.d.ts +5 -0
  30. package/dist/build/prerender.js +109 -0
  31. package/dist/build/preview.d.ts +7 -0
  32. package/dist/build/preview.js +41 -0
  33. package/dist/build/seo-files.d.ts +27 -0
  34. package/dist/build/seo-files.js +24 -0
  35. package/dist/client/head-swap.d.ts +45 -0
  36. package/dist/client/head-swap.js +183 -0
  37. package/dist/client/hydration-pass.d.ts +56 -0
  38. package/dist/client/hydration-pass.js +186 -0
  39. package/dist/client/hydration-reset.d.ts +82 -0
  40. package/dist/client/hydration-reset.js +154 -0
  41. package/dist/client/index.d.ts +37 -0
  42. package/dist/client/index.js +65 -0
  43. package/dist/client/nav-client.d.ts +35 -0
  44. package/dist/client/nav-client.js +371 -0
  45. package/dist/live/collab/doc-provider.d.ts +74 -0
  46. package/dist/live/collab/doc-provider.js +412 -0
  47. package/dist/live/collab/index.d.ts +51 -0
  48. package/dist/live/collab/index.jsx +142 -0
  49. package/dist/live/collab-status.d.ts +25 -0
  50. package/dist/live/collab-status.js +17 -0
  51. package/dist/live/cursors/cursor-engine.d.ts +57 -0
  52. package/dist/live/cursors/cursor-engine.js +243 -0
  53. package/dist/live/cursors/index.d.ts +46 -0
  54. package/dist/live/cursors/index.jsx +110 -0
  55. package/dist/live/declaration.d.ts +113 -0
  56. package/dist/live/declaration.js +94 -0
  57. package/dist/live/index.d.ts +8 -0
  58. package/dist/live/index.js +8 -0
  59. package/dist/live/protocol.d.ts +224 -0
  60. package/dist/live/protocol.js +272 -0
  61. package/dist/live/server/doc-store.d.ts +68 -0
  62. package/dist/live/server/doc-store.js +187 -0
  63. package/dist/live/server/index.d.ts +60 -0
  64. package/dist/live/server/index.js +77 -0
  65. package/dist/live/server/room-presence.d.ts +24 -0
  66. package/dist/live/server/room-presence.js +123 -0
  67. package/dist/live/server/room-sockets.d.ts +65 -0
  68. package/dist/live/server/room-sockets.js +97 -0
  69. package/dist/live/server/room.d.ts +20 -0
  70. package/dist/live/server/room.js +348 -0
  71. package/dist/live/server/route.d.ts +56 -0
  72. package/dist/live/server/route.js +159 -0
  73. package/dist/live/server/types.d.ts +163 -0
  74. package/dist/live/server/types.js +2 -0
  75. package/dist/logic/agent-actions.d.ts +133 -0
  76. package/dist/logic/agent-actions.js +150 -0
  77. package/dist/logic/command-types.d.ts +53 -0
  78. package/dist/logic/command-types.js +0 -0
  79. package/dist/logic/dev.d.ts +9 -0
  80. package/dist/logic/dev.js +10 -0
  81. package/dist/logic/draft-rebase.d.ts +59 -0
  82. package/dist/logic/draft-rebase.js +71 -0
  83. package/dist/logic/form-state.d.ts +105 -0
  84. package/dist/logic/form-state.js +93 -0
  85. package/dist/logic/head.d.ts +145 -0
  86. package/dist/logic/head.js +140 -0
  87. package/dist/logic/index.d.ts +27 -0
  88. package/dist/logic/index.js +25 -0
  89. package/dist/logic/island-def.d.ts +89 -0
  90. package/dist/logic/island-def.js +59 -0
  91. package/dist/logic/kit-commands.d.ts +104 -0
  92. package/dist/logic/kit-commands.js +72 -0
  93. package/dist/logic/kit-errors.d.ts +25 -0
  94. package/dist/logic/kit-errors.js +6 -0
  95. package/dist/logic/listen.d.ts +99 -0
  96. package/dist/logic/listen.js +92 -0
  97. package/dist/logic/mutation-def.d.ts +65 -0
  98. package/dist/logic/mutation-def.js +43 -0
  99. package/dist/logic/navigation-data.d.ts +50 -0
  100. package/dist/logic/navigation-data.js +55 -0
  101. package/dist/logic/navigation-policy.d.ts +74 -0
  102. package/dist/logic/navigation-policy.js +127 -0
  103. package/dist/logic/page-model-def.d.ts +108 -0
  104. package/dist/logic/page-model-def.js +31 -0
  105. package/dist/logic/path.d.ts +31 -0
  106. package/dist/logic/path.js +48 -0
  107. package/dist/logic/query-def.d.ts +56 -0
  108. package/dist/logic/query-def.js +37 -0
  109. package/dist/logic/query-key.d.ts +24 -0
  110. package/dist/logic/query-key.js +35 -0
  111. package/dist/logic/query-types.d.ts +28 -0
  112. package/dist/logic/query-types.js +2 -0
  113. package/dist/logic/resources.d.ts +163 -0
  114. package/dist/logic/resources.js +62 -0
  115. package/dist/logic/result.d.ts +30 -0
  116. package/dist/logic/result.js +23 -0
  117. package/dist/logic/route-model.d.ts +139 -0
  118. package/dist/logic/route-model.js +207 -0
  119. package/dist/logic/route-params.d.ts +80 -0
  120. package/dist/logic/route-params.js +114 -0
  121. package/dist/logic/route-table.d.ts +308 -0
  122. package/dist/logic/route-table.js +206 -0
  123. package/dist/logic/seo.d.ts +61 -0
  124. package/dist/logic/seo.js +101 -0
  125. package/dist/logic/site.d.ts +12 -0
  126. package/dist/logic/site.js +0 -0
  127. package/dist/logic/subscriptions.d.ts +177 -0
  128. package/dist/logic/subscriptions.js +152 -0
  129. package/dist/render/index.d.ts +32 -0
  130. package/dist/render/index.js +52 -0
  131. package/dist/runtime/island-wake.d.ts +38 -0
  132. package/dist/runtime/island-wake.js +147 -0
  133. package/dist/runtime/query-scope.d.ts +224 -0
  134. package/dist/runtime/query-scope.js +222 -0
  135. package/dist/runtime/room-hub.d.ts +107 -0
  136. package/dist/runtime/room-hub.js +307 -0
  137. package/dist/runtime/subscription-runner.d.ts +71 -0
  138. package/dist/runtime/subscription-runner.js +240 -0
  139. package/dist/server/bindings.d.ts +41 -0
  140. package/dist/server/bindings.js +74 -0
  141. package/dist/server/browser.d.ts +9 -0
  142. package/dist/server/browser.js +9 -0
  143. package/dist/server/edge-cache.d.ts +28 -0
  144. package/dist/server/edge-cache.js +35 -0
  145. package/dist/server/errors.d.ts +45 -0
  146. package/dist/server/errors.js +36 -0
  147. package/dist/server/form-actions-setup.d.ts +1 -0
  148. package/dist/server/form-actions-setup.js +15 -0
  149. package/dist/server/form-actions.d.ts +121 -0
  150. package/dist/server/form-actions.js +211 -0
  151. package/dist/server/index.d.ts +36 -0
  152. package/dist/server/index.js +35 -0
  153. package/dist/server/inputs.d.ts +45 -0
  154. package/dist/server/inputs.js +77 -0
  155. package/dist/server/rate-limit.d.ts +29 -0
  156. package/dist/server/rate-limit.js +32 -0
  157. package/dist/server/read-cache.d.ts +74 -0
  158. package/dist/server/read-cache.js +58 -0
  159. package/dist/server/request-info.d.ts +17 -0
  160. package/dist/server/request-info.js +11 -0
  161. package/dist/server/request.d.ts +52 -0
  162. package/dist/server/request.js +73 -0
  163. package/dist/server/response-cookies.d.ts +23 -0
  164. package/dist/server/response-cookies.js +24 -0
  165. package/dist/server/run-effect.d.ts +42 -0
  166. package/dist/server/run-effect.js +92 -0
  167. package/dist/server/run.d.ts +63 -0
  168. package/dist/server/run.js +66 -0
  169. package/dist/server/session.d.ts +125 -0
  170. package/dist/server/session.js +247 -0
  171. package/dist/test/fake-bindings.d.ts +32 -0
  172. package/dist/test/fake-bindings.js +108 -0
  173. package/dist/test/fake-room.d.ts +66 -0
  174. package/dist/test/fake-room.js +216 -0
  175. package/dist/test/index.d.ts +19 -0
  176. package/dist/test/index.js +44 -0
  177. package/dist/test/probe.d.ts +11 -0
  178. package/dist/test/probe.js +11 -0
  179. package/dist/test/solid-jsx.d.ts +23 -0
  180. package/dist/test/solid-jsx.js +28 -0
  181. package/dist/test/solid-preload.d.ts +1 -0
  182. package/dist/test/solid-preload.js +29 -0
  183. package/dist/ui/code-editor/index.d.ts +21 -0
  184. package/dist/ui/code-editor/index.jsx +286 -0
  185. package/dist/ui/collab-text/index.d.ts +29 -0
  186. package/dist/ui/collab-text/index.jsx +96 -0
  187. package/dist/ui/components/controls.d.ts +69 -0
  188. package/dist/ui/components/controls.jsx +81 -0
  189. package/dist/ui/components/feedback.d.ts +26 -0
  190. package/dist/ui/components/feedback.jsx +80 -0
  191. package/dist/ui/components/layout.d.ts +74 -0
  192. package/dist/ui/components/layout.jsx +146 -0
  193. package/dist/ui/components/lists.d.ts +69 -0
  194. package/dist/ui/components/lists.jsx +133 -0
  195. package/dist/ui/components/navigation.d.ts +73 -0
  196. package/dist/ui/components/navigation.jsx +112 -0
  197. package/dist/ui/components/text.d.ts +34 -0
  198. package/dist/ui/components/text.jsx +163 -0
  199. package/dist/ui/index.d.ts +7 -0
  200. package/dist/ui/index.js +7 -0
  201. package/dist/ui/jsx-runtime.d.ts +19 -0
  202. package/dist/ui/jsx-runtime.js +0 -0
  203. package/dist/ui/list-keys.d.ts +31 -0
  204. package/dist/ui/list-keys.js +45 -0
  205. package/dist/ui/styles/base.css +38 -0
  206. package/dist/ui/styles/components.css +608 -0
  207. package/dist/ui/styles/tokens.css +27 -0
  208. package/dist/ui/styles/transitions.css +23 -0
  209. package/dist/ui/styles/workbench.css +428 -0
  210. package/dist/ui/styles.css +9 -0
  211. package/dist/view/agent-actions-view.d.ts +30 -0
  212. package/dist/view/agent-actions-view.js +27 -0
  213. package/dist/view/agent-surface.d.ts +42 -0
  214. package/dist/view/agent-surface.js +123 -0
  215. package/dist/view/app-scope.d.ts +51 -0
  216. package/dist/view/app-scope.js +75 -0
  217. package/dist/view/boundary.d.ts +18 -0
  218. package/dist/view/boundary.jsx +26 -0
  219. package/dist/view/command-runner.d.ts +16 -0
  220. package/dist/view/command-runner.js +245 -0
  221. package/dist/view/form.d.ts +82 -0
  222. package/dist/view/form.jsx +109 -0
  223. package/dist/view/head-view.d.ts +31 -0
  224. package/dist/view/head-view.js +46 -0
  225. package/dist/view/index.d.ts +41 -0
  226. package/dist/view/index.js +40 -0
  227. package/dist/view/island-root.d.ts +30 -0
  228. package/dist/view/island-root.js +36 -0
  229. package/dist/view/island.d.ts +102 -0
  230. package/dist/view/island.jsx +154 -0
  231. package/dist/view/match.d.ts +41 -0
  232. package/dist/view/match.js +111 -0
  233. package/dist/view/model.d.ts +92 -0
  234. package/dist/view/model.js +162 -0
  235. package/dist/view/navigation-head.d.ts +29 -0
  236. package/dist/view/navigation-head.jsx +38 -0
  237. package/dist/view/page-model.d.ts +46 -0
  238. package/dist/view/page-model.js +146 -0
  239. package/dist/view/query-effects.d.ts +87 -0
  240. package/dist/view/query-effects.js +147 -0
  241. package/dist/view/query-ok.d.ts +45 -0
  242. package/dist/view/query-ok.js +96 -0
  243. package/dist/view/query.d.ts +115 -0
  244. package/dist/view/query.jsx +179 -0
  245. package/dist/view/result-view.d.ts +14 -0
  246. package/dist/view/result-view.jsx +15 -0
  247. package/dist/view/route-pages.d.ts +43 -0
  248. package/dist/view/route-pages.js +59 -0
  249. package/dist/view/router.d.ts +44 -0
  250. package/dist/view/router.js +123 -0
  251. package/dist/vite/dev-middleware.d.ts +12 -0
  252. package/dist/vite/dev-middleware.js +39 -0
  253. package/dist/vite/dev-objects.d.ts +25 -0
  254. package/dist/vite/dev-objects.js +127 -0
  255. package/dist/vite/dev-platform.d.ts +19 -0
  256. package/dist/vite/dev-platform.js +77 -0
  257. package/dist/vite/dev-seo-files.d.ts +11 -0
  258. package/dist/vite/dev-seo-files.js +40 -0
  259. package/dist/vite/index.d.ts +53 -0
  260. package/dist/vite/index.js +148 -0
  261. package/dist/vite/local-config.d.ts +34 -0
  262. package/dist/vite/local-config.js +72 -0
  263. package/dist/vite/worker-build.d.ts +24 -0
  264. package/dist/vite/worker-build.js +84 -0
  265. package/dist/worker/create-worker.d.ts +52 -0
  266. package/dist/worker/create-worker.js +90 -0
  267. package/dist/worker/index.d.ts +12 -0
  268. package/dist/worker/index.js +12 -0
  269. package/dist/worker/page-routes.d.ts +88 -0
  270. package/dist/worker/page-routes.js +100 -0
  271. package/dist/worker/page-status.d.ts +41 -0
  272. package/dist/worker/page-status.js +23 -0
  273. package/dist/worker/request-prelude.d.ts +69 -0
  274. package/dist/worker/request-prelude.js +107 -0
  275. package/dist/worker/security.d.ts +76 -0
  276. package/dist/worker/security.js +137 -0
  277. package/dist/worker/server-app.d.ts +54 -0
  278. package/dist/worker/server-app.js +76 -0
  279. package/guards/browser-only.js +5 -0
  280. package/guards/node-only.js +6 -0
  281. package/guards/server-only.js +5 -0
  282. package/migrations/0001-sessions.sql +22 -0
  283. package/package.json +233 -5
@@ -0,0 +1,428 @@
1
+ /* Navigation, forms, code blocks, the workbench strip and live rooms. */
2
+ /* ---- Architecture layout grid ---- */
3
+ .ui-grid--cols-arch {
4
+ grid-template-columns: minmax(0, 1fr) 330px;
5
+ align-items: start;
6
+ }
7
+
8
+ .ui-sticky-col {
9
+ position: sticky;
10
+ top: 76px;
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: 14px;
14
+ }
15
+
16
+ @media (max-width: 1040px) {
17
+ .ui-grid--cols-arch {
18
+ grid-template-columns: minmax(0, 1fr);
19
+ }
20
+ .ui-sticky-col {
21
+ position: static;
22
+ }
23
+ }
24
+
25
+ .ui-card,
26
+ .ui-section,
27
+ .ui-stack,
28
+ .ui-grid > * {
29
+ min-width: 0;
30
+ }
31
+
32
+ /* ---- Filter Bar ---- */
33
+ .ui-filterbar {
34
+ display: flex;
35
+ flex-wrap: wrap;
36
+ align-items: center;
37
+ gap: 8px;
38
+ }
39
+
40
+ .ui-filterchip {
41
+ appearance: none;
42
+ display: inline-flex;
43
+ align-items: center;
44
+ gap: 6px;
45
+ padding: 6px 12px;
46
+ border-radius: 999px;
47
+ border: 1px solid var(--border);
48
+ background: var(--bg-surface);
49
+ color: var(--text-muted);
50
+ font-family: var(--font-sans);
51
+ font-size: 0.82rem;
52
+ font-weight: 550;
53
+ cursor: pointer;
54
+ transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
55
+ }
56
+
57
+ .ui-filterchip:hover {
58
+ color: var(--text);
59
+ border-color: var(--border-strong);
60
+ }
61
+
62
+ .ui-filterchip--active {
63
+ background: var(--accent-soft);
64
+ border-color: rgba(56, 189, 248, 0.45);
65
+ color: var(--accent);
66
+ }
67
+
68
+ .ui-filterchip-count {
69
+ font-family: var(--font-mono);
70
+ font-size: 0.72rem;
71
+ opacity: 0.85;
72
+ }
73
+
74
+ /* ---- CodeBlock & Editable CodeEditorSurface ---- */
75
+ .ui-codeblock {
76
+ border: 1px solid var(--border);
77
+ border-radius: var(--radius-md);
78
+ background: #0b0d11;
79
+ overflow: hidden;
80
+ min-width: 0;
81
+ }
82
+
83
+ .ui-codeblock--modified {
84
+ border-color: rgba(224, 169, 59, 0.55);
85
+ }
86
+
87
+ .ui-codeblock-head {
88
+ display: flex;
89
+ flex-wrap: wrap;
90
+ align-items: center;
91
+ justify-content: space-between;
92
+ gap: 8px;
93
+ padding: 8px 12px;
94
+ background: var(--bg-surface);
95
+ border-bottom: 1px solid var(--border);
96
+ }
97
+
98
+ .ui-codeblock-file {
99
+ font-family: var(--font-mono);
100
+ font-size: 0.78rem;
101
+ color: var(--text);
102
+ font-weight: 600;
103
+ overflow-wrap: anywhere;
104
+ }
105
+
106
+ .ui-codeblock-actions {
107
+ display: flex;
108
+ flex-wrap: wrap;
109
+ align-items: center;
110
+ gap: 6px;
111
+ }
112
+
113
+ .ui-codeblock-pre {
114
+ margin: 0;
115
+ padding: 10px 0;
116
+ overflow-x: auto;
117
+ font-family: var(--font-mono);
118
+ font-size: 12.5px;
119
+ line-height: 20px;
120
+ color: #e6e8ee;
121
+ tab-size: 2;
122
+ }
123
+
124
+ .ui-codeblock-line {
125
+ display: grid;
126
+ grid-template-columns: 44px minmax(0, 1fr);
127
+ padding: 0 12px 0 0;
128
+ white-space: pre;
129
+ }
130
+
131
+ .ui-codeblock-line--feedback {
132
+ background: rgba(224, 169, 59, 0.14);
133
+ box-shadow: inset 3px 0 0 #e0a93b;
134
+ color: #ffd37a;
135
+ font-weight: 700;
136
+ }
137
+
138
+ .ui-codeblock-ln {
139
+ text-align: right;
140
+ padding-right: 12px;
141
+ color: #5b6475;
142
+ user-select: none;
143
+ }
144
+
145
+ .ui-tok-kw { color: #c792ea; }
146
+ .ui-tok-str { color: #a5d6a7; }
147
+ .ui-tok-num { color: #f78c6c; }
148
+ .ui-tok-cmt { color: #6b7589; font-style: italic; }
149
+ .ui-tok-tag { color: #f07178; }
150
+
151
+ .ui-codeeditor-host {
152
+ min-width: 0;
153
+ width: 100%;
154
+ background: #0b0d11;
155
+ }
156
+
157
+ /* ---- Stepped Workbench Strip & Sticky Bottom Bar ---- */
158
+ .ui-step-strip {
159
+ display: flex;
160
+ flex-wrap: wrap;
161
+ align-items: center;
162
+ gap: 6px;
163
+ }
164
+
165
+ .ui-step-pill {
166
+ appearance: none;
167
+ display: inline-flex;
168
+ align-items: center;
169
+ gap: 6px;
170
+ padding: 5px 10px;
171
+ border-radius: var(--radius-sm);
172
+ border: 1px solid var(--border);
173
+ background: var(--bg-surface);
174
+ color: var(--text-muted);
175
+ font-family: var(--font-sans);
176
+ font-size: 0.78rem;
177
+ font-weight: 550;
178
+ cursor: pointer;
179
+ transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
180
+ }
181
+
182
+ .ui-step-pill:hover {
183
+ color: var(--text);
184
+ border-color: var(--border-strong);
185
+ background: var(--bg-muted);
186
+ }
187
+
188
+ .ui-step-pill--active {
189
+ background: var(--accent-soft);
190
+ border-color: rgba(56, 189, 248, 0.5);
191
+ color: var(--accent);
192
+ }
193
+
194
+ .ui-step-pill--feedback {
195
+ border-color: rgba(251, 191, 36, 0.45);
196
+ }
197
+
198
+ .ui-step-pill-count {
199
+ padding: 1px 6px;
200
+ border-radius: 999px;
201
+ background: var(--warning-soft);
202
+ color: var(--warning);
203
+ font-family: var(--font-mono);
204
+ font-size: 0.7rem;
205
+ font-weight: 700;
206
+ }
207
+
208
+ .ui-bottom-bar {
209
+ position: sticky;
210
+ bottom: 12px;
211
+ z-index: 35;
212
+ display: flex;
213
+ flex-wrap: wrap;
214
+ align-items: center;
215
+ justify-content: space-between;
216
+ gap: 12px;
217
+ padding: 10px 16px;
218
+ background: rgba(18, 23, 34, 0.94);
219
+ backdrop-filter: blur(10px);
220
+ border: 1px solid var(--border-strong);
221
+ border-radius: var(--radius-lg);
222
+ box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
223
+ }
224
+
225
+ .ui-bottom-bar-group {
226
+ display: flex;
227
+ flex-wrap: wrap;
228
+ align-items: center;
229
+ gap: 8px;
230
+ }
231
+
232
+ .ui-feedback-item--clickable {
233
+ appearance: none;
234
+ width: 100%;
235
+ text-align: left;
236
+ cursor: pointer;
237
+ font-family: var(--font-sans);
238
+ transition: background 140ms ease, border-color 140ms ease;
239
+ }
240
+
241
+ .ui-feedback-item--clickable:hover {
242
+ background: rgba(224, 169, 59, 0.18);
243
+ border-color: rgba(224, 169, 59, 0.55);
244
+ }
245
+
246
+ /* ---- TextArea ---- */
247
+ .ui-field {
248
+ display: flex;
249
+ flex-direction: column;
250
+ gap: 6px;
251
+ }
252
+
253
+ .ui-field-label {
254
+ font-size: 0.78rem;
255
+ font-weight: 600;
256
+ color: var(--text-muted);
257
+ text-transform: uppercase;
258
+ letter-spacing: 0.04em;
259
+ }
260
+
261
+ .ui-textarea {
262
+ width: 100%;
263
+ min-height: 84px;
264
+ resize: vertical;
265
+ padding: 9px 11px;
266
+ border-radius: var(--radius-sm);
267
+ border: 1px solid var(--border-strong);
268
+ background: #090c11;
269
+ color: var(--text);
270
+ font-family: var(--font-sans);
271
+ font-size: 0.85rem;
272
+ line-height: 1.45;
273
+ }
274
+
275
+ .ui-textarea:focus {
276
+ outline: none;
277
+ border-color: var(--accent);
278
+ }
279
+
280
+ .ui-feedback-item {
281
+ padding: 8px 10px;
282
+ border-radius: var(--radius-sm);
283
+ background: rgba(224, 169, 59, 0.1);
284
+ border: 1px solid rgba(224, 169, 59, 0.3);
285
+ display: flex;
286
+ flex-direction: column;
287
+ gap: 3px;
288
+ }
289
+
290
+ .ui-feedback-item-meta {
291
+ font-family: var(--font-mono);
292
+ font-size: 0.72rem;
293
+ color: #ffd37a;
294
+ }
295
+
296
+ .ui-feedback-item-text {
297
+ font-size: 0.82rem;
298
+ color: var(--text);
299
+ overflow-wrap: anywhere;
300
+ }
301
+
302
+ /* ---- Links, tabs, forms (round 4) ---- */
303
+ .ui-link {
304
+ color: var(--accent);
305
+ text-decoration: underline;
306
+ text-underline-offset: 2px;
307
+ }
308
+
309
+ .ui-tabs {
310
+ display: flex;
311
+ gap: 6px;
312
+ border-bottom: 1px solid var(--border);
313
+ padding-bottom: 6px;
314
+ }
315
+
316
+ .ui-tab {
317
+ padding: 6px 12px;
318
+ border-radius: var(--radius-sm);
319
+ border: 1px solid transparent;
320
+ color: var(--text-muted);
321
+ text-decoration: none;
322
+ font-size: 0.85rem;
323
+ font-weight: 550;
324
+ }
325
+
326
+ .ui-tab:hover {
327
+ color: var(--text);
328
+ background: var(--bg-surface);
329
+ border-color: var(--border);
330
+ }
331
+
332
+ .ui-tab--active {
333
+ color: var(--accent);
334
+ background: var(--accent-soft);
335
+ border-color: rgba(56, 189, 248, 0.35);
336
+ }
337
+
338
+ .ui-form {
339
+ display: flex;
340
+ flex-direction: column;
341
+ gap: 12px;
342
+ max-width: 420px;
343
+ }
344
+
345
+ .ui-form[aria-busy="true"] {
346
+ opacity: 0.85;
347
+ }
348
+
349
+ .ui-input {
350
+ width: 100%;
351
+ padding: 8px 11px;
352
+ border-radius: var(--radius-sm);
353
+ border: 1px solid var(--border-strong);
354
+ background: #090c11;
355
+ color: var(--text);
356
+ font-family: var(--font-sans);
357
+ font-size: 0.9rem;
358
+ }
359
+
360
+ .ui-input:focus {
361
+ outline: none;
362
+ border-color: var(--accent);
363
+ }
364
+
365
+ .ui-field--invalid .ui-input {
366
+ border-color: #f87171;
367
+ }
368
+
369
+ .ui-field-hint {
370
+ margin: 0;
371
+ font-size: 0.78rem;
372
+ color: var(--text-muted);
373
+ }
374
+
375
+ .ui-field-error {
376
+ margin: 0;
377
+ font-size: 0.8rem;
378
+ color: #fca5a5;
379
+ }
380
+
381
+ /* Live rooms: the cursor surface and the kit's cursor overlay (`@alecsibilia/ui-kit/live/cursors`). */
382
+ .ui-cursor-surface {
383
+ position: relative;
384
+ }
385
+
386
+ .ui-live-cursors {
387
+ position: absolute;
388
+ inset: 0;
389
+ pointer-events: none;
390
+ overflow: hidden;
391
+ z-index: 50;
392
+ }
393
+
394
+ .ui-live-cursor {
395
+ position: absolute;
396
+ top: 0;
397
+ left: 0;
398
+ will-change: transform;
399
+ transition: opacity 120ms ease;
400
+ }
401
+
402
+ .ui-live-cursor::before {
403
+ content: "";
404
+ display: block;
405
+ width: 0;
406
+ height: 0;
407
+ border-left: 7px solid hsl(var(--cursor-hue, 210) 80% 60%);
408
+ border-top: 7px solid transparent;
409
+ border-bottom: 7px solid transparent;
410
+ transform: rotate(-45deg) translate(-2px, -6px);
411
+ }
412
+
413
+ .ui-live-cursor__label {
414
+ display: inline-block;
415
+ margin-left: 10px;
416
+ padding: 1px 6px;
417
+ border-radius: 6px;
418
+ font-size: 11px;
419
+ line-height: 16px;
420
+ white-space: nowrap;
421
+ color: #0b0d11;
422
+ background: hsl(var(--cursor-hue, 210) 80% 65%);
423
+ }
424
+
425
+ /* The collaborative text editor (`@alecsibilia/ui-kit/ui/collab-text`). */
426
+ .ui-collab-text {
427
+ min-width: 0;
428
+ }
@@ -0,0 +1,9 @@
1
+ /*
2
+ * The kit's styles (`@alecsibilia/ui-kit/ui/styles.css`), imported once by
3
+ * the closed component set. Split by concern for the file size limit.
4
+ */
5
+ @import './styles/tokens.css';
6
+ @import './styles/base.css';
7
+ @import './styles/components.css';
8
+ @import './styles/workbench.css';
9
+ @import './styles/transitions.css';
@@ -0,0 +1,30 @@
1
+ import { type Element as SolidElement } from 'solid-js';
2
+ import type { AgentActions as AgentActionMap } from '../logic/agent-actions.ts';
3
+ export type { PageAgentRegistry } from './agent-surface.ts';
4
+ /**
5
+ * Publishes one panel's agent actions (draft; only when the site's `agents`
6
+ * flag is `"on"`): a manifest data block in the `<head>` (SSR, prerender)
7
+ * and, in the browser, each action on `window.ourAgentActions` and as a
8
+ * WebMCP tool (see `agent-surface.ts`).
9
+ *
10
+ * The surface's code is its own lazy chunk, loaded only when the flag is
11
+ * on: with the flag off a page ships none of it. Put it inside an island
12
+ * (a static part of the page never runs in the browser, so it could only
13
+ * publish the manifest).
14
+ *
15
+ * The flag is the same on the server and in the browser, so both sides
16
+ * create the same owners (hydration ids match).
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * <AgentActions panel="planner" actions={plannerAgent} context={props.server} send={props.send} />
21
+ * ```
22
+ */
23
+ export declare function AgentActions<Msg, Ctx>(props: {
24
+ /** The panel's name: tools are `<panel>.<action>`. */
25
+ readonly panel: string;
26
+ readonly actions: AgentActionMap<Msg, Ctx>;
27
+ /** What `toMessage` builds from (usually the panel's query value); read at call time. */
28
+ readonly context: Ctx;
29
+ readonly send: (msg: Msg) => void;
30
+ }): SolidElement;
@@ -0,0 +1,27 @@
1
+ import { createComponent, lazy } from 'solid-js';
2
+ import { useSite } from './app-scope.js';
3
+ /**
4
+ * Publishes one panel's agent actions (draft; only when the site's `agents`
5
+ * flag is `"on"`): a manifest data block in the `<head>` (SSR, prerender)
6
+ * and, in the browser, each action on `window.ourAgentActions` and as a
7
+ * WebMCP tool (see `agent-surface.ts`).
8
+ *
9
+ * The surface's code is its own lazy chunk, loaded only when the flag is
10
+ * on: with the flag off a page ships none of it. Put it inside an island
11
+ * (a static part of the page never runs in the browser, so it could only
12
+ * publish the manifest).
13
+ *
14
+ * The flag is the same on the server and in the browser, so both sides
15
+ * create the same owners (hydration ids match).
16
+ *
17
+ * @example
18
+ * ```tsx
19
+ * <AgentActions panel="planner" actions={plannerAgent} context={props.server} send={props.send} />
20
+ * ```
21
+ */
22
+ export function AgentActions(props) {
23
+ if (useSite()?.agents !== 'on')
24
+ return undefined;
25
+ const Surface = lazy(() => import('./agent-surface.js'));
26
+ return createComponent(Surface, props);
27
+ }
@@ -0,0 +1,42 @@
1
+ import { type Element as SolidElement } from 'solid-js';
2
+ import { type AgentActions as AgentActionMap, type AgentCallResult, type AgentToolDescriptor } from '../logic/agent-actions.ts';
3
+ /**
4
+ * The page's agent registry on `window` (flag on only): what an in-page
5
+ * agent, a test, or a WebMCP polyfill can list and call. Each mounted
6
+ * `<AgentActions>` adds its tools and removes them on unmount.
7
+ */
8
+ export interface PageAgentRegistry {
9
+ list(): readonly AgentToolDescriptor[];
10
+ call(name: string, input: unknown): AgentCallResult;
11
+ }
12
+ /**
13
+ * Publishes one panel's agent actions (draft; only when the site's `agents`
14
+ * flag is `"on"`):
15
+ * - SSR / prerender: a JSON data block in the `<head>`
16
+ * (`<script type="application/vnd.our.agent-actions+json" data-agent-panel>`:
17
+ * names, descriptions, effects, JSON Schemas), readable with JS off. A
18
+ * data block is not executed, so the CSP doesn't apply to it.
19
+ * - Browser, after hydration: each action on `window.ourAgentActions` and,
20
+ * where WebMCP exists, as a `modelContext` tool. A call checks the input
21
+ * against the schema, builds the Message from the panel's current
22
+ * `context` and sends it through the panel's own `send`: the agent acts
23
+ * with the user's permissions, through `update` and mutations (which the
24
+ * server validates again). Unmounting unregisters the tools.
25
+ *
26
+ * Renders nothing.
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * <AgentActions panel="planner" actions={plannerAgent} context={props.server} send={props.send} />
31
+ * ```
32
+ */
33
+ export declare function AgentSurface<Msg, Ctx>(props: {
34
+ /** The panel's name: tools are `<panel>.<action>`. */
35
+ readonly panel: string;
36
+ readonly actions: AgentActionMap<Msg, Ctx>;
37
+ /** What `toMessage` builds from (usually the panel's query value); read at call time. */
38
+ readonly context: Ctx;
39
+ readonly send: (msg: Msg) => void;
40
+ }): SolidElement;
41
+ /** The surface is this module's default export: `<AgentActions>` loads it lazily, only when the flag is on. */
42
+ export default AgentSurface;
@@ -0,0 +1,123 @@
1
+ import { isServer, useHead } from '@solidjs/web';
2
+ import { onSettled } from 'solid-js';
3
+ import { AGENT_MANIFEST_TYPE, agentToolDescriptors, runAgentAction, } from '../logic/agent-actions.js';
4
+ /** `window.ourAgentActions`, created on first use (never module state: one per page). */
5
+ function pageRegistry() {
6
+ const host = window;
7
+ if (!host.ourAgentActions) {
8
+ const entries = new Map();
9
+ host.ourAgentActions = {
10
+ entries,
11
+ list: () => [...entries.values()].map((entry) => entry.descriptor),
12
+ call: (name, input) => {
13
+ const entry = entries.get(name);
14
+ return entry
15
+ ? entry.call(input)
16
+ : {
17
+ _tag: 'Rejected',
18
+ problems: [`no action \`${name}\` on this page`],
19
+ };
20
+ },
21
+ };
22
+ }
23
+ return host.ourAgentActions.entries;
24
+ }
25
+ function modelContext() {
26
+ const fromDocument = document.modelContext;
27
+ const fromNavigator = navigator.modelContext;
28
+ return fromDocument ?? fromNavigator;
29
+ }
30
+ /** WebMCP tool names: letters, digits, `_`, `-`, `.` (we use `panel.action`). */
31
+ const webMcpName = (name) => name.replace(/[^A-Za-z0-9_.-]/g, '_');
32
+ /**
33
+ * Publishes one panel's agent actions (draft; only when the site's `agents`
34
+ * flag is `"on"`):
35
+ * - SSR / prerender: a JSON data block in the `<head>`
36
+ * (`<script type="application/vnd.our.agent-actions+json" data-agent-panel>`:
37
+ * names, descriptions, effects, JSON Schemas), readable with JS off. A
38
+ * data block is not executed, so the CSP doesn't apply to it.
39
+ * - Browser, after hydration: each action on `window.ourAgentActions` and,
40
+ * where WebMCP exists, as a `modelContext` tool. A call checks the input
41
+ * against the schema, builds the Message from the panel's current
42
+ * `context` and sends it through the panel's own `send`: the agent acts
43
+ * with the user's permissions, through `update` and mutations (which the
44
+ * server validates again). Unmounting unregisters the tools.
45
+ *
46
+ * Renders nothing.
47
+ *
48
+ * @example
49
+ * ```tsx
50
+ * <AgentActions panel="planner" actions={plannerAgent} context={props.server} send={props.send} />
51
+ * ```
52
+ */
53
+ export function AgentSurface(props) {
54
+ const panel = props.panel;
55
+ const descriptors = agentToolDescriptors(panel, props.actions);
56
+ useHead({
57
+ tag: 'script',
58
+ key: `agent-actions:${panel}`,
59
+ props: {
60
+ type: AGENT_MANIFEST_TYPE,
61
+ 'data-agent-panel': panel,
62
+ children: JSON.stringify({ panel, tools: descriptors }),
63
+ },
64
+ });
65
+ onSettled(() => {
66
+ if (isServer)
67
+ return;
68
+ const registry = pageRegistry();
69
+ const controller = new AbortController();
70
+ const webMcp = modelContext();
71
+ const handles = [];
72
+ for (const descriptor of descriptors) {
73
+ const spec = props.actions[descriptor.name.slice(panel.length + 1)];
74
+ const call = (input) => runAgentAction(spec, input, props.context, props.send);
75
+ registry.set(descriptor.name, { descriptor, call });
76
+ if (webMcp) {
77
+ try {
78
+ const handle = webMcp.registerTool({
79
+ name: webMcpName(descriptor.name),
80
+ description: descriptor.description,
81
+ inputSchema: descriptor.inputSchema,
82
+ annotations: {
83
+ readOnlyHint: descriptor.effect === 'read',
84
+ consequentialHint: descriptor.effect === 'write',
85
+ untrustedContentHint: false,
86
+ },
87
+ execute: async (input) => {
88
+ const result = call(input);
89
+ // MCP tool-result shape; a rejected input is a tool error the model can read and retry.
90
+ return {
91
+ content: [
92
+ {
93
+ type: 'text',
94
+ text: JSON.stringify(result),
95
+ },
96
+ ],
97
+ isError: result._tag === 'Rejected',
98
+ };
99
+ },
100
+ }, { signal: controller.signal });
101
+ handle?.then?.(undefined, (error) => console.warn(`[agent] WebMCP registerTool(${descriptor.name}) rejected`, error));
102
+ handles.push(handle);
103
+ }
104
+ catch (error) {
105
+ console.warn(`[agent] WebMCP registerTool(${descriptor.name}) failed`, error);
106
+ }
107
+ }
108
+ }
109
+ return () => {
110
+ controller.abort();
111
+ // Earlier WebMCP drafts returned `{ unregister() }` instead of taking a signal.
112
+ for (const handle of handles) {
113
+ ;
114
+ handle?.unregister?.();
115
+ }
116
+ for (const descriptor of descriptors)
117
+ registry.delete(descriptor.name);
118
+ };
119
+ });
120
+ return undefined;
121
+ }
122
+ /** The surface is this module's default export: `<AgentActions>` loads it lazily, only when the flag is on. */
123
+ export default AgentSurface;
@@ -0,0 +1,51 @@
1
+ import { type Element as SolidElement } from 'solid-js';
2
+ import type { SiteSettings } from '../logic/site.ts';
3
+ import { type KitScope } from '../runtime/query-scope.ts';
4
+ export type { AgentSurfaceFlag, SiteSettings } from '../logic/site.ts';
5
+ /**
6
+ * The page root. Wrap the app once (inside the root component, so it is
7
+ * created per SSR request — never shared across requests through module
8
+ * state). Everything inside renders as static server HTML
9
+ * (`<NoHydration>`): only `<Island of={...}>` roots ship JS and hydrate
10
+ * (see `island.tsx`); the browser never renders the app root itself.
11
+ *
12
+ * Provides:
13
+ * - the site's head defaults and agent-surface flag (`site`), read by the
14
+ * route pages' head, `<Head>` and `<AgentActions>`;
15
+ * - Way 1 shared reads: `<Query>`s with the same registry query, input and
16
+ * revision share one execution (one server call) while any of them holds it.
17
+ * - Way 2 outcome channel: `<Query>` publishes each settled outcome by
18
+ * registry query name; `createModel({ listens })` turns them into Messages.
19
+ * - page models (`usePageModel`): one instance per definition per page.
20
+ *
21
+ * In the browser the island client entry (`startIslands`) creates one
22
+ * scope per page and gives it to every island root, so islands share
23
+ * reads, outcomes, invalidations and page models.
24
+ *
25
+ * @example
26
+ * ```tsx
27
+ * export default function App() {
28
+ * return <AppScope site={siteSettings}><Page>...</Page></AppScope>;
29
+ * }
30
+ * ```
31
+ */
32
+ export declare function AppScope(props: {
33
+ /** Site head defaults and the agent-surface flag (`src/site.ts`). */
34
+ readonly site?: SiteSettings;
35
+ readonly children: SolidElement;
36
+ }): SolidElement;
37
+ /**
38
+ * Kit-internal: the scope and site contexts, without `<NoHydration>`. The
39
+ * page root (`AppScope`) and every island root (`IslandBody`, on the server
40
+ * inside `<Hydration>`, in the browser under `hydrate`) render it, so both
41
+ * sides create the same owners.
42
+ */
43
+ export declare function ScopeProviders(props: {
44
+ readonly scope: KitScope;
45
+ readonly site: SiteSettings | null;
46
+ readonly children: SolidElement;
47
+ }): SolidElement;
48
+ /** The nearest `<AppScope site>`'s settings, or `null`. Kit-internal. */
49
+ export declare function useSite(): SiteSettings | null;
50
+ /** The nearest `<AppScope>`'s scope, or `null` outside one. Kit-internal. */
51
+ export declare function useKitScope(): KitScope | null;