跳到主内容

dsh-openmaic 使用指南

把 OpenMAIC 教学平台接入 DSH:让模型生成可上课的课堂链接,并就地渲染交互式教学卡片、滑片、小组件。

本文为派生内容(基于 wiki / faq / compatibility_json 自动组装),非 AI 即时创作。

本文由本站基于该插件已收录的字段自动派生(wiki / faq / compatibility_json / readme),非 AI 即时创作。每节末尾标源字段。

快速上手

dsh-openmaic

— 源: plugin_wiki.wiki_content

安装与验证

dsh plugin --profile web add github:THU-MAIC/dsh-openmaic

复制以上命令在 DSH Web Profile 内运行。安装完成后在「插件列表」启用即可。

— 源: plugins.install

关键要点

  • openmaic_slide: the agent writes one OpenMAIC slide (PPTist-style Slide JSON) and the plugin renders it with OpenMAIC's official renderer (text, shapes, images, tables, charts, formulas, code).
  • openmaic_widget: the agent writes an OpenMAIC-style interactive widget (simulation, game, or code) per the bundled contract; the code streams as it writes, then renders inline as a sandboxed card.
  • openmaic_render: the agent writes an inline HTML teaching fragment (concept card, quiz, walkthrough) and the plugin renders it as a sandboxed card right in the conversation.
  • openmaic-teach skill: turns a session into a Socratic OpenMAIC lesson, teaching by guided questioning and pulling in slides, widgets, and cards as aids.
  • openmaic_generate: generate a classroom and return a playable link.

— 源: plugin_wiki.readme_zh (fallback readme_raw)

常见问题

这个插件和 DSH 自带的「渲染 HTML」能力有什么区别?

openmaic_render 渲染的是符合 OpenMAIC fragment 合约的内联 HTML 片段(不带文档骨架、不超过 256 KB),并被宿主包成带独立 CSP 的 iframe;openmaic_widget 接收完整 HTML 文档(带骨架),适合做模拟器、游戏、代码挑战;openmaic_slide 接收 PPTist 风格 JSON。

生成课堂链接需要等多久?

课堂由 open.maic.chat 异步生成,插件默认每 5 秒轮询一次、单次最长 10 分钟。如果 10 分钟还没完成,工具会返回"还在后台生成"并附 jobId,不会一直阻塞会话。

accessCode 是什么?需要填吗?

accessCode 是 open.maic.chat 的邀请码,源码里标记为 secret 字段。当前线上还没启用邀请码校验,所以保持空字符串即可;将来开启后再填入。

哪些 DSH 版本能用?

package.json 的 engines.dsh 写的是 >=0.0.1,即任何 DSH 版本都能安装;不挑 Node 版本号(源文件只用了 node:fs/promises 和 node:url 这类内置模块)。

安装后需要重启吗?

需要。README 明确说明:dsh plugin add 装好后,重启 dsh web 并刷新浏览器,新插件的工具、技能和卡片才会在对话里出现。

可以在本地跑自己的 OpenMAIC 后端吗?

可以。把 baseUrl 改成 http://localhost:3000(或你本地 OpenMAIC 实例的地址)即可,所有 API 调用都会打到本地。

代码片段在卡片里能高亮吗?

浏览器端 shiki 是构建期桩模块,所以代码不会自动高亮。slide 工具依赖的 @openmaic/renderer 在客户端另走它的高亮路径,请以实际渲染为准。

怎么卸载?

移除 cordis.patch.yml 中 dsh-openmaic 的 insert 行,重启 dsh web;再从 DSH profile 配置里删除该插件条目即可。

— 源: plugin_wiki.faq_json

兼容性

  • DSH: >=0.0.1
  • Node: 未声明

— 源: plugin_wiki.compatibility_json

踩坑提醒

安装前请审阅上游仓库;本指南基于已收录字段自动派生,可能滞后于最新版本。如发现与官方文档冲突,请以上游为准。

— 来源:通用规则