llmz 0.0.11 → 0.0.13

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 (92) hide show
  1. package/dist/chat.d.ts +17 -0
  2. package/dist/chunk-276Q6EWP.cjs +224 -0
  3. package/dist/chunk-4L6D2A6O.cjs +283 -0
  4. package/dist/chunk-4MNIJGK6.js +224 -0
  5. package/dist/chunk-7WRN4E42.js +3087 -0
  6. package/dist/chunk-BEPRLBPK.cjs +3123 -0
  7. package/dist/chunk-C6WNNTEV.cjs +212 -0
  8. package/dist/chunk-D3ESDRLH.js +3123 -0
  9. package/dist/chunk-GGWM6X2K.js +184 -0
  10. package/dist/chunk-GWFYZDUR.cjs +105 -0
  11. package/dist/chunk-HJKOSEH2.cjs +722 -0
  12. package/dist/chunk-IH2WQFO5.js +283 -0
  13. package/dist/chunk-IKSIOIIP.cjs +28 -0
  14. package/dist/chunk-JAGB2AOU.js +212 -0
  15. package/dist/chunk-JDABP4SD.cjs +161 -0
  16. package/dist/chunk-JGVAZO4X.cjs +152 -0
  17. package/dist/chunk-JKVVQN2P.js +161 -0
  18. package/dist/chunk-JMSZKB4T.js +105 -0
  19. package/dist/chunk-JQBT7UWN.js +28 -0
  20. package/dist/chunk-KH6JQYQA.js +796 -0
  21. package/dist/chunk-KMZDFWYZ.cjs +33 -0
  22. package/dist/chunk-ORQP26SZ.js +33 -0
  23. package/dist/chunk-PRVFVXT4.js +722 -0
  24. package/dist/chunk-SHJDRZF5.cjs +796 -0
  25. package/dist/chunk-SNDVQU5A.js +152 -0
  26. package/dist/chunk-UQOBUJIQ.cjs +3087 -0
  27. package/dist/chunk-ZRCU35UV.cjs +184 -0
  28. package/dist/citations.d.ts +63 -0
  29. package/dist/compiler/compiler.d.ts +28 -0
  30. package/dist/compiler/index.d.ts +2 -0
  31. package/dist/compiler/plugins/async-iterator.d.ts +4 -0
  32. package/dist/compiler/plugins/braces-tsx.d.ts +3 -0
  33. package/dist/compiler/plugins/jsx-preserve-newlines.d.ts +5 -0
  34. package/dist/compiler/plugins/line-tracking.d.ts +5 -0
  35. package/dist/compiler/plugins/replace-comment.d.ts +5 -0
  36. package/dist/compiler/plugins/return-async.d.ts +4 -0
  37. package/dist/compiler/plugins/track-tool-calls.d.ts +16 -0
  38. package/dist/compiler/plugins/variable-extraction.d.ts +5 -0
  39. package/dist/component-R4WTW6DZ.cjs +18 -0
  40. package/dist/component-WFVDVSDK.js +18 -0
  41. package/dist/component.d.ts +66 -0
  42. package/dist/component.default.d.ts +316 -0
  43. package/dist/context.d.ts +176 -0
  44. package/dist/dual-modes-T53P72CH.js +12 -0
  45. package/dist/dual-modes-VLIGPIHX.cjs +12 -0
  46. package/dist/errors.d.ts +64 -0
  47. package/dist/exit-TRXEU4OU.cjs +8 -0
  48. package/dist/exit-YORW76T3.js +8 -0
  49. package/dist/exit.d.ts +26 -0
  50. package/dist/formatting.d.ts +5 -0
  51. package/dist/getter.d.ts +2 -0
  52. package/dist/handlers.d.ts +10 -0
  53. package/dist/hoist.d.ts +2 -0
  54. package/dist/index.cjs +921 -0
  55. package/dist/index.d.ts +23 -0
  56. package/dist/index.js +921 -0
  57. package/dist/inspect.d.ts +6 -0
  58. package/dist/jsx-AEHVFB3L.js +13 -0
  59. package/dist/jsx-AJAXBWFE.cjs +13 -0
  60. package/dist/jsx.d.ts +11 -0
  61. package/dist/llmz-QLZBDG2Z.cjs +576 -0
  62. package/dist/llmz-ROOX7RYI.js +576 -0
  63. package/dist/llmz.d.ts +40 -0
  64. package/dist/objects.d.ts +24 -0
  65. package/dist/prompts/chat-mode/system.md.d.ts +2 -0
  66. package/dist/prompts/chat-mode/user.md.d.ts +2 -0
  67. package/dist/prompts/common.d.ts +6 -0
  68. package/dist/prompts/dual-modes.d.ts +2 -0
  69. package/dist/prompts/prompt.d.ts +55 -0
  70. package/dist/prompts/worker-mode/system.md.d.ts +2 -0
  71. package/dist/prompts/worker-mode/user.md.d.ts +2 -0
  72. package/dist/result.d.ts +33 -0
  73. package/dist/snapshots.d.ts +69 -0
  74. package/dist/stack-traces.d.ts +1 -0
  75. package/dist/tool-N6ODRRGH.js +11 -0
  76. package/dist/tool-QP4MVRWI.cjs +11 -0
  77. package/dist/tool.d.ts +56 -0
  78. package/dist/transcript.d.ts +36 -0
  79. package/dist/truncator-DUMWEGQO.cjs +10 -0
  80. package/dist/truncator-IY2MXOMC.js +10 -0
  81. package/dist/truncator.d.ts +20 -0
  82. package/dist/types.d.ts +105 -0
  83. package/dist/typings-2CPHOFDN.cjs +10 -0
  84. package/dist/typings-GDMY6VY2.js +10 -0
  85. package/dist/typings.d.ts +5 -0
  86. package/dist/utils-A7WNEFTA.cjs +39 -0
  87. package/dist/utils-N24IHDFA.js +39 -0
  88. package/dist/utils.d.ts +23 -0
  89. package/dist/vm-2DLG7V4G.cjs +12 -0
  90. package/dist/vm-FLBMZUA2.js +12 -0
  91. package/dist/vm.d.ts +3 -0
  92. package/package.json +4 -4
