@shawnowen/comet-mcp 2.3.1 → 2.4.2

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 (65) hide show
  1. package/README.md +97 -19
  2. package/dist/alert-dispatcher.d.ts +23 -0
  3. package/dist/alert-dispatcher.js +101 -0
  4. package/dist/binding-reaper.d.ts +46 -0
  5. package/dist/binding-reaper.js +73 -0
  6. package/dist/bound-session.d.ts +23 -0
  7. package/dist/bound-session.js +119 -0
  8. package/dist/bridge-config.d.ts +6 -0
  9. package/dist/bridge-config.js +78 -0
  10. package/dist/cdp-client.d.ts +40 -4
  11. package/dist/cdp-client.js +502 -155
  12. package/dist/comet-ai.d.ts +15 -0
  13. package/dist/comet-ai.js +114 -38
  14. package/dist/delegate-binding.d.ts +19 -0
  15. package/dist/delegate-binding.js +73 -0
  16. package/dist/http-server.js +2188 -47
  17. package/dist/index.js +3545 -788
  18. package/dist/observer.d.ts +47 -0
  19. package/dist/observer.js +516 -0
  20. package/dist/project-config.d.ts +46 -0
  21. package/dist/project-config.js +166 -0
  22. package/dist/session-registry.d.ts +57 -0
  23. package/dist/session-registry.js +500 -0
  24. package/dist/sidecar-artifacts.d.ts +49 -0
  25. package/dist/sidecar-artifacts.js +146 -0
  26. package/dist/snapshot-capture.d.ts +3 -0
  27. package/dist/snapshot-capture.js +91 -0
  28. package/dist/tab-group-archive.js +3 -1
  29. package/dist/tab-groups.d.ts +28 -1
  30. package/dist/tab-groups.js +205 -3
  31. package/dist/types.d.ts +237 -0
  32. package/dist/window-bindings.d.ts +160 -0
  33. package/dist/window-bindings.js +561 -0
  34. package/extension/background.js +1577 -300
  35. package/extension/icons/icon.svg +9 -0
  36. package/extension/icons/icon128.png +0 -0
  37. package/extension/icons/icon16.png +0 -0
  38. package/extension/icons/icon48.png +0 -0
  39. package/extension/manifest.json +34 -4
  40. package/extension/perplexity-capability-manifest.json +1181 -0
  41. package/extension/perplexity-capability-manifest.schema.json +142 -0
  42. package/extension/session-logic.js +3054 -0
  43. package/extension/session-manager.html +311 -0
  44. package/extension/sidepanel.css +5338 -528
  45. package/extension/sidepanel.html +282 -2
  46. package/extension/sidepanel.js +10604 -950
  47. package/extension/window-policy.js +162 -0
  48. package/package.json +10 -7
  49. package/vendor/lifecycle-mcp-adapter.mjs +103 -0
  50. package/vendor/lifecycle-metadata.mjs +252 -0
  51. package/vendor/readiness-report.mjs +742 -0
  52. package/dist/cdp-client.d.ts.map +0 -1
  53. package/dist/cdp-client.js.map +0 -1
  54. package/dist/comet-ai.d.ts.map +0 -1
  55. package/dist/comet-ai.js.map +0 -1
  56. package/dist/http-server.d.ts.map +0 -1
  57. package/dist/http-server.js.map +0 -1
  58. package/dist/index.d.ts.map +0 -1
  59. package/dist/index.js.map +0 -1
  60. package/dist/tab-group-archive.d.ts.map +0 -1
  61. package/dist/tab-group-archive.js.map +0 -1
  62. package/dist/tab-groups.d.ts.map +0 -1
  63. package/dist/tab-groups.js.map +0 -1
  64. package/dist/types.d.ts.map +0 -1
  65. package/dist/types.js.map +0 -1
@@ -1,3 +1,4 @@
1
+ import CDP from "chrome-remote-interface";
1
2
  import type { CDPTarget, CDPVersion, NavigateResult, ScreenshotResult, EvaluateResult, CometState, NetworkIdleResult } from "./types.js";
2
3
  export declare class CometCDPClient {
3
4
  private client;
@@ -8,6 +9,12 @@ export declare class CometCDPClient {
8
9
  private maxReconnectAttempts;
9
10
  private isReconnecting;
10
11
  get isConnected(): boolean;
12
+ /**
13
+ * Access the raw CDP protocol client for direct domain calls
14
+ * (e.g., Page.printToPDF, Network.enable, Input.dispatchKeyEvent).
15
+ * Throws if not connected — always check isConnected or call connect() first.
16
+ */
17
+ get protocol(): CDP.Client;
11
18
  /**
12
19
  * Health check - verify connection is actually alive (not just "connected" in state)
13
20
  * This catches cases where WebSocket died silently
@@ -41,15 +48,26 @@ export declare class CometCDPClient {
41
48
  * Check if Comet process is running
42
49
  */
43
50
  private isCometProcessRunning;
44
- /**
45
- * Kill any running Comet process
46
- */
47
- private killComet;
51
+ private readCrashHistory;
52
+ private writeCrashHistory;
53
+ recordCrash(): void;
54
+ checkCrashLoopCap(): {
55
+ blocked: boolean;
56
+ count: number;
57
+ windowMinutes: number;
58
+ };
48
59
  /**
49
60
  * Start Comet browser with remote debugging enabled
50
61
  * Handles macOS, Windows, and WSL environments
51
62
  */
52
63
  startComet(port?: number): Promise<string>;
64
+ /**
65
+ * Position the Comet browser window on the top display using full-screen bounds.
66
+ * Top display staging bounds: origin (0, -1440), size 2560x1440.
67
+ * Keep the native window state normal so browser tabs and toolbar remain visible.
68
+ * Uses CDP Browser.getWindowForTarget + Browser.setWindowBounds.
69
+ */
70
+ positionOnTopDisplay(targetId?: string): Promise<void>;
53
71
  /**
54
72
  * Get CDP version info
55
73
  */
@@ -58,6 +76,9 @@ export declare class CometCDPClient {
58
76
  * List all available tabs/targets
59
77
  */
60
78
  listTargets(): Promise<CDPTarget[]>;
79
+ waitForTargetUrl(url: string, timeoutMs?: number): Promise<CDPTarget>;
80
+ private getWindowIdForTarget;
81
+ private findSidecarTargetForWindow;
61
82
  /**
62
83
  * Connect to a specific tab
63
84
  */
@@ -89,6 +110,21 @@ export declare class CometCDPClient {
89
110
  * Press a key
90
111
  */
91
112
  pressKey(key: string): Promise<void>;
113
+ /**
114
+ * Return the existing Perplexity sidecar CDP target without activating Comet
115
+ * or sending OS-level keyboard shortcuts.
116
+ */
117
+ ensureSidecarOpen(options?: {
118
+ windowId?: number;
119
+ targetId?: string;
120
+ }): Promise<CDPTarget | null>;
121
+ /**
122
+ * Connect a separate CDP client to the sidecar target for isolated interaction.
123
+ */
124
+ connectToSidecar(options?: {
125
+ windowId?: number;
126
+ targetId?: string;
127
+ }): Promise<CometCDPClient | null>;
92
128
  /**
93
129
  * Create a new tab
94
130
  */