Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,25 @@ jobs:
if-no-files-found: error
retention-days: 14

- name: Verify the native skill library and owner preferences in two sandboxed Chrome logins
id: skills_ui
if: ${{ !cancelled() && steps.host_tests.outcome == 'success' }}
timeout-minutes: 5
env:
DEVA_QA_SKILLS_CAPTURE: '1'
run: node scripts/workbench/e2e-skill-library.mjs

- name: Publish the verified synthetic skill settings and document views
if: ${{ !cancelled() && steps.skills_ui.outcome == 'success' }}
uses: actions/upload-artifact@v4
with:
name: workbench-skill-library
path: |
test-results/skill-library/skills-list.png
test-results/skill-library/skill-detail.png
if-no-files-found: error
retention-days: 14

- name: Select the same installed Chrome for UI and worker
run: bash scripts/workbench/ci-select-chromium.sh

Expand Down Expand Up @@ -254,6 +273,77 @@ jobs:
timeout-minutes: 6
run: node scripts/workbench/container-terminal-viewer.mjs

parity-workbook:
name: Export the capability workbook at the exact PR head
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
timeout-minutes: 5
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
steps:
- uses: actions/checkout@v5
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile --filter @deva/desktop
- name: Verify the preload AST and each linked Git blob, then generate the XLSX
env:
REPORT_REPOSITORY: ${{ github.event.pull_request.head.repo.full_name }}
REPORT_LINK_REPOSITORY: ${{ github.repository }}
REPORT_PR: ${{ github.event.pull_request.number }}
REPORT_SHA: ${{ github.event.pull_request.head.sha }}
run: |
set -eu
test "$(git rev-parse HEAD)" = "$REPORT_SHA"
if [ "$REPORT_REPOSITORY" = "$REPORT_LINK_REPOSITORY" ]; then
node scripts/workbench/export-parity-workbook.mjs --repo "$REPORT_REPOSITORY" --pr "$REPORT_PR"
else
node scripts/workbench/export-parity-workbook.mjs --repo "$REPORT_REPOSITORY"
fi
- uses: actions/upload-artifact@v4
with:
name: workbench-parity-workbook
path: test-results/parity-*/Deva-Web-*项能力验收清单.xlsx
if-no-files-found: error
retention-days: 14

packaged-skills:
name: Native skill preferences in the production amd64 workbench
if: ${{ github.event_name == 'pull_request' && github.head_ref == 'feat/web-workbench-skill-library' }}
runs-on: ubuntu-latest
timeout-minutes: 14
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
package-manager-cache: false
- name: Build the native Linux amd64 production image
timeout-minutes: 8
run: |
set -eu
test "$(uname -m)" = x86_64
docker build --platform linux/amd64 --target runtime -t deva-workbench:skills-verify .
docker image inspect -f '{{.Os}}/{{.Architecture}} {{.Id}} {{.Size}} bytes' deva-workbench:skills-verify
- name: Verify skill management and model isolation inside the packaged host
timeout-minutes: 3
run: |
set -eu
test -f "$PWD/apps/headless/test/skill-library-http.test.mjs"
docker run --rm --init --network none --read-only --user 1000:1000 --cap-drop ALL --security-opt no-new-privileges:true \
--pids-limit 128 --cpus 2 --memory 512m --tmpfs /tmp:rw,nosuid,nodev,noexec,mode=1777,size=96m \
--mount "type=bind,src=$PWD/apps/headless/test/skill-library-http.test.mjs,dst=/opt/deva/apps/headless/ci/skill-library-http.test.mjs,readonly" \
--entrypoint node deva-workbench:skills-verify --test /opt/deva/apps/headless/ci/skill-library-http.test.mjs
- name: Confirm real saved skill preferences across two distinct production containers
timeout-minutes: 3
run: node scripts/workbench/container-skill-library.mjs

sandbox:
name: Private human browser worker
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ The [amd64 Docker Compose workbench](apps/headless/README.md) runs independently

