@aligndottech/connector-core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/LICENSE +21 -0
  2. package/dist/fetchers/confluence.d.ts +9 -0
  3. package/dist/fetchers/confluence.d.ts.map +1 -0
  4. package/dist/fetchers/confluence.js +89 -0
  5. package/dist/fetchers/confluence.js.map +1 -0
  6. package/dist/fetchers/errors.d.ts +11 -0
  7. package/dist/fetchers/errors.d.ts.map +1 -0
  8. package/dist/fetchers/errors.js +15 -0
  9. package/dist/fetchers/errors.js.map +1 -0
  10. package/dist/fetchers/git.d.ts +23 -0
  11. package/dist/fetchers/git.d.ts.map +1 -0
  12. package/dist/fetchers/git.js +27 -0
  13. package/dist/fetchers/git.js.map +1 -0
  14. package/dist/fetchers/github.d.ts +9 -0
  15. package/dist/fetchers/github.d.ts.map +1 -0
  16. package/dist/fetchers/github.js +53 -0
  17. package/dist/fetchers/github.js.map +1 -0
  18. package/dist/fetchers/gitlab.d.ts +9 -0
  19. package/dist/fetchers/gitlab.d.ts.map +1 -0
  20. package/dist/fetchers/gitlab.js +33 -0
  21. package/dist/fetchers/gitlab.js.map +1 -0
  22. package/dist/fetchers/index.d.ts +20 -0
  23. package/dist/fetchers/index.d.ts.map +1 -0
  24. package/dist/fetchers/index.js +38 -0
  25. package/dist/fetchers/index.js.map +1 -0
  26. package/dist/fetchers/jira.d.ts +9 -0
  27. package/dist/fetchers/jira.d.ts.map +1 -0
  28. package/dist/fetchers/jira.js +73 -0
  29. package/dist/fetchers/jira.js.map +1 -0
  30. package/dist/fetchers/linear.d.ts +9 -0
  31. package/dist/fetchers/linear.d.ts.map +1 -0
  32. package/dist/fetchers/linear.js +71 -0
  33. package/dist/fetchers/linear.js.map +1 -0
  34. package/dist/fetchers/notion.d.ts +9 -0
  35. package/dist/fetchers/notion.d.ts.map +1 -0
  36. package/dist/fetchers/notion.js +85 -0
  37. package/dist/fetchers/notion.js.map +1 -0
  38. package/dist/fetchers/slack.d.ts +10 -0
  39. package/dist/fetchers/slack.d.ts.map +1 -0
  40. package/dist/fetchers/slack.js +103 -0
  41. package/dist/fetchers/slack.js.map +1 -0
  42. package/dist/fetchers/teams.d.ts +10 -0
  43. package/dist/fetchers/teams.d.ts.map +1 -0
  44. package/dist/fetchers/teams.js +76 -0
  45. package/dist/fetchers/teams.js.map +1 -0
  46. package/dist/fetchers/util/git.d.ts +22 -0
  47. package/dist/fetchers/util/git.d.ts.map +1 -0
  48. package/dist/fetchers/util/git.js +50 -0
  49. package/dist/fetchers/util/git.js.map +1 -0
  50. package/dist/fetchers/zoom.d.ts +9 -0
  51. package/dist/fetchers/zoom.d.ts.map +1 -0
  52. package/dist/fetchers/zoom.js +72 -0
  53. package/dist/fetchers/zoom.js.map +1 -0
  54. package/dist/index.d.ts +25 -0
  55. package/dist/index.d.ts.map +1 -0
  56. package/dist/index.js +33 -0
  57. package/dist/index.js.map +1 -0
  58. package/dist/parsers/CommandParser.d.ts +69 -0
  59. package/dist/parsers/CommandParser.d.ts.map +1 -0
  60. package/dist/parsers/CommandParser.js +233 -0
  61. package/dist/parsers/CommandParser.js.map +1 -0
  62. package/dist/services/GatewayClient.d.ts +147 -0
  63. package/dist/services/GatewayClient.d.ts.map +1 -0
  64. package/dist/services/GatewayClient.js +411 -0
  65. package/dist/services/GatewayClient.js.map +1 -0
  66. package/dist/services/StreamingResponseConsumer.d.ts +28 -0
  67. package/dist/services/StreamingResponseConsumer.d.ts.map +1 -0
  68. package/dist/services/StreamingResponseConsumer.js +58 -0
  69. package/dist/services/StreamingResponseConsumer.js.map +1 -0
  70. package/dist/services/TelemetryClient.d.ts +116 -0
  71. package/dist/services/TelemetryClient.d.ts.map +1 -0
  72. package/dist/services/TelemetryClient.js +234 -0
  73. package/dist/services/TelemetryClient.js.map +1 -0
  74. package/dist/testing/MockGatewayClient.d.ts +51 -0
  75. package/dist/testing/MockGatewayClient.d.ts.map +1 -0
  76. package/dist/testing/MockGatewayClient.js +84 -0
  77. package/dist/testing/MockGatewayClient.js.map +1 -0
  78. package/dist/testing/fixtures.d.ts +49 -0
  79. package/dist/testing/fixtures.d.ts.map +1 -0
  80. package/dist/testing/fixtures.js +59 -0
  81. package/dist/testing/fixtures.js.map +1 -0
  82. package/dist/tiers/capabilities.d.ts +18 -0
  83. package/dist/tiers/capabilities.d.ts.map +1 -0
  84. package/dist/tiers/capabilities.js +99 -0
  85. package/dist/tiers/capabilities.js.map +1 -0
  86. package/dist/types/fetcher.d.ts +59 -0
  87. package/dist/types/fetcher.d.ts.map +1 -0
  88. package/dist/types/fetcher.js +15 -0
  89. package/dist/types/fetcher.js.map +1 -0
  90. package/dist/types/flow.d.ts +190 -0
  91. package/dist/types/flow.d.ts.map +1 -0
  92. package/dist/types/flow.js +24 -0
  93. package/dist/types/flow.js.map +1 -0
  94. package/dist/types/index.d.ts +707 -0
  95. package/dist/types/index.d.ts.map +1 -0
  96. package/dist/types/index.js +13 -0
  97. package/dist/types/index.js.map +1 -0
  98. package/dist/utils/requestContext.d.ts +42 -0
  99. package/dist/utils/requestContext.d.ts.map +1 -0
  100. package/dist/utils/requestContext.js +56 -0
  101. package/dist/utils/requestContext.js.map +1 -0
  102. package/dist/utils/validation.d.ts +25 -0
  103. package/dist/utils/validation.d.ts.map +1 -0
  104. package/dist/utils/validation.js +31 -0
  105. package/dist/utils/validation.js.map +1 -0
  106. package/package.json +51 -0
