lua-cli 3.17.6 → 3.20.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.
@@ -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'];
@@ -265,11 +266,11 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
265
266
  }, "strip", z.ZodTypeAny, {
266
267
  options?: Record<string, unknown>;
267
268
  kind?: "realtime";
268
- provider?: "openai" | "google" | "xai";
269
+ provider?: "google" | "xai" | "openai";
269
270
  }, {
270
271
  options?: Record<string, unknown>;
271
272
  kind?: "realtime";
272
- provider?: "openai" | "google" | "xai";
273
+ provider?: "google" | "xai" | "openai";
273
274
  }>]>;
274
275
  stt: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
275
276
  kind: z.ZodLiteral<"inference">;
@@ -331,11 +332,11 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
331
332
  }, "strip", z.ZodTypeAny, {
332
333
  options?: Record<string, unknown>;
333
334
  kind?: "realtime";
334
- provider?: "openai" | "google" | "xai";
335
+ provider?: "google" | "xai" | "openai";
335
336
  }, {
336
337
  options?: Record<string, unknown>;
337
338
  kind?: "realtime";
338
- provider?: "openai" | "google" | "xai";
339
+ provider?: "google" | "xai" | "openai";
339
340
  }>]>>;
340
341
  tts: z.ZodOptional<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
341
342
  kind: z.ZodLiteral<"inference">;
@@ -397,11 +398,11 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
397
398
  }, "strip", z.ZodTypeAny, {
398
399
  options?: Record<string, unknown>;
399
400
  kind?: "realtime";
400
- provider?: "openai" | "google" | "xai";
401
+ provider?: "google" | "xai" | "openai";
401
402
  }, {
402
403
  options?: Record<string, unknown>;
403
404
  kind?: "realtime";
404
- provider?: "openai" | "google" | "xai";
405
+ provider?: "google" | "xai" | "openai";
405
406
  }>]>>;
406
407
  vad: z.ZodOptional<z.ZodString>;
