llmz 0.0.2

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 (96) hide show
  1. package/README.md +41 -0
  2. package/dist/chunk-3CGLDS5T.cjs +3059 -0
  3. package/dist/chunk-3T465BEW.js +96 -0
  4. package/dist/chunk-6QDFMQHA.js +98 -0
  5. package/dist/chunk-7FIPXMZR.js +33 -0
  6. package/dist/chunk-7S3UY52U.js +3059 -0
  7. package/dist/chunk-A7BDFLAE.cjs +30 -0
  8. package/dist/chunk-BKGPO722.cjs +3079 -0
  9. package/dist/chunk-BOLDQGES.cjs +33 -0
  10. package/dist/chunk-C2TSWGYC.cjs +91 -0
  11. package/dist/chunk-DFZ6GX5C.js +220 -0
  12. package/dist/chunk-DILHJIMP.js +180 -0
  13. package/dist/chunk-E2B5DRIC.cjs +419 -0
  14. package/dist/chunk-E5W3P7EO.cjs +96 -0
  15. package/dist/chunk-ENFB45AI.cjs +220 -0
  16. package/dist/chunk-MSTBEKOQ.js +28 -0
  17. package/dist/chunk-PQN6HW7A.cjs +28 -0
  18. package/dist/chunk-Q4DEJGXD.js +344 -0
  19. package/dist/chunk-QPSUMPLP.js +419 -0
  20. package/dist/chunk-QZGFCB4T.cjs +344 -0
  21. package/dist/chunk-R2N2UUKC.cjs +98 -0
  22. package/dist/chunk-RB2L33ZR.js +3079 -0
  23. package/dist/chunk-RJHDQL4C.js +161 -0
  24. package/dist/chunk-UG2GCPHF.js +91 -0
  25. package/dist/chunk-UVSOAH2H.js +152 -0
  26. package/dist/chunk-VP6WWAE2.cjs +152 -0
  27. package/dist/chunk-YPOOKE3A.cjs +180 -0
  28. package/dist/chunk-YSQDPG26.js +30 -0
  29. package/dist/chunk-YUDUY7XW.cjs +284 -0
  30. package/dist/chunk-ZSRC3TN4.js +284 -0
  31. package/dist/chunk-ZUAFUOUR.cjs +161 -0
  32. package/dist/compiler/compiler.d.ts +28 -0
  33. package/dist/compiler/index.d.ts +2 -0
  34. package/dist/compiler/plugins/async-iterator.d.ts +4 -0
  35. package/dist/compiler/plugins/braces-tsx.d.ts +3 -0
  36. package/dist/compiler/plugins/jsx-preserve-newlines.d.ts +5 -0
  37. package/dist/compiler/plugins/line-tracking.d.ts +5 -0
  38. package/dist/compiler/plugins/replace-comment.d.ts +5 -0
  39. package/dist/compiler/plugins/return-async.d.ts +4 -0
  40. package/dist/compiler/plugins/track-tool-calls.d.ts +16 -0
  41. package/dist/compiler/plugins/variable-extraction.d.ts +5 -0
  42. package/dist/component-DWBRHLEN.cjs +9 -0
  43. package/dist/component-R3ZAVXUC.js +9 -0
  44. package/dist/component.d.ts +51 -0
  45. package/dist/component.default.d.ts +10 -0
  46. package/dist/context.d.ts +167 -0
  47. package/dist/dual-modes-2VDEOJ5D.js +13 -0
  48. package/dist/dual-modes-3MH5N6RY.cjs +13 -0
  49. package/dist/errors.d.ts +64 -0
  50. package/dist/exit-GYMXZZ4I.js +9 -0
  51. package/dist/exit-PQHMJEOG.cjs +9 -0
  52. package/dist/exit.d.ts +20 -0
  53. package/dist/formatting.d.ts +5 -0
  54. package/dist/getter.d.ts +2 -0
  55. package/dist/handlers.d.ts +10 -0
  56. package/dist/hoist.d.ts +2 -0
  57. package/dist/index.cjs +811 -0
  58. package/dist/index.d.ts +18 -0
  59. package/dist/index.js +811 -0
  60. package/dist/inspect.d.ts +6 -0
  61. package/dist/jsx-CJ2RBODH.js +14 -0
  62. package/dist/jsx-PPLE5YTB.cjs +14 -0
  63. package/dist/jsx.d.ts +11 -0
  64. package/dist/llmz-EGTGPSTX.cjs +1049 -0
  65. package/dist/llmz-WY74UVE3.js +1049 -0
  66. package/dist/llmz.d.ts +41 -0
  67. package/dist/objects.d.ts +24 -0
  68. package/dist/openai.d.ts +8 -0
  69. package/dist/prompts/chat-mode/system.md.d.ts +2 -0
  70. package/dist/prompts/chat-mode/user.md.d.ts +2 -0
  71. package/dist/prompts/common.d.ts +6 -0
  72. package/dist/prompts/dual-modes.d.ts +2 -0
  73. package/dist/prompts/prompt.d.ts +50 -0
  74. package/dist/prompts/worker-mode/system.md.d.ts +2 -0
  75. package/dist/prompts/worker-mode/user.md.d.ts +2 -0
  76. package/dist/snapshots.d.ts +61 -0
  77. package/dist/stack-traces.d.ts +1 -0
  78. package/dist/tool-AY47ML65.cjs +12 -0
  79. package/dist/tool-WVIPESKN.js +12 -0
  80. package/dist/tool.d.ts +30 -0
  81. package/dist/transcript.d.ts +9 -0
  82. package/dist/truncator-MTONQESU.js +11 -0
  83. package/dist/truncator-ZKPOW2I3.cjs +11 -0
  84. package/dist/truncator.d.ts +21 -0
  85. package/dist/types.d.ts +131 -0
  86. package/dist/typings-HTYLRNIC.js +11 -0
  87. package/dist/typings-QRJGGNUM.cjs +11 -0
  88. package/dist/typings.d.ts +5 -0
  89. package/dist/utils-TS23YJPE.js +38 -0
  90. package/dist/utils-UR4IMUHC.cjs +38 -0
  91. package/dist/utils.d.ts +21 -0
  92. package/dist/vm-4JFSZAMR.cjs +13 -0
  93. package/dist/vm-SMMA664M.js +13 -0
  94. package/dist/vm.d.ts +3 -0
  95. package/package.json +85 -0
  96. package/patches/source-map-js@1.2.1.patch +16 -0
