@microsoft/m365agentsplayground-cli 0.2.25-alpha.20260507-efe1416.0 → 0.2.26

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 CHANGED
@@ -173,15 +173,15 @@ Run a multi-turn conversation:
173
173
 
174
174
  The `config` object in the request body:
175
175
 
176
- | Field | Type | Default | Description |
177
- | -------------- | ------------------------------- | ----------------- | ------------------------------------- |
178
- | `botEndpoint` | `string` | _required_ | Bot's messaging endpoint URL |
179
- | `timeout` | `number` | `120000` | Per-turn response timeout (ms) |
180
- | `deliveryMode` | `"expectReplies" \| "default"` | `"expectReplies"` | How the bot delivers responses |
181
- | `chatType` | `"personal" \| "group" \| "channel"` | `"personal"` | Default chat context for all turns |
182
- | `streamingSettleDelayMs` | `number` | `800` | Quiet-period (ms) for streaming bots — see below |
183
- | `bot` | `BotConfig` | - | Bot identity (see above) |
184
- | `personas` | `Record<string, PersonaConfig>` | - | Named personas for notification turns |
176
+ | Field | Type | Default | Description |
177
+ | ------------------------ | ------------------------------------ | ----------------- | ------------------------------------------------ |
178
+ | `botEndpoint` | `string` | _required_ | Bot's messaging endpoint URL |
179
+ | `timeout` | `number` | `120000` | Per-turn response timeout (ms) |
180
+ | `deliveryMode` | `"expectReplies" \| "default"` | `"expectReplies"` | How the bot delivers responses |
181
+ | `chatType` | `"personal" \| "group" \| "channel"` | `"personal"` | Default chat context for all turns |
182
+ | `streamingSettleDelayMs` | `number` | `800` | Quiet-period (ms) for streaming bots — see below |
183
+ | `bot` | `BotConfig` | - | Bot identity (see above) |
184
+ | `personas` | `Record<string, PersonaConfig>` | - | Named personas for notification turns |
185
185
 
186
186
  > **Streaming bots (teams-ai / teams.ts `stream: true`):** When the simulator receives the placeholder `"Loading stream results..."`, it automatically switches into streaming mode. It first waits for a `streamType:"final"` WebSocket event (the precise end-of-stream signal from teams-ai and teams.ts SDK) — this is instant and accurate. If the bot doesn't send `streamType`, it falls back to a quiet-period: waits until no new `updateActivity` events arrive for `streamingSettleDelayMs` ms (default: 800 ms). Increase `streamingSettleDelayMs` only if you have a slow LLM that pauses mid-stream for over 800 ms. For bots with `stream: false` this option has no effect.
187
187
 
@@ -189,21 +189,16 @@ The `config` object in the request body:
189
189
 
190
190
  Each turn has an optional `turn_type` that controls what kind of Bot Framework activity is sent:
191
191
 
192
- | Turn type | Description |
193
- | ------------------- | ------------------------------------------------ |
194
- | `"chat"` | Standard chat message (default) |
195
- | `"sendEmail"` | Email notification activity |
196
- | `"mentionInWord"` | Word document mention notification activity |
197
- | `"meetingStart"` | Meeting started event |
198
- | `"meetingEnd"` | Meeting ended event |
199
- | `"participantJoin"` | Meeting participant joined event |
200
- | `"participantLeave"`| Meeting participant left event |
201
- | `"messageReaction"` | Reaction added to a message (like, heart, etc.) |
202
- | `"install"` | Bot installation update |
203
- | `"userAdded"` | User added to conversation |
204
- | `"botAdded"` | Bot added to conversation |
205
- | `"channelCreated"` | Channel created (team context required) |
206
- | `"teamRenamed"` | Team renamed (team context required) |
192
+ | Turn type | Description |
193
+ | ------------------ | ------------------------------------------- |
194
+ | `"chat"` | Standard chat message (default) |
195
+ | `"sendEmail"` | Email notification activity |
196
+ | `"mentionInWord"` | Word document mention notification activity |
197
+ | `"install"` | Bot installation update |
198
+ | `"userAdded"` | User added to conversation |
199
+ | `"botAdded"` | Bot added to conversation |
200
+ | `"channelCreated"` | Channel created (team context required) |
201
+ | `"teamRenamed"` | Team renamed (team context required) |
207
202
 
