llmz 0.0.50 → 0.0.52
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.
- package/dist/{chunk-LQ3UXHYZ.cjs → chunk-D3JSHTIK.cjs} +17 -17
- package/dist/{chunk-SO5KKTLS.js → chunk-GPXZL4YV.js} +2 -2
- package/dist/{chunk-6FIFHRRZ.js → chunk-M4WTTARE.js} +1 -1
- package/dist/{chunk-EZIXRZMP.cjs → chunk-MDMLCSOZ.cjs} +11 -11
- package/dist/{chunk-IUP5LRT4.cjs → chunk-UCXQ4U7P.cjs} +1 -1
- package/dist/{chunk-26OZSB5J.js → chunk-WTWIJ2LI.js} +1 -1
- package/dist/{dual-modes-6CLTZG3Q.cjs → dual-modes-FTHFPWZ4.cjs} +3 -3
- package/dist/{dual-modes-EKDIUFRD.js → dual-modes-GCL2U7YL.js} +2 -2
- package/dist/index.cjs +11 -11
- package/dist/index.js +8 -8
- package/dist/{llmz-XJUAO7RZ.js → llmz-566HNZLM.js} +3 -3
- package/dist/{llmz-USOWH35H.cjs → llmz-OJCGD4CI.cjs} +14 -14
- package/dist/{truncator-KR74EP5W.js → truncator-2FSONJM2.js} +1 -1
- package/dist/truncator-6M2EP2NZ.cjs +10 -0
- package/package.json +4 -4
- package/dist/truncator-225BRYWF.cjs +0 -10
|
@@ -6,7 +6,7 @@ var _chunkKIN7Y247cjs = require('./chunk-KIN7Y247.cjs');
|
|
|
6
6
|
var _chunkTLOQBZKWcjs = require('./chunk-TLOQBZKW.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkUCXQ4U7Pcjs = require('./chunk-UCXQ4U7P.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -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":
|
|
511
|
+
"tools.d.ts": _chunkUCXQ4U7Pcjs.wrapContent.call(void 0, dts, {
|
|
512
512
|
preserve: "both",
|
|
513
513
|
minTokens: 500
|
|
514
514
|
}),
|
|
515
|
-
identity:
|
|
515
|
+
identity: _chunkUCXQ4U7Pcjs.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:
|
|
519
|
+
transcript: _chunkUCXQ4U7Pcjs.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:
|
|
528
|
+
components: _chunkUCXQ4U7Pcjs.wrapContent.call(void 0,
|
|
529
529
|
props.components.map((component) => _chunkTLOQBZKWcjs.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
|
-
${
|
|
606
|
+
${_chunkUCXQ4U7Pcjs.wrapContent.call(void 0, props.code)}
|
|
607
607
|
\u25A0fn_end
|
|
608
608
|
\`\`\`
|
|
609
609
|
|
|
610
610
|
Error:
|
|
611
611
|
\`\`\`
|
|
612
|
-
${
|
|
612
|
+
${_chunkUCXQ4U7Pcjs.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
|
-
${
|
|
635
|
+
${_chunkUCXQ4U7Pcjs.wrapContent.call(void 0, props.message, { preserve: "top", flex: 4 })}
|
|
636
636
|
|
|
637
637
|
Stack Trace:
|
|
638
638
|
\`\`\`
|
|
639
|
-
${
|
|
639
|
+
${_chunkUCXQ4U7Pcjs.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 ${
|
|
662
|
+
acc.push(`Value of ${key} is ${_chunkUCXQ4U7Pcjs.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 ${
|
|
673
|
+
return `Value at index ${index} is ${_chunkUCXQ4U7Pcjs.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
|
-
${
|
|
691
|
+
${_chunkUCXQ4U7Pcjs.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
|
-
// ${
|
|
710
|
+
// ${_chunkUCXQ4U7Pcjs.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
|
-
// ${
|
|
716
|
+
// ${_chunkUCXQ4U7Pcjs.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 =
|
|
722
|
+
const output = _chunkUCXQ4U7Pcjs.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
|
-
${
|
|
744
|
+
${_chunkUCXQ4U7Pcjs.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 =
|
|
767
|
+
const output = _chunkUCXQ4U7Pcjs.wrapContent.call(void 0, _nullishCoalesce(errorMessage.split("\n").join("\n * "), () => ( "Unknown Error")), {
|
|
768
768
|
preserve: "both",
|
|
769
769
|
minTokens: 100
|
|
770
770
|
});
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DualModePrompt,
|
|
3
3
|
extractType,
|
|
4
4
|
inspect
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WTWIJ2LI.js";
|
|
6
6
|
import {
|
|
7
7
|
Tool
|
|
8
8
|
} from "./chunk-L2ZDZKCB.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-UOENUUUV.js";
|
|
18
18
|
import {
|
|
19
19
|
wrapContent
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-M4WTTARE.js";
|
|
21
21
|
import {
|
|
22
22
|
cloneDeep_default,
|
|
23
23
|
isPlainObject_default,
|
|
@@ -86,7 +86,7 @@ function truncateWrappedContent({
|
|
|
86
86
|
toRemove = biggest.tokens - (((_b = biggest.attributes) == null ? void 0 : _b.minTokens) ?? 0);
|
|
87
87
|
}
|
|
88
88
|
const preserve = ((_c = biggest.attributes) == null ? void 0 : _c.preserve) ?? DEFAULT_TRUNCATE_OPTIONS.preserve;
|
|
89
|
-
const split = tokenizer.
|
|
89
|
+
const split = tokenizer.splitAndSlice(biggest.content);
|
|
90
90
|
if (preserve === "bottom") {
|
|
91
91
|
biggest.content = split.slice(toRemove).join("");
|
|
92
92
|
} else if (preserve === "top") {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkD3JSHTIKcjs = require('./chunk-D3JSHTIK.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkSZLX27VXcjs = require('./chunk-SZLX27VX.cjs');
|
|
@@ -17,7 +17,7 @@ var _chunkF4OZHUMScjs = require('./chunk-F4OZHUMS.cjs');
|
|
|
17
17
|
var _chunkTLOQBZKWcjs = require('./chunk-TLOQBZKW.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkUCXQ4U7Pcjs = require('./chunk-UCXQ4U7P.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -493,10 +493,10 @@ var Snapshot = class _Snapshot {
|
|
|
493
493
|
};
|
|
494
494
|
function parseVariables(variableMap) {
|
|
495
495
|
return Object.entries(variableMap).map(([name, value]) => {
|
|
496
|
-
const type =
|
|
496
|
+
const type = _chunkD3JSHTIKcjs.extractType.call(void 0, value);
|
|
497
497
|
const bytes = JSON.stringify(value || "").length;
|
|
498
498
|
const truncated = bytes > MAX_SNAPSHOT_SIZE_BYTES;
|
|
499
|
-
return truncated ? { name, type, bytes, truncated: true, preview: _nullishCoalesce(
|
|
499
|
+
return truncated ? { name, type, bytes, truncated: true, preview: _nullishCoalesce(_chunkD3JSHTIKcjs.inspect.call(void 0, value, name), () => ( "N/A")) } : { name, type, bytes, truncated: false, value };
|
|
500
500
|
});
|
|
501
501
|
}
|
|
502
502
|
|
|
@@ -507,9 +507,9 @@ function getMessagePreview(message) {
|
|
|
507
507
|
return message.content;
|
|
508
508
|
}
|
|
509
509
|
if (message.role === "event") {
|
|
510
|
-
return
|
|
510
|
+
return _chunkD3JSHTIKcjs.inspect.call(void 0, message.payload, message.name, { tokens: 1e3 });
|
|
511
511
|
}
|
|
512
|
-
return
|
|
512
|
+
return _chunkD3JSHTIKcjs.inspect.call(void 0, message, void 0, { tokens: 1e3 });
|
|
513
513
|
}
|
|
514
514
|
function getMessageType(message) {
|
|
515
515
|
if (message.role === "assistant" || message.role === "user" || message.role === "summary") {
|
|
@@ -1098,7 +1098,7 @@ var Context = (_class2 = class {
|
|
|
1098
1098
|
|
|
1099
1099
|
|
|
1100
1100
|
|
|
1101
|
-
__init3() {this.version =
|
|
1101
|
+
__init3() {this.version = _chunkD3JSHTIKcjs.DualModePrompt}
|
|
1102
1102
|
__init4() {this.timeout = 6e4}
|
|
1103
1103
|
// Default timeout of 60 seconds
|
|
1104
1104
|
|
|
@@ -1219,7 +1219,7 @@ var Context = (_class2 = class {
|
|
|
1219
1219
|
...lastIterationMessages,
|
|
1220
1220
|
{
|
|
1221
1221
|
role: "assistant",
|
|
1222
|
-
content:
|
|
1222
|
+
content: _chunkUCXQ4U7Pcjs.wrapContent.call(void 0, _nullishCoalesce(((_c = lastIteration.llm) == null ? void 0 : _c.output), () => ( "")), { preserve: "top", flex: 4, minTokens: 25 })
|
|
1223
1223
|
},
|
|
1224
1224
|
await this.version.getThinkingMessage({
|
|
1225
1225
|
reason: lastIteration.status.thinking_requested.reason,
|
|
@@ -1232,7 +1232,7 @@ var Context = (_class2 = class {
|
|
|
1232
1232
|
...lastIterationMessages,
|
|
1233
1233
|
{
|
|
1234
1234
|
role: "assistant",
|
|
1235
|
-
content:
|
|
1235
|
+
content: _chunkUCXQ4U7Pcjs.wrapContent.call(void 0, _nullishCoalesce(((_d = lastIteration.llm) == null ? void 0 : _d.output), () => ( "")), { preserve: "top", flex: 4, minTokens: 25 })
|
|
1236
1236
|
},
|
|
1237
1237
|
await this.version.getInvalidCodeMessage({
|
|
1238
1238
|
code: _nullishCoalesce(lastIteration.code, () => ( "// No code generated")),
|
|
@@ -1245,7 +1245,7 @@ var Context = (_class2 = class {
|
|
|
1245
1245
|
...lastIterationMessages,
|
|
1246
1246
|
{
|
|
1247
1247
|
role: "assistant",
|
|
1248
|
-
content:
|
|
1248
|
+
content: _chunkUCXQ4U7Pcjs.wrapContent.call(void 0, _nullishCoalesce(((_e = lastIteration.llm) == null ? void 0 : _e.output), () => ( "")), { preserve: "top", flex: 4, minTokens: 25 })
|
|
1249
1249
|
},
|
|
1250
1250
|
await this.version.getInvalidCodeMessage({
|
|
1251
1251
|
code: _nullishCoalesce(lastIteration.code, () => ( "// No code generated")),
|
|
@@ -1258,7 +1258,7 @@ var Context = (_class2 = class {
|
|
|
1258
1258
|
...lastIterationMessages,
|
|
1259
1259
|
{
|
|
1260
1260
|
role: "assistant",
|
|
1261
|
-
content:
|
|
1261
|
+
content: _chunkUCXQ4U7Pcjs.wrapContent.call(void 0, _nullishCoalesce(((_f = lastIteration.llm) == null ? void 0 : _f.output), () => ( "")), { preserve: "top", flex: 4, minTokens: 25 })
|
|
1262
1262
|
},
|
|
1263
1263
|
await this.version.getCodeExecutionErrorMessage({
|
|
1264
1264
|
message: lastIteration.status.execution_error.message,
|
|
@@ -86,7 +86,7 @@ function truncateWrappedContent({
|
|
|
86
86
|
toRemove = biggest.tokens - (_nullishCoalesce(((_b = biggest.attributes) == null ? void 0 : _b.minTokens), () => ( 0)));
|
|
87
87
|
}
|
|
88
88
|
const preserve = _nullishCoalesce(((_c = biggest.attributes) == null ? void 0 : _c.preserve), () => ( DEFAULT_TRUNCATE_OPTIONS.preserve));
|
|
89
|
-
const split = tokenizer.
|
|
89
|
+
const split = tokenizer.splitAndSlice(biggest.content);
|
|
90
90
|
if (preserve === "bottom") {
|
|
91
91
|
biggest.content = split.slice(toRemove).join("");
|
|
92
92
|
} else if (preserve === "top") {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkD3JSHTIKcjs = require('./chunk-D3JSHTIK.cjs');
|
|
4
4
|
require('./chunk-KIN7Y247.cjs');
|
|
5
5
|
require('./chunk-TLOQBZKW.cjs');
|
|
6
6
|
require('./chunk-54G63644.cjs');
|
|
7
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-UCXQ4U7P.cjs');
|
|
8
8
|
require('./chunk-4VYDQ3VF.cjs');
|
|
9
9
|
require('./chunk-RKKRSBX3.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.DualModePrompt =
|
|
12
|
+
exports.DualModePrompt = _chunkD3JSHTIKcjs.DualModePrompt;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DualModePrompt
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WTWIJ2LI.js";
|
|
4
4
|
import "./chunk-YEAWWJSJ.js";
|
|
5
5
|
import "./chunk-UOENUUUV.js";
|
|
6
6
|
import "./chunk-UOPTKXLE.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-M4WTTARE.js";
|
|
8
8
|
import "./chunk-EKXZXQJB.js";
|
|
9
9
|
import "./chunk-5XC6ZMS5.js";
|
|
10
10
|
export {
|
package/dist/index.cjs
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
12
|
+
var _chunkMDMLCSOZcjs = require('./chunk-MDMLCSOZ.cjs');
|
|
13
|
+
require('./chunk-D3JSHTIK.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
var _chunkSZLX27VXcjs = require('./chunk-SZLX27VX.cjs');
|
|
@@ -39,7 +39,7 @@ require('./chunk-54G63644.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _chunkUCXQ4U7Pcjs = require('./chunk-UCXQ4U7P.cjs');
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
@@ -53,7 +53,7 @@ var _chunk4VYDQ3VFcjs = require('./chunk-4VYDQ3VF.cjs');
|
|
|
53
53
|
var _chunkRKKRSBX3cjs = require('./chunk-RKKRSBX3.cjs');
|
|
54
54
|
|
|
55
55
|
// package.json
|
|
56
|
-
var version = "0.0.
|
|
56
|
+
var version = "0.0.52";
|
|
57
57
|
|
|
58
58
|
// src/objects.ts
|
|
59
59
|
var _zui = require('@bpinternal/zui');
|
|
@@ -1111,24 +1111,24 @@ var Chat = class {
|
|
|
1111
1111
|
var utils = {
|
|
1112
1112
|
toValidObjectName: _chunk4VYDQ3VFcjs.toValidObjectName,
|
|
1113
1113
|
toValidFunctionName: _chunk4VYDQ3VFcjs.toValidFunctionName,
|
|
1114
|
-
wrapContent:
|
|
1115
|
-
truncateWrappedContent:
|
|
1114
|
+
wrapContent: _chunkUCXQ4U7Pcjs.wrapContent,
|
|
1115
|
+
truncateWrappedContent: _chunkUCXQ4U7Pcjs.truncateWrappedContent
|
|
1116
1116
|
};
|
|
1117
1117
|
var execute = async (props) => {
|
|
1118
|
-
const { executeContext } = await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-
|
|
1118
|
+
const { executeContext } = await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-OJCGD4CI.cjs")));
|
|
1119
1119
|
return executeContext(props);
|
|
1120
1120
|
};
|
|
1121
1121
|
var init = async () => {
|
|
1122
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-
|
|
1122
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./llmz-OJCGD4CI.cjs")));
|
|
1123
1123
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./component-J72CVOKY.cjs")));
|
|
1124
1124
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./tool-NAGC3ZMN.cjs")));
|
|
1125
1125
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./exit-OOGJ3TAS.cjs")));
|
|
1126
1126
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./jsx-ENFGHP6S.cjs")));
|
|
1127
1127
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./vm-VYYSPUQ5.cjs")));
|
|
1128
1128
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./utils-BZUEJT4W.cjs")));
|
|
1129
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./truncator-
|
|
1129
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./truncator-6M2EP2NZ.cjs")));
|
|
1130
1130
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./typings-SNGR4WYT.cjs")));
|
|
1131
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./dual-modes-
|
|
1131
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./dual-modes-FTHFPWZ4.cjs")));
|
|
1132
1132
|
};
|
|
1133
1133
|
|
|
1134
1134
|
|
|
@@ -1159,4 +1159,4 @@ var init = async () => {
|
|
|
1159
1159
|
|
|
1160
1160
|
|
|
1161
1161
|
|
|
1162
|
-
exports.Chat = Chat; exports.CitationsManager = CitationsManager; exports.Component = _chunkTLOQBZKWcjs.Component; exports.DefaultComponents = DefaultComponents; exports.DefaultExit =
|
|
1162
|
+
exports.Chat = Chat; exports.CitationsManager = CitationsManager; exports.Component = _chunkTLOQBZKWcjs.Component; exports.DefaultComponents = DefaultComponents; exports.DefaultExit = _chunkMDMLCSOZcjs.DefaultExit; exports.ErrorExecutionResult = _chunkMDMLCSOZcjs.ErrorExecutionResult; exports.ExecutionResult = _chunkMDMLCSOZcjs.ExecutionResult; exports.Exit = _chunkF4OZHUMScjs.Exit; exports.ListenExit = _chunkMDMLCSOZcjs.ListenExit; exports.LoopExceededError = _chunkPK72FAKDcjs.LoopExceededError; exports.ObjectInstance = ObjectInstance; exports.PartialExecutionResult = _chunkMDMLCSOZcjs.PartialExecutionResult; exports.Snapshot = _chunkMDMLCSOZcjs.Snapshot; exports.SnapshotSignal = _chunkPK72FAKDcjs.SnapshotSignal; exports.SuccessExecutionResult = _chunkMDMLCSOZcjs.SuccessExecutionResult; exports.ThinkExit = _chunkMDMLCSOZcjs.ThinkExit; exports.ThinkSignal = _chunkPK72FAKDcjs.ThinkSignal; exports.Tool = _chunkSZLX27VXcjs.Tool; exports.assertValidComponent = _chunkTLOQBZKWcjs.assertValidComponent; exports.execute = execute; exports.getValue = _chunkMDMLCSOZcjs.getValue; exports.init = init; exports.isAnyComponent = _chunkTLOQBZKWcjs.isAnyComponent; exports.isComponent = _chunkTLOQBZKWcjs.isComponent; exports.parseExit = _chunkMDMLCSOZcjs.parseExit; exports.renderToTsx = _chunkTLOQBZKWcjs.renderToTsx; exports.utils = utils; exports.version = version;
|
package/dist/index.js
CHANGED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
ThinkExit,
|
|
10
10
|
getValue,
|
|
11
11
|
parseExit
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-GPXZL4YV.js";
|
|
13
|
+
import "./chunk-WTWIJ2LI.js";
|
|
14
14
|
import {
|
|
15
15
|
Tool
|
|
16
16
|
} from "./chunk-L2ZDZKCB.js";
|
|
@@ -39,7 +39,7 @@ import "./chunk-UOPTKXLE.js";
|
|
|
39
39
|
import {
|
|
40
40
|
truncateWrappedContent,
|
|
41
41
|
wrapContent
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-M4WTTARE.js";
|
|
43
43
|
import {
|
|
44
44
|
escapeString,
|
|
45
45
|
getMultilineComment,
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
} from "./chunk-5XC6ZMS5.js";
|
|
54
54
|
|
|
55
55
|
// package.json
|
|
56
|
-
var version = "0.0.
|
|
56
|
+
var version = "0.0.52";
|
|
57
57
|
|
|
58
58
|
// src/objects.ts
|
|
59
59
|
import { z } from "@bpinternal/zui";
|
|
@@ -1115,20 +1115,20 @@ var utils = {
|
|
|
1115
1115
|
truncateWrappedContent
|
|
1116
1116
|
};
|
|
1117
1117
|
var execute = async (props) => {
|
|
1118
|
-
const { executeContext } = await import("./llmz-
|
|
1118
|
+
const { executeContext } = await import("./llmz-566HNZLM.js");
|
|
1119
1119
|
return executeContext(props);
|
|
1120
1120
|
};
|
|
1121
1121
|
var init = async () => {
|
|
1122
|
-
await import("./llmz-
|
|
1122
|
+
await import("./llmz-566HNZLM.js");
|
|
1123
1123
|
await import("./component-GNYIA77X.js");
|
|
1124
1124
|
await import("./tool-5JXTEQNW.js");
|
|
1125
1125
|
await import("./exit-56DISPLS.js");
|
|
1126
1126
|
await import("./jsx-PCXQVMLU.js");
|
|
1127
1127
|
await import("./vm-5IM44JHK.js");
|
|
1128
1128
|
await import("./utils-D3J443FA.js");
|
|
1129
|
-
await import("./truncator-
|
|
1129
|
+
await import("./truncator-2FSONJM2.js");
|
|
1130
1130
|
await import("./typings-ZO63Z4TF.js");
|
|
1131
|
-
await import("./dual-modes-
|
|
1131
|
+
await import("./dual-modes-GCL2U7YL.js");
|
|
1132
1132
|
};
|
|
1133
1133
|
export {
|
|
1134
1134
|
Chat,
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
Snapshot,
|
|
9
9
|
SuccessExecutionResult,
|
|
10
10
|
parseExit
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-GPXZL4YV.js";
|
|
12
|
+
import "./chunk-WTWIJ2LI.js";
|
|
13
13
|
import "./chunk-L2ZDZKCB.js";
|
|
14
14
|
import "./chunk-YV5N57D3.js";
|
|
15
15
|
import {
|
|
@@ -31,7 +31,7 @@ import "./chunk-UOENUUUV.js";
|
|
|
31
31
|
import "./chunk-UOPTKXLE.js";
|
|
32
32
|
import {
|
|
33
33
|
truncateWrappedContent
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-M4WTTARE.js";
|
|
35
35
|
import {
|
|
36
36
|
init,
|
|
37
37
|
stripInvalidIdentifiers
|
|
@@ -8,8 +8,8 @@ var _chunkRMIS25AAcjs = require('./chunk-RMIS25AA.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('./chunk-
|
|
11
|
+
var _chunkMDMLCSOZcjs = require('./chunk-MDMLCSOZ.cjs');
|
|
12
|
+
require('./chunk-D3JSHTIK.cjs');
|
|
13
13
|
require('./chunk-SZLX27VX.cjs');
|
|
14
14
|
require('./chunk-2NEOPXCS.cjs');
|
|
15
15
|
|
|
@@ -31,7 +31,7 @@ require('./chunk-TLOQBZKW.cjs');
|
|
|
31
31
|
require('./chunk-54G63644.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _chunkUCXQ4U7Pcjs = require('./chunk-UCXQ4U7P.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
@@ -109,7 +109,7 @@ var _executeContext = async (props) => {
|
|
|
109
109
|
const client = _nullishCoalesce(props.client, () => ( new (0, _client.Client)()));
|
|
110
110
|
const cognitive = _cognitive.Cognitive.isCognitiveClient(client) ? client : new (0, _cognitive.Cognitive)({ client, __experimental_beta: true });
|
|
111
111
|
const cleanups = [];
|
|
112
|
-
const ctx = new (0,
|
|
112
|
+
const ctx = new (0, _chunkMDMLCSOZcjs.Context)({
|
|
113
113
|
chat: props.chat,
|
|
114
114
|
instructions: props.instructions,
|
|
115
115
|
objects: props.objects,
|
|
@@ -124,7 +124,7 @@ var _executeContext = async (props) => {
|
|
|
124
124
|
try {
|
|
125
125
|
while (true) {
|
|
126
126
|
if (ctx.iterations.length >= ctx.loop) {
|
|
127
|
-
return new (0,
|
|
127
|
+
return new (0, _chunkMDMLCSOZcjs.ErrorExecutionResult)(ctx, new (0, _chunkPK72FAKDcjs.LoopExceededError)());
|
|
128
128
|
}
|
|
129
129
|
const iteration = await ctx.nextIteration();
|
|
130
130
|
try {
|
|
@@ -147,7 +147,7 @@ var _executeContext = async (props) => {
|
|
|
147
147
|
reason: _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted"))
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
|
-
return new (0,
|
|
150
|
+
return new (0, _chunkMDMLCSOZcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted")));
|
|
151
151
|
}
|
|
152
152
|
cleanups.push(
|
|
153
153
|
iteration.traces.onPush((traces) => {
|
|
@@ -169,7 +169,7 @@ var _executeContext = async (props) => {
|
|
|
169
169
|
});
|
|
170
170
|
} catch (err) {
|
|
171
171
|
if (err instanceof _chunkPK72FAKDcjs.CognitiveError) {
|
|
172
|
-
return new (0,
|
|
172
|
+
return new (0, _chunkMDMLCSOZcjs.ErrorExecutionResult)(ctx, err);
|
|
173
173
|
}
|
|
174
174
|
iteration.end({
|
|
175
175
|
type: "execution_error",
|
|
@@ -186,25 +186,25 @@ var _executeContext = async (props) => {
|
|
|
186
186
|
}
|
|
187
187
|
if (iteration.status.type === "exit_success") {
|
|
188
188
|
const exitName = iteration.status.exit_success.exit_name;
|
|
189
|
-
return new (0,
|
|
189
|
+
return new (0, _chunkMDMLCSOZcjs.SuccessExecutionResult)(ctx, {
|
|
190
190
|
exit: iteration.exits.find((x) => x.name === exitName),
|
|
191
191
|
result: iteration.status.exit_success.return_value
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
194
|
if (iteration.status.type === "callback_requested") {
|
|
195
|
-
return new (0,
|
|
195
|
+
return new (0, _chunkMDMLCSOZcjs.PartialExecutionResult)(
|
|
196
196
|
ctx,
|
|
197
197
|
iteration.status.callback_requested.signal,
|
|
198
|
-
|
|
198
|
+
_chunkMDMLCSOZcjs.Snapshot.fromSignal(iteration.status.callback_requested.signal)
|
|
199
199
|
);
|
|
200
200
|
}
|
|
201
201
|
if (iteration.status.type === "thinking_requested" || iteration.status.type === "exit_error" || iteration.status.type === "execution_error" || iteration.status.type === "invalid_code_error") {
|
|
202
202
|
continue;
|
|
203
203
|
}
|
|
204
|
-
return new (0,
|
|
204
|
+
return new (0, _chunkMDMLCSOZcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(iteration.error, () => ( `Unknown error. Status: ${iteration.status.type}`)));
|
|
205
205
|
}
|
|
206
206
|
} catch (error) {
|
|
207
|
-
return new (0,
|
|
207
|
+
return new (0, _chunkMDMLCSOZcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(error, () => ( "Unknown error")));
|
|
208
208
|
} finally {
|
|
209
209
|
for (const cleanup of cleanups) {
|
|
210
210
|
try {
|
|
@@ -233,7 +233,7 @@ var executeIteration = async ({
|
|
|
233
233
|
});
|
|
234
234
|
const modelLimit = Math.max(model.input.maxTokens, 8e3);
|
|
235
235
|
const responseLengthBuffer = getModelOutputLimit(modelLimit);
|
|
236
|
-
const messages =
|
|
236
|
+
const messages = _chunkUCXQ4U7Pcjs.truncateWrappedContent.call(void 0, {
|
|
237
237
|
messages: iteration.messages,
|
|
238
238
|
tokenLimit: modelLimit - responseLengthBuffer,
|
|
239
239
|
throwOnFailure: true
|
|
@@ -482,7 +482,7 @@ var executeIteration = async ({
|
|
|
482
482
|
}
|
|
483
483
|
});
|
|
484
484
|
}
|
|
485
|
-
const parsedExit =
|
|
485
|
+
const parsedExit = _chunkMDMLCSOZcjs.parseExit.call(void 0, returnValue, iteration.exits);
|
|
486
486
|
if (!parsedExit.success) {
|
|
487
487
|
return iteration.end({
|
|
488
488
|
type: "exit_error",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkUCXQ4U7Pcjs = require('./chunk-UCXQ4U7P.cjs');
|
|
5
|
+
require('./chunk-4VYDQ3VF.cjs');
|
|
6
|
+
require('./chunk-RKKRSBX3.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.truncateWrappedContent = _chunkUCXQ4U7Pcjs.truncateWrappedContent; exports.wrapContent = _chunkUCXQ4U7Pcjs.wrapContent;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "llmz",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "LLMz - An LLM-native Typescript VM built on top of Zui",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.52",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"main": "./dist/index.cjs",
|
|
8
8
|
"module": "./dist/index.js",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
74
|
"@botpress/client": "1.33.0",
|
|
75
|
-
"@botpress/cognitive": "0.3.
|
|
76
|
-
"@bpinternal/thicktoken": "^
|
|
77
|
-
"@bpinternal/zui": "^1.3.
|
|
75
|
+
"@botpress/cognitive": "0.3.12",
|
|
76
|
+
"@bpinternal/thicktoken": "^2.0.0",
|
|
77
|
+
"@bpinternal/zui": "^1.3.3"
|
|
78
78
|
},
|
|
79
79
|
"dependenciesMeta": {
|
|
80
80
|
"@bpinternal/zui": {
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkIUP5LRT4cjs = require('./chunk-IUP5LRT4.cjs');
|
|
5
|
-
require('./chunk-4VYDQ3VF.cjs');
|
|
6
|
-
require('./chunk-RKKRSBX3.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.truncateWrappedContent = _chunkIUP5LRT4cjs.truncateWrappedContent; exports.wrapContent = _chunkIUP5LRT4cjs.wrapContent;
|