llmz 0.0.2 → 0.0.5
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/chat.d.ts +17 -0
- package/dist/chunk-3U57H7GT.js +608 -0
- package/dist/{chunk-RB2L33ZR.js → chunk-4EWY34YA.js} +24 -24
- package/dist/{chunk-R2N2UUKC.cjs → chunk-4I7UPBLN.cjs} +14 -8
- package/dist/{chunk-YPOOKE3A.cjs → chunk-4QTK5ALH.cjs} +59 -28
- package/dist/{chunk-BKGPO722.cjs → chunk-5NVNEEYW.cjs} +55 -55
- package/dist/{chunk-DFZ6GX5C.js → chunk-5TRUJES5.js} +1 -1
- package/dist/{chunk-E2B5DRIC.cjs → chunk-6WT5VZBG.cjs} +362 -26
- package/dist/{chunk-7S3UY52U.js → chunk-7WRN4E42.js} +36 -8
- package/dist/{chunk-E5W3P7EO.cjs → chunk-EJRCDWBA.cjs} +64 -7
- package/dist/{chunk-VP6WWAE2.cjs → chunk-FIVFS4HG.cjs} +2 -2
- package/dist/{chunk-3T465BEW.js → chunk-HP7RKM25.js} +63 -6
- package/dist/{chunk-YUDUY7XW.cjs → chunk-HYVKY3W6.cjs} +23 -24
- package/dist/{chunk-PQN6HW7A.cjs → chunk-IKSIOIIP.cjs} +3 -3
- package/dist/{chunk-ZUAFUOUR.cjs → chunk-JDABP4SD.cjs} +3 -3
- package/dist/{chunk-RJHDQL4C.js → chunk-JKVVQN2P.js} +1 -1
- package/dist/{chunk-MSTBEKOQ.js → chunk-JQBT7UWN.js} +3 -3
- package/dist/{chunk-BOLDQGES.cjs → chunk-KMZDFWYZ.cjs} +3 -3
- package/dist/chunk-MU4LFVY7.cjs +608 -0
- package/dist/{chunk-7FIPXMZR.js → chunk-ORQP26SZ.js} +1 -1
- package/dist/{chunk-ENFB45AI.cjs → chunk-P7J2WCBB.cjs} +7 -7
- package/dist/{chunk-DILHJIMP.js → chunk-QBXIE6EY.js} +49 -18
- package/dist/{chunk-UVSOAH2H.js → chunk-QT4QF3YA.js} +1 -1
- package/dist/{chunk-6QDFMQHA.js → chunk-S6FOL2HY.js} +8 -2
- package/dist/{chunk-ZSRC3TN4.js → chunk-UNMKB2DA.js} +9 -10
- package/dist/{chunk-3CGLDS5T.cjs → chunk-UQOBUJIQ.cjs} +38 -10
- package/dist/{chunk-QPSUMPLP.js → chunk-WLUVY5QU.js} +345 -9
- package/dist/citations.d.ts +63 -0
- package/dist/component-R2Y74VUI.js +16 -0
- package/dist/component-TSNW3SC7.cjs +16 -0
- package/dist/component.d.ts +26 -17
- package/dist/component.default.d.ts +314 -8
- package/dist/context.d.ts +9 -6
- package/dist/dual-modes-UHNDHNIF.cjs +12 -0
- package/dist/dual-modes-ZUQKPJFH.js +12 -0
- package/dist/exit-KJ4COC5N.cjs +8 -0
- package/dist/exit-OIYZLBVJ.js +8 -0
- package/dist/exit.d.ts +6 -0
- package/dist/getter.d.ts +1 -1
- package/dist/index.cjs +256 -160
- package/dist/index.d.ts +7 -4
- package/dist/index.js +242 -146
- package/dist/{jsx-CJ2RBODH.js → jsx-AEHVFB3L.js} +2 -3
- package/dist/jsx-AJAXBWFE.cjs +13 -0
- package/dist/llmz-VDA4M42R.cjs +604 -0
- package/dist/llmz-YE5N54IU.js +604 -0
- package/dist/llmz.d.ts +8 -10
- package/dist/snapshots.d.ts +9 -1
- package/dist/tool-LY77IWV2.js +11 -0
- package/dist/tool-SWJYOR2Z.cjs +11 -0
- package/dist/tool.d.ts +34 -9
- package/dist/truncator-NYN7BGKJ.cjs +10 -0
- package/dist/truncator-WAL2GCUY.js +10 -0
- package/dist/types.d.ts +9 -1
- package/dist/typings-AIV2OASX.js +10 -0
- package/dist/typings-XR6CYHW4.cjs +10 -0
- package/dist/{utils-TS23YJPE.js → utils-L5GLCS3C.js} +2 -3
- package/dist/utils-QC4I2L6R.cjs +37 -0
- package/dist/vm-GJ5R72AP.cjs +12 -0
- package/dist/vm-ZUQOSRRM.js +12 -0
- package/dist/vm.d.ts +1 -1
- package/package.json +8 -6
- package/dist/chunk-A7BDFLAE.cjs +0 -30
- package/dist/chunk-C2TSWGYC.cjs +0 -91
- package/dist/chunk-Q4DEJGXD.js +0 -344
- package/dist/chunk-QZGFCB4T.cjs +0 -344
- package/dist/chunk-UG2GCPHF.js +0 -91
- package/dist/chunk-YSQDPG26.js +0 -30
- package/dist/component-DWBRHLEN.cjs +0 -9
- package/dist/component-R3ZAVXUC.js +0 -9
- package/dist/dual-modes-2VDEOJ5D.js +0 -13
- package/dist/dual-modes-3MH5N6RY.cjs +0 -13
- package/dist/exit-GYMXZZ4I.js +0 -9
- package/dist/exit-PQHMJEOG.cjs +0 -9
- package/dist/jsx-PPLE5YTB.cjs +0 -14
- package/dist/llmz-EGTGPSTX.cjs +0 -1049
- package/dist/llmz-WY74UVE3.js +0 -1049
- package/dist/tool-AY47ML65.cjs +0 -12
- package/dist/tool-WVIPESKN.js +0 -12
- package/dist/truncator-MTONQESU.js +0 -11
- package/dist/truncator-ZKPOW2I3.cjs +0 -11
- package/dist/typings-HTYLRNIC.js +0 -11
- package/dist/typings-QRJGGNUM.cjs +0 -11
- package/dist/utils-UR4IMUHC.cjs +0 -38
- package/dist/vm-4JFSZAMR.cjs +0 -13
- package/dist/vm-SMMA664M.js +0 -13
- package/patches/source-map-js@1.2.1.patch +0 -16
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export type Citation = {
|
|
2
|
+
id: number;
|
|
3
|
+
source: any;
|
|
4
|
+
tag: string;
|
|
5
|
+
offset?: number;
|
|
6
|
+
};
|
|
7
|
+
export type CitationReplaceFn = (citation: Citation) => string;
|
|
8
|
+
/** These are all single-token symbols that are very rare in natural texts, making them suitable for usage within GPT Prompts. */
|
|
9
|
+
export declare const RARE_SYMBOLS: {
|
|
10
|
+
readonly ARROW_UP: "↑";
|
|
11
|
+
readonly CIRCLE_BULLET: "・";
|
|
12
|
+
readonly STAR_BULLET_FULL: "★";
|
|
13
|
+
readonly STAR_BULLET_EMPTY: "☆";
|
|
14
|
+
readonly ARROW_BULLET: "→";
|
|
15
|
+
readonly SQUARE_BULLET: "■";
|
|
16
|
+
readonly TRIANGLE_BULLET: "►";
|
|
17
|
+
readonly OPENING_TAG: "【";
|
|
18
|
+
readonly CLOSING_TAG: "】";
|
|
19
|
+
readonly SS: "§";
|
|
20
|
+
readonly CROSS: "†";
|
|
21
|
+
};
|
|
22
|
+
export declare class CitationsManager {
|
|
23
|
+
private _citations;
|
|
24
|
+
private _nextId;
|
|
25
|
+
/**
|
|
26
|
+
* Registers a new source and returns the created Citation.
|
|
27
|
+
* @param source An object representing the source of the citation.
|
|
28
|
+
* @returns The created Citation.
|
|
29
|
+
*/
|
|
30
|
+
registerSource(source: any): Citation;
|
|
31
|
+
/**
|
|
32
|
+
* Extracts citations from the provided content and cleans the content of citation tags.
|
|
33
|
+
* Non-found citations are replaced with a special "Not Found" citation.
|
|
34
|
+
* @param content The string content containing citation tags.
|
|
35
|
+
* @returns An object containing the cleaned content and an array of found citations.
|
|
36
|
+
*/
|
|
37
|
+
extractCitations(content: string, replace?: CitationReplaceFn): {
|
|
38
|
+
cleaned: string;
|
|
39
|
+
citations: Citation[];
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Strips citation tags from the provided content.
|
|
43
|
+
* @param content The string content containing citation tags.
|
|
44
|
+
* @returns The cleaned content without citation tags.
|
|
45
|
+
*/
|
|
46
|
+
static stripCitationTags(content: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Removes citations from a deeply nested plain object and returns a new object with citations removed.
|
|
49
|
+
* @param obj The plain object to process.
|
|
50
|
+
* @returns A tuple containing the new object and an array of extracted citations with paths.
|
|
51
|
+
*/
|
|
52
|
+
removeCitationsFromObject<T>(obj: T): [T, {
|
|
53
|
+
path: string;
|
|
54
|
+
citation: Citation;
|
|
55
|
+
}[]];
|
|
56
|
+
/**
|
|
57
|
+
* Re-adds citations to the cleaned content based on their offsets.
|
|
58
|
+
* @param cleaned The cleaned string without citation tags.
|
|
59
|
+
* @param citations The array of citations with offsets.
|
|
60
|
+
* @returns The string with citation tags re-added.
|
|
61
|
+
*/
|
|
62
|
+
reAddCitations(cleaned: string, citations: Citation[]): string;
|
|
63
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
assertValidComponent,
|
|
4
|
+
getComponentReference,
|
|
5
|
+
isAnyComponent,
|
|
6
|
+
isComponent
|
|
7
|
+
} from "./chunk-HP7RKM25.js";
|
|
8
|
+
import "./chunk-ORQP26SZ.js";
|
|
9
|
+
import "./chunk-7WRN4E42.js";
|
|
10
|
+
export {
|
|
11
|
+
Component,
|
|
12
|
+
assertValidComponent,
|
|
13
|
+
getComponentReference,
|
|
14
|
+
isAnyComponent,
|
|
15
|
+
isComponent
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkEJRCDWBAcjs = require('./chunk-EJRCDWBA.cjs');
|
|
8
|
+
require('./chunk-KMZDFWYZ.cjs');
|
|
9
|
+
require('./chunk-UQOBUJIQ.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.Component = _chunkEJRCDWBAcjs.Component; exports.assertValidComponent = _chunkEJRCDWBAcjs.assertValidComponent; exports.getComponentReference = _chunkEJRCDWBAcjs.getComponentReference; exports.isAnyComponent = _chunkEJRCDWBAcjs.isAnyComponent; exports.isComponent = _chunkEJRCDWBAcjs.isComponent;
|
package/dist/component.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
name: string;
|
|
3
|
-
type: 'string' | 'boolean' | 'number';
|
|
4
|
-
default?: string | boolean | number;
|
|
5
|
-
description?: string;
|
|
6
|
-
required: boolean;
|
|
7
|
-
};
|
|
8
|
-
export type Component = DefaultComponent | LeafComponent | ContainerComponent;
|
|
1
|
+
import { z } from '@bpinternal/zui';
|
|
9
2
|
export type ExampleUsage = {
|
|
10
3
|
name: string;
|
|
11
4
|
description: string;
|
|
@@ -13,39 +6,55 @@ export type ExampleUsage = {
|
|
|
13
6
|
};
|
|
14
7
|
export type ComponentChild = {
|
|
15
8
|
description: string;
|
|
16
|
-
component:
|
|
9
|
+
component: ComponentDefinition;
|
|
17
10
|
};
|
|
18
|
-
export
|
|
11
|
+
export declare function assertValidComponent(component: ComponentDefinition): asserts component is ComponentDefinition;
|
|
12
|
+
export declare function getComponentReference(component: ComponentDefinition): string;
|
|
13
|
+
export type DefaultComponentDefinition<T extends z.ZodObject<any> = z.ZodObject<any>> = {
|
|
19
14
|
type: 'default';
|
|
20
15
|
name: string;
|
|
21
16
|
aliases: string[];
|
|
22
17
|
description: string;
|
|
23
18
|
examples: ExampleUsage[];
|
|
24
19
|
default: {
|
|
25
|
-
props:
|
|
20
|
+
props: T;
|
|
26
21
|
children: Array<ComponentChild>;
|
|
27
22
|
};
|
|
28
23
|
};
|
|
29
|
-
export type
|
|
24
|
+
export type LeafComponentDefinition<T extends z.ZodObject<any> = z.ZodObject<any>> = {
|
|
30
25
|
type: 'leaf';
|
|
31
26
|
name: string;
|
|
32
27
|
description: string;
|
|
33
28
|
aliases?: string[];
|
|
34
29
|
examples: ExampleUsage[];
|
|
35
30
|
leaf: {
|
|
36
|
-
props:
|
|
31
|
+
props: T;
|
|
37
32
|
};
|
|
38
33
|
};
|
|
39
|
-
export type
|
|
34
|
+
export type ContainerComponentDefinition<T extends z.ZodObject<any> = z.ZodObject<any>> = {
|
|
40
35
|
type: 'container';
|
|
41
36
|
name: string;
|
|
42
37
|
description: string;
|
|
43
38
|
aliases?: string[];
|
|
44
39
|
examples: ExampleUsage[];
|
|
45
40
|
container: {
|
|
46
|
-
props:
|
|
41
|
+
props: T;
|
|
47
42
|
children: Array<ComponentChild>;
|
|
48
43
|
};
|
|
49
44
|
};
|
|
50
|
-
export
|
|
51
|
-
|
|
45
|
+
export type ComponentDefinition = DefaultComponentDefinition | LeafComponentDefinition | ContainerComponentDefinition;
|
|
46
|
+
type ExtractComponentProps<T extends ComponentDefinition> = T extends LeafComponentDefinition<infer P> ? z.infer<P> : T extends ContainerComponentDefinition<infer P> ? z.infer<P> : T extends DefaultComponentDefinition<infer P> ? z.infer<P> : never;
|
|
47
|
+
export type RenderedComponent<TProps = Record<string, any>> = {
|
|
48
|
+
__jsx: true;
|
|
49
|
+
type: string;
|
|
50
|
+
children: any[];
|
|
51
|
+
props: TProps;
|
|
52
|
+
};
|
|
53
|
+
export declare class Component<T extends ComponentDefinition = ComponentDefinition> {
|
|
54
|
+
readonly definition: T;
|
|
55
|
+
readonly propsType: ExtractComponentProps<T>;
|
|
56
|
+
constructor(definition: T);
|
|
57
|
+
}
|
|
58
|
+
export declare function isComponent<T extends ComponentDefinition>(rendered: RenderedComponent<any>, component: Component<T>): rendered is RenderedComponent<ExtractComponentProps<T>>;
|
|
59
|
+
export declare function isAnyComponent(message: unknown): message is RenderedComponent;
|
|
60
|
+
export {};
|
|
@@ -1,10 +1,316 @@
|
|
|
1
|
+
import { Component } from './component.js';
|
|
1
2
|
export declare const DefaultComponents: {
|
|
2
|
-
Button:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
Button: Component<{
|
|
4
|
+
type: "leaf";
|
|
5
|
+
description: string;
|
|
6
|
+
name: string;
|
|
7
|
+
aliases: string[];
|
|
8
|
+
examples: {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
code: string;
|
|
12
|
+
}[];
|
|
13
|
+
leaf: {
|
|
14
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
15
|
+
action: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodEnum<["say", "url", "postback"]>>;
|
|
16
|
+
label: import("@bpinternal/zui").ZodString;
|
|
17
|
+
value: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
18
|
+
url: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
19
|
+
}, "strip", {
|
|
20
|
+
label: string;
|
|
21
|
+
action: "say" | "url" | "postback";
|
|
22
|
+
value?: string | undefined;
|
|
23
|
+
url?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
label: string;
|
|
26
|
+
value?: string | undefined;
|
|
27
|
+
action?: "say" | "url" | "postback" | undefined;
|
|
28
|
+
url?: string | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
Image: Component<{
|
|
33
|
+
type: "leaf";
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
aliases: never[];
|
|
37
|
+
examples: {
|
|
38
|
+
name: string;
|
|
39
|
+
description: string;
|
|
40
|
+
code: string;
|
|
41
|
+
}[];
|
|
42
|
+
leaf: {
|
|
43
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
44
|
+
url: import("@bpinternal/zui").ZodString;
|
|
45
|
+
alt: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
46
|
+
}, "strip", {
|
|
47
|
+
url: string;
|
|
48
|
+
alt?: string | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
url: string;
|
|
51
|
+
alt?: string | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
};
|
|
54
|
+
}>;
|
|
55
|
+
File: Component<{
|
|
56
|
+
type: "leaf";
|
|
57
|
+
name: string;
|
|
58
|
+
description: string;
|
|
59
|
+
aliases: never[];
|
|
60
|
+
examples: {
|
|
61
|
+
name: string;
|
|
62
|
+
description: string;
|
|
63
|
+
code: string;
|
|
64
|
+
}[];
|
|
65
|
+
leaf: {
|
|
66
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
67
|
+
url: import("@bpinternal/zui").ZodString;
|
|
68
|
+
name: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
69
|
+
}, "strip", {
|
|
70
|
+
url: string;
|
|
71
|
+
name?: string | undefined;
|
|
72
|
+
}, {
|
|
73
|
+
url: string;
|
|
74
|
+
name?: string | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
};
|
|
77
|
+
}>;
|
|
78
|
+
Video: Component<{
|
|
79
|
+
type: "leaf";
|
|
80
|
+
name: string;
|
|
81
|
+
description: string;
|
|
82
|
+
aliases: never[];
|
|
83
|
+
examples: {
|
|
84
|
+
name: string;
|
|
85
|
+
description: string;
|
|
86
|
+
code: string;
|
|
87
|
+
}[];
|
|
88
|
+
leaf: {
|
|
89
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
90
|
+
url: import("@bpinternal/zui").ZodString;
|
|
91
|
+
title: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
92
|
+
}, "strip", {
|
|
93
|
+
url: string;
|
|
94
|
+
title?: string | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
url: string;
|
|
97
|
+
title?: string | undefined;
|
|
98
|
+
}>;
|
|
99
|
+
};
|
|
100
|
+
}>;
|
|
101
|
+
Audio: Component<{
|
|
102
|
+
type: "leaf";
|
|
103
|
+
name: string;
|
|
104
|
+
description: string;
|
|
105
|
+
aliases: never[];
|
|
106
|
+
examples: {
|
|
107
|
+
name: string;
|
|
108
|
+
description: string;
|
|
109
|
+
code: string;
|
|
110
|
+
}[];
|
|
111
|
+
leaf: {
|
|
112
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
113
|
+
url: import("@bpinternal/zui").ZodString;
|
|
114
|
+
title: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
115
|
+
}, "strip", {
|
|
116
|
+
url: string;
|
|
117
|
+
title?: string | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
url: string;
|
|
120
|
+
title?: string | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
};
|
|
123
|
+
}>;
|
|
124
|
+
Card: Component<{
|
|
125
|
+
type: "container";
|
|
126
|
+
name: string;
|
|
127
|
+
description: string;
|
|
128
|
+
aliases: never[];
|
|
129
|
+
examples: {
|
|
130
|
+
name: string;
|
|
131
|
+
description: string;
|
|
132
|
+
code: string;
|
|
133
|
+
}[];
|
|
134
|
+
container: {
|
|
135
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
136
|
+
title: import("@bpinternal/zui").ZodString;
|
|
137
|
+
subtitle: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
138
|
+
}, "strip", {
|
|
139
|
+
title: string;
|
|
140
|
+
subtitle?: string | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
title: string;
|
|
143
|
+
subtitle?: string | undefined;
|
|
144
|
+
}>;
|
|
145
|
+
children: ({
|
|
146
|
+
description: string;
|
|
147
|
+
component: {
|
|
148
|
+
type: "leaf";
|
|
149
|
+
name: string;
|
|
150
|
+
description: string;
|
|
151
|
+
aliases: never[];
|
|
152
|
+
examples: {
|
|
153
|
+
name: string;
|
|
154
|
+
description: string;
|
|
155
|
+
code: string;
|
|
156
|
+
}[];
|
|
157
|
+
leaf: {
|
|
158
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
159
|
+
url: import("@bpinternal/zui").ZodString;
|
|
160
|
+
alt: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
161
|
+
}, "strip", {
|
|
162
|
+
url: string;
|
|
163
|
+
alt?: string | undefined;
|
|
164
|
+
}, {
|
|
165
|
+
url: string;
|
|
166
|
+
alt?: string | undefined;
|
|
167
|
+
}>;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
} | {
|
|
171
|
+
description: string;
|
|
172
|
+
component: {
|
|
173
|
+
type: "leaf";
|
|
174
|
+
description: string;
|
|
175
|
+
name: string;
|
|
176
|
+
aliases: string[];
|
|
177
|
+
examples: {
|
|
178
|
+
name: string;
|
|
179
|
+
description: string;
|
|
180
|
+
code: string;
|
|
181
|
+
}[];
|
|
182
|
+
leaf: {
|
|
183
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
184
|
+
action: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodEnum<["say", "url", "postback"]>>;
|
|
185
|
+
label: import("@bpinternal/zui").ZodString;
|
|
186
|
+
value: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
187
|
+
url: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
188
|
+
}, "strip", {
|
|
189
|
+
label: string;
|
|
190
|
+
action: "say" | "url" | "postback";
|
|
191
|
+
value?: string | undefined;
|
|
192
|
+
url?: string | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
label: string;
|
|
195
|
+
value?: string | undefined;
|
|
196
|
+
action?: "say" | "url" | "postback" | undefined;
|
|
197
|
+
url?: string | undefined;
|
|
198
|
+
}>;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
})[];
|
|
202
|
+
};
|
|
203
|
+
}>;
|
|
204
|
+
Carousel: Component<{
|
|
205
|
+
type: "container";
|
|
206
|
+
name: string;
|
|
207
|
+
description: string;
|
|
208
|
+
aliases: never[];
|
|
209
|
+
examples: {
|
|
210
|
+
name: string;
|
|
211
|
+
description: string;
|
|
212
|
+
code: string;
|
|
213
|
+
}[];
|
|
214
|
+
container: {
|
|
215
|
+
props: import("@bpinternal/zui").ZodObject<{}, "strip", {}, {}>;
|
|
216
|
+
children: {
|
|
217
|
+
description: string;
|
|
218
|
+
component: {
|
|
219
|
+
type: "container";
|
|
220
|
+
name: string;
|
|
221
|
+
description: string;
|
|
222
|
+
aliases: never[];
|
|
223
|
+
examples: {
|
|
224
|
+
name: string;
|
|
225
|
+
description: string;
|
|
226
|
+
code: string;
|
|
227
|
+
}[];
|
|
228
|
+
container: {
|
|
229
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
230
|
+
title: import("@bpinternal/zui").ZodString;
|
|
231
|
+
subtitle: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
232
|
+
}, "strip", {
|
|
233
|
+
title: string;
|
|
234
|
+
subtitle?: string | undefined;
|
|
235
|
+
}, {
|
|
236
|
+
title: string;
|
|
237
|
+
subtitle?: string | undefined;
|
|
238
|
+
}>;
|
|
239
|
+
children: ({
|
|
240
|
+
description: string;
|
|
241
|
+
component: {
|
|
242
|
+
type: "leaf";
|
|
243
|
+
name: string;
|
|
244
|
+
description: string;
|
|
245
|
+
aliases: never[];
|
|
246
|
+
examples: {
|
|
247
|
+
name: string;
|
|
248
|
+
description: string;
|
|
249
|
+
code: string;
|
|
250
|
+
}[];
|
|
251
|
+
leaf: {
|
|
252
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
253
|
+
url: import("@bpinternal/zui").ZodString;
|
|
254
|
+
alt: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
255
|
+
}, "strip", {
|
|
256
|
+
url: string;
|
|
257
|
+
alt?: string | undefined;
|
|
258
|
+
}, {
|
|
259
|
+
url: string;
|
|
260
|
+
alt?: string | undefined;
|
|
261
|
+
}>;
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
} | {
|
|
265
|
+
description: string;
|
|
266
|
+
component: {
|
|
267
|
+
type: "leaf";
|
|
268
|
+
description: string;
|
|
269
|
+
name: string;
|
|
270
|
+
aliases: string[];
|
|
271
|
+
examples: {
|
|
272
|
+
name: string;
|
|
273
|
+
description: string;
|
|
274
|
+
code: string;
|
|
275
|
+
}[];
|
|
276
|
+
leaf: {
|
|
277
|
+
props: import("@bpinternal/zui").ZodObject<{
|
|
278
|
+
action: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodEnum<["say", "url", "postback"]>>;
|
|
279
|
+
label: import("@bpinternal/zui").ZodString;
|
|
280
|
+
value: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
281
|
+
url: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
282
|
+
}, "strip", {
|
|
283
|
+
label: string;
|
|
284
|
+
action: "say" | "url" | "postback";
|
|
285
|
+
value?: string | undefined;
|
|
286
|
+
url?: string | undefined;
|
|
287
|
+
}, {
|
|
288
|
+
label: string;
|
|
289
|
+
value?: string | undefined;
|
|
290
|
+
action?: "say" | "url" | "postback" | undefined;
|
|
291
|
+
url?: string | undefined;
|
|
292
|
+
}>;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
})[];
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
}[];
|
|
299
|
+
};
|
|
300
|
+
}>;
|
|
301
|
+
Text: Component<{
|
|
302
|
+
type: "default";
|
|
303
|
+
name: string;
|
|
304
|
+
aliases: string[];
|
|
305
|
+
description: string;
|
|
306
|
+
examples: {
|
|
307
|
+
name: string;
|
|
308
|
+
description: string;
|
|
309
|
+
code: string;
|
|
310
|
+
}[];
|
|
311
|
+
default: {
|
|
312
|
+
props: import("@bpinternal/zui").ZodObject<{}, "strip", {}, {}>;
|
|
313
|
+
children: never[];
|
|
314
|
+
};
|
|
315
|
+
}>;
|
|
10
316
|
};
|
package/dist/context.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Cognitive } from '@botpress/cognitive';
|
|
2
|
+
import { Chat } from './chat.js';
|
|
2
3
|
import { Component } from './component.js';
|
|
3
4
|
import { SnapshotSignal } from './errors.js';
|
|
4
5
|
import { Exit } from './exit.js';
|
|
@@ -9,7 +10,7 @@ import type { OAI } from './openai.js';
|
|
|
9
10
|
import { Prompt } from './prompts/prompt.js';
|
|
10
11
|
import { Snapshot } from './snapshots.js';
|
|
11
12
|
import { Tool } from './tool.js';
|
|
12
|
-
import { TranscriptArray
|
|
13
|
+
import { TranscriptArray } from './transcript.js';
|
|
13
14
|
import { ObjectMutation, Trace } from './types.js';
|
|
14
15
|
type Model = Parameters<InstanceType<typeof Cognitive>['generateContent']>[0]['model'];
|
|
15
16
|
export type IterationParameters = {
|
|
@@ -79,6 +80,8 @@ export declare namespace IterationStatuses {
|
|
|
79
80
|
};
|
|
80
81
|
};
|
|
81
82
|
}
|
|
83
|
+
export declare const ThinkExit: Exit<unknown>;
|
|
84
|
+
export declare const ListenExit: Exit<unknown>;
|
|
82
85
|
export declare class Iteration {
|
|
83
86
|
id: string;
|
|
84
87
|
messages: OAI.Message[];
|
|
@@ -93,7 +96,7 @@ export declare class Iteration {
|
|
|
93
96
|
trackMutation(mutation: ObjectMutation): void;
|
|
94
97
|
private _parameters;
|
|
95
98
|
get transcript(): TranscriptArray;
|
|
96
|
-
get tools(): Tool<
|
|
99
|
+
get tools(): Tool<import("./types.js").ZuiType, import("./types.js").ZuiType>[];
|
|
97
100
|
get objects(): ObjectInstance[];
|
|
98
101
|
get exits(): Exit<unknown>[];
|
|
99
102
|
get instructions(): string | undefined;
|
|
@@ -132,13 +135,13 @@ export declare class Iteration {
|
|
|
132
135
|
}
|
|
133
136
|
export declare class Context {
|
|
134
137
|
id: string;
|
|
135
|
-
|
|
138
|
+
chat?: Chat;
|
|
136
139
|
instructions?: ValueOrGetter<string, Context>;
|
|
137
140
|
objects?: ValueOrGetter<ObjectInstance[], Context>;
|
|
138
141
|
tools?: ValueOrGetter<Tool[], Context>;
|
|
139
142
|
exits?: ValueOrGetter<Exit[], Context>;
|
|
140
|
-
components?: ValueOrGetter<Component[], Context>;
|
|
141
143
|
version: Prompt;
|
|
144
|
+
timeout: number;
|
|
142
145
|
loop: number;
|
|
143
146
|
temperature: number;
|
|
144
147
|
model?: Model;
|
|
@@ -151,17 +154,17 @@ export declare class Context {
|
|
|
151
154
|
private _getIterationMessages;
|
|
152
155
|
private _refreshIterationParameters;
|
|
153
156
|
constructor(props: {
|
|
157
|
+
chat?: Chat;
|
|
154
158
|
instructions?: ValueOrGetter<string, Context>;
|
|
155
159
|
objects?: ValueOrGetter<ObjectInstance[], Context>;
|
|
156
160
|
tools?: ValueOrGetter<Tool[], Context>;
|
|
157
161
|
exits?: ValueOrGetter<Exit[], Context>;
|
|
158
|
-
transcript?: ValueOrGetter<TranscriptMessage[], Context>;
|
|
159
|
-
components?: ValueOrGetter<Component[], Context>;
|
|
160
162
|
loop?: number;
|
|
161
163
|
temperature?: number;
|
|
162
164
|
model?: Model;
|
|
163
165
|
metadata?: Record<string, any>;
|
|
164
166
|
snapshot?: Snapshot;
|
|
167
|
+
timeout?: number;
|
|
165
168
|
});
|
|
166
169
|
}
|
|
167
170
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk6WT5VZBGcjs = require('./chunk-6WT5VZBG.cjs');
|
|
4
|
+
require('./chunk-IKSIOIIP.cjs');
|
|
5
|
+
require('./chunk-EJRCDWBA.cjs');
|
|
6
|
+
require('./chunk-KMZDFWYZ.cjs');
|
|
7
|
+
require('./chunk-FIVFS4HG.cjs');
|
|
8
|
+
require('./chunk-P7J2WCBB.cjs');
|
|
9
|
+
require('./chunk-UQOBUJIQ.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.DualModePrompt = _chunk6WT5VZBGcjs.DualModePrompt;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DualModePrompt
|
|
3
|
+
} from "./chunk-WLUVY5QU.js";
|
|
4
|
+
import "./chunk-JQBT7UWN.js";
|
|
5
|
+
import "./chunk-HP7RKM25.js";
|
|
6
|
+
import "./chunk-ORQP26SZ.js";
|
|
7
|
+
import "./chunk-QT4QF3YA.js";
|
|
8
|
+
import "./chunk-5TRUJES5.js";
|
|
9
|
+
import "./chunk-7WRN4E42.js";
|
|
10
|
+
export {
|
|
11
|
+
DualModePrompt
|
|
12
|
+
};
|
package/dist/exit.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { type JSONSchema } from '@bpinternal/zui';
|
|
2
2
|
import { ZuiType } from './types.js';
|
|
3
|
+
export type ExitResult<T = unknown> = {
|
|
4
|
+
exit: Exit<T>;
|
|
5
|
+
result: T;
|
|
6
|
+
};
|
|
3
7
|
export declare class Exit<T = unknown> {
|
|
4
8
|
name: string;
|
|
5
9
|
aliases: string[];
|
|
@@ -9,6 +13,8 @@ export declare class Exit<T = unknown> {
|
|
|
9
13
|
get zSchema(): import("@bpinternal/zui").ZodTypeAny | undefined;
|
|
10
14
|
rename(name: string): this;
|
|
11
15
|
clone(): Exit<any>;
|
|
16
|
+
is<T>(exit: Exit<T>): this is Exit<T>;
|
|
17
|
+
match(result: ExitResult): result is ExitResult<T>;
|
|
12
18
|
constructor(props: {
|
|
13
19
|
name: string;
|
|
14
20
|
aliases?: string[];
|
package/dist/getter.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type ValueOrGetter<T, I> = T | ((ctx: I) => T) | ((ctx: I) => Promise<T>);
|
|
2
|
-
export declare const getValue: <T, I>(valueOrGetter: ValueOrGetter<T, I>, ctx
|
|
2
|
+
export declare const getValue: <T, I>(valueOrGetter: ValueOrGetter<T, I>, ctx?: I) => Promise<T>;
|