208
203
  All values from `CustomActivityTemplateType` are supported. You can mix turn types within a single conversation:
209
204
 
@@ -218,9 +213,7 @@ All values from `CustomActivityTemplateType` are supported. You can mix turn typ
218
213
  "turn_type": "sendEmail",
219
214
  "persona": "customer1"
220
215
  },
221
- { "test_id": "t3", "prompt": "Summarize the email I just received", "turn_type": "chat" },
222
- { "test_id": "t4", "prompt": "", "turn_type": "meetingStart" },
223
- { "test_id": "t5", "prompt": "", "turn_type": "messageReaction", "reaction_type": "like" }
216
+ { "test_id": "t3", "prompt": "Summarize the email I just received", "turn_type": "chat" }
224
217
  ]
225
218
  }
226
219
  }
@@ -228,23 +221,20 @@ All values from `CustomActivityTemplateType` are supported. You can mix turn typ
228
221
 
229
222
  #### Turn-specific fields
230
223
 
231
- | Field | Applies to | Description |
232
- | ----------------- | ------------------------------- | -------------------------------------------------------- |
233
- | `reaction_type` | `messageReaction` | Reaction emoji: `like` (default), `heart`, `laugh`, `surprised`, `sad`, `angry` |
234
- | `reply_to_id` | `messageReaction` | Message ID to react to. Defaults to last bot message. |
235
- | `prompt_metadata.meetingTitle` | `meetingStart`, `meetingEnd` | Override the meeting title in the event. |
236
- | `prompt_metadata.documentUrl` | `mentionInWord` | Override the document URL. |
237
- | `prompt_metadata.documentName`| `mentionInWord` | Override the document name. |
224
+ | Field | Applies to | Description |
225
+ | ------------------------------ | --------------- | --------------------------- |
226
+ | `prompt_metadata.documentUrl` | `mentionInWord` | Override the document URL. |
227
+ | `prompt_metadata.documentName` | `mentionInWord` | Override the document name. |
238
228
 
239
229
  ### Chat Types
240
230
 
241
231
  The `chat_type` field on a turn (or `chatType` in config) controls the conversation context:
242
232
 
243
- | Chat type | Description |
244
- | ------------ | ---------------------------------------------- |
245
- | `"personal"` | 1:1 personal chat with the bot (default) |
246
- | `"group"` | Group chat context |
247
- | `"channel"` | Team channel context (uses general channel) |
233
+ | Chat type | Description |
234
+ | ------------ | ------------------------------------------- |
235
+ | `"personal"` | 1:1 personal chat with the bot (default) |
236
+ | `"group"` | Group chat context |
237
+ | `"channel"` | Team channel context (uses general channel) |
248
238
 
249
239
  Set the default for the whole conversation in `config.chatType`, or override per turn with `turn.chat_type`:
250
240
 
@@ -258,7 +248,12 @@ Set the default for the whole conversation in `config.chatType`, or override per
258
248
  "input": {
259
249
  "turns": [
260
250
  { "test_id": "t1", "prompt": "@bot Hello everyone!", "turn_type": "chat" },
261
- { "test_id": "t2", "prompt": "Personal follow-up", "turn_type": "chat", "chat_type": "personal" }
251
+ {
252
+ "test_id": "t2",
253
+ "prompt": "Personal follow-up",
254
+ "turn_type": "chat",
255
+ "chat_type": "personal"
256
+ }
262
257
  ]
263
258
  }
264
259
  }
@@ -338,4 +333,3 @@ Returns `{ "status": "ok" }`.
338
333
  ## Example Project
339
334
 
340
335
  See `samples/agents-simulator-example` for a complete example with Mocha tests and a sanity-test script.
341
-
@@ -6,7 +6,7 @@
6
6
  * parse. Does NOT check visual rendering — only structural/schema correctness.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.validateAdaptiveCard = void 0;
