/** * Coding Workspace Service - Manages git workspaces for coding tasks * * Delegates to: * - workspace-github.ts (issue management, OAuth, PAT auth) * - workspace-git-ops.ts (status, commit, push, PR creation) * - workspace-lifecycle.ts (GC, scratch dir cleanup) * - workspace-types.ts (shared interface definitions) * * @module services/workspace-service */ import type { IAgentRuntime } from "@elizaos/core"; import { type CreateIssueOptions, type IssueComment, type IssueInfo, type IssueState, type PullRequestInfo, type WorkspaceEvent } from "git-workspace-service"; import type { AuthPromptCallback } from "./workspace-github.js"; export type { AuthPromptCallback } from "./workspace-github.js"; export type { CodingWorkspaceConfig, CommitOptions, PROptions, ProvisionWorkspaceOptions, PushOptions, WorkspaceResult, WorkspaceStatusResult, } from "./workspace-types.js"; import type { CodingWorkspaceConfig, CommitOptions, PROptions, ProvisionWorkspaceOptions, PushOptions, WorkspaceResult, WorkspaceStatusResult } from "./workspace-types.js"; type WorkspaceEventCallback = (event: WorkspaceEvent) => void; export declare class CodingWorkspaceService { static serviceType: string; capabilityDescription: string; private runtime; private workspaceService; private credentialService; private githubClient; private githubAuthInProgress; private serviceConfig; private workspaces; private labels; private eventCallbacks; private authPromptCallback; constructor(runtime: IAgentRuntime, config?: CodingWorkspaceConfig); static start(runtime: IAgentRuntime): Promise; static stopRuntime(runtime: IAgentRuntime): Promise; private initialize; stop(): Promise; /** Provision a new workspace */ provisionWorkspace(options: ProvisionWorkspaceOptions): Promise; getWorkspace(id: string): WorkspaceResult | undefined; listWorkspaces(): WorkspaceResult[]; /** * Assign a semantic label to a workspace (e.g. "auth-bugfix"). * If the label already exists, it is reassigned to the new workspace. */ setLabel(workspaceId: string, label: string): void; getWorkspaceByLabel(label: string): WorkspaceResult | undefined; /** Resolve a workspace by label or ID. */ resolveWorkspace(labelOrId: string): WorkspaceResult | undefined; getStatus(workspaceId: string): Promise; commit(workspaceId: string, options: CommitOptions): Promise; push(workspaceId: string, options?: PushOptions): Promise; createPR(workspaceId: string, options: PROptions): Promise; private getGitHubContext; /** Set a callback to surface OAuth auth prompts to the user. */ setAuthPromptCallback(callback: AuthPromptCallback): void; createIssue(repo: string, options: CreateIssueOptions): Promise; getIssue(repo: string, issueNumber: number): Promise; listIssues(repo: string, options?: { state?: IssueState | "all"; labels?: string[]; assignee?: string; }): Promise; updateIssue(repo: string, issueNumber: number, options: { title?: string; body?: string; state?: IssueState; labels?: string[]; assignees?: string[]; }): Promise; addComment(repo: string, issueNumber: number, body: string): Promise; listComments(repo: string, issueNumber: number): Promise; closeIssue(repo: string, issueNumber: number): Promise; reopenIssue(repo: string, issueNumber: number): Promise; addLabels(repo: string, issueNumber: number, labels: string[]): Promise; removeWorkspace(workspaceId: string): Promise; onEvent(callback: WorkspaceEventCallback): () => void; private emitEvent; /** Remove a scratch directory (non-git workspace) under the workspaces base dir. */ removeScratchDir(dirPath: string): Promise; /** GC orphaned workspace directories older than workspaceTtlMs. */ private gcOrphanedWorkspaces; private log; } //# sourceMappingURL=workspace-service.d.ts.map