- Add Microsoft 365 Agents SDK packages (@microsoft/agents-hosting, @microsoft/agents-hosting-express, @microsoft/agents-hosting-extensions-teams) - Add MSTeamsConfig type and zod schema - Create src/msteams/ provider with monitor, token, send, probe - Wire provider into gateway (server-providers.ts, server.ts) - Add msteams to all provider type unions (hooks, queue, cron, etc.) - Update implementation guide with new SDK and progress
24 lines
575 B
TypeScript
24 lines
575 B
TypeScript
import type { MSTeamsConfig } from "../config/types.js";
|
|
import { resolveMSTeamsCredentials } from "./token.js";
|
|
|
|
export type ProbeMSTeamsResult = {
|
|
ok: boolean;
|
|
error?: string;
|
|
appId?: string;
|
|
};
|
|
|
|
export async function probeMSTeams(
|
|
cfg?: MSTeamsConfig,
|
|
): Promise<ProbeMSTeamsResult> {
|
|
const creds = resolveMSTeamsCredentials(cfg);
|
|
if (!creds) {
|
|
return {
|
|
ok: false,
|
|
error: "missing credentials (appId, appPassword, tenantId)",
|
|
};
|
|
}
|
|
|
|
// TODO: Validate credentials by attempting to get a token
|
|
return { ok: true, appId: creds.appId };
|
|
}
|