9
+ exports.validateAdaptiveCard = validateAdaptiveCard;
10
10
  const adaptivecards_1 = require("adaptivecards");
11
11
  /**
12
12
  * Validate a raw Adaptive Card JSON payload.
@@ -19,7 +19,7 @@ payload) {
19
19
  // Basic type guard: must have type === "AdaptiveCard"
20
20
  if (payload.type !== "AdaptiveCard") {
21
21
  errors.push({
22
- message: `Expected type "AdaptiveCard", got "${payload.type ?? "(missing)"}"`,
22
+ message: `Expected type "AdaptiveCard", got "${String(payload.type ?? "(missing)")}"`,
23
23
  phase: "schema",
24
24
  });
25
25
  return errors; // No point parsing further
@@ -44,4 +44,3 @@ payload) {
44
44
  }
45
45
  return errors;
46
46
  }
47
- exports.validateAdaptiveCard = validateAdaptiveCard;
@@ -25,15 +25,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
25
25
  }) : function(o, v) {
26
26
  o["default"] = v;
27
27
  });
28
- var __importStar = (this && this.__importStar) || function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
28
+ var __importStar = (this && this.__importStar) || (function () {
29
+ var ownKeys = function(o) {
30
+ ownKeys = Object.getOwnPropertyNames || function (o) {
31
+ var ar = [];
32
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
33
+ return ar;
34
+ };
35
+ return ownKeys(o);
36
+ };
37
+ return function (mod) {
38
+ if (mod && mod.__esModule) return mod;
39
+ var result = {};
40
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
41
+ __setModuleDefault(result, mod);
42
+ return result;
43
+ };
44
+ })();
35
45
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.createConversationServer = void 0;
46
+ exports.createConversationServer = createConversationServer;
37
47
  const http = __importStar(require("http"));
38
48
  const runConversation_1 = require("./runConversation");
39
49
  // ─────────────────────────────────────────────────────────────────────────────
@@ -124,4 +134,3 @@ async function createConversationServer(options) {
124
134
  });
125
135
  });
126
136
  }
127
- exports.createConversationServer = createConversationServer;
@@ -50,7 +50,7 @@ export interface Turn {
50
50
  prompt: string;
51
51
  /**
52
52
  * Activity type. Default: "chat" (standard message).
53
- * Any CustomActivityTemplateType value (e.g., "sendEmail", "mentionInWord", "meetingStart")
53
+ * Any CustomActivityTemplateType value (e.g., "sendEmail", "mentionInWord")
54
54
  * sends the corresponding notification activity.
55
55
  */
56
56
  turn_type?: "chat" | "card_action" | CustomActivityTemplateType;
