@kya-os/mcp-i-cloudflare 1.6.15 → 1.6.16-canary.clientinfo.20251126041014
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/e2e/test-config.d.ts +37 -0
- package/dist/__tests__/e2e/test-config.d.ts.map +1 -0
- package/dist/__tests__/e2e/test-config.js +62 -0
- package/dist/__tests__/e2e/test-config.js.map +1 -0
- package/dist/adapter.d.ts +2 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js +14 -2
- package/dist/adapter.js.map +1 -1
- package/dist/agent.d.ts +36 -0
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +258 -51
- package/dist/agent.js.map +1 -1
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +16 -8
- package/dist/app.js.map +1 -1
- package/dist/runtime/oauth-handler.d.ts.map +1 -1
- package/dist/runtime/oauth-handler.js +56 -9
- package/dist/runtime/oauth-handler.js.map +1 -1
- package/dist/services/admin.service.d.ts.map +1 -1
- package/dist/services/admin.service.js +4 -1
- package/dist/services/admin.service.js.map +1 -1
- package/dist/services/consent.service.d.ts.map +1 -1
- package/dist/services/consent.service.js +11 -3
- package/dist/services/consent.service.js.map +1 -1
- package/dist/services/kta-client-lookup.d.ts +59 -0
- package/dist/services/kta-client-lookup.d.ts.map +1 -0
- package/dist/services/kta-client-lookup.js +153 -0
- package/dist/services/kta-client-lookup.js.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/client-info.d.ts +69 -0
- package/dist/utils/client-info.d.ts.map +1 -0
- package/dist/utils/client-info.js +178 -0
- package/dist/utils/client-info.js.map +1 -0
- package/dist/utils/error-formatter.d.ts +103 -0
- package/dist/utils/error-formatter.d.ts.map +1 -0
- package/dist/utils/error-formatter.js +245 -0
- package/dist/utils/error-formatter.js.map +1 -0
- package/dist/utils/initialize-context.d.ts +91 -0
- package/dist/utils/initialize-context.d.ts.map +1 -0
- package/dist/utils/initialize-context.js +169 -0
- package/dist/utils/initialize-context.js.map +1 -0
- package/dist/utils/known-clients.d.ts +46 -0
- package/dist/utils/known-clients.d.ts.map +1 -0
- package/dist/utils/known-clients.js +138 -0
- package/dist/utils/known-clients.js.map +1 -0
- package/dist/utils/oauth-identity.d.ts +58 -0
- package/dist/utils/oauth-identity.d.ts.map +1 -0
- package/dist/utils/oauth-identity.js +215 -0
- package/dist/utils/oauth-identity.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Initialize Context Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages MCP initialize context storage and retrieval for cross-request state.
|
|
5
|
+
* This allows us to preserve client info between initialize and handshake calls.
|
|
6
|
+
*/
|
|
7
|
+
import type { MCPClientCapabilities } from "@kya-os/contracts/handshake";
|
|
8
|
+
import type { MCPClientInfo as SessionClientInfo } from "../types/client";
|
|
9
|
+
/**
|
|
10
|
+
* Context stored from initialize request
|
|
11
|
+
*/
|
|
12
|
+
export interface InitializeContext {
|
|
13
|
+
timestamp: number;
|
|
14
|
+
protocolVersion?: string;
|
|
15
|
+
capabilities?: MCPClientCapabilities;
|
|
16
|
+
clientInfo?: Partial<SessionClientInfo>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Request metadata for fingerprinting
|
|
20
|
+
*/
|
|
21
|
+
export interface RequestMeta {
|
|
22
|
+
fingerprint?: string;
|
|
23
|
+
userAgent?: string;
|
|
24
|
+
ip?: string;
|
|
25
|
+
cfRay?: string;
|
|
26
|
+
request?: Request;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Manages initialize contexts for session continuity
|
|
30
|
+
*/
|
|
31
|
+
export declare class InitializeContextManager {
|
|
32
|
+
private contexts;
|
|
33
|
+
constructor();
|
|
34
|
+
/**
|
|
35
|
+
* Store initialize context for later use in handshake
|
|
36
|
+
*
|
|
37
|
+
* @param meta Request metadata for fingerprinting
|
|
38
|
+
* @param params Initialize request parameters
|
|
39
|
+
*/
|
|
40
|
+
store(meta: RequestMeta | undefined, params: unknown): void;
|
|
41
|
+
/**
|
|
42
|
+
* Consume initialize context (removes it after retrieval)
|
|
43
|
+
*
|
|
44
|
+
* @param meta Request metadata for fingerprinting
|
|
45
|
+
* @returns Initialize context if found and valid, undefined otherwise
|
|
46
|
+
*/
|
|
47
|
+
consume(meta: RequestMeta | undefined): InitializeContext | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Prune expired contexts
|
|
50
|
+
*/
|
|
51
|
+
private prune;
|
|
52
|
+
/**
|
|
53
|
+
* Normalize client info from various formats
|
|
54
|
+
*
|
|
55
|
+
* @param value Client info from request
|
|
56
|
+
* @returns Normalized client info or undefined
|
|
57
|
+
*/
|
|
58
|
+
private normalizeClientInfo;
|
|
59
|
+
/**
|
|
60
|
+
* Clone capabilities object (deep copy)
|
|
61
|
+
*
|
|
62
|
+
* @param capabilities Capabilities to clone
|
|
63
|
+
* @returns Cloned capabilities or undefined
|
|
64
|
+
*/
|
|
65
|
+
private cloneCapabilities;
|
|
66
|
+
/**
|
|
67
|
+
* Type guard for record objects
|
|
68
|
+
*
|
|
69
|
+
* @param value Value to check
|
|
70
|
+
* @returns true if value is a record object
|
|
71
|
+
*/
|
|
72
|
+
private isRecord;
|
|
73
|
+
/**
|
|
74
|
+
* Get current size of context cache (for monitoring)
|
|
75
|
+
*
|
|
76
|
+
* @returns Number of stored contexts
|
|
77
|
+
*/
|
|
78
|
+
size(): number;
|
|
79
|
+
/**
|
|
80
|
+
* Clear all contexts (for testing)
|
|
81
|
+
*/
|
|
82
|
+
clear(): void;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Build request metadata from HTTP request
|
|
86
|
+
*
|
|
87
|
+
* @param request HTTP request
|
|
88
|
+
* @returns Request metadata with fingerprint
|
|
89
|
+
*/
|
|
90
|
+
export declare function buildRequestMeta(request: Request): RequestMeta;
|
|
91
|
+
//# sourceMappingURL=initialize-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialize-context.d.ts","sourceRoot":"","sources":["../../src/utils/initialize-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAKD;;GAEG;AACH,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAiC;;IAMjD;;;;;OAKG;IACH,KAAK,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;IAqB3D;;;;;OAKG;IACH,OAAO,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,GAAG,iBAAiB,GAAG,SAAS;IAoBrE;;OAEG;IACH,OAAO,CAAC,KAAK;IASb;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IA2C3B;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;IAUzB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ;IAIhB;;;;OAIG;IACH,IAAI,IAAI,MAAM;IAId;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAsB9D"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Initialize Context Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages MCP initialize context storage and retrieval for cross-request state.
|
|
5
|
+
* This allows us to preserve client info between initialize and handshake calls.
|
|
6
|
+
*/
|
|
7
|
+
// TTL for initialize contexts (60 seconds)
|
|
8
|
+
const INITIALIZE_CONTEXT_TTL_MS = 60_000;
|
|
9
|
+
/**
|
|
10
|
+
* Manages initialize contexts for session continuity
|
|
11
|
+
*/
|
|
12
|
+
export class InitializeContextManager {
|
|
13
|
+
contexts;
|
|
14
|
+
constructor() {
|
|
15
|
+
this.contexts = new Map();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Store initialize context for later use in handshake
|
|
19
|
+
*
|
|
20
|
+
* @param meta Request metadata for fingerprinting
|
|
21
|
+
* @param params Initialize request parameters
|
|
22
|
+
*/
|
|
23
|
+
store(meta, params) {
|
|
24
|
+
if (!meta?.fingerprint || !this.isRecord(params)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const protocolVersion = params.protocolVersion;
|
|
28
|
+
const capabilities = params.capabilities;
|
|
29
|
+
const clientInfo = this.normalizeClientInfo(params.clientInfo);
|
|
30
|
+
const context = {
|
|
31
|
+
timestamp: Date.now(),
|
|
32
|
+
protocolVersion: typeof protocolVersion === "string" ? protocolVersion : undefined,
|
|
33
|
+
capabilities: this.cloneCapabilities(capabilities),
|
|
34
|
+
clientInfo,
|
|
35
|
+
};
|
|
36
|
+
this.contexts.set(meta.fingerprint, context);
|
|
37
|
+
this.prune();
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Consume initialize context (removes it after retrieval)
|
|
41
|
+
*
|
|
42
|
+
* @param meta Request metadata for fingerprinting
|
|
43
|
+
* @returns Initialize context if found and valid, undefined otherwise
|
|
44
|
+
*/
|
|
45
|
+
consume(meta) {
|
|
46
|
+
if (!meta?.fingerprint) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
const context = this.contexts.get(meta.fingerprint);
|
|
50
|
+
if (!context) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
if (Date.now() - context.timestamp > INITIALIZE_CONTEXT_TTL_MS) {
|
|
54
|
+
this.contexts.delete(meta.fingerprint);
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
// Remove after consumption to prevent cross-session leakage
|
|
58
|
+
this.contexts.delete(meta.fingerprint);
|
|
59
|
+
return context;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Prune expired contexts
|
|
63
|
+
*/
|
|
64
|
+
prune() {
|
|
65
|
+
const now = Date.now();
|
|
66
|
+
for (const [key, context] of this.contexts.entries()) {
|
|
67
|
+
if (now - context.timestamp > INITIALIZE_CONTEXT_TTL_MS) {
|
|
68
|
+
this.contexts.delete(key);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Normalize client info from various formats
|
|
74
|
+
*
|
|
75
|
+
* @param value Client info from request
|
|
76
|
+
* @returns Normalized client info or undefined
|
|
77
|
+
*/
|
|
78
|
+
normalizeClientInfo(value) {
|
|
79
|
+
if (!this.isRecord(value)) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
const normalized = {};
|
|
83
|
+
const record = value;
|
|
84
|
+
const name = record.name;
|
|
85
|
+
if (typeof name === "string" && name.trim().length > 0) {
|
|
86
|
+
normalized.name = name.trim();
|
|
87
|
+
}
|
|
88
|
+
const title = record.title;
|
|
89
|
+
if (typeof title === "string" && title.trim().length > 0) {
|
|
90
|
+
normalized.title = title.trim();
|
|
91
|
+
}
|
|
92
|
+
const version = record.version;
|
|
93
|
+
if (typeof version === "string" && version.trim().length > 0) {
|
|
94
|
+
normalized.version = version.trim();
|
|
95
|
+
}
|
|
96
|
+
const platform = record.platform;
|
|
97
|
+
if (typeof platform === "string" && platform.trim().length > 0) {
|
|
98
|
+
normalized.platform = platform.trim();
|
|
99
|
+
}
|
|
100
|
+
const vendor = record.vendor;
|
|
101
|
+
if (typeof vendor === "string" && vendor.trim().length > 0) {
|
|
102
|
+
normalized.vendor = vendor.trim();
|
|
103
|
+
}
|
|
104
|
+
const persistentId = record.persistentId;
|
|
105
|
+
if (typeof persistentId === "string" && persistentId.trim().length > 0) {
|
|
106
|
+
normalized.persistentId = persistentId.trim();
|
|
107
|
+
}
|
|
108
|
+
return Object.keys(normalized).length > 0 ? normalized : undefined;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Clone capabilities object (deep copy)
|
|
112
|
+
*
|
|
113
|
+
* @param capabilities Capabilities to clone
|
|
114
|
+
* @returns Cloned capabilities or undefined
|
|
115
|
+
*/
|
|
116
|
+
cloneCapabilities(capabilities) {
|
|
117
|
+
if (!this.isRecord(capabilities)) {
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
return JSON.parse(JSON.stringify(capabilities));
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Type guard for record objects
|
|
124
|
+
*
|
|
125
|
+
* @param value Value to check
|
|
126
|
+
* @returns true if value is a record object
|
|
127
|
+
*/
|
|
128
|
+
isRecord(value) {
|
|
129
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Get current size of context cache (for monitoring)
|
|
133
|
+
*
|
|
134
|
+
* @returns Number of stored contexts
|
|
135
|
+
*/
|
|
136
|
+
size() {
|
|
137
|
+
return this.contexts.size;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Clear all contexts (for testing)
|
|
141
|
+
*/
|
|
142
|
+
clear() {
|
|
143
|
+
this.contexts.clear();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Build request metadata from HTTP request
|
|
148
|
+
*
|
|
149
|
+
* @param request HTTP request
|
|
150
|
+
* @returns Request metadata with fingerprint
|
|
151
|
+
*/
|
|
152
|
+
export function buildRequestMeta(request) {
|
|
153
|
+
const ip = request.headers.get("cf-connecting-ip") ??
|
|
154
|
+
request.headers.get("x-forwarded-for") ??
|
|
155
|
+
undefined;
|
|
156
|
+
const userAgent = request.headers.get("user-agent") ?? undefined;
|
|
157
|
+
const cfRay = request.headers.get("cf-ray") ?? undefined;
|
|
158
|
+
const origin = request.headers.get("origin") ?? undefined;
|
|
159
|
+
const secChUa = request.headers.get("sec-ch-ua") ?? undefined;
|
|
160
|
+
const fingerprintParts = [ip, userAgent, cfRay, origin, secChUa].filter((value) => typeof value === "string" && value.length > 0);
|
|
161
|
+
return {
|
|
162
|
+
fingerprint: fingerprintParts.length > 0 ? fingerprintParts.join("|") : undefined,
|
|
163
|
+
ip,
|
|
164
|
+
userAgent,
|
|
165
|
+
cfRay,
|
|
166
|
+
request, // Include request for cookie access
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=initialize-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initialize-context.js","sourceRoot":"","sources":["../../src/utils/initialize-context.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0BH,2CAA2C;AAC3C,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAEzC;;GAEG;AACH,MAAM,OAAO,wBAAwB;IAC3B,QAAQ,CAAiC;IAEjD;QACE,IAAI,CAAC,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAA6B,EAAE,MAAe;QAClD,IAAI,CAAC,IAAI,EAAE,WAAW,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACjD,OAAO;QACT,CAAC;QAED,MAAM,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QAC/C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AQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,MAAM,EAAE,GACN,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;QACvC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;QACtC,SAAS,CAAC;IACZ,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,SAAS,CAAC;IACjE,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;IACzD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC;IAC1D,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,SAAS,CAAC;IAE9D,MAAM,gBAAgB,GAAG,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,CACrE,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAC1E,CAAC;IAEF,OAAO;QACL,WAAW,EACT,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;QACtE,EAAE;QACF,SAAS;QACT,KAAK;QACL,OAAO,EAAE,oCAAoC;KAC9C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Known MCP Clients Registry
|
|
3
|
+
*
|
|
4
|
+
* Maps known MCP client names to their official Know That AI (KTA) DIDs.
|
|
5
|
+
* When a known client connects, we use its pre-registered DID instead of generating one.
|
|
6
|
+
*/
|
|
7
|
+
export interface KnownClientConfig {
|
|
8
|
+
/** Possible client name variations (case-insensitive matching) */
|
|
9
|
+
names: string[];
|
|
10
|
+
/** Know That AI registered DID for this client (null if not yet registered) */
|
|
11
|
+
ktaDid: string | null;
|
|
12
|
+
/** Display name for logging */
|
|
13
|
+
displayName: string;
|
|
14
|
+
/** Optional vendor/organization */
|
|
15
|
+
vendor?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Registry of known MCP clients
|
|
19
|
+
*
|
|
20
|
+
* Each entry maps a canonical client ID to its configuration.
|
|
21
|
+
* The `names` array contains possible variations of the client name
|
|
22
|
+
* that might appear in the MCP initialize message's clientInfo.name field.
|
|
23
|
+
*/
|
|
24
|
+
export declare const KNOWN_MCP_CLIENTS: Record<string, KnownClientConfig>;
|
|
25
|
+
/**
|
|
26
|
+
* Find a known client by name (case-insensitive)
|
|
27
|
+
*
|
|
28
|
+
* @param clientName - The client name from MCP initialize message
|
|
29
|
+
* @returns The known client config if found, undefined otherwise
|
|
30
|
+
*/
|
|
31
|
+
export declare function findKnownClient(clientName: string | undefined): (KnownClientConfig & {
|
|
32
|
+
id: string;
|
|
33
|
+
}) | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Check if a client name corresponds to a known client
|
|
36
|
+
*/
|
|
37
|
+
export declare function isKnownClient(clientName: string | undefined): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Get the DID for a known client, if registered
|
|
40
|
+
*/
|
|
41
|
+
export declare function getKnownClientDid(clientName: string | undefined): string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Get all known client IDs
|
|
44
|
+
*/
|
|
45
|
+
export declare function getKnownClientIds(): string[];
|
|
46
|
+
//# sourceMappingURL=known-clients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"known-clients.d.ts","sourceRoot":"","sources":["../../src/utils/known-clients.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,+EAA+E;IAC/E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAsF/D,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,CAAC,iBAAiB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,CAclD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAErE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,MAAM,GAAG,IAAI,CAGf;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,EAAE,CAE5C"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Known MCP Clients Registry
|
|
3
|
+
*
|
|
4
|
+
* Maps known MCP client names to their official Know That AI (KTA) DIDs.
|
|
5
|
+
* When a known client connects, we use its pre-registered DID instead of generating one.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Registry of known MCP clients
|
|
9
|
+
*
|
|
10
|
+
* Each entry maps a canonical client ID to its configuration.
|
|
11
|
+
* The `names` array contains possible variations of the client name
|
|
12
|
+
* that might appear in the MCP initialize message's clientInfo.name field.
|
|
13
|
+
*/
|
|
14
|
+
export const KNOWN_MCP_CLIENTS = {
|
|
15
|
+
// ============================================================
|
|
16
|
+
// REGISTERED CLIENTS (have DIDs on https://knowthat.ai/agents)
|
|
17
|
+
// ============================================================
|
|
18
|
+
"claude": {
|
|
19
|
+
names: [
|
|
20
|
+
"Claude Desktop",
|
|
21
|
+
"claude-desktop",
|
|
22
|
+
"Claude",
|
|
23
|
+
"claude",
|
|
24
|
+
"Anthropic Claude",
|
|
25
|
+
"Anthropic/ClaudeAI", // Web/mobile client name
|
|
26
|
+
"ClaudeAI",
|
|
27
|
+
"Claude Code", // CLI/code client
|
|
28
|
+
"claude-code",
|
|
29
|
+
],
|
|
30
|
+
ktaDid: "did:web:knowthat.ai:agents:claude", // https://knowthat.ai/agents/claude
|
|
31
|
+
displayName: "Claude",
|
|
32
|
+
vendor: "Anthropic",
|
|
33
|
+
},
|
|
34
|
+
"chatgpt": {
|
|
35
|
+
names: [
|
|
36
|
+
"ChatGPT",
|
|
37
|
+
"chatgpt",
|
|
38
|
+
"chatgpt-app",
|
|
39
|
+
"ChatGPT App",
|
|
40
|
+
"OpenAI ChatGPT",
|
|
41
|
+
"OpenAI",
|
|
42
|
+
],
|
|
43
|
+
ktaDid: "did:web:knowthat.ai:agents:chatgpt", // https://knowthat.ai/agents/chatgpt
|
|
44
|
+
displayName: "ChatGPT",
|
|
45
|
+
vendor: "OpenAI",
|
|
46
|
+
},
|
|
47
|
+
"perplexity": {
|
|
48
|
+
names: [
|
|
49
|
+
"Perplexity",
|
|
50
|
+
"perplexity",
|
|
51
|
+
"Perplexity AI",
|
|
52
|
+
"perplexity-ai",
|
|
53
|
+
"Perplexity App",
|
|
54
|
+
],
|
|
55
|
+
ktaDid: "did:web:knowthat.ai:agents:perplexity", // https://knowthat.ai/agents/perplexity
|
|
56
|
+
displayName: "Perplexity",
|
|
57
|
+
vendor: "Perplexity AI",
|
|
58
|
+
},
|
|
59
|
+
// ============================================================
|
|
60
|
+
// UNREGISTERED CLIENTS (no KTA DID yet - will get ephemeral DID)
|
|
61
|
+
// ============================================================
|
|
62
|
+
"mcp-inspector": {
|
|
63
|
+
names: [
|
|
64
|
+
"MCP Inspector",
|
|
65
|
+
"mcp-inspector",
|
|
66
|
+
"@anthropic/mcp-inspector",
|
|
67
|
+
"@modelcontextprotocol/inspector",
|
|
68
|
+
"Inspector",
|
|
69
|
+
"inspector-client", // Name sent by inspector CLI
|
|
70
|
+
],
|
|
71
|
+
ktaDid: null, // Not yet registered on knowthat.ai
|
|
72
|
+
displayName: "MCP Inspector",
|
|
73
|
+
vendor: "Anthropic",
|
|
74
|
+
},
|
|
75
|
+
"cursor": {
|
|
76
|
+
names: ["Cursor", "cursor", "cursor-ai", "Cursor AI", "Cursor IDE"],
|
|
77
|
+
ktaDid: null, // Not yet registered on knowthat.ai
|
|
78
|
+
displayName: "Cursor",
|
|
79
|
+
vendor: "Cursor Inc",
|
|
80
|
+
},
|
|
81
|
+
"windsurf": {
|
|
82
|
+
names: ["Windsurf", "windsurf", "Codeium Windsurf"],
|
|
83
|
+
ktaDid: null, // Not yet registered on knowthat.ai
|
|
84
|
+
displayName: "Windsurf",
|
|
85
|
+
vendor: "Codeium",
|
|
86
|
+
},
|
|
87
|
+
"cline": {
|
|
88
|
+
names: ["Cline", "cline", "VS Code Cline", "vscode-cline"],
|
|
89
|
+
ktaDid: null, // Not yet registered on knowthat.ai
|
|
90
|
+
displayName: "Cline",
|
|
91
|
+
vendor: "Cline",
|
|
92
|
+
},
|
|
93
|
+
"zed": {
|
|
94
|
+
names: ["Zed", "zed", "Zed Editor", "zed-editor"],
|
|
95
|
+
ktaDid: null, // Not yet registered on knowthat.ai
|
|
96
|
+
displayName: "Zed",
|
|
97
|
+
vendor: "Zed Industries",
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Find a known client by name (case-insensitive)
|
|
102
|
+
*
|
|
103
|
+
* @param clientName - The client name from MCP initialize message
|
|
104
|
+
* @returns The known client config if found, undefined otherwise
|
|
105
|
+
*/
|
|
106
|
+
export function findKnownClient(clientName) {
|
|
107
|
+
if (!clientName)
|
|
108
|
+
return undefined;
|
|
109
|
+
const normalizedName = clientName.toLowerCase().trim();
|
|
110
|
+
for (const [id, config] of Object.entries(KNOWN_MCP_CLIENTS)) {
|
|
111
|
+
for (const name of config.names) {
|
|
112
|
+
if (name.toLowerCase() === normalizedName) {
|
|
113
|
+
return { ...config, id };
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return undefined;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Check if a client name corresponds to a known client
|
|
121
|
+
*/
|
|
122
|
+
export function isKnownClient(clientName) {
|
|
123
|
+
return findKnownClient(clientName) !== undefined;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Get the DID for a known client, if registered
|
|
127
|
+
*/
|
|
128
|
+
export function getKnownClientDid(clientName) {
|
|
129
|
+
const known = findKnownClient(clientName);
|
|
130
|
+
return known?.ktaDid ?? null;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get all known client IDs
|
|
134
|
+
*/
|
|
135
|
+
export function getKnownClientIds() {
|
|
136
|
+
return Object.keys(KNOWN_MCP_CLIENTS);
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=known-clients.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"known-clients.js","sourceRoot":"","sources":["../../src/utils/known-clients.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAsC;IAClE,+DAA+D;IAC/D,+DAA+D;IAC/D,+DAA+D;IAC/D,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,gBAAgB;YAChB,gBAAgB;YAChB,QAAQ;YACR,QAAQ;YACR,kBAAkB;YAClB,oBAAoB,EAAE,yBAAyB;YAC/C,UAAU;YACV,aAAa,EAAE,kBAAkB;YACjC,aAAa;SACd;QACD,MAAM,EAAE,mCAAmC,EAAE,oCAAoC;QACjF,WAAW,EAAE,QAAQ;QACrB,MAAM,EAAE,WAAW;KACpB;IACD,SAAS,EAAE;QACT,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,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,CAAC;QACjD,MAAM,EAAE,IAAI,EAAE,oCAAoC;QAClD,WAAW,EAAE,KAAK;QAClB,MAAM,EAAE,gBAAgB;KACzB;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,UAA8B;IAE9B,IAAI,CAAC,UAAU;QAAE,OAAO,SAAS,CAAC;IAElC,MAAM,cAAc,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;IAEvD,KAAK,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC;QAC7D,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YAChC,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,cAAc,EAAE,CAAC;gBAC1C,OAAO,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,CAAC;YAC3B,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,UAA8B;IAC1D,OAAO,eAAe,CAAC,UAAU,CAAC,KAAK,SAAS,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAA8B;IAE9B,MAAM,KAAK,GAAG,eAAe,CAAC,UAAU,CAAC,CAAC;IAC1C,OAAO,KAAK,EAAE,MAAM,IAAI,IAAI,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth Identity Utilities
|
|
3
|
+
*
|
|
4
|
+
* Handles OAuth identity extraction and validation from HTTP requests.
|
|
5
|
+
* This module consolidates OAuth-related logic that was previously in the adapter.
|
|
6
|
+
*/
|
|
7
|
+
import type { OAuthIdentity } from "@kya-os/contracts/consent";
|
|
8
|
+
/**
|
|
9
|
+
* OAuth identity validation result
|
|
10
|
+
*/
|
|
11
|
+
export interface OAuthValidationResult {
|
|
12
|
+
valid: boolean;
|
|
13
|
+
reason?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Extract OAuth identity from request cookies
|
|
17
|
+
*
|
|
18
|
+
* @param request - HTTP Request object
|
|
19
|
+
* @returns OAuthIdentity or null if not found/invalid
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractOAuthIdentityFromRequest(request: Request): OAuthIdentity | null;
|
|
22
|
+
/**
|
|
23
|
+
* Validate OAuth identity format and content
|
|
24
|
+
*
|
|
25
|
+
* Ensures:
|
|
26
|
+
* - Provider is non-empty string (1-50 chars)
|
|
27
|
+
* - Subject is non-empty string (1-255 chars)
|
|
28
|
+
* - Provider matches expected format (alphanumeric, hyphens, underscores)
|
|
29
|
+
* - Subject matches expected format (non-empty, reasonable length)
|
|
30
|
+
*
|
|
31
|
+
* @param identity - Parsed OAuth identity object
|
|
32
|
+
* @returns Validation result
|
|
33
|
+
*/
|
|
34
|
+
export declare function validateOAuthIdentity(identity: unknown): OAuthValidationResult;
|
|
35
|
+
/**
|
|
36
|
+
* Lookup User DID from OAuth identity mapping
|
|
37
|
+
*
|
|
38
|
+
* @param oauthIdentity OAuth identity to lookup
|
|
39
|
+
* @param delegationStorage KV namespace for storage
|
|
40
|
+
* @returns User DID or null if not found
|
|
41
|
+
*/
|
|
42
|
+
export declare function lookupUserDidFromOAuth(oauthIdentity: OAuthIdentity, delegationStorage: any): Promise<string | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Create a redacted OAuth identity for storage (PII protection)
|
|
45
|
+
*
|
|
46
|
+
* @param oauthIdentity Original OAuth identity
|
|
47
|
+
* @returns Redacted identity safe for storage
|
|
48
|
+
*/
|
|
49
|
+
export declare function redactOAuthIdentityForStorage(oauthIdentity: OAuthIdentity | null): any;
|
|
50
|
+
/**
|
|
51
|
+
* Test if an OAuth cookie value is valid
|
|
52
|
+
* Helper function for testing and debugging
|
|
53
|
+
*
|
|
54
|
+
* @param cookieValue Encoded cookie value
|
|
55
|
+
* @returns true if valid OAuth identity, false otherwise
|
|
56
|
+
*/
|
|
57
|
+
export declare function isValidOAuthCookie(cookieValue: string): boolean;
|
|
58
|
+
//# sourceMappingURL=oauth-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-identity.d.ts","sourceRoot":"","sources":["../../src/utils/oauth-identity.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAoCtF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,qBAAqB,CAkH9E;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC1C,aAAa,EAAE,aAAa,EAC5B,iBAAiB,EAAE,GAAG,GACrB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA+BxB;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,GAAG,GAAG,CAUtF;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAQ/D"}
|