feat: update MCP config and TOOLS.md with calendar/contacts note

This commit is contained in:
root
2026-03-29 18:45:26 +08:00
parent 1a9fdc7274
commit c3e845f89c
3427 changed files with 2447281 additions and 1 deletions

View File

@@ -0,0 +1,8 @@
import SPI, * as $SPI from '@alicloud/gateway-spi';
export default class Client extends SPI {
constructor();
modifyConfiguration(context: $SPI.InterceptorContext, attributeMap: $SPI.AttributeMap): Promise<void>;
modifyRequest(context: $SPI.InterceptorContext, attributeMap: $SPI.AttributeMap): Promise<void>;
modifyResponse(context: $SPI.InterceptorContext, attributeMap: $SPI.AttributeMap): Promise<void>;
defaultAny(inputValue: any, defaultValue: any): any;
}

View File

@@ -0,0 +1,95 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
// This file is auto-generated, don't edit it
const gateway_spi_1 = __importDefault(require("@alicloud/gateway-spi"));
const tea_util_1 = __importDefault(require("@alicloud/tea-util"));
const $tea = __importStar(require("@alicloud/tea-typescript"));
class Client extends gateway_spi_1.default {
constructor() {
super();
}
async modifyConfiguration(context, attributeMap) {
}
async modifyRequest(context, attributeMap) {
let request = context.request;
let config = context.configuration;
request.headers = Object.assign({ host: config.endpoint, 'user-agent': request.userAgent, accept: "application/json" }, request.headers);
if (!tea_util_1.default.isUnset(request.body)) {
let jsonObj = tea_util_1.default.toJSONString(request.body);
request.stream = new $tea.BytesReadable(jsonObj);
request.headers["content-type"] = "application/json; charset=utf-8";
}
}
async modifyResponse(context, attributeMap) {
let request = context.request;
let response = context.response;
if (tea_util_1.default.is4xx(response.statusCode) || tea_util_1.default.is5xx(response.statusCode)) {
let _res = await tea_util_1.default.readAsJSON(response.body);
let err = tea_util_1.default.assertAsMap(_res);
err["statusCode"] = response.statusCode;
throw $tea.newError({
code: `${this.defaultAny(err["Code"], err["code"])}`,
message: `code: ${response.statusCode}, ${this.defaultAny(err["Message"], err["message"])} request id: ${this.defaultAny(err["RequestId"], err["requestid"])}`,
data: err,
description: `${this.defaultAny(err["Description"], err["description"])}`,
accessDeniedDetail: this.defaultAny(err["AccessDeniedDetail"], err["accessdenieddetail"]),
});
}
if (tea_util_1.default.equalNumber(response.statusCode, 204)) {
await tea_util_1.default.readAsString(response.body);
}
else if (tea_util_1.default.equalString(request.bodyType, "binary")) {
response.deserializedBody = response.body;
}
else if (tea_util_1.default.equalString(request.bodyType, "byte")) {
let byt = await tea_util_1.default.readAsBytes(response.body);
response.deserializedBody = byt;
}
else if (tea_util_1.default.equalString(request.bodyType, "string")) {
let str = await tea_util_1.default.readAsString(response.body);
response.deserializedBody = str;
}
else if (tea_util_1.default.equalString(request.bodyType, "json")) {
let obj = await tea_util_1.default.readAsJSON(response.body);
let res = tea_util_1.default.assertAsMap(obj);
response.deserializedBody = res;
}
else if (tea_util_1.default.equalString(request.bodyType, "array")) {
let arr = await tea_util_1.default.readAsJSON(response.body);
response.deserializedBody = arr;
}
else {
response.deserializedBody = await tea_util_1.default.readAsString(response.body);
}
}
defaultAny(inputValue, defaultValue) {
if (tea_util_1.default.isUnset(inputValue)) {
return defaultValue;
}
return inputValue;
}
}
exports.default = Client;
//# sourceMappingURL=client.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src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*.test.js",
"test-cov": "nyc -e .ts -r=html -r=text -r=lcov npm run test",
"build": "tsc",
"prepublishOnly": "tsc"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@types/node": "^12.12.26",
"nyc": "^15.0.0",
"source-map-support": "^0.5.16",
"ts-node": "^8.6.2",
"typescript": "^3.7.5"
},
"dependencies": {
"@alicloud/tea-typescript": "^1.7.1",
"@alicloud/gateway-spi": "^0.0.8",
"@alicloud/tea-util": "^1.4.5"
},
"files": [
"dist",
"src"
]
}

View File

@@ -0,0 +1,81 @@
// This file is auto-generated, don't edit it
import SPI, * as $SPI from '@alicloud/gateway-spi';
import Util from '@alicloud/tea-util';
import * as $tea from '@alicloud/tea-typescript';
export default class Client extends SPI {
constructor() {
super();
}
async modifyConfiguration(context: $SPI.InterceptorContext, attributeMap: $SPI.AttributeMap): Promise<void> {
}
async modifyRequest(context: $SPI.InterceptorContext, attributeMap: $SPI.AttributeMap): Promise<void> {
let request = context.request;
let config = context.configuration;
request.headers = {
host: config.endpoint,
'user-agent': request.userAgent,
accept: "application/json",
...request.headers,
};
if (!Util.isUnset(request.body)) {
let jsonObj = Util.toJSONString(request.body);
request.stream = new $tea.BytesReadable(jsonObj);
request.headers["content-type"] = "application/json; charset=utf-8";
}
}
async modifyResponse(context: $SPI.InterceptorContext, attributeMap: $SPI.AttributeMap): Promise<void> {
let request = context.request;
let response = context.response;
if (Util.is4xx(response.statusCode) || Util.is5xx(response.statusCode)) {
let _res = await Util.readAsJSON(response.body);
let err = Util.assertAsMap(_res);
err["statusCode"] = response.statusCode;
throw $tea.newError({
code: `${this.defaultAny(err["Code"], err["code"])}`,
message: `code: ${response.statusCode}, ${this.defaultAny(err["Message"], err["message"])} request id: ${this.defaultAny(err["RequestId"], err["requestid"])}`,
data: err,
description: `${this.defaultAny(err["Description"], err["description"])}`,
accessDeniedDetail: this.defaultAny(err["AccessDeniedDetail"], err["accessdenieddetail"]),
});
}
if (Util.equalNumber(response.statusCode, 204)) {
await Util.readAsString(response.body);
} else if (Util.equalString(request.bodyType, "binary")) {
response.deserializedBody = response.body;
} else if (Util.equalString(request.bodyType, "byte")) {
let byt = await Util.readAsBytes(response.body);
response.deserializedBody = byt;
} else if (Util.equalString(request.bodyType, "string")) {
let str = await Util.readAsString(response.body);
response.deserializedBody = str;
} else if (Util.equalString(request.bodyType, "json")) {
let obj = await Util.readAsJSON(response.body);
let res = Util.assertAsMap(obj);
response.deserializedBody = res;
} else if (Util.equalString(request.bodyType, "array")) {
let arr = await Util.readAsJSON(response.body);
response.deserializedBody = arr;
} else {
response.deserializedBody = await Util.readAsString(response.body);
}
}
defaultAny(inputValue: any, defaultValue: any): any {
if (Util.isUnset(inputValue)) {
return defaultValue;
}
return inputValue;
}
}