llmz 0.0.80 → 0.0.82
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-W4HLZNF4.js → chunk-22DGAZXC.js} +784 -868
- package/dist/{chunk-ESMRQVFC.js → chunk-2UM7PFM3.js} +6 -6
- package/dist/{chunk-EKXZXQJB.js → chunk-3NVOHQVY.js} +1 -1
- package/dist/{chunk-BSKF4J2E.cjs → chunk-5X5TDCMX.cjs} +51 -51
- package/dist/{chunk-BLB44ZDU.cjs → chunk-BXPPMP5X.cjs} +14 -14
- package/dist/{chunk-F4OZHUMS.cjs → chunk-DLV5FJ42.cjs} +9 -9
- package/dist/{chunk-LR6KTFHO.js → chunk-DO7DN4FZ.js} +1 -1
- package/dist/{chunk-UOPTKXLE.js → chunk-E6UFMAW7.js} +1 -1
- package/dist/{chunk-E5YW5YQN.js → chunk-E74GBCTT.js} +2 -2
- package/dist/{chunk-YTDNCBQW.js → chunk-EQ4JDBE5.js} +1 -1
- package/dist/{chunk-4VYDQ3VF.cjs → chunk-FQ4QCUTI.cjs} +7 -7
- package/dist/{chunk-5CXOW4DC.cjs → chunk-GFZCNSYW.cjs} +797 -881
- package/dist/{chunk-QOM7BK7U.cjs → chunk-H5LCBNN6.cjs} +18 -18
- package/dist/{chunk-UI6J4WKQ.js → chunk-HBKQKO3R.js} +3 -3
- package/dist/{chunk-2KRDL5AW.js → chunk-HP3T6PF4.js} +4 -4
- package/dist/{chunk-54G63644.cjs → chunk-OX3Y2Z5K.cjs} +3 -3
- package/dist/{chunk-UCXQ4U7P.cjs → chunk-TB6TCWEB.cjs} +2 -2
- package/dist/{chunk-WDYTCDIK.cjs → chunk-VXQ2CZ7B.cjs} +4 -4
- package/dist/{chunk-XLUYPCCY.cjs → chunk-X24YFCFY.cjs} +28 -28
- package/dist/{chunk-M4WTTARE.js → chunk-YFG53MRF.js} +1 -1
- package/dist/{component-DWFDDH5N.js → component-GVCCL5XU.js} +3 -3
- package/dist/component-YMPMWSTU.cjs +18 -0
- package/dist/dual-modes-KOU5YJ3Q.cjs +12 -0
- package/dist/dual-modes-X7YHJBFJ.js +12 -0
- package/dist/exit-A34GODDB.cjs +8 -0
- package/dist/exit-J55SREDL.js +8 -0
- package/dist/index.cjs +49 -49
- package/dist/index.js +22 -22
- package/dist/{jsx-PCXQVMLU.js → jsx-RIPUQSAU.js} +2 -2
- package/dist/jsx-XEUSAKAK.cjs +13 -0
- package/dist/{llmz-XRURR7Z5.cjs → llmz-2HD6WKIP.cjs} +34 -30
- package/dist/{llmz-F227HVGB.js → llmz-JTZUIYRP.js} +17 -13
- package/dist/llmz.d.ts +2 -2
- package/dist/quickjs-variant.d.ts +7 -1
- package/dist/tool-B3DJ3D2F.js +11 -0
- package/dist/tool-IWPZD5OY.cjs +11 -0
- package/dist/{truncator-2FSONJM2.js → truncator-HCWH5MJ3.js} +3 -3
- package/dist/truncator-SOO6NHLD.cjs +10 -0
- package/dist/{typings-DVMU3KVB.js → typings-FPFJ5D5R.js} +3 -3
- package/dist/typings-O2FLZGQN.cjs +10 -0
- package/dist/{utils-D3J443FA.js → utils-M5KFPSNZ.js} +2 -2
- package/dist/utils-PWX3JPCF.cjs +39 -0
- package/dist/vm/drivers/node.d.ts +5 -0
- package/dist/vm/drivers/quickjs.d.ts +6 -0
- package/dist/vm/errors.d.ts +21 -0
- package/dist/vm/index.d.ts +3 -0
- package/dist/vm/instrument.d.ts +11 -0
- package/dist/vm/types.d.ts +20 -0
- package/dist/{vm-GDB4GW4S.js → vm-KBBQ7U5L.js} +3 -3
- package/dist/vm-R2XBIWE4.cjs +10 -0
- package/package.json +3 -3
- package/dist/component-RVYDIBUM.cjs +0 -18
- package/dist/dual-modes-A4SC4APN.cjs +0 -12
- package/dist/dual-modes-FNC3BGK3.js +0 -12
- package/dist/exit-56DISPLS.js +0 -8
- package/dist/exit-OOGJ3TAS.cjs +0 -8
- package/dist/jsx-ENFGHP6S.cjs +0 -13
- package/dist/tool-A7EOCUQG.cjs +0 -11
- package/dist/tool-FNWHZGDU.js +0 -11
- package/dist/truncator-6M2EP2NZ.cjs +0 -10
- package/dist/typings-54UIN7ZR.cjs +0 -10
- package/dist/utils-BZUEJT4W.cjs +0 -39
- package/dist/vm-CR5NE6NS.cjs +0 -10
- package/dist/vm.d.ts +0 -9
- package/dist/{chunk-RKKRSBX3.cjs → chunk-7XVBJQ53.cjs} +432 -432
- package/dist/{chunk-5XC6ZMS5.js → chunk-BJMZIH3M.js} +432 -432
- /package/dist/{vm-jsx.test.d.ts → vm/vm-jsx.test.d.ts} +0 -0
- /package/dist/{vm.test.d.ts → vm/vm.test.d.ts} +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkBXPPMP5Xcjs = require('./chunk-BXPPMP5X.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkFQ4QCUTIcjs = require('./chunk-FQ4QCUTI.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunk7XVBJQ53cjs = require('./chunk-7XVBJQ53.cjs');
|
|
14
14
|
|
|
15
15
|
// src/tool.ts
|
|
16
16
|
var _zui = require('@bpinternal/zui');
|
|
@@ -104,8 +104,8 @@ var Tool = (_class = class _Tool {
|
|
|
104
104
|
} else {
|
|
105
105
|
input = _zui.z.any();
|
|
106
106
|
}
|
|
107
|
-
if (!
|
|
108
|
-
const inputExtensions =
|
|
107
|
+
if (!_chunk7XVBJQ53cjs.isEmpty_default.call(void 0, this._staticInputValues)) {
|
|
108
|
+
const inputExtensions = _chunkFQ4QCUTIcjs.convertObjectToZuiLiterals.call(void 0, this._staticInputValues);
|
|
109
109
|
if (_zui.z.is.zuiObject(input)) {
|
|
110
110
|
input = input.extend(inputExtensions);
|
|
111
111
|
} else if (_zui.z.is.zuiArray(input)) {
|
|
@@ -149,13 +149,13 @@ var Tool = (_class = class _Tool {
|
|
|
149
149
|
*/
|
|
150
150
|
rename(name) {
|
|
151
151
|
const before = this.name;
|
|
152
|
-
if (!
|
|
152
|
+
if (!_chunkFQ4QCUTIcjs.isValidIdentifier.call(void 0, name)) {
|
|
153
153
|
throw new Error(
|
|
154
154
|
`Invalid name for tool ${name}. A tool name must start with a letter and contain only letters, numbers, and underscores. It must be 1-50 characters long.`
|
|
155
155
|
);
|
|
156
156
|
}
|
|
157
157
|
this.name = name;
|
|
158
|
-
this.aliases =
|
|
158
|
+
this.aliases = _chunk7XVBJQ53cjs.uniq_default.call(void 0, [name, ...this.aliases.map((alias) => alias === before ? name : alias)]);
|
|
159
159
|
return this;
|
|
160
160
|
}
|
|
161
161
|
/**
|
|
@@ -325,7 +325,7 @@ var Tool = (_class = class _Tool {
|
|
|
325
325
|
* ```
|
|
326
326
|
*/
|
|
327
327
|
constructor(props) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);
|
|
328
|
-
if (!
|
|
328
|
+
if (!_chunkFQ4QCUTIcjs.isValidIdentifier.call(void 0, props.name)) {
|
|
329
329
|
throw new Error(
|
|
330
330
|
`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.`
|
|
331
331
|
);
|
|
@@ -350,17 +350,17 @@ var Tool = (_class = class _Tool {
|
|
|
350
350
|
`Invalid aliases for tool ${props.name}. Expected an array, but got type "${typeof props.aliases}"`
|
|
351
351
|
);
|
|
352
352
|
}
|
|
353
|
-
if (props.aliases && props.aliases.some((alias) => !
|
|
353
|
+
if (props.aliases && props.aliases.some((alias) => !_chunkFQ4QCUTIcjs.isValidIdentifier.call(void 0, alias))) {
|
|
354
354
|
throw new Error(`Invalid aliases for tool ${props.name}. Expected an array of valid identifiers.`);
|
|
355
355
|
}
|
|
356
356
|
if (typeof props.input !== "undefined") {
|
|
357
|
-
if (
|
|
357
|
+
if (_chunkFQ4QCUTIcjs.isZuiSchema.call(void 0, props.input)) {
|
|
358
358
|
try {
|
|
359
359
|
this.input = _zui.transforms.toJSONSchema(props.input);
|
|
360
360
|
} catch (e6) {
|
|
361
361
|
this.input = _zui.transforms.toJSONSchemaLegacy(props.input);
|
|
362
362
|
}
|
|
363
|
-
} else if (
|
|
363
|
+
} else if (_chunkFQ4QCUTIcjs.isJsonSchema.call(void 0, props.input)) {
|
|
364
364
|
this.input = props.input;
|
|
365
365
|
} else {
|
|
366
366
|
throw new Error(
|
|
@@ -369,13 +369,13 @@ var Tool = (_class = class _Tool {
|
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
371
|
if (typeof props.output !== "undefined") {
|
|
372
|
-
if (
|
|
372
|
+
if (_chunkFQ4QCUTIcjs.isZuiSchema.call(void 0, props.output)) {
|
|
373
373
|
try {
|
|
374
374
|
this.output = _zui.transforms.toJSONSchema(props.output);
|
|
375
375
|
} catch (e7) {
|
|
376
376
|
this.output = _zui.transforms.toJSONSchemaLegacy(props.output);
|
|
377
377
|
}
|
|
378
|
-
} else if (
|
|
378
|
+
} else if (_chunkFQ4QCUTIcjs.isJsonSchema.call(void 0, props.output)) {
|
|
379
379
|
this.output = props.output;
|
|
380
380
|
} else {
|
|
381
381
|
throw new Error(
|
|
@@ -384,7 +384,7 @@ var Tool = (_class = class _Tool {
|
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
this.name = props.name;
|
|
387
|
-
this.aliases =
|
|
387
|
+
this.aliases = _chunk7XVBJQ53cjs.uniq_default.call(void 0, [props.name, ..._nullishCoalesce(props.aliases, () => ( []))]);
|
|
388
388
|
this.description = props.description;
|
|
389
389
|
this.metadata = _nullishCoalesce(props.metadata, () => ( {}));
|
|
390
390
|
this._handler = props.handler;
|
|
@@ -495,14 +495,14 @@ var Tool = (_class = class _Tool {
|
|
|
495
495
|
output = _zui.transforms.fromJSONSchemaLegacy(this.output);
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
if (input && _zui.z.is.zuiObject(input.naked()) && typeof this._staticInputValues === "object" && !
|
|
499
|
-
const inputExtensions =
|
|
498
|
+
if (input && _zui.z.is.zuiObject(input.naked()) && typeof this._staticInputValues === "object" && !_chunk7XVBJQ53cjs.isEmpty_default.call(void 0, this._staticInputValues)) {
|
|
499
|
+
const inputExtensions = _chunkFQ4QCUTIcjs.convertObjectToZuiLiterals.call(void 0, this._staticInputValues);
|
|
500
500
|
input = input.extend(inputExtensions);
|
|
501
501
|
} else if (this._staticInputValues !== void 0) {
|
|
502
|
-
input =
|
|
502
|
+
input = _chunkFQ4QCUTIcjs.convertObjectToZuiLiterals.call(void 0, this._staticInputValues);
|
|
503
503
|
}
|
|
504
504
|
const fnType = _zui.z.function(input, _zui.z.promise(output)).title(this.name).describe(_nullishCoalesce(this.description, () => ( "")));
|
|
505
|
-
return
|
|
505
|
+
return _chunkBXPPMP5Xcjs.getTypings.call(void 0, fnType, {
|
|
506
506
|
declaration: true
|
|
507
507
|
});
|
|
508
508
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTypings
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DO7DN4FZ.js";
|
|
4
4
|
import {
|
|
5
5
|
convertObjectToZuiLiterals,
|
|
6
6
|
isJsonSchema,
|
|
7
7
|
isValidIdentifier,
|
|
8
8
|
isZuiSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3NVOHQVY.js";
|
|
10
10
|
import {
|
|
11
11
|
isEmpty_default,
|
|
12
12
|
uniq_default
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BJMZIH3M.js";
|
|
14
14
|
|
|
15
15
|
// src/tool.ts
|
|
16
16
|
import { z, transforms } from "@bpinternal/zui";
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./chunk-YEAWWJSJ.js";
|
|
4
4
|
import {
|
|
5
5
|
getComponentReference
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EQ4JDBE5.js";
|
|
7
7
|
import {
|
|
8
8
|
wrapContent
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YFG53MRF.js";
|
|
10
10
|
import {
|
|
11
11
|
escapeString,
|
|
12
12
|
getTokenizer
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3NVOHQVY.js";
|
|
14
14
|
import {
|
|
15
15
|
countBy_default,
|
|
16
16
|
filter_default,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
toPairs_default,
|
|
28
28
|
uniqWith_default,
|
|
29
29
|
uniq_default
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-BJMZIH3M.js";
|
|
31
31
|
|
|
32
32
|
// src/inspect.ts
|
|
33
33
|
import bytes from "bytes";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk7XVBJQ53cjs = require('./chunk-7XVBJQ53.cjs');
|
|
5
5
|
|
|
6
6
|
// src/jsx.ts
|
|
7
7
|
var _zui = require('@bpinternal/zui');
|
|
@@ -13,9 +13,9 @@ function isJsxComponent(type, component) {
|
|
|
13
13
|
}
|
|
14
14
|
var createJsxComponent = (props) => ({
|
|
15
15
|
__jsx: true,
|
|
16
|
-
type:
|
|
16
|
+
type: _chunk7XVBJQ53cjs.isString_default.call(void 0, props.type) ? props.type.toUpperCase() : "__unknown__",
|
|
17
17
|
children: Array.isArray(props.children) ? props.children : props.children ? [props.children] : [],
|
|
18
|
-
props:
|
|
18
|
+
props: _chunk7XVBJQ53cjs.isPlainObject_default.call(void 0, props.props) ? props.props : {}
|
|
19
19
|
});
|
|
20
20
|
var Jsx = _zui.z.custom(
|
|
21
21
|
(value) => isAnyJsxComponent(value),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkFQ4QCUTIcjs = require('./chunk-FQ4QCUTI.cjs');
|
|
4
4
|
|
|
5
5
|
// src/truncator.ts
|
|
6
6
|
var DEFAULT_REMOVE_CHUNK = 250;
|
|
@@ -25,7 +25,7 @@ function truncateWrappedContent({
|
|
|
25
25
|
throwOnFailure = true
|
|
26
26
|
}) {
|
|
27
27
|
var _a, _b, _c;
|
|
28
|
-
const tokenizer =
|
|
28
|
+
const tokenizer = _chunkFQ4QCUTIcjs.getTokenizer.call(void 0, );
|
|
29
29
|
const parts = [];
|
|
30
30
|
for (const msg of messages) {
|
|
31
31
|
const current = [];
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkOX3Y2Z5Kcjs = require('./chunk-OX3Y2Z5K.cjs');
|
|
6
6
|
|
|
7
7
|
// src/component.ts
|
|
8
8
|
var _zui = require('@bpinternal/zui');
|
|
@@ -136,14 +136,14 @@ var Component = class {
|
|
|
136
136
|
this.definition = definition;
|
|
137
137
|
}
|
|
138
138
|
render(props, children = []) {
|
|
139
|
-
return
|
|
139
|
+
return _chunkOX3Y2Z5Kcjs.createJsxComponent.call(void 0, { type: this.definition.name, props, children });
|
|
140
140
|
}
|
|
141
141
|
};
|
|
142
142
|
function isComponent(rendered, component) {
|
|
143
|
-
return
|
|
143
|
+
return _chunkOX3Y2Z5Kcjs.isJsxComponent.call(void 0, component.definition.name, rendered);
|
|
144
144
|
}
|
|
145
145
|
function isAnyComponent(message) {
|
|
146
|
-
return
|
|
146
|
+
return _chunkOX3Y2Z5Kcjs.isAnyJsxComponent.call(void 0, message);
|
|
147
147
|
}
|
|
148
148
|
function renderToTsx(component) {
|
|
149
149
|
const props = Object.entries(component.props).map(([key, value]) => {
|
|
@@ -2,27 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk5X5TDCMXcjs = require('./chunk-5X5TDCMX.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkH5LCBNN6cjs = require('./chunk-H5LCBNN6.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _chunkPK72FAKDcjs = require('./chunk-PK72FAKD.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkDLV5FJ42cjs = require('./chunk-DLV5FJ42.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkVXQ2CZ7Bcjs = require('./chunk-VXQ2CZ7B.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkTB6TCWEBcjs = require('./chunk-TB6TCWEB.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunk7XVBJQ53cjs = require('./chunk-7XVBJQ53.cjs');
|
|
26
26
|
|
|
27
27
|
// src/exit-parser.ts
|
|
28
28
|
function isValuePrimitive(value) {
|
|
@@ -189,7 +189,7 @@ function parseExit(returnValue, exits) {
|
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
191
|
if (!returnExit.zSchema) {
|
|
192
|
-
const otherProps =
|
|
192
|
+
const otherProps = _chunk7XVBJQ53cjs.omit_default.call(void 0, returnValue, "action");
|
|
193
193
|
const value = Object.keys(otherProps).length === 1 ? Object.values(otherProps)[0] : otherProps;
|
|
194
194
|
return {
|
|
195
195
|
success: true,
|
|
@@ -200,7 +200,7 @@ function parseExit(returnValue, exits) {
|
|
|
200
200
|
let valueToValidate = returnValue.value;
|
|
201
201
|
let alternativeValue = void 0;
|
|
202
202
|
if (valueToValidate === void 0) {
|
|
203
|
-
const otherProps =
|
|
203
|
+
const otherProps = _chunk7XVBJQ53cjs.omit_default.call(void 0, returnValue, "action");
|
|
204
204
|
if (Object.keys(otherProps).length > 0) {
|
|
205
205
|
valueToValidate = otherProps;
|
|
206
206
|
if (Object.keys(otherProps).length === 1) {
|
|
@@ -238,7 +238,7 @@ function parseExit(returnValue, exits) {
|
|
|
238
238
|
if (returnValue.value !== void 0) {
|
|
239
239
|
generatedStatement += `, value: ${generatedType}`;
|
|
240
240
|
} else {
|
|
241
|
-
const otherProps =
|
|
241
|
+
const otherProps = _chunk7XVBJQ53cjs.omit_default.call(void 0, returnValue, "action");
|
|
242
242
|
const propKeys = Object.keys(otherProps);
|
|
243
243
|
if (propKeys.length === 1) {
|
|
244
244
|
generatedStatement += `, ${propKeys[0]}: ${generatedType}`;
|
|
@@ -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 = _chunk5X5TDCMXcjs.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(_chunk5X5TDCMXcjs.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 _chunk5X5TDCMXcjs.inspect.call(void 0, message.payload, message.name, { tokens: 1e3 });
|
|
511
511
|
}
|
|
512
|
-
return
|
|
512
|
+
return _chunk5X5TDCMXcjs.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") {
|
|
@@ -933,15 +933,15 @@ var HookedArray = class extends Array {
|
|
|
933
933
|
};
|
|
934
934
|
|
|
935
935
|
// src/context.ts
|
|
936
|
-
var ThinkExit = new (0,
|
|
936
|
+
var ThinkExit = new (0, _chunkDLV5FJ42cjs.Exit)({
|
|
937
937
|
name: "think",
|
|
938
938
|
description: "Think about the current situation and provide a response"
|
|
939
939
|
});
|
|
940
|
-
var ListenExit = new (0,
|
|
940
|
+
var ListenExit = new (0, _chunkDLV5FJ42cjs.Exit)({
|
|
941
941
|
name: "listen",
|
|
942
942
|
description: "Listen to the user and provide a response"
|
|
943
943
|
});
|
|
944
|
-
var DefaultExit = new (0,
|
|
944
|
+
var DefaultExit = new (0, _chunkDLV5FJ42cjs.Exit)({
|
|
945
945
|
name: "done",
|
|
946
946
|
description: "When the execution is sucessfully completed or when error recovery is not possible",
|
|
947
947
|
schema: _zui.z.discriminatedUnion("success", [
|
|
@@ -1103,7 +1103,7 @@ var Context = (_class2 = class {
|
|
|
1103
1103
|
|
|
1104
1104
|
|
|
1105
1105
|
|
|
1106
|
-
__init3() {this.version =
|
|
1106
|
+
__init3() {this.version = _chunk5X5TDCMXcjs.DualModePrompt}
|
|
1107
1107
|
__init4() {this.timeout = 6e4}
|
|
1108
1108
|
// Default timeout of 60 seconds
|
|
1109
1109
|
|
|
@@ -1139,12 +1139,12 @@ var Context = (_class2 = class {
|
|
|
1139
1139
|
const variables = {};
|
|
1140
1140
|
if ((lastIteration == null ? void 0 : lastIteration.status.type) === "thinking_requested") {
|
|
1141
1141
|
const lastThinkingVariables = lastIteration.status.thinking_requested.variables;
|
|
1142
|
-
if (
|
|
1143
|
-
Object.assign(variables,
|
|
1142
|
+
if (_chunk7XVBJQ53cjs.isPlainObject_default.call(void 0, lastThinkingVariables)) {
|
|
1143
|
+
Object.assign(variables, _chunk7XVBJQ53cjs.cloneDeep_default.call(void 0, lastThinkingVariables));
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
|
-
if (
|
|
1147
|
-
Object.assign(variables,
|
|
1146
|
+
if (_chunk7XVBJQ53cjs.isPlainObject_default.call(void 0, lastIteration == null ? void 0 : lastIteration.variables)) {
|
|
1147
|
+
Object.assign(variables, _chunk7XVBJQ53cjs.cloneDeep_default.call(void 0, _nullishCoalesce((lastIteration == null ? void 0 : lastIteration.variables), () => ( {}))));
|
|
1148
1148
|
}
|
|
1149
1149
|
if (((_a = this.snapshot) == null ? void 0 : _a.status.type) === "resolved") {
|
|
1150
1150
|
for (const v of this.snapshot.variables) {
|
|
@@ -1224,7 +1224,7 @@ var Context = (_class2 = class {
|
|
|
1224
1224
|
...lastIterationMessages,
|
|
1225
1225
|
{
|
|
1226
1226
|
role: "assistant",
|
|
1227
|
-
content:
|
|
1227
|
+
content: _chunkTB6TCWEBcjs.wrapContent.call(void 0, _nullishCoalesce(((_c = lastIteration.llm) == null ? void 0 : _c.output), () => ( "")), { preserve: "top", flex: 4, minTokens: 25 })
|
|
1228
1228
|
},
|
|
1229
1229
|
await this.version.getThinkingMessage({
|
|
1230
1230
|
reason: lastIteration.status.thinking_requested.reason,
|
|
@@ -1237,7 +1237,7 @@ var Context = (_class2 = class {
|
|
|
1237
1237
|
...lastIterationMessages,
|
|
1238
1238
|
{
|
|
1239
1239
|
role: "assistant",
|
|
1240
|
-
content:
|
|
1240
|
+
content: _chunkTB6TCWEBcjs.wrapContent.call(void 0, _nullishCoalesce(((_d = lastIteration.llm) == null ? void 0 : _d.output), () => ( "")), { preserve: "top", flex: 4, minTokens: 25 })
|
|
1241
1241
|
},
|
|
1242
1242
|
await this.version.getInvalidCodeMessage({
|
|
1243
1243
|
code: _nullishCoalesce(lastIteration.code, () => ( "// No code generated")),
|
|
@@ -1250,7 +1250,7 @@ var Context = (_class2 = class {
|
|
|
1250
1250
|
...lastIterationMessages,
|
|
1251
1251
|
{
|
|
1252
1252
|
role: "assistant",
|
|
1253
|
-
content:
|
|
1253
|
+
content: _chunkTB6TCWEBcjs.wrapContent.call(void 0, _nullishCoalesce(((_e = lastIteration.llm) == null ? void 0 : _e.output), () => ( "")), { preserve: "top", flex: 4, minTokens: 25 })
|
|
1254
1254
|
},
|
|
1255
1255
|
await this.version.getInvalidCodeMessage({
|
|
1256
1256
|
code: _nullishCoalesce(lastIteration.code, () => ( "// No code generated")),
|
|
@@ -1263,7 +1263,7 @@ var Context = (_class2 = class {
|
|
|
1263
1263
|
...lastIterationMessages,
|
|
1264
1264
|
{
|
|
1265
1265
|
role: "assistant",
|
|
1266
|
-
content:
|
|
1266
|
+
content: _chunkTB6TCWEBcjs.wrapContent.call(void 0, _nullishCoalesce(((_f = lastIteration.llm) == null ? void 0 : _f.output), () => ( "")), { preserve: "top", flex: 4, minTokens: 25 })
|
|
1267
1267
|
},
|
|
1268
1268
|
await this.version.getCodeExecutionErrorMessage({
|
|
1269
1269
|
message: lastIteration.status.execution_error.message,
|
|
@@ -1279,7 +1279,7 @@ var Context = (_class2 = class {
|
|
|
1279
1279
|
var _a, _b;
|
|
1280
1280
|
const instructions = await getValue(this.instructions, this);
|
|
1281
1281
|
const transcript = new TranscriptArray(await getValue(_nullishCoalesce(((_a = this.chat) == null ? void 0 : _a.transcript), () => ( [])), this));
|
|
1282
|
-
const tools =
|
|
1282
|
+
const tools = _chunkH5LCBNN6cjs.Tool.withUniqueNames(await _asyncNullishCoalesce(await getValue(this.tools, this), async () => ( [])));
|
|
1283
1283
|
const objects = await _asyncNullishCoalesce(await getValue(this.objects, this), async () => ( []));
|
|
1284
1284
|
const exits = await _asyncNullishCoalesce(await getValue(this.exits, this), async () => ( []));
|
|
1285
1285
|
const components = await getValue(_nullishCoalesce(((_b = this.chat) == null ? void 0 : _b.components), () => ( [])), this);
|
|
@@ -1293,7 +1293,7 @@ var Context = (_class2 = class {
|
|
|
1293
1293
|
throw new Error("Too many tools. Expected at most 100 tools.");
|
|
1294
1294
|
}
|
|
1295
1295
|
for (const component of components) {
|
|
1296
|
-
|
|
1296
|
+
_chunkVXQ2CZ7Bcjs.assertValidComponent.call(void 0, component.definition);
|
|
1297
1297
|
}
|
|
1298
1298
|
const ReservedToolNames = [
|
|
1299
1299
|
"think",
|
|
@@ -1312,7 +1312,7 @@ var Context = (_class2 = class {
|
|
|
1312
1312
|
"boolean",
|
|
1313
1313
|
"array"
|
|
1314
1314
|
];
|
|
1315
|
-
const MessageTool = this.chat && components.length ? new (0,
|
|
1315
|
+
const MessageTool = this.chat && components.length ? new (0, _chunkH5LCBNN6cjs.Tool)({
|
|
1316
1316
|
name: "Message",
|
|
1317
1317
|
description: "Send a message to the user",
|
|
1318
1318
|
aliases: Array.from(
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
isAnyComponent,
|
|
6
6
|
isComponent,
|
|
7
7
|
renderToTsx
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-EQ4JDBE5.js";
|
|
9
|
+
import "./chunk-E6UFMAW7.js";
|
|
10
|
+
import "./chunk-BJMZIH3M.js";
|
|
11
11
|
export {
|
|
12
12
|
Component,
|
|
13
13
|
assertValidComponent,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkVXQ2CZ7Bcjs = require('./chunk-VXQ2CZ7B.cjs');
|
|
9
|
+
require('./chunk-OX3Y2Z5K.cjs');
|
|
10
|
+
require('./chunk-7XVBJQ53.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
exports.Component = _chunkVXQ2CZ7Bcjs.Component; exports.assertValidComponent = _chunkVXQ2CZ7Bcjs.assertValidComponent; exports.getComponentReference = _chunkVXQ2CZ7Bcjs.getComponentReference; exports.isAnyComponent = _chunkVXQ2CZ7Bcjs.isAnyComponent; exports.isComponent = _chunkVXQ2CZ7Bcjs.isComponent; exports.renderToTsx = _chunkVXQ2CZ7Bcjs.renderToTsx;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk5X5TDCMXcjs = require('./chunk-5X5TDCMX.cjs');
|
|
4
|
+
require('./chunk-KIN7Y247.cjs');
|
|
5
|
+
require('./chunk-VXQ2CZ7B.cjs');
|
|
6
|
+
require('./chunk-OX3Y2Z5K.cjs');
|
|
7
|
+
require('./chunk-TB6TCWEB.cjs');
|
|
8
|
+
require('./chunk-FQ4QCUTI.cjs');
|
|
9
|
+
require('./chunk-7XVBJQ53.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.DualModePrompt = _chunk5X5TDCMXcjs.DualModePrompt;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DualModePrompt
|
|
3
|
+
} from "./chunk-HP3T6PF4.js";
|
|
4
|
+
import "./chunk-YEAWWJSJ.js";
|
|
5
|
+
import "./chunk-EQ4JDBE5.js";
|
|
6
|
+
import "./chunk-E6UFMAW7.js";
|
|
7
|
+
import "./chunk-YFG53MRF.js";
|
|
8
|
+
import "./chunk-3NVOHQVY.js";
|
|
9
|
+
import "./chunk-BJMZIH3M.js";
|
|
10
|
+
export {
|
|
11
|
+
DualModePrompt
|
|
12
|
+
};
|