llmz 0.0.4 → 0.0.6

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.
Files changed (41) hide show
  1. package/README.md +4 -0
  2. package/dist/chat.d.ts +17 -0
  3. package/dist/{chunk-LVKZYKTP.cjs → chunk-4I7UPBLN.cjs} +2 -2
  4. package/dist/{chunk-W6U2VXSF.cjs → chunk-6WT5VZBG.cjs} +348 -12
  5. package/dist/{chunk-5NVNEEYW.cjs → chunk-BEPRLBPK.cjs} +60 -16
  6. package/dist/chunk-CH5T6SPC.cjs +694 -0
  7. package/dist/{chunk-4EWY34YA.js → chunk-D3ESDRLH.js} +60 -16
  8. package/dist/{chunk-JK2LZW2G.cjs → chunk-EJRCDWBA.cjs} +45 -6
  9. package/dist/{chunk-ZCPQ3QOW.js → chunk-HP7RKM25.js} +45 -6
  10. package/dist/{chunk-S6WICIDW.js → chunk-S6FOL2HY.js} +2 -2
  11. package/dist/{chunk-TJQVC4CE.js → chunk-WLUVY5QU.js} +341 -5
  12. package/dist/chunk-XJNRORSK.js +694 -0
  13. package/dist/{component-LQDU72LX.js → component-R2Y74VUI.js} +3 -1
  14. package/dist/component-TSNW3SC7.cjs +16 -0
  15. package/dist/component.d.ts +6 -19
  16. package/dist/component.default.d.ts +131 -151
  17. package/dist/context.d.ts +13 -5
  18. package/dist/{dual-modes-YE4S2AIL.cjs → dual-modes-UHNDHNIF.cjs} +3 -4
  19. package/dist/{dual-modes-QHBOFWHM.js → dual-modes-ZUQKPJFH.js} +2 -3
  20. package/dist/{exit-IDKGZD7M.cjs → exit-KJ4COC5N.cjs} +2 -2
  21. package/dist/{exit-F6ZUL2NV.js → exit-OIYZLBVJ.js} +1 -1
  22. package/dist/exit.d.ts +5 -1
  23. package/dist/getter.d.ts +1 -1
  24. package/dist/index.cjs +85 -128
  25. package/dist/index.d.ts +11 -8
  26. package/dist/index.js +80 -123
  27. package/dist/llmz-CPMVYIOJ.cjs +581 -0
  28. package/dist/llmz-LAN4WDFW.js +581 -0
  29. package/dist/llmz.d.ts +8 -10
  30. package/dist/result.d.ts +33 -0
  31. package/dist/types.d.ts +1 -33
  32. package/dist/{vm-GJ5R72AP.cjs → vm-2DLG7V4G.cjs} +2 -2
  33. package/dist/{vm-ZUQOSRRM.js → vm-FLBMZUA2.js} +1 -1
  34. package/package.json +1 -1
  35. package/dist/chunk-4KB5WXHR.js +0 -92
  36. package/dist/chunk-6YWYCVAB.cjs +0 -92
  37. package/dist/chunk-EFGXTO64.js +0 -344
  38. package/dist/chunk-VAF2H6UD.cjs +0 -344
  39. package/dist/component-HQ5YQNRX.cjs +0 -14
  40. package/dist/llmz-AS5TGCQS.js +0 -1108
  41. package/dist/llmz-R6XZG3JQ.cjs +0 -1108
package/dist/index.cjs CHANGED
@@ -1,7 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;
2
2
 
3
- var _chunk6YWYCVABcjs = require('./chunk-6YWYCVAB.cjs');
4
- require('./chunk-VAF2H6UD.cjs');
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+ var _chunkCH5T6SPCcjs = require('./chunk-CH5T6SPC.cjs');
12
+ require('./chunk-6WT5VZBG.cjs');
5
13
 
6
14
 
7
15
  var _chunk4QTK5ALHcjs = require('./chunk-4QTK5ALH.cjs');
