@botpress/adk-cli 1.5.14 → 1.5.15
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/cli.js +341 -72
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -64697,7 +64697,7 @@ var init_luxon = __esm(() => {
|
|
|
64697
64697
|
};
|
|
64698
64698
|
});
|
|
64699
64699
|
|
|
64700
|
-
// ../../node_modules/.bun/@botpress+sdk@4.17.3+
|
|
64700
|
+
// ../../node_modules/.bun/@botpress+sdk@4.17.3+d24c76667a197d64/node_modules/@botpress/sdk/dist/index.mjs
|
|
64701
64701
|
var exports_dist2 = {};
|
|
64702
64702
|
__export(exports_dist2, {
|
|
64703
64703
|
z: () => X,
|
|
@@ -79361,7 +79361,7 @@ DeepSeek-R1 is a state-of-the-art large language model optimized with reinforcem
|
|
|
79361
79361
|
};
|
|
79362
79362
|
});
|
|
79363
79363
|
|
|
79364
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
79364
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/chunk-YEAWWJSJ.js
|
|
79365
79365
|
function cleanStackTrace(stack, cleanInternal = true) {
|
|
79366
79366
|
let lines = stack.split(`
|
|
79367
79367
|
`);
|
|
@@ -79393,7 +79393,7 @@ var isInternalLine = (line) => {
|
|
|
79393
79393
|
};
|
|
79394
79394
|
var init_chunk_YEAWWJSJ = () => {};
|
|
79395
79395
|
|
|
79396
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
79396
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/chunk-7WRN4E42.js
|
|
79397
79397
|
var exports_chunk_7WRN4E42 = {};
|
|
79398
79398
|
__export(exports_chunk_7WRN4E42, {
|
|
79399
79399
|
upperFirst_default: () => upperFirst_default,
|
|
@@ -81820,7 +81820,7 @@ var init_chunk_7WRN4E42 = __esm(() => {
|
|
|
81820
81820
|
*/
|
|
81821
81821
|
});
|
|
81822
81822
|
|
|
81823
|
-
// ../../node_modules/.bun/@bpinternal+zui@1.2.
|
|
81823
|
+
// ../../node_modules/.bun/@bpinternal+zui@1.2.2/node_modules/@bpinternal/zui/dist/index.js
|
|
81824
81824
|
var exports_dist3 = {};
|
|
81825
81825
|
__export(exports_dist3, {
|
|
81826
81826
|
z: () => z_exports,
|
|
@@ -83826,6 +83826,10 @@ function _fromJSONSchema(schema) {
|
|
|
83826
83826
|
const inner = _fromJSONSchema(__spreadProps(__spreadValues({}, schema), { readOnly: undefined }));
|
|
83827
83827
|
return inner.readonly();
|
|
83828
83828
|
}
|
|
83829
|
+
if (schema.description !== undefined) {
|
|
83830
|
+
const inner = _fromJSONSchema(__spreadProps(__spreadValues({}, schema), { description: undefined }));
|
|
83831
|
+
return inner.describe(schema.description);
|
|
83832
|
+
}
|
|
83829
83833
|
if (schema.oneOf !== undefined) {
|
|
83830
83834
|
throw new UnsupportedJSONSchemaToZuiError({ oneOf: schema.oneOf });
|
|
83831
83835
|
}
|
|
@@ -83903,7 +83907,7 @@ function _fromJSONSchema(schema) {
|
|
|
83903
83907
|
for (const [key, value2] of Object.entries(schema.properties)) {
|
|
83904
83908
|
const mapped = _fromJSONSchema(value2);
|
|
83905
83909
|
const required = (_b3 = schema.required) != null ? _b3 : [];
|
|
83906
|
-
properties[key] = required.includes(key) ? mapped : mapped.optional();
|
|
83910
|
+
properties[key] = required.includes(key) ? mapped : mapped.isOptional() ? mapped : mapped.optional();
|
|
83907
83911
|
}
|
|
83908
83912
|
return z_default.object(properties);
|
|
83909
83913
|
}
|
|
@@ -90946,7 +90950,7 @@ declare function ${identifier}${typings};${closingTag}`);
|
|
|
90946
90950
|
*/
|
|
90947
90951
|
});
|
|
90948
90952
|
|
|
90949
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
90953
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/chunk-ORQP26SZ.js
|
|
90950
90954
|
function isAnyJsxComponent(component) {
|
|
90951
90955
|
return typeof component === "object" && component !== null && "__jsx" in component && component.__jsx === true && typeof component.type === "string";
|
|
90952
90956
|
}
|
|
@@ -90968,7 +90972,7 @@ var init_chunk_ORQP26SZ = __esm(() => {
|
|
|
90968
90972
|
}));
|
|
90969
90973
|
});
|
|
90970
90974
|
|
|
90971
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
90975
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/chunk-GGWM6X2K.js
|
|
90972
90976
|
function assertValidComponent(component) {
|
|
90973
90977
|
if (!component.name) {
|
|
90974
90978
|
throw new Error("Component must have a name");
|
|
@@ -91699,7 +91703,7 @@ var init_tokenizer = __esm(() => {
|
|
|
91699
91703
|
TiktokenFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((ptr) => wasm.__wbg_tiktoken_free(ptr >>> 0, 1));
|
|
91700
91704
|
});
|
|
91701
91705
|
|
|
91702
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
91706
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/chunk-ZORRILUV.js
|
|
91703
91707
|
function escapeString2(str) {
|
|
91704
91708
|
if (typeof str !== "string") {
|
|
91705
91709
|
return "";
|
|
@@ -91892,7 +91896,7 @@ var init_chunk_ZORRILUV = __esm(() => {
|
|
|
91892
91896
|
Identifier = z_exports.string().min(1).max(100).regex(/^([a-zA-Z_][a-zA-Z0-9_]*)$/, "Identifiers must start with a letter and can only contain letters, numbers and underscores");
|
|
91893
91897
|
});
|
|
91894
91898
|
|
|
91895
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
91899
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/chunk-3JYCCI4S.js
|
|
91896
91900
|
function wrapContent(content, options) {
|
|
91897
91901
|
const preserve = (options == null ? undefined : options.preserve) ?? DEFAULT_TRUNCATE_OPTIONS.preserve;
|
|
91898
91902
|
const flex = (options == null ? undefined : options.flex) ?? DEFAULT_TRUNCATE_OPTIONS.flex;
|
|
@@ -97638,7 +97642,7 @@ var require_lib2 = __commonJS((exports, module) => {
|
|
|
97638
97642
|
}
|
|
97639
97643
|
});
|
|
97640
97644
|
|
|
97641
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
97645
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/chunk-HCC76DDO.js
|
|
97642
97646
|
function printLimitedJson(obj, maxDepth, maxLength, maxKeys) {
|
|
97643
97647
|
const indent = 2;
|
|
97644
97648
|
let currentLength = 0;
|
|
@@ -98839,7 +98843,7 @@ var init_chunk_HCC76DDO = __esm(() => {
|
|
|
98839
98843
|
};
|
|
98840
98844
|
});
|
|
98841
98845
|
|
|
98842
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
98846
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/chunk-MYLTD5WT.js
|
|
98843
98847
|
function registerErrorClass(name2, errorClass) {
|
|
98844
98848
|
errorClasses[name2] = errorClass;
|
|
98845
98849
|
}
|
|
@@ -100122,7 +100126,7 @@ var init_esm = __esm(() => {
|
|
|
100122
100126
|
};
|
|
100123
100127
|
});
|
|
100124
100128
|
|
|
100125
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
100129
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/chunk-IUE5BW56.js
|
|
100126
100130
|
import babel from "prettier/plugins/babel";
|
|
100127
100131
|
import estree from "prettier/plugins/estree";
|
|
100128
100132
|
import typescript from "prettier/plugins/typescript";
|
|
@@ -100383,7 +100387,7 @@ var init_chunk_IUE5BW56 = __esm(() => {
|
|
|
100383
100387
|
];
|
|
100384
100388
|
});
|
|
100385
100389
|
|
|
100386
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
100390
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/chunk-7POUFE5M.js
|
|
100387
100391
|
var Tool = class _Tool {
|
|
100388
100392
|
_staticInputValues;
|
|
100389
100393
|
name;
|
|
@@ -100573,7 +100577,7 @@ var init_chunk_7POUFE5M = __esm(() => {
|
|
|
100573
100577
|
init_dist7();
|
|
100574
100578
|
});
|
|
100575
100579
|
|
|
100576
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
100580
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/chunk-VPTFUOIK.js
|
|
100577
100581
|
var Exit = class _Exit {
|
|
100578
100582
|
name;
|
|
100579
100583
|
aliases = [];
|
|
@@ -100752,7 +100756,7 @@ var init_index_esm = __esm(() => {
|
|
|
100752
100756
|
ulid = factory2();
|
|
100753
100757
|
});
|
|
100754
100758
|
|
|
100755
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
100759
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/chunk-KQPGB6GB.js
|
|
100756
100760
|
function getMessagePreview(message2) {
|
|
100757
100761
|
if (message2.role === "assistant" || message2.role === "user" || message2.role === "summary") {
|
|
100758
100762
|
return message2.content;
|
|
@@ -300733,7 +300737,7 @@ Using plugins:`);
|
|
|
300733
300737
|
});
|
|
300734
300738
|
});
|
|
300735
300739
|
|
|
300736
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
300740
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/chunk-7G5QAIUX.js
|
|
300737
300741
|
function fixTSXUntilNoErrors(rawCode, maxAttempts = 50) {
|
|
300738
300742
|
let code = rawCode;
|
|
300739
300743
|
for (let attempt = 0;attempt < maxAttempts; attempt++) {
|
|
@@ -303602,7 +303606,7 @@ ${Close}
|
|
|
303602
303606
|
];
|
|
303603
303607
|
});
|
|
303604
303608
|
|
|
303605
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
303609
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/llmz-WPO4HYQY.js
|
|
303606
303610
|
var exports_llmz_WPO4HYQY = {};
|
|
303607
303611
|
__export(exports_llmz_WPO4HYQY, {
|
|
303608
303612
|
executeContext: () => executeContext,
|
|
@@ -304189,7 +304193,7 @@ var init_llmz_WPO4HYQY = __esm(() => {
|
|
|
304189
304193
|
};
|
|
304190
304194
|
});
|
|
304191
304195
|
|
|
304192
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
304196
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/component-WFVDVSDK.js
|
|
304193
304197
|
var exports_component_WFVDVSDK = {};
|
|
304194
304198
|
__export(exports_component_WFVDVSDK, {
|
|
304195
304199
|
renderToTsx: () => renderToTsx,
|
|
@@ -304205,7 +304209,7 @@ var init_component_WFVDVSDK = __esm(() => {
|
|
|
304205
304209
|
init_chunk_7WRN4E42();
|
|
304206
304210
|
});
|
|
304207
304211
|
|
|
304208
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
304212
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/tool-GEBXW6AQ.js
|
|
304209
304213
|
var exports_tool_GEBXW6AQ = {};
|
|
304210
304214
|
__export(exports_tool_GEBXW6AQ, {
|
|
304211
304215
|
Tool: () => Tool
|
|
@@ -304219,7 +304223,7 @@ var init_tool_GEBXW6AQ = __esm(() => {
|
|
|
304219
304223
|
init_chunk_7WRN4E42();
|
|
304220
304224
|
});
|
|
304221
304225
|
|
|
304222
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
304226
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/exit-YLO7BY7Z.js
|
|
304223
304227
|
var exports_exit_YLO7BY7Z = {};
|
|
304224
304228
|
__export(exports_exit_YLO7BY7Z, {
|
|
304225
304229
|
Exit: () => Exit
|
|
@@ -304230,7 +304234,7 @@ var init_exit_YLO7BY7Z = __esm(() => {
|
|
|
304230
304234
|
init_chunk_7WRN4E42();
|
|
304231
304235
|
});
|
|
304232
304236
|
|
|
304233
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
304237
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/jsx-AEHVFB3L.js
|
|
304234
304238
|
var exports_jsx_AEHVFB3L = {};
|
|
304235
304239
|
__export(exports_jsx_AEHVFB3L, {
|
|
304236
304240
|
isJsxComponent: () => isJsxComponent,
|
|
@@ -304243,7 +304247,7 @@ var init_jsx_AEHVFB3L = __esm(() => {
|
|
|
304243
304247
|
init_chunk_7WRN4E42();
|
|
304244
304248
|
});
|
|
304245
304249
|
|
|
304246
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
304250
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/vm-I4G4IH7T.js
|
|
304247
304251
|
var exports_vm_I4G4IH7T = {};
|
|
304248
304252
|
__export(exports_vm_I4G4IH7T, {
|
|
304249
304253
|
runAsyncFunction: () => runAsyncFunction,
|
|
@@ -304257,7 +304261,7 @@ var init_vm_I4G4IH7T = __esm(() => {
|
|
|
304257
304261
|
init_chunk_7WRN4E42();
|
|
304258
304262
|
});
|
|
304259
304263
|
|
|
304260
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
304264
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/utils-RQHQ2KOG.js
|
|
304261
304265
|
var exports_utils_RQHQ2KOG = {};
|
|
304262
304266
|
__export(exports_utils_RQHQ2KOG, {
|
|
304263
304267
|
toValidObjectName: () => toValidObjectName,
|
|
@@ -304283,7 +304287,7 @@ var init_utils_RQHQ2KOG = __esm(() => {
|
|
|
304283
304287
|
init_chunk_7WRN4E42();
|
|
304284
304288
|
});
|
|
304285
304289
|
|
|
304286
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
304290
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/truncator-BSP6PQPC.js
|
|
304287
304291
|
var exports_truncator_BSP6PQPC = {};
|
|
304288
304292
|
__export(exports_truncator_BSP6PQPC, {
|
|
304289
304293
|
wrapContent: () => wrapContent,
|
|
@@ -304295,7 +304299,7 @@ var init_truncator_BSP6PQPC = __esm(() => {
|
|
|
304295
304299
|
init_chunk_7WRN4E42();
|
|
304296
304300
|
});
|
|
304297
304301
|
|
|
304298
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
304302
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/typings-3VYUEACY.js
|
|
304299
304303
|
var exports_typings_3VYUEACY = {};
|
|
304300
304304
|
__export(exports_typings_3VYUEACY, {
|
|
304301
304305
|
getTypings: () => getTypings
|
|
@@ -304308,7 +304312,7 @@ var init_typings_3VYUEACY = __esm(() => {
|
|
|
304308
304312
|
init_chunk_7WRN4E42();
|
|
304309
304313
|
});
|
|
304310
304314
|
|
|
304311
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
304315
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/dual-modes-DW3KRXT2.js
|
|
304312
304316
|
var exports_dual_modes_DW3KRXT2 = {};
|
|
304313
304317
|
__export(exports_dual_modes_DW3KRXT2, {
|
|
304314
304318
|
DualModePrompt: () => DualModePrompt
|
|
@@ -304323,7 +304327,7 @@ var init_dual_modes_DW3KRXT2 = __esm(() => {
|
|
|
304323
304327
|
init_chunk_7WRN4E42();
|
|
304324
304328
|
});
|
|
304325
304329
|
|
|
304326
|
-
// ../../node_modules/.bun/llmz@0.0.27+
|
|
304330
|
+
// ../../node_modules/.bun/llmz@0.0.27+7ebc700c42a4de0d/node_modules/llmz/dist/index.js
|
|
304327
304331
|
var exports_dist4 = {};
|
|
304328
304332
|
__export(exports_dist4, {
|
|
304329
304333
|
utils: () => utils,
|
|
@@ -306299,11 +306303,11 @@ var require_dist2 = __commonJS((exports) => {
|
|
|
306299
306303
|
__exportStar(require_usage_metadata(), exports);
|
|
306300
306304
|
});
|
|
306301
306305
|
|
|
306302
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
306306
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/adapters/adapter.js
|
|
306303
306307
|
class Adapter {
|
|
306304
306308
|
}
|
|
306305
306309
|
|
|
306306
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
306310
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/adapters/botpress-table.js
|
|
306307
306311
|
var CRITICAL_TAGS, OPTIONAL_TAGS, FACTOR = 30, Props, TableSchema, searchableColumns, TableJsonSchema, TableAdapter;
|
|
306308
306312
|
var init_botpress_table = __esm(() => {
|
|
306309
306313
|
init_dist7();
|
|
@@ -306467,7 +306471,7 @@ var init_botpress_table = __esm(() => {
|
|
|
306467
306471
|
};
|
|
306468
306472
|
});
|
|
306469
306473
|
|
|
306470
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
306474
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/adapters/memory.js
|
|
306471
306475
|
var MemoryAdapter;
|
|
306472
306476
|
var init_memory = __esm(() => {
|
|
306473
306477
|
MemoryAdapter = class MemoryAdapter extends Adapter {
|
|
@@ -306482,7 +306486,7 @@ var init_memory = __esm(() => {
|
|
|
306482
306486
|
};
|
|
306483
306487
|
});
|
|
306484
306488
|
|
|
306485
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
306489
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/zai.js
|
|
306486
306490
|
class Zai {
|
|
306487
306491
|
static tokenizer = null;
|
|
306488
306492
|
client;
|
|
@@ -306950,7 +306954,7 @@ var init_lodash = __esm(() => {
|
|
|
306950
306954
|
init_isArray();
|
|
306951
306955
|
});
|
|
306952
306956
|
|
|
306953
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
306957
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/emitter.js
|
|
306954
306958
|
class EventEmitter5 {
|
|
306955
306959
|
_listeners = {};
|
|
306956
306960
|
emit(type, event2) {
|
|
@@ -306994,7 +306998,7 @@ class EventEmitter5 {
|
|
|
306994
306998
|
}
|
|
306995
306999
|
}
|
|
306996
307000
|
|
|
306997
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
307001
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/context.js
|
|
306998
307002
|
class ZaiContext {
|
|
306999
307003
|
_startedAt = Date.now();
|
|
307000
307004
|
_inputCost = 0;
|
|
@@ -307127,7 +307131,7 @@ Please return a valid response addressing the error above.`
|
|
|
307127
307131
|
}
|
|
307128
307132
|
var init_context = () => {};
|
|
307129
307133
|
|
|
307130
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
307134
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/response.js
|
|
307131
307135
|
class Response2 {
|
|
307132
307136
|
_promise;
|
|
307133
307137
|
_eventEmitter;
|
|
@@ -307204,7 +307208,7 @@ class Response2 {
|
|
|
307204
307208
|
}
|
|
307205
307209
|
var init_response = () => {};
|
|
307206
307210
|
|
|
307207
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
307211
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/tokenizer.js
|
|
307208
307212
|
async function getTokenizer2() {
|
|
307209
307213
|
if (!tokenizer3) {
|
|
307210
307214
|
while (!getWasmTokenizer) {
|
|
@@ -307219,10 +307223,10 @@ var init_tokenizer2 = __esm(() => {
|
|
|
307219
307223
|
init_tokenizer();
|
|
307220
307224
|
});
|
|
307221
307225
|
|
|
307222
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
307226
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/operations/constants.js
|
|
307223
307227
|
var PROMPT_INPUT_BUFFER = 1048, PROMPT_OUTPUT_BUFFER = 512;
|
|
307224
307228
|
|
|
307225
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
307229
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/operations/text.js
|
|
307226
307230
|
var Options, text = async (prompt, _options, ctx) => {
|
|
307227
307231
|
ctx.controller.signal.throwIfAborted();
|
|
307228
307232
|
const options = Options.parse(_options ?? {});
|
|
@@ -307293,7 +307297,7 @@ var init_text = __esm(() => {
|
|
|
307293
307297
|
};
|
|
307294
307298
|
});
|
|
307295
307299
|
|
|
307296
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
307300
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/utils.js
|
|
307297
307301
|
function fastHash(str) {
|
|
307298
307302
|
let hash = 0;
|
|
307299
307303
|
for (let i2 = 0;i2 < str.length; i2++) {
|
|
@@ -307318,7 +307322,7 @@ var stringify = (input, beautify = true) => {
|
|
|
307318
307322
|
return result;
|
|
307319
307323
|
};
|
|
307320
307324
|
|
|
307321
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
307325
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/operations/rewrite.js
|
|
307322
307326
|
var _Example, Options2, START = "\u25A0START\u25A0", END = "\u25A0END\u25A0", rewrite = async (original, prompt, _options, ctx) => {
|
|
307323
307327
|
ctx.controller.signal.throwIfAborted();
|
|
307324
307328
|
const options = Options2.parse(_options ?? {});
|
|
@@ -307456,7 +307460,149 @@ var init_rewrite = __esm(() => {
|
|
|
307456
307460
|
};
|
|
307457
307461
|
});
|
|
307458
307462
|
|
|
307459
|
-
// ../../node_modules/.bun
|
|
307463
|
+
// ../../node_modules/.bun/yocto-queue@1.2.1/node_modules/yocto-queue/index.js
|
|
307464
|
+
class Node2 {
|
|
307465
|
+
value;
|
|
307466
|
+
next;
|
|
307467
|
+
constructor(value2) {
|
|
307468
|
+
this.value = value2;
|
|
307469
|
+
}
|
|
307470
|
+
}
|
|
307471
|
+
var Queue;
|
|
307472
|
+
var init_yocto_queue = __esm(() => {
|
|
307473
|
+
Queue = class Queue {
|
|
307474
|
+
#head;
|
|
307475
|
+
#tail;
|
|
307476
|
+
#size;
|
|
307477
|
+
constructor() {
|
|
307478
|
+
this.clear();
|
|
307479
|
+
}
|
|
307480
|
+
enqueue(value2) {
|
|
307481
|
+
const node = new Node2(value2);
|
|
307482
|
+
if (this.#head) {
|
|
307483
|
+
this.#tail.next = node;
|
|
307484
|
+
this.#tail = node;
|
|
307485
|
+
} else {
|
|
307486
|
+
this.#head = node;
|
|
307487
|
+
this.#tail = node;
|
|
307488
|
+
}
|
|
307489
|
+
this.#size++;
|
|
307490
|
+
}
|
|
307491
|
+
dequeue() {
|
|
307492
|
+
const current = this.#head;
|
|
307493
|
+
if (!current) {
|
|
307494
|
+
return;
|
|
307495
|
+
}
|
|
307496
|
+
this.#head = this.#head.next;
|
|
307497
|
+
this.#size--;
|
|
307498
|
+
return current.value;
|
|
307499
|
+
}
|
|
307500
|
+
peek() {
|
|
307501
|
+
if (!this.#head) {
|
|
307502
|
+
return;
|
|
307503
|
+
}
|
|
307504
|
+
return this.#head.value;
|
|
307505
|
+
}
|
|
307506
|
+
clear() {
|
|
307507
|
+
this.#head = undefined;
|
|
307508
|
+
this.#tail = undefined;
|
|
307509
|
+
this.#size = 0;
|
|
307510
|
+
}
|
|
307511
|
+
get size() {
|
|
307512
|
+
return this.#size;
|
|
307513
|
+
}
|
|
307514
|
+
*[Symbol.iterator]() {
|
|
307515
|
+
let current = this.#head;
|
|
307516
|
+
while (current) {
|
|
307517
|
+
yield current.value;
|
|
307518
|
+
current = current.next;
|
|
307519
|
+
}
|
|
307520
|
+
}
|
|
307521
|
+
*drain() {
|
|
307522
|
+
while (this.#head) {
|
|
307523
|
+
yield this.dequeue();
|
|
307524
|
+
}
|
|
307525
|
+
}
|
|
307526
|
+
};
|
|
307527
|
+
});
|
|
307528
|
+
|
|
307529
|
+
// ../../node_modules/.bun/p-limit@7.2.0/node_modules/p-limit/index.js
|
|
307530
|
+
function pLimit(concurrency) {
|
|
307531
|
+
validateConcurrency(concurrency);
|
|
307532
|
+
const queue = new Queue;
|
|
307533
|
+
let activeCount = 0;
|
|
307534
|
+
const resumeNext = () => {
|
|
307535
|
+
if (activeCount < concurrency && queue.size > 0) {
|
|
307536
|
+
activeCount++;
|
|
307537
|
+
queue.dequeue()();
|
|
307538
|
+
}
|
|
307539
|
+
};
|
|
307540
|
+
const next = () => {
|
|
307541
|
+
activeCount--;
|
|
307542
|
+
resumeNext();
|
|
307543
|
+
};
|
|
307544
|
+
const run = async (function_, resolve, arguments_) => {
|
|
307545
|
+
const result = (async () => function_(...arguments_))();
|
|
307546
|
+
resolve(result);
|
|
307547
|
+
try {
|
|
307548
|
+
await result;
|
|
307549
|
+
} catch {}
|
|
307550
|
+
next();
|
|
307551
|
+
};
|
|
307552
|
+
const enqueue = (function_, resolve, arguments_) => {
|
|
307553
|
+
new Promise((internalResolve) => {
|
|
307554
|
+
queue.enqueue(internalResolve);
|
|
307555
|
+
}).then(run.bind(undefined, function_, resolve, arguments_));
|
|
307556
|
+
if (activeCount < concurrency) {
|
|
307557
|
+
resumeNext();
|
|
307558
|
+
}
|
|
307559
|
+
};
|
|
307560
|
+
const generator = (function_, ...arguments_) => new Promise((resolve) => {
|
|
307561
|
+
enqueue(function_, resolve, arguments_);
|
|
307562
|
+
});
|
|
307563
|
+
Object.defineProperties(generator, {
|
|
307564
|
+
activeCount: {
|
|
307565
|
+
get: () => activeCount
|
|
307566
|
+
},
|
|
307567
|
+
pendingCount: {
|
|
307568
|
+
get: () => queue.size
|
|
307569
|
+
},
|
|
307570
|
+
clearQueue: {
|
|
307571
|
+
value() {
|
|
307572
|
+
queue.clear();
|
|
307573
|
+
}
|
|
307574
|
+
},
|
|
307575
|
+
concurrency: {
|
|
307576
|
+
get: () => concurrency,
|
|
307577
|
+
set(newConcurrency) {
|
|
307578
|
+
validateConcurrency(newConcurrency);
|
|
307579
|
+
concurrency = newConcurrency;
|
|
307580
|
+
queueMicrotask(() => {
|
|
307581
|
+
while (activeCount < concurrency && queue.size > 0) {
|
|
307582
|
+
resumeNext();
|
|
307583
|
+
}
|
|
307584
|
+
});
|
|
307585
|
+
}
|
|
307586
|
+
},
|
|
307587
|
+
map: {
|
|
307588
|
+
async value(iterable, function_) {
|
|
307589
|
+
const promises = Array.from(iterable, (value2, index) => this(function_, value2, index));
|
|
307590
|
+
return Promise.all(promises);
|
|
307591
|
+
}
|
|
307592
|
+
}
|
|
307593
|
+
});
|
|
307594
|
+
return generator;
|
|
307595
|
+
}
|
|
307596
|
+
function validateConcurrency(concurrency) {
|
|
307597
|
+
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
307598
|
+
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
307599
|
+
}
|
|
307600
|
+
}
|
|
307601
|
+
var init_p_limit = __esm(() => {
|
|
307602
|
+
init_yocto_queue();
|
|
307603
|
+
});
|
|
307604
|
+
|
|
307605
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/operations/summarize.js
|
|
307460
307606
|
var Options3, START2 = "\u25A0START\u25A0", END2 = "\u25A0END\u25A0", summarize = async (original, options, ctx) => {
|
|
307461
307607
|
ctx.controller.signal.throwIfAborted();
|
|
307462
307608
|
const tokenizer4 = await getTokenizer2();
|
|
@@ -307489,8 +307635,9 @@ ${newText}
|
|
|
307489
307635
|
const useMergeSort = parts >= Math.pow(2, N3);
|
|
307490
307636
|
const chunkSize = Math.ceil(tokens.length / (parts * N3));
|
|
307491
307637
|
if (useMergeSort) {
|
|
307638
|
+
const limit = pLimit(10);
|
|
307492
307639
|
const chunks = chunk_default(tokens, chunkSize).map((x) => x.join(""));
|
|
307493
|
-
const allSummaries = (await Promise.allSettled(chunks.map((chunk2) => summarize(chunk2, options, ctx)))).filter((x) => x.status === "fulfilled").map((x) => x.value);
|
|
307640
|
+
const allSummaries = (await Promise.allSettled(chunks.map((chunk2) => limit(() => summarize(chunk2, options, ctx))))).filter((x) => x.status === "fulfilled").map((x) => x.value);
|
|
307494
307641
|
return summarize(allSummaries.join(`
|
|
307495
307642
|
|
|
307496
307643
|
============
|
|
@@ -307569,6 +307716,7 @@ ${options.format}
|
|
|
307569
307716
|
var init_summarize = __esm(() => {
|
|
307570
307717
|
init_dist7();
|
|
307571
307718
|
init_lodash();
|
|
307719
|
+
init_p_limit();
|
|
307572
307720
|
init_context();
|
|
307573
307721
|
init_response();
|
|
307574
307722
|
init_tokenizer2();
|
|
@@ -307597,7 +307745,7 @@ var init_summarize = __esm(() => {
|
|
|
307597
307745
|
};
|
|
307598
307746
|
});
|
|
307599
307747
|
|
|
307600
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
307748
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/operations/check.js
|
|
307601
307749
|
var _Example2, _Options, TRUE = "\u25A0TRUE\u25A0", FALSE = "\u25A0FALSE\u25A0", END3 = "\u25A0END\u25A0", check2 = async (input, condition, options, ctx) => {
|
|
307602
307750
|
ctx.controller.signal.throwIfAborted();
|
|
307603
307751
|
const tokenizer4 = await getTokenizer2();
|
|
@@ -307777,7 +307925,7 @@ var init_check = __esm(() => {
|
|
|
307777
307925
|
};
|
|
307778
307926
|
});
|
|
307779
307927
|
|
|
307780
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
307928
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/operations/filter.js
|
|
307781
307929
|
var _Example3, _Options2, END4 = "\u25A0END\u25A0", filter3 = async (input, condition, _options, ctx) => {
|
|
307782
307930
|
ctx.controller.signal.throwIfAborted();
|
|
307783
307931
|
const options = _Options2.parse(_options ?? {});
|
|
@@ -307943,12 +308091,14 @@ The condition is: "${condition}"
|
|
|
307943
308091
|
}
|
|
307944
308092
|
return partial;
|
|
307945
308093
|
};
|
|
307946
|
-
const
|
|
308094
|
+
const limit = pLimit(10);
|
|
308095
|
+
const filteredChunks = await Promise.all(chunks.map((chunk2) => limit(() => filterChunk(chunk2))));
|
|
307947
308096
|
return filteredChunks.flat();
|
|
307948
308097
|
};
|
|
307949
308098
|
var init_filter = __esm(() => {
|
|
307950
308099
|
init_dist7();
|
|
307951
308100
|
init_lodash();
|
|
308101
|
+
init_p_limit();
|
|
307952
308102
|
init_context();
|
|
307953
308103
|
init_response();
|
|
307954
308104
|
init_tokenizer2();
|
|
@@ -308644,30 +308794,144 @@ var init_esm2 = __esm(() => {
|
|
|
308644
308794
|
init_jsonrepair();
|
|
308645
308795
|
});
|
|
308646
308796
|
|
|
308647
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
308797
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/operations/errors.js
|
|
308648
308798
|
var JsonParsingError;
|
|
308649
308799
|
var init_errors = __esm(() => {
|
|
308800
|
+
init_dist7();
|
|
308650
308801
|
JsonParsingError = class JsonParsingError extends Error {
|
|
308651
308802
|
constructor(json, error) {
|
|
308652
|
-
const message2 =
|
|
308803
|
+
const message2 = JsonParsingError._formatError(json, error);
|
|
308804
|
+
super(message2);
|
|
308805
|
+
this.json = json;
|
|
308806
|
+
this.error = error;
|
|
308807
|
+
}
|
|
308808
|
+
static _formatError(json, error) {
|
|
308809
|
+
let errorMessage = `Error parsing JSON:
|
|
308653
308810
|
|
|
308654
|
-
|
|
308811
|
+
`;
|
|
308812
|
+
errorMessage += `---JSON---
|
|
308655
308813
|
${json}
|
|
308656
308814
|
|
|
308657
|
-
|
|
308815
|
+
`;
|
|
308816
|
+
if (error instanceof ZodError) {
|
|
308817
|
+
errorMessage += `---Validation Errors---
|
|
308658
308818
|
|
|
308659
|
-
|
|
308660
|
-
|
|
308661
|
-
|
|
308662
|
-
|
|
308819
|
+
`;
|
|
308820
|
+
errorMessage += JsonParsingError._formatZodError(error);
|
|
308821
|
+
} else {
|
|
308822
|
+
errorMessage += `---Error---
|
|
308823
|
+
|
|
308824
|
+
`;
|
|
308825
|
+
errorMessage += `The JSON provided is not valid JSON.
|
|
308826
|
+
`;
|
|
308827
|
+
errorMessage += `Details: ${error.message}
|
|
308828
|
+
`;
|
|
308829
|
+
}
|
|
308830
|
+
return errorMessage;
|
|
308831
|
+
}
|
|
308832
|
+
static _formatZodError(zodError) {
|
|
308833
|
+
const issues = zodError.issues;
|
|
308834
|
+
if (issues.length === 0) {
|
|
308835
|
+
return `Unknown validation error
|
|
308836
|
+
`;
|
|
308837
|
+
}
|
|
308838
|
+
let message2 = "";
|
|
308839
|
+
for (let i2 = 0;i2 < issues.length; i2++) {
|
|
308840
|
+
const issue = issues[i2];
|
|
308841
|
+
const path6 = issue.path.length > 0 ? issue.path.join(".") : "root";
|
|
308842
|
+
message2 += `${i2 + 1}. Field: "${path6}"
|
|
308843
|
+
`;
|
|
308844
|
+
switch (issue.code) {
|
|
308845
|
+
case "invalid_type":
|
|
308846
|
+
message2 += ` Problem: Expected ${issue.expected}, but received ${issue.received}
|
|
308847
|
+
`;
|
|
308848
|
+
message2 += ` Message: ${issue.message}
|
|
308849
|
+
`;
|
|
308850
|
+
break;
|
|
308851
|
+
case "invalid_string":
|
|
308852
|
+
if ("validation" in issue) {
|
|
308853
|
+
message2 += ` Problem: Invalid ${issue.validation} format
|
|
308854
|
+
`;
|
|
308855
|
+
}
|
|
308856
|
+
message2 += ` Message: ${issue.message}
|
|
308857
|
+
`;
|
|
308858
|
+
break;
|
|
308859
|
+
case "too_small":
|
|
308860
|
+
if (issue.type === "string") {
|
|
308861
|
+
if (issue.exact) {
|
|
308862
|
+
message2 += ` Problem: String must be exactly ${issue.minimum} characters
|
|
308863
|
+
`;
|
|
308864
|
+
} else {
|
|
308865
|
+
message2 += ` Problem: String must be at least ${issue.minimum} characters
|
|
308866
|
+
`;
|
|
308867
|
+
}
|
|
308868
|
+
} else if (issue.type === "number") {
|
|
308869
|
+
message2 += ` Problem: Number must be ${issue.inclusive ? "at least" : "greater than"} ${issue.minimum}
|
|
308870
|
+
`;
|
|
308871
|
+
} else if (issue.type === "array") {
|
|
308872
|
+
message2 += ` Problem: Array must contain ${issue.inclusive ? "at least" : "more than"} ${issue.minimum} items
|
|
308873
|
+
`;
|
|
308874
|
+
}
|
|
308875
|
+
message2 += ` Message: ${issue.message}
|
|
308876
|
+
`;
|
|
308877
|
+
break;
|
|
308878
|
+
case "too_big":
|
|
308879
|
+
if (issue.type === "string") {
|
|
308880
|
+
if (issue.exact) {
|
|
308881
|
+
message2 += ` Problem: String must be exactly ${issue.maximum} characters
|
|
308882
|
+
`;
|
|
308883
|
+
} else {
|
|
308884
|
+
message2 += ` Problem: String must be at most ${issue.maximum} characters
|
|
308885
|
+
`;
|
|
308886
|
+
}
|
|
308887
|
+
} else if (issue.type === "number") {
|
|
308888
|
+
message2 += ` Problem: Number must be ${issue.inclusive ? "at most" : "less than"} ${issue.maximum}
|
|
308889
|
+
`;
|
|
308890
|
+
} else if (issue.type === "array") {
|
|
308891
|
+
message2 += ` Problem: Array must contain ${issue.inclusive ? "at most" : "fewer than"} ${issue.maximum} items
|
|
308892
|
+
`;
|
|
308893
|
+
}
|
|
308894
|
+
message2 += ` Message: ${issue.message}
|
|
308895
|
+
`;
|
|
308896
|
+
break;
|
|
308897
|
+
case "invalid_enum_value":
|
|
308898
|
+
message2 += ` Problem: Invalid value "${issue.received}"
|
|
308899
|
+
`;
|
|
308900
|
+
message2 += ` Allowed values: ${issue.options.map((o2) => `"${o2}"`).join(", ")}
|
|
308901
|
+
`;
|
|
308902
|
+
message2 += ` Message: ${issue.message}
|
|
308903
|
+
`;
|
|
308904
|
+
break;
|
|
308905
|
+
case "invalid_literal":
|
|
308906
|
+
message2 += ` Problem: Expected the literal value "${issue.expected}", but received "${issue.received}"
|
|
308907
|
+
`;
|
|
308908
|
+
message2 += ` Message: ${issue.message}
|
|
308909
|
+
`;
|
|
308910
|
+
break;
|
|
308911
|
+
case "invalid_union":
|
|
308912
|
+
message2 += ` Problem: Value doesn't match any of the expected formats
|
|
308913
|
+
`;
|
|
308914
|
+
message2 += ` Message: ${issue.message}
|
|
308915
|
+
`;
|
|
308916
|
+
break;
|
|
308917
|
+
default:
|
|
308918
|
+
message2 += ` Problem: ${issue.message}
|
|
308919
|
+
`;
|
|
308920
|
+
}
|
|
308921
|
+
if (i2 < issues.length - 1) {
|
|
308922
|
+
message2 += `
|
|
308923
|
+
`;
|
|
308924
|
+
}
|
|
308925
|
+
}
|
|
308926
|
+
return message2;
|
|
308663
308927
|
}
|
|
308664
308928
|
};
|
|
308665
308929
|
});
|
|
308666
308930
|
|
|
308667
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
308668
|
-
var import_json5, Options4, START3 = "\u25A0json_start\u25A0", END5 = "\u25A0json_end\u25A0", NO_MORE = "\u25A0NO_MORE_ELEMENT\u25A0", extract = async (input, _schema, _options, ctx) => {
|
|
308931
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/operations/extract.js
|
|
308932
|
+
var import_json5, Options4, START3 = "\u25A0json_start\u25A0", END5 = "\u25A0json_end\u25A0", NO_MORE = "\u25A0NO_MORE_ELEMENT\u25A0", ZERO_ELEMENTS = "\u25A0ZERO_ELEMENTS\u25A0", extract = async (input, _schema, _options, ctx) => {
|
|
308669
308933
|
ctx.controller.signal.throwIfAborted();
|
|
308670
|
-
let schema = _schema;
|
|
308934
|
+
let schema = transforms_exports.fromJSONSchema(transforms_exports.toJSONSchema(_schema));
|
|
308671
308935
|
const options = Options4.parse(_options ?? {});
|
|
308672
308936
|
const tokenizer4 = await getTokenizer2();
|
|
308673
308937
|
const model = await ctx.getModel();
|
|
@@ -308709,12 +308973,13 @@ var import_json5, Options4, START3 = "\u25A0json_start\u25A0", END5 = "\u25A0jso
|
|
|
308709
308973
|
const keys3 = Object.keys(schema.shape);
|
|
308710
308974
|
const inputAsString = stringify(input);
|
|
308711
308975
|
if (tokenizer4.count(inputAsString) > options.chunkLength) {
|
|
308976
|
+
const limit = pLimit(10);
|
|
308712
308977
|
const tokens = tokenizer4.split(inputAsString);
|
|
308713
308978
|
const chunks = chunk_default(tokens, options.chunkLength).map((x) => x.join(""));
|
|
308714
|
-
const all3 = await Promise.allSettled(chunks.map((chunk2) => extract(chunk2, originalSchema, {
|
|
308979
|
+
const all3 = await Promise.allSettled(chunks.map((chunk2) => limit(() => extract(chunk2, originalSchema, {
|
|
308715
308980
|
...options,
|
|
308716
308981
|
strict: false
|
|
308717
|
-
}, ctx))).then((results) => results.filter((x) => x.status === "fulfilled").map((x) => x.value));
|
|
308982
|
+
}, ctx)))).then((results) => results.filter((x) => x.status === "fulfilled").map((x) => x.value));
|
|
308718
308983
|
ctx.controller.signal.throwIfAborted();
|
|
308719
308984
|
const rows = all3.map((x, idx) => `<part-${idx + 1}>
|
|
308720
308985
|
${stringify(x, true)}
|
|
@@ -308741,8 +309006,9 @@ Merge it back into a final result.`.trim(), originalSchema, options, ctx);
|
|
|
308741
309006
|
instructions.push("You may have multiple elements, or zero elements in the input.");
|
|
308742
309007
|
instructions.push("You must extract each element separately.");
|
|
308743
309008
|
instructions.push(`Each element must be a JSON object with exactly the format: ${START3}${shape}${END5}`);
|
|
309009
|
+
instructions.push(`If there are no elements to extract, respond with ${ZERO_ELEMENTS}.`);
|
|
308744
309010
|
instructions.push(`When you are done extracting all elements, type "${NO_MORE}" to finish.`);
|
|
308745
|
-
instructions.push(`For example, if you have zero elements, the output should look like this: ${NO_MORE}`);
|
|
309011
|
+
instructions.push(`For example, if you have zero elements, the output should look like this: ${ZERO_ELEMENTS}${NO_MORE}`);
|
|
308746
309012
|
instructions.push(`For example, if you have two elements, the output should look like this: ${START3}${abbv}${END5}${START3}${abbv}${END5}${NO_MORE}`);
|
|
308747
309013
|
} else {
|
|
308748
309014
|
instructions.push("You may have exactly one element in the input.");
|
|
@@ -308918,6 +309184,7 @@ var init_extract = __esm(() => {
|
|
|
308918
309184
|
init_dist7();
|
|
308919
309185
|
init_esm2();
|
|
308920
309186
|
init_lodash();
|
|
309187
|
+
init_p_limit();
|
|
308921
309188
|
init_context();
|
|
308922
309189
|
init_response();
|
|
308923
309190
|
init_tokenizer2();
|
|
@@ -308941,7 +309208,7 @@ var init_extract = __esm(() => {
|
|
|
308941
309208
|
};
|
|
308942
309209
|
});
|
|
308943
309210
|
|
|
308944
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
309211
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/operations/label.js
|
|
308945
309212
|
var LABELS, ALL_LABELS, _Options3, _Labels, parseLabel = (label2) => {
|
|
308946
309213
|
label2 = label2.toUpperCase().replace(/\s+/g, "_").replace(/_{2,}/g, "_").trim();
|
|
308947
309214
|
if (label2.includes("ABSOLUTELY") && label2.includes("NOT")) {
|
|
@@ -308981,9 +309248,10 @@ var LABELS, ALL_LABELS, _Options3, _Labels, parseLabel = (label2) => {
|
|
|
308981
309248
|
const CHUNK_INPUT_MAX_TOKENS = clamp_default2(TOTAL_MAX_TOKENS - CHUNK_EXAMPLES_MAX_TOKENS, TOTAL_MAX_TOKENS * 0.5, TOTAL_MAX_TOKENS);
|
|
308982
309249
|
const inputAsString = stringify(input);
|
|
308983
309250
|
if (tokenizer4.count(inputAsString) > CHUNK_INPUT_MAX_TOKENS) {
|
|
309251
|
+
const limit = pLimit(10);
|
|
308984
309252
|
const tokens = tokenizer4.split(inputAsString);
|
|
308985
309253
|
const chunks = chunk_default(tokens, CHUNK_INPUT_MAX_TOKENS).map((x) => x.join(""));
|
|
308986
|
-
const allLabels = await Promise.all(chunks.map((chunk2) => label(chunk2, _labels, _options, ctx)));
|
|
309254
|
+
const allLabels = await Promise.all(chunks.map((chunk2) => limit(() => label(chunk2, _labels, _options, ctx))));
|
|
308987
309255
|
return allLabels.reduce((acc, x) => {
|
|
308988
309256
|
Object.keys(x).forEach((key) => {
|
|
308989
309257
|
if (acc[key]?.value === true) {
|
|
@@ -309160,6 +309428,7 @@ For example, you can say: "According to Expert Example #1, ..."`.trim()
|
|
|
309160
309428
|
var init_label = __esm(() => {
|
|
309161
309429
|
init_dist7();
|
|
309162
309430
|
init_lodash();
|
|
309431
|
+
init_p_limit();
|
|
309163
309432
|
init_context();
|
|
309164
309433
|
init_response();
|
|
309165
309434
|
init_tokenizer2();
|
|
@@ -309213,7 +309482,7 @@ var init_label = __esm(() => {
|
|
|
309213
309482
|
};
|
|
309214
309483
|
});
|
|
309215
309484
|
|
|
309216
|
-
// ../../node_modules/.bun/@botpress+zai@2.1.
|
|
309485
|
+
// ../../node_modules/.bun/@botpress+zai@2.1.20+45458ba98afe399f/node_modules/@botpress/zai/dist/index.js
|
|
309217
309486
|
var init_dist9 = __esm(() => {
|
|
309218
309487
|
init_zai();
|
|
309219
309488
|
init_text();
|
|
@@ -315748,7 +316017,7 @@ var init_internal = __esm(() => {
|
|
|
315748
316017
|
});
|
|
315749
316018
|
init_define_PACKAGE_VERSIONS = __esm2({
|
|
315750
316019
|
"<define:__PACKAGE_VERSIONS__>"() {
|
|
315751
|
-
define_PACKAGE_VERSIONS_default = { runtime: "1.3.
|
|
316020
|
+
define_PACKAGE_VERSIONS_default = { runtime: "1.3.15", adk: "not-installed", sdk: "4.17.3", llmz: "0.0.27", zai: "2.1.20", cognitive: "0.1.50" };
|
|
315752
316021
|
}
|
|
315753
316022
|
});
|
|
315754
316023
|
init_globalThis = __esm2({
|
|
@@ -350783,7 +351052,7 @@ ${iteration.status.execution_error.stack}`;
|
|
|
350783
351052
|
get zai() {
|
|
350784
351053
|
return new Zai({
|
|
350785
351054
|
client: context.get("cognitive"),
|
|
350786
|
-
modelId: Array.isArray(adk.project.config.defaultModels.autonomous) ? adk.project.config.defaultModels.autonomous[0] : adk.project.config.defaultModels.autonomous
|
|
351055
|
+
modelId: Array.isArray(adk.project.config.defaultModels.autonomous) ? adk.project.config.defaultModels.autonomous[0] ?? "auto" : adk.project.config.defaultModels.autonomous
|
|
350787
351056
|
});
|
|
350788
351057
|
},
|
|
350789
351058
|
get project() {
|
|
@@ -367900,7 +368169,7 @@ class AgentProjectGenerator {
|
|
|
367900
368169
|
deploy: "adk deploy"
|
|
367901
368170
|
},
|
|
367902
368171
|
dependencies: {
|
|
367903
|
-
"@botpress/runtime": "^1.3.
|
|
368172
|
+
"@botpress/runtime": "^1.3.15"
|
|
367904
368173
|
},
|
|
367905
368174
|
devDependencies: {
|
|
367906
368175
|
typescript: "^5.0.0"
|
|
@@ -377162,7 +377431,7 @@ var init_Separator = __esm(async () => {
|
|
|
377162
377431
|
var require_package3 = __commonJS((exports, module) => {
|
|
377163
377432
|
module.exports = {
|
|
377164
377433
|
name: "@botpress/adk",
|
|
377165
|
-
version: "1.3.
|
|
377434
|
+
version: "1.3.15",
|
|
377166
377435
|
description: "Core ADK library for building AI agents on Botpress",
|
|
377167
377436
|
type: "module",
|
|
377168
377437
|
main: "dist/index.js",
|
|
@@ -377209,7 +377478,7 @@ var require_package3 = __commonJS((exports, module) => {
|
|
|
377209
377478
|
"@botpress/cli": "^4.20",
|
|
377210
377479
|
"@botpress/client": "^1.27.0",
|
|
377211
377480
|
"@botpress/cognitive": "^0.1.50",
|
|
377212
|
-
"@botpress/runtime": "^1.3.
|
|
377481
|
+
"@botpress/runtime": "^1.3.15",
|
|
377213
377482
|
"@botpress/sdk": "^4.17.3",
|
|
377214
377483
|
"@bpinternal/yargs-extra": "^0.0.21",
|
|
377215
377484
|
"@parcel/watcher": "^2.5.1",
|
|
@@ -380387,7 +380656,7 @@ function checkRuntimeVersion(agentRoot) {
|
|
|
380387
380656
|
`));
|
|
380388
380657
|
}
|
|
380389
380658
|
}
|
|
380390
|
-
var semver, EXPECTED_RUNTIME_VERSION = "1.3.
|
|
380659
|
+
var semver, EXPECTED_RUNTIME_VERSION = "1.3.15";
|
|
380391
380660
|
var init_runtime_version_check = __esm(() => {
|
|
380392
380661
|
init_source();
|
|
380393
380662
|
semver = __toESM(require_semver3(), 1);
|
|
@@ -390621,7 +390890,7 @@ var init_write_entry = __esm(() => {
|
|
|
390621
390890
|
function insertAfter(self2, node, value2) {
|
|
390622
390891
|
const prev = node;
|
|
390623
390892
|
const next = node ? node.next : self2.head;
|
|
390624
|
-
const inserted = new
|
|
390893
|
+
const inserted = new Node3(value2, prev, next, self2);
|
|
390625
390894
|
if (inserted.next === undefined) {
|
|
390626
390895
|
self2.tail = inserted;
|
|
390627
390896
|
}
|
|
@@ -390632,21 +390901,21 @@ function insertAfter(self2, node, value2) {
|
|
|
390632
390901
|
return inserted;
|
|
390633
390902
|
}
|
|
390634
390903
|
function push(self2, item) {
|
|
390635
|
-
self2.tail = new
|
|
390904
|
+
self2.tail = new Node3(item, self2.tail, undefined, self2);
|
|
390636
390905
|
if (!self2.head) {
|
|
390637
390906
|
self2.head = self2.tail;
|
|
390638
390907
|
}
|
|
390639
390908
|
self2.length++;
|
|
390640
390909
|
}
|
|
390641
390910
|
function unshift(self2, item) {
|
|
390642
|
-
self2.head = new
|
|
390911
|
+
self2.head = new Node3(item, undefined, self2.head, self2);
|
|
390643
390912
|
if (!self2.tail) {
|
|
390644
390913
|
self2.tail = self2.head;
|
|
390645
390914
|
}
|
|
390646
390915
|
self2.length++;
|
|
390647
390916
|
}
|
|
390648
390917
|
|
|
390649
|
-
class
|
|
390918
|
+
class Node3 {
|
|
390650
390919
|
list;
|
|
390651
390920
|
next;
|
|
390652
390921
|
prev;
|
|
@@ -395928,7 +396197,7 @@ function formatHelp(cmd, version) {
|
|
|
395928
396197
|
// src/cli.ts
|
|
395929
396198
|
var __filename2 = fileURLToPath9(import.meta.url);
|
|
395930
396199
|
var __dirname5 = dirname3(__filename2);
|
|
395931
|
-
var CLI_VERSION = "1.5.
|
|
396200
|
+
var CLI_VERSION = "1.5.15";
|
|
395932
396201
|
program.name("adk").description("Botpress Agent Development Kit (ADK) - CLI for building AI agents").version(CLI_VERSION).option("--no-cache", "Disable caching for integration lookups").configureHelp({
|
|
395933
396202
|
formatHelp: () => formatHelp(program, CLI_VERSION)
|
|
395934
396203
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/adk-cli",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.15",
|
|
4
4
|
"description": "Command-line interface for the Botpress Agent Development Kit (ADK)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"url": "https://github.com/botpress/adk"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@botpress/adk": "^1.3.
|
|
43
|
+
"@botpress/adk": "^1.3.15",
|
|
44
44
|
"@botpress/cli": "^4.20",
|
|
45
|
-
"@botpress/runtime": "^1.3.
|
|
45
|
+
"@botpress/runtime": "^1.3.15",
|
|
46
46
|
"adm-zip": "^0.5.16",
|
|
47
47
|
"chalk": "^5.4.1",
|
|
48
48
|
"clipboardy": "^4.0.0",
|