llmz 0.0.84 → 0.0.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{chunk-NK2NCYSY.js → chunk-2XSXXGXJ.js} +4 -4
  2. package/dist/{chunk-2O3UTPVH.js → chunk-EADBCAE7.js} +2 -2
  3. package/dist/{chunk-D6PU5YAS.cjs → chunk-EC2I4U4G.cjs} +6 -6
  4. package/dist/{chunk-L74UZONX.js → chunk-GEN6TAXY.js} +8 -16
  5. package/dist/{chunk-ZPHRTTQX.cjs → chunk-GFSUTNRM.cjs} +9 -17
  6. package/dist/{chunk-WODK7Y4J.cjs → chunk-H3PZFBJL.cjs} +10 -10
  7. package/dist/{chunk-7LMIOS6H.cjs → chunk-KY27DGTG.cjs} +14 -14
  8. package/dist/{chunk-PQGZQQA6.cjs → chunk-N3XPJTPE.cjs} +18 -18
  9. package/dist/{chunk-FPLSJF4S.cjs → chunk-NFZXJRXS.cjs} +2 -5
  10. package/dist/{chunk-TOGYDN6U.js → chunk-PASYUKW4.js} +1 -1
  11. package/dist/{chunk-XVVYNOTX.js → chunk-TRWUQSEK.js} +1 -1
  12. package/dist/{chunk-IRCB4FRM.js → chunk-YTFNFSDT.js} +2 -2
  13. package/dist/{chunk-YX27XM67.js → chunk-ZHHB3FT4.js} +1 -4
  14. package/dist/{chunk-BBX2LDZE.cjs → chunk-ZVSO527D.cjs} +25 -25
  15. package/dist/{dual-modes-HEXPFVUE.js → dual-modes-5NJMZJTA.js} +3 -3
  16. package/dist/{dual-modes-LLIWZCHC.cjs → dual-modes-WA5TPGJR.cjs} +4 -4
  17. package/dist/{execute-EZXXBWB6.js → execute-2T75URIX.js} +7 -7
  18. package/dist/{execute-2BVFYTJT.cjs → execute-I53OOORH.cjs} +30 -30
  19. package/dist/{exit-VJATJTQI.js → exit-7NHSUR3V.js} +2 -2
  20. package/dist/exit-V3ORIN65.cjs +8 -0
  21. package/dist/index.cjs +33 -33
  22. package/dist/index.js +16 -16
  23. package/dist/{tool-GJ6ZXWS2.cjs → tool-4OPM7QRM.cjs} +4 -4
  24. package/dist/{tool-DNHVW3KC.js → tool-HXXQMDA3.js} +3 -3
  25. package/dist/truncator-ZN7X6OMF.cjs +10 -0
  26. package/dist/{truncator-3U2QUUJJ.js → truncator-ZQYBTVCJ.js} +2 -2
  27. package/dist/{typings-ZTFPPA5W.cjs → typings-QW4427V7.cjs} +3 -3
  28. package/dist/{typings-3YV3RDMP.js → typings-YD2WAQ4A.js} +2 -2
  29. package/dist/utils-NQSM5FBL.cjs +39 -0
  30. package/dist/{utils-ZEZ66X6Q.js → utils-RKUVYFTJ.js} +1 -1
  31. package/dist/utils.d.ts +1 -1
  32. package/package.json +2 -2
  33. package/dist/exit-LUJY7JIG.cjs +0 -8
  34. package/dist/truncator-3ZN7W6NB.cjs +0 -10
  35. package/dist/utils-GLZVMRWO.cjs +0 -39
@@ -6,11 +6,11 @@ var _chunkKIN7Y247cjs = require('./chunk-KIN7Y247.cjs');
6
6
  var _chunkCQ3UJW76cjs = require('./chunk-CQ3UJW76.cjs');
7
7
 
8
8
 
9
- var _chunkZPHRTTQXcjs = require('./chunk-ZPHRTTQX.cjs');
9
+ var _chunkGFSUTNRMcjs = require('./chunk-GFSUTNRM.cjs');
10
10
 
11
11
 
12
12
 
13
- var _chunkFPLSJF4Scjs = require('./chunk-FPLSJF4S.cjs');
13
+ var _chunkNFZXJRXScjs = require('./chunk-NFZXJRXS.cjs');
14
14
 
15
15
 
16
16
 
@@ -57,7 +57,7 @@ function printLimitedJson(obj, maxDepth, maxLength, maxKeys) {
57
57
  }
