@soederpop/luca 0.0.6 → 0.0.8

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 (208) hide show
  1. package/CLAUDE.md +10 -1
  2. package/RUNME.md +56 -0
  3. package/bun.lock +1 -1
  4. package/commands/build-bootstrap.ts +78 -0
  5. package/commands/build-scaffolds.ts +24 -2
  6. package/commands/try-all-challenges.ts +543 -0
  7. package/commands/try-challenge.ts +100 -0
  8. package/docs/README.md +52 -80
  9. package/docs/TABLE-OF-CONTENTS.md +82 -51
  10. package/docs/apis/clients/elevenlabs.md +232 -8
  11. package/docs/apis/clients/graph.md +59 -8
  12. package/docs/apis/clients/openai.md +362 -2
  13. package/docs/apis/clients/rest.md +122 -2
  14. package/docs/apis/clients/websocket.md +71 -17
  15. package/docs/apis/features/agi/assistant.md +9 -3
  16. package/docs/apis/features/agi/assistants-manager.md +2 -2
  17. package/docs/apis/features/agi/claude-code.md +153 -14
  18. package/docs/apis/features/agi/conversation-history.md +15 -3
  19. package/docs/apis/features/agi/conversation.md +133 -20
  20. package/docs/apis/features/agi/openai-codex.md +90 -12
  21. package/docs/apis/features/agi/skills-library.md +23 -5
  22. package/docs/apis/features/node/container-link.md +59 -0
  23. package/docs/apis/features/node/content-db.md +1 -1
  24. package/docs/apis/features/node/disk-cache.md +1 -1
  25. package/docs/apis/features/node/dns.md +1 -0
  26. package/docs/apis/features/node/docker.md +2 -1
  27. package/docs/apis/features/node/esbuild.md +4 -3
  28. package/docs/apis/features/node/file-manager.md +13 -4
  29. package/docs/apis/features/node/fs.md +726 -171
  30. package/docs/apis/features/node/git.md +1 -0
  31. package/docs/apis/features/node/google-auth.md +23 -4
  32. package/docs/apis/features/node/google-calendar.md +14 -2
  33. package/docs/apis/features/node/google-docs.md +15 -2
  34. package/docs/apis/features/node/google-drive.md +21 -3
  35. package/docs/apis/features/node/google-sheets.md +14 -2
  36. package/docs/apis/features/node/grep.md +2 -0
  37. package/docs/apis/features/node/helpers.md +29 -0
  38. package/docs/apis/features/node/ink.md +2 -2
  39. package/docs/apis/features/node/networking.md +39 -4
  40. package/docs/apis/features/node/os.md +28 -0
  41. package/docs/apis/features/node/postgres.md +26 -4
  42. package/docs/apis/features/node/proc.md +37 -28
  43. package/docs/apis/features/node/process-manager.md +33 -5
  44. package/docs/apis/features/node/repl.md +1 -1
  45. package/docs/apis/features/node/runpod.md +1 -0
  46. package/docs/apis/features/node/secure-shell.md +7 -0
  47. package/docs/apis/features/node/semantic-search.md +12 -5
  48. package/docs/apis/features/node/sqlite.md +26 -4
  49. package/docs/apis/features/node/telegram.md +30 -5
  50. package/docs/apis/features/node/tts.md +17 -2
  51. package/docs/apis/features/node/ui.md +1 -1
  52. package/docs/apis/features/node/vault.md +4 -9
  53. package/docs/apis/features/node/vm.md +3 -12
  54. package/docs/apis/features/node/window-manager.md +128 -20
  55. package/docs/apis/features/web/asset-loader.md +13 -1
  56. package/docs/apis/features/web/container-link.md +59 -0
  57. package/docs/apis/features/web/esbuild.md +4 -3
  58. package/docs/apis/features/web/helpers.md +29 -0
  59. package/docs/apis/features/web/network.md +16 -2
  60. package/docs/apis/features/web/speech.md +16 -2
  61. package/docs/apis/features/web/vault.md +4 -9
  62. package/docs/apis/features/web/vm.md +3 -12
  63. package/docs/apis/features/web/voice.md +18 -1
  64. package/docs/apis/servers/express.md +18 -2
  65. package/docs/apis/servers/mcp.md +29 -4
  66. package/docs/apis/servers/websocket.md +34 -6
  67. package/docs/bootstrap/CLAUDE.md +100 -0
  68. package/docs/bootstrap/SKILL.md +222 -0
  69. package/docs/bootstrap/templates/about-command.ts +41 -0
  70. package/docs/bootstrap/templates/docs-models.ts +22 -0
  71. package/docs/bootstrap/templates/docs-readme.md +43 -0
  72. package/docs/bootstrap/templates/example-feature.ts +53 -0
  73. package/docs/bootstrap/templates/health-endpoint.ts +15 -0
  74. package/docs/bootstrap/templates/luca-cli.ts +25 -0
  75. package/docs/bootstrap/templates/runme.md +54 -0
  76. package/docs/challenges/caching-proxy.md +16 -0
  77. package/docs/challenges/content-db-round-trip.md +14 -0
  78. package/docs/challenges/custom-command.md +9 -0
  79. package/docs/challenges/file-watcher-pipeline.md +11 -0
  80. package/docs/challenges/grep-audit-report.md +15 -0
  81. package/docs/challenges/multi-feature-dashboard.md +14 -0
  82. package/docs/challenges/process-orchestrator.md +17 -0
  83. package/docs/challenges/rest-api-server-with-client.md +12 -0
  84. package/docs/challenges/script-runner-with-vm.md +11 -0
  85. package/docs/challenges/simple-rest-api.md +15 -0
  86. package/docs/challenges/websocket-serve-and-client.md +11 -0
  87. package/docs/challenges/yaml-config-system.md +14 -0
  88. package/docs/command-system-overhaul.md +94 -0
  89. package/docs/examples/assistant/CORE.md +18 -0
  90. package/docs/examples/assistant/hooks.ts +3 -0
  91. package/docs/examples/assistant/tools.ts +10 -0
  92. package/docs/examples/window-manager-layouts.md +180 -0
  93. package/docs/in-memory-fs.md +4 -0
  94. package/docs/models.ts +13 -10
  95. package/docs/philosophy.md +4 -3
  96. package/docs/reports/console-hmr-design.md +170 -0
  97. package/docs/reports/helper-semantic-search.md +72 -0
  98. package/docs/scaffolds/client.md +29 -20
  99. package/docs/scaffolds/command.md +64 -50
  100. package/docs/scaffolds/endpoint.md +31 -36
  101. package/docs/scaffolds/feature.md +28 -18
  102. package/docs/scaffolds/selector.md +91 -0
  103. package/docs/scaffolds/server.md +18 -9
  104. package/docs/selectors.md +115 -0
  105. package/docs/sessions/custom-command/attempt-log-2.md +195 -0
  106. package/docs/sessions/file-watcher-pipeline/attempt-log-1.md +728 -0
  107. package/docs/sessions/file-watcher-pipeline/attempt-log-2.md +555 -0
  108. package/docs/sessions/grep-audit-report/attempt-log-1.md +289 -0
  109. package/docs/sessions/multi-feature-dashboard/attempt-log-2.md +679 -0
  110. package/docs/sessions/rest-api-server-with-client/attempt-log-1.md +1 -0
  111. package/docs/sessions/rest-api-server-with-client/attempt-log-3.md +920 -0
  112. package/docs/sessions/simple-rest-api/attempt-log-1.md +593 -0
  113. package/docs/sessions/websocket-serve-and-client/attempt-log-2.md +995 -0
  114. package/docs/tutorials/00-bootstrap.md +148 -0
  115. package/docs/tutorials/07-endpoints.md +7 -7
  116. package/docs/tutorials/08-commands.md +153 -72
  117. package/luca.cli.ts +3 -0
  118. package/package.json +6 -5
  119. package/public/index.html +1430 -0
  120. package/scripts/examples/using-ollama.ts +2 -1
  121. package/scripts/update-introspection-data.ts +2 -2
  122. package/src/agi/endpoints/experts.ts +1 -1
  123. package/src/agi/features/assistant.ts +7 -0
  124. package/src/agi/features/assistants-manager.ts +5 -5
  125. package/src/agi/features/claude-code.ts +263 -3
  126. package/src/agi/features/conversation-history.ts +7 -1
  127. package/src/agi/features/conversation.ts +26 -3
  128. package/src/agi/features/openai-codex.ts +26 -2
  129. package/src/agi/features/openapi.ts +6 -1
  130. package/src/agi/features/skills-library.ts +9 -1
  131. package/src/bootstrap/generated.ts +595 -0
  132. package/src/cli/cli.ts +64 -21
  133. package/src/client.ts +23 -357
  134. package/src/clients/civitai/index.ts +1 -1
  135. package/src/clients/client-template.ts +1 -1
  136. package/src/clients/comfyui/index.ts +13 -2
  137. package/src/clients/elevenlabs/index.ts +2 -1
  138. package/src/clients/graph.ts +87 -0
  139. package/src/clients/openai/index.ts +10 -1
  140. package/src/clients/rest.ts +207 -0
  141. package/src/clients/websocket.ts +176 -0
  142. package/src/command.ts +281 -34
  143. package/src/commands/bootstrap.ts +185 -0
  144. package/src/commands/chat.ts +5 -4
  145. package/src/commands/describe.ts +341 -4
  146. package/src/commands/help.ts +35 -9
  147. package/src/commands/index.ts +3 -0
  148. package/src/commands/introspect.ts +92 -2
  149. package/src/commands/prompt.ts +5 -6
  150. package/src/commands/run.ts +75 -10
  151. package/src/commands/save-api-docs.ts +49 -0
  152. package/src/commands/scaffold.ts +169 -23
  153. package/src/commands/select.ts +94 -0
  154. package/src/commands/serve.ts +10 -1
  155. package/src/container.ts +15 -0
  156. package/src/endpoint.ts +19 -0
  157. package/src/graft.ts +181 -0
  158. package/src/introspection/generated.agi.ts +12458 -8968
  159. package/src/introspection/generated.node.ts +10573 -7145
  160. package/src/introspection/generated.web.ts +1 -1
  161. package/src/introspection/index.ts +26 -0
  162. package/src/node/container.ts +6 -7
  163. package/src/node/features/content-db.ts +49 -2
  164. package/src/node/features/disk-cache.ts +16 -9
  165. package/src/node/features/dns.ts +16 -3
  166. package/src/node/features/docker.ts +16 -4
  167. package/src/node/features/esbuild.ts +22 -2
  168. package/src/node/features/file-manager.ts +184 -29
  169. package/src/node/features/fs.ts +704 -248
  170. package/src/node/features/git.ts +21 -8
  171. package/src/node/features/grep.ts +23 -3
  172. package/src/node/features/helpers.ts +372 -43
  173. package/src/node/features/networking.ts +39 -4
  174. package/src/node/features/opener.ts +28 -15
  175. package/src/node/features/os.ts +76 -0
  176. package/src/node/features/port-exposer.ts +11 -1
  177. package/src/node/features/postgres.ts +17 -1
  178. package/src/node/features/proc.ts +4 -1
  179. package/src/node/features/python.ts +63 -14
  180. package/src/node/features/repl.ts +11 -7
  181. package/src/node/features/runpod.ts +16 -3
  182. package/src/node/features/secure-shell.ts +27 -2
  183. package/src/node/features/semantic-search.ts +12 -1
  184. package/src/node/features/ui.ts +5 -69
  185. package/src/node/features/vm.ts +17 -0
  186. package/src/node/features/window-manager.ts +68 -20
  187. package/src/node.ts +5 -0
  188. package/src/scaffolds/generated.ts +492 -290
  189. package/src/scaffolds/template.ts +9 -0
  190. package/src/schemas/base.ts +46 -5
  191. package/src/selector.ts +282 -0
  192. package/src/server.ts +11 -0
  193. package/src/servers/express.ts +27 -12
  194. package/src/servers/socket.ts +45 -11
  195. package/src/web/clients/socket.ts +4 -1
  196. package/src/web/container.ts +2 -1
  197. package/src/web/features/network.ts +7 -1
  198. package/src/web/features/voice-recognition.ts +16 -1
  199. package/test/clients-servers.test.ts +2 -1
  200. package/test/command.test.ts +267 -0
  201. package/test/vm-context.test.ts +146 -0
  202. package/test-integration/assistants-manager.test.ts +10 -20
  203. package/docs/apis/features/node/launcher-app-command-listener.md +0 -145
  204. package/docs/examples/launcher-app-command-listener.md +0 -120
  205. package/docs/tasks/web-container-helper-discovery.md +0 -71
  206. package/docs/todos.md +0 -1
  207. package/scripts/test-command-listener.ts +0 -123
  208. package/src/node/features/launcher-app-command-listener.ts +0 -389
