teams-api 0.5.2 → 0.6.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.
Files changed (83) hide show
  1. package/SKILL.md +1 -1
  2. package/dist/actions/conversation-resolution.d.ts +26 -0
  3. package/dist/actions/conversation-resolution.d.ts.map +1 -0
  4. package/dist/actions/conversation-resolution.js +81 -0
  5. package/dist/actions/conversation-resolution.js.map +1 -0
  6. package/dist/actions/definitions.d.ts +16 -0
  7. package/dist/actions/definitions.d.ts.map +1 -0
  8. package/dist/{actions.js → actions/definitions.js} +77 -209
  9. package/dist/actions/definitions.js.map +1 -0
  10. package/dist/{actions.d.ts → actions/formatters.d.ts} +24 -13
  11. package/dist/actions/formatters.d.ts.map +1 -0
  12. package/dist/actions/formatters.js +86 -0
  13. package/dist/actions/formatters.js.map +1 -0
  14. package/dist/api/chat-service.d.ts +54 -0
  15. package/dist/api/chat-service.d.ts.map +1 -0
  16. package/dist/api/chat-service.js +327 -0
  17. package/dist/api/chat-service.js.map +1 -0
  18. package/dist/api/common.d.ts +21 -0
  19. package/dist/api/common.d.ts.map +1 -0
  20. package/dist/api/common.js +65 -0
  21. package/dist/api/common.js.map +1 -0
  22. package/dist/api/middle-tier.d.ts +15 -0
  23. package/dist/api/middle-tier.d.ts.map +1 -0
  24. package/dist/api/middle-tier.js +52 -0
  25. package/dist/api/middle-tier.js.map +1 -0
  26. package/dist/api/substrate.d.ts +22 -0
  27. package/dist/api/substrate.d.ts.map +1 -0
  28. package/dist/api/substrate.js +162 -0
  29. package/dist/api/substrate.js.map +1 -0
  30. package/dist/api/transcripts.d.ts +51 -0
  31. package/dist/api/transcripts.d.ts.map +1 -0
  32. package/dist/api/transcripts.js +140 -0
  33. package/dist/api/transcripts.js.map +1 -0
  34. package/dist/auth/auto-login.d.ts +23 -0
  35. package/dist/auth/auto-login.d.ts.map +1 -0
  36. package/dist/auth/auto-login.js +136 -0
  37. package/dist/auth/auto-login.js.map +1 -0
  38. package/dist/auth/debug-session.d.ts +20 -0
  39. package/dist/auth/debug-session.d.ts.map +1 -0
  40. package/dist/auth/debug-session.js +121 -0
  41. package/dist/auth/debug-session.js.map +1 -0
  42. package/dist/auth/interactive.d.ts +21 -0
  43. package/dist/auth/interactive.d.ts.map +1 -0
  44. package/dist/auth/interactive.js +90 -0
  45. package/dist/auth/interactive.js.map +1 -0
  46. package/dist/auth/page-diagnostics.d.ts +21 -0
  47. package/dist/auth/page-diagnostics.d.ts.map +1 -0
  48. package/dist/auth/page-diagnostics.js +65 -0
  49. package/dist/auth/page-diagnostics.js.map +1 -0
  50. package/dist/auth/token-capture.d.ts +24 -0
  51. package/dist/auth/token-capture.d.ts.map +1 -0
  52. package/dist/auth/token-capture.js +123 -0
  53. package/dist/auth/token-capture.js.map +1 -0
  54. package/dist/cli.js +11 -5
  55. package/dist/cli.js.map +1 -1
  56. package/dist/constants.d.ts +9 -0
  57. package/dist/constants.d.ts.map +1 -0
  58. package/dist/constants.js +14 -0
  59. package/dist/constants.js.map +1 -0
  60. package/dist/html-utils.d.ts +9 -0
  61. package/dist/html-utils.d.ts.map +1 -0
  62. package/dist/html-utils.js +21 -0
  63. package/dist/html-utils.js.map +1 -0
  64. package/dist/mcp-server.js +4 -3
  65. package/dist/mcp-server.js.map +1 -1
  66. package/dist/teams-client.d.ts +17 -8
  67. package/dist/teams-client.d.ts.map +1 -1
  68. package/dist/teams-client.js +90 -75
  69. package/dist/teams-client.js.map +1 -1
  70. package/dist/types.d.ts +20 -1
  71. package/dist/types.d.ts.map +1 -1
  72. package/dist/types.js.map +1 -1
  73. package/package.json +1 -1
  74. package/dist/actions.d.ts.map +0 -1
  75. package/dist/actions.js.map +0 -1
  76. package/dist/api.d.ts +0 -126
  77. package/dist/api.d.ts.map +0 -1
  78. package/dist/api.js +0 -702
  79. package/dist/api.js.map +0 -1
  80. package/dist/auth.d.ts +0 -53
  81. package/dist/auth.d.ts.map +0 -1
  82. package/dist/auth.js +0 -491
  83. package/dist/auth.js.map +0 -1
package/SKILL.md CHANGED
@@ -130,6 +130,6 @@ The MCP server handles authentication automatically via environment variables. C
130
130
 
131
131
  - Conversation IDs look like `19:abc123@thread.v2` for group chats or `48:notes` for self-chat
132
132
  - 1:1 chats have no topic name — use `teams_find_one_on_one` or the `to` parameter to find them by person name
133
- - Messages include reactions, mentions, and quoted message references
133
+ - Messages include reactions, mentions, followers (thread subscribers), and quoted message references
134
134
  - Token lifetime is ~24 hours — the server re-authenticates automatically with auto-login
135
135
  - All tools share the same parameters and behavior as the CLI commands and programmatic API
@@ -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;;;;;;;;;GASG;AACI,KAAK,UAAU,qBAAqB,CACzC,MAAmB,EACnB,UAAmC;IAEnC,MAAM,cAAc,GAAG,UAAU,CAAC,cAAoC,CAAC;IACvE,MAAM,IAAI,GAAG,UAAU,CAAC,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,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;AAw7BzB,6DAA6D;AAC7D,eAAO,MAAM,OAAO,EAAE,gBAAgB,EAAwC,CAAC"}