lua-cli 3.17.6 → 3.18.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 +391 -9
- package/dist/api-exports.js +626 -405
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +2092 -471
- package/dist/index.js.map +1 -1
- package/dist/voice/test/index.d.ts +28 -7
- package/dist/zod-runtime.mjs +2 -2
- package/docs/API_REFERENCE.md +48 -1
- package/docs/README.md +1 -1
- package/package.json +4 -4
- package/template/package.json +1 -1
|
@@ -157,6 +157,7 @@ declare class LuaVoice {
|
|
|
157
157
|
readonly preemptiveGeneration: LuaVoiceConfig['preemptiveGeneration'];
|
|
158
158
|
readonly interruption: LuaVoiceConfig['interruption'];
|
|
159
159
|
readonly sttLanguage: LuaVoiceConfig['sttLanguage'];
|
|
160
|
+
readonly excludeTools: LuaVoiceConfig['excludeTools'];
|
|
160
161
|
readonly tools: ReadonlyArray<LuaTool<any> | LuaVoiceTool<any>>;
|
|
161
162
|
readonly onEnter?: LuaVoiceConfig_2['onEnter'];
|
|
162
163
|
readonly onUserTurnCompleted?: LuaVoiceConfig_2['onUserTurnCompleted'];
|
|
@@ -557,6 +558,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
557
558
|
pronunciations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
558
559
|
persistTranscript: z.ZodOptional<z.ZodBoolean>;
|
|
559
560
|
onToolFailureSay: z.ZodOptional<z.ZodString>;
|
|
561
|
+
excludeTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
560
562
|
}, "strip", z.ZodTypeAny, {
|
|
561
563
|
vad?: string;
|
|
562
564
|
stt?: {
|
|
@@ -650,6 +652,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
650
652
|
pronunciations?: Record<string, string>;
|
|
651
653
|
persistTranscript?: boolean;
|
|
652
654
|
onToolFailureSay?: string;
|
|
655
|
+
excludeTools?: string[];
|
|
653
656
|
}, {
|
|
654
657
|
vad?: string;
|
|
655
658
|
stt?: {
|
|
@@ -743,6 +746,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
743
746
|
pronunciations?: Record<string, string>;
|
|
744
747
|
persistTranscript?: boolean;
|
|
745
748
|
onToolFailureSay?: string;
|
|
749
|
+
excludeTools?: string[];
|
|
746
750
|
}>, {
|
|
747
751
|
vad?: string;
|
|
748
752
|
stt?: {
|
|
@@ -836,6 +840,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
836
840
|
pronunciations?: Record<string, string>;
|
|
837
841
|
persistTranscript?: boolean;
|
|
838
842
|
onToolFailureSay?: string;
|
|
843
|
+
excludeTools?: string[];
|
|
839
844
|
}, {
|
|
840
845
|
vad?: string;
|
|
841
846
|
stt?: {
|
|
@@ -929,6 +934,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
929
934
|
pronunciations?: Record<string, string>;
|
|
930
935
|
persistTranscript?: boolean;
|
|
931
936
|
onToolFailureSay?: string;
|
|
937
|
+
excludeTools?: string[];
|
|
932
938
|
}>;
|
|
933
939
|
|
|
934
940
|
/**
|
|
@@ -1002,10 +1008,10 @@ declare interface LuaVoiceToolConfig<TInput extends ZodType = ZodType> {
|
|
|
1002
1008
|
* its second `execute` arg whether it runs over chat or voice; this
|
|
1003
1009
|
* extension just adds the Phase-5 fields (currently optional + experimental).
|
|
1004
1010
|
*
|
|
1005
|
-
* `say()`
|
|
1006
|
-
*
|
|
1007
|
-
*
|
|
1008
|
-
*
|
|
1011
|
+
* `say()`, `transferToHuman()`, `endCall()` and `handoff()` are wired today
|
|
1012
|
+
* and delegate to the active LiveKit `voice.AgentSession`.
|
|
1013
|
+
* `disallowInterruptions()` is an optional placeholder — the barge-in lock
|
|
1014
|
+
* plumbing isn't implemented yet. The delegates are marked optional so this
|
|
1009
1015
|
* type stays structurally compatible with `LuaToolCtx` — that
|
|
1010
1016
|
* compatibility is what lets a `LuaVoiceTool` (which extends `LuaTool`)
|
|
1011
1017
|
* present `(ctx?: LuaVoiceToolCtx)` while satisfying the parent's
|
|
@@ -1067,9 +1073,24 @@ declare interface LuaVoiceToolCtx {
|
|
|
1067
1073
|
*/
|
|
1068
1074
|
disallowInterruptions?(): void;
|
|
1069
1075
|
/**
|
|
1070
|
-
*
|
|
1071
|
-
*
|
|
1072
|
-
*
|
|
1076
|
+
* Hand the live call to another LuaVoice on the same agent,
|
|
1077
|
+
* addressed by its `name`. The caller stays in the same room; only
|
|
1078
|
+
* the agent identity flips — the receiving voice starts cold from
|
|
1079
|
+
* its own persona + greeting (no conversation history carries
|
|
1080
|
+
* over). Pass `context` to surface a structured payload to the
|
|
1081
|
+
* receiving voice on its first turn.
|
|
1082
|
+
*
|
|
1083
|
+
* In `lua voice test`, register reachable voices via
|
|
1084
|
+
* `runVoice({ handoffTargets })`; in production, any voice pushed
|
|
1085
|
+
* on the same agent is reachable. An unknown name degrades
|
|
1086
|
+
* in-call (spoken fallback, no crash).
|
|
1087
|
+
*
|
|
1088
|
+
* @example
|
|
1089
|
+
* ```typescript
|
|
1090
|
+
* await ctx.voice?.handoff('billing-line', {
|
|
1091
|
+
* context: { reason: 'invoice question', orderId: input.orderId },
|
|
1092
|
+
* });
|
|
1093
|
+
* ```
|
|
1073
1094
|
*/
|
|
1074
1095
|
handoff?(otherVoiceName: string, opts?: {
|
|
1075
1096
|
context?: Record<string, unknown>;
|
package/dist/zod-runtime.mjs
CHANGED
|
@@ -3832,7 +3832,7 @@ ZodNaN.create = (params) => {
|
|
|
3832
3832
|
...processCreateParams(params)
|
|
3833
3833
|
});
|
|
3834
3834
|
};
|
|
3835
|
-
var BRAND = Symbol("zod_brand");
|
|
3835
|
+
var BRAND = /* @__PURE__ */ Symbol("zod_brand");
|
|
3836
3836
|
var ZodBranded = class extends ZodType {
|
|
3837
3837
|
_parse(input) {
|
|
3838
3838
|
const { ctx } = this._processInputParams(input);
|
|
@@ -4046,7 +4046,7 @@ var coerce = {
|
|
|
4046
4046
|
var NEVER = INVALID;
|
|
4047
4047
|
|
|
4048
4048
|
// ../../node_modules/.pnpm/zod-to-json-schema@3.25.1_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
4049
|
-
var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
4049
|
+
var ignoreOverride = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
4050
4050
|
var defaultOptions = {
|
|
4051
4051
|
name: void 0,
|
|
4052
4052
|
$refStrategy: "root",
|
package/docs/API_REFERENCE.md
CHANGED
|
@@ -36,6 +36,7 @@ import { User, Products, Data, Jobs, AI } from 'lua-cli';
|
|
|
36
36
|
- [AI API](#ai-api) - AI text generation
|
|
37
37
|
- [Templates API](#templates-api) - WhatsApp templates
|
|
38
38
|
- [CDN API](#cdn-api) - File upload/download
|
|
39
|
+
- [Channels API](#channels-api) - Outbound channel sends
|
|
39
40
|
|
|
40
41
|
### Utilities
|
|
41
42
|
- [env()](#env) - Environment variables
|
|
@@ -71,7 +72,8 @@ import {
|
|
|
71
72
|
|
|
72
73
|
// Utilities
|
|
73
74
|
env,
|
|
74
|
-
Lua
|
|
75
|
+
Lua,
|
|
76
|
+
Channels,
|
|
75
77
|
} from 'lua-cli';
|
|
76
78
|
```
|
|
77
79
|
|
|
@@ -584,6 +586,51 @@ const url = await CDN.get(result.fileId);
|
|
|
584
586
|
|
|
585
587
|
---
|
|
586
588
|
|
|
589
|
+
### Channels API
|
|
590
|
+
|
|
591
|
+
Send outbound messages over any supported channel (WhatsApp, SMS, email, webchat, and more)
|
|
592
|
+
from inside a job, webhook, or skill tool.
|
|
593
|
+
|
|
594
|
+
A successful send with a memory write failure returns `{ delivered: true, persisted: false, warning: '...' }` —
|
|
595
|
+
this is HTTP 200 and is never thrown as an error.
|
|
596
|
+
|
|
597
|
+
**Methods:**
|
|
598
|
+
- `Channels.send(input)` - Send a text message on any channel
|
|
599
|
+
- `Channels.whatsapp.sendTemplate(input)` - Send a WhatsApp Business template
|
|
600
|
+
- `Channels.email.send(input)` - Send an email
|
|
601
|
+
|
|
602
|
+
**Examples:**
|
|
603
|
+
```typescript
|
|
604
|
+
import { Channels } from 'lua-cli';
|
|
605
|
+
|
|
606
|
+
// Send a text message over WhatsApp
|
|
607
|
+
await Channels.send({
|
|
608
|
+
channel: 'whatsapp',
|
|
609
|
+
to: { phoneNumber: '+15551234567' },
|
|
610
|
+
text: 'Your order has shipped!',
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
// Send a WhatsApp Business template
|
|
614
|
+
await Channels.whatsapp.sendTemplate({
|
|
615
|
+
to: { phoneNumber: '+447551166594' },
|
|
616
|
+
templateName: 'order_update',
|
|
617
|
+
languageCode: 'en',
|
|
618
|
+
components: [{ type: 'body', parameters: [{ type: 'text', text: 'ORD-99' }] }],
|
|
619
|
+
});
|
|
620
|
+
|
|
621
|
+
// Send an email
|
|
622
|
+
const result = await Channels.email.send({
|
|
623
|
+
to: { email: 'alice@example.com' },
|
|
624
|
+
subject: 'Your order is ready',
|
|
625
|
+
html: '<p>Hello, Alice!</p>',
|
|
626
|
+
});
|
|
627
|
+
if (!result.persisted) {
|
|
628
|
+
console.warn('Delivered but not stored in memory:', result.warning);
|
|
629
|
+
}
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
---
|
|
633
|
+
|
|
587
634
|
## Utilities
|
|
588
635
|
|
|
589
636
|
### env()
|
package/docs/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lua-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.18.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",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"commander": "^14.0.1",
|
|
81
81
|
"diff": "^8.0.2",
|
|
82
82
|
"dotenv": "^17.2.3",
|
|
83
|
-
"esbuild": "^0.
|
|
83
|
+
"esbuild": "^0.28.1",
|
|
84
84
|
"inquirer": "^12.9.6",
|
|
85
85
|
"js-yaml": "^4.1.0",
|
|
86
86
|
"open": "^10.1.0",
|
|
@@ -110,8 +110,8 @@
|
|
|
110
110
|
"ts-node": "^10.9.2",
|
|
111
111
|
"tsup": "^8.5.1",
|
|
112
112
|
"@lua/shared-sandbox": "0.0.1",
|
|
113
|
-
"@lua/shared-
|
|
114
|
-
"@lua/shared-
|
|
113
|
+
"@lua/shared-types": "0.0.1",
|
|
114
|
+
"@lua/shared-source-sync": "0.0.1"
|
|
115
115
|
},
|
|
116
116
|
"scripts": {
|
|
117
117
|
"clean": "rm -rf dist temp",
|