@@ -13,17 +21,20 @@ var _chunkHYVKY3W6cjs = require('./chunk-HYVKY3W6.cjs');
13
21
 
14
22
 
15
23
 
24
+
16
25
  var _chunkJDABP4SDcjs = require('./chunk-JDABP4SD.cjs');
17
26
  require('./chunk-IKSIOIIP.cjs');
18
27
 
19
28
 
20
- var _chunkLVKZYKTPcjs = require('./chunk-LVKZYKTP.cjs');
29
+ var _chunk4I7UPBLNcjs = require('./chunk-4I7UPBLN.cjs');
30
+
21
31
 
22
32
 
23
33
 
24
34
 
25
- var _chunkJK2LZW2Gcjs = require('./chunk-JK2LZW2G.cjs');
35
+ var _chunkEJRCDWBAcjs = require('./chunk-EJRCDWBA.cjs');
26
36
  require('./chunk-KMZDFWYZ.cjs');
37
+ require('./chunk-FIVFS4HG.cjs');
27
38
 
28
39
 
29
40
 
@@ -636,7 +647,8 @@ var CitationsManager = (_class = class {constructor() { _class.prototype.__init.
636
647
  }, _class);
637
648
 
638
649
  // src/component.default.ts
639
- var Button = new (0, _chunkJK2LZW2Gcjs.Component)({
650
+
651
+ var Button = new (0, _chunkEJRCDWBAcjs.Component)({
640
652
  type: "leaf",
641
653
  description: "A button component that can perform actions when clicked",
642
654
  name: "Button",
@@ -658,36 +670,15 @@ var Button = new (0, _chunkJK2LZW2Gcjs.Component)({
658
670
  }
659
671
  ],
660
672
  leaf: {
661
- props: [
662
- {
663
- name: "action",
664
- type: "string",
665
- default: "say",
666
- description: 'The action to perform when the button is clicked. Can be "say", "url", or "postback"',
667
- required: true
668
- },
669
- {
670
- name: "label",
671
- type: "string",
672
- description: "The text displayed on the button",
673
- required: true
674
- },
675
- {
676
- name: "value",
677
- type: "string",
678
- description: 'The postback value to send when the button is clicked. Required if action is "postback"',
679
- required: false
680
- },
681
- {
682
- name: "url",
683
- type: "string",
684
- description: 'The URL to open when the button is clicked. Required if action is "url"',
685
- required: false
686
- }
687
- ]
673
+ props: _zui.z.object({
674
+ action: _zui.z.enum(["say", "url", "postback"]).default("say").describe('The action to perform when the button is clicked. Can be "say", "url", or "postback"'),
675
+ label: _zui.z.string().describe("The text displayed on the button"),
676
+ value: _zui.z.string().optional().describe('The postback value to send when the button is clicked. Required if action is "postback"'),
677
+ url: _zui.z.string().optional().describe('The URL to open when the button is clicked. Required if action is "url"')
678
+ })
688
679
  }
689
680
  });
690
- var Image = new (0, _chunkJK2LZW2Gcjs.Component)({
681
+ var Image = new (0, _chunkEJRCDWBAcjs.Component)({
691
682
  type: "leaf",
692
683
  name: "Image",
693
684
  description: "Displays an image from a URL.",
@@ -702,23 +693,13 @@ var Image = new (0, _chunkJK2LZW2Gcjs.Component)({
702
693
  }
703
694
  ],
704
695
  leaf: {
705
- props: [
706
- {
707
- name: "url",
708
- type: "string",
709
- description: "The URL of the image (must be valid)",
710
- required: true
711
- },
712
- {
713
- name: "alt",
714
- type: "string",
715
- description: "Alternative text describing the image",
716
- required: false
717
- }
718
- ]
696
+ props: _zui.z.object({
697
+ url: _zui.z.string().describe("The URL of the image (must be valid)"),
698
+ alt: _zui.z.string().optional().describe("Alternative text describing the image")
699
+ })
719
700
  }
720
701
  });
721
- var File = new (0, _chunkJK2LZW2Gcjs.Component)({
702
+ var File = new (0, _chunkEJRCDWBAcjs.Component)({
722
703
  type: "leaf",
723
704
  name: "File",
724
705
  description: "Sends a downloadable file to the user.",
@@ -733,23 +714,13 @@ var File = new (0, _chunkJK2LZW2Gcjs.Component)({
733
714
  }
734
715
  ],
735
716
  leaf: {
736
- props: [
737
- {
738
- name: "url",
739
- type: "string",
740
- description: "The URL of the file (must be valid)",
741
- required: true
742
- },
743
- {
744
- name: "name",
745
- type: "string",
746
- description: "The display name of the file",
747
- required: false
748
- }
749
- ]
717
+ props: _zui.z.object({
718
+ url: _zui.z.string().describe("The URL of the file (must be valid)"),
719
+ name: _zui.z.string().optional().describe("The display name of the file")
720
+ })
750
721
  }
751
722
  });
752
- var Video = new (0, _chunkJK2LZW2Gcjs.Component)({
723
+ var Video = new (0, _chunkEJRCDWBAcjs.Component)({
753
724
  type: "leaf",
754
725
  name: "Video",
755
726
  description: "Embeds a video from a URL.",
@@ -764,23 +735,13 @@ var Video = new (0, _chunkJK2LZW2Gcjs.Component)({
764
735
  }
765
736
  ],
766
737
  leaf: {
767
- props: [
768
- {
769
- name: "url",
770
- type: "string",
771
- description: "The URL of the video (must be valid)",
772
- required: true
773
- },
774
- {
775
- name: "title",
776
- type: "string",
777
- description: "Title for the video",
778
- required: false
779
- }
780
- ]
738
+ props: _zui.z.object({
739
+ url: _zui.z.string().describe("The URL of the video (must be valid)"),
740
+ title: _zui.z.string().optional().describe("Title for the video")
741
+ })
781
742
  }
782
743
  });
783
- var Audio = new (0, _chunkJK2LZW2Gcjs.Component)({
744
+ var Audio = new (0, _chunkEJRCDWBAcjs.Component)({
784
745
  type: "leaf",
785
746
  name: "Audio",
786
747
  description: "Plays an audio clip from a URL.",
@@ -795,23 +756,13 @@ var Audio = new (0, _chunkJK2LZW2Gcjs.Component)({
795
756
  }
796
757
  ],
797
758
  leaf: {
798
- props: [
799
- {
800
- name: "url",
801
- type: "string",
802
- description: "The URL of the audio clip (must be valid)",
803
- required: true
804
- },
805
- {
806
- name: "title",
807
- type: "string",
808
- description: "Title for the audio clip",
809
- required: false
810
- }
811
- ]
759
+ props: _zui.z.object({
760
+ url: _zui.z.string().describe("The URL of the audio clip (must be valid)"),
761
+ title: _zui.z.string().optional().describe("Title for the audio clip")
762
+ })
812
763
  }
813
764
  });
814
- var Card = new (0, _chunkJK2LZW2Gcjs.Component)({
765
+ var Card = new (0, _chunkEJRCDWBAcjs.Component)({
815
766
  type: "container",
816
767
  name: "Card",
817
768
  description: "A visual card component that can include an image and buttons.",
@@ -830,20 +781,10 @@ var Card = new (0, _chunkJK2LZW2Gcjs.Component)({
830
781
  }
831
782
  ],
832
783
  container: {
833
- props: [
834
- {
835
- name: "title",
836
- type: "string",
837
- description: "Title text (1\u2013250 characters)",
838
- required: true
839
- },
840
- {
841
- name: "subtitle",
842
- type: "string",
843
- description: "Optional subtitle for the card",
844
- required: false
845
- }
846
- ],
784
+ props: _zui.z.object({
785
+ title: _zui.z.string().min(1).max(250).describe("Title text (1\u2013250 characters)"),
786
+ subtitle: _zui.z.string().optional().describe("Optional subtitle for the card")
787
+ }),
847
788
  children: [
848
789
  {
849
790
  description: "Image (optional, max 1)",
@@ -856,7 +797,7 @@ var Card = new (0, _chunkJK2LZW2Gcjs.Component)({
856
797
  ]
857
798
  }
858
799
  });
859
- var Carousel = new (0, _chunkJK2LZW2Gcjs.Component)({
800
+ var Carousel = new (0, _chunkEJRCDWBAcjs.Component)({
860
801
  type: "container",
861
802
  name: "Carousel",
862
803
  description: "A virtual container for displaying 1 to 10 Card components as a carousel.",
@@ -880,7 +821,7 @@ var Carousel = new (0, _chunkJK2LZW2Gcjs.Component)({
880
821
  }
881
822
  ],
882
823
  container: {
883
- props: [],
824
+ props: _zui.z.object({}),
884
825
  children: [
885
826
  {
886
827
  description: "Card component (required, 1\u201310 allowed)",
@@ -889,7 +830,7 @@ var Carousel = new (0, _chunkJK2LZW2Gcjs.Component)({
889
830
  ]
890
831
  }
891
832
  });
892
- var Text = new (0, _chunkJK2LZW2Gcjs.Component)({
833
+ var Text = new (0, _chunkEJRCDWBAcjs.Component)({
893
834
  type: "default",
894
835
  name: "Message",
895
836
  aliases: ["Text", "Markdown"],
@@ -904,18 +845,10 @@ var Text = new (0, _chunkJK2LZW2Gcjs.Component)({
904
845
  }
905
846
  ],
906
847
  default: {
907
- props: [],
848
+ props: _zui.z.object({}),
908
849
  children: []
909
850
  }
910
851
  });
911
- var messageTool = (handler) => new (0, _chunk4QTK5ALHcjs.Tool)({
912
- name: "Message",
913
- metadata: {
914
- system: true,
915
- description: "Sends a message with components like Button, Image, File, Video, Audio, Card, Carousel, and Text."
916
- },
917
- handler: async (args) => await handler(args)
918
- });
919
852
  var DefaultComponents = {
920
853
  Button,
921
854
  Image,
@@ -927,22 +860,36 @@ var DefaultComponents = {
927
860
  Text
928
861
  };
929
862
 
863
+ // src/chat.ts
864
+ var Chat = class {
865
+
866
+
867
+
868
+ constructor(props) {
869
+ this.handler = props.handler;
870
+ this.components = props.components;
871
+ this.transcript = props.transcript || [];
872
+ }
873
+ onExecutionDone(_result) {
874
+ }
875
+ };
876
+
930
877
  // src/index.ts
931
- var executeContext = async (props) => {
932
- const { executeContext: executeContext2 } = (await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-R6XZG3JQ.cjs")))).llmz;
933
- return executeContext2(props);
878
+ var execute = async (props) => {
879
+ const { executeContext } = await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-CPMVYIOJ.cjs")));
880
+ return executeContext(props);
934
881
  };
935
882
  var init = async () => {
936
- await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-R6XZG3JQ.cjs")));
937
- await Promise.resolve().then(() => _interopRequireWildcard(require("./component-HQ5YQNRX.cjs")));
883
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-CPMVYIOJ.cjs")));
884
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./component-TSNW3SC7.cjs")));
938
885
  await Promise.resolve().then(() => _interopRequireWildcard(require("./tool-SWJYOR2Z.cjs")));
939
- await Promise.resolve().then(() => _interopRequireWildcard(require("./exit-IDKGZD7M.cjs")));
886
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./exit-KJ4COC5N.cjs")));
940
887
  await Promise.resolve().then(() => _interopRequireWildcard(require("./jsx-AJAXBWFE.cjs")));
941
- await Promise.resolve().then(() => _interopRequireWildcard(require("./vm-GJ5R72AP.cjs")));
888
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./vm-2DLG7V4G.cjs")));
942
889
  await Promise.resolve().then(() => _interopRequireWildcard(require("./utils-QC4I2L6R.cjs")));
943
890
  await Promise.resolve().then(() => _interopRequireWildcard(require("./truncator-NYN7BGKJ.cjs")));
944
891
  await Promise.resolve().then(() => _interopRequireWildcard(require("./typings-XR6CYHW4.cjs")));
945
- await Promise.resolve().then(() => _interopRequireWildcard(require("./dual-modes-YE4S2AIL.cjs")));
892
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./dual-modes-UHNDHNIF.cjs")));
946
893
  };
947
894
 
948
895
 
@@ -959,4 +906,14 @@ var init = async () => {
959
906
 
960
907
 
961
908
 
962
- exports.CitationsManager = CitationsManager; exports.Component = _chunkJK2LZW2Gcjs.Component; exports.DefaultComponents = DefaultComponents; exports.Exit = _chunkLVKZYKTPcjs.Exit; exports.ObjectInstance = ObjectInstance; exports.Snapshot = _chunk6YWYCVABcjs.Snapshot; exports.SnapshotSignal = _chunkJDABP4SDcjs.SnapshotSignal; exports.ThinkSignal = _chunkJDABP4SDcjs.ThinkSignal; exports.Tool = _chunk4QTK5ALHcjs.Tool; exports.assertValidComponent = _chunkJK2LZW2Gcjs.assertValidComponent; exports.executeContext = executeContext; exports.init = init; exports.isComponent = _chunkJK2LZW2Gcjs.isComponent; exports.messageTool = messageTool;
909
+
910
+
911
+
912
+
913
+
914
+
915
+
916
+
917
+
918
+
919
+ exports.Chat = Chat; exports.CitationsManager = CitationsManager; exports.Component = _chunkEJRCDWBAcjs.Component; exports.DefaultComponents = DefaultComponents; exports.DefaultExit = _chunkCH5T6SPCcjs.DefaultExit; exports.ErrorExecutionResult = _chunkCH5T6SPCcjs.ErrorExecutionResult; exports.ExecutionResult = _chunkCH5T6SPCcjs.ExecutionResult; exports.Exit = _chunk4I7UPBLNcjs.Exit; exports.ListenExit = _chunkCH5T6SPCcjs.ListenExit; exports.LoopExceededError = _chunkJDABP4SDcjs.LoopExceededError; exports.ObjectInstance = ObjectInstance; exports.PartialExecutionResult = _chunkCH5T6SPCcjs.PartialExecutionResult; exports.Snapshot = _chunkCH5T6SPCcjs.Snapshot; exports.SnapshotSignal = _chunkJDABP4SDcjs.SnapshotSignal; exports.SuccessExecutionResult = _chunkCH5T6SPCcjs.SuccessExecutionResult; exports.ThinkExit = _chunkCH5T6SPCcjs.ThinkExit; exports.ThinkSignal = _chunkJDABP4SDcjs.ThinkSignal; exports.Tool = _chunk4QTK5ALHcjs.Tool; exports.assertValidComponent = _chunkEJRCDWBAcjs.assertValidComponent; exports.execute = execute; exports.getValue = _chunkCH5T6SPCcjs.getValue; exports.init = init; exports.isAnyComponent = _chunkEJRCDWBAcjs.isAnyComponent; exports.isComponent = _chunkEJRCDWBAcjs.isComponent;
package/dist/index.d.ts CHANGED
@@ -1,16 +1,19 @@
1
1
  export { Tool } from './tool.js';
2
- export { Exit } from './exit.js';
2
+ export { Exit, ExitResult } from './exit.js';
3
3
  export { ObjectInstance } from './objects.js';
4
- export { SnapshotSignal, ThinkSignal } from './errors.js';
5
- export { Component, RenderedComponent, LeafComponentDefinition, ContainerComponentDefinition, DefaultComponentDefinition, ComponentDefinition, assertValidComponent, isComponent, } from './component.js';
4
+ export { SnapshotSignal, ThinkSignal, LoopExceededError } from './errors.js';
5
+ export { Component, RenderedComponent, LeafComponentDefinition, ContainerComponentDefinition, DefaultComponentDefinition, ComponentDefinition, assertValidComponent, isComponent, isAnyComponent, } from './component.js';
6
6
  export { Citation, CitationsManager } from './citations.js';
7
- export { DefaultComponents, messageTool } from './component.default.js';
7
+ export { DefaultComponents } from './component.default.js';
8
8
  export { Snapshot } from './snapshots.js';
9
+ export { Chat, type MessageHandler } from './chat.js';
9
10
  import { type ExecutionProps } from './llmz.js';
10
- import { type ExecutionResult } from './types.js';
11
- export { type ExecutionResult, Trace } from './types.js';
12
- export type { Iteration } from './context.js';
13
- export declare const executeContext: (props: ExecutionProps) => Promise<ExecutionResult>;
11
+ import { ExecutionResult } from './result.js';
12
+ export { ErrorExecutionResult, ExecutionResult, PartialExecutionResult, SuccessExecutionResult } from './result.js';
13
+ export { Trace } from './types.js';
14
+ export { type Iteration, ListenExit, ThinkExit, DefaultExit, IterationStatuses, IterationStatus } from './context.js';
15
+ export { type ValueOrGetter, getValue } from './getter.js';
16
+ export declare const execute: (props: ExecutionProps) => Promise<ExecutionResult>;
14
17
  /**
15
18
  * Loads the necessary dependencies for the library to work
16
19
  * Calling this function is optional, but it will improve the performance of the first call to `executeContext`
package/dist/index.js CHANGED
@@ -1,7 +1,15 @@
1
1
  import {
2
- Snapshot
3
- } from "./chunk-4KB5WXHR.js";
4
- import "./chunk-EFGXTO64.js";
2
+ DefaultExit,
3
+ ErrorExecutionResult,
4
+ ExecutionResult,
5
+ ListenExit,
6
+ PartialExecutionResult,
7
+ Snapshot,
8
+ SuccessExecutionResult,
9
+ ThinkExit,
10
+ getValue
11
+ } from "./chunk-XJNRORSK.js";
12
+ import "./chunk-WLUVY5QU.js";
5
13
  import {
6
14
  Tool
7
15
  } from "./chunk-QBXIE6EY.js";
@@ -11,19 +19,22 @@ import {
11
19
  } from "./chunk-UNMKB2DA.js";
12
20
  import {
13
21
  CodeFormattingError,
22
+ LoopExceededError,
14
23
  SnapshotSignal,
15
24
  ThinkSignal
16
25
  } from "./chunk-JKVVQN2P.js";
17
26
  import "./chunk-JQBT7UWN.js";
18
27
  import {
19
28
  Exit
20
- } from "./chunk-S6WICIDW.js";
29
+ } from "./chunk-S6FOL2HY.js";
21
30
  import {
22
31
  Component,
23
32
  assertValidComponent,
33
+ isAnyComponent,
24
34
  isComponent
25
- } from "./chunk-ZCPQ3QOW.js";
35
+ } from "./chunk-HP7RKM25.js";
26
36
  import "./chunk-ORQP26SZ.js";
37
+ import "./chunk-QT4QF3YA.js";
27
38
  import {
28
39
  escapeString,
29
40
  getMultilineComment,
@@ -636,6 +647,7 @@ var CitationsManager = class {
636
647
  };
637
648
 
638
649
  // src/component.default.ts
650
+ import { z as z2 } from "@bpinternal/zui";
639
651
  var Button = new Component({
640
652
  type: "leaf",
641
653
  description: "A button component that can perform actions when clicked",
@@ -658,33 +670,12 @@ var Button = new Component({
658
670
  }
659
671
  ],
660
672
  leaf: {
661
- props: [
662
- {
663
- name: "action",
664
- type: "string",
665
- default: "say",
666
- description: 'The action to perform when the button is clicked. Can be "say", "url", or "postback"',
667
- required: true
668
- },
669
- {
670
- name: "label",
671
- type: "string",
672
- description: "The text displayed on the button",
673
- required: true
674
- },
675
- {
676
- name: "value",
677
- type: "string",
678
- description: 'The postback value to send when the button is clicked. Required if action is "postback"',
679
- required: false
680
- },
681
- {
682
- name: "url",
683
- type: "string",
684
- description: 'The URL to open when the button is clicked. Required if action is "url"',
685
- required: false
686
- }
687
- ]
673
+ props: z2.object({
674
+ action: z2.enum(["say", "url", "postback"]).default("say").describe('The action to perform when the button is clicked. Can be "say", "url", or "postback"'),
675
+ label: z2.string().describe("The text displayed on the button"),
676
+ value: z2.string().optional().describe('The postback value to send when the button is clicked. Required if action is "postback"'),
677
+ url: z2.string().optional().describe('The URL to open when the button is clicked. Required if action is "url"')
678
+ })
688
679
  }
689
680
  });
690
681
  var Image = new Component({
@@ -702,20 +693,10 @@ var Image = new Component({
702
693
  }
703
694
  ],
704
695
  leaf: {
705
- props: [
706
- {
707
- name: "url",
708
- type: "string",
709
- description: "The URL of the image (must be valid)",
710
- required: true
711
- },
712
- {
713
- name: "alt",
714
- type: "string",
715
- description: "Alternative text describing the image",
716
- required: false
717
- }
718
- ]
696
+ props: z2.object({
697
+ url: z2.string().describe("The URL of the image (must be valid)"),
698
+ alt: z2.string().optional().describe("Alternative text describing the image")
699
+ })
719
700
  }
720
701
  });
721
702
  var File = new Component({
@@ -733,20 +714,10 @@ var File = new Component({
733
714
  }
734
715
  ],
735
716
  leaf: {
736
- props: [
737
- {
738
- name: "url",
739
- type: "string",
740
- description: "The URL of the file (must be valid)",
741
- required: true
742
- },
743
- {
744
- name: "name",
745
- type: "string",
746
- description: "The display name of the file",
747
- required: false
748
- }
749
- ]
717
+ props: z2.object({
718
+ url: z2.string().describe("The URL of the file (must be valid)"),
719
+ name: z2.string().optional().describe("The display name of the file")
720
+ })
750
721
  }
751
722
  });
752
723
  var Video = new Component({
@@ -764,20 +735,10 @@ var Video = new Component({
764
735
  }
765
736
  ],
766
737
  leaf: {
767
- props: [
768
- {
769
- name: "url",
770
- type: "string",
771
- description: "The URL of the video (must be valid)",
772
- required: true
773
- },
774
- {
775
- name: "title",
776
- type: "string",
777
- description: "Title for the video",
778
- required: false
779
- }
780
- ]
738
+ props: z2.object({
739
+ url: z2.string().describe("The URL of the video (must be valid)"),
740
+ title: z2.string().optional().describe("Title for the video")
741
+ })
781
742
  }
782
743
  });
783
744
  var Audio = new Component({
@@ -795,20 +756,10 @@ var Audio = new Component({
795
756
  }
796
757
  ],
797
758
  leaf: {
798
- props: [
799
- {
800
- name: "url",
801
- type: "string",
802
- description: "The URL of the audio clip (must be valid)",
803
- required: true
804
- },
805
- {
806
- name: "title",
807
- type: "string",
808
- description: "Title for the audio clip",
809
- required: false
810
- }
811
- ]
759
+ props: z2.object({
760
+ url: z2.string().describe("The URL of the audio clip (must be valid)"),
761
+ title: z2.string().optional().describe("Title for the audio clip")
762
+ })
812
763
  }
813
764
  });
814
765
  var Card = new Component({
@@ -830,20 +781,10 @@ var Card = new Component({
830
781
  }
831
782
  ],
832
783
  container: {
833
- props: [
834
- {
835
- name: "title",
836
- type: "string",
837
- description: "Title text (1\u2013250 characters)",
838
- required: true
839
- },
840
- {
841
- name: "subtitle",
842
- type: "string",
843
- description: "Optional subtitle for the card",
844
- required: false
845
- }
846
- ],
784
+ props: z2.object({
785
+ title: z2.string().min(1).max(250).describe("Title text (1\u2013250 characters)"),
786
+ subtitle: z2.string().optional().describe("Optional subtitle for the card")
787
+ }),
847
788
  children: [
848
789
  {
849
790
  description: "Image (optional, max 1)",
@@ -880,7 +821,7 @@ var Carousel = new Component({
880
821
  }
881
822
  ],
882
823
  container: {
883
- props: [],
824
+ props: z2.object({}),
884
825
  children: [
885
826
  {
886
827
  description: "Card component (required, 1\u201310 allowed)",
@@ -904,18 +845,10 @@ var Text = new Component({
904
845
  }
905
846
  ],
906
847
  default: {
907
- props: [],
848
+ props: z2.object({}),
908
849
  children: []
909
850
  }
910
851
  });
911
- var messageTool = (handler) => new Tool({
912
- name: "Message",
913
- metadata: {
914
- system: true,
915
- description: "Sends a message with components like Button, Image, File, Video, Audio, Card, Carousel, and Text."
916
- },
917
- handler: async (args) => await handler(args)
918
- });
919
852
  var DefaultComponents = {
920
853
  Button,
921
854
  Image,
@@ -927,36 +860,60 @@ var DefaultComponents = {
927
860
  Text
928
861
  };
929
862
 
863
+ // src/chat.ts
864
+ var Chat = class {
865
+ handler;
866
+ transcript;
867
+ components;
868
+ constructor(props) {
869
+ this.handler = props.handler;
870
+ this.components = props.components;
871
+ this.transcript = props.transcript || [];
872
+ }
873
+ onExecutionDone(_result) {
874
+ }
875
+ };
876
+
930
877
  // src/index.ts
931
- var executeContext = async (props) => {
932
- const { executeContext: executeContext2 } = (await import("./llmz-AS5TGCQS.js")).llmz;
933
- return executeContext2(props);
878
+ var execute = async (props) => {
879
+ const { executeContext } = await import("./llmz-LAN4WDFW.js");
880
+ return executeContext(props);
934
881
  };
935
882
  var init = async () => {
936
- await import("./llmz-AS5TGCQS.js");
937
- await import("./component-LQDU72LX.js");
883
+ await import("./llmz-LAN4WDFW.js");
884
+ await import("./component-R2Y74VUI.js");
938
885
  await import("./tool-LY77IWV2.js");
939
- await import("./exit-F6ZUL2NV.js");
886
+ await import("./exit-OIYZLBVJ.js");
940
887
  await import("./jsx-AEHVFB3L.js");
941
- await import("./vm-ZUQOSRRM.js");
888
+ await import("./vm-FLBMZUA2.js");
942
889
  await import("./utils-L5GLCS3C.js");
943
890
  await import("./truncator-WAL2GCUY.js");
944
891
  await import("./typings-AIV2OASX.js");
945
- await import("./dual-modes-QHBOFWHM.js");
892
+ await import("./dual-modes-ZUQKPJFH.js");
946
893
  };
947
894
  export {
895
+ Chat,
948
896
  CitationsManager,
949
897
  Component,
950
898
  DefaultComponents,
899
+ DefaultExit,
900
+ ErrorExecutionResult,
901
+ ExecutionResult,
951
902
  Exit,
903
+ ListenExit,
904
+ LoopExceededError,
952
905
  ObjectInstance,
906
+ PartialExecutionResult,
953
907
  Snapshot,
954
908
  SnapshotSignal,
909
+ SuccessExecutionResult,
910
+ ThinkExit,
955
911
  ThinkSignal,
956
912
  Tool,
957
913
  assertValidComponent,
958
- executeContext,
914
+ execute,
915
+ getValue,
959
916
  init,
960
- isComponent,
961
- messageTool
917
+ isAnyComponent,
918
+ isComponent
962
919
  };