llmz 0.2.2 → 0.2.3

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 (50) hide show
  1. package/CLAUDE.md +0 -1
  2. package/dist/{chunk-2EZSVF5X.cjs → chunk-3UZKLXAD.cjs} +29 -23
  3. package/dist/{chunk-HM5H556L.js → chunk-72ZWBNZV.js} +1 -1
  4. package/dist/{chunk-D6PU5YAS.cjs → chunk-DDSJTR6Q.cjs} +8 -7
  5. package/dist/{chunk-GDWRFHM5.js → chunk-GDJTKI7J.js} +1 -1
  6. package/dist/{chunk-YX27XM67.js → chunk-GLXADNTR.js} +13 -1
  7. package/dist/{chunk-FPLSJF4S.cjs → chunk-GOWPACSK.cjs} +15 -3
  8. package/dist/{chunk-XVVYNOTX.js → chunk-HB2G32AK.js} +3 -2
  9. package/dist/{chunk-YQT5G77W.cjs → chunk-HEAQAEFZ.cjs} +2 -2
  10. package/dist/{chunk-MHVORH33.cjs → chunk-HMMM32RG.cjs} +14 -14
  11. package/dist/{chunk-5XPEVOOW.cjs → chunk-KG5E3UZZ.cjs} +20 -20
  12. package/dist/{chunk-C2KND2PS.cjs → chunk-OVRDJMZJ.cjs} +26 -34
  13. package/dist/{chunk-5ISVDYBA.js → chunk-OXEKAOVI.js} +3 -11
  14. package/dist/{chunk-S46T73HR.cjs → chunk-PZE6PIPG.cjs} +12 -11
  15. package/dist/chunk-RGUG3UMF.cjs +26 -0
  16. package/dist/{chunk-3OSQ4XL4.js → chunk-TDALRNGL.js} +4 -3
  17. package/dist/chunk-UGHFNCPD.js +26 -0
  18. package/dist/{chunk-2MSLOTFO.js → chunk-XMFQVARN.js} +5 -5
  19. package/dist/{chunk-EJIDFDQP.js → chunk-YRS7KRKP.js} +28 -22
  20. package/dist/{dual-modes-J4RWHJ2O.js → dual-modes-BYABHBDI.js} +3 -3
  21. package/dist/dual-modes-HO6RRIZ5.cjs +10 -0
  22. package/dist/emscripten-module.wasm +0 -0
  23. package/dist/{execute-6AYBMTRM.js → execute-DSGJ2UNL.js} +9 -8
  24. package/dist/{execute-4IL4QPAR.cjs → execute-MRZZ4AYY.cjs} +41 -40
  25. package/dist/exit-MX56VN2C.cjs +8 -0
  26. package/dist/{exit-VJATJTQI.js → exit-UQ3EUX5D.js} +2 -2
  27. package/dist/exit.d.ts +1 -1
  28. package/dist/index.cjs +67 -61
  29. package/dist/index.d.ts +2 -0
  30. package/dist/index.js +23 -17
  31. package/dist/index.workerd.js +17328 -0
  32. package/dist/quickjs-variant.d.ts +22 -0
  33. package/dist/quickjs-variant.workerd.d.ts +22 -0
  34. package/dist/{tool-I3MAWDN2.js → tool-KD7FL45V.js} +3 -3
  35. package/dist/{tool-56I7OSKU.cjs → tool-VE2YHIY2.cjs} +4 -4
  36. package/dist/{truncator-OZOBNYON.js → truncator-73RCL52Y.js} +2 -2
  37. package/dist/truncator-FZNLYSDL.cjs +12 -0
  38. package/dist/{typings-SR3EE6LR.js → typings-E2RROCLT.js} +2 -2
  39. package/dist/{typings-LVI4VGE2.cjs → typings-LQOBZXSO.cjs} +3 -3
  40. package/dist/{utils-ZEZ66X6Q.js → utils-IATCUNKF.js} +5 -1
  41. package/dist/utils-ITB4NEL7.cjs +43 -0
  42. package/dist/utils.d.ts +18 -0
  43. package/dist/vm-6D3IIIU7.cjs +12 -0
  44. package/dist/{vm-ZLWGAYYJ.js → vm-QO5FSGPN.js} +2 -1
  45. package/package.json +5 -3
  46. package/dist/dual-modes-IZQJTXR7.cjs +0 -10
  47. package/dist/exit-LUJY7JIG.cjs +0 -8
  48. package/dist/truncator-7PGEGCHV.cjs +0 -12
  49. package/dist/utils-GLZVMRWO.cjs +0 -39
  50. package/dist/vm-ZVONLAZV.cjs +0 -11
package/dist/index.cjs CHANGED
@@ -10,25 +10,28 @@
10
10
 
11
11
 
12
12
 
13
- var _chunk5XPEVOOWcjs = require('./chunk-5XPEVOOW.cjs');
13
+ var _chunkKG5E3UZZcjs = require('./chunk-KG5E3UZZ.cjs');
14
14
 
15
15
 
16
16
 
17
17
 
18
18
 
19
19
 
20
- var _chunkC2KND2PScjs = require('./chunk-C2KND2PS.cjs');
20
+ var _chunkOVRDJMZJcjs = require('./chunk-OVRDJMZJ.cjs');
21
21
 
22
22
 
