lua-cli 3.46.0 → 3.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-exports.d.ts +125 -57
- package/dist/api-exports.js +273 -118
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +334 -177
- package/dist/index.js.map +1 -1
- package/dist/voice/test/index.d.ts +54 -54
- package/dist/workflow-builder.js +198 -102
- package/dist/workflow-builder.js.map +1 -1
- package/docs/README.md +4 -4
- package/docs/api/User.md +52 -1
- package/package.json +3 -3
- package/template/package.json +1 -1
package/docs/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# lua-cli v3.
|
|
1
|
+
# lua-cli v3.47.0
|
|
2
2
|
|
|
3
|
-
Welcome to the comprehensive API documentation for lua-cli v3.
|
|
3
|
+
Welcome to the comprehensive API documentation for lua-cli v3.47.0. This guide covers every API, class, and function exported by the package.
|
|
4
4
|
|
|
5
5
|
## 📚 Documentation Index
|
|
6
6
|
|
|
@@ -263,8 +263,8 @@ Each API doc includes:
|
|
|
263
263
|
|
|
264
264
|
---
|
|
265
265
|
|
|
266
|
-
**Version:** 3.
|
|
267
|
-
**Last Updated:**
|
|
266
|
+
**Version:** 3.47.0
|
|
267
|
+
**Last Updated:** October 2026
|
|
268
268
|
|
|
269
269
|
---
|
|
270
270
|
|
package/docs/api/User.md
CHANGED
|
@@ -266,7 +266,7 @@ await user.send([
|
|
|
266
266
|
|
|
267
267
|
#### `user.clear()`
|
|
268
268
|
|
|
269
|
-
Clears all user data.
|
|
269
|
+
Clears all user data, including the user's My work list.
|
|
270
270
|
|
|
271
271
|
**Returns:** `Promise<{ success: boolean }>` - `{ success: true }` once the data is cleared. Throws if the clear fails.
|
|
272
272
|
|
|
@@ -277,6 +277,57 @@ const user = await User.get();
|
|
|
277
277
|
await user.clear();
|
|
278
278
|
```
|
|
279
279
|
|
|
280
|
+
#### `user.setWorkItems(items)`
|
|
281
|
+
|
|
282
|
+
Publishes this user's **My work** list: the open work an agent lists for them (a ticket they raised or hold, an approval waiting on them). Their client shows it beside the conversation, for example Frontline's "My work" tab. Each call replaces the whole list.
|
|
283
|
+
|
|
284
|
+
**Parameters:** `items: WorkItem[]`, at most 100.
|
|
285
|
+
|
|
286
|
+
| Field | Type | Notes |
|
|
287
|
+
| ------------- | ---------------- | ----------------------------------------------------------------------- |
|
|
288
|
+
| `id` | `string` | Unique in the list, ≤ 200 chars (e.g. a ticket number) |
|
|
289
|
+
| `title` | `string` | One line the user recognises, ≤ 120 chars |
|
|
290
|
+
| `group` | `string` | Display group you choose, ≤ 40 chars ("Waiting on you", "Your tickets") |
|
|
291
|
+
| `needsAction` | `boolean?` | The user's own action is needed; listed first and highlighted |
|
|
292
|
+
| `status` | `string?` | Short label, ≤ 40 chars ("In progress") |
|
|
293
|
+
| `updatedAt` | `string \| Date` | When this work last changed |
|
|
294
|
+
| `action` | `string` | Message the client sends when the item is tapped, ≤ 200 chars |
|
|
295
|
+
|
|
296
|
+
**Returns:** `Promise<void>`. Throws an error naming the first invalid item before anything is written, or `Failed to set work items` if the write fails.
|
|
297
|
+
|
|
298
|
+
**Rules:**
|
|
299
|
+
|
|
300
|
+
- **`action` is a show/open request, never a decision.** Use "Show MNT-00123", not "Approve MNT-00123". A tap must not act on a list that may be minutes old; ask for decisions in the conversation instead.
|
|
301
|
+
- **Publish whenever the work changes, for everyone it affects.** That means the raiser, the assignee and the next approver. Use `User.get({ phone })` or `User.get(userId)` to address each of them.
|
|
302
|
+
- **Add a scheduled job (every ~30 min)** that rebuilds the lists of recently active users. It catches any write that failed.
|
|
303
|
+
- **Leave closed or cancelled work out.** An empty list (`[]`) means "nothing waiting".
|
|
304
|
+
- **The list is kept out of `user.data`.** `update()`, `save()` and `patch()` never write it, so a stale read can't overwrite a newer list. `user.clear()` removes it.
|
|
305
|
+
|
|
306
|
+
**Example:**
|
|
307
|
+
|
|
308
|
+
```typescript
|
|
309
|
+
import { User } from 'lua-cli';
|
|
310
|
+
|
|
311
|
+
// After assigning MNT-00123 to a technician:
|
|
312
|
+
const technician = await User.get({ phone: '+254700000000' });
|
|
313
|
+
await technician?.setWorkItems([
|
|
314
|
+
{
|
|
315
|
+
id: 'MNT-00123',
|
|
316
|
+
title: 'MNT-00123 · Fryer not heating',
|
|
317
|
+
group: 'Assigned to you',
|
|
318
|
+
status: 'In progress',
|
|
319
|
+
updatedAt: new Date(),
|
|
320
|
+
action: 'Show MNT-00123',
|
|
321
|
+
},
|
|
322
|
+
]);
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
#### `user.clearWorkItems()`
|
|
326
|
+
|
|
327
|
+
Removes this user's My work list. Their client then shows no list from this agent.
|
|
328
|
+
|
|
329
|
+
**Returns:** `Promise<void>`
|
|
330
|
+
|
|
280
331
|
#### `user.save()`
|
|
281
332
|
|
|
282
333
|
Saves current user data state.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lua-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.47.0",
|
|
4
4
|
"description": "Build, test, and deploy AI agents with custom tools, webhooks, and scheduled jobs. Features LuaAgent unified configuration, streaming chat, and batch deployment.",
|
|
5
5
|
"readmeFilename": "README.md",
|
|
6
6
|
"main": "dist/api-exports.js",
|
|
@@ -116,9 +116,9 @@
|
|
|
116
116
|
"tsup": "^8.5.1",
|
|
117
117
|
"@lua/sandbox-runtime": "0.0.1",
|
|
118
118
|
"@lua/shared-sandbox": "0.0.1",
|
|
119
|
+
"@lua/workflow-graph": "0.0.1",
|
|
119
120
|
"@lua/shared-source-sync": "0.0.1",
|
|
120
|
-
"@lua/shared-types": "0.0.1"
|
|
121
|
-
"@lua/workflow-graph": "0.0.1"
|
|
121
|
+
"@lua/shared-types": "0.0.1"
|
|
122
122
|
},
|
|
123
123
|
"scripts": {
|
|
124
124
|
"clean": "rm -rf dist temp",
|