@@ -0,0 +1,316 @@
1
+ import { Component } from './component.js';
2
+ export declare const DefaultComponents: {
3
+ Button: Component<{
4
+ type: "leaf";
5
+ description: string;
6
+ name: string;
7
+ aliases: string[];
8
+ examples: {
9
+ name: string;
10
+ description: string;
11
+ code: string;
12
+ }[];
13
+ leaf: {
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
+ }>;
30
+ };
31
+ }>;
32
+ Image: Component<{
33
+ type: "leaf";
34
+ name: string;
35
+ description: string;
36
+ aliases: never[];
37
+ examples: {
38
+ name: string;
39
+ description: string;
40
+ code: string;
41
+ }[];
42
+ leaf: {
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
+ }>;
53
+ };
54
+ }>;
55
+ File: Component<{
56
+ type: "leaf";
57
+ name: string;
58
+ description: string;
59
+ aliases: never[];
60
+ examples: {
61
+ name: string;
62
+ description: string;
63
+ code: string;
64
+ }[];
65
+ leaf: {
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
+ }>;
76
+ };
77
+ }>;
78
+ Video: Component<{
79
+ type: "leaf";
80
+ name: string;
81
+ description: string;
82
+ aliases: never[];
83
+ examples: {
84
+ name: string;
85
+ description: string;
86
+ code: string;
87
+ }[];
88
+ leaf: {
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
+ }>;
99
+ };
100
+ }>;
101
+ Audio: Component<{
102
+ type: "leaf";
103
+ name: string;
104
+ description: string;
105
+ aliases: never[];
106
+ examples: {
107
+ name: string;
108
+ description: string;
109
+ code: string;
110
+ }[];
111
+ leaf: {
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
+ }>;
122
+ };
123
+ }>;
124
+ Card: Component<{
125
+ type: "container";
126
+ name: string;
127
+ description: string;
128
+ aliases: never[];
129
+ examples: {
130
+ name: string;
131
+ description: string;
132
+ code: string;
133
+ }[];
134
+ container: {
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
+ }>;
145
+ children: ({
146
+ description: string;
147
+ component: {
148
+ type: "leaf";
149
+ name: string;
150
+ description: string;
151
+ aliases: never[];
152
+ examples: {
153
+ name: string;
154
+ description: string;
155
+ code: string;
156
+ }[];
157
+ leaf: {
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
+ }>;
168
+ };
169
+ };
170
+ } | {
171
+ description: string;
172
+ component: {
173
+ type: "leaf";
174
+ description: string;
175
+ name: string;
176
+ aliases: string[];
177
+ examples: {
178
+ name: string;
179
+ description: string;
180
+ code: string;
181
+ }[];
182
+ leaf: {
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
+ }>;
199
+ };
200
+ };
201
+ })[];
202
+ };
203
+ }>;
204
+ Carousel: Component<{
205
+ type: "container";
206
+ name: string;
207
+ description: string;
208
+ aliases: never[];
209
+ examples: {
210
+ name: string;
211
+ description: string;
212
+ code: string;
213
+ }[];
214
+ container: {
215
+ props: import("@bpinternal/zui").ZodObject<{}, "strip", {}, {}>;
216
+ children: {
217
+ description: string;
218
+ component: {
219
+ type: "container";
220
+ name: string;
221
+ description: string;
222
+ aliases: never[];
223
+ examples: {
224
+ name: string;
225
+ description: string;
226
+ code: string;
227
+ }[];
228
+ container: {
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
+ }>;
239
+ children: ({
240
+ description: string;
241
+ component: {
242
+ type: "leaf";
243
+ name: string;
244
+ description: string;
245
+ aliases: never[];
246
+ examples: {
247
+ name: string;
248
+ description: string;
249
+ code: string;
250
+ }[];
251
+ leaf: {
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
+ }>;
262
+ };
263
+ };
264
+ } | {
265
+ description: string;
266
+ component: {
267
+ type: "leaf";
268
+ description: string;
269
+ name: string;
270
+ aliases: string[];
271
+ examples: {
272
+ name: string;
273
+ description: string;
274
+ code: string;
275
+ }[];
276
+ leaf: {
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
+ }>;
293
+ };
294
+ };
295
+ })[];
296
+ };
297
+ };
298
+ }[];
299
+ };
300
+ }>;
301
+ Text: Component<{
302
+ type: "default";
303
+ name: string;
304
+ aliases: string[];
305
+ description: string;
306
+ examples: {
307
+ name: string;
308
+ description: string;
309
+ code: string;
310
+ }[];
311
+ default: {
312
+ props: import("@bpinternal/zui").ZodObject<{}, "strip", {}, {}>;
313
+ children: never[];
314
+ };
315
+ }>;
316
+ };
@@ -0,0 +1,176 @@
1
+ import { type Cognitive } from '@botpress/cognitive';
2
+ import { Chat } from './chat.js';
3
+ import { Component } from './component.js';
4
+ import { SnapshotSignal } from './errors.js';
5
+ import { Exit } from './exit.js';
6
+ import { ValueOrGetter } from './getter.js';
7
+ import { HookedArray } from './handlers.js';
8
+ import { ObjectInstance } from './objects.js';
9
+ import { LLMzPrompts, Prompt } from './prompts/prompt.js';
10
+ import { Snapshot } from './snapshots.js';
11
+ import { Tool } from './tool.js';
12
+ import { TranscriptArray } from './transcript.js';
13
+ import { ObjectMutation, Trace } from './types.js';
14
+ type Model = Parameters<InstanceType<typeof Cognitive>['generateContent']>[0]['model'];
15
+ export type IterationParameters = {
16
+ transcript: TranscriptArray;
17
+ tools: Tool[];
18
+ objects: ObjectInstance[];
19
+ exits: Exit[];
20
+ instructions?: string;
21
+ components: Component[];
22
+ };
23
+ export type IterationStatus = IterationStatuses.Pending | IterationStatuses.GenerationError | IterationStatuses.ExecutionError | IterationStatuses.InvalidCodeError | IterationStatuses.Thinking | IterationStatuses.Callback | IterationStatuses.ExitSuccess | IterationStatuses.ExitError | IterationStatuses.Aborted;
24
+ export declare namespace IterationStatuses {
25
+ type Pending = {
26
+ type: 'pending';
27
+ };
28
+ type GenerationError = {
29
+ type: 'generation_error';
30
+ generation_error: {
31
+ message: string;
32
+ };
33
+ };
34
+ type InvalidCodeError = {
35
+ type: 'invalid_code_error';
36
+ invalid_code_error: {
37
+ message: string;
38
+ };
39
+ };
40
+ type ExecutionError = {
41
+ type: 'execution_error';
42
+ execution_error: {
43
+ message: string;
44
+ stack: string;
45
+ };
46
+ };
47
+ type Thinking = {
48
+ type: 'thinking_requested';
49
+ thinking_requested: {
50
+ reason?: string;
51
+ variables: Record<string, unknown>;
52
+ };
53
+ };
54
+ type Callback = {
55
+ type: 'callback_requested';
56
+ callback_requested: {
57
+ signal: SnapshotSignal;
58
+ };
59
+ };
60
+ type ExitSuccess<T = unknown> = {
61
+ type: 'exit_success';
62
+ exit_success: {
63
+ exit_name: string;
64
+ return_value: T;
65
+ };
66
+ };
67
+ type ExitError = {
68
+ type: 'exit_error';
69
+ exit_error: {
70
+ exit: string;
71
+ return_value: unknown;
72
+ message: string;
73
+ };
74
+ };
75
+ type Aborted = {
76
+ type: 'aborted';
77
+ aborted: {
78
+ reason: string;
79
+ };
80
+ };
81
+ }
82
+ export declare const ThinkExit: Exit<unknown>;
83
+ export declare const ListenExit: Exit<unknown>;
84
+ export declare const DefaultExit: Exit<{
85
+ success: true;
86
+ result?: any;
87
+ } | {
88
+ error: string;
89
+ success: false;
90
+ }>;
91
+ export declare class Iteration {
92
+ id: string;
93
+ messages: LLMzPrompts.Message[];
94
+ code?: string;
95
+ traces: HookedArray<Trace>;
96
+ variables: Record<string, any>;
97
+ started_ts: number;
98
+ ended_ts?: number;
99
+ status: IterationStatus;
100
+ private _mutations;
101
+ get mutations(): ObjectMutation[];
102
+ trackMutation(mutation: ObjectMutation): void;
103
+ private _parameters;
104
+ get transcript(): TranscriptArray;
105
+ get tools(): Tool<import("./types.js").ZuiType, import("./types.js").ZuiType>[];
106
+ get objects(): ObjectInstance[];
107
+ get exits(): Exit<unknown>[];
108
+ get instructions(): string | undefined;
109
+ llm?: {
110
+ started_at: number;
111
+ ended_at: number;
112
+ status: 'success' | 'error';
113
+ cached: boolean;
114
+ tokens: number;
115
+ spend: number;
116
+ output: string;
117
+ model: string;
118
+ };
119
+ hasExited(this: this): this is this & {
120
+ status: IterationStatuses.ExitSuccess;
121
+ };
122
+ hasExitedWith<R>(this: this, exit: Exit<R>): this is {
123
+ status: IterationStatuses.ExitSuccess<R>;
124
+ } & this;
125
+ isSuccessful(this: this): this is this & {
126
+ status: IterationStatuses.ExitSuccess | IterationStatuses.Callback | IterationStatuses.Thinking;
127
+ };
128
+ isFailed(this: this): this is this & {
129
+ status: IterationStatuses.GenerationError | IterationStatuses.ExecutionError | IterationStatuses.InvalidCodeError | IterationStatuses.ExitError | IterationStatuses.Aborted;
130
+ };
131
+ get duration(): string;
132
+ get error(): string | null;
133
+ get isChatEnabled(): boolean;
134
+ constructor(props: {
135
+ id: string;
136
+ parameters: IterationParameters;
137
+ messages: LLMzPrompts.Message[];
138
+ variables: Record<string, any>;
139
+ });
140
+ end(status: IterationStatus): void;
141
+ }
142
+ export declare class Context {
143
+ id: string;
144
+ chat?: Chat;
145
+ instructions?: ValueOrGetter<string, Context>;
146
+ objects?: ValueOrGetter<ObjectInstance[], Context>;
147
+ tools?: ValueOrGetter<Tool[], Context>;
148
+ exits?: ValueOrGetter<Exit[], Context>;
149
+ version: Prompt;
150
+ timeout: number;
151
+ loop: number;
152
+ temperature: number;
153
+ model?: Model;
154
+ metadata: Record<string, any>;
155
+ snapshot?: Snapshot;
156
+ iteration: number;
157
+ iterations: Iteration[];
158
+ nextIteration(): Promise<Iteration>;
159
+ private _getIterationVariables;
160
+ private _getIterationMessages;
161
+ private _refreshIterationParameters;
162
+ constructor(props: {
163
+ chat?: Chat;
164
+ instructions?: ValueOrGetter<string, Context>;
165
+ objects?: ValueOrGetter<ObjectInstance[], Context>;
166
+ tools?: ValueOrGetter<Tool[], Context>;
167
+ exits?: ValueOrGetter<Exit[], Context>;
168
+ loop?: number;
169
+ temperature?: number;
170
+ model?: Model;
171
+ metadata?: Record<string, any>;
172
+ snapshot?: Snapshot;
173
+ timeout?: number;
174
+ });
175
+ }
176
+ export {};
@@ -0,0 +1,12 @@
1
+ import {
2
+ DualModePrompt
3
+ } from "./chunk-KH6JQYQA.js";
4
+ import "./chunk-JQBT7UWN.js";
5
+ import "./chunk-GGWM6X2K.js";
6
+ import "./chunk-ORQP26SZ.js";
7
+ import "./chunk-SNDVQU5A.js";
8
+ import "./chunk-4MNIJGK6.js";
9
+ import "./chunk-7WRN4E42.js";
10
+ export {
11
+ DualModePrompt
12
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkSHJDRZF5cjs = require('./chunk-SHJDRZF5.cjs');
4
+ require('./chunk-IKSIOIIP.cjs');
5
+ require('./chunk-ZRCU35UV.cjs');
6
+ require('./chunk-KMZDFWYZ.cjs');
7
+ require('./chunk-JGVAZO4X.cjs');
8
+ require('./chunk-276Q6EWP.cjs');
9
+ require('./chunk-UQOBUJIQ.cjs');
10
+
11
+
12
+ exports.DualModePrompt = _chunkSHJDRZF5cjs.DualModePrompt;
@@ -0,0 +1,64 @@
1
+ import { JSONSchema7 } from 'json-schema';
2
+ import { type Assignment } from './compiler/plugins/track-tool-calls.js';
3
+ export type ToolCall = {
4
+ name: string;
5
+ inputSchema?: JSONSchema7;
6
+ outputSchema?: JSONSchema7;
7
+ input?: unknown;
8
+ assignment?: Assignment;
9
+ };
10
+ export declare namespace Signals {
11
+ function isWrappedError(error: Error): boolean;
12
+ function serializeError(error: Error): string;
13
+ function maybeDeserializeError(error: unknown): any;
14
+ }
15
+ export declare class VMSignal extends Error {
16
+ message: string;
17
+ /**
18
+ * The code that was executed by the VM up to the point of the signal
19
+ */
20
+ truncatedCode: string;
21
+ /** The current tool call, if any */
22
+ toolCall?: ToolCall;
23
+ /**
24
+ * Contains all the declared and executed variables during the VM execution
25
+ * See file plugins/variable-extraction.ts for more details
26
+ */
27
+ variables: {
28
+ [key: string]: any;
29
+ };
30
+ constructor(message: string);
31
+ }
32
+ /** Request a snapshot from inside a tool call */
33
+ export declare class SnapshotSignal extends VMSignal {
34
+ constructor(message: string);
35
+ }
36
+ /** Loop means LLMz will continue the execution (unless it exhausted its iterations) */
37
+ export declare class VMLoopSignal extends VMSignal {
38
+ constructor(message: string);
39
+ }
40
+ export declare class ThinkSignal extends VMLoopSignal {
41
+ reason: string;
42
+ context?: any;
43
+ constructor(reason: string, context?: any);
44
+ toString(): string;
45
+ }
46
+ export declare class CodeExecutionError extends Error {
47
+ code: string;
48
+ stacktrace: string;
49
+ constructor(message: string, code: string, stacktrace: string);
50
+ }
51
+ export declare class InvalidCodeError extends Error {
52
+ code: string;
53
+ constructor(message: string, code: string);
54
+ }
55
+ export declare class LoopExceededError extends Error {
56
+ constructor();
57
+ }
58
+ export declare class CodeFormattingError extends Error {
59
+ code: string;
60
+ constructor(message: string, code: string);
61
+ }
62
+ export declare class AssignmentError extends Error {
63
+ constructor(message: string);
64
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkGWFYZDURcjs = require('./chunk-GWFYZDUR.cjs');
4
+ require('./chunk-276Q6EWP.cjs');
5
+ require('./chunk-UQOBUJIQ.cjs');
6
+
7
+
8
+ exports.Exit = _chunkGWFYZDURcjs.Exit;
@@ -0,0 +1,8 @@
1
+ import {
2
+ Exit
3
+ } from "./chunk-JMSZKB4T.js";
4
+ import "./chunk-4MNIJGK6.js";
5
+ import "./chunk-7WRN4E42.js";
6
+ export {
7
+ Exit
8
+ };
package/dist/exit.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ import { JSONSchema7 } from 'json-schema';
2
+ import { ZuiType } from './types.js';
3
+ export type ExitResult<T = unknown> = {
4
+ exit: Exit<T>;
5
+ result: T;
6
+ };
7
+ export declare class Exit<T = unknown> {
8
+ name: string;
9
+ aliases: string[];
10
+ description: string;
11
+ metadata: Record<string, unknown>;
12
+ schema?: JSONSchema7;
13
+ get zSchema(): import("@bpinternal/zui").ZodTypeAny | undefined;
14
+ rename(name: string): this;
15
+ clone(): Exit<any>;
16
+ is<T>(exit: Exit<T>): this is Exit<T>;
17
+ match(result: ExitResult): result is ExitResult<T>;
18
+ constructor(props: {
19
+ name: string;
20
+ aliases?: string[];
21
+ description: string;
22
+ metadata?: Record<string, unknown>;
23
+ schema?: ZuiType<T>;
24
+ });
25
+ static withUniqueNames: (exits: Exit[]) => Exit<unknown>[];
26
+ }
@@ -0,0 +1,5 @@
1
+ import { format } from 'prettier/standalone';
2
+ export type CodeFormatOptions = Parameters<typeof format>[1] & {
3
+ throwOnError?: boolean;
4
+ };
5
+ export declare function formatTypings(typings: string, options?: CodeFormatOptions): Promise<string>;
@@ -0,0 +1,2 @@
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>;
@@ -0,0 +1,10 @@
1
+ type UnsubscribeFn = () => void;
2
+ type EventHandler<T> = (event: T) => void;
3
+ export type SubscribeFn<T> = (fn: EventHandler<T>) => UnsubscribeFn;
4
+ export declare class HookedArray<T> extends Array<T> {
5
+ #private;
6
+ constructor(...items: T[]);
7
+ push(...items: T[]): number;
8
+ onPush(fn: EventHandler<T[]>): UnsubscribeFn;
9
+ }
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import { CodeFormatOptions } from './formatting.js';
2
+ export declare function hoistTypings(code: string, formatOptions?: CodeFormatOptions): Promise<string>;