@usestratus/mcp-aws 0.1.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 +610 -0
- package/dist/auth/api-key.d.ts +29 -0
- package/dist/auth/api-key.d.ts.map +1 -0
- package/dist/auth/api-key.js +42 -0
- package/dist/auth/api-key.js.map +1 -0
- package/dist/auth/cognito.d.ts +26 -0
- package/dist/auth/cognito.d.ts.map +1 -0
- package/dist/auth/cognito.js +58 -0
- package/dist/auth/cognito.js.map +1 -0
- package/dist/auth/index.d.ts +11 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +21 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/metadata.d.ts +30 -0
- package/dist/auth/metadata.d.ts.map +1 -0
- package/dist/auth/metadata.js +25 -0
- package/dist/auth/metadata.js.map +1 -0
- package/dist/auth/types.d.ts +8 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +2 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/codemode/executor.d.ts +29 -0
- package/dist/codemode/executor.d.ts.map +1 -0
- package/dist/codemode/executor.js +154 -0
- package/dist/codemode/executor.js.map +1 -0
- package/dist/codemode/index.d.ts +4 -0
- package/dist/codemode/index.d.ts.map +1 -0
- package/dist/codemode/index.js +3 -0
- package/dist/codemode/index.js.map +1 -0
- package/dist/codemode/types.d.ts +10 -0
- package/dist/codemode/types.d.ts.map +1 -0
- package/dist/codemode/types.js +195 -0
- package/dist/codemode/types.js.map +1 -0
- package/dist/compose.d.ts +57 -0
- package/dist/compose.d.ts.map +1 -0
- package/dist/compose.js +138 -0
- package/dist/compose.js.map +1 -0
- package/dist/context.d.ts +22 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +39 -0
- package/dist/context.js.map +1 -0
- package/dist/deploy.d.ts +57 -0
- package/dist/deploy.d.ts.map +1 -0
- package/dist/deploy.js +281 -0
- package/dist/deploy.js.map +1 -0
- package/dist/disclosure/index.d.ts +3 -0
- package/dist/disclosure/index.d.ts.map +1 -0
- package/dist/disclosure/index.js +3 -0
- package/dist/disclosure/index.js.map +1 -0
- package/dist/disclosure/search.d.ts +15 -0
- package/dist/disclosure/search.d.ts.map +1 -0
- package/dist/disclosure/search.js +73 -0
- package/dist/disclosure/search.js.map +1 -0
- package/dist/disclosure/tier.d.ts +16 -0
- package/dist/disclosure/tier.d.ts.map +1 -0
- package/dist/disclosure/tier.js +69 -0
- package/dist/disclosure/tier.js.map +1 -0
- package/dist/errors.d.ts +34 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +56 -0
- package/dist/errors.js.map +1 -0
- package/dist/events.d.ts +93 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +28 -0
- package/dist/events.js.map +1 -0
- package/dist/gating/combinators.d.ts +10 -0
- package/dist/gating/combinators.d.ts.map +1 -0
- package/dist/gating/combinators.js +34 -0
- package/dist/gating/combinators.js.map +1 -0
- package/dist/gating/gates.d.ts +21 -0
- package/dist/gating/gates.d.ts.map +1 -0
- package/dist/gating/gates.js +74 -0
- package/dist/gating/gates.js.map +1 -0
- package/dist/gating/index.d.ts +3 -0
- package/dist/gating/index.d.ts.map +1 -0
- package/dist/gating/index.js +3 -0
- package/dist/gating/index.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +161 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +768 -0
- package/dist/server.js.map +1 -0
- package/dist/session/dynamo.d.ts +23 -0
- package/dist/session/dynamo.d.ts.map +1 -0
- package/dist/session/dynamo.js +92 -0
- package/dist/session/dynamo.js.map +1 -0
- package/dist/session/index.d.ts +4 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +4 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/memory.d.ts +16 -0
- package/dist/session/memory.d.ts.map +1 -0
- package/dist/session/memory.js +43 -0
- package/dist/session/memory.js.map +1 -0
- package/dist/session/sqlite.d.ts +17 -0
- package/dist/session/sqlite.d.ts.map +1 -0
- package/dist/session/sqlite.js +79 -0
- package/dist/session/sqlite.js.map +1 -0
- package/dist/ssrf.d.ts +25 -0
- package/dist/ssrf.d.ts.map +1 -0
- package/dist/ssrf.js +88 -0
- package/dist/ssrf.js.map +1 -0
- package/dist/types.d.ts +110 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +21 -0
- package/dist/types.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ToolConfig } from "../types.js";
|
|
2
|
+
export type SearchResult = {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
score: number;
|
|
6
|
+
tags: string[];
|
|
7
|
+
};
|
|
8
|
+
export declare class SearchIndex {
|
|
9
|
+
private readonly entries;
|
|
10
|
+
private readonly docFrequencies;
|
|
11
|
+
private avgDocLength;
|
|
12
|
+
build(tools: ToolConfig[]): void;
|
|
13
|
+
search(query: string, maxResults?: number): SearchResult[];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/disclosure/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,EAAE,CAAC;CACf,CAAC;AAmBF,qBAAa,WAAW;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6B;IAC5D,OAAO,CAAC,YAAY,CAAK;IAEzB,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,IAAI;IAmChC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,SAAK,GAAG,YAAY,EAAE;CAsCtD"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
function tokenize(text) {
|
|
2
|
+
return text
|
|
3
|
+
.toLowerCase()
|
|
4
|
+
.replace(/[^a-z0-9\s]/g, " ")
|
|
5
|
+
.split(/\s+/)
|
|
6
|
+
.filter((t) => t.length > 1);
|
|
7
|
+
}
|
|
8
|
+
export class SearchIndex {
|
|
9
|
+
entries = [];
|
|
10
|
+
docFrequencies = new Map();
|
|
11
|
+
avgDocLength = 0;
|
|
12
|
+
build(tools) {
|
|
13
|
+
this.entries.length = 0;
|
|
14
|
+
this.docFrequencies.clear();
|
|
15
|
+
for (const tool of tools) {
|
|
16
|
+
const parts = [tool.name, tool.description, ...(tool.tags ?? [])];
|
|
17
|
+
const terms = tokenize(parts.join(" "));
|
|
18
|
+
const tf = new Map();
|
|
19
|
+
for (const term of terms) {
|
|
20
|
+
tf.set(term, (tf.get(term) ?? 0) + 1);
|
|
21
|
+
}
|
|
22
|
+
this.entries.push({
|
|
23
|
+
name: tool.name,
|
|
24
|
+
description: tool.description,
|
|
25
|
+
tags: tool.tags ?? [],
|
|
26
|
+
terms,
|
|
27
|
+
termFrequencies: tf,
|
|
28
|
+
length: terms.length,
|
|
29
|
+
});
|
|
30
|
+
const seen = new Set();
|
|
31
|
+
for (const term of terms) {
|
|
32
|
+
if (!seen.has(term)) {
|
|
33
|
+
seen.add(term);
|
|
34
|
+
this.docFrequencies.set(term, (this.docFrequencies.get(term) ?? 0) + 1);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const total = this.entries.reduce((sum, e) => sum + e.length, 0);
|
|
39
|
+
this.avgDocLength = this.entries.length > 0 ? total / this.entries.length : 0;
|
|
40
|
+
}
|
|
41
|
+
search(query, maxResults = 10) {
|
|
42
|
+
const queryTerms = tokenize(query);
|
|
43
|
+
if (queryTerms.length === 0 || this.entries.length === 0)
|
|
44
|
+
return [];
|
|
45
|
+
const n = this.entries.length;
|
|
46
|
+
const k1 = 1.5;
|
|
47
|
+
const b = 0.75;
|
|
48
|
+
const scored = [];
|
|
49
|
+
for (const entry of this.entries) {
|
|
50
|
+
let score = 0;
|
|
51
|
+
for (const term of queryTerms) {
|
|
52
|
+
const tf = entry.termFrequencies.get(term) ?? 0;
|
|
53
|
+
if (tf === 0)
|
|
54
|
+
continue;
|
|
55
|
+
const df = this.docFrequencies.get(term) ?? 0;
|
|
56
|
+
const idf = Math.log((n - df + 0.5) / (df + 0.5) + 1);
|
|
57
|
+
const tfNorm = (tf * (k1 + 1)) / (tf + k1 * (1 - b + (b * entry.length) / this.avgDocLength));
|
|
58
|
+
score += idf * tfNorm;
|
|
59
|
+
}
|
|
60
|
+
if (score > 0) {
|
|
61
|
+
scored.push({ entry, score });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
scored.sort((a, b) => b.score - a.score);
|
|
65
|
+
return scored.slice(0, maxResults).map((s) => ({
|
|
66
|
+
name: s.entry.name,
|
|
67
|
+
description: s.entry.description,
|
|
68
|
+
score: s.score,
|
|
69
|
+
tags: s.entry.tags,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../src/disclosure/search.ts"],"names":[],"mappings":"AAkBA,SAAS,QAAQ,CAAC,IAAY;IAC7B,OAAO,IAAI;SACT,WAAW,EAAE;SACb,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;SAC5B,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,OAAO,WAAW;IACN,OAAO,GAAiB,EA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CAAC,CAAC;gBAC9C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;gBAEtD,MAAM,MAAM,GACX,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;gBAChF,KAAK,IAAI,GAAG,GAAG,MAAM,CAAC;YACvB,CAAC;YAED,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;gBACf,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YAC/B,CAAC;QACF,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QAEzC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC9C,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI;YAClB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW;YAChC,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI;SAClB,CAAC,CAAC,CAAC;IACL,CAAC;CACD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { McpSession, ToolConfig } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Returns tools visible to this session based on tier and promotions.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getVisibleTools(allTools: Map<string, ToolConfig>, session: McpSession): ToolConfig[];
|
|
6
|
+
/**
|
|
7
|
+
* Promotes a tool to the session's visible set.
|
|
8
|
+
* Returns true if the tool was newly promoted.
|
|
9
|
+
*/
|
|
10
|
+
export declare function promoteToVisible(session: McpSession, toolName: string): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Unlocks a gate and promotes hidden tools whose gate depends on it.
|
|
13
|
+
* Returns the names of newly promoted tools.
|
|
14
|
+
*/
|
|
15
|
+
export declare function handleGateUnlock(allTools: Map<string, ToolConfig>, session: McpSession, gateName: string): string[];
|
|
16
|
+
//# sourceMappingURL=tier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tier.d.ts","sourceRoot":"","sources":["../../src/disclosure/tier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE1D;;GAEG;AACH,wBAAgB,eAAe,CAC9B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACjC,OAAO,EAAE,UAAU,GACjB,UAAU,EAAE,CAQd;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAI/E;AAmCD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EACjC,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,MAAM,GACd,MAAM,EAAE,CAcV"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns tools visible to this session based on tier and promotions.
|
|
3
|
+
*/
|
|
4
|
+
export function getVisibleTools(allTools, session) {
|
|
5
|
+
const results = [];
|
|
6
|
+
for (const tool of allTools.values()) {
|
|
7
|
+
if (tool.tier === "always" || session.visibleTools.has(tool.name)) {
|
|
8
|
+
results.push(tool);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return results;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Promotes a tool to the session's visible set.
|
|
15
|
+
* Returns true if the tool was newly promoted.
|
|
16
|
+
*/
|
|
17
|
+
export function promoteToVisible(session, toolName) {
|
|
18
|
+
if (session.visibleTools.has(toolName))
|
|
19
|
+
return false;
|
|
20
|
+
session.visibleTools.add(toolName);
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Check if a tool's gate is (or wraps) a `requires()` gate matching the given name.
|
|
25
|
+
* We detect this by calling the gate with the prerequisite in `unlockedGates` and without.
|
|
26
|
+
* If the gate passes with it and fails without it, the gate depends on this prerequisite.
|
|
27
|
+
*/
|
|
28
|
+
function gateMatchesPrerequisite(tool, gateName) {
|
|
29
|
+
if (!tool.gate)
|
|
30
|
+
return false;
|
|
31
|
+
// Synchronous heuristic: call the gate with and without the prerequisite.
|
|
32
|
+
// requires() gates are synchronous, so this works for the common case.
|
|
33
|
+
const baseCtx = {
|
|
34
|
+
auth: { authenticated: false, roles: [], claims: {} },
|
|
35
|
+
toolName: tool.name,
|
|
36
|
+
sessionId: "check",
|
|
37
|
+
metadata: { unlockedGates: new Set() },
|
|
38
|
+
};
|
|
39
|
+
const withCtx = {
|
|
40
|
+
...baseCtx,
|
|
41
|
+
metadata: { unlockedGates: new Set([gateName]) },
|
|
42
|
+
};
|
|
43
|
+
const withoutResult = tool.gate(baseCtx);
|
|
44
|
+
const withResult = tool.gate(withCtx);
|
|
45
|
+
// Both should be synchronous GateResult for requires() gates
|
|
46
|
+
if (withoutResult instanceof Promise || withResult instanceof Promise) {
|
|
47
|
+
// Async gates can't be checked synchronously — default to deny (don't promote)
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return !withoutResult.allowed && withResult.allowed;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Unlocks a gate and promotes hidden tools whose gate depends on it.
|
|
54
|
+
* Returns the names of newly promoted tools.
|
|
55
|
+
*/
|
|
56
|
+
export function handleGateUnlock(allTools, session, gateName) {
|
|
57
|
+
session.unlockedGates.add(gateName);
|
|
58
|
+
const promoted = [];
|
|
59
|
+
for (const tool of allTools.values()) {
|
|
60
|
+
if (tool.tier === "hidden" && !session.visibleTools.has(tool.name)) {
|
|
61
|
+
if (gateMatchesPrerequisite(tool, gateName)) {
|
|
62
|
+
session.visibleTools.add(tool.name);
|
|
63
|
+
promoted.push(tool.name);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return promoted;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=tier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tier.js","sourceRoot":"","sources":["../../src/disclosure/tier.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,eAAe,CAC9B,QAAiC,EACjC,OAAmB;IAEnB,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;QACtC,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACnE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;IACF,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAmB,EAAE,QAAgB;IACrE,IAAI,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IACrD,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnC,OAAO,IAAI,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,IAAgB,EAAE,QAAgB;IAClE,IAAI,CAAC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AAC,EAAE,CAAC;gBAC7C,OAAO,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACpC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1B,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Gate } from "./types.js";
|
|
2
|
+
export declare class McpAwsError extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
export declare class GateDeniedError extends McpAwsError {
|
|
6
|
+
readonly toolName: string;
|
|
7
|
+
readonly reason: string;
|
|
8
|
+
readonly hint?: string;
|
|
9
|
+
readonly gate?: Gate;
|
|
10
|
+
constructor(opts: {
|
|
11
|
+
toolName: string;
|
|
12
|
+
reason: string;
|
|
13
|
+
hint?: string;
|
|
14
|
+
gate?: Gate;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export declare class AuthenticationError extends McpAwsError {
|
|
18
|
+
constructor(message: string);
|
|
19
|
+
}
|
|
20
|
+
export declare class SessionNotFoundError extends McpAwsError {
|
|
21
|
+
readonly sessionId: string;
|
|
22
|
+
constructor(sessionId: string);
|
|
23
|
+
}
|
|
24
|
+
export declare class ToolExecutionError extends McpAwsError {
|
|
25
|
+
readonly toolName: string;
|
|
26
|
+
readonly cause: unknown;
|
|
27
|
+
constructor(toolName: string, cause: unknown);
|
|
28
|
+
}
|
|
29
|
+
export declare class ToolTimeoutError extends McpAwsError {
|
|
30
|
+
readonly toolName: string;
|
|
31
|
+
readonly timeoutMs: number;
|
|
32
|
+
constructor(toolName: string, timeoutMs: number);
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"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DeniedError extends McpAwsError {
|
|
8
|
+
toolName;
|
|
9
|
+
reason;
|
|
10
|
+
hint;
|
|
11
|
+
gate;
|
|
12
|
+
constructor(opts) {
|
|
13
|
+
super(`Gate denied for tool "${opts.toolName}": ${opts.reason}`);
|
|
14
|
+
this.name = "GateDeniedError";
|
|
15
|
+
this.toolName = opts.toolName;
|
|
16
|
+
this.reason = opts.reason;
|
|
17
|
+
this.hint = opts.hint;
|
|
18
|
+
this.gate = opts.gate;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export class AuthenticationError extends McpAwsError {
|
|
22
|
+
constructor(message) {
|
|
23
|
+
super(message);
|
|
24
|
+
this.name = "AuthenticationError";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export class SessionNotFoundError extends McpAwsError {
|
|
28
|
+
sessionId;
|
|
29
|
+
constructor(sessionId) {
|
|
30
|
+
super(`Session not found: ${sessionId}`);
|
|
31
|
+
this.name = "SessionNotFoundError";
|
|
32
|
+
this.sessionId = sessionId;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export class ToolExecutionError extends McpAwsError {
|
|
36
|
+
toolName;
|
|
37
|
+
cause;
|
|
38
|
+
constructor(toolName, cause) {
|
|
39
|
+
const message = cause instanceof Error ? cause.message : String(cause);
|
|
40
|
+
super(`Tool "${toolName}" execution failed: ${message}`);
|
|
41
|
+
this.name = "ToolExecutionError";
|
|
42
|
+
this.toolName = toolName;
|
|
43
|
+
this.cause = cause;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export class ToolTimeoutError extends McpAwsError {
|
|
47
|
+
toolName;
|
|
48
|
+
timeoutMs;
|
|
49
|
+
constructor(toolName, timeoutMs) {
|
|
50
|
+
super(`Tool "${toolName}" timed out after ${timeoutMs}ms`);
|
|
51
|
+
this.name = "ToolTimeoutError";
|
|
52
|
+
this.toolName = toolName;
|
|
53
|
+
this.timeoutMs = timeoutMs;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
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,CAAU;IAEjC,YAAY,QAAgB,EAAE,KAAc;QAC3C,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,KAAK,CAAC,SAAS,QAAQ,uBAAuB,OAAO,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;CACD;AAED,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IACvC,QAAQ,CAAS;IACjB,SAAS,CAAS;IAE3B,YAAY,QAAgB,EAAE,SAAiB;QAC9C,KAAK,CAAC,SAAS,QAAQ,qBAAqB,SAAS,IAAI,CAAC,CAAC;QAC3D,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;QAC/B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;CACD"}
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed observability events for MCP server lifecycle.
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* const server = new McpServer("my-server@1.0.0");
|
|
7
|
+
*
|
|
8
|
+
* server.on("tool:call", (e) => {
|
|
9
|
+
* console.log(`Tool ${e.toolName} called by ${e.auth.subject}`);
|
|
10
|
+
* });
|
|
11
|
+
*
|
|
12
|
+
* server.on("tool:result", (e) => {
|
|
13
|
+
* console.log(`Tool ${e.toolName} completed in ${e.durationMs}ms`);
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* server.on("auth:success", (e) => {
|
|
17
|
+
* console.log(`User ${e.auth.subject} authenticated`);
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
import type { AuthContext } from "./types.js";
|
|
22
|
+
export type McpEventMap = {
|
|
23
|
+
/** Emitted when a tool is called */
|
|
24
|
+
"tool:call": {
|
|
25
|
+
toolName: string;
|
|
26
|
+
params: unknown;
|
|
27
|
+
auth: AuthContext;
|
|
28
|
+
sessionId: string;
|
|
29
|
+
timestamp: number;
|
|
30
|
+
};
|
|
31
|
+
/** Emitted after a tool returns (success or error) */
|
|
32
|
+
"tool:result": {
|
|
33
|
+
toolName: string;
|
|
34
|
+
durationMs: number;
|
|
35
|
+
isError: boolean;
|
|
36
|
+
auth: AuthContext;
|
|
37
|
+
sessionId: string;
|
|
38
|
+
timestamp: number;
|
|
39
|
+
};
|
|
40
|
+
/** Emitted when a gate denies a tool call */
|
|
41
|
+
"gate:denied": {
|
|
42
|
+
toolName: string;
|
|
43
|
+
reason: string;
|
|
44
|
+
auth: AuthContext;
|
|
45
|
+
sessionId: string;
|
|
46
|
+
timestamp: number;
|
|
47
|
+
};
|
|
48
|
+
/** Emitted on successful authentication */
|
|
49
|
+
"auth:success": {
|
|
50
|
+
auth: AuthContext;
|
|
51
|
+
timestamp: number;
|
|
52
|
+
};
|
|
53
|
+
/** Emitted on authentication failure */
|
|
54
|
+
"auth:failure": {
|
|
55
|
+
timestamp: number;
|
|
56
|
+
};
|
|
57
|
+
/** Emitted when search_tools promotes tools */
|
|
58
|
+
"tools:promoted": {
|
|
59
|
+
toolNames: string[];
|
|
60
|
+
query: string;
|
|
61
|
+
sessionId: string;
|
|
62
|
+
timestamp: number;
|
|
63
|
+
};
|
|
64
|
+
/** Emitted when a gate unlock promotes hidden tools */
|
|
65
|
+
"tools:unlocked": {
|
|
66
|
+
toolNames: string[];
|
|
67
|
+
prerequisite: string;
|
|
68
|
+
sessionId: string;
|
|
69
|
+
timestamp: number;
|
|
70
|
+
};
|
|
71
|
+
/** Emitted when deploy() is called */
|
|
72
|
+
"deploy:start": {
|
|
73
|
+
functionName: string;
|
|
74
|
+
region: string;
|
|
75
|
+
timestamp: number;
|
|
76
|
+
};
|
|
77
|
+
/** Emitted after deploy() completes */
|
|
78
|
+
"deploy:complete": {
|
|
79
|
+
functionName: string;
|
|
80
|
+
url: string;
|
|
81
|
+
region: string;
|
|
82
|
+
durationMs: number;
|
|
83
|
+
timestamp: number;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
export type McpEventName = keyof McpEventMap;
|
|
87
|
+
export declare class McpEventEmitter {
|
|
88
|
+
#private;
|
|
89
|
+
on<K extends McpEventName>(event: K, listener: (data: McpEventMap[K]) => void): void;
|
|
90
|
+
off<K extends McpEventName>(event: K, listener: (data: McpEventMap[K]) => void): void;
|
|
91
|
+
emit<K extends McpEventName>(event: K, data: McpEventMap[K]): void;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG;IACzB,oCAAoC;IACpC,WAAW,EAAE;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,OAAO,CAAC;QAChB,IAAI,EAAE,WAAW,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,sDAAsD;IACtD,aAAa,EAAE;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC;QACjB,IAAI,EAAE,WAAW,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,6CAA6C;IAC7C,aAAa,EAAE;QACd,QAAQ,EAAE,MAAM,CAAC;QAC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YAAY,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI;IAIrF,IAAI,CAAC,CAAC,SAAS,YAAY,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI;CAWlE"}
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export class McpEventEmitter {
|
|
2
|
+
#listeners = new Map();
|
|
3
|
+
on(event, listener) {
|
|
4
|
+
let set = this.#listeners.get(event);
|
|
5
|
+
if (!set) {
|
|
6
|
+
set = new Set();
|
|
7
|
+
this.#listeners.set(event, set);
|
|
8
|
+
}
|
|
9
|
+
set.add(listener);
|
|
10
|
+
}
|
|
11
|
+
off(event, listener) {
|
|
12
|
+
this.#listeners.get(event)?.delete(listener);
|
|
13
|
+
}
|
|
14
|
+
emit(event, data) {
|
|
15
|
+
const set = this.#listeners.get(event);
|
|
16
|
+
if (!set)
|
|
17
|
+
return;
|
|
18
|
+
for (const listener of set) {
|
|
19
|
+
try {
|
|
20
|
+
listener(data);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
// Don't let listener errors break the server
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAyFA,MAAM,OAAO,eAAe;IAC3B,UAAU,GAAG,IAAI,GAAG,EAAyC,CAAC;IAE9D,EAAE,CAAyB,KAAQ,EAAE,QAAwC;QAC5E,IAAI,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,CAAC,GAAG,EAAE,CAAC;YACV,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;YAChB,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACjC,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,QAAoC,CAAC,CAAC;IAC/C,CAAC;IAED,GAAG,CAAyB,KAAQ,EAAE,QAAwC;QAC7E,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,QAAoC,CAAC,CAAC;IAC1E,CAAC;IAED,IAAI,CAAyB,KAAQ,EAAE,IAAoB;QAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,GAAG;YAAE,OAAO;QACjB,KAAK,MAAM,QAAQ,IAAI,GAAG,EAAE,CAAC;YAC5B,IAAI,CAAC;gBACJ,QAAQ,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC;YAAC,MAAM,CAAC;gBACR,6CAA6C;YAC9C,CAAC;QACF,CAAC;IACF,CAAC;CACD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Gate } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* All gates must pass. Returns the first failure.
|
|
4
|
+
*/
|
|
5
|
+
export declare function all(...gates: Gate[]): Gate;
|
|
6
|
+
/**
|
|
7
|
+
* At least one gate must pass. Returns all failure reasons if none pass.
|
|
8
|
+
*/
|
|
9
|
+
export declare function any(...gates: Gate[]): Gate;
|
|
10
|
+
//# sourceMappingURL=combinators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combinators.d.ts","sourceRoot":"","sources":["../../src/gating/combinators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAA2B,MAAM,aAAa,CAAC;AAEjE;;GAEG;AACH,wBAAgB,GAAG,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAU1C;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAe1C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All gates must pass. Returns the first failure.
|
|
3
|
+
*/
|
|
4
|
+
export function all(...gates) {
|
|
5
|
+
return async (ctx) => {
|
|
6
|
+
for (const gate of gates) {
|
|
7
|
+
const result = await gate(ctx);
|
|
8
|
+
if (!result.allowed) {
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return { allowed: true };
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* At least one gate must pass. Returns all failure reasons if none pass.
|
|
17
|
+
*/
|
|
18
|
+
export function any(...gates) {
|
|
19
|
+
return async (ctx) => {
|
|
20
|
+
const failures = [];
|
|
21
|
+
for (const gate of gates) {
|
|
22
|
+
const result = await gate(ctx);
|
|
23
|
+
if (result.allowed) {
|
|
24
|
+
return { allowed: true };
|
|
25
|
+
}
|
|
26
|
+
failures.push(result.reason);
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
allowed: false,
|
|
30
|
+
reason: `None of the gates passed: ${failures.join("; ")}`,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=combinators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combinators.js","sourceRoot":"","sources":["../../src/gating/combinators.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,GAAG,KAAa;IACnC,OAAO,KAAK,EAAE,GAAgB,EAAuB,EAAE;QACtD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YAC1B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC;YAC/B,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACrB,OAAO,MAAM,CAAC;YACf,CAAC;QACF,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC1B,CAAC,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,GAAG,CAAC,GAAG,KAAa;IACnC,OAAO,KAAK,EAAE,GAAgB,EAAuB,EAAE;QACtD,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YAC1B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC;YAC/B,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAC1B,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO;YACN,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,6BAA6B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SAC1D,CAAC;IACH,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Gate, GateContext } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Requires at least one of the specified roles.
|
|
4
|
+
*/
|
|
5
|
+
export declare function role(...roles: string[]): Gate;
|
|
6
|
+
/**
|
|
7
|
+
* Arbitrary async predicate gate.
|
|
8
|
+
*/
|
|
9
|
+
export declare function check(fn: (ctx: GateContext) => boolean | Promise<boolean>, reason?: string): Gate;
|
|
10
|
+
/**
|
|
11
|
+
* Requires a prerequisite tool to have been called (unlocked in session).
|
|
12
|
+
*/
|
|
13
|
+
export declare function requires(prerequisiteToolName: string): Gate;
|
|
14
|
+
/**
|
|
15
|
+
* In-memory rate limiter per tool. Resets on cold start.
|
|
16
|
+
*/
|
|
17
|
+
export declare function rateLimit(opts: {
|
|
18
|
+
max: number;
|
|
19
|
+
windowMs: number;
|
|
20
|
+
}): Gate;
|
|
21
|
+
//# sourceMappingURL=gates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gates.d.ts","sourceRoot":"","sources":["../../src/gating/gates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAc,MAAM,aAAa,CAAC;AAEjE;;GAEG;AACH,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAY7C;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAWjG;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAc3D;AAOD;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAwBvE"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Requires at least one of the specified roles.
|
|
3
|
+
*/
|
|
4
|
+
export function role(...roles) {
|
|
5
|
+
return (ctx) => {
|
|
6
|
+
const hasRole = roles.some((r) => ctx.auth.roles.includes(r));
|
|
7
|
+
if (hasRole) {
|
|
8
|
+
return { allowed: true };
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
allowed: false,
|
|
12
|
+
reason: `Requires one of roles: ${roles.join(", ")}`,
|
|
13
|
+
hint: "Ensure the user has the appropriate role assigned.",
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Arbitrary async predicate gate.
|
|
19
|
+
*/
|
|
20
|
+
export function check(fn, reason) {
|
|
21
|
+
return async (ctx) => {
|
|
22
|
+
const passed = await fn(ctx);
|
|
23
|
+
if (passed) {
|
|
24
|
+
return { allowed: true };
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
allowed: false,
|
|
28
|
+
reason: reason ?? "Check failed",
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Requires a prerequisite tool to have been called (unlocked in session).
|
|
34
|
+
*/
|
|
35
|
+
export function requires(prerequisiteToolName) {
|
|
36
|
+
return (ctx) => {
|
|
37
|
+
if (ctx.metadata.unlockedGates instanceof Set) {
|
|
38
|
+
const gates = ctx.metadata.unlockedGates;
|
|
39
|
+
if (gates.has(prerequisiteToolName)) {
|
|
40
|
+
return { allowed: true };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
allowed: false,
|
|
45
|
+
reason: `Requires "${prerequisiteToolName}" to be called first`,
|
|
46
|
+
hint: `Call the "${prerequisiteToolName}" tool before using "${ctx.toolName}".`,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* In-memory rate limiter per tool. Resets on cold start.
|
|
52
|
+
*/
|
|
53
|
+
export function rateLimit(opts) {
|
|
54
|
+
const counters = new Map();
|
|
55
|
+
return (ctx) => {
|
|
56
|
+
const key = `${ctx.sessionId}:${ctx.toolName}`;
|
|
57
|
+
const now = Date.now();
|
|
58
|
+
let state = counters.get(key);
|
|
59
|
+
if (!state || now - state.windowStart >= opts.windowMs) {
|
|
60
|
+
state = { count: 0, windowStart: now };
|
|
61
|
+
counters.set(key, state);
|
|
62
|
+
}
|
|
63
|
+
if (state.count >= opts.max) {
|
|
64
|
+
return {
|
|
65
|
+
allowed: false,
|
|
66
|
+
reason: `Rate limit exceeded: max ${opts.max} calls per ${opts.windowMs}ms`,
|
|
67
|
+
hint: "Wait before retrying this tool.",
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
state.count++;
|
|
71
|
+
return { allowed: true };
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//# sour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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gating/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gating/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { McpServer, type LambdaTransportConfig, type ExpressTransportConfig } from "./server.js";
|
|
2
|
+
export type { ToolTier, ToolConfig, ToolHandler, ToolHandlerReturn, ToolContext, ToolResult, ToolOptions, ContentPart, TextContent, ImageContent, AuthContext, Gate, GateContext, GateResult, McpSession, SessionStore, ToolCallRecord, McpServerConfig, DisclosureMode, DisclosureConfig, CodeModeConfig, } from "./types.js";
|
|
3
|
+
export { McpAwsError, GateDeniedError, AuthenticationError, SessionNotFoundError, ToolExecutionError, ToolTimeoutError, } from "./errors.js";
|
|
4
|
+
export { apiKey, ApiKeyAuth, type ApiKeyAuthConfig, type ApiKeyEntry } from "./auth/api-key.js";
|
|
5
|
+
export { cognito, CognitoAuth, type CognitoAuthConfig } from "./auth/cognito.js";
|
|
6
|
+
export { chainAuth, type AuthProvider, type AuthRequest } from "./auth/index.js";
|
|
7
|
+
export { buildResourceMetadata, buildWwwAuthenticateHeader, type ProtectedResourceMetadata, type ResourceMetadataConfig, } from "./auth/metadata.js";
|
|
8
|
+
export { role, check, requires, rateLimit } from "./gating/gates.js";
|
|
9
|
+
export { all, any } from "./gating/combinators.js";
|
|
10
|
+
export { MemorySessionStore, type MemorySessionStoreConfig } from "./session/memory.js";
|
|
11
|
+
export { DynamoSessionStore, type DynamoSessionStoreConfig } from "./session/dynamo.js";
|
|
12
|
+
export type { SqliteSessionStoreConfig } from "./session/sqlite.js";
|
|
13
|
+
export { SearchIndex, type SearchResult } from "./disclosure/search.js";
|
|
14
|
+
export { FunctionExecutor, WorkerExecutor } from "./codemode/executor.js";
|
|
15
|
+
export type { Executor, ExecuteResult } from "./codemode/executor.js";
|
|
16
|
+
export { getAuthContext, getSession } from "./context.js";
|
|
17
|
+
export { isBlockedUrl, assertSafeUrl } from "./ssrf.js";
|
|
18
|
+
export type { McpEventMap, McpEventName } from "./events.js";
|
|
19
|
+
export { codeMcpServer, createMcpHandler, type CodeMcpServerOptions, type CreateMcpHandlerOptions } from "./compose.js";
|
|
20
|
+
export { deploy, destroy, type DeployConfig, type DeployResult, type DestroyResult, type VpcConfig, } from "./deploy.js";
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,qBAAqB,EAAE,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAGjG,YAAY,EACX,QAAQ,EACR,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,YAAY,EACZ,WAAW,EACX,IAAI,EACJ,WAAW,EACX,UAAU,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,cAAc,GACd,MAAM,YAAY,CAAC;AAGpB,OAAO,EACN,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,GAChB,MAAM,aAAa,CAAC;AAGrB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