@@ -0,0 +1,284 @@
1
+ import {
2
+ CodeFormattingError
3
+ } from "./chunk-RJHDQL4C.js";
4
+ import {
5
+ escapeString,
6
+ getMultilineComment,
7
+ toPropertyKey
8
+ } from "./chunk-DFZ6GX5C.js";
9
+
10
+ // src/typings.ts
11
+ import { z } from "@bpinternal/zui";
12
+
13
+ // src/formatting.ts
14
+ import { LRUCache } from "lru-cache";
15
+ import babel from "prettier/plugins/babel";
16
+ import estree from "prettier/plugins/estree";
17
+ import typescript from "prettier/plugins/typescript";
18
+ import { format } from "prettier/standalone";
19
+ var cache = new LRUCache({ max: 1e3 });
20
+ async function formatTypings(typings, options) {
21
+ if (cache.has(typings)) {
22
+ return cache.get(typings);
23
+ }
24
+ try {
25
+ options ??= {};
26
+ options.throwOnError ??= true;
27
+ const result = (await format(typings, {
28
+ singleAttributePerLine: true,
29
+ bracketSameLine: true,
30
+ semi: false,
31
+ ...options,
32
+ embeddedLanguageFormatting: "off",
33
+ plugins: [estree, babel, typescript],
34
+ parser: "typescript",
35
+ filepath: "tools.d.ts"
36
+ })).trim();
37
+ cache.set(typings, result);
38
+ return result;
39
+ } catch (err) {
40
+ if (options == null ? void 0 : options.throwOnError) {
41
+ throw new CodeFormattingError(err instanceof Error ? err.message : (err == null ? void 0 : err.toString()) ?? "Unknown Error", typings);
42
+ }
43
+ return typings;
44
+ }
45
+ }
46
+
47
+ // src/typings.ts
48
+ var Primitives = [
49
+ "string",
50
+ "number",
51
+ "boolean",
52
+ "unknown",
53
+ "void",
54
+ "any",
55
+ "null",
56
+ "undefined",
57
+ "never",
58
+ "bigint",
59
+ "symbol",
60
+ "object"
61
+ ];
62
+ var LARGE_DECLARATION_LINES = 5;
63
+ var isPrimitive = (type) => Primitives.includes(type);
64
+ var isArrayOfPrimitives = (type) => Primitives.map((p) => `${p}[]`).includes(type);
65
+ var stripSpaces = (typings) => typings.replace(/ +/g, " ").trim();
66
+ var KeyValue = class {
67
+ constructor(key, value) {
68
+ this.key = key;
69
+ this.value = value;
70
+ }
71
+ };
72
+ var FnParameters = class {
73
+ constructor(schema) {
74
+ this.schema = schema;
75
+ }
76
+ };
77
+ var FnReturn = class {
78
+ constructor(schema) {
79
+ this.schema = schema;
80
+ }
81
+ };
82
+ var Declaration = class {
83
+ constructor(schema, identifier) {
84
+ this.schema = schema;
85
+ this.identifier = identifier;
86
+ }
87
+ };
88
+ async function getTypings(schema, options) {
89
+ options ??= {};
90
+ options.declaration ??= false;
91
+ let wrappedSchema = schema;
92
+ if (options == null ? void 0 : options.declaration) {
93
+ if (schema instanceof z.Schema) {
94
+ const title = "title" in schema.ui ? schema.ui.title : null;
95
+ if (!title) {
96
+ throw new Error('Only schemas with "title" Zui property can be declared.');
97
+ }
98
+ wrappedSchema = new Declaration(schema, title);
99
+ }
100
+ }
101
+ let dts = await sUnwrapZodRecursive(wrappedSchema, { ...options });
102
+ dts = await formatTypings(dts, { throwOnError: false });
103
+ return dts;
104
+ }
105
+ async function sUnwrapZodRecursive(schema, options) {
106
+ return sUnwrapZod(schema, options);
107
+ }
108
+ async function sUnwrapZod(schema, options) {
109
+ var _a, _b;
110
+ const newOptions = {
111
+ ...options,
112
+ declaration: false,
113
+ parent: schema
114
+ };
115
+ if (schema instanceof Declaration) {
116
+ const description = getMultilineComment(schema.schema.description);
117
+ const withoutDesc = schema.schema.describe("");
118
+ const typings = await sUnwrapZodRecursive(withoutDesc, { ...newOptions, declaration: true });
119
+ const isLargeDeclaration = typings.split("\n").length >= LARGE_DECLARATION_LINES;
120
+ const closingTag = isLargeDeclaration ? `// end of ${schema.identifier}` : "";
121
+ if (schema.schema instanceof z.ZodFunction) {
122
+ return stripSpaces(`${description}
123
+ declare function ${schema.identifier}${typings};${closingTag}`);
124
+ }
125
+ return stripSpaces(`${description}
126
+ declare const ${schema.identifier}: ${typings};${closingTag}`);
127
+ }
128
+ if (schema instanceof KeyValue) {
129
+ if (schema.value instanceof z.ZodOptional) {
130
+ let innerType = schema.value._def.innerType;
131
+ if (innerType instanceof z.Schema && !innerType.description && schema.value.description) {
132
+ innerType = innerType == null ? void 0 : innerType.describe(schema.value.description);
133
+ }
134
+ const optionalToken = schema.key.endsWith("?") ? "" : "?";
135
+ return sUnwrapZodRecursive(new KeyValue(schema.key + optionalToken, innerType), newOptions);
136
+ }
137
+ const description = getMultilineComment(schema.value._def.description || schema.value.description);
138
+ const delimiter = (description == null ? void 0 : description.trim().length) > 0 ? "\n" : "";
139
+ const withoutDesc = schema.value.describe("");
140
+ return `${delimiter}${description}${delimiter}${schema.key}: ${await sUnwrapZodRecursive(withoutDesc, newOptions)}${delimiter}`;
141
+ }
142
+ if (schema instanceof FnParameters) {
143
+ if (schema.schema instanceof z.ZodTuple) {
144
+ let args = "";
145
+ for (let i = 0; i < schema.schema.items.length; i++) {
146
+ const argName = ((_b = (_a = schema.schema.items[i]) == null ? void 0 : _a.ui) == null ? void 0 : _b.title) ?? `arg${i}`;
147
+ const item = schema.schema.items[i];
148
+ args += `${await sUnwrapZodRecursive(new KeyValue(toPropertyKey(argName), item), newOptions)}, `;
149
+ }
150
+ return args;
151
+ }
152
+ const typings = (await sUnwrapZodRecursive(schema.schema, newOptions)).trim();
153
+ const startsWithPairs = typings.startsWith("{") && typings.endsWith("}") || typings.startsWith("[") && typings.endsWith("]") || typings.startsWith("(") && typings.endsWith(")") || typings.startsWith("Array<") && typings.endsWith(">") || typings.startsWith("Record<") && typings.endsWith(">") || isArrayOfPrimitives(typings);
154
+ if (startsWithPairs) {
155
+ return `args: ${typings}`;
156
+ } else {
157
+ return typings;
158
+ }
159
+ }
160
+ if (schema instanceof FnReturn) {
161
+ if (schema.schema instanceof z.ZodOptional) {
162
+ return `${await sUnwrapZodRecursive(schema.schema.unwrap(), newOptions)} | undefined`;
163
+ }
164
+ return sUnwrapZodRecursive(schema.schema, newOptions);
165
+ }
166
+ if (schema instanceof z.ZodDefault) {
167
+ return sUnwrapZodRecursive(schema._def.innerType, options);
168
+ }
169
+ if (schema instanceof z.ZodVoid) {
170
+ return "void";
171
+ }
172
+ if (schema instanceof z.ZodUnknown) {
173
+ return "unknown";
174
+ }
175
+ if (schema instanceof z.ZodAny) {
176
+ return "any";
177
+ }
178
+ if (schema instanceof z.ZodPromise) {
179
+ return `Promise<${await sUnwrapZodRecursive(schema.unwrap(), newOptions)}>`;
180
+ }
181
+ if (schema instanceof z.ZodFunction) {
182
+ const description = getMultilineComment(schema._def.description);
183
+ const input = await sUnwrapZodRecursive(new FnParameters(schema._def.args), newOptions);
184
+ const output = await sUnwrapZodRecursive(new FnReturn(schema._def.returns), newOptions);
185
+ if (options == null ? void 0 : options.declaration) {
186
+ return `${description}
187
+ (${input}): ${output}`;
188
+ }
189
+ return `${description}
190
+ (${input}) => ${output}`;
191
+ }
192
+ if (schema instanceof z.ZodArray) {
193
+ const item = await sUnwrapZodRecursive(schema._def.type, newOptions);
194
+ if (isPrimitive(item)) {
195
+ return `${item}[]`;
196
+ }
197
+ return `Array<${item}>`;
198
+ }
199
+ if (schema instanceof z.ZodEnum) {
200
+ const values = schema._def.values.map(escapeString);
201
+ return values.join(" | ");
202
+ }
203
+ if (schema instanceof z.ZodTuple) {
204
+ if (schema.items.length === 0) {
205
+ return "[]";
206
+ }
207
+ const items = await Promise.all(schema.items.map((i) => sUnwrapZodRecursive(i, newOptions)));
208
+ return `[${items.join(", ")}]`;
209
+ }
210
+ if (schema instanceof z.ZodNullable) {
211
+ return `${await sUnwrapZodRecursive(schema.unwrap(), options)} | null`;
212
+ }
213
+ if (schema instanceof z.ZodOptional) {
214
+ if ((options == null ? void 0 : options.declaration) || (options == null ? void 0 : options.parent) instanceof z.ZodRecord) {
215
+ return `${await sUnwrapZodRecursive(schema._def.innerType, newOptions)} | undefined`;
216
+ }
217
+ const optionalToken = options.parent instanceof KeyValue ? "| undefined" : "";
218
+ const val = `${await sUnwrapZodRecursive(schema._def.innerType, newOptions)}${optionalToken}`;
219
+ return val;
220
+ }
221
+ if (schema instanceof z.ZodObject) {
222
+ const props = await Promise.all(
223
+ Object.entries(schema.shape).map(async ([key, value]) => {
224
+ if (value instanceof z.Schema) {
225
+ return sUnwrapZodRecursive(new KeyValue(toPropertyKey(key), value), newOptions);
226
+ }
227
+ return `${key}: unknown`;
228
+ })
229
+ );
230
+ return `{ ${props.join("; ")} }`;
231
+ }
232
+ if (schema instanceof z.ZodString) {
233
+ const description = getMultilineComment(schema._def.description);
234
+ return `${description} string`.trim();
235
+ }
236
+ if (schema instanceof z.ZodUnion) {
237
+ const description = getMultilineComment(schema._def.description);
238
+ const options2 = await Promise.all(
239
+ schema.options.map(async (option) => {
240
+ return sUnwrapZodRecursive(option, newOptions);
241
+ })
242
+ );
243
+ return `${description}
244
+ ${options2.join(" | ")}`;
245
+ }
246
+ if (schema instanceof z.ZodLiteral) {
247
+ const description = getMultilineComment(schema._def.description);
248
+ return `${description}
249
+ ${typeof schema.value === "string" ? escapeString(schema.value) : schema.value}`.trim();
250
+ }
251
+ if (schema instanceof z.ZodNumber) {
252
+ const description = getMultilineComment(schema._def.description);
253
+ return `${description} number`.trim();
254
+ }
255
+ if (schema instanceof z.ZodBoolean) {
256
+ const description = getMultilineComment(schema._def.description);
257
+ return `${description} boolean`.trim();
258
+ }
259
+ if (schema instanceof z.ZodCatch) {
260
+ return sUnwrapZodRecursive(schema.removeCatch(), newOptions);
261
+ }
262
+ if (schema instanceof z.ZodLazy) {
263
+ return sUnwrapZodRecursive(schema._def.getter(), newOptions);
264
+ }
265
+ if (schema instanceof z.ZodRecord) {
266
+ const description = getMultilineComment(schema._def.description);
267
+ const keyType = await sUnwrapZodRecursive(schema._def.keyType, newOptions);
268
+ const valueType = await sUnwrapZodRecursive(schema._def.valueType, newOptions);
269
+ return `${description} { [key: (${keyType})]: (${valueType}) }`;
270
+ }
271
+ try {
272
+ let typings = await (schema == null ? void 0 : schema.toTypescriptAsync());
273
+ typings ??= "unknown";
274
+ return stripSpaces(typings);
275
+ } catch (error) {
276
+ console.error("Error in sUnwrapZod", { error, schema, parent: options == null ? void 0 : options.parent });
277
+ return "unknown";
278
+ }
279
+ }
280
+
281
+ export {
282
+ formatTypings,
283
+ getTypings
284
+ };
@@ -0,0 +1,161 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;
2
+
3
+ var _chunkPQN6HW7Acjs = require('./chunk-PQN6HW7A.cjs');
4
+
5
+ // src/errors.ts
6
+ var errorClasses = {};
7
+ function registerErrorClass(name, errorClass) {
8
+ errorClasses[name] = errorClass;
9
+ }
10
+ var tryParseMessage = (str) => {
11
+ try {
12
+ return JSON.parse(str);
13
+ } catch (e) {
14
+ return str;
15
+ }
16
+ };
17
+ var Signals;
18
+ ((Signals2) => {
19
+ function isWrappedError(error) {
20
+ var _a, _b;
21
+ const isAlreadyWrapped = error.name === "Error" && ((_a = error == null ? void 0 : error.message) == null ? void 0 : _a.startsWith("{")) && ((_b = error == null ? void 0 : error.message) == null ? void 0 : _b.endsWith("}"));
22
+ return isAlreadyWrapped;
23
+ }
24
+ Signals2.isWrappedError = isWrappedError;
25
+ function serializeError(error) {
26
+ if (isWrappedError(error)) {
27
+ const msg = tryParseMessage(error.message);
28
+ return JSON.stringify({
29
+ ...typeof msg === "object" ? msg : { message: msg },
30
+ properties: { ...error }
31
+ });
32
+ }
33
+ return JSON.stringify({
34
+ name: error.constructor.name,
35
+ message: error.message,
36
+ stack: _chunkPQN6HW7Acjs.cleanStackTrace.call(void 0, _nullishCoalesce(error.stack, () => ( ""))),
37
+ properties: { ...error }
38
+ });
39
+ }
40
+ Signals2.serializeError = serializeError;
41
+ function maybeDeserializeError(error) {
42
+ const errorIsAlreadyDeserialized = error instanceof Error && error.name in errorClasses;
43
+ if (errorIsAlreadyDeserialized) {
44
+ return error;
45
+ }
46
+ const serializedError = error instanceof Error ? error.message : typeof error === "string" ? error : _nullishCoalesce((error == null ? void 0 : error.toString()), () => ( ""));
47
+ try {
48
+ const parsed = JSON.parse(serializedError);
49
+ if (parsed && parsed.name && parsed.message) {
50
+ const { name, message, properties = {} } = parsed;
51
+ const ErrorClass = errorClasses[name] || Error;
52
+ const errorInstance = new ErrorClass(message);
53
+ errorInstance.message = message;
54
+ errorInstance.name = name;
55
+ errorInstance.stack = _chunkPQN6HW7Acjs.cleanStackTrace.call(void 0, _nullishCoalesce((error == null ? void 0 : error.stack), () => ( "")));
56
+ Object.assign(errorInstance, properties);
57
+ if (isWrappedError(errorInstance)) {
58
+ return maybeDeserializeError(errorInstance);
59
+ }
60
+ return errorInstance;
61
+ }
62
+ } catch (e2) {
63
+ }
64
+ return error;
65
+ }
66
+ Signals2.maybeDeserializeError = maybeDeserializeError;
67
+ })(Signals || (Signals = exports.Signals = {}));
68
+ var VMSignal = (_class = class extends Error {
69
+ constructor(message) {
70
+ super(message);_class.prototype.__init.call(this);_class.prototype.__init2.call(this);;
71
+ this.message = message;
72
+ this.message = Signals.serializeError(this);
73
+ }
74
+ /**
75
+ * The code that was executed by the VM up to the point of the signal
76
+ */
77
+ __init() {this.truncatedCode = ""}
78
+ /** The current tool call, if any */
79
+
80
+ /**
81
+ * Contains all the declared and executed variables during the VM execution
82
+ * See file plugins/variable-extraction.ts for more details
83
+ */
84
+ __init2() {this.variables = {}}
85
+ }, _class);
86
+ var SnapshotSignal = class extends VMSignal {
87
+ constructor(message) {
88
+ super(message);
89
+ this.message = Signals.serializeError(this);
90
+ }
91
+ };
92
+ var VMLoopSignal = class extends VMSignal {
93
+ constructor(message) {
94
+ super(message);
95
+ this.message = Signals.serializeError(this);
96
+ }
97
+ };
98
+ var ThinkSignal = class extends VMLoopSignal {
99
+ constructor(reason, context) {
100
+ super("Think signal received: " + reason);
101
+ this.reason = reason;
102
+ this.context = context;
103
+ this.message = Signals.serializeError(this);
104
+ }
105
+ toString() {
106
+ return Signals.serializeError(this);
107
+ }
108
+ };
109
+ var CodeExecutionError = class extends Error {
110
+ constructor(message, code, stacktrace) {
111
+ super(message);
112
+ this.code = code;
113
+ this.stacktrace = stacktrace;
114
+ this.message = Signals.serializeError(this);
115
+ }
116
+ };
117
+ var InvalidCodeError = class extends Error {
118
+ constructor(message, code) {
119
+ super(message);
120
+ this.code = code;
121
+ this.message = Signals.serializeError(this);
122
+ }
123
+ };
124
+ var LoopExceededError = class extends Error {
125
+ constructor() {
126
+ super("Loop exceeded error");
127
+ this.message = Signals.serializeError(this);
128
+ }
129
+ };
130
+ var CodeFormattingError = class extends Error {
131
+ constructor(message, code) {
132
+ super(message, {
133
+ cause: "Code formatting error"
134
+ });
135
+ this.code = code;
136
+ }
137
+ };
138
+ var AssignmentError = class extends Error {
139
+ constructor(message) {
140
+ super(message);
141
+ this.message = Signals.serializeError(this);
142
+ }
143
+ };
144
+ registerErrorClass("VMSignal", VMSignal);
145
+ registerErrorClass("SnapshotSignal", SnapshotSignal);
146
+ registerErrorClass("VMLoopSignal", VMLoopSignal);
147
+ registerErrorClass("ThinkSignal", ThinkSignal);
148
+ registerErrorClass("CodeExecutionError", CodeExecutionError);
149
+ registerErrorClass("AssignmentError", AssignmentError);
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+ exports.Signals = Signals; exports.VMSignal = VMSignal; exports.SnapshotSignal = SnapshotSignal; exports.ThinkSignal = ThinkSignal; exports.CodeExecutionError = CodeExecutionError; exports.InvalidCodeError = InvalidCodeError; exports.LoopExceededError = LoopExceededError; exports.CodeFormattingError = CodeFormattingError; exports.AssignmentError = AssignmentError;
@@ -0,0 +1,28 @@
1
+ import { type TransformOptions } from '@babel/core';
2
+ import { ToolCallEntry } from './plugins/track-tool-calls.js';
3
+ export declare const DEFAULT_TRANSFORM_OPTIONS: TransformOptions;
4
+ export declare const Identifiers: {
5
+ JSXFnIdentifier: string;
6
+ AsyncIterYieldFnIdentifier: string;
7
+ ConsoleObjIdentifier: string;
8
+ LineTrackingFnIdentifier: string;
9
+ VariableTrackingFnIdentifier: string;
10
+ ToolCallTrackerFnIdentifier: string;
11
+ ToolTrackerRetIdentifier: string;
12
+ CommentFnIdentifier: string;
13
+ };
14
+ export type CompiledCode = ReturnType<typeof compile>;
15
+ export declare function compile(code: string): {
16
+ code: string;
17
+ map: {
18
+ version: number;
19
+ sources: string[];
20
+ names: string[];
21
+ sourceRoot?: string | undefined;
22
+ sourcesContent?: string[] | undefined;
23
+ mappings: string;
24
+ file: string;
25
+ } | null | undefined;
26
+ variables: Set<string>;
27
+ toolCalls: Map<number, ToolCallEntry>;
28
+ };
@@ -0,0 +1,2 @@
1
+ export { Identifiers, compile } from './compiler.js';
2
+ export type { CompiledCode } from './compiler.js';
@@ -0,0 +1,4 @@
1
+ export declare const AsyncIterator: {
2
+ preProcessing: (code: string) => string;
3
+ postProcessing: (code: string) => string;
4
+ };
@@ -0,0 +1,3 @@
1
+ export declare const JSXMarkdown: {
2
+ preProcessing: (code: string) => string;
3
+ };
@@ -0,0 +1,5 @@
1
+ import type { PluginObj } from '@babel/core';
2
+ export declare const JSXNewLines: {
3
+ babelPlugin: PluginObj<import("@babel/core").PluginPass>;
4
+ postProcessing: (code: string) => string;
5
+ };
@@ -0,0 +1,5 @@
1
+ import type * as BabelCore from '@babel/core';
2
+ export declare const LineTrackingFnIdentifier = "__track__";
3
+ export declare const lineTrackingBabelPlugin: ({ types: t }: {
4
+ types: typeof BabelCore.types;
5
+ }) => BabelCore.PluginObj;
@@ -0,0 +1,5 @@
1
+ import type * as BabelCore from '@babel/core';
2
+ export declare const CommentFnIdentifier = "__comment__";
3
+ export declare const replaceCommentBabelPlugin: ({ types: t, }: {
4
+ types: typeof BabelCore.types;
5
+ }) => BabelCore.PluginObj;
@@ -0,0 +1,4 @@
1
+ import type * as BabelCore from '@babel/core';
2
+ export declare const instrumentLastLinePlugin: ({ types: t, }: {
3
+ types: typeof BabelCore.types;
4
+ }) => BabelCore.PluginObj;
@@ -0,0 +1,16 @@
1
+ import type * as BabelCore from '@babel/core';
2
+ export declare const ToolCallTrackerFnIdentifier = "__toolc__";
3
+ export declare const ToolTrackerRetIdentifier = "__ret__";
4
+ export type Assignment = {
5
+ type: 'single' | 'object' | 'array' | 'unsupported';
6
+ left: string;
7
+ evalFn: string;
8
+ };
9
+ export type ToolCallEntry = {
10
+ object: string;
11
+ tool: string;
12
+ assignment: Assignment;
13
+ };
14
+ export declare const toolCallTrackingPlugin: (calls?: Map<number, ToolCallEntry>) => ({}: {
15
+ types: typeof BabelCore.types;
16
+ }) => BabelCore.PluginObj;
@@ -0,0 +1,5 @@
1
+ import type * as BabelCore from '@babel/core';
2
+ export declare const VariableTrackingFnIdentifier = "__var__";
3
+ export declare const variableTrackingPlugin: (variables?: Set<string>) => ({ types: t }: {
4
+ types: typeof BabelCore.types;
5
+ }) => BabelCore.PluginObj;
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkE5W3P7EOcjs = require('./chunk-E5W3P7EO.cjs');
5
+ require('./chunk-A7BDFLAE.cjs');
6
+
7
+
8
+
9
+ exports.assertValidComponent = _chunkE5W3P7EOcjs.assertValidComponent; exports.getComponentReference = _chunkE5W3P7EOcjs.getComponentReference;
@@ -0,0 +1,9 @@
1
+ import {
2
+ assertValidComponent,
3
+ getComponentReference
4
+ } from "./chunk-3T465BEW.js";
5
+ import "./chunk-YSQDPG26.js";
6
+ export {
7
+ assertValidComponent,
8
+ getComponentReference
9
+ };
@@ -0,0 +1,51 @@
1
+ export type ComponentProperty = {
2
+ name: string;
3
+ type: 'string' | 'boolean' | 'number';
4
+ default?: string | boolean | number;
5
+ description?: string;
6
+ required: boolean;
7
+ };
8
+ export type Component = DefaultComponent | LeafComponent | ContainerComponent;
9
+ export type ExampleUsage = {
10
+ name: string;
11
+ description: string;
12
+ code: string;
13
+ };
14
+ export type ComponentChild = {
15
+ description: string;
16
+ component: Component;
17
+ };
18
+ export type DefaultComponent = {
19
+ type: 'default';
20
+ name: string;
21
+ aliases: string[];
22
+ description: string;
23
+ examples: ExampleUsage[];
24
+ default: {
25
+ props: ComponentProperty[];
26
+ children: Array<ComponentChild>;
27
+ };
28
+ };
29
+ export type LeafComponent = {
30
+ type: 'leaf';
31
+ name: string;
32
+ description: string;
33
+ aliases?: string[];
34
+ examples: ExampleUsage[];
35
+ leaf: {
36
+ props: ComponentProperty[];
37
+ };
38
+ };
39
+ export type ContainerComponent = {
40
+ type: 'container';
41
+ name: string;
42
+ description: string;
43
+ aliases?: string[];
44
+ examples: ExampleUsage[];
45
+ container: {
46
+ props: ComponentProperty[];
47
+ children: Array<ComponentChild>;
48
+ };
49
+ };
50
+ export declare function assertValidComponent(component: Component): asserts component is Component;
51
+ export declare function getComponentReference(component: Component): string;
@@ -0,0 +1,10 @@
1
+ export declare const DefaultComponents: {
2
+ Button: import("./component.js").LeafComponent;
3
+ Image: import("./component.js").LeafComponent;
4
+ File: import("./component.js").LeafComponent;
5
+ Video: import("./component.js").LeafComponent;
6
+ Audio: import("./component.js").LeafComponent;
7
+ Card: import("./component.js").ContainerComponent;
8
+ Carousel: import("./component.js").ContainerComponent;
9
+ Text: import("./component.js").DefaultComponent;
10
+ };