23
- var _chunkS46T73HRcjs = require('./chunk-S46T73HR.cjs');
23
+ var _chunkRGUG3UMFcjs = require('./chunk-RGUG3UMF.cjs');
24
24
 
25
25
 
26
+ var _chunkPZE6PIPGcjs = require('./chunk-PZE6PIPG.cjs');
26
27
 
27
28
 
28
29
 
29
30
 
30
31
 
31
- var _chunkMHVORH33cjs = require('./chunk-MHVORH33.cjs');
32
+
33
+
34
+ var _chunkHMMM32RGcjs = require('./chunk-HMMM32RG.cjs');
32
35
 
33
36
 
34
37
 
@@ -38,7 +41,7 @@ var _chunkPK72FAKDcjs = require('./chunk-PK72FAKD.cjs');
38
41
  require('./chunk-KIN7Y247.cjs');
39
42
 
40
43
 
41
- var _chunkD6PU5YAScjs = require('./chunk-D6PU5YAS.cjs');
44
+ var _chunkDDSJTR6Qcjs = require('./chunk-DDSJTR6Q.cjs');
42
45
 
43
46
 
44
47
 
@@ -50,7 +53,8 @@ require('./chunk-5ZF6NTYI.cjs');
50
53
 
51
54
 
52
55
 
53
- var _chunkYQT5G77Wcjs = require('./chunk-YQT5G77W.cjs');
56
+ var _chunkHEAQAEFZcjs = require('./chunk-HEAQAEFZ.cjs');
57
+
54
58
 
55
59
 
56
60
 
@@ -59,13 +63,13 @@ var _chunkYQT5G77Wcjs = require('./chunk-YQT5G77W.cjs');
59
63
 
60
64
 
61
65
 
62
- var _chunkFPLSJF4Scjs = require('./chunk-FPLSJF4S.cjs');
66
+ var _chunkGOWPACSKcjs = require('./chunk-GOWPACSK.cjs');
63
67
 
64
68
 
65
69
  var _chunkHC2QZTVTcjs = require('./chunk-HC2QZTVT.cjs');
66
70
 
67
71
  // package.json
68
- var version = "0.2.2";
72
+ var version = "0.2.3";
69
73
 
70
74
  // src/objects.ts
71
75
  var _zui = require('@bpinternal/zui');
@@ -84,7 +88,7 @@ function printNodes(nodes) {
84
88
  out += " ";
85
89
  }
86
90
  afterLineComment = false;
