llmz 0.0.83 → 0.0.85
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-VDTORFBP.js → chunk-2XSXXGXJ.js} +4 -4
- package/dist/{chunk-I2CZYEMH.js → chunk-EADBCAE7.js} +2 -2
- package/dist/{chunk-RLUTWFAA.cjs → chunk-EC2I4U4G.cjs} +6 -6
- package/dist/{chunk-MM2FLD3J.js → chunk-GEN6TAXY.js} +8 -16
- package/dist/{chunk-6KR6VRA6.cjs → chunk-GFSUTNRM.cjs} +9 -17
- package/dist/{chunk-52QTFQOB.cjs → chunk-H3PZFBJL.cjs} +60 -14
- package/dist/{chunk-73XYX76S.cjs → chunk-KY27DGTG.cjs} +14 -14
- package/dist/{chunk-YCLKXXSF.cjs → chunk-N3XPJTPE.cjs} +18 -18
- package/dist/{chunk-NWTG73QR.cjs → chunk-NFZXJRXS.cjs} +3 -48
- package/dist/{chunk-NPVV3PHY.js → chunk-PASYUKW4.js} +1 -1
- package/dist/{chunk-VLJA22PB.js → chunk-TRWUQSEK.js} +1 -1
- package/dist/{chunk-5Z2SJOGS.js → chunk-YTFNFSDT.js} +65 -19
- package/dist/{chunk-5MAFEI2A.js → chunk-ZHHB3FT4.js} +1 -46
- package/dist/{chunk-NQBIU5VM.cjs → chunk-ZVSO527D.cjs} +25 -25
- package/dist/convert.d.ts +11 -0
- package/dist/{dual-modes-VDFZH4YM.js → dual-modes-5NJMZJTA.js} +3 -3
- package/dist/{dual-modes-E5HGE35E.cjs → dual-modes-WA5TPGJR.cjs} +4 -4
- package/dist/{execute-CJVHUFYI.js → execute-2T75URIX.js} +7 -7
- package/dist/{execute-R6R3A42S.cjs → execute-I53OOORH.cjs} +30 -30
- package/dist/{exit-GKF4EEMZ.js → exit-7NHSUR3V.js} +2 -2
- package/dist/exit-V3ORIN65.cjs +8 -0
- package/dist/index.cjs +33 -33
- package/dist/index.js +16 -16
- package/dist/{tool-4VK7TZV2.cjs → tool-4OPM7QRM.cjs} +4 -4
- package/dist/{tool-JZP3UN2F.js → tool-HXXQMDA3.js} +3 -3
- package/dist/truncator-ZN7X6OMF.cjs +10 -0
- package/dist/{truncator-IIRX3MB2.js → truncator-ZQYBTVCJ.js} +2 -2
- package/dist/{typings-SHVPZ5AR.cjs → typings-QW4427V7.cjs} +3 -3
- package/dist/{typings-SKZSSL2M.js → typings-YD2WAQ4A.js} +2 -2
- package/dist/utils-NQSM5FBL.cjs +39 -0
- package/dist/{utils-SYJGSVFW.js → utils-RKUVYFTJ.js} +1 -3
- package/dist/utils.d.ts +1 -5
- package/package.json +2 -2
- package/dist/exit-VZASQELZ.cjs +0 -8
- package/dist/truncator-NWENJXMR.cjs +0 -10
- package/dist/utils-6MFSS4AT.cjs +0 -41
|
@@ -8,10 +8,10 @@ var _chunkJXD2KJVBcjs = require('./chunk-JXD2KJVB.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
12
|
-
require('./chunk-
|
|
13
|
-
require('./chunk-
|
|
14
|
-
require('./chunk-
|
|
11
|
+
var _chunkN3XPJTPEcjs = require('./chunk-N3XPJTPE.cjs');
|
|
12
|
+
require('./chunk-ZVSO527D.cjs');
|
|
13
|
+
require('./chunk-H3PZFBJL.cjs');
|
|
14
|
+
require('./chunk-KY27DGTG.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
@@ -25,17 +25,17 @@ var _chunkPK72FAKDcjs = require('./chunk-PK72FAKD.cjs');
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
var _chunkKIN7Y247cjs = require('./chunk-KIN7Y247.cjs');
|
|
28
|
-
require('./chunk-
|
|
28
|
+
require('./chunk-EC2I4U4G.cjs');
|
|
29
29
|
require('./chunk-CQ3UJW76.cjs');
|
|
30
30
|
require('./chunk-5ZF6NTYI.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkGFSUTNRMcjs = require('./chunk-GFSUTNRM.cjs');
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunkNFZXJRXScjs = require('./chunk-NFZXJRXS.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -93,11 +93,11 @@ var generateCode = async ({ iteration, ctx, cognitive, controller }) => {
|
|
|
93
93
|
const traces = iteration.traces;
|
|
94
94
|
const modelRef = Array.isArray(iteration.model) ? iteration.model[0] : iteration.model;
|
|
95
95
|
const model = await cognitive.getModelDetails(modelRef).catch((thrown) => {
|
|
96
|
-
throw new (0, _chunkPK72FAKDcjs.CognitiveError)(`Failed to fetch model details for model "${modelRef}": ${
|
|
96
|
+
throw new (0, _chunkPK72FAKDcjs.CognitiveError)(`Failed to fetch model details for model "${modelRef}": ${_chunkNFZXJRXScjs.getErrorMessage.call(void 0, thrown)}`);
|
|
97
97
|
});
|
|
98
98
|
const modelLimit = Math.max(model.input.maxTokens, 8e3);
|
|
99
99
|
const responseLengthBuffer = getModelOutputLimit(modelLimit);
|
|
100
|
-
const messages =
|
|
100
|
+
const messages = _chunkGFSUTNRMcjs.truncateWrappedContent.call(void 0, {
|
|
101
101
|
messages: iteration.messages,
|
|
102
102
|
tokenLimit: modelLimit - responseLengthBuffer,
|
|
103
103
|
throwOnFailure: true
|
|
@@ -119,7 +119,7 @@ var generateCode = async ({ iteration, ctx, cognitive, controller }) => {
|
|
|
119
119
|
messages: messages.filter((x) => x.role !== "system"),
|
|
120
120
|
stopSequences: ctx.version.getStopTokens()
|
|
121
121
|
}).catch((thrown) => {
|
|
122
|
-
throw new (0, _chunkPK72FAKDcjs.CognitiveError)(`LLM generation failed: ${
|
|
122
|
+
throw new (0, _chunkPK72FAKDcjs.CognitiveError)(`LLM generation failed: ${_chunkNFZXJRXScjs.getErrorMessage.call(void 0, thrown)}`);
|
|
123
123
|
});
|
|
124
124
|
const out = typeof ((_c = (_b = output.output.choices) == null ? void 0 : _b[0]) == null ? void 0 : _c.content) === "string" ? output.output.choices[0].content : null;
|
|
125
125
|
if (!out) {
|
|
@@ -243,7 +243,7 @@ var interpretVMResult = async ({
|
|
|
243
243
|
});
|
|
244
244
|
return;
|
|
245
245
|
}
|
|
246
|
-
const parsedExit =
|
|
246
|
+
const parsedExit = _chunkN3XPJTPEcjs.parseExit.call(void 0, returnValue, iteration.exits);
|
|
247
247
|
if (!parsedExit.success) {
|
|
248
248
|
iteration.end({
|
|
249
249
|
type: "exit_error",
|
|
@@ -267,7 +267,7 @@ var interpretVMResult = async ({
|
|
|
267
267
|
type: "exit_error",
|
|
268
268
|
exit_error: {
|
|
269
269
|
exit: returnExit.name,
|
|
270
|
-
message: `Error executing exit ${returnExit.name}: ${
|
|
270
|
+
message: `Error executing exit ${returnExit.name}: ${_chunkNFZXJRXScjs.getErrorMessage.call(void 0, err)}`,
|
|
271
271
|
return_value: returnValue
|
|
272
272
|
}
|
|
273
273
|
});
|
|
@@ -449,7 +449,7 @@ var buildVMContext = ({
|
|
|
449
449
|
onAfterTool
|
|
450
450
|
}) => {
|
|
451
451
|
const traces = iteration.traces;
|
|
452
|
-
const vmContext = { ...
|
|
452
|
+
const vmContext = { ..._chunkNFZXJRXScjs.stripInvalidIdentifiers.call(void 0, iteration.variables) };
|
|
453
453
|
for (const obj of iteration.objects) {
|
|
454
454
|
const internalValues = {};
|
|
455
455
|
const instance = {};
|
|
@@ -473,7 +473,7 @@ var buildVMContext = ({
|
|
|
473
473
|
const parsed = schema.safeParse(value2);
|
|
474
474
|
if (!parsed.success) {
|
|
475
475
|
throw new (0, _chunkPK72FAKDcjs.AssignmentError)(
|
|
476
|
-
`Invalid value for Object property ${obj.name}.${name}: ${
|
|
476
|
+
`Invalid value for Object property ${obj.name}.${name}: ${_chunkNFZXJRXScjs.getErrorMessage.call(void 0, parsed.error)}`
|
|
477
477
|
);
|
|
478
478
|
}
|
|
479
479
|
internalValues[name] = parsed.data;
|
|
@@ -524,7 +524,7 @@ var buildVMContext = ({
|
|
|
524
524
|
// src/runtime/execute.ts
|
|
525
525
|
var executeContext = async (props) => {
|
|
526
526
|
var _a, _b;
|
|
527
|
-
await
|
|
527
|
+
await _chunkNFZXJRXScjs.init.call(void 0, );
|
|
528
528
|
const result = await executeContextInternal(props);
|
|
529
529
|
try {
|
|
530
530
|
(_b = (_a = result.context.chat) == null ? void 0 : _a.onExecutionDone) == null ? void 0 : _b.call(_a, result);
|
|
@@ -538,7 +538,7 @@ var executeContextInternal = async (props) => {
|
|
|
538
538
|
const { onIterationStart, onIterationEnd, onTrace, onExit, onBeforeExecution, onAfterTool, onBeforeTool } = props;
|
|
539
539
|
const client = _nullishCoalesce(props.client, () => ( new (0, _client.Client)()));
|
|
540
540
|
const cognitive = _cognitive.Cognitive.isCognitiveClient(client) ? client : _cognitive.CognitiveBeta.isBetaClient(client) ? _cognitive.cognitiveFromBeta.call(void 0, client) : new (0, _cognitive.Cognitive)({ client, __experimental_beta: true });
|
|
541
|
-
const ctx = new (0,
|
|
541
|
+
const ctx = new (0, _chunkN3XPJTPEcjs.Context)({
|
|
542
542
|
chat: props.chat,
|
|
543
543
|
instructions: props.instructions,
|
|
544
544
|
objects: props.objects,
|
|
@@ -554,7 +554,7 @@ var executeContextInternal = async (props) => {
|
|
|
554
554
|
try {
|
|
555
555
|
while (true) {
|
|
556
556
|
if (ctx.iterations.length >= ctx.loop) {
|
|
557
|
-
return new (0,
|
|
557
|
+
return new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, new (0, _chunkPK72FAKDcjs.LoopExceededError)());
|
|
558
558
|
}
|
|
559
559
|
const iteration = await ctx.nextIteration();
|
|
560
560
|
const unsubscribeTrace = iteration.traces.onPush((traces) => {
|
|
@@ -585,7 +585,7 @@ var executeContextInternal = async (props) => {
|
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
587
|
});
|
|
588
|
-
return new (0,
|
|
588
|
+
return new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted")));
|
|
589
589
|
}
|
|
590
590
|
const iterationResult = await executeIterationWithErrorHandling({
|
|
591
591
|
iteration,
|
|
@@ -614,7 +614,7 @@ var executeContextInternal = async (props) => {
|
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
} catch (error) {
|
|
617
|
-
return new (0,
|
|
617
|
+
return new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(error, () => ( "Unknown error")));
|
|
618
618
|
}
|
|
619
619
|
};
|
|
620
620
|
var executeIterationStartHook = async ({
|
|
@@ -644,7 +644,7 @@ var executeIterationStartHook = async ({
|
|
|
644
644
|
} : {
|
|
645
645
|
type: "execution_error",
|
|
646
646
|
execution_error: {
|
|
647
|
-
message: `Error in onIterationStart hook: ${
|
|
647
|
+
message: `Error in onIterationStart hook: ${_chunkNFZXJRXScjs.getErrorMessage.call(void 0, err)}`,
|
|
648
648
|
stack: _chunkKIN7Y247cjs.cleanStackTrace.call(void 0,
|
|
649
649
|
err instanceof Error ? _nullishCoalesce(err.stack, () => ( "No stack trace available")) : "No stack trace available"
|
|
650
650
|
)
|
|
@@ -687,7 +687,7 @@ var executeIterationWithErrorHandling = async ({
|
|
|
687
687
|
status: iteration.status.type === "pending" ? {
|
|
688
688
|
type: "execution_error",
|
|
689
689
|
execution_error: {
|
|
690
|
-
message: "An unexpected error occurred: " +
|
|
690
|
+
message: "An unexpected error occurred: " + _chunkNFZXJRXScjs.getErrorMessage.call(void 0, err),
|
|
691
691
|
stack: _chunkKIN7Y247cjs.cleanStackTrace.call(void 0,
|
|
692
692
|
err instanceof Error ? _nullishCoalesce(err.stack, () => ( "No stack trace available")) : "No stack trace available"
|
|
693
693
|
)
|
|
@@ -699,7 +699,7 @@ var executeIterationWithErrorHandling = async ({
|
|
|
699
699
|
if (!controller.signal.aborted) {
|
|
700
700
|
return {
|
|
701
701
|
type: "return",
|
|
702
|
-
result: new (0,
|
|
702
|
+
result: new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, err)
|
|
703
703
|
};
|
|
704
704
|
}
|
|
705
705
|
await finalizeIteration({
|
|
@@ -715,7 +715,7 @@ var executeIterationWithErrorHandling = async ({
|
|
|
715
715
|
});
|
|
716
716
|
return {
|
|
717
717
|
type: "return",
|
|
718
|
-
result: new (0,
|
|
718
|
+
result: new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(controller.signal.reason, () => ( "The operation was aborted")))
|
|
719
719
|
};
|
|
720
720
|
}
|
|
721
721
|
};
|
|
@@ -727,7 +727,7 @@ var transformIterationResult = ({
|
|
|
727
727
|
const exitName = iteration.status.exit_success.exit_name;
|
|
728
728
|
return {
|
|
729
729
|
type: "return",
|
|
730
|
-
result: new (0,
|
|
730
|
+
result: new (0, _chunkN3XPJTPEcjs.SuccessExecutionResult)(ctx, {
|
|
731
731
|
exit: iteration.exits.find((x) => x.name === exitName),
|
|
732
732
|
result: iteration.status.exit_success.return_value
|
|
733
733
|
})
|
|
@@ -736,17 +736,17 @@ var transformIterationResult = ({
|
|
|
736
736
|
if (iteration.status.type === "callback_requested") {
|
|
737
737
|
return {
|
|
738
738
|
type: "return",
|
|
739
|
-
result: new (0,
|
|
739
|
+
result: new (0, _chunkN3XPJTPEcjs.PartialExecutionResult)(
|
|
740
740
|
ctx,
|
|
741
741
|
iteration.status.callback_requested.signal,
|
|
742
|
-
|
|
742
|
+
_chunkN3XPJTPEcjs.Snapshot.fromSignal(iteration.status.callback_requested.signal)
|
|
743
743
|
)
|
|
744
744
|
};
|
|
745
745
|
}
|
|
746
746
|
if (iteration.status.type === "aborted") {
|
|
747
747
|
return {
|
|
748
748
|
type: "return",
|
|
749
|
-
result: new (0,
|
|
749
|
+
result: new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(iteration.error, () => ( "The operation was aborted")))
|
|
750
750
|
};
|
|
751
751
|
}
|
|
752
752
|
if (iteration.status.type === "thinking_requested" || iteration.status.type === "exit_error" || iteration.status.type === "execution_error" || iteration.status.type === "invalid_code_error") {
|
|
@@ -754,7 +754,7 @@ var transformIterationResult = ({
|
|
|
754
754
|
}
|
|
755
755
|
return {
|
|
756
756
|
type: "return",
|
|
757
|
-
result: new (0,
|
|
757
|
+
result: new (0, _chunkN3XPJTPEcjs.ErrorExecutionResult)(ctx, _nullishCoalesce(iteration.error, () => ( `Unknown error. Status: ${iteration.status.type}`)))
|
|
758
758
|
};
|
|
759
759
|
};
|
|
760
760
|
var executeIteration = async ({
|
|
@@ -788,7 +788,7 @@ var executeIteration = async ({
|
|
|
788
788
|
iteration.end({
|
|
789
789
|
type: "execution_error",
|
|
790
790
|
execution_error: {
|
|
791
|
-
message: `Error in onBeforeExecution hook: ${
|
|
791
|
+
message: `Error in onBeforeExecution hook: ${_chunkNFZXJRXScjs.getErrorMessage.call(void 0, err)}`,
|
|
792
792
|
stack: _chunkKIN7Y247cjs.cleanStackTrace.call(void 0,
|
|
793
793
|
err instanceof Error ? _nullishCoalesce(err.stack, () => ( "No stack trace available")) : "No stack trace available"
|
|
794
794
|
)
|
|
@@ -823,7 +823,7 @@ var executeIteration = async ({
|
|
|
823
823
|
).catch((err) => {
|
|
824
824
|
return {
|
|
825
825
|
success: false,
|
|
826
|
-
error: err instanceof Error ? err : new Error(
|
|
826
|
+
error: err instanceof Error ? err : new Error(_chunkNFZXJRXScjs.getErrorMessage.call(void 0, err)),
|
|
827
827
|
lines_executed: [],
|
|
828
828
|
traces: [],
|
|
829
829
|
variables: {}
|
package/dist/index.cjs
CHANGED
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
require('./chunk-
|
|
12
|
+
var _chunkN3XPJTPEcjs = require('./chunk-N3XPJTPE.cjs');
|
|
13
|
+
require('./chunk-ZVSO527D.cjs');
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkH3PZFBJLcjs = require('./chunk-H3PZFBJL.cjs');
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _chunkKY27DGTGcjs = require('./chunk-KY27DGTG.cjs');
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
@@ -27,7 +27,7 @@ var _chunkPK72FAKDcjs = require('./chunk-PK72FAKD.cjs');
|
|
|
27
27
|
require('./chunk-KIN7Y247.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _chunkEC2I4U4Gcjs = require('./chunk-EC2I4U4G.cjs');
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
@@ -39,21 +39,21 @@ require('./chunk-5ZF6NTYI.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _chunkGFSUTNRMcjs = require('./chunk-GFSUTNRM.cjs');
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
var
|
|
49
|
+
var _chunkNFZXJRXScjs = require('./chunk-NFZXJRXS.cjs');
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
var _chunkHC2QZTVTcjs = require('./chunk-HC2QZTVT.cjs');
|
|
54
54
|
|
|
55
55
|
// package.json
|
|
56
|
-
var version = "0.0.
|
|
56
|
+
var version = "0.0.85";
|
|
57
57
|
|
|
58
58
|
// src/objects.ts
|
|
59
59
|
var _zui = require('@bpinternal/zui');
|
|
@@ -305,7 +305,7 @@ async function hoistTypings(code, formatOptions) {
|
|
|
305
305
|
break;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
return
|
|
308
|
+
return _chunkKY27DGTGcjs.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 (!_chunkNFZXJRXScjs.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 (!_chunkNFZXJRXScjs.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 = _chunkH3PZFBJLcjs.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(_chunkNFZXJRXScjs.getMultilineComment.call(void 0, description));
|
|
512
512
|
}
|
|
513
513
|
let type = "unknown";
|
|
514
514
|
if (prop.type) {
|
|
515
|
-
type = await
|
|
515
|
+
type = await _chunkKY27DGTGcjs.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 _chunkKY27DGTGcjs.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 = _chunkNFZXJRXScjs.getMultilineComment.call(void 0, obj.description);
|
|
557
557
|
}
|
|
558
|
-
return
|
|
558
|
+
return _chunkKY27DGTGcjs.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 _chunkNFZXJRXScjs.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(${_chunkNFZXJRXScjs.escapeString.call(void 0, property.value.source)}, ${_chunkNFZXJRXScjs.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(${_chunkNFZXJRXScjs.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()))})`;
|
|
@@ -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: _chunkNFZXJRXScjs.toValidObjectName,
|
|
1113
|
+
toValidFunctionName: _chunkNFZXJRXScjs.toValidFunctionName,
|
|
1114
|
+
wrapContent: _chunkGFSUTNRMcjs.wrapContent,
|
|
1115
|
+
truncateWrappedContent: _chunkGFSUTNRMcjs.truncateWrappedContent
|
|
1116
1116
|
};
|
|
1117
1117
|
var execute = async (props) => {
|
|
1118
|
-
const { executeContext } = await Promise.resolve().then(() => _interopRequireWildcard(require("./execute-
|
|
1118
|
+
const { executeContext } = await Promise.resolve().then(() => _interopRequireWildcard(require("./execute-I53OOORH.cjs")));
|
|
1119
1119
|
return executeContext(props);
|
|
1120
1120
|
};
|
|
1121
1121
|
var init = async () => {
|
|
1122
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./execute-
|
|
1122
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./execute-I53OOORH.cjs")));
|
|
1123
1123
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./component-NNHBHD72.cjs")));
|
|
1124
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./tool-
|
|
1125
|
-
await Promise.resolve().then(() => _interopRequireWildcard(require("./exit-
|
|
1124
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./tool-4OPM7QRM.cjs")));
|
|
1125
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./exit-V3ORIN65.cjs")));
|
|
1126
1126
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./jsx-ULPWX5TW.cjs")));
|
|
1127
1127
|
await Promise.resolve().then(() => _interopRequireWildcard(require("./vm-VHB67FVH.cjs")));
|
|
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-
|
|
1128
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./utils-NQSM5FBL.cjs")));
|
|
1129
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./truncator-ZN7X6OMF.cjs")));
|
|
1130
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./typings-QW4427V7.cjs")));
|
|
1131
|
+
await Promise.resolve().then(() => _interopRequireWildcard(require("./dual-modes-WA5TPGJR.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 = _chunkCQ3UJW76cjs.Component; exports.DefaultComponents = DefaultComponents; exports.DefaultExit =
|
|
1162
|
+
exports.Chat = Chat; exports.CitationsManager = CitationsManager; exports.Component = _chunkCQ3UJW76cjs.Component; exports.DefaultComponents = DefaultComponents; exports.DefaultExit = _chunkN3XPJTPEcjs.DefaultExit; exports.ErrorExecutionResult = _chunkN3XPJTPEcjs.ErrorExecutionResult; exports.ExecutionResult = _chunkN3XPJTPEcjs.ExecutionResult; exports.Exit = _chunkEC2I4U4Gcjs.Exit; exports.ListenExit = _chunkN3XPJTPEcjs.ListenExit; exports.LoopExceededError = _chunkPK72FAKDcjs.LoopExceededError; exports.ObjectInstance = ObjectInstance; exports.PartialExecutionResult = _chunkN3XPJTPEcjs.PartialExecutionResult; exports.Snapshot = _chunkN3XPJTPEcjs.Snapshot; exports.SnapshotSignal = _chunkPK72FAKDcjs.SnapshotSignal; exports.SuccessExecutionResult = _chunkN3XPJTPEcjs.SuccessExecutionResult; exports.ThinkExit = _chunkN3XPJTPEcjs.ThinkExit; exports.ThinkSignal = _chunkPK72FAKDcjs.ThinkSignal; exports.Tool = _chunkH3PZFBJLcjs.Tool; exports.assertValidComponent = _chunkCQ3UJW76cjs.assertValidComponent; exports.execute = execute; exports.getValue = _chunkN3XPJTPEcjs.getValue; exports.init = init; exports.isAnyComponent = _chunkCQ3UJW76cjs.isAnyComponent; exports.isComponent = _chunkCQ3UJW76cjs.isComponent; exports.parseExit = _chunkN3XPJTPEcjs.parseExit; exports.renderToTsx = _chunkCQ3UJW76cjs.renderToTsx; exports.utils = utils; exports.version = version;
|
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-2XSXXGXJ.js";
|
|
13
|
+
import "./chunk-EADBCAE7.js";
|
|
14
14
|
import {
|
|
15
15
|
Tool
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YTFNFSDT.js";
|
|
17
17
|
import {
|
|
18
18
|
formatTypings,
|
|
19
19
|
getTypings
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-PASYUKW4.js";
|
|
21
21
|
import {
|
|
22
22
|
CodeFormattingError,
|
|
23
23
|
LoopExceededError,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
import "./chunk-YEAWWJSJ.js";
|
|
28
28
|
import {
|
|
29
29
|
Exit
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-TRWUQSEK.js";
|
|
31
31
|
import {
|
|
32
32
|
Component,
|
|
33
33
|
assertValidComponent,
|
|
@@ -39,21 +39,21 @@ import "./chunk-XTEHT2TK.js";
|
|
|
39
39
|
import {
|
|
40
40
|
truncateWrappedContent,
|
|
41
41
|
wrapContent
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-GEN6TAXY.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-ZHHB3FT4.js";
|
|
50
50
|
import {
|
|
51
51
|
cloneDeep_default,
|
|
52
52
|
upperFirst_default
|
|
53
53
|
} from "./chunk-34GJUS6U.js";
|
|
54
54
|
|
|
55
55
|
// package.json
|
|
56
|
-
var version = "0.0.
|
|
56
|
+
var version = "0.0.85";
|
|
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("./execute-
|
|
1118
|
+
const { executeContext } = await import("./execute-2T75URIX.js");
|
|
1119
1119
|
return executeContext(props);
|
|
1120
1120
|
};
|
|
1121
1121
|
var init = async () => {
|
|
1122
|
-
await import("./execute-
|
|
1122
|
+
await import("./execute-2T75URIX.js");
|
|
1123
1123
|
await import("./component-2Z3KLWLX.js");
|
|
1124
|
-
await import("./tool-
|
|
1125
|
-
await import("./exit-
|
|
1124
|
+
await import("./tool-HXXQMDA3.js");
|
|
1125
|
+
await import("./exit-7NHSUR3V.js");
|
|
1126
1126
|
await import("./jsx-DDZ63UUF.js");
|
|
1127
1127
|
await import("./vm-PYCKS77H.js");
|
|
1128
|
-
await import("./utils-
|
|
1129
|
-
await import("./truncator-
|
|
1130
|
-
await import("./typings-
|
|
1131
|
-
await import("./dual-modes-
|
|
1128
|
+
await import("./utils-RKUVYFTJ.js");
|
|
1129
|
+
await import("./truncator-ZQYBTVCJ.js");
|
|
1130
|
+
await import("./typings-YD2WAQ4A.js");
|
|
1131
|
+
await import("./dual-modes-5NJMZJTA.js");
|
|
1132
1132
|
};
|
|
1133
1133
|
export {
|
|
1134
1134
|
Chat,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkH3PZFBJLcjs = require('./chunk-H3PZFBJL.cjs');
|
|
4
|
+
require('./chunk-KY27DGTG.cjs');
|
|
5
5
|
require('./chunk-PK72FAKD.cjs');
|
|
6
6
|
require('./chunk-KIN7Y247.cjs');
|
|
7
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-NFZXJRXS.cjs');
|
|
8
8
|
require('./chunk-HC2QZTVT.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.Tool =
|
|
11
|
+
exports.Tool = _chunkH3PZFBJLcjs.Tool;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Tool
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-YTFNFSDT.js";
|
|
4
|
+
import "./chunk-PASYUKW4.js";
|
|
5
5
|
import "./chunk-WSVDMGMR.js";
|
|
6
6
|
import "./chunk-YEAWWJSJ.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-ZHHB3FT4.js";
|
|
8
8
|
import "./chunk-34GJUS6U.js";
|
|
9
9
|
export {
|
|
10
10
|
Tool
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkGFSUTNRMcjs = require('./chunk-GFSUTNRM.cjs');
|
|
5
|
+
require('./chunk-NFZXJRXS.cjs');
|
|
6
|
+
require('./chunk-HC2QZTVT.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.truncateWrappedContent = _chunkGFSUTNRMcjs.truncateWrappedContent; exports.wrapContent = _chunkGFSUTNRMcjs.wrapContent;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkKY27DGTGcjs = require('./chunk-KY27DGTG.cjs');
|
|
4
4
|
require('./chunk-PK72FAKD.cjs');
|
|
5
5
|
require('./chunk-KIN7Y247.cjs');
|
|
6
|
-
require('./chunk-
|
|
6
|
+
require('./chunk-NFZXJRXS.cjs');
|
|
7
7
|
require('./chunk-HC2QZTVT.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.getTypings =
|
|
10
|
+
exports.getTypings = _chunkKY27DGTGcjs.getTypings;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTypings
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PASYUKW4.js";
|
|
4
4
|
import "./chunk-WSVDMGMR.js";
|
|
5
5
|
import "./chunk-YEAWWJSJ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-ZHHB3FT4.js";
|
|
7
7
|
import "./chunk-34GJUS6U.js";
|
|
8
8
|
export {
|
|
9
9
|
getTypings
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
var _chunkNFZXJRXScjs = require('./chunk-NFZXJRXS.cjs');
|
|
20
|
+
require('./chunk-HC2QZTVT.cjs');
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
exports.Identifier = _chunkNFZXJRXScjs.Identifier; exports.Tokens = _chunkNFZXJRXScjs.Tokens; exports.awaitObject = _chunkNFZXJRXScjs.awaitObject; exports.escapeString = _chunkNFZXJRXScjs.escapeString; exports.getErrorMessage = _chunkNFZXJRXScjs.getErrorMessage; exports.getMultilineComment = _chunkNFZXJRXScjs.getMultilineComment; exports.getTokenizer = _chunkNFZXJRXScjs.getTokenizer; exports.init = _chunkNFZXJRXScjs.init; exports.isJsonSchema = _chunkNFZXJRXScjs.isJsonSchema; exports.isValidIdentifier = _chunkNFZXJRXScjs.isValidIdentifier; exports.isValidMessageName = _chunkNFZXJRXScjs.isValidMessageName; exports.isValidSchema = _chunkNFZXJRXScjs.isValidSchema; exports.isZuiSchema = _chunkNFZXJRXScjs.isZuiSchema; exports.stripInvalidIdentifiers = _chunkNFZXJRXScjs.stripInvalidIdentifiers; exports.toPropertyKey = _chunkNFZXJRXScjs.toPropertyKey; exports.toValidFunctionName = _chunkNFZXJRXScjs.toValidFunctionName; exports.toValidObjectName = _chunkNFZXJRXScjs.toValidObjectName;
|