@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
package/src/store/AgentsApi.ts
CHANGED
|
@@ -1,51 +1,63 @@
|
|
|
1
|
-
import { ApiTopic, ClientBase } from '@vertesia/api-fetch-client';
|
|
1
|
+
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
2
|
import {
|
|
3
|
-
ActiveWorkstreamsQueryResult,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
AgentMessage,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
AgentRunUpdatesResponse,
|
|
12
|
-
|
|
13
|
-
CreateAgentRunPayload,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
3
|
+
type ActiveWorkstreamsQueryResult,
|
|
4
|
+
type AgentArtifactUrlResponse,
|
|
5
|
+
type AgentEvent,
|
|
6
|
+
type AgentMessage,
|
|
7
|
+
type AgentRun,
|
|
8
|
+
type AgentRunDetailsStreamEvent,
|
|
9
|
+
type AgentRunInternals,
|
|
10
|
+
type AgentRunResponse,
|
|
11
|
+
type AgentRunUpdatesResponse,
|
|
12
|
+
type BindRunWorkflowPayload,
|
|
13
|
+
type CreateAgentRunPayload,
|
|
14
|
+
type CreateProcessRunPayload,
|
|
15
|
+
type ErrorAnalyticsResponse,
|
|
16
|
+
type FirstResponseBehaviorAnalyticsResponse,
|
|
17
|
+
type IngestAgentEventsPayload,
|
|
18
|
+
type IngestAgentEventsResponse,
|
|
19
|
+
type LatencyAnalyticsResponse,
|
|
20
|
+
type ListAgentRunsQuery,
|
|
21
|
+
type ListAgentRunsResponse,
|
|
22
|
+
type ListWorkflowRunsResponse,
|
|
23
|
+
type PostAgentRunUpdatePayload,
|
|
24
|
+
type PostAgentRunUpdateResponse,
|
|
25
|
+
type ProcessRun,
|
|
26
|
+
type ProcessState,
|
|
27
|
+
type PromptSizeAnalyticsResponse,
|
|
20
28
|
parseMessage,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
TimeToFirstResponseAnalyticsResponse,
|
|
31
|
-
|
|
29
|
+
type RecordAgentRunPayload,
|
|
30
|
+
type RecordProcessRunPayload,
|
|
31
|
+
type RecordRunPayload,
|
|
32
|
+
type RunsByAgentAnalyticsResponse,
|
|
33
|
+
type SearchAgentRunsQuery,
|
|
34
|
+
type SearchAgentRunsResponse,
|
|
35
|
+
type SignalAgentPayload,
|
|
36
|
+
type SignalAgentResponse,
|
|
37
|
+
type TerminateAgentRunResponse,
|
|
38
|
+
type TimeToFirstResponseAnalyticsResponse,
|
|
39
|
+
type TokenUsageAnalyticsResponse,
|
|
40
|
+
type ToolAnalyticsResponse,
|
|
41
|
+
type ToolParameterAnalyticsResponse,
|
|
42
|
+
type TopPrincipalsAnalyticsResponse,
|
|
32
43
|
toAgentMessage,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
WorkflowAnalyticsSummaryResponse,
|
|
41
|
-
WorkflowAnalyticsTimeSeriesQuery,
|
|
42
|
-
WorkflowRunWithDetails,
|
|
43
|
-
WorkflowToolParametersQuery,
|
|
44
|
-
IngestAgentEventsPayload,
|
|
45
|
-
IngestAgentEventsResponse,
|
|
44
|
+
type UpdateAgentRunStatusPayload,
|
|
45
|
+
type WorkflowAnalyticsFilterOptionsResponse,
|
|
46
|
+
type WorkflowAnalyticsSummaryQuery,
|
|
47
|
+
type WorkflowAnalyticsSummaryResponse,
|
|
48
|
+
type WorkflowAnalyticsTimeSeriesQuery,
|
|
49
|
+
type WorkflowRunWithDetails,
|
|
50
|
+
type WorkflowToolParametersQuery,
|
|
46
51
|
} from '@vertesia/common';
|
|
47
|
-
import { VertesiaClient } from '../client.js';
|
|
52
|
+
import type { VertesiaClient } from '../client.js';
|
|
48
53
|
import { EventSourceProvider } from '../execute.js';
|
|
54
|
+
import { fetchSignedUrl } from './signed-url.js';
|
|
55
|
+
import { shouldCloseAgentRunStream, shouldCloseCompactRunStream } from './stream-termination.js';
|
|
56
|
+
|
|
57
|
+
export interface AgentRunStreamMessagesOptions {
|
|
58
|
+
onHistoryLoaded?: (messages: AgentMessage[]) => void;
|
|
59
|
+
onHistoryError?: (error: unknown) => void;
|
|
60
|
+
}
|
|
49
61
|
|
|
50
62
|
export class AgentsApi extends ApiTopic {
|
|
51
63
|
constructor(parent: ClientBase) {
|
|
@@ -60,20 +72,32 @@ export class AgentsApi extends ApiTopic {
|
|
|
60
72
|
* Create and start a new agent run.
|
|
61
73
|
* Returns the created AgentRun with its stable id.
|
|
62
74
|
*/
|
|
75
|
+
start<TData = Record<string, unknown>>(payload: CreateAgentRunPayload<TData>): Promise<AgentRun<TData>>;
|
|
76
|
+
start<TData = Record<string, unknown>>(payload: CreateProcessRunPayload<TData>): Promise<ProcessRun>;
|
|
63
77
|
start<TData = Record<string, unknown>>(
|
|
64
|
-
payload: CreateAgentRunPayload<TData>,
|
|
65
|
-
): Promise<AgentRun<TData
|
|
78
|
+
payload: CreateAgentRunPayload<TData> | CreateProcessRunPayload<TData>,
|
|
79
|
+
): Promise<AgentRun<TData> | ProcessRun> {
|
|
66
80
|
return this.post('/', { payload });
|
|
67
81
|
}
|
|
68
82
|
|
|
69
83
|
/**
|
|
70
|
-
* Record
|
|
71
|
-
*
|
|
84
|
+
* Record a run for an already-running workflow. This only creates the
|
|
85
|
+
* MongoDB document; the caller owns the Temporal workflow ids.
|
|
86
|
+
*
|
|
87
|
+
* @internal
|
|
72
88
|
*/
|
|
73
|
-
|
|
89
|
+
recordRun<TData = Record<string, unknown>>(payload: RecordAgentRunPayload<TData>): Promise<AgentRun<TData>>;
|
|
90
|
+
recordRun<TData = Record<string, unknown>>(payload: RecordProcessRunPayload<TData>): Promise<ProcessRun>;
|
|
91
|
+
recordRun<TData = Record<string, unknown>>(
|
|
92
|
+
payload: RecordRunPayload<TData>,
|
|
93
|
+
): Promise<AgentRun<TData> | ProcessRun> {
|
|
74
94
|
return this.post('/record', { payload });
|
|
75
95
|
}
|
|
76
96
|
|
|
97
|
+
createRecord(payload: RecordAgentRunPayload): Promise<AgentRun> {
|
|
98
|
+
return this.recordRun(payload);
|
|
99
|
+
}
|
|
100
|
+
|
|
77
101
|
/**
|
|
78
102
|
* Get agent run by id.
|
|
79
103
|
*/
|
|
@@ -81,10 +105,34 @@ export class AgentsApi extends ApiTopic {
|
|
|
81
105
|
return this.get(`/${id}`);
|
|
82
106
|
}
|
|
83
107
|
|
|
108
|
+
/**
|
|
109
|
+
* Get any agent run by id, preserving the agent/process discriminator.
|
|
110
|
+
*/
|
|
111
|
+
retrieveRun<TData = Record<string, unknown>, TProperties = Record<string, unknown>>(
|
|
112
|
+
id: string,
|
|
113
|
+
): Promise<AgentRunResponse<TData, TProperties>> {
|
|
114
|
+
return this.get(`/${id}`);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
retrieveProcess(id: string): Promise<ProcessRun> {
|
|
118
|
+
return this.get(`/${id}`);
|
|
119
|
+
}
|
|
120
|
+
|
|
84
121
|
/**
|
|
85
122
|
* List agent runs with optional filters.
|
|
86
123
|
*/
|
|
87
124
|
list(query?: ListAgentRunsQuery): Promise<ListAgentRunsResponse> {
|
|
125
|
+
return this.get('/', { query: this.buildListQueryParams(query) });
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
async listProcessRuns(query?: Omit<ListAgentRunsQuery, 'run_kind'>): Promise<ProcessRun[]> {
|
|
129
|
+
const response: ListAgentRunsResponse = await this.get('/', {
|
|
130
|
+
query: this.buildListQueryParams({ ...query, run_kind: 'process' }),
|
|
131
|
+
});
|
|
132
|
+
return response.items.filter(isProcessRunResponse);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
private buildListQueryParams(query?: ListAgentRunsQuery): Record<string, string> {
|
|
88
136
|
const params: Record<string, string> = {};
|
|
89
137
|
if (query?.id) params.id = query.id;
|
|
90
138
|
if (query?.status) {
|
|
@@ -96,12 +144,15 @@ export class AgentsApi extends ApiTopic {
|
|
|
96
144
|
if (query?.until) params.until = query.until.toISOString();
|
|
97
145
|
if (query?.schedule_id) params.schedule_id = query.schedule_id;
|
|
98
146
|
if (query?.type) params.type = query.type;
|
|
147
|
+
if (query?.run_type)
|
|
148
|
+
params.run_type = Array.isArray(query.run_type) ? query.run_type.join(',') : query.run_type;
|
|
149
|
+
if (query?.run_kind) params.run_kind = query.run_kind;
|
|
99
150
|
if (query?.limit) params.limit = String(query.limit);
|
|
100
151
|
if (query?.offset) params.offset = String(query.offset);
|
|
101
152
|
if (query?.cursor) params.cursor = query.cursor;
|
|
102
153
|
if (query?.sort) params.sort = query.sort;
|
|
103
154
|
if (query?.order) params.order = query.order;
|
|
104
|
-
return
|
|
155
|
+
return params;
|
|
105
156
|
}
|
|
106
157
|
|
|
107
158
|
/**
|
|
@@ -122,6 +173,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
122
173
|
if (query?.until) params.until = query.until.toISOString();
|
|
123
174
|
if (query?.limit) params.limit = String(query.limit);
|
|
124
175
|
if (query?.offset) params.offset = String(query.offset);
|
|
176
|
+
if (query?.sort?.length) params.sort = query.sort.join(',');
|
|
125
177
|
return this.get('/search', { query: params });
|
|
126
178
|
}
|
|
127
179
|
|
|
@@ -150,24 +202,55 @@ export class AgentsApi extends ApiTopic {
|
|
|
150
202
|
return this.post(`/${id}/fork`, {});
|
|
151
203
|
}
|
|
152
204
|
|
|
205
|
+
getContext(id: string): Promise<{ run_id: string; current_node: string; context: Record<string, unknown> }> {
|
|
206
|
+
return this.get(`/${id}/context`);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
getHistory(id: string): Promise<{
|
|
210
|
+
run_id: string;
|
|
211
|
+
current_node: string;
|
|
212
|
+
node_history: ProcessState['node_history'];
|
|
213
|
+
node_history_ref?: ProcessState['node_history_ref'];
|
|
214
|
+
}> {
|
|
215
|
+
return this.get(`/${id}/history`);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
advance(id: string, payload?: { target?: string; reason?: string }): Promise<{ message: string }> {
|
|
219
|
+
return this.post(`/${id}/advance`, { payload: payload ?? {} });
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
retryNode(id: string, payload?: { node?: string; reason?: string }): Promise<{ message: string }> {
|
|
223
|
+
return this.post(`/${id}/retry-node`, { payload: payload ?? {} });
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
answerTask(id: string, taskId: string, result: Record<string, unknown>): Promise<{ message: string }> {
|
|
227
|
+
return this.post(`/${id}/answer-task`, { payload: { task_id: taskId, result } });
|
|
228
|
+
}
|
|
229
|
+
|
|
153
230
|
/**
|
|
154
231
|
* Update agent run status/metadata.
|
|
155
232
|
* Called by workflow activities to sync lifecycle state.
|
|
156
233
|
*/
|
|
157
|
-
updateStatus(
|
|
158
|
-
id: string,
|
|
159
|
-
update: UpdateAgentRunStatusPayload,
|
|
160
|
-
): Promise<AgentRun> {
|
|
234
|
+
updateStatus(id: string, update: UpdateAgentRunStatusPayload): Promise<AgentRun | ProcessRun> {
|
|
161
235
|
return this.post(`/${id}/status`, { payload: update });
|
|
162
236
|
}
|
|
163
237
|
|
|
238
|
+
/**
|
|
239
|
+
* Attach Temporal workflow run ids to a pre-created run record.
|
|
240
|
+
*
|
|
241
|
+
* @internal
|
|
242
|
+
*/
|
|
243
|
+
bindWorkflowRun(id: string, payload: BindRunWorkflowPayload): Promise<AgentRun | ProcessRun> {
|
|
244
|
+
return this.post(`/${id}/workflow`, { payload });
|
|
245
|
+
}
|
|
246
|
+
|
|
164
247
|
// ========================================================================
|
|
165
248
|
// Communication
|
|
166
249
|
// ========================================================================
|
|
167
250
|
|
|
168
251
|
/**
|
|
169
252
|
* Send a signal to a running agent.
|
|
170
|
-
* Signals: "UserInput", "Stop", "FileUploaded"
|
|
253
|
+
* Signals: "UserInput", "Stop", "FileUploaded", "FileRemoved"
|
|
171
254
|
*/
|
|
172
255
|
sendSignal(id: string, signalName: string, payload?: SignalAgentPayload): Promise<SignalAgentResponse> {
|
|
173
256
|
return this.post(`/${id}/signal/${signalName}`, { payload });
|
|
@@ -198,8 +281,8 @@ export class AgentsApi extends ApiTopic {
|
|
|
198
281
|
*/
|
|
199
282
|
async retrieveMessages(id: string, since?: number): Promise<AgentMessage[]> {
|
|
200
283
|
const query = since ? { since } : undefined;
|
|
201
|
-
const response = await this.get(`/${id}/updates`, { query }) as AgentRunUpdatesResponse;
|
|
202
|
-
return response.messages.map((m
|
|
284
|
+
const response = (await this.get(`/${id}/updates`, { query })) as AgentRunUpdatesResponse;
|
|
285
|
+
return response.messages.map((m) => toAgentMessage(parseMessage(m), id));
|
|
203
286
|
}
|
|
204
287
|
|
|
205
288
|
/**
|
|
@@ -224,6 +307,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
224
307
|
onMessage?: (message: AgentMessage, exitFn?: (payload: unknown) => void) => void,
|
|
225
308
|
since?: number,
|
|
226
309
|
signal?: AbortSignal,
|
|
310
|
+
options?: AgentRunStreamMessagesOptions,
|
|
227
311
|
): Promise<unknown> {
|
|
228
312
|
let resolveFn: (value: unknown) => void = () => {};
|
|
229
313
|
let rejectFn: (reason?: unknown) => void = () => {};
|
|
@@ -234,6 +318,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
234
318
|
|
|
235
319
|
let reconnectAttempts = 0;
|
|
236
320
|
let lastMessageTimestamp = since || 0;
|
|
321
|
+
const historyFetchStartedAt = Date.now();
|
|
237
322
|
let isClosed = false;
|
|
238
323
|
let currentSse: EventSource | null = null;
|
|
239
324
|
let interval: ReturnType<typeof setInterval> | null = null;
|
|
@@ -245,16 +330,28 @@ export class AgentsApi extends ApiTopic {
|
|
|
245
330
|
const maxDelay = 30000;
|
|
246
331
|
|
|
247
332
|
const calculateBackoffDelay = (attempts: number): number => {
|
|
248
|
-
const exponentialDelay = Math.min(baseDelay *
|
|
333
|
+
const exponentialDelay = Math.min(baseDelay * 2 ** attempts, maxDelay);
|
|
249
334
|
const jitter = Math.random() * 0.1 * exponentialDelay;
|
|
250
335
|
return exponentialDelay + jitter;
|
|
251
336
|
};
|
|
252
337
|
|
|
253
338
|
const cleanup = () => {
|
|
254
|
-
if (reconnectTimer) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
339
|
+
if (reconnectTimer) {
|
|
340
|
+
clearTimeout(reconnectTimer);
|
|
341
|
+
reconnectTimer = null;
|
|
342
|
+
}
|
|
343
|
+
if (interval) {
|
|
344
|
+
clearInterval(interval);
|
|
345
|
+
interval = null;
|
|
346
|
+
}
|
|
347
|
+
if (currentSse) {
|
|
348
|
+
currentSse.close();
|
|
349
|
+
currentSse = null;
|
|
350
|
+
}
|
|
351
|
+
if (signal && abortHandler) {
|
|
352
|
+
signal.removeEventListener('abort', abortHandler);
|
|
353
|
+
abortHandler = null;
|
|
354
|
+
}
|
|
258
355
|
};
|
|
259
356
|
|
|
260
357
|
const exit = (payload: unknown) => {
|
|
@@ -265,9 +362,71 @@ export class AgentsApi extends ApiTopic {
|
|
|
265
362
|
}
|
|
266
363
|
};
|
|
267
364
|
|
|
365
|
+
// SSE reconnection exhausted. The run is durable and still executing
|
|
366
|
+
// server-side — only the live view dropped. Failing fatally here aborts
|
|
367
|
+
// headless consumers (CLI `agents stream`, agent test harnesses) before
|
|
368
|
+
// they can read the result. Instead degrade gracefully: poll GET /updates
|
|
369
|
+
// for any messages we missed and exit cleanly once the run is terminal,
|
|
370
|
+
// even if the terminal message never streamed.
|
|
371
|
+
const POLL_INTERVAL_MS = 5000;
|
|
372
|
+
const isTerminalStatus = (status: unknown): boolean =>
|
|
373
|
+
typeof status === 'string' && ['completed', 'failed', 'cancelled'].includes(status);
|
|
374
|
+
const degradeToPolling = (reason: unknown) => {
|
|
375
|
+
if (isClosed) return;
|
|
376
|
+
cleanup();
|
|
377
|
+
console.warn(
|
|
378
|
+
`Agent stream ${id}: SSE unavailable after ${maxReconnectAttempts} attempts; falling back to /updates polling.`,
|
|
379
|
+
reason instanceof Error ? reason.message : reason,
|
|
380
|
+
);
|
|
381
|
+
const tick = async () => {
|
|
382
|
+
if (isClosed) return;
|
|
383
|
+
try {
|
|
384
|
+
const recent = await this.retrieveMessages(id, lastMessageTimestamp || undefined);
|
|
385
|
+
for (const msg of recent) {
|
|
386
|
+
if (isClosed) return;
|
|
387
|
+
if ((msg.timestamp || 0) <= lastMessageTimestamp) continue;
|
|
388
|
+
lastMessageTimestamp = msg.timestamp || lastMessageTimestamp;
|
|
389
|
+
if (onMessage) onMessage(msg, exit);
|
|
390
|
+
if (isClosed) return;
|
|
391
|
+
if (shouldCloseAgentRunStream(msg, id)) {
|
|
392
|
+
exit(null);
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
} catch {
|
|
397
|
+
// transient poll error — retry next tick
|
|
398
|
+
}
|
|
399
|
+
if (isClosed) return;
|
|
400
|
+
// Exit even when no terminal message ever streams, by reading the run record.
|
|
401
|
+
try {
|
|
402
|
+
const run = (await this.get(`/${id}`)) as { status?: unknown };
|
|
403
|
+
if (isTerminalStatus(run?.status)) {
|
|
404
|
+
exit(null);
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
} catch {
|
|
408
|
+
// ignore — retry next tick
|
|
409
|
+
}
|
|
410
|
+
if (!isClosed) {
|
|
411
|
+
reconnectTimer = setTimeout(() => {
|
|
412
|
+
reconnectTimer = null;
|
|
413
|
+
void tick();
|
|
414
|
+
}, POLL_INTERVAL_MS);
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
void tick();
|
|
418
|
+
};
|
|
419
|
+
|
|
268
420
|
if (signal) {
|
|
269
|
-
if (signal.aborted) {
|
|
270
|
-
|
|
421
|
+
if (signal.aborted) {
|
|
422
|
+
isClosed = true;
|
|
423
|
+
cleanup();
|
|
424
|
+
resolveFn(null);
|
|
425
|
+
return promise;
|
|
426
|
+
}
|
|
427
|
+
abortHandler = () => {
|
|
428
|
+
exit(null);
|
|
429
|
+
};
|
|
271
430
|
signal.addEventListener('abort', abortHandler, { once: true });
|
|
272
431
|
}
|
|
273
432
|
|
|
@@ -275,27 +434,35 @@ export class AgentsApi extends ApiTopic {
|
|
|
275
434
|
try {
|
|
276
435
|
if (!isClosed) {
|
|
277
436
|
const historical = await this.retrieveMessages(id, since);
|
|
278
|
-
|
|
437
|
+
options?.onHistoryLoaded?.(historical);
|
|
438
|
+
let shouldCloseAfterHistory = false;
|
|
439
|
+
for (let index = 0; index < historical.length; index++) {
|
|
440
|
+
const msg = historical[index];
|
|
279
441
|
if (isClosed) break;
|
|
280
442
|
lastMessageTimestamp = Math.max(lastMessageTimestamp, msg.timestamp || 0);
|
|
281
443
|
if (onMessage) onMessage(msg, exit);
|
|
282
444
|
if (isClosed) break;
|
|
283
445
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
exit(null);
|
|
290
|
-
return promise;
|
|
291
|
-
}
|
|
446
|
+
shouldCloseAfterHistory = index === historical.length - 1 && shouldCloseAgentRunStream(msg, id);
|
|
447
|
+
}
|
|
448
|
+
if (shouldCloseAfterHistory) {
|
|
449
|
+
exit(null);
|
|
450
|
+
return promise;
|
|
292
451
|
}
|
|
293
452
|
}
|
|
294
453
|
} catch (err) {
|
|
295
454
|
if (!isClosed) {
|
|
455
|
+
options?.onHistoryError?.(err);
|
|
296
456
|
console.warn('Failed to fetch historical messages, continuing with SSE:', err);
|
|
297
457
|
}
|
|
298
458
|
}
|
|
459
|
+
if (!isClosed && lastMessageTimestamp <= 0) {
|
|
460
|
+
// The server only replays the GET-to-SSE handoff gap when `since > 0`.
|
|
461
|
+
// New runs often have no history yet, so use the GET start time as the
|
|
462
|
+
// cursor to avoid dropping messages emitted before the SSE subscription
|
|
463
|
+
// is active.
|
|
464
|
+
lastMessageTimestamp = Math.max(1, historyFetchStartedAt - 1);
|
|
465
|
+
}
|
|
299
466
|
|
|
300
467
|
// 2. Connect to SSE for real-time updates
|
|
301
468
|
const setupStream = async (isReconnect: boolean = false) => {
|
|
@@ -304,7 +471,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
304
471
|
const EventSourceImpl = await EventSourceProvider();
|
|
305
472
|
if (isClosed) return;
|
|
306
473
|
const client = this.client as VertesiaClient;
|
|
307
|
-
const streamUrl = new URL(client.agents.baseUrl
|
|
474
|
+
const streamUrl = new URL(`${client.agents.baseUrl}/${id}/stream`);
|
|
308
475
|
|
|
309
476
|
if (lastMessageTimestamp > 0) {
|
|
310
477
|
streamUrl.searchParams.set('since', lastMessageTimestamp.toString());
|
|
@@ -324,13 +491,15 @@ export class AgentsApi extends ApiTopic {
|
|
|
324
491
|
streamUrl.searchParams.set('access_token', token);
|
|
325
492
|
|
|
326
493
|
if (isReconnect) {
|
|
327
|
-
console.log(
|
|
494
|
+
console.log(
|
|
495
|
+
`Reconnecting to agent stream ${id} (attempt ${reconnectAttempts + 1}/${maxReconnectAttempts})`,
|
|
496
|
+
);
|
|
328
497
|
}
|
|
329
498
|
|
|
330
499
|
if (isClosed) return;
|
|
331
500
|
const sse = new EventSourceImpl(streamUrl.href);
|
|
332
501
|
currentSse = sse;
|
|
333
|
-
interval = setInterval(() => {
|
|
502
|
+
interval = setInterval(() => {}, 1000);
|
|
334
503
|
|
|
335
504
|
let connectionOpenedAt = 0;
|
|
336
505
|
|
|
@@ -356,11 +525,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
356
525
|
onMessage(agentMessage, exit);
|
|
357
526
|
}
|
|
358
527
|
|
|
359
|
-
|
|
360
|
-
const streamIsOver =
|
|
361
|
-
compactMessage.t === AgentMessageType.TERMINATED ||
|
|
362
|
-
(compactMessage.t === AgentMessageType.COMPLETE && workstreamId === 'main');
|
|
363
|
-
if (streamIsOver) {
|
|
528
|
+
if (shouldCloseCompactRunStream(compactMessage, id)) {
|
|
364
529
|
exit(null);
|
|
365
530
|
}
|
|
366
531
|
} catch (err) {
|
|
@@ -386,12 +551,12 @@ export class AgentsApi extends ApiTopic {
|
|
|
386
551
|
reconnectAttempts++;
|
|
387
552
|
reconnectTimer = setTimeout(() => {
|
|
388
553
|
reconnectTimer = null;
|
|
389
|
-
if (!isClosed) setupStream(true);
|
|
554
|
+
if (!isClosed) void setupStream(true);
|
|
390
555
|
}, delay);
|
|
391
556
|
} else {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
557
|
+
degradeToPolling(
|
|
558
|
+
new Error(`SSE connection failed after ${maxReconnectAttempts} reconnection attempts`),
|
|
559
|
+
);
|
|
395
560
|
}
|
|
396
561
|
};
|
|
397
562
|
} catch (err) {
|
|
@@ -401,17 +566,15 @@ export class AgentsApi extends ApiTopic {
|
|
|
401
566
|
reconnectAttempts++;
|
|
402
567
|
reconnectTimer = setTimeout(() => {
|
|
403
568
|
reconnectTimer = null;
|
|
404
|
-
if (!isClosed) setupStream(true);
|
|
569
|
+
if (!isClosed) void setupStream(true);
|
|
405
570
|
}, delay);
|
|
406
571
|
} else {
|
|
407
|
-
|
|
408
|
-
cleanup();
|
|
409
|
-
rejectFn(err);
|
|
572
|
+
degradeToPolling(err);
|
|
410
573
|
}
|
|
411
574
|
}
|
|
412
575
|
};
|
|
413
576
|
|
|
414
|
-
setupStream(false);
|
|
577
|
+
void setupStream(false);
|
|
415
578
|
return promise;
|
|
416
579
|
}
|
|
417
580
|
|
|
@@ -435,10 +598,12 @@ export class AgentsApi extends ApiTopic {
|
|
|
435
598
|
id: string,
|
|
436
599
|
options?: {
|
|
437
600
|
includeHistory?: boolean;
|
|
601
|
+
hydratePayloads?: boolean;
|
|
438
602
|
},
|
|
439
603
|
): Promise<WorkflowRunWithDetails> {
|
|
440
604
|
const query: Record<string, string> = {};
|
|
441
605
|
if (options?.includeHistory) query.include_history = 'true';
|
|
606
|
+
if (options?.hydratePayloads) query.hydrate_payloads = 'true';
|
|
442
607
|
return this.get(`/${id}/details`, { query });
|
|
443
608
|
}
|
|
444
609
|
|
|
@@ -453,7 +618,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
453
618
|
): Promise<void> {
|
|
454
619
|
const EventSourceImpl = await EventSourceProvider();
|
|
455
620
|
const client = this.client as VertesiaClient;
|
|
456
|
-
const streamUrl = new URL(client.agents.baseUrl
|
|
621
|
+
const streamUrl = new URL(`${client.agents.baseUrl}/${id}/details/stream`);
|
|
457
622
|
|
|
458
623
|
const bearerToken = client._auth ? await client._auth() : undefined;
|
|
459
624
|
if (!bearerToken) {
|
|
@@ -475,34 +640,53 @@ export class AgentsApi extends ApiTopic {
|
|
|
475
640
|
};
|
|
476
641
|
|
|
477
642
|
if (signal) {
|
|
478
|
-
if (signal.aborted) {
|
|
479
|
-
|
|
643
|
+
if (signal.aborted) {
|
|
644
|
+
cleanup();
|
|
645
|
+
resolve();
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
abortHandler = () => {
|
|
649
|
+
cleanup();
|
|
650
|
+
resolve();
|
|
651
|
+
};
|
|
480
652
|
signal.addEventListener('abort', abortHandler, { once: true });
|
|
481
653
|
}
|
|
482
654
|
|
|
483
655
|
sse.addEventListener('history', (ev: MessageEvent) => {
|
|
484
656
|
try {
|
|
485
|
-
const data = JSON.parse(ev.data) as Extract<
|
|
657
|
+
const data = JSON.parse(ev.data) as Extract<
|
|
658
|
+
AgentRunDetailsStreamEvent,
|
|
659
|
+
{ type: 'history' }
|
|
660
|
+
>['data'];
|
|
486
661
|
if (onEvent) onEvent({ type: 'history', data });
|
|
487
|
-
} catch (_err) {
|
|
662
|
+
} catch (_err) {
|
|
663
|
+
/* ignore parse errors */
|
|
664
|
+
}
|
|
488
665
|
});
|
|
489
666
|
|
|
490
667
|
sse.addEventListener('control', (ev: MessageEvent) => {
|
|
491
668
|
try {
|
|
492
|
-
const data = JSON.parse(ev.data) as Extract<
|
|
669
|
+
const data = JSON.parse(ev.data) as Extract<
|
|
670
|
+
AgentRunDetailsStreamEvent,
|
|
671
|
+
{ type: 'control' }
|
|
672
|
+
>['data'];
|
|
493
673
|
if (onEvent) onEvent({ type: 'control', data });
|
|
494
674
|
if ('type' in data && data.type === 'done') {
|
|
495
675
|
cleanup();
|
|
496
676
|
resolve();
|
|
497
677
|
}
|
|
498
|
-
} catch (_err) {
|
|
678
|
+
} catch (_err) {
|
|
679
|
+
/* ignore parse errors */
|
|
680
|
+
}
|
|
499
681
|
});
|
|
500
682
|
|
|
501
683
|
sse.addEventListener('error', (ev: MessageEvent) => {
|
|
502
684
|
try {
|
|
503
685
|
const data = JSON.parse(ev.data) as Extract<AgentRunDetailsStreamEvent, { type: 'error' }>['data'];
|
|
504
686
|
if (onEvent) onEvent({ type: 'error', data });
|
|
505
|
-
} catch (_err) {
|
|
687
|
+
} catch (_err) {
|
|
688
|
+
/* ignore parse errors */
|
|
689
|
+
}
|
|
506
690
|
});
|
|
507
691
|
|
|
508
692
|
sse.onerror = (_err: unknown) => {
|
|
@@ -513,7 +697,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
513
697
|
}
|
|
514
698
|
|
|
515
699
|
/**
|
|
516
|
-
* List child workflows
|
|
700
|
+
* List child workflows for an agent or process run.
|
|
517
701
|
*/
|
|
518
702
|
listChildren(id: string): Promise<ListWorkflowRunsResponse> {
|
|
519
703
|
return this.get(`/${id}/children`);
|
|
@@ -521,15 +705,16 @@ export class AgentsApi extends ApiTopic {
|
|
|
521
705
|
|
|
522
706
|
/**
|
|
523
707
|
* Get details for a specific child workflow.
|
|
524
|
-
* Serves from
|
|
708
|
+
* Serves from the child run record when available, falls back to archive or Temporal.
|
|
525
709
|
*/
|
|
526
710
|
getChildDetails(
|
|
527
711
|
id: string,
|
|
528
712
|
childWorkflowId: string,
|
|
529
|
-
options?: { includeHistory?: boolean },
|
|
713
|
+
options?: { includeHistory?: boolean; hydratePayloads?: boolean },
|
|
530
714
|
): Promise<WorkflowRunWithDetails> {
|
|
531
715
|
const query: Record<string, string> = {};
|
|
532
716
|
if (options?.includeHistory) query.include_history = 'true';
|
|
717
|
+
if (options?.hydratePayloads) query.hydrate_payloads = 'true';
|
|
533
718
|
return this.get(`/${id}/children/${childWorkflowId}/details`, { query });
|
|
534
719
|
}
|
|
535
720
|
|
|
@@ -582,12 +767,12 @@ export class AgentsApi extends ApiTopic {
|
|
|
582
767
|
const mimeType = contentType || 'application/octet-stream';
|
|
583
768
|
|
|
584
769
|
// 1. Get signed upload URL from the agents API
|
|
585
|
-
const result = await this.put(`/${id}/artifacts/${path}`, {
|
|
770
|
+
const result = (await this.put(`/${id}/artifacts/${path}`, {
|
|
586
771
|
headers: { 'Content-Type': mimeType },
|
|
587
|
-
}) as AgentArtifactUrlResponse;
|
|
772
|
+
})) as AgentArtifactUrlResponse;
|
|
588
773
|
|
|
589
774
|
// 2. Upload directly to cloud storage
|
|
590
|
-
const res = await
|
|
775
|
+
const res = await fetchSignedUrl(result.url, {
|
|
591
776
|
method: 'PUT',
|
|
592
777
|
body: content,
|
|
593
778
|
headers: { 'Content-Type': mimeType },
|
|
@@ -603,12 +788,9 @@ export class AgentsApi extends ApiTopic {
|
|
|
603
788
|
/**
|
|
604
789
|
* Download an artifact from an agent run.
|
|
605
790
|
*/
|
|
606
|
-
async downloadArtifact(
|
|
607
|
-
id: string,
|
|
608
|
-
path: string,
|
|
609
|
-
): Promise<ReadableStream<Uint8Array>> {
|
|
791
|
+
async downloadArtifact(id: string, path: string): Promise<ReadableStream<Uint8Array>> {
|
|
610
792
|
const { url } = await this.getArtifactUrl(id, path, 'attachment');
|
|
611
|
-
const res = await
|
|
793
|
+
const res = await fetchSignedUrl(url);
|
|
612
794
|
if (!res.ok) {
|
|
613
795
|
throw new Error(`Failed to download artifact: ${res.statusText}`);
|
|
614
796
|
}
|
|
@@ -626,10 +808,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
626
808
|
* Ingest telemetry events for an agent run.
|
|
627
809
|
* Workers use this to send telemetry to zeno-server for BigQuery storage.
|
|
628
810
|
*/
|
|
629
|
-
ingestEvents(
|
|
630
|
-
agentRunId: string,
|
|
631
|
-
events: AgentEvent[],
|
|
632
|
-
): Promise<IngestAgentEventsResponse> {
|
|
811
|
+
ingestEvents(agentRunId: string, events: AgentEvent[]): Promise<IngestAgentEventsResponse> {
|
|
633
812
|
const payload: IngestAgentEventsPayload = { events };
|
|
634
813
|
return this.post(`/${agentRunId}/events`, { payload });
|
|
635
814
|
}
|
|
@@ -642,9 +821,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
642
821
|
* Get analytics summary.
|
|
643
822
|
* Returns overall metrics including token usage, success rates, and run counts.
|
|
644
823
|
*/
|
|
645
|
-
getAnalyticsSummary(
|
|
646
|
-
query: WorkflowAnalyticsSummaryQuery = {}
|
|
647
|
-
): Promise<WorkflowAnalyticsSummaryResponse> {
|
|
824
|
+
getAnalyticsSummary(query: WorkflowAnalyticsSummaryQuery = {}): Promise<WorkflowAnalyticsSummaryResponse> {
|
|
648
825
|
return this.post('/analytics/summary', { payload: query });
|
|
649
826
|
}
|
|
650
827
|
|
|
@@ -652,9 +829,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
652
829
|
* Get token usage analytics.
|
|
653
830
|
* Returns token consumption metrics by model, agent, tool, or over time.
|
|
654
831
|
*/
|
|
655
|
-
getTokenUsageAnalytics(
|
|
656
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
657
|
-
): Promise<TokenUsageAnalyticsResponse> {
|
|
832
|
+
getTokenUsageAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<TokenUsageAnalyticsResponse> {
|
|
658
833
|
return this.post('/analytics/tokens', { payload: query });
|
|
659
834
|
}
|
|
660
835
|
|
|
@@ -662,9 +837,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
662
837
|
* Get LLM latency analytics.
|
|
663
838
|
* Returns duration/latency metrics for LLM calls.
|
|
664
839
|
*/
|
|
665
|
-
getLlmLatencyAnalytics(
|
|
666
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
667
|
-
): Promise<LatencyAnalyticsResponse> {
|
|
840
|
+
getLlmLatencyAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<LatencyAnalyticsResponse> {
|
|
668
841
|
return this.post('/analytics/latency/llm', { payload: query });
|
|
669
842
|
}
|
|
670
843
|
|
|
@@ -672,9 +845,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
672
845
|
* Get tool latency analytics.
|
|
673
846
|
* Returns duration/latency metrics for tool calls.
|
|
674
847
|
*/
|
|
675
|
-
getToolLatencyAnalytics(
|
|
676
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
677
|
-
): Promise<LatencyAnalyticsResponse> {
|
|
848
|
+
getToolLatencyAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<LatencyAnalyticsResponse> {
|
|
678
849
|
return this.post('/analytics/latency/tools', { payload: query });
|
|
679
850
|
}
|
|
680
851
|
|
|
@@ -682,9 +853,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
682
853
|
* Get agent latency analytics.
|
|
683
854
|
* Returns duration metrics for complete agent runs.
|
|
684
855
|
*/
|
|
685
|
-
getAgentLatencyAnalytics(
|
|
686
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
687
|
-
): Promise<LatencyAnalyticsResponse> {
|
|
856
|
+
getAgentLatencyAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<LatencyAnalyticsResponse> {
|
|
688
857
|
return this.post('/analytics/latency/agents', { payload: query });
|
|
689
858
|
}
|
|
690
859
|
|
|
@@ -692,9 +861,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
692
861
|
* Get error analytics.
|
|
693
862
|
* Returns error rates, types, and trends.
|
|
694
863
|
*/
|
|
695
|
-
getErrorAnalytics(
|
|
696
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
697
|
-
): Promise<ErrorAnalyticsResponse> {
|
|
864
|
+
getErrorAnalytics(query: WorkflowAnalyticsTimeSeriesQuery = {}): Promise<ErrorAnalyticsResponse> {
|
|
698
865
|
return this.post('/analytics/errors', { payload: query });
|
|
699
866
|
}
|
|
700
867
|
|
|
@@ -702,9 +869,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
702
869
|
* Get tool usage analytics.
|
|
703
870
|
* Returns tool invocation counts, success rates, and performance metrics.
|
|
704
871
|
*/
|
|
705
|
-
getToolAnalytics(
|
|
706
|
-
query: WorkflowAnalyticsSummaryQuery = {}
|
|
707
|
-
): Promise<ToolAnalyticsResponse> {
|
|
872
|
+
getToolAnalytics(query: WorkflowAnalyticsSummaryQuery = {}): Promise<ToolAnalyticsResponse> {
|
|
708
873
|
return this.post('/analytics/tools', { payload: query });
|
|
709
874
|
}
|
|
710
875
|
|
|
@@ -712,9 +877,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
712
877
|
* Get tool parameter analytics.
|
|
713
878
|
* Returns parameter value distributions for a specific tool.
|
|
714
879
|
*/
|
|
715
|
-
getToolParameterAnalytics(
|
|
716
|
-
query: WorkflowToolParametersQuery
|
|
717
|
-
): Promise<ToolParameterAnalyticsResponse> {
|
|
880
|
+
getToolParameterAnalytics(query: WorkflowToolParametersQuery): Promise<ToolParameterAnalyticsResponse> {
|
|
718
881
|
return this.post('/analytics/tools/parameters', { payload: query });
|
|
719
882
|
}
|
|
720
883
|
|
|
@@ -723,7 +886,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
723
886
|
* Returns unique agents, environments, and models from telemetry data.
|
|
724
887
|
*/
|
|
725
888
|
getAnalyticsFilterOptions(
|
|
726
|
-
query: WorkflowAnalyticsSummaryQuery = {}
|
|
889
|
+
query: WorkflowAnalyticsSummaryQuery = {},
|
|
727
890
|
): Promise<WorkflowAnalyticsFilterOptionsResponse> {
|
|
728
891
|
return this.post('/analytics/filter-options', { payload: query });
|
|
729
892
|
}
|
|
@@ -732,9 +895,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
732
895
|
* Get average prompt size (input tokens) by agent for startConversation calls.
|
|
733
896
|
* This represents the initial prompt + tools size.
|
|
734
897
|
*/
|
|
735
|
-
getPromptSizeAnalytics(
|
|
736
|
-
query: WorkflowAnalyticsSummaryQuery = {}
|
|
737
|
-
): Promise<PromptSizeAnalyticsResponse> {
|
|
898
|
+
getPromptSizeAnalytics(query: WorkflowAnalyticsSummaryQuery = {}): Promise<PromptSizeAnalyticsResponse> {
|
|
738
899
|
return this.post('/analytics/prompt-size', { payload: query });
|
|
739
900
|
}
|
|
740
901
|
|
|
@@ -742,9 +903,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
742
903
|
* Get top principals (users/API keys) who started the most agent runs.
|
|
743
904
|
* Returns the top N principals sorted by run count descending.
|
|
744
905
|
*/
|
|
745
|
-
getTopPrincipalsAnalytics(
|
|
746
|
-
query: WorkflowAnalyticsSummaryQuery = {}
|
|
747
|
-
): Promise<TopPrincipalsAnalyticsResponse> {
|
|
906
|
+
getTopPrincipalsAnalytics(query: WorkflowAnalyticsSummaryQuery = {}): Promise<TopPrincipalsAnalyticsResponse> {
|
|
748
907
|
return this.post('/analytics/top-principals', { payload: query });
|
|
749
908
|
}
|
|
750
909
|
|
|
@@ -752,9 +911,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
752
911
|
* Get agent run distribution - how many runs per agent/interaction type.
|
|
753
912
|
* Returns the top N agents sorted by run count descending.
|
|
754
913
|
*/
|
|
755
|
-
getRunsByAgentAnalytics(
|
|
756
|
-
query: WorkflowAnalyticsSummaryQuery = {}
|
|
757
|
-
): Promise<RunsByAgentAnalyticsResponse> {
|
|
914
|
+
getRunsByAgentAnalytics(query: WorkflowAnalyticsSummaryQuery = {}): Promise<RunsByAgentAnalyticsResponse> {
|
|
758
915
|
return this.post('/analytics/runs-by-agent', { payload: query });
|
|
759
916
|
}
|
|
760
917
|
|
|
@@ -764,7 +921,7 @@ export class AgentsApi extends ApiTopic {
|
|
|
764
921
|
* Returns average, min, max, median, p95, and p99 metrics.
|
|
765
922
|
*/
|
|
766
923
|
getTimeToFirstResponseAnalytics(
|
|
767
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
924
|
+
query: WorkflowAnalyticsTimeSeriesQuery = {},
|
|
768
925
|
): Promise<TimeToFirstResponseAnalyticsResponse> {
|
|
769
926
|
return this.post('/analytics/time-to-first-response', { payload: query });
|
|
770
927
|
}
|
|
@@ -776,9 +933,12 @@ export class AgentsApi extends ApiTopic {
|
|
|
776
933
|
* - Percentage of agents that return no tool calls at start
|
|
777
934
|
*/
|
|
778
935
|
getFirstResponseBehaviorAnalytics(
|
|
779
|
-
query: WorkflowAnalyticsTimeSeriesQuery = {}
|
|
936
|
+
query: WorkflowAnalyticsTimeSeriesQuery = {},
|
|
780
937
|
): Promise<FirstResponseBehaviorAnalyticsResponse> {
|
|
781
938
|
return this.post('/analytics/first-response-behavior', { payload: query });
|
|
782
939
|
}
|
|
940
|
+
}
|
|
783
941
|
|
|
942
|
+
function isProcessRunResponse(run: AgentRunResponse): run is ProcessRun {
|
|
943
|
+
return run.run_kind === 'process';
|
|
784
944
|
}
|