llmz 0.9.0 → 1.0.1

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 (231) hide show
  1. package/DOCS.md +230 -1796
  2. package/ERRORS.md +98 -0
  3. package/README.md +96 -582
  4. package/dist/chat/chat.d.ts +63 -0
  5. package/dist/chat/component.d.ts +31 -0
  6. package/dist/chat/component.default.d.ts +58 -0
  7. package/dist/chat/response.d.ts +15 -0
  8. package/dist/compiler/compiler.d.ts +2 -7
  9. package/dist/compiler/plugins/dynamic-code.d.ts +7 -0
  10. package/dist/compiler/plugins/replace-comment.d.ts +2 -3
  11. package/dist/compiler/plugins/return-async.d.ts +5 -4
  12. package/dist/compiler/plugins/termination.d.ts +8 -0
  13. package/dist/compiler/plugins/tool-resolution.d.ts +4 -0
  14. package/dist/compiler/plugins/variable-extraction.d.ts +2 -8
  15. package/dist/component-BpMVZYOa.cjs +649 -0
  16. package/dist/component-C27qu6Zv.js +614 -0
  17. package/dist/context.d.ts +70 -377
  18. package/dist/custom-client-BDkgBR2w.js +1631 -0
  19. package/dist/custom-client-MytucGI-.cjs +1708 -0
  20. package/dist/custom-client.d.ts +12 -2
  21. package/dist/errors/catalog.d.ts +287 -0
  22. package/dist/errors/hooks.d.ts +2 -0
  23. package/dist/errors-H4JJFH3S.js +620 -0
  24. package/dist/errors-IhnTKUp7.cjs +871 -0
  25. package/dist/errors.d.ts +18 -36
  26. package/dist/execute-BYI_U5sR.js +1943 -0
  27. package/dist/execute-DLas4V2n.cjs +1944 -0
  28. package/dist/{exit-DUM96DN1.cjs → exit-BUgJ5qi5.cjs} +38 -28
  29. package/dist/{exit-CDdxDBRT.js → exit-CPNk3vbz.js} +37 -27
  30. package/dist/exit.d.ts +19 -16
  31. package/dist/index.cjs +176 -1237
  32. package/dist/index.d.ts +25 -28
  33. package/dist/index.js +137 -1213
  34. package/dist/index.workerd.js +8427 -10771
  35. package/dist/inspect.d.ts +18 -4
  36. package/dist/inspection.d.ts +38 -0
  37. package/dist/native-Bm6L9zOb.cjs +212 -0
  38. package/dist/native-DvTH9vFe.js +177 -0
  39. package/dist/objects.d.ts +2 -57
  40. package/dist/prompts/native.d.ts +2 -0
  41. package/dist/prompts/prompt.d.ts +10 -101
  42. package/dist/quickjs-variant-DJwYDSsb.cjs +1073 -0
  43. package/dist/quickjs-variant-DlPi9-Sx.js +984 -0
  44. package/dist/result.d.ts +30 -861
  45. package/dist/runtime/execute.d.ts +3 -2
  46. package/dist/runtime/execution-activity.d.ts +11 -0
  47. package/dist/runtime/execution-diagnostics.d.ts +11 -0
  48. package/dist/runtime/execution-report.d.ts +48 -0
  49. package/dist/runtime/fixtures/chat.d.ts +8 -0
  50. package/dist/runtime/fixtures/long-search.d.ts +1 -1
  51. package/dist/runtime/fixtures/native-client.d.ts +33 -0
  52. package/dist/runtime/fixtures/protocol-languages.d.ts +1 -1
  53. package/dist/runtime/generate.d.ts +23 -20
  54. package/dist/runtime/inspection-values.d.ts +14 -0
  55. package/dist/runtime/inspection-values.test.d.ts +1 -0
  56. package/dist/runtime/interruption-control-flow.test.d.ts +1 -0
  57. package/dist/runtime/interruption-settings.test.d.ts +1 -0
  58. package/dist/runtime/javascript-api.d.ts +59 -0
  59. package/dist/runtime/javascript-api.test.d.ts +1 -0
  60. package/dist/runtime/native-review.test.d.ts +1 -0
  61. package/dist/runtime/native-tools.d.ts +18 -0
  62. package/dist/runtime/native-tools.test.d.ts +1 -0
  63. package/dist/runtime/object-memory.test.d.ts +1 -0
  64. package/dist/runtime/single-tool.test.d.ts +1 -0
  65. package/dist/runtime/token-budget.d.ts +22 -0
  66. package/dist/runtime/token-budget.test.d.ts +1 -0
  67. package/dist/runtime/tool-wrapper.d.ts +4 -5
  68. package/dist/runtime/traces.test.d.ts +1 -0
  69. package/dist/runtime/truncation.test.d.ts +1 -0
  70. package/dist/runtime/types.d.ts +39 -31
  71. package/dist/runtime/variable-recovery.test.d.ts +1 -0
  72. package/dist/runtime/vm-context.d.ts +6 -1
  73. package/dist/runtime/worker-completion.test.d.ts +1 -0
  74. package/dist/runtime-names.d.ts +4 -0
  75. package/dist/schema-Aer_W7Al.js +45 -0
  76. package/dist/schema-DBkjo0b7.cjs +68 -0
  77. package/dist/schema.d.ts +10 -0
  78. package/dist/schema.test.d.ts +1 -0
  79. package/dist/session/compactor.d.ts +51 -0
  80. package/dist/session/compactor.test.d.ts +1 -0
  81. package/dist/session/history.d.ts +36 -0
  82. package/dist/session/history.test.d.ts +1 -0
  83. package/dist/session/json.d.ts +3 -0
  84. package/dist/session/json.test.d.ts +1 -0
  85. package/dist/session/memory-codec.d.ts +9 -0
  86. package/dist/session/memory-codec.test.d.ts +1 -0
  87. package/dist/session/memory-render.d.ts +15 -0
  88. package/dist/session/memory-render.test.d.ts +1 -0
  89. package/dist/session/memory.d.ts +112 -0
  90. package/dist/session/memory.test.d.ts +1 -0
  91. package/dist/session/messages.d.ts +17 -0
  92. package/dist/session/messages.test.d.ts +1 -0
  93. package/dist/session/serialization.d.ts +34 -0
  94. package/dist/session/serialization.test.d.ts +1 -0
  95. package/dist/session/session-memory.test.d.ts +1 -0
  96. package/dist/session/session.d.ts +117 -0
  97. package/dist/session/session.test.d.ts +1 -0
  98. package/dist/{transcript.d.ts → session/transcript.d.ts} +4 -8
  99. package/dist/session/transcript.test.d.ts +1 -0
  100. package/dist/{tool-Bv8N4IPj.js → tool--gK91eez.js} +144 -92
  101. package/dist/{tool-Dy6AJpJH.cjs → tool-Da_F-N-5.cjs} +146 -94
  102. package/dist/tool.d.ts +25 -17
  103. package/dist/truncate-BSoH2-nY.js +79 -0
  104. package/dist/truncate-nV3Mxr6-.cjs +102 -0
  105. package/dist/truncate.d.ts +24 -0
  106. package/dist/truncate.test.d.ts +1 -0
  107. package/dist/types.d.ts +27 -9
  108. package/dist/{typings-3lsqCbkn.cjs → typings-C1ihexWE.cjs} +38 -193
  109. package/dist/{typings-CrBa7Tyy.js → typings-D9_aC8aq.js} +38 -175
  110. package/dist/typings-formatter.d.ts +1 -1
  111. package/dist/typings.d.ts +3 -0
  112. package/dist/{uniq-BYQ7GWwb.js → uniq-DfUeSNaX.js} +2 -2
  113. package/dist/{uniq-G872RWmE.cjs → uniq-DiXgysNV.cjs} +6 -18
  114. package/dist/{_baseIteratee-P_firB7b.js → utils-BOFzb8Ok.js} +1134 -16
  115. package/dist/{_baseIteratee-CF4qP2a8.cjs → utils-CTlsXvdj.cjs} +1281 -84
  116. package/dist/vm/drivers/node.d.ts +1 -1
  117. package/dist/vm/drivers/quickjs.d.ts +1 -1
  118. package/dist/vm/errors.d.ts +4 -4
  119. package/dist/vm/index.d.ts +3 -4
  120. package/dist/vm/instrument.d.ts +14 -6
  121. package/dist/vm/member-proxy.d.ts +4 -0
  122. package/dist/vm/member-proxy.test.d.ts +1 -0
  123. package/dist/vm/memory.test.d.ts +1 -0
  124. package/dist/vm/return-semantics.test.d.ts +1 -0
  125. package/dist/vm/types.d.ts +18 -3
  126. package/dist/{vm-BLsHw1da.js → vm-8jxt8PTK.js} +1162 -180
  127. package/dist/{vm-D6s1zF6M.cjs → vm-XuVPuW3Y.cjs} +1195 -207
  128. package/package.json +13 -6
  129. package/dist/_baseForOwn-BfWDTL8L.cjs +0 -53
  130. package/dist/_baseForOwn-CFhWe_W6.js +0 -48
  131. package/dist/_getPrototype-CG7Dxrrz.js +0 -6
  132. package/dist/_getPrototype-DQDlNVVM.cjs +0 -10
  133. package/dist/_overArg-C5Hy7oCi.cjs +0 -196
  134. package/dist/_overArg-CRYbj1NH.js +0 -155
  135. package/dist/chat.d.ts +0 -401
  136. package/dist/common-BlRFtdf2.js +0 -807
  137. package/dist/common-BnvrDnIT.cjs +0 -860
  138. package/dist/compiler/plugins/track-tool-calls.d.ts +0 -33
  139. package/dist/compiler-C-OI9sim.cjs +0 -547
  140. package/dist/compiler-CW1VjQsn.js +0 -473
  141. package/dist/component-C6Agl2ns.cjs +0 -73
  142. package/dist/component-DGG7d_Mz.js +0 -44
  143. package/dist/component.d.ts +0 -88
  144. package/dist/component.default.d.ts +0 -278
  145. package/dist/custom-client-ChuZ63zp.js +0 -2658
  146. package/dist/custom-client-DAsGRnYc.cjs +0 -2729
  147. package/dist/dual-modes-DDkoCp3R.js +0 -3006
  148. package/dist/dual-modes-DPXiuvNe.cjs +0 -3090
  149. package/dist/errors-C962uJdS.cjs +0 -220
  150. package/dist/errors-Cg1G0Awu.js +0 -161
  151. package/dist/example-format.d.ts +0 -8
  152. package/dist/example.d.ts +0 -45
  153. package/dist/execute-BWcdv9so.js +0 -1059
  154. package/dist/execute-DM2-7y86.cjs +0 -1060
  155. package/dist/exit-parser.d.ts +0 -39
  156. package/dist/handlers.d.ts +0 -10
  157. package/dist/hoist.d.ts +0 -2
  158. package/dist/isEmpty-BhJRCqIF.js +0 -52
  159. package/dist/isEmpty-LY533Wmh.cjs +0 -57
  160. package/dist/isPlainObject-CSxXVKCk.cjs +0 -56
  161. package/dist/isPlainObject-D39AzPO2.js +0 -51
  162. package/dist/jsx-CIgdGGVs.js +0 -52
  163. package/dist/jsx-owqxrquU.cjs +0 -75
  164. package/dist/jsx.d.ts +0 -11
  165. package/dist/message-stream/index.d.ts +0 -9
  166. package/dist/message-stream/instructions.d.ts +0 -30
  167. package/dist/message-stream/normalizer.d.ts +0 -21
  168. package/dist/message-stream/parser.d.ts +0 -89
  169. package/dist/message-stream/registry.d.ts +0 -14
  170. package/dist/message-stream/replayable.d.ts +0 -27
  171. package/dist/message-stream/response-parser.d.ts +0 -24
  172. package/dist/message-stream/sanitize.d.ts +0 -10
  173. package/dist/message-stream/stream.d.ts +0 -54
  174. package/dist/message-stream/types.d.ts +0 -97
  175. package/dist/message-stream/validator.d.ts +0 -23
  176. package/dist/prompts/chat-mode/protocol.d.ts +0 -2
  177. package/dist/prompts/chat-mode/system.d.ts +0 -2
  178. package/dist/prompts/chat-mode/system.md.d.ts +0 -2
  179. package/dist/prompts/chat-mode/user.d.ts +0 -2
  180. package/dist/prompts/chat-mode/user.md.d.ts +0 -2
  181. package/dist/prompts/code-examples.d.ts +0 -2
  182. package/dist/prompts/common.d.ts +0 -7
  183. package/dist/prompts/dual-modes.d.ts +0 -2
  184. package/dist/prompts/execution-history.d.ts +0 -6
  185. package/dist/prompts/execution-state.d.ts +0 -3
  186. package/dist/prompts/protocol-basics.d.ts +0 -5
  187. package/dist/prompts/protocol.d.ts +0 -31
  188. package/dist/prompts/worker-mode/protocol.d.ts +0 -2
  189. package/dist/prompts/worker-mode/system.d.ts +0 -2
  190. package/dist/prompts/worker-mode/system.md.d.ts +0 -2
  191. package/dist/prompts/worker-mode/user.d.ts +0 -2
  192. package/dist/prompts/worker-mode/user.md.d.ts +0 -2
  193. package/dist/quickjs-variant-BYhMBpwU.js +0 -45
  194. package/dist/quickjs-variant-CsIwTVFC.cjs +0 -56
  195. package/dist/rolldown-runtime-EAsCxrDo.js +0 -14
  196. package/dist/runtime/fixtures/qwen-protocol-failures.d.ts +0 -29
  197. package/dist/runtime/interpret-result.d.ts +0 -22
  198. package/dist/snapshots.d.ts +0 -249
  199. package/dist/stack-traces-BIE_5Xwf.js +0 -21
  200. package/dist/stack-traces-ntw_qhoy.cjs +0 -26
  201. package/dist/truncator-CLkouTCO.cjs +0 -276
  202. package/dist/truncator-DZqEqnpD.js +0 -253
  203. package/dist/truncator.d.ts +0 -118
  204. package/dist/utils-3ESwP3yg.cjs +0 -1075
  205. package/dist/utils-UBeAFeEI.js +0 -950
  206. /package/dist/{citations.d.ts → chat/citations.d.ts} +0 -0
  207. /package/dist/{citations.test.d.ts → chat/citations.test.d.ts} +0 -0
  208. /package/dist/{component.default.test.d.ts → chat/component.default.test.d.ts} +0 -0
  209. /package/dist/{compiler/plugins/track-tool-calls.test.d.ts → chat/component.test.d.ts} +0 -0
  210. /package/dist/{example.test.d.ts → chat/response.test.d.ts} +0 -0
  211. /package/dist/{exit-parser.test.d.ts → compiler/plugins/dynamic-code.test.d.ts} +0 -0
  212. /package/dist/{handlers.test.d.ts → compiler/plugins/tool-resolution.test.d.ts} +0 -0
  213. /package/dist/{hoist.test.d.ts → errors/catalog.test.d.ts} +0 -0
  214. /package/dist/{message-stream/instructions.test.d.ts → exit.test.d.ts} +0 -0
  215. /package/dist/{message-stream/normalizer.test.d.ts → inspection.test.d.ts} +0 -0
  216. /package/dist/{message-stream/parser.test.d.ts → prompts/native.test.d.ts} +0 -0
  217. /package/dist/{message-stream/response-parser.test.d.ts → result.test.d.ts} +0 -0
  218. /package/dist/{message-stream/stream.test.d.ts → runtime/chat-delivery.test.d.ts} +0 -0
  219. /package/dist/{message-stream/validator.test.d.ts → runtime/compatibility-regressions.test.d.ts} +0 -0
  220. /package/dist/{prompts/adherence.test.d.ts → runtime/context-registration.test.d.ts} +0 -0
  221. /package/dist/{prompts/catalogue-examples.test.d.ts → runtime/error-recovery.test.d.ts} +0 -0
  222. /package/dist/{prompts/code-examples.test.d.ts → runtime/errors.test.d.ts} +0 -0
  223. /package/dist/{prompts/common.test.d.ts → runtime/execution-activity.test.d.ts} +0 -0
  224. /package/dist/{prompts/concrete-patterns.test.d.ts → runtime/execution-diagnostics.test.d.ts} +0 -0
  225. /package/dist/{prompts/long-search.test.d.ts → runtime/execution-report.test.d.ts} +0 -0
  226. /package/dist/{prompts/protocol-simple.test.d.ts → runtime/execution-safety.test.d.ts} +0 -0
  227. /package/dist/{prompts/protocol.test.d.ts → runtime/exit-control-flow.test.d.ts} +0 -0
  228. /package/dist/{prompts/sections.test.d.ts → runtime/fixtures/long-search.test.d.ts} +0 -0
  229. /package/dist/runtime/{interpret-result.test.d.ts → generate.test.d.ts} +0 -0
  230. /package/dist/{transcript.test.d.ts → runtime/hook-provenance.test.d.ts} +0 -0
  231. /package/dist/{truncator.test.d.ts → runtime/inspection-hook.test.d.ts} +0 -0
