feat: 新增代码工作台(AI 实时生成 React Demo) - #5
Open
hifizz wants to merge 1 commit into
Open
Conversation
支持"帮我写一个 Tailwind + framer-motion 的 Dialog 组件"这类请求:模型通过 createDemo 工具流式生成多文件代码,右侧工作台自动打开预览/代码双视图, Demo 随会话持久化,刷新可恢复。 - 预览运行时双实现:Sandpack(浏览器沙箱,默认)与 Apple container(本机 轻量 VM 里跑真 next dev,实验特性,面板右上角图标切换) - constants/workbench.ts、lib/workbench/*:系统提示词、防御式文件规整 (@/ 别名改写、cn() 注入)、zustand 状态 - lib/sandbox/manager.ts、app/api/sandbox/*、sandbox-template/:容器沙箱 的生命周期管理(tar 管道写文件、allowedDevOrigins 跨源修复) - 默认模型切至 MiniMax-M3,chat 请求放宽 maxOutputTokens 以容纳多文件输出 - openspec/changes/add-code-workbench/:运行时选型调研、架构设计、多轮 迭代路线图(v2 全栈沙箱 → v3 agent 化修复循环 → v4 工程能力 → v5 发布分享) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createDemo工具流式生成多文件代码,右侧工作台自动打开预览/代码双视图,Demo 随会话持久化、刷新可恢复next dev,实验特性)maxOutputTokens以容纳多文件代码输出openspec/changes/add-code-workbench/:运行时选型调研(Sandpack / WebContainers / 本地进程 / 云沙箱对比)、架构设计、多轮迭代路线图主要变更
constants/workbench.ts、lib/workbench/*:工作台系统提示词、防御式文件规整(@/别名改写为相对路径、cn()注入、依赖合并)、zustand 状态components/assistant-ui/create-demo-tool.tsx:消息内 artifact 卡片,流式期间持续 upsert,自动开关面板components/workbench/*:预览/代码双视图面板 + Sandpack Provider 接线lib/sandbox/manager.ts、app/api/sandbox/*、sandbox-template/:容器沙箱生命周期管理(containerCLI 封装、tar 管道写文件、跨源 dev 资源修复)app/api/chat/route.ts:新增createDemo后端工具Test plan
端到端已在本地 QA 通过(详见对话记录),包括:
帮我写一个基于 Tailwind CSS、framer-motion 的 React Dialog 弹窗组件→ 工具调用 → 面板自动打开 → 预览可交互(弹窗缩放淡入动画)→ 代码视图 → 刷新页面后从历史消息恢复pnpm typecheck:0 个新增错误(14 个既有错误与本次无关,main 分支同样存在)pnpm openspec:validate:change/add-code-workbench通过pnpm dev,用首页「Demo」建议分组过一遍交互🤖 Generated with Claude Code