@vertesia/client 1.1.1-dev.20260505.163000Z → 1.3.0-dev.20260620.061059Z
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/README.md +29 -0
- package/lib/{types/AccountApi.d.ts → AccountApi.d.ts} +5 -10
- package/lib/AccountApi.d.ts.map +1 -0
- package/lib/{esm/AccountApi.js → AccountApi.js} +5 -13
- package/lib/AccountApi.js.map +1 -0
- package/lib/{types/AccountsApi.d.ts → AccountsApi.d.ts} +3 -2
- package/lib/AccountsApi.d.ts.map +1 -0
- package/lib/{esm/AccountsApi.js → AccountsApi.js} +2 -2
- package/lib/AccountsApi.js.map +1 -0
- package/lib/{types/AnalyticsApi.d.ts → AnalyticsApi.d.ts} +3 -2
- package/lib/AnalyticsApi.d.ts.map +1 -0
- package/lib/{esm/AnalyticsApi.js → AnalyticsApi.js} +5 -5
- package/lib/AnalyticsApi.js.map +1 -0
- package/lib/{types/ApiKeysApi.d.ts → ApiKeysApi.d.ts} +3 -2
- package/lib/ApiKeysApi.d.ts.map +1 -0
- package/lib/ApiKeysApi.js.map +1 -0
- package/lib/{types/AppsApi.d.ts → AppsApi.d.ts} +40 -2
- package/lib/AppsApi.d.ts.map +1 -0
- package/lib/{esm/AppsApi.js → AppsApi.js} +87 -14
- package/lib/AppsApi.js.map +1 -0
- package/lib/{types/AuditTrailApi.d.ts → AuditTrailApi.d.ts} +2 -1
- package/lib/AuditTrailApi.d.ts.map +1 -0
- package/lib/{esm/AuditTrailApi.js → AuditTrailApi.js} +1 -1
- package/lib/AuditTrailApi.js.map +1 -0
- package/lib/{types/CommandsApi.d.ts → CommandsApi.d.ts} +3 -2
- package/lib/CommandsApi.d.ts.map +1 -0
- package/lib/{esm/CommandsApi.js → CommandsApi.js} +3 -3
- package/lib/CommandsApi.js.map +1 -0
- package/lib/{types/EnvironmentsApi.d.ts → EnvironmentsApi.d.ts} +5 -4
- package/lib/EnvironmentsApi.d.ts.map +1 -0
- package/lib/{esm/EnvironmentsApi.js → EnvironmentsApi.js} +13 -13
- package/lib/EnvironmentsApi.js.map +1 -0
- package/lib/{types/GroupsApi.d.ts → GroupsApi.d.ts} +3 -2
- package/lib/GroupsApi.d.ts.map +1 -0
- package/lib/{esm/GroupsApi.js → GroupsApi.js} +8 -8
- package/lib/GroupsApi.js.map +1 -0
- package/lib/IamApi.d.ts +58 -0
- package/lib/IamApi.d.ts.map +1 -0
- package/lib/IamApi.js +76 -0
- package/lib/IamApi.js.map +1 -0
- package/lib/{types/InteractionBase.d.ts → InteractionBase.d.ts} +6 -5
- package/lib/InteractionBase.d.ts.map +1 -0
- package/lib/{esm/InteractionBase.js → InteractionBase.js} +4 -4
- package/lib/InteractionBase.js.map +1 -0
- package/lib/{types/InteractionCatalogApi.d.ts → InteractionCatalogApi.d.ts} +3 -2
- package/lib/InteractionCatalogApi.d.ts.map +1 -0
- package/lib/{esm/InteractionCatalogApi.js → InteractionCatalogApi.js} +12 -12
- package/lib/InteractionCatalogApi.js.map +1 -0
- package/lib/{types/InteractionOutput.d.ts → InteractionOutput.d.ts} +13 -12
- package/lib/InteractionOutput.d.ts.map +1 -0
- package/lib/{esm/InteractionOutput.js → InteractionOutput.js} +22 -25
- package/lib/InteractionOutput.js.map +1 -0
- package/lib/{types/InteractionResult.example.d.ts → InteractionResult.example.d.ts} +1 -0
- package/lib/InteractionResult.example.d.ts.map +1 -0
- package/lib/{esm/InteractionResult.example.js → InteractionResult.example.js} +4 -4
- package/lib/InteractionResult.example.js.map +1 -0
- package/lib/{types/InteractionsApi.d.ts → InteractionsApi.d.ts} +17 -6
- package/lib/InteractionsApi.d.ts.map +1 -0
- package/lib/{esm/InteractionsApi.js → InteractionsApi.js} +45 -28
- package/lib/InteractionsApi.js.map +1 -0
- package/lib/{types/OAuthClientsApi.d.ts → OAuthClientsApi.d.ts} +4 -2
- package/lib/OAuthClientsApi.d.ts.map +1 -0
- package/lib/{esm/OAuthClientsApi.js → OAuthClientsApi.js} +3 -0
- package/lib/OAuthClientsApi.js.map +1 -0
- package/lib/{types/OAuthGrantsApi.d.ts → OAuthGrantsApi.d.ts} +2 -1
- package/lib/OAuthGrantsApi.d.ts.map +1 -0
- package/lib/OAuthGrantsApi.js.map +1 -0
- package/lib/{types/OAuthProvidersApi.d.ts → OAuthProvidersApi.d.ts} +3 -2
- package/lib/OAuthProvidersApi.d.ts.map +1 -0
- package/lib/OAuthProvidersApi.js.map +1 -0
- package/lib/OAuthServerApi.d.ts +19 -0
- package/lib/OAuthServerApi.d.ts.map +1 -0
- package/lib/OAuthServerApi.js +48 -0
- package/lib/OAuthServerApi.js.map +1 -0
- package/lib/{types/ProjectsApi.d.ts → ProjectsApi.d.ts} +8 -5
- package/lib/ProjectsApi.d.ts.map +1 -0
- package/lib/{esm/ProjectsApi.js → ProjectsApi.js} +21 -12
- package/lib/ProjectsApi.js.map +1 -0
- package/lib/{types/PromptsApi.d.ts → PromptsApi.d.ts} +17 -9
- package/lib/PromptsApi.d.ts.map +1 -0
- package/lib/{esm/PromptsApi.js → PromptsApi.js} +16 -18
- package/lib/PromptsApi.js.map +1 -0
- package/lib/RefsApi.d.ts +7 -0
- package/lib/RefsApi.d.ts.map +1 -0
- package/lib/{esm/RefsApi.js → RefsApi.js} +2 -2
- package/lib/RefsApi.js.map +1 -0
- package/lib/{types/RemoteMcpConnectionsApi.d.ts → RemoteMcpConnectionsApi.d.ts} +3 -2
- package/lib/RemoteMcpConnectionsApi.d.ts.map +1 -0
- package/lib/{esm/RemoteMcpConnectionsApi.js → RemoteMcpConnectionsApi.js} +3 -3
- package/lib/RemoteMcpConnectionsApi.js.map +1 -0
- package/lib/{types/RunsApi.d.ts → RunsApi.d.ts} +11 -7
- package/lib/RunsApi.d.ts.map +1 -0
- package/lib/{esm/RunsApi.js → RunsApi.js} +14 -12
- package/lib/RunsApi.js.map +1 -0
- package/lib/SecretsApi.d.ts +18 -0
- package/lib/SecretsApi.d.ts.map +1 -0
- package/lib/SecretsApi.js +30 -0
- package/lib/SecretsApi.js.map +1 -0
- package/lib/{types/SkillsApi.d.ts → SkillsApi.d.ts} +3 -2
- package/lib/SkillsApi.d.ts.map +1 -0
- package/lib/{esm/SkillsApi.js → SkillsApi.js} +3 -3
- package/lib/SkillsApi.js.map +1 -0
- package/lib/{types/StreamSource.d.ts → StreamSource.d.ts} +1 -0
- package/lib/StreamSource.d.ts.map +1 -0
- package/lib/StreamSource.js.map +1 -0
- package/lib/ToolsApi.d.ts +36 -0
- package/lib/ToolsApi.d.ts.map +1 -0
- package/lib/ToolsApi.js +46 -0
- package/lib/ToolsApi.js.map +1 -0
- package/lib/{types/TrainingApi.d.ts → TrainingApi.d.ts} +7 -6
- package/lib/TrainingApi.d.ts.map +1 -0
- package/lib/TrainingApi.js +51 -0
- package/lib/TrainingApi.js.map +1 -0
- package/lib/{types/UsersApi.d.ts → UsersApi.d.ts} +3 -2
- package/lib/UsersApi.d.ts.map +1 -0
- package/lib/{esm/UsersApi.js → UsersApi.js} +3 -3
- package/lib/UsersApi.js.map +1 -0
- package/lib/{types/client.d.ts → client.d.ts} +55 -27
- package/lib/client.d.ts.map +1 -0
- package/lib/{esm/client.js → client.js} +113 -61
- package/lib/client.js.map +1 -0
- package/lib/{types/execute.d.ts → execute.d.ts} +5 -4
- package/lib/execute.d.ts.map +1 -0
- package/lib/{esm/execute.js → execute.js} +29 -11
- package/lib/execute.js.map +1 -0
- package/lib/{types/index.d.ts → index.d.ts} +9 -8
- package/lib/index.d.ts.map +1 -0
- package/lib/{esm/index.js → index.js} +4 -2
- package/lib/index.js.map +1 -0
- package/lib/{types/nodejs → nodejs}/NodeStreamSource.d.ts +3 -2
- package/lib/nodejs/NodeStreamSource.d.ts.map +1 -0
- package/lib/{esm/nodejs → nodejs}/NodeStreamSource.js +3 -3
- package/lib/nodejs/NodeStreamSource.js.map +1 -0
- package/lib/nodejs/index.d.ts +2 -0
- package/lib/nodejs/index.d.ts.map +1 -0
- package/lib/nodejs/index.js +2 -0
- package/lib/nodejs/index.js.map +1 -0
- package/lib/{types/store → store}/AgentsApi.d.ts +60 -9
- package/lib/store/AgentsApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/AgentsApi.js +174 -53
- package/lib/store/AgentsApi.js.map +1 -0
- package/lib/{types/store → store}/AnalyzeDocApi.d.ts +3 -2
- package/lib/store/AnalyzeDocApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/AnalyzeDocApi.js +10 -10
- package/lib/store/AnalyzeDocApi.js.map +1 -0
- package/lib/{types/store → store}/CollectionsApi.d.ts +6 -5
- package/lib/store/CollectionsApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/CollectionsApi.js +22 -22
- package/lib/store/CollectionsApi.js.map +1 -0
- package/lib/{types/store → store}/CostApi.d.ts +3 -2
- package/lib/store/CostApi.d.ts.map +1 -0
- package/lib/store/CostApi.js.map +1 -0
- package/lib/{types/store → store}/DashboardApi.d.ts +3 -2
- package/lib/store/DashboardApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/DashboardApi.js +7 -4
- package/lib/store/DashboardApi.js.map +1 -0
- package/lib/{types/store → store}/DataApi.d.ts +4 -3
- package/lib/store/DataApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/DataApi.js +6 -6
- package/lib/store/DataApi.js.map +1 -0
- package/lib/{types/store → store}/EmailApi.d.ts +3 -2
- package/lib/store/EmailApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/EmailApi.js +5 -5
- package/lib/store/EmailApi.js.map +1 -0
- package/lib/store/EmbeddingsApi.d.ts +13 -0
- package/lib/store/EmbeddingsApi.d.ts.map +1 -0
- package/lib/store/EmbeddingsApi.js +25 -0
- package/lib/store/EmbeddingsApi.js.map +1 -0
- package/lib/{types/store → store}/FilesApi.d.ts +22 -7
- package/lib/store/FilesApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/FilesApi.js +56 -51
- package/lib/store/FilesApi.js.map +1 -0
- package/lib/{types/store → store}/HiveMemoryApi.d.ts +3 -2
- package/lib/store/HiveMemoryApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/HiveMemoryApi.js +11 -11
- package/lib/{esm/store → store}/HiveMemoryApi.js.map +1 -1
- package/lib/{types/store → store}/IndexingApi.d.ts +16 -10
- package/lib/store/IndexingApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/IndexingApi.js +57 -45
- package/lib/store/IndexingApi.js.map +1 -0
- package/lib/{types/store → store}/ObjectsApi.d.ts +16 -11
- package/lib/store/ObjectsApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/ObjectsApi.js +46 -63
- package/lib/store/ObjectsApi.js.map +1 -0
- package/lib/{types/store → store}/PendingAsksApi.d.ts +5 -2
- package/lib/store/PendingAsksApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/PendingAsksApi.js +4 -4
- package/lib/store/PendingAsksApi.js.map +1 -0
- package/lib/store/ProcessApi.d.ts +25 -0
- package/lib/store/ProcessApi.d.ts.map +1 -0
- package/lib/store/ProcessApi.js +42 -0
- package/lib/store/ProcessApi.js.map +1 -0
- package/lib/{types/store → store}/QueryApi.d.ts +2 -1
- package/lib/store/QueryApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/QueryApi.js +3 -3
- package/lib/store/QueryApi.js.map +1 -0
- package/lib/{types/store → store}/RenderingApi.d.ts +3 -2
- package/lib/store/RenderingApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/RenderingApi.js +8 -8
- package/lib/store/RenderingApi.js.map +1 -0
- package/lib/{types/store → store}/SchedulesApi.d.ts +3 -2
- package/lib/store/SchedulesApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/SchedulesApi.js +4 -4
- package/lib/store/SchedulesApi.js.map +1 -0
- package/lib/store/TaskApi.d.ts +16 -0
- package/lib/store/TaskApi.d.ts.map +1 -0
- package/lib/store/TaskApi.js +42 -0
- package/lib/store/TaskApi.js.map +1 -0
- package/lib/{types/store → store}/ToolsApi.d.ts +3 -2
- package/lib/store/ToolsApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/ToolsApi.js +2 -2
- package/lib/store/ToolsApi.js.map +1 -0
- package/lib/{types/store → store}/TypeCatalogApi.d.ts +4 -3
- package/lib/store/TypeCatalogApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/TypeCatalogApi.js +5 -5
- package/lib/store/TypeCatalogApi.js.map +1 -0
- package/lib/{types/store → store}/TypesApi.d.ts +5 -4
- package/lib/store/TypesApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/TypesApi.js +12 -12
- package/lib/store/TypesApi.js.map +1 -0
- package/lib/{types/store → store}/WorkflowsApi.d.ts +11 -9
- package/lib/store/WorkflowsApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/WorkflowsApi.js +62 -52
- package/lib/store/WorkflowsApi.js.map +1 -0
- package/lib/store/client.d.ts +62 -0
- package/lib/store/client.d.ts.map +1 -0
- package/lib/store/client.js +106 -0
- package/lib/store/client.js.map +1 -0
- package/lib/{types/store → store}/errors.d.ts +2 -1
- package/lib/store/errors.d.ts.map +1 -0
- package/lib/store/errors.js +7 -0
- package/lib/store/errors.js.map +1 -0
- package/lib/store/index.d.ts +21 -0
- package/lib/store/index.d.ts.map +1 -0
- package/lib/store/index.js +21 -0
- package/lib/store/index.js.map +1 -0
- package/lib/store/signed-url.d.ts +39 -0
- package/lib/store/signed-url.d.ts.map +1 -0
- package/lib/store/signed-url.js +153 -0
- package/lib/store/signed-url.js.map +1 -0
- package/lib/store/stream-termination.d.ts +4 -0
- package/lib/store/stream-termination.d.ts.map +1 -0
- package/lib/store/stream-termination.js +31 -0
- package/lib/store/stream-termination.js.map +1 -0
- package/lib/{types/store → store}/version.d.ts +2 -0
- package/lib/store/version.d.ts.map +1 -0
- package/lib/{esm/store → store}/version.js +1 -0
- package/lib/store/version.js.map +1 -0
- package/lib/vertesia-client.js +1 -1
- package/lib/vertesia-client.js.map +1 -1
- package/package.json +26 -38
- package/src/AccountApi.ts +10 -22
- package/src/AccountsApi.ts +3 -9
- package/src/AnalyticsApi.ts +6 -8
- package/src/ApiKeysApi.ts +10 -2
- package/src/AppsApi.ts +131 -27
- package/src/AuditTrailApi.ts +4 -4
- package/src/CommandsApi.ts +7 -8
- package/src/EnvironmentsApi.ts +27 -23
- package/src/GroupsApi.ts +15 -10
- package/src/IamApi.ts +56 -22
- package/src/InteractionBase.ts +18 -9
- package/src/InteractionCatalogApi.ts +15 -20
- package/src/InteractionOutput.test.ts +40 -57
- package/src/InteractionOutput.ts +55 -47
- package/src/InteractionResult.example.ts +30 -18
- package/src/InteractionsApi.ts +113 -59
- package/src/OAuthClientsApi.ts +6 -1
- package/src/OAuthGrantsApi.ts +1 -1
- package/src/OAuthProvidersApi.ts +3 -4
- package/src/OAuthServerApi.ts +53 -6
- package/src/ProjectsApi.ts +70 -31
- package/src/PromptsApi.ts +44 -29
- package/src/RefsApi.ts +4 -10
- package/src/RemoteMcpConnectionsApi.ts +6 -7
- package/src/RunsApi.ts +25 -20
- package/src/SecretsApi.ts +56 -0
- package/src/SkillsApi.ts +5 -12
- package/src/StreamSource.ts +6 -1
- package/src/ToolsApi.ts +52 -0
- package/src/TrainingApi.ts +27 -25
- package/src/UsersApi.ts +6 -8
- package/src/client.test.ts +68 -2
- package/src/client.ts +160 -103
- package/src/execute.ts +60 -20
- package/src/index.ts +8 -8
- package/src/nodejs/NodeStreamSource.ts +4 -5
- package/src/nodejs/index.ts +1 -1
- package/src/store/AgentsApi.ts +308 -148
- package/src/store/AnalyzeDocApi.ts +39 -21
- package/src/store/CollectionsApi.ts +40 -38
- package/src/store/CostApi.ts +14 -19
- package/src/store/DashboardApi.ts +24 -27
- package/src/store/DataApi.ts +29 -32
- package/src/store/EmailApi.ts +6 -6
- package/src/store/EmbeddingsApi.ts +15 -15
- package/src/store/FilesApi.ts +80 -85
- package/src/store/HiveMemoryApi.ts +17 -28
- package/src/store/IndexingApi.ts +113 -76
- package/src/store/ObjectsApi.ts +100 -131
- package/src/store/PendingAsksApi.ts +7 -5
- package/src/store/ProcessApi.ts +61 -0
- package/src/store/QueryApi.ts +3 -4
- package/src/store/RenderingApi.ts +14 -17
- package/src/store/SchedulesApi.ts +6 -6
- package/src/store/TaskApi.ts +45 -0
- package/src/store/ToolsApi.ts +3 -3
- package/src/store/TypeCatalogApi.ts +56 -53
- package/src/store/TypesApi.ts +26 -18
- package/src/store/WorkflowsApi.ts +158 -152
- package/src/store/client.ts +58 -39
- package/src/store/errors.ts +3 -3
- package/src/store/index.ts +20 -18
- package/src/store/signed-url.test.ts +182 -0
- package/src/store/signed-url.ts +184 -0
- package/src/store/stream-gap.test.ts +230 -0
- package/src/store/stream-termination.test.ts +58 -0
- package/src/store/stream-termination.ts +40 -0
- package/src/store/version.ts +2 -1
- package/lib/cjs/AccountApi.js +0 -85
- package/lib/cjs/AccountApi.js.map +0 -1
- package/lib/cjs/AccountsApi.js +0 -16
- package/lib/cjs/AccountsApi.js.map +0 -1
- package/lib/cjs/AnalyticsApi.js +0 -43
- package/lib/cjs/AnalyticsApi.js.map +0 -1
- package/lib/cjs/ApiKeysApi.js +0 -61
- package/lib/cjs/ApiKeysApi.js.map +0 -1
- package/lib/cjs/AppsApi.js +0 -137
- package/lib/cjs/AppsApi.js.map +0 -1
- package/lib/cjs/AuditTrailApi.js +0 -39
- package/lib/cjs/AuditTrailApi.js.map +0 -1
- package/lib/cjs/CommandsApi.js +0 -19
- package/lib/cjs/CommandsApi.js.map +0 -1
- package/lib/cjs/EnvironmentsApi.js +0 -72
- package/lib/cjs/EnvironmentsApi.js.map +0 -1
- package/lib/cjs/GroupsApi.js +0 -86
- package/lib/cjs/GroupsApi.js.map +0 -1
- package/lib/cjs/IamApi.js +0 -53
- package/lib/cjs/IamApi.js.map +0 -1
- package/lib/cjs/InteractionBase.js +0 -44
- package/lib/cjs/InteractionBase.js.map +0 -1
- package/lib/cjs/InteractionCatalogApi.js +0 -64
- package/lib/cjs/InteractionCatalogApi.js.map +0 -1
- package/lib/cjs/InteractionOutput.js +0 -300
- package/lib/cjs/InteractionOutput.js.map +0 -1
- package/lib/cjs/InteractionResult.example.js +0 -57
- package/lib/cjs/InteractionResult.example.js.map +0 -1
- package/lib/cjs/InteractionsApi.js +0 -260
- package/lib/cjs/InteractionsApi.js.map +0 -1
- package/lib/cjs/OAuthClientsApi.js +0 -25
- package/lib/cjs/OAuthClientsApi.js.map +0 -1
- package/lib/cjs/OAuthGrantsApi.js +0 -30
- package/lib/cjs/OAuthGrantsApi.js.map +0 -1
- package/lib/cjs/OAuthProvidersApi.js +0 -43
- package/lib/cjs/OAuthProvidersApi.js.map +0 -1
- package/lib/cjs/OAuthServerApi.js +0 -22
- package/lib/cjs/OAuthServerApi.js.map +0 -1
- package/lib/cjs/ProjectsApi.js +0 -105
- package/lib/cjs/ProjectsApi.js.map +0 -1
- package/lib/cjs/PromptsApi.js +0 -135
- package/lib/cjs/PromptsApi.js.map +0 -1
- package/lib/cjs/RefsApi.js +0 -14
- package/lib/cjs/RefsApi.js.map +0 -1
- package/lib/cjs/RemoteMcpConnectionsApi.js +0 -38
- package/lib/cjs/RemoteMcpConnectionsApi.js.map +0 -1
- package/lib/cjs/RunsApi.js +0 -115
- package/lib/cjs/RunsApi.js.map +0 -1
- package/lib/cjs/SkillsApi.js +0 -39
- package/lib/cjs/SkillsApi.js.map +0 -1
- package/lib/cjs/StreamSource.js +0 -17
- package/lib/cjs/StreamSource.js.map +0 -1
- package/lib/cjs/TrainingApi.js +0 -54
- package/lib/cjs/TrainingApi.js.map +0 -1
- package/lib/cjs/UsersApi.js +0 -19
- package/lib/cjs/UsersApi.js.map +0 -1
- package/lib/cjs/client.js +0 -375
- package/lib/cjs/client.js.map +0 -1
- package/lib/cjs/execute.js +0 -160
- package/lib/cjs/execute.js.map +0 -1
- package/lib/cjs/index.js +0 -36
- package/lib/cjs/index.js.map +0 -1
- package/lib/cjs/nodejs/NodeStreamSource.js +0 -45
- package/lib/cjs/nodejs/NodeStreamSource.js.map +0 -1
- package/lib/cjs/nodejs/index.js +0 -18
- package/lib/cjs/nodejs/index.js.map +0 -1
- package/lib/cjs/package.json +0 -3
- package/lib/cjs/store/AgentsApi.js +0 -663
- package/lib/cjs/store/AgentsApi.js.map +0 -1
- package/lib/cjs/store/AnalyzeDocApi.js +0 -56
- package/lib/cjs/store/AnalyzeDocApi.js.map +0 -1
- package/lib/cjs/store/CollectionsApi.js +0 -131
- package/lib/cjs/store/CollectionsApi.js.map +0 -1
- package/lib/cjs/store/CommandsApi.js +0 -17
- package/lib/cjs/store/CommandsApi.js.map +0 -1
- package/lib/cjs/store/CostApi.js +0 -62
- package/lib/cjs/store/CostApi.js.map +0 -1
- package/lib/cjs/store/DashboardApi.js +0 -182
- package/lib/cjs/store/DashboardApi.js.map +0 -1
- package/lib/cjs/store/DataApi.js +0 -436
- package/lib/cjs/store/DataApi.js.map +0 -1
- package/lib/cjs/store/EmailApi.js +0 -103
- package/lib/cjs/store/EmailApi.js.map +0 -1
- package/lib/cjs/store/EmbeddingsApi.js +0 -29
- package/lib/cjs/store/EmbeddingsApi.js.map +0 -1
- package/lib/cjs/store/FilesApi.js +0 -286
- package/lib/cjs/store/FilesApi.js.map +0 -1
- package/lib/cjs/store/HiveMemoryApi.js +0 -174
- package/lib/cjs/store/HiveMemoryApi.js.map +0 -1
- package/lib/cjs/store/IndexingApi.js +0 -308
- package/lib/cjs/store/IndexingApi.js.map +0 -1
- package/lib/cjs/store/ObjectsApi.js +0 -340
- package/lib/cjs/store/ObjectsApi.js.map +0 -1
- package/lib/cjs/store/PendingAsksApi.js +0 -43
- package/lib/cjs/store/PendingAsksApi.js.map +0 -1
- package/lib/cjs/store/QueryApi.js +0 -67
- package/lib/cjs/store/QueryApi.js.map +0 -1
- package/lib/cjs/store/RenderingApi.js +0 -84
- package/lib/cjs/store/RenderingApi.js.map +0 -1
- package/lib/cjs/store/SchedulesApi.js +0 -103
- package/lib/cjs/store/SchedulesApi.js.map +0 -1
- package/lib/cjs/store/ToolsApi.js +0 -21
- package/lib/cjs/store/ToolsApi.js.map +0 -1
- package/lib/cjs/store/TypeCatalogApi.js +0 -50
- package/lib/cjs/store/TypeCatalogApi.js.map +0 -1
- package/lib/cjs/store/TypesApi.js +0 -60
- package/lib/cjs/store/TypesApi.js.map +0 -1
- package/lib/cjs/store/WorkersApi.js +0 -16
- package/lib/cjs/store/WorkersApi.js.map +0 -1
- package/lib/cjs/store/WorkflowsApi.js +0 -621
- package/lib/cjs/store/WorkflowsApi.js.map +0 -1
- package/lib/cjs/store/client.js +0 -93
- package/lib/cjs/store/client.js.map +0 -1
- package/lib/cjs/store/errors.js +0 -11
- package/lib/cjs/store/errors.js.map +0 -1
- package/lib/cjs/store/index.js +0 -34
- package/lib/cjs/store/index.js.map +0 -1
- package/lib/cjs/store/version.js +0 -6
- package/lib/cjs/store/version.js.map +0 -1
- package/lib/esm/AccountApi.js.map +0 -1
- package/lib/esm/AccountsApi.js.map +0 -1
- package/lib/esm/AnalyticsApi.js.map +0 -1
- package/lib/esm/ApiKeysApi.js.map +0 -1
- package/lib/esm/AppsApi.js.map +0 -1
- package/lib/esm/AuditTrailApi.js.map +0 -1
- package/lib/esm/CommandsApi.js.map +0 -1
- package/lib/esm/EnvironmentsApi.js.map +0 -1
- package/lib/esm/GroupsApi.js.map +0 -1
- package/lib/esm/IamApi.js +0 -47
- package/lib/esm/IamApi.js.map +0 -1
- package/lib/esm/InteractionBase.js.map +0 -1
- package/lib/esm/InteractionCatalogApi.js.map +0 -1
- package/lib/esm/InteractionOutput.js.map +0 -1
- package/lib/esm/InteractionResult.example.js.map +0 -1
- package/lib/esm/InteractionsApi.js.map +0 -1
- package/lib/esm/OAuthClientsApi.js.map +0 -1
- package/lib/esm/OAuthGrantsApi.js.map +0 -1
- package/lib/esm/OAuthProvidersApi.js.map +0 -1
- package/lib/esm/OAuthServerApi.js +0 -19
- package/lib/esm/OAuthServerApi.js.map +0 -1
- package/lib/esm/ProjectsApi.js.map +0 -1
- package/lib/esm/PromptsApi.js.map +0 -1
- package/lib/esm/RefsApi.js.map +0 -1
- package/lib/esm/RemoteMcpConnectionsApi.js.map +0 -1
- package/lib/esm/RunsApi.js.map +0 -1
- package/lib/esm/SkillsApi.js.map +0 -1
- package/lib/esm/StreamSource.js.map +0 -1
- package/lib/esm/TrainingApi.js +0 -51
- package/lib/esm/TrainingApi.js.map +0 -1
- package/lib/esm/UsersApi.js.map +0 -1
- package/lib/esm/client.js.map +0 -1
- package/lib/esm/execute.js.map +0 -1
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/nodejs/NodeStreamSource.js.map +0 -1
- package/lib/esm/nodejs/index.js +0 -2
- package/lib/esm/nodejs/index.js.map +0 -1
- package/lib/esm/store/AgentsApi.js.map +0 -1
- package/lib/esm/store/AnalyzeDocApi.js.map +0 -1
- package/lib/esm/store/CollectionsApi.js.map +0 -1
- package/lib/esm/store/CommandsApi.js +0 -13
- package/lib/esm/store/CommandsApi.js.map +0 -1
- package/lib/esm/store/CostApi.js.map +0 -1
- package/lib/esm/store/DashboardApi.js.map +0 -1
- package/lib/esm/store/DataApi.js.map +0 -1
- package/lib/esm/store/EmailApi.js.map +0 -1
- package/lib/esm/store/EmbeddingsApi.js +0 -25
- package/lib/esm/store/EmbeddingsApi.js.map +0 -1
- package/lib/esm/store/FilesApi.js.map +0 -1
- package/lib/esm/store/IndexingApi.js.map +0 -1
- package/lib/esm/store/ObjectsApi.js.map +0 -1
- package/lib/esm/store/PendingAsksApi.js.map +0 -1
- package/lib/esm/store/QueryApi.js.map +0 -1
- package/lib/esm/store/RenderingApi.js.map +0 -1
- package/lib/esm/store/SchedulesApi.js.map +0 -1
- package/lib/esm/store/ToolsApi.js.map +0 -1
- package/lib/esm/store/TypeCatalogApi.js.map +0 -1
- package/lib/esm/store/TypesApi.js.map +0 -1
- package/lib/esm/store/WorkersApi.js +0 -12
- package/lib/esm/store/WorkersApi.js.map +0 -1
- package/lib/esm/store/WorkflowsApi.js.map +0 -1
- package/lib/esm/store/client.js +0 -89
- package/lib/esm/store/client.js.map +0 -1
- package/lib/esm/store/errors.js +0 -7
- package/lib/esm/store/errors.js.map +0 -1
- package/lib/esm/store/index.js +0 -18
- package/lib/esm/store/index.js.map +0 -1
- package/lib/esm/store/version.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/types/AccountApi.d.ts.map +0 -1
- package/lib/types/AccountsApi.d.ts.map +0 -1
- package/lib/types/AnalyticsApi.d.ts.map +0 -1
- package/lib/types/ApiKeysApi.d.ts.map +0 -1
- package/lib/types/AppsApi.d.ts.map +0 -1
- package/lib/types/AuditTrailApi.d.ts.map +0 -1
- package/lib/types/CommandsApi.d.ts.map +0 -1
- package/lib/types/EnvironmentsApi.d.ts.map +0 -1
- package/lib/types/GroupsApi.d.ts.map +0 -1
- package/lib/types/IamApi.d.ts +0 -36
- package/lib/types/IamApi.d.ts.map +0 -1
- package/lib/types/InteractionBase.d.ts.map +0 -1
- package/lib/types/InteractionCatalogApi.d.ts.map +0 -1
- package/lib/types/InteractionOutput.d.ts.map +0 -1
- package/lib/types/InteractionResult.example.d.ts.map +0 -1
- package/lib/types/InteractionsApi.d.ts.map +0 -1
- package/lib/types/OAuthClientsApi.d.ts.map +0 -1
- package/lib/types/OAuthGrantsApi.d.ts.map +0 -1
- package/lib/types/OAuthProvidersApi.d.ts.map +0 -1
- package/lib/types/OAuthServerApi.d.ts +0 -10
- package/lib/types/OAuthServerApi.d.ts.map +0 -1
- package/lib/types/ProjectsApi.d.ts.map +0 -1
- package/lib/types/PromptsApi.d.ts.map +0 -1
- package/lib/types/RefsApi.d.ts +0 -6
- package/lib/types/RefsApi.d.ts.map +0 -1
- package/lib/types/RemoteMcpConnectionsApi.d.ts.map +0 -1
- package/lib/types/RunsApi.d.ts.map +0 -1
- package/lib/types/SkillsApi.d.ts.map +0 -1
- package/lib/types/StreamSource.d.ts.map +0 -1
- package/lib/types/TrainingApi.d.ts.map +0 -1
- package/lib/types/UsersApi.d.ts.map +0 -1
- package/lib/types/client.d.ts.map +0 -1
- package/lib/types/execute.d.ts.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/nodejs/NodeStreamSource.d.ts.map +0 -1
- package/lib/types/nodejs/index.d.ts +0 -1
- package/lib/types/nodejs/index.d.ts.map +0 -1
- package/lib/types/store/AgentsApi.d.ts.map +0 -1
- package/lib/types/store/AnalyzeDocApi.d.ts.map +0 -1
- package/lib/types/store/CollectionsApi.d.ts.map +0 -1
- package/lib/types/store/CommandsApi.d.ts +0 -10
- package/lib/types/store/CommandsApi.d.ts.map +0 -1
- package/lib/types/store/CostApi.d.ts.map +0 -1
- package/lib/types/store/DashboardApi.d.ts.map +0 -1
- package/lib/types/store/DataApi.d.ts.map +0 -1
- package/lib/types/store/EmailApi.d.ts.map +0 -1
- package/lib/types/store/EmbeddingsApi.d.ts +0 -12
- package/lib/types/store/EmbeddingsApi.d.ts.map +0 -1
- package/lib/types/store/FilesApi.d.ts.map +0 -1
- package/lib/types/store/HiveMemoryApi.d.ts.map +0 -1
- package/lib/types/store/IndexingApi.d.ts.map +0 -1
- package/lib/types/store/ObjectsApi.d.ts.map +0 -1
- package/lib/types/store/PendingAsksApi.d.ts.map +0 -1
- package/lib/types/store/QueryApi.d.ts.map +0 -1
- package/lib/types/store/RenderingApi.d.ts.map +0 -1
- package/lib/types/store/SchedulesApi.d.ts.map +0 -1
- package/lib/types/store/ToolsApi.d.ts.map +0 -1
- package/lib/types/store/TypeCatalogApi.d.ts.map +0 -1
- package/lib/types/store/TypesApi.d.ts.map +0 -1
- package/lib/types/store/WorkersApi.d.ts +0 -6
- package/lib/types/store/WorkersApi.d.ts.map +0 -1
- package/lib/types/store/WorkflowsApi.d.ts.map +0 -1
- package/lib/types/store/client.d.ts +0 -57
- package/lib/types/store/client.d.ts.map +0 -1
- package/lib/types/store/errors.d.ts.map +0 -1
- package/lib/types/store/index.d.ts +0 -17
- package/lib/types/store/index.d.ts.map +0 -1
- package/lib/types/store/version.d.ts.map +0 -1
- package/src/store/CommandsApi.ts +0 -15
- package/src/store/WorkersApi.ts +0 -17
- /package/lib/{esm/ApiKeysApi.js → ApiKeysApi.js} +0 -0
- /package/lib/{esm/OAuthGrantsApi.js → OAuthGrantsApi.js} +0 -0
- /package/lib/{esm/OAuthProvidersApi.js → OAuthProvidersApi.js} +0 -0
- /package/lib/{esm/StreamSource.js → StreamSource.js} +0 -0
- /package/lib/{esm/store → store}/CostApi.js +0 -0
|
@@ -1,58 +1,61 @@
|
|
|
1
|
-
import { ApiTopic, ClientBase } from
|
|
1
|
+
import { ApiTopic, type ClientBase, type IRequestParams } from '@vertesia/api-fetch-client';
|
|
2
2
|
import {
|
|
3
|
-
ActivityCatalog,
|
|
4
|
-
AgentEvent,
|
|
5
|
-
AgentMessage,
|
|
3
|
+
type ActivityCatalog,
|
|
4
|
+
type AgentEvent,
|
|
5
|
+
type AgentMessage,
|
|
6
6
|
AgentMessageType,
|
|
7
|
-
CompactMessage,
|
|
8
|
-
CreateWorkflowRulePayload,
|
|
9
|
-
DSLWorkflowDefinition,
|
|
10
|
-
DSLWorkflowSpec,
|
|
11
|
-
ErrorAnalyticsResponse,
|
|
12
|
-
ExecuteWorkflowPayload,
|
|
13
|
-
FirstResponseBehaviorAnalyticsResponse,
|
|
14
|
-
LatencyAnalyticsResponse,
|
|
15
|
-
ListWorkflowInteractionsResponse,
|
|
16
|
-
ListWorkflowRunsPayload,
|
|
17
|
-
ListWorkflowRunsResponse,
|
|
7
|
+
type CompactMessage,
|
|
8
|
+
type CreateWorkflowRulePayload,
|
|
9
|
+
type DSLWorkflowDefinition,
|
|
10
|
+
type DSLWorkflowSpec,
|
|
11
|
+
type ErrorAnalyticsResponse,
|
|
12
|
+
type ExecuteWorkflowPayload,
|
|
13
|
+
type FirstResponseBehaviorAnalyticsResponse,
|
|
14
|
+
type LatencyAnalyticsResponse,
|
|
15
|
+
type ListWorkflowInteractionsResponse,
|
|
16
|
+
type ListWorkflowRunsPayload,
|
|
17
|
+
type ListWorkflowRunsResponse,
|
|
18
|
+
type PromptSizeAnalyticsResponse,
|
|
18
19
|
parseMessage,
|
|
20
|
+
type RunsByAgentAnalyticsResponse,
|
|
21
|
+
type SignalAgentPayload,
|
|
22
|
+
type SignalAgentResponse,
|
|
23
|
+
type TimeToFirstResponseAnalyticsResponse,
|
|
24
|
+
type TokenUsageAnalyticsResponse,
|
|
25
|
+
type ToolAnalyticsResponse,
|
|
26
|
+
type ToolParameterAnalyticsResponse,
|
|
27
|
+
type TopPrincipalsAnalyticsResponse,
|
|
19
28
|
toAgentMessage,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
WorkflowRunWithDetails,
|
|
43
|
-
WorkflowToolParametersQuery,
|
|
44
|
-
WorkflowUpdatePublishResponse,
|
|
45
|
-
} from "@vertesia/common";
|
|
46
|
-
import { VertesiaClient } from "../client.js";
|
|
47
|
-
import { EventSourceProvider } from "../execute.js";
|
|
29
|
+
type UploadWorkflowRulePayload,
|
|
30
|
+
type WebSocketClientMessage,
|
|
31
|
+
type WebSocketServerMessage,
|
|
32
|
+
type WorkflowActionPayload,
|
|
33
|
+
type WorkflowActionResponse,
|
|
34
|
+
type WorkflowAnalyticsFilterOptionsResponse,
|
|
35
|
+
type WorkflowAnalyticsSummaryQuery,
|
|
36
|
+
type WorkflowAnalyticsSummaryResponse,
|
|
37
|
+
type WorkflowAnalyticsTimeSeriesQuery,
|
|
38
|
+
type WorkflowDefinitionRef,
|
|
39
|
+
type WorkflowExecutionStartResult,
|
|
40
|
+
type WorkflowQueryResult,
|
|
41
|
+
type WorkflowRule,
|
|
42
|
+
type WorkflowRuleItem,
|
|
43
|
+
type WorkflowRunUpdatesResponse,
|
|
44
|
+
type WorkflowRunWithDetails,
|
|
45
|
+
type WorkflowToolParametersQuery,
|
|
46
|
+
type WorkflowUpdatePublishResponse,
|
|
47
|
+
} from '@vertesia/common';
|
|
48
|
+
import type { VertesiaClient } from '../client.js';
|
|
49
|
+
import { EventSourceProvider } from '../execute.js';
|
|
50
|
+
import { shouldCloseAgentRunStream, shouldCloseCompactRunStream } from './stream-termination.js';
|
|
48
51
|
|
|
49
52
|
export class WorkflowsApi extends ApiTopic {
|
|
50
53
|
constructor(parent: ClientBase) {
|
|
51
|
-
super(parent,
|
|
54
|
+
super(parent, '/api/v1/workflows');
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
getActivityCatalog(): Promise<ActivityCatalog> {
|
|
55
|
-
return this.get(
|
|
58
|
+
return this.get('/activity-catalog');
|
|
56
59
|
}
|
|
57
60
|
|
|
58
61
|
listRuns(documentId: string, eventName: string, ruleId: string): Promise<ListWorkflowRunsResponse> {
|
|
@@ -62,7 +65,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
62
65
|
/** List conversations the users has access to */
|
|
63
66
|
listConversations(payload: ListWorkflowRunsPayload): Promise<ListWorkflowRunsResponse> {
|
|
64
67
|
return this.post(`/conversations`, {
|
|
65
|
-
payload
|
|
68
|
+
payload,
|
|
66
69
|
});
|
|
67
70
|
}
|
|
68
71
|
|
|
@@ -70,7 +73,12 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
70
73
|
return this.post(`/runs`, { payload: payload });
|
|
71
74
|
}
|
|
72
75
|
|
|
73
|
-
sendSignal(
|
|
76
|
+
sendSignal(
|
|
77
|
+
workflowId: string,
|
|
78
|
+
runId: string,
|
|
79
|
+
signal: string,
|
|
80
|
+
payload?: SignalAgentPayload | null,
|
|
81
|
+
): Promise<SignalAgentResponse> {
|
|
74
82
|
return this.post(`/runs/${workflowId}/${runId}/signal/${signal}`, { payload });
|
|
75
83
|
}
|
|
76
84
|
|
|
@@ -80,9 +88,10 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
80
88
|
options?: {
|
|
81
89
|
includeHistory?: boolean;
|
|
82
90
|
historyFormat?: 'events' | 'tasks' | 'agent';
|
|
83
|
-
|
|
91
|
+
hydratePayloads?: boolean;
|
|
92
|
+
},
|
|
84
93
|
): Promise<WorkflowRunWithDetails> {
|
|
85
|
-
const query:
|
|
94
|
+
const query: NonNullable<IRequestParams['query']> = {};
|
|
86
95
|
|
|
87
96
|
// Support legacy includeHistory parameter
|
|
88
97
|
if (options?.includeHistory !== undefined) {
|
|
@@ -94,6 +103,10 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
94
103
|
query.history_format = options.historyFormat;
|
|
95
104
|
}
|
|
96
105
|
|
|
106
|
+
if (options?.hydratePayloads !== undefined) {
|
|
107
|
+
query.hydrate_payloads = options.hydratePayloads;
|
|
108
|
+
}
|
|
109
|
+
|
|
97
110
|
return this.get(`/runs/${workflowId}/${runId}`, { query });
|
|
98
111
|
}
|
|
99
112
|
|
|
@@ -123,16 +136,13 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
123
136
|
return this.get(`/runs/${workflowId}/${runId}/query/${queryName}`);
|
|
124
137
|
}
|
|
125
138
|
|
|
126
|
-
execute(
|
|
127
|
-
name: string,
|
|
128
|
-
payload: ExecuteWorkflowPayload = {},
|
|
129
|
-
): Promise<(WorkflowExecutionStartResult | undefined)[]> {
|
|
139
|
+
execute(name: string, payload: ExecuteWorkflowPayload = {}): Promise<(WorkflowExecutionStartResult | undefined)[]> {
|
|
130
140
|
return this.post(`/execute/${name}`, { payload });
|
|
131
141
|
}
|
|
132
142
|
|
|
133
143
|
postMessage(runId: string, msg: AgentMessage): Promise<WorkflowUpdatePublishResponse> {
|
|
134
144
|
if (!runId) {
|
|
135
|
-
throw new Error(
|
|
145
|
+
throw new Error('runId is required');
|
|
136
146
|
}
|
|
137
147
|
return this.post(`/runs/${runId}/updates`, { payload: msg });
|
|
138
148
|
}
|
|
@@ -144,9 +154,11 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
144
154
|
*/
|
|
145
155
|
async retrieveMessages(workflowId: string, runId: string, since?: number): Promise<AgentMessage[]> {
|
|
146
156
|
const query = { since };
|
|
147
|
-
const response = await this.get(`/runs/${workflowId}/${runId}/updates`, {
|
|
148
|
-
|
|
149
|
-
|
|
157
|
+
const response = (await this.get(`/runs/${workflowId}/${runId}/updates`, {
|
|
158
|
+
query,
|
|
159
|
+
})) as WorkflowRunUpdatesResponse;
|
|
160
|
+
// Normalize compact and legacy messages to AgentMessage for backward compatibility.
|
|
161
|
+
return response.messages.map((m) => toAgentMessage(parseMessage(m), runId));
|
|
150
162
|
}
|
|
151
163
|
|
|
152
164
|
/**
|
|
@@ -168,6 +180,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
168
180
|
return new Promise<unknown>((resolve, reject) => {
|
|
169
181
|
let reconnectAttempts = 0;
|
|
170
182
|
let lastMessageTimestamp = since || 0;
|
|
183
|
+
const historyFetchStartedAt = Date.now();
|
|
171
184
|
let isClosed = false;
|
|
172
185
|
let currentSse: EventSource | null = null;
|
|
173
186
|
let interval: ReturnType<typeof setInterval> | null = null;
|
|
@@ -179,7 +192,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
179
192
|
const maxDelay = 30000; // 30 seconds max delay
|
|
180
193
|
|
|
181
194
|
const calculateBackoffDelay = (attempts: number): number => {
|
|
182
|
-
const exponentialDelay = Math.min(baseDelay *
|
|
195
|
+
const exponentialDelay = Math.min(baseDelay * 2 ** attempts, maxDelay);
|
|
183
196
|
// Add jitter to prevent thundering herd
|
|
184
197
|
const jitter = Math.random() * 0.1 * exponentialDelay;
|
|
185
198
|
return exponentialDelay + jitter;
|
|
@@ -228,37 +241,39 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
228
241
|
try {
|
|
229
242
|
const EventSourceImpl = await EventSourceProvider();
|
|
230
243
|
const client = this.client as VertesiaClient;
|
|
231
|
-
const streamUrl = new URL(client.workflows.baseUrl
|
|
244
|
+
const streamUrl = new URL(`${client.workflows.baseUrl}/runs/${workflowId}/${runId}/stream`);
|
|
232
245
|
|
|
233
246
|
// Use the timestamp of the last received message for reconnection
|
|
234
247
|
if (lastMessageTimestamp > 0) {
|
|
235
|
-
streamUrl.searchParams.set(
|
|
248
|
+
streamUrl.searchParams.set('since', lastMessageTimestamp.toString());
|
|
236
249
|
}
|
|
237
250
|
|
|
238
251
|
// Skip historical messages - we already fetched them via GET /updates
|
|
239
|
-
streamUrl.searchParams.set(
|
|
252
|
+
streamUrl.searchParams.set('skipHistory', 'true');
|
|
240
253
|
|
|
241
254
|
const bearerToken = client._auth ? await client._auth() : undefined;
|
|
242
255
|
if (isClosed) return;
|
|
243
256
|
if (!bearerToken) {
|
|
244
257
|
isClosed = true;
|
|
245
258
|
cleanup();
|
|
246
|
-
reject(new Error(
|
|
259
|
+
reject(new Error('No auth token available'));
|
|
247
260
|
return;
|
|
248
261
|
}
|
|
249
262
|
|
|
250
|
-
const token = bearerToken.split(
|
|
251
|
-
streamUrl.searchParams.set(
|
|
263
|
+
const token = bearerToken.split(' ')[1];
|
|
264
|
+
streamUrl.searchParams.set('access_token', token);
|
|
252
265
|
|
|
253
266
|
if (isReconnect) {
|
|
254
|
-
console.log(
|
|
267
|
+
console.log(
|
|
268
|
+
`Reconnecting to SSE stream for run ${runId} (attempt ${reconnectAttempts + 1}/${maxReconnectAttempts})`,
|
|
269
|
+
);
|
|
255
270
|
}
|
|
256
271
|
|
|
257
272
|
const sse = new EventSourceImpl(streamUrl.href);
|
|
258
273
|
currentSse = sse;
|
|
259
274
|
|
|
260
275
|
// Prevent Node from exiting prematurely
|
|
261
|
-
interval = setInterval(() => {
|
|
276
|
+
interval = setInterval(() => {}, 1000);
|
|
262
277
|
|
|
263
278
|
sse.onopen = () => {
|
|
264
279
|
if (isReconnect) {
|
|
@@ -269,8 +284,8 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
269
284
|
};
|
|
270
285
|
|
|
271
286
|
sse.onmessage = (ev: MessageEvent) => {
|
|
272
|
-
if (!ev.data || ev.data.startsWith(
|
|
273
|
-
console.log(
|
|
287
|
+
if (!ev.data || ev.data.startsWith(':')) {
|
|
288
|
+
console.log('Received comment or heartbeat; ignoring it.: ', ev.data);
|
|
274
289
|
return;
|
|
275
290
|
}
|
|
276
291
|
|
|
@@ -291,29 +306,24 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
291
306
|
onMessage(agentMessage, exit);
|
|
292
307
|
}
|
|
293
308
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
const streamIsOver = compactMessage.t === AgentMessageType.TERMINATED ||
|
|
298
|
-
(compactMessage.t === AgentMessageType.COMPLETE && workstreamId === 'main');
|
|
299
|
-
|
|
300
|
-
// Only close the stream when the main workstream completes or terminates
|
|
301
|
-
if (streamIsOver) {
|
|
302
|
-
console.log("Closing stream due to COMPLETE message from main workstream");
|
|
309
|
+
if (shouldCloseCompactRunStream(compactMessage, runId)) {
|
|
310
|
+
console.log('Closing stream due to COMPLETE message from main workstream');
|
|
303
311
|
if (!isClosed) {
|
|
304
312
|
isClosed = true;
|
|
305
313
|
cleanup();
|
|
306
314
|
resolve(null);
|
|
307
315
|
}
|
|
308
316
|
} else if (compactMessage.t === AgentMessageType.COMPLETE) {
|
|
309
|
-
console.log(
|
|
317
|
+
console.log(
|
|
318
|
+
`Received COMPLETE message that does not close the root stream for run ${runId}`,
|
|
319
|
+
);
|
|
310
320
|
}
|
|
311
321
|
} catch (err) {
|
|
312
|
-
console.error(
|
|
322
|
+
console.error('Failed to parse SSE message:', err, ev.data);
|
|
313
323
|
}
|
|
314
324
|
};
|
|
315
325
|
|
|
316
|
-
sse.onerror = (err:
|
|
326
|
+
sse.onerror = (err: unknown) => {
|
|
317
327
|
if (isClosed) return;
|
|
318
328
|
|
|
319
329
|
console.warn(`SSE stream error for run ${runId}:`, err);
|
|
@@ -322,30 +332,36 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
322
332
|
// Check if we should attempt reconnection
|
|
323
333
|
if (reconnectAttempts < maxReconnectAttempts) {
|
|
324
334
|
const delay = calculateBackoffDelay(reconnectAttempts);
|
|
325
|
-
console.log(
|
|
335
|
+
console.log(
|
|
336
|
+
`Attempting to reconnect in ${delay}ms (attempt ${reconnectAttempts + 1}/${maxReconnectAttempts})`,
|
|
337
|
+
);
|
|
326
338
|
|
|
327
339
|
reconnectAttempts++;
|
|
328
340
|
reconnectTimer = setTimeout(() => {
|
|
329
341
|
reconnectTimer = null;
|
|
330
342
|
if (!isClosed) {
|
|
331
|
-
setupStream(true);
|
|
343
|
+
void setupStream(true);
|
|
332
344
|
}
|
|
333
345
|
}, delay);
|
|
334
346
|
} else {
|
|
335
|
-
console.error(
|
|
347
|
+
console.error(
|
|
348
|
+
`Failed to reconnect to SSE stream for run ${runId} after ${maxReconnectAttempts} attempts`,
|
|
349
|
+
);
|
|
336
350
|
isClosed = true;
|
|
337
|
-
reject(
|
|
351
|
+
reject(
|
|
352
|
+
new Error(`SSE connection failed after ${maxReconnectAttempts} reconnection attempts`),
|
|
353
|
+
);
|
|
338
354
|
}
|
|
339
355
|
};
|
|
340
356
|
} catch (err) {
|
|
341
|
-
console.error(
|
|
357
|
+
console.error('Error setting up SSE stream:', err);
|
|
342
358
|
if (reconnectAttempts < maxReconnectAttempts) {
|
|
343
359
|
const delay = calculateBackoffDelay(reconnectAttempts);
|
|
344
360
|
reconnectAttempts++;
|
|
345
361
|
reconnectTimer = setTimeout(() => {
|
|
346
362
|
reconnectTimer = null;
|
|
347
363
|
if (!isClosed) {
|
|
348
|
-
setupStream(true);
|
|
364
|
+
void setupStream(true);
|
|
349
365
|
}
|
|
350
366
|
}, delay);
|
|
351
367
|
} else {
|
|
@@ -359,25 +375,33 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
359
375
|
// 1. Fetch historical messages via GET /updates (gzip-compressed if > 3KB)
|
|
360
376
|
try {
|
|
361
377
|
const historical = await this.retrieveMessages(workflowId, runId, since);
|
|
362
|
-
|
|
378
|
+
let shouldCloseAfterHistory = false;
|
|
379
|
+
for (let index = 0; index < historical.length; index++) {
|
|
380
|
+
const msg = historical[index];
|
|
363
381
|
lastMessageTimestamp = Math.max(lastMessageTimestamp, msg.timestamp || 0);
|
|
364
382
|
if (onMessage) {
|
|
365
383
|
onMessage(msg, exit);
|
|
366
384
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
}
|
|
385
|
+
shouldCloseAfterHistory =
|
|
386
|
+
index === historical.length - 1 && shouldCloseAgentRunStream(msg, runId);
|
|
387
|
+
}
|
|
388
|
+
if (shouldCloseAfterHistory) {
|
|
389
|
+
exit(null);
|
|
390
|
+
return;
|
|
374
391
|
}
|
|
375
392
|
} catch (err) {
|
|
376
|
-
console.warn(
|
|
393
|
+
console.warn('Failed to fetch historical messages, continuing with SSE:', err);
|
|
394
|
+
}
|
|
395
|
+
if (!isClosed && lastMessageTimestamp <= 0) {
|
|
396
|
+
// The server only replays the GET-to-SSE handoff gap when
|
|
397
|
+
// `since > 0`. New runs can have no history at the first
|
|
398
|
+
// fetch, so use the GET start time as the cursor to avoid
|
|
399
|
+
// dropping messages emitted before the SSE subscription is active.
|
|
400
|
+
lastMessageTimestamp = Math.max(1, historyFetchStartedAt - 1);
|
|
377
401
|
}
|
|
378
402
|
|
|
379
403
|
// 2. Connect to SSE
|
|
380
|
-
setupStream(false);
|
|
404
|
+
void setupStream(false);
|
|
381
405
|
};
|
|
382
406
|
|
|
383
407
|
init().catch(reject);
|
|
@@ -396,8 +420,8 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
396
420
|
workflowId: string,
|
|
397
421
|
runId: string,
|
|
398
422
|
onMessage?: (message: CompactMessage) => void,
|
|
399
|
-
since?: number
|
|
400
|
-
): Promise<{ cleanup: () => void; sendSignal: (signalName: string, data:
|
|
423
|
+
since?: number,
|
|
424
|
+
): Promise<{ cleanup: () => void; sendSignal: (signalName: string, data: unknown) => void }> {
|
|
401
425
|
return new Promise((resolve, reject) => {
|
|
402
426
|
let reconnectAttempts = 0;
|
|
403
427
|
const maxReconnectAttempts = 10;
|
|
@@ -408,7 +432,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
408
432
|
let isClosed = false;
|
|
409
433
|
|
|
410
434
|
const calculateBackoffDelay = (attempts: number): number => {
|
|
411
|
-
const exponentialDelay = Math.min(baseDelay *
|
|
435
|
+
const exponentialDelay = Math.min(baseDelay * 2 ** attempts, maxDelay);
|
|
412
436
|
const jitter = Math.random() * 0.1 * exponentialDelay;
|
|
413
437
|
return exponentialDelay + jitter;
|
|
414
438
|
};
|
|
@@ -418,7 +442,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
418
442
|
|
|
419
443
|
try {
|
|
420
444
|
const client = this.client as VertesiaClient;
|
|
421
|
-
const wsUrl = new URL(client.workflows.baseUrl
|
|
445
|
+
const wsUrl = new URL(`${client.workflows.baseUrl}/runs/${workflowId}/${runId}/ws`);
|
|
422
446
|
|
|
423
447
|
// Replace http/https with ws/wss
|
|
424
448
|
wsUrl.protocol = wsUrl.protocol.replace('http', 'ws');
|
|
@@ -438,7 +462,9 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
438
462
|
wsUrl.searchParams.set('access_token', token);
|
|
439
463
|
|
|
440
464
|
if (reconnectAttempts > 0) {
|
|
441
|
-
console.log(
|
|
465
|
+
console.log(
|
|
466
|
+
`Reconnecting to WebSocket for run ${runId} (attempt ${reconnectAttempts + 1}/${maxReconnectAttempts})`,
|
|
467
|
+
);
|
|
442
468
|
}
|
|
443
469
|
|
|
444
470
|
ws = new WebSocket(wsUrl.href);
|
|
@@ -459,19 +485,19 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
459
485
|
ws = null;
|
|
460
486
|
}
|
|
461
487
|
},
|
|
462
|
-
sendSignal: (signalName: string, data:
|
|
488
|
+
sendSignal: (signalName: string, data: unknown) => {
|
|
463
489
|
if (ws?.readyState === WebSocket.OPEN) {
|
|
464
490
|
const message: WebSocketClientMessage = {
|
|
465
491
|
type: 'signal',
|
|
466
492
|
signalName,
|
|
467
493
|
data,
|
|
468
|
-
requestId: Date.now()
|
|
494
|
+
requestId: Date.now(),
|
|
469
495
|
};
|
|
470
496
|
ws.send(JSON.stringify(message));
|
|
471
497
|
} else {
|
|
472
498
|
console.warn('WebSocket not open, cannot send signal');
|
|
473
499
|
}
|
|
474
|
-
}
|
|
500
|
+
},
|
|
475
501
|
});
|
|
476
502
|
}
|
|
477
503
|
};
|
|
@@ -534,7 +560,9 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
534
560
|
ws.onclose = () => {
|
|
535
561
|
if (!isClosed && reconnectAttempts < maxReconnectAttempts) {
|
|
536
562
|
const delay = calculateBackoffDelay(reconnectAttempts);
|
|
537
|
-
console.log(
|
|
563
|
+
console.log(
|
|
564
|
+
`WebSocket closed, reconnecting in ${delay}ms (attempt ${reconnectAttempts + 1}/${maxReconnectAttempts})`,
|
|
565
|
+
);
|
|
538
566
|
reconnectAttempts++;
|
|
539
567
|
setTimeout(connect, delay);
|
|
540
568
|
} else if (reconnectAttempts >= maxReconnectAttempts) {
|
|
@@ -553,7 +581,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
553
581
|
}
|
|
554
582
|
};
|
|
555
583
|
|
|
556
|
-
connect();
|
|
584
|
+
void connect();
|
|
557
585
|
});
|
|
558
586
|
}
|
|
559
587
|
|
|
@@ -564,7 +592,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
564
592
|
ingestEvents(
|
|
565
593
|
workflowId: string,
|
|
566
594
|
runId: string,
|
|
567
|
-
events: AgentEvent[]
|
|
595
|
+
events: AgentEvent[],
|
|
568
596
|
): Promise<{ ingested: number; status?: string; error?: string }> {
|
|
569
597
|
return this.post(`/runs/${workflowId}/${runId}/events`, {
|
|
570
598
|
payload: { events },
|
|
@@ -579,9 +607,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
579
607
|
* Get workflow analytics summary.
|
|
580
608
|
* Returns overall metrics including token usage, success rates, and run counts.
|
|
581
609
|
*/
|
|
582
|
-
getAnalyticsSummary(
|
|
583
|
-
query: WorkflowAnalyticsSummaryQuery = {}
|
|
584
|
-
): Promise<WorkflowAnalyticsSummaryResponse> {
|
|
610
|
+
getAnalyticsSummary(query: WorkflowAnalyticsSummaryQuery = {}): Promise<WorkflowAnalyticsSummaryResponse> {
|
|
585
611
|
return this.post('/analytics/summary', { payload: query });
|
|
586
612
|
}
|
|
587
613
|
|
|
@@ -589,9 +615,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
589
615
|
* Get token usage analytics.
|
|
590
616
|
* Returns token consumption metrics by model, agent, tool, or over time.
|
|
591
617
|
*/
|
|
592
|
-
getTokenUsageAnalytics(
|
|
593
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
594
|
-
): Promise<TokenUsageAnalyticsResponse> {
|
|
618
|
+
getTokenUsageAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<TokenUsageAnalyticsResponse> {
|
|
595
619
|
return this.post('/analytics/tokens', { payload: query });
|
|
596
620
|
}
|
|
597
621
|
|
|
@@ -599,9 +623,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
599
623
|
* Get LLM latency analytics.
|
|
600
624
|
* Returns duration/latency metrics for LLM calls.
|
|
601
625
|
*/
|
|
602
|
-
getLlmLatencyAnalytics(
|
|
603
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
604
|
-
): Promise<LatencyAnalyticsResponse> {
|
|
626
|
+
getLlmLatencyAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<LatencyAnalyticsResponse> {
|
|
605
627
|
return this.post('/analytics/latency/llm', { payload: query });
|
|
606
628
|
}
|
|
607
629
|
|
|
@@ -609,9 +631,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
609
631
|
* Get tool latency analytics.
|
|
610
632
|
* Returns duration/latency metrics for tool calls.
|
|
611
633
|
*/
|
|
612
|
-
getToolLatencyAnalytics(
|
|
613
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
614
|
-
): Promise<LatencyAnalyticsResponse> {
|
|
634
|
+
getToolLatencyAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<LatencyAnalyticsResponse> {
|
|
615
635
|
return this.post('/analytics/latency/tools', { payload: query });
|
|
616
636
|
}
|
|
617
637
|
|
|
@@ -619,9 +639,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
619
639
|
* Get agent/workflow latency analytics.
|
|
620
640
|
* Returns duration metrics for complete workflow runs.
|
|
621
641
|
*/
|
|
622
|
-
getAgentLatencyAnalytics(
|
|
623
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
624
|
-
): Promise<LatencyAnalyticsResponse> {
|
|
642
|
+
getAgentLatencyAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<LatencyAnalyticsResponse> {
|
|
625
643
|
return this.post('/analytics/latency/agents', { payload: query });
|
|
626
644
|
}
|
|
627
645
|
|
|
@@ -629,9 +647,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
629
647
|
* Get error analytics.
|
|
630
648
|
* Returns error rates, types, and trends.
|
|
631
649
|
*/
|
|
632
|
-
getErrorAnalytics(
|
|
633
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
634
|
-
): Promise<ErrorAnalyticsResponse> {
|
|
650
|
+
getErrorAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<ErrorAnalyticsResponse> {
|
|
635
651
|
return this.post('/analytics/errors', { payload: query });
|
|
636
652
|
}
|
|
637
653
|
|
|
@@ -639,9 +655,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
639
655
|
* Get tool usage analytics.
|
|
640
656
|
* Returns tool invocation counts, success rates, and performance metrics.
|
|
641
657
|
*/
|
|
642
|
-
getToolAnalytics(
|
|
643
|
-
query: WorkflowAnalyticsSummaryQuery = {}
|
|
644
|
-
): Promise<ToolAnalyticsResponse> {
|
|
658
|
+
getToolAnalytics(query: WorkflowAnalyticsSummaryQuery = {}): Promise<ToolAnalyticsResponse> {
|
|
645
659
|
return this.post('/analytics/tools', { payload: query });
|
|
646
660
|
}
|
|
647
661
|
|
|
@@ -649,9 +663,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
649
663
|
* Get tool parameter analytics.
|
|
650
664
|
* Returns parameter value distributions for a specific tool.
|
|
651
665
|
*/
|
|
652
|
-
getToolParameterAnalytics(
|
|
653
|
-
query: WorkflowToolParametersQuery
|
|
654
|
-
): Promise<ToolParameterAnalyticsResponse> {
|
|
666
|
+
getToolParameterAnalytics(query: WorkflowToolParametersQuery): Promise<ToolParameterAnalyticsResponse> {
|
|
655
667
|
return this.post('/analytics/tools/parameters', { payload: query });
|
|
656
668
|
}
|
|
657
669
|
|
|
@@ -660,7 +672,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
660
672
|
* Returns unique agents, environments, and models from telemetry data.
|
|
661
673
|
*/
|
|
662
674
|
getAnalyticsFilterOptions(
|
|
663
|
-
query: WorkflowAnalyticsSummaryQuery = {}
|
|
675
|
+
query: WorkflowAnalyticsSummaryQuery = {},
|
|
664
676
|
): Promise<WorkflowAnalyticsFilterOptionsResponse> {
|
|
665
677
|
return this.post('/analytics/filter-options', { payload: query });
|
|
666
678
|
}
|
|
@@ -669,9 +681,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
669
681
|
* Get average prompt size (input tokens) by agent for startConversation calls.
|
|
670
682
|
* This represents the initial prompt + tools size.
|
|
671
683
|
*/
|
|
672
|
-
getPromptSizeAnalytics(
|
|
673
|
-
query: WorkflowAnalyticsSummaryQuery = {}
|
|
674
|
-
): Promise<PromptSizeAnalyticsResponse> {
|
|
684
|
+
getPromptSizeAnalytics(query: WorkflowAnalyticsSummaryQuery = {}): Promise<PromptSizeAnalyticsResponse> {
|
|
675
685
|
return this.post('/analytics/prompt-size', { payload: query });
|
|
676
686
|
}
|
|
677
687
|
|
|
@@ -679,9 +689,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
679
689
|
* Get top principals (users/API keys) who started the most agent runs.
|
|
680
690
|
* Returns the top N principals sorted by run count descending.
|
|
681
691
|
*/
|
|
682
|
-
getTopPrincipalsAnalytics(
|
|
683
|
-
query: WorkflowAnalyticsSummaryQuery = {}
|
|
684
|
-
): Promise<TopPrincipalsAnalyticsResponse> {
|
|
692
|
+
getTopPrincipalsAnalytics(query: WorkflowAnalyticsSummaryQuery = {}): Promise<TopPrincipalsAnalyticsResponse> {
|
|
685
693
|
return this.post('/analytics/top-principals', { payload: query });
|
|
686
694
|
}
|
|
687
695
|
|
|
@@ -689,9 +697,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
689
697
|
* Get agent run distribution - how many runs per agent/interaction type.
|
|
690
698
|
* Returns the top N agents sorted by run count descending.
|
|
691
699
|
*/
|
|
692
|
-
getRunsByAgentAnalytics(
|
|
693
|
-
query: WorkflowAnalyticsSummaryQuery = {}
|
|
694
|
-
): Promise<RunsByAgentAnalyticsResponse> {
|
|
700
|
+
getRunsByAgentAnalytics(query: WorkflowAnalyticsSummaryQuery = {}): Promise<RunsByAgentAnalyticsResponse> {
|
|
695
701
|
return this.post('/analytics/runs-by-agent', { payload: query });
|
|
696
702
|
}
|
|
697
703
|
|
|
@@ -701,7 +707,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
701
707
|
* Returns average, min, max, median, p95, and p99 metrics.
|
|
702
708
|
*/
|
|
703
709
|
getTimeToFirstResponseAnalytics(
|
|
704
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
710
|
+
query: WorkflowAnalyticsTimeSeriesQuery = {},
|
|
705
711
|
): Promise<TimeToFirstResponseAnalyticsResponse> {
|
|
706
712
|
return this.post('/analytics/time-to-first-response', { payload: query });
|
|
707
713
|
}
|
|
@@ -713,7 +719,7 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
713
719
|
* - Percentage of agents that return no tool calls at start
|
|
714
720
|
*/
|
|
715
721
|
getFirstResponseBehaviorAnalytics(
|
|
716
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
722
|
+
query: WorkflowAnalyticsTimeSeriesQuery = {},
|
|
717
723
|
): Promise<FirstResponseBehaviorAnalyticsResponse> {
|
|
718
724
|
return this.post('/analytics/first-response-behavior', { payload: query });
|
|
719
725
|
}
|
|
@@ -724,25 +730,25 @@ export class WorkflowsApi extends ApiTopic {
|
|
|
724
730
|
|
|
725
731
|
export class WorkflowsRulesApi extends ApiTopic {
|
|
726
732
|
constructor(parent: WorkflowsApi) {
|
|
727
|
-
super(parent,
|
|
733
|
+
super(parent, '/rules');
|
|
728
734
|
}
|
|
729
735
|
|
|
730
736
|
list(): Promise<WorkflowRuleItem[]> {
|
|
731
|
-
return this.get(
|
|
737
|
+
return this.get('/');
|
|
732
738
|
}
|
|
733
739
|
|
|
734
740
|
retrieve(id: string): Promise<WorkflowRule> {
|
|
735
741
|
return this.get(`/${id}`);
|
|
736
742
|
}
|
|
737
743
|
|
|
738
|
-
update(id: string, payload:
|
|
744
|
+
update(id: string, payload: UploadWorkflowRulePayload): Promise<WorkflowRule> {
|
|
739
745
|
return this.put(`/${id}`, {
|
|
740
746
|
payload,
|
|
741
747
|
});
|
|
742
748
|
}
|
|
743
749
|
|
|
744
750
|
create(payload: CreateWorkflowRulePayload): Promise<WorkflowRule> {
|
|
745
|
-
return this.post(
|
|
751
|
+
return this.post('/', {
|
|
746
752
|
payload,
|
|
747
753
|
});
|
|
748
754
|
}
|
|
@@ -754,7 +760,7 @@ export class WorkflowsRulesApi extends ApiTopic {
|
|
|
754
760
|
execute(
|
|
755
761
|
id: string,
|
|
756
762
|
objectIds?: string[],
|
|
757
|
-
vars?: Record<string,
|
|
763
|
+
vars?: Record<string, unknown>,
|
|
758
764
|
): Promise<({ run_id: string; workflow_id: string } | undefined)[]> {
|
|
759
765
|
const payload: ExecuteWorkflowPayload = {
|
|
760
766
|
objectIds,
|
|
@@ -768,25 +774,25 @@ export class WorkflowsDefinitionApi extends ApiTopic {
|
|
|
768
774
|
//model: DSLWorkflowDefinition;
|
|
769
775
|
|
|
770
776
|
constructor(parent: WorkflowsApi) {
|
|
771
|
-
super(parent,
|
|
777
|
+
super(parent, '/definitions');
|
|
772
778
|
}
|
|
773
779
|
|
|
774
780
|
list(): Promise<WorkflowDefinitionRef[]> {
|
|
775
|
-
return this.get(
|
|
781
|
+
return this.get('/');
|
|
776
782
|
}
|
|
777
783
|
|
|
778
784
|
retrieve(id: string): Promise<DSLWorkflowDefinition> {
|
|
779
785
|
return this.get(`/${id}`);
|
|
780
786
|
}
|
|
781
787
|
|
|
782
|
-
update(id: string, payload:
|
|
788
|
+
update(id: string, payload: DSLWorkflowSpec): Promise<DSLWorkflowDefinition> {
|
|
783
789
|
return this.put(`/${id}`, {
|
|
784
790
|
payload,
|
|
785
791
|
});
|
|
786
792
|
}
|
|
787
793
|
|
|
788
794
|
create(payload: DSLWorkflowSpec): Promise<DSLWorkflowDefinition> {
|
|
789
|
-
return this.post(
|
|
795
|
+
return this.post('/', {
|
|
790
796
|
payload,
|
|
791
797
|
});
|
|
792
798
|
}
|