@soederpop/luca 0.0.26 → 0.0.28
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/docs/examples/assistant-with-process-manager.md +84 -0
- package/docs/examples/websocket-ask-and-reply-example.md +128 -0
- package/docs/window-manager-fix.md +249 -0
- package/package.json +1 -1
- package/src/agi/features/assistant.ts +62 -2
- package/src/bootstrap/generated.ts +215 -1
- package/src/cli/build-info.ts +2 -2
- package/src/clients/websocket.ts +76 -1
- package/src/helper.ts +29 -2
- package/src/introspection/generated.agi.ts +1280 -660
- package/src/introspection/generated.node.ts +621 -89
- package/src/introspection/generated.web.ts +1 -1
- package/src/node/features/ipc-socket.ts +370 -180
- package/src/node/features/process-manager.ts +316 -49
- package/src/node/features/window-manager.ts +843 -235
- package/src/scaffolds/generated.ts +1 -1
- package/src/servers/socket.ts +87 -0
- package/src/web/clients/socket.ts +22 -6
- package/test/websocket-ask.test.ts +101 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { setBuildTimeData, setContainerBuildTimeData } from './index.js';
|
|
2
2
|
|
|
3
3
|
// Auto-generated introspection registry data
|
|
4
|
-
// Generated at: 2026-03-
|
|
4
|
+
// Generated at: 2026-03-23T07:45:57.079Z
|
|
5
5
|
|
|
6
6
|
setBuildTimeData('features.googleDocs', {
|
|
7
7
|
"id": "features.googleDocs",
|
|
@@ -1525,7 +1525,7 @@ setBuildTimeData('features.downloader', {
|
|
|
1525
1525
|
|
|
1526
1526
|
setBuildTimeData('features.windowManager', {
|
|
1527
1527
|
"id": "features.windowManager",
|
|
1528
|
-
"description": "WindowManager Feature — Native window control via LucaVoiceLauncher
|
|
1528
|
+
"description": "WindowManager Feature — Native window control via LucaVoiceLauncher Uses a broker/producer architecture so multiple luca processes can trigger window operations without competing for the same Unix socket. **Architecture:** - The first process to call `listen()` becomes the **broker**. It owns the app-facing socket (`ipc-window.sock`) and a control socket (`ipc-window-control.sock`). - Subsequent processes detect the broker and become **producers**. They connect to the control socket and route commands through the broker. - The broker forwards producer commands to the native app and routes acks and lifecycle events back to the originating producer. **Protocol:** - Bun listens on a Unix domain socket; the native app connects as a client - Window dispatch commands are sent as NDJSON with a `window` field - The app executes window commands and sends back `windowAck` messages - Any non-windowAck message from the app is emitted as a `message` event - Other features can use `send()` to write arbitrary NDJSON to the app **Capabilities:** - Spawn native browser windows with configurable chrome - Navigate, focus, close, and eval JavaScript in windows - Multiple luca processes can trigger window operations simultaneously - Automatic broker detection and producer fallback Observable state includes `windows` (open window metadata), `pendingOperations` (in-flight command ids), and `producerCount` (broker). Sockets, promises, and `WindowHandle` instances stay internal. **Producer state:** The broker pushes `windowStateSync` on the control socket when a producer connects and whenever the window roster changes, so every process sees the same `windows` / `windowCount` / `clientConnected` as the broker (not only its own acks).",
|
|
1529
1529
|
"shortcut": "features.windowManager",
|
|
1530
1530
|
"className": "WindowManager",
|
|
1531
1531
|
"methods": {
|
|
@@ -1541,7 +1541,18 @@ setBuildTimeData('features.windowManager', {
|
|
|
1541
1541
|
"returns": "Promise<this>"
|
|
1542
1542
|
},
|
|
1543
1543
|
"listen": {
|
|
1544
|
-
"description": "Start
|
|
1544
|
+
"description": "Start the window manager. Automatically detects whether a broker already exists and either becomes the broker or connects as a producer. - If no broker is running: becomes the broker, binds the app socket and a control socket for producers. - If a broker is already running: connects as a producer through the control socket.",
|
|
1545
|
+
"parameters": {
|
|
1546
|
+
"socketPath": {
|
|
1547
|
+
"type": "string",
|
|
1548
|
+
"description": "Override the configured app socket path"
|
|
1549
|
+
}
|
|
1550
|
+
},
|
|
1551
|
+
"required": [],
|
|
1552
|
+
"returns": "Promise<this>"
|
|
1553
|
+
},
|
|
1554
|
+
"cleanupSocket": {
|
|
1555
|
+
"description": "Remove stale socket files without starting or stopping the server. Useful when a previous process crashed and left dead sockets behind. Will not remove sockets that have live listeners.",
|
|
1545
1556
|
"parameters": {
|
|
1546
1557
|
"socketPath": {
|
|
1547
1558
|
"type": "string",
|
|
@@ -1549,10 +1560,10 @@ setBuildTimeData('features.windowManager', {
|
|
|
1549
1560
|
}
|
|
1550
1561
|
},
|
|
1551
1562
|
"required": [],
|
|
1552
|
-
"returns": "
|
|
1563
|
+
"returns": "Promise<boolean>"
|
|
1553
1564
|
},
|
|
1554
1565
|
"stop": {
|
|
1555
|
-
"description": "Stop the
|
|
1566
|
+
"description": "Stop the window manager and clean up all connections. Rejects any pending window operation requests.",
|
|
1556
1567
|
"parameters": {},
|
|
1557
1568
|
"required": [],
|
|
1558
1569
|
"returns": "Promise<this>"
|
|
@@ -1825,7 +1836,7 @@ setBuildTimeData('features.windowManager', {
|
|
|
1825
1836
|
]
|
|
1826
1837
|
},
|
|
1827
1838
|
"send": {
|
|
1828
|
-
"description": "Write an NDJSON message to the connected app client. Public so other features can send arbitrary protocol messages over the same socket.",
|
|
1839
|
+
"description": "Write an NDJSON message to the connected app client. In producer mode, routes through the broker. Public so other features can send arbitrary protocol messages over the same socket.",
|
|
1829
1840
|
"parameters": {
|
|
1830
1841
|
"msg": {
|
|
1831
1842
|
"type": "Record<string, any>",
|
|
@@ -1839,12 +1850,20 @@ setBuildTimeData('features.windowManager', {
|
|
|
1839
1850
|
}
|
|
1840
1851
|
},
|
|
1841
1852
|
"getters": {
|
|
1853
|
+
"isBroker": {
|
|
1854
|
+
"description": "Whether this instance is acting as the broker.",
|
|
1855
|
+
"returns": "boolean"
|
|
1856
|
+
},
|
|
1857
|
+
"isProducer": {
|
|
1858
|
+
"description": "Whether this instance is acting as a producer.",
|
|
1859
|
+
"returns": "boolean"
|
|
1860
|
+
},
|
|
1842
1861
|
"isListening": {
|
|
1843
|
-
"description": "Whether the IPC server is currently listening.",
|
|
1862
|
+
"description": "Whether the IPC server is currently listening (broker) or connected to broker (producer).",
|
|
1844
1863
|
"returns": "boolean"
|
|
1845
1864
|
},
|
|
1846
1865
|
"isClientConnected": {
|
|
1847
|
-
"description": "Whether the native app client is currently connected.",
|
|
1866
|
+
"description": "Whether the native app client is currently connected (only meaningful for broker).",
|
|
1848
1867
|
"returns": "boolean"
|
|
1849
1868
|
}
|
|
1850
1869
|
},
|
|
@@ -1879,6 +1898,11 @@ setBuildTimeData('features.windowManager', {
|
|
|
1879
1898
|
"description": "Event emitted by WindowManager",
|
|
1880
1899
|
"arguments": {}
|
|
1881
1900
|
},
|
|
1901
|
+
"windowFocus": {
|
|
1902
|
+
"name": "windowFocus",
|
|
1903
|
+
"description": "Event emitted by WindowManager",
|
|
1904
|
+
"arguments": {}
|
|
1905
|
+
},
|
|
1882
1906
|
"message": {
|
|
1883
1907
|
"name": "message",
|
|
1884
1908
|
"description": "Event emitted by WindowManager",
|
|
@@ -6223,7 +6247,7 @@ setBuildTimeData('features.fs', {
|
|
|
6223
6247
|
|
|
6224
6248
|
setBuildTimeData('features.ipcSocket', {
|
|
6225
6249
|
"id": "features.ipcSocket",
|
|
6226
|
-
"description": "IpcSocket Feature - Inter-Process Communication via Unix Domain Sockets This feature provides robust IPC (Inter-Process Communication) capabilities using Unix domain sockets. It supports both server and client modes, allowing processes to communicate efficiently through file system-based socket connections. **Key Features:** -
|
|
6250
|
+
"description": "IpcSocket Feature - Inter-Process Communication via Unix Domain Sockets This feature provides robust IPC (Inter-Process Communication) capabilities using Unix domain sockets. It supports both server and client modes, allowing processes to communicate efficiently through file system-based socket connections. **Key Features:** - Hub-and-spoke: one server, many named clients with identity tracking - Targeted messaging: sendTo(clientId), broadcast(msg, excludeId) - Request/reply: ask() + reply() with timeout-based correlation - Auto-reconnect: clients reconnect with exponential backoff - Stale socket detection: probeSocket() before listen() - Clean shutdown: stopServer() removes socket file **Server (Hub):** ```typescript const ipc = container.feature('ipcSocket'); await ipc.listen('/tmp/hub.sock', true); ipc.on('connection', (clientId, socket) => { console.log('Client joined:', clientId); }); ipc.on('message', (data, clientId) => { console.log(`From ${clientId}:`, data); // Reply to sender, or ask and wait ipc.sendTo(clientId, { ack: true }); }); ``` **Client (Spoke):** ```typescript const ipc = container.feature('ipcSocket'); await ipc.connect('/tmp/hub.sock', { reconnect: true, name: 'worker-1' }); // Fire and forget await ipc.send({ type: 'status', ready: true }); // Request/reply ipc.on('message', (data) => { if (data.requestId) ipc.reply(data.requestId, { result: 42 }); }); ```",
|
|
6227
6251
|
"shortcut": "features.ipcSocket",
|
|
6228
6252
|
"className": "IpcSocket",
|
|
6229
6253
|
"methods": {
|
|
@@ -6263,61 +6287,127 @@ setBuildTimeData('features.ipcSocket', {
|
|
|
6263
6287
|
]
|
|
6264
6288
|
},
|
|
6265
6289
|
"broadcast": {
|
|
6266
|
-
"description": "Broadcasts a message to all connected clients (server mode only).
|
|
6290
|
+
"description": "Broadcasts a message to all connected clients (server mode only).",
|
|
6267
6291
|
"parameters": {
|
|
6268
6292
|
"message": {
|
|
6269
6293
|
"type": "any",
|
|
6270
|
-
"description": "The message object to broadcast
|
|
6294
|
+
"description": "The message object to broadcast"
|
|
6295
|
+
},
|
|
6296
|
+
"exclude": {
|
|
6297
|
+
"type": "string",
|
|
6298
|
+
"description": "Optional client ID to exclude from broadcast"
|
|
6271
6299
|
}
|
|
6272
6300
|
},
|
|
6273
6301
|
"required": [
|
|
6274
6302
|
"message"
|
|
6275
6303
|
],
|
|
6276
|
-
"returns": "void"
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
|
|
6280
|
-
|
|
6304
|
+
"returns": "void"
|
|
6305
|
+
},
|
|
6306
|
+
"sendTo": {
|
|
6307
|
+
"description": "Sends a message to a specific client by ID (server mode only).",
|
|
6308
|
+
"parameters": {
|
|
6309
|
+
"clientId": {
|
|
6310
|
+
"type": "string",
|
|
6311
|
+
"description": "The target client ID"
|
|
6312
|
+
},
|
|
6313
|
+
"message": {
|
|
6314
|
+
"type": "any",
|
|
6315
|
+
"description": "The message to send"
|
|
6281
6316
|
}
|
|
6282
|
-
|
|
6317
|
+
},
|
|
6318
|
+
"required": [
|
|
6319
|
+
"clientId",
|
|
6320
|
+
"message"
|
|
6321
|
+
],
|
|
6322
|
+
"returns": "boolean"
|
|
6283
6323
|
},
|
|
6284
6324
|
"send": {
|
|
6285
|
-
"description": "
|
|
6325
|
+
"description": "Fire-and-forget: sends a message to the server (client mode only). For server→client, use sendTo() or broadcast().",
|
|
6286
6326
|
"parameters": {
|
|
6287
6327
|
"message": {
|
|
6288
6328
|
"type": "any",
|
|
6289
|
-
"description": "The message
|
|
6329
|
+
"description": "The message to send"
|
|
6290
6330
|
}
|
|
6291
6331
|
},
|
|
6292
6332
|
"required": [
|
|
6293
6333
|
"message"
|
|
6294
6334
|
],
|
|
6295
|
-
"returns": "void"
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6335
|
+
"returns": "void"
|
|
6336
|
+
},
|
|
6337
|
+
"ask": {
|
|
6338
|
+
"description": "Sends a message and waits for a correlated reply. Works in both client and server mode. The recipient should call `reply(requestId, response)` to respond.",
|
|
6339
|
+
"parameters": {
|
|
6340
|
+
"message": {
|
|
6341
|
+
"type": "any",
|
|
6342
|
+
"description": "The message to send"
|
|
6343
|
+
},
|
|
6344
|
+
"options": {
|
|
6345
|
+
"type": "{ clientId?: string; timeoutMs?: number }",
|
|
6346
|
+
"description": "Optional: clientId (server mode target), timeoutMs"
|
|
6300
6347
|
}
|
|
6301
|
-
|
|
6348
|
+
},
|
|
6349
|
+
"required": [
|
|
6350
|
+
"message"
|
|
6351
|
+
],
|
|
6352
|
+
"returns": "Promise<any>"
|
|
6353
|
+
},
|
|
6354
|
+
"reply": {
|
|
6355
|
+
"description": "Sends a reply to a previous ask() call, correlated by requestId.",
|
|
6356
|
+
"parameters": {
|
|
6357
|
+
"requestId": {
|
|
6358
|
+
"type": "string",
|
|
6359
|
+
"description": "The requestId from the incoming message"
|
|
6360
|
+
},
|
|
6361
|
+
"data": {
|
|
6362
|
+
"type": "any",
|
|
6363
|
+
"description": "The reply payload"
|
|
6364
|
+
},
|
|
6365
|
+
"clientId": {
|
|
6366
|
+
"type": "string",
|
|
6367
|
+
"description": "Target client (server mode; for client mode, omit)"
|
|
6368
|
+
}
|
|
6369
|
+
},
|
|
6370
|
+
"required": [
|
|
6371
|
+
"requestId",
|
|
6372
|
+
"data"
|
|
6373
|
+
],
|
|
6374
|
+
"returns": "void"
|
|
6302
6375
|
},
|
|
6303
6376
|
"connect": {
|
|
6304
|
-
"description": "Connects to an IPC server at the specified socket path (client mode).
|
|
6377
|
+
"description": "Connects to an IPC server at the specified socket path (client mode).",
|
|
6305
6378
|
"parameters": {
|
|
6306
6379
|
"socketPath": {
|
|
6307
6380
|
"type": "string",
|
|
6308
|
-
"description": "
|
|
6381
|
+
"description": "Path to the server's Unix domain socket"
|
|
6382
|
+
},
|
|
6383
|
+
"options": {
|
|
6384
|
+
"type": "{ reconnect?: boolean; name?: string }",
|
|
6385
|
+
"description": "Optional: reconnect (enable auto-reconnect), name (identify this client)"
|
|
6309
6386
|
}
|
|
6310
6387
|
},
|
|
6311
6388
|
"required": [
|
|
6312
6389
|
"socketPath"
|
|
6313
6390
|
],
|
|
6314
|
-
"returns": "Promise<Socket>"
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6391
|
+
"returns": "Promise<Socket>"
|
|
6392
|
+
},
|
|
6393
|
+
"disconnect": {
|
|
6394
|
+
"description": "Disconnects the client and stops any reconnection attempts.",
|
|
6395
|
+
"parameters": {},
|
|
6396
|
+
"required": [],
|
|
6397
|
+
"returns": "void"
|
|
6398
|
+
},
|
|
6399
|
+
"probeSocket": {
|
|
6400
|
+
"description": "Probe an existing socket to see if a live listener is behind it. Attempts a quick connect — if it succeeds, someone is listening.",
|
|
6401
|
+
"parameters": {
|
|
6402
|
+
"socketPath": {
|
|
6403
|
+
"type": "string",
|
|
6404
|
+
"description": "Parameter socketPath"
|
|
6319
6405
|
}
|
|
6320
|
-
|
|
6406
|
+
},
|
|
6407
|
+
"required": [
|
|
6408
|
+
"socketPath"
|
|
6409
|
+
],
|
|
6410
|
+
"returns": "Promise<boolean>"
|
|
6321
6411
|
}
|
|
6322
6412
|
},
|
|
6323
6413
|
"getters": {
|
|
@@ -6329,12 +6419,25 @@ setBuildTimeData('features.ipcSocket', {
|
|
|
6329
6419
|
"description": "Checks if the IPC socket is operating in server mode.",
|
|
6330
6420
|
"returns": "any"
|
|
6331
6421
|
},
|
|
6422
|
+
"clientCount": {
|
|
6423
|
+
"description": "Returns the number of currently connected clients (server mode).",
|
|
6424
|
+
"returns": "any"
|
|
6425
|
+
},
|
|
6426
|
+
"connectedClients": {
|
|
6427
|
+
"description": "Returns info about all connected clients (server mode).",
|
|
6428
|
+
"returns": "Array<{ id: string; name?: string; connectedAt: number }>"
|
|
6429
|
+
},
|
|
6332
6430
|
"connection": {
|
|
6333
6431
|
"description": "Gets the current client connection socket.",
|
|
6334
6432
|
"returns": "any"
|
|
6335
6433
|
}
|
|
6336
6434
|
},
|
|
6337
6435
|
"events": {
|
|
6436
|
+
"disconnection": {
|
|
6437
|
+
"name": "disconnection",
|
|
6438
|
+
"description": "Event emitted by IpcSocket",
|
|
6439
|
+
"arguments": {}
|
|
6440
|
+
},
|
|
6338
6441
|
"connection": {
|
|
6339
6442
|
"name": "connection",
|
|
6340
6443
|
"description": "Event emitted by IpcSocket",
|
|
@@ -7255,10 +7358,68 @@ setBuildTimeData('features.packageFinder', {
|
|
|
7255
7358
|
|
|
7256
7359
|
setBuildTimeData('features.processManager', {
|
|
7257
7360
|
"id": "features.processManager",
|
|
7258
|
-
"description": "Manages long-running child processes with tracking, events, and automatic cleanup. Unlike the `proc` feature whose spawn methods block until the child exits, ProcessManager returns a SpawnHandler immediately — a handle object with its own state, events, and lifecycle methods. The feature tracks all spawned processes, maintains observable state, and can automatically kill them on parent exit.",
|
|
7361
|
+
"description": "Manages long-running child processes with tracking, events, and automatic cleanup. Unlike the `proc` feature whose spawn methods block until the child exits, ProcessManager returns a SpawnHandler immediately — a handle object with its own state, events, and lifecycle methods. The feature tracks all spawned processes, maintains observable state, and can automatically kill them on parent exit. Each handler maintains a memory-efficient output buffer: the first 20 lines (head) and last 50 lines (tail) of stdout/stderr are kept, everything in between is discarded.",
|
|
7259
7362
|
"shortcut": "features.processManager",
|
|
7260
7363
|
"className": "ProcessManager",
|
|
7261
7364
|
"methods": {
|
|
7365
|
+
"spawnProcess": {
|
|
7366
|
+
"description": "Tool handler: spawn a long-running background process.",
|
|
7367
|
+
"parameters": {
|
|
7368
|
+
"args": {
|
|
7369
|
+
"type": "{ command: string; args?: string; tag?: string; cwd?: string }",
|
|
7370
|
+
"description": "Parameter args"
|
|
7371
|
+
}
|
|
7372
|
+
},
|
|
7373
|
+
"required": [
|
|
7374
|
+
"args"
|
|
7375
|
+
],
|
|
7376
|
+
"returns": "void"
|
|
7377
|
+
},
|
|
7378
|
+
"runCommand": {
|
|
7379
|
+
"description": "Tool handler: run a command to completion and return its output.",
|
|
7380
|
+
"parameters": {
|
|
7381
|
+
"args": {
|
|
7382
|
+
"type": "{ command: string; cwd?: string }",
|
|
7383
|
+
"description": "Parameter args"
|
|
7384
|
+
}
|
|
7385
|
+
},
|
|
7386
|
+
"required": [
|
|
7387
|
+
"args"
|
|
7388
|
+
],
|
|
7389
|
+
"returns": "void"
|
|
7390
|
+
},
|
|
7391
|
+
"listProcesses": {
|
|
7392
|
+
"description": "Tool handler: list all tracked processes.",
|
|
7393
|
+
"parameters": {},
|
|
7394
|
+
"required": [],
|
|
7395
|
+
"returns": "void"
|
|
7396
|
+
},
|
|
7397
|
+
"getProcessOutput": {
|
|
7398
|
+
"description": "Tool handler: peek at a process's buffered output.",
|
|
7399
|
+
"parameters": {
|
|
7400
|
+
"args": {
|
|
7401
|
+
"type": "{ id?: string; tag?: string; stream?: string }",
|
|
7402
|
+
"description": "Parameter args"
|
|
7403
|
+
}
|
|
7404
|
+
},
|
|
7405
|
+
"required": [
|
|
7406
|
+
"args"
|
|
7407
|
+
],
|
|
7408
|
+
"returns": "void"
|
|
7409
|
+
},
|
|
7410
|
+
"killProcess": {
|
|
7411
|
+
"description": "Tool handler: kill a process by ID or tag.",
|
|
7412
|
+
"parameters": {
|
|
7413
|
+
"args": {
|
|
7414
|
+
"type": "{ id?: string; tag?: string; signal?: string }",
|
|
7415
|
+
"description": "Parameter args"
|
|
7416
|
+
}
|
|
7417
|
+
},
|
|
7418
|
+
"required": [
|
|
7419
|
+
"args"
|
|
7420
|
+
],
|
|
7421
|
+
"returns": "void"
|
|
7422
|
+
},
|
|
7262
7423
|
"spawn": {
|
|
7263
7424
|
"description": "Spawn a long-running process and return a handle immediately. The returned SpawnHandler provides events for stdout/stderr streaming, exit/crash notifications, and methods to kill or await the process.",
|
|
7264
7425
|
"parameters": {
|
|
@@ -7436,7 +7597,7 @@ setBuildTimeData('features.processManager', {
|
|
|
7436
7597
|
"examples": [
|
|
7437
7598
|
{
|
|
7438
7599
|
"language": "ts",
|
|
7439
|
-
"code": "const pm = container.feature('processManager', { enable: true })\n\nconst server = pm.spawn('node', ['server.js'], { tag: 'api', cwd: '/app' })\nserver.on('stdout', (data) => console.log('[api]', data))\nserver.on('crash', (code) => console.error('API crashed:', code))\n\n// Kill one\nserver.kill()\n\n// Kill all tracked processes\npm.killAll()\n\n// List and lookup\npm.list() // SpawnHandler[]\npm.getByTag('api') // SpawnHandler | undefined"
|
|
7600
|
+
"code": "const pm = container.feature('processManager', { enable: true })\n\nconst server = pm.spawn('node', ['server.js'], { tag: 'api', cwd: '/app' })\nserver.on('stdout', (data) => console.log('[api]', data))\nserver.on('crash', (code) => console.error('API crashed:', code))\n\n// Peek at buffered output\nconst { head, tail } = server.peek()\n\n// Kill one\nserver.kill()\n\n// Kill all tracked processes\npm.killAll()\n\n// List and lookup\npm.list() // SpawnHandler[]\npm.getByTag('api') // SpawnHandler | undefined"
|
|
7440
7601
|
}
|
|
7441
7602
|
]
|
|
7442
7603
|
});
|
|
@@ -9805,7 +9966,7 @@ setBuildTimeData('clients.rest', {
|
|
|
9805
9966
|
|
|
9806
9967
|
setBuildTimeData('clients.websocket', {
|
|
9807
9968
|
"id": "clients.websocket",
|
|
9808
|
-
"description": "
|
|
9969
|
+
"description": "WebSocketClient helper",
|
|
9809
9970
|
"shortcut": "clients.websocket",
|
|
9810
9971
|
"className": "WebSocketClient",
|
|
9811
9972
|
"methods": {
|
|
@@ -9828,6 +9989,59 @@ setBuildTimeData('clients.websocket', {
|
|
|
9828
9989
|
],
|
|
9829
9990
|
"returns": "Promise<void>"
|
|
9830
9991
|
},
|
|
9992
|
+
"ask": {
|
|
9993
|
+
"description": "Send a request and wait for a correlated response. The message is sent with a unique `requestId`; the remote side is expected to reply with a message containing `replyTo` set to that same ID.",
|
|
9994
|
+
"parameters": {
|
|
9995
|
+
"type": {
|
|
9996
|
+
"type": "string",
|
|
9997
|
+
"description": "A string identifying the request type"
|
|
9998
|
+
},
|
|
9999
|
+
"data": {
|
|
10000
|
+
"type": "any",
|
|
10001
|
+
"description": "Optional payload to include with the request"
|
|
10002
|
+
},
|
|
10003
|
+
"timeout": {
|
|
10004
|
+
"type": "any",
|
|
10005
|
+
"description": "How long to wait for a response (default 10 000 ms)"
|
|
10006
|
+
}
|
|
10007
|
+
},
|
|
10008
|
+
"required": [
|
|
10009
|
+
"type"
|
|
10010
|
+
],
|
|
10011
|
+
"returns": "Promise<R>",
|
|
10012
|
+
"examples": [
|
|
10013
|
+
{
|
|
10014
|
+
"language": "ts",
|
|
10015
|
+
"code": "const result = await ws.ask('getUser', { id: 42 })"
|
|
10016
|
+
}
|
|
10017
|
+
]
|
|
10018
|
+
},
|
|
10019
|
+
"_handleReply": {
|
|
10020
|
+
"description": "",
|
|
10021
|
+
"parameters": {
|
|
10022
|
+
"message": {
|
|
10023
|
+
"type": "any",
|
|
10024
|
+
"description": "Parameter message"
|
|
10025
|
+
}
|
|
10026
|
+
},
|
|
10027
|
+
"required": [
|
|
10028
|
+
"message"
|
|
10029
|
+
],
|
|
10030
|
+
"returns": "boolean"
|
|
10031
|
+
},
|
|
10032
|
+
"_rejectAllPending": {
|
|
10033
|
+
"description": "",
|
|
10034
|
+
"parameters": {
|
|
10035
|
+
"reason": {
|
|
10036
|
+
"type": "string",
|
|
10037
|
+
"description": "Parameter reason"
|
|
10038
|
+
}
|
|
10039
|
+
},
|
|
10040
|
+
"required": [
|
|
10041
|
+
"reason"
|
|
10042
|
+
],
|
|
10043
|
+
"returns": "void"
|
|
10044
|
+
},
|
|
9831
10045
|
"disconnect": {
|
|
9832
10046
|
"description": "Gracefully close the WebSocket connection. Suppresses auto-reconnect and updates connection state to disconnected.",
|
|
9833
10047
|
"parameters": {},
|
|
@@ -9870,13 +10084,7 @@ setBuildTimeData('clients.websocket', {
|
|
|
9870
10084
|
},
|
|
9871
10085
|
"state": {},
|
|
9872
10086
|
"options": {},
|
|
9873
|
-
"envVars": []
|
|
9874
|
-
"examples": [
|
|
9875
|
-
{
|
|
9876
|
-
"language": "ts",
|
|
9877
|
-
"code": "const ws = container.client('websocket', {\n baseURL: 'ws://localhost:8080',\n reconnect: true,\n maxReconnectAttempts: 5\n})\nws.on('message', (data) => console.log('Received:', data))\nawait ws.connect()\nawait ws.send({ type: 'hello' })"
|
|
9878
|
-
}
|
|
9879
|
-
]
|
|
10087
|
+
"envVars": []
|
|
9880
10088
|
});
|
|
9881
10089
|
|
|
9882
10090
|
setBuildTimeData('clients.openai', {
|
|
@@ -10343,32 +10551,234 @@ setBuildTimeData('clients.supabase', {
|
|
|
10343
10551
|
]
|
|
10344
10552
|
});
|
|
10345
10553
|
|
|
10346
|
-
setBuildTimeData('clients.
|
|
10347
|
-
"id": "clients.
|
|
10348
|
-
"description": "
|
|
10349
|
-
"shortcut": "clients.
|
|
10350
|
-
"className": "
|
|
10554
|
+
setBuildTimeData('clients.elevenlabs', {
|
|
10555
|
+
"id": "clients.elevenlabs",
|
|
10556
|
+
"description": "ElevenLabs client — text-to-speech synthesis via the ElevenLabs REST API. Provides methods for listing voices, listing models, and generating speech audio. Audio is returned as a Buffer; use `say()` for a convenience method that writes to disk.",
|
|
10557
|
+
"shortcut": "clients.elevenlabs",
|
|
10558
|
+
"className": "ElevenLabsClient",
|
|
10351
10559
|
"methods": {
|
|
10352
|
-
"
|
|
10353
|
-
"description": "
|
|
10560
|
+
"beforeRequest": {
|
|
10561
|
+
"description": "Inject the xi-api-key header before each request.",
|
|
10562
|
+
"parameters": {},
|
|
10563
|
+
"required": [],
|
|
10564
|
+
"returns": "void"
|
|
10565
|
+
},
|
|
10566
|
+
"connect": {
|
|
10567
|
+
"description": "Validate the API key by listing available models.",
|
|
10568
|
+
"parameters": {},
|
|
10569
|
+
"required": [],
|
|
10570
|
+
"returns": "Promise<this>",
|
|
10571
|
+
"examples": [
|
|
10572
|
+
{
|
|
10573
|
+
"language": "ts",
|
|
10574
|
+
"code": "await el.connect()"
|
|
10575
|
+
}
|
|
10576
|
+
]
|
|
10577
|
+
},
|
|
10578
|
+
"listVoices": {
|
|
10579
|
+
"description": "List available voices with optional search and filtering.",
|
|
10354
10580
|
"parameters": {
|
|
10355
|
-
"
|
|
10356
|
-
"type": "
|
|
10357
|
-
"description": "
|
|
10358
|
-
}
|
|
10359
|
-
|
|
10581
|
+
"options": {
|
|
10582
|
+
"type": "{\n search?: string\n category?: string\n voice_type?: string\n page_size?: number\n next_page_token?: string\n }",
|
|
10583
|
+
"description": "Query parameters for filtering voices"
|
|
10584
|
+
}
|
|
10585
|
+
},
|
|
10586
|
+
"required": [],
|
|
10587
|
+
"returns": "Promise<any>",
|
|
10588
|
+
"examples": [
|
|
10589
|
+
{
|
|
10590
|
+
"language": "ts",
|
|
10591
|
+
"code": "const voices = await el.listVoices()\nconst premade = await el.listVoices({ category: 'premade' })"
|
|
10592
|
+
}
|
|
10593
|
+
]
|
|
10594
|
+
},
|
|
10595
|
+
"getVoice": {
|
|
10596
|
+
"description": "Get details for a single voice.",
|
|
10597
|
+
"parameters": {
|
|
10598
|
+
"voiceId": {
|
|
10360
10599
|
"type": "string",
|
|
10361
|
-
"description": "
|
|
10600
|
+
"description": "The voice ID to look up"
|
|
10362
10601
|
}
|
|
10363
10602
|
},
|
|
10364
10603
|
"required": [
|
|
10365
|
-
"
|
|
10604
|
+
"voiceId"
|
|
10366
10605
|
],
|
|
10367
|
-
"returns": "Promise<
|
|
10606
|
+
"returns": "Promise<any>",
|
|
10368
10607
|
"examples": [
|
|
10369
10608
|
{
|
|
10370
10609
|
"language": "ts",
|
|
10371
|
-
"code": "const
|
|
10610
|
+
"code": "const voice = await el.getVoice('21m00Tcm4TlvDq8ikWAM')\nconsole.log(voice.name, voice.settings)"
|
|
10611
|
+
}
|
|
10612
|
+
]
|
|
10613
|
+
},
|
|
10614
|
+
"listModels": {
|
|
10615
|
+
"description": "List available TTS models.",
|
|
10616
|
+
"parameters": {},
|
|
10617
|
+
"required": [],
|
|
10618
|
+
"returns": "Promise<any[]>",
|
|
10619
|
+
"examples": [
|
|
10620
|
+
{
|
|
10621
|
+
"language": "ts",
|
|
10622
|
+
"code": "const models = await el.listModels()\nconsole.log(models.map(m => m.model_id))"
|
|
10623
|
+
}
|
|
10624
|
+
]
|
|
10625
|
+
},
|
|
10626
|
+
"synthesize": {
|
|
10627
|
+
"description": "Synthesize speech from text, returning audio as a Buffer.",
|
|
10628
|
+
"parameters": {
|
|
10629
|
+
"text": {
|
|
10630
|
+
"type": "string",
|
|
10631
|
+
"description": "The text to convert to speech"
|
|
10632
|
+
},
|
|
10633
|
+
"options": {
|
|
10634
|
+
"type": "SynthesizeOptions",
|
|
10635
|
+
"description": "Voice, model, format, and voice settings overrides",
|
|
10636
|
+
"properties": {
|
|
10637
|
+
"voiceId": {
|
|
10638
|
+
"type": "string",
|
|
10639
|
+
"description": ""
|
|
10640
|
+
},
|
|
10641
|
+
"modelId": {
|
|
10642
|
+
"type": "string",
|
|
10643
|
+
"description": ""
|
|
10644
|
+
},
|
|
10645
|
+
"outputFormat": {
|
|
10646
|
+
"type": "string",
|
|
10647
|
+
"description": ""
|
|
10648
|
+
},
|
|
10649
|
+
"voiceSettings": {
|
|
10650
|
+
"type": "ElevenLabsVoiceSettings",
|
|
10651
|
+
"description": ""
|
|
10652
|
+
},
|
|
10653
|
+
"disableCache": {
|
|
10654
|
+
"type": "boolean",
|
|
10655
|
+
"description": ""
|
|
10656
|
+
}
|
|
10657
|
+
}
|
|
10658
|
+
}
|
|
10659
|
+
},
|
|
10660
|
+
"required": [
|
|
10661
|
+
"text"
|
|
10662
|
+
],
|
|
10663
|
+
"returns": "Promise<Buffer>",
|
|
10664
|
+
"examples": [
|
|
10665
|
+
{
|
|
10666
|
+
"language": "ts",
|
|
10667
|
+
"code": "const audio = await el.synthesize('Hello world')\n// audio is a Buffer of mp3 data\n\nconst custom = await el.synthesize('Hello', {\n voiceId: '21m00Tcm4TlvDq8ikWAM',\n voiceSettings: { stability: 0.5, similarityBoost: 0.8 }\n})"
|
|
10668
|
+
}
|
|
10669
|
+
]
|
|
10670
|
+
},
|
|
10671
|
+
"say": {
|
|
10672
|
+
"description": "Synthesize speech and write the audio to a file.",
|
|
10673
|
+
"parameters": {
|
|
10674
|
+
"text": {
|
|
10675
|
+
"type": "string",
|
|
10676
|
+
"description": "The text to convert to speech"
|
|
10677
|
+
},
|
|
10678
|
+
"outputPath": {
|
|
10679
|
+
"type": "string",
|
|
10680
|
+
"description": "File path to write the audio to"
|
|
10681
|
+
},
|
|
10682
|
+
"options": {
|
|
10683
|
+
"type": "SynthesizeOptions",
|
|
10684
|
+
"description": "Voice, model, format, and voice settings overrides",
|
|
10685
|
+
"properties": {
|
|
10686
|
+
"voiceId": {
|
|
10687
|
+
"type": "string",
|
|
10688
|
+
"description": ""
|
|
10689
|
+
},
|
|
10690
|
+
"modelId": {
|
|
10691
|
+
"type": "string",
|
|
10692
|
+
"description": ""
|
|
10693
|
+
},
|
|
10694
|
+
"outputFormat": {
|
|
10695
|
+
"type": "string",
|
|
10696
|
+
"description": ""
|
|
10697
|
+
},
|
|
10698
|
+
"voiceSettings": {
|
|
10699
|
+
"type": "ElevenLabsVoiceSettings",
|
|
10700
|
+
"description": ""
|
|
10701
|
+
},
|
|
10702
|
+
"disableCache": {
|
|
10703
|
+
"type": "boolean",
|
|
10704
|
+
"description": ""
|
|
10705
|
+
}
|
|
10706
|
+
}
|
|
10707
|
+
}
|
|
10708
|
+
},
|
|
10709
|
+
"required": [
|
|
10710
|
+
"text",
|
|
10711
|
+
"outputPath"
|
|
10712
|
+
],
|
|
10713
|
+
"returns": "Promise<string>",
|
|
10714
|
+
"examples": [
|
|
10715
|
+
{
|
|
10716
|
+
"language": "ts",
|
|
10717
|
+
"code": "const path = await el.say('Hello world', './hello.mp3')\nconsole.log(`Audio saved to ${path}`)"
|
|
10718
|
+
}
|
|
10719
|
+
]
|
|
10720
|
+
}
|
|
10721
|
+
},
|
|
10722
|
+
"getters": {
|
|
10723
|
+
"apiKey": {
|
|
10724
|
+
"description": "The resolved API key from options or environment.",
|
|
10725
|
+
"returns": "string"
|
|
10726
|
+
}
|
|
10727
|
+
},
|
|
10728
|
+
"events": {
|
|
10729
|
+
"failure": {
|
|
10730
|
+
"name": "failure",
|
|
10731
|
+
"description": "Event emitted by ElevenLabsClient",
|
|
10732
|
+
"arguments": {}
|
|
10733
|
+
},
|
|
10734
|
+
"voices": {
|
|
10735
|
+
"name": "voices",
|
|
10736
|
+
"description": "Event emitted by ElevenLabsClient",
|
|
10737
|
+
"arguments": {}
|
|
10738
|
+
},
|
|
10739
|
+
"speech": {
|
|
10740
|
+
"name": "speech",
|
|
10741
|
+
"description": "Event emitted by ElevenLabsClient",
|
|
10742
|
+
"arguments": {}
|
|
10743
|
+
}
|
|
10744
|
+
},
|
|
10745
|
+
"state": {},
|
|
10746
|
+
"options": {},
|
|
10747
|
+
"envVars": [],
|
|
10748
|
+
"examples": [
|
|
10749
|
+
{
|
|
10750
|
+
"language": "ts",
|
|
10751
|
+
"code": "const el = container.client('elevenlabs')\nawait el.connect()\nconst voices = await el.listVoices()\nconst audio = await el.synthesize('Hello world')\n// audio is a Buffer of mp3 data"
|
|
10752
|
+
}
|
|
10753
|
+
]
|
|
10754
|
+
});
|
|
10755
|
+
|
|
10756
|
+
setBuildTimeData('clients.comfyui', {
|
|
10757
|
+
"id": "clients.comfyui",
|
|
10758
|
+
"description": "ComfyUI client — execute Stable Diffusion workflows via the ComfyUI API. Connects to a ComfyUI instance to queue prompts, track execution via WebSocket or polling, and download generated images. Supports both UI-format and API-format workflows with automatic conversion.",
|
|
10759
|
+
"shortcut": "clients.comfyui",
|
|
10760
|
+
"className": "ComfyUIClient",
|
|
10761
|
+
"methods": {
|
|
10762
|
+
"queuePrompt": {
|
|
10763
|
+
"description": "Queue a prompt (API-format workflow) for execution.",
|
|
10764
|
+
"parameters": {
|
|
10765
|
+
"prompt": {
|
|
10766
|
+
"type": "Record<string, any>",
|
|
10767
|
+
"description": "The API-format workflow object"
|
|
10768
|
+
},
|
|
10769
|
+
"clientId": {
|
|
10770
|
+
"type": "string",
|
|
10771
|
+
"description": "Override the client ID for this request"
|
|
10772
|
+
}
|
|
10773
|
+
},
|
|
10774
|
+
"required": [
|
|
10775
|
+
"prompt"
|
|
10776
|
+
],
|
|
10777
|
+
"returns": "Promise<{ prompt_id: string; number: number }>",
|
|
10778
|
+
"examples": [
|
|
10779
|
+
{
|
|
10780
|
+
"language": "ts",
|
|
10781
|
+
"code": "const { prompt_id } = await comfy.queuePrompt(apiWorkflow)"
|
|
10372
10782
|
}
|
|
10373
10783
|
]
|
|
10374
10784
|
},
|
|
@@ -10595,261 +11005,59 @@ setBuildTimeData('clients.comfyui', {
|
|
|
10595
11005
|
]
|
|
10596
11006
|
});
|
|
10597
11007
|
|
|
10598
|
-
setBuildTimeData('
|
|
10599
|
-
"id": "
|
|
10600
|
-
"description": "
|
|
10601
|
-
"shortcut": "
|
|
10602
|
-
"className": "
|
|
11008
|
+
setBuildTimeData('servers.mcp', {
|
|
11009
|
+
"id": "servers.mcp",
|
|
11010
|
+
"description": "MCP (Model Context Protocol) server for exposing tools, resources, and prompts to AI clients like Claude Code. Uses the low-level MCP SDK Server class directly with Zod 4 native JSON Schema conversion. Register tools, resources, and prompts programmatically, then start the server over stdio (for CLI integration) or HTTP (for remote access).",
|
|
11011
|
+
"shortcut": "servers.mcp",
|
|
11012
|
+
"className": "MCPServer",
|
|
10603
11013
|
"methods": {
|
|
10604
|
-
"
|
|
10605
|
-
"description": "
|
|
10606
|
-
"parameters": {},
|
|
10607
|
-
"required": [],
|
|
10608
|
-
"returns": "void"
|
|
10609
|
-
},
|
|
10610
|
-
"connect": {
|
|
10611
|
-
"description": "Validate the API key by listing available models.",
|
|
10612
|
-
"parameters": {},
|
|
10613
|
-
"required": [],
|
|
10614
|
-
"returns": "Promise<this>",
|
|
10615
|
-
"examples": [
|
|
10616
|
-
{
|
|
10617
|
-
"language": "ts",
|
|
10618
|
-
"code": "await el.connect()"
|
|
10619
|
-
}
|
|
10620
|
-
]
|
|
10621
|
-
},
|
|
10622
|
-
"listVoices": {
|
|
10623
|
-
"description": "List available voices with optional search and filtering.",
|
|
11014
|
+
"tool": {
|
|
11015
|
+
"description": "Register an MCP tool. The tool's Zod schema is converted to JSON Schema for the protocol listing, and used for runtime argument validation. Tool handlers can return a string (auto-wrapped as text content) or a full CallToolResult object for advanced responses (images, errors, etc).",
|
|
10624
11016
|
"parameters": {
|
|
11017
|
+
"name": {
|
|
11018
|
+
"type": "string",
|
|
11019
|
+
"description": "Unique tool name"
|
|
11020
|
+
},
|
|
10625
11021
|
"options": {
|
|
10626
|
-
"type": "
|
|
10627
|
-
"description": "
|
|
11022
|
+
"type": "ToolRegistrationOptions",
|
|
11023
|
+
"description": "Tool schema, description, and handler",
|
|
11024
|
+
"properties": {
|
|
11025
|
+
"schema": {
|
|
11026
|
+
"type": "z.ZodObject<any>",
|
|
11027
|
+
"description": ""
|
|
11028
|
+
},
|
|
11029
|
+
"description": {
|
|
11030
|
+
"type": "string",
|
|
11031
|
+
"description": ""
|
|
11032
|
+
},
|
|
11033
|
+
"handler": {
|
|
11034
|
+
"type": "(args: any, ctx: MCPContext) => any",
|
|
11035
|
+
"description": ""
|
|
11036
|
+
}
|
|
11037
|
+
}
|
|
10628
11038
|
}
|
|
10629
11039
|
},
|
|
10630
|
-
"required": [
|
|
10631
|
-
|
|
10632
|
-
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
"code": "const voices = await el.listVoices()\nconst premade = await el.listVoices({ category: 'premade' })"
|
|
10636
|
-
}
|
|
10637
|
-
]
|
|
11040
|
+
"required": [
|
|
11041
|
+
"name",
|
|
11042
|
+
"options"
|
|
11043
|
+
],
|
|
11044
|
+
"returns": "this"
|
|
10638
11045
|
},
|
|
10639
|
-
"
|
|
10640
|
-
"description": "
|
|
11046
|
+
"resource": {
|
|
11047
|
+
"description": "Register an MCP resource. Resources expose data (files, configs, etc) that AI clients can read by URI. Accepts either a handler function directly or an options object with additional metadata (name, description, mimeType).",
|
|
10641
11048
|
"parameters": {
|
|
10642
|
-
"
|
|
11049
|
+
"uri": {
|
|
10643
11050
|
"type": "string",
|
|
10644
|
-
"description": "
|
|
11051
|
+
"description": "Unique resource URI (e.g. \"project://readme\")"
|
|
11052
|
+
},
|
|
11053
|
+
"handlerOrOptions": {
|
|
11054
|
+
"type": "ResourceRegistrationOptions['handler'] | ResourceRegistrationOptions",
|
|
11055
|
+
"description": "Handler function or options object with handler"
|
|
10645
11056
|
}
|
|
10646
11057
|
},
|
|
10647
11058
|
"required": [
|
|
10648
|
-
"
|
|
10649
|
-
|
|
10650
|
-
"returns": "Promise<any>",
|
|
10651
|
-
"examples": [
|
|
10652
|
-
{
|
|
10653
|
-
"language": "ts",
|
|
10654
|
-
"code": "const voice = await el.getVoice('21m00Tcm4TlvDq8ikWAM')\nconsole.log(voice.name, voice.settings)"
|
|
10655
|
-
}
|
|
10656
|
-
]
|
|
10657
|
-
},
|
|
10658
|
-
"listModels": {
|
|
10659
|
-
"description": "List available TTS models.",
|
|
10660
|
-
"parameters": {},
|
|
10661
|
-
"required": [],
|
|
10662
|
-
"returns": "Promise<any[]>",
|
|
10663
|
-
"examples": [
|
|
10664
|
-
{
|
|
10665
|
-
"language": "ts",
|
|
10666
|
-
"code": "const models = await el.listModels()\nconsole.log(models.map(m => m.model_id))"
|
|
10667
|
-
}
|
|
10668
|
-
]
|
|
10669
|
-
},
|
|
10670
|
-
"synthesize": {
|
|
10671
|
-
"description": "Synthesize speech from text, returning audio as a Buffer.",
|
|
10672
|
-
"parameters": {
|
|
10673
|
-
"text": {
|
|
10674
|
-
"type": "string",
|
|
10675
|
-
"description": "The text to convert to speech"
|
|
10676
|
-
},
|
|
10677
|
-
"options": {
|
|
10678
|
-
"type": "SynthesizeOptions",
|
|
10679
|
-
"description": "Voice, model, format, and voice settings overrides",
|
|
10680
|
-
"properties": {
|
|
10681
|
-
"voiceId": {
|
|
10682
|
-
"type": "string",
|
|
10683
|
-
"description": ""
|
|
10684
|
-
},
|
|
10685
|
-
"modelId": {
|
|
10686
|
-
"type": "string",
|
|
10687
|
-
"description": ""
|
|
10688
|
-
},
|
|
10689
|
-
"outputFormat": {
|
|
10690
|
-
"type": "string",
|
|
10691
|
-
"description": ""
|
|
10692
|
-
},
|
|
10693
|
-
"voiceSettings": {
|
|
10694
|
-
"type": "ElevenLabsVoiceSettings",
|
|
10695
|
-
"description": ""
|
|
10696
|
-
},
|
|
10697
|
-
"disableCache": {
|
|
10698
|
-
"type": "boolean",
|
|
10699
|
-
"description": ""
|
|
10700
|
-
}
|
|
10701
|
-
}
|
|
10702
|
-
}
|
|
10703
|
-
},
|
|
10704
|
-
"required": [
|
|
10705
|
-
"text"
|
|
10706
|
-
],
|
|
10707
|
-
"returns": "Promise<Buffer>",
|
|
10708
|
-
"examples": [
|
|
10709
|
-
{
|
|
10710
|
-
"language": "ts",
|
|
10711
|
-
"code": "const audio = await el.synthesize('Hello world')\n// audio is a Buffer of mp3 data\n\nconst custom = await el.synthesize('Hello', {\n voiceId: '21m00Tcm4TlvDq8ikWAM',\n voiceSettings: { stability: 0.5, similarityBoost: 0.8 }\n})"
|
|
10712
|
-
}
|
|
10713
|
-
]
|
|
10714
|
-
},
|
|
10715
|
-
"say": {
|
|
10716
|
-
"description": "Synthesize speech and write the audio to a file.",
|
|
10717
|
-
"parameters": {
|
|
10718
|
-
"text": {
|
|
10719
|
-
"type": "string",
|
|
10720
|
-
"description": "The text to convert to speech"
|
|
10721
|
-
},
|
|
10722
|
-
"outputPath": {
|
|
10723
|
-
"type": "string",
|
|
10724
|
-
"description": "File path to write the audio to"
|
|
10725
|
-
},
|
|
10726
|
-
"options": {
|
|
10727
|
-
"type": "SynthesizeOptions",
|
|
10728
|
-
"description": "Voice, model, format, and voice settings overrides",
|
|
10729
|
-
"properties": {
|
|
10730
|
-
"voiceId": {
|
|
10731
|
-
"type": "string",
|
|
10732
|
-
"description": ""
|
|
10733
|
-
},
|
|
10734
|
-
"modelId": {
|
|
10735
|
-
"type": "string",
|
|
10736
|
-
"description": ""
|
|
10737
|
-
},
|
|
10738
|
-
"outputFormat": {
|
|
10739
|
-
"type": "string",
|
|
10740
|
-
"description": ""
|
|
10741
|
-
},
|
|
10742
|
-
"voiceSettings": {
|
|
10743
|
-
"type": "ElevenLabsVoiceSettings",
|
|
10744
|
-
"description": ""
|
|
10745
|
-
},
|
|
10746
|
-
"disableCache": {
|
|
10747
|
-
"type": "boolean",
|
|
10748
|
-
"description": ""
|
|
10749
|
-
}
|
|
10750
|
-
}
|
|
10751
|
-
}
|
|
10752
|
-
},
|
|
10753
|
-
"required": [
|
|
10754
|
-
"text",
|
|
10755
|
-
"outputPath"
|
|
10756
|
-
],
|
|
10757
|
-
"returns": "Promise<string>",
|
|
10758
|
-
"examples": [
|
|
10759
|
-
{
|
|
10760
|
-
"language": "ts",
|
|
10761
|
-
"code": "const path = await el.say('Hello world', './hello.mp3')\nconsole.log(`Audio saved to ${path}`)"
|
|
10762
|
-
}
|
|
10763
|
-
]
|
|
10764
|
-
}
|
|
10765
|
-
},
|
|
10766
|
-
"getters": {
|
|
10767
|
-
"apiKey": {
|
|
10768
|
-
"description": "The resolved API key from options or environment.",
|
|
10769
|
-
"returns": "string"
|
|
10770
|
-
}
|
|
10771
|
-
},
|
|
10772
|
-
"events": {
|
|
10773
|
-
"failure": {
|
|
10774
|
-
"name": "failure",
|
|
10775
|
-
"description": "Event emitted by ElevenLabsClient",
|
|
10776
|
-
"arguments": {}
|
|
10777
|
-
},
|
|
10778
|
-
"voices": {
|
|
10779
|
-
"name": "voices",
|
|
10780
|
-
"description": "Event emitted by ElevenLabsClient",
|
|
10781
|
-
"arguments": {}
|
|
10782
|
-
},
|
|
10783
|
-
"speech": {
|
|
10784
|
-
"name": "speech",
|
|
10785
|
-
"description": "Event emitted by ElevenLabsClient",
|
|
10786
|
-
"arguments": {}
|
|
10787
|
-
}
|
|
10788
|
-
},
|
|
10789
|
-
"state": {},
|
|
10790
|
-
"options": {},
|
|
10791
|
-
"envVars": [],
|
|
10792
|
-
"examples": [
|
|
10793
|
-
{
|
|
10794
|
-
"language": "ts",
|
|
10795
|
-
"code": "const el = container.client('elevenlabs')\nawait el.connect()\nconst voices = await el.listVoices()\nconst audio = await el.synthesize('Hello world')\n// audio is a Buffer of mp3 data"
|
|
10796
|
-
}
|
|
10797
|
-
]
|
|
10798
|
-
});
|
|
10799
|
-
|
|
10800
|
-
setBuildTimeData('servers.mcp', {
|
|
10801
|
-
"id": "servers.mcp",
|
|
10802
|
-
"description": "MCP (Model Context Protocol) server for exposing tools, resources, and prompts to AI clients like Claude Code. Uses the low-level MCP SDK Server class directly with Zod 4 native JSON Schema conversion. Register tools, resources, and prompts programmatically, then start the server over stdio (for CLI integration) or HTTP (for remote access).",
|
|
10803
|
-
"shortcut": "servers.mcp",
|
|
10804
|
-
"className": "MCPServer",
|
|
10805
|
-
"methods": {
|
|
10806
|
-
"tool": {
|
|
10807
|
-
"description": "Register an MCP tool. The tool's Zod schema is converted to JSON Schema for the protocol listing, and used for runtime argument validation. Tool handlers can return a string (auto-wrapped as text content) or a full CallToolResult object for advanced responses (images, errors, etc).",
|
|
10808
|
-
"parameters": {
|
|
10809
|
-
"name": {
|
|
10810
|
-
"type": "string",
|
|
10811
|
-
"description": "Unique tool name"
|
|
10812
|
-
},
|
|
10813
|
-
"options": {
|
|
10814
|
-
"type": "ToolRegistrationOptions",
|
|
10815
|
-
"description": "Tool schema, description, and handler",
|
|
10816
|
-
"properties": {
|
|
10817
|
-
"schema": {
|
|
10818
|
-
"type": "z.ZodObject<any>",
|
|
10819
|
-
"description": ""
|
|
10820
|
-
},
|
|
10821
|
-
"description": {
|
|
10822
|
-
"type": "string",
|
|
10823
|
-
"description": ""
|
|
10824
|
-
},
|
|
10825
|
-
"handler": {
|
|
10826
|
-
"type": "(args: any, ctx: MCPContext) => any",
|
|
10827
|
-
"description": ""
|
|
10828
|
-
}
|
|
10829
|
-
}
|
|
10830
|
-
}
|
|
10831
|
-
},
|
|
10832
|
-
"required": [
|
|
10833
|
-
"name",
|
|
10834
|
-
"options"
|
|
10835
|
-
],
|
|
10836
|
-
"returns": "this"
|
|
10837
|
-
},
|
|
10838
|
-
"resource": {
|
|
10839
|
-
"description": "Register an MCP resource. Resources expose data (files, configs, etc) that AI clients can read by URI. Accepts either a handler function directly or an options object with additional metadata (name, description, mimeType).",
|
|
10840
|
-
"parameters": {
|
|
10841
|
-
"uri": {
|
|
10842
|
-
"type": "string",
|
|
10843
|
-
"description": "Unique resource URI (e.g. \"project://readme\")"
|
|
10844
|
-
},
|
|
10845
|
-
"handlerOrOptions": {
|
|
10846
|
-
"type": "ResourceRegistrationOptions['handler'] | ResourceRegistrationOptions",
|
|
10847
|
-
"description": "Handler function or options object with handler"
|
|
10848
|
-
}
|
|
10849
|
-
},
|
|
10850
|
-
"required": [
|
|
10851
|
-
"uri",
|
|
10852
|
-
"handlerOrOptions"
|
|
11059
|
+
"uri",
|
|
11060
|
+
"handlerOrOptions"
|
|
10853
11061
|
],
|
|
10854
11062
|
"returns": "this"
|
|
10855
11063
|
},
|
|
@@ -11081,7 +11289,7 @@ setBuildTimeData('servers.express', {
|
|
|
11081
11289
|
|
|
11082
11290
|
setBuildTimeData('servers.websocket', {
|
|
11083
11291
|
"id": "servers.websocket",
|
|
11084
|
-
"description": "WebSocket server built on the `ws` library with optional JSON message framing. Manages WebSocket connections, tracks connected clients, and bridges messages to Luca's event bus. When `json` mode is enabled, incoming messages are automatically JSON-parsed (with `.toString()` for Buffer data) and outgoing messages via `send()` / `broadcast()` are JSON-stringified. When `json` mode is disabled, raw message data is emitted as-is and `send()` / `broadcast()` still JSON-stringify for safety.",
|
|
11292
|
+
"description": "WebSocket server built on the `ws` library with optional JSON message framing. Manages WebSocket connections, tracks connected clients, and bridges messages to Luca's event bus. When `json` mode is enabled, incoming messages are automatically JSON-parsed (with `.toString()` for Buffer data) and outgoing messages via `send()` / `broadcast()` are JSON-stringified. When `json` mode is disabled, raw message data is emitted as-is and `send()` / `broadcast()` still JSON-stringify for safety. Supports ask/reply semantics when paired with the Luca WebSocket client. The server can `ask(ws, type, data)` a connected client and await a typed response, or handle incoming asks from clients by listening for messages with a `requestId` and replying via `send(ws, { replyTo, data })`. Requests time out if no reply arrives within the configurable window.",
|
|
11085
11293
|
"shortcut": "servers.websocket",
|
|
11086
11294
|
"className": "WebsocketServer",
|
|
11087
11295
|
"methods": {
|
|
@@ -11116,6 +11324,64 @@ setBuildTimeData('servers.websocket', {
|
|
|
11116
11324
|
],
|
|
11117
11325
|
"returns": "void"
|
|
11118
11326
|
},
|
|
11327
|
+
"ask": {
|
|
11328
|
+
"description": "Send a request to a specific client and wait for a correlated response. The client is expected to reply with a message whose `replyTo` matches the `requestId` of this message.",
|
|
11329
|
+
"parameters": {
|
|
11330
|
+
"ws": {
|
|
11331
|
+
"type": "any",
|
|
11332
|
+
"description": "The WebSocket client to ask"
|
|
11333
|
+
},
|
|
11334
|
+
"type": {
|
|
11335
|
+
"type": "string",
|
|
11336
|
+
"description": "A string identifying the request type"
|
|
11337
|
+
},
|
|
11338
|
+
"data": {
|
|
11339
|
+
"type": "any",
|
|
11340
|
+
"description": "Optional payload"
|
|
11341
|
+
},
|
|
11342
|
+
"timeout": {
|
|
11343
|
+
"type": "any",
|
|
11344
|
+
"description": "How long to wait (default 10 000 ms)"
|
|
11345
|
+
}
|
|
11346
|
+
},
|
|
11347
|
+
"required": [
|
|
11348
|
+
"ws",
|
|
11349
|
+
"type"
|
|
11350
|
+
],
|
|
11351
|
+
"returns": "Promise<R>",
|
|
11352
|
+
"examples": [
|
|
11353
|
+
{
|
|
11354
|
+
"language": "ts",
|
|
11355
|
+
"code": "ws.on('connection', async (client) => {\n const info = await ws.ask(client, 'identify')\n console.log('Client says:', info)\n})"
|
|
11356
|
+
}
|
|
11357
|
+
]
|
|
11358
|
+
},
|
|
11359
|
+
"_handleReply": {
|
|
11360
|
+
"description": "",
|
|
11361
|
+
"parameters": {
|
|
11362
|
+
"message": {
|
|
11363
|
+
"type": "any",
|
|
11364
|
+
"description": "Parameter message"
|
|
11365
|
+
}
|
|
11366
|
+
},
|
|
11367
|
+
"required": [
|
|
11368
|
+
"message"
|
|
11369
|
+
],
|
|
11370
|
+
"returns": "boolean"
|
|
11371
|
+
},
|
|
11372
|
+
"_rejectAllPending": {
|
|
11373
|
+
"description": "",
|
|
11374
|
+
"parameters": {
|
|
11375
|
+
"reason": {
|
|
11376
|
+
"type": "string",
|
|
11377
|
+
"description": "Parameter reason"
|
|
11378
|
+
}
|
|
11379
|
+
},
|
|
11380
|
+
"required": [
|
|
11381
|
+
"reason"
|
|
11382
|
+
],
|
|
11383
|
+
"returns": "void"
|
|
11384
|
+
},
|
|
11119
11385
|
"start": {
|
|
11120
11386
|
"description": "Start the WebSocket server. A runtime `port` overrides the constructor option and is written to state before the underlying `ws.Server` is created, so the server binds to the correct port.",
|
|
11121
11387
|
"parameters": {
|
|
@@ -11162,7 +11428,7 @@ setBuildTimeData('servers.websocket', {
|
|
|
11162
11428
|
"examples": [
|
|
11163
11429
|
{
|
|
11164
11430
|
"language": "ts",
|
|
11165
|
-
"code": "const ws = container.server('websocket', { json: true })\nawait ws.start({ port: 8080 })\n\nws.on('message', (data, client) => {\n console.log('Received:', data)\n ws.broadcast({ echo: data })\n})"
|
|
11431
|
+
"code": "const ws = container.server('websocket', { json: true })\nawait ws.start({ port: 8080 })\n\nws.on('message', (data, client) => {\n console.log('Received:', data)\n ws.broadcast({ echo: data })\n})\n\n// ask/reply: request info from a connected client\nws.on('connection', async (client) => {\n const info = await ws.ask(client, 'identify')\n console.log('Client says:', info)\n})"
|
|
11166
11432
|
}
|
|
11167
11433
|
]
|
|
11168
11434
|
});
|
|
@@ -12016,15 +12282,46 @@ setBuildTimeData('features.assistant', {
|
|
|
12016
12282
|
"required": [],
|
|
12017
12283
|
"returns": "void"
|
|
12018
12284
|
},
|
|
12019
|
-
"
|
|
12020
|
-
"description": "
|
|
12285
|
+
"addSystemPromptExtension": {
|
|
12286
|
+
"description": "Add or update a named system prompt extension. The value is appended to the base system prompt when passed to the conversation.",
|
|
12021
12287
|
"parameters": {
|
|
12022
|
-
"
|
|
12023
|
-
"type": "
|
|
12024
|
-
"description": "
|
|
12025
|
-
}
|
|
12026
|
-
|
|
12027
|
-
|
|
12288
|
+
"key": {
|
|
12289
|
+
"type": "string",
|
|
12290
|
+
"description": "A unique identifier for this extension"
|
|
12291
|
+
},
|
|
12292
|
+
"value": {
|
|
12293
|
+
"type": "string",
|
|
12294
|
+
"description": "The text to append"
|
|
12295
|
+
}
|
|
12296
|
+
},
|
|
12297
|
+
"required": [
|
|
12298
|
+
"key",
|
|
12299
|
+
"value"
|
|
12300
|
+
],
|
|
12301
|
+
"returns": "this"
|
|
12302
|
+
},
|
|
12303
|
+
"removeSystemPromptExtension": {
|
|
12304
|
+
"description": "Remove a named system prompt extension.",
|
|
12305
|
+
"parameters": {
|
|
12306
|
+
"key": {
|
|
12307
|
+
"type": "string",
|
|
12308
|
+
"description": "The identifier of the extension to remove"
|
|
12309
|
+
}
|
|
12310
|
+
},
|
|
12311
|
+
"required": [
|
|
12312
|
+
"key"
|
|
12313
|
+
],
|
|
12314
|
+
"returns": "this"
|
|
12315
|
+
},
|
|
12316
|
+
"use": {
|
|
12317
|
+
"description": "Apply a setup function or a Helper instance to this assistant. When passed a function, it receives the assistant and can configure tools, hooks, event listeners, etc. When passed a Helper instance that exposes tools via toTools(), those tools are automatically added to this assistant.",
|
|
12318
|
+
"parameters": {
|
|
12319
|
+
"fnOrHelper": {
|
|
12320
|
+
"type": "((assistant: this) => void | Promise<void>) | { toTools: () => { schemas: Record<string, z.ZodType>, handlers: Record<string, Function> } } | { schemas: Record<string, z.ZodType>, handlers: Record<string, Function> }",
|
|
12321
|
+
"description": "Setup function or Helper instance"
|
|
12322
|
+
}
|
|
12323
|
+
},
|
|
12324
|
+
"required": [
|
|
12028
12325
|
"fnOrHelper"
|
|
12029
12326
|
],
|
|
12030
12327
|
"returns": "this",
|
|
@@ -12286,6 +12583,14 @@ setBuildTimeData('features.assistant', {
|
|
|
12286
12583
|
"description": "The current system prompt text.",
|
|
12287
12584
|
"returns": "string"
|
|
12288
12585
|
},
|
|
12586
|
+
"systemPromptExtensions": {
|
|
12587
|
+
"description": "The named extensions appended to the system prompt.",
|
|
12588
|
+
"returns": "Record<string, string>"
|
|
12589
|
+
},
|
|
12590
|
+
"effectiveSystemPrompt": {
|
|
12591
|
+
"description": "The system prompt with all extensions appended. This is the value passed to the conversation.",
|
|
12592
|
+
"returns": "string"
|
|
12593
|
+
},
|
|
12289
12594
|
"tools": {
|
|
12290
12595
|
"description": "The tools registered with this assistant.",
|
|
12291
12596
|
"returns": "Record<string, ConversationTool>"
|
|
@@ -12329,6 +12634,11 @@ setBuildTimeData('features.assistant', {
|
|
|
12329
12634
|
"description": "Event emitted by Assistant",
|
|
12330
12635
|
"arguments": {}
|
|
12331
12636
|
},
|
|
12637
|
+
"systemPromptExtensionsChanged": {
|
|
12638
|
+
"name": "systemPromptExtensionsChanged",
|
|
12639
|
+
"description": "Event emitted by Assistant",
|
|
12640
|
+
"arguments": {}
|
|
12641
|
+
},
|
|
12332
12642
|
"toolsChanged": {
|
|
12333
12643
|
"name": "toolsChanged",
|
|
12334
12644
|
"description": "Event emitted by Assistant",
|
|
@@ -15653,7 +15963,7 @@ export const introspectionData = [
|
|
|
15653
15963
|
},
|
|
15654
15964
|
{
|
|
15655
15965
|
"id": "features.windowManager",
|
|
15656
|
-
"description": "WindowManager Feature — Native window control via LucaVoiceLauncher
|
|
15966
|
+
"description": "WindowManager Feature — Native window control via LucaVoiceLauncher Uses a broker/producer architecture so multiple luca processes can trigger window operations without competing for the same Unix socket. **Architecture:** - The first process to call `listen()` becomes the **broker**. It owns the app-facing socket (`ipc-window.sock`) and a control socket (`ipc-window-control.sock`). - Subsequent processes detect the broker and become **producers**. They connect to the control socket and route commands through the broker. - The broker forwards producer commands to the native app and routes acks and lifecycle events back to the originating producer. **Protocol:** - Bun listens on a Unix domain socket; the native app connects as a client - Window dispatch commands are sent as NDJSON with a `window` field - The app executes window commands and sends back `windowAck` messages - Any non-windowAck message from the app is emitted as a `message` event - Other features can use `send()` to write arbitrary NDJSON to the app **Capabilities:** - Spawn native browser windows with configurable chrome - Navigate, focus, close, and eval JavaScript in windows - Multiple luca processes can trigger window operations simultaneously - Automatic broker detection and producer fallback Observable state includes `windows` (open window metadata), `pendingOperations` (in-flight command ids), and `producerCount` (broker). Sockets, promises, and `WindowHandle` instances stay internal. **Producer state:** The broker pushes `windowStateSync` on the control socket when a producer connects and whenever the window roster changes, so every process sees the same `windows` / `windowCount` / `clientConnected` as the broker (not only its own acks).",
|
|
15657
15967
|
"shortcut": "features.windowManager",
|
|
15658
15968
|
"className": "WindowManager",
|
|
15659
15969
|
"methods": {
|
|
@@ -15669,7 +15979,18 @@ export const introspectionData = [
|
|
|
15669
15979
|
"returns": "Promise<this>"
|
|
15670
15980
|
},
|
|
15671
15981
|
"listen": {
|
|
15672
|
-
"description": "Start
|
|
15982
|
+
"description": "Start the window manager. Automatically detects whether a broker already exists and either becomes the broker or connects as a producer. - If no broker is running: becomes the broker, binds the app socket and a control socket for producers. - If a broker is already running: connects as a producer through the control socket.",
|
|
15983
|
+
"parameters": {
|
|
15984
|
+
"socketPath": {
|
|
15985
|
+
"type": "string",
|
|
15986
|
+
"description": "Override the configured app socket path"
|
|
15987
|
+
}
|
|
15988
|
+
},
|
|
15989
|
+
"required": [],
|
|
15990
|
+
"returns": "Promise<this>"
|
|
15991
|
+
},
|
|
15992
|
+
"cleanupSocket": {
|
|
15993
|
+
"description": "Remove stale socket files without starting or stopping the server. Useful when a previous process crashed and left dead sockets behind. Will not remove sockets that have live listeners.",
|
|
15673
15994
|
"parameters": {
|
|
15674
15995
|
"socketPath": {
|
|
15675
15996
|
"type": "string",
|
|
@@ -15677,10 +15998,10 @@ export const introspectionData = [
|
|
|
15677
15998
|
}
|
|
15678
15999
|
},
|
|
15679
16000
|
"required": [],
|
|
15680
|
-
"returns": "
|
|
16001
|
+
"returns": "Promise<boolean>"
|
|
15681
16002
|
},
|
|
15682
16003
|
"stop": {
|
|
15683
|
-
"description": "Stop the
|
|
16004
|
+
"description": "Stop the window manager and clean up all connections. Rejects any pending window operation requests.",
|
|
15684
16005
|
"parameters": {},
|
|
15685
16006
|
"required": [],
|
|
15686
16007
|
"returns": "Promise<this>"
|
|
@@ -15953,7 +16274,7 @@ export const introspectionData = [
|
|
|
15953
16274
|
]
|
|
15954
16275
|
},
|
|
15955
16276
|
"send": {
|
|
15956
|
-
"description": "Write an NDJSON message to the connected app client. Public so other features can send arbitrary protocol messages over the same socket.",
|
|
16277
|
+
"description": "Write an NDJSON message to the connected app client. In producer mode, routes through the broker. Public so other features can send arbitrary protocol messages over the same socket.",
|
|
15957
16278
|
"parameters": {
|
|
15958
16279
|
"msg": {
|
|
15959
16280
|
"type": "Record<string, any>",
|
|
@@ -15967,12 +16288,20 @@ export const introspectionData = [
|
|
|
15967
16288
|
}
|
|
15968
16289
|
},
|
|
15969
16290
|
"getters": {
|
|
16291
|
+
"isBroker": {
|
|
16292
|
+
"description": "Whether this instance is acting as the broker.",
|
|
16293
|
+
"returns": "boolean"
|
|
16294
|
+
},
|
|
16295
|
+
"isProducer": {
|
|
16296
|
+
"description": "Whether this instance is acting as a producer.",
|
|
16297
|
+
"returns": "boolean"
|
|
16298
|
+
},
|
|
15970
16299
|
"isListening": {
|
|
15971
|
-
"description": "Whether the IPC server is currently listening.",
|
|
16300
|
+
"description": "Whether the IPC server is currently listening (broker) or connected to broker (producer).",
|
|
15972
16301
|
"returns": "boolean"
|
|
15973
16302
|
},
|
|
15974
16303
|
"isClientConnected": {
|
|
15975
|
-
"description": "Whether the native app client is currently connected.",
|
|
16304
|
+
"description": "Whether the native app client is currently connected (only meaningful for broker).",
|
|
15976
16305
|
"returns": "boolean"
|
|
15977
16306
|
}
|
|
15978
16307
|
},
|
|
@@ -16007,6 +16336,11 @@ export const introspectionData = [
|
|
|
16007
16336
|
"description": "Event emitted by WindowManager",
|
|
16008
16337
|
"arguments": {}
|
|
16009
16338
|
},
|
|
16339
|
+
"windowFocus": {
|
|
16340
|
+
"name": "windowFocus",
|
|
16341
|
+
"description": "Event emitted by WindowManager",
|
|
16342
|
+
"arguments": {}
|
|
16343
|
+
},
|
|
16010
16344
|
"message": {
|
|
16011
16345
|
"name": "message",
|
|
16012
16346
|
"description": "Event emitted by WindowManager",
|
|
@@ -20330,7 +20664,7 @@ export const introspectionData = [
|
|
|
20330
20664
|
},
|
|
20331
20665
|
{
|
|
20332
20666
|
"id": "features.ipcSocket",
|
|
20333
|
-
"description": "IpcSocket Feature - Inter-Process Communication via Unix Domain Sockets This feature provides robust IPC (Inter-Process Communication) capabilities using Unix domain sockets. It supports both server and client modes, allowing processes to communicate efficiently through file system-based socket connections. **Key Features:** -
|
|
20667
|
+
"description": "IpcSocket Feature - Inter-Process Communication via Unix Domain Sockets This feature provides robust IPC (Inter-Process Communication) capabilities using Unix domain sockets. It supports both server and client modes, allowing processes to communicate efficiently through file system-based socket connections. **Key Features:** - Hub-and-spoke: one server, many named clients with identity tracking - Targeted messaging: sendTo(clientId), broadcast(msg, excludeId) - Request/reply: ask() + reply() with timeout-based correlation - Auto-reconnect: clients reconnect with exponential backoff - Stale socket detection: probeSocket() before listen() - Clean shutdown: stopServer() removes socket file **Server (Hub):** ```typescript const ipc = container.feature('ipcSocket'); await ipc.listen('/tmp/hub.sock', true); ipc.on('connection', (clientId, socket) => { console.log('Client joined:', clientId); }); ipc.on('message', (data, clientId) => { console.log(`From ${clientId}:`, data); // Reply to sender, or ask and wait ipc.sendTo(clientId, { ack: true }); }); ``` **Client (Spoke):** ```typescript const ipc = container.feature('ipcSocket'); await ipc.connect('/tmp/hub.sock', { reconnect: true, name: 'worker-1' }); // Fire and forget await ipc.send({ type: 'status', ready: true }); // Request/reply ipc.on('message', (data) => { if (data.requestId) ipc.reply(data.requestId, { result: 42 }); }); ```",
|
|
20334
20668
|
"shortcut": "features.ipcSocket",
|
|
20335
20669
|
"className": "IpcSocket",
|
|
20336
20670
|
"methods": {
|
|
@@ -20370,61 +20704,127 @@ export const introspectionData = [
|
|
|
20370
20704
|
]
|
|
20371
20705
|
},
|
|
20372
20706
|
"broadcast": {
|
|
20373
|
-
"description": "Broadcasts a message to all connected clients (server mode only).
|
|
20707
|
+
"description": "Broadcasts a message to all connected clients (server mode only).",
|
|
20374
20708
|
"parameters": {
|
|
20375
20709
|
"message": {
|
|
20376
20710
|
"type": "any",
|
|
20377
|
-
"description": "The message object to broadcast
|
|
20711
|
+
"description": "The message object to broadcast"
|
|
20712
|
+
},
|
|
20713
|
+
"exclude": {
|
|
20714
|
+
"type": "string",
|
|
20715
|
+
"description": "Optional client ID to exclude from broadcast"
|
|
20378
20716
|
}
|
|
20379
20717
|
},
|
|
20380
20718
|
"required": [
|
|
20381
20719
|
"message"
|
|
20382
20720
|
],
|
|
20383
|
-
"returns": "void"
|
|
20384
|
-
|
|
20385
|
-
|
|
20386
|
-
|
|
20387
|
-
|
|
20721
|
+
"returns": "void"
|
|
20722
|
+
},
|
|
20723
|
+
"sendTo": {
|
|
20724
|
+
"description": "Sends a message to a specific client by ID (server mode only).",
|
|
20725
|
+
"parameters": {
|
|
20726
|
+
"clientId": {
|
|
20727
|
+
"type": "string",
|
|
20728
|
+
"description": "The target client ID"
|
|
20729
|
+
},
|
|
20730
|
+
"message": {
|
|
20731
|
+
"type": "any",
|
|
20732
|
+
"description": "The message to send"
|
|
20388
20733
|
}
|
|
20389
|
-
|
|
20734
|
+
},
|
|
20735
|
+
"required": [
|
|
20736
|
+
"clientId",
|
|
20737
|
+
"message"
|
|
20738
|
+
],
|
|
20739
|
+
"returns": "boolean"
|
|
20390
20740
|
},
|
|
20391
20741
|
"send": {
|
|
20392
|
-
"description": "
|
|
20742
|
+
"description": "Fire-and-forget: sends a message to the server (client mode only). For server→client, use sendTo() or broadcast().",
|
|
20393
20743
|
"parameters": {
|
|
20394
20744
|
"message": {
|
|
20395
20745
|
"type": "any",
|
|
20396
|
-
"description": "The message
|
|
20746
|
+
"description": "The message to send"
|
|
20397
20747
|
}
|
|
20398
20748
|
},
|
|
20399
20749
|
"required": [
|
|
20400
20750
|
"message"
|
|
20401
20751
|
],
|
|
20402
|
-
"returns": "void"
|
|
20403
|
-
|
|
20404
|
-
|
|
20405
|
-
|
|
20406
|
-
|
|
20752
|
+
"returns": "void"
|
|
20753
|
+
},
|
|
20754
|
+
"ask": {
|
|
20755
|
+
"description": "Sends a message and waits for a correlated reply. Works in both client and server mode. The recipient should call `reply(requestId, response)` to respond.",
|
|
20756
|
+
"parameters": {
|
|
20757
|
+
"message": {
|
|
20758
|
+
"type": "any",
|
|
20759
|
+
"description": "The message to send"
|
|
20760
|
+
},
|
|
20761
|
+
"options": {
|
|
20762
|
+
"type": "{ clientId?: string; timeoutMs?: number }",
|
|
20763
|
+
"description": "Optional: clientId (server mode target), timeoutMs"
|
|
20407
20764
|
}
|
|
20408
|
-
|
|
20765
|
+
},
|
|
20766
|
+
"required": [
|
|
20767
|
+
"message"
|
|
20768
|
+
],
|
|
20769
|
+
"returns": "Promise<any>"
|
|
20770
|
+
},
|
|
20771
|
+
"reply": {
|
|
20772
|
+
"description": "Sends a reply to a previous ask() call, correlated by requestId.",
|
|
20773
|
+
"parameters": {
|
|
20774
|
+
"requestId": {
|
|
20775
|
+
"type": "string",
|
|
20776
|
+
"description": "The requestId from the incoming message"
|
|
20777
|
+
},
|
|
20778
|
+
"data": {
|
|
20779
|
+
"type": "any",
|
|
20780
|
+
"description": "The reply payload"
|
|
20781
|
+
},
|
|
20782
|
+
"clientId": {
|
|
20783
|
+
"type": "string",
|
|
20784
|
+
"description": "Target client (server mode; for client mode, omit)"
|
|
20785
|
+
}
|
|
20786
|
+
},
|
|
20787
|
+
"required": [
|
|
20788
|
+
"requestId",
|
|
20789
|
+
"data"
|
|
20790
|
+
],
|
|
20791
|
+
"returns": "void"
|
|
20409
20792
|
},
|
|
20410
20793
|
"connect": {
|
|
20411
|
-
"description": "Connects to an IPC server at the specified socket path (client mode).
|
|
20794
|
+
"description": "Connects to an IPC server at the specified socket path (client mode).",
|
|
20412
20795
|
"parameters": {
|
|
20413
20796
|
"socketPath": {
|
|
20414
20797
|
"type": "string",
|
|
20415
|
-
"description": "
|
|
20798
|
+
"description": "Path to the server's Unix domain socket"
|
|
20799
|
+
},
|
|
20800
|
+
"options": {
|
|
20801
|
+
"type": "{ reconnect?: boolean; name?: string }",
|
|
20802
|
+
"description": "Optional: reconnect (enable auto-reconnect), name (identify this client)"
|
|
20416
20803
|
}
|
|
20417
20804
|
},
|
|
20418
20805
|
"required": [
|
|
20419
20806
|
"socketPath"
|
|
20420
20807
|
],
|
|
20421
|
-
"returns": "Promise<Socket>"
|
|
20422
|
-
|
|
20423
|
-
|
|
20424
|
-
|
|
20425
|
-
|
|
20808
|
+
"returns": "Promise<Socket>"
|
|
20809
|
+
},
|
|
20810
|
+
"disconnect": {
|
|
20811
|
+
"description": "Disconnects the client and stops any reconnection attempts.",
|
|
20812
|
+
"parameters": {},
|
|
20813
|
+
"required": [],
|
|
20814
|
+
"returns": "void"
|
|
20815
|
+
},
|
|
20816
|
+
"probeSocket": {
|
|
20817
|
+
"description": "Probe an existing socket to see if a live listener is behind it. Attempts a quick connect — if it succeeds, someone is listening.",
|
|
20818
|
+
"parameters": {
|
|
20819
|
+
"socketPath": {
|
|
20820
|
+
"type": "string",
|
|
20821
|
+
"description": "Parameter socketPath"
|
|
20426
20822
|
}
|
|
20427
|
-
|
|
20823
|
+
},
|
|
20824
|
+
"required": [
|
|
20825
|
+
"socketPath"
|
|
20826
|
+
],
|
|
20827
|
+
"returns": "Promise<boolean>"
|
|
20428
20828
|
}
|
|
20429
20829
|
},
|
|
20430
20830
|
"getters": {
|
|
@@ -20436,12 +20836,25 @@ export const introspectionData = [
|
|
|
20436
20836
|
"description": "Checks if the IPC socket is operating in server mode.",
|
|
20437
20837
|
"returns": "any"
|
|
20438
20838
|
},
|
|
20839
|
+
"clientCount": {
|
|
20840
|
+
"description": "Returns the number of currently connected clients (server mode).",
|
|
20841
|
+
"returns": "any"
|
|
20842
|
+
},
|
|
20843
|
+
"connectedClients": {
|
|
20844
|
+
"description": "Returns info about all connected clients (server mode).",
|
|
20845
|
+
"returns": "Array<{ id: string; name?: string; connectedAt: number }>"
|
|
20846
|
+
},
|
|
20439
20847
|
"connection": {
|
|
20440
20848
|
"description": "Gets the current client connection socket.",
|
|
20441
20849
|
"returns": "any"
|
|
20442
20850
|
}
|
|
20443
20851
|
},
|
|
20444
20852
|
"events": {
|
|
20853
|
+
"disconnection": {
|
|
20854
|
+
"name": "disconnection",
|
|
20855
|
+
"description": "Event emitted by IpcSocket",
|
|
20856
|
+
"arguments": {}
|
|
20857
|
+
},
|
|
20445
20858
|
"connection": {
|
|
20446
20859
|
"name": "connection",
|
|
20447
20860
|
"description": "Event emitted by IpcSocket",
|
|
@@ -21356,10 +21769,68 @@ export const introspectionData = [
|
|
|
21356
21769
|
},
|
|
21357
21770
|
{
|
|
21358
21771
|
"id": "features.processManager",
|
|
21359
|
-
"description": "Manages long-running child processes with tracking, events, and automatic cleanup. Unlike the `proc` feature whose spawn methods block until the child exits, ProcessManager returns a SpawnHandler immediately — a handle object with its own state, events, and lifecycle methods. The feature tracks all spawned processes, maintains observable state, and can automatically kill them on parent exit.",
|
|
21772
|
+
"description": "Manages long-running child processes with tracking, events, and automatic cleanup. Unlike the `proc` feature whose spawn methods block until the child exits, ProcessManager returns a SpawnHandler immediately — a handle object with its own state, events, and lifecycle methods. The feature tracks all spawned processes, maintains observable state, and can automatically kill them on parent exit. Each handler maintains a memory-efficient output buffer: the first 20 lines (head) and last 50 lines (tail) of stdout/stderr are kept, everything in between is discarded.",
|
|
21360
21773
|
"shortcut": "features.processManager",
|
|
21361
21774
|
"className": "ProcessManager",
|
|
21362
21775
|
"methods": {
|
|
21776
|
+
"spawnProcess": {
|
|
21777
|
+
"description": "Tool handler: spawn a long-running background process.",
|
|
21778
|
+
"parameters": {
|
|
21779
|
+
"args": {
|
|
21780
|
+
"type": "{ command: string; args?: string; tag?: string; cwd?: string }",
|
|
21781
|
+
"description": "Parameter args"
|
|
21782
|
+
}
|
|
21783
|
+
},
|
|
21784
|
+
"required": [
|
|
21785
|
+
"args"
|
|
21786
|
+
],
|
|
21787
|
+
"returns": "void"
|
|
21788
|
+
},
|
|
21789
|
+
"runCommand": {
|
|
21790
|
+
"description": "Tool handler: run a command to completion and return its output.",
|
|
21791
|
+
"parameters": {
|
|
21792
|
+
"args": {
|
|
21793
|
+
"type": "{ command: string; cwd?: string }",
|
|
21794
|
+
"description": "Parameter args"
|
|
21795
|
+
}
|
|
21796
|
+
},
|
|
21797
|
+
"required": [
|
|
21798
|
+
"args"
|
|
21799
|
+
],
|
|
21800
|
+
"returns": "void"
|
|
21801
|
+
},
|
|
21802
|
+
"listProcesses": {
|
|
21803
|
+
"description": "Tool handler: list all tracked processes.",
|
|
21804
|
+
"parameters": {},
|
|
21805
|
+
"required": [],
|
|
21806
|
+
"returns": "void"
|
|
21807
|
+
},
|
|
21808
|
+
"getProcessOutput": {
|
|
21809
|
+
"description": "Tool handler: peek at a process's buffered output.",
|
|
21810
|
+
"parameters": {
|
|
21811
|
+
"args": {
|
|
21812
|
+
"type": "{ id?: string; tag?: string; stream?: string }",
|
|
21813
|
+
"description": "Parameter args"
|
|
21814
|
+
}
|
|
21815
|
+
},
|
|
21816
|
+
"required": [
|
|
21817
|
+
"args"
|
|
21818
|
+
],
|
|
21819
|
+
"returns": "void"
|
|
21820
|
+
},
|
|
21821
|
+
"killProcess": {
|
|
21822
|
+
"description": "Tool handler: kill a process by ID or tag.",
|
|
21823
|
+
"parameters": {
|
|
21824
|
+
"args": {
|
|
21825
|
+
"type": "{ id?: string; tag?: string; signal?: string }",
|
|
21826
|
+
"description": "Parameter args"
|
|
21827
|
+
}
|
|
21828
|
+
},
|
|
21829
|
+
"required": [
|
|
21830
|
+
"args"
|
|
21831
|
+
],
|
|
21832
|
+
"returns": "void"
|
|
21833
|
+
},
|
|
21363
21834
|
"spawn": {
|
|
21364
21835
|
"description": "Spawn a long-running process and return a handle immediately. The returned SpawnHandler provides events for stdout/stderr streaming, exit/crash notifications, and methods to kill or await the process.",
|
|
21365
21836
|
"parameters": {
|
|
@@ -21537,7 +22008,7 @@ export const introspectionData = [
|
|
|
21537
22008
|
"examples": [
|
|
21538
22009
|
{
|
|
21539
22010
|
"language": "ts",
|
|
21540
|
-
"code": "const pm = container.feature('processManager', { enable: true })\n\nconst server = pm.spawn('node', ['server.js'], { tag: 'api', cwd: '/app' })\nserver.on('stdout', (data) => console.log('[api]', data))\nserver.on('crash', (code) => console.error('API crashed:', code))\n\n// Kill one\nserver.kill()\n\n// Kill all tracked processes\npm.killAll()\n\n// List and lookup\npm.list() // SpawnHandler[]\npm.getByTag('api') // SpawnHandler | undefined"
|
|
22011
|
+
"code": "const pm = container.feature('processManager', { enable: true })\n\nconst server = pm.spawn('node', ['server.js'], { tag: 'api', cwd: '/app' })\nserver.on('stdout', (data) => console.log('[api]', data))\nserver.on('crash', (code) => console.error('API crashed:', code))\n\n// Peek at buffered output\nconst { head, tail } = server.peek()\n\n// Kill one\nserver.kill()\n\n// Kill all tracked processes\npm.killAll()\n\n// List and lookup\npm.list() // SpawnHandler[]\npm.getByTag('api') // SpawnHandler | undefined"
|
|
21541
22012
|
}
|
|
21542
22013
|
]
|
|
21543
22014
|
},
|
|
@@ -23895,7 +24366,7 @@ export const introspectionData = [
|
|
|
23895
24366
|
},
|
|
23896
24367
|
{
|
|
23897
24368
|
"id": "clients.websocket",
|
|
23898
|
-
"description": "
|
|
24369
|
+
"description": "WebSocketClient helper",
|
|
23899
24370
|
"shortcut": "clients.websocket",
|
|
23900
24371
|
"className": "WebSocketClient",
|
|
23901
24372
|
"methods": {
|
|
@@ -23918,6 +24389,59 @@ export const introspectionData = [
|
|
|
23918
24389
|
],
|
|
23919
24390
|
"returns": "Promise<void>"
|
|
23920
24391
|
},
|
|
24392
|
+
"ask": {
|
|
24393
|
+
"description": "Send a request and wait for a correlated response. The message is sent with a unique `requestId`; the remote side is expected to reply with a message containing `replyTo` set to that same ID.",
|
|
24394
|
+
"parameters": {
|
|
24395
|
+
"type": {
|
|
24396
|
+
"type": "string",
|
|
24397
|
+
"description": "A string identifying the request type"
|
|
24398
|
+
},
|
|
24399
|
+
"data": {
|
|
24400
|
+
"type": "any",
|
|
24401
|
+
"description": "Optional payload to include with the request"
|
|
24402
|
+
},
|
|
24403
|
+
"timeout": {
|
|
24404
|
+
"type": "any",
|
|
24405
|
+
"description": "How long to wait for a response (default 10 000 ms)"
|
|
24406
|
+
}
|
|
24407
|
+
},
|
|
24408
|
+
"required": [
|
|
24409
|
+
"type"
|
|
24410
|
+
],
|
|
24411
|
+
"returns": "Promise<R>",
|
|
24412
|
+
"examples": [
|
|
24413
|
+
{
|
|
24414
|
+
"language": "ts",
|
|
24415
|
+
"code": "const result = await ws.ask('getUser', { id: 42 })"
|
|
24416
|
+
}
|
|
24417
|
+
]
|
|
24418
|
+
},
|
|
24419
|
+
"_handleReply": {
|
|
24420
|
+
"description": "",
|
|
24421
|
+
"parameters": {
|
|
24422
|
+
"message": {
|
|
24423
|
+
"type": "any",
|
|
24424
|
+
"description": "Parameter message"
|
|
24425
|
+
}
|
|
24426
|
+
},
|
|
24427
|
+
"required": [
|
|
24428
|
+
"message"
|
|
24429
|
+
],
|
|
24430
|
+
"returns": "boolean"
|
|
24431
|
+
},
|
|
24432
|
+
"_rejectAllPending": {
|
|
24433
|
+
"description": "",
|
|
24434
|
+
"parameters": {
|
|
24435
|
+
"reason": {
|
|
24436
|
+
"type": "string",
|
|
24437
|
+
"description": "Parameter reason"
|
|
24438
|
+
}
|
|
24439
|
+
},
|
|
24440
|
+
"required": [
|
|
24441
|
+
"reason"
|
|
24442
|
+
],
|
|
24443
|
+
"returns": "void"
|
|
24444
|
+
},
|
|
23921
24445
|
"disconnect": {
|
|
23922
24446
|
"description": "Gracefully close the WebSocket connection. Suppresses auto-reconnect and updates connection state to disconnected.",
|
|
23923
24447
|
"parameters": {},
|
|
@@ -23960,13 +24484,7 @@ export const introspectionData = [
|
|
|
23960
24484
|
},
|
|
23961
24485
|
"state": {},
|
|
23962
24486
|
"options": {},
|
|
23963
|
-
"envVars": []
|
|
23964
|
-
"examples": [
|
|
23965
|
-
{
|
|
23966
|
-
"language": "ts",
|
|
23967
|
-
"code": "const ws = container.client('websocket', {\n baseURL: 'ws://localhost:8080',\n reconnect: true,\n maxReconnectAttempts: 5\n})\nws.on('message', (data) => console.log('Received:', data))\nawait ws.connect()\nawait ws.send({ type: 'hello' })"
|
|
23968
|
-
}
|
|
23969
|
-
]
|
|
24487
|
+
"envVars": []
|
|
23970
24488
|
},
|
|
23971
24489
|
{
|
|
23972
24490
|
"id": "clients.openai",
|
|
@@ -24431,27 +24949,228 @@ export const introspectionData = [
|
|
|
24431
24949
|
]
|
|
24432
24950
|
},
|
|
24433
24951
|
{
|
|
24434
|
-
"id": "clients.
|
|
24435
|
-
"description": "
|
|
24436
|
-
"shortcut": "clients.
|
|
24437
|
-
"className": "
|
|
24952
|
+
"id": "clients.elevenlabs",
|
|
24953
|
+
"description": "ElevenLabs client — text-to-speech synthesis via the ElevenLabs REST API. Provides methods for listing voices, listing models, and generating speech audio. Audio is returned as a Buffer; use `say()` for a convenience method that writes to disk.",
|
|
24954
|
+
"shortcut": "clients.elevenlabs",
|
|
24955
|
+
"className": "ElevenLabsClient",
|
|
24438
24956
|
"methods": {
|
|
24439
|
-
"
|
|
24440
|
-
"description": "
|
|
24441
|
-
"parameters": {
|
|
24442
|
-
|
|
24443
|
-
|
|
24444
|
-
|
|
24445
|
-
|
|
24446
|
-
|
|
24447
|
-
|
|
24448
|
-
|
|
24449
|
-
|
|
24450
|
-
|
|
24451
|
-
|
|
24452
|
-
|
|
24453
|
-
|
|
24454
|
-
|
|
24957
|
+
"beforeRequest": {
|
|
24958
|
+
"description": "Inject the xi-api-key header before each request.",
|
|
24959
|
+
"parameters": {},
|
|
24960
|
+
"required": [],
|
|
24961
|
+
"returns": "void"
|
|
24962
|
+
},
|
|
24963
|
+
"connect": {
|
|
24964
|
+
"description": "Validate the API key by listing available models.",
|
|
24965
|
+
"parameters": {},
|
|
24966
|
+
"required": [],
|
|
24967
|
+
"returns": "Promise<this>",
|
|
24968
|
+
"examples": [
|
|
24969
|
+
{
|
|
24970
|
+
"language": "ts",
|
|
24971
|
+
"code": "await el.connect()"
|
|
24972
|
+
}
|
|
24973
|
+
]
|
|
24974
|
+
},
|
|
24975
|
+
"listVoices": {
|
|
24976
|
+
"description": "List available voices with optional search and filtering.",
|
|
24977
|
+
"parameters": {
|
|
24978
|
+
"options": {
|
|
24979
|
+
"type": "{\n search?: string\n category?: string\n voice_type?: string\n page_size?: number\n next_page_token?: string\n }",
|
|
24980
|
+
"description": "Query parameters for filtering voices"
|
|
24981
|
+
}
|
|
24982
|
+
},
|
|
24983
|
+
"required": [],
|
|
24984
|
+
"returns": "Promise<any>",
|
|
24985
|
+
"examples": [
|
|
24986
|
+
{
|
|
24987
|
+
"language": "ts",
|
|
24988
|
+
"code": "const voices = await el.listVoices()\nconst premade = await el.listVoices({ category: 'premade' })"
|
|
24989
|
+
}
|
|
24990
|
+
]
|
|
24991
|
+
},
|
|
24992
|
+
"getVoice": {
|
|
24993
|
+
"description": "Get details for a single voice.",
|
|
24994
|
+
"parameters": {
|
|
24995
|
+
"voiceId": {
|
|
24996
|
+
"type": "string",
|
|
24997
|
+
"description": "The voice ID to look up"
|
|
24998
|
+
}
|
|
24999
|
+
},
|
|
25000
|
+
"required": [
|
|
25001
|
+
"voiceId"
|
|
25002
|
+
],
|
|
25003
|
+
"returns": "Promise<any>",
|
|
25004
|
+
"examples": [
|
|
25005
|
+
{
|
|
25006
|
+
"language": "ts",
|
|
25007
|
+
"code": "const voice = await el.getVoice('21m00Tcm4TlvDq8ikWAM')\nconsole.log(voice.name, voice.settings)"
|
|
25008
|
+
}
|
|
25009
|
+
]
|
|
25010
|
+
},
|
|
25011
|
+
"listModels": {
|
|
25012
|
+
"description": "List available TTS models.",
|
|
25013
|
+
"parameters": {},
|
|
25014
|
+
"required": [],
|
|
25015
|
+
"returns": "Promise<any[]>",
|
|
25016
|
+
"examples": [
|
|
25017
|
+
{
|
|
25018
|
+
"language": "ts",
|
|
25019
|
+
"code": "const models = await el.listModels()\nconsole.log(models.map(m => m.model_id))"
|
|
25020
|
+
}
|
|
25021
|
+
]
|
|
25022
|
+
},
|
|
25023
|
+
"synthesize": {
|
|
25024
|
+
"description": "Synthesize speech from text, returning audio as a Buffer.",
|
|
25025
|
+
"parameters": {
|
|
25026
|
+
"text": {
|
|
25027
|
+
"type": "string",
|
|
25028
|
+
"description": "The text to convert to speech"
|
|
25029
|
+
},
|
|
25030
|
+
"options": {
|
|
25031
|
+
"type": "SynthesizeOptions",
|
|
25032
|
+
"description": "Voice, model, format, and voice settings overrides",
|
|
25033
|
+
"properties": {
|
|
25034
|
+
"voiceId": {
|
|
25035
|
+
"type": "string",
|
|
25036
|
+
"description": ""
|
|
25037
|
+
},
|
|
25038
|
+
"modelId": {
|
|
25039
|
+
"type": "string",
|
|
25040
|
+
"description": ""
|
|
25041
|
+
},
|
|
25042
|
+
"outputFormat": {
|
|
25043
|
+
"type": "string",
|
|
25044
|
+
"description": ""
|
|
25045
|
+
},
|
|
25046
|
+
"voiceSettings": {
|
|
25047
|
+
"type": "ElevenLabsVoiceSettings",
|
|
25048
|
+
"description": ""
|
|
25049
|
+
},
|
|
25050
|
+
"disableCache": {
|
|
25051
|
+
"type": "boolean",
|
|
25052
|
+
"description": ""
|
|
25053
|
+
}
|
|
25054
|
+
}
|
|
25055
|
+
}
|
|
25056
|
+
},
|
|
25057
|
+
"required": [
|
|
25058
|
+
"text"
|
|
25059
|
+
],
|
|
25060
|
+
"returns": "Promise<Buffer>",
|
|
25061
|
+
"examples": [
|
|
25062
|
+
{
|
|
25063
|
+
"language": "ts",
|
|
25064
|
+
"code": "const audio = await el.synthesize('Hello world')\n// audio is a Buffer of mp3 data\n\nconst custom = await el.synthesize('Hello', {\n voiceId: '21m00Tcm4TlvDq8ikWAM',\n voiceSettings: { stability: 0.5, similarityBoost: 0.8 }\n})"
|
|
25065
|
+
}
|
|
25066
|
+
]
|
|
25067
|
+
},
|
|
25068
|
+
"say": {
|
|
25069
|
+
"description": "Synthesize speech and write the audio to a file.",
|
|
25070
|
+
"parameters": {
|
|
25071
|
+
"text": {
|
|
25072
|
+
"type": "string",
|
|
25073
|
+
"description": "The text to convert to speech"
|
|
25074
|
+
},
|
|
25075
|
+
"outputPath": {
|
|
25076
|
+
"type": "string",
|
|
25077
|
+
"description": "File path to write the audio to"
|
|
25078
|
+
},
|
|
25079
|
+
"options": {
|
|
25080
|
+
"type": "SynthesizeOptions",
|
|
25081
|
+
"description": "Voice, model, format, and voice settings overrides",
|
|
25082
|
+
"properties": {
|
|
25083
|
+
"voiceId": {
|
|
25084
|
+
"type": "string",
|
|
25085
|
+
"description": ""
|
|
25086
|
+
},
|
|
25087
|
+
"modelId": {
|
|
25088
|
+
"type": "string",
|
|
25089
|
+
"description": ""
|
|
25090
|
+
},
|
|
25091
|
+
"outputFormat": {
|
|
25092
|
+
"type": "string",
|
|
25093
|
+
"description": ""
|
|
25094
|
+
},
|
|
25095
|
+
"voiceSettings": {
|
|
25096
|
+
"type": "ElevenLabsVoiceSettings",
|
|
25097
|
+
"description": ""
|
|
25098
|
+
},
|
|
25099
|
+
"disableCache": {
|
|
25100
|
+
"type": "boolean",
|
|
25101
|
+
"description": ""
|
|
25102
|
+
}
|
|
25103
|
+
}
|
|
25104
|
+
}
|
|
25105
|
+
},
|
|
25106
|
+
"required": [
|
|
25107
|
+
"text",
|
|
25108
|
+
"outputPath"
|
|
25109
|
+
],
|
|
25110
|
+
"returns": "Promise<string>",
|
|
25111
|
+
"examples": [
|
|
25112
|
+
{
|
|
25113
|
+
"language": "ts",
|
|
25114
|
+
"code": "const path = await el.say('Hello world', './hello.mp3')\nconsole.log(`Audio saved to ${path}`)"
|
|
25115
|
+
}
|
|
25116
|
+
]
|
|
25117
|
+
}
|
|
25118
|
+
},
|
|
25119
|
+
"getters": {
|
|
25120
|
+
"apiKey": {
|
|
25121
|
+
"description": "The resolved API key from options or environment.",
|
|
25122
|
+
"returns": "string"
|
|
25123
|
+
}
|
|
25124
|
+
},
|
|
25125
|
+
"events": {
|
|
25126
|
+
"failure": {
|
|
25127
|
+
"name": "failure",
|
|
25128
|
+
"description": "Event emitted by ElevenLabsClient",
|
|
25129
|
+
"arguments": {}
|
|
25130
|
+
},
|
|
25131
|
+
"voices": {
|
|
25132
|
+
"name": "voices",
|
|
25133
|
+
"description": "Event emitted by ElevenLabsClient",
|
|
25134
|
+
"arguments": {}
|
|
25135
|
+
},
|
|
25136
|
+
"speech": {
|
|
25137
|
+
"name": "speech",
|
|
25138
|
+
"description": "Event emitted by ElevenLabsClient",
|
|
25139
|
+
"arguments": {}
|
|
25140
|
+
}
|
|
25141
|
+
},
|
|
25142
|
+
"state": {},
|
|
25143
|
+
"options": {},
|
|
25144
|
+
"envVars": [],
|
|
25145
|
+
"examples": [
|
|
25146
|
+
{
|
|
25147
|
+
"language": "ts",
|
|
25148
|
+
"code": "const el = container.client('elevenlabs')\nawait el.connect()\nconst voices = await el.listVoices()\nconst audio = await el.synthesize('Hello world')\n// audio is a Buffer of mp3 data"
|
|
25149
|
+
}
|
|
25150
|
+
]
|
|
25151
|
+
},
|
|
25152
|
+
{
|
|
25153
|
+
"id": "clients.comfyui",
|
|
25154
|
+
"description": "ComfyUI client — execute Stable Diffusion workflows via the ComfyUI API. Connects to a ComfyUI instance to queue prompts, track execution via WebSocket or polling, and download generated images. Supports both UI-format and API-format workflows with automatic conversion.",
|
|
25155
|
+
"shortcut": "clients.comfyui",
|
|
25156
|
+
"className": "ComfyUIClient",
|
|
25157
|
+
"methods": {
|
|
25158
|
+
"queuePrompt": {
|
|
25159
|
+
"description": "Queue a prompt (API-format workflow) for execution.",
|
|
25160
|
+
"parameters": {
|
|
25161
|
+
"prompt": {
|
|
25162
|
+
"type": "Record<string, any>",
|
|
25163
|
+
"description": "The API-format workflow object"
|
|
25164
|
+
},
|
|
25165
|
+
"clientId": {
|
|
25166
|
+
"type": "string",
|
|
25167
|
+
"description": "Override the client ID for this request"
|
|
25168
|
+
}
|
|
25169
|
+
},
|
|
25170
|
+
"required": [
|
|
25171
|
+
"prompt"
|
|
25172
|
+
],
|
|
25173
|
+
"returns": "Promise<{ prompt_id: string; number: number }>",
|
|
24455
25174
|
"examples": [
|
|
24456
25175
|
{
|
|
24457
25176
|
"language": "ts",
|
|
@@ -24551,324 +25270,123 @@ export const introspectionData = [
|
|
|
24551
25270
|
},
|
|
24552
25271
|
"type": {
|
|
24553
25272
|
"type": "any",
|
|
24554
|
-
"description": "Image type ('output', 'input', 'temp')"
|
|
24555
|
-
}
|
|
24556
|
-
},
|
|
24557
|
-
"required": [
|
|
24558
|
-
"filename"
|
|
24559
|
-
],
|
|
24560
|
-
"returns": "Promise<Buffer>"
|
|
24561
|
-
},
|
|
24562
|
-
"connectWs": {
|
|
24563
|
-
"description": "Open a WebSocket connection to ComfyUI for real-time execution tracking. Events emitted: `execution_start`, `executing`, `progress`, `executed`, `execution_cached`, `execution_error`, `execution_complete`.",
|
|
24564
|
-
"parameters": {},
|
|
24565
|
-
"required": [],
|
|
24566
|
-
"returns": "Promise<void>"
|
|
24567
|
-
},
|
|
24568
|
-
"disconnectWs": {
|
|
24569
|
-
"description": "Close the WebSocket connection.",
|
|
24570
|
-
"parameters": {},
|
|
24571
|
-
"required": [],
|
|
24572
|
-
"returns": "void"
|
|
24573
|
-
},
|
|
24574
|
-
"toApiFormat": {
|
|
24575
|
-
"description": "Convert a UI-format workflow to the API format that /prompt expects. Requires a running ComfyUI instance to fetch `object_info` so we can map positional `widgets_values` to their named input fields. If the workflow is already in API format, it's returned as-is.",
|
|
24576
|
-
"parameters": {
|
|
24577
|
-
"workflow": {
|
|
24578
|
-
"type": "Record<string, any>",
|
|
24579
|
-
"description": "Parameter workflow"
|
|
24580
|
-
}
|
|
24581
|
-
},
|
|
24582
|
-
"required": [
|
|
24583
|
-
"workflow"
|
|
24584
|
-
],
|
|
24585
|
-
"returns": "Promise<Record<string, any>>"
|
|
24586
|
-
},
|
|
24587
|
-
"runWorkflow": {
|
|
24588
|
-
"description": "Run a ComfyUI workflow with optional runtime input overrides. Inputs can be provided in two forms: **Direct node mapping** (when no `inputMap` in options): ``` { '3': { seed: 42 }, '6': { text: 'a cat' } } ``` **Named inputs** (when `inputMap` is provided in options): ``` inputs: { positive_prompt: 'a cat', seed: 42 } options.inputMap: { positive_prompt: { nodeId: '6', field: 'text' }, seed: { nodeId: '3', field: 'seed' } } ```",
|
|
24589
|
-
"parameters": {
|
|
24590
|
-
"workflow": {
|
|
24591
|
-
"type": "Record<string, any>",
|
|
24592
|
-
"description": "Parameter workflow"
|
|
24593
|
-
},
|
|
24594
|
-
"inputs": {
|
|
24595
|
-
"type": "Record<string, any>",
|
|
24596
|
-
"description": "Parameter inputs"
|
|
24597
|
-
},
|
|
24598
|
-
"options": {
|
|
24599
|
-
"type": "WorkflowRunOptions",
|
|
24600
|
-
"description": "Parameter options",
|
|
24601
|
-
"properties": {
|
|
24602
|
-
"poll": {
|
|
24603
|
-
"type": "boolean",
|
|
24604
|
-
"description": "Use polling instead of WebSocket for tracking execution"
|
|
24605
|
-
},
|
|
24606
|
-
"pollInterval": {
|
|
24607
|
-
"type": "number",
|
|
24608
|
-
"description": "Polling interval in ms (default 1000)"
|
|
24609
|
-
},
|
|
24610
|
-
"inputMap": {
|
|
24611
|
-
"type": "InputMapping",
|
|
24612
|
-
"description": "Named input mapping: semantic name -> { nodeId, field }"
|
|
24613
|
-
},
|
|
24614
|
-
"outputDir": {
|
|
24615
|
-
"type": "string",
|
|
24616
|
-
"description": "If provided, output images are downloaded to this directory"
|
|
24617
|
-
}
|
|
24618
|
-
}
|
|
24619
|
-
}
|
|
24620
|
-
},
|
|
24621
|
-
"required": [
|
|
24622
|
-
"workflow"
|
|
24623
|
-
],
|
|
24624
|
-
"returns": "Promise<WorkflowResult>"
|
|
24625
|
-
}
|
|
24626
|
-
},
|
|
24627
|
-
"getters": {
|
|
24628
|
-
"clientId": {
|
|
24629
|
-
"description": "The unique client ID used for WebSocket session tracking.",
|
|
24630
|
-
"returns": "string"
|
|
24631
|
-
},
|
|
24632
|
-
"wsURL": {
|
|
24633
|
-
"description": "The WebSocket URL derived from baseURL or overridden via options.",
|
|
24634
|
-
"returns": "string"
|
|
24635
|
-
}
|
|
24636
|
-
},
|
|
24637
|
-
"events": {
|
|
24638
|
-
"execution_start": {
|
|
24639
|
-
"name": "execution_start",
|
|
24640
|
-
"description": "Event emitted by ComfyUIClient",
|
|
24641
|
-
"arguments": {}
|
|
24642
|
-
},
|
|
24643
|
-
"execution_complete": {
|
|
24644
|
-
"name": "execution_complete",
|
|
24645
|
-
"description": "Event emitted by ComfyUIClient",
|
|
24646
|
-
"arguments": {}
|
|
24647
|
-
},
|
|
24648
|
-
"executing": {
|
|
24649
|
-
"name": "executing",
|
|
24650
|
-
"description": "Event emitted by ComfyUIClient",
|
|
24651
|
-
"arguments": {}
|
|
24652
|
-
},
|
|
24653
|
-
"progress": {
|
|
24654
|
-
"name": "progress",
|
|
24655
|
-
"description": "Event emitted by ComfyUIClient",
|
|
24656
|
-
"arguments": {}
|
|
24657
|
-
},
|
|
24658
|
-
"executed": {
|
|
24659
|
-
"name": "executed",
|
|
24660
|
-
"description": "Event emitted by ComfyUIClient",
|
|
24661
|
-
"arguments": {}
|
|
24662
|
-
},
|
|
24663
|
-
"execution_cached": {
|
|
24664
|
-
"name": "execution_cached",
|
|
24665
|
-
"description": "Event emitted by ComfyUIClient",
|
|
24666
|
-
"arguments": {}
|
|
24667
|
-
},
|
|
24668
|
-
"execution_error": {
|
|
24669
|
-
"name": "execution_error",
|
|
24670
|
-
"description": "Event emitted by ComfyUIClient",
|
|
24671
|
-
"arguments": {}
|
|
24672
|
-
}
|
|
24673
|
-
},
|
|
24674
|
-
"state": {},
|
|
24675
|
-
"options": {},
|
|
24676
|
-
"envVars": [],
|
|
24677
|
-
"examples": [
|
|
24678
|
-
{
|
|
24679
|
-
"language": "ts",
|
|
24680
|
-
"code": "const comfy = container.client('comfyui', { baseURL: 'http://localhost:8188' })\nconst result = await comfy.runWorkflow(workflow, {\n '6': { text: 'a beautiful sunset' }\n})\nconsole.log(result.images)"
|
|
24681
|
-
}
|
|
24682
|
-
]
|
|
24683
|
-
},
|
|
24684
|
-
{
|
|
24685
|
-
"id": "clients.elevenlabs",
|
|
24686
|
-
"description": "ElevenLabs client — text-to-speech synthesis via the ElevenLabs REST API. Provides methods for listing voices, listing models, and generating speech audio. Audio is returned as a Buffer; use `say()` for a convenience method that writes to disk.",
|
|
24687
|
-
"shortcut": "clients.elevenlabs",
|
|
24688
|
-
"className": "ElevenLabsClient",
|
|
24689
|
-
"methods": {
|
|
24690
|
-
"beforeRequest": {
|
|
24691
|
-
"description": "Inject the xi-api-key header before each request.",
|
|
24692
|
-
"parameters": {},
|
|
24693
|
-
"required": [],
|
|
24694
|
-
"returns": "void"
|
|
24695
|
-
},
|
|
24696
|
-
"connect": {
|
|
24697
|
-
"description": "Validate the API key by listing available models.",
|
|
24698
|
-
"parameters": {},
|
|
24699
|
-
"required": [],
|
|
24700
|
-
"returns": "Promise<this>",
|
|
24701
|
-
"examples": [
|
|
24702
|
-
{
|
|
24703
|
-
"language": "ts",
|
|
24704
|
-
"code": "await el.connect()"
|
|
24705
|
-
}
|
|
24706
|
-
]
|
|
24707
|
-
},
|
|
24708
|
-
"listVoices": {
|
|
24709
|
-
"description": "List available voices with optional search and filtering.",
|
|
24710
|
-
"parameters": {
|
|
24711
|
-
"options": {
|
|
24712
|
-
"type": "{\n search?: string\n category?: string\n voice_type?: string\n page_size?: number\n next_page_token?: string\n }",
|
|
24713
|
-
"description": "Query parameters for filtering voices"
|
|
24714
|
-
}
|
|
24715
|
-
},
|
|
24716
|
-
"required": [],
|
|
24717
|
-
"returns": "Promise<any>",
|
|
24718
|
-
"examples": [
|
|
24719
|
-
{
|
|
24720
|
-
"language": "ts",
|
|
24721
|
-
"code": "const voices = await el.listVoices()\nconst premade = await el.listVoices({ category: 'premade' })"
|
|
24722
|
-
}
|
|
24723
|
-
]
|
|
24724
|
-
},
|
|
24725
|
-
"getVoice": {
|
|
24726
|
-
"description": "Get details for a single voice.",
|
|
24727
|
-
"parameters": {
|
|
24728
|
-
"voiceId": {
|
|
24729
|
-
"type": "string",
|
|
24730
|
-
"description": "The voice ID to look up"
|
|
24731
|
-
}
|
|
24732
|
-
},
|
|
24733
|
-
"required": [
|
|
24734
|
-
"voiceId"
|
|
24735
|
-
],
|
|
24736
|
-
"returns": "Promise<any>",
|
|
24737
|
-
"examples": [
|
|
24738
|
-
{
|
|
24739
|
-
"language": "ts",
|
|
24740
|
-
"code": "const voice = await el.getVoice('21m00Tcm4TlvDq8ikWAM')\nconsole.log(voice.name, voice.settings)"
|
|
25273
|
+
"description": "Image type ('output', 'input', 'temp')"
|
|
24741
25274
|
}
|
|
24742
|
-
|
|
25275
|
+
},
|
|
25276
|
+
"required": [
|
|
25277
|
+
"filename"
|
|
25278
|
+
],
|
|
25279
|
+
"returns": "Promise<Buffer>"
|
|
24743
25280
|
},
|
|
24744
|
-
"
|
|
24745
|
-
"description": "
|
|
25281
|
+
"connectWs": {
|
|
25282
|
+
"description": "Open a WebSocket connection to ComfyUI for real-time execution tracking. Events emitted: `execution_start`, `executing`, `progress`, `executed`, `execution_cached`, `execution_error`, `execution_complete`.",
|
|
24746
25283
|
"parameters": {},
|
|
24747
25284
|
"required": [],
|
|
24748
|
-
"returns": "Promise<
|
|
24749
|
-
"examples": [
|
|
24750
|
-
{
|
|
24751
|
-
"language": "ts",
|
|
24752
|
-
"code": "const models = await el.listModels()\nconsole.log(models.map(m => m.model_id))"
|
|
24753
|
-
}
|
|
24754
|
-
]
|
|
25285
|
+
"returns": "Promise<void>"
|
|
24755
25286
|
},
|
|
24756
|
-
"
|
|
24757
|
-
"description": "
|
|
25287
|
+
"disconnectWs": {
|
|
25288
|
+
"description": "Close the WebSocket connection.",
|
|
25289
|
+
"parameters": {},
|
|
25290
|
+
"required": [],
|
|
25291
|
+
"returns": "void"
|
|
25292
|
+
},
|
|
25293
|
+
"toApiFormat": {
|
|
25294
|
+
"description": "Convert a UI-format workflow to the API format that /prompt expects. Requires a running ComfyUI instance to fetch `object_info` so we can map positional `widgets_values` to their named input fields. If the workflow is already in API format, it's returned as-is.",
|
|
24758
25295
|
"parameters": {
|
|
24759
|
-
"
|
|
24760
|
-
"type": "string",
|
|
24761
|
-
"description": "
|
|
24762
|
-
},
|
|
24763
|
-
"options": {
|
|
24764
|
-
"type": "SynthesizeOptions",
|
|
24765
|
-
"description": "Voice, model, format, and voice settings overrides",
|
|
24766
|
-
"properties": {
|
|
24767
|
-
"voiceId": {
|
|
24768
|
-
"type": "string",
|
|
24769
|
-
"description": ""
|
|
24770
|
-
},
|
|
24771
|
-
"modelId": {
|
|
24772
|
-
"type": "string",
|
|
24773
|
-
"description": ""
|
|
24774
|
-
},
|
|
24775
|
-
"outputFormat": {
|
|
24776
|
-
"type": "string",
|
|
24777
|
-
"description": ""
|
|
24778
|
-
},
|
|
24779
|
-
"voiceSettings": {
|
|
24780
|
-
"type": "ElevenLabsVoiceSettings",
|
|
24781
|
-
"description": ""
|
|
24782
|
-
},
|
|
24783
|
-
"disableCache": {
|
|
24784
|
-
"type": "boolean",
|
|
24785
|
-
"description": ""
|
|
24786
|
-
}
|
|
24787
|
-
}
|
|
25296
|
+
"workflow": {
|
|
25297
|
+
"type": "Record<string, any>",
|
|
25298
|
+
"description": "Parameter workflow"
|
|
24788
25299
|
}
|
|
24789
25300
|
},
|
|
24790
25301
|
"required": [
|
|
24791
|
-
"
|
|
25302
|
+
"workflow"
|
|
24792
25303
|
],
|
|
24793
|
-
"returns": "Promise<
|
|
24794
|
-
"examples": [
|
|
24795
|
-
{
|
|
24796
|
-
"language": "ts",
|
|
24797
|
-
"code": "const audio = await el.synthesize('Hello world')\n// audio is a Buffer of mp3 data\n\nconst custom = await el.synthesize('Hello', {\n voiceId: '21m00Tcm4TlvDq8ikWAM',\n voiceSettings: { stability: 0.5, similarityBoost: 0.8 }\n})"
|
|
24798
|
-
}
|
|
24799
|
-
]
|
|
25304
|
+
"returns": "Promise<Record<string, any>>"
|
|
24800
25305
|
},
|
|
24801
|
-
"
|
|
24802
|
-
"description": "
|
|
25306
|
+
"runWorkflow": {
|
|
25307
|
+
"description": "Run a ComfyUI workflow with optional runtime input overrides. Inputs can be provided in two forms: **Direct node mapping** (when no `inputMap` in options): ``` { '3': { seed: 42 }, '6': { text: 'a cat' } } ``` **Named inputs** (when `inputMap` is provided in options): ``` inputs: { positive_prompt: 'a cat', seed: 42 } options.inputMap: { positive_prompt: { nodeId: '6', field: 'text' }, seed: { nodeId: '3', field: 'seed' } } ```",
|
|
24803
25308
|
"parameters": {
|
|
24804
|
-
"
|
|
24805
|
-
"type": "string",
|
|
24806
|
-
"description": "
|
|
25309
|
+
"workflow": {
|
|
25310
|
+
"type": "Record<string, any>",
|
|
25311
|
+
"description": "Parameter workflow"
|
|
24807
25312
|
},
|
|
24808
|
-
"
|
|
24809
|
-
"type": "string",
|
|
24810
|
-
"description": "
|
|
25313
|
+
"inputs": {
|
|
25314
|
+
"type": "Record<string, any>",
|
|
25315
|
+
"description": "Parameter inputs"
|
|
24811
25316
|
},
|
|
24812
25317
|
"options": {
|
|
24813
|
-
"type": "
|
|
24814
|
-
"description": "
|
|
25318
|
+
"type": "WorkflowRunOptions",
|
|
25319
|
+
"description": "Parameter options",
|
|
24815
25320
|
"properties": {
|
|
24816
|
-
"
|
|
24817
|
-
"type": "
|
|
24818
|
-
"description": ""
|
|
24819
|
-
},
|
|
24820
|
-
"modelId": {
|
|
24821
|
-
"type": "string",
|
|
24822
|
-
"description": ""
|
|
25321
|
+
"poll": {
|
|
25322
|
+
"type": "boolean",
|
|
25323
|
+
"description": "Use polling instead of WebSocket for tracking execution"
|
|
24823
25324
|
},
|
|
24824
|
-
"
|
|
24825
|
-
"type": "
|
|
24826
|
-
"description": ""
|
|
25325
|
+
"pollInterval": {
|
|
25326
|
+
"type": "number",
|
|
25327
|
+
"description": "Polling interval in ms (default 1000)"
|
|
24827
25328
|
},
|
|
24828
|
-
"
|
|
24829
|
-
"type": "
|
|
24830
|
-
"description": ""
|
|
25329
|
+
"inputMap": {
|
|
25330
|
+
"type": "InputMapping",
|
|
25331
|
+
"description": "Named input mapping: semantic name -> { nodeId, field }"
|
|
24831
25332
|
},
|
|
24832
|
-
"
|
|
24833
|
-
"type": "
|
|
24834
|
-
"description": ""
|
|
25333
|
+
"outputDir": {
|
|
25334
|
+
"type": "string",
|
|
25335
|
+
"description": "If provided, output images are downloaded to this directory"
|
|
24835
25336
|
}
|
|
24836
25337
|
}
|
|
24837
25338
|
}
|
|
24838
25339
|
},
|
|
24839
25340
|
"required": [
|
|
24840
|
-
"
|
|
24841
|
-
"outputPath"
|
|
25341
|
+
"workflow"
|
|
24842
25342
|
],
|
|
24843
|
-
"returns": "Promise<
|
|
24844
|
-
"examples": [
|
|
24845
|
-
{
|
|
24846
|
-
"language": "ts",
|
|
24847
|
-
"code": "const path = await el.say('Hello world', './hello.mp3')\nconsole.log(`Audio saved to ${path}`)"
|
|
24848
|
-
}
|
|
24849
|
-
]
|
|
25343
|
+
"returns": "Promise<WorkflowResult>"
|
|
24850
25344
|
}
|
|
24851
25345
|
},
|
|
24852
25346
|
"getters": {
|
|
24853
|
-
"
|
|
24854
|
-
"description": "The
|
|
25347
|
+
"clientId": {
|
|
25348
|
+
"description": "The unique client ID used for WebSocket session tracking.",
|
|
25349
|
+
"returns": "string"
|
|
25350
|
+
},
|
|
25351
|
+
"wsURL": {
|
|
25352
|
+
"description": "The WebSocket URL derived from baseURL or overridden via options.",
|
|
24855
25353
|
"returns": "string"
|
|
24856
25354
|
}
|
|
24857
25355
|
},
|
|
24858
25356
|
"events": {
|
|
24859
|
-
"
|
|
24860
|
-
"name": "
|
|
24861
|
-
"description": "Event emitted by
|
|
25357
|
+
"execution_start": {
|
|
25358
|
+
"name": "execution_start",
|
|
25359
|
+
"description": "Event emitted by ComfyUIClient",
|
|
24862
25360
|
"arguments": {}
|
|
24863
25361
|
},
|
|
24864
|
-
"
|
|
24865
|
-
"name": "
|
|
24866
|
-
"description": "Event emitted by
|
|
25362
|
+
"execution_complete": {
|
|
25363
|
+
"name": "execution_complete",
|
|
25364
|
+
"description": "Event emitted by ComfyUIClient",
|
|
24867
25365
|
"arguments": {}
|
|
24868
25366
|
},
|
|
24869
|
-
"
|
|
24870
|
-
"name": "
|
|
24871
|
-
"description": "Event emitted by
|
|
25367
|
+
"executing": {
|
|
25368
|
+
"name": "executing",
|
|
25369
|
+
"description": "Event emitted by ComfyUIClient",
|
|
25370
|
+
"arguments": {}
|
|
25371
|
+
},
|
|
25372
|
+
"progress": {
|
|
25373
|
+
"name": "progress",
|
|
25374
|
+
"description": "Event emitted by ComfyUIClient",
|
|
25375
|
+
"arguments": {}
|
|
25376
|
+
},
|
|
25377
|
+
"executed": {
|
|
25378
|
+
"name": "executed",
|
|
25379
|
+
"description": "Event emitted by ComfyUIClient",
|
|
25380
|
+
"arguments": {}
|
|
25381
|
+
},
|
|
25382
|
+
"execution_cached": {
|
|
25383
|
+
"name": "execution_cached",
|
|
25384
|
+
"description": "Event emitted by ComfyUIClient",
|
|
25385
|
+
"arguments": {}
|
|
25386
|
+
},
|
|
25387
|
+
"execution_error": {
|
|
25388
|
+
"name": "execution_error",
|
|
25389
|
+
"description": "Event emitted by ComfyUIClient",
|
|
24872
25390
|
"arguments": {}
|
|
24873
25391
|
}
|
|
24874
25392
|
},
|
|
@@ -24878,7 +25396,7 @@ export const introspectionData = [
|
|
|
24878
25396
|
"examples": [
|
|
24879
25397
|
{
|
|
24880
25398
|
"language": "ts",
|
|
24881
|
-
"code": "const
|
|
25399
|
+
"code": "const comfy = container.client('comfyui', { baseURL: 'http://localhost:8188' })\nconst result = await comfy.runWorkflow(workflow, {\n '6': { text: 'a beautiful sunset' }\n})\nconsole.log(result.images)"
|
|
24882
25400
|
}
|
|
24883
25401
|
]
|
|
24884
25402
|
},
|
|
@@ -25164,7 +25682,7 @@ export const introspectionData = [
|
|
|
25164
25682
|
},
|
|
25165
25683
|
{
|
|
25166
25684
|
"id": "servers.websocket",
|
|
25167
|
-
"description": "WebSocket server built on the `ws` library with optional JSON message framing. Manages WebSocket connections, tracks connected clients, and bridges messages to Luca's event bus. When `json` mode is enabled, incoming messages are automatically JSON-parsed (with `.toString()` for Buffer data) and outgoing messages via `send()` / `broadcast()` are JSON-stringified. When `json` mode is disabled, raw message data is emitted as-is and `send()` / `broadcast()` still JSON-stringify for safety.",
|
|
25685
|
+
"description": "WebSocket server built on the `ws` library with optional JSON message framing. Manages WebSocket connections, tracks connected clients, and bridges messages to Luca's event bus. When `json` mode is enabled, incoming messages are automatically JSON-parsed (with `.toString()` for Buffer data) and outgoing messages via `send()` / `broadcast()` are JSON-stringified. When `json` mode is disabled, raw message data is emitted as-is and `send()` / `broadcast()` still JSON-stringify for safety. Supports ask/reply semantics when paired with the Luca WebSocket client. The server can `ask(ws, type, data)` a connected client and await a typed response, or handle incoming asks from clients by listening for messages with a `requestId` and replying via `send(ws, { replyTo, data })`. Requests time out if no reply arrives within the configurable window.",
|
|
25168
25686
|
"shortcut": "servers.websocket",
|
|
25169
25687
|
"className": "WebsocketServer",
|
|
25170
25688
|
"methods": {
|
|
@@ -25199,6 +25717,64 @@ export const introspectionData = [
|
|
|
25199
25717
|
],
|
|
25200
25718
|
"returns": "void"
|
|
25201
25719
|
},
|
|
25720
|
+
"ask": {
|
|
25721
|
+
"description": "Send a request to a specific client and wait for a correlated response. The client is expected to reply with a message whose `replyTo` matches the `requestId` of this message.",
|
|
25722
|
+
"parameters": {
|
|
25723
|
+
"ws": {
|
|
25724
|
+
"type": "any",
|
|
25725
|
+
"description": "The WebSocket client to ask"
|
|
25726
|
+
},
|
|
25727
|
+
"type": {
|
|
25728
|
+
"type": "string",
|
|
25729
|
+
"description": "A string identifying the request type"
|
|
25730
|
+
},
|
|
25731
|
+
"data": {
|
|
25732
|
+
"type": "any",
|
|
25733
|
+
"description": "Optional payload"
|
|
25734
|
+
},
|
|
25735
|
+
"timeout": {
|
|
25736
|
+
"type": "any",
|
|
25737
|
+
"description": "How long to wait (default 10 000 ms)"
|
|
25738
|
+
}
|
|
25739
|
+
},
|
|
25740
|
+
"required": [
|
|
25741
|
+
"ws",
|
|
25742
|
+
"type"
|
|
25743
|
+
],
|
|
25744
|
+
"returns": "Promise<R>",
|
|
25745
|
+
"examples": [
|
|
25746
|
+
{
|
|
25747
|
+
"language": "ts",
|
|
25748
|
+
"code": "ws.on('connection', async (client) => {\n const info = await ws.ask(client, 'identify')\n console.log('Client says:', info)\n})"
|
|
25749
|
+
}
|
|
25750
|
+
]
|
|
25751
|
+
},
|
|
25752
|
+
"_handleReply": {
|
|
25753
|
+
"description": "",
|
|
25754
|
+
"parameters": {
|
|
25755
|
+
"message": {
|
|
25756
|
+
"type": "any",
|
|
25757
|
+
"description": "Parameter message"
|
|
25758
|
+
}
|
|
25759
|
+
},
|
|
25760
|
+
"required": [
|
|
25761
|
+
"message"
|
|
25762
|
+
],
|
|
25763
|
+
"returns": "boolean"
|
|
25764
|
+
},
|
|
25765
|
+
"_rejectAllPending": {
|
|
25766
|
+
"description": "",
|
|
25767
|
+
"parameters": {
|
|
25768
|
+
"reason": {
|
|
25769
|
+
"type": "string",
|
|
25770
|
+
"description": "Parameter reason"
|
|
25771
|
+
}
|
|
25772
|
+
},
|
|
25773
|
+
"required": [
|
|
25774
|
+
"reason"
|
|
25775
|
+
],
|
|
25776
|
+
"returns": "void"
|
|
25777
|
+
},
|
|
25202
25778
|
"start": {
|
|
25203
25779
|
"description": "Start the WebSocket server. A runtime `port` overrides the constructor option and is written to state before the underlying `ws.Server` is created, so the server binds to the correct port.",
|
|
25204
25780
|
"parameters": {
|
|
@@ -25245,7 +25821,7 @@ export const introspectionData = [
|
|
|
25245
25821
|
"examples": [
|
|
25246
25822
|
{
|
|
25247
25823
|
"language": "ts",
|
|
25248
|
-
"code": "const ws = container.server('websocket', { json: true })\nawait ws.start({ port: 8080 })\n\nws.on('message', (data, client) => {\n console.log('Received:', data)\n ws.broadcast({ echo: data })\n})"
|
|
25824
|
+
"code": "const ws = container.server('websocket', { json: true })\nawait ws.start({ port: 8080 })\n\nws.on('message', (data, client) => {\n console.log('Received:', data)\n ws.broadcast({ echo: data })\n})\n\n// ask/reply: request info from a connected client\nws.on('connection', async (client) => {\n const info = await ws.ask(client, 'identify')\n console.log('Client says:', info)\n})"
|
|
25249
25825
|
}
|
|
25250
25826
|
]
|
|
25251
25827
|
},
|
|
@@ -26093,6 +26669,37 @@ export const introspectionData = [
|
|
|
26093
26669
|
"required": [],
|
|
26094
26670
|
"returns": "void"
|
|
26095
26671
|
},
|
|
26672
|
+
"addSystemPromptExtension": {
|
|
26673
|
+
"description": "Add or update a named system prompt extension. The value is appended to the base system prompt when passed to the conversation.",
|
|
26674
|
+
"parameters": {
|
|
26675
|
+
"key": {
|
|
26676
|
+
"type": "string",
|
|
26677
|
+
"description": "A unique identifier for this extension"
|
|
26678
|
+
},
|
|
26679
|
+
"value": {
|
|
26680
|
+
"type": "string",
|
|
26681
|
+
"description": "The text to append"
|
|
26682
|
+
}
|
|
26683
|
+
},
|
|
26684
|
+
"required": [
|
|
26685
|
+
"key",
|
|
26686
|
+
"value"
|
|
26687
|
+
],
|
|
26688
|
+
"returns": "this"
|
|
26689
|
+
},
|
|
26690
|
+
"removeSystemPromptExtension": {
|
|
26691
|
+
"description": "Remove a named system prompt extension.",
|
|
26692
|
+
"parameters": {
|
|
26693
|
+
"key": {
|
|
26694
|
+
"type": "string",
|
|
26695
|
+
"description": "The identifier of the extension to remove"
|
|
26696
|
+
}
|
|
26697
|
+
},
|
|
26698
|
+
"required": [
|
|
26699
|
+
"key"
|
|
26700
|
+
],
|
|
26701
|
+
"returns": "this"
|
|
26702
|
+
},
|
|
26096
26703
|
"use": {
|
|
26097
26704
|
"description": "Apply a setup function or a Helper instance to this assistant. When passed a function, it receives the assistant and can configure tools, hooks, event listeners, etc. When passed a Helper instance that exposes tools via toTools(), those tools are automatically added to this assistant.",
|
|
26098
26705
|
"parameters": {
|
|
@@ -26363,6 +26970,14 @@ export const introspectionData = [
|
|
|
26363
26970
|
"description": "The current system prompt text.",
|
|
26364
26971
|
"returns": "string"
|
|
26365
26972
|
},
|
|
26973
|
+
"systemPromptExtensions": {
|
|
26974
|
+
"description": "The named extensions appended to the system prompt.",
|
|
26975
|
+
"returns": "Record<string, string>"
|
|
26976
|
+
},
|
|
26977
|
+
"effectiveSystemPrompt": {
|
|
26978
|
+
"description": "The system prompt with all extensions appended. This is the value passed to the conversation.",
|
|
26979
|
+
"returns": "string"
|
|
26980
|
+
},
|
|
26366
26981
|
"tools": {
|
|
26367
26982
|
"description": "The tools registered with this assistant.",
|
|
26368
26983
|
"returns": "Record<string, ConversationTool>"
|
|
@@ -26406,6 +27021,11 @@ export const introspectionData = [
|
|
|
26406
27021
|
"description": "Event emitted by Assistant",
|
|
26407
27022
|
"arguments": {}
|
|
26408
27023
|
},
|
|
27024
|
+
"systemPromptExtensionsChanged": {
|
|
27025
|
+
"name": "systemPromptExtensionsChanged",
|
|
27026
|
+
"description": "Event emitted by Assistant",
|
|
27027
|
+
"arguments": {}
|
|
27028
|
+
},
|
|
26409
27029
|
"toolsChanged": {
|
|
26410
27030
|
"name": "toolsChanged",
|
|
26411
27031
|
"description": "Event emitted by Assistant",
|