import { ToolProvider, ToolRequest } from '@theia/ai-core'; import { TaskService } from '@theia/task/lib/browser/task-service'; import { TaskScope } from '@theia/task/lib/common/task-protocol'; import { TerminalService } from '@theia/terminal/lib/browser/base/terminal-service'; import { WorkspaceFunctionScope } from './workspace-functions'; /** * Sentinel value returned (and accepted) as `workspaceRoot` for tasks defined * in the `.code-workspace` file rather than in a specific folder's `tasks.json`. */ export declare const WORKSPACE_SCOPE_TOKEN = "(workspace)"; /** * Sentinel value returned (and accepted) as `workspaceRoot` for user-level * global tasks that are not associated with any workspace or folder. */ export declare const GLOBAL_SCOPE_TOKEN = "(global)"; export interface TaskListEntry { /** The task label as defined in tasks.json or by a task provider */ label: string; /** * Identifies where the task is defined: * - A root folder name (e.g. `"frontend"`) for folder-scoped tasks. * - `"(workspace)"` for tasks defined in the `.code-workspace` file. * - `"(global)"` for user-level global tasks. * * Pass this value back to `runTask`'s `workspaceRoot` parameter to * disambiguate when multiple tasks share the same label. */ workspaceRoot?: string; } /** * Maps a task scope to the addressing token an agent should use. * * - Folder URI string → the workspace root name (e.g. `"frontend"`). * - `TaskScope.Workspace` → `"(workspace)"`. * - `TaskScope.Global` → `"(global)"`. * * If a folder URI cannot be resolved to a known root name, falls back to * `"(workspace)"` so the task remains addressable. */ export declare function resolveScopeToken(scope: string | TaskScope.Workspace | TaskScope.Global, workspaceScope: WorkspaceFunctionScope): string; export declare class TaskListProvider implements ToolProvider { protected readonly taskService: TaskService; protected readonly workspaceScope: WorkspaceFunctionScope; getTool(): ToolRequest; private getAvailableTasks; private toTaskListEntry; } export declare class TaskRunnerProvider implements ToolProvider { protected readonly taskService: TaskService; protected readonly terminalService: TerminalService; protected readonly workspaceScope: WorkspaceFunctionScope; getTool(): ToolRequest; private handleRunTask; /** * Filters tasks by the `workspaceRoot` addressing token the agent provided. * * Handles the sentinel values `(workspace)` and `(global)` as well as * normal folder-root names. * * @returns the filtered task array, or an error string if the root is unknown. */ private filterByWorkspaceRoot; } //# sourceMappingURL=workspace-task-provider.d.ts.map