Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add teams runtime #1095

Merged
merged 18 commits into from
Feb 5, 2025
Merged

add teams runtime #1095

merged 18 commits into from
Feb 5, 2025

Conversation

pelikhan
Copy link
Member

@pelikhan pelikhan commented Feb 4, 2025


Summary of Changes

  • Microsoft Teams Integration: Added functionality to post messages and upload files to Microsoft Teams channels using the Microsoft Graph API.

    • Introduced a new CLI option -tm, --teams-message to post messages to Teams channels.
    • Added support for Teams channel message posting in runScriptInternal.
    • Implemented microsoftTeamsChannelPostMessage and microsoftTeamsChannelUploadFile for handling messages and file uploads.
    • Created MicrosoftTeamsChannelClient to interact with Teams channels programmatically.
  • 🛠️ Markdown to Teams HTML Conversion: Added a utility to convert Markdown into Teams-compatible HTML for message formatting. Includes handling for headers, lists, bold, italic, and more.

  • Unit Tests: Added tests for the Markdown-to-Teams HTML conversion to ensure proper formatting of messages.

  • 🔑 Token Management: Enhanced NodeHost and TestHost to support microsoftGraphToken for authenticating with the Microsoft Graph API.

  • 🗂️ File Handling Enhancements: Updated resolveFileBytes to support handling files with additional metadata (e.g., descriptions).

  • 📖 Documentation Updates:

    • Added the new --teams-message option to the CLI documentation.
    • Removed unused YouTube embed references from script parameter documentation.
  • 🌟 Sample Script: Updated the Teams example script to demonstrate posting messages and attaching files to a Teams channel.

These changes introduce robust Microsoft Teams integration, enabling seamless communication and file sharing directly from the CLI. 🚀

AI-generated content by prd may be incorrect

packages/cli/src/runtime.ts Fixed Show fixed Hide fixed
packages/cli/src/runtime.ts Fixed Show fixed Hide fixed
Copy link
Member Author

pelikhan commented Feb 5, 2025

Caution

Missing semicolon in the teams-message option description: "Posts a message to the teams channel" (docs/src/content/docs/reference/cli/commands.md#L41 missing_semi)

Caution

Missing opening code block for the text following this line, which introduces the Syntax section improperly. (docs/src/content/docs/reference/scripts/parameters.mdx#L34 missing_code_block)

Caution

Missing semicolon in .option for teams-message description. (packages/cli/src/cli.ts#L149 missing_semi)

Caution

The variable microsoftGraphToken should be initialized in the constructor. (packages/cli/src/nodehost.ts#L100 uninitialized_variable)

Caution

The variable teamsMessage should have a type declaration. (packages/cli/src/run.ts#L180 missing_variable_declaration)

Caution

Missing parameter description in the teamsChannel method documentation. (packages/core/src/types/prompt_template.d.ts#L4337 missing_param_doc)

Caution

Unnecessary commented-out code should be removed for better readability. (packages/sample/genaisrc/teams.genai.mts#L1 unnecessary_imports)

AI-generated content by prr may be incorrect

@pelikhan pelikhan merged commit c65f218 into main Feb 5, 2025
12 of 14 checks passed
@pelikhan pelikhan deleted the teams branch February 5, 2025 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant