llmz 0.0.4 → 0.0.5

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 (35) hide show
  1. package/dist/chat.d.ts +17 -0
  2. package/dist/chunk-3U57H7GT.js +608 -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-JK2LZW2G.cjs → chunk-EJRCDWBA.cjs} +45 -6
  6. package/dist/{chunk-ZCPQ3QOW.js → chunk-HP7RKM25.js} +45 -6
  7. package/dist/chunk-MU4LFVY7.cjs +608 -0
  8. package/dist/{chunk-S6WICIDW.js → chunk-S6FOL2HY.js} +2 -2
  9. package/dist/{chunk-TJQVC4CE.js → chunk-WLUVY5QU.js} +341 -5
  10. package/dist/{component-LQDU72LX.js → component-R2Y74VUI.js} +3 -1
  11. package/dist/component-TSNW3SC7.cjs +16 -0
  12. package/dist/component.d.ts +6 -19
  13. package/dist/component.default.d.ts +131 -151
  14. package/dist/context.d.ts +6 -5
  15. package/dist/{dual-modes-YE4S2AIL.cjs → dual-modes-UHNDHNIF.cjs} +3 -4
  16. package/dist/{dual-modes-QHBOFWHM.js → dual-modes-ZUQKPJFH.js} +2 -3
  17. package/dist/{exit-IDKGZD7M.cjs → exit-KJ4COC5N.cjs} +2 -2
  18. package/dist/{exit-F6ZUL2NV.js → exit-OIYZLBVJ.js} +1 -1
  19. package/dist/exit.d.ts +5 -1
  20. package/dist/getter.d.ts +1 -1
  21. package/dist/index.cjs +72 -127
  22. package/dist/index.d.ts +7 -5
  23. package/dist/index.js +67 -122
  24. package/dist/llmz-VDA4M42R.cjs +604 -0
  25. package/dist/llmz-YE5N54IU.js +604 -0
  26. package/dist/llmz.d.ts +6 -9
  27. package/dist/types.d.ts +2 -0
  28. package/package.json +1 -1
  29. package/dist/chunk-4KB5WXHR.js +0 -92
  30. package/dist/chunk-6YWYCVAB.cjs +0 -92
  31. package/dist/chunk-EFGXTO64.js +0 -344
  32. package/dist/chunk-VAF2H6UD.cjs +0 -344
  33. package/dist/component-HQ5YQNRX.cjs +0 -14
  34. package/dist/llmz-AS5TGCQS.js +0 -1108
  35. package/dist/llmz-R6XZG3JQ.cjs +0 -1108
