Add gitignor
This commit is contained in:
22
mcp_servers/traveller_map/dist/parsers/sec.d.ts
vendored
Normal file
22
mcp_servers/traveller_map/dist/parsers/sec.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { type DecodedUWP } from './uwp.js';
|
||||
export interface WorldRecord {
|
||||
hex: string;
|
||||
name: string;
|
||||
uwp: string;
|
||||
decoded_uwp: DecodedUWP;
|
||||
bases: string;
|
||||
remarks: string;
|
||||
trade_codes: string[];
|
||||
zone: string;
|
||||
pbg: string;
|
||||
allegiance: string;
|
||||
stars: string;
|
||||
importance?: string;
|
||||
economic?: string;
|
||||
cultural?: string;
|
||||
nobility?: string;
|
||||
worlds?: string;
|
||||
resource_units?: string;
|
||||
}
|
||||
export declare function parseSecTabDelimited(text: string): WorldRecord[];
|
||||
//# sourceMappingURL=sec.d.ts.map
|
||||
1
mcp_servers/traveller_map/dist/parsers/sec.d.ts.map
vendored
Normal file
1
mcp_servers/traveller_map/dist/parsers/sec.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sec.d.ts","sourceRoot":"","sources":["../../src/parsers/sec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAErD,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,UAAU,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAuBD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CA0FhE"}
|
||||
106
mcp_servers/traveller_map/dist/parsers/sec.js
vendored
Normal file
106
mcp_servers/traveller_map/dist/parsers/sec.js
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
import { parseUWP } from './uwp.js';
|
||||
const ZONE_MAP = {
|
||||
R: 'Red',
|
||||
A: 'Amber',
|
||||
'': 'Green',
|
||||
'-': 'Green',
|
||||
' ': 'Green',
|
||||
G: 'Green',
|
||||
};
|
||||
function normalizeZone(zone) {
|
||||
return ZONE_MAP[zone?.trim() ?? ''] ?? zone?.trim() ?? 'Green';
|
||||
}
|
||||
function parseRemarks(remarks) {
|
||||
if (!remarks)
|
||||
return [];
|
||||
return remarks
|
||||
.trim()
|
||||
.split(/\s+/)
|
||||
.filter((r) => r.length > 0 && r !== '-');
|
||||
}
|
||||
export function parseSecTabDelimited(text) {
|
||||
const lines = text.split('\n');
|
||||
const worlds = [];
|
||||
let headerLine = '';
|
||||
let headerIndex = -1;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
const line = lines[i];
|
||||
if (line.startsWith('#') || line.trim() === '')
|
||||
continue;
|
||||
if (/^[-\s]+$/.test(line))
|
||||
continue;
|
||||
if (line.toLowerCase().includes('hex') || line.toLowerCase().includes('name')) {
|
||||
headerLine = line;
|
||||
headerIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!headerLine) {
|
||||
return worlds;
|
||||
}
|
||||
const headers = headerLine.split('\t').map((h) => h.trim().toLowerCase());
|
||||
const colIndex = (names) => {
|
||||
for (const name of names) {
|
||||
const idx = headers.indexOf(name);
|
||||
if (idx !== -1)
|
||||
return idx;
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
const hexIdx = colIndex(['hex']);
|
||||
const nameIdx = colIndex(['name', 'world name']);
|
||||
const uwpIdx = colIndex(['uwp']);
|
||||
const basesIdx = colIndex(['bases', 'base']);
|
||||
const remarksIdx = colIndex(['remarks', 'trade codes', 'tradecodes']);
|
||||
const zoneIdx = colIndex(['zone', 'iz', 'travel zone']);
|
||||
const pbgIdx = colIndex(['pbg']);
|
||||
const allegIdx = colIndex(['allegiance', 'alleg', 'a']);
|
||||
const starsIdx = colIndex(['stars', 'stellar data', 'stellar']);
|
||||
const importanceIdx = colIndex(['{ix}', 'ix', 'importance', '{importance}']);
|
||||
const economicIdx = colIndex(['(ex)', 'ex', 'economic', '(economic)']);
|
||||
const culturalIdx = colIndex(['[cx]', 'cx', 'cultural', '[cultural]']);
|
||||
const nobilityIdx = colIndex(['nobility', 'nobil', 'n']);
|
||||
const worldsIdx = colIndex(['w', 'worlds']);
|
||||
const ruIdx = colIndex(['ru', 'resource units']);
|
||||
for (let i = headerIndex + 1; i < lines.length; i++) {
|
||||
const line = lines[i];
|
||||
if (line.startsWith('#') || line.trim() === '')
|
||||
continue;
|
||||
if (/^[-\s]+$/.test(line))
|
||||
continue;
|
||||
const cols = line.split('\t');
|
||||
if (cols.length < 3)
|
||||
continue;
|
||||
const get = (idx) => (idx >= 0 ? cols[idx]?.trim() ?? '' : '');
|
||||
const uwpRaw = get(uwpIdx);
|
||||
let decodedUwp;
|
||||
try {
|
||||
decodedUwp = parseUWP(uwpRaw);
|
||||
}
|
||||
catch {
|
||||
decodedUwp = parseUWP('?000000-0');
|
||||
}
|
||||
const remarksRaw = get(remarksIdx);
|
||||
worlds.push({
|
||||
hex: get(hexIdx),
|
||||
name: get(nameIdx),
|
||||
uwp: uwpRaw,
|
||||
decoded_uwp: decodedUwp,
|
||||
bases: get(basesIdx),
|
||||
remarks: remarksRaw,
|
||||
trade_codes: parseRemarks(remarksRaw),
|
||||
zone: normalizeZone(get(zoneIdx)),
|
||||
pbg: get(pbgIdx),
|
||||
allegiance: get(allegIdx),
|
||||
stars: get(starsIdx),
|
||||
importance: importanceIdx >= 0 ? get(importanceIdx) : undefined,
|
||||
economic: economicIdx >= 0 ? get(economicIdx) : undefined,
|
||||
cultural: culturalIdx >= 0 ? get(culturalIdx) : undefined,
|
||||
nobility: nobilityIdx >= 0 ? get(nobilityIdx) : undefined,
|
||||
worlds: worldsIdx >= 0 ? get(worldsIdx) : undefined,
|
||||
resource_units: ruIdx >= 0 ? get(ruIdx) : undefined,
|
||||
});
|
||||
}
|
||||
return worlds;
|
||||
}
|
||||
//# sourceMappingURL=sec.js.map
|
||||
1
mcp_servers/traveller_map/dist/parsers/sec.js.map
vendored
Normal file
1
mcp_servers/traveller_map/dist/parsers/sec.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sec.js","sourceRoot":"","sources":["../../src/parsers/sec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmB,MAAM,UAAU,CAAC;AAsBrD,MAAM,QAAQ,GAA2B;IACvC,CAAC,EAAE,KAAK;IACR,CAAC,EAAE,OAAO;IACV,EAAE,EAAE,OAAO;IACX,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,OAAO;IACZ,CAAC,EAAE,OAAO;CACX,CAAC;AAEF,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,IAAI,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC;AACjE,CAAC;AAED,SAAS,YAAY,CAAC,OAAe;IACnC,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACxB,OAAO,OAAO;SACX,IAAI,EAAE;SACN,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAA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Q,CAAC;YACpB,OAAO,EAAE,UAAU;YACnB,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC;YACrC,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YACjC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC;YAChB,UAAU,EAAE,GAAG,CAAC,QAAQ,CAAC;YACzB,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC;YACpB,UAAU,EAAE,aAAa,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS;YAC/D,QAAQ,EAAE,WAAW,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;YACzD,QAAQ,EAAE,WAAW,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;YACzD,QAAQ,EAAE,WAAW,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;YACzD,MAAM,EAAE,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;YACnD,cAAc,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS;SACpD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
||||
30
mcp_servers/traveller_map/dist/parsers/uwp.d.ts
vendored
Normal file
30
mcp_servers/traveller_map/dist/parsers/uwp.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
export interface DecodedUWPField {
|
||||
code: string;
|
||||
value: number;
|
||||
description: string;
|
||||
}
|
||||
export interface DecodedUWP {
|
||||
raw: string;
|
||||
starport: {
|
||||
code: string;
|
||||
description: string;
|
||||
};
|
||||
size: DecodedUWPField & {
|
||||
diameter_km: string;
|
||||
};
|
||||
atmosphere: DecodedUWPField;
|
||||
hydrographics: DecodedUWPField & {
|
||||
percent: string;
|
||||
};
|
||||
population: DecodedUWPField & {
|
||||
estimate: string;
|
||||
};
|
||||
government: DecodedUWPField;
|
||||
law_level: DecodedUWPField;
|
||||
tech_level: DecodedUWPField & {
|
||||
era: string;
|
||||
};
|
||||
}
|
||||
export declare function eHexValue(char: string): number;
|
||||
export declare function parseUWP(uwp: string): DecodedUWP;
|
||||
//# sourceMappingURL=uwp.d.ts.map
|
||||
1
mcp_servers/traveller_map/dist/parsers/uwp.d.ts.map
vendored
Normal file
1
mcp_servers/traveller_map/dist/parsers/uwp.d.ts.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"uwp.d.ts","sourceRoot":"","sources":["../../src/parsers/uwp.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,IAAI,EAAE,eAAe,GAAG;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,UAAU,EAAE,eAAe,CAAC;IAC5B,aAAa,EAAE,eAAe,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,UAAU,EAAE,eAAe,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,UAAU,EAAE,eAAe,CAAC;IAC5B,SAAS,EAAE,eAAe,CAAC;IAC3B,UAAU,EAAE,eAAe,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAC/C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAK9C;AAyID,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAsEhD"}
|
||||
203
mcp_servers/traveller_map/dist/parsers/uwp.js
vendored
Normal file
203
mcp_servers/traveller_map/dist/parsers/uwp.js
vendored
Normal file
@@ -0,0 +1,203 @@
|
||||
export function eHexValue(char) {
|
||||
const c = char.toUpperCase();
|
||||
if (c >= '0' && c <= '9')
|
||||
return parseInt(c, 10);
|
||||
if (c >= 'A' && c <= 'Z')
|
||||
return c.charCodeAt(0) - 'A'.charCodeAt(0) + 10;
|
||||
return 0;
|
||||
}
|
||||
const STARPORT = {
|
||||
A: 'Excellent — full repair, refined fuel, shipyard capable',
|
||||
B: 'Good — full repair, refined fuel available',
|
||||
C: 'Routine — some repair, unrefined fuel available',
|
||||
D: 'Poor — limited repair, unrefined fuel only',
|
||||
E: 'Frontier — no repair, no fuel',
|
||||
X: 'None — no starport facilities',
|
||||
F: 'Good — spaceport (non-starship capable)',
|
||||
G: 'Poor — primitive spaceport',
|
||||
H: 'Primitive — minimal facilities',
|
||||
Y: 'None',
|
||||
};
|
||||
const SIZE_DESC = {
|
||||
0: { description: 'Asteroid/planetoid belt or very small body', diameter_km: '<800 km' },
|
||||
1: { description: 'Small world', diameter_km: '~1,600 km' },
|
||||
2: { description: 'Small world', diameter_km: '~3,200 km' },
|
||||
3: { description: 'Small world', diameter_km: '~4,800 km' },
|
||||
4: { description: 'Small world', diameter_km: '~6,400 km' },
|
||||
5: { description: 'Medium world', diameter_km: '~8,000 km' },
|
||||
6: { description: 'Medium world (Earth-like)', diameter_km: '~9,600 km' },
|
||||
7: { description: 'Medium world', diameter_km: '~11,200 km' },
|
||||
8: { description: 'Large world', diameter_km: '~12,800 km' },
|
||||
9: { description: 'Large world', diameter_km: '~14,400 km' },
|
||||
10: { description: 'Large world', diameter_km: '~16,000 km' },
|
||||
};
|
||||
const ATMOSPHERE_DESC = {
|
||||
0: 'None — vacuum',
|
||||
1: 'Trace — very thin, requires vacc suit',
|
||||
2: 'Very Thin, Tainted — requires filter mask and compressor',
|
||||
3: 'Very Thin — requires compressor',
|
||||
4: 'Thin, Tainted — requires filter mask',
|
||||
5: 'Thin — breathable with some discomfort',
|
||||
6: 'Standard — breathable',
|
||||
7: 'Standard, Tainted — requires filter mask',
|
||||
8: 'Dense — breathable with no special equipment',
|
||||
9: 'Dense, Tainted — requires filter mask',
|
||||
10: 'Exotic — requires oxygen supply',
|
||||
11: 'Corrosive — requires vacc suit',
|
||||
12: 'Insidious — suit penetrating, requires special protection',
|
||||
13: 'Dense, High — breathable only at high altitudes',
|
||||
14: 'Thin, Low — breathable only in lowlands',
|
||||
15: 'Unusual',
|
||||
};
|
||||
const HYDROGRAPHICS_DESC = {
|
||||
0: { description: 'Desert world — no free water', percent: '0%' },
|
||||
1: { description: 'Dry world — traces of water', percent: '1–10%' },
|
||||
2: { description: 'Dry world', percent: '11–20%' },
|
||||
3: { description: 'Dry world', percent: '21–30%' },
|
||||
4: { description: 'Wet world', percent: '31–40%' },
|
||||
5: { description: 'Wet world', percent: '41–50%' },
|
||||
6: { description: 'Wet world', percent: '51–60%' },
|
||||
7: { description: 'Wet world — significant oceans', percent: '61–70%' },
|
||||
8: { description: 'Water world — large oceans', percent: '71–80%' },
|
||||
9: { description: 'Water world — very large oceans', percent: '81–90%' },
|
||||
10: { description: 'Water world — global ocean', percent: '91–100%' },
|
||||
};
|
||||
const POPULATION_DESC = {
|
||||
0: { description: 'Unpopulated or tiny outpost', estimate: 'None or a few individuals' },
|
||||
1: { description: 'Tens of inhabitants', estimate: '~10s' },
|
||||
2: { description: 'Hundreds of inhabitants', estimate: '~100s' },
|
||||
3: { description: 'Thousands of inhabitants', estimate: '~1,000s' },
|
||||
4: { description: 'Tens of thousands', estimate: '~10,000s' },
|
||||
5: { description: 'Hundreds of thousands', estimate: '~100,000s' },
|
||||
6: { description: 'Millions of inhabitants', estimate: '~1,000,000s' },
|
||||
7: { description: 'Tens of millions', estimate: '~10,000,000s' },
|
||||
8: { description: 'Hundreds of millions', estimate: '~100,000,000s' },
|
||||
9: { description: 'Billions of inhabitants', estimate: '~1,000,000,000s' },
|
||||
10: { description: 'Tens of billions', estimate: '~10,000,000,000s' },
|
||||
11: { description: 'Hundreds of billions', estimate: '~100,000,000,000s' },
|
||||
12: { description: 'Trillions of inhabitants', estimate: '~1,000,000,000,000s' },
|
||||
};
|
||||
const GOVERNMENT_DESC = {
|
||||
0: 'No Government Structure — family/clan/tribal',
|
||||
1: 'Company/Corporation — governed by a company',
|
||||
2: 'Participating Democracy — rule by citizen vote',
|
||||
3: 'Self-Perpetuating Oligarchy — ruling class maintains power',
|
||||
4: 'Representative Democracy — elected representatives',
|
||||
5: 'Feudal Technocracy — controlled by technology owners',
|
||||
6: 'Captive Government — controlled by outside power',
|
||||
7: 'Balkanization — no central authority',
|
||||
8: 'Civil Service Bureaucracy — rule by competence',
|
||||
9: 'Impersonal Bureaucracy — rule by rigid law',
|
||||
10: 'Charismatic Dictator — rule by personality',
|
||||
11: 'Non-Charismatic Leader — rule by position',
|
||||
12: 'Charismatic Oligarchy — rule by a few personalities',
|
||||
13: 'Religious Dictatorship — rule by religious doctrine',
|
||||
14: 'Religious Autocracy — rule by a religious figure',
|
||||
15: 'Totalitarian Oligarchy — oppressive rule by a few',
|
||||
};
|
||||
const LAW_LEVEL_DESC = {
|
||||
0: 'No prohibitions — no restrictions on weapons or behavior',
|
||||
1: 'Body pistols, explosives, nuclear weapons prohibited',
|
||||
2: 'Portable energy weapons prohibited',
|
||||
3: 'Machine guns, automatic weapons prohibited',
|
||||
4: 'Light assault weapons prohibited',
|
||||
5: 'Personal concealable weapons prohibited',
|
||||
6: 'All firearms except shotguns prohibited',
|
||||
7: 'Shotguns prohibited',
|
||||
8: 'Long blades prohibited in public',
|
||||
9: 'All weapons outside home prohibited',
|
||||
10: 'Weapon possession prohibited — weapons locked up',
|
||||
11: 'Rigid control of civilian movement',
|
||||
12: 'Unrestricted invasion of privacy',
|
||||
13: 'Paramilitary law enforcement',
|
||||
14: 'Full-fledged police state',
|
||||
15: 'Daily life rigidly controlled',
|
||||
};
|
||||
const TECH_LEVEL_ERA = {
|
||||
0: 'Stone Age / Pre-Industrial',
|
||||
1: 'Bronze Age / Iron Age',
|
||||
2: 'Renaissance',
|
||||
3: 'Industrial Revolution',
|
||||
4: 'Mechanized Age',
|
||||
5: 'Broadcast Age',
|
||||
6: 'Atomic Age',
|
||||
7: 'Space Age',
|
||||
8: 'Information Age',
|
||||
9: 'Pre-Stellar',
|
||||
10: 'Early Stellar',
|
||||
11: 'Average Stellar',
|
||||
12: 'Average Interstellar',
|
||||
13: 'High Interstellar',
|
||||
14: 'Average Imperial',
|
||||
15: 'High Imperial / Average Interstellar II',
|
||||
16: 'Sophont',
|
||||
17: 'Advanced',
|
||||
};
|
||||
export function parseUWP(uwp) {
|
||||
const clean = uwp.trim().replace(/\s+/g, '');
|
||||
const starportCode = clean[0] ?? '?';
|
||||
const sizeCode = clean[1] ?? '0';
|
||||
const atmCode = clean[2] ?? '0';
|
||||
const hydroCode = clean[3] ?? '0';
|
||||
const popCode = clean[4] ?? '0';
|
||||
const govCode = clean[5] ?? '0';
|
||||
const lawCode = clean[6] ?? '0';
|
||||
const tlCode = clean[8] ?? '0';
|
||||
const sizeVal = eHexValue(sizeCode);
|
||||
const atmVal = eHexValue(atmCode);
|
||||
const hydroVal = eHexValue(hydroCode);
|
||||
const popVal = eHexValue(popCode);
|
||||
const govVal = eHexValue(govCode);
|
||||
const lawVal = eHexValue(lawCode);
|
||||
const tlVal = eHexValue(tlCode);
|
||||
const sizeInfo = SIZE_DESC[sizeVal] ?? { description: 'Unknown size', diameter_km: 'Unknown' };
|
||||
const hydroInfo = HYDROGRAPHICS_DESC[hydroVal] ?? { description: 'Unknown hydrographics', percent: 'Unknown' };
|
||||
const popInfo = POPULATION_DESC[popVal] ?? { description: 'Unknown population', estimate: 'Unknown' };
|
||||
return {
|
||||
raw: uwp,
|
||||
starport: {
|
||||
code: starportCode,
|
||||
description: STARPORT[starportCode.toUpperCase()] ?? `Unknown starport code: ${starportCode}`,
|
||||
},
|
||||
size: {
|
||||
code: sizeCode,
|
||||
value: sizeVal,
|
||||
description: sizeInfo.description,
|
||||
diameter_km: sizeInfo.diameter_km,
|
||||
},
|
||||
atmosphere: {
|
||||
code: atmCode,
|
||||
value: atmVal,
|
||||
description: ATMOSPHERE_DESC[atmVal] ?? `Unknown atmosphere code: ${atmCode}`,
|
||||
},
|
||||
hydrographics: {
|
||||
code: hydroCode,
|
||||
value: hydroVal,
|
||||
description: hydroInfo.description,
|
||||
percent: hydroInfo.percent,
|
||||
},
|
||||
population: {
|
||||
code: popCode,
|
||||
value: popVal,
|
||||
description: popInfo.description,
|
||||
estimate: popInfo.estimate,
|
||||
},
|
||||
government: {
|
||||
code: govCode,
|
||||
value: govVal,
|
||||
description: GOVERNMENT_DESC[govVal] ?? `Unknown government code: ${govCode}`,
|
||||
},
|
||||
law_level: {
|
||||
code: lawCode,
|
||||
value: lawVal,
|
||||
description: LAW_LEVEL_DESC[lawVal] ?? `Unknown law level code: ${lawCode}`,
|
||||
},
|
||||
tech_level: {
|
||||
code: tlCode,
|
||||
value: tlVal,
|
||||
description: `Tech Level ${tlVal}`,
|
||||
era: TECH_LEVEL_ERA[tlVal] ?? 'Advanced/Unknown',
|
||||
},
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=uwp.js.map
|
||||
1
mcp_servers/traveller_map/dist/parsers/uwp.js.map
vendored
Normal file
1
mcp_servers/traveller_map/dist/parsers/uwp.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user