@skillhq/concierge 1.6.0 → 1.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.
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +2 -0
- package/dist/cli/program.js.map +1 -1
- package/dist/commands/flightqueue.d.ts +4 -0
- package/dist/commands/flightqueue.d.ts.map +1 -0
- package/dist/commands/flightqueue.js +100 -0
- package/dist/commands/flightqueue.js.map +1 -0
- package/dist/lib/flightqueue-client.d.ts +38 -0
- package/dist/lib/flightqueue-client.d.ts.map +1 -0
- package/dist/lib/flightqueue-client.js +346 -0
- package/dist/lib/flightqueue-client.js.map +1 -0
- package/dist/lib/flightqueue-types.d.ts +42 -0
- package/dist/lib/flightqueue-types.d.ts.map +1 -0
- package/dist/lib/flightqueue-types.js +2 -0
- package/dist/lib/flightqueue-types.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2BpC,wBAAgB,aAAa,IAAI,OAAO,CA+BvC"}
|
package/dist/cli/program.js
CHANGED
|
@@ -5,6 +5,7 @@ import { callCommand } from '../commands/call.js';
|
|
|
5
5
|
import { checkAvailabilityCommand } from '../commands/check-availability.js';
|
|
6
6
|
import { configCommand } from '../commands/config.js';
|
|
7
7
|
import { findContactCommand } from '../commands/find-contact.js';
|
|
8
|
+
import { flightqueueCommand } from '../commands/flightqueue.js';
|
|
8
9
|
import { searchCommand } from '../commands/search.js';
|
|
9
10
|
import { serverCommand } from '../commands/server.js';
|
|
10
11
|
const require = createRequire(import.meta.url);
|
|
@@ -40,6 +41,7 @@ export function createProgram() {
|
|
|
40
41
|
};
|
|
41
42
|
// Register commands
|
|
42
43
|
findContactCommand(program, getContext);
|
|
44
|
+
flightqueueCommand(program, getContext);
|
|
43
45
|
configCommand(program, getContext);
|
|
44
46
|
serverCommand(program, getContext);
|
|
45
47
|
callCommand(program, getContext);
|
package/dist/cli/program.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"program.js","sourceRoot":"","sources":["../../src/cli/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAwB,CAAC;AAEjE,SAAS,YAAY;IACnB,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,IAAI;QACnB,SAAS,EAAE,KAAK,CAAC,OAAO;QACxB,OAAO,EAAE,KAAK,CAAC,KAAK;QACpB,KAAK,EAAE,KAAK,CAAC,GAAG;QAChB,OAAO,EAAE,KAAK,CAAC,MAAM;QACrB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE,KAAK,CAAC,IAAI;QACjB,SAAS,EAAE,KAAK,CAAC,IAAI;KACtB,CAAC;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EAAE;YACtB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,KAAK;YACxB,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,KAAK;SAC/B,CAAC;IACJ,CAAC,CAAC;IAEF,oBAAoB;IACpB,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACxC,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACxC,aAAa,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACnC,aAAa,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACnC,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACjC,aAAa,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IACnC,wBAAwB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAE9C,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flightqueue.d.ts","sourceRoot":"","sources":["../../src/commands/flightqueue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAqGnD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,GAAG,IAAI,CAwBvF"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { FlightQueueClient } from '../lib/flightqueue-client.js';
|
|
2
|
+
import { formatError, formatVerbose } from '../lib/output.js';
|
|
3
|
+
function formatWaitTimeLevel(level) {
|
|
4
|
+
switch (level) {
|
|
5
|
+
case 'fast':
|
|
6
|
+
return 'Fast';
|
|
7
|
+
case 'moderate':
|
|
8
|
+
return 'Moderate';
|
|
9
|
+
case 'busy':
|
|
10
|
+
return 'Busy';
|
|
11
|
+
case 'very_busy':
|
|
12
|
+
return 'Very Busy';
|
|
13
|
+
default:
|
|
14
|
+
return 'Unknown';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function formatFlightQueueData(data, ctx) {
|
|
18
|
+
if (ctx.json) {
|
|
19
|
+
return JSON.stringify(data, null, 2);
|
|
20
|
+
}
|
|
21
|
+
const { colors } = ctx;
|
|
22
|
+
const lines = [];
|
|
23
|
+
// Header
|
|
24
|
+
lines.push('');
|
|
25
|
+
lines.push(colors.highlight('═══════════════════════════════════════════════════════════'));
|
|
26
|
+
lines.push(colors.highlight(` AIRPORT WAIT TIMES: ${data.airport.code}`));
|
|
27
|
+
lines.push(colors.highlight('═══════════════════════════════════════════════════════════'));
|
|
28
|
+
lines.push('');
|
|
29
|
+
// Airport Info
|
|
30
|
+
lines.push(colors.primary('▸ Airport Information'));
|
|
31
|
+
lines.push(` ${colors.muted('Code:')} ${data.airport.code}`);
|
|
32
|
+
lines.push(` ${colors.muted('Name:')} ${data.airport.name}`);
|
|
33
|
+
if (data.airport.city) {
|
|
34
|
+
lines.push(` ${colors.muted('City:')} ${data.airport.city}`);
|
|
35
|
+
}
|
|
36
|
+
if (data.airport.country) {
|
|
37
|
+
lines.push(` ${colors.muted('Country:')} ${data.airport.country}`);
|
|
38
|
+
}
|
|
39
|
+
lines.push('');
|
|
40
|
+
// Wait Times
|
|
41
|
+
lines.push(colors.primary('▸ Current Wait Times'));
|
|
42
|
+
// Security
|
|
43
|
+
const securityColor = data.security.level === 'fast'
|
|
44
|
+
? colors.success
|
|
45
|
+
: data.security.level === 'moderate'
|
|
46
|
+
? colors.warning
|
|
47
|
+
: colors.error;
|
|
48
|
+
const securityTime = data.security.minutes ? `${data.security.minutes} min` : 'N/A';
|
|
49
|
+
lines.push(` ${colors.muted('Security:')} ${securityColor(formatWaitTimeLevel(data.security.level))} (${securityTime})`);
|
|
50
|
+
// Immigration
|
|
51
|
+
const immigrationColor = data.immigration.level === 'fast'
|
|
52
|
+
? colors.success
|
|
53
|
+
: data.immigration.level === 'moderate'
|
|
54
|
+
? colors.warning
|
|
55
|
+
: colors.error;
|
|
56
|
+
const immigrationTime = data.immigration.minutes ? `${data.immigration.minutes} min` : 'N/A';
|
|
57
|
+
lines.push(` ${colors.muted('Immigration:')} ${immigrationColor(formatWaitTimeLevel(data.immigration.level))} (${immigrationTime})`);
|
|
58
|
+
if (data.trafficScore !== null) {
|
|
59
|
+
lines.push(` ${colors.muted('Traffic Score:')} ${data.trafficScore}`);
|
|
60
|
+
}
|
|
61
|
+
lines.push('');
|
|
62
|
+
// Recommended Arrival
|
|
63
|
+
if (data.recommendedArrival.domestic || data.recommendedArrival.international) {
|
|
64
|
+
lines.push(colors.primary('▸ Recommended Arrival'));
|
|
65
|
+
if (data.recommendedArrival.domestic) {
|
|
66
|
+
lines.push(` ${colors.muted('Domestic:')} ${data.recommendedArrival.domestic} min before departure`);
|
|
67
|
+
}
|
|
68
|
+
if (data.recommendedArrival.international) {
|
|
69
|
+
lines.push(` ${colors.muted('International:')} ${data.recommendedArrival.international} min before departure`);
|
|
70
|
+
}
|
|
71
|
+
lines.push('');
|
|
72
|
+
}
|
|
73
|
+
// Footer
|
|
74
|
+
lines.push(colors.muted(`Source: ${data.url}`));
|
|
75
|
+
lines.push(colors.muted(`Fetched: ${data.fetchedAt}`));
|
|
76
|
+
lines.push('');
|
|
77
|
+
return lines.join('\n');
|
|
78
|
+
}
|
|
79
|
+
export function flightqueueCommand(program, getContext) {
|
|
80
|
+
program
|
|
81
|
+
.command('flightqueue')
|
|
82
|
+
.alias('fq')
|
|
83
|
+
.alias('queue')
|
|
84
|
+
.description('Get airport wait times from FlightQueue.com')
|
|
85
|
+
.argument('<airport>', 'Airport code (e.g., HKT) or city name (e.g., Phuket)')
|
|
86
|
+
.action(async (airport) => {
|
|
87
|
+
const ctx = getContext();
|
|
88
|
+
const client = new FlightQueueClient({ verbose: ctx.verbose });
|
|
89
|
+
const verboseMsg = formatVerbose(`Looking up wait times for: ${airport}`, ctx);
|
|
90
|
+
if (verboseMsg)
|
|
91
|
+
console.log(verboseMsg);
|
|
92
|
+
const result = await client.getWaitTimes(airport);
|
|
93
|
+
if (!result.success) {
|
|
94
|
+
console.log(formatError(result.error, ctx));
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
console.log(formatFlightQueueData(result.data, ctx));
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=flightqueue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flightqueue.js","sourceRoot":"","sources":["../../src/commands/flightqueue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE9D,SAAS,mBAAmB,CAAC,KAAa;IACxC,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB,KAAK,UAAU;YACb,OAAO,UAAU,CAAC;QACpB,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB,KAAK,WAAW;YACd,OAAO,WAAW,CAAC;QACrB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAqB,EAAE,GAAe;IACnE,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC;QACb,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IACvB,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,SAAS;IACT,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,6DAA6D,CAAC,CAAC,CAAC;IAC5F,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,yBAAyB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CA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,EAAE,CAAC;QAEzB,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QAE/D,MAAM,UAAU,GAAG,aAAa,CAAC,8BAA8B,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC;QAC/E,IAAI,UAAU;YAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAExC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAElD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { FlightQueueResult, FlightQueueSearchResponse } from './flightqueue-types.js';
|
|
2
|
+
export declare class FlightQueueClient {
|
|
3
|
+
private verbose;
|
|
4
|
+
private currentSession;
|
|
5
|
+
constructor(options?: {
|
|
6
|
+
verbose?: boolean;
|
|
7
|
+
});
|
|
8
|
+
private getNewSession;
|
|
9
|
+
/**
|
|
10
|
+
* Check if input looks like an airport code (3 uppercase letters)
|
|
11
|
+
*/
|
|
12
|
+
isAirportCode(input: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Get wait times for an airport by code or city name
|
|
15
|
+
*/
|
|
16
|
+
getWaitTimes(input: string): Promise<FlightQueueResult>;
|
|
17
|
+
/**
|
|
18
|
+
* Search for airports only (internal helper that closes browser)
|
|
19
|
+
*/
|
|
20
|
+
private searchAirportsOnly;
|
|
21
|
+
/**
|
|
22
|
+
* Search for airports by city/name
|
|
23
|
+
*/
|
|
24
|
+
searchAirports(query: string): Promise<FlightQueueSearchResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Get wait times for a specific airport code
|
|
27
|
+
*/
|
|
28
|
+
private getAirportWaitTimes;
|
|
29
|
+
private runAgentBrowser;
|
|
30
|
+
private closeSession;
|
|
31
|
+
private parseSearchResults;
|
|
32
|
+
private parseAirportData;
|
|
33
|
+
private parseWaitTime;
|
|
34
|
+
private parseLevel;
|
|
35
|
+
private parseMinutes;
|
|
36
|
+
private minutesToLevel;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=flightqueue-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flightqueue-client.d.ts","sourceRoot":"","sources":["../../src/lib/flightqueue-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,iBAAiB,EACjB,yBAAyB,EAE1B,MAAM,wBAAwB,CAAC;AAOhC,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAU;IACzB,OAAO,CAAC,cAAc,CAAuB;gBAEjC,OAAO,GAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAO;IAI/C,OAAO,CAAC,aAAa;IAMrB;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIrC;;OAEG;IACG,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA2B7D;;OAEG;YACW,kBAAkB;IAiChC;;OAEG;IACG,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAgCvE;;OAEG;YACW,mBAAmB;IA8BjC,OAAO,CAAC,eAAe;IAiBvB,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,kBAAkB;IAqE1B,OAAO,CAAC,gBAAgB;IA4CxB,OAAO,CAAC,aAAa;IAuDrB,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,YAAY;IAqBpB,OAAO,CAAC,cAAc;CAMvB"}
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
const FLIGHTQUEUE_BASE_URL = 'https://flightqueue.com';
|
|
3
|
+
// Use a counter to generate unique session names
|
|
4
|
+
let sessionCounter = 0;
|
|
5
|
+
export class FlightQueueClient {
|
|
6
|
+
verbose;
|
|
7
|
+
currentSession = null;
|
|
8
|
+
constructor(options = {}) {
|
|
9
|
+
this.verbose = options.verbose ?? false;
|
|
10
|
+
}
|
|
11
|
+
getNewSession() {
|
|
12
|
+
sessionCounter++;
|
|
13
|
+
this.currentSession = `fq-${process.pid}-${sessionCounter}`;
|
|
14
|
+
return this.currentSession;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Check if input looks like an airport code (3 uppercase letters)
|
|
18
|
+
*/
|
|
19
|
+
isAirportCode(input) {
|
|
20
|
+
return /^[A-Z]{3}$/i.test(input.trim());
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get wait times for an airport by code or city name
|
|
24
|
+
*/
|
|
25
|
+
async getWaitTimes(input) {
|
|
26
|
+
const trimmed = input.trim();
|
|
27
|
+
if (this.isAirportCode(trimmed)) {
|
|
28
|
+
return this.getAirportWaitTimes(trimmed.toUpperCase());
|
|
29
|
+
}
|
|
30
|
+
// Search by city name first
|
|
31
|
+
const searchResult = await this.searchAirportsOnly(trimmed);
|
|
32
|
+
if (!searchResult.success) {
|
|
33
|
+
return { success: false, error: searchResult.error };
|
|
34
|
+
}
|
|
35
|
+
if (searchResult.data.airports.length === 0) {
|
|
36
|
+
return { success: false, error: `No airports found for "${trimmed}"` };
|
|
37
|
+
}
|
|
38
|
+
// Use the first result
|
|
39
|
+
const airport = searchResult.data.airports[0];
|
|
40
|
+
if (this.verbose) {
|
|
41
|
+
console.log(`Found airport: ${airport.code} - ${airport.name}`);
|
|
42
|
+
}
|
|
43
|
+
// Get wait times using fresh browser session
|
|
44
|
+
return this.getAirportWaitTimes(airport.code);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Search for airports only (internal helper that closes browser)
|
|
48
|
+
*/
|
|
49
|
+
async searchAirportsOnly(query) {
|
|
50
|
+
const url = `${FLIGHTQUEUE_BASE_URL}/search?q=${encodeURIComponent(query)}`;
|
|
51
|
+
const session = this.getNewSession();
|
|
52
|
+
try {
|
|
53
|
+
// Open the search page
|
|
54
|
+
this.runAgentBrowser(`open "${url}"`, session);
|
|
55
|
+
this.runAgentBrowser('wait 1500', session);
|
|
56
|
+
// Get snapshot
|
|
57
|
+
const snapshot = this.runAgentBrowser('snapshot', session);
|
|
58
|
+
// Parse search results from snapshot
|
|
59
|
+
const airports = this.parseSearchResults(snapshot);
|
|
60
|
+
// Close browser
|
|
61
|
+
this.closeSession();
|
|
62
|
+
return {
|
|
63
|
+
success: true,
|
|
64
|
+
data: { airports, query },
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
this.closeSession();
|
|
69
|
+
return {
|
|
70
|
+
success: false,
|
|
71
|
+
error: error instanceof Error ? error.message : 'Failed to search airports',
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Search for airports by city/name
|
|
77
|
+
*/
|
|
78
|
+
async searchAirports(query) {
|
|
79
|
+
const url = `${FLIGHTQUEUE_BASE_URL}/search?q=${encodeURIComponent(query)}`;
|
|
80
|
+
try {
|
|
81
|
+
// Open the search page
|
|
82
|
+
this.runAgentBrowser(`open "${url}"`);
|
|
83
|
+
// Wait a moment for page to fully render
|
|
84
|
+
this.runAgentBrowser('wait 1000');
|
|
85
|
+
// Get snapshot
|
|
86
|
+
const snapshot = this.runAgentBrowser('snapshot');
|
|
87
|
+
// Parse search results from snapshot
|
|
88
|
+
const airports = this.parseSearchResults(snapshot);
|
|
89
|
+
// Close browser
|
|
90
|
+
this.closeSession();
|
|
91
|
+
return {
|
|
92
|
+
success: true,
|
|
93
|
+
data: { airports, query },
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
this.closeSession();
|
|
98
|
+
return {
|
|
99
|
+
success: false,
|
|
100
|
+
error: error instanceof Error ? error.message : 'Failed to search airports',
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Get wait times for a specific airport code
|
|
106
|
+
*/
|
|
107
|
+
async getAirportWaitTimes(code) {
|
|
108
|
+
const url = `${FLIGHTQUEUE_BASE_URL}/airport/${code}`;
|
|
109
|
+
const session = this.getNewSession();
|
|
110
|
+
try {
|
|
111
|
+
// Open the airport page
|
|
112
|
+
this.runAgentBrowser(`open "${url}"`, session);
|
|
113
|
+
// Wait a moment for page to fully render
|
|
114
|
+
this.runAgentBrowser('wait 1500', session);
|
|
115
|
+
// Get snapshot
|
|
116
|
+
const snapshot = this.runAgentBrowser('snapshot', session);
|
|
117
|
+
// Parse the airport data
|
|
118
|
+
const data = this.parseAirportData(snapshot, code, url);
|
|
119
|
+
// Close browser
|
|
120
|
+
this.closeSession();
|
|
121
|
+
return { success: true, data };
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
this.closeSession();
|
|
125
|
+
return {
|
|
126
|
+
success: false,
|
|
127
|
+
error: error instanceof Error ? error.message : 'Failed to get wait times',
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
runAgentBrowser(command, session) {
|
|
132
|
+
const sessionName = session ?? this.currentSession ?? this.getNewSession();
|
|
133
|
+
try {
|
|
134
|
+
const result = execSync(`agent-browser --session ${sessionName} ${command}`, {
|
|
135
|
+
encoding: 'utf-8',
|
|
136
|
+
timeout: 60000,
|
|
137
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
138
|
+
});
|
|
139
|
+
return result;
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
if (error instanceof Error && 'stderr' in error) {
|
|
143
|
+
throw new Error(`agent-browser error: ${error.stderr}`);
|
|
144
|
+
}
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
closeSession() {
|
|
149
|
+
if (!this.currentSession)
|
|
150
|
+
return;
|
|
151
|
+
try {
|
|
152
|
+
execSync(`agent-browser --session ${this.currentSession} close`, {
|
|
153
|
+
encoding: 'utf-8',
|
|
154
|
+
timeout: 10000,
|
|
155
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
// Ignore close errors
|
|
160
|
+
}
|
|
161
|
+
this.currentSession = null;
|
|
162
|
+
}
|
|
163
|
+
parseSearchResults(snapshot) {
|
|
164
|
+
const airports = [];
|
|
165
|
+
// The snapshot format has search results in a single text line like:
|
|
166
|
+
// "SEARCH RESULTS 3 airports found CODE AIRPORT CITY COUNTRY
|
|
167
|
+
// SWF New York Stewart International Airport Newburgh United States VIEW →
|
|
168
|
+
// JFK John F. Kennedy International Airport New York United States VIEW →"
|
|
169
|
+
// First, find the search results section
|
|
170
|
+
const searchSection = snapshot.match(/SEARCH RESULTS\s+\d+\s+airports?\s+found\s+CODE\s+AIRPORT\s+CITY\s+COUNTRY\s+(.+)/i);
|
|
171
|
+
if (searchSection) {
|
|
172
|
+
const resultsText = searchSection[1];
|
|
173
|
+
// Split by "VIEW →" to get individual airport entries
|
|
174
|
+
const entries = resultsText.split(/VIEW\s*→/).filter((s) => s.trim());
|
|
175
|
+
for (const entry of entries) {
|
|
176
|
+
// Pattern: CODE followed by airport name (containing "Airport"), then city and country
|
|
177
|
+
// Example: "JFK John F. Kennedy International Airport New York United States"
|
|
178
|
+
const match = entry
|
|
179
|
+
.trim()
|
|
180
|
+
.match(/^([A-Z]{3})\s+(.+?(?:Airport|International)[^\s]*)\s+(.+?)\s+([\w\s]+)$/i);
|
|
181
|
+
if (match) {
|
|
182
|
+
airports.push({
|
|
183
|
+
code: match[1],
|
|
184
|
+
name: match[2].trim(),
|
|
185
|
+
city: match[3].trim(),
|
|
186
|
+
country: match[4].trim(),
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
// Simpler fallback: just get code and whatever follows
|
|
191
|
+
const simpleMatch = entry.trim().match(/^([A-Z]{3})\s+(.+)/i);
|
|
192
|
+
if (simpleMatch) {
|
|
193
|
+
// Try to extract city from "... Airport CityName Country"
|
|
194
|
+
const parts = simpleMatch[2].match(/(.+Airport)\s+(\w+(?:\s+\w+)?)\s+(\w+(?:\s+\w+)?)$/i);
|
|
195
|
+
if (parts) {
|
|
196
|
+
airports.push({
|
|
197
|
+
code: simpleMatch[1],
|
|
198
|
+
name: parts[1].trim(),
|
|
199
|
+
city: parts[2].trim(),
|
|
200
|
+
country: parts[3].trim(),
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// Fallback: look for individual airport patterns in snapshot
|
|
208
|
+
if (airports.length === 0) {
|
|
209
|
+
const codePattern = /([A-Z]{3})\s+(\w+(?:\s+\w+)*?)\s+International\s+Airport/gi;
|
|
210
|
+
let match;
|
|
211
|
+
while ((match = codePattern.exec(snapshot)) !== null) {
|
|
212
|
+
airports.push({
|
|
213
|
+
code: match[1],
|
|
214
|
+
name: `${match[2]} International Airport`,
|
|
215
|
+
city: match[2],
|
|
216
|
+
country: '',
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return airports;
|
|
221
|
+
}
|
|
222
|
+
parseAirportData(snapshot, code, url) {
|
|
223
|
+
// Extract airport name from title or content
|
|
224
|
+
const nameMatch = snapshot.match(/([A-Z]{3})\s+(?:Airport\s+)?Wait\s+Times\s*[-–]\s*(.+?)(?:\s+Security|\s+Immigration|$)/i);
|
|
225
|
+
const airportName = nameMatch ? nameMatch[2].trim() : `${code} Airport`;
|
|
226
|
+
// Extract city from the airport name or page content
|
|
227
|
+
const cityMatch = snapshot.match(/(?:^|\s)([A-Z][a-z]+(?:\s+[A-Z][a-z]+)*)\s+International/);
|
|
228
|
+
const city = cityMatch ? cityMatch[1] : '';
|
|
229
|
+
// Parse security wait time
|
|
230
|
+
const security = this.parseWaitTime(snapshot, 'security');
|
|
231
|
+
// Parse immigration wait time
|
|
232
|
+
const immigration = this.parseWaitTime(snapshot, 'immigration');
|
|
233
|
+
// Parse traffic score
|
|
234
|
+
const trafficMatch = snapshot.match(/Traffic\s+Score[:\s]+(\d+)/i);
|
|
235
|
+
const trafficScore = trafficMatch ? parseInt(trafficMatch[1], 10) : null;
|
|
236
|
+
// Parse recommended arrival times
|
|
237
|
+
const domesticMatch = snapshot.match(/(\d+)\s*(?:min(?:utes)?)?.*?before\s+domestic/i);
|
|
238
|
+
const internationalMatch = snapshot.match(/(\d+)\s*(?:min(?:utes)?)?.*?before\s+international/i);
|
|
239
|
+
return {
|
|
240
|
+
airport: {
|
|
241
|
+
code,
|
|
242
|
+
name: airportName,
|
|
243
|
+
city,
|
|
244
|
+
country: '',
|
|
245
|
+
},
|
|
246
|
+
security,
|
|
247
|
+
immigration,
|
|
248
|
+
recommendedArrival: {
|
|
249
|
+
domestic: domesticMatch ? parseInt(domesticMatch[1], 10) : null,
|
|
250
|
+
international: internationalMatch ? parseInt(internationalMatch[1], 10) : null,
|
|
251
|
+
},
|
|
252
|
+
trafficScore,
|
|
253
|
+
url,
|
|
254
|
+
fetchedAt: new Date().toISOString(),
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
parseWaitTime(snapshot, type) {
|
|
258
|
+
// Look for wait time patterns in the snapshot
|
|
259
|
+
// Snapshot format examples:
|
|
260
|
+
// - link "Security Wait Very Busy (45+ min) for departing passengers..."
|
|
261
|
+
// - link "Immigration Fast (under 15 min) for arriving passengers..."
|
|
262
|
+
// - button "Very Busy (45+ min)"
|
|
263
|
+
const patterns = [
|
|
264
|
+
// Pattern: "Security Wait Very Busy (45+ min)" with extra spaces
|
|
265
|
+
new RegExp(`${type}(?:\\s+Wait)?\\s+(Very\\s*Busy|Busy|Moderate|Fast)\\s*\\(([^)]+)\\)`, 'i'),
|
|
266
|
+
// Pattern: "Security: 51 min"
|
|
267
|
+
new RegExp(`${type}[:\\s]+(\\d+)\\s*min`, 'i'),
|
|
268
|
+
// Pattern with just level (after type keyword)
|
|
269
|
+
new RegExp(`${type}(?:\\s+Wait)?\\s+(Very\\s*Busy|Busy|Moderate|Fast)`, 'i'),
|
|
270
|
+
];
|
|
271
|
+
for (const pattern of patterns) {
|
|
272
|
+
const match = snapshot.match(pattern);
|
|
273
|
+
if (match) {
|
|
274
|
+
if (match[2]) {
|
|
275
|
+
// Has level and time description
|
|
276
|
+
return {
|
|
277
|
+
level: this.parseLevel(match[1]),
|
|
278
|
+
minutes: this.parseMinutes(match[2]),
|
|
279
|
+
description: `${match[1].replace(/\s+/g, ' ')} (${match[2]})`,
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
if (/^\d+$/.test(match[1])) {
|
|
283
|
+
// Just minutes
|
|
284
|
+
const mins = parseInt(match[1], 10);
|
|
285
|
+
return {
|
|
286
|
+
level: this.minutesToLevel(mins),
|
|
287
|
+
minutes: mins,
|
|
288
|
+
description: `${mins} minutes`,
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
// Just level
|
|
292
|
+
return {
|
|
293
|
+
level: this.parseLevel(match[1]),
|
|
294
|
+
minutes: null,
|
|
295
|
+
description: match[1].replace(/\s+/g, ' '),
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return {
|
|
300
|
+
level: 'unknown',
|
|
301
|
+
minutes: null,
|
|
302
|
+
description: 'Unknown',
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
parseLevel(text) {
|
|
306
|
+
const normalized = text.toLowerCase().replace(/\s+/g, '_');
|
|
307
|
+
if (normalized.includes('very_busy') || normalized.includes('very busy'))
|
|
308
|
+
return 'very_busy';
|
|
309
|
+
if (normalized.includes('busy'))
|
|
310
|
+
return 'busy';
|
|
311
|
+
if (normalized.includes('moderate'))
|
|
312
|
+
return 'moderate';
|
|
313
|
+
if (normalized.includes('fast'))
|
|
314
|
+
return 'fast';
|
|
315
|
+
return 'unknown';
|
|
316
|
+
}
|
|
317
|
+
parseMinutes(text) {
|
|
318
|
+
// "45+ min" -> 45
|
|
319
|
+
// "under 15 min" -> 15
|
|
320
|
+
// "15-30 min" -> average (22)
|
|
321
|
+
const plusMatch = text.match(/(\d+)\+/);
|
|
322
|
+
if (plusMatch)
|
|
323
|
+
return parseInt(plusMatch[1], 10);
|
|
324
|
+
const underMatch = text.match(/under\s+(\d+)/i);
|
|
325
|
+
if (underMatch)
|
|
326
|
+
return parseInt(underMatch[1], 10);
|
|
327
|
+
const rangeMatch = text.match(/(\d+)\s*-\s*(\d+)/);
|
|
328
|
+
if (rangeMatch) {
|
|
329
|
+
return Math.round((parseInt(rangeMatch[1], 10) + parseInt(rangeMatch[2], 10)) / 2);
|
|
330
|
+
}
|
|
331
|
+
const simpleMatch = text.match(/(\d+)/);
|
|
332
|
+
if (simpleMatch)
|
|
333
|
+
return parseInt(simpleMatch[1], 10);
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
minutesToLevel(minutes) {
|
|
337
|
+
if (minutes < 15)
|
|
338
|
+
return 'fast';
|
|
339
|
+
if (minutes < 30)
|
|
340
|
+
return 'moderate';
|
|
341
|
+
if (minutes < 45)
|
|
342
|
+
return 'busy';
|
|
343
|
+
return 'very_busy';
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
//# sourceMappingURL=flightqueue-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flightqueue-client.js","sourceRoot":"","sources":["../../src/lib/flightqueue-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAS9C,MAAM,oBAAoB,G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;YAAE,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAEjD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAChD,IAAI,UAAU;YAAE,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAEnD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACnD,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACrF,CAAC;QAED,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,WAAW;YAAE,OAAO,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAErD,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,cAAc,CAAC,OAAe;QACpC,IAAI,OAAO,GAAG,EAAE;YAAE,OAAO,MAAM,CAAC;QAChC,IAAI,OAAO,GAAG,EAAE;YAAE,OAAO,UAAU,CAAC;QACpC,IAAI,OAAO,GAAG,EAAE;YAAE,OAAO,MAAM,CAAC;QAChC,OAAO,WAAW,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export interface FlightQueueAirport {
|
|
2
|
+
code: string;
|
|
3
|
+
name: string;
|
|
4
|
+
city: string;
|
|
5
|
+
country: string;
|
|
6
|
+
}
|
|
7
|
+
export interface WaitTimeStatus {
|
|
8
|
+
level: 'fast' | 'moderate' | 'busy' | 'very_busy' | 'unknown';
|
|
9
|
+
minutes: number | null;
|
|
10
|
+
description: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FlightQueueData {
|
|
13
|
+
airport: FlightQueueAirport;
|
|
14
|
+
security: WaitTimeStatus;
|
|
15
|
+
immigration: WaitTimeStatus;
|
|
16
|
+
recommendedArrival: {
|
|
17
|
+
domestic: number | null;
|
|
18
|
+
international: number | null;
|
|
19
|
+
};
|
|
20
|
+
trafficScore: number | null;
|
|
21
|
+
url: string;
|
|
22
|
+
fetchedAt: string;
|
|
23
|
+
}
|
|
24
|
+
export interface FlightQueueSearchResult {
|
|
25
|
+
airports: FlightQueueAirport[];
|
|
26
|
+
query: string;
|
|
27
|
+
}
|
|
28
|
+
export type FlightQueueResult = {
|
|
29
|
+
success: true;
|
|
30
|
+
data: FlightQueueData;
|
|
31
|
+
} | {
|
|
32
|
+
success: false;
|
|
33
|
+
error: string;
|
|
34
|
+
};
|
|
35
|
+
export type FlightQueueSearchResponse = {
|
|
36
|
+
success: true;
|
|
37
|
+
data: FlightQueueSearchResult;
|
|
38
|
+
} | {
|
|
39
|
+
success: false;
|
|
40
|
+
error: string;
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=flightqueue-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flightqueue-types.d.ts","sourceRoot":"","sources":["../../src/lib/flightqueue-types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9D,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,EAAE,cA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