@botpress/runtime 1.12.1 → 1.12.3
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 +1 -1
- package/dist/internal.js.map +2 -2
- package/dist/library.js +1 -1
- 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/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 +1 -1
|
@@ -1,15 +1,50 @@
|
|
|
1
1
|
import type { Integrations } from './integrations';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Helper type to check if a type is empty (empty object or Record<string, never>)
|
|
4
|
+
*/
|
|
5
|
+
type IsEmptyObject<T> = T extends Record<string, never> ? true : keyof T extends never ? true : [T] extends [{}] ? {} extends T ? true : false : false;
|
|
6
|
+
/**
|
|
7
|
+
* Makes config optional if the config type is empty, otherwise requires it to be the specified type
|
|
8
|
+
*/
|
|
9
|
+
type ConfigField<T> = IsEmptyObject<T> extends true ? {
|
|
10
|
+
config?: T;
|
|
11
|
+
} : {
|
|
12
|
+
config?: T;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Creates a discriminated union of configuration options for an integration.
|
|
16
|
+
* When configurationType is set to a specific key, config must match that configuration's type.
|
|
17
|
+
* When configurationType is omitted, it defaults to "default" and config must match the default configuration.
|
|
18
|
+
* When config type is empty ({}), the config field can be omitted.
|
|
19
|
+
*/
|
|
20
|
+
type IntegrationConfigurationUnion<K extends keyof Integrations> = Integrations[K] extends {
|
|
21
|
+
configurations: infer Configs;
|
|
22
|
+
} ? Configs extends Record<string, unknown> ? 'default' extends keyof Configs ? ({
|
|
23
|
+
configurationType?: never;
|
|
24
|
+
} & ConfigField<Configs['default']>) | {
|
|
25
|
+
[CT in keyof Configs]: {
|
|
26
|
+
configurationType: CT;
|
|
27
|
+
} & ConfigField<Configs[CT]>;
|
|
28
|
+
}[keyof Configs] : {
|
|
29
|
+
[CT in keyof Configs]: {
|
|
30
|
+
configurationType: CT;
|
|
31
|
+
} & ConfigField<Configs[CT]>;
|
|
32
|
+
}[keyof Configs] : {
|
|
33
|
+
configurationType?: string;
|
|
34
|
+
config?: unknown;
|
|
35
|
+
} : Integrations[K] extends {
|
|
3
36
|
config: infer C;
|
|
4
37
|
} ? {
|
|
5
|
-
|
|
6
|
-
} : {
|
|
38
|
+
configurationType?: string;
|
|
39
|
+
} & ConfigField<C> : {
|
|
40
|
+
configurationType?: string;
|
|
41
|
+
config?: unknown;
|
|
42
|
+
};
|
|
7
43
|
export type IntegrationDependency<K extends keyof Integrations = keyof Integrations> = {
|
|
8
44
|
version: string;
|
|
9
45
|
enabled: boolean;
|
|
10
|
-
configurationType?: string;
|
|
11
46
|
connection?: string;
|
|
12
|
-
} &
|
|
47
|
+
} & IntegrationConfigurationUnion<K>;
|
|
13
48
|
export type Dependencies = {
|
|
14
49
|
integrations: {
|
|
15
50
|
[K in keyof Integrations]: IntegrationDependency<K>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../src/_types/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD,KAAK,
|
|
1
|
+
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../../src/_types/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD;;GAEG;AACH,KAAK,aAAa,CAAC,CAAC,IA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C;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,CAAC,CAAC,CAAC,GAC/C;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAEtD,MAAM,MAAM,qBAAqB,CAAC,CAAC,SAAS,MAAM,YAAY,GAAG,MAAM,YAAY,IAAI;IACrF,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,GAAG,6BAA6B,CAAC,CAAC,CAAC,CAAA;AAEpC,MAAM,MAAM,YAAY,GAAG;IACzB,YAAY,EAAE;SACX,CAAC,IAAI,MAAM,YAAY,GAAG,qBAAqB,CAAC,CAAC,CAAC;KACpD,CAAA;CACF,CAAA"}
|
package/dist/definition.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.3", adk: "1.12.3", sdk: "4.20.2", llmz: "0.0.33", zai: "2.5.0", cognitive: "0.2.0" };
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
|