87
- if (_chunkMHVORH33cjs.isGroup.call(void 0, n)) {
91
+ if (_chunkHMMM32RGcjs.isGroup.call(void 0, n)) {
88
92
  out += n.open;
89
93
  for (const child of n.children) {
90
94
  emit(child);
@@ -107,7 +111,7 @@ function printNodes(nodes) {
107
111
  function keyOf(group) {
108
112
  const parts = [];
109
113
  const visit = (n) => {
110
- if (_chunkMHVORH33cjs.isGroup.call(void 0, n)) {
114
+ if (_chunkHMMM32RGcjs.isGroup.call(void 0, n)) {
111
115
  parts.push(n.open);
112
116
  n.children.forEach(visit);
113
117
  parts.push(n.close);
@@ -121,7 +125,7 @@ function keyOf(group) {
121
125
  var prevMeaningful = (siblings, index) => {
122
126
  for (let i = index - 1; i >= 0; i--) {
123
127
  const n = siblings[i];
124
- if (_chunkMHVORH33cjs.isGroup.call(void 0, n) || n.kind !== "block-comment" && n.kind !== "line-comment") {
128
+ if (_chunkHMMM32RGcjs.isGroup.call(void 0, n) || n.kind !== "block-comment" && n.kind !== "line-comment") {
125
129
  return n;
126
130
  }
127
131
  }
@@ -131,26 +135,26 @@ var asName = (text) => _chunkHC2QZTVTcjs.upperFirst_default.call(void 0, text.re
131
135
  function segmentsAt(siblings, index) {
132
136
  var _a;
133
137
  const prev = prevMeaningful(siblings, index);
134
- if (!prev || _chunkMHVORH33cjs.isGroup.call(void 0, prev)) {
138
+ if (!prev || _chunkHMMM32RGcjs.isGroup.call(void 0, prev)) {
135
139
  return [];
136
140
  }
137
- if (_chunkMHVORH33cjs.isPunct.call(void 0, prev, "=>")) {
141
+ if (_chunkHMMM32RGcjs.isPunct.call(void 0, prev, "=>")) {
138
142
  return ["Output"];
139
143
  }
140
- if (_chunkMHVORH33cjs.isPunct.call(void 0, prev, ":") || _chunkMHVORH33cjs.isPunct.call(void 0, prev, "<")) {
144
+ if (_chunkHMMM32RGcjs.isPunct.call(void 0, prev, ":") || _chunkHMMM32RGcjs.isPunct.call(void 0, prev, "<")) {
141
145
  let i = siblings.indexOf(prev) - 1;
142
- while (i >= 0 && !_chunkMHVORH33cjs.isGroup.call(void 0, siblings[i]) && ((_a = siblings[i].kind) == null ? void 0 : _a.includes("comment"))) {
146
+ while (i >= 0 && !_chunkHMMM32RGcjs.isGroup.call(void 0, siblings[i]) && ((_a = siblings[i].kind) == null ? void 0 : _a.includes("comment"))) {
143
147
  i--;
144
148
  }
145
149
  let q = siblings[i];
146
- if (q && !_chunkMHVORH33cjs.isGroup.call(void 0, q) && q.kind === "punct" && q.text === "?") {
150
+ if (q && !_chunkHMMM32RGcjs.isGroup.call(void 0, q) && q.kind === "punct" && q.text === "?") {
147
151
  q = siblings[--i];
148
152
  }
149
- if (q && _chunkMHVORH33cjs.isGroup.call(void 0, q) && q.open === "(") {
153
+ if (q && _chunkHMMM32RGcjs.isGroup.call(void 0, q) && q.open === "(") {
150
154
  const fnWord = prevMeaningful(siblings, i);
151
- return fnWord && !_chunkMHVORH33cjs.isGroup.call(void 0, fnWord) && fnWord.kind === "word" ? [asName(fnWord.text), "Output"] : ["Output"];
155
+ return fnWord && !_chunkHMMM32RGcjs.isGroup.call(void 0, fnWord) && fnWord.kind === "word" ? [asName(fnWord.text), "Output"] : ["Output"];
152
156
  }
153
- if (q && !_chunkMHVORH33cjs.isGroup.call(void 0, q) && (q.kind === "word" || q.kind === "string")) {
157
+ if (q && !_chunkHMMM32RGcjs.isGroup.call(void 0, q) && (q.kind === "word" || q.kind === "string")) {
154
158
  return [asName(q.text)];
155
159
  }
156
160
  }
@@ -160,12 +164,12 @@ function walkLiterals(siblings, path, visit) {
160
164
  var _a;
161
165
  for (let i = 0; i < siblings.length; i++) {
162
166
  const node = siblings[i];
163
- if (!_chunkMHVORH33cjs.isGroup.call(void 0, node)) {
167
+ if (!_chunkHMMM32RGcjs.isGroup.call(void 0, node)) {
164
168
  continue;
165
169
  }
166
170
  if (node.open === "(") {
167
171
  const fnWord = prevMeaningful(siblings, i);
168
- const fnName = fnWord && !_chunkMHVORH33cjs.isGroup.call(void 0, fnWord) && fnWord.kind === "word" ? [asName(fnWord.text)] : [];
172
+ const fnName = fnWord && !_chunkHMMM32RGcjs.isGroup.call(void 0, fnWord) && fnWord.kind === "word" ? [asName(fnWord.text)] : [];
169
173
  walkLiterals(node.children, [...path, ...fnName], visit);
170
174
  continue;
171
175
  }
@@ -174,11 +178,11 @@ function walkLiterals(siblings, path, visit) {
174
178
  continue;
175
179
  }
176
180
  const prev = prevMeaningful(siblings, i);
177
- if (prev && _chunkMHVORH33cjs.isPunct.call(void 0, prev, "=")) {
181
+ if (prev && _chunkHMMM32RGcjs.isPunct.call(void 0, prev, "=")) {
178
182
  const eqIdx = siblings.indexOf(prev);
179
183
  const nameTok = siblings[eqIdx - 1];
180
184
  const typeTok = siblings[eqIdx - 2];
181
- const isAlias = nameTok && typeTok && !_chunkMHVORH33cjs.isGroup.call(void 0, nameTok) && !_chunkMHVORH33cjs.isGroup.call(void 0, typeTok) && nameTok.kind === "word" && typeTok.kind === "word" && typeTok.text === "type";
185
+ const isAlias = nameTok && typeTok && !_chunkHMMM32RGcjs.isGroup.call(void 0, nameTok) && !_chunkHMMM32RGcjs.isGroup.call(void 0, typeTok) && nameTok.kind === "word" && typeTok.kind === "word" && typeTok.text === "type";
182
186
  if (!isAlias) {
183
187
  continue;
184
188
  }
@@ -189,7 +193,7 @@ function walkLiterals(siblings, path, visit) {
189
193
  }
190
194
  continue;
191
195
  }
192
- const prevIsNamespace = prev && !_chunkMHVORH33cjs.isGroup.call(void 0, prev) && prev.kind === "word" && ((_a = prevMeaningful(siblings, siblings.indexOf(prev))) == null ? void 0 : _a.kind) === "word";
196
+ const prevIsNamespace = prev && !_chunkHMMM32RGcjs.isGroup.call(void 0, prev) && prev.kind === "word" && ((_a = prevMeaningful(siblings, siblings.indexOf(prev))) == null ? void 0 : _a.kind) === "word";
193
197
  const namespaceLike = prevIsNamespace && ["namespace", "module"].includes(prevMeaningful(siblings, siblings.indexOf(prev)).text);
194
198
  const segments = segmentsAt(siblings, i);
195
199
  const newPath = [...path, ...segments];
@@ -202,7 +206,7 @@ function walkLiterals(siblings, path, visit) {
202
206
  }
203
207
  }
204
208
  function extractAndHoistTypes(code) {
205
- const top = _chunkMHVORH33cjs.parse.call(void 0, _chunkMHVORH33cjs.tokenize.call(void 0, code));
209
+ const top = _chunkHMMM32RGcjs.parse.call(void 0, _chunkHMMM32RGcjs.tokenize.call(void 0, code));
206
210
  const counts = /* @__PURE__ */ new Map();
207
211
  const aliasByKey = /* @__PURE__ */ new Map();
208
212
  const usedNames = /* @__PURE__ */ new Set();
@@ -265,7 +269,7 @@ async function hoistTypings(code, formatOptions) {
265
269
  break;
266
270
  }
267
271
  }
268
- return _chunkMHVORH33cjs.formatTypings.call(void 0, code, formatOptions);
272
+ return _chunkHMMM32RGcjs.formatTypings.call(void 0, code, formatOptions);
269
273
  }
270
274
 
271
275
  // src/objects.ts
@@ -334,7 +338,7 @@ var ObjectInstance = class {
334
338
  */
335
339
  constructor(props) {
336
340
  var _a;
337
- if (!_chunkFPLSJF4Scjs.isValidIdentifier.call(void 0, props.name)) {
341
+ if (!_chunkGOWPACSKcjs.isValidIdentifier.call(void 0, props.name)) {
338
342
  throw new Error(
339
343
  `Invalid name for tool ${props.name}. A tool name must start with a letter and contain only letters, numbers, and underscores. It must be 1-50 characters long.`
340
344
  );
@@ -367,7 +371,7 @@ var ObjectInstance = class {
367
371
  if (props.properties.filter((p) => p.name === prop.name).length > 1) {
368
372
  throw new Error(`Duplicate property name "${prop.name}" in tool ${props.name}`);
369
373
  }
370
- if (!_chunkFPLSJF4Scjs.isValidIdentifier.call(void 0, prop.name)) {
374
+ if (!_chunkGOWPACSKcjs.isValidIdentifier.call(void 0, prop.name)) {
371
375
  throw new Error(
372
376
  `Invalid name for property ${prop.name}. A property name must start with a letter and contain only letters, numbers, and underscores. It must be 1-50 characters long.`
373
377
  );
@@ -391,7 +395,7 @@ var ObjectInstance = class {
391
395
  this.description = props.description;
392
396
  this.metadata = _nullishCoalesce(props.metadata, () => ( {}));
393
397
  this.properties = props.properties;
394
- this.tools = _chunkS46T73HRcjs.Tool.withUniqueNames(_nullishCoalesce(props.tools, () => ( [])));
398
+ this.tools = _chunkPZE6PIPGcjs.Tool.withUniqueNames(_nullishCoalesce(props.tools, () => ( [])));
395
399
  }
396
400
  /**
397
401
  * Generates TypeScript namespace declarations for this object.
@@ -468,11 +472,11 @@ function getObjectTypings(obj) {
468
472
  for (const prop of _nullishCoalesce(obj.properties, () => ( []))) {
469
473
  const description = _nullishCoalesce(prop.description, () => ( ""));
470
474
  if (description == null ? void 0 : description.trim().length) {
471
- typings.push(_chunkFPLSJF4Scjs.getMultilineComment.call(void 0, description));
475
+ typings.push(_chunkGOWPACSKcjs.getMultilineComment.call(void 0, description));
472
476
  }
473
477
  let type = "unknown";
474
478
  if (prop.type) {
475
- type = await _chunkMHVORH33cjs.getTypings.call(void 0, prop.type, {});
479
+ type = await _chunkHMMM32RGcjs.getTypings.call(void 0, prop.type, {});
476
480
  } else if (prop.value !== void 0) {
477
481
  type = typeof prop.value;
478
482
  }
@@ -492,7 +496,7 @@ function getObjectTypings(obj) {
492
496
  typings.push("");
493
497
  for (const tool of obj.tools) {
494
498
  const fnType = _zui.z.function(tool.zInput, tool.zOutput).title(tool.name).describe(_nullishCoalesce(tool.description, () => ( "")));
495
- let temp = await _chunkMHVORH33cjs.getTypings.call(void 0, fnType, {
499
+ let temp = await _chunkHMMM32RGcjs.getTypings.call(void 0, fnType, {
496
500
  declaration: true
497
501
  });
498
502
  temp = temp.replace("declare function ", "function ");
@@ -513,9 +517,9 @@ function getObjectTypings(obj) {
513
517
  typings.push("}" + closingBracket);
514
518
  let header = "";
515
519
  if ((_a = obj.description) == null ? void 0 : _a.trim().length) {
516
- header = _chunkFPLSJF4Scjs.getMultilineComment.call(void 0, obj.description);
520
+ header = _chunkGOWPACSKcjs.getMultilineComment.call(void 0, obj.description);
517
521
  }
518
- return _chunkMHVORH33cjs.formatTypings.call(void 0,
522
+ return _chunkHMMM32RGcjs.formatTypings.call(void 0,
519
523
  `${header}
520
524
  export namespace ${obj.name} {
521
525
  ${body}
@@ -546,7 +550,7 @@ function getObjectTypings(obj) {
546
550
  }
547
551
  function embedPropertyValue(property) {
548
552
  if (typeof property.value === "string") {
549
- return _chunkFPLSJF4Scjs.escapeString.call(void 0, property.value);
553
+ return _chunkGOWPACSKcjs.escapeString.call(void 0, property.value);
550
554
  }
551
555
  if (Number.isNaN(property.value)) {
552
556
  return "NaN";
@@ -564,7 +568,7 @@ function embedPropertyValue(property) {
564
568
  return `new Date('${property.value.toISOString()}')`;
565
569
  }
566
570
  if (property.value instanceof RegExp) {
567
- return `new RegExp(${_chunkFPLSJF4Scjs.escapeString.call(void 0, property.value.source)}, ${_chunkFPLSJF4Scjs.escapeString.call(void 0, property.value.flags)})`;
571
+ return `new RegExp(${_chunkGOWPACSKcjs.escapeString.call(void 0, property.value.source)}, ${_chunkGOWPACSKcjs.escapeString.call(void 0, property.value.flags)})`;
568
572
  }
569
573
  if (property.value === null) {
570
574
  return "null";
@@ -582,7 +586,7 @@ function embedPropertyValue(property) {
582
586
  return `${property.value}n`;
583
587
  }
584
588
  if (property.value instanceof Error) {
585
- return `Error(${_chunkFPLSJF4Scjs.escapeString.call(void 0, property.value.message)})`;
589
+ return `Error(${_chunkGOWPACSKcjs.escapeString.call(void 0, property.value.message)})`;
586
590
  }
587
591
  if (property.value instanceof Map) {
588
592
  return `new Map(${JSON.stringify(Array.from(property.value.entries()))})`;
@@ -1163,7 +1167,7 @@ var SendResponse = class extends BaseResponse {
1163
1167
  return this.item.props;
1164
1168
  }
1165
1169
  static formatToText(component, props, body) {
1166
- const header = `${_chunkC2KND2PScjs.MARKER}send=${component}${props && Object.keys(props).length ? ` ${JSON.stringify(props)}` : ""}`;
1170
+ const header = `${_chunkOVRDJMZJcjs.MARKER}send=${component}${props && Object.keys(props).length ? ` ${JSON.stringify(props)}` : ""}`;
1167
1171
  return body ? `${header}
1168
1172
  ${body}` : header;
1169
1173
  }
@@ -1174,7 +1178,7 @@ var RunResponse = class extends BaseResponse {
1174
1178
  this.code = code;
1175
1179
  }
1176
1180
  static formatToText(code) {
1177
- return `${_chunkC2KND2PScjs.MARKER}run
1181
+ return `${_chunkOVRDJMZJcjs.MARKER}run
1178
1182
  ${code}`;
1179
1183
  }
1180
1184
  };
@@ -1189,7 +1193,7 @@ var NextResponse = class extends BaseResponse {
1189
1193
  return this.item.props;
1190
1194
  }
1191
1195
  static formatToText(name, props) {
1192
- return `${_chunkC2KND2PScjs.MARKER}next=${name}${props && Object.keys(props).length ? ` ${JSON.stringify(props)}` : ""}`;
1196
+ return `${_chunkOVRDJMZJcjs.MARKER}next=${name}${props && Object.keys(props).length ? ` ${JSON.stringify(props)}` : ""}`;
1193
1197
  }
1194
1198
  };
1195
1199
  var EventPump = (_class3 = class {
@@ -1246,7 +1250,7 @@ function parseText(text, options) {
1246
1250
  );
1247
1251
  }
1248
1252
  async function* parseResponses(stream, options) {
1249
- const parser = new (0, _chunkC2KND2PScjs.StreamingMessageParser)(options);
1253
+ const parser = new (0, _chunkOVRDJMZJcjs.StreamingMessageParser)(options);
1250
1254
  const pump = new EventPump(stream, parser);
1251
1255
  let activeBody;
1252
1256
  while (true) {
@@ -1303,7 +1307,7 @@ var ComponentRegistry = (_class4 = class {
1303
1307
  }
1304
1308
  }
1305
1309
  register(definition) {
1306
- if (!_chunkC2KND2PScjs.NAME_REGEX.test(definition.name)) {
1310
+ if (!_chunkOVRDJMZJcjs.NAME_REGEX.test(definition.name)) {
1307
1311
  throw new Error(
1308
1312
  `Invalid component name "${definition.name}". Component names must be lowercase ([a-z][a-z0-9_-]*).`
1309
1313
  );
@@ -1330,7 +1334,7 @@ var EMPTY_PROPS_SCHEMA = { type: "object", properties: {}, additionalProperties:
1330
1334
  var normalizeComponentName = (name) => name.trim().toLowerCase();
1331
1335
  function normalizeComponentDefinition(definition) {
1332
1336
  const name = normalizeComponentName(_nullishCoalesce(definition.name, () => ( "")));
1333
- if (!_chunkC2KND2PScjs.NAME_REGEX.test(name)) {
1337
+ if (!_chunkOVRDJMZJcjs.NAME_REGEX.test(name)) {
1334
1338
  throw new Error(
1335
1339
  `Invalid component name "${definition.name}". Component names must be lowercase ([a-z][a-z0-9_-]*).`
1336
1340
  );
@@ -1351,14 +1355,14 @@ function normalizePropsSchema(props, name) {
1351
1355
  if (props === void 0) {
1352
1356
  return EMPTY_PROPS_SCHEMA;
1353
1357
  }
1354
- if (_chunkFPLSJF4Scjs.isZuiSchema.call(void 0, props)) {
1358
+ if (_chunkGOWPACSKcjs.isZuiSchema.call(void 0, props)) {
1355
1359
  try {
1356
1360
  return _zui.transforms.toJSONSchema(props);
1357
1361
  } catch (e2) {
1358
1362
  return _zui.transforms.toJSONSchemaLegacy(props);
1359
1363
  }
1360
1364
  }
1361
- if (_chunkFPLSJF4Scjs.isJsonSchema.call(void 0, props)) {
1365
+ if (_chunkGOWPACSKcjs.isJsonSchema.call(void 0, props)) {
1362
1366
  return props;
1363
1367
  }
1364
1368
  throw new Error(
@@ -1512,31 +1516,31 @@ var _checkValue = (value, schema, path, errors) => {
1512
1516
  };
1513
1517
 
1514
1518
  // src/message-stream/sanitize.ts
1515
- var sanitizeMessageText = (value, options = {}) => value.replaceAll(_chunkC2KND2PScjs.MARKER, _nullishCoalesce(options.markerReplacement, () => ( "\u25AA")));
1519
+ var sanitizeMessageText = (value, options = {}) => value.replaceAll(_chunkOVRDJMZJcjs.MARKER, _nullishCoalesce(options.markerReplacement, () => ( "\u25AA")));
1516
1520
 
1517
1521
  // src/index.ts
1518
1522
  var utils = {
1519
- toValidObjectName: _chunkFPLSJF4Scjs.toValidObjectName,
1520
- toValidFunctionName: _chunkFPLSJF4Scjs.toValidFunctionName,
1521
- wrapContent: _chunkYQT5G77Wcjs.wrapContent,
1522
- truncateWrappedContent: _chunkYQT5G77Wcjs.truncateWrappedContent,
1523
- stripTruncationTags: _chunkYQT5G77Wcjs.stripTruncationTags
1523
+ toValidObjectName: _chunkGOWPACSKcjs.toValidObjectName,
1524
+ toValidFunctionName: _chunkGOWPACSKcjs.toValidFunctionName,
1525
+ wrapContent: _chunkHEAQAEFZcjs.wrapContent,
1526
+ truncateWrappedContent: _chunkHEAQAEFZcjs.truncateWrappedContent,
1527
+ stripTruncationTags: _chunkHEAQAEFZcjs.stripTruncationTags
1524
1528
  };
1525
1529
  var execute = async (props) => {
1526
- const { executeContext } = await Promise.resolve().then(() => _interopRequireWildcard(require("./execute-4IL4QPAR.cjs")));
1530
+ const { executeContext } = await Promise.resolve().then(() => _interopRequireWildcard(require("./execute-MRZZ4AYY.cjs")));
1527
1531
  return executeContext(props);
1528
1532
  };
1529
1533
  var init = async () => {
1530
- await Promise.resolve().then(() => _interopRequireWildcard(require("./execute-4IL4QPAR.cjs")));
1534
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./execute-MRZZ4AYY.cjs")));
1531
1535
  await Promise.resolve().then(() => _interopRequireWildcard(require("./component-2NYFY6CW.cjs")));
1532
- await Promise.resolve().then(() => _interopRequireWildcard(require("./tool-56I7OSKU.cjs")));
1533
- await Promise.resolve().then(() => _interopRequireWildcard(require("./exit-LUJY7JIG.cjs")));
1536
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./tool-VE2YHIY2.cjs")));
1537
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./exit-MX56VN2C.cjs")));
1534
1538
  await Promise.resolve().then(() => _interopRequireWildcard(require("./jsx-ULPWX5TW.cjs")));
1535
- await Promise.resolve().then(() => _interopRequireWildcard(require("./vm-ZVONLAZV.cjs")));
1536
- await Promise.resolve().then(() => _interopRequireWildcard(require("./utils-GLZVMRWO.cjs")));
1537
- await Promise.resolve().then(() => _interopRequireWildcard(require("./truncator-7PGEGCHV.cjs")));
1538
- await Promise.resolve().then(() => _interopRequireWildcard(require("./typings-LVI4VGE2.cjs")));
1539
- await Promise.resolve().then(() => _interopRequireWildcard(require("./dual-modes-IZQJTXR7.cjs")));
1539
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./vm-6D3IIIU7.cjs")));
1540
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./utils-ITB4NEL7.cjs")));
1541
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./truncator-FZNLYSDL.cjs")));
1542
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./typings-LQOBZXSO.cjs")));
1543
+ await Promise.resolve().then(() => _interopRequireWildcard(require("./dual-modes-HO6RRIZ5.cjs")));
1540
1544
  };
1541
1545
 
1542
1546
 
@@ -1587,4 +1591,6 @@ var init = async () => {
1587
1591
 
1588
1592
 
1589
1593
 
1590
- exports.BaseResponse = BaseResponse; exports.Chat = Chat; exports.CitationsManager = CitationsManager; exports.Component = _chunkI56MPOVGcjs.Component; exports.ComponentRegistry = ComponentRegistry; exports.DefaultComponents = DefaultComponents; exports.DefaultExit = _chunk5XPEVOOWcjs.DefaultExit; exports.ErrorExecutionResult = _chunk5XPEVOOWcjs.ErrorExecutionResult; exports.ExecutionResult = _chunk5XPEVOOWcjs.ExecutionResult; exports.Exit = _chunkD6PU5YAScjs.Exit; exports.ListenExit = _chunk5XPEVOOWcjs.ListenExit; exports.LoopExceededError = _chunkPK72FAKDcjs.LoopExceededError; exports.MARKER = _chunkC2KND2PScjs.MARKER; exports.NAME_REGEX = _chunkC2KND2PScjs.NAME_REGEX; exports.NextResponse = NextResponse; exports.ObjectInstance = ObjectInstance; exports.PartialExecutionResult = _chunk5XPEVOOWcjs.PartialExecutionResult; exports.ReplayableAsyncIterable = ReplayableAsyncIterable; exports.RunResponse = RunResponse; exports.SendResponse = SendResponse; exports.Snapshot = _chunk5XPEVOOWcjs.Snapshot; exports.SnapshotSignal = _chunkPK72FAKDcjs.SnapshotSignal; exports.StreamingMessageParser = _chunkC2KND2PScjs.StreamingMessageParser; exports.SuccessExecutionResult = _chunk5XPEVOOWcjs.SuccessExecutionResult; exports.ThinkExit = _chunk5XPEVOOWcjs.ThinkExit; exports.ThinkSignal = _chunkPK72FAKDcjs.ThinkSignal; exports.Tool = _chunkS46T73HRcjs.Tool; exports._CustomModelClient = _chunk5XPEVOOWcjs._CustomModelClient; exports.assertValidComponent = _chunkI56MPOVGcjs.assertValidComponent; exports.collectText = collectText; exports.execute = execute; exports.generateInstructions = _chunkC2KND2PScjs.generateInstructions; exports.getValue = _chunk5XPEVOOWcjs.getValue; exports.init = init; exports.isAnyComponent = _chunkI56MPOVGcjs.isAnyComponent; exports.isComponent = _chunkI56MPOVGcjs.isComponent; exports.normalizeComponentDefinition = normalizeComponentDefinition; exports.normalizeComponentName = normalizeComponentName; exports.normalizePropsSchema = normalizePropsSchema; exports.parseExit = _chunk5XPEVOOWcjs.parseExit; exports.parseStream = parseStream; exports.parseText = parseText; exports.sanitizeMessageText = sanitizeMessageText; exports.tryParseJson = _chunkC2KND2PScjs.tryParseJson; exports.utils = utils; exports.validateComponent = validateComponent; exports.validateProps = validateProps; exports.version = version;
1594
+
1595
+
1596
+ exports.BaseResponse = BaseResponse; exports.Chat = Chat; exports.CitationsManager = CitationsManager; exports.Component = _chunkI56MPOVGcjs.Component; exports.ComponentRegistry = ComponentRegistry; exports.DefaultComponents = DefaultComponents; exports.DefaultExit = _chunkKG5E3UZZcjs.DefaultExit; exports.ErrorExecutionResult = _chunkKG5E3UZZcjs.ErrorExecutionResult; exports.ExecutionResult = _chunkKG5E3UZZcjs.ExecutionResult; exports.Exit = _chunkDDSJTR6Qcjs.Exit; exports.ListenExit = _chunkKG5E3UZZcjs.ListenExit; exports.LoopExceededError = _chunkPK72FAKDcjs.LoopExceededError; exports.MARKER = _chunkOVRDJMZJcjs.MARKER; exports.NAME_REGEX = _chunkOVRDJMZJcjs.NAME_REGEX; exports.NextResponse = NextResponse; exports.ObjectInstance = ObjectInstance; exports.PartialExecutionResult = _chunkKG5E3UZZcjs.PartialExecutionResult; exports.ReplayableAsyncIterable = ReplayableAsyncIterable; exports.RunResponse = RunResponse; exports.SendResponse = SendResponse; exports.Snapshot = _chunkKG5E3UZZcjs.Snapshot; exports.SnapshotSignal = _chunkPK72FAKDcjs.SnapshotSignal; exports.StreamingMessageParser = _chunkOVRDJMZJcjs.StreamingMessageParser; exports.SuccessExecutionResult = _chunkKG5E3UZZcjs.SuccessExecutionResult; exports.ThinkExit = _chunkKG5E3UZZcjs.ThinkExit; exports.ThinkSignal = _chunkPK72FAKDcjs.ThinkSignal; exports.Tool = _chunkPZE6PIPGcjs.Tool; exports._CustomModelClient = _chunkKG5E3UZZcjs._CustomModelClient; exports.assertValidComponent = _chunkI56MPOVGcjs.assertValidComponent; exports.collectText = collectText; exports.configureQuickJS = _chunkRGUG3UMFcjs.configureQuickJS; exports.configureTokenizer = _chunkGOWPACSKcjs.configureTokenizer; exports.execute = execute; exports.generateInstructions = _chunkOVRDJMZJcjs.generateInstructions; exports.getValue = _chunkKG5E3UZZcjs.getValue; exports.init = init; exports.isAnyComponent = _chunkI56MPOVGcjs.isAnyComponent; exports.isComponent = _chunkI56MPOVGcjs.isComponent; exports.normalizeComponentDefinition = normalizeComponentDefinition; exports.normalizeComponentName = normalizeComponentName; exports.normalizePropsSchema = normalizePropsSchema; exports.parseExit = _chunkKG5E3UZZcjs.parseExit; exports.parseStream = parseStream; exports.parseText = parseText; exports.sanitizeMessageText = sanitizeMessageText; exports.tryParseJson = _chunkOVRDJMZJcjs.tryParseJson; exports.utils = utils; exports.validateComponent = validateComponent; exports.validateProps = validateProps; exports.version = version;
package/dist/index.d.ts CHANGED
@@ -22,6 +22,8 @@ export type { ExecutionProps, ExecutionHooks } from './runtime/types.js';
22
22
  export { type ValueOrGetter, getValue } from './getter.js';
23
23
  export * from './message-stream/index.js';
24
24
  export * from './custom-client.js';
25
+ export { configureQuickJS } from './quickjs-variant.js';
26
+ export { configureTokenizer } from './utils.js';
25
27
  export declare const utils: {
26
28
  toValidObjectName: (str: string) => string;
27
29
  toValidFunctionName: (str: string) => string;
package/dist/index.js CHANGED
@@ -10,17 +10,20 @@ import {
10
10
  _CustomModelClient,
11
11
  getValue,
12
12
  parseExit
13
- } from "./chunk-2MSLOTFO.js";
13
+ } from "./chunk-XMFQVARN.js";
14
14
  import {
15
15
  MARKER,
16
16
  NAME_REGEX,
17
17
  StreamingMessageParser,
18
18
  generateInstructions,
19
19
  tryParseJson
20
- } from "./chunk-5ISVDYBA.js";
20
+ } from "./chunk-OXEKAOVI.js";
21
+ import {
22
+ configureQuickJS
23
+ } from "./chunk-UGHFNCPD.js";
21
24
  import {
22
25
  Tool
23
- } from "./chunk-3OSQ4XL4.js";
26
+ } from "./chunk-TDALRNGL.js";
24
27
  import {
25
28
  formatTypings,
26
29
  getTypings,
@@ -28,7 +31,7 @@ import {
28
31
  isPunct,
29
32
  parse,
30
33
  tokenize
31
- } from "./chunk-GDWRFHM5.js";
34
+ } from "./chunk-GDJTKI7J.js";
32
35
  import {
33
36
  CodeFormattingError,
34
37
  LoopExceededError,
@@ -38,7 +41,7 @@ import {
38
41
  import "./chunk-YEAWWJSJ.js";
39
42
  import {
40
43
  Exit
41
- } from "./chunk-XVVYNOTX.js";
44
+ } from "./chunk-HB2G32AK.js";
42
45
  import {
43
46
  Component,
44
47
  assertValidComponent,
@@ -50,8 +53,9 @@ import {
50
53
  stripTruncationTags,
51
54
  truncateWrappedContent,
52
55
  wrapContent
53
- } from "./chunk-HM5H556L.js";
56
+ } from "./chunk-72ZWBNZV.js";
54
57
  import {
58
+ configureTokenizer,
55
59
  escapeString,
56
60
  getMultilineComment,
57
61
  isJsonSchema,
@@ -59,13 +63,13 @@ import {
59
63
  isZuiSchema,
60
64
  toValidFunctionName,
61
65
  toValidObjectName
62
- } from "./chunk-YX27XM67.js";
66
+ } from "./chunk-GLXADNTR.js";
63
67
  import {
64
68
  upperFirst_default
65
69
  } from "./chunk-34GJUS6U.js";
66
70
 
67
71
  // package.json
68
- var version = "0.2.2";
72
+ var version = "0.2.3";
69
73
 
70
74
  // src/objects.ts
71
75
  import { z } from "@bpinternal/zui";
@@ -1523,20 +1527,20 @@ var utils = {
1523
1527
  stripTruncationTags
1524
1528
  };
1525
1529
  var execute = async (props) => {
1526
- const { executeContext } = await import("./execute-6AYBMTRM.js");
1530
+ const { executeContext } = await import("./execute-DSGJ2UNL.js");
1527
1531
  return executeContext(props);
1528
1532
  };
1529
1533
  var init = async () => {
1530
- await import("./execute-6AYBMTRM.js");
1534
+ await import("./execute-DSGJ2UNL.js");
1531
1535
  await import("./component-ASNZHQUR.js");
1532
- await import("./tool-I3MAWDN2.js");
1533
- await import("./exit-VJATJTQI.js");
1536
+ await import("./tool-KD7FL45V.js");
1537
+ await import("./exit-UQ3EUX5D.js");
1534
1538
  await import("./jsx-DDZ63UUF.js");
1535
- await import("./vm-ZLWGAYYJ.js");
1536
- await import("./utils-ZEZ66X6Q.js");
1537
- await import("./truncator-OZOBNYON.js");
1538
- await import("./typings-SR3EE6LR.js");
1539
- await import("./dual-modes-J4RWHJ2O.js");
1539
+ await import("./vm-QO5FSGPN.js");
1540
+ await import("./utils-IATCUNKF.js");
1541
+ await import("./truncator-73RCL52Y.js");
1542
+ await import("./typings-E2RROCLT.js");
1543
+ await import("./dual-modes-BYABHBDI.js");
1540
1544
  };
1541
1545
  export {
1542
1546
  BaseResponse,
@@ -1569,6 +1573,8 @@ export {
1569
1573
  _CustomModelClient,
1570
1574
  assertValidComponent,
1571
1575
  collectText,
1576
+ configureQuickJS,
1577
+ configureTokenizer,
1572
1578
  execute,
1573
1579
  generateInstructions,
1574
1580
  getValue,