@botpress/runtime 1.0.1
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/actions.d.ts +3 -0
- package/dist/_types/actions.d.ts.map +1 -0
- package/dist/_types/events.d.ts +5 -0
- package/dist/_types/events.d.ts.map +1 -0
- package/dist/_types/integration-actions.d.ts +3 -0
- package/dist/_types/integration-actions.d.ts.map +1 -0
- package/dist/_types/state.d.ts +4 -0
- package/dist/_types/state.d.ts.map +1 -0
- package/dist/_types/tables.d.ts +3 -0
- package/dist/_types/tables.d.ts.map +1 -0
- package/dist/_types/triggers.d.ts +3 -0
- package/dist/_types/triggers.d.ts.map +1 -0
- package/dist/_types/workflows.d.ts +12 -0
- package/dist/_types/workflows.d.ts.map +1 -0
- package/dist/constants.d.ts +58 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/consts.d.ts +8 -0
- package/dist/consts.d.ts.map +1 -0
- package/dist/debugging/node-inspector.d.ts +5 -0
- package/dist/debugging/node-inspector.d.ts.map +1 -0
- package/dist/define-config.d.ts +70 -0
- package/dist/define-config.d.ts.map +1 -0
- package/dist/definition.d.ts +10 -0
- package/dist/definition.d.ts.map +1 -0
- package/dist/definition.js +88 -0
- package/dist/definition.js.map +7 -0
- package/dist/environment.d.ts +60 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/errors.d.ts +36 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/globals.d.ts +21 -0
- package/dist/globals.d.ts.map +1 -0
- package/dist/internal.d.ts +15 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +46573 -0
- package/dist/internal.js.map +7 -0
- package/dist/library.d.ts +16 -0
- package/dist/library.d.ts.map +1 -0
- package/dist/library.js +45943 -0
- package/dist/library.js.map +7 -0
- package/dist/primitives/action.d.ts +37 -0
- package/dist/primitives/action.d.ts.map +1 -0
- package/dist/primitives/asset.d.ts +28 -0
- package/dist/primitives/asset.d.ts.map +1 -0
- package/dist/primitives/conversation.d.ts +104 -0
- package/dist/primitives/conversation.d.ts.map +1 -0
- package/dist/primitives/data-sources/index.d.ts +7 -0
- package/dist/primitives/data-sources/index.d.ts.map +1 -0
- package/dist/primitives/data-sources/source-base.d.ts +251 -0
- package/dist/primitives/data-sources/source-base.d.ts.map +1 -0
- package/dist/primitives/data-sources/source-directory.d.ts +119 -0
- package/dist/primitives/data-sources/source-directory.d.ts.map +1 -0
- package/dist/primitives/data-sources/source-table.d.ts +135 -0
- package/dist/primitives/data-sources/source-table.d.ts.map +1 -0
- package/dist/primitives/data-sources/source-website.d.ts +226 -0
- package/dist/primitives/data-sources/source-website.d.ts.map +1 -0
- package/dist/primitives/definition.d.ts +68 -0
- package/dist/primitives/definition.d.ts.map +1 -0
- package/dist/primitives/index.d.ts +149 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/knowledge.d.ts +36 -0
- package/dist/primitives/knowledge.d.ts.map +1 -0
- package/dist/primitives/table.d.ts +153 -0
- package/dist/primitives/table.d.ts.map +1 -0
- package/dist/primitives/trigger.d.ts +26 -0
- package/dist/primitives/trigger.d.ts.map +1 -0
- package/dist/primitives/workflow-instance.d.ts +80 -0
- package/dist/primitives/workflow-instance.d.ts.map +1 -0
- package/dist/primitives/workflow-step.d.ts +184 -0
- package/dist/primitives/workflow-step.d.ts.map +1 -0
- package/dist/primitives/workflow-utils.d.ts +36 -0
- package/dist/primitives/workflow-utils.d.ts.map +1 -0
- package/dist/primitives/workflow.d.ts +86 -0
- package/dist/primitives/workflow.d.ts.map +1 -0
- package/dist/runtime/actions.d.ts +6 -0
- package/dist/runtime/actions.d.ts.map +1 -0
- package/dist/runtime/adk.d.ts +54 -0
- package/dist/runtime/adk.d.ts.map +1 -0
- package/dist/runtime/agent-registry.d.ts +33 -0
- package/dist/runtime/agent-registry.d.ts.map +1 -0
- package/dist/runtime/assets.d.ts +48 -0
- package/dist/runtime/assets.d.ts.map +1 -0
- package/dist/runtime/autonomous.d.ts +86 -0
- package/dist/runtime/autonomous.d.ts.map +1 -0
- package/dist/runtime/chat/chat.d.ts +42 -0
- package/dist/runtime/chat/chat.d.ts.map +1 -0
- package/dist/runtime/chat/citations.d.ts +9 -0
- package/dist/runtime/chat/citations.d.ts.map +1 -0
- package/dist/runtime/chat/html.d.ts +2 -0
- package/dist/runtime/chat/html.d.ts.map +1 -0
- package/dist/runtime/chat/index.d.ts +5 -0
- package/dist/runtime/chat/index.d.ts.map +1 -0
- package/dist/runtime/chat/messages.d.ts +35 -0
- package/dist/runtime/chat/messages.d.ts.map +1 -0
- package/dist/runtime/chat/transcript.d.ts +75 -0
- package/dist/runtime/chat/transcript.d.ts.map +1 -0
- package/dist/runtime/chat/truncate-object.d.ts +12 -0
- package/dist/runtime/chat/truncate-object.d.ts.map +1 -0
- package/dist/runtime/chat/truncate-transcript.d.ts +6 -0
- package/dist/runtime/chat/truncate-transcript.d.ts.map +1 -0
- package/dist/runtime/config.d.ts +19 -0
- package/dist/runtime/config.d.ts.map +1 -0
- package/dist/runtime/context/cognitive.d.ts +7 -0
- package/dist/runtime/context/cognitive.d.ts.map +1 -0
- package/dist/runtime/context/context.d.ts +59 -0
- package/dist/runtime/context/context.d.ts.map +1 -0
- package/dist/runtime/context/handlers.d.ts +14 -0
- package/dist/runtime/context/handlers.d.ts.map +1 -0
- package/dist/runtime/context/http.d.ts +38 -0
- package/dist/runtime/context/http.d.ts.map +1 -0
- package/dist/runtime/context/inspector-handler.d.ts +59 -0
- package/dist/runtime/context/inspector-handler.d.ts.map +1 -0
- package/dist/runtime/context/promises.d.ts +36 -0
- package/dist/runtime/context/promises.d.ts.map +1 -0
- package/dist/runtime/events.d.ts +89 -0
- package/dist/runtime/events.d.ts.map +1 -0
- package/dist/runtime/handlers/conversation.d.ts +3 -0
- package/dist/runtime/handlers/conversation.d.ts.map +1 -0
- package/dist/runtime/handlers/event.d.ts +3 -0
- package/dist/runtime/handlers/event.d.ts.map +1 -0
- package/dist/runtime/handlers/index.d.ts +11 -0
- package/dist/runtime/handlers/index.d.ts.map +1 -0
- package/dist/runtime/handlers/trigger.d.ts +3 -0
- package/dist/runtime/handlers/trigger.d.ts.map +1 -0
- package/dist/runtime/handlers/workflow.d.ts +3 -0
- package/dist/runtime/handlers/workflow.d.ts.map +1 -0
- package/dist/runtime/heavy-imports.d.ts +10 -0
- package/dist/runtime/heavy-imports.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +13 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/interfaces.d.ts +16 -0
- package/dist/runtime/interfaces.d.ts.map +1 -0
- package/dist/runtime/singletons.d.ts +21 -0
- package/dist/runtime/singletons.d.ts.map +1 -0
- package/dist/runtime/state.d.ts +8 -0
- package/dist/runtime/state.d.ts.map +1 -0
- package/dist/runtime/tracked-state-schema.d.ts +36 -0
- package/dist/runtime/tracked-state-schema.d.ts.map +1 -0
- package/dist/runtime/tracked-state.d.ts +57 -0
- package/dist/runtime/tracked-state.d.ts.map +1 -0
- package/dist/runtime/workflows/index.d.ts +7 -0
- package/dist/runtime/workflows/index.d.ts.map +1 -0
- package/dist/runtime/workflows/knowledge-indexing.d.ts +109 -0
- package/dist/runtime/workflows/knowledge-indexing.d.ts.map +1 -0
- package/dist/runtime.d.ts +22 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +47545 -0
- package/dist/runtime.js.map +7 -0
- package/dist/telemetry/context-manager.d.ts +16 -0
- package/dist/telemetry/context-manager.d.ts.map +1 -0
- package/dist/telemetry/file-exporter.d.ts +11 -0
- package/dist/telemetry/file-exporter.d.ts.map +1 -0
- package/dist/telemetry/instrument-http.d.ts +4 -0
- package/dist/telemetry/instrument-http.d.ts.map +1 -0
- package/dist/telemetry/live-file-processor.d.ts +13 -0
- package/dist/telemetry/live-file-processor.d.ts.map +1 -0
- package/dist/telemetry/span-helpers.d.ts +30 -0
- package/dist/telemetry/span-helpers.d.ts.map +1 -0
- package/dist/telemetry/spans/factory.d.ts +44 -0
- package/dist/telemetry/spans/factory.d.ts.map +1 -0
- package/dist/telemetry/spans/index.d.ts +1009 -0
- package/dist/telemetry/spans/index.d.ts.map +1 -0
- package/dist/telemetry/spans/well-known-attributes.d.ts +78 -0
- package/dist/telemetry/spans/well-known-attributes.d.ts.map +1 -0
- package/dist/telemetry/structured-logging.d.ts +34 -0
- package/dist/telemetry/structured-logging.d.ts.map +1 -0
- package/dist/telemetry/tracing.d.ts +6 -0
- package/dist/telemetry/tracing.d.ts.map +1 -0
- package/dist/telemetry/utils.d.ts +3 -0
- package/dist/telemetry/utils.d.ts.map +1 -0
- package/dist/types.d.ts +17 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/ui.d.ts +10 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +749 -0
- package/dist/ui.js.map +7 -0
- package/dist/utilities/abort-signal.d.ts +41 -0
- package/dist/utilities/abort-signal.d.ts.map +1 -0
- package/dist/utilities/events.d.ts +10 -0
- package/dist/utilities/events.d.ts.map +1 -0
- package/dist/utilities/promises.d.ts +3 -0
- package/dist/utilities/promises.d.ts.map +1 -0
- package/dist/utilities/size.d.ts +12 -0
- package/dist/utilities/size.d.ts.map +1 -0
- package/dist/utilities/strings.d.ts +18 -0
- package/dist/utilities/strings.d.ts.map +1 -0
- package/dist/utilities/trigger-tags.d.ts +31 -0
- package/dist/utilities/trigger-tags.d.ts.map +1 -0
- package/dist/utilities/types.d.ts +2 -0
- package/dist/utilities/types.d.ts.map +1 -0
- package/dist/workers/dev_worker.d.ts +6 -0
- package/dist/workers/dev_worker.d.ts.map +1 -0
- package/dist/workers/index.d.ts +5 -0
- package/dist/workers/index.d.ts.map +1 -0
- package/dist/workers/parent_worker.d.ts +5 -0
- package/dist/workers/parent_worker.d.ts.map +1 -0
- package/dist/workers/worker_pool.d.ts +109 -0
- package/dist/workers/worker_pool.d.ts.map +1 -0
- package/package.json +109 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { DataSource } from "./source-base";
|
|
2
|
+
import { BaseTable } from "../table";
|
|
3
|
+
type TableRow = {
|
|
4
|
+
id: number;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
type TableSourceOptions<TRow extends TableRow = TableRow> = {
|
|
10
|
+
id?: string;
|
|
11
|
+
transform?: (context: {
|
|
12
|
+
row: TRow;
|
|
13
|
+
content: string;
|
|
14
|
+
}) => string | Promise<string>;
|
|
15
|
+
};
|
|
16
|
+
export declare class TableSource<TRow extends TableRow = TableRow> extends DataSource {
|
|
17
|
+
readonly table: BaseTable<any>;
|
|
18
|
+
private transformFn;
|
|
19
|
+
private constructor();
|
|
20
|
+
get syncWorkflow(): import("..").Workflow<`data_source_sync_${string}`, import("@bpinternal/zui").ZodObject<{
|
|
21
|
+
sourceId: import("@bpinternal/zui").ZodString;
|
|
22
|
+
kbName: import("@bpinternal/zui").ZodString;
|
|
23
|
+
force: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodBoolean>>;
|
|
24
|
+
}, "strip", {
|
|
25
|
+
kbName: string;
|
|
26
|
+
sourceId: string;
|
|
27
|
+
force: boolean;
|
|
28
|
+
}, {
|
|
29
|
+
kbName: string;
|
|
30
|
+
sourceId: string;
|
|
31
|
+
force?: boolean | undefined;
|
|
32
|
+
}>, import("@bpinternal/zui").ZodObject<{
|
|
33
|
+
processed: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
|
|
34
|
+
added: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
35
|
+
file: import("@bpinternal/zui").ZodString;
|
|
36
|
+
name: import("@bpinternal/zui").ZodString;
|
|
37
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
38
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
39
|
+
}, "strip", {
|
|
40
|
+
name: string;
|
|
41
|
+
size: number;
|
|
42
|
+
hash: string;
|
|
43
|
+
file: string;
|
|
44
|
+
}, {
|
|
45
|
+
name: string;
|
|
46
|
+
size: number;
|
|
47
|
+
hash: string;
|
|
48
|
+
file: string;
|
|
49
|
+
}>, "many">>;
|
|
50
|
+
updated: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
51
|
+
file: import("@bpinternal/zui").ZodString;
|
|
52
|
+
name: import("@bpinternal/zui").ZodString;
|
|
53
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
54
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
55
|
+
}, "strip", {
|
|
56
|
+
name: string;
|
|
57
|
+
size: number;
|
|
58
|
+
hash: string;
|
|
59
|
+
file: string;
|
|
60
|
+
}, {
|
|
61
|
+
name: string;
|
|
62
|
+
size: number;
|
|
63
|
+
hash: string;
|
|
64
|
+
file: string;
|
|
65
|
+
}>, "many">>;
|
|
66
|
+
deleted: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
67
|
+
file: import("@bpinternal/zui").ZodString;
|
|
68
|
+
name: import("@bpinternal/zui").ZodString;
|
|
69
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
70
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
71
|
+
}, "strip", {
|
|
72
|
+
name: string;
|
|
73
|
+
size: number;
|
|
74
|
+
hash: string;
|
|
75
|
+
file: string;
|
|
76
|
+
}, {
|
|
77
|
+
name: string;
|
|
78
|
+
size: number;
|
|
79
|
+
hash: string;
|
|
80
|
+
file: string;
|
|
81
|
+
}>, "many">>;
|
|
82
|
+
errors: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodString, "many">>;
|
|
83
|
+
}, "strip", {
|
|
84
|
+
processed: number;
|
|
85
|
+
added: {
|
|
86
|
+
name: string;
|
|
87
|
+
size: number;
|
|
88
|
+
hash: string;
|
|
89
|
+
file: string;
|
|
90
|
+
}[];
|
|
91
|
+
updated: {
|
|
92
|
+
name: string;
|
|
93
|
+
size: number;
|
|
94
|
+
hash: string;
|
|
95
|
+
file: string;
|
|
96
|
+
}[];
|
|
97
|
+
deleted: {
|
|
98
|
+
name: string;
|
|
99
|
+
size: number;
|
|
100
|
+
hash: string;
|
|
101
|
+
file: string;
|
|
102
|
+
}[];
|
|
103
|
+
errors: string[];
|
|
104
|
+
}, {
|
|
105
|
+
processed?: number | undefined;
|
|
106
|
+
added?: {
|
|
107
|
+
name: string;
|
|
108
|
+
size: number;
|
|
109
|
+
hash: string;
|
|
110
|
+
file: string;
|
|
111
|
+
}[] | undefined;
|
|
112
|
+
updated?: {
|
|
113
|
+
name: string;
|
|
114
|
+
size: number;
|
|
115
|
+
hash: string;
|
|
116
|
+
file: string;
|
|
117
|
+
}[] | undefined;
|
|
118
|
+
deleted?: {
|
|
119
|
+
name: string;
|
|
120
|
+
size: number;
|
|
121
|
+
hash: string;
|
|
122
|
+
file: string;
|
|
123
|
+
}[] | undefined;
|
|
124
|
+
errors?: string[] | undefined;
|
|
125
|
+
}>, import("@bpinternal/zui").ZodObject<{
|
|
126
|
+
offset: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
|
|
127
|
+
}, "strip", {
|
|
128
|
+
offset: number;
|
|
129
|
+
}, {
|
|
130
|
+
offset?: number | undefined;
|
|
131
|
+
}>, Record<string, import("../../types").ZuiType>>;
|
|
132
|
+
static fromTable<TRow extends TableRow = TableRow>(table: BaseTable<any>, options?: TableSourceOptions<TRow>): TableSource<TRow>;
|
|
133
|
+
}
|
|
134
|
+
export {};
|
|
135
|
+
//# sourceMappingURL=source-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-table.d.ts","sourceRoot":"","sources":["../../../src/primitives/data-sources/source-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,KAAK,QAAQ,GAAG;IACd,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAC;AAEF,KAAK,kBAAkB,CAAC,IAAI,SAAS,QAAQ,GAAG,QAAQ,IAAI;IAC1D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE;QACpB,GAAG,EAAE,IAAI,CAAC;QACV,OAAO,EAAE,MAAM,CAAC;KACjB,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF,qBAAa,WAAW,CAAC,IAAI,SAAS,QAAQ,GAAG,QAAQ,CAAE,SAAQ,UAAU;IAC3E,SAAgB,KAAK,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IACtC,OAAO,CAAC,WAAW,CAEL;IAEd,OAAO;IAUP,IAAW,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAQtB;IAED,MAAM,CAAC,SAAS,CAAC,IAAI,SAAS,QAAQ,GAAG,QAAQ,EAC/C,KAAK,EAAE,SAAS,CAAC,GAAG,CAAC,EACrB,OAAO,GAAE,kBAAkB,CAAC,IAAI,CAAM,GACrC,WAAW,CAAC,IAAI,CAAC;CAIrB"}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { DataSource } from "./source-base";
|
|
2
|
+
import { WellKnownMetadata } from "../../constants";
|
|
3
|
+
type SitemapFilterContext = {
|
|
4
|
+
url: string;
|
|
5
|
+
lastmod?: string;
|
|
6
|
+
changefreq?: string;
|
|
7
|
+
priority?: string;
|
|
8
|
+
};
|
|
9
|
+
type FetchResult = {
|
|
10
|
+
url: string;
|
|
11
|
+
contentType: string;
|
|
12
|
+
content: string;
|
|
13
|
+
metadata?: {
|
|
14
|
+
[WellKnownMetadata.knowledge.TITLE]?: string;
|
|
15
|
+
[WellKnownMetadata.knowledge.DESCRIPTION]?: string;
|
|
16
|
+
[WellKnownMetadata.knowledge.FAVICON]?: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type WebsiteSourceOptions = {
|
|
20
|
+
id?: string;
|
|
21
|
+
filter?: (context: SitemapFilterContext) => boolean;
|
|
22
|
+
fetch?: (url: string) => Promise<FetchResult> | FetchResult;
|
|
23
|
+
maxPages?: number;
|
|
24
|
+
maxDepth?: number;
|
|
25
|
+
};
|
|
26
|
+
type UrlsSourceOptions = {
|
|
27
|
+
id?: string;
|
|
28
|
+
fetch?: (url: string) => Promise<FetchResult> | FetchResult;
|
|
29
|
+
};
|
|
30
|
+
export declare class WebsiteSource extends DataSource {
|
|
31
|
+
private mode;
|
|
32
|
+
private baseUrl;
|
|
33
|
+
private sitemapUrl;
|
|
34
|
+
private urls;
|
|
35
|
+
private filterFn;
|
|
36
|
+
private customFetch;
|
|
37
|
+
private maxPages;
|
|
38
|
+
private maxDepth;
|
|
39
|
+
private transformFn;
|
|
40
|
+
private constructor();
|
|
41
|
+
private isBrowserIntegrationAvailable;
|
|
42
|
+
/**
|
|
43
|
+
* Fetch content from a URL with fallback strategy
|
|
44
|
+
*/
|
|
45
|
+
private fetchSitemap;
|
|
46
|
+
/**
|
|
47
|
+
* Fetch content from a URL with fallback strategy
|
|
48
|
+
*/
|
|
49
|
+
private fetchUrl;
|
|
50
|
+
/**
|
|
51
|
+
* Parse sitemap XML content
|
|
52
|
+
*/
|
|
53
|
+
private parseSitemapXml;
|
|
54
|
+
/**
|
|
55
|
+
* Parse sitemap TXT content
|
|
56
|
+
*/
|
|
57
|
+
private parseSitemapTxt;
|
|
58
|
+
/**
|
|
59
|
+
* Discover URLs from a website using browser integration
|
|
60
|
+
*/
|
|
61
|
+
private discoverUrlsFromWebsite;
|
|
62
|
+
/**
|
|
63
|
+
* Discover all URLs from sitemap with depth and page limits
|
|
64
|
+
*/
|
|
65
|
+
private discoverUrls;
|
|
66
|
+
get syncWorkflow(): import("../workflow").BaseWorkflow<`data_source_sync_${string}`, import("@bpinternal/zui").ZodObject<{
|
|
67
|
+
sourceId: import("@bpinternal/zui").ZodString;
|
|
68
|
+
kbName: import("@bpinternal/zui").ZodString;
|
|
69
|
+
force: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodBoolean>>;
|
|
70
|
+
}, "strip", {
|
|
71
|
+
kbName: string;
|
|
72
|
+
sourceId: string;
|
|
73
|
+
force: boolean;
|
|
74
|
+
}, {
|
|
75
|
+
kbName: string;
|
|
76
|
+
sourceId: string;
|
|
77
|
+
force?: boolean | undefined;
|
|
78
|
+
}>, import("@bpinternal/zui").ZodObject<{
|
|
79
|
+
processed: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
|
|
80
|
+
added: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
81
|
+
file: import("@bpinternal/zui").ZodString;
|
|
82
|
+
name: import("@bpinternal/zui").ZodString;
|
|
83
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
84
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
85
|
+
}, "strip", {
|
|
86
|
+
name: string;
|
|
87
|
+
size: number;
|
|
88
|
+
hash: string;
|
|
89
|
+
file: string;
|
|
90
|
+
}, {
|
|
91
|
+
name: string;
|
|
92
|
+
size: number;
|
|
93
|
+
hash: string;
|
|
94
|
+
file: string;
|
|
95
|
+
}>, "many">>;
|
|
96
|
+
updated: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
97
|
+
file: import("@bpinternal/zui").ZodString;
|
|
98
|
+
name: import("@bpinternal/zui").ZodString;
|
|
99
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
100
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
101
|
+
}, "strip", {
|
|
102
|
+
name: string;
|
|
103
|
+
size: number;
|
|
104
|
+
hash: string;
|
|
105
|
+
file: string;
|
|
106
|
+
}, {
|
|
107
|
+
name: string;
|
|
108
|
+
size: number;
|
|
109
|
+
hash: string;
|
|
110
|
+
file: string;
|
|
111
|
+
}>, "many">>;
|
|
112
|
+
deleted: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
113
|
+
file: import("@bpinternal/zui").ZodString;
|
|
114
|
+
name: import("@bpinternal/zui").ZodString;
|
|
115
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
116
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
117
|
+
}, "strip", {
|
|
118
|
+
name: string;
|
|
119
|
+
size: number;
|
|
120
|
+
hash: string;
|
|
121
|
+
file: string;
|
|
122
|
+
}, {
|
|
123
|
+
name: string;
|
|
124
|
+
size: number;
|
|
125
|
+
hash: string;
|
|
126
|
+
file: string;
|
|
127
|
+
}>, "many">>;
|
|
128
|
+
errors: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodString, "many">>;
|
|
129
|
+
}, "strip", {
|
|
130
|
+
processed: number;
|
|
131
|
+
added: {
|
|
132
|
+
name: string;
|
|
133
|
+
size: number;
|
|
134
|
+
hash: string;
|
|
135
|
+
file: string;
|
|
136
|
+
}[];
|
|
137
|
+
updated: {
|
|
138
|
+
name: string;
|
|
139
|
+
size: number;
|
|
140
|
+
hash: string;
|
|
141
|
+
file: string;
|
|
142
|
+
}[];
|
|
143
|
+
deleted: {
|
|
144
|
+
name: string;
|
|
145
|
+
size: number;
|
|
146
|
+
hash: string;
|
|
147
|
+
file: string;
|
|
148
|
+
}[];
|
|
149
|
+
errors: string[];
|
|
150
|
+
}, {
|
|
151
|
+
processed?: number | undefined;
|
|
152
|
+
added?: {
|
|
153
|
+
name: string;
|
|
154
|
+
size: number;
|
|
155
|
+
hash: string;
|
|
156
|
+
file: string;
|
|
157
|
+
}[] | undefined;
|
|
158
|
+
updated?: {
|
|
159
|
+
name: string;
|
|
160
|
+
size: number;
|
|
161
|
+
hash: string;
|
|
162
|
+
file: string;
|
|
163
|
+
}[] | undefined;
|
|
164
|
+
deleted?: {
|
|
165
|
+
name: string;
|
|
166
|
+
size: number;
|
|
167
|
+
hash: string;
|
|
168
|
+
file: string;
|
|
169
|
+
}[] | undefined;
|
|
170
|
+
errors?: string[] | undefined;
|
|
171
|
+
}>, import("@bpinternal/zui").ZodObject<{
|
|
172
|
+
urls: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
173
|
+
loc: import("@bpinternal/zui").ZodString;
|
|
174
|
+
lastmod: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
175
|
+
changefreq: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
176
|
+
priority: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
177
|
+
}, "strip", {
|
|
178
|
+
loc: string;
|
|
179
|
+
lastmod?: string | undefined;
|
|
180
|
+
changefreq?: string | undefined;
|
|
181
|
+
priority?: string | undefined;
|
|
182
|
+
}, {
|
|
183
|
+
loc: string;
|
|
184
|
+
lastmod?: string | undefined;
|
|
185
|
+
changefreq?: string | undefined;
|
|
186
|
+
priority?: string | undefined;
|
|
187
|
+
}>, "many">>;
|
|
188
|
+
queue: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
189
|
+
url: import("@bpinternal/zui").ZodString;
|
|
190
|
+
depth: import("@bpinternal/zui").ZodNumber;
|
|
191
|
+
}, "strip", {
|
|
192
|
+
url: string;
|
|
193
|
+
depth: number;
|
|
194
|
+
}, {
|
|
195
|
+
url: string;
|
|
196
|
+
depth: number;
|
|
197
|
+
}>, "many">>;
|
|
198
|
+
}, "strip", {
|
|
199
|
+
urls: {
|
|
200
|
+
loc: string;
|
|
201
|
+
lastmod?: string | undefined;
|
|
202
|
+
changefreq?: string | undefined;
|
|
203
|
+
priority?: string | undefined;
|
|
204
|
+
}[];
|
|
205
|
+
queue: {
|
|
206
|
+
url: string;
|
|
207
|
+
depth: number;
|
|
208
|
+
}[];
|
|
209
|
+
}, {
|
|
210
|
+
urls?: {
|
|
211
|
+
loc: string;
|
|
212
|
+
lastmod?: string | undefined;
|
|
213
|
+
changefreq?: string | undefined;
|
|
214
|
+
priority?: string | undefined;
|
|
215
|
+
}[] | undefined;
|
|
216
|
+
queue?: {
|
|
217
|
+
url: string;
|
|
218
|
+
depth: number;
|
|
219
|
+
}[] | undefined;
|
|
220
|
+
}>, Record<string, import("../../types").ZuiType>>;
|
|
221
|
+
static fromWebsite(baseUrl: string, options?: WebsiteSourceOptions): WebsiteSource;
|
|
222
|
+
static fromSitemap(sitemapUrl: string, options?: WebsiteSourceOptions): WebsiteSource;
|
|
223
|
+
static fromUrls(urls: string[], options?: UrlsSourceOptions): WebsiteSource;
|
|
224
|
+
}
|
|
225
|
+
export {};
|
|
226
|
+
//# sourceMappingURL=source-website.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-website.d.ts","sourceRoot":"","sources":["../../../src/primitives/data-sources/source-website.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4B,MAAM,eAAe,CAAC;AAErE,OAAO,EAAiB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAKnE,KAAK,oBAAoB,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CA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AAC,6BAA6B;IAIrC;;OAEG;YACW,YAAY;IAgD1B;;OAEG;YACW,QAAQ;IAoDtB;;OAEG;IACH,OAAO,CAAC,eAAe;IAuDvB;;OAEG;IACH,OAAO,CAAC,eAAe;IAcvB;;OAEG;YACW,uBAAuB;IA0DrC;;OAEG;YACW,YAAY;IAqI1B,IAAW,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAmNtB;IAED,MAAM,CAAC,WAAW,CAChB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,oBAAyB,GACjC,aAAa;IAOhB,MAAM,CAAC,WAAW,CAChB,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,oBAAyB,GACjC,aAAa;IAOhB,MAAM,CAAC,QAAQ,CACb,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,iBAAsB,GAC9B,aAAa;CAIjB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { JSONSchema7 } from "@botpress/sdk";
|
|
2
|
+
import { DataSource } from "./data-sources";
|
|
3
|
+
export declare namespace Definitions {
|
|
4
|
+
type PrimitiveDefinition = ConversationDefinition | WorkflowDefinition | KnowledgeDefinition | TriggerDefinition | ActionDefinition | TableDefinition;
|
|
5
|
+
interface Primitive {
|
|
6
|
+
getDefinition(): PrimitiveDefinition;
|
|
7
|
+
}
|
|
8
|
+
type ConversationDefinition = {
|
|
9
|
+
type: "conversation";
|
|
10
|
+
channel: string;
|
|
11
|
+
};
|
|
12
|
+
type WorkflowDefinition = {
|
|
13
|
+
type: "workflow";
|
|
14
|
+
name: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
input?: JSONSchema7;
|
|
17
|
+
output?: JSONSchema7;
|
|
18
|
+
state?: JSONSchema7;
|
|
19
|
+
schedule?: string;
|
|
20
|
+
timeout: number;
|
|
21
|
+
};
|
|
22
|
+
type KnowledgeDefinition = {
|
|
23
|
+
type: "knowledge";
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
sources: DataSource[];
|
|
27
|
+
};
|
|
28
|
+
type TriggerDefinition = {
|
|
29
|
+
type: "trigger";
|
|
30
|
+
name: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
state?: JSONSchema7;
|
|
33
|
+
events: string[];
|
|
34
|
+
};
|
|
35
|
+
type ActionDefinition = {
|
|
36
|
+
type: "action";
|
|
37
|
+
name: string;
|
|
38
|
+
title?: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
attributes?: Record<string, string>;
|
|
41
|
+
input?: JSONSchema7;
|
|
42
|
+
output?: JSONSchema7;
|
|
43
|
+
cached?: boolean;
|
|
44
|
+
};
|
|
45
|
+
type TableDefinition = {
|
|
46
|
+
type: "table";
|
|
47
|
+
name: string;
|
|
48
|
+
schema: JSONSchema7;
|
|
49
|
+
factor: number;
|
|
50
|
+
};
|
|
51
|
+
function isConversationDefinition(value: unknown): value is ConversationDefinition;
|
|
52
|
+
function isWorkflowDefinition(value: unknown): value is WorkflowDefinition;
|
|
53
|
+
function isKnowledgeDefinition(value: unknown): value is KnowledgeDefinition;
|
|
54
|
+
function isTriggerDefinition(value: unknown): value is TriggerDefinition;
|
|
55
|
+
function isActionDefinition(value: unknown): value is ActionDefinition;
|
|
56
|
+
function isTableDefinition(value: unknown): value is TableDefinition;
|
|
57
|
+
function isValidDefinition(value: unknown): value is PrimitiveDefinition;
|
|
58
|
+
/**
|
|
59
|
+
* Extracts the definition from a class that implements the Primitive interface.
|
|
60
|
+
* If the class does not implement the interface or the definition is invalid,
|
|
61
|
+
* it returns undefined.
|
|
62
|
+
*
|
|
63
|
+
* @param maybeClass - The object to check for a Primitive definition.
|
|
64
|
+
* @returns The definition if valid, otherwise undefined.
|
|
65
|
+
*/
|
|
66
|
+
function getDefinition(maybeClass: unknown): PrimitiveDefinition | undefined;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["../../src/primitives/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,yBAAiB,WAAW,CAAC;IAC3B,KAAY,mBAAmB,GAC3B,sBAAsB,GACtB,kBAAkB,GAClB,mBAAmB,GACnB,iBAAiB,GACjB,gBAAgB,GAChB,eAAe,CAAC;IAEpB,UAAiB,SAAS;QACxB,aAAa,IAAI,mBAAmB,CAAC;KACtC;IAED,KAAY,sBAAsB,GAAG;QACnC,IAAI,EAAE,cAAc,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF,KAAY,kBAAkB,GAAG;QAC/B,IAAI,EAAE,UAAU,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,WAAW,CAAC;QACpB,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,KAAK,CAAC,EAAE,WAAW,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF,KAAY,mBAAmB,GAAG;QAChC,IAAI,EAAE,WAAW,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,UAAU,EAAE,CAAC;KACvB,CAAC;IAEF,KAAY,iBAAiB,GAAG;QAC9B,IAAI,EAAE,SAAS,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,KAAK,CAAC,EAAE,WAAW,CAAC;QACpB,MAAM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|
|
3
|
+
import { Definitions as _Definitions } from "./definition";
|
|
4
|
+
import * as _DataSources from "./data-sources/index";
|
|
5
|
+
import { BaseConversation as _BaseConversation, Typings as _ConversationTypings } from "./conversation.js";
|
|
6
|
+
import { BaseKnowledge as _BaseKnowledge, Typings as _KnowledgeTypings } from "./knowledge.js";
|
|
7
|
+
import { BaseWorkflow as _BaseWorkflow, Typings as _WorkflowTypings } from "./workflow.js";
|
|
8
|
+
import { BaseAction as _BaseAction, Typings as _ActionTypings } from "./action.js";
|
|
9
|
+
import { BaseTable as _BaseTable, Typings as _TableTypings } from "./table.js";
|
|
10
|
+
import { Trigger as _BaseTrigger, Typings as _TriggerTypings } from "./trigger.js";
|
|
11
|
+
import { ZuiType } from "../types";
|
|
12
|
+
export declare namespace Primitives {
|
|
13
|
+
export import Definitions = _Definitions;
|
|
14
|
+
const BaseConversation: typeof _BaseConversation;
|
|
15
|
+
export import Conversation = _ConversationTypings;
|
|
16
|
+
const BaseKnowledge: typeof _BaseKnowledge;
|
|
17
|
+
export import Knowledge = _KnowledgeTypings;
|
|
18
|
+
const BaseWorkflow: typeof _BaseWorkflow;
|
|
19
|
+
export import Workflow = _WorkflowTypings;
|
|
20
|
+
const BaseAction: typeof _BaseAction;
|
|
21
|
+
export import Action = _ActionTypings;
|
|
22
|
+
const BaseTable: typeof _BaseTable;
|
|
23
|
+
export import Table = _TableTypings;
|
|
24
|
+
const BaseTrigger: typeof _BaseTrigger;
|
|
25
|
+
export import Trigger = _TriggerTypings;
|
|
26
|
+
}
|
|
27
|
+
export { BaseConversation as Conversation } from "./conversation.js";
|
|
28
|
+
export { BaseKnowledge as Knowledge } from "./knowledge.js";
|
|
29
|
+
export declare class Action<TInput extends ZuiType, TOutput extends ZuiType> extends Primitives.BaseAction<TInput, TOutput> {
|
|
30
|
+
}
|
|
31
|
+
export { BaseTable as Table } from "./table.js";
|
|
32
|
+
export { BaseWorkflow as Workflow } from "./workflow.js";
|
|
33
|
+
export { Trigger } from "./trigger.js";
|
|
34
|
+
export declare namespace DataSource {
|
|
35
|
+
const createSyncWorkflow: <TState extends import("llmz/dist/types").ZuiType = import("llmz/dist/types").ZuiType>(props: {
|
|
36
|
+
type: string;
|
|
37
|
+
state: TState;
|
|
38
|
+
handler: (props: _WorkflowTypings.HandlerProps<typeof import("./data-sources/source-base").SyncInput, typeof import("./data-sources/source-base").SyncOutput, TState>) => Promise<import("@bpinternal/zui").TypeOf<typeof import("./data-sources/source-base").SyncOutput>>;
|
|
39
|
+
}) => _BaseWorkflow<`data_source_sync_${string}`, import("@bpinternal/zui").ZodObject<{
|
|
40
|
+
sourceId: import("@bpinternal/zui").ZodString;
|
|
41
|
+
kbName: import("@bpinternal/zui").ZodString;
|
|
42
|
+
force: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodBoolean>>;
|
|
43
|
+
}, "strip", {
|
|
44
|
+
kbName: string;
|
|
45
|
+
sourceId: string;
|
|
46
|
+
force: boolean;
|
|
47
|
+
}, {
|
|
48
|
+
kbName: string;
|
|
49
|
+
sourceId: string;
|
|
50
|
+
force?: boolean | undefined;
|
|
51
|
+
}>, import("@bpinternal/zui").ZodObject<{
|
|
52
|
+
processed: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodNumber>;
|
|
53
|
+
added: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
54
|
+
file: import("@bpinternal/zui").ZodString;
|
|
55
|
+
name: import("@bpinternal/zui").ZodString;
|
|
56
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
57
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
58
|
+
}, "strip", {
|
|
59
|
+
name: string;
|
|
60
|
+
size: number;
|
|
61
|
+
hash: string;
|
|
62
|
+
file: string;
|
|
63
|
+
}, {
|
|
64
|
+
name: string;
|
|
65
|
+
size: number;
|
|
66
|
+
hash: string;
|
|
67
|
+
file: string;
|
|
68
|
+
}>, "many">>;
|
|
69
|
+
updated: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
70
|
+
file: import("@bpinternal/zui").ZodString;
|
|
71
|
+
name: import("@bpinternal/zui").ZodString;
|
|
72
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
73
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
74
|
+
}, "strip", {
|
|
75
|
+
name: string;
|
|
76
|
+
size: number;
|
|
77
|
+
hash: string;
|
|
78
|
+
file: string;
|
|
79
|
+
}, {
|
|
80
|
+
name: string;
|
|
81
|
+
size: number;
|
|
82
|
+
hash: string;
|
|
83
|
+
file: string;
|
|
84
|
+
}>, "many">>;
|
|
85
|
+
deleted: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodObject<{
|
|
86
|
+
file: import("@bpinternal/zui").ZodString;
|
|
87
|
+
name: import("@bpinternal/zui").ZodString;
|
|
88
|
+
hash: import("@bpinternal/zui").ZodString;
|
|
89
|
+
size: import("@bpinternal/zui").ZodNumber;
|
|
90
|
+
}, "strip", {
|
|
91
|
+
name: string;
|
|
92
|
+
size: number;
|
|
93
|
+
hash: string;
|
|
94
|
+
file: string;
|
|
95
|
+
}, {
|
|
96
|
+
name: string;
|
|
97
|
+
size: number;
|
|
98
|
+
hash: string;
|
|
99
|
+
file: string;
|
|
100
|
+
}>, "many">>;
|
|
101
|
+
errors: import("@bpinternal/zui").ZodDefault<import("@bpinternal/zui").ZodArray<import("@bpinternal/zui").ZodString, "many">>;
|
|
102
|
+
}, "strip", {
|
|
103
|
+
processed: number;
|
|
104
|
+
added: {
|
|
105
|
+
name: string;
|
|
106
|
+
size: number;
|
|
107
|
+
hash: string;
|
|
108
|
+
file: string;
|
|
109
|
+
}[];
|
|
110
|
+
updated: {
|
|
111
|
+
name: string;
|
|
112
|
+
size: number;
|
|
113
|
+
hash: string;
|
|
114
|
+
file: string;
|
|
115
|
+
}[];
|
|
116
|
+
deleted: {
|
|
117
|
+
name: string;
|
|
118
|
+
size: number;
|
|
119
|
+
hash: string;
|
|
120
|
+
file: string;
|
|
121
|
+
}[];
|
|
122
|
+
errors: string[];
|
|
123
|
+
}, {
|
|
124
|
+
processed?: number | undefined;
|
|
125
|
+
added?: {
|
|
126
|
+
name: string;
|
|
127
|
+
size: number;
|
|
128
|
+
hash: string;
|
|
129
|
+
file: string;
|
|
130
|
+
}[] | undefined;
|
|
131
|
+
updated?: {
|
|
132
|
+
name: string;
|
|
133
|
+
size: number;
|
|
134
|
+
hash: string;
|
|
135
|
+
file: string;
|
|
136
|
+
}[] | undefined;
|
|
137
|
+
deleted?: {
|
|
138
|
+
name: string;
|
|
139
|
+
size: number;
|
|
140
|
+
hash: string;
|
|
141
|
+
file: string;
|
|
142
|
+
}[] | undefined;
|
|
143
|
+
errors?: string[] | undefined;
|
|
144
|
+
}>, TState, Record<string, ZuiType>>;
|
|
145
|
+
const Table: typeof _DataSources.TableSource;
|
|
146
|
+
const Website: typeof _DataSources.WebsiteSource;
|
|
147
|
+
const Directory: typeof _DataSources.DirectorySource;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/primitives/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EAAE,WAAW,IAAI,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,YAAY,MAAM,sBAAsB,CAAC;AAErD,OAAO,EACL,gBAAgB,IAAI,iBAAiB,EACrC,OAAO,IAAI,oBAAoB,EAChC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,aAAa,IAAI,cAAc,EAC/B,OAAO,IAAI,iBAAiB,EAC7B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,YAAY,IAAI,aAAa,EA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AAO,EAAE,YAAY,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,yBAAiB,UAAU,CAAC;IACnB,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAAkC,CAAC;IAC3D,MAAM,KAAK,iCAA2B,CAAC;IACvC,MAAM,OAAO,mCAA6B,CAAC;IAC3C,MAAM,SAAS,qCAA+B,CAAC;CACvD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Definitions } from "./definition";
|
|
2
|
+
import { DataSource } from "./data-sources";
|
|
3
|
+
export declare namespace Typings {
|
|
4
|
+
type Props = {
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
sources: DataSource[];
|
|
8
|
+
};
|
|
9
|
+
const Primitive: "knowledge";
|
|
10
|
+
}
|
|
11
|
+
export declare class BaseKnowledge implements Definitions.Primitive {
|
|
12
|
+
readonly name: string;
|
|
13
|
+
readonly sources: DataSource[];
|
|
14
|
+
readonly description?: string;
|
|
15
|
+
constructor(props: Typings.Props);
|
|
16
|
+
/**
|
|
17
|
+
* Refresh the knowledge base by triggering the built-in indexing workflow for all sources
|
|
18
|
+
* This will fetch data from all data sources and update the knowledge base
|
|
19
|
+
* @param force - If true, forces re-indexing of all data even if unchanged
|
|
20
|
+
* @returns Promise that resolves when the indexing workflow has been started
|
|
21
|
+
*/
|
|
22
|
+
refresh(options?: Partial<{
|
|
23
|
+
force?: boolean;
|
|
24
|
+
}>): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Refresh a specific data source by its ID
|
|
27
|
+
*
|
|
28
|
+
* @param sourceId - The ID of the data source to refresh
|
|
29
|
+
* @param force - If true, forces re-indexing of all data even if unchanged
|
|
30
|
+
* @returns Promise that resolves when the source has been queued for indexing
|
|
31
|
+
*/
|
|
32
|
+
refreshSource(sourceId: string, options?: Partial<{
|
|
33
|
+
force?: boolean;
|
|
34
|
+
}>): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=knowledge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.d.ts","sourceRoot":"","sources":["../../src/primitives/knowledge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAI5C,yBAAiB,OAAO,CAAC;IACvB,KAAY,KAAK,GAAG;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,EAAE,UAAU,EAAE,CAAC;KACvB,CAAC;IAEK,MAAM,SAAS,EAAG,WAAoB,CAAC;CAC/C;AAED,qBAAa,aAAc,YAAW,WAAW,CAAC,SAAS;IACzD,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,OAAO,EAAE,UAAU,EAAE,CAAC;IACtC,SAAgB,WAAW,CAAC,EAAE,MAAM,CAAC;gBAEzB,KAAK,EAAE,OAAO,CAAC,KAAK;IAgBhC;;;;;OAKG;IACG,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAUpE;;;;;;OAMG;IACG,aAAa,CACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,OAAO,CAAC;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,GACrC,OAAO,CAAC,IAAI,CAAC;CAiBjB"}
|