@linkegringo/mcp 1.0.4 → 1.0.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/dist/index.d.ts +152 -82
  3. package/dist/index.js +583 -367
  4. package/package.json +10 -10
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Muriel Gasparini
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.d.ts CHANGED
@@ -1,72 +1,11 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import http from 'node:http';
3
+ import { EventEmitter } from 'node:events';
2
4
  import { z } from 'zod';
3
5
  import { Experience } from '@linkegringo/core';
4
6
 
5
7
  declare function createLinkeGringoMcpServer(): McpServer;
6
8
 
7
- interface ChromeVersionResponse {
8
- Browser: string;
9
- 'Protocol-Version': string;
10
- 'User-Agent': string;
11
- 'V8-Version': string;
12
- 'WebKit-Version': string;
13
- webSocketDebuggerUrl?: string;
14
- }
15
- interface ChromeTabInfo {
16
- id: string;
17
- title: string;
18
- type: string;
19
- url: string;
20
- description?: string;
21
- webSocketDebuggerUrl?: string;
22
- devtoolsFrontendUrl?: string;
23
- }
24
- interface LinkeGringoTabInfo {
25
- id: string;
26
- title: string;
27
- url: string;
28
- webSocketDebuggerUrl?: string;
29
- }
30
- interface LinkeGringoSessionState {
31
- hasUploadedProfile: boolean;
32
- candidateName?: string;
33
- targetRole?: string;
34
- step?: string;
35
- inboundScore?: number;
36
- profile?: any;
37
- review?: any;
38
- }
39
- interface CdpStatus {
40
- isRunning: boolean;
41
- port: number;
42
- host: string;
43
- browser?: string;
44
- protocolVersion?: string;
45
- /**
46
- * Abas ativas restritas estritamente ao escopo do LinkeGringo (Privacy Shield).
47
- * Abas pessoais (e-mails, mensageiros, bancos) são completamente omitidas.
48
- */
49
- activeTabs: LinkeGringoTabInfo[];
50
- linkeGringoTabs: LinkeGringoTabInfo[];
51
- otherTabsCount: number;
52
- linkeGringoTabFound: boolean;
53
- linkeGringoTabUrl?: string;
54
- sessionState?: LinkeGringoSessionState | null;
55
- error?: string;
56
- }
57
-
58
- declare function isLinkeGringoUrl(url?: string): boolean;
59
- declare function findDevToolsActivePort(): {
60
- port: number;
61
- wsPath: string;
62
- } | null;
63
- declare function probeViaWebSocket(port: number, wsPath: string, timeoutMs?: number): Promise<{
64
- linkeGringoTabs: LinkeGringoTabInfo[];
65
- otherTabsCount: number;
66
- sessionState: LinkeGringoSessionState | null;
67
- } | null>;
68
- declare function checkChromeCdp(port?: number, host?: string, timeoutMs?: number): Promise<CdpStatus>;
69
-
70
9
  interface McpTarget {
71
10
  id: string;
72
11
  client: string;
@@ -92,6 +31,63 @@ declare function installMcpServerConfig(configPath: string): {
92
31
  declare function parseArgs(args?: string[]): InstallerOptions;
93
32
  declare function runInstaller(args?: string[]): InstallResult[];
94
33
 
34
+ type JobType = 'parse_and_diagnose' | 'generate_interview' | 'evaluate_progress' | 'generate_rewritten_profile' | 'chat_message';
35
+ type JobStatus = 'pending' | 'processing' | 'completed' | 'failed';
36
+ interface BridgeJob<TPayload = any, TResult = any> {
37
+ id: string;
38
+ type: JobType;
39
+ payload: TPayload;
40
+ status: JobStatus;
41
+ createdAt: number;
42
+ updatedAt: number;
43
+ result?: TResult;
44
+ error?: string;
45
+ }
46
+ interface BridgeServerOptions {
47
+ port?: number;
48
+ host?: string;
49
+ onJobCreated?: (job: BridgeJob) => void;
50
+ }
51
+
52
+ declare function createBridgeHttpServer(options?: BridgeServerOptions): http.Server;
53
+ declare function startBridgeServer(options?: BridgeServerOptions): Promise<{
54
+ server: http.Server;
55
+ port: number;
56
+ close: () => Promise<void>;
57
+ }>;
58
+ declare function stopBridgeServer(): Promise<void>;
59
+
60
+ /**
61
+ * Busca o próximo job pendente no Bridge HTTP local (porta 5174).
62
+ * Se o bridge HTTP estiver offline ou inacessível, realiza fallback para o bridgeJobStore em memória.
63
+ */
64
+ declare function getRemoteOrLocalPendingJob(jobId?: string, bridgeUrl?: string): Promise<BridgeJob | undefined>;
65
+ /**
66
+ * Conclui um job enviando o resultado estruturado para o Bridge HTTP local.
67
+ * Se o bridge HTTP estiver offline, conclui diretamente na store em memória.
68
+ */
69
+ declare function completeRemoteOrLocalJob(jobId: string, result: any, bridgeUrl?: string): Promise<BridgeJob>;
70
+ /**
71
+ * Marca um job com falha no Bridge HTTP local ou na store em memória.
72
+ */
73
+ declare function failRemoteOrLocalJob(jobId: string, error: string, bridgeUrl?: string): Promise<BridgeJob>;
74
+
75
+ declare class BridgeJobStore extends EventEmitter {
76
+ private jobs;
77
+ private pendingQueue;
78
+ createJob<TPayload = any>(type: JobType, payload: TPayload): BridgeJob<TPayload>;
79
+ getJob(id: string): BridgeJob | undefined;
80
+ getPendingJob(id?: string): BridgeJob | undefined;
81
+ markProcessing(id: string): BridgeJob | undefined;
82
+ completeJob<TResult = any>(id: string, result: TResult): BridgeJob;
83
+ failJob(id: string, error: string): BridgeJob;
84
+ waitForJob(id: string, timeoutMs?: number): Promise<BridgeJob>;
85
+ getAllJobs(): BridgeJob[];
86
+ getPendingCount(): number;
87
+ clear(): void;
88
+ }
89
+ declare const bridgeJobStore: BridgeJobStore;
90
+
95
91
  interface SparseExperience {
96
92
  company: string;
97
93
  title: string;
@@ -166,9 +162,11 @@ declare function handleAuditProfile(input: AuditProfileInput): Promise<{
166
162
  }[];
167
163
  structuredData: {
168
164
  status: string;
169
- linkeGringoTabUrl: string | undefined;
170
- message: string;
165
+ jobId: string;
166
+ jobType: JobType;
167
+ payload: any;
171
168
  actionRequired: string;
169
+ message?: undefined;
172
170
  score?: undefined;
173
171
  targetRole?: undefined;
174
172
  headline?: undefined;
@@ -187,7 +185,9 @@ declare function handleAuditProfile(input: AuditProfileInput): Promise<{
187
185
  status: string;
188
186
  message: string;
189
187
  actionRequired: string;
190
- linkeGringoTabUrl?: undefined;
188
+ jobId?: undefined;
189
+ jobType?: undefined;
190
+ payload?: undefined;
191
191
  score?: undefined;
192
192
  targetRole?: undefined;
193
193
  headline?: undefined;
@@ -212,9 +212,11 @@ declare function handleAuditProfile(input: AuditProfileInput): Promise<{
212
212
  triageBottlenecks: string[];
213
213
  issues: AuditIssue[];
214
214
  status?: undefined;
215
- linkeGringoTabUrl?: undefined;
216
- message?: undefined;
215
+ jobId?: undefined;
216
+ jobType?: undefined;
217
+ payload?: undefined;
217
218
  actionRequired?: undefined;
219
+ message?: undefined;
218
220
  };
219
221
  }>;
220
222
 
@@ -347,26 +349,94 @@ declare function handleGenerateHeadline(input: GenerateHeadlineInput): Promise<{
347
349
  };
348
350
  }>;
349
351
 
350
- declare const checkChromeCdpInputSchema: z.ZodObject<{
351
- port: z.ZodDefault<z.ZodNumber>;
352
- host: z.ZodDefault<z.ZodString>;
353
- timeoutMs: z.ZodDefault<z.ZodNumber>;
352
+ declare const getPendingJobInputSchema: z.ZodObject<{
353
+ jobId: z.ZodOptional<z.ZodString>;
354
354
  }, "strip", z.ZodTypeAny, {
355
- port: number;
356
- host: string;
357
- timeoutMs: number;
355
+ jobId?: string | undefined;
358
356
  }, {
359
- port?: number | undefined;
360
- host?: string | undefined;
361
- timeoutMs?: number | undefined;
357
+ jobId?: string | undefined;
362
358
  }>;
363
- type CheckChromeCdpInput = z.infer<typeof checkChromeCdpInputSchema>;
364
- declare function handleCheckChromeCdp(input: CheckChromeCdpInput): Promise<{
359
+ type GetPendingJobInput = z.infer<typeof getPendingJobInputSchema>;
360
+ declare function handleGetPendingJob(input?: GetPendingJobInput): Promise<{
365
361
  content: {
366
362
  type: "text";
367
363
  text: string;
368
364
  }[];
369
- structuredData: CdpStatus;
365
+ structuredData: {
366
+ jobFound: boolean;
367
+ pendingCount: number;
368
+ job?: undefined;
369
+ };
370
+ } | {
371
+ content: {
372
+ type: "text";
373
+ text: string;
374
+ }[];
375
+ structuredData: {
376
+ jobFound: boolean;
377
+ job: {
378
+ id: string;
379
+ type: JobType;
380
+ payload: any;
381
+ createdAt: number;
382
+ };
383
+ pendingCount?: undefined;
384
+ };
385
+ }>;
386
+
387
+ declare const submitJobResultInputSchema: z.ZodObject<{
388
+ jobId: z.ZodString;
389
+ result: z.ZodAny;
390
+ status: z.ZodDefault<z.ZodEnum<["completed", "failed"]>>;
391
+ error: z.ZodOptional<z.ZodString>;
392
+ }, "strip", z.ZodTypeAny, {
393
+ status: "completed" | "failed";
394
+ jobId: string;
395
+ result?: any;
396
+ error?: string | undefined;
397
+ }, {
398
+ jobId: string;
399
+ result?: any;
400
+ error?: string | undefined;
401
+ status?: "completed" | "failed" | undefined;
402
+ }>;
403
+ type SubmitJobResultInput = z.infer<typeof submitJobResultInputSchema>;
404
+ declare function handleSubmitJobResult(input: SubmitJobResultInput): Promise<{
405
+ content: {
406
+ type: "text";
407
+ text: string;
408
+ }[];
409
+ structuredData: {
410
+ success: boolean;
411
+ jobId: string;
412
+ status: string;
413
+ type?: undefined;
414
+ error?: undefined;
415
+ };
416
+ } | {
417
+ content: {
418
+ type: "text";
419
+ text: string;
420
+ }[];
421
+ structuredData: {
422
+ success: boolean;
423
+ jobId: string;
424
+ status: string;
425
+ type: JobType;
426
+ error?: undefined;
427
+ };
428
+ } | {
429
+ content: {
430
+ type: "text";
431
+ text: string;
432
+ }[];
433
+ structuredData: {
434
+ success: boolean;
435
+ error: any;
436
+ jobId?: undefined;
437
+ status?: undefined;
438
+ type?: undefined;
439
+ };
370
440
  }>;
371
441
 
372
- export { type AuditIssue, type AuditProfileInput, type CdpStatus, type CheckChromeCdpInput, type ChromeTabInfo, type ChromeVersionResponse, type ConvertToXyzBulletInput, type GenerateHeadlineInput, type InstallResult, type InstallerOptions, type LinkeGringoSessionState, type LinkeGringoTabInfo, type McpTarget, type SimulateRecruiterSearchInput, type SparseExperience, auditProfileInputSchema, checkChromeCdp, checkChromeCdpInputSchema, convertToXyzBulletInputSchema, createLinkeGringoMcpServer, detectSparseExperiences, findDevToolsActivePort, formatGoogleXyzBullet, generateHeadlineInputSchema, getExperienceBulletCount, getMcpConfigsForSystem, handleAuditProfile, handleCheckChromeCdp, handleConvertToXyzBullet, handleGenerateHeadline, handleSimulateRecruiterSearch, installMcpServerConfig, isLinkeGringoUrl, parseArgs, probeViaWebSocket, runInstaller, simulateRecruiterSearchInputSchema };
442
+ export { type AuditIssue, type AuditProfileInput, type BridgeJob, type BridgeServerOptions, type ConvertToXyzBulletInput, type GenerateHeadlineInput, type GetPendingJobInput, type InstallResult, type InstallerOptions, type JobStatus, type JobType, type McpTarget, type SimulateRecruiterSearchInput, type SparseExperience, type SubmitJobResultInput, auditProfileInputSchema, bridgeJobStore, completeRemoteOrLocalJob, convertToXyzBulletInputSchema, createBridgeHttpServer, createLinkeGringoMcpServer, detectSparseExperiences, failRemoteOrLocalJob, formatGoogleXyzBullet, generateHeadlineInputSchema, getExperienceBulletCount, getMcpConfigsForSystem, getPendingJobInputSchema, getRemoteOrLocalPendingJob, handleAuditProfile, handleConvertToXyzBullet, handleGenerateHeadline, handleGetPendingJob, handleSimulateRecruiterSearch, handleSubmitJobResult, installMcpServerConfig, parseArgs, runInstaller, simulateRecruiterSearchInputSchema, startBridgeServer, stopBridgeServer, submitJobResultInputSchema };