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
@@ -0,0 +1,16 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+ var _chunkEJRCDWBAcjs = require('./chunk-EJRCDWBA.cjs');
8
+ require('./chunk-KMZDFWYZ.cjs');
9
+ require('./chunk-UQOBUJIQ.cjs');
10
+
11
+
12
+
13
+
14
+
15
+
16
+ exports.Component = _chunkEJRCDWBAcjs.Component; exports.assertValidComponent = _chunkEJRCDWBAcjs.assertValidComponent; exports.getComponentReference = _chunkEJRCDWBAcjs.getComponentReference; exports.isAnyComponent = _chunkEJRCDWBAcjs.isAnyComponent; exports.isComponent = _chunkEJRCDWBAcjs.isComponent;
@@ -1,10 +1,4 @@
1
- export type ComponentProperty = {
2
- name: string;
3
- type: 'string' | 'boolean' | 'number';
4
- default?: string | boolean | number;
5
- description?: string;
6
- required: boolean;
7
- };
1
+ import { z } from '@bpinternal/zui';
8
2
  export type ExampleUsage = {
9
3
  name: string;
10
4
  description: string;
@@ -16,15 +10,7 @@ export type ComponentChild = {
16
10
  };
17
11
  export declare function assertValidComponent(component: ComponentDefinition): asserts component is ComponentDefinition;
18
12
  export declare function getComponentReference(component: ComponentDefinition): string;
19
- type TypeMap = {
20
- string: string;
21
- boolean: boolean;
22
- number: number;
23
- };
24
- type ExtractPropsFromProperties<T extends readonly ComponentProperty[]> = {
25
- [K in T[number] as K['name']]: K['required'] extends true ? TypeMap[K['type']] : TypeMap[K['type']] | undefined;
26
- };
27
- export type DefaultComponentDefinition<T extends readonly ComponentProperty[] = readonly ComponentProperty[]> = {
13
+ export type DefaultComponentDefinition<T extends z.ZodObject<any> = z.ZodObject<any>> = {
28
14
  type: 'default';
29
15
  name: string;
30
16
  aliases: string[];
@@ -35,7 +21,7 @@ export type DefaultComponentDefinition<T extends readonly ComponentProperty[] =
35
21
  children: Array<ComponentChild>;
36
22
  };
37
23
  };
38
- export type LeafComponentDefinition<T extends readonly ComponentProperty[] = readonly ComponentProperty[]> = {
24
+ export type LeafComponentDefinition<T extends z.ZodObject<any> = z.ZodObject<any>> = {
39
25
  type: 'leaf';
40
26
  name: string;
41
27
  description: string;
@@ -45,7 +31,7 @@ export type LeafComponentDefinition<T extends readonly ComponentProperty[] = rea
45
31
  props: T;
46
32
  };
47
33
  };
48
- export type ContainerComponentDefinition<T extends readonly ComponentProperty[] = readonly ComponentProperty[]> = {
34
+ export type ContainerComponentDefinition<T extends z.ZodObject<any> = z.ZodObject<any>> = {
49
35
  type: 'container';
50
36
  name: string;
51
37
  description: string;
@@ -57,7 +43,7 @@ export type ContainerComponentDefinition<T extends readonly ComponentProperty[]
57
43
  };
58
44
  };
59
45
  export type ComponentDefinition = DefaultComponentDefinition | LeafComponentDefinition | ContainerComponentDefinition;
60
- type ExtractComponentProps<T extends ComponentDefinition> = T extends LeafComponentDefinition<infer P> ? ExtractPropsFromProperties<P> : T extends ContainerComponentDefinition<infer P> ? ExtractPropsFromProperties<P> : T extends DefaultComponentDefinition<infer P> ? ExtractPropsFromProperties<P> : never;
46
+ type ExtractComponentProps<T extends ComponentDefinition> = T extends LeafComponentDefinition<infer P> ? z.infer<P> : T extends ContainerComponentDefinition<infer P> ? z.infer<P> : T extends DefaultComponentDefinition<infer P> ? z.infer<P> : never;
61
47
  export type RenderedComponent<TProps = Record<string, any>> = {
62
48
  __jsx: true;
63
49
  type: string;
@@ -70,4 +56,5 @@ export declare class Component<T extends ComponentDefinition = ComponentDefiniti
70
56
  constructor(definition: T);
71
57
  }
72
58
  export declare function isComponent<T extends ComponentDefinition>(rendered: RenderedComponent<any>, component: Component<T>): rendered is RenderedComponent<ExtractComponentProps<T>>;
59
+ export declare function isAnyComponent(message: unknown): message is RenderedComponent;
73
60
  export {};
@@ -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,15 @@ export declare namespace IterationStatuses {
79
80
  };
80
81
  };
81
82
  }
83
+ export declare const ThinkExit: Exit<unknown>;
84
+ export declare const ListenExit: Exit<unknown>;
85
+ export declare const DefaultExit: Exit<{
86
+ success: true;
87
+ result?: any;
88
+ } | {
89
+ error: string;
90
+ success: false;
91
+ }>;
82
92
  export declare class Iteration {
83
93
  id: string;
84
94
  messages: OAI.Message[];
@@ -132,12 +142,11 @@ export declare class Iteration {
132
142
  }
133
143
  export declare class Context {
134
144
  id: string;
135
- transcript?: ValueOrGetter<TranscriptArray, Context>;
145
+ chat?: Chat;
136
146
  instructions?: ValueOrGetter<string, Context>;
137
147
  objects?: ValueOrGetter<ObjectInstance[], Context>;
138
148
  tools?: ValueOrGetter<Tool[], Context>;
139
149
  exits?: ValueOrGetter<Exit[], Context>;
140
- components?: ValueOrGetter<Component[], Context>;
141
150
  version: Prompt;
142
151
  timeout: number;
143
152
  loop: number;
@@ -152,12 +161,11 @@ export declare class Context {
152
161
  private _getIterationMessages;
153
162
  private _refreshIterationParameters;
154
163
  constructor(props: {
164
+ chat?: Chat;
155
165
  instructions?: ValueOrGetter<string, Context>;
156
166
  objects?: ValueOrGetter<ObjectInstance[], Context>;
157
167
  tools?: ValueOrGetter<Tool[], Context>;
158
168
  exits?: ValueOrGetter<Exit[], Context>;
159
- transcript?: ValueOrGetter<TranscriptMessage[], Context>;
160
- components?: ValueOrGetter<Component[], Context>;
161
169
  loop?: number;
162
170
  temperature?: number;
163
171
  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>;