Copilot Studio 认证模式检测
detect-mode
通过查询 Dataverse 检测 Copilot Studio 智能体的身份验证模式(DirectLine vs M365)。返回聊天所需的模式和连接详情。
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 493
- Forks
- 103
01 前言 Front Matter
- agent
- copilot-studio-test
- description
- Detect a Copilot Studio agent's authentication mode (DirectLine vs M365) by querying Dataverse. Returns the mode and connection details needed to chat.
- allowed-tools
- Bash(node *chat-with-agent.bundle.js --detect-only *), Read, Glob
- argument-hint
- [ "--agent-dir <path>" ]
- user-invocable
- false
03 SKILL.md 正文
Detect Agent Authentication Mode
Query the Dataverse bots entity to determine whether the agent uses DirectLine (no auth / manual auth) or the Copilot Studio SDK (integrated auth / Entra ID SSO).
Instructions
-
Run the detect-only command:
node ${CLAUDE_SKILL_DIR}/../../scripts/chat-with-agent.bundle.js --detect-only $ARGUMENTSIf the agent is not at the project root, pass
--agent-dir <path>. -
Parse the JSON output from stdout:
DirectLine mode (authenticationmode 1 or 3)
{ "status": "ok", "mode": "directline", "authenticationmode": 1, "tokenEndpoint": "https://...", "schemaName": "..." }The agent uses no authentication or manual authentication. No user credentials needed. The
tokenEndpointis ready to use with/copilot-studio:chat-directline.M365 mode (authenticationmode 2)
{ "status": "ok", "mode": "m365", "authenticationmode": 2, "schemaName": "..." }The agent uses integrated authentication (Entra ID SSO). An App Registration Client ID is needed for
/copilot-studio:chat-sdk. -
Return the result to the caller. Do not proceed to chat — that is a separate step.
Error Handling
| Error | Cause | Resolution |
|---|---|---|
No agent.mcs.yml found |
No agent in workspace | Clone the agent first |
No .mcs/conn.json found |
Agent not cloned via VS Code extension | Clone with the extension |
Could not detect authentication mode |
No cached Dataverse token | Run a push/pull first to cache tokens, or ask the user about their auth config |
04 同仓库更多 Skills
Copilot Studio YAML 校验
validate
使用 LSP 二进制文件的完整诊断能力(YAML 结构、Power Fx、schema、跨文件引用)校验 Copilot Studio 智能体的 YAML 文件。当用户要求检查、验证或核对 YAML 文件时使用。
Copilot Studio 测试身份验证
test-auth
为 Copilot Studio 评估 API 和 SDK 聊天进行身份验证。缓存一个在 run-eval 和 chat-sdk 技能之间共享的令牌。在任何评估或 SDK 聊天工作流之前运行此技能。要求使用具有 MakerOperations 和 Copilots.Invoke 权限的 App Registration。
Copilot Studio Kit 批量测试
run-tests-kit
通过 Copilot Studio Kit (Dataverse API) 运行批量测试套件。使用 Power CAT Copilot Studio Kit 对已发布的智能体执行测试用例,并生成包含延迟的通过/失败结果。要求环境中已安装 Kit、具有 Dataverse 权限的 App Registration,以及已发布的智能体。
Copilot Studio 智能体评估运行
run-eval
通过 Power Platform Evaluation API 对 Copilot Studio 智能体运行评估。适用于草稿(DRAFT)智能体——无需发布步骤。列出测试集、启动运行、轮询直至完成、获取结果,并针对失败提出 YAML 修复建议。当用户希望在不发布的情况下测试智能体更改时使用。
Copilot Studio 主题创建
new-topic
创建一个新的 Copilot Studio 主题(topic)YAML 文件。当用户要求为其智能体创建新主题、对话流程或对话框时使用。
Copilot Studio 智能体管理
manage-agent
通过 VS Code 扩展的 LanguageServerHost LSP 二进制文件推送/拉取 Copilot Studio 智能体内容。处理身份验证(推送/拉取使用交互式浏览器登录,聊天令牌使用设备代码流)、同步推送、同步拉取、克隆和差异比较操作。