@soederpop/luca 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +10 -1
- package/bun.lock +1 -1
- package/commands/build-bootstrap.ts +78 -0
- package/commands/build-scaffolds.ts +24 -2
- package/commands/try-all-challenges.ts +543 -0
- package/commands/try-challenge.ts +100 -0
- package/docs/README.md +52 -80
- package/docs/TABLE-OF-CONTENTS.md +82 -51
- package/docs/apis/clients/elevenlabs.md +232 -8
- package/docs/apis/clients/graph.md +59 -8
- package/docs/apis/clients/openai.md +362 -2
- package/docs/apis/clients/rest.md +122 -2
- package/docs/apis/clients/websocket.md +71 -17
- package/docs/apis/features/agi/assistant.md +9 -3
- package/docs/apis/features/agi/assistants-manager.md +2 -2
- package/docs/apis/features/agi/claude-code.md +153 -14
- package/docs/apis/features/agi/conversation-history.md +15 -3
- package/docs/apis/features/agi/conversation.md +133 -20
- package/docs/apis/features/agi/openai-codex.md +90 -12
- package/docs/apis/features/agi/skills-library.md +23 -5
- package/docs/apis/features/node/container-link.md +59 -0
- package/docs/apis/features/node/content-db.md +1 -1
- package/docs/apis/features/node/disk-cache.md +1 -1
- package/docs/apis/features/node/dns.md +1 -0
- package/docs/apis/features/node/docker.md +2 -1
- package/docs/apis/features/node/esbuild.md +4 -3
- package/docs/apis/features/node/file-manager.md +13 -4
- package/docs/apis/features/node/fs.md +726 -171
- package/docs/apis/features/node/git.md +1 -0
- package/docs/apis/features/node/google-auth.md +23 -4
- package/docs/apis/features/node/google-calendar.md +14 -2
- package/docs/apis/features/node/google-docs.md +15 -2
- package/docs/apis/features/node/google-drive.md +21 -3
- package/docs/apis/features/node/google-sheets.md +14 -2
- package/docs/apis/features/node/grep.md +2 -0
- package/docs/apis/features/node/helpers.md +29 -0
- package/docs/apis/features/node/ink.md +2 -2
- package/docs/apis/features/node/networking.md +39 -4
- package/docs/apis/features/node/os.md +28 -0
- package/docs/apis/features/node/postgres.md +26 -4
- package/docs/apis/features/node/proc.md +37 -28
- package/docs/apis/features/node/process-manager.md +33 -5
- package/docs/apis/features/node/repl.md +1 -1
- package/docs/apis/features/node/runpod.md +1 -0
- package/docs/apis/features/node/secure-shell.md +7 -0
- package/docs/apis/features/node/semantic-search.md +12 -5
- package/docs/apis/features/node/sqlite.md +26 -4
- package/docs/apis/features/node/telegram.md +30 -5
- package/docs/apis/features/node/tts.md +17 -2
- package/docs/apis/features/node/ui.md +1 -1
- package/docs/apis/features/node/vault.md +4 -9
- package/docs/apis/features/node/vm.md +3 -12
- package/docs/apis/features/node/window-manager.md +128 -20
- package/docs/apis/features/web/asset-loader.md +13 -1
- package/docs/apis/features/web/container-link.md +59 -0
- package/docs/apis/features/web/esbuild.md +4 -3
- package/docs/apis/features/web/helpers.md +29 -0
- package/docs/apis/features/web/network.md +16 -2
- package/docs/apis/features/web/speech.md +16 -2
- package/docs/apis/features/web/vault.md +4 -9
- package/docs/apis/features/web/vm.md +3 -12
- package/docs/apis/features/web/voice.md +18 -1
- package/docs/apis/servers/express.md +18 -2
- package/docs/apis/servers/mcp.md +29 -4
- package/docs/apis/servers/websocket.md +34 -6
- package/docs/bootstrap/CLAUDE.md +100 -0
- package/docs/bootstrap/SKILL.md +222 -0
- package/docs/bootstrap/templates/about-command.ts +41 -0
- package/docs/bootstrap/templates/docs-models.ts +22 -0
- package/docs/bootstrap/templates/docs-readme.md +43 -0
- package/docs/bootstrap/templates/example-feature.ts +53 -0
- package/docs/bootstrap/templates/health-endpoint.ts +15 -0
- package/docs/bootstrap/templates/luca-cli.ts +25 -0
- package/docs/challenges/caching-proxy.md +16 -0
- package/docs/challenges/content-db-round-trip.md +14 -0
- package/docs/challenges/custom-command.md +9 -0
- package/docs/challenges/file-watcher-pipeline.md +11 -0
- package/docs/challenges/grep-audit-report.md +15 -0
- package/docs/challenges/multi-feature-dashboard.md +14 -0
- package/docs/challenges/process-orchestrator.md +17 -0
- package/docs/challenges/rest-api-server-with-client.md +12 -0
- package/docs/challenges/script-runner-with-vm.md +11 -0
- package/docs/challenges/simple-rest-api.md +15 -0
- package/docs/challenges/websocket-serve-and-client.md +11 -0
- package/docs/challenges/yaml-config-system.md +14 -0
- package/docs/command-system-overhaul.md +94 -0
- package/docs/examples/assistant/CORE.md +18 -0
- package/docs/examples/assistant/hooks.ts +3 -0
- package/docs/examples/assistant/tools.ts +10 -0
- package/docs/examples/window-manager-layouts.md +180 -0
- package/docs/in-memory-fs.md +4 -0
- package/docs/models.ts +13 -10
- package/docs/philosophy.md +4 -3
- package/docs/reports/console-hmr-design.md +170 -0
- package/docs/reports/helper-semantic-search.md +72 -0
- package/docs/scaffolds/client.md +29 -20
- package/docs/scaffolds/command.md +64 -50
- package/docs/scaffolds/endpoint.md +31 -36
- package/docs/scaffolds/feature.md +28 -18
- package/docs/scaffolds/selector.md +91 -0
- package/docs/scaffolds/server.md +18 -9
- package/docs/selectors.md +115 -0
- package/docs/sessions/custom-command/attempt-log-2.md +195 -0
- package/docs/sessions/file-watcher-pipeline/attempt-log-1.md +728 -0
- package/docs/sessions/file-watcher-pipeline/attempt-log-2.md +555 -0
- package/docs/sessions/grep-audit-report/attempt-log-1.md +289 -0
- package/docs/sessions/multi-feature-dashboard/attempt-log-2.md +679 -0
- package/docs/sessions/rest-api-server-with-client/attempt-log-1.md +1 -0
- package/docs/sessions/rest-api-server-with-client/attempt-log-3.md +920 -0
- package/docs/sessions/simple-rest-api/attempt-log-1.md +593 -0
- package/docs/sessions/websocket-serve-and-client/attempt-log-2.md +995 -0
- package/docs/tutorials/00-bootstrap.md +148 -0
- package/docs/tutorials/07-endpoints.md +7 -7
- package/docs/tutorials/08-commands.md +153 -72
- package/luca.cli.ts +3 -0
- package/package.json +6 -5
- package/public/index.html +1430 -0
- package/scripts/examples/using-ollama.ts +2 -1
- package/scripts/update-introspection-data.ts +2 -2
- package/src/agi/endpoints/experts.ts +1 -1
- package/src/agi/features/assistant.ts +7 -0
- package/src/agi/features/assistants-manager.ts +5 -5
- package/src/agi/features/claude-code.ts +263 -3
- package/src/agi/features/conversation-history.ts +7 -1
- package/src/agi/features/conversation.ts +26 -3
- package/src/agi/features/openai-codex.ts +26 -2
- package/src/agi/features/openapi.ts +6 -1
- package/src/agi/features/skills-library.ts +9 -1
- package/src/bootstrap/generated.ts +540 -0
- package/src/cli/cli.ts +64 -21
- package/src/client.ts +23 -357
- package/src/clients/civitai/index.ts +1 -1
- package/src/clients/client-template.ts +1 -1
- package/src/clients/comfyui/index.ts +13 -2
- package/src/clients/elevenlabs/index.ts +2 -1
- package/src/clients/graph.ts +87 -0
- package/src/clients/openai/index.ts +10 -1
- package/src/clients/rest.ts +207 -0
- package/src/clients/websocket.ts +176 -0
- package/src/command.ts +281 -34
- package/src/commands/bootstrap.ts +181 -0
- package/src/commands/chat.ts +5 -4
- package/src/commands/describe.ts +225 -2
- package/src/commands/help.ts +35 -9
- package/src/commands/index.ts +3 -0
- package/src/commands/introspect.ts +92 -2
- package/src/commands/prompt.ts +5 -6
- package/src/commands/run.ts +33 -10
- package/src/commands/save-api-docs.ts +49 -0
- package/src/commands/scaffold.ts +169 -23
- package/src/commands/select.ts +94 -0
- package/src/commands/serve.ts +10 -1
- package/src/container.ts +15 -0
- package/src/endpoint.ts +19 -0
- package/src/graft.ts +181 -0
- package/src/introspection/generated.agi.ts +12458 -8968
- package/src/introspection/generated.node.ts +10573 -7145
- package/src/introspection/generated.web.ts +1 -1
- package/src/introspection/index.ts +26 -0
- package/src/node/container.ts +6 -7
- package/src/node/features/content-db.ts +49 -2
- package/src/node/features/disk-cache.ts +16 -9
- package/src/node/features/dns.ts +16 -3
- package/src/node/features/docker.ts +16 -4
- package/src/node/features/esbuild.ts +20 -0
- package/src/node/features/file-manager.ts +184 -29
- package/src/node/features/fs.ts +704 -248
- package/src/node/features/git.ts +21 -8
- package/src/node/features/grep.ts +23 -3
- package/src/node/features/helpers.ts +372 -43
- package/src/node/features/networking.ts +39 -4
- package/src/node/features/opener.ts +28 -15
- package/src/node/features/os.ts +76 -0
- package/src/node/features/port-exposer.ts +11 -1
- package/src/node/features/postgres.ts +17 -1
- package/src/node/features/proc.ts +4 -1
- package/src/node/features/python.ts +63 -14
- package/src/node/features/repl.ts +11 -7
- package/src/node/features/runpod.ts +16 -3
- package/src/node/features/secure-shell.ts +27 -2
- package/src/node/features/semantic-search.ts +12 -1
- package/src/node/features/ui.ts +5 -69
- package/src/node/features/vm.ts +17 -0
- package/src/node/features/window-manager.ts +68 -20
- package/src/node.ts +5 -0
- package/src/scaffolds/generated.ts +492 -290
- package/src/scaffolds/template.ts +9 -0
- package/src/schemas/base.ts +46 -5
- package/src/selector.ts +282 -0
- package/src/server.ts +11 -0
- package/src/servers/express.ts +27 -12
- package/src/servers/socket.ts +45 -11
- package/src/web/clients/socket.ts +4 -1
- package/src/web/container.ts +2 -1
- package/src/web/features/network.ts +7 -1
- package/src/web/features/voice-recognition.ts +16 -1
- package/test/clients-servers.test.ts +2 -1
- package/test/command.test.ts +267 -0
- package/test-integration/assistants-manager.test.ts +10 -20
- package/tmp/.cache/luca-disk-cache/content-v2/sha512/1b/b5/c75b28794f00f94c4d609a98978e9420e9b7146d204a7fbf5b0b30477292581705d207c0100dabaac27eef540aaaece3374af75104a93219d4ec8bfb44e7 +1 -0
- package/tmp/.cache/luca-disk-cache/content-v2/sha512/da/df/1d90ce4e042abeb035a197832c6d6893420a747a056be773eb00e4f745a037d505c8db13dde7d36b36b6b893addbb7df0f5fe9f0c13e665f20056447318b +1 -0
- package/tmp/.cache/luca-disk-cache/content-v2/sha512/ed/04/e1d0c2a58c2db29b3921ca2affb3ea4febe831c53b38ebc21019fb799823aba6ed5b4611873d2cd25d422d49955b852a9c326da0d678899bc1c2c2960901 +1 -0
- package/tmp/.cache/luca-disk-cache/index-v5/00/13/572aa4c9a94f99eda999695d050cdd0ca7fe2d23a50af03234d4c8ce0791 +2 -0
- package/tmp/.cache/luca-disk-cache/index-v5/75/a9/cb61dc0f0589e8ec10a9aca27b834bc73884c479941042d22a2b22324cd3 +2 -0
- package/tmp/.cache/luca-disk-cache/index-v5/9f/0f/8b1f915ee64cfff7667dd96acd7a5ac0a96aa91a346e19cefd45909a9c9c +2 -0
- package/docs/apis/features/node/launcher-app-command-listener.md +0 -145
- package/docs/examples/launcher-app-command-listener.md +0 -120
- package/docs/tasks/web-container-helper-discovery.md +0 -71
- package/docs/todos.md +0 -1
- package/scripts/test-command-listener.ts +0 -123
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
192
|
+
Bot stopped
|
|
193
193
|
|
|
194
194
|
|
|
195
195
|
|
|
196
196
|
### command
|
|
197
197
|
|
|
198
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
57
|
-
|
|
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
|
-
|
|
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
|
-
//
|
|
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` | `
|
|
78
|
-
| `height` | `
|
|
79
|
-
| `x` | `
|
|
80
|
-
| `y` | `
|
|
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<
|
|
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` | `
|
|
117
|
-
| `height` | `
|
|
118
|
-
| `x` | `
|
|
119
|
-
| `y` | `
|
|
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<
|
|
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
|
-
|
|
310
|
+
Emitted when the IPC server starts listening
|
|
268
311
|
|
|
269
312
|
|
|
270
313
|
|
|
271
314
|
### clientConnected
|
|
272
315
|
|
|
273
|
-
|
|
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
|
-
|
|
328
|
+
Emitted when the native app disconnects
|
|
280
329
|
|
|
281
330
|
|
|
282
331
|
|
|
283
332
|
### windowAck
|
|
284
333
|
|
|
285
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
326
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
57
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
57
|
-
|
|
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
|
|