@browserless.io/mcp 1.6.1 → 1.6.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.
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@browserless.io/mcp",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "MCP (Model Context Protocol) server for the Browserless.io browser automation platform",
5
5
  "author": "browserless.io",
6
6
  "license": "SSPL-1.0",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/browserless/browserless-mcp.git"
10
+ },
7
11
  "type": "module",
8
12
  "main": "./build/src/index.js",
9
13
  "types": "./build/src/index.d.ts",
@@ -1,23 +0,0 @@
1
- export interface AmplitudeEvent {
2
- event_type: string;
3
- time: number;
4
- session_id?: number;
5
- event_properties: Record<string, unknown> & {
6
- token: string;
7
- };
8
- }
9
- /**
10
- * Simple djb2 hash — matches the enterprise repo's session ID hashing.
11
- */
12
- export declare function djb2(str: string): number;
13
- export declare class AmplitudeHelper {
14
- private sqsClient?;
15
- private queueUrl?;
16
- private initialized;
17
- private enabled;
18
- constructor(enabled: boolean, queueUrl?: string, region?: string);
19
- initialize(queueUrl: string, region: string): void;
20
- send(eventName: string, sessionId: number, properties: Record<string, unknown> & {
21
- token: string;
22
- }): Promise<boolean>;
23
- }
@@ -1,72 +0,0 @@
1
- import { SQSClient, SendMessageBatchCommand, } from '@aws-sdk/client-sqs';
2
- import { randomUUID } from 'node:crypto';
3
- /**
4
- * Simple djb2 hash — matches the enterprise repo's session ID hashing.
5
- */
6
- export function djb2(str) {
7
- let hash = 5381;
8
- for (let i = 0; i < str.length; i++) {
9
- hash = (hash * 33) ^ str.charCodeAt(i);
10
- }
11
- return hash >>> 0;
12
- }
13
- export class AmplitudeHelper {
14
- sqsClient;
15
- queueUrl;
16
- initialized = false;
17
- enabled;
18
- constructor(enabled, queueUrl, region) {
19
- this.enabled = enabled;
20
- if (!this.enabled) {
21
- return;
22
- }
23
- if (queueUrl && region) {
24
- this.initialize(queueUrl, region);
25
- }
26
- }
27
- initialize(queueUrl, region) {
28
- if (!this.enabled || this.initialized) {
29
- return;
30
- }
31
- this.queueUrl = queueUrl;
32
- this.sqsClient = new SQSClient({ region });
33
- this.initialized = true;
34
- }
35
- async send(eventName, sessionId, properties) {
36
- if (!this.enabled || !this.initialized || !this.sqsClient || !this.queueUrl) {
37
- return false;
38
- }
39
- const event = {
40
- event_type: eventName,
41
- session_id: sessionId,
42
- time: Date.now(),
43
- event_properties: properties,
44
- };
45
- const entry = {
46
- Id: randomUUID(),
47
- MessageBody: JSON.stringify(event),
48
- };
49
- let retries = 3;
50
- while (retries-- > 0) {
51
- try {
52
- const command = new SendMessageBatchCommand({
53
- QueueUrl: this.queueUrl,
54
- Entries: [entry],
55
- });
56
- const data = await this.sqsClient.send(command);
57
- if (data.Failed?.length) {
58
- if (retries === 0)
59
- return false;
60
- }
61
- else {
62
- return true;
63
- }
64
- }
65
- catch {
66
- if (retries === 0)
67
- return false;
68
- }
69
- }
70
- return false;
71
- }
72
- }