llmz 0.0.82 → 0.0.83
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-BJMZIH3M.js → chunk-34GJUS6U.js} +1047 -1047
- package/dist/{chunk-EQ4JDBE5.js → chunk-3T5IU7OU.js} +1 -1
- package/dist/{chunk-H5LCBNN6.cjs → chunk-52QTFQOB.cjs} +18 -18
- package/dist/{chunk-3NVOHQVY.js → chunk-5MAFEI2A.js} +4 -2
- package/dist/{chunk-HBKQKO3R.js → chunk-5Z2SJOGS.js} +3 -3
- package/dist/{chunk-OX3Y2Z5K.cjs → chunk-5ZF6NTYI.cjs} +3 -3
- package/dist/{chunk-TB6TCWEB.cjs → chunk-6KR6VRA6.cjs} +2 -2
- package/dist/{chunk-BXPPMP5X.cjs → chunk-73XYX76S.cjs} +14 -14
- package/dist/{chunk-VXQ2CZ7B.cjs → chunk-CQ3UJW76.cjs} +4 -4
- package/dist/{chunk-22DGAZXC.js → chunk-EFEF2AL7.js} +2 -2
- package/dist/{chunk-7XVBJQ53.cjs → chunk-HC2QZTVT.cjs} +1047 -1047
- package/dist/{chunk-HP3T6PF4.js → chunk-I2CZYEMH.js} +4 -4
- package/dist/{chunk-GFZCNSYW.cjs → chunk-JXD2KJVB.cjs} +23 -23
- package/dist/{chunk-YFG53MRF.js → chunk-MM2FLD3J.js} +1 -1
- package/dist/{chunk-DO7DN4FZ.js → chunk-NPVV3PHY.js} +1 -1
- package/dist/{chunk-5X5TDCMX.cjs → chunk-NQBIU5VM.cjs} +51 -51
- package/dist/{chunk-FQ4QCUTI.cjs → chunk-NWTG73QR.cjs} +10 -8
- package/dist/{chunk-DLV5FJ42.cjs → chunk-RLUTWFAA.cjs} +9 -9
- package/dist/{chunk-2UM7PFM3.js → chunk-VDTORFBP.js} +6 -6
- package/dist/{chunk-E74GBCTT.js → chunk-VLJA22PB.js} +2 -2
- package/dist/{chunk-E6UFMAW7.js → chunk-XTEHT2TK.js} +1 -1
- package/dist/{chunk-X24YFCFY.cjs → chunk-YCLKXXSF.cjs} +28 -28
- package/dist/{component-GVCCL5XU.js → component-2Z3KLWLX.js} +3 -3
- package/dist/component-NNHBHD72.cjs +18 -0
- package/dist/dual-modes-E5HGE35E.cjs +12 -0
- package/dist/dual-modes-VDFZH4YM.js +12 -0
- package/dist/{llmz-JTZUIYRP.js → execute-CJVHUFYI.js} +536 -420
- package/dist/{llmz-2HD6WKIP.cjs → execute-R6R3A42S.cjs} +545 -429
- package/dist/exit-GKF4EEMZ.js +8 -0
- package/dist/exit-VZASQELZ.cjs +8 -0
- package/dist/index.cjs +49 -49
- package/dist/index.d.ts +1 -1
- package/dist/index.js +22 -22
- package/dist/{jsx-RIPUQSAU.js → jsx-DDZ63UUF.js} +2 -2
- package/dist/jsx-ULPWX5TW.cjs +13 -0
- package/dist/runtime/execute.d.ts +3 -0
- package/dist/runtime/generate.d.ts +10 -0
- package/dist/runtime/interpret-result.d.ts +12 -0
- package/dist/runtime/interpret-result.test.d.ts +1 -0
- package/dist/runtime/tool-wrapper.d.ts +17 -0
- package/dist/runtime/tool-wrapper.test.d.ts +1 -0
- package/dist/{llmz.d.ts → runtime/types.d.ts} +12 -13
- package/dist/runtime/utils.d.ts +10 -0
- package/dist/runtime/vm-context.d.ts +12 -0
- package/dist/tool-4VK7TZV2.cjs +11 -0
- package/dist/tool-JZP3UN2F.js +11 -0
- package/dist/{truncator-HCWH5MJ3.js → truncator-IIRX3MB2.js} +3 -3
- package/dist/truncator-NWENJXMR.cjs +10 -0
- package/dist/typings-SHVPZ5AR.cjs +10 -0
- package/dist/{typings-FPFJ5D5R.js → typings-SKZSSL2M.js} +3 -3
- package/dist/utils-6MFSS4AT.cjs +41 -0
- package/dist/{utils-M5KFPSNZ.js → utils-SYJGSVFW.js} +4 -2
- package/dist/utils.d.ts +1 -0
- package/dist/{vm-KBBQ7U5L.js → vm-PYCKS77H.js} +3 -3
- package/dist/vm-VHB67FVH.cjs +10 -0
- package/package.json +1 -1
- package/dist/component-YMPMWSTU.cjs +0 -18
- package/dist/dual-modes-KOU5YJ3Q.cjs +0 -12
- package/dist/dual-modes-X7YHJBFJ.js +0 -12
- package/dist/exit-A34GODDB.cjs +0 -8
- package/dist/exit-J55SREDL.js +0 -8
- package/dist/jsx-XEUSAKAK.cjs +0 -13
- package/dist/tool-B3DJ3D2F.js +0 -11
- package/dist/tool-IWPZD5OY.cjs +0 -11
- package/dist/truncator-SOO6NHLD.cjs +0 -10
- package/dist/typings-O2FLZGQN.cjs +0 -10
- package/dist/utils-PWX3JPCF.cjs +0 -39
- package/dist/vm-R2XBIWE4.cjs +0 -10
package/dist/index.cjs
CHANGED
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
12
|
+
var _chunkYCLKXXSFcjs = require('./chunk-YCLKXXSF.cjs');
|
|
13
|
+
require('./chunk-NQBIU5VM.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunk52QTFQOBcjs = require('./chunk-52QTFQOB.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunk73XYX76Scjs = require('./chunk-73XYX76S.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -27,33 +27,33 @@ var _chunkPK72FAKDcjs = require('./chunk-PK72FAKD.cjs');
|
|
|
27
27
|
require('./chunk-KIN7Y247.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkRLUTWFAAcjs = require('./chunk-RLUTWFAA.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
38
|
-
require('./chunk-
|
|
37
|
+
var _chunkCQ3UJW76cjs = require('./chunk-CQ3UJW76.cjs');
|
|
38
|
+
require('./chunk-5ZF6NTYI.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _chunk6KR6VRA6cjs = require('./chunk-6KR6VRA6.cjs');
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
var
|
|
49
|
+
var _chunkNWTG73QRcjs = require('./chunk-NWTG73QR.cjs');
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
var
|
|
53
|
+
var _chunkHC2QZTVTcjs = require('./chunk-HC2QZTVT.cjs');
|
|
54
54
|
|
|
55
55
|
// package.json
|
|
56
|
-
var version = "0.0.
|
|
56
|
+
var version = "0.0.83";
|
|
57
57
|
|
|
58
58
|
// src/objects.ts
|
|
59
59
|
var _zui = require('@bpinternal/zui');
|
|
@@ -65,7 +65,7 @@ var _traverse = require('@babel/traverse'); var _traverse2 = _interopRequireDefa
|
|
|
65
65
|
var _types = require('@babel/types'); var t = _interopRequireWildcard(_types);
|
|
66
66
|
var traverse = _traverse2.default;
|
|
67
67
|
function getTypingsWithoutComments(type) {
|
|
68
|
-
const typeClone =
|
|
68
|
+
const typeClone = _chunkHC2QZTVTcjs.cloneDeep_default.call(void 0, type);
|
|
69
69
|
removeBabelComments(typeClone);
|
|
70
70
|
return new (0, _generator.CodeGenerator)(typeClone, { comments: false }).generate().code;
|
|
71
71
|
}
|
|
@@ -133,7 +133,7 @@ function extractAndHoistTypes(ast) {
|
|
|
133
133
|
}
|
|
134
134
|
currPath = parentPath;
|
|
135
135
|
}
|
|
136
|
-
return parts.size ? Array.from(parts).reverse().map(
|
|
136
|
+
return parts.size ? Array.from(parts).reverse().map(_chunkHC2QZTVTcjs.upperFirst_default) : ["UnnamedType"];
|
|
137
137
|
}
|
|
138
138
|
function generateTypeName(path) {
|
|
139
139
|
return getTypePaths(path).join("");
|
|
@@ -305,7 +305,7 @@ async function hoistTypings(code, formatOptions) {
|
|
|
305
305
|
break;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
return
|
|
308
|
+
return _chunk73XYX76Scjs.formatTypings.call(void 0, code, formatOptions);
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
// src/objects.ts
|
|
@@ -374,7 +374,7 @@ var ObjectInstance = class {
|
|
|
374
374
|
*/
|
|
375
375
|
constructor(props) {
|
|
376
376
|
var _a;
|
|
377
|
-
if (!
|
|
377
|
+
if (!_chunkNWTG73QRcjs.isValidIdentifier.call(void 0, props.name)) {
|
|
378
378
|
throw new Error(
|
|
379
379
|
`Invalid name for tool ${props.name}. A tool name must start with a letter and contain only letters, numbers, and underscores. It must be 1-50 characters long.`
|
|
380
380
|
);
|
|
@@ -407,7 +407,7 @@ var ObjectInstance = class {
|
|
|
407
407
|
if (props.properties.filter((p) => p.name === prop.name).length > 1) {
|
|
408
408
|
throw new Error(`Duplicate property name "${prop.name}" in tool ${props.name}`);
|
|
409
409
|
}
|
|
410
|
-
if (!
|
|
410
|
+
if (!_chunkNWTG73QRcjs.isValidIdentifier.call(void 0, prop.name)) {
|
|
411
411
|
throw new Error(
|
|
412
412
|
`Invalid name for property ${prop.name}. A property name must start with a letter and contain only letters, numbers, and underscores. It must be 1-50 characters long.`
|
|
413
413
|
);
|
|
@@ -431,7 +431,7 @@ var ObjectInstance = class {
|
|
|
431
431
|
this.description = props.description;
|
|
432
432
|
this.metadata = _nullishCoalesce(props.metadata, () => ( {}));
|
|
433
433
|
this.properties = props.properties;
|
|
434
|
-
this.tools =
|
|
434
|
+
this.tools = _chunk52QTFQOBcjs.Tool.withUniqueNames(_nullishCoalesce(props.tools, () => ( [])));
|
|
435
435
|
}
|
|
436
436
|
/**
|
|
437
437
|
* Generates TypeScript namespace declarations for this object.
|
|
@@ -508,11 +508,11 @@ function getObjectTypings(obj) {
|
|
|
508
508
|
for (const prop of _nullishCoalesce(obj.properties, () => ( []))) {
|
|
509
509
|
const description = _nullishCoalesce(prop.description, () => ( ""));
|
|
510
510
|
if (description == null ? void 0 : description.trim().length) {
|
|
511
|
-
typings.push(
|
|
511
|
+
typings.push(_chunkNWTG73QRcjs.getMultilineComment.call(void 0, description));
|
|
512
512
|
}
|
|
513
513
|
let type = "unknown";
|
|
514
514
|
if (prop.type) {
|
|
515
|
-
type = await
|
|
515
|
+
type = await _chunk73XYX76Scjs.getTypings.call(void 0, prop.type, {});
|
|
516
516
|
} else if (prop.value !== void 0) {
|
|
517
517
|
type = typeof prop.value;
|
|
518
518
|
}
|
|
@@ -532,7 +532,7 @@ function getObjectTypings(obj) {
|
|
|
532
532
|
typings.push("");
|
|
533
533
|
for (const tool of obj.tools) {
|
|
534
534
|
const fnType = _zui.z.function(tool.zInput, tool.zOutput).title(tool.name).describe(_nullishCoalesce(tool.description, () => ( "")));
|
|
535
|
-
let temp = await
|
|
535
|
+
let temp = await _chunk73XYX76Scjs.getTypings.call(void 0, fnType, {
|
|
536
536
|
declaration: true
|
|
537
537
|
});
|
|
538
538
|
temp = temp.replace("declare function ", "function ");
|
|
@@ -553,9 +553,9 @@ function getObjectTypings(obj) {
|
|
|
553
553
|
typings.push("}" + closingBracket);
|
|
554
554
|
let header = "";
|
|
555
555
|
if ((_a = obj.description) == null ? void 0 : _a.trim().length) {
|
|
556
|
-
header =
|
|
556
|
+
header = _chunkNWTG73QRcjs.getMultilineComment.call(void 0, obj.description);
|
|
557
557
|
}
|
|
558
|
-
return
|
|
558
|
+
return _chunk73XYX76Scjs.formatTypings.call(void 0,
|
|
559
559
|
`${header}
|
|
560
560
|
export namespace ${obj.name} {
|
|
561
561
|
${body}
|
|
@@ -586,7 +586,7 @@ function getObjectTypings(obj) {
|
|
|
586
586
|
}
|
|
587
587
|
function embedPropertyValue(property) {
|
|
588
588
|
if (typeof property.value === "string") {
|
|
589
|
-
return
|
|
589
|
+
return _chunkNWTG73QRcjs.escapeString.call(void 0, property.value);
|
|
590
590
|
}
|
|
591
591
|
if (Number.isNaN(property.value)) {
|
|
592
592
|
return "NaN";
|
|
@@ -604,7 +604,7 @@ function embedPropertyValue(property) {
|
|
|
604
604
|
return `new Date('${property.value.toISOString()}')`;
|
|
605
605
|
}
|
|
606
606
|
if (property.value instanceof RegExp) {
|
|
607
|
-
return `new RegExp(${
|
|
607
|
+
return `new RegExp(${_chunkNWTG73QRcjs.escapeString.call(void 0, property.value.source)}, ${_chunkNWTG73QRcjs.escapeString.call(void 0, property.value.flags)})`;
|
|
608
608
|
}
|
|
609
609
|
if (property.value === null) {
|
|
610
610
|
return "null";
|
|
@@ -622,7 +622,7 @@ function embedPropertyValue(property) {
|
|
|
622
622
|
return `${property.value}n`;
|
|
623
623
|
}
|
|
624
624
|
if (property.value instanceof Error) {
|
|
625
|
-
return `Error(${
|
|
625
|
+
return `Error(${_chunkNWTG73QRcjs.escapeString.call(void 0, property.value.message)})`;
|
|
626
626
|
}
|
|
627
627
|
if (property.value instanceof Map) {
|
|
628
628
|
return `new Map(${JSON.stringify(Array.from(property.value.entries()))})`;
|
|
@@ -769,7 +769,7 @@ var CitationsManager = (_class = class {constructor() { _class.prototype.__init.
|
|
|
769
769
|
|
|
770
770
|
// src/component.default.ts
|
|
771
771
|
|
|
772
|
-
var Button = new (0,
|
|
772
|
+
var Button = new (0, _chunkCQ3UJW76cjs.Component)({
|
|
773
773
|
type: "leaf",
|
|
774
774
|
description: "A button component that can perform actions when clicked",
|
|
775
775
|
name: "Button",
|
|
@@ -801,7 +801,7 @@ var Button = new (0, _chunkVXQ2CZ7Bcjs.Component)({
|
|
|
801
801
|
})
|
|
802
802
|
}
|
|
803
803
|
});
|
|
804
|
-
var Image = new (0,
|
|
804
|
+
var Image = new (0, _chunkCQ3UJW76cjs.Component)({
|
|
805
805
|
type: "leaf",
|
|
806
806
|
name: "Image",
|
|
807
807
|
description: "Displays an image from a URL.",
|
|
@@ -823,7 +823,7 @@ var Image = new (0, _chunkVXQ2CZ7Bcjs.Component)({
|
|
|
823
823
|
})
|
|
824
824
|
}
|
|
825
825
|
});
|
|
826
|
-
var File = new (0,
|
|
826
|
+
var File = new (0, _chunkCQ3UJW76cjs.Component)({
|
|
827
827
|
type: "leaf",
|
|
828
828
|
name: "File",
|
|
829
829
|
description: "Sends a downloadable file to the user.",
|
|
@@ -845,7 +845,7 @@ var File = new (0, _chunkVXQ2CZ7Bcjs.Component)({
|
|
|
845
845
|
})
|
|
846
846
|
}
|
|
847
847
|
});
|
|
848
|
-
var Video = new (0,
|
|
848
|
+
var Video = new (0, _chunkCQ3UJW76cjs.Component)({
|
|
849
849
|
type: "leaf",
|
|
850
850
|
name: "Video",
|
|
851
851
|
description: "Embeds a video from a URL.",
|
|
@@ -867,7 +867,7 @@ var Video = new (0, _chunkVXQ2CZ7Bcjs.Component)({
|
|
|
867
867
|
})
|
|
868
868
|
}
|
|
869
869
|
});
|
|
870
|
-
var Audio = new (0,
|
|
870
|
+
var Audio = new (0, _chunkCQ3UJW76cjs.Component)({
|
|
871
871
|
type: "leaf",
|
|
872
872
|
name: "Audio",
|
|
873
873
|
description: "Plays an audio clip from a URL.",
|
|
@@ -889,7 +889,7 @@ var Audio = new (0, _chunkVXQ2CZ7Bcjs.Component)({
|
|
|
889
889
|
})
|
|
890
890
|
}
|
|
891
891
|
});
|
|
892
|
-
var Card = new (0,
|
|
892
|
+
var Card = new (0, _chunkCQ3UJW76cjs.Component)({
|
|
893
893
|
type: "container",
|
|
894
894
|
name: "Card",
|
|
895
895
|
description: "A visual card component that can include an image and buttons.",
|
|
@@ -925,7 +925,7 @@ var Card = new (0, _chunkVXQ2CZ7Bcjs.Component)({
|
|
|
925
925
|
]
|
|
926
926
|
}
|
|
927
927
|
});
|
|
928
|
-
var Carousel = new (0,
|
|
928
|
+
var Carousel = new (0, _chunkCQ3UJW76cjs.Component)({
|
|
929
929
|
type: "container",
|
|
930
930
|
name: "Carousel",
|
|
931
931
|
description: "A virtual container for displaying 1 to 10 Card components as a carousel.",
|
|
@@ -959,7 +959,7 @@ var Carousel = new (0, _chunkVXQ2CZ7Bcjs.Component)({
|
|
|
959
959
|
]
|
|
960
960
|
}
|
|
961
961
|
});
|
|
962
|
-
var Text = new (0,
|
|
962
|
+
var Text = new (0, _chunkCQ3UJW76cjs.Component)({
|
|
963
963
|
type: "default",
|
|
964
964
|
name: "Message",
|
|
965
965
|
aliases: ["Text", "Markdown"],
|
|
@@ -1109,26 +1109,26 @@ var Chat = class {
|
|
|
1109
1109
|
|
|
1110
1110
|
// src/index.ts
|
|
1111
1111
|
var utils = {
|
|
1112
|
-
toValidObjectName:
|
|
1113
|
-
toValidFunctionName:
|
|
1114
|
-
wrapContent:
|
|
1115
|
-
truncateWrappedContent:
|
|
1112
|
+
toValidObjectName: _chunkNWTG73QRcjs.toValidObjectName,
|
|
1113
|
+
toValidFunctionName: _chunkNWTG73QRcjs.toValidFunctionName,
|
|
1114
|
+
wrapContent: _chunk6KR6VRA6cjs.wrapContent,
|
|
1115
|
+
truncateWrappedContent: _chunk6KR6VRA6cjs.truncateWrappedContent
|
|
1116
1116
|
};
|
|
1117
1117
|
var execute = async (props) => {
|
|
1118
|
-
const { executeContext } = await Promise.resolve().then(() => _interopRequireWildcard(require("./
|
|
1118
|
+
const { executeContext } = await Promise.resolve().then(() => _interopRequireWildcard(require("./execute-R6R3A42S.cjs")));
|
|
1119
1119
|
return executeContext(props);
|
|
1120
1120
|
};
|
|
1121
1121
|
var init = async () => {
|
|
1122
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./
|
|
1123
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./component-
|
|
1124
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./tool-
|
|
1125
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./exit-
|
|
1126
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./jsx-
|
|
1127
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./vm-
|
|
1128
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./utils-
|
|
1129
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./truncator-
|
|
1130
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./typings-
|
|
1131
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./dual-modes-
|
|
1122
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./execute-R6R3A42S.cjs")));
|
|
1123
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./component-NNHBHD72.cjs")));
|
|
1124
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./tool-4VK7TZV2.cjs")));
|
|
1125
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./exit-VZASQELZ.cjs")));
|
|
1126
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./jsx-ULPWX5TW.cjs")));
|
|
1127
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./vm-VHB67FVH.cjs")));
|
|
1128
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./utils-6MFSS4AT.cjs")));
|
|
1129
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./truncator-NWENJXMR.cjs")));
|
|
1130
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./typings-SHVPZ5AR.cjs")));
|
|
1131
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./dual-modes-E5HGE35E.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 =
|
|
1162
|
+
exports.Chat = Chat; exports.CitationsManager = CitationsManager; exports.Component = _chunkCQ3UJW76cjs.Component; exports.DefaultComponents = DefaultComponents; exports.DefaultExit = _chunkYCLKXXSFcjs.DefaultExit; exports.ErrorExecutionResult = _chunkYCLKXXSFcjs.ErrorExecutionResult; exports.ExecutionResult = _chunkYCLKXXSFcjs.ExecutionResult; exports.Exit = _chunkRLUTWFAAcjs.Exit; exports.ListenExit = _chunkYCLKXXSFcjs.ListenExit; exports.LoopExceededError = _chunkPK72FAKDcjs.LoopExceededError; exports.ObjectInstance = ObjectInstance; exports.PartialExecutionResult = _chunkYCLKXXSFcjs.PartialExecutionResult; exports.Snapshot = _chunkYCLKXXSFcjs.Snapshot; exports.SnapshotSignal = _chunkPK72FAKDcjs.SnapshotSignal; exports.SuccessExecutionResult = _chunkYCLKXXSFcjs.SuccessExecutionResult; exports.ThinkExit = _chunkYCLKXXSFcjs.ThinkExit; exports.ThinkSignal = _chunkPK72FAKDcjs.ThinkSignal; exports.Tool = _chunk52QTFQOBcjs.Tool; exports.assertValidComponent = _chunkCQ3UJW76cjs.assertValidComponent; exports.execute = execute; exports.getValue = _chunkYCLKXXSFcjs.getValue; exports.init = init; exports.isAnyComponent = _chunkCQ3UJW76cjs.isAnyComponent; exports.isComponent = _chunkCQ3UJW76cjs.isComponent; exports.parseExit = _chunkYCLKXXSFcjs.parseExit; exports.renderToTsx = _chunkCQ3UJW76cjs.renderToTsx; exports.utils = utils; exports.version = version;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,8 +9,8 @@ export { Citation, CitationsManager } from './citations.js';
|
|
|
9
9
|
export { DefaultComponents } from './component.default.js';
|
|
10
10
|
export { Snapshot } from './snapshots.js';
|
|
11
11
|
export { Chat, type MessageHandler } from './chat.js';
|
|
12
|
-
import { type ExecutionProps } from './llmz.js';
|
|
13
12
|
import { ExecutionResult } from './result.js';
|
|
13
|
+
import { type ExecutionProps } from './runtime/types.js';
|
|
14
14
|
import { truncateWrappedContent, wrapContent } from './truncator.js';
|
|
15
15
|
export { Transcript } from './transcript.js';
|
|
16
16
|
export { ErrorExecutionResult, ExecutionResult, PartialExecutionResult, SuccessExecutionResult } from './result.js';
|
package/dist/index.js
CHANGED
|
@@ -9,15 +9,15 @@ import {
|
|
|
9
9
|
ThinkExit,
|
|
10
10
|
getValue,
|
|
11
11
|
parseExit
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-VDTORFBP.js";
|
|
13
|
+
import "./chunk-I2CZYEMH.js";
|
|
14
14
|
import {
|
|
15
15
|
Tool
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5Z2SJOGS.js";
|
|
17
17
|
import {
|
|
18
18
|
formatTypings,
|
|
19
19
|
getTypings
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NPVV3PHY.js";
|
|
21
21
|
import {
|
|
22
22
|
CodeFormattingError,
|
|
23
23
|
LoopExceededError,
|
|
@@ -27,33 +27,33 @@ import {
|
|
|
27
27
|
import "./chunk-YEAWWJSJ.js";
|
|
28
28
|
import {
|
|
29
29
|
Exit
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-VLJA22PB.js";
|
|
31
31
|
import {
|
|
32
32
|
Component,
|
|
33
33
|
assertValidComponent,
|
|
34
34
|
isAnyComponent,
|
|
35
35
|
isComponent,
|
|
36
36
|
renderToTsx
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
} from "./chunk-3T5IU7OU.js";
|
|
38
|
+
import "./chunk-XTEHT2TK.js";
|
|
39
39
|
import {
|
|
40
40
|
truncateWrappedContent,
|
|
41
41
|
wrapContent
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-MM2FLD3J.js";
|
|
43
43
|
import {
|
|
44
44
|
escapeString,
|
|
45
45
|
getMultilineComment,
|
|
46
46
|
isValidIdentifier,
|
|
47
47
|
toValidFunctionName,
|
|
48
48
|
toValidObjectName
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-5MAFEI2A.js";
|
|
50
50
|
import {
|
|
51
51
|
cloneDeep_default,
|
|
52
52
|
upperFirst_default
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-34GJUS6U.js";
|
|
54
54
|
|
|
55
55
|
// package.json
|
|
56
|
-
var version = "0.0.
|
|
56
|
+
var version = "0.0.83";
|
|
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("./
|
|
1118
|
+
const { executeContext } = await import("./execute-CJVHUFYI.js");
|
|
1119
1119
|
return executeContext(props);
|
|
1120
1120
|
};
|
|
1121
1121
|
var init = async () => {
|
|
1122
|
-
await import("./
|
|
1123
|
-
await import("./component-
|
|
1124
|
-
await import("./tool-
|
|
1125
|
-
await import("./exit-
|
|
1126
|
-
await import("./jsx-
|
|
1127
|
-
await import("./vm-
|
|
1128
|
-
await import("./utils-
|
|
1129
|
-
await import("./truncator-
|
|
1130
|
-
await import("./typings-
|
|
1131
|
-
await import("./dual-modes-
|
|
1122
|
+
await import("./execute-CJVHUFYI.js");
|
|
1123
|
+
await import("./component-2Z3KLWLX.js");
|
|
1124
|
+
await import("./tool-JZP3UN2F.js");
|
|
1125
|
+
await import("./exit-GKF4EEMZ.js");
|
|
1126
|
+
await import("./jsx-DDZ63UUF.js");
|
|
1127
|
+
await import("./vm-PYCKS77H.js");
|
|
1128
|
+
await import("./utils-SYJGSVFW.js");
|
|
1129
|
+
await import("./truncator-IIRX3MB2.js");
|
|
1130
|
+
await import("./typings-SKZSSL2M.js");
|
|
1131
|
+
await import("./dual-modes-VDFZH4YM.js");
|
|
1132
1132
|
};
|
|
1133
1133
|
export {
|
|
1134
1134
|
Chat,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk5ZF6NTYIcjs = require('./chunk-5ZF6NTYI.cjs');
|
|
7
|
+
require('./chunk-HC2QZTVT.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.Jsx = _chunk5ZF6NTYIcjs.Jsx; exports.createJsxComponent = _chunk5ZF6NTYIcjs.createJsxComponent; exports.isAnyJsxComponent = _chunk5ZF6NTYIcjs.isAnyJsxComponent; exports.isJsxComponent = _chunk5ZF6NTYIcjs.isJsxComponent;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Context, Iteration } from '../context.js';
|
|
2
|
+
import { RuntimeCognitive } from './types.js';
|
|
3
|
+
type GenerateCodeProps = {
|
|
4
|
+
iteration: Iteration;
|
|
5
|
+
ctx: Context;
|
|
6
|
+
cognitive: RuntimeCognitive;
|
|
7
|
+
controller: AbortController;
|
|
8
|
+
};
|
|
9
|
+
export declare const generateCode: ({ iteration, ctx, cognitive, controller }: GenerateCodeProps) => Promise<void>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Iteration } from '../context.js';
|
|
2
|
+
import { VMExecutionResult } from '../types.js';
|
|
3
|
+
import { ExecutionHooks } from './types.js';
|
|
4
|
+
type InterpretVMResultProps = {
|
|
5
|
+
iteration: Iteration;
|
|
6
|
+
result: VMExecutionResult;
|
|
7
|
+
controller: AbortController;
|
|
8
|
+
startedAt: number;
|
|
9
|
+
onExit?: ExecutionHooks['onExit'];
|
|
10
|
+
};
|
|
11
|
+
export declare const interpretVMResult: ({ iteration, result, controller, startedAt, onExit, }: InterpretVMResultProps) => Promise<void>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Chat } from '../chat.js';
|
|
2
|
+
import { Iteration } from '../context.js';
|
|
3
|
+
import { type Tool } from '../tool.js';
|
|
4
|
+
import { Trace } from '../types.js';
|
|
5
|
+
import { ExecutionHooks } from './types.js';
|
|
6
|
+
type ToolWrapperProps = {
|
|
7
|
+
chat?: Chat;
|
|
8
|
+
tool: Tool;
|
|
9
|
+
object?: string;
|
|
10
|
+
traces: Trace[];
|
|
11
|
+
iteration: Iteration;
|
|
12
|
+
beforeHook?: ExecutionHooks['onBeforeTool'];
|
|
13
|
+
afterHook?: ExecutionHooks['onAfterTool'];
|
|
14
|
+
controller: AbortController;
|
|
15
|
+
};
|
|
16
|
+
export declare function wrapTool({ chat, tool, traces, object, iteration, beforeHook, afterHook, controller, }: ToolWrapperProps): (input: any) => Promise<any>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { Cognitive, CognitiveBeta,
|
|
2
|
-
import { Chat } from '
|
|
3
|
-
import { Context, Iteration } from '
|
|
4
|
-
import { Exit, ExitResult } from '
|
|
5
|
-
import { ValueOrGetter } from '
|
|
6
|
-
import { type ObjectInstance } from '
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Trace } from './types.js';
|
|
1
|
+
import { Cognitive, CognitiveBeta, type BotpressClientLike, Models } from '@botpress/cognitive';
|
|
2
|
+
import { Chat } from '../chat.js';
|
|
3
|
+
import { Context, Iteration } from '../context.js';
|
|
4
|
+
import { Exit, ExitResult } from '../exit.js';
|
|
5
|
+
import { ValueOrGetter } from '../getter.js';
|
|
6
|
+
import { type ObjectInstance } from '../objects.js';
|
|
7
|
+
import { Snapshot } from '../snapshots.js';
|
|
8
|
+
import { type Tool } from '../tool.js';
|
|
9
|
+
import { Trace } from '../types.js';
|
|
11
10
|
export type ExecutionHooks = {
|
|
12
11
|
/**
|
|
13
12
|
* NON-BLOCKING HOOK
|
|
@@ -165,7 +164,8 @@ export type ExecutionProps = {
|
|
|
165
164
|
exits?: ValueOrGetter<Exit[], Context>;
|
|
166
165
|
options?: Options;
|
|
167
166
|
/**
|
|
168
|
-
* An instance of a Botpress Client,
|
|
167
|
+
* An instance of a Botpress Client, an instance of Cognitive Client (@botpress/cognitive),
|
|
168
|
+
* or a standalone CognitiveBeta client.
|
|
169
169
|
* This is used to generate content using the LLM and to access the Botpress API.
|
|
170
170
|
* If not provided, a default client will be created using environment variables.
|
|
171
171
|
*/
|
|
@@ -206,6 +206,5 @@ export type ExecutionProps = {
|
|
|
206
206
|
*/
|
|
207
207
|
reasoningEffort?: ValueOrGetter<'low' | 'medium' | 'high' | 'dynamic' | 'none', Context>;
|
|
208
208
|
} & ExecutionHooks;
|
|
209
|
-
export
|
|
210
|
-
export declare const _executeContext: (props: ExecutionProps) => Promise<ExecutionResult>;
|
|
209
|
+
export type RuntimeCognitive = Pick<Cognitive, 'getModelDetails' | 'generateContent'>;
|
|
211
210
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Iteration } from '../context.js';
|
|
2
|
+
import type { ExecutionHooks } from './types.js';
|
|
3
|
+
type FinalizeIterationProps = {
|
|
4
|
+
iteration: Iteration;
|
|
5
|
+
status?: Parameters<Iteration['end']>[0];
|
|
6
|
+
controller: AbortController;
|
|
7
|
+
onIterationEnd?: ExecutionHooks['onIterationEnd'];
|
|
8
|
+
};
|
|
9
|
+
export declare const finalizeIteration: ({ iteration, status, controller, onIterationEnd }: FinalizeIterationProps) => Promise<void>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Context, Iteration } from '../context.js';
|
|
2
|
+
import { type VMContext } from '../vm/types.js';
|
|
3
|
+
import { ExecutionHooks } from './types.js';
|
|
4
|
+
type BuildVMContextProps = {
|
|
5
|
+
ctx: Context;
|
|
6
|
+
iteration: Iteration;
|
|
7
|
+
controller: AbortController;
|
|
8
|
+
onBeforeTool?: ExecutionHooks['onBeforeTool'];
|
|
9
|
+
onAfterTool?: ExecutionHooks['onAfterTool'];
|
|
10
|
+
};
|
|
11
|
+
export declare const buildVMContext: ({ ctx, iteration, controller, onBeforeTool, onAfterTool, }: BuildVMContextProps) => VMContext;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk52QTFQOBcjs = require('./chunk-52QTFQOB.cjs');
|
|
4
|
+
require('./chunk-73XYX76S.cjs');
|
|
5
|
+
require('./chunk-PK72FAKD.cjs');
|
|
6
|
+
require('./chunk-KIN7Y247.cjs');
|
|
7
|
+
require('./chunk-NWTG73QR.cjs');
|
|
8
|
+
require('./chunk-HC2QZTVT.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.Tool = _chunk52QTFQOBcjs.Tool;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
truncateWrappedContent,
|
|
3
3
|
wrapContent
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-MM2FLD3J.js";
|
|
5
|
+
import "./chunk-5MAFEI2A.js";
|
|
6
|
+
import "./chunk-34GJUS6U.js";
|
|
7
7
|
export {
|
|
8
8
|
truncateWrappedContent,
|
|
9
9
|
wrapContent
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk6KR6VRA6cjs = require('./chunk-6KR6VRA6.cjs');
|
|
5
|
+
require('./chunk-NWTG73QR.cjs');
|
|
6
|
+
require('./chunk-HC2QZTVT.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.truncateWrappedContent = _chunk6KR6VRA6cjs.truncateWrappedContent; exports.wrapContent = _chunk6KR6VRA6cjs.wrapContent;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk73XYX76Scjs = require('./chunk-73XYX76S.cjs');
|
|
4
|
+
require('./chunk-PK72FAKD.cjs');
|
|
5
|
+
require('./chunk-KIN7Y247.cjs');
|
|
6
|
+
require('./chunk-NWTG73QR.cjs');
|
|
7
|
+
require('./chunk-HC2QZTVT.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.getTypings = _chunk73XYX76Scjs.getTypings;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTypings
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NPVV3PHY.js";
|
|
4
4
|
import "./chunk-WSVDMGMR.js";
|
|
5
5
|
import "./chunk-YEAWWJSJ.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-5MAFEI2A.js";
|
|
7
|
+
import "./chunk-34GJUS6U.js";
|
|
8
8
|
export {
|
|
9
9
|
getTypings
|
|
10
10
|
};
|