@@ -0,0 +1,871 @@
1
+ //#region src/errors/catalog.ts
2
+ const ERROR_BRAND = Symbol.for("llmz.error.v1");
3
+ /** Stable library failures. Control-flow signals (such as ThinkSignal) are not errors. */
4
+ var LLMzError = class extends Error {
5
+ critical;
6
+ constructor(message, critical, options) {
7
+ super(message, options);
8
+ this.critical = critical;
9
+ this.name = new.target.name;
10
+ }
11
+ /** Shared across independently loaded copies of the library. */
12
+ get [ERROR_BRAND]() {
13
+ return true;
14
+ }
15
+ static is = (value) => isLLMzError(value);
16
+ };
17
+ function validationMessage(subject, issues, expectedInput) {
18
+ return `${subject} received invalid input:\n${issues.map((issue) => `- ${issue.path.join(".") || "input"}: ${issue.message}`).join("\n")}\n\nExpected input (TypeScript):\n${expectedInput}`;
19
+ }
20
+ var CodeExecutionError = class extends LLMzError {
21
+ source;
22
+ stacktrace;
23
+ originalErrorName;
24
+ static is = (value) => isLLMzError(value, "EXECUTION_FAILED");
25
+ code = "EXECUTION_FAILED";
26
+ constructor(message, source, stacktrace, originalErrorName, cause) {
27
+ super(message, isCriticalError(cause), { cause });
28
+ this.source = source;
29
+ this.stacktrace = stacktrace;
30
+ this.originalErrorName = originalErrorName;
31
+ }
32
+ };
33
+ var InvalidCodeError = class extends LLMzError {
34
+ source;
35
+ static is = (value) => isLLMzError(value, "INVALID_CODE");
36
+ code = "INVALID_CODE";
37
+ constructor(message, source, options) {
38
+ super(message, false, options);
39
+ this.source = source;
40
+ }
41
+ };
42
+ var CodeFormattingError = class extends LLMzError {
43
+ source;
44
+ static is = (value) => isLLMzError(value, "CODE_FORMATTING_FAILED");
45
+ code = "CODE_FORMATTING_FAILED";
46
+ constructor(message, source) {
47
+ super(message, true);
48
+ this.source = source;
49
+ }
50
+ };
51
+ var ToolInputError = class extends LLMzError {
52
+ toolName;
53
+ issues;
54
+ expectedInput;
55
+ static is = (value) => isLLMzError(value, "INVALID_TOOL_INPUT");
56
+ code = "INVALID_TOOL_INPUT";
57
+ constructor(toolName, issues, expectedInput) {
58
+ super(validationMessage(`Tool "${toolName}"`, issues, expectedInput), false);
59
+ this.toolName = toolName;
60
+ this.issues = issues;
61
+ this.expectedInput = expectedInput;
62
+ }
63
+ };
64
+ var ExitInputError = class extends LLMzError {
65
+ exitName;
66
+ issues;
67
+ expectedInput;
68
+ static is = (value) => isLLMzError(value, "INVALID_EXIT_INPUT");
69
+ code = "INVALID_EXIT_INPUT";
70
+ constructor(exitName, issues, expectedInput) {
71
+ super(validationMessage(`Exit "${exitName}"`, issues, expectedInput), false);
72
+ this.exitName = exitName;
73
+ this.issues = issues;
74
+ this.expectedInput = expectedInput;
75
+ }
76
+ };
77
+ var ObjectPropertyError = class extends LLMzError {
78
+ objectName;
79
+ propertyName;
80
+ issues;
81
+ expectedInput;
82
+ static is = (value) => isLLMzError(value, "INVALID_OBJECT_PROPERTY");
83
+ code = "INVALID_OBJECT_PROPERTY";
84
+ constructor(objectName, propertyName, issues, expectedInput) {
85
+ super(validationMessage(`Object property ${objectName}.${propertyName}`, issues, expectedInput), false);
86
+ this.objectName = objectName;
87
+ this.propertyName = propertyName;
88
+ this.issues = issues;
89
+ this.expectedInput = expectedInput;
90
+ }
91
+ };
92
+ var ComponentInputError = class extends LLMzError {
93
+ componentName;
94
+ issues;
95
+ expectedInput;
96
+ static is = (value) => isLLMzError(value, "INVALID_COMPONENT_INPUT");
97
+ code = "INVALID_COMPONENT_INPUT";
98
+ constructor(componentName, issues, expectedInput) {
99
+ super(validationMessage(`Component "${componentName}"`, issues, expectedInput), false);
100
+ this.componentName = componentName;
101
+ this.issues = issues;
102
+ this.expectedInput = expectedInput;
103
+ }
104
+ };
105
+ var UnknownToolError = class extends LLMzError {
106
+ toolName;
107
+ availableTools;
108
+ static is = (value) => isLLMzError(value, "UNKNOWN_TOOL");
109
+ code = "UNKNOWN_TOOL";
110
+ constructor(toolName, availableTools = [], message) {
111
+ super(message ?? `Tool "${toolName}" is not available. Use a documented tool from the JavaScript API.`, false);
112
+ this.toolName = toolName;
113
+ this.availableTools = availableTools;
114
+ }
115
+ };
116
+ var UnknownComponentError = class extends LLMzError {
117
+ componentName;
118
+ availableComponents;
119
+ static is = (value) => isLLMzError(value, "UNKNOWN_COMPONENT");
120
+ code = "UNKNOWN_COMPONENT";
121
+ constructor(componentName, availableComponents) {
122
+ super(`Component "chat.${componentName}" is not available. Available components: ${availableComponents.map((name) => `chat.${name}`).join(", ") || "(none)"}. Use native assistant text for ordinary replies.`, false);
123
+ this.componentName = componentName;
124
+ this.availableComponents = availableComponents;
125
+ }
126
+ };
127
+ var UnknownExitError = class extends LLMzError {
128
+ exitName;
129
+ availableExits;
130
+ static is = (value) => isLLMzError(value, "UNKNOWN_EXIT");
131
+ code = "UNKNOWN_EXIT";
132
+ constructor(exitName, availableExits) {
133
+ super(`Exit "${exitName}" is not available. Use a registered exit name. Available exits: ${availableExits.join(", ")}.`, false);
134
+ this.exitName = exitName;
135
+ this.availableExits = availableExits;
136
+ }
137
+ };
138
+ var ReservedIdentifierError = class extends LLMzError {
139
+ identifier;
140
+ kind;
141
+ static is = (value) => isLLMzError(value, "RESERVED_IDENTIFIER");
142
+ code = "RESERVED_IDENTIFIER";
143
+ constructor(identifier, kind, critical = kind !== "variable", message = `Runtime name "${identifier}" is reserved.`) {
144
+ super(message, critical);
145
+ this.identifier = identifier;
146
+ this.kind = kind;
147
+ }
148
+ };
149
+ var ToolExecutionError = class extends LLMzError {
150
+ toolName;
151
+ static is = (value) => isLLMzError(value, "TOOL_EXECUTION_FAILED");
152
+ code = "TOOL_EXECUTION_FAILED";
153
+ constructor(toolName, cause) {
154
+ super(cause instanceof Error ? cause.message : String(cause), false, { cause });
155
+ this.toolName = toolName;
156
+ }
157
+ };
158
+ var LoopExceededError = class extends LLMzError {
159
+ limit;
160
+ static is = (value) => isLLMzError(value, "ITERATION_LIMIT");
161
+ code = "ITERATION_LIMIT";
162
+ constructor(limit) {
163
+ super("Loop exceeded error", true);
164
+ this.limit = limit;
165
+ }
166
+ };
167
+ var TokenOverflowError = class extends LLMzError {
168
+ tokens;
169
+ limit;
170
+ phase;
171
+ static is = (value) => isLLMzError(value, "TOKEN_OVERFLOW");
172
+ code = "TOKEN_OVERFLOW";
173
+ constructor(message, tokens, limit, phase = "input") {
174
+ super(message, true);
175
+ this.tokens = tokens;
176
+ this.limit = limit;
177
+ this.phase = phase;
178
+ }
179
+ };
180
+ var MemoryCapacityError = class extends LLMzError {
181
+ maxBytes;
182
+ static is = (value) => isLLMzError(value, "MEMORY_CAPACITY");
183
+ code = "MEMORY_CAPACITY";
184
+ constructor(maxBytes) {
185
+ super(`Memory limit exceeded (${maxBytes} bytes). Compact retained iterations before continuing.`, true);
186
+ this.maxBytes = maxBytes;
187
+ }
188
+ };
189
+ /** A generated program tried to change read-only runtime state. */
190
+ var AssignmentError = class extends LLMzError {
191
+ static is = (value) => isLLMzError(value, "INVALID_ASSIGNMENT");
192
+ code = "INVALID_ASSIGNMENT";
193
+ constructor(message, options) {
194
+ super(message, false, options);
195
+ }
196
+ };
197
+ /** The provider failed, or returned an incomplete or malformed generation. */
198
+ var CognitiveError = class extends LLMzError {
199
+ static is = (value) => isLLMzError(value, "GENERATION_FAILED");
200
+ code = "GENERATION_FAILED";
201
+ constructor(message, options) {
202
+ super(message, true, options);
203
+ }
204
+ };
205
+ /** Summarization failed; canonical history is preserved. */
206
+ var CompactionError = class extends LLMzError {
207
+ static is = (value) => isLLMzError(value, "COMPACTION_FAILED");
208
+ code = "COMPACTION_FAILED";
209
+ constructor(message, options) {
210
+ super(message, true, options);
211
+ }
212
+ };
213
+ /** Invalid tool definition. */
214
+ var InvalidToolError = class extends LLMzError {
215
+ static is = (value) => isLLMzError(value, "INVALID_TOOL");
216
+ code = "INVALID_TOOL";
217
+ constructor(message, options) {
218
+ super(message, true, options);
219
+ }
220
+ };
221
+ /** Invalid object definition. */
222
+ var InvalidObjectError = class extends LLMzError {
223
+ static is = (value) => isLLMzError(value, "INVALID_OBJECT");
224
+ code = "INVALID_OBJECT";
225
+ constructor(message, options) {
226
+ super(message, true, options);
227
+ }
228
+ };
229
+ /** Invalid exit definition. */
230
+ var InvalidExitError = class extends LLMzError {
231
+ static is = (value) => isLLMzError(value, "INVALID_EXIT");
232
+ code = "INVALID_EXIT";
233
+ constructor(message, options) {
234
+ super(message, true, options);
235
+ }
236
+ };
237
+ /** Invalid chat component definition. */
238
+ var InvalidComponentError = class extends LLMzError {
239
+ static is = (value) => isLLMzError(value, "INVALID_COMPONENT");
240
+ code = "INVALID_COMPONENT";
241
+ constructor(message, options) {
242
+ super(message, true, options);
243
+ }
244
+ };
245
+ /** Invalid execution, chat, or library configuration. */
246
+ var InvalidConfigurationError = class extends LLMzError {
247
+ static is = (value) => isLLMzError(value, "INVALID_CONFIG");
248
+ code = "INVALID_CONFIG";
249
+ constructor(message, options) {
250
+ super(message, true, options);
251
+ }
252
+ };
253
+ /** Invalid session input message. */
254
+ var InvalidMessageError = class extends LLMzError {
255
+ static is = (value) => isLLMzError(value, "INVALID_MESSAGE");
256
+ code = "INVALID_MESSAGE";
257
+ constructor(message, options) {
258
+ super(message, true, options);
259
+ }
260
+ };
261
+ /** Invalid external event name or payload. */
262
+ var InvalidEventError = class extends LLMzError {
263
+ static is = (value) => isLLMzError(value, "INVALID_EVENT");
264
+ code = "INVALID_EVENT";
265
+ constructor(message, options) {
266
+ super(message, true, options);
267
+ }
268
+ };
269
+ /** Invalid persisted session or native history. */
270
+ var InvalidSessionError = class extends LLMzError {
271
+ static is = (value) => isLLMzError(value, "INVALID_SESSION");
272
+ code = "INVALID_SESSION";
273
+ constructor(message, options) {
274
+ super(message, true, options);
275
+ }
276
+ };
277
+ /** The operation is not allowed in the current session state. */
278
+ var SessionStateError = class extends LLMzError {
279
+ static is = (value) => isLLMzError(value, "SESSION_STATE");
280
+ code = "SESSION_STATE";
281
+ constructor(message, options) {
282
+ super(message, true, options);
283
+ }
284
+ };
285
+ /** A value cannot be retained in session memory. */
286
+ var MemoryValueError = class extends LLMzError {
287
+ static is = (value) => isLLMzError(value, "INVALID_MEMORY_VALUE");
288
+ code = "INVALID_MEMORY_VALUE";
289
+ constructor(message, options) {
290
+ super(message, false, options);
291
+ }
292
+ };
293
+ /** The model returned an invalid native tool call. */
294
+ var NativeProtocolError = class extends LLMzError {
295
+ static is = (value) => isLLMzError(value, "INVALID_NATIVE_CALL");
296
+ code = "INVALID_NATIVE_CALL";
297
+ constructor(message, options) {
298
+ super(message, false, options);
299
+ }
300
+ };
301
+ /** Generated code used a closed or unawaited host operation. */
302
+ var HostOperationError = class extends LLMzError {
303
+ static is = (value) => isLLMzError(value, "HOST_OPERATION_FAILED");
304
+ code = "HOST_OPERATION_FAILED";
305
+ constructor(message, options) {
306
+ super(message, false, options);
307
+ }
308
+ };
309
+ /** Message delivery failed; external delivery may have partially completed. */
310
+ var DeliveryError = class extends LLMzError {
311
+ static is = (value) => isLLMzError(value, "DELIVERY_FAILED");
312
+ code = "DELIVERY_FAILED";
313
+ constructor(message, options) {
314
+ super(message, false, options);
315
+ }
316
+ };
317
+ /** An execution hook failed; its external effects may be incomplete. */
318
+ var HookError = class extends LLMzError {
319
+ static is = (value) => isLLMzError(value, "HOOK_FAILED");
320
+ code = "HOOK_FAILED";
321
+ constructor(message, options) {
322
+ super(message, false, options);
323
+ }
324
+ };
325
+ /** Execution was cancelled or timed out. */
326
+ var ExecutionAbortedError = class extends LLMzError {
327
+ static is = (value) => isLLMzError(value, "EXECUTION_ABORTED");
328
+ code = "EXECUTION_ABORTED";
329
+ constructor(message, options) {
330
+ super(message, true, options);
331
+ }
332
+ };
333
+ /** An unexpected library failure; inspect cause for the original exception. */
334
+ var InternalError = class extends LLMzError {
335
+ static is = (value) => isLLMzError(value, "INTERNAL_ERROR");
336
+ code = "INTERNAL_ERROR";
337
+ constructor(message, options) {
338
+ super(message, true, options);
339
+ }
340
+ };
341
+ /** @internal Constructor registry for VM diagnostics. */
342
+ const errorClasses$1 = {
343
+ CodeExecutionError,
344
+ InvalidCodeError,
345
+ CodeFormattingError,
346
+ ToolInputError,
347
+ ExitInputError,
348
+ ObjectPropertyError,
349
+ ComponentInputError,
350
+ UnknownToolError,
351
+ UnknownExitError,
352
+ UnknownComponentError,
353
+ ReservedIdentifierError,
354
+ ToolExecutionError,
355
+ LoopExceededError,
356
+ TokenOverflowError,
357
+ MemoryCapacityError,
358
+ AssignmentError,
359
+ CognitiveError,
360
+ CompactionError,
361
+ InvalidToolError,
362
+ InvalidObjectError,
363
+ InvalidExitError,
364
+ InvalidComponentError,
365
+ InvalidConfigurationError,
366
+ InvalidMessageError,
367
+ InvalidEventError,
368
+ InvalidSessionError,
369
+ SessionStateError,
370
+ MemoryValueError,
371
+ NativeProtocolError,
372
+ HostOperationError,
373
+ DeliveryError,
374
+ HookError,
375
+ ExecutionAbortedError,
376
+ InternalError
377
+ };
378
+ const ERROR_CODES = /* @__PURE__ */ new Set([
379
+ "EXECUTION_FAILED",
380
+ "INVALID_CODE",
381
+ "CODE_FORMATTING_FAILED",
382
+ "INVALID_TOOL_INPUT",
383
+ "INVALID_EXIT_INPUT",
384
+ "INVALID_OBJECT_PROPERTY",
385
+ "INVALID_COMPONENT_INPUT",
386
+ "UNKNOWN_TOOL",
387
+ "UNKNOWN_COMPONENT",
388
+ "UNKNOWN_EXIT",
389
+ "RESERVED_IDENTIFIER",
390
+ "TOOL_EXECUTION_FAILED",
391
+ "ITERATION_LIMIT",
392
+ "TOKEN_OVERFLOW",
393
+ "MEMORY_CAPACITY",
394
+ "INVALID_ASSIGNMENT",
395
+ "GENERATION_FAILED",
396
+ "COMPACTION_FAILED",
397
+ "INVALID_TOOL",
398
+ "INVALID_OBJECT",
399
+ "INVALID_EXIT",
400
+ "INVALID_COMPONENT",
401
+ "INVALID_CONFIG",
402
+ "INVALID_MESSAGE",
403
+ "INVALID_EVENT",
404
+ "INVALID_SESSION",
405
+ "SESSION_STATE",
406
+ "INVALID_MEMORY_VALUE",
407
+ "INVALID_NATIVE_CALL",
408
+ "HOST_OPERATION_FAILED",
409
+ "DELIVERY_FAILED",
410
+ "HOOK_FAILED",
411
+ "EXECUTION_ABORTED",
412
+ "INTERNAL_ERROR"
413
+ ]);
414
+ function isLLMzError(error, code) {
415
+ if (!error || typeof error !== "object") return false;
416
+ try {
417
+ const value = error;
418
+ return value[ERROR_BRAND] === true && typeof value.message === "string" && typeof value.name === "string" && typeof value.critical === "boolean" && typeof value.code === "string" && ERROR_CODES.has(value.code) && (code === void 0 || value.code === code);
419
+ } catch {
420
+ return false;
421
+ }
422
+ }
423
+ /** Critical errors end execution; they are never sent back to the model for retry. */
424
+ function isCriticalError(error) {
425
+ return isLLMzError(error) && error.critical;
426
+ }
427
+ //#endregion
428
+ //#region src/stack-traces.ts
429
+ const isInternalLine = (line) => {
430
+ return line.includes("/llmz/") || line.includes("\\llmz\\src\\") || line.includes("node_modules");
431
+ };
432
+ function cleanStackTrace(stack, cleanInternal = true) {
433
+ let lines = stack.split("\n");
434
+ const until = lines.findIndex((line) => isInternalLine(line));
435
+ if (cleanInternal && until >= 0) lines = lines.slice(0, until);
436
+ else lines = lines.map((line) => {
437
+ let llmzIndex = line.indexOf("/llmz/");
438
+ if (llmzIndex === -1) llmzIndex = line.indexOf("\\llmz\\");
439
+ if (llmzIndex === -1) return line;
440
+ let lastSpaceIndex = line.lastIndexOf(" ", llmzIndex);
441
+ if (lastSpaceIndex === -1) lastSpaceIndex = 0;
442
+ const maybeParen = line[lastSpaceIndex + 1] === "(" ? "(" : "";
443
+ return line.slice(0, lastSpaceIndex + 1) + maybeParen + line.slice(llmzIndex);
444
+ });
445
+ return lines.join("\n");
446
+ }
447
+ //#endregion
448
+ //#region src/errors.ts
449
+ const errorClasses = { ...errorClasses$1 };
450
+ /** @internal Serialize diagnostics without losing non-enumerable Error fields. */
451
+ function describeError(error, seen = /* @__PURE__ */ new Set()) {
452
+ const value = Signals.maybeDeserializeError(error);
453
+ const details = {
454
+ ...diagnosticProperties(value),
455
+ name: value.name === "Error" ? value.constructor.name : value.name,
456
+ message: value.message,
457
+ stack: value.stack
458
+ };
459
+ delete details.cause;
460
+ seen.add(error);
461
+ if (value.cause instanceof Error && !seen.has(value.cause)) details.cause = describeError(value.cause, seen);
462
+ else if (value.cause !== void 0 && !(value.cause instanceof Error)) details.cause = {
463
+ name: "ThrownValue",
464
+ message: String(value.cause),
465
+ value: diagnosticValue(value.cause)
466
+ };
467
+ return details;
468
+ }
469
+ /** User-supplied exceptions can carry cycles, bigint metadata, or throwing accessors. */
470
+ function diagnosticValue(value) {
471
+ if (value === void 0) return;
472
+ const seen = /* @__PURE__ */ new WeakSet();
473
+ try {
474
+ const encoded = JSON.stringify(value, (_key, item) => {
475
+ if (typeof item === "bigint") return item.toString();
476
+ if (item && typeof item === "object") {
477
+ if (seen.has(item)) return "[Circular]";
478
+ seen.add(item);
479
+ }
480
+ return item;
481
+ });
482
+ return encoded === void 0 ? String(value) : JSON.parse(encoded);
483
+ } catch {
484
+ return "[Unserializable]";
485
+ }
486
+ }
487
+ function diagnosticProperties(error) {
488
+ const entries = Object.entries(Object.getOwnPropertyDescriptors(error)).filter(([key, descriptor]) => key !== "cause" && descriptor.enumerable && "value" in descriptor).map(([key, descriptor]) => [key, diagnosticValue(descriptor.value)]);
489
+ return Object.fromEntries(entries);
490
+ }
491
+ function registerErrorClass(name, errorClass) {
492
+ errorClasses[name] = errorClass;
493
+ }
494
+ const tryParseMessage = (str) => {
495
+ try {
496
+ return JSON.parse(str);
497
+ } catch {
498
+ return str;
499
+ }
500
+ };
501
+ let Signals;
502
+ (function(_Signals) {
503
+ function isWrappedError(error) {
504
+ var _error$message, _error$message2;
505
+ return error.name === "Error" && (error === null || error === void 0 || (_error$message = error.message) === null || _error$message === void 0 ? void 0 : _error$message.startsWith("{")) && (error === null || error === void 0 || (_error$message2 = error.message) === null || _error$message2 === void 0 ? void 0 : _error$message2.endsWith("}"));
506
+ }
507
+ _Signals.isWrappedError = isWrappedError;
508
+ function serializeError(error, seen = /* @__PURE__ */ new Set()) {
509
+ seen.add(error);
510
+ const properties = diagnosticProperties(error);
511
+ if (error.cause instanceof Error && !seen.has(error.cause)) Object.assign(properties, { cause: serializeError(error.cause, seen) });
512
+ else if (error.cause !== void 0 && !(error.cause instanceof Error)) properties.cause = { value: diagnosticValue(error.cause) };
513
+ if (isWrappedError(error)) {
514
+ const msg = tryParseMessage(error.message);
515
+ return JSON.stringify({
516
+ ...typeof msg === "object" ? msg : { message: msg },
517
+ properties
518
+ });
519
+ }
520
+ return JSON.stringify({
521
+ name: error.constructor.name,
522
+ message: error.message,
523
+ stack: cleanStackTrace(error.stack ?? ""),
524
+ properties
525
+ });
526
+ }
527
+ _Signals.serializeError = serializeError;
528
+ function maybeDeserializeError(error) {
529
+ if (isLLMzError(error) || error instanceof Error && !!errorClasses[error.name] && error instanceof errorClasses[error.name]) return error;
530
+ let serializedError = (error === null || error === void 0 ? void 0 : error.toString()) ?? "";
531
+ if (error instanceof Error) serializedError = error.message;
532
+ else if (typeof error === "string") serializedError = error;
533
+ try {
534
+ const parsed = JSON.parse(serializedError);
535
+ if (parsed && typeof parsed.name === "string" && typeof parsed.message === "string") {
536
+ const { name, message, properties = {} } = parsed;
537
+ const ErrorClass = Object.values(errorClasses$1).find((candidate) => candidate.is({
538
+ ...properties,
539
+ name,
540
+ message,
541
+ [Symbol.for("llmz.error.v1")]: true
542
+ })) ?? (Object.hasOwn(errorClasses, name) ? errorClasses[name] : Error);
543
+ const errorInstance = Object.setPrototypeOf(new Error(message), ErrorClass.prototype);
544
+ errorInstance.message = message;
545
+ errorInstance.name = name;
546
+ errorInstance.stack = cleanStackTrace((error === null || error === void 0 ? void 0 : error.stack) ?? "");
547
+ Object.assign(errorInstance, properties);
548
+ if (typeof properties.cause === "string") errorInstance.cause = maybeDeserializeError(properties.cause);
549
+ else if (properties.cause && typeof properties.cause === "object" && "value" in properties.cause) errorInstance.cause = properties.cause.value;
550
+ if (isWrappedError(errorInstance)) return maybeDeserializeError(errorInstance);
551
+ return errorInstance;
552
+ }
553
+ } catch {}
554
+ return error;
555
+ }
556
+ _Signals.maybeDeserializeError = maybeDeserializeError;
557
+ })(Signals || (Signals = {}));
558
+ const SIGNAL_BRAND = Symbol.for("llmz.signal.v1");
559
+ function isSignal(value) {
560
+ if (!value || typeof value !== "object") return false;
561
+ try {
562
+ return value[SIGNAL_BRAND] === true;
563
+ } catch {
564
+ return false;
565
+ }
566
+ }
567
+ var VMSignal = class extends Error {
568
+ message;
569
+ get [SIGNAL_BRAND]() {
570
+ return true;
571
+ }
572
+ signalKind = "vm";
573
+ static is = (value) => isSignal(value);
574
+ /**
575
+ * The code that was executed by the VM up to the point of the signal
576
+ */
577
+ truncatedCode = "";
578
+ /**
579
+ * Contains all the declared and executed variables during the VM execution
580
+ * See file plugins/variable-extraction.ts for more details
581
+ */
582
+ variables = {};
583
+ constructor(message) {
584
+ super(message);
585
+ this.message = message;
586
+ this.message = Signals.serializeError(this);
587
+ }
588
+ };
589
+ /** Loop means LLMz will continue the execution (unless it exhausted its iterations) */
590
+ var VMLoopSignal = class extends VMSignal {
591
+ signalKind = "loop";
592
+ static is = (value) => isSignal(value) && (value.signalKind === "loop" || value.signalKind === "think");
593
+ constructor(message) {
594
+ super(message);
595
+ this.message = Signals.serializeError(this);
596
+ }
597
+ };
598
+ var ThinkSignal = class extends VMLoopSignal {
599
+ reason;
600
+ context;
601
+ metadata;
602
+ signalKind = "think";
603
+ static is = (value) => isSignal(value) && value.signalKind === "think";
604
+ constructor(reason, context, metadata) {
605
+ super("Think signal received: " + reason);
606
+ this.reason = reason;
607
+ this.context = context;
608
+ this.metadata = metadata;
609
+ this.message = Signals.serializeError(this);
610
+ this.stack = "";
611
+ }
612
+ toString() {
613
+ return Signals.serializeError(this);
614
+ }
615
+ };
616
+ registerErrorClass("VMSignal", VMSignal);
617
+ registerErrorClass("VMLoopSignal", VMLoopSignal);
618
+ registerErrorClass("ThinkSignal", ThinkSignal);
619
+ //#endregion
620
+ Object.defineProperty(exports, "AssignmentError", {
621
+ enumerable: true,
622
+ get: function() {
623
+ return AssignmentError;
624
+ }
625
+ });
626
+ Object.defineProperty(exports, "CodeExecutionError", {
627
+ enumerable: true,
628
+ get: function() {
629
+ return CodeExecutionError;
630
+ }
631
+ });
632
+ Object.defineProperty(exports, "CodeFormattingError", {
633
+ enumerable: true,
634
+ get: function() {
635
+ return CodeFormattingError;
636
+ }
637
+ });
638
+ Object.defineProperty(exports, "CognitiveError", {
639
+ enumerable: true,
640
+ get: function() {
641
+ return CognitiveError;
642
+ }
643
+ });
644
+ Object.defineProperty(exports, "CompactionError", {
645
+ enumerable: true,
646
+ get: function() {
647
+ return CompactionError;
648
+ }
649
+ });
650
+ Object.defineProperty(exports, "ComponentInputError", {
651
+ enumerable: true,
652
+ get: function() {
653
+ return ComponentInputError;
654
+ }
655
+ });
656
+ Object.defineProperty(exports, "DeliveryError", {
657
+ enumerable: true,
658
+ get: function() {
659
+ return DeliveryError;
660
+ }
661
+ });
662
+ Object.defineProperty(exports, "ExecutionAbortedError", {
663
+ enumerable: true,
664
+ get: function() {
665
+ return ExecutionAbortedError;
666
+ }
667
+ });
668
+ Object.defineProperty(exports, "ExitInputError", {
669
+ enumerable: true,
670
+ get: function() {
671
+ return ExitInputError;
672
+ }
673
+ });
674
+ Object.defineProperty(exports, "HookError", {
675
+ enumerable: true,
676
+ get: function() {
677
+ return HookError;
678
+ }
679
+ });
680
+ Object.defineProperty(exports, "HostOperationError", {
681
+ enumerable: true,
682
+ get: function() {
683
+ return HostOperationError;
684
+ }
685
+ });
686
+ Object.defineProperty(exports, "InternalError", {
687
+ enumerable: true,
688
+ get: function() {
689
+ return InternalError;
690
+ }
691
+ });
692
+ Object.defineProperty(exports, "InvalidCodeError", {
693
+ enumerable: true,
694
+ get: function() {
695
+ return InvalidCodeError;
696
+ }
697
+ });
698
+ Object.defineProperty(exports, "InvalidComponentError", {
699
+ enumerable: true,
700
+ get: function() {
701
+ return InvalidComponentError;
702
+ }
703
+ });
704
+ Object.defineProperty(exports, "InvalidConfigurationError", {
705
+ enumerable: true,
706
+ get: function() {
707
+ return InvalidConfigurationError;
708
+ }
709
+ });
710
+ Object.defineProperty(exports, "InvalidEventError", {
711
+ enumerable: true,
712
+ get: function() {
713
+ return InvalidEventError;
714
+ }
715
+ });
716
+ Object.defineProperty(exports, "InvalidExitError", {
717
+ enumerable: true,
718
+ get: function() {
719
+ return InvalidExitError;
720
+ }
721
+ });
722
+ Object.defineProperty(exports, "InvalidMessageError", {
723
+ enumerable: true,
724
+ get: function() {
725
+ return InvalidMessageError;
726
+ }
727
+ });
728
+ Object.defineProperty(exports, "InvalidObjectError", {
729
+ enumerable: true,
730
+ get: function() {
731
+ return InvalidObjectError;
732
+ }
733
+ });
734
+ Object.defineProperty(exports, "InvalidSessionError", {
735
+ enumerable: true,
736
+ get: function() {
737
+ return InvalidSessionError;
738
+ }
739
+ });
740
+ Object.defineProperty(exports, "InvalidToolError", {
741
+ enumerable: true,
742
+ get: function() {
743
+ return InvalidToolError;
744
+ }
745
+ });
746
+ Object.defineProperty(exports, "LLMzError", {
747
+ enumerable: true,
748
+ get: function() {
749
+ return LLMzError;
750
+ }
751
+ });
752
+ Object.defineProperty(exports, "LoopExceededError", {
753
+ enumerable: true,
754
+ get: function() {
755
+ return LoopExceededError;
756
+ }
757
+ });
758
+ Object.defineProperty(exports, "MemoryCapacityError", {
759
+ enumerable: true,
760
+ get: function() {
761
+ return MemoryCapacityError;
762
+ }
763
+ });
764
+ Object.defineProperty(exports, "MemoryValueError", {
765
+ enumerable: true,
766
+ get: function() {
767
+ return MemoryValueError;
768
+ }
769
+ });
770
+ Object.defineProperty(exports, "NativeProtocolError", {
771
+ enumerable: true,
772
+ get: function() {
773
+ return NativeProtocolError;
774
+ }
775
+ });
776
+ Object.defineProperty(exports, "ObjectPropertyError", {
777
+ enumerable: true,
778
+ get: function() {
779
+ return ObjectPropertyError;
780
+ }
781
+ });
782
+ Object.defineProperty(exports, "ReservedIdentifierError", {
783
+ enumerable: true,
784
+ get: function() {
785
+ return ReservedIdentifierError;
786
+ }
787
+ });
788
+ Object.defineProperty(exports, "SessionStateError", {
789
+ enumerable: true,
790
+ get: function() {
791
+ return SessionStateError;
792
+ }
793
+ });
794
+ Object.defineProperty(exports, "Signals", {
795
+ enumerable: true,
796
+ get: function() {
797
+ return Signals;
798
+ }
799
+ });
800
+ Object.defineProperty(exports, "ThinkSignal", {
801
+ enumerable: true,
802
+ get: function() {
803
+ return ThinkSignal;
804
+ }
805
+ });
806
+ Object.defineProperty(exports, "TokenOverflowError", {
807
+ enumerable: true,
808
+ get: function() {
809
+ return TokenOverflowError;
810
+ }
811
+ });
812
+ Object.defineProperty(exports, "ToolExecutionError", {
813
+ enumerable: true,
814
+ get: function() {
815
+ return ToolExecutionError;
816
+ }
817
+ });
818
+ Object.defineProperty(exports, "ToolInputError", {
819
+ enumerable: true,
820
+ get: function() {
821
+ return ToolInputError;
822
+ }
823
+ });
824
+ Object.defineProperty(exports, "UnknownComponentError", {
825
+ enumerable: true,
826
+ get: function() {
827
+ return UnknownComponentError;
828
+ }
829
+ });
830
+ Object.defineProperty(exports, "UnknownExitError", {
831
+ enumerable: true,
832
+ get: function() {
833
+ return UnknownExitError;
834
+ }
835
+ });
836
+ Object.defineProperty(exports, "UnknownToolError", {
837
+ enumerable: true,
838
+ get: function() {
839
+ return UnknownToolError;
840
+ }
841
+ });
842
+ Object.defineProperty(exports, "VMSignal", {
843
+ enumerable: true,
844
+ get: function() {
845
+ return VMSignal;
846
+ }
847
+ });
848
+ Object.defineProperty(exports, "cleanStackTrace", {
849
+ enumerable: true,
850
+ get: function() {
851
+ return cleanStackTrace;
852
+ }
853
+ });
854
+ Object.defineProperty(exports, "describeError", {
855
+ enumerable: true,
856
+ get: function() {
857
+ return describeError;
858
+ }
859
+ });
860
+ Object.defineProperty(exports, "isCriticalError", {
861
+ enumerable: true,
862
+ get: function() {
863
+ return isCriticalError;
864
+ }
865
+ });
866
+ Object.defineProperty(exports, "isLLMzError", {
867
+ enumerable: true,
868
+ get: function() {
869
+ return isLLMzError;
870
+ }
871
+ });