teams-api 0.5.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -14
- package/dist/actions/conversation-resolution.d.ts +26 -0
- package/dist/actions/conversation-resolution.d.ts.map +1 -0
- package/dist/actions/conversation-resolution.js +81 -0
- package/dist/actions/conversation-resolution.js.map +1 -0
- package/dist/actions/definitions.d.ts +16 -0
- package/dist/actions/definitions.d.ts.map +1 -0
- package/dist/{actions.js → actions/definitions.js} +83 -212
- package/dist/actions/definitions.js.map +1 -0
- package/dist/{actions.d.ts → actions/formatters.d.ts} +24 -13
- package/dist/actions/formatters.d.ts.map +1 -0
- package/dist/actions/formatters.js +86 -0
- package/dist/actions/formatters.js.map +1 -0
- package/dist/api/chat-service.d.ts +54 -0
- package/dist/api/chat-service.d.ts.map +1 -0
- package/dist/api/chat-service.js +327 -0
- package/dist/api/chat-service.js.map +1 -0
- package/dist/api/common.d.ts +21 -0
- package/dist/api/common.d.ts.map +1 -0
- package/dist/api/common.js +65 -0
- package/dist/api/common.js.map +1 -0
- package/dist/api/middle-tier.d.ts +15 -0
- package/dist/api/middle-tier.d.ts.map +1 -0
- package/dist/api/middle-tier.js +52 -0
- package/dist/api/middle-tier.js.map +1 -0
- package/dist/api/substrate.d.ts +22 -0
- package/dist/api/substrate.d.ts.map +1 -0
- package/dist/api/substrate.js +162 -0
- package/dist/api/substrate.js.map +1 -0
- package/dist/api/transcripts.d.ts +51 -0
- package/dist/api/transcripts.d.ts.map +1 -0
- package/dist/api/transcripts.js +140 -0
- package/dist/api/transcripts.js.map +1 -0
- package/dist/auth/auto-login.d.ts +23 -0
- package/dist/auth/auto-login.d.ts.map +1 -0
- package/dist/auth/auto-login.js +136 -0
- package/dist/auth/auto-login.js.map +1 -0
- package/dist/auth/debug-session.d.ts +20 -0
- package/dist/auth/debug-session.d.ts.map +1 -0
- package/dist/auth/debug-session.js +121 -0
- package/dist/auth/debug-session.js.map +1 -0
- package/dist/auth/interactive.d.ts +21 -0
- package/dist/auth/interactive.d.ts.map +1 -0
- package/dist/auth/interactive.js +90 -0
- package/dist/auth/interactive.js.map +1 -0
- package/dist/auth/page-diagnostics.d.ts +21 -0
- package/dist/auth/page-diagnostics.d.ts.map +1 -0
- package/dist/auth/page-diagnostics.js +65 -0
- package/dist/auth/page-diagnostics.js.map +1 -0
- package/dist/auth/token-capture.d.ts +24 -0
- package/dist/auth/token-capture.d.ts.map +1 -0
- package/dist/auth/token-capture.js +123 -0
- package/dist/auth/token-capture.js.map +1 -0
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +21 -7
- package/dist/cli.js.map +1 -1
- package/dist/constants.d.ts +9 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +14 -0
- package/dist/constants.js.map +1 -0
- package/dist/html-utils.d.ts +9 -0
- package/dist/html-utils.d.ts.map +1 -0
- package/dist/html-utils.js +21 -0
- package/dist/html-utils.js.map +1 -0
- package/dist/mcp-server.js +7 -3
- package/dist/mcp-server.js.map +1 -1
- package/dist/server-instructions.d.ts +13 -0
- package/dist/server-instructions.d.ts.map +1 -0
- package/dist/server-instructions.js +60 -0
- package/dist/server-instructions.js.map +1 -0
- package/dist/teams-client.d.ts +17 -8
- package/dist/teams-client.d.ts.map +1 -1
- package/dist/teams-client.js +90 -75
- package/dist/teams-client.js.map +1 -1
- package/dist/types.d.ts +20 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -2
- package/SKILL.md +0 -135
- package/dist/actions.d.ts.map +0 -1
- package/dist/actions.js.map +0 -1
- package/dist/api.d.ts +0 -126
- package/dist/api.d.ts.map +0 -1
- package/dist/api.js +0 -702
- package/dist/api.js.map +0 -1
- package/dist/auth.d.ts +0 -53
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js +0 -491
- package/dist/auth.js.map +0 -1
package/README.md
CHANGED
|
@@ -25,19 +25,6 @@ Designed for autonomous AI agents that need to interact with Teams: read message
|
|
|
25
25
|
|
|
26
26
|
The quickest way to get started is to click one of the install badges above, or follow the instructions for your editor below.
|
|
27
27
|
|
|
28
|
-
#### Install as an agent skill
|
|
29
|
-
|
|
30
|
-
The [SKILL.md](SKILL.md) teaches AI agents _how_ to use the MCP tools (when to call which tool, typical workflows, parameter guidance). Install it with the [`skills` CLI](https://github.com/vercel-labs/skills):
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
npx -y skills add Maxim-Mazurok/teams-api
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
This copies the skill into your agent's skills directory (Claude Code, Cursor, GitHub Copilot, Codex, and [many more](https://www.npmjs.com/package/skills#supported-agents)).
|
|
37
|
-
|
|
38
|
-
> [!NOTE]
|
|
39
|
-
> The skill is optional — the MCP tools work without it. The skill just gives agents extra context about when and how to use each tool.
|
|
40
|
-
|
|
41
28
|
#### Editor-specific instructions
|
|
42
29
|
|
|
43
30
|
<details>
|
|
@@ -393,7 +380,7 @@ All MCP tools accept an optional `format` parameter (`json`, `text`, `md`, or `t
|
|
|
393
380
|
| `teams_get_transcript` | Get a meeting transcript from a recorded conversation |
|
|
394
381
|
| `teams_whoami` | Get the authenticated user's display name |
|
|
395
382
|
|
|
396
|
-
|
|
383
|
+
Workflow guidance, tips, and important notes are served automatically via the MCP server's `instructions` field — no separate skill file needed. For the same content on the CLI, run `teams-api guide`.
|
|
397
384
|
|
|
398
385
|
## API regions
|
|
399
386
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared conversation resolution logic for actions.
|
|
3
|
+
*
|
|
4
|
+
* Provides the standard parameter definitions for identifying a conversation
|
|
5
|
+
* and a resolver function that supports three identification strategies:
|
|
6
|
+
* direct ID, topic name match, or person name (1:1 lookup).
|
|
7
|
+
*/
|
|
8
|
+
import type { TeamsClient } from "../teams-client.js";
|
|
9
|
+
import type { ActionParameter } from "./formatters.js";
|
|
10
|
+
/** Shared parameter definitions for conversation identification. */
|
|
11
|
+
export declare const conversationParameters: ActionParameter[];
|
|
12
|
+
/**
|
|
13
|
+
* Resolve a conversation ID from the standard identification parameters.
|
|
14
|
+
*
|
|
15
|
+
* Supports three ways to identify a conversation:
|
|
16
|
+
* 1. conversationId — direct thread ID
|
|
17
|
+
* 2. chat — topic name (partial match via findConversation)
|
|
18
|
+
* 3. to — person name (1:1 lookup via findOneOnOneConversation)
|
|
19
|
+
*
|
|
20
|
+
* Returns both the resolved ID and a human-readable label.
|
|
21
|
+
*/
|
|
22
|
+
export declare function resolveConversationId(client: TeamsClient, parameters: Record<string, unknown>): Promise<{
|
|
23
|
+
conversationId: string;
|
|
24
|
+
label: string;
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=conversation-resolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-resolution.d.ts","sourceRoot":"","sources":["../../src/actions/conversation-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,EAAE,eAAe,EAoBnD,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,OAAO,CAAC;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CA4CpD"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared conversation resolution logic for actions.
|
|
4
|
+
*
|
|
5
|
+
* Provides the standard parameter definitions for identifying a conversation
|
|
6
|
+
* and a resolver function that supports three identification strategies:
|
|
7
|
+
* direct ID, topic name match, or person name (1:1 lookup).
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.conversationParameters = void 0;
|
|
11
|
+
exports.resolveConversationId = resolveConversationId;
|
|
12
|
+
/** Shared parameter definitions for conversation identification. */
|
|
13
|
+
exports.conversationParameters = [
|
|
14
|
+
{
|
|
15
|
+
name: "chat",
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Find conversation by topic name (partial match), person name (1:1 fallback), or direct thread ID",
|
|
18
|
+
required: false,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "to",
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "Find 1:1 conversation by person name",
|
|
24
|
+
required: false,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "conversationId",
|
|
28
|
+
type: "string",
|
|
29
|
+
description: "Direct conversation thread ID",
|
|
30
|
+
required: false,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
/**
|
|
34
|
+
* Resolve a conversation ID from the standard identification parameters.
|
|
35
|
+
*
|
|
36
|
+
* Supports three ways to identify a conversation:
|
|
37
|
+
* 1. conversationId — direct thread ID
|
|
38
|
+
* 2. chat — topic name (partial match via findConversation)
|
|
39
|
+
* 3. to — person name (1:1 lookup via findOneOnOneConversation)
|
|
40
|
+
*
|
|
41
|
+
* Returns both the resolved ID and a human-readable label.
|
|
42
|
+
*/
|
|
43
|
+
async function resolveConversationId(client, parameters) {
|
|
44
|
+
const conversationId = parameters.conversationId;
|
|
45
|
+
const chat = parameters.chat;
|
|
46
|
+
const to = parameters.to;
|
|
47
|
+
if (conversationId) {
|
|
48
|
+
return { conversationId, label: conversationId };
|
|
49
|
+
}
|
|
50
|
+
if (chat) {
|
|
51
|
+
// If the value looks like a raw conversation ID, use it directly
|
|
52
|
+
if (chat.startsWith("19:") && chat.includes("@")) {
|
|
53
|
+
return { conversationId: chat, label: chat };
|
|
54
|
+
}
|
|
55
|
+
const conversation = await client.findConversation(chat);
|
|
56
|
+
if (conversation) {
|
|
57
|
+
return { conversationId: conversation.id, label: conversation.topic };
|
|
58
|
+
}
|
|
59
|
+
// Fall back to 1:1 resolution (covers person names passed to --chat)
|
|
60
|
+
const oneOnOne = await client.findOneOnOneConversation(chat);
|
|
61
|
+
if (oneOnOne) {
|
|
62
|
+
return {
|
|
63
|
+
conversationId: oneOnOne.conversationId,
|
|
64
|
+
label: oneOnOne.memberDisplayName,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
throw new Error(`No conversation matching "${chat}" found.`);
|
|
68
|
+
}
|
|
69
|
+
if (to) {
|
|
70
|
+
const result = await client.findOneOnOneConversation(to);
|
|
71
|
+
if (!result) {
|
|
72
|
+
throw new Error(`No 1:1 conversation found with "${to}".`);
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
conversationId: result.conversationId,
|
|
76
|
+
label: result.memberDisplayName,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
throw new Error("One of --conversation-id, --chat, or --to is required.");
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=conversation-resolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-resolution.js","sourceRoot":"","sources":["../../src/actions/conversation-resolution.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAsCH,sDA+CC;AAhFD,oEAAoE;AACvD,QAAA,sBAAsB,GAAsB;IACvD;QACE,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,kGAAkG;QACpG,QAAQ,EAAE,KAAK;KAChB;IACD;QACE,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,sCAAsC;QACnD,QAAQ,EAAE,KAAK;KAChB;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,+BAA+B;QAC5C,QAAQ,EAAE,KAAK;KAChB;CACF,CAAC;AAEF;;;;;;;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mCAAmC,EAAE,IAAI,CAAC,CAAC;QAC7D,CAAC;QACD,OAAO;YACL,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,KAAK,EAAE,MAAM,CAAC,iBAAiB;SAChC,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* All action definitions for the Teams API.
|
|
3
|
+
*
|
|
4
|
+
* This is the single source of truth for all operations. CLI commands,
|
|
5
|
+
* MCP tools, and programmatic usage all derive from these definitions.
|
|
6
|
+
*
|
|
7
|
+
* Each action declares:
|
|
8
|
+
* - name, title, description — shared help text and documentation
|
|
9
|
+
* - parameters — typed parameter definitions with descriptions and defaults
|
|
10
|
+
* - execute — the implementation, calling TeamsClient methods
|
|
11
|
+
* - formatResult — human-readable output formatter (CLI without --json)
|
|
12
|
+
*/
|
|
13
|
+
import { type ActionDefinition } from "./formatters.js";
|
|
14
|
+
/** All registered actions, derived from the registry map. */
|
|
15
|
+
export declare const actions: ActionDefinition[];
|
|
16
|
+
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/actions/definitions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAcH,OAAO,EACL,KAAK,gBAAgB,EAMtB,MAAM,iBAAiB,CAAC;AA27BzB,6DAA6D;AAC7D,eAAO,MAAM,OAAO,EAAE,gBAAgB,EAAwC,CAAC"}
|