llmz 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/DOCS.md +1 -3
  2. package/dist/_baseForOwn-CFhWe_W6.js +48 -0
  3. package/dist/_baseForOwn-buOZDFbK.cjs +103 -0
  4. package/dist/_baseIteratee-CF4qP2a8.cjs +2377 -0
  5. package/dist/_baseIteratee-P_firB7b.js +2138 -0
  6. package/dist/_getPrototype-CG7Dxrrz.js +6 -0
  7. package/dist/_getPrototype-DQDlNVVM.cjs +10 -0
  8. package/dist/_overArg-C5Hy7oCi.cjs +196 -0
  9. package/dist/_overArg-CRYbj1NH.js +155 -0
  10. package/dist/citations.d.ts +11 -11
  11. package/dist/component-BwixNVH8.cjs +73 -0
  12. package/dist/component-DGG7d_Mz.js +44 -0
  13. package/dist/context.d.ts +8 -8
  14. package/dist/custom-client-BPmEoWKu.cjs +2618 -0
  15. package/dist/custom-client-NUoxrFQh.js +2547 -0
  16. package/dist/dual-modes-D_p-jedw.js +2750 -0
  17. package/dist/dual-modes-wAOAlaBS.cjs +2840 -0
  18. package/dist/errors-C962uJdS.cjs +220 -0
  19. package/dist/errors-Cg1G0Awu.js +161 -0
  20. package/dist/execute-BEaq3jkV.cjs +1003 -0
  21. package/dist/execute-DYvFRs54.js +1001 -0
  22. package/dist/exit-BGi0Kk0y.cjs +428 -0
  23. package/dist/exit-CDdxDBRT.js +417 -0
  24. package/dist/index.cjs +1786 -1489
  25. package/dist/index.d.ts +10 -9
  26. package/dist/index.js +1721 -1479
  27. package/dist/index.workerd.js +17534 -16875
  28. package/dist/isEmpty-BhJRCqIF.js +52 -0
  29. package/dist/isEmpty-LY533Wmh.cjs +57 -0
  30. package/dist/isPlainObject-CSxXVKCk.cjs +56 -0
  31. package/dist/isPlainObject-D39AzPO2.js +51 -0
  32. package/dist/jsx-BWvT6ukg.cjs +75 -0
  33. package/dist/jsx-CIgdGGVs.js +52 -0
  34. package/dist/jsx.d.ts +2 -2
  35. package/dist/prompts/chat-mode/system.md.d.ts +1 -1
  36. package/dist/prompts/chat-mode/user.md.d.ts +1 -1
  37. package/dist/prompts/worker-mode/system.md.d.ts +1 -1
  38. package/dist/prompts/worker-mode/user.md.d.ts +1 -1
  39. package/dist/quickjs-variant-BYhMBpwU.js +45 -0
  40. package/dist/quickjs-variant-CsIwTVFC.cjs +56 -0
  41. package/dist/quickjs-variant.workerd.d.ts +1 -1
  42. package/dist/result.d.ts +12 -12
  43. package/dist/rolldown-runtime-EAsCxrDo.js +14 -0
  44. package/dist/runtime/interpret-result.d.ts +1 -1
  45. package/dist/snapshots.d.ts +5 -5
  46. package/dist/stack-traces-BIE_5Xwf.js +21 -0
  47. package/dist/stack-traces-ntw_qhoy.cjs +26 -0
  48. package/dist/tool-CAo-BQHs.js +643 -0
  49. package/dist/tool-DdPZb0JW.cjs +654 -0
  50. package/dist/tool.d.ts +3 -3
  51. package/dist/truncator-B6aaJaN1.cjs +276 -0
  52. package/dist/truncator-DZqEqnpD.js +253 -0
  53. package/dist/typings-BwAz_TM9.cjs +784 -0
  54. package/dist/typings-CrBa7Tyy.js +743 -0
  55. package/dist/uniq-BYQ7GWwb.js +183 -0
  56. package/dist/uniq-G872RWmE.cjs +200 -0
  57. package/dist/utils-UBeAFeEI.js +950 -0
  58. package/dist/utils-ZpJm00ed.cjs +1075 -0
  59. package/dist/vm/errors.d.ts +2 -2
  60. package/dist/vm-BjkJqSQH.cjs +3438 -0
  61. package/dist/vm-C5vf1LH3.js +3436 -0
  62. package/package.json +7 -7
  63. package/dist/chunk-34GJUS6U.js +0 -3266
  64. package/dist/chunk-3UZKLXAD.cjs +0 -3249
  65. package/dist/chunk-4POZJQXN.js +0 -1530
  66. package/dist/chunk-5WBNTV42.cjs +0 -1530
  67. package/dist/chunk-5ZF6NTYI.cjs +0 -33
  68. package/dist/chunk-72ZWBNZV.js +0 -173
  69. package/dist/chunk-DDSJTR6Q.cjs +0 -257
  70. package/dist/chunk-GDJTKI7J.js +0 -792
  71. package/dist/chunk-GLXADNTR.js +0 -199
  72. package/dist/chunk-GOWPACSK.cjs +0 -199
  73. package/dist/chunk-HB2G32AK.js +0 -257
  74. package/dist/chunk-HC2QZTVT.cjs +0 -3266
  75. package/dist/chunk-HEAQAEFZ.cjs +0 -173
  76. package/dist/chunk-HMMM32RG.cjs +0 -792
  77. package/dist/chunk-I56MPOVG.cjs +0 -62
  78. package/dist/chunk-KIN7Y247.cjs +0 -32
  79. package/dist/chunk-KTDBAJBB.cjs +0 -1685
  80. package/dist/chunk-KWQTYXAT.js +0 -62
  81. package/dist/chunk-LOX7GOR6.js +0 -1685
  82. package/dist/chunk-PK72FAKD.cjs +0 -175
  83. package/dist/chunk-PZE6PIPG.cjs +0 -621
  84. package/dist/chunk-RGUG3UMF.cjs +0 -26
  85. package/dist/chunk-TDALRNGL.js +0 -621
  86. package/dist/chunk-UGHFNCPD.js +0 -26
  87. package/dist/chunk-WSVDMGMR.js +0 -175
  88. package/dist/chunk-XTEHT2TK.js +0 -33
  89. package/dist/chunk-YEAWWJSJ.js +0 -32
  90. package/dist/chunk-YRS7KRKP.js +0 -3249
  91. package/dist/component-2NYFY6CW.cjs +0 -14
  92. package/dist/component-ASNZHQUR.js +0 -14
  93. package/dist/dual-modes-S5TJ5JVJ.js +0 -10
  94. package/dist/dual-modes-TCMWBZIH.cjs +0 -10
  95. package/dist/execute-FF7D46TY.js +0 -1109
  96. package/dist/execute-IK6O4SU2.cjs +0 -1109
  97. package/dist/exit-MX56VN2C.cjs +0 -8
  98. package/dist/exit-UQ3EUX5D.js +0 -8
  99. package/dist/jsx-DDZ63UUF.js +0 -13
  100. package/dist/jsx-ULPWX5TW.cjs +0 -13
  101. package/dist/tool-KD7FL45V.js +0 -11
  102. package/dist/tool-VE2YHIY2.cjs +0 -11
  103. package/dist/truncator-73RCL52Y.js +0 -12
  104. package/dist/truncator-FZNLYSDL.cjs +0 -12
  105. package/dist/typings-E2RROCLT.js +0 -10
  106. package/dist/typings-LQOBZXSO.cjs +0 -10
  107. package/dist/utils-IATCUNKF.js +0 -43
  108. package/dist/utils-ITB4NEL7.cjs +0 -43
  109. package/dist/vm-6D3IIIU7.cjs +0 -12
  110. package/dist/vm-QO5FSGPN.js +0 -12
