feat(projects): add interactive AI app scaffold skill

This commit is contained in:
2026-09-04 20:36:28 +08:00
parent 336e0bb0ca
commit 959b6333b5
40 changed files with 2647 additions and 65 deletions

View File

@@ -167,7 +167,7 @@ export function Sidebar({ workspaceLayout = false, sidebarPeekOpen = false, onSi
const [newProjectName, setNewProjectName] = useState('');
const [newProjectSelectedPath, setNewProjectSelectedPath] = useState('');
const [newProjectDirectoryMode, setNewProjectDirectoryMode] = useState<ProjectDirectoryMode>('use-selected-directory');
const [newProjectType, setNewProjectType] = useState<ProjectType>('mini_game');
const [newProjectType, setNewProjectType] = useState<ProjectType>('interactive_ai_app');
const [newProjectIdentityKind, setNewProjectIdentityKind] = useState<ProjectIdentityKind>('create');
const [newProjectIdentityProjectId, setNewProjectIdentityProjectId] = useState('');
const [createProjectError, setCreateProjectError] = useState<string | null>(null);
@@ -399,7 +399,7 @@ export function Sidebar({ workspaceLayout = false, sidebarPeekOpen = false, onSi
setNewProjectName('');
setNewProjectSelectedPath('');
setNewProjectDirectoryMode('use-selected-directory');
setNewProjectType('mini_game');
setNewProjectType('interactive_ai_app');
setNewProjectIdentityKind('create');
setNewProjectIdentityProjectId('');
setCreateProjectError(null);
@@ -409,7 +409,7 @@ export function Sidebar({ workspaceLayout = false, sidebarPeekOpen = false, onSi
const closeCreateProject = () => {
if (creatingProject) return;
setCreateDialogOpen(false);
setNewProjectType('mini_game');
setNewProjectType('interactive_ai_app');
setNewProjectIdentityKind('create');
setNewProjectIdentityProjectId('');
setCreateProjectError(null);
@@ -856,10 +856,9 @@ export function Sidebar({ workspaceLayout = false, sidebarPeekOpen = false, onSi
<fieldset className="space-y-2">
<legend className="text-xs font-semibold"></legend>
<div className="grid gap-2 sm:grid-cols-3">
<div className="grid gap-2 sm:grid-cols-2">
{([
['mini_game', '小游戏', '适合实时互动、Canvas 和关卡玩法;创建后可直接提交审核。'],
['mini_program', '小程序', '适合页面、表单和轻量工具;创建后可直接提交审核。'],
['interactive_ai_app', '交互式 AI 应用', '创建可交互、可发布的 AI 应用项目;进入对话后可用项目初始化 Skill 生成工程骨架。'],
['custom', '自定义项目', '只创建项目空间,不配置默认发布方式。'],
] as const).map(([value, title, description]) => (
<label

View File

@@ -521,7 +521,7 @@ export function ProjectPublishAction({ project, projectType, buttonVariant = 'de
</div>
<p className="rounded-xl bg-muted/50 px-3 py-2 text-xs text-muted-foreground">
{projectType}
AI
</p>
</>}

View File

@@ -93,7 +93,7 @@ const PUBLISH_FAILURES: Record<string, WorksPublishFailure> = {
PROJECT_TYPE_UNPUBLISHABLE: {
title: '这个项目没有配置发布方式',
reason: '自定义项目只创建工作空间,不会自动生成平台发布模板。',
nextStep: '如需一键提交,请新建小游戏或小程序项目。',
nextStep: '如需一键提交,请新建交互式 AI 应用项目。',
},
PROJECT_FILE_INVALID: {
title: '项目配置无法读取',

View File

@@ -368,7 +368,14 @@ export function PluginDetails(props: PluginDetailsProps) {
<div className="mt-3 rounded-xl bg-surface-subtle p-4 text-sm">
<p>{props.item.local.kind === 'skill-only' ? 'Skill' : props.item.local.kind === 'pi-extension' ? 'Pi extension' : 'Skill + Pi extension'}</p>
<p className="mt-1 text-muted-foreground">{props.item.local.skillEntries.length} Skill · {props.item.local.extensionEntries.length} extension</p>
{props.item.local.confirmedExecutableCode ? <p className="mt-3 flex gap-2 text-warning"><AlertTriangle className="h-4 w-4 shrink-0" /> Pi extension</p> : null}
{props.item.local.confirmedExecutableCode ? (
<p className="mt-3 flex gap-2 text-warning">
<AlertTriangle className="h-4 w-4 shrink-0" />
{props.item.local.kind === 'skill-only'
? '包含可执行 Skill 脚本;调用时可能使用当前桌面用户可用的文件、网络和进程权限。'
: '包含可执行代码,运行时拥有完整桌面权限。'}
</p>
) : null}
</div>
) : <p className="mt-2 text-sm text-muted-foreground"></p>}
{detail?.permissions.length ? (

View File

@@ -460,7 +460,7 @@ export function ProjectConfiguration() {
<div data-testid="project-configuration-actions" className="glass-surface config-motion-actions sticky bottom-3 z-10 mt-auto flex shrink-0 flex-col gap-2 rounded-2xl border border-border/70 bg-background/85 p-2 shadow-float sm:flex-row sm:items-start sm:justify-between">
<Button type="button" variant="outline" size="sm" onClick={() => setDeleteDialogOpen(true)} className="h-9 w-full border-brand/25 bg-background px-3 font-semibold text-foreground shadow-none hover:border-brand/40 hover:bg-brand-soft sm:w-auto"><Trash2 className="mr-2 h-4 w-4" />删除项目</Button>
<div data-testid="project-configuration-primary-actions" className="flex w-full flex-col gap-2 sm:ml-auto sm:w-auto sm:flex-row sm:items-start sm:justify-end">
{draft.projectType === 'mini_game' || draft.projectType === 'mini_program' ? (
{draft.projectType === 'interactive_ai_app' ? (
<ProjectPublishAction
key={activeProject.id}
project={activeProject}