2026-03-09 09:02:20 -07:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright 2026 Google LLC
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import type { GeminiClient } from '../core/client.js';
|
|
|
|
|
import type { MessageBus } from '../confirmation-bus/message-bus.js';
|
|
|
|
|
import type { ToolRegistry } from '../tools/tool-registry.js';
|
2026-03-17 19:34:44 -07:00
|
|
|
import type { PromptRegistry } from '../prompts/prompt-registry.js';
|
|
|
|
|
import type { ResourceRegistry } from '../resources/resource-registry.js';
|
2026-03-13 14:11:51 -07:00
|
|
|
import type { SandboxManager } from '../services/sandboxManager.js';
|
2026-03-10 18:12:59 -07:00
|
|
|
import type { Config } from './config.js';
|
2026-03-09 09:02:20 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* AgentLoopContext represents the execution-scoped view of the world for a single
|
|
|
|
|
* agent turn or sub-agent loop.
|
|
|
|
|
*/
|
|
|
|
|
export interface AgentLoopContext {
|
2026-03-10 18:12:59 -07:00
|
|
|
/** The global runtime configuration. */
|
|
|
|
|
readonly config: Config;
|
|
|
|
|
|
2026-03-09 09:02:20 -07:00
|
|
|
/** The unique ID for the current user turn or agent thought loop. */
|
|
|
|
|
readonly promptId: string;
|
|
|
|
|
|
|
|
|
|
/** The registry of tools available to the agent in this context. */
|
|
|
|
|
readonly toolRegistry: ToolRegistry;
|
|
|
|
|
|
2026-03-17 19:34:44 -07:00
|
|
|
/** The registry of prompts available to the agent in this context. */
|
|
|
|
|
readonly promptRegistry: PromptRegistry;
|
|
|
|
|
|
|
|
|
|
/** The registry of resources available to the agent in this context. */
|
|
|
|
|
readonly resourceRegistry: ResourceRegistry;
|
|
|
|
|
|
2026-03-09 09:02:20 -07:00
|
|
|
/** The bus for user confirmations and messages in this context. */
|
|
|
|
|
readonly messageBus: MessageBus;
|
|
|
|
|
|
|
|
|
|
/** The client used to communicate with the LLM in this context. */
|
|
|
|
|
readonly geminiClient: GeminiClient;
|
2026-03-13 14:11:51 -07:00
|
|
|
|
|
|
|
|
/** The service used to prepare commands for sandboxed execution. */
|
|
|
|
|
readonly sandboxManager: SandboxManager;
|
2026-03-09 09:02:20 -07:00
|
|
|
}
|