@@ -122,25 +122,47 @@ db.close()
122
122
 
123
123
  ### query
124
124
 
125
- Event emitted by Sqlite
125
+ Emitted after a SELECT-like query completes successfully
126
+
127
+ **Event Arguments:**
128
+
129
+ | Name | Type | Description |
130
+ |------|------|-------------|
131
+ | `arg0` | `string` | The SQL query text that was executed |
132
+ | `arg1` | `array` | Bound parameter values |
133
+ | `arg2` | `number` | Number of rows returned |
126
134
 
127
135
 
128
136
 
129
137
  ### error
130
138
 
131
- Event emitted by Sqlite
139
+ Emitted when a SQL operation fails
140
+
141
+ **Event Arguments:**
142
+
143
+ | Name | Type | Description |
144
+ |------|------|-------------|
145
+ | `arg0` | `any` | The error that occurred |
132
146
 
133
147
 
134
148
 
135
149
  ### execute
136
150
 
137
- Event emitted by Sqlite
151
+ Emitted after a write/update/delete statement completes successfully
152
+
153
+ **Event Arguments:**
154
+
155
+ | Name | Type | Description |
156
+ |------|------|-------------|
157
+ | `arg0` | `string` | The SQL statement text that was executed |
158
+ | `arg1` | `array` | Bound parameter values |
159
+ | `arg2` | `number` | Number of rows changed |
138
160
 
