@ccpocket/bridge 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 (77) hide show
  1. package/README.md +54 -0
  2. package/dist/claude-process.d.ts +108 -0
  3. package/dist/claude-process.js +471 -0
  4. package/dist/claude-process.js.map +1 -0
  5. package/dist/cli.d.ts +2 -0
  6. package/dist/cli.js +42 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/codex-process.d.ts +46 -0
  9. package/dist/codex-process.js +420 -0
  10. package/dist/codex-process.js.map +1 -0
  11. package/dist/debug-trace-store.d.ts +15 -0
  12. package/dist/debug-trace-store.js +78 -0
  13. package/dist/debug-trace-store.js.map +1 -0
  14. package/dist/firebase-auth.d.ts +35 -0
  15. package/dist/firebase-auth.js +132 -0
  16. package/dist/firebase-auth.js.map +1 -0
  17. package/dist/gallery-store.d.ts +66 -0
  18. package/dist/gallery-store.js +310 -0
  19. package/dist/gallery-store.js.map +1 -0
  20. package/dist/image-store.d.ts +22 -0
  21. package/dist/image-store.js +113 -0
  22. package/dist/image-store.js.map +1 -0
  23. package/dist/index.d.ts +1 -0
  24. package/dist/index.js +153 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/mdns.d.ts +6 -0
  27. package/dist/mdns.js +42 -0
  28. package/dist/mdns.js.map +1 -0
  29. package/dist/parser.d.ts +381 -0
  30. package/dist/parser.js +218 -0
  31. package/dist/parser.js.map +1 -0
  32. package/dist/project-history.d.ts +10 -0
  33. package/dist/project-history.js +73 -0
  34. package/dist/project-history.js.map +1 -0
  35. package/dist/prompt-history-backup.d.ts +15 -0
  36. package/dist/prompt-history-backup.js +46 -0
  37. package/dist/prompt-history-backup.js.map +1 -0
  38. package/dist/push-relay.d.ts +27 -0
  39. package/dist/push-relay.js +69 -0
  40. package/dist/push-relay.js.map +1 -0
  41. package/dist/recording-store.d.ts +51 -0
  42. package/dist/recording-store.js +158 -0
  43. package/dist/recording-store.js.map +1 -0
  44. package/dist/screenshot.d.ts +28 -0
  45. package/dist/screenshot.js +98 -0
  46. package/dist/screenshot.js.map +1 -0
  47. package/dist/sdk-process.d.ts +151 -0
  48. package/dist/sdk-process.js +740 -0
  49. package/dist/sdk-process.js.map +1 -0
  50. package/dist/session.d.ts +126 -0
  51. package/dist/session.js +550 -0
  52. package/dist/session.js.map +1 -0
  53. package/dist/sessions-index.d.ts +86 -0
  54. package/dist/sessions-index.js +1027 -0
  55. package/dist/sessions-index.js.map +1 -0
  56. package/dist/setup-launchd.d.ts +8 -0
  57. package/dist/setup-launchd.js +109 -0
  58. package/dist/setup-launchd.js.map +1 -0
  59. package/dist/startup-info.d.ts +8 -0
  60. package/dist/startup-info.js +78 -0
  61. package/dist/startup-info.js.map +1 -0
  62. package/dist/usage.d.ts +17 -0
  63. package/dist/usage.js +236 -0
  64. package/dist/usage.js.map +1 -0
  65. package/dist/version.d.ts +11 -0
  66. package/dist/version.js +39 -0
  67. package/dist/version.js.map +1 -0
  68. package/dist/websocket.d.ts +71 -0
  69. package/dist/websocket.js +1487 -0
  70. package/dist/websocket.js.map +1 -0
  71. package/dist/worktree-store.d.ts +25 -0
  72. package/dist/worktree-store.js +59 -0
  73. package/dist/worktree-store.js.map +1 -0
  74. package/dist/worktree.d.ts +43 -0
  75. package/dist/worktree.js +295 -0
  76. package/dist/worktree.js.map +1 -0
  77. package/package.json +63 -0
@@ -0,0 +1,71 @@
1
+ import type { Server as HttpServer } from "node:http";
2
+ import type { ImageStore } from "./image-store.js";
3
+ import type { GalleryStore } from "./gallery-store.js";
4
+ import type { ProjectHistory } from "./project-history.js";
5
+ import { DebugTraceStore } from "./debug-trace-store.js";
6
+ import { RecordingStore } from "./recording-store.js";
7
+ import type { FirebaseAuthClient } from "./firebase-auth.js";
8
+ import type { PromptHistoryBackupStore } from "./prompt-history-backup.js";
9
+ export interface BridgeServerOptions {
10
+ server: HttpServer;
11
+ apiKey?: string;
12
+ imageStore?: ImageStore;
13
+ galleryStore?: GalleryStore;
14
+ projectHistory?: ProjectHistory;
15
+ debugTraceStore?: DebugTraceStore;
16
+ recordingStore?: RecordingStore;
17
+ firebaseAuth?: FirebaseAuthClient;
18
+ promptHistoryBackup?: PromptHistoryBackupStore;
19
+ }
20
+ export declare class BridgeWebSocketServer {
21
+ private static readonly MAX_DEBUG_EVENTS;
22
+ private static readonly MAX_HISTORY_SUMMARY_ITEMS;
23
+ private wss;
24
+ private sessionManager;
25
+ private apiKey;
26
+ private imageStore;
27
+ private galleryStore;
28
+ private projectHistory;
29
+ private debugTraceStore;
30
+ private recordingStore;
31
+ private worktreeStore;
32
+ private pushRelay;
33
+ private promptHistoryBackup;
34
+ private recentSessionsRequestId;
35
+ private debugEvents;
36
+ private notifiedPermissionToolUses;
37
+ constructor(options: BridgeServerOptions);
38
+ close(): void;
39
+ /** Return session count for /health endpoint. */
40
+ get sessionCount(): number;
41
+ /** Return connected WebSocket client count. */
42
+ get clientCount(): number;
43
+ private handleConnection;
44
+ private handleClientMessage;
45
+ private resolveSession;
46
+ private getFirstSession;
47
+ private sendSessionList;
48
+ /** Broadcast session list to all connected clients. */
49
+ private broadcastSessionList;
50
+ private broadcastSessionMessage;
51
+ /** Extract a short project label from the full projectPath (last directory name). */
52
+ private projectLabel;
53
+ private maybeSendPushNotification;
54
+ private broadcast;
55
+ private send;
56
+ /** Broadcast a gallery_new_image message to all connected clients. */
57
+ broadcastGalleryNewImage(image: import("./gallery-store.js").GalleryImageInfo): void;
58
+ private collectGitDiff;
59
+ private extractSessionIdFromClientMessage;
60
+ private extractSessionIdFromServerMessage;
61
+ private recordDebugEvent;
62
+ private getDebugEvents;
63
+ private buildHistorySummary;
64
+ private summarizeClientMessage;
65
+ private summarizeServerMessage;
66
+ private summarizeOutboundMessage;
67
+ private pruneDebugEvents;
68
+ private buildReproRecipe;
69
+ private buildResumeSessionMessage;
70
+ private buildAgentPrompt;
71
+ }