turbowrap-issue-widget 1.0.38 → 1.13.6

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.
@@ -1,4 +1,4 @@
1
- import { WidgetConfig, AnalyzeRequest, AnalyzeResult, FinalizeRequest, IssueCreatedResult, ChatContext, ChatSessionOptions, ChatSessionResponse, ChatActionData } from './types';
1
+ import { WidgetConfig, AnalyzeRequest, AnalyzeResult, FinalizeRequest, IssueCreatedResult, ChatContext, ChatSessionOptions, ChatSessionResponse, ChatActionData, OpusClarifyStartRequest, OpusClarifyEventType } from './types';
2
2
  export declare class IssueAPIClient {
3
3
  private baseUrl;
4
4
  private apiKey;
@@ -11,4 +11,22 @@ export declare class IssueAPIClient {
11
11
  sendChatMessage(sessionId: string, message: string, context: ChatContext | undefined, onChunk: (content: string) => void, onAction: (action: ChatActionData) => void, onComplete: () => void, onError: (error: string) => void): Promise<void>;
12
12
  deleteChatSession(sessionId: string): Promise<void>;
13
13
  private parseChatSSEStream;
14
+ /**
15
+ * Start an Opus clarification session with SSE streaming.
16
+ * Returns session_id immediately, then streams events.
17
+ */
18
+ startOpusClarify(data: OpusClarifyStartRequest, onEvent: (eventType: OpusClarifyEventType, eventData: Record<string, unknown>) => void, onError: (error: string) => void): Promise<string | null>;
19
+ /**
20
+ * Send an answer to an Opus clarify session question.
21
+ * Continues the SSE stream with more events.
22
+ */
23
+ sendOpusClarifyAnswer(sessionId: string, questionId: number, answer: string, onEvent: (eventType: OpusClarifyEventType, eventData: Record<string, unknown>) => void, onError: (error: string) => void): Promise<void>;
24
+ /**
25
+ * Delete an Opus clarify session.
26
+ */
27
+ deleteOpusClarifySession(sessionId: string): Promise<void>;
28
+ /**
29
+ * Parse Opus clarify SSE stream.
30
+ */
31
+ private parseOpusClarifySSE;
14
32
  }
@@ -108,3 +108,32 @@ export interface ChatActionData {
108
108
  type: 'bug' | 'suggestion';
109
109
  };
110
110
  }
111
+ export interface OpusClarifyStartRequest {
112
+ title: string;
113
+ description: string;
114
+ record_type: 'issue' | 'feature';
115
+ repository_id: string;
116
+ requester_email?: string;
117
+ screenshot_urls?: string[];
118
+ gemini_insights?: string;
119
+ website_link?: string;
120
+ figma_link?: string;
121
+ }
122
+ export type OpusClarifyQuestionType = 'open' | 'choice';
123
+ export interface OpusClarifyQuestion {
124
+ id: number;
125
+ question: string;
126
+ context?: string;
127
+ type?: OpusClarifyQuestionType;
128
+ options?: string[];
129
+ }
130
+ export interface OpusClarifySessionResponse {
131
+ session_id: string;
132
+ status: string;
133
+ questions: OpusClarifyQuestion[];
134
+ }
135
+ export type OpusClarifyEventType = 'session_started' | 'thinking' | 'streaming' | 'exploring' | 'question' | 'questions' | 'waiting_answer' | 'phase_change' | 'tool_use' | 'done' | 'error';
136
+ export interface OpusClarifyEvent {
137
+ event: OpusClarifyEventType;
138
+ data: Record<string, unknown>;
139
+ }