@vertesia/client 1.2.0 → 1.4.0-dev.20260614.160504Z
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{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 +51 -0
- package/lib/IamApi.d.ts.map +1 -0
- package/lib/IamApi.js +67 -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} +8 -7
- package/lib/RunsApi.d.ts.map +1 -0
- package/lib/{esm/RunsApi.js → RunsApi.js} +11 -11
- 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} +42 -27
- package/lib/client.d.ts.map +1 -0
- package/lib/{esm/client.js → client.js} +90 -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} +13 -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 +55 -8
- package/lib/store/AgentsApi.d.ts.map +1 -0
- package/lib/{esm/store → store}/AgentsApi.js +155 -47
- 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 +44 -46
- package/lib/store/WorkflowsApi.js.map +1 -0
- package/lib/store/client.d.ts +59 -0
- package/lib/store/client.d.ts.map +1 -0
- package/lib/{esm/store → store}/client.js +32 -29
- 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 +20 -0
- package/lib/store/index.d.ts.map +1 -0
- package/lib/store/index.js +20 -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 +1 -0
- package/lib/store/version.d.ts.map +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 +25 -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 +46 -23
- 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 +22 -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 +130 -103
- package/src/execute.ts +41 -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 +285 -143
- 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 +140 -146
- package/src/store/client.ts +44 -39
- package/src/store/errors.ts +3 -3
- package/src/store/index.ts +19 -18
- package/src/store/signed-url.test.ts +182 -0
- package/src/store/signed-url.ts +184 -0
- package/src/store/stream-termination.test.ts +58 -0
- package/src/store/stream-termination.ts +40 -0
- package/src/store/version.ts +1 -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.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/lib/{esm/store → store}/version.js +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
+
import type { CreateUserGroupPayload, DeleteByIdResult, UpdateUserGroupPayload, UserGroup, UserRef } from '@vertesia/common';
|
|
3
3
|
export interface GroupsQueryOptions {
|
|
4
4
|
search?: string;
|
|
5
5
|
tags?: string[];
|
|
@@ -67,3 +67,4 @@ export declare class GroupsApi extends ApiTopic {
|
|
|
67
67
|
*/
|
|
68
68
|
syncMembers(): Promise<UserGroup>;
|
|
69
69
|
}
|
|
70
|
+
//# sourceMappingURL=GroupsApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupsApi.d.ts","sourceRoot":"","sources":["../src/GroupsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EACR,sBAAsB,EACtB,gBAAgB,EAChB,sBAAsB,EACtB,SAAS,EACT,OAAO,EACV,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,kBAAkB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;CACzD;AAED,qBAAa,SAAU,SAAQ,QAAQ;gBACvB,MAAM,EAAE,UAAU;IAI9B;;;;OAIG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAIxD;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC;IAI3D;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAI7C;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,SAAS,CAAC;IAI5E;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIlD;;;;OAIG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAIhD;;;;;OAKG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAI9D;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAIjE;;;;OAIG;IACH,WAAW,IAAI,OAAO,CAAC,SAAS,CAAC;CAGpC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ApiTopic } from
|
|
1
|
+
import { ApiTopic } from '@vertesia/api-fetch-client';
|
|
2
2
|
export class GroupsApi extends ApiTopic {
|
|
3
3
|
constructor(parent) {
|
|
4
|
-
super(parent,
|
|
4
|
+
super(parent, '/groups');
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* List all groups in the current account
|
|
@@ -25,7 +25,7 @@ export class GroupsApi extends ApiTopic {
|
|
|
25
25
|
* @returns The UserGroup object
|
|
26
26
|
*/
|
|
27
27
|
retrieve(groupId) {
|
|
28
|
-
return this.get(
|
|
28
|
+
return this.get(`/${groupId}`);
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* Update a group
|
|
@@ -34,7 +34,7 @@ export class GroupsApi extends ApiTopic {
|
|
|
34
34
|
* @returns The updated UserGroup object
|
|
35
35
|
*/
|
|
36
36
|
update(groupId, payload) {
|
|
37
|
-
return this.put(
|
|
37
|
+
return this.put(`/${groupId}`, { payload });
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Delete a group
|
|
@@ -42,7 +42,7 @@ export class GroupsApi extends ApiTopic {
|
|
|
42
42
|
* @returns Object with the deleted group ID
|
|
43
43
|
*/
|
|
44
44
|
delete(groupId) {
|
|
45
|
-
return this.del(
|
|
45
|
+
return this.del(`/${groupId}`);
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* List members of a group
|
|
@@ -50,7 +50,7 @@ export class GroupsApi extends ApiTopic {
|
|
|
50
50
|
* @returns Array of UserRef objects representing group members
|
|
51
51
|
*/
|
|
52
52
|
listMembers(groupId) {
|
|
53
|
-
return this.get(
|
|
53
|
+
return this.get(`/${groupId}/members`);
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
56
|
* Add a member to a group
|
|
@@ -59,7 +59,7 @@ export class GroupsApi extends ApiTopic {
|
|
|
59
59
|
* @returns The updated UserGroup object
|
|
60
60
|
*/
|
|
61
61
|
addMember(groupId, userId) {
|
|
62
|
-
return this.post(
|
|
62
|
+
return this.post(`/${groupId}/members/${userId}`);
|
|
63
63
|
}
|
|
64
64
|
/**
|
|
65
65
|
* Remove a member from a group
|
|
@@ -68,7 +68,7 @@ export class GroupsApi extends ApiTopic {
|
|
|
68
68
|
* @returns The updated UserGroup object
|
|
69
69
|
*/
|
|
70
70
|
removeMember(groupId, userId) {
|
|
71
|
-
return this.del(
|
|
71
|
+
return this.del(`/${groupId}/members/${userId}`);
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Sync the account's members group with current organization members.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupsApi.js","sourceRoot":"","sources":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,EAAE,CAAC,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACH,WAAW;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACtC,CAAC;CACJ"}
|
package/lib/IamApi.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
+
import type { ACECreatePayload, ACEUpdatePayload, AccessControlEntry, AcesQueryOptions, DeleteByIdResult, PrincipalIdentity, RoleDefinition } from '@vertesia/common';
|
|
3
|
+
import { GroupsApi } from './GroupsApi.js';
|
|
4
|
+
export interface FilterOption {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
count: number;
|
|
8
|
+
}
|
|
9
|
+
export declare class IamApi extends ApiTopic {
|
|
10
|
+
constructor(parent: ClientBase);
|
|
11
|
+
aces: AcesApi;
|
|
12
|
+
roles: RolesApi;
|
|
13
|
+
groups: GroupsApi;
|
|
14
|
+
/**
|
|
15
|
+
* Fetch the current user's principal identity — the id plus the merged
|
|
16
|
+
* ABAC principal context (clearance, compartments, email, tags, properties).
|
|
17
|
+
*
|
|
18
|
+
* Rejects with HTTP 400 if the caller is not a user principal
|
|
19
|
+
* (API keys, service accounts, etc. — they have no underlying user context).
|
|
20
|
+
*/
|
|
21
|
+
getPrincipalIdentity(): Promise<PrincipalIdentity>;
|
|
22
|
+
}
|
|
23
|
+
export declare class RolesApi extends ApiTopic {
|
|
24
|
+
constructor(parent: ClientBase);
|
|
25
|
+
list(): Promise<RoleDefinition[]>;
|
|
26
|
+
}
|
|
27
|
+
export declare class AcesApi extends ApiTopic {
|
|
28
|
+
constructor(parent: ClientBase);
|
|
29
|
+
/**
|
|
30
|
+
* Get the list of all runs
|
|
31
|
+
* @param project optional project id to filter by
|
|
32
|
+
* @param interaction optional interaction id to filter by
|
|
33
|
+
* @returns InteractionResult[]
|
|
34
|
+
**/
|
|
35
|
+
list(options: AcesQueryOptions): Promise<AccessControlEntry[]>;
|
|
36
|
+
/**
|
|
37
|
+
* List all ACEs scoped to the current project.
|
|
38
|
+
* Returns both regular project ACEs and dynamic (content_set/principal_set) ACEs.
|
|
39
|
+
*/
|
|
40
|
+
listProjectAces(): Promise<AccessControlEntry[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Get an ACE by its Id
|
|
43
|
+
* @param id
|
|
44
|
+
* @returns InteractionResult
|
|
45
|
+
**/
|
|
46
|
+
retrieve(id: string): Promise<AccessControlEntry>;
|
|
47
|
+
create(payload: ACECreatePayload): Promise<AccessControlEntry>;
|
|
48
|
+
update(id: string, payload: ACEUpdatePayload): Promise<AccessControlEntry>;
|
|
49
|
+
delete(id: string): Promise<DeleteByIdResult>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=IamApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IamApi.d.ts","sourceRoot":"","sources":["../src/IamApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EACR,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,MAAO,SAAQ,QAAQ;gBACpB,MAAM,EAAE,UAAU;IAI9B,IAAI,UAAqB;IACzB,KAAK,WAAsB;IAC3B,MAAM,YAAuB;IAE7B;;;;;;OAMG;IACH,oBAAoB,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAGrD;AAED,qBAAa,QAAS,SAAQ,QAAQ;gBACtB,MAAM,EAAE,UAAU;IAI9B,IAAI,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;CAGpC;AAED,qBAAa,OAAQ,SAAQ,QAAQ;gBACrB,MAAM,EAAE,UAAU;IAI9B;;;;;QAKI;IACJ,IAAI,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAI9D;;;OAGG;IACH,eAAe,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAIhD;;;;QAII;IACJ,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIjD,MAAM,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI9D,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI1E,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAGhD"}
|
package/lib/IamApi.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ApiTopic } from '@vertesia/api-fetch-client';
|
|
2
|
+
import { GroupsApi } from './GroupsApi.js';
|
|
3
|
+
export class IamApi extends ApiTopic {
|
|
4
|
+
constructor(parent) {
|
|
5
|
+
super(parent, '/api/v1/iam');
|
|
6
|
+
}
|
|
7
|
+
aces = new AcesApi(this);
|
|
8
|
+
roles = new RolesApi(this);
|
|
9
|
+
groups = new GroupsApi(this);
|
|
10
|
+
/**
|
|
11
|
+
* Fetch the current user's principal identity — the id plus the merged
|
|
12
|
+
* ABAC principal context (clearance, compartments, email, tags, properties).
|
|
13
|
+
*
|
|
14
|
+
* Rejects with HTTP 400 if the caller is not a user principal
|
|
15
|
+
* (API keys, service accounts, etc. — they have no underlying user context).
|
|
16
|
+
*/
|
|
17
|
+
getPrincipalIdentity() {
|
|
18
|
+
return this.get('/users/identity');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export class RolesApi extends ApiTopic {
|
|
22
|
+
constructor(parent) {
|
|
23
|
+
super(parent, '/roles');
|
|
24
|
+
}
|
|
25
|
+
list() {
|
|
26
|
+
return this.get('/');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export class AcesApi extends ApiTopic {
|
|
30
|
+
constructor(parent) {
|
|
31
|
+
super(parent, '/aces');
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get the list of all runs
|
|
35
|
+
* @param project optional project id to filter by
|
|
36
|
+
* @param interaction optional interaction id to filter by
|
|
37
|
+
* @returns InteractionResult[]
|
|
38
|
+
**/
|
|
39
|
+
list(options) {
|
|
40
|
+
return this.get('/', { query: { ...options } });
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* List all ACEs scoped to the current project.
|
|
44
|
+
* Returns both regular project ACEs and dynamic (content_set/principal_set) ACEs.
|
|
45
|
+
*/
|
|
46
|
+
listProjectAces() {
|
|
47
|
+
return this.get('/project');
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get an ACE by its Id
|
|
51
|
+
* @param id
|
|
52
|
+
* @returns InteractionResult
|
|
53
|
+
**/
|
|
54
|
+
retrieve(id) {
|
|
55
|
+
return this.get(`/${id}`);
|
|
56
|
+
}
|
|
57
|
+
create(payload) {
|
|
58
|
+
return this.post('/', { payload });
|
|
59
|
+
}
|
|
60
|
+
update(id, payload) {
|
|
61
|
+
return this.put(`/${id}`, { payload });
|
|
62
|
+
}
|
|
63
|
+
delete(id) {
|
|
64
|
+
return this.del(`/${id}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=IamApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IamApi.js","sourceRoot":"","sources":["../src/IamApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,4BAA4B,CAAC;AAUvE,OAAO,EAAE,SAAS,EAAE,MAA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EAAU,EAAE,OAAyB;QACxC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;CACJ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { VertesiaClient, VertesiaClientProps } from
|
|
3
|
-
export declare class InteractionBase<P =
|
|
1
|
+
import type { InteractionExecutionPayload, InteractionExecutionResult, InteractionUpdatePayload } from '@vertesia/common';
|
|
2
|
+
import { VertesiaClient, type VertesiaClientProps } from './client.js';
|
|
3
|
+
export declare class InteractionBase<P = unknown> {
|
|
4
4
|
id: string;
|
|
5
5
|
client: VertesiaClient;
|
|
6
6
|
constructor(id: string, clientOrOpts: VertesiaClient | VertesiaClientProps);
|
|
@@ -16,7 +16,8 @@ export declare class InteractionBase<P = any> {
|
|
|
16
16
|
* @param id of the interaction to execute
|
|
17
17
|
* @param payload InteractionExecutionPayload
|
|
18
18
|
* @param onChunk callback to be called when the next chunk of the response is available
|
|
19
|
-
* @returns the resolved execution
|
|
19
|
+
* @returns the resolved interaction execution result
|
|
20
20
|
*/
|
|
21
|
-
execute(payload?: InteractionExecutionPayload, onChunk?: (chunk: string) => void): Promise<
|
|
21
|
+
execute(payload?: InteractionExecutionPayload, onChunk?: (chunk: string) => void): Promise<InteractionExecutionResult<P>>;
|
|
22
22
|
}
|
|
23
|
+
//# sourceMappingURL=InteractionBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionBase.d.ts","sourceRoot":"","sources":["../src/InteractionBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,2BAA2B,EAC3B,0BAA0B,EAC1B,wBAAwB,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGvE,qBAAa,eAAe,CAAC,CAAC,GAAG,OAAO;IAIzB,EAAE,EAAE,MAAM;IAHrB,MAAM,EAAE,cAAc,CAAC;gBAGZ,EAAE,EAAE,MAAM,EACjB,YAAY,EAAE,cAAc,GAAG,mBAAmB;IAStD,QAAQ;IAIR,MAAM,CAAC,OAAO,EAAE,wBAAwB;IAKxC,MAAM,CAAC,KAAK,EAAE,CAAC;IAIf;;;;;;;;;;OAUG;IACG,OAAO,CACT,OAAO,GAAE,2BAAgC,EACzC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAClC,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;CAG5C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VertesiaClient } from
|
|
2
|
-
import { executeInteraction } from
|
|
1
|
+
import { VertesiaClient } from './client.js';
|
|
2
|
+
import { executeInteraction } from './execute.js';
|
|
3
3
|
export class InteractionBase {
|
|
4
4
|
id;
|
|
5
5
|
client;
|
|
@@ -20,7 +20,7 @@ export class InteractionBase {
|
|
|
20
20
|
}
|
|
21
21
|
//TODO - Not implemented
|
|
22
22
|
render(_data) {
|
|
23
|
-
throw new Error(
|
|
23
|
+
throw new Error('Not implemented');
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Execute an interaction and return a promise which will be resolved with the executed run when
|
|
@@ -31,7 +31,7 @@ export class InteractionBase {
|
|
|
31
31
|
* @param id of the interaction to execute
|
|
32
32
|
* @param payload InteractionExecutionPayload
|
|
33
33
|
* @param onChunk callback to be called when the next chunk of the response is available
|
|
34
|
-
* @returns the resolved execution
|
|
34
|
+
* @returns the resolved interaction execution result
|
|
35
35
|
*/
|
|
36
36
|
async execute(payload = {}, onChunk) {
|
|
37
37
|
return executeInteraction(this.client, this.id, payload, onChunk);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionBase.js","sourceRoot":"","sources":["../src/InteractionBase.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAA4B,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,MAAM,OAAO,eAAe;IAIb;IAHX,MAAM,CAAiB;IAEvB,YACW,EAAU,EACjB,YAAkD;QAD3C,OAAE,GAAF,EAAE,CAAQ;QAGjB,IAAI,YAAY,YAAY,cAAc,EAAE,CAAC;YACzC,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;QAC/B,CAAC;aAAM,CAAC;YACJ,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,YAAY,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;IAED,QAAQ;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,MAAM,CAAC,OAAiC;QACpC,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED,wBAAwB;IACxB,MAAM,CAAC,KAAQ;QACX,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,OAAO,CACT,UAAuC,EAAE,EACzC,OAAiC;QAEjC,OAAO,kBAAkB,CAAI,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;CACJ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApiTopic, ClientBase } from
|
|
2
|
-
import { CatalogInteractionRef, InCodeInteraction, InteractionStatus } from
|
|
1
|
+
import { ApiTopic, type ClientBase } from '@vertesia/api-fetch-client';
|
|
2
|
+
import type { CatalogInteractionRef, InCodeInteraction, InteractionStatus } from '@vertesia/common';
|
|
3
3
|
export declare class InteractionCatalogApi extends ApiTopic {
|
|
4
4
|
constructor(parent: ClientBase);
|
|
5
5
|
/**
|
|
@@ -34,3 +34,4 @@ export declare class InteractionCatalogApi extends ApiTopic {
|
|
|
34
34
|
*/
|
|
35
35
|
resolve(id: string): Promise<InCodeInteraction>;
|
|
36
36
|
}
|
|
37
|
+
//# sourceMappingURL=InteractionCatalogApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionCatalogApi.d.ts","sourceRoot":"","sources":["../src/InteractionCatalogApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEpG,qBAAa,qBAAsB,SAAQ,QAAQ;gBACnC,MAAM,EAAE,UAAU;IAI9B;;OAEG;IACH,IAAI,CAAC,KAAK,GAAE;QAAE,MAAM,CAAC,EAAE,iBAAiB,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAMhG;;OAEG;IACH,sBAAsB,CAAC,KAAK,GAAE;QAAE,MAAM,CAAC,EAAE,iBAAiB,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAMlH;;OAEG;IACH,mBAAmB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAQnE;;OAEG;IACH,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAQpF;;OAEG;IACH,sBAAsB,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAQtE;;;OAGG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;CAGlD"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { ApiTopic } from
|
|
1
|
+
import { ApiTopic } from '@vertesia/api-fetch-client';
|
|
2
2
|
export class InteractionCatalogApi extends ApiTopic {
|
|
3
3
|
constructor(parent) {
|
|
4
|
-
super(parent,
|
|
4
|
+
super(parent, '/api/v1/interactions/catalog');
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* List all project interactions
|
|
8
8
|
*/
|
|
9
9
|
list(query = {}) {
|
|
10
|
-
return this.get(
|
|
11
|
-
query
|
|
10
|
+
return this.get('/', {
|
|
11
|
+
query,
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* List all stored interactions
|
|
16
16
|
*/
|
|
17
17
|
listStoredInteractions(query = {}) {
|
|
18
|
-
return this.get(
|
|
19
|
-
query
|
|
18
|
+
return this.get('/stored', {
|
|
19
|
+
query,
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -25,8 +25,8 @@ export class InteractionCatalogApi extends ApiTopic {
|
|
|
25
25
|
listSysInteractions(tag) {
|
|
26
26
|
return this.get(`/sys`, {
|
|
27
27
|
query: {
|
|
28
|
-
tag
|
|
29
|
-
}
|
|
28
|
+
tag,
|
|
29
|
+
},
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
@@ -35,8 +35,8 @@ export class InteractionCatalogApi extends ApiTopic {
|
|
|
35
35
|
listAppInteractions(appName, tag) {
|
|
36
36
|
return this.get(`/apps/${appName}`, {
|
|
37
37
|
query: {
|
|
38
|
-
tag
|
|
39
|
-
}
|
|
38
|
+
tag,
|
|
39
|
+
},
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
@@ -45,8 +45,8 @@ export class InteractionCatalogApi extends ApiTopic {
|
|
|
45
45
|
listAllAppInteractions(tag) {
|
|
46
46
|
return this.get(`/apps`, {
|
|
47
47
|
query: {
|
|
48
|
-
tag
|
|
49
|
-
}
|
|
48
|
+
tag,
|
|
49
|
+
},
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionCatalogApi.js","sourceRoot":"","sources":["../src/InteractionCatalogApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,4BAA4B,CAAC;AAGvE,MAAM,OAAO,qBAAsB,SAAQ,QAAQ;IAC/C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,QAAsD,EAAE;QACzD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;YACjB,KAAK;SACR,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,sBAAsB,CAAC,QAAsD,EAAE;QAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE;YACvB,KAAK;SACR,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,GAAY;QAC5B,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;YACpB,KAAK,EAAE;gBACH,GAAG;aACN;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,mBAAmB,CAAC,OAAe,EAAE,GAAY;QAC7C,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,OAAO,EAAE,EAAE;YAChC,KAAK,EAAE;gBACH,GAAG;aACN;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACH,sBAAsB,CAAC,GAAY;QAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE;YACrB,KAAK,EAAE;gBACH,GAAG;aACN;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;OAGG;IACH,OAAO,CAAC,EAAU;QACd,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC;CACJ"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CompletionResult } from '@llumiverse/common';
|
|
2
|
-
import { ExecutionRun, InteractionExecutionResult } from '@vertesia/common';
|
|
1
|
+
import type { CompletionResult, JSONObject } from '@llumiverse/common';
|
|
2
|
+
import type { ExecutionRun, InteractionExecutionResult } from '@vertesia/common';
|
|
3
3
|
/**
|
|
4
4
|
* Symbol used to mark InteractionOutputArray instances.
|
|
5
5
|
* This allows us to detect if a CompletionResult[] has already been wrapped.
|
|
6
6
|
*/
|
|
7
7
|
export declare const IS_INTERACTION_OUTPUT: unique symbol;
|
|
8
|
-
export declare function enhanceInteractionExecutionResult<ResultT =
|
|
9
|
-
export declare function enhanceExecutionRun<ResultT =
|
|
8
|
+
export declare function enhanceInteractionExecutionResult<ResultT = unknown, ParamsT = unknown>(r: InteractionExecutionResult<ParamsT>): EnhancedInteractionExecutionResult<ResultT, ParamsT>;
|
|
9
|
+
export declare function enhanceExecutionRun<ResultT = unknown, ParamsT = unknown>(r: ExecutionRun<ParamsT>): EnhancedExecutionRun<ResultT, ParamsT>;
|
|
10
10
|
/**
|
|
11
11
|
* A convenient wrapper around CompletionResult[] that provides ergonomic accessors
|
|
12
12
|
* for different result types (text, JSON/objects, images) from interaction executions.
|
|
@@ -34,7 +34,7 @@ export declare function enhanceExecutionRun<ResultT = any, ParamsT = any>(r: Exe
|
|
|
34
34
|
* interface OtherType { title: string; }
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
|
-
export declare class InteractionOutput<T =
|
|
37
|
+
export declare class InteractionOutput<T = unknown> {
|
|
38
38
|
readonly results: CompletionResult[];
|
|
39
39
|
/**
|
|
40
40
|
* The raw completion results array.
|
|
@@ -63,8 +63,8 @@ export declare class InteractionOutput<T = any> {
|
|
|
63
63
|
* const text = output.text(); // string
|
|
64
64
|
* ```
|
|
65
65
|
*/
|
|
66
|
-
static from<T =
|
|
67
|
-
static isInteractionOutputArray(obj:
|
|
66
|
+
static from<T = unknown>(results: CompletionResult[] | InteractionOutputArray<T> | JSONObject | string | null | undefined): InteractionOutputArray<T>;
|
|
67
|
+
static isInteractionOutputArray(obj: unknown): boolean;
|
|
68
68
|
get isEmpty(): boolean;
|
|
69
69
|
hasObject(): boolean;
|
|
70
70
|
hasText(): boolean;
|
|
@@ -84,7 +84,7 @@ export declare class InteractionOutput<T = any> {
|
|
|
84
84
|
* @returns The first JSON result typed as T (the class generic type)
|
|
85
85
|
* @throws Error if no JSON result found and text cannot be parsed as JSON
|
|
86
86
|
*/
|
|
87
|
-
object():
|
|
87
|
+
object<U = T>(): U;
|
|
88
88
|
/**
|
|
89
89
|
* Get all JSON results as parsed objects.
|
|
90
90
|
* @returns An array of all JSON results typed as T[] (the class generic type)
|
|
@@ -140,11 +140,11 @@ export declare class InteractionOutput<T = any> {
|
|
|
140
140
|
* Type representing a CompletionResult array enhanced with InteractionOutput methods.
|
|
141
141
|
* This is the return type of InteractionOutput.from() - it acts as both an array and has convenience methods.
|
|
142
142
|
*/
|
|
143
|
-
export type InteractionOutputArray<T =
|
|
144
|
-
export interface EnhancedInteractionExecutionResult<ResultT =
|
|
143
|
+
export type InteractionOutputArray<T = unknown> = CompletionResult[] & InteractionOutput<T>;
|
|
144
|
+
export interface EnhancedInteractionExecutionResult<ResultT = unknown, ParamsT = unknown> extends InteractionExecutionResult<ParamsT> {
|
|
145
145
|
result: InteractionOutputArray<ResultT>;
|
|
146
146
|
}
|
|
147
|
-
export interface EnhancedExecutionRun<ResultT =
|
|
147
|
+
export interface EnhancedExecutionRun<ResultT = unknown, ParamsT = unknown> extends ExecutionRun<ParamsT> {
|
|
148
148
|
result: InteractionOutputArray<ResultT>;
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
@@ -171,4 +171,5 @@ export interface EnhancedExecutionRun<ResultT = any, ParamsT = any> extends Exec
|
|
|
171
171
|
* const img = output.image(); // string
|
|
172
172
|
* ```
|
|
173
173
|
*/
|
|
174
|
-
export declare function createInteractionOutput<T =
|
|
174
|
+
export declare function createInteractionOutput<T = unknown>(results: CompletionResult[]): InteractionOutputArray<T>;
|
|
175
|
+
//# sourceMappingURL=InteractionOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionOutput.d.ts","sourceRoot":"","sources":["../src/InteractionOutput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAEjF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,eAA8B,CAAC;AAEjE,wBAAgB,iCAAiC,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EAClF,CAAC,EAAE,0BAA0B,CAAC,OAAO,CAAC,GACvC,kCAAkC,CAAC,OAAO,EAAE,OAAO,CAAC,CAGtD;AAED,wBAAgB,mBAAmB,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EACpE,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,GACzB,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,CAGxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,iBAAiB,CAAC,CAAC,GAAG,OAAO;aAKV,OAAO,EAAE,gBAAgB,EAAE;IAJvD;;;OAGG;gBACyB,OAAO,EAAE,gBAAgB,EAAE;IAEvD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,EACnB,OAAO,EAAE,gBAAgB,EAAE,GAAG,sBAAsB,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GACjG,sBAAsB,C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C,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAwB3G"}
|
|
@@ -73,8 +73,8 @@ export class InteractionOutput {
|
|
|
73
73
|
if (!results) {
|
|
74
74
|
return createInteractionOutput([]);
|
|
75
75
|
}
|
|
76
|
-
// Check if already wrapped using the symbol marker
|
|
77
|
-
if (results
|
|
76
|
+
// Check if already wrapped using the symbol marker
|
|
77
|
+
if (isInteractionOutputMarker(results)) {
|
|
78
78
|
return results;
|
|
79
79
|
}
|
|
80
80
|
if (Array.isArray(results)) {
|
|
@@ -88,19 +88,19 @@ export class InteractionOutput {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
static isInteractionOutputArray(obj) {
|
|
91
|
-
return obj
|
|
91
|
+
return isInteractionOutputMarker(obj);
|
|
92
92
|
}
|
|
93
93
|
get isEmpty() {
|
|
94
94
|
return this.results.length === 0;
|
|
95
95
|
}
|
|
96
96
|
hasObject() {
|
|
97
|
-
return this.results.some(r => r.type === 'json');
|
|
97
|
+
return this.results.some((r) => r.type === 'json');
|
|
98
98
|
}
|
|
99
99
|
hasText() {
|
|
100
|
-
return this.results.some(r => r.type === 'text');
|
|
100
|
+
return this.results.some((r) => r.type === 'text');
|
|
101
101
|
}
|
|
102
102
|
hasImage() {
|
|
103
|
-
return this.results.some(r => r.type === 'image');
|
|
103
|
+
return this.results.some((r) => r.type === 'image');
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
106
|
* Get the concatenated text from all text results.
|
|
@@ -108,17 +108,15 @@ export class InteractionOutput {
|
|
|
108
108
|
*/
|
|
109
109
|
text(delimiter = '\n') {
|
|
110
110
|
return this.results
|
|
111
|
-
.filter(r => r.type === 'text')
|
|
112
|
-
.map(r => r.value)
|
|
111
|
+
.filter((r) => r.type === 'text')
|
|
112
|
+
.map((r) => r.value)
|
|
113
113
|
.join(delimiter);
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
116
|
* Get an array of all text values from text results.
|
|
117
117
|
*/
|
|
118
118
|
texts() {
|
|
119
|
-
return this.results
|
|
120
|
-
.filter(r => r.type === 'text')
|
|
121
|
-
.map(r => r.value);
|
|
119
|
+
return this.results.filter((r) => r.type === 'text').map((r) => r.value);
|
|
122
120
|
}
|
|
123
121
|
/**
|
|
124
122
|
* Get the first JSON result as a parsed object.
|
|
@@ -127,7 +125,7 @@ export class InteractionOutput {
|
|
|
127
125
|
* @throws Error if no JSON result found and text cannot be parsed as JSON
|
|
128
126
|
*/
|
|
129
127
|
object() {
|
|
130
|
-
const jsonResult = this.results.find(r => r.type === 'json');
|
|
128
|
+
const jsonResult = this.results.find((r) => r.type === 'json');
|
|
131
129
|
if (jsonResult) {
|
|
132
130
|
return jsonResult.value;
|
|
133
131
|
}
|
|
@@ -139,9 +137,7 @@ export class InteractionOutput {
|
|
|
139
137
|
* @returns An array of all JSON results typed as T[] (the class generic type)
|
|
140
138
|
*/
|
|
141
139
|
objects() {
|
|
142
|
-
return this.results
|
|
143
|
-
.filter(r => r.type === 'json')
|
|
144
|
-
.map(r => r.value);
|
|
140
|
+
return this.results.filter((r) => r.type === 'json').map((r) => r.value);
|
|
145
141
|
}
|
|
146
142
|
/**
|
|
147
143
|
* Get a specific JSON result by index as a parsed object.
|
|
@@ -167,7 +163,7 @@ export class InteractionOutput {
|
|
|
167
163
|
* @throws Error if no image result exists
|
|
168
164
|
*/
|
|
169
165
|
image() {
|
|
170
|
-
const imageResult = this.results.find(r => r.type === 'image');
|
|
166
|
+
const imageResult = this.results.find((r) => r.type === 'image');
|
|
171
167
|
if (!imageResult) {
|
|
172
168
|
throw new Error('No image result found');
|
|
173
169
|
}
|
|
@@ -177,9 +173,7 @@ export class InteractionOutput {
|
|
|
177
173
|
* Get an array of all image values (base64 data URLs or URLs).
|
|
178
174
|
*/
|
|
179
175
|
images() {
|
|
180
|
-
return this.results
|
|
181
|
-
.filter(r => r.type === 'image')
|
|
182
|
-
.map(r => r.value);
|
|
176
|
+
return this.results.filter((r) => r.type === 'image').map((r) => r.value);
|
|
183
177
|
}
|
|
184
178
|
/**
|
|
185
179
|
* Convert all results to a string representation.
|
|
@@ -200,7 +194,7 @@ export class InteractionOutput {
|
|
|
200
194
|
*/
|
|
201
195
|
stringify(separator = '\n', indent = 2) {
|
|
202
196
|
return this.results
|
|
203
|
-
.map(r => {
|
|
197
|
+
.map((r) => {
|
|
204
198
|
switch (r.type) {
|
|
205
199
|
case 'json':
|
|
206
200
|
return JSON.stringify(r.value, null, indent);
|
|
@@ -225,6 +219,9 @@ export class InteractionOutput {
|
|
|
225
219
|
return this.results;
|
|
226
220
|
}
|
|
227
221
|
}
|
|
222
|
+
function isInteractionOutputMarker(obj) {
|
|
223
|
+
return !!obj && typeof obj === 'object' && obj[IS_INTERACTION_OUTPUT] === true;
|
|
224
|
+
}
|
|
228
225
|
/**
|
|
229
226
|
* Creates a proxied array that acts as both a CompletionResult[] and has InteractionOutput convenience methods.
|
|
230
227
|
* Note: It's recommended to use InteractionOutput.from() instead of calling this function directly.
|
|
@@ -259,7 +256,7 @@ export function createInteractionOutput(results) {
|
|
|
259
256
|
}
|
|
260
257
|
// Check if the wrapper has this property/method
|
|
261
258
|
if (prop in wrapper) {
|
|
262
|
-
const value = wrapper
|
|
259
|
+
const value = Reflect.get(wrapper, prop, wrapper);
|
|
263
260
|
// If it's a function, bind it to the wrapper so 'this' works correctly
|
|
264
261
|
if (typeof value === 'function') {
|
|
265
262
|
return value.bind(wrapper);
|
|
@@ -269,24 +266,24 @@ export function createInteractionOutput(results) {
|
|
|
269
266
|
}
|
|
270
267
|
// Otherwise delegate to the array
|
|
271
268
|
return Reflect.get(target, prop, receiver);
|
|
272
|
-
}
|
|
269
|
+
},
|
|
273
270
|
});
|
|
274
271
|
}
|
|
275
272
|
function parseCompletionResultAsJson(data) {
|
|
276
273
|
let lastError;
|
|
277
274
|
for (const part of data) {
|
|
278
|
-
if (part.type ===
|
|
275
|
+
if (part.type === 'text') {
|
|
279
276
|
const text = part.value.trim();
|
|
280
277
|
try {
|
|
281
278
|
return JSON.parse(text);
|
|
282
279
|
}
|
|
283
280
|
catch (error) {
|
|
284
|
-
lastError = error;
|
|
281
|
+
lastError = error instanceof Error ? error : new Error(String(error));
|
|
285
282
|
}
|
|
286
283
|
}
|
|
287
284
|
}
|
|
288
285
|
if (!lastError) {
|
|
289
|
-
lastError = new Error(
|
|
286
|
+
lastError = new Error('No JSON result found and no text available to parse');
|
|
290
287
|
}
|
|
291
288
|
throw lastError;
|
|
292
289
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionOutput.js","sourceRoot":"","sources":["../src/InteractionOutput.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAEjE,MAAM,UAAU,iCAAiC,CAC7C,CAAsC;IAEtC,CAAC,CAAC,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IACrD,OAAO,CAAyD,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,mBAAmB,CAC/B,CAAwB;IAExB,CAAC,CAAC,MAAM,GAAG,iBAAiB,CAAC,IAAI,CAAU,CAAC,CAAC,MAAM,CAAC,CAAC;IACrD,OAAO,CAA2C,CAAC;AACvD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,OAAO,iBAAiB;IAKE;IAJ5B;;;OAGG;IACH,YAA4B,OAA2B;QAA3B,YAAO,GAAP,OAAO,CAAoB;IAAG,CAAC;IAE3D;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,IAAI,CACP,OAAgG;QAEhG,IAAI,CAAC,OAAO,EAAE,CAAC;YACX,OAAO,uBAAuB,CAAI,EAAE,CAAC,CAAC;QAC1C,CAAC;QACD,mDAAmD;QACnD,IAAI,yBAAyB,CAAC,OAAO,CAAC,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,KAAK,CAAC,IAAI,CAAM,CAAC;YACjC,CAAC;YAAC,OAAO,KAAc,EAAE,CAAC;gBACtB,SAAS,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAC1E,CAAC;QACL,CAAC;IACL,CAAC;IACD,IAAI,CAAC,SAAS,EAAE,CAAC;QACb,SAAS,GAAG,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IACjF,CAAC;IACD,MAAM,SAAS,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InteractionResult.example.d.ts","sourceRoot":"","sources":["../src/InteractionResult.example.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -10,7 +10,7 @@ const sampleResults = [
|
|
|
10
10
|
{ type: 'text', value: 'World!' },
|
|
11
11
|
{ type: 'json', value: { name: 'Alice', age: 30 } },
|
|
12
12
|
{ type: 'json', value: { title: 'Engineer', level: 'Senior' } },
|
|
13
|
-
{ type: 'image', value: 'data:image/png;base64,iVBORw0K...' }
|
|
13
|
+
{ type: 'image', value: 'data:image/png;base64,iVBORw0K...' },
|
|
14
14
|
];
|
|
15
15
|
// Example 1: Using InteractionOutput.from() (Proxy approach - RECOMMENDED)
|
|
16
16
|
console.log('=== Example 1: Proxy Approach ===');
|
|
@@ -18,7 +18,7 @@ const output = InteractionOutput.from(sampleResults);
|
|
|
18
18
|
// Works as an array
|
|
19
19
|
console.log('Array length:', output.length); // 5
|
|
20
20
|
console.log('First item:', output[0]); // { type: 'text', value: 'Hello, ' }
|
|
21
|
-
console.log('Types:', output.map(r => r.type)); // ['text', 'text', 'json', 'json', 'image']
|
|
21
|
+
console.log('Types:', output.map((r) => r.type)); // ['text', 'text', 'json', 'json', 'image']
|
|
22
22
|
// Has convenience methods
|
|
23
23
|
console.log('All text:', output.text); // 'Hello, World!'
|
|
24
24
|
console.log('First object:', output.object()); // { name: 'Alice', age: 30 } (typed as Person)
|
|
@@ -35,7 +35,7 @@ console.log('First object:', wrapper.object());
|
|
|
35
35
|
// Example 3: Type safety demonstration
|
|
36
36
|
console.log('\n=== Example 3: Type Safety ===');
|
|
37
37
|
const contractResults = [
|
|
38
|
-
{ type: 'json', value: { title: 'Sales Agreement', parties: ['Alice', 'Bob'] } }
|
|
38
|
+
{ type: 'json', value: { title: 'Sales Agreement', parties: ['Alice', 'Bob'] } },
|
|
39
39
|
];
|
|
40
40
|
const contractOutput = InteractionOutput.from(contractResults);
|
|
41
41
|
const contract = contractOutput.object(); // TypeScript knows this is Contract
|
|
@@ -46,7 +46,7 @@ console.log('\n=== Example 4: Mixed Content ===');
|
|
|
46
46
|
const mixedResults = [
|
|
47
47
|
{ type: 'text', value: 'Analysis complete. Results: ' },
|
|
48
48
|
{ type: 'json', value: { score: 0.95, confidence: 'high' } },
|
|
49
|
-
{ type: 'text', value: '\nThank you!' }
|
|
49
|
+
{ type: 'text', value: '\nThank you!' },
|
|
50
50
|
];
|
|
51
51
|
const mixed = InteractionOutput.from(mixedResults);
|
|
52
52
|
console.log('Full text:', mixed.text); // 'Analysis complete. Results: \nThank you!'
|