llmz 0.7.1 → 0.9.0

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 (69) hide show
  1. package/README.md +45 -11
  2. package/dist/{_baseForOwn-buOZDFbK.cjs → _baseForOwn-BfWDTL8L.cjs} +0 -50
  3. package/dist/chat.d.ts +6 -6
  4. package/dist/common-BlRFtdf2.js +807 -0
  5. package/dist/common-BnvrDnIT.cjs +860 -0
  6. package/dist/compiler-C-OI9sim.cjs +547 -0
  7. package/dist/compiler-CW1VjQsn.js +473 -0
  8. package/dist/{component-BwixNVH8.cjs → component-C6Agl2ns.cjs} +3 -3
  9. package/dist/component.d.ts +4 -4
  10. package/dist/component.default.d.ts +70 -87
  11. package/dist/component.default.test.d.ts +1 -0
  12. package/dist/context.d.ts +14 -8
  13. package/dist/{custom-client-CMuy7fXU.js → custom-client-ChuZ63zp.js} +128 -30
  14. package/dist/{custom-client-Bp1TgTKk.cjs → custom-client-DAsGRnYc.cjs} +131 -33
  15. package/dist/{dual-modes-mNyMThtf.js → dual-modes-DDkoCp3R.js} +1771 -1489
  16. package/dist/{dual-modes-CfqTk9M8.cjs → dual-modes-DPXiuvNe.cjs} +1767 -1491
  17. package/dist/example-format.d.ts +8 -0
  18. package/dist/example.d.ts +45 -0
  19. package/dist/example.test.d.ts +1 -0
  20. package/dist/{execute-DP_17lYZ.js → execute-BWcdv9so.js} +77 -85
  21. package/dist/{execute-msui51b2.cjs → execute-DM2-7y86.cjs} +83 -92
  22. package/dist/{exit-BGi0Kk0y.cjs → exit-DUM96DN1.cjs} +3 -3
  23. package/dist/exit-parser.d.ts +2 -0
  24. package/dist/index.cjs +137 -217
  25. package/dist/index.d.ts +2 -0
  26. package/dist/index.js +115 -196
  27. package/dist/index.workerd.js +16664 -15533
  28. package/dist/inspect.d.ts +2 -0
  29. package/dist/{jsx-BWvT6ukg.cjs → jsx-owqxrquU.cjs} +2 -2
  30. package/dist/message-stream/instructions.d.ts +8 -0
  31. package/dist/message-stream/parser.d.ts +9 -0
  32. package/dist/message-stream/response-parser.d.ts +24 -0
  33. package/dist/message-stream/response-parser.test.d.ts +1 -0
  34. package/dist/message-stream/types.d.ts +3 -2
  35. package/dist/prompts/adherence.test.d.ts +1 -0
  36. package/dist/prompts/catalogue-examples.test.d.ts +1 -0
  37. package/dist/prompts/chat-mode/protocol.d.ts +2 -0
  38. package/dist/prompts/chat-mode/system.d.ts +2 -0
  39. package/dist/prompts/chat-mode/user.d.ts +2 -0
  40. package/dist/prompts/code-examples.d.ts +2 -0
  41. package/dist/prompts/code-examples.test.d.ts +1 -0
  42. package/dist/prompts/common.d.ts +2 -1
  43. package/dist/prompts/concrete-patterns.test.d.ts +1 -0
  44. package/dist/prompts/execution-history.d.ts +6 -0
  45. package/dist/prompts/execution-state.d.ts +3 -0
  46. package/dist/prompts/long-search.test.d.ts +1 -0
  47. package/dist/prompts/prompt.d.ts +31 -2
  48. package/dist/prompts/protocol-basics.d.ts +5 -0
  49. package/dist/prompts/protocol-simple.test.d.ts +1 -0
  50. package/dist/prompts/protocol.d.ts +13 -0
  51. package/dist/prompts/protocol.test.d.ts +1 -0
  52. package/dist/prompts/sections.test.d.ts +1 -0
  53. package/dist/prompts/worker-mode/protocol.d.ts +2 -0
  54. package/dist/prompts/worker-mode/system.d.ts +2 -0
  55. package/dist/prompts/worker-mode/user.d.ts +2 -0
  56. package/dist/runtime/citations.test.d.ts +1 -0
  57. package/dist/runtime/fixtures/long-search.d.ts +19 -0
  58. package/dist/runtime/fixtures/protocol-languages.d.ts +74 -0
  59. package/dist/runtime/fixtures/qwen-protocol-failures.d.ts +29 -0
  60. package/dist/runtime/generate.d.ts +2 -9
  61. package/dist/runtime/protocol-adherence.test.d.ts +1 -0
  62. package/dist/runtime/types.d.ts +13 -7
  63. package/dist/{tool-ReA9gxMp.cjs → tool-Dy6AJpJH.cjs} +4 -4
  64. package/dist/{truncator-B6aaJaN1.cjs → truncator-CLkouTCO.cjs} +3 -3
  65. package/dist/{typings-BwAz_TM9.cjs → typings-3lsqCbkn.cjs} +3 -3
  66. package/dist/{utils-ZpJm00ed.cjs → utils-3ESwP3yg.cjs} +2 -2
  67. package/dist/{vm-C5vf1LH3.js → vm-BLsHw1da.js} +3 -462
  68. package/dist/{vm-BjkJqSQH.cjs → vm-D6s1zF6M.cjs} +28 -489
  69. package/package.json +1 -1