407
408
  vadOptions: z.ZodOptional<z.ZodObject<{
@@ -434,28 +435,28 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
434
435
  maxDelay: z.ZodOptional<z.ZodNumber>;
435
436
  }, "strip", z.ZodTypeAny, {
436
437
  enabled?: boolean;
437
- mode?: "vad" | "adaptive";
438
+ mode?: "adaptive" | "vad";
438
439
  falseInterruptionTimeout?: number;
439
440
  resumeFalseInterruption?: boolean;
440
441
  minDelay?: number;
441
442
  maxDelay?: number;
442
443
  }, {
443
444
  enabled?: boolean;
444
- mode?: "vad" | "adaptive";
445
+ mode?: "adaptive" | "vad";
445
446
  falseInterruptionTimeout?: number;
446
447
  resumeFalseInterruption?: boolean;
447
448
  minDelay?: number;
448
449
  maxDelay?: number;
449
450
  }>, {
450
451
  enabled?: boolean;
451
- mode?: "vad" | "adaptive";
452
+ mode?: "adaptive" | "vad";
452
453
  falseInterruptionTimeout?: number;
453
454
  resumeFalseInterruption?: boolean;
454
455
  minDelay?: number;
455
456
  maxDelay?: number;
456
457
  }, {
457
458
  enabled?: boolean;
458
- mode?: "vad" | "adaptive";
459
+ mode?: "adaptive" | "vad";
459
460
  falseInterruptionTimeout?: number;
460
461
  resumeFalseInterruption?: boolean;
461
462
  minDelay?: number;
@@ -557,7 +558,9 @@ 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, {
563
+ name?: string;
561
564
  vad?: string;
562
565
  stt?: {
563
566
  voice?: string;
@@ -572,10 +575,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
572
575
  } | {
573
576
  options?: Record<string, unknown>;
574
577
  kind?: "realtime";
575
- provider?: "openai" | "google" | "xai";
578
+ provider?: "google" | "xai" | "openai";
576
579
  };
577
580
  volume?: number;
578
- name?: string;
579
581
  llm?: {
580
582
  voice?: string;
581
583
  options?: Record<string, unknown>;
@@ -589,7 +591,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
589
591
  } | {
590
592
  options?: Record<string, unknown>;
591
593
  kind?: "realtime";
592
- provider?: "openai" | "google" | "xai";
594
+ provider?: "google" | "xai" | "openai";
593
595
  };
594
596
  tts?: {
595
597
  voice?: string;
@@ -604,7 +606,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
604
606
  } | {
605
607
  options?: Record<string, unknown>;
606
608
  kind?: "realtime";
607
- provider?: "openai" | "google" | "xai";
609
+ provider?: "google" | "xai" | "openai";
608
610
  };
609
611
  vadOptions?: {
610
612
  minSpeechDuration?: number;
@@ -619,7 +621,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
619
621
  preemptiveGeneration?: boolean;
620
622
  interruption?: {
621
623
  enabled?: boolean;
622
- mode?: "vad" | "adaptive";
624
+ mode?: "adaptive" | "vad";
623
625
  falseInterruptionTimeout?: number;
624
626
  resumeFalseInterruption?: boolean;
625
627
  minDelay?: number;
@@ -650,7 +652,9 @@ 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
  }, {
657
+ name?: string;
654
658
  vad?: string;
655
659
  stt?: {
656
660
  voice?: string;
@@ -665,10 +669,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
665
669
  } | {
666
670
  options?: Record<string, unknown>;
667
671
  kind?: "realtime";
668
- provider?: "openai" | "google" | "xai";
672
+ provider?: "google" | "xai" | "openai";
669
673
  };
670
674
  volume?: number;
671
- name?: string;
672
675
  llm?: {
673
676
  voice?: string;
674
677
  options?: Record<string, unknown>;
@@ -682,7 +685,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
682
685
  } | {
683
686
  options?: Record<string, unknown>;
684
687
  kind?: "realtime";
685
- provider?: "openai" | "google" | "xai";
688
+ provider?: "google" | "xai" | "openai";
686
689
  };
687
690
  tts?: {
688
691
  voice?: string;
@@ -697,7 +700,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
697
700
  } | {
698
701
  options?: Record<string, unknown>;
699
702
  kind?: "realtime";
700
- provider?: "openai" | "google" | "xai";
703
+ provider?: "google" | "xai" | "openai";
701
704
  };
702
705
  vadOptions?: {
703
706
  minSpeechDuration?: number;
@@ -712,7 +715,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
712
715
  preemptiveGeneration?: boolean;
713
716
  interruption?: {
714
717
  enabled?: boolean;
715
- mode?: "vad" | "adaptive";
718
+ mode?: "adaptive" | "vad";
716
719
  falseInterruptionTimeout?: number;
717
720
  resumeFalseInterruption?: boolean;
718
721
  minDelay?: number;
@@ -743,7 +746,9 @@ 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
  }>, {
751
+ name?: string;
747
752
  vad?: string;
748
753
  stt?: {
749
754
  voice?: string;
@@ -758,10 +763,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
758
763
  } | {
759
764
  options?: Record<string, unknown>;
760
765
  kind?: "realtime";
761
- provider?: "openai" | "google" | "xai";
766
+ provider?: "google" | "xai" | "openai";
762
767
  };
763
768
  volume?: number;
764
- name?: string;
765
769
  llm?: {
766
770
  voice?: string;
767
771
  options?: Record<string, unknown>;
@@ -775,7 +779,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
775
779
  } | {
776
780
  options?: Record<string, unknown>;
777
781
  kind?: "realtime";
778
- provider?: "openai" | "google" | "xai";
782
+ provider?: "google" | "xai" | "openai";
779
783
  };
780
784
  tts?: {
781
785
  voice?: string;
@@ -790,7 +794,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
790
794
  } | {
791
795
  options?: Record<string, unknown>;
792
796
  kind?: "realtime";
793
- provider?: "openai" | "google" | "xai";
797
+ provider?: "google" | "xai" | "openai";
794
798
  };
795
799
  vadOptions?: {
796
800
  minSpeechDuration?: number;
@@ -805,7 +809,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
805
809
  preemptiveGeneration?: boolean;
806
810
  interruption?: {
807
811
  enabled?: boolean;
808
- mode?: "vad" | "adaptive";
812
+ mode?: "adaptive" | "vad";
809
813
  falseInterruptionTimeout?: number;
810
814
  resumeFalseInterruption?: boolean;
811
815
  minDelay?: number;
@@ -836,7 +840,9 @@ 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
  }, {
845
+ name?: string;
840
846
  vad?: string;
841
847
  stt?: {
842
848
  voice?: string;
@@ -851,10 +857,9 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
851
857
  } | {
852
858
  options?: Record<string, unknown>;
853
859
  kind?: "realtime";
854
- provider?: "openai" | "google" | "xai";
860
+ provider?: "google" | "xai" | "openai";
855
861
  };
856
862
  volume?: number;
857
- name?: string;
858
863
  llm?: {
859
864
  voice?: string;
860
865
  options?: Record<string, unknown>;
@@ -868,7 +873,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
868
873
  } | {
869
874
  options?: Record<string, unknown>;
870
875
  kind?: "realtime";
871
- provider?: "openai" | "google" | "xai";
876
+ provider?: "google" | "xai" | "openai";
872
877
  };
873
878
  tts?: {
874
879
  voice?: string;
@@ -883,7 +888,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
883
888
  } | {
884
889
  options?: Record<string, unknown>;
885
890
  kind?: "realtime";
886
- provider?: "openai" | "google" | "xai";
891
+ provider?: "google" | "xai" | "openai";
887
892
  };
888
893
  vadOptions?: {
889
894
  minSpeechDuration?: number;
@@ -898,7 +903,7 @@ declare const LuaVoiceConfigSchema: z.ZodEffects<z.ZodObject<{
898
903
  preemptiveGeneration?: boolean;
899
904
  interruption?: {
900
905
  enabled?: boolean;
901
- mode?: "vad" | "adaptive";
906
+ mode?: "adaptive" | "vad";
902
907
  falseInterruptionTimeout?: number;
903
908
  resumeFalseInterruption?: boolean;
904
909
  minDelay?: number;
@@ -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()` is wired today and delegates to the active LiveKit `voice.AgentSession`.
1006
- * `disallowInterruptions()` and `handoff()` are optional placeholders for
1007
- * Phase 5 (BAC-213, the LuaVoice handoffs + test framework ticket).
1008
- * Marked optional both because they aren't implemented yet AND so this
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
- * @experimental Reserved for Phase 5 (BAC-213). Optional because
1071
- * unimplemented handoffs require `chatCtx.copy(exclude_instructions=True)`
1072
- * + `update_agent` plumbing that's part of the multi-LuaVoice flow ticket.
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>;
@@ -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",
@@ -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
@@ -1,6 +1,6 @@
1
- # lua-cli v3.16.2
1
+ # lua-cli v3.20.0
2
2
 
3
- Welcome to the comprehensive API documentation for lua-cli v3.16.2. This guide covers every API, class, and function exported by the package.
3
+ Welcome to the comprehensive API documentation for lua-cli v3.20.0. This guide covers every API, class, and function exported by the package.
4
4
 
5
5
  ## 📚 Documentation Index
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lua-cli",
3
- "version": "3.17.6",
3
+ "version": "3.20.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.25.10",
83
+ "esbuild": "^0.28.1",
84
84
  "inquirer": "^12.9.6",
85
85
  "js-yaml": "^4.1.0",
86
86
  "open": "^10.1.0",
@@ -20,7 +20,7 @@
20
20
  "inquirer": "^12.9.6",
21
21
  "stripe": "^17.5.0",
22
22
  "js-yaml": "^4.1.0",
23
- "lua-cli": "^3.17.6",
23
+ "lua-cli": "^3.20.0",
24
24
  "openai": "^5.23.0",
25
25
  "uuid": "^13.0.0",
26
26
  "zod": "^3.24.1"