From a2a80e9a417b096c09ae89807aa604b695fb0828 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 27 Oct 2026 00:23:15 +0000 Subject: [PATCH] feat: Updated OpenAPI spec --- .../Dust.Agents.JsonSerializerContext.g.cs | 1 + .../Dust.Analytics.JsonSerializerContext.g.cs | 1 + .../Dust.Apps.JsonSerializerContext.g.cs | 1 + ...t.Conversations.JsonSerializerContext.g.cs | 1 + ...AssistantConversationsByCIdFilesByRel.g.cs | 437 ++++++++++++++++++ ...DatasourceViews.JsonSerializerContext.g.cs | 1 + ...ust.Datasources.JsonSerializerContext.g.cs | 1 + src/libs/Dust/Generated/Dust.Exceptions.g.cs | 26 ++ .../Dust.Feedbacks.JsonSerializerContext.g.cs | 1 + ...AssistantConversationsByCIdFilesByRel.g.cs | 20 + .../Generated/Dust.JsonSerializerContext.g.cs | 1 + .../Dust.JsonSerializerContextTypes.g.cs | 5 + .../Dust.Mcp.JsonSerializerContext.g.cs | 1 + .../Dust.Mentions.JsonSerializerContext.g.cs | 1 + .../Dust/Generated/Dust.ResponseStream.g.cs | 66 ++- .../Dust.Search.JsonSerializerContext.g.cs | 1 + .../Dust.Skills.JsonSerializerContext.g.cs | 1 + .../Dust.Spaces.JsonSerializerContext.g.cs | 1 + .../Dust.Tools.JsonSerializerContext.g.cs | 1 + .../Dust.Triggers.JsonSerializerContext.g.cs | 1 + 20 files changed, 547 insertions(+), 22 deletions(-) diff --git a/src/libs/Dust/Generated/Dust.Agents.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.Agents.JsonSerializerContext.g.cs index 328dd9e..67dfb3f 100644 --- a/src/libs/Dust/Generated/Dust.Agents.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.Agents.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] diff --git a/src/libs/Dust/Generated/Dust.Analytics.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.Analytics.JsonSerializerContext.g.cs index 8c822d1..55bfe49 100644 --- a/src/libs/Dust/Generated/Dust.Analytics.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.Analytics.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] diff --git a/src/libs/Dust/Generated/Dust.Apps.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.Apps.JsonSerializerContext.g.cs index 3ad05ca..94e3e74 100644 --- a/src/libs/Dust/Generated/Dust.Apps.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.Apps.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] diff --git a/src/libs/Dust/Generated/Dust.Conversations.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.Conversations.JsonSerializerContext.g.cs index 26103e0..f638461 100644 --- a/src/libs/Dust/Generated/Dust.Conversations.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.Conversations.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Dust.ConversationConsumption))] diff --git a/src/libs/Dust/Generated/Dust.ConversationsClient.GetWByWIdAssistantConversationsByCIdFilesByRel.g.cs b/src/libs/Dust/Generated/Dust.ConversationsClient.GetWByWIdAssistantConversationsByCIdFilesByRel.g.cs index aa46fb6..6d720a3 100644 --- a/src/libs/Dust/Generated/Dust.ConversationsClient.GetWByWIdAssistantConversationsByCIdFilesByRel.g.cs +++ b/src/libs/Dust/Generated/Dust.ConversationsClient.GetWByWIdAssistantConversationsByCIdFilesByRel.g.cs @@ -474,6 +474,443 @@ partial void ProcessGetWByWIdAssistantConversationsByCIdFilesByRelResponseConten return new global::Dust.ResponseStream(__response, __content); } + catch (global::System.OperationCanceledException) + { + throw; + } + catch (global::System.Exception __ex) + { + string? __content = null; + try + { + __content = await __response.Content.ReadAsStringAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + } + catch (global::System.Exception) + { + } + + throw global::Dust.ApiException.Create( + statusCode: __response.StatusCode, + message: __content ?? __response.ReasonPhrase ?? string.Empty, + innerException: __ex, + responseBody: __content, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + } + catch + { + __response.Dispose(); + throw; + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Download a conversation-scoped file by path
+ /// Download a file from a conversation's file system by its scoped path. Pass the
+ /// canonical `filePath` surfaced in a message action's `generatedFiles` (the legacy
+ /// `conversation/foo.pdf` form is also accepted). The file content is streamed
+ /// directly from the conversation mount. + ///
+ /// + /// + /// + /// The response metadata and an unbuffered body stream. The caller must dispose Body to release the HTTP response. + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + public async global::System.Threading.Tasks.Task> GetWByWIdAssistantConversationsByCIdFilesByRelAsStreamAsResponseAsync( + string wId, + string cId, + string rel, + global::Dust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareGetWByWIdAssistantConversationsByCIdFilesByRelArguments( + httpClient: HttpClient, + wId: ref wId, + cId: ref cId, + rel: ref rel); + + + var __authorizations = global::Dust.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_GetWByWIdAssistantConversationsByCIdFilesByRelSecurityRequirements, + operationName: "GetWByWIdAssistantConversationsByCIdFilesByRelAsync"); + + using var __timeoutCancellationTokenSource = global::Dust.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource( + clientOptions: Options, + requestOptions: requestOptions, + cancellationToken: cancellationToken); + var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken; + var __effectiveReadResponseAsString = global::Dust.AutoSDKRequestOptionsSupport.GetReadResponseAsString( + clientOptions: Options, + requestOptions: requestOptions, + fallbackValue: ReadResponseAsString); + var __maxAttempts = global::Dust.AutoSDKRequestOptionsSupport.GetMaxAttempts( + clientOptions: Options, + requestOptions: requestOptions, + supportsRetry: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Dust.PathBuilder( + path: $"/api/v1/w/{wId}/assistant/conversations/{cId}/files/{rel}", + baseUri: ResolveBaseUri( + servers: s_GetWByWIdAssistantConversationsByCIdFilesByRelServers, + defaultBaseUrl: "https://dust.tt/")); + var __path = __pathBuilder.ToString(); + __path = global::Dust.AutoSDKRequestOptionsSupport.AppendQueryParameters( + path: __path, + clientParameters: Options.QueryParameters, + requestParameters: requestOptions?.QueryParameters); + var __httpRequest = new global::System.Net.Http.HttpRequestMessage( + method: global::System.Net.Http.HttpMethod.Get, + requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute)); +#if NET6_0_OR_GREATER + __httpRequest.Version = global::System.Net.HttpVersion.Version11; + __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher; +#endif + + foreach (var __authorization in __authorizations) + { + if (__authorization.Type == "Http" || + __authorization.Type == "OAuth2" || + __authorization.Type == "OpenIdConnect") + { + __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue( + scheme: __authorization.Name, + parameter: __authorization.Value); + } + else if (__authorization.Type == "ApiKey" && + __authorization.Location == "Header") + { + __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); + } + } + global::Dust.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareGetWByWIdAssistantConversationsByCIdFilesByRelRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + wId: wId, + cId: cId, + rel: rel); + + return __httpRequest; + } + + global::System.Net.Http.HttpRequestMessage? __httpRequest = null; + global::System.Net.Http.HttpResponseMessage? __response = null; + var __attemptNumber = 0; + try + { + for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++) + { + __attemptNumber = __attempt; + __httpRequest = __CreateHttpRequest(); + await global::Dust.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync( + clientOptions: Options, + context: global::Dust.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "getWByWIdAssistantConversationsByCIdFilesByRel", + methodName: "GetWByWIdAssistantConversationsByCIdFilesByRelAsync", + pathTemplate: "$\"/api/v1/w/{wId}/assistant/conversations/{cId}/files/{rel}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + try + { + __response = await HttpClient.SendAsync( + request: __httpRequest, + completionOption: global::System.Net.Http.HttpCompletionOption.ResponseHeadersRead, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + } + catch (global::System.Net.Http.HttpRequestException __exception) + { + var __retryDelay = global::Dust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: null, + attempt: __attempt); + var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested; + await global::Dust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Dust.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "getWByWIdAssistantConversationsByCIdFilesByRel", + methodName: "GetWByWIdAssistantConversationsByCIdFilesByRelAsync", + pathTemplate: "$\"/api/v1/w/{wId}/assistant/conversations/{cId}/files/{rel}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: null, + exception: __exception, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + if (!__willRetry) + { + throw; + } + + __httpRequest.Dispose(); + __httpRequest = null; + await global::Dust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + if (__response != null && + __attempt < __maxAttempts && + global::Dust.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode)) + { + var __retryDelay = global::Dust.AutoSDKRequestOptionsSupport.GetRetryDelay( + clientOptions: Options, + requestOptions: requestOptions, + response: __response, + attempt: __attempt); + await global::Dust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Dust.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "getWByWIdAssistantConversationsByCIdFilesByRel", + methodName: "GetWByWIdAssistantConversationsByCIdFilesByRelAsync", + pathTemplate: "$\"/api/v1/w/{wId}/assistant/conversations/{cId}/files/{rel}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attempt, + maxAttempts: __maxAttempts, + willRetry: true, + retryDelay: __retryDelay, + retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture), + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + __response.Dispose(); + __response = null; + __httpRequest.Dispose(); + __httpRequest = null; + await global::Dust.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( + retryDelay: __retryDelay, + cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); + continue; + } + + break; + } + + if (__response == null) + { + throw new global::System.InvalidOperationException("No response received."); + } + + try + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessGetWByWIdAssistantConversationsByCIdFilesByRelResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Dust.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Dust.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "getWByWIdAssistantConversationsByCIdFilesByRel", + methodName: "GetWByWIdAssistantConversationsByCIdFilesByRelAsync", + pathTemplate: "$\"/api/v1/w/{wId}/assistant/conversations/{cId}/files/{rel}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + else + { + await global::Dust.AutoSDKRequestOptionsSupport.OnAfterErrorAsync( + clientOptions: Options, + context: global::Dust.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "getWByWIdAssistantConversationsByCIdFilesByRel", + methodName: "GetWByWIdAssistantConversationsByCIdFilesByRelAsync", + pathTemplate: "$\"/api/v1/w/{wId}/assistant/conversations/{cId}/files/{rel}\"", + httpMethod: "GET", + baseUri: BaseUri, + request: __httpRequest ?? throw new global::System.InvalidOperationException("The HTTP request was not created before invoking a request hook."), + response: __response, + exception: null, + clientOptions: Options, + requestOptions: requestOptions, + attempt: __attemptNumber, + maxAttempts: __maxAttempts, + willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, + cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); + } + // + if ((int)__response.StatusCode == 400) + { + string? __content_400 = null; + global::System.Exception? __exception_400 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_400 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_400 = __ex; + } + + + throw global::Dust.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_400 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_400, + responseBody: __content_400, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Dust.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // + if ((int)__response.StatusCode == 404) + { + string? __content_404 = null; + global::System.Exception? __exception_404 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + else + { + __content_404 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + } + } + catch (global::System.Exception __ex) + { + __exception_404 = __ex; + } + + + throw global::Dust.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_404 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_404, + responseBody: __content_404, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + + try + { + __response.EnsureSuccessStatusCode(); + + var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::Dust.AutoSDKHttpResponse( + statusCode: __response.StatusCode, + headers: global::Dust.AutoSDKHttpResponse.CreateHeaders(__response), + requestUri: __response.RequestMessage?.RequestUri, + body: new global::Dust.ResponseStream(__response, __content)); + } + catch (global::System.OperationCanceledException) + { + throw; + } catch (global::System.Exception __ex) { string? __content = null; diff --git a/src/libs/Dust/Generated/Dust.DatasourceViews.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.DatasourceViews.JsonSerializerContext.g.cs index 94d09a9..1653fe3 100644 --- a/src/libs/Dust/Generated/Dust.DatasourceViews.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.DatasourceViews.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] diff --git a/src/libs/Dust/Generated/Dust.Datasources.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.Datasources.JsonSerializerContext.g.cs index 0a9190d..0694ae6 100644 --- a/src/libs/Dust/Generated/Dust.Datasources.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.Datasources.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Dust.Section))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] diff --git a/src/libs/Dust/Generated/Dust.Exceptions.g.cs b/src/libs/Dust/Generated/Dust.Exceptions.g.cs index 7d18c0a..78de304 100644 --- a/src/libs/Dust/Generated/Dust.Exceptions.g.cs +++ b/src/libs/Dust/Generated/Dust.Exceptions.g.cs @@ -20,6 +20,32 @@ public partial class ApiException : global::System.Exception /// public string? ResponseBody { get; set; } + /// + /// Successful HTTP responses that fail during processing put the cause before a bounded body preview. + /// Inspect ResponseBody for the full response; HTTP service-error messages retain their existing format. + /// + public override string Message + { + get + { + if ((int)StatusCode < 200 || (int)StatusCode >= 300 || InnerException == null) + { + return base.Message; + } + + string? path = (InnerException as global::System.Text.Json.JsonException)?.Path; + return "Response processing failed after successful HTTP " + + ((int)StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture) + ": " + + InnerException.GetType().FullName + ": " + BoundDiagnosticText(InnerException.Message) + + (string.IsNullOrEmpty(path) ? string.Empty : " Path: " + BoundDiagnosticText(path, 256)) + + "\nResponse preview: " + BoundDiagnosticText(base.Message); + } + } + + private static string BoundDiagnosticText(string? value, int maximumLength = 512) => + value == null ? string.Empty : + value.Length <= maximumLength ? value : value.Substring(0, maximumLength) + "... [truncated]"; + /// /// The response headers. /// diff --git a/src/libs/Dust/Generated/Dust.Feedbacks.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.Feedbacks.JsonSerializerContext.g.cs index bda2d00..c48b089 100644 --- a/src/libs/Dust/Generated/Dust.Feedbacks.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.Feedbacks.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] diff --git a/src/libs/Dust/Generated/Dust.IConversationsClient.GetWByWIdAssistantConversationsByCIdFilesByRel.g.cs b/src/libs/Dust/Generated/Dust.IConversationsClient.GetWByWIdAssistantConversationsByCIdFilesByRel.g.cs index 8226e33..a2f9fea 100644 --- a/src/libs/Dust/Generated/Dust.IConversationsClient.GetWByWIdAssistantConversationsByCIdFilesByRel.g.cs +++ b/src/libs/Dust/Generated/Dust.IConversationsClient.GetWByWIdAssistantConversationsByCIdFilesByRel.g.cs @@ -52,6 +52,26 @@ public partial interface IConversationsClient /// /// /// + /// The response metadata and an unbuffered body stream. The caller must dispose Body to release the HTTP response. + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWByWIdAssistantConversationsByCIdFilesByRelAsStreamAsResponseAsync( + string wId, + string cId, + string rel, + global::Dust.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download a conversation-scoped file by path
+ /// Download a file from a conversation's file system by its scoped path. Pass the
+ /// canonical `filePath` surfaced in a message action's `generatedFiles` (the legacy
+ /// `conversation/foo.pdf` form is also accepted). The file content is streamed
+ /// directly from the conversation mount. + ///
+ /// + /// + /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with /// diff --git a/src/libs/Dust/Generated/Dust.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.JsonSerializerContext.g.cs index 881033c..de393d8 100644 --- a/src/libs/Dust/Generated/Dust.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.JsonSerializerContext.g.cs @@ -194,6 +194,7 @@ namespace Dust #pragma warning restore CS3016 [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Dust.JsonSerializerContextTypes))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::Dust.Section))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.IList))] diff --git a/src/libs/Dust/Generated/Dust.JsonSerializerContextTypes.g.cs b/src/libs/Dust/Generated/Dust.JsonSerializerContextTypes.g.cs index e09d9b5..a9c20ea 100644 --- a/src/libs/Dust/Generated/Dust.JsonSerializerContextTypes.g.cs +++ b/src/libs/Dust/Generated/Dust.JsonSerializerContextTypes.g.cs @@ -25,6 +25,11 @@ public sealed partial class JsonSerializerContextTypes /// public global::System.Collections.Generic.List? ObjectList { get; set; } + /// + /// String arrays used by dynamic JSON option values. + /// + public string[]? StringArray { get; set; } + /// /// /// diff --git a/src/libs/Dust/Generated/Dust.Mcp.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.Mcp.JsonSerializerContext.g.cs index f70ca19..cc0baf7 100644 --- a/src/libs/Dust/Generated/Dust.Mcp.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.Mcp.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] diff --git a/src/libs/Dust/Generated/Dust.Mentions.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.Mentions.JsonSerializerContext.g.cs index 9026a49..5fe4d53 100644 --- a/src/libs/Dust/Generated/Dust.Mentions.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.Mentions.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] diff --git a/src/libs/Dust/Generated/Dust.ResponseStream.g.cs b/src/libs/Dust/Generated/Dust.ResponseStream.g.cs index f5bae00..85f0817 100644 --- a/src/libs/Dust/Generated/Dust.ResponseStream.g.cs +++ b/src/libs/Dust/Generated/Dust.ResponseStream.g.cs @@ -7,7 +7,7 @@ internal sealed class ResponseStream : global::System.IO.Stream { private readonly global::System.Net.Http.HttpResponseMessage _response; private readonly global::System.IO.Stream _stream; - private bool _disposed; + private int _disposed; public ResponseStream( global::System.Net.Http.HttpResponseMessage response, @@ -47,21 +47,51 @@ public override int WriteTimeout global::System.Threading.CancellationToken cancellationToken) => _stream.FlushAsync(cancellationToken); - public override int Read(byte[] buffer, int offset, int count) => - _stream.Read(buffer, offset, count); + public override int Read(byte[] buffer, int offset, int count) + { + try + { + return _stream.Read(buffer, offset, count); + } + catch + { + Dispose(); + throw; + } + } - public override global::System.Threading.Tasks.Task ReadAsync( + public override async global::System.Threading.Tasks.Task ReadAsync( byte[] buffer, int offset, int count, - global::System.Threading.CancellationToken cancellationToken) => - _stream.ReadAsync(buffer, offset, count, cancellationToken); + global::System.Threading.CancellationToken cancellationToken) + { + try + { + return await _stream.ReadAsync(buffer, offset, count, cancellationToken).ConfigureAwait(false); + } + catch + { + Dispose(); + throw; + } + } #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER - public override global::System.Threading.Tasks.ValueTask ReadAsync( + public override async global::System.Threading.Tasks.ValueTask ReadAsync( global::System.Memory buffer, - global::System.Threading.CancellationToken cancellationToken = default) => - _stream.ReadAsync(buffer, cancellationToken); + global::System.Threading.CancellationToken cancellationToken = default) + { + try + { + return await _stream.ReadAsync(buffer, cancellationToken).ConfigureAwait(false); + } + catch + { + Dispose(); + throw; + } + } #endif public override long Seek(long offset, global::System.IO.SeekOrigin origin) => @@ -89,10 +119,9 @@ public override void Write(byte[] buffer, int offset, int count) => protected override void Dispose(bool disposing) { - if (!_disposed && disposing) + if (disposing && global::System.Threading.Interlocked.Exchange(ref _disposed, 1) == 0) { - _disposed = true; - _stream.Dispose(); + // The response content owns the underlying stream; disposing both would close it twice. _response.Dispose(); } @@ -100,17 +129,10 @@ protected override void Dispose(bool disposing) } #if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER - public override async global::System.Threading.Tasks.ValueTask DisposeAsync() + public override global::System.Threading.Tasks.ValueTask DisposeAsync() { - if (_disposed) - { - return; - } - - _disposed = true; - await _stream.DisposeAsync().ConfigureAwait(false); - _response.Dispose(); - await base.DisposeAsync().ConfigureAwait(false); + Dispose(); + return default; } #endif } diff --git a/src/libs/Dust/Generated/Dust.Search.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.Search.JsonSerializerContext.g.cs index 28f1ae4..511b3e3 100644 --- a/src/libs/Dust/Generated/Dust.Search.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.Search.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))] diff --git a/src/libs/Dust/Generated/Dust.Skills.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.Skills.JsonSerializerContext.g.cs index 33fe93e..cfef273 100644 --- a/src/libs/Dust/Generated/Dust.Skills.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.Skills.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] diff --git a/src/libs/Dust/Generated/Dust.Spaces.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.Spaces.JsonSerializerContext.g.cs index 07f60fd..2db4903 100644 --- a/src/libs/Dust/Generated/Dust.Spaces.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.Spaces.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(bool))] diff --git a/src/libs/Dust/Generated/Dust.Tools.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.Tools.JsonSerializerContext.g.cs index 75f76a1..48e2ba1 100644 --- a/src/libs/Dust/Generated/Dust.Tools.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.Tools.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(double))] diff --git a/src/libs/Dust/Generated/Dust.Triggers.JsonSerializerContext.g.cs b/src/libs/Dust/Generated/Dust.Triggers.JsonSerializerContext.g.cs index ce5a62e..45e4557 100644 --- a/src/libs/Dust/Generated/Dust.Triggers.JsonSerializerContext.g.cs +++ b/src/libs/Dust/Generated/Dust.Triggers.JsonSerializerContext.g.cs @@ -12,6 +12,7 @@ namespace Dust [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.Dictionary))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Collections.Generic.List), TypeInfoPropertyName = "SystemCollectionsGeneric_ObjectList")] + [global::System.Text.Json.Serialization.JsonSerializable(typeof(string[]))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(global::System.Text.Json.JsonElement?))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(string))] [global::System.Text.Json.Serialization.JsonSerializable(typeof(int))]