@cyanheads/wsdot-mcp-server 0.2.1 → 0.2.3
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/AGENTS.md +1 -1
- package/CLAUDE.md +1 -1
- package/README.md +21 -9
- package/changelog/0.2.x/0.2.2.md +15 -0
- package/changelog/0.2.x/0.2.3.md +20 -0
- package/dist/mcp-server/tools/coordinate-pair.d.ts +18 -0
- package/dist/mcp-server/tools/coordinate-pair.d.ts.map +1 -0
- package/dist/mcp-server/tools/coordinate-pair.js +22 -0
- package/dist/mcp-server/tools/coordinate-pair.js.map +1 -0
- package/dist/mcp-server/tools/definitions/get-border-waits.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-border-waits.tool.js +11 -7
- package/dist/mcp-server/tools/definitions/get-border-waits.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ferry-alerts.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ferry-alerts.tool.js +11 -7
- package/dist/mcp-server/tools/definitions/get-ferry-alerts.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ferry-schedule.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ferry-schedule.tool.js +13 -2
- package/dist/mcp-server/tools/definitions/get-ferry-schedule.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ferry-terminals.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-ferry-terminals.tool.js +4 -3
- package/dist/mcp-server/tools/definitions/get-ferry-terminals.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-mountain-passes.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-mountain-passes.tool.js +5 -4
- package/dist/mcp-server/tools/definitions/get-mountain-passes.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-terminal-space.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/get-terminal-space.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-terminal-space.tool.js +94 -12
- package/dist/mcp-server/tools/definitions/get-terminal-space.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-toll-rates.tool.d.ts +6 -1
- package/dist/mcp-server/tools/definitions/get-toll-rates.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-toll-rates.tool.js +82 -21
- package/dist/mcp-server/tools/definitions/get-toll-rates.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-travel-times.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/get-travel-times.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-travel-times.tool.js +51 -7
- package/dist/mcp-server/tools/definitions/get-travel-times.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/get-vessel-locations.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/get-vessel-locations.tool.js +11 -7
- package/dist/mcp-server/tools/definitions/get-vessel-locations.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-alerts.tool.d.ts +4 -0
- package/dist/mcp-server/tools/definitions/search-alerts.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-alerts.tool.js +58 -13
- package/dist/mcp-server/tools/definitions/search-alerts.tool.js.map +1 -1
- package/dist/mcp-server/tools/definitions/search-cameras.tool.d.ts.map +1 -1
- package/dist/mcp-server/tools/definitions/search-cameras.tool.js +22 -9
- package/dist/mcp-server/tools/definitions/search-cameras.tool.js.map +1 -1
- package/dist/services/traffic/stable-order.d.ts +20 -0
- package/dist/services/traffic/stable-order.d.ts.map +1 -0
- package/dist/services/traffic/stable-order.js +29 -0
- package/dist/services/traffic/stable-order.js.map +1 -0
- package/package.json +1 -1
- package/server.json +3 -3
|
@@ -5,6 +5,13 @@
|
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { getFerryApiService } from '../../../services/ferry/ferry-service.js';
|
|
8
|
+
/**
|
|
9
|
+
* Paging unit is the terminal, not the sailing: offset/limit select whole terminals and each
|
|
10
|
+
* one arrives with every upcoming sailing it reports. WSF operates roughly 20 terminals, so
|
|
11
|
+
* MAX_LIMIT reaches the entire set in one call while the default bounds a browse of all of them.
|
|
12
|
+
*/
|
|
13
|
+
const DEFAULT_LIMIT = 5;
|
|
14
|
+
const MAX_LIMIT = 20;
|
|
8
15
|
export const getTerminalSpace = tool('wsdot_get_terminal_space', {
|
|
9
16
|
title: 'Get Terminal Space',
|
|
10
17
|
description: 'Returns real-time drive-up and reservable vehicle space available at WSF terminals for upcoming sailings. ' +
|
|
@@ -12,13 +19,29 @@ export const getTerminalSpace = tool('wsdot_get_terminal_space', {
|
|
|
12
19
|
'Optionally filter to a specific terminal by ID (use wsdot_get_ferry_terminals for the ID). ' +
|
|
13
20
|
'driveUpSpaceCount is the key field — zero means the drive-up lane is full. ' +
|
|
14
21
|
'Destinations are arrivingTerminalIds, not the itineraryLabel string: a sailing can serve ' +
|
|
15
|
-
'several terminals, and those IDs are what wsdot_get_ferry_schedule accepts.'
|
|
22
|
+
'several terminals, and those IDs are what wsdot_get_ferry_schedule accepts. ' +
|
|
23
|
+
`Results are paged by terminal (default ${DEFAULT_LIMIT}, max ${MAX_LIMIT}): offset/limit select whole terminals ` +
|
|
24
|
+
'and totalCount counts matching terminals, not sailings — every sailing of a returned terminal is included, ' +
|
|
25
|
+
'so page size varies with how many departures each terminal carries.',
|
|
16
26
|
annotations: { readOnlyHint: true },
|
|
17
27
|
input: z.object({
|
|
18
28
|
departingTerminalId: z
|
|
19
29
|
.number()
|
|
20
30
|
.optional()
|
|
21
31
|
.describe('Filter to a specific terminal by numeric ID. Omit to return all terminals.'),
|
|
32
|
+
offset: z
|
|
33
|
+
.number()
|
|
34
|
+
.int()
|
|
35
|
+
.min(0)
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Zero-based index of the first terminal to return, for paging. Defaults to 0.'),
|
|
38
|
+
limit: z
|
|
39
|
+
.number()
|
|
40
|
+
.int()
|
|
41
|
+
.min(1)
|
|
42
|
+
.max(MAX_LIMIT)
|
|
43
|
+
.optional()
|
|
44
|
+
.describe(`Maximum terminals to return in this page (1–${MAX_LIMIT}). Defaults to ${DEFAULT_LIMIT}. Counts terminals, not sailings.`),
|
|
22
45
|
}),
|
|
23
46
|
output: z.object({
|
|
24
47
|
terminals: z
|
|
@@ -78,7 +101,14 @@ export const getTerminalSpace = tool('wsdot_get_terminal_space', {
|
|
|
78
101
|
.describe('Terminal space availability by terminal.'),
|
|
79
102
|
}),
|
|
80
103
|
enrichment: {
|
|
81
|
-
totalCount: z
|
|
104
|
+
totalCount: z
|
|
105
|
+
.number()
|
|
106
|
+
.describe('Total terminals matching the filter across all pages (not just this page). Counts terminals, not sailings.'),
|
|
107
|
+
nextOffset: z
|
|
108
|
+
.number()
|
|
109
|
+
.nullable()
|
|
110
|
+
.describe('Offset to pass to retrieve the next page, or null when this is the last page.'),
|
|
111
|
+
hasMore: z.boolean().describe('True when more terminals remain beyond the current page.'),
|
|
82
112
|
terminalFilter: z
|
|
83
113
|
.number()
|
|
84
114
|
.optional()
|
|
@@ -86,7 +116,7 @@ export const getTerminalSpace = tool('wsdot_get_terminal_space', {
|
|
|
86
116
|
notice: z
|
|
87
117
|
.string()
|
|
88
118
|
.optional()
|
|
89
|
-
.describe('
|
|
119
|
+
.describe('Informational note about the page window, or guidance when no terminal space data is available, the filter matched nothing, or the offset ran past the end.'),
|
|
90
120
|
},
|
|
91
121
|
errors: [
|
|
92
122
|
{
|
|
@@ -109,17 +139,41 @@ export const getTerminalSpace = tool('wsdot_get_terminal_space', {
|
|
|
109
139
|
const filtered = input.departingTerminalId != null
|
|
110
140
|
? all.filter((t) => t.terminalId === input.departingTerminalId)
|
|
111
141
|
: all;
|
|
112
|
-
|
|
142
|
+
// Page the filtered set at the terminal level so structuredContent and content[] carry the
|
|
143
|
+
// identical page and no terminal's sailings are split across two calls (the service stays
|
|
144
|
+
// filter-only; paging is a tool-handler concern). totalCount stays the full match count.
|
|
145
|
+
const totalCount = filtered.length;
|
|
146
|
+
const offset = input.offset ?? 0;
|
|
147
|
+
const limit = input.limit ?? DEFAULT_LIMIT;
|
|
148
|
+
const terminals = filtered.slice(offset, offset + limit);
|
|
149
|
+
const hasMore = offset + terminals.length < totalCount;
|
|
150
|
+
const nextOffset = hasMore ? offset + terminals.length : null;
|
|
151
|
+
ctx.log.info('Terminal space fetched', {
|
|
152
|
+
total: all.length,
|
|
153
|
+
totalCount,
|
|
154
|
+
offset,
|
|
155
|
+
limit,
|
|
156
|
+
returned: terminals.length,
|
|
157
|
+
});
|
|
113
158
|
ctx.enrich({
|
|
114
|
-
totalCount
|
|
159
|
+
totalCount,
|
|
160
|
+
nextOffset,
|
|
161
|
+
hasMore,
|
|
115
162
|
...(input.departingTerminalId != null && { terminalFilter: input.departingTerminalId }),
|
|
116
163
|
});
|
|
117
|
-
if (
|
|
164
|
+
if (totalCount === 0) {
|
|
118
165
|
ctx.enrich.notice(input.departingTerminalId != null
|
|
119
166
|
? `No terminal space data found for terminal ID ${input.departingTerminalId}. Use wsdot_get_ferry_terminals to verify valid terminal IDs.`
|
|
120
167
|
: 'No terminal space data available. The WSF API may be temporarily unavailable — retry in 30 seconds.');
|
|
121
168
|
}
|
|
122
|
-
|
|
169
|
+
else if (terminals.length === 0) {
|
|
170
|
+
ctx.enrich.notice(`Offset ${offset} is past the end of ${totalCount} matching terminals. Use an offset between 0 and ${totalCount - 1}.`);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
const window = `Showing terminals ${offset + 1}–${offset + terminals.length} of ${totalCount}, each with all of its upcoming sailings.`;
|
|
174
|
+
ctx.enrich.notice(hasMore ? `${window} Pass offset=${nextOffset} for the next page.` : window);
|
|
175
|
+
}
|
|
176
|
+
return { terminals };
|
|
123
177
|
},
|
|
124
178
|
format: (result) => {
|
|
125
179
|
if (result.terminals.length === 0) {
|
|
@@ -134,24 +188,52 @@ export const getTerminalSpace = tool('wsdot_get_terminal_space', {
|
|
|
134
188
|
}
|
|
135
189
|
else {
|
|
136
190
|
for (const s of t.departingSpaces) {
|
|
137
|
-
|
|
191
|
+
/**
|
|
192
|
+
* Every sailing WSF publishes carries an explicit cancellation flag, so rendering
|
|
193
|
+
* only the `true` case leaves `content[]` silent about a status `structuredContent`
|
|
194
|
+
* states outright.
|
|
195
|
+
*/
|
|
196
|
+
const cancelled = s.isCancelled === true
|
|
197
|
+
? ' [CANCELLED]'
|
|
198
|
+
: s.isCancelled === false
|
|
199
|
+
? ' [not cancelled]'
|
|
200
|
+
: '';
|
|
138
201
|
const itinerary = s.itineraryLabel ? ` → ${s.itineraryLabel}` : '';
|
|
139
202
|
const vessel = s.vesselName ? ` | ${s.vesselName}` : '';
|
|
140
203
|
lines.push(`**${s.departure ?? 'Unknown'}**${itinerary}${vessel}${cancelled}`);
|
|
141
|
-
if (s.arrivingTerminalIds
|
|
142
|
-
lines.push(
|
|
204
|
+
if (s.arrivingTerminalIds) {
|
|
205
|
+
lines.push(s.arrivingTerminalIds.length > 0
|
|
206
|
+
? ` arrivingTerminalIds: ${s.arrivingTerminalIds.join(', ')}`
|
|
207
|
+
: ' arrivingTerminalIds: none listed');
|
|
143
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* The display flag and the count it describes are independently optional: nothing
|
|
211
|
+
* upstream guarantees a cleared flag comes with a null count, so each is rendered on
|
|
212
|
+
* its own terms rather than one gating the other. A set flag rides the count line
|
|
213
|
+
* below when there is one; without a count it has nothing else to carry it.
|
|
214
|
+
*/
|
|
144
215
|
if (s.displayDriveUpSpace === false) {
|
|
145
216
|
lines.push(' Drive-up: not reported for this sailing (displayDriveUpSpace: false)');
|
|
146
217
|
}
|
|
147
|
-
else if (s.driveUpSpaceCount
|
|
218
|
+
else if (s.displayDriveUpSpace === true && s.driveUpSpaceCount == null) {
|
|
219
|
+
lines.push(' Drive-up: reported for this sailing, count absent (displayDriveUpSpace: true)');
|
|
220
|
+
}
|
|
221
|
+
if (s.driveUpSpaceCount != null) {
|
|
148
222
|
const full = s.driveUpSpaceCount <= 0 ? ' (FULL)' : '';
|
|
149
223
|
lines.push(` Drive-up: ${s.driveUpSpaceCount}${s.maxSpaceCount != null ? `/${s.maxSpaceCount}` : ''} spaces${full}`);
|
|
150
224
|
}
|
|
225
|
+
else if (s.maxSpaceCount != null) {
|
|
226
|
+
// Capacity otherwise rides the drive-up line, so a sailing reporting capacity with
|
|
227
|
+
// no drive-up count (an empty SpaceForArrivalTerminals) would drop it from content[].
|
|
228
|
+
lines.push(` Capacity: ${s.maxSpaceCount} spaces`);
|
|
229
|
+
}
|
|
151
230
|
if (s.displayReservableSpace === false) {
|
|
152
231
|
lines.push(' Reservable: no reservations on this sailing (displayReservableSpace: false)');
|
|
153
232
|
}
|
|
154
|
-
else if (s.reservableSpaceCount
|
|
233
|
+
else if (s.displayReservableSpace === true && s.reservableSpaceCount == null) {
|
|
234
|
+
lines.push(' Reservable: reservations taken on this sailing, count absent (displayReservableSpace: true)');
|
|
235
|
+
}
|
|
236
|
+
if (s.reservableSpaceCount != null) {
|
|
155
237
|
const full = s.reservableSpaceCount <= 0 ? ' (FULL)' : '';
|
|
156
238
|
lines.push(` Reservable: ${s.reservableSpaceCount} spaces${full}`);
|
|
157
239
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-terminal-space.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-terminal-space.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,0BAA0B,EAAE;IAC/D,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EACT,4GAA4G;QAC5G,iFAAiF;QACjF,6FAA6F;QAC7F,6EAA6E;QAC7E,2FAA2F;QAC3F,
|
|
1
|
+
{"version":3,"file":"get-terminal-space.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-terminal-space.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE;;;;GAIG;AACH,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC,0BAA0B,EAAE;IAC/D,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EACT,4GAA4G;QAC5G,iFAAiF;QACjF,6FAA6F;QAC7F,6EAA6E;QAC7E,2FAA2F;QAC3F,8EAA8E;QAC9E,0CAA0C,aAAa,SAAS,SAAS,yCAAyC;QAClH,6GAA6G;QAC7G,qEAAqE;IACvE,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,mBAAmB,EAAE,CAAC;aACnB,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,4EAA4E,CAAC;QACzF,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,QAAQ,EAAE;aACV,QAAQ,CAAC,8EAA8E,CAAC;QAC3F,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,GAAG,EAAE;aACL,GAAG,CAAC,CAAC,CAAC;aACN,GAAG,CAAC,SAAS,CAAC;aACd,QAAQ,EAAE;aACV,QAAQ,CACP,+CAA+C,SAAS,kB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E,CAAC;wBAC3B,KAAK,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,oBAAoB,EAAE,CAAC,CAAC;oBACnE,CAAC;gBACH,CAAC;YACH,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
-
export declare const getTollRates: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
7
|
+
export declare const getTollRates: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
11
|
rates: z.ZodArray<z.ZodObject<{
|
|
9
12
|
tripName: z.ZodOptional<z.ZodString>;
|
|
10
13
|
stateRoute: z.ZodOptional<z.ZodString>;
|
|
@@ -35,6 +38,8 @@ export declare const getTollRates: import("@cyanheads/mcp-ts-core").ToolDefiniti
|
|
|
35
38
|
readonly recovery: "Register an access code at https://wsdot.wa.gov/traffic/api/, set WSDOT_ACCESS_CODE on the server, and restart it.";
|
|
36
39
|
}], {
|
|
37
40
|
readonly totalCount: z.ZodNumber;
|
|
41
|
+
readonly nextOffset: z.ZodNullable<z.ZodNumber>;
|
|
42
|
+
readonly hasMore: z.ZodBoolean;
|
|
38
43
|
readonly notice: z.ZodOptional<z.ZodString>;
|
|
39
44
|
}>;
|
|
40
45
|
//# sourceMappingURL=get-toll-rates.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-toll-rates.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-toll-rates.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"get-toll-rates.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-toll-rates.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAoBjE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmKvB,CAAC"}
|
|
@@ -4,14 +4,45 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
|
+
import { coordinatePair } from '../../../mcp-server/tools/coordinate-pair.js';
|
|
7
8
|
import { getTrafficApiService } from '../../../services/traffic/traffic-service.js';
|
|
9
|
+
const DEFAULT_LIMIT = 50;
|
|
10
|
+
const MAX_LIMIT = 500;
|
|
11
|
+
/**
|
|
12
|
+
* Washington's Interstate route numbers. The feed reports a bare, zero-padded route number with
|
|
13
|
+
* no route type, so a blanket "SR" prefix mislabels I-405; every other number the feed carries
|
|
14
|
+
* is a state route.
|
|
15
|
+
*/
|
|
16
|
+
const INTERSTATE_ROUTE_NUMBERS = new Set(['5', '82', '90', '182', '205', '405', '705']);
|
|
17
|
+
/** Turns an upstream route number ("099", "405") into its posted designation ("SR 99", "I-405"). */
|
|
18
|
+
function routeDesignation(stateRoute) {
|
|
19
|
+
const number = stateRoute.replace(/^0+(?=\d)/, '');
|
|
20
|
+
return INTERSTATE_ROUTE_NUMBERS.has(number) ? `I-${number}` : `SR ${number}`;
|
|
21
|
+
}
|
|
8
22
|
export const getTollRates = tool('wsdot_get_toll_rates', {
|
|
9
23
|
title: 'Get Toll Rates',
|
|
10
24
|
description: 'Returns current dynamic toll rates for WA express lanes and tolled facilities: SR 99 (WSDOT Tunnel), ' +
|
|
11
|
-
'SR
|
|
12
|
-
'Rates are time-banded and change dynamically based on traffic conditions.'
|
|
25
|
+
'SR 167 HOT Lanes, I-405 Express Lanes, SR 509 tolled segment, and the SR 520 Bridge. ' +
|
|
26
|
+
'Rates are time-banded and change dynamically based on traffic conditions. ' +
|
|
27
|
+
'stateRoute is a bare, zero-padded route number ("099", "405") — the posted designation is in ' +
|
|
28
|
+
'the rendered text. Results are paged — pass offset/limit to page through the full set ' +
|
|
29
|
+
'(the notice reports the next offset).',
|
|
13
30
|
annotations: { readOnlyHint: true },
|
|
14
|
-
input: z.object({
|
|
31
|
+
input: z.object({
|
|
32
|
+
offset: z
|
|
33
|
+
.number()
|
|
34
|
+
.int()
|
|
35
|
+
.min(0)
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Zero-based index of the first toll rate to return, for paging. Defaults to 0.'),
|
|
38
|
+
limit: z
|
|
39
|
+
.number()
|
|
40
|
+
.int()
|
|
41
|
+
.min(1)
|
|
42
|
+
.max(MAX_LIMIT)
|
|
43
|
+
.optional()
|
|
44
|
+
.describe(`Maximum toll rates to return in this page (1–${MAX_LIMIT}). Defaults to ${DEFAULT_LIMIT}.`),
|
|
45
|
+
}),
|
|
15
46
|
output: z.object({
|
|
16
47
|
rates: z
|
|
17
48
|
.array(z
|
|
@@ -44,11 +75,18 @@ export const getTollRates = tool('wsdot_get_toll_rates', {
|
|
|
44
75
|
.describe('Current toll rates for all active tolled facilities.'),
|
|
45
76
|
}),
|
|
46
77
|
enrichment: {
|
|
47
|
-
totalCount: z
|
|
78
|
+
totalCount: z
|
|
79
|
+
.number()
|
|
80
|
+
.describe('Total toll rate entries across all pages (not just this page).'),
|
|
81
|
+
nextOffset: z
|
|
82
|
+
.number()
|
|
83
|
+
.nullable()
|
|
84
|
+
.describe('Offset to pass to retrieve the next page, or null when this is the last page.'),
|
|
85
|
+
hasMore: z.boolean().describe('True when more toll rates remain beyond the current page.'),
|
|
48
86
|
notice: z
|
|
49
87
|
.string()
|
|
50
88
|
.optional()
|
|
51
|
-
.describe('
|
|
89
|
+
.describe('Informational note about the page window, or guidance when no toll rate data is available or the offset ran past the end.'),
|
|
52
90
|
},
|
|
53
91
|
errors: [
|
|
54
92
|
{
|
|
@@ -66,13 +104,29 @@ export const getTollRates = tool('wsdot_get_toll_rates', {
|
|
|
66
104
|
recovery: 'Register an access code at https://wsdot.wa.gov/traffic/api/, set WSDOT_ACCESS_CODE on the server, and restart it.',
|
|
67
105
|
},
|
|
68
106
|
],
|
|
69
|
-
async handler(
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
107
|
+
async handler(input, ctx) {
|
|
108
|
+
const allRates = await getTrafficApiService().getTollRates(ctx);
|
|
109
|
+
// Page the full set so structuredContent and content[] carry the identical page (the
|
|
110
|
+
// service stays filter-only; paging is a tool-handler concern). totalCount stays the
|
|
111
|
+
// full entry count so the agent knows how much lies beyond this page.
|
|
112
|
+
const totalCount = allRates.length;
|
|
113
|
+
const offset = input.offset ?? 0;
|
|
114
|
+
const limit = input.limit ?? DEFAULT_LIMIT;
|
|
115
|
+
const rates = allRates.slice(offset, offset + limit);
|
|
116
|
+
const hasMore = offset + rates.length < totalCount;
|
|
117
|
+
const nextOffset = hasMore ? offset + rates.length : null;
|
|
118
|
+
ctx.log.info('Toll rates fetched', { totalCount, offset, limit, returned: rates.length });
|
|
119
|
+
ctx.enrich({ totalCount, nextOffset, hasMore });
|
|
120
|
+
if (totalCount === 0) {
|
|
74
121
|
ctx.enrich.notice('No toll rate data available. The WSDOT API may be temporarily unavailable — retry in 30 seconds.');
|
|
75
122
|
}
|
|
123
|
+
else if (rates.length === 0) {
|
|
124
|
+
ctx.enrich.notice(`Offset ${offset} is past the end of ${totalCount} toll rate entries. Use an offset between 0 and ${totalCount - 1}.`);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
const window = `Showing toll rates ${offset + 1}–${offset + rates.length} of ${totalCount}.`;
|
|
128
|
+
ctx.enrich.notice(hasMore ? `${window} Pass offset=${nextOffset} for the next page.` : window);
|
|
129
|
+
}
|
|
76
130
|
return { rates };
|
|
77
131
|
},
|
|
78
132
|
format: (result) => {
|
|
@@ -81,16 +135,21 @@ export const getTollRates = tool('wsdot_get_toll_rates', {
|
|
|
81
135
|
}
|
|
82
136
|
const lines = [];
|
|
83
137
|
for (const r of result.rates) {
|
|
84
|
-
|
|
85
|
-
|
|
138
|
+
// tripName is an opaque upstream key ("099tp03268"); the endpoint names read as a segment,
|
|
139
|
+
// so they lead. A segment whose ends carry the same name collapses to one.
|
|
140
|
+
const ends = [r.startLocationName, r.endLocationName].filter(Boolean);
|
|
141
|
+
const segment = [...new Set(ends)].join(' → ');
|
|
142
|
+
lines.push(`### ${segment || r.tripName || 'Toll segment'}`);
|
|
143
|
+
if (r.tripName)
|
|
144
|
+
lines.push(`**Trip:** ${r.tripName}`);
|
|
86
145
|
if (r.stateRoute)
|
|
87
|
-
lines.push(`**Route:**
|
|
146
|
+
lines.push(`**Route:** ${routeDesignation(r.stateRoute)}`);
|
|
88
147
|
if (r.travelDirection)
|
|
89
148
|
lines.push(`**Direction:** ${r.travelDirection}`);
|
|
90
|
-
if (r.startLocationName
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
149
|
+
if (r.startLocationName)
|
|
150
|
+
lines.push(`**From:** ${r.startLocationName}`);
|
|
151
|
+
if (r.endLocationName)
|
|
152
|
+
lines.push(`**To:** ${r.endLocationName}`);
|
|
94
153
|
if (r.startMilepost != null)
|
|
95
154
|
lines.push(`**Start MP:** ${r.startMilepost}`);
|
|
96
155
|
if (r.endMilepost != null)
|
|
@@ -99,10 +158,12 @@ export const getTollRates = tool('wsdot_get_toll_rates', {
|
|
|
99
158
|
lines.push(`**Rate:** $${r.tollRateInDollars.toFixed(2)}`);
|
|
100
159
|
if (r.message)
|
|
101
160
|
lines.push(`**Message:** ${r.message}`);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
161
|
+
const startCoords = coordinatePair(r.startLatitude, r.startLongitude);
|
|
162
|
+
if (startCoords)
|
|
163
|
+
lines.push(`**Start Coords:** ${startCoords}`);
|
|
164
|
+
const endCoords = coordinatePair(r.endLatitude, r.endLongitude);
|
|
165
|
+
if (endCoords)
|
|
166
|
+
lines.push(`**End Coords:** ${endCoords}`);
|
|
106
167
|
if (r.timeUpdated)
|
|
107
168
|
lines.push(`**Updated:** ${r.timeUpdated}`);
|
|
108
169
|
lines.push('');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-toll-rates.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-toll-rates.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,sBAAsB,EAAE;IACvD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EACT,uGAAuG;QACvG,wFAAwF;QACxF,
|
|
1
|
+
{"version":3,"file":"get-toll-rates.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-toll-rates.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAA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TravelTimes: import("@cyanheads/mcp-ts-core").ToolDefinition<z.ZodObject<{
|
|
8
8
|
route: z.ZodOptional<z.ZodString>;
|
|
9
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
9
11
|
}, z.core.$strip>, z.ZodObject<{
|
|
10
12
|
corridors: z.ZodArray<z.ZodObject<{
|
|
11
13
|
travelTimeId: z.ZodOptional<z.ZodNumber>;
|
|
@@ -41,6 +43,8 @@ export declare const getTravelTimes: import("@cyanheads/mcp-ts-core").ToolDefini
|
|
|
41
43
|
readonly recovery: "Register an access code at https://wsdot.wa.gov/traffic/api/, set WSDOT_ACCESS_CODE on the server, and restart it.";
|
|
42
44
|
}], {
|
|
43
45
|
readonly totalCount: z.ZodNumber;
|
|
46
|
+
readonly nextOffset: z.ZodNullable<z.ZodNumber>;
|
|
47
|
+
readonly hasMore: z.ZodBoolean;
|
|
44
48
|
readonly routeFilter: z.ZodOptional<z.ZodString>;
|
|
45
49
|
readonly notice: z.ZodOptional<z.ZodString>;
|
|
46
50
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-travel-times.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-travel-times.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"get-travel-times.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-travel-times.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAOjE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuPzB,CAAC"}
|
|
@@ -6,13 +6,16 @@ import { tool, z } from '@cyanheads/mcp-ts-core';
|
|
|
6
6
|
import { JsonRpcErrorCode } from '@cyanheads/mcp-ts-core/errors';
|
|
7
7
|
import { routeMatches } from '../../../services/traffic/route-match.js';
|
|
8
8
|
import { getTrafficApiService } from '../../../services/traffic/traffic-service.js';
|
|
9
|
+
const DEFAULT_LIMIT = 50;
|
|
10
|
+
const MAX_LIMIT = 500;
|
|
9
11
|
export const getTravelTimes = tool('wsdot_get_travel_times', {
|
|
10
12
|
title: 'Get Travel Times',
|
|
11
13
|
description: 'Returns current vs. average travel times for named WA highway corridors (I-5, I-90, SR 520, SR 99, ' +
|
|
12
14
|
'I-405, SR 167, etc.). Use for "how congested is I-5?" or commute time estimates. ' +
|
|
13
15
|
'The route filter matches two ways: a route designation ("I-5", "5", "SR 520") returns every ' +
|
|
14
16
|
'corridor measured on that route, and any text also matches corridor names ("Everett"). ' +
|
|
15
|
-
'When current time exceeds average, the corridor is congested.'
|
|
17
|
+
'When current time exceeds average, the corridor is congested. ' +
|
|
18
|
+
'Results are paged — pass offset/limit to page through the full set (the notice reports the next offset).',
|
|
16
19
|
annotations: { readOnlyHint: true },
|
|
17
20
|
input: z.object({
|
|
18
21
|
route: z
|
|
@@ -22,6 +25,19 @@ export const getTravelTimes = tool('wsdot_get_travel_times', {
|
|
|
22
25
|
'corridor whose start or end point is on that route, whichever form the feed reports. ' +
|
|
23
26
|
'Any text also matches the corridor name as a case-insensitive substring, so "Everett" ' +
|
|
24
27
|
'finds the Seattle-Everett corridors. Omit to return all corridors.'),
|
|
28
|
+
offset: z
|
|
29
|
+
.number()
|
|
30
|
+
.int()
|
|
31
|
+
.min(0)
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('Zero-based index of the first corridor to return, for paging. Defaults to 0.'),
|
|
34
|
+
limit: z
|
|
35
|
+
.number()
|
|
36
|
+
.int()
|
|
37
|
+
.min(1)
|
|
38
|
+
.max(MAX_LIMIT)
|
|
39
|
+
.optional()
|
|
40
|
+
.describe(`Maximum corridors to return in this page (1–${MAX_LIMIT}). Defaults to ${DEFAULT_LIMIT}.`),
|
|
25
41
|
}),
|
|
26
42
|
output: z.object({
|
|
27
43
|
corridors: z
|
|
@@ -77,7 +93,14 @@ export const getTravelTimes = tool('wsdot_get_travel_times', {
|
|
|
77
93
|
.describe('Travel time corridors matching the filter.'),
|
|
78
94
|
}),
|
|
79
95
|
enrichment: {
|
|
80
|
-
totalCount: z
|
|
96
|
+
totalCount: z
|
|
97
|
+
.number()
|
|
98
|
+
.describe('Total corridors matching the filter across all pages (not just this page).'),
|
|
99
|
+
nextOffset: z
|
|
100
|
+
.number()
|
|
101
|
+
.nullable()
|
|
102
|
+
.describe('Offset to pass to retrieve the next page, or null when this is the last page.'),
|
|
103
|
+
hasMore: z.boolean().describe('True when more corridors remain beyond the current page.'),
|
|
81
104
|
routeFilter: z
|
|
82
105
|
.string()
|
|
83
106
|
.optional()
|
|
@@ -85,7 +108,7 @@ export const getTravelTimes = tool('wsdot_get_travel_times', {
|
|
|
85
108
|
notice: z
|
|
86
109
|
.string()
|
|
87
110
|
.optional()
|
|
88
|
-
.describe('
|
|
111
|
+
.describe('Informational note about the page window, or guidance when no corridors matched the route filter or the offset ran past the end.'),
|
|
89
112
|
},
|
|
90
113
|
errors: [
|
|
91
114
|
{
|
|
@@ -113,19 +136,40 @@ export const getTravelTimes = tool('wsdot_get_travel_times', {
|
|
|
113
136
|
? all.filter((t) => t.name?.toLowerCase().includes(routeFilter) ||
|
|
114
137
|
[t.startPoint?.roadName, t.endPoint?.roadName].some((roadName) => roadName != null && routeMatches(routeFilter, roadName)))
|
|
115
138
|
: all;
|
|
116
|
-
|
|
139
|
+
// Page the full filtered set so structuredContent and content[] carry the identical
|
|
140
|
+
// page (the service stays filter-only; paging is a tool-handler concern). totalCount
|
|
141
|
+
// stays the full match count so the agent knows how much lies beyond this page.
|
|
142
|
+
const totalCount = filtered.length;
|
|
143
|
+
const offset = input.offset ?? 0;
|
|
144
|
+
const limit = input.limit ?? DEFAULT_LIMIT;
|
|
145
|
+
const corridors = filtered.slice(offset, offset + limit).map((t) => ({
|
|
117
146
|
...t,
|
|
118
147
|
delayInMinutes: t.currentTimeInMinutes != null && t.averageTimeInMinutes != null
|
|
119
148
|
? t.currentTimeInMinutes - t.averageTimeInMinutes
|
|
120
149
|
: undefined,
|
|
121
150
|
}));
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
151
|
+
const hasMore = offset + corridors.length < totalCount;
|
|
152
|
+
const nextOffset = hasMore ? offset + corridors.length : null;
|
|
153
|
+
ctx.log.info('Travel times fetched', {
|
|
154
|
+
total: all.length,
|
|
155
|
+
totalCount,
|
|
156
|
+
offset,
|
|
157
|
+
limit,
|
|
158
|
+
returned: corridors.length,
|
|
159
|
+
});
|
|
160
|
+
ctx.enrich({ totalCount, nextOffset, hasMore, ...(routeFilter && { routeFilter }) });
|
|
161
|
+
if (totalCount === 0) {
|
|
125
162
|
ctx.enrich.notice(routeFilter
|
|
126
163
|
? `No corridors matched the route filter "${routeFilter}". Try a broader filter (e.g. "I-5" instead of "I-5 NB") or omit the filter to list all corridors.`
|
|
127
164
|
: 'No travel time data available. The WSDOT API may be temporarily unavailable — retry in 30 seconds.');
|
|
128
165
|
}
|
|
166
|
+
else if (corridors.length === 0) {
|
|
167
|
+
ctx.enrich.notice(`Offset ${offset} is past the end of ${totalCount} matching corridors. Use an offset between 0 and ${totalCount - 1}.`);
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
const window = `Showing corridors ${offset + 1}–${offset + corridors.length} of ${totalCount}.`;
|
|
171
|
+
ctx.enrich.notice(hasMore ? `${window} Pass offset=${nextOffset} for the next page.` : window);
|
|
172
|
+
}
|
|
129
173
|
return { corridors };
|
|
130
174
|
},
|
|
131
175
|
format: (result) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-travel-times.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-travel-times.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,wBAAwB,EAAE;IAC3D,KAAK,EAAE,kBAAkB;IACzB,WAAW,EACT,qGAAqG;QACrG,mFAAmF;QACnF,8FAA8F;QAC9F,yFAAyF;QACzF
|
|
1
|
+
{"version":3,"file":"get-travel-times.tool.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-travel-times.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,SAAS,GAAG,GAAG,CAAC;AAEtB,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,CAAC,wBAAwB,EAAE;IAC3D,KAAK,EAAE,kBAAkB;IACzB,WAAW,EACT,qGAAqG;QACrG,mFAAmF;QACnF,8FAA8F;QAC9F,yFAAyF;QACzF,gEAAgE;QAChE,0GAA0G;IAC5G,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE;IACnC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,KAAK,EAAE,CAAC;aACL,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,4FAA4F;YA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S;iBACtE;qBACE,MAAM,CAAC,OAAO,CAAC;qBACf,IAAI,CAAC,GAAG,CAAC,CAAC;gBACb,IAAI,EAAE;oBAAE,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;YACtC,CAAC;YACD,IAAI,CAAC,CAAC,WAAW;gBAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;YAC/D,IAAI,CAAC,CAAC,YAAY,IAAI,IAAI;gBAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;YACpE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-vessel-locations.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-vessel-locations.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"get-vessel-locations.tool.d.ts","sourceRoot":"","sources":["../../../../src/mcp-server/tools/definitions/get-vessel-locations.tool.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAQ,CAAC,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+I7B,CAAC"}
|