@vertesia/common 1.0.0-dev.20260203.130115Z → 1.0.0-dev.20260227.104700Z
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/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 +17 -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/audit-trail.js +3 -0
- package/lib/cjs/audit-trail.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 +56 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/integrations.js +16 -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 +143 -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/hive-memory.js +3 -0
- package/lib/cjs/store/hive-memory.js.map +1 -0
- package/lib/cjs/store/index.js +32 -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/rendering.js +22 -0
- package/lib/cjs/store/rendering.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 +179 -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 +305 -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 +138 -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 +9 -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 +14 -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/audit-trail.js +2 -0
- package/lib/esm/audit-trail.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 +40 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/integrations.js +13 -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 +138 -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/hive-memory.js +2 -0
- package/lib/esm/store/hive-memory.js.map +1 -0
- package/lib/esm/store/index.js +16 -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/rendering.js +18 -0
- package/lib/esm/store/rendering.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 +171 -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 +287 -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 +129 -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 +6 -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 +99 -0
- package/lib/types/apikey.d.ts.map +1 -0
- package/lib/types/apps.d.ts +481 -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/audit-trail.d.ts +49 -0
- package/lib/types/audit-trail.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 +40 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/integrations.d.ts +68 -0
- package/lib/types/integrations.d.ts.map +1 -0
- package/lib/types/interaction.d.ts +965 -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 +434 -0
- package/lib/types/project.d.ts.map +1 -0
- package/lib/types/prompt.d.ts +77 -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 +132 -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 +272 -0
- package/lib/types/store/dsl-workflow.d.ts.map +1 -0
- package/lib/types/store/hive-memory.d.ts +116 -0
- package/lib/types/store/hive-memory.d.ts.map +1 -0
- package/lib/types/store/index.d.ts +15 -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/rendering.d.ts +193 -0
- package/lib/types/store/rendering.d.ts.map +1 -0
- package/lib/types/store/schedule.d.ts +184 -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 +436 -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 +948 -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 +125 -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 +18 -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 +4 -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 +4 -6
- package/src/apikey.ts +1 -0
- package/src/apps.ts +193 -2
- package/src/audit-trail.ts +61 -0
- package/src/index.ts +1 -0
- package/src/integrations.ts +10 -0
- package/src/interaction.ts +12 -12
- package/src/project.ts +226 -0
- package/src/prompt.ts +3 -4
- package/src/store/conversation-state.ts +9 -0
- package/src/store/doc-analyzer.ts +1 -1
- package/src/store/dsl-workflow.ts +20 -0
- package/src/store/index.ts +1 -0
- package/src/store/rendering.ts +233 -0
- package/src/store/schedule.ts +3 -0
- package/src/store/store.ts +40 -5
- package/src/store/workflow.ts +184 -7
- package/src/user.ts +11 -0
- package/src/utils/schemas.ts +33 -11
- package/src/versions.ts +1 -0
|
@@ -127,6 +127,15 @@ export interface ConversationState {
|
|
|
127
127
|
* When a skill is called, its related tools are added to unlocked_tools.
|
|
128
128
|
*/
|
|
129
129
|
skill_tool_map?: Record<string, string[]>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Current activity group ID for internal tool-execution progress messages.
|
|
133
|
+
* All updates emitted during one tool-execution cycle should share this ID.
|
|
134
|
+
*/
|
|
135
|
+
active_activity_group_id?: string;
|
|
136
|
+
|
|
137
|
+
/** LLM stop reason from the latest call (e.g., "stop", "length", "tool_use") */
|
|
138
|
+
finish_reason?: string;
|
|
130
139
|
}
|
|
131
140
|
|
|
132
141
|
/** Skill metadata collected at workflow start for upfront sandbox hydration */
|
|
@@ -3,6 +3,26 @@ import { BaseObject } from "./common.js";
|
|
|
3
3
|
import { WorkflowExecutionPayload } from "./index.js";
|
|
4
4
|
import { ParentClosePolicyType } from "./temporalio.js";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Discriminator for workflow input type - either object IDs or GCS file URIs
|
|
8
|
+
*/
|
|
9
|
+
export type WorkflowInputType = 'objectIds' | 'files';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* File reference with URL and mimetype
|
|
13
|
+
*/
|
|
14
|
+
export interface WorkflowInputFile {
|
|
15
|
+
url: string;
|
|
16
|
+
mimetype: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Discriminated union for workflow inputs.
|
|
21
|
+
* Workflows can accept either a list of object IDs (existing behavior) OR a list of file references (new).
|
|
22
|
+
*/
|
|
23
|
+
export type WorkflowInput =
|
|
24
|
+
| { inputType: 'objectIds', objectIds: string[] }
|
|
25
|
+
| { inputType: 'files', files: WorkflowInputFile[] };
|
|
6
26
|
|
|
7
27
|
/**
|
|
8
28
|
* The payload sent when starting a workflow from the temporal client to the workflow instance.
|
package/src/store/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./object-types.js";
|
|
|
9
9
|
export * from "./schedule.js";
|
|
10
10
|
export * from "./signals.js";
|
|
11
11
|
export * from "./store.js";
|
|
12
|
+
export * from "./rendering.js";
|
|
12
13
|
export * from "./temporalio.js";
|
|
13
14
|
export * from "./worker.js";
|
|
14
15
|
export * from "./workflow.js";
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rendering API types
|
|
3
|
+
*
|
|
4
|
+
* Types for rendering content to various formats (PDF, DOCX, images)
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { ImageRenditionFormat, MarkdownRenditionFormat } from "./store.js";
|
|
8
|
+
import { WorkflowExecutionStatus, WorkflowRunStatus } from "./workflow.js";
|
|
9
|
+
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Workflow Vars Types (Discriminated Union)
|
|
12
|
+
// ============================================================================
|
|
13
|
+
|
|
14
|
+
/** Base vars shared by all rendition types */
|
|
15
|
+
interface BaseRenditionVars {
|
|
16
|
+
mime_type?: string;
|
|
17
|
+
/** Custom upload path — overrides the default renditions/{etag}/{name} path */
|
|
18
|
+
outputPath?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Workflow vars for image renditions (jpeg, png, webp) */
|
|
22
|
+
export interface ImageRenditionVars extends BaseRenditionVars {
|
|
23
|
+
format?: ImageRenditionFormat;
|
|
24
|
+
max_hw?: number;
|
|
25
|
+
max_pages?: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Metadata for PDF rendering (displayed in header/footer) */
|
|
29
|
+
export interface PdfRenderingMetadata {
|
|
30
|
+
/** Document ID to display in footer */
|
|
31
|
+
document_id?: string;
|
|
32
|
+
/** Agent name that generated the document */
|
|
33
|
+
agent_name?: string;
|
|
34
|
+
/** Agent run ID to display in footer */
|
|
35
|
+
agent_run_id?: string;
|
|
36
|
+
/** Document subtitle */
|
|
37
|
+
subtitle?: string;
|
|
38
|
+
/** Document author(s) */
|
|
39
|
+
author?: string | string[];
|
|
40
|
+
/** Document date (displayed in header and title page; defaults to today if omitted) */
|
|
41
|
+
date?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Workflow vars for markdown renditions (pdf, docx) */
|
|
45
|
+
export interface MarkdownRenditionVars extends BaseRenditionVars {
|
|
46
|
+
format: MarkdownRenditionFormat;
|
|
47
|
+
/** Inline markdown content (mutually exclusive with objectId) */
|
|
48
|
+
content?: string;
|
|
49
|
+
/** Blob store path to fetch markdown from (mutually exclusive with content/objectId) */
|
|
50
|
+
artifactPath?: string;
|
|
51
|
+
/** Document title for inline content */
|
|
52
|
+
title?: string;
|
|
53
|
+
/** URL to template file (LaTeX for PDF, reference doc for DOCX) */
|
|
54
|
+
templateUrl?: string;
|
|
55
|
+
/** Optional logo URL for template variable `logo-path` (studio-hosted URL) */
|
|
56
|
+
templateLogoUrl?: string;
|
|
57
|
+
/** Template file via artifact:/store: protocol (takes precedence over templateUrl) */
|
|
58
|
+
templatePath?: string;
|
|
59
|
+
/** Logo file via artifact:/store: protocol (takes precedence over templateLogoUrl) */
|
|
60
|
+
logoPath?: string;
|
|
61
|
+
/** Use Vertesia default template if no templateUrl provided (default: true for pdf) */
|
|
62
|
+
useDefaultTemplate?: boolean;
|
|
63
|
+
/** Additional pandoc command-line options */
|
|
64
|
+
pandocOptions?: string[];
|
|
65
|
+
/** Run ID for resolving artifact: URLs in markdown */
|
|
66
|
+
artifactRunId?: string;
|
|
67
|
+
/** Document metadata for PDF footer/header */
|
|
68
|
+
metadata?: PdfRenderingMetadata;
|
|
69
|
+
/** Source reference for auto-wired template data: `store:<objectId>` or `artifact:<path-to-json>` */
|
|
70
|
+
templateDataSource?: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Discriminated union of all rendition workflow vars */
|
|
74
|
+
export type GenerateRenditionVars = ImageRenditionVars | MarkdownRenditionVars;
|
|
75
|
+
|
|
76
|
+
/** Type guard for markdown rendition vars */
|
|
77
|
+
export function isMarkdownRenditionVars(
|
|
78
|
+
vars: GenerateRenditionVars
|
|
79
|
+
): vars is MarkdownRenditionVars {
|
|
80
|
+
return vars.format === 'pdf' || vars.format === 'docx';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// ============================================================================
|
|
84
|
+
// API Payload Types
|
|
85
|
+
// ============================================================================
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Payload for rendering markdown to PDF or DOCX.
|
|
89
|
+
* Either object_id OR content must be provided.
|
|
90
|
+
*/
|
|
91
|
+
export interface RenderMarkdownPayload {
|
|
92
|
+
/** Output format */
|
|
93
|
+
format: MarkdownRenditionFormat;
|
|
94
|
+
/** Object ID to render (mutually exclusive with content) */
|
|
95
|
+
object_id?: string;
|
|
96
|
+
/** Inline markdown content to render (mutually exclusive with object_id) */
|
|
97
|
+
content?: string;
|
|
98
|
+
/** Document title (used for filename when using inline content) */
|
|
99
|
+
title?: string;
|
|
100
|
+
/** URL to a template file for pandoc (DOCX reference doc or LaTeX template) */
|
|
101
|
+
template_url?: string;
|
|
102
|
+
/** Optional logo URL for template variable `logo-path` (studio-hosted URL) */
|
|
103
|
+
template_logo_url?: string;
|
|
104
|
+
/** Template file via artifact:/store: protocol (takes precedence over template_url) */
|
|
105
|
+
template_path?: string;
|
|
106
|
+
/** Logo file via artifact:/store: protocol (takes precedence over template_logo_url) */
|
|
107
|
+
logo_path?: string;
|
|
108
|
+
/** Use Vertesia default template if no template_url provided (default: true for pdf) */
|
|
109
|
+
use_default_template?: boolean;
|
|
110
|
+
/** Additional pandoc command-line options */
|
|
111
|
+
pandoc_options?: string[];
|
|
112
|
+
/** Run ID for resolving artifact: and image: URLs */
|
|
113
|
+
artifact_run_id?: string;
|
|
114
|
+
/** Document metadata for PDF footer/header */
|
|
115
|
+
metadata?: PdfRenderingMetadata;
|
|
116
|
+
/** Source reference for auto-wired template data: `store:<objectId>` or `artifact:<path-to-json>` */
|
|
117
|
+
template_data_source?: string;
|
|
118
|
+
/** Custom upload path for the rendered output */
|
|
119
|
+
output_path?: string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Initial response when starting a markdown rendering workflow.
|
|
124
|
+
* Clients should poll status using workflow_id/workflow_run_id.
|
|
125
|
+
*/
|
|
126
|
+
export interface RenderMarkdownStartResponse extends WorkflowRunStatus {
|
|
127
|
+
/** Requested output format */
|
|
128
|
+
format: MarkdownRenditionFormat;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Polled status response for markdown rendering workflow.
|
|
133
|
+
*/
|
|
134
|
+
export interface RenderMarkdownStatusResponse extends WorkflowRunStatus {
|
|
135
|
+
/** Requested output format (if known) */
|
|
136
|
+
format?: MarkdownRenditionFormat;
|
|
137
|
+
/** Download URL for completed output */
|
|
138
|
+
download_url?: string;
|
|
139
|
+
/** File URI in storage for completed output */
|
|
140
|
+
file_uri?: string;
|
|
141
|
+
/** Error details for failed/terminated runs */
|
|
142
|
+
error?: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Client-side polling options for markdown rendering.
|
|
147
|
+
*/
|
|
148
|
+
export interface RenderMarkdownPollOptions {
|
|
149
|
+
/** Maximum time to wait in milliseconds (default: 10 minutes) */
|
|
150
|
+
timeoutMs?: number;
|
|
151
|
+
/** Polling interval in milliseconds (default: 1500ms) */
|
|
152
|
+
pollIntervalMs?: number;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Result from the GenerateRenditions workflow.
|
|
157
|
+
* Shared between zeno-server (consumer) and workflows (producer).
|
|
158
|
+
*/
|
|
159
|
+
export interface GenerateRenditionsResult {
|
|
160
|
+
uploads: string[];
|
|
161
|
+
format: string;
|
|
162
|
+
status: string;
|
|
163
|
+
fileUri?: string;
|
|
164
|
+
/** Warnings about rich content blocks that failed to render (document was still produced) */
|
|
165
|
+
warnings?: string[];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Response from the rendering API.
|
|
170
|
+
*/
|
|
171
|
+
export interface RenderMarkdownResponse {
|
|
172
|
+
/** Rendering status */
|
|
173
|
+
status: "success";
|
|
174
|
+
/** Output format */
|
|
175
|
+
format: MarkdownRenditionFormat;
|
|
176
|
+
/** Download URL for the rendered document */
|
|
177
|
+
download_url?: string;
|
|
178
|
+
/** File URI in storage */
|
|
179
|
+
file_uri?: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// ============================================================================
|
|
183
|
+
// Slide Deck Types
|
|
184
|
+
// ============================================================================
|
|
185
|
+
|
|
186
|
+
/** A slide rendered from a named SVG template with structured content */
|
|
187
|
+
export interface TemplateSlide {
|
|
188
|
+
type: 'template';
|
|
189
|
+
/** Template name: 'title' | 'section' | 'bullets' | 'two-column' | 'image-text' */
|
|
190
|
+
template: string;
|
|
191
|
+
/** Key-value content for the template (values can be strings or string arrays) */
|
|
192
|
+
content: Record<string, string | string[]>;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** A slide with raw SVG markup */
|
|
196
|
+
export interface RawSvgSlide {
|
|
197
|
+
type: 'svg';
|
|
198
|
+
/** Complete SVG markup (should use 1920x1080 viewBox) */
|
|
199
|
+
svg: string;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** A single slide specification — either template-based or raw SVG */
|
|
203
|
+
export type SlideSpec = TemplateSlide | RawSvgSlide;
|
|
204
|
+
|
|
205
|
+
/** Options for rendering a slide deck to PDF */
|
|
206
|
+
export interface RenderSlidesDeckOptions {
|
|
207
|
+
/** Canvas scale factor for higher resolution (default: 2) */
|
|
208
|
+
scale?: number;
|
|
209
|
+
/** Background color for each slide (default: '#ffffff') */
|
|
210
|
+
backgroundColor?: string;
|
|
211
|
+
/** Slide theme — replaces default colors in SVG templates */
|
|
212
|
+
theme?: Record<string, string>;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** Result of rendering a slide deck to PDF */
|
|
216
|
+
export interface RenderSlidesDeckResult {
|
|
217
|
+
/** PDF file as a Uint8Array (use Buffer.from() in Node.js) */
|
|
218
|
+
buffer: Uint8Array;
|
|
219
|
+
/** Number of slides rendered */
|
|
220
|
+
slideCount: number;
|
|
221
|
+
/** PDF page width in points (720 = 10") */
|
|
222
|
+
pageWidth: number;
|
|
223
|
+
/** PDF page height in points (540 = 7.5") */
|
|
224
|
+
pageHeight: number;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export function isWorkflowTerminalStatus(status: WorkflowExecutionStatus): boolean {
|
|
228
|
+
return status === WorkflowExecutionStatus.COMPLETED
|
|
229
|
+
|| status === WorkflowExecutionStatus.FAILED
|
|
230
|
+
|| status === WorkflowExecutionStatus.CANCELED
|
|
231
|
+
|| status === WorkflowExecutionStatus.TERMINATED
|
|
232
|
+
|| status === WorkflowExecutionStatus.TIMED_OUT;
|
|
233
|
+
}
|
package/src/store/schedule.ts
CHANGED
|
@@ -107,6 +107,9 @@ export interface CreateSchedulePayload {
|
|
|
107
107
|
|
|
108
108
|
/** Whether the schedule should be enabled immediately (defaults to true) */
|
|
109
109
|
enabled?: boolean;
|
|
110
|
+
|
|
111
|
+
/** Visibility of the conversation (defaults to "project") */
|
|
112
|
+
visibility?: 'project' | 'private';
|
|
110
113
|
}
|
|
111
114
|
|
|
112
115
|
/**
|
package/src/store/store.ts
CHANGED
|
@@ -302,8 +302,30 @@ export interface CreateContentObjectPayload<T = any>
|
|
|
302
302
|
generation_run_info?: GenerationRunMetadata;
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
export
|
|
305
|
+
export function getContentTypeRefId(type: ContentObjectTypeRef) {
|
|
306
|
+
return (type as StoredTypeRef).id || (type as InCodeTypeRef).code;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Reference to a content object type. Either `id` (stored type) or `code` (in-code type) must be set.
|
|
311
|
+
*/
|
|
312
|
+
export type ContentObjectTypeRef = StoredTypeRef | InCodeTypeRef;
|
|
313
|
+
|
|
314
|
+
interface StoredTypeRef {
|
|
315
|
+
/**
|
|
316
|
+
* MongoDB ObjectId string for stored types
|
|
317
|
+
*/
|
|
306
318
|
id: string;
|
|
319
|
+
code?: never;
|
|
320
|
+
name: string;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
interface InCodeTypeRef {
|
|
324
|
+
id?: never;
|
|
325
|
+
/**
|
|
326
|
+
* Namespaced identifier for in-code types (e.g. "sys:Invoice", "app:myapp:Contract")
|
|
327
|
+
*/
|
|
328
|
+
code: string;
|
|
307
329
|
name: string;
|
|
308
330
|
}
|
|
309
331
|
|
|
@@ -353,7 +375,20 @@ export interface ContentObjectTypeItem extends BaseObject {
|
|
|
353
375
|
*/
|
|
354
376
|
strict_mode?: boolean;
|
|
355
377
|
}
|
|
356
|
-
export type InCodeTypeDefinition = Pick<ContentObjectTypeItem, 'name' | 'description' | 'tags' | 'object_schema' | 'table_layout' | 'is_chunkable' | 'strict_mode'>;
|
|
378
|
+
export type InCodeTypeDefinition = Pick<ContentObjectTypeItem, 'id' | 'name' | 'description' | 'tags' | 'object_schema' | 'table_layout' | 'is_chunkable' | 'strict_mode'>;
|
|
379
|
+
/**
|
|
380
|
+
* The itnerface to be used whend efining types in a plugin app.
|
|
381
|
+
*/
|
|
382
|
+
export type InCodeTypeSpec = Omit<InCodeTypeDefinition, 'id'>;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Returns true if the type id represents an in-code type (system or app-contributed).
|
|
386
|
+
* In-code types use colon-separated ids like "sys:Invoice" or "app:myapp:Article".
|
|
387
|
+
* These types are read-only and cannot be edited through the UI.
|
|
388
|
+
*/
|
|
389
|
+
export function isInCodeType(typeId: string): boolean {
|
|
390
|
+
return typeId.includes(':');
|
|
391
|
+
}
|
|
357
392
|
|
|
358
393
|
export interface CreateContentObjectTypePayload
|
|
359
394
|
extends Omit<
|
|
@@ -456,8 +491,8 @@ const RENDITION_COMPATIBILITY: Record<string, RenditionFormat[]> = {
|
|
|
456
491
|
'application/pdf': [ImageRenditionFormat.jpeg, ImageRenditionFormat.png, ImageRenditionFormat.webp],
|
|
457
492
|
// Markdown can generate: pdf, docx (NOT jpeg/png)
|
|
458
493
|
'text/markdown': [MarkdownRenditionFormat.pdf, MarkdownRenditionFormat.docx],
|
|
459
|
-
//
|
|
460
|
-
'text
|
|
494
|
+
// Any text/* can generate: docx (editable export)
|
|
495
|
+
'text/*': [MarkdownRenditionFormat.docx],
|
|
461
496
|
// Office documents can generate: pdf
|
|
462
497
|
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': [MarkdownRenditionFormat.pdf],
|
|
463
498
|
'application/msword': [MarkdownRenditionFormat.pdf],
|
|
@@ -563,7 +598,7 @@ export interface GetFileUrlPayload {
|
|
|
563
598
|
export interface GetFileUrlResponse {
|
|
564
599
|
url: string;
|
|
565
600
|
id: string;
|
|
566
|
-
mime_type
|
|
601
|
+
mime_type?: string;
|
|
567
602
|
path: string;
|
|
568
603
|
}
|
|
569
604
|
|
package/src/store/workflow.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { JSONSchema4 } from "json-schema";
|
|
2
1
|
import { ConversationVisibility, InteractionRef, UserChannel } from "../interaction.js";
|
|
2
|
+
import { JSONSchema } from "../json-schema.js";
|
|
3
|
+
import type { WorkflowInput } from "./dsl-workflow.js";
|
|
3
4
|
|
|
4
5
|
export enum ContentEventName {
|
|
5
6
|
create = "create",
|
|
@@ -151,9 +152,16 @@ export interface WorkflowExecutionPayload<T = Record<string, any>> extends Workf
|
|
|
151
152
|
wf_rule_name?: string;
|
|
152
153
|
|
|
153
154
|
/**
|
|
154
|
-
* The ID of the target objects processed by the workflow.
|
|
155
|
+
* The ID of the target objects processed by the workflow (legacy format).
|
|
156
|
+
* For backward compatibility. New workflows should use the `input` field.
|
|
155
157
|
*/
|
|
156
|
-
objectIds
|
|
158
|
+
objectIds?: string[];
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* New format: Workflow input (either objectIds or files).
|
|
162
|
+
* Takes precedence over the legacy `objectIds` field.
|
|
163
|
+
*/
|
|
164
|
+
input?: WorkflowInput;
|
|
157
165
|
|
|
158
166
|
/**
|
|
159
167
|
* Auth Token to access Zeno and Composable from the workers
|
|
@@ -162,7 +170,12 @@ export interface WorkflowExecutionPayload<T = Record<string, any>> extends Workf
|
|
|
162
170
|
}
|
|
163
171
|
|
|
164
172
|
export function getDocumentIds(payload: WorkflowExecutionPayload): string[] {
|
|
165
|
-
|
|
173
|
+
// Check new input format first
|
|
174
|
+
if (payload.input?.inputType === 'objectIds') {
|
|
175
|
+
return payload.input.objectIds;
|
|
176
|
+
}
|
|
177
|
+
// Fall back to legacy objectIds field
|
|
178
|
+
if (payload.objectIds) {
|
|
166
179
|
return payload.objectIds;
|
|
167
180
|
}
|
|
168
181
|
return [];
|
|
@@ -181,6 +194,12 @@ export interface ExecuteWorkflowPayload {
|
|
|
181
194
|
//@deprecated
|
|
182
195
|
objectIds?: string[];
|
|
183
196
|
|
|
197
|
+
/**
|
|
198
|
+
* New format: Workflow input (either objectIds or files).
|
|
199
|
+
* Takes precedence over the deprecated `objectIds` field.
|
|
200
|
+
*/
|
|
201
|
+
input?: WorkflowInput;
|
|
202
|
+
|
|
184
203
|
/**
|
|
185
204
|
* Parameters to pass to the workflow
|
|
186
205
|
*/
|
|
@@ -335,6 +354,12 @@ export interface WorkflowRunEvent {
|
|
|
335
354
|
|
|
336
355
|
signal?: SignalEventProperties;
|
|
337
356
|
|
|
357
|
+
timer?: {
|
|
358
|
+
timerId?: string;
|
|
359
|
+
duration?: string;
|
|
360
|
+
summary?: string;
|
|
361
|
+
};
|
|
362
|
+
|
|
338
363
|
error?: EventError;
|
|
339
364
|
|
|
340
365
|
result?: any;
|
|
@@ -358,6 +383,7 @@ export enum TaskType {
|
|
|
358
383
|
ACTIVITY = 'activity',
|
|
359
384
|
CHILD_WORKFLOW = 'childWorkflow',
|
|
360
385
|
SIGNAL = 'signal',
|
|
386
|
+
TIMER = 'timer',
|
|
361
387
|
}
|
|
362
388
|
|
|
363
389
|
// Base task interface
|
|
@@ -402,21 +428,75 @@ export interface SignalTask extends TaskBase {
|
|
|
402
428
|
};
|
|
403
429
|
}
|
|
404
430
|
|
|
431
|
+
// Timer-specific task
|
|
432
|
+
export interface TimerTask extends TaskBase {
|
|
433
|
+
type: TaskType.TIMER;
|
|
434
|
+
timerId?: string;
|
|
435
|
+
duration?: string;
|
|
436
|
+
}
|
|
437
|
+
|
|
405
438
|
// Union type for all processed tasks
|
|
406
439
|
export type WorkflowTask =
|
|
407
440
|
| ActivityTask
|
|
408
441
|
| ChildWorkflowTask
|
|
409
|
-
| SignalTask
|
|
442
|
+
| SignalTask
|
|
443
|
+
| TimerTask;
|
|
410
444
|
|
|
411
445
|
// History format discriminated union
|
|
412
446
|
export type WorkflowHistory =
|
|
413
447
|
| { type: 'events'; events: WorkflowRunEvent[] }
|
|
414
448
|
| { type: 'tasks'; tasks: WorkflowTask[] }
|
|
415
|
-
| { type: 'agent';
|
|
449
|
+
| { type: 'agent'; agentTasks: AgentTask[] };
|
|
416
450
|
|
|
417
451
|
// History format query parameter type
|
|
418
452
|
export type HistoryFormat = 'events' | 'tasks' | 'agent';
|
|
419
453
|
|
|
454
|
+
/**
|
|
455
|
+
* Agent task information for workflow history UI representation.
|
|
456
|
+
* This is separate from the analytics AgentEvent types.
|
|
457
|
+
* Consistent with WorkflowTask naming convention.
|
|
458
|
+
*
|
|
459
|
+
* Currently represents tool calls, but designed to be extensible
|
|
460
|
+
* for other task types (LLM calls, checkpoints, etc.)
|
|
461
|
+
*/
|
|
462
|
+
export interface AgentTask {
|
|
463
|
+
/** Type discriminator for future task types */
|
|
464
|
+
taskType: 'tool_call' | 'llm_call' | 'input' | 'timer' | 'subagent' | 'processing';
|
|
465
|
+
|
|
466
|
+
/** Tool-specific fields */
|
|
467
|
+
toolName: string;
|
|
468
|
+
toolUseId?: string;
|
|
469
|
+
toolRunId?: string;
|
|
470
|
+
toolType?: 'builtin' | 'interaction' | 'remote' | 'skill';
|
|
471
|
+
iteration?: number;
|
|
472
|
+
|
|
473
|
+
/** Execution details */
|
|
474
|
+
scheduled_at: string | null;
|
|
475
|
+
started_at: string | null;
|
|
476
|
+
completed_at: string | null;
|
|
477
|
+
status: 'running' | 'completed' | 'error' | 'warning';
|
|
478
|
+
|
|
479
|
+
/** Tool data */
|
|
480
|
+
parameters?: Record<string, unknown>;
|
|
481
|
+
result?: string;
|
|
482
|
+
error?: { type: string; message: string };
|
|
483
|
+
|
|
484
|
+
/** Number of activity retries */
|
|
485
|
+
retries?: number;
|
|
486
|
+
|
|
487
|
+
/** Active tools for this LLM call */
|
|
488
|
+
activeTools?: string[];
|
|
489
|
+
|
|
490
|
+
/** Available skills for this LLM call */
|
|
491
|
+
availableSkills?: string[];
|
|
492
|
+
|
|
493
|
+
/** Workstream tracking */
|
|
494
|
+
workstreamId?: string;
|
|
495
|
+
|
|
496
|
+
/** LLM stop reason for llm_call tasks (e.g., "stop", "length", "tool_use") */
|
|
497
|
+
finish_reason?: string;
|
|
498
|
+
}
|
|
499
|
+
|
|
420
500
|
export interface WorkflowRun {
|
|
421
501
|
status?: WorkflowExecutionStatus | string;
|
|
422
502
|
/**
|
|
@@ -504,8 +584,14 @@ export interface WorkflowInteractionVars {
|
|
|
504
584
|
environment: string,
|
|
505
585
|
model: string
|
|
506
586
|
},
|
|
507
|
-
interactionParamsSchema?:
|
|
587
|
+
interactionParamsSchema?: JSONSchema,
|
|
508
588
|
collection_id?: string;
|
|
589
|
+
/**
|
|
590
|
+
* The token threshold in thousands (K) for creating checkpoints.
|
|
591
|
+
* If total tokens exceed this value, a checkpoint will be created.
|
|
592
|
+
* If not specified, default value of 150K tokens will be used.
|
|
593
|
+
*/
|
|
594
|
+
checkpoint_tokens?: number;
|
|
509
595
|
/**
|
|
510
596
|
* Optional version of the interaction to use when restoring conversations.
|
|
511
597
|
* If not specified, the latest version will be used.
|
|
@@ -580,6 +666,97 @@ export enum AgentMessageType {
|
|
|
580
666
|
BATCH_PROGRESS = 13,
|
|
581
667
|
}
|
|
582
668
|
|
|
669
|
+
// ============================================
|
|
670
|
+
// AGENT MESSAGE DETAIL TYPES & TYPE GUARDS
|
|
671
|
+
// ============================================
|
|
672
|
+
|
|
673
|
+
/**
|
|
674
|
+
* Details for THOUGHT messages representing tool calls (event_class: 'activity').
|
|
675
|
+
*/
|
|
676
|
+
export interface ToolCallDetails {
|
|
677
|
+
event_class: 'activity';
|
|
678
|
+
tool: string;
|
|
679
|
+
tool_run_id?: string;
|
|
680
|
+
tool_status?: 'running' | 'completed' | 'error' | 'warning';
|
|
681
|
+
tool_iteration?: number;
|
|
682
|
+
activity_group_id?: string;
|
|
683
|
+
activity_id?: string;
|
|
684
|
+
files?: string[];
|
|
685
|
+
outputFiles?: string[];
|
|
686
|
+
[key: string]: unknown;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
/**
|
|
690
|
+
* Details for UPDATE messages signaling document creation or update.
|
|
691
|
+
*/
|
|
692
|
+
export interface DocumentEventDetails {
|
|
693
|
+
event_class: 'document_created' | 'document_updated';
|
|
694
|
+
document_id: string;
|
|
695
|
+
title?: string;
|
|
696
|
+
[key: string]: unknown;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Details for REQUEST_INPUT messages with UX configuration.
|
|
701
|
+
*/
|
|
702
|
+
export interface RequestInputDetails {
|
|
703
|
+
ux?: {
|
|
704
|
+
options?: Array<{ id: string; label: string }>;
|
|
705
|
+
variant?: string;
|
|
706
|
+
multiSelect?: boolean;
|
|
707
|
+
allowFreeResponse?: boolean;
|
|
708
|
+
placeholder?: string;
|
|
709
|
+
};
|
|
710
|
+
[key: string]: unknown;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
/**
|
|
714
|
+
* Details for PLAN messages containing the plan structure.
|
|
715
|
+
*/
|
|
716
|
+
export interface PlanMessageDetails {
|
|
717
|
+
plan: PlanTask[];
|
|
718
|
+
comment?: string;
|
|
719
|
+
[key: string]: unknown;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
// Type guards — check both message type and details shape for safety
|
|
723
|
+
|
|
724
|
+
export function isToolCallMessage(msg: AgentMessage): msg is AgentMessage & { details: ToolCallDetails } {
|
|
725
|
+
return msg.type === AgentMessageType.THOUGHT &&
|
|
726
|
+
!!msg.details &&
|
|
727
|
+
typeof msg.details === 'object' &&
|
|
728
|
+
typeof msg.details.tool === 'string';
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
export function isDocumentEventMessage(msg: AgentMessage): msg is AgentMessage & { details: DocumentEventDetails } {
|
|
732
|
+
return msg.type === AgentMessageType.UPDATE &&
|
|
733
|
+
!!msg.details &&
|
|
734
|
+
typeof msg.details === 'object' &&
|
|
735
|
+
(msg.details.event_class === 'document_created' || msg.details.event_class === 'document_updated') &&
|
|
736
|
+
typeof msg.details.document_id === 'string';
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
export function isFileProcessingMessage(msg: AgentMessage): msg is AgentMessage & { details: FileProcessingDetails } {
|
|
740
|
+
return msg.type === AgentMessageType.SYSTEM &&
|
|
741
|
+
!!msg.details &&
|
|
742
|
+
typeof msg.details === 'object' &&
|
|
743
|
+
msg.details.system_type === 'file_processing' &&
|
|
744
|
+
Array.isArray(msg.details.files);
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
export function isPlanMessage(msg: AgentMessage): msg is AgentMessage & { details: PlanMessageDetails } {
|
|
748
|
+
return msg.type === AgentMessageType.PLAN &&
|
|
749
|
+
!!msg.details &&
|
|
750
|
+
typeof msg.details === 'object' &&
|
|
751
|
+
Array.isArray(msg.details.plan);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export function isRequestInputMessage(msg: AgentMessage): msg is AgentMessage & { details: RequestInputDetails } {
|
|
755
|
+
return msg.type === AgentMessageType.REQUEST_INPUT &&
|
|
756
|
+
!!msg.details &&
|
|
757
|
+
typeof msg.details === 'object';
|
|
758
|
+
}
|
|
759
|
+
|
|
583
760
|
/**
|
|
584
761
|
* Details for STREAMING_CHUNK messages used for real-time LLM response streaming
|
|
585
762
|
* @deprecated Use CompactMessage with f field for streaming chunks
|
package/src/user.ts
CHANGED
|
@@ -18,6 +18,17 @@ export interface User {
|
|
|
18
18
|
sign_in_provider?: string;
|
|
19
19
|
last_selected_account?: string;
|
|
20
20
|
source?: 'firebase' | 'scim';
|
|
21
|
+
updated_by?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export interface UpdateUserPayload {
|
|
26
|
+
name?: string;
|
|
27
|
+
username?: string;
|
|
28
|
+
picture?: string;
|
|
29
|
+
language?: string;
|
|
30
|
+
phone?: string;
|
|
31
|
+
last_selected_account?: string;
|
|
21
32
|
}
|
|
22
33
|
|
|
23
34
|
|