From af55f8de3da45d7d61ebe0ec8956d53200fc72d7 Mon Sep 17 00:00:00 2001 From: Wanlin Du Date: Tue, 9 Jun 2026 17:56:39 -0700 Subject: [PATCH] chore: internal structure change PiperOrigin-RevId: 929505643 --- src/interactions/client.ts | 4 + src/interactions/resources/index.ts | 2 + src/interactions/resources/interactions.ts | 477 +++++++-------------- 3 files changed, 163 insertions(+), 320 deletions(-) diff --git a/src/interactions/client.ts b/src/interactions/client.ts index c1ba8b7849..386b49bc89 100644 --- a/src/interactions/client.ts +++ b/src/interactions/client.ts @@ -53,6 +53,8 @@ import { FileCitation, FileSearchCallStep, FileSearchResultStep, + FindRequest, + FixRequest, Function, FunctionCallStep, FunctionResultStep, @@ -917,6 +919,8 @@ export declare namespace GeminiNextGenAPIClient { type FileCitation as FileCitation, type FileSearchCallStep as FileSearchCallStep, type FileSearchResultStep as FileSearchResultStep, + type FindRequest as FindRequest, + type FixRequest as FixRequest, type Function as Function, type FunctionCallStep as FunctionCallStep, type FunctionResultStep as FunctionResultStep, diff --git a/src/interactions/resources/index.ts b/src/interactions/resources/index.ts index d718410956..2d9d125dd2 100644 --- a/src/interactions/resources/index.ts +++ b/src/interactions/resources/index.ts @@ -36,6 +36,8 @@ export { type FileCitation, type FileSearchCallStep, type FileSearchResultStep, + type FindRequest, + type FixRequest, type Function, type FunctionCallStep, type FunctionResultStep, diff --git a/src/interactions/resources/interactions.ts b/src/interactions/resources/interactions.ts index 031ae6475d..cf44f55503 100644 --- a/src/interactions/resources/interactions.ts +++ b/src/interactions/resources/interactions.ts @@ -684,6 +684,159 @@ export interface FileSearchResultStep { signature?: string; } +/** + * Request parameters specific to FIND sessions, used for discovering + * vulnerabilities in a codebase. + */ +export interface FindRequest { + request: 'find_request'; + + /** + * Additional context or custom instructions provided by the user to guide the + * vulnerability analysis. + */ + description?: string; + + /** + * The identifier of a specific finding to verify. This is primarily used in VERIFY + * mode to focus the agent's execution-based validation on a single vulnerability. + */ + finding_id?: string; + + /** + * Optional session-specific configurations to override default agent behavior. + */ + session_config?: FindRequest.SessionConfig; + + /** + * Parameter for grouping multiple interactions that belong to the same CodeMender + * session. + */ + session_id?: string; + + /** + * A list of source files to provide as context for the scan. + */ + source_files?: Array; +} + +export namespace FindRequest { + /** + * Optional session-specific configurations to override default agent behavior. + */ + export interface SessionConfig { + /** + * The maximum number of interaction rounds the agent is allowed to perform before + * reaching a timeout. + */ + max_rounds?: number; + + /** + * The pipeline mode of a CodeMender session. It can only be used for a find + * session. + */ + pipeline_mode?: 'scan' | 'verify'; + + /** + * The cognitive architecture or "thinking" topology used by the agent (e.g. + * "default", "deep"). + */ + topology?: string; + } + + /** + * Content of a single file in the codebase. + */ + export interface SourceFile { + /** + * The UTF-8 encoded text content of the file. + */ + content?: string; + + /** + * The relative path of the file from the project root. + */ + path?: string; + } +} + +/** + * Request parameters specific to FIX sessions, used for generating and validating + * security patches. + */ +export interface FixRequest { + request: 'fix_request'; + + /** + * Additional context or custom instructions provided by the user to guide the + * patch generation process. + */ + description?: string; + + /** + * The identifier of the specific security finding to be remediated. This ID maps + * to a previously discovered vulnerability. + */ + finding_id?: string; + + /** + * Optional session-specific configurations to override default agent behavior. + */ + session_config?: FixRequest.SessionConfig; + + /** + * Parameter for grouping multiple interactions that belong to the same CodeMender + * session. + */ + session_id?: string; + + /** + * A list of source files providing context for the remediation. These files are + * typically the ones containing the identified vulnerability. + */ + source_files?: Array; +} + +export namespace FixRequest { + /** + * Optional session-specific configurations to override default agent behavior. + */ + export interface SessionConfig { + /** + * The maximum number of interaction rounds the agent is allowed to perform before + * reaching a timeout. + */ + max_rounds?: number; + + /** + * The pipeline mode of a CodeMender session. It can only be used for a find + * session. + */ + pipeline_mode?: 'scan' | 'verify'; + + /** + * The cognitive architecture or "thinking" topology used by the agent (e.g. + * "default", "deep"). + */ + topology?: string; + } + + /** + * Content of a single file in the codebase. + */ + export interface SourceFile { + /** + * The UTF-8 encoded text content of the file. + */ + content?: string; + + /** + * The relative path of the file from the project root. + */ + path?: string; + } +} + /** * A tool that can be used by the model. */ @@ -1244,11 +1397,7 @@ export interface Interaction { /** * Configuration parameters for the agent interaction. */ - agent_config?: - | DeepResearchAgentConfig - | DynamicAgentConfig - | Interaction.FindRequest - | Interaction.FixRequest; + agent_config?: DeepResearchAgentConfig | DynamicAgentConfig | FindRequest | FixRequest; /** * The name of the cached content used as context to serve the prediction. Note: @@ -1375,161 +1524,6 @@ export interface Interaction { output_video?: VideoContent; } -export namespace Interaction { - /** - * Request parameters specific to FIND sessions, used for discovering - * vulnerabilities in a codebase. - */ - export interface FindRequest { - request: 'find_request'; - - /** - * Additional context or custom instructions provided by the user to guide the - * vulnerability analysis. - */ - description?: string; - - /** - * The identifier of a specific finding to verify. This is primarily used in VERIFY - * mode to focus the agent's execution-based validation on a single vulnerability. - */ - finding_id?: string; - - /** - * Optional session-specific configurations to override default agent behavior. - */ - session_config?: FindRequest.SessionConfig; - - /** - * Parameter for grouping multiple interactions that belong to the same CodeMender - * session. - */ - session_id?: string; - - /** - * A list of source files to provide as context for the scan. - */ - source_files?: Array; - } - - export namespace FindRequest { - /** - * Optional session-specific configurations to override default agent behavior. - */ - export interface SessionConfig { - /** - * The maximum number of interaction rounds the agent is allowed to perform before - * reaching a timeout. - */ - max_rounds?: number; - - /** - * The pipeline mode of a CodeMender session. It can only be used for a find - * session. - */ - pipeline_mode?: 'scan' | 'verify'; - - /** - * The cognitive architecture or "thinking" topology used by the agent (e.g. - * "default", "deep"). - */ - topology?: string; - } - - /** - * Content of a single file in the codebase. - */ - export interface SourceFile { - /** - * The UTF-8 encoded text content of the file. - */ - content?: string; - - /** - * The relative path of the file from the project root. - */ - path?: string; - } - } - - /** - * Request parameters specific to FIX sessions, used for generating and validating - * security patches. - */ - export interface FixRequest { - request: 'fix_request'; - - /** - * Additional context or custom instructions provided by the user to guide the - * patch generation process. - */ - description?: string; - - /** - * The identifier of the specific security finding to be remediated. This ID maps - * to a previously discovered vulnerability. - */ - finding_id?: string; - - /** - * Optional session-specific configurations to override default agent behavior. - */ - session_config?: FixRequest.SessionConfig; - - /** - * Parameter for grouping multiple interactions that belong to the same CodeMender - * session. - */ - session_id?: string; - - /** - * A list of source files providing context for the remediation. These files are - * typically the ones containing the identified vulnerability. - */ - source_files?: Array; - } - - export namespace FixRequest { - /** - * Optional session-specific configurations to override default agent behavior. - */ - export interface SessionConfig { - /** - * The maximum number of interaction rounds the agent is allowed to perform before - * reaching a timeout. - */ - max_rounds?: number; - - /** - * The pipeline mode of a CodeMender session. It can only be used for a find - * session. - */ - pipeline_mode?: 'scan' | 'verify'; - - /** - * The cognitive architecture or "thinking" topology used by the agent (e.g. - * "default", "deep"). - */ - topology?: string; - } - - /** - * Content of a single file in the codebase. - */ - export interface SourceFile { - /** - * The UTF-8 encoded text content of the file. - */ - content?: string; - - /** - * The relative path of the file from the project root. - */ - path?: string; - } - } -} - export interface InteractionCompletedEvent { event_type: 'interaction.completed'; @@ -3125,11 +3119,7 @@ export interface BaseCreateAgentInteractionParams { /** * Body param: Configuration parameters for the agent interaction. */ - agent_config?: - | DeepResearchAgentConfig - | DynamicAgentConfig - | BaseCreateAgentInteractionParams.FindRequest - | BaseCreateAgentInteractionParams.FixRequest; + agent_config?: DeepResearchAgentConfig | DynamicAgentConfig | FindRequest | FixRequest; /** * Body param: Input only. Whether to run the model interaction in the background. @@ -3203,161 +3193,6 @@ export interface BaseCreateAgentInteractionParams { webhook_config?: WebhookConfig; } -export namespace BaseCreateAgentInteractionParams { - /** - * Request parameters specific to FIND sessions, used for discovering - * vulnerabilities in a codebase. - */ - export interface FindRequest { - request: 'find_request'; - - /** - * Additional context or custom instructions provided by the user to guide the - * vulnerability analysis. - */ - description?: string; - - /** - * The identifier of a specific finding to verify. This is primarily used in VERIFY - * mode to focus the agent's execution-based validation on a single vulnerability. - */ - finding_id?: string; - - /** - * Optional session-specific configurations to override default agent behavior. - */ - session_config?: FindRequest.SessionConfig; - - /** - * Parameter for grouping multiple interactions that belong to the same CodeMender - * session. - */ - session_id?: string; - - /** - * A list of source files to provide as context for the scan. - */ - source_files?: Array; - } - - export namespace FindRequest { - /** - * Optional session-specific configurations to override default agent behavior. - */ - export interface SessionConfig { - /** - * The maximum number of interaction rounds the agent is allowed to perform before - * reaching a timeout. - */ - max_rounds?: number; - - /** - * The pipeline mode of a CodeMender session. It can only be used for a find - * session. - */ - pipeline_mode?: 'scan' | 'verify'; - - /** - * The cognitive architecture or "thinking" topology used by the agent (e.g. - * "default", "deep"). - */ - topology?: string; - } - - /** - * Content of a single file in the codebase. - */ - export interface SourceFile { - /** - * The UTF-8 encoded text content of the file. - */ - content?: string; - - /** - * The relative path of the file from the project root. - */ - path?: string; - } - } - - /** - * Request parameters specific to FIX sessions, used for generating and validating - * security patches. - */ - export interface FixRequest { - request: 'fix_request'; - - /** - * Additional context or custom instructions provided by the user to guide the - * patch generation process. - */ - description?: string; - - /** - * The identifier of the specific security finding to be remediated. This ID maps - * to a previously discovered vulnerability. - */ - finding_id?: string; - - /** - * Optional session-specific configurations to override default agent behavior. - */ - session_config?: FixRequest.SessionConfig; - - /** - * Parameter for grouping multiple interactions that belong to the same CodeMender - * session. - */ - session_id?: string; - - /** - * A list of source files providing context for the remediation. These files are - * typically the ones containing the identified vulnerability. - */ - source_files?: Array; - } - - export namespace FixRequest { - /** - * Optional session-specific configurations to override default agent behavior. - */ - export interface SessionConfig { - /** - * The maximum number of interaction rounds the agent is allowed to perform before - * reaching a timeout. - */ - max_rounds?: number; - - /** - * The pipeline mode of a CodeMender session. It can only be used for a find - * session. - */ - pipeline_mode?: 'scan' | 'verify'; - - /** - * The cognitive architecture or "thinking" topology used by the agent (e.g. - * "default", "deep"). - */ - topology?: string; - } - - /** - * Content of a single file in the codebase. - */ - export interface SourceFile { - /** - * The UTF-8 encoded text content of the file. - */ - content?: string; - - /** - * The relative path of the file from the project root. - */ - path?: string; - } - } -} - export interface CreateModelInteractionParamsNonStreaming extends BaseCreateModelInteractionParams { /** * Body param: Input only. Whether the interaction will be streamed. @@ -3466,6 +3301,8 @@ export declare namespace Interactions { type FileCitation as FileCitation, type FileSearchCallStep as FileSearchCallStep, type FileSearchResultStep as FileSearchResultStep, + type FindRequest as FindRequest, + type FixRequest as FixRequest, type Function as Function, type FunctionCallStep as FunctionCallStep, type FunctionResultStep as FunctionResultStep,