@@ -1,7 +1,4 @@
1
- import { Component, RenderedComponent } from './component.js';
2
- import { Tool } from './tool.js';
3
- export type SendMessageHandler = (input: RenderedComponent) => Promise<void> | void;
4
- export declare const messageTool: (handler: SendMessageHandler) => Tool<import("./types.js").ZuiType, import("./types.js").ZuiType>;
1
+ import { Component } from './component.js';
5
2
  export declare const DefaultComponents: {
6
3
  Button: Component<{
7
4
  type: "leaf";
@@ -14,25 +11,22 @@ export declare const DefaultComponents: {
14
11
  code: string;
15
12
  }[];
16
13
  leaf: {
17
- props: ({
18
- name: string;
19
- type: "string";
20
- default: string;
21
- description: string;
22
- required: true;
23
- } | {
24
- name: string;
25
- type: "string";
26
- description: string;
27
- required: true;
28
- default?: undefined;
29
- } | {
30
- name: string;
31
- type: "string";
32
- description: string;
33
- required: false;
34
- default?: undefined;
35
- })[];
14
+ props: import("@bpinternal/zui").ZodObject<{
15
+ action: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodEnum<["say", "url", "postback"]>>;
16
+ label: import("@bpinternal/zui").ZodString;
17
+ value: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
18
+ url: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
19
+ }, "strip", {
20
+ label: string;
21
+ action: "say" | "url" | "postback";
22
+ value?: string | undefined;
23
+ url?: string | undefined;
24
+ }, {
25
+ label: string;
26
+ value?: string | undefined;
27
+ action?: "say" | "url" | "postback" | undefined;
28
+ url?: string | undefined;
29
+ }>;
36
30
  };
37
31
  }>;
38
32
  Image: Component<{
@@ -46,17 +40,16 @@ export declare const DefaultComponents: {
46
40
  code: string;
47
41
  }[];
48
42
  leaf: {
49
- props: ({
50
- name: string;
51
- type: "string";
52
- description: string;
53
- required: true;
54
- } | {
55
- name: string;
56
- type: "string";
57
- description: string;
58
- required: false;
59
- })[];
43
+ props: import("@bpinternal/zui").ZodObject<{
44
+ url: import("@bpinternal/zui").ZodString;
45
+ alt: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
46
+ }, "strip", {
47
+ url: string;
48
+ alt?: string | undefined;
49
+ }, {
50
+ url: string;
51
+ alt?: string | undefined;
52
+ }>;
60
53
  };
61
54
  }>;
62
55
  File: Component<{
@@ -70,17 +63,16 @@ export declare const DefaultComponents: {
70
63
  code: string;
71
64
  }[];
72
65
  leaf: {
73
- props: ({
74
- name: string;
75
- type: "string";
76
- description: string;
77
- required: true;
78
- } | {
79
- name: string;
80
- type: "string";
81
- description: string;
82
- required: false;
83
- })[];
66
+ props: import("@bpinternal/zui").ZodObject<{
67
+ url: import("@bpinternal/zui").ZodString;
68
+ name: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
69
+ }, "strip", {
70
+ url: string;
71
+ name?: string | undefined;
72
+ }, {
73
+ url: string;
74
+ name?: string | undefined;
75
+ }>;
84
76
  };
85
77
  }>;
86
78
  Video: Component<{
@@ -94,17 +86,16 @@ export declare const DefaultComponents: {
94
86
  code: string;
95
87
  }[];
96
88
  leaf: {
97
- props: ({
98
- name: string;
99
- type: "string";
100
- description: string;
101
- required: true;
102
- } | {
103
- name: string;
104
- type: "string";
105
- description: string;
106
- required: false;
107
- })[];
89
+ props: import("@bpinternal/zui").ZodObject<{
90
+ url: import("@bpinternal/zui").ZodString;
91
+ title: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
92
+ }, "strip", {
93
+ url: string;
94
+ title?: string | undefined;
95
+ }, {
96
+ url: string;
97
+ title?: string | undefined;
98
+ }>;
108
99
  };
109
100
  }>;
110
101
  Audio: Component<{
@@ -118,17 +109,16 @@ export declare const DefaultComponents: {
118
109
  code: string;
119
110
  }[];
120
111
  leaf: {
121
- props: ({
122
- name: string;
123
- type: "string";
124
- description: string;
125
- required: true;
126
- } | {
127
- name: string;
128
- type: "string";
129
- description: string;
130
- required: false;
131
- })[];
112
+ props: import("@bpinternal/zui").ZodObject<{
113
+ url: import("@bpinternal/zui").ZodString;
114
+ title: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
115
+ }, "strip", {
116
+ url: string;
117
+ title?: string | undefined;
118
+ }, {
119
+ url: string;
120
+ title?: string | undefined;
121
+ }>;
132
122
  };
133
123
  }>;
134
124
  Card: Component<{
@@ -142,17 +132,16 @@ export declare const DefaultComponents: {
142
132
  code: string;
143
133
  }[];
144
134
  container: {
145
- props: ({
146
- name: string;
147
- type: "string";
148
- description: string;
149
- required: true;
150
- } | {
151
- name: string;
152
- type: "string";
153
- description: string;
154
- required: false;
155
- })[];
135
+ props: import("@bpinternal/zui").ZodObject<{
136
+ title: import("@bpinternal/zui").ZodString;
137
+ subtitle: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
138
+ }, "strip", {
139
+ title: string;
140
+ subtitle?: string | undefined;
141
+ }, {
142
+ title: string;
143
+ subtitle?: string | undefined;
144
+ }>;
156
145
  children: ({
157
146
  description: string;
158
147
  component: {
@@ -166,17 +155,16 @@ export declare const DefaultComponents: {
166
155
  code: string;
167
156
  }[];
168
157
  leaf: {
169
- props: ({
170
- name: string;
171
- type: "string";
172
- description: string;
173
- required: true;
174
- } | {
175
- name: string;
176
- type: "string";
177
- description: string;
178
- required: false;
179
- })[];
158
+ props: import("@bpinternal/zui").ZodObject<{
159
+ url: import("@bpinternal/zui").ZodString;
160
+ alt: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
161
+ }, "strip", {
162
+ url: string;
163
+ alt?: string | undefined;
164
+ }, {
165
+ url: string;
166
+ alt?: string | undefined;
167
+ }>;
180
168
  };
181
169
  };
182
170
  } | {
@@ -192,25 +180,22 @@ export declare const DefaultComponents: {
192
180
  code: string;
193
181
  }[];
194
182
  leaf: {
195
- props: ({
196
- name: string;
197
- type: "string";
198
- default: string;
199
- description: string;
200
- required: true;
201
- } | {
202
- name: string;
203
- type: "string";
204
- description: string;
205
- required: true;
206
- default?: undefined;
207
- } | {
208
- name: string;
209
- type: "string";
210
- description: string;
211
- required: false;
212
- default?: undefined;
213
- })[];
183
+ props: import("@bpinternal/zui").ZodObject<{
184
+ action: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodEnum<["say", "url", "postback"]>>;
185
+ label: import("@bpinternal/zui").ZodString;
186
+ value: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
187
+ url: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
188
+ }, "strip", {
189
+ label: string;
190
+ action: "say" | "url" | "postback";
191
+ value?: string | undefined;
192
+ url?: string | undefined;
193
+ }, {
194
+ label: string;
195
+ value?: string | undefined;
196
+ action?: "say" | "url" | "postback" | undefined;
197
+ url?: string | undefined;
198
+ }>;
214
199
  };
215
200
  };
216
201
  })[];
@@ -227,7 +212,7 @@ export declare const DefaultComponents: {
227
212
  code: string;
228
213
  }[];
229
214
  container: {
230
- props: never[];
215
+ props: import("@bpinternal/zui").ZodObject<{}, "strip", {}, {}>;
231
216
  children: {
232
217
  description: string;
233
218
  component: {
@@ -241,17 +226,16 @@ export declare const DefaultComponents: {
241
226
  code: string;
242
227
  }[];
243
228
  container: {
244
- props: ({
245
- name: string;
246
- type: "string";
247
- description: string;
248
- required: true;
249
- } | {
250
- name: string;
251
- type: "string";
252
- description: string;
253
- required: false;
254
- })[];
229
+ props: import("@bpinternal/zui").ZodObject<{
230
+ title: import("@bpinternal/zui").ZodString;
231
+ subtitle: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
232
+ }, "strip", {
233
+ title: string;
234
+ subtitle?: string | undefined;
235
+ }, {
236
+ title: string;
237
+ subtitle?: string | undefined;
238
+ }>;
255
239
  children: ({
256
240
  description: string;
257
241
  component: {
@@ -265,17 +249,16 @@ export declare const DefaultComponents: {
265
249
  code: string;
266
250
  }[];
267
251
  leaf: {
268
- props: ({
269
- name: string;
270
- type: "string";
271
- description: string;
272
- required: true;
273
- } | {
274
- name: string;
275
- type: "string";
276
- description: string;
277
- required: false;
278
- })[];
252
+ props: import("@bpinternal/zui").ZodObject<{
253
+ url: import("@bpinternal/zui").ZodString;
254
+ alt: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
255
+ }, "strip", {
256
+ url: string;
257
+ alt?: string | undefined;
258
+ }, {
259
+ url: string;
260
+ alt?: string | undefined;
261
+ }>;
279
262
  };
280
263
  };
281
264
  } | {
@@ -291,25 +274,22 @@ export declare const DefaultComponents: {
291
274
  code: string;
292
275
  }[];
293
276
  leaf: {
294
- props: ({
295
- name: string;
296
- type: "string";
297
- default: string;
298
- description: string;
299
- required: true;
300
- } | {
301
- name: string;
302
- type: "string";
303
- description: string;
304
- required: true;
305
- default?: undefined;
306
- } | {
307
- name: string;
308
- type: "string";
309
- description: string;
310
- required: false;
311
- default?: undefined;
312
- })[];
277
+ props: import("@bpinternal/zui").ZodObject<{
278
+ action: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodEnum<["say", "url", "postback"]>>;
279
+ label: import("@bpinternal/zui").ZodString;
280
+ value: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
281
+ url: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
282
+ }, "strip", {
283
+ label: string;
284
+ action: "say" | "url" | "postback";
285
+ value?: string | undefined;
286
+ url?: string | undefined;
287
+ }, {
288
+ label: string;
289
+ value?: string | undefined;
290
+ action?: "say" | "url" | "postback" | undefined;
291
+ url?: string | undefined;
292
+ }>;
313
293
  };
314
294
  };
315
295
  })[];
@@ -329,7 +309,7 @@ export declare const DefaultComponents: {
329
309
  code: string;
330
310
  }[];
331
311
  default: {
332
- props: never[];
312
+ props: import("@bpinternal/zui").ZodObject<{}, "strip", {}, {}>;
333
313
  children: never[];
334
314
  };
335
315
  }>;
package/dist/context.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { type Cognitive } from '@botpress/cognitive';
2
+ import { Chat } from './chat.js';
2
3
  import { Component } from './component.js';
3
4
  import { SnapshotSignal } from './errors.js';
4
5
  import { Exit } from './exit.js';
@@ -9,7 +10,7 @@ import type { OAI } from './openai.js';
9
10
  import { Prompt } from './prompts/prompt.js';
10
11
  import { Snapshot } from './snapshots.js';
11
12
  import { Tool } from './tool.js';
12
- import { TranscriptArray, TranscriptMessage } from './transcript.js';
13
+ import { TranscriptArray } from './transcript.js';
13
14
  import { ObjectMutation, Trace } from './types.js';
14
15
  type Model = Parameters<InstanceType<typeof Cognitive>['generateContent']>[0]['model'];
15
16
  export type IterationParameters = {
@@ -79,6 +80,8 @@ export declare namespace IterationStatuses {
79
80
  };
80
81
  };
81
82
  }
83
+ export declare const ThinkExit: Exit<unknown>;
84
+ export declare const ListenExit: Exit<unknown>;
82
85
  export declare class Iteration {
83
86
  id: string;
84
87
  messages: OAI.Message[];
@@ -132,12 +135,11 @@ export declare class Iteration {
132
135
  }
133
136
  export declare class Context {
134
137
  id: string;
135
- transcript?: ValueOrGetter<TranscriptArray, Context>;
138
+ chat?: Chat;
136
139
  instructions?: ValueOrGetter<string, Context>;
137
140
  objects?: ValueOrGetter<ObjectInstance[], Context>;
138
141
  tools?: ValueOrGetter<Tool[], Context>;
139
142
  exits?: ValueOrGetter<Exit[], Context>;
140
- components?: ValueOrGetter<Component[], Context>;
141
143
  version: Prompt;
142
144
  timeout: number;
143
145
  loop: number;
@@ -152,12 +154,11 @@ export declare class Context {
152
154
  private _getIterationMessages;
153
155
  private _refreshIterationParameters;
154
156
  constructor(props: {
157
+ chat?: Chat;
155
158
  instructions?: ValueOrGetter<string, Context>;
156
159
  objects?: ValueOrGetter<ObjectInstance[], Context>;
157
160
  tools?: ValueOrGetter<Tool[], Context>;
158
161
  exits?: ValueOrGetter<Exit[], Context>;
159
- transcript?: ValueOrGetter<TranscriptMessage[], Context>;
160
- components?: ValueOrGetter<Component[], Context>;
161
162
  loop?: number;
162
163
  temperature?: number;
163
164
  model?: Model;
@@ -1,13 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkW6U2VXSFcjs = require('./chunk-W6U2VXSF.cjs');
4
- require('./chunk-VAF2H6UD.cjs');
3
+ var _chunk6WT5VZBGcjs = require('./chunk-6WT5VZBG.cjs');
5
4
  require('./chunk-IKSIOIIP.cjs');
6
- require('./chunk-JK2LZW2G.cjs');
5
+ require('./chunk-EJRCDWBA.cjs');
7
6
  require('./chunk-KMZDFWYZ.cjs');
8
7
  require('./chunk-FIVFS4HG.cjs');
9
8
  require('./chunk-P7J2WCBB.cjs');
10
9
  require('./chunk-UQOBUJIQ.cjs');
11
10
 
12
11
 
13
- exports.DualModePrompt = _chunkW6U2VXSFcjs.DualModePrompt;
12
+ exports.DualModePrompt = _chunk6WT5VZBGcjs.DualModePrompt;
@@ -1,9 +1,8 @@
1
1
  import {
2
2
  DualModePrompt
3
- } from "./chunk-TJQVC4CE.js";
4
- import "./chunk-EFGXTO64.js";
3
+ } from "./chunk-WLUVY5QU.js";
5
4
  import "./chunk-JQBT7UWN.js";
6
- import "./chunk-ZCPQ3QOW.js";
5
+ import "./chunk-HP7RKM25.js";
7
6
  import "./chunk-ORQP26SZ.js";
8
7
  import "./chunk-QT4QF3YA.js";
9
8
  import "./chunk-5TRUJES5.js";
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkLVKZYKTPcjs = require('./chunk-LVKZYKTP.cjs');
3
+ var _chunk4I7UPBLNcjs = require('./chunk-4I7UPBLN.cjs');
4
4
  require('./chunk-P7J2WCBB.cjs');
5
5
  require('./chunk-UQOBUJIQ.cjs');
6
6
 
7
7
 
8
- exports.Exit = _chunkLVKZYKTPcjs.Exit;
8
+ exports.Exit = _chunk4I7UPBLNcjs.Exit;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Exit
3
- } from "./chunk-S6WICIDW.js";
3
+ } from "./chunk-S6FOL2HY.js";
4
4
  import "./chunk-5TRUJES5.js";
5
5
  import "./chunk-7WRN4E42.js";
6
6
  export {
package/dist/exit.d.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  import { type JSONSchema } from '@bpinternal/zui';
2
2
  import { ZuiType } from './types.js';
3
+ export type ExitResult<T = unknown> = {
4
+ exit: Exit<T>;
5
+ result: T;
6
+ };
3
7
  export declare class Exit<T = unknown> {
4
8
  name: string;
5
9
  aliases: string[];
@@ -10,7 +14,7 @@ export declare class Exit<T = unknown> {
10
14
  rename(name: string): this;
11
15
  clone(): Exit<any>;
12
16
  is<T>(exit: Exit<T>): this is Exit<T>;
13
- parse(exit: Exit, value: unknown): value is T;
17
+ match(result: ExitResult): result is ExitResult<T>;
14
18
  constructor(props: {
15
19
  name: string;
16
20
  aliases?: string[];
package/dist/getter.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export type ValueOrGetter<T, I> = T | ((ctx: I) => T) | ((ctx: I) => Promise<T>);
2
- export declare const getValue: <T, I>(valueOrGetter: ValueOrGetter<T, I>, ctx: I) => Promise<T>;
2
+ export declare const getValue: <T, I>(valueOrGetter: ValueOrGetter<T, I>, ctx?: I) => Promise<T>;