import { IDisposable } from "../../../../base/common/lifecycle.js"; import { IObservable } from "../../../../base/common/observable.js"; import { ISession, IChat } from "../../../services/sessions/common/session.js"; import { Event, URI } from "../../../sessions.web.main.internal.js"; import { ISessionTaskRunEvent, ISessionTaskWithTarget, INonSessionTaskEntry, ITaskEntry, TaskStorageTarget, ITaskRunOptions } from "./sessionsTasksService.js"; export interface ISessionsTasksService { readonly _serviceBrand: undefined; /** * Fires after a session task has been successfully dispatched to its * runner via {@link runTask}. Does not fire when the task throws or when * no runner is registered for the session. */ readonly onDidRunTask: Event; /** * Observable list of tasks with `inAgents: true`, automatically * updated when the tasks.json file changes. Each entry includes the * storage target the task was loaded from. * * **Note:** This observable is shared across all sessions — repeated * calls with different sessions overwrite it with the most recently * requested session's tasks. It is intended for a single follower * (e.g. the toolbar tracking the active session). Consumers that need * a one-time snapshot for a specific session should use * {@link getSessionTasksOnce} instead. */ getSessionTasks(session: ISession | IChat): IObservable; /** * Returns a one-shot snapshot of the tasks (with `inAgents: true`) for the * given session or chat, reading from both workspace and user `tasks.json`. * * Unlike {@link getSessionTasks}, this method does NOT touch the shared * per-folder observable, so it is safe to call concurrently for * multiple sessions or chats. */ getSessionTasksOnce(session: ISession | IChat): Promise; /** * Returns a one-shot snapshot of **all** tasks (with or without `inAgents`) * declared for the given session or chat, reading from both workspace and * user `tasks.json`. Used by the agent-host runner to look up dependency * tasks referenced via `dependsOn`. */ getAllTasks(session: ISession | IChat): Promise; /** * Returns tasks that do NOT have `inAgents: true` — used as * suggestions in the "Add Run Action" picker. */ getNonSessionTasks(session: ISession | IChat): Promise; /** * Sets `inAgents: true` on an existing task (identified by label), * updating it in place in its tasks.json. */ addTaskToSessions(task: ITaskEntry, session: ISession | IChat, target: TaskStorageTarget, options?: ITaskRunOptions): Promise; /** * Creates a new shell task with `inAgents: true` and writes it to * the appropriate tasks.json (user or workspace). */ createAndAddTask(label: string | undefined, command: string, session: ISession | IChat, target: TaskStorageTarget, options?: ITaskRunOptions): Promise; /** * Updates an existing task entry, optionally moving it between user and * workspace storage. */ updateTask(originalTaskLabel: string, updatedTask: ITaskEntry, session: ISession | IChat, currentTarget: TaskStorageTarget, newTarget: TaskStorageTarget): Promise; /** * Removes an existing task entry from its tasks.json. */ removeTask(taskLabel: string, session: ISession | IChat, target: TaskStorageTarget): Promise; /** * Runs a task via the task service, looking it up by label in the active * chat's workspace folder when provided. * * May resolve to an {@link IDisposable} that stops the launched task; see * {@link ISessionTaskRunner.runTask}. */ runTask(task: ITaskEntry, session: ISession, chat?: IChat): Promise; /** * Observable label of the pinned task for the given repository. */ getPinnedTaskLabel(repository: URI | undefined): IObservable; /** * Sets or clears the pinned task for the given repository. */ setPinnedTaskLabel(repository: URI | undefined, taskLabel: string | undefined): void; /** * Observable URL configured for the integrated browser action for the given repository. */ getBrowserUrl(repository: URI | undefined): IObservable; /** * Sets or clears the configured browser URL for the given repository. */ setBrowserUrl(repository: URI | undefined, url: string | undefined): void; /** * Observable indicating whether the integrated browser action is pinned as the primary action for the given repository. */ getPinnedBrowser(repository: URI | undefined): IObservable; /** * Sets or clears whether the integrated browser action is pinned as the primary action for the given repository. * Pinning the browser clears any pinned task; pinning a task clears the pinned browser. */ setPinnedBrowser(repository: URI | undefined, pinned: boolean): void; } export declare const ISessionsTasksService: import("../../../../platform/instantiation/common/instantiation.js").ServiceIdentifier;