@@ -1,18 +1,19 @@
1
- const require__baseForOwn = require("./_baseForOwn-buOZDFbK.cjs");
2
- const require_dual_modes = require("./dual-modes-CfqTk9M8.cjs");
3
- const require_custom_client = require("./custom-client-Bp1TgTKk.cjs");
4
- const require_utils = require("./utils-ZpJm00ed.cjs");
5
- const require_jsx = require("./jsx-BWvT6ukg.cjs");
1
+ const require_compiler = require("./compiler-C-OI9sim.cjs");
2
+ const require_dual_modes = require("./dual-modes-DPXiuvNe.cjs");
3
+ const require_common = require("./common-BnvrDnIT.cjs");
4
+ const require_custom_client = require("./custom-client-DAsGRnYc.cjs");
5
+ const require_utils = require("./utils-3ESwP3yg.cjs");
6
+ const require_jsx = require("./jsx-owqxrquU.cjs");
6
7
  const require_stack_traces = require("./stack-traces-ntw_qhoy.cjs");
7
8
  const require_errors = require("./errors-C962uJdS.cjs");
8
- const require_truncator = require("./truncator-B6aaJaN1.cjs");
9
- const require_vm = require("./vm-BjkJqSQH.cjs");
9
+ const require_truncator = require("./truncator-CLkouTCO.cjs");
10
+ const require_vm = require("./vm-D6s1zF6M.cjs");
10
11
  let _bpinternal_zui = require("@bpinternal/zui");
11
12
  let ulid = require("ulid");
12
13
  let _botpress_client = require("@botpress/client");
13
14
  let _botpress_cognitive = require("@botpress/cognitive");
14
15
  let ms = require("ms");
15
- ms = require__baseForOwn.__toESM(ms, 1);
16
+ ms = require_compiler.__toESM(ms, 1);
16
17
  //#region ../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseClamp.js
