@vertesia/client 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 +110 -0
- package/lib/cjs/AccountApi.js +85 -0
- package/lib/cjs/AccountApi.js.map +1 -0
- package/lib/cjs/AccountsApi.js +16 -0
- package/lib/cjs/AccountsApi.js.map +1 -0
- package/lib/cjs/AnalyticsApi.js +41 -0
- package/lib/cjs/AnalyticsApi.js.map +1 -0
- package/lib/cjs/ApiKeysApi.js +63 -0
- package/lib/cjs/ApiKeysApi.js.map +1 -0
- package/lib/cjs/AppsApi.js +119 -0
- package/lib/cjs/AppsApi.js.map +1 -0
- package/lib/cjs/CommandsApi.js +19 -0
- package/lib/cjs/CommandsApi.js.map +1 -0
- package/lib/cjs/EnvironmentsApi.js +72 -0
- package/lib/cjs/EnvironmentsApi.js.map +1 -0
- package/lib/cjs/GroupsApi.js +78 -0
- package/lib/cjs/GroupsApi.js.map +1 -0
- package/lib/cjs/IamApi.js +53 -0
- package/lib/cjs/IamApi.js.map +1 -0
- package/lib/cjs/InteractionBase.js +44 -0
- package/lib/cjs/InteractionBase.js.map +1 -0
- package/lib/cjs/InteractionCatalogApi.js +64 -0
- package/lib/cjs/InteractionCatalogApi.js.map +1 -0
- package/lib/cjs/InteractionOutput.js +300 -0
- package/lib/cjs/InteractionOutput.js.map +1 -0
- package/lib/cjs/InteractionResult.example.js +57 -0
- package/lib/cjs/InteractionResult.example.js.map +1 -0
- package/lib/cjs/InteractionsApi.js +262 -0
- package/lib/cjs/InteractionsApi.js.map +1 -0
- package/lib/cjs/MCPOAuthApi.js +62 -0
- package/lib/cjs/MCPOAuthApi.js.map +1 -0
- package/lib/cjs/ProjectsApi.js +72 -0
- package/lib/cjs/ProjectsApi.js.map +1 -0
- package/lib/cjs/PromptsApi.js +133 -0
- package/lib/cjs/PromptsApi.js.map +1 -0
- package/lib/cjs/RefsApi.js +14 -0
- package/lib/cjs/RefsApi.js.map +1 -0
- package/lib/cjs/RunsApi.js +113 -0
- package/lib/cjs/RunsApi.js.map +1 -0
- package/lib/cjs/SkillsApi.js +39 -0
- package/lib/cjs/SkillsApi.js.map +1 -0
- package/lib/cjs/StreamSource.js +17 -0
- package/lib/cjs/StreamSource.js.map +1 -0
- package/lib/cjs/TrainingApi.js +54 -0
- package/lib/cjs/TrainingApi.js.map +1 -0
- package/lib/cjs/UsersApi.js +13 -0
- package/lib/cjs/UsersApi.js.map +1 -0
- package/lib/cjs/client.js +360 -0
- package/lib/cjs/client.js.map +1 -0
- package/lib/cjs/execute.js +158 -0
- package/lib/cjs/execute.js.map +1 -0
- package/lib/cjs/index.js +22 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/nodejs/NodeStreamSource.js +45 -0
- package/lib/cjs/nodejs/NodeStreamSource.js.map +1 -0
- package/lib/cjs/nodejs/index.js +18 -0
- package/lib/cjs/nodejs/index.js.map +1 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/store/AnalyzeDocApi.js +56 -0
- package/lib/cjs/store/AnalyzeDocApi.js.map +1 -0
- package/lib/cjs/store/CollectionsApi.js +131 -0
- package/lib/cjs/store/CollectionsApi.js.map +1 -0
- package/lib/cjs/store/CommandsApi.js +17 -0
- package/lib/cjs/store/CommandsApi.js.map +1 -0
- package/lib/cjs/store/DashboardApi.js +182 -0
- package/lib/cjs/store/DashboardApi.js.map +1 -0
- package/lib/cjs/store/DataApi.js +433 -0
- package/lib/cjs/store/DataApi.js.map +1 -0
- package/lib/cjs/store/EmailApi.js +103 -0
- package/lib/cjs/store/EmailApi.js.map +1 -0
- package/lib/cjs/store/EmbeddingsApi.js +29 -0
- package/lib/cjs/store/EmbeddingsApi.js.map +1 -0
- package/lib/cjs/store/FilesApi.js +237 -0
- package/lib/cjs/store/FilesApi.js.map +1 -0
- package/lib/cjs/store/ObjectsApi.js +314 -0
- package/lib/cjs/store/ObjectsApi.js.map +1 -0
- package/lib/cjs/store/PendingAsksApi.js +43 -0
- package/lib/cjs/store/PendingAsksApi.js.map +1 -0
- package/lib/cjs/store/SchedulesApi.js +103 -0
- package/lib/cjs/store/SchedulesApi.js.map +1 -0
- package/lib/cjs/store/ToolsApi.js +21 -0
- package/lib/cjs/store/ToolsApi.js.map +1 -0
- package/lib/cjs/store/TypesApi.js +57 -0
- package/lib/cjs/store/TypesApi.js.map +1 -0
- package/lib/cjs/store/WorkersApi.js +16 -0
- package/lib/cjs/store/WorkersApi.js.map +1 -0
- package/lib/cjs/store/WorkflowsApi.js +596 -0
- package/lib/cjs/store/WorkflowsApi.js.map +1 -0
- package/lib/cjs/store/client.js +81 -0
- package/lib/cjs/store/client.js.map +1 -0
- package/lib/cjs/store/errors.js +11 -0
- package/lib/cjs/store/errors.js.map +1 -0
- package/lib/cjs/store/index.js +27 -0
- package/lib/cjs/store/index.js.map +1 -0
- package/lib/cjs/store/version.js +6 -0
- package/lib/cjs/store/version.js.map +1 -0
- package/lib/esm/AccountApi.js +82 -0
- package/lib/esm/AccountApi.js.map +1 -0
- package/lib/esm/AccountsApi.js +13 -0
- package/lib/esm/AccountsApi.js.map +1 -0
- package/lib/esm/AnalyticsApi.js +38 -0
- package/lib/esm/AnalyticsApi.js.map +1 -0
- package/lib/esm/ApiKeysApi.js +59 -0
- package/lib/esm/ApiKeysApi.js.map +1 -0
- package/lib/esm/AppsApi.js +116 -0
- package/lib/esm/AppsApi.js.map +1 -0
- package/lib/esm/CommandsApi.js +16 -0
- package/lib/esm/CommandsApi.js.map +1 -0
- package/lib/esm/EnvironmentsApi.js +69 -0
- package/lib/esm/EnvironmentsApi.js.map +1 -0
- package/lib/esm/GroupsApi.js +74 -0
- package/lib/esm/GroupsApi.js.map +1 -0
- package/lib/esm/IamApi.js +47 -0
- package/lib/esm/IamApi.js.map +1 -0
- package/lib/esm/InteractionBase.js +40 -0
- package/lib/esm/InteractionBase.js.map +1 -0
- package/lib/esm/InteractionCatalogApi.js +60 -0
- package/lib/esm/InteractionCatalogApi.js.map +1 -0
- package/lib/esm/InteractionOutput.js +293 -0
- package/lib/esm/InteractionOutput.js.map +1 -0
- package/lib/esm/InteractionResult.example.js +55 -0
- package/lib/esm/InteractionResult.example.js.map +1 -0
- package/lib/esm/InteractionsApi.js +259 -0
- package/lib/esm/InteractionsApi.js.map +1 -0
- package/lib/esm/MCPOAuthApi.js +59 -0
- package/lib/esm/MCPOAuthApi.js.map +1 -0
- package/lib/esm/ProjectsApi.js +69 -0
- package/lib/esm/ProjectsApi.js.map +1 -0
- package/lib/esm/PromptsApi.js +130 -0
- package/lib/esm/PromptsApi.js.map +1 -0
- package/lib/esm/RefsApi.js +10 -0
- package/lib/esm/RefsApi.js.map +1 -0
- package/lib/esm/RunsApi.js +109 -0
- package/lib/esm/RunsApi.js.map +1 -0
- package/lib/esm/SkillsApi.js +36 -0
- package/lib/esm/SkillsApi.js.map +1 -0
- package/lib/esm/StreamSource.js +13 -0
- package/lib/esm/StreamSource.js.map +1 -0
- package/lib/esm/TrainingApi.js +51 -0
- package/lib/esm/TrainingApi.js.map +1 -0
- package/lib/esm/UsersApi.js +10 -0
- package/lib/esm/UsersApi.js.map +1 -0
- package/lib/esm/client.js +351 -0
- package/lib/esm/client.js.map +1 -0
- package/lib/esm/execute.js +118 -0
- package/lib/esm/execute.js.map +1 -0
- package/lib/esm/index.js +6 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/nodejs/NodeStreamSource.js +41 -0
- package/lib/esm/nodejs/NodeStreamSource.js.map +1 -0
- package/lib/esm/nodejs/index.js +2 -0
- package/lib/esm/nodejs/index.js.map +1 -0
- package/lib/esm/store/AnalyzeDocApi.js +52 -0
- package/lib/esm/store/AnalyzeDocApi.js.map +1 -0
- package/lib/esm/store/CollectionsApi.js +127 -0
- package/lib/esm/store/CollectionsApi.js.map +1 -0
- package/lib/esm/store/CommandsApi.js +13 -0
- package/lib/esm/store/CommandsApi.js.map +1 -0
- package/lib/esm/store/DashboardApi.js +178 -0
- package/lib/esm/store/DashboardApi.js.map +1 -0
- package/lib/esm/store/DataApi.js +429 -0
- package/lib/esm/store/DataApi.js.map +1 -0
- package/lib/esm/store/EmailApi.js +99 -0
- package/lib/esm/store/EmailApi.js.map +1 -0
- package/lib/esm/store/EmbeddingsApi.js +25 -0
- package/lib/esm/store/EmbeddingsApi.js.map +1 -0
- package/lib/esm/store/FilesApi.js +231 -0
- package/lib/esm/store/FilesApi.js.map +1 -0
- package/lib/esm/store/ObjectsApi.js +309 -0
- package/lib/esm/store/ObjectsApi.js.map +1 -0
- package/lib/esm/store/PendingAsksApi.js +39 -0
- package/lib/esm/store/PendingAsksApi.js.map +1 -0
- package/lib/esm/store/SchedulesApi.js +99 -0
- package/lib/esm/store/SchedulesApi.js.map +1 -0
- package/lib/esm/store/ToolsApi.js +17 -0
- package/lib/esm/store/ToolsApi.js.map +1 -0
- package/lib/esm/store/TypesApi.js +53 -0
- package/lib/esm/store/TypesApi.js.map +1 -0
- package/lib/esm/store/WorkersApi.js +12 -0
- package/lib/esm/store/WorkersApi.js.map +1 -0
- package/lib/esm/store/WorkflowsApi.js +590 -0
- package/lib/esm/store/WorkflowsApi.js.map +1 -0
- package/lib/esm/store/client.js +77 -0
- package/lib/esm/store/client.js.map +1 -0
- package/lib/esm/store/errors.js +7 -0
- package/lib/esm/store/errors.js.map +1 -0
- package/lib/esm/store/index.js +11 -0
- package/lib/esm/store/index.js.map +1 -0
- package/lib/esm/store/version.js +3 -0
- package/lib/esm/store/version.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types/AccountApi.d.ts +59 -0
- package/lib/types/AccountApi.d.ts.map +1 -0
- package/lib/types/AccountsApi.d.ts +7 -0
- package/lib/types/AccountsApi.d.ts.map +1 -0
- package/lib/types/AnalyticsApi.d.ts +11 -0
- package/lib/types/AnalyticsApi.d.ts.map +1 -0
- package/lib/types/ApiKeysApi.d.ts +42 -0
- package/lib/types/ApiKeysApi.d.ts.map +1 -0
- package/lib/types/AppsApi.d.ts +65 -0
- package/lib/types/AppsApi.d.ts.map +1 -0
- package/lib/types/CommandsApi.d.ts +10 -0
- package/lib/types/CommandsApi.d.ts.map +1 -0
- package/lib/types/EnvironmentsApi.d.ts +40 -0
- package/lib/types/EnvironmentsApi.d.ts.map +1 -0
- package/lib/types/GroupsApi.d.ts +65 -0
- package/lib/types/GroupsApi.d.ts.map +1 -0
- package/lib/types/IamApi.d.ts +41 -0
- package/lib/types/IamApi.d.ts.map +1 -0
- package/lib/types/InteractionBase.d.ts +22 -0
- package/lib/types/InteractionBase.d.ts.map +1 -0
- package/lib/types/InteractionCatalogApi.d.ts +36 -0
- package/lib/types/InteractionCatalogApi.d.ts.map +1 -0
- package/lib/types/InteractionOutput.d.ts +174 -0
- package/lib/types/InteractionOutput.d.ts.map +1 -0
- package/lib/types/InteractionResult.example.d.ts +6 -0
- package/lib/types/InteractionResult.example.d.ts.map +1 -0
- package/lib/types/InteractionsApi.d.ts +183 -0
- package/lib/types/InteractionsApi.d.ts.map +1 -0
- package/lib/types/MCPOAuthApi.d.ts +45 -0
- package/lib/types/MCPOAuthApi.d.ts.map +1 -0
- package/lib/types/ProjectsApi.d.ts +28 -0
- package/lib/types/ProjectsApi.d.ts.map +1 -0
- package/lib/types/PromptsApi.d.ts +106 -0
- package/lib/types/PromptsApi.d.ts.map +1 -0
- package/lib/types/RefsApi.d.ts +6 -0
- package/lib/types/RefsApi.d.ts.map +1 -0
- package/lib/types/RunsApi.d.ts +79 -0
- package/lib/types/RunsApi.d.ts.map +1 -0
- package/lib/types/SkillsApi.d.ts +26 -0
- package/lib/types/SkillsApi.d.ts.map +1 -0
- package/lib/types/StreamSource.d.ts +7 -0
- package/lib/types/StreamSource.d.ts.map +1 -0
- package/lib/types/TrainingApi.d.ts +27 -0
- package/lib/types/TrainingApi.d.ts.map +1 -0
- package/lib/types/UsersApi.d.ts +6 -0
- package/lib/types/UsersApi.d.ts.map +1 -0
- package/lib/types/client.d.ts +136 -0
- package/lib/types/client.d.ts.map +1 -0
- package/lib/types/execute.d.ts +37 -0
- package/lib/types/execute.d.ts.map +1 -0
- package/lib/types/index.d.ts +10 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/nodejs/NodeStreamSource.d.ts +9 -0
- package/lib/types/nodejs/NodeStreamSource.d.ts.map +1 -0
- package/lib/types/nodejs/index.d.ts +1 -0
- package/lib/types/nodejs/index.d.ts.map +1 -0
- package/lib/types/store/AnalyzeDocApi.d.ts +17 -0
- package/lib/types/store/AnalyzeDocApi.d.ts.map +1 -0
- package/lib/types/store/CollectionsApi.d.ts +82 -0
- package/lib/types/store/CollectionsApi.d.ts.map +1 -0
- package/lib/types/store/CommandsApi.d.ts +10 -0
- package/lib/types/store/CommandsApi.d.ts.map +1 -0
- package/lib/types/store/DashboardApi.d.ts +149 -0
- package/lib/types/store/DashboardApi.d.ts.map +1 -0
- package/lib/types/store/DataApi.d.ts +392 -0
- package/lib/types/store/DataApi.d.ts.map +1 -0
- package/lib/types/store/EmailApi.d.ts +185 -0
- package/lib/types/store/EmailApi.d.ts.map +1 -0
- package/lib/types/store/EmbeddingsApi.d.ts +12 -0
- package/lib/types/store/EmbeddingsApi.d.ts.map +1 -0
- package/lib/types/store/FilesApi.d.ts +110 -0
- package/lib/types/store/FilesApi.d.ts.map +1 -0
- package/lib/types/store/ObjectsApi.d.ts +139 -0
- package/lib/types/store/ObjectsApi.d.ts.map +1 -0
- package/lib/types/store/PendingAsksApi.d.ts +79 -0
- package/lib/types/store/PendingAsksApi.d.ts.map +1 -0
- package/lib/types/store/SchedulesApi.d.ts +89 -0
- package/lib/types/store/SchedulesApi.d.ts.map +1 -0
- package/lib/types/store/ToolsApi.d.ts +13 -0
- package/lib/types/store/ToolsApi.d.ts.map +1 -0
- package/lib/types/store/TypesApi.d.ts +23 -0
- package/lib/types/store/TypesApi.d.ts.map +1 -0
- package/lib/types/store/WorkersApi.d.ts +6 -0
- package/lib/types/store/WorkersApi.d.ts.map +1 -0
- package/lib/types/store/WorkflowsApi.d.ts +167 -0
- package/lib/types/store/WorkflowsApi.d.ts.map +1 -0
- package/lib/types/store/client.d.ts +45 -0
- package/lib/types/store/client.d.ts.map +1 -0
- package/lib/types/store/errors.d.ts +4 -0
- package/lib/types/store/errors.d.ts.map +1 -0
- package/lib/types/store/index.d.ts +10 -0
- package/lib/types/store/index.d.ts.map +1 -0
- package/lib/types/store/version.d.ts +2 -0
- package/lib/types/store/version.d.ts.map +1 -0
- package/lib/vertesia-client.js +2 -0
- package/lib/vertesia-client.js.map +1 -0
- package/package.json +71 -0
- package/src/AccountApi.ts +96 -0
- package/src/AccountsApi.ts +22 -0
- package/src/AnalyticsApi.ts +36 -0
- package/src/ApiKeysApi.ts +67 -0
- package/src/AppsApi.ts +134 -0
- package/src/CommandsApi.ts +23 -0
- package/src/EnvironmentsApi.ts +94 -0
- package/src/GroupsApi.ts +92 -0
- package/src/IamApi.ts +70 -0
- package/src/InteractionBase.ts +44 -0
- package/src/InteractionCatalogApi.ts +72 -0
- package/src/InteractionOutput.test.ts +305 -0
- package/src/InteractionOutput.ts +328 -0
- package/src/InteractionResult.example.ts +72 -0
- package/src/InteractionsApi.ts +308 -0
- package/src/MCPOAuthApi.ts +67 -0
- package/src/ProjectsApi.ts +85 -0
- package/src/PromptsApi.ts +160 -0
- package/src/RefsApi.ts +18 -0
- package/src/RunsApi.ts +151 -0
- package/src/SkillsApi.ts +46 -0
- package/src/StreamSource.ts +3 -0
- package/src/TrainingApi.ts +71 -0
- package/src/UsersApi.ts +18 -0
- package/src/client.test.ts +99 -0
- package/src/client.ts +419 -0
- package/src/execute.ts +126 -0
- package/src/index.ts +10 -0
- package/src/nodejs/NodeStreamSource.ts +43 -0
- package/src/nodejs/index.ts +1 -0
- package/src/store/AnalyzeDocApi.ts +61 -0
- package/src/store/CollectionsApi.ts +166 -0
- package/src/store/CommandsApi.ts +15 -0
- package/src/store/DashboardApi.ts +216 -0
- package/src/store/DataApi.ts +516 -0
- package/src/store/EmailApi.ts +211 -0
- package/src/store/EmbeddingsApi.ts +39 -0
- package/src/store/FilesApi.ts +288 -0
- package/src/store/ObjectsApi.ts +432 -0
- package/src/store/PendingAsksApi.ts +98 -0
- package/src/store/SchedulesApi.ts +114 -0
- package/src/store/ToolsApi.ts +19 -0
- package/src/store/TypesApi.ts +65 -0
- package/src/store/WorkersApi.ts +17 -0
- package/src/store/WorkflowsApi.ts +752 -0
- package/src/store/client.ts +95 -0
- package/src/store/errors.ts +7 -0
- package/src/store/index.ts +11 -0
- package/src/store/version.ts +2 -0
- package/tsconfig.dist.json +20 -0
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { EmailRouteData } from "@vertesia/common";
|
|
3
|
+
/**
|
|
4
|
+
* Request payload for sending an email via the agent.
|
|
5
|
+
* Resend configuration is fetched from project settings.
|
|
6
|
+
* From address is constructed as: {project_namespace}+{agent_name}@{email_domain}
|
|
7
|
+
*/
|
|
8
|
+
export interface SendEmailRequest {
|
|
9
|
+
/** Email address to send to */
|
|
10
|
+
to_email: string;
|
|
11
|
+
/** Email subject */
|
|
12
|
+
subject: string;
|
|
13
|
+
/** Email body in markdown format */
|
|
14
|
+
body: string;
|
|
15
|
+
/** Agent/interaction endpoint name (used in from address) */
|
|
16
|
+
agent_name: string;
|
|
17
|
+
/** Display name for the sender (overrides project default) */
|
|
18
|
+
from_name?: string;
|
|
19
|
+
/** Workflow run ID for routing replies */
|
|
20
|
+
run_id: string;
|
|
21
|
+
/** Existing route key (for subsequent emails in same conversation) */
|
|
22
|
+
route_key?: string;
|
|
23
|
+
/** Message ID for In-Reply-To header (email threading) */
|
|
24
|
+
in_reply_to?: string;
|
|
25
|
+
/** Chain of message IDs for References header */
|
|
26
|
+
references?: string[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Response from sending an email.
|
|
30
|
+
*/
|
|
31
|
+
export interface SendEmailResponse {
|
|
32
|
+
success: boolean;
|
|
33
|
+
/** Resend email ID */
|
|
34
|
+
email_id?: string;
|
|
35
|
+
/** Message-ID header for threading */
|
|
36
|
+
message_id?: string;
|
|
37
|
+
/** Short route key for reply routing */
|
|
38
|
+
route_key?: string;
|
|
39
|
+
/** Error message if failed */
|
|
40
|
+
error?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Response from creating an email route.
|
|
44
|
+
*/
|
|
45
|
+
export interface CreateRouteResponse {
|
|
46
|
+
/** The generated route key (8-char alphanumeric) */
|
|
47
|
+
route_key: string;
|
|
48
|
+
/** Full reply-to address: r+{route_key}@{email_domain} */
|
|
49
|
+
reply_to: string;
|
|
50
|
+
/** The email domain for sending and receiving */
|
|
51
|
+
email_domain: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Request to forward an email to a workflow.
|
|
55
|
+
* Used by external services that handle email reception themselves.
|
|
56
|
+
*/
|
|
57
|
+
export interface ForwardEmailRequest {
|
|
58
|
+
/** Email content received by the external service */
|
|
59
|
+
email: {
|
|
60
|
+
/** Sender email address */
|
|
61
|
+
from: string;
|
|
62
|
+
/** Email subject */
|
|
63
|
+
subject?: string;
|
|
64
|
+
/** Plain text body */
|
|
65
|
+
text: string;
|
|
66
|
+
/** HTML body (optional) */
|
|
67
|
+
html?: string;
|
|
68
|
+
/** Message-ID header for threading */
|
|
69
|
+
message_id?: string;
|
|
70
|
+
};
|
|
71
|
+
/** Custom context data from the external service (e.g., auth tokens, user IDs) */
|
|
72
|
+
context?: Record<string, unknown>;
|
|
73
|
+
/** Attachments with download URLs */
|
|
74
|
+
attachments?: Array<{
|
|
75
|
+
filename: string;
|
|
76
|
+
content_type: string;
|
|
77
|
+
size: number;
|
|
78
|
+
download_url: string;
|
|
79
|
+
}>;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Response from forwarding an email.
|
|
83
|
+
*/
|
|
84
|
+
export interface ForwardEmailResponse {
|
|
85
|
+
success: boolean;
|
|
86
|
+
run_id: string;
|
|
87
|
+
workflow_id: string;
|
|
88
|
+
route_key: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Request to create an email route.
|
|
92
|
+
*/
|
|
93
|
+
export interface CreateRouteRequest {
|
|
94
|
+
/** Workflow run ID for routing replies */
|
|
95
|
+
run_id: string;
|
|
96
|
+
/** Email address of the user (for context) */
|
|
97
|
+
user_email: string;
|
|
98
|
+
/** Subject of the email thread (optional) */
|
|
99
|
+
thread_subject?: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Email API for sending emails from workflows.
|
|
103
|
+
*/
|
|
104
|
+
export declare class EmailApi extends ApiTopic {
|
|
105
|
+
constructor(parent: ClientBase);
|
|
106
|
+
/**
|
|
107
|
+
* Send an email from an agent/workflow.
|
|
108
|
+
* Creates a route key if not provided, sends via Resend, and returns routing info.
|
|
109
|
+
*/
|
|
110
|
+
send(request: SendEmailRequest): Promise<SendEmailResponse>;
|
|
111
|
+
/**
|
|
112
|
+
* Resolve a route key to get email context.
|
|
113
|
+
* Used by webhook handler to look up workflow info from reply email.
|
|
114
|
+
* @deprecated Use getRoute() instead
|
|
115
|
+
*/
|
|
116
|
+
resolveRoute(routeKey: string): Promise<EmailRouteData>;
|
|
117
|
+
/**
|
|
118
|
+
* Create a new email route without sending an email.
|
|
119
|
+
* Useful for external services that want to handle email sending themselves
|
|
120
|
+
* but need reply routing back to Vertesia workflows.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* const { route_key, reply_to } = await client.store.email.createRoute({
|
|
125
|
+
* run_id: workflowRunId,
|
|
126
|
+
* user_email: "user@example.com",
|
|
127
|
+
* thread_subject: "Contract Review"
|
|
128
|
+
* });
|
|
129
|
+
* // Use reply_to as the Reply-To header when sending your own email
|
|
130
|
+
* // Replies will be routed back to the workflow
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
createRoute(request: CreateRouteRequest): Promise<CreateRouteResponse>;
|
|
134
|
+
/**
|
|
135
|
+
* Get an email route by key.
|
|
136
|
+
*/
|
|
137
|
+
getRoute(routeKey: string): Promise<EmailRouteData & {
|
|
138
|
+
route_key: string;
|
|
139
|
+
}>;
|
|
140
|
+
/**
|
|
141
|
+
* Update an email route (e.g., to update threading info).
|
|
142
|
+
*/
|
|
143
|
+
updateRoute(routeKey: string, updates: Partial<EmailRouteData>): Promise<{
|
|
144
|
+
success: boolean;
|
|
145
|
+
route_key: string;
|
|
146
|
+
}>;
|
|
147
|
+
/**
|
|
148
|
+
* Forward an email to a workflow via route key.
|
|
149
|
+
*
|
|
150
|
+
* Use this when your service receives an email reply and needs to forward
|
|
151
|
+
* it to the Vertesia workflow. You can add custom context data (like auth
|
|
152
|
+
* tokens or user IDs) that will be merged into `payload.vars.data`.
|
|
153
|
+
*
|
|
154
|
+
* **Important**: Use camelCase keys in context to match the agent start
|
|
155
|
+
* pattern. This ensures tools work identically whether the agent was
|
|
156
|
+
* started directly or received an email reply.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```ts
|
|
160
|
+
* // In your email webhook handler:
|
|
161
|
+
* const result = await client.store.email.forwardEmail(routeKey, {
|
|
162
|
+
* email: {
|
|
163
|
+
* from: inboundEmail.from,
|
|
164
|
+
* subject: inboundEmail.subject,
|
|
165
|
+
* text: inboundEmail.text,
|
|
166
|
+
* message_id: inboundEmail.messageId,
|
|
167
|
+
* },
|
|
168
|
+
* context: {
|
|
169
|
+
* // Use camelCase - merged into payload.vars.data
|
|
170
|
+
* apiKey: generateServiceToken(),
|
|
171
|
+
* tenantId: resolvedUser.tenantId,
|
|
172
|
+
* userId: resolvedUser.id,
|
|
173
|
+
* userEmail: resolvedUser.email,
|
|
174
|
+
* },
|
|
175
|
+
* attachments: inboundEmail.attachments?.map(att => ({
|
|
176
|
+
* filename: att.filename,
|
|
177
|
+
* content_type: att.contentType,
|
|
178
|
+
* size: att.size,
|
|
179
|
+
* download_url: att.url,
|
|
180
|
+
* })),
|
|
181
|
+
* });
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
forwardEmail(routeKey: string, request: ForwardEmailRequest): Promise<ForwardEmailResponse>;
|
|
185
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmailApi.d.ts","sourceRoot":"","sources":["../../../src/store/EmailApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sCAAsC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,QA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OAAO,CAAC,cAAc,CAAC;IAQvD;;;;;;;;;;;;;;;OAeG;IACH,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAItE;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAI3E;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAIjH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAG9F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { EmbeddingsStatusResponse, GenericCommandResponse, ProjectConfigurationEmbeddings, SupportedEmbeddingTypes } from "@vertesia/common";
|
|
3
|
+
/**
|
|
4
|
+
* @since 0.52.0
|
|
5
|
+
*/
|
|
6
|
+
export declare class EmbeddingsApi extends ApiTopic {
|
|
7
|
+
constructor(parent: ClientBase, basePath?: string);
|
|
8
|
+
status(type: SupportedEmbeddingTypes): Promise<EmbeddingsStatusResponse>;
|
|
9
|
+
activate(type: SupportedEmbeddingTypes, config: Partial<ProjectConfigurationEmbeddings>): Promise<GenericCommandResponse>;
|
|
10
|
+
disable(type: SupportedEmbeddingTypes): Promise<GenericCommandResponse>;
|
|
11
|
+
recalculate(type: SupportedEmbeddingTypes): Promise<GenericCommandResponse>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmbeddingsApi.d.ts","sourceRoot":"","sources":["../../../src/store/EmbeddingsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACH,wBAAwB,EACxB,sBAAsB,EACtB,8BAA8B,EAC9B,uBAAuB,EAC1B,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,qBAAa,aAAc,SAAQ,QAAQ;gBAE3B,MAAM,EAAE,UAAU,EAAE,QAAQ,GAAE,MAA6B;IAIjE,MAAM,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAIxE,QAAQ,CAAC,IAAI,EAAE,uBAAuB,EAAE,MAAM,EAAE,OAAO,CAAC,8BAA8B,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC;IASzH,OAAO,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAIvE,WAAW,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAIpF"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { GetFileUrlPayload, GetFileUrlResponse, GetUploadUrlPayload } from "@vertesia/common";
|
|
3
|
+
import { StreamSource } from "../StreamSource.js";
|
|
4
|
+
export declare const MEMORIES_PREFIX = "memories";
|
|
5
|
+
export declare const ARTIFACTS_PREFIX = "agents";
|
|
6
|
+
export declare function getMemoryFilePath(name: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Build the storage path for an agent artifact
|
|
9
|
+
* @param runId - The workflow run ID
|
|
10
|
+
* @param name - The artifact filename
|
|
11
|
+
*/
|
|
12
|
+
export declare function getAgentArtifactPath(runId: string, name: string): string;
|
|
13
|
+
export declare class FilesApi extends ApiTopic {
|
|
14
|
+
constructor(parent: ClientBase);
|
|
15
|
+
deleteFile(path: string, prefix?: boolean): Promise<void | number>;
|
|
16
|
+
/**
|
|
17
|
+
* get the metadata of a blob given its URI. Supported URI are:
|
|
18
|
+
* starting with s3:// and gs://.
|
|
19
|
+
* For s3 blobs use #region to specify the region. Ex: s3://bucket/key#us-west-2
|
|
20
|
+
* @param uri
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
getMetadata(uri: string): Promise<{
|
|
24
|
+
name: string;
|
|
25
|
+
size: number;
|
|
26
|
+
contentType: string;
|
|
27
|
+
contentDisposition?: string;
|
|
28
|
+
etag?: string;
|
|
29
|
+
customMetadata?: Record<string, string>;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* Set custom metadata on a file
|
|
33
|
+
* @param file - The file path or URI
|
|
34
|
+
* @param metadata - Custom metadata key-value pairs
|
|
35
|
+
* @returns Success status
|
|
36
|
+
*/
|
|
37
|
+
setFileMetadata(file: string, metadata: Record<string, string>): Promise<{
|
|
38
|
+
success: boolean;
|
|
39
|
+
file: string;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Get or create a bucket for the project. If the bucket already exists, it does nothing.
|
|
43
|
+
* The bucket URI is returned.
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
getOrCreateBucket(): Promise<{
|
|
47
|
+
bucket: string;
|
|
48
|
+
}>;
|
|
49
|
+
getUploadUrl(payload: GetUploadUrlPayload): Promise<GetFileUrlResponse>;
|
|
50
|
+
getDownloadUrl(file: string, name?: string, disposition?: "inline" | "attachment"): Promise<GetFileUrlResponse>;
|
|
51
|
+
getDownloadUrlWithOptions(payload: GetFileUrlPayload): Promise<GetFileUrlResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* Upload content to a file and return the full path (including bucket name) of the uploaded file
|
|
54
|
+
* @param source
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
uploadFile(source: StreamSource | File): Promise<string>;
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @param location can be a relative path in the project, a reference to a cloud storage, or a accessible HTTPS URL (typically signed URL)
|
|
61
|
+
* @returns ReadableStream
|
|
62
|
+
*/
|
|
63
|
+
downloadFile(location: string): Promise<ReadableStream<Uint8Array<ArrayBuffer>>>;
|
|
64
|
+
/**
|
|
65
|
+
* Copy a file to a new destination within the same bucket.
|
|
66
|
+
* @param source - Source file path (relative to project bucket)
|
|
67
|
+
* @param dest - Destination file path (relative to project bucket)
|
|
68
|
+
* @returns The destination file URI
|
|
69
|
+
*/
|
|
70
|
+
copyFile(source: string, dest: string): Promise<string>;
|
|
71
|
+
uploadMemoryPack(source: StreamSource | File): Promise<string>;
|
|
72
|
+
downloadMemoryPack(name: string, gunzip?: boolean): Promise<ReadableStream<Uint8Array>>;
|
|
73
|
+
/**
|
|
74
|
+
* List files by prefix
|
|
75
|
+
* @param prefix - Path prefix to filter files
|
|
76
|
+
* @returns Array of file paths matching the prefix
|
|
77
|
+
*/
|
|
78
|
+
listByPrefix(prefix: string): Promise<{
|
|
79
|
+
files: string[];
|
|
80
|
+
}>;
|
|
81
|
+
/**
|
|
82
|
+
* Upload an artifact for an agent run
|
|
83
|
+
* @param runId - The workflow run ID
|
|
84
|
+
* @param name - Artifact name (e.g., "output.json")
|
|
85
|
+
* @param source - File content source
|
|
86
|
+
* @returns The full path of the uploaded artifact
|
|
87
|
+
*/
|
|
88
|
+
uploadArtifact(runId: string, name: string, source: StreamSource | File): Promise<string>;
|
|
89
|
+
/**
|
|
90
|
+
* Download an artifact from an agent run
|
|
91
|
+
* @param runId - The workflow run ID
|
|
92
|
+
* @param name - Artifact name
|
|
93
|
+
* @returns ReadableStream of the artifact content
|
|
94
|
+
*/
|
|
95
|
+
downloadArtifact(runId: string, name: string): Promise<ReadableStream<Uint8Array>>;
|
|
96
|
+
/**
|
|
97
|
+
* Get download URL for an artifact
|
|
98
|
+
* @param runId - The workflow run ID
|
|
99
|
+
* @param name - Artifact name
|
|
100
|
+
* @param disposition - Content disposition (inline or attachment)
|
|
101
|
+
* @returns Signed URL response
|
|
102
|
+
*/
|
|
103
|
+
getArtifactDownloadUrl(runId: string, name: string, disposition?: "inline" | "attachment"): Promise<GetFileUrlResponse>;
|
|
104
|
+
/**
|
|
105
|
+
* List artifacts for an agent run
|
|
106
|
+
* @param runId - The workflow run ID
|
|
107
|
+
* @returns Array of artifact file paths
|
|
108
|
+
*/
|
|
109
|
+
listArtifacts(runId: string): Promise<string[]>;
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilesApi.d.ts","sourceRoot":"","sources":["../../../src/store/FilesApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACH,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EAEtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,eAAO,MAAM,eAAe,aAAa,CAAC;AAC1C,eAAO,MAAM,gBAAgB,WAAW,CAAC;AAEzC,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,UAG7C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,qBAAa,QAAS,SAAQ,QAAQ;gBACtB,MAAM,EAAE,UAAU;IAIxB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,CAAC;IAKxE;;;;;;OAMG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAC9B,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,cAAc,CAAC,EAAE,MAAM,CAA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AM,EAAE,CAAA;KAAE,CAAC;IAI1D;;;;;;OAMG;IACG,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;IAc/F;;;;;OAKG;IACG,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAKxF;;;;;;OAMG;IACH,sBAAsB,CAClB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,WAAW,CAAC,EAAE,QAAQ,GAAG,YAAY,GACtC,OAAO,CAAC,kBAAkB,CAAC;IAK9B;;;;OAIG;IACG,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAKxD"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { canGenerateRendition, ComplexSearchPayload, ComputeObjectFacetPayload, ContentObject, ContentObjectItem, ContentObjectProcessingPriority, ContentSource, CreateContentObjectPayload, Embedding, ExportPropertiesPayload, ExportPropertiesResponse, FindPayload, GetFileUrlPayload, GetFileUrlResponse, GetRenditionParams, GetRenditionResponse, getSupportedRenditionFormats, GetUploadUrlPayload, ListWorkflowRunsResponse, ObjectSearchPayload, SupportedEmbeddingTypes, supportsVisualRendition } from "@vertesia/common";
|
|
3
|
+
export { canGenerateRendition, getSupportedRenditionFormats, supportsVisualRendition };
|
|
4
|
+
import { StreamSource } from "../StreamSource.js";
|
|
5
|
+
import { AnalyzeDocApi } from "./AnalyzeDocApi.js";
|
|
6
|
+
export interface ComputeFacetsResponse {
|
|
7
|
+
type?: {
|
|
8
|
+
_id: string;
|
|
9
|
+
count: number;
|
|
10
|
+
}[];
|
|
11
|
+
location?: {
|
|
12
|
+
_id: string;
|
|
13
|
+
count: number;
|
|
14
|
+
}[];
|
|
15
|
+
status?: {
|
|
16
|
+
_id: string;
|
|
17
|
+
count: number;
|
|
18
|
+
}[];
|
|
19
|
+
total?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface SearchResponse {
|
|
22
|
+
results: ContentObjectItem[];
|
|
23
|
+
facets: ComputeFacetsResponse;
|
|
24
|
+
}
|
|
25
|
+
export declare class ObjectsApi extends ApiTopic {
|
|
26
|
+
constructor(parent: ClientBase);
|
|
27
|
+
analyze(objectId: string): AnalyzeDocApi;
|
|
28
|
+
getUploadUrl(payload: GetUploadUrlPayload): Promise<GetFileUrlResponse>;
|
|
29
|
+
getDownloadUrl(fileUri: string, name?: string, disposition?: "inline" | "attachment"): Promise<{
|
|
30
|
+
url: string;
|
|
31
|
+
}>;
|
|
32
|
+
getDownloadUrlWithOptions(payload: GetFileUrlPayload): Promise<{
|
|
33
|
+
url: string;
|
|
34
|
+
}>;
|
|
35
|
+
getContentSource(objectId: string): Promise<ContentSource>;
|
|
36
|
+
/**
|
|
37
|
+
* List objects with revision filtering options
|
|
38
|
+
*
|
|
39
|
+
* @param payload Search/filter parameters
|
|
40
|
+
* @returns Matching content objects
|
|
41
|
+
*/
|
|
42
|
+
list<T = any>(payload?: ObjectSearchPayload): Promise<ContentObjectItem<T>[]>;
|
|
43
|
+
computeFacets(query: ComputeObjectFacetPayload): Promise<ComputeFacetsResponse>;
|
|
44
|
+
listFolders(path?: string): void;
|
|
45
|
+
/** Find object based on query */
|
|
46
|
+
find(payload: FindPayload): Promise<ContentObject[]>;
|
|
47
|
+
/** Count number of objects matching this query */
|
|
48
|
+
count(payload: FindPayload): Promise<{
|
|
49
|
+
count: number;
|
|
50
|
+
}>;
|
|
51
|
+
/** Search object — different from find because allow full text search */
|
|
52
|
+
search(payload: ComplexSearchPayload): Promise<SearchResponse>;
|
|
53
|
+
retrieve(id: string, select?: string): Promise<ContentObject>;
|
|
54
|
+
getObjectText(id: string): Promise<{
|
|
55
|
+
text: string;
|
|
56
|
+
}>;
|
|
57
|
+
upload(source: StreamSource | File): Promise<{
|
|
58
|
+
source: string;
|
|
59
|
+
name: string;
|
|
60
|
+
type: string;
|
|
61
|
+
etag: string | undefined;
|
|
62
|
+
}>;
|
|
63
|
+
create(payload: CreateContentObjectPayload, options?: {
|
|
64
|
+
collection_id?: string;
|
|
65
|
+
processing_priority?: ContentObjectProcessingPriority;
|
|
66
|
+
}): Promise<ContentObject>;
|
|
67
|
+
/**
|
|
68
|
+
* Create an object which holds a reference to an external blob (i.e. not in the project bucket)
|
|
69
|
+
* The uri should starts either with gs:// or s3://. Not other protocols are supported yet.
|
|
70
|
+
* For the s3 blobs you must use a hash with the blob #region. Ex: s3://bucket/path/to/file#us-east-1
|
|
71
|
+
* @param uri
|
|
72
|
+
* @param payload
|
|
73
|
+
* @param options
|
|
74
|
+
* @returns
|
|
75
|
+
*/
|
|
76
|
+
createFromExternalSource(uri: string, payload?: CreateContentObjectPayload, options?: {
|
|
77
|
+
collection_id?: string;
|
|
78
|
+
processing_priority?: ContentObjectProcessingPriority;
|
|
79
|
+
}): Promise<ContentObject>;
|
|
80
|
+
/**
|
|
81
|
+
* Updates an existing object or creates a new revision
|
|
82
|
+
* Handles file uploads similar to the create method
|
|
83
|
+
*
|
|
84
|
+
* @param id The ID of the object to update
|
|
85
|
+
* @param payload The changes to apply
|
|
86
|
+
* @param options Additional options
|
|
87
|
+
* @param options.createRevision Whether to create a new revision instead of updating in place
|
|
88
|
+
* @param options.revisionLabel Optional label for the revision (e.g., "v1.2")
|
|
89
|
+
* @param options.suppressWorkflows When true, prevents this update from triggering workflow rules
|
|
90
|
+
* @returns The updated object or newly created revision
|
|
91
|
+
*/
|
|
92
|
+
update(id: string, payload: Partial<CreateContentObjectPayload>, options?: {
|
|
93
|
+
createRevision?: boolean;
|
|
94
|
+
revisionLabel?: string;
|
|
95
|
+
processing_priority?: ContentObjectProcessingPriority;
|
|
96
|
+
suppressWorkflows?: boolean;
|
|
97
|
+
}): Promise<ContentObject>;
|
|
98
|
+
/**
|
|
99
|
+
* Retrieves all revisions of a content object
|
|
100
|
+
*
|
|
101
|
+
* @param id The ID of any revision in the object's history
|
|
102
|
+
* @returns Array of all revisions sharing the same root
|
|
103
|
+
*/
|
|
104
|
+
getRevisions(id: string): Promise<ContentObjectItem[]>;
|
|
105
|
+
/**
|
|
106
|
+
* Retrieves all collections that contain a specific object
|
|
107
|
+
*
|
|
108
|
+
* @param id The ID of the object
|
|
109
|
+
* @returns Array of collections containing this object (both static and dynamic)
|
|
110
|
+
*/
|
|
111
|
+
getCollections(id: string): Promise<any[]>;
|
|
112
|
+
delete(id: string): Promise<{
|
|
113
|
+
id: string;
|
|
114
|
+
}>;
|
|
115
|
+
listWorkflowRuns(documentId: string): Promise<ListWorkflowRunsResponse>;
|
|
116
|
+
listRenditions(documentId: string): Promise<ContentObjectItem[]>;
|
|
117
|
+
getRendition(documentId: string, options: GetRenditionParams): Promise<GetRenditionResponse>;
|
|
118
|
+
/**
|
|
119
|
+
* Get rendition with pre-validation of content type compatibility.
|
|
120
|
+
* Returns null instead of throwing if the format is not supported for the content type.
|
|
121
|
+
*
|
|
122
|
+
* @param documentId - The document ID
|
|
123
|
+
* @param contentType - The content type of the document (e.g., 'image/png', 'text/markdown')
|
|
124
|
+
* @param options - Rendition options including format
|
|
125
|
+
* @returns The rendition response, or null if format is not supported for the content type
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* const rendition = await client.objects.getRenditionSafe(docId, doc.content?.type, {
|
|
129
|
+
* format: ImageRenditionFormat.jpeg,
|
|
130
|
+
* generate_if_missing: true
|
|
131
|
+
* });
|
|
132
|
+
* if (!rendition) {
|
|
133
|
+
* console.log('Document does not support JPEG renditions');
|
|
134
|
+
* }
|
|
135
|
+
*/
|
|
136
|
+
getRenditionSafe(documentId: string, contentType: string | undefined, options: GetRenditionParams): Promise<GetRenditionResponse | null>;
|
|
137
|
+
exportProperties(payload: ExportPropertiesPayload): Promise<ExportPropertiesResponse>;
|
|
138
|
+
setEmbedding(id: string, type: SupportedEmbeddingTypes, payload: Embedding): Promise<Record<SupportedEmbeddingTypes, Embedding>>;
|
|
139
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObjectsApi.d.ts","sourceRoot":"","sources":["../../../src/store/ObjectsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACH,oBAAoB,EAEpB,oBAAoB,EACpB,yBAAyB,EACzB,aAAa,EACb,iBAAiB,EACjB,+BAA+B,EAC/B,aAAa,EACb,0BAA0B,EAC1B,SAAS,EACT,uBAAuB,EACvB,wBAAwB,EACxB,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,4BAA4B,EAC5B,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EAEnB,uBAAuB,EACvB,uBAAuB,EAC1B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,CAAC;AAEvF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,MAAM,WAAW,qBAAqB;IAClC,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxC,QAAQ,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC5C,MAAM,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,iBAAiB,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AAiB,EAAE,CAAC;IAIhE,YAAY,CACR,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,oBAAoB,CAAC;IAahC;;;;;;;;;;;;;;;;;OAiBG;IACH,gBAAgB,CACZ,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAOvC,gBAAgB,CACZ,OAAO,EAAE,uBAAuB,GACjC,OAAO,CAAC,wBAAwB,CAAC;IAMpC,YAAY,CACR,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,uBAAuB,EAC7B,OAAO,EAAE,SAAS,GACnB,OAAO,CAAC,MAAM,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC;CAKzD"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { ListPendingAsksResponse, PendingAskData, UserChannel } from "@vertesia/common";
|
|
3
|
+
/**
|
|
4
|
+
* Request to register a pending ask.
|
|
5
|
+
*/
|
|
6
|
+
export interface RegisterPendingAskRequest {
|
|
7
|
+
/** Temporal workflow run ID */
|
|
8
|
+
runId: string;
|
|
9
|
+
/** Temporal workflow ID */
|
|
10
|
+
workflowId: string;
|
|
11
|
+
/** Name of the agent/interaction */
|
|
12
|
+
agentName: string;
|
|
13
|
+
/** Questions asked by the agent */
|
|
14
|
+
questions: string[];
|
|
15
|
+
/** Timeout in hours (default 48) */
|
|
16
|
+
timeoutHours?: number;
|
|
17
|
+
/** User communication channels */
|
|
18
|
+
userChannels: UserChannel[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Response from registering a pending ask.
|
|
22
|
+
*/
|
|
23
|
+
export interface RegisterPendingAskResponse {
|
|
24
|
+
/** Whether registration succeeded */
|
|
25
|
+
success: boolean;
|
|
26
|
+
/** Generated ask ID */
|
|
27
|
+
askId?: string;
|
|
28
|
+
/** Whether webhook was sent */
|
|
29
|
+
webhookSent?: boolean;
|
|
30
|
+
/** Error message if failed */
|
|
31
|
+
error?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Request to resolve a pending ask.
|
|
35
|
+
*/
|
|
36
|
+
export interface ResolvePendingAskRequest {
|
|
37
|
+
/** User's response */
|
|
38
|
+
response: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Response from resolving a pending ask.
|
|
42
|
+
*/
|
|
43
|
+
export interface ResolvePendingAskResponse {
|
|
44
|
+
/** Whether resolution succeeded */
|
|
45
|
+
success: boolean;
|
|
46
|
+
/** Whether webhook was sent */
|
|
47
|
+
webhookSent?: boolean;
|
|
48
|
+
/** How long the user took to respond (ms) */
|
|
49
|
+
waitDurationMs?: number;
|
|
50
|
+
/** Error message if failed */
|
|
51
|
+
error?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Pending Asks API for tracking ask_user requests.
|
|
55
|
+
* Handles registration, resolution, and listing of pending asks.
|
|
56
|
+
*/
|
|
57
|
+
export declare class PendingAsksApi extends ApiTopic {
|
|
58
|
+
constructor(parent: ClientBase);
|
|
59
|
+
/**
|
|
60
|
+
* Register a new pending ask.
|
|
61
|
+
* Called when an agent calls ask_user.
|
|
62
|
+
* Stores in Redis and sends webhook if configured.
|
|
63
|
+
*/
|
|
64
|
+
register(request: RegisterPendingAskRequest): Promise<RegisterPendingAskResponse>;
|
|
65
|
+
/**
|
|
66
|
+
* Resolve a pending ask with the user's response.
|
|
67
|
+
* Called when a user responds to an ask.
|
|
68
|
+
* Updates Redis and sends webhook if configured.
|
|
69
|
+
*/
|
|
70
|
+
resolve(askId: string, request: ResolvePendingAskRequest): Promise<ResolvePendingAskResponse>;
|
|
71
|
+
/**
|
|
72
|
+
* List all pending asks for the current project.
|
|
73
|
+
*/
|
|
74
|
+
list(): Promise<ListPendingAsksResponse>;
|
|
75
|
+
/**
|
|
76
|
+
* Get a specific pending ask by ID.
|
|
77
|
+
*/
|
|
78
|
+
retrieve(askId: string): Promise<PendingAskData>;
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PendingAsksApi.d.ts","sourceRoot":"","sources":["../../../src/store/PendingAsksApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAExF;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,mCAAmC;IACnC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,oCAAoC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,YAAY,EAAE,WAAW,EAAE,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACvC,qCAAqC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,+BAA+B;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,QAAQ;gBAC5B,MAAM,EAAE,UAAU;IAI9B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAIjF;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAI7F;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,uBAAuB,CAAC;IAIxC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;CAGnD"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import { AgentSchedule, AgentScheduleWithTemporalInfo, CreateSchedulePayload, ScheduleListItem, UpdateSchedulePayload } from "@vertesia/common";
|
|
3
|
+
/**
|
|
4
|
+
* Client API for managing agent schedules.
|
|
5
|
+
*
|
|
6
|
+
* Schedules allow agents to run on a recurring basis using cron expressions.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SchedulesApi extends ApiTopic {
|
|
9
|
+
constructor(parent: ClientBase);
|
|
10
|
+
/**
|
|
11
|
+
* List all schedules in the project.
|
|
12
|
+
*/
|
|
13
|
+
list(): Promise<ScheduleListItem[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve a schedule by ID.
|
|
16
|
+
* Includes Temporal execution info if available.
|
|
17
|
+
*/
|
|
18
|
+
retrieve(id: string): Promise<AgentScheduleWithTemporalInfo>;
|
|
19
|
+
/**
|
|
20
|
+
* Create a new schedule.
|
|
21
|
+
*
|
|
22
|
+
* @param payload - Schedule configuration including name, interaction, and cron expression
|
|
23
|
+
* @returns The created schedule
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const schedule = await client.schedules.create({
|
|
28
|
+
* name: 'Weekly Report',
|
|
29
|
+
* interaction: 'WeeklyReportAgent',
|
|
30
|
+
* cron_expression: '0 9 * * MON', // Every Monday at 9am
|
|
31
|
+
* timezone: 'America/New_York',
|
|
32
|
+
* vars: { reportType: 'summary' }
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
create(payload: CreateSchedulePayload): Promise<AgentSchedule>;
|
|
37
|
+
/**
|
|
38
|
+
* Update an existing schedule.
|
|
39
|
+
*
|
|
40
|
+
* @param id - Schedule ID
|
|
41
|
+
* @param payload - Fields to update
|
|
42
|
+
* @returns The updated schedule
|
|
43
|
+
*/
|
|
44
|
+
update(id: string, payload: UpdateSchedulePayload): Promise<AgentSchedule>;
|
|
45
|
+
/**
|
|
46
|
+
* Delete a schedule.
|
|
47
|
+
*
|
|
48
|
+
* This also removes the corresponding Temporal schedule.
|
|
49
|
+
*
|
|
50
|
+
* @param id - Schedule ID
|
|
51
|
+
* @returns Object with the deleted schedule ID
|
|
52
|
+
*/
|
|
53
|
+
delete(id: string): Promise<{
|
|
54
|
+
id: string;
|
|
55
|
+
}>;
|
|
56
|
+
/**
|
|
57
|
+
* Trigger an immediate execution of the scheduled agent.
|
|
58
|
+
*
|
|
59
|
+
* This runs the agent immediately without waiting for the next scheduled time.
|
|
60
|
+
*
|
|
61
|
+
* @param id - Schedule ID
|
|
62
|
+
* @returns Success message
|
|
63
|
+
*/
|
|
64
|
+
trigger(id: string): Promise<{
|
|
65
|
+
message: string;
|
|
66
|
+
}>;
|
|
67
|
+
/**
|
|
68
|
+
* Pause a schedule.
|
|
69
|
+
*
|
|
70
|
+
* The schedule will not run until resumed.
|
|
71
|
+
*
|
|
72
|
+
* @param id - Schedule ID
|
|
73
|
+
* @param note - Optional note explaining why the schedule was paused
|
|
74
|
+
* @returns Success message
|
|
75
|
+
*/
|
|
76
|
+
pause(id: string, note?: string): Promise<{
|
|
77
|
+
message: string;
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* Resume a paused schedule.
|
|
81
|
+
*
|
|
82
|
+
* @param id - Schedule ID
|
|
83
|
+
* @param note - Optional note explaining why the schedule was resumed
|
|
84
|
+
* @returns Success message
|
|
85
|
+
*/
|
|
86
|
+
resume(id: string, note?: string): Promise<{
|
|
87
|
+
message: string;
|
|
88
|
+
}>;
|
|
89
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchedulesApi.d.ts","sourceRoot":"","sources":["../../../src/store/SchedulesApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACH,aAAa,EACb,6BAA6B,EAC7B,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACxB,MAAM,kBAAkB,CAAC;AAE1B;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,QAAQ;gBAC1B,MAAM,EAAE,UAAU;IAI9B;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAInC;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAI5D;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC;IAI9D;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC;IAI1E;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAI3C;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAIjD;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAI9D;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAGlE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
|
|
2
|
+
import type { BuiltinToolsCatalogResponse } from "@vertesia/common";
|
|
3
|
+
/**
|
|
4
|
+
* API for accessing the builtin tools catalog
|
|
5
|
+
*/
|
|
6
|
+
export declare class ToolsApi extends ApiTopic {
|
|
7
|
+
constructor(parent: ClientBase);
|
|
8
|
+
/**
|
|
9
|
+
* Get the builtin tools catalog
|
|
10
|
+
* @returns List of all available builtin tools with their descriptions and parameter schemas
|
|
11
|
+
*/
|
|
12
|
+
getBuiltinCatalog(): Promise<BuiltinToolsCatalogResponse>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolsApi.d.ts","sourceRoot":"","sources":["../../../src/store/ToolsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAEpE;;GAEG;AACH,qBAAa,QAAS,SAAQ,QAAQ;gBACtB,MAAM,EAAE,UAAU;IAI9B;;;OAGG;IACH,iBAAiB,IAAI,OAAO,CAAC,2BAA2B,CAAC;CAG5D"}
|