@@ -65,16 +65,6 @@ export interface Turn {
65
65
  persona?: string;
66
66
  /** Extra metadata for the turn */
67
67
  prompt_metadata?: Record<string, string>;
68
- /**
69
- * For "messageReaction" turn_type: the reaction emoji.
70
- * Defaults to "like". Options: like, heart, laugh, surprised, sad, angry.
71
- */
72
- reaction_type?: "like" | "heart" | "laugh" | "surprised" | "sad" | "angry";
73
- /**
74
- * For "messageReaction" turn_type: the message ID to react to.
75
- * If omitted, reacts to the last bot message in the conversation.
76
- */
77
- reply_to_id?: string;
78
68
  /**
79
69
  * For "card_action" turn_type: simulate clicking an Adaptive Card button.
80
70
  * The server must already have a card message in this conversation to target.
@@ -1 +1 @@
1
- {"version":3,"file":"conversationTypes.d.ts","sourceRoot":"","sources":["../src/conversationTypes.ts"],"names":[],"mappings":"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B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS,CAAC;IAC7C,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"notificationSender.d.ts","sourceRoot":"","sources":["../src/notificationSender.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAQ/D;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAyGjB"}
1
+ {"version":3,"file":"notificationSender.d.ts","sourceRoot":"","sources":["../src/notificationSender.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAQ/D;;;;;;GAMG;AACH,wBAAsB,uBAAuB,CAC3C,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,aAAa,GAAG,SAAS,EAClC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAyEjB"}
@@ -6,7 +6,7 @@
6
6
  * infrastructure and polls ConversationManager for bot responses.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.sendNotificationAndWait = void 0;
9
+ exports.sendNotificationAndWait = sendNotificationAndWait;
10
10
  const server_1 = require("server");
11
11
  const POLL_INTERVAL_MS = 200;
12
12
  function log(msg) {
@@ -61,42 +61,6 @@ async function sendNotificationAndWait(conversationId, turn, persona, timeout) {
61
61
  }
62
62
  }
63
63
  }
64
- else if (templateType === "meetingStart" || templateType === "meetingEnd") {
65
- if (turn.prompt_metadata?.meetingTitle) {
66
- const value = (template.value ?? {});
67
- value.Title = turn.prompt_metadata.meetingTitle;
68
- template.value = value;
69
- }
70
- }
71
- else if (templateType === "participantJoin" || templateType === "participantLeave") {
72
- if (turn.prompt) {
73
- const value = (template.value ?? {});
74
- const members = (value.members ?? []);
75
- if (members[0]) {
76
- const user = (members[0].user ?? {});
77
- user.name = turn.prompt;
78
- members[0].user = user;
79
- value.members = members;
80
- template.value = value;
81
- }
82
- }
83
- }
84
- else if (templateType === "messageReaction") {
85
- const reaction = turn.reaction_type ?? "like";
86
- template.reactionsAdded = [{ type: reaction }];
87
- template.reactionsRemoved = [];
88
- if (turn.reply_to_id) {
89
- template.replyToId = turn.reply_to_id;
90
- }
91
- else {
92
- // Default: react to last bot message
93
- const messages = conversationManager.listMessages(conversationId);
94
- const lastBotMsg = [...messages].reverse().find((m) => m.createdBy === "bot");
95
- if (lastBotMsg) {
96
- template.replyToId = lastBotMsg.content.id;
97
- }
98
- }
99
- }
100
64
  log(`Sending ${templateType} activity to conversation ${conversationId}`);
101
65
  // sendActivity expects the Activity class from the server's dependency tree.
102
66
  // We cast through unknown to bridge the inferred template type.
@@ -117,4 +81,3 @@ async function sendNotificationAndWait(conversationId, turn, persona, timeout) {
117
81
  }
118
82
  throw new Error(`Timeout waiting for bot response to ${templateType} after ${timeout}ms`);
119
83
  }
120
- exports.sendNotificationAndWait = sendNotificationAndWait;
@@ -1 +1 @@
1
- {"version":3,"file":"runConversation.d.ts","sourceRoot":"","sources":["../src/runConversation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EACV,SAAS,EAET,iBAAiB,EAIjB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAM7B,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAErC;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE1C;AAiHD;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,kBAAkB,CAAC,CA+N7B"}
1
+ {"version":3,"file":"runConversation.d.ts","sourceRoot":"","sources":["../src/runConversation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EACV,SAAS,EAET,iBAAiB,EAIjB,kBAAkB,EACnB,MAAM,qBAAqB,CAAC;AAM7B,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAErC;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE1C;AAoHD;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,iBAAiB,GACvB,OAAO,CAAC,kBAAkB,CAAC,CA+N7B"}
@@ -21,15 +21,27 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
21
21
  }) : function(o, v) {
22
22
  o["default"] = v;
23
23
  });
24
- var __importStar = (this && this.__importStar) || function (mod) {
25
- if (mod && mod.__esModule) return mod;
26
- var result = {};
27
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
- __setModuleDefault(result, mod);
29
- return result;
30
- };
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
31
41
  Object.defineProperty(exports, "__esModule", { value: true });
32
- exports.runConversation = exports.logError = exports.log = void 0;
42
+ exports.log = log;
43
+ exports.logError = logError;
44
+ exports.runConversation = runConversation;
33
45
  const http = __importStar(require("http"));
34
46
  const https = __importStar(require("https"));
35
47
  const testClient_1 = require("./testClient");
@@ -41,11 +53,9 @@ const cardValidator_1 = require("./cardValidator");
41
53
  function log(msg) {
42
54
  process.stderr.write(`[agents-simulator] ${msg}\n`);
43
55
  }
44
- exports.log = log;
45
56
  function logError(msg) {
46
57
  process.stderr.write(`[agents-simulator][ERROR] ${msg}\n`);
47
58
  }
48
- exports.logError = logError;
49
59
  // ─────────────────────────────────────────────────────────────────────────────
50
60
  // Persona resolution
51
61
  // ─────────────────────────────────────────────────────────────────────────────
@@ -75,7 +85,10 @@ async function probeBot(botEndpoint) {
75
85
  return new Promise((resolve, reject) => {
76
86
  const url = new URL(botEndpoint);
77
87
  const lib = url.protocol === "https:" ? https : http;
78
- const body = JSON.stringify({ type: "message", text: "__ping__" });
88
+ // Use type:"typing" the Bot Framework adapter acks it immediately without
89
+ // invoking the AI planner (no LLM call, no sendActivity, instant response).
90
+ // Bot returns 200/202 for unauthenticated bots, 401 for authenticated ones.
91
+ const body = JSON.stringify({ type: "typing" });
79
92
  const req = lib.request({
80
93
  hostname: url.hostname,
81
94
  port: url.port || (url.protocol === "https:" ? 443 : 80),
@@ -234,6 +247,7 @@ async function runConversation(config, scenario, input) {
234
247
  else {
235
248
  // Use the most recently stored card messageId
236
249
  const entries = [...cardMessageIds.values()];
250
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
237
251
  replyToId = entries[entries.length - 1];
238
252
  }
239
253
  if (!replyToId) {
@@ -335,4 +349,3 @@ async function runConversation(config, scenario, input) {
335
349
  turns: results,
336
350
  };
337
351
  }
338
- exports.runConversation = runConversation;
@@ -1 +1 @@
1
- {"version":3,"file":"testClient.d.ts","sourceRoot":"","sources":["../src/testClient.ts"],"names":[],"mappings":"AAA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IASxB;;OAEG;IACH,iBAAiB,IAAI,OAAO,GAAG,SAAS;IAMxC;;OAEG;IACH,iBAAiB,IAAI,MAAM;IAI3B;;OAEG;IACH,OAAO,IAAI,MAAM;IAIjB;;;;;;;OAOG;IACG,eAAe,CACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACjC,OAAO,CAAC,OAAO,CAAC;IAkCnB;;;;;OAKG;IACG,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IA4BxF;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IAiClC;;OAEG;IACH,OAAO,CAAC,aAAa;CAStB"}
@@ -414,7 +414,7 @@ class TestClient extends events_1.EventEmitter {
414
414
  // Using 'as any' is intentional — ChatManager has no public addUserToChat API and
415
415
  // this is simulator-only setup code, not production logic.
416
416
  const meId = server_1.Factory.getTenantManager().getMe().id;
417
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
417
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
418
418
  chatManager._chatUsers.set(chat.id, new Set([meId]));
419
419
  }
420
420
  }
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@microsoft/m365agentsplayground-cli",
3
- "version": "0.2.25-alpha.20260507-efe1416.0",
3
+ "version": "0.2.26",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "bin": {
7
7
  "playground-cli-server": "build/start-server.js"
8
8
  },
9
9
  "scripts": {
10
- "build": "tsc --build",
10
+ "build": "tsc -p ./",
11
11
  "server": "node build/start-server.js"
12
12
  },
13
13
  "devDependencies": {
@@ -20,17 +20,15 @@
20
20
  "chai": "^4.3.7",
21
21
  "mocha": "^10.2.0",
22
22
  "ts-node": "^10.9.1",
23
- "typescript": "^4.9.5"
23
+ "typescript": "^5.4.5"
24
24
  },
25
25
  "dependencies": {
26
- "adaptivecards": "^3.0.4",
27
26
  "express": "^5.2.0",
28
- "schema": "^0.2.25-alpha.20260507-efe1416.0",
29
- "server": "^0.2.25-alpha.20260507-efe1416.0",
27
+ "schema": "^0.2.26",
28
+ "server": "^0.2.26",
30
29
  "ws": "^8.18.0"
31
30
  },
32
- "bundledDependencies": [
33
- "server",
34
- "schema"
35
- ]
31
+ "optionalDependencies": {
32
+ "adaptivecards": "^3.0.4"
33
+ }
36
34
  }
@@ -27,7 +27,7 @@ export function validateAdaptiveCard(
27
27
  // Basic type guard: must have type === "AdaptiveCard"
28
28
  if (payload.type !== "AdaptiveCard") {
29
29
  errors.push({
30
- message: `Expected type "AdaptiveCard", got "${payload.type ?? "(missing)"}"`,
30
+ message: `Expected type "AdaptiveCard", got "${String(payload.type ?? "(missing)")}"`,
31
31
  phase: "schema",
32
32
  });
33
33
  return errors; // No point parsing further
@@ -62,7 +62,7 @@ export interface Turn {
62
62
 
63
63
  /**
64
64
  * Activity type. Default: "chat" (standard message).
65
- * Any CustomActivityTemplateType value (e.g., "sendEmail", "mentionInWord", "meetingStart")
65
+ * Any CustomActivityTemplateType value (e.g., "sendEmail", "mentionInWord")
66
66
  * sends the corresponding notification activity.
67
67
  */
68
68
  turn_type?: "chat" | "card_action" | CustomActivityTemplateType;
@@ -81,18 +81,6 @@ export interface Turn {
81
81
  /** Extra metadata for the turn */
82
82
  prompt_metadata?: Record<string, string>;
83
83
 
84
- /**
85
- * For "messageReaction" turn_type: the reaction emoji.
86
- * Defaults to "like". Options: like, heart, laugh, surprised, sad, angry.
87
- */
88
- reaction_type?: "like" | "heart" | "laugh" | "surprised" | "sad" | "angry";
89
-
90
- /**
91
- * For "messageReaction" turn_type: the message ID to react to.
92
- * If omitted, reacts to the last bot message in the conversation.
93
- */
94
- reply_to_id?: string;
95
-
96
84
  /**
97
85
  * For "card_action" turn_type: simulate clicking an Adaptive Card button.
98
86
  * The server must already have a card message in this conversation to target.
@@ -74,38 +74,6 @@ export async function sendNotificationAndWait(
74
74
  attachments[0].name = turn.prompt_metadata.documentName;
75
75
  }
76
76
  }
77
- } else if (templateType === "meetingStart" || templateType === "meetingEnd") {
78
- if (turn.prompt_metadata?.meetingTitle) {
79
- const value = (template.value ?? {}) as Record<string, unknown>;
80
- value.Title = turn.prompt_metadata.meetingTitle;
81
- template.value = value;
82
- }
83
- } else if (templateType === "participantJoin" || templateType === "participantLeave") {
84
- if (turn.prompt) {
85
- const value = (template.value ?? {}) as Record<string, unknown>;
86
- const members = (value.members ?? []) as Array<Record<string, unknown>>;
87
- if (members[0]) {
88
- const user = (members[0].user ?? {}) as Record<string, unknown>;
89
- user.name = turn.prompt;
90
- members[0].user = user;
91
- value.members = members;
92
- template.value = value;
93
- }
94
- }
95
- } else if (templateType === "messageReaction") {
96
- const reaction = turn.reaction_type ?? "like";
97
- template.reactionsAdded = [{ type: reaction }];
98
- template.reactionsRemoved = [];
99
- if (turn.reply_to_id) {
100
- template.replyToId = turn.reply_to_id;
101
- } else {
102
- // Default: react to last bot message
103
- const messages = conversationManager.listMessages(conversationId);
104
- const lastBotMsg = [...messages].reverse().find((m) => m.createdBy === "bot");
105
- if (lastBotMsg) {
106
- template.replyToId = lastBotMsg.content.id;
107
- }
108
- }
109
77
  }
110
78
 
111
79
  log(`Sending ${templateType} activity to conversation ${conversationId}`);
@@ -69,7 +69,10 @@ async function probeBot(botEndpoint: string): Promise<number> {
69
69
  const url = new URL(botEndpoint);
70
70
  const lib = url.protocol === "https:" ? https : http;
71
71
 
72
- const body = JSON.stringify({ type: "message", text: "__ping__" });
72
+ // Use type:"typing" the Bot Framework adapter acks it immediately without
73
+ // invoking the AI planner (no LLM call, no sendActivity, instant response).
74
+ // Bot returns 200/202 for unauthenticated bots, 401 for authenticated ones.
75
+ const body = JSON.stringify({ type: "typing" });
73
76
  const req = lib.request(
74
77
  {
75
78
  hostname: url.hostname,
@@ -234,11 +237,8 @@ export async function runConversation(
234
237
  .join("\n\n");
235
238
  attachments = extractAttachments(responses);
236
239
  // Track the first card-containing message ID for card_action turns
237
- const firstCardMsg = responses.find(
238
- (r) =>
239
- r.attachments?.some(
240
- (a) => a.contentType === "application/vnd.microsoft.card.adaptive"
241
- )
240
+ const firstCardMsg = responses.find((r) =>
241
+ r.attachments?.some((a) => a.contentType === "application/vnd.microsoft.card.adaptive")
242
242
  );
243
243
  if (firstCardMsg?.messageId) {
244
244
  cardMessageIds.set(turn.test_id, firstCardMsg.messageId);
@@ -246,7 +246,9 @@ export async function runConversation(
246
246
  } else if (turnType === "card_action") {
247
247
  const cardAction = turn.card_action;
248
248
  if (!cardAction) {
249
- throw new Error(`Turn "${turn.test_id}" has turn_type "card_action" but no card_action field.`);
249
+ throw new Error(
250
+ `Turn "${turn.test_id}" has turn_type "card_action" but no card_action field.`
251
+ );
250
252
  }
251
253
  if (!cardAction.verb) {
252
254
  throw new Error(`Turn "${turn.test_id}" card_action is missing required "verb" field.`);
@@ -264,6 +266,7 @@ export async function runConversation(
264
266
  } else {
265
267
  // Use the most recently stored card messageId
266
268
  const entries = [...cardMessageIds.values()];
269
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
267
270
  replyToId = entries[entries.length - 1];
268
271
  }
269
272
  if (!replyToId) {
@@ -86,7 +86,7 @@ export class ServerManager {
86
86
  ? DeliveryMode.Default
87
87
  : undefined;
88
88
 
89
- mountBackend(app as any, ServerManager.server, {
89
+ mountBackend(app, ServerManager.server, {
90
90
  configFileOptions: { configFile: defaultConfig },
91
91
  appConfig: {
92
92
  endpoint: config.botEndpoint,
package/src/testClient.ts CHANGED
@@ -430,10 +430,7 @@ export class TestClient extends EventEmitter {
430
430
  * @param messageId The message ID of the card message
431
431
  * @param data The form data to submit
432
432
  */
433
- async submitCardForm(
434
- messageId: string,
435
- data: Record<string, unknown>
436
- ): Promise<unknown> {
433
+ async submitCardForm(messageId: string, data: Record<string, unknown>): Promise<unknown> {
437
434
  if (!this.started) {
438
435
  throw new Error("TestClient is not started. Call start() first.");
439
436
  }
@@ -495,7 +492,7 @@ export class TestClient extends EventEmitter {
495
492
  // Using 'as any' is intentional — ChatManager has no public addUserToChat API and
496
493
  // this is simulator-only setup code, not production logic.
497
494
  const meId = Factory.getTenantManager().getMe().id;
498
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
495
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
499
496
  (chatManager as any)._chatUsers.set(chat.id, new Set([meId]));
500
497
  }
501
498
  }
package/tsconfig.json CHANGED
@@ -8,9 +8,7 @@
8
8
  "outDir": "./build",
9
9
  "noEmit": false,
10
10
  "declaration": true,
11
- "declarationMap": true,
12
- "composite": true
11
+ "declarationMap": true
13
12
  },
14
- "references": [{ "path": "../schema" }, { "path": "../server" }],
15
13
  "include": ["src"]
16
14
  }