@chrischall/microsoft-teams-mcp 0.10.0 → 0.11.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +55 -4
- package/dist/bridge-scope.js +13 -3
- package/dist/bundle.js +543 -109
- package/dist/index.js +6 -1
- package/dist/recap-auth.js +44 -0
- package/dist/recap-token-cache.js +50 -0
- package/dist/recap.js +325 -0
- package/dist/tools/recap.js +122 -0
- package/dist/version.js +1 -1
- package/mint.yaml +9 -0
- package/package.json +1 -1
- package/server.json +16 -2
package/dist/bundle.js
CHANGED
|
@@ -347,8 +347,8 @@ function defineLazy(object2, key, getter) {
|
|
|
347
347
|
configurable: true
|
|
348
348
|
});
|
|
349
349
|
}
|
|
350
|
-
function objectClone(
|
|
351
|
-
return Object.create(Object.getPrototypeOf(
|
|
350
|
+
function objectClone(obj3) {
|
|
351
|
+
return Object.create(Object.getPrototypeOf(obj3), Object.getOwnPropertyDescriptors(obj3));
|
|
352
352
|
}
|
|
353
353
|
function assignProp(target, prop, value) {
|
|
354
354
|
Object.defineProperty(target, prop, {
|
|
@@ -419,10 +419,10 @@ function mergeDefs(...defs) {
|
|
|
419
419
|
function cloneDef(schema) {
|
|
420
420
|
return mergeDefs(schema._zod.def);
|
|
421
421
|
}
|
|
422
|
-
function getElementAtPath(
|
|
422
|
+
function getElementAtPath(obj3, path) {
|
|
423
423
|
if (!path)
|
|
424
|
-
return
|
|
425
|
-
return path.reduce((acc, key) => acc?.[key],
|
|
424
|
+
return obj3;
|
|
425
|
+
return path.reduce((acc, key) => acc?.[key], obj3);
|
|
426
426
|
}
|
|
427
427
|
function promiseAllObject(promisesObj) {
|
|
428
428
|
const keys = Object.keys(promisesObj);
|
|
@@ -437,14 +437,14 @@ function promiseAllObject(promisesObj) {
|
|
|
437
437
|
}
|
|
438
438
|
function randomString(length = 10) {
|
|
439
439
|
const chars = "abcdefghijklmnopqrstuvwxyz";
|
|
440
|
-
let
|
|
440
|
+
let str4 = "";
|
|
441
441
|
for (let i = 0; i < length; i++) {
|
|
442
|
-
|
|
442
|
+
str4 += chars[Math.floor(Math.random() * chars.length)];
|
|
443
443
|
}
|
|
444
|
-
return
|
|
444
|
+
return str4;
|
|
445
445
|
}
|
|
446
|
-
function esc(
|
|
447
|
-
return JSON.stringify(
|
|
446
|
+
function esc(str4) {
|
|
447
|
+
return JSON.stringify(str4);
|
|
448
448
|
}
|
|
449
449
|
function slugify(input2) {
|
|
450
450
|
return input2.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
@@ -488,8 +488,8 @@ function numKeys(data) {
|
|
|
488
488
|
}
|
|
489
489
|
return keyCount;
|
|
490
490
|
}
|
|
491
|
-
function escapeRegex(
|
|
492
|
-
return
|
|
491
|
+
function escapeRegex(str4) {
|
|
492
|
+
return str4.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
493
493
|
}
|
|
494
494
|
function clone(inst, def, params) {
|
|
495
495
|
const cl = new inst._zod.constr(def ?? inst._zod.def);
|
|
@@ -743,13 +743,13 @@ function getSizableOrigin(input2) {
|
|
|
743
743
|
return "file";
|
|
744
744
|
return "unknown";
|
|
745
745
|
}
|
|
746
|
-
function codePointLength(
|
|
747
|
-
const units =
|
|
748
|
-
if (!highSurrogate.test(
|
|
746
|
+
function codePointLength(str4) {
|
|
747
|
+
const units = str4.length;
|
|
748
|
+
if (!highSurrogate.test(str4))
|
|
749
749
|
return units;
|
|
750
750
|
let count = units;
|
|
751
751
|
for (let i = 0; i < units - 1; i++) {
|
|
752
|
-
if ((
|
|
752
|
+
if ((str4.charCodeAt(i) & 64512) === 55296 && (str4.charCodeAt(i + 1) & 64512) === 56320) {
|
|
753
753
|
count--;
|
|
754
754
|
i++;
|
|
755
755
|
}
|
|
@@ -776,9 +776,9 @@ function parsedType(data) {
|
|
|
776
776
|
if (Array.isArray(data)) {
|
|
777
777
|
return "array";
|
|
778
778
|
}
|
|
779
|
-
const
|
|
780
|
-
if (
|
|
781
|
-
return
|
|
779
|
+
const obj3 = data;
|
|
780
|
+
if (obj3 && Object.getPrototypeOf(obj3) !== Object.prototype && "constructor" in obj3 && obj3.constructor) {
|
|
781
|
+
return obj3.constructor.name;
|
|
782
782
|
}
|
|
783
783
|
}
|
|
784
784
|
}
|
|
@@ -796,8 +796,8 @@ function issue(...args) {
|
|
|
796
796
|
}
|
|
797
797
|
return { ...iss };
|
|
798
798
|
}
|
|
799
|
-
function cleanEnum(
|
|
800
|
-
return Object.entries(
|
|
799
|
+
function cleanEnum(obj3) {
|
|
800
|
+
return Object.entries(obj3).filter(([k, _]) => {
|
|
801
801
|
return Number.isNaN(Number.parseInt(k, 10));
|
|
802
802
|
}).map((el) => el[1]);
|
|
803
803
|
}
|
|
@@ -1194,15 +1194,15 @@ function _getMessage() {
|
|
|
1194
1194
|
function _setMessage(value) {
|
|
1195
1195
|
this._zod.message = value;
|
|
1196
1196
|
}
|
|
1197
|
-
function node(
|
|
1198
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
1197
|
+
function node(obj3, key, make) {
|
|
1198
|
+
if (!Object.prototype.hasOwnProperty.call(obj3, key)) {
|
|
1199
1199
|
if (key === "__proto__") {
|
|
1200
|
-
Object.defineProperty(
|
|
1200
|
+
Object.defineProperty(obj3, key, { value: make(), writable: true, enumerable: true, configurable: true });
|
|
1201
1201
|
} else {
|
|
1202
|
-
|
|
1202
|
+
obj3[key] = make();
|
|
1203
1203
|
}
|
|
1204
1204
|
}
|
|
1205
|
-
return
|
|
1205
|
+
return obj3[key];
|
|
1206
1206
|
}
|
|
1207
1207
|
function flattenError(error62, mapper = (issue2) => issue2.message) {
|
|
1208
1208
|
const fieldErrors = {};
|
|
@@ -24348,12 +24348,12 @@ function isZodV4Schema(v) {
|
|
|
24348
24348
|
function looksLikeZodV3(v) {
|
|
24349
24349
|
return typeof v === "object" && v !== null && !("_zod" in v) && "_def" in v && typeof v._def?.typeName === "string";
|
|
24350
24350
|
}
|
|
24351
|
-
function isZodRawShape(
|
|
24352
|
-
if (typeof
|
|
24353
|
-
if (isStandardSchema(
|
|
24354
|
-
const proto = Object.getPrototypeOf(
|
|
24351
|
+
function isZodRawShape(obj3) {
|
|
24352
|
+
if (typeof obj3 !== "object" || obj3 === null) return false;
|
|
24353
|
+
if (isStandardSchema(obj3)) return false;
|
|
24354
|
+
const proto = Object.getPrototypeOf(obj3);
|
|
24355
24355
|
if (proto !== Object.prototype && proto !== null) return false;
|
|
24356
|
-
return Object.values(
|
|
24356
|
+
return Object.values(obj3).every((v) => isZodV4Schema(v));
|
|
24357
24357
|
}
|
|
24358
24358
|
function normalizeRawShapeSchema(schema) {
|
|
24359
24359
|
if (schema === void 0) return void 0;
|
|
@@ -26208,7 +26208,7 @@ var init_src_DdvbAHrR = __esm({
|
|
|
26208
26208
|
var index = header.indexOf(";");
|
|
26209
26209
|
var type = index !== -1 ? header.slice(0, index).trim() : header.trim();
|
|
26210
26210
|
if (!TYPE_REGEXP.test(type)) throw new TypeError("invalid media type");
|
|
26211
|
-
var
|
|
26211
|
+
var obj3 = new ContentType(type.toLowerCase());
|
|
26212
26212
|
if (index !== -1) {
|
|
26213
26213
|
var key;
|
|
26214
26214
|
var match;
|
|
@@ -26223,16 +26223,16 @@ var init_src_DdvbAHrR = __esm({
|
|
|
26223
26223
|
value = value.slice(1, -1);
|
|
26224
26224
|
if (value.indexOf("\\") !== -1) value = value.replace(QESC_REGEXP, "$1");
|
|
26225
26225
|
}
|
|
26226
|
-
|
|
26226
|
+
obj3.parameters[key] = value;
|
|
26227
26227
|
}
|
|
26228
26228
|
if (index !== header.length) throw new TypeError("invalid parameter format");
|
|
26229
26229
|
}
|
|
26230
|
-
return
|
|
26230
|
+
return obj3;
|
|
26231
26231
|
}
|
|
26232
|
-
function getcontenttype(
|
|
26232
|
+
function getcontenttype(obj3) {
|
|
26233
26233
|
var header;
|
|
26234
|
-
if (typeof
|
|
26235
|
-
else if (typeof
|
|
26234
|
+
if (typeof obj3.getHeader === "function") header = obj3.getHeader("content-type");
|
|
26235
|
+
else if (typeof obj3.headers === "object") header = obj3.headers && obj3.headers["content-type"];
|
|
26236
26236
|
if (typeof header !== "string") throw new TypeError("content-type header is missing from object");
|
|
26237
26237
|
return header;
|
|
26238
26238
|
}
|
|
@@ -26357,7 +26357,7 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
26357
26357
|
}
|
|
26358
26358
|
exports._ = _;
|
|
26359
26359
|
const plus = new _Code("+");
|
|
26360
|
-
function
|
|
26360
|
+
function str4(strs, ...args) {
|
|
26361
26361
|
const expr = [safeStringify(strs[0])];
|
|
26362
26362
|
let i = 0;
|
|
26363
26363
|
while (i < args.length) {
|
|
@@ -26368,7 +26368,7 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
26368
26368
|
optimize(expr);
|
|
26369
26369
|
return new _Code(expr);
|
|
26370
26370
|
}
|
|
26371
|
-
exports.str =
|
|
26371
|
+
exports.str = str4;
|
|
26372
26372
|
function addCodeArg(code2, arg) {
|
|
26373
26373
|
if (arg instanceof _Code) code2.push(...arg._items);
|
|
26374
26374
|
else if (arg instanceof Name) code2.push(arg);
|
|
@@ -26401,7 +26401,7 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
26401
26401
|
if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) return `"${a}${b.slice(1)}`;
|
|
26402
26402
|
}
|
|
26403
26403
|
function strConcat(c1, c2) {
|
|
26404
|
-
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 :
|
|
26404
|
+
return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str4`${c1}${c2}`;
|
|
26405
26405
|
}
|
|
26406
26406
|
exports.strConcat = strConcat;
|
|
26407
26407
|
function interpolate(x) {
|
|
@@ -27082,10 +27082,10 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
27082
27082
|
}
|
|
27083
27083
|
return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name));
|
|
27084
27084
|
}
|
|
27085
|
-
forIn(nameOrPrefix,
|
|
27086
|
-
if (this.opts.ownProperties) return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys(${
|
|
27085
|
+
forIn(nameOrPrefix, obj3, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {
|
|
27086
|
+
if (this.opts.ownProperties) return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys(${obj3})`, forBody);
|
|
27087
27087
|
const name = this._scope.toName(nameOrPrefix);
|
|
27088
|
-
return this._for(new ForIter("in", varKind, name,
|
|
27088
|
+
return this._for(new ForIter("in", varKind, name, obj3), () => forBody(name));
|
|
27089
27089
|
}
|
|
27090
27090
|
endFor() {
|
|
27091
27091
|
return this._endBlockNode(For);
|
|
@@ -27280,21 +27280,21 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
27280
27280
|
return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
|
|
27281
27281
|
}
|
|
27282
27282
|
exports.schemaRefOrVal = schemaRefOrVal;
|
|
27283
|
-
function unescapeFragment(
|
|
27284
|
-
return unescapeJsonPointer(decodeURIComponent(
|
|
27283
|
+
function unescapeFragment(str4) {
|
|
27284
|
+
return unescapeJsonPointer(decodeURIComponent(str4));
|
|
27285
27285
|
}
|
|
27286
27286
|
exports.unescapeFragment = unescapeFragment;
|
|
27287
|
-
function escapeFragment(
|
|
27288
|
-
return encodeURIComponent(escapeJsonPointer(
|
|
27287
|
+
function escapeFragment(str4) {
|
|
27288
|
+
return encodeURIComponent(escapeJsonPointer(str4));
|
|
27289
27289
|
}
|
|
27290
27290
|
exports.escapeFragment = escapeFragment;
|
|
27291
|
-
function escapeJsonPointer(
|
|
27292
|
-
if (typeof
|
|
27293
|
-
return
|
|
27291
|
+
function escapeJsonPointer(str4) {
|
|
27292
|
+
if (typeof str4 == "number") return `${str4}`;
|
|
27293
|
+
return str4.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
27294
27294
|
}
|
|
27295
27295
|
exports.escapeJsonPointer = escapeJsonPointer;
|
|
27296
|
-
function unescapeJsonPointer(
|
|
27297
|
-
return
|
|
27296
|
+
function unescapeJsonPointer(str4) {
|
|
27297
|
+
return str4.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
27298
27298
|
}
|
|
27299
27299
|
exports.unescapeJsonPointer = unescapeJsonPointer;
|
|
27300
27300
|
function eachItem(xs, f) {
|
|
@@ -28180,8 +28180,8 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
28180
28180
|
post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
28181
28181
|
}
|
|
28182
28182
|
}
|
|
28183
|
-
function escapeJsonPtr(
|
|
28184
|
-
return
|
|
28183
|
+
function escapeJsonPtr(str4) {
|
|
28184
|
+
return str4.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
28185
28185
|
}
|
|
28186
28186
|
}));
|
|
28187
28187
|
require_resolve = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
@@ -28613,9 +28613,9 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
28613
28613
|
ok(cond) {
|
|
28614
28614
|
if (!this.allErrors) this.gen.if(cond);
|
|
28615
28615
|
}
|
|
28616
|
-
setParams(
|
|
28617
|
-
if (assign) Object.assign(this.params,
|
|
28618
|
-
else this.params =
|
|
28616
|
+
setParams(obj3, assign) {
|
|
28617
|
+
if (assign) Object.assign(this.params, obj3);
|
|
28618
|
+
else this.params = obj3;
|
|
28619
28619
|
}
|
|
28620
28620
|
block$data(valid, codeBlock, $dataValid = codegen_1.nil) {
|
|
28621
28621
|
this.gen.block(() => {
|
|
@@ -29126,9 +29126,9 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
29126
29126
|
isIPV6: true
|
|
29127
29127
|
};
|
|
29128
29128
|
}
|
|
29129
|
-
function findToken(
|
|
29129
|
+
function findToken(str4, token) {
|
|
29130
29130
|
let ind = 0;
|
|
29131
|
-
for (let i = 0; i <
|
|
29131
|
+
for (let i = 0; i < str4.length; i++) if (str4[i] === token) ind++;
|
|
29132
29132
|
return ind;
|
|
29133
29133
|
}
|
|
29134
29134
|
function removeDotSegments(path) {
|
|
@@ -29943,7 +29943,7 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
29943
29943
|
const util_1 = require_util();
|
|
29944
29944
|
const $dataRefSchema = require_data();
|
|
29945
29945
|
const uri_1 = require_uri();
|
|
29946
|
-
const defaultRegExp = (
|
|
29946
|
+
const defaultRegExp = (str4, flags) => new RegExp(str4, flags);
|
|
29947
29947
|
defaultRegExp.code = "new RegExp";
|
|
29948
29948
|
const META_IGNORE_OPTIONS = [
|
|
29949
29949
|
"removeAdditional",
|
|
@@ -30649,16 +30649,16 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
30649
30649
|
}));
|
|
30650
30650
|
require_ucs2length = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
30651
30651
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30652
|
-
function ucs2length(
|
|
30653
|
-
const len =
|
|
30652
|
+
function ucs2length(str4) {
|
|
30653
|
+
const len = str4.length;
|
|
30654
30654
|
let length = 0;
|
|
30655
30655
|
let pos = 0;
|
|
30656
30656
|
let value;
|
|
30657
30657
|
while (pos < len) {
|
|
30658
30658
|
length++;
|
|
30659
|
-
value =
|
|
30659
|
+
value = str4.charCodeAt(pos++);
|
|
30660
30660
|
if (value >= 55296 && value <= 56319 && pos < len) {
|
|
30661
|
-
value =
|
|
30661
|
+
value = str4.charCodeAt(pos);
|
|
30662
30662
|
if ((value & 64512) === 56320) pos++;
|
|
30663
30663
|
}
|
|
30664
30664
|
}
|
|
@@ -33353,7 +33353,7 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
33353
33353
|
function isLeapYear(year) {
|
|
33354
33354
|
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
33355
33355
|
}
|
|
33356
|
-
const
|
|
33356
|
+
const DATE2 = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
|
|
33357
33357
|
const DAYS = [
|
|
33358
33358
|
0,
|
|
33359
33359
|
31,
|
|
@@ -33369,8 +33369,8 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
33369
33369
|
30,
|
|
33370
33370
|
31
|
|
33371
33371
|
];
|
|
33372
|
-
function date5(
|
|
33373
|
-
const matches =
|
|
33372
|
+
function date5(str4) {
|
|
33373
|
+
const matches = DATE2.exec(str4);
|
|
33374
33374
|
if (!matches) return false;
|
|
33375
33375
|
const year = +matches[1];
|
|
33376
33376
|
const month = +matches[2];
|
|
@@ -33385,8 +33385,8 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
33385
33385
|
}
|
|
33386
33386
|
const TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
33387
33387
|
function getTime(strictTimeZone) {
|
|
33388
|
-
return function time3(
|
|
33389
|
-
const matches = TIME.exec(
|
|
33388
|
+
return function time3(str4) {
|
|
33389
|
+
const matches = TIME.exec(str4);
|
|
33390
33390
|
if (!matches) return false;
|
|
33391
33391
|
const hr = +matches[1];
|
|
33392
33392
|
const min = +matches[2];
|
|
@@ -33423,8 +33423,8 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
33423
33423
|
const DATE_TIME_SEPARATOR = /t|\s/i;
|
|
33424
33424
|
function getDateTime(strictTimeZone) {
|
|
33425
33425
|
const time3 = getTime(strictTimeZone);
|
|
33426
|
-
return function date_time(
|
|
33427
|
-
const dateTime =
|
|
33426
|
+
return function date_time(str4) {
|
|
33427
|
+
const dateTime = str4.split(DATE_TIME_SEPARATOR);
|
|
33428
33428
|
return dateTime.length === 2 && date5(dateTime[0]) && time3(dateTime[1]);
|
|
33429
33429
|
};
|
|
33430
33430
|
}
|
|
@@ -33445,13 +33445,13 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
33445
33445
|
}
|
|
33446
33446
|
const NOT_URI_FRAGMENT = /\/|:/;
|
|
33447
33447
|
const URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
33448
|
-
function uri(
|
|
33449
|
-
return NOT_URI_FRAGMENT.test(
|
|
33448
|
+
function uri(str4) {
|
|
33449
|
+
return NOT_URI_FRAGMENT.test(str4) && URI.test(str4);
|
|
33450
33450
|
}
|
|
33451
33451
|
const BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
|
|
33452
|
-
function byte(
|
|
33452
|
+
function byte(str4) {
|
|
33453
33453
|
BYTE.lastIndex = 0;
|
|
33454
|
-
return BYTE.test(
|
|
33454
|
+
return BYTE.test(str4);
|
|
33455
33455
|
}
|
|
33456
33456
|
const MIN_INT32 = -(2 ** 31);
|
|
33457
33457
|
const MAX_INT32 = 2 ** 31 - 1;
|
|
@@ -33465,10 +33465,10 @@ var init_ajvProvider_DyjnscPj = __esm({
|
|
|
33465
33465
|
return true;
|
|
33466
33466
|
}
|
|
33467
33467
|
const Z_ANCHOR = /[^\\]\\Z/;
|
|
33468
|
-
function regex(
|
|
33469
|
-
if (Z_ANCHOR.test(
|
|
33468
|
+
function regex(str4) {
|
|
33469
|
+
if (Z_ANCHOR.test(str4)) return false;
|
|
33470
33470
|
try {
|
|
33471
|
-
new RegExp(
|
|
33471
|
+
new RegExp(str4);
|
|
33472
33472
|
return true;
|
|
33473
33473
|
} catch (e) {
|
|
33474
33474
|
return false;
|
|
@@ -36098,9 +36098,9 @@ function redactValues(text, values, opts = {}) {
|
|
|
36098
36098
|
return out;
|
|
36099
36099
|
}
|
|
36100
36100
|
function truncateErrorMessage(text, max = DEFAULT_ERROR_MESSAGE_MAX, opts = {}) {
|
|
36101
|
-
const
|
|
36101
|
+
const str4 = text === null || text === void 0 ? "" : String(text);
|
|
36102
36102
|
const cap = Math.max(ERROR_REDACTION_INPUT_MAX, max);
|
|
36103
|
-
const capped =
|
|
36103
|
+
const capped = str4.length > cap ? str4.slice(0, cap) : str4;
|
|
36104
36104
|
const scrubbed = opts.values !== void 0 ? redactValues(capped, opts.values, opts.placeholder !== void 0 ? { placeholder: opts.placeholder } : {}) : capped;
|
|
36105
36105
|
const redacted = redactSecrets(scrubbed);
|
|
36106
36106
|
if (redacted.length <= max)
|
|
@@ -38523,7 +38523,7 @@ var init_version = __esm({
|
|
|
38523
38523
|
"src/version.ts"() {
|
|
38524
38524
|
"use strict";
|
|
38525
38525
|
PACKAGE_NAME = "microsoft-teams-mcp";
|
|
38526
|
-
VERSION = "0.
|
|
38526
|
+
VERSION = "0.11.0";
|
|
38527
38527
|
}
|
|
38528
38528
|
});
|
|
38529
38529
|
|
|
@@ -43636,7 +43636,7 @@ var require_websocket = __commonJS({
|
|
|
43636
43636
|
BINARY_TYPES,
|
|
43637
43637
|
CLOSE_TIMEOUT,
|
|
43638
43638
|
EMPTY_BUFFER,
|
|
43639
|
-
GUID:
|
|
43639
|
+
GUID: GUID4,
|
|
43640
43640
|
kForOnEventAttribute,
|
|
43641
43641
|
kListener,
|
|
43642
43642
|
kStatusCode,
|
|
@@ -44312,7 +44312,7 @@ var require_websocket = __commonJS({
|
|
|
44312
44312
|
abortHandshake(websocket, socket, "Invalid Upgrade header");
|
|
44313
44313
|
return;
|
|
44314
44314
|
}
|
|
44315
|
-
const digest = createHash5("sha1").update(key +
|
|
44315
|
+
const digest = createHash5("sha1").update(key + GUID4).digest("base64");
|
|
44316
44316
|
if (res.headers["sec-websocket-accept"] !== digest) {
|
|
44317
44317
|
abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
|
|
44318
44318
|
return;
|
|
@@ -44691,7 +44691,7 @@ var require_websocket_server = __commonJS({
|
|
|
44691
44691
|
var PerMessageDeflate2 = require_permessage_deflate();
|
|
44692
44692
|
var subprotocol2 = require_subprotocol();
|
|
44693
44693
|
var WebSocket2 = require_websocket();
|
|
44694
|
-
var { CLOSE_TIMEOUT, GUID:
|
|
44694
|
+
var { CLOSE_TIMEOUT, GUID: GUID4, kWebSocket } = require_constants();
|
|
44695
44695
|
var keyRegex = /^[+/0-9A-Za-z]{22}==$/;
|
|
44696
44696
|
var RUNNING = 0;
|
|
44697
44697
|
var CLOSING = 1;
|
|
@@ -44993,7 +44993,7 @@ var require_websocket_server = __commonJS({
|
|
|
44993
44993
|
);
|
|
44994
44994
|
}
|
|
44995
44995
|
if (this._state > RUNNING) return abortHandshake(socket, 503);
|
|
44996
|
-
const digest = createHash5("sha1").update(key +
|
|
44996
|
+
const digest = createHash5("sha1").update(key + GUID4).digest("base64");
|
|
44997
44997
|
const headers = [
|
|
44998
44998
|
"HTTP/1.1 101 Switching Protocols",
|
|
44999
44999
|
"Upgrade: websocket",
|
|
@@ -49964,7 +49964,7 @@ function sharePointCaptureDecl(host) {
|
|
|
49964
49964
|
}
|
|
49965
49965
|
function bridgeCaptureDecls(sharePointHosts) {
|
|
49966
49966
|
const hosts = [...new Set([...sharePointHosts].map((h) => h.toLowerCase()).filter(isSharePointHost))].sort();
|
|
49967
|
-
return [{ ...CAPTURE_DECL }, { ...SUBSTRATE_CAPTURE_DECL }, ...hosts.map(sharePointCaptureDecl)];
|
|
49967
|
+
return [{ ...CAPTURE_DECL }, { ...SUBSTRATE_CAPTURE_DECL }, { ...RECAP_CAPTURE_DECL }, ...hosts.map(sharePointCaptureDecl)];
|
|
49968
49968
|
}
|
|
49969
49969
|
function bridgeScopePath(env = process.env) {
|
|
49970
49970
|
return join10(dirname5(sharePointTokenCachePath(env)), "bridge-scope.json");
|
|
@@ -50008,7 +50008,7 @@ function withBridgeScope(opts, env, extraSharePointHosts = []) {
|
|
|
50008
50008
|
captureHeaders: bridgeCaptureDecls(hosts)
|
|
50009
50009
|
};
|
|
50010
50010
|
}
|
|
50011
|
-
var CAPTURE_DECL, SUBSTRATE_CAPTURE_DECL, BRIDGE_TRUST_DOMAINS;
|
|
50011
|
+
var CAPTURE_DECL, SUBSTRATE_CAPTURE_DECL, RECAP_CAPTURE_DECL, BRIDGE_TRUST_DOMAINS;
|
|
50012
50012
|
var init_bridge_scope = __esm({
|
|
50013
50013
|
"src/bridge-scope.ts"() {
|
|
50014
50014
|
"use strict";
|
|
@@ -50026,6 +50026,11 @@ var init_bridge_scope = __esm({
|
|
|
50026
50026
|
path: "/searchservice/*",
|
|
50027
50027
|
headerName: "authorization"
|
|
50028
50028
|
};
|
|
50029
|
+
RECAP_CAPTURE_DECL = {
|
|
50030
|
+
host: "teams.cloud.microsoft",
|
|
50031
|
+
path: "/api/mcps/*",
|
|
50032
|
+
headerName: "authorization"
|
|
50033
|
+
};
|
|
50029
50034
|
BRIDGE_TRUST_DOMAINS = [CAPTURE_DECL.host, "sharepoint.com", SUBSTRATE_CAPTURE_DECL.host];
|
|
50030
50035
|
}
|
|
50031
50036
|
});
|
|
@@ -50200,6 +50205,38 @@ var init_substrate_auth = __esm({
|
|
|
50200
50205
|
}
|
|
50201
50206
|
});
|
|
50202
50207
|
|
|
50208
|
+
// src/recap-auth.ts
|
|
50209
|
+
var recap_auth_exports = {};
|
|
50210
|
+
__export(recap_auth_exports, {
|
|
50211
|
+
RECAP_CAPTURE_DECL: () => RECAP_CAPTURE_DECL,
|
|
50212
|
+
captureRecapTokenViaFetchproxy: () => captureRecapTokenViaFetchproxy
|
|
50213
|
+
});
|
|
50214
|
+
async function captureRecapTokenViaFetchproxy(env = process.env) {
|
|
50215
|
+
return captureBearerHeader({
|
|
50216
|
+
// The one bridge scope every capture of this server declares (`bridge-scope.ts`).
|
|
50217
|
+
captures: [{ ...RECAP_CAPTURE_DECL }],
|
|
50218
|
+
domains: [...BRIDGE_TRUST_DOMAINS],
|
|
50219
|
+
windowMs: captureWindowMs(env),
|
|
50220
|
+
port: getWsPort(),
|
|
50221
|
+
serverName: PACKAGE_NAME,
|
|
50222
|
+
version: VERSION,
|
|
50223
|
+
what: "a Teams meeting-recap token",
|
|
50224
|
+
guidance: "In a signed-in teams.cloud.microsoft tab, open any meeting chat and click its Recap tab \u2014 that is what makes Teams call its meeting-recap service, where the token is read from \u2014 then retry. If the ContextMint Bridge asks to re-pair microsoft-teams-mcp, approve it once: the recap capture is new to its scope.",
|
|
50225
|
+
createTransport: bridgeScopedTransport(env)
|
|
50226
|
+
});
|
|
50227
|
+
}
|
|
50228
|
+
var init_recap_auth = __esm({
|
|
50229
|
+
"src/recap-auth.ts"() {
|
|
50230
|
+
"use strict";
|
|
50231
|
+
init_fetchproxy();
|
|
50232
|
+
init_capture_window();
|
|
50233
|
+
init_auth_fetchproxy();
|
|
50234
|
+
init_bridge_scope();
|
|
50235
|
+
init_version();
|
|
50236
|
+
init_bridge_scope();
|
|
50237
|
+
}
|
|
50238
|
+
});
|
|
50239
|
+
|
|
50203
50240
|
// src/index.ts
|
|
50204
50241
|
init_dist2();
|
|
50205
50242
|
init_version();
|
|
@@ -50459,11 +50496,11 @@ function fileAttachments(raw) {
|
|
|
50459
50496
|
if (f === null || typeof f !== "object") continue;
|
|
50460
50497
|
const o = f;
|
|
50461
50498
|
const info = o.fileInfo && typeof o.fileInfo === "object" ? o.fileInfo : {};
|
|
50462
|
-
const
|
|
50463
|
-
const name =
|
|
50464
|
-
const type =
|
|
50465
|
-
const openUrl =
|
|
50466
|
-
const url2 =
|
|
50499
|
+
const str4 = (v) => typeof v === "string" && v !== "" ? v : void 0;
|
|
50500
|
+
const name = str4(o.fileName) ?? str4(o.title) ?? "(file)";
|
|
50501
|
+
const type = str4(o.fileType) ?? str4(o.type);
|
|
50502
|
+
const openUrl = str4(o.openUrl) ?? str4(info.shareUrl);
|
|
50503
|
+
const url2 = str4(o.objectUrl) ?? str4(info.fileUrl);
|
|
50467
50504
|
out.push({
|
|
50468
50505
|
name,
|
|
50469
50506
|
...type !== void 0 ? { type } : {},
|
|
@@ -51858,6 +51895,299 @@ function checkStatus(status, lookup) {
|
|
|
51858
51895
|
});
|
|
51859
51896
|
}
|
|
51860
51897
|
|
|
51898
|
+
// src/recap.ts
|
|
51899
|
+
init_dist2();
|
|
51900
|
+
init_session();
|
|
51901
|
+
|
|
51902
|
+
// src/recap-token-cache.ts
|
|
51903
|
+
init_session();
|
|
51904
|
+
init_dist2();
|
|
51905
|
+
init_token_cache();
|
|
51906
|
+
function recapTokenCachePath(env = process.env) {
|
|
51907
|
+
return resolveStateFile({
|
|
51908
|
+
env,
|
|
51909
|
+
envVar: "TEAMS_RECAP_TOKEN_FILE",
|
|
51910
|
+
subdir: ".microsoft-teams-mcp",
|
|
51911
|
+
fileName: "recap-token.json"
|
|
51912
|
+
});
|
|
51913
|
+
}
|
|
51914
|
+
function createRecapTokenCache(env = process.env) {
|
|
51915
|
+
if (!parseBoolEnv("TEAMS_TOKEN_CACHE", { env, default: true })) return null;
|
|
51916
|
+
if (parseBoolEnv("TEAMS_DISABLE_FETCHPROXY", { env })) return null;
|
|
51917
|
+
const file2 = createFileStatePersistence({
|
|
51918
|
+
filePath: recapTokenCachePath(env),
|
|
51919
|
+
boundTo: "fetchproxy",
|
|
51920
|
+
validate: (raw) => isBearerTokens(raw) ? raw : null
|
|
51921
|
+
});
|
|
51922
|
+
return {
|
|
51923
|
+
load: () => file2.load(),
|
|
51924
|
+
save(tokens) {
|
|
51925
|
+
try {
|
|
51926
|
+
file2.save(tokens);
|
|
51927
|
+
} catch (err) {
|
|
51928
|
+
reportCacheWriteFailure(err);
|
|
51929
|
+
}
|
|
51930
|
+
},
|
|
51931
|
+
clear() {
|
|
51932
|
+
try {
|
|
51933
|
+
file2.clear();
|
|
51934
|
+
} catch (err) {
|
|
51935
|
+
reportCacheWriteFailure(err);
|
|
51936
|
+
}
|
|
51937
|
+
}
|
|
51938
|
+
};
|
|
51939
|
+
}
|
|
51940
|
+
|
|
51941
|
+
// src/recap.ts
|
|
51942
|
+
var DEFAULT_MCPS_REGION = "us";
|
|
51943
|
+
var REQUEST_TIMEOUT_MS4 = 3e4;
|
|
51944
|
+
var MAX_RESPONSE_BYTES2 = 4 * 1024 * 1024;
|
|
51945
|
+
var GUID2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
51946
|
+
var GOID = /^[0-9a-f]{40,256}$/i;
|
|
51947
|
+
var THREAD_ID = /^19:[A-Za-z0-9_-]+@thread\.(?:v2|tacv2|skype)$/;
|
|
51948
|
+
var DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
51949
|
+
var EPOCH_TICKS = 621355968000000000n;
|
|
51950
|
+
async function captureRecapTokenLazily() {
|
|
51951
|
+
const mod = await Promise.resolve().then(() => (init_recap_auth(), recap_auth_exports));
|
|
51952
|
+
return mod.captureRecapTokenViaFetchproxy();
|
|
51953
|
+
}
|
|
51954
|
+
function obj2(v) {
|
|
51955
|
+
return v !== null && typeof v === "object" && !Array.isArray(v) ? v : void 0;
|
|
51956
|
+
}
|
|
51957
|
+
function str2(v) {
|
|
51958
|
+
return typeof v === "string" && v.trim() !== "" ? v.trim() : void 0;
|
|
51959
|
+
}
|
|
51960
|
+
function isoOf2(v) {
|
|
51961
|
+
const s = str2(v);
|
|
51962
|
+
if (s === void 0) return void 0;
|
|
51963
|
+
const ms = Date.parse(s);
|
|
51964
|
+
return Number.isFinite(ms) ? new Date(ms).toISOString() : void 0;
|
|
51965
|
+
}
|
|
51966
|
+
function httpsUrl(v) {
|
|
51967
|
+
const s = str2(v);
|
|
51968
|
+
return s !== void 0 && /^https:\/\//i.test(s) ? s : void 0;
|
|
51969
|
+
}
|
|
51970
|
+
function parseMeetingInfo(thread) {
|
|
51971
|
+
const raw = thread.properties?.meeting;
|
|
51972
|
+
let m;
|
|
51973
|
+
if (typeof raw === "string") {
|
|
51974
|
+
try {
|
|
51975
|
+
m = obj2(JSON.parse(raw));
|
|
51976
|
+
} catch {
|
|
51977
|
+
return void 0;
|
|
51978
|
+
}
|
|
51979
|
+
} else {
|
|
51980
|
+
m = obj2(raw);
|
|
51981
|
+
}
|
|
51982
|
+
const iCalUid = str2(m?.iCalUid);
|
|
51983
|
+
const organizerId = str2(m?.organizerId);
|
|
51984
|
+
const tenantId = str2(m?.tenantId);
|
|
51985
|
+
if (m === void 0 || iCalUid === void 0 || organizerId === void 0 || tenantId === void 0) return void 0;
|
|
51986
|
+
if (!GOID.test(iCalUid) || !GUID2.test(organizerId) || !GUID2.test(tenantId)) return void 0;
|
|
51987
|
+
const subject = str2(m.subject);
|
|
51988
|
+
const seriesStart = isoOf2(m.startTime);
|
|
51989
|
+
const joinUrl = httpsUrl(m.meetingJoinUrl);
|
|
51990
|
+
return {
|
|
51991
|
+
...subject !== void 0 ? { subject } : {},
|
|
51992
|
+
iCalUid,
|
|
51993
|
+
organizerId,
|
|
51994
|
+
tenantId,
|
|
51995
|
+
recurring: m.meetingType === "Recurring",
|
|
51996
|
+
...seriesStart !== void 0 ? { seriesStart } : {},
|
|
51997
|
+
...joinUrl !== void 0 ? { joinUrl } : {}
|
|
51998
|
+
};
|
|
51999
|
+
}
|
|
52000
|
+
function isOccurrenceDate(date5) {
|
|
52001
|
+
const m = DATE.exec(date5);
|
|
52002
|
+
if (!m) return false;
|
|
52003
|
+
const d = new Date(Date.UTC(Number(m[1]), Number(m[2]) - 1, Number(m[3])));
|
|
52004
|
+
return d.toISOString().slice(0, 10) === date5;
|
|
52005
|
+
}
|
|
52006
|
+
function occurrenceUid(iCalUid, date5) {
|
|
52007
|
+
if (!GOID.test(iCalUid)) throw new Error(`not a meeting id: ${JSON.stringify(iCalUid)}`);
|
|
52008
|
+
if (!isOccurrenceDate(date5)) throw new Error(`not a YYYY-MM-DD date: ${JSON.stringify(date5)}`);
|
|
52009
|
+
const [y, mo, d] = date5.split("-").map(Number);
|
|
52010
|
+
const hex3 = [y >> 8, y & 255, mo, d].map((b) => b.toString(16).padStart(2, "0")).join("").toUpperCase();
|
|
52011
|
+
return iCalUid.slice(0, 32) + hex3 + iCalUid.slice(40);
|
|
52012
|
+
}
|
|
52013
|
+
function mcpsBase(env = process.env) {
|
|
52014
|
+
const region = readEnvVar("TEAMS_MCPS_REGION", { env }) ?? DEFAULT_MCPS_REGION;
|
|
52015
|
+
return `https://teams.cloud.microsoft/api/mcps/${encodeURIComponent(region)}`;
|
|
52016
|
+
}
|
|
52017
|
+
function collabObjectUrl(base, meeting, uid, threadId) {
|
|
52018
|
+
if (!GUID2.test(meeting.organizerId) || !GUID2.test(meeting.tenantId)) throw new Error("not a meeting organizer");
|
|
52019
|
+
if (!GOID.test(uid)) throw new Error(`not a meeting id: ${JSON.stringify(uid)}`);
|
|
52020
|
+
if (!THREAD_ID.test(threadId)) throw new Error(`not a meeting thread id: ${JSON.stringify(threadId)}`);
|
|
52021
|
+
return `${base}/collab/readcollabobject/V2/${meeting.organizerId}@${meeting.tenantId}/${uid}/${threadId}`;
|
|
52022
|
+
}
|
|
52023
|
+
function ticksToIso(ticks) {
|
|
52024
|
+
const s = str2(ticks);
|
|
52025
|
+
if (s === void 0 || !/^\d{15,20}$/.test(s)) return void 0;
|
|
52026
|
+
const ms = Number((BigInt(s) - EPOCH_TICKS) / 10000n);
|
|
52027
|
+
return Number.isFinite(ms) && ms > 0 ? new Date(ms).toISOString() : void 0;
|
|
52028
|
+
}
|
|
52029
|
+
function hms(totalSeconds) {
|
|
52030
|
+
const s = Math.floor(totalSeconds);
|
|
52031
|
+
return `${Math.floor(s / 3600)}:${String(Math.floor(s % 3600 / 60)).padStart(2, "0")}:${String(s % 60).padStart(2, "0")}`;
|
|
52032
|
+
}
|
|
52033
|
+
function timespan(v) {
|
|
52034
|
+
const m = /^(\d+):(\d{2}):(\d{2})/.exec(str2(v) ?? "");
|
|
52035
|
+
return m ? hms(Number(m[1]) * 3600 + Number(m[2]) * 60 + Number(m[3])) : void 0;
|
|
52036
|
+
}
|
|
52037
|
+
function parseCollabObject(body) {
|
|
52038
|
+
const list = obj2(body)?.resources;
|
|
52039
|
+
if (!Array.isArray(list)) return [];
|
|
52040
|
+
const byId = /* @__PURE__ */ new Map();
|
|
52041
|
+
for (const raw of list) {
|
|
52042
|
+
const r = obj2(raw);
|
|
52043
|
+
const id = str2(r?.id);
|
|
52044
|
+
const type = str2(r?.type);
|
|
52045
|
+
if (r === void 0 || id === void 0 || type === void 0 || byId.has(id)) continue;
|
|
52046
|
+
const location = str2(r.location);
|
|
52047
|
+
const added = isoOf2(r.additionDateTime);
|
|
52048
|
+
byId.set(id, {
|
|
52049
|
+
id,
|
|
52050
|
+
type,
|
|
52051
|
+
...location !== void 0 ? { location } : {},
|
|
52052
|
+
metadata: obj2(r.metadata) ?? {},
|
|
52053
|
+
...added !== void 0 ? { added } : {}
|
|
52054
|
+
});
|
|
52055
|
+
}
|
|
52056
|
+
return [...byId.values()];
|
|
52057
|
+
}
|
|
52058
|
+
function compact(o) {
|
|
52059
|
+
return Object.fromEntries(Object.entries(o).filter(([, v]) => v !== void 0));
|
|
52060
|
+
}
|
|
52061
|
+
function summarizeRecap(resources) {
|
|
52062
|
+
const out = {
|
|
52063
|
+
recordings: [],
|
|
52064
|
+
transcripts: [],
|
|
52065
|
+
notes: [],
|
|
52066
|
+
attendance_reports: [],
|
|
52067
|
+
files: [],
|
|
52068
|
+
other: []
|
|
52069
|
+
};
|
|
52070
|
+
for (const r of resources) {
|
|
52071
|
+
const md = r.metadata;
|
|
52072
|
+
switch (r.type) {
|
|
52073
|
+
case "Recording": {
|
|
52074
|
+
const started = ticksToIso(md.startTime);
|
|
52075
|
+
const ended = ticksToIso(md.endTime);
|
|
52076
|
+
const duration3 = started && ended ? hms((Date.parse(ended) - Date.parse(started)) / 1e3) : void 0;
|
|
52077
|
+
out.recordings.push(compact({ started, ended, duration: duration3, url: httpsUrl(r.location) }));
|
|
52078
|
+
break;
|
|
52079
|
+
}
|
|
52080
|
+
case "TranscriptV2":
|
|
52081
|
+
out.transcripts.push(compact({ started: ticksToIso(md.startTime), duration: timespan(md.duration), url: httpsUrl(md.webUrl) }));
|
|
52082
|
+
break;
|
|
52083
|
+
case "transcript":
|
|
52084
|
+
out.transcripts.push(compact({ started: isoOf2(md.startTime), state: str2(md.state) }));
|
|
52085
|
+
break;
|
|
52086
|
+
case "notes":
|
|
52087
|
+
out.notes.push(compact({ url: httpsUrl(r.location), added: r.added }));
|
|
52088
|
+
break;
|
|
52089
|
+
case "AttendanceReport":
|
|
52090
|
+
out.attendance_reports.push(compact({ started: ticksToIso(md.startTime), url: httpsUrl(md.webUrl) ?? httpsUrl(r.location) }));
|
|
52091
|
+
break;
|
|
52092
|
+
case "MeetingChat":
|
|
52093
|
+
case "MeetingStage":
|
|
52094
|
+
out.files.push(
|
|
52095
|
+
compact({
|
|
52096
|
+
name: str2(md.fileTitle),
|
|
52097
|
+
file_type: str2(md.fileType),
|
|
52098
|
+
app: str2(md.appTitle),
|
|
52099
|
+
shared_in: r.type === "MeetingChat" ? "chat" : "meeting",
|
|
52100
|
+
url: httpsUrl(md.shareUrl) ?? httpsUrl(r.location),
|
|
52101
|
+
added: r.added
|
|
52102
|
+
})
|
|
52103
|
+
);
|
|
52104
|
+
break;
|
|
52105
|
+
case "AISummary":
|
|
52106
|
+
out.ai_summary = compact({ exists: true, generated: r.added });
|
|
52107
|
+
break;
|
|
52108
|
+
default:
|
|
52109
|
+
out.other.push(compact({ type: r.type, url: httpsUrl(r.location), added: r.added }));
|
|
52110
|
+
}
|
|
52111
|
+
}
|
|
52112
|
+
return Object.fromEntries(
|
|
52113
|
+
Object.entries(out).filter(([, v]) => v !== void 0 && (!Array.isArray(v) || v.length > 0))
|
|
52114
|
+
);
|
|
52115
|
+
}
|
|
52116
|
+
var RecapClient = class {
|
|
52117
|
+
#fetchImpl;
|
|
52118
|
+
#base;
|
|
52119
|
+
#configError = null;
|
|
52120
|
+
#manager;
|
|
52121
|
+
constructor(opts = {}) {
|
|
52122
|
+
const env = opts.env ?? process.env;
|
|
52123
|
+
this.#fetchImpl = opts.fetchImpl ?? ((input2, init) => fetch(input2, init));
|
|
52124
|
+
this.#base = mcpsBase(env);
|
|
52125
|
+
this.#manager = createCapturedTokenManager({
|
|
52126
|
+
capture: opts.captureToken ?? captureRecapTokenLazily,
|
|
52127
|
+
persistence: createRecapTokenCache(env)
|
|
52128
|
+
});
|
|
52129
|
+
if (parseBoolEnv("TEAMS_DISABLE_FETCHPROXY", { env })) {
|
|
52130
|
+
this.#configError = new McpToolError("Meeting recaps are disabled (no token source).", {
|
|
52131
|
+
kind: "no_credential",
|
|
52132
|
+
hint: "Unset TEAMS_DISABLE_FETCHPROXY so a recap token can be captured from a signed-in Teams tab."
|
|
52133
|
+
});
|
|
52134
|
+
}
|
|
52135
|
+
}
|
|
52136
|
+
isConfigured() {
|
|
52137
|
+
return this.#configError === null;
|
|
52138
|
+
}
|
|
52139
|
+
async readCollabObject(meeting, uid, threadId) {
|
|
52140
|
+
if (this.#configError) throw this.#configError;
|
|
52141
|
+
const url2 = collabObjectUrl(this.#base, meeting, uid, threadId);
|
|
52142
|
+
let text = "";
|
|
52143
|
+
const res = await this.#manager.withAuth(async (token) => {
|
|
52144
|
+
let r;
|
|
52145
|
+
try {
|
|
52146
|
+
r = await fetchBounded(
|
|
52147
|
+
url2,
|
|
52148
|
+
{ method: "GET", headers: { authorization: `Bearer ${token}`, accept: "application/json" }, redirect: "error" },
|
|
52149
|
+
{ read: "text", maxBytes: MAX_RESPONSE_BYTES2, service: "Teams meeting recap", timeoutMs: REQUEST_TIMEOUT_MS4, fetchImpl: this.#fetchImpl }
|
|
52150
|
+
);
|
|
52151
|
+
} catch (e) {
|
|
52152
|
+
throw describeTransportFailure2(e, url2, "Teams meeting recap") ?? e;
|
|
52153
|
+
}
|
|
52154
|
+
text = r.body;
|
|
52155
|
+
return r.res;
|
|
52156
|
+
});
|
|
52157
|
+
checkStatus2(res.status);
|
|
52158
|
+
try {
|
|
52159
|
+
return parseCollabObject(JSON.parse(text));
|
|
52160
|
+
} catch {
|
|
52161
|
+
throw new McpToolError("The Teams meeting-recap service returned a response that is not JSON.", { status: res.status, kind: "http" });
|
|
52162
|
+
}
|
|
52163
|
+
}
|
|
52164
|
+
};
|
|
52165
|
+
function checkStatus2(status) {
|
|
52166
|
+
if (status >= 200 && status < 300) return;
|
|
52167
|
+
if (status === 401) {
|
|
52168
|
+
throw new McpToolError("The Teams meeting-recap service rejected the recap token (401) even after a fresh capture.", {
|
|
52169
|
+
status,
|
|
52170
|
+
kind: "credential_rejected",
|
|
52171
|
+
hint: "Open a meeting chat's Recap tab in a signed-in Teams tab to mint a fresh recap token, then retry."
|
|
52172
|
+
});
|
|
52173
|
+
}
|
|
52174
|
+
if (status === 403) {
|
|
52175
|
+
throw new McpToolError("You are not allowed to read this meeting's recap (403).", { status, kind: "http" });
|
|
52176
|
+
}
|
|
52177
|
+
if (status === 429) {
|
|
52178
|
+
throw new McpToolError("The Teams meeting-recap service is rate-limiting requests (429).", {
|
|
52179
|
+
status,
|
|
52180
|
+
kind: "http",
|
|
52181
|
+
hint: "Wait a minute before retrying."
|
|
52182
|
+
});
|
|
52183
|
+
}
|
|
52184
|
+
throw new McpToolError(`The Teams meeting-recap service returned HTTP ${status}.`, {
|
|
52185
|
+
status,
|
|
52186
|
+
kind: "http",
|
|
52187
|
+
...status >= 500 ? { hint: "A Teams-side failure; retry shortly." } : {}
|
|
52188
|
+
});
|
|
52189
|
+
}
|
|
52190
|
+
|
|
51861
52191
|
// src/tools/chat.ts
|
|
51862
52192
|
init_dist2();
|
|
51863
52193
|
init_zod();
|
|
@@ -54494,10 +54824,10 @@ function decodeExportCursor(cursor) {
|
|
|
54494
54824
|
}
|
|
54495
54825
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
|
|
54496
54826
|
throw bad();
|
|
54497
|
-
const
|
|
54498
|
-
if (
|
|
54827
|
+
const obj3 = parsed;
|
|
54828
|
+
if (obj3.v !== CURSOR_VERSION)
|
|
54499
54829
|
throw bad();
|
|
54500
|
-
return
|
|
54830
|
+
return obj3;
|
|
54501
54831
|
}
|
|
54502
54832
|
function jsonlLine(value) {
|
|
54503
54833
|
const s = JSON.stringify(value);
|
|
@@ -55454,13 +55784,13 @@ init_dist2();
|
|
|
55454
55784
|
// src/tools/people.ts
|
|
55455
55785
|
init_dist2();
|
|
55456
55786
|
var MRI = /^\d+:\S+$/;
|
|
55457
|
-
var
|
|
55787
|
+
var GUID3 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
55458
55788
|
var RECENT_MESSAGES = 200;
|
|
55459
55789
|
var MAX_CANDIDATES2 = 10;
|
|
55460
55790
|
function personMri(input2) {
|
|
55461
55791
|
const s = input2.trim();
|
|
55462
55792
|
if (MRI.test(s)) return s;
|
|
55463
|
-
if (
|
|
55793
|
+
if (GUID3.test(s)) return `8:orgid:${s.toLowerCase()}`;
|
|
55464
55794
|
return void 0;
|
|
55465
55795
|
}
|
|
55466
55796
|
function normaliseName(name) {
|
|
@@ -56422,13 +56752,13 @@ function activityOf(m) {
|
|
|
56422
56752
|
}
|
|
56423
56753
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
56424
56754
|
}
|
|
56425
|
-
function
|
|
56755
|
+
function str3(v) {
|
|
56426
56756
|
if (typeof v === "string") return v === "" ? void 0 : v;
|
|
56427
56757
|
if (typeof v === "number" && Number.isFinite(v)) return String(v);
|
|
56428
56758
|
return void 0;
|
|
56429
56759
|
}
|
|
56430
56760
|
function isoOrUndefined(v) {
|
|
56431
|
-
const s =
|
|
56761
|
+
const s = str3(v);
|
|
56432
56762
|
if (s === void 0) return void 0;
|
|
56433
56763
|
const ms = /^\d+$/.test(s) ? Number(s) : Date.parse(s);
|
|
56434
56764
|
return Number.isFinite(ms) ? new Date(ms).toISOString() : void 0;
|
|
@@ -56440,25 +56770,25 @@ function activityRow(m) {
|
|
|
56440
56770
|
if (m.properties?.deletetime) return void 0;
|
|
56441
56771
|
const a = activityOf(m);
|
|
56442
56772
|
if (a === void 0) return void 0;
|
|
56443
|
-
const type =
|
|
56444
|
-
const replyChain =
|
|
56773
|
+
const type = str3(a.activityType) ?? "";
|
|
56774
|
+
const replyChain = str3(a.sourceReplyChainId);
|
|
56445
56775
|
const isread = m.properties?.isread;
|
|
56446
56776
|
return {
|
|
56447
56777
|
id: m.id,
|
|
56448
56778
|
time: isoOrUndefined(a.activityTimestamp) ?? isoOrUndefined(m.originalarrivaltime),
|
|
56449
56779
|
kind: activityKind(type),
|
|
56450
56780
|
type,
|
|
56451
|
-
subtype:
|
|
56781
|
+
subtype: str3(a.activitySubtype) ?? "",
|
|
56452
56782
|
read: isread === true || isread === "true",
|
|
56453
|
-
from:
|
|
56783
|
+
from: str3(a.sourceUserImDisplayName),
|
|
56454
56784
|
where: {
|
|
56455
|
-
conversation_id:
|
|
56456
|
-
title:
|
|
56457
|
-
type:
|
|
56785
|
+
conversation_id: str3(a.sourceThreadId),
|
|
56786
|
+
title: str3(a.sourceThreadTopic),
|
|
56787
|
+
type: str3(a.sourceThreadType)
|
|
56458
56788
|
},
|
|
56459
|
-
message_id:
|
|
56789
|
+
message_id: str3(a.sourceMessageId),
|
|
56460
56790
|
...replyChain !== void 0 ? { reply_chain_id: replyChain } : {},
|
|
56461
|
-
preview: clip(htmlToText(
|
|
56791
|
+
preview: clip(htmlToText(str3(a.messagePreview) ?? ""))
|
|
56462
56792
|
};
|
|
56463
56793
|
}
|
|
56464
56794
|
async function nameRows(name, rows) {
|
|
@@ -57034,12 +57364,115 @@ function recordingObjectOf(messages, id) {
|
|
|
57034
57364
|
return m === void 0 ? void 0 : parseRecording(m)?.object_id;
|
|
57035
57365
|
}
|
|
57036
57366
|
|
|
57367
|
+
// src/tools/recap.ts
|
|
57368
|
+
init_zod();
|
|
57369
|
+
init_dist2();
|
|
57370
|
+
var MAX_SCAN2 = 1e3;
|
|
57371
|
+
var MAX_PROBE = 5;
|
|
57372
|
+
var MAX_OTHERS2 = 20;
|
|
57373
|
+
var CALL_TYPES = /* @__PURE__ */ new Set(["Event/Call", "RichText/Media_CallRecording", "RichText/Media_CallTranscript"]);
|
|
57374
|
+
function callDays(messages) {
|
|
57375
|
+
const days = /* @__PURE__ */ new Map();
|
|
57376
|
+
for (const m of messages) {
|
|
57377
|
+
if (!CALL_TYPES.has(m.messagetype ?? "")) continue;
|
|
57378
|
+
const ms = Date.parse(m.composetime ?? m.originalarrivaltime ?? "") || Number(m.id);
|
|
57379
|
+
if (!Number.isFinite(ms) || ms <= 0) continue;
|
|
57380
|
+
const day = new Date(ms).toISOString().slice(0, 10);
|
|
57381
|
+
days.set(day, Math.max(days.get(day) ?? 0, ms));
|
|
57382
|
+
}
|
|
57383
|
+
return [...days.entries()].sort((a, b) => b[1] - a[1]).map(([d]) => d);
|
|
57384
|
+
}
|
|
57385
|
+
var isEmpty = (r) => Object.keys(r).length === 0;
|
|
57386
|
+
function hintFor(recap, occurrence, recurring, searched) {
|
|
57387
|
+
const parts = [];
|
|
57388
|
+
if (isEmpty(recap)) {
|
|
57389
|
+
parts.push(
|
|
57390
|
+
recurring && occurrence === void 0 && !searched ? "No call was found in this chat to pick an occurrence from: pass date (YYYY-MM-DD) for the occurrence you want." : `Nothing was recorded or shared for ${occurrence !== void 0 ? `the ${occurrence} occurrence` : "this meeting"}: no recording, transcript, notes or files.`
|
|
57391
|
+
);
|
|
57392
|
+
}
|
|
57393
|
+
if (recap.transcripts !== void 0) parts.push("teams_get_transcript reads a recording's transcript text from this same chat.");
|
|
57394
|
+
if (recap.ai_summary !== void 0) {
|
|
57395
|
+
parts.push("Teams made AI notes (Intelligent Recap) for this meeting; they are shown only in Teams, to licensed users, and are not read here.");
|
|
57396
|
+
}
|
|
57397
|
+
return parts.length > 0 ? parts.join(" ") : void 0;
|
|
57398
|
+
}
|
|
57399
|
+
function registerRecapTools(server, { chatsvc, recap }) {
|
|
57400
|
+
server.registerTool(
|
|
57401
|
+
"teams_get_meeting_recap",
|
|
57402
|
+
{
|
|
57403
|
+
title: "Get a Teams meeting recap",
|
|
57404
|
+
description: `Get what a Teams meeting's Recap tab shows, from its meeting chat (by id or by name, as teams_list_conversations lists it): recordings (start, end, duration, play link), transcripts, the meeting notes (Loop) link, attendance reports, files shared in the meeting chat or on stage (e.g. a whiteboard), and whether Teams made AI notes (their text is not read). A recurring meeting has one recap per occurrence: pass date (YYYY-MM-DD) for one, else the newest day the chat shows a call on that has a recap is returned (up to ${MAX_PROBE} tried), with series (what belongs to the whole series) and other_occurrences (other call days, newest first). For the transcript text use teams_get_transcript. Uses its own token, captured when a Recap tab is opened in Teams. Does not mark anything read.` + UNTRUSTED_DESCRIPTION_SUFFIX2,
|
|
57405
|
+
_meta: workMeta("lookup", {
|
|
57406
|
+
aliases: ["recap", "meeting recap", "meeting notes", "attendance report", "attendance", "recording link", "intelligent recap", "ai notes"]
|
|
57407
|
+
}),
|
|
57408
|
+
annotations: toolAnnotations({ readOnly: true, openWorld: true }),
|
|
57409
|
+
inputSchema: {
|
|
57410
|
+
conversation: external_exports.string().min(1).describe("The meeting chat's id, or a case-insensitive substring of its title."),
|
|
57411
|
+
date: external_exports.string().refine(isOccurrenceDate, "date must be a real day, YYYY-MM-DD").optional().describe("For a recurring meeting: the occurrence, YYYY-MM-DD (the UTC day it met). Default: the newest with a recap.")
|
|
57412
|
+
}
|
|
57413
|
+
},
|
|
57414
|
+
async ({ conversation, date: date5 }) => {
|
|
57415
|
+
try {
|
|
57416
|
+
const [raw, me] = await Promise.all([chatsvc.listConversations(), chatsvc.meMri()]);
|
|
57417
|
+
const summary = await resolveListed(chatsvc, raw, me, conversation, "read the recap of");
|
|
57418
|
+
const meeting = parseMeetingInfo(await chatsvc.getThread(summary.id));
|
|
57419
|
+
if (meeting === void 0) {
|
|
57420
|
+
throw new McpToolError(`"${summary.title}" is not a meeting chat: it has no scheduled meeting to recap.`, {
|
|
57421
|
+
hint: `Pass a meeting's own chat (teams_list_conversations lists them with type "meeting").`
|
|
57422
|
+
});
|
|
57423
|
+
}
|
|
57424
|
+
const read = async (uid) => summarizeRecap(await recap.readCollabObject(meeting, uid, summary.id));
|
|
57425
|
+
const base = {
|
|
57426
|
+
conversation: summary.id,
|
|
57427
|
+
title: summary.title,
|
|
57428
|
+
meeting: {
|
|
57429
|
+
...meeting.subject !== void 0 ? { subject: meeting.subject } : {},
|
|
57430
|
+
recurring: meeting.recurring,
|
|
57431
|
+
...meeting.joinUrl !== void 0 ? { join_url: meeting.joinUrl } : {}
|
|
57432
|
+
}
|
|
57433
|
+
};
|
|
57434
|
+
if (!meeting.recurring) {
|
|
57435
|
+
const r2 = await read(meeting.iCalUid);
|
|
57436
|
+
const hint2 = hintFor(r2, void 0, false, true);
|
|
57437
|
+
return untrustedResult2({ ...base, recap: r2, ...hint2 !== void 0 ? { hint: hint2 } : {} });
|
|
57438
|
+
}
|
|
57439
|
+
const days = date5 !== void 0 ? [date5] : callDays(await chatsvc.getMessages(summary.id, { max: MAX_SCAN2 }));
|
|
57440
|
+
const series = await read(meeting.iCalUid);
|
|
57441
|
+
let chosen;
|
|
57442
|
+
for (const day of days.slice(0, MAX_PROBE)) {
|
|
57443
|
+
const r2 = await read(occurrenceUid(meeting.iCalUid, day));
|
|
57444
|
+
chosen ??= { day, recap: r2 };
|
|
57445
|
+
if (!isEmpty(r2)) {
|
|
57446
|
+
chosen = { day, recap: r2 };
|
|
57447
|
+
break;
|
|
57448
|
+
}
|
|
57449
|
+
}
|
|
57450
|
+
const r = chosen?.recap ?? {};
|
|
57451
|
+
const others = days.filter((d) => d !== chosen?.day).slice(0, MAX_OTHERS2);
|
|
57452
|
+
const hint = hintFor(r, chosen?.day, true, days.length > 0);
|
|
57453
|
+
return untrustedResult2({
|
|
57454
|
+
...base,
|
|
57455
|
+
...chosen !== void 0 ? { occurrence: chosen.day } : {},
|
|
57456
|
+
recap: r,
|
|
57457
|
+
...!isEmpty(series) ? { series } : {},
|
|
57458
|
+
...others.length > 0 ? { other_occurrences: others } : {},
|
|
57459
|
+
...hint !== void 0 ? { hint } : {}
|
|
57460
|
+
});
|
|
57461
|
+
} catch (err) {
|
|
57462
|
+
if (err instanceof AmbiguousConversationError) return untrustedResult2(ambiguousResult(err));
|
|
57463
|
+
throw wrapApiError(err, "get the meeting recap");
|
|
57464
|
+
}
|
|
57465
|
+
}
|
|
57466
|
+
);
|
|
57467
|
+
}
|
|
57468
|
+
|
|
57037
57469
|
// src/index.ts
|
|
57038
57470
|
loadDotenvSafely();
|
|
57039
57471
|
var deps = {
|
|
57040
57472
|
chatsvc: new ChatServiceClient(),
|
|
57041
57473
|
sharepoint: new SharePointClient(),
|
|
57042
|
-
substrate: new SubstrateClient()
|
|
57474
|
+
substrate: new SubstrateClient(),
|
|
57475
|
+
recap: new RecapClient()
|
|
57043
57476
|
};
|
|
57044
57477
|
await runMcp({
|
|
57045
57478
|
name: "microsoft-teams-mcp",
|
|
@@ -57061,6 +57494,7 @@ await runMcp({
|
|
|
57061
57494
|
registerSearchTools,
|
|
57062
57495
|
registerExportTools,
|
|
57063
57496
|
registerTranscriptTools,
|
|
57497
|
+
registerRecapTools,
|
|
57064
57498
|
registerHealthcheckTool
|
|
57065
57499
|
]
|
|
57066
57500
|
});
|