@vertesia/common 0.24.0-dev.202601221707
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/LICENSE +13 -0
- package/README.md +53 -0
- package/lib/cjs/Progress.js +61 -0
- package/lib/cjs/Progress.js.map +1 -0
- package/lib/cjs/access-control.js +56 -0
- package/lib/cjs/access-control.js.map +1 -0
- package/lib/cjs/analytics.js +3 -0
- package/lib/cjs/analytics.js.map +1 -0
- package/lib/cjs/apikey.js +16 -0
- package/lib/cjs/apikey.js.map +1 -0
- package/lib/cjs/apps.js +35 -0
- package/lib/cjs/apps.js.map +1 -0
- package/lib/cjs/ask-user.js +8 -0
- package/lib/cjs/ask-user.js.map +1 -0
- package/lib/cjs/channels.js +63 -0
- package/lib/cjs/channels.js.map +1 -0
- package/lib/cjs/common.js +3 -0
- package/lib/cjs/common.js.map +1 -0
- package/lib/cjs/data-platform.js +127 -0
- package/lib/cjs/data-platform.js.map +1 -0
- package/lib/cjs/email.js +20 -0
- package/lib/cjs/email.js.map +1 -0
- package/lib/cjs/environment.js +44 -0
- package/lib/cjs/environment.js.map +1 -0
- package/lib/cjs/facets.js +3 -0
- package/lib/cjs/facets.js.map +1 -0
- package/lib/cjs/group.js +5 -0
- package/lib/cjs/group.js.map +1 -0
- package/lib/cjs/index.js +55 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/integrations.js +14 -0
- package/lib/cjs/integrations.js.map +1 -0
- package/lib/cjs/interaction.js +97 -0
- package/lib/cjs/interaction.js.map +1 -0
- package/lib/cjs/json-schema.js +3 -0
- package/lib/cjs/json-schema.js.map +1 -0
- package/lib/cjs/json.js +3 -0
- package/lib/cjs/json.js.map +1 -0
- package/lib/cjs/meters.js +13 -0
- package/lib/cjs/meters.js.map +1 -0
- package/lib/cjs/model_utility.js +6 -0
- package/lib/cjs/model_utility.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/payload.js +3 -0
- package/lib/cjs/payload.js.map +1 -0
- package/lib/cjs/pending-asks.js +7 -0
- package/lib/cjs/pending-asks.js.map +1 -0
- package/lib/cjs/project.js +107 -0
- package/lib/cjs/project.js.map +1 -0
- package/lib/cjs/prompt.js +21 -0
- package/lib/cjs/prompt.js.map +1 -0
- package/lib/cjs/query.js +3 -0
- package/lib/cjs/query.js.map +1 -0
- package/lib/cjs/rate-limiter.js +6 -0
- package/lib/cjs/rate-limiter.js.map +1 -0
- package/lib/cjs/refs.js +14 -0
- package/lib/cjs/refs.js.map +1 -0
- package/lib/cjs/runs.js +3 -0
- package/lib/cjs/runs.js.map +1 -0
- package/lib/cjs/skill.js +14 -0
- package/lib/cjs/skill.js.map +1 -0
- package/lib/cjs/store/activity-catalog.js +3 -0
- package/lib/cjs/store/activity-catalog.js.map +1 -0
- package/lib/cjs/store/collections.js +9 -0
- package/lib/cjs/store/collections.js.map +1 -0
- package/lib/cjs/store/common.js +3 -0
- package/lib/cjs/store/common.js.map +1 -0
- package/lib/cjs/store/conversation-state.js +3 -0
- package/lib/cjs/store/conversation-state.js.map +1 -0
- package/lib/cjs/store/doc-analyzer.js +3 -0
- package/lib/cjs/store/doc-analyzer.js.map +1 -0
- package/lib/cjs/store/dsl-workflow.js +5 -0
- package/lib/cjs/store/dsl-workflow.js.map +1 -0
- package/lib/cjs/store/index.js +30 -0
- package/lib/cjs/store/index.js.map +1 -0
- package/lib/cjs/store/object-types.js +98 -0
- package/lib/cjs/store/object-types.js.map +1 -0
- package/lib/cjs/store/schedule.js +32 -0
- package/lib/cjs/store/schedule.js.map +1 -0
- package/lib/cjs/store/signals.js +3 -0
- package/lib/cjs/store/signals.js.map +1 -0
- package/lib/cjs/store/store.js +166 -0
- package/lib/cjs/store/store.js.map +1 -0
- package/lib/cjs/store/temporalio.js +44 -0
- package/lib/cjs/store/temporalio.js.map +1 -0
- package/lib/cjs/store/worker.js +3 -0
- package/lib/cjs/store/worker.js.map +1 -0
- package/lib/cjs/store/workflow.js +241 -0
- package/lib/cjs/store/workflow.js.map +1 -0
- package/lib/cjs/sts-token-types.js +32 -0
- package/lib/cjs/sts-token-types.js.map +1 -0
- package/lib/cjs/tenant.js +3 -0
- package/lib/cjs/tenant.js.map +1 -0
- package/lib/cjs/tool-execution.js +6 -0
- package/lib/cjs/tool-execution.js.map +1 -0
- package/lib/cjs/training.js +14 -0
- package/lib/cjs/training.js.map +1 -0
- package/lib/cjs/transient-tokens.js +9 -0
- package/lib/cjs/transient-tokens.js.map +1 -0
- package/lib/cjs/user.js +25 -0
- package/lib/cjs/user.js.map +1 -0
- package/lib/cjs/utils/auth.js +15 -0
- package/lib/cjs/utils/auth.js.map +1 -0
- package/lib/cjs/utils/schemas.js +114 -0
- package/lib/cjs/utils/schemas.js.map +1 -0
- package/lib/cjs/utils/type-helpers.js +3 -0
- package/lib/cjs/utils/type-helpers.js.map +1 -0
- package/lib/cjs/versions.js +8 -0
- package/lib/cjs/versions.js.map +1 -0
- package/lib/cjs/workflow-analytics.js +52 -0
- package/lib/cjs/workflow-analytics.js.map +1 -0
- package/lib/esm/Progress.js +57 -0
- package/lib/esm/Progress.js.map +1 -0
- package/lib/esm/access-control.js +53 -0
- package/lib/esm/access-control.js.map +1 -0
- package/lib/esm/analytics.js +2 -0
- package/lib/esm/analytics.js.map +1 -0
- package/lib/esm/apikey.js +13 -0
- package/lib/esm/apikey.js.map +1 -0
- package/lib/esm/apps.js +32 -0
- package/lib/esm/apps.js.map +1 -0
- package/lib/esm/ask-user.js +7 -0
- package/lib/esm/ask-user.js.map +1 -0
- package/lib/esm/channels.js +57 -0
- package/lib/esm/channels.js.map +1 -0
- package/lib/esm/common.js +2 -0
- package/lib/esm/common.js.map +1 -0
- package/lib/esm/data-platform.js +124 -0
- package/lib/esm/data-platform.js.map +1 -0
- package/lib/esm/email.js +16 -0
- package/lib/esm/email.js.map +1 -0
- package/lib/esm/environment.js +41 -0
- package/lib/esm/environment.js.map +1 -0
- package/lib/esm/facets.js +2 -0
- package/lib/esm/facets.js.map +1 -0
- package/lib/esm/group.js +2 -0
- package/lib/esm/group.js.map +1 -0
- package/lib/esm/index.js +39 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/integrations.js +11 -0
- package/lib/esm/integrations.js.map +1 -0
- package/lib/esm/interaction.js +92 -0
- package/lib/esm/interaction.js.map +1 -0
- package/lib/esm/json-schema.js +2 -0
- package/lib/esm/json-schema.js.map +1 -0
- package/lib/esm/json.js +2 -0
- package/lib/esm/json.js.map +1 -0
- package/lib/esm/meters.js +10 -0
- package/lib/esm/meters.js.map +1 -0
- package/lib/esm/model_utility.js +2 -0
- package/lib/esm/model_utility.js.map +1 -0
- package/lib/esm/payload.js +2 -0
- package/lib/esm/payload.js.map +1 -0
- package/lib/esm/pending-asks.js +6 -0
- package/lib/esm/pending-asks.js.map +1 -0
- package/lib/esm/project.js +102 -0
- package/lib/esm/project.js.map +1 -0
- package/lib/esm/prompt.js +18 -0
- package/lib/esm/prompt.js.map +1 -0
- package/lib/esm/query.js +2 -0
- package/lib/esm/query.js.map +1 -0
- package/lib/esm/rate-limiter.js +5 -0
- package/lib/esm/rate-limiter.js.map +1 -0
- package/lib/esm/refs.js +11 -0
- package/lib/esm/refs.js.map +1 -0
- package/lib/esm/runs.js +2 -0
- package/lib/esm/runs.js.map +1 -0
- package/lib/esm/skill.js +13 -0
- package/lib/esm/skill.js.map +1 -0
- package/lib/esm/store/activity-catalog.js +2 -0
- package/lib/esm/store/activity-catalog.js.map +1 -0
- package/lib/esm/store/collections.js +6 -0
- package/lib/esm/store/collections.js.map +1 -0
- package/lib/esm/store/common.js +2 -0
- package/lib/esm/store/common.js.map +1 -0
- package/lib/esm/store/conversation-state.js +2 -0
- package/lib/esm/store/conversation-state.js.map +1 -0
- package/lib/esm/store/doc-analyzer.js +2 -0
- package/lib/esm/store/doc-analyzer.js.map +1 -0
- package/lib/esm/store/dsl-workflow.js +2 -0
- package/lib/esm/store/dsl-workflow.js.map +1 -0
- package/lib/esm/store/index.js +14 -0
- package/lib/esm/store/index.js.map +1 -0
- package/lib/esm/store/object-types.js +95 -0
- package/lib/esm/store/object-types.js.map +1 -0
- package/lib/esm/store/schedule.js +29 -0
- package/lib/esm/store/schedule.js.map +1 -0
- package/lib/esm/store/signals.js +2 -0
- package/lib/esm/store/signals.js.map +1 -0
- package/lib/esm/store/store.js +160 -0
- package/lib/esm/store/store.js.map +1 -0
- package/lib/esm/store/temporalio.js +41 -0
- package/lib/esm/store/temporalio.js.map +1 -0
- package/lib/esm/store/worker.js +2 -0
- package/lib/esm/store/worker.js.map +1 -0
- package/lib/esm/store/workflow.js +228 -0
- package/lib/esm/store/workflow.js.map +1 -0
- package/lib/esm/sts-token-types.js +24 -0
- package/lib/esm/sts-token-types.js.map +1 -0
- package/lib/esm/tenant.js +2 -0
- package/lib/esm/tenant.js.map +1 -0
- package/lib/esm/tool-execution.js +5 -0
- package/lib/esm/tool-execution.js.map +1 -0
- package/lib/esm/training.js +11 -0
- package/lib/esm/training.js.map +1 -0
- package/lib/esm/transient-tokens.js +6 -0
- package/lib/esm/transient-tokens.js.map +1 -0
- package/lib/esm/user.js +22 -0
- package/lib/esm/user.js.map +1 -0
- package/lib/esm/utils/auth.js +11 -0
- package/lib/esm/utils/auth.js.map +1 -0
- package/lib/esm/utils/schemas.js +107 -0
- package/lib/esm/utils/schemas.js.map +1 -0
- package/lib/esm/utils/type-helpers.js +2 -0
- package/lib/esm/utils/type-helpers.js.map +1 -0
- package/lib/esm/versions.js +5 -0
- package/lib/esm/versions.js.map +1 -0
- package/lib/esm/workflow-analytics.js +49 -0
- package/lib/esm/workflow-analytics.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/Progress.d.ts +21 -0
- package/lib/types/Progress.d.ts.map +1 -0
- package/lib/types/access-control.d.ts +73 -0
- package/lib/types/access-control.d.ts.map +1 -0
- package/lib/types/analytics.d.ts +87 -0
- package/lib/types/analytics.d.ts.map +1 -0
- package/lib/types/apikey.d.ts +98 -0
- package/lib/types/apikey.d.ts.map +1 -0
- package/lib/types/apps.d.ts +236 -0
- package/lib/types/apps.d.ts.map +1 -0
- package/lib/types/ask-user.d.ts +32 -0
- package/lib/types/ask-user.d.ts.map +1 -0
- package/lib/types/channels.d.ts +21 -0
- package/lib/types/channels.d.ts.map +1 -0
- package/lib/types/common.d.ts +31 -0
- package/lib/types/common.d.ts.map +1 -0
- package/lib/types/data-platform.d.ts +860 -0
- package/lib/types/data-platform.d.ts.map +1 -0
- package/lib/types/email.d.ts +66 -0
- package/lib/types/email.d.ts.map +1 -0
- package/lib/types/environment.d.ts +106 -0
- package/lib/types/environment.d.ts.map +1 -0
- package/lib/types/facets.d.ts +34 -0
- package/lib/types/facets.d.ts.map +1 -0
- package/lib/types/group.d.ts +21 -0
- package/lib/types/group.d.ts.map +1 -0
- package/lib/types/index.d.ts +39 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/integrations.d.ts +60 -0
- package/lib/types/integrations.d.ts.map +1 -0
- package/lib/types/interaction.d.ts +958 -0
- package/lib/types/interaction.d.ts.map +1 -0
- package/lib/types/json-schema.d.ts +1 -0
- package/lib/types/json-schema.d.ts.map +1 -0
- package/lib/types/json.d.ts +1 -0
- package/lib/types/json.d.ts.map +1 -0
- package/lib/types/meters.d.ts +23 -0
- package/lib/types/meters.d.ts.map +1 -0
- package/lib/types/model_utility.d.ts +1 -0
- package/lib/types/model_utility.d.ts.map +1 -0
- package/lib/types/payload.d.ts +60 -0
- package/lib/types/payload.d.ts.map +1 -0
- package/lib/types/pending-asks.d.ts +93 -0
- package/lib/types/pending-asks.d.ts.map +1 -0
- package/lib/types/project.d.ts +179 -0
- package/lib/types/project.d.ts.map +1 -0
- package/lib/types/prompt.d.ts +78 -0
- package/lib/types/prompt.d.ts.map +1 -0
- package/lib/types/query.d.ts +118 -0
- package/lib/types/query.d.ts.map +1 -0
- package/lib/types/rate-limiter.d.ts +28 -0
- package/lib/types/rate-limiter.d.ts.map +1 -0
- package/lib/types/refs.d.ts +22 -0
- package/lib/types/refs.d.ts.map +1 -0
- package/lib/types/runs.d.ts +32 -0
- package/lib/types/runs.d.ts.map +1 -0
- package/lib/types/skill.d.ts +78 -0
- package/lib/types/skill.d.ts.map +1 -0
- package/lib/types/store/activity-catalog.d.ts +26 -0
- package/lib/types/store/activity-catalog.d.ts.map +1 -0
- package/lib/types/store/collections.d.ts +78 -0
- package/lib/types/store/collections.d.ts.map +1 -0
- package/lib/types/store/common.d.ts +22 -0
- package/lib/types/store/common.d.ts.map +1 -0
- package/lib/types/store/conversation-state.d.ts +120 -0
- package/lib/types/store/conversation-state.d.ts.map +1 -0
- package/lib/types/store/doc-analyzer.d.ts +140 -0
- package/lib/types/store/doc-analyzer.d.ts.map +1 -0
- package/lib/types/store/dsl-workflow.d.ts +244 -0
- package/lib/types/store/dsl-workflow.d.ts.map +1 -0
- package/lib/types/store/index.d.ts +13 -0
- package/lib/types/store/index.d.ts.map +1 -0
- package/lib/types/store/object-types.d.ts +23 -0
- package/lib/types/store/object-types.d.ts.map +1 -0
- package/lib/types/store/schedule.d.ts +182 -0
- package/lib/types/store/schedule.d.ts.map +1 -0
- package/lib/types/store/signals.d.ts +24 -0
- package/lib/types/store/signals.d.ts.map +1 -0
- package/lib/types/store/store.d.ts +407 -0
- package/lib/types/store/store.d.ts.map +1 -0
- package/lib/types/store/temporalio.d.ts +16 -0
- package/lib/types/store/temporalio.d.ts.map +1 -0
- package/lib/types/store/worker.d.ts +18 -0
- package/lib/types/store/worker.d.ts.map +1 -0
- package/lib/types/store/workflow.d.ts +730 -0
- package/lib/types/store/workflow.d.ts.map +1 -0
- package/lib/types/sts-token-types.d.ts +72 -0
- package/lib/types/sts-token-types.d.ts.map +1 -0
- package/lib/types/tenant.d.ts +10 -0
- package/lib/types/tenant.d.ts.map +1 -0
- package/lib/types/tool-execution.d.ts +45 -0
- package/lib/types/tool-execution.d.ts.map +1 -0
- package/lib/types/training.d.ts +38 -0
- package/lib/types/training.d.ts.map +1 -0
- package/lib/types/transient-tokens.d.ts +24 -0
- package/lib/types/transient-tokens.d.ts.map +1 -0
- package/lib/types/user.d.ts +116 -0
- package/lib/types/user.d.ts.map +1 -0
- package/lib/types/utils/auth.d.ts +3 -0
- package/lib/types/utils/auth.d.ts.map +1 -0
- package/lib/types/utils/schemas.d.ts +9 -0
- package/lib/types/utils/schemas.d.ts.map +1 -0
- package/lib/types/utils/type-helpers.d.ts +3 -0
- package/lib/types/utils/type-helpers.d.ts.map +1 -0
- package/lib/types/versions.d.ts +3 -0
- package/lib/types/versions.d.ts.map +1 -0
- package/lib/types/workflow-analytics.d.ts +777 -0
- package/lib/types/workflow-analytics.d.ts.map +1 -0
- package/lib/vertesia-common.js +2 -0
- package/lib/vertesia-common.js.map +1 -0
- package/package.json +54 -0
- package/src/Progress.ts +57 -0
- package/src/access-control.ts +98 -0
- package/src/analytics.ts +106 -0
- package/src/apikey.ts +116 -0
- package/src/apps.ts +296 -0
- package/src/ask-user.ts +35 -0
- package/src/channels.ts +70 -0
- package/src/common.ts +37 -0
- package/src/data-platform.ts +976 -0
- package/src/email.ts +80 -0
- package/src/environment.ts +137 -0
- package/src/facets.ts +44 -0
- package/src/group.ts +26 -0
- package/src/index.ts +40 -0
- package/src/integrations.ts +72 -0
- package/src/interaction.ts +1182 -0
- package/src/json-schema.ts +7 -0
- package/src/json.ts +4 -0
- package/src/meters.ts +30 -0
- package/src/model_utility.ts +1 -0
- package/src/payload.ts +83 -0
- package/src/pending-asks.ts +106 -0
- package/src/project.ts +263 -0
- package/src/prompt.ts +103 -0
- package/src/query.ts +137 -0
- package/src/rate-limiter.ts +34 -0
- package/src/refs.ts +30 -0
- package/src/runs.ts +36 -0
- package/src/skill.ts +90 -0
- package/src/store/activity-catalog.ts +44 -0
- package/src/store/collections.ts +87 -0
- package/src/store/common.ts +30 -0
- package/src/store/conversation-state.ts +146 -0
- package/src/store/doc-analyzer.ts +161 -0
- package/src/store/dsl-workflow.ts +288 -0
- package/src/store/index.ts +14 -0
- package/src/store/ms.d.ts +11 -0
- package/src/store/object-types.ts +127 -0
- package/src/store/schedule.ts +238 -0
- package/src/store/signals.ts +25 -0
- package/src/store/store.ts +579 -0
- package/src/store/temporalio.ts +54 -0
- package/src/store/worker.ts +19 -0
- package/src/store/workflow.test.ts +578 -0
- package/src/store/workflow.ts +973 -0
- package/src/sts-token-types.ts +117 -0
- package/src/tenant.ts +10 -0
- package/src/tool-execution.ts +47 -0
- package/src/training.ts +44 -0
- package/src/transient-tokens.ts +30 -0
- package/src/user.ts +153 -0
- package/src/utils/auth.ts +12 -0
- package/src/utils/schemas.ts +108 -0
- package/src/utils/type-helpers.ts +6 -0
- package/src/versions.ts +3 -0
- package/src/workflow-analytics.ts +925 -0
- package/tsconfig.dist.json +20 -0
|
@@ -0,0 +1,730 @@
|
|
|
1
|
+
import { JSONSchema4 } from "json-schema";
|
|
2
|
+
import { ConversationVisibility, InteractionRef, UserChannel } from "../interaction.js";
|
|
3
|
+
export declare enum ContentEventName {
|
|
4
|
+
create = "create",
|
|
5
|
+
change_type = "change_type",
|
|
6
|
+
update = "update",
|
|
7
|
+
revision_created = "revision_created",
|
|
8
|
+
delete = "delete",
|
|
9
|
+
workflow_finished = "workflow_finished",
|
|
10
|
+
workflow_execution_request = "workflow_execution_request",
|
|
11
|
+
api_request = "api_request"
|
|
12
|
+
}
|
|
13
|
+
export interface Queue {
|
|
14
|
+
name: string;
|
|
15
|
+
queue_suffix?: string;
|
|
16
|
+
queue_full_name?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface WorkflowAncestor {
|
|
19
|
+
run_id: string;
|
|
20
|
+
workflow_id: string;
|
|
21
|
+
/**
|
|
22
|
+
* the depth of nested parent workflows
|
|
23
|
+
*/
|
|
24
|
+
run_depth: number;
|
|
25
|
+
}
|
|
26
|
+
export interface WorkflowExecutionBaseParams<T = Record<string, any>> {
|
|
27
|
+
/**
|
|
28
|
+
* The ref of the user who initiated the workflow.
|
|
29
|
+
*/
|
|
30
|
+
initiated_by?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The account ID of the user who created the activity.
|
|
33
|
+
* This is useful to select the right database to work on.
|
|
34
|
+
*/
|
|
35
|
+
account_id: string;
|
|
36
|
+
/**
|
|
37
|
+
* The project ID of the account who created the activity.
|
|
38
|
+
*/
|
|
39
|
+
project_id: string;
|
|
40
|
+
/**
|
|
41
|
+
* The vars field is mainly used to pass the user input to the workflow.
|
|
42
|
+
* The user input ar custom user options that can be used to configure the workflow.
|
|
43
|
+
* You can see the user input as the arguments for a command line app.
|
|
44
|
+
*
|
|
45
|
+
* In the case of workflows started by events (e.g. using a a workflow rule) the user input vars will be initialized with the workflow rule configuration field.
|
|
46
|
+
*
|
|
47
|
+
* In case of dsl workflows the workflow execution payload vars will be applied over the default vars values stored in the DSL vars field.
|
|
48
|
+
*/
|
|
49
|
+
vars: T;
|
|
50
|
+
/**
|
|
51
|
+
* Auth Token to access Zeno and Composable from the workers
|
|
52
|
+
*/
|
|
53
|
+
auth_token?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The configuration for the workflow execution.
|
|
56
|
+
*/
|
|
57
|
+
config?: {
|
|
58
|
+
studio_url: string;
|
|
59
|
+
store_url: string;
|
|
60
|
+
slack_app_url?: string;
|
|
61
|
+
enabled_integrations?: string[];
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* The list of endpoints to notify when the workflow finishes.
|
|
65
|
+
* It is handled by a sub-workflow execution, so the main workflow will not wait for the notification to be sent.
|
|
66
|
+
*/
|
|
67
|
+
notify_endpoints?: (string | WebHookSpec)[];
|
|
68
|
+
/** If this is a child workflow, parent contains parent's ids */
|
|
69
|
+
parent?: WorkflowAncestor;
|
|
70
|
+
/**
|
|
71
|
+
* Full ancestry chain from root to immediate parent (for hierarchical aggregation)
|
|
72
|
+
*/
|
|
73
|
+
ancestors?: WorkflowAncestor[];
|
|
74
|
+
/**
|
|
75
|
+
* If true, copy workspace artifacts (scripts/, files/, skills/, docs/, out/)
|
|
76
|
+
* from parent workflow to this workflow on startup.
|
|
77
|
+
* Defaults to true when spawning child workflows.
|
|
78
|
+
* conversation.json and tools.json are never copied.
|
|
79
|
+
*/
|
|
80
|
+
inherit_artifacts?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* List of enabled processing queues. Managed by the application.
|
|
83
|
+
*/
|
|
84
|
+
_enabled_queues?: Queue[];
|
|
85
|
+
}
|
|
86
|
+
export interface WebHookSpec {
|
|
87
|
+
/**
|
|
88
|
+
* The webhook URL to call using POST method
|
|
89
|
+
*/
|
|
90
|
+
url: string;
|
|
91
|
+
/**
|
|
92
|
+
* the API version to use if any
|
|
93
|
+
*/
|
|
94
|
+
version?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Custom headers to include in the webhook request
|
|
97
|
+
*/
|
|
98
|
+
headers?: Record<string, string>;
|
|
99
|
+
/**
|
|
100
|
+
* Additional custom data to include in the webhook body.
|
|
101
|
+
* When custom data is provided, the workflow result will always be nested
|
|
102
|
+
* to prevent field collisions. Use result_path to control where it's nested.
|
|
103
|
+
*/
|
|
104
|
+
data?: Record<string, any>;
|
|
105
|
+
/**
|
|
106
|
+
* Path where the workflow result should be nested in the webhook body.
|
|
107
|
+
* Defaults to "result" when custom data is provided.
|
|
108
|
+
*
|
|
109
|
+
* Example: With result_path="workflow_result" and data={customer_id: "123"}:
|
|
110
|
+
* {
|
|
111
|
+
* "workflow_result": { ...workflow result... },
|
|
112
|
+
* "customer_id": "123"
|
|
113
|
+
* }
|
|
114
|
+
*
|
|
115
|
+
* Example: With data={customer_id: "123"} but no result_path (uses default):
|
|
116
|
+
* {
|
|
117
|
+
* "result": { ...workflow result... },
|
|
118
|
+
* "customer_id": "123"
|
|
119
|
+
* }
|
|
120
|
+
*/
|
|
121
|
+
result_path?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface WorkflowExecutionPayload<T = Record<string, any>> extends WorkflowExecutionBaseParams<T> {
|
|
124
|
+
/**
|
|
125
|
+
* The event which started the workflow who created the activity.
|
|
126
|
+
*/
|
|
127
|
+
event: ContentEventName;
|
|
128
|
+
wf_rule_name?: string;
|
|
129
|
+
/**
|
|
130
|
+
* The ID of the target objects processed by the workflow.
|
|
131
|
+
*/
|
|
132
|
+
objectIds: string[];
|
|
133
|
+
/**
|
|
134
|
+
* Auth Token to access Zeno and Composable from the workers
|
|
135
|
+
*/
|
|
136
|
+
auth_token: string;
|
|
137
|
+
}
|
|
138
|
+
export declare function getDocumentIds(payload: WorkflowExecutionPayload): string[];
|
|
139
|
+
export interface ExecuteWorkflowPayload {
|
|
140
|
+
/**
|
|
141
|
+
* The task queue to assign the workflow to. Deprecated, queues are choosend server side
|
|
142
|
+
*/
|
|
143
|
+
task_queue?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Docuument IDs pon which the workflow will be executed, deprecated, replaced params in vars
|
|
146
|
+
*/
|
|
147
|
+
objectIds?: string[];
|
|
148
|
+
/**
|
|
149
|
+
* Parameters to pass to the workflow
|
|
150
|
+
*/
|
|
151
|
+
vars?: Record<string, any>;
|
|
152
|
+
/**
|
|
153
|
+
* Make the workflow ID unique by always adding a random token to the ID.
|
|
154
|
+
*/
|
|
155
|
+
unique?: boolean;
|
|
156
|
+
/**
|
|
157
|
+
* A custom ID to use for the workflow execution id instead of the generated one.
|
|
158
|
+
*/
|
|
159
|
+
custom_id?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Timeout for the workflow execution to complete, in seconds.
|
|
162
|
+
*/
|
|
163
|
+
timeout?: number;
|
|
164
|
+
}
|
|
165
|
+
export interface ListWorkflowRunsPayload {
|
|
166
|
+
/**
|
|
167
|
+
* The document ID passed to a workflow run.
|
|
168
|
+
*/
|
|
169
|
+
document_id?: string;
|
|
170
|
+
/**
|
|
171
|
+
* The event name that triggered the workflow.
|
|
172
|
+
*/
|
|
173
|
+
event_name?: string;
|
|
174
|
+
/**
|
|
175
|
+
* The workflow rule ID that triggered the workflow.
|
|
176
|
+
*/
|
|
177
|
+
rule_id?: string;
|
|
178
|
+
/**
|
|
179
|
+
* The start time for filtering workflow runs.
|
|
180
|
+
*/
|
|
181
|
+
start?: string;
|
|
182
|
+
/**
|
|
183
|
+
* The end time for filtering workflow runs.
|
|
184
|
+
*/
|
|
185
|
+
end?: string;
|
|
186
|
+
/**
|
|
187
|
+
* The status of the workflow run.
|
|
188
|
+
*/
|
|
189
|
+
status?: string;
|
|
190
|
+
/**
|
|
191
|
+
* search term to filter on workflow id and run id
|
|
192
|
+
*/
|
|
193
|
+
search_term?: string;
|
|
194
|
+
/**
|
|
195
|
+
* The user or service account that initiated the workflow run.
|
|
196
|
+
*/
|
|
197
|
+
initiated_by?: string;
|
|
198
|
+
/**
|
|
199
|
+
* The interaction name used to filter conversations.
|
|
200
|
+
*/
|
|
201
|
+
interaction?: string;
|
|
202
|
+
/**
|
|
203
|
+
* Lucene query string to search for the workflow runs.
|
|
204
|
+
* This is a full text search on the workflow run history.
|
|
205
|
+
*/
|
|
206
|
+
query?: string;
|
|
207
|
+
type?: string;
|
|
208
|
+
/**
|
|
209
|
+
* The maximum number of results to return per page.
|
|
210
|
+
*/
|
|
211
|
+
page_size?: number;
|
|
212
|
+
/**
|
|
213
|
+
* The page token for Temporal pagination.
|
|
214
|
+
*/
|
|
215
|
+
next_page_token?: string;
|
|
216
|
+
}
|
|
217
|
+
interface WorkflowRunEvent {
|
|
218
|
+
event_id: number;
|
|
219
|
+
event_time: number;
|
|
220
|
+
event_type: string;
|
|
221
|
+
task_id?: string;
|
|
222
|
+
attempt: number;
|
|
223
|
+
activity?: {
|
|
224
|
+
name?: string;
|
|
225
|
+
id?: string;
|
|
226
|
+
input?: any;
|
|
227
|
+
scheduledEventId?: string;
|
|
228
|
+
startedEventId?: string;
|
|
229
|
+
};
|
|
230
|
+
childWorkflow?: {
|
|
231
|
+
workflowId?: string;
|
|
232
|
+
workflowType?: string;
|
|
233
|
+
runId?: string;
|
|
234
|
+
scheduledEventId?: string;
|
|
235
|
+
startedEventId?: string;
|
|
236
|
+
input?: any;
|
|
237
|
+
result?: any;
|
|
238
|
+
};
|
|
239
|
+
signal?: {
|
|
240
|
+
direction: "receiving" | "sending";
|
|
241
|
+
signalName?: string;
|
|
242
|
+
input?: any;
|
|
243
|
+
sender?: {
|
|
244
|
+
workflowId?: string;
|
|
245
|
+
runId?: string;
|
|
246
|
+
};
|
|
247
|
+
recipient?: {
|
|
248
|
+
workflowId?: string;
|
|
249
|
+
runId?: string;
|
|
250
|
+
};
|
|
251
|
+
initiatedEventId?: string;
|
|
252
|
+
};
|
|
253
|
+
error?: {
|
|
254
|
+
message?: string;
|
|
255
|
+
source?: string;
|
|
256
|
+
stacktrace?: string;
|
|
257
|
+
type?: string;
|
|
258
|
+
};
|
|
259
|
+
result?: any;
|
|
260
|
+
}
|
|
261
|
+
export interface WorkflowRun {
|
|
262
|
+
status?: WorkflowExecutionStatus | string;
|
|
263
|
+
/**
|
|
264
|
+
* The Temporal Workflow Type of this Workflow Run.
|
|
265
|
+
*
|
|
266
|
+
* @see https://docs.temporal.io/workflows
|
|
267
|
+
*/
|
|
268
|
+
type?: string;
|
|
269
|
+
started_at?: number;
|
|
270
|
+
closed_at?: number;
|
|
271
|
+
execution_duration?: number;
|
|
272
|
+
run_id?: string;
|
|
273
|
+
workflow_id?: string;
|
|
274
|
+
initiated_by?: string;
|
|
275
|
+
interaction_name?: string;
|
|
276
|
+
input?: any;
|
|
277
|
+
result?: any;
|
|
278
|
+
error?: any;
|
|
279
|
+
raw?: any;
|
|
280
|
+
/**
|
|
281
|
+
* The Vertesia Workflow Type of this Workflow Run.
|
|
282
|
+
* - For DSL workflows (`type:dslWorkflow`), the vertesia_type refers to the "Workflow Rule Name" specified in the
|
|
283
|
+
* DSL. For example, "Standard Document Intake" or "Standard Image Intake".
|
|
284
|
+
* - For non-DSL workflows, the vertesia_type is the name of the Temporal Workflow Type.
|
|
285
|
+
*/
|
|
286
|
+
vertesia_workflow_type?: string;
|
|
287
|
+
/**
|
|
288
|
+
* An interaction is used to start the agent, the data is stored on temporal "vars"
|
|
289
|
+
*/
|
|
290
|
+
interactions?: InteractionRef[];
|
|
291
|
+
/**
|
|
292
|
+
* The visibility of the workflow run.
|
|
293
|
+
* - 'private': Only visible to the user who initiated the workflow
|
|
294
|
+
* - 'project': Visible to all users in the project
|
|
295
|
+
*/
|
|
296
|
+
visibility?: ConversationVisibility;
|
|
297
|
+
/**
|
|
298
|
+
* A brief summary of the conversation workflow.
|
|
299
|
+
*/
|
|
300
|
+
topic?: string;
|
|
301
|
+
}
|
|
302
|
+
export interface WorkflowRunWithDetails extends WorkflowRun {
|
|
303
|
+
history?: WorkflowRunEvent[];
|
|
304
|
+
memo?: {
|
|
305
|
+
[key: string]: any;
|
|
306
|
+
} | null;
|
|
307
|
+
pendingActivities?: {
|
|
308
|
+
activityId?: string;
|
|
309
|
+
activityType?: string;
|
|
310
|
+
attempt: number;
|
|
311
|
+
maximumAttempts: number;
|
|
312
|
+
lastFailure?: string;
|
|
313
|
+
lastStartedTime?: number;
|
|
314
|
+
}[];
|
|
315
|
+
}
|
|
316
|
+
export interface ListWorkflowRunsResponse {
|
|
317
|
+
runs: WorkflowRun[];
|
|
318
|
+
next_page_token?: string;
|
|
319
|
+
has_more?: boolean;
|
|
320
|
+
}
|
|
321
|
+
export interface ListWorkflowInteractionsResponse {
|
|
322
|
+
workflow_id: string;
|
|
323
|
+
run_id: string;
|
|
324
|
+
interaction: WorkflowInteractionVars;
|
|
325
|
+
}
|
|
326
|
+
export interface WorkflowInteractionVars {
|
|
327
|
+
type: string;
|
|
328
|
+
interaction: string;
|
|
329
|
+
interactive: boolean;
|
|
330
|
+
debug_mode?: boolean;
|
|
331
|
+
/**
|
|
332
|
+
* Array of channels to use for user communication.
|
|
333
|
+
* Multiple channels can be active simultaneously.
|
|
334
|
+
*/
|
|
335
|
+
user_channels?: UserChannel[];
|
|
336
|
+
data?: Record<string, any>;
|
|
337
|
+
tool_names: string[];
|
|
338
|
+
config: {
|
|
339
|
+
environment: string;
|
|
340
|
+
model: string;
|
|
341
|
+
};
|
|
342
|
+
interactionParamsSchema?: JSONSchema4;
|
|
343
|
+
collection_id?: string;
|
|
344
|
+
/**
|
|
345
|
+
* Optional version of the interaction to use when restoring conversations.
|
|
346
|
+
* If not specified, the latest version will be used.
|
|
347
|
+
*/
|
|
348
|
+
version?: number;
|
|
349
|
+
}
|
|
350
|
+
export interface MultiDocumentsInteractionParams extends Omit<WorkflowExecutionPayload, "config"> {
|
|
351
|
+
config: {
|
|
352
|
+
interactionName: string;
|
|
353
|
+
action: DocumentActionConfig;
|
|
354
|
+
data: Record<string, any>;
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
export interface DocumentActionConfig {
|
|
358
|
+
contentTypeName?: string;
|
|
359
|
+
setAsProperties: boolean;
|
|
360
|
+
setAsText: string;
|
|
361
|
+
setNameFrom: string;
|
|
362
|
+
upsert: boolean;
|
|
363
|
+
documentId?: string;
|
|
364
|
+
parentId?: string;
|
|
365
|
+
}
|
|
366
|
+
export declare enum WorkflowExecutionStatus {
|
|
367
|
+
UNKNOWN = 0,
|
|
368
|
+
RUNNING = 1,
|
|
369
|
+
COMPLETED = 2,
|
|
370
|
+
FAILED = 3,
|
|
371
|
+
CANCELED = 4,
|
|
372
|
+
TERMINATED = 5,
|
|
373
|
+
CONTINUED_AS_NEW = 6,
|
|
374
|
+
TIMED_OUT = 7
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Basic response for anything run with an async workflow
|
|
378
|
+
*/
|
|
379
|
+
export interface WorkflowRunStatus {
|
|
380
|
+
workflow_id: string | null;
|
|
381
|
+
workflow_run_id: string | null;
|
|
382
|
+
status: WorkflowExecutionStatus;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Workflow Update Message
|
|
386
|
+
*/
|
|
387
|
+
export interface AgentMessage {
|
|
388
|
+
timestamp: number;
|
|
389
|
+
workflow_run_id: string;
|
|
390
|
+
type: AgentMessageType;
|
|
391
|
+
message: string;
|
|
392
|
+
details?: any;
|
|
393
|
+
workstream_id?: string;
|
|
394
|
+
}
|
|
395
|
+
export declare enum AgentMessageType {
|
|
396
|
+
SYSTEM = 0,
|
|
397
|
+
THOUGHT = 1,
|
|
398
|
+
PLAN = 2,
|
|
399
|
+
UPDATE = 3,
|
|
400
|
+
COMPLETE = 4,
|
|
401
|
+
WARNING = 5,
|
|
402
|
+
ERROR = 6,
|
|
403
|
+
ANSWER = 7,
|
|
404
|
+
QUESTION = 8,
|
|
405
|
+
REQUEST_INPUT = 9,
|
|
406
|
+
IDLE = 10,
|
|
407
|
+
TERMINATED = 11,
|
|
408
|
+
STREAMING_CHUNK = 12,
|
|
409
|
+
BATCH_PROGRESS = 13
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* Details for STREAMING_CHUNK messages used for real-time LLM response streaming
|
|
413
|
+
* @deprecated Use CompactMessage with f field for streaming chunks
|
|
414
|
+
*/
|
|
415
|
+
export interface StreamingChunkDetails {
|
|
416
|
+
/** Unique identifier grouping chunks from the same stream */
|
|
417
|
+
streaming_id: string;
|
|
418
|
+
/** Order of this chunk within the stream (0-indexed) */
|
|
419
|
+
chunk_index: number;
|
|
420
|
+
/** True if this is the final chunk of the stream */
|
|
421
|
+
is_final: boolean;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Compact message format for efficient wire transfer.
|
|
425
|
+
* Primary type used throughout the system.
|
|
426
|
+
* ~85% smaller than legacy AgentMessage format.
|
|
427
|
+
*/
|
|
428
|
+
export interface CompactMessage {
|
|
429
|
+
/** Message type (integer enum) */
|
|
430
|
+
t: AgentMessageType;
|
|
431
|
+
/** Message content */
|
|
432
|
+
m?: string;
|
|
433
|
+
/** Workstream ID (only when not "main") */
|
|
434
|
+
w?: string;
|
|
435
|
+
/** Type-specific details */
|
|
436
|
+
d?: unknown;
|
|
437
|
+
/** Is final chunk (only for STREAMING_CHUNK, 0 or 1) */
|
|
438
|
+
f?: 0 | 1;
|
|
439
|
+
/** Timestamp (only for stored/persisted messages) */
|
|
440
|
+
ts?: number;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Legacy message format for backward compatibility.
|
|
444
|
+
* @deprecated Use CompactMessage instead
|
|
445
|
+
*/
|
|
446
|
+
export type LegacyAgentMessage = AgentMessage;
|
|
447
|
+
/**
|
|
448
|
+
* Check if a message is in compact format
|
|
449
|
+
*/
|
|
450
|
+
export declare function isCompactMessage(msg: unknown): msg is CompactMessage;
|
|
451
|
+
/**
|
|
452
|
+
* Check if a message is in legacy format
|
|
453
|
+
*/
|
|
454
|
+
export declare function isLegacyMessage(msg: unknown): msg is LegacyAgentMessage;
|
|
455
|
+
/**
|
|
456
|
+
* Normalize message type from string or number to AgentMessageType
|
|
457
|
+
*/
|
|
458
|
+
export declare function normalizeMessageType(type: string | number | AgentMessageType): AgentMessageType;
|
|
459
|
+
/**
|
|
460
|
+
* Convert legacy AgentMessage to CompactMessage
|
|
461
|
+
*/
|
|
462
|
+
export declare function toCompactMessage(legacy: LegacyAgentMessage): CompactMessage;
|
|
463
|
+
/**
|
|
464
|
+
* Parse any message format (compact or legacy) into CompactMessage.
|
|
465
|
+
* Use this as the entry point for all received messages.
|
|
466
|
+
*/
|
|
467
|
+
export declare function parseMessage(data: string | object): CompactMessage;
|
|
468
|
+
/**
|
|
469
|
+
* Create a compact message (convenience function for server-side)
|
|
470
|
+
*/
|
|
471
|
+
export declare function createCompactMessage(type: AgentMessageType, options?: {
|
|
472
|
+
message?: string;
|
|
473
|
+
workstreamId?: string;
|
|
474
|
+
details?: unknown;
|
|
475
|
+
isFinal?: boolean;
|
|
476
|
+
timestamp?: number;
|
|
477
|
+
}): CompactMessage;
|
|
478
|
+
/**
|
|
479
|
+
* Convert CompactMessage back to AgentMessage (for UI components).
|
|
480
|
+
* This allows UI to continue using familiar field names while wire format is compact.
|
|
481
|
+
* @param compact The compact message to convert
|
|
482
|
+
* @param workflowRunId Optional workflow_run_id (known from SSE context, not in compact format)
|
|
483
|
+
*/
|
|
484
|
+
export declare function toAgentMessage(compact: CompactMessage, workflowRunId?: string): AgentMessage;
|
|
485
|
+
/**
|
|
486
|
+
* Status of a single item in a batch execution
|
|
487
|
+
*/
|
|
488
|
+
export interface BatchItemStatus {
|
|
489
|
+
/** Unique identifier for this batch item */
|
|
490
|
+
id: string;
|
|
491
|
+
/** Current status of the item */
|
|
492
|
+
status: "pending" | "running" | "success" | "error";
|
|
493
|
+
/** Optional message (e.g., error message or result summary) */
|
|
494
|
+
message?: string;
|
|
495
|
+
/** Execution duration in milliseconds (when completed) */
|
|
496
|
+
duration_ms?: number;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Details for BATCH_PROGRESS messages used for batch tool execution progress
|
|
500
|
+
*/
|
|
501
|
+
export interface BatchProgressDetails {
|
|
502
|
+
/** Unique identifier for this batch execution */
|
|
503
|
+
batch_id: string;
|
|
504
|
+
/** Name of the tool being batch executed */
|
|
505
|
+
tool_name: string;
|
|
506
|
+
/** Total number of items in the batch */
|
|
507
|
+
total: number;
|
|
508
|
+
/** Number of items completed */
|
|
509
|
+
completed: number;
|
|
510
|
+
/** Number of items that succeeded */
|
|
511
|
+
succeeded: number;
|
|
512
|
+
/** Number of items that failed */
|
|
513
|
+
failed: number;
|
|
514
|
+
/** Status of individual items */
|
|
515
|
+
items: BatchItemStatus[];
|
|
516
|
+
/** Timestamp when batch started */
|
|
517
|
+
started_at: number;
|
|
518
|
+
/** Timestamp when batch completed (if done) */
|
|
519
|
+
completed_at?: number;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Status of a file being processed for conversation use.
|
|
523
|
+
*/
|
|
524
|
+
export declare enum FileProcessingStatus {
|
|
525
|
+
/** File is being uploaded to artifact storage */
|
|
526
|
+
UPLOADING = "uploading",
|
|
527
|
+
/** File uploaded, text extraction in progress */
|
|
528
|
+
PROCESSING = "processing",
|
|
529
|
+
/** File is ready for use in conversation */
|
|
530
|
+
READY = "ready",
|
|
531
|
+
/** File processing failed */
|
|
532
|
+
ERROR = "error"
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Represents a file being processed in a conversation workflow.
|
|
536
|
+
*/
|
|
537
|
+
export interface ConversationFile {
|
|
538
|
+
/** Unique ID for tracking this file (generated client-side) */
|
|
539
|
+
id: string;
|
|
540
|
+
/** Original filename */
|
|
541
|
+
name: string;
|
|
542
|
+
/** MIME type */
|
|
543
|
+
content_type: string;
|
|
544
|
+
/** Size in bytes */
|
|
545
|
+
size: number;
|
|
546
|
+
/** Current processing status */
|
|
547
|
+
status: FileProcessingStatus;
|
|
548
|
+
/** Artifact path (e.g., "files/document.pdf") - set after upload */
|
|
549
|
+
artifact_path?: string;
|
|
550
|
+
/** Full artifact reference URI (e.g., "artifact:files/document.pdf") */
|
|
551
|
+
reference?: string;
|
|
552
|
+
/** Path to extracted text markdown (e.g., "files/document.pdf.md") */
|
|
553
|
+
md_path?: string;
|
|
554
|
+
/** Whether text extraction completed successfully */
|
|
555
|
+
text_extracted?: boolean;
|
|
556
|
+
/** Error message if status is ERROR */
|
|
557
|
+
error?: string;
|
|
558
|
+
/** Timestamp when upload started */
|
|
559
|
+
started_at: number;
|
|
560
|
+
/** Timestamp when processing completed */
|
|
561
|
+
completed_at?: number;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Details for file processing SYSTEM messages.
|
|
565
|
+
* Used when type is AgentMessageType.SYSTEM with system_type: 'file_processing'.
|
|
566
|
+
*/
|
|
567
|
+
export interface FileProcessingDetails {
|
|
568
|
+
/** Discriminator for SYSTEM message subtypes */
|
|
569
|
+
system_type: 'file_processing';
|
|
570
|
+
/** Batch ID for grouping related file operations */
|
|
571
|
+
batch_id: string;
|
|
572
|
+
/** All files in this batch with their current status */
|
|
573
|
+
files: ConversationFile[];
|
|
574
|
+
/** Number of files still being processed */
|
|
575
|
+
pending_count: number;
|
|
576
|
+
/** Number of files ready for use */
|
|
577
|
+
ready_count: number;
|
|
578
|
+
/** Number of files that failed */
|
|
579
|
+
error_count: number;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Reference to a file uploaded via the UI for conversation use.
|
|
583
|
+
*/
|
|
584
|
+
export interface ConversationFileRef {
|
|
585
|
+
/** Client-generated unique ID */
|
|
586
|
+
id: string;
|
|
587
|
+
/** Original filename */
|
|
588
|
+
name: string;
|
|
589
|
+
/** MIME type */
|
|
590
|
+
content_type: string;
|
|
591
|
+
/** Artifact reference (e.g., "artifact:files/document.pdf") */
|
|
592
|
+
reference: string;
|
|
593
|
+
/** Artifact path without prefix (e.g., "files/document.pdf") */
|
|
594
|
+
artifact_path: string;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Get the Redis pub/sub channel name for workflow messages.
|
|
598
|
+
* Used by both publishers (workflow activities, studio-server) and subscribers (zeno-server, clients).
|
|
599
|
+
* @param workflowRunId - The Temporal workflow run ID (NOT the interaction execution run ID)
|
|
600
|
+
*/
|
|
601
|
+
export declare function getWorkflowChannel(workflowRunId: string): string;
|
|
602
|
+
/**
|
|
603
|
+
* Get the Redis list key for storing workflow message history.
|
|
604
|
+
* Messages are stored here for retrieval by reconnecting clients.
|
|
605
|
+
* @param workflowRunId - The Temporal workflow run ID (NOT the interaction execution run ID)
|
|
606
|
+
*/
|
|
607
|
+
export declare function getWorkflowUpdatesKey(workflowRunId: string): string;
|
|
608
|
+
export interface PlanTask {
|
|
609
|
+
id: number;
|
|
610
|
+
goal: string;
|
|
611
|
+
instructions: string[];
|
|
612
|
+
comment?: string;
|
|
613
|
+
status?: "pending" | "in_progress" | "completed" | "skipped";
|
|
614
|
+
}
|
|
615
|
+
export interface Plan {
|
|
616
|
+
plan: PlanTask[];
|
|
617
|
+
comment?: string;
|
|
618
|
+
}
|
|
619
|
+
export declare const LOW_PRIORITY_TASK_QUEUE = "low_priority";
|
|
620
|
+
/**
|
|
621
|
+
* WebSocket message types for bidirectional communication
|
|
622
|
+
*/
|
|
623
|
+
export interface WebSocketSignalMessage {
|
|
624
|
+
type: 'signal';
|
|
625
|
+
signalName: string;
|
|
626
|
+
data: any;
|
|
627
|
+
requestId?: string | number;
|
|
628
|
+
}
|
|
629
|
+
export interface WebSocketPingMessage {
|
|
630
|
+
type: 'ping';
|
|
631
|
+
}
|
|
632
|
+
export interface WebSocketPongMessage {
|
|
633
|
+
type: 'pong';
|
|
634
|
+
}
|
|
635
|
+
export interface WebSocketAckMessage {
|
|
636
|
+
type: 'ack';
|
|
637
|
+
requestId: string | number;
|
|
638
|
+
}
|
|
639
|
+
export interface WebSocketErrorMessage {
|
|
640
|
+
type: 'error';
|
|
641
|
+
requestId?: string | number;
|
|
642
|
+
error: string;
|
|
643
|
+
}
|
|
644
|
+
export type WebSocketClientMessage = WebSocketSignalMessage | WebSocketPingMessage;
|
|
645
|
+
export type WebSocketServerMessage = WebSocketPongMessage | WebSocketAckMessage | WebSocketErrorMessage | AgentMessage;
|
|
646
|
+
/**
|
|
647
|
+
* Payload for applying actions to a workflow run (e.g., cancel, terminate).
|
|
648
|
+
*/
|
|
649
|
+
export interface WorkflowActionPayload {
|
|
650
|
+
/**
|
|
651
|
+
* Optional reason for the action.
|
|
652
|
+
*/
|
|
653
|
+
reason?: string;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Parameters for the AgentIntakeWorkflow.
|
|
657
|
+
* This workflow uses an intelligent agent to process documents:
|
|
658
|
+
* - Select or create appropriate content types
|
|
659
|
+
* - Extract properties using schema-enforced interactions
|
|
660
|
+
* - File documents into relevant collections
|
|
661
|
+
*/
|
|
662
|
+
export interface AgentIntakeWorkflowParams {
|
|
663
|
+
/**
|
|
664
|
+
* The interaction to use for document intake agent.
|
|
665
|
+
* Defaults to "sys:DocumentIntakeAgent" if not specified.
|
|
666
|
+
* Can be overridden with a project-level interaction.
|
|
667
|
+
*/
|
|
668
|
+
intakeInteraction?: string;
|
|
669
|
+
/**
|
|
670
|
+
* The interaction to use for property extraction.
|
|
671
|
+
* Defaults to "sys:ExtractInformation" if not specified.
|
|
672
|
+
* Can be overridden with a project-level interaction.
|
|
673
|
+
*/
|
|
674
|
+
extractionInteraction?: string;
|
|
675
|
+
/**
|
|
676
|
+
* Whether to generate table of contents for documents.
|
|
677
|
+
* Defaults to true for documents, false for images/videos.
|
|
678
|
+
*/
|
|
679
|
+
generateTableOfContents?: boolean;
|
|
680
|
+
/**
|
|
681
|
+
* Whether to generate embeddings after processing.
|
|
682
|
+
* Defaults to true.
|
|
683
|
+
*/
|
|
684
|
+
generateEmbeddings?: boolean;
|
|
685
|
+
/**
|
|
686
|
+
* Max iterations for the agent workflow.
|
|
687
|
+
* Defaults to 50.
|
|
688
|
+
*/
|
|
689
|
+
maxIterations?: number;
|
|
690
|
+
/**
|
|
691
|
+
* Environment ID for LLM execution.
|
|
692
|
+
*/
|
|
693
|
+
environment?: string;
|
|
694
|
+
/**
|
|
695
|
+
* Model to use for the agent.
|
|
696
|
+
*/
|
|
697
|
+
model?: string;
|
|
698
|
+
/**
|
|
699
|
+
* Additional model options.
|
|
700
|
+
*/
|
|
701
|
+
model_options?: Record<string, unknown>;
|
|
702
|
+
/**
|
|
703
|
+
* Whether to use semantic layer (MagicPDF) for PDF processing.
|
|
704
|
+
*/
|
|
705
|
+
useSemanticLayer?: boolean;
|
|
706
|
+
/**
|
|
707
|
+
* Whether to use vision for image-based extraction.
|
|
708
|
+
*/
|
|
709
|
+
useVision?: boolean;
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Result of the AgentIntakeWorkflow
|
|
713
|
+
*/
|
|
714
|
+
export interface AgentIntakeWorkflowResult {
|
|
715
|
+
/** The object ID that was processed */
|
|
716
|
+
objectId: string;
|
|
717
|
+
/** Whether text was extracted */
|
|
718
|
+
hasText: boolean;
|
|
719
|
+
/** Whether table of contents was generated */
|
|
720
|
+
hasTableOfContents: boolean;
|
|
721
|
+
/** The type ID assigned to the document */
|
|
722
|
+
typeId?: string;
|
|
723
|
+
/** Whether properties were extracted */
|
|
724
|
+
hasProperties: boolean;
|
|
725
|
+
/** Collection IDs the document was added to */
|
|
726
|
+
collectionIds?: string[];
|
|
727
|
+
/** Whether embeddings were generated */
|
|
728
|
+
hasEmbeddings: boolean;
|
|
729
|
+
}
|
|
730
|
+
export {};
|