@botpress/runtime 1.12.0 → 1.12.2
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/_types/dependencies.d.ts +40 -5
- package/dist/_types/dependencies.d.ts.map +1 -1
- package/dist/definition.js +1 -1
- package/dist/definition.js.map +2 -2
- package/dist/internal.js +28 -2
- package/dist/internal.js.map +2 -2
- package/dist/library.js +28 -2
- package/dist/library.js.map +2 -2
- package/dist/primitives/conversation-instance.d.ts +1 -1
- package/dist/primitives/conversation-instance.d.ts.map +1 -1
- package/dist/primitives/definition.d.ts +2 -0
- package/dist/primitives/definition.d.ts.map +1 -1
- package/dist/primitives/table.d.ts +5 -0
- package/dist/primitives/table.d.ts.map +1 -1
- package/dist/runtime/chat/chat.d.ts +15 -3
- package/dist/runtime/chat/chat.d.ts.map +1 -1
- package/dist/runtime/context/context.d.ts +5 -2
- package/dist/runtime/context/context.d.ts.map +1 -1
- package/dist/runtime.js +1 -1
- package/dist/runtime.js.map +2 -2
- package/package.json +2 -2
package/dist/library.js
CHANGED
|
@@ -48,7 +48,7 @@ var init_define_BUILD = __esm({
|
|
|
48
48
|
var define_PACKAGE_VERSIONS_default;
|
|
49
49
|
var init_define_PACKAGE_VERSIONS = __esm({
|
|
50
50
|
"<define:__PACKAGE_VERSIONS__>"() {
|
|
51
|
-
define_PACKAGE_VERSIONS_default = { runtime: "1.12.
|
|
51
|
+
define_PACKAGE_VERSIONS_default = { runtime: "1.12.2", adk: "1.12.2", sdk: "4.20.2", llmz: "0.0.33", zai: "2.5.0", cognitive: "0.2.0" };
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -47836,6 +47836,9 @@ var init_table = __esm({
|
|
|
47836
47836
|
factor;
|
|
47837
47837
|
columns;
|
|
47838
47838
|
schema;
|
|
47839
|
+
type = "table";
|
|
47840
|
+
keyColumn;
|
|
47841
|
+
tags;
|
|
47839
47842
|
nullableColumns = /* @__PURE__ */ new Set();
|
|
47840
47843
|
searchableColumns = /* @__PURE__ */ new Set();
|
|
47841
47844
|
computedColumns = /* @__PURE__ */ new Set();
|
|
@@ -47847,6 +47850,7 @@ var init_table = __esm({
|
|
|
47847
47850
|
(name) => /^[a-zA-Z_$][a-zA-Z0-9_]{0,29}Table$/.test(name),
|
|
47848
47851
|
"Table name must start with a letter/underscore, be 35 chars or less, contain only letters/numbers/underscores, and end with 'Table'"
|
|
47849
47852
|
);
|
|
47853
|
+
const tagsSchema = z25.record(z25.string().min(3).max(50), z25.string().min(1).max(255)).optional();
|
|
47850
47854
|
const validation = tableNameSchema.safeParse(props.name);
|
|
47851
47855
|
if (!validation.success) {
|
|
47852
47856
|
throw new Errors.InvalidPrimitiveError(`Invalid table name '${props.name}'`, validation.error);
|
|
@@ -47855,7 +47859,19 @@ var init_table = __esm({
|
|
|
47855
47859
|
if (props.description !== void 0) {
|
|
47856
47860
|
this.description = props.description;
|
|
47857
47861
|
}
|
|
47862
|
+
if (props.factor !== void 0 && (props.factor < 1 || props.factor > 30)) {
|
|
47863
|
+
throw new Errors.InvalidPrimitiveError(
|
|
47864
|
+
`Invalid factor for table '${props.name}': must be between 1 and 30 but got ${props.factor}`
|
|
47865
|
+
);
|
|
47866
|
+
}
|
|
47858
47867
|
this.factor = props.factor ?? 1;
|
|
47868
|
+
if (props.tags !== void 0) {
|
|
47869
|
+
const parsed = tagsSchema.safeParse(props.tags);
|
|
47870
|
+
if (!parsed.success) {
|
|
47871
|
+
throw new Errors.InvalidPrimitiveError(`Invalid tags for table '${props.name}'`, parsed.error);
|
|
47872
|
+
}
|
|
47873
|
+
this.tags = props.tags;
|
|
47874
|
+
}
|
|
47859
47875
|
this.columns = {};
|
|
47860
47876
|
let schema = z25.object({});
|
|
47861
47877
|
for (const [key, value] of Object.entries(props.columns)) {
|
|
@@ -47905,6 +47921,14 @@ var init_table = __esm({
|
|
|
47905
47921
|
};
|
|
47906
47922
|
}
|
|
47907
47923
|
}
|
|
47924
|
+
if (props.keyColumn) {
|
|
47925
|
+
if (typeof props.keyColumn !== "string" || !(props.keyColumn in this.columns)) {
|
|
47926
|
+
throw new Errors.InvalidPrimitiveError(
|
|
47927
|
+
`Invalid keyColumn '${String(props.keyColumn)}' for table '${props.name}': column does not exist`
|
|
47928
|
+
);
|
|
47929
|
+
}
|
|
47930
|
+
this.keyColumn = String(props.keyColumn);
|
|
47931
|
+
}
|
|
47908
47932
|
this.schema = schema;
|
|
47909
47933
|
}
|
|
47910
47934
|
/** @internal */
|
|
@@ -47925,7 +47949,9 @@ var init_table = __esm({
|
|
|
47925
47949
|
type: "table",
|
|
47926
47950
|
name: this.name,
|
|
47927
47951
|
schema,
|
|
47928
|
-
factor: this.factor
|
|
47952
|
+
factor: this.factor,
|
|
47953
|
+
keyColumn: this.keyColumn,
|
|
47954
|
+
tags: this.tags
|
|
47929
47955
|
};
|
|
47930
47956
|
}
|
|
47931
47957
|
async getRow(props) {
|