@@ -0,0 +1,707 @@
1
+ /**
2
+ * Shared types for communication connectors (Slack, Teams, etc.)
3
+ *
4
+ * This is the SINGLE SOURCE OF TRUTH for types shared across:
5
+ * - mcp-teams connector
6
+ * - mcp-jira connector
7
+ * - mcp-slack connector
8
+ * - Gateway service (where applicable)
9
+ *
10
+ * DO NOT duplicate these types in connector packages.
11
+ */
12
+ /**
13
+ * Type of actionable item extracted from decisions
14
+ */
15
+ export type ActionableItemType = 'question' | 'risk' | 'ambiguity';
16
+ /**
17
+ * Priority level for actionable items
18
+ */
19
+ export type ActionableItemPriority = 'high' | 'medium' | 'low';
20
+ /**
21
+ * Status of an actionable item
22
+ */
23
+ export type ActionableItemStatus = 'open' | 'in_progress' | 'resolved' | 'deferred' | 'mitigated' | 'accepted';
24
+ /**
25
+ * An actionable item (question, risk, or ambiguity) extracted from a decision
26
+ */
27
+ export interface ActionableItem {
28
+ id: string;
29
+ type: ActionableItemType;
30
+ text: string;
31
+ context?: string;
32
+ status?: string;
33
+ priority?: ActionableItemPriority;
34
+ assignedTo?: string;
35
+ dueDate?: string;
36
+ resolutionSummary?: string;
37
+ mitigationStrategy?: string;
38
+ clarification?: string;
39
+ }
40
+ /**
41
+ * Action item with owner and due date
42
+ */
43
+ export interface Action {
44
+ text: string;
45
+ owner?: string;
46
+ dueDate?: string;
47
+ due?: string;
48
+ status?: 'pending' | 'in_progress' | 'completed' | 'blocked';
49
+ completed_at?: string;
50
+ }
51
+ /**
52
+ * AI analysis result from decision processing
53
+ */
54
+ export interface AIResult {
55
+ goals?: string[];
56
+ decisions?: string[];
57
+ questions?: string[];
58
+ risks?: string[];
59
+ actions?: Action[];
60
+ owners?: string[];
61
+ tags?: string[];
62
+ links?: string[];
63
+ rationale?: string;
64
+ work_item_type?: string;
65
+ acceptance_criteria?: string;
66
+ gherkin?: string;
67
+ confidence?: number;
68
+ actionableItems?: ActionableItem[];
69
+ }
70
+ /**
71
+ * Ambiguity analysis for a decision
72
+ */
73
+ export interface AmbiguityAnalysis {
74
+ score: number;
75
+ reasons?: string[];
76
+ vagueTerms?: string[];
77
+ missingContext?: string[];
78
+ contradictions?: string[];
79
+ }
80
+ /**
81
+ * Relationship types between decisions
82
+ */
83
+ export type DecisionRelationship = 'supersedes' | 'conflicts_with' | 'contradicts' | 'duplicates' | 'clarifies' | 'relates' | 'refines' | 'supports' | 'questions' | 'blocks';
84
+ /**
85
+ * A related decision with relationship metadata
86
+ */
87
+ export interface RelatedDecision {
88
+ id: string;
89
+ title?: string;
90
+ summary?: string;
91
+ relationship: DecisionRelationship;
92
+ confidence: number;
93
+ similarity?: number;
94
+ reasons?: string[];
95
+ suggestedActions?: string[];
96
+ source_url?: string;
97
+ }
98
+ /**
99
+ * Analysis of a decision's relationships and quality
100
+ */
101
+ export interface DecisionAnalysis {
102
+ isNew: boolean;
103
+ relatedDecisions: RelatedDecision[];
104
+ ambiguityAnalysis?: AmbiguityAnalysis;
105
+ suggestedActions?: string[];
106
+ severity?: 'low' | 'medium' | 'high' | 'critical';
107
+ }
108
+ /**
109
+ * Decision status
110
+ */
111
+ export type DecisionStatus = 'active' | 'superseded' | 'conflicted' | 'ambiguous' | 'clarified' | 'archived';
112
+ /**
113
+ * Core decision interface
114
+ */
115
+ export interface Decision {
116
+ id: string;
117
+ title: string;
118
+ summary: string;
119
+ decision_json: {
120
+ context?: unknown;
121
+ raw_text?: string;
122
+ ai?: AIResult;
123
+ };
124
+ }
125
+ /**
126
+ * Full decision snapshot from database
127
+ */
128
+ export interface DecisionSnapshot {
129
+ id: string;
130
+ tenant_id: string;
131
+ source_url: string;
132
+ platform: string;
133
+ title: string;
134
+ summary: string;
135
+ decision_json: {
136
+ context?: unknown;
137
+ raw_text?: string;
138
+ ai?: AIResult;
139
+ };
140
+ ai?: AIResult;
141
+ embedding?: number[];
142
+ status?: DecisionStatus;
143
+ ambiguity_score?: number;
144
+ ambiguity_reasons?: string[];
145
+ is_primary?: boolean;
146
+ primary_decision_id?: string;
147
+ source_reference?: string;
148
+ merged_into_primary_at?: string;
149
+ superseded_by?: string;
150
+ created_at: string;
151
+ updated_at?: string;
152
+ created_by?: string;
153
+ analysis?: DecisionAnalysis;
154
+ }
155
+ /**
156
+ * A single result from a decision search query
157
+ */
158
+ export interface DecisionSearchResult {
159
+ id: string;
160
+ source_url: string;
161
+ platform: string;
162
+ title: string;
163
+ summary: string;
164
+ created_at: string;
165
+ decision_json?: {
166
+ context?: unknown;
167
+ raw_text?: string;
168
+ ai?: AIResult;
169
+ };
170
+ status?: DecisionStatus;
171
+ similarity?: number;
172
+ }
173
+ /**
174
+ * Response from the decision search endpoint
175
+ */
176
+ export interface DecisionSearchResponse {
177
+ query: string;
178
+ results: DecisionSearchResult[];
179
+ count: number;
180
+ strategy: 'semantic' | 'keyword';
181
+ }
182
+ /**
183
+ * Options for searching decisions
184
+ */
185
+ export interface DecisionSearchOptions {
186
+ limit?: number;
187
+ exclude_superseded?: boolean;
188
+ }
189
+ export type IssueConnector = 'jira' | 'linear' | 'github';
190
+ export interface Issue {
191
+ connector: IssueConnector;
192
+ issueKey: string;
193
+ title?: string;
194
+ url?: string;
195
+ status?: string;
196
+ projectKey?: string;
197
+ }
198
+ export interface JiraSettings {
199
+ configured: boolean;
200
+ settings?: {
201
+ default_project_key?: string;
202
+ default_issue_type?: string;
203
+ default_labels?: string[];
204
+ default_components?: string[];
205
+ default_priority?: string;
206
+ default_epic_key?: string;
207
+ };
208
+ }
209
+ export interface JiraProject {
210
+ key: string;
211
+ name: string;
212
+ }
213
+ export interface EpicSuggestion {
214
+ type: 'EXISTING_EPIC' | 'NEW_EPIC';
215
+ epicKey?: string;
216
+ epicName?: string;
217
+ }
218
+ export interface CreateIssueParams {
219
+ connector: IssueConnector;
220
+ projectKey: string;
221
+ summary: string;
222
+ description: unknown;
223
+ issueType: string;
224
+ labels?: string[];
225
+ components?: string[];
226
+ priority?: string;
227
+ epicKey?: string;
228
+ }
229
+ export interface CreateIssueResult {
230
+ key: string;
231
+ issueKey?: string;
232
+ url?: string;
233
+ }
234
+ export interface BulkIssueCreationRequest {
235
+ decisionId: string;
236
+ title: string;
237
+ }
238
+ export interface BulkIssueResult {
239
+ decisionId: string;
240
+ title: string;
241
+ success: boolean;
242
+ error?: string;
243
+ issueKey?: string;
244
+ issueUrl?: string;
245
+ }
246
+ export interface BulkIssueCreationResult {
247
+ type: 'completed' | 'needs_project_selection';
248
+ results?: BulkIssueResult[];
249
+ projects?: JiraProject[];
250
+ createdCount?: number;
251
+ failedCount?: number;
252
+ }
253
+ export type CommandAction = {
254
+ type: 'merge_all';
255
+ } | {
256
+ type: 'merge_single';
257
+ index: number;
258
+ } | {
259
+ type: 'merge_specific';
260
+ indices: number[];
261
+ } | {
262
+ type: 'keep_new';
263
+ } | {
264
+ type: 'keep_old';
265
+ } | {
266
+ type: 'keep_both';
267
+ } | {
268
+ type: 'accept_supersession';
269
+ } | {
270
+ type: 'reject_supersession';
271
+ } | {
272
+ type: 'link_issue';
273
+ issueKey: string;
274
+ } | {
275
+ type: 'create_issue';
276
+ projectKey?: string;
277
+ } | {
278
+ type: 'skip';
279
+ } | {
280
+ type: 'help';
281
+ } | {
282
+ type: 'greeting';
283
+ } | {
284
+ type: 'unknown';
285
+ };
286
+ export type ConversationAction = 'awaiting_conflict_action' | 'awaiting_issue_action' | 'awaiting_project_selection' | 'awaiting_epic_selection' | null;
287
+ export interface ConversationState {
288
+ action: ConversationAction;
289
+ related_decisions?: RelatedDecision[];
290
+ issues?: Issue[];
291
+ searchText?: string;
292
+ decision_title?: string;
293
+ decision_id?: string;
294
+ suggestedEpicKey?: string;
295
+ suggestedEpicName?: string;
296
+ selectedProjectKey?: string;
297
+ }
298
+ export interface StoredConversationState {
299
+ id: string;
300
+ tenant_id: string;
301
+ platform: 'slack' | 'teams';
302
+ conversation_id: string;
303
+ channel_id: string;
304
+ decision_id?: string;
305
+ state: ConversationState;
306
+ user_id?: string;
307
+ expires_at: Date;
308
+ created_at: Date;
309
+ updated_at: Date;
310
+ }
311
+ export interface IngestPayload {
312
+ source_url: string;
313
+ platform: DecisionPlatform;
314
+ raw_text: string;
315
+ message_id: string;
316
+ conversation_id: string;
317
+ is_meeting_chat?: boolean;
318
+ }
319
+ /**
320
+ * Response from Gateway /ingest endpoint
321
+ */
322
+ export interface IngestResponse {
323
+ id: string;
324
+ tenant_id?: string;
325
+ source_url?: string;
326
+ platform?: string;
327
+ title?: string;
328
+ summary?: string;
329
+ decision_json?: unknown;
330
+ ai?: AIResult;
331
+ analysis?: DecisionAnalysis;
332
+ }
333
+ /**
334
+ * Position in a debate for consensus analysis
335
+ */
336
+ export interface ConsensusPosition {
337
+ position: string;
338
+ supporters: string[];
339
+ evidence: string[];
340
+ }
341
+ /**
342
+ * Proposed consensus from debate analysis
343
+ */
344
+ export interface ProposedConsensus {
345
+ title: string;
346
+ summary: string;
347
+ rationale: string;
348
+ confidence: number;
349
+ }
350
+ /**
351
+ * Response from Gateway /ingest/consensus endpoint
352
+ */
353
+ export interface ConsensusResponse {
354
+ type: 'consensus';
355
+ source_url: string;
356
+ platform: string;
357
+ debate_summary: string;
358
+ positions: ConsensusPosition[];
359
+ areas_of_agreement: string[];
360
+ areas_of_disagreement: string[];
361
+ proposed_consensus: ProposedConsensus;
362
+ open_questions: string[];
363
+ suggested_next_steps: string[];
364
+ confidence: number;
365
+ trace?: Record<string, unknown>;
366
+ }
367
+ export interface IssueSearchResult {
368
+ results: Issue[];
369
+ explicitRefs: {
370
+ jira: string[];
371
+ linear: string[];
372
+ ambiguous: string[];
373
+ };
374
+ enabledConnectors: string[];
375
+ }
376
+ /**
377
+ * Platform-agnostic message sending interface
378
+ */
379
+ export interface MessageSender {
380
+ sendText(text: string): Promise<void>;
381
+ sendCard(card: unknown): Promise<void>;
382
+ }
383
+ /**
384
+ * Platform context for handling messages
385
+ */
386
+ export interface PlatformContext {
387
+ tenantId: string;
388
+ conversationId: string;
389
+ channelId: string;
390
+ userId: string;
391
+ platform: 'slack' | 'teams' | 'zoom';
392
+ messageSender: MessageSender;
393
+ }
394
+ /**
395
+ * Action item extracted from a decision
396
+ */
397
+ export interface ExtractedAction {
398
+ text: string;
399
+ owner?: string;
400
+ due?: string;
401
+ status?: string;
402
+ }
403
+ /**
404
+ * A single decision extracted from a transcript
405
+ */
406
+ export interface ExtractedDecision {
407
+ /** Unique identifier for this pending decision (client-generated) */
408
+ id: string;
409
+ /** Short title for the decision */
410
+ title: string;
411
+ /** Brief summary of this decision segment */
412
+ segment_summary: string;
413
+ /** Timestamp where this decision starts in the transcript */
414
+ start_timestamp?: string;
415
+ /** Timestamp where this decision ends */
416
+ end_timestamp?: string;
417
+ /** Goals identified for this decision */
418
+ goals: string[];
419
+ /** Actual decisions made */
420
+ decisions: string[];
421
+ /** Unresolved questions */
422
+ questions: string[];
423
+ /** Identified risks */
424
+ risks: string[];
425
+ /** Action items with optional owner/due date */
426
+ actions: ExtractedAction[];
427
+ /** People responsible for this decision */
428
+ owners: string[];
429
+ /** Relevant tags */
430
+ tags: string[];
431
+ /** Rationale for the decision */
432
+ rationale: string;
433
+ /** Type of work item (user_story, technical_task, epic) */
434
+ work_item_type: 'user_story' | 'technical_task' | 'epic';
435
+ /** Acceptance criteria formatted by work item type */
436
+ acceptance_criteria: string;
437
+ /** Gherkin specification (for user stories) */
438
+ gherkin: string;
439
+ /** Confidence score 0-1 */
440
+ confidence: number;
441
+ /** Actionable items (questions, risks, ambiguities) */
442
+ actionableItems?: ActionableItem[];
443
+ }
444
+ /**
445
+ * Response from Brain /synthesize-multi endpoint
446
+ */
447
+ export interface MultiDecisionResponse {
448
+ decisions: ExtractedDecision[];
449
+ decision_count: number;
450
+ trace?: Record<string, unknown>;
451
+ }
452
+ /**
453
+ * State for multi-decision review flow
454
+ */
455
+ export interface MultiDecisionReviewState {
456
+ /** Pending decisions to review */
457
+ pending_decisions: ExtractedDecision[];
458
+ /** Decisions that have been saved */
459
+ saved_decision_ids: string[];
460
+ /** Decisions that were skipped/removed */
461
+ skipped_decision_ids: string[];
462
+ /** Index of currently displayed decision (for carousel navigation) */
463
+ current_index: number;
464
+ /** Auto-save timeout in seconds (null means no auto-save) */
465
+ auto_save_timeout_seconds?: number;
466
+ /** When the auto-save timer started */
467
+ auto_save_started_at?: string;
468
+ /** Source information */
469
+ source: {
470
+ platform: 'slack' | 'teams';
471
+ meeting_id?: string;
472
+ meeting_subject?: string;
473
+ transcript_url?: string;
474
+ conversation_id: string;
475
+ };
476
+ }
477
+ /**
478
+ * Extended conversation state to include multi-decision review
479
+ */
480
+ export type ExtendedConversationAction = ConversationAction | 'awaiting_multi_decision_review';
481
+ export interface ExtendedConversationState extends Omit<ConversationState, 'action'> {
482
+ action: ExtendedConversationAction;
483
+ /** Multi-decision review state (when action is 'awaiting_multi_decision_review') */
484
+ multi_decision?: MultiDecisionReviewState;
485
+ }
486
+ /**
487
+ * Commands for multi-decision review
488
+ */
489
+ export type MultiDecisionCommand = {
490
+ type: 'save_all';
491
+ } | {
492
+ type: 'save_current';
493
+ } | {
494
+ type: 'skip_current';
495
+ } | {
496
+ type: 'skip_all';
497
+ } | {
498
+ type: 'next';
499
+ } | {
500
+ type: 'prev';
501
+ } | {
502
+ type: 'edit';
503
+ decisionId: string;
504
+ } | {
505
+ type: 'review';
506
+ } | {
507
+ type: 'show_list';
508
+ };
509
+ /**
510
+ * Data for formatting a decision snapshot alert
511
+ */
512
+ export interface DecisionAlertData {
513
+ id: string;
514
+ title?: string;
515
+ summary?: string;
516
+ goals?: string[];
517
+ decisions?: string[];
518
+ actions?: Action[];
519
+ risks?: string[];
520
+ questions?: string[];
521
+ confidence?: number;
522
+ ambiguityScore?: number;
523
+ detailsUrl?: string;
524
+ }
525
+ /**
526
+ * Data for formatting a conflict/duplicate/supersession alert
527
+ */
528
+ export interface ConflictAlertData {
529
+ conflictingDecisionId: string;
530
+ conflictingDecisionTitle?: string;
531
+ conflictingDecisionUrl?: string;
532
+ relationshipType: 'conflicts_with' | 'duplicates' | 'supersedes';
533
+ confidence: number;
534
+ explanation?: string;
535
+ }
536
+ /**
537
+ * Data for formatting a multiple duplicates alert
538
+ */
539
+ export interface DuplicatesAlertData {
540
+ duplicates: Array<{
541
+ id: string;
542
+ title?: string;
543
+ url?: string;
544
+ confidence: number;
545
+ }>;
546
+ }
547
+ /**
548
+ * Data for formatting an ambiguity alert
549
+ */
550
+ export interface AmbiguityAlertData {
551
+ score: number;
552
+ reasons?: string[];
553
+ }
554
+ /**
555
+ * Types of decision operations
556
+ */
557
+ export type DecisionOperationType = 'merge' | 'supersession_accepted' | 'supersession_rejected' | 'conflict_resolved' | 'kept_both' | 'skip';
558
+ /**
559
+ * Result of a decision operation (merge, supersession, etc.)
560
+ */
561
+ export interface DecisionOperationResult {
562
+ success: boolean;
563
+ message: string;
564
+ error?: string;
565
+ /** The type of operation that was performed */
566
+ operationType?: DecisionOperationType;
567
+ }
568
+ /**
569
+ * Actions for conversation state (extended for all platforms)
570
+ */
571
+ export type PlatformConversationAction = 'awaiting_conflict_action' | 'awaiting_duplicate_action' | 'awaiting_supersession_action' | 'awaiting_issue_action' | 'awaiting_project_selection' | 'awaiting_epic_selection' | 'awaiting_multi_decision_review';
572
+ /**
573
+ * Supported platforms for decision capture
574
+ */
575
+ export type DecisionPlatform = 'slack' | 'teams' | 'github' | 'jira' | 'confluence' | 'zoom';
576
+ /**
577
+ * Extended platform context supporting all platforms
578
+ */
579
+ export interface ExtendedPlatformContext {
580
+ tenantId: string;
581
+ platform: DecisionPlatform;
582
+ /** Unique conversation identifier (channel_ts for Slack, thread_id for Teams, pr_number for GitHub) */
583
+ conversationId: string;
584
+ /** Channel/repo identifier */
585
+ channelId: string;
586
+ /** User identifier */
587
+ userId: string;
588
+ }
589
+ /**
590
+ * Intent detected from user message
591
+ */
592
+ export type ConversationalIntent = 'consensus' | 'decision' | 'question' | 'status' | 'help' | 'transcript' | 'clarify';
593
+ /**
594
+ * Single message in conversation history
595
+ */
596
+ export interface ConversationMessage {
597
+ author: string;
598
+ content: string;
599
+ timestamp?: string;
600
+ }
601
+ /**
602
+ * Request for conversational AI endpoint
603
+ */
604
+ export interface ConversationalRequest {
605
+ message: string;
606
+ conversation_history: ConversationMessage[];
607
+ platform: DecisionPlatform;
608
+ context: Record<string, unknown>;
609
+ source_url?: string;
610
+ }
611
+ /**
612
+ * Response from conversational AI endpoint
613
+ */
614
+ export interface ConversationalResponse {
615
+ intent: ConversationalIntent;
616
+ response_text: string;
617
+ structured_data?: {
618
+ debate_summary?: string;
619
+ positions?: Array<{
620
+ position: string;
621
+ supporters?: string[];
622
+ evidence?: string[];
623
+ }>;
624
+ areas_of_agreement?: string[];
625
+ areas_of_disagreement?: string[];
626
+ proposed_consensus?: {
627
+ title: string;
628
+ summary: string;
629
+ rationale: string;
630
+ confidence: number;
631
+ };
632
+ open_questions?: string[];
633
+ suggested_next_steps?: string[];
634
+ title?: string;
635
+ summary?: string;
636
+ decisions?: string[];
637
+ owners?: string[];
638
+ } | null;
639
+ follow_up_prompts: string[];
640
+ confidence: number;
641
+ }
642
+ /**
643
+ * Server-Sent Event from streaming conversational AI endpoint
644
+ */
645
+ export interface StreamEvent {
646
+ type: 'token' | 'complete' | 'error';
647
+ data: {
648
+ text?: string;
649
+ error?: string;
650
+ intent?: string;
651
+ response_text?: string;
652
+ structured_data?: Record<string, unknown> | null;
653
+ follow_up_prompts?: string[];
654
+ confidence?: number;
655
+ [key: string]: unknown;
656
+ };
657
+ }
658
+ /**
659
+ * Payload sent from gateway → communication-tier connector for deferred conflict/supersession alerts.
660
+ * Used by ALL communication connectors (Slack, Teams, Zoom, etc.) via DeferredNotificationHandler.
661
+ *
662
+ * Gateway sends this after performDeferredAnalysis() detects a conflict or supersession
663
+ * with confidence >= 0.7, targeting the original thread/conversation where the decision was captured.
664
+ */
665
+ export interface ConflictNotificationPayload {
666
+ decisionId: string;
667
+ decisionTitle: string;
668
+ relatedId: string;
669
+ relatedTitle: string;
670
+ relationship: 'conflicts_with' | 'contradicts' | 'supersedes';
671
+ confidence: number;
672
+ severity: string;
673
+ reasons: string[];
674
+ /** Platform-specific channel ID where the original decision was captured. Null for non-chat platforms (Jira, GitHub). */
675
+ sourceChannelId: string | null;
676
+ /** Platform-specific thread/conversation ID. Null if posted at channel level. */
677
+ sourceConversationId: string | null;
678
+ /** Space/team names the new decision belongs to (for cross-scope display) */
679
+ decisionSpaces?: string[];
680
+ /** Space/team names the related decision belongs to */
681
+ relatedSpaces?: string[];
682
+ /** Suggested actions from the analysis (e.g. "Review and resolve conflict before proceeding") */
683
+ suggestedActions?: string[];
684
+ }
685
+ /**
686
+ * Payload sent from gateway -> communication-tier connector for stale decision digest DMs.
687
+ * Gateway sends this weekly when decisions are past their review interval.
688
+ * The connector formats a digest card and sends it as a DM to the user.
689
+ */
690
+ export interface StaleDigestNotificationPayload {
691
+ /** Platform-specific user ID to DM (Slack user ID, Teams email/AAD ID) */
692
+ userId: string;
693
+ /** Stale decisions for this user (capped at 10) */
694
+ decisions: Array<{
695
+ id: string;
696
+ title: string;
697
+ platform: string;
698
+ created_at: string;
699
+ last_reviewed_at: string | null;
700
+ review_interval_days: number;
701
+ days_overdue: number;
702
+ source_url: string;
703
+ }>;
704
+ /** Total stale count including those beyond the cap */
705
+ totalStaleCount: number;
706
+ }
707
+ //# sourceMappingURL=index.d.ts.map