17
18
  /**
18
19
  * The base implementation of `_.clamp` which doesn't coerce arguments.
@@ -128,35 +129,7 @@ const assertSuccessfulGeneration = (metadata) => {
128
129
  if (metadata.stopReason === "max_tokens" || metadata.stopReason === "content_filter") throw new require_errors.CognitiveError(`LLM generation did not complete: stopReason=${metadata.stopReason}`);
129
130
  };
130
131
  const getModelOutputLimit = (inputLength) => clamp(RESPONSE_LENGTH_BUFFER.PERCENTAGE * inputLength, RESPONSE_LENGTH_BUFFER.MIN_TOKENS, RESPONSE_LENGTH_BUFFER.MAX_TOKENS);
131
- /**
132
- * Models sometimes wrap their whole response in a code fence. The fence has to
133
- * be removed before it reaches the incremental parser to avoid a spurious
134
- * unexpected-text diagnostic. Works on arbitrary chunk boundaries
135
- * by holding content back until the first newline.
136
- */
137
- var LeadingFenceFilter = class {
138
- _buffer = "";
139
- _done = false;
140
- push(text) {
141
- if (this._done) return text;
142
- this._buffer += text;
143
- const newline = this._buffer.indexOf("\n");
144
- if (newline === -1) return "";
145
- this._done = true;
146
- const firstLine = this._buffer.slice(0, newline);
147
- const rest = this._buffer.slice(newline + 1);
148
- this._buffer = "";
149
- return firstLine.trim().startsWith("```") ? rest : `${firstLine}\n${rest}`;
150
- }
151
- flush() {
152
- if (this._done) return "";
153
- this._done = true;
154
- const buffered = this._buffer;
155
- this._buffer = "";
156
- return buffered.trim().startsWith("```") ? "" : buffered;
157
- }
158
- };
159
- const generateCode = async ({ iteration, ctx, cognitive, controller, metadata, onSend, onSendDelta, onRunStart, onRunComplete }) => {
132
+ const generateCode = async ({ iteration, ctx, cognitive, controller, metadata, onSend, onSendDelta, onRunStart }) => {
160
133
  const startedAt = Date.now();
161
134
  const traces = iteration.traces;
162
135
  const modelRef = Array.isArray(iteration.model) ? iteration.model[0] : iteration.model;
@@ -219,6 +192,7 @@ const generateCode = async ({ iteration, ctx, cognitive, controller, metadata, o
219
192
  const liveContent = /* @__PURE__ */ new Map();
220
193
  let codeGenerationTraced = false;
221
194
  let runCompleted = false;
195
+ let completions = [];
222
196
  const dispatchSends = async (events) => {
223
197
  for (const event of events) if (event.type === "item-start") {
224
198
  liveItems.set(event.item.id, event.item);
@@ -232,7 +206,7 @@ const generateCode = async ({ iteration, ctx, cognitive, controller, metadata, o
232
206
  }
233
207
  } else if (event.type === "body-delta" && onSendDelta) {
234
208
  const item = liveItems.get(event.itemId);
235
- if ((item === null || item === void 0 ? void 0 : item.kind) !== "send") continue;
209
+ if ((item === null || item === void 0 ? void 0 : item.kind) !== "send" || runCompleted) continue;
236
210
  const content = (liveContent.get(item.id) ?? "") + event.delta;
237
211
  liveContent.set(item.id, content);
238
212
  const delta = {
@@ -245,21 +219,19 @@ const generateCode = async ({ iteration, ctx, cognitive, controller, metadata, o
245
219
  };
246
220
  await preview(delta);
247
221
  } else if (event.type === "item-complete") {
248
- if (event.item.kind === "send" && onSend) await onSend({
249
- name: event.item.name,
250
- props: event.item.props,
251
- body: event.item.body
252
- }, messageMetadata(event.item.id));
253
- else if (event.item.kind === "run" && event.item.status === "complete" && !runCompleted) {
254
- runCompleted = true;
255
- const code = (event.item.body ?? "").trim();
256
- onRunComplete === null || onRunComplete === void 0 || onRunComplete(code);
257
- }
222
+ if (event.item.kind === "send" && onSend && !runCompleted) {
223
+ const send = {
224
+ name: event.item.name,
225
+ props: event.item.props,
226
+ body: event.item.body
227
+ };
228
+ const metadata = messageMetadata(event.item.id);
229
+ completions.push(() => onSend(send, metadata));
230
+ } else if (event.item.kind === "run" && event.item.status === "complete" && !runCompleted) runCompleted = true;
258
231
  }
259
232
  };
260
233
  if (typeof cognitive.generateTextStream === "function") {
261
- let parser = new require_dual_modes.StreamingMessageParser();
262
- let fence = new LeadingFenceFilter();
234
+ let parser = new require_common.ResponseParser();
263
235
  const streamController = createJoinedAbortController([controller.signal]);
264
236
  const requestedAt = Date.now();
265
237
  const stream = cognitive.generateTextStream({
@@ -287,6 +259,7 @@ const generateCode = async ({ iteration, ctx, cognitive, controller, metadata, o
287
259
  };
288
260
  raw = "";
289
261
  let streamCompleted = false;
262
+ let accepted = false;
290
263
  try {
291
264
  while (true) {
292
265
  var _chunk$value, _chunk$value2, _chunk$value3, _chunk$value4;
@@ -311,8 +284,9 @@ const generateCode = async ({ iteration, ctx, cognitive, controller, metadata, o
311
284
  ...chunk.value.restart
312
285
  });
313
286
  raw = "";
314
- parser = new require_dual_modes.StreamingMessageParser();
315
- fence = new LeadingFenceFilter();
287
+ completions = [];
288
+ accepted = false;
289
+ parser = new require_common.ResponseParser();
316
290
  liveItems.clear();
317
291
  liveContent.clear();
318
292
  codeGenerationTraced = false;
@@ -334,19 +308,52 @@ const generateCode = async ({ iteration, ctx, cognitive, controller, metadata, o
334
308
  timeToLastToken = Date.now() - requestedAt;
335
309
  timeToFirstToken ??= timeToLastToken;
336
310
  raw += delta;
337
- await dispatchSends(parser.push(fence.push(delta)));
311
+ await dispatchSends(parser.push(delta));
338
312
  }
339
313
  if (!responseMetadata) throw new require_errors.CognitiveError("LLM streaming completed without metadata");
340
314
  assertSuccessfulGeneration(responseMetadata);
341
- const remaining = fence.flush();
342
- if (remaining) await dispatchSends(parser.push(remaining));
343
- await dispatchSends(parser.finish());
344
- assistantResponse = require_dual_modes.toParsedAssistantResponse(parser.items, raw, parser.diagnostics);
315
+ await dispatchSends(parser.finish(responseMetadata.stopReason));
316
+ if (parser.valid) {
317
+ for (const complete of completions) await complete();
318
+ accepted = true;
319
+ }
320
+ assistantResponse = require_common.toParsedAssistantResponse(parser.items, raw, parser.diagnostics);
321
+ } catch (error) {
322
+ parser.finish();
323
+ const usage = (responseMetadata === null || responseMetadata === void 0 ? void 0 : responseMetadata.usage) ?? {
324
+ inputTokens: 0,
325
+ outputTokens: 0,
326
+ inputCost: 0,
327
+ outputCost: 0
328
+ };
329
+ iteration.llm = {
330
+ started_at: startedAt,
331
+ ended_at: Date.now(),
332
+ status: "error",
333
+ cached: (responseMetadata === null || responseMetadata === void 0 ? void 0 : responseMetadata.cached) ?? false,
334
+ tokens: usage.inputTokens + usage.outputTokens,
335
+ spend: (responseMetadata === null || responseMetadata === void 0 ? void 0 : responseMetadata.cost) ?? usage.inputCost + usage.outputCost,
336
+ output: raw,
337
+ diagnostics: parser.diagnostics,
338
+ model: (responseMetadata === null || responseMetadata === void 0 ? void 0 : responseMetadata.model) ?? model.id,
339
+ time_to_first_token: timeToFirstToken,
340
+ time_to_last_token: timeToLastToken,
341
+ usage
342
+ };
343
+ throw error;
345
344
  } finally {
346
345
  streamController.abort("LLM stream closed");
347
346
  if (!streamCompleted) stream.return(void 0).catch((err) => {});
347
+ if (!accepted && liveContent.size) await preview({
348
+ restart: true,
349
+ iterationId: iteration.id,
350
+ attempt: attempt + 1,
351
+ fromModel: model.id,
352
+ toModel: model.id,
353
+ reason: "invalid or incomplete response envelope"
354
+ });
348
355
  }
349
- if (midStreamFallback) controller.signal.throwIfAborted();
356
+ controller.signal.throwIfAborted();
350
357
  } else {
351
358
  const response = await cognitive.generateText(input, { signal: controller.signal }).catch((thrown) => {
352
359
  throw new require_errors.CognitiveError(`LLM generation failed: ${require_utils.getErrorMessage(thrown)}`);
@@ -356,7 +363,7 @@ const generateCode = async ({ iteration, ctx, cognitive, controller, metadata, o
356
363
  responseMetadata = response.metadata;
357
364
  assertSuccessfulGeneration(responseMetadata);
358
365
  raw = response.output;
359
- assistantResponse = ctx.version.parseAssistantResponse(raw);
366
+ assistantResponse = ctx.version.parseAssistantResponse(raw, responseMetadata.stopReason);
360
367
  for (const [index, send] of assistantResponse.sends.entries()) await (onSend === null || onSend === void 0 ? void 0 : onSend(send, messageMetadata(`send-${index}`)));
361
368
  }
362
369
  iteration.code = assistantResponse.code;
@@ -398,6 +405,7 @@ const generateCode = async ({ iteration, ctx, cognitive, controller, metadata, o
398
405
  //#endregion
399
406
  //#region src/runtime/interpret-result.ts
400
407
  const interpretVMResult = async ({ iteration, result, controller, startedAt, onExit }) => {
408
+ Object.assign(iteration.variables, Object.fromEntries(Object.entries(result.variables ?? {}).filter(([, value]) => value !== "[[non-primitive]]")));
401
409
  if (result.error && result.error instanceof require_errors.InvalidCodeError) {
402
410
  iteration.end({
403
411
  type: "invalid_code_error",
@@ -445,7 +453,8 @@ const interpretVMResult = async ({ iteration, result, controller, startedAt, onE
445
453
  thinking_requested: {
446
454
  variables: result.signal.context,
447
455
  reason: result.signal.reason,
448
- metadata: result.signal.metadata
456
+ metadata: result.signal.metadata,
457
+ interrupted: true
449
458
  }
450
459
  });
451
460
  return;
@@ -458,7 +467,7 @@ const interpretVMResult = async ({ iteration, result, controller, startedAt, onE
458
467
  return;
459
468
  }
460
469
  const returnValue = result.return_value;
461
- const codeRequestsInspection = require_vm.hasTopLevelReturn(iteration.code ?? "");
470
+ const codeRequestsInspection = require_compiler.hasTopLevelReturn(iteration.code ?? "");
462
471
  if (iteration.next && !codeRequestsInspection) {
463
472
  await applyNextExit({
464
473
  iteration,
@@ -506,11 +515,14 @@ const applyNextExit = async ({ iteration, controller, onExit }) => {
506
515
  value: parsedExit.success ? parsedExit.value : next.props
507
516
  };
508
517
  if (!parsedExit.success) {
518
+ var _parsedExit$validatio;
519
+ const details = (_parsedExit$validatio = parsedExit.validationErrors) === null || _parsedExit$validatio === void 0 ? void 0 : _parsedExit$validatio.join("; ");
520
+ const error = [parsedExit.error.split("\n")[0], details].filter(Boolean).join(". ");
509
521
  iteration.end({
510
522
  type: "exit_error",
511
523
  exit_error: {
512
524
  exit: next.name,
513
- message: parsedExit.error,
525
+ message: `${error}. Received props: ${JSON.stringify(next.props)}. Choose an exit from <exits> and supply its required props as ONE JSON object on the SAME LINE as ■next=${next.name}. Do not use a JavaScript return statement or wrap the fields in "value" or "props".`,
514
526
  return_value: returnValue
515
527
  }
516
528
  });
@@ -750,6 +762,7 @@ const executeContextInternal = async (props) => {
750
762
  const ctx = new require_custom_client.Context({
751
763
  chat: props.chat,
752
764
  instructions: props.instructions,
765
+ examples: props.examples,
753
766
  objects: props.objects,
754
767
  tools: props.tools,
755
768
  loop: (_props$options = props.options) === null || _props$options === void 0 ? void 0 : _props$options.loop,
@@ -950,8 +963,6 @@ const executeIteration = async ({ iteration, ctx, cognitive, controller, onExit,
950
963
  };
951
964
  });
952
965
  };
953
- const canExecuteEarly = typeof onBeforeExecution !== "function" && !ctx.midStreamFallback;
954
- let earlyExecution;
955
966
  await generateCode({
956
967
  iteration,
957
968
  ctx,
@@ -959,22 +970,15 @@ const executeIteration = async ({ iteration, ctx, cognitive, controller, onExit,
959
970
  controller,
960
971
  metadata,
961
972
  onRunStart: () => require_vm.warmupVM(),
962
- onRunComplete: canExecuteEarly ? (code) => {
963
- if (!code.length || controller.signal.aborted || earlyExecution) return;
964
- iteration.code = code;
965
- earlyExecution = {
966
- code,
967
- started_at: Date.now(),
968
- promise: runCode(code)
969
- };
970
- } : void 0,
971
973
  onSend: async (send, messageMetadata) => {
972
974
  if (!ctx.chat) return;
973
975
  const sendStartedAt = Date.now();
974
- const component = require_jsx.createJsxComponent({
976
+ const registered = iteration.components.find((component) => component.definition.name.toLowerCase() === send.name);
977
+ const children = send.body ? [send.body] : [];
978
+ const component = registered ? registered.render(send.props, children) : require_jsx.createJsxComponent({
975
979
  type: send.name,
976
980
  props: send.props,
977
- children: send.body ? [send.body] : []
981
+ children
978
982
  });
979
983
  try {
980
984
  await ctx.chat.handler(component, messageMetadata);
@@ -990,7 +994,6 @@ const executeIteration = async ({ iteration, ctx, cognitive, controller, onExit,
990
994
  },
991
995
  onSendDelta: ((_ctx$chat = ctx.chat) === null || _ctx$chat === void 0 ? void 0 : _ctx$chat.onMessageDelta) ? (delta) => ctx.chat.onMessageDelta(delta) : void 0
992
996
  });
993
- if (earlyExecution) iteration.code = earlyExecution.code;
994
997
  if (typeof onBeforeExecution === "function") try {
995
998
  const hookRes = await onBeforeExecution(iteration, controller);
996
999
  if (typeof (hookRes === null || hookRes === void 0 ? void 0 : hookRes.code) === "string" && hookRes.code.trim().length > 0) iteration.code = hookRes.code.trim();
@@ -1028,7 +1031,7 @@ const executeIteration = async ({ iteration, ctx, cognitive, controller, onExit,
1028
1031
  return;
1029
1032
  }
1030
1033
  if (!iteration.code) {
1031
- var _iteration$sends;
1034
+ var _iteration$llm;
1032
1035
  if (iteration.next) {
1033
1036
  await applyNextExit({
1034
1037
  iteration,
@@ -1037,26 +1040,14 @@ const executeIteration = async ({ iteration, ctx, cognitive, controller, onExit,
1037
1040
  });
1038
1041
  return;
1039
1042
  }
1040
- if (ctx.chat && ((_iteration$sends = iteration.sends) === null || _iteration$sends === void 0 ? void 0 : _iteration$sends.length)) {
1041
- iteration.next = {
1042
- name: "listen",
1043
- props: {}
1044
- };
1045
- await applyNextExit({
1046
- iteration,
1047
- controller,
1048
- onExit
1049
- });
1050
- return;
1051
- }
1052
1043
  iteration.end({
1053
1044
  type: "invalid_code_error",
1054
- invalid_code_error: { message: "The response did not include a ■run block or a ■next exit. Reply using ■ blocks and end your response with ■run or ■next=<exit>." }
1045
+ invalid_code_error: { message: ((_iteration$llm = iteration.llm) === null || _iteration$llm === void 0 || (_iteration$llm = _iteration$llm.diagnostics) === null || _iteration$llm === void 0 || (_iteration$llm = _iteration$llm.find((diagnostic) => diagnostic.code === "invalid-envelope")) === null || _iteration$llm === void 0 ? void 0 : _iteration$llm.message) ?? "The response did not include a ■run block or a ■next exit. Reply with ■start, the required ■ blocks, and ■end." }
1055
1046
  });
1056
1047
  return;
1057
1048
  }
1058
- const startedAt = (earlyExecution === null || earlyExecution === void 0 ? void 0 : earlyExecution.started_at) ?? Date.now();
1059
- const result = earlyExecution ? await earlyExecution.promise : await runCode(iteration.code ?? "");
1049
+ const startedAt = Date.now();
1050
+ const result = await runCode(iteration.code);
1060
1051
  await interpretVMResult({
1061
1052
  iteration,
1062
1053
  result,
@@ -1,9 +1,9 @@
1
- const require__baseForOwn = require("./_baseForOwn-buOZDFbK.cjs");
1
+ const require_compiler = require("./compiler-C-OI9sim.cjs");
2
2
  const require_uniq = require("./uniq-G872RWmE.cjs");
3
- const require_utils = require("./utils-ZpJm00ed.cjs");
3
+ const require_utils = require("./utils-3ESwP3yg.cjs");
4
4
  let _bpinternal_zui = require("@bpinternal/zui");
5
5
  //#region src/exit.ts
6
- var exit_exports = /* @__PURE__ */ require__baseForOwn.__exportAll({ Exit: () => Exit });
6
+ var exit_exports = /* @__PURE__ */ require_compiler.__exportAll({ Exit: () => Exit });
7
7
  /**
8
8
  * Defines how LLMz agent execution can terminate.
9
9
  *
@@ -9,6 +9,8 @@ export type ParsedExit = {
9
9
  } | {
10
10
  success: false;
11
11
  error: string;
12
+ /** Field-level schema errors, separate from the legacy return-statement guidance. */
13
+ validationErrors?: string[];
12
14
  returnValue: unknown;
13
15
  };
14
16
  /**