139
161
 
140
162
 
141
163
  ### closed
142
164
 
143
- Event emitted by Sqlite
165
+ Emitted when the database connection is closed
144
166
 
145
167
 
146
168
 
@@ -189,31 +189,56 @@ Print a diagnostic summary of the bot's current state.
189
189
 
190
190
  ### stopped
191
191
 
192
- Event emitted by Telegram
192
+ Bot stopped
193
193
 
194
194
 
195
195
 
196
196
  ### command
197
197
 
198
- Event emitted by Telegram
198
+ Command triggered: [name, Context]
199
+
200
+ **Event Arguments:**
201
+
202
+ | Name | Type | Description |
203
+ |------|------|-------------|
204
+ | `arg0` | `string` | |
205
+ | `arg1` | `any` | |
199
206
 
200
207
 
201
208
 
202
209
  ### started
203
210
 
204
- Event emitted by Telegram
211
+ Bot started receiving updates
212
+
213
+ **Event Arguments:**
214
+
215
+ | Name | Type | Description |
216
+ |------|------|-------------|
217
+ | `mode` | `string` | |
205
218
 
206
219
 
207
220
 
208
221
  ### webhook_ready
209
222
 
210
- Event emitted by Telegram
223
+ Webhook registered and ready
224
+
225
+ **Event Arguments:**
226
+
227
+ | Name | Type | Description |
228
+ |------|------|-------------|
229
+ | `arg0` | `string` | |
211
230
 
