@10play/expo-air 0.6.0 → 0.7.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.
@@ -27,6 +27,7 @@ export interface StatusMessage {
27
27
  type: "status";
28
28
  status: "connected" | "processing" | "idle";
29
29
  promptId?: string;
30
+ branchName?: string;
30
31
  timestamp: number;
31
32
  }
32
33
 
@@ -146,6 +147,36 @@ export interface GitChange {
146
147
  status: "added" | "modified" | "deleted" | "renamed" | "untracked";
147
148
  }
148
149
 
150
+ export interface BranchInfo {
151
+ name: string;
152
+ isCurrent: boolean;
153
+ prNumber?: string;
154
+ prTitle?: string;
155
+ lastCommitDate?: string;
156
+ }
157
+
158
+ export interface BranchesListMessage {
159
+ type: "branches_list";
160
+ branches: BranchInfo[];
161
+ timestamp: number;
162
+ }
163
+
164
+ export interface BranchSwitchedMessage {
165
+ type: "branch_switched";
166
+ branchName: string;
167
+ success: boolean;
168
+ error?: string;
169
+ timestamp: number;
170
+ }
171
+
172
+ export interface BranchCreatedMessage {
173
+ type: "branch_created";
174
+ branchName: string;
175
+ success: boolean;
176
+ error?: string;
177
+ timestamp: number;
178
+ }
179
+
149
180
  export interface GitStatusMessage {
150
181
  type: "git_status";
151
182
  branchName: string;
@@ -168,7 +199,10 @@ export type ServerMessage =
168
199
  | HistoryResultMessage
169
200
  | SystemDisplayMessage
170
201
  | GitStatusMessage
171
- | AssistantPartsMessage;
202
+ | AssistantPartsMessage
203
+ | BranchesListMessage
204
+ | BranchSwitchedMessage
205
+ | BranchCreatedMessage;
172
206
 
173
207
  export interface WebSocketClientOptions {
174
208
  url: string;
@@ -358,6 +392,32 @@ export class WebSocketClient {
358
392
  this.ws.send(JSON.stringify({ type: "register_push_token", token }));
359
393
  }
360
394
 
395
+ requestBranches(): void {
396
+ if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
397
+ return;
398
+ }
399
+
400
+ this.ws.send(JSON.stringify({ type: "list_branches" }));
401
+ }
402
+
403
+ requestSwitchBranch(branchName: string): void {
404
+ if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
405
+ this.options.onError(new Error("Not connected"));
406
+ return;
407
+ }
408
+
409
+ this.ws.send(JSON.stringify({ type: "switch_branch", branchName }));
410
+ }
411
+
412
+ requestCreateBranch(branchName: string): void {
413
+ if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
414
+ this.options.onError(new Error("Not connected"));
415
+ return;
416
+ }
417
+
418
+ this.ws.send(JSON.stringify({ type: "create_branch", branchName }));
419
+ }
420
+
361
421
  isConnected(): boolean {
362
422
  return this.ws?.readyState === WebSocket.OPEN;
363
423
  }