import { AIVariable, AIVariableContext, AIVariableContribution, AIVariableResolutionRequest, AIVariableResolver, AIVariableService, ResolvedAIVariable } from '@theia/ai-core/lib/common'; import { MaybePromise, URI } from '@theia/core'; import { WorkspaceMetadataStorageService, WorkspaceMetadataStore } from '@theia/workspace/lib/browser/metadata-storage'; import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service'; import { AccessibleRootContribution } from './workspace-functions'; /** Key under which the memory directory is requested from the workspace metadata storage. */ export declare const MEMORY_METADATA_STORE_KEY = "memory"; export declare const MEMORY_DIRECTORY_VARIABLE: AIVariable; /** * Resolves the memory directory of the current workspace and makes it reachable for the AI workspace * tools. The directory is the workspace's metadata store, so every workspace has its own memory and none * of it ends up in the user's repository. * * Its path is generated and changes with the workspace, which is why it is contributed as an accessible * root instead of being configured in `ai-features.workspaceFunctions.allowedExternalPaths`: the user * cannot name a path they do not know, and prompts learn it from {@link MEMORY_DIRECTORY_VARIABLE}. * * A window without a workspace has no metadata store and therefore no memory. The variable then resolves * to nothing and no directory is made accessible. */ export declare class MemoryDirectoryVariableContribution implements AIVariableContribution, AIVariableResolver, AccessibleRootContribution { protected readonly metadataStorageService: WorkspaceMetadataStorageService; protected readonly workspaceService: WorkspaceService; protected store: WorkspaceMetadataStore | undefined; protected ensuredLocation: string | undefined; registerVariables(service: AIVariableService): void; canResolve(request: AIVariableResolutionRequest, context: AIVariableContext): MaybePromise; resolve(request: AIVariableResolutionRequest, context: AIVariableContext): Promise; getRoots(): Promise; /** * The memory store of the current workspace, or undefined when there is no workspace to store * memory for. The store instance is kept because it tracks the workspace itself: its `location` * follows a workspace change, so nothing has to be invalidated when the workspace is replaced. * * Closing a workspace is the exception: the store cannot compute a location without one, so it * keeps the location of the closed workspace. Whether a workspace is open is therefore checked on * every call rather than only when the store is created. */ protected getStore(): Promise; } //# sourceMappingURL=memory-directory-variable-contribution.d.ts.map