58
58
  if (typeof currentObj !== "object" || currentObj === null) {
59
59
  const value = JSON.stringify(currentObj);
60
- currentLength += _chunkFPLSJF4Scjs.getTokenizer.call(void 0, ).count(value);
60
+ currentLength += _chunkNFZXJRXScjs.getTokenizer.call(void 0, ).count(value);
61
61
  return value;
62
62
  }
63
63
  const indentation = " ".repeat(currentIndent);
@@ -70,7 +70,7 @@ function printLimitedJson(obj, maxDepth, maxLength, maxKeys) {
70
70
  result += indentation + " ".repeat(indent) + recurse(currentObj[i], depth + 1, currentIndent + indent);
71
71
  }
72
72
  result += "\n" + indentation + "]";
73
- currentLength += _chunkFPLSJF4Scjs.getTokenizer.call(void 0, ).count(result);
73
+ currentLength += _chunkNFZXJRXScjs.getTokenizer.call(void 0, ).count(result);
74
74
  return result;
75
75
  } else {
76
76
  let result = "{\n";
@@ -89,11 +89,11 @@ function printLimitedJson(obj, maxDepth, maxLength, maxKeys) {
89
89
  result += ",\n" + indentation + `... (${numKeys - maxKeys} more keys)`;
90
90
  }
91
91
  result += "\n" + indentation + "}";
92
- currentLength += _chunkFPLSJF4Scjs.getTokenizer.call(void 0, ).count(result);
92
+ currentLength += _chunkNFZXJRXScjs.getTokenizer.call(void 0, ).count(result);
93
93
  return result;
94
94
  }
95
95
  }
96
- const output = _chunkFPLSJF4Scjs.getTokenizer.call(void 0, ).truncate(recurse(obj, 0, 0), maxLength);
96
+ const output = _chunkNFZXJRXScjs.getTokenizer.call(void 0, ).truncate(recurse(obj, 0, 0), maxLength);
97
97
  return { output, truncated: wasTruncated };
98
98
  }