package/dist/result.d.ts CHANGED
@@ -403,16 +403,16 @@ export declare class SuccessExecutionResult<TOutput = unknown> extends Execution
403
403
  * @returns The JSON representation of the execution result.
404
404
  */
405
405
  toJSON(): {
406
- status: "success";
406
+ status: 'success';
407
407
  context: {
408
408
  id: string;
409
409
  iterations: {
410
410
  id: string;
411
411
  messages: import("@botpress/cognitive").CognitiveMessage[];
412
412
  code: string | undefined;
413
- model: import("@botpress/cognitive").Models | import("@botpress/cognitive").Models[];
413
+ model: import("@botpress/cognitive").Models[] | import("@botpress/cognitive").Models;
414
414
  temperature: number;
415
- reasoningEffort: "low" | "medium" | "high" | "dynamic" | "none" | undefined;
415
+ reasoningEffort: "dynamic" | "high" | "low" | "medium" | "none" | undefined;
416
416
  traces: import("./types.js").Traces.Trace[];
417
417
  variables: Record<string, any>;
418
418
  started_ts: number;
@@ -422,7 +422,7 @@ export declare class SuccessExecutionResult<TOutput = unknown> extends Execution
422
422
  llm: {
423
423
  started_at: number;
424
424
  ended_at: number;
425
- status: "success" | "error";
425
+ status: 'success' | 'error';
426
426
  cached: boolean;
427
427
  tokens: number;
428
428
  spend: number;
@@ -568,16 +568,16 @@ export declare class ErrorExecutionResult extends ExecutionResult implements Ser
568
568
  */
569
569
  get output(): null;
570
570
  toJSON(): {
571
- status: "error";
571
+ status: 'error';
572
572
  context: {
573
573
  id: string;
574
574
  iterations: {
575
575
  id: string;
576
576
  messages: import("@botpress/cognitive").CognitiveMessage[];
577
577
  code: string | undefined;
578
- model: import("@botpress/cognitive").Models | import("@botpress/cognitive").Models[];
578
+ model: import("@botpress/cognitive").Models[] | import("@botpress/cognitive").Models;
579
579
  temperature: number;
580
- reasoningEffort: "low" | "medium" | "high" | "dynamic" | "none" | undefined;
580
+ reasoningEffort: "dynamic" | "high" | "low" | "medium" | "none" | undefined;
581
581
  traces: import("./types.js").Traces.Trace[];
582
582
  variables: Record<string, any>;
583
583
  started_ts: number;
@@ -587,7 +587,7 @@ export declare class ErrorExecutionResult extends ExecutionResult implements Ser
587
587
  llm: {
588
588
  started_at: number;
589
589
  ended_at: number;
590
- status: "success" | "error";
590
+ status: 'success' | 'error';
591
591
  cached: boolean;
592
592
  tokens: number;
593
593
  spend: number;
@@ -753,16 +753,16 @@ export declare class PartialExecutionResult extends ExecutionResult implements S
753
753
  * @returns The JSON representation of the execution result.
754
754
  */
755
755
  toJSON(): {
756
- status: "interrupted";
756
+ status: 'interrupted';
757
757
  context: {
758
758
  id: string;
759
759
  iterations: {
760
760
  id: string;
761
761
  messages: import("@botpress/cognitive").CognitiveMessage[];
762
762
  code: string | undefined;
763
- model: import("@botpress/cognitive").Models | import("@botpress/cognitive").Models[];
763
+ model: import("@botpress/cognitive").Models[] | import("@botpress/cognitive").Models;
764
764
  temperature: number;
765
- reasoningEffort: "low" | "medium" | "high" | "dynamic" | "none" | undefined;
765
+ reasoningEffort: "dynamic" | "high" | "low" | "medium" | "none" | undefined;
766
766
  traces: import("./types.js").Traces.Trace[];
767
767
  variables: Record<string, any>;
768
768
  started_ts: number;
@@ -772,7 +772,7 @@ export declare class PartialExecutionResult extends ExecutionResult implements S
772
772
  llm: {
773
773
  started_at: number;
774
774
  ended_at: number;
775
- status: "success" | "error";
775
+ status: 'success' | 'error';
776
776
  cached: boolean;
777
777
  tokens: number;
778
778
  spend: number;
@@ -0,0 +1,14 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
+ var __exportAll = (all, no_symbols) => {
5
+ let target = {};
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
11
+ return target;
12
+ };
13
+ //#endregion
14
+ export { __exportAll as n, __commonJSMin as t };
@@ -17,6 +17,6 @@ export declare const interpretVMResult: ({ iteration, result, controller, starte
17
17
  export declare const applyNextExit: ({ iteration, controller, onExit, }: {
18
18
  iteration: Iteration;
19
19
  controller: AbortController;
20
- onExit?: ExecutionHooks["onExit"];
20
+ onExit?: ExecutionHooks['onExit'];
21
21
  }) => Promise<void>;
22
22
  export {};
@@ -124,13 +124,13 @@ export declare class Snapshot implements Serializable<Snapshot.JSON> {
124
124
  * @returns The snapshot status (pending, resolved, or rejected)
125
125
  */
126
126
  get status(): Readonly<{
127
- type: "pending";
128
- } | {
129
- type: "resolved";
130
- value: unknown;
127
+ type: 'pending';
131
128
  } | {
132
- type: "rejected";
129
+ type: 'rejected';
133
130
  error: unknown;
131
+ } | {
132
+ type: 'resolved';
133
+ value: unknown;
134
134
  }>;
135
135
  private constructor();
136
136
  /**
@@ -0,0 +1,21 @@
1
+ //#region src/stack-traces.ts
2
+ const isInternalLine = (line) => {
3
+ return line.includes("/llmz/") || line.includes("\\llmz\\src\\") || line.includes("node_modules");
4
+ };
5
+ function cleanStackTrace(stack, cleanInternal = true) {
6
+ let lines = stack.split("\n");
7
+ const until = lines.findIndex((line) => isInternalLine(line));
8
+ if (cleanInternal && until >= 0) lines = lines.slice(0, until);
9
+ else lines = lines.map((line) => {
10
+ let llmzIndex = line.indexOf("/llmz/");
11
+ if (llmzIndex === -1) llmzIndex = line.indexOf("\\llmz\\");
12
+ if (llmzIndex === -1) return line;
13
+ let lastSpaceIndex = line.lastIndexOf(" ", llmzIndex);
14
+ if (lastSpaceIndex === -1) lastSpaceIndex = 0;
15
+ const maybeParen = line[lastSpaceIndex + 1] === "(" ? "(" : "";
16
+ return line.slice(0, lastSpaceIndex + 1) + maybeParen + line.slice(llmzIndex);
17
+ });
18
+ return lines.join("\n");
19
+ }
20
+ //#endregion
21
+ export { cleanStackTrace as t };
@@ -0,0 +1,26 @@
1
+ //#region src/stack-traces.ts
2
+ const isInternalLine = (line) => {
3
+ return line.includes("/llmz/") || line.includes("\\llmz\\src\\") || line.includes("node_modules");
4
+ };
5
+ function cleanStackTrace(stack, cleanInternal = true) {
6
+ let lines = stack.split("\n");
7
+ const until = lines.findIndex((line) => isInternalLine(line));
8
+ if (cleanInternal && until >= 0) lines = lines.slice(0, until);
9
+ else lines = lines.map((line) => {
10
+ let llmzIndex = line.indexOf("/llmz/");
11
+ if (llmzIndex === -1) llmzIndex = line.indexOf("\\llmz\\");
12
+ if (llmzIndex === -1) return line;
13
+ let lastSpaceIndex = line.lastIndexOf(" ", llmzIndex);
14
+ if (lastSpaceIndex === -1) lastSpaceIndex = 0;
15
+ const maybeParen = line[lastSpaceIndex + 1] === "(" ? "(" : "";
16
+ return line.slice(0, lastSpaceIndex + 1) + maybeParen + line.slice(llmzIndex);
17
+ });
18
+ return lines.join("\n");
19
+ }
20
+ //#endregion
21
+ Object.defineProperty(exports, "cleanStackTrace", {
22
+ enumerable: true,
23
+ get: function() {
24
+ return cleanStackTrace;
25
+ }
26
+ });