@dsh-plus/agent-preset-rea 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +870 -52
- package/lib/index.d.ts +402 -9
- package/lib/index.js +1319 -203
- package/package.json +4 -3
- package/src/client/api.ts +77 -0
- package/src/client/card.tsx +39 -10
- package/src/client/client.ts +3 -3
- package/src/client/draft.ts +52 -6
- package/src/client/i18n.ts +135 -4
- package/src/client/install.tsx +373 -0
- package/src/client/styles.ts +27 -2
- package/src/client/toggles.tsx +57 -0
- package/src/config.ts +54 -14
- package/src/definition.ts +193 -136
- package/src/dto.ts +113 -0
- package/src/exec.ts +177 -0
- package/src/index.ts +115 -4
- package/src/jobs.ts +145 -0
- package/src/manager.ts +424 -0
- package/src/mcp.ts +47 -6
- package/src/reverse.ts +335 -0
- package/src/routes.ts +223 -0
- package/src/skill.ts +32 -7
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-plus/agent-preset-rea",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "dsh-plus service + UI plugin: 注册逆向工程 agent preset(id=rea)——官方 standard 全量行镜像 + 预设作用域的 REA MCP 客户端(mcp__rea__*)、随包 REA 官方 skill
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "dsh-plus service + UI plugin: 注册逆向工程 agent preset(id=rea)——官方 standard 全量行镜像 + 预设作用域的 REA MCP 客户端(mcp__rea__*)、随包 REA 官方 skill、提示词卡片与 REA/skill 的受管安装更新",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@dsh-plus/shared": "0.1.
|
|
35
|
+
"@dsh-plus/shared": "0.1.41"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@deepseek-ai/cordis": "^4.0.5-alpha.2",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@deepseek-ai/cordis": "4.0.5-alpha.2",
|
|
44
44
|
"@deepseek-ai/dsh-agent-preset-registry": "0.2.1-alpha.3",
|
|
45
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.1-alpha.3",
|
|
45
46
|
"@deepseek-ai/schemastery": "3.18.5-alpha.2",
|
|
46
47
|
"@types/react": "~18.3.31",
|
|
47
48
|
"react": "^18.2.0",
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 受管安装/更新的端点通道(状态查询 + 三类动作)。
|
|
3
|
+
* 配置读写仍走 `ctx.remote.settings` 直连(见 card.tsx),这里只补官方传输没有的动作。
|
|
4
|
+
*
|
|
5
|
+
* 响应都经类型谓词在边界收窄:宿主契约漂移时立即报错,而不是渲染期白屏。
|
|
6
|
+
* @module agent-preset-rea/client/api
|
|
7
|
+
*/
|
|
8
|
+
import { getJson, postJson } from '@dsh-plus/shared/client'
|
|
9
|
+
import type { JobActionDto, JobDto, JobKind, StatusDto } from '../dto.ts'
|
|
10
|
+
|
|
11
|
+
/** 载荷类型谓词(与 shared/client 的 fetch 同形;此处按本插件契约自持)。 */
|
|
12
|
+
type Guard<T> = (value: unknown) => value is T
|
|
13
|
+
|
|
14
|
+
const ROUTE_BASE = '/dsh-plus/agent-preset-rea'
|
|
15
|
+
|
|
16
|
+
/** JobDto 守卫。 */
|
|
17
|
+
function isJob(value: unknown): value is JobDto {
|
|
18
|
+
if (typeof value !== 'object' || value === null) return false
|
|
19
|
+
const job = value as Record<string, unknown>
|
|
20
|
+
return (
|
|
21
|
+
typeof job['id'] === 'number' &&
|
|
22
|
+
typeof job['kind'] === 'string' &&
|
|
23
|
+
typeof job['state'] === 'string' &&
|
|
24
|
+
Array.isArray(job['log']) &&
|
|
25
|
+
typeof job['progress'] === 'object' &&
|
|
26
|
+
job['progress'] !== null
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** StatusDto 守卫(结构性字段缺席即判不符)。 */
|
|
31
|
+
function isStatus(value: unknown): value is StatusDto {
|
|
32
|
+
if (typeof value !== 'object' || value === null) return false
|
|
33
|
+
const body = value as Record<string, unknown>
|
|
34
|
+
const install = body['install']
|
|
35
|
+
const skill = body['skill']
|
|
36
|
+
const mcp = body['mcp']
|
|
37
|
+
const reverse = body['reverse']
|
|
38
|
+
return (
|
|
39
|
+
typeof install === 'object' &&
|
|
40
|
+
install !== null &&
|
|
41
|
+
typeof skill === 'object' &&
|
|
42
|
+
skill !== null &&
|
|
43
|
+
typeof mcp === 'object' &&
|
|
44
|
+
mcp !== null &&
|
|
45
|
+
typeof reverse === 'object' &&
|
|
46
|
+
reverse !== null &&
|
|
47
|
+
typeof body['config'] === 'object' &&
|
|
48
|
+
body['config'] !== null
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** JobActionDto 守卫。 */
|
|
53
|
+
const isJobAction: Guard<JobActionDto> = (value: unknown): value is JobActionDto => {
|
|
54
|
+
if (typeof value !== 'object' || value === null) return false
|
|
55
|
+
const job = (value as Record<string, unknown>)['job']
|
|
56
|
+
return job === null || job === undefined || isJob(job)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** 查询安装/skill/MCP 行状态与当前作业。 */
|
|
60
|
+
export async function fetchStatus(): Promise<StatusDto> {
|
|
61
|
+
return getJson<StatusDto>(`${ROUTE_BASE}/status`, isStatus)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 启动作业。
|
|
66
|
+
* @param kind - `install` = 安装/更新 REA 包;`skill` = 更新 REA skill 副本;
|
|
67
|
+
* `reverse` = 更新 reverse-skill(GitHub 源)。
|
|
68
|
+
* @param proxyPort - 草稿里当前填的代理端口(未保存也即时生效)。
|
|
69
|
+
*/
|
|
70
|
+
export async function startJob(kind: JobKind, proxyPort: number): Promise<JobActionDto> {
|
|
71
|
+
return postJson<JobActionDto>(`${ROUTE_BASE}/${kind}`, { proxyPort }, isJobAction)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** 取消当前作业。 */
|
|
75
|
+
export async function cancelJob(): Promise<JobActionDto> {
|
|
76
|
+
return postJson<JobActionDto>(`${ROUTE_BASE}/cancel`, undefined, isJobAction)
|
|
77
|
+
}
|
package/src/client/card.tsx
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 「逆向工程」预设配置卡片:提示词(活动字段)+ 代理端口(活动字段)+ 安装维护区。
|
|
3
3
|
*
|
|
4
4
|
* 经 injectPluginConfigCard 注册(插件页 plugins.row.config / plugins.bundle.config,
|
|
5
5
|
* view 分发 summary/page);外壳与草稿语义走 @dsh-plus/shared/client 套件
|
|
6
6
|
* (CardChrome + useNamespaceDraft:staged 草稿、脏判定、revision fencing、
|
|
7
|
-
* Host
|
|
7
|
+
* Host 更新不覆盖在途编辑),安装维护区见 client/install.tsx。
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* 五个活动字段(`Config` 里标 `.volatile()` 的)都在这里给出编辑器:
|
|
10
|
+
* - `personaPrefix`:system-prompt 的 persona 前缀段;
|
|
11
|
+
* - `proxyPort`:安装/更新时的本机代理端口;
|
|
12
|
+
* - `mcpEnabled` / `skillEnabled` / `reverseSkillEnabled`:三个能力开关(见 toggles.tsx)。
|
|
13
|
+
* 其余字段(受管目录、版本钉、skill 组、MCP 参数、超时、附加 skill 根)属部署方平面,
|
|
14
|
+
* 由 profile 的 cordis.patch.yml 行级配置覆盖,卡片只读展示关键事实。
|
|
15
|
+
*
|
|
16
|
+
* 安装维护为什么不放在注册期自动做:启动期 `npx`/npm 安装会跑依赖安装脚本
|
|
17
|
+
* (原生 prebuild 下载),卡住即吊死预设激活与整个名册;因此改成显式动作
|
|
18
|
+
* ——后台作业 + 轮询实时进度,作业完成后宿主半换代注册,新建会话即用新事实。
|
|
14
19
|
* @module agent-preset-rea/client/card
|
|
15
20
|
*/
|
|
16
21
|
|
|
@@ -21,11 +26,15 @@ import {
|
|
|
21
26
|
type NamespaceSettingsApi,
|
|
22
27
|
type PluginConfigViewProps,
|
|
23
28
|
type Scope,
|
|
29
|
+
TextField,
|
|
24
30
|
useNamespaceDraft,
|
|
25
31
|
} from '@dsh-plus/shared/client'
|
|
26
32
|
import type { ReactElement } from 'react'
|
|
27
|
-
|
|
33
|
+
|
|
34
|
+
import { type ConfigValue, type Draft, draftFromValue, parseProxyPort, toPatch } from './draft.ts'
|
|
28
35
|
import type { Translate } from './i18n.ts'
|
|
36
|
+
import { InstallSection } from './install.tsx'
|
|
37
|
+
import { ToggleSection } from './toggles.tsx'
|
|
29
38
|
|
|
30
39
|
export interface CardProps extends PluginConfigViewProps {
|
|
31
40
|
t: Translate
|
|
@@ -33,12 +42,13 @@ export interface CardProps extends PluginConfigViewProps {
|
|
|
33
42
|
api: NamespaceSettingsApi
|
|
34
43
|
}
|
|
35
44
|
|
|
36
|
-
/** 卡片动作:放弃 /
|
|
45
|
+
/** 卡片动作:放弃 / 保存(脏且可写且输入合法时才可用)。 */
|
|
37
46
|
function cardActions(options: {
|
|
38
47
|
t: Translate
|
|
39
48
|
dirty: boolean
|
|
40
49
|
saving: boolean
|
|
41
50
|
disabled: boolean
|
|
51
|
+
invalid: boolean
|
|
42
52
|
onDiscard(): void
|
|
43
53
|
onSave(): void
|
|
44
54
|
}): CardAction[] {
|
|
@@ -53,7 +63,7 @@ function cardActions(options: {
|
|
|
53
63
|
key: 'save',
|
|
54
64
|
label: options.t(options.saving ? 'saving' : 'save'),
|
|
55
65
|
variant: 'primary',
|
|
56
|
-
disabled: !options.dirty || options.saving || options.disabled,
|
|
66
|
+
disabled: !options.dirty || options.saving || options.disabled || options.invalid,
|
|
57
67
|
onClick: options.onSave,
|
|
58
68
|
},
|
|
59
69
|
]
|
|
@@ -78,6 +88,7 @@ export function ReaCard(props: CardProps): ReactElement | string | null {
|
|
|
78
88
|
}
|
|
79
89
|
|
|
80
90
|
const disabled = state.disabled
|
|
91
|
+
const port = parseProxyPort(draft.proxyPort)
|
|
81
92
|
return (
|
|
82
93
|
<CardChrome
|
|
83
94
|
prefix="apr"
|
|
@@ -92,6 +103,7 @@ export function ReaCard(props: CardProps): ReactElement | string | null {
|
|
|
92
103
|
dirty: state.dirty,
|
|
93
104
|
saving: state.saving,
|
|
94
105
|
disabled,
|
|
106
|
+
invalid: port === null,
|
|
95
107
|
onDiscard: state.reset,
|
|
96
108
|
onSave: state.save,
|
|
97
109
|
})}
|
|
@@ -115,6 +127,23 @@ export function ReaCard(props: CardProps): ReactElement | string | null {
|
|
|
115
127
|
<p className="apr-hint">{t('promptHint')}</p>
|
|
116
128
|
{draft.personaPrefix.trim() === '' ? <p className="apr-hint">{t('promptEmpty')}</p> : null}
|
|
117
129
|
</div>
|
|
130
|
+
|
|
131
|
+
<TextField
|
|
132
|
+
prefix="apr"
|
|
133
|
+
id="apr-proxy"
|
|
134
|
+
label={t('proxyPort')}
|
|
135
|
+
hint={t('proxyPortHint')}
|
|
136
|
+
invalid={port === null}
|
|
137
|
+
invalidLabel={t('proxyPortInvalid')}
|
|
138
|
+
numeric
|
|
139
|
+
value={draft.proxyPort}
|
|
140
|
+
disabled={disabled}
|
|
141
|
+
onEdit={(text) => state.edit({ proxyPort: text })}
|
|
142
|
+
/>
|
|
143
|
+
|
|
144
|
+
<ToggleSection t={t} draft={draft} disabled={disabled} onEdit={state.edit} />
|
|
145
|
+
|
|
146
|
+
<InstallSection t={t} disabled={disabled} proxyPort={port} />
|
|
118
147
|
</CardChrome>
|
|
119
148
|
)
|
|
120
149
|
}
|
package/src/client/client.ts
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* 构建产物为 window.__ModuleLoader__.load({id, factory}) 形式的 CJS factory
|
|
5
5
|
* (包装见 tsdown.config.ts);样式沿用官方 data-plugin-css 约定,HMR 据此卸载。
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* `ctx.remote.settings
|
|
9
|
-
*
|
|
7
|
+
* 卡片编辑五个活动字段(`personaPrefix`、`proxyPort` 与 mcp/skill/reverse 三个开关),
|
|
8
|
+
* 并驱动宿主半的受管安装/更新作业(同源自定义端点,见 client/api.ts);配置读写经共享层直连 `ctx.remote.settings`
|
|
9
|
+
* (官方 `settingsScope` 服务不存在、由 `configForms` 取代),与 notify-email 同机制。
|
|
10
10
|
* @module @dsh-plus/agent-preset-rea/client
|
|
11
11
|
*/
|
|
12
12
|
import type { Context } from '@deepseek-ai/cordis'
|
package/src/client/draft.ts
CHANGED
|
@@ -1,28 +1,74 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 卡片草稿的纯逻辑(无 JSX,node --test 可直接测):命名空间解析值 ⇄ 编辑草稿。
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* 卡片编辑五个活动字段(`personaPrefix` 提示词、`proxyPort` 安装代理端口、
|
|
5
|
+
* `mcpEnabled` / `skillEnabled` / `reverseSkillEnabled` 三个能力开关),其余字段
|
|
6
|
+
* 属部署方平面不进卡片;命名空间值是整行配置的脱敏视图,读取时按字段收窄:
|
|
7
|
+
* 值缺席或类型不符一律回落默认(提示词空串、代理 0、开关 true)。
|
|
8
|
+
*
|
|
9
|
+
* 代理端口以文本承载:越界/非法不静默改写,标 `invalid` 并禁用保存(见 card.tsx),
|
|
10
|
+
* 避免「输入 99999 被悄悄存成 65535」这类静默数据损坏。
|
|
7
11
|
* @module agent-preset-rea/client/draft
|
|
8
12
|
*/
|
|
9
13
|
|
|
10
14
|
/** 命名空间解析值中本卡片消费的部分。 */
|
|
11
15
|
export interface ConfigValue {
|
|
12
16
|
personaPrefix?: unknown
|
|
17
|
+
proxyPort?: unknown
|
|
18
|
+
mcpEnabled?: unknown
|
|
19
|
+
skillEnabled?: unknown
|
|
20
|
+
reverseSkillEnabled?: unknown
|
|
13
21
|
}
|
|
14
22
|
|
|
15
23
|
/** 编辑草稿。 */
|
|
16
24
|
export interface Draft {
|
|
17
25
|
personaPrefix: string
|
|
26
|
+
/** 代理端口文本(空串与 `'0'` 都表示不用代理)。 */
|
|
27
|
+
proxyPort: string
|
|
28
|
+
/** 三个能力开关(REA MCP 行 / REA skill / reverse-skill)。 */
|
|
29
|
+
mcpEnabled: boolean
|
|
30
|
+
skillEnabled: boolean
|
|
31
|
+
reverseSkillEnabled: boolean
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** 布尔字段收窄(缺席或类型不符回落默认值)。 */
|
|
35
|
+
function boolOf(value: unknown, fallback: boolean): boolean {
|
|
36
|
+
return typeof value === 'boolean' ? value : fallback
|
|
18
37
|
}
|
|
19
38
|
|
|
20
|
-
/**
|
|
39
|
+
/** 代理端口上限。 */
|
|
40
|
+
export const PROXY_PORT_MAX = 65535
|
|
41
|
+
|
|
42
|
+
/** 解析值 → 草稿(类型不符一律回落默认)。 */
|
|
21
43
|
export function draftFromValue(value: ConfigValue): Draft {
|
|
22
|
-
return {
|
|
44
|
+
return {
|
|
45
|
+
personaPrefix: typeof value.personaPrefix === 'string' ? value.personaPrefix : '',
|
|
46
|
+
proxyPort: typeof value.proxyPort === 'number' ? String(value.proxyPort) : '',
|
|
47
|
+
mcpEnabled: boolOf(value.mcpEnabled, true),
|
|
48
|
+
skillEnabled: boolOf(value.skillEnabled, true),
|
|
49
|
+
reverseSkillEnabled: boolOf(value.reverseSkillEnabled, true),
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 代理端口文本 → 端口号。
|
|
55
|
+
* @returns 空串按 0(不用代理);非纯数字或越界返回 null(调用方据此判非法)。
|
|
56
|
+
*/
|
|
57
|
+
export function parseProxyPort(text: string): number | null {
|
|
58
|
+
const trimmed = text.trim()
|
|
59
|
+
if (trimmed === '') return 0
|
|
60
|
+
if (!/^\d+$/.test(trimmed)) return null
|
|
61
|
+
const port = Number(trimmed)
|
|
62
|
+
return Number.isInteger(port) && port >= 0 && port <= PROXY_PORT_MAX ? port : null
|
|
23
63
|
}
|
|
24
64
|
|
|
25
65
|
/** 草稿 → 提交形状(只回写本卡片负责的字段)。 */
|
|
26
66
|
export function toPatch(draft: Draft): Record<string, unknown> {
|
|
27
|
-
return {
|
|
67
|
+
return {
|
|
68
|
+
personaPrefix: draft.personaPrefix,
|
|
69
|
+
proxyPort: parseProxyPort(draft.proxyPort) ?? 0,
|
|
70
|
+
mcpEnabled: draft.mcpEnabled,
|
|
71
|
+
skillEnabled: draft.skillEnabled,
|
|
72
|
+
reverseSkillEnabled: draft.reverseSkillEnabled,
|
|
73
|
+
}
|
|
28
74
|
}
|
package/src/client/i18n.ts
CHANGED
|
@@ -9,21 +9,86 @@ export const NS = 'dsh-plus-agent-preset-rea'
|
|
|
9
9
|
|
|
10
10
|
const ownZh = {
|
|
11
11
|
title: '逆向工程预设',
|
|
12
|
-
description: 'REA
|
|
13
|
-
summaryLine: '
|
|
12
|
+
description: 'REA 提示词与安装维护:提示词留空即空 persona,工具指引与运行时上下文照常注入。',
|
|
13
|
+
summaryLine: '编辑「逆向工程」预设的提示词、开关 REA MCP 与两类 skill,并安装/更新',
|
|
14
14
|
prompt: '系统提示词(persona 前缀)',
|
|
15
15
|
promptHint:
|
|
16
16
|
'写入 system-prompt 的 persona 前缀段,仅对「逆向工程」预设的新会话生效;留空 = 不注入 persona 段(官方工具指引、项目指令与运行时上下文不受影响)。保存后新建会话即用新值。',
|
|
17
17
|
promptPlaceholder: '例如:先做证据分级,再动手改二进制;每一步给出可复核的证据链……',
|
|
18
18
|
promptEmpty: '当前为空:该预设不注入 persona 段。',
|
|
19
19
|
saveFailed: '保存失败:',
|
|
20
|
+
|
|
21
|
+
installSection: 'REA 安装与更新',
|
|
22
|
+
installHint:
|
|
23
|
+
'安装/更新在后台执行:把 rea-agents 装进下面的受管目录(先装 staging 再换目录,失败不留半截安装树),作业完成后本预设自动换代——新建会话即带 mcp__rea__* 工具。安装位置与 MCP 命令属部署方平面(profile 的 cordis.patch.yml),此处只读展示。',
|
|
24
|
+
installPackage: 'REA 包',
|
|
25
|
+
installPath: '受管安装目录',
|
|
26
|
+
installVersion: '版本',
|
|
27
|
+
installTarget: '目标版本',
|
|
28
|
+
installed: '已安装',
|
|
29
|
+
notInstalled: '未安装',
|
|
30
|
+
skillSource: 'REA skill',
|
|
31
|
+
skillBundled: '随包副本',
|
|
32
|
+
skillUpdated: '手动更新副本',
|
|
33
|
+
skillFiles: '文件',
|
|
34
|
+
updatedAt: '更新时间',
|
|
35
|
+
mcpRow: 'MCP 行',
|
|
36
|
+
mcpInstalled: '已挂载(受管安装入口)',
|
|
37
|
+
mcpCustom: '已挂载(显式 mcpCommand)',
|
|
38
|
+
mcpMissing: '未挂载:未安装 REA,该行已禁用(不会在启动期拉取)',
|
|
39
|
+
mcpOff: '已按配置关闭',
|
|
40
|
+
commandLabel: '命令',
|
|
41
|
+
refreshStatus: '刷新状态',
|
|
42
|
+
installAction: '安装 / 更新 REA',
|
|
43
|
+
skillAction: '更新 skill',
|
|
44
|
+
cancelAction: '取消作业',
|
|
45
|
+
statusLoading: '正在读取安装状态…',
|
|
46
|
+
statusFailed: '状态查询失败:',
|
|
47
|
+
actionFailed: '操作失败:',
|
|
48
|
+
jobRunning: '作业进行中',
|
|
49
|
+
jobOk: '作业完成',
|
|
50
|
+
jobError: '作业失败',
|
|
51
|
+
jobCancelled: '作业已取消',
|
|
52
|
+
jobInstall: '安装 REA',
|
|
53
|
+
jobSkill: '更新 skill',
|
|
54
|
+
jobPhase: '阶段',
|
|
55
|
+
jobLog: '日志',
|
|
56
|
+
jobStartedAt: '开始于',
|
|
57
|
+
jobFinishedAt: '结束于',
|
|
58
|
+
jobElapsed: '已用时',
|
|
59
|
+
jobLogEmpty: '(暂无输出)',
|
|
60
|
+
|
|
61
|
+
toggleSection: '能力开关',
|
|
62
|
+
toggleMcp: 'REA MCP 工具(mcp__rea__*)',
|
|
63
|
+
toggleMcpHint:
|
|
64
|
+
'关掉即从本预设摘掉 REA MCP 行,模型面看不到 mcp__rea__* 工具;REA 仍留在磁盘上,随时可开回来(保存后新建会话生效)。',
|
|
65
|
+
toggleSkill: 'REA 官方 skill',
|
|
66
|
+
toggleSkillHint:
|
|
67
|
+
'关掉即不挂 REA 官方 skill 根(reverse-engineer-anything),其余 skill 根不受影响。',
|
|
68
|
+
toggleReverse: 'reverse-skill 技能包',
|
|
69
|
+
toggleReverseHint:
|
|
70
|
+
'关掉即不挂 zhaoxuya520/reverse-skill 的技能组(默认挂主包根:路由技能 + 各模块技能);安装副本仍在,可从下面重新更新。',
|
|
71
|
+
enabled: '已挂载',
|
|
72
|
+
disabled: '已关闭',
|
|
73
|
+
reverseSource: 'reverse-skill',
|
|
74
|
+
reverseCommit: '提交',
|
|
75
|
+
reverseGroups: '技能组',
|
|
76
|
+
reverseGroupsHint: '树内可选组:',
|
|
77
|
+
reversePath: '技能包目录',
|
|
78
|
+
reverseAction: '更新 reverse-skill',
|
|
79
|
+
jobReverse: '更新 reverse-skill',
|
|
80
|
+
|
|
81
|
+
proxyPort: '安装代理端口',
|
|
82
|
+
proxyPortHint:
|
|
83
|
+
'安装/更新时供 npm 与原生依赖(node-pty)prebuild 下载使用的本机代理端口;0 或留空 = 直连。未保存也用于本次安装,保存后长期生效。',
|
|
84
|
+
proxyPortInvalid: '代理端口必须是 0..65535 的整数。',
|
|
20
85
|
} as const
|
|
21
86
|
|
|
22
87
|
const ownEn = {
|
|
23
88
|
title: 'Reverse-engineering preset',
|
|
24
89
|
description:
|
|
25
|
-
'REA prompt:
|
|
26
|
-
summaryLine: 'Edit the
|
|
90
|
+
'REA prompt and installation: an empty prompt means a blank persona; tool guidance and runtime context stay in place.',
|
|
91
|
+
summaryLine: 'Edit the “逆向工程” prompt, toggle REA MCP/skills, install and update them',
|
|
27
92
|
prompt: 'System prompt (persona prefix)',
|
|
28
93
|
promptHint:
|
|
29
94
|
'Written to the persona-prefix section of the system prompt for new sessions of this preset only. Empty means no persona section (official tool guidance, project instructions and runtime context are unaffected). New sessions pick up the saved value.',
|
|
@@ -31,6 +96,72 @@ const ownEn = {
|
|
|
31
96
|
'e.g. Grade the evidence first, then patch the binary; every step needs a checkable chain of evidence…',
|
|
32
97
|
promptEmpty: 'Currently empty: this preset injects no persona section.',
|
|
33
98
|
saveFailed: 'Save failed: ',
|
|
99
|
+
|
|
100
|
+
installSection: 'REA installation',
|
|
101
|
+
installHint:
|
|
102
|
+
'Install/update runs in the background: rea-agents goes into the managed directory below (staged install, then directory swap, so a failure leaves no half tree). When the job finishes the preset re-registers — new sessions get the mcp__rea__* tools. The install location and MCP command belong to the deployment plane (profile cordis.patch.yml) and are shown read-only.',
|
|
103
|
+
installPackage: 'REA package',
|
|
104
|
+
installPath: 'Managed install dir',
|
|
105
|
+
installVersion: 'Version',
|
|
106
|
+
installTarget: 'Target version',
|
|
107
|
+
installed: 'Installed',
|
|
108
|
+
notInstalled: 'Not installed',
|
|
109
|
+
skillSource: 'REA skill',
|
|
110
|
+
skillBundled: 'Bundled copy',
|
|
111
|
+
skillUpdated: 'Manually updated copy',
|
|
112
|
+
skillFiles: 'Files',
|
|
113
|
+
updatedAt: 'Updated at',
|
|
114
|
+
mcpRow: 'MCP row',
|
|
115
|
+
mcpInstalled: 'Mounted (managed install entry)',
|
|
116
|
+
mcpCustom: 'Mounted (explicit mcpCommand)',
|
|
117
|
+
mcpMissing:
|
|
118
|
+
'Not mounted: REA is not installed, the row stays disabled (nothing is fetched at boot)',
|
|
119
|
+
mcpOff: 'Disabled by config',
|
|
120
|
+
commandLabel: 'Command',
|
|
121
|
+
refreshStatus: 'Refresh status',
|
|
122
|
+
installAction: 'Install / update REA',
|
|
123
|
+
skillAction: 'Update skill',
|
|
124
|
+
cancelAction: 'Cancel job',
|
|
125
|
+
statusLoading: 'Reading install status…',
|
|
126
|
+
statusFailed: 'Status query failed: ',
|
|
127
|
+
actionFailed: 'Action failed: ',
|
|
128
|
+
jobRunning: 'Job running',
|
|
129
|
+
jobOk: 'Job finished',
|
|
130
|
+
jobError: 'Job failed',
|
|
131
|
+
jobCancelled: 'Job cancelled',
|
|
132
|
+
jobInstall: 'Install REA',
|
|
133
|
+
jobSkill: 'Update skill',
|
|
134
|
+
jobPhase: 'Phase',
|
|
135
|
+
jobLog: 'Log',
|
|
136
|
+
jobStartedAt: 'Started',
|
|
137
|
+
jobFinishedAt: 'Finished',
|
|
138
|
+
jobElapsed: 'Elapsed',
|
|
139
|
+
jobLogEmpty: '(no output yet)',
|
|
140
|
+
|
|
141
|
+
toggleSection: 'Capability switches',
|
|
142
|
+
toggleMcp: 'REA MCP tools (mcp__rea__*)',
|
|
143
|
+
toggleMcpHint:
|
|
144
|
+
'Turning this off drops the REA MCP row from this preset, so mcp__rea__* tools disappear; REA stays on disk and can be switched back on. New sessions pick up the change.',
|
|
145
|
+
toggleSkill: 'REA official skill',
|
|
146
|
+
toggleSkillHint:
|
|
147
|
+
'Turning this off unmounts the bundled REA skill root (reverse-engineer-anything); other skill roots are unaffected.',
|
|
148
|
+
toggleReverse: 'reverse-skill pack',
|
|
149
|
+
toggleReverseHint:
|
|
150
|
+
'Turning this off unmounts the skill groups of zhaoxuya520/reverse-skill (the main pack root is mounted by default: router skill plus module skills). The installed copy stays on disk and can be updated again below.',
|
|
151
|
+
enabled: 'Mounted',
|
|
152
|
+
disabled: 'Off',
|
|
153
|
+
reverseSource: 'reverse-skill',
|
|
154
|
+
reverseCommit: 'Commit',
|
|
155
|
+
reverseGroups: 'Skill groups',
|
|
156
|
+
reverseGroupsHint: 'Available in tree: ',
|
|
157
|
+
reversePath: 'Pack directory',
|
|
158
|
+
reverseAction: 'Update reverse-skill',
|
|
159
|
+
jobReverse: 'Update reverse-skill',
|
|
160
|
+
|
|
161
|
+
proxyPort: 'Install proxy port',
|
|
162
|
+
proxyPortHint:
|
|
163
|
+
'Local proxy port used by npm and by the native node-pty prebuild download during install/update; 0 or empty means direct. The unsaved value is used for the next install and applies permanently once saved.',
|
|
164
|
+
proxyPortInvalid: 'Proxy port must be an integer in 0..65535.',
|
|
34
165
|
} as const
|
|
35
166
|
|
|
36
167
|
export type DictKey = keyof typeof commonZh | keyof typeof ownZh
|