/** * Platform-agnostic interfaces for multi-platform support. * Allows Squad to work with GitHub and Azure DevOps interchangeably. * * @module platform/types */ export type PlatformType = 'github' | 'azure-devops' | 'planner'; /** Where work items are tracked — may differ from where code lives */ export type WorkItemSource = 'github' | 'azure-devops' | 'planner'; /** Hybrid config: repo on one platform, work items on another */ export interface HybridPlatformConfig { repo: PlatformType; workItems: WorkItemSource; } /** Normalized work item — maps to GitHub Issues or ADO Work Items */ export interface WorkItem { id: number; title: string; state: string; tags: string[]; assignedTo?: string; body?: string; url: string; } /** Normalized pull request — maps to GitHub PRs or ADO PRs */ export interface PullRequest { id: number; title: string; sourceBranch: string; targetBranch: string; status: 'active' | 'completed' | 'abandoned' | 'draft'; reviewStatus?: 'approved' | 'changes-requested' | 'pending'; author: string; url: string; } /** Platform adapter interface — implemented by GitHub and ADO adapters */ export interface PlatformAdapter { readonly type: PlatformType; listWorkItems(options: { tags?: string[]; state?: string; limit?: number; }): Promise; getWorkItem(id: number): Promise; createWorkItem(options: { title: string; description?: string; tags?: string[]; assignedTo?: string; type?: string; }): Promise; addTag(workItemId: number, tag: string): Promise; removeTag(workItemId: number, tag: string): Promise; addComment(workItemId: number, comment: string): Promise; /** * Assign a work item to a user. Pass undefined/empty to unassign the current assignee. * '@me' assigns the current user on GitHub; the ADO adapter cannot resolve '@me' and skips it (no-op). */ setAssignee(workItemId: number, assignee: string | undefined): Promise; /** Ensure a tag/label exists (creates it if missing). No-op on platforms with auto-created tags. */ ensureTag?(tag: string, options?: { color?: string; description?: string; }): Promise; /** * Verify and repair authentication context for the current repository. * If preferredUser is provided, switch to that account directly. * Otherwise, try to auto-detect from the remote URL (works for EMU repos * where org name = account name, but not for repos where owner ≠ your account). * No-op if auth is already correct. Non-fatal — never throws. */ ensureAuth?(preferredUser?: string): Promise; listPullRequests(options: { status?: string; limit?: number; }): Promise; createPullRequest(options: { title: string; sourceBranch: string; targetBranch: string; description?: string; }): Promise; mergePullRequest(id: number): Promise; createBranch(name: string, fromBranch?: string): Promise; } /** Where communication happens — which channel/service */ export type CommunicationChannel = 'github-discussions' | 'ado-work-items' | 'teams-graph' | 'file-log'; /** A reply from a human on a communication channel */ export interface CommunicationReply { author: string; body: string; timestamp: Date; /** Platform-specific identifier for the reply */ id: string; } /** Configuration for a communication channel */ export interface CommunicationConfig { channel: CommunicationChannel; /** Post session summaries after agent work */ postAfterSession?: boolean; /** Post decisions that need human review */ postDecisions?: boolean; /** Post escalations when agents are blocked */ postEscalations?: boolean; /** Adapter-specific configuration, keyed by channel name */ adapterConfig?: Record; } /** * Communication adapter interface — pluggable agent-human communication. * * Abstracts the communication channel so Squad can post updates and read * replies from GitHub Discussions, ADO Work Item discussions, Teams, or * plain log files — depending on what the user has configured. */ export interface CommunicationAdapter { readonly channel: CommunicationChannel; /** * Post an update to the communication channel. * Used by Scribe (session summaries), Ralph (board status), and agents (escalations). */ postUpdate(options: { title: string; body: string; category?: string; /** Agent or role posting the update */ author?: string; }): Promise<{ id: string; url?: string; }>; /** * Poll for replies since a given timestamp. * Returns new replies from humans on the channel. */ pollForReplies(options: { /** Thread/discussion ID to check for replies */ threadId: string; since: Date; }): Promise; /** * Get a URL that humans can open on any device (phone, browser, desktop). * Returns undefined if the channel has no web UI (e.g., file-log). */ getNotificationUrl(threadId: string): string | undefined; /** * Logout: clear cached credentials for this adapter. * Local credential purge — does not revoke server-side tokens. * Optional — not all adapters require authentication. */ logout?(): Promise; } //# sourceMappingURL=types.d.ts.map