- **Conversations:** claim the instance, configure models, stream, stop and reconnect. Use the desktop message menu to copy a selection or quote it in an unsent draft. Clipboard, sidebar shortcuts and page fullscreen belong to the client browser.
- **Library and projects:** manage profiles, roles, avatars and scoped notes. A conversation can inherit or explicitly attach an approved project; manually opening its files or notes does not send them to a model.
- **Skill settings:** inspect existing skills under Settings → Extensions and save their enabled preferences and role scopes. Opening a custom skill displays its document; web chat does not load or execute skills.
- **Read-only terminal:** an optional [network-isolated PTY worker](apps/terminal-worker/README.md) displays a confirmed, saved workspace text file in the original file panel. Navigation, resize and exit come from a real native process; this is not a host command shell.
- **Attachments and deliveries:** explicitly send supported text, static images or PDFs on compatible adapters. Export confirmed replies or use the desktop delivery card to download and reveal an authorized project file.
- **Inspection:** view branches, first-parent history and staged or working-tree differences in separately approved repositories. Inspect recorded desktop tasks, preview a schedule in an explicit time zone, and pause an active record after confirmation. The server does not run a task scheduler.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ IM 机器人支持 `/new [角色名]`、`/list`、`/stop`、`/status`、`/help`

- **对话**:在浏览器认领实例、配置模型,使用原会话列表和编辑器聊天、停止、刷新续接。选中文字可复制或加入当前草稿的引用条;剪贴板、侧栏快捷键和页面全屏都属于操作电脑。
- **资料与项目**:管理个人资料、角色、头像和分域记忆。会话可继承或显式关联管理员登记的项目;手动打开文件或笔记不会将内容发送给模型。
- **技能设置**:在桌面同源的「设置 → 扩展」查看现有技能,保存启用偏好和角色范围。只有打开自定义条目才显示正文;Web 对话不会加载或运行这些技能。
- **只读终端**:可选的[无网络 PTY 工作器](apps/terminal-worker/README.md)在原文件面板中显示已保存的文本。翻页、调整行列、退出都由真实子进程响应;它不会提供宿主命令行。
- **附件与交付**:显式发送文本、静态图片或兼容协议的 PDF;导出已完成的回复,或在桌面同源交付卡下载、定位授权文件。
- **检查**:获准仓库可看分支、首父历史,以及暂存区和工作树的差异;任务页可查阅桌面记录、预览时区日程和确认暂停。它不会启动任务调度器。
Expand Down
17 changes: 17 additions & 0 deletions apps/desktop/src/main/services/skill-document-format.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { fmArray, fmMap, fmString, parseFrontmatter } from './frontmatter'

/** Native SKILL.md display fields. No directory, lifecycle or runtime concerns. */
export function parseSkillDocument(id: string, raw: string) {
const { data, body } = parseFrontmatter(raw)
return {
id,
name: fmString(data, 'name') || id,
description: fmString(data, 'description'),
trigger: fmString(data, 'trigger'),
allowedTools: fmArray(data, 'allowed-tools'),
license: fmString(data, 'license'),
compatibility: fmString(data, 'compatibility'),
metadata: fmMap(data, 'metadata'),
instructions: body.trim()
}
}
40 changes: 12 additions & 28 deletions apps/desktop/src/main/services/skills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ import { dirname, isAbsolute, join, resolve, sep } from 'path'
import { unzipSync } from 'fflate'
import { getConfig, getDevaHome, setConfig } from './config'
import { allowsPersona, getRoles, setRoles } from './ext-roles'
import { fmArray, fmMap, fmScalar, fmString, parseFrontmatter } from './frontmatter'
import { fmScalar, fmString, parseFrontmatter } from './frontmatter'
import { parseSkillDocument } from './skill-document-format'
import { BUILTIN_SKILL_CATALOG } from '../../shared/skill-catalog'

const [createSkillSummary, createAgentSummary, createMcpSummary] = BUILTIN_SKILL_CATALOG

