Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 | 1x 1x 1x 1x 1x | import { Tool, Resource, Prompt } from '@modelcontextprotocol/sdk/types.js'; import { Client } from '@modelcontextprotocol/sdk/client/index.js'; export interface ProviderConfig { id: string; name: string; type: 'stdio' | 'http' | 'sse'; command?: string; args?: string[]; url?: string; headers?: Record<string, string>; env?: Record<string, string>; enabled: boolean; version?: string; autoUpdate?: boolean; } export interface ProjectMapping { [path: string]: string; } export interface NexusConfig { providers: ProviderConfig[]; projects: ProjectMapping; defaultRepository?: string; defaultTask?: string; } // Request queuing interfaces export interface QueuedRequest { id: string; type: 'tool' | 'resource' | 'prompt'; data: { name?: string; uri?: string; arguments?: Record<string, unknown>; }; resolve: (value: unknown) => void; reject: (error: Error) => void; timestamp: Date; timeoutId?: NodeJS.Timeout; } export interface ProviderInstance { id: string; config: ProviderConfig; client?: Client; tools: Map<string, Tool>; resources: Map<string, Resource>; prompts: Map<string, Prompt>; status: 'starting' | 'connected' | 'disconnected' | 'error' | 'auth_failed' | 'updating'; error?: string; errorType?: 'auth' | 'network' | 'config' | 'unknown'; shouldReconnect?: boolean; reconnectAttempts?: number; lastReconnectTime?: Date; lastUpdated?: Date; // New fields for update management isUpdating?: boolean; updateStartTime?: Date; requestQueue?: QueuedRequest[]; } // Enhanced WorkItem interface as per PROVIDERS.md export interface WorkItem { // Identity id: string; // Global unique ID: "provider:owner/project#number" provider: 'gitlab' | 'github' | 'azure'; // Core fields (common across all) type: WorkItemType; // Normalized type title: string; description: string; state: 'open' | 'closed'; // Simplified state // Relationships parent?: WorkItem; // Parent epic/feature children?: WorkItem[]; // Child items blockedBy?: WorkItem[]; blocks?: WorkItem[]; relatedTo?: WorkItem[]; // People author: User; assignees: User[]; // May be limited to 1 for Azure reviewers?: User[]; mentions?: User[]; // Organization labels: string[]; milestone?: Milestone; iteration?: Iteration; priority?: Priority; // Timestamps createdAt: Date; updatedAt: Date; closedAt?: Date; dueDate?: Date; // Provider-specific extensions providerFields: ProviderSpecificFields; // Migration metadata migrationMeta?: { sourceProvider: string; sourceId: string; migratedAt: Date; dataMappingNotes: string[]; }; } // Legacy WorkItem interface for backward compatibility export interface LegacyWorkItem { id: string; provider: string; type: 'issue' | 'task' | 'epic' | 'story' | 'bug'; title: string; description?: string; status: string; assignee?: string; labels?: string[]; milestone?: string; priority?: string; createdAt?: Date; updatedAt?: Date; originalData?: unknown; } export interface UnifiedToolCall { provider: string; tool: string; arguments: Record<string, unknown>; } export interface MCPResult { content?: Array<{ type: string; text?: string; }>; isError?: boolean; } export interface ProviderAPIResponse { id?: string | number; number?: number; iid?: number; title?: string; name?: string; summary?: string; description?: string; body?: string; content?: string; state?: string; status?: string; type?: string; issue_type?: string; assignee?: string | { username?: string; login?: string; name?: string }; assignees?: Array<string | { username?: string; login?: string; name?: string }>; assigned_to?: string | { name?: string }; labels?: Array<string | { name?: string; title?: string }>; tags?: string[]; milestone?: string | { title?: string }; priority?: string; created_at?: string; updated_at?: string; } export interface TypeGuards { isMCPResult(value: unknown): value is MCPResult; isProviderAPIResponse(value: unknown): value is ProviderAPIResponse; isStringOrObject(value: unknown): value is string | Record<string, unknown>; } // New type definitions as per PROVIDERS.md export type WorkItemType = 'epic' | 'feature' | 'story' | 'bug' | 'task' | 'test' | 'issue'; export type Priority = 'critical' | 'high' | 'medium' | 'low'; export type Provider = 'gitlab' | 'github' | 'azure'; export type AzureProcess = 'agile' | 'scrum' | 'basic'; export type LinkType = 'blocks' | 'related' | 'duplicate' | 'parent-child'; export interface User { id: string; username: string; displayName: string; email?: string; provider: Provider; } export interface Milestone { id: string; title: string; description?: string; startDate?: Date; dueDate?: Date; state: 'open' | 'closed'; provider: 'gitlab' | 'github'; } export interface Iteration { id: string; title: string; startDate: Date; endDate: Date; state: 'open' | 'closed' | 'upcoming' | 'current'; provider: 'gitlab' | 'azure'; path?: string; // Azure iteration path } // Provider-specific field containers export interface GitLabSpecificFields { iid: number; projectId: number; weight?: number; timeEstimate?: number; timeSpent?: number; confidential?: boolean; discussionLocked?: boolean; epicId?: number; healthStatus?: 'on_track' | 'needs_attention' | 'at_risk'; issueType?: 'issue' | 'incident' | 'test_case' | 'task'; } export interface GitHubSpecificFields { number: number; repository: string; stateReason?: 'completed' | 'not_planned' | 'reopened'; reactions?: Record<string, number>; isDraft?: boolean; projectItems?: Array<{ projectId: string; itemId: string; fieldValues: Record<string, unknown>; }>; } export interface AzureSpecificFields { workItemId: number; workItemType: string; // Exact ADO type areaPath?: string; iterationPath?: string; state: string; // Full ADO state reason?: string; boardColumn?: string; boardLane?: string; storyPoints?: number; effort?: number; remainingWork?: number; originalEstimate?: number; completedWork?: number; customFields?: Record<string, unknown>; } export type ProviderSpecificFields = | GitLabSpecificFields | GitHubSpecificFields | AzureSpecificFields; // Work item hierarchy and capabilities export enum HierarchyLevel { Portfolio = 0, // Epic level Feature = 1, // Feature/Sub-epic Requirement = 2, // User Story/Issue Task = 3, // Task/Sub-task } export interface ProviderCapabilities { supportsEpics: boolean; supportsIterations: boolean; supportsMilestones: boolean; supportsMultipleAssignees: boolean; supportsConfidential: boolean; supportsWeight: boolean; supportsTimeTracking: boolean; supportsCustomFields: boolean; maxAssignees: number; hierarchyLevels: number; customWorkItemTypes: string[]; } // Data structures for CRUD operations export interface CreateWorkItemData { type: WorkItemType; title: string; description: string; assignees?: User[]; labels?: string[]; priority?: Priority; parent?: WorkItem; milestone?: Milestone; iteration?: Iteration; dueDate?: Date; confidential?: boolean; customFields?: Record<string, unknown>; } export interface UpdateWorkItemData { title?: string; description?: string; state?: 'open' | 'closed'; assignees?: User[]; labels?: string[]; priority?: Priority; milestone?: Milestone; iteration?: Iteration; dueDate?: Date; } export interface WorkItemFilter { type?: WorkItemType; state?: 'open' | 'closed' | 'all'; assignee?: string; labels?: string[]; milestone?: string; iteration?: string; priority?: Priority; since?: Date; until?: Date; } // Migration support types export interface WorkItemExport { id: string; provider: Provider; type: WorkItemType; title: string; description: string; state: 'open' | 'closed'; assignees: User[]; labels: string[]; milestone?: Milestone; iteration?: Iteration; priority?: Priority; createdAt: Date; updatedAt: Date; providerFields: ProviderSpecificFields; relationships: { parent?: string; children: string[]; blocks: string[]; blockedBy: string[]; relatedTo: string[]; }; } export interface WorkItemImport { title: string; description: string; type: WorkItemType; state: 'open' | 'closed'; labels: string[]; assignees: User[]; priority?: Priority; customFields: Record<string, unknown>; } export interface MigrationResult { successful: number; failed: Array<{ id: string; reason: string; }>; mapping: Map<string, string>; // old ID -> new ID } |