99
99
  function extractType(value, generic = true) {
@@ -158,9 +158,9 @@ function previewValue(value, length = LONG_TEXT_LENGTH) {
158
158
  }
159
159
  const previewStr = (str) => {
160
160
  if (str.length > length) {
161
- return _chunkFPLSJF4Scjs.escapeString.call(void 0, str.slice(0, length)) + " ... <truncated>";
161
+ return _chunkNFZXJRXScjs.escapeString.call(void 0, str.slice(0, length)) + " ... <truncated>";
162
162
  }
163
- return _chunkFPLSJF4Scjs.escapeString.call(void 0, str);
163
+ return _chunkNFZXJRXScjs.escapeString.call(void 0, str);
164
164
  };
165
165
  const previewObj = (obj) => {
166
166
  const mapped = _chunkHC2QZTVTcjs.mapKeys_default.call(void 0, obj, (_value, key) => previewStr(key));
@@ -353,7 +353,7 @@ var inspect = (value, name, options = DEFAULT_OPTIONS) => {
353
353
  } else if (genericType === "boolean") {
354
354
  return header + previewValue(value);
355
355
  } else if (typeof value === "string") {
356
- if (_chunkFPLSJF4Scjs.getTokenizer.call(void 0, ).count(value) < options.tokens) {
356
+ if (_chunkNFZXJRXScjs.getTokenizer.call(void 0, ).count(value) < options.tokens) {
357
357
  return header + previewValue(value);
358
358
  } else {
359
359
  return header + previewLongText(value);
@@ -508,15 +508,15 @@ ${variables_example}
508
508
  role: "system",
509
509
  content: replacePlaceholders(canTalk ? system_md_default : system_md_default2, {
510
510
  is_message_enabled: canTalk,
511
- "tools.d.ts": _chunkZPHRTTQXcjs.wrapContent.call(void 0, dts, {
511
+ "tools.d.ts": _chunkGFSUTNRMcjs.wrapContent.call(void 0, dts, {
512
512
  preserve: "both",
513
513
  minTokens: 500
514
514
  }),
515
- identity: _chunkZPHRTTQXcjs.wrapContent.call(void 0, ((_a = props.instructions) == null ? void 0 : _a.length) ? props.instructions : "No specific instructions provided", {
515
+ identity: _chunkGFSUTNRMcjs.wrapContent.call(void 0, ((_a = props.instructions) == null ? void 0 : _a.length) ? props.instructions : "No specific instructions provided", {
516
516
  preserve: "both",
517
517
  minTokens: 1e3
518
518
  }),
519
- transcript: _chunkZPHRTTQXcjs.wrapContent.call(void 0, props.transcript.toString(), {
519
+ transcript: _chunkGFSUTNRMcjs.wrapContent.call(void 0, props.transcript.toString(), {
520
520
  preserve: "bottom",
521
521
  minTokens: 500
522
522
  }),
@@ -525,7 +525,7 @@ ${variables_example}
525
525
  writeable_vars: writeable_vars.join(", "),
526
526
  variables_example,
527
527
  exits,
528
- components: _chunkZPHRTTQXcjs.wrapContent.call(void 0,
528
+ components: _chunkGFSUTNRMcjs.wrapContent.call(void 0,
529
529
  props.components.map((component) => _chunkCQ3UJW76cjs.getComponentReference.call(void 0, component.definition)).join("\n\n"),
530
530
  {
531
531
  preserve: "top",
@@ -603,13 +603,13 @@ Code:
603
603
 
604
604
  \`\`\`tsx
605
605
  \u25A0fn_start
606
- ${_chunkZPHRTTQXcjs.wrapContent.call(void 0, props.code)}
606
+ ${_chunkGFSUTNRMcjs.wrapContent.call(void 0, props.code)}
607
607
  \u25A0fn_end
608
608
  \`\`\`
609
609
 
610
610
  Error:
611
611
  \`\`\`
612
- ${_chunkZPHRTTQXcjs.wrapContent.call(void 0, props.message, { flex: 4 })}
612
+ ${_chunkGFSUTNRMcjs.wrapContent.call(void 0, props.message, { flex: 4 })}
613
613
  \`\`\`
614
614
 
615
615
  Please fix the error and try again.
@@ -632,11 +632,11 @@ var getCodeExecutionErrorMessage = async (props) => {
632
632
 
633
633
  An error occurred while executing the code.
634
634
 
635
- ${_chunkZPHRTTQXcjs.wrapContent.call(void 0, props.message, { preserve: "top", flex: 4 })}
635
+ ${_chunkGFSUTNRMcjs.wrapContent.call(void 0, props.message, { preserve: "top", flex: 4 })}
636
636
 
637
637
  Stack Trace:
638
638
  \`\`\`
639
- ${_chunkZPHRTTQXcjs.wrapContent.call(void 0, _chunkKIN7Y247cjs.cleanStackTrace.call(void 0, props.stacktrace), { flex: 6, preserve: "top" })}
639
+ ${_chunkGFSUTNRMcjs.wrapContent.call(void 0, _chunkKIN7Y247cjs.cleanStackTrace.call(void 0, props.stacktrace), { flex: 6, preserve: "top" })}
640
640
  \`\`\`
641
641
 
642
642
  Let the user know that an error occurred, and if possible, try something else. Do not repeat yourself in the message.
@@ -659,7 +659,7 @@ var getThinkingMessage = async (props) => {
659
659
  if (inspected) {
660
660
  acc.push(inspected);
661
661
  } else {
662
- acc.push(`Value of ${key} is ${_chunkZPHRTTQXcjs.wrapContent.call(void 0, JSON.stringify(value, null, 2))}`);
662
+ acc.push(`Value of ${key} is ${_chunkGFSUTNRMcjs.wrapContent.call(void 0, JSON.stringify(value, null, 2))}`);
663
663
  }
664
664
  return acc;
665
665
  }, []);
@@ -670,7 +670,7 @@ var getThinkingMessage = async (props) => {
670
670
  if (inspected) {
671
671
  return inspected;
672
672
  } else {
673
- return `Value at index ${index} is ${_chunkZPHRTTQXcjs.wrapContent.call(void 0, JSON.stringify(value, null, 2))}`;
673
+ return `Value at index ${index} is ${_chunkGFSUTNRMcjs.wrapContent.call(void 0, JSON.stringify(value, null, 2))}`;
674
674
  }
675
675
  });
676
676
  context = mapped.join("\n\n");
@@ -688,7 +688,7 @@ The assistant requested to think. Here's the context:
688
688
  -------------------
689
689
  Reason: ${props.reason || "Thinking requested"}
690
690
  Context:
691
- ${_chunkZPHRTTQXcjs.wrapContent.call(void 0, context, { preserve: "top" })}
691
+ ${_chunkGFSUTNRMcjs.wrapContent.call(void 0, context, { preserve: "top" })}
692
692
  -------------------
693
693
 
694
694
  Please continue with the conversation (\u25A0fn_start).
@@ -707,19 +707,19 @@ var getSnapshotResolvedMessage = (props) => {
707
707
  injectedVariables[variable.name] = variable.value;
708
708
  variablesMessage += `
709
709
  // Variable "${variable.name}" restored with its full value:
710
- // ${_chunkZPHRTTQXcjs.wrapContent.call(void 0, _nullishCoalesce(((_a = inspect(variable.value)) == null ? void 0 : _a.split("\n").join("\n// ")), () => ( "")))}
710
+ // ${_chunkGFSUTNRMcjs.wrapContent.call(void 0, _nullishCoalesce(((_a = inspect(variable.value)) == null ? void 0 : _a.split("\n").join("\n// ")), () => ( "")))}
711
711
  declare const ${variable.name}: ${variable.type}
712
712
  `;
713
713
  } else {
714
714
  variablesMessage += `
715
715
  // The variable "${variable.name}" was too large to be restored with its full value, here's a preview of its last known value:
716
- // ${_chunkZPHRTTQXcjs.wrapContent.call(void 0, variable.preview.split("\n").join("\n// "))}
716
+ // ${_chunkGFSUTNRMcjs.wrapContent.call(void 0, variable.preview.split("\n").join("\n// "))}
717
717
  // Important: To restore the full value, please re-run the code that generated this variable in the first place.
718
718
  let ${variable.name}: undefined | ${variable.type} = undefined;
719
719
  `;
720
720
  }
721
721
  }
722
- const output = _chunkZPHRTTQXcjs.wrapContent.call(void 0, _nullishCoalesce(((_b = inspect(props.snapshot.status.value)) == null ? void 0 : _b.split("\n").join("\n * ")), () => ( "")), {
722
+ const output = _chunkGFSUTNRMcjs.wrapContent.call(void 0, _nullishCoalesce(((_b = inspect(props.snapshot.status.value)) == null ? void 0 : _b.split("\n").join("\n * ")), () => ( "")), {
723
723
  preserve: "top",
724
724
  flex: 4
725
725
  });
@@ -741,7 +741,7 @@ ${_chunkKIN7Y247cjs.cleanStackTrace.call(void 0, props.snapshot.stack).split("\n
741
741
  Continue the conversation from here, without repeating the above code, as it has already been executed. Here's the variables you can rely on:
742
742
 
743
743
  \`\`\`tsx
744
- ${_chunkZPHRTTQXcjs.wrapContent.call(void 0, variablesMessage)}
744
+ ${_chunkGFSUTNRMcjs.wrapContent.call(void 0, variablesMessage)}
745
745
  \`\`\`
746
746
 
747
747
  You can now assume that the code you about to generate can rely on the variables "${Object.keys(injectedVariables).join('", "')}" being available.
@@ -764,7 +764,7 @@ var getSnapshotRejectedMessage = (props) => {
764
764
  throw new Error("Snapshot is not resolved");
765
765
  }
766
766
  const errorMessage = _nullishCoalesce(inspect(props.snapshot.status.error), () => ( "Unknown Error"));
767
- const output = _chunkZPHRTTQXcjs.wrapContent.call(void 0, _nullishCoalesce(errorMessage.split("\n").join("\n * "), () => ( "Unknown Error")), {
767
+ const output = _chunkGFSUTNRMcjs.wrapContent.call(void 0, _nullishCoalesce(errorMessage.split("\n").join("\n * "), () => ( "Unknown Error")), {
768
768
  preserve: "both",
769
769
  minTokens: 100
770
770
  });
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  DualModePrompt
3
- } from "./chunk-2O3UTPVH.js";
3
+ } from "./chunk-EADBCAE7.js";
4
4
  import "./chunk-YEAWWJSJ.js";
5
5
  import "./chunk-3T5IU7OU.js";
6
6
  import "./chunk-XTEHT2TK.js";
7
- import "./chunk-L74UZONX.js";
8
- import "./chunk-YX27XM67.js";
7
+ import "./chunk-GEN6TAXY.js";
8
+ import "./chunk-ZHHB3FT4.js";
9
9
  import "./chunk-34GJUS6U.js";
10
10
  export {
11
11
  DualModePrompt
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkBBX2LDZEcjs = require('./chunk-BBX2LDZE.cjs');
3
+ var _chunkZVSO527Dcjs = require('./chunk-ZVSO527D.cjs');
4
4
  require('./chunk-KIN7Y247.cjs');
5
5
  require('./chunk-CQ3UJW76.cjs');
6
6
  require('./chunk-5ZF6NTYI.cjs');
7
- require('./chunk-ZPHRTTQX.cjs');
8
- require('./chunk-FPLSJF4S.cjs');
7
+ require('./chunk-GFSUTNRM.cjs');
8
+ require('./chunk-NFZXJRXS.cjs');
9
9
  require('./chunk-HC2QZTVT.cjs');
10
10
 
11
11
 
12
- exports.DualModePrompt = _chunkBBX2LDZEcjs.DualModePrompt;
12
+ exports.DualModePrompt = _chunkZVSO527Dcjs.DualModePrompt;
@@ -8,10 +8,10 @@ import {
8
8
  Snapshot,
9
9
  SuccessExecutionResult,
10
10
  parseExit
11
- } from "./chunk-NK2NCYSY.js";
12
- import "./chunk-2O3UTPVH.js";
13
- import "./chunk-IRCB4FRM.js";
14
- import "./chunk-TOGYDN6U.js";
11
+ } from "./chunk-2XSXXGXJ.js";
12
+ import "./chunk-EADBCAE7.js";
13
+ import "./chunk-YTFNFSDT.js";
14
+ import "./chunk-PASYUKW4.js";
15
15
  import {
16
16
  AssignmentError,
17
17
  CodeExecutionError,
@@ -25,17 +25,17 @@ import {
25
25
  import {
26
26
  cleanStackTrace
27
27
  } from "./chunk-YEAWWJSJ.js";
28
- import "./chunk-XVVYNOTX.js";
28
+ import "./chunk-TRWUQSEK.js";
29
29
  import "./chunk-3T5IU7OU.js";
30
30
  import "./chunk-XTEHT2TK.js";
31
31
  import {
32
32
  truncateWrappedContent
33
- } from "./chunk-L74UZONX.js";
33
+ } from "./chunk-GEN6TAXY.js";
34
34
  import {
35
35
  getErrorMessage,
36
36
  init,
37
37
  stripInvalidIdentifiers
38
- } from "./chunk-YX27XM67.js";
38
+ } from "./chunk-ZHHB3FT4.js";
39
39
  import {
40
40
  clamp_default,
41
41
  isEqual_default,
@@ -8,10 +8,10 @@ var _chunkJXD2KJVBcjs = require('./chunk-JXD2KJVB.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunkPQGZQQA6cjs = require('./chunk-PQGZQQA6.cjs');
12
- require('./chunk-BBX2LDZE.cjs');
13
- require('./chunk-WODK7Y4J.cjs');
14
- require('./chunk-7LMIOS6H.cjs');
11
+ var _chunkN3XPJTPEcjs = require('./chunk-N3XPJTPE.cjs');
12
+ require('./chunk-ZVSO527D.cjs');
13
+ require('./chunk-H3PZFBJL.cjs');
14
+ require('./chunk-KY27DGTG.cjs');
15
15
 
16
16
 
17
17
 
@@ -25,17 +25,17 @@ var _chunkPK72FAKDcjs = require('./chunk-PK72FAKD.cjs');
25
25
 
26
26
 
27
27
  var _chunkKIN7Y247cjs = require('./chunk-KIN7Y247.cjs');
28
- require('./chunk-D6PU5YAS.cjs');
28
+ require('./chunk-EC2I4U4G.cjs');
29
29
  require('./chunk-CQ3UJW76.cjs');
30
30
  require('./chunk-5ZF6NTYI.cjs');
31
31
 
32
32
 
33
- var _chunkZPHRTTQXcjs = require('./chunk-ZPHRTTQX.cjs');
33
+ var _chunkGFSUTNRMcjs = require('./chunk-GFSUTNRM.cjs');
34
34
 
35
35
 
36
36
 
37
37
 
38
- var _chunkFPLSJF4Scjs = require('./chunk-FPLSJF4S.cjs');
38
+ var _chunkNFZXJRXScjs = require('./chunk-NFZXJRXS.cjs');
39
39
 
40
40
 
41
41
 
@@ -93,11 +93,11 @@ var generateCode = async ({ iteration, ctx, cognitive, controller }) => {
93
93
  const traces = iteration.traces;
94
94
  const modelRef = Array.isArray(iteration.model) ? iteration.model[0] : iteration.model;
95
95
  const model = await cognitive.getModelDetails(modelRef).catch((thrown) => {
96
- throw new (0, _chunkPK72FAKDcjs.CognitiveError)(`Failed to fetch model details for model "${modelRef}": ${_chunkFPLSJF4Scjs.getErrorMessage.call(void 0, thrown)}`);
96
+ throw new (0, _chunkPK72FAKDcjs.CognitiveError)(`Failed to fetch model details for model "${modelRef}": ${_chunkNFZXJRXScjs.getErrorMessage.call(void 0, thrown)}`);
97
97
  });
98
98
  const modelLimit = Math.max(model.input.maxTokens, 8e3);
99
99
  const responseLengthBuffer = getModelOutputLimit(modelLimit);
100
- const messages = _chunkZPHRTTQXcjs.truncateWrappedContent.call(void 0, {
100
+ const messages = _chunkGFSUTNRMcjs.truncateWrappedContent.call(void 0, {
101
101
  messages: iteration.messages,
102
102
  tokenLimit: modelLimit - responseLengthBuffer,
103
103
  throwOnFailure: true
@@ -119,7 +119,7 @@ var generateCode = async ({ iteration, ctx, cognitive, controller }) => {
119
119
  messages: messages.filter((x) => x.role !== "system"),
120
120
  stopSequences: ctx.version.getStopTokens()
121
121
  }).catch((thrown) => {
122
- throw new (0, _chunkPK72FAKDcjs.CognitiveError)(`LLM generation failed: ${_chunkFPLSJF4Scjs.getErrorMessage.call(void 0, thrown)}`);
122
+ throw new (0, _chunkPK72FAKDcjs.CognitiveError)(`LLM generation failed: ${_chunkNFZXJRXScjs.getErrorMessage.call(void 0, thrown)}`);
123
123
  });
124
124
  const out = typeof ((_c = (_b = output.output.choices) == null ? void 0 : _b[0]) == null ? void 0 : _c.content) === "string" ? output.output.choices[0].content : null;
125
125
  if (!out) {
@@ -243,7 +243,7 @@ var interpretVMResult = async ({
243
243
  });
244
244
  return;
245
245
  }
246
- const parsedExit = _chunkPQGZQQA6cjs.parseExit.call(void 0, returnValue, iteration.exits);
246
+ const parsedExit = _chunkN3XPJTPEcjs.parseExit.call(void 0, returnValue, iteration.exits);
247
247
  if (!parsedExit.success) {
248
248
  iteration.end({
249
249
  type: "exit_error",
@@ -267,7 +267,7 @@ var interpretVMResult = async ({
267
267
  type: "exit_error",
268
268
  exit_error: {
269
269
  exit: returnExit.name,
270
- message: `Error executing exit ${returnExit.name}: ${_chunkFPLSJF4Scjs.getErrorMessage.call(void 0, err)}`,
270
+ message: `Error executing exit ${returnExit.name}: ${_chunkNFZXJRXScjs.getErrorMessage.call(void 0, err)}`,
271
271
  return_value: returnValue
272
272
  }
273
273
  });
@@ -449,7 +449,7 @@ var buildVMContext = ({
449
449
  onAfterTool
450
450
  }) => {
451
451
  const traces = iteration.traces;
452
- const vmContext = { ..._chunkFPLSJF4Scjs.stripInvalidIdentifiers.call(void 0, iteration.variables) };
452
+ const vmContext = { ..._chunkNFZXJRXScjs.stripInvalidIdentifiers.call(void 0, iteration.variables) };
453
453
  for (const obj of iteration.objects) {
454
454
  const internalValues = {};
455
455
  const instance = {};
@@ -473,7 +473,7 @@ var buildVMContext = ({
473
473
  const parsed = schema.safeParse(value2);
474
474
  if (!parsed.success) {
475
475
  throw new (0, _chunkPK72FAKDcjs.AssignmentError)(
476
- `Invalid value for Object property ${obj.name}.${name}: ${_chunkFPLSJF4Scjs.getErrorMessage.call(void 0, parsed.error)}`
476
+ `Invalid value for Object property ${obj.name}.${name}: ${_chunkNFZXJRXScjs.getErrorMessage.call(void 0, parsed.error)}`
477
477
  );
478
478
  }
479
479
  internalValues[name] = parsed.data;
@@ -524,7 +524,7 @@ var buildVMContext = ({
524
524
  // src/runtime/execute.ts
525
525
  var executeContext = async (props) => {
526
526
  var _a, _b;
527
- await _chunkFPLSJF4Scjs.init.call(void 0, );
527
+ await _chunkNFZXJRXScjs.init.call(void 0, );
528
528
  const result = await executeContextInternal(props);
529
529
  try {
530
530
  (_b = (_a = result.context.chat) == null ? void 0 : _a.onExecutionDone) == null ? void 0 : _b.call(_a, result);
@@ -538,7 +538,7 @@ var executeContextInternal = async (props) => {
538
538
  const { onIterationStart, onIterationEnd, onTrace, onExit, onBeforeExecution, onAfterTool, onBeforeTool } = props;
539
539
  const client = _nullishCoalesce(props.client, () => ( new (0, _client.Client)()));
540
540
  const cognitive = _cognitive.Cognitive.isCognitiveClient(client) ? client : _cognitive.CognitiveBeta.isBetaClient(client) ? _cognitive.cognitiveFromBeta.call(void 0, client) : new (0, _cognitive.Cognitive)({ client, __experimental_beta: true });
541
- const ctx = new (0, _chunkPQGZQQA6cjs.Context)({
541
+ const ctx = new (0, _chunkN3XPJTPEcjs.Context)({
542
542
  chat: props.chat,
543
543
  instructions: props.instructions,
544
544
  objects: props.objects,
@@ -554,7 +554,7 @@ var executeContextInternal = async (props) => {
554
554
  try {
555
555
  while (true) {
556
556
  if (ctx.iterations.length >= ctx.loop) {
557
- return new (0, _chunkPQGZQQA6cjs.ErrorExecutionResult)(ctx, new (0, _chunkPK72FAKDcjs.LoopExceededError)());
557
+ return new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, new (0, _chunkPK72FAKDcjs.LoopExceededError)());
558
558
  }
559
559
  const iteration = await ctx.nextIteration();
560
560
  const unsubscribeTrace = iteration.traces.onPush((traces) => {
@@ -585,7 +585,7 @@ var executeContextInternal = async (props) => {
585
585
  }
586
586
  }
587
587
  });
588
- return new (0, _chunkPQGZQQA6cjs.ErrorExecutionResult)(ctx, _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted")));
588
+ return new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted")));
589
589
  }
590
590
  const iterationResult = await executeIterationWithErrorHandling({
591
591
  iteration,
@@ -614,7 +614,7 @@ var executeContextInternal = async (props) => {
614
614
  }
615
615
  }
616
616
  } catch (error) {
617
- return new (0, _chunkPQGZQQA6cjs.ErrorExecutionResult)(ctx, _nullishCoalesce(error, () => ( "Unknown error")));
617
+ return new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(error, () => ( "Unknown error")));
618
618
  }
619
619
  };
620
620
  var executeIterationStartHook = async ({
@@ -644,7 +644,7 @@ var executeIterationStartHook = async ({
644
644
  } : {
645
645
  type: "execution_error",
646
646
  execution_error: {
647
- message: `Error in onIterationStart hook: ${_chunkFPLSJF4Scjs.getErrorMessage.call(void 0, err)}`,
647
+ message: `Error in onIterationStart hook: ${_chunkNFZXJRXScjs.getErrorMessage.call(void 0, err)}`,
648
648
  stack: _chunkKIN7Y247cjs.cleanStackTrace.call(void 0,
649
649
  err instanceof Error ? _nullishCoalesce(err.stack, () => ( "No stack trace available")) : "No stack trace available"
650
650
  )
@@ -687,7 +687,7 @@ var executeIterationWithErrorHandling = async ({
687
687
  status: iteration.status.type === "pending" ? {
688
688
  type: "execution_error",
689
689
  execution_error: {
690
- message: "An unexpected error occurred: " + _chunkFPLSJF4Scjs.getErrorMessage.call(void 0, err),
690
+ message: "An unexpected error occurred: " + _chunkNFZXJRXScjs.getErrorMessage.call(void 0, err),
691
691
  stack: _chunkKIN7Y247cjs.cleanStackTrace.call(void 0,
692
692
  err instanceof Error ? _nullishCoalesce(err.stack, () => ( "No stack trace available")) : "No stack trace available"
693
693
  )
@@ -699,7 +699,7 @@ var executeIterationWithErrorHandling = async ({
699
699
  if (!controller.signal.aborted) {
700
700
  return {
701
701
  type: "return",
702
- result: new (0, _chunkPQGZQQA6cjs.ErrorExecutionResult)(ctx, err)
702
+ result: new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, err)
703
703
  };
704
704
  }
705
705
  await finalizeIteration({
@@ -715,7 +715,7 @@ var executeIterationWithErrorHandling = async ({
715
715
  });
716
716
  return {
717
717
  type: "return",
718
- result: new (0, _chunkPQGZQQA6cjs.ErrorExecutionResult)(ctx, _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted")))
718
+ result: new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted")))
719
719
  };
720
720
  }
721
721
  };
@@ -727,7 +727,7 @@ var transformIterationResult = ({
727
727
  const exitName = iteration.status.exit_success.exit_name;
728
728
  return {
729
729
  type: "return",
730
- result: new (0, _chunkPQGZQQA6cjs.SuccessExecutionResult)(ctx, {
730
+ result: new (0, _chunkN3XPJTPEcjs.SuccessExecutionResult)(ctx, {
731
731
  exit: iteration.exits.find((x) => x.name === exitName),
732
732
  result: iteration.status.exit_success.return_value
733
733
  })
@@ -736,17 +736,17 @@ var transformIterationResult = ({
736
736
  if (iteration.status.type === "callback_requested") {
737
737
  return {
738
738
  type: "return",
739
- result: new (0, _chunkPQGZQQA6cjs.PartialExecutionResult)(
739
+ result: new (0, _chunkN3XPJTPEcjs.PartialExecutionResult)(
740
740
  ctx,
741
741
  iteration.status.callback_requested.signal,
742
- _chunkPQGZQQA6cjs.Snapshot.fromSignal(iteration.status.callback_requested.signal)
742
+ _chunkN3XPJTPEcjs.Snapshot.fromSignal(iteration.status.callback_requested.signal)
743
743
  )
744
744
  };
745
745
  }
746
746
  if (iteration.status.type === "aborted") {
747
747
  return {
748
748
  type: "return",
749
- result: new (0, _chunkPQGZQQA6cjs.ErrorExecutionResult)(ctx, _nullishCoalesce(iteration.error, () => ( "The operation was aborted")))
749
+ result: new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(iteration.error, () => ( "The operation was aborted")))
750
750
  };
751
751
  }
752
752
  if (iteration.status.type === "thinking_requested" || iteration.status.type === "exit_error" || iteration.status.type === "execution_error" || iteration.status.type === "invalid_code_error") {
@@ -754,7 +754,7 @@ var transformIterationResult = ({
754
754
  }
755
755
  return {
756
756
  type: "return",
757
- result: new (0, _chunkPQGZQQA6cjs.ErrorExecutionResult)(ctx, _nullishCoalesce(iteration.error, () => ( `Unknown error. Status: ${iteration.status.type}`)))
757
+ result: new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(iteration.error, () => ( `Unknown error. Status: ${iteration.status.type}`)))
758
758
  };
759
759
  };
760
760
  var executeIteration = async ({
@@ -788,7 +788,7 @@ var executeIteration = async ({
788
788
  iteration.end({
789
789
  type: "execution_error",
790
790
  execution_error: {
791
- message: `Error in onBeforeExecution hook: ${_chunkFPLSJF4Scjs.getErrorMessage.call(void 0, err)}`,
791
+ message: `Error in onBeforeExecution hook: ${_chunkNFZXJRXScjs.getErrorMessage.call(void 0, err)}`,
792
792
  stack: _chunkKIN7Y247cjs.cleanStackTrace.call(void 0,
793
793
  err instanceof Error ? _nullishCoalesce(err.stack, () => ( "No stack trace available")) : "No stack trace available"
794
794
  )
@@ -823,7 +823,7 @@ var executeIteration = async ({
823
823
  ).catch((err) => {
824
824
  return {
825
825
  success: false,
826
- error: err instanceof Error ? err : new Error(_chunkFPLSJF4Scjs.getErrorMessage.call(void 0, err)),
826
+ error: err instanceof Error ? err : new Error(_chunkNFZXJRXScjs.getErrorMessage.call(void 0, err)),
827
827
  lines_executed: [],
828
828
  traces: [],
829
829
  variables: {}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Exit
3
- } from "./chunk-XVVYNOTX.js";
4
- import "./chunk-YX27XM67.js";
3
+ } from "./chunk-TRWUQSEK.js";
4
+ import "./chunk-ZHHB3FT4.js";
5
5
  import "./chunk-34GJUS6U.js";
6
6
  export {
7
7
  Exit
@@ -0,0 +1,8 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkEC2I4U4Gcjs = require('./chunk-EC2I4U4G.cjs');
4
+ require('./chunk-NFZXJRXS.cjs');
5
+ require('./chunk-HC2QZTVT.cjs');
6
+
7
+
8
+ exports.Exit = _chunkEC2I4U4Gcjs.Exit;