/**
* 技能(Skills)服务:发现 / 解析 / 读写 `~/.deva/skills/<id>/SKILL.md`(全局,与项目无关)。
Expand Down Expand Up @@ -153,19 +157,15 @@ allowed-tools: run_command, read_file

/** 内置、不可删、恒启用的元技能,合成在代码里(永不落盘)。随 listSkills() 自动进系统提示词与 /create-skill。 */
const BUILTIN_CREATE_SKILL: SkillRecord = {
id: 'create-skill',
name: 'create-skill',
description:
'引导用户从零创建一个新技能:从用例规划脚本、参考文档、模板等资源,落盘、校验并启用(单文件调 create_skill,多文件直接写进技能目录)。',
...createSkillSummary,
trigger: '输入 /create-skill,或表达「帮我做/创建一个技能」时触发。',
allowedTools: ['create_skill', 'list_dir', 'write_file', 'read_file', 'run_command'],
license: '',
compatibility: '',
metadata: {},
instructions: CREATE_SKILL_INSTRUCTIONS,
enabled: true,
roles: null,
source: 'builtin'
roles: null
}

/**
Expand All @@ -191,18 +191,15 @@ const CREATE_AGENT_INSTRUCTIONS = `你正在帮助用户创建一个新的**角

/** 内置、不可删、恒启用的「对话创建角色」元技能。随 listSkills() 自动进系统提示词与 /create-agent。 */
const BUILTIN_CREATE_AGENT: SkillRecord = {
id: 'create-agent',
name: 'create-agent',
description: '引导用户用对话创建一个新角色:最多问一次厘清用途,随即调 propose_agent 生成名片供确认。',
...createAgentSummary,
trigger: '输入 /create-agent,或表达「帮我做/创建一个角色/性格/身份」时触发。',
allowedTools: ['propose_agent'],
license: '',
compatibility: '',
metadata: {},
instructions: CREATE_AGENT_INSTRUCTIONS,
enabled: true,
roles: null,
source: 'builtin'
roles: null
}

/**
Expand Down Expand Up @@ -231,18 +228,15 @@ const CREATE_MCP_INSTRUCTIONS = `你正在帮助用户接入一个新的 **MCP

/** 内置、不可删、恒启用的「对话接入 MCP 服务」元技能。随 listSkills() 自动进系统提示词与 /create-mcp。 */
const BUILTIN_CREATE_MCP: SkillRecord = {
id: 'create-mcp',
name: 'create-mcp',
description: '引导用户用对话接入一个 MCP 服务:厘清用途与传输方式、收集要素(密钥仅收字段名)、确认后调 create_mcp 工具落盘并启用。',
...createMcpSummary,
trigger: '输入 /create-mcp,或表达「帮我接入/添加/创建一个 MCP(服务)」时触发。',
allowedTools: ['create_mcp'],
license: '',
compatibility: '',
metadata: {},
instructions: CREATE_MCP_INSTRUCTIONS,
enabled: true,
roles: null,
source: 'builtin'
roles: null
}

/** 内置元技能按 id 索引(generalize:不同保留 id 返回各自的内置常量,勿一律返回 create-skill)。 */
Expand Down Expand Up @@ -307,18 +301,8 @@ function makeId(name: string): string {
}

