@kya-os/mcp-i-cloudflare 1.7.8 → 1.7.10
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kya-os/mcp-i-cloudflare",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.10",
|
|
4
4
|
"description": "Cloudflare Workers adapter for MCP-I framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"prepublishOnly": "npm run build && node ../create-mcpi-app/scripts/validate-no-workspace.js"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@kya-os/consent": "^0.1.
|
|
25
|
-
"@kya-os/contracts": "^1.7.
|
|
26
|
-
"@kya-os/mcp-i-core": "^1.4.
|
|
27
|
-
"@kya-os/provider-registry": "^0.1.
|
|
24
|
+
"@kya-os/consent": "^0.1.7",
|
|
25
|
+
"@kya-os/contracts": "^1.7.8",
|
|
26
|
+
"@kya-os/mcp-i-core": "^1.4.5",
|
|
27
|
+
"@kya-os/provider-registry": "^0.1.2",
|
|
28
28
|
"@modelcontextprotocol/sdk": "^1.24.0",
|
|
29
29
|
"agents": "^0.2.30",
|
|
30
30
|
"base-x": "^5.0.0",
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Consent Page Defaults and Helpers
|
|
3
|
-
*
|
|
4
|
-
* Default values and resolution helpers for consent page rendering.
|
|
5
|
-
* Mirrors @kya-os/agentshield-shared patterns for consistency.
|
|
6
|
-
*
|
|
7
|
-
* @module utils/consent-defaults
|
|
8
|
-
*/
|
|
9
|
-
import type { ConsentConfig } from "@kya-os/contracts/consent";
|
|
10
|
-
/**
|
|
11
|
-
* Default consent branding values with all fields required
|
|
12
|
-
*/
|
|
13
|
-
interface DefaultBranding {
|
|
14
|
-
primaryColor: string;
|
|
15
|
-
secondaryColor: string;
|
|
16
|
-
theme: "light" | "dark" | "auto";
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Default consent UI values with all text fields required
|
|
20
|
-
*/
|
|
21
|
-
interface DefaultUI {
|
|
22
|
-
title: string;
|
|
23
|
-
description: string;
|
|
24
|
-
expirationText: string;
|
|
25
|
-
cancelButtonText: string;
|
|
26
|
-
submitButtonText: string;
|
|
27
|
-
theme: "light" | "dark" | "auto";
|
|
28
|
-
popupEnabled: boolean;
|
|
29
|
-
autoClose: boolean;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Default consent terms values
|
|
33
|
-
*/
|
|
34
|
-
interface DefaultTerms {
|
|
35
|
-
text: string;
|
|
36
|
-
required: boolean;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Default consent configuration structure
|
|
40
|
-
*/
|
|
41
|
-
interface DefaultConsentConfig {
|
|
42
|
-
branding: DefaultBranding;
|
|
43
|
-
ui: DefaultUI;
|
|
44
|
-
terms: DefaultTerms;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Default consent configuration values
|
|
48
|
-
* Aligned with AgentShield dashboard defaults
|
|
49
|
-
*/
|
|
50
|
-
export declare const DEFAULT_CONSENT_CONFIG: DefaultConsentConfig;
|
|
51
|
-
/**
|
|
52
|
-
* Resolved consent copy - all text fields with defaults applied
|
|
53
|
-
*/
|
|
54
|
-
export interface ResolvedConsentCopy {
|
|
55
|
-
title: string;
|
|
56
|
-
description: string;
|
|
57
|
-
resolvedDescription: string;
|
|
58
|
-
expirationText: string;
|
|
59
|
-
cancelButtonText: string;
|
|
60
|
-
submitButtonText: string;
|
|
61
|
-
termsText: string;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Resolved consent branding - all color/style fields with defaults applied
|
|
65
|
-
*/
|
|
66
|
-
export interface ResolvedConsentBranding {
|
|
67
|
-
primaryColor: string;
|
|
68
|
-
secondaryColor: string;
|
|
69
|
-
logoUrl?: string;
|
|
70
|
-
companyName?: string;
|
|
71
|
-
theme: "light" | "dark" | "auto";
|
|
72
|
-
/** CSS custom properties for easy styling */
|
|
73
|
-
cssVars: Record<string, string>;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Resolve consent copy with defaults
|
|
77
|
-
* Replaces [AI Agent] placeholder with actual agent name
|
|
78
|
-
*
|
|
79
|
-
* @param config - Consent configuration (may be partial)
|
|
80
|
-
* @param agentName - Agent name to replace placeholder with
|
|
81
|
-
* @returns Resolved copy with all defaults applied
|
|
82
|
-
*/
|
|
83
|
-
export declare function resolveConsentCopy(config?: ConsentConfig, agentName?: string): ResolvedConsentCopy;
|
|
84
|
-
/**
|
|
85
|
-
* Resolve consent branding with defaults
|
|
86
|
-
*
|
|
87
|
-
* @param config - Consent configuration (may be partial)
|
|
88
|
-
* @returns Resolved branding with all defaults applied
|
|
89
|
-
*/
|
|
90
|
-
export declare function resolveConsentBranding(config?: ConsentConfig): ResolvedConsentBranding;
|
|
91
|
-
/**
|
|
92
|
-
* Merge partial config with defaults
|
|
93
|
-
* Ensures all required fields are present
|
|
94
|
-
*
|
|
95
|
-
* @param config - Partial consent configuration
|
|
96
|
-
* @returns Complete configuration with defaults applied
|
|
97
|
-
*/
|
|
98
|
-
export declare function mergeWithDefaults(config?: ConsentConfig): ConsentConfig;
|
|
99
|
-
export {};
|
|
100
|
-
//# sourceMappingURL=consent-defaults.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consent-defaults.d.ts","sourceRoot":"","sources":["../../src/utils/consent-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;GAEG;AACH,UAAU,eAAe;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE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BAAkB,CAChC,MAAM,CAAC,EAAE,aAAa,EACtB,SAAS,GAAE,MAAsB,GAChC,mBAAmB,CAmBrB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,CAAC,EAAE,aAAa,GACrB,uBAAuB,CAsBzB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,aAAa,CAiBvE"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Consent Page Defaults and Helpers
|
|
3
|
-
*
|
|
4
|
-
* Default values and resolution helpers for consent page rendering.
|
|
5
|
-
* Mirrors @kya-os/agentshield-shared patterns for consistency.
|
|
6
|
-
*
|
|
7
|
-
* @module utils/consent-defaults
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Default consent configuration values
|
|
11
|
-
* Aligned with AgentShield dashboard defaults
|
|
12
|
-
*/
|
|
13
|
-
export const DEFAULT_CONSENT_CONFIG = {
|
|
14
|
-
branding: {
|
|
15
|
-
primaryColor: "#2563EB",
|
|
16
|
-
secondaryColor: "#DBEAFE",
|
|
17
|
-
theme: "light",
|
|
18
|
-
},
|
|
19
|
-
ui: {
|
|
20
|
-
title: "Permission request",
|
|
21
|
-
description: "It looks like you would like to use [AI Agent] to perform actions on your behalf. If so, we need a few things from you.",
|
|
22
|
-
expirationText: "This delegation will expire in",
|
|
23
|
-
cancelButtonText: "Cancel",
|
|
24
|
-
submitButtonText: "Allow access",
|
|
25
|
-
theme: "light",
|
|
26
|
-
popupEnabled: false,
|
|
27
|
-
autoClose: false,
|
|
28
|
-
},
|
|
29
|
-
terms: {
|
|
30
|
-
text: "Terms and Conditions",
|
|
31
|
-
required: true,
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Resolve consent copy with defaults
|
|
36
|
-
* Replaces [AI Agent] placeholder with actual agent name
|
|
37
|
-
*
|
|
38
|
-
* @param config - Consent configuration (may be partial)
|
|
39
|
-
* @param agentName - Agent name to replace placeholder with
|
|
40
|
-
* @returns Resolved copy with all defaults applied
|
|
41
|
-
*/
|
|
42
|
-
export function resolveConsentCopy(config, agentName = "an AI Agent") {
|
|
43
|
-
const ui = config?.ui;
|
|
44
|
-
const terms = config?.terms;
|
|
45
|
-
const title = ui?.title ?? DEFAULT_CONSENT_CONFIG.ui.title;
|
|
46
|
-
const description = ui?.description ?? DEFAULT_CONSENT_CONFIG.ui.description;
|
|
47
|
-
return {
|
|
48
|
-
title,
|
|
49
|
-
description,
|
|
50
|
-
resolvedDescription: description.replace(/\[AI Agent\]/gi, agentName),
|
|
51
|
-
expirationText: ui?.expirationText ?? DEFAULT_CONSENT_CONFIG.ui.expirationText,
|
|
52
|
-
cancelButtonText: ui?.cancelButtonText ?? DEFAULT_CONSENT_CONFIG.ui.cancelButtonText,
|
|
53
|
-
submitButtonText: ui?.submitButtonText ?? DEFAULT_CONSENT_CONFIG.ui.submitButtonText,
|
|
54
|
-
termsText: terms?.text ?? DEFAULT_CONSENT_CONFIG.terms.text,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Resolve consent branding with defaults
|
|
59
|
-
*
|
|
60
|
-
* @param config - Consent configuration (may be partial)
|
|
61
|
-
* @returns Resolved branding with all defaults applied
|
|
62
|
-
*/
|
|
63
|
-
export function resolveConsentBranding(config) {
|
|
64
|
-
const branding = config?.branding;
|
|
65
|
-
const primaryColor = branding?.primaryColor ?? DEFAULT_CONSENT_CONFIG.branding.primaryColor;
|
|
66
|
-
const secondaryColor = branding?.secondaryColor ?? DEFAULT_CONSENT_CONFIG.branding.secondaryColor;
|
|
67
|
-
const theme = branding?.theme ?? DEFAULT_CONSENT_CONFIG.branding.theme;
|
|
68
|
-
return {
|
|
69
|
-
primaryColor,
|
|
70
|
-
secondaryColor,
|
|
71
|
-
logoUrl: branding?.logoUrl,
|
|
72
|
-
companyName: branding?.companyName,
|
|
73
|
-
theme,
|
|
74
|
-
cssVars: {
|
|
75
|
-
"--consent-primary": primaryColor,
|
|
76
|
-
"--consent-secondary": secondaryColor,
|
|
77
|
-
"--consent-primary-light": `${primaryColor}20`, // 20% opacity
|
|
78
|
-
"--consent-secondary-light": `${secondaryColor}40`, // 40% opacity
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Merge partial config with defaults
|
|
84
|
-
* Ensures all required fields are present
|
|
85
|
-
*
|
|
86
|
-
* @param config - Partial consent configuration
|
|
87
|
-
* @returns Complete configuration with defaults applied
|
|
88
|
-
*/
|
|
89
|
-
export function mergeWithDefaults(config) {
|
|
90
|
-
return {
|
|
91
|
-
branding: {
|
|
92
|
-
...DEFAULT_CONSENT_CONFIG.branding,
|
|
93
|
-
...config?.branding,
|
|
94
|
-
},
|
|
95
|
-
ui: {
|
|
96
|
-
...DEFAULT_CONSENT_CONFIG.ui,
|
|
97
|
-
...config?.ui,
|
|
98
|
-
},
|
|
99
|
-
terms: {
|
|
100
|
-
...DEFAULT_CONSENT_CONFIG.terms,
|
|
101
|
-
...config?.terms,
|
|
102
|
-
},
|
|
103
|
-
customFields: config?.customFields ?? [],
|
|
104
|
-
metadata: config?.metadata,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=consent-defaults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consent-defaults.js","sourceRoot":"","sources":["../../src/utils/consent-defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA4CH;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAyB;IAC1D,QAAQ,EAAE;QACR,YAAY,EAAE,SAAS;QACvB,cAAc,EAAE,SAAS;QACzB,KAAK,EAAE,OAAO;KACf;IACD,EAAE,EAAE;QACF,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EACT,yHAAyH;QAC3H,cAAc,EAAE,gCAAgC;QAChD,gBAAgB,EAA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