212
231
 
213
232
 
214
233
  ### error
215
234
 
216
- Event emitted by Telegram
235
+ Error occurred
236
+
237
+ **Event Arguments:**
238
+
239
+ | Name | Type | Description |
240
+ |------|------|-------------|
241
+ | `arg0` | `any` | |
217
242
 
218
243
 
219
244
 
@@ -69,13 +69,28 @@ const path = await tts.synthesize('Hello world', {
69
69
 
70
70
  ### synthesized
71
71
 
72
- Event emitted by TTS
72
+ Emitted when audio synthesis completes
73
+
74
+ **Event Arguments:**
75
+
76
+ | Name | Type | Description |
77
+ |------|------|-------------|
78
+ | `arg0` | `string` | The text that was synthesized |
79
+ | `arg1` | `string` | Path to the generated audio file |
80
+ | `arg2` | `string` | Voice used |
81
+ | `arg3` | `number` | Duration of the API call in milliseconds |
73
82
 
74
83
 
75
84
 
76
85
  ### error
77
86
 
78
- Event emitted by TTS
87
+ Emitted when synthesis fails
88
+
89
+ **Event Arguments:**
90
+
91
+ | Name | Type | Description |
92
+ |------|------|-------------|
93
+ | `arg0` | `any` | The error |
79
94
 
80
95
 
81
96
 
@@ -1,6 +1,6 @@
1
1
  # UI (features.ui)
2
2
 
3
- UI Feature - Interactive Terminal User Interface Builder This feature provides comprehensive tools for creating beautiful, interactive terminal experiences. It combines several popular libraries (chalk, figlet, inquirer) into a unified interface for building professional CLI applications with colors, ASCII art, and interactive prompts. **Core Capabilities:** - Rich color management using chalk library - ASCII art generation with multiple fonts - Interactive prompts and wizards - Automatic color assignment for consistent theming - Text padding and formatting utilities - Gradient text effects (horizontal and vertical) - Banner creation with styled ASCII art **Color System:** - Full chalk API access for complex styling - Automatic color assignment with palette cycling - Consistent color mapping for named entities - Support for hex colors and gradients **ASCII Art Features:** - Multiple font options via figlet - Automatic font discovery and caching - Banner creation with color gradients - Text styling and effects **Interactive Elements:** - Wizard creation with inquirer integration - External editor integration - User input validation and processing **Usage Examples:** **Basic Colors:** ```typescript const ui = container.feature('ui'); // Direct color usage ui.print.red('Error message'); ui.print.green('Success!'); // Complex styling console.log(ui.colors.blue.bold.underline('Important text')); ``` **ASCII Art Banners:** ```typescript const banner = ui.banner('MyApp', { font: 'Big', colors: ['red', 'white', 'blue'] }); console.log(banner); ``` **Interactive Wizards:** ```typescript const answers = await ui.wizard([ { type: 'input', name: 'name', message: 'Your name?' }, { type: 'confirm', name: 'continue', message: 'Continue?' } ]); ``` **Automatic Color Assignment:** ```typescript const userColor = ui.assignColor('john'); const adminColor = ui.assignColor('admin'); console.log(userColor('John\'s message')); console.log(adminColor('Admin notice')); ```
3
+ UI Feature - Interactive Terminal User Interface Builder Unified interface for building professional CLI experiences using chalk (colors/styles), figlet (ASCII art), and inquirer (interactive prompts). Provides rich color management, automatic color assignment, text gradients, banner generation, padding utilities, markdown rendering, and interactive wizards.
4
4
 
5
5
  ## Usage
6
6
 
@@ -1,6 +1,6 @@
1
1
  # WebVault (features.vault)
2
2
 
3
- WebVault helper
3
+ AES-256-GCM encryption and decryption for the browser using the Web Crypto API. Generates or accepts a secret key and provides `encrypt()` / `decrypt()` methods that work entirely client-side. Keys are stored as base64-encoded state so they can persist across sessions when needed.
4
4
 
5
5
  ## Usage
6
6
 
@@ -52,13 +52,8 @@ container.feature('vault')
52
52
 
53
53
  ```ts
54
54
  const vault = container.feature('vault')
55
-
56
- // Encrypt sensitive data
57
- const encrypted = vault.encrypt('sensitive information')
58
- console.log(encrypted) // Base64 encoded encrypted data
59
-
60
- // Decrypt the data
61
- const decrypted = vault.decrypt(encrypted)
62
- console.log(decrypted) // 'sensitive information'
55
+ const encrypted = await vault.encrypt('secret data')
56
+ const decrypted = await vault.decrypt(encrypted)
57
+ console.log(decrypted) // 'secret data'
63
58
  ```
64
59
 
@@ -1,6 +1,6 @@
1
1
  # VM (features.vm)
2
2
 
3
- The VM features providers a virtual machine for executing JavaScript code in a sandboxed environment. The Vm feature automatically injects the container.context object into the global scope, so these things can be referenced in the code and the code can use anything provided by the container.
3
+ Sandboxed JavaScript execution environment for the browser. Automatically injects the container's context object into the global scope, so evaluated code can use anything provided by the container. Useful for live code playgrounds, plugin systems, and dynamic script evaluation.
4
4
 
5
5
  ## Usage
6
6
 
@@ -69,16 +69,7 @@ container.feature('vm', {
69
69
 
70
70
  ```ts
71
71
  const vm = container.feature('vm')
72
-
73
- // Execute simple code
74
- const result = vm.run('1 + 2 + 3')
75
- console.log(result) // 6
76
-
77
- // Execute code with custom context
78
- const result2 = vm.run('greeting + " " + name', {
79
- greeting: 'Hello',
80
- name: 'World'
81
- })
82
- console.log(result2) // 'Hello World'
72
+ const result = vm.run('1 + 2 + 3') // 6
73
+ const greeting = vm.run('container.uuid') // accesses container globals
83
74
  ```
84
75
 
@@ -74,10 +74,10 @@ Spawn a new native browser window. Sends a window dispatch to the app and waits
74
74
  | Property | Type | Description |
75
75
  |----------|------|-------------|
76
76
  | `url` | `string` | |
77
- | `width` | `number` | |
78
- | `height` | `number` | |
79
- | `x` | `number` | |
80
- | `y` | `number` | |
77
+ | `width` | `DimensionValue` | |
78
+ | `height` | `DimensionValue` | |
79
+ | `x` | `DimensionValue` | |
80
+ | `y` | `DimensionValue` | |
81
81
  | `alwaysOnTop` | `boolean` | |
82
82
  | `window` | `{
83
83
  decorations?: 'normal' | 'hiddenTitleBar' | 'none'
@@ -88,7 +88,7 @@ Spawn a new native browser window. Sends a window dispatch to the app and waits
88
88
  clickThrough?: boolean
89
89
  }` | |
90
90
 
91
- **Returns:** `Promise<WindowAckResult>`
91
+ **Returns:** `Promise<WindowHandle>`
92
92
 
93
93
 
94
94
 
@@ -113,13 +113,13 @@ Spawn a native terminal window running a command. The terminal is read-only —
113
113
  | `cols` | `number` | Initial terminal columns. |
114
114
  | `rows` | `number` | Initial terminal rows. |
115
115
  | `title` | `string` | Window title. |
116
- | `width` | `number` | Window width in points. |
117
- | `height` | `number` | Window height in points. |
118
- | `x` | `number` | Window x position. |
119
- | `y` | `number` | Window y position. |
116
+ | `width` | `DimensionValue` | Window width in points. |
117
+ | `height` | `DimensionValue` | Window height in points. |
118
+ | `x` | `DimensionValue` | Window x position. |
119
+ | `y` | `DimensionValue` | Window y position. |
120
120
  | `window` | `SpawnOptions['window']` | Chrome options (decorations, alwaysOnTop, etc.) |
121
121
 
122
- **Returns:** `Promise<WindowAckResult>`
122
+ **Returns:** `Promise<WindowHandle>`
123
123
 
124
124
 
125
125
 
@@ -227,7 +227,7 @@ Record a video from a window to disk.
227
227
 
228
228
  ### window
229
229
 
230
- Get a WindowHandle for chainable operations on a specific window.
230
+ Get a WindowHandle for chainable operations on a specific window. Returns the tracked handle if one exists, otherwise creates a new one.
231
231
 
232
232
  **Parameters:**
233
233
 
@@ -239,6 +239,49 @@ Get a WindowHandle for chainable operations on a specific window.
239
239
 
240
240
 
241
241
 
242
+ ### spawnLayout
243
+
244
+ Spawn multiple windows in parallel from a layout configuration. Returns handles in the same order as the config entries.
245
+
246
+ **Parameters:**
247
+
248
+ | Name | Type | Required | Description |
249
+ |------|------|----------|-------------|
250
+ | `config` | `LayoutEntry[]` | ✓ | Array of layout entries (window or tty) |
251
+
252
+ **Returns:** `Promise<WindowHandle[]>`
253
+
254
+ ```ts
255
+ const handles = await wm.spawnLayout([
256
+ { type: 'window', url: 'https://google.com', width: 800, height: 600 },
257
+ { type: 'tty', command: 'htop' },
258
+ { url: 'https://github.com' }, // defaults to window
259
+ ])
260
+ ```
261
+
262
+
263
+
264
+ ### spawnLayouts
265
+
266
+ Spawn multiple layouts sequentially. Each layout's windows spawn in parallel, but the next layout waits for the previous one to fully complete.
267
+
268
+ **Parameters:**
269
+
270
+ | Name | Type | Required | Description |
271
+ |------|------|----------|-------------|
272
+ | `configs` | `LayoutEntry[][]` | ✓ | Array of layout configurations |
273
+
274
+ **Returns:** `Promise<WindowHandle[][]>`
275
+
276
+ ```ts
277
+ const [firstBatch, secondBatch] = await wm.spawnLayouts([
278
+ [{ url: 'https://google.com' }, { url: 'https://github.com' }],
279
+ [{ type: 'tty', command: 'htop' }],
280
+ ])
281
+ ```
282
+
283
+
284
+
242
285
  ### send
243
286
 
244
287
  Write an NDJSON message to the connected app client. Public so other features can send arbitrary protocol messages over the same socket.
@@ -264,43 +307,85 @@ Write an NDJSON message to the connected app client. Public so other features ca
264
307
 
265
308
  ### listening
266
309
 
267
- Event emitted by WindowManager
310
+ Emitted when the IPC server starts listening
268
311
 
269
312
 
270
313
 
271
314
  ### clientConnected
272
315
 
273
- Event emitted by WindowManager
316
+ Emitted when the native app connects
317
+
318
+ **Event Arguments:**
319
+
320
+ | Name | Type | Description |
321
+ |------|------|-------------|
322
+ | `arg0` | `any` | The client socket |
274
323
 
275
324
 
276
325
 
277
326
  ### clientDisconnected
278
327
 
279
- Event emitted by WindowManager
328
+ Emitted when the native app disconnects
280
329
 
281
330
 
282
331
 
283
332
  ### windowAck
284
333
 
285
- Event emitted by WindowManager
334
+ Emitted when a window ack is received from the app
335
+
336
+ **Event Arguments:**
337
+
338
+ | Name | Type | Description |
339
+ |------|------|-------------|
340
+ | `arg0` | `any` | The window ack payload |
286
341
 
287
342
 
288
343
 
289
344
  ### windowClosed
290
345
 
291
- Event emitted by WindowManager
346
+ Emitted when the native app reports a window closed event
347
+
348
+ **Event Arguments:**
349
+
350
+ | Name | Type | Description |
351
+ |------|------|-------------|
352
+ | `arg0` | `any` | Window lifecycle payload emitted when a window closes |
292
353
 
293
354
 
294
355
 
295
356
  ### terminalExited
296
357
 
297
- Event emitted by WindowManager
358
+ Emitted when the native app reports a terminal process exit event
359
+
360
+ **Event Arguments:**
361
+
362
+ | Name | Type | Description |
363
+ |------|------|-------------|
364
+ | `arg0` | `any` | Terminal lifecycle payload emitted when a terminal process exits |
298
365
 
299
366
 
300
367
 
301
368
  ### message
302
369
 
303
- Event emitted by WindowManager
370
+ Emitted for any incoming message that is not a windowAck
371
+
372
+ **Event Arguments:**
373
+
374
+ | Name | Type | Description |
375
+ |------|------|-------------|
376
+ | `arg0` | `any` | The parsed message object |
377
+
378
+
379
+
380
+ ### error
381
+
382
+ Emitted on error
383
+
384
+ **Event Arguments:**
385
+
386
+ | Name | Type | Description |
387
+ |------|------|-------------|
388
+ | `arg0` | `any` | The error |
304
389
 
305
390
 
306
391
 
@@ -322,8 +407,8 @@ Event emitted by WindowManager
322
407
  ```ts
323
408
  const wm = container.feature('windowManager', { enable: true, autoListen: true })
324
409
 
325
- const result = await wm.spawn({ url: 'https://google.com', width: 800, height: 600 })
326
- const handle = wm.window(result.windowId)
410
+ const handle = await wm.spawn({ url: 'https://google.com', width: 800, height: 600 })
411
+ handle.on('close', (msg) => console.log('window closed'))
327
412
  await handle.navigate('https://news.ycombinator.com')
328
413
  const title = await handle.eval('document.title')
329
414
  await handle.close()
@@ -335,3 +420,26 @@ wm.on('message', (msg) => console.log('App says:', msg))
335
420
  wm.send({ id: 'abc', status: 'processing', speech: 'Working on it' })
336
421
  ```
337
422
 
423
+
424
+
425
+ **spawnLayout**
426
+
427
+ ```ts
428
+ const handles = await wm.spawnLayout([
429
+ { type: 'window', url: 'https://google.com', width: 800, height: 600 },
430
+ { type: 'tty', command: 'htop' },
431
+ { url: 'https://github.com' }, // defaults to window
432
+ ])
433
+ ```
434
+
435
+
436
+
437
+ **spawnLayouts**
438
+
439
+ ```ts
440
+ const [firstBatch, secondBatch] = await wm.spawnLayouts([
441
+ [{ url: 'https://google.com' }, { url: 'https://github.com' }],
442
+ [{ type: 'tty', command: 'htop' }],
443
+ ])
444
+ ```
445
+
@@ -1,6 +1,6 @@
1
1
  # AssetLoader (features.assetLoader)
2
2
 
3
- The AssetLoader provides an API for injecting scripts and stylesheets into the page. It also provides a convenient way of loading any library from unpkg.com
3
+ Injects scripts and stylesheets into the page at runtime. Provides helpers for loading external libraries from unpkg.com, injecting arbitrary script/link tags, and managing load state. Used by other web features (e.g. Esbuild) to pull in dependencies on demand.
4
4
 
5
5
  ## Usage
6
6
 
@@ -45,3 +45,15 @@ container.feature('assetLoader')
45
45
 
46
46
  **Returns:** `Promise<any>`
47
47
 
48
+
49
+
50
+ ## Examples
51
+
52
+ **features.assetLoader**
53
+
54
+ ```ts
55
+ const loader = container.feature('assetLoader')
56
+ await loader.loadScript('https://unpkg.com/lodash')
57
+ await AssetLoader.loadStylesheet('https://unpkg.com/normalize.css')
58
+ ```
59
+
@@ -102,6 +102,65 @@ Event emitted by ContainerLink
102
102
 
103
103
 
104
104
 
105
+ ### disconnection
106
+
107
+ Emitted when a web container disconnects
108
+
109
+ **Event Arguments:**
110
+
111
+ | Name | Type | Description |
112
+ |------|------|-------------|
113
+ | `arg0` | `string` | Container UUID |
114
+ | `arg1` | `string` | Reason |
115
+
116
+
117
+
118
+ ### error
119
+
120
+ Event emitted by ContainerLink
121
+
122
+
123
+
124
+ ### connection
125
+
126
+ Emitted when a web container connects and registers
127
+
128
+ **Event Arguments:**
129
+
130
+ | Name | Type | Description |
131
+ |------|------|-------------|
132
+ | `arg0` | `string` | Container UUID |
133
+ | `arg1` | `any` | Connection metadata |
134
+
135
+
136
+
137
+ ### evalResult
138
+
139
+ Emitted when an eval result is received
140
+
141
+ **Event Arguments:**
142
+
143
+ | Name | Type | Description |
144
+ |------|------|-------------|
145
+ | `arg0` | `string` | Request ID |
146
+ | `arg1` | `any` | Result or error |
147
+
148
+
149
+
150
+ ### event
151
+
152
+ Emitted when a web container sends a structured event
153
+
154
+ **Event Arguments:**
155
+
156
+ | Name | Type | Description |
157
+ |------|------|-------------|
158
+ | `arg0` | `string` | Container UUID |
159
+ | `arg1` | `string` | Event name |
160
+ | `arg2` | `any` | Event data |
161
+
162
+
163
+
105
164
  ## State (Zod v4 schema)
106
165
 
107
166
  | Property | Type | Description |
@@ -1,6 +1,6 @@
1
1
  # Esbuild (features.esbuild)
2
2
 
3
- Esbuild helper
3
+ Browser-side TypeScript/ESM compilation feature using esbuild-wasm. Loads esbuild's WebAssembly build via the AssetLoader, then provides `compile()` and `transform()` methods that work entirely in the browser. Useful for live playgrounds, in-browser REPLs, and client-side bundling.
4
4
 
5
5
  ## Usage
6
6
 
@@ -53,7 +53,8 @@ container.feature('esbuild')
53
53
 
54
54
  ```ts
55
55
  const esbuild = container.feature('esbuild')
56
- const result = esbuild.transformSync('const x: number = 1')
57
- console.log(result.code) // 'const x = 1;\n'
56
+ await esbuild.start()
57
+ const result = await esbuild.compile('const x: number = 1')
58
+ console.log(result.code)
58
59
  ```
59
60
 
@@ -108,6 +108,35 @@ Get the introspection description for a specific helper.
108
108
  | `manifestURL` | `string` | The URL to fetch the helpers manifest from. |
109
109
  | `available` | `Record<string, string[]>` | Returns a unified view of all available helpers across all registries. Each key is a registry type, each value is the list of helper names in that registry. |
110
110
 
111
+ ## Events (Zod v4 schema)
112
+
113
+ ### discovered
114
+
115
+ Emitted after a registry type has been discovered
116
+
117
+ **Event Arguments:**
118
+
119
+ | Name | Type | Description |
120
+ |------|------|-------------|
121
+ | `arg0` | `string` | Registry type that was discovered |
122
+ | `arg1` | `array` | Names of newly registered helpers |
123
+
124
+
125
+
126
+ ### registered
127
+
128
+ Emitted when a single helper is registered
129
+
130
+ **Event Arguments:**
131
+
132
+ | Name | Type | Description |
133
+ |------|------|-------------|
134
+ | `arg0` | `string` | Registry type |
135
+ | `arg1` | `string` | Helper name |
136
+ | `arg2` | `any` | The helper class or module |
137
+
138
+
139
+
111
140
  ## State (Zod v4 schema)
112
141
 
113
142
  | Property | Type | Description |
@@ -1,6 +1,6 @@
1
1
  # Network (features.network)
2
2
 
3
- Network helper
3
+ Tracks browser online/offline connectivity state. Listens for the browser's `online` and `offline` events and keeps the feature state in sync. Other features can observe the `offline` state value or listen for change events to react to connectivity changes.
4
4
 
5
5
  ## Usage
6
6
 
@@ -27,4 +27,18 @@ container.feature('network')
27
27
  | Property | Type | Description |
28
28
  |----------|------|-------------|
29
29
  | `isOffline` | `any` | Whether the browser is currently offline. |
30
- | `isOnline` | `any` | Whether the browser is currently online. |
30
+ | `isOnline` | `any` | Whether the browser is currently online. |
31
+
32
+ ## Examples
33
+
34
+ **features.network**
35
+
36
+ ```ts
37
+ const network = container.feature('network')
38
+ console.log(network.state.get('offline')) // false when online
39
+
40
+ network.on('stateChanged', ({ offline }) => {
41
+ console.log(offline ? 'Went offline' : 'Back online')
42
+ })
43
+ ```
44
+
@@ -1,6 +1,6 @@
1
1
  # Speech (features.speech)
2
2
 
3
- Speech helper
3
+ Text-to-speech synthesis using the Web Speech API (SpeechSynthesis). Wraps the browser's built-in speech synthesis, providing voice selection, queue management, and state tracking. Voices are discovered on init and exposed via state for UI binding.
4
4
 
5
5
  ## Usage
6
6
 
@@ -52,4 +52,18 @@ container.feature('speech')
52
52
  | Property | Type | Description |
53
53
  |----------|------|-------------|
54
54
  | `voices` | `any` | Returns the array of available speech synthesis voices. |
55
- | `defaultVoice` | `any` | Returns the Voice object matching the currently selected default voice name. |
55
+ | `defaultVoice` | `any` | Returns the Voice object matching the currently selected default voice name. |
56
+
57
+ ## Examples
58
+
59
+ **features.speech**
60
+
61
+ ```ts
62
+ const speech = container.feature('speech')
63
+ speech.say('Hello from the browser!')
64
+
65
+ // Choose a specific voice
66
+ const speech = container.feature('speech', { voice: 'Google UK English Female' })
67
+ speech.say('Cheerio!')
68
+ ```
69
+
@@ -1,6 +1,6 @@
1
1
  # WebVault (features.vault)
2
2
 
3
- WebVault helper
3
+ AES-256-GCM encryption and decryption for the browser using the Web Crypto API. Generates or accepts a secret key and provides `encrypt()` / `decrypt()` methods that work entirely client-side. Keys are stored as base64-encoded state so they can persist across sessions when needed.
4
4
 
5
5
  ## Usage
6
6
 
@@ -52,13 +52,8 @@ container.feature('vault')
52
52
 
53
53
  ```ts
54
54
  const vault = container.feature('vault')
55
-
56
- // Encrypt sensitive data
57
- const encrypted = vault.encrypt('sensitive information')
58
- console.log(encrypted) // Base64 encoded encrypted data
59
-
60
- // Decrypt the data
61
- const decrypted = vault.decrypt(encrypted)
62
- console.log(decrypted) // 'sensitive information'
55
+ const encrypted = await vault.encrypt('secret data')
56
+ const decrypted = await vault.decrypt(encrypted)
57
+ console.log(decrypted) // 'secret data'
63
58
  ```
64
59