function parseSkill(id: string, raw: string, enabled: boolean): SkillRecord {
const { data, body } = parseFrontmatter(raw)
const name = fmString(data, 'name') || id
return {
id,
name,
description: fmString(data, 'description'),
trigger: fmString(data, 'trigger'),
allowedTools: fmArray(data, 'allowed-tools'),
license: fmString(data, 'license'),
compatibility: fmString(data, 'compatibility'),
metadata: fmMap(data, 'metadata'),
instructions: body.trim(),
...parseSkillDocument(id, raw),
enabled,
roles: getRoles('skills', id),
source: 'custom'
Expand Down
66 changes: 18 additions & 48 deletions apps/desktop/src/renderer/src/redesign/SettingsPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { useEffect, useMemo, useRef, useState } from 'react'
import {
Brain,
ChevronLeft,
ChevronRight,
Cog,
Info,
Lock,
Expand All @@ -31,6 +30,7 @@ import { PersonaFace, parseAvatarSpec } from '../components/humation'
import { useTheme } from '../theme/ThemeContext'
import { readChatFontSize, saveChatFontSize, type ChatFontSize } from '../theme/chatFontSize'
import { SettingsFrame } from './SettingsFrame'
import { ExtensionSettingsRow, SkillSettingsDetail } from './SkillSettingsParts'
import { ModelSettings } from '../features/settings/ModelSettings'
import { clipName, IS_MAC, AvatarStack, Segmented, Toggle } from './shell-common'

Expand Down Expand Up @@ -224,37 +224,18 @@ function ExtensionsPane({
<div className="cf-empty">{t('cf.extEmpty')}</div>
) : (
<div className="cf-rows">
{items.map((x) => {
const name = (
<span className="cf-setrow__name">
<span className="cf-setrow__label" title={x.name}>
{x.name}
</span>
<span className="cf-badge">{x.badge}</span>
{x.note && (
<span className={`cf-setrow__note${x.noteWarn ? ' cf-setrow__note--warn' : ''}`}>
{x.note}
</span>
)}
</span>
)
return (
<div key={`${x.kind}:${x.id}`} className="cf-setrow">
{x.locked ? (
// 内置技能不展示详情:只读一行,开关禁用。
<div className="cf-setrow__main">{name}</div>
) : (
// 主区做按钮(点开详情),开关作兄弟节点独立触发(互不干扰)。
<button className="cf-setrow__open" onClick={() => setOpen({ kind: x.kind, id: x.id })}>
{name}
{x.roles !== undefined && <RolesBadge roles={x.roles} />}
<ChevronRight className="cf-setrow__chevron" size={15} />
</button>
)}
<Toggle on={x.enabled} disabled={x.locked} onChange={() => toggle(x.kind, x.id)} />
</div>
)
})}
{items.map((x) => (
<ExtensionSettingsRow
key={`${x.kind}:${x.id}`}
name={x.name}
badge={x.badge}
note={x.note}
noteWarn={x.noteWarn}
onOpen={x.locked ? undefined : () => setOpen({ kind: x.kind, id: x.id })}
accessory={x.roles !== undefined && <RolesBadge roles={x.roles} />}
toggle={<Toggle on={x.enabled} disabled={x.locked} onChange={() => toggle(x.kind, x.id)} />}
/>
))}
</div>
)}
</>
Expand Down Expand Up @@ -409,26 +390,15 @@ function SkillDetail({ item, onBack }: { item: Skill; onBack: () => void }): Rea
}

return (
<section className="provider-detail provider-detail--fill" key={item.id}>
<div className="provider-detail__topbar">
<button className="provider-detail__back" onClick={onBack}>
<ChevronLeft size={16} />
{t('common.back')}
</button>
<div className="provider-detail__spacer" />
<SkillSettingsDetail key={item.id} name={item.name} backLabel={t('common.back')} onBack={onBack} controls={
<>
<button className="icon-btn provider-detail__del" title={t('extensions.remove')} onClick={onDelete}>
<Trash2 size={15} />
</button>
<span className="provider-detail__enable">{t('extensions.enable')}</span>
<Toggle on={item.enabled} onChange={() => toggle('skill', item.id)} />
</div>
<header className="provider-detail__head">
<span className="ext-detail__icon">
<Puzzle size={18} />
</span>
<h2 className="ext-detail__name ext-detail__name--mono">{item.name}</h2>
</header>

</>
}>
<RolesPicker kind="skill" id={item.id} roles={item.roles} />

<div className="ext-field ext-field--grow">
Expand All @@ -441,7 +411,7 @@ function SkillDetail({ item, onBack }: { item: Skill; onBack: () => void }): Rea
<span className="ext-detail__muted">{t('extensions.instructionsEmpty')}</span>
)}
</div>
</section>
</SkillSettingsDetail>
)
}

Expand Down
Loading
Loading