@curless/hotel-storefront 0.68.2 → 0.69.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/README.md +23 -0
- package/dist/cidr.d.ts +46 -0
- package/dist/cidr.d.ts.map +1 -0
- package/dist/cidr.js +143 -0
- package/dist/cidr.js.map +1 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/legal.d.ts +7 -1
- package/dist/legal.d.ts.map +1 -1
- package/dist/legal.js +10 -3
- package/dist/legal.js.map +1 -1
- package/dist/lib.d.ts +6 -0
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +5 -0
- package/dist/lib.js.map +1 -1
- package/dist/otaless/booking.d.ts.map +1 -1
- package/dist/otaless/booking.js +43 -2
- package/dist/otaless/booking.js.map +1 -1
- package/dist/ranges-check-cli.d.ts +3 -0
- package/dist/ranges-check-cli.d.ts.map +1 -0
- package/dist/ranges-check-cli.js +10 -0
- package/dist/ranges-check-cli.js.map +1 -0
- package/dist/ranges-check.d.ts +39 -0
- package/dist/ranges-check.d.ts.map +1 -0
- package/dist/ranges-check.js +137 -0
- package/dist/ranges-check.js.map +1 -0
- package/dist/server.d.ts +4 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +41 -2
- package/dist/server.js.map +1 -1
- package/dist/source-allowlist.d.ts +95 -0
- package/dist/source-allowlist.d.ts.map +1 -0
- package/dist/source-allowlist.js +250 -0
- package/dist/source-allowlist.js.map +1 -0
- package/dist/source-ranges.d.ts +30 -0
- package/dist/source-ranges.d.ts.map +1 -0
- package/dist/source-ranges.js +376 -0
- package/dist/source-ranges.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type PlatformRanges, type RangeSource } from './source-ranges.js';
|
|
2
|
+
/** One source, compared. */
|
|
3
|
+
export type SourceDiff = {
|
|
4
|
+
platform: string;
|
|
5
|
+
url: string;
|
|
6
|
+
/** Published now, not in the file. */
|
|
7
|
+
added: string[];
|
|
8
|
+
/** In the file, not published now. */
|
|
9
|
+
removed: string[];
|
|
10
|
+
/** The file's own date or version now, when it has one. */
|
|
11
|
+
version?: string;
|
|
12
|
+
ours: number;
|
|
13
|
+
theirs: number;
|
|
14
|
+
/** Why it could not be compared. */
|
|
15
|
+
error?: string;
|
|
16
|
+
};
|
|
17
|
+
/** The URL `ranges-check` reads - the Markdown of a docs page, where it has one. */
|
|
18
|
+
export declare const fetchUrlOf: (s: RangeSource) => string;
|
|
19
|
+
/**
|
|
20
|
+
* The ranges a source publishes, from what its URL answered - or an Error.
|
|
21
|
+
*
|
|
22
|
+
* ⚠️ ANTHROPIC'S PAGE: ONLY THE `### IPv4` / `### IPv6` LISTS UNDER ITS
|
|
23
|
+
* OUTBOUND SECTION - not its inbound section (where its API is reached: a
|
|
24
|
+
* range read from there would let in a block nobody calls from), and not its
|
|
25
|
+
* phased-out list, whatever that is called next (audit P3-11).
|
|
26
|
+
*
|
|
27
|
+
* ⚠️ A SOURCE THAT LISTS NOTHING WAS NOT READ: an empty list is an error (exit
|
|
28
|
+
* 2), not every range removed (audit P3-11).
|
|
29
|
+
*/
|
|
30
|
+
export declare const parsePublished: (s: RangeSource, body: string) => string[];
|
|
31
|
+
/** One source compared with what it publishes now. */
|
|
32
|
+
export declare const compareSource: (platform: string, s: RangeSource, published: string[], version?: string) => SourceDiff;
|
|
33
|
+
/** Every source of every platform, read again and compared. */
|
|
34
|
+
export declare const checkRanges: (doFetch?: typeof fetch, platforms?: readonly PlatformRanges[]) => Promise<SourceDiff[]>;
|
|
35
|
+
/** The exit code for a comparison: 0 the same, 1 something differs, 2 something unread. */
|
|
36
|
+
export declare const exitCodeOf: (diffs: SourceDiff[]) => 0 | 1 | 2;
|
|
37
|
+
/** The report a person reads. */
|
|
38
|
+
export declare const reportOf: (diffs: SourceDiff[], platforms?: readonly PlatformRanges[]) => string;
|
|
39
|
+
//# sourceMappingURL=ranges-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ranges-check.d.ts","sourceRoot":"","sources":["../src/ranges-check.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAgB5F,4BAA4B;AAC5B,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,sCAAsC;IACtC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,sCAAsC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAQF,oFAAoF;AACpF,eAAO,MAAM,UAAU,GAAI,GAAG,WAAW,KAAG,MACc,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,GAAG,WAAW,EAAE,MAAM,MAAM,KAAG,MAAM,EAwBnE,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,aAAa,GACxB,UAAU,MAAM,EAChB,GAAG,WAAW,EACd,WAAW,MAAM,EAAE,EACnB,UAAU,MAAM,KACf,UAuBF,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,WAAW,GACtB,UAAS,OAAO,KAAa,EAC7B,YAAW,SAAS,cAAc,EAAoB,KACrD,OAAO,CAAC,UAAU,EAAE,CA8BtB,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,UAAU,GAAI,OAAO,UAAU,EAAE,KAAG,CAAC,GAAG,CAAC,GAAG,CAKhD,CAAC;AAEV,iCAAiC;AACjC,eAAO,MAAM,QAAQ,GACnB,OAAO,UAAU,EAAE,EACnB,YAAW,SAAS,cAAc,EAAoB,KACrD,MAqBF,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { parseCidr } from './cidr.js';
|
|
2
|
+
import { PLATFORM_RANGES } from './source-ranges.js';
|
|
3
|
+
/** A range written the one way it compares: its network and prefix, read by cidr.ts. */
|
|
4
|
+
const canonical = (raw) => {
|
|
5
|
+
const c = parseCidr(raw);
|
|
6
|
+
return c ? `${c.v}:${c.net.toString(16)}/${c.bits}` : undefined;
|
|
7
|
+
};
|
|
8
|
+
/** The URL `ranges-check` reads - the Markdown of a docs page, where it has one. */
|
|
9
|
+
export const fetchUrlOf = (s) => s.format === 'anthropic-ip-page' ? `${s.url}.md` : s.url;
|
|
10
|
+
/**
|
|
11
|
+
* The ranges a source publishes, from what its URL answered - or an Error.
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ ANTHROPIC'S PAGE: ONLY THE `### IPv4` / `### IPv6` LISTS UNDER ITS
|
|
14
|
+
* OUTBOUND SECTION - not its inbound section (where its API is reached: a
|
|
15
|
+
* range read from there would let in a block nobody calls from), and not its
|
|
16
|
+
* phased-out list, whatever that is called next (audit P3-11).
|
|
17
|
+
*
|
|
18
|
+
* ⚠️ A SOURCE THAT LISTS NOTHING WAS NOT READ: an empty list is an error (exit
|
|
19
|
+
* 2), not every range removed (audit P3-11).
|
|
20
|
+
*/
|
|
21
|
+
export const parsePublished = (s, body) => {
|
|
22
|
+
if (s.format === 'openai-prefixes-json') {
|
|
23
|
+
const json = JSON.parse(body);
|
|
24
|
+
if (!Array.isArray(json.prefixes))
|
|
25
|
+
throw new Error('no "prefixes" in the file');
|
|
26
|
+
const listed = json.prefixes
|
|
27
|
+
.map((p) => p.ipv4Prefix ?? p.ipv6Prefix)
|
|
28
|
+
.filter((x) => typeof x === 'string');
|
|
29
|
+
if (!listed.length)
|
|
30
|
+
throw new Error('"prefixes" lists no range');
|
|
31
|
+
return listed;
|
|
32
|
+
}
|
|
33
|
+
const start = body.search(/^##\s+Outbound IP addresses\s*$/m);
|
|
34
|
+
if (start < 0)
|
|
35
|
+
throw new Error('no "## Outbound IP addresses" heading on the page');
|
|
36
|
+
const rest = body.slice(start).replace(/^##\s+Outbound[^\n]*\n/, '');
|
|
37
|
+
const next = rest.search(/^##\s/m);
|
|
38
|
+
const section = next < 0 ? rest : rest.slice(0, next);
|
|
39
|
+
// Each `### IPv4` / `### IPv6` list, to the next heading of any level.
|
|
40
|
+
const found = [
|
|
41
|
+
...section.matchAll(/^###\s+IPv[46]\s*$([\s\S]*?)(?=^#{1,6}\s|(?![\s\S]))/gm),
|
|
42
|
+
].flatMap((m) => [...(m[1] ?? '').matchAll(/`([0-9a-fA-F:.]+\/\d{1,3})`/g)].map((r) => r[1]));
|
|
43
|
+
if (!found.length)
|
|
44
|
+
throw new Error('no ranges under "Outbound IP addresses" / "### IPv4" or "### IPv6"');
|
|
45
|
+
return found;
|
|
46
|
+
};
|
|
47
|
+
/** One source compared with what it publishes now. */
|
|
48
|
+
export const compareSource = (platform, s, published, version) => {
|
|
49
|
+
const theirs = new Map();
|
|
50
|
+
const bad = [];
|
|
51
|
+
for (const raw of published) {
|
|
52
|
+
const k = canonical(raw);
|
|
53
|
+
if (k)
|
|
54
|
+
theirs.set(k, raw);
|
|
55
|
+
else
|
|
56
|
+
bad.push(raw);
|
|
57
|
+
}
|
|
58
|
+
const ours = new Map(s.cidrs.map((raw) => [canonical(raw) ?? raw, raw]));
|
|
59
|
+
return {
|
|
60
|
+
platform,
|
|
61
|
+
url: s.url,
|
|
62
|
+
added: [...theirs].filter(([k]) => !ours.has(k)).map(([, raw]) => raw),
|
|
63
|
+
removed: [...ours].filter(([k]) => !theirs.has(k)).map(([, raw]) => raw),
|
|
64
|
+
...(version ? { version } : {}),
|
|
65
|
+
ours: ours.size,
|
|
66
|
+
theirs: theirs.size,
|
|
67
|
+
...(bad.length
|
|
68
|
+
? {
|
|
69
|
+
error: `published ranges not written exactly, left out of the comparison: ${bad.join(', ')}`,
|
|
70
|
+
}
|
|
71
|
+
: {}),
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
/** Every source of every platform, read again and compared. */
|
|
75
|
+
export const checkRanges = async (doFetch = fetch, platforms = PLATFORM_RANGES) => {
|
|
76
|
+
const out = [];
|
|
77
|
+
for (const p of platforms) {
|
|
78
|
+
for (const s of p.sources) {
|
|
79
|
+
try {
|
|
80
|
+
const res = await doFetch(fetchUrlOf(s), {
|
|
81
|
+
headers: { 'user-agent': 'hotel-storefront-ranges-check' },
|
|
82
|
+
signal: AbortSignal.timeout(20_000),
|
|
83
|
+
});
|
|
84
|
+
if (!res.ok)
|
|
85
|
+
throw new Error(`HTTP ${res.status}`);
|
|
86
|
+
const body = await res.text();
|
|
87
|
+
const version = s.format === 'openai-prefixes-json'
|
|
88
|
+
? JSON.parse(body).creationTime
|
|
89
|
+
: undefined;
|
|
90
|
+
out.push(compareSource(p.id, s, parsePublished(s, body), version));
|
|
91
|
+
}
|
|
92
|
+
catch (e) {
|
|
93
|
+
out.push({
|
|
94
|
+
platform: p.id,
|
|
95
|
+
url: s.url,
|
|
96
|
+
added: [],
|
|
97
|
+
removed: [],
|
|
98
|
+
ours: s.cidrs.length,
|
|
99
|
+
theirs: 0,
|
|
100
|
+
error: e instanceof Error ? e.message : String(e),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return out;
|
|
106
|
+
};
|
|
107
|
+
/** The exit code for a comparison: 0 the same, 1 something differs, 2 something unread. */
|
|
108
|
+
export const exitCodeOf = (diffs) => diffs.some((d) => d.error && d.theirs === 0)
|
|
109
|
+
? 2
|
|
110
|
+
: diffs.some((d) => d.added.length || d.removed.length || d.error)
|
|
111
|
+
? 1
|
|
112
|
+
: 0;
|
|
113
|
+
/** The report a person reads. */
|
|
114
|
+
export const reportOf = (diffs, platforms = PLATFORM_RANGES) => {
|
|
115
|
+
const lines = [];
|
|
116
|
+
for (const d of diffs) {
|
|
117
|
+
const s = platforms.find((p) => p.id === d.platform)?.sources.find((x) => x.url === d.url);
|
|
118
|
+
lines.push(`${d.platform} ${d.url}`);
|
|
119
|
+
if (d.version || s?.version) {
|
|
120
|
+
lines.push(` version: published ${d.version ?? '?'}, ours ${s?.version ?? '-'}`);
|
|
121
|
+
}
|
|
122
|
+
if (d.error)
|
|
123
|
+
lines.push(` ⚠️ ${d.error}`);
|
|
124
|
+
if (!d.added.length && !d.removed.length && !(d.error && d.theirs === 0)) {
|
|
125
|
+
lines.push(` same (${d.ours} ranges)`);
|
|
126
|
+
}
|
|
127
|
+
for (const a of d.added)
|
|
128
|
+
lines.push(` + ${a} published now, not in source-ranges.ts`);
|
|
129
|
+
for (const r of d.removed)
|
|
130
|
+
lines.push(` - ${r} in source-ranges.ts, no longer published`);
|
|
131
|
+
}
|
|
132
|
+
for (const p of platforms.filter((x) => x.unpublished)) {
|
|
133
|
+
lines.push(`${p.id} no published ranges (looked ${p.unpublished?.checked}) - nothing to compare; look again by hand: ${p.unpublished?.looked.join(' ')}`);
|
|
134
|
+
}
|
|
135
|
+
return lines.join('\n');
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=ranges-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ranges-check.js","sourceRoot":"","sources":["../src/ranges-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,eAAe,EAAyC,MAAM,oBAAoB,CAAC;AAgC5F,wFAAwF;AACxF,MAAM,SAAS,GAAG,CAAC,GAAW,EAAsB,EAAE;IACpD,MAAM,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;IACzB,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,C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,KAAK,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;YACzE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC;QAC1C,CAAC;QACD,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK;YAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,2CAA2C,CAAC,CAAC;QACzF,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO;YAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,6CAA6C,CAAC,CAAC;IAC/F,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC;QACvD,KAAK,CAAC,IAAI,CACR,GAAG,CAAC,CAAC,EAAE,iCAAiC,CAAC,CAAC,WAAW,EAAE,OAAO,+CAA+C,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAC/I,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Hono } from 'hono';
|
|
|
2
2
|
import type { HotelConfig } from './config.js';
|
|
3
3
|
import { MemberStore } from './members.js';
|
|
4
4
|
import { Sessions } from './sessions.js';
|
|
5
|
+
import { type SourceAllowlist } from './source-allowlist.js';
|
|
5
6
|
import { type BrandFonts, type ToolDeps } from './tools.js';
|
|
6
7
|
import { TripIds } from './trip-ids.js';
|
|
7
8
|
import { TripStore } from './trip.js';
|
|
@@ -29,7 +30,7 @@ export declare const INITIALIZE_PER_MINUTE = 300;
|
|
|
29
30
|
* number. Found by reading the boot banner of a container that had just been
|
|
30
31
|
* deployed (2026-09-22): seventeen tools listed, and "0.7.0" above them.
|
|
31
32
|
*/
|
|
32
|
-
export declare const VERSION = "0.
|
|
33
|
+
export declare const VERSION = "0.69.0";
|
|
33
34
|
/**
|
|
34
35
|
* The card's resource URI.
|
|
35
36
|
*
|
|
@@ -192,6 +193,8 @@ export type BuiltServer = {
|
|
|
192
193
|
members: MemberStore;
|
|
193
194
|
tripIds: TripIds;
|
|
194
195
|
sessions: Sessions;
|
|
196
|
+
/** Who may reach /mcp, where the deployment limits it - see source-allowlist.ts. */
|
|
197
|
+
sources?: SourceAllowlist;
|
|
195
198
|
/** Whatever the stores have not written yet, written now - on a clean stop. */
|
|
196
199
|
flush: () => void;
|
|
197
200
|
/**
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAYA,OAAO,EAAgB,IAAI,EAAE,MAAM,MAAM,CAAC;AAO1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,EAAE,QAAQ,EAAe,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAYA,OAAO,EAAgB,IAAI,EAAE,MAAM,MAAM,CAAC;AAO1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,EAAE,QAAQ,EAAe,MAAM,eAAe,CAAC;AACtD,OAAO,EAEL,KAAK,eAAe,EAIrB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,QAAQ,EAad,MAAM,YAAY,CAAC;AACpB,OAAO,EAA4C,OAAO,EAAa,MAAM,eAAe,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAW,MAAM,WAAW,CAAC;AAC/C,OAAO,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IACnF,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB,qHAAqH;IACrH,YAAY,CAAC,EAAE,OAAO,KAAK,CAAC;IAC5B,8EAA8E;IAC9E,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAoBF,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,eAAO,MAAM,WAAW,GAAI,MAAM,aAAa,KAAG,WAi/CjD,CAAC;AAmCF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,IAAI,MAAM,KAAG,MACyK,CAAC;AAGxN,6GAA6G;AAC7G,eAAO,MAAM,mBAAmB,sMACqK,CAAC;AA0BtM,iFAAiF;AACjF,eAAO,MAAM,YAAY,6PACmO,CAAC;AAiD7P,8FAA8F;AAC9F,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,iGAAiG;AACjG,eAAO,MAAM,WAAW,MAAM,CAAC;AAc/B,eAAO,MAAM,QAAQ,GAAI,QAAQ,MAAM,GAAG,SAAS,KAAG,MAAM,GAAG,SAG9D,CAAC;AAEF,yFAAyF;AACzF,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CASlF,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -16,6 +16,7 @@ import { MemberStore } from './members.js';
|
|
|
16
16
|
import { paidAnswer } from './paid.js';
|
|
17
17
|
import { PICTURES_PATH, PictureStore, picturesAs } from './pictures.js';
|
|
18
18
|
import { Sessions, cardSupport } from './sessions.js';
|
|
19
|
+
import { REFUSED_SAID, checkSourceAllowlist, makeSourceAllowlist, sourceAddress, } from './source-allowlist.js';
|
|
19
20
|
import { StateDir } from './state.js';
|
|
20
21
|
import { makeSupplier } from './supplier.js';
|
|
21
22
|
import { buildInstructions, listTools, tripToolNames } from './surface.js';
|
|
@@ -51,7 +52,7 @@ export const INITIALIZE_PER_MINUTE = 300;
|
|
|
51
52
|
* number. Found by reading the boot banner of a container that had just been
|
|
52
53
|
* deployed (2026-09-22): seventeen tools listed, and "0.7.0" above them.
|
|
53
54
|
*/
|
|
54
|
-
export const VERSION = '0.
|
|
55
|
+
export const VERSION = '0.69.0';
|
|
55
56
|
/**
|
|
56
57
|
* The card's resource URI.
|
|
57
58
|
*
|
|
@@ -310,6 +311,8 @@ export const buildServer = (opts) => {
|
|
|
310
311
|
const config = opts.config;
|
|
311
312
|
const brand = resolveBrand(config);
|
|
312
313
|
const now = opts.now ?? (() => Date.now());
|
|
314
|
+
// Before anything else is built: an allowlist written wrong stops the start.
|
|
315
|
+
const sources = makeSourceAllowlist(config.sourceAllowlist, opts.env ?? process.env, { now });
|
|
313
316
|
const publicUrl = (opts.publicUrl ?? config.urls.publicUrl ?? config.urls.appUrl).replace(/\/$/, '');
|
|
314
317
|
const state = new StateDir(stateDirOf(config, opts));
|
|
315
318
|
/**
|
|
@@ -846,7 +849,7 @@ export const buildServer = (opts) => {
|
|
|
846
849
|
// …or the membership sign-in's /login, where members sign in (0.58.0).
|
|
847
850
|
memberLogin?.mount(app);
|
|
848
851
|
app.get('/docs', (c) => c.html(docsPage(config, caps)));
|
|
849
|
-
app.get('/privacy', (c) => c.html(privacyPage(config, [...new Set([...made.imageDomains(), ...(homeFrom ? [homeFrom] : [])])], caps, state.persisted)));
|
|
852
|
+
app.get('/privacy', (c) => c.html(privacyPage(config, [...new Set([...made.imageDomains(), ...(homeFrom ? [homeFrom] : [])])], caps, state.persisted, sources !== undefined)));
|
|
850
853
|
app.get('/terms', (c) => c.html(termsPage(config, caps)));
|
|
851
854
|
// Where a guest lands from the payment page, paid (robin, 2026-10-15) - see
|
|
852
855
|
// paid.ts. Only where something is paid in advance: the backend's
|
|
@@ -906,6 +909,8 @@ export const buildServer = (opts) => {
|
|
|
906
909
|
...made.health(),
|
|
907
910
|
...(account?.health() ?? {}),
|
|
908
911
|
...(memberLogin?.health() ?? {}),
|
|
912
|
+
// New sessions by platform, and who came from elsewhere (by network only).
|
|
913
|
+
...(sources ? { sourceAllowlist: sources.health() } : {}),
|
|
909
914
|
// ⚠️ A store that cannot write is a person's job - see state.ts.
|
|
910
915
|
...(Object.keys(stateTrouble).length ? { stateTrouble } : {}),
|
|
911
916
|
...(pictures.trouble ? { picturesTrouble: pictures.trouble } : {}),
|
|
@@ -936,6 +941,22 @@ export const buildServer = (opts) => {
|
|
|
936
941
|
// asked for: behind Caddy that is /shangrila, no trailing slash, so it landed
|
|
937
942
|
// on the host's own /docs - a 404 (2026-10-07).
|
|
938
943
|
app.get('/', (c) => c.redirect(`${publicUrl}/docs`, 302));
|
|
944
|
+
// ⚠️ /mcp ONLY, EVERY METHOD, BEFORE ITS HANDLERS - see source-allowlist.ts.
|
|
945
|
+
// Under enforce, a request from anywhere but an allowed platform is answered
|
|
946
|
+
// here, its body never read. Under shadow nothing is refused: `initialize`
|
|
947
|
+
// logs the verdict, below.
|
|
948
|
+
if (sources?.mode === 'enforce') {
|
|
949
|
+
app.use('/mcp', async (c, next) => {
|
|
950
|
+
const ip = sourceOf(c);
|
|
951
|
+
const verdict = sources.judge(ip);
|
|
952
|
+
if (verdict.allowed)
|
|
953
|
+
return next();
|
|
954
|
+
sources.noteRefused(ip, verdict, c.req.header('user-agent'));
|
|
955
|
+
return c.json({ jsonrpc: '2.0', id: null, error: { code: -32001, message: REFUSED_SAID } }, 403, {
|
|
956
|
+
'cache-control': 'no-store',
|
|
957
|
+
});
|
|
958
|
+
});
|
|
959
|
+
}
|
|
939
960
|
// No sessions are ended on request: they lapse (sessions.ts). 405 is the
|
|
940
961
|
// spec's word for that - 404 read as "no MCP server here" (2026-10-05 audit, P3).
|
|
941
962
|
app.delete('/mcp', (c) => c.body(null, 405, { Allow: 'GET, POST' }));
|
|
@@ -992,6 +1013,14 @@ export const buildServer = (opts) => {
|
|
|
992
1013
|
// since 0.67.0), so the lines of one connection can be followed.
|
|
993
1014
|
console.log(`[mcp] initialize client=${printable(typeof client === 'string' ? client : '-', 60)} cards=${cards} s=${h8(sessionId)}`);
|
|
994
1015
|
noteHeaders(c, 'initialize', typeof client === 'string' ? client : undefined, '');
|
|
1016
|
+
// Where it came from, once a session (source-allowlist.ts) - only where
|
|
1017
|
+
// the deployment limits it; elsewhere no address is logged, as before.
|
|
1018
|
+
const source = sources ? sourceOf(c) : undefined;
|
|
1019
|
+
sources?.noteSession(source, sources.judge(source), {
|
|
1020
|
+
...(typeof client === 'string' ? { client } : {}),
|
|
1021
|
+
...(c.req.header('user-agent') ? { ua: c.req.header('user-agent') } : {}),
|
|
1022
|
+
session: h8(sessionId),
|
|
1023
|
+
});
|
|
995
1024
|
c.header('Mcp-Session-Id', sessionId);
|
|
996
1025
|
return ok(c, id, {
|
|
997
1026
|
protocolVersion: PROTOCOL_VERSION,
|
|
@@ -1638,6 +1667,7 @@ export const buildServer = (opts) => {
|
|
|
1638
1667
|
members,
|
|
1639
1668
|
tripIds,
|
|
1640
1669
|
sessions,
|
|
1670
|
+
...(sources ? { sources } : {}),
|
|
1641
1671
|
flush: () => state.flush(),
|
|
1642
1672
|
drain: () => made.drain?.() ?? Promise.resolve(),
|
|
1643
1673
|
};
|
|
@@ -1736,6 +1766,13 @@ const headerNames = (c) => {
|
|
|
1736
1766
|
export const HEADER_LOGS_PER_APP = 5;
|
|
1737
1767
|
/** Apps whose header names are logged at all, by where - past it, a new name is not (0.67.0). */
|
|
1738
1768
|
export const HEADER_APPS = 200;
|
|
1769
|
+
/**
|
|
1770
|
+
* Where a request came from, for the allowlist (source-allowlist.ts
|
|
1771
|
+
* `sourceAddress`): the connection's own address when that is public - nothing
|
|
1772
|
+
* stood in front of us to write the header - and `clientIp` otherwise.
|
|
1773
|
+
*/
|
|
1774
|
+
const sourceOf = (c) => sourceAddress(clientIp(c.req.header('x-forwarded-for')), c.env?.incoming?.socket
|
|
1775
|
+
?.remoteAddress);
|
|
1739
1776
|
export const clientIp = (header) => {
|
|
1740
1777
|
const last = (header ?? '').split(',').at(-1)?.trim();
|
|
1741
1778
|
return last || undefined;
|
|
@@ -1747,6 +1784,8 @@ export const loadConfig = (path) => {
|
|
|
1747
1784
|
// The demonstration's own switches (`data.invented`, `data.capabilities`)
|
|
1748
1785
|
// are refused here, at start, not found out by a tool that is missing.
|
|
1749
1786
|
checkDemoData(config.data);
|
|
1787
|
+
// …and so is an allowlist written wrong (a brand's own tests load it here).
|
|
1788
|
+
checkSourceAllowlist(config.sourceAllowlist);
|
|
1750
1789
|
return { config, configPath };
|
|
1751
1790
|
};
|
|
1752
1791